From: Andrea Bianco Date: Sun, 9 May 2021 10:07:41 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.5.27 X-Git-Tag: 2.5.27 X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=1562546be7bf64ba323d0927837b2b20dc380166;p=motion2.git Built motion from commit (unavailable).|2.5.27 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index b747213..2a3cfde 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1,6 +1,6 @@ define({ "name": "xCALLY Motion API", - "version": "2.5.26", + "version": "2.5.27", "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": "2021-05-07T09:30:04.130Z", + "time": "2021-05-09T10:00:40.830Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index ffa774e..6a9afd5 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1,6 +1,6 @@ { "name": "xCALLY Motion API", - "version": "2.5.26", + "version": "2.5.27", "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": "2021-05-07T09:30:04.130Z", + "time": "2021-05-09T10:00:40.830Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/package.json b/package.json index 4458090..fa4bbbb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.5.26", + "version": "2.5.27", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { @@ -12,22 +12,23 @@ }, "author": "xCALLY Team", "contributors": [ - "Giuseppe Careri ", + "Giuseppe Careri ", "Daniele Cinti ", "Innocenzo Biondo ", - "Massimiliano Bungaro ", - "Andrea Bianco ", - "Fabio Lodato ", - "Andrea Cuccaro ", + "Massimiliano Bungaro ", + "Andrea Bianco ", + "Fabio Lodato ", + "Andrea Cuccaro ", "Donatella Soldi ", "Afnan Imtiaz ", "Cristian Di Sclafani ", "Marco Giraldi ", "Giulia Trombin ", - "Cristopher Fasolin ", - "Marco Messina ", - "Vito Macchia ", - "Marco Lecce " + "Cristopher Fasolin ", + "Marco Messina ", + "Vito Macchia ", + "Marco Lecce ", + "Rodolfo Bevione " ], "private": true, "license": "EULA", @@ -61,6 +62,7 @@ "express-winston": "2.6.0", "extract-zip": "1.7.0", "fast-json-patch": "1.2.2", + "fs-extra": "1.0.0", "google-tts-api": "github:xmdevelop/google-tts", "grpc": "1.24.6", "html-to-pdfmake": "^2.1.7", diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 161d541..ac60cdb 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 _0xae06=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','browser','bot'];(function(_0xb1aa53,_0x17396b){var _0x37e8ec=function(_0x51df8e){while(--_0x51df8e){_0xb1aa53['push'](_0xb1aa53['shift']());}};_0x37e8ec(++_0x17396b);}(_0xae06,0x1d6));var _0x6ae0=function(_0x5548fe,_0x3efc3f){_0x5548fe=_0x5548fe-0x0;var _0xc1c1f2=_0xae06[_0x5548fe];return _0xc1c1f2;};'use strict';var Sequelize=require('sequelize');module[_0x6ae0('0x0')]={'name':{'type':Sequelize[_0x6ae0('0x1')],'get':function(_0x2db3fd){return this[_0x6ae0('0x2')](_0x6ae0('0x3'));}},'action':{'type':Sequelize[_0x6ae0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6ae0('0x5'),_0x6ae0('0x6'),_0x6ae0('0x7'),'jscripty','urlForward',_0x6ae0('0x8'),_0x6ae0('0x9'),_0x6ae0('0xa')]],'msg':_0x6ae0('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x6ae0('0x4')](0x1000),'comment':_0x6ae0('0xc')},'data2':{'type':Sequelize[_0x6ae0('0x4')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x6ae0('0xd')},'data4':{'type':Sequelize[_0x6ae0('0x4')](0x1000)},'data5':{'type':Sequelize[_0x6ae0('0x4')](0x1000)},'data6':{'type':Sequelize[_0x6ae0('0x4')]},'data7':{'type':Sequelize[_0x6ae0('0xe')]}}; \ No newline at end of file +var _0x2f17=['integration','jscripty','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','getDataValue','STRING','contactManager'];(function(_0x294846,_0x1aefe2){var _0x4aeedf=function(_0x5065fb){while(--_0x5065fb){_0x294846['push'](_0x294846['shift']());}};_0x4aeedf(++_0x1aefe2);}(_0x2f17,0x8d));var _0x72f1=function(_0x3bc0c3,_0x2d9c9a){_0x3bc0c3=_0x3bc0c3-0x0;var _0x18c615=_0x2f17[_0x3bc0c3];return _0x18c615;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1647b1){return this[_0x72f1('0x0')]('action');}},'action':{'type':Sequelize[_0x72f1('0x1')],'allowNull':![],'validate':{'isIn':{'args':[[_0x72f1('0x2'),_0x72f1('0x3'),'motionbar',_0x72f1('0x4'),_0x72f1('0x5'),_0x72f1('0x6'),'bot','script']],'msg':_0x72f1('0x7')}},'comment':_0x72f1('0x7')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x72f1('0x8')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x72f1('0x9')},'data3':{'type':Sequelize[_0x72f1('0x1')](0x1000),'comment':_0x72f1('0xa')},'data4':{'type':Sequelize[_0x72f1('0x1')](0x1000)},'data5':{'type':Sequelize[_0x72f1('0x1')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x72f1('0xb')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index b83f3c9..365a845 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 _0x7918=['name','send','update','body','find','params','catch','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack'];(function(_0x1b4114,_0x12c63e){var _0x2bac1d=function(_0x9ffb15){while(--_0x9ffb15){_0x1b4114['push'](_0x1b4114['shift']());}};_0x2bac1d(++_0x12c63e);}(_0x7918,0x1e1));var _0x8791=function(_0x451af0,_0x41d423){_0x451af0=_0x451af0-0x0;var _0x5d579d=_0x7918[_0x451af0];return _0x5d579d;};'use strict';var emlformat=require(_0x8791('0x0'));var rimraf=require(_0x8791('0x1'));var zipdir=require(_0x8791('0x2'));var jsonpatch=require(_0x8791('0x3'));var rp=require(_0x8791('0x4'));var moment=require(_0x8791('0x5'));var BPromise=require(_0x8791('0x6'));var Mustache=require(_0x8791('0x7'));var util=require('util');var path=require(_0x8791('0x8'));var sox=require(_0x8791('0x9'));var csv=require(_0x8791('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8791('0xb'));var crypto=require(_0x8791('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8791('0xd'));var Papa=require(_0x8791('0xe'));var Redis=require(_0x8791('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8791('0x10'));var as=require(_0x8791('0x11'));var hardwareService=require(_0x8791('0x12'));var logger=require('../../config/logger')(_0x8791('0x13'));var utils=require('../../config/utils');var config=require(_0x8791('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20b190,_0x42000e){_0x42000e=_0x42000e||0xcc;return function(_0x313273){if(_0x313273){return _0x20b190[_0x8791('0x15')](_0x42000e);}return _0x20b190['status'](_0x42000e)[_0x8791('0x16')]();};}function respondWithResult(_0x2b42db,_0x32d001){_0x32d001=_0x32d001||0xc8;return function(_0x5cb392){if(_0x5cb392){return _0x2b42db[_0x8791('0x17')](_0x32d001)[_0x8791('0x18')](_0x5cb392);}};}function respondWithFilteredResult(_0xc74b91,_0x58b131){return function(_0x53600b){if(_0x53600b){var _0xc85c60=_0x53600b['count'],_0x5d82b2=_0x58b131[_0x8791('0x19')],_0x5b28c6=_0x58b131[_0x8791('0x19')]+_0x58b131[_0x8791('0x1a')],_0x5df9fb;if(_0x5b28c6>=_0xc85c60){_0x5b28c6=_0xc85c60;_0x5df9fb=0xc8;}else{_0x5df9fb=0xce;}_0xc74b91['status'](_0x5df9fb);return _0xc74b91[_0x8791('0x1b')](_0x8791('0x1c'),_0x5d82b2+'-'+_0x5b28c6+'/'+_0xc85c60)[_0x8791('0x18')](_0x53600b);}return null;};}function patchUpdates(_0x204b4e){return function(_0x61b79a){try{jsonpatch[_0x8791('0x1d')](_0x61b79a,_0x204b4e,!![]);}catch(_0xb6e262){return BPromise[_0x8791('0x1e')](_0xb6e262);}return _0x61b79a[_0x8791('0x1f')]();};}function saveUpdates(_0x1003f9,_0xb37712){return function(_0x4ae9d0){if(_0x4ae9d0){return _0x4ae9d0['update'](_0x1003f9)[_0x8791('0x20')](function(_0x4a1fc8){return _0x4a1fc8;});}return null;};}function removeEntity(_0x5e25de,_0x5eade7){return function(_0x9d6d90){if(_0x9d6d90){return _0x9d6d90[_0x8791('0x21')]()[_0x8791('0x20')](function(){_0x5e25de[_0x8791('0x17')](0xcc)[_0x8791('0x16')]();});}};}function handleEntityNotFound(_0x17b090,_0x17329f){return function(_0x5afddd){if(!_0x5afddd){_0x17b090[_0x8791('0x15')](0x194);}return _0x5afddd;};}function handleError(_0x5587e8,_0x2e2343){_0x2e2343=_0x2e2343||0x1f4;return function(_0x372fa2){logger['error'](_0x372fa2[_0x8791('0x22')]);if(_0x372fa2[_0x8791('0x23')]){delete _0x372fa2[_0x8791('0x23')];}_0x5587e8['status'](_0x2e2343)[_0x8791('0x24')](_0x372fa2);};}exports[_0x8791('0x25')]=function(_0x2d1ba7,_0x2329c6){if(_0x2d1ba7['body']['id']){delete _0x2d1ba7[_0x8791('0x26')]['id'];}return db['Action'][_0x8791('0x27')]({'where':{'id':_0x2d1ba7[_0x8791('0x28')]['id']}})[_0x8791('0x20')](handleEntityNotFound(_0x2329c6,null))['then'](saveUpdates(_0x2d1ba7['body'],null))['then'](respondWithResult(_0x2329c6,null))[_0x8791('0x29')](handleError(_0x2329c6,null));};exports[_0x8791('0x21')]=function(_0x25f6e8,_0xcca0ae){return db[_0x8791('0x2a')][_0x8791('0x27')]({'where':{'id':_0x25f6e8[_0x8791('0x28')]['id']}})[_0x8791('0x20')](handleEntityNotFound(_0xcca0ae,null))[_0x8791('0x20')](removeEntity(_0xcca0ae,null))['catch'](handleError(_0xcca0ae,null));}; \ No newline at end of file +var _0xce14=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','body','Action','find','params','catch','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x5c6e8c,_0x154b65){var _0x5e1f24=function(_0x17d3a4){while(--_0x17d3a4){_0x5c6e8c['push'](_0x5c6e8c['shift']());}};_0x5e1f24(++_0x154b65);}(_0xce14,0x17f));var _0x4ce1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xce14[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ce1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ce1('0x1'));var rp=require(_0x4ce1('0x2'));var moment=require('moment');var BPromise=require(_0x4ce1('0x3'));var Mustache=require(_0x4ce1('0x4'));var util=require(_0x4ce1('0x5'));var path=require(_0x4ce1('0x6'));var sox=require(_0x4ce1('0x7'));var csv=require('to-csv');var ejs=require(_0x4ce1('0x8'));var fs=require('fs');var fs_extra=require(_0x4ce1('0x9'));var _=require(_0x4ce1('0xa'));var squel=require(_0x4ce1('0xb'));var crypto=require('crypto');var jsforce=require(_0x4ce1('0xc'));var deskjs=require(_0x4ce1('0xd'));var toCsv=require(_0x4ce1('0xe'));var querystring=require('querystring');var Papa=require(_0x4ce1('0xf'));var Redis=require(_0x4ce1('0x10'));var authService=require(_0x4ce1('0x11'));var qs=require(_0x4ce1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ce1('0x13'));var logger=require(_0x4ce1('0x14'))(_0x4ce1('0x15'));var utils=require(_0x4ce1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4ce1('0x17'));var db=require(_0x4ce1('0x18'))['db'];function respondWithStatusCode(_0x1297d8,_0x16dade){_0x16dade=_0x16dade||0xcc;return function(_0x171b8f){if(_0x171b8f){return _0x1297d8[_0x4ce1('0x19')](_0x16dade);}return _0x1297d8[_0x4ce1('0x1a')](_0x16dade)[_0x4ce1('0x1b')]();};}function respondWithResult(_0x45f57e,_0x15407b){_0x15407b=_0x15407b||0xc8;return function(_0x321df9){if(_0x321df9){return _0x45f57e['status'](_0x15407b)[_0x4ce1('0x1c')](_0x321df9);}};}function respondWithFilteredResult(_0x4fa4bc,_0x172e2c){return function(_0x1bfd82){if(_0x1bfd82){var _0x1decc2=_0x1bfd82['count'],_0x35eebd=_0x172e2c['offset'],_0x5649a2=_0x172e2c['offset']+_0x172e2c[_0x4ce1('0x1d')],_0x221306;if(_0x5649a2>=_0x1decc2){_0x5649a2=_0x1decc2;_0x221306=0xc8;}else{_0x221306=0xce;}_0x4fa4bc[_0x4ce1('0x1a')](_0x221306);return _0x4fa4bc[_0x4ce1('0x1e')](_0x4ce1('0x1f'),_0x35eebd+'-'+_0x5649a2+'/'+_0x1decc2)['json'](_0x1bfd82);}return null;};}function patchUpdates(_0x4322e6){return function(_0x48a4ed){try{jsonpatch['apply'](_0x48a4ed,_0x4322e6,!![]);}catch(_0x315bb7){return BPromise[_0x4ce1('0x20')](_0x315bb7);}return _0x48a4ed[_0x4ce1('0x21')]();};}function saveUpdates(_0x44a166,_0x1cb999){return function(_0x315f07){if(_0x315f07){return _0x315f07[_0x4ce1('0x22')](_0x44a166)[_0x4ce1('0x23')](function(_0x564280){return _0x564280;});}return null;};}function removeEntity(_0x95457f,_0x3bce9d){return function(_0x5c0b4f){if(_0x5c0b4f){return _0x5c0b4f[_0x4ce1('0x24')]()[_0x4ce1('0x23')](function(){_0x95457f['status'](0xcc)[_0x4ce1('0x1b')]();});}};}function handleEntityNotFound(_0x2da360,_0x4de527){return function(_0x4d1379){if(!_0x4d1379){_0x2da360['sendStatus'](0x194);}return _0x4d1379;};}function handleError(_0x7cd94b,_0x493feb){_0x493feb=_0x493feb||0x1f4;return function(_0x41f6ed){logger[_0x4ce1('0x25')](_0x41f6ed['stack']);if(_0x41f6ed[_0x4ce1('0x26')]){delete _0x41f6ed[_0x4ce1('0x26')];}_0x7cd94b[_0x4ce1('0x1a')](_0x493feb)[_0x4ce1('0x27')](_0x41f6ed);};}exports[_0x4ce1('0x22')]=function(_0x1efe11,_0x7eba6d){if(_0x1efe11[_0x4ce1('0x28')]['id']){delete _0x1efe11[_0x4ce1('0x28')]['id'];}return db[_0x4ce1('0x29')][_0x4ce1('0x2a')]({'where':{'id':_0x1efe11[_0x4ce1('0x2b')]['id']}})[_0x4ce1('0x23')](handleEntityNotFound(_0x7eba6d,null))[_0x4ce1('0x23')](saveUpdates(_0x1efe11[_0x4ce1('0x28')],null))[_0x4ce1('0x23')](respondWithResult(_0x7eba6d,null))[_0x4ce1('0x2c')](handleError(_0x7eba6d,null));};exports[_0x4ce1('0x24')]=function(_0x5f5854,_0x2a9bc3){return db[_0x4ce1('0x29')][_0x4ce1('0x2a')]({'where':{'id':_0x5f5854[_0x4ce1('0x2b')]['id']}})[_0x4ce1('0x23')](handleEntityNotFound(_0x2a9bc3,null))[_0x4ce1('0x23')](removeEntity(_0x2a9bc3,null))['catch'](handleError(_0x2a9bc3,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 5b69279..1be8b57 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 _0x3b88=['define','tools_actions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0x4bb5d5,_0xdbdf58){var _0x7b0473=function(_0x2b529e){while(--_0x2b529e){_0x4bb5d5['push'](_0x4bb5d5['shift']());}};_0x7b0473(++_0xdbdf58);}(_0x3b88,0x113));var _0x83b8=function(_0x46521e,_0x5ad7ae){_0x46521e=_0x46521e-0x0;var _0x3c2e82=_0x3b88[_0x46521e];return _0x3c2e82;};'use strict';var _=require(_0x83b8('0x0'));var util=require(_0x83b8('0x1'));var logger=require(_0x83b8('0x2'))(_0x83b8('0x3'));var moment=require('moment');var BPromise=require(_0x83b8('0x4'));var rp=require(_0x83b8('0x5'));var fs=require('fs');var path=require(_0x83b8('0x6'));var rimraf=require(_0x83b8('0x7'));var config=require(_0x83b8('0x8'));var attributes=require(_0x83b8('0x9'));module[_0x83b8('0xa')]=function(_0x367c51,_0x1e4a16){return _0x367c51[_0x83b8('0xb')]('Action',attributes,{'tableName':_0x83b8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a14=['util','../../config/logger','api','moment','request-promise','path','rimraf','./action.attributes','define','Action','tools_actions','lodash'];(function(_0x3d706f,_0x3b3214){var _0xa00fa0=function(_0x14931e){while(--_0x14931e){_0x3d706f['push'](_0x3d706f['shift']());}};_0xa00fa0(++_0x3b3214);}(_0x3a14,0xb3));var _0x43a1=function(_0x17b4ce,_0x597822){_0x17b4ce=_0x17b4ce-0x0;var _0x2d14a1=_0x3a14[_0x17b4ce];return _0x2d14a1;};'use strict';var _=require(_0x43a1('0x0'));var util=require(_0x43a1('0x1'));var logger=require(_0x43a1('0x2'))(_0x43a1('0x3'));var moment=require(_0x43a1('0x4'));var BPromise=require('bluebird');var rp=require(_0x43a1('0x5'));var fs=require('fs');var path=require(_0x43a1('0x6'));var rimraf=require(_0x43a1('0x7'));var config=require('../../config/environment');var attributes=require(_0x43a1('0x8'));module['exports']=function(_0x17bded,_0x4cc39d){return _0x17bded[_0x43a1('0x9')](_0x43a1('0xa'),attributes,{'tableName':_0x43a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 56219c1..bfa0a11 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 _0xa9e0=['http','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x4c85e1,_0x54f5fa){var _0x9270b8=function(_0x2cc916){while(--_0x2cc916){_0x4c85e1['push'](_0x4c85e1['shift']());}};_0x9270b8(++_0x54f5fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0xcb0342,_0x50f7a1){var _0x3d6cf7=function(_0x5eb9e2){while(--_0x5eb9e2){_0xcb0342['push'](_0xcb0342['shift']());}};_0x3d6cf7(++_0x50f7a1);}(_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 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/action/index.js b/server/api/action/index.js index 16ab524..f2dae68 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 _0x6a72=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','path','express','fs-extra'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x6a72,0x118));var _0x26a7=function(_0x21c81e,_0x5de28f){_0x21c81e=_0x21c81e-0x0;var _0x16a6d7=_0x6a72[_0x21c81e];return _0x16a6d7;};'use strict';var multer=require(_0x26a7('0x0'));var util=require(_0x26a7('0x1'));var path=require(_0x26a7('0x2'));var timeout=require('connect-timeout');var express=require(_0x26a7('0x3'));var router=express['Router']();var fs_extra=require(_0x26a7('0x4'));var auth=require(_0x26a7('0x5'));var interaction=require(_0x26a7('0x6'));var config=require(_0x26a7('0x7'));var controller=require(_0x26a7('0x8'));router[_0x26a7('0x9')](_0x26a7('0xa'),auth[_0x26a7('0xb')](),controller['update']);router[_0x26a7('0xc')](_0x26a7('0xa'),auth['isAuthenticated'](),controller[_0x26a7('0xd')]);module[_0x26a7('0xe')]=router; \ No newline at end of file +var _0xf268=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','delete','util','connect-timeout'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf268,0x11e));var _0x8f26=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0xf268[_0x2f8530];return _0x5e814e;};'use strict';var multer=require('multer');var util=require(_0x8f26('0x0'));var path=require('path');var timeout=require(_0x8f26('0x1'));var express=require(_0x8f26('0x2'));var router=express[_0x8f26('0x3')]();var fs_extra=require(_0x8f26('0x4'));var auth=require(_0x8f26('0x5'));var interaction=require(_0x8f26('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x8f26('0x7')](_0x8f26('0x8'),auth[_0x8f26('0x9')](),controller[_0x8f26('0xa')]);router[_0x8f26('0xb')](_0x8f26('0x8'),auth[_0x8f26('0x9')](),controller['destroy']);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 1b4fb7e..30dab8b 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 _0x75c7=['exports','STRING','TEXT','sequelize'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x75c7,0x12b));var _0x775c=function(_0x439386,_0x56b397){_0x439386=_0x439386-0x0;var _0x29e025=_0x75c7[_0x439386];return _0x29e025;};'use strict';var Sequelize=require(_0x775c('0x0'));module[_0x775c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x775c('0x2')]},'parent':{'type':Sequelize[_0x775c('0x2')]},'table':{'type':Sequelize[_0x775c('0x2')]},'conditions':{'type':Sequelize[_0x775c('0x3')]},'joins':{'type':Sequelize[_0x775c('0x3')]}}; \ No newline at end of file +var _0x241a=['sequelize','exports','STRING','TEXT'];(function(_0xb93e8d,_0x11e30e){var _0xeda55b=function(_0xbfe7cf){while(--_0xbfe7cf){_0xb93e8d['push'](_0xb93e8d['shift']());}};_0xeda55b(++_0x11e30e);}(_0x241a,0x128));var _0xa241=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x241a[_0xe73080];return _0x12cbc4;};'use strict';var Sequelize=require(_0xa241('0x0'));module[_0xa241('0x1')]={'name':{'type':Sequelize[_0xa241('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa241('0x2')]},'parent':{'type':Sequelize[_0xa241('0x2')]},'table':{'type':Sequelize[_0xa241('0x2')]},'conditions':{'type':Sequelize[_0xa241('0x3')]},'joins':{'type':Sequelize[_0xa241('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 8266e01..0072d80 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 _0x6a2c=['AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','join','../../components/export/','../../files/reports','savename','select','COUNT(*)','run','runReport','COUNT(DISTINCT\x20%s)','operator','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','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','dbH','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','UserProfileResource','destroy','error','name','map','AnalyticCustomReport','fieldName','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','params','keys','options','find','catch','create','body','user','get','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','function','replace','format','groupBy','orderBy','joins','parse','type','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SEC_TO_TIME(%s)','HOUR(%s)','getFields','ValidationErrorItem','AnalyticMetric','metric','DESC','alias','web','fullPath','generate','output','custom'];(function(_0x5a401e,_0x2de782){var _0x2aa2cc=function(_0x1150e7){while(--_0x1150e7){_0x5a401e['push'](_0x5a401e['shift']());}};_0x2aa2cc(++_0x2de782);}(_0x6a2c,0x15a));var _0xc6a2=function(_0x3d64b6,_0x29cd04){_0x3d64b6=_0x3d64b6-0x0;var _0x20e92c=_0x6a2c[_0x3d64b6];return _0x20e92c;};'use strict';var emlformat=require(_0xc6a2('0x0'));var rimraf=require(_0xc6a2('0x1'));var zipdir=require(_0xc6a2('0x2'));var jsonpatch=require(_0xc6a2('0x3'));var rp=require(_0xc6a2('0x4'));var moment=require(_0xc6a2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc6a2('0x6'));var util=require(_0xc6a2('0x7'));var path=require(_0xc6a2('0x8'));var sox=require('sox');var csv=require(_0xc6a2('0x9'));var ejs=require(_0xc6a2('0xa'));var fs=require('fs');var fs_extra=require(_0xc6a2('0xb'));var _=require('lodash');var squel=require(_0xc6a2('0xc'));var crypto=require('crypto');var jsforce=require(_0xc6a2('0xd'));var deskjs=require(_0xc6a2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc6a2('0xf'));var Papa=require(_0xc6a2('0x10'));var Redis=require(_0xc6a2('0x11'));var authService=require(_0xc6a2('0x12'));var qs=require(_0xc6a2('0x13'));var as=require(_0xc6a2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc6a2('0x15'))(_0xc6a2('0x16'));var utils=require(_0xc6a2('0x17'));var config=require(_0xc6a2('0x18'));var licenseUtil=require(_0xc6a2('0x19'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xc6a2('0x1a')];function respondWithStatusCode(_0x378626,_0x599a90){_0x599a90=_0x599a90||0xcc;return function(_0x1c4130){if(_0x1c4130){return _0x378626[_0xc6a2('0x1b')](_0x599a90);}return _0x378626[_0xc6a2('0x1c')](_0x599a90)[_0xc6a2('0x1d')]();};}function respondWithResult(_0x3ebab9,_0x4ab781){_0x4ab781=_0x4ab781||0xc8;return function(_0xfec436){if(_0xfec436){return _0x3ebab9['status'](_0x4ab781)['json'](_0xfec436);}};}function respondWithFilteredResult(_0x4c5acd,_0x10573e){return function(_0x1edf41){if(_0x1edf41){var _0x4ccac3=_0x1edf41[_0xc6a2('0x1e')],_0x36d9bd=_0x10573e[_0xc6a2('0x1f')],_0x190421=_0x10573e[_0xc6a2('0x1f')]+_0x10573e['limit'],_0x3486ea;if(_0x190421>=_0x4ccac3){_0x190421=_0x4ccac3;_0x3486ea=0xc8;}else{_0x3486ea=0xce;}_0x4c5acd['status'](_0x3486ea);return _0x4c5acd[_0xc6a2('0x20')](_0xc6a2('0x21'),_0x36d9bd+'-'+_0x190421+'/'+_0x4ccac3)[_0xc6a2('0x22')](_0x1edf41);}return null;};}function patchUpdates(_0x52f7b4){return function(_0x55cf39){try{jsonpatch[_0xc6a2('0x23')](_0x55cf39,_0x52f7b4,!![]);}catch(_0x9e6ecd){return BPromise[_0xc6a2('0x24')](_0x9e6ecd);}return _0x55cf39[_0xc6a2('0x25')]();};}function saveUpdates(_0x621639,_0x2f2254){return function(_0x4ab816){if(_0x4ab816){return _0x4ab816[_0xc6a2('0x26')](_0x621639)[_0xc6a2('0x27')](function(_0x1d878){return _0x1d878;});}return null;};}function removeEntity(_0x4e1c19,_0x3a5492){return function(_0x39058b){if(_0x39058b){return _0x39058b['destroy']()[_0xc6a2('0x27')](function(){var _0x332ac5=_0x39058b['get']({'plain':!![]});var _0x17931a='CustomReports';return db[_0xc6a2('0x28')][_0xc6a2('0x29')]({'where':{'type':_0x17931a,'resourceId':_0x332ac5['id']}})['then'](function(){return _0x39058b;});})[_0xc6a2('0x27')](function(){_0x4e1c19[_0xc6a2('0x1c')](0xcc)[_0xc6a2('0x1d')]();});}};}function handleEntityNotFound(_0x29419b,_0x17f13f){return function(_0x52141d){if(!_0x52141d){_0x29419b[_0xc6a2('0x1b')](0x194);}return _0x52141d;};}function handleError(_0xaf1a8a,_0x4b7a1d){_0x4b7a1d=_0x4b7a1d||0x1f4;return function(_0x4f4ae9){logger[_0xc6a2('0x2a')](_0x4f4ae9['stack']);if(_0x4f4ae9[_0xc6a2('0x2b')]){delete _0x4f4ae9['name'];}_0xaf1a8a['status'](_0x4b7a1d)['send'](_0x4f4ae9);};}exports['index']=function(_0xe0cc97,_0x3cb0d5){var _0x1bf9d1={},_0xc86af3={},_0x8574ae={'count':0x0,'rows':[]};var _0x3d77d6=_[_0xc6a2('0x2c')](db[_0xc6a2('0x2d')]['rawAttributes'],function(_0x2395c0){return{'name':_0x2395c0[_0xc6a2('0x2e')],'type':_0x2395c0['type'][_0xc6a2('0x2f')]};});_0xc86af3[_0xc6a2('0x30')]=_['map'](_0x3d77d6,_0xc6a2('0x2b'));_0xc86af3[_0xc6a2('0x31')]=_['keys'](_0xe0cc97[_0xc6a2('0x31')]);_0xc86af3[_0xc6a2('0x32')]=_[_0xc6a2('0x33')](_0xc86af3['model'],_0xc86af3[_0xc6a2('0x31')]);_0x1bf9d1['attributes']=_[_0xc6a2('0x33')](_0xc86af3[_0xc6a2('0x30')],qs[_0xc6a2('0x34')](_0xe0cc97[_0xc6a2('0x31')][_0xc6a2('0x34')]));_0x1bf9d1['attributes']=_0x1bf9d1['attributes'][_0xc6a2('0x35')]?_0x1bf9d1[_0xc6a2('0x36')]:_0xc86af3[_0xc6a2('0x30')];if(!_0xe0cc97[_0xc6a2('0x31')][_0xc6a2('0x37')](_0xc6a2('0x38'))){_0x1bf9d1['limit']=qs[_0xc6a2('0x39')](_0xe0cc97['query']['limit']);_0x1bf9d1[_0xc6a2('0x1f')]=qs[_0xc6a2('0x1f')](_0xe0cc97[_0xc6a2('0x31')][_0xc6a2('0x1f')]);}_0x1bf9d1[_0xc6a2('0x3a')]=qs[_0xc6a2('0x3b')](_0xe0cc97[_0xc6a2('0x31')][_0xc6a2('0x3b')]);_0x1bf9d1[_0xc6a2('0x3c')]=qs[_0xc6a2('0x32')](_[_0xc6a2('0x3d')](_0xe0cc97[_0xc6a2('0x31')],_0xc86af3['filters']),_0x3d77d6);if(_0xe0cc97[_0xc6a2('0x31')][_0xc6a2('0x3e')]){_0x1bf9d1[_0xc6a2('0x3c')]=_[_0xc6a2('0x3f')](_0x1bf9d1[_0xc6a2('0x3c')],{'$or':_['map'](_0x3d77d6,function(_0x240c61){if(_0x240c61['type']!==_0xc6a2('0x40')){var _0x4cca59={};_0x4cca59[_0x240c61[_0xc6a2('0x2b')]]={'$like':'%'+_0xe0cc97[_0xc6a2('0x31')][_0xc6a2('0x3e')]+'%'};return _0x4cca59;}})});}_0x1bf9d1=_[_0xc6a2('0x3f')]({},_0x1bf9d1,_0xe0cc97['options']);var _0x501983={'where':_0x1bf9d1[_0xc6a2('0x3c')]};return db[_0xc6a2('0x2d')][_0xc6a2('0x1e')](_0x501983)[_0xc6a2('0x27')](function(_0x23538e){_0x8574ae[_0xc6a2('0x1e')]=_0x23538e;if(_0xe0cc97[_0xc6a2('0x31')]['includeAll']){_0x1bf9d1[_0xc6a2('0x41')]=[{'all':!![]}];}return db[_0xc6a2('0x2d')]['findAll'](_0x1bf9d1);})[_0xc6a2('0x27')](function(_0xc319c6){_0x8574ae['rows']=_0xc319c6;return _0x8574ae;})['then'](respondWithFilteredResult(_0x3cb0d5,_0x1bf9d1))['catch'](handleError(_0x3cb0d5,null));};exports['show']=function(_0x564883,_0x515bcb){var _0x13c48a={'raw':![],'where':{'id':_0x564883[_0xc6a2('0x42')]['id']}},_0x59817e={};_0x59817e['model']=_[_0xc6a2('0x43')](db[_0xc6a2('0x2d')]['rawAttributes']);_0x59817e[_0xc6a2('0x31')]=_[_0xc6a2('0x43')](_0x564883[_0xc6a2('0x31')]);_0x59817e['filters']=_['intersection'](_0x59817e[_0xc6a2('0x30')],_0x59817e['query']);_0x13c48a[_0xc6a2('0x36')]=_['intersection'](_0x59817e['model'],qs['fields'](_0x564883[_0xc6a2('0x31')][_0xc6a2('0x34')]));_0x13c48a[_0xc6a2('0x36')]=_0x13c48a[_0xc6a2('0x36')][_0xc6a2('0x35')]?_0x13c48a[_0xc6a2('0x36')]:_0x59817e[_0xc6a2('0x30')];if(_0x564883[_0xc6a2('0x31')]['includeAll']){_0x13c48a[_0xc6a2('0x41')]=[{'all':!![]}];}_0x13c48a=_[_0xc6a2('0x3f')]({},_0x13c48a,_0x564883[_0xc6a2('0x44')]);return db[_0xc6a2('0x2d')][_0xc6a2('0x45')](_0x13c48a)[_0xc6a2('0x27')](handleEntityNotFound(_0x515bcb,null))['then'](respondWithResult(_0x515bcb,null))[_0xc6a2('0x46')](handleError(_0x515bcb,null));};exports[_0xc6a2('0x47')]=function(_0x82212a,_0x3b2a7f){return db[_0xc6a2('0x2d')][_0xc6a2('0x47')](_0x82212a[_0xc6a2('0x48')],{})[_0xc6a2('0x27')](function(_0x3e961a){var _0x4bcd6a=_0x82212a[_0xc6a2('0x49')][_0xc6a2('0x4a')]({'plain':!![]});if(!_0x4bcd6a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bcd6a[_0xc6a2('0x4b')]===_0xc6a2('0x49')){var _0x1b17c8=_0x3e961a[_0xc6a2('0x4a')]({'plain':!![]});var _0x5f5501=_0xc6a2('0x4c');return db[_0xc6a2('0x4d')][_0xc6a2('0x45')]({'where':{'name':_0x5f5501,'userProfileId':_0x4bcd6a[_0xc6a2('0x4e')]},'raw':!![]})[_0xc6a2('0x27')](function(_0x35ceff){if(_0x35ceff&&_0x35ceff[_0xc6a2('0x4f')]===0x0){return db[_0xc6a2('0x28')][_0xc6a2('0x47')]({'name':_0x1b17c8[_0xc6a2('0x2b')],'resourceId':_0x1b17c8['id'],'type':'CustomReports','sectionId':_0x35ceff['id']},{})[_0xc6a2('0x27')](function(){return _0x3e961a;});}else{return _0x3e961a;}})['catch'](function(_0x3e64c6){logger['error'](_0xc6a2('0x50'),_0x3e64c6);throw _0x3e64c6;});}return _0x3e961a;})[_0xc6a2('0x27')](respondWithResult(_0x3b2a7f,0xc9))[_0xc6a2('0x46')](handleError(_0x3b2a7f,null));};exports[_0xc6a2('0x26')]=function(_0x2ad518,_0x181a88){if(_0x2ad518['body']['id']){delete _0x2ad518['body']['id'];}return db[_0xc6a2('0x2d')][_0xc6a2('0x45')]({'where':{'id':_0x2ad518[_0xc6a2('0x42')]['id']}})[_0xc6a2('0x27')](handleEntityNotFound(_0x181a88,null))[_0xc6a2('0x27')](saveUpdates(_0x2ad518['body'],null))[_0xc6a2('0x27')](respondWithResult(_0x181a88,null))[_0xc6a2('0x46')](handleError(_0x181a88,null));};exports[_0xc6a2('0x29')]=function(_0x293ead,_0x1a9d0b){return db[_0xc6a2('0x2d')]['find']({'where':{'id':_0x293ead[_0xc6a2('0x42')]['id']}})[_0xc6a2('0x27')](handleEntityNotFound(_0x1a9d0b,null))[_0xc6a2('0x27')](removeEntity(_0x1a9d0b,null))['catch'](handleError(_0x1a9d0b,null));};exports[_0xc6a2('0x51')]=function(_0x572f33,_0x28c090){var _0x5701fa=0xa;var _0x4ae3e0=['join',_0xc6a2('0x52'),_0xc6a2('0x53'),_0xc6a2('0x54')];var _0x3cf0b2={'SUM':_0xc6a2('0x55'),'COUNT':_0xc6a2('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc6a2('0x57'),'MIN':_0xc6a2('0x58'),'AVG':_0xc6a2('0x59'),'GROUP_CONCAT':_0xc6a2('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc6a2('0x5b')};var _0x1e5642={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc6a2('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xc6a2('0x5d'),'UNIX_TIMESTAMP':_0xc6a2('0x5e')};var _0x1620ff=function(_0x395830){return!_[_0xc6a2('0x5f')]([_0xc6a2('0x60'),_0xc6a2('0x61'),_0xc6a2('0x62'),'IS\x20NOT\x20EMPTY'],_0x395830);};var _0x2799c1=function(_0x340a70){if(!_0x340a70||!_0x340a70[_0xc6a2('0x63')][_0xc6a2('0x35')]){return'';}for(var _0x5074f8='(',_0x4eabda=0x0;_0x4eabda<_0x340a70[_0xc6a2('0x63')]['length'];_0x4eabda+=0x1){_0x4eabda>0x0&&(_0x5074f8+='\x20'+_0x340a70['operator']+'\x20');_0x5074f8+=_0x340a70[_0xc6a2('0x63')][_0x4eabda][_0xc6a2('0x64')]?_0x2799c1(_0x340a70[_0xc6a2('0x63')][_0x4eabda][_0xc6a2('0x64')]):_0x340a70[_0xc6a2('0x63')][_0x4eabda][_0xc6a2('0x65')]+'\x20'+_0x340a70[_0xc6a2('0x63')][_0x4eabda][_0xc6a2('0x66')]+(_0x1620ff(_0x340a70['rules'][_0x4eabda]['condition'])?'\x20'+_0x340a70[_0xc6a2('0x63')][_0x4eabda][_0xc6a2('0x67')]:'');}return _0x5074f8+')';};var _0x16edd1={'where':{'id':_0x572f33[_0xc6a2('0x42')]['id']}},_0x43158d,_0x18320d,_0x4c09a2,_0x1540e3,_0x58df0a;_0x16edd1=_[_0xc6a2('0x3f')]({},_0x16edd1,_0x572f33[_0xc6a2('0x44')]);return db[_0xc6a2('0x2d')][_0xc6a2('0x45')](_0x16edd1)['then'](function(_0x26e2c5){if(_0x26e2c5){_0x43158d=_0x26e2c5;return _0x26e2c5['getFields']();}return null;})[_0xc6a2('0x27')](function(_0x187292){if(_0x187292){if(!_0x187292[_0xc6a2('0x35')]){throw new db[(_0xc6a2('0x68'))]['ValidationErrorItem'](_0xc6a2('0x69'),0x193);}_0x18320d=_0x187292;return db['AnalyticMetric'][_0xc6a2('0x6a')]({'raw':!![]});}return null;})[_0xc6a2('0x27')](function(_0x3f00ea){if(_0x3f00ea){_0x4c09a2=_[_0xc6a2('0x6b')](_0x3f00ea,'id');var _0x3c9537;var _0x2502f5=squel['select']();_0x2502f5[_0xc6a2('0x6c')](_0x43158d[_0xc6a2('0x6d')]);for(var _0x3a720e=0x0;_0x3a720e<_0x18320d['length'];_0x3a720e+=0x1){_0x3c9537=_0x18320d[_0x3a720e][_0xc6a2('0x6e')]?_0x4c09a2[_0x18320d[_0x3a720e][_0xc6a2('0x6e')]]['metric']:_0x18320d[_0x3a720e][_0xc6a2('0x65')];_0x3c9537=_0x18320d[_0x3a720e][_0xc6a2('0x6f')]?_[_0xc6a2('0x70')](_0x3cf0b2[_0x18320d[_0x3a720e][_0xc6a2('0x6f')]],'%s',_0x3c9537):_0x3c9537;_0x3c9537=_0x18320d[_0x3a720e][_0xc6a2('0x71')]?_[_0xc6a2('0x70')](_0x1e5642[_0x18320d[_0x3a720e][_0xc6a2('0x71')]],'%s',_0x3c9537):_0x3c9537;if(_0x18320d[_0x3a720e][_0xc6a2('0x72')]){_0x2502f5['group'](_0x3c9537);}_0x18320d[_0x3a720e][_0xc6a2('0x73')]&&_0x2502f5['order'](_0x3c9537,_0x18320d[_0x3a720e][_0xc6a2('0x73')]==='DESC'?![]:!![]);_0x2502f5[_0xc6a2('0x65')](_0x3c9537,_0x18320d[_0x3a720e]['alias']||_0x3c9537);}if(_0x43158d['joins']){_0x43158d[_0xc6a2('0x74')]=JSON[_0xc6a2('0x75')](_0x43158d['joins']);for(var _0x27ce16=0x0;_0x27ce16<_0x43158d[_0xc6a2('0x74')][_0xc6a2('0x35')];_0x27ce16+=0x1){if(_0x43158d[_0xc6a2('0x74')][_0x27ce16][_0xc6a2('0x76')]&&_[_0xc6a2('0x5f')](_0x4ae3e0,_0x43158d[_0xc6a2('0x74')][_0x27ce16][_0xc6a2('0x76')])&&_0x43158d[_0xc6a2('0x74')][_0x27ce16][_0xc6a2('0x77')]&&_0x43158d[_0xc6a2('0x74')][_0x27ce16][_0xc6a2('0x78')]&&_0x43158d[_0xc6a2('0x74')][_0x27ce16][_0xc6a2('0x79')]){_0x2502f5[_0x43158d[_0xc6a2('0x74')][_0x27ce16][_0xc6a2('0x76')]](_0x43158d['joins'][_0x27ce16][_0xc6a2('0x78')],null,util[_0xc6a2('0x71')]('%s.%s\x20=\x20%s.%s',_0x43158d[_0xc6a2('0x6d')],_0x43158d['joins'][_0x27ce16][_0xc6a2('0x77')],_0x43158d[_0xc6a2('0x74')][_0x27ce16]['foreignTable'],_0x43158d['joins'][_0x27ce16]['foreignKey']));}}}if(_0x43158d[_0xc6a2('0x7a')]){_0x43158d['conditions']=JSON[_0xc6a2('0x75')](_0x43158d[_0xc6a2('0x7a')]);_0x2502f5['where'](_0x2799c1(_0x43158d[_0xc6a2('0x7a')][_0xc6a2('0x64')]));}_0x58df0a=_0x2502f5[_0xc6a2('0x7b')]();_0x2502f5[_0xc6a2('0x39')](_0x5701fa);_0x2502f5[_0xc6a2('0x1f')](0x0);logger[_0xc6a2('0x7c')](_0xc6a2('0x7d'),_0x2502f5[_0xc6a2('0x7e')]());return dbH[_0xc6a2('0x7f')][_0xc6a2('0x31')](_0x2502f5[_0xc6a2('0x7e')](),{'type':dbH[_0xc6a2('0x7f')][_0xc6a2('0x80')][_0xc6a2('0x81')]});}})[_0xc6a2('0x27')](respondWithResult(_0x28c090,null))['catch'](handleError(_0x28c090,null));};function runReport(_0x152bda,_0x2c3e16,_0x48739c){var _0x28d169=_0x2c3e16[_0xc6a2('0x2b')];var _0x4bf8d1=0xa;var _0x4ca397=['join','left_join',_0xc6a2('0x53'),'cross_join'];var _0x53086a={'SUM':_0xc6a2('0x55'),'COUNT':_0xc6a2('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc6a2('0x57'),'MIN':_0xc6a2('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc6a2('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc6a2('0x5b')};var _0x1665fa={'SEC_TO_TIME':_0xc6a2('0x82'),'DATE':'DATE(%s)','HOUR':_0xc6a2('0x83'),'ROUND':_0xc6a2('0x5d'),'UNIX_TIMESTAMP':_0xc6a2('0x5e')};var _0x4eafca=function(_0x2cbe58){return!_['includes'](['IS\x20NULL',_0xc6a2('0x61'),_0xc6a2('0x62'),'IS\x20NOT\x20EMPTY'],_0x2cbe58);};var _0x1fe785=function(_0xabe3cf){if(!_0xabe3cf||!_0xabe3cf['rules']['length']){return'';}for(var _0x3de453='(',_0x4ee55b=0x0;_0x4ee55b<_0xabe3cf[_0xc6a2('0x63')][_0xc6a2('0x35')];_0x4ee55b+=0x1){_0x4ee55b>0x0&&(_0x3de453+='\x20'+_0xabe3cf['operator']+'\x20');_0x3de453+=_0xabe3cf[_0xc6a2('0x63')][_0x4ee55b]['group']?_0x1fe785(_0xabe3cf[_0xc6a2('0x63')][_0x4ee55b][_0xc6a2('0x64')]):_0xabe3cf[_0xc6a2('0x63')][_0x4ee55b][_0xc6a2('0x65')]+'\x20'+_0xabe3cf[_0xc6a2('0x63')][_0x4ee55b][_0xc6a2('0x66')]+(_0x4eafca(_0xabe3cf[_0xc6a2('0x63')][_0x4ee55b][_0xc6a2('0x66')])?'\x20'+_0xabe3cf[_0xc6a2('0x63')][_0x4ee55b]['value']:'');}return _0x3de453+')';};var _0x5b533d={'where':{'id':_0x152bda['id']}},_0x6580c5,_0x4c35bd,_0x1b5f0c,_0x2491f9,_0x4e2e66;_0x5b533d=_[_0xc6a2('0x3f')]({},_0x5b533d,_0x48739c);return db[_0xc6a2('0x2d')][_0xc6a2('0x45')](_0x5b533d)[_0xc6a2('0x27')](function(_0x16d3be){if(_0x16d3be){_0x6580c5=_0x16d3be;return _0x16d3be[_0xc6a2('0x84')]();}return null;})['then'](function(_0xf64c68){if(_0xf64c68){if(!_0xf64c68[_0xc6a2('0x35')]){throw new db[(_0xc6a2('0x68'))][(_0xc6a2('0x85'))](_0xc6a2('0x69'),0x193);}_0x4c35bd=_0xf64c68;return db[_0xc6a2('0x86')]['findAll']({'raw':!![]});}return null;})[_0xc6a2('0x27')](function(_0x306094){if(_0x306094){_0x1b5f0c=_[_0xc6a2('0x6b')](_0x306094,'id');var _0xcd3bf3;var _0x539312=squel['select']();_0x539312[_0xc6a2('0x6c')](_0x6580c5[_0xc6a2('0x6d')]);for(var _0x2efb66=0x0;_0x2efb66<_0x4c35bd['length'];_0x2efb66+=0x1){_0xcd3bf3=_0x4c35bd[_0x2efb66][_0xc6a2('0x6e')]?_0x1b5f0c[_0x4c35bd[_0x2efb66]['MetricId']][_0xc6a2('0x87')]:_0x4c35bd[_0x2efb66]['field'];_0xcd3bf3=_0x4c35bd[_0x2efb66][_0xc6a2('0x6f')]?_[_0xc6a2('0x70')](_0x53086a[_0x4c35bd[_0x2efb66][_0xc6a2('0x6f')]],'%s',_0xcd3bf3):_0xcd3bf3;_0xcd3bf3=_0x4c35bd[_0x2efb66]['format']?_[_0xc6a2('0x70')](_0x1665fa[_0x4c35bd[_0x2efb66]['format']],'%s',_0xcd3bf3):_0xcd3bf3;if(_0x4c35bd[_0x2efb66][_0xc6a2('0x72')]){_0x539312[_0xc6a2('0x64')](_0xcd3bf3);}_0x4c35bd[_0x2efb66][_0xc6a2('0x73')]&&_0x539312['order'](_0xcd3bf3,_0x4c35bd[_0x2efb66][_0xc6a2('0x73')]===_0xc6a2('0x88')?![]:!![]);_0x539312[_0xc6a2('0x65')](_0xcd3bf3,_0x4c35bd[_0x2efb66][_0xc6a2('0x89')]||_0xcd3bf3);}if(_0x6580c5[_0xc6a2('0x74')]){_0x6580c5[_0xc6a2('0x74')]=JSON['parse'](_0x6580c5['joins']);for(var _0x1aed77=0x0;_0x1aed77<_0x6580c5['joins'][_0xc6a2('0x35')];_0x1aed77+=0x1){if(_0x6580c5['joins'][_0x1aed77][_0xc6a2('0x76')]&&_[_0xc6a2('0x5f')](_0x4ca397,_0x6580c5[_0xc6a2('0x74')][_0x1aed77][_0xc6a2('0x76')])&&_0x6580c5[_0xc6a2('0x74')][_0x1aed77][_0xc6a2('0x77')]&&_0x6580c5['joins'][_0x1aed77]['foreignTable']&&_0x6580c5[_0xc6a2('0x74')][_0x1aed77][_0xc6a2('0x79')]){_0x539312[_0x6580c5[_0xc6a2('0x74')][_0x1aed77]['type']](_0x6580c5[_0xc6a2('0x74')][_0x1aed77][_0xc6a2('0x78')],null,util[_0xc6a2('0x71')]('%s.%s\x20=\x20%s.%s',_0x6580c5[_0xc6a2('0x6d')],_0x6580c5[_0xc6a2('0x74')][_0x1aed77]['parentKey'],_0x6580c5[_0xc6a2('0x74')][_0x1aed77][_0xc6a2('0x78')],_0x6580c5['joins'][_0x1aed77]['foreignKey']));}}}if(_0x6580c5[_0xc6a2('0x7a')]){_0x6580c5['conditions']=JSON[_0xc6a2('0x75')](_0x6580c5[_0xc6a2('0x7a')]);_0x539312[_0xc6a2('0x3c')](_0x1fe785(_0x6580c5[_0xc6a2('0x7a')][_0xc6a2('0x64')]));}_0x4e2e66=_0x539312['clone']();_0x539312[_0xc6a2('0x39')](_0x4bf8d1);_0x539312[_0xc6a2('0x1f')](0x0);return;}})[_0xc6a2('0x27')](function(){if(_0x2c3e16['output']===_0xc6a2('0x8a')){return null;}var _0x2b6893=_[_0xc6a2('0x3f')](_0x2c3e16,{'name':_0x2c3e16[_0xc6a2('0x8b')]||_0x2c3e16[_0xc6a2('0x2b')]||_0x6580c5[_0xc6a2('0x2b')],'basename':_0x28d169,'savename':util[_0xc6a2('0x71')]('%s-%s.%s',_0x2c3e16[_0xc6a2('0x2b')]||_0x6580c5['name'],require('randomstring')[_0xc6a2('0x8c')](0x4),_0x2c3e16[_0xc6a2('0x8d')]||'csv'),'reportId':_0x6580c5['id'],'reportType':_0xc6a2('0x8e')});return db[_0xc6a2('0x8f')][_0xc6a2('0x47')](_0x2b6893,{'raw':!![]});})[_0xc6a2('0x27')](function(_0x564666){if(_0x6580c5[_0xc6a2('0x6d')]===_0xc6a2('0x90')){_0x4e2e66[_0xc6a2('0x3c')](_0x6580c5[_0xc6a2('0x6d')]+_0xc6a2('0x91'),_0x2c3e16[_0xc6a2('0x92')],_0x2c3e16[_0xc6a2('0x93')]);}else{_0x4e2e66['where'](_0x6580c5['table']+_0xc6a2('0x94'),_0x2c3e16['startDate'],_0x2c3e16[_0xc6a2('0x93')]);}if(_0x564666){logger['info'](_0xc6a2('0x95'),_0x4e2e66['toString']());require(_0xc6a2('0x96'))[_0xc6a2('0x97')](path[_0xc6a2('0x98')](__dirname,_0xc6a2('0x99'),_0x564666[_0xc6a2('0x8d')]),[_0x564666['id'],_0x4e2e66[_0xc6a2('0x7e')](),path[_0xc6a2('0x98')](__dirname,_0xc6a2('0x9a'),_0x564666[_0xc6a2('0x9b')]),_0x28d169]);return _0x564666;}else{var _0x1575cd=squel[_0xc6a2('0x9c')]();_0x1575cd[_0xc6a2('0x6c')]('('+_0x4e2e66[_0xc6a2('0x7e')]()+')','countTable');_0x1575cd[_0xc6a2('0x65')](_0xc6a2('0x9d'),_0xc6a2('0x1e'));_0x4e2e66[_0xc6a2('0x39')](_0x2c3e16['limit']||_0x4bf8d1);_0x4e2e66['offset'](_0x2c3e16[_0xc6a2('0x1f')]||0x0);return dbH[_0xc6a2('0x7f')][_0xc6a2('0x31')](_0x1575cd[_0xc6a2('0x7e')](),{'type':dbH[_0xc6a2('0x7f')][_0xc6a2('0x80')][_0xc6a2('0x81')]})[_0xc6a2('0x27')](function(_0x2453ff){if(!_0x2453ff[_0xc6a2('0x35')]){_0x2491f9=0x0;}else{_0x2491f9=_0x2453ff[0x0]['count']||0x0;}return dbH['sequelize'][_0xc6a2('0x31')](_0x4e2e66[_0xc6a2('0x7e')](),{'type':dbH['sequelize']['QueryTypes'][_0xc6a2('0x81')]});})[_0xc6a2('0x27')](function(_0x3eed76){return{'rows':_0x3eed76||[],'count':_0x2491f9};});}});}exports[_0xc6a2('0x9e')]=function(_0x47ed00,_0x104dc2){return runReport(_0x47ed00[_0xc6a2('0x42')],_0x47ed00[_0xc6a2('0x31')],_0x47ed00['options'])[_0xc6a2('0x27')](respondWithResult(_0x104dc2,null))[_0xc6a2('0x46')](handleError(_0x104dc2,null));};exports[_0xc6a2('0x9f')]=runReport;exports[_0xc6a2('0x31')]=function(_0x4a1c4b,_0xc0a7b2){var _0x15556a=0xa;var _0x1782ef=['join',_0xc6a2('0x52'),_0xc6a2('0x53'),_0xc6a2('0x54')];var _0x1e595f={'SUM':_0xc6a2('0x55'),'COUNT':_0xc6a2('0x56'),'COUNT DISTINCT':_0xc6a2('0xa0'),'MAX':_0xc6a2('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc6a2('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc6a2('0x5b')};var _0x202710={'SEC_TO_TIME':_0xc6a2('0x82'),'DATE':_0xc6a2('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xc6a2('0x5d'),'UNIX_TIMESTAMP':_0xc6a2('0x5e')};var _0x16e0f7=function(_0x40db0d){return!_[_0xc6a2('0x5f')](['IS\x20NULL',_0xc6a2('0x61'),_0xc6a2('0x62'),'IS\x20NOT\x20EMPTY'],_0x40db0d);};var _0x1f34f5=function(_0x155d8d){if(!_0x155d8d||!_0x155d8d[_0xc6a2('0x63')][_0xc6a2('0x35')]){return'';}for(var _0x566bc7='(',_0x420ad2=0x0;_0x420ad2<_0x155d8d[_0xc6a2('0x63')][_0xc6a2('0x35')];_0x420ad2+=0x1){_0x420ad2>0x0&&(_0x566bc7+='\x20'+_0x155d8d[_0xc6a2('0xa1')]+'\x20');_0x566bc7+=_0x155d8d[_0xc6a2('0x63')][_0x420ad2][_0xc6a2('0x64')]?_0x1f34f5(_0x155d8d[_0xc6a2('0x63')][_0x420ad2][_0xc6a2('0x64')]):_0x155d8d['rules'][_0x420ad2][_0xc6a2('0x65')]+'\x20'+_0x155d8d['rules'][_0x420ad2]['condition']+(_0x16e0f7(_0x155d8d[_0xc6a2('0x63')][_0x420ad2][_0xc6a2('0x66')])?'\x20'+_0x155d8d[_0xc6a2('0x63')][_0x420ad2][_0xc6a2('0x67')]:'');}return _0x566bc7+')';};var _0x1c9672={'where':{'id':_0x4a1c4b['params']['id']}},_0x17dd65,_0x172d58,_0x1e4679,_0x30037b,_0x4f9d6c;_0x1c9672=_[_0xc6a2('0x3f')]({},_0x1c9672,_0x4a1c4b['options']);return db[_0xc6a2('0x2d')]['find'](_0x1c9672)[_0xc6a2('0x27')](function(_0x481f72){if(_0x481f72){_0x17dd65=_0x481f72;return _0x481f72[_0xc6a2('0x84')]();}return null;})['then'](function(_0x18eb32){if(_0x18eb32){if(!_0x18eb32[_0xc6a2('0x35')]){throw new db[(_0xc6a2('0x68'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x172d58=_0x18eb32;return db[_0xc6a2('0x86')]['findAll']({'raw':!![]});}return null;})[_0xc6a2('0x27')](function(_0x4d8fd7){if(_0x4d8fd7){_0x1e4679=_['keyBy'](_0x4d8fd7,'id');var _0xc55e63;var _0x82b343=squel[_0xc6a2('0x9c')]();_0x82b343['from'](_0x17dd65['table']);for(var _0x2d3fd8=0x0;_0x2d3fd8<_0x172d58['length'];_0x2d3fd8+=0x1){_0xc55e63=_0x172d58[_0x2d3fd8]['MetricId']?_0x1e4679[_0x172d58[_0x2d3fd8][_0xc6a2('0x6e')]][_0xc6a2('0x87')]:_0x172d58[_0x2d3fd8][_0xc6a2('0x65')];_0xc55e63=_0x172d58[_0x2d3fd8][_0xc6a2('0x6f')]?_[_0xc6a2('0x70')](_0x1e595f[_0x172d58[_0x2d3fd8]['function']],'%s',_0xc55e63):_0xc55e63;_0xc55e63=_0x172d58[_0x2d3fd8][_0xc6a2('0x71')]?_[_0xc6a2('0x70')](_0x202710[_0x172d58[_0x2d3fd8][_0xc6a2('0x71')]],'%s',_0xc55e63):_0xc55e63;if(_0x172d58[_0x2d3fd8][_0xc6a2('0x72')]){_0x82b343[_0xc6a2('0x64')](_0xc55e63);}_0x172d58[_0x2d3fd8][_0xc6a2('0x73')]&&_0x82b343['order'](_0xc55e63,_0x172d58[_0x2d3fd8][_0xc6a2('0x73')]===_0xc6a2('0x88')?![]:!![]);_0x82b343[_0xc6a2('0x65')](_0xc55e63,_0x172d58[_0x2d3fd8][_0xc6a2('0x89')]||_0xc55e63);}if(_0x17dd65[_0xc6a2('0x74')]){_0x17dd65[_0xc6a2('0x74')]=JSON[_0xc6a2('0x75')](_0x17dd65['joins']);for(var _0x53d555=0x0;_0x53d555<_0x17dd65[_0xc6a2('0x74')][_0xc6a2('0x35')];_0x53d555+=0x1){if(_0x17dd65[_0xc6a2('0x74')][_0x53d555][_0xc6a2('0x76')]&&_[_0xc6a2('0x5f')](_0x1782ef,_0x17dd65[_0xc6a2('0x74')][_0x53d555][_0xc6a2('0x76')])&&_0x17dd65['joins'][_0x53d555][_0xc6a2('0x77')]&&_0x17dd65[_0xc6a2('0x74')][_0x53d555][_0xc6a2('0x78')]&&_0x17dd65[_0xc6a2('0x74')][_0x53d555][_0xc6a2('0x79')]){_0x82b343[_0x17dd65[_0xc6a2('0x74')][_0x53d555][_0xc6a2('0x76')]](_0x17dd65[_0xc6a2('0x74')][_0x53d555][_0xc6a2('0x78')],null,util['format'](_0xc6a2('0xa2'),_0x17dd65[_0xc6a2('0x6d')],_0x17dd65[_0xc6a2('0x74')][_0x53d555]['parentKey'],_0x17dd65[_0xc6a2('0x74')][_0x53d555]['foreignTable'],_0x17dd65[_0xc6a2('0x74')][_0x53d555]['foreignKey']));}}}if(_0x17dd65[_0xc6a2('0x7a')]){_0x17dd65[_0xc6a2('0x7a')]=JSON[_0xc6a2('0x75')](_0x17dd65[_0xc6a2('0x7a')]);_0x82b343[_0xc6a2('0x3c')](_0x1f34f5(_0x17dd65['conditions'][_0xc6a2('0x64')]));}_0x4f9d6c=_0x82b343[_0xc6a2('0x7b')]();_0x82b343['limit'](_0x15556a);_0x82b343[_0xc6a2('0x1f')](0x0);logger[_0xc6a2('0x7c')](_0xc6a2('0x7d'),_0x82b343[_0xc6a2('0x7e')]());return dbH['sequelize'][_0xc6a2('0x31')](_0x82b343[_0xc6a2('0x7e')](),{'type':dbH[_0xc6a2('0x7f')][_0xc6a2('0x80')]['SELECT']});}})['then'](function(){return{'sql':_0x4f9d6c[_0xc6a2('0x7e')]()};})[_0xc6a2('0x27')](respondWithResult(_0xc0a7b2,null))[_0xc6a2('0x46')](handleError(_0xc0a7b2,null));}; \ No newline at end of file +var _0xe389=['foreignKey','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SEC_TO_TIME(%s)','AnalyticMetric','from','clone','web','fullPath','randomstring','generate','output','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','SUM(%s)','MAX(%s)','debug','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','order','orderBy','DESC','joins','parse','parentKey','foreignTable'];(function(_0x179d07,_0x29431a){var _0xbcbe0b=function(_0xaefa24){while(--_0xaefa24){_0x179d07['push'](_0x179d07['shift']());}};_0xbcbe0b(++_0x29431a);}(_0xe389,0x15a));var _0x9e38=function(_0x1d2455,_0x3cf9fc){_0x1d2455=_0x1d2455-0x0;var _0x2a061d=_0xe389[_0x1d2455];return _0x2a061d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9e38('0x0'));var jsonpatch=require(_0x9e38('0x1'));var rp=require(_0x9e38('0x2'));var moment=require('moment');var BPromise=require(_0x9e38('0x3'));var Mustache=require(_0x9e38('0x4'));var util=require(_0x9e38('0x5'));var path=require('path');var sox=require(_0x9e38('0x6'));var csv=require(_0x9e38('0x7'));var ejs=require(_0x9e38('0x8'));var fs=require('fs');var fs_extra=require(_0x9e38('0x9'));var _=require(_0x9e38('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9e38('0x7'));var querystring=require(_0x9e38('0xb'));var Papa=require('papaparse');var Redis=require(_0x9e38('0xc'));var authService=require(_0x9e38('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9e38('0xe'));var hardwareService=require(_0x9e38('0xf'));var logger=require(_0x9e38('0x10'))(_0x9e38('0x11'));var utils=require('../../config/utils');var config=require(_0x9e38('0x12'));var licenseUtil=require(_0x9e38('0x13'));var db=require(_0x9e38('0x14'))['db'];var dbH=require(_0x9e38('0x14'))['dbH'];function respondWithStatusCode(_0xd1a83,_0xfdae9){_0xfdae9=_0xfdae9||0xcc;return function(_0x273b2e){if(_0x273b2e){return _0xd1a83[_0x9e38('0x15')](_0xfdae9);}return _0xd1a83[_0x9e38('0x16')](_0xfdae9)[_0x9e38('0x17')]();};}function respondWithResult(_0x2172b6,_0x2fe0cd){_0x2fe0cd=_0x2fe0cd||0xc8;return function(_0x5804eb){if(_0x5804eb){return _0x2172b6[_0x9e38('0x16')](_0x2fe0cd)['json'](_0x5804eb);}};}function respondWithFilteredResult(_0x4383fd,_0x3d5828){return function(_0x3e11df){if(_0x3e11df){var _0x57878a=_0x3e11df[_0x9e38('0x18')],_0x2ab87d=_0x3d5828[_0x9e38('0x19')],_0x320b05=_0x3d5828[_0x9e38('0x19')]+_0x3d5828[_0x9e38('0x1a')],_0x1b6696;if(_0x320b05>=_0x57878a){_0x320b05=_0x57878a;_0x1b6696=0xc8;}else{_0x1b6696=0xce;}_0x4383fd[_0x9e38('0x16')](_0x1b6696);return _0x4383fd[_0x9e38('0x1b')](_0x9e38('0x1c'),_0x2ab87d+'-'+_0x320b05+'/'+_0x57878a)[_0x9e38('0x1d')](_0x3e11df);}return null;};}function patchUpdates(_0x561b2c){return function(_0x5f0f60){try{jsonpatch[_0x9e38('0x1e')](_0x5f0f60,_0x561b2c,!![]);}catch(_0x36316a){return BPromise['reject'](_0x36316a);}return _0x5f0f60[_0x9e38('0x1f')]();};}function saveUpdates(_0x55cfac,_0x237d24){return function(_0x21d1bb){if(_0x21d1bb){return _0x21d1bb[_0x9e38('0x20')](_0x55cfac)[_0x9e38('0x21')](function(_0x2e339d){return _0x2e339d;});}return null;};}function removeEntity(_0x447df3,_0x515db6){return function(_0x48e39e){if(_0x48e39e){return _0x48e39e[_0x9e38('0x22')]()[_0x9e38('0x21')](function(){var _0x3f7c8b=_0x48e39e[_0x9e38('0x23')]({'plain':!![]});var _0x340681=_0x9e38('0x24');return db[_0x9e38('0x25')][_0x9e38('0x22')]({'where':{'type':_0x340681,'resourceId':_0x3f7c8b['id']}})[_0x9e38('0x21')](function(){return _0x48e39e;});})['then'](function(){_0x447df3['status'](0xcc)[_0x9e38('0x17')]();});}};}function handleEntityNotFound(_0x26e1f1,_0xdaa430){return function(_0x1726d4){if(!_0x1726d4){_0x26e1f1['sendStatus'](0x194);}return _0x1726d4;};}function handleError(_0x44b80e,_0x5ec978){_0x5ec978=_0x5ec978||0x1f4;return function(_0x1df95b){logger[_0x9e38('0x26')](_0x1df95b[_0x9e38('0x27')]);if(_0x1df95b[_0x9e38('0x28')]){delete _0x1df95b[_0x9e38('0x28')];}_0x44b80e[_0x9e38('0x16')](_0x5ec978)[_0x9e38('0x29')](_0x1df95b);};}exports[_0x9e38('0x2a')]=function(_0x1f5ebc,_0x4538a1){var _0x518ba9={},_0x47dc71={},_0x479169={'count':0x0,'rows':[]};var _0x206b0b=_[_0x9e38('0x2b')](db[_0x9e38('0x2c')]['rawAttributes'],function(_0x376b56){return{'name':_0x376b56[_0x9e38('0x2d')],'type':_0x376b56[_0x9e38('0x2e')]['key']};});_0x47dc71['model']=_[_0x9e38('0x2b')](_0x206b0b,_0x9e38('0x28'));_0x47dc71[_0x9e38('0x2f')]=_['keys'](_0x1f5ebc[_0x9e38('0x2f')]);_0x47dc71[_0x9e38('0x30')]=_[_0x9e38('0x31')](_0x47dc71[_0x9e38('0x32')],_0x47dc71['query']);_0x518ba9['attributes']=_[_0x9e38('0x31')](_0x47dc71[_0x9e38('0x32')],qs['fields'](_0x1f5ebc[_0x9e38('0x2f')][_0x9e38('0x33')]));_0x518ba9[_0x9e38('0x34')]=_0x518ba9['attributes'][_0x9e38('0x35')]?_0x518ba9[_0x9e38('0x34')]:_0x47dc71['model'];if(!_0x1f5ebc[_0x9e38('0x2f')][_0x9e38('0x36')]('nolimit')){_0x518ba9['limit']=qs[_0x9e38('0x1a')](_0x1f5ebc[_0x9e38('0x2f')]['limit']);_0x518ba9[_0x9e38('0x19')]=qs[_0x9e38('0x19')](_0x1f5ebc[_0x9e38('0x2f')][_0x9e38('0x19')]);}_0x518ba9['order']=qs[_0x9e38('0x37')](_0x1f5ebc[_0x9e38('0x2f')]['sort']);_0x518ba9[_0x9e38('0x38')]=qs[_0x9e38('0x30')](_[_0x9e38('0x39')](_0x1f5ebc[_0x9e38('0x2f')],_0x47dc71[_0x9e38('0x30')]),_0x206b0b);if(_0x1f5ebc[_0x9e38('0x2f')][_0x9e38('0x3a')]){_0x518ba9[_0x9e38('0x38')]=_['merge'](_0x518ba9[_0x9e38('0x38')],{'$or':_['map'](_0x206b0b,function(_0xd2706a){if(_0xd2706a[_0x9e38('0x2e')]!==_0x9e38('0x3b')){var _0x3aa219={};_0x3aa219[_0xd2706a[_0x9e38('0x28')]]={'$like':'%'+_0x1f5ebc[_0x9e38('0x2f')][_0x9e38('0x3a')]+'%'};return _0x3aa219;}})});}_0x518ba9=_['merge']({},_0x518ba9,_0x1f5ebc['options']);var _0x225261={'where':_0x518ba9[_0x9e38('0x38')]};return db[_0x9e38('0x2c')]['count'](_0x225261)[_0x9e38('0x21')](function(_0x13b9e8){_0x479169[_0x9e38('0x18')]=_0x13b9e8;if(_0x1f5ebc['query'][_0x9e38('0x3c')]){_0x518ba9[_0x9e38('0x3d')]=[{'all':!![]}];}return db[_0x9e38('0x2c')][_0x9e38('0x3e')](_0x518ba9);})['then'](function(_0x579a6b){_0x479169[_0x9e38('0x3f')]=_0x579a6b;return _0x479169;})[_0x9e38('0x21')](respondWithFilteredResult(_0x4538a1,_0x518ba9))[_0x9e38('0x40')](handleError(_0x4538a1,null));};exports[_0x9e38('0x41')]=function(_0x12e785,_0x57ff30){var _0x33553d={'raw':![],'where':{'id':_0x12e785[_0x9e38('0x42')]['id']}},_0x209522={};_0x209522['model']=_[_0x9e38('0x43')](db[_0x9e38('0x2c')][_0x9e38('0x44')]);_0x209522['query']=_['keys'](_0x12e785[_0x9e38('0x2f')]);_0x209522[_0x9e38('0x30')]=_[_0x9e38('0x31')](_0x209522[_0x9e38('0x32')],_0x209522[_0x9e38('0x2f')]);_0x33553d[_0x9e38('0x34')]=_[_0x9e38('0x31')](_0x209522[_0x9e38('0x32')],qs['fields'](_0x12e785[_0x9e38('0x2f')][_0x9e38('0x33')]));_0x33553d[_0x9e38('0x34')]=_0x33553d[_0x9e38('0x34')][_0x9e38('0x35')]?_0x33553d[_0x9e38('0x34')]:_0x209522[_0x9e38('0x32')];if(_0x12e785[_0x9e38('0x2f')][_0x9e38('0x3c')]){_0x33553d[_0x9e38('0x3d')]=[{'all':!![]}];}_0x33553d=_[_0x9e38('0x45')]({},_0x33553d,_0x12e785[_0x9e38('0x46')]);return db[_0x9e38('0x2c')][_0x9e38('0x47')](_0x33553d)[_0x9e38('0x21')](handleEntityNotFound(_0x57ff30,null))[_0x9e38('0x21')](respondWithResult(_0x57ff30,null))[_0x9e38('0x40')](handleError(_0x57ff30,null));};exports[_0x9e38('0x48')]=function(_0x43e7be,_0x26f0bf){return db[_0x9e38('0x2c')][_0x9e38('0x48')](_0x43e7be[_0x9e38('0x49')],{})[_0x9e38('0x21')](function(_0xce77be){var _0x17a6aa=_0x43e7be[_0x9e38('0x4a')]['get']({'plain':!![]});if(!_0x17a6aa)throw new Error(_0x9e38('0x4b'));if(_0x17a6aa['role']===_0x9e38('0x4a')){var _0x295cea=_0xce77be[_0x9e38('0x23')]({'plain':!![]});var _0xf4f6c4=_0x9e38('0x4c');return db[_0x9e38('0x4d')]['find']({'where':{'name':_0xf4f6c4,'userProfileId':_0x17a6aa['userProfileId']},'raw':!![]})[_0x9e38('0x21')](function(_0x3ea388){if(_0x3ea388&&_0x3ea388[_0x9e38('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x295cea[_0x9e38('0x28')],'resourceId':_0x295cea['id'],'type':_0x9e38('0x24'),'sectionId':_0x3ea388['id']},{})[_0x9e38('0x21')](function(){return _0xce77be;});}else{return _0xce77be;}})['catch'](function(_0x395c78){logger[_0x9e38('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x395c78);throw _0x395c78;});}return _0xce77be;})[_0x9e38('0x21')](respondWithResult(_0x26f0bf,0xc9))[_0x9e38('0x40')](handleError(_0x26f0bf,null));};exports[_0x9e38('0x20')]=function(_0x285f16,_0x350c3d){if(_0x285f16[_0x9e38('0x49')]['id']){delete _0x285f16[_0x9e38('0x49')]['id'];}return db[_0x9e38('0x2c')][_0x9e38('0x47')]({'where':{'id':_0x285f16[_0x9e38('0x42')]['id']}})['then'](handleEntityNotFound(_0x350c3d,null))['then'](saveUpdates(_0x285f16['body'],null))[_0x9e38('0x21')](respondWithResult(_0x350c3d,null))[_0x9e38('0x40')](handleError(_0x350c3d,null));};exports['destroy']=function(_0x452ce5,_0x12f705){return db['AnalyticCustomReport'][_0x9e38('0x47')]({'where':{'id':_0x452ce5[_0x9e38('0x42')]['id']}})['then'](handleEntityNotFound(_0x12f705,null))[_0x9e38('0x21')](removeEntity(_0x12f705,null))[_0x9e38('0x40')](handleError(_0x12f705,null));};exports[_0x9e38('0x4f')]=function(_0x3f68f0,_0x376791){var _0x48fd7e=0xa;var _0x70cbcb=[_0x9e38('0x50'),_0x9e38('0x51'),_0x9e38('0x52'),_0x9e38('0x53')];var _0x3a74ab={'SUM':'SUM(%s)','COUNT':_0x9e38('0x54'),'COUNT DISTINCT':_0x9e38('0x55'),'MAX':'MAX(%s)','MIN':_0x9e38('0x56'),'AVG':_0x9e38('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x9e38('0x58'),'GROUP_CONCAT DESC':_0x9e38('0x59')};var _0x3b77a7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9e38('0x5a'),'HOUR':_0x9e38('0x5b'),'ROUND':_0x9e38('0x5c'),'UNIX_TIMESTAMP':_0x9e38('0x5d')};var _0x48ac9f=function(_0x3d6388){return!_[_0x9e38('0x5e')]([_0x9e38('0x5f'),_0x9e38('0x60'),_0x9e38('0x61'),_0x9e38('0x62')],_0x3d6388);};var _0x1e4caf=function(_0x2f23d5){if(!_0x2f23d5||!_0x2f23d5[_0x9e38('0x63')][_0x9e38('0x35')]){return'';}for(var _0x234b36='(',_0xcb9ce1=0x0;_0xcb9ce1<_0x2f23d5[_0x9e38('0x63')]['length'];_0xcb9ce1+=0x1){_0xcb9ce1>0x0&&(_0x234b36+='\x20'+_0x2f23d5[_0x9e38('0x64')]+'\x20');_0x234b36+=_0x2f23d5['rules'][_0xcb9ce1][_0x9e38('0x65')]?_0x1e4caf(_0x2f23d5[_0x9e38('0x63')][_0xcb9ce1][_0x9e38('0x65')]):_0x2f23d5[_0x9e38('0x63')][_0xcb9ce1][_0x9e38('0x66')]+'\x20'+_0x2f23d5[_0x9e38('0x63')][_0xcb9ce1][_0x9e38('0x67')]+(_0x48ac9f(_0x2f23d5[_0x9e38('0x63')][_0xcb9ce1][_0x9e38('0x67')])?'\x20'+_0x2f23d5[_0x9e38('0x63')][_0xcb9ce1][_0x9e38('0x68')]:'');}return _0x234b36+')';};var _0x308514={'where':{'id':_0x3f68f0['params']['id']}},_0x578fc8,_0x404d5e,_0x17fcd8,_0x19d686,_0x15b03b;_0x308514=_[_0x9e38('0x45')]({},_0x308514,_0x3f68f0[_0x9e38('0x46')]);return db['AnalyticCustomReport']['find'](_0x308514)[_0x9e38('0x21')](function(_0x1e99e1){if(_0x1e99e1){_0x578fc8=_0x1e99e1;return _0x1e99e1[_0x9e38('0x69')]();}return null;})[_0x9e38('0x21')](function(_0x3cea04){if(_0x3cea04){if(!_0x3cea04[_0x9e38('0x35')]){throw new db[(_0x9e38('0x6a'))][(_0x9e38('0x6b'))](_0x9e38('0x6c'),0x193);}_0x404d5e=_0x3cea04;return db['AnalyticMetric'][_0x9e38('0x3e')]({'raw':!![]});}return null;})['then'](function(_0x1aa509){if(_0x1aa509){_0x17fcd8=_[_0x9e38('0x6d')](_0x1aa509,'id');var _0x182c36;var _0x43b94a=squel[_0x9e38('0x6e')]();_0x43b94a['from'](_0x578fc8[_0x9e38('0x6f')]);for(var _0x36bba0=0x0;_0x36bba0<_0x404d5e[_0x9e38('0x35')];_0x36bba0+=0x1){_0x182c36=_0x404d5e[_0x36bba0][_0x9e38('0x70')]?_0x17fcd8[_0x404d5e[_0x36bba0][_0x9e38('0x70')]][_0x9e38('0x71')]:_0x404d5e[_0x36bba0][_0x9e38('0x66')];_0x182c36=_0x404d5e[_0x36bba0][_0x9e38('0x72')]?_[_0x9e38('0x73')](_0x3a74ab[_0x404d5e[_0x36bba0][_0x9e38('0x72')]],'%s',_0x182c36):_0x182c36;_0x182c36=_0x404d5e[_0x36bba0][_0x9e38('0x74')]?_[_0x9e38('0x73')](_0x3b77a7[_0x404d5e[_0x36bba0][_0x9e38('0x74')]],'%s',_0x182c36):_0x182c36;if(_0x404d5e[_0x36bba0][_0x9e38('0x75')]){_0x43b94a[_0x9e38('0x65')](_0x182c36);}_0x404d5e[_0x36bba0]['orderBy']&&_0x43b94a[_0x9e38('0x76')](_0x182c36,_0x404d5e[_0x36bba0][_0x9e38('0x77')]===_0x9e38('0x78')?![]:!![]);_0x43b94a['field'](_0x182c36,_0x404d5e[_0x36bba0]['alias']||_0x182c36);}if(_0x578fc8[_0x9e38('0x79')]){_0x578fc8['joins']=JSON[_0x9e38('0x7a')](_0x578fc8[_0x9e38('0x79')]);for(var _0x541386=0x0;_0x541386<_0x578fc8[_0x9e38('0x79')][_0x9e38('0x35')];_0x541386+=0x1){if(_0x578fc8[_0x9e38('0x79')][_0x541386][_0x9e38('0x2e')]&&_['includes'](_0x70cbcb,_0x578fc8['joins'][_0x541386][_0x9e38('0x2e')])&&_0x578fc8['joins'][_0x541386][_0x9e38('0x7b')]&&_0x578fc8['joins'][_0x541386][_0x9e38('0x7c')]&&_0x578fc8[_0x9e38('0x79')][_0x541386][_0x9e38('0x7d')]){_0x43b94a[_0x578fc8['joins'][_0x541386][_0x9e38('0x2e')]](_0x578fc8[_0x9e38('0x79')][_0x541386][_0x9e38('0x7c')],null,util['format'](_0x9e38('0x7e'),_0x578fc8[_0x9e38('0x6f')],_0x578fc8[_0x9e38('0x79')][_0x541386]['parentKey'],_0x578fc8['joins'][_0x541386][_0x9e38('0x7c')],_0x578fc8[_0x9e38('0x79')][_0x541386][_0x9e38('0x7d')]));}}}if(_0x578fc8['conditions']){_0x578fc8[_0x9e38('0x7f')]=JSON[_0x9e38('0x7a')](_0x578fc8[_0x9e38('0x7f')]);_0x43b94a[_0x9e38('0x38')](_0x1e4caf(_0x578fc8[_0x9e38('0x7f')]['group']));}_0x15b03b=_0x43b94a['clone']();_0x43b94a['limit'](_0x48fd7e);_0x43b94a[_0x9e38('0x19')](0x0);logger['debug'](_0x9e38('0x80'),_0x43b94a[_0x9e38('0x81')]());return dbH[_0x9e38('0x82')][_0x9e38('0x2f')](_0x43b94a['toString'](),{'type':dbH['sequelize'][_0x9e38('0x83')][_0x9e38('0x84')]});}})['then'](respondWithResult(_0x376791,null))[_0x9e38('0x40')](handleError(_0x376791,null));};function runReport(_0x3917c6,_0x5eeab2,_0x2b3247){var _0x1cadbb=_0x5eeab2[_0x9e38('0x28')];var _0x23c56b=0xa;var _0x310ffe=[_0x9e38('0x50'),'left_join','right_join','cross_join'];var _0x39bd10={'SUM':'SUM(%s)','COUNT':_0x9e38('0x54'),'COUNT DISTINCT':_0x9e38('0x55'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x9e38('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x9e38('0x58'),'GROUP_CONCAT DESC':_0x9e38('0x59')};var _0x44eaf9={'SEC_TO_TIME':_0x9e38('0x85'),'DATE':_0x9e38('0x5a'),'HOUR':_0x9e38('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9e38('0x5d')};var _0x5a8c06=function(_0x25a2d9){return!_[_0x9e38('0x5e')]([_0x9e38('0x5f'),_0x9e38('0x60'),'IS\x20EMPTY',_0x9e38('0x62')],_0x25a2d9);};var _0x60a26a=function(_0x4bad13){if(!_0x4bad13||!_0x4bad13[_0x9e38('0x63')][_0x9e38('0x35')]){return'';}for(var _0x5320b1='(',_0x1a8f3e=0x0;_0x1a8f3e<_0x4bad13['rules'][_0x9e38('0x35')];_0x1a8f3e+=0x1){_0x1a8f3e>0x0&&(_0x5320b1+='\x20'+_0x4bad13[_0x9e38('0x64')]+'\x20');_0x5320b1+=_0x4bad13[_0x9e38('0x63')][_0x1a8f3e][_0x9e38('0x65')]?_0x60a26a(_0x4bad13[_0x9e38('0x63')][_0x1a8f3e]['group']):_0x4bad13['rules'][_0x1a8f3e][_0x9e38('0x66')]+'\x20'+_0x4bad13[_0x9e38('0x63')][_0x1a8f3e]['condition']+(_0x5a8c06(_0x4bad13[_0x9e38('0x63')][_0x1a8f3e][_0x9e38('0x67')])?'\x20'+_0x4bad13[_0x9e38('0x63')][_0x1a8f3e][_0x9e38('0x68')]:'');}return _0x5320b1+')';};var _0x1b0d11={'where':{'id':_0x3917c6['id']}},_0x2e0393,_0x32b352,_0x12e79d,_0x37b4ce,_0x5b63f3;_0x1b0d11=_[_0x9e38('0x45')]({},_0x1b0d11,_0x2b3247);return db[_0x9e38('0x2c')][_0x9e38('0x47')](_0x1b0d11)[_0x9e38('0x21')](function(_0x1522df){if(_0x1522df){_0x2e0393=_0x1522df;return _0x1522df[_0x9e38('0x69')]();}return null;})[_0x9e38('0x21')](function(_0x3fe5b1){if(_0x3fe5b1){if(!_0x3fe5b1['length']){throw new db[(_0x9e38('0x6a'))][(_0x9e38('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x32b352=_0x3fe5b1;return db[_0x9e38('0x86')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x5c3aa8){if(_0x5c3aa8){_0x12e79d=_[_0x9e38('0x6d')](_0x5c3aa8,'id');var _0x338b2a;var _0x3e77d2=squel['select']();_0x3e77d2[_0x9e38('0x87')](_0x2e0393[_0x9e38('0x6f')]);for(var _0x1c435b=0x0;_0x1c435b<_0x32b352[_0x9e38('0x35')];_0x1c435b+=0x1){_0x338b2a=_0x32b352[_0x1c435b]['MetricId']?_0x12e79d[_0x32b352[_0x1c435b][_0x9e38('0x70')]][_0x9e38('0x71')]:_0x32b352[_0x1c435b][_0x9e38('0x66')];_0x338b2a=_0x32b352[_0x1c435b]['function']?_['replace'](_0x39bd10[_0x32b352[_0x1c435b]['function']],'%s',_0x338b2a):_0x338b2a;_0x338b2a=_0x32b352[_0x1c435b][_0x9e38('0x74')]?_[_0x9e38('0x73')](_0x44eaf9[_0x32b352[_0x1c435b][_0x9e38('0x74')]],'%s',_0x338b2a):_0x338b2a;if(_0x32b352[_0x1c435b][_0x9e38('0x75')]){_0x3e77d2[_0x9e38('0x65')](_0x338b2a);}_0x32b352[_0x1c435b][_0x9e38('0x77')]&&_0x3e77d2[_0x9e38('0x76')](_0x338b2a,_0x32b352[_0x1c435b][_0x9e38('0x77')]===_0x9e38('0x78')?![]:!![]);_0x3e77d2[_0x9e38('0x66')](_0x338b2a,_0x32b352[_0x1c435b]['alias']||_0x338b2a);}if(_0x2e0393[_0x9e38('0x79')]){_0x2e0393['joins']=JSON[_0x9e38('0x7a')](_0x2e0393[_0x9e38('0x79')]);for(var _0x578be7=0x0;_0x578be7<_0x2e0393[_0x9e38('0x79')][_0x9e38('0x35')];_0x578be7+=0x1){if(_0x2e0393['joins'][_0x578be7][_0x9e38('0x2e')]&&_[_0x9e38('0x5e')](_0x310ffe,_0x2e0393[_0x9e38('0x79')][_0x578be7][_0x9e38('0x2e')])&&_0x2e0393['joins'][_0x578be7]['parentKey']&&_0x2e0393['joins'][_0x578be7]['foreignTable']&&_0x2e0393[_0x9e38('0x79')][_0x578be7]['foreignKey']){_0x3e77d2[_0x2e0393[_0x9e38('0x79')][_0x578be7][_0x9e38('0x2e')]](_0x2e0393[_0x9e38('0x79')][_0x578be7][_0x9e38('0x7c')],null,util[_0x9e38('0x74')](_0x9e38('0x7e'),_0x2e0393[_0x9e38('0x6f')],_0x2e0393[_0x9e38('0x79')][_0x578be7]['parentKey'],_0x2e0393[_0x9e38('0x79')][_0x578be7]['foreignTable'],_0x2e0393[_0x9e38('0x79')][_0x578be7]['foreignKey']));}}}if(_0x2e0393['conditions']){_0x2e0393[_0x9e38('0x7f')]=JSON['parse'](_0x2e0393[_0x9e38('0x7f')]);_0x3e77d2[_0x9e38('0x38')](_0x60a26a(_0x2e0393['conditions']['group']));}_0x5b63f3=_0x3e77d2[_0x9e38('0x88')]();_0x3e77d2[_0x9e38('0x1a')](_0x23c56b);_0x3e77d2['offset'](0x0);return;}})[_0x9e38('0x21')](function(){if(_0x5eeab2['output']===_0x9e38('0x89')){return null;}var _0x3af8de=_[_0x9e38('0x45')](_0x5eeab2,{'name':_0x5eeab2[_0x9e38('0x8a')]||_0x5eeab2[_0x9e38('0x28')]||_0x2e0393[_0x9e38('0x28')],'basename':_0x1cadbb,'savename':util['format']('%s-%s.%s',_0x5eeab2[_0x9e38('0x28')]||_0x2e0393[_0x9e38('0x28')],require(_0x9e38('0x8b'))[_0x9e38('0x8c')](0x4),_0x5eeab2[_0x9e38('0x8d')]||'csv'),'reportId':_0x2e0393['id'],'reportType':_0x9e38('0x8e')});return db[_0x9e38('0x8f')][_0x9e38('0x48')](_0x3af8de,{'raw':!![]});})[_0x9e38('0x21')](function(_0x3c708b){if(_0x2e0393['table']==='cdr'){_0x5b63f3[_0x9e38('0x38')](_0x2e0393[_0x9e38('0x6f')]+_0x9e38('0x90'),_0x5eeab2['startDate'],_0x5eeab2['endDate']);}else{_0x5b63f3['where'](_0x2e0393[_0x9e38('0x6f')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5eeab2['startDate'],_0x5eeab2['endDate']);}if(_0x3c708b){logger[_0x9e38('0x91')]('Run\x20Query:',_0x5b63f3[_0x9e38('0x81')]());require(_0x9e38('0x92'))[_0x9e38('0x93')](path['join'](__dirname,_0x9e38('0x94'),_0x3c708b[_0x9e38('0x8d')]),[_0x3c708b['id'],_0x5b63f3[_0x9e38('0x81')](),path[_0x9e38('0x50')](__dirname,_0x9e38('0x95'),_0x3c708b[_0x9e38('0x96')]),_0x1cadbb]);return _0x3c708b;}else{var _0x505e37=squel[_0x9e38('0x6e')]();_0x505e37['from']('('+_0x5b63f3[_0x9e38('0x81')]()+')',_0x9e38('0x97'));_0x505e37[_0x9e38('0x66')]('COUNT(*)',_0x9e38('0x18'));_0x5b63f3[_0x9e38('0x1a')](_0x5eeab2['limit']||_0x23c56b);_0x5b63f3['offset'](_0x5eeab2[_0x9e38('0x19')]||0x0);return dbH[_0x9e38('0x82')][_0x9e38('0x2f')](_0x505e37['toString'](),{'type':dbH[_0x9e38('0x82')]['QueryTypes'][_0x9e38('0x84')]})[_0x9e38('0x21')](function(_0x39bbd9){if(!_0x39bbd9[_0x9e38('0x35')]){_0x37b4ce=0x0;}else{_0x37b4ce=_0x39bbd9[0x0][_0x9e38('0x18')]||0x0;}return dbH[_0x9e38('0x82')][_0x9e38('0x2f')](_0x5b63f3['toString'](),{'type':dbH[_0x9e38('0x82')][_0x9e38('0x83')]['SELECT']});})[_0x9e38('0x21')](function(_0x297301){return{'rows':_0x297301||[],'count':_0x37b4ce};});}});}exports[_0x9e38('0x98')]=function(_0x42de0c,_0x3b52be){return runReport(_0x42de0c[_0x9e38('0x42')],_0x42de0c['query'],_0x42de0c[_0x9e38('0x46')])[_0x9e38('0x21')](respondWithResult(_0x3b52be,null))['catch'](handleError(_0x3b52be,null));};exports[_0x9e38('0x99')]=runReport;exports[_0x9e38('0x2f')]=function(_0x30bea9,_0x4649ba){var _0x45bab8=0xa;var _0xf5b8c5=[_0x9e38('0x50'),_0x9e38('0x51'),'right_join','cross_join'];var _0x169bd4={'SUM':_0x9e38('0x9a'),'COUNT':_0x9e38('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9e38('0x9b'),'MIN':'MIN(%s)','AVG':_0x9e38('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x9e38('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x54c3df={'SEC_TO_TIME':_0x9e38('0x85'),'DATE':_0x9e38('0x5a'),'HOUR':_0x9e38('0x5b'),'ROUND':_0x9e38('0x5c'),'UNIX_TIMESTAMP':_0x9e38('0x5d')};var _0x413c60=function(_0x1b7c22){return!_[_0x9e38('0x5e')]([_0x9e38('0x5f'),'IS\x20NOT\x20NULL',_0x9e38('0x61'),_0x9e38('0x62')],_0x1b7c22);};var _0x4d6adb=function(_0x363ba4){if(!_0x363ba4||!_0x363ba4[_0x9e38('0x63')][_0x9e38('0x35')]){return'';}for(var _0xe88dc4='(',_0x355b2f=0x0;_0x355b2f<_0x363ba4[_0x9e38('0x63')][_0x9e38('0x35')];_0x355b2f+=0x1){_0x355b2f>0x0&&(_0xe88dc4+='\x20'+_0x363ba4['operator']+'\x20');_0xe88dc4+=_0x363ba4[_0x9e38('0x63')][_0x355b2f][_0x9e38('0x65')]?_0x4d6adb(_0x363ba4[_0x9e38('0x63')][_0x355b2f][_0x9e38('0x65')]):_0x363ba4['rules'][_0x355b2f]['field']+'\x20'+_0x363ba4['rules'][_0x355b2f][_0x9e38('0x67')]+(_0x413c60(_0x363ba4['rules'][_0x355b2f][_0x9e38('0x67')])?'\x20'+_0x363ba4[_0x9e38('0x63')][_0x355b2f][_0x9e38('0x68')]:'');}return _0xe88dc4+')';};var _0x8ccf65={'where':{'id':_0x30bea9[_0x9e38('0x42')]['id']}},_0x49ab25,_0x380b30,_0x5a9b93,_0x2cfd61,_0x3221a8;_0x8ccf65=_[_0x9e38('0x45')]({},_0x8ccf65,_0x30bea9[_0x9e38('0x46')]);return db[_0x9e38('0x2c')][_0x9e38('0x47')](_0x8ccf65)[_0x9e38('0x21')](function(_0x363e6b){if(_0x363e6b){_0x49ab25=_0x363e6b;return _0x363e6b[_0x9e38('0x69')]();}return null;})['then'](function(_0x4bd2da){if(_0x4bd2da){if(!_0x4bd2da[_0x9e38('0x35')]){throw new db[(_0x9e38('0x6a'))][(_0x9e38('0x6b'))](_0x9e38('0x6c'),0x193);}_0x380b30=_0x4bd2da;return db[_0x9e38('0x86')]['findAll']({'raw':!![]});}return null;})[_0x9e38('0x21')](function(_0x107d61){if(_0x107d61){_0x5a9b93=_[_0x9e38('0x6d')](_0x107d61,'id');var _0x5e2fcf;var _0x35075e=squel[_0x9e38('0x6e')]();_0x35075e[_0x9e38('0x87')](_0x49ab25[_0x9e38('0x6f')]);for(var _0x1027e7=0x0;_0x1027e7<_0x380b30[_0x9e38('0x35')];_0x1027e7+=0x1){_0x5e2fcf=_0x380b30[_0x1027e7][_0x9e38('0x70')]?_0x5a9b93[_0x380b30[_0x1027e7][_0x9e38('0x70')]][_0x9e38('0x71')]:_0x380b30[_0x1027e7][_0x9e38('0x66')];_0x5e2fcf=_0x380b30[_0x1027e7][_0x9e38('0x72')]?_['replace'](_0x169bd4[_0x380b30[_0x1027e7]['function']],'%s',_0x5e2fcf):_0x5e2fcf;_0x5e2fcf=_0x380b30[_0x1027e7]['format']?_['replace'](_0x54c3df[_0x380b30[_0x1027e7][_0x9e38('0x74')]],'%s',_0x5e2fcf):_0x5e2fcf;if(_0x380b30[_0x1027e7][_0x9e38('0x75')]){_0x35075e[_0x9e38('0x65')](_0x5e2fcf);}_0x380b30[_0x1027e7]['orderBy']&&_0x35075e[_0x9e38('0x76')](_0x5e2fcf,_0x380b30[_0x1027e7][_0x9e38('0x77')]===_0x9e38('0x78')?![]:!![]);_0x35075e['field'](_0x5e2fcf,_0x380b30[_0x1027e7]['alias']||_0x5e2fcf);}if(_0x49ab25[_0x9e38('0x79')]){_0x49ab25['joins']=JSON['parse'](_0x49ab25[_0x9e38('0x79')]);for(var _0x448fe3=0x0;_0x448fe3<_0x49ab25['joins'][_0x9e38('0x35')];_0x448fe3+=0x1){if(_0x49ab25[_0x9e38('0x79')][_0x448fe3]['type']&&_[_0x9e38('0x5e')](_0xf5b8c5,_0x49ab25[_0x9e38('0x79')][_0x448fe3][_0x9e38('0x2e')])&&_0x49ab25[_0x9e38('0x79')][_0x448fe3][_0x9e38('0x7b')]&&_0x49ab25[_0x9e38('0x79')][_0x448fe3][_0x9e38('0x7c')]&&_0x49ab25[_0x9e38('0x79')][_0x448fe3]['foreignKey']){_0x35075e[_0x49ab25[_0x9e38('0x79')][_0x448fe3][_0x9e38('0x2e')]](_0x49ab25[_0x9e38('0x79')][_0x448fe3]['foreignTable'],null,util[_0x9e38('0x74')](_0x9e38('0x7e'),_0x49ab25[_0x9e38('0x6f')],_0x49ab25[_0x9e38('0x79')][_0x448fe3]['parentKey'],_0x49ab25[_0x9e38('0x79')][_0x448fe3][_0x9e38('0x7c')],_0x49ab25[_0x9e38('0x79')][_0x448fe3][_0x9e38('0x7d')]));}}}if(_0x49ab25[_0x9e38('0x7f')]){_0x49ab25[_0x9e38('0x7f')]=JSON[_0x9e38('0x7a')](_0x49ab25[_0x9e38('0x7f')]);_0x35075e[_0x9e38('0x38')](_0x4d6adb(_0x49ab25[_0x9e38('0x7f')][_0x9e38('0x65')]));}_0x3221a8=_0x35075e['clone']();_0x35075e['limit'](_0x45bab8);_0x35075e['offset'](0x0);logger[_0x9e38('0x9c')](_0x9e38('0x80'),_0x35075e[_0x9e38('0x81')]());return dbH[_0x9e38('0x82')]['query'](_0x35075e['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x9e38('0x84')]});}})[_0x9e38('0x21')](function(){return{'sql':_0x3221a8[_0x9e38('0x81')]()};})[_0x9e38('0x21')](respondWithResult(_0x4649ba,null))[_0x9e38('0x40')](handleError(_0x4649ba,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 351c416..6b910c4 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 _0x8cc3=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x8cc3,0x103));var _0x38cc=function(_0x5dccf9,_0x52dafd){_0x5dccf9=_0x5dccf9-0x0;var _0x62860e=_0x8cc3[_0x5dccf9];return _0x62860e;};'use strict';var _=require(_0x38cc('0x0'));var util=require(_0x38cc('0x1'));var logger=require(_0x38cc('0x2'))(_0x38cc('0x3'));var moment=require(_0x38cc('0x4'));var BPromise=require(_0x38cc('0x5'));var rp=require(_0x38cc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38cc('0x7'));var config=require(_0x38cc('0x8'));var attributes=require(_0x38cc('0x9'));module[_0x38cc('0xa')]=function(_0x874da5,_0x55810a){return _0x874da5[_0x38cc('0xb')](_0x38cc('0xc'),attributes,{'tableName':_0x38cc('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b81=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','util','api','moment','bluebird'];(function(_0x4046b6,_0x238c36){var _0x1443be=function(_0x2e6c5d){while(--_0x2e6c5d){_0x4046b6['push'](_0x4046b6['shift']());}};_0x1443be(++_0x238c36);}(_0x3b81,0xec));var _0x13b8=function(_0x3fe2d9,_0x330323){_0x3fe2d9=_0x3fe2d9-0x0;var _0x182e7c=_0x3b81[_0x3fe2d9];return _0x182e7c;};'use strict';var _=require('lodash');var util=require(_0x13b8('0x0'));var logger=require('../../config/logger')(_0x13b8('0x1'));var moment=require(_0x13b8('0x2'));var BPromise=require(_0x13b8('0x3'));var rp=require(_0x13b8('0x4'));var fs=require('fs');var path=require(_0x13b8('0x5'));var rimraf=require(_0x13b8('0x6'));var config=require(_0x13b8('0x7'));var attributes=require(_0x13b8('0x8'));module['exports']=function(_0x4be8ed,_0xa59068){return _0x4be8ed[_0x13b8('0x9')](_0x13b8('0xa'),attributes,{'tableName':_0x13b8('0xb'),'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 00c1897..4cc9ff2 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 _0x7840=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird'];(function(_0x4a3d0f,_0x4ac17a){var _0x254d8e=function(_0x20d5b1){while(--_0x20d5b1){_0x4a3d0f['push'](_0x4a3d0f['shift']());}};_0x254d8e(++_0x4ac17a);}(_0x7840,0x1e4));var _0x0784=function(_0x4c54c0,_0x1f9b82){_0x4c54c0=_0x4c54c0-0x0;var _0x9dd09d=_0x7840[_0x4c54c0];return _0x9dd09d;};'use strict';var _=require(_0x0784('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0784('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0784('0x2'));var db=require(_0x0784('0x3'))['db'];var utils=require(_0x0784('0x4'));var logger=require(_0x0784('0x5'))('rpc');var config=require(_0x0784('0x6'));var jayson=require(_0x0784('0x7'));var client=jayson[_0x0784('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe47192,_0x4c6ec2,_0x470352){return new BPromise(function(_0x4d7ea3,_0x36696c){return client['request'](_0xe47192,_0x470352)['then'](function(_0x4a34a7){logger[_0x0784('0x9')](_0x0784('0xa'),_0x4c6ec2,_0x0784('0xb'));logger[_0x0784('0xc')](_0x0784('0xd'),_0x4c6ec2,'request\x20sent',JSON['stringify'](_0x4a34a7));if(_0x4a34a7[_0x0784('0xe')]){if(_0x4a34a7['error']['code']===0x1f4){logger['error'](_0x0784('0xa'),_0x4c6ec2,_0x4a34a7[_0x0784('0xe')][_0x0784('0xf')]);return _0x36696c(_0x4a34a7['error'][_0x0784('0xf')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4c6ec2,_0x4a34a7[_0x0784('0xe')][_0x0784('0xf')]);return _0x4d7ea3(_0x4a34a7[_0x0784('0xe')][_0x0784('0xf')]);}else{logger[_0x0784('0x9')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4c6ec2,_0x0784('0xb'));_0x4d7ea3(_0x4a34a7[_0x0784('0x10')][_0x0784('0xf')]);}})[_0x0784('0x11')](function(_0x4a72a4){logger[_0x0784('0xe')](_0x0784('0xa'),_0x4c6ec2,_0x4a72a4);_0x36696c(_0x4a72a4);});});} \ No newline at end of file +var _0x0d3b=['util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x23152b,_0x4ed0fb){var _0x4624d4=function(_0x38c398){while(--_0x38c398){_0x23152b['push'](_0x23152b['shift']());}};_0x4624d4(++_0x4ed0fb);}(_0x0d3b,0x1cd));var _0xb0d3=function(_0x4ef5b1,_0x36084e){_0x4ef5b1=_0x4ef5b1-0x0;var _0x2a4fb8=_0x0d3b[_0x4ef5b1];return _0x2a4fb8;};'use strict';var _=require(_0xb0d3('0x0'));var util=require(_0xb0d3('0x1'));var moment=require('moment');var BPromise=require(_0xb0d3('0x2'));var rs=require(_0xb0d3('0x3'));var fs=require('fs');var Redis=require(_0xb0d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb0d3('0x5'));var logger=require('../../config/logger')(_0xb0d3('0x6'));var config=require(_0xb0d3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb0d3('0x8')][_0xb0d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11f812,_0x19c189,_0x17e754){return new BPromise(function(_0x4f0c5a,_0x1f05e2){return client['request'](_0x11f812,_0x17e754)[_0xb0d3('0xa')](function(_0x2f9417){logger[_0xb0d3('0xb')](_0xb0d3('0xc'),_0x19c189,_0xb0d3('0xd'));logger[_0xb0d3('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x19c189,_0xb0d3('0xd'),JSON[_0xb0d3('0xf')](_0x2f9417));if(_0x2f9417[_0xb0d3('0x10')]){if(_0x2f9417['error'][_0xb0d3('0x11')]===0x1f4){logger[_0xb0d3('0x10')](_0xb0d3('0xc'),_0x19c189,_0x2f9417['error'][_0xb0d3('0x12')]);return _0x1f05e2(_0x2f9417[_0xb0d3('0x10')][_0xb0d3('0x12')]);}logger[_0xb0d3('0x10')](_0xb0d3('0xc'),_0x19c189,_0x2f9417[_0xb0d3('0x10')][_0xb0d3('0x12')]);return _0x4f0c5a(_0x2f9417[_0xb0d3('0x10')][_0xb0d3('0x12')]);}else{logger[_0xb0d3('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x19c189,_0xb0d3('0xd'));_0x4f0c5a(_0x2f9417[_0xb0d3('0x13')][_0xb0d3('0x12')]);}})[_0xb0d3('0x14')](function(_0x2f97d2){logger[_0xb0d3('0x10')](_0xb0d3('0xc'),_0x19c189,_0x2f97d2);_0x1f05e2(_0x2f97d2);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 593576e..5195225 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 _0xbc36=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','/:id','show','/:id/preview','preview','get','run','/:id/query','query','post','create','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbc36,0x169));var _0x6bc3=function(_0xa153b1,_0x3fe7ed){_0xa153b1=_0xa153b1-0x0;var _0x60cfb=_0xbc36[_0xa153b1];return _0x60cfb;};'use strict';var multer=require(_0x6bc3('0x0'));var util=require('util');var path=require(_0x6bc3('0x1'));var timeout=require(_0x6bc3('0x2'));var express=require(_0x6bc3('0x3'));var router=express[_0x6bc3('0x4')]();var fs_extra=require(_0x6bc3('0x5'));var auth=require(_0x6bc3('0x6'));var interaction=require(_0x6bc3('0x7'));var config=require(_0x6bc3('0x8'));var controller=require(_0x6bc3('0x9'));router['get']('/',auth[_0x6bc3('0xa')](),controller[_0x6bc3('0xb')]);router['get'](_0x6bc3('0xc'),auth[_0x6bc3('0xa')](),controller[_0x6bc3('0xd')]);router['get'](_0x6bc3('0xe'),auth[_0x6bc3('0xa')](),controller[_0x6bc3('0xf')]);router[_0x6bc3('0x10')]('/:id/run',auth[_0x6bc3('0xa')](),controller[_0x6bc3('0x11')]);router[_0x6bc3('0x10')](_0x6bc3('0x12'),auth[_0x6bc3('0xa')](),controller[_0x6bc3('0x13')]);router[_0x6bc3('0x14')]('/',auth[_0x6bc3('0xa')](),controller[_0x6bc3('0x15')]);router['put'](_0x6bc3('0xc'),auth['isAuthenticated'](),controller[_0x6bc3('0x16')]);router['delete'](_0x6bc3('0xc'),auth[_0x6bc3('0xa')](),controller['destroy']);module[_0x6bc3('0x17')]=router; \ No newline at end of file +var _0x0aba=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','exports','multer'];(function(_0x1857c6,_0x48840c){var _0x51011c=function(_0x3a4736){while(--_0x3a4736){_0x1857c6['push'](_0x1857c6['shift']());}};_0x51011c(++_0x48840c);}(_0x0aba,0x11d));var _0xa0ab=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x0aba[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0xa0ab('0x0'));var util=require('util');var path=require(_0xa0ab('0x1'));var timeout=require(_0xa0ab('0x2'));var express=require(_0xa0ab('0x3'));var router=express[_0xa0ab('0x4')]();var fs_extra=require(_0xa0ab('0x5'));var auth=require(_0xa0ab('0x6'));var interaction=require(_0xa0ab('0x7'));var config=require('../../config/environment');var controller=require(_0xa0ab('0x8'));router[_0xa0ab('0x9')]('/',auth[_0xa0ab('0xa')](),controller[_0xa0ab('0xb')]);router['get']('/:id',auth[_0xa0ab('0xa')](),controller[_0xa0ab('0xc')]);router['get'](_0xa0ab('0xd'),auth[_0xa0ab('0xa')](),controller[_0xa0ab('0xe')]);router[_0xa0ab('0x9')](_0xa0ab('0xf'),auth['isAuthenticated'](),controller[_0xa0ab('0x10')]);router['get'](_0xa0ab('0x11'),auth[_0xa0ab('0xa')](),controller[_0xa0ab('0x12')]);router[_0xa0ab('0x13')]('/',auth['isAuthenticated'](),controller[_0xa0ab('0x14')]);router[_0xa0ab('0x15')](_0xa0ab('0x16'),auth['isAuthenticated'](),controller[_0xa0ab('0x17')]);router[_0xa0ab('0x18')](_0xa0ab('0x16'),auth[_0xa0ab('0xa')](),controller['destroy']);module[_0xa0ab('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 45f0ccb..b9c0746 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 _0xbba3=['STRING','TEXT','exports'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xbba3,0xda));var _0x3bba=function(_0x11f3c9,_0xb071a4){_0x11f3c9=_0x11f3c9-0x0;var _0x41d914=_0xbba3[_0x11f3c9];return _0x41d914;};'use strict';var Sequelize=require('sequelize');module[_0x3bba('0x0')]={'name':{'type':Sequelize[_0x3bba('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3bba('0x1')]},'parent':{'type':Sequelize[_0x3bba('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x3bba('0x2')]},'joins':{'type':Sequelize[_0x3bba('0x2')]}}; \ No newline at end of file +var _0xee91=['exports','STRING','TEXT'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xee91,0xe1));var _0x1ee9=function(_0x1c226b,_0x11116b){_0x1c226b=_0x1c226b-0x0;var _0x3b5842=_0xee91[_0x1c226b];return _0x3b5842;};'use strict';var Sequelize=require('sequelize');module[_0x1ee9('0x0')]={'name':{'type':Sequelize[_0x1ee9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1ee9('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x1ee9('0x2')]},'joins':{'type':Sequelize[_0x1ee9('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 90c8d05..9df5b87 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 _0x70e4=['includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','field','condition','value','getFields','Sequelize','ValidationErrorItem','findAll','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','group','clone','Limited\x20Query:','toString','sequelize','QueryTypes','HOUR(%s)','IS\x20NOT\x20NULL','operator','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','metric','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','SELECT','run','runReport','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','count','offset','Content-Range','apply','save','get','DefaultReports','UserProfileResource','then','sendStatus','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','catch','error','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)'];(function(_0x19bff2,_0x48446e){var _0x233991=function(_0x51b9fa){while(--_0x51b9fa){_0x19bff2['push'](_0x19bff2['shift']());}};_0x233991(++_0x48446e);}(_0x70e4,0x18b));var _0x470e=function(_0x4599b6,_0x40c254){_0x4599b6=_0x4599b6-0x0;var _0x2e014c=_0x70e4[_0x4599b6];return _0x2e014c;};'use strict';var emlformat=require(_0x470e('0x0'));var rimraf=require(_0x470e('0x1'));var zipdir=require(_0x470e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x470e('0x3'));var BPromise=require(_0x470e('0x4'));var Mustache=require(_0x470e('0x5'));var util=require('util');var path=require(_0x470e('0x6'));var sox=require(_0x470e('0x7'));var csv=require('to-csv');var ejs=require(_0x470e('0x8'));var fs=require('fs');var fs_extra=require(_0x470e('0x9'));var _=require(_0x470e('0xa'));var squel=require(_0x470e('0xb'));var crypto=require(_0x470e('0xc'));var jsforce=require(_0x470e('0xd'));var deskjs=require(_0x470e('0xe'));var toCsv=require(_0x470e('0xf'));var querystring=require(_0x470e('0x10'));var Papa=require(_0x470e('0x11'));var Redis=require(_0x470e('0x12'));var authService=require(_0x470e('0x13'));var qs=require(_0x470e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x470e('0x15'));var logger=require(_0x470e('0x16'))(_0x470e('0x17'));var utils=require('../../config/utils');var config=require(_0x470e('0x18'));var licenseUtil=require(_0x470e('0x19'));var db=require(_0x470e('0x1a'))['db'];var dbH=require('../../mysqldb')[_0x470e('0x1b')];function respondWithStatusCode(_0x36c0bf,_0x3426a1){_0x3426a1=_0x3426a1||0xcc;return function(_0x2a83ac){if(_0x2a83ac){return _0x36c0bf['sendStatus'](_0x3426a1);}return _0x36c0bf[_0x470e('0x1c')](_0x3426a1)[_0x470e('0x1d')]();};}function respondWithResult(_0x55bd07,_0x113c96){_0x113c96=_0x113c96||0xc8;return function(_0x4c9317){if(_0x4c9317){return _0x55bd07[_0x470e('0x1c')](_0x113c96)[_0x470e('0x1e')](_0x4c9317);}};}function respondWithFilteredResult(_0x3f602b,_0x3ec8d7){return function(_0x3f3f25){if(_0x3f3f25){var _0x5ce828=_0x3f3f25[_0x470e('0x1f')],_0x22fbcf=_0x3ec8d7[_0x470e('0x20')],_0x3be174=_0x3ec8d7[_0x470e('0x20')]+_0x3ec8d7['limit'],_0x524850;if(_0x3be174>=_0x5ce828){_0x3be174=_0x5ce828;_0x524850=0xc8;}else{_0x524850=0xce;}_0x3f602b['status'](_0x524850);return _0x3f602b['set'](_0x470e('0x21'),_0x22fbcf+'-'+_0x3be174+'/'+_0x5ce828)[_0x470e('0x1e')](_0x3f3f25);}return null;};}function patchUpdates(_0x262e34){return function(_0x4eec7d){try{jsonpatch[_0x470e('0x22')](_0x4eec7d,_0x262e34,!![]);}catch(_0x3278c3){return BPromise['reject'](_0x3278c3);}return _0x4eec7d[_0x470e('0x23')]();};}function saveUpdates(_0x35247b,_0x3978af){return function(_0x3d680c){if(_0x3d680c){return _0x3d680c['update'](_0x35247b)['then'](function(_0x2b3c5d){return _0x2b3c5d;});}return null;};}function removeEntity(_0x4f8cfd,_0x1ad929){return function(_0x1d6017){if(_0x1d6017){return _0x1d6017['destroy']()['then'](function(){var _0x2e7ecb=_0x1d6017[_0x470e('0x24')]({'plain':!![]});var _0x413355=_0x470e('0x25');return db[_0x470e('0x26')]['destroy']({'where':{'type':_0x413355,'resourceId':_0x2e7ecb['id']}})[_0x470e('0x27')](function(){return _0x1d6017;});})[_0x470e('0x27')](function(){_0x4f8cfd[_0x470e('0x1c')](0xcc)[_0x470e('0x1d')]();});}};}function handleEntityNotFound(_0x5715e6,_0x29b2a9){return function(_0x81bfe8){if(!_0x81bfe8){_0x5715e6[_0x470e('0x28')](0x194);}return _0x81bfe8;};}function handleError(_0x3c137d,_0x58cce3){_0x58cce3=_0x58cce3||0x1f4;return function(_0x5a014a){logger['error'](_0x5a014a['stack']);if(_0x5a014a[_0x470e('0x29')]){delete _0x5a014a[_0x470e('0x29')];}_0x3c137d[_0x470e('0x1c')](_0x58cce3)[_0x470e('0x2a')](_0x5a014a);};}exports['index']=function(_0x20eea1,_0x3657c2){var _0x2fd7ee={},_0xa5f994={},_0x539ecc={'count':0x0,'rows':[]};var _0xbeda57=_[_0x470e('0x2b')](db[_0x470e('0x2c')][_0x470e('0x2d')],function(_0x2b9a45){return{'name':_0x2b9a45[_0x470e('0x2e')],'type':_0x2b9a45['type'][_0x470e('0x2f')]};});_0xa5f994[_0x470e('0x30')]=_[_0x470e('0x2b')](_0xbeda57,_0x470e('0x29'));_0xa5f994[_0x470e('0x31')]=_[_0x470e('0x32')](_0x20eea1[_0x470e('0x31')]);_0xa5f994['filters']=_[_0x470e('0x33')](_0xa5f994[_0x470e('0x30')],_0xa5f994['query']);_0x2fd7ee[_0x470e('0x34')]=_[_0x470e('0x33')](_0xa5f994[_0x470e('0x30')],qs[_0x470e('0x35')](_0x20eea1[_0x470e('0x31')][_0x470e('0x35')]));_0x2fd7ee[_0x470e('0x34')]=_0x2fd7ee[_0x470e('0x34')]['length']?_0x2fd7ee[_0x470e('0x34')]:_0xa5f994['model'];if(!_0x20eea1[_0x470e('0x31')][_0x470e('0x36')]('nolimit')){_0x2fd7ee['limit']=qs[_0x470e('0x37')](_0x20eea1[_0x470e('0x31')][_0x470e('0x37')]);_0x2fd7ee['offset']=qs[_0x470e('0x20')](_0x20eea1['query'][_0x470e('0x20')]);}_0x2fd7ee[_0x470e('0x38')]=qs['sort'](_0x20eea1[_0x470e('0x31')][_0x470e('0x39')]);_0x2fd7ee[_0x470e('0x3a')]=qs[_0x470e('0x3b')](_['pick'](_0x20eea1['query'],_0xa5f994[_0x470e('0x3b')]),_0xbeda57);if(_0x20eea1['query'][_0x470e('0x3c')]){_0x2fd7ee[_0x470e('0x3a')]=_[_0x470e('0x3d')](_0x2fd7ee[_0x470e('0x3a')],{'$or':_['map'](_0xbeda57,function(_0x4d0d31){if(_0x4d0d31[_0x470e('0x3e')]!==_0x470e('0x3f')){var _0x2fd462={};_0x2fd462[_0x4d0d31[_0x470e('0x29')]]={'$like':'%'+_0x20eea1[_0x470e('0x31')]['filter']+'%'};return _0x2fd462;}})});}_0x2fd7ee=_['merge']({},_0x2fd7ee,_0x20eea1[_0x470e('0x40')]);var _0x588ed5={'where':_0x2fd7ee[_0x470e('0x3a')]};return db[_0x470e('0x2c')][_0x470e('0x1f')](_0x588ed5)[_0x470e('0x27')](function(_0x304140){_0x539ecc['count']=_0x304140;if(_0x20eea1['query'][_0x470e('0x41')]){_0x2fd7ee[_0x470e('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport']['findAll'](_0x2fd7ee);})[_0x470e('0x27')](function(_0xaa456c){_0x539ecc['rows']=_0xaa456c;return _0x539ecc;})[_0x470e('0x27')](respondWithFilteredResult(_0x3657c2,_0x2fd7ee))['catch'](handleError(_0x3657c2,null));};exports[_0x470e('0x43')]=function(_0x5ccae3,_0x18a140){var _0x463469={'raw':!![],'where':{'id':_0x5ccae3[_0x470e('0x44')]['id']}},_0x4d0d58={};_0x4d0d58[_0x470e('0x30')]=_[_0x470e('0x32')](db[_0x470e('0x2c')][_0x470e('0x2d')]);_0x4d0d58[_0x470e('0x31')]=_[_0x470e('0x32')](_0x5ccae3[_0x470e('0x31')]);_0x4d0d58['filters']=_[_0x470e('0x33')](_0x4d0d58['model'],_0x4d0d58[_0x470e('0x31')]);_0x463469[_0x470e('0x34')]=_[_0x470e('0x33')](_0x4d0d58[_0x470e('0x30')],qs[_0x470e('0x35')](_0x5ccae3[_0x470e('0x31')][_0x470e('0x35')]));_0x463469[_0x470e('0x34')]=_0x463469['attributes'][_0x470e('0x45')]?_0x463469[_0x470e('0x34')]:_0x4d0d58[_0x470e('0x30')];if(_0x5ccae3['query'][_0x470e('0x41')]){_0x463469['include']=[{'all':!![]}];}_0x463469=_['merge']({},_0x463469,_0x5ccae3['options']);return db[_0x470e('0x2c')]['find'](_0x463469)[_0x470e('0x27')](handleEntityNotFound(_0x18a140,null))[_0x470e('0x27')](respondWithResult(_0x18a140,null))['catch'](handleError(_0x18a140,null));};exports[_0x470e('0x46')]=function(_0x5d3112,_0x58e437){return db[_0x470e('0x2c')][_0x470e('0x46')](_0x5d3112[_0x470e('0x47')],{})[_0x470e('0x27')](function(_0x5b6134){var _0x1b450f=_0x5d3112[_0x470e('0x48')][_0x470e('0x24')]({'plain':!![]});if(!_0x1b450f)throw new Error(_0x470e('0x49'));if(_0x1b450f[_0x470e('0x4a')]===_0x470e('0x48')){var _0x5942ca=_0x5b6134['get']({'plain':!![]});var _0x4fc6c2=_0x470e('0x4b');return db[_0x470e('0x4c')][_0x470e('0x4d')]({'where':{'name':_0x4fc6c2,'userProfileId':_0x1b450f[_0x470e('0x4e')]},'raw':!![]})[_0x470e('0x27')](function(_0x521845){if(_0x521845&&_0x521845['autoAssociation']===0x0){return db['UserProfileResource'][_0x470e('0x46')]({'name':_0x5942ca[_0x470e('0x29')],'resourceId':_0x5942ca['id'],'type':_0x470e('0x25'),'sectionId':_0x521845['id']},{})[_0x470e('0x27')](function(){return _0x5b6134;});}else{return _0x5b6134;}})[_0x470e('0x4f')](function(_0x2db527){logger[_0x470e('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2db527);throw _0x2db527;});}return _0x5b6134;})[_0x470e('0x27')](respondWithResult(_0x58e437,0xc9))[_0x470e('0x4f')](handleError(_0x58e437,null));};exports['update']=function(_0x4c4181,_0x4174de){if(_0x4c4181[_0x470e('0x47')]['id']){delete _0x4c4181[_0x470e('0x47')]['id'];}return db[_0x470e('0x2c')][_0x470e('0x4d')]({'where':{'id':_0x4c4181['params']['id']}})[_0x470e('0x27')](handleEntityNotFound(_0x4174de,null))['then'](saveUpdates(_0x4c4181[_0x470e('0x47')],null))['then'](respondWithResult(_0x4174de,null))[_0x470e('0x4f')](handleError(_0x4174de,null));};exports['destroy']=function(_0x525783,_0x4519b6){return db[_0x470e('0x2c')][_0x470e('0x4d')]({'where':{'id':_0x525783[_0x470e('0x44')]['id']}})[_0x470e('0x27')](handleEntityNotFound(_0x4519b6,null))['then'](removeEntity(_0x4519b6,null))['catch'](handleError(_0x4519b6,null));};exports[_0x470e('0x51')]=function(_0x10a5e7,_0x1259e2){var _0x150127=0xa;var _0x237832=[_0x470e('0x52'),_0x470e('0x53'),_0x470e('0x54'),_0x470e('0x55')];var _0x25a42b={'SUM':_0x470e('0x56'),'COUNT':_0x470e('0x57'),'COUNT DISTINCT':_0x470e('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x470e('0x59'),'GROUP_CONCAT':_0x470e('0x5a'),'GROUP_CONCAT ASC':_0x470e('0x5b'),'GROUP_CONCAT DESC':_0x470e('0x5c')};var _0x2b7d46={'SEC_TO_TIME':_0x470e('0x5d'),'DATE':_0x470e('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x470e('0x5f'),'UNIX_TIMESTAMP':_0x470e('0x60')};var _0x55544a=function(_0x9af88d){return!_[_0x470e('0x61')]([_0x470e('0x62'),'IS\x20NOT\x20NULL',_0x470e('0x63'),_0x470e('0x64')],_0x9af88d);};var _0x481b51=function(_0x3e20ad){if(!_0x3e20ad||!_0x3e20ad[_0x470e('0x65')][_0x470e('0x45')]){return'';}for(var _0x3ec3b9='(',_0x5c98d8=0x0;_0x5c98d8<_0x3e20ad[_0x470e('0x65')][_0x470e('0x45')];_0x5c98d8+=0x1){_0x5c98d8>0x0&&(_0x3ec3b9+='\x20'+_0x3e20ad['operator']+'\x20');_0x3ec3b9+=_0x3e20ad['rules'][_0x5c98d8]['group']?_0x481b51(_0x3e20ad['rules'][_0x5c98d8]['group']):_0x3e20ad['rules'][_0x5c98d8][_0x470e('0x66')]+'\x20'+_0x3e20ad[_0x470e('0x65')][_0x5c98d8][_0x470e('0x67')]+(_0x55544a(_0x3e20ad['rules'][_0x5c98d8][_0x470e('0x67')])?'\x20'+_0x3e20ad[_0x470e('0x65')][_0x5c98d8][_0x470e('0x68')]:'');}return _0x3ec3b9+')';};var _0x2270db={'where':{'id':_0x10a5e7[_0x470e('0x44')]['id']}},_0xaf5305,_0x577bfd,_0x3024bd,_0x165442,_0x21ba03;_0x2270db=_[_0x470e('0x3d')]({},_0x2270db,_0x10a5e7[_0x470e('0x40')]);return db[_0x470e('0x2c')][_0x470e('0x4d')](_0x2270db)['then'](function(_0xd8c25b){if(_0xd8c25b){_0xaf5305=_0xd8c25b;return _0xd8c25b[_0x470e('0x69')]();}return null;})[_0x470e('0x27')](function(_0x4f5b0c){if(_0x4f5b0c){if(!_0x4f5b0c[_0x470e('0x45')]){throw new db[(_0x470e('0x6a'))][(_0x470e('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x577bfd=_0x4f5b0c;return db['AnalyticMetric'][_0x470e('0x6c')]({'raw':!![]});}return null;})[_0x470e('0x27')](function(_0x33a586){if(_0x33a586){_0x3024bd=_[_0x470e('0x6d')](_0x33a586,'id');var _0x1c2cba;var _0x5420ef=squel[_0x470e('0x6e')]();_0x5420ef[_0x470e('0x6f')](_0xaf5305[_0x470e('0x70')]);for(var _0x14cef3=0x0;_0x14cef3<_0x577bfd[_0x470e('0x45')];_0x14cef3+=0x1){_0x1c2cba=_0x577bfd[_0x14cef3][_0x470e('0x71')]?_0x3024bd[_0x577bfd[_0x14cef3]['MetricId']]['metric']:_0x577bfd[_0x14cef3][_0x470e('0x66')];_0x1c2cba=_0x577bfd[_0x14cef3][_0x470e('0x72')]?_[_0x470e('0x73')](_0x25a42b[_0x577bfd[_0x14cef3][_0x470e('0x72')]],'%s',_0x1c2cba):_0x1c2cba;_0x1c2cba=_0x577bfd[_0x14cef3][_0x470e('0x74')]?_['replace'](_0x2b7d46[_0x577bfd[_0x14cef3][_0x470e('0x74')]],'%s',_0x1c2cba):_0x1c2cba;if(_0x577bfd[_0x14cef3][_0x470e('0x75')]){_0x5420ef['group'](_0x1c2cba);}_0x577bfd[_0x14cef3][_0x470e('0x76')]&&_0x5420ef[_0x470e('0x38')](_0x1c2cba,_0x577bfd[_0x14cef3]['orderBy']===_0x470e('0x77')?![]:!![]);_0x5420ef[_0x470e('0x66')](_0x1c2cba,_0x577bfd[_0x14cef3]['alias']||_0x1c2cba);}if(_0xaf5305[_0x470e('0x78')]){_0xaf5305[_0x470e('0x78')]=JSON[_0x470e('0x79')](_0xaf5305[_0x470e('0x78')]);for(var _0x252b34=0x0;_0x252b34<_0xaf5305['joins']['length'];_0x252b34+=0x1){if(_0xaf5305['joins'][_0x252b34][_0x470e('0x3e')]&&_[_0x470e('0x61')](_0x237832,_0xaf5305[_0x470e('0x78')][_0x252b34]['type'])&&_0xaf5305[_0x470e('0x78')][_0x252b34]['parentKey']&&_0xaf5305['joins'][_0x252b34][_0x470e('0x7a')]&&_0xaf5305[_0x470e('0x78')][_0x252b34][_0x470e('0x7b')]){_0x5420ef[_0xaf5305[_0x470e('0x78')][_0x252b34][_0x470e('0x3e')]](_0xaf5305[_0x470e('0x78')][_0x252b34]['foreignTable'],null,util[_0x470e('0x74')](_0x470e('0x7c'),_0xaf5305[_0x470e('0x70')],_0xaf5305[_0x470e('0x78')][_0x252b34][_0x470e('0x7d')],_0xaf5305[_0x470e('0x78')][_0x252b34][_0x470e('0x7a')],_0xaf5305[_0x470e('0x78')][_0x252b34][_0x470e('0x7b')]));}}}if(_0xaf5305['conditions']){_0xaf5305[_0x470e('0x7e')]=JSON[_0x470e('0x79')](_0xaf5305['conditions']);_0x5420ef[_0x470e('0x3a')](_0x481b51(_0xaf5305[_0x470e('0x7e')][_0x470e('0x7f')]));}_0x21ba03=_0x5420ef[_0x470e('0x80')]();_0x5420ef[_0x470e('0x37')](_0x150127);_0x5420ef[_0x470e('0x20')](0x0);logger['debug'](_0x470e('0x81'),_0x5420ef[_0x470e('0x82')]());return dbH[_0x470e('0x83')][_0x470e('0x31')](_0x5420ef['toString'](),{'type':dbH['sequelize'][_0x470e('0x84')]['SELECT']});}})[_0x470e('0x27')](respondWithResult(_0x1259e2,null))[_0x470e('0x4f')](handleError(_0x1259e2,null));};function runReport(_0x315c15,_0x2c1bc8,_0x339c0b){var _0x244240=_0x2c1bc8[_0x470e('0x29')];var _0x500ed8=0xa;var _0x4876c1=[_0x470e('0x52'),_0x470e('0x53'),'right_join',_0x470e('0x55')];var _0xf27d45={'SUM':_0x470e('0x56'),'COUNT':_0x470e('0x57'),'COUNT DISTINCT':_0x470e('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x470e('0x5a'),'GROUP_CONCAT ASC':_0x470e('0x5b'),'GROUP_CONCAT DESC':_0x470e('0x5c')};var _0x2e9c67={'SEC_TO_TIME':_0x470e('0x5d'),'DATE':_0x470e('0x5e'),'HOUR':_0x470e('0x85'),'ROUND':_0x470e('0x5f'),'UNIX_TIMESTAMP':_0x470e('0x60')};var _0x40d309=function(_0x4ad7a5){return!_[_0x470e('0x61')](['IS\x20NULL',_0x470e('0x86'),_0x470e('0x63'),_0x470e('0x64')],_0x4ad7a5);};var _0x531df5=function(_0x5a5d19){if(!_0x5a5d19||!_0x5a5d19[_0x470e('0x65')]['length']){return'';}for(var _0x1dfa5a='(',_0x422442=0x0;_0x422442<_0x5a5d19['rules'][_0x470e('0x45')];_0x422442+=0x1){_0x422442>0x0&&(_0x1dfa5a+='\x20'+_0x5a5d19[_0x470e('0x87')]+'\x20');_0x1dfa5a+=_0x5a5d19['rules'][_0x422442][_0x470e('0x7f')]?_0x531df5(_0x5a5d19['rules'][_0x422442]['group']):_0x5a5d19[_0x470e('0x65')][_0x422442][_0x470e('0x66')]+'\x20'+_0x5a5d19[_0x470e('0x65')][_0x422442]['condition']+(_0x40d309(_0x5a5d19[_0x470e('0x65')][_0x422442][_0x470e('0x67')])?'\x20'+_0x5a5d19['rules'][_0x422442]['value']:'');}return _0x1dfa5a+')';};var _0x535502={'where':{'id':_0x315c15['id']}},_0x42ece7,_0x30a451,_0x597113,_0x3f3376,_0x163d3e;_0x535502=_[_0x470e('0x3d')]({},_0x535502,_0x339c0b);return db['AnalyticDefaultReport'][_0x470e('0x4d')](_0x535502)[_0x470e('0x27')](function(_0x385b13){if(_0x385b13){_0x42ece7=_0x385b13;return _0x385b13[_0x470e('0x69')]();}return null;})['then'](function(_0x1d0c60){if(_0x1d0c60){if(!_0x1d0c60[_0x470e('0x45')]){throw new db[(_0x470e('0x6a'))]['ValidationErrorItem'](_0x470e('0x88'),0x193);}_0x30a451=_0x1d0c60;return db[_0x470e('0x89')][_0x470e('0x6c')]({'raw':!![]});}return null;})['then'](function(_0xadefae){if(_0xadefae){_0x597113=_[_0x470e('0x6d')](_0xadefae,'id');var _0x36d02c;var _0x225cef=squel[_0x470e('0x6e')]();_0x225cef[_0x470e('0x6f')](_0x42ece7[_0x470e('0x70')]);for(var _0x464115=0x0;_0x464115<_0x30a451[_0x470e('0x45')];_0x464115+=0x1){_0x36d02c=_0x30a451[_0x464115][_0x470e('0x71')]?_0x597113[_0x30a451[_0x464115][_0x470e('0x71')]][_0x470e('0x8a')]:_0x30a451[_0x464115]['field'];_0x36d02c=_0x30a451[_0x464115][_0x470e('0x72')]?_[_0x470e('0x73')](_0xf27d45[_0x30a451[_0x464115][_0x470e('0x72')]],'%s',_0x36d02c):_0x36d02c;_0x36d02c=_0x30a451[_0x464115][_0x470e('0x74')]?_[_0x470e('0x73')](_0x2e9c67[_0x30a451[_0x464115][_0x470e('0x74')]],'%s',_0x36d02c):_0x36d02c;if(_0x30a451[_0x464115]['groupBy']){_0x225cef['group'](_0x36d02c);}_0x30a451[_0x464115][_0x470e('0x76')]&&_0x225cef[_0x470e('0x38')](_0x36d02c,_0x30a451[_0x464115]['orderBy']===_0x470e('0x77')?![]:!![]);_0x225cef[_0x470e('0x66')](_0x36d02c,_0x30a451[_0x464115][_0x470e('0x8b')]||_0x36d02c);}if(_0x42ece7[_0x470e('0x78')]){_0x42ece7['joins']=JSON['parse'](_0x42ece7[_0x470e('0x78')]);for(var _0x13c745=0x0;_0x13c745<_0x42ece7[_0x470e('0x78')]['length'];_0x13c745+=0x1){if(_0x42ece7[_0x470e('0x78')][_0x13c745][_0x470e('0x3e')]&&_['includes'](_0x4876c1,_0x42ece7[_0x470e('0x78')][_0x13c745][_0x470e('0x3e')])&&_0x42ece7[_0x470e('0x78')][_0x13c745]['parentKey']&&_0x42ece7[_0x470e('0x78')][_0x13c745][_0x470e('0x7a')]&&_0x42ece7[_0x470e('0x78')][_0x13c745][_0x470e('0x7b')]){_0x225cef[_0x42ece7[_0x470e('0x78')][_0x13c745][_0x470e('0x3e')]](_0x42ece7[_0x470e('0x78')][_0x13c745][_0x470e('0x7a')],null,util[_0x470e('0x74')]('%s.%s\x20=\x20%s.%s',_0x42ece7[_0x470e('0x70')],_0x42ece7[_0x470e('0x78')][_0x13c745][_0x470e('0x7d')],_0x42ece7['joins'][_0x13c745][_0x470e('0x7a')],_0x42ece7[_0x470e('0x78')][_0x13c745]['foreignKey']));}}}if(_0x42ece7['conditions']){_0x42ece7[_0x470e('0x7e')]=JSON[_0x470e('0x79')](_0x42ece7[_0x470e('0x7e')]);_0x225cef['where'](_0x531df5(_0x42ece7[_0x470e('0x7e')][_0x470e('0x7f')]));}_0x163d3e=_0x225cef[_0x470e('0x80')]();_0x225cef['limit'](_0x500ed8);_0x225cef[_0x470e('0x20')](0x0);return;}})['then'](function(){if(_0x2c1bc8[_0x470e('0x8c')]===_0x470e('0x8d')){return null;}var _0x95c485=_[_0x470e('0x3d')](_0x2c1bc8,{'name':_0x2c1bc8[_0x470e('0x8e')]||_0x2c1bc8[_0x470e('0x29')]||_0x42ece7[_0x470e('0x29')],'basename':_0x244240,'savename':util[_0x470e('0x74')](_0x470e('0x8f'),_0x2c1bc8[_0x470e('0x29')]||_0x42ece7['name'],require(_0x470e('0x90'))[_0x470e('0x91')](0x4),_0x2c1bc8[_0x470e('0x8c')]||_0x470e('0x92')),'reportId':_0x42ece7['id'],'reportType':_0x470e('0x93')});return db[_0x470e('0x94')][_0x470e('0x46')](_0x95c485,{'raw':!![]});})[_0x470e('0x27')](function(_0x2c05e4){if(_0x42ece7[_0x470e('0x70')]===_0x470e('0x95')){_0x163d3e['where'](_0x42ece7[_0x470e('0x70')]+_0x470e('0x96'),_0x2c1bc8[_0x470e('0x97')],_0x2c1bc8[_0x470e('0x98')]);}else{_0x163d3e[_0x470e('0x3a')](_0x42ece7[_0x470e('0x70')]+_0x470e('0x99'),_0x2c1bc8[_0x470e('0x97')],_0x2c1bc8[_0x470e('0x98')]);}if(_0x2c05e4){logger[_0x470e('0x9a')](_0x470e('0x9b'),_0x163d3e[_0x470e('0x82')]());require(_0x470e('0x9c'))['fork'](path['join'](__dirname,_0x470e('0x9d'),_0x2c05e4[_0x470e('0x8c')]),[_0x2c05e4['id'],_0x163d3e[_0x470e('0x82')](),path[_0x470e('0x52')](__dirname,_0x470e('0x9e'),_0x2c05e4[_0x470e('0x9f')]),_0x244240]);return _0x2c05e4;}else{var _0x310e43=squel[_0x470e('0x6e')]();_0x310e43['from']('('+_0x163d3e[_0x470e('0x82')]()+')',_0x470e('0xa0'));_0x310e43[_0x470e('0x66')]('COUNT(*)','count');_0x163d3e[_0x470e('0x37')](_0x2c1bc8[_0x470e('0x37')]||_0x500ed8);_0x163d3e[_0x470e('0x20')](_0x2c1bc8[_0x470e('0x20')]||0x0);return dbH['sequelize']['query'](_0x310e43[_0x470e('0x82')](),{'type':dbH[_0x470e('0x83')][_0x470e('0x84')][_0x470e('0xa1')]})[_0x470e('0x27')](function(_0x31dd71){if(!_0x31dd71[_0x470e('0x45')]){_0x3f3376=0x0;}else{_0x3f3376=_0x31dd71[0x0][_0x470e('0x1f')]||0x0;}return dbH['sequelize']['query'](_0x163d3e['toString'](),{'type':dbH['sequelize'][_0x470e('0x84')][_0x470e('0xa1')]});})['then'](function(_0x33945c){return{'rows':_0x33945c||[],'count':_0x3f3376};});}});}exports[_0x470e('0xa2')]=function(_0x3aa36a,_0x5424d6){return runReport(_0x3aa36a['params'],_0x3aa36a[_0x470e('0x31')],_0x3aa36a['options'])[_0x470e('0x27')](respondWithResult(_0x5424d6,null))[_0x470e('0x4f')](handleError(_0x5424d6,null));};exports[_0x470e('0xa3')]=runReport;exports['query']=function(_0x13aaaa,_0x5b4070){var _0x301bf8=0xa;var _0x32d392=['join','left_join','right_join','cross_join'];var _0x2b7a00={'SUM':_0x470e('0x56'),'COUNT':_0x470e('0x57'),'COUNT DISTINCT':_0x470e('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x470e('0x5a'),'GROUP_CONCAT ASC':_0x470e('0x5b'),'GROUP_CONCAT DESC':_0x470e('0x5c')};var _0x3bca89={'SEC_TO_TIME':_0x470e('0x5d'),'DATE':_0x470e('0x5e'),'HOUR':_0x470e('0x85'),'ROUND':_0x470e('0x5f'),'UNIX_TIMESTAMP':_0x470e('0x60')};var _0x297621=function(_0xbdb110){return!_['includes']([_0x470e('0x62'),_0x470e('0x86'),_0x470e('0x63'),'IS\x20NOT\x20EMPTY'],_0xbdb110);};var _0x4e8ee9=function(_0x3bb331){if(!_0x3bb331||!_0x3bb331[_0x470e('0x65')]['length']){return'';}for(var _0x411cd0='(',_0x1290ef=0x0;_0x1290ef<_0x3bb331[_0x470e('0x65')][_0x470e('0x45')];_0x1290ef+=0x1){_0x1290ef>0x0&&(_0x411cd0+='\x20'+_0x3bb331[_0x470e('0x87')]+'\x20');_0x411cd0+=_0x3bb331['rules'][_0x1290ef][_0x470e('0x7f')]?_0x4e8ee9(_0x3bb331[_0x470e('0x65')][_0x1290ef][_0x470e('0x7f')]):_0x3bb331['rules'][_0x1290ef][_0x470e('0x66')]+'\x20'+_0x3bb331['rules'][_0x1290ef][_0x470e('0x67')]+(_0x297621(_0x3bb331[_0x470e('0x65')][_0x1290ef][_0x470e('0x67')])?'\x20'+_0x3bb331[_0x470e('0x65')][_0x1290ef][_0x470e('0x68')]:'');}return _0x411cd0+')';};var _0x21e89d={'where':{'id':_0x13aaaa['params']['id']}},_0x19a1f4,_0x2893f4,_0x392185,_0x4878fe,_0x15b964;_0x21e89d=_[_0x470e('0x3d')]({},_0x21e89d,_0x13aaaa[_0x470e('0x40')]);return db[_0x470e('0x2c')][_0x470e('0x4d')](_0x21e89d)[_0x470e('0x27')](function(_0x58c10d){if(_0x58c10d){_0x19a1f4=_0x58c10d;return _0x58c10d[_0x470e('0x69')]();}return null;})[_0x470e('0x27')](function(_0x2fe682){if(_0x2fe682){if(!_0x2fe682[_0x470e('0x45')]){throw new db[(_0x470e('0x6a'))][(_0x470e('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2893f4=_0x2fe682;return db[_0x470e('0x89')][_0x470e('0x6c')]({'raw':!![]});}return null;})['then'](function(_0x473dfe){if(_0x473dfe){_0x392185=_[_0x470e('0x6d')](_0x473dfe,'id');var _0x2ebb04;var _0x4a85dc=squel[_0x470e('0x6e')]();_0x4a85dc[_0x470e('0x6f')](_0x19a1f4[_0x470e('0x70')]);for(var _0x2d240d=0x0;_0x2d240d<_0x2893f4['length'];_0x2d240d+=0x1){_0x2ebb04=_0x2893f4[_0x2d240d]['MetricId']?_0x392185[_0x2893f4[_0x2d240d][_0x470e('0x71')]][_0x470e('0x8a')]:_0x2893f4[_0x2d240d][_0x470e('0x66')];_0x2ebb04=_0x2893f4[_0x2d240d][_0x470e('0x72')]?_[_0x470e('0x73')](_0x2b7a00[_0x2893f4[_0x2d240d]['function']],'%s',_0x2ebb04):_0x2ebb04;_0x2ebb04=_0x2893f4[_0x2d240d][_0x470e('0x74')]?_[_0x470e('0x73')](_0x3bca89[_0x2893f4[_0x2d240d][_0x470e('0x74')]],'%s',_0x2ebb04):_0x2ebb04;if(_0x2893f4[_0x2d240d][_0x470e('0x75')]){_0x4a85dc[_0x470e('0x7f')](_0x2ebb04);}_0x2893f4[_0x2d240d][_0x470e('0x76')]&&_0x4a85dc[_0x470e('0x38')](_0x2ebb04,_0x2893f4[_0x2d240d][_0x470e('0x76')]==='DESC'?![]:!![]);_0x4a85dc['field'](_0x2ebb04,_0x2893f4[_0x2d240d]['alias']||_0x2ebb04);}if(_0x19a1f4[_0x470e('0x78')]){_0x19a1f4[_0x470e('0x78')]=JSON['parse'](_0x19a1f4[_0x470e('0x78')]);for(var _0xbcdf82=0x0;_0xbcdf82<_0x19a1f4[_0x470e('0x78')][_0x470e('0x45')];_0xbcdf82+=0x1){if(_0x19a1f4[_0x470e('0x78')][_0xbcdf82]['type']&&_['includes'](_0x32d392,_0x19a1f4[_0x470e('0x78')][_0xbcdf82][_0x470e('0x3e')])&&_0x19a1f4[_0x470e('0x78')][_0xbcdf82][_0x470e('0x7d')]&&_0x19a1f4[_0x470e('0x78')][_0xbcdf82][_0x470e('0x7a')]&&_0x19a1f4[_0x470e('0x78')][_0xbcdf82]['foreignKey']){_0x4a85dc[_0x19a1f4[_0x470e('0x78')][_0xbcdf82][_0x470e('0x3e')]](_0x19a1f4[_0x470e('0x78')][_0xbcdf82]['foreignTable'],null,util[_0x470e('0x74')](_0x470e('0x7c'),_0x19a1f4['table'],_0x19a1f4[_0x470e('0x78')][_0xbcdf82][_0x470e('0x7d')],_0x19a1f4['joins'][_0xbcdf82][_0x470e('0x7a')],_0x19a1f4[_0x470e('0x78')][_0xbcdf82]['foreignKey']));}}}if(_0x19a1f4['conditions']){_0x19a1f4['conditions']=JSON[_0x470e('0x79')](_0x19a1f4[_0x470e('0x7e')]);_0x4a85dc[_0x470e('0x3a')](_0x4e8ee9(_0x19a1f4[_0x470e('0x7e')][_0x470e('0x7f')]));}_0x15b964=_0x4a85dc[_0x470e('0x80')]();_0x4a85dc[_0x470e('0x37')](_0x301bf8);_0x4a85dc[_0x470e('0x20')](0x0);logger['debug'](_0x470e('0x81'),_0x4a85dc['toString']());return dbH[_0x470e('0x83')][_0x470e('0x31')](_0x4a85dc['toString'](),{'type':dbH['sequelize'][_0x470e('0x84')][_0x470e('0xa1')]});}})[_0x470e('0x27')](function(){return{'sql':_0x15b964[_0x470e('0x82')]()};})[_0x470e('0x27')](respondWithResult(_0x5b4070,null))[_0x470e('0x4f')](handleError(_0x5b4070,null));}; \ No newline at end of file +var _0xd344=['type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','DefaultReports','error','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','foreignTable','foreignKey','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','operator','AnalyticMetric','DESC','parentKey','output','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','Please\x20insert\x20at\x20least\x20one\x20field','%s.%s\x20=\x20%s.%s','debug','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','limit','set','Content-Range','reject','update','then','get','UserProfileResource','destroy','end','stack','name','send','index','AnalyticDefaultReport'];(function(_0x3900a3,_0x5410d2){var _0x4577c2=function(_0x49469b){while(--_0x49469b){_0x3900a3['push'](_0x3900a3['shift']());}};_0x4577c2(++_0x5410d2);}(_0xd344,0x78));var _0x4d34=function(_0x47b0b1,_0x61a1ed){_0x47b0b1=_0x47b0b1-0x0;var _0x28e38e=_0xd344[_0x47b0b1];return _0x28e38e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d34('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d34('0x1'));var rp=require(_0x4d34('0x2'));var moment=require(_0x4d34('0x3'));var BPromise=require(_0x4d34('0x4'));var Mustache=require(_0x4d34('0x5'));var util=require(_0x4d34('0x6'));var path=require(_0x4d34('0x7'));var sox=require(_0x4d34('0x8'));var csv=require(_0x4d34('0x9'));var ejs=require(_0x4d34('0xa'));var fs=require('fs');var fs_extra=require(_0x4d34('0xb'));var _=require(_0x4d34('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4d34('0xd'));var deskjs=require(_0x4d34('0xe'));var toCsv=require(_0x4d34('0x9'));var querystring=require(_0x4d34('0xf'));var Papa=require(_0x4d34('0x10'));var Redis=require(_0x4d34('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4d34('0x12'));var as=require(_0x4d34('0x13'));var hardwareService=require(_0x4d34('0x14'));var logger=require(_0x4d34('0x15'))(_0x4d34('0x16'));var utils=require('../../config/utils');var config=require(_0x4d34('0x17'));var licenseUtil=require(_0x4d34('0x18'));var db=require(_0x4d34('0x19'))['db'];var dbH=require(_0x4d34('0x19'))[_0x4d34('0x1a')];function respondWithStatusCode(_0x4d5e22,_0x5ab243){_0x5ab243=_0x5ab243||0xcc;return function(_0x4c031b){if(_0x4c031b){return _0x4d5e22[_0x4d34('0x1b')](_0x5ab243);}return _0x4d5e22[_0x4d34('0x1c')](_0x5ab243)['end']();};}function respondWithResult(_0x5cdeba,_0x3feb1a){_0x3feb1a=_0x3feb1a||0xc8;return function(_0x19509c){if(_0x19509c){return _0x5cdeba[_0x4d34('0x1c')](_0x3feb1a)[_0x4d34('0x1d')](_0x19509c);}};}function respondWithFilteredResult(_0x188838,_0x590fca){return function(_0x1d1502){if(_0x1d1502){var _0x2db894=_0x1d1502['count'],_0x37aebd=_0x590fca['offset'],_0x818d94=_0x590fca[_0x4d34('0x1e')]+_0x590fca[_0x4d34('0x1f')],_0xd9b2b0;if(_0x818d94>=_0x2db894){_0x818d94=_0x2db894;_0xd9b2b0=0xc8;}else{_0xd9b2b0=0xce;}_0x188838[_0x4d34('0x1c')](_0xd9b2b0);return _0x188838[_0x4d34('0x20')](_0x4d34('0x21'),_0x37aebd+'-'+_0x818d94+'/'+_0x2db894)[_0x4d34('0x1d')](_0x1d1502);}return null;};}function patchUpdates(_0xbe81d2){return function(_0x52ac8d){try{jsonpatch['apply'](_0x52ac8d,_0xbe81d2,!![]);}catch(_0x4042d5){return BPromise[_0x4d34('0x22')](_0x4042d5);}return _0x52ac8d['save']();};}function saveUpdates(_0x1bdfd5,_0x39b2a5){return function(_0x4332a3){if(_0x4332a3){return _0x4332a3[_0x4d34('0x23')](_0x1bdfd5)[_0x4d34('0x24')](function(_0x1175c9){return _0x1175c9;});}return null;};}function removeEntity(_0x19a393,_0x3fa2e6){return function(_0x13d0a5){if(_0x13d0a5){return _0x13d0a5['destroy']()[_0x4d34('0x24')](function(){var _0x41a5c7=_0x13d0a5[_0x4d34('0x25')]({'plain':!![]});var _0x35ec6f='DefaultReports';return db[_0x4d34('0x26')][_0x4d34('0x27')]({'where':{'type':_0x35ec6f,'resourceId':_0x41a5c7['id']}})['then'](function(){return _0x13d0a5;});})['then'](function(){_0x19a393[_0x4d34('0x1c')](0xcc)[_0x4d34('0x28')]();});}};}function handleEntityNotFound(_0x2c42c2,_0x440728){return function(_0x1bec53){if(!_0x1bec53){_0x2c42c2['sendStatus'](0x194);}return _0x1bec53;};}function handleError(_0x774deb,_0x5d15e2){_0x5d15e2=_0x5d15e2||0x1f4;return function(_0x2ab138){logger['error'](_0x2ab138[_0x4d34('0x29')]);if(_0x2ab138[_0x4d34('0x2a')]){delete _0x2ab138[_0x4d34('0x2a')];}_0x774deb[_0x4d34('0x1c')](_0x5d15e2)[_0x4d34('0x2b')](_0x2ab138);};}exports[_0x4d34('0x2c')]=function(_0x27450a,_0x3a68e8){var _0x4e147c={},_0x7095fe={},_0x5d494f={'count':0x0,'rows':[]};var _0x3b1179=_['map'](db[_0x4d34('0x2d')]['rawAttributes'],function(_0x5d1ee3){return{'name':_0x5d1ee3['fieldName'],'type':_0x5d1ee3[_0x4d34('0x2e')][_0x4d34('0x2f')]};});_0x7095fe[_0x4d34('0x30')]=_['map'](_0x3b1179,_0x4d34('0x2a'));_0x7095fe[_0x4d34('0x31')]=_[_0x4d34('0x32')](_0x27450a[_0x4d34('0x31')]);_0x7095fe[_0x4d34('0x33')]=_[_0x4d34('0x34')](_0x7095fe[_0x4d34('0x30')],_0x7095fe['query']);_0x4e147c['attributes']=_[_0x4d34('0x34')](_0x7095fe['model'],qs[_0x4d34('0x35')](_0x27450a[_0x4d34('0x31')]['fields']));_0x4e147c[_0x4d34('0x36')]=_0x4e147c[_0x4d34('0x36')][_0x4d34('0x37')]?_0x4e147c['attributes']:_0x7095fe[_0x4d34('0x30')];if(!_0x27450a['query']['hasOwnProperty'](_0x4d34('0x38'))){_0x4e147c[_0x4d34('0x1f')]=qs[_0x4d34('0x1f')](_0x27450a[_0x4d34('0x31')][_0x4d34('0x1f')]);_0x4e147c['offset']=qs['offset'](_0x27450a[_0x4d34('0x31')][_0x4d34('0x1e')]);}_0x4e147c[_0x4d34('0x39')]=qs['sort'](_0x27450a[_0x4d34('0x31')][_0x4d34('0x3a')]);_0x4e147c[_0x4d34('0x3b')]=qs[_0x4d34('0x33')](_[_0x4d34('0x3c')](_0x27450a['query'],_0x7095fe[_0x4d34('0x33')]),_0x3b1179);if(_0x27450a[_0x4d34('0x31')]['filter']){_0x4e147c[_0x4d34('0x3b')]=_[_0x4d34('0x3d')](_0x4e147c[_0x4d34('0x3b')],{'$or':_['map'](_0x3b1179,function(_0x487728){if(_0x487728[_0x4d34('0x2e')]!==_0x4d34('0x3e')){var _0x230109={};_0x230109[_0x487728[_0x4d34('0x2a')]]={'$like':'%'+_0x27450a[_0x4d34('0x31')][_0x4d34('0x3f')]+'%'};return _0x230109;}})});}_0x4e147c=_[_0x4d34('0x3d')]({},_0x4e147c,_0x27450a[_0x4d34('0x40')]);var _0xdc2140={'where':_0x4e147c[_0x4d34('0x3b')]};return db[_0x4d34('0x2d')][_0x4d34('0x41')](_0xdc2140)[_0x4d34('0x24')](function(_0x33a0f2){_0x5d494f['count']=_0x33a0f2;if(_0x27450a[_0x4d34('0x31')][_0x4d34('0x42')]){_0x4e147c[_0x4d34('0x43')]=[{'all':!![]}];}return db[_0x4d34('0x2d')]['findAll'](_0x4e147c);})[_0x4d34('0x24')](function(_0x5af2c7){_0x5d494f[_0x4d34('0x44')]=_0x5af2c7;return _0x5d494f;})[_0x4d34('0x24')](respondWithFilteredResult(_0x3a68e8,_0x4e147c))[_0x4d34('0x45')](handleError(_0x3a68e8,null));};exports[_0x4d34('0x46')]=function(_0x13e7c1,_0x2737eb){var _0x1aa8e1={'raw':!![],'where':{'id':_0x13e7c1[_0x4d34('0x47')]['id']}},_0x89d0df={};_0x89d0df['model']=_['keys'](db['AnalyticDefaultReport'][_0x4d34('0x48')]);_0x89d0df['query']=_[_0x4d34('0x32')](_0x13e7c1[_0x4d34('0x31')]);_0x89d0df['filters']=_[_0x4d34('0x34')](_0x89d0df['model'],_0x89d0df[_0x4d34('0x31')]);_0x1aa8e1['attributes']=_['intersection'](_0x89d0df['model'],qs[_0x4d34('0x35')](_0x13e7c1[_0x4d34('0x31')]['fields']));_0x1aa8e1['attributes']=_0x1aa8e1[_0x4d34('0x36')][_0x4d34('0x37')]?_0x1aa8e1[_0x4d34('0x36')]:_0x89d0df['model'];if(_0x13e7c1[_0x4d34('0x31')][_0x4d34('0x42')]){_0x1aa8e1[_0x4d34('0x43')]=[{'all':!![]}];}_0x1aa8e1=_[_0x4d34('0x3d')]({},_0x1aa8e1,_0x13e7c1['options']);return db[_0x4d34('0x2d')]['find'](_0x1aa8e1)[_0x4d34('0x24')](handleEntityNotFound(_0x2737eb,null))[_0x4d34('0x24')](respondWithResult(_0x2737eb,null))[_0x4d34('0x45')](handleError(_0x2737eb,null));};exports[_0x4d34('0x49')]=function(_0x38b9d5,_0x2786e2){return db['AnalyticDefaultReport'][_0x4d34('0x49')](_0x38b9d5[_0x4d34('0x4a')],{})[_0x4d34('0x24')](function(_0x35c9ef){var _0x282902=_0x38b9d5[_0x4d34('0x4b')]['get']({'plain':!![]});if(!_0x282902)throw new Error(_0x4d34('0x4c'));if(_0x282902[_0x4d34('0x4d')]==='user'){var _0x1985b2=_0x35c9ef[_0x4d34('0x25')]({'plain':!![]});var _0xf30a7=_0x4d34('0x4e');return db['UserProfileSection'][_0x4d34('0x4f')]({'where':{'name':_0xf30a7,'userProfileId':_0x282902[_0x4d34('0x50')]},'raw':!![]})[_0x4d34('0x24')](function(_0x4a119c){if(_0x4a119c&&_0x4a119c['autoAssociation']===0x0){return db[_0x4d34('0x26')]['create']({'name':_0x1985b2[_0x4d34('0x2a')],'resourceId':_0x1985b2['id'],'type':_0x4d34('0x51'),'sectionId':_0x4a119c['id']},{})[_0x4d34('0x24')](function(){return _0x35c9ef;});}else{return _0x35c9ef;}})[_0x4d34('0x45')](function(_0x334160){logger[_0x4d34('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x334160);throw _0x334160;});}return _0x35c9ef;})[_0x4d34('0x24')](respondWithResult(_0x2786e2,0xc9))['catch'](handleError(_0x2786e2,null));};exports[_0x4d34('0x23')]=function(_0x23def3,_0x404235){if(_0x23def3[_0x4d34('0x4a')]['id']){delete _0x23def3[_0x4d34('0x4a')]['id'];}return db[_0x4d34('0x2d')][_0x4d34('0x4f')]({'where':{'id':_0x23def3[_0x4d34('0x47')]['id']}})['then'](handleEntityNotFound(_0x404235,null))['then'](saveUpdates(_0x23def3[_0x4d34('0x4a')],null))[_0x4d34('0x24')](respondWithResult(_0x404235,null))[_0x4d34('0x45')](handleError(_0x404235,null));};exports['destroy']=function(_0x14dc64,_0x251690){return db['AnalyticDefaultReport'][_0x4d34('0x4f')]({'where':{'id':_0x14dc64['params']['id']}})[_0x4d34('0x24')](handleEntityNotFound(_0x251690,null))['then'](removeEntity(_0x251690,null))[_0x4d34('0x45')](handleError(_0x251690,null));};exports[_0x4d34('0x53')]=function(_0x23cc04,_0x53974d){var _0x494f04=0xa;var _0x21d332=[_0x4d34('0x54'),_0x4d34('0x55'),_0x4d34('0x56'),'cross_join'];var _0x380264={'SUM':_0x4d34('0x57'),'COUNT':_0x4d34('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4d34('0x59'),'MIN':_0x4d34('0x5a'),'AVG':_0x4d34('0x5b'),'GROUP_CONCAT':_0x4d34('0x5c'),'GROUP_CONCAT ASC':_0x4d34('0x5d'),'GROUP_CONCAT DESC':_0x4d34('0x5e')};var _0x444f20={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x4d34('0x5f'),'UNIX_TIMESTAMP':_0x4d34('0x60')};var _0x336428=function(_0x2de0f2){return!_[_0x4d34('0x61')]([_0x4d34('0x62'),'IS\x20NOT\x20NULL',_0x4d34('0x63'),'IS\x20NOT\x20EMPTY'],_0x2de0f2);};var _0x13d2ce=function(_0x30d96c){if(!_0x30d96c||!_0x30d96c[_0x4d34('0x64')][_0x4d34('0x37')]){return'';}for(var _0x269075='(',_0x3c0ae4=0x0;_0x3c0ae4<_0x30d96c[_0x4d34('0x64')][_0x4d34('0x37')];_0x3c0ae4+=0x1){_0x3c0ae4>0x0&&(_0x269075+='\x20'+_0x30d96c['operator']+'\x20');_0x269075+=_0x30d96c[_0x4d34('0x64')][_0x3c0ae4][_0x4d34('0x65')]?_0x13d2ce(_0x30d96c[_0x4d34('0x64')][_0x3c0ae4][_0x4d34('0x65')]):_0x30d96c[_0x4d34('0x64')][_0x3c0ae4][_0x4d34('0x66')]+'\x20'+_0x30d96c['rules'][_0x3c0ae4]['condition']+(_0x336428(_0x30d96c[_0x4d34('0x64')][_0x3c0ae4][_0x4d34('0x67')])?'\x20'+_0x30d96c[_0x4d34('0x64')][_0x3c0ae4][_0x4d34('0x68')]:'');}return _0x269075+')';};var _0x989558={'where':{'id':_0x23cc04[_0x4d34('0x47')]['id']}},_0x22d72d,_0x12a545,_0x2389ad,_0xe5a463,_0x1838bd;_0x989558=_[_0x4d34('0x3d')]({},_0x989558,_0x23cc04['options']);return db['AnalyticDefaultReport'][_0x4d34('0x4f')](_0x989558)[_0x4d34('0x24')](function(_0x5b2c9a){if(_0x5b2c9a){_0x22d72d=_0x5b2c9a;return _0x5b2c9a[_0x4d34('0x69')]();}return null;})[_0x4d34('0x24')](function(_0x135cf7){if(_0x135cf7){if(!_0x135cf7[_0x4d34('0x37')]){throw new db[(_0x4d34('0x6a'))][(_0x4d34('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x12a545=_0x135cf7;return db['AnalyticMetric'][_0x4d34('0x6c')]({'raw':!![]});}return null;})[_0x4d34('0x24')](function(_0x1aa811){if(_0x1aa811){_0x2389ad=_[_0x4d34('0x6d')](_0x1aa811,'id');var _0x4f42d7;var _0x359be1=squel[_0x4d34('0x6e')]();_0x359be1[_0x4d34('0x6f')](_0x22d72d[_0x4d34('0x70')]);for(var _0xe7fd7b=0x0;_0xe7fd7b<_0x12a545[_0x4d34('0x37')];_0xe7fd7b+=0x1){_0x4f42d7=_0x12a545[_0xe7fd7b]['MetricId']?_0x2389ad[_0x12a545[_0xe7fd7b][_0x4d34('0x71')]][_0x4d34('0x72')]:_0x12a545[_0xe7fd7b][_0x4d34('0x66')];_0x4f42d7=_0x12a545[_0xe7fd7b][_0x4d34('0x73')]?_[_0x4d34('0x74')](_0x380264[_0x12a545[_0xe7fd7b][_0x4d34('0x73')]],'%s',_0x4f42d7):_0x4f42d7;_0x4f42d7=_0x12a545[_0xe7fd7b]['format']?_[_0x4d34('0x74')](_0x444f20[_0x12a545[_0xe7fd7b][_0x4d34('0x75')]],'%s',_0x4f42d7):_0x4f42d7;if(_0x12a545[_0xe7fd7b][_0x4d34('0x76')]){_0x359be1['group'](_0x4f42d7);}_0x12a545[_0xe7fd7b][_0x4d34('0x77')]&&_0x359be1[_0x4d34('0x39')](_0x4f42d7,_0x12a545[_0xe7fd7b][_0x4d34('0x77')]==='DESC'?![]:!![]);_0x359be1[_0x4d34('0x66')](_0x4f42d7,_0x12a545[_0xe7fd7b][_0x4d34('0x78')]||_0x4f42d7);}if(_0x22d72d['joins']){_0x22d72d[_0x4d34('0x79')]=JSON['parse'](_0x22d72d[_0x4d34('0x79')]);for(var _0x525896=0x0;_0x525896<_0x22d72d[_0x4d34('0x79')][_0x4d34('0x37')];_0x525896+=0x1){if(_0x22d72d[_0x4d34('0x79')][_0x525896]['type']&&_[_0x4d34('0x61')](_0x21d332,_0x22d72d[_0x4d34('0x79')][_0x525896]['type'])&&_0x22d72d['joins'][_0x525896]['parentKey']&&_0x22d72d[_0x4d34('0x79')][_0x525896][_0x4d34('0x7a')]&&_0x22d72d[_0x4d34('0x79')][_0x525896][_0x4d34('0x7b')]){_0x359be1[_0x22d72d['joins'][_0x525896][_0x4d34('0x2e')]](_0x22d72d[_0x4d34('0x79')][_0x525896][_0x4d34('0x7a')],null,util[_0x4d34('0x75')]('%s.%s\x20=\x20%s.%s',_0x22d72d['table'],_0x22d72d[_0x4d34('0x79')][_0x525896]['parentKey'],_0x22d72d[_0x4d34('0x79')][_0x525896][_0x4d34('0x7a')],_0x22d72d[_0x4d34('0x79')][_0x525896][_0x4d34('0x7b')]));}}}if(_0x22d72d[_0x4d34('0x7c')]){_0x22d72d[_0x4d34('0x7c')]=JSON[_0x4d34('0x7d')](_0x22d72d[_0x4d34('0x7c')]);_0x359be1['where'](_0x13d2ce(_0x22d72d['conditions'][_0x4d34('0x65')]));}_0x1838bd=_0x359be1[_0x4d34('0x7e')]();_0x359be1[_0x4d34('0x1f')](_0x494f04);_0x359be1['offset'](0x0);logger['debug'](_0x4d34('0x7f'),_0x359be1[_0x4d34('0x80')]());return dbH[_0x4d34('0x81')][_0x4d34('0x31')](_0x359be1[_0x4d34('0x80')](),{'type':dbH[_0x4d34('0x81')][_0x4d34('0x82')][_0x4d34('0x83')]});}})[_0x4d34('0x24')](respondWithResult(_0x53974d,null))['catch'](handleError(_0x53974d,null));};function runReport(_0x587394,_0x3f9af7,_0x46a025){var _0x43103b=_0x3f9af7[_0x4d34('0x2a')];var _0x57cfa4=0xa;var _0x2b093e=[_0x4d34('0x54'),_0x4d34('0x55'),_0x4d34('0x56'),_0x4d34('0x84')];var _0x38efa8={'SUM':_0x4d34('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4d34('0x85'),'MAX':_0x4d34('0x59'),'MIN':_0x4d34('0x5a'),'AVG':_0x4d34('0x5b'),'GROUP_CONCAT':_0x4d34('0x5c'),'GROUP_CONCAT ASC':_0x4d34('0x5d'),'GROUP_CONCAT DESC':_0x4d34('0x5e')};var _0x221512={'SEC_TO_TIME':_0x4d34('0x86'),'DATE':_0x4d34('0x87'),'HOUR':'HOUR(%s)','ROUND':_0x4d34('0x5f'),'UNIX_TIMESTAMP':_0x4d34('0x60')};var _0xe36978=function(_0x9ea875){return!_[_0x4d34('0x61')]([_0x4d34('0x62'),_0x4d34('0x88'),_0x4d34('0x63'),_0x4d34('0x89')],_0x9ea875);};var _0x4d4f00=function(_0x5c6b54){if(!_0x5c6b54||!_0x5c6b54['rules'][_0x4d34('0x37')]){return'';}for(var _0x5c32e0='(',_0x4468d4=0x0;_0x4468d4<_0x5c6b54[_0x4d34('0x64')]['length'];_0x4468d4+=0x1){_0x4468d4>0x0&&(_0x5c32e0+='\x20'+_0x5c6b54[_0x4d34('0x8a')]+'\x20');_0x5c32e0+=_0x5c6b54[_0x4d34('0x64')][_0x4468d4]['group']?_0x4d4f00(_0x5c6b54[_0x4d34('0x64')][_0x4468d4][_0x4d34('0x65')]):_0x5c6b54['rules'][_0x4468d4][_0x4d34('0x66')]+'\x20'+_0x5c6b54['rules'][_0x4468d4][_0x4d34('0x67')]+(_0xe36978(_0x5c6b54[_0x4d34('0x64')][_0x4468d4][_0x4d34('0x67')])?'\x20'+_0x5c6b54[_0x4d34('0x64')][_0x4468d4][_0x4d34('0x68')]:'');}return _0x5c32e0+')';};var _0x59aa7f={'where':{'id':_0x587394['id']}},_0x1b092d,_0x5682ff,_0x17c859,_0x374d09,_0x14e1f2;_0x59aa7f=_[_0x4d34('0x3d')]({},_0x59aa7f,_0x46a025);return db[_0x4d34('0x2d')][_0x4d34('0x4f')](_0x59aa7f)['then'](function(_0x49866c){if(_0x49866c){_0x1b092d=_0x49866c;return _0x49866c[_0x4d34('0x69')]();}return null;})[_0x4d34('0x24')](function(_0x1c477d){if(_0x1c477d){if(!_0x1c477d[_0x4d34('0x37')]){throw new db[(_0x4d34('0x6a'))][(_0x4d34('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5682ff=_0x1c477d;return db[_0x4d34('0x8b')][_0x4d34('0x6c')]({'raw':!![]});}return null;})['then'](function(_0x55267b){if(_0x55267b){_0x17c859=_[_0x4d34('0x6d')](_0x55267b,'id');var _0x37343b;var _0x1e52e4=squel[_0x4d34('0x6e')]();_0x1e52e4[_0x4d34('0x6f')](_0x1b092d[_0x4d34('0x70')]);for(var _0x458cea=0x0;_0x458cea<_0x5682ff[_0x4d34('0x37')];_0x458cea+=0x1){_0x37343b=_0x5682ff[_0x458cea][_0x4d34('0x71')]?_0x17c859[_0x5682ff[_0x458cea]['MetricId']][_0x4d34('0x72')]:_0x5682ff[_0x458cea][_0x4d34('0x66')];_0x37343b=_0x5682ff[_0x458cea]['function']?_[_0x4d34('0x74')](_0x38efa8[_0x5682ff[_0x458cea][_0x4d34('0x73')]],'%s',_0x37343b):_0x37343b;_0x37343b=_0x5682ff[_0x458cea]['format']?_[_0x4d34('0x74')](_0x221512[_0x5682ff[_0x458cea][_0x4d34('0x75')]],'%s',_0x37343b):_0x37343b;if(_0x5682ff[_0x458cea][_0x4d34('0x76')]){_0x1e52e4[_0x4d34('0x65')](_0x37343b);}_0x5682ff[_0x458cea][_0x4d34('0x77')]&&_0x1e52e4[_0x4d34('0x39')](_0x37343b,_0x5682ff[_0x458cea][_0x4d34('0x77')]===_0x4d34('0x8c')?![]:!![]);_0x1e52e4[_0x4d34('0x66')](_0x37343b,_0x5682ff[_0x458cea][_0x4d34('0x78')]||_0x37343b);}if(_0x1b092d[_0x4d34('0x79')]){_0x1b092d[_0x4d34('0x79')]=JSON['parse'](_0x1b092d[_0x4d34('0x79')]);for(var _0x223ba0=0x0;_0x223ba0<_0x1b092d[_0x4d34('0x79')][_0x4d34('0x37')];_0x223ba0+=0x1){if(_0x1b092d['joins'][_0x223ba0][_0x4d34('0x2e')]&&_[_0x4d34('0x61')](_0x2b093e,_0x1b092d[_0x4d34('0x79')][_0x223ba0][_0x4d34('0x2e')])&&_0x1b092d['joins'][_0x223ba0][_0x4d34('0x8d')]&&_0x1b092d['joins'][_0x223ba0][_0x4d34('0x7a')]&&_0x1b092d[_0x4d34('0x79')][_0x223ba0][_0x4d34('0x7b')]){_0x1e52e4[_0x1b092d[_0x4d34('0x79')][_0x223ba0][_0x4d34('0x2e')]](_0x1b092d[_0x4d34('0x79')][_0x223ba0][_0x4d34('0x7a')],null,util[_0x4d34('0x75')]('%s.%s\x20=\x20%s.%s',_0x1b092d[_0x4d34('0x70')],_0x1b092d[_0x4d34('0x79')][_0x223ba0]['parentKey'],_0x1b092d[_0x4d34('0x79')][_0x223ba0]['foreignTable'],_0x1b092d[_0x4d34('0x79')][_0x223ba0][_0x4d34('0x7b')]));}}}if(_0x1b092d['conditions']){_0x1b092d[_0x4d34('0x7c')]=JSON[_0x4d34('0x7d')](_0x1b092d[_0x4d34('0x7c')]);_0x1e52e4[_0x4d34('0x3b')](_0x4d4f00(_0x1b092d[_0x4d34('0x7c')]['group']));}_0x14e1f2=_0x1e52e4[_0x4d34('0x7e')]();_0x1e52e4[_0x4d34('0x1f')](_0x57cfa4);_0x1e52e4['offset'](0x0);return;}})[_0x4d34('0x24')](function(){if(_0x3f9af7[_0x4d34('0x8e')]==='web'){return null;}var _0x4d5568=_[_0x4d34('0x3d')](_0x3f9af7,{'name':_0x3f9af7[_0x4d34('0x8f')]||_0x3f9af7[_0x4d34('0x2a')]||_0x1b092d['name'],'basename':_0x43103b,'savename':util[_0x4d34('0x75')]('%s-%s.%s',_0x3f9af7[_0x4d34('0x2a')]||_0x1b092d[_0x4d34('0x2a')],require(_0x4d34('0x90'))[_0x4d34('0x91')](0x4),_0x3f9af7[_0x4d34('0x8e')]||_0x4d34('0x92')),'reportId':_0x1b092d['id'],'reportType':_0x4d34('0x93')});return db[_0x4d34('0x94')][_0x4d34('0x49')](_0x4d5568,{'raw':!![]});})['then'](function(_0x49a56f){if(_0x1b092d[_0x4d34('0x70')]===_0x4d34('0x95')){_0x14e1f2[_0x4d34('0x3b')](_0x1b092d[_0x4d34('0x70')]+_0x4d34('0x96'),_0x3f9af7[_0x4d34('0x97')],_0x3f9af7[_0x4d34('0x98')]);}else{_0x14e1f2[_0x4d34('0x3b')](_0x1b092d[_0x4d34('0x70')]+_0x4d34('0x99'),_0x3f9af7[_0x4d34('0x97')],_0x3f9af7[_0x4d34('0x98')]);}if(_0x49a56f){logger[_0x4d34('0x9a')](_0x4d34('0x9b'),_0x14e1f2[_0x4d34('0x80')]());require(_0x4d34('0x9c'))['fork'](path['join'](__dirname,_0x4d34('0x9d'),_0x49a56f[_0x4d34('0x8e')]),[_0x49a56f['id'],_0x14e1f2[_0x4d34('0x80')](),path[_0x4d34('0x54')](__dirname,_0x4d34('0x9e'),_0x49a56f[_0x4d34('0x9f')]),_0x43103b]);return _0x49a56f;}else{var _0x212c2f=squel['select']();_0x212c2f[_0x4d34('0x6f')]('('+_0x14e1f2[_0x4d34('0x80')]()+')',_0x4d34('0xa0'));_0x212c2f[_0x4d34('0x66')](_0x4d34('0xa1'),'count');_0x14e1f2[_0x4d34('0x1f')](_0x3f9af7[_0x4d34('0x1f')]||_0x57cfa4);_0x14e1f2['offset'](_0x3f9af7['offset']||0x0);return dbH['sequelize'][_0x4d34('0x31')](_0x212c2f[_0x4d34('0x80')](),{'type':dbH[_0x4d34('0x81')]['QueryTypes'][_0x4d34('0x83')]})['then'](function(_0x3b6070){if(!_0x3b6070['length']){_0x374d09=0x0;}else{_0x374d09=_0x3b6070[0x0][_0x4d34('0x41')]||0x0;}return dbH[_0x4d34('0x81')]['query'](_0x14e1f2[_0x4d34('0x80')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x4d34('0x24')](function(_0xbe7ecd){return{'rows':_0xbe7ecd||[],'count':_0x374d09};});}});}exports[_0x4d34('0xa2')]=function(_0x17cf99,_0x45381c){return runReport(_0x17cf99['params'],_0x17cf99[_0x4d34('0x31')],_0x17cf99[_0x4d34('0x40')])[_0x4d34('0x24')](respondWithResult(_0x45381c,null))['catch'](handleError(_0x45381c,null));};exports['runReport']=runReport;exports['query']=function(_0x560186,_0x1cd77a){var _0x352a6b=0xa;var _0x55b3a1=['join','left_join',_0x4d34('0x56'),'cross_join'];var _0x582147={'SUM':_0x4d34('0x57'),'COUNT':_0x4d34('0x58'),'COUNT DISTINCT':_0x4d34('0x85'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x4d34('0x5c'),'GROUP_CONCAT ASC':_0x4d34('0x5d'),'GROUP_CONCAT DESC':_0x4d34('0x5e')};var _0x1fdc76={'SEC_TO_TIME':_0x4d34('0x86'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x4d34('0x5f'),'UNIX_TIMESTAMP':_0x4d34('0x60')};var _0x509551=function(_0x1a7a04){return!_[_0x4d34('0x61')]([_0x4d34('0x62'),_0x4d34('0x88'),_0x4d34('0x63'),'IS\x20NOT\x20EMPTY'],_0x1a7a04);};var _0x53aed9=function(_0x442a29){if(!_0x442a29||!_0x442a29[_0x4d34('0x64')][_0x4d34('0x37')]){return'';}for(var _0x1f4516='(',_0x7273f8=0x0;_0x7273f8<_0x442a29[_0x4d34('0x64')][_0x4d34('0x37')];_0x7273f8+=0x1){_0x7273f8>0x0&&(_0x1f4516+='\x20'+_0x442a29[_0x4d34('0x8a')]+'\x20');_0x1f4516+=_0x442a29['rules'][_0x7273f8][_0x4d34('0x65')]?_0x53aed9(_0x442a29[_0x4d34('0x64')][_0x7273f8][_0x4d34('0x65')]):_0x442a29['rules'][_0x7273f8][_0x4d34('0x66')]+'\x20'+_0x442a29[_0x4d34('0x64')][_0x7273f8][_0x4d34('0x67')]+(_0x509551(_0x442a29[_0x4d34('0x64')][_0x7273f8]['condition'])?'\x20'+_0x442a29[_0x4d34('0x64')][_0x7273f8]['value']:'');}return _0x1f4516+')';};var _0x18c371={'where':{'id':_0x560186[_0x4d34('0x47')]['id']}},_0x4f22fb,_0x456622,_0x4f61be,_0x1127a3,_0x35598e;_0x18c371=_[_0x4d34('0x3d')]({},_0x18c371,_0x560186[_0x4d34('0x40')]);return db['AnalyticDefaultReport'][_0x4d34('0x4f')](_0x18c371)[_0x4d34('0x24')](function(_0x5bd3aa){if(_0x5bd3aa){_0x4f22fb=_0x5bd3aa;return _0x5bd3aa[_0x4d34('0x69')]();}return null;})['then'](function(_0xd50949){if(_0xd50949){if(!_0xd50949[_0x4d34('0x37')]){throw new db['Sequelize'][(_0x4d34('0x6b'))](_0x4d34('0xa3'),0x193);}_0x456622=_0xd50949;return db[_0x4d34('0x8b')]['findAll']({'raw':!![]});}return null;})[_0x4d34('0x24')](function(_0x4d4c9a){if(_0x4d4c9a){_0x4f61be=_['keyBy'](_0x4d4c9a,'id');var _0x2ec16a;var _0xd3c071=squel[_0x4d34('0x6e')]();_0xd3c071[_0x4d34('0x6f')](_0x4f22fb[_0x4d34('0x70')]);for(var _0x1a987f=0x0;_0x1a987f<_0x456622[_0x4d34('0x37')];_0x1a987f+=0x1){_0x2ec16a=_0x456622[_0x1a987f]['MetricId']?_0x4f61be[_0x456622[_0x1a987f][_0x4d34('0x71')]][_0x4d34('0x72')]:_0x456622[_0x1a987f][_0x4d34('0x66')];_0x2ec16a=_0x456622[_0x1a987f][_0x4d34('0x73')]?_['replace'](_0x582147[_0x456622[_0x1a987f][_0x4d34('0x73')]],'%s',_0x2ec16a):_0x2ec16a;_0x2ec16a=_0x456622[_0x1a987f]['format']?_[_0x4d34('0x74')](_0x1fdc76[_0x456622[_0x1a987f][_0x4d34('0x75')]],'%s',_0x2ec16a):_0x2ec16a;if(_0x456622[_0x1a987f][_0x4d34('0x76')]){_0xd3c071[_0x4d34('0x65')](_0x2ec16a);}_0x456622[_0x1a987f][_0x4d34('0x77')]&&_0xd3c071['order'](_0x2ec16a,_0x456622[_0x1a987f][_0x4d34('0x77')]==='DESC'?![]:!![]);_0xd3c071[_0x4d34('0x66')](_0x2ec16a,_0x456622[_0x1a987f][_0x4d34('0x78')]||_0x2ec16a);}if(_0x4f22fb[_0x4d34('0x79')]){_0x4f22fb[_0x4d34('0x79')]=JSON[_0x4d34('0x7d')](_0x4f22fb[_0x4d34('0x79')]);for(var _0x5487e4=0x0;_0x5487e4<_0x4f22fb['joins']['length'];_0x5487e4+=0x1){if(_0x4f22fb[_0x4d34('0x79')][_0x5487e4][_0x4d34('0x2e')]&&_[_0x4d34('0x61')](_0x55b3a1,_0x4f22fb['joins'][_0x5487e4]['type'])&&_0x4f22fb[_0x4d34('0x79')][_0x5487e4][_0x4d34('0x8d')]&&_0x4f22fb['joins'][_0x5487e4][_0x4d34('0x7a')]&&_0x4f22fb[_0x4d34('0x79')][_0x5487e4][_0x4d34('0x7b')]){_0xd3c071[_0x4f22fb[_0x4d34('0x79')][_0x5487e4]['type']](_0x4f22fb['joins'][_0x5487e4][_0x4d34('0x7a')],null,util['format'](_0x4d34('0xa4'),_0x4f22fb[_0x4d34('0x70')],_0x4f22fb[_0x4d34('0x79')][_0x5487e4][_0x4d34('0x8d')],_0x4f22fb['joins'][_0x5487e4][_0x4d34('0x7a')],_0x4f22fb[_0x4d34('0x79')][_0x5487e4][_0x4d34('0x7b')]));}}}if(_0x4f22fb[_0x4d34('0x7c')]){_0x4f22fb[_0x4d34('0x7c')]=JSON[_0x4d34('0x7d')](_0x4f22fb[_0x4d34('0x7c')]);_0xd3c071[_0x4d34('0x3b')](_0x53aed9(_0x4f22fb[_0x4d34('0x7c')]['group']));}_0x35598e=_0xd3c071[_0x4d34('0x7e')]();_0xd3c071[_0x4d34('0x1f')](_0x352a6b);_0xd3c071['offset'](0x0);logger[_0x4d34('0xa5')]('Limited\x20Query:',_0xd3c071[_0x4d34('0x80')]());return dbH[_0x4d34('0x81')]['query'](_0xd3c071[_0x4d34('0x80')](),{'type':dbH[_0x4d34('0x81')][_0x4d34('0x82')][_0x4d34('0x83')]});}})[_0x4d34('0x24')](function(){return{'sql':_0x35598e[_0x4d34('0x80')]()};})[_0x4d34('0x24')](respondWithResult(_0x1cd77a,null))['catch'](handleError(_0x1cd77a,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index cca0120..aa5308d 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 _0xf774=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x28816a,_0x2408f9){var _0x1a56df=function(_0x1d2578){while(--_0x1d2578){_0x28816a['push'](_0x28816a['shift']());}};_0x1a56df(++_0x2408f9);}(_0xf774,0xae));var _0x4f77=function(_0x33757e,_0x35b6ba){_0x33757e=_0x33757e-0x0;var _0x54c6ad=_0xf774[_0x33757e];return _0x54c6ad;};'use strict';var _=require(_0x4f77('0x0'));var util=require('util');var logger=require(_0x4f77('0x1'))(_0x4f77('0x2'));var moment=require(_0x4f77('0x3'));var BPromise=require('bluebird');var rp=require(_0x4f77('0x4'));var fs=require('fs');var path=require(_0x4f77('0x5'));var rimraf=require(_0x4f77('0x6'));var config=require(_0x4f77('0x7'));var attributes=require(_0x4f77('0x8'));module[_0x4f77('0x9')]=function(_0x180511,_0x459e9c){return _0x180511[_0x4f77('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x4f77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a9a=['analytics_default_reports','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x5a9a,0x85));var _0xa5a9=function(_0x5ba473,_0x9e19b7){_0x5ba473=_0x5ba473-0x0;var _0x214ba5=_0x5a9a[_0x5ba473];return _0x214ba5;};'use strict';var _=require('lodash');var util=require(_0xa5a9('0x0'));var logger=require(_0xa5a9('0x1'))('api');var moment=require(_0xa5a9('0x2'));var BPromise=require(_0xa5a9('0x3'));var rp=require(_0xa5a9('0x4'));var fs=require('fs');var path=require(_0xa5a9('0x5'));var rimraf=require('rimraf');var config=require(_0xa5a9('0x6'));var attributes=require(_0xa5a9('0x7'));module[_0xa5a9('0x8')]=function(_0x48fca3,_0x849f75){return _0x48fca3[_0xa5a9('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0xa5a9('0xa'),'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 c244cfa..dd35019 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 _0x8130=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0xf4f38c,_0x402145){var _0x3e5cdc=function(_0x333b89){while(--_0x333b89){_0xf4f38c['push'](_0xf4f38c['shift']());}};_0x3e5cdc(++_0x402145);}(_0x8130,0x146));var _0x0813=function(_0x1a128f,_0x1d1ae5){_0x1a128f=_0x1a128f-0x0;var _0x5b608b=_0x8130[_0x1a128f];return _0x5b608b;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var moment=require('moment');var BPromise=require(_0x0813('0x2'));var rs=require(_0x0813('0x3'));var fs=require('fs');var Redis=require(_0x0813('0x4'));var db=require(_0x0813('0x5'))['db'];var utils=require(_0x0813('0x6'));var logger=require(_0x0813('0x7'))('rpc');var config=require(_0x0813('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0813('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2df45a,_0x2bbdfd,_0x19a508){return new BPromise(function(_0x2ab8f0,_0x115a90){return client[_0x0813('0xa')](_0x2df45a,_0x19a508)['then'](function(_0x44ec2c){logger[_0x0813('0xb')](_0x0813('0xc'),_0x2bbdfd,'request\x20sent');logger['debug'](_0x0813('0xd'),_0x2bbdfd,'request\x20sent',JSON[_0x0813('0xe')](_0x44ec2c));if(_0x44ec2c['error']){if(_0x44ec2c[_0x0813('0xf')][_0x0813('0x10')]===0x1f4){logger[_0x0813('0xf')](_0x0813('0xc'),_0x2bbdfd,_0x44ec2c['error']['message']);return _0x115a90(_0x44ec2c[_0x0813('0xf')][_0x0813('0x11')]);}logger['error'](_0x0813('0xc'),_0x2bbdfd,_0x44ec2c['error']['message']);return _0x2ab8f0(_0x44ec2c[_0x0813('0xf')][_0x0813('0x11')]);}else{logger['info'](_0x0813('0xc'),_0x2bbdfd,'request\x20sent');_0x2ab8f0(_0x44ec2c[_0x0813('0x12')][_0x0813('0x11')]);}})[_0x0813('0x13')](function(_0xee126d){logger[_0x0813('0xf')](_0x0813('0xc'),_0x2bbdfd,_0xee126d);_0x115a90(_0xee126d);});});} \ No newline at end of file +var _0x980c=['../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ea463,_0x1541b3){var _0x596aef=function(_0x22b977){while(--_0x22b977){_0x4ea463['push'](_0x4ea463['shift']());}};_0x596aef(++_0x1541b3);}(_0x980c,0x100));var _0xc980=function(_0x79b28a,_0x9a5b26){_0x79b28a=_0x79b28a-0x0;var _0x2b4798=_0x980c[_0x79b28a];return _0x2b4798;};'use strict';var _=require(_0xc980('0x0'));var util=require(_0xc980('0x1'));var moment=require(_0xc980('0x2'));var BPromise=require(_0xc980('0x3'));var rs=require(_0xc980('0x4'));var fs=require('fs');var Redis=require(_0xc980('0x5'));var db=require(_0xc980('0x6'))['db'];var utils=require(_0xc980('0x7'));var logger=require(_0xc980('0x8'))(_0xc980('0x9'));var config=require(_0xc980('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc980('0xb')][_0xc980('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36d2dd,_0x3175e7,_0x389546){return new BPromise(function(_0x4523c0,_0x355bfa){return client['request'](_0x36d2dd,_0x389546)['then'](function(_0x5b99c8){logger[_0xc980('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3175e7,_0xc980('0xe'));logger[_0xc980('0xf')](_0xc980('0x10'),_0x3175e7,'request\x20sent',JSON[_0xc980('0x11')](_0x5b99c8));if(_0x5b99c8[_0xc980('0x12')]){if(_0x5b99c8[_0xc980('0x12')]['code']===0x1f4){logger[_0xc980('0x12')](_0xc980('0x13'),_0x3175e7,_0x5b99c8[_0xc980('0x12')][_0xc980('0x14')]);return _0x355bfa(_0x5b99c8[_0xc980('0x12')][_0xc980('0x14')]);}logger[_0xc980('0x12')](_0xc980('0x13'),_0x3175e7,_0x5b99c8[_0xc980('0x12')][_0xc980('0x14')]);return _0x4523c0(_0x5b99c8[_0xc980('0x12')][_0xc980('0x14')]);}else{logger[_0xc980('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3175e7,'request\x20sent');_0x4523c0(_0x5b99c8[_0xc980('0x15')]['message']);}})['catch'](function(_0x1d1de0){logger[_0xc980('0x12')](_0xc980('0x13'),_0x3175e7,_0x1d1de0);_0x355bfa(_0x1d1de0);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 583858a..73d08d7 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 _0xa909=['isAuthenticated','index','show','get','/:id/preview','preview','run','query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x4d525c,_0x277dac){var _0x3f0655=function(_0x5e8102){while(--_0x5e8102){_0x4d525c['push'](_0x4d525c['shift']());}};_0x3f0655(++_0x277dac);}(_0xa909,0x186));var _0x9a90=function(_0x50b334,_0xea3188){_0x50b334=_0x50b334-0x0;var _0x30ce47=_0xa909[_0x50b334];return _0x30ce47;};'use strict';var multer=require('multer');var util=require(_0x9a90('0x0'));var path=require(_0x9a90('0x1'));var timeout=require(_0x9a90('0x2'));var express=require(_0x9a90('0x3'));var router=express[_0x9a90('0x4')]();var fs_extra=require(_0x9a90('0x5'));var auth=require(_0x9a90('0x6'));var interaction=require(_0x9a90('0x7'));var config=require(_0x9a90('0x8'));var controller=require(_0x9a90('0x9'));router['get']('/',auth[_0x9a90('0xa')](),controller[_0x9a90('0xb')]);router['get']('/:id',auth[_0x9a90('0xa')](),controller[_0x9a90('0xc')]);router[_0x9a90('0xd')](_0x9a90('0xe'),auth['isAuthenticated'](),controller[_0x9a90('0xf')]);router['get']('/:id/run',auth[_0x9a90('0xa')](),controller[_0x9a90('0x10')]);router['get']('/:id/query',auth[_0x9a90('0xa')](),controller[_0x9a90('0x11')]);router[_0x9a90('0x12')]('/',auth['isAuthenticated'](),controller[_0x9a90('0x13')]);router[_0x9a90('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x9a90('0x15')]);router[_0x9a90('0x16')]('/:id',auth[_0x9a90('0xa')](),controller[_0x9a90('0x17')]);module[_0x9a90('0x18')]=router; \ No newline at end of file +var _0x759e=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put'];(function(_0x180e11,_0x24bfb8){var _0x330930=function(_0x5be898){while(--_0x5be898){_0x180e11['push'](_0x180e11['shift']());}};_0x330930(++_0x24bfb8);}(_0x759e,0xbd));var _0xe759=function(_0x2bea4b,_0x52c11e){_0x2bea4b=_0x2bea4b-0x0;var _0x55663d=_0x759e[_0x2bea4b];return _0x55663d;};'use strict';var multer=require(_0xe759('0x0'));var util=require(_0xe759('0x1'));var path=require(_0xe759('0x2'));var timeout=require(_0xe759('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe759('0x4'));var auth=require(_0xe759('0x5'));var interaction=require(_0xe759('0x6'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xe759('0x7')]('/',auth[_0xe759('0x8')](),controller['index']);router[_0xe759('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe759('0x9')]);router['get'](_0xe759('0xa'),auth[_0xe759('0x8')](),controller[_0xe759('0xb')]);router['get'](_0xe759('0xc'),auth[_0xe759('0x8')](),controller[_0xe759('0xd')]);router[_0xe759('0x7')](_0xe759('0xe'),auth[_0xe759('0x8')](),controller[_0xe759('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe759('0x10')]);router[_0xe759('0x11')](_0xe759('0x12'),auth[_0xe759('0x8')](),controller[_0xe759('0x13')]);router[_0xe759('0x14')](_0xe759('0x12'),auth['isAuthenticated'](),controller[_0xe759('0x15')]);module[_0xe759('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index b6943e2..894be3c 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 _0xb00e=['exports','STRING','csv','pdf','xlsx','DATE','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','moment'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0xb00e,0xf6));var _0xeb00=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xb00e[_0x25d386];return _0x857f4a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xeb00('0x0'));module[_0xeb00('0x1')]={'name':{'type':Sequelize[_0xeb00('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xeb00('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xeb00('0x3'),_0xeb00('0x4'),_0xeb00('0x5')),'allowNull':![],'defaultValue':_0xeb00('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xeb00('0x6')]},'endDate':{'type':Sequelize[_0xeb00('0x6')]},'status':{'type':Sequelize[_0xeb00('0x2')],'defaultValue':_0xeb00('0x7')},'type':{'type':Sequelize[_0xeb00('0x8')](_0xeb00('0x9'),_0xeb00('0xa')),'allowNull':![],'defaultValue':_0xeb00('0x9')},'reportId':{'type':Sequelize[_0xeb00('0xb')](0xb)[_0xeb00('0xc')]},'reportType':{'type':Sequelize[_0xeb00('0x2')]}}; \ No newline at end of file +var _0x9488=['INTEGER','UNSIGNED','moment','exports','STRING','csv','pdf','xlsx','DATE','Loading','ENUM','manual','scheduled'];(function(_0x44b6f2,_0x38a417){var _0x190b48=function(_0x6fb983){while(--_0x6fb983){_0x44b6f2['push'](_0x44b6f2['shift']());}};_0x190b48(++_0x38a417);}(_0x9488,0x13a));var _0x8948=function(_0x34c993,_0x484bfa){_0x34c993=_0x34c993-0x0;var _0x2c6038=_0x9488[_0x34c993];return _0x2c6038;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8948('0x0'));module[_0x8948('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x8948('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x8948('0x3'),_0x8948('0x4'),_0x8948('0x5')),'allowNull':![],'defaultValue':_0x8948('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x8948('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x8948('0x7')},'type':{'type':Sequelize[_0x8948('0x8')](_0x8948('0x9'),_0x8948('0xa')),'allowNull':![],'defaultValue':_0x8948('0x9')},'reportId':{'type':Sequelize[_0x8948('0xb')](0xb)[_0x8948('0xc')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 4580ba0..f8a7125 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 _0x4ded=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','index','map','fieldName','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','AnalyticExtractedReport','findAll','rows','show','params','rawAttributes','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x2cfef8,_0x230aa3){var _0x12167a=function(_0x2744db){while(--_0x2744db){_0x2cfef8['push'](_0x2cfef8['shift']());}};_0x12167a(++_0x230aa3);}(_0x4ded,0x116));var _0xd4de=function(_0x585e07,_0x42d8cd){_0x585e07=_0x585e07-0x0;var _0x22fed8=_0x4ded[_0x585e07];return _0x22fed8;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require(_0xd4de('0x9'));var sox=require(_0xd4de('0xa'));var csv=require(_0xd4de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require(_0xd4de('0xe'));var crypto=require(_0xd4de('0xf'));var jsforce=require(_0xd4de('0x10'));var deskjs=require(_0xd4de('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4de('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4de('0x13'));var as=require(_0xd4de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4de('0x16'));var db=require(_0xd4de('0x17'))['db'];function respondWithStatusCode(_0x104dad,_0x2aa09d){_0x2aa09d=_0x2aa09d||0xcc;return function(_0x3ffc72){if(_0x3ffc72){return _0x104dad[_0xd4de('0x18')](_0x2aa09d);}return _0x104dad[_0xd4de('0x19')](_0x2aa09d)[_0xd4de('0x1a')]();};}function respondWithResult(_0x3e3735,_0x37cb9f){_0x37cb9f=_0x37cb9f||0xc8;return function(_0x691ba9){if(_0x691ba9){return _0x3e3735[_0xd4de('0x19')](_0x37cb9f)[_0xd4de('0x1b')](_0x691ba9);}};}function respondWithFilteredResult(_0xbb4f7e,_0x102e5b){return function(_0xa7c18b){if(_0xa7c18b){var _0x325fba=_0xa7c18b[_0xd4de('0x1c')],_0x4b0a95=_0x102e5b[_0xd4de('0x1d')],_0x5d0aeb=_0x102e5b[_0xd4de('0x1d')]+_0x102e5b['limit'],_0x3df820;if(_0x5d0aeb>=_0x325fba){_0x5d0aeb=_0x325fba;_0x3df820=0xc8;}else{_0x3df820=0xce;}_0xbb4f7e['status'](_0x3df820);return _0xbb4f7e[_0xd4de('0x1e')]('Content-Range',_0x4b0a95+'-'+_0x5d0aeb+'/'+_0x325fba)[_0xd4de('0x1b')](_0xa7c18b);}return null;};}function patchUpdates(_0x29c028){return function(_0x50b9e3){try{jsonpatch[_0xd4de('0x1f')](_0x50b9e3,_0x29c028,!![]);}catch(_0x57c078){return BPromise[_0xd4de('0x20')](_0x57c078);}return _0x50b9e3[_0xd4de('0x21')]();};}function saveUpdates(_0x2bad14,_0x8e8712){return function(_0x5368f5){if(_0x5368f5){return _0x5368f5[_0xd4de('0x22')](_0x2bad14)[_0xd4de('0x23')](function(_0x360e3d){return _0x360e3d;});}return null;};}function removeEntity(_0xdb3fc,_0x1c631a){return function(_0x2d092a){if(_0x2d092a){return _0x2d092a[_0xd4de('0x24')]()[_0xd4de('0x23')](function(){var _0x2f9de6=_0x2d092a[_0xd4de('0x25')]({'plain':!![]});var _0x534b37=_0xd4de('0x26');return db[_0xd4de('0x27')][_0xd4de('0x24')]({'where':{'type':_0x534b37,'resourceId':_0x2f9de6['id']}})[_0xd4de('0x23')](function(){return _0x2d092a;});})[_0xd4de('0x23')](function(){_0xdb3fc[_0xd4de('0x19')](0xcc)[_0xd4de('0x1a')]();});}};}function handleEntityNotFound(_0x36308c,_0x2aa82a){return function(_0x260c5c){if(!_0x260c5c){_0x36308c[_0xd4de('0x18')](0x194);}return _0x260c5c;};}function handleError(_0xb2d8a1,_0x586126){_0x586126=_0x586126||0x1f4;return function(_0xe64e4e){logger[_0xd4de('0x28')](_0xe64e4e['stack']);if(_0xe64e4e[_0xd4de('0x29')]){delete _0xe64e4e['name'];}_0xb2d8a1[_0xd4de('0x19')](_0x586126)[_0xd4de('0x2a')](_0xe64e4e);};}exports[_0xd4de('0x2b')]=function(_0x4fa53a,_0xd4de93){var _0x36f2f1={},_0x17f0a={},_0x50cb73={'count':0x0,'rows':[]};var _0x3615b8=_[_0xd4de('0x2c')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x5706fe){return{'name':_0x5706fe[_0xd4de('0x2d')],'type':_0x5706fe['type'][_0xd4de('0x2e')]};});_0x17f0a[_0xd4de('0x2f')]=_[_0xd4de('0x2c')](_0x3615b8,_0xd4de('0x29'));_0x17f0a['query']=_[_0xd4de('0x30')](_0x4fa53a[_0xd4de('0x31')]);_0x17f0a['filters']=_[_0xd4de('0x32')](_0x17f0a[_0xd4de('0x2f')],_0x17f0a['query']);_0x36f2f1['attributes']=_[_0xd4de('0x32')](_0x17f0a[_0xd4de('0x2f')],qs[_0xd4de('0x33')](_0x4fa53a[_0xd4de('0x31')]['fields']));_0x36f2f1[_0xd4de('0x34')]=_0x36f2f1[_0xd4de('0x34')]['length']?_0x36f2f1[_0xd4de('0x34')]:_0x17f0a[_0xd4de('0x2f')];if(!_0x4fa53a[_0xd4de('0x31')][_0xd4de('0x35')](_0xd4de('0x36'))){_0x36f2f1[_0xd4de('0x37')]=qs['limit'](_0x4fa53a['query'][_0xd4de('0x37')]);_0x36f2f1[_0xd4de('0x1d')]=qs[_0xd4de('0x1d')](_0x4fa53a['query'][_0xd4de('0x1d')]);}_0x36f2f1[_0xd4de('0x38')]=qs['sort'](_0x4fa53a[_0xd4de('0x31')][_0xd4de('0x39')]);_0x36f2f1[_0xd4de('0x3a')]=qs[_0xd4de('0x3b')](_['pick'](_0x4fa53a['query'],_0x17f0a[_0xd4de('0x3b')]),_0x3615b8);if(_0x4fa53a['query'][_0xd4de('0x3c')]){_0x36f2f1['where']=_[_0xd4de('0x3d')](_0x36f2f1[_0xd4de('0x3a')],{'$or':_[_0xd4de('0x2c')](_0x3615b8,function(_0x1e1937){if(_0x1e1937['type']!==_0xd4de('0x3e')){var _0x4bd6ed={};_0x4bd6ed[_0x1e1937[_0xd4de('0x29')]]={'$like':'%'+_0x4fa53a[_0xd4de('0x31')][_0xd4de('0x3c')]+'%'};return _0x4bd6ed;}})});}_0x36f2f1=_[_0xd4de('0x3d')]({},_0x36f2f1,_0x4fa53a[_0xd4de('0x3f')]);var _0x13c256={'where':_0x36f2f1[_0xd4de('0x3a')]};return db['AnalyticExtractedReport'][_0xd4de('0x1c')](_0x13c256)[_0xd4de('0x23')](function(_0x3cc600){_0x50cb73[_0xd4de('0x1c')]=_0x3cc600;if(_0x4fa53a[_0xd4de('0x31')]['includeAll']){_0x36f2f1[_0xd4de('0x40')]=[{'all':!![]}];}return db[_0xd4de('0x41')][_0xd4de('0x42')](_0x36f2f1);})['then'](function(_0x3eaa14){_0x50cb73[_0xd4de('0x43')]=_0x3eaa14;return _0x50cb73;})[_0xd4de('0x23')](respondWithFilteredResult(_0xd4de93,_0x36f2f1))['catch'](handleError(_0xd4de93,null));};exports[_0xd4de('0x44')]=function(_0x10a42c,_0x419c49){var _0x3f1e22={'raw':!![],'where':{'id':_0x10a42c[_0xd4de('0x45')]['id']}},_0x3267bd={};_0x3267bd[_0xd4de('0x2f')]=_['keys'](db[_0xd4de('0x41')][_0xd4de('0x46')]);_0x3267bd[_0xd4de('0x31')]=_['keys'](_0x10a42c[_0xd4de('0x31')]);_0x3267bd[_0xd4de('0x3b')]=_[_0xd4de('0x32')](_0x3267bd['model'],_0x3267bd['query']);_0x3f1e22[_0xd4de('0x34')]=_[_0xd4de('0x32')](_0x3267bd['model'],qs[_0xd4de('0x33')](_0x10a42c[_0xd4de('0x31')][_0xd4de('0x33')]));_0x3f1e22[_0xd4de('0x34')]=_0x3f1e22['attributes'][_0xd4de('0x47')]?_0x3f1e22[_0xd4de('0x34')]:_0x3267bd[_0xd4de('0x2f')];if(_0x10a42c[_0xd4de('0x31')][_0xd4de('0x48')]){_0x3f1e22[_0xd4de('0x40')]=[{'all':!![]}];}_0x3f1e22=_['merge']({},_0x3f1e22,_0x10a42c[_0xd4de('0x3f')]);return db[_0xd4de('0x41')][_0xd4de('0x49')](_0x3f1e22)[_0xd4de('0x23')](handleEntityNotFound(_0x419c49,null))[_0xd4de('0x23')](respondWithResult(_0x419c49,null))[_0xd4de('0x4a')](handleError(_0x419c49,null));};exports[_0xd4de('0x4b')]=function(_0x425a7e,_0xaf442c){return db[_0xd4de('0x41')]['create'](_0x425a7e[_0xd4de('0x4c')],{})[_0xd4de('0x23')](function(_0x178daf){var _0x518bfe=_0x425a7e[_0xd4de('0x4d')][_0xd4de('0x25')]({'plain':!![]});if(!_0x518bfe)throw new Error(_0xd4de('0x4e'));if(_0x518bfe[_0xd4de('0x4f')]===_0xd4de('0x4d')){var _0xa24bb7=_0x178daf[_0xd4de('0x25')]({'plain':!![]});var _0x29cb16=_0xd4de('0x26');return db[_0xd4de('0x50')]['find']({'where':{'name':_0x29cb16,'userProfileId':_0x518bfe[_0xd4de('0x51')]},'raw':!![]})[_0xd4de('0x23')](function(_0x215f85){if(_0x215f85&&_0x215f85[_0xd4de('0x52')]===0x0){return db[_0xd4de('0x27')]['create']({'name':_0xa24bb7['name'],'resourceId':_0xa24bb7['id'],'type':_0x215f85[_0xd4de('0x29')],'sectionId':_0x215f85['id']},{})[_0xd4de('0x23')](function(){return _0x178daf;});}else{return _0x178daf;}})['catch'](function(_0x48cb7d){logger[_0xd4de('0x28')](_0xd4de('0x53'),_0x48cb7d);throw _0x48cb7d;});}return _0x178daf;})[_0xd4de('0x23')](respondWithResult(_0xaf442c,0xc9))[_0xd4de('0x4a')](handleError(_0xaf442c,null));};exports[_0xd4de('0x22')]=function(_0x15c8cd,_0x4177a9){if(_0x15c8cd[_0xd4de('0x4c')]['id']){delete _0x15c8cd[_0xd4de('0x4c')]['id'];}return db[_0xd4de('0x41')][_0xd4de('0x49')]({'where':{'id':_0x15c8cd[_0xd4de('0x45')]['id']}})['then'](handleEntityNotFound(_0x4177a9,null))[_0xd4de('0x23')](saveUpdates(_0x15c8cd[_0xd4de('0x4c')],null))[_0xd4de('0x23')](respondWithResult(_0x4177a9,null))[_0xd4de('0x4a')](handleError(_0x4177a9,null));};exports[_0xd4de('0x24')]=function(_0x176025,_0x53be94){return db[_0xd4de('0x41')]['find']({'where':{'id':_0x176025['params']['id']}})[_0xd4de('0x23')](handleEntityNotFound(_0x53be94,null))[_0xd4de('0x23')](removeEntity(_0x53be94,null))[_0xd4de('0x4a')](handleError(_0x53be94,null));};exports[_0xd4de('0x54')]=function(_0x4e533c,_0xfc79e7,_0x3d62c2){return db[_0xd4de('0x41')][_0xd4de('0x49')]({'where':{'id':_0x4e533c[_0xd4de('0x45')]['id']},'attributes':['name','basename','savename',_0xd4de('0x55')],'raw':!![]})[_0xd4de('0x23')](handleEntityNotFound(_0xfc79e7,null))[_0xd4de('0x23')](function(_0x3c5f7a){if(_0x3c5f7a){if(!fs['existsSync'](path[_0xd4de('0x56')](config[_0xd4de('0x57')],_0xd4de('0x58'),_0x3c5f7a[_0xd4de('0x59')]))){throw new db['Sequelize'][(_0xd4de('0x5a'))](_0xd4de('0x5b'));}if(_0x4e533c[_0xd4de('0x31')][_0xd4de('0x5c')]){return _0xfc79e7['sendStatus'](0xc8);}return _0xfc79e7['download'](path['join'](config[_0xd4de('0x57')],_0xd4de('0x58'),_0x3c5f7a[_0xd4de('0x59')]),util['format'](_0xd4de('0x5d'),_0x3c5f7a[_0xd4de('0x5e')]||_0x3c5f7a[_0xd4de('0x29')],_0x3c5f7a['output'][_0xd4de('0x5f')]()));}})['catch'](handleError(_0xfc79e7,null));}; \ No newline at end of file +var _0x1d2d=['map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','sort','where','VIRTUAL','filter','merge','options','include','findAll','rows','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','output','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','update','then','get','ExtractedReports','UserProfileResource','destroy','error','name','send','index'];(function(_0x2b28f4,_0x524546){var _0x3d3557=function(_0x28dc0a){while(--_0x28dc0a){_0x2b28f4['push'](_0x2b28f4['shift']());}};_0x3d3557(++_0x524546);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x2ee8fd,_0x50524a){_0x2ee8fd=_0x2ee8fd-0x0;var _0x14b028=_0x1d2d[_0x2ee8fd];return _0x14b028;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];function respondWithStatusCode(_0x33f088,_0x129d8f){_0x129d8f=_0x129d8f||0xcc;return function(_0xc3ee82){if(_0xc3ee82){return _0x33f088[_0xd1d2('0x1b')](_0x129d8f);}return _0x33f088[_0xd1d2('0x1c')](_0x129d8f)[_0xd1d2('0x1d')]();};}function respondWithResult(_0x3f670f,_0x4cf702){_0x4cf702=_0x4cf702||0xc8;return function(_0x2e7fec){if(_0x2e7fec){return _0x3f670f[_0xd1d2('0x1c')](_0x4cf702)[_0xd1d2('0x1e')](_0x2e7fec);}};}function respondWithFilteredResult(_0x56de25,_0x35381b){return function(_0xc36ce){if(_0xc36ce){var _0x208425=_0xc36ce[_0xd1d2('0x1f')],_0x2f4cf9=_0x35381b['offset'],_0xecac1f=_0x35381b['offset']+_0x35381b[_0xd1d2('0x20')],_0x2723b3;if(_0xecac1f>=_0x208425){_0xecac1f=_0x208425;_0x2723b3=0xc8;}else{_0x2723b3=0xce;}_0x56de25['status'](_0x2723b3);return _0x56de25[_0xd1d2('0x21')](_0xd1d2('0x22'),_0x2f4cf9+'-'+_0xecac1f+'/'+_0x208425)[_0xd1d2('0x1e')](_0xc36ce);}return null;};}function patchUpdates(_0x40d3dd){return function(_0x4ab386){try{jsonpatch['apply'](_0x4ab386,_0x40d3dd,!![]);}catch(_0xb43456){return BPromise['reject'](_0xb43456);}return _0x4ab386['save']();};}function saveUpdates(_0x1ab67c,_0x27e26b){return function(_0x3414ce){if(_0x3414ce){return _0x3414ce[_0xd1d2('0x23')](_0x1ab67c)['then'](function(_0x1cacad){return _0x1cacad;});}return null;};}function removeEntity(_0xbb4d27,_0x24b8db){return function(_0x4eb082){if(_0x4eb082){return _0x4eb082['destroy']()[_0xd1d2('0x24')](function(){var _0x3a1078=_0x4eb082[_0xd1d2('0x25')]({'plain':!![]});var _0x2f92ee=_0xd1d2('0x26');return db[_0xd1d2('0x27')][_0xd1d2('0x28')]({'where':{'type':_0x2f92ee,'resourceId':_0x3a1078['id']}})['then'](function(){return _0x4eb082;});})[_0xd1d2('0x24')](function(){_0xbb4d27[_0xd1d2('0x1c')](0xcc)[_0xd1d2('0x1d')]();});}};}function handleEntityNotFound(_0x2e1709,_0x5d3ee1){return function(_0x39e991){if(!_0x39e991){_0x2e1709[_0xd1d2('0x1b')](0x194);}return _0x39e991;};}function handleError(_0x34faf7,_0xe6ef3c){_0xe6ef3c=_0xe6ef3c||0x1f4;return function(_0x384460){logger[_0xd1d2('0x29')](_0x384460['stack']);if(_0x384460['name']){delete _0x384460[_0xd1d2('0x2a')];}_0x34faf7[_0xd1d2('0x1c')](_0xe6ef3c)[_0xd1d2('0x2b')](_0x384460);};}exports[_0xd1d2('0x2c')]=function(_0xc815ea,_0x48ade1){var _0x39d694={},_0x41171c={},_0x383947={'count':0x0,'rows':[]};var _0x4b4134=_[_0xd1d2('0x2d')](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')],function(_0x56557d){return{'name':_0x56557d[_0xd1d2('0x30')],'type':_0x56557d[_0xd1d2('0x31')][_0xd1d2('0x32')]};});_0x41171c[_0xd1d2('0x33')]=_[_0xd1d2('0x2d')](_0x4b4134,_0xd1d2('0x2a'));_0x41171c[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0xc815ea[_0xd1d2('0x34')]);_0x41171c[_0xd1d2('0x36')]=_[_0xd1d2('0x37')](_0x41171c[_0xd1d2('0x33')],_0x41171c[_0xd1d2('0x34')]);_0x39d694[_0xd1d2('0x38')]=_[_0xd1d2('0x37')](_0x41171c[_0xd1d2('0x33')],qs[_0xd1d2('0x39')](_0xc815ea[_0xd1d2('0x34')]['fields']));_0x39d694[_0xd1d2('0x38')]=_0x39d694[_0xd1d2('0x38')][_0xd1d2('0x3a')]?_0x39d694['attributes']:_0x41171c[_0xd1d2('0x33')];if(!_0xc815ea['query']['hasOwnProperty'](_0xd1d2('0x3b'))){_0x39d694[_0xd1d2('0x20')]=qs[_0xd1d2('0x20')](_0xc815ea[_0xd1d2('0x34')][_0xd1d2('0x20')]);_0x39d694[_0xd1d2('0x3c')]=qs['offset'](_0xc815ea[_0xd1d2('0x34')][_0xd1d2('0x3c')]);}_0x39d694['order']=qs[_0xd1d2('0x3d')](_0xc815ea[_0xd1d2('0x34')][_0xd1d2('0x3d')]);_0x39d694[_0xd1d2('0x3e')]=qs['filters'](_['pick'](_0xc815ea[_0xd1d2('0x34')],_0x41171c['filters']),_0x4b4134);if(_0xc815ea['query']['filter']){_0x39d694[_0xd1d2('0x3e')]=_['merge'](_0x39d694[_0xd1d2('0x3e')],{'$or':_['map'](_0x4b4134,function(_0x47996a){if(_0x47996a['type']!==_0xd1d2('0x3f')){var _0x3bf13c={};_0x3bf13c[_0x47996a[_0xd1d2('0x2a')]]={'$like':'%'+_0xc815ea[_0xd1d2('0x34')][_0xd1d2('0x40')]+'%'};return _0x3bf13c;}})});}_0x39d694=_[_0xd1d2('0x41')]({},_0x39d694,_0xc815ea[_0xd1d2('0x42')]);var _0x38bf16={'where':_0x39d694[_0xd1d2('0x3e')]};return db[_0xd1d2('0x2e')][_0xd1d2('0x1f')](_0x38bf16)[_0xd1d2('0x24')](function(_0x1c2835){_0x383947[_0xd1d2('0x1f')]=_0x1c2835;if(_0xc815ea['query']['includeAll']){_0x39d694[_0xd1d2('0x43')]=[{'all':!![]}];}return db[_0xd1d2('0x2e')][_0xd1d2('0x44')](_0x39d694);})['then'](function(_0x4f70c1){_0x383947[_0xd1d2('0x45')]=_0x4f70c1;return _0x383947;})[_0xd1d2('0x24')](respondWithFilteredResult(_0x48ade1,_0x39d694))['catch'](handleError(_0x48ade1,null));};exports[_0xd1d2('0x46')]=function(_0x4c5d49,_0x5a3790){var _0x21eb24={'raw':!![],'where':{'id':_0x4c5d49['params']['id']}},_0x5114df={};_0x5114df[_0xd1d2('0x33')]=_[_0xd1d2('0x35')](db[_0xd1d2('0x2e')]['rawAttributes']);_0x5114df[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x4c5d49[_0xd1d2('0x34')]);_0x5114df[_0xd1d2('0x36')]=_['intersection'](_0x5114df[_0xd1d2('0x33')],_0x5114df[_0xd1d2('0x34')]);_0x21eb24['attributes']=_[_0xd1d2('0x37')](_0x5114df['model'],qs[_0xd1d2('0x39')](_0x4c5d49[_0xd1d2('0x34')][_0xd1d2('0x39')]));_0x21eb24[_0xd1d2('0x38')]=_0x21eb24[_0xd1d2('0x38')]['length']?_0x21eb24['attributes']:_0x5114df[_0xd1d2('0x33')];if(_0x4c5d49[_0xd1d2('0x34')]['includeAll']){_0x21eb24[_0xd1d2('0x43')]=[{'all':!![]}];}_0x21eb24=_[_0xd1d2('0x41')]({},_0x21eb24,_0x4c5d49[_0xd1d2('0x42')]);return db[_0xd1d2('0x2e')][_0xd1d2('0x47')](_0x21eb24)[_0xd1d2('0x24')](handleEntityNotFound(_0x5a3790,null))[_0xd1d2('0x24')](respondWithResult(_0x5a3790,null))['catch'](handleError(_0x5a3790,null));};exports[_0xd1d2('0x48')]=function(_0xc10c10,_0x5594f5){return db[_0xd1d2('0x2e')][_0xd1d2('0x48')](_0xc10c10['body'],{})['then'](function(_0x3d4fe3){var _0x182ea8=_0xc10c10['user'][_0xd1d2('0x25')]({'plain':!![]});if(!_0x182ea8)throw new Error(_0xd1d2('0x49'));if(_0x182ea8[_0xd1d2('0x4a')]===_0xd1d2('0x4b')){var _0x404ad2=_0x3d4fe3['get']({'plain':!![]});var _0x4dd22e=_0xd1d2('0x26');return db['UserProfileSection'][_0xd1d2('0x47')]({'where':{'name':_0x4dd22e,'userProfileId':_0x182ea8[_0xd1d2('0x4c')]},'raw':!![]})['then'](function(_0x389fcb){if(_0x389fcb&&_0x389fcb[_0xd1d2('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x404ad2[_0xd1d2('0x2a')],'resourceId':_0x404ad2['id'],'type':_0x389fcb[_0xd1d2('0x2a')],'sectionId':_0x389fcb['id']},{})[_0xd1d2('0x24')](function(){return _0x3d4fe3;});}else{return _0x3d4fe3;}})[_0xd1d2('0x4e')](function(_0xa013ce){logger[_0xd1d2('0x29')](_0xd1d2('0x4f'),_0xa013ce);throw _0xa013ce;});}return _0x3d4fe3;})[_0xd1d2('0x24')](respondWithResult(_0x5594f5,0xc9))[_0xd1d2('0x4e')](handleError(_0x5594f5,null));};exports['update']=function(_0x1958f3,_0x530db0){if(_0x1958f3['body']['id']){delete _0x1958f3[_0xd1d2('0x50')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x47')]({'where':{'id':_0x1958f3[_0xd1d2('0x51')]['id']}})[_0xd1d2('0x24')](handleEntityNotFound(_0x530db0,null))[_0xd1d2('0x24')](saveUpdates(_0x1958f3[_0xd1d2('0x50')],null))[_0xd1d2('0x24')](respondWithResult(_0x530db0,null))[_0xd1d2('0x4e')](handleError(_0x530db0,null));};exports[_0xd1d2('0x28')]=function(_0x28173a,_0x14ba8d){return db[_0xd1d2('0x2e')]['find']({'where':{'id':_0x28173a['params']['id']}})[_0xd1d2('0x24')](handleEntityNotFound(_0x14ba8d,null))[_0xd1d2('0x24')](removeEntity(_0x14ba8d,null))[_0xd1d2('0x4e')](handleError(_0x14ba8d,null));};exports[_0xd1d2('0x52')]=function(_0x344b6f,_0x1d1d31,_0x306e2b){return db[_0xd1d2('0x2e')][_0xd1d2('0x47')]({'where':{'id':_0x344b6f[_0xd1d2('0x51')]['id']},'attributes':[_0xd1d2('0x2a'),'basename','savename',_0xd1d2('0x53')],'raw':!![]})[_0xd1d2('0x24')](handleEntityNotFound(_0x1d1d31,null))[_0xd1d2('0x24')](function(_0x1c6a46){if(_0x1c6a46){if(!fs['existsSync'](path[_0xd1d2('0x54')](config[_0xd1d2('0x55')],_0xd1d2('0x56'),_0x1c6a46[_0xd1d2('0x57')]))){throw new db[(_0xd1d2('0x58'))][(_0xd1d2('0x59'))](_0xd1d2('0x5a'));}if(_0x344b6f['query'][_0xd1d2('0x5b')]){return _0x1d1d31[_0xd1d2('0x1b')](0xc8);}return _0x1d1d31[_0xd1d2('0x52')](path['join'](config['root'],_0xd1d2('0x56'),_0x1c6a46[_0xd1d2('0x57')]),util[_0xd1d2('0x5c')](_0xd1d2('0x5d'),_0x1c6a46['basename']||_0x1c6a46[_0xd1d2('0x2a')],_0x1c6a46[_0xd1d2('0x53')][_0xd1d2('0x5e')]()));}})['catch'](handleError(_0x1d1d31,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index ea74407..b517efc 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 _0xcd22=['./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3666e4,_0x2f4448){var _0x304ae9=function(_0x23e7fd){while(--_0x23e7fd){_0x3666e4['push'](_0x3666e4['shift']());}};_0x304ae9(++_0x2f4448);}(_0xcd22,0x162));var _0x2cd2=function(_0x4cfa2e,_0x5752b5){_0x4cfa2e=_0x4cfa2e-0x0;var _0x279b50=_0xcd22[_0x4cfa2e];return _0x279b50;};'use strict';var _=require(_0x2cd2('0x0'));var util=require(_0x2cd2('0x1'));var logger=require(_0x2cd2('0x2'))(_0x2cd2('0x3'));var moment=require(_0x2cd2('0x4'));var BPromise=require(_0x2cd2('0x5'));var rp=require(_0x2cd2('0x6'));var fs=require('fs');var path=require(_0x2cd2('0x7'));var rimraf=require(_0x2cd2('0x8'));var config=require(_0x2cd2('0x9'));var attributes=require(_0x2cd2('0xa'));module['exports']=function(_0x533d34,_0xa466b2){return _0x533d34[_0x2cd2('0xb')](_0x2cd2('0xc'),attributes,{'tableName':_0x2cd2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5782=['rimraf','./analyticExtractedReport.attributes','exports','analytics_extracted_reports','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1ddc47,_0x27b667){var _0x2241cd=function(_0x4dfcc8){while(--_0x4dfcc8){_0x1ddc47['push'](_0x1ddc47['shift']());}};_0x2241cd(++_0x27b667);}(_0x5782,0x8b));var _0x2578=function(_0x1cf987,_0x51a548){_0x1cf987=_0x1cf987-0x0;var _0x87ab90=_0x5782[_0x1cf987];return _0x87ab90;};'use strict';var _=require('lodash');var util=require(_0x2578('0x0'));var logger=require(_0x2578('0x1'))('api');var moment=require(_0x2578('0x2'));var BPromise=require(_0x2578('0x3'));var rp=require(_0x2578('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2578('0x5'));var config=require('../../config/environment');var attributes=require(_0x2578('0x6'));module[_0x2578('0x7')]=function(_0x3aa38b,_0x5275d9){return _0x3aa38b['define']('AnalyticExtractedReport',attributes,{'tableName':_0x2578('0x8'),'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 4dfa9b5..dfdcad5 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 _0x550e=['error','code','message','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x24602f,_0x35d18d){var _0x5528ef=function(_0x5561a4){while(--_0x5561a4){_0x24602f['push'](_0x24602f['shift']());}};_0x5528ef(++_0x35d18d);}(_0x550e,0x88));var _0xe550=function(_0x4720ab,_0x49c0ae){_0x4720ab=_0x4720ab-0x0;var _0x5c2cad=_0x550e[_0x4720ab];return _0x5c2cad;};'use strict';var _=require(_0xe550('0x0'));var util=require(_0xe550('0x1'));var moment=require(_0xe550('0x2'));var BPromise=require('bluebird');var rs=require(_0xe550('0x3'));var fs=require('fs');var Redis=require(_0xe550('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe550('0x5'))(_0xe550('0x6'));var config=require(_0xe550('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe550('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x308c21,_0x11f5b9,_0x5a8ed5){return new BPromise(function(_0x3d3244,_0x3d3255){return client[_0xe550('0x9')](_0x308c21,_0x5a8ed5)[_0xe550('0xa')](function(_0x1c35bd){logger[_0xe550('0xb')](_0xe550('0xc'),_0x11f5b9,_0xe550('0xd'));logger[_0xe550('0xe')](_0xe550('0xf'),_0x11f5b9,_0xe550('0xd'),JSON['stringify'](_0x1c35bd));if(_0x1c35bd[_0xe550('0x10')]){if(_0x1c35bd[_0xe550('0x10')][_0xe550('0x11')]===0x1f4){logger['error'](_0xe550('0xc'),_0x11f5b9,_0x1c35bd[_0xe550('0x10')][_0xe550('0x12')]);return _0x3d3255(_0x1c35bd[_0xe550('0x10')]['message']);}logger[_0xe550('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x11f5b9,_0x1c35bd[_0xe550('0x10')][_0xe550('0x12')]);return _0x3d3244(_0x1c35bd[_0xe550('0x10')][_0xe550('0x12')]);}else{logger[_0xe550('0xb')](_0xe550('0xc'),_0x11f5b9,'request\x20sent');_0x3d3244(_0x1c35bd['result'][_0xe550('0x12')]);}})['catch'](function(_0x27bc0f){logger[_0xe550('0x10')](_0xe550('0xc'),_0x11f5b9,_0x27bc0f);_0x3d3255(_0x27bc0f);});});} \ No newline at end of file +var _0x86d4=['message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x23eca8,_0x16c391){var _0x51fbac=function(_0x28ade4){while(--_0x28ade4){_0x23eca8['push'](_0x23eca8['shift']());}};_0x51fbac(++_0x16c391);}(_0x86d4,0x10c));var _0x486d=function(_0x15d48f,_0x2039b2){_0x15d48f=_0x15d48f-0x0;var _0x4fb30c=_0x86d4[_0x15d48f];return _0x4fb30c;};'use strict';var _=require('lodash');var util=require(_0x486d('0x0'));var moment=require('moment');var BPromise=require(_0x486d('0x1'));var rs=require(_0x486d('0x2'));var fs=require('fs');var Redis=require(_0x486d('0x3'));var db=require(_0x486d('0x4'))['db'];var utils=require(_0x486d('0x5'));var logger=require(_0x486d('0x6'))(_0x486d('0x7'));var config=require(_0x486d('0x8'));var jayson=require(_0x486d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x118db5,_0x39aacf,_0x297399){return new BPromise(function(_0x540db8,_0x34340a){return client['request'](_0x118db5,_0x297399)[_0x486d('0xa')](function(_0x425bc4){logger[_0x486d('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x39aacf,'request\x20sent');logger[_0x486d('0xc')](_0x486d('0xd'),_0x39aacf,_0x486d('0xe'),JSON[_0x486d('0xf')](_0x425bc4));if(_0x425bc4[_0x486d('0x10')]){if(_0x425bc4[_0x486d('0x10')][_0x486d('0x11')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x39aacf,_0x425bc4['error'][_0x486d('0x12')]);return _0x34340a(_0x425bc4[_0x486d('0x10')][_0x486d('0x12')]);}logger[_0x486d('0x10')](_0x486d('0x13'),_0x39aacf,_0x425bc4[_0x486d('0x10')][_0x486d('0x12')]);return _0x540db8(_0x425bc4[_0x486d('0x10')][_0x486d('0x12')]);}else{logger[_0x486d('0xb')](_0x486d('0x13'),_0x39aacf,'request\x20sent');_0x540db8(_0x425bc4[_0x486d('0x14')][_0x486d('0x12')]);}})[_0x486d('0x15')](function(_0x21f9f5){logger[_0x486d('0x10')](_0x486d('0x13'),_0x39aacf,_0x21f9f5);_0x34340a(_0x21f9f5);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 260a082..6287200 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 _0x2416=['create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download'];(function(_0x290967,_0x172639){var _0x500fa4=function(_0x5b4bd3){while(--_0x5b4bd3){_0x290967['push'](_0x290967['shift']());}};_0x500fa4(++_0x172639);}(_0x2416,0x17f));var _0x6241=function(_0x202cc8,_0x46902d){_0x202cc8=_0x202cc8-0x0;var _0x4622f6=_0x2416[_0x202cc8];return _0x4622f6;};'use strict';var multer=require('multer');var util=require(_0x6241('0x0'));var path=require(_0x6241('0x1'));var timeout=require(_0x6241('0x2'));var express=require(_0x6241('0x3'));var router=express[_0x6241('0x4')]();var fs_extra=require(_0x6241('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6241('0x6'));var config=require(_0x6241('0x7'));var controller=require(_0x6241('0x8'));router[_0x6241('0x9')]('/',auth[_0x6241('0xa')](),controller['index']);router[_0x6241('0x9')](_0x6241('0xb'),auth[_0x6241('0xa')](),controller['show']);router[_0x6241('0x9')](_0x6241('0xc'),auth[_0x6241('0xa')](),controller['download']);router['post']('/',auth[_0x6241('0xa')](),controller[_0x6241('0xd')]);router[_0x6241('0xe')](_0x6241('0xb'),auth[_0x6241('0xa')](),controller[_0x6241('0xf')]);router[_0x6241('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6241('0x11')]=router; \ No newline at end of file +var _0xfb8d=['../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy','exports','multer','connect-timeout','Router'];(function(_0x147ff7,_0x449ed6){var _0x39d203=function(_0x59b84f){while(--_0x59b84f){_0x147ff7['push'](_0x147ff7['shift']());}};_0x39d203(++_0x449ed6);}(_0xfb8d,0xc9));var _0xdfb8=function(_0x4238d7,_0x15b20b){_0x4238d7=_0x4238d7-0x0;var _0x284414=_0xfb8d[_0x4238d7];return _0x284414;};'use strict';var multer=require(_0xdfb8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdfb8('0x1'));var express=require('express');var router=express[_0xdfb8('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdfb8('0x3'));var interaction=require(_0xdfb8('0x4'));var config=require('../../config/environment');var controller=require(_0xdfb8('0x5'));router['get']('/',auth[_0xdfb8('0x6')](),controller[_0xdfb8('0x7')]);router[_0xdfb8('0x8')](_0xdfb8('0x9'),auth[_0xdfb8('0x6')](),controller[_0xdfb8('0xa')]);router['get']('/:id/download',auth[_0xdfb8('0x6')](),controller['download']);router[_0xdfb8('0xb')]('/',auth[_0xdfb8('0x6')](),controller[_0xdfb8('0xc')]);router['put'](_0xdfb8('0x9'),auth[_0xdfb8('0x6')](),controller[_0xdfb8('0xd')]);router[_0xdfb8('0xe')](_0xdfb8('0x9'),auth['isAuthenticated'](),controller[_0xdfb8('0xf')]);module[_0xdfb8('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 43be2dc..c3c0a56 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 _0x7217=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x51be75,_0x5439a5){var _0x5b2f04=function(_0x2cb1ad){while(--_0x2cb1ad){_0x51be75['push'](_0x51be75['shift']());}};_0x5b2f04(++_0x5439a5);}(_0x7217,0x19e));var _0x7721=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x7217[_0x9aada2];return _0x196dff;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'field':{'type':Sequelize[_0x7721('0x1')]},'alias':{'type':Sequelize[_0x7721('0x2')]},'function':{'type':Sequelize[_0x7721('0x2')]},'format':{'type':Sequelize[_0x7721('0x2')]},'groupBy':{'type':Sequelize[_0x7721('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x1a209f,_0x1b35e6){var _0x376b56=function(_0x5ed729){while(--_0x5ed729){_0x1a209f['push'](_0x1a209f['shift']());}};_0x376b56(++_0x1b35e6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 01d6735..b5ed2ed 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 _0xa571=['hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','rows','catch','find','create','body','bulkCreate','update','params','bulkDestroy','addFields','AnalyticCustomReport','findOne','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','destroy','then','end','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length'];(function(_0x2a322e,_0x512002){var _0x35da00=function(_0x370fab){while(--_0x370fab){_0x2a322e['push'](_0x2a322e['shift']());}};_0x35da00(++_0x512002);}(_0xa571,0x107));var _0x1a57=function(_0x2f0ee7,_0x47a6cf){_0x2f0ee7=_0x2f0ee7-0x0;var _0x56e5a6=_0xa571[_0x2f0ee7];return _0x56e5a6;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=_0x20f7ad[_0x1a57('0x1b')],_0x49ee05=_0x5802d6['offset'],_0x1b58d7=_0x5802d6[_0x1a57('0x1c')]+_0x5802d6[_0x1a57('0x1d')],_0x1c537f;if(_0x1b58d7>=_0x53c61f){_0x1b58d7=_0x53c61f;_0x1c537f=0xc8;}else{_0x1c537f=0xce;}_0x153d01[_0x1a57('0x19')](_0x1c537f);return _0x153d01['set'](_0x1a57('0x1e'),_0x49ee05+'-'+_0x1b58d7+'/'+_0x53c61f)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x451b34){return function(_0xcba6b7){try{jsonpatch[_0x1a57('0x1f')](_0xcba6b7,_0x451b34,!![]);}catch(_0x52bc9e){return BPromise['reject'](_0x52bc9e);}return _0xcba6b7[_0x1a57('0x20')]();};}function saveUpdates(_0x21e811,_0x211c63){return function(_0x4d3e05){if(_0x4d3e05){return _0x4d3e05['update'](_0x21e811)['then'](function(_0x154cf3){return _0x154cf3;});}return null;};}function removeEntity(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x21')]()[_0x1a57('0x22')](function(){_0x113ad4[_0x1a57('0x19')](0xcc)[_0x1a57('0x23')]();});}};}function handleEntityNotFound(_0x183ca3,_0x35d5dc){return function(_0x29e7cd){if(!_0x29e7cd){_0x183ca3[_0x1a57('0x18')](0x194);}return _0x29e7cd;};}function handleError(_0x26cdd3,_0x1b4cb5){_0x1b4cb5=_0x1b4cb5||0x1f4;return function(_0x2f9454){logger[_0x1a57('0x24')](_0x2f9454[_0x1a57('0x25')]);if(_0x2f9454[_0x1a57('0x26')]){delete _0x2f9454[_0x1a57('0x26')];}_0x26cdd3[_0x1a57('0x19')](_0x1b4cb5)[_0x1a57('0x27')](_0x2f9454);};}exports[_0x1a57('0x28')]=function(_0x5a53c8,_0x530401){var _0x139d8c={},_0x22549f={},_0x545041={'count':0x0,'rows':[]};var _0x46dac6=_['map'](db[_0x1a57('0x29')][_0x1a57('0x2a')],function(_0x53bf6e){return{'name':_0x53bf6e[_0x1a57('0x2b')],'type':_0x53bf6e[_0x1a57('0x2c')][_0x1a57('0x2d')]};});_0x22549f[_0x1a57('0x2e')]=_['map'](_0x46dac6,_0x1a57('0x26'));_0x22549f[_0x1a57('0x2f')]=_[_0x1a57('0x30')](_0x5a53c8[_0x1a57('0x2f')]);_0x22549f['filters']=_[_0x1a57('0x31')](_0x22549f[_0x1a57('0x2e')],_0x22549f[_0x1a57('0x2f')]);_0x139d8c[_0x1a57('0x32')]=_[_0x1a57('0x31')](_0x22549f[_0x1a57('0x2e')],qs[_0x1a57('0x33')](_0x5a53c8[_0x1a57('0x2f')][_0x1a57('0x33')]));_0x139d8c['attributes']=_0x139d8c[_0x1a57('0x32')][_0x1a57('0x34')]?_0x139d8c['attributes']:_0x22549f['model'];if(!_0x5a53c8[_0x1a57('0x2f')][_0x1a57('0x35')](_0x1a57('0x36'))){_0x139d8c[_0x1a57('0x1d')]=qs[_0x1a57('0x1d')](_0x5a53c8[_0x1a57('0x2f')][_0x1a57('0x1d')]);_0x139d8c[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x5a53c8[_0x1a57('0x2f')][_0x1a57('0x1c')]);}_0x139d8c[_0x1a57('0x37')]=qs[_0x1a57('0x38')](_0x5a53c8[_0x1a57('0x2f')][_0x1a57('0x38')]);_0x139d8c[_0x1a57('0x39')]=qs[_0x1a57('0x3a')](_[_0x1a57('0x3b')](_0x5a53c8['query'],_0x22549f[_0x1a57('0x3a')]),_0x46dac6);if(_0x5a53c8[_0x1a57('0x2f')][_0x1a57('0x3c')]){_0x139d8c[_0x1a57('0x39')]=_[_0x1a57('0x3d')](_0x139d8c[_0x1a57('0x39')],{'$or':_[_0x1a57('0x3e')](_0x46dac6,function(_0x23d087){if(_0x23d087[_0x1a57('0x2c')]!=='VIRTUAL'){var _0x4c37af={};_0x4c37af[_0x23d087['name']]={'$like':'%'+_0x5a53c8['query'][_0x1a57('0x3c')]+'%'};return _0x4c37af;}})});}_0x139d8c=_[_0x1a57('0x3d')]({},_0x139d8c,_0x5a53c8[_0x1a57('0x3f')]);var _0x4d6e1e={'where':_0x139d8c[_0x1a57('0x39')]};return db[_0x1a57('0x29')][_0x1a57('0x1b')](_0x4d6e1e)[_0x1a57('0x22')](function(_0x5bf186){_0x545041[_0x1a57('0x1b')]=_0x5bf186;if(_0x5a53c8['query'][_0x1a57('0x40')]){_0x139d8c[_0x1a57('0x41')]=[{'all':!![]}];}return db[_0x1a57('0x29')]['findAll'](_0x139d8c);})[_0x1a57('0x22')](function(_0x9d6331){_0x545041[_0x1a57('0x42')]=_0x9d6331;return _0x545041;})[_0x1a57('0x22')](respondWithFilteredResult(_0x530401,_0x139d8c))[_0x1a57('0x43')](handleError(_0x530401,null));};exports['show']=function(_0x2eeb71,_0x47e998){var _0x4ba6b3={'raw':![],'where':{'id':_0x2eeb71['params']['id']}},_0x135e81={};_0x135e81[_0x1a57('0x2e')]=_[_0x1a57('0x30')](db[_0x1a57('0x29')]['rawAttributes']);_0x135e81[_0x1a57('0x2f')]=_[_0x1a57('0x30')](_0x2eeb71[_0x1a57('0x2f')]);_0x135e81[_0x1a57('0x3a')]=_['intersection'](_0x135e81[_0x1a57('0x2e')],_0x135e81[_0x1a57('0x2f')]);_0x4ba6b3['attributes']=_[_0x1a57('0x31')](_0x135e81['model'],qs['fields'](_0x2eeb71[_0x1a57('0x2f')][_0x1a57('0x33')]));_0x4ba6b3[_0x1a57('0x32')]=_0x4ba6b3[_0x1a57('0x32')]['length']?_0x4ba6b3[_0x1a57('0x32')]:_0x135e81[_0x1a57('0x2e')];if(_0x2eeb71[_0x1a57('0x2f')][_0x1a57('0x40')]){_0x4ba6b3[_0x1a57('0x41')]=[{'all':!![]}];}_0x4ba6b3=_['merge']({},_0x4ba6b3,_0x2eeb71[_0x1a57('0x3f')]);return db[_0x1a57('0x29')][_0x1a57('0x44')](_0x4ba6b3)[_0x1a57('0x22')](handleEntityNotFound(_0x47e998,null))['then'](respondWithResult(_0x47e998,null))[_0x1a57('0x43')](handleError(_0x47e998,null));};exports['create']=function(_0x4bbfc3,_0x36f8dc){return db[_0x1a57('0x29')][_0x1a57('0x45')](_0x4bbfc3[_0x1a57('0x46')],{})[_0x1a57('0x22')](respondWithResult(_0x36f8dc,0xc9))[_0x1a57('0x43')](handleError(_0x36f8dc,null));};exports[_0x1a57('0x47')]=function(_0x29fe1f,_0x424065){return db[_0x1a57('0x29')][_0x1a57('0x47')](_0x29fe1f[_0x1a57('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x424065,0xc9))[_0x1a57('0x43')](handleError(_0x424065,null));};exports[_0x1a57('0x48')]=function(_0x3bf103,_0x3b3f1f){if(_0x3bf103[_0x1a57('0x46')]['id']){delete _0x3bf103[_0x1a57('0x46')]['id'];}return db[_0x1a57('0x29')][_0x1a57('0x44')]({'where':{'id':_0x3bf103[_0x1a57('0x49')]['id']}})[_0x1a57('0x22')](handleEntityNotFound(_0x3b3f1f,null))[_0x1a57('0x22')](saveUpdates(_0x3bf103['body'],null))[_0x1a57('0x22')](respondWithResult(_0x3b3f1f,null))[_0x1a57('0x43')](handleError(_0x3b3f1f,null));};exports['destroy']=function(_0x15f1f5,_0x270a33){return db['AnalyticFieldReport'][_0x1a57('0x44')]({'where':{'id':_0x15f1f5[_0x1a57('0x49')]['id']}})['then'](handleEntityNotFound(_0x270a33,null))['then'](removeEntity(_0x270a33,null))['catch'](handleError(_0x270a33,null));};exports[_0x1a57('0x4a')]=function(_0x41465b,_0x509c4f){return db[_0x1a57('0x29')][_0x1a57('0x21')]({'where':{'id':_0x41465b['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x509c4f,0xcc))[_0x1a57('0x43')](handleError(_0x509c4f,null));};exports[_0x1a57('0x4b')]=function(_0x431cf5,_0x31be00,_0x28738e){return db[_0x1a57('0x4c')][_0x1a57('0x4d')]({'where':{'id':_0x431cf5[_0x1a57('0x49')]['id']}})['then'](handleEntityNotFound(_0x31be00,null))['then'](function(_0x48308b){if(_0x48308b){return db['sequelize']['transaction'](function(_0xd0261c){return db[_0x1a57('0x29')][_0x1a57('0x21')]({'where':{'CustomReportId':_0x431cf5[_0x1a57('0x49')]['id']},'transaction':_0xd0261c})[_0x1a57('0x22')](function(_0x2f09e7){var _0xe710e=_[_0x1a57('0x3e')](_0x431cf5['body'],function(_0x48cc13){delete _0x48cc13['id'];_0x48cc13['CustomReportId']=_0x431cf5[_0x1a57('0x49')]['id'];return _0x48cc13;});return db['AnalyticFieldReport'][_0x1a57('0x47')](_0xe710e,{'transaction':_0xd0261c});});})[_0x1a57('0x22')](function(){return db[_0x1a57('0x29')][_0x1a57('0x4e')]({'where':{'CustomReportId':_0x431cf5[_0x1a57('0x49')]['id']}});});}})[_0x1a57('0x22')](respondWithResult(_0x31be00,null))[_0x1a57('0x43')](handleError(_0x31be00,null));}; \ No newline at end of file +var _0x5c00=['apply','reject','destroy','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticFieldReport','catch','show','rawAttributes','length','find','create','body','bulkCreate','update','bulkDestroy','AnalyticCustomReport','findOne','params','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range'];(function(_0x1cb81c,_0x127d94){var _0xf27552=function(_0x399e98){while(--_0x399e98){_0x1cb81c['push'](_0x1cb81c['shift']());}};_0xf27552(++_0x127d94);}(_0x5c00,0x17e));var _0x05c0=function(_0x5d0eb8,_0x40c598){_0x5d0eb8=_0x5d0eb8-0x0;var _0x32d89b=_0x5c00[_0x5d0eb8];return _0x32d89b;};'use strict';var emlformat=require(_0x05c0('0x0'));var rimraf=require(_0x05c0('0x1'));var zipdir=require(_0x05c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05c0('0x3'));var moment=require('moment');var BPromise=require(_0x05c0('0x4'));var Mustache=require(_0x05c0('0x5'));var util=require(_0x05c0('0x6'));var path=require(_0x05c0('0x7'));var sox=require('sox');var csv=require(_0x05c0('0x8'));var ejs=require(_0x05c0('0x9'));var fs=require('fs');var fs_extra=require(_0x05c0('0xa'));var _=require(_0x05c0('0xb'));var squel=require('squel');var crypto=require(_0x05c0('0xc'));var jsforce=require(_0x05c0('0xd'));var deskjs=require(_0x05c0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x05c0('0xf'));var Papa=require(_0x05c0('0x10'));var Redis=require(_0x05c0('0x11'));var authService=require(_0x05c0('0x12'));var qs=require(_0x05c0('0x13'));var as=require(_0x05c0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x05c0('0x15'));var utils=require('../../config/utils');var config=require(_0x05c0('0x16'));var licenseUtil=require(_0x05c0('0x17'));var db=require(_0x05c0('0x18'))['db'];function respondWithStatusCode(_0x5a3e65,_0x4e39d4){_0x4e39d4=_0x4e39d4||0xcc;return function(_0x5eec41){if(_0x5eec41){return _0x5a3e65[_0x05c0('0x19')](_0x4e39d4);}return _0x5a3e65[_0x05c0('0x1a')](_0x4e39d4)[_0x05c0('0x1b')]();};}function respondWithResult(_0x12deeb,_0x25764b){_0x25764b=_0x25764b||0xc8;return function(_0xe57ed0){if(_0xe57ed0){return _0x12deeb[_0x05c0('0x1a')](_0x25764b)[_0x05c0('0x1c')](_0xe57ed0);}};}function respondWithFilteredResult(_0x4c3e54,_0x238e25){return function(_0x161a5f){if(_0x161a5f){var _0x4bb164=_0x161a5f[_0x05c0('0x1d')],_0x29e6b0=_0x238e25[_0x05c0('0x1e')],_0x27c7bd=_0x238e25[_0x05c0('0x1e')]+_0x238e25['limit'],_0x40153e;if(_0x27c7bd>=_0x4bb164){_0x27c7bd=_0x4bb164;_0x40153e=0xc8;}else{_0x40153e=0xce;}_0x4c3e54[_0x05c0('0x1a')](_0x40153e);return _0x4c3e54[_0x05c0('0x1f')](_0x05c0('0x20'),_0x29e6b0+'-'+_0x27c7bd+'/'+_0x4bb164)['json'](_0x161a5f);}return null;};}function patchUpdates(_0x40d905){return function(_0x2023d6){try{jsonpatch[_0x05c0('0x21')](_0x2023d6,_0x40d905,!![]);}catch(_0x23164c){return BPromise[_0x05c0('0x22')](_0x23164c);}return _0x2023d6['save']();};}function saveUpdates(_0x407c1f,_0x1014ef){return function(_0x5313b0){if(_0x5313b0){return _0x5313b0['update'](_0x407c1f)['then'](function(_0x1c448b){return _0x1c448b;});}return null;};}function removeEntity(_0x2055a3,_0x83f29){return function(_0x8e2d4){if(_0x8e2d4){return _0x8e2d4[_0x05c0('0x23')]()[_0x05c0('0x24')](function(){_0x2055a3[_0x05c0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b4930,_0x1abbf3){return function(_0x4ba978){if(!_0x4ba978){_0x9b4930['sendStatus'](0x194);}return _0x4ba978;};}function handleError(_0x4da6d6,_0x5dc2b7){_0x5dc2b7=_0x5dc2b7||0x1f4;return function(_0x56aa78){logger[_0x05c0('0x25')](_0x56aa78[_0x05c0('0x26')]);if(_0x56aa78['name']){delete _0x56aa78[_0x05c0('0x27')];}_0x4da6d6[_0x05c0('0x1a')](_0x5dc2b7)[_0x05c0('0x28')](_0x56aa78);};}exports[_0x05c0('0x29')]=function(_0x58769a,_0x7d5ccd){var _0x1c14b1={},_0x2ceaed={},_0x200e80={'count':0x0,'rows':[]};var _0x216a5c=_[_0x05c0('0x2a')](db['AnalyticFieldReport']['rawAttributes'],function(_0x2df109){return{'name':_0x2df109[_0x05c0('0x2b')],'type':_0x2df109[_0x05c0('0x2c')][_0x05c0('0x2d')]};});_0x2ceaed[_0x05c0('0x2e')]=_[_0x05c0('0x2a')](_0x216a5c,_0x05c0('0x27'));_0x2ceaed[_0x05c0('0x2f')]=_[_0x05c0('0x30')](_0x58769a[_0x05c0('0x2f')]);_0x2ceaed[_0x05c0('0x31')]=_[_0x05c0('0x32')](_0x2ceaed['model'],_0x2ceaed['query']);_0x1c14b1[_0x05c0('0x33')]=_[_0x05c0('0x32')](_0x2ceaed[_0x05c0('0x2e')],qs['fields'](_0x58769a[_0x05c0('0x2f')][_0x05c0('0x34')]));_0x1c14b1['attributes']=_0x1c14b1[_0x05c0('0x33')]['length']?_0x1c14b1[_0x05c0('0x33')]:_0x2ceaed[_0x05c0('0x2e')];if(!_0x58769a[_0x05c0('0x2f')][_0x05c0('0x35')](_0x05c0('0x36'))){_0x1c14b1[_0x05c0('0x37')]=qs[_0x05c0('0x37')](_0x58769a[_0x05c0('0x2f')][_0x05c0('0x37')]);_0x1c14b1[_0x05c0('0x1e')]=qs[_0x05c0('0x1e')](_0x58769a[_0x05c0('0x2f')][_0x05c0('0x1e')]);}_0x1c14b1[_0x05c0('0x38')]=qs[_0x05c0('0x39')](_0x58769a[_0x05c0('0x2f')][_0x05c0('0x39')]);_0x1c14b1[_0x05c0('0x3a')]=qs[_0x05c0('0x31')](_[_0x05c0('0x3b')](_0x58769a[_0x05c0('0x2f')],_0x2ceaed[_0x05c0('0x31')]),_0x216a5c);if(_0x58769a[_0x05c0('0x2f')][_0x05c0('0x3c')]){_0x1c14b1[_0x05c0('0x3a')]=_[_0x05c0('0x3d')](_0x1c14b1[_0x05c0('0x3a')],{'$or':_[_0x05c0('0x2a')](_0x216a5c,function(_0x40d4db){if(_0x40d4db[_0x05c0('0x2c')]!==_0x05c0('0x3e')){var _0x251d56={};_0x251d56[_0x40d4db[_0x05c0('0x27')]]={'$like':'%'+_0x58769a['query'][_0x05c0('0x3c')]+'%'};return _0x251d56;}})});}_0x1c14b1=_[_0x05c0('0x3d')]({},_0x1c14b1,_0x58769a[_0x05c0('0x3f')]);var _0x3eff9e={'where':_0x1c14b1['where']};return db['AnalyticFieldReport'][_0x05c0('0x1d')](_0x3eff9e)[_0x05c0('0x24')](function(_0x3c5620){_0x200e80['count']=_0x3c5620;if(_0x58769a[_0x05c0('0x2f')][_0x05c0('0x40')]){_0x1c14b1[_0x05c0('0x41')]=[{'all':!![]}];}return db[_0x05c0('0x42')]['findAll'](_0x1c14b1);})[_0x05c0('0x24')](function(_0x32f25c){_0x200e80['rows']=_0x32f25c;return _0x200e80;})[_0x05c0('0x24')](respondWithFilteredResult(_0x7d5ccd,_0x1c14b1))[_0x05c0('0x43')](handleError(_0x7d5ccd,null));};exports[_0x05c0('0x44')]=function(_0xcbd98,_0x164e3a){var _0x398a6e={'raw':![],'where':{'id':_0xcbd98['params']['id']}},_0x322fd1={};_0x322fd1['model']=_[_0x05c0('0x30')](db[_0x05c0('0x42')][_0x05c0('0x45')]);_0x322fd1[_0x05c0('0x2f')]=_[_0x05c0('0x30')](_0xcbd98['query']);_0x322fd1[_0x05c0('0x31')]=_[_0x05c0('0x32')](_0x322fd1[_0x05c0('0x2e')],_0x322fd1[_0x05c0('0x2f')]);_0x398a6e[_0x05c0('0x33')]=_[_0x05c0('0x32')](_0x322fd1[_0x05c0('0x2e')],qs['fields'](_0xcbd98[_0x05c0('0x2f')][_0x05c0('0x34')]));_0x398a6e[_0x05c0('0x33')]=_0x398a6e[_0x05c0('0x33')][_0x05c0('0x46')]?_0x398a6e[_0x05c0('0x33')]:_0x322fd1[_0x05c0('0x2e')];if(_0xcbd98[_0x05c0('0x2f')][_0x05c0('0x40')]){_0x398a6e[_0x05c0('0x41')]=[{'all':!![]}];}_0x398a6e=_[_0x05c0('0x3d')]({},_0x398a6e,_0xcbd98['options']);return db['AnalyticFieldReport'][_0x05c0('0x47')](_0x398a6e)[_0x05c0('0x24')](handleEntityNotFound(_0x164e3a,null))[_0x05c0('0x24')](respondWithResult(_0x164e3a,null))[_0x05c0('0x43')](handleError(_0x164e3a,null));};exports[_0x05c0('0x48')]=function(_0x856372,_0x54a1f6){return db[_0x05c0('0x42')][_0x05c0('0x48')](_0x856372[_0x05c0('0x49')],{})[_0x05c0('0x24')](respondWithResult(_0x54a1f6,0xc9))['catch'](handleError(_0x54a1f6,null));};exports[_0x05c0('0x4a')]=function(_0x2440e8,_0x3ec0bf){return db[_0x05c0('0x42')]['bulkCreate'](_0x2440e8[_0x05c0('0x49')],{'raw':![],'individualHooks':!![]})[_0x05c0('0x24')](respondWithResult(_0x3ec0bf,0xc9))[_0x05c0('0x43')](handleError(_0x3ec0bf,null));};exports[_0x05c0('0x4b')]=function(_0x5ef6cf,_0x230ffa){if(_0x5ef6cf[_0x05c0('0x49')]['id']){delete _0x5ef6cf['body']['id'];}return db[_0x05c0('0x42')]['find']({'where':{'id':_0x5ef6cf['params']['id']}})[_0x05c0('0x24')](handleEntityNotFound(_0x230ffa,null))['then'](saveUpdates(_0x5ef6cf[_0x05c0('0x49')],null))[_0x05c0('0x24')](respondWithResult(_0x230ffa,null))[_0x05c0('0x43')](handleError(_0x230ffa,null));};exports[_0x05c0('0x23')]=function(_0x3ccae9,_0x2affe8){return db['AnalyticFieldReport'][_0x05c0('0x47')]({'where':{'id':_0x3ccae9['params']['id']}})[_0x05c0('0x24')](handleEntityNotFound(_0x2affe8,null))[_0x05c0('0x24')](removeEntity(_0x2affe8,null))[_0x05c0('0x43')](handleError(_0x2affe8,null));};exports[_0x05c0('0x4c')]=function(_0x1496d4,_0x37ad50){return db[_0x05c0('0x42')]['destroy']({'where':{'id':_0x1496d4['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x05c0('0x24')](respondWithResult(_0x37ad50,0xcc))[_0x05c0('0x43')](handleError(_0x37ad50,null));};exports['addFields']=function(_0x5d8e8d,_0xbfb9cb,_0x1a72d6){return db[_0x05c0('0x4d')][_0x05c0('0x4e')]({'where':{'id':_0x5d8e8d[_0x05c0('0x4f')]['id']}})[_0x05c0('0x24')](handleEntityNotFound(_0xbfb9cb,null))[_0x05c0('0x24')](function(_0x48155d){if(_0x48155d){return db[_0x05c0('0x50')][_0x05c0('0x51')](function(_0x189a9a){return db[_0x05c0('0x42')]['destroy']({'where':{'CustomReportId':_0x5d8e8d[_0x05c0('0x4f')]['id']},'transaction':_0x189a9a})['then'](function(_0x1edf4f){var _0x30bc90=_['map'](_0x5d8e8d[_0x05c0('0x49')],function(_0x58bf78){delete _0x58bf78['id'];_0x58bf78[_0x05c0('0x52')]=_0x5d8e8d[_0x05c0('0x4f')]['id'];return _0x58bf78;});return db[_0x05c0('0x42')][_0x05c0('0x4a')](_0x30bc90,{'transaction':_0x189a9a});});})[_0x05c0('0x24')](function(){return db[_0x05c0('0x42')]['findAll']({'where':{'CustomReportId':_0x5d8e8d[_0x05c0('0x4f')]['id']}});});}})[_0x05c0('0x24')](respondWithResult(_0xbfb9cb,null))[_0x05c0('0x43')](handleError(_0xbfb9cb,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 8109199..f192025 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 _0xae9b=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x58f5a7,_0x95ae3b){var _0x41b46f=function(_0x42f03f){while(--_0x42f03f){_0x58f5a7['push'](_0x58f5a7['shift']());}};_0x41b46f(++_0x95ae3b);}(_0xae9b,0x147));var _0xbae9=function(_0x110b0e,_0x2633af){_0x110b0e=_0x110b0e-0x0;var _0x83cf25=_0xae9b[_0x110b0e];return _0x83cf25;};'use strict';var _=require(_0xbae9('0x0'));var util=require(_0xbae9('0x1'));var logger=require(_0xbae9('0x2'))(_0xbae9('0x3'));var moment=require(_0xbae9('0x4'));var BPromise=require(_0xbae9('0x5'));var rp=require(_0xbae9('0x6'));var fs=require('fs');var path=require(_0xbae9('0x7'));var rimraf=require(_0xbae9('0x8'));var config=require(_0xbae9('0x9'));var attributes=require('./analyticFieldReport.attributes');module[_0xbae9('0xa')]=function(_0x99e376,_0xe048cb){return _0x99e376['define'](_0xbae9('0xb'),attributes,{'tableName':_0xbae9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1dc=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb1dc,0xef));var _0xcb1d=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0xb1dc[_0x3ed054];return _0x16dd95;};'use strict';var _=require(_0xcb1d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcb1d('0x1'));var moment=require(_0xcb1d('0x2'));var BPromise=require(_0xcb1d('0x3'));var rp=require(_0xcb1d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb1d('0x5'));var config=require(_0xcb1d('0x6'));var attributes=require(_0xcb1d('0x7'));module[_0xcb1d('0x8')]=function(_0xfe2e7,_0x126da1){return _0xfe2e7[_0xcb1d('0x9')](_0xcb1d('0xa'),attributes,{'tableName':_0xcb1d('0xb'),'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 2979ebb..9f8a67d 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 _0xef43=['../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','request\x20sent','error','AnalyticFieldReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis'];(function(_0x16199a,_0x333613){var _0x4122f0=function(_0xf67836){while(--_0xf67836){_0x16199a['push'](_0x16199a['shift']());}};_0x4122f0(++_0x333613);}(_0xef43,0x1a5));var _0x3ef4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xef43[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x3ef4('0x0'));var moment=require(_0x3ef4('0x1'));var BPromise=require(_0x3ef4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ef4('0x3'));var db=require(_0x3ef4('0x4'))['db'];var utils=require(_0x3ef4('0x5'));var logger=require('../../config/logger')(_0x3ef4('0x6'));var config=require(_0x3ef4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3ef4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b0a2d,_0x2abec8,_0x3ff0ab){return new BPromise(function(_0x10dff5,_0x48a75f){return client[_0x3ef4('0x9')](_0x1b0a2d,_0x3ff0ab)[_0x3ef4('0xa')](function(_0x3b5f05){logger[_0x3ef4('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2abec8,_0x3ef4('0xc'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2abec8,'request\x20sent',JSON['stringify'](_0x3b5f05));if(_0x3b5f05[_0x3ef4('0xd')]){if(_0x3b5f05['error']['code']===0x1f4){logger[_0x3ef4('0xd')](_0x3ef4('0xe'),_0x2abec8,_0x3b5f05[_0x3ef4('0xd')][_0x3ef4('0xf')]);return _0x48a75f(_0x3b5f05[_0x3ef4('0xd')][_0x3ef4('0xf')]);}logger[_0x3ef4('0xd')](_0x3ef4('0xe'),_0x2abec8,_0x3b5f05['error']['message']);return _0x10dff5(_0x3b5f05[_0x3ef4('0xd')][_0x3ef4('0xf')]);}else{logger[_0x3ef4('0xb')](_0x3ef4('0xe'),_0x2abec8,_0x3ef4('0xc'));_0x10dff5(_0x3b5f05['result']['message']);}})[_0x3ef4('0x10')](function(_0x4642ca){logger[_0x3ef4('0xd')](_0x3ef4('0xe'),_0x2abec8,_0x4642ca);_0x48a75f(_0x4642ca);});});} \ No newline at end of file +var _0x7081=['message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x5d0e28,_0x5636e3){var _0x43a4f6=function(_0x168591){while(--_0x168591){_0x5d0e28['push'](_0x5d0e28['shift']());}};_0x43a4f6(++_0x5636e3);}(_0x7081,0x75));var _0x1708=function(_0x248d46,_0xba08ec){_0x248d46=_0x248d46-0x0;var _0x354942=_0x7081[_0x248d46];return _0x354942;};'use strict';var _=require(_0x1708('0x0'));var util=require(_0x1708('0x1'));var moment=require('moment');var BPromise=require(_0x1708('0x2'));var rs=require(_0x1708('0x3'));var fs=require('fs');var Redis=require(_0x1708('0x4'));var db=require(_0x1708('0x5'))['db'];var utils=require(_0x1708('0x6'));var logger=require('../../config/logger')(_0x1708('0x7'));var config=require(_0x1708('0x8'));var jayson=require(_0x1708('0x9'));var client=jayson[_0x1708('0xa')][_0x1708('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e7970,_0x3fe102,_0x1a40ca){return new BPromise(function(_0x2f53cc,_0x2bdc74){return client[_0x1708('0xc')](_0x1e7970,_0x1a40ca)[_0x1708('0xd')](function(_0x205f23){logger[_0x1708('0xe')](_0x1708('0xf'),_0x3fe102,_0x1708('0x10'));logger[_0x1708('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3fe102,_0x1708('0x10'),JSON[_0x1708('0x12')](_0x205f23));if(_0x205f23[_0x1708('0x13')]){if(_0x205f23[_0x1708('0x13')][_0x1708('0x14')]===0x1f4){logger[_0x1708('0x13')](_0x1708('0xf'),_0x3fe102,_0x205f23[_0x1708('0x13')][_0x1708('0x15')]);return _0x2bdc74(_0x205f23[_0x1708('0x13')]['message']);}logger['error'](_0x1708('0xf'),_0x3fe102,_0x205f23[_0x1708('0x13')][_0x1708('0x15')]);return _0x2f53cc(_0x205f23['error'][_0x1708('0x15')]);}else{logger[_0x1708('0xe')](_0x1708('0xf'),_0x3fe102,_0x1708('0x10'));_0x2f53cc(_0x205f23[_0x1708('0x16')][_0x1708('0x15')]);}})['catch'](function(_0x503ebd){logger[_0x1708('0x13')](_0x1708('0xf'),_0x3fe102,_0x503ebd);_0x2bdc74(_0x503ebd);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index ed018dc..4a770ea 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 _0x99c4=['../../components/interaction/service','../../config/environment','get','index','/:id','post','isAuthenticated','/create_many','bulkCreate','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','destroy','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x43e54d,_0xc34f31){var _0x2fc9e7=function(_0x52916c){while(--_0x52916c){_0x43e54d['push'](_0x43e54d['shift']());}};_0x2fc9e7(++_0xc34f31);}(_0x99c4,0x94));var _0x499c=function(_0x25ff15,_0x2941b4){_0x25ff15=_0x25ff15-0x0;var _0x18acf6=_0x99c4[_0x25ff15];return _0x18acf6;};'use strict';var multer=require('multer');var util=require(_0x499c('0x0'));var path=require(_0x499c('0x1'));var timeout=require('connect-timeout');var express=require(_0x499c('0x2'));var router=express[_0x499c('0x3')]();var fs_extra=require(_0x499c('0x4'));var auth=require(_0x499c('0x5'));var interaction=require(_0x499c('0x6'));var config=require(_0x499c('0x7'));var controller=require('./analyticFieldReport.controller');router[_0x499c('0x8')]('/',auth['isAuthenticated'](),controller[_0x499c('0x9')]);router[_0x499c('0x8')](_0x499c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x499c('0xb')]('/',auth[_0x499c('0xc')](),controller['create']);router[_0x499c('0xb')](_0x499c('0xd'),auth[_0x499c('0xc')](),controller[_0x499c('0xe')]);router[_0x499c('0xb')](_0x499c('0xf'),auth['isAuthenticated'](),controller[_0x499c('0x10')]);router['put']('/:id',auth[_0x499c('0xc')](),controller[_0x499c('0x11')]);router[_0x499c('0x12')](_0x499c('0x13'),auth[_0x499c('0xc')](),controller[_0x499c('0x14')]);router[_0x499c('0x12')](_0x499c('0xa'),auth[_0x499c('0xc')](),controller[_0x499c('0x15')]);module['exports']=router; \ No newline at end of file +var _0xca49=['Router','fs-extra','../../components/auth/service','./analyticFieldReport.controller','get','isAuthenticated','index','show','post','create','/create_many','bulkCreate','addFields','put','/:id','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xca49,0xcb));var _0x9ca4=function(_0x56608c,_0x29eb74){_0x56608c=_0x56608c-0x0;var _0x3c7fb0=_0xca49[_0x56608c];return _0x3c7fb0;};'use strict';var multer=require(_0x9ca4('0x0'));var util=require(_0x9ca4('0x1'));var path=require(_0x9ca4('0x2'));var timeout=require(_0x9ca4('0x3'));var express=require(_0x9ca4('0x4'));var router=express[_0x9ca4('0x5')]();var fs_extra=require(_0x9ca4('0x6'));var auth=require(_0x9ca4('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9ca4('0x8'));router[_0x9ca4('0x9')]('/',auth[_0x9ca4('0xa')](),controller[_0x9ca4('0xb')]);router[_0x9ca4('0x9')]('/:id',auth[_0x9ca4('0xa')](),controller[_0x9ca4('0xc')]);router[_0x9ca4('0xd')]('/',auth[_0x9ca4('0xa')](),controller[_0x9ca4('0xe')]);router[_0x9ca4('0xd')](_0x9ca4('0xf'),auth[_0x9ca4('0xa')](),controller[_0x9ca4('0x10')]);router[_0x9ca4('0xd')]('/:id/create_many',auth[_0x9ca4('0xa')](),controller[_0x9ca4('0x11')]);router[_0x9ca4('0x12')](_0x9ca4('0x13'),auth['isAuthenticated'](),controller[_0x9ca4('0x14')]);router[_0x9ca4('0x15')](_0x9ca4('0x16'),auth['isAuthenticated'](),controller[_0x9ca4('0x17')]);router[_0x9ca4('0x15')](_0x9ca4('0x13'),auth[_0x9ca4('0xa')](),controller[_0x9ca4('0x18')]);module[_0x9ca4('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 4073983..9117ed6 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 _0x0efe=['STRING','TEXT','sequelize','exports','name'];(function(_0x8c8176,_0x5360a1){var _0x4dc47b=function(_0x1a7f65){while(--_0x1a7f65){_0x8c8176['push'](_0x8c8176['shift']());}};_0x4dc47b(++_0x5360a1);}(_0x0efe,0x110));var _0xe0ef=function(_0x285872,_0x25eb4f){_0x285872=_0x285872-0x0;var _0x43cc11=_0x0efe[_0x285872];return _0x43cc11;};'use strict';var Sequelize=require(_0xe0ef('0x0'));module[_0xe0ef('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe0ef('0x2')},'table':{'type':Sequelize[_0xe0ef('0x3')]},'metric':{'type':Sequelize[_0xe0ef('0x4')]},'description':{'type':Sequelize[_0xe0ef('0x3')]}}; \ No newline at end of file +var _0xb315=['name','STRING','TEXT','sequelize'];(function(_0x4d028d,_0x66c05c){var _0x1abe6e=function(_0x10cb17){while(--_0x10cb17){_0x4d028d['push'](_0x4d028d['shift']());}};_0x1abe6e(++_0x66c05c);}(_0xb315,0x6f));var _0x5b31=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0xb315[_0x3fd3a3];return _0xa3e4d5;};'use strict';var Sequelize=require(_0x5b31('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5b31('0x1')},'table':{'type':Sequelize[_0x5b31('0x2')]},'metric':{'type':Sequelize[_0x5b31('0x3')]},'description':{'type':Sequelize[_0x5b31('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 4522238..5211cdb 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 _0xf072=['save','then','Metrics','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','AnalyticMetric','includeAll','include','findAll','catch','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','count','offset','limit','set','Content-Range','json','apply','reject'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0xf072,0x1d9));var _0x2f07=function(_0x2040f4,_0x4fe5cc){_0x2040f4=_0x2040f4-0x0;var _0x4b8540=_0xf072[_0x2040f4];return _0x4b8540;};'use strict';var emlformat=require(_0x2f07('0x0'));var rimraf=require(_0x2f07('0x1'));var zipdir=require(_0x2f07('0x2'));var jsonpatch=require(_0x2f07('0x3'));var rp=require(_0x2f07('0x4'));var moment=require(_0x2f07('0x5'));var BPromise=require(_0x2f07('0x6'));var Mustache=require(_0x2f07('0x7'));var util=require('util');var path=require(_0x2f07('0x8'));var sox=require(_0x2f07('0x9'));var csv=require(_0x2f07('0xa'));var ejs=require(_0x2f07('0xb'));var fs=require('fs');var fs_extra=require(_0x2f07('0xc'));var _=require(_0x2f07('0xd'));var squel=require(_0x2f07('0xe'));var crypto=require(_0x2f07('0xf'));var jsforce=require(_0x2f07('0x10'));var deskjs=require(_0x2f07('0x11'));var toCsv=require(_0x2f07('0xa'));var querystring=require(_0x2f07('0x12'));var Papa=require(_0x2f07('0x13'));var Redis=require('ioredis');var authService=require(_0x2f07('0x14'));var qs=require(_0x2f07('0x15'));var as=require(_0x2f07('0x16'));var hardwareService=require(_0x2f07('0x17'));var logger=require('../../config/logger')(_0x2f07('0x18'));var utils=require(_0x2f07('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x2f07('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e1d16,_0xbb514f){_0xbb514f=_0xbb514f||0xcc;return function(_0xd3a6){if(_0xd3a6){return _0x1e1d16['sendStatus'](_0xbb514f);}return _0x1e1d16[_0x2f07('0x1b')](_0xbb514f)[_0x2f07('0x1c')]();};}function respondWithResult(_0x57dcd2,_0x1cc5a4){_0x1cc5a4=_0x1cc5a4||0xc8;return function(_0x171380){if(_0x171380){return _0x57dcd2[_0x2f07('0x1b')](_0x1cc5a4)['json'](_0x171380);}};}function respondWithFilteredResult(_0x586dda,_0x3d8b9b){return function(_0x37ffa7){if(_0x37ffa7){var _0x521e99=_0x37ffa7[_0x2f07('0x1d')],_0x3b64b2=_0x3d8b9b['offset'],_0x5337ae=_0x3d8b9b[_0x2f07('0x1e')]+_0x3d8b9b[_0x2f07('0x1f')],_0x60d8e4;if(_0x5337ae>=_0x521e99){_0x5337ae=_0x521e99;_0x60d8e4=0xc8;}else{_0x60d8e4=0xce;}_0x586dda[_0x2f07('0x1b')](_0x60d8e4);return _0x586dda[_0x2f07('0x20')](_0x2f07('0x21'),_0x3b64b2+'-'+_0x5337ae+'/'+_0x521e99)[_0x2f07('0x22')](_0x37ffa7);}return null;};}function patchUpdates(_0x1d7eb8){return function(_0x4f7670){try{jsonpatch[_0x2f07('0x23')](_0x4f7670,_0x1d7eb8,!![]);}catch(_0x319db6){return BPromise[_0x2f07('0x24')](_0x319db6);}return _0x4f7670[_0x2f07('0x25')]();};}function saveUpdates(_0x13c04d,_0x4bb406){return function(_0x253b89){if(_0x253b89){return _0x253b89['update'](_0x13c04d)[_0x2f07('0x26')](function(_0x445808){return _0x445808;});}return null;};}function removeEntity(_0x256f79,_0x5653cd){return function(_0x50f263){if(_0x50f263){return _0x50f263['destroy']()[_0x2f07('0x26')](function(){var _0x4ad315=_0x50f263['get']({'plain':!![]});var _0x34cd67=_0x2f07('0x27');return db['UserProfileResource'][_0x2f07('0x28')]({'where':{'type':_0x34cd67,'resourceId':_0x4ad315['id']}})[_0x2f07('0x26')](function(){return _0x50f263;});})['then'](function(){_0x256f79[_0x2f07('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e276a,_0x38543f){return function(_0x46a5ec){if(!_0x46a5ec){_0x2e276a[_0x2f07('0x29')](0x194);}return _0x46a5ec;};}function handleError(_0x941e91,_0x50186a){_0x50186a=_0x50186a||0x1f4;return function(_0x27b5da){logger[_0x2f07('0x2a')](_0x27b5da[_0x2f07('0x2b')]);if(_0x27b5da[_0x2f07('0x2c')]){delete _0x27b5da['name'];}_0x941e91[_0x2f07('0x1b')](_0x50186a)[_0x2f07('0x2d')](_0x27b5da);};}exports['index']=function(_0x2da386,_0xf48a98){var _0x449da7={},_0x419b3d={},_0x52f3ac={'count':0x0,'rows':[]};var _0x722218=_[_0x2f07('0x2e')](db['AnalyticMetric'][_0x2f07('0x2f')],function(_0x142b33){return{'name':_0x142b33[_0x2f07('0x30')],'type':_0x142b33['type'][_0x2f07('0x31')]};});_0x419b3d[_0x2f07('0x32')]=_['map'](_0x722218,'name');_0x419b3d[_0x2f07('0x33')]=_[_0x2f07('0x34')](_0x2da386[_0x2f07('0x33')]);_0x419b3d[_0x2f07('0x35')]=_[_0x2f07('0x36')](_0x419b3d[_0x2f07('0x32')],_0x419b3d[_0x2f07('0x33')]);_0x449da7[_0x2f07('0x37')]=_['intersection'](_0x419b3d[_0x2f07('0x32')],qs[_0x2f07('0x38')](_0x2da386[_0x2f07('0x33')][_0x2f07('0x38')]));_0x449da7[_0x2f07('0x37')]=_0x449da7[_0x2f07('0x37')]['length']?_0x449da7[_0x2f07('0x37')]:_0x419b3d[_0x2f07('0x32')];if(!_0x2da386['query'][_0x2f07('0x39')](_0x2f07('0x3a'))){_0x449da7[_0x2f07('0x1f')]=qs[_0x2f07('0x1f')](_0x2da386[_0x2f07('0x33')][_0x2f07('0x1f')]);_0x449da7[_0x2f07('0x1e')]=qs[_0x2f07('0x1e')](_0x2da386[_0x2f07('0x33')]['offset']);}_0x449da7[_0x2f07('0x3b')]=qs[_0x2f07('0x3c')](_0x2da386[_0x2f07('0x33')]['sort']);_0x449da7['where']=qs[_0x2f07('0x35')](_[_0x2f07('0x3d')](_0x2da386['query'],_0x419b3d[_0x2f07('0x35')]),_0x722218);if(_0x2da386['query'][_0x2f07('0x3e')]){_0x449da7[_0x2f07('0x3f')]=_[_0x2f07('0x40')](_0x449da7[_0x2f07('0x3f')],{'$or':_[_0x2f07('0x2e')](_0x722218,function(_0x89c268){if(_0x89c268[_0x2f07('0x41')]!==_0x2f07('0x42')){var _0xb347fd={};_0xb347fd[_0x89c268['name']]={'$like':'%'+_0x2da386[_0x2f07('0x33')]['filter']+'%'};return _0xb347fd;}})});}_0x449da7=_['merge']({},_0x449da7,_0x2da386['options']);var _0x20983c={'where':_0x449da7[_0x2f07('0x3f')]};return db[_0x2f07('0x43')][_0x2f07('0x1d')](_0x20983c)['then'](function(_0x3bcf24){_0x52f3ac['count']=_0x3bcf24;if(_0x2da386['query'][_0x2f07('0x44')]){_0x449da7[_0x2f07('0x45')]=[{'all':!![]}];}return db[_0x2f07('0x43')][_0x2f07('0x46')](_0x449da7);})[_0x2f07('0x26')](function(_0x2f3528){_0x52f3ac['rows']=_0x2f3528;return _0x52f3ac;})[_0x2f07('0x26')](respondWithFilteredResult(_0xf48a98,_0x449da7))[_0x2f07('0x47')](handleError(_0xf48a98,null));};exports['show']=function(_0x300082,_0x56aa1a){var _0x42e67c={'raw':!![],'where':{'id':_0x300082['params']['id']}},_0x532ed9={};_0x532ed9['model']=_[_0x2f07('0x34')](db[_0x2f07('0x43')][_0x2f07('0x2f')]);_0x532ed9['query']=_[_0x2f07('0x34')](_0x300082['query']);_0x532ed9['filters']=_[_0x2f07('0x36')](_0x532ed9['model'],_0x532ed9['query']);_0x42e67c[_0x2f07('0x37')]=_[_0x2f07('0x36')](_0x532ed9[_0x2f07('0x32')],qs[_0x2f07('0x38')](_0x300082[_0x2f07('0x33')][_0x2f07('0x38')]));_0x42e67c[_0x2f07('0x37')]=_0x42e67c[_0x2f07('0x37')]['length']?_0x42e67c['attributes']:_0x532ed9['model'];if(_0x300082['query'][_0x2f07('0x44')]){_0x42e67c[_0x2f07('0x45')]=[{'all':!![]}];}_0x42e67c=_[_0x2f07('0x40')]({},_0x42e67c,_0x300082[_0x2f07('0x48')]);return db['AnalyticMetric'][_0x2f07('0x49')](_0x42e67c)[_0x2f07('0x26')](handleEntityNotFound(_0x56aa1a,null))[_0x2f07('0x26')](respondWithResult(_0x56aa1a,null))[_0x2f07('0x47')](handleError(_0x56aa1a,null));};exports[_0x2f07('0x4a')]=function(_0x41764a,_0x4b887a){return db[_0x2f07('0x43')]['create'](_0x41764a[_0x2f07('0x4b')],{})[_0x2f07('0x26')](function(_0x34046d){var _0xfdb50a=_0x41764a['user'][_0x2f07('0x4c')]({'plain':!![]});if(!_0xfdb50a)throw new Error(_0x2f07('0x4d'));if(_0xfdb50a[_0x2f07('0x4e')]==='user'){var _0x252b7b=_0x34046d[_0x2f07('0x4c')]({'plain':!![]});var _0x1c323e=_0x2f07('0x27');return db[_0x2f07('0x4f')][_0x2f07('0x49')]({'where':{'name':_0x1c323e,'userProfileId':_0xfdb50a[_0x2f07('0x50')]},'raw':!![]})[_0x2f07('0x26')](function(_0x373a51){if(_0x373a51&&_0x373a51['autoAssociation']===0x0){return db[_0x2f07('0x51')][_0x2f07('0x4a')]({'name':_0x252b7b[_0x2f07('0x2c')],'resourceId':_0x252b7b['id'],'type':_0x373a51[_0x2f07('0x2c')],'sectionId':_0x373a51['id']},{})[_0x2f07('0x26')](function(){return _0x34046d;});}else{return _0x34046d;}})[_0x2f07('0x47')](function(_0x4b9dc8){logger[_0x2f07('0x2a')](_0x2f07('0x52'),_0x4b9dc8);throw _0x4b9dc8;});}return _0x34046d;})[_0x2f07('0x26')](respondWithResult(_0x4b887a,0xc9))['catch'](handleError(_0x4b887a,null));};exports[_0x2f07('0x53')]=function(_0x8c0432,_0x345d13){if(_0x8c0432[_0x2f07('0x4b')]['id']){delete _0x8c0432[_0x2f07('0x4b')]['id'];}return db[_0x2f07('0x43')][_0x2f07('0x49')]({'where':{'id':_0x8c0432[_0x2f07('0x54')]['id']}})['then'](handleEntityNotFound(_0x345d13,null))[_0x2f07('0x26')](saveUpdates(_0x8c0432[_0x2f07('0x4b')],null))[_0x2f07('0x26')](respondWithResult(_0x345d13,null))[_0x2f07('0x47')](handleError(_0x345d13,null));};exports['destroy']=function(_0x18c671,_0x505edd){return db[_0x2f07('0x43')][_0x2f07('0x49')]({'where':{'id':_0x18c671[_0x2f07('0x54')]['id']}})[_0x2f07('0x26')](handleEntityNotFound(_0x505edd,null))[_0x2f07('0x26')](removeEntity(_0x505edd,null))[_0x2f07('0x47')](handleError(_0x505edd,null));}; \ No newline at end of file +var _0xaa57=['sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','create','body','user','get','UserProfileSection','autoAssociation','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','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3a8e2f,_0x57588b){var _0x50f4af=function(_0x46f4b2){while(--_0x46f4b2){_0x3a8e2f['push'](_0x3a8e2f['shift']());}};_0x50f4af(++_0x57588b);}(_0xaa57,0x17c));var _0x7aa5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa57[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x7aa5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7aa5('0x1'));var jsonpatch=require(_0x7aa5('0x2'));var rp=require(_0x7aa5('0x3'));var moment=require(_0x7aa5('0x4'));var BPromise=require(_0x7aa5('0x5'));var Mustache=require(_0x7aa5('0x6'));var util=require(_0x7aa5('0x7'));var path=require(_0x7aa5('0x8'));var sox=require(_0x7aa5('0x9'));var csv=require(_0x7aa5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7aa5('0xb'));var _=require(_0x7aa5('0xc'));var squel=require('squel');var crypto=require(_0x7aa5('0xd'));var jsforce=require(_0x7aa5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7aa5('0xa'));var querystring=require('querystring');var Papa=require(_0x7aa5('0xf'));var Redis=require(_0x7aa5('0x10'));var authService=require(_0x7aa5('0x11'));var qs=require(_0x7aa5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7aa5('0x13'))(_0x7aa5('0x14'));var utils=require(_0x7aa5('0x15'));var config=require(_0x7aa5('0x16'));var licenseUtil=require(_0x7aa5('0x17'));var db=require(_0x7aa5('0x18'))['db'];function respondWithStatusCode(_0x6925cf,_0x25052f){_0x25052f=_0x25052f||0xcc;return function(_0x3c70b9){if(_0x3c70b9){return _0x6925cf[_0x7aa5('0x19')](_0x25052f);}return _0x6925cf[_0x7aa5('0x1a')](_0x25052f)[_0x7aa5('0x1b')]();};}function respondWithResult(_0x23f143,_0x38ee87){_0x38ee87=_0x38ee87||0xc8;return function(_0x28dafa){if(_0x28dafa){return _0x23f143[_0x7aa5('0x1a')](_0x38ee87)[_0x7aa5('0x1c')](_0x28dafa);}};}function respondWithFilteredResult(_0x4bc10d,_0x5d2772){return function(_0x13c394){if(_0x13c394){var _0x35f5fb=_0x13c394[_0x7aa5('0x1d')],_0x3aacb7=_0x5d2772[_0x7aa5('0x1e')],_0x275bff=_0x5d2772[_0x7aa5('0x1e')]+_0x5d2772[_0x7aa5('0x1f')],_0x16991e;if(_0x275bff>=_0x35f5fb){_0x275bff=_0x35f5fb;_0x16991e=0xc8;}else{_0x16991e=0xce;}_0x4bc10d[_0x7aa5('0x1a')](_0x16991e);return _0x4bc10d['set'](_0x7aa5('0x20'),_0x3aacb7+'-'+_0x275bff+'/'+_0x35f5fb)[_0x7aa5('0x1c')](_0x13c394);}return null;};}function patchUpdates(_0x5b775a){return function(_0x255e86){try{jsonpatch[_0x7aa5('0x21')](_0x255e86,_0x5b775a,!![]);}catch(_0x346d17){return BPromise['reject'](_0x346d17);}return _0x255e86[_0x7aa5('0x22')]();};}function saveUpdates(_0x50d5f1,_0x37d154){return function(_0x4cfc38){if(_0x4cfc38){return _0x4cfc38[_0x7aa5('0x23')](_0x50d5f1)[_0x7aa5('0x24')](function(_0x46567d){return _0x46567d;});}return null;};}function removeEntity(_0x3671f7,_0x45265e){return function(_0x59a51f){if(_0x59a51f){return _0x59a51f['destroy']()[_0x7aa5('0x24')](function(){var _0x2e6b10=_0x59a51f['get']({'plain':!![]});var _0x86d212=_0x7aa5('0x25');return db[_0x7aa5('0x26')][_0x7aa5('0x27')]({'where':{'type':_0x86d212,'resourceId':_0x2e6b10['id']}})[_0x7aa5('0x24')](function(){return _0x59a51f;});})[_0x7aa5('0x24')](function(){_0x3671f7['status'](0xcc)[_0x7aa5('0x1b')]();});}};}function handleEntityNotFound(_0x42acac,_0x26fc5c){return function(_0xd999dd){if(!_0xd999dd){_0x42acac[_0x7aa5('0x19')](0x194);}return _0xd999dd;};}function handleError(_0x5c08e0,_0x567e63){_0x567e63=_0x567e63||0x1f4;return function(_0x3669cc){logger[_0x7aa5('0x28')](_0x3669cc[_0x7aa5('0x29')]);if(_0x3669cc[_0x7aa5('0x2a')]){delete _0x3669cc['name'];}_0x5c08e0[_0x7aa5('0x1a')](_0x567e63)[_0x7aa5('0x2b')](_0x3669cc);};}exports[_0x7aa5('0x2c')]=function(_0x289252,_0x1690aa){var _0x5a7b31={},_0x5daa1a={},_0x3fae54={'count':0x0,'rows':[]};var _0x2e9d52=_[_0x7aa5('0x2d')](db[_0x7aa5('0x2e')][_0x7aa5('0x2f')],function(_0x22b591){return{'name':_0x22b591['fieldName'],'type':_0x22b591[_0x7aa5('0x30')]['key']};});_0x5daa1a[_0x7aa5('0x31')]=_[_0x7aa5('0x2d')](_0x2e9d52,'name');_0x5daa1a[_0x7aa5('0x32')]=_[_0x7aa5('0x33')](_0x289252[_0x7aa5('0x32')]);_0x5daa1a[_0x7aa5('0x34')]=_['intersection'](_0x5daa1a[_0x7aa5('0x31')],_0x5daa1a[_0x7aa5('0x32')]);_0x5a7b31[_0x7aa5('0x35')]=_[_0x7aa5('0x36')](_0x5daa1a[_0x7aa5('0x31')],qs[_0x7aa5('0x37')](_0x289252['query']['fields']));_0x5a7b31['attributes']=_0x5a7b31[_0x7aa5('0x35')][_0x7aa5('0x38')]?_0x5a7b31['attributes']:_0x5daa1a[_0x7aa5('0x31')];if(!_0x289252[_0x7aa5('0x32')][_0x7aa5('0x39')](_0x7aa5('0x3a'))){_0x5a7b31[_0x7aa5('0x1f')]=qs[_0x7aa5('0x1f')](_0x289252[_0x7aa5('0x32')][_0x7aa5('0x1f')]);_0x5a7b31['offset']=qs['offset'](_0x289252[_0x7aa5('0x32')][_0x7aa5('0x1e')]);}_0x5a7b31[_0x7aa5('0x3b')]=qs[_0x7aa5('0x3c')](_0x289252[_0x7aa5('0x32')][_0x7aa5('0x3c')]);_0x5a7b31[_0x7aa5('0x3d')]=qs['filters'](_[_0x7aa5('0x3e')](_0x289252[_0x7aa5('0x32')],_0x5daa1a[_0x7aa5('0x34')]),_0x2e9d52);if(_0x289252[_0x7aa5('0x32')][_0x7aa5('0x3f')]){_0x5a7b31[_0x7aa5('0x3d')]=_[_0x7aa5('0x40')](_0x5a7b31[_0x7aa5('0x3d')],{'$or':_['map'](_0x2e9d52,function(_0x232944){if(_0x232944[_0x7aa5('0x30')]!==_0x7aa5('0x41')){var _0x4161ee={};_0x4161ee[_0x232944[_0x7aa5('0x2a')]]={'$like':'%'+_0x289252[_0x7aa5('0x32')][_0x7aa5('0x3f')]+'%'};return _0x4161ee;}})});}_0x5a7b31=_['merge']({},_0x5a7b31,_0x289252['options']);var _0xd4ce7e={'where':_0x5a7b31[_0x7aa5('0x3d')]};return db[_0x7aa5('0x2e')][_0x7aa5('0x1d')](_0xd4ce7e)[_0x7aa5('0x24')](function(_0x201b12){_0x3fae54[_0x7aa5('0x1d')]=_0x201b12;if(_0x289252[_0x7aa5('0x32')]['includeAll']){_0x5a7b31[_0x7aa5('0x42')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x7aa5('0x43')](_0x5a7b31);})[_0x7aa5('0x24')](function(_0x1aa1cb){_0x3fae54['rows']=_0x1aa1cb;return _0x3fae54;})['then'](respondWithFilteredResult(_0x1690aa,_0x5a7b31))[_0x7aa5('0x44')](handleError(_0x1690aa,null));};exports[_0x7aa5('0x45')]=function(_0x25bda1,_0x472a98){var _0x415367={'raw':!![],'where':{'id':_0x25bda1[_0x7aa5('0x46')]['id']}},_0x1abea0={};_0x1abea0[_0x7aa5('0x31')]=_[_0x7aa5('0x33')](db[_0x7aa5('0x2e')][_0x7aa5('0x2f')]);_0x1abea0[_0x7aa5('0x32')]=_[_0x7aa5('0x33')](_0x25bda1[_0x7aa5('0x32')]);_0x1abea0[_0x7aa5('0x34')]=_[_0x7aa5('0x36')](_0x1abea0[_0x7aa5('0x31')],_0x1abea0[_0x7aa5('0x32')]);_0x415367[_0x7aa5('0x35')]=_[_0x7aa5('0x36')](_0x1abea0[_0x7aa5('0x31')],qs[_0x7aa5('0x37')](_0x25bda1['query'][_0x7aa5('0x37')]));_0x415367[_0x7aa5('0x35')]=_0x415367[_0x7aa5('0x35')][_0x7aa5('0x38')]?_0x415367[_0x7aa5('0x35')]:_0x1abea0['model'];if(_0x25bda1['query'][_0x7aa5('0x47')]){_0x415367[_0x7aa5('0x42')]=[{'all':!![]}];}_0x415367=_['merge']({},_0x415367,_0x25bda1[_0x7aa5('0x48')]);return db[_0x7aa5('0x2e')][_0x7aa5('0x49')](_0x415367)[_0x7aa5('0x24')](handleEntityNotFound(_0x472a98,null))[_0x7aa5('0x24')](respondWithResult(_0x472a98,null))[_0x7aa5('0x44')](handleError(_0x472a98,null));};exports[_0x7aa5('0x4a')]=function(_0x4fb6bd,_0xf371df){return db[_0x7aa5('0x2e')][_0x7aa5('0x4a')](_0x4fb6bd[_0x7aa5('0x4b')],{})[_0x7aa5('0x24')](function(_0x63cc18){var _0x347377=_0x4fb6bd[_0x7aa5('0x4c')][_0x7aa5('0x4d')]({'plain':!![]});if(!_0x347377)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347377['role']===_0x7aa5('0x4c')){var _0x178694=_0x63cc18[_0x7aa5('0x4d')]({'plain':!![]});var _0x36d385=_0x7aa5('0x25');return db[_0x7aa5('0x4e')][_0x7aa5('0x49')]({'where':{'name':_0x36d385,'userProfileId':_0x347377['userProfileId']},'raw':!![]})[_0x7aa5('0x24')](function(_0x5ba380){if(_0x5ba380&&_0x5ba380[_0x7aa5('0x4f')]===0x0){return db[_0x7aa5('0x26')][_0x7aa5('0x4a')]({'name':_0x178694[_0x7aa5('0x2a')],'resourceId':_0x178694['id'],'type':_0x5ba380[_0x7aa5('0x2a')],'sectionId':_0x5ba380['id']},{})[_0x7aa5('0x24')](function(){return _0x63cc18;});}else{return _0x63cc18;}})['catch'](function(_0xf0176e){logger[_0x7aa5('0x28')](_0x7aa5('0x50'),_0xf0176e);throw _0xf0176e;});}return _0x63cc18;})[_0x7aa5('0x24')](respondWithResult(_0xf371df,0xc9))['catch'](handleError(_0xf371df,null));};exports[_0x7aa5('0x23')]=function(_0x5911e5,_0x15621a){if(_0x5911e5[_0x7aa5('0x4b')]['id']){delete _0x5911e5['body']['id'];}return db[_0x7aa5('0x2e')][_0x7aa5('0x49')]({'where':{'id':_0x5911e5[_0x7aa5('0x46')]['id']}})['then'](handleEntityNotFound(_0x15621a,null))[_0x7aa5('0x24')](saveUpdates(_0x5911e5['body'],null))['then'](respondWithResult(_0x15621a,null))['catch'](handleError(_0x15621a,null));};exports['destroy']=function(_0x49b7bd,_0x1097b4){return db[_0x7aa5('0x2e')][_0x7aa5('0x49')]({'where':{'id':_0x49b7bd[_0x7aa5('0x46')]['id']}})[_0x7aa5('0x24')](handleEntityNotFound(_0x1097b4,null))[_0x7aa5('0x24')](removeEntity(_0x1097b4,null))[_0x7aa5('0x44')](handleError(_0x1097b4,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 9c0c5ec..e45e388 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 _0x9455=['define','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./analyticMetric.attributes','exports'];(function(_0x3fed99,_0x191b34){var _0x4e7ebd=function(_0x4f8c0f){while(--_0x4f8c0f){_0x3fed99['push'](_0x3fed99['shift']());}};_0x4e7ebd(++_0x191b34);}(_0x9455,0x8d));var _0x5945=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9455[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var util=require(_0x5945('0x0'));var logger=require(_0x5945('0x1'))(_0x5945('0x2'));var moment=require(_0x5945('0x3'));var BPromise=require(_0x5945('0x4'));var rp=require(_0x5945('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5945('0x6'));var config=require('../../config/environment');var attributes=require(_0x5945('0x7'));module[_0x5945('0x8')]=function(_0x25019d,_0x4a9f2c){return _0x25019d[_0x5945('0x9')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41bd=['request-promise','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api','moment','bluebird'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x41bd,0x103));var _0xd41b=function(_0x54c659,_0x569260){_0x54c659=_0x54c659-0x0;var _0x582102=_0x41bd[_0x54c659];return _0x582102;};'use strict';var _=require('lodash');var util=require(_0xd41b('0x0'));var logger=require(_0xd41b('0x1'))(_0xd41b('0x2'));var moment=require(_0xd41b('0x3'));var BPromise=require(_0xd41b('0x4'));var rp=require(_0xd41b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd41b('0x6'));var attributes=require(_0xd41b('0x7'));module[_0xd41b('0x8')]=function(_0x13852e,_0x5f1f61){return _0x13852e[_0xd41b('0x9')](_0xd41b('0xa'),attributes,{'tableName':_0xd41b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index fddf7aa..3fef17c 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 _0xa83a=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','AnalyticMetric,\x20%s,\x20%s'];(function(_0x524f97,_0x1814ce){var _0x2192e4=function(_0x4b5935){while(--_0x4b5935){_0x524f97['push'](_0x524f97['shift']());}};_0x2192e4(++_0x1814ce);}(_0xa83a,0x179));var _0xaa83=function(_0x53c89c,_0x56c26f){_0x53c89c=_0x53c89c-0x0;var _0x2de0f4=_0xa83a[_0x53c89c];return _0x2de0f4;};'use strict';var _=require(_0xaa83('0x0'));var util=require(_0xaa83('0x1'));var moment=require(_0xaa83('0x2'));var BPromise=require(_0xaa83('0x3'));var rs=require(_0xaa83('0x4'));var fs=require('fs');var Redis=require(_0xaa83('0x5'));var db=require(_0xaa83('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa83('0x7'))(_0xaa83('0x8'));var config=require(_0xaa83('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaa83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x288a15,_0x447734,_0x435f9d){return new BPromise(function(_0x5ce4e8,_0x4698f5){return client[_0xaa83('0xb')](_0x288a15,_0x435f9d)[_0xaa83('0xc')](function(_0x17c349){logger['info'](_0xaa83('0xd'),_0x447734,_0xaa83('0xe'));logger[_0xaa83('0xf')](_0xaa83('0x10'),_0x447734,_0xaa83('0xe'),JSON[_0xaa83('0x11')](_0x17c349));if(_0x17c349[_0xaa83('0x12')]){if(_0x17c349[_0xaa83('0x12')]['code']===0x1f4){logger[_0xaa83('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x447734,_0x17c349[_0xaa83('0x12')][_0xaa83('0x13')]);return _0x4698f5(_0x17c349[_0xaa83('0x12')][_0xaa83('0x13')]);}logger[_0xaa83('0x12')](_0xaa83('0xd'),_0x447734,_0x17c349[_0xaa83('0x12')]['message']);return _0x5ce4e8(_0x17c349[_0xaa83('0x12')][_0xaa83('0x13')]);}else{logger[_0xaa83('0x14')](_0xaa83('0xd'),_0x447734,_0xaa83('0xe'));_0x5ce4e8(_0x17c349[_0xaa83('0x15')]['message']);}})[_0xaa83('0x16')](function(_0x754653){logger[_0xaa83('0x12')](_0xaa83('0xd'),_0x447734,_0x754653);_0x4698f5(_0x754653);});});} \ No newline at end of file +var _0xf762=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x16337a,_0x4789a1){var _0x422365=function(_0x34f039){while(--_0x34f039){_0x16337a['push'](_0x16337a['shift']());}};_0x422365(++_0x4789a1);}(_0xf762,0x1a2));var _0x2f76=function(_0xdd7362,_0x2d8086){_0xdd7362=_0xdd7362-0x0;var _0x4a77b1=_0xf762[_0xdd7362];return _0x4a77b1;};'use strict';var _=require(_0x2f76('0x0'));var util=require(_0x2f76('0x1'));var moment=require(_0x2f76('0x2'));var BPromise=require(_0x2f76('0x3'));var rs=require(_0x2f76('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2f76('0x5'));var logger=require(_0x2f76('0x6'))(_0x2f76('0x7'));var config=require(_0x2f76('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2f76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f4353,_0x17190b,_0x2bccbe){return new BPromise(function(_0x824ff5,_0x21bd6a){return client['request'](_0x5f4353,_0x2bccbe)[_0x2f76('0xa')](function(_0x378a90){logger[_0x2f76('0xb')](_0x2f76('0xc'),_0x17190b,_0x2f76('0xd'));logger['debug'](_0x2f76('0xe'),_0x17190b,_0x2f76('0xd'),JSON['stringify'](_0x378a90));if(_0x378a90[_0x2f76('0xf')]){if(_0x378a90[_0x2f76('0xf')][_0x2f76('0x10')]===0x1f4){logger['error'](_0x2f76('0xc'),_0x17190b,_0x378a90['error'][_0x2f76('0x11')]);return _0x21bd6a(_0x378a90[_0x2f76('0xf')]['message']);}logger[_0x2f76('0xf')](_0x2f76('0xc'),_0x17190b,_0x378a90['error'][_0x2f76('0x11')]);return _0x824ff5(_0x378a90[_0x2f76('0xf')][_0x2f76('0x11')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x17190b,_0x2f76('0xd'));_0x824ff5(_0x378a90['result'][_0x2f76('0x11')]);}})[_0x2f76('0x12')](function(_0x31cee1){logger[_0x2f76('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x17190b,_0x31cee1);_0x21bd6a(_0x31cee1);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 90c750f..634b00c 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 _0xea28=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xea28,0x13a));var _0x8ea2=function(_0x4faecb,_0x3ea6f6){_0x4faecb=_0x4faecb-0x0;var _0x3bd1c9=_0xea28[_0x4faecb];return _0x3bd1c9;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xf')]('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0x11')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x12')]);router['delete']('/:id',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);module[_0x8ea2('0x14')]=router; \ No newline at end of file +var _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','path','express'];(function(_0x5958d2,_0x550300){var _0x2a4809=function(_0x48048b){while(--_0x48048b){_0x5958d2['push'](_0x5958d2['shift']());}};_0x2a4809(++_0x550300);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['post']('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xd')]);router[_0xe36e('0xe')]('/:id',auth[_0xe36e('0x9')](),controller['update']);router[_0xe36e('0xf')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x10')]);module[_0xe36e('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 080e4fd..9e64afb 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 _0x75e2=['exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x75e2,0x147));var _0x275e=function(_0x301064,_0x1985aa){_0x301064=_0x301064-0x0;var _0x5bc841=_0x75e2[_0x301064];return _0x5bc841;};'use strict';var Sequelize=require('sequelize');module[_0x275e('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 7a5d604..05b3176 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 _0xff58=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','eml-format','rimraf'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xff58,0x1a8));var _0x8ff5=function(_0x539709,_0x2c9edd){_0x539709=_0x539709-0x0;var _0x73cc7e=_0xff58[_0x539709];return _0x73cc7e;};'use strict';var emlformat=require(_0x8ff5('0x0'));var rimraf=require(_0x8ff5('0x1'));var zipdir=require(_0x8ff5('0x2'));var jsonpatch=require(_0x8ff5('0x3'));var rp=require(_0x8ff5('0x4'));var moment=require(_0x8ff5('0x5'));var BPromise=require(_0x8ff5('0x6'));var Mustache=require(_0x8ff5('0x7'));var util=require(_0x8ff5('0x8'));var path=require(_0x8ff5('0x9'));var sox=require(_0x8ff5('0xa'));var csv=require(_0x8ff5('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8ff5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8ff5('0xd'));var toCsv=require(_0x8ff5('0xb'));var querystring=require('querystring');var Papa=require(_0x8ff5('0xe'));var Redis=require(_0x8ff5('0xf'));var authService=require(_0x8ff5('0x10'));var qs=require(_0x8ff5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ff5('0x12'));var logger=require(_0x8ff5('0x13'))(_0x8ff5('0x14'));var utils=require('../../config/utils');var config=require(_0x8ff5('0x15'));var licenseUtil=require(_0x8ff5('0x16'));var db=require(_0x8ff5('0x17'))['db'];function respondWithStatusCode(_0xd228df,_0x1819fc){_0x1819fc=_0x1819fc||0xcc;return function(_0x5c772c){if(_0x5c772c){return _0xd228df[_0x8ff5('0x18')](_0x1819fc);}return _0xd228df[_0x8ff5('0x19')](_0x1819fc)['end']();};}function respondWithResult(_0x1c4799,_0x5e953c){_0x5e953c=_0x5e953c||0xc8;return function(_0x5bbd7b){if(_0x5bbd7b){return _0x1c4799['status'](_0x5e953c)['json'](_0x5bbd7b);}};}function respondWithFilteredResult(_0x32ebc1,_0x188133){return function(_0x32a964){if(_0x32a964){var _0x45aebf=_0x32a964[_0x8ff5('0x1a')],_0x2b8eeb=_0x188133[_0x8ff5('0x1b')],_0x1be1ec=_0x188133['offset']+_0x188133[_0x8ff5('0x1c')],_0x50a485;if(_0x1be1ec>=_0x45aebf){_0x1be1ec=_0x45aebf;_0x50a485=0xc8;}else{_0x50a485=0xce;}_0x32ebc1[_0x8ff5('0x19')](_0x50a485);return _0x32ebc1[_0x8ff5('0x1d')](_0x8ff5('0x1e'),_0x2b8eeb+'-'+_0x1be1ec+'/'+_0x45aebf)[_0x8ff5('0x1f')](_0x32a964);}return null;};}function patchUpdates(_0x59a904){return function(_0x53d5df){try{jsonpatch[_0x8ff5('0x20')](_0x53d5df,_0x59a904,!![]);}catch(_0x424415){return BPromise[_0x8ff5('0x21')](_0x424415);}return _0x53d5df[_0x8ff5('0x22')]();};}function saveUpdates(_0x145395,_0x347c3c){return function(_0x5a9d5f){if(_0x5a9d5f){return _0x5a9d5f[_0x8ff5('0x23')](_0x145395)[_0x8ff5('0x24')](function(_0x1692f1){return _0x1692f1;});}return null;};}function removeEntity(_0x34a6f1,_0x2ce2e7){return function(_0x5b2689){if(_0x5b2689){return _0x5b2689[_0x8ff5('0x25')]()['then'](function(){_0x34a6f1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15f7c4,_0x443a58){return function(_0x171358){if(!_0x171358){_0x15f7c4[_0x8ff5('0x18')](0x194);}return _0x171358;};}function handleError(_0x1983df,_0x524983){_0x524983=_0x524983||0x1f4;return function(_0x953f02){logger['error'](_0x953f02[_0x8ff5('0x26')]);if(_0x953f02['name']){delete _0x953f02[_0x8ff5('0x27')];}_0x1983df[_0x8ff5('0x19')](_0x524983)[_0x8ff5('0x28')](_0x953f02);};}exports[_0x8ff5('0x29')]=function(_0x132062,_0x4b4b44){var _0x78ff10={},_0x574afd={},_0x4ff319={'count':0x0,'rows':[]};var _0x3ef133=_[_0x8ff5('0x2a')](db[_0x8ff5('0x2b')][_0x8ff5('0x2c')],function(_0x3f6649){return{'name':_0x3f6649['fieldName'],'type':_0x3f6649[_0x8ff5('0x2d')][_0x8ff5('0x2e')]};});_0x574afd[_0x8ff5('0x2f')]=_[_0x8ff5('0x2a')](_0x3ef133,'name');_0x574afd[_0x8ff5('0x30')]=_[_0x8ff5('0x31')](_0x132062['query']);_0x574afd['filters']=_[_0x8ff5('0x32')](_0x574afd[_0x8ff5('0x2f')],_0x574afd['query']);_0x78ff10['attributes']=_[_0x8ff5('0x32')](_0x574afd[_0x8ff5('0x2f')],qs['fields'](_0x132062[_0x8ff5('0x30')][_0x8ff5('0x33')]));_0x78ff10[_0x8ff5('0x34')]=_0x78ff10['attributes']['length']?_0x78ff10['attributes']:_0x574afd[_0x8ff5('0x2f')];if(!_0x132062['query'][_0x8ff5('0x35')]('nolimit')){_0x78ff10[_0x8ff5('0x1c')]=qs[_0x8ff5('0x1c')](_0x132062[_0x8ff5('0x30')][_0x8ff5('0x1c')]);_0x78ff10[_0x8ff5('0x1b')]=qs[_0x8ff5('0x1b')](_0x132062['query']['offset']);}_0x78ff10['order']=qs[_0x8ff5('0x36')](_0x132062[_0x8ff5('0x30')][_0x8ff5('0x36')]);_0x78ff10[_0x8ff5('0x37')]=qs['filters'](_[_0x8ff5('0x38')](_0x132062[_0x8ff5('0x30')],_0x574afd['filters']),_0x3ef133);if(_0x132062[_0x8ff5('0x30')][_0x8ff5('0x39')]){_0x78ff10['where']=_[_0x8ff5('0x3a')](_0x78ff10['where'],{'$or':_[_0x8ff5('0x2a')](_0x3ef133,function(_0x3b55fe){if(_0x3b55fe[_0x8ff5('0x2d')]!=='VIRTUAL'){var _0x461a87={};_0x461a87[_0x3b55fe['name']]={'$like':'%'+_0x132062['query']['filter']+'%'};return _0x461a87;}})});}_0x78ff10=_['merge']({},_0x78ff10,_0x132062[_0x8ff5('0x3b')]);var _0x40796b={'where':_0x78ff10[_0x8ff5('0x37')]};return db[_0x8ff5('0x2b')][_0x8ff5('0x1a')](_0x40796b)['then'](function(_0x3a5ec7){_0x4ff319[_0x8ff5('0x1a')]=_0x3a5ec7;if(_0x132062['query']['includeAll']){_0x78ff10[_0x8ff5('0x3c')]=[{'all':!![]}];}return db[_0x8ff5('0x2b')][_0x8ff5('0x3d')](_0x78ff10);})[_0x8ff5('0x24')](function(_0xea44db){_0x4ff319[_0x8ff5('0x3e')]=_0xea44db;return _0x4ff319;})[_0x8ff5('0x24')](respondWithFilteredResult(_0x4b4b44,_0x78ff10))[_0x8ff5('0x3f')](handleError(_0x4b4b44,null));};exports[_0x8ff5('0x40')]=function(_0x2d1dd8,_0x2f8a47){var _0x52e7fd={'raw':!![],'where':{'id':_0x2d1dd8[_0x8ff5('0x41')]['id']}},_0x57a37b={};_0x57a37b[_0x8ff5('0x2f')]=_[_0x8ff5('0x31')](db[_0x8ff5('0x2b')][_0x8ff5('0x2c')]);_0x57a37b[_0x8ff5('0x30')]=_[_0x8ff5('0x31')](_0x2d1dd8[_0x8ff5('0x30')]);_0x57a37b['filters']=_[_0x8ff5('0x32')](_0x57a37b[_0x8ff5('0x2f')],_0x57a37b[_0x8ff5('0x30')]);_0x52e7fd['attributes']=_[_0x8ff5('0x32')](_0x57a37b[_0x8ff5('0x2f')],qs[_0x8ff5('0x33')](_0x2d1dd8[_0x8ff5('0x30')]['fields']));_0x52e7fd[_0x8ff5('0x34')]=_0x52e7fd['attributes'][_0x8ff5('0x42')]?_0x52e7fd[_0x8ff5('0x34')]:_0x57a37b[_0x8ff5('0x2f')];if(_0x2d1dd8[_0x8ff5('0x30')][_0x8ff5('0x43')]){_0x52e7fd['include']=[{'all':!![]}];}_0x52e7fd=_[_0x8ff5('0x3a')]({},_0x52e7fd,_0x2d1dd8[_0x8ff5('0x3b')]);return db[_0x8ff5('0x2b')][_0x8ff5('0x44')](_0x52e7fd)[_0x8ff5('0x24')](handleEntityNotFound(_0x2f8a47,null))[_0x8ff5('0x24')](respondWithResult(_0x2f8a47,null))[_0x8ff5('0x3f')](handleError(_0x2f8a47,null));};exports[_0x8ff5('0x45')]=function(_0x4c83c8,_0x5b4fae){return db[_0x8ff5('0x2b')]['create'](_0x4c83c8[_0x8ff5('0x46')],{})[_0x8ff5('0x24')](respondWithResult(_0x5b4fae,0xc9))[_0x8ff5('0x3f')](handleError(_0x5b4fae,null));};exports[_0x8ff5('0x23')]=function(_0x4abb8d,_0x11d879){if(_0x4abb8d['body']['id']){delete _0x4abb8d[_0x8ff5('0x46')]['id'];}return db[_0x8ff5('0x2b')][_0x8ff5('0x44')]({'where':{'id':_0x4abb8d['params']['id']}})[_0x8ff5('0x24')](handleEntityNotFound(_0x11d879,null))[_0x8ff5('0x24')](saveUpdates(_0x4abb8d[_0x8ff5('0x46')],null))['then'](respondWithResult(_0x11d879,null))[_0x8ff5('0x3f')](handleError(_0x11d879,null));};exports[_0x8ff5('0x25')]=function(_0x57eec9,_0xe0e14b){return db[_0x8ff5('0x2b')]['find']({'where':{'id':_0x57eec9[_0x8ff5('0x41')]['id']}})['then'](handleEntityNotFound(_0xe0e14b,null))[_0x8ff5('0x24')](removeEntity(_0xe0e14b,null))[_0x8ff5('0x3f')](handleError(_0xe0e14b,null));}; \ No newline at end of file +var _0x7995=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','update','then','destroy','end','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','VIRTUAL','merge','AnalyticTreeReport','includeAll','findAll','rows','catch','show','rawAttributes','include','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x50d059,_0x4bfc87){var _0x387988=function(_0x28c79f){while(--_0x28c79f){_0x50d059['push'](_0x50d059['shift']());}};_0x387988(++_0x4bfc87);}(_0x7995,0xd3));var _0x5799=function(_0x2406c6,_0x3a8996){_0x2406c6=_0x2406c6-0x0;var _0xef14dd=_0x7995[_0x2406c6];return _0xef14dd;};'use strict';var emlformat=require(_0x5799('0x0'));var rimraf=require(_0x5799('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5799('0x2'));var rp=require(_0x5799('0x3'));var moment=require(_0x5799('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5799('0x5'));var util=require(_0x5799('0x6'));var path=require(_0x5799('0x7'));var sox=require(_0x5799('0x8'));var csv=require(_0x5799('0x9'));var ejs=require(_0x5799('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5799('0xb'));var squel=require(_0x5799('0xc'));var crypto=require(_0x5799('0xd'));var jsforce=require(_0x5799('0xe'));var deskjs=require(_0x5799('0xf'));var toCsv=require(_0x5799('0x9'));var querystring=require(_0x5799('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5799('0x11'));var qs=require(_0x5799('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5799('0x13'));var logger=require(_0x5799('0x14'))(_0x5799('0x15'));var utils=require(_0x5799('0x16'));var config=require(_0x5799('0x17'));var licenseUtil=require(_0x5799('0x18'));var db=require(_0x5799('0x19'))['db'];function respondWithStatusCode(_0x16eff8,_0x515a5b){_0x515a5b=_0x515a5b||0xcc;return function(_0x337ef8){if(_0x337ef8){return _0x16eff8[_0x5799('0x1a')](_0x515a5b);}return _0x16eff8[_0x5799('0x1b')](_0x515a5b)['end']();};}function respondWithResult(_0x2cfc80,_0x276754){_0x276754=_0x276754||0xc8;return function(_0x27888b){if(_0x27888b){return _0x2cfc80['status'](_0x276754)[_0x5799('0x1c')](_0x27888b);}};}function respondWithFilteredResult(_0x2368fb,_0x304c2a){return function(_0x5aa2bc){if(_0x5aa2bc){var _0x168d63=_0x5aa2bc[_0x5799('0x1d')],_0x1d8028=_0x304c2a[_0x5799('0x1e')],_0x4bf898=_0x304c2a[_0x5799('0x1e')]+_0x304c2a['limit'],_0x28d476;if(_0x4bf898>=_0x168d63){_0x4bf898=_0x168d63;_0x28d476=0xc8;}else{_0x28d476=0xce;}_0x2368fb['status'](_0x28d476);return _0x2368fb['set'](_0x5799('0x1f'),_0x1d8028+'-'+_0x4bf898+'/'+_0x168d63)['json'](_0x5aa2bc);}return null;};}function patchUpdates(_0xb25a24){return function(_0x17cbd4){try{jsonpatch[_0x5799('0x20')](_0x17cbd4,_0xb25a24,!![]);}catch(_0x4b1d5a){return BPromise[_0x5799('0x21')](_0x4b1d5a);}return _0x17cbd4['save']();};}function saveUpdates(_0x22c0b9,_0x2d293c){return function(_0x25acff){if(_0x25acff){return _0x25acff[_0x5799('0x22')](_0x22c0b9)[_0x5799('0x23')](function(_0x339cb3){return _0x339cb3;});}return null;};}function removeEntity(_0x4d1c38,_0x3b05b4){return function(_0x355801){if(_0x355801){return _0x355801[_0x5799('0x24')]()[_0x5799('0x23')](function(){_0x4d1c38[_0x5799('0x1b')](0xcc)[_0x5799('0x25')]();});}};}function handleEntityNotFound(_0x5a34e5,_0x2f9302){return function(_0x42007c){if(!_0x42007c){_0x5a34e5[_0x5799('0x1a')](0x194);}return _0x42007c;};}function handleError(_0x56f227,_0x33319e){_0x33319e=_0x33319e||0x1f4;return function(_0x52326f){logger[_0x5799('0x26')](_0x52326f['stack']);if(_0x52326f[_0x5799('0x27')]){delete _0x52326f[_0x5799('0x27')];}_0x56f227['status'](_0x33319e)[_0x5799('0x28')](_0x52326f);};}exports[_0x5799('0x29')]=function(_0x145682,_0x28a830){var _0x4b8f1b={},_0x24d665={},_0x22e2cc={'count':0x0,'rows':[]};var _0x1dc96a=_['map'](db['AnalyticTreeReport']['rawAttributes'],function(_0x55343f){return{'name':_0x55343f[_0x5799('0x2a')],'type':_0x55343f[_0x5799('0x2b')][_0x5799('0x2c')]};});_0x24d665[_0x5799('0x2d')]=_[_0x5799('0x2e')](_0x1dc96a,'name');_0x24d665[_0x5799('0x2f')]=_[_0x5799('0x30')](_0x145682[_0x5799('0x2f')]);_0x24d665[_0x5799('0x31')]=_[_0x5799('0x32')](_0x24d665[_0x5799('0x2d')],_0x24d665[_0x5799('0x2f')]);_0x4b8f1b['attributes']=_[_0x5799('0x32')](_0x24d665[_0x5799('0x2d')],qs[_0x5799('0x33')](_0x145682[_0x5799('0x2f')][_0x5799('0x33')]));_0x4b8f1b[_0x5799('0x34')]=_0x4b8f1b[_0x5799('0x34')][_0x5799('0x35')]?_0x4b8f1b[_0x5799('0x34')]:_0x24d665[_0x5799('0x2d')];if(!_0x145682[_0x5799('0x2f')][_0x5799('0x36')](_0x5799('0x37'))){_0x4b8f1b[_0x5799('0x38')]=qs[_0x5799('0x38')](_0x145682[_0x5799('0x2f')][_0x5799('0x38')]);_0x4b8f1b[_0x5799('0x1e')]=qs[_0x5799('0x1e')](_0x145682[_0x5799('0x2f')][_0x5799('0x1e')]);}_0x4b8f1b[_0x5799('0x39')]=qs['sort'](_0x145682[_0x5799('0x2f')][_0x5799('0x3a')]);_0x4b8f1b['where']=qs[_0x5799('0x31')](_['pick'](_0x145682[_0x5799('0x2f')],_0x24d665[_0x5799('0x31')]),_0x1dc96a);if(_0x145682[_0x5799('0x2f')][_0x5799('0x3b')]){_0x4b8f1b[_0x5799('0x3c')]=_['merge'](_0x4b8f1b[_0x5799('0x3c')],{'$or':_['map'](_0x1dc96a,function(_0x5286c8){if(_0x5286c8[_0x5799('0x2b')]!==_0x5799('0x3d')){var _0x1e641d={};_0x1e641d[_0x5286c8['name']]={'$like':'%'+_0x145682[_0x5799('0x2f')][_0x5799('0x3b')]+'%'};return _0x1e641d;}})});}_0x4b8f1b=_[_0x5799('0x3e')]({},_0x4b8f1b,_0x145682['options']);var _0x38eb01={'where':_0x4b8f1b['where']};return db[_0x5799('0x3f')][_0x5799('0x1d')](_0x38eb01)[_0x5799('0x23')](function(_0x1bc136){_0x22e2cc[_0x5799('0x1d')]=_0x1bc136;if(_0x145682[_0x5799('0x2f')][_0x5799('0x40')]){_0x4b8f1b['include']=[{'all':!![]}];}return db[_0x5799('0x3f')][_0x5799('0x41')](_0x4b8f1b);})[_0x5799('0x23')](function(_0x2d9ec9){_0x22e2cc[_0x5799('0x42')]=_0x2d9ec9;return _0x22e2cc;})[_0x5799('0x23')](respondWithFilteredResult(_0x28a830,_0x4b8f1b))[_0x5799('0x43')](handleError(_0x28a830,null));};exports[_0x5799('0x44')]=function(_0x106027,_0x45f7d9){var _0x3db009={'raw':!![],'where':{'id':_0x106027['params']['id']}},_0x4aeef6={};_0x4aeef6['model']=_['keys'](db['AnalyticTreeReport'][_0x5799('0x45')]);_0x4aeef6[_0x5799('0x2f')]=_[_0x5799('0x30')](_0x106027[_0x5799('0x2f')]);_0x4aeef6[_0x5799('0x31')]=_[_0x5799('0x32')](_0x4aeef6[_0x5799('0x2d')],_0x4aeef6[_0x5799('0x2f')]);_0x3db009[_0x5799('0x34')]=_['intersection'](_0x4aeef6[_0x5799('0x2d')],qs['fields'](_0x106027[_0x5799('0x2f')][_0x5799('0x33')]));_0x3db009[_0x5799('0x34')]=_0x3db009[_0x5799('0x34')][_0x5799('0x35')]?_0x3db009[_0x5799('0x34')]:_0x4aeef6['model'];if(_0x106027[_0x5799('0x2f')][_0x5799('0x40')]){_0x3db009[_0x5799('0x46')]=[{'all':!![]}];}_0x3db009=_[_0x5799('0x3e')]({},_0x3db009,_0x106027[_0x5799('0x47')]);return db[_0x5799('0x3f')][_0x5799('0x48')](_0x3db009)[_0x5799('0x23')](handleEntityNotFound(_0x45f7d9,null))['then'](respondWithResult(_0x45f7d9,null))['catch'](handleError(_0x45f7d9,null));};exports[_0x5799('0x49')]=function(_0x391632,_0x531be7){return db[_0x5799('0x3f')][_0x5799('0x49')](_0x391632[_0x5799('0x4a')],{})[_0x5799('0x23')](respondWithResult(_0x531be7,0xc9))[_0x5799('0x43')](handleError(_0x531be7,null));};exports['update']=function(_0x5dc581,_0x18979a){if(_0x5dc581[_0x5799('0x4a')]['id']){delete _0x5dc581[_0x5799('0x4a')]['id'];}return db['AnalyticTreeReport'][_0x5799('0x48')]({'where':{'id':_0x5dc581[_0x5799('0x4b')]['id']}})[_0x5799('0x23')](handleEntityNotFound(_0x18979a,null))[_0x5799('0x23')](saveUpdates(_0x5dc581[_0x5799('0x4a')],null))['then'](respondWithResult(_0x18979a,null))[_0x5799('0x43')](handleError(_0x18979a,null));};exports[_0x5799('0x24')]=function(_0x598594,_0x1d0366){return db[_0x5799('0x3f')]['find']({'where':{'id':_0x598594[_0x5799('0x4b')]['id']}})[_0x5799('0x23')](handleEntityNotFound(_0x1d0366,null))[_0x5799('0x23')](removeEntity(_0x1d0366,null))[_0x5799('0x43')](handleError(_0x1d0366,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 341291e..988f54a 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 _0xa817=['api','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x3fcc20,_0x57c31b){var _0x15d3ce=function(_0x575619){while(--_0x575619){_0x3fcc20['push'](_0x3fcc20['shift']());}};_0x15d3ce(++_0x57c31b);}(_0xa817,0x7b));var _0x7a81=function(_0x4a9c2a,_0x516745){_0x4a9c2a=_0x4a9c2a-0x0;var _0x36e7d0=_0xa817[_0x4a9c2a];return _0x36e7d0;};'use strict';var _=require(_0x7a81('0x0'));var util=require(_0x7a81('0x1'));var logger=require(_0x7a81('0x2'))(_0x7a81('0x3'));var moment=require(_0x7a81('0x4'));var BPromise=require(_0x7a81('0x5'));var rp=require(_0x7a81('0x6'));var fs=require('fs');var path=require(_0x7a81('0x7'));var rimraf=require(_0x7a81('0x8'));var config=require('../../config/environment');var attributes=require(_0x7a81('0x9'));module[_0x7a81('0xa')]=function(_0x5bf69b,_0x2249d1){return _0x5bf69b[_0x7a81('0xb')](_0x7a81('0xc'),attributes,{'tableName':_0x7a81('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ab1=['define','AnalyticTreeReport','analytics_report_trees','lodash','api','path','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x37abe3,_0x3029b0){var _0x594f22=function(_0x6f6568){while(--_0x6f6568){_0x37abe3['push'](_0x37abe3['shift']());}};_0x594f22(++_0x3029b0);}(_0x1ab1,0x12c));var _0x11ab=function(_0x299837,_0x4b01b2){_0x299837=_0x299837-0x0;var _0xc2019d=_0x1ab1[_0x299837];return _0xc2019d;};'use strict';var _=require(_0x11ab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x11ab('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x11ab('0x2'));var rimraf=require('rimraf');var config=require(_0x11ab('0x3'));var attributes=require(_0x11ab('0x4'));module[_0x11ab('0x5')]=function(_0x1399f4,_0x5758c5){return _0x1399f4[_0x11ab('0x6')](_0x11ab('0x7'),attributes,{'tableName':_0x11ab('0x8'),'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 52b6e8c..0c714b5 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 _0xfdaf=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash'];(function(_0x3cc1b0,_0x1875ba){var _0x7ce73c=function(_0x3bf195){while(--_0x3bf195){_0x3cc1b0['push'](_0x3cc1b0['shift']());}};_0x7ce73c(++_0x1875ba);}(_0xfdaf,0xbc));var _0xffda=function(_0x3b99de,_0x273b72){_0x3b99de=_0x3b99de-0x0;var _0x23c676=_0xfdaf[_0x3b99de];return _0x23c676;};'use strict';var _=require(_0xffda('0x0'));var util=require(_0xffda('0x1'));var moment=require(_0xffda('0x2'));var BPromise=require(_0xffda('0x3'));var rs=require(_0xffda('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffda('0x5'))['db'];var utils=require(_0xffda('0x6'));var logger=require(_0xffda('0x7'))(_0xffda('0x8'));var config=require(_0xffda('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x443d5e,_0x498aa6,_0x3aa7d5){return new BPromise(function(_0x36b129,_0x4a5ad8){return client[_0xffda('0xa')](_0x443d5e,_0x3aa7d5)['then'](function(_0x30ce84){logger[_0xffda('0xb')](_0xffda('0xc'),_0x498aa6,'request\x20sent');logger[_0xffda('0xd')](_0xffda('0xe'),_0x498aa6,'request\x20sent',JSON[_0xffda('0xf')](_0x30ce84));if(_0x30ce84[_0xffda('0x10')]){if(_0x30ce84[_0xffda('0x10')]['code']===0x1f4){logger[_0xffda('0x10')](_0xffda('0xc'),_0x498aa6,_0x30ce84[_0xffda('0x10')][_0xffda('0x11')]);return _0x4a5ad8(_0x30ce84['error'][_0xffda('0x11')]);}logger[_0xffda('0x10')](_0xffda('0xc'),_0x498aa6,_0x30ce84[_0xffda('0x10')]['message']);return _0x36b129(_0x30ce84['error'][_0xffda('0x11')]);}else{logger[_0xffda('0xb')]('AnalyticTreeReport,\x20%s,\x20%s',_0x498aa6,_0xffda('0x12'));_0x36b129(_0x30ce84[_0xffda('0x13')][_0xffda('0x11')]);}})[_0xffda('0x14')](function(_0xb7ef46){logger[_0xffda('0x10')](_0xffda('0xc'),_0x498aa6,_0xb7ef46);_0x4a5ad8(_0xb7ef46);});});} \ No newline at end of file +var _0x7c5d=['../../mysqldb','../../config/logger','rpc','http','request','then','info','request\x20sent','stringify','error','AnalyticTreeReport,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x3c9c2e,_0x1e7d40){var _0x269196=function(_0x1cb3c7){while(--_0x1cb3c7){_0x3c9c2e['push'](_0x3c9c2e['shift']());}};_0x269196(++_0x1e7d40);}(_0x7c5d,0xb0));var _0xd7c5=function(_0x5644aa,_0x44fbd4){_0x5644aa=_0x5644aa-0x0;var _0x1d4024=_0x7c5d[_0x5644aa];return _0x1d4024;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd7c5('0x0'));var BPromise=require(_0xd7c5('0x1'));var rs=require(_0xd7c5('0x2'));var fs=require('fs');var Redis=require(_0xd7c5('0x3'));var db=require(_0xd7c5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd7c5('0x5'))(_0xd7c5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd7c5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a0629,_0x17bf07,_0x1f558a){return new BPromise(function(_0xc28415,_0x21dc59){return client[_0xd7c5('0x8')](_0x1a0629,_0x1f558a)[_0xd7c5('0x9')](function(_0x106548){logger[_0xd7c5('0xa')]('AnalyticTreeReport,\x20%s,\x20%s',_0x17bf07,_0xd7c5('0xb'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x17bf07,'request\x20sent',JSON[_0xd7c5('0xc')](_0x106548));if(_0x106548[_0xd7c5('0xd')]){if(_0x106548[_0xd7c5('0xd')]['code']===0x1f4){logger[_0xd7c5('0xd')](_0xd7c5('0xe'),_0x17bf07,_0x106548['error'][_0xd7c5('0xf')]);return _0x21dc59(_0x106548['error']['message']);}logger['error'](_0xd7c5('0xe'),_0x17bf07,_0x106548[_0xd7c5('0xd')][_0xd7c5('0xf')]);return _0xc28415(_0x106548[_0xd7c5('0xd')]['message']);}else{logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0x17bf07,_0xd7c5('0xb'));_0xc28415(_0x106548[_0xd7c5('0x10')]['message']);}})[_0xd7c5('0x11')](function(_0x10d184){logger[_0xd7c5('0xd')](_0xd7c5('0xe'),_0x17bf07,_0x10d184);_0x21dc59(_0x10d184);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index f713a6f..e64edb4 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 _0xf3b2=['connect-timeout','express','Router','fs-extra','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','destroy','multer','path'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0xf3b2,0x152));var _0x2f3b=function(_0x233e6f,_0x4019ac){_0x233e6f=_0x233e6f-0x0;var _0x1deeb0=_0xf3b2[_0x233e6f];return _0x1deeb0;};'use strict';var multer=require(_0x2f3b('0x0'));var util=require('util');var path=require(_0x2f3b('0x1'));var timeout=require(_0x2f3b('0x2'));var express=require(_0x2f3b('0x3'));var router=express[_0x2f3b('0x4')]();var fs_extra=require(_0x2f3b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2f3b('0x6'));var controller=require(_0x2f3b('0x7'));router['get']('/',auth[_0x2f3b('0x8')](),controller[_0x2f3b('0x9')]);router[_0x2f3b('0xa')](_0x2f3b('0xb'),auth[_0x2f3b('0x8')](),controller[_0x2f3b('0xc')]);router[_0x2f3b('0xd')]('/',auth[_0x2f3b('0x8')](),controller[_0x2f3b('0xe')]);router[_0x2f3b('0xf')]('/:id',auth[_0x2f3b('0x8')](),controller['update']);router['delete'](_0x2f3b('0xb'),auth[_0x2f3b('0x8')](),controller[_0x2f3b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x9c5e=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','/:id','update'];(function(_0x1ce595,_0x1069cb){var _0x525dfe=function(_0xeee00a){while(--_0xeee00a){_0x1ce595['push'](_0x1ce595['shift']());}};_0x525dfe(++_0x1069cb);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x130c43,_0x4b4fa8){_0x130c43=_0x130c43-0x0;var _0x1951e0=_0x9c5e[_0x130c43];return _0x1951e0;};'use strict';var multer=require(_0xe9c5('0x0'));var util=require(_0xe9c5('0x1'));var path=require(_0xe9c5('0x2'));var timeout=require(_0xe9c5('0x3'));var express=require(_0xe9c5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe9c5('0x5'));var config=require(_0xe9c5('0x6'));var controller=require('./analyticTreeReport.controller');router[_0xe9c5('0x7')]('/',auth[_0xe9c5('0x8')](),controller[_0xe9c5('0x9')]);router[_0xe9c5('0x7')]('/:id',auth[_0xe9c5('0x8')](),controller[_0xe9c5('0xa')]);router[_0xe9c5('0xb')]('/',auth[_0xe9c5('0x8')](),controller['create']);router['put'](_0xe9c5('0xc'),auth[_0xe9c5('0x8')](),controller[_0xe9c5('0xd')]);router[_0xe9c5('0xe')](_0xe9c5('0xc'),auth[_0xe9c5('0x8')](),controller[_0xe9c5('0xf')]);module[_0xe9c5('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 07436b1..fa5e603 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 _0x32fb=['STRING','exports'];(function(_0x24f5b3,_0x343539){var _0x57873f=function(_0xe7590a){while(--_0xe7590a){_0x24f5b3['push'](_0x24f5b3['shift']());}};_0x57873f(++_0x343539);}(_0x32fb,0x1af));var _0xb32f=function(_0x8df43f,_0x43f979){_0x8df43f=_0x8df43f-0x0;var _0x53c055=_0x32fb[_0x8df43f];return _0x53c055;};'use strict';var Sequelize=require('sequelize');module[_0xb32f('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xb32f('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf634=['sequelize','STRING'];(function(_0x5a5339,_0x37b299){var _0x1a69c4=function(_0x90c26b){while(--_0x90c26b){_0x5a5339['push'](_0x5a5339['shift']());}};_0x1a69c4(++_0x37b299);}(_0xf634,0xb2));var _0x4f63=function(_0x2d8201,_0x4d82e6){_0x2d8201=_0x2d8201-0x0;var _0x55a389=_0xf634[_0x2d8201];return _0x55a389;};'use strict';var Sequelize=require(_0x4f63('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f63('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4f63('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 5db56da..8e1acfb 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 _0x0a0d=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','Attachment','fieldName','key','model','map','keys','query','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','options','include','findAll','rows','catch','show','params','includeAll','merge','find','clone','rawAttributes','get','omit','createdAt','updatedAt','body','create','destroy','file','basename','filename','mimetype','findOne','join','root','server/files/attachments/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x314620,_0x266101){var _0x2022f8=function(_0x1a79de){while(--_0x1a79de){_0x314620['push'](_0x314620['shift']());}};_0x2022f8(++_0x266101);}(_0x0a0d,0xf7));var _0xd0a0=function(_0x1fd437,_0x2c0b47){_0x1fd437=_0x1fd437-0x0;var _0x40d9e6=_0x0a0d[_0x1fd437];return _0x40d9e6;};'use strict';var emlformat=require(_0xd0a0('0x0'));var rimraf=require(_0xd0a0('0x1'));var zipdir=require(_0xd0a0('0x2'));var jsonpatch=require(_0xd0a0('0x3'));var rp=require(_0xd0a0('0x4'));var moment=require(_0xd0a0('0x5'));var BPromise=require(_0xd0a0('0x6'));var Mustache=require(_0xd0a0('0x7'));var util=require('util');var path=require(_0xd0a0('0x8'));var sox=require(_0xd0a0('0x9'));var csv=require(_0xd0a0('0xa'));var ejs=require(_0xd0a0('0xb'));var fs=require('fs');var fs_extra=require(_0xd0a0('0xc'));var _=require(_0xd0a0('0xd'));var squel=require(_0xd0a0('0xe'));var crypto=require(_0xd0a0('0xf'));var jsforce=require(_0xd0a0('0x10'));var deskjs=require(_0xd0a0('0x11'));var toCsv=require(_0xd0a0('0xa'));var querystring=require('querystring');var Papa=require(_0xd0a0('0x12'));var Redis=require(_0xd0a0('0x13'));var authService=require(_0xd0a0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd0a0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0a0('0x16'))(_0xd0a0('0x17'));var utils=require('../../config/utils');var config=require(_0xd0a0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd0a0('0x19'))['db'];function respondWithStatusCode(_0x49173f,_0x10b0a4){_0x10b0a4=_0x10b0a4||0xcc;return function(_0x55b9ae){if(_0x55b9ae){return _0x49173f[_0xd0a0('0x1a')](_0x10b0a4);}return _0x49173f['status'](_0x10b0a4)[_0xd0a0('0x1b')]();};}function respondWithResult(_0x503b79,_0x5c7feb){_0x5c7feb=_0x5c7feb||0xc8;return function(_0x22e605){if(_0x22e605){return _0x503b79['status'](_0x5c7feb)['json'](_0x22e605);}};}function respondWithFilteredResult(_0x8ae811,_0x6136c){return function(_0x5d36dd){if(_0x5d36dd){var _0x2943fc=_0x5d36dd[_0xd0a0('0x1c')],_0x3d2d9b=_0x6136c[_0xd0a0('0x1d')],_0x9ca3b6=_0x6136c[_0xd0a0('0x1d')]+_0x6136c[_0xd0a0('0x1e')],_0x742705;if(_0x9ca3b6>=_0x2943fc){_0x9ca3b6=_0x2943fc;_0x742705=0xc8;}else{_0x742705=0xce;}_0x8ae811[_0xd0a0('0x1f')](_0x742705);return _0x8ae811[_0xd0a0('0x20')](_0xd0a0('0x21'),_0x3d2d9b+'-'+_0x9ca3b6+'/'+_0x2943fc)['json'](_0x5d36dd);}return null;};}function patchUpdates(_0x331788){return function(_0x53c028){try{jsonpatch[_0xd0a0('0x22')](_0x53c028,_0x331788,!![]);}catch(_0x2e7200){return BPromise[_0xd0a0('0x23')](_0x2e7200);}return _0x53c028[_0xd0a0('0x24')]();};}function saveUpdates(_0x1f4bfa,_0x343f74){return function(_0x47741b){if(_0x47741b){return _0x47741b[_0xd0a0('0x25')](_0x1f4bfa)[_0xd0a0('0x26')](function(_0x2f4656){return _0x2f4656;});}return null;};}function removeEntity(_0x29c4f9,_0x2c1be7){return function(_0x150009){if(_0x150009){return _0x150009['destroy']()['then'](function(){_0x29c4f9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x340110,_0x3a27f5){return function(_0x5de5ee){if(!_0x5de5ee){_0x340110[_0xd0a0('0x1a')](0x194);}return _0x5de5ee;};}function handleError(_0x5d3e80,_0xd6d682){_0xd6d682=_0xd6d682||0x1f4;return function(_0x3b8798){logger[_0xd0a0('0x27')](_0x3b8798[_0xd0a0('0x28')]);if(_0x3b8798[_0xd0a0('0x29')]){delete _0x3b8798[_0xd0a0('0x29')];}_0x5d3e80[_0xd0a0('0x1f')](_0xd6d682)[_0xd0a0('0x2a')](_0x3b8798);};}exports['index']=function(_0xa271eb,_0x3d6ffd){var _0x494a7f={},_0x12bb17={},_0x198967={'count':0x0,'rows':[]};var _0x1743e6=_['map'](db[_0xd0a0('0x2b')]['rawAttributes'],function(_0x54bb3f){return{'name':_0x54bb3f[_0xd0a0('0x2c')],'type':_0x54bb3f['type'][_0xd0a0('0x2d')]};});_0x12bb17[_0xd0a0('0x2e')]=_[_0xd0a0('0x2f')](_0x1743e6,_0xd0a0('0x29'));_0x12bb17['query']=_[_0xd0a0('0x30')](_0xa271eb[_0xd0a0('0x31')]);_0x12bb17['filters']=_[_0xd0a0('0x32')](_0x12bb17[_0xd0a0('0x2e')],_0x12bb17[_0xd0a0('0x31')]);_0x494a7f[_0xd0a0('0x33')]=_[_0xd0a0('0x32')](_0x12bb17[_0xd0a0('0x2e')],qs['fields'](_0xa271eb[_0xd0a0('0x31')][_0xd0a0('0x34')]));_0x494a7f['attributes']=_0x494a7f['attributes'][_0xd0a0('0x35')]?_0x494a7f[_0xd0a0('0x33')]:_0x12bb17['model'];if(!_0xa271eb['query']['hasOwnProperty']('nolimit')){_0x494a7f[_0xd0a0('0x1e')]=qs[_0xd0a0('0x1e')](_0xa271eb[_0xd0a0('0x31')]['limit']);_0x494a7f['offset']=qs['offset'](_0xa271eb[_0xd0a0('0x31')][_0xd0a0('0x1d')]);}_0x494a7f[_0xd0a0('0x36')]=qs[_0xd0a0('0x37')](_0xa271eb['query'][_0xd0a0('0x37')]);_0x494a7f[_0xd0a0('0x38')]=qs['filters'](_[_0xd0a0('0x39')](_0xa271eb[_0xd0a0('0x31')],_0x12bb17[_0xd0a0('0x3a')]),_0x1743e6);if(_0xa271eb[_0xd0a0('0x31')][_0xd0a0('0x3b')]){_0x494a7f['where']=_['merge'](_0x494a7f[_0xd0a0('0x38')],{'$or':_[_0xd0a0('0x2f')](_0x1743e6,function(_0x10b563){if(_0x10b563['type']!=='VIRTUAL'){var _0x486ad8={};_0x486ad8[_0x10b563[_0xd0a0('0x29')]]={'$like':'%'+_0xa271eb[_0xd0a0('0x31')]['filter']+'%'};return _0x486ad8;}})});}_0x494a7f=_['merge']({},_0x494a7f,_0xa271eb[_0xd0a0('0x3c')]);var _0x412cf9={'where':_0x494a7f[_0xd0a0('0x38')]};return db[_0xd0a0('0x2b')][_0xd0a0('0x1c')](_0x412cf9)['then'](function(_0x3e1dac){_0x198967[_0xd0a0('0x1c')]=_0x3e1dac;if(_0xa271eb['query']['includeAll']){_0x494a7f[_0xd0a0('0x3d')]=[{'all':!![]}];}return db['Attachment'][_0xd0a0('0x3e')](_0x494a7f);})[_0xd0a0('0x26')](function(_0x44d8ec){_0x198967[_0xd0a0('0x3f')]=_0x44d8ec;return _0x198967;})[_0xd0a0('0x26')](respondWithFilteredResult(_0x3d6ffd,_0x494a7f))[_0xd0a0('0x40')](handleError(_0x3d6ffd,null));};exports[_0xd0a0('0x41')]=function(_0xc85c28,_0x2e95f5){var _0x7365fe={'raw':!![],'where':{'id':_0xc85c28[_0xd0a0('0x42')]['id']}},_0x316ca8={};_0x316ca8[_0xd0a0('0x2e')]=_[_0xd0a0('0x30')](db[_0xd0a0('0x2b')]['rawAttributes']);_0x316ca8[_0xd0a0('0x31')]=_['keys'](_0xc85c28[_0xd0a0('0x31')]);_0x316ca8[_0xd0a0('0x3a')]=_[_0xd0a0('0x32')](_0x316ca8['model'],_0x316ca8[_0xd0a0('0x31')]);_0x7365fe[_0xd0a0('0x33')]=_[_0xd0a0('0x32')](_0x316ca8[_0xd0a0('0x2e')],qs[_0xd0a0('0x34')](_0xc85c28['query'][_0xd0a0('0x34')]));_0x7365fe[_0xd0a0('0x33')]=_0x7365fe[_0xd0a0('0x33')]['length']?_0x7365fe[_0xd0a0('0x33')]:_0x316ca8[_0xd0a0('0x2e')];if(_0xc85c28[_0xd0a0('0x31')][_0xd0a0('0x43')]){_0x7365fe['include']=[{'all':!![]}];}_0x7365fe=_[_0xd0a0('0x44')]({},_0x7365fe,_0xc85c28[_0xd0a0('0x3c')]);return db[_0xd0a0('0x2b')][_0xd0a0('0x45')](_0x7365fe)[_0xd0a0('0x26')](handleEntityNotFound(_0x2e95f5,null))[_0xd0a0('0x26')](respondWithResult(_0x2e95f5,null))[_0xd0a0('0x40')](handleError(_0x2e95f5,null));};exports[_0xd0a0('0x46')]=function(_0x5c095b,_0x2a5edc){var _0x4e1a93={'where':{'id':_0x5c095b[_0xd0a0('0x42')]['id']}},_0x4bf6f4={};_0x4bf6f4['model']=_[_0xd0a0('0x30')](db[_0xd0a0('0x2b')][_0xd0a0('0x47')]);_0x4e1a93[_0xd0a0('0x33')]=_['intersection'](_0x4bf6f4[_0xd0a0('0x2e')],qs[_0xd0a0('0x34')](_0x5c095b['query']['fields']));_0x4e1a93[_0xd0a0('0x33')]=_0x4e1a93['attributes']['length']?_0x4e1a93['attributes']:_0x4bf6f4[_0xd0a0('0x2e')];if(_0x5c095b[_0xd0a0('0x31')][_0xd0a0('0x43')]){_0x4e1a93[_0xd0a0('0x3d')]=[{'all':!![]}];}_0x4e1a93=_[_0xd0a0('0x44')]({},_0x4e1a93,_0x5c095b[_0xd0a0('0x3c')]);return db[_0xd0a0('0x2b')][_0xd0a0('0x45')](_0x4e1a93)[_0xd0a0('0x26')](handleEntityNotFound(_0x2a5edc,null))[_0xd0a0('0x26')](function(_0x3e4b9c){if(_0x3e4b9c){var _0x4bae4a=_0x3e4b9c[_0xd0a0('0x48')]({'plain':!![]});_0x4bae4a=qs[_0xd0a0('0x49')](_0x4bae4a,['id',_0xd0a0('0x4a'),_0xd0a0('0x4b')]);_0x5c095b[_0xd0a0('0x4c')]=_[_0xd0a0('0x49')](_0x5c095b[_0xd0a0('0x4c')],['id',_0xd0a0('0x4a'),_0xd0a0('0x4b')]);return db[_0xd0a0('0x2b')][_0xd0a0('0x4d')](_[_0xd0a0('0x44')](_0x4bae4a,_0x5c095b[_0xd0a0('0x4c')]),{'include':_0x5c095b[_0xd0a0('0x31')][_0xd0a0('0x43')]?[{'all':!![]}]:undefined});}})[_0xd0a0('0x26')](respondWithResult(_0x2a5edc,0xc9))[_0xd0a0('0x40')](handleError(_0x2a5edc,null));};exports[_0xd0a0('0x25')]=function(_0x5f5a5e,_0x7b3020){if(_0x5f5a5e['body']['id']){delete _0x5f5a5e[_0xd0a0('0x4c')]['id'];}return db['Attachment']['find']({'where':{'id':_0x5f5a5e[_0xd0a0('0x42')]['id']}})['then'](handleEntityNotFound(_0x7b3020,null))[_0xd0a0('0x26')](saveUpdates(_0x5f5a5e['body'],null))[_0xd0a0('0x26')](respondWithResult(_0x7b3020,null))[_0xd0a0('0x40')](handleError(_0x7b3020,null));};exports[_0xd0a0('0x4e')]=function(_0x2fb30a,_0xcf322b){return db['Attachment'][_0xd0a0('0x45')]({'where':{'id':_0x2fb30a[_0xd0a0('0x42')]['id']}})['then'](handleEntityNotFound(_0xcf322b,null))[_0xd0a0('0x26')](removeEntity(_0xcf322b,null))[_0xd0a0('0x40')](handleError(_0xcf322b,null));};exports[_0xd0a0('0x4d')]=function(_0x51270b,_0x8e5b53,_0xf0bad2){_0x51270b['body'][_0xd0a0('0x29')]=_0x51270b[_0xd0a0('0x4f')]['originalname'];_0x51270b['body'][_0xd0a0('0x50')]=_0x51270b[_0xd0a0('0x4f')][_0xd0a0('0x51')];_0x51270b[_0xd0a0('0x4c')]['type']=_0x51270b[_0xd0a0('0x4f')][_0xd0a0('0x52')];return db[_0xd0a0('0x2b')][_0xd0a0('0x4d')](_0x51270b[_0xd0a0('0x4c')])[_0xd0a0('0x26')](respondWithResult(_0x8e5b53,0xc9))[_0xd0a0('0x40')](handleError(_0x8e5b53,null));};exports['download']=function(_0x16c41b,_0x2d5317,_0x53c71a){return db[_0xd0a0('0x2b')][_0xd0a0('0x53')]({'where':{'id':_0x16c41b[_0xd0a0('0x42')]['id']},'raw':!![]})[_0xd0a0('0x26')](handleEntityNotFound(_0x2d5317,null))[_0xd0a0('0x26')](function(_0x8fc6e1){if(_0x8fc6e1){var _0xf9ee33=_0x8fc6e1['ChatOfflineMessageId']!==null;var _0x39d906=path[_0xd0a0('0x54')](config[_0xd0a0('0x55')],_0xd0a0('0x56'));if(_0xf9ee33){_0x39d906=path[_0xd0a0('0x54')](_0x39d906,'offline-chat/');}var _0x650337=path[_0xd0a0('0x54')](_0x39d906,_0x8fc6e1[_0xd0a0('0x50')]);return _0x2d5317[_0xd0a0('0x57')](_0x650337);}})[_0xd0a0('0x40')](handleError(_0x2d5317,null));}; \ No newline at end of file +var _0x9eae=['root','server/files/attachments/','offline-chat/','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','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','Attachment','includeAll','include','findAll','rows','catch','show','params','find','clone','omit','createdAt','body','create','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join'];(function(_0xc88f3b,_0x16907a){var _0x36e99f=function(_0x55609f){while(--_0x55609f){_0xc88f3b['push'](_0xc88f3b['shift']());}};_0x36e99f(++_0x16907a);}(_0x9eae,0x15f));var _0xe9ea=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9eae[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xe9ea('0x0'));var rimraf=require(_0xe9ea('0x1'));var zipdir=require(_0xe9ea('0x2'));var jsonpatch=require(_0xe9ea('0x3'));var rp=require('request-promise');var moment=require(_0xe9ea('0x4'));var BPromise=require(_0xe9ea('0x5'));var Mustache=require(_0xe9ea('0x6'));var util=require(_0xe9ea('0x7'));var path=require(_0xe9ea('0x8'));var sox=require(_0xe9ea('0x9'));var csv=require(_0xe9ea('0xa'));var ejs=require(_0xe9ea('0xb'));var fs=require('fs');var fs_extra=require(_0xe9ea('0xc'));var _=require(_0xe9ea('0xd'));var squel=require(_0xe9ea('0xe'));var crypto=require(_0xe9ea('0xf'));var jsforce=require(_0xe9ea('0x10'));var deskjs=require(_0xe9ea('0x11'));var toCsv=require(_0xe9ea('0xa'));var querystring=require(_0xe9ea('0x12'));var Papa=require(_0xe9ea('0x13'));var Redis=require(_0xe9ea('0x14'));var authService=require(_0xe9ea('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9ea('0x16'))('api');var utils=require(_0xe9ea('0x17'));var config=require(_0xe9ea('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16ddbf,_0x1804ee){_0x1804ee=_0x1804ee||0xcc;return function(_0x2e7795){if(_0x2e7795){return _0x16ddbf['sendStatus'](_0x1804ee);}return _0x16ddbf[_0xe9ea('0x19')](_0x1804ee)[_0xe9ea('0x1a')]();};}function respondWithResult(_0x460a93,_0x4f3841){_0x4f3841=_0x4f3841||0xc8;return function(_0x55ef41){if(_0x55ef41){return _0x460a93[_0xe9ea('0x19')](_0x4f3841)['json'](_0x55ef41);}};}function respondWithFilteredResult(_0xcd6513,_0xccbe92){return function(_0x576724){if(_0x576724){var _0x2e9aa6=_0x576724[_0xe9ea('0x1b')],_0x565435=_0xccbe92[_0xe9ea('0x1c')],_0xb8b36c=_0xccbe92[_0xe9ea('0x1c')]+_0xccbe92[_0xe9ea('0x1d')],_0xf9d3b0;if(_0xb8b36c>=_0x2e9aa6){_0xb8b36c=_0x2e9aa6;_0xf9d3b0=0xc8;}else{_0xf9d3b0=0xce;}_0xcd6513[_0xe9ea('0x19')](_0xf9d3b0);return _0xcd6513[_0xe9ea('0x1e')](_0xe9ea('0x1f'),_0x565435+'-'+_0xb8b36c+'/'+_0x2e9aa6)['json'](_0x576724);}return null;};}function patchUpdates(_0x435999){return function(_0x134784){try{jsonpatch[_0xe9ea('0x20')](_0x134784,_0x435999,!![]);}catch(_0x5c057e){return BPromise[_0xe9ea('0x21')](_0x5c057e);}return _0x134784['save']();};}function saveUpdates(_0x5104d5,_0x312dfa){return function(_0x7b1e42){if(_0x7b1e42){return _0x7b1e42[_0xe9ea('0x22')](_0x5104d5)[_0xe9ea('0x23')](function(_0x1654c0){return _0x1654c0;});}return null;};}function removeEntity(_0x482c0b,_0x3154dc){return function(_0x478982){if(_0x478982){return _0x478982[_0xe9ea('0x24')]()[_0xe9ea('0x23')](function(){_0x482c0b['status'](0xcc)[_0xe9ea('0x1a')]();});}};}function handleEntityNotFound(_0x1d45a2,_0x316e57){return function(_0x288190){if(!_0x288190){_0x1d45a2[_0xe9ea('0x25')](0x194);}return _0x288190;};}function handleError(_0x3cd1c4,_0x2d1dd9){_0x2d1dd9=_0x2d1dd9||0x1f4;return function(_0x2292f7){logger[_0xe9ea('0x26')](_0x2292f7[_0xe9ea('0x27')]);if(_0x2292f7[_0xe9ea('0x28')]){delete _0x2292f7[_0xe9ea('0x28')];}_0x3cd1c4[_0xe9ea('0x19')](_0x2d1dd9)['send'](_0x2292f7);};}exports[_0xe9ea('0x29')]=function(_0x48992d,_0x3e3de4){var _0x12f372={},_0x5b7b7c={},_0x25333b={'count':0x0,'rows':[]};var _0x1c819b=_[_0xe9ea('0x2a')](db['Attachment'][_0xe9ea('0x2b')],function(_0x1096b6){return{'name':_0x1096b6[_0xe9ea('0x2c')],'type':_0x1096b6['type']['key']};});_0x5b7b7c[_0xe9ea('0x2d')]=_['map'](_0x1c819b,_0xe9ea('0x28'));_0x5b7b7c[_0xe9ea('0x2e')]=_[_0xe9ea('0x2f')](_0x48992d[_0xe9ea('0x2e')]);_0x5b7b7c[_0xe9ea('0x30')]=_[_0xe9ea('0x31')](_0x5b7b7c['model'],_0x5b7b7c[_0xe9ea('0x2e')]);_0x12f372[_0xe9ea('0x32')]=_[_0xe9ea('0x31')](_0x5b7b7c[_0xe9ea('0x2d')],qs[_0xe9ea('0x33')](_0x48992d[_0xe9ea('0x2e')][_0xe9ea('0x33')]));_0x12f372[_0xe9ea('0x32')]=_0x12f372[_0xe9ea('0x32')][_0xe9ea('0x34')]?_0x12f372[_0xe9ea('0x32')]:_0x5b7b7c[_0xe9ea('0x2d')];if(!_0x48992d[_0xe9ea('0x2e')][_0xe9ea('0x35')](_0xe9ea('0x36'))){_0x12f372[_0xe9ea('0x1d')]=qs[_0xe9ea('0x1d')](_0x48992d[_0xe9ea('0x2e')]['limit']);_0x12f372[_0xe9ea('0x1c')]=qs[_0xe9ea('0x1c')](_0x48992d[_0xe9ea('0x2e')][_0xe9ea('0x1c')]);}_0x12f372['order']=qs[_0xe9ea('0x37')](_0x48992d['query'][_0xe9ea('0x37')]);_0x12f372[_0xe9ea('0x38')]=qs[_0xe9ea('0x30')](_[_0xe9ea('0x39')](_0x48992d['query'],_0x5b7b7c[_0xe9ea('0x30')]),_0x1c819b);if(_0x48992d[_0xe9ea('0x2e')]['filter']){_0x12f372[_0xe9ea('0x38')]=_[_0xe9ea('0x3a')](_0x12f372[_0xe9ea('0x38')],{'$or':_[_0xe9ea('0x2a')](_0x1c819b,function(_0x22a0ad){if(_0x22a0ad['type']!==_0xe9ea('0x3b')){var _0x5ef5df={};_0x5ef5df[_0x22a0ad[_0xe9ea('0x28')]]={'$like':'%'+_0x48992d[_0xe9ea('0x2e')][_0xe9ea('0x3c')]+'%'};return _0x5ef5df;}})});}_0x12f372=_[_0xe9ea('0x3a')]({},_0x12f372,_0x48992d[_0xe9ea('0x3d')]);var _0x581acc={'where':_0x12f372[_0xe9ea('0x38')]};return db[_0xe9ea('0x3e')][_0xe9ea('0x1b')](_0x581acc)[_0xe9ea('0x23')](function(_0x20a781){_0x25333b[_0xe9ea('0x1b')]=_0x20a781;if(_0x48992d[_0xe9ea('0x2e')][_0xe9ea('0x3f')]){_0x12f372[_0xe9ea('0x40')]=[{'all':!![]}];}return db[_0xe9ea('0x3e')][_0xe9ea('0x41')](_0x12f372);})['then'](function(_0xddd0d6){_0x25333b[_0xe9ea('0x42')]=_0xddd0d6;return _0x25333b;})['then'](respondWithFilteredResult(_0x3e3de4,_0x12f372))[_0xe9ea('0x43')](handleError(_0x3e3de4,null));};exports[_0xe9ea('0x44')]=function(_0x4f14d1,_0x58e222){var _0x277374={'raw':!![],'where':{'id':_0x4f14d1[_0xe9ea('0x45')]['id']}},_0x2d72f9={};_0x2d72f9['model']=_['keys'](db[_0xe9ea('0x3e')]['rawAttributes']);_0x2d72f9[_0xe9ea('0x2e')]=_[_0xe9ea('0x2f')](_0x4f14d1[_0xe9ea('0x2e')]);_0x2d72f9['filters']=_[_0xe9ea('0x31')](_0x2d72f9['model'],_0x2d72f9[_0xe9ea('0x2e')]);_0x277374['attributes']=_['intersection'](_0x2d72f9[_0xe9ea('0x2d')],qs[_0xe9ea('0x33')](_0x4f14d1[_0xe9ea('0x2e')]['fields']));_0x277374[_0xe9ea('0x32')]=_0x277374[_0xe9ea('0x32')][_0xe9ea('0x34')]?_0x277374[_0xe9ea('0x32')]:_0x2d72f9[_0xe9ea('0x2d')];if(_0x4f14d1['query'][_0xe9ea('0x3f')]){_0x277374[_0xe9ea('0x40')]=[{'all':!![]}];}_0x277374=_[_0xe9ea('0x3a')]({},_0x277374,_0x4f14d1[_0xe9ea('0x3d')]);return db[_0xe9ea('0x3e')][_0xe9ea('0x46')](_0x277374)[_0xe9ea('0x23')](handleEntityNotFound(_0x58e222,null))[_0xe9ea('0x23')](respondWithResult(_0x58e222,null))['catch'](handleError(_0x58e222,null));};exports[_0xe9ea('0x47')]=function(_0x2dcbd9,_0x49e077){var _0x1c76c2={'where':{'id':_0x2dcbd9[_0xe9ea('0x45')]['id']}},_0xbf94d0={};_0xbf94d0[_0xe9ea('0x2d')]=_['keys'](db[_0xe9ea('0x3e')][_0xe9ea('0x2b')]);_0x1c76c2[_0xe9ea('0x32')]=_[_0xe9ea('0x31')](_0xbf94d0[_0xe9ea('0x2d')],qs[_0xe9ea('0x33')](_0x2dcbd9[_0xe9ea('0x2e')][_0xe9ea('0x33')]));_0x1c76c2[_0xe9ea('0x32')]=_0x1c76c2['attributes'][_0xe9ea('0x34')]?_0x1c76c2[_0xe9ea('0x32')]:_0xbf94d0[_0xe9ea('0x2d')];if(_0x2dcbd9['query'][_0xe9ea('0x3f')]){_0x1c76c2[_0xe9ea('0x40')]=[{'all':!![]}];}_0x1c76c2=_['merge']({},_0x1c76c2,_0x2dcbd9[_0xe9ea('0x3d')]);return db['Attachment']['find'](_0x1c76c2)[_0xe9ea('0x23')](handleEntityNotFound(_0x49e077,null))[_0xe9ea('0x23')](function(_0x2ef540){if(_0x2ef540){var _0x5176ca=_0x2ef540['get']({'plain':!![]});_0x5176ca=qs[_0xe9ea('0x48')](_0x5176ca,['id',_0xe9ea('0x49'),'updatedAt']);_0x2dcbd9[_0xe9ea('0x4a')]=_[_0xe9ea('0x48')](_0x2dcbd9[_0xe9ea('0x4a')],['id',_0xe9ea('0x49'),'updatedAt']);return db['Attachment'][_0xe9ea('0x4b')](_[_0xe9ea('0x3a')](_0x5176ca,_0x2dcbd9['body']),{'include':_0x2dcbd9[_0xe9ea('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xe9ea('0x23')](respondWithResult(_0x49e077,0xc9))[_0xe9ea('0x43')](handleError(_0x49e077,null));};exports[_0xe9ea('0x22')]=function(_0x1ceaf5,_0x444fae){if(_0x1ceaf5[_0xe9ea('0x4a')]['id']){delete _0x1ceaf5[_0xe9ea('0x4a')]['id'];}return db['Attachment'][_0xe9ea('0x46')]({'where':{'id':_0x1ceaf5[_0xe9ea('0x45')]['id']}})[_0xe9ea('0x23')](handleEntityNotFound(_0x444fae,null))[_0xe9ea('0x23')](saveUpdates(_0x1ceaf5[_0xe9ea('0x4a')],null))['then'](respondWithResult(_0x444fae,null))['catch'](handleError(_0x444fae,null));};exports['destroy']=function(_0x1e7788,_0x206850){return db[_0xe9ea('0x3e')]['find']({'where':{'id':_0x1e7788[_0xe9ea('0x45')]['id']}})[_0xe9ea('0x23')](handleEntityNotFound(_0x206850,null))[_0xe9ea('0x23')](removeEntity(_0x206850,null))[_0xe9ea('0x43')](handleError(_0x206850,null));};exports['create']=function(_0x34ea20,_0x12a62b,_0x4377ce){_0x34ea20['body'][_0xe9ea('0x28')]=_0x34ea20[_0xe9ea('0x4c')]['originalname'];_0x34ea20[_0xe9ea('0x4a')][_0xe9ea('0x4d')]=_0x34ea20[_0xe9ea('0x4c')][_0xe9ea('0x4e')];_0x34ea20['body']['type']=_0x34ea20[_0xe9ea('0x4c')][_0xe9ea('0x4f')];return db[_0xe9ea('0x3e')][_0xe9ea('0x4b')](_0x34ea20[_0xe9ea('0x4a')])['then'](respondWithResult(_0x12a62b,0xc9))[_0xe9ea('0x43')](handleError(_0x12a62b,null));};exports[_0xe9ea('0x50')]=function(_0x573b0f,_0x52e065,_0x59ea64){return db['Attachment'][_0xe9ea('0x51')]({'where':{'id':_0x573b0f[_0xe9ea('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x52e065,null))[_0xe9ea('0x23')](function(_0x1c46aa){if(_0x1c46aa){var _0xa9e8e9=_0x1c46aa[_0xe9ea('0x52')]!==null;var _0x6b6408=path[_0xe9ea('0x53')](config[_0xe9ea('0x54')],_0xe9ea('0x55'));if(_0xa9e8e9){_0x6b6408=path[_0xe9ea('0x53')](_0x6b6408,_0xe9ea('0x56'));}var _0x48fccd=path[_0xe9ea('0x53')](_0x6b6408,_0x1c46aa['basename']);return _0x52e065[_0xe9ea('0x50')](_0x48fccd);}})[_0xe9ea('0x43')](handleError(_0x52e065,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 439829c..61d3618 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 _0x3a15=['moment','bluebird','request-promise','../../config/environment','Attachment','attachments','lodash','../../config/logger'];(function(_0x276592,_0x154e81){var _0x9137cc=function(_0x552792){while(--_0x552792){_0x276592['push'](_0x276592['shift']());}};_0x9137cc(++_0x154e81);}(_0x3a15,0xde));var _0x53a1=function(_0x260d5b,_0x9df418){_0x260d5b=_0x260d5b-0x0;var _0x18ae84=_0x3a15[_0x260d5b];return _0x18ae84;};'use strict';var _=require(_0x53a1('0x0'));var util=require('util');var logger=require(_0x53a1('0x1'))('api');var moment=require(_0x53a1('0x2'));var BPromise=require(_0x53a1('0x3'));var rp=require(_0x53a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x53a1('0x5'));var attributes=require('./attachment.attributes');module['exports']=function(_0x5acff4,_0x292b62){return _0x5acff4['define'](_0x53a1('0x6'),attributes,{'tableName':_0x53a1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x693f=['attachments','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf693('0x0'));var util=require(_0xf693('0x1'));var logger=require(_0xf693('0x2'))(_0xf693('0x3'));var moment=require('moment');var BPromise=require(_0xf693('0x4'));var rp=require(_0xf693('0x5'));var fs=require('fs');var path=require(_0xf693('0x6'));var rimraf=require(_0xf693('0x7'));var config=require(_0xf693('0x8'));var attributes=require(_0xf693('0x9'));module[_0xf693('0xa')]=function(_0x4b4d39,_0x1d3b17){return _0x4b4d39[_0xf693('0xb')]('Attachment',attributes,{'tableName':_0xf693('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 3d72980..2cd8e85 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 _0x37f5=['request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3ced90,_0xf1aad1){var _0x5b9d75=function(_0x287333){while(--_0x287333){_0x3ced90['push'](_0x3ced90['shift']());}};_0x5b9d75(++_0xf1aad1);}(_0x37f5,0x15d));var _0x537f=function(_0x48ac68,_0x4ea411){_0x48ac68=_0x48ac68-0x0;var _0x4cdf6e=_0x37f5[_0x48ac68];return _0x4cdf6e;};'use strict';var _=require(_0x537f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x537f('0x1'));var rs=require(_0x537f('0x2'));var fs=require('fs');var Redis=require(_0x537f('0x3'));var db=require(_0x537f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x537f('0x5'))(_0x537f('0x6'));var config=require(_0x537f('0x7'));var jayson=require(_0x537f('0x8'));var client=jayson[_0x537f('0x9')][_0x537f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x127fc8,_0x54a507,_0x5dafc7){return new BPromise(function(_0x366243,_0x2a8893){return client[_0x537f('0xb')](_0x127fc8,_0x5dafc7)[_0x537f('0xc')](function(_0x1d0819){logger[_0x537f('0xd')](_0x537f('0xe'),_0x54a507,_0x537f('0xf'));logger[_0x537f('0x10')](_0x537f('0x11'),_0x54a507,_0x537f('0xf'),JSON['stringify'](_0x1d0819));if(_0x1d0819[_0x537f('0x12')]){if(_0x1d0819[_0x537f('0x12')][_0x537f('0x13')]===0x1f4){logger['error'](_0x537f('0xe'),_0x54a507,_0x1d0819[_0x537f('0x12')][_0x537f('0x14')]);return _0x2a8893(_0x1d0819[_0x537f('0x12')][_0x537f('0x14')]);}logger[_0x537f('0x12')](_0x537f('0xe'),_0x54a507,_0x1d0819[_0x537f('0x12')][_0x537f('0x14')]);return _0x366243(_0x1d0819[_0x537f('0x12')][_0x537f('0x14')]);}else{logger[_0x537f('0xd')](_0x537f('0xe'),_0x54a507,_0x537f('0xf'));_0x366243(_0x1d0819[_0x537f('0x15')]['message']);}})[_0x537f('0x16')](function(_0x3db5dd){logger[_0x537f('0x12')](_0x537f('0xe'),_0x54a507,_0x3db5dd);_0x2a8893(_0x3db5dd);});});}exports[_0x537f('0x17')]=function(_0x2ed10a){var _0x163cfd=this;return new Promise(function(_0x5e62b8,_0x41cffa){return db[_0x537f('0x18')][_0x537f('0x19')](_0x2ed10a[_0x537f('0x1a')],{'raw':_0x2ed10a[_0x537f('0x1b')]?_0x2ed10a[_0x537f('0x1b')][_0x537f('0x1c')]===undefined?!![]:![]:!![]})[_0x537f('0xc')](function(_0xee2c68){logger[_0x537f('0xd')]('CreateAttachment',_0x2ed10a);logger[_0x537f('0x10')](_0x537f('0x17'),_0x2ed10a,JSON[_0x537f('0x1d')](_0xee2c68));_0x5e62b8(_0xee2c68);})[_0x537f('0x16')](function(_0x506b6d){logger[_0x537f('0x12')](_0x537f('0x17'),_0x506b6d[_0x537f('0x14')],_0x2ed10a);_0x41cffa(_0x163cfd[_0x537f('0x12')](0x1f4,_0x506b6d[_0x537f('0x14')]));});});}; \ No newline at end of file +var _0xab8f=['message','result','catch','CreateAttachment','create','body','options','raw','then','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xc4ad3d,_0x1f8163){var _0x1d5465=function(_0x2a5850){while(--_0x2a5850){_0xc4ad3d['push'](_0xc4ad3d['shift']());}};_0x1d5465(++_0x1f8163);}(_0xab8f,0x71));var _0xfab8=function(_0xb43c8b,_0x2c193c){_0xb43c8b=_0xb43c8b-0x0;var _0x68af76=_0xab8f[_0xb43c8b];return _0x68af76;};'use strict';var _=require('lodash');var util=require(_0xfab8('0x0'));var moment=require(_0xfab8('0x1'));var BPromise=require('bluebird');var rs=require(_0xfab8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfab8('0x3'));var logger=require(_0xfab8('0x4'))(_0xfab8('0x5'));var config=require(_0xfab8('0x6'));var jayson=require(_0xfab8('0x7'));var client=jayson['client'][_0xfab8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5355e2,_0x2dcd00,_0x484747){return new BPromise(function(_0x5b58db,_0xe3d961){return client[_0xfab8('0x9')](_0x5355e2,_0x484747)['then'](function(_0x2b1c5e){logger[_0xfab8('0xa')](_0xfab8('0xb'),_0x2dcd00,_0xfab8('0xc'));logger[_0xfab8('0xd')](_0xfab8('0xe'),_0x2dcd00,_0xfab8('0xc'),JSON['stringify'](_0x2b1c5e));if(_0x2b1c5e[_0xfab8('0xf')]){if(_0x2b1c5e[_0xfab8('0xf')][_0xfab8('0x10')]===0x1f4){logger['error'](_0xfab8('0xb'),_0x2dcd00,_0x2b1c5e[_0xfab8('0xf')][_0xfab8('0x11')]);return _0xe3d961(_0x2b1c5e[_0xfab8('0xf')][_0xfab8('0x11')]);}logger[_0xfab8('0xf')]('Attachment,\x20%s,\x20%s',_0x2dcd00,_0x2b1c5e[_0xfab8('0xf')][_0xfab8('0x11')]);return _0x5b58db(_0x2b1c5e[_0xfab8('0xf')][_0xfab8('0x11')]);}else{logger[_0xfab8('0xa')](_0xfab8('0xb'),_0x2dcd00,'request\x20sent');_0x5b58db(_0x2b1c5e[_0xfab8('0x12')]['message']);}})[_0xfab8('0x13')](function(_0x2c7c85){logger[_0xfab8('0xf')](_0xfab8('0xb'),_0x2dcd00,_0x2c7c85);_0xe3d961(_0x2c7c85);});});}exports[_0xfab8('0x14')]=function(_0x16767b){var _0xb76871=this;return new Promise(function(_0x51f578,_0x1ec02f){return db['Attachment'][_0xfab8('0x15')](_0x16767b[_0xfab8('0x16')],{'raw':_0x16767b[_0xfab8('0x17')]?_0x16767b[_0xfab8('0x17')][_0xfab8('0x18')]===undefined?!![]:![]:!![]})[_0xfab8('0x19')](function(_0x4629db){logger[_0xfab8('0xa')](_0xfab8('0x14'),_0x16767b);logger[_0xfab8('0xd')](_0xfab8('0x14'),_0x16767b,JSON['stringify'](_0x4629db));_0x51f578(_0x4629db);})[_0xfab8('0x13')](function(_0x38268b){logger[_0xfab8('0xf')](_0xfab8('0x14'),_0x38268b['message'],_0x16767b);_0x1ec02f(_0xb76871[_0xfab8('0xf')](0x1f4,_0x38268b[_0xfab8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index dc74c75..4b3cfca 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 _0x1bc6=['../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','post','clone','diskStorage','server/files/attachments/','originalname','replace','single','file','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2c8f54,_0x3d5a57){var _0x5cd3e5=function(_0x4b0600){while(--_0x4b0600){_0x2c8f54['push'](_0x2c8f54['shift']());}};_0x5cd3e5(++_0x3d5a57);}(_0x1bc6,0x94));var _0x61bc=function(_0x5a61bf,_0x815b40){_0x5a61bf=_0x5a61bf-0x0;var _0x4974b6=_0x1bc6[_0x5a61bf];return _0x4974b6;};'use strict';var multer=require(_0x61bc('0x0'));var util=require(_0x61bc('0x1'));var path=require(_0x61bc('0x2'));var timeout=require(_0x61bc('0x3'));var express=require(_0x61bc('0x4'));var router=express[_0x61bc('0x5')]();var fs_extra=require(_0x61bc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x61bc('0x7'));var config=require(_0x61bc('0x8'));var controller=require(_0x61bc('0x9'));router[_0x61bc('0xa')]('/',auth[_0x61bc('0xb')](),controller[_0x61bc('0xc')]);router[_0x61bc('0xa')](_0x61bc('0xd'),auth[_0x61bc('0xb')](),controller['show']);router[_0x61bc('0xa')]('/:id/download',auth[_0x61bc('0xb')](),controller['download']);router[_0x61bc('0xe')]('/:id/clone',auth[_0x61bc('0xb')](),controller[_0x61bc('0xf')]);var upload=multer({'storage':multer[_0x61bc('0x10')]({'destination':function(_0x5f2543,_0x480314,_0x508f2f){_0x508f2f(null,path['join'](config['root'],_0x61bc('0x11')));},'filename':function(_0x4feac0,_0x3ecf9e,_0xd3759c){_0xd3759c(null,util['format']('%s-%s',Date['now'](),_0x3ecf9e[_0x61bc('0x12')][_0x61bc('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0x61bc('0x14')](_0x61bc('0x15')),controller[_0x61bc('0x16')]);router[_0x61bc('0x17')](_0x61bc('0xd'),auth[_0x61bc('0xb')](),controller['update']);router[_0x61bc('0x18')](_0x61bc('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x61bc('0x19')]=router; \ No newline at end of file +var _0x8580=['clone','diskStorage','join','root','now','originalname','single','file','create','put','update','delete','destroy','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./attachment.controller','isAuthenticated','index','get','/:id','show','/:id/download','post'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8580,0x1c7));var _0x0858=function(_0x4e8956,_0x324dc8){_0x4e8956=_0x4e8956-0x0;var _0x1d81c3=_0x8580[_0x4e8956];return _0x1d81c3;};'use strict';var multer=require('multer');var util=require(_0x0858('0x0'));var path=require('path');var timeout=require(_0x0858('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0858('0x2'));var auth=require(_0x0858('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0858('0x4'));var controller=require(_0x0858('0x5'));router['get']('/',auth[_0x0858('0x6')](),controller[_0x0858('0x7')]);router[_0x0858('0x8')](_0x0858('0x9'),auth['isAuthenticated'](),controller[_0x0858('0xa')]);router[_0x0858('0x8')](_0x0858('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x0858('0xc')]('/:id/clone',auth[_0x0858('0x6')](),controller[_0x0858('0xd')]);var upload=multer({'storage':multer[_0x0858('0xe')]({'destination':function(_0x1699a5,_0x41b849,_0x207cda){_0x207cda(null,path[_0x0858('0xf')](config[_0x0858('0x10')],'server/files/attachments/'));},'filename':function(_0x49eb34,_0x448d29,_0x4dec96){_0x4dec96(null,util['format']('%s-%s',Date[_0x0858('0x11')](),_0x448d29[_0x0858('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0858('0xc')]('/',upload[_0x0858('0x13')](_0x0858('0x14')),controller[_0x0858('0x15')]);router[_0x0858('0x16')](_0x0858('0x9'),auth[_0x0858('0x6')](),controller[_0x0858('0x17')]);router[_0x0858('0x18')](_0x0858('0x9'),auth[_0x0858('0x6')](),controller[_0x0858('0x19')]);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 d18dd0a..2e1d193 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 _0x0f06=['lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','login','/login','profile','email','callback','authenticate','google','use','clientSecret','secret','callbackURL','Setting','blockDuration','then','find','map','user','agent','disabled','blocked','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch'];(function(_0x49d511,_0x38e1a5){var _0x36001b=function(_0x50f87d){while(--_0x50f87d){_0x49d511['push'](_0x49d511['shift']());}};_0x36001b(++_0x38e1a5);}(_0x0f06,0x1c7));var _0x60f0=function(_0x16e5d1,_0x9cf085){_0x16e5d1=_0x16e5d1-0x0;var _0x3f72e6=_0x0f06[_0x16e5d1];return _0x3f72e6;};'use strict';var _=require(_0x60f0('0x0'));var passport=require(_0x60f0('0x1'));var GoogleStrategy=require(_0x60f0('0x2'))[_0x60f0('0x3')];var moment=require(_0x60f0('0x4'));var db=require(_0x60f0('0x5'))['db'];var config=require(_0x60f0('0x6'));var signToken=require('../../components/auth/service')[_0x60f0('0x7')];var utils=require(_0x60f0('0x8'));exports[_0x60f0('0x9')]=passport['authenticate']('google',{'failureRedirect':_0x60f0('0xa'),'scope':[_0x60f0('0xb'),_0x60f0('0xc')],'session':![]});exports[_0x60f0('0xd')]=passport[_0x60f0('0xe')](_0x60f0('0xf'),{'failureRedirect':_0x60f0('0xa'),'session':![]});passport[_0x60f0('0x10')](new GoogleStrategy({'clientID':config[_0x60f0('0xf')]?config[_0x60f0('0xf')]['clientID']:'id','clientSecret':config[_0x60f0('0xf')]?config[_0x60f0('0xf')][_0x60f0('0x11')]:_0x60f0('0x12'),'callbackURL':config[_0x60f0('0xf')]?config['google'][_0x60f0('0x13')]:''},function(_0x4f030a,_0x357ec0,_0x1bee5d,_0x1fe46e){var _0x1f1919,_0x868907;return db[_0x60f0('0x14')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x60f0('0x15')],'raw':!![]})[_0x60f0('0x16')](function(_0x3fbd61){_0x1f1919=_0x3fbd61;return db['User'][_0x60f0('0x17')]({'where':{'email':_[_0x60f0('0x18')](_0x1bee5d['emails'],'value'),'role':{'$or':['admin',_0x60f0('0x19'),_0x60f0('0x1a')]}}});})['then'](function(_0xb354a5){_0x868907=_0xb354a5;if(_0x868907){if(_0x868907[_0x60f0('0x1b')]){return _0x1fe46e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x1f1919[_0x60f0('0x15')]>0x0){if(_0x868907[_0x60f0('0x1c')]){if(moment(_0x868907['blockedAt'])[_0x60f0('0x1d')](_0x1f1919[_0x60f0('0x15')],_0x60f0('0x1e'))>moment()){return _0x1fe46e(_0x60f0('0x1f'));}else{return utils[_0x60f0('0x20')](_0x868907,0x0,![],null)['then'](function(){return utils[_0x60f0('0x21')](_0x868907);})[_0x60f0('0x16')](function(){return _0x1fe46e(null,_0x868907);});}}else{return utils[_0x60f0('0x21')](_0x868907)[_0x60f0('0x16')](function(){return _0x1fe46e(null,_0x868907);});}}else{return utils[_0x60f0('0x21')](_0x868907)[_0x60f0('0x16')](function(){return _0x1fe46e(null,_0x868907);});}}return _0x1fe46e(_0x60f0('0x1f'));})[_0x60f0('0x22')](function(_0x1b7cbb){_0x1fe46e(_0x1b7cbb);});})); \ No newline at end of file +var _0x7d3e=['moment','../../config/environment','../../components/auth/service','../../config/utils','/login','email','callback','authenticate','google','use','clientID','clientSecret','findOne','allowedLoginAttempts','User','find','map','emails','value','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','getLicense','catch','lodash','passport','passport-google-oauth20'];(function(_0xca073c,_0x5030ae){var _0x5187f4=function(_0x2c4411){while(--_0x2c4411){_0xca073c['push'](_0xca073c['shift']());}};_0x5187f4(++_0x5030ae);}(_0x7d3e,0x152));var _0xe7d3=function(_0x3762cd,_0x43838a){_0x3762cd=_0x3762cd-0x0;var _0x29b8e9=_0x7d3e[_0x3762cd];return _0x29b8e9;};'use strict';var _=require(_0xe7d3('0x0'));var passport=require(_0xe7d3('0x1'));var GoogleStrategy=require(_0xe7d3('0x2'))['Strategy'];var moment=require(_0xe7d3('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0xe7d3('0x4'));var signToken=require(_0xe7d3('0x5'))['signToken'];var utils=require(_0xe7d3('0x6'));exports['login']=passport['authenticate']('google',{'failureRedirect':_0xe7d3('0x7'),'scope':['profile',_0xe7d3('0x8')],'session':![]});exports[_0xe7d3('0x9')]=passport[_0xe7d3('0xa')](_0xe7d3('0xb'),{'failureRedirect':_0xe7d3('0x7'),'session':![]});passport[_0xe7d3('0xc')](new GoogleStrategy({'clientID':config[_0xe7d3('0xb')]?config[_0xe7d3('0xb')][_0xe7d3('0xd')]:'id','clientSecret':config['google']?config['google'][_0xe7d3('0xe')]:'secret','callbackURL':config[_0xe7d3('0xb')]?config['google']['callbackURL']:''},function(_0x968deb,_0x3a4f9e,_0x5abf1e,_0x432282){var _0x258d1c,_0xb6af64;return db['Setting'][_0xe7d3('0xf')]({'where':{'id':0x1},'attributes':[_0xe7d3('0x10'),'blockDuration'],'raw':!![]})['then'](function(_0x3ec48b){_0x258d1c=_0x3ec48b;return db[_0xe7d3('0x11')][_0xe7d3('0x12')]({'where':{'email':_[_0xe7d3('0x13')](_0x5abf1e[_0xe7d3('0x14')],_0xe7d3('0x15')),'role':{'$or':['admin','user','agent']}}});})[_0xe7d3('0x16')](function(_0x41b38b){_0xb6af64=_0x41b38b;if(_0xb6af64){if(_0xb6af64['disabled']){return _0x432282(_0xe7d3('0x17'));}else if(_0x258d1c[_0xe7d3('0x18')]>0x0){if(_0xb6af64[_0xe7d3('0x19')]){if(moment(_0xb6af64[_0xe7d3('0x1a')])[_0xe7d3('0x1b')](_0x258d1c[_0xe7d3('0x18')],_0xe7d3('0x1c'))>moment()){return _0x432282(_0xe7d3('0x17'));}else{return utils['clearBlockUser'](_0xb6af64,0x0,![],null)[_0xe7d3('0x16')](function(){return utils[_0xe7d3('0x1d')](_0xb6af64);})[_0xe7d3('0x16')](function(){return _0x432282(null,_0xb6af64);});}}else{return utils[_0xe7d3('0x1d')](_0xb6af64)[_0xe7d3('0x16')](function(){return _0x432282(null,_0xb6af64);});}}else{return utils[_0xe7d3('0x1d')](_0xb6af64)['then'](function(){return _0x432282(null,_0xb6af64);});}}return _0x432282(_0xe7d3('0x17'));})[_0xe7d3('0x1e')](function(_0x3462e2){_0x432282(_0x3462e2);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 73e7bf3..a4861eb 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 _0xc368=['../../components/auth/service','get','login','/callback','callback','isMiddleware','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x22d202,_0xfcd670){var _0x3cb212=function(_0xafd594){while(--_0xafd594){_0x22d202['push'](_0x22d202['shift']());}};_0x3cb212(++_0xfcd670);}(_0xc368,0x7b));var _0x8c36=function(_0x6d2b3b,_0x40bc9d){_0x6d2b3b=_0x6d2b3b-0x0;var _0x5f10d0=_0xc368[_0x6d2b3b];return _0x5f10d0;};'use strict';var express=require('express');var passport=require(_0x8c36('0x0'));var router=express['Router']();var controller=require(_0x8c36('0x1'));var userController=require(_0x8c36('0x2'));var authService=require(_0x8c36('0x3'));router[_0x8c36('0x4')]('/',controller[_0x8c36('0x5')]);router['get'](_0x8c36('0x6'),controller[_0x8c36('0x7')],authService[_0x8c36('0x8')],userController[_0x8c36('0x5')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file +var _0x3189=['callback','isMiddleware','setTokenCookie','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login'];(function(_0x14fa0b,_0x58efd6){var _0x55bb13=function(_0x4f6b78){while(--_0x4f6b78){_0x14fa0b['push'](_0x14fa0b['shift']());}};_0x55bb13(++_0x58efd6);}(_0x3189,0xae));var _0x9318=function(_0x11b2c2,_0x33c0ba){_0x11b2c2=_0x11b2c2-0x0;var _0x23487f=_0x3189[_0x11b2c2];return _0x23487f;};'use strict';var express=require(_0x9318('0x0'));var passport=require(_0x9318('0x1'));var router=express['Router']();var controller=require(_0x9318('0x2'));var userController=require(_0x9318('0x3'));var authService=require(_0x9318('0x4'));router['get']('/',controller[_0x9318('0x5')]);router['get']('/callback',controller[_0x9318('0x6')],authService[_0x9318('0x7')],userController['login'],authService[_0x9318('0x8')]);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 bcd9c74..6bd32c2 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 _0x323f=['merge','format','request','error','message','stringify','send','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','pass'];(function(_0x2ca6e5,_0x3aaed0){var _0x4946ba=function(_0x2541a1){while(--_0x2541a1){_0x2ca6e5['push'](_0x2ca6e5['shift']());}};_0x4946ba(++_0x3aaed0);}(_0x323f,0x1ee));var _0xf323=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x323f[_0x4cf98e];return _0x1623ac;};'use strict';var util=require('util');var passport=require(_0xf323('0x0'));var LocalStrategy=require('passport-local')[_0xf323('0x1')];var jayson=require(_0xf323('0x2'));var _=require(_0xf323('0x3'));var rs=require(_0xf323('0x4'));var moment=require(_0xf323('0x5'));var db=require(_0xf323('0x6'))['db'];var authService=require(_0xf323('0x7'));var utils=require(_0xf323('0x8'));var client=jayson[_0xf323('0x9')][_0xf323('0xa')]({'port':0x232b});function localAuthenticate(_0x5d7d60,_0xb9a667,_0x444cba,_0x1af70d){var _0x2c8271,_0x8abeac;return db[_0xf323('0xb')][_0xf323('0xc')]({'where':{'id':0x1},'attributes':[_0xf323('0xd'),_0xf323('0xe')],'raw':!![]})[_0xf323('0xf')](function(_0x22fd48){_0x2c8271=_0x22fd48;return _0x5d7d60[_0xf323('0xc')]({'attributes':['id',_0xf323('0x10'),_0xf323('0x11'),_0xf323('0x12'),_0xf323('0x13'),_0xf323('0x14'),'blocked',_0xf323('0x15'),_0xf323('0x16')],'where':{'name':_0xb9a667,'role':{'$or':[_0xf323('0x17'),'user',_0xf323('0x18')]}}});})[_0xf323('0xf')](function(_0x367db4){if(!_0x367db4||_0x367db4&&_0x367db4[_0xf323('0x10')]!==_0xb9a667){throw new Error(_0xf323('0x19'));}else{_0x8abeac=_0x367db4;return _0x8abeac;}})[_0xf323('0xf')](function(){_0x8abeac['authenticate'](_0x444cba,function(_0x4cc3ce,_0x874219){var _0x447517=_0x8abeac[_0xf323('0x16')]+0x1;if(_0x4cc3ce){return _0x1af70d(_0x4cc3ce);}else if(!_0x874219){if(_0x8abeac[_0xf323('0x14')]){return _0x1af70d(null,![],{'message':_0xf323('0x19')});}else if(_0x2c8271['allowedLoginAttempts']>0x0){if(_0x8abeac[_0xf323('0x1a')]){if(_0x2c8271[_0xf323('0xe')]>0x0){if(moment(_0x8abeac[_0xf323('0x15')])[_0xf323('0x1b')](_0x2c8271['blockDuration'],_0xf323('0x1c'))>moment()){return _0x1af70d(null,![],{'message':_0xf323('0x19')});}else{return utils[_0xf323('0x1d')](_0x8abeac,_0x447517,![],null)[_0xf323('0xf')](function(){return _0x1af70d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x1af70d(null,![],{'message':_0xf323('0x19')});}}else{if(_0x447517>=_0x2c8271[_0xf323('0xd')]){return utils['clearBlockUser'](_0x8abeac,0x0,!![],moment())[_0xf323('0xf')](function(){return _0x1af70d(null,![],{'message':_0xf323('0x19')});});}else{return utils[_0xf323('0x1d')](_0x8abeac,_0x447517,![],null)[_0xf323('0xf')](function(){return _0x1af70d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1af70d(null,![],{'message':_0xf323('0x19')});}}else{if(_0x8abeac[_0xf323('0x14')]){return _0x1af70d(null,![],{'message':_0xf323('0x19')});}else if(_0x2c8271['allowedLoginAttempts']>0x0){if(_0x8abeac[_0xf323('0x1a')]){if(_0x2c8271[_0xf323('0xe')]>0x0){if(moment(_0x8abeac[_0xf323('0x15')])[_0xf323('0x1b')](_0x2c8271[_0xf323('0xe')],_0xf323('0x1c'))>moment()){return _0x1af70d(null,![],{'message':_0xf323('0x19')});}else{return utils[_0xf323('0x1d')](_0x8abeac,0x0,![],null)[_0xf323('0xf')](function(){return utils['getLicense'](_0x8abeac);})[_0xf323('0xf')](function(){return _0x1af70d(null,_0x8abeac);});}}else{return _0x1af70d(null,![],{'message':_0xf323('0x19')});}}else{return utils[_0xf323('0x1d')](_0x8abeac,0x0,![],null)[_0xf323('0xf')](function(){return utils[_0xf323('0x1e')](_0x8abeac);})[_0xf323('0xf')](function(){return _0x1af70d(null,_0x8abeac);})['catch'](function(_0x30ed93){return _0x1af70d(null,![],_0x30ed93);});}}else{if(_0x8abeac['blocked']){return _0x1af70d(null,![],{'message':_0xf323('0x19')});}else{return utils[_0xf323('0x1e')](_0x8abeac)['then'](function(){return _0x1af70d(null,_0x8abeac);});}}}});})[_0xf323('0x1f')](function(_0x3c95ce){return _0x1af70d(null,![],_0x3c95ce);});}function sendServiceMail(_0x2b6254){return db[_0xf323('0x20')][_0xf323('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0xf323('0x22')],'include':[{'model':db[_0xf323('0x23')],'as':_0xf323('0x24')}]})[_0xf323('0xf')](function(_0x4260f3){if(!_0x4260f3){throw new Error(_0xf323('0x25'));}var _0x17cb4d={'tls':{'rejectUnauthorized':![]}};if(_0x4260f3[_0xf323('0x24')][_0xf323('0x26')]){_0x17cb4d['service']=_0x4260f3[_0xf323('0x24')][_0xf323('0x26')];}else{_0x17cb4d[_0xf323('0x27')]=_0x4260f3[_0xf323('0x24')][_0xf323('0x27')];_0x17cb4d['port']=_0x4260f3[_0xf323('0x24')][_0xf323('0x28')];_0x17cb4d[_0xf323('0x29')]=_0x4260f3[_0xf323('0x24')][_0xf323('0x29')];}if(_0x4260f3['Smtp'][_0xf323('0x2a')]){_0x17cb4d[_0xf323('0x2b')]={'user':_0x4260f3[_0xf323('0x24')][_0xf323('0x2c')],'pass':_0x4260f3['Smtp'][_0xf323('0x2d')]};}var _0x5658db={'account':_0x17cb4d,'message':_[_0xf323('0x2e')]({'from':util[_0xf323('0x2f')]('\x22%s\x22\x20<%s>',_0x4260f3[_0xf323('0x10')],_0x4260f3['email']||_0x4260f3[_0xf323('0x24')]['user'])},_0x2b6254)};return client[_0xf323('0x30')]('SendMail',_0x5658db);})[_0xf323('0xf')](function(_0x82a6ca){if(_0x82a6ca['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x82a6ca[_0xf323('0x31')][_0xf323('0x32')]||JSON[_0xf323('0x33')](_0x82a6ca[_0xf323('0x31')])));}return!![];});}function handleError(_0x223fb7,_0x49e458,_0x54104a){return _0x223fb7['status'](_0x49e458||0x1f4)[_0xf323('0x34')]({'message':_0x54104a?_0x54104a['message']||_0x54104a:''});}exports[_0xf323('0x35')]=function(_0x47e7a2,_0x431bc,_0x1f7b34){passport[_0xf323('0x36')](_0xf323('0x37'),function(_0x325248,_0x48a6c4,_0x3d8ddb){var _0x3bbe02=_0x325248||_0x3d8ddb;if(_0x3bbe02){return handleError(_0x431bc,0x191,_0x3bbe02);}if(!_0x48a6c4){return handleError(_0x431bc,0x194,{'message':_0xf323('0x38')});}else{var _0x27ddcc={'payload':{'id':_0x48a6c4['id'],'role':_0x48a6c4[_0xf323('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0xf323('0x39')](_0x27ddcc)[_0xf323('0xf')](function(_0x2dcb00){_0x431bc[_0xf323('0x3a')]({'id':_0x48a6c4['id'],'token':_0x2dcb00,'statusCall':'','isAlreadyLogged':_0x48a6c4[_0xf323('0x3b')]});});}})(_0x47e7a2,_0x431bc,_0x1f7b34);};exports[_0xf323('0x3c')]=function(_0x45287b,_0xc48a6e,_0x388d80){if(!_0x45287b[_0xf323('0x3d')][_0xf323('0x22')]){return handleError(_0xc48a6e,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x502114=rs[_0xf323('0x3e')]();_0x45287b[_0xf323('0x3d')][_0xf323('0x22')]=_0x45287b[_0xf323('0x3d')][_0xf323('0x22')][_0xf323('0x3f')]()[_0xf323('0x40')]();var _0x125047;return db[_0xf323('0xb')][_0xf323('0xc')]({'where':{'id':0x1},'attributes':[_0xf323('0xd'),_0xf323('0xe')],'raw':!![]})[_0xf323('0xf')](function(_0x48d4df){_0x125047=_0x48d4df;return db[_0xf323('0x41')]['find']({'where':{'email':_0x45287b['body'][_0xf323('0x22')]}});})['then'](function(_0x5ddb5b){if(!_0x5ddb5b){throw new Error(_0xf323('0x42'));}if(_0x5ddb5b[_0xf323('0x14')]){throw new Error(_0xf323('0x43'));}if(_0x5ddb5b[_0xf323('0x1a')]){if(moment(_0x5ddb5b[_0xf323('0x15')])[_0xf323('0x1b')](_0x125047[_0xf323('0xe')],_0xf323('0x1c'))>moment()){throw new Error(_0xf323('0x44'));}else{_0x5ddb5b[_0xf323('0x1a')]=![];_0x5ddb5b[_0xf323('0x15')]=null;}}_0x5ddb5b['resetPasswordToken']=_0x502114;_0x5ddb5b[_0xf323('0x45')]=Date['now']()+0x36ee80;return _0x5ddb5b[_0xf323('0x46')]();})[_0xf323('0xf')](function(){return sendServiceMail({'to':_0x45287b[_0xf323('0x3d')][_0xf323('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xf323('0x47')+'https://'+_0x45287b[_0xf323('0x48')]['host']+_0xf323('0x49')+_0x502114+'\x0a\x0a'+_0xf323('0x4a')});})['then'](function(){_0xc48a6e[_0xf323('0x4b')](0xc8)[_0xf323('0x34')]({'message':_0xf323('0x4c')});})[_0xf323('0x1f')](function(_0x1e50b3){return handleError(_0xc48a6e,0x1f4,_0x1e50b3);});};exports[_0xf323('0x4d')]=function(_0x34268e,_0x103cc9,_0x1cb5fa){return db[_0xf323('0x41')][_0xf323('0x21')]({'where':{'resetPasswordToken':_0x34268e[_0xf323('0x4e')][_0xf323('0x4f')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xf323('0xf')](function(_0x18ad3e){if(!_0x18ad3e){throw new Error(_0xf323('0x50'));}return db[_0xf323('0xb')][_0xf323('0xc')]({'attributes':['id',_0xf323('0x51'),'enforcePasswordHistory',_0xf323('0x52')]})[_0xf323('0xf')](function(_0x5caa1c){if(_0x5caa1c[_0xf323('0x51')])authService[_0xf323('0x53')](_0x34268e['body']['password']);if(!_0x5caa1c[_0xf323('0x54')]||!_0x18ad3e[_0xf323('0x55')])return _0x18ad3e;authService[_0xf323('0x56')](_0x34268e[_0xf323('0x3d')][_0xf323('0x11')],_0x18ad3e[_0xf323('0x55')],_0x5caa1c[_0xf323('0x52')]);return _0x18ad3e;})[_0xf323('0xf')](function(){_0x18ad3e['password']=_0x34268e[_0xf323('0x3d')][_0xf323('0x11')];_0x18ad3e[_0xf323('0x57')]=null;_0x18ad3e[_0xf323('0x45')]=null;return _0x18ad3e[_0xf323('0x46')]();});})[_0xf323('0xf')](function(){_0x103cc9[_0xf323('0x4b')](0xc8)['send']({'message':_0xf323('0x58')});})[_0xf323('0x1f')](function(_0x277aa0){return handleError(_0x103cc9,0x1f4,_0x277aa0);});};passport[_0xf323('0x59')](new LocalStrategy({'usernameField':_0xf323('0x10'),'passwordField':_0xf323('0x11')},function(_0x4621f2,_0x728994,_0x3f0cfe){return localAuthenticate(db['User'],_0x4621f2,_0x728994,_0x3f0cfe);})); \ No newline at end of file +var _0xda19=['port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','local','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','find','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','use','User','passport','passport-local','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','allowedLoginAttempts','then','findOne','name','password','salt','role','blockedAt','admin','user','agent','authenticate','loginAttempts','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockDuration','add','minutes','clearBlockUser','getLicense','catch','email','MailServerOut','Smtp','service','host'];(function(_0x2769ca,_0x5de7ea){var _0x3e46c2=function(_0xf1a186){while(--_0xf1a186){_0x2769ca['push'](_0x2769ca['shift']());}};_0x3e46c2(++_0x5de7ea);}(_0xda19,0xd5));var _0x9da1=function(_0x5bc9dc,_0x2debc7){_0x5bc9dc=_0x5bc9dc-0x0;var _0x3b999f=_0xda19[_0x5bc9dc];return _0x3b999f;};'use strict';var util=require('util');var passport=require(_0x9da1('0x0'));var LocalStrategy=require(_0x9da1('0x1'))['Strategy'];var jayson=require(_0x9da1('0x2'));var _=require('lodash');var rs=require(_0x9da1('0x3'));var moment=require('moment');var db=require(_0x9da1('0x4'))['db'];var authService=require(_0x9da1('0x5'));var utils=require(_0x9da1('0x6'));var client=jayson[_0x9da1('0x7')][_0x9da1('0x8')]({'port':0x232b});function localAuthenticate(_0x2dcbc6,_0x23e4f7,_0x2c3cdd,_0x1c24e6){var _0x5e2d18,_0x47df89;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x9da1('0x9'),'blockDuration'],'raw':!![]})[_0x9da1('0xa')](function(_0x1cca84){_0x5e2d18=_0x1cca84;return _0x2dcbc6[_0x9da1('0xb')]({'attributes':['id',_0x9da1('0xc'),_0x9da1('0xd'),_0x9da1('0xe'),_0x9da1('0xf'),'disabled','blocked',_0x9da1('0x10'),'loginAttempts'],'where':{'name':_0x23e4f7,'role':{'$or':[_0x9da1('0x11'),_0x9da1('0x12'),_0x9da1('0x13')]}}});})[_0x9da1('0xa')](function(_0x4b75cc){if(!_0x4b75cc||_0x4b75cc&&_0x4b75cc[_0x9da1('0xc')]!==_0x23e4f7){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x47df89=_0x4b75cc;return _0x47df89;}})['then'](function(){_0x47df89[_0x9da1('0x14')](_0x2c3cdd,function(_0x479ccd,_0x433ff4){var _0x43c093=_0x47df89[_0x9da1('0x15')]+0x1;if(_0x479ccd){return _0x1c24e6(_0x479ccd);}else if(!_0x433ff4){if(_0x47df89[_0x9da1('0x16')]){return _0x1c24e6(null,![],{'message':_0x9da1('0x17')});}else if(_0x5e2d18['allowedLoginAttempts']>0x0){if(_0x47df89[_0x9da1('0x18')]){if(_0x5e2d18[_0x9da1('0x19')]>0x0){if(moment(_0x47df89[_0x9da1('0x10')])[_0x9da1('0x1a')](_0x5e2d18[_0x9da1('0x19')],_0x9da1('0x1b'))>moment()){return _0x1c24e6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x47df89,_0x43c093,![],null)[_0x9da1('0xa')](function(){return _0x1c24e6(null,![],{'message':_0x9da1('0x17')});});}}else{return _0x1c24e6(null,![],{'message':_0x9da1('0x17')});}}else{if(_0x43c093>=_0x5e2d18[_0x9da1('0x9')]){return utils[_0x9da1('0x1c')](_0x47df89,0x0,!![],moment())[_0x9da1('0xa')](function(){return _0x1c24e6(null,![],{'message':_0x9da1('0x17')});});}else{return utils['clearBlockUser'](_0x47df89,_0x43c093,![],null)[_0x9da1('0xa')](function(){return _0x1c24e6(null,![],{'message':_0x9da1('0x17')});});}}}else{return _0x1c24e6(null,![],{'message':_0x9da1('0x17')});}}else{if(_0x47df89[_0x9da1('0x16')]){return _0x1c24e6(null,![],{'message':_0x9da1('0x17')});}else if(_0x5e2d18['allowedLoginAttempts']>0x0){if(_0x47df89['blocked']){if(_0x5e2d18[_0x9da1('0x19')]>0x0){if(moment(_0x47df89[_0x9da1('0x10')])[_0x9da1('0x1a')](_0x5e2d18[_0x9da1('0x19')],_0x9da1('0x1b'))>moment()){return _0x1c24e6(null,![],{'message':_0x9da1('0x17')});}else{return utils['clearBlockUser'](_0x47df89,0x0,![],null)[_0x9da1('0xa')](function(){return utils[_0x9da1('0x1d')](_0x47df89);})['then'](function(){return _0x1c24e6(null,_0x47df89);});}}else{return _0x1c24e6(null,![],{'message':_0x9da1('0x17')});}}else{return utils[_0x9da1('0x1c')](_0x47df89,0x0,![],null)['then'](function(){return utils[_0x9da1('0x1d')](_0x47df89);})[_0x9da1('0xa')](function(){return _0x1c24e6(null,_0x47df89);})['catch'](function(_0x36b87a){return _0x1c24e6(null,![],_0x36b87a);});}}else{if(_0x47df89[_0x9da1('0x18')]){return _0x1c24e6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x47df89)[_0x9da1('0xa')](function(){return _0x1c24e6(null,_0x47df89);});}}}});})[_0x9da1('0x1e')](function(_0x5eca5b){return _0x1c24e6(null,![],_0x5eca5b);});}function sendServiceMail(_0x27c6e2){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id','name',_0x9da1('0x1f')],'include':[{'model':db[_0x9da1('0x20')],'as':_0x9da1('0x21')}]})[_0x9da1('0xa')](function(_0x140c6c){if(!_0x140c6c){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x269628={'tls':{'rejectUnauthorized':![]}};if(_0x140c6c['Smtp'][_0x9da1('0x22')]){_0x269628[_0x9da1('0x22')]=_0x140c6c['Smtp'][_0x9da1('0x22')];}else{_0x269628[_0x9da1('0x23')]=_0x140c6c['Smtp'][_0x9da1('0x23')];_0x269628[_0x9da1('0x24')]=_0x140c6c[_0x9da1('0x21')][_0x9da1('0x24')];_0x269628['secure']=_0x140c6c['Smtp'][_0x9da1('0x25')];}if(_0x140c6c[_0x9da1('0x21')][_0x9da1('0x26')]){_0x269628[_0x9da1('0x27')]={'user':_0x140c6c[_0x9da1('0x21')]['user'],'pass':_0x140c6c[_0x9da1('0x21')][_0x9da1('0x28')]};}var _0xd7f28f={'account':_0x269628,'message':_[_0x9da1('0x29')]({'from':util[_0x9da1('0x2a')](_0x9da1('0x2b'),_0x140c6c['name'],_0x140c6c[_0x9da1('0x1f')]||_0x140c6c['Smtp']['user'])},_0x27c6e2)};return client[_0x9da1('0x2c')]('SendMail',_0xd7f28f);})[_0x9da1('0xa')](function(_0x23b8e5){if(_0x23b8e5[_0x9da1('0x2d')]){throw new Error(util[_0x9da1('0x2a')](_0x9da1('0x2e'),_0x23b8e5[_0x9da1('0x2d')][_0x9da1('0x2f')]||JSON[_0x9da1('0x30')](_0x23b8e5['error'])));}return!![];});}function handleError(_0x41172d,_0x4c78af,_0x22a42f){return _0x41172d['status'](_0x4c78af||0x1f4)['send']({'message':_0x22a42f?_0x22a42f[_0x9da1('0x2f')]||_0x22a42f:''});}exports['login']=function(_0x4593f4,_0x227a1c,_0x5dea20){passport[_0x9da1('0x14')](_0x9da1('0x31'),function(_0x390457,_0x468d91,_0x56bd49){var _0x257c2e=_0x390457||_0x56bd49;if(_0x257c2e){return handleError(_0x227a1c,0x191,_0x257c2e);}if(!_0x468d91){return handleError(_0x227a1c,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2bb9e4={'payload':{'id':_0x468d91['id'],'role':_0x468d91['role']},'options':{'expiresIn':0x15180}};return authService[_0x9da1('0x32')](_0x2bb9e4)[_0x9da1('0xa')](function(_0x58e165){_0x227a1c[_0x9da1('0x33')]({'id':_0x468d91['id'],'token':_0x58e165,'statusCall':'','isAlreadyLogged':_0x468d91[_0x9da1('0x34')]});});}})(_0x4593f4,_0x227a1c,_0x5dea20);};exports[_0x9da1('0x35')]=function(_0x4e9af3,_0x5d867d,_0x53fc15){if(!_0x4e9af3[_0x9da1('0x36')]['email']){return handleError(_0x5d867d,0x1f4,{'message':_0x9da1('0x37')});}var _0x287afe=rs[_0x9da1('0x38')]();_0x4e9af3[_0x9da1('0x36')]['email']=_0x4e9af3[_0x9da1('0x36')][_0x9da1('0x1f')][_0x9da1('0x39')]()[_0x9da1('0x3a')]();var _0x28fc88;return db[_0x9da1('0x3b')][_0x9da1('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9da1('0x19')],'raw':!![]})['then'](function(_0x3bb1da){_0x28fc88=_0x3bb1da;return db['User'][_0x9da1('0x3c')]({'where':{'email':_0x4e9af3[_0x9da1('0x36')]['email']}});})[_0x9da1('0xa')](function(_0xfeec5f){if(!_0xfeec5f){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xfeec5f[_0x9da1('0x16')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0xfeec5f[_0x9da1('0x18')]){if(moment(_0xfeec5f[_0x9da1('0x10')])['add'](_0x28fc88['blockDuration'],_0x9da1('0x1b'))>moment()){throw new Error(_0x9da1('0x3d'));}else{_0xfeec5f[_0x9da1('0x18')]=![];_0xfeec5f[_0x9da1('0x10')]=null;}}_0xfeec5f[_0x9da1('0x3e')]=_0x287afe;_0xfeec5f[_0x9da1('0x3f')]=Date[_0x9da1('0x40')]()+0x36ee80;return _0xfeec5f[_0x9da1('0x41')]();})['then'](function(){return sendServiceMail({'to':_0x4e9af3[_0x9da1('0x36')][_0x9da1('0x1f')],'subject':_0x9da1('0x42'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x9da1('0x43')+_0x9da1('0x44')+_0x4e9af3[_0x9da1('0x45')]['host']+_0x9da1('0x46')+_0x287afe+'\x0a\x0a'+_0x9da1('0x47')});})[_0x9da1('0xa')](function(){_0x5d867d['status'](0xc8)[_0x9da1('0x48')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0xfbdde9){return handleError(_0x5d867d,0x1f4,_0xfbdde9);});};exports[_0x9da1('0x49')]=function(_0x5afbc7,_0x712d10,_0x2066d2){return db['User'][_0x9da1('0x3c')]({'where':{'resetPasswordToken':_0x5afbc7[_0x9da1('0x4a')][_0x9da1('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x9da1('0x40')]()}}})[_0x9da1('0xa')](function(_0x39ca29){if(!_0x39ca29){throw new Error(_0x9da1('0x4c'));}return db[_0x9da1('0x3b')][_0x9da1('0xb')]({'attributes':['id','securePassword',_0x9da1('0x4d'),_0x9da1('0x4e')]})[_0x9da1('0xa')](function(_0x181270){if(_0x181270['securePassword'])authService['validatePasswordPattern'](_0x5afbc7[_0x9da1('0x36')][_0x9da1('0xd')]);if(!_0x181270[_0x9da1('0x4d')]||!_0x39ca29[_0x9da1('0x4f')])return _0x39ca29;authService[_0x9da1('0x50')](_0x5afbc7[_0x9da1('0x36')][_0x9da1('0xd')],_0x39ca29[_0x9da1('0x4f')],_0x181270[_0x9da1('0x4e')]);return _0x39ca29;})[_0x9da1('0xa')](function(){_0x39ca29[_0x9da1('0xd')]=_0x5afbc7[_0x9da1('0x36')][_0x9da1('0xd')];_0x39ca29[_0x9da1('0x3e')]=null;_0x39ca29['resetPasswordExpires']=null;return _0x39ca29[_0x9da1('0x41')]();});})[_0x9da1('0xa')](function(){_0x712d10['status'](0xc8)[_0x9da1('0x48')]({'message':'Password\x20reset!'});})[_0x9da1('0x1e')](function(_0x4f4980){return handleError(_0x712d10,0x1f4,_0x4f4980);});};passport[_0x9da1('0x51')](new LocalStrategy({'usernameField':_0x9da1('0xc'),'passwordField':_0x9da1('0xd')},function(_0x72eb89,_0x32d131,_0x2cb7a4){return localAuthenticate(db[_0x9da1('0x52')],_0x72eb89,_0x32d131,_0x2cb7a4);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 542e911..80cfabc 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 _0x3cfe=['express','Router','post','login','forgot','/reset/:token','reset','exports'];(function(_0x207286,_0x4900f9){var _0x2b9cbc=function(_0x4c16d3){while(--_0x4c16d3){_0x207286['push'](_0x207286['shift']());}};_0x2b9cbc(++_0x4900f9);}(_0x3cfe,0x138));var _0xe3cf=function(_0x18fc7e,_0x25339a){_0x18fc7e=_0x18fc7e-0x0;var _0x40996b=_0x3cfe[_0x18fc7e];return _0x40996b;};'use strict';var express=require(_0xe3cf('0x0'));var router=express[_0xe3cf('0x1')]();var controller=require('./authLocal.controller');router[_0xe3cf('0x2')]('/',controller[_0xe3cf('0x3')]);router[_0xe3cf('0x2')]('/forgot',controller[_0xe3cf('0x4')]);router['post'](_0xe3cf('0x5'),controller[_0xe3cf('0x6')]);module[_0xe3cf('0x7')]=router; \ No newline at end of file +var _0xc06f=['reset','exports','express','./authLocal.controller','post','login','forgot'];(function(_0x279479,_0x44673b){var _0x4f7a36=function(_0x1d0c22){while(--_0x1d0c22){_0x279479['push'](_0x279479['shift']());}};_0x4f7a36(++_0x44673b);}(_0xc06f,0x1a6));var _0xfc06=function(_0x5bf1e4,_0xbc36eb){_0x5bf1e4=_0x5bf1e4-0x0;var _0x126392=_0xc06f[_0x5bf1e4];return _0x126392;};'use strict';var express=require(_0xfc06('0x0'));var router=express['Router']();var controller=require(_0xfc06('0x1'));router[_0xfc06('0x2')]('/',controller[_0xfc06('0x3')]);router[_0xfc06('0x2')]('/forgot',controller[_0xfc06('0x4')]);router[_0xfc06('0x2')]('/reset/:token',controller[_0xfc06('0x5')]);module[_0xfc06('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 1374e1d..5d687a5 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 _0xc2a6=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x3f28c6,_0x539420){var _0x5820fd=function(_0x361877){while(--_0x361877){_0x3f28c6['push'](_0x3f28c6['shift']());}};_0x5820fd(++_0x539420);}(_0xc2a6,0xd6));var _0x6c2a=function(_0x55c1a9,_0x40c271){_0x55c1a9=_0x55c1a9-0x0;var _0xc1e083=_0xc2a6[_0x55c1a9];return _0xc1e083;};'use strict';var Sequelize=require(_0x6c2a('0x0'));module['exports']={'name':{'type':Sequelize[_0x6c2a('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x6c2a('0x1')]},'description':{'type':Sequelize[_0x6c2a('0x1')]},'status':{'type':Sequelize[_0x6c2a('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6c2a('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x70ce=['exports','BOOLEAN','INTEGER'];(function(_0x255caf,_0x2f893b){var _0x25e862=function(_0xffbed9){while(--_0xffbed9){_0x255caf['push'](_0x255caf['shift']());}};_0x25e862(++_0x2f893b);}(_0x70ce,0x120));var _0xe70c=function(_0x123db1,_0x4faec1){_0x123db1=_0x123db1-0x0;var _0x1d50b3=_0x70ce[_0x123db1];return _0x1d50b3;};'use strict';var Sequelize=require('sequelize');module[_0xe70c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xe70c('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe70c('0x2')],'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 4f6b6bb..70b5bc9 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 _0xa23c=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','set','json','apply','save','then','destroy','error','stack','send','index','Automation','rawAttributes','type','key','model','map','name','filters','query','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','find','Condition','addConditions','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x47e309,_0x1e771a){var _0x2e1900=function(_0x407297){while(--_0x407297){_0x47e309['push'](_0x47e309['shift']());}};_0x2e1900(++_0x1e771a);}(_0xa23c,0x9b));var _0xca23=function(_0x3729c5,_0x2981a5){_0x3729c5=_0x3729c5-0x0;var _0x57ae10=_0xa23c[_0x3729c5];return _0x57ae10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xca23('0x0'));var rp=require(_0xca23('0x1'));var moment=require(_0xca23('0x2'));var BPromise=require(_0xca23('0x3'));var Mustache=require(_0xca23('0x4'));var util=require(_0xca23('0x5'));var path=require(_0xca23('0x6'));var sox=require(_0xca23('0x7'));var csv=require(_0xca23('0x8'));var ejs=require(_0xca23('0x9'));var fs=require('fs');var fs_extra=require(_0xca23('0xa'));var _=require(_0xca23('0xb'));var squel=require('squel');var crypto=require(_0xca23('0xc'));var jsforce=require(_0xca23('0xd'));var deskjs=require(_0xca23('0xe'));var toCsv=require(_0xca23('0x8'));var querystring=require(_0xca23('0xf'));var Papa=require(_0xca23('0x10'));var Redis=require(_0xca23('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xca23('0x12'));var as=require(_0xca23('0x13'));var hardwareService=require(_0xca23('0x14'));var logger=require(_0xca23('0x15'))(_0xca23('0x16'));var utils=require(_0xca23('0x17'));var config=require(_0xca23('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xca23('0x19'))['db'];function respondWithStatusCode(_0x2495a4,_0x193b40){_0x193b40=_0x193b40||0xcc;return function(_0x4e7bba){if(_0x4e7bba){return _0x2495a4[_0xca23('0x1a')](_0x193b40);}return _0x2495a4['status'](_0x193b40)[_0xca23('0x1b')]();};}function respondWithResult(_0x108793,_0x232547){_0x232547=_0x232547||0xc8;return function(_0x547682){if(_0x547682){return _0x108793['status'](_0x232547)['json'](_0x547682);}};}function respondWithFilteredResult(_0x55c75b,_0x28adaa){return function(_0x549440){if(_0x549440){var _0x37214c=_0x549440[_0xca23('0x1c')],_0x1df746=_0x28adaa['offset'],_0x7d3192=_0x28adaa[_0xca23('0x1d')]+_0x28adaa[_0xca23('0x1e')],_0x30457c;if(_0x7d3192>=_0x37214c){_0x7d3192=_0x37214c;_0x30457c=0xc8;}else{_0x30457c=0xce;}_0x55c75b[_0xca23('0x1f')](_0x30457c);return _0x55c75b[_0xca23('0x20')]('Content-Range',_0x1df746+'-'+_0x7d3192+'/'+_0x37214c)[_0xca23('0x21')](_0x549440);}return null;};}function patchUpdates(_0x25d860){return function(_0x5036d9){try{jsonpatch[_0xca23('0x22')](_0x5036d9,_0x25d860,!![]);}catch(_0x1cdd6d){return BPromise['reject'](_0x1cdd6d);}return _0x5036d9[_0xca23('0x23')]();};}function saveUpdates(_0x1a91ce,_0x51d695){return function(_0x3507a8){if(_0x3507a8){return _0x3507a8['update'](_0x1a91ce)[_0xca23('0x24')](function(_0x97de38){return _0x97de38;});}return null;};}function removeEntity(_0x19125c,_0x595faf){return function(_0x26738a){if(_0x26738a){return _0x26738a[_0xca23('0x25')]()[_0xca23('0x24')](function(){_0x19125c['status'](0xcc)[_0xca23('0x1b')]();});}};}function handleEntityNotFound(_0x508930,_0x389deb){return function(_0x28de2a){if(!_0x28de2a){_0x508930[_0xca23('0x1a')](0x194);}return _0x28de2a;};}function handleError(_0x4a6fbd,_0x17d274){_0x17d274=_0x17d274||0x1f4;return function(_0x1b04c2){logger[_0xca23('0x26')](_0x1b04c2[_0xca23('0x27')]);if(_0x1b04c2['name']){delete _0x1b04c2['name'];}_0x4a6fbd[_0xca23('0x1f')](_0x17d274)[_0xca23('0x28')](_0x1b04c2);};}exports[_0xca23('0x29')]=function(_0x5162cd,_0x77dcb9){var _0x99fcd2={},_0x53860a={},_0x2cc47b={'count':0x0,'rows':[]};var _0x431ed6=_['map'](db[_0xca23('0x2a')][_0xca23('0x2b')],function(_0x3abbb0){return{'name':_0x3abbb0['fieldName'],'type':_0x3abbb0[_0xca23('0x2c')][_0xca23('0x2d')]};});_0x53860a[_0xca23('0x2e')]=_[_0xca23('0x2f')](_0x431ed6,_0xca23('0x30'));_0x53860a['query']=_['keys'](_0x5162cd['query']);_0x53860a[_0xca23('0x31')]=_['intersection'](_0x53860a[_0xca23('0x2e')],_0x53860a[_0xca23('0x32')]);_0x99fcd2[_0xca23('0x33')]=_[_0xca23('0x34')](_0x53860a[_0xca23('0x2e')],qs[_0xca23('0x35')](_0x5162cd[_0xca23('0x32')][_0xca23('0x35')]));_0x99fcd2['attributes']=_0x99fcd2[_0xca23('0x33')]['length']?_0x99fcd2[_0xca23('0x33')]:_0x53860a[_0xca23('0x2e')];if(!_0x5162cd['query']['hasOwnProperty'](_0xca23('0x36'))){_0x99fcd2[_0xca23('0x1e')]=qs['limit'](_0x5162cd[_0xca23('0x32')][_0xca23('0x1e')]);_0x99fcd2[_0xca23('0x1d')]=qs[_0xca23('0x1d')](_0x5162cd['query'][_0xca23('0x1d')]);}_0x99fcd2[_0xca23('0x37')]=qs[_0xca23('0x38')](_0x5162cd['query'][_0xca23('0x38')]);_0x99fcd2[_0xca23('0x39')]=qs['filters'](_[_0xca23('0x3a')](_0x5162cd['query'],_0x53860a[_0xca23('0x31')]),_0x431ed6);if(_0x5162cd[_0xca23('0x32')][_0xca23('0x3b')]){_0x99fcd2[_0xca23('0x39')]=_[_0xca23('0x3c')](_0x99fcd2[_0xca23('0x39')],{'$or':_[_0xca23('0x2f')](_0x431ed6,function(_0x5e7109){if(_0x5e7109['type']!==_0xca23('0x3d')){var _0x2a136e={};_0x2a136e[_0x5e7109['name']]={'$like':'%'+_0x5162cd[_0xca23('0x32')][_0xca23('0x3b')]+'%'};return _0x2a136e;}})});}_0x99fcd2=_[_0xca23('0x3c')]({},_0x99fcd2,_0x5162cd['options']);var _0x9c237b={'where':_0x99fcd2[_0xca23('0x39')]};return db['Automation'][_0xca23('0x1c')](_0x9c237b)['then'](function(_0x3f9627){_0x2cc47b['count']=_0x3f9627;if(_0x5162cd[_0xca23('0x32')][_0xca23('0x3e')]){_0x99fcd2[_0xca23('0x3f')]=[{'all':!![]}];}return db[_0xca23('0x2a')][_0xca23('0x40')](_0x99fcd2);})['then'](function(_0x530f7d){_0x2cc47b[_0xca23('0x41')]=_0x530f7d;return _0x2cc47b;})['then'](respondWithFilteredResult(_0x77dcb9,_0x99fcd2))[_0xca23('0x42')](handleError(_0x77dcb9,null));};exports[_0xca23('0x43')]=function(_0x4a4aa4,_0xd1c1f8){var _0x461ca8={'raw':![],'where':{'id':_0x4a4aa4[_0xca23('0x44')]['id']}},_0x43783c={};_0x43783c[_0xca23('0x2e')]=_[_0xca23('0x45')](db['Automation']['rawAttributes']);_0x43783c[_0xca23('0x32')]=_['keys'](_0x4a4aa4[_0xca23('0x32')]);_0x43783c[_0xca23('0x31')]=_[_0xca23('0x34')](_0x43783c['model'],_0x43783c[_0xca23('0x32')]);_0x461ca8[_0xca23('0x33')]=_[_0xca23('0x34')](_0x43783c[_0xca23('0x2e')],qs[_0xca23('0x35')](_0x4a4aa4[_0xca23('0x32')][_0xca23('0x35')]));_0x461ca8[_0xca23('0x33')]=_0x461ca8[_0xca23('0x33')][_0xca23('0x46')]?_0x461ca8[_0xca23('0x33')]:_0x43783c[_0xca23('0x2e')];if(_0x4a4aa4[_0xca23('0x32')][_0xca23('0x3e')]){_0x461ca8['include']=[{'all':!![]}];}_0x461ca8=_['merge']({},_0x461ca8,_0x4a4aa4['options']);return db[_0xca23('0x2a')]['find'](_0x461ca8)[_0xca23('0x24')](handleEntityNotFound(_0xd1c1f8,null))[_0xca23('0x24')](respondWithResult(_0xd1c1f8,null))[_0xca23('0x42')](handleError(_0xd1c1f8,null));};exports[_0xca23('0x47')]=function(_0x50ab58,_0x8c2fff){return db[_0xca23('0x2a')][_0xca23('0x47')](_0x50ab58['body'],{})[_0xca23('0x24')](respondWithResult(_0x8c2fff,0xc9))['catch'](handleError(_0x8c2fff,null));};exports['update']=function(_0x56cae9,_0x30b094){if(_0x56cae9[_0xca23('0x48')]['id']){delete _0x56cae9[_0xca23('0x48')]['id'];}return db[_0xca23('0x2a')][_0xca23('0x49')]({'where':{'id':_0x56cae9['params']['id']}})['then'](handleEntityNotFound(_0x30b094,null))[_0xca23('0x24')](saveUpdates(_0x56cae9[_0xca23('0x48')],null))[_0xca23('0x24')](respondWithResult(_0x30b094,null))[_0xca23('0x42')](handleError(_0x30b094,null));};exports[_0xca23('0x25')]=function(_0x4729cc,_0x313677){return db[_0xca23('0x2a')]['find']({'where':{'id':_0x4729cc[_0xca23('0x44')]['id']}})['then'](handleEntityNotFound(_0x313677,null))['then'](removeEntity(_0x313677,null))[_0xca23('0x42')](handleError(_0x313677,null));};exports['addConditions']=function(_0x53e199,_0x2bc238,_0x2edc41){return db[_0xca23('0x4a')][_0xca23('0x49')]({'where':{'id':_0x53e199['params']['id']}})[_0xca23('0x24')](handleEntityNotFound(_0x2bc238,null))[_0xca23('0x24')](function(_0x3029ef){if(_0x3029ef){return _0x3029ef[_0xca23('0x4b')](_0x53e199[_0xca23('0x48')][_0xca23('0x4c')],_[_0xca23('0x4d')](_0x53e199['body'],[_0xca23('0x4c'),'id'])||{});}})[_0xca23('0x24')](respondWithResult(_0x2bc238,null))[_0xca23('0x42')](handleError(_0x2bc238,null));};exports[_0xca23('0x4e')]=function(_0x1ca7c2,_0x22b372,_0x257b73){var _0x54fae4={};var _0x1164f2={};var _0x3fb4a9;var _0x41dfa6;return db['Automation'][_0xca23('0x4f')]({'where':{'id':_0x1ca7c2[_0xca23('0x44')]['id']}})[_0xca23('0x24')](handleEntityNotFound(_0x22b372,null))['then'](function(_0x3384e2){if(_0x3384e2){_0x3fb4a9=_0x3384e2;_0x1164f2[_0xca23('0x2e')]=_[_0xca23('0x45')](db[_0xca23('0x4a')][_0xca23('0x2b')]);_0x1164f2[_0xca23('0x32')]=_[_0xca23('0x45')](_0x1ca7c2[_0xca23('0x32')]);_0x1164f2[_0xca23('0x31')]=_[_0xca23('0x34')](_0x1164f2['model'],_0x1164f2['query']);_0x54fae4[_0xca23('0x33')]=_[_0xca23('0x34')](_0x1164f2[_0xca23('0x2e')],qs['fields'](_0x1ca7c2[_0xca23('0x32')][_0xca23('0x35')]));_0x54fae4[_0xca23('0x33')]=_0x54fae4[_0xca23('0x33')][_0xca23('0x46')]?_0x54fae4[_0xca23('0x33')]:_0x1164f2[_0xca23('0x2e')];_0x54fae4[_0xca23('0x37')]=qs[_0xca23('0x38')](_0x1ca7c2[_0xca23('0x32')][_0xca23('0x38')]);_0x54fae4[_0xca23('0x39')]=qs['filters'](_[_0xca23('0x3a')](_0x1ca7c2[_0xca23('0x32')],_0x1164f2[_0xca23('0x31')]));if(_0x1ca7c2['query'][_0xca23('0x3b')]){_0x54fae4[_0xca23('0x39')]=_[_0xca23('0x3c')](_0x54fae4[_0xca23('0x39')],{'$or':_[_0xca23('0x2f')](_0x54fae4['attributes'],function(_0x3e61e1){var _0x333a17={};_0x333a17[_0x3e61e1]={'$like':'%'+_0x1ca7c2['query'][_0xca23('0x3b')]+'%'};return _0x333a17;})});}_0x54fae4=_[_0xca23('0x3c')]({},_0x54fae4,_0x1ca7c2['options']);return _0x3fb4a9[_0xca23('0x4e')](_0x54fae4);}})['then'](function(_0x2595ac){if(_0x2595ac){_0x41dfa6=_0x2595ac[_0xca23('0x46')];if(!_0x1ca7c2[_0xca23('0x32')][_0xca23('0x50')](_0xca23('0x36'))){_0x54fae4[_0xca23('0x1e')]=qs[_0xca23('0x1e')](_0x1ca7c2['query'][_0xca23('0x1e')]);_0x54fae4[_0xca23('0x1d')]=qs[_0xca23('0x1d')](_0x1ca7c2['query'][_0xca23('0x1d')]);}return _0x3fb4a9['getConditions'](_0x54fae4);}})[_0xca23('0x24')](function(_0x23d86e){if(_0x23d86e){return _0x23d86e?{'count':_0x41dfa6,'rows':_0x23d86e}:null;}})['then'](respondWithResult(_0x22b372,null))[_0xca23('0x42')](handleError(_0x22b372,null));};exports[_0xca23('0x51')]=function(_0x5da492,_0x186488,_0x28c2cd){return db[_0xca23('0x52')]['find']({'where':{'id':_0x5da492['params']['id']}})[_0xca23('0x24')](handleEntityNotFound(_0x186488,null))[_0xca23('0x24')](function(_0x204414){if(_0x204414){return _0x204414[_0xca23('0x51')](_0x5da492[_0xca23('0x48')][_0xca23('0x4c')],_[_0xca23('0x4d')](_0x5da492['body'],[_0xca23('0x4c'),'id'])||{});}})[_0xca23('0x24')](respondWithResult(_0x186488,null))[_0xca23('0x42')](handleError(_0x186488,null));};exports['getActions']=function(_0x15afcc,_0x53171c,_0x39dcce){var _0x46842c={};var _0x2dc4d9={};var _0x321703;var _0x525c86;return db[_0xca23('0x2a')][_0xca23('0x4f')]({'where':{'id':_0x15afcc[_0xca23('0x44')]['id']}})[_0xca23('0x24')](handleEntityNotFound(_0x53171c,null))[_0xca23('0x24')](function(_0x542e98){if(_0x542e98){_0x321703=_0x542e98;_0x2dc4d9['model']=_[_0xca23('0x45')](db[_0xca23('0x52')][_0xca23('0x2b')]);_0x2dc4d9[_0xca23('0x32')]=_[_0xca23('0x45')](_0x15afcc[_0xca23('0x32')]);_0x2dc4d9[_0xca23('0x31')]=_[_0xca23('0x34')](_0x2dc4d9[_0xca23('0x2e')],_0x2dc4d9[_0xca23('0x32')]);_0x46842c[_0xca23('0x33')]=_['intersection'](_0x2dc4d9['model'],qs[_0xca23('0x35')](_0x15afcc[_0xca23('0x32')]['fields']));_0x46842c[_0xca23('0x33')]=_0x46842c[_0xca23('0x33')][_0xca23('0x46')]?_0x46842c[_0xca23('0x33')]:_0x2dc4d9[_0xca23('0x2e')];_0x46842c[_0xca23('0x37')]=qs[_0xca23('0x38')](_0x15afcc[_0xca23('0x32')][_0xca23('0x38')]);_0x46842c['where']=qs[_0xca23('0x31')](_[_0xca23('0x3a')](_0x15afcc[_0xca23('0x32')],_0x2dc4d9[_0xca23('0x31')]));if(_0x15afcc[_0xca23('0x32')]['filter']){_0x46842c['where']=_[_0xca23('0x3c')](_0x46842c[_0xca23('0x39')],{'$or':_[_0xca23('0x2f')](_0x46842c[_0xca23('0x33')],function(_0x3ecd5e){var _0xcb34bd={};_0xcb34bd[_0x3ecd5e]={'$like':'%'+_0x15afcc[_0xca23('0x32')][_0xca23('0x3b')]+'%'};return _0xcb34bd;})});}_0x46842c=_[_0xca23('0x3c')]({},_0x46842c,_0x15afcc['options']);return _0x321703[_0xca23('0x53')](_0x46842c);}})['then'](function(_0x32eeaf){if(_0x32eeaf){_0x525c86=_0x32eeaf[_0xca23('0x46')];if(!_0x15afcc[_0xca23('0x32')][_0xca23('0x50')]('nolimit')){_0x46842c[_0xca23('0x1e')]=qs[_0xca23('0x1e')](_0x15afcc[_0xca23('0x32')][_0xca23('0x1e')]);_0x46842c[_0xca23('0x1d')]=qs[_0xca23('0x1d')](_0x15afcc[_0xca23('0x32')][_0xca23('0x1d')]);}return _0x321703[_0xca23('0x53')](_0x46842c);}})[_0xca23('0x24')](function(_0x376145){if(_0x376145){return _0x376145?{'count':_0x525c86,'rows':_0x376145}:null;}})[_0xca23('0x24')](respondWithResult(_0x53171c,null))[_0xca23('0x42')](handleError(_0x53171c,null));}; \ No newline at end of file +var _0x13f3=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','addActions','Action','getActions','pick','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x13f3,0xa1));var _0x313f=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0x13f3[_0x4a82ac];return _0x58ee97;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x313f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x313f('0x1'));var rp=require(_0x313f('0x2'));var moment=require(_0x313f('0x3'));var BPromise=require(_0x313f('0x4'));var Mustache=require(_0x313f('0x5'));var util=require(_0x313f('0x6'));var path=require(_0x313f('0x7'));var sox=require(_0x313f('0x8'));var csv=require(_0x313f('0x9'));var ejs=require(_0x313f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x313f('0xb'));var squel=require(_0x313f('0xc'));var crypto=require(_0x313f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x313f('0xe'));var toCsv=require(_0x313f('0x9'));var querystring=require(_0x313f('0xf'));var Papa=require('papaparse');var Redis=require(_0x313f('0x10'));var authService=require(_0x313f('0x11'));var qs=require(_0x313f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x313f('0x13'));var logger=require(_0x313f('0x14'))(_0x313f('0x15'));var utils=require(_0x313f('0x16'));var config=require(_0x313f('0x17'));var licenseUtil=require(_0x313f('0x18'));var db=require(_0x313f('0x19'))['db'];function respondWithStatusCode(_0x374516,_0x5400de){_0x5400de=_0x5400de||0xcc;return function(_0xfb39e5){if(_0xfb39e5){return _0x374516[_0x313f('0x1a')](_0x5400de);}return _0x374516['status'](_0x5400de)['end']();};}function respondWithResult(_0x486560,_0x5b8e53){_0x5b8e53=_0x5b8e53||0xc8;return function(_0x2050f2){if(_0x2050f2){return _0x486560[_0x313f('0x1b')](_0x5b8e53)[_0x313f('0x1c')](_0x2050f2);}};}function respondWithFilteredResult(_0x431efd,_0x25185a){return function(_0x3ea5db){if(_0x3ea5db){var _0x44ac9b=_0x3ea5db[_0x313f('0x1d')],_0x4f6b50=_0x25185a['offset'],_0x4008bd=_0x25185a[_0x313f('0x1e')]+_0x25185a['limit'],_0x838fb8;if(_0x4008bd>=_0x44ac9b){_0x4008bd=_0x44ac9b;_0x838fb8=0xc8;}else{_0x838fb8=0xce;}_0x431efd[_0x313f('0x1b')](_0x838fb8);return _0x431efd[_0x313f('0x1f')](_0x313f('0x20'),_0x4f6b50+'-'+_0x4008bd+'/'+_0x44ac9b)['json'](_0x3ea5db);}return null;};}function patchUpdates(_0x3bb87f){return function(_0x57a8b3){try{jsonpatch[_0x313f('0x21')](_0x57a8b3,_0x3bb87f,!![]);}catch(_0xc8e817){return BPromise[_0x313f('0x22')](_0xc8e817);}return _0x57a8b3[_0x313f('0x23')]();};}function saveUpdates(_0x1a3d60,_0x57f34e){return function(_0x3f4430){if(_0x3f4430){return _0x3f4430[_0x313f('0x24')](_0x1a3d60)[_0x313f('0x25')](function(_0x1127d1){return _0x1127d1;});}return null;};}function removeEntity(_0x3d6ca8,_0x56ea5b){return function(_0x47b99d){if(_0x47b99d){return _0x47b99d[_0x313f('0x26')]()[_0x313f('0x25')](function(){_0x3d6ca8[_0x313f('0x1b')](0xcc)[_0x313f('0x27')]();});}};}function handleEntityNotFound(_0x9a91d0,_0xac4383){return function(_0x1ba073){if(!_0x1ba073){_0x9a91d0[_0x313f('0x1a')](0x194);}return _0x1ba073;};}function handleError(_0x5de6af,_0x51bcfd){_0x51bcfd=_0x51bcfd||0x1f4;return function(_0x3aa7b0){logger[_0x313f('0x28')](_0x3aa7b0['stack']);if(_0x3aa7b0[_0x313f('0x29')]){delete _0x3aa7b0['name'];}_0x5de6af['status'](_0x51bcfd)[_0x313f('0x2a')](_0x3aa7b0);};}exports[_0x313f('0x2b')]=function(_0x30140b,_0x1a4da1){var _0x587f32={},_0x100dc0={},_0x30c533={'count':0x0,'rows':[]};var _0x2b4b94=_[_0x313f('0x2c')](db[_0x313f('0x2d')][_0x313f('0x2e')],function(_0x37753d){return{'name':_0x37753d[_0x313f('0x2f')],'type':_0x37753d[_0x313f('0x30')][_0x313f('0x31')]};});_0x100dc0[_0x313f('0x32')]=_[_0x313f('0x2c')](_0x2b4b94,'name');_0x100dc0['query']=_['keys'](_0x30140b[_0x313f('0x33')]);_0x100dc0['filters']=_['intersection'](_0x100dc0[_0x313f('0x32')],_0x100dc0['query']);_0x587f32[_0x313f('0x34')]=_[_0x313f('0x35')](_0x100dc0[_0x313f('0x32')],qs[_0x313f('0x36')](_0x30140b[_0x313f('0x33')][_0x313f('0x36')]));_0x587f32['attributes']=_0x587f32[_0x313f('0x34')][_0x313f('0x37')]?_0x587f32[_0x313f('0x34')]:_0x100dc0[_0x313f('0x32')];if(!_0x30140b[_0x313f('0x33')][_0x313f('0x38')](_0x313f('0x39'))){_0x587f32['limit']=qs[_0x313f('0x3a')](_0x30140b[_0x313f('0x33')][_0x313f('0x3a')]);_0x587f32[_0x313f('0x1e')]=qs[_0x313f('0x1e')](_0x30140b[_0x313f('0x33')][_0x313f('0x1e')]);}_0x587f32[_0x313f('0x3b')]=qs[_0x313f('0x3c')](_0x30140b[_0x313f('0x33')][_0x313f('0x3c')]);_0x587f32[_0x313f('0x3d')]=qs[_0x313f('0x3e')](_['pick'](_0x30140b[_0x313f('0x33')],_0x100dc0[_0x313f('0x3e')]),_0x2b4b94);if(_0x30140b[_0x313f('0x33')][_0x313f('0x3f')]){_0x587f32[_0x313f('0x3d')]=_[_0x313f('0x40')](_0x587f32[_0x313f('0x3d')],{'$or':_[_0x313f('0x2c')](_0x2b4b94,function(_0x671003){if(_0x671003[_0x313f('0x30')]!==_0x313f('0x41')){var _0x467b28={};_0x467b28[_0x671003['name']]={'$like':'%'+_0x30140b[_0x313f('0x33')][_0x313f('0x3f')]+'%'};return _0x467b28;}})});}_0x587f32=_[_0x313f('0x40')]({},_0x587f32,_0x30140b[_0x313f('0x42')]);var _0x784a35={'where':_0x587f32[_0x313f('0x3d')]};return db[_0x313f('0x2d')]['count'](_0x784a35)[_0x313f('0x25')](function(_0x28f8cf){_0x30c533['count']=_0x28f8cf;if(_0x30140b[_0x313f('0x33')][_0x313f('0x43')]){_0x587f32[_0x313f('0x44')]=[{'all':!![]}];}return db[_0x313f('0x2d')][_0x313f('0x45')](_0x587f32);})['then'](function(_0x14dd77){_0x30c533[_0x313f('0x46')]=_0x14dd77;return _0x30c533;})[_0x313f('0x25')](respondWithFilteredResult(_0x1a4da1,_0x587f32))[_0x313f('0x47')](handleError(_0x1a4da1,null));};exports[_0x313f('0x48')]=function(_0x4b5918,_0x1b89d8){var _0xb8cb62={'raw':![],'where':{'id':_0x4b5918[_0x313f('0x49')]['id']}},_0x12e02b={};_0x12e02b['model']=_[_0x313f('0x4a')](db['Automation']['rawAttributes']);_0x12e02b['query']=_['keys'](_0x4b5918[_0x313f('0x33')]);_0x12e02b[_0x313f('0x3e')]=_['intersection'](_0x12e02b[_0x313f('0x32')],_0x12e02b['query']);_0xb8cb62[_0x313f('0x34')]=_[_0x313f('0x35')](_0x12e02b['model'],qs[_0x313f('0x36')](_0x4b5918[_0x313f('0x33')][_0x313f('0x36')]));_0xb8cb62[_0x313f('0x34')]=_0xb8cb62[_0x313f('0x34')][_0x313f('0x37')]?_0xb8cb62['attributes']:_0x12e02b[_0x313f('0x32')];if(_0x4b5918['query'][_0x313f('0x43')]){_0xb8cb62['include']=[{'all':!![]}];}_0xb8cb62=_['merge']({},_0xb8cb62,_0x4b5918[_0x313f('0x42')]);return db[_0x313f('0x2d')][_0x313f('0x4b')](_0xb8cb62)[_0x313f('0x25')](handleEntityNotFound(_0x1b89d8,null))[_0x313f('0x25')](respondWithResult(_0x1b89d8,null))['catch'](handleError(_0x1b89d8,null));};exports[_0x313f('0x4c')]=function(_0x3c81c5,_0x56f03d){return db['Automation'][_0x313f('0x4c')](_0x3c81c5[_0x313f('0x4d')],{})[_0x313f('0x25')](respondWithResult(_0x56f03d,0xc9))['catch'](handleError(_0x56f03d,null));};exports[_0x313f('0x24')]=function(_0x3b21b7,_0x100c32){if(_0x3b21b7[_0x313f('0x4d')]['id']){delete _0x3b21b7[_0x313f('0x4d')]['id'];}return db[_0x313f('0x2d')][_0x313f('0x4b')]({'where':{'id':_0x3b21b7[_0x313f('0x49')]['id']}})[_0x313f('0x25')](handleEntityNotFound(_0x100c32,null))[_0x313f('0x25')](saveUpdates(_0x3b21b7[_0x313f('0x4d')],null))[_0x313f('0x25')](respondWithResult(_0x100c32,null))[_0x313f('0x47')](handleError(_0x100c32,null));};exports[_0x313f('0x26')]=function(_0x15f54d,_0x23f419){return db[_0x313f('0x2d')][_0x313f('0x4b')]({'where':{'id':_0x15f54d[_0x313f('0x49')]['id']}})[_0x313f('0x25')](handleEntityNotFound(_0x23f419,null))['then'](removeEntity(_0x23f419,null))['catch'](handleError(_0x23f419,null));};exports[_0x313f('0x4e')]=function(_0x3588a3,_0x4ee831,_0x481836){return db[_0x313f('0x4f')][_0x313f('0x4b')]({'where':{'id':_0x3588a3[_0x313f('0x49')]['id']}})[_0x313f('0x25')](handleEntityNotFound(_0x4ee831,null))[_0x313f('0x25')](function(_0x554726){if(_0x554726){return _0x554726[_0x313f('0x4e')](_0x3588a3[_0x313f('0x4d')]['ids'],_[_0x313f('0x50')](_0x3588a3[_0x313f('0x4d')],[_0x313f('0x51'),'id'])||{});}})[_0x313f('0x25')](respondWithResult(_0x4ee831,null))[_0x313f('0x47')](handleError(_0x4ee831,null));};exports[_0x313f('0x52')]=function(_0x43be24,_0x310177,_0x4a447a){var _0x43f08f={};var _0xe9cefe={};var _0x380317;var _0x2807e4;return db[_0x313f('0x2d')][_0x313f('0x53')]({'where':{'id':_0x43be24['params']['id']}})[_0x313f('0x25')](handleEntityNotFound(_0x310177,null))['then'](function(_0x56d194){if(_0x56d194){_0x380317=_0x56d194;_0xe9cefe['model']=_[_0x313f('0x4a')](db[_0x313f('0x4f')][_0x313f('0x2e')]);_0xe9cefe['query']=_[_0x313f('0x4a')](_0x43be24[_0x313f('0x33')]);_0xe9cefe[_0x313f('0x3e')]=_[_0x313f('0x35')](_0xe9cefe['model'],_0xe9cefe[_0x313f('0x33')]);_0x43f08f[_0x313f('0x34')]=_['intersection'](_0xe9cefe[_0x313f('0x32')],qs[_0x313f('0x36')](_0x43be24[_0x313f('0x33')][_0x313f('0x36')]));_0x43f08f[_0x313f('0x34')]=_0x43f08f['attributes']['length']?_0x43f08f['attributes']:_0xe9cefe[_0x313f('0x32')];_0x43f08f['order']=qs[_0x313f('0x3c')](_0x43be24[_0x313f('0x33')][_0x313f('0x3c')]);_0x43f08f[_0x313f('0x3d')]=qs['filters'](_['pick'](_0x43be24[_0x313f('0x33')],_0xe9cefe[_0x313f('0x3e')]));if(_0x43be24[_0x313f('0x33')]['filter']){_0x43f08f[_0x313f('0x3d')]=_[_0x313f('0x40')](_0x43f08f['where'],{'$or':_[_0x313f('0x2c')](_0x43f08f['attributes'],function(_0x483b42){var _0x5dff5b={};_0x5dff5b[_0x483b42]={'$like':'%'+_0x43be24[_0x313f('0x33')]['filter']+'%'};return _0x5dff5b;})});}_0x43f08f=_['merge']({},_0x43f08f,_0x43be24[_0x313f('0x42')]);return _0x380317[_0x313f('0x52')](_0x43f08f);}})[_0x313f('0x25')](function(_0x215449){if(_0x215449){_0x2807e4=_0x215449[_0x313f('0x37')];if(!_0x43be24['query'][_0x313f('0x38')](_0x313f('0x39'))){_0x43f08f[_0x313f('0x3a')]=qs[_0x313f('0x3a')](_0x43be24['query'][_0x313f('0x3a')]);_0x43f08f[_0x313f('0x1e')]=qs[_0x313f('0x1e')](_0x43be24['query'][_0x313f('0x1e')]);}return _0x380317[_0x313f('0x52')](_0x43f08f);}})[_0x313f('0x25')](function(_0x33594b){if(_0x33594b){return _0x33594b?{'count':_0x2807e4,'rows':_0x33594b}:null;}})[_0x313f('0x25')](respondWithResult(_0x310177,null))['catch'](handleError(_0x310177,null));};exports[_0x313f('0x54')]=function(_0x40943b,_0x361321,_0x3e6b10){return db[_0x313f('0x55')]['find']({'where':{'id':_0x40943b[_0x313f('0x49')]['id']}})[_0x313f('0x25')](handleEntityNotFound(_0x361321,null))[_0x313f('0x25')](function(_0x394389){if(_0x394389){return _0x394389['addActions'](_0x40943b[_0x313f('0x4d')]['ids'],_[_0x313f('0x50')](_0x40943b[_0x313f('0x4d')],[_0x313f('0x51'),'id'])||{});}})['then'](respondWithResult(_0x361321,null))[_0x313f('0x47')](handleError(_0x361321,null));};exports[_0x313f('0x56')]=function(_0x2efc71,_0x24d851,_0x350204){var _0x4a3dd7={};var _0x2959c1={};var _0x4b6b5b;var _0x9393e6;return db[_0x313f('0x2d')][_0x313f('0x53')]({'where':{'id':_0x2efc71[_0x313f('0x49')]['id']}})[_0x313f('0x25')](handleEntityNotFound(_0x24d851,null))[_0x313f('0x25')](function(_0x38d744){if(_0x38d744){_0x4b6b5b=_0x38d744;_0x2959c1[_0x313f('0x32')]=_[_0x313f('0x4a')](db[_0x313f('0x55')]['rawAttributes']);_0x2959c1[_0x313f('0x33')]=_[_0x313f('0x4a')](_0x2efc71['query']);_0x2959c1[_0x313f('0x3e')]=_[_0x313f('0x35')](_0x2959c1[_0x313f('0x32')],_0x2959c1[_0x313f('0x33')]);_0x4a3dd7[_0x313f('0x34')]=_[_0x313f('0x35')](_0x2959c1[_0x313f('0x32')],qs[_0x313f('0x36')](_0x2efc71[_0x313f('0x33')][_0x313f('0x36')]));_0x4a3dd7[_0x313f('0x34')]=_0x4a3dd7['attributes'][_0x313f('0x37')]?_0x4a3dd7[_0x313f('0x34')]:_0x2959c1[_0x313f('0x32')];_0x4a3dd7[_0x313f('0x3b')]=qs[_0x313f('0x3c')](_0x2efc71[_0x313f('0x33')][_0x313f('0x3c')]);_0x4a3dd7[_0x313f('0x3d')]=qs[_0x313f('0x3e')](_[_0x313f('0x57')](_0x2efc71['query'],_0x2959c1['filters']));if(_0x2efc71[_0x313f('0x33')][_0x313f('0x3f')]){_0x4a3dd7['where']=_[_0x313f('0x40')](_0x4a3dd7['where'],{'$or':_[_0x313f('0x2c')](_0x4a3dd7['attributes'],function(_0x241e7b){var _0x42618c={};_0x42618c[_0x241e7b]={'$like':'%'+_0x2efc71[_0x313f('0x33')][_0x313f('0x3f')]+'%'};return _0x42618c;})});}_0x4a3dd7=_[_0x313f('0x40')]({},_0x4a3dd7,_0x2efc71[_0x313f('0x42')]);return _0x4b6b5b[_0x313f('0x56')](_0x4a3dd7);}})[_0x313f('0x25')](function(_0x5a0ca1){if(_0x5a0ca1){_0x9393e6=_0x5a0ca1['length'];if(!_0x2efc71[_0x313f('0x33')][_0x313f('0x38')]('nolimit')){_0x4a3dd7['limit']=qs[_0x313f('0x3a')](_0x2efc71['query']['limit']);_0x4a3dd7[_0x313f('0x1e')]=qs['offset'](_0x2efc71['query'][_0x313f('0x1e')]);}return _0x4b6b5b[_0x313f('0x56')](_0x4a3dd7);}})[_0x313f('0x25')](function(_0x5ec12b){if(_0x5ec12b){return _0x5ec12b?{'count':_0x9393e6,'rows':_0x5ec12b}:null;}})[_0x313f('0x25')](respondWithResult(_0x24d851,null))['catch'](handleError(_0x24d851,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 1fc2fc0..c51e734 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 _0x0f49=['../../config/logger','api','moment','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','util'];(function(_0x2e30d8,_0x344b2c){var _0x347234=function(_0x5916cf){while(--_0x5916cf){_0x2e30d8['push'](_0x2e30d8['shift']());}};_0x347234(++_0x344b2c);}(_0x0f49,0x8e));var _0x90f4=function(_0x46111d,_0x5d286b){_0x46111d=_0x46111d-0x0;var _0xe82586=_0x0f49[_0x46111d];return _0xe82586;};'use strict';var _=require('lodash');var util=require(_0x90f4('0x0'));var logger=require(_0x90f4('0x1'))(_0x90f4('0x2'));var moment=require(_0x90f4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x90f4('0x4'));var rimraf=require(_0x90f4('0x5'));var config=require(_0x90f4('0x6'));var attributes=require(_0x90f4('0x7'));module[_0x90f4('0x8')]=function(_0x1d9d2f,_0x244b04){return _0x1d9d2f[_0x90f4('0x9')](_0x90f4('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea35=['path','rimraf','./automation.attributes','exports','define','tools_automations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x38d06e,_0x22c3ad){var _0x489daa=function(_0x3f670f){while(--_0x3f670f){_0x38d06e['push'](_0x38d06e['shift']());}};_0x489daa(++_0x22c3ad);}(_0xea35,0x11a));var _0x5ea3=function(_0x10373c,_0x2c5f8a){_0x10373c=_0x10373c-0x0;var _0xf888bf=_0xea35[_0x10373c];return _0xf888bf;};'use strict';var _=require(_0x5ea3('0x0'));var util=require(_0x5ea3('0x1'));var logger=require(_0x5ea3('0x2'))('api');var moment=require(_0x5ea3('0x3'));var BPromise=require(_0x5ea3('0x4'));var rp=require(_0x5ea3('0x5'));var fs=require('fs');var path=require(_0x5ea3('0x6'));var rimraf=require(_0x5ea3('0x7'));var config=require('../../config/environment');var attributes=require(_0x5ea3('0x8'));module[_0x5ea3('0x9')]=function(_0x29f582,_0x12ed4c){return _0x29f582[_0x5ea3('0xa')]('Automation',attributes,{'tableName':_0x5ea3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index d58f2ec..4ec5cea 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 _0x579f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','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','message','info','result','catch','lodash','util','bluebird'];(function(_0xef9903,_0x1f6af1){var _0x4db20e=function(_0x5d9ce9){while(--_0x5d9ce9){_0xef9903['push'](_0xef9903['shift']());}};_0x4db20e(++_0x1f6af1);}(_0x579f,0x14d));var _0xf579=function(_0x37b4c9,_0x24e0b9){_0x37b4c9=_0x37b4c9-0x0;var _0x1409f1=_0x579f[_0x37b4c9];return _0x1409f1;};'use strict';var _=require(_0xf579('0x0'));var util=require(_0xf579('0x1'));var moment=require('moment');var BPromise=require(_0xf579('0x2'));var rs=require(_0xf579('0x3'));var fs=require('fs');var Redis=require(_0xf579('0x4'));var db=require(_0xf579('0x5'))['db'];var utils=require(_0xf579('0x6'));var logger=require(_0xf579('0x7'))(_0xf579('0x8'));var config=require(_0xf579('0x9'));var jayson=require(_0xf579('0xa'));var client=jayson[_0xf579('0xb')][_0xf579('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21fc96,_0xba7a9e,_0x506834){return new BPromise(function(_0x232e8f,_0x7845ef){return client[_0xf579('0xd')](_0x21fc96,_0x506834)['then'](function(_0x338a7f){logger['info'](_0xf579('0xe'),_0xba7a9e,_0xf579('0xf'));logger[_0xf579('0x10')](_0xf579('0x11'),_0xba7a9e,_0xf579('0xf'),JSON[_0xf579('0x12')](_0x338a7f));if(_0x338a7f[_0xf579('0x13')]){if(_0x338a7f[_0xf579('0x13')]['code']===0x1f4){logger[_0xf579('0x13')](_0xf579('0xe'),_0xba7a9e,_0x338a7f[_0xf579('0x13')][_0xf579('0x14')]);return _0x7845ef(_0x338a7f['error'][_0xf579('0x14')]);}logger[_0xf579('0x13')]('Automation,\x20%s,\x20%s',_0xba7a9e,_0x338a7f['error']['message']);return _0x232e8f(_0x338a7f[_0xf579('0x13')][_0xf579('0x14')]);}else{logger[_0xf579('0x15')](_0xf579('0xe'),_0xba7a9e,_0xf579('0xf'));_0x232e8f(_0x338a7f[_0xf579('0x16')][_0xf579('0x14')]);}})[_0xf579('0x17')](function(_0x2a3a8a){logger[_0xf579('0x13')]('Automation,\x20%s,\x20%s',_0xba7a9e,_0x2a3a8a);_0x7845ef(_0x2a3a8a);});});} \ No newline at end of file +var _0xe397=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xe397,0xac));var _0x7e39=function(_0x14647d,_0x20a244){_0x14647d=_0x14647d-0x0;var _0x3a0cae=_0xe397[_0x14647d];return _0x3a0cae;};'use strict';var _=require(_0x7e39('0x0'));var util=require(_0x7e39('0x1'));var moment=require(_0x7e39('0x2'));var BPromise=require('bluebird');var rs=require(_0x7e39('0x3'));var fs=require('fs');var Redis=require(_0x7e39('0x4'));var db=require(_0x7e39('0x5'))['db'];var utils=require(_0x7e39('0x6'));var logger=require(_0x7e39('0x7'))(_0x7e39('0x8'));var config=require('../../config/environment');var jayson=require(_0x7e39('0x9'));var client=jayson['client'][_0x7e39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28ccef,_0x34400b,_0x51bc8d){return new BPromise(function(_0x1262fe,_0x535d37){return client[_0x7e39('0xb')](_0x28ccef,_0x51bc8d)[_0x7e39('0xc')](function(_0x4450ec){logger[_0x7e39('0xd')](_0x7e39('0xe'),_0x34400b,_0x7e39('0xf'));logger[_0x7e39('0x10')](_0x7e39('0x11'),_0x34400b,'request\x20sent',JSON[_0x7e39('0x12')](_0x4450ec));if(_0x4450ec[_0x7e39('0x13')]){if(_0x4450ec[_0x7e39('0x13')][_0x7e39('0x14')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x34400b,_0x4450ec['error'][_0x7e39('0x15')]);return _0x535d37(_0x4450ec['error'][_0x7e39('0x15')]);}logger['error'](_0x7e39('0xe'),_0x34400b,_0x4450ec['error'][_0x7e39('0x15')]);return _0x1262fe(_0x4450ec[_0x7e39('0x13')][_0x7e39('0x15')]);}else{logger[_0x7e39('0xd')](_0x7e39('0xe'),_0x34400b,'request\x20sent');_0x1262fe(_0x4450ec[_0x7e39('0x16')][_0x7e39('0x15')]);}})[_0x7e39('0x17')](function(_0x577f1a){logger[_0x7e39('0x13')](_0x7e39('0xe'),_0x34400b,_0x577f1a);_0x535d37(_0x577f1a);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 2a805d9..318252a 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 _0x36da=['Router','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x23266e,_0x3647e2){var _0x55c2b6=function(_0x32afd4){while(--_0x32afd4){_0x23266e['push'](_0x23266e['shift']());}};_0x55c2b6(++_0x3647e2);}(_0x36da,0x154));var _0xa36d=function(_0x4444d6,_0x22abc0){_0x4444d6=_0x4444d6-0x0;var _0x22a657=_0x36da[_0x4444d6];return _0x22a657;};'use strict';var multer=require(_0xa36d('0x0'));var util=require(_0xa36d('0x1'));var path=require(_0xa36d('0x2'));var timeout=require(_0xa36d('0x3'));var express=require(_0xa36d('0x4'));var router=express[_0xa36d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa36d('0x6'));var interaction=require(_0xa36d('0x7'));var config=require('../../config/environment');var controller=require(_0xa36d('0x8'));router[_0xa36d('0x9')]('/',auth[_0xa36d('0xa')](),controller[_0xa36d('0xb')]);router[_0xa36d('0x9')](_0xa36d('0xc'),auth[_0xa36d('0xa')](),controller['show']);router[_0xa36d('0x9')](_0xa36d('0xd'),auth[_0xa36d('0xa')](),controller[_0xa36d('0xe')]);router[_0xa36d('0x9')](_0xa36d('0xf'),auth[_0xa36d('0xa')](),controller[_0xa36d('0x10')]);router[_0xa36d('0x11')]('/',auth[_0xa36d('0xa')](),controller[_0xa36d('0x12')]);router[_0xa36d('0x11')]('/:id/conditions',auth[_0xa36d('0xa')](),controller[_0xa36d('0x13')]);router[_0xa36d('0x11')](_0xa36d('0xf'),auth[_0xa36d('0xa')](),controller['addActions']);router['put'](_0xa36d('0xc'),auth[_0xa36d('0xa')](),controller[_0xa36d('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa36d('0x15')]);module[_0xa36d('0x16')]=router; \ No newline at end of file +var _0xfe40=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','delete','destroy','exports'];(function(_0x1d8829,_0x1b3190){var _0x2583a8=function(_0x3c3371){while(--_0x3c3371){_0x1d8829['push'](_0x1d8829['shift']());}};_0x2583a8(++_0x1b3190);}(_0xfe40,0x1cb));var _0x0fe4=function(_0x47e137,_0x51cf7a){_0x47e137=_0x47e137-0x0;var _0x10ed85=_0xfe40[_0x47e137];return _0x10ed85;};'use strict';var multer=require(_0x0fe4('0x0'));var util=require(_0x0fe4('0x1'));var path=require(_0x0fe4('0x2'));var timeout=require(_0x0fe4('0x3'));var express=require(_0x0fe4('0x4'));var router=express[_0x0fe4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0fe4('0x6'));var interaction=require(_0x0fe4('0x7'));var config=require(_0x0fe4('0x8'));var controller=require(_0x0fe4('0x9'));router[_0x0fe4('0xa')]('/',auth[_0x0fe4('0xb')](),controller[_0x0fe4('0xc')]);router[_0x0fe4('0xa')](_0x0fe4('0xd'),auth[_0x0fe4('0xb')](),controller[_0x0fe4('0xe')]);router[_0x0fe4('0xa')](_0x0fe4('0xf'),auth['isAuthenticated'](),controller[_0x0fe4('0x10')]);router[_0x0fe4('0xa')](_0x0fe4('0x11'),auth[_0x0fe4('0xb')](),controller[_0x0fe4('0x12')]);router[_0x0fe4('0x13')]('/',auth[_0x0fe4('0xb')](),controller[_0x0fe4('0x14')]);router['post'](_0x0fe4('0xf'),auth[_0x0fe4('0xb')](),controller[_0x0fe4('0x15')]);router['post']('/:id/actions',auth[_0x0fe4('0xb')](),controller[_0x0fe4('0x16')]);router[_0x0fe4('0x17')](_0x0fe4('0xd'),auth[_0x0fe4('0xb')](),controller['update']);router[_0x0fe4('0x18')](_0x0fe4('0xd'),auth[_0x0fe4('0xb')](),controller[_0x0fe4('0x19')]);module[_0x0fe4('0x1a')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index fca78a8..0b913f5 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 _0xd409=['onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','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)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never'];(function(_0x2074fb,_0x26707f){var _0x4c71d3=function(_0x4d32ef){while(--_0x4d32ef){_0x2074fb['push'](_0x2074fb['shift']());}};_0x4c71d3(++_0x26707f);}(_0xd409,0x173));var _0x9d40=function(_0x1b08d4,_0x8a710c){_0x1b08d4=_0x1b08d4-0x0;var _0x9aef3e=_0xd409[_0x1b08d4];return _0x9aef3e;};'use strict';var Sequelize=require(_0x9d40('0x0'));module[_0x9d40('0x1')]={'name':{'type':Sequelize[_0x9d40('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x9d40('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x9d40('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x9d40('0x5')],'defaultValue':0x0,'comment':_0x9d40('0x6')},'limitCalls':{'type':Sequelize[_0x9d40('0x7')](0x4)[_0x9d40('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9d40('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x9d40('0x7')](0x3)[_0x9d40('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9d40('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9d40('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9d40('0x7')](0x5)[_0x9d40('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d40('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x9d40('0x7')](0x3)[_0x9d40('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x9d40('0x7')](0x5)[_0x9d40('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d40('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9d40('0x7')](0x3)[_0x9d40('0x8')],'defaultValue':0x3,'comment':_0x9d40('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9d40('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d40('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9d40('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9d40('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9d40('0x2')],'defaultValue':_0x9d40('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x9d40('0x3')](_0x9d40('0x11'),_0x9d40('0x12'),_0x9d40('0x13')),'defaultValue':_0x9d40('0x11')},'dialAMDActive':{'type':Sequelize[_0x9d40('0x5')],'defaultValue':0x0,'comment':_0x9d40('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9d40('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9d40('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x9d40('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9d40('0x7')](0x9)[_0x9d40('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9d40('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9d40('0x7')](0x9)[_0x9d40('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9d40('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x9d40('0x7')](0x9)[_0x9d40('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9d40('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9d40('0x7')](0x9)[_0x9d40('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9d40('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x9d40('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9d40('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9d40('0x7')](0x5)[_0x9d40('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9d40('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x9d40('0x1c'),_0x9d40('0x1d')),'defaultValue':_0x9d40('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9d40('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9d40('0x1e')},'dialCutDigit':{'type':Sequelize[_0x9d40('0x7')](0x3)[_0x9d40('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9d40('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9d40('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9d40('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9d40('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d40('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x9d40('0x7')](0x3)[_0x9d40('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9d40('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x9d40('0x7')](0x5)[_0x9d40('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9d40('0x7')](0x3)[_0x9d40('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x9d40('0x7')](0x3)[_0x9d40('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9d40('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9d40('0x7')](0x5)[_0x9d40('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d40('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9d40('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9d40('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9d40('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9d40('0x26')}}; \ No newline at end of file +var _0x3338=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','ENUM','ivr','STRING','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xa28b1a,_0x384f4b){var _0x4c9b78=function(_0x3cf640){while(--_0x3cf640){_0xa28b1a['push'](_0xa28b1a['shift']());}};_0x4c9b78(++_0x384f4b);}(_0x3338,0x114));var _0x8333=function(_0x16ca4a,_0x1ed3e7){_0x16ca4a=_0x16ca4a-0x0;var _0x48f844=_0x3338[_0x16ca4a];return _0x48f844;};'use strict';var Sequelize=require(_0x8333('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8333('0x1')](_0x8333('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x8333('0x3')]},'active':{'type':Sequelize[_0x8333('0x4')],'defaultValue':0x0,'comment':_0x8333('0x5')},'limitCalls':{'type':Sequelize[_0x8333('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8333('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0x8333('0x6')](0x3)[_0x8333('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8333('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8333('0x6')](0x3)[_0x8333('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8333('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8333('0x6')](0x5)[_0x8333('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8333('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x8333('0x6')](0x3)[_0x8333('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8333('0x6')](0x5)[_0x8333('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8333('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8333('0x6')](0x3)[_0x8333('0x7')],'defaultValue':0x3,'comment':_0x8333('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8333('0x6')](0x5)[_0x8333('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8333('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8333('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8333('0x3')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8333('0xf'),_0x8333('0x10'),_0x8333('0x11')),'defaultValue':_0x8333('0xf')},'dialAMDActive':{'type':Sequelize[_0x8333('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8333('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8333('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x8333('0x6')](0x9)[_0x8333('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8333('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8333('0x6')](0x9)[_0x8333('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8333('0x6')](0x9)[_0x8333('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8333('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x8333('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8333('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8333('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8333('0x6')](0x9)[_0x8333('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8333('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8333('0x6')](0x5)[_0x8333('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8333('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8333('0x6')](0x9)[_0x8333('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x8333('0x1')](_0x8333('0x18'),'ASC'),'defaultValue':_0x8333('0x18')},'dialPrefix':{'type':Sequelize[_0x8333('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x8333('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8333('0x19')},'dialCutDigit':{'type':Sequelize[_0x8333('0x6')](0x3)[_0x8333('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8333('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8333('0x6')](0x3)[_0x8333('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8333('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8333('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8333('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8333('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8333('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x8333('0x6')](0x5)[_0x8333('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8333('0x6')](0x3)[_0x8333('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8333('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8333('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x8333('0x6')](0x3)[_0x8333('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8333('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8333('0x6')](0x3)[_0x8333('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8333('0x6')](0x5)[_0x8333('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8333('0x1f')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 716702b..cd151f7 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 _0x27bc=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','update','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','pick','getLists','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','phone','ContactId','ListId','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','fromQuery','CmListId','phone\x20IS\x20NOT\x20NULL','push','sequelize','removeLists','getBlackLists','addBlackLists','spread','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x27bc,0x100));var _0xc27b=function(_0x5074c6,_0x4a4937){_0x5074c6=_0x5074c6-0x0;var _0x2711f0=_0x27bc[_0x5074c6];return _0x2711f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc27b('0x0'));var zipdir=require(_0xc27b('0x1'));var jsonpatch=require(_0xc27b('0x2'));var rp=require('request-promise');var moment=require(_0xc27b('0x3'));var BPromise=require(_0xc27b('0x4'));var Mustache=require(_0xc27b('0x5'));var util=require(_0xc27b('0x6'));var path=require(_0xc27b('0x7'));var sox=require(_0xc27b('0x8'));var csv=require(_0xc27b('0x9'));var ejs=require(_0xc27b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc27b('0xb'));var crypto=require(_0xc27b('0xc'));var jsforce=require(_0xc27b('0xd'));var deskjs=require(_0xc27b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc27b('0xf'));var Papa=require(_0xc27b('0x10'));var Redis=require(_0xc27b('0x11'));var authService=require(_0xc27b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc27b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc27b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc27b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc27b('0x16'))['db'];function respondWithStatusCode(_0x411fd6,_0x46ff73){_0x46ff73=_0x46ff73||0xcc;return function(_0x43f97e){if(_0x43f97e){return _0x411fd6[_0xc27b('0x17')](_0x46ff73);}return _0x411fd6[_0xc27b('0x18')](_0x46ff73)[_0xc27b('0x19')]();};}function respondWithResult(_0x2db238,_0x3677c1){_0x3677c1=_0x3677c1||0xc8;return function(_0x4dd82c){if(_0x4dd82c){return _0x2db238[_0xc27b('0x18')](_0x3677c1)['json'](_0x4dd82c);}};}function respondWithFilteredResult(_0x4c64b8,_0x951869){return function(_0x1c9659){if(_0x1c9659){var _0x8f163=_0x1c9659[_0xc27b('0x1a')],_0x17d909=_0x951869['offset'],_0x4e88ec=_0x951869[_0xc27b('0x1b')]+_0x951869[_0xc27b('0x1c')],_0x213e1a;if(_0x4e88ec>=_0x8f163){_0x4e88ec=_0x8f163;_0x213e1a=0xc8;}else{_0x213e1a=0xce;}_0x4c64b8[_0xc27b('0x18')](_0x213e1a);return _0x4c64b8[_0xc27b('0x1d')](_0xc27b('0x1e'),_0x17d909+'-'+_0x4e88ec+'/'+_0x8f163)[_0xc27b('0x1f')](_0x1c9659);}return null;};}function patchUpdates(_0x45b575){return function(_0x2ed428){try{jsonpatch[_0xc27b('0x20')](_0x2ed428,_0x45b575,!![]);}catch(_0x279a87){return BPromise[_0xc27b('0x21')](_0x279a87);}return _0x2ed428['save']();};}function saveUpdates(_0x2188f9,_0x30a00c){return function(_0x2a3318){if(_0x2a3318){return _0x2a3318['update'](_0x2188f9)[_0xc27b('0x22')](function(_0x454746){return _0x454746;});}return null;};}function removeEntity(_0x11c326,_0x205eff){return function(_0x19bd95){if(_0x19bd95){return _0x19bd95[_0xc27b('0x23')]()[_0xc27b('0x22')](function(){var _0x4008ce=_0x19bd95[_0xc27b('0x24')]({'plain':!![]});var _0x12a45d=_0xc27b('0x25');return db[_0xc27b('0x26')]['destroy']({'where':{'type':_0x12a45d,'resourceId':_0x4008ce['id']}})[_0xc27b('0x22')](function(){return _0x19bd95;});})[_0xc27b('0x22')](function(){_0x11c326[_0xc27b('0x18')](0xcc)[_0xc27b('0x19')]();});}};}function handleEntityNotFound(_0x525b72,_0x11c000){return function(_0x51ff55){if(!_0x51ff55){_0x525b72['sendStatus'](0x194);}return _0x51ff55;};}function handleError(_0x46cef3,_0x1f5836){_0x1f5836=_0x1f5836||0x1f4;return function(_0x12aaea){logger[_0xc27b('0x27')](_0x12aaea[_0xc27b('0x28')]);if(_0x12aaea['name']){delete _0x12aaea[_0xc27b('0x29')];}_0x46cef3[_0xc27b('0x18')](_0x1f5836)[_0xc27b('0x2a')](_0x12aaea);};}exports[_0xc27b('0x2b')]=function(_0x218e53,_0x4f7a75){var _0x22e2b6={},_0x1386e9={},_0x1d2450={'count':0x0,'rows':[]};var _0x553153=_[_0xc27b('0x2c')](db[_0xc27b('0x2d')]['rawAttributes'],function(_0x41b465){return{'name':_0x41b465[_0xc27b('0x2e')],'type':_0x41b465[_0xc27b('0x2f')]['key']};});_0x1386e9[_0xc27b('0x30')]=_[_0xc27b('0x2c')](_0x553153,_0xc27b('0x29'));_0x1386e9[_0xc27b('0x31')]=_[_0xc27b('0x32')](_0x218e53[_0xc27b('0x31')]);_0x1386e9['filters']=_[_0xc27b('0x33')](_0x1386e9[_0xc27b('0x30')],_0x1386e9[_0xc27b('0x31')]);_0x22e2b6[_0xc27b('0x34')]=_[_0xc27b('0x33')](_0x1386e9['model'],qs[_0xc27b('0x35')](_0x218e53[_0xc27b('0x31')]['fields']));_0x22e2b6['attributes']=_0x22e2b6[_0xc27b('0x34')]['length']?_0x22e2b6[_0xc27b('0x34')]:_0x1386e9['model'];if(!_0x218e53[_0xc27b('0x31')][_0xc27b('0x36')](_0xc27b('0x37'))){_0x22e2b6[_0xc27b('0x1c')]=qs['limit'](_0x218e53['query']['limit']);_0x22e2b6[_0xc27b('0x1b')]=qs['offset'](_0x218e53[_0xc27b('0x31')][_0xc27b('0x1b')]);}_0x22e2b6[_0xc27b('0x38')]=qs[_0xc27b('0x39')](_0x218e53[_0xc27b('0x31')][_0xc27b('0x39')]);_0x22e2b6[_0xc27b('0x3a')]=qs[_0xc27b('0x3b')](_['pick'](_0x218e53[_0xc27b('0x31')],_0x1386e9['filters']),_0x553153);if(_0x218e53[_0xc27b('0x31')][_0xc27b('0x3c')]){_0x22e2b6['where']=_['merge'](_0x22e2b6[_0xc27b('0x3a')],{'$or':_[_0xc27b('0x2c')](_0x553153,function(_0x567faf){if(_0x567faf[_0xc27b('0x2f')]!=='VIRTUAL'){var _0x58d9b6={};_0x58d9b6[_0x567faf[_0xc27b('0x29')]]={'$like':'%'+_0x218e53[_0xc27b('0x31')][_0xc27b('0x3c')]+'%'};return _0x58d9b6;}})});}_0x22e2b6=_[_0xc27b('0x3d')]({},_0x22e2b6,_0x218e53[_0xc27b('0x3e')]);var _0x1e8b03={'where':_0x22e2b6[_0xc27b('0x3a')]};return db[_0xc27b('0x2d')]['count'](_0x1e8b03)['then'](function(_0x404383){_0x1d2450[_0xc27b('0x1a')]=_0x404383;if(_0x218e53[_0xc27b('0x31')][_0xc27b('0x3f')]){_0x22e2b6[_0xc27b('0x40')]=[{'all':!![]}];}return db[_0xc27b('0x2d')][_0xc27b('0x41')](_0x22e2b6);})['then'](function(_0x4da686){_0x1d2450[_0xc27b('0x42')]=_0x4da686;return _0x1d2450;})[_0xc27b('0x22')](respondWithFilteredResult(_0x4f7a75,_0x22e2b6))[_0xc27b('0x43')](handleError(_0x4f7a75,null));};exports[_0xc27b('0x44')]=function(_0x388595,_0xa21bd6){var _0x432ca4={'raw':![],'where':{'id':_0x388595[_0xc27b('0x45')]['id']}},_0x453ba5={};_0x453ba5[_0xc27b('0x30')]=_[_0xc27b('0x32')](db['Campaign'][_0xc27b('0x46')]);_0x453ba5['query']=_[_0xc27b('0x32')](_0x388595[_0xc27b('0x31')]);_0x453ba5[_0xc27b('0x3b')]=_[_0xc27b('0x33')](_0x453ba5[_0xc27b('0x30')],_0x453ba5[_0xc27b('0x31')]);_0x432ca4[_0xc27b('0x34')]=_[_0xc27b('0x33')](_0x453ba5[_0xc27b('0x30')],qs['fields'](_0x388595[_0xc27b('0x31')][_0xc27b('0x35')]));_0x432ca4['attributes']=_0x432ca4[_0xc27b('0x34')]['length']?_0x432ca4[_0xc27b('0x34')]:_0x453ba5[_0xc27b('0x30')];if(_0x388595[_0xc27b('0x31')]['includeAll']){_0x432ca4[_0xc27b('0x40')]=[{'all':!![]}];}_0x432ca4=_[_0xc27b('0x3d')]({},_0x432ca4,_0x388595[_0xc27b('0x3e')]);return db['Campaign'][_0xc27b('0x47')](_0x432ca4)[_0xc27b('0x22')](handleEntityNotFound(_0xa21bd6,null))['then'](respondWithResult(_0xa21bd6,null))['catch'](handleError(_0xa21bd6,null));};exports['create']=function(_0x209d11,_0x2b4f70){return db[_0xc27b('0x2d')][_0xc27b('0x48')](_0x209d11[_0xc27b('0x49')],{})['then'](function(_0x9f3763){var _0x4b56d3=_0x209d11['user'][_0xc27b('0x24')]({'plain':!![]});if(!_0x4b56d3)throw new Error(_0xc27b('0x4a'));if(_0x4b56d3[_0xc27b('0x4b')]===_0xc27b('0x4c')){var _0x3133f1=_0x9f3763[_0xc27b('0x24')]({'plain':!![]});var _0x5b72fb=_0xc27b('0x25');return db[_0xc27b('0x4d')]['find']({'where':{'name':_0x5b72fb,'userProfileId':_0x4b56d3[_0xc27b('0x4e')]},'raw':!![]})[_0xc27b('0x22')](function(_0x1c1bdc){if(_0x1c1bdc&&_0x1c1bdc[_0xc27b('0x4f')]===0x0){return db[_0xc27b('0x26')]['create']({'name':_0x3133f1[_0xc27b('0x29')],'resourceId':_0x3133f1['id'],'type':_0x1c1bdc[_0xc27b('0x29')],'sectionId':_0x1c1bdc['id']},{})[_0xc27b('0x22')](function(){return _0x9f3763;});}else{return _0x9f3763;}})[_0xc27b('0x43')](function(_0x54949b){logger[_0xc27b('0x27')](_0xc27b('0x50'),_0x54949b);throw _0x54949b;});}return _0x9f3763;})[_0xc27b('0x22')](respondWithResult(_0x2b4f70,0xc9))[_0xc27b('0x43')](handleError(_0x2b4f70,null));};exports[_0xc27b('0x51')]=function(_0x63a04f,_0xc7c9e1){var _0x419bb3={'where':{'id':_0x63a04f['params']['id']}},_0xb50aa5={};_0xb50aa5[_0xc27b('0x30')]=_['keys'](db[_0xc27b('0x2d')]['rawAttributes']);_0x419bb3[_0xc27b('0x34')]=_['intersection'](_0xb50aa5[_0xc27b('0x30')],qs[_0xc27b('0x35')](_0x63a04f['query'][_0xc27b('0x35')]));_0x419bb3[_0xc27b('0x34')]=_0x419bb3[_0xc27b('0x34')][_0xc27b('0x52')]?_0x419bb3['attributes']:_0xb50aa5[_0xc27b('0x30')];if(_0x63a04f[_0xc27b('0x31')]['includeAll']){_0x419bb3[_0xc27b('0x40')]=[{'all':!![]}];}_0x419bb3=_[_0xc27b('0x3d')]({},_0x419bb3,_0x63a04f[_0xc27b('0x3e')]);return db[_0xc27b('0x2d')]['find'](_0x419bb3)[_0xc27b('0x22')](handleEntityNotFound(_0xc7c9e1,null))[_0xc27b('0x22')](function(_0x30b0ff){if(_0x30b0ff){var _0x5c5457=_0x30b0ff[_0xc27b('0x24')]({'plain':!![]});_0x5c5457=qs[_0xc27b('0x53')](_0x5c5457,['id',_0xc27b('0x54'),_0xc27b('0x55')]);_0x63a04f[_0xc27b('0x49')]=_[_0xc27b('0x53')](_0x63a04f[_0xc27b('0x49')],['id',_0xc27b('0x54'),_0xc27b('0x55')]);return db['Campaign']['create'](_['merge'](_0x5c5457,_0x63a04f[_0xc27b('0x49')]),{'include':_0x63a04f['query'][_0xc27b('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0x57541b){var _0x120355=_0x63a04f[_0xc27b('0x4c')][_0xc27b('0x24')]({'plain':!![]});if(!_0x120355)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x120355['role']===_0xc27b('0x4c')){var _0x3c370e=_0x57541b[_0xc27b('0x24')]({'plain':!![]});var _0x1bcb0d=_0xc27b('0x25');return db['UserProfileSection'][_0xc27b('0x47')]({'where':{'name':_0x1bcb0d,'userProfileId':_0x120355['userProfileId']},'raw':!![]})['then'](function(_0xab8e03){if(_0xab8e03&&_0xab8e03['autoAssociation']===0x0){return db[_0xc27b('0x26')][_0xc27b('0x48')]({'name':_0x3c370e[_0xc27b('0x29')],'resourceId':_0x3c370e['id'],'type':_0xab8e03[_0xc27b('0x29')],'sectionId':_0xab8e03['id']},{})['then'](function(){return _0x57541b;});}else{return _0x57541b;}})['catch'](function(_0xd0900e){logger[_0xc27b('0x27')](_0xc27b('0x50'),_0xd0900e);throw _0xd0900e;});}return _0x57541b;});}})[_0xc27b('0x22')](respondWithResult(_0xc7c9e1,0xc9))[_0xc27b('0x43')](handleError(_0xc7c9e1,null));};exports[_0xc27b('0x56')]=function(_0x34279a,_0x2f70a1){if(_0x34279a['body']['id']){delete _0x34279a[_0xc27b('0x49')]['id'];}return db[_0xc27b('0x2d')]['find']({'where':{'id':_0x34279a['params']['id']}})['then'](handleEntityNotFound(_0x2f70a1,null))[_0xc27b('0x22')](saveUpdates(_0x34279a[_0xc27b('0x49')],null))['then'](respondWithResult(_0x2f70a1,null))[_0xc27b('0x43')](handleError(_0x2f70a1,null));};exports[_0xc27b('0x23')]=function(_0x1d7731,_0x3c62cc){return db[_0xc27b('0x2d')][_0xc27b('0x47')]({'where':{'id':_0x1d7731[_0xc27b('0x45')]['id']}})[_0xc27b('0x22')](handleEntityNotFound(_0x3c62cc,null))[_0xc27b('0x22')](removeEntity(_0x3c62cc,null))[_0xc27b('0x43')](handleError(_0x3c62cc,null));};exports[_0xc27b('0x57')]=function(_0x2f0bb,_0x364eec,_0x3fa1f7){var _0x512a26={'raw':!![],'where':{}};var _0x196e93={};var _0x3f9773={'count':0x0,'rows':[]};return db[_0xc27b('0x2d')][_0xc27b('0x58')]({'where':{'id':_0x2f0bb[_0xc27b('0x45')]['id']}})[_0xc27b('0x22')](handleEntityNotFound(_0x364eec,null))[_0xc27b('0x22')](function(_0xcfe321){if(_0xcfe321){_0x196e93[_0xc27b('0x30')]=_[_0xc27b('0x32')](db[_0xc27b('0x59')][_0xc27b('0x46')]);_0x196e93[_0xc27b('0x31')]=_['keys'](_0x2f0bb['query']);_0x196e93[_0xc27b('0x3b')]=_['intersection'](_0x196e93[_0xc27b('0x30')],_0x196e93[_0xc27b('0x31')]);_0x512a26['attributes']=_[_0xc27b('0x33')](_0x196e93[_0xc27b('0x30')],qs[_0xc27b('0x35')](_0x2f0bb[_0xc27b('0x31')][_0xc27b('0x35')]));_0x512a26[_0xc27b('0x34')]=_0x512a26['attributes'][_0xc27b('0x52')]?_0x512a26[_0xc27b('0x34')]:_0x196e93[_0xc27b('0x30')];if(!_0x2f0bb[_0xc27b('0x31')]['hasOwnProperty'](_0xc27b('0x37'))){_0x512a26['limit']=qs[_0xc27b('0x1c')](_0x2f0bb[_0xc27b('0x31')][_0xc27b('0x1c')]);_0x512a26[_0xc27b('0x1b')]=qs[_0xc27b('0x1b')](_0x2f0bb['query'][_0xc27b('0x1b')]);}_0x512a26[_0xc27b('0x38')]=qs[_0xc27b('0x39')](_0x2f0bb[_0xc27b('0x31')][_0xc27b('0x39')]);_0x512a26[_0xc27b('0x3a')]=qs[_0xc27b('0x3b')](_['pick'](_0x2f0bb[_0xc27b('0x31')],_0x196e93[_0xc27b('0x3b')]));_0x512a26[_0xc27b('0x3a')]['CampaignId']=_0xcfe321['id'];if(_0x2f0bb['query'][_0xc27b('0x3c')]){_0x512a26['where']=_['merge'](_0x512a26[_0xc27b('0x3a')],{'$or':_[_0xc27b('0x2c')](_0x512a26[_0xc27b('0x34')],function(_0x5b7992){var _0x5644cd={};_0x5644cd[_0x5b7992]={'$like':'%'+_0x2f0bb[_0xc27b('0x31')][_0xc27b('0x3c')]+'%'};return _0x5644cd;})});}_0x512a26=_[_0xc27b('0x3d')]({},_0x512a26,_0x2f0bb[_0xc27b('0x3e')]);return db[_0xc27b('0x59')]['count']({'where':_0x512a26[_0xc27b('0x3a')]})[_0xc27b('0x22')](function(_0x37685a){_0x3f9773[_0xc27b('0x1a')]=_0x37685a;if(_0x2f0bb[_0xc27b('0x31')]['includeAll']){_0x512a26[_0xc27b('0x40')]=[{'all':!![]}];}return db[_0xc27b('0x59')][_0xc27b('0x41')](_0x512a26);})['then'](function(_0x18d174){_0x3f9773[_0xc27b('0x42')]=_0x18d174;return _0x3f9773;});}})[_0xc27b('0x22')](respondWithFilteredResult(_0x364eec,_0x512a26))[_0xc27b('0x43')](handleError(_0x364eec,null));};exports[_0xc27b('0x5a')]=function(_0x10cad6,_0x3b5055,_0x5dcacd){var _0x40260b={'raw':!![],'where':{}};var _0x489389={};var _0x142c11={'count':0x0,'rows':[]};return db[_0xc27b('0x2d')][_0xc27b('0x58')]({'where':{'id':_0x10cad6[_0xc27b('0x45')]['id']}})[_0xc27b('0x22')](handleEntityNotFound(_0x3b5055,null))[_0xc27b('0x22')](function(_0xc5ca1b){if(_0xc5ca1b){_0x489389['model']=_[_0xc27b('0x32')](db[_0xc27b('0x5b')][_0xc27b('0x46')]);_0x489389[_0xc27b('0x31')]=_['keys'](_0x10cad6[_0xc27b('0x31')]);_0x489389['filters']=_[_0xc27b('0x33')](_0x489389['model'],_0x489389[_0xc27b('0x31')]);_0x40260b[_0xc27b('0x34')]=_[_0xc27b('0x33')](_0x489389[_0xc27b('0x30')],qs[_0xc27b('0x35')](_0x10cad6[_0xc27b('0x31')][_0xc27b('0x35')]));_0x40260b[_0xc27b('0x34')]=_0x40260b['attributes'][_0xc27b('0x52')]?_0x40260b[_0xc27b('0x34')]:_0x489389[_0xc27b('0x30')];if(!_0x10cad6['query'][_0xc27b('0x36')](_0xc27b('0x37'))){_0x40260b[_0xc27b('0x1c')]=qs[_0xc27b('0x1c')](_0x10cad6[_0xc27b('0x31')][_0xc27b('0x1c')]);_0x40260b['offset']=qs[_0xc27b('0x1b')](_0x10cad6['query'][_0xc27b('0x1b')]);}_0x40260b[_0xc27b('0x38')]=qs[_0xc27b('0x39')](_0x10cad6[_0xc27b('0x31')][_0xc27b('0x39')]);_0x40260b['where']=qs[_0xc27b('0x3b')](_['pick'](_0x10cad6[_0xc27b('0x31')],_0x489389[_0xc27b('0x3b')]));_0x40260b[_0xc27b('0x3a')][_0xc27b('0x5c')]=_0xc5ca1b['id'];if(_0x10cad6['query'][_0xc27b('0x3c')]){_0x40260b[_0xc27b('0x3a')]=_['merge'](_0x40260b['where'],{'$or':_['map'](_0x40260b[_0xc27b('0x34')],function(_0x10f353){var _0x2cb498={};_0x2cb498[_0x10f353]={'$like':'%'+_0x10cad6[_0xc27b('0x31')][_0xc27b('0x3c')]+'%'};return _0x2cb498;})});}_0x40260b=_['merge']({},_0x40260b,_0x10cad6['options']);return db['CmHopperHistory'][_0xc27b('0x1a')]({'where':_0x40260b[_0xc27b('0x3a')]})[_0xc27b('0x22')](function(_0x492936){_0x142c11[_0xc27b('0x1a')]=_0x492936;if(_0x10cad6['query'][_0xc27b('0x3f')]){_0x40260b[_0xc27b('0x40')]=[{'all':!![]}];}return db[_0xc27b('0x5b')][_0xc27b('0x41')](_0x40260b);})[_0xc27b('0x22')](function(_0x22c50b){_0x142c11['rows']=_0x22c50b;return _0x142c11;});}})[_0xc27b('0x22')](respondWithFilteredResult(_0x3b5055,_0x40260b))[_0xc27b('0x43')](handleError(_0x3b5055,null));};exports[_0xc27b('0x5d')]=function(_0x4e516e,_0x2d531a,_0xadbb75){var _0x2d8d48={'raw':!![],'where':{}};var _0xd3e589={};var _0x2a1684={'count':0x0,'rows':[]};return db['Campaign'][_0xc27b('0x58')]({'where':{'id':_0x4e516e[_0xc27b('0x45')]['id']}})[_0xc27b('0x22')](handleEntityNotFound(_0x2d531a,null))[_0xc27b('0x22')](function(_0x160031){if(_0x160031){_0xd3e589[_0xc27b('0x30')]=_['keys'](db[_0xc27b('0x5e')][_0xc27b('0x46')]);_0xd3e589['query']=_[_0xc27b('0x32')](_0x4e516e['query']);_0xd3e589[_0xc27b('0x3b')]=_[_0xc27b('0x33')](_0xd3e589['model'],_0xd3e589[_0xc27b('0x31')]);_0x2d8d48['attributes']=_[_0xc27b('0x33')](_0xd3e589['model'],qs[_0xc27b('0x35')](_0x4e516e[_0xc27b('0x31')][_0xc27b('0x35')]));_0x2d8d48['attributes']=_0x2d8d48[_0xc27b('0x34')][_0xc27b('0x52')]?_0x2d8d48[_0xc27b('0x34')]:_0xd3e589[_0xc27b('0x30')];if(!_0x4e516e[_0xc27b('0x31')]['hasOwnProperty'](_0xc27b('0x37'))){_0x2d8d48['limit']=qs[_0xc27b('0x1c')](_0x4e516e[_0xc27b('0x31')][_0xc27b('0x1c')]);_0x2d8d48[_0xc27b('0x1b')]=qs[_0xc27b('0x1b')](_0x4e516e[_0xc27b('0x31')][_0xc27b('0x1b')]);}_0x2d8d48[_0xc27b('0x38')]=qs[_0xc27b('0x39')](_0x4e516e[_0xc27b('0x31')]['sort']);_0x2d8d48[_0xc27b('0x3a')]=qs['filters'](_['pick'](_0x4e516e[_0xc27b('0x31')],_0xd3e589[_0xc27b('0x3b')]));_0x2d8d48[_0xc27b('0x3a')]['CampaignId']=_0x160031['id'];if(_0x4e516e[_0xc27b('0x31')][_0xc27b('0x3c')]){_0x2d8d48[_0xc27b('0x3a')]=_[_0xc27b('0x3d')](_0x2d8d48[_0xc27b('0x3a')],{'$or':_[_0xc27b('0x2c')](_0x2d8d48['attributes'],function(_0x50a97e){var _0x922e46={};_0x922e46[_0x50a97e]={'$like':'%'+_0x4e516e[_0xc27b('0x31')][_0xc27b('0x3c')]+'%'};return _0x922e46;})});}_0x2d8d48=_[_0xc27b('0x3d')]({},_0x2d8d48,_0x4e516e[_0xc27b('0x3e')]);return db[_0xc27b('0x5e')][_0xc27b('0x1a')]({'where':_0x2d8d48[_0xc27b('0x3a')]})[_0xc27b('0x22')](function(_0xba311c){_0x2a1684['count']=_0xba311c;if(_0x4e516e[_0xc27b('0x31')][_0xc27b('0x3f')]){_0x2d8d48[_0xc27b('0x40')]=[{'all':!![]}];}return db[_0xc27b('0x5e')]['findAll'](_0x2d8d48);})[_0xc27b('0x22')](function(_0x206fc1){_0x2a1684['rows']=_0x206fc1;return _0x2a1684;});}})[_0xc27b('0x22')](respondWithFilteredResult(_0x2d531a,_0x2d8d48))[_0xc27b('0x43')](handleError(_0x2d531a,null));};exports[_0xc27b('0x5f')]=function(_0x8b3d61,_0x56c1f9,_0x1eb2ed){var _0x43e5f9={'raw':!![],'where':{}};var _0x4470da={};var _0x455a65={'count':0x0,'rows':[]};return db[_0xc27b('0x2d')][_0xc27b('0x58')]({'where':{'id':_0x8b3d61[_0xc27b('0x45')]['id']}})['then'](handleEntityNotFound(_0x56c1f9,null))[_0xc27b('0x22')](function(_0xa7ec6){if(_0xa7ec6){_0x4470da[_0xc27b('0x30')]=_[_0xc27b('0x32')](db[_0xc27b('0x60')]['rawAttributes']);_0x4470da['query']=_[_0xc27b('0x32')](_0x8b3d61[_0xc27b('0x31')]);_0x4470da['filters']=_[_0xc27b('0x33')](_0x4470da[_0xc27b('0x30')],_0x4470da['query']);_0x43e5f9[_0xc27b('0x34')]=_[_0xc27b('0x33')](_0x4470da['model'],qs[_0xc27b('0x35')](_0x8b3d61[_0xc27b('0x31')][_0xc27b('0x35')]));_0x43e5f9[_0xc27b('0x34')]=_0x43e5f9[_0xc27b('0x34')][_0xc27b('0x52')]?_0x43e5f9[_0xc27b('0x34')]:_0x4470da[_0xc27b('0x30')];if(!_0x8b3d61[_0xc27b('0x31')][_0xc27b('0x36')](_0xc27b('0x37'))){_0x43e5f9[_0xc27b('0x1c')]=qs[_0xc27b('0x1c')](_0x8b3d61['query'][_0xc27b('0x1c')]);_0x43e5f9['offset']=qs[_0xc27b('0x1b')](_0x8b3d61['query'][_0xc27b('0x1b')]);}_0x43e5f9['order']=qs[_0xc27b('0x39')](_0x8b3d61[_0xc27b('0x31')][_0xc27b('0x39')]);_0x43e5f9[_0xc27b('0x3a')]=qs[_0xc27b('0x3b')](_['pick'](_0x8b3d61[_0xc27b('0x31')],_0x4470da[_0xc27b('0x3b')]));_0x43e5f9['where'][_0xc27b('0x5c')]=_0xa7ec6['id'];if(_0x8b3d61[_0xc27b('0x31')][_0xc27b('0x3c')]){_0x43e5f9[_0xc27b('0x3a')]=_[_0xc27b('0x3d')](_0x43e5f9[_0xc27b('0x3a')],{'$or':_[_0xc27b('0x2c')](_0x43e5f9['attributes'],function(_0x5152bb){var _0x456346={};_0x456346[_0x5152bb]={'$like':'%'+_0x8b3d61['query']['filter']+'%'};return _0x456346;})});}_0x43e5f9=_['merge']({},_0x43e5f9,_0x8b3d61[_0xc27b('0x3e')]);return db[_0xc27b('0x60')][_0xc27b('0x1a')]({'where':_0x43e5f9[_0xc27b('0x3a')]})['then'](function(_0x88e72a){_0x455a65[_0xc27b('0x1a')]=_0x88e72a;if(_0x8b3d61[_0xc27b('0x31')][_0xc27b('0x3f')]){_0x43e5f9[_0xc27b('0x40')]=[{'all':!![]}];}return db[_0xc27b('0x60')][_0xc27b('0x41')](_0x43e5f9);})[_0xc27b('0x22')](function(_0x1d9c07){_0x455a65[_0xc27b('0x42')]=_0x1d9c07;return _0x455a65;});}})['then'](respondWithFilteredResult(_0x56c1f9,_0x43e5f9))[_0xc27b('0x43')](handleError(_0x56c1f9,null));};exports['getLists']=function(_0x2832d0,_0xa0fc87,_0x556743){var _0x3df654={};var _0x245a9a={};var _0xd90dec;var _0x5797f5;return db[_0xc27b('0x2d')][_0xc27b('0x58')]({'where':{'id':_0x2832d0[_0xc27b('0x45')]['id']}})['then'](handleEntityNotFound(_0xa0fc87,null))[_0xc27b('0x22')](function(_0x385911){if(_0x385911){_0xd90dec=_0x385911;_0x245a9a['model']=_['keys'](db[_0xc27b('0x61')]['rawAttributes']);_0x245a9a['query']=_[_0xc27b('0x32')](_0x2832d0['query']);_0x245a9a[_0xc27b('0x3b')]=_[_0xc27b('0x33')](_0x245a9a[_0xc27b('0x30')],_0x245a9a[_0xc27b('0x31')]);_0x3df654['attributes']=_[_0xc27b('0x33')](_0x245a9a[_0xc27b('0x30')],qs['fields'](_0x2832d0[_0xc27b('0x31')][_0xc27b('0x35')]));_0x3df654[_0xc27b('0x34')]=_0x3df654['attributes'][_0xc27b('0x52')]?_0x3df654['attributes']:_0x245a9a[_0xc27b('0x30')];_0x3df654['order']=qs[_0xc27b('0x39')](_0x2832d0[_0xc27b('0x31')][_0xc27b('0x39')]);_0x3df654[_0xc27b('0x3a')]=qs[_0xc27b('0x3b')](_[_0xc27b('0x62')](_0x2832d0['query'],_0x245a9a[_0xc27b('0x3b')]));if(_0x2832d0[_0xc27b('0x31')][_0xc27b('0x3c')]){_0x3df654['where']=_[_0xc27b('0x3d')](_0x3df654[_0xc27b('0x3a')],{'$or':_['map'](_0x3df654[_0xc27b('0x34')],function(_0x21e454){var _0x529a9e={};_0x529a9e[_0x21e454]={'$like':'%'+_0x2832d0[_0xc27b('0x31')][_0xc27b('0x3c')]+'%'};return _0x529a9e;})});}_0x3df654=_[_0xc27b('0x3d')]({},_0x3df654,_0x2832d0['options']);return _0xd90dec['getLists'](_0x3df654);}})[_0xc27b('0x22')](function(_0x50efb7){if(_0x50efb7){_0x5797f5=_0x50efb7[_0xc27b('0x52')];if(!_0x2832d0[_0xc27b('0x31')][_0xc27b('0x36')](_0xc27b('0x37'))){_0x3df654['limit']=qs['limit'](_0x2832d0[_0xc27b('0x31')][_0xc27b('0x1c')]);_0x3df654[_0xc27b('0x1b')]=qs[_0xc27b('0x1b')](_0x2832d0[_0xc27b('0x31')]['offset']);}return _0xd90dec[_0xc27b('0x63')](_0x3df654);}})['then'](function(_0x2b2ae8){if(_0x2b2ae8){return _0x2b2ae8?{'count':_0x5797f5,'rows':_0x2b2ae8}:null;}})[_0xc27b('0x22')](respondWithResult(_0xa0fc87,null))[_0xc27b('0x43')](handleError(_0xa0fc87,null));};exports[_0xc27b('0x64')]=function(_0x28a02a,_0x2ee686,_0x300472){var _0x4c0ab4,_0x5b8e24;return db[_0xc27b('0x2d')][_0xc27b('0x47')]({'where':{'id':_0x28a02a[_0xc27b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ee686,null))[_0xc27b('0x22')](function(_0x4465f8){if(_0x4465f8){_0x5b8e24=_0x4465f8;return _0x4465f8[_0xc27b('0x64')](_0x28a02a[_0xc27b('0x49')][_0xc27b('0x65')],_['omit'](_0x28a02a[_0xc27b('0x49')],[_0xc27b('0x65'),'id'])||{});}return null;})['spread'](function(_0x5391fa){var _0xf016f6;_0x4c0ab4=_0x5391fa||[];var _0x1933ba=[];if(_0x5391fa){for(var _0x4fd02b=0x0;_0x4fd02b<_0x5391fa[_0xc27b('0x52')];_0x4fd02b+=0x1){var _0x97c8aa=_0x5391fa[_0x4fd02b]['get']({'plain':!![]});_0x5b8e24['dialCheckDuplicateType']=_0x28a02a[_0xc27b('0x49')][_0xc27b('0x66')]?_0x28a02a[_0xc27b('0x49')][_0xc27b('0x66')]:_0x5b8e24[_0xc27b('0x66')];switch(_0x5b8e24['dialCheckDuplicateType']){case _0xc27b('0x67'):_0xf016f6=squel['insert']()[_0xc27b('0x68')](_0xc27b('0x69'))['fromQuery']([_0xc27b('0x6a'),'scheduledAt',_0xc27b('0x6b'),_0xc27b('0x6c'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0xc27b('0x6d')](_0xc27b('0x6a'),_0xc27b('0x6a'))[_0xc27b('0x6d')](_0xc27b('0x6e'),_0xc27b('0x6f'))[_0xc27b('0x6d')]('id',_0xc27b('0x6b'))[_0xc27b('0x6d')](_0x97c8aa['CmListId'][_0xc27b('0x70')](),_0xc27b('0x6c'))[_0xc27b('0x6d')](_0x28a02a[_0xc27b('0x45')]['id'][_0xc27b('0x70')](),_0xc27b('0x5c'))[_0xc27b('0x6d')](_0xc27b('0x6e'),_0xc27b('0x54'))[_0xc27b('0x6d')](_0xc27b('0x6e'),'updatedAt')[_0xc27b('0x71')](_0xc27b('0x72'))[_0xc27b('0x3a')](_0xc27b('0x73'))[_0xc27b('0x3a')](_0xc27b('0x74'),_0x97c8aa['CmListId'][_0xc27b('0x70')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xc27b('0x3a')](_0xc27b('0x75'),squel[_0xc27b('0x76')]()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xc27b('0x77'))[_0xc27b('0x3a')](_0xc27b('0x78'),_0x28a02a[_0xc27b('0x45')]['id'][_0xc27b('0x70')]()))['where'](_0xc27b('0x75'),squel[_0xc27b('0x76')]()[_0xc27b('0x6d')](_0xc27b('0x79'))[_0xc27b('0x71')](_0xc27b('0x69'))[_0xc27b('0x3a')](_0xc27b('0x78'),_0x28a02a[_0xc27b('0x45')]['id'][_0xc27b('0x70')]())))[_0xc27b('0x70')]();break;case _0xc27b('0x7a'):_0xf016f6=squel[_0xc27b('0x7b')]()['into']('cm_hopper')[_0xc27b('0x7c')](['phone',_0xc27b('0x6f'),_0xc27b('0x6b'),_0xc27b('0x6c'),_0xc27b('0x5c'),'createdAt','updatedAt'],squel['select']()[_0xc27b('0x6d')](_0xc27b('0x6a'),_0xc27b('0x6a'))[_0xc27b('0x6d')]('NOW()','scheduledAt')[_0xc27b('0x6d')]('id',_0xc27b('0x6b'))[_0xc27b('0x6d')](_0x97c8aa[_0xc27b('0x7d')][_0xc27b('0x70')](),_0xc27b('0x6c'))['field'](_0x28a02a[_0xc27b('0x45')]['id']['toString'](),_0xc27b('0x5c'))[_0xc27b('0x6d')](_0xc27b('0x6e'),_0xc27b('0x54'))[_0xc27b('0x6d')](_0xc27b('0x6e'),_0xc27b('0x55'))[_0xc27b('0x71')]('cm_contacts')[_0xc27b('0x3a')](_0xc27b('0x73'))[_0xc27b('0x3a')]('ListId\x20=\x20?',_0x97c8aa[_0xc27b('0x7d')][_0xc27b('0x70')]())['where'](_0xc27b('0x7e'))[_0xc27b('0x3a')](_0xc27b('0x75'),squel[_0xc27b('0x76')]()[_0xc27b('0x6d')](_0xc27b('0x79'))[_0xc27b('0x71')]('cm_hopper')[_0xc27b('0x3a')]('CampaignId\x20=\x20?',_0x28a02a[_0xc27b('0x45')]['id'][_0xc27b('0x70')]())))[_0xc27b('0x70')]();break;default:_0xf016f6=squel['insert']()[_0xc27b('0x68')](_0xc27b('0x69'))['fromQuery'](['phone',_0xc27b('0x6f'),_0xc27b('0x6b'),'ListId',_0xc27b('0x5c'),'createdAt',_0xc27b('0x55')],squel['select']()['field'](_0xc27b('0x6a'),_0xc27b('0x6a'))['field']('NOW()',_0xc27b('0x6f'))[_0xc27b('0x6d')]('id',_0xc27b('0x6b'))['field'](_0x97c8aa[_0xc27b('0x7d')][_0xc27b('0x70')](),_0xc27b('0x6c'))[_0xc27b('0x6d')](_0x28a02a[_0xc27b('0x45')]['id'][_0xc27b('0x70')](),_0xc27b('0x5c'))['field']('NOW()','createdAt')[_0xc27b('0x6d')](_0xc27b('0x6e'),'updatedAt')[_0xc27b('0x71')](_0xc27b('0x72'))[_0xc27b('0x3a')](_0xc27b('0x73'))['where'](_0xc27b('0x74'),_0x97c8aa['CmListId'][_0xc27b('0x70')]())[_0xc27b('0x3a')](_0xc27b('0x7e')))[_0xc27b('0x70')]();}_0x1933ba[_0xc27b('0x7f')](db[_0xc27b('0x80')][_0xc27b('0x31')](_0xf016f6));}return BPromise['all'](_0x1933ba);}})['then'](function(){return _0x4c0ab4;})['then'](respondWithResult(_0x2ee686,null))[_0xc27b('0x43')](handleError(_0x2ee686,null));};exports[_0xc27b('0x81')]=function(_0x58faba,_0x27f085,_0x3f4405){return db[_0xc27b('0x2d')]['find']({'where':{'id':_0x58faba[_0xc27b('0x45')]['id']}})[_0xc27b('0x22')](handleEntityNotFound(_0x27f085,null))['then'](function(_0x1fe120){if(_0x1fe120){return _0x1fe120['removeLists'](_0x58faba[_0xc27b('0x31')][_0xc27b('0x65')]);}})[_0xc27b('0x22')](function(_0x3b7826){if(_0x3b7826){return db['CmHopper'][_0xc27b('0x23')]({'where':{'ListId':_0x58faba['query']['ids'],'CampaignId':_0x58faba[_0xc27b('0x45')]['id']}})[_0xc27b('0x22')](function(){return _0x3b7826;});}})[_0xc27b('0x22')](respondWithStatusCode(_0x27f085,null))[_0xc27b('0x43')](handleError(_0x27f085,null));};exports[_0xc27b('0x82')]=function(_0x52f74d,_0x18225a,_0x5dd93b){var _0x48cd06={};var _0x1743c3={};var _0x1e0eda;var _0x2cbf00;return db[_0xc27b('0x2d')][_0xc27b('0x58')]({'where':{'id':_0x52f74d[_0xc27b('0x45')]['id']}})[_0xc27b('0x22')](handleEntityNotFound(_0x18225a,null))[_0xc27b('0x22')](function(_0x322fc0){if(_0x322fc0){_0x1e0eda=_0x322fc0;_0x1743c3['model']=_[_0xc27b('0x32')](db[_0xc27b('0x61')][_0xc27b('0x46')]);_0x1743c3['query']=_[_0xc27b('0x32')](_0x52f74d['query']);_0x1743c3[_0xc27b('0x3b')]=_[_0xc27b('0x33')](_0x1743c3[_0xc27b('0x30')],_0x1743c3[_0xc27b('0x31')]);_0x48cd06[_0xc27b('0x34')]=_['intersection'](_0x1743c3[_0xc27b('0x30')],qs['fields'](_0x52f74d[_0xc27b('0x31')][_0xc27b('0x35')]));_0x48cd06[_0xc27b('0x34')]=_0x48cd06[_0xc27b('0x34')][_0xc27b('0x52')]?_0x48cd06[_0xc27b('0x34')]:_0x1743c3[_0xc27b('0x30')];_0x48cd06[_0xc27b('0x38')]=qs[_0xc27b('0x39')](_0x52f74d[_0xc27b('0x31')][_0xc27b('0x39')]);_0x48cd06[_0xc27b('0x3a')]=qs[_0xc27b('0x3b')](_[_0xc27b('0x62')](_0x52f74d['query'],_0x1743c3[_0xc27b('0x3b')]));if(_0x52f74d['query'][_0xc27b('0x3c')]){_0x48cd06[_0xc27b('0x3a')]=_[_0xc27b('0x3d')](_0x48cd06[_0xc27b('0x3a')],{'$or':_[_0xc27b('0x2c')](_0x48cd06[_0xc27b('0x34')],function(_0x2720fa){var _0x1939f2={};_0x1939f2[_0x2720fa]={'$like':'%'+_0x52f74d[_0xc27b('0x31')][_0xc27b('0x3c')]+'%'};return _0x1939f2;})});}_0x48cd06=_[_0xc27b('0x3d')]({},_0x48cd06,_0x52f74d[_0xc27b('0x3e')]);return _0x1e0eda[_0xc27b('0x82')](_0x48cd06);}})[_0xc27b('0x22')](function(_0x10679e){if(_0x10679e){_0x2cbf00=_0x10679e[_0xc27b('0x52')];if(!_0x52f74d[_0xc27b('0x31')][_0xc27b('0x36')]('nolimit')){_0x48cd06[_0xc27b('0x1c')]=qs[_0xc27b('0x1c')](_0x52f74d[_0xc27b('0x31')]['limit']);_0x48cd06[_0xc27b('0x1b')]=qs[_0xc27b('0x1b')](_0x52f74d[_0xc27b('0x31')][_0xc27b('0x1b')]);}return _0x1e0eda[_0xc27b('0x82')](_0x48cd06);}})['then'](function(_0x405349){if(_0x405349){return _0x405349?{'count':_0x2cbf00,'rows':_0x405349}:null;}})[_0xc27b('0x22')](respondWithResult(_0x18225a,null))[_0xc27b('0x43')](handleError(_0x18225a,null));};exports[_0xc27b('0x83')]=function(_0x3f2483,_0x271c43,_0x99f907){var _0x64b202,_0x65ee3a;return db[_0xc27b('0x2d')][_0xc27b('0x47')]({'where':{'id':_0x3f2483['params']['id']}})['then'](handleEntityNotFound(_0x271c43,null))[_0xc27b('0x22')](function(_0x2d7998){if(_0x2d7998){_0x65ee3a=_0x2d7998;return _0x2d7998[_0xc27b('0x83')](_0x3f2483['body'][_0xc27b('0x65')],_[_0xc27b('0x53')](_0x3f2483[_0xc27b('0x49')],['ids','id'])||{});}return null;})[_0xc27b('0x84')](function(_0x14e115){var _0x2b9a60;_0x64b202=_0x14e115||[];var _0x5e40a0=[];if(_0x14e115){for(var _0x49f90c=0x0;_0x49f90c<_0x14e115[_0xc27b('0x52')];_0x49f90c+=0x1){var _0x507432=_0x14e115[_0x49f90c]['get']({'plain':!![]});_0x2b9a60=squel[_0xc27b('0x7b')]()[_0xc27b('0x68')]('cm_hopper_black')[_0xc27b('0x7c')]([_0xc27b('0x6a'),_0xc27b('0x6b'),'ListId',_0xc27b('0x5c'),_0xc27b('0x54'),_0xc27b('0x55')],squel[_0xc27b('0x76')]()[_0xc27b('0x6d')](_0xc27b('0x6a'),_0xc27b('0x6a'))[_0xc27b('0x6d')]('id','ContactId')[_0xc27b('0x6d')](_0x507432[_0xc27b('0x7d')]['toString'](),_0xc27b('0x6c'))[_0xc27b('0x6d')](_0x3f2483['params']['id'][_0xc27b('0x70')](),_0xc27b('0x5c'))[_0xc27b('0x6d')](_0xc27b('0x6e'),_0xc27b('0x54'))['field']('NOW()',_0xc27b('0x55'))[_0xc27b('0x71')]('cm_contacts')[_0xc27b('0x3a')](_0xc27b('0x73'))[_0xc27b('0x3a')](_0xc27b('0x74'),_0x507432[_0xc27b('0x7d')][_0xc27b('0x70')]())[_0xc27b('0x3a')](_0xc27b('0x7e')))['toString']();_0x5e40a0['push'](db['sequelize']['query'](_0x2b9a60));}return BPromise['all'](_0x5e40a0);}})[_0xc27b('0x22')](function(){return _0x64b202;})[_0xc27b('0x22')](respondWithResult(_0x271c43,null))[_0xc27b('0x43')](handleError(_0x271c43,null));};exports[_0xc27b('0x85')]=function(_0x8c632f,_0x54fa6b,_0x21160f){return db[_0xc27b('0x2d')][_0xc27b('0x47')]({'where':{'id':_0x8c632f[_0xc27b('0x45')]['id']}})['then'](handleEntityNotFound(_0x54fa6b,null))[_0xc27b('0x22')](function(_0xa524de){if(_0xa524de){return _0xa524de[_0xc27b('0x85')](_0x8c632f[_0xc27b('0x31')]['ids']);}})[_0xc27b('0x22')](function(_0x467e24){if(_0x467e24){return db[_0xc27b('0x60')]['destroy']({'where':{'ListId':_0x8c632f[_0xc27b('0x31')][_0xc27b('0x65')],'CampaignId':_0x8c632f[_0xc27b('0x45')]['id']}})[_0xc27b('0x22')](function(){return _0x467e24;});}})[_0xc27b('0x22')](respondWithStatusCode(_0x54fa6b,null))[_0xc27b('0x43')](handleError(_0x54fa6b,null));}; \ No newline at end of file +var _0x8adb=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','set','reject','save','then','destroy','stack','name','map','Campaign','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','findAll','catch','show','params','rawAttributes','keys','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','userProfileId','UserProfileResource','error','clone','length','include','createdAt','updatedAt','omit','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','CampaignId','rows','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','field','CmListId','ListId','toString','NOW()','from','cm_contacts','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','into','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2b8e39,_0x170dc1){var _0x591515=function(_0x5f3528){while(--_0x5f3528){_0x2b8e39['push'](_0x2b8e39['shift']());}};_0x591515(++_0x170dc1);}(_0x8adb,0xf5));var _0xb8ad=function(_0x34380b,_0x249caf){_0x34380b=_0x34380b-0x0;var _0x11f37e=_0x8adb[_0x34380b];return _0x11f37e;};'use strict';var emlformat=require(_0xb8ad('0x0'));var rimraf=require(_0xb8ad('0x1'));var zipdir=require(_0xb8ad('0x2'));var jsonpatch=require(_0xb8ad('0x3'));var rp=require(_0xb8ad('0x4'));var moment=require(_0xb8ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb8ad('0x6'));var util=require('util');var path=require(_0xb8ad('0x7'));var sox=require(_0xb8ad('0x8'));var csv=require(_0xb8ad('0x9'));var ejs=require(_0xb8ad('0xa'));var fs=require('fs');var fs_extra=require(_0xb8ad('0xb'));var _=require(_0xb8ad('0xc'));var squel=require(_0xb8ad('0xd'));var crypto=require('crypto');var jsforce=require(_0xb8ad('0xe'));var deskjs=require(_0xb8ad('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb8ad('0x10'));var Papa=require(_0xb8ad('0x11'));var Redis=require('ioredis');var authService=require(_0xb8ad('0x12'));var qs=require(_0xb8ad('0x13'));var as=require(_0xb8ad('0x14'));var hardwareService=require(_0xb8ad('0x15'));var logger=require(_0xb8ad('0x16'))(_0xb8ad('0x17'));var utils=require(_0xb8ad('0x18'));var config=require(_0xb8ad('0x19'));var licenseUtil=require(_0xb8ad('0x1a'));var db=require(_0xb8ad('0x1b'))['db'];function respondWithStatusCode(_0x211480,_0x1c06db){_0x1c06db=_0x1c06db||0xcc;return function(_0x11ffe1){if(_0x11ffe1){return _0x211480[_0xb8ad('0x1c')](_0x1c06db);}return _0x211480[_0xb8ad('0x1d')](_0x1c06db)['end']();};}function respondWithResult(_0x5879d9,_0x2a9eb6){_0x2a9eb6=_0x2a9eb6||0xc8;return function(_0xc240c1){if(_0xc240c1){return _0x5879d9['status'](_0x2a9eb6)[_0xb8ad('0x1e')](_0xc240c1);}};}function respondWithFilteredResult(_0x1122f4,_0xe91090){return function(_0x46a78d){if(_0x46a78d){var _0x2f0acb=_0x46a78d['count'],_0x31d80d=_0xe91090[_0xb8ad('0x1f')],_0x29ab4a=_0xe91090[_0xb8ad('0x1f')]+_0xe91090['limit'],_0x30f2b2;if(_0x29ab4a>=_0x2f0acb){_0x29ab4a=_0x2f0acb;_0x30f2b2=0xc8;}else{_0x30f2b2=0xce;}_0x1122f4[_0xb8ad('0x1d')](_0x30f2b2);return _0x1122f4[_0xb8ad('0x20')]('Content-Range',_0x31d80d+'-'+_0x29ab4a+'/'+_0x2f0acb)[_0xb8ad('0x1e')](_0x46a78d);}return null;};}function patchUpdates(_0x3cc2a2){return function(_0x379e47){try{jsonpatch['apply'](_0x379e47,_0x3cc2a2,!![]);}catch(_0x44de31){return BPromise[_0xb8ad('0x21')](_0x44de31);}return _0x379e47[_0xb8ad('0x22')]();};}function saveUpdates(_0x51cadc,_0x1bd3d4){return function(_0x18ff5c){if(_0x18ff5c){return _0x18ff5c['update'](_0x51cadc)[_0xb8ad('0x23')](function(_0x5e6056){return _0x5e6056;});}return null;};}function removeEntity(_0xeed146,_0x62bea3){return function(_0x559f46){if(_0x559f46){return _0x559f46[_0xb8ad('0x24')]()['then'](function(){var _0x43bf69=_0x559f46['get']({'plain':!![]});var _0x2c5eec='IvrCampaigns';return db['UserProfileResource'][_0xb8ad('0x24')]({'where':{'type':_0x2c5eec,'resourceId':_0x43bf69['id']}})[_0xb8ad('0x23')](function(){return _0x559f46;});})[_0xb8ad('0x23')](function(){_0xeed146[_0xb8ad('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x351f51,_0xfef3e2){return function(_0x6a0811){if(!_0x6a0811){_0x351f51[_0xb8ad('0x1c')](0x194);}return _0x6a0811;};}function handleError(_0x381aec,_0x66a639){_0x66a639=_0x66a639||0x1f4;return function(_0x7639b9){logger['error'](_0x7639b9[_0xb8ad('0x25')]);if(_0x7639b9[_0xb8ad('0x26')]){delete _0x7639b9[_0xb8ad('0x26')];}_0x381aec['status'](_0x66a639)['send'](_0x7639b9);};}exports['index']=function(_0x48aea8,_0x5a9e51){var _0x3a83a2={},_0x4eaa90={},_0x5aed71={'count':0x0,'rows':[]};var _0x5793d1=_[_0xb8ad('0x27')](db[_0xb8ad('0x28')]['rawAttributes'],function(_0x2c9224){return{'name':_0x2c9224[_0xb8ad('0x29')],'type':_0x2c9224['type'][_0xb8ad('0x2a')]};});_0x4eaa90[_0xb8ad('0x2b')]=_[_0xb8ad('0x27')](_0x5793d1,_0xb8ad('0x26'));_0x4eaa90[_0xb8ad('0x2c')]=_['keys'](_0x48aea8[_0xb8ad('0x2c')]);_0x4eaa90[_0xb8ad('0x2d')]=_[_0xb8ad('0x2e')](_0x4eaa90[_0xb8ad('0x2b')],_0x4eaa90[_0xb8ad('0x2c')]);_0x3a83a2[_0xb8ad('0x2f')]=_[_0xb8ad('0x2e')](_0x4eaa90[_0xb8ad('0x2b')],qs[_0xb8ad('0x30')](_0x48aea8['query'][_0xb8ad('0x30')]));_0x3a83a2[_0xb8ad('0x2f')]=_0x3a83a2[_0xb8ad('0x2f')]['length']?_0x3a83a2['attributes']:_0x4eaa90[_0xb8ad('0x2b')];if(!_0x48aea8[_0xb8ad('0x2c')][_0xb8ad('0x31')]('nolimit')){_0x3a83a2['limit']=qs[_0xb8ad('0x32')](_0x48aea8[_0xb8ad('0x2c')][_0xb8ad('0x32')]);_0x3a83a2[_0xb8ad('0x1f')]=qs[_0xb8ad('0x1f')](_0x48aea8[_0xb8ad('0x2c')][_0xb8ad('0x1f')]);}_0x3a83a2[_0xb8ad('0x33')]=qs[_0xb8ad('0x34')](_0x48aea8['query'][_0xb8ad('0x34')]);_0x3a83a2[_0xb8ad('0x35')]=qs['filters'](_[_0xb8ad('0x36')](_0x48aea8[_0xb8ad('0x2c')],_0x4eaa90[_0xb8ad('0x2d')]),_0x5793d1);if(_0x48aea8[_0xb8ad('0x2c')][_0xb8ad('0x37')]){_0x3a83a2[_0xb8ad('0x35')]=_[_0xb8ad('0x38')](_0x3a83a2[_0xb8ad('0x35')],{'$or':_[_0xb8ad('0x27')](_0x5793d1,function(_0x1f5a3d){if(_0x1f5a3d[_0xb8ad('0x39')]!==_0xb8ad('0x3a')){var _0x239639={};_0x239639[_0x1f5a3d['name']]={'$like':'%'+_0x48aea8['query'][_0xb8ad('0x37')]+'%'};return _0x239639;}})});}_0x3a83a2=_[_0xb8ad('0x38')]({},_0x3a83a2,_0x48aea8['options']);var _0x3d4ae3={'where':_0x3a83a2[_0xb8ad('0x35')]};return db['Campaign'][_0xb8ad('0x3b')](_0x3d4ae3)['then'](function(_0x3070d3){_0x5aed71[_0xb8ad('0x3b')]=_0x3070d3;if(_0x48aea8[_0xb8ad('0x2c')][_0xb8ad('0x3c')]){_0x3a83a2['include']=[{'all':!![]}];}return db['Campaign'][_0xb8ad('0x3d')](_0x3a83a2);})[_0xb8ad('0x23')](function(_0x16bfad){_0x5aed71['rows']=_0x16bfad;return _0x5aed71;})['then'](respondWithFilteredResult(_0x5a9e51,_0x3a83a2))[_0xb8ad('0x3e')](handleError(_0x5a9e51,null));};exports[_0xb8ad('0x3f')]=function(_0x4d0d0c,_0x530d23){var _0x23a045={'raw':![],'where':{'id':_0x4d0d0c[_0xb8ad('0x40')]['id']}},_0x2c8ed2={};_0x2c8ed2[_0xb8ad('0x2b')]=_['keys'](db[_0xb8ad('0x28')][_0xb8ad('0x41')]);_0x2c8ed2[_0xb8ad('0x2c')]=_[_0xb8ad('0x42')](_0x4d0d0c[_0xb8ad('0x2c')]);_0x2c8ed2[_0xb8ad('0x2d')]=_[_0xb8ad('0x2e')](_0x2c8ed2[_0xb8ad('0x2b')],_0x2c8ed2['query']);_0x23a045[_0xb8ad('0x2f')]=_[_0xb8ad('0x2e')](_0x2c8ed2[_0xb8ad('0x2b')],qs[_0xb8ad('0x30')](_0x4d0d0c[_0xb8ad('0x2c')][_0xb8ad('0x30')]));_0x23a045['attributes']=_0x23a045[_0xb8ad('0x2f')]['length']?_0x23a045[_0xb8ad('0x2f')]:_0x2c8ed2[_0xb8ad('0x2b')];if(_0x4d0d0c[_0xb8ad('0x2c')]['includeAll']){_0x23a045['include']=[{'all':!![]}];}_0x23a045=_[_0xb8ad('0x38')]({},_0x23a045,_0x4d0d0c[_0xb8ad('0x43')]);return db[_0xb8ad('0x28')][_0xb8ad('0x44')](_0x23a045)[_0xb8ad('0x23')](handleEntityNotFound(_0x530d23,null))[_0xb8ad('0x23')](respondWithResult(_0x530d23,null))['catch'](handleError(_0x530d23,null));};exports[_0xb8ad('0x45')]=function(_0x3714af,_0x1f2abd){return db[_0xb8ad('0x28')]['create'](_0x3714af[_0xb8ad('0x46')],{})[_0xb8ad('0x23')](function(_0x8cdce1){var _0x1cfb66=_0x3714af[_0xb8ad('0x47')][_0xb8ad('0x48')]({'plain':!![]});if(!_0x1cfb66)throw new Error(_0xb8ad('0x49'));if(_0x1cfb66['role']===_0xb8ad('0x47')){var _0x5447f5=_0x8cdce1[_0xb8ad('0x48')]({'plain':!![]});var _0xa3e6df=_0xb8ad('0x4a');return db['UserProfileSection'][_0xb8ad('0x44')]({'where':{'name':_0xa3e6df,'userProfileId':_0x1cfb66[_0xb8ad('0x4b')]},'raw':!![]})[_0xb8ad('0x23')](function(_0x5a82ad){if(_0x5a82ad&&_0x5a82ad['autoAssociation']===0x0){return db[_0xb8ad('0x4c')][_0xb8ad('0x45')]({'name':_0x5447f5[_0xb8ad('0x26')],'resourceId':_0x5447f5['id'],'type':_0x5a82ad['name'],'sectionId':_0x5a82ad['id']},{})[_0xb8ad('0x23')](function(){return _0x8cdce1;});}else{return _0x8cdce1;}})[_0xb8ad('0x3e')](function(_0x3c8401){logger[_0xb8ad('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c8401);throw _0x3c8401;});}return _0x8cdce1;})[_0xb8ad('0x23')](respondWithResult(_0x1f2abd,0xc9))[_0xb8ad('0x3e')](handleError(_0x1f2abd,null));};exports[_0xb8ad('0x4e')]=function(_0x2cc433,_0x4407a5){var _0x8c72d8={'where':{'id':_0x2cc433['params']['id']}},_0x2b3228={};_0x2b3228[_0xb8ad('0x2b')]=_[_0xb8ad('0x42')](db[_0xb8ad('0x28')][_0xb8ad('0x41')]);_0x8c72d8[_0xb8ad('0x2f')]=_[_0xb8ad('0x2e')](_0x2b3228[_0xb8ad('0x2b')],qs['fields'](_0x2cc433[_0xb8ad('0x2c')]['fields']));_0x8c72d8[_0xb8ad('0x2f')]=_0x8c72d8['attributes'][_0xb8ad('0x4f')]?_0x8c72d8[_0xb8ad('0x2f')]:_0x2b3228['model'];if(_0x2cc433[_0xb8ad('0x2c')]['includeAll']){_0x8c72d8[_0xb8ad('0x50')]=[{'all':!![]}];}_0x8c72d8=_[_0xb8ad('0x38')]({},_0x8c72d8,_0x2cc433[_0xb8ad('0x43')]);return db[_0xb8ad('0x28')][_0xb8ad('0x44')](_0x8c72d8)[_0xb8ad('0x23')](handleEntityNotFound(_0x4407a5,null))['then'](function(_0x38d7a9){if(_0x38d7a9){var _0x5468b1=_0x38d7a9[_0xb8ad('0x48')]({'plain':!![]});_0x5468b1=qs['omit'](_0x5468b1,['id',_0xb8ad('0x51'),_0xb8ad('0x52')]);_0x2cc433[_0xb8ad('0x46')]=_[_0xb8ad('0x53')](_0x2cc433['body'],['id',_0xb8ad('0x51'),'updatedAt']);return db['Campaign'][_0xb8ad('0x45')](_[_0xb8ad('0x38')](_0x5468b1,_0x2cc433['body']),{'include':_0x2cc433[_0xb8ad('0x2c')][_0xb8ad('0x3c')]?[{'all':!![]}]:undefined})[_0xb8ad('0x23')](function(_0x37b7ea){var _0x18eabf=_0x2cc433[_0xb8ad('0x47')][_0xb8ad('0x48')]({'plain':!![]});if(!_0x18eabf)throw new Error(_0xb8ad('0x49'));if(_0x18eabf['role']===_0xb8ad('0x47')){var _0x2a54ba=_0x37b7ea[_0xb8ad('0x48')]({'plain':!![]});var _0x20b424=_0xb8ad('0x4a');return db[_0xb8ad('0x54')]['find']({'where':{'name':_0x20b424,'userProfileId':_0x18eabf[_0xb8ad('0x4b')]},'raw':!![]})['then'](function(_0x25fd26){if(_0x25fd26&&_0x25fd26['autoAssociation']===0x0){return db['UserProfileResource'][_0xb8ad('0x45')]({'name':_0x2a54ba[_0xb8ad('0x26')],'resourceId':_0x2a54ba['id'],'type':_0x25fd26[_0xb8ad('0x26')],'sectionId':_0x25fd26['id']},{})[_0xb8ad('0x23')](function(){return _0x37b7ea;});}else{return _0x37b7ea;}})[_0xb8ad('0x3e')](function(_0x4982a2){logger[_0xb8ad('0x4d')](_0xb8ad('0x55'),_0x4982a2);throw _0x4982a2;});}return _0x37b7ea;});}})[_0xb8ad('0x23')](respondWithResult(_0x4407a5,0xc9))[_0xb8ad('0x3e')](handleError(_0x4407a5,null));};exports[_0xb8ad('0x56')]=function(_0x4ce9f8,_0x42bf78){if(_0x4ce9f8['body']['id']){delete _0x4ce9f8[_0xb8ad('0x46')]['id'];}return db[_0xb8ad('0x28')][_0xb8ad('0x44')]({'where':{'id':_0x4ce9f8[_0xb8ad('0x40')]['id']}})['then'](handleEntityNotFound(_0x42bf78,null))['then'](saveUpdates(_0x4ce9f8[_0xb8ad('0x46')],null))['then'](respondWithResult(_0x42bf78,null))[_0xb8ad('0x3e')](handleError(_0x42bf78,null));};exports[_0xb8ad('0x24')]=function(_0x14cd35,_0x5a5999){return db[_0xb8ad('0x28')][_0xb8ad('0x44')]({'where':{'id':_0x14cd35[_0xb8ad('0x40')]['id']}})[_0xb8ad('0x23')](handleEntityNotFound(_0x5a5999,null))[_0xb8ad('0x23')](removeEntity(_0x5a5999,null))[_0xb8ad('0x3e')](handleError(_0x5a5999,null));};exports['getHoppers']=function(_0x4a944c,_0x42642c,_0x38ff2a){var _0x323841={'raw':!![],'where':{}};var _0x2e7cc5={};var _0x543184={'count':0x0,'rows':[]};return db[_0xb8ad('0x28')][_0xb8ad('0x57')]({'where':{'id':_0x4a944c[_0xb8ad('0x40')]['id']}})[_0xb8ad('0x23')](handleEntityNotFound(_0x42642c,null))[_0xb8ad('0x23')](function(_0x553fcf){if(_0x553fcf){_0x2e7cc5[_0xb8ad('0x2b')]=_[_0xb8ad('0x42')](db[_0xb8ad('0x58')][_0xb8ad('0x41')]);_0x2e7cc5['query']=_[_0xb8ad('0x42')](_0x4a944c[_0xb8ad('0x2c')]);_0x2e7cc5[_0xb8ad('0x2d')]=_[_0xb8ad('0x2e')](_0x2e7cc5['model'],_0x2e7cc5['query']);_0x323841[_0xb8ad('0x2f')]=_[_0xb8ad('0x2e')](_0x2e7cc5[_0xb8ad('0x2b')],qs[_0xb8ad('0x30')](_0x4a944c[_0xb8ad('0x2c')][_0xb8ad('0x30')]));_0x323841[_0xb8ad('0x2f')]=_0x323841['attributes'][_0xb8ad('0x4f')]?_0x323841[_0xb8ad('0x2f')]:_0x2e7cc5[_0xb8ad('0x2b')];if(!_0x4a944c[_0xb8ad('0x2c')]['hasOwnProperty']('nolimit')){_0x323841[_0xb8ad('0x32')]=qs[_0xb8ad('0x32')](_0x4a944c[_0xb8ad('0x2c')][_0xb8ad('0x32')]);_0x323841[_0xb8ad('0x1f')]=qs['offset'](_0x4a944c[_0xb8ad('0x2c')][_0xb8ad('0x1f')]);}_0x323841[_0xb8ad('0x33')]=qs[_0xb8ad('0x34')](_0x4a944c[_0xb8ad('0x2c')][_0xb8ad('0x34')]);_0x323841[_0xb8ad('0x35')]=qs[_0xb8ad('0x2d')](_[_0xb8ad('0x36')](_0x4a944c['query'],_0x2e7cc5['filters']));_0x323841[_0xb8ad('0x35')][_0xb8ad('0x59')]=_0x553fcf['id'];if(_0x4a944c[_0xb8ad('0x2c')][_0xb8ad('0x37')]){_0x323841[_0xb8ad('0x35')]=_[_0xb8ad('0x38')](_0x323841[_0xb8ad('0x35')],{'$or':_[_0xb8ad('0x27')](_0x323841[_0xb8ad('0x2f')],function(_0x7e9a37){var _0x4e7188={};_0x4e7188[_0x7e9a37]={'$like':'%'+_0x4a944c[_0xb8ad('0x2c')][_0xb8ad('0x37')]+'%'};return _0x4e7188;})});}_0x323841=_[_0xb8ad('0x38')]({},_0x323841,_0x4a944c[_0xb8ad('0x43')]);return db[_0xb8ad('0x58')]['count']({'where':_0x323841[_0xb8ad('0x35')]})['then'](function(_0x1757f9){_0x543184[_0xb8ad('0x3b')]=_0x1757f9;if(_0x4a944c[_0xb8ad('0x2c')][_0xb8ad('0x3c')]){_0x323841[_0xb8ad('0x50')]=[{'all':!![]}];}return db[_0xb8ad('0x58')]['findAll'](_0x323841);})[_0xb8ad('0x23')](function(_0x2e398b){_0x543184[_0xb8ad('0x5a')]=_0x2e398b;return _0x543184;});}})[_0xb8ad('0x23')](respondWithFilteredResult(_0x42642c,_0x323841))[_0xb8ad('0x3e')](handleError(_0x42642c,null));};exports['getHopperHistories']=function(_0x19e1d7,_0x52cf8c,_0x5b60ec){var _0x22e068={'raw':!![],'where':{}};var _0x5ef49a={};var _0x15b4e2={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x19e1d7[_0xb8ad('0x40')]['id']}})['then'](handleEntityNotFound(_0x52cf8c,null))['then'](function(_0x2a4b65){if(_0x2a4b65){_0x5ef49a[_0xb8ad('0x2b')]=_[_0xb8ad('0x42')](db[_0xb8ad('0x5b')][_0xb8ad('0x41')]);_0x5ef49a[_0xb8ad('0x2c')]=_['keys'](_0x19e1d7['query']);_0x5ef49a['filters']=_[_0xb8ad('0x2e')](_0x5ef49a[_0xb8ad('0x2b')],_0x5ef49a[_0xb8ad('0x2c')]);_0x22e068[_0xb8ad('0x2f')]=_['intersection'](_0x5ef49a[_0xb8ad('0x2b')],qs[_0xb8ad('0x30')](_0x19e1d7[_0xb8ad('0x2c')][_0xb8ad('0x30')]));_0x22e068[_0xb8ad('0x2f')]=_0x22e068['attributes'][_0xb8ad('0x4f')]?_0x22e068[_0xb8ad('0x2f')]:_0x5ef49a['model'];if(!_0x19e1d7[_0xb8ad('0x2c')]['hasOwnProperty'](_0xb8ad('0x5c'))){_0x22e068[_0xb8ad('0x32')]=qs['limit'](_0x19e1d7[_0xb8ad('0x2c')][_0xb8ad('0x32')]);_0x22e068[_0xb8ad('0x1f')]=qs[_0xb8ad('0x1f')](_0x19e1d7[_0xb8ad('0x2c')][_0xb8ad('0x1f')]);}_0x22e068[_0xb8ad('0x33')]=qs[_0xb8ad('0x34')](_0x19e1d7[_0xb8ad('0x2c')][_0xb8ad('0x34')]);_0x22e068['where']=qs[_0xb8ad('0x2d')](_[_0xb8ad('0x36')](_0x19e1d7[_0xb8ad('0x2c')],_0x5ef49a['filters']));_0x22e068[_0xb8ad('0x35')]['CampaignId']=_0x2a4b65['id'];if(_0x19e1d7[_0xb8ad('0x2c')]['filter']){_0x22e068[_0xb8ad('0x35')]=_[_0xb8ad('0x38')](_0x22e068[_0xb8ad('0x35')],{'$or':_['map'](_0x22e068[_0xb8ad('0x2f')],function(_0x11d4a0){var _0x349dcd={};_0x349dcd[_0x11d4a0]={'$like':'%'+_0x19e1d7[_0xb8ad('0x2c')][_0xb8ad('0x37')]+'%'};return _0x349dcd;})});}_0x22e068=_[_0xb8ad('0x38')]({},_0x22e068,_0x19e1d7['options']);return db[_0xb8ad('0x5b')]['count']({'where':_0x22e068[_0xb8ad('0x35')]})[_0xb8ad('0x23')](function(_0x531d55){_0x15b4e2[_0xb8ad('0x3b')]=_0x531d55;if(_0x19e1d7[_0xb8ad('0x2c')][_0xb8ad('0x3c')]){_0x22e068[_0xb8ad('0x50')]=[{'all':!![]}];}return db[_0xb8ad('0x5b')][_0xb8ad('0x3d')](_0x22e068);})[_0xb8ad('0x23')](function(_0xdc4be1){_0x15b4e2[_0xb8ad('0x5a')]=_0xdc4be1;return _0x15b4e2;});}})[_0xb8ad('0x23')](respondWithFilteredResult(_0x52cf8c,_0x22e068))[_0xb8ad('0x3e')](handleError(_0x52cf8c,null));};exports[_0xb8ad('0x5d')]=function(_0x24f2d5,_0x15ad78,_0x152446){var _0x5150b2={'raw':!![],'where':{}};var _0x31e498={};var _0x3f841f={'count':0x0,'rows':[]};return db[_0xb8ad('0x28')][_0xb8ad('0x57')]({'where':{'id':_0x24f2d5[_0xb8ad('0x40')]['id']}})[_0xb8ad('0x23')](handleEntityNotFound(_0x15ad78,null))[_0xb8ad('0x23')](function(_0x4d90d7){if(_0x4d90d7){_0x31e498[_0xb8ad('0x2b')]=_['keys'](db[_0xb8ad('0x5e')][_0xb8ad('0x41')]);_0x31e498[_0xb8ad('0x2c')]=_[_0xb8ad('0x42')](_0x24f2d5[_0xb8ad('0x2c')]);_0x31e498['filters']=_[_0xb8ad('0x2e')](_0x31e498[_0xb8ad('0x2b')],_0x31e498['query']);_0x5150b2[_0xb8ad('0x2f')]=_['intersection'](_0x31e498['model'],qs[_0xb8ad('0x30')](_0x24f2d5[_0xb8ad('0x2c')][_0xb8ad('0x30')]));_0x5150b2[_0xb8ad('0x2f')]=_0x5150b2['attributes'][_0xb8ad('0x4f')]?_0x5150b2[_0xb8ad('0x2f')]:_0x31e498[_0xb8ad('0x2b')];if(!_0x24f2d5[_0xb8ad('0x2c')]['hasOwnProperty'](_0xb8ad('0x5c'))){_0x5150b2[_0xb8ad('0x32')]=qs[_0xb8ad('0x32')](_0x24f2d5[_0xb8ad('0x2c')][_0xb8ad('0x32')]);_0x5150b2[_0xb8ad('0x1f')]=qs[_0xb8ad('0x1f')](_0x24f2d5['query'][_0xb8ad('0x1f')]);}_0x5150b2['order']=qs['sort'](_0x24f2d5[_0xb8ad('0x2c')][_0xb8ad('0x34')]);_0x5150b2[_0xb8ad('0x35')]=qs[_0xb8ad('0x2d')](_[_0xb8ad('0x36')](_0x24f2d5[_0xb8ad('0x2c')],_0x31e498['filters']));_0x5150b2['where']['CampaignId']=_0x4d90d7['id'];if(_0x24f2d5[_0xb8ad('0x2c')][_0xb8ad('0x37')]){_0x5150b2[_0xb8ad('0x35')]=_[_0xb8ad('0x38')](_0x5150b2[_0xb8ad('0x35')],{'$or':_[_0xb8ad('0x27')](_0x5150b2[_0xb8ad('0x2f')],function(_0x464092){var _0x5067b3={};_0x5067b3[_0x464092]={'$like':'%'+_0x24f2d5['query'][_0xb8ad('0x37')]+'%'};return _0x5067b3;})});}_0x5150b2=_[_0xb8ad('0x38')]({},_0x5150b2,_0x24f2d5['options']);return db[_0xb8ad('0x5e')][_0xb8ad('0x3b')]({'where':_0x5150b2[_0xb8ad('0x35')]})[_0xb8ad('0x23')](function(_0x2d619e){_0x3f841f[_0xb8ad('0x3b')]=_0x2d619e;if(_0x24f2d5['query']['includeAll']){_0x5150b2[_0xb8ad('0x50')]=[{'all':!![]}];}return db[_0xb8ad('0x5e')][_0xb8ad('0x3d')](_0x5150b2);})[_0xb8ad('0x23')](function(_0x80439a){_0x3f841f[_0xb8ad('0x5a')]=_0x80439a;return _0x3f841f;});}})['then'](respondWithFilteredResult(_0x15ad78,_0x5150b2))[_0xb8ad('0x3e')](handleError(_0x15ad78,null));};exports[_0xb8ad('0x5f')]=function(_0x11d6d0,_0x227c8b,_0x1ac617){var _0x4cc050={'raw':!![],'where':{}};var _0x2b5c18={};var _0x2378d2={'count':0x0,'rows':[]};return db[_0xb8ad('0x28')][_0xb8ad('0x57')]({'where':{'id':_0x11d6d0[_0xb8ad('0x40')]['id']}})['then'](handleEntityNotFound(_0x227c8b,null))[_0xb8ad('0x23')](function(_0x2c6cb4){if(_0x2c6cb4){_0x2b5c18['model']=_['keys'](db['CmHopperBlack'][_0xb8ad('0x41')]);_0x2b5c18[_0xb8ad('0x2c')]=_[_0xb8ad('0x42')](_0x11d6d0[_0xb8ad('0x2c')]);_0x2b5c18[_0xb8ad('0x2d')]=_['intersection'](_0x2b5c18[_0xb8ad('0x2b')],_0x2b5c18[_0xb8ad('0x2c')]);_0x4cc050[_0xb8ad('0x2f')]=_[_0xb8ad('0x2e')](_0x2b5c18[_0xb8ad('0x2b')],qs[_0xb8ad('0x30')](_0x11d6d0[_0xb8ad('0x2c')][_0xb8ad('0x30')]));_0x4cc050[_0xb8ad('0x2f')]=_0x4cc050[_0xb8ad('0x2f')]['length']?_0x4cc050['attributes']:_0x2b5c18['model'];if(!_0x11d6d0[_0xb8ad('0x2c')][_0xb8ad('0x31')](_0xb8ad('0x5c'))){_0x4cc050['limit']=qs[_0xb8ad('0x32')](_0x11d6d0[_0xb8ad('0x2c')][_0xb8ad('0x32')]);_0x4cc050[_0xb8ad('0x1f')]=qs['offset'](_0x11d6d0[_0xb8ad('0x2c')][_0xb8ad('0x1f')]);}_0x4cc050[_0xb8ad('0x33')]=qs['sort'](_0x11d6d0['query']['sort']);_0x4cc050['where']=qs['filters'](_[_0xb8ad('0x36')](_0x11d6d0['query'],_0x2b5c18[_0xb8ad('0x2d')]));_0x4cc050[_0xb8ad('0x35')]['CampaignId']=_0x2c6cb4['id'];if(_0x11d6d0[_0xb8ad('0x2c')]['filter']){_0x4cc050[_0xb8ad('0x35')]=_[_0xb8ad('0x38')](_0x4cc050[_0xb8ad('0x35')],{'$or':_['map'](_0x4cc050[_0xb8ad('0x2f')],function(_0xc7bdb0){var _0x56482a={};_0x56482a[_0xc7bdb0]={'$like':'%'+_0x11d6d0[_0xb8ad('0x2c')]['filter']+'%'};return _0x56482a;})});}_0x4cc050=_[_0xb8ad('0x38')]({},_0x4cc050,_0x11d6d0[_0xb8ad('0x43')]);return db[_0xb8ad('0x60')][_0xb8ad('0x3b')]({'where':_0x4cc050[_0xb8ad('0x35')]})[_0xb8ad('0x23')](function(_0x4ba010){_0x2378d2['count']=_0x4ba010;if(_0x11d6d0['query']['includeAll']){_0x4cc050['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xb8ad('0x3d')](_0x4cc050);})[_0xb8ad('0x23')](function(_0x2803a1){_0x2378d2[_0xb8ad('0x5a')]=_0x2803a1;return _0x2378d2;});}})[_0xb8ad('0x23')](respondWithFilteredResult(_0x227c8b,_0x4cc050))[_0xb8ad('0x3e')](handleError(_0x227c8b,null));};exports['getLists']=function(_0x7a2b0b,_0x578806,_0x5762f9){var _0x5f4ecd={};var _0x208c9f={};var _0xf331b2;var _0x36220f;return db[_0xb8ad('0x28')][_0xb8ad('0x57')]({'where':{'id':_0x7a2b0b[_0xb8ad('0x40')]['id']}})[_0xb8ad('0x23')](handleEntityNotFound(_0x578806,null))[_0xb8ad('0x23')](function(_0x222abe){if(_0x222abe){_0xf331b2=_0x222abe;_0x208c9f[_0xb8ad('0x2b')]=_['keys'](db[_0xb8ad('0x61')]['rawAttributes']);_0x208c9f[_0xb8ad('0x2c')]=_[_0xb8ad('0x42')](_0x7a2b0b[_0xb8ad('0x2c')]);_0x208c9f[_0xb8ad('0x2d')]=_['intersection'](_0x208c9f['model'],_0x208c9f[_0xb8ad('0x2c')]);_0x5f4ecd['attributes']=_['intersection'](_0x208c9f[_0xb8ad('0x2b')],qs[_0xb8ad('0x30')](_0x7a2b0b[_0xb8ad('0x2c')][_0xb8ad('0x30')]));_0x5f4ecd[_0xb8ad('0x2f')]=_0x5f4ecd['attributes'][_0xb8ad('0x4f')]?_0x5f4ecd['attributes']:_0x208c9f['model'];_0x5f4ecd[_0xb8ad('0x33')]=qs[_0xb8ad('0x34')](_0x7a2b0b[_0xb8ad('0x2c')][_0xb8ad('0x34')]);_0x5f4ecd[_0xb8ad('0x35')]=qs[_0xb8ad('0x2d')](_['pick'](_0x7a2b0b['query'],_0x208c9f[_0xb8ad('0x2d')]));if(_0x7a2b0b[_0xb8ad('0x2c')][_0xb8ad('0x37')]){_0x5f4ecd[_0xb8ad('0x35')]=_[_0xb8ad('0x38')](_0x5f4ecd['where'],{'$or':_[_0xb8ad('0x27')](_0x5f4ecd[_0xb8ad('0x2f')],function(_0x2204ce){var _0x3beb32={};_0x3beb32[_0x2204ce]={'$like':'%'+_0x7a2b0b[_0xb8ad('0x2c')][_0xb8ad('0x37')]+'%'};return _0x3beb32;})});}_0x5f4ecd=_['merge']({},_0x5f4ecd,_0x7a2b0b['options']);return _0xf331b2[_0xb8ad('0x62')](_0x5f4ecd);}})['then'](function(_0x3fe779){if(_0x3fe779){_0x36220f=_0x3fe779[_0xb8ad('0x4f')];if(!_0x7a2b0b[_0xb8ad('0x2c')]['hasOwnProperty'](_0xb8ad('0x5c'))){_0x5f4ecd[_0xb8ad('0x32')]=qs[_0xb8ad('0x32')](_0x7a2b0b[_0xb8ad('0x2c')][_0xb8ad('0x32')]);_0x5f4ecd['offset']=qs[_0xb8ad('0x1f')](_0x7a2b0b[_0xb8ad('0x2c')]['offset']);}return _0xf331b2['getLists'](_0x5f4ecd);}})['then'](function(_0x1c1791){if(_0x1c1791){return _0x1c1791?{'count':_0x36220f,'rows':_0x1c1791}:null;}})['then'](respondWithResult(_0x578806,null))[_0xb8ad('0x3e')](handleError(_0x578806,null));};exports[_0xb8ad('0x63')]=function(_0x5cb130,_0x353a54,_0x53f7dc){var _0x26ff95,_0x133e56;return db[_0xb8ad('0x28')]['find']({'where':{'id':_0x5cb130[_0xb8ad('0x40')]['id']}})['then'](handleEntityNotFound(_0x353a54,null))['then'](function(_0x2b7117){if(_0x2b7117){_0x133e56=_0x2b7117;return _0x2b7117[_0xb8ad('0x63')](_0x5cb130[_0xb8ad('0x46')][_0xb8ad('0x64')],_['omit'](_0x5cb130['body'],['ids','id'])||{});}return null;})[_0xb8ad('0x65')](function(_0x4f0134){var _0x1e37a3;_0x26ff95=_0x4f0134||[];var _0x287295=[];if(_0x4f0134){for(var _0x2c778a=0x0;_0x2c778a<_0x4f0134[_0xb8ad('0x4f')];_0x2c778a+=0x1){var _0x4d0197=_0x4f0134[_0x2c778a][_0xb8ad('0x48')]({'plain':!![]});_0x133e56[_0xb8ad('0x66')]=_0x5cb130[_0xb8ad('0x46')][_0xb8ad('0x66')]?_0x5cb130[_0xb8ad('0x46')][_0xb8ad('0x66')]:_0x133e56[_0xb8ad('0x66')];switch(_0x133e56[_0xb8ad('0x66')]){case _0xb8ad('0x67'):_0x1e37a3=squel[_0xb8ad('0x68')]()['into']('cm_hopper')[_0xb8ad('0x69')]([_0xb8ad('0x6a'),_0xb8ad('0x6b'),_0xb8ad('0x6c'),'ListId','CampaignId',_0xb8ad('0x51'),'updatedAt'],squel['select']()[_0xb8ad('0x6d')](_0xb8ad('0x6a'),_0xb8ad('0x6a'))[_0xb8ad('0x6d')]('NOW()',_0xb8ad('0x6b'))[_0xb8ad('0x6d')]('id','ContactId')[_0xb8ad('0x6d')](_0x4d0197[_0xb8ad('0x6e')]['toString'](),_0xb8ad('0x6f'))[_0xb8ad('0x6d')](_0x5cb130[_0xb8ad('0x40')]['id'][_0xb8ad('0x70')](),'CampaignId')[_0xb8ad('0x6d')](_0xb8ad('0x71'),_0xb8ad('0x51'))[_0xb8ad('0x6d')](_0xb8ad('0x71'),_0xb8ad('0x52'))[_0xb8ad('0x72')](_0xb8ad('0x73'))['where']('deletedAt\x20IS\x20NULL')[_0xb8ad('0x35')]('ListId\x20=\x20?',_0x4d0197[_0xb8ad('0x6e')][_0xb8ad('0x70')]())[_0xb8ad('0x35')]('phone\x20IS\x20NOT\x20NULL')[_0xb8ad('0x35')](_0xb8ad('0x74'),squel[_0xb8ad('0x75')]()[_0xb8ad('0x6d')]('COALESCE(calleridnum,\x27\x27)')[_0xb8ad('0x72')](_0xb8ad('0x76'))[_0xb8ad('0x35')](_0xb8ad('0x77'),_0x5cb130['params']['id'][_0xb8ad('0x70')]()))['where'](_0xb8ad('0x74'),squel[_0xb8ad('0x75')]()[_0xb8ad('0x6d')](_0xb8ad('0x78'))[_0xb8ad('0x72')](_0xb8ad('0x79'))[_0xb8ad('0x35')]('CampaignId\x20=\x20?',_0x5cb130[_0xb8ad('0x40')]['id'][_0xb8ad('0x70')]())))['toString']();break;case _0xb8ad('0x7a'):_0x1e37a3=squel[_0xb8ad('0x68')]()[_0xb8ad('0x7b')](_0xb8ad('0x79'))['fromQuery']([_0xb8ad('0x6a'),_0xb8ad('0x6b'),_0xb8ad('0x6c'),_0xb8ad('0x6f'),_0xb8ad('0x59'),'createdAt',_0xb8ad('0x52')],squel['select']()['field'](_0xb8ad('0x6a'),'phone')[_0xb8ad('0x6d')](_0xb8ad('0x71'),'scheduledAt')[_0xb8ad('0x6d')]('id',_0xb8ad('0x6c'))[_0xb8ad('0x6d')](_0x4d0197[_0xb8ad('0x6e')][_0xb8ad('0x70')](),_0xb8ad('0x6f'))['field'](_0x5cb130[_0xb8ad('0x40')]['id'][_0xb8ad('0x70')](),_0xb8ad('0x59'))[_0xb8ad('0x6d')](_0xb8ad('0x71'),_0xb8ad('0x51'))[_0xb8ad('0x6d')](_0xb8ad('0x71'),_0xb8ad('0x52'))[_0xb8ad('0x72')](_0xb8ad('0x73'))[_0xb8ad('0x35')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x4d0197['CmListId'][_0xb8ad('0x70')]())[_0xb8ad('0x35')](_0xb8ad('0x7c'))[_0xb8ad('0x35')](_0xb8ad('0x74'),squel['select']()[_0xb8ad('0x6d')](_0xb8ad('0x78'))['from'](_0xb8ad('0x79'))[_0xb8ad('0x35')](_0xb8ad('0x77'),_0x5cb130[_0xb8ad('0x40')]['id'][_0xb8ad('0x70')]())))[_0xb8ad('0x70')]();break;default:_0x1e37a3=squel[_0xb8ad('0x68')]()['into']('cm_hopper')['fromQuery'](['phone',_0xb8ad('0x6b'),_0xb8ad('0x6c'),'ListId',_0xb8ad('0x59'),_0xb8ad('0x51'),_0xb8ad('0x52')],squel[_0xb8ad('0x75')]()[_0xb8ad('0x6d')](_0xb8ad('0x6a'),'phone')['field']('NOW()',_0xb8ad('0x6b'))['field']('id',_0xb8ad('0x6c'))[_0xb8ad('0x6d')](_0x4d0197[_0xb8ad('0x6e')]['toString'](),_0xb8ad('0x6f'))[_0xb8ad('0x6d')](_0x5cb130[_0xb8ad('0x40')]['id'][_0xb8ad('0x70')](),_0xb8ad('0x59'))['field']('NOW()',_0xb8ad('0x51'))['field']('NOW()',_0xb8ad('0x52'))[_0xb8ad('0x72')](_0xb8ad('0x73'))['where'](_0xb8ad('0x7d'))[_0xb8ad('0x35')](_0xb8ad('0x7e'),_0x4d0197['CmListId'][_0xb8ad('0x70')]())[_0xb8ad('0x35')](_0xb8ad('0x7c')))[_0xb8ad('0x70')]();}_0x287295[_0xb8ad('0x7f')](db['sequelize'][_0xb8ad('0x2c')](_0x1e37a3));}return BPromise['all'](_0x287295);}})[_0xb8ad('0x23')](function(){return _0x26ff95;})[_0xb8ad('0x23')](respondWithResult(_0x353a54,null))[_0xb8ad('0x3e')](handleError(_0x353a54,null));};exports[_0xb8ad('0x80')]=function(_0x744048,_0xab220f,_0x2fb246){return db[_0xb8ad('0x28')][_0xb8ad('0x44')]({'where':{'id':_0x744048['params']['id']}})[_0xb8ad('0x23')](handleEntityNotFound(_0xab220f,null))[_0xb8ad('0x23')](function(_0x4e6b32){if(_0x4e6b32){return _0x4e6b32['removeLists'](_0x744048[_0xb8ad('0x2c')][_0xb8ad('0x64')]);}})[_0xb8ad('0x23')](function(_0x3ae6d1){if(_0x3ae6d1){return db['CmHopper'][_0xb8ad('0x24')]({'where':{'ListId':_0x744048[_0xb8ad('0x2c')][_0xb8ad('0x64')],'CampaignId':_0x744048[_0xb8ad('0x40')]['id']}})['then'](function(){return _0x3ae6d1;});}})[_0xb8ad('0x23')](respondWithStatusCode(_0xab220f,null))[_0xb8ad('0x3e')](handleError(_0xab220f,null));};exports[_0xb8ad('0x81')]=function(_0x45510d,_0x2d5905,_0x19246f){var _0x4be199={};var _0x30aef6={};var _0x3bef4a;var _0x4210a7;return db[_0xb8ad('0x28')][_0xb8ad('0x57')]({'where':{'id':_0x45510d[_0xb8ad('0x40')]['id']}})[_0xb8ad('0x23')](handleEntityNotFound(_0x2d5905,null))['then'](function(_0x1edea1){if(_0x1edea1){_0x3bef4a=_0x1edea1;_0x30aef6[_0xb8ad('0x2b')]=_[_0xb8ad('0x42')](db[_0xb8ad('0x61')][_0xb8ad('0x41')]);_0x30aef6['query']=_[_0xb8ad('0x42')](_0x45510d[_0xb8ad('0x2c')]);_0x30aef6[_0xb8ad('0x2d')]=_[_0xb8ad('0x2e')](_0x30aef6[_0xb8ad('0x2b')],_0x30aef6[_0xb8ad('0x2c')]);_0x4be199['attributes']=_[_0xb8ad('0x2e')](_0x30aef6['model'],qs[_0xb8ad('0x30')](_0x45510d[_0xb8ad('0x2c')][_0xb8ad('0x30')]));_0x4be199[_0xb8ad('0x2f')]=_0x4be199['attributes'][_0xb8ad('0x4f')]?_0x4be199[_0xb8ad('0x2f')]:_0x30aef6[_0xb8ad('0x2b')];_0x4be199['order']=qs[_0xb8ad('0x34')](_0x45510d['query'][_0xb8ad('0x34')]);_0x4be199[_0xb8ad('0x35')]=qs[_0xb8ad('0x2d')](_['pick'](_0x45510d[_0xb8ad('0x2c')],_0x30aef6['filters']));if(_0x45510d[_0xb8ad('0x2c')][_0xb8ad('0x37')]){_0x4be199[_0xb8ad('0x35')]=_[_0xb8ad('0x38')](_0x4be199[_0xb8ad('0x35')],{'$or':_[_0xb8ad('0x27')](_0x4be199[_0xb8ad('0x2f')],function(_0x1de794){var _0x2e1376={};_0x2e1376[_0x1de794]={'$like':'%'+_0x45510d['query'][_0xb8ad('0x37')]+'%'};return _0x2e1376;})});}_0x4be199=_[_0xb8ad('0x38')]({},_0x4be199,_0x45510d['options']);return _0x3bef4a[_0xb8ad('0x81')](_0x4be199);}})[_0xb8ad('0x23')](function(_0x251890){if(_0x251890){_0x4210a7=_0x251890[_0xb8ad('0x4f')];if(!_0x45510d[_0xb8ad('0x2c')][_0xb8ad('0x31')](_0xb8ad('0x5c'))){_0x4be199[_0xb8ad('0x32')]=qs[_0xb8ad('0x32')](_0x45510d[_0xb8ad('0x2c')][_0xb8ad('0x32')]);_0x4be199[_0xb8ad('0x1f')]=qs['offset'](_0x45510d['query'][_0xb8ad('0x1f')]);}return _0x3bef4a['getBlackLists'](_0x4be199);}})[_0xb8ad('0x23')](function(_0x511e6f){if(_0x511e6f){return _0x511e6f?{'count':_0x4210a7,'rows':_0x511e6f}:null;}})[_0xb8ad('0x23')](respondWithResult(_0x2d5905,null))[_0xb8ad('0x3e')](handleError(_0x2d5905,null));};exports[_0xb8ad('0x82')]=function(_0x4fc834,_0xebab43,_0x373b70){var _0x2477dd,_0x473dbc;return db['Campaign']['find']({'where':{'id':_0x4fc834[_0xb8ad('0x40')]['id']}})[_0xb8ad('0x23')](handleEntityNotFound(_0xebab43,null))['then'](function(_0x453eeb){if(_0x453eeb){_0x473dbc=_0x453eeb;return _0x453eeb[_0xb8ad('0x82')](_0x4fc834[_0xb8ad('0x46')][_0xb8ad('0x64')],_['omit'](_0x4fc834['body'],[_0xb8ad('0x64'),'id'])||{});}return null;})[_0xb8ad('0x65')](function(_0x1d7b37){var _0x524574;_0x2477dd=_0x1d7b37||[];var _0x12e987=[];if(_0x1d7b37){for(var _0x5a95ce=0x0;_0x5a95ce<_0x1d7b37[_0xb8ad('0x4f')];_0x5a95ce+=0x1){var _0xa95d6c=_0x1d7b37[_0x5a95ce][_0xb8ad('0x48')]({'plain':!![]});_0x524574=squel[_0xb8ad('0x68')]()['into'](_0xb8ad('0x83'))['fromQuery'](['phone',_0xb8ad('0x6c'),_0xb8ad('0x6f'),_0xb8ad('0x59'),_0xb8ad('0x51'),_0xb8ad('0x52')],squel[_0xb8ad('0x75')]()[_0xb8ad('0x6d')](_0xb8ad('0x6a'),'phone')['field']('id',_0xb8ad('0x6c'))[_0xb8ad('0x6d')](_0xa95d6c['CmListId'][_0xb8ad('0x70')](),'ListId')[_0xb8ad('0x6d')](_0x4fc834[_0xb8ad('0x40')]['id'][_0xb8ad('0x70')](),_0xb8ad('0x59'))[_0xb8ad('0x6d')](_0xb8ad('0x71'),_0xb8ad('0x51'))['field']('NOW()',_0xb8ad('0x52'))[_0xb8ad('0x72')](_0xb8ad('0x73'))['where'](_0xb8ad('0x7d'))[_0xb8ad('0x35')]('ListId\x20=\x20?',_0xa95d6c[_0xb8ad('0x6e')][_0xb8ad('0x70')]())[_0xb8ad('0x35')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x12e987[_0xb8ad('0x7f')](db[_0xb8ad('0x84')][_0xb8ad('0x2c')](_0x524574));}return BPromise['all'](_0x12e987);}})[_0xb8ad('0x23')](function(){return _0x2477dd;})[_0xb8ad('0x23')](respondWithResult(_0xebab43,null))[_0xb8ad('0x3e')](handleError(_0xebab43,null));};exports['removeBlackLists']=function(_0x21bb4a,_0x279358,_0x541688){return db[_0xb8ad('0x28')][_0xb8ad('0x44')]({'where':{'id':_0x21bb4a[_0xb8ad('0x40')]['id']}})['then'](handleEntityNotFound(_0x279358,null))[_0xb8ad('0x23')](function(_0x4607bf){if(_0x4607bf){return _0x4607bf[_0xb8ad('0x85')](_0x21bb4a[_0xb8ad('0x2c')][_0xb8ad('0x64')]);}})[_0xb8ad('0x23')](function(_0x8dcf04){if(_0x8dcf04){return db[_0xb8ad('0x60')]['destroy']({'where':{'ListId':_0x21bb4a['query'][_0xb8ad('0x64')],'CampaignId':_0x21bb4a[_0xb8ad('0x40')]['id']}})[_0xb8ad('0x23')](function(){return _0x8dcf04;});}})['then'](respondWithStatusCode(_0x279358,null))[_0xb8ad('0x3e')](handleError(_0x279358,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 7c3ca89..6e75734 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 _0x12b1=['exports','define','util','api','moment','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x12b1,0x138));var _0x112b=function(_0x160ec9,_0x169902){_0x160ec9=_0x160ec9-0x0;var _0xf1fa69=_0x12b1[_0x160ec9];return _0xf1fa69;};'use strict';var _=require('lodash');var util=require(_0x112b('0x0'));var logger=require('../../config/logger')(_0x112b('0x1'));var moment=require(_0x112b('0x2'));var BPromise=require(_0x112b('0x3'));var rp=require(_0x112b('0x4'));var fs=require('fs');var path=require(_0x112b('0x5'));var rimraf=require(_0x112b('0x6'));var config=require('../../config/environment');var attributes=require(_0x112b('0x7'));module[_0x112b('0x8')]=function(_0x17c97e,_0x3163b7){return _0x17c97e[_0x112b('0x9')]('Campaign',attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x531b=['Campaign','lodash','util','../../config/logger','api','../../config/environment','./campaign.attributes','define'];(function(_0x8e90c8,_0x4f5a3b){var _0x435cbc=function(_0x5e8cc4){while(--_0x5e8cc4){_0x8e90c8['push'](_0x8e90c8['shift']());}};_0x435cbc(++_0x4f5a3b);}(_0x531b,0x159));var _0xb531=function(_0x41aa4d,_0x51e45f){_0x41aa4d=_0x41aa4d-0x0;var _0x3fb7d6=_0x531b[_0x41aa4d];return _0x3fb7d6;};'use strict';var _=require(_0xb531('0x0'));var util=require(_0xb531('0x1'));var logger=require(_0xb531('0x2'))(_0xb531('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(_0xb531('0x4'));var attributes=require(_0xb531('0x5'));module['exports']=function(_0x4378cd,_0xe1bb0a){return _0x4378cd[_0xb531('0x6')](_0xb531('0x7'),attributes,{'tableName':'campaigns','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 8fdf6b9..31db2e4 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 _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5d57fc,_0x49f7d6){var _0x2729c9=function(_0xb5463e){while(--_0xb5463e){_0x5d57fc['push'](_0x5d57fc['shift']());}};_0x2729c9(++_0x49f7d6);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file +var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x75102c,_0xf77042){var _0x12e536=function(_0x16fb9e){while(--_0x16fb9e){_0x75102c['push'](_0x75102c['shift']());}};_0x12e536(++_0xf77042);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 528da1b..bf12a19 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 _0x1b3d=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','/:id','destroy','removeLists','removeBlackLists','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x1b3d,0x139));var _0xd1b3=function(_0x3018cb,_0x5cece4){_0x3018cb=_0x3018cb-0x0;var _0x91249=_0x1b3d[_0x3018cb];return _0x91249;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd1b3('0x0'));var timeout=require(_0xd1b3('0x1'));var express=require(_0xd1b3('0x2'));var router=express[_0xd1b3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd1b3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd1b3('0x5'));var controller=require(_0xd1b3('0x6'));router[_0xd1b3('0x7')]('/',auth[_0xd1b3('0x8')](),controller[_0xd1b3('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd1b3('0xa')]);router['get']('/:id/hoppers',auth[_0xd1b3('0x8')](),controller[_0xd1b3('0xb')]);router[_0xd1b3('0x7')](_0xd1b3('0xc'),auth[_0xd1b3('0x8')](),controller[_0xd1b3('0xd')]);router['get'](_0xd1b3('0xe'),auth['isAuthenticated'](),controller[_0xd1b3('0xf')]);router['get'](_0xd1b3('0x10'),auth[_0xd1b3('0x8')](),controller[_0xd1b3('0x11')]);router[_0xd1b3('0x7')](_0xd1b3('0x12'),auth[_0xd1b3('0x8')](),controller[_0xd1b3('0x13')]);router[_0xd1b3('0x7')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xd1b3('0x14')]);router[_0xd1b3('0x15')]('/',auth[_0xd1b3('0x8')](),controller[_0xd1b3('0x16')]);router['post'](_0xd1b3('0x17'),auth[_0xd1b3('0x8')](),controller[_0xd1b3('0x18')]);router[_0xd1b3('0x15')]('/:id/lists',auth[_0xd1b3('0x8')](),controller[_0xd1b3('0x19')]);router[_0xd1b3('0x15')](_0xd1b3('0x1a'),auth[_0xd1b3('0x8')](),controller[_0xd1b3('0x1b')]);router[_0xd1b3('0x1c')]('/:id',auth[_0xd1b3('0x8')](),controller[_0xd1b3('0x1d')]);router[_0xd1b3('0x1e')](_0xd1b3('0x1f'),auth[_0xd1b3('0x8')](),controller[_0xd1b3('0x20')]);router[_0xd1b3('0x1e')]('/:id/lists',auth[_0xd1b3('0x8')](),controller[_0xd1b3('0x21')]);router[_0xd1b3('0x1e')](_0xd1b3('0x1a'),auth[_0xd1b3('0x8')](),controller[_0xd1b3('0x22')]);module[_0xd1b3('0x23')]=router; \ No newline at end of file +var _0xc5ef=['isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','addBlackLists','update','delete','destroy','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc5ef,0x133));var _0xfc5e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xc5ef[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0xfc5e('0x0'));var util=require(_0xfc5e('0x1'));var path=require(_0xfc5e('0x2'));var timeout=require(_0xfc5e('0x3'));var express=require(_0xfc5e('0x4'));var router=express[_0xfc5e('0x5')]();var fs_extra=require(_0xfc5e('0x6'));var auth=require(_0xfc5e('0x7'));var interaction=require(_0xfc5e('0x8'));var config=require(_0xfc5e('0x9'));var controller=require(_0xfc5e('0xa'));router[_0xfc5e('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xfc5e('0xc'),auth[_0xfc5e('0xd')](),controller[_0xfc5e('0xe')]);router[_0xfc5e('0xb')](_0xfc5e('0xf'),auth[_0xfc5e('0xd')](),controller[_0xfc5e('0x10')]);router[_0xfc5e('0xb')](_0xfc5e('0x11'),auth[_0xfc5e('0xd')](),controller[_0xfc5e('0x12')]);router['get'](_0xfc5e('0x13'),auth[_0xfc5e('0xd')](),controller[_0xfc5e('0x14')]);router[_0xfc5e('0xb')]('/:id/hopper_black',auth[_0xfc5e('0xd')](),controller['getHopperBlacks']);router[_0xfc5e('0xb')](_0xfc5e('0x15'),auth[_0xfc5e('0xd')](),controller[_0xfc5e('0x16')]);router[_0xfc5e('0xb')]('/:id/blacklists',auth[_0xfc5e('0xd')](),controller[_0xfc5e('0x17')]);router[_0xfc5e('0x18')]('/',auth[_0xfc5e('0xd')](),controller['create']);router['post'](_0xfc5e('0x19'),auth['isAuthenticated'](),controller[_0xfc5e('0x1a')]);router[_0xfc5e('0x18')]('/:id/lists',auth[_0xfc5e('0xd')](),controller['addLists']);router[_0xfc5e('0x18')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xfc5e('0x1b')]);router['put'](_0xfc5e('0xc'),auth[_0xfc5e('0xd')](),controller[_0xfc5e('0x1c')]);router[_0xfc5e('0x1d')](_0xfc5e('0xc'),auth[_0xfc5e('0xd')](),controller[_0xfc5e('0x1e')]);router[_0xfc5e('0x1d')]('/:id/lists',auth[_0xfc5e('0xd')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0xfc5e('0xd')](),controller[_0xfc5e('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index c90efcf..8359d42 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 _0x476f=['exports','STRING','getDataValue','sequelize'];(function(_0x292f7f,_0x4231da){var _0x45e0e5=function(_0x11c264){while(--_0x11c264){_0x292f7f['push'](_0x292f7f['shift']());}};_0x45e0e5(++_0x4231da);}(_0x476f,0x1b7));var _0xf476=function(_0x28d63a,_0x18c61a){_0x28d63a=_0x28d63a-0x0;var _0x5401cb=_0x476f[_0x28d63a];return _0x5401cb;};'use strict';var Sequelize=require(_0xf476('0x0'));module[_0xf476('0x1')]={'key':{'type':Sequelize[_0xf476('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xf476('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf476('0x3')]('key');}}}; \ No newline at end of file +var _0xdf9a=['getDataValue','key','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf9a,0xda));var _0xadf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf9a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xadf9('0x0'));module['exports']={'key':{'type':Sequelize[_0xadf9('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xadf9('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xadf9('0x2')](_0xadf9('0x3'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 342e2dd..b2fb840 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 _0x4ad3=['fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','update','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ad3,0x1b1));var _0x34ad=function(_0xa25862,_0x27f1a4){_0xa25862=_0xa25862-0x0;var _0x5b9b0a=_0x4ad3[_0xa25862];return _0x5b9b0a;};'use strict';var emlformat=require(_0x34ad('0x0'));var rimraf=require(_0x34ad('0x1'));var zipdir=require(_0x34ad('0x2'));var jsonpatch=require(_0x34ad('0x3'));var rp=require(_0x34ad('0x4'));var moment=require(_0x34ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x34ad('0x6'));var util=require(_0x34ad('0x7'));var path=require(_0x34ad('0x8'));var sox=require(_0x34ad('0x9'));var csv=require(_0x34ad('0xa'));var ejs=require(_0x34ad('0xb'));var fs=require('fs');var fs_extra=require(_0x34ad('0xc'));var _=require(_0x34ad('0xd'));var squel=require(_0x34ad('0xe'));var crypto=require(_0x34ad('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x34ad('0xa'));var querystring=require(_0x34ad('0x10'));var Papa=require(_0x34ad('0x11'));var Redis=require(_0x34ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x34ad('0x13'));var as=require(_0x34ad('0x14'));var hardwareService=require(_0x34ad('0x15'));var logger=require(_0x34ad('0x16'))(_0x34ad('0x17'));var utils=require(_0x34ad('0x18'));var config=require(_0x34ad('0x19'));var licenseUtil=require(_0x34ad('0x1a'));var db=require(_0x34ad('0x1b'))['db'];function respondWithStatusCode(_0x377c90,_0x14c9fd){_0x14c9fd=_0x14c9fd||0xcc;return function(_0x1be906){if(_0x1be906){return _0x377c90[_0x34ad('0x1c')](_0x14c9fd);}return _0x377c90[_0x34ad('0x1d')](_0x14c9fd)[_0x34ad('0x1e')]();};}function respondWithResult(_0xc64e62,_0x558097){_0x558097=_0x558097||0xc8;return function(_0x4764e9){if(_0x4764e9){return _0xc64e62[_0x34ad('0x1d')](_0x558097)[_0x34ad('0x1f')](_0x4764e9);}};}function respondWithFilteredResult(_0x5e2a1d,_0x21a78c){return function(_0x262123){if(_0x262123){var _0x38a15e=_0x262123[_0x34ad('0x20')],_0x36c8d3=_0x21a78c['offset'],_0x1a2d10=_0x21a78c[_0x34ad('0x21')]+_0x21a78c[_0x34ad('0x22')],_0x48e90a;if(_0x1a2d10>=_0x38a15e){_0x1a2d10=_0x38a15e;_0x48e90a=0xc8;}else{_0x48e90a=0xce;}_0x5e2a1d[_0x34ad('0x1d')](_0x48e90a);return _0x5e2a1d[_0x34ad('0x23')](_0x34ad('0x24'),_0x36c8d3+'-'+_0x1a2d10+'/'+_0x38a15e)['json'](_0x262123);}return null;};}function patchUpdates(_0x33aa7c){return function(_0x3a2cd5){try{jsonpatch[_0x34ad('0x25')](_0x3a2cd5,_0x33aa7c,!![]);}catch(_0x15bf30){return BPromise[_0x34ad('0x26')](_0x15bf30);}return _0x3a2cd5[_0x34ad('0x27')]();};}function saveUpdates(_0x3c178a,_0x45557e){return function(_0x1ef997){if(_0x1ef997){return _0x1ef997['update'](_0x3c178a)[_0x34ad('0x28')](function(_0x51c394){return _0x51c394;});}return null;};}function removeEntity(_0x1c2d49,_0x493f73){return function(_0x154ee8){if(_0x154ee8){return _0x154ee8[_0x34ad('0x29')]()[_0x34ad('0x28')](function(){var _0x1c2fa5=_0x154ee8[_0x34ad('0x2a')]({'plain':!![]});var _0x4a06a7='CannedAnswers';return db[_0x34ad('0x2b')]['destroy']({'where':{'type':_0x4a06a7,'resourceId':_0x1c2fa5['id']}})[_0x34ad('0x28')](function(){return _0x154ee8;});})['then'](function(){_0x1c2d49['status'](0xcc)[_0x34ad('0x1e')]();});}};}function handleEntityNotFound(_0x3df4ca,_0x249380){return function(_0x3cb657){if(!_0x3cb657){_0x3df4ca[_0x34ad('0x1c')](0x194);}return _0x3cb657;};}function handleError(_0x320b6a,_0x158aa7){_0x158aa7=_0x158aa7||0x1f4;return function(_0x3b7ac5){logger[_0x34ad('0x2c')](_0x3b7ac5[_0x34ad('0x2d')]);if(_0x3b7ac5['name']){delete _0x3b7ac5[_0x34ad('0x2e')];}_0x320b6a[_0x34ad('0x1d')](_0x158aa7)[_0x34ad('0x2f')](_0x3b7ac5);};}exports[_0x34ad('0x30')]=function(_0x2bcdc3,_0x1b2387){var _0x2daf92={},_0x353b64={},_0x1c2f89={'count':0x0,'rows':[]};var _0x27d9fe=_[_0x34ad('0x31')](db[_0x34ad('0x32')][_0x34ad('0x33')],function(_0xf0f8b7){return{'name':_0xf0f8b7[_0x34ad('0x34')],'type':_0xf0f8b7[_0x34ad('0x35')]['key']};});_0x353b64[_0x34ad('0x36')]=_['map'](_0x27d9fe,_0x34ad('0x2e'));_0x353b64[_0x34ad('0x37')]=_[_0x34ad('0x38')](_0x2bcdc3[_0x34ad('0x37')]);_0x353b64['filters']=_[_0x34ad('0x39')](_0x353b64[_0x34ad('0x36')],_0x353b64[_0x34ad('0x37')]);_0x2daf92[_0x34ad('0x3a')]=_['intersection'](_0x353b64['model'],qs['fields'](_0x2bcdc3[_0x34ad('0x37')][_0x34ad('0x3b')]));_0x2daf92[_0x34ad('0x3a')]=_0x2daf92[_0x34ad('0x3a')][_0x34ad('0x3c')]?_0x2daf92['attributes']:_0x353b64[_0x34ad('0x36')];if(!_0x2bcdc3[_0x34ad('0x37')][_0x34ad('0x3d')](_0x34ad('0x3e'))){_0x2daf92[_0x34ad('0x22')]=qs[_0x34ad('0x22')](_0x2bcdc3[_0x34ad('0x37')][_0x34ad('0x22')]);_0x2daf92[_0x34ad('0x21')]=qs[_0x34ad('0x21')](_0x2bcdc3[_0x34ad('0x37')][_0x34ad('0x21')]);}_0x2daf92[_0x34ad('0x3f')]=qs[_0x34ad('0x40')](_0x2bcdc3[_0x34ad('0x37')][_0x34ad('0x40')]);_0x2daf92[_0x34ad('0x41')]=qs[_0x34ad('0x42')](_[_0x34ad('0x43')](_0x2bcdc3[_0x34ad('0x37')],_0x353b64['filters']),_0x27d9fe);if(_0x2bcdc3['query'][_0x34ad('0x44')]){_0x2daf92[_0x34ad('0x41')]=_[_0x34ad('0x45')](_0x2daf92[_0x34ad('0x41')],{'$or':_[_0x34ad('0x31')](_0x27d9fe,function(_0x157c8b){if(_0x157c8b[_0x34ad('0x35')]!==_0x34ad('0x46')){var _0x2babd2={};_0x2babd2[_0x157c8b[_0x34ad('0x2e')]]={'$like':'%'+_0x2bcdc3['query'][_0x34ad('0x44')]+'%'};return _0x2babd2;}})});}_0x2daf92=_[_0x34ad('0x45')]({},_0x2daf92,_0x2bcdc3[_0x34ad('0x47')]);var _0xa4605b={'where':_0x2daf92[_0x34ad('0x41')]};return db[_0x34ad('0x32')][_0x34ad('0x20')](_0xa4605b)[_0x34ad('0x28')](function(_0x32427b){_0x1c2f89['count']=_0x32427b;if(_0x2bcdc3[_0x34ad('0x37')]['includeAll']){_0x2daf92[_0x34ad('0x48')]=[{'all':!![]}];}return db[_0x34ad('0x32')][_0x34ad('0x49')](_0x2daf92);})[_0x34ad('0x28')](function(_0x14cadc){_0x1c2f89[_0x34ad('0x4a')]=_0x14cadc;return _0x1c2f89;})['then'](respondWithFilteredResult(_0x1b2387,_0x2daf92))[_0x34ad('0x4b')](handleError(_0x1b2387,null));};exports['show']=function(_0x32dc03,_0x49a890){var _0x5c55ad={'raw':!![],'where':{'id':_0x32dc03[_0x34ad('0x4c')]['id']}},_0x44b971={};_0x44b971[_0x34ad('0x36')]=_['keys'](db[_0x34ad('0x32')][_0x34ad('0x33')]);_0x44b971[_0x34ad('0x37')]=_['keys'](_0x32dc03['query']);_0x44b971[_0x34ad('0x42')]=_[_0x34ad('0x39')](_0x44b971['model'],_0x44b971[_0x34ad('0x37')]);_0x5c55ad[_0x34ad('0x3a')]=_[_0x34ad('0x39')](_0x44b971['model'],qs[_0x34ad('0x3b')](_0x32dc03[_0x34ad('0x37')][_0x34ad('0x3b')]));_0x5c55ad[_0x34ad('0x3a')]=_0x5c55ad[_0x34ad('0x3a')][_0x34ad('0x3c')]?_0x5c55ad[_0x34ad('0x3a')]:_0x44b971['model'];if(_0x32dc03[_0x34ad('0x37')][_0x34ad('0x4d')]){_0x5c55ad['include']=[{'all':!![]}];}_0x5c55ad=_[_0x34ad('0x45')]({},_0x5c55ad,_0x32dc03[_0x34ad('0x47')]);return db[_0x34ad('0x32')][_0x34ad('0x4e')](_0x5c55ad)[_0x34ad('0x28')](handleEntityNotFound(_0x49a890,null))['then'](respondWithResult(_0x49a890,null))['catch'](handleError(_0x49a890,null));};exports[_0x34ad('0x4f')]=function(_0x402cb6,_0x52c60f){if(_0x402cb6['body']['id']){delete _0x402cb6[_0x34ad('0x50')]['id'];}return db['CannedAnswer'][_0x34ad('0x4e')]({'where':{'id':_0x402cb6[_0x34ad('0x4c')]['id']}})[_0x34ad('0x28')](handleEntityNotFound(_0x52c60f,null))['then'](saveUpdates(_0x402cb6[_0x34ad('0x50')],null))[_0x34ad('0x28')](respondWithResult(_0x52c60f,null))['catch'](handleError(_0x52c60f,null));};exports['destroy']=function(_0x48be05,_0x4ee0b4){return db[_0x34ad('0x32')][_0x34ad('0x4e')]({'where':{'id':_0x48be05[_0x34ad('0x4c')]['id']}})[_0x34ad('0x28')](handleEntityNotFound(_0x4ee0b4,null))['then'](removeEntity(_0x4ee0b4,null))[_0x34ad('0x4b')](handleError(_0x4ee0b4,null));};exports[_0x34ad('0x51')]=function(_0x54b41d,_0x53cc3d){var _0x293adf={'key':_0x54b41d[_0x34ad('0x50')][_0x34ad('0x52')]};if(_0x54b41d[_0x34ad('0x50')][_0x34ad('0x53')]){_0x293adf[_0x34ad('0x53')]=_0x54b41d['body'][_0x34ad('0x53')];}else if(_0x54b41d[_0x34ad('0x50')]['SmsAccountId']){_0x293adf[_0x34ad('0x54')]=_0x54b41d['body']['SmsAccountId'];}else if(_0x54b41d[_0x34ad('0x50')][_0x34ad('0x55')]){_0x293adf[_0x34ad('0x55')]=_0x54b41d['body'][_0x34ad('0x55')];}else if(_0x54b41d['body'][_0x34ad('0x56')]){_0x293adf[_0x34ad('0x56')]=_0x54b41d[_0x34ad('0x50')]['ChatWebsiteId'];}return db[_0x34ad('0x32')][_0x34ad('0x4e')]({'where':_0x293adf})[_0x34ad('0x28')](function(_0x2f6d7f){if(_0x2f6d7f){throw new db[(_0x34ad('0x57'))][(_0x34ad('0x58'))](_0x34ad('0x59'));}return db[_0x34ad('0x32')][_0x34ad('0x51')](_0x54b41d['body']);})[_0x34ad('0x28')](function(_0x3b5143){var _0x1ed241=_0x54b41d[_0x34ad('0x5a')][_0x34ad('0x2a')]({'plain':!![]});if(!_0x1ed241)throw new Error(_0x34ad('0x5b'));if(_0x1ed241[_0x34ad('0x5c')]===_0x34ad('0x5a')){var _0x2dd5c5=_0x3b5143[_0x34ad('0x2a')]({'plain':!![]});return db[_0x34ad('0x5d')][_0x34ad('0x4e')]({'where':{'name':'CannedAnswers','userProfileId':_0x1ed241[_0x34ad('0x5e')]},'raw':!![]})[_0x34ad('0x28')](function(_0x3727f5){if(_0x3727f5&&_0x3727f5[_0x34ad('0x5f')]===0x0){return db[_0x34ad('0x2b')]['create']({'name':_0x2dd5c5[_0x34ad('0x2e')],'resourceId':_0x2dd5c5['id'],'type':_0x3727f5['name'],'sectionId':_0x3727f5['id']},{})[_0x34ad('0x28')](function(){return _0x3b5143;});}else{return _0x3b5143;}})[_0x34ad('0x4b')](function(_0x5eeead){logger[_0x34ad('0x2c')](_0x34ad('0x60'),_0x5eeead);throw _0x5eeead;});}return _0x3b5143;})[_0x34ad('0x28')](respondWithResult(_0x53cc3d,0xc9))[_0x34ad('0x4b')](handleError(_0x53cc3d,null));}; \ No newline at end of file +var _0x594d=['update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','type','merge','includeAll','include','findAll','rows','catch','show','options','body','params','find','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','count','limit','status','Content-Range','apply','reject'];(function(_0x1c126b,_0x52a787){var _0x415aed=function(_0x2fbffc){while(--_0x2fbffc){_0x1c126b['push'](_0x1c126b['shift']());}};_0x415aed(++_0x52a787);}(_0x594d,0x92));var _0xd594=function(_0xcb1fb1,_0x182dae){_0xcb1fb1=_0xcb1fb1-0x0;var _0x2e1d23=_0x594d[_0xcb1fb1];return _0x2e1d23;};'use strict';var emlformat=require(_0xd594('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd594('0x1'));var rp=require(_0xd594('0x2'));var moment=require(_0xd594('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd594('0x4'));var util=require(_0xd594('0x5'));var path=require(_0xd594('0x6'));var sox=require(_0xd594('0x7'));var csv=require('to-csv');var ejs=require(_0xd594('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd594('0x9'));var squel=require(_0xd594('0xa'));var crypto=require(_0xd594('0xb'));var jsforce=require(_0xd594('0xc'));var deskjs=require(_0xd594('0xd'));var toCsv=require(_0xd594('0xe'));var querystring=require(_0xd594('0xf'));var Papa=require(_0xd594('0x10'));var Redis=require(_0xd594('0x11'));var authService=require(_0xd594('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd594('0x13'));var hardwareService=require(_0xd594('0x14'));var logger=require(_0xd594('0x15'))('api');var utils=require(_0xd594('0x16'));var config=require(_0xd594('0x17'));var licenseUtil=require(_0xd594('0x18'));var db=require(_0xd594('0x19'))['db'];function respondWithStatusCode(_0x4593eb,_0x12af74){_0x12af74=_0x12af74||0xcc;return function(_0x1aa88a){if(_0x1aa88a){return _0x4593eb['sendStatus'](_0x12af74);}return _0x4593eb['status'](_0x12af74)[_0xd594('0x1a')]();};}function respondWithResult(_0x164a52,_0x5ced58){_0x5ced58=_0x5ced58||0xc8;return function(_0x8da9ac){if(_0x8da9ac){return _0x164a52['status'](_0x5ced58)[_0xd594('0x1b')](_0x8da9ac);}};}function respondWithFilteredResult(_0x21673c,_0x14ea68){return function(_0x4cb9ec){if(_0x4cb9ec){var _0x120fcf=_0x4cb9ec[_0xd594('0x1c')],_0x4c05ae=_0x14ea68['offset'],_0x5731c2=_0x14ea68['offset']+_0x14ea68[_0xd594('0x1d')],_0x2a5f17;if(_0x5731c2>=_0x120fcf){_0x5731c2=_0x120fcf;_0x2a5f17=0xc8;}else{_0x2a5f17=0xce;}_0x21673c[_0xd594('0x1e')](_0x2a5f17);return _0x21673c['set'](_0xd594('0x1f'),_0x4c05ae+'-'+_0x5731c2+'/'+_0x120fcf)['json'](_0x4cb9ec);}return null;};}function patchUpdates(_0x3977bd){return function(_0x497d53){try{jsonpatch[_0xd594('0x20')](_0x497d53,_0x3977bd,!![]);}catch(_0x4fa2c7){return BPromise[_0xd594('0x21')](_0x4fa2c7);}return _0x497d53['save']();};}function saveUpdates(_0x3b0fda,_0x55f83b){return function(_0x2cd721){if(_0x2cd721){return _0x2cd721[_0xd594('0x22')](_0x3b0fda)[_0xd594('0x23')](function(_0x2e2243){return _0x2e2243;});}return null;};}function removeEntity(_0x1f8c09,_0x2b8495){return function(_0x243234){if(_0x243234){return _0x243234[_0xd594('0x24')]()[_0xd594('0x23')](function(){var _0xf73000=_0x243234[_0xd594('0x25')]({'plain':!![]});var _0x3d83ce=_0xd594('0x26');return db[_0xd594('0x27')][_0xd594('0x24')]({'where':{'type':_0x3d83ce,'resourceId':_0xf73000['id']}})['then'](function(){return _0x243234;});})[_0xd594('0x23')](function(){_0x1f8c09[_0xd594('0x1e')](0xcc)[_0xd594('0x1a')]();});}};}function handleEntityNotFound(_0x210e7b,_0x1c36fd){return function(_0x40f87e){if(!_0x40f87e){_0x210e7b[_0xd594('0x28')](0x194);}return _0x40f87e;};}function handleError(_0x3b9844,_0x308d8a){_0x308d8a=_0x308d8a||0x1f4;return function(_0x578f6b){logger[_0xd594('0x29')](_0x578f6b[_0xd594('0x2a')]);if(_0x578f6b[_0xd594('0x2b')]){delete _0x578f6b[_0xd594('0x2b')];}_0x3b9844[_0xd594('0x1e')](_0x308d8a)[_0xd594('0x2c')](_0x578f6b);};}exports[_0xd594('0x2d')]=function(_0x212db4,_0x26d55b){var _0x199836={},_0x55f454={},_0x371c10={'count':0x0,'rows':[]};var _0x1e3e53=_[_0xd594('0x2e')](db[_0xd594('0x2f')][_0xd594('0x30')],function(_0x1aa827){return{'name':_0x1aa827['fieldName'],'type':_0x1aa827['type']['key']};});_0x55f454[_0xd594('0x31')]=_[_0xd594('0x2e')](_0x1e3e53,'name');_0x55f454['query']=_[_0xd594('0x32')](_0x212db4['query']);_0x55f454['filters']=_[_0xd594('0x33')](_0x55f454[_0xd594('0x31')],_0x55f454[_0xd594('0x34')]);_0x199836[_0xd594('0x35')]=_[_0xd594('0x33')](_0x55f454[_0xd594('0x31')],qs['fields'](_0x212db4[_0xd594('0x34')][_0xd594('0x36')]));_0x199836['attributes']=_0x199836[_0xd594('0x35')][_0xd594('0x37')]?_0x199836[_0xd594('0x35')]:_0x55f454[_0xd594('0x31')];if(!_0x212db4[_0xd594('0x34')][_0xd594('0x38')](_0xd594('0x39'))){_0x199836[_0xd594('0x1d')]=qs[_0xd594('0x1d')](_0x212db4[_0xd594('0x34')][_0xd594('0x1d')]);_0x199836[_0xd594('0x3a')]=qs[_0xd594('0x3a')](_0x212db4[_0xd594('0x34')][_0xd594('0x3a')]);}_0x199836[_0xd594('0x3b')]=qs[_0xd594('0x3c')](_0x212db4[_0xd594('0x34')]['sort']);_0x199836[_0xd594('0x3d')]=qs[_0xd594('0x3e')](_['pick'](_0x212db4[_0xd594('0x34')],_0x55f454[_0xd594('0x3e')]),_0x1e3e53);if(_0x212db4[_0xd594('0x34')][_0xd594('0x3f')]){_0x199836[_0xd594('0x3d')]=_['merge'](_0x199836[_0xd594('0x3d')],{'$or':_[_0xd594('0x2e')](_0x1e3e53,function(_0x3fa7b2){if(_0x3fa7b2[_0xd594('0x40')]!=='VIRTUAL'){var _0x41d41b={};_0x41d41b[_0x3fa7b2[_0xd594('0x2b')]]={'$like':'%'+_0x212db4['query'][_0xd594('0x3f')]+'%'};return _0x41d41b;}})});}_0x199836=_[_0xd594('0x41')]({},_0x199836,_0x212db4['options']);var _0x4d169a={'where':_0x199836[_0xd594('0x3d')]};return db[_0xd594('0x2f')][_0xd594('0x1c')](_0x4d169a)[_0xd594('0x23')](function(_0x371137){_0x371c10[_0xd594('0x1c')]=_0x371137;if(_0x212db4['query'][_0xd594('0x42')]){_0x199836[_0xd594('0x43')]=[{'all':!![]}];}return db[_0xd594('0x2f')][_0xd594('0x44')](_0x199836);})['then'](function(_0x704375){_0x371c10[_0xd594('0x45')]=_0x704375;return _0x371c10;})[_0xd594('0x23')](respondWithFilteredResult(_0x26d55b,_0x199836))[_0xd594('0x46')](handleError(_0x26d55b,null));};exports[_0xd594('0x47')]=function(_0x5cc2c6,_0x1d0fe3){var _0xe37e57={'raw':!![],'where':{'id':_0x5cc2c6['params']['id']}},_0x5b784d={};_0x5b784d['model']=_[_0xd594('0x32')](db[_0xd594('0x2f')][_0xd594('0x30')]);_0x5b784d[_0xd594('0x34')]=_['keys'](_0x5cc2c6[_0xd594('0x34')]);_0x5b784d[_0xd594('0x3e')]=_[_0xd594('0x33')](_0x5b784d[_0xd594('0x31')],_0x5b784d[_0xd594('0x34')]);_0xe37e57['attributes']=_[_0xd594('0x33')](_0x5b784d[_0xd594('0x31')],qs['fields'](_0x5cc2c6[_0xd594('0x34')][_0xd594('0x36')]));_0xe37e57[_0xd594('0x35')]=_0xe37e57[_0xd594('0x35')]['length']?_0xe37e57[_0xd594('0x35')]:_0x5b784d[_0xd594('0x31')];if(_0x5cc2c6[_0xd594('0x34')][_0xd594('0x42')]){_0xe37e57[_0xd594('0x43')]=[{'all':!![]}];}_0xe37e57=_[_0xd594('0x41')]({},_0xe37e57,_0x5cc2c6[_0xd594('0x48')]);return db[_0xd594('0x2f')]['find'](_0xe37e57)[_0xd594('0x23')](handleEntityNotFound(_0x1d0fe3,null))[_0xd594('0x23')](respondWithResult(_0x1d0fe3,null))[_0xd594('0x46')](handleError(_0x1d0fe3,null));};exports[_0xd594('0x22')]=function(_0x2b58cd,_0x564522){if(_0x2b58cd[_0xd594('0x49')]['id']){delete _0x2b58cd[_0xd594('0x49')]['id'];}return db[_0xd594('0x2f')]['find']({'where':{'id':_0x2b58cd[_0xd594('0x4a')]['id']}})[_0xd594('0x23')](handleEntityNotFound(_0x564522,null))[_0xd594('0x23')](saveUpdates(_0x2b58cd[_0xd594('0x49')],null))[_0xd594('0x23')](respondWithResult(_0x564522,null))[_0xd594('0x46')](handleError(_0x564522,null));};exports[_0xd594('0x24')]=function(_0x5ce598,_0x350979){return db['CannedAnswer'][_0xd594('0x4b')]({'where':{'id':_0x5ce598[_0xd594('0x4a')]['id']}})['then'](handleEntityNotFound(_0x350979,null))[_0xd594('0x23')](removeEntity(_0x350979,null))[_0xd594('0x46')](handleError(_0x350979,null));};exports[_0xd594('0x4c')]=function(_0x155584,_0x2caab1){var _0x6636f8={'key':_0x155584['body'][_0xd594('0x4d')]};if(_0x155584[_0xd594('0x49')]['MailAccountId']){_0x6636f8[_0xd594('0x4e')]=_0x155584['body'][_0xd594('0x4e')];}else if(_0x155584[_0xd594('0x49')]['SmsAccountId']){_0x6636f8[_0xd594('0x4f')]=_0x155584['body'][_0xd594('0x4f')];}else if(_0x155584[_0xd594('0x49')][_0xd594('0x50')]){_0x6636f8['OpenchannelAccountId']=_0x155584['body'][_0xd594('0x50')];}else if(_0x155584[_0xd594('0x49')]['ChatWebsiteId']){_0x6636f8[_0xd594('0x51')]=_0x155584[_0xd594('0x49')][_0xd594('0x51')];}return db[_0xd594('0x2f')][_0xd594('0x4b')]({'where':_0x6636f8})[_0xd594('0x23')](function(_0x490f03){if(_0x490f03){throw new db[(_0xd594('0x52'))][(_0xd594('0x53'))](_0xd594('0x54'));}return db[_0xd594('0x2f')][_0xd594('0x4c')](_0x155584[_0xd594('0x49')]);})['then'](function(_0x25cb9b){var _0x5643ea=_0x155584['user'][_0xd594('0x25')]({'plain':!![]});if(!_0x5643ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5643ea['role']===_0xd594('0x55')){var _0x20eb2a=_0x25cb9b[_0xd594('0x25')]({'plain':!![]});return db[_0xd594('0x56')][_0xd594('0x4b')]({'where':{'name':_0xd594('0x26'),'userProfileId':_0x5643ea[_0xd594('0x57')]},'raw':!![]})[_0xd594('0x23')](function(_0x15ae18){if(_0x15ae18&&_0x15ae18[_0xd594('0x58')]===0x0){return db[_0xd594('0x27')]['create']({'name':_0x20eb2a['name'],'resourceId':_0x20eb2a['id'],'type':_0x15ae18['name'],'sectionId':_0x15ae18['id']},{})['then'](function(){return _0x25cb9b;});}else{return _0x25cb9b;}})[_0xd594('0x46')](function(_0x353af8){logger[_0xd594('0x29')](_0xd594('0x59'),_0x353af8);throw _0x353af8;});}return _0x25cb9b;})[_0xd594('0x23')](respondWithResult(_0x2caab1,0xc9))[_0xd594('0x46')](handleError(_0x2caab1,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 3146f5d..847c98d 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 _0x46d1=['request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x46d1,0xbe));var _0x146d=function(_0x4234ed,_0x260715){_0x4234ed=_0x4234ed-0x0;var _0x3e7d0c=_0x46d1[_0x4234ed];return _0x3e7d0c;};'use strict';var _=require(_0x146d('0x0'));var util=require(_0x146d('0x1'));var logger=require(_0x146d('0x2'))(_0x146d('0x3'));var moment=require(_0x146d('0x4'));var BPromise=require(_0x146d('0x5'));var rp=require(_0x146d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x146d('0x7'));var config=require(_0x146d('0x8'));var attributes=require(_0x146d('0x9'));module['exports']=function(_0x3a122d,_0x5aa0d8){return _0x3a122d[_0x146d('0xa')](_0x146d('0xb'),attributes,{'tableName':_0x146d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x146d('0xd')});}; \ No newline at end of file +var _0xe630=['define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x13bfba,_0x51c2ce){var _0x32f31f=function(_0x4ecab0){while(--_0x4ecab0){_0x13bfba['push'](_0x13bfba['shift']());}};_0x32f31f(++_0x51c2ce);}(_0xe630,0x149));var _0x0e63=function(_0x9ca21f,_0x437553){_0x9ca21f=_0x9ca21f-0x0;var _0x9ef54b=_0xe630[_0x9ca21f];return _0x9ef54b;};'use strict';var _=require(_0x0e63('0x0'));var util=require(_0x0e63('0x1'));var logger=require('../../config/logger')(_0x0e63('0x2'));var moment=require(_0x0e63('0x3'));var BPromise=require(_0x0e63('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e63('0x5'));var rimraf=require(_0x0e63('0x6'));var config=require(_0x0e63('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x0e63('0x8')]=function(_0x308039,_0x356abb){return _0x308039[_0x0e63('0x9')](_0x0e63('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0e63('0xb'),'collate':_0x0e63('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 553da1c..daeb87c 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 _0x4c55=['request','then','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','error','code','CannedAnswer,\x20%s,\x20%s','message','info','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x37df8c,_0x293f40){var _0x9beae1=function(_0x9a96a9){while(--_0x9a96a9){_0x37df8c['push'](_0x37df8c['shift']());}};_0x9beae1(++_0x293f40);}(_0x4c55,0x15b));var _0x54c5=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x4c55[_0x50e40b];return _0x2608b7;};'use strict';var _=require(_0x54c5('0x0'));var util=require('util');var moment=require(_0x54c5('0x1'));var BPromise=require('bluebird');var rs=require(_0x54c5('0x2'));var fs=require('fs');var Redis=require(_0x54c5('0x3'));var db=require(_0x54c5('0x4'))['db'];var utils=require(_0x54c5('0x5'));var logger=require('../../config/logger')(_0x54c5('0x6'));var config=require(_0x54c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x54c5('0x8')][_0x54c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56d23b,_0x2f26f5,_0x4d21cf){return new BPromise(function(_0x8c139d,_0x5e9b6f){return client[_0x54c5('0xa')](_0x56d23b,_0x4d21cf)[_0x54c5('0xb')](function(_0x583b2d){logger['info']('CannedAnswer,\x20%s,\x20%s',_0x2f26f5,_0x54c5('0xc'));logger[_0x54c5('0xd')](_0x54c5('0xe'),_0x2f26f5,_0x54c5('0xc'),JSON['stringify'](_0x583b2d));if(_0x583b2d['error']){if(_0x583b2d[_0x54c5('0xf')][_0x54c5('0x10')]===0x1f4){logger[_0x54c5('0xf')](_0x54c5('0x11'),_0x2f26f5,_0x583b2d['error'][_0x54c5('0x12')]);return _0x5e9b6f(_0x583b2d[_0x54c5('0xf')][_0x54c5('0x12')]);}logger[_0x54c5('0xf')](_0x54c5('0x11'),_0x2f26f5,_0x583b2d[_0x54c5('0xf')]['message']);return _0x8c139d(_0x583b2d[_0x54c5('0xf')][_0x54c5('0x12')]);}else{logger[_0x54c5('0x13')](_0x54c5('0x11'),_0x2f26f5,'request\x20sent');_0x8c139d(_0x583b2d[_0x54c5('0x14')]['message']);}})['catch'](function(_0x35c32f){logger['error'](_0x54c5('0x11'),_0x2f26f5,_0x35c32f);_0x5e9b6f(_0x35c32f);});});} \ No newline at end of file +var _0x15aa=['code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x30c18f,_0xdc5cfb){var _0x342b1f=function(_0x2c7569){while(--_0x2c7569){_0x30c18f['push'](_0x30c18f['shift']());}};_0x342b1f(++_0xdc5cfb);}(_0x15aa,0xcb));var _0xa15a=function(_0xfd6f5,_0x25c8f8){_0xfd6f5=_0xfd6f5-0x0;var _0x36d448=_0x15aa[_0xfd6f5];return _0x36d448;};'use strict';var _=require(_0xa15a('0x0'));var util=require('util');var moment=require(_0xa15a('0x1'));var BPromise=require(_0xa15a('0x2'));var rs=require(_0xa15a('0x3'));var fs=require('fs');var Redis=require(_0xa15a('0x4'));var db=require(_0xa15a('0x5'))['db'];var utils=require(_0xa15a('0x6'));var logger=require(_0xa15a('0x7'))(_0xa15a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa15a('0x9')][_0xa15a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d6465,_0x240a33,_0x464da4){return new BPromise(function(_0x36c9ca,_0x32648c){return client['request'](_0x2d6465,_0x464da4)[_0xa15a('0xb')](function(_0x5202b0){logger['info'](_0xa15a('0xc'),_0x240a33,_0xa15a('0xd'));logger[_0xa15a('0xe')](_0xa15a('0xf'),_0x240a33,'request\x20sent',JSON[_0xa15a('0x10')](_0x5202b0));if(_0x5202b0['error']){if(_0x5202b0['error'][_0xa15a('0x11')]===0x1f4){logger['error'](_0xa15a('0xc'),_0x240a33,_0x5202b0[_0xa15a('0x12')][_0xa15a('0x13')]);return _0x32648c(_0x5202b0[_0xa15a('0x12')][_0xa15a('0x13')]);}logger[_0xa15a('0x12')](_0xa15a('0xc'),_0x240a33,_0x5202b0['error'][_0xa15a('0x13')]);return _0x36c9ca(_0x5202b0[_0xa15a('0x12')][_0xa15a('0x13')]);}else{logger['info'](_0xa15a('0xc'),_0x240a33,_0xa15a('0xd'));_0x36c9ca(_0x5202b0[_0xa15a('0x14')][_0xa15a('0x13')]);}})[_0xa15a('0x15')](function(_0xb886e6){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x240a33,_0xb886e6);_0x32648c(_0xb886e6);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 09a4433..009d572 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 _0xc82e=['create','put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','index','/:id'];(function(_0x5a582c,_0x4f6495){var _0x1147e9=function(_0x7217b4){while(--_0x7217b4){_0x5a582c['push'](_0x5a582c['shift']());}};_0x1147e9(++_0x4f6495);}(_0xc82e,0x110));var _0xec82=function(_0x3257f5,_0x2fc01b){_0x3257f5=_0x3257f5-0x0;var _0x4ba03b=_0xc82e[_0x3257f5];return _0x4ba03b;};'use strict';var multer=require(_0xec82('0x0'));var util=require(_0xec82('0x1'));var path=require(_0xec82('0x2'));var timeout=require(_0xec82('0x3'));var express=require(_0xec82('0x4'));var router=express[_0xec82('0x5')]();var fs_extra=require(_0xec82('0x6'));var auth=require(_0xec82('0x7'));var interaction=require(_0xec82('0x8'));var config=require('../../config/environment');var controller=require(_0xec82('0x9'));router[_0xec82('0xa')]('/',auth['isAuthenticated'](),controller[_0xec82('0xb')]);router[_0xec82('0xa')](_0xec82('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xec82('0xd')]);router[_0xec82('0xe')](_0xec82('0xc'),auth[_0xec82('0xf')](),controller[_0xec82('0x10')]);router['delete'](_0xec82('0xc'),auth[_0xec82('0xf')](),controller[_0xec82('0x11')]);module[_0xec82('0x12')]=router; \ No newline at end of file +var _0xff4c=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller'];(function(_0x453b78,_0x1d2902){var _0xe0b03=function(_0x468fa3){while(--_0x468fa3){_0x453b78['push'](_0x453b78['shift']());}};_0xe0b03(++_0x1d2902);}(_0xff4c,0x160));var _0xcff4=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0xff4c[_0x496333];return _0x44256e;};'use strict';var multer=require(_0xcff4('0x0'));var util=require(_0xcff4('0x1'));var path=require(_0xcff4('0x2'));var timeout=require(_0xcff4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcff4('0x4'));var auth=require(_0xcff4('0x5'));var interaction=require(_0xcff4('0x6'));var config=require('../../config/environment');var controller=require(_0xcff4('0x7'));router[_0xcff4('0x8')]('/',auth[_0xcff4('0x9')](),controller[_0xcff4('0xa')]);router[_0xcff4('0x8')](_0xcff4('0xb'),auth['isAuthenticated'](),controller[_0xcff4('0xc')]);router[_0xcff4('0xd')]('/',auth['isAuthenticated'](),controller[_0xcff4('0xe')]);router[_0xcff4('0xf')](_0xcff4('0xb'),auth[_0xcff4('0x9')](),controller[_0xcff4('0x10')]);router[_0xcff4('0x11')]('/:id',auth[_0xcff4('0x9')](),controller[_0xcff4('0x12')]);module[_0xcff4('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index d99bf69..74e4848 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 _0xa7cc=['DATE','STRING','INTEGER','exports'];(function(_0x1ce16d,_0xdbb61a){var _0x179ba0=function(_0x502682){while(--_0x502682){_0x1ce16d['push'](_0x1ce16d['shift']());}};_0x179ba0(++_0xdbb61a);}(_0xa7cc,0x1e3));var _0xca7c=function(_0x21b125,_0x4e9942){_0x21b125=_0x21b125-0x0;var _0x1f04c5=_0xa7cc[_0x21b125];return _0x1f04c5;};'use strict';var Sequelize=require('sequelize');module[_0xca7c('0x0')]={'calldate':{'type':Sequelize[_0xca7c('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xca7c('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xca7c('0x2')]},'lastapp':{'type':Sequelize[_0xca7c('0x2')]},'lastdata':{'type':Sequelize[_0xca7c('0x2')]},'duration':{'type':Sequelize[_0xca7c('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xca7c('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xca7c('0x2')]},'amaflags':{'type':Sequelize[_0xca7c('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xca7c('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xca7c('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xca7c('0x2')]}}; \ No newline at end of file +var _0xbe77=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x23a9ce,_0x1c61d2){var _0xc2513c=function(_0x14c3a3){while(--_0x14c3a3){_0x23a9ce['push'](_0x23a9ce['shift']());}};_0xc2513c(++_0x1c61d2);}(_0xbe77,0x1ab));var _0x7be7=function(_0xa07731,_0x21efb0){_0xa07731=_0xa07731-0x0;var _0x18f683=_0xbe77[_0xa07731];return _0x18f683;};'use strict';var Sequelize=require(_0x7be7('0x0'));module[_0x7be7('0x1')]={'calldate':{'type':Sequelize[_0x7be7('0x2')],'allowNull':![],'defaultValue':_0x7be7('0x3')},'clid':{'type':Sequelize[_0x7be7('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x7be7('0x4')]},'dcontext':{'type':Sequelize[_0x7be7('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x7be7('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x7be7('0x4')]},'duration':{'type':Sequelize[_0x7be7('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7be7('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7be7('0x4')]},'amaflags':{'type':Sequelize[_0x7be7('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7be7('0x4')]},'userfield':{'type':Sequelize[_0x7be7('0x4')]},'uniqueid':{'type':Sequelize[_0x7be7('0x4')]},'linkedid':{'type':Sequelize[_0x7be7('0x4')]},'sequence':{'type':Sequelize[_0x7be7('0x4')]},'peeraccount':{'type':Sequelize[_0x7be7('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x7be7('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 3910c7a..cc50003 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 _0x21d1=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Cdr','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','includeAll','include','catch','create','body','find','params'];(function(_0x12b87f,_0x5beb51){var _0x2b1261=function(_0x57de5e){while(--_0x57de5e){_0x12b87f['push'](_0x12b87f['shift']());}};_0x2b1261(++_0x5beb51);}(_0x21d1,0x1c9));var _0x121d=function(_0x3b2500,_0xeab0d){_0x3b2500=_0x3b2500-0x0;var _0x5769af=_0x21d1[_0x3b2500];return _0x5769af;};'use strict';var emlformat=require(_0x121d('0x0'));var rimraf=require(_0x121d('0x1'));var zipdir=require(_0x121d('0x2'));var jsonpatch=require(_0x121d('0x3'));var rp=require(_0x121d('0x4'));var moment=require(_0x121d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x121d('0x6'));var path=require(_0x121d('0x7'));var sox=require(_0x121d('0x8'));var csv=require(_0x121d('0x9'));var ejs=require(_0x121d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x121d('0xb'));var squel=require(_0x121d('0xc'));var crypto=require(_0x121d('0xd'));var jsforce=require(_0x121d('0xe'));var deskjs=require(_0x121d('0xf'));var toCsv=require(_0x121d('0x9'));var querystring=require(_0x121d('0x10'));var Papa=require(_0x121d('0x11'));var Redis=require(_0x121d('0x12'));var authService=require(_0x121d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x121d('0x14'));var hardwareService=require(_0x121d('0x15'));var logger=require(_0x121d('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x121d('0x17'));var licenseUtil=require(_0x121d('0x18'));var db=require(_0x121d('0x19'))['db'];function respondWithStatusCode(_0x50c279,_0x570d2a){_0x570d2a=_0x570d2a||0xcc;return function(_0x29dd8c){if(_0x29dd8c){return _0x50c279['sendStatus'](_0x570d2a);}return _0x50c279[_0x121d('0x1a')](_0x570d2a)[_0x121d('0x1b')]();};}function respondWithResult(_0x280c80,_0x48e4ce){_0x48e4ce=_0x48e4ce||0xc8;return function(_0x224e01){if(_0x224e01){return _0x280c80[_0x121d('0x1a')](_0x48e4ce)[_0x121d('0x1c')](_0x224e01);}};}function respondWithFilteredResult(_0x8dec86,_0x13f76a){return function(_0x6bf5e6){if(_0x6bf5e6){var _0xbd872f=_0x6bf5e6[_0x121d('0x1d')],_0x317b8a=_0x13f76a[_0x121d('0x1e')],_0x37cb0d=_0x13f76a[_0x121d('0x1e')]+_0x13f76a['limit'],_0x475541;if(_0x37cb0d>=_0xbd872f){_0x37cb0d=_0xbd872f;_0x475541=0xc8;}else{_0x475541=0xce;}_0x8dec86['status'](_0x475541);return _0x8dec86['set'](_0x121d('0x1f'),_0x317b8a+'-'+_0x37cb0d+'/'+_0xbd872f)[_0x121d('0x1c')](_0x6bf5e6);}return null;};}function patchUpdates(_0x4a8630){return function(_0x455041){try{jsonpatch[_0x121d('0x20')](_0x455041,_0x4a8630,!![]);}catch(_0x18b802){return BPromise[_0x121d('0x21')](_0x18b802);}return _0x455041[_0x121d('0x22')]();};}function saveUpdates(_0x418345,_0x477485){return function(_0x25844d){if(_0x25844d){return _0x25844d[_0x121d('0x23')](_0x418345)[_0x121d('0x24')](function(_0x1b8e6d){return _0x1b8e6d;});}return null;};}function removeEntity(_0x2f8e6d,_0x15da0f){return function(_0x9e6d43){if(_0x9e6d43){return _0x9e6d43[_0x121d('0x25')]()[_0x121d('0x24')](function(){_0x2f8e6d[_0x121d('0x1a')](0xcc)[_0x121d('0x1b')]();});}};}function handleEntityNotFound(_0x331e9c,_0x1de3f8){return function(_0x1b5ce6){if(!_0x1b5ce6){_0x331e9c['sendStatus'](0x194);}return _0x1b5ce6;};}function handleError(_0x31e1e1,_0x18392c){_0x18392c=_0x18392c||0x1f4;return function(_0x78cb1a){logger[_0x121d('0x26')](_0x78cb1a[_0x121d('0x27')]);if(_0x78cb1a['name']){delete _0x78cb1a[_0x121d('0x28')];}_0x31e1e1['status'](_0x18392c)[_0x121d('0x29')](_0x78cb1a);};}exports[_0x121d('0x2a')]=function(_0x4762fb,_0x485aae){var _0x1683b0={},_0x3156b5={},_0x6cb2ce={'count':0x0,'rows':[]};var _0x4347ac=_[_0x121d('0x2b')](db[_0x121d('0x2c')]['rawAttributes'],function(_0x3c041c){return{'name':_0x3c041c['fieldName'],'type':_0x3c041c[_0x121d('0x2d')][_0x121d('0x2e')]};});_0x3156b5[_0x121d('0x2f')]=_['map'](_0x4347ac,'name');_0x3156b5[_0x121d('0x30')]=_[_0x121d('0x31')](_0x4762fb[_0x121d('0x30')]);_0x3156b5[_0x121d('0x32')]=_[_0x121d('0x33')](_0x3156b5[_0x121d('0x2f')],_0x3156b5[_0x121d('0x30')]);_0x1683b0['attributes']=_[_0x121d('0x33')](_0x3156b5[_0x121d('0x2f')],qs[_0x121d('0x34')](_0x4762fb[_0x121d('0x30')][_0x121d('0x34')]));_0x1683b0[_0x121d('0x35')]=_0x1683b0[_0x121d('0x35')][_0x121d('0x36')]?_0x1683b0['attributes']:_0x3156b5[_0x121d('0x2f')];if(!_0x4762fb[_0x121d('0x30')][_0x121d('0x37')](_0x121d('0x38'))){_0x1683b0[_0x121d('0x39')]=qs[_0x121d('0x39')](_0x4762fb[_0x121d('0x30')][_0x121d('0x39')]);_0x1683b0[_0x121d('0x1e')]=qs['offset'](_0x4762fb[_0x121d('0x30')][_0x121d('0x1e')]);}_0x1683b0[_0x121d('0x3a')]=qs['sort'](_0x4762fb[_0x121d('0x30')][_0x121d('0x3b')]);_0x1683b0[_0x121d('0x3c')]=qs[_0x121d('0x32')](_[_0x121d('0x3d')](_0x4762fb[_0x121d('0x30')],_0x3156b5[_0x121d('0x32')]),_0x4347ac);if(_0x4762fb['query'][_0x121d('0x3e')]){_0x1683b0[_0x121d('0x3c')]=_[_0x121d('0x3f')](_0x1683b0[_0x121d('0x3c')],{'$or':_['map'](_0x4347ac,function(_0x476733){if(_0x476733[_0x121d('0x2d')]!==_0x121d('0x40')){var _0x2beeba={};_0x2beeba[_0x476733[_0x121d('0x28')]]={'$like':'%'+_0x4762fb[_0x121d('0x30')][_0x121d('0x3e')]+'%'};return _0x2beeba;}})});}_0x1683b0=_['merge']({},_0x1683b0,_0x4762fb[_0x121d('0x41')]);var _0xca04cc={'where':_0x1683b0[_0x121d('0x3c')]};return db[_0x121d('0x2c')][_0x121d('0x1d')](_0xca04cc)[_0x121d('0x24')](function(_0x2b2c4a){_0x6cb2ce['count']=_0x2b2c4a;if(_0x4762fb[_0x121d('0x30')]['includeAll']){_0x1683b0['include']=[{'all':!![]}];}return db[_0x121d('0x2c')][_0x121d('0x42')](_0x1683b0);})[_0x121d('0x24')](function(_0x5e55ee){_0x6cb2ce['rows']=_0x5e55ee;return _0x6cb2ce;})[_0x121d('0x24')](respondWithFilteredResult(_0x485aae,_0x1683b0))['catch'](handleError(_0x485aae,null));};exports[_0x121d('0x43')]=function(_0x333a8b,_0x4a163b){var _0x2fc92b={'raw':!![],'where':{'id':_0x333a8b['params']['id']}},_0x1881c6={};_0x1881c6['model']=_[_0x121d('0x31')](db[_0x121d('0x2c')]['rawAttributes']);_0x1881c6['query']=_['keys'](_0x333a8b['query']);_0x1881c6[_0x121d('0x32')]=_[_0x121d('0x33')](_0x1881c6[_0x121d('0x2f')],_0x1881c6[_0x121d('0x30')]);_0x2fc92b[_0x121d('0x35')]=_[_0x121d('0x33')](_0x1881c6[_0x121d('0x2f')],qs[_0x121d('0x34')](_0x333a8b['query'][_0x121d('0x34')]));_0x2fc92b[_0x121d('0x35')]=_0x2fc92b['attributes'][_0x121d('0x36')]?_0x2fc92b[_0x121d('0x35')]:_0x1881c6['model'];if(_0x333a8b[_0x121d('0x30')][_0x121d('0x44')]){_0x2fc92b[_0x121d('0x45')]=[{'all':!![]}];}_0x2fc92b=_[_0x121d('0x3f')]({},_0x2fc92b,_0x333a8b[_0x121d('0x41')]);return db[_0x121d('0x2c')]['find'](_0x2fc92b)['then'](handleEntityNotFound(_0x4a163b,null))[_0x121d('0x24')](respondWithResult(_0x4a163b,null))[_0x121d('0x46')](handleError(_0x4a163b,null));};exports[_0x121d('0x47')]=function(_0x4488a4,_0x1d4f3c){return db[_0x121d('0x2c')][_0x121d('0x47')](_0x4488a4['body'],{})[_0x121d('0x24')](respondWithResult(_0x1d4f3c,0xc9))['catch'](handleError(_0x1d4f3c,null));};exports[_0x121d('0x23')]=function(_0x550789,_0x739491){if(_0x550789[_0x121d('0x48')]['id']){delete _0x550789['body']['id'];}return db[_0x121d('0x2c')][_0x121d('0x49')]({'where':{'id':_0x550789[_0x121d('0x4a')]['id']}})[_0x121d('0x24')](handleEntityNotFound(_0x739491,null))[_0x121d('0x24')](saveUpdates(_0x550789[_0x121d('0x48')],null))[_0x121d('0x24')](respondWithResult(_0x739491,null))['catch'](handleError(_0x739491,null));};exports[_0x121d('0x25')]=function(_0x1dba9d,_0x3a55af){return db[_0x121d('0x2c')]['find']({'where':{'id':_0x1dba9d[_0x121d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3a55af,null))[_0x121d('0x24')](removeEntity(_0x3a55af,null))[_0x121d('0x46')](handleError(_0x3a55af,null));};exports['describe']=function(_0x22f8cf,_0x166469){return db['Cdr'][_0x121d('0x4b')]()[_0x121d('0x24')](respondWithResult(_0x166469,null))['catch'](handleError(_0x166469,null));}; \ No newline at end of file +var _0xad36=['path','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','Content-Range','reject','save','update','then','destroy','error','stack','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','count','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x1f2c3d,_0x4760bd){var _0x386306=function(_0x2a47ea){while(--_0x2a47ea){_0x1f2c3d['push'](_0x1f2c3d['shift']());}};_0x386306(++_0x4760bd);}(_0xad36,0x11c));var _0x6ad3=function(_0x47eaa6,_0x4d264d){_0x47eaa6=_0x47eaa6-0x0;var _0x3e38ba=_0xad36[_0x47eaa6];return _0x3e38ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ad3('0x0'));var zipdir=require(_0x6ad3('0x1'));var jsonpatch=require(_0x6ad3('0x2'));var rp=require(_0x6ad3('0x3'));var moment=require(_0x6ad3('0x4'));var BPromise=require(_0x6ad3('0x5'));var Mustache=require(_0x6ad3('0x6'));var util=require(_0x6ad3('0x7'));var path=require(_0x6ad3('0x8'));var sox=require('sox');var csv=require(_0x6ad3('0x9'));var ejs=require(_0x6ad3('0xa'));var fs=require('fs');var fs_extra=require(_0x6ad3('0xb'));var _=require(_0x6ad3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ad3('0x9'));var querystring=require(_0x6ad3('0xd'));var Papa=require(_0x6ad3('0xe'));var Redis=require(_0x6ad3('0xf'));var authService=require(_0x6ad3('0x10'));var qs=require(_0x6ad3('0x11'));var as=require(_0x6ad3('0x12'));var hardwareService=require(_0x6ad3('0x13'));var logger=require(_0x6ad3('0x14'))('api');var utils=require(_0x6ad3('0x15'));var config=require(_0x6ad3('0x16'));var licenseUtil=require(_0x6ad3('0x17'));var db=require(_0x6ad3('0x18'))['db'];function respondWithStatusCode(_0x439b9b,_0x27d865){_0x27d865=_0x27d865||0xcc;return function(_0x3132b7){if(_0x3132b7){return _0x439b9b[_0x6ad3('0x19')](_0x27d865);}return _0x439b9b['status'](_0x27d865)[_0x6ad3('0x1a')]();};}function respondWithResult(_0x4883a1,_0x14418f){_0x14418f=_0x14418f||0xc8;return function(_0x2541fa){if(_0x2541fa){return _0x4883a1[_0x6ad3('0x1b')](_0x14418f)[_0x6ad3('0x1c')](_0x2541fa);}};}function respondWithFilteredResult(_0x2e1ba0,_0x52bb9d){return function(_0x2d406b){if(_0x2d406b){var _0x45aa65=_0x2d406b['count'],_0xf81b3=_0x52bb9d['offset'],_0x4c52c2=_0x52bb9d[_0x6ad3('0x1d')]+_0x52bb9d['limit'],_0x5479b8;if(_0x4c52c2>=_0x45aa65){_0x4c52c2=_0x45aa65;_0x5479b8=0xc8;}else{_0x5479b8=0xce;}_0x2e1ba0[_0x6ad3('0x1b')](_0x5479b8);return _0x2e1ba0['set'](_0x6ad3('0x1e'),_0xf81b3+'-'+_0x4c52c2+'/'+_0x45aa65)[_0x6ad3('0x1c')](_0x2d406b);}return null;};}function patchUpdates(_0x2a1570){return function(_0x3f8ce2){try{jsonpatch['apply'](_0x3f8ce2,_0x2a1570,!![]);}catch(_0x48469f){return BPromise[_0x6ad3('0x1f')](_0x48469f);}return _0x3f8ce2[_0x6ad3('0x20')]();};}function saveUpdates(_0x1fad6e,_0x3050aa){return function(_0x3b3f8b){if(_0x3b3f8b){return _0x3b3f8b[_0x6ad3('0x21')](_0x1fad6e)[_0x6ad3('0x22')](function(_0x3dbfb6){return _0x3dbfb6;});}return null;};}function removeEntity(_0xe5b2ad,_0x4cb79d){return function(_0x33e11b){if(_0x33e11b){return _0x33e11b[_0x6ad3('0x23')]()[_0x6ad3('0x22')](function(){_0xe5b2ad[_0x6ad3('0x1b')](0xcc)[_0x6ad3('0x1a')]();});}};}function handleEntityNotFound(_0x244064,_0x4887ba){return function(_0x1942d4){if(!_0x1942d4){_0x244064[_0x6ad3('0x19')](0x194);}return _0x1942d4;};}function handleError(_0x65a104,_0x4dfec1){_0x4dfec1=_0x4dfec1||0x1f4;return function(_0x50dbec){logger[_0x6ad3('0x24')](_0x50dbec[_0x6ad3('0x25')]);if(_0x50dbec['name']){delete _0x50dbec['name'];}_0x65a104[_0x6ad3('0x1b')](_0x4dfec1)[_0x6ad3('0x26')](_0x50dbec);};}exports[_0x6ad3('0x27')]=function(_0xf857f4,_0x467512){var _0x3a8774={},_0x4f692d={},_0x4f40ef={'count':0x0,'rows':[]};var _0x3df91f=_[_0x6ad3('0x28')](db[_0x6ad3('0x29')][_0x6ad3('0x2a')],function(_0x4ee707){return{'name':_0x4ee707[_0x6ad3('0x2b')],'type':_0x4ee707[_0x6ad3('0x2c')][_0x6ad3('0x2d')]};});_0x4f692d[_0x6ad3('0x2e')]=_[_0x6ad3('0x28')](_0x3df91f,_0x6ad3('0x2f'));_0x4f692d[_0x6ad3('0x30')]=_[_0x6ad3('0x31')](_0xf857f4[_0x6ad3('0x30')]);_0x4f692d['filters']=_[_0x6ad3('0x32')](_0x4f692d[_0x6ad3('0x2e')],_0x4f692d['query']);_0x3a8774[_0x6ad3('0x33')]=_[_0x6ad3('0x32')](_0x4f692d[_0x6ad3('0x2e')],qs[_0x6ad3('0x34')](_0xf857f4['query'][_0x6ad3('0x34')]));_0x3a8774['attributes']=_0x3a8774[_0x6ad3('0x33')][_0x6ad3('0x35')]?_0x3a8774[_0x6ad3('0x33')]:_0x4f692d[_0x6ad3('0x2e')];if(!_0xf857f4[_0x6ad3('0x30')][_0x6ad3('0x36')]('nolimit')){_0x3a8774[_0x6ad3('0x37')]=qs[_0x6ad3('0x37')](_0xf857f4[_0x6ad3('0x30')][_0x6ad3('0x37')]);_0x3a8774[_0x6ad3('0x1d')]=qs['offset'](_0xf857f4[_0x6ad3('0x30')]['offset']);}_0x3a8774[_0x6ad3('0x38')]=qs[_0x6ad3('0x39')](_0xf857f4[_0x6ad3('0x30')][_0x6ad3('0x39')]);_0x3a8774[_0x6ad3('0x3a')]=qs[_0x6ad3('0x3b')](_[_0x6ad3('0x3c')](_0xf857f4[_0x6ad3('0x30')],_0x4f692d[_0x6ad3('0x3b')]),_0x3df91f);if(_0xf857f4['query'][_0x6ad3('0x3d')]){_0x3a8774[_0x6ad3('0x3a')]=_[_0x6ad3('0x3e')](_0x3a8774[_0x6ad3('0x3a')],{'$or':_[_0x6ad3('0x28')](_0x3df91f,function(_0x3ed7b9){if(_0x3ed7b9[_0x6ad3('0x2c')]!=='VIRTUAL'){var _0x5391f1={};_0x5391f1[_0x3ed7b9[_0x6ad3('0x2f')]]={'$like':'%'+_0xf857f4[_0x6ad3('0x30')][_0x6ad3('0x3d')]+'%'};return _0x5391f1;}})});}_0x3a8774=_[_0x6ad3('0x3e')]({},_0x3a8774,_0xf857f4[_0x6ad3('0x3f')]);var _0x2bad35={'where':_0x3a8774[_0x6ad3('0x3a')]};return db['Cdr'][_0x6ad3('0x40')](_0x2bad35)[_0x6ad3('0x22')](function(_0x21965c){_0x4f40ef['count']=_0x21965c;if(_0xf857f4[_0x6ad3('0x30')]['includeAll']){_0x3a8774['include']=[{'all':!![]}];}return db[_0x6ad3('0x29')]['findAll'](_0x3a8774);})[_0x6ad3('0x22')](function(_0x32d71c){_0x4f40ef[_0x6ad3('0x41')]=_0x32d71c;return _0x4f40ef;})[_0x6ad3('0x22')](respondWithFilteredResult(_0x467512,_0x3a8774))[_0x6ad3('0x42')](handleError(_0x467512,null));};exports[_0x6ad3('0x43')]=function(_0x1e9226,_0x550d9b){var _0x41e444={'raw':!![],'where':{'id':_0x1e9226[_0x6ad3('0x44')]['id']}},_0x23a7a9={};_0x23a7a9[_0x6ad3('0x2e')]=_[_0x6ad3('0x31')](db[_0x6ad3('0x29')][_0x6ad3('0x2a')]);_0x23a7a9['query']=_[_0x6ad3('0x31')](_0x1e9226[_0x6ad3('0x30')]);_0x23a7a9[_0x6ad3('0x3b')]=_[_0x6ad3('0x32')](_0x23a7a9[_0x6ad3('0x2e')],_0x23a7a9[_0x6ad3('0x30')]);_0x41e444[_0x6ad3('0x33')]=_[_0x6ad3('0x32')](_0x23a7a9[_0x6ad3('0x2e')],qs[_0x6ad3('0x34')](_0x1e9226[_0x6ad3('0x30')]['fields']));_0x41e444[_0x6ad3('0x33')]=_0x41e444[_0x6ad3('0x33')][_0x6ad3('0x35')]?_0x41e444[_0x6ad3('0x33')]:_0x23a7a9[_0x6ad3('0x2e')];if(_0x1e9226['query']['includeAll']){_0x41e444['include']=[{'all':!![]}];}_0x41e444=_['merge']({},_0x41e444,_0x1e9226[_0x6ad3('0x3f')]);return db[_0x6ad3('0x29')][_0x6ad3('0x45')](_0x41e444)[_0x6ad3('0x22')](handleEntityNotFound(_0x550d9b,null))[_0x6ad3('0x22')](respondWithResult(_0x550d9b,null))[_0x6ad3('0x42')](handleError(_0x550d9b,null));};exports[_0x6ad3('0x46')]=function(_0x670d27,_0x8ebb90){return db['Cdr'][_0x6ad3('0x46')](_0x670d27[_0x6ad3('0x47')],{})['then'](respondWithResult(_0x8ebb90,0xc9))['catch'](handleError(_0x8ebb90,null));};exports[_0x6ad3('0x21')]=function(_0x1e2ef6,_0x574ade){if(_0x1e2ef6[_0x6ad3('0x47')]['id']){delete _0x1e2ef6[_0x6ad3('0x47')]['id'];}return db[_0x6ad3('0x29')][_0x6ad3('0x45')]({'where':{'id':_0x1e2ef6[_0x6ad3('0x44')]['id']}})['then'](handleEntityNotFound(_0x574ade,null))[_0x6ad3('0x22')](saveUpdates(_0x1e2ef6['body'],null))[_0x6ad3('0x22')](respondWithResult(_0x574ade,null))['catch'](handleError(_0x574ade,null));};exports[_0x6ad3('0x23')]=function(_0x11fe81,_0x5769da){return db['Cdr'][_0x6ad3('0x45')]({'where':{'id':_0x11fe81[_0x6ad3('0x44')]['id']}})[_0x6ad3('0x22')](handleEntityNotFound(_0x5769da,null))[_0x6ad3('0x22')](removeEntity(_0x5769da,null))[_0x6ad3('0x42')](handleError(_0x5769da,null));};exports[_0x6ad3('0x48')]=function(_0x46c91e,_0xa36879){return db[_0x6ad3('0x29')][_0x6ad3('0x48')]()[_0x6ad3('0x22')](respondWithResult(_0xa36879,null))[_0x6ad3('0x42')](handleError(_0xa36879,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index fa65c67..43667c5 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 _0x0295=['uniqueid','lodash','api','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','accountcode','calldate','disposition','dst','src'];(function(_0x402f4b,_0x284fe6){var _0x116846=function(_0x30424e){while(--_0x30424e){_0x402f4b['push'](_0x402f4b['shift']());}};_0x116846(++_0x284fe6);}(_0x0295,0x1f0));var _0x5029=function(_0x3340c8,_0x3d67d7){_0x3340c8=_0x3340c8-0x0;var _0x30ca8a=_0x0295[_0x3340c8];return _0x30ca8a;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x5029('0x9')]},{'name':'calldate','fields':[_0x5029('0xa')]},{'name':'disposition','fields':[_0x5029('0xb')]},{'name':'dst','fields':[_0x5029('0xc')]},{'name':_0x5029('0xd'),'fields':[_0x5029('0xd')]},{'name':'uniqueid','fields':[_0x5029('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd8fb=['api','path','rimraf','./cdr.attributes','exports','Cdr','accountcode','disposition','dst','src','lodash','util','../../config/logger'];(function(_0x9d8122,_0x5895d3){var _0x1d5cdc=function(_0x49ab8d){while(--_0x49ab8d){_0x9d8122['push'](_0x9d8122['shift']());}};_0x1d5cdc(++_0x5895d3);}(_0xd8fb,0x99));var _0xbd8f=function(_0x347700,_0x2a4485){_0x347700=_0x347700-0x0;var _0x44e311=_0xd8fb[_0x347700];return _0x44e311;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));module[_0xbd8f('0x7')]=function(_0x5543b2,_0x33d541){return _0x5543b2['define'](_0xbd8f('0x8'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0xbd8f('0x9'),'fields':[_0xbd8f('0x9')]},{'name':'calldate','fields':['calldate']},{'name':_0xbd8f('0xa'),'fields':[_0xbd8f('0xa')]},{'name':_0xbd8f('0xb'),'fields':['dst']},{'name':_0xbd8f('0xc'),'fields':[_0xbd8f('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 529b090..29c8239 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 _0xa608=['message','info','result','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2dede6,_0x6b5325){var _0x12e7b2=function(_0x2af420){while(--_0x2af420){_0x2dede6['push'](_0x2dede6['shift']());}};_0x12e7b2(++_0x6b5325);}(_0xa608,0xab));var _0x8a60=function(_0x26ea26,_0x467c14){_0x26ea26=_0x26ea26-0x0;var _0xd77fac=_0xa608[_0x26ea26];return _0xd77fac;};'use strict';var _=require(_0x8a60('0x0'));var util=require(_0x8a60('0x1'));var moment=require('moment');var BPromise=require(_0x8a60('0x2'));var rs=require(_0x8a60('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a60('0x4'));var logger=require(_0x8a60('0x5'))(_0x8a60('0x6'));var config=require(_0x8a60('0x7'));var jayson=require(_0x8a60('0x8'));var client=jayson[_0x8a60('0x9')][_0x8a60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28c60a,_0x308bc5,_0x3463cb){return new BPromise(function(_0x42b7ca,_0x15d02c){return client['request'](_0x28c60a,_0x3463cb)[_0x8a60('0xb')](function(_0x260430){logger['info'](_0x8a60('0xc'),_0x308bc5,'request\x20sent');logger['debug'](_0x8a60('0xd'),_0x308bc5,_0x8a60('0xe'),JSON[_0x8a60('0xf')](_0x260430));if(_0x260430[_0x8a60('0x10')]){if(_0x260430[_0x8a60('0x10')][_0x8a60('0x11')]===0x1f4){logger[_0x8a60('0x10')]('Cdr,\x20%s,\x20%s',_0x308bc5,_0x260430[_0x8a60('0x10')][_0x8a60('0x12')]);return _0x15d02c(_0x260430['error']['message']);}logger[_0x8a60('0x10')]('Cdr,\x20%s,\x20%s',_0x308bc5,_0x260430[_0x8a60('0x10')][_0x8a60('0x12')]);return _0x42b7ca(_0x260430[_0x8a60('0x10')][_0x8a60('0x12')]);}else{logger[_0x8a60('0x13')](_0x8a60('0xc'),_0x308bc5,'request\x20sent');_0x42b7ca(_0x260430[_0x8a60('0x14')][_0x8a60('0x12')]);}})['catch'](function(_0x2ea146){logger[_0x8a60('0x10')](_0x8a60('0xc'),_0x308bc5,_0x2ea146);_0x15d02c(_0x2ea146);});});} \ No newline at end of file +var _0x5421=['message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','Cdr,\x20%s,\x20%s'];(function(_0x5a3fe8,_0x25d2cf){var _0x24f3ca=function(_0x561b17){while(--_0x561b17){_0x5a3fe8['push'](_0x5a3fe8['shift']());}};_0x24f3ca(++_0x25d2cf);}(_0x5421,0x118));var _0x1542=function(_0x139e6a,_0x443ab7){_0x139e6a=_0x139e6a-0x0;var _0x19c2ba=_0x5421[_0x139e6a];return _0x19c2ba;};'use strict';var _=require(_0x1542('0x0'));var util=require(_0x1542('0x1'));var moment=require(_0x1542('0x2'));var BPromise=require('bluebird');var rs=require(_0x1542('0x3'));var fs=require('fs');var Redis=require(_0x1542('0x4'));var db=require(_0x1542('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1542('0x6'))(_0x1542('0x7'));var config=require(_0x1542('0x8'));var jayson=require(_0x1542('0x9'));var client=jayson[_0x1542('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36f8c3,_0x4a3b9d,_0x34e076){return new BPromise(function(_0x5989db,_0x56db53){return client[_0x1542('0xb')](_0x36f8c3,_0x34e076)[_0x1542('0xc')](function(_0x1db471){logger['info']('Cdr,\x20%s,\x20%s',_0x4a3b9d,_0x1542('0xd'));logger['debug'](_0x1542('0xe'),_0x4a3b9d,_0x1542('0xd'),JSON[_0x1542('0xf')](_0x1db471));if(_0x1db471['error']){if(_0x1db471['error'][_0x1542('0x10')]===0x1f4){logger[_0x1542('0x11')](_0x1542('0x12'),_0x4a3b9d,_0x1db471['error']['message']);return _0x56db53(_0x1db471[_0x1542('0x11')][_0x1542('0x13')]);}logger['error'](_0x1542('0x12'),_0x4a3b9d,_0x1db471[_0x1542('0x11')][_0x1542('0x13')]);return _0x5989db(_0x1db471[_0x1542('0x11')][_0x1542('0x13')]);}else{logger[_0x1542('0x14')](_0x1542('0x12'),_0x4a3b9d,'request\x20sent');_0x5989db(_0x1db471[_0x1542('0x15')][_0x1542('0x13')]);}})[_0x1542('0x16')](function(_0x4550ab){logger['error']('Cdr,\x20%s,\x20%s',_0x4a3b9d,_0x4550ab);_0x56db53(_0x4550ab);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index b0639c1..fc4322f 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 _0xba4f=['../../config/environment','./cdr.controller','get','isAuthenticated','/describe','/:id','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2d21d6,_0x288a17){var _0x460e26=function(_0xfdf68d){while(--_0xfdf68d){_0x2d21d6['push'](_0x2d21d6['shift']());}};_0x460e26(++_0x288a17);}(_0xba4f,0xbe));var _0xfba4=function(_0x50d148,_0x98e59b){_0x50d148=_0x50d148-0x0;var _0x5fdc4d=_0xba4f[_0x50d148];return _0x5fdc4d;};'use strict';var multer=require(_0xfba4('0x0'));var util=require(_0xfba4('0x1'));var path=require(_0xfba4('0x2'));var timeout=require(_0xfba4('0x3'));var express=require(_0xfba4('0x4'));var router=express[_0xfba4('0x5')]();var fs_extra=require(_0xfba4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfba4('0x7'));var config=require(_0xfba4('0x8'));var controller=require(_0xfba4('0x9'));router[_0xfba4('0xa')]('/',auth[_0xfba4('0xb')](),controller['index']);router['get'](_0xfba4('0xc'),auth[_0xfba4('0xb')](),controller['describe']);router['get'](_0xfba4('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xfba4('0xb')](),controller['create']);router[_0xfba4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xfba4('0xf')]);router[_0xfba4('0x10')](_0xfba4('0xd'),auth[_0xfba4('0xb')](),controller['destroy']);module[_0xfba4('0x11')]=router; \ No newline at end of file +var _0xc249=['describe','/:id','show','post','create','put','update','delete','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','isAuthenticated'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0xc249,0x135));var _0x9c24=function(_0x3a487f,_0x42cdbf){_0x3a487f=_0x3a487f-0x0;var _0x4f3a40=_0xc249[_0x3a487f];return _0x4f3a40;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9c24('0x0'));var timeout=require(_0x9c24('0x1'));var express=require('express');var router=express[_0x9c24('0x2')]();var fs_extra=require(_0x9c24('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9c24('0x4'));var config=require(_0x9c24('0x5'));var controller=require(_0x9c24('0x6'));router[_0x9c24('0x7')]('/',auth['isAuthenticated'](),controller[_0x9c24('0x8')]);router[_0x9c24('0x7')](_0x9c24('0x9'),auth[_0x9c24('0xa')](),controller[_0x9c24('0xb')]);router[_0x9c24('0x7')](_0x9c24('0xc'),auth[_0x9c24('0xa')](),controller[_0x9c24('0xd')]);router[_0x9c24('0xe')]('/',auth[_0x9c24('0xa')](),controller[_0x9c24('0xf')]);router[_0x9c24('0x10')](_0x9c24('0xc'),auth[_0x9c24('0xa')](),controller[_0x9c24('0x11')]);router[_0x9c24('0x12')](_0x9c24('0xc'),auth[_0x9c24('0xa')](),controller['destroy']);module[_0x9c24('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 3f108d8..685d574 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 _0x62da=['STRING','*,*,*,*','sequelize','exports','TEXT'];(function(_0x36d6b2,_0x378d34){var _0x555067=function(_0x1d5223){while(--_0x1d5223){_0x36d6b2['push'](_0x36d6b2['shift']());}};_0x555067(++_0x378d34);}(_0x62da,0x15b));var _0xa62d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62da[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa62d('0x0'));module[_0xa62d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa62d('0x2')]()},'description':{'type':Sequelize[_0xa62d('0x3')]},'interval':{'type':Sequelize[_0xa62d('0x3')],'defaultValue':_0xa62d('0x4')}}; \ No newline at end of file +var _0xed66=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0xde12d6,_0x3d7cf4){var _0x2dcdb1=function(_0x544d03){while(--_0x544d03){_0xde12d6['push'](_0xde12d6['shift']());}};_0x2dcdb1(++_0x3d7cf4);}(_0xed66,0x147));var _0x6ed6=function(_0x3de99a,_0x20140b){_0x3de99a=_0x3de99a-0x0;var _0x3d9667=_0xed66[_0x3de99a];return _0x3d9667;};'use strict';var Sequelize=require(_0x6ed6('0x0'));module[_0x6ed6('0x1')]={'priority':{'type':Sequelize[_0x6ed6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6ed6('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6ed6('0x4')]()},'description':{'type':Sequelize[_0x6ed6('0x3')]},'interval':{'type':Sequelize[_0x6ed6('0x3')],'defaultValue':_0x6ed6('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 45c0b71..c2c7c10 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 _0x8671=['fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','then','destroy','error','name','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','find','catch','body','eml-format','zip-dir'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8671,0x1ed));var _0x1867=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x8671[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0x1867('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1867('0x1'));var jsonpatch=require(_0x1867('0x2'));var rp=require(_0x1867('0x3'));var moment=require('moment');var BPromise=require(_0x1867('0x4'));var Mustache=require(_0x1867('0x5'));var util=require(_0x1867('0x6'));var path=require(_0x1867('0x7'));var sox=require('sox');var csv=require(_0x1867('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1867('0x9'));var _=require(_0x1867('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1867('0xb'));var deskjs=require(_0x1867('0xc'));var toCsv=require(_0x1867('0x8'));var querystring=require('querystring');var Papa=require(_0x1867('0xd'));var Redis=require(_0x1867('0xe'));var authService=require(_0x1867('0xf'));var qs=require(_0x1867('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1867('0x11'));var logger=require(_0x1867('0x12'))(_0x1867('0x13'));var utils=require(_0x1867('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1867('0x15'));var db=require(_0x1867('0x16'))['db'];function respondWithStatusCode(_0x31a416,_0x2b3d7c){_0x2b3d7c=_0x2b3d7c||0xcc;return function(_0x119496){if(_0x119496){return _0x31a416[_0x1867('0x17')](_0x2b3d7c);}return _0x31a416[_0x1867('0x18')](_0x2b3d7c)[_0x1867('0x19')]();};}function respondWithResult(_0x57184a,_0x395a76){_0x395a76=_0x395a76||0xc8;return function(_0x5bc136){if(_0x5bc136){return _0x57184a[_0x1867('0x18')](_0x395a76)['json'](_0x5bc136);}};}function respondWithFilteredResult(_0x23b618,_0x4b3430){return function(_0x250880){if(_0x250880){var _0x316948=_0x250880['count'],_0xf7eacd=_0x4b3430[_0x1867('0x1a')],_0x24b8c5=_0x4b3430[_0x1867('0x1a')]+_0x4b3430[_0x1867('0x1b')],_0x5da559;if(_0x24b8c5>=_0x316948){_0x24b8c5=_0x316948;_0x5da559=0xc8;}else{_0x5da559=0xce;}_0x23b618[_0x1867('0x18')](_0x5da559);return _0x23b618[_0x1867('0x1c')](_0x1867('0x1d'),_0xf7eacd+'-'+_0x24b8c5+'/'+_0x316948)[_0x1867('0x1e')](_0x250880);}return null;};}function patchUpdates(_0x3482c8){return function(_0x4dbce9){try{jsonpatch['apply'](_0x4dbce9,_0x3482c8,!![]);}catch(_0x4cfc93){return BPromise[_0x1867('0x1f')](_0x4cfc93);}return _0x4dbce9[_0x1867('0x20')]();};}function saveUpdates(_0x98541b,_0x1dfaee){return function(_0x299e90){if(_0x299e90){return _0x299e90['update'](_0x98541b)[_0x1867('0x21')](function(_0xa1570){return _0xa1570;});}return null;};}function removeEntity(_0x2544d1,_0x5a0f5d){return function(_0x4fa1e9){if(_0x4fa1e9){return _0x4fa1e9[_0x1867('0x22')]()[_0x1867('0x21')](function(){_0x2544d1[_0x1867('0x18')](0xcc)[_0x1867('0x19')]();});}};}function handleEntityNotFound(_0x18138f,_0x474c12){return function(_0x29ed13){if(!_0x29ed13){_0x18138f['sendStatus'](0x194);}return _0x29ed13;};}function handleError(_0x3a0348,_0x3450ea){_0x3450ea=_0x3450ea||0x1f4;return function(_0x324b1e){logger[_0x1867('0x23')](_0x324b1e['stack']);if(_0x324b1e[_0x1867('0x24')]){delete _0x324b1e[_0x1867('0x24')];}_0x3a0348[_0x1867('0x18')](_0x3450ea)[_0x1867('0x25')](_0x324b1e);};}exports[_0x1867('0x26')]=function(_0x403273,_0x345dc6){var _0x34fe96={'raw':!![],'where':{'id':_0x403273[_0x1867('0x27')]['id']}},_0x49ec9a={};_0x49ec9a[_0x1867('0x28')]=_['keys'](db[_0x1867('0x29')][_0x1867('0x2a')]);_0x49ec9a[_0x1867('0x2b')]=_[_0x1867('0x2c')](_0x403273[_0x1867('0x2b')]);_0x49ec9a[_0x1867('0x2d')]=_[_0x1867('0x2e')](_0x49ec9a[_0x1867('0x28')],_0x49ec9a[_0x1867('0x2b')]);_0x34fe96[_0x1867('0x2f')]=_['intersection'](_0x49ec9a[_0x1867('0x28')],qs[_0x1867('0x30')](_0x403273[_0x1867('0x2b')][_0x1867('0x30')]));_0x34fe96[_0x1867('0x2f')]=_0x34fe96[_0x1867('0x2f')][_0x1867('0x31')]?_0x34fe96['attributes']:_0x49ec9a[_0x1867('0x28')];if(_0x403273[_0x1867('0x2b')]['includeAll']){_0x34fe96['include']=[{'all':!![]}];}_0x34fe96=_[_0x1867('0x32')]({},_0x34fe96,_0x403273[_0x1867('0x33')]);return db[_0x1867('0x29')][_0x1867('0x34')](_0x34fe96)[_0x1867('0x21')](handleEntityNotFound(_0x345dc6,null))[_0x1867('0x21')](respondWithResult(_0x345dc6,null))[_0x1867('0x35')](handleError(_0x345dc6,null));};exports['update']=function(_0x15baf8,_0x475769){if(_0x15baf8[_0x1867('0x36')]['id']){delete _0x15baf8['body']['id'];}return db[_0x1867('0x29')][_0x1867('0x34')]({'where':{'id':_0x15baf8[_0x1867('0x27')]['id']}})['then'](handleEntityNotFound(_0x475769,null))[_0x1867('0x21')](saveUpdates(_0x15baf8[_0x1867('0x36')],null))[_0x1867('0x21')](respondWithResult(_0x475769,null))[_0x1867('0x35')](handleError(_0x475769,null));};exports[_0x1867('0x22')]=function(_0x1a357a,_0x14bc17){return db['ChatApplication']['find']({'where':{'id':_0x1a357a[_0x1867('0x27')]['id']}})[_0x1867('0x21')](handleEntityNotFound(_0x14bc17,null))[_0x1867('0x21')](removeEntity(_0x14bc17,null))[_0x1867('0x35')](handleError(_0x14bc17,null));}; \ No newline at end of file +var _0x8923=['to-csv','ejs','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','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','length','includeAll','include','options','find','catch','body','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox'];(function(_0x3fd455,_0x1f7c5b){var _0x1c259f=function(_0x2da88a){while(--_0x2da88a){_0x3fd455['push'](_0x3fd455['shift']());}};_0x1c259f(++_0x1f7c5b);}(_0x8923,0x70));var _0x3892=function(_0x517eb1,_0xa0759f){_0x517eb1=_0x517eb1-0x0;var _0x59e6d0=_0x8923[_0x517eb1];return _0x59e6d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3892('0x0'));var zipdir=require(_0x3892('0x1'));var jsonpatch=require(_0x3892('0x2'));var rp=require('request-promise');var moment=require(_0x3892('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3892('0x4'));var util=require(_0x3892('0x5'));var path=require(_0x3892('0x6'));var sox=require(_0x3892('0x7'));var csv=require(_0x3892('0x8'));var ejs=require(_0x3892('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3892('0xa'));var squel=require(_0x3892('0xb'));var crypto=require(_0x3892('0xc'));var jsforce=require(_0x3892('0xd'));var deskjs=require(_0x3892('0xe'));var toCsv=require(_0x3892('0x8'));var querystring=require(_0x3892('0xf'));var Papa=require(_0x3892('0x10'));var Redis=require('ioredis');var authService=require(_0x3892('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3892('0x12'));var hardwareService=require(_0x3892('0x13'));var logger=require(_0x3892('0x14'))(_0x3892('0x15'));var utils=require(_0x3892('0x16'));var config=require(_0x3892('0x17'));var licenseUtil=require(_0x3892('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59835e,_0x2b0c5f){_0x2b0c5f=_0x2b0c5f||0xcc;return function(_0x3c6c57){if(_0x3c6c57){return _0x59835e[_0x3892('0x19')](_0x2b0c5f);}return _0x59835e[_0x3892('0x1a')](_0x2b0c5f)['end']();};}function respondWithResult(_0x49fffb,_0x1cbb1d){_0x1cbb1d=_0x1cbb1d||0xc8;return function(_0xf31ff7){if(_0xf31ff7){return _0x49fffb[_0x3892('0x1a')](_0x1cbb1d)['json'](_0xf31ff7);}};}function respondWithFilteredResult(_0xbc0d29,_0x11169f){return function(_0x508cfc){if(_0x508cfc){var _0x59ff29=_0x508cfc[_0x3892('0x1b')],_0x226e14=_0x11169f['offset'],_0x15ab22=_0x11169f[_0x3892('0x1c')]+_0x11169f[_0x3892('0x1d')],_0x3a73c7;if(_0x15ab22>=_0x59ff29){_0x15ab22=_0x59ff29;_0x3a73c7=0xc8;}else{_0x3a73c7=0xce;}_0xbc0d29[_0x3892('0x1a')](_0x3a73c7);return _0xbc0d29[_0x3892('0x1e')](_0x3892('0x1f'),_0x226e14+'-'+_0x15ab22+'/'+_0x59ff29)[_0x3892('0x20')](_0x508cfc);}return null;};}function patchUpdates(_0x75fb6d){return function(_0x1dc92a){try{jsonpatch[_0x3892('0x21')](_0x1dc92a,_0x75fb6d,!![]);}catch(_0x1258ed){return BPromise[_0x3892('0x22')](_0x1258ed);}return _0x1dc92a[_0x3892('0x23')]();};}function saveUpdates(_0x450730,_0x5a78fb){return function(_0x5b042d){if(_0x5b042d){return _0x5b042d[_0x3892('0x24')](_0x450730)[_0x3892('0x25')](function(_0x5ae33b){return _0x5ae33b;});}return null;};}function removeEntity(_0x4d66dc,_0x4faa17){return function(_0x24f5dc){if(_0x24f5dc){return _0x24f5dc[_0x3892('0x26')]()['then'](function(){_0x4d66dc[_0x3892('0x1a')](0xcc)[_0x3892('0x27')]();});}};}function handleEntityNotFound(_0x54ca10,_0x3890e2){return function(_0xde04cd){if(!_0xde04cd){_0x54ca10[_0x3892('0x19')](0x194);}return _0xde04cd;};}function handleError(_0x46ec1e,_0x550688){_0x550688=_0x550688||0x1f4;return function(_0x6e3571){logger[_0x3892('0x28')](_0x6e3571[_0x3892('0x29')]);if(_0x6e3571['name']){delete _0x6e3571[_0x3892('0x2a')];}_0x46ec1e[_0x3892('0x1a')](_0x550688)[_0x3892('0x2b')](_0x6e3571);};}exports[_0x3892('0x2c')]=function(_0x50d916,_0x3b8338){var _0x37066a={'raw':!![],'where':{'id':_0x50d916[_0x3892('0x2d')]['id']}},_0xd0f480={};_0xd0f480[_0x3892('0x2e')]=_[_0x3892('0x2f')](db[_0x3892('0x30')][_0x3892('0x31')]);_0xd0f480[_0x3892('0x32')]=_['keys'](_0x50d916[_0x3892('0x32')]);_0xd0f480['filters']=_['intersection'](_0xd0f480[_0x3892('0x2e')],_0xd0f480[_0x3892('0x32')]);_0x37066a['attributes']=_[_0x3892('0x33')](_0xd0f480[_0x3892('0x2e')],qs['fields'](_0x50d916[_0x3892('0x32')]['fields']));_0x37066a[_0x3892('0x34')]=_0x37066a['attributes'][_0x3892('0x35')]?_0x37066a['attributes']:_0xd0f480[_0x3892('0x2e')];if(_0x50d916['query'][_0x3892('0x36')]){_0x37066a[_0x3892('0x37')]=[{'all':!![]}];}_0x37066a=_['merge']({},_0x37066a,_0x50d916[_0x3892('0x38')]);return db['ChatApplication'][_0x3892('0x39')](_0x37066a)['then'](handleEntityNotFound(_0x3b8338,null))[_0x3892('0x25')](respondWithResult(_0x3b8338,null))[_0x3892('0x3a')](handleError(_0x3b8338,null));};exports['update']=function(_0x36f720,_0x4f62a4){if(_0x36f720[_0x3892('0x3b')]['id']){delete _0x36f720[_0x3892('0x3b')]['id'];}return db['ChatApplication'][_0x3892('0x39')]({'where':{'id':_0x36f720[_0x3892('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4f62a4,null))['then'](saveUpdates(_0x36f720[_0x3892('0x3b')],null))[_0x3892('0x25')](respondWithResult(_0x4f62a4,null))[_0x3892('0x3a')](handleError(_0x4f62a4,null));};exports[_0x3892('0x26')]=function(_0x276e9a,_0x1069ed){return db['ChatApplication'][_0x3892('0x39')]({'where':{'id':_0x276e9a[_0x3892('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1069ed,null))[_0x3892('0x25')](removeEntity(_0x1069ed,null))['catch'](handleError(_0x1069ed,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 432503e..624ed35 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 _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_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':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index dfe8ab9..41bd48d 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 _0x397a=['error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5e8757,_0x2f7976){var _0xc27e47=function(_0x4000bd){while(--_0x4000bd){_0x5e8757['push'](_0x5e8757['shift']());}};_0xc27e47(++_0x2f7976);}(_0x397a,0x130));var _0xa397=function(_0x27503f,_0xd9e4a9){_0x27503f=_0x27503f-0x0;var _0x22a062=_0x397a[_0x27503f];return _0x22a062;};'use strict';var _=require(_0xa397('0x0'));var util=require(_0xa397('0x1'));var moment=require(_0xa397('0x2'));var BPromise=require(_0xa397('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa397('0x4'));var db=require(_0xa397('0x5'))['db'];var utils=require(_0xa397('0x6'));var logger=require(_0xa397('0x7'))(_0xa397('0x8'));var config=require(_0xa397('0x9'));var jayson=require(_0xa397('0xa'));var client=jayson[_0xa397('0xb')][_0xa397('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46c389,_0x42fb34,_0x3f12bb){return new BPromise(function(_0x2259f0,_0x499f2c){return client[_0xa397('0xd')](_0x46c389,_0x3f12bb)[_0xa397('0xe')](function(_0x1b5493){logger['info'](_0xa397('0xf'),_0x42fb34,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x42fb34,_0xa397('0x10'),JSON[_0xa397('0x11')](_0x1b5493));if(_0x1b5493[_0xa397('0x12')]){if(_0x1b5493[_0xa397('0x12')][_0xa397('0x13')]===0x1f4){logger[_0xa397('0x12')]('ChatApplication,\x20%s,\x20%s',_0x42fb34,_0x1b5493['error']['message']);return _0x499f2c(_0x1b5493[_0xa397('0x12')]['message']);}logger[_0xa397('0x12')]('ChatApplication,\x20%s,\x20%s',_0x42fb34,_0x1b5493[_0xa397('0x12')][_0xa397('0x14')]);return _0x2259f0(_0x1b5493[_0xa397('0x12')][_0xa397('0x14')]);}else{logger[_0xa397('0x15')](_0xa397('0xf'),_0x42fb34,_0xa397('0x10'));_0x2259f0(_0x1b5493['result'][_0xa397('0x14')]);}})[_0xa397('0x16')](function(_0x5ccd0c){logger[_0xa397('0x12')](_0xa397('0xf'),_0x42fb34,_0x5ccd0c);_0x499f2c(_0x5ccd0c);});});} \ No newline at end of file +var _0xaab7=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','error','message','result','util'];(function(_0x53de45,_0x33096d){var _0x2267a3=function(_0x2e79e1){while(--_0x2e79e1){_0x53de45['push'](_0x53de45['shift']());}};_0x2267a3(++_0x33096d);}(_0xaab7,0x77));var _0x7aab=function(_0x464a77,_0x468333){_0x464a77=_0x464a77-0x0;var _0x1c27af=_0xaab7[_0x464a77];return _0x1c27af;};'use strict';var _=require('lodash');var util=require(_0x7aab('0x0'));var moment=require(_0x7aab('0x1'));var BPromise=require(_0x7aab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7aab('0x3'))['db'];var utils=require(_0x7aab('0x4'));var logger=require(_0x7aab('0x5'))(_0x7aab('0x6'));var config=require(_0x7aab('0x7'));var jayson=require(_0x7aab('0x8'));var client=jayson[_0x7aab('0x9')][_0x7aab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ab447,_0x54e8e2,_0x249582){return new BPromise(function(_0x3046f5,_0x12fcce){return client[_0x7aab('0xb')](_0x3ab447,_0x249582)[_0x7aab('0xc')](function(_0x4de2bc){logger[_0x7aab('0xd')](_0x7aab('0xe'),_0x54e8e2,'request\x20sent');logger[_0x7aab('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x54e8e2,_0x7aab('0x10'),JSON['stringify'](_0x4de2bc));if(_0x4de2bc[_0x7aab('0x11')]){if(_0x4de2bc[_0x7aab('0x11')]['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x54e8e2,_0x4de2bc[_0x7aab('0x11')][_0x7aab('0x12')]);return _0x12fcce(_0x4de2bc[_0x7aab('0x11')][_0x7aab('0x12')]);}logger[_0x7aab('0x11')](_0x7aab('0xe'),_0x54e8e2,_0x4de2bc[_0x7aab('0x11')][_0x7aab('0x12')]);return _0x3046f5(_0x4de2bc[_0x7aab('0x11')][_0x7aab('0x12')]);}else{logger[_0x7aab('0xd')](_0x7aab('0xe'),_0x54e8e2,_0x7aab('0x10'));_0x3046f5(_0x4de2bc[_0x7aab('0x13')]['message']);}})['catch'](function(_0x3eb92b){logger[_0x7aab('0x11')]('ChatApplication,\x20%s,\x20%s',_0x54e8e2,_0x3eb92b);_0x12fcce(_0x3eb92b);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 9677a8e..812573e 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 _0x6bbf=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id','update','destroy','exports'];(function(_0xf93678,_0x515528){var _0x20153b=function(_0x2c0a36){while(--_0x2c0a36){_0xf93678['push'](_0xf93678['shift']());}};_0x20153b(++_0x515528);}(_0x6bbf,0x11e));var _0xf6bb=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x6bbf[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf6bb('0x0'));var timeout=require(_0xf6bb('0x1'));var express=require(_0xf6bb('0x2'));var router=express[_0xf6bb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf6bb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf6bb('0x5'));var controller=require('./chatApplication.controller');router[_0xf6bb('0x6')]('/:id',auth[_0xf6bb('0x7')](),controller[_0xf6bb('0x8')]);router['put'](_0xf6bb('0x9'),auth['isAuthenticated'](),controller[_0xf6bb('0xa')]);router['delete']('/:id',auth[_0xf6bb('0x7')](),controller[_0xf6bb('0xb')]);module[_0xf6bb('0xc')]=router; \ No newline at end of file +var _0xd862=['exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0xd862,0xc4));var _0x2d86=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xd862[_0x819464];return _0x49dcc0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2d86('0x0'));var timeout=require(_0x2d86('0x1'));var express=require(_0x2d86('0x2'));var router=express[_0x2d86('0x3')]();var fs_extra=require(_0x2d86('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2d86('0x5'));var config=require(_0x2d86('0x6'));var controller=require('./chatApplication.controller');router[_0x2d86('0x7')](_0x2d86('0x8'),auth[_0x2d86('0x9')](),controller[_0x2d86('0xa')]);router[_0x2d86('0xb')](_0x2d86('0x8'),auth['isAuthenticated'](),controller[_0x2d86('0xc')]);router[_0x2d86('0xd')]('/:id',auth[_0x2d86('0x9')](),controller['destroy']);module[_0x2d86('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 611d78e..4a81747 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 _0x1560=['BOOLEAN','sequelize','exports','STRING'];(function(_0x40c97f,_0x4951d6){var _0x56fe50=function(_0x320295){while(--_0x320295){_0x40c97f['push'](_0x40c97f['shift']());}};_0x56fe50(++_0x4951d6);}(_0x1560,0x1a5));var _0x0156=function(_0x154297,_0x3ea535){_0x154297=_0x154297-0x0;var _0x3999b0=_0x1560[_0x154297];return _0x3999b0;};'use strict';var Sequelize=require(_0x0156('0x0'));module[_0x0156('0x1')]={'name':{'type':Sequelize[_0x0156('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0156('0x2')]},'write':{'type':Sequelize[_0x0156('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb5c5=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1ddcf1,_0x3c2244){var _0x48a6da=function(_0x19608e){while(--_0x19608e){_0x1ddcf1['push'](_0x1ddcf1['shift']());}};_0x48a6da(++_0x3c2244);}(_0xb5c5,0xdc));var _0x5b5c=function(_0x177ef7,_0x5043a8){_0x177ef7=_0x177ef7-0x0;var _0x180647=_0xb5c5[_0x177ef7];return _0x180647;};'use strict';var Sequelize=require(_0x5b5c('0x0'));module[_0x5b5c('0x1')]={'name':{'type':Sequelize[_0x5b5c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5b5c('0x2')]},'write':{'type':Sequelize[_0x5b5c('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 5756ac1..ab35c1d 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 _0x6d3e=['save','update','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','removeMembers','addMessage','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x5998d0,_0x24ad81){var _0x47149d=function(_0x5e4d63){while(--_0x5e4d63){_0x5998d0['push'](_0x5998d0['shift']());}};_0x47149d(++_0x24ad81);}(_0x6d3e,0x117));var _0xe6d3=function(_0x464f27,_0x45af44){_0x464f27=_0x464f27-0x0;var _0x350713=_0x6d3e[_0x464f27];return _0x350713;};'use strict';var emlformat=require(_0xe6d3('0x0'));var rimraf=require(_0xe6d3('0x1'));var zipdir=require(_0xe6d3('0x2'));var jsonpatch=require(_0xe6d3('0x3'));var rp=require(_0xe6d3('0x4'));var moment=require(_0xe6d3('0x5'));var BPromise=require(_0xe6d3('0x6'));var Mustache=require(_0xe6d3('0x7'));var util=require(_0xe6d3('0x8'));var path=require(_0xe6d3('0x9'));var sox=require(_0xe6d3('0xa'));var csv=require(_0xe6d3('0xb'));var ejs=require(_0xe6d3('0xc'));var fs=require('fs');var fs_extra=require(_0xe6d3('0xd'));var _=require(_0xe6d3('0xe'));var squel=require(_0xe6d3('0xf'));var crypto=require(_0xe6d3('0x10'));var jsforce=require(_0xe6d3('0x11'));var deskjs=require(_0xe6d3('0x12'));var toCsv=require(_0xe6d3('0xb'));var querystring=require(_0xe6d3('0x13'));var Papa=require('papaparse');var Redis=require(_0xe6d3('0x14'));var authService=require(_0xe6d3('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xe6d3('0x16'));var hardwareService=require(_0xe6d3('0x17'));var logger=require(_0xe6d3('0x18'))(_0xe6d3('0x19'));var utils=require(_0xe6d3('0x1a'));var config=require(_0xe6d3('0x1b'));var licenseUtil=require(_0xe6d3('0x1c'));var db=require(_0xe6d3('0x1d'))['db'];config['redis']=_[_0xe6d3('0x1e')](config[_0xe6d3('0x1f')],{'host':_0xe6d3('0x20'),'port':0x18eb});var socket=require(_0xe6d3('0x21'))(new Redis(config[_0xe6d3('0x1f')]));require(_0xe6d3('0x22'))[_0xe6d3('0x23')](socket);var jayson=require(_0xe6d3('0x24'));var client=jayson[_0xe6d3('0x25')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22f5ea,_0x2e5200,_0x2e5cc5,_0x5e2a7f){return new BPromise(function(_0x133fc7,_0x5c0743){var _0xc7176a=_0x5e2a7f||client;return _0xc7176a[_0xe6d3('0x26')](_0x22f5ea,_0x2e5cc5)[_0xe6d3('0x27')](function(_0x3a0d1d){logger[_0xe6d3('0x28')](_0xe6d3('0x29'),_0x2e5200,_0xe6d3('0x2a'));logger[_0xe6d3('0x2b')](_0xe6d3('0x2c'),_0x2e5200,_0xe6d3('0x2a'),JSON[_0xe6d3('0x2d')](_0x3a0d1d));if(_0x3a0d1d['error']){if(_0x3a0d1d[_0xe6d3('0x2e')]['code']===0x1f4){logger[_0xe6d3('0x2e')](_0xe6d3('0x29'),_0x2e5200,_0x3a0d1d[_0xe6d3('0x2e')][_0xe6d3('0x2f')]);return _0x5c0743(_0x3a0d1d[_0xe6d3('0x2e')][_0xe6d3('0x2f')]);}logger['error'](_0xe6d3('0x29'),_0x2e5200,_0x3a0d1d['error'][_0xe6d3('0x2f')]);return _0x133fc7(_0x3a0d1d['error'][_0xe6d3('0x2f')]);}else{logger[_0xe6d3('0x28')](_0xe6d3('0x29'),_0x2e5200,_0xe6d3('0x2a'));_0x133fc7(_0x3a0d1d['result']['message']);}})[_0xe6d3('0x30')](function(_0x3e4c0d){logger[_0xe6d3('0x2e')](_0xe6d3('0x29'),_0x2e5200,_0x3e4c0d);_0x5c0743(_0x3e4c0d);});});}function respondWithStatusCode(_0xd99b91,_0x8f061d){_0x8f061d=_0x8f061d||0xcc;return function(_0x53a913){if(_0x53a913){return _0xd99b91[_0xe6d3('0x31')](_0x8f061d);}return _0xd99b91[_0xe6d3('0x32')](_0x8f061d)[_0xe6d3('0x33')]();};}function respondWithResult(_0x82392a,_0x470d1b){_0x470d1b=_0x470d1b||0xc8;return function(_0x5df06f){if(_0x5df06f){return _0x82392a['status'](_0x470d1b)[_0xe6d3('0x34')](_0x5df06f);}};}function respondWithFilteredResult(_0x3ef493,_0x23f1f6){return function(_0xed4a1c){if(_0xed4a1c){var _0x2dd283=_0xed4a1c[_0xe6d3('0x35')],_0xbb5296=_0x23f1f6[_0xe6d3('0x36')],_0x1d547a=_0x23f1f6[_0xe6d3('0x36')]+_0x23f1f6[_0xe6d3('0x37')],_0x56669f;if(_0x1d547a>=_0x2dd283){_0x1d547a=_0x2dd283;_0x56669f=0xc8;}else{_0x56669f=0xce;}_0x3ef493[_0xe6d3('0x32')](_0x56669f);return _0x3ef493[_0xe6d3('0x38')](_0xe6d3('0x39'),_0xbb5296+'-'+_0x1d547a+'/'+_0x2dd283)['json'](_0xed4a1c);}return null;};}function patchUpdates(_0x2f4708){return function(_0x3b1400){try{jsonpatch[_0xe6d3('0x3a')](_0x3b1400,_0x2f4708,!![]);}catch(_0xbc26c0){return BPromise[_0xe6d3('0x3b')](_0xbc26c0);}return _0x3b1400[_0xe6d3('0x3c')]();};}function saveUpdates(_0x49a7a6,_0x248493){return function(_0x4e712c){if(_0x4e712c){return _0x4e712c[_0xe6d3('0x3d')](_0x49a7a6)['then'](function(_0x3314cf){return _0x3314cf;});}return null;};}function removeEntity(_0x321068,_0xd29f82){return function(_0x5e4e9a){if(_0x5e4e9a){return _0x5e4e9a['destroy']()[_0xe6d3('0x27')](function(){_0x321068['status'](0xcc)[_0xe6d3('0x33')]();});}};}function handleEntityNotFound(_0x25e9db,_0x58d5c0){return function(_0xb8430d){if(!_0xb8430d){_0x25e9db['sendStatus'](0x194);}return _0xb8430d;};}function handleError(_0x25aa32,_0x5cd2f8){_0x5cd2f8=_0x5cd2f8||0x1f4;return function(_0x49b201){logger[_0xe6d3('0x2e')](_0x49b201[_0xe6d3('0x3e')]);if(_0x49b201[_0xe6d3('0x3f')]){delete _0x49b201[_0xe6d3('0x3f')];}_0x25aa32[_0xe6d3('0x32')](_0x5cd2f8)[_0xe6d3('0x40')](_0x49b201);};}exports[_0xe6d3('0x41')]=function(_0x3c8b04,_0x196695){var _0x361ab8={},_0xde99bc={},_0x2deb74={'count':0x0,'rows':[]};var _0x13ab85=_[_0xe6d3('0x42')](db[_0xe6d3('0x43')][_0xe6d3('0x44')],function(_0x250442){return{'name':_0x250442[_0xe6d3('0x45')],'type':_0x250442[_0xe6d3('0x46')][_0xe6d3('0x47')]};});_0xde99bc['model']=_['map'](_0x13ab85,_0xe6d3('0x3f'));_0xde99bc[_0xe6d3('0x48')]=_[_0xe6d3('0x49')](_0x3c8b04['query']);_0xde99bc[_0xe6d3('0x4a')]=_[_0xe6d3('0x4b')](_0xde99bc[_0xe6d3('0x4c')],_0xde99bc[_0xe6d3('0x48')]);_0x361ab8['attributes']=_[_0xe6d3('0x4b')](_0xde99bc[_0xe6d3('0x4c')],qs[_0xe6d3('0x4d')](_0x3c8b04['query'][_0xe6d3('0x4d')]));_0x361ab8['attributes']=_0x361ab8['attributes'][_0xe6d3('0x4e')]?_0x361ab8[_0xe6d3('0x4f')]:_0xde99bc['model'];if(!_0x3c8b04['query'][_0xe6d3('0x50')](_0xe6d3('0x51'))){_0x361ab8[_0xe6d3('0x37')]=qs[_0xe6d3('0x37')](_0x3c8b04[_0xe6d3('0x48')]['limit']);_0x361ab8[_0xe6d3('0x36')]=qs[_0xe6d3('0x36')](_0x3c8b04[_0xe6d3('0x48')][_0xe6d3('0x36')]);}_0x361ab8[_0xe6d3('0x52')]=qs[_0xe6d3('0x53')](_0x3c8b04['query'][_0xe6d3('0x53')]);_0x361ab8[_0xe6d3('0x54')]=qs[_0xe6d3('0x4a')](_[_0xe6d3('0x55')](_0x3c8b04[_0xe6d3('0x48')],_0xde99bc['filters']),_0x13ab85);if(_0x3c8b04[_0xe6d3('0x48')][_0xe6d3('0x56')]){_0x361ab8[_0xe6d3('0x54')]=_[_0xe6d3('0x57')](_0x361ab8[_0xe6d3('0x54')],{'$or':_[_0xe6d3('0x42')](_0x13ab85,function(_0x22b61f){if(_0x22b61f['type']!=='VIRTUAL'){var _0x375121={};_0x375121[_0x22b61f[_0xe6d3('0x3f')]]={'$like':'%'+_0x3c8b04[_0xe6d3('0x48')]['filter']+'%'};return _0x375121;}})});}_0x361ab8=_[_0xe6d3('0x57')]({},_0x361ab8,_0x3c8b04[_0xe6d3('0x58')]);var _0x237289={'where':_0x361ab8[_0xe6d3('0x54')]};return db[_0xe6d3('0x43')]['count'](_0x237289)[_0xe6d3('0x27')](function(_0x5b3b0e){_0x2deb74[_0xe6d3('0x35')]=_0x5b3b0e;if(_0x3c8b04['query'][_0xe6d3('0x59')]){_0x361ab8[_0xe6d3('0x5a')]=[{'all':!![]}];}return db[_0xe6d3('0x43')][_0xe6d3('0x5b')](_0x361ab8);})[_0xe6d3('0x27')](function(_0x475822){_0x2deb74[_0xe6d3('0x5c')]=_0x475822;return _0x2deb74;})[_0xe6d3('0x27')](respondWithFilteredResult(_0x196695,_0x361ab8))[_0xe6d3('0x30')](handleError(_0x196695,null));};exports[_0xe6d3('0x5d')]=function(_0x4ba99b,_0x4589aa){var _0x5c9ac7={'raw':!![],'where':{'id':_0x4ba99b[_0xe6d3('0x5e')]['id']}},_0x5931bf={};_0x5931bf['model']=_[_0xe6d3('0x49')](db[_0xe6d3('0x43')][_0xe6d3('0x44')]);_0x5931bf[_0xe6d3('0x48')]=_[_0xe6d3('0x49')](_0x4ba99b[_0xe6d3('0x48')]);_0x5931bf[_0xe6d3('0x4a')]=_[_0xe6d3('0x4b')](_0x5931bf[_0xe6d3('0x4c')],_0x5931bf['query']);_0x5c9ac7[_0xe6d3('0x4f')]=_[_0xe6d3('0x4b')](_0x5931bf[_0xe6d3('0x4c')],qs[_0xe6d3('0x4d')](_0x4ba99b['query'][_0xe6d3('0x4d')]));_0x5c9ac7[_0xe6d3('0x4f')]=_0x5c9ac7[_0xe6d3('0x4f')][_0xe6d3('0x4e')]?_0x5c9ac7[_0xe6d3('0x4f')]:_0x5931bf['model'];if(_0x4ba99b[_0xe6d3('0x48')]['includeAll']){_0x5c9ac7[_0xe6d3('0x5a')]=[{'all':!![]}];}_0x5c9ac7=_[_0xe6d3('0x57')]({},_0x5c9ac7,_0x4ba99b[_0xe6d3('0x58')]);return db[_0xe6d3('0x43')][_0xe6d3('0x5f')](_0x5c9ac7)[_0xe6d3('0x27')](handleEntityNotFound(_0x4589aa,null))[_0xe6d3('0x27')](respondWithResult(_0x4589aa,null))[_0xe6d3('0x30')](handleError(_0x4589aa,null));};exports['create']=function(_0x596490,_0x1b044d){return db['ChatGroup'][_0xe6d3('0x60')](_0x596490[_0xe6d3('0x61')],{})[_0xe6d3('0x27')](respondWithResult(_0x1b044d,0xc9))[_0xe6d3('0x30')](handleError(_0x1b044d,null));};exports[_0xe6d3('0x3d')]=function(_0x46f913,_0x16cba2){if(_0x46f913[_0xe6d3('0x61')]['id']){delete _0x46f913[_0xe6d3('0x61')]['id'];}return db[_0xe6d3('0x43')]['find']({'where':{'id':_0x46f913['params']['id']}})['then'](handleEntityNotFound(_0x16cba2,null))[_0xe6d3('0x27')](saveUpdates(_0x46f913['body'],null))[_0xe6d3('0x27')](respondWithResult(_0x16cba2,null))[_0xe6d3('0x30')](handleError(_0x16cba2,null));};exports['destroy']=function(_0x184660,_0x19e2be){return db[_0xe6d3('0x43')][_0xe6d3('0x5f')]({'where':{'id':_0x184660[_0xe6d3('0x5e')]['id']}})['then'](handleEntityNotFound(_0x19e2be,null))[_0xe6d3('0x27')](removeEntity(_0x19e2be,null))[_0xe6d3('0x30')](handleError(_0x19e2be,null));};exports[_0xe6d3('0x62')]=function(_0x1b6f51,_0x5be215){return db['ChatGroup'][_0xe6d3('0x62')]()['then'](respondWithResult(_0x5be215,null))[_0xe6d3('0x30')](handleError(_0x5be215,null));};exports[_0xe6d3('0x63')]=function(_0x1f7eeb,_0x251535,_0x1f5160){return db[_0xe6d3('0x64')][_0xe6d3('0x35')]({'where':{'ChatGroupId':_0x1f7eeb[_0xe6d3('0x5e')]['id'],'ToId':_0x1f7eeb['user']['id'],'read':![]}})[_0xe6d3('0x27')](function(_0x2aec44){return{'id':_[_0xe6d3('0x65')](_0x1f7eeb['params']['id']),'count':_0x2aec44};})[_0xe6d3('0x27')](respondWithResult(_0x251535,null))[_0xe6d3('0x30')](handleError(_0x251535,null));};exports[_0xe6d3('0x66')]=function(_0x157e6e,_0x4a7d34,_0xbebbc1){return db[_0xe6d3('0x43')]['find']({'where':{'id':_0x157e6e[_0xe6d3('0x5e')]['id']}})[_0xe6d3('0x27')](handleEntityNotFound(_0x4a7d34,null))[_0xe6d3('0x27')](function(_0xfe25db){if(_0xfe25db){return _0xfe25db[_0xe6d3('0x66')](_0x157e6e['body'][_0xe6d3('0x67')],_[_0xe6d3('0x68')](_0x157e6e[_0xe6d3('0x61')],[_0xe6d3('0x67'),'id'])||{});}})[_0xe6d3('0x27')](respondWithResult(_0x4a7d34,null))[_0xe6d3('0x30')](handleError(_0x4a7d34,null));};exports[_0xe6d3('0x69')]=function(_0x4d851e,_0x42899f,_0x31e8c4){var _0x425936={};var _0x505583={};var _0x2cd4d0;var _0xc6f5b2;return db['ChatGroup']['findOne']({'where':{'id':_0x4d851e[_0xe6d3('0x5e')]['id']}})[_0xe6d3('0x27')](handleEntityNotFound(_0x42899f,null))[_0xe6d3('0x27')](function(_0x4943d6){if(_0x4943d6){_0x2cd4d0=_0x4943d6;_0x505583[_0xe6d3('0x4c')]=_[_0xe6d3('0x49')](db['User']['rawAttributes']);_0x505583['query']=_[_0xe6d3('0x49')](_0x4d851e[_0xe6d3('0x48')]);_0x505583['filters']=_[_0xe6d3('0x4b')](_0x505583[_0xe6d3('0x4c')],_0x505583[_0xe6d3('0x48')]);_0x425936[_0xe6d3('0x4f')]=_[_0xe6d3('0x4b')](_0x505583[_0xe6d3('0x4c')],qs[_0xe6d3('0x4d')](_0x4d851e[_0xe6d3('0x48')][_0xe6d3('0x4d')]));_0x425936[_0xe6d3('0x4f')]=_0x425936['attributes'][_0xe6d3('0x4e')]?_0x425936['attributes']:_0x505583[_0xe6d3('0x4c')];_0x425936[_0xe6d3('0x52')]=qs[_0xe6d3('0x53')](_0x4d851e[_0xe6d3('0x48')][_0xe6d3('0x53')]);_0x425936[_0xe6d3('0x54')]=qs[_0xe6d3('0x4a')](_['pick'](_0x4d851e[_0xe6d3('0x48')],_0x505583[_0xe6d3('0x4a')]));if(_0x4d851e['query'][_0xe6d3('0x56')]){_0x425936[_0xe6d3('0x54')]=_[_0xe6d3('0x57')](_0x425936['where'],{'$or':_[_0xe6d3('0x42')](_0x425936['attributes'],function(_0xfeae8){var _0x3d010a={};_0x3d010a[_0xfeae8]={'$like':'%'+_0x4d851e[_0xe6d3('0x48')][_0xe6d3('0x56')]+'%'};return _0x3d010a;})});}_0x425936=_['merge']({},_0x425936,_0x4d851e[_0xe6d3('0x58')]);return _0x2cd4d0['getMembers'](_0x425936);}})[_0xe6d3('0x27')](function(_0x252c65){if(_0x252c65){_0xc6f5b2=_0x252c65[_0xe6d3('0x4e')];if(!_0x4d851e['query'][_0xe6d3('0x50')](_0xe6d3('0x51'))){_0x425936[_0xe6d3('0x37')]=qs[_0xe6d3('0x37')](_0x4d851e[_0xe6d3('0x48')][_0xe6d3('0x37')]);_0x425936['offset']=qs[_0xe6d3('0x36')](_0x4d851e[_0xe6d3('0x48')][_0xe6d3('0x36')]);}return _0x2cd4d0[_0xe6d3('0x69')](_0x425936);}})['then'](function(_0x2aa7bc){if(_0x2aa7bc){return _0x2aa7bc?{'count':_0xc6f5b2,'rows':_0x2aa7bc}:null;}})[_0xe6d3('0x27')](respondWithResult(_0x42899f,null))[_0xe6d3('0x30')](handleError(_0x42899f,null));};exports[_0xe6d3('0x6a')]=function(_0x4fad3e,_0x3b6cd9,_0x2f913a){return db[_0xe6d3('0x43')]['find']({'where':{'id':_0x4fad3e[_0xe6d3('0x5e')]['id']}})[_0xe6d3('0x27')](handleEntityNotFound(_0x3b6cd9,null))[_0xe6d3('0x27')](function(_0x58b882){if(_0x58b882){return _0x58b882['removeMembers'](_0x4fad3e[_0xe6d3('0x48')]['ids']);}})[_0xe6d3('0x27')](respondWithStatusCode(_0x3b6cd9,null))[_0xe6d3('0x30')](handleError(_0x3b6cd9,null));};exports[_0xe6d3('0x6b')]=function(_0x3bdd1a,_0x4aa65c,_0x4e1d65){if(_0x3bdd1a[_0xe6d3('0x61')]['id']){delete _0x3bdd1a[_0xe6d3('0x61')]['id'];}return db[_0xe6d3('0x43')][_0xe6d3('0x5f')]({'where':{'id':_0x3bdd1a[_0xe6d3('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4aa65c,null))['then'](function(_0x30ebb3){if(_0x30ebb3){_0x3bdd1a[_0xe6d3('0x61')]['ChatGroupId']=_0x30ebb3['id'];return db[_0xe6d3('0x64')]['create'](_0x3bdd1a[_0xe6d3('0x61')]);}})[_0xe6d3('0x27')](respondWithResult(_0x4aa65c,null))[_0xe6d3('0x30')](handleError(_0x4aa65c,null));};exports['getMessages']=function(_0x2dce28,_0x1cba5b,_0x247428){var _0x4f1909={};var _0x1a25de={};var _0x409175;var _0xc183f9;return db[_0xe6d3('0x43')][_0xe6d3('0x6c')]({'where':{'id':_0x2dce28[_0xe6d3('0x5e')]['id']}})[_0xe6d3('0x27')](handleEntityNotFound(_0x1cba5b,null))[_0xe6d3('0x27')](function(_0xf962ce){if(_0xf962ce){_0x409175=_0xf962ce;_0x1a25de[_0xe6d3('0x4c')]=_['keys'](db[_0xe6d3('0x64')][_0xe6d3('0x44')]);_0x1a25de[_0xe6d3('0x48')]=_[_0xe6d3('0x49')](_0x2dce28[_0xe6d3('0x48')]);_0x1a25de['filters']=_[_0xe6d3('0x4b')](_0x1a25de['model'],_0x1a25de[_0xe6d3('0x48')]);_0x4f1909[_0xe6d3('0x4f')]=_[_0xe6d3('0x4b')](_0x1a25de['model'],qs[_0xe6d3('0x4d')](_0x2dce28[_0xe6d3('0x48')][_0xe6d3('0x4d')]));_0x4f1909[_0xe6d3('0x4f')]=_0x4f1909[_0xe6d3('0x4f')][_0xe6d3('0x4e')]?_0x4f1909[_0xe6d3('0x4f')]:_0x1a25de[_0xe6d3('0x4c')];_0x4f1909[_0xe6d3('0x52')]=qs[_0xe6d3('0x53')](_0x2dce28['query'][_0xe6d3('0x53')]);_0x4f1909['where']=qs[_0xe6d3('0x4a')](_['pick'](_0x2dce28[_0xe6d3('0x48')],_0x1a25de[_0xe6d3('0x4a')]));if(_0x2dce28[_0xe6d3('0x48')][_0xe6d3('0x56')]){_0x4f1909[_0xe6d3('0x54')]=_[_0xe6d3('0x57')](_0x4f1909[_0xe6d3('0x54')],{'$or':_[_0xe6d3('0x42')](_0x4f1909['attributes'],function(_0x4d1ffe){var _0x1240f9={};_0x1240f9[_0x4d1ffe]={'$like':'%'+_0x2dce28[_0xe6d3('0x48')]['filter']+'%'};return _0x1240f9;})});}if(_0x2dce28[_0xe6d3('0x48')][_0xe6d3('0x6d')]){var _0x196a0f=_0x2dce28['query'][_0xe6d3('0x6d')][_0xe6d3('0x6e')](',');var _0x2992b3={};_0x2992b3[_0x196a0f[0x0]]={'$gte':moment(_0x196a0f[0x1])['format'](_0xe6d3('0x6f'))};_0x4f1909[_0xe6d3('0x54')]=_['merge'](_0x4f1909[_0xe6d3('0x54')],_0x2992b3);}_0x4f1909=_[_0xe6d3('0x57')]({},_0x4f1909,_0x2dce28[_0xe6d3('0x58')]);return _0x409175['getMessages'](_0x4f1909);}})[_0xe6d3('0x27')](function(_0x32a5c5){if(_0x32a5c5){_0xc183f9=_0x32a5c5[_0xe6d3('0x4e')];if(!_0x2dce28[_0xe6d3('0x48')]['hasOwnProperty']('nolimit')){_0x4f1909[_0xe6d3('0x37')]=qs[_0xe6d3('0x37')](_0x2dce28[_0xe6d3('0x48')]['limit']);_0x4f1909['offset']=qs[_0xe6d3('0x36')](_0x2dce28[_0xe6d3('0x48')]['offset']);}return _0x409175[_0xe6d3('0x70')](_0x4f1909);}})[_0xe6d3('0x27')](function(_0x500889){if(_0x500889){return _0x500889?{'count':_0xc183f9,'rows':_0x500889}:null;}})['then'](respondWithResult(_0x1cba5b,null))[_0xe6d3('0x30')](handleError(_0x1cba5b,null));}; \ No newline at end of file +var _0xf6c5=['name','send','index','map','ChatGroup','fieldName','type','key','query','keys','intersection','model','fields','length','attributes','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','getUnread','toInteger','addMembers','ids','omit','User','getMembers','removeMembers','addMessage','getMessages','findOne','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','client','http','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','ChatGroup,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','set','reject','save','destroy','stack'];(function(_0x4e96d8,_0x20304f){var _0x5cb02d=function(_0x423404){while(--_0x423404){_0x4e96d8['push'](_0x4e96d8['shift']());}};_0x5cb02d(++_0x20304f);}(_0xf6c5,0x1f0));var _0x5f6c=function(_0x453583,_0x5ca1e8){_0x453583=_0x453583-0x0;var _0x3e9101=_0xf6c5[_0x453583];return _0x3e9101;};'use strict';var emlformat=require(_0x5f6c('0x0'));var rimraf=require(_0x5f6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5f6c('0x2'));var moment=require(_0x5f6c('0x3'));var BPromise=require(_0x5f6c('0x4'));var Mustache=require(_0x5f6c('0x5'));var util=require(_0x5f6c('0x6'));var path=require(_0x5f6c('0x7'));var sox=require('sox');var csv=require(_0x5f6c('0x8'));var ejs=require(_0x5f6c('0x9'));var fs=require('fs');var fs_extra=require(_0x5f6c('0xa'));var _=require('lodash');var squel=require(_0x5f6c('0xb'));var crypto=require(_0x5f6c('0xc'));var jsforce=require(_0x5f6c('0xd'));var deskjs=require(_0x5f6c('0xe'));var toCsv=require(_0x5f6c('0x8'));var querystring=require(_0x5f6c('0xf'));var Papa=require(_0x5f6c('0x10'));var Redis=require('ioredis');var authService=require(_0x5f6c('0x11'));var qs=require(_0x5f6c('0x12'));var as=require(_0x5f6c('0x13'));var hardwareService=require(_0x5f6c('0x14'));var logger=require(_0x5f6c('0x15'))(_0x5f6c('0x16'));var utils=require('../../config/utils');var config=require(_0x5f6c('0x17'));var licenseUtil=require(_0x5f6c('0x18'));var db=require(_0x5f6c('0x19'))['db'];config['redis']=_[_0x5f6c('0x1a')](config[_0x5f6c('0x1b')],{'host':_0x5f6c('0x1c'),'port':0x18eb});var socket=require(_0x5f6c('0x1d'))(new Redis(config['redis']));require(_0x5f6c('0x1e'))[_0x5f6c('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5f6c('0x20')][_0x5f6c('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x52e04e,_0x240b2c,_0x4cf80d,_0x129776){return new BPromise(function(_0xddbf5b,_0x2354c2){var _0x42c15d=_0x129776||client;return _0x42c15d['request'](_0x52e04e,_0x4cf80d)[_0x5f6c('0x22')](function(_0x1cad11){logger[_0x5f6c('0x23')]('ChatGroup,\x20%s,\x20%s',_0x240b2c,_0x5f6c('0x24'));logger[_0x5f6c('0x25')](_0x5f6c('0x26'),_0x240b2c,_0x5f6c('0x24'),JSON['stringify'](_0x1cad11));if(_0x1cad11['error']){if(_0x1cad11[_0x5f6c('0x27')]['code']===0x1f4){logger['error'](_0x5f6c('0x28'),_0x240b2c,_0x1cad11[_0x5f6c('0x27')]['message']);return _0x2354c2(_0x1cad11[_0x5f6c('0x27')][_0x5f6c('0x29')]);}logger[_0x5f6c('0x27')](_0x5f6c('0x28'),_0x240b2c,_0x1cad11[_0x5f6c('0x27')]['message']);return _0xddbf5b(_0x1cad11[_0x5f6c('0x27')][_0x5f6c('0x29')]);}else{logger[_0x5f6c('0x23')](_0x5f6c('0x28'),_0x240b2c,_0x5f6c('0x24'));_0xddbf5b(_0x1cad11[_0x5f6c('0x2a')][_0x5f6c('0x29')]);}})['catch'](function(_0x407d3a){logger[_0x5f6c('0x27')](_0x5f6c('0x28'),_0x240b2c,_0x407d3a);_0x2354c2(_0x407d3a);});});}function respondWithStatusCode(_0x22bded,_0x4ea3ee){_0x4ea3ee=_0x4ea3ee||0xcc;return function(_0x4b6d60){if(_0x4b6d60){return _0x22bded[_0x5f6c('0x2b')](_0x4ea3ee);}return _0x22bded[_0x5f6c('0x2c')](_0x4ea3ee)[_0x5f6c('0x2d')]();};}function respondWithResult(_0xbcdf54,_0xba838c){_0xba838c=_0xba838c||0xc8;return function(_0x4f23fa){if(_0x4f23fa){return _0xbcdf54[_0x5f6c('0x2c')](_0xba838c)[_0x5f6c('0x2e')](_0x4f23fa);}};}function respondWithFilteredResult(_0x3b542f,_0x931eff){return function(_0x5a2ca9){if(_0x5a2ca9){var _0x2bea3d=_0x5a2ca9[_0x5f6c('0x2f')],_0x576615=_0x931eff[_0x5f6c('0x30')],_0x4fb94a=_0x931eff['offset']+_0x931eff['limit'],_0x3265b9;if(_0x4fb94a>=_0x2bea3d){_0x4fb94a=_0x2bea3d;_0x3265b9=0xc8;}else{_0x3265b9=0xce;}_0x3b542f[_0x5f6c('0x2c')](_0x3265b9);return _0x3b542f[_0x5f6c('0x31')]('Content-Range',_0x576615+'-'+_0x4fb94a+'/'+_0x2bea3d)['json'](_0x5a2ca9);}return null;};}function patchUpdates(_0x48d006){return function(_0x2131e9){try{jsonpatch['apply'](_0x2131e9,_0x48d006,!![]);}catch(_0x47dfed){return BPromise[_0x5f6c('0x32')](_0x47dfed);}return _0x2131e9[_0x5f6c('0x33')]();};}function saveUpdates(_0x3722ac,_0x5efa37){return function(_0x45f5ca){if(_0x45f5ca){return _0x45f5ca['update'](_0x3722ac)['then'](function(_0x5a4261){return _0x5a4261;});}return null;};}function removeEntity(_0x34cdca,_0x178069){return function(_0x290ae0){if(_0x290ae0){return _0x290ae0[_0x5f6c('0x34')]()[_0x5f6c('0x22')](function(){_0x34cdca[_0x5f6c('0x2c')](0xcc)[_0x5f6c('0x2d')]();});}};}function handleEntityNotFound(_0x27effd,_0x2e31b9){return function(_0x492ba0){if(!_0x492ba0){_0x27effd[_0x5f6c('0x2b')](0x194);}return _0x492ba0;};}function handleError(_0x5b6ace,_0xf93f56){_0xf93f56=_0xf93f56||0x1f4;return function(_0x4d118a){logger[_0x5f6c('0x27')](_0x4d118a[_0x5f6c('0x35')]);if(_0x4d118a[_0x5f6c('0x36')]){delete _0x4d118a['name'];}_0x5b6ace[_0x5f6c('0x2c')](_0xf93f56)[_0x5f6c('0x37')](_0x4d118a);};}exports[_0x5f6c('0x38')]=function(_0x8c10ab,_0x3cf139){var _0x178a78={},_0x135abf={},_0x5b1972={'count':0x0,'rows':[]};var _0x116079=_[_0x5f6c('0x39')](db[_0x5f6c('0x3a')]['rawAttributes'],function(_0x4c32c2){return{'name':_0x4c32c2[_0x5f6c('0x3b')],'type':_0x4c32c2[_0x5f6c('0x3c')][_0x5f6c('0x3d')]};});_0x135abf['model']=_['map'](_0x116079,_0x5f6c('0x36'));_0x135abf[_0x5f6c('0x3e')]=_[_0x5f6c('0x3f')](_0x8c10ab[_0x5f6c('0x3e')]);_0x135abf['filters']=_[_0x5f6c('0x40')](_0x135abf[_0x5f6c('0x41')],_0x135abf[_0x5f6c('0x3e')]);_0x178a78['attributes']=_[_0x5f6c('0x40')](_0x135abf[_0x5f6c('0x41')],qs[_0x5f6c('0x42')](_0x8c10ab[_0x5f6c('0x3e')]['fields']));_0x178a78['attributes']=_0x178a78['attributes'][_0x5f6c('0x43')]?_0x178a78[_0x5f6c('0x44')]:_0x135abf[_0x5f6c('0x41')];if(!_0x8c10ab[_0x5f6c('0x3e')]['hasOwnProperty'](_0x5f6c('0x45'))){_0x178a78[_0x5f6c('0x46')]=qs['limit'](_0x8c10ab[_0x5f6c('0x3e')][_0x5f6c('0x46')]);_0x178a78['offset']=qs['offset'](_0x8c10ab[_0x5f6c('0x3e')][_0x5f6c('0x30')]);}_0x178a78[_0x5f6c('0x47')]=qs[_0x5f6c('0x48')](_0x8c10ab[_0x5f6c('0x3e')]['sort']);_0x178a78[_0x5f6c('0x49')]=qs[_0x5f6c('0x4a')](_[_0x5f6c('0x4b')](_0x8c10ab['query'],_0x135abf[_0x5f6c('0x4a')]),_0x116079);if(_0x8c10ab[_0x5f6c('0x3e')][_0x5f6c('0x4c')]){_0x178a78[_0x5f6c('0x49')]=_['merge'](_0x178a78[_0x5f6c('0x49')],{'$or':_['map'](_0x116079,function(_0x49faea){if(_0x49faea[_0x5f6c('0x3c')]!==_0x5f6c('0x4d')){var _0x4d0885={};_0x4d0885[_0x49faea[_0x5f6c('0x36')]]={'$like':'%'+_0x8c10ab[_0x5f6c('0x3e')][_0x5f6c('0x4c')]+'%'};return _0x4d0885;}})});}_0x178a78=_[_0x5f6c('0x4e')]({},_0x178a78,_0x8c10ab[_0x5f6c('0x4f')]);var _0x29e316={'where':_0x178a78['where']};return db[_0x5f6c('0x3a')][_0x5f6c('0x2f')](_0x29e316)[_0x5f6c('0x22')](function(_0x3151ef){_0x5b1972[_0x5f6c('0x2f')]=_0x3151ef;if(_0x8c10ab[_0x5f6c('0x3e')][_0x5f6c('0x50')]){_0x178a78[_0x5f6c('0x51')]=[{'all':!![]}];}return db[_0x5f6c('0x3a')][_0x5f6c('0x52')](_0x178a78);})[_0x5f6c('0x22')](function(_0x58f51f){_0x5b1972[_0x5f6c('0x53')]=_0x58f51f;return _0x5b1972;})['then'](respondWithFilteredResult(_0x3cf139,_0x178a78))[_0x5f6c('0x54')](handleError(_0x3cf139,null));};exports[_0x5f6c('0x55')]=function(_0x10f09a,_0x39977a){var _0x4ce221={'raw':!![],'where':{'id':_0x10f09a[_0x5f6c('0x56')]['id']}},_0x5c1b5e={};_0x5c1b5e[_0x5f6c('0x41')]=_['keys'](db[_0x5f6c('0x3a')][_0x5f6c('0x57')]);_0x5c1b5e[_0x5f6c('0x3e')]=_[_0x5f6c('0x3f')](_0x10f09a[_0x5f6c('0x3e')]);_0x5c1b5e[_0x5f6c('0x4a')]=_[_0x5f6c('0x40')](_0x5c1b5e[_0x5f6c('0x41')],_0x5c1b5e['query']);_0x4ce221[_0x5f6c('0x44')]=_[_0x5f6c('0x40')](_0x5c1b5e['model'],qs[_0x5f6c('0x42')](_0x10f09a[_0x5f6c('0x3e')][_0x5f6c('0x42')]));_0x4ce221[_0x5f6c('0x44')]=_0x4ce221[_0x5f6c('0x44')][_0x5f6c('0x43')]?_0x4ce221[_0x5f6c('0x44')]:_0x5c1b5e[_0x5f6c('0x41')];if(_0x10f09a[_0x5f6c('0x3e')][_0x5f6c('0x50')]){_0x4ce221[_0x5f6c('0x51')]=[{'all':!![]}];}_0x4ce221=_[_0x5f6c('0x4e')]({},_0x4ce221,_0x10f09a[_0x5f6c('0x4f')]);return db[_0x5f6c('0x3a')][_0x5f6c('0x58')](_0x4ce221)['then'](handleEntityNotFound(_0x39977a,null))[_0x5f6c('0x22')](respondWithResult(_0x39977a,null))['catch'](handleError(_0x39977a,null));};exports[_0x5f6c('0x59')]=function(_0x87ee1b,_0x57f6e9){return db['ChatGroup'][_0x5f6c('0x59')](_0x87ee1b[_0x5f6c('0x5a')],{})[_0x5f6c('0x22')](respondWithResult(_0x57f6e9,0xc9))[_0x5f6c('0x54')](handleError(_0x57f6e9,null));};exports[_0x5f6c('0x5b')]=function(_0x4cfa80,_0x88116c){if(_0x4cfa80[_0x5f6c('0x5a')]['id']){delete _0x4cfa80['body']['id'];}return db[_0x5f6c('0x3a')][_0x5f6c('0x58')]({'where':{'id':_0x4cfa80[_0x5f6c('0x56')]['id']}})[_0x5f6c('0x22')](handleEntityNotFound(_0x88116c,null))[_0x5f6c('0x22')](saveUpdates(_0x4cfa80[_0x5f6c('0x5a')],null))[_0x5f6c('0x22')](respondWithResult(_0x88116c,null))['catch'](handleError(_0x88116c,null));};exports['destroy']=function(_0x358f73,_0x5118f5){return db[_0x5f6c('0x3a')]['find']({'where':{'id':_0x358f73[_0x5f6c('0x56')]['id']}})[_0x5f6c('0x22')](handleEntityNotFound(_0x5118f5,null))[_0x5f6c('0x22')](removeEntity(_0x5118f5,null))['catch'](handleError(_0x5118f5,null));};exports[_0x5f6c('0x5c')]=function(_0x4e167c,_0x1ddcc9){return db['ChatGroup'][_0x5f6c('0x5c')]()[_0x5f6c('0x22')](respondWithResult(_0x1ddcc9,null))[_0x5f6c('0x54')](handleError(_0x1ddcc9,null));};exports[_0x5f6c('0x5d')]=function(_0x1d2546,_0x2dc3aa,_0x56c311){return db['ChatInternalMessage'][_0x5f6c('0x2f')]({'where':{'ChatGroupId':_0x1d2546[_0x5f6c('0x56')]['id'],'ToId':_0x1d2546['user']['id'],'read':![]}})[_0x5f6c('0x22')](function(_0x2e0643){return{'id':_[_0x5f6c('0x5e')](_0x1d2546[_0x5f6c('0x56')]['id']),'count':_0x2e0643};})[_0x5f6c('0x22')](respondWithResult(_0x2dc3aa,null))[_0x5f6c('0x54')](handleError(_0x2dc3aa,null));};exports[_0x5f6c('0x5f')]=function(_0x4d0497,_0x9b80ab,_0x2ce471){return db['ChatGroup'][_0x5f6c('0x58')]({'where':{'id':_0x4d0497['params']['id']}})[_0x5f6c('0x22')](handleEntityNotFound(_0x9b80ab,null))[_0x5f6c('0x22')](function(_0x5b8949){if(_0x5b8949){return _0x5b8949[_0x5f6c('0x5f')](_0x4d0497[_0x5f6c('0x5a')][_0x5f6c('0x60')],_[_0x5f6c('0x61')](_0x4d0497[_0x5f6c('0x5a')],[_0x5f6c('0x60'),'id'])||{});}})[_0x5f6c('0x22')](respondWithResult(_0x9b80ab,null))[_0x5f6c('0x54')](handleError(_0x9b80ab,null));};exports['getMembers']=function(_0x501078,_0x4f7cdf,_0x5c0662){var _0xb4d3ce={};var _0x4887cf={};var _0x249645;var _0x7fb047;return db['ChatGroup']['findOne']({'where':{'id':_0x501078['params']['id']}})[_0x5f6c('0x22')](handleEntityNotFound(_0x4f7cdf,null))[_0x5f6c('0x22')](function(_0x2732fd){if(_0x2732fd){_0x249645=_0x2732fd;_0x4887cf[_0x5f6c('0x41')]=_[_0x5f6c('0x3f')](db[_0x5f6c('0x62')][_0x5f6c('0x57')]);_0x4887cf['query']=_[_0x5f6c('0x3f')](_0x501078[_0x5f6c('0x3e')]);_0x4887cf[_0x5f6c('0x4a')]=_['intersection'](_0x4887cf[_0x5f6c('0x41')],_0x4887cf[_0x5f6c('0x3e')]);_0xb4d3ce[_0x5f6c('0x44')]=_[_0x5f6c('0x40')](_0x4887cf['model'],qs['fields'](_0x501078[_0x5f6c('0x3e')]['fields']));_0xb4d3ce['attributes']=_0xb4d3ce[_0x5f6c('0x44')][_0x5f6c('0x43')]?_0xb4d3ce[_0x5f6c('0x44')]:_0x4887cf[_0x5f6c('0x41')];_0xb4d3ce[_0x5f6c('0x47')]=qs['sort'](_0x501078[_0x5f6c('0x3e')][_0x5f6c('0x48')]);_0xb4d3ce[_0x5f6c('0x49')]=qs[_0x5f6c('0x4a')](_[_0x5f6c('0x4b')](_0x501078[_0x5f6c('0x3e')],_0x4887cf[_0x5f6c('0x4a')]));if(_0x501078['query'][_0x5f6c('0x4c')]){_0xb4d3ce['where']=_[_0x5f6c('0x4e')](_0xb4d3ce[_0x5f6c('0x49')],{'$or':_[_0x5f6c('0x39')](_0xb4d3ce[_0x5f6c('0x44')],function(_0x192dfb){var _0x1dcb24={};_0x1dcb24[_0x192dfb]={'$like':'%'+_0x501078['query'][_0x5f6c('0x4c')]+'%'};return _0x1dcb24;})});}_0xb4d3ce=_[_0x5f6c('0x4e')]({},_0xb4d3ce,_0x501078[_0x5f6c('0x4f')]);return _0x249645[_0x5f6c('0x63')](_0xb4d3ce);}})[_0x5f6c('0x22')](function(_0x2abda8){if(_0x2abda8){_0x7fb047=_0x2abda8[_0x5f6c('0x43')];if(!_0x501078[_0x5f6c('0x3e')]['hasOwnProperty']('nolimit')){_0xb4d3ce[_0x5f6c('0x46')]=qs[_0x5f6c('0x46')](_0x501078[_0x5f6c('0x3e')][_0x5f6c('0x46')]);_0xb4d3ce[_0x5f6c('0x30')]=qs[_0x5f6c('0x30')](_0x501078[_0x5f6c('0x3e')][_0x5f6c('0x30')]);}return _0x249645[_0x5f6c('0x63')](_0xb4d3ce);}})[_0x5f6c('0x22')](function(_0x3f9080){if(_0x3f9080){return _0x3f9080?{'count':_0x7fb047,'rows':_0x3f9080}:null;}})[_0x5f6c('0x22')](respondWithResult(_0x4f7cdf,null))[_0x5f6c('0x54')](handleError(_0x4f7cdf,null));};exports['removeMembers']=function(_0x4bf5e6,_0x38521d,_0xb3f6a6){return db['ChatGroup'][_0x5f6c('0x58')]({'where':{'id':_0x4bf5e6[_0x5f6c('0x56')]['id']}})[_0x5f6c('0x22')](handleEntityNotFound(_0x38521d,null))[_0x5f6c('0x22')](function(_0x268141){if(_0x268141){return _0x268141[_0x5f6c('0x64')](_0x4bf5e6[_0x5f6c('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0x38521d,null))[_0x5f6c('0x54')](handleError(_0x38521d,null));};exports[_0x5f6c('0x65')]=function(_0x5f23eb,_0x1771dd,_0x13d4f4){if(_0x5f23eb['body']['id']){delete _0x5f23eb[_0x5f6c('0x5a')]['id'];}return db[_0x5f6c('0x3a')][_0x5f6c('0x58')]({'where':{'id':_0x5f23eb['params']['id']}})['then'](handleEntityNotFound(_0x1771dd,null))[_0x5f6c('0x22')](function(_0x5df59d){if(_0x5df59d){_0x5f23eb['body']['ChatGroupId']=_0x5df59d['id'];return db['ChatInternalMessage'][_0x5f6c('0x59')](_0x5f23eb[_0x5f6c('0x5a')]);}})[_0x5f6c('0x22')](respondWithResult(_0x1771dd,null))[_0x5f6c('0x54')](handleError(_0x1771dd,null));};exports[_0x5f6c('0x66')]=function(_0xbf55c7,_0x4ca298,_0xbd57e6){var _0xf0c2d4={};var _0x404d82={};var _0x358e17;var _0x4a7263;return db[_0x5f6c('0x3a')][_0x5f6c('0x67')]({'where':{'id':_0xbf55c7[_0x5f6c('0x56')]['id']}})[_0x5f6c('0x22')](handleEntityNotFound(_0x4ca298,null))[_0x5f6c('0x22')](function(_0x385d55){if(_0x385d55){_0x358e17=_0x385d55;_0x404d82['model']=_[_0x5f6c('0x3f')](db[_0x5f6c('0x68')]['rawAttributes']);_0x404d82[_0x5f6c('0x3e')]=_[_0x5f6c('0x3f')](_0xbf55c7['query']);_0x404d82[_0x5f6c('0x4a')]=_[_0x5f6c('0x40')](_0x404d82[_0x5f6c('0x41')],_0x404d82[_0x5f6c('0x3e')]);_0xf0c2d4[_0x5f6c('0x44')]=_[_0x5f6c('0x40')](_0x404d82[_0x5f6c('0x41')],qs[_0x5f6c('0x42')](_0xbf55c7[_0x5f6c('0x3e')][_0x5f6c('0x42')]));_0xf0c2d4['attributes']=_0xf0c2d4[_0x5f6c('0x44')][_0x5f6c('0x43')]?_0xf0c2d4[_0x5f6c('0x44')]:_0x404d82[_0x5f6c('0x41')];_0xf0c2d4['order']=qs[_0x5f6c('0x48')](_0xbf55c7['query']['sort']);_0xf0c2d4[_0x5f6c('0x49')]=qs[_0x5f6c('0x4a')](_[_0x5f6c('0x4b')](_0xbf55c7[_0x5f6c('0x3e')],_0x404d82[_0x5f6c('0x4a')]));if(_0xbf55c7[_0x5f6c('0x3e')][_0x5f6c('0x4c')]){_0xf0c2d4[_0x5f6c('0x49')]=_[_0x5f6c('0x4e')](_0xf0c2d4[_0x5f6c('0x49')],{'$or':_[_0x5f6c('0x39')](_0xf0c2d4[_0x5f6c('0x44')],function(_0x316077){var _0x3a0f7b={};_0x3a0f7b[_0x316077]={'$like':'%'+_0xbf55c7[_0x5f6c('0x3e')][_0x5f6c('0x4c')]+'%'};return _0x3a0f7b;})});}if(_0xbf55c7[_0x5f6c('0x3e')][_0x5f6c('0x69')]){var _0x3a42ca=_0xbf55c7[_0x5f6c('0x3e')][_0x5f6c('0x69')][_0x5f6c('0x6a')](',');var _0x1b4424={};_0x1b4424[_0x3a42ca[0x0]]={'$gte':moment(_0x3a42ca[0x1])[_0x5f6c('0x6b')](_0x5f6c('0x6c'))};_0xf0c2d4['where']=_[_0x5f6c('0x4e')](_0xf0c2d4['where'],_0x1b4424);}_0xf0c2d4=_[_0x5f6c('0x4e')]({},_0xf0c2d4,_0xbf55c7['options']);return _0x358e17[_0x5f6c('0x66')](_0xf0c2d4);}})['then'](function(_0x3e4e3b){if(_0x3e4e3b){_0x4a7263=_0x3e4e3b[_0x5f6c('0x43')];if(!_0xbf55c7[_0x5f6c('0x3e')][_0x5f6c('0x6d')](_0x5f6c('0x45'))){_0xf0c2d4[_0x5f6c('0x46')]=qs[_0x5f6c('0x46')](_0xbf55c7['query']['limit']);_0xf0c2d4[_0x5f6c('0x30')]=qs[_0x5f6c('0x30')](_0xbf55c7[_0x5f6c('0x3e')][_0x5f6c('0x30')]);}return _0x358e17[_0x5f6c('0x66')](_0xf0c2d4);}})['then'](function(_0x5d44cf){if(_0x5d44cf){return _0x5d44cf?{'count':_0x4a7263,'rows':_0x5d44cf}:null;}})['then'](respondWithResult(_0x4ca298,null))[_0x5f6c('0x54')](handleError(_0x4ca298,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 6fdd951..6d9d93c 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 _0xdb28=['ChatGroup','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x29c614,_0xb4f144){var _0x255d3d=function(_0x5dd95a){while(--_0x5dd95a){_0x29c614['push'](_0x29c614['shift']());}};_0x255d3d(++_0xb4f144);}(_0xdb28,0x106));var _0x8db2=function(_0x3da5e6,_0x28387e){_0x3da5e6=_0x3da5e6-0x0;var _0x5e2069=_0xdb28[_0x3da5e6];return _0x5e2069;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var ChatGroup=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xdb28=['ChatGroup','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x258102,_0x49505d){var _0x3dc2ed=function(_0x13ecc2){while(--_0x13ecc2){_0x258102['push'](_0x258102['shift']());}};_0x3dc2ed(++_0x49505d);}(_0xdb28,0x106));var _0x8db2=function(_0x468fac,_0x47d410){_0x468fac=_0x468fac-0x0;var _0x1470a3=_0xdb28[_0x468fac];return _0x1470a3;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var ChatGroup=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 7437fb0..865aab3 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 _0x6dc0=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatGroup.attributes','ChatGroup'];(function(_0x58fb83,_0x297a48){var _0x419b2f=function(_0x5425a8){while(--_0x5425a8){_0x58fb83['push'](_0x58fb83['shift']());}};_0x419b2f(++_0x297a48);}(_0x6dc0,0x18c));var _0x06dc=function(_0x5eb581,_0x2efdc2){_0x5eb581=_0x5eb581-0x0;var _0x523691=_0x6dc0[_0x5eb581];return _0x523691;};'use strict';var _=require(_0x06dc('0x0'));var util=require('util');var logger=require(_0x06dc('0x1'))(_0x06dc('0x2'));var moment=require(_0x06dc('0x3'));var BPromise=require(_0x06dc('0x4'));var rp=require(_0x06dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x06dc('0x6'));var attributes=require(_0x06dc('0x7'));module['exports']=function(_0x45a093,_0x26b287){return _0x45a093['define'](_0x06dc('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4074=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup'];(function(_0x15a26e,_0x334582){var _0x25bef6=function(_0x2fab4f){while(--_0x2fab4f){_0x15a26e['push'](_0x15a26e['shift']());}};_0x25bef6(++_0x334582);}(_0x4074,0xf0));var _0x4407=function(_0x4b8420,_0x4b4419){_0x4b8420=_0x4b8420-0x0;var _0x488bb5=_0x4074[_0x4b8420];return _0x488bb5;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var logger=require(_0x4407('0x2'))('api');var moment=require(_0x4407('0x3'));var BPromise=require(_0x4407('0x4'));var rp=require(_0x4407('0x5'));var fs=require('fs');var path=require(_0x4407('0x6'));var rimraf=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var attributes=require(_0x4407('0x9'));module[_0x4407('0xa')]=function(_0x3f085d,_0x35899d){return _0x3f085d['define'](_0x4407('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 8b7b555..d991fb6 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 _0x4fb8=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x4fb8,0x78));var _0x84fb=function(_0x1a5c1e,_0x488b11){_0x1a5c1e=_0x1a5c1e-0x0;var _0x3e15b4=_0x4fb8[_0x1a5c1e];return _0x3e15b4;};'use strict';var _=require(_0x84fb('0x0'));var util=require(_0x84fb('0x1'));var moment=require(_0x84fb('0x2'));var BPromise=require(_0x84fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84fb('0x4'));var db=require(_0x84fb('0x5'))['db'];var utils=require(_0x84fb('0x6'));var logger=require('../../config/logger')(_0x84fb('0x7'));var config=require(_0x84fb('0x8'));var jayson=require(_0x84fb('0x9'));var client=jayson[_0x84fb('0xa')][_0x84fb('0xb')]({'port':0x232a});config[_0x84fb('0xc')]=_[_0x84fb('0xd')](config[_0x84fb('0xc')],{'host':_0x84fb('0xe'),'port':0x18eb});var socket=require(_0x84fb('0xf'))(new Redis(config[_0x84fb('0xc')]));require(_0x84fb('0x10'))[_0x84fb('0x11')](socket);function respondWithRpcPromise(_0x41b378,_0x1f04ce,_0x46fd8c){return new BPromise(function(_0x4475c7,_0x4f2545){return client[_0x84fb('0x12')](_0x41b378,_0x46fd8c)['then'](function(_0x48cb4d){logger['info'](_0x84fb('0x13'),_0x1f04ce,_0x84fb('0x14'));logger[_0x84fb('0x15')](_0x84fb('0x16'),_0x1f04ce,_0x84fb('0x14'),JSON[_0x84fb('0x17')](_0x48cb4d));if(_0x48cb4d[_0x84fb('0x18')]){if(_0x48cb4d[_0x84fb('0x18')][_0x84fb('0x19')]===0x1f4){logger[_0x84fb('0x18')](_0x84fb('0x13'),_0x1f04ce,_0x48cb4d[_0x84fb('0x18')]['message']);return _0x4f2545(_0x48cb4d[_0x84fb('0x18')][_0x84fb('0x1a')]);}logger[_0x84fb('0x18')]('ChatGroup,\x20%s,\x20%s',_0x1f04ce,_0x48cb4d[_0x84fb('0x18')][_0x84fb('0x1a')]);return _0x4475c7(_0x48cb4d[_0x84fb('0x18')][_0x84fb('0x1a')]);}else{logger['info'](_0x84fb('0x13'),_0x1f04ce,_0x84fb('0x14'));_0x4475c7(_0x48cb4d[_0x84fb('0x1b')][_0x84fb('0x1a')]);}})[_0x84fb('0x1c')](function(_0x25b3b0){logger[_0x84fb('0x18')]('ChatGroup,\x20%s,\x20%s',_0x1f04ce,_0x25b3b0);_0x4f2545(_0x25b3b0);});});} \ No newline at end of file +var _0xfa29=['./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis'];(function(_0xd2d993,_0x2ec36c){var _0x296464=function(_0x2cae7e){while(--_0x2cae7e){_0xd2d993['push'](_0xd2d993['shift']());}};_0x296464(++_0x2ec36c);}(_0xfa29,0x185));var _0x9fa2=function(_0x593787,_0x462df7){_0x593787=_0x593787-0x0;var _0x330f09=_0xfa29[_0x593787];return _0x330f09;};'use strict';var _=require('lodash');var util=require(_0x9fa2('0x0'));var moment=require(_0x9fa2('0x1'));var BPromise=require(_0x9fa2('0x2'));var rs=require(_0x9fa2('0x3'));var fs=require('fs');var Redis=require(_0x9fa2('0x4'));var db=require(_0x9fa2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9fa2('0x6'))(_0x9fa2('0x7'));var config=require(_0x9fa2('0x8'));var jayson=require(_0x9fa2('0x9'));var client=jayson[_0x9fa2('0xa')][_0x9fa2('0xb')]({'port':0x232a});config['redis']=_[_0x9fa2('0xc')](config['redis'],{'host':_0x9fa2('0xd'),'port':0x18eb});var socket=require(_0x9fa2('0xe'))(new Redis(config[_0x9fa2('0xf')]));require(_0x9fa2('0x10'))[_0x9fa2('0x11')](socket);function respondWithRpcPromise(_0x14b634,_0x327872,_0x42592c){return new BPromise(function(_0x16cf5e,_0x3a444f){return client['request'](_0x14b634,_0x42592c)[_0x9fa2('0x12')](function(_0x6beb20){logger[_0x9fa2('0x13')](_0x9fa2('0x14'),_0x327872,_0x9fa2('0x15'));logger[_0x9fa2('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x327872,'request\x20sent',JSON['stringify'](_0x6beb20));if(_0x6beb20[_0x9fa2('0x17')]){if(_0x6beb20['error']['code']===0x1f4){logger[_0x9fa2('0x17')](_0x9fa2('0x14'),_0x327872,_0x6beb20[_0x9fa2('0x17')][_0x9fa2('0x18')]);return _0x3a444f(_0x6beb20[_0x9fa2('0x17')]['message']);}logger['error'](_0x9fa2('0x14'),_0x327872,_0x6beb20[_0x9fa2('0x17')][_0x9fa2('0x18')]);return _0x16cf5e(_0x6beb20[_0x9fa2('0x17')][_0x9fa2('0x18')]);}else{logger[_0x9fa2('0x13')](_0x9fa2('0x14'),_0x327872,_0x9fa2('0x15'));_0x16cf5e(_0x6beb20[_0x9fa2('0x19')]['message']);}})[_0x9fa2('0x1a')](function(_0x4386fb){logger[_0x9fa2('0x17')](_0x9fa2('0x14'),_0x327872,_0x4386fb);_0x3a444f(_0x4386fb);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index ae15136..baf8c9b 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 _0x0a02=['emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','update'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x0a02,0x1bd));var _0x20a0=function(_0x3d27a,_0x31311d){_0x3d27a=_0x3d27a-0x0;var _0x314fd7=_0x0a02[_0x3d27a];return _0x314fd7;};'use strict';var ChatGroupEvents=require(_0x20a0('0x0'));var events=[_0x20a0('0x1'),'remove',_0x20a0('0x2')];function createListener(_0x232a6c,_0x8e0192){return function(_0x112d16){_0x8e0192[_0x20a0('0x3')](_0x232a6c,_0x112d16);};}function removeListener(_0x284a2f,_0x2523c1){return function(){ChatGroupEvents[_0x20a0('0x4')](_0x284a2f,_0x2523c1);};}exports[_0x20a0('0x5')]=function(_0x193ae1){for(var _0xde0166=0x0,_0x3341d7=events[_0x20a0('0x6')];_0xde0166<_0x3341d7;_0xde0166++){var _0x48c7c3=events[_0xde0166];var _0x6f28aa=createListener(_0x20a0('0x7')+_0x48c7c3,_0x193ae1);ChatGroupEvents['on'](_0x48c7c3,_0x6f28aa);}}; \ No newline at end of file +var _0x16da=['update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','remove'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x16da,0xe6));var _0xa16d=function(_0x45d6c8,_0x3d38bc){_0x45d6c8=_0x45d6c8-0x0;var _0x4692fd=_0x16da[_0x45d6c8];return _0x4692fd;};'use strict';var ChatGroupEvents=require(_0xa16d('0x0'));var events=['save',_0xa16d('0x1'),_0xa16d('0x2')];function createListener(_0x5a5efb,_0x3fe093){return function(_0x51cd3e){_0x3fe093[_0xa16d('0x3')](_0x5a5efb,_0x51cd3e);};}function removeListener(_0x80f223,_0x588e4a){return function(){ChatGroupEvents[_0xa16d('0x4')](_0x80f223,_0x588e4a);};}exports[_0xa16d('0x5')]=function(_0x5b84e2){for(var _0x339f29=0x0,_0x439518=events[_0xa16d('0x6')];_0x339f29<_0x439518;_0x339f29++){var _0xb6752=events[_0x339f29];var _0x2ed303=createListener(_0xa16d('0x7')+_0xb6752,_0x5b84e2);ChatGroupEvents['on'](_0xb6752,_0x2ed303);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 561f1d3..b14b3fa 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 _0xdade=['removeMembers','exports','util','path','Router','fs-extra','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','describe','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','destroy','delete'];(function(_0x28f812,_0x3769b4){var _0x19b195=function(_0x538faf){while(--_0x538faf){_0x28f812['push'](_0x28f812['shift']());}};_0x19b195(++_0x3769b4);}(_0xdade,0x13a));var _0xedad=function(_0x596053,_0x1a9efd){_0x596053=_0x596053-0x0;var _0x1fb180=_0xdade[_0x596053];return _0x1fb180;};'use strict';var multer=require('multer');var util=require(_0xedad('0x0'));var path=require(_0xedad('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xedad('0x2')]();var fs_extra=require(_0xedad('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xedad('0x4'));var config=require('../../config/environment');var controller=require(_0xedad('0x5'));router[_0xedad('0x6')]('/',auth[_0xedad('0x7')](),controller['index']);router[_0xedad('0x6')](_0xedad('0x8'),auth[_0xedad('0x7')](),controller[_0xedad('0x9')]);router['get']('/:id',auth[_0xedad('0x7')](),controller[_0xedad('0xa')]);router[_0xedad('0x6')](_0xedad('0xb'),auth[_0xedad('0x7')](),controller[_0xedad('0xc')]);router['get'](_0xedad('0xd'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0xedad('0xe'),auth[_0xedad('0x7')](),controller[_0xedad('0xf')]);router[_0xedad('0x10')]('/',auth[_0xedad('0x7')](),controller[_0xedad('0x11')]);router[_0xedad('0x10')]('/:id/members',auth[_0xedad('0x7')](),controller[_0xedad('0x12')]);router[_0xedad('0x10')](_0xedad('0xe'),auth['isAuthenticated'](),controller[_0xedad('0x13')]);router[_0xedad('0x14')](_0xedad('0x15'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xedad('0x15'),auth[_0xedad('0x7')](),controller[_0xedad('0x16')]);router[_0xedad('0x17')](_0xedad('0xd'),auth[_0xedad('0x7')](),controller[_0xedad('0x18')]);module[_0xedad('0x19')]=router; \ No newline at end of file +var _0x611f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','addMembers','/:id'];(function(_0x199d7c,_0x3cadb8){var _0x5ef59b=function(_0x2fdf9f){while(--_0x2fdf9f){_0x199d7c['push'](_0x199d7c['shift']());}};_0x5ef59b(++_0x3cadb8);}(_0x611f,0x1ac));var _0xf611=function(_0x53f524,_0x3ed404){_0x53f524=_0x53f524-0x0;var _0x12f9f9=_0x611f[_0x53f524];return _0x12f9f9;};'use strict';var multer=require(_0xf611('0x0'));var util=require('util');var path=require(_0xf611('0x1'));var timeout=require(_0xf611('0x2'));var express=require(_0xf611('0x3'));var router=express['Router']();var fs_extra=require(_0xf611('0x4'));var auth=require(_0xf611('0x5'));var interaction=require(_0xf611('0x6'));var config=require('../../config/environment');var controller=require(_0xf611('0x7'));router[_0xf611('0x8')]('/',auth[_0xf611('0x9')](),controller[_0xf611('0xa')]);router['get'](_0xf611('0xb'),auth[_0xf611('0x9')](),controller[_0xf611('0xc')]);router[_0xf611('0x8')]('/:id',auth[_0xf611('0x9')](),controller[_0xf611('0xd')]);router[_0xf611('0x8')](_0xf611('0xe'),auth[_0xf611('0x9')](),controller[_0xf611('0xf')]);router['get'](_0xf611('0x10'),auth[_0xf611('0x9')](),controller[_0xf611('0x11')]);router[_0xf611('0x8')](_0xf611('0x12'),auth[_0xf611('0x9')](),controller['getMessages']);router[_0xf611('0x13')]('/',auth[_0xf611('0x9')](),controller['create']);router[_0xf611('0x13')](_0xf611('0x10'),auth['isAuthenticated'](),controller[_0xf611('0x14')]);router[_0xf611('0x13')](_0xf611('0x12'),auth[_0xf611('0x9')](),controller['addMessage']);router['put'](_0xf611('0x15'),auth[_0xf611('0x9')](),controller[_0xf611('0x16')]);router[_0xf611('0x17')](_0xf611('0x15'),auth[_0xf611('0x9')](),controller[_0xf611('0x18')]);router[_0xf611('0x17')](_0xf611('0x10'),auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index cdde828..29292e4 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 _0x4232=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out','sequelize','exports'];(function(_0xf98908,_0x3948f1){var _0x54dcc1=function(_0xbcbea5){while(--_0xbcbea5){_0xf98908['push'](_0xf98908['shift']());}};_0x54dcc1(++_0x3948f1);}(_0x4232,0x1d7));var _0x2423=function(_0x4b98f8,_0x478f5c){_0x4b98f8=_0x4b98f8-0x0;var _0x4e3f64=_0x4232[_0x4b98f8];return _0x4e3f64;};'use strict';var Sequelize=require(_0x2423('0x0'));module[_0x2423('0x1')]={'closed':{'type':Sequelize[_0x2423('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2423('0x3')]},'ratingType':{'type':Sequelize[_0x2423('0x4')](_0x2423('0x5'),_0x2423('0x6')),'defaultValue':_0x2423('0x5')},'ratingMessage':{'type':Sequelize[_0x2423('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x2423('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2423('0x8')]},'secondDisposition':{'type':Sequelize[_0x2423('0x8')]},'thirdDisposition':{'type':Sequelize[_0x2423('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2423('0x8')]},'browserVersion':{'type':Sequelize[_0x2423('0x8')]},'osName':{'type':Sequelize[_0x2423('0x8')]},'osVersion':{'type':Sequelize[_0x2423('0x8')]},'deviceModel':{'type':Sequelize[_0x2423('0x8')]},'deviceVendor':{'type':Sequelize[_0x2423('0x8')]},'deviceType':{'type':Sequelize[_0x2423('0x8')]},'referer':{'type':Sequelize[_0x2423('0x7')]},'customerIp':{'type':Sequelize[_0x2423('0x8')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x2423('0x9')]},'lastMsgAt':{'type':Sequelize[_0x2423('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2423('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2423('0x8')]},'customerPort':{'type':Sequelize[_0x2423('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x2423('0x7')]}}; \ No newline at end of file +var _0x7d2c=['ENUM','star','thumb','TEXT','DATE','STRING','long','out','sequelize','exports','BOOLEAN','INTEGER'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7d2c,0x11c));var _0xc7d2=function(_0x1d34e3,_0x4f5844){_0x1d34e3=_0x1d34e3-0x0;var _0x34266b=_0x7d2c[_0x1d34e3];return _0x34266b;};'use strict';var Sequelize=require(_0xc7d2('0x0'));module[_0xc7d2('0x1')]={'closed':{'type':Sequelize[_0xc7d2('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc7d2('0x3')]},'ratingType':{'type':Sequelize[_0xc7d2('0x4')](_0xc7d2('0x5'),_0xc7d2('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xc7d2('0x7')]},'pathTranscript':{'type':Sequelize[_0xc7d2('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc7d2('0x8')]},'disposition':{'type':Sequelize[_0xc7d2('0x9')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc7d2('0x9')]},'note':{'type':Sequelize[_0xc7d2('0x9')]},'browserName':{'type':Sequelize[_0xc7d2('0x9')]},'browserVersion':{'type':Sequelize[_0xc7d2('0x9')]},'osName':{'type':Sequelize[_0xc7d2('0x9')]},'osVersion':{'type':Sequelize[_0xc7d2('0x9')]},'deviceModel':{'type':Sequelize[_0xc7d2('0x9')]},'deviceVendor':{'type':Sequelize[_0xc7d2('0x9')]},'deviceType':{'type':Sequelize[_0xc7d2('0x9')]},'referer':{'type':Sequelize[_0xc7d2('0x7')]},'customerIp':{'type':Sequelize[_0xc7d2('0x9')]},'formData':{'type':Sequelize[_0xc7d2('0x7')](_0xc7d2('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xc7d2('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc7d2('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc7d2('0x9')]},'customerPort':{'type':Sequelize[_0xc7d2('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xc7d2('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 8f609ec..9aa198a 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 _0xc2f6=['getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','ChatWebsiteId','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','catch','show','fields','includeAll','include','options','create','params','destroy','describe','findOne','ChatWebsite','vidaooApiKey','POST','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','file','filename','mimetype','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','ContactId','Messages','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','Owner','mkdirSync','Chat','Account','N.A.','disposition','browserName','osName','customerIp','customerPort','tail','basename','existsSync','pipe','createWriteStream','renderFile','views','downloadInteraction.html','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','status','end','json','count','offset','limit','set','apply','update','sendStatus','name','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','select','field','color','tools_tags','u.fullname','from','user_has_chat_interactions','left_join','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact'];(function(_0xdc9b7a,_0x25aa10){var _0x300c0e=function(_0x3c9eef){while(--_0x3c9eef){_0xdc9b7a['push'](_0xdc9b7a['shift']());}};_0x300c0e(++_0x25aa10);}(_0xc2f6,0xc9));var _0x6c2f=function(_0x35b23c,_0x19eebd){_0x35b23c=_0x35b23c-0x0;var _0x32b861=_0xc2f6[_0x35b23c];return _0x32b861;};'use strict';var emlformat=require(_0x6c2f('0x0'));var rimraf=require(_0x6c2f('0x1'));var zipdir=require(_0x6c2f('0x2'));var jsonpatch=require(_0x6c2f('0x3'));var rp=require(_0x6c2f('0x4'));var moment=require('moment');var BPromise=require(_0x6c2f('0x5'));var Mustache=require(_0x6c2f('0x6'));var util=require(_0x6c2f('0x7'));var path=require(_0x6c2f('0x8'));var sox=require(_0x6c2f('0x9'));var csv=require(_0x6c2f('0xa'));var ejs=require(_0x6c2f('0xb'));var fs=require('fs');var fs_extra=require(_0x6c2f('0xc'));var _=require(_0x6c2f('0xd'));var squel=require('squel');var crypto=require(_0x6c2f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6c2f('0xf'));var Papa=require(_0x6c2f('0x10'));var Redis=require(_0x6c2f('0x11'));var authService=require(_0x6c2f('0x12'));var qs=require(_0x6c2f('0x13'));var as=require(_0x6c2f('0x14'));var pdf=require(_0x6c2f('0x15'));var hardwareService=require(_0x6c2f('0x16'));var logger=require(_0x6c2f('0x17'))(_0x6c2f('0x18'));var utils=require('../../config/utils');var config=require(_0x6c2f('0x19'));var licenseUtil=require(_0x6c2f('0x1a'));var db=require(_0x6c2f('0x1b'))['db'];config[_0x6c2f('0x1c')]=_[_0x6c2f('0x1d')](config[_0x6c2f('0x1c')],{'host':_0x6c2f('0x1e'),'port':0x18eb});var socket=require(_0x6c2f('0x1f'))(new Redis(config[_0x6c2f('0x1c')]));require(_0x6c2f('0x20'))[_0x6c2f('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6c2f('0x22')][_0x6c2f('0x23')]({'port':0x232b});var client9004=jayson['client'][_0x6c2f('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x342e35,_0x2a5511,_0x284a36,_0x49c256){return new BPromise(function(_0x760fa6,_0x5c60c3){var _0xf5f7e9=_0x49c256||client;return _0xf5f7e9[_0x6c2f('0x24')](_0x342e35,_0x284a36)[_0x6c2f('0x25')](function(_0x298bee){logger['info'](_0x6c2f('0x26'),_0x2a5511,_0x6c2f('0x27'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2a5511,_0x6c2f('0x27'),JSON[_0x6c2f('0x28')](_0x298bee));if(_0x298bee[_0x6c2f('0x29')]){if(_0x298bee[_0x6c2f('0x29')][_0x6c2f('0x2a')]===0x1f4){logger[_0x6c2f('0x29')](_0x6c2f('0x26'),_0x2a5511,_0x298bee[_0x6c2f('0x29')]['message']);return _0x5c60c3(_0x298bee[_0x6c2f('0x29')][_0x6c2f('0x2b')]);}logger[_0x6c2f('0x29')](_0x6c2f('0x26'),_0x2a5511,_0x298bee[_0x6c2f('0x29')][_0x6c2f('0x2b')]);return _0x760fa6(_0x298bee[_0x6c2f('0x29')]['message']);}else{logger[_0x6c2f('0x2c')](_0x6c2f('0x26'),_0x2a5511,'request\x20sent');_0x760fa6(_0x298bee['result'][_0x6c2f('0x2b')]);}})['catch'](function(_0x401c53){logger[_0x6c2f('0x29')](_0x6c2f('0x26'),_0x2a5511,_0x401c53);_0x5c60c3(_0x401c53);});});}function respondWithStatusCode(_0x2e5c19,_0x1c1f84){_0x1c1f84=_0x1c1f84||0xcc;return function(_0x274ffe){if(_0x274ffe){return _0x2e5c19['sendStatus'](_0x1c1f84);}return _0x2e5c19[_0x6c2f('0x2d')](_0x1c1f84)[_0x6c2f('0x2e')]();};}function respondWithResult(_0x472b1d,_0x3c0820){_0x3c0820=_0x3c0820||0xc8;return function(_0x3f84b2){if(_0x3f84b2){return _0x472b1d[_0x6c2f('0x2d')](_0x3c0820)[_0x6c2f('0x2f')](_0x3f84b2);}};}function respondWithFilteredResult(_0x5e5526,_0xf9c003){return function(_0x174828){if(_0x174828){var _0x393e01=_0x174828[_0x6c2f('0x30')],_0x5ba800=_0xf9c003[_0x6c2f('0x31')],_0xc9fa0f=_0xf9c003[_0x6c2f('0x31')]+_0xf9c003[_0x6c2f('0x32')],_0x565b04;if(_0xc9fa0f>=_0x393e01){_0xc9fa0f=_0x393e01;_0x565b04=0xc8;}else{_0x565b04=0xce;}_0x5e5526[_0x6c2f('0x2d')](_0x565b04);return _0x5e5526[_0x6c2f('0x33')]('Content-Range',_0x5ba800+'-'+_0xc9fa0f+'/'+_0x393e01)['json'](_0x174828);}return null;};}function patchUpdates(_0x3f1859){return function(_0x384599){try{jsonpatch[_0x6c2f('0x34')](_0x384599,_0x3f1859,!![]);}catch(_0x57d8c8){return BPromise['reject'](_0x57d8c8);}return _0x384599['save']();};}function saveUpdates(_0x3ad680,_0x4b1f29){return function(_0x115987){if(_0x115987){return _0x115987[_0x6c2f('0x35')](_0x3ad680)[_0x6c2f('0x25')](function(_0x5ed02c){return _0x5ed02c;});}return null;};}function removeEntity(_0x3c5ac2,_0x3fba41){return function(_0x1f9f0b){if(_0x1f9f0b){return _0x1f9f0b['destroy']()[_0x6c2f('0x25')](function(){_0x3c5ac2[_0x6c2f('0x2d')](0xcc)[_0x6c2f('0x2e')]();});}};}function handleEntityNotFound(_0x30124d,_0x143aa8){return function(_0x3f4334){if(!_0x3f4334){_0x30124d[_0x6c2f('0x36')](0x194);}return _0x3f4334;};}function handleError(_0x4887d9,_0x272fb4){_0x272fb4=_0x272fb4||0x1f4;return function(_0x1cef02){logger[_0x6c2f('0x29')](_0x1cef02['stack']);if(_0x1cef02['name']){delete _0x1cef02[_0x6c2f('0x37')];}_0x4887d9['status'](_0x272fb4)['send'](_0x1cef02);};}function getInteractionUsers(_0x1aa7c0,_0x1b52c9){return new BPromise(function(_0x1a9adf,_0x25ca6d){try{if(_0x1b52c9[_0x1aa7c0['id']]){_0x1aa7c0['Users']=_[_0x6c2f('0x38')](_0x1b52c9[_0x1aa7c0['id']],function(_0x564322){return{'id':_0x564322['id'],'fullname':_0x564322[_0x6c2f('0x39')]};});}}catch(_0x193839){_0x25ca6d(_0x193839);}_0x1a9adf(_0x1aa7c0);});}function getInteractionTags(_0x27b0f6,_0x13069c){return new BPromise(function(_0x492a48,_0x2f47da){try{if(_0x27b0f6[_0x6c2f('0x3a')]){_0x27b0f6[_0x6c2f('0x3b')]=[];_0x27b0f6[_0x6c2f('0x3a')][_0x6c2f('0x3c')](',')[_0x6c2f('0x3d')](function(_0x736fd9){_0x27b0f6[_0x6c2f('0x3b')][_0x6c2f('0x3e')](_0x13069c[_0x736fd9]);});}delete _0x27b0f6['TagIds'];}catch(_0x3e4e50){_0x2f47da(_0x3e4e50);}_0x492a48(_0x27b0f6);});}function updateChatInteraction(_0x958904,_0xd591cd,_0x35a0bc){return new BPromise(function(_0x193e5b,_0x7d54a){return getInteractionUsers(_0x958904,_0x35a0bc)[_0x6c2f('0x25')](function(_0x24cb62){return getInteractionTags(_0x24cb62,_0xd591cd);})[_0x6c2f('0x25')](function(_0x3ac038){_0x193e5b(_0x3ac038);})['catch'](function(_0x27ba88){_0x7d54a(_0x27ba88);});});}exports[_0x6c2f('0x3f')]=function(_0x85b7d6,_0x58d201){var _0x55191e={},_0x5a7afe={},_0x388184={'count':0x0,'rows':[]};var _0x57f1de=_[_0x6c2f('0x38')](db[_0x6c2f('0x40')][_0x6c2f('0x41')],function(_0x5d2e4d){return{'name':_0x5d2e4d[_0x6c2f('0x42')],'type':_0x5d2e4d[_0x6c2f('0x43')][_0x6c2f('0x44')]};});_0x5a7afe[_0x6c2f('0x45')]=_[_0x6c2f('0x38')](_0x57f1de,'name');_0x5a7afe[_0x6c2f('0x46')]=_[_0x6c2f('0x47')](_0x85b7d6[_0x6c2f('0x46')]);_0x5a7afe['filters']=_[_0x6c2f('0x48')](_0x5a7afe[_0x6c2f('0x45')],_0x5a7afe[_0x6c2f('0x46')]);_0x55191e[_0x6c2f('0x49')]=_[_0x6c2f('0x48')](_0x5a7afe[_0x6c2f('0x45')],qs['fields'](_0x85b7d6[_0x6c2f('0x46')]['fields']));_0x55191e[_0x6c2f('0x49')]=_0x55191e['attributes'][_0x6c2f('0x4a')]?_0x55191e[_0x6c2f('0x49')]:_0x5a7afe[_0x6c2f('0x45')];if(!_0x85b7d6[_0x6c2f('0x46')]['hasOwnProperty'](_0x6c2f('0x4b'))){_0x55191e[_0x6c2f('0x32')]=qs[_0x6c2f('0x32')](_0x85b7d6['query'][_0x6c2f('0x32')]);_0x55191e['offset']=qs['offset'](_0x85b7d6['query']['offset']);}_0x55191e[_0x6c2f('0x4c')]=qs[_0x6c2f('0x4d')](_0x85b7d6['query']['sort']);_0x55191e[_0x6c2f('0x4e')]=qs[_0x6c2f('0x4f')](_[_0x6c2f('0x50')](_0x85b7d6['query'],_0x5a7afe[_0x6c2f('0x4f')]),_0x57f1de);var _0x3c1147=[];var _0x22f972=squel[_0x6c2f('0x51')]()[_0x6c2f('0x52')]('id')[_0x6c2f('0x52')](_0x6c2f('0x37'))[_0x6c2f('0x52')](_0x6c2f('0x53'))['from'](_0x6c2f('0x54'));var _0x48f56f=squel[_0x6c2f('0x51')]()['field']('u.id')['field'](_0x6c2f('0x55'))[_0x6c2f('0x52')]('ui.ChatInteractionId')[_0x6c2f('0x56')](_0x6c2f('0x57'),'ui')[_0x6c2f('0x58')]('users','u','u.id\x20=\x20ui.UserId');var _0x2cdfd8=squel[_0x6c2f('0x51')]()[_0x6c2f('0x56')](_0x6c2f('0x59'),'i')['left_join']('cm_contacts','c',_0x6c2f('0x5a'))[_0x6c2f('0x58')]('users','o',_0x6c2f('0x5b'))[_0x6c2f('0x58')](_0x6c2f('0x5c'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x6c2f('0x5d'),'me',_0x6c2f('0x5e'))[_0x6c2f('0x58')](_0x6c2f('0x5f'),'it',_0x6c2f('0x60'))['left_join'](_0x6c2f('0x54'),'t',_0x6c2f('0x61'));var _0x4dc59a=squel['expr']();var _0x2aeea6=[];var _0x25da05=squel[_0x6c2f('0x62')]();var _0x54c5a5;if(_0x85b7d6['query'][_0x6c2f('0x63')]){_0x54c5a5=as[_0x6c2f('0x64')](_0x85b7d6[_0x6c2f('0x46')]['search']);var _0xdd6b31=_0x54c5a5[_0x6c2f('0x65')];for(var _0x382634=0x0;_0x382634<_0x54c5a5[_0x6c2f('0x66')][_0x6c2f('0x4a')];_0x382634++){var _0x260cd8=_0x54c5a5[_0x6c2f('0x66')][_0x382634];var _0x477305='i';var _0x2b51da=_[_0x6c2f('0x67')](_0x57f1de,[_0x6c2f('0x37'),_0x260cd8['field']]);if(!_0x2b51da){switch(_0x260cd8['field']){case'unreadMessages':if(_0x260cd8[_0x6c2f('0x68')]==0x1){_0x2cdfd8[_0x6c2f('0x69')]('`'+_0x260cd8[_0x6c2f('0x52')]+_0x6c2f('0x6a'));}else{_0x2cdfd8[_0x6c2f('0x69')]('`'+_0x260cd8[_0x6c2f('0x52')]+_0x6c2f('0x6b'));}break;case _0x6c2f('0x6c'):if(_0x260cd8['operator']==='$substring'){if(_0x260cd8['value']['split']('\x20')[_0x6c2f('0x4a')]>0x1){_0x4dc59a[_0xdd6b31]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6c2f('0x6d')](_0x260cd8[_0x6c2f('0x68')]),null);}else{var _0x4c9281='%'+_0x260cd8[_0x6c2f('0x68')]+'%';_0x4dc59a[_0xdd6b31](_0x6c2f('0x6e'),_0x4c9281,_0x4c9281,_0x4c9281);}}else{_0x2b51da=_['find'](_0x57f1de,['name','ContactId']);_0x260cd8['field']='ContactId';_0xc94821=as[_0x6c2f('0x6f')](_0x477305,_0x2b51da[_0x6c2f('0x43')],_0x260cd8);_0x4dc59a[_0xdd6b31](_0xc94821[_0x6c2f('0x70')],_0xc94821[_0x6c2f('0x68')][_0x6c2f('0x71')],_0xc94821[_0x6c2f('0x68')][_0x6c2f('0x2e')]);}break;case _0x6c2f('0x72'):var _0x4745a3=_0x260cd8[_0x6c2f('0x68')]['split'](',')[_0x6c2f('0x38')](function(_0x2c0c7e){return Number(_0x2c0c7e);});_0x4745a3[_0x6c2f('0x3d')](function(_0x10dde2){_0x25da05['or'](_0x6c2f('0x73'),'%,'+_0x10dde2+',%');});_0x2aeea6=_['union'](_0x2aeea6,_0x4745a3);break;case _0x6c2f('0x74'):if(_0x260cd8[_0x6c2f('0x75')]===_0x6c2f('0x76')){_0x4dc59a[_0xdd6b31](_0x6c2f('0x77'),'%'+_0x260cd8[_0x6c2f('0x68')]+'%',null);}else{_0x2b51da=_[_0x6c2f('0x67')](_0x57f1de,[_0x6c2f('0x37'),'UserId']);_0x260cd8['field']=_0x6c2f('0x78');_0xc94821=as['buildExpression'](_0x477305,_0x2b51da[_0x6c2f('0x43')],_0x260cd8);_0x4dc59a[_0xdd6b31](_0xc94821['text'],_0xc94821['value'][_0x6c2f('0x71')],_0xc94821[_0x6c2f('0x68')][_0x6c2f('0x2e')]);}break;case _0x6c2f('0x79'):_0xc94821=as[_0x6c2f('0x6f')]('me',null,_0x260cd8);_0x4dc59a[_0xdd6b31](_0xc94821['text'],_0xc94821[_0x6c2f('0x68')][_0x6c2f('0x71')],_0xc94821[_0x6c2f('0x68')][_0x6c2f('0x2e')]);break;}}else{var _0xc94821=as['buildExpression'](_0x477305,_0x2b51da['type'],_0x260cd8);_0x4dc59a[_0xdd6b31](_0xc94821[_0x6c2f('0x70')],_0xc94821[_0x6c2f('0x68')]['start'],_0xc94821['value'][_0x6c2f('0x2e')]);}}}else{var _0x2713b2=_(_0x85b7d6[_0x6c2f('0x46')])['keys']()[_0x6c2f('0x38')](function(_0x3a8f5d){return _['some'](_0x57f1de,['name',_0x3a8f5d])?_0x3a8f5d:undefined;})[_0x6c2f('0x7a')]()[_0x6c2f('0x68')]();if(!_[_0x6c2f('0x7b')](_0x2713b2)){_0x2713b2[_0x6c2f('0x3d')](function(_0x2d5b38){if(_0x2d5b38==='ChatWebsiteId'){_0x2cdfd8[_0x6c2f('0x4e')](_0x6c2f('0x7c'),[][_0x6c2f('0x7d')](_0x85b7d6[_0x6c2f('0x46')][_0x2d5b38]));}else if(_0x2d5b38===_0x6c2f('0x7e')){var _0x12ea56=JSON[_0x6c2f('0x7f')](_0x85b7d6[_0x6c2f('0x46')][_0x2d5b38])[_0x6c2f('0x80')];var _0x207f93=JSON[_0x6c2f('0x7f')](_0x85b7d6['query'][_0x2d5b38])[_0x6c2f('0x81')];_0x2cdfd8['where'](_0x6c2f('0x82'),_0x12ea56,_0x207f93);}else{if(_0x85b7d6['query'][_0x2d5b38]===_0x6c2f('0x83')){_0x2cdfd8['where']('i.'+_0x2d5b38+'\x20IS\x20NULL');}else{_0x2cdfd8[_0x6c2f('0x4e')]('i.'+_0x2d5b38+'\x20=\x20?',_0x85b7d6['query'][_0x2d5b38]);}}});}if(_0x85b7d6['query']['read']){if(_0x85b7d6[_0x6c2f('0x46')][_0x6c2f('0x84')]==0x1){_0x2cdfd8[_0x6c2f('0x69')](_0x6c2f('0x85'));}else{_0x2cdfd8['having'](_0x6c2f('0x86'));}}if(_0x85b7d6[_0x6c2f('0x46')][_0x6c2f('0x87')]){_0x2aeea6=_[_0x6c2f('0x88')](_0x85b7d6[_0x6c2f('0x46')][_0x6c2f('0x87')])?_0x85b7d6[_0x6c2f('0x46')][_0x6c2f('0x87')]:new Array(_0x85b7d6[_0x6c2f('0x46')]['tag']);_0x2aeea6[_0x6c2f('0x3d')](function(_0x585c0e){_0x25da05['or'](_0x6c2f('0x73'),'%,'+_0x585c0e+',%');});}if(_0x85b7d6[_0x6c2f('0x46')][_0x6c2f('0x89')]){var _0x9057f4=_0x85b7d6[_0x6c2f('0x46')][_0x6c2f('0x89')][_0x6c2f('0x8a')]('\x5c','\x5c\x5c')[_0x6c2f('0x8a')](/'/g,'\x27\x27');if(qs[_0x6c2f('0x8b')](_0x9057f4)){_0x4dc59a['or']('i.id\x20LIKE\x20?',_0x9057f4+'%');}else{_0x4dc59a['or'](_0x6c2f('0x8c'),qs[_0x6c2f('0x6d')](_0x9057f4))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x9057f4+'%');}}}_0x2cdfd8['where'](_0x4dc59a);_0x2cdfd8['group'](_0x6c2f('0x8d'));var _0x2c44ef={'type':db[_0x6c2f('0x8e')][_0x6c2f('0x8f')][_0x6c2f('0x90')],'raw':!![]};var _0x15dde3=_0x2cdfd8[_0x6c2f('0x91')]();_0x15dde3[_0x6c2f('0x52')](_0x6c2f('0x8d'));_0x15dde3[_0x6c2f('0x52')](_0x6c2f('0x92'),_0x6c2f('0x93'));if(_0x55191e[_0x6c2f('0x4c')]){_0x55191e[_0x6c2f('0x4c')]['forEach'](function(_0x4ccdbc){var _0x120c3f=_0x4ccdbc[0x0]===_0x6c2f('0x94')?_0x4ccdbc[0x0]:'i.'+_0x4ccdbc[0x0];_0x2cdfd8[_0x6c2f('0x4c')](_0x120c3f,_0x4ccdbc[0x1]===_0x6c2f('0x95')?![]:!![]);});}if(!_[_0x6c2f('0x7b')](_0x2aeea6)){_0x2cdfd8[_0x6c2f('0x69')](_0x25da05);_0x15dde3[_0x6c2f('0x4e')](_0x6c2f('0x96'),_0x2aeea6);}BPromise[_0x6c2f('0x97')]()[_0x6c2f('0x25')](function(){if(!_0x54c5a5){if(_0x85b7d6['query']['ChatWebsiteId'])return;_0x15dde3['where'](_0x6c2f('0x98'));_0x2cdfd8[_0x6c2f('0x4e')](_0x6c2f('0x98'));return;}if(_0x85b7d6[_0x6c2f('0x99')]['role']!==_0x6c2f('0x9a'))return;return _0x85b7d6['user'][_0x6c2f('0x9b')]({'attributes':['id'],'raw':!![]})[_0x6c2f('0x25')](function(_0xc48a9d){if(_['isEmpty'](_0xc48a9d)){_0x15dde3[_0x6c2f('0x4e')](_0x6c2f('0x9c'));_0x2cdfd8['where'](_0x6c2f('0x9c'));}else{_0x15dde3[_0x6c2f('0x4e')](_0x6c2f('0x7c'),_[_0x6c2f('0x38')](_0xc48a9d,'id'));_0x2cdfd8['where'](_0x6c2f('0x7c'),_[_0x6c2f('0x38')](_0xc48a9d,'id'));}});})[_0x6c2f('0x25')](function(){if(_0x85b7d6[_0x6c2f('0x99')][_0x6c2f('0x9d')]===_0x6c2f('0x9a')&&!_0x54c5a5&&!_0x85b7d6['query'][_0x6c2f('0x9e')])return[];return db[_0x6c2f('0x9f')]['query'](_0x15dde3[_0x6c2f('0xa0')](),_0x2c44ef);})[_0x6c2f('0x25')](function(_0x18b7f7){_0x388184['count']=_0x18b7f7[_0x6c2f('0x4a')];if(_0x388184[_0x6c2f('0x30')]===0x0)return[];return db['sequelize'][_0x6c2f('0x46')](_0x22f972['toString'](),_0x2c44ef)[_0x6c2f('0x25')](function(_0x4c42df){_0x3c1147=_[_0x6c2f('0xa1')](_0x4c42df,'id');_0x2c44ef=_[_0x6c2f('0xa2')](_0x2c44ef,{'model':db[_0x6c2f('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x85b7d6[_0x6c2f('0x46')]['fields']){_0x55191e[_0x6c2f('0x49')][_0x6c2f('0x3d')](function(_0x4d1cca){_0x2cdfd8[_0x6c2f('0x52')]('i.'+_0x4d1cca);});}else{_0x2cdfd8[_0x6c2f('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6c2f('0x93'));_0x2cdfd8[_0x6c2f('0x52')](_0x6c2f('0xa3'),_0x6c2f('0xa4'));_0x2cdfd8[_0x6c2f('0x52')](_0x6c2f('0xa5'),'Account.mandatoryDisposition');_0x2cdfd8[_0x6c2f('0x52')](_0x6c2f('0xa6'),'contactName');_0x2cdfd8['field'](_0x6c2f('0xa7'));_0x2cdfd8['field'](_0x6c2f('0xa8'),_0x6c2f('0xa9'));_0x2cdfd8[_0x6c2f('0x52')](_0x6c2f('0xaa'),_0x6c2f('0xab'));_0x2cdfd8[_0x6c2f('0x52')](_0x6c2f('0xac'),_0x6c2f('0xad'));_0x2cdfd8[_0x6c2f('0x52')](_0x6c2f('0xae'),_0x6c2f('0xaf'));_0x2cdfd8[_0x6c2f('0x52')](_0x6c2f('0xb0'),_0x6c2f('0xb1'));_0x2cdfd8['field'](_0x6c2f('0xb2'),_0x6c2f('0xb3'));_0x2cdfd8[_0x6c2f('0x52')](_0x6c2f('0xb4'),_0x6c2f('0xb5'));_0x2cdfd8['field'](_0x6c2f('0xb6'),_0x6c2f('0xb7'));_0x2cdfd8[_0x6c2f('0x52')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x6c2f('0x3a'));}if(_0x55191e[_0x6c2f('0x32')])_0x2cdfd8['limit'](_0x55191e[_0x6c2f('0x32')]);if(_0x55191e['offset'])_0x2cdfd8[_0x6c2f('0x31')](_0x55191e[_0x6c2f('0x31')]);return db['sequelize'][_0x6c2f('0x46')](_0x2cdfd8[_0x6c2f('0xa0')](),_0x2c44ef);})[_0x6c2f('0x25')](function(_0x13b7bf){_0x48f56f['where'](_0x6c2f('0xb8'),_[_0x6c2f('0x38')](_0x13b7bf,'id'));return db[_0x6c2f('0x9f')]['query'](_0x48f56f[_0x6c2f('0xa0')](),_0x2c44ef)[_0x6c2f('0x25')](function(_0x42eadb){var _0x4416e6=_[_0x6c2f('0xb9')](_0x42eadb,'ChatInteractionId');var _0x1341ff=[];_0x13b7bf[_0x6c2f('0x3d')](function(_0x388804){_0x1341ff['push'](updateChatInteraction(_0x388804,_0x3c1147,_0x4416e6));});return BPromise[_0x6c2f('0xba')](_0x1341ff);});});})[_0x6c2f('0x25')](function(_0xd4bb73){_0x388184[_0x6c2f('0xbb')]=_0xd4bb73;return _0x388184;})[_0x6c2f('0x25')](respondWithFilteredResult(_0x58d201,_0x55191e))[_0x6c2f('0xbc')](handleError(_0x58d201,null));};exports[_0x6c2f('0xbd')]=function(_0x13d2e8,_0x1ee5f0){var _0x341121={'raw':![],'where':{'id':_0x13d2e8['params']['id']}},_0x265dc0={};_0x265dc0[_0x6c2f('0x45')]=_['keys'](db[_0x6c2f('0x40')][_0x6c2f('0x41')]);_0x265dc0[_0x6c2f('0x46')]=_[_0x6c2f('0x47')](_0x13d2e8[_0x6c2f('0x46')]);_0x265dc0[_0x6c2f('0x4f')]=_[_0x6c2f('0x48')](_0x265dc0['model'],_0x265dc0['query']);_0x341121[_0x6c2f('0x49')]=_[_0x6c2f('0x48')](_0x265dc0[_0x6c2f('0x45')],qs[_0x6c2f('0xbe')](_0x13d2e8[_0x6c2f('0x46')][_0x6c2f('0xbe')]));_0x341121[_0x6c2f('0x49')]=_0x341121[_0x6c2f('0x49')][_0x6c2f('0x4a')]?_0x341121['attributes']:_0x265dc0['model'];if(_0x13d2e8['query'][_0x6c2f('0xbf')]){_0x341121[_0x6c2f('0xc0')]=[{'all':!![]}];}_0x341121=_['merge']({},_0x341121,_0x13d2e8[_0x6c2f('0xc1')]);return db[_0x6c2f('0x40')][_0x6c2f('0x67')](_0x341121)[_0x6c2f('0x25')](handleEntityNotFound(_0x1ee5f0,null))[_0x6c2f('0x25')](respondWithResult(_0x1ee5f0,null))['catch'](handleError(_0x1ee5f0,null));};exports[_0x6c2f('0xc2')]=function(_0x847e92,_0x4691cf){return db[_0x6c2f('0x40')][_0x6c2f('0xc2')](_0x847e92[_0x6c2f('0x79')],{})[_0x6c2f('0x25')](respondWithResult(_0x4691cf,0xc9))['catch'](handleError(_0x4691cf,null));};exports['update']=function(_0x167a9f,_0x22d5b0){if(_0x167a9f[_0x6c2f('0x79')]['id']){delete _0x167a9f[_0x6c2f('0x79')]['id'];}return db[_0x6c2f('0x40')][_0x6c2f('0x67')]({'where':{'id':_0x167a9f[_0x6c2f('0xc3')]['id']}})[_0x6c2f('0x25')](handleEntityNotFound(_0x22d5b0,null))['then'](saveUpdates(_0x167a9f['body'],null))[_0x6c2f('0x25')](respondWithResult(_0x22d5b0,null))['catch'](handleError(_0x22d5b0,null));};exports[_0x6c2f('0xc4')]=function(_0x34a71e,_0x3747be){return db[_0x6c2f('0x40')][_0x6c2f('0x67')]({'where':{'id':_0x34a71e[_0x6c2f('0xc3')]['id']}})[_0x6c2f('0x25')](handleEntityNotFound(_0x3747be,null))[_0x6c2f('0x25')](removeEntity(_0x3747be,null))[_0x6c2f('0xbc')](handleError(_0x3747be,null));};exports[_0x6c2f('0xc5')]=function(_0xd19757,_0x4f3a4f){return db[_0x6c2f('0x40')][_0x6c2f('0xc5')]()['then'](respondWithResult(_0x4f3a4f,null))[_0x6c2f('0xbc')](handleError(_0x4f3a4f,null));};exports['createVidaooSession']=function(_0x3faa8f,_0x533c6a){var _0x1365c0=_0x3faa8f[_0x6c2f('0xc3')]['id'];var _0x462d23;var _0x231d5b;var _0x256858;return db['ChatInteraction'][_0x6c2f('0xc6')]({'where':{'id':_0x1365c0}})['then'](function(_0x5b05ed){_0x462d23=_0x5b05ed;return db[_0x6c2f('0xc7')][_0x6c2f('0xc6')]({'where':{'id':_0x5b05ed[_0x6c2f('0x9e')]},'attributes':['id','vidaooApiKey','vidaooEscalation'],'raw':!![]});})[_0x6c2f('0x25')](function(_0x45632f){if(_0x45632f&&_0x45632f[_0x6c2f('0xc8')]&&_0x45632f['vidaooEscalation']){_0x231d5b=_0x45632f;var _0x11824a={'rejectUnauthorized':![],'method':_0x6c2f('0xc9'),'uri':_0x6c2f('0xca'),'headers':{'X-APIKEY':_0x45632f[_0x6c2f('0xc8')]},'body':{'name':_0x6c2f('0xcb')+_0x1365c0},'redirect':'follow','json':!![]};return rp(_0x11824a);}else{throw new db['Sequelize'][(_0x6c2f('0xcc'))](_0x6c2f('0xcd'));}})['then'](function(_0x2c6605){_0x256858=_0x2c6605;if(_0x256858['id']){var _0x29f7e7={'body':_0x256858[_0x6c2f('0xce')],'ChatWebsiteId':_0x231d5b['id'],'ChatInteractionId':_0x462d23['id'],'direction':_0x6c2f('0xcf'),'UserId':_0x3faa8f[_0x6c2f('0x99')]['id']};return db[_0x6c2f('0xd0')][_0x6c2f('0xc2')](_0x29f7e7,{});}else{throw new db[(_0x6c2f('0x8e'))][(_0x6c2f('0xcc'))](_0x6c2f('0xd1'));}})[_0x6c2f('0x25')](function(){return _0x462d23[_0x6c2f('0xd2')]({'vidaooSessionId':_0x256858['id']});})['then'](respondWithResult(_0x533c6a,null))['catch'](handleError(_0x533c6a,null));};exports['customUpdate']=function(_0x39bfcd,_0x3cbea8){if(_0x39bfcd[_0x6c2f('0x79')]['id']){delete _0x39bfcd[_0x6c2f('0x79')]['id'];}return db['ChatInteraction'][_0x6c2f('0x67')]({'where':{'id':_0x39bfcd[_0x6c2f('0xc3')]['id']},'include':[{'model':db[_0x6c2f('0xd3')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x3cbea8,null))[_0x6c2f('0x25')](saveUpdates(_0x39bfcd[_0x6c2f('0x79')],null))[_0x6c2f('0x25')](respondWithResult(_0x3cbea8,null))[_0x6c2f('0xbc')](handleError(_0x3cbea8,null));};exports['abandon']=function(_0x4ca246,_0x9c5ead,_0x2077ee){if(_0x4ca246[_0x6c2f('0x79')]['id']){delete _0x4ca246[_0x6c2f('0x79')]['id'];}return db[_0x6c2f('0x40')][_0x6c2f('0x67')]({'where':{'id':_0x4ca246[_0x6c2f('0xc3')]['id']}})[_0x6c2f('0x25')](function(_0x429b88){if(!_0x429b88){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x6c2f('0xd4'),0x194,'entity\x20not\x20found');_0x9c5ead[_0x6c2f('0x36')](0x194);}else{if(_0x429b88[_0x6c2f('0x78')]){throw new db['Sequelize'][(_0x6c2f('0xcc'))](_0x6c2f('0xd5'));}}return _0x429b88;})[_0x6c2f('0x25')](function(_0x468aba){if(_0x468aba){return _0x468aba[_0x6c2f('0x35')]({'closed':_0x4ca246[_0x6c2f('0x79')][_0x6c2f('0xd6')],'disposition':_0x4ca246['body']['disposition']})[_0x6c2f('0x25')](function(_0x1a50ce){return _0x1a50ce;});}})[_0x6c2f('0x25')](function(_0x167405){return respondWithRpcPromise(_0x6c2f('0xd7'),'abandon',_0x4ca246[_0x6c2f('0x79')],client9004);})[_0x6c2f('0x25')](respondWithResult(_0x9c5ead,null))[_0x6c2f('0xbc')](handleError(_0x9c5ead,null));};exports[_0x6c2f('0xd8')]=function(_0x5b83af,_0x542918,_0x5a7cf3){_0x5b83af[_0x6c2f('0x79')][_0x6c2f('0x37')]=_0x5b83af['file'][_0x6c2f('0xd9')];_0x5b83af[_0x6c2f('0x79')]['basename']=_0x5b83af[_0x6c2f('0xda')][_0x6c2f('0xdb')];_0x5b83af[_0x6c2f('0x79')]['type']=_0x5b83af['file'][_0x6c2f('0xdc')];return db[_0x6c2f('0xdd')][_0x6c2f('0xc2')](_0x5b83af[_0x6c2f('0x79')])[_0x6c2f('0x25')](respondWithResult(_0x542918,0xc9))['catch'](handleError(_0x542918,null));};exports[_0x6c2f('0xde')]=function(_0x253566,_0x586a0e,_0x454043){return db[_0x6c2f('0x40')]['findOne']({'where':{'id':_0x253566[_0x6c2f('0xc3')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x586a0e,null))[_0x6c2f('0x25')](function(_0x5324bb){if(_0x5324bb){if(_0x5324bb[_0x6c2f('0xd6')]){return _0x586a0e[_0x6c2f('0x2d')](0x193)[_0x6c2f('0x2f')]({'status':0x193,'message':'Unauthorized'});}return db[_0x6c2f('0xdd')][_0x6c2f('0xc6')]({'where':{'id':_0x253566[_0x6c2f('0x46')][_0x6c2f('0xdf')]},'raw':!![]})[_0x6c2f('0x25')](handleEntityNotFound(_0x586a0e,null));}})[_0x6c2f('0x25')](function(_0x920248){if(_0x920248){var _0x4bc95c=_0x920248[_0x6c2f('0xe0')]!==null;var _0xfb1203=path[_0x6c2f('0xe1')](config[_0x6c2f('0xe2')],_0x6c2f('0xe3'));if(_0x4bc95c){_0xfb1203=path['join'](_0xfb1203,_0x6c2f('0xe4'));}var _0x11b6d0=path[_0x6c2f('0xe1')](_0xfb1203,_0x920248['basename']);return _0x586a0e[_0x6c2f('0xe5')](_0x11b6d0);}})[_0x6c2f('0xbc')](handleError(_0x586a0e,null));};exports[_0x6c2f('0xe6')]=function(_0xeea6ef,_0x59a2da){var _0x17e860=null;var _0x392ffb=null;var _0x3b83bd=null;var _0x1b9295=null;if(_0xeea6ef[_0x6c2f('0x79')]['id']){delete _0xeea6ef[_0x6c2f('0x79')]['id'];}if(_0xeea6ef[_0x6c2f('0x79')][_0x6c2f('0xe7')]){_0x1b9295=path[_0x6c2f('0xe1')](config[_0x6c2f('0xe2')],_0x6c2f('0xe8'),util[_0x6c2f('0xe9')]('transcript-%s.txt',Date[_0x6c2f('0xea')]()));_0xeea6ef[_0x6c2f('0x79')][_0x6c2f('0xeb')]=_0x1b9295;}return db[_0x6c2f('0x40')][_0x6c2f('0x67')]({'where':{'id':_0xeea6ef[_0x6c2f('0xc3')]['id']},'include':[{'model':db[_0x6c2f('0xd0')],'as':'Messages','include':[{'model':db[_0x6c2f('0x74')],'as':_0x6c2f('0x74')}]}]})[_0x6c2f('0x25')](handleEntityNotFound(_0x59a2da,null))[_0x6c2f('0x25')](saveUpdates(_0xeea6ef['body'],null))[_0x6c2f('0x25')](function(_0x663112){if(_0x663112){_0x17e860=_0x663112;return db[_0x6c2f('0xc7')][_0x6c2f('0x67')]({'where':{'id':_0x17e860[_0x6c2f('0x9e')]}});}})[_0x6c2f('0x25')](function(_0x280abc){if(_0x280abc){_0x3b83bd=_0x280abc;return db[_0x6c2f('0xd3')][_0x6c2f('0x67')]({'where':{'id':_0x17e860[_0x6c2f('0xec')]}});}})[_0x6c2f('0x25')](function(_0x51d8b4){if(_0x51d8b4){_0x392ffb=_0x51d8b4;if(_0x1b9295){var _0x4b8ca8=null;for(var _0x3e8a61=0x1;_0x3e8a61<_0x17e860[_0x6c2f('0xed')][_0x6c2f('0x4a')];++_0x3e8a61){_0x4b8ca8=_0x17e860[_0x6c2f('0xed')][_0x3e8a61];var _0x3349ac=_0x4b8ca8[_0x6c2f('0x78')]?util['format'](_0x6c2f('0xee'),_0x3b83bd[_0x6c2f('0xef')],_0x4b8ca8['UserId']):'System';var _0x499712=_0xeea6ef[_0x6c2f('0x79')][_0x6c2f('0xf0')]||util['format'](_0x6c2f('0xee'),_0x6c2f('0xf1'),_0x4b8ca8[_0x6c2f('0xec')]);switch(_0x3b83bd[_0x6c2f('0xf2')]){case _0x6c2f('0xf3'):_0x3349ac=_0x4b8ca8[_0x6c2f('0x78')]?util[_0x6c2f('0xe9')](_0x6c2f('0xee'),_0x3b83bd['agentAlias'],_0x4b8ca8[_0x6c2f('0x78')]):_0x6c2f('0xf4');break;case _0x6c2f('0xf5'):_0x3349ac=_0x4b8ca8[_0x6c2f('0x78')]?_0x4b8ca8[_0x6c2f('0x74')][_0x6c2f('0xf6')]||_0x4b8ca8[_0x6c2f('0x74')][_0x6c2f('0x39')]:_0x6c2f('0xf4');break;case _0x6c2f('0xf7'):_0x3349ac=_0x4b8ca8[_0x6c2f('0x78')]?_0x4b8ca8[_0x6c2f('0x74')][_0x6c2f('0x39')]:_0x6c2f('0xf4');break;default:_0x3349ac=_0x4b8ca8['UserId']?util[_0x6c2f('0xe9')]('%s%d',_0x3b83bd[_0x6c2f('0xef')],_0x4b8ca8[_0x6c2f('0x78')]):_0x6c2f('0xf4');}var _0x1e8144=util[_0x6c2f('0xe9')]('[%s]\x20%s:\x20%s\x0a',moment(_0x4b8ca8[_0x6c2f('0x7e')])[_0x6c2f('0xe9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x4b8ca8[_0x6c2f('0xf8')]==='in'?_0x499712:_0x3349ac,_0x4b8ca8[_0x6c2f('0x79')]);if(!_0x4b8ca8[_0x6c2f('0xf9')]){fs[_0x6c2f('0xfa')](_0x1b9295,_0x1e8144);}}return db[_0x6c2f('0xfb')][_0x6c2f('0xc6')]({'where':{'service':!![]},'include':[{'model':db[_0x6c2f('0xfc')],'as':'Smtp','raw':!![]}]});}}})[_0x6c2f('0x25')](function(_0x5609cc){if(_0x5609cc&&_0x5609cc[_0x6c2f('0xfd')]&&_0xeea6ef[_0x6c2f('0x79')]){var _0x264ffb={'tls':{'rejectUnauthorized':![]}};if(_0x5609cc[_0x6c2f('0xfd')][_0x6c2f('0xfe')]){_0x264ffb[_0x6c2f('0xfe')]=_0x5609cc[_0x6c2f('0xfd')]['service'];}else{_0x264ffb[_0x6c2f('0xff')]=_0x5609cc['Smtp'][_0x6c2f('0xff')];_0x264ffb[_0x6c2f('0x100')]=_0x5609cc['Smtp'][_0x6c2f('0x100')];_0x264ffb[_0x6c2f('0x101')]=_0x5609cc[_0x6c2f('0xfd')][_0x6c2f('0x101')];}if(_0x5609cc[_0x6c2f('0xfd')][_0x6c2f('0x102')]){_0x264ffb[_0x6c2f('0x103')]={'user':_0x5609cc['Smtp'][_0x6c2f('0x99')],'pass':_0x5609cc[_0x6c2f('0xfd')][_0x6c2f('0x104')]};}return respondWithRpcPromise(_0x6c2f('0x105'),_0x6c2f('0x106'),{'account':_0x264ffb,'message':{'from':util[_0x6c2f('0xe9')](_0x6c2f('0x107'),_0x5609cc[_0x6c2f('0x37')],_0x5609cc['email']||_0x5609cc[_0x6c2f('0xfd')][_0x6c2f('0x99')]),'to':_0xeea6ef['body']['mailTranscript'],'subject':_0x6c2f('0x108'),'text':util[_0x6c2f('0xe9')](_0x6c2f('0x109'),_0xeea6ef[_0x6c2f('0x79')][_0x6c2f('0xe7')]),'attachments':[{'path':_0x1b9295}]}})['then'](function(){return _0x17e860;})['catch'](function(_0x1c17f3){console['error'](_0x1c17f3);});}else{return _0x17e860;}})[_0x6c2f('0x25')](respondWithStatusCode(_0x59a2da,0xc8))[_0x6c2f('0xbc')](handleError(_0x59a2da,null));};exports['addMessage']=function(_0x394950,_0x3e77f1,_0x5d7dff){return db[_0x6c2f('0xd0')][_0x6c2f('0x67')]({'where':{'id':_0x394950[_0x6c2f('0xc3')]['id']}})[_0x6c2f('0x25')](handleEntityNotFound(_0x3e77f1,null))['then'](function(_0xe5a3fd){if(_0xe5a3fd){return _0xe5a3fd[_0x6c2f('0x10a')](_0x394950['body'][_0x6c2f('0x10b')],_[_0x6c2f('0x10c')](_0x394950[_0x6c2f('0x79')],[_0x6c2f('0x10b'),'id'])||{});}})[_0x6c2f('0x25')](respondWithResult(_0x3e77f1,null))['catch'](handleError(_0x3e77f1,null));};exports[_0x6c2f('0x10d')]=function(_0x5674dd,_0x34db5b,_0x330804){var _0x1df20b={'raw':![],'where':{}};var _0x113782={};var _0x3eb02c={'count':0x0,'rows':[]};return db[_0x6c2f('0x40')][_0x6c2f('0xc6')]({'where':{'id':_0x5674dd['params']['id']}})[_0x6c2f('0x25')](handleEntityNotFound(_0x34db5b,null))['then'](function(_0x4fcf34){if(_0x4fcf34){_0x113782['model']=_['keys'](db[_0x6c2f('0xd0')][_0x6c2f('0x41')]);_0x113782[_0x6c2f('0x46')]=_[_0x6c2f('0x47')](_0x5674dd['query']);_0x113782['filters']=_['intersection'](_0x113782[_0x6c2f('0x45')],_0x113782[_0x6c2f('0x46')]);_0x1df20b[_0x6c2f('0x49')]=_[_0x6c2f('0x48')](_0x113782['model'],qs[_0x6c2f('0xbe')](_0x5674dd[_0x6c2f('0x46')]['fields']));_0x1df20b['attributes']=_0x1df20b[_0x6c2f('0x49')][_0x6c2f('0x4a')]?_0x1df20b['attributes']:_0x113782['model'];if(!_0x5674dd[_0x6c2f('0x46')][_0x6c2f('0x10e')]('nolimit')){_0x1df20b[_0x6c2f('0x32')]=qs['limit'](_0x5674dd[_0x6c2f('0x46')][_0x6c2f('0x32')]);_0x1df20b[_0x6c2f('0x31')]=qs[_0x6c2f('0x31')](_0x5674dd[_0x6c2f('0x46')][_0x6c2f('0x31')]);}_0x1df20b['order']=qs[_0x6c2f('0x4d')](_0x5674dd[_0x6c2f('0x46')][_0x6c2f('0x4d')]);_0x1df20b['where']=qs[_0x6c2f('0x4f')](_[_0x6c2f('0x50')](_0x5674dd[_0x6c2f('0x46')],_0x113782[_0x6c2f('0x4f')]));_0x1df20b['where'][_0x6c2f('0x10f')]=_0x4fcf34['id'];if(_0x5674dd['query'][_0x6c2f('0x89')]){_0x1df20b[_0x6c2f('0x4e')]=_[_0x6c2f('0xa2')](_0x1df20b[_0x6c2f('0x4e')],{'$or':_[_0x6c2f('0x38')](_0x1df20b['attributes'],function(_0x528eb4){var _0x218c64={};_0x218c64[_0x528eb4]={'$like':'%'+_0x5674dd[_0x6c2f('0x46')][_0x6c2f('0x89')]+'%'};return _0x218c64;})});}if(_0x5674dd[_0x6c2f('0x46')][_0x6c2f('0x80')]){var _0xa17063=_0x5674dd[_0x6c2f('0x46')][_0x6c2f('0x80')]['split'](',');var _0x120338={};_0x120338[_0xa17063[0x0]]={'$gte':moment(_0xa17063[0x1])[_0x6c2f('0xe9')](_0x6c2f('0x110'))};_0x1df20b[_0x6c2f('0x4e')]=_['merge'](_0x1df20b[_0x6c2f('0x4e')],_0x120338);}_0x1df20b=_[_0x6c2f('0xa2')]({},_0x1df20b,_0x5674dd[_0x6c2f('0xc1')]);return db[_0x6c2f('0xd0')]['count']({'where':_0x1df20b['where']})[_0x6c2f('0x25')](function(_0xa17128){_0x3eb02c[_0x6c2f('0x30')]=_0xa17128;if(_0x5674dd[_0x6c2f('0x46')]['includeAll']){_0x1df20b['include']=[{'all':!![]}];}return db[_0x6c2f('0xd0')][_0x6c2f('0x111')](_0x1df20b);})[_0x6c2f('0x25')](function(_0xf2724e){_0x3eb02c['rows']=_0xf2724e;return _0x3eb02c;});}})['then'](respondWithFilteredResult(_0x34db5b,_0x1df20b))[_0x6c2f('0xbc')](handleError(_0x34db5b,null));};exports[_0x6c2f('0x112')]=function(_0x29733a,_0x190768,_0x3acc72){var _0x20e8ee={'where':{}},_0x5ba52f={},_0x574c73={'count':0x0,'rows':[]};return db[_0x6c2f('0x40')][_0x6c2f('0xc6')]({'where':{'id':_0x29733a[_0x6c2f('0xc3')]['id']}})['then'](handleEntityNotFound(_0x190768,null))[_0x6c2f('0x25')](function(_0x1ad43e){if(_0x1ad43e){_0x5ba52f[_0x6c2f('0x45')]=_[_0x6c2f('0x47')](db[_0x6c2f('0xd0')]['rawAttributes']);_0x5ba52f['query']=_[_0x6c2f('0x47')](_0x29733a[_0x6c2f('0x46')]);_0x5ba52f[_0x6c2f('0x4f')]=_[_0x6c2f('0x48')](_0x5ba52f[_0x6c2f('0x45')],_0x5ba52f['query']);_0x20e8ee[_0x6c2f('0x49')]=_['intersection'](_0x5ba52f[_0x6c2f('0x45')],qs[_0x6c2f('0xbe')](_0x29733a[_0x6c2f('0x46')][_0x6c2f('0xbe')]));_0x20e8ee[_0x6c2f('0x49')]=_0x20e8ee[_0x6c2f('0x49')][_0x6c2f('0x4a')]?_0x20e8ee[_0x6c2f('0x49')]:_0x5ba52f[_0x6c2f('0x45')];if(!_0x29733a[_0x6c2f('0x46')]['hasOwnProperty'](_0x6c2f('0x4b'))){_0x20e8ee[_0x6c2f('0x32')]=qs[_0x6c2f('0x32')](_0x29733a[_0x6c2f('0x46')][_0x6c2f('0x32')]);_0x20e8ee[_0x6c2f('0x31')]=qs['offset'](_0x29733a['query'][_0x6c2f('0x31')]);}_0x20e8ee[_0x6c2f('0x4c')]=qs[_0x6c2f('0x4d')](_0x29733a[_0x6c2f('0x46')][_0x6c2f('0x4d')]);_0x20e8ee[_0x6c2f('0x4e')]=qs[_0x6c2f('0x4f')](_[_0x6c2f('0x50')](_0x29733a['query'],_0x5ba52f['filters']));_0x20e8ee['where']['ChatInteractionId']=_0x1ad43e['id'];if(_0x29733a[_0x6c2f('0x46')][_0x6c2f('0x89')]){_0x20e8ee[_0x6c2f('0x4e')]=_['merge'](_0x20e8ee['where'],{'$or':_[_0x6c2f('0x38')](_0x20e8ee[_0x6c2f('0x49')],function(_0x55a228){var _0x3d57da={};_0x3d57da[_0x55a228]={'$like':'%'+_0x29733a[_0x6c2f('0x46')][_0x6c2f('0x89')]+'%'};return _0x3d57da;})});}_0x20e8ee[_0x6c2f('0x4e')][_0x6c2f('0xf9')]=![];if(_0x29733a['query']['id']){_0x20e8ee[_0x6c2f('0x4e')]['id']={'$gt':_0x29733a[_0x6c2f('0x46')]['id']};}_0x20e8ee=_[_0x6c2f('0xa2')]({},_0x20e8ee,_0x29733a['options']);return db[_0x6c2f('0xd0')][_0x6c2f('0x30')]({'where':_0x20e8ee[_0x6c2f('0x4e')]})['then'](function(_0x310167){_0x574c73[_0x6c2f('0x30')]=_0x310167;_0x20e8ee[_0x6c2f('0xc0')]=[];if(_0x29733a[_0x6c2f('0x46')][_0x6c2f('0x113')]){_0x20e8ee[_0x6c2f('0xc0')][_0x6c2f('0x3e')]({'model':db[_0x6c2f('0x74')],'as':'User','attributes':['id','fullname','alias']});}if(_0x29733a['query']['includeAll']){_0x20e8ee[_0x6c2f('0xc0')]=[{'all':!![]}];}return db[_0x6c2f('0xd0')][_0x6c2f('0x111')](_0x20e8ee);})[_0x6c2f('0x25')](function(_0x1f979c){_0x574c73['rows']=_0x1f979c;return _0x574c73;});}})[_0x6c2f('0x25')](respondWithFilteredResult(_0x190768,_0x20e8ee))[_0x6c2f('0xbc')](handleError(_0x190768,null));};exports['addTags']=function(_0x398b6d,_0x382c8f,_0xf2fb38){return db[_0x6c2f('0x40')][_0x6c2f('0x67')]({'where':{'id':_0x398b6d[_0x6c2f('0xc3')]['id']}})['then'](handleEntityNotFound(_0x382c8f,null))[_0x6c2f('0x25')](function(_0xcfc02d){if(_0xcfc02d){return _0xcfc02d[_0x6c2f('0x114')](_0x398b6d[_0x6c2f('0x79')][_0x6c2f('0x10b')],_[_0x6c2f('0x10c')](_0x398b6d[_0x6c2f('0x79')],[_0x6c2f('0x10b'),'id'])||{})[_0x6c2f('0x115')](function(){return db['Tag'][_0x6c2f('0x111')]({'attributes':['id','name',_0x6c2f('0x53')],'where':{'id':_0x398b6d[_0x6c2f('0x79')]['ids']}});})['then'](function(_0x4d8ec8){socket['emit'](_0x6c2f('0x116'),{'id':Number(_0x398b6d[_0x6c2f('0xc3')]['id']),'tags':_0x4d8ec8||[]});return{'id':Number(_0x398b6d[_0x6c2f('0xc3')]['id']),'tags':_0x4d8ec8||[]};});}})[_0x6c2f('0x25')](respondWithResult(_0x382c8f,null))[_0x6c2f('0xbc')](handleError(_0x382c8f,null));};exports[_0x6c2f('0x117')]=function(_0x1b1763,_0x35cb21,_0x1e975f){return db[_0x6c2f('0x40')][_0x6c2f('0x67')]({'where':{'id':_0x1b1763[_0x6c2f('0xc3')]['id']}})[_0x6c2f('0x25')](handleEntityNotFound(_0x35cb21,null))[_0x6c2f('0x25')](function(_0x579c14){if(_0x579c14){return _0x579c14[_0x6c2f('0x117')](_0x1b1763['query'][_0x6c2f('0x10b')]);}})[_0x6c2f('0x25')](respondWithStatusCode(_0x35cb21,null))['catch'](handleError(_0x35cb21,null));};exports['download']=function(_0x1e35ff,_0x380fe8){var _0x3b17ce=moment()['unix']()[_0x6c2f('0xa0')]();var _0x354e10=path[_0x6c2f('0xe1')](config[_0x6c2f('0xe2')],_0x6c2f('0x118'),_0x6c2f('0x119'),_0x6c2f('0x11a'));var _0x6aade2=path[_0x6c2f('0xe1')](config[_0x6c2f('0xe2')],_0x6c2f('0x118'),_0x6c2f('0x119'),_0x6c2f('0x11b'));var _0x5a28a8=path[_0x6c2f('0xe1')](_0x354e10,_0x3b17ce);var _0x3b681b=util[_0x6c2f('0xe9')](_0x6c2f('0x11c'),_0x1e35ff[_0x6c2f('0xc3')]['id'],_0x3b17ce);var _0x3215a2=path[_0x6c2f('0xe1')](_0x354e10,_0x3b681b);var _0x5a3e8b=[];_0x5a3e8b['push']({'model':db[_0x6c2f('0x74')],'as':'User','attributes':['id',_0x6c2f('0x39')],'raw':!![]});_0x5a3e8b[_0x6c2f('0x3e')]({'model':db[_0x6c2f('0xd3')],'as':'Contact','attributes':['id','firstName',_0x6c2f('0x11d')],'raw':!![]});if(_0x1e35ff['query'][_0x6c2f('0x11b')]){_0x5a3e8b[_0x6c2f('0x3e')]({'model':db[_0x6c2f('0xdd')],'as':_0x6c2f('0xdd'),'raw':!![]});}var _0x2f8e13=[{'model':db[_0x6c2f('0xd0')],'as':'Messages','attributes':['id',_0x6c2f('0x79'),_0x6c2f('0x7e'),'direction','secret',_0x6c2f('0x84')],'include':_0x5a3e8b}];_0x2f8e13[_0x6c2f('0x3e')]({'model':db[_0x6c2f('0xc7')],'as':'Account','attributes':['id',_0x6c2f('0x37')]});_0x2f8e13[_0x6c2f('0x3e')]({'model':db[_0x6c2f('0x74')],'as':_0x6c2f('0x11e'),'attributes':['id',_0x6c2f('0x39')]});return db['ChatInteraction'][_0x6c2f('0x67')]({'where':{'id':_0x1e35ff[_0x6c2f('0xc3')]['id']},'include':_0x2f8e13})['then'](handleEntityNotFound(_0x380fe8,null))['then'](function(_0x123487){if(_0x123487){var _0x343e79=_0x123487['get']({'plain':!![]});fs[_0x6c2f('0x11f')](_0x5a28a8);var _0x303145={'channel':_0x6c2f('0x120'),'account':_0x343e79[_0x6c2f('0x121')][_0x6c2f('0x37')],'agent':_0x343e79[_0x6c2f('0x11e')]?_0x343e79[_0x6c2f('0x11e')][_0x6c2f('0x39')]:_0x6c2f('0x122'),'createdAt':moment(_0x343e79[_0x6c2f('0x7e')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x343e79[_0x6c2f('0xd6')]?moment(_0x343e79['closedAt'])['format'](_0x6c2f('0x110'))[_0x6c2f('0xa0')]():'','disposition':_0x343e79[_0x6c2f('0x123')],'chatInfo':{'browser':_0x343e79[_0x6c2f('0x124')],'os':_0x343e79[_0x6c2f('0x125')],'referer':_0x343e79['referer'],'customerIp':_0x343e79[_0x6c2f('0x126')],'customerPort':_0x343e79[_0x6c2f('0x127')]?_0x343e79['customerPort']:_0x6c2f('0x122')},'messages':_(_0x343e79[_0x6c2f('0xed')])[_0x6c2f('0x128')]()[_0x6c2f('0x89')]({'secret':![]})[_0x6c2f('0x38')](function(_0x414248){if(_0x414248[_0x6c2f('0xdd')]){var _0x4118ab=path['join'](_0x6aade2,_0x414248[_0x6c2f('0xdd')][_0x6c2f('0x129')]);if(fs[_0x6c2f('0x12a')](_0x4118ab)){fs['createReadStream'](_0x4118ab)[_0x6c2f('0x12b')](fs[_0x6c2f('0x12c')](path['join'](_0x5a28a8,_0x414248[_0x6c2f('0xdd')]['basename'])));}}return{'date':moment(_0x414248['createdAt'])[_0x6c2f('0xe9')](_0x6c2f('0x110'))[_0x6c2f('0xa0')](),'sender':_0x414248[_0x6c2f('0xf8')]===_0x6c2f('0xcf')?_0x414248['User']?_0x414248['User'][_0x6c2f('0x39')]:'System':_0x414248['Contact']['firstName']+(_0x414248[_0x6c2f('0x6c')][_0x6c2f('0x11d')]?'\x20'+_0x414248[_0x6c2f('0x6c')][_0x6c2f('0x11d')]:''),'body':_0x414248[_0x6c2f('0xdd')]?_0x414248['Attachment'][_0x6c2f('0x129')]:_0x414248[_0x6c2f('0x79')],'direction':_0x414248[_0x6c2f('0xf8')]===_0x6c2f('0xcf')?'A':'C','secret':_0x414248[_0x6c2f('0xf9')],'read':_0x414248[_0x6c2f('0x84')],'attachment':_0x414248[_0x6c2f('0xdd')]};})['value']()};return ejs[_0x6c2f('0x12d')](path[_0x6c2f('0xe1')](config['root'],'server',_0x6c2f('0x12e'),_0x6c2f('0x12f')),{'interaction':_0x303145})[_0x6c2f('0x25')](function(_0x2653b9){var _0x3f7fe8=path[_0x6c2f('0xe1')](_0x5a28a8,_0x6c2f('0x130')+_0x343e79['id']+'-'+_0x3b17ce+_0x6c2f('0x131'));var _0x171ecd={'path':_0x3f7fe8,'channel':_0x6c2f('0x120'),'interactionId':_0x343e79['id']};return pdf[_0x6c2f('0x132')](_0x2653b9,_0x171ecd);})[_0x6c2f('0x25')](function(){return new BPromise(function(_0x5d15c5,_0x495f1f){zipdir(_0x5a28a8,{'saveTo':_0x3215a2},function(_0x10705b,_0x2ca499){if(_0x10705b)return _0x495f1f(_0x10705b);return _0x5d15c5(_0x2ca499);});})[_0x6c2f('0x25')](function(){return new BPromise(function(_0x515a4b,_0x19e859){rimraf(_0x5a28a8,function(_0x4599a3){if(_0x4599a3)_0x19e859(_0x4599a3);return _0x515a4b();});});})[_0x6c2f('0x25')](function(){return _0x380fe8[_0x6c2f('0xe5')](_0x3215a2,_0x3b681b,function(_0x4ac556){if(_0x4ac556){console[_0x6c2f('0x133')](_0x6c2f('0x134'),_0x4ac556);}else{fs[_0x6c2f('0x135')](_0x3215a2);}});});});}else{return _0x380fe8[_0x6c2f('0x36')](0xc8);}})[_0x6c2f('0xbc')](handleError(_0x380fe8,null));}; \ No newline at end of file +var _0x5beb=['`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','role','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','options','create','body','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','follow','Sequelize','ValidationError','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','server/files/chat/upload/','transcript-%s.txt','now','ChatMessage','Messages','format','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','addMessage','ids','omit','getMessages','nolimit','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','hasOwnProperty','includeAgent','spread','color','emit','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','firstName','attachments','Account','get','Chat','Owner','N.A.','closedAt','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','downloadInteraction.html','.pdf','log','err','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','stack','name','send','Users','map','fullname','TagIds','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','sort','where','pick','filters','select','field','tools_tags','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','value','having','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','text','some','compact','isEmpty','forEach','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200'];(function(_0xbc8e6f,_0xbc133d){var _0x169a3c=function(_0x28b18d){while(--_0x28b18d){_0xbc8e6f['push'](_0xbc8e6f['shift']());}};_0x169a3c(++_0xbc133d);}(_0x5beb,0xaa));var _0xb5be=function(_0x54424d,_0x292791){_0x54424d=_0x54424d-0x0;var _0xd9cc7e=_0x5beb[_0x54424d];return _0xd9cc7e;};'use strict';var emlformat=require(_0xb5be('0x0'));var rimraf=require(_0xb5be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5be('0x2'));var rp=require('request-promise');var moment=require(_0xb5be('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb5be('0x4'));var util=require(_0xb5be('0x5'));var path=require(_0xb5be('0x6'));var sox=require('sox');var csv=require(_0xb5be('0x7'));var ejs=require(_0xb5be('0x8'));var fs=require('fs');var fs_extra=require(_0xb5be('0x9'));var _=require('lodash');var squel=require(_0xb5be('0xa'));var crypto=require(_0xb5be('0xb'));var jsforce=require(_0xb5be('0xc'));var deskjs=require(_0xb5be('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb5be('0xe'));var authService=require(_0xb5be('0xf'));var qs=require(_0xb5be('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xb5be('0x11'));var hardwareService=require(_0xb5be('0x12'));var logger=require(_0xb5be('0x13'))(_0xb5be('0x14'));var utils=require(_0xb5be('0x15'));var config=require(_0xb5be('0x16'));var licenseUtil=require(_0xb5be('0x17'));var db=require(_0xb5be('0x18'))['db'];config['redis']=_['defaults'](config[_0xb5be('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb5be('0x1a'))(new Redis(config[_0xb5be('0x19')]));require(_0xb5be('0x1b'))[_0xb5be('0x1c')](socket);var jayson=require(_0xb5be('0x1d'));var client=jayson['client'][_0xb5be('0x1e')]({'port':0x232b});var client9004=jayson['client'][_0xb5be('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x18154b,_0x2c32d1,_0x199c6d,_0x57db14){return new BPromise(function(_0x4ed5fd,_0xb1a3bf){var _0x12a655=_0x57db14||client;return _0x12a655[_0xb5be('0x1f')](_0x18154b,_0x199c6d)['then'](function(_0x4c6f0a){logger[_0xb5be('0x20')](_0xb5be('0x21'),_0x2c32d1,_0xb5be('0x22'));logger[_0xb5be('0x23')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2c32d1,_0xb5be('0x22'),JSON['stringify'](_0x4c6f0a));if(_0x4c6f0a[_0xb5be('0x24')]){if(_0x4c6f0a[_0xb5be('0x24')]['code']===0x1f4){logger[_0xb5be('0x24')](_0xb5be('0x21'),_0x2c32d1,_0x4c6f0a[_0xb5be('0x24')][_0xb5be('0x25')]);return _0xb1a3bf(_0x4c6f0a[_0xb5be('0x24')][_0xb5be('0x25')]);}logger[_0xb5be('0x24')](_0xb5be('0x21'),_0x2c32d1,_0x4c6f0a[_0xb5be('0x24')][_0xb5be('0x25')]);return _0x4ed5fd(_0x4c6f0a[_0xb5be('0x24')][_0xb5be('0x25')]);}else{logger[_0xb5be('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x2c32d1,_0xb5be('0x22'));_0x4ed5fd(_0x4c6f0a[_0xb5be('0x26')][_0xb5be('0x25')]);}})[_0xb5be('0x27')](function(_0x369650){logger[_0xb5be('0x24')](_0xb5be('0x21'),_0x2c32d1,_0x369650);_0xb1a3bf(_0x369650);});});}function respondWithStatusCode(_0x156c63,_0x5c39af){_0x5c39af=_0x5c39af||0xcc;return function(_0x52579b){if(_0x52579b){return _0x156c63[_0xb5be('0x28')](_0x5c39af);}return _0x156c63[_0xb5be('0x29')](_0x5c39af)[_0xb5be('0x2a')]();};}function respondWithResult(_0x5b2938,_0x3463a1){_0x3463a1=_0x3463a1||0xc8;return function(_0x5ee09b){if(_0x5ee09b){return _0x5b2938[_0xb5be('0x29')](_0x3463a1)[_0xb5be('0x2b')](_0x5ee09b);}};}function respondWithFilteredResult(_0x38f1b3,_0x15eba2){return function(_0x53b43b){if(_0x53b43b){var _0x300969=_0x53b43b[_0xb5be('0x2c')],_0x1b596e=_0x15eba2[_0xb5be('0x2d')],_0xd0e480=_0x15eba2[_0xb5be('0x2d')]+_0x15eba2[_0xb5be('0x2e')],_0x26afcb;if(_0xd0e480>=_0x300969){_0xd0e480=_0x300969;_0x26afcb=0xc8;}else{_0x26afcb=0xce;}_0x38f1b3[_0xb5be('0x29')](_0x26afcb);return _0x38f1b3[_0xb5be('0x2f')](_0xb5be('0x30'),_0x1b596e+'-'+_0xd0e480+'/'+_0x300969)[_0xb5be('0x2b')](_0x53b43b);}return null;};}function patchUpdates(_0x413d5b){return function(_0x30d81c){try{jsonpatch[_0xb5be('0x31')](_0x30d81c,_0x413d5b,!![]);}catch(_0x2910ae){return BPromise['reject'](_0x2910ae);}return _0x30d81c['save']();};}function saveUpdates(_0x1e678e,_0x350d8d){return function(_0x3c05e8){if(_0x3c05e8){return _0x3c05e8[_0xb5be('0x32')](_0x1e678e)[_0xb5be('0x33')](function(_0x488efb){return _0x488efb;});}return null;};}function removeEntity(_0x3d9060,_0x59ebc7){return function(_0x525283){if(_0x525283){return _0x525283['destroy']()['then'](function(){_0x3d9060[_0xb5be('0x29')](0xcc)[_0xb5be('0x2a')]();});}};}function handleEntityNotFound(_0x16355a,_0x45906a){return function(_0x23d8a5){if(!_0x23d8a5){_0x16355a[_0xb5be('0x28')](0x194);}return _0x23d8a5;};}function handleError(_0x102543,_0x4efb53){_0x4efb53=_0x4efb53||0x1f4;return function(_0xc2499){logger[_0xb5be('0x24')](_0xc2499[_0xb5be('0x34')]);if(_0xc2499['name']){delete _0xc2499[_0xb5be('0x35')];}_0x102543['status'](_0x4efb53)[_0xb5be('0x36')](_0xc2499);};}function getInteractionUsers(_0x1df4f4,_0x293ef2){return new BPromise(function(_0x5d6e14,_0x30961b){try{if(_0x293ef2[_0x1df4f4['id']]){_0x1df4f4[_0xb5be('0x37')]=_[_0xb5be('0x38')](_0x293ef2[_0x1df4f4['id']],function(_0x3fc2d5){return{'id':_0x3fc2d5['id'],'fullname':_0x3fc2d5[_0xb5be('0x39')]};});}}catch(_0x1e17d4){_0x30961b(_0x1e17d4);}_0x5d6e14(_0x1df4f4);});}function getInteractionTags(_0x4b1f87,_0x301b36){return new BPromise(function(_0x4ee16b,_0x494398){try{if(_0x4b1f87[_0xb5be('0x3a')]){_0x4b1f87[_0xb5be('0x3b')]=[];_0x4b1f87[_0xb5be('0x3a')]['split'](',')['forEach'](function(_0x3daeb1){_0x4b1f87[_0xb5be('0x3b')][_0xb5be('0x3c')](_0x301b36[_0x3daeb1]);});}delete _0x4b1f87[_0xb5be('0x3a')];}catch(_0x250f45){_0x494398(_0x250f45);}_0x4ee16b(_0x4b1f87);});}function updateChatInteraction(_0x339d08,_0x4efd6b,_0x52e50d){return new BPromise(function(_0x595a6a,_0x105114){return getInteractionUsers(_0x339d08,_0x52e50d)[_0xb5be('0x33')](function(_0x428de7){return getInteractionTags(_0x428de7,_0x4efd6b);})[_0xb5be('0x33')](function(_0x3a704b){_0x595a6a(_0x3a704b);})['catch'](function(_0x485c5c){_0x105114(_0x485c5c);});});}exports[_0xb5be('0x3d')]=function(_0x1405e3,_0xe04f30){var _0x3af79d={},_0x5aeaad={},_0x133e6b={'count':0x0,'rows':[]};var _0x1e7eaa=_['map'](db[_0xb5be('0x3e')][_0xb5be('0x3f')],function(_0x3caaac){return{'name':_0x3caaac[_0xb5be('0x40')],'type':_0x3caaac[_0xb5be('0x41')]['key']};});_0x5aeaad[_0xb5be('0x42')]=_['map'](_0x1e7eaa,_0xb5be('0x35'));_0x5aeaad[_0xb5be('0x43')]=_[_0xb5be('0x44')](_0x1405e3[_0xb5be('0x43')]);_0x5aeaad['filters']=_[_0xb5be('0x45')](_0x5aeaad[_0xb5be('0x42')],_0x5aeaad['query']);_0x3af79d[_0xb5be('0x46')]=_['intersection'](_0x5aeaad['model'],qs[_0xb5be('0x47')](_0x1405e3[_0xb5be('0x43')][_0xb5be('0x47')]));_0x3af79d['attributes']=_0x3af79d['attributes'][_0xb5be('0x48')]?_0x3af79d[_0xb5be('0x46')]:_0x5aeaad[_0xb5be('0x42')];if(!_0x1405e3['query']['hasOwnProperty']('nolimit')){_0x3af79d['limit']=qs[_0xb5be('0x2e')](_0x1405e3[_0xb5be('0x43')]['limit']);_0x3af79d[_0xb5be('0x2d')]=qs['offset'](_0x1405e3['query'][_0xb5be('0x2d')]);}_0x3af79d['order']=qs[_0xb5be('0x49')](_0x1405e3[_0xb5be('0x43')][_0xb5be('0x49')]);_0x3af79d[_0xb5be('0x4a')]=qs['filters'](_[_0xb5be('0x4b')](_0x1405e3['query'],_0x5aeaad[_0xb5be('0x4c')]),_0x1e7eaa);var _0x82c230=[];var _0x479932=squel[_0xb5be('0x4d')]()[_0xb5be('0x4e')]('id')[_0xb5be('0x4e')](_0xb5be('0x35'))[_0xb5be('0x4e')]('color')['from'](_0xb5be('0x4f'));var _0x258786=squel[_0xb5be('0x4d')]()[_0xb5be('0x4e')](_0xb5be('0x50'))['field']('u.fullname')[_0xb5be('0x4e')](_0xb5be('0x51'))[_0xb5be('0x52')](_0xb5be('0x53'),'ui')['left_join'](_0xb5be('0x54'),'u',_0xb5be('0x55'));var _0x5b13ad=squel[_0xb5be('0x4d')]()[_0xb5be('0x52')](_0xb5be('0x56'),'i')[_0xb5be('0x57')]('cm_contacts','c',_0xb5be('0x58'))[_0xb5be('0x57')](_0xb5be('0x54'),'o',_0xb5be('0x59'))[_0xb5be('0x57')](_0xb5be('0x5a'),'a',_0xb5be('0x5b'))[_0xb5be('0x57')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')['left_join'](_0xb5be('0x5c'),'it',_0xb5be('0x5d'))[_0xb5be('0x57')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x1578c9=squel[_0xb5be('0x5e')]();var _0x41c19a=[];var _0x1ab892=squel['expr']();var _0x4208b2;if(_0x1405e3[_0xb5be('0x43')][_0xb5be('0x5f')]){_0x4208b2=as['parseSearch'](_0x1405e3[_0xb5be('0x43')]['search']);var _0x50d1df=_0x4208b2[_0xb5be('0x60')];for(var _0x5ead80=0x0;_0x5ead80<_0x4208b2['conditions'][_0xb5be('0x48')];_0x5ead80++){var _0x27f0f8=_0x4208b2[_0xb5be('0x61')][_0x5ead80];var _0x26d400='i';var _0x50206b=_[_0xb5be('0x62')](_0x1e7eaa,[_0xb5be('0x35'),_0x27f0f8['field']]);if(!_0x50206b){switch(_0x27f0f8[_0xb5be('0x4e')]){case'unreadMessages':if(_0x27f0f8[_0xb5be('0x63')]==0x1){_0x5b13ad[_0xb5be('0x64')]('`'+_0x27f0f8[_0xb5be('0x4e')]+'`\x20=\x200');}else{_0x5b13ad['having']('`'+_0x27f0f8[_0xb5be('0x4e')]+_0xb5be('0x65'));}break;case'Contact':if(_0x27f0f8[_0xb5be('0x66')]===_0xb5be('0x67')){if(_0x27f0f8[_0xb5be('0x63')][_0xb5be('0x68')]('\x20')[_0xb5be('0x48')]>0x1){_0x1578c9[_0x50d1df](_0xb5be('0x69'),qs[_0xb5be('0x6a')](_0x27f0f8[_0xb5be('0x63')]),null);}else{var _0x41d216='%'+_0x27f0f8[_0xb5be('0x63')]+'%';_0x1578c9[_0x50d1df](_0xb5be('0x6b'),_0x41d216,_0x41d216,_0x41d216);}}else{_0x50206b=_['find'](_0x1e7eaa,['name','ContactId']);_0x27f0f8['field']=_0xb5be('0x6c');_0x3397a6=as['buildExpression'](_0x26d400,_0x50206b[_0xb5be('0x41')],_0x27f0f8);_0x1578c9[_0x50d1df](_0x3397a6['text'],_0x3397a6[_0xb5be('0x63')]['start'],_0x3397a6[_0xb5be('0x63')][_0xb5be('0x2a')]);}break;case _0xb5be('0x6d'):var _0x35a9e7=_0x27f0f8[_0xb5be('0x63')]['split'](',')[_0xb5be('0x38')](function(_0x295492){return Number(_0x295492);});_0x35a9e7['forEach'](function(_0x4c2ece){_0x1ab892['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4c2ece+',%');});_0x41c19a=_[_0xb5be('0x6e')](_0x41c19a,_0x35a9e7);break;case _0xb5be('0x6f'):if(_0x27f0f8[_0xb5be('0x66')]===_0xb5be('0x67')){_0x1578c9[_0x50d1df](_0xb5be('0x70'),'%'+_0x27f0f8[_0xb5be('0x63')]+'%',null);}else{_0x50206b=_['find'](_0x1e7eaa,['name',_0xb5be('0x71')]);_0x27f0f8[_0xb5be('0x4e')]=_0xb5be('0x71');_0x3397a6=as[_0xb5be('0x72')](_0x26d400,_0x50206b['type'],_0x27f0f8);_0x1578c9[_0x50d1df](_0x3397a6['text'],_0x3397a6[_0xb5be('0x63')][_0xb5be('0x73')],_0x3397a6[_0xb5be('0x63')][_0xb5be('0x2a')]);}break;case'body':_0x3397a6=as[_0xb5be('0x72')]('me',null,_0x27f0f8);_0x1578c9[_0x50d1df](_0x3397a6[_0xb5be('0x74')],_0x3397a6[_0xb5be('0x63')][_0xb5be('0x73')],_0x3397a6[_0xb5be('0x63')]['end']);break;}}else{var _0x3397a6=as['buildExpression'](_0x26d400,_0x50206b[_0xb5be('0x41')],_0x27f0f8);_0x1578c9[_0x50d1df](_0x3397a6[_0xb5be('0x74')],_0x3397a6[_0xb5be('0x63')]['start'],_0x3397a6[_0xb5be('0x63')][_0xb5be('0x2a')]);}}}else{var _0x3b69eb=_(_0x1405e3[_0xb5be('0x43')])[_0xb5be('0x44')]()[_0xb5be('0x38')](function(_0x108dc7){return _[_0xb5be('0x75')](_0x1e7eaa,[_0xb5be('0x35'),_0x108dc7])?_0x108dc7:undefined;})[_0xb5be('0x76')]()[_0xb5be('0x63')]();if(!_[_0xb5be('0x77')](_0x3b69eb)){_0x3b69eb[_0xb5be('0x78')](function(_0x1df251){if(_0x1df251===_0xb5be('0x79')){_0x5b13ad[_0xb5be('0x4a')](_0xb5be('0x7a'),[]['concat'](_0x1405e3[_0xb5be('0x43')][_0x1df251]));}else if(_0x1df251===_0xb5be('0x7b')){var _0x2237e9=JSON[_0xb5be('0x7c')](_0x1405e3[_0xb5be('0x43')][_0x1df251])['$gte'];var _0x57900b=JSON[_0xb5be('0x7c')](_0x1405e3[_0xb5be('0x43')][_0x1df251])[_0xb5be('0x7d')];_0x5b13ad[_0xb5be('0x4a')](_0xb5be('0x7e'),_0x2237e9,_0x57900b);}else{if(_0x1405e3['query'][_0x1df251]===_0xb5be('0x7f')){_0x5b13ad[_0xb5be('0x4a')]('i.'+_0x1df251+_0xb5be('0x80'));}else{_0x5b13ad['where']('i.'+_0x1df251+_0xb5be('0x81'),_0x1405e3[_0xb5be('0x43')][_0x1df251]);}}});}if(_0x1405e3[_0xb5be('0x43')][_0xb5be('0x82')]){if(_0x1405e3[_0xb5be('0x43')][_0xb5be('0x82')]==0x1){_0x5b13ad['having'](_0xb5be('0x83'));}else{_0x5b13ad[_0xb5be('0x64')](_0xb5be('0x84'));}}if(_0x1405e3[_0xb5be('0x43')][_0xb5be('0x85')]){_0x41c19a=_[_0xb5be('0x86')](_0x1405e3[_0xb5be('0x43')]['tag'])?_0x1405e3[_0xb5be('0x43')][_0xb5be('0x85')]:new Array(_0x1405e3[_0xb5be('0x43')][_0xb5be('0x85')]);_0x41c19a[_0xb5be('0x78')](function(_0x4dc852){_0x1ab892['or'](_0xb5be('0x87'),'%,'+_0x4dc852+',%');});}if(_0x1405e3[_0xb5be('0x43')]['filter']){var _0x42e5dd=_0x1405e3[_0xb5be('0x43')][_0xb5be('0x88')]['replace']('\x5c','\x5c\x5c')[_0xb5be('0x89')](/'/g,'\x27\x27');if(qs[_0xb5be('0x8a')](_0x42e5dd)){_0x1578c9['or'](_0xb5be('0x8b'),_0x42e5dd+'%');}else{_0x1578c9['or'](_0xb5be('0x8c'),qs['getFullTextValue'](_0x42e5dd))['or'](_0xb5be('0x8d'),_0x42e5dd+'%');}}}_0x5b13ad[_0xb5be('0x4a')](_0x1578c9);_0x5b13ad[_0xb5be('0x8e')](_0xb5be('0x8f'));var _0x62379c={'type':db['Sequelize']['QueryTypes'][_0xb5be('0x90')],'raw':!![]};var _0x462d95=_0x5b13ad[_0xb5be('0x91')]();_0x462d95[_0xb5be('0x4e')](_0xb5be('0x8f'));_0x462d95[_0xb5be('0x4e')](_0xb5be('0x92'),_0xb5be('0x93'));if(_0x3af79d[_0xb5be('0x94')]){_0x3af79d[_0xb5be('0x94')][_0xb5be('0x78')](function(_0x1bd4be){var _0x1e1b4c=_0x1bd4be[0x0]==='contactName'?_0x1bd4be[0x0]:'i.'+_0x1bd4be[0x0];_0x5b13ad[_0xb5be('0x94')](_0x1e1b4c,_0x1bd4be[0x1]===_0xb5be('0x95')?![]:!![]);});}if(!_[_0xb5be('0x77')](_0x41c19a)){_0x5b13ad[_0xb5be('0x64')](_0x1ab892);_0x462d95[_0xb5be('0x4a')]('t.id\x20IN\x20?',_0x41c19a);}BPromise[_0xb5be('0x96')]()[_0xb5be('0x33')](function(){if(!_0x4208b2){if(_0x1405e3['query']['ChatWebsiteId'])return;_0x462d95[_0xb5be('0x4a')](_0xb5be('0x97'));_0x5b13ad['where'](_0xb5be('0x97'));return;}if(_0x1405e3[_0xb5be('0x98')]['role']!=='agent')return;return _0x1405e3[_0xb5be('0x98')][_0xb5be('0x99')]({'attributes':['id'],'raw':!![]})[_0xb5be('0x33')](function(_0x54edd0){if(_[_0xb5be('0x77')](_0x54edd0)){_0x462d95[_0xb5be('0x4a')]('i.ChatWebsiteId\x20IS\x20NULL');_0x5b13ad[_0xb5be('0x4a')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x462d95[_0xb5be('0x4a')](_0xb5be('0x7a'),_[_0xb5be('0x38')](_0x54edd0,'id'));_0x5b13ad[_0xb5be('0x4a')]('i.ChatWebsiteId\x20IN\x20?',_[_0xb5be('0x38')](_0x54edd0,'id'));}});})[_0xb5be('0x33')](function(){if(_0x1405e3['user'][_0xb5be('0x9a')]==='agent'&&!_0x4208b2&&!_0x1405e3['query'][_0xb5be('0x79')])return[];return db['sequelize'][_0xb5be('0x43')](_0x462d95['toString'](),_0x62379c);})['then'](function(_0x488cb2){_0x133e6b[_0xb5be('0x2c')]=_0x488cb2['length'];if(_0x133e6b[_0xb5be('0x2c')]===0x0)return[];return db[_0xb5be('0x9b')][_0xb5be('0x43')](_0x479932[_0xb5be('0x9c')](),_0x62379c)[_0xb5be('0x33')](function(_0x2688c6){_0x82c230=_[_0xb5be('0x9d')](_0x2688c6,'id');_0x62379c=_[_0xb5be('0x9e')](_0x62379c,{'model':db[_0xb5be('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1405e3[_0xb5be('0x43')]['fields']){_0x3af79d[_0xb5be('0x46')][_0xb5be('0x78')](function(_0xd4c231){_0x5b13ad[_0xb5be('0x4e')]('i.'+_0xd4c231);});}else{_0x5b13ad[_0xb5be('0x4e')](_0xb5be('0x92'),'unreadMessages');_0x5b13ad[_0xb5be('0x4e')](_0xb5be('0x9f'),_0xb5be('0xa0'));_0x5b13ad['field'](_0xb5be('0xa1'),_0xb5be('0xa2'));_0x5b13ad[_0xb5be('0x4e')](_0xb5be('0xa3'),'contactName');_0x5b13ad[_0xb5be('0x4e')](_0xb5be('0xa4'));_0x5b13ad['field'](_0xb5be('0xa5'),'Contact.firstName');_0x5b13ad[_0xb5be('0x4e')](_0xb5be('0xa6'),_0xb5be('0xa7'));_0x5b13ad[_0xb5be('0x4e')](_0xb5be('0xa8'),_0xb5be('0xa9'));_0x5b13ad[_0xb5be('0x4e')]('c.phone',_0xb5be('0xaa'));_0x5b13ad[_0xb5be('0x4e')]('c.mobile','Contact.mobile');_0x5b13ad[_0xb5be('0x4e')]('c.fax',_0xb5be('0xab'));_0x5b13ad[_0xb5be('0x4e')](_0xb5be('0xac'),_0xb5be('0xad'));_0x5b13ad['field'](_0xb5be('0xae'),_0xb5be('0xaf'));_0x5b13ad[_0xb5be('0x4e')](_0xb5be('0xb0'),_0xb5be('0x3a'));}if(_0x3af79d[_0xb5be('0x2e')])_0x5b13ad[_0xb5be('0x2e')](_0x3af79d['limit']);if(_0x3af79d[_0xb5be('0x2d')])_0x5b13ad[_0xb5be('0x2d')](_0x3af79d[_0xb5be('0x2d')]);return db['sequelize']['query'](_0x5b13ad[_0xb5be('0x9c')](),_0x62379c);})['then'](function(_0x508a38){_0x258786['where'](_0xb5be('0xb1'),_[_0xb5be('0x38')](_0x508a38,'id'));return db[_0xb5be('0x9b')][_0xb5be('0x43')](_0x258786['toString'](),_0x62379c)['then'](function(_0x41a660){var _0x56a439=_[_0xb5be('0xb2')](_0x41a660,_0xb5be('0xb3'));var _0x173698=[];_0x508a38[_0xb5be('0x78')](function(_0x479e36){_0x173698['push'](updateChatInteraction(_0x479e36,_0x82c230,_0x56a439));});return BPromise[_0xb5be('0xb4')](_0x173698);});});})[_0xb5be('0x33')](function(_0x1bb3f1){_0x133e6b[_0xb5be('0xb5')]=_0x1bb3f1;return _0x133e6b;})[_0xb5be('0x33')](respondWithFilteredResult(_0xe04f30,_0x3af79d))[_0xb5be('0x27')](handleError(_0xe04f30,null));};exports[_0xb5be('0xb6')]=function(_0xb118ee,_0x1959f9){var _0x522ddf={'raw':![],'where':{'id':_0xb118ee[_0xb5be('0xb7')]['id']}},_0x2e70a8={};_0x2e70a8[_0xb5be('0x42')]=_[_0xb5be('0x44')](db[_0xb5be('0x3e')][_0xb5be('0x3f')]);_0x2e70a8[_0xb5be('0x43')]=_[_0xb5be('0x44')](_0xb118ee[_0xb5be('0x43')]);_0x2e70a8[_0xb5be('0x4c')]=_[_0xb5be('0x45')](_0x2e70a8[_0xb5be('0x42')],_0x2e70a8['query']);_0x522ddf[_0xb5be('0x46')]=_['intersection'](_0x2e70a8[_0xb5be('0x42')],qs[_0xb5be('0x47')](_0xb118ee[_0xb5be('0x43')][_0xb5be('0x47')]));_0x522ddf[_0xb5be('0x46')]=_0x522ddf['attributes'][_0xb5be('0x48')]?_0x522ddf['attributes']:_0x2e70a8[_0xb5be('0x42')];if(_0xb118ee[_0xb5be('0x43')][_0xb5be('0xb8')]){_0x522ddf[_0xb5be('0xb9')]=[{'all':!![]}];}_0x522ddf=_[_0xb5be('0x9e')]({},_0x522ddf,_0xb118ee[_0xb5be('0xba')]);return db[_0xb5be('0x3e')][_0xb5be('0x62')](_0x522ddf)[_0xb5be('0x33')](handleEntityNotFound(_0x1959f9,null))[_0xb5be('0x33')](respondWithResult(_0x1959f9,null))[_0xb5be('0x27')](handleError(_0x1959f9,null));};exports[_0xb5be('0xbb')]=function(_0x2aa594,_0x3952b5){return db[_0xb5be('0x3e')][_0xb5be('0xbb')](_0x2aa594[_0xb5be('0xbc')],{})[_0xb5be('0x33')](respondWithResult(_0x3952b5,0xc9))[_0xb5be('0x27')](handleError(_0x3952b5,null));};exports['update']=function(_0x283370,_0x535faa){if(_0x283370[_0xb5be('0xbc')]['id']){delete _0x283370[_0xb5be('0xbc')]['id'];}return db[_0xb5be('0x3e')][_0xb5be('0x62')]({'where':{'id':_0x283370[_0xb5be('0xb7')]['id']}})[_0xb5be('0x33')](handleEntityNotFound(_0x535faa,null))[_0xb5be('0x33')](saveUpdates(_0x283370['body'],null))[_0xb5be('0x33')](respondWithResult(_0x535faa,null))[_0xb5be('0x27')](handleError(_0x535faa,null));};exports[_0xb5be('0xbd')]=function(_0x4bdc1f,_0x45a751){return db[_0xb5be('0x3e')]['find']({'where':{'id':_0x4bdc1f['params']['id']}})[_0xb5be('0x33')](handleEntityNotFound(_0x45a751,null))[_0xb5be('0x33')](removeEntity(_0x45a751,null))['catch'](handleError(_0x45a751,null));};exports[_0xb5be('0xbe')]=function(_0x53a8d8,_0x1f8636){return db['ChatInteraction']['describe']()[_0xb5be('0x33')](respondWithResult(_0x1f8636,null))[_0xb5be('0x27')](handleError(_0x1f8636,null));};exports[_0xb5be('0xbf')]=function(_0x358b7b,_0x1350d7){var _0xf96273=_0x358b7b[_0xb5be('0xb7')]['id'];var _0x1df8ce;var _0x2f73e6;var _0x4e3a67;return db[_0xb5be('0x3e')][_0xb5be('0xc0')]({'where':{'id':_0xf96273}})[_0xb5be('0x33')](function(_0x4672d9){_0x1df8ce=_0x4672d9;return db[_0xb5be('0xc1')][_0xb5be('0xc0')]({'where':{'id':_0x4672d9[_0xb5be('0x79')]},'attributes':['id',_0xb5be('0xc2'),_0xb5be('0xc3')],'raw':!![]});})[_0xb5be('0x33')](function(_0x452cdf){if(_0x452cdf&&_0x452cdf['vidaooApiKey']&&_0x452cdf['vidaooEscalation']){_0x2f73e6=_0x452cdf;var _0x49f219={'rejectUnauthorized':![],'method':'POST','uri':_0xb5be('0xc4'),'headers':{'X-APIKEY':_0x452cdf[_0xb5be('0xc2')]},'body':{'name':_0xb5be('0xc5')+_0xf96273},'redirect':_0xb5be('0xc6'),'json':!![]};return rp(_0x49f219);}else{throw new db[(_0xb5be('0xc7'))][(_0xb5be('0xc8'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xb5be('0x33')](function(_0x47f80d){_0x4e3a67=_0x47f80d;if(_0x4e3a67['id']){var _0x2016ea={'body':_0x4e3a67['join_url'],'ChatWebsiteId':_0x2f73e6['id'],'ChatInteractionId':_0x1df8ce['id'],'direction':_0xb5be('0xc9'),'UserId':_0x358b7b[_0xb5be('0x98')]['id']};return db['ChatMessage'][_0xb5be('0xbb')](_0x2016ea,{});}else{throw new db[(_0xb5be('0xc7'))][(_0xb5be('0xc8'))](_0xb5be('0xca'));}})[_0xb5be('0x33')](function(){return _0x1df8ce['updateAttributes']({'vidaooSessionId':_0x4e3a67['id']});})[_0xb5be('0x33')](respondWithResult(_0x1350d7,null))['catch'](handleError(_0x1350d7,null));};exports[_0xb5be('0xcb')]=function(_0x1fa3c0,_0x358c96){if(_0x1fa3c0[_0xb5be('0xbc')]['id']){delete _0x1fa3c0['body']['id'];}return db[_0xb5be('0x3e')][_0xb5be('0x62')]({'where':{'id':_0x1fa3c0[_0xb5be('0xb7')]['id']},'include':[{'model':db[_0xb5be('0xcc')],'as':_0xb5be('0xcd')}]})[_0xb5be('0x33')](handleEntityNotFound(_0x358c96,null))[_0xb5be('0x33')](saveUpdates(_0x1fa3c0[_0xb5be('0xbc')],null))['then'](respondWithResult(_0x358c96,null))['catch'](handleError(_0x358c96,null));};exports[_0xb5be('0xce')]=function(_0x4bbbe4,_0x353fe4,_0x3904d7){if(_0x4bbbe4['body']['id']){delete _0x4bbbe4[_0xb5be('0xbc')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x4bbbe4[_0xb5be('0xb7')]['id']}})[_0xb5be('0x33')](function(_0x1a2d70){if(!_0x1a2d70){logger[_0xb5be('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xb5be('0xce'),0x194,'entity\x20not\x20found');_0x353fe4[_0xb5be('0x28')](0x194);}else{if(_0x1a2d70[_0xb5be('0x71')]){throw new db[(_0xb5be('0xc7'))][(_0xb5be('0xc8'))](_0xb5be('0xcf'));}}return _0x1a2d70;})[_0xb5be('0x33')](function(_0x735d36){if(_0x735d36){return _0x735d36['update']({'closed':_0x4bbbe4[_0xb5be('0xbc')][_0xb5be('0xd0')],'disposition':_0x4bbbe4[_0xb5be('0xbc')][_0xb5be('0xd1')]})[_0xb5be('0x33')](function(_0x4e0e5e){return _0x4e0e5e;});}})['then'](function(_0x33c744){return respondWithRpcPromise('AbandonInteraction',_0xb5be('0xce'),_0x4bbbe4[_0xb5be('0xbc')],client9004);})['then'](respondWithResult(_0x353fe4,null))[_0xb5be('0x27')](handleError(_0x353fe4,null));};exports[_0xb5be('0xd2')]=function(_0x13f705,_0x20b694,_0x3851dc){_0x13f705[_0xb5be('0xbc')][_0xb5be('0x35')]=_0x13f705['file'][_0xb5be('0xd3')];_0x13f705[_0xb5be('0xbc')][_0xb5be('0xd4')]=_0x13f705[_0xb5be('0xd5')][_0xb5be('0xd6')];_0x13f705[_0xb5be('0xbc')][_0xb5be('0x41')]=_0x13f705[_0xb5be('0xd5')][_0xb5be('0xd7')];return db[_0xb5be('0xd8')][_0xb5be('0xbb')](_0x13f705[_0xb5be('0xbc')])[_0xb5be('0x33')](respondWithResult(_0x20b694,0xc9))['catch'](handleError(_0x20b694,null));};exports[_0xb5be('0xd9')]=function(_0x218024,_0x5584db,_0x1664e2){return db[_0xb5be('0x3e')]['findOne']({'where':{'id':_0x218024['params']['id']},'raw':!![]})[_0xb5be('0x33')](handleEntityNotFound(_0x5584db,null))[_0xb5be('0x33')](function(_0x3d9f51){if(_0x3d9f51){if(_0x3d9f51[_0xb5be('0xd0')]){return _0x5584db['status'](0x193)[_0xb5be('0x2b')]({'status':0x193,'message':'Unauthorized'});}return db[_0xb5be('0xd8')][_0xb5be('0xc0')]({'where':{'id':_0x218024[_0xb5be('0x43')][_0xb5be('0xda')]},'raw':!![]})['then'](handleEntityNotFound(_0x5584db,null));}})[_0xb5be('0x33')](function(_0x142345){if(_0x142345){var _0x482a39=_0x142345[_0xb5be('0xdb')]!==null;var _0x112c27=path[_0xb5be('0xdc')](config[_0xb5be('0xdd')],_0xb5be('0xde'));if(_0x482a39){_0x112c27=path[_0xb5be('0xdc')](_0x112c27,_0xb5be('0xdf'));}var _0x1cd69e=path[_0xb5be('0xdc')](_0x112c27,_0x142345[_0xb5be('0xd4')]);return _0x5584db[_0xb5be('0xe0')](_0x1cd69e);}})[_0xb5be('0x27')](handleError(_0x5584db,null));};exports[_0xb5be('0xe1')]=function(_0x5c236d,_0xf9a8ea){var _0x222e9d=null;var _0x516cd5=null;var _0x31c8be=null;var _0x360149=null;if(_0x5c236d['body']['id']){delete _0x5c236d['body']['id'];}if(_0x5c236d[_0xb5be('0xbc')]['mailTranscript']){_0x360149=path[_0xb5be('0xdc')](config['root'],_0xb5be('0xe2'),util['format'](_0xb5be('0xe3'),Date[_0xb5be('0xe4')]()));_0x5c236d[_0xb5be('0xbc')]['pathTranscript']=_0x360149;}return db[_0xb5be('0x3e')][_0xb5be('0x62')]({'where':{'id':_0x5c236d[_0xb5be('0xb7')]['id']},'include':[{'model':db[_0xb5be('0xe5')],'as':_0xb5be('0xe6'),'include':[{'model':db['User'],'as':_0xb5be('0x6f')}]}]})[_0xb5be('0x33')](handleEntityNotFound(_0xf9a8ea,null))[_0xb5be('0x33')](saveUpdates(_0x5c236d['body'],null))[_0xb5be('0x33')](function(_0x52b595){if(_0x52b595){_0x222e9d=_0x52b595;return db['ChatWebsite']['find']({'where':{'id':_0x222e9d[_0xb5be('0x79')]}});}})[_0xb5be('0x33')](function(_0x5bff95){if(_0x5bff95){_0x31c8be=_0x5bff95;return db[_0xb5be('0xcc')][_0xb5be('0x62')]({'where':{'id':_0x222e9d['ContactId']}});}})[_0xb5be('0x33')](function(_0xa4ed30){if(_0xa4ed30){_0x516cd5=_0xa4ed30;if(_0x360149){var _0x8e3a5f=null;for(var _0x105f9d=0x1;_0x105f9d<_0x222e9d[_0xb5be('0xe6')]['length'];++_0x105f9d){_0x8e3a5f=_0x222e9d['Messages'][_0x105f9d];var _0x549b00=_0x8e3a5f[_0xb5be('0x71')]?util[_0xb5be('0xe7')](_0xb5be('0xe8'),_0x31c8be[_0xb5be('0xe9')],_0x8e3a5f[_0xb5be('0x71')]):_0xb5be('0xea');var _0x5302a8=_0x5c236d[_0xb5be('0xbc')][_0xb5be('0xeb')]||util[_0xb5be('0xe7')](_0xb5be('0xe8'),_0xb5be('0xec'),_0x8e3a5f[_0xb5be('0x6c')]);switch(_0x31c8be['agentIdentifier']){case _0xb5be('0xed'):_0x549b00=_0x8e3a5f[_0xb5be('0x71')]?util[_0xb5be('0xe7')]('%s%d',_0x31c8be[_0xb5be('0xe9')],_0x8e3a5f[_0xb5be('0x71')]):_0xb5be('0xea');break;case _0xb5be('0xee'):_0x549b00=_0x8e3a5f[_0xb5be('0x71')]?_0x8e3a5f['User'][_0xb5be('0xef')]||_0x8e3a5f[_0xb5be('0x6f')][_0xb5be('0x39')]:_0xb5be('0xea');break;case _0xb5be('0xf0'):_0x549b00=_0x8e3a5f[_0xb5be('0x71')]?_0x8e3a5f['User'][_0xb5be('0x39')]:_0xb5be('0xea');break;default:_0x549b00=_0x8e3a5f[_0xb5be('0x71')]?util[_0xb5be('0xe7')](_0xb5be('0xe8'),_0x31c8be[_0xb5be('0xe9')],_0x8e3a5f[_0xb5be('0x71')]):_0xb5be('0xea');}var _0x1c4580=util[_0xb5be('0xe7')]('[%s]\x20%s:\x20%s\x0a',moment(_0x8e3a5f[_0xb5be('0x7b')])['format'](_0xb5be('0xf1')),_0x8e3a5f[_0xb5be('0xf2')]==='in'?_0x5302a8:_0x549b00,_0x8e3a5f['body']);if(!_0x8e3a5f[_0xb5be('0xf3')]){fs['appendFileSync'](_0x360149,_0x1c4580);}}return db[_0xb5be('0xf4')][_0xb5be('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0xb5be('0xf5')],'as':_0xb5be('0xf6'),'raw':!![]}]});}}})[_0xb5be('0x33')](function(_0x3e8640){if(_0x3e8640&&_0x3e8640[_0xb5be('0xf6')]&&_0x5c236d[_0xb5be('0xbc')]){var _0xcfc71e={'tls':{'rejectUnauthorized':![]}};if(_0x3e8640[_0xb5be('0xf6')][_0xb5be('0xf7')]){_0xcfc71e[_0xb5be('0xf7')]=_0x3e8640['Smtp']['service'];}else{_0xcfc71e[_0xb5be('0xf8')]=_0x3e8640[_0xb5be('0xf6')][_0xb5be('0xf8')];_0xcfc71e[_0xb5be('0xf9')]=_0x3e8640[_0xb5be('0xf6')]['port'];_0xcfc71e[_0xb5be('0xfa')]=_0x3e8640[_0xb5be('0xf6')][_0xb5be('0xfa')];}if(_0x3e8640['Smtp']['authentication']){_0xcfc71e[_0xb5be('0xfb')]={'user':_0x3e8640[_0xb5be('0xf6')][_0xb5be('0x98')],'pass':_0x3e8640[_0xb5be('0xf6')][_0xb5be('0xfc')]};}return respondWithRpcPromise(_0xb5be('0xfd'),_0xb5be('0xfe'),{'account':_0xcfc71e,'message':{'from':util[_0xb5be('0xe7')](_0xb5be('0xff'),_0x3e8640[_0xb5be('0x35')],_0x3e8640[_0xb5be('0x100')]||_0x3e8640[_0xb5be('0xf6')][_0xb5be('0x98')]),'to':_0x5c236d['body'][_0xb5be('0x101')],'subject':_0xb5be('0x102'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x5c236d[_0xb5be('0xbc')][_0xb5be('0x101')]),'attachments':[{'path':_0x360149}]}})[_0xb5be('0x33')](function(){return _0x222e9d;})[_0xb5be('0x27')](function(_0xc631dd){console[_0xb5be('0x24')](_0xc631dd);});}else{return _0x222e9d;}})[_0xb5be('0x33')](respondWithStatusCode(_0xf9a8ea,0xc8))[_0xb5be('0x27')](handleError(_0xf9a8ea,null));};exports[_0xb5be('0x103')]=function(_0x8d8cc6,_0x4824ee,_0x15721a){return db[_0xb5be('0xe5')]['find']({'where':{'id':_0x8d8cc6[_0xb5be('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4824ee,null))[_0xb5be('0x33')](function(_0x1da38a){if(_0x1da38a){return _0x1da38a[_0xb5be('0x103')](_0x8d8cc6[_0xb5be('0xbc')][_0xb5be('0x104')],_[_0xb5be('0x105')](_0x8d8cc6[_0xb5be('0xbc')],['ids','id'])||{});}})[_0xb5be('0x33')](respondWithResult(_0x4824ee,null))[_0xb5be('0x27')](handleError(_0x4824ee,null));};exports[_0xb5be('0x106')]=function(_0x25b180,_0x378823,_0x48d634){var _0x35eeb6={'raw':![],'where':{}};var _0x2db877={};var _0x267784={'count':0x0,'rows':[]};return db[_0xb5be('0x3e')]['findOne']({'where':{'id':_0x25b180[_0xb5be('0xb7')]['id']}})['then'](handleEntityNotFound(_0x378823,null))[_0xb5be('0x33')](function(_0x359e08){if(_0x359e08){_0x2db877[_0xb5be('0x42')]=_[_0xb5be('0x44')](db[_0xb5be('0xe5')][_0xb5be('0x3f')]);_0x2db877['query']=_[_0xb5be('0x44')](_0x25b180[_0xb5be('0x43')]);_0x2db877[_0xb5be('0x4c')]=_[_0xb5be('0x45')](_0x2db877[_0xb5be('0x42')],_0x2db877['query']);_0x35eeb6[_0xb5be('0x46')]=_[_0xb5be('0x45')](_0x2db877[_0xb5be('0x42')],qs[_0xb5be('0x47')](_0x25b180[_0xb5be('0x43')][_0xb5be('0x47')]));_0x35eeb6[_0xb5be('0x46')]=_0x35eeb6[_0xb5be('0x46')][_0xb5be('0x48')]?_0x35eeb6[_0xb5be('0x46')]:_0x2db877[_0xb5be('0x42')];if(!_0x25b180['query']['hasOwnProperty'](_0xb5be('0x107'))){_0x35eeb6[_0xb5be('0x2e')]=qs[_0xb5be('0x2e')](_0x25b180[_0xb5be('0x43')][_0xb5be('0x2e')]);_0x35eeb6[_0xb5be('0x2d')]=qs[_0xb5be('0x2d')](_0x25b180[_0xb5be('0x43')][_0xb5be('0x2d')]);}_0x35eeb6[_0xb5be('0x94')]=qs[_0xb5be('0x49')](_0x25b180['query'][_0xb5be('0x49')]);_0x35eeb6['where']=qs[_0xb5be('0x4c')](_['pick'](_0x25b180['query'],_0x2db877[_0xb5be('0x4c')]));_0x35eeb6[_0xb5be('0x4a')][_0xb5be('0xb3')]=_0x359e08['id'];if(_0x25b180[_0xb5be('0x43')]['filter']){_0x35eeb6[_0xb5be('0x4a')]=_[_0xb5be('0x9e')](_0x35eeb6[_0xb5be('0x4a')],{'$or':_[_0xb5be('0x38')](_0x35eeb6['attributes'],function(_0x504426){var _0x185e92={};_0x185e92[_0x504426]={'$like':'%'+_0x25b180[_0xb5be('0x43')][_0xb5be('0x88')]+'%'};return _0x185e92;})});}if(_0x25b180[_0xb5be('0x43')]['$gte']){var _0x4ceb9b=_0x25b180[_0xb5be('0x43')][_0xb5be('0x108')]['split'](',');var _0x4518c4={};_0x4518c4[_0x4ceb9b[0x0]]={'$gte':moment(_0x4ceb9b[0x1])[_0xb5be('0xe7')](_0xb5be('0x109'))};_0x35eeb6[_0xb5be('0x4a')]=_[_0xb5be('0x9e')](_0x35eeb6[_0xb5be('0x4a')],_0x4518c4);}_0x35eeb6=_[_0xb5be('0x9e')]({},_0x35eeb6,_0x25b180['options']);return db[_0xb5be('0xe5')][_0xb5be('0x2c')]({'where':_0x35eeb6[_0xb5be('0x4a')]})['then'](function(_0x441d66){_0x267784[_0xb5be('0x2c')]=_0x441d66;if(_0x25b180[_0xb5be('0x43')][_0xb5be('0xb8')]){_0x35eeb6['include']=[{'all':!![]}];}return db[_0xb5be('0xe5')][_0xb5be('0x10a')](_0x35eeb6);})[_0xb5be('0x33')](function(_0x573d68){_0x267784[_0xb5be('0xb5')]=_0x573d68;return _0x267784;});}})[_0xb5be('0x33')](respondWithFilteredResult(_0x378823,_0x35eeb6))[_0xb5be('0x27')](handleError(_0x378823,null));};exports['getMyMessages']=function(_0x252379,_0x5b684f,_0x3efde1){var _0x2ff2bf={'where':{}},_0xc34b7={},_0x54d1d4={'count':0x0,'rows':[]};return db[_0xb5be('0x3e')][_0xb5be('0xc0')]({'where':{'id':_0x252379['params']['id']}})['then'](handleEntityNotFound(_0x5b684f,null))['then'](function(_0x45695b){if(_0x45695b){_0xc34b7[_0xb5be('0x42')]=_[_0xb5be('0x44')](db[_0xb5be('0xe5')][_0xb5be('0x3f')]);_0xc34b7[_0xb5be('0x43')]=_[_0xb5be('0x44')](_0x252379[_0xb5be('0x43')]);_0xc34b7[_0xb5be('0x4c')]=_['intersection'](_0xc34b7[_0xb5be('0x42')],_0xc34b7[_0xb5be('0x43')]);_0x2ff2bf[_0xb5be('0x46')]=_['intersection'](_0xc34b7[_0xb5be('0x42')],qs[_0xb5be('0x47')](_0x252379['query'][_0xb5be('0x47')]));_0x2ff2bf[_0xb5be('0x46')]=_0x2ff2bf[_0xb5be('0x46')][_0xb5be('0x48')]?_0x2ff2bf[_0xb5be('0x46')]:_0xc34b7[_0xb5be('0x42')];if(!_0x252379['query'][_0xb5be('0x10b')](_0xb5be('0x107'))){_0x2ff2bf[_0xb5be('0x2e')]=qs[_0xb5be('0x2e')](_0x252379['query'][_0xb5be('0x2e')]);_0x2ff2bf[_0xb5be('0x2d')]=qs[_0xb5be('0x2d')](_0x252379[_0xb5be('0x43')][_0xb5be('0x2d')]);}_0x2ff2bf[_0xb5be('0x94')]=qs[_0xb5be('0x49')](_0x252379[_0xb5be('0x43')][_0xb5be('0x49')]);_0x2ff2bf[_0xb5be('0x4a')]=qs[_0xb5be('0x4c')](_[_0xb5be('0x4b')](_0x252379[_0xb5be('0x43')],_0xc34b7[_0xb5be('0x4c')]));_0x2ff2bf[_0xb5be('0x4a')][_0xb5be('0xb3')]=_0x45695b['id'];if(_0x252379[_0xb5be('0x43')][_0xb5be('0x88')]){_0x2ff2bf['where']=_[_0xb5be('0x9e')](_0x2ff2bf[_0xb5be('0x4a')],{'$or':_[_0xb5be('0x38')](_0x2ff2bf[_0xb5be('0x46')],function(_0x1837b7){var _0x3a101e={};_0x3a101e[_0x1837b7]={'$like':'%'+_0x252379[_0xb5be('0x43')][_0xb5be('0x88')]+'%'};return _0x3a101e;})});}_0x2ff2bf[_0xb5be('0x4a')][_0xb5be('0xf3')]=![];if(_0x252379['query']['id']){_0x2ff2bf['where']['id']={'$gt':_0x252379[_0xb5be('0x43')]['id']};}_0x2ff2bf=_[_0xb5be('0x9e')]({},_0x2ff2bf,_0x252379['options']);return db['ChatMessage'][_0xb5be('0x2c')]({'where':_0x2ff2bf['where']})[_0xb5be('0x33')](function(_0xc3843){_0x54d1d4[_0xb5be('0x2c')]=_0xc3843;_0x2ff2bf[_0xb5be('0xb9')]=[];if(_0x252379['query'][_0xb5be('0x10c')]){_0x2ff2bf[_0xb5be('0xb9')][_0xb5be('0x3c')]({'model':db[_0xb5be('0x6f')],'as':'User','attributes':['id',_0xb5be('0x39'),_0xb5be('0xef')]});}if(_0x252379[_0xb5be('0x43')][_0xb5be('0xb8')]){_0x2ff2bf[_0xb5be('0xb9')]=[{'all':!![]}];}return db[_0xb5be('0xe5')][_0xb5be('0x10a')](_0x2ff2bf);})[_0xb5be('0x33')](function(_0x4344b8){_0x54d1d4[_0xb5be('0xb5')]=_0x4344b8;return _0x54d1d4;});}})[_0xb5be('0x33')](respondWithFilteredResult(_0x5b684f,_0x2ff2bf))[_0xb5be('0x27')](handleError(_0x5b684f,null));};exports['addTags']=function(_0x33f586,_0x514455,_0x3607c2){return db[_0xb5be('0x3e')]['find']({'where':{'id':_0x33f586[_0xb5be('0xb7')]['id']}})[_0xb5be('0x33')](handleEntityNotFound(_0x514455,null))[_0xb5be('0x33')](function(_0x2a3176){if(_0x2a3176){return _0x2a3176['setTags'](_0x33f586['body'][_0xb5be('0x104')],_['omit'](_0x33f586[_0xb5be('0xbc')],[_0xb5be('0x104'),'id'])||{})[_0xb5be('0x10d')](function(){return db[_0xb5be('0x6d')][_0xb5be('0x10a')]({'attributes':['id',_0xb5be('0x35'),_0xb5be('0x10e')],'where':{'id':_0x33f586['body'][_0xb5be('0x104')]}});})[_0xb5be('0x33')](function(_0x1184b0){socket[_0xb5be('0x10f')]('chatInteractionTags:save',{'id':Number(_0x33f586[_0xb5be('0xb7')]['id']),'tags':_0x1184b0||[]});return{'id':Number(_0x33f586['params']['id']),'tags':_0x1184b0||[]};});}})[_0xb5be('0x33')](respondWithResult(_0x514455,null))[_0xb5be('0x27')](handleError(_0x514455,null));};exports[_0xb5be('0x110')]=function(_0x28a3b9,_0x12ba53,_0x323b00){return db[_0xb5be('0x3e')]['find']({'where':{'id':_0x28a3b9[_0xb5be('0xb7')]['id']}})['then'](handleEntityNotFound(_0x12ba53,null))[_0xb5be('0x33')](function(_0x68f992){if(_0x68f992){return _0x68f992[_0xb5be('0x110')](_0x28a3b9['query'][_0xb5be('0x104')]);}})[_0xb5be('0x33')](respondWithStatusCode(_0x12ba53,null))[_0xb5be('0x27')](handleError(_0x12ba53,null));};exports[_0xb5be('0xe0')]=function(_0x2caeae,_0x436308){var _0x4ed9c7=moment()[_0xb5be('0x111')]()['toString']();var _0x51245c=path[_0xb5be('0xdc')](config[_0xb5be('0xdd')],_0xb5be('0x112'),_0xb5be('0x113'),_0xb5be('0x114'));var _0x3efb7d=path[_0xb5be('0xdc')](config[_0xb5be('0xdd')],_0xb5be('0x112'),'files','attachments');var _0x1326f2=path[_0xb5be('0xdc')](_0x51245c,_0x4ed9c7);var _0x277895=util[_0xb5be('0xe7')](_0xb5be('0x115'),_0x2caeae[_0xb5be('0xb7')]['id'],_0x4ed9c7);var _0x313053=path['join'](_0x51245c,_0x277895);var _0x467938=[];_0x467938[_0xb5be('0x3c')]({'model':db[_0xb5be('0x6f')],'as':_0xb5be('0x6f'),'attributes':['id',_0xb5be('0x39')],'raw':!![]});_0x467938[_0xb5be('0x3c')]({'model':db['CmContact'],'as':_0xb5be('0xcd'),'attributes':['id',_0xb5be('0x116'),'lastName'],'raw':!![]});if(_0x2caeae[_0xb5be('0x43')][_0xb5be('0x117')]){_0x467938['push']({'model':db[_0xb5be('0xd8')],'as':'Attachment','raw':!![]});}var _0x2359e7=[{'model':db[_0xb5be('0xe5')],'as':_0xb5be('0xe6'),'attributes':['id',_0xb5be('0xbc'),_0xb5be('0x7b'),_0xb5be('0xf2'),_0xb5be('0xf3'),_0xb5be('0x82')],'include':_0x467938}];_0x2359e7['push']({'model':db[_0xb5be('0xc1')],'as':_0xb5be('0x118'),'attributes':['id',_0xb5be('0x35')]});_0x2359e7[_0xb5be('0x3c')]({'model':db[_0xb5be('0x6f')],'as':'Owner','attributes':['id',_0xb5be('0x39')]});return db[_0xb5be('0x3e')][_0xb5be('0x62')]({'where':{'id':_0x2caeae[_0xb5be('0xb7')]['id']},'include':_0x2359e7})[_0xb5be('0x33')](handleEntityNotFound(_0x436308,null))[_0xb5be('0x33')](function(_0x7828ce){if(_0x7828ce){var _0x1359a5=_0x7828ce[_0xb5be('0x119')]({'plain':!![]});fs['mkdirSync'](_0x1326f2);var _0x2ba3f3={'channel':_0xb5be('0x11a'),'account':_0x1359a5['Account'][_0xb5be('0x35')],'agent':_0x1359a5[_0xb5be('0x11b')]?_0x1359a5[_0xb5be('0x11b')][_0xb5be('0x39')]:_0xb5be('0x11c'),'createdAt':moment(_0x1359a5[_0xb5be('0x7b')])['format'](_0xb5be('0x109'))[_0xb5be('0x9c')](),'closedAt':_0x1359a5[_0xb5be('0xd0')]?moment(_0x1359a5[_0xb5be('0x11d')])[_0xb5be('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb5be('0x9c')]():'','disposition':_0x1359a5[_0xb5be('0xd1')],'chatInfo':{'browser':_0x1359a5['browserName'],'os':_0x1359a5[_0xb5be('0x11e')],'referer':_0x1359a5[_0xb5be('0x11f')],'customerIp':_0x1359a5[_0xb5be('0x120')],'customerPort':_0x1359a5[_0xb5be('0x121')]?_0x1359a5[_0xb5be('0x121')]:_0xb5be('0x11c')},'messages':_(_0x1359a5[_0xb5be('0xe6')])[_0xb5be('0x122')]()[_0xb5be('0x88')]({'secret':![]})['map'](function(_0x56ba91){if(_0x56ba91[_0xb5be('0xd8')]){var _0x47f814=path[_0xb5be('0xdc')](_0x3efb7d,_0x56ba91[_0xb5be('0xd8')][_0xb5be('0xd4')]);if(fs[_0xb5be('0x123')](_0x47f814)){fs[_0xb5be('0x124')](_0x47f814)[_0xb5be('0x125')](fs[_0xb5be('0x126')](path[_0xb5be('0xdc')](_0x1326f2,_0x56ba91[_0xb5be('0xd8')][_0xb5be('0xd4')])));}}return{'date':moment(_0x56ba91[_0xb5be('0x7b')])[_0xb5be('0xe7')](_0xb5be('0x109'))[_0xb5be('0x9c')](),'sender':_0x56ba91[_0xb5be('0xf2')]==='out'?_0x56ba91[_0xb5be('0x6f')]?_0x56ba91[_0xb5be('0x6f')][_0xb5be('0x39')]:'System':_0x56ba91[_0xb5be('0xcd')]['firstName']+(_0x56ba91[_0xb5be('0xcd')][_0xb5be('0x127')]?'\x20'+_0x56ba91[_0xb5be('0xcd')]['lastName']:''),'body':_0x56ba91[_0xb5be('0xd8')]?_0x56ba91['Attachment'][_0xb5be('0xd4')]:_0x56ba91[_0xb5be('0xbc')],'direction':_0x56ba91[_0xb5be('0xf2')]===_0xb5be('0xc9')?'A':'C','secret':_0x56ba91['secret'],'read':_0x56ba91[_0xb5be('0x82')],'attachment':_0x56ba91[_0xb5be('0xd8')]};})[_0xb5be('0x63')]()};return ejs[_0xb5be('0x128')](path[_0xb5be('0xdc')](config[_0xb5be('0xdd')],_0xb5be('0x112'),_0xb5be('0x129'),_0xb5be('0x12a')),{'interaction':_0x2ba3f3})['then'](function(_0xe4652f){var _0x9431a5=path[_0xb5be('0xdc')](_0x1326f2,'transcript-'+_0x1359a5['id']+'-'+_0x4ed9c7+_0xb5be('0x12b'));var _0x5dca47={'path':_0x9431a5,'channel':_0xb5be('0x11a'),'interactionId':_0x1359a5['id']};return pdf['createPdfFromHTML'](_0xe4652f,_0x5dca47);})[_0xb5be('0x33')](function(){return new BPromise(function(_0x399ac6,_0x52a6ea){zipdir(_0x1326f2,{'saveTo':_0x313053},function(_0x3f941b,_0x1e3784){if(_0x3f941b)return _0x52a6ea(_0x3f941b);return _0x399ac6(_0x1e3784);});})[_0xb5be('0x33')](function(){return new BPromise(function(_0x43b32c,_0x1ab2a1){rimraf(_0x1326f2,function(_0x5374b3){if(_0x5374b3)_0x1ab2a1(_0x5374b3);return _0x43b32c();});});})['then'](function(){return _0x436308['download'](_0x313053,_0x277895,function(_0xe7e31c){if(_0xe7e31c){console[_0xb5be('0x12c')](_0xb5be('0x12d'),_0xe7e31c);}else{fs['unlinkSync'](_0x313053);}});});});}else{return _0x436308[_0xb5be('0x28')](0xc8);}})[_0xb5be('0x27')](handleError(_0x436308,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index d920dc1..4f42ce4 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 _0xbf07=['events','ChatInteraction','../../mysqldb','setMaxListeners','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbf07,0x17a));var _0x7bf0=function(_0x6dfbaa,_0x31eede){_0x6dfbaa=_0x6dfbaa-0x0;var _0xfbe02=_0xbf07[_0x6dfbaa];return _0xfbe02;};'use strict';var EventEmitter=require(_0x7bf0('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x7bf0('0x1')];var ChatMessage=require(_0x7bf0('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7bf0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7bf0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x21f58c){return function(_0x1c7d51,_0x4503e0,_0x563ccc){_0x1c7d51[_0x7bf0('0x5')]({'attributes':['id'],'raw':!![]})[_0x7bf0('0x6')](function(_0x2ba82b){_0x1c7d51[_0x7bf0('0x7')](_0x7bf0('0x8'),_0x2ba82b[_0x7bf0('0x9')](function(_0x1fffbd){return{'id':_0x1fffbd['id']};}));return ChatMessage[_0x7bf0('0xa')]({'where':{'ChatInteractionId':_0x1c7d51['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7bf0('0x6')](function(_0x59cdc1){_0x1c7d51[_0x7bf0('0x7')](_0x7bf0('0xb'),_0x59cdc1[_0x7bf0('0xc')]);ChatInteractionEvents[_0x7bf0('0xd')](_0x21f58c+':'+_0x1c7d51['id'],_0x1c7d51);ChatInteractionEvents[_0x7bf0('0xd')](_0x21f58c,_0x1c7d51);_0x563ccc(null);})[_0x7bf0('0xe')](_0x563ccc(null));};}for(var e in events){if(events[_0x7bf0('0xf')](e)){var event=events[e];ChatInteraction[_0x7bf0('0x10')](e,emitEvent(event));}}module[_0x7bf0('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x727a=['ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x727a,0x95));var _0xa727=function(_0x1749fe,_0x5156f1){_0x1749fe=_0x1749fe-0x0;var _0x2a4e37=_0x727a[_0x1749fe];return _0x2a4e37;};'use strict';var EventEmitter=require(_0xa727('0x0'));var ChatInteraction=require(_0xa727('0x1'))['db'][_0xa727('0x2')];var ChatMessage=require(_0xa727('0x1'))['db'][_0xa727('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa727('0x4')](0x0);var events={'afterCreate':_0xa727('0x5'),'afterUpdate':'update','afterDestroy':_0xa727('0x6')};function emitEvent(_0x12465b){return function(_0xcdb46c,_0x2b3e74,_0x2d49d4){_0xcdb46c[_0xa727('0x7')]({'attributes':['id'],'raw':!![]})[_0xa727('0x8')](function(_0x1a60b4){_0xcdb46c[_0xa727('0x9')](_0xa727('0xa'),_0x1a60b4[_0xa727('0xb')](function(_0x21b002){return{'id':_0x21b002['id']};}));return ChatMessage[_0xa727('0xc')]({'where':{'ChatInteractionId':_0xcdb46c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa727('0x8')](function(_0x10db35){_0xcdb46c[_0xa727('0x9')](_0xa727('0xd'),_0x10db35['length']);ChatInteractionEvents[_0xa727('0xe')](_0x12465b+':'+_0xcdb46c['id'],_0xcdb46c);ChatInteractionEvents[_0xa727('0xe')](_0x12465b,_0xcdb46c);_0x2d49d4(null);})[_0xa727('0xf')](_0x2d49d4(null));};}for(var e in events){if(events[_0xa727('0x10')](e)){var event=events[e];ChatInteraction[_0xa727('0x11')](e,emitEvent(event));}}module[_0xa727('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index c07e350..27c9d2e 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 _0xcfd4=['chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x3a921d,_0x18ba2b){var _0x1def6b=function(_0x169d7f){while(--_0x169d7f){_0x3a921d['push'](_0x3a921d['shift']());}};_0x1def6b(++_0x18ba2b);}(_0xcfd4,0xbc));var _0x4cfd=function(_0xbd24c2,_0x3c830d){_0xbd24c2=_0xbd24c2-0x0;var _0xc6e504=_0xcfd4[_0xbd24c2];return _0xc6e504;};'use strict';var _=require(_0x4cfd('0x0'));var util=require(_0x4cfd('0x1'));var logger=require(_0x4cfd('0x2'))('api');var moment=require(_0x4cfd('0x3'));var BPromise=require(_0x4cfd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4cfd('0x5'));var rimraf=require(_0x4cfd('0x6'));var config=require(_0x4cfd('0x7'));var attributes=require(_0x4cfd('0x8'));module[_0x4cfd('0x9')]=function(_0x17e261,_0x54f898){return _0x17e261[_0x4cfd('0xa')](_0x4cfd('0xb'),attributes,{'tableName':_0x4cfd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x475fd2,_0x461b73,_0x560b4c){if(_0x475fd2[_0x4cfd('0xd')](_0x4cfd('0xe'))){_0x475fd2[_0x4cfd('0xf')]=moment()[_0x4cfd('0x10')](_0x4cfd('0x11'));}_0x560b4c(null,_0x475fd2);}},'charset':_0x4cfd('0x12'),'collate':_0x4cfd('0x13')});}; \ No newline at end of file +var _0x4955=['util','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','closed','closedAt','format','utf8mb4','lodash'];(function(_0x4435d1,_0x1d2534){var _0x490939=function(_0x652d09){while(--_0x652d09){_0x4435d1['push'](_0x4435d1['shift']());}};_0x490939(++_0x1d2534);}(_0x4955,0xa4));var _0x5495=function(_0x1b7fd8,_0x530652){_0x1b7fd8=_0x1b7fd8-0x0;var _0x5a300b=_0x4955[_0x1b7fd8];return _0x5a300b;};'use strict';var _=require(_0x5495('0x0'));var util=require(_0x5495('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5495('0x2'));var BPromise=require(_0x5495('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5495('0x4'));var rimraf=require(_0x5495('0x5'));var config=require(_0x5495('0x6'));var attributes=require(_0x5495('0x7'));module['exports']=function(_0x19b6ae,_0x5c5942){return _0x19b6ae[_0x5495('0x8')](_0x5495('0x9'),attributes,{'tableName':_0x5495('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x317daa,_0x1a4879,_0xd1ef37){if(_0x317daa['changed'](_0x5495('0xb'))){_0x317daa[_0x5495('0xc')]=moment()[_0x5495('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0xd1ef37(null,_0x317daa);}},'charset':_0x5495('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 5c7f6c7..9e2be53 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 _0x2973=['result','catch','update','body','options','raw','attributes','limit','debug','UpdateChatInteraction','AddTagsToChatInteraction','ChatInteraction','find','where','addTags','ids','omit','spread','AddTags','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x12fc4b,_0x2a1d79){var _0xb914fb=function(_0x1fb7d4){while(--_0x1fb7d4){_0x12fc4b['push'](_0x12fc4b['shift']());}};_0xb914fb(++_0x2a1d79);}(_0x2973,0x94));var _0x3297=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0x2973[_0x18546c];return _0x46ef43;};'use strict';var _=require('lodash');var util=require(_0x3297('0x0'));var moment=require(_0x3297('0x1'));var BPromise=require('bluebird');var rs=require(_0x3297('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3297('0x3'))['db'];var utils=require(_0x3297('0x4'));var logger=require('../../config/logger')(_0x3297('0x5'));var config=require(_0x3297('0x6'));var jayson=require(_0x3297('0x7'));var client=jayson['client'][_0x3297('0x8')]({'port':0x232a});config[_0x3297('0x9')]=_['defaults'](config['redis'],{'host':_0x3297('0xa'),'port':0x18eb});var socket=require(_0x3297('0xb'))(new Redis(config['redis']));require(_0x3297('0xc'))[_0x3297('0xd')](socket);function respondWithRpcPromise(_0x56eb93,_0x15037c,_0x17b0cc){return new BPromise(function(_0x15b82d,_0x1d8bd6){return client[_0x3297('0xe')](_0x56eb93,_0x17b0cc)[_0x3297('0xf')](function(_0x4e8ae2){logger[_0x3297('0x10')](_0x3297('0x11'),_0x15037c,'request\x20sent');logger['debug'](_0x3297('0x12'),_0x15037c,'request\x20sent',JSON[_0x3297('0x13')](_0x4e8ae2));if(_0x4e8ae2[_0x3297('0x14')]){if(_0x4e8ae2[_0x3297('0x14')][_0x3297('0x15')]===0x1f4){logger[_0x3297('0x14')](_0x3297('0x11'),_0x15037c,_0x4e8ae2[_0x3297('0x14')][_0x3297('0x16')]);return _0x1d8bd6(_0x4e8ae2['error']['message']);}logger[_0x3297('0x14')](_0x3297('0x11'),_0x15037c,_0x4e8ae2['error'][_0x3297('0x16')]);return _0x15b82d(_0x4e8ae2[_0x3297('0x14')][_0x3297('0x16')]);}else{logger[_0x3297('0x10')](_0x3297('0x11'),_0x15037c,_0x3297('0x17'));_0x15b82d(_0x4e8ae2[_0x3297('0x18')][_0x3297('0x16')]);}})[_0x3297('0x19')](function(_0x16152e){logger[_0x3297('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x15037c,_0x16152e);_0x1d8bd6(_0x16152e);});});}exports['UpdateChatInteraction']=function(_0x7ba82f){var _0x2d9226=this;return new Promise(function(_0x47fad8,_0x597964){return db['ChatInteraction'][_0x3297('0x1a')](_0x7ba82f[_0x3297('0x1b')],{'raw':_0x7ba82f[_0x3297('0x1c')]?_0x7ba82f[_0x3297('0x1c')][_0x3297('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7ba82f[_0x3297('0x1c')]?_0x7ba82f['options']['where']||null:null,'attributes':_0x7ba82f[_0x3297('0x1c')]?_0x7ba82f[_0x3297('0x1c')][_0x3297('0x1e')]||null:null,'limit':_0x7ba82f[_0x3297('0x1c')]?_0x7ba82f[_0x3297('0x1c')][_0x3297('0x1f')]||null:null})[_0x3297('0xf')](function(_0x5b01a0){logger['info']('UpdateChatInteraction',_0x7ba82f);logger[_0x3297('0x20')](_0x3297('0x21'),_0x7ba82f,JSON[_0x3297('0x13')](_0x5b01a0));_0x47fad8(_0x5b01a0);})['catch'](function(_0x4dec43){logger[_0x3297('0x14')](_0x3297('0x21'),_0x4dec43[_0x3297('0x16')],_0x7ba82f);_0x597964(_0x2d9226[_0x3297('0x14')](0x1f4,_0x4dec43['message']));});});};exports[_0x3297('0x22')]=function(_0x2f2518){return new Promise(function(_0x3310e9,_0x214e62){return db[_0x3297('0x23')][_0x3297('0x24')]({'where':_0x2f2518[_0x3297('0x1c')]?_0x2f2518[_0x3297('0x1c')][_0x3297('0x25')]||null:null})[_0x3297('0xf')](function(_0x240637){if(_0x240637){return _0x240637[_0x3297('0x26')](_0x2f2518['body'][_0x3297('0x27')],_[_0x3297('0x28')](_0x2f2518['body'],['ids','id'])||{});}})[_0x3297('0x29')](function(_0x1b03fa){logger[_0x3297('0x10')](_0x3297('0x2a'),_0x2f2518);logger[_0x3297('0x20')](_0x3297('0x2a'),_0x2f2518,JSON['stringify'](_0x1b03fa));_0x3310e9(_0x1b03fa);})[_0x3297('0x19')](function(_0x4f400b){logger['error']('AddTags',_0x4f400b[_0x3297('0x16')],_0x2f2518);_0x214e62(_this[_0x3297('0x14')](0x1f4,_0x4f400b[_0x3297('0x16')]));});});}; \ No newline at end of file +var _0x0835=['request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateChatInteraction','ChatInteraction','body','options','where','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x0835,0xc1));var _0x5083=function(_0x3f8eae,_0x40c5c9){_0x3f8eae=_0x3f8eae-0x0;var _0x252eab=_0x0835[_0x3f8eae];return _0x252eab;};'use strict';var _=require(_0x5083('0x0'));var util=require(_0x5083('0x1'));var moment=require(_0x5083('0x2'));var BPromise=require(_0x5083('0x3'));var rs=require(_0x5083('0x4'));var fs=require('fs');var Redis=require(_0x5083('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5083('0x6'))(_0x5083('0x7'));var config=require(_0x5083('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5083('0x9')][_0x5083('0xa')]({'port':0x232a});config['redis']=_[_0x5083('0xb')](config[_0x5083('0xc')],{'host':_0x5083('0xd'),'port':0x18eb});var socket=require(_0x5083('0xe'))(new Redis(config[_0x5083('0xc')]));require(_0x5083('0xf'))[_0x5083('0x10')](socket);function respondWithRpcPromise(_0x185635,_0x342283,_0x397632){return new BPromise(function(_0xcc8624,_0x41b97b){return client[_0x5083('0x11')](_0x185635,_0x397632)[_0x5083('0x12')](function(_0x2e00d7){logger['info'](_0x5083('0x13'),_0x342283,_0x5083('0x14'));logger[_0x5083('0x15')](_0x5083('0x16'),_0x342283,_0x5083('0x14'),JSON[_0x5083('0x17')](_0x2e00d7));if(_0x2e00d7[_0x5083('0x18')]){if(_0x2e00d7[_0x5083('0x18')][_0x5083('0x19')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x342283,_0x2e00d7['error']['message']);return _0x41b97b(_0x2e00d7[_0x5083('0x18')][_0x5083('0x1a')]);}logger[_0x5083('0x18')](_0x5083('0x13'),_0x342283,_0x2e00d7[_0x5083('0x18')][_0x5083('0x1a')]);return _0xcc8624(_0x2e00d7[_0x5083('0x18')][_0x5083('0x1a')]);}else{logger[_0x5083('0x1b')](_0x5083('0x13'),_0x342283,_0x5083('0x14'));_0xcc8624(_0x2e00d7['result'][_0x5083('0x1a')]);}})[_0x5083('0x1c')](function(_0x2a3532){logger[_0x5083('0x18')](_0x5083('0x13'),_0x342283,_0x2a3532);_0x41b97b(_0x2a3532);});});}exports[_0x5083('0x1d')]=function(_0xf87640){var _0x19f2ba=this;return new Promise(function(_0x2049cf,_0x324132){return db[_0x5083('0x1e')]['update'](_0xf87640[_0x5083('0x1f')],{'raw':_0xf87640[_0x5083('0x20')]?_0xf87640[_0x5083('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf87640['options']?_0xf87640[_0x5083('0x20')][_0x5083('0x21')]||null:null,'attributes':_0xf87640[_0x5083('0x20')]?_0xf87640[_0x5083('0x20')][_0x5083('0x22')]||null:null,'limit':_0xf87640['options']?_0xf87640['options'][_0x5083('0x23')]||null:null})[_0x5083('0x12')](function(_0x48cb31){logger['info'](_0x5083('0x1d'),_0xf87640);logger[_0x5083('0x15')](_0x5083('0x1d'),_0xf87640,JSON[_0x5083('0x17')](_0x48cb31));_0x2049cf(_0x48cb31);})[_0x5083('0x1c')](function(_0x513879){logger[_0x5083('0x18')](_0x5083('0x1d'),_0x513879[_0x5083('0x1a')],_0xf87640);_0x324132(_0x19f2ba[_0x5083('0x18')](0x1f4,_0x513879[_0x5083('0x1a')]));});});};exports[_0x5083('0x24')]=function(_0x1f0c01){return new Promise(function(_0x282b44,_0x5489aa){return db['ChatInteraction'][_0x5083('0x25')]({'where':_0x1f0c01[_0x5083('0x20')]?_0x1f0c01[_0x5083('0x20')][_0x5083('0x21')]||null:null})[_0x5083('0x12')](function(_0x3b6f63){if(_0x3b6f63){return _0x3b6f63[_0x5083('0x26')](_0x1f0c01['body'][_0x5083('0x27')],_['omit'](_0x1f0c01[_0x5083('0x1f')],[_0x5083('0x27'),'id'])||{});}})[_0x5083('0x28')](function(_0x2cdece){logger[_0x5083('0x1b')](_0x5083('0x29'),_0x1f0c01);logger['debug'](_0x5083('0x29'),_0x1f0c01,JSON[_0x5083('0x17')](_0x2cdece));_0x282b44(_0x2cdece);})[_0x5083('0x1c')](function(_0x144117){logger[_0x5083('0x18')](_0x5083('0x29'),_0x144117['message'],_0x1f0c01);_0x5489aa(_this[_0x5083('0x18')](0x1f4,_0x144117['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 9588034..fd5e1d3 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 _0x652f=['remove','emit','register','chatInteraction:','./chatInteraction.events','save'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x652f,0xfa));var _0xf652=function(_0x11b677,_0x2c3da5){_0x11b677=_0x11b677-0x0;var _0x5046f1=_0x652f[_0x11b677];return _0x5046f1;};'use strict';var ChatInteractionEvents=require(_0xf652('0x0'));var events=[_0xf652('0x1'),_0xf652('0x2'),'update'];function createListener(_0x58c405,_0x47a417){return function(_0x590a89){_0x47a417[_0xf652('0x3')](_0x58c405,_0x590a89);};}function removeListener(_0x40087b,_0x567db7){return function(){ChatInteractionEvents['removeListener'](_0x40087b,_0x567db7);};}exports[_0xf652('0x4')]=function(_0x11f70e){for(var _0x2b2926=0x0,_0x591f5b=events['length'];_0x2b2926<_0x591f5b;_0x2b2926++){var _0x1efd77=events[_0x2b2926];var _0x54bcbe=createListener(_0xf652('0x5')+_0x1efd77,_0x11f70e);ChatInteractionEvents['on'](_0x1efd77,_0x54bcbe);}}; \ No newline at end of file +var _0x8d58=['length','chatInteraction:','./chatInteraction.events','update','register'];(function(_0x12fd56,_0x74350b){var _0x22e804=function(_0x53668e){while(--_0x53668e){_0x12fd56['push'](_0x12fd56['shift']());}};_0x22e804(++_0x74350b);}(_0x8d58,0xde));var _0x88d5=function(_0x204106,_0x3e2e12){_0x204106=_0x204106-0x0;var _0x157a1a=_0x8d58[_0x204106];return _0x157a1a;};'use strict';var ChatInteractionEvents=require(_0x88d5('0x0'));var events=['save','remove',_0x88d5('0x1')];function createListener(_0x2eff79,_0x130cfd){return function(_0x38ed0){_0x130cfd['emit'](_0x2eff79,_0x38ed0);};}function removeListener(_0x40a332,_0x30da4d){return function(){ChatInteractionEvents['removeListener'](_0x40a332,_0x30da4d);};}exports[_0x88d5('0x2')]=function(_0x3dad55){for(var _0x4459f5=0x0,_0x496297=events[_0x88d5('0x3')];_0x4459f5<_0x496297;_0x4459f5++){var _0x5c0fb6=events[_0x4459f5];var _0x4b6c7c=createListener(_0x88d5('0x4')+_0x5c0fb6,_0x3dad55);ChatInteractionEvents['on'](_0x5c0fb6,_0x4b6c7c);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 38e488e..0122702 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 _0x5d7a=['/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','put','tracked','chatinteraction:update','update','customUpdate','/:id/abandon','/:id/close','close','chatinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index'];(function(_0x707e89,_0x44186f){var _0x329de7=function(_0x2d1a96){while(--_0x2d1a96){_0x707e89['push'](_0x707e89['shift']());}};_0x329de7(++_0x44186f);}(_0x5d7a,0x176));var _0xa5d7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5d7a[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xa5d7('0x0'));var util=require('util');var path=require(_0xa5d7('0x1'));var timeout=require(_0xa5d7('0x2'));var express=require(_0xa5d7('0x3'));var router=express[_0xa5d7('0x4')]();var fs_extra=require(_0xa5d7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa5d7('0x6'));var config=require('../../config/environment');var controller=require(_0xa5d7('0x7'));router[_0xa5d7('0x8')]('/',auth[_0xa5d7('0x9')](),controller[_0xa5d7('0xa')]);router[_0xa5d7('0x8')](_0xa5d7('0xb'),auth[_0xa5d7('0x9')](),controller[_0xa5d7('0xc')]);router[_0xa5d7('0x8')](_0xa5d7('0xd'),auth[_0xa5d7('0xe')](),controller[_0xa5d7('0xf')]);router[_0xa5d7('0x8')](_0xa5d7('0x10'),auth[_0xa5d7('0xe')](),controller[_0xa5d7('0x11')]);router['get'](_0xa5d7('0x12'),auth['isAuthenticated'](),controller[_0xa5d7('0x13')]);router[_0xa5d7('0x8')](_0xa5d7('0x14'),auth[_0xa5d7('0xe')](),controller[_0xa5d7('0x15')]);router[_0xa5d7('0x8')](_0xa5d7('0x16'),auth[_0xa5d7('0x9')](),controller[_0xa5d7('0x17')]);router[_0xa5d7('0x18')]('/',auth[_0xa5d7('0x9')](),controller[_0xa5d7('0x19')]);router['post']('/:id/vidaoo',auth[_0xa5d7('0x9')](),controller[_0xa5d7('0x1a')]);var upload=multer({'storage':multer[_0xa5d7('0x1b')]({'destination':function(_0xf3df0c,_0x373ac2,_0x4a4e3a){_0x4a4e3a(null,path[_0xa5d7('0x1c')](config[_0xa5d7('0x1d')],_0xa5d7('0x1e')));},'filename':function(_0x265bdc,_0x569d42,_0x2a3ea0){_0x2a3ea0(null,util[_0xa5d7('0x1f')](_0xa5d7('0x20'),Date['now'](),_0x569d42[_0xa5d7('0x21')][_0xa5d7('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa5d7('0x18')](_0xa5d7('0x23'),upload[_0xa5d7('0x24')](_0xa5d7('0x25')),controller[_0xa5d7('0x26')]);router[_0xa5d7('0x18')](_0xa5d7('0x12'),auth[_0xa5d7('0xe')](),controller[_0xa5d7('0x27')]);router[_0xa5d7('0x18')](_0xa5d7('0x28'),auth['isAuthenticated'](),interaction['tracked'](_0xa5d7('0x29'),_0xa5d7('0x2a')),controller['addTags']);router[_0xa5d7('0x2b')]('/:id',auth[_0xa5d7('0x9')](),interaction[_0xa5d7('0x2c')](_0xa5d7('0x29'),_0xa5d7('0x2d')),controller[_0xa5d7('0x2e')]);router['put']('/:id/custom_update',controller[_0xa5d7('0x2f')]);router[_0xa5d7('0x2b')](_0xa5d7('0x30'),auth['isChatInteractionAuthorized'](),controller['abandon']);router['put'](_0xa5d7('0x31'),controller[_0xa5d7('0x32')]);router['delete'](_0xa5d7('0xd'),auth[_0xa5d7('0x9')](),interaction[_0xa5d7('0x2c')](_0xa5d7('0x29'),_0xa5d7('0x33')),controller[_0xa5d7('0x34')]);router['delete'](_0xa5d7('0x28'),auth[_0xa5d7('0x9')](),controller[_0xa5d7('0x35')]);module[_0xa5d7('0x36')]=router; \ No newline at end of file +var _0x78f0=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','attachmentDownload','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','file','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','util'];(function(_0x201a9f,_0x4b8d86){var _0x38a3c8=function(_0x3c724a){while(--_0x3c724a){_0x201a9f['push'](_0x201a9f['shift']());}};_0x38a3c8(++_0x4b8d86);}(_0x78f0,0x18f));var _0x078f=function(_0x299c41,_0x2e4519){_0x299c41=_0x299c41-0x0;var _0x139b97=_0x78f0[_0x299c41];return _0x139b97;};'use strict';var multer=require('multer');var util=require(_0x078f('0x0'));var path=require(_0x078f('0x1'));var timeout=require(_0x078f('0x2'));var express=require('express');var router=express[_0x078f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x078f('0x4'));var interaction=require(_0x078f('0x5'));var config=require('../../config/environment');var controller=require(_0x078f('0x6'));router['get']('/',auth[_0x078f('0x7')](),controller[_0x078f('0x8')]);router[_0x078f('0x9')](_0x078f('0xa'),auth[_0x078f('0x7')](),controller[_0x078f('0xb')]);router['get'](_0x078f('0xc'),auth[_0x078f('0xd')](),controller['show']);router['get']('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x078f('0xe')]);router[_0x078f('0x9')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x078f('0x9')]('/:id/my_messages',auth[_0x078f('0xd')](),controller[_0x078f('0xf')]);router[_0x078f('0x9')](_0x078f('0x10'),auth[_0x078f('0x7')](),controller[_0x078f('0x11')]);router[_0x078f('0x12')]('/',auth['isAuthenticated'](),controller[_0x078f('0x13')]);router[_0x078f('0x12')](_0x078f('0x14'),auth['isAuthenticated'](),controller[_0x078f('0x15')]);var upload=multer({'storage':multer[_0x078f('0x16')]({'destination':function(_0x4d7095,_0x2a63bf,_0x3953ef){_0x3953ef(null,path[_0x078f('0x17')](config[_0x078f('0x18')],_0x078f('0x19')));},'filename':function(_0xa8f31e,_0x4f1e75,_0x19d35a){_0x19d35a(null,util[_0x078f('0x1a')]('%s-%s',Date[_0x078f('0x1b')](),_0x4f1e75[_0x078f('0x1c')][_0x078f('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x078f('0x12')]('/:id/attachment_upload',upload['single'](_0x078f('0x1e')),controller['attachmentUpload']);router[_0x078f('0x12')](_0x078f('0x1f'),auth[_0x078f('0xd')](),controller[_0x078f('0x20')]);router[_0x078f('0x12')](_0x078f('0x21'),auth[_0x078f('0x7')](),interaction['tracked'](_0x078f('0x22'),_0x078f('0x23')),controller[_0x078f('0x24')]);router[_0x078f('0x25')]('/:id',auth[_0x078f('0x7')](),interaction[_0x078f('0x26')](_0x078f('0x22'),_0x078f('0x27')),controller[_0x078f('0x28')]);router[_0x078f('0x25')](_0x078f('0x29'),controller[_0x078f('0x2a')]);router[_0x078f('0x25')](_0x078f('0x2b'),auth[_0x078f('0xd')](),controller[_0x078f('0x2c')]);router['put'](_0x078f('0x2d'),controller[_0x078f('0x2e')]);router[_0x078f('0x2f')](_0x078f('0xc'),auth[_0x078f('0x7')](),interaction['tracked'](_0x078f('0x22'),_0x078f('0x30')),controller['destroy']);router['delete']('/:id/tags',auth[_0x078f('0x7')](),controller[_0x078f('0x31')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index b3adbbb..71fb0d5 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 _0xdb28=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0xe2fca,_0x352d57){var _0x53d6dd=function(_0x772de5){while(--_0x772de5){_0xe2fca['push'](_0xe2fca['shift']());}};_0x53d6dd(++_0x352d57);}(_0xdb28,0x106));var _0x8db2=function(_0x2d2d92,_0x455f5b){_0x2d2d92=_0x2d2d92-0x0;var _0x5da902=_0xdb28[_0x2d2d92];return _0x5da902;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8db2('0x4')]}}; \ No newline at end of file +var _0x7a54=['BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x33bcdb,_0x11846b){var _0x18a9bf=function(_0x34417a){while(--_0x34417a){_0x33bcdb['push'](_0x33bcdb['shift']());}};_0x18a9bf(++_0x11846b);}(_0x7a54,0x106));var _0x47a5=function(_0x5e6dd5,_0x422aec){_0x5e6dd5=_0x5e6dd5-0x0;var _0x446bf4=_0x7a54[_0x5e6dd5];return _0x446bf4;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'body':{'type':Sequelize[_0x47a5('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x47a5('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index ff87768..21f011a 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 _0x1058=['save','update','then','destroy','end','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','read','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','set','Content-Range'];(function(_0x5ec3da,_0x39bf0a){var _0x46e252=function(_0x5f4b28){while(--_0x5f4b28){_0x5ec3da['push'](_0x5ec3da['shift']());}};_0x46e252(++_0x39bf0a);}(_0x1058,0x18c));var _0x8105=function(_0x960e3,_0x3016a2){_0x960e3=_0x960e3-0x0;var _0x1d4b63=_0x1058[_0x960e3];return _0x1d4b63;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8105('0x0'));var jsonpatch=require(_0x8105('0x1'));var rp=require(_0x8105('0x2'));var moment=require(_0x8105('0x3'));var BPromise=require(_0x8105('0x4'));var Mustache=require(_0x8105('0x5'));var util=require(_0x8105('0x6'));var path=require(_0x8105('0x7'));var sox=require(_0x8105('0x8'));var csv=require(_0x8105('0x9'));var ejs=require(_0x8105('0xa'));var fs=require('fs');var fs_extra=require(_0x8105('0xb'));var _=require(_0x8105('0xc'));var squel=require(_0x8105('0xd'));var crypto=require(_0x8105('0xe'));var jsforce=require(_0x8105('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8105('0x10'));var authService=require(_0x8105('0x11'));var qs=require(_0x8105('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8105('0x13'));var logger=require(_0x8105('0x14'))(_0x8105('0x15'));var utils=require(_0x8105('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8105('0x17'));var db=require(_0x8105('0x18'))['db'];config[_0x8105('0x19')]=_['defaults'](config['redis'],{'host':_0x8105('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8105('0x19')]));require(_0x8105('0x1b'))[_0x8105('0x1c')](socket);function respondWithStatusCode(_0x211c9c,_0x325ba2){_0x325ba2=_0x325ba2||0xcc;return function(_0x3b430f){if(_0x3b430f){return _0x211c9c[_0x8105('0x1d')](_0x325ba2);}return _0x211c9c[_0x8105('0x1e')](_0x325ba2)['end']();};}function respondWithResult(_0x60b1bd,_0x187893){_0x187893=_0x187893||0xc8;return function(_0x374da6){if(_0x374da6){return _0x60b1bd[_0x8105('0x1e')](_0x187893)[_0x8105('0x1f')](_0x374da6);}};}function respondWithFilteredResult(_0x17915f,_0x4977ce){return function(_0x41bf46){if(_0x41bf46){var _0x5f4351=_0x41bf46['count'],_0x30f143=_0x4977ce[_0x8105('0x20')],_0x5a39af=_0x4977ce['offset']+_0x4977ce[_0x8105('0x21')],_0x53791e;if(_0x5a39af>=_0x5f4351){_0x5a39af=_0x5f4351;_0x53791e=0xc8;}else{_0x53791e=0xce;}_0x17915f[_0x8105('0x1e')](_0x53791e);return _0x17915f[_0x8105('0x22')](_0x8105('0x23'),_0x30f143+'-'+_0x5a39af+'/'+_0x5f4351)[_0x8105('0x1f')](_0x41bf46);}return null;};}function patchUpdates(_0x4ac238){return function(_0x47518f){try{jsonpatch['apply'](_0x47518f,_0x4ac238,!![]);}catch(_0xd123be){return BPromise['reject'](_0xd123be);}return _0x47518f[_0x8105('0x24')]();};}function saveUpdates(_0x506cf5,_0x3ff78e){return function(_0x1ac93d){if(_0x1ac93d){return _0x1ac93d[_0x8105('0x25')](_0x506cf5)[_0x8105('0x26')](function(_0x2079e6){return _0x2079e6;});}return null;};}function removeEntity(_0x9899ae,_0x14f658){return function(_0x4dcaff){if(_0x4dcaff){return _0x4dcaff[_0x8105('0x27')]()['then'](function(){_0x9899ae[_0x8105('0x1e')](0xcc)[_0x8105('0x28')]();});}};}function handleEntityNotFound(_0x34abc7,_0xdeeddb){return function(_0x26b8ff){if(!_0x26b8ff){_0x34abc7[_0x8105('0x1d')](0x194);}return _0x26b8ff;};}function handleError(_0x39b277,_0x58abd9){_0x58abd9=_0x58abd9||0x1f4;return function(_0x5e8734){logger['error'](_0x5e8734[_0x8105('0x29')]);if(_0x5e8734['name']){delete _0x5e8734[_0x8105('0x2a')];}_0x39b277['status'](_0x58abd9)[_0x8105('0x2b')](_0x5e8734);};}exports[_0x8105('0x2c')]=function(_0x1ef561,_0x1bc8eb){var _0x41722c={},_0x4bd732={},_0x14f3c7={'count':0x0,'rows':[]};var _0x256ace=_[_0x8105('0x2d')](db[_0x8105('0x2e')][_0x8105('0x2f')],function(_0x1c1f1f){return{'name':_0x1c1f1f['fieldName'],'type':_0x1c1f1f[_0x8105('0x30')][_0x8105('0x31')]};});_0x4bd732['model']=_[_0x8105('0x2d')](_0x256ace,_0x8105('0x2a'));_0x4bd732[_0x8105('0x32')]=_[_0x8105('0x33')](_0x1ef561['query']);_0x4bd732['filters']=_[_0x8105('0x34')](_0x4bd732[_0x8105('0x35')],_0x4bd732[_0x8105('0x32')]);_0x41722c[_0x8105('0x36')]=_[_0x8105('0x34')](_0x4bd732[_0x8105('0x35')],qs['fields'](_0x1ef561['query'][_0x8105('0x37')]));_0x41722c['attributes']=_0x41722c[_0x8105('0x36')][_0x8105('0x38')]?_0x41722c[_0x8105('0x36')]:_0x4bd732[_0x8105('0x35')];if(!_0x1ef561[_0x8105('0x32')]['hasOwnProperty'](_0x8105('0x39'))){_0x41722c[_0x8105('0x21')]=qs[_0x8105('0x21')](_0x1ef561[_0x8105('0x32')][_0x8105('0x21')]);_0x41722c[_0x8105('0x20')]=qs[_0x8105('0x20')](_0x1ef561[_0x8105('0x32')][_0x8105('0x20')]);}_0x41722c[_0x8105('0x3a')]=qs['sort'](_0x1ef561[_0x8105('0x32')][_0x8105('0x3b')]);_0x41722c[_0x8105('0x3c')]=qs[_0x8105('0x3d')](_['pick'](_0x1ef561[_0x8105('0x32')],_0x4bd732[_0x8105('0x3d')]),_0x256ace);if(_0x1ef561[_0x8105('0x32')][_0x8105('0x3e')]){_0x41722c['where']=_[_0x8105('0x3f')](_0x41722c[_0x8105('0x3c')],{'$or':_[_0x8105('0x2d')](_0x256ace,function(_0x44edfe){if(_0x44edfe['type']!==_0x8105('0x40')){var _0x404c09={};_0x404c09[_0x44edfe[_0x8105('0x2a')]]={'$like':'%'+_0x1ef561[_0x8105('0x32')][_0x8105('0x3e')]+'%'};return _0x404c09;}})});}_0x41722c=_[_0x8105('0x3f')]({},_0x41722c,_0x1ef561[_0x8105('0x41')]);var _0x4d3d51={'where':_0x41722c['where']};return db[_0x8105('0x2e')][_0x8105('0x42')](_0x4d3d51)[_0x8105('0x26')](function(_0x4153bd){_0x14f3c7[_0x8105('0x42')]=_0x4153bd;if(_0x1ef561[_0x8105('0x32')][_0x8105('0x43')]){_0x41722c[_0x8105('0x44')]=[{'all':!![]}];}return db[_0x8105('0x2e')][_0x8105('0x45')](_0x41722c);})[_0x8105('0x26')](function(_0xdd11ba){_0x14f3c7[_0x8105('0x46')]=_0xdd11ba;return _0x14f3c7;})['then'](respondWithFilteredResult(_0x1bc8eb,_0x41722c))[_0x8105('0x47')](handleError(_0x1bc8eb,null));};exports[_0x8105('0x48')]=function(_0x1ad6e7,_0x28143d){var _0xdb5397={'raw':!![],'where':{'id':_0x1ad6e7[_0x8105('0x49')]['id']}},_0x4ab691={};_0x4ab691[_0x8105('0x35')]=_['keys'](db[_0x8105('0x2e')][_0x8105('0x2f')]);_0x4ab691[_0x8105('0x32')]=_[_0x8105('0x33')](_0x1ad6e7[_0x8105('0x32')]);_0x4ab691[_0x8105('0x3d')]=_[_0x8105('0x34')](_0x4ab691[_0x8105('0x35')],_0x4ab691[_0x8105('0x32')]);_0xdb5397[_0x8105('0x36')]=_[_0x8105('0x34')](_0x4ab691['model'],qs[_0x8105('0x37')](_0x1ad6e7[_0x8105('0x32')][_0x8105('0x37')]));_0xdb5397[_0x8105('0x36')]=_0xdb5397['attributes'][_0x8105('0x38')]?_0xdb5397[_0x8105('0x36')]:_0x4ab691[_0x8105('0x35')];if(_0x1ad6e7[_0x8105('0x32')][_0x8105('0x43')]){_0xdb5397[_0x8105('0x44')]=[{'all':!![]}];}_0xdb5397=_[_0x8105('0x3f')]({},_0xdb5397,_0x1ad6e7[_0x8105('0x41')]);return db[_0x8105('0x2e')]['find'](_0xdb5397)[_0x8105('0x26')](handleEntityNotFound(_0x28143d,null))['then'](respondWithResult(_0x28143d,null))[_0x8105('0x47')](handleError(_0x28143d,null));};exports[_0x8105('0x4a')]=function(_0x2dd3d5,_0x4b81ee){return db[_0x8105('0x2e')][_0x8105('0x4a')](_0x2dd3d5['body'],{})[_0x8105('0x26')](respondWithResult(_0x4b81ee,0xc9))[_0x8105('0x47')](handleError(_0x4b81ee,null));};exports[_0x8105('0x25')]=function(_0x2d3ca3,_0x337b04){if(_0x2d3ca3[_0x8105('0x4b')]['id']){delete _0x2d3ca3['body']['id'];}return db[_0x8105('0x2e')]['find']({'where':{'id':_0x2d3ca3[_0x8105('0x49')]['id']}})[_0x8105('0x26')](handleEntityNotFound(_0x337b04,null))[_0x8105('0x26')](saveUpdates(_0x2d3ca3[_0x8105('0x4b')],null))['then'](respondWithResult(_0x337b04,null))[_0x8105('0x47')](handleError(_0x337b04,null));};exports['destroy']=function(_0x3057d5,_0x593912){return db[_0x8105('0x2e')][_0x8105('0x4c')]({'where':{'id':_0x3057d5[_0x8105('0x49')]['id']}})[_0x8105('0x26')](handleEntityNotFound(_0x593912,null))['then'](removeEntity(_0x593912,null))[_0x8105('0x47')](handleError(_0x593912,null));};exports['describe']=function(_0x4df557,_0x33ff98){return db[_0x8105('0x2e')][_0x8105('0x4d')]()[_0x8105('0x26')](respondWithResult(_0x33ff98,null))[_0x8105('0x47')](handleError(_0x33ff98,null));};function wrapUser(_0x23246b){return function(_0x4021a5){var _0x26c792=_0x23246b[_0x8105('0x4e')]({'plain':!![]});_0x26c792[_0x8105('0x4f')]=[];if(_0x4021a5){_0x26c792[_0x8105('0x50')]=_0x4021a5[_0x8105('0x51')];_0x26c792['lastMessage']=_0x4021a5;}else{_0x26c792['lastMessageAt']=moment(0x0)[_0x8105('0x52')](_0x8105('0x53'));_0x26c792[_0x8105('0x54')]={};}return _0x26c792;};}exports['getUsers']=function(_0x534e4a,_0x268b76,_0x1718dc){var _0x55c65a=[];return db[_0x8105('0x55')][_0x8105('0x45')]({'where':{'role':[_0x8105('0x56'),'admin',_0x8105('0x57')]},'attributes':['id',_0x8105('0x58'),'name',_0x8105('0x59'),_0x8105('0x5a'),_0x8105('0x5b'),_0x8105('0x5c'),_0x8105('0x5d'),_0x8105('0x5e'),_0x8105('0x5f')],'order':qs['sort']('-online'),'include':[{'model':db[_0x8105('0x60')],'as':_0x8105('0x61'),'attributes':['id',_0x8105('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x8105('0x26')](function(_0x44d936){if(_0x44d936){var _0x245fb1=_0x534e4a['user'][_0x8105('0x4e')]({'plain':!![]});if(!_0x245fb1)throw new Error(_0x8105('0x62'));if(_0x245fb1[_0x8105('0x59')]===_0x8105('0x57')){return db[_0x8105('0x63')]['find']({'where':{'name':_0x8105('0x64'),'userProfileId':_0x245fb1[_0x8105('0x65')]},'raw':!![]})[_0x8105('0x26')](function(_0x46b149){if(_0x46b149){if(_0x46b149[_0x8105('0x66')]===0x0){return db[_0x8105('0x67')][_0x8105('0x45')]({'where':{'sectionId':_0x46b149['id']},'raw':!![]})[_0x8105('0x26')](function(_0x4766a9){var _0x386805=[];if(_[_0x8105('0x68')](_0x4766a9)){_0x386805=_['filter'](_0x44d936,function(_0x33ecc1){if(_0x33ecc1[_0x8105('0x59')]!==_0x8105('0x56')){return _0x33ecc1;}});return _0x386805;}else{for(var _0x3525d5=0x0;_0x3525d5<_0x44d936[_0x8105('0x38')];_0x3525d5++){var _0x590c40=_0x44d936[_0x3525d5];if(_0x590c40[_0x8105('0x59')]===_0x8105('0x56')){var _0x545872=_[_0x8105('0x4c')](_0x4766a9,function(_0x26e866){return _0x26e866['resourceId']===_0x590c40['id'];});if(_0x545872)_0x386805[_0x8105('0x69')](_0x590c40);}else{_0x386805[_0x8105('0x69')](_0x590c40);}}return _0x386805;}});}else{return _0x44d936;}}else{var _0x59d9d1=_[_0x8105('0x3e')](_0x44d936,function(_0x543889){if(_0x543889['role']!=='agent'){return _0x543889;}});return _0x59d9d1;}});}else{return _0x44d936;}}})[_0x8105('0x26')](function(_0x3fd430){var _0x353678=[];if(_0x3fd430){_0x55c65a=_0x3fd430;for(var _0x4c2f90=0x0;_0x4c2f90<_0x3fd430['length'];_0x4c2f90+=0x1){_0x55c65a[_0x4c2f90]['messages']=[];_0x353678[_0x8105('0x69')](db[_0x8105('0x2e')][_0x8105('0x4c')]({'where':{'FromId':[_0x534e4a[_0x8105('0x57')]['id'],_0x3fd430[_0x4c2f90]['id']],'ToId':[_0x534e4a[_0x8105('0x57')]['id'],_0x3fd430[_0x4c2f90]['id']],'ChatGroupId':null},'attributes':['id',_0x8105('0x51'),_0x8105('0x6a'),'ToId',_0x8105('0x6b'),_0x8105('0x4b')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8105('0x26')](wrapUser(_0x3fd430[_0x4c2f90])));}return BPromise['all'](_0x353678);}return[];})[_0x8105('0x26')](function(_0x1b31e1){return{'rows':_0x1b31e1,'count':_0x1b31e1['length']};})['then'](respondWithResult(_0x268b76,null))[_0x8105('0x47')](handleError(_0x268b76,null));}; \ No newline at end of file +var _0x7e8b=['findAll','rows','catch','params','rawAttributes','fields','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','user','fullname','role','userpic','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','isEmpty','length','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','pick','filters','filter','where','type','merge','options','ChatInternalMessage','count','includeAll','include'];(function(_0xd7edeb,_0x14cb8e){var _0x350960=function(_0x1e8873){while(--_0x1e8873){_0xd7edeb['push'](_0xd7edeb['shift']());}};_0x350960(++_0x14cb8e);}(_0x7e8b,0x1e1));var _0xb7e8=function(_0x5e0823,_0x146024){_0x5e0823=_0x5e0823-0x0;var _0x592fbb=_0x7e8b[_0x5e0823];return _0x592fbb;};'use strict';var emlformat=require(_0xb7e8('0x0'));var rimraf=require(_0xb7e8('0x1'));var zipdir=require(_0xb7e8('0x2'));var jsonpatch=require(_0xb7e8('0x3'));var rp=require(_0xb7e8('0x4'));var moment=require(_0xb7e8('0x5'));var BPromise=require(_0xb7e8('0x6'));var Mustache=require(_0xb7e8('0x7'));var util=require('util');var path=require(_0xb7e8('0x8'));var sox=require(_0xb7e8('0x9'));var csv=require(_0xb7e8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7e8('0xb'));var _=require(_0xb7e8('0xc'));var squel=require(_0xb7e8('0xd'));var crypto=require(_0xb7e8('0xe'));var jsforce=require(_0xb7e8('0xf'));var deskjs=require(_0xb7e8('0x10'));var toCsv=require(_0xb7e8('0xa'));var querystring=require('querystring');var Papa=require(_0xb7e8('0x11'));var Redis=require(_0xb7e8('0x12'));var authService=require(_0xb7e8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb7e8('0x14'));var hardwareService=require(_0xb7e8('0x15'));var logger=require(_0xb7e8('0x16'))(_0xb7e8('0x17'));var utils=require(_0xb7e8('0x18'));var config=require(_0xb7e8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb7e8('0x1a'))['db'];config[_0xb7e8('0x1b')]=_[_0xb7e8('0x1c')](config[_0xb7e8('0x1b')],{'host':_0xb7e8('0x1d'),'port':0x18eb});var socket=require(_0xb7e8('0x1e'))(new Redis(config[_0xb7e8('0x1b')]));require('./chatInternalMessage.socket')[_0xb7e8('0x1f')](socket);function respondWithStatusCode(_0x31529b,_0x33a372){_0x33a372=_0x33a372||0xcc;return function(_0x101fa9){if(_0x101fa9){return _0x31529b['sendStatus'](_0x33a372);}return _0x31529b[_0xb7e8('0x20')](_0x33a372)['end']();};}function respondWithResult(_0x15bbba,_0x144281){_0x144281=_0x144281||0xc8;return function(_0x379b29){if(_0x379b29){return _0x15bbba[_0xb7e8('0x20')](_0x144281)[_0xb7e8('0x21')](_0x379b29);}};}function respondWithFilteredResult(_0x196ff7,_0x2f5938){return function(_0x407fd8){if(_0x407fd8){var _0x1c6407=_0x407fd8['count'],_0x511af8=_0x2f5938[_0xb7e8('0x22')],_0x557662=_0x2f5938[_0xb7e8('0x22')]+_0x2f5938[_0xb7e8('0x23')],_0x2d01f8;if(_0x557662>=_0x1c6407){_0x557662=_0x1c6407;_0x2d01f8=0xc8;}else{_0x2d01f8=0xce;}_0x196ff7[_0xb7e8('0x20')](_0x2d01f8);return _0x196ff7['set'](_0xb7e8('0x24'),_0x511af8+'-'+_0x557662+'/'+_0x1c6407)[_0xb7e8('0x21')](_0x407fd8);}return null;};}function patchUpdates(_0x2598b4){return function(_0x121e3b){try{jsonpatch[_0xb7e8('0x25')](_0x121e3b,_0x2598b4,!![]);}catch(_0x5e2f7a){return BPromise[_0xb7e8('0x26')](_0x5e2f7a);}return _0x121e3b[_0xb7e8('0x27')]();};}function saveUpdates(_0x3d9755,_0xf8cdfb){return function(_0x3dc8a7){if(_0x3dc8a7){return _0x3dc8a7[_0xb7e8('0x28')](_0x3d9755)[_0xb7e8('0x29')](function(_0x1beb10){return _0x1beb10;});}return null;};}function removeEntity(_0x597333,_0x32311b){return function(_0x1b933d){if(_0x1b933d){return _0x1b933d[_0xb7e8('0x2a')]()[_0xb7e8('0x29')](function(){_0x597333[_0xb7e8('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43927f,_0x454fad){return function(_0x4e6caa){if(!_0x4e6caa){_0x43927f[_0xb7e8('0x2b')](0x194);}return _0x4e6caa;};}function handleError(_0x5f0c3b,_0x2f8a9a){_0x2f8a9a=_0x2f8a9a||0x1f4;return function(_0x2f68a6){logger[_0xb7e8('0x2c')](_0x2f68a6[_0xb7e8('0x2d')]);if(_0x2f68a6[_0xb7e8('0x2e')]){delete _0x2f68a6[_0xb7e8('0x2e')];}_0x5f0c3b[_0xb7e8('0x20')](_0x2f8a9a)['send'](_0x2f68a6);};}exports[_0xb7e8('0x2f')]=function(_0x4b5012,_0x2e65c6){var _0xd48ad={},_0x1726c4={},_0x2caf36={'count':0x0,'rows':[]};var _0x1a4bfa=_[_0xb7e8('0x30')](db['ChatInternalMessage']['rawAttributes'],function(_0x56d66b){return{'name':_0x56d66b['fieldName'],'type':_0x56d66b['type'][_0xb7e8('0x31')]};});_0x1726c4[_0xb7e8('0x32')]=_[_0xb7e8('0x30')](_0x1a4bfa,_0xb7e8('0x2e'));_0x1726c4[_0xb7e8('0x33')]=_[_0xb7e8('0x34')](_0x4b5012[_0xb7e8('0x33')]);_0x1726c4['filters']=_[_0xb7e8('0x35')](_0x1726c4[_0xb7e8('0x32')],_0x1726c4[_0xb7e8('0x33')]);_0xd48ad[_0xb7e8('0x36')]=_[_0xb7e8('0x35')](_0x1726c4['model'],qs['fields'](_0x4b5012[_0xb7e8('0x33')]['fields']));_0xd48ad['attributes']=_0xd48ad[_0xb7e8('0x36')]['length']?_0xd48ad[_0xb7e8('0x36')]:_0x1726c4[_0xb7e8('0x32')];if(!_0x4b5012['query'][_0xb7e8('0x37')](_0xb7e8('0x38'))){_0xd48ad['limit']=qs['limit'](_0x4b5012['query'][_0xb7e8('0x23')]);_0xd48ad[_0xb7e8('0x22')]=qs[_0xb7e8('0x22')](_0x4b5012[_0xb7e8('0x33')][_0xb7e8('0x22')]);}_0xd48ad['order']=qs[_0xb7e8('0x39')](_0x4b5012[_0xb7e8('0x33')][_0xb7e8('0x39')]);_0xd48ad['where']=qs['filters'](_[_0xb7e8('0x3a')](_0x4b5012[_0xb7e8('0x33')],_0x1726c4[_0xb7e8('0x3b')]),_0x1a4bfa);if(_0x4b5012[_0xb7e8('0x33')][_0xb7e8('0x3c')]){_0xd48ad['where']=_['merge'](_0xd48ad[_0xb7e8('0x3d')],{'$or':_['map'](_0x1a4bfa,function(_0x9fc5b9){if(_0x9fc5b9[_0xb7e8('0x3e')]!=='VIRTUAL'){var _0x56ca3e={};_0x56ca3e[_0x9fc5b9[_0xb7e8('0x2e')]]={'$like':'%'+_0x4b5012[_0xb7e8('0x33')][_0xb7e8('0x3c')]+'%'};return _0x56ca3e;}})});}_0xd48ad=_[_0xb7e8('0x3f')]({},_0xd48ad,_0x4b5012[_0xb7e8('0x40')]);var _0x5c49d7={'where':_0xd48ad[_0xb7e8('0x3d')]};return db[_0xb7e8('0x41')][_0xb7e8('0x42')](_0x5c49d7)[_0xb7e8('0x29')](function(_0xfe23fc){_0x2caf36[_0xb7e8('0x42')]=_0xfe23fc;if(_0x4b5012[_0xb7e8('0x33')][_0xb7e8('0x43')]){_0xd48ad[_0xb7e8('0x44')]=[{'all':!![]}];}return db[_0xb7e8('0x41')][_0xb7e8('0x45')](_0xd48ad);})['then'](function(_0x38a819){_0x2caf36[_0xb7e8('0x46')]=_0x38a819;return _0x2caf36;})['then'](respondWithFilteredResult(_0x2e65c6,_0xd48ad))[_0xb7e8('0x47')](handleError(_0x2e65c6,null));};exports['show']=function(_0x4bce8f,_0x5a4e52){var _0x382ded={'raw':!![],'where':{'id':_0x4bce8f[_0xb7e8('0x48')]['id']}},_0x51d89c={};_0x51d89c['model']=_[_0xb7e8('0x34')](db[_0xb7e8('0x41')][_0xb7e8('0x49')]);_0x51d89c[_0xb7e8('0x33')]=_[_0xb7e8('0x34')](_0x4bce8f[_0xb7e8('0x33')]);_0x51d89c['filters']=_[_0xb7e8('0x35')](_0x51d89c['model'],_0x51d89c[_0xb7e8('0x33')]);_0x382ded[_0xb7e8('0x36')]=_['intersection'](_0x51d89c[_0xb7e8('0x32')],qs[_0xb7e8('0x4a')](_0x4bce8f[_0xb7e8('0x33')][_0xb7e8('0x4a')]));_0x382ded[_0xb7e8('0x36')]=_0x382ded[_0xb7e8('0x36')]['length']?_0x382ded['attributes']:_0x51d89c[_0xb7e8('0x32')];if(_0x4bce8f['query'][_0xb7e8('0x43')]){_0x382ded[_0xb7e8('0x44')]=[{'all':!![]}];}_0x382ded=_[_0xb7e8('0x3f')]({},_0x382ded,_0x4bce8f['options']);return db[_0xb7e8('0x41')][_0xb7e8('0x4b')](_0x382ded)['then'](handleEntityNotFound(_0x5a4e52,null))[_0xb7e8('0x29')](respondWithResult(_0x5a4e52,null))[_0xb7e8('0x47')](handleError(_0x5a4e52,null));};exports[_0xb7e8('0x4c')]=function(_0x35fb49,_0x1edb7d){return db[_0xb7e8('0x41')][_0xb7e8('0x4c')](_0x35fb49['body'],{})[_0xb7e8('0x29')](respondWithResult(_0x1edb7d,0xc9))[_0xb7e8('0x47')](handleError(_0x1edb7d,null));};exports[_0xb7e8('0x28')]=function(_0x1b3a53,_0x22d65b){if(_0x1b3a53[_0xb7e8('0x4d')]['id']){delete _0x1b3a53[_0xb7e8('0x4d')]['id'];}return db['ChatInternalMessage'][_0xb7e8('0x4b')]({'where':{'id':_0x1b3a53['params']['id']}})['then'](handleEntityNotFound(_0x22d65b,null))[_0xb7e8('0x29')](saveUpdates(_0x1b3a53[_0xb7e8('0x4d')],null))[_0xb7e8('0x29')](respondWithResult(_0x22d65b,null))['catch'](handleError(_0x22d65b,null));};exports[_0xb7e8('0x2a')]=function(_0x1828dc,_0xbf56ea){return db['ChatInternalMessage'][_0xb7e8('0x4b')]({'where':{'id':_0x1828dc[_0xb7e8('0x48')]['id']}})[_0xb7e8('0x29')](handleEntityNotFound(_0xbf56ea,null))['then'](removeEntity(_0xbf56ea,null))['catch'](handleError(_0xbf56ea,null));};exports[_0xb7e8('0x4e')]=function(_0x35f468,_0x2fc899){return db[_0xb7e8('0x41')][_0xb7e8('0x4e')]()[_0xb7e8('0x29')](respondWithResult(_0x2fc899,null))[_0xb7e8('0x47')](handleError(_0x2fc899,null));};function wrapUser(_0x2d3b25){return function(_0x201b69){var _0x43fb1b=_0x2d3b25[_0xb7e8('0x4f')]({'plain':!![]});_0x43fb1b[_0xb7e8('0x50')]=[];if(_0x201b69){_0x43fb1b[_0xb7e8('0x51')]=_0x201b69[_0xb7e8('0x52')];_0x43fb1b['lastMessage']=_0x201b69;}else{_0x43fb1b[_0xb7e8('0x51')]=moment(0x0)[_0xb7e8('0x53')](_0xb7e8('0x54'));_0x43fb1b[_0xb7e8('0x55')]={};}return _0x43fb1b;};}exports['getUsers']=function(_0x50c95c,_0x85d171,_0x550a3c){var _0x3699b3=[];return db[_0xb7e8('0x56')][_0xb7e8('0x45')]({'where':{'role':[_0xb7e8('0x57'),'admin',_0xb7e8('0x58')]},'attributes':['id',_0xb7e8('0x59'),_0xb7e8('0x2e'),_0xb7e8('0x5a'),_0xb7e8('0x5b'),'internal',_0xb7e8('0x5c'),'lastLoginAt',_0xb7e8('0x5d'),_0xb7e8('0x5e')],'order':qs[_0xb7e8('0x39')](_0xb7e8('0x5f')),'include':[{'model':db[_0xb7e8('0x60')],'as':_0xb7e8('0x61'),'attributes':['id',_0xb7e8('0x2e'),'type'],'through':{'attributes':[]}}]})[_0xb7e8('0x29')](function(_0x3a5129){if(_0x3a5129){var _0x5d5a94=_0x50c95c[_0xb7e8('0x58')][_0xb7e8('0x4f')]({'plain':!![]});if(!_0x5d5a94)throw new Error(_0xb7e8('0x62'));if(_0x5d5a94['role']===_0xb7e8('0x58')){return db['UserProfileSection']['find']({'where':{'name':_0xb7e8('0x63'),'userProfileId':_0x5d5a94[_0xb7e8('0x64')]},'raw':!![]})[_0xb7e8('0x29')](function(_0x1f2138){if(_0x1f2138){if(_0x1f2138[_0xb7e8('0x65')]===0x0){return db['UserProfileResource'][_0xb7e8('0x45')]({'where':{'sectionId':_0x1f2138['id']},'raw':!![]})[_0xb7e8('0x29')](function(_0x36bb35){var _0x3d9aa0=[];if(_[_0xb7e8('0x66')](_0x36bb35)){_0x3d9aa0=_['filter'](_0x3a5129,function(_0x215480){if(_0x215480[_0xb7e8('0x5a')]!==_0xb7e8('0x57')){return _0x215480;}});return _0x3d9aa0;}else{for(var _0x3e0f3f=0x0;_0x3e0f3f<_0x3a5129[_0xb7e8('0x67')];_0x3e0f3f++){var _0x1d509f=_0x3a5129[_0x3e0f3f];if(_0x1d509f['role']===_0xb7e8('0x57')){var _0x1f00d4=_[_0xb7e8('0x4b')](_0x36bb35,function(_0x3f319b){return _0x3f319b[_0xb7e8('0x68')]===_0x1d509f['id'];});if(_0x1f00d4)_0x3d9aa0[_0xb7e8('0x69')](_0x1d509f);}else{_0x3d9aa0[_0xb7e8('0x69')](_0x1d509f);}}return _0x3d9aa0;}});}else{return _0x3a5129;}}else{var _0x50e7b=_[_0xb7e8('0x3c')](_0x3a5129,function(_0x12e1e2){if(_0x12e1e2[_0xb7e8('0x5a')]!=='agent'){return _0x12e1e2;}});return _0x50e7b;}});}else{return _0x3a5129;}}})['then'](function(_0x359f70){var _0x161863=[];if(_0x359f70){_0x3699b3=_0x359f70;for(var _0x256006=0x0;_0x256006<_0x359f70[_0xb7e8('0x67')];_0x256006+=0x1){_0x3699b3[_0x256006]['messages']=[];_0x161863[_0xb7e8('0x69')](db[_0xb7e8('0x41')]['find']({'where':{'FromId':[_0x50c95c[_0xb7e8('0x58')]['id'],_0x359f70[_0x256006]['id']],'ToId':[_0x50c95c[_0xb7e8('0x58')]['id'],_0x359f70[_0x256006]['id']],'ChatGroupId':null},'attributes':['id',_0xb7e8('0x52'),'FromId',_0xb7e8('0x6a'),_0xb7e8('0x6b'),_0xb7e8('0x4d')],'order':qs[_0xb7e8('0x39')](_0xb7e8('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb7e8('0x29')](wrapUser(_0x359f70[_0x256006])));}return BPromise[_0xb7e8('0x6d')](_0x161863);}return[];})[_0xb7e8('0x29')](function(_0x1c080d){return{'rows':_0x1c080d,'count':_0x1c080d[_0xb7e8('0x67')]};})[_0xb7e8('0x29')](respondWithResult(_0x85d171,null))[_0xb7e8('0x47')](handleError(_0x85d171,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 321b13d..4f553ec 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 _0x92bc=['remove','emit','exports','events','../../mysqldb','ChatInternalMessage','update'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x92bc,0x106));var _0xc92b=function(_0x355ade,_0x2d777c){_0x355ade=_0x355ade-0x0;var _0x587b96=_0x92bc[_0x355ade];return _0x587b96;};'use strict';var EventEmitter=require(_0xc92b('0x0'));var ChatInternalMessage=require(_0xc92b('0x1'))['db'][_0xc92b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc92b('0x3'),'afterDestroy':_0xc92b('0x4')};function emitEvent(_0x35903f){return function(_0x1d7812,_0x56c979,_0x2dcfaa){ChatInternalMessageEvents[_0xc92b('0x5')](_0x35903f+':'+_0x1d7812['id'],_0x1d7812);ChatInternalMessageEvents[_0xc92b('0x5')](_0x35903f,_0x1d7812);_0x2dcfaa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xc92b('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x1a8f=['events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x58c7b0,_0x4cb178){var _0x22a17d=function(_0xdb4bc){while(--_0xdb4bc){_0x58c7b0['push'](_0x58c7b0['shift']());}};_0x22a17d(++_0x4cb178);}(_0x1a8f,0x87));var _0xf1a8=function(_0x79324e,_0x4af67e){_0x79324e=_0x79324e-0x0;var _0x555666=_0x1a8f[_0x79324e];return _0x555666;};'use strict';var EventEmitter=require(_0xf1a8('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xf1a8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf1a8('0x2')](0x0);var events={'afterCreate':_0xf1a8('0x3'),'afterUpdate':_0xf1a8('0x4'),'afterDestroy':_0xf1a8('0x5')};function emitEvent(_0x5bc9ff){return function(_0x520d7d,_0x4f9445,_0x5712f0){ChatInternalMessageEvents[_0xf1a8('0x6')](_0x5bc9ff+':'+_0x520d7d['id'],_0x520d7d);ChatInternalMessageEvents[_0xf1a8('0x6')](_0x5bc9ff,_0x520d7d);_0x5712f0(null);};}for(var e in events){if(events[_0xf1a8('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xf1a8('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 2f84b3c..afe1f5a 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 _0xb43b=['./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5333ba,_0x22e1bb){var _0x20f9dc=function(_0x1956af){while(--_0x1956af){_0x5333ba['push'](_0x5333ba['shift']());}};_0x20f9dc(++_0x22e1bb);}(_0xb43b,0x1b2));var _0xbb43=function(_0x34a394,_0x497f5f){_0x34a394=_0x34a394-0x0;var _0x5f1224=_0xb43b[_0x34a394];return _0x5f1224;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbb43('0xb'),'collate':_0xbb43('0xc')});}; \ No newline at end of file +var _0xe706=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x479188,_0x505a1c){var _0x466b0d=function(_0x57c2c8){while(--_0x57c2c8){_0x479188['push'](_0x479188['shift']());}};_0x466b0d(++_0x505a1c);}(_0xe706,0xa3));var _0x6e70=function(_0x3a340f,_0x18653e){_0x3a340f=_0x3a340f-0x0;var _0x14ca55=_0xe706[_0x3a340f];return _0x14ca55;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e70('0xe'),'collate':_0x6e70('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index c7b15bf..3ae0226 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 _0xe4b7=['message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2c8a32,_0x46f29e){var _0x22b3d7=function(_0x4d681a){while(--_0x4d681a){_0x2c8a32['push'](_0x2c8a32['shift']());}};_0x22b3d7(++_0x46f29e);}(_0xe4b7,0x189));var _0x7e4b=function(_0x23b106,_0x50acec){_0x23b106=_0x23b106-0x0;var _0x3c88e5=_0xe4b7[_0x23b106];return _0x3c88e5;};'use strict';var _=require(_0x7e4b('0x0'));var util=require(_0x7e4b('0x1'));var moment=require(_0x7e4b('0x2'));var BPromise=require(_0x7e4b('0x3'));var rs=require(_0x7e4b('0x4'));var fs=require('fs');var Redis=require(_0x7e4b('0x5'));var db=require(_0x7e4b('0x6'))['db'];var utils=require(_0x7e4b('0x7'));var logger=require(_0x7e4b('0x8'))(_0x7e4b('0x9'));var config=require(_0x7e4b('0xa'));var jayson=require(_0x7e4b('0xb'));var client=jayson[_0x7e4b('0xc')]['http']({'port':0x232a});config[_0x7e4b('0xd')]=_[_0x7e4b('0xe')](config[_0x7e4b('0xd')],{'host':_0x7e4b('0xf'),'port':0x18eb});var socket=require(_0x7e4b('0x10'))(new Redis(config[_0x7e4b('0xd')]));require(_0x7e4b('0x11'))[_0x7e4b('0x12')](socket);function respondWithRpcPromise(_0x4705e5,_0x1a5cb9,_0x1d224d){return new BPromise(function(_0x1873d4,_0x4d357c){return client[_0x7e4b('0x13')](_0x4705e5,_0x1d224d)[_0x7e4b('0x14')](function(_0x27b559){logger[_0x7e4b('0x15')](_0x7e4b('0x16'),_0x1a5cb9,'request\x20sent');logger[_0x7e4b('0x17')](_0x7e4b('0x18'),_0x1a5cb9,'request\x20sent',JSON['stringify'](_0x27b559));if(_0x27b559[_0x7e4b('0x19')]){if(_0x27b559[_0x7e4b('0x19')][_0x7e4b('0x1a')]===0x1f4){logger['error'](_0x7e4b('0x16'),_0x1a5cb9,_0x27b559['error'][_0x7e4b('0x1b')]);return _0x4d357c(_0x27b559[_0x7e4b('0x19')]['message']);}logger[_0x7e4b('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x1a5cb9,_0x27b559[_0x7e4b('0x19')]['message']);return _0x1873d4(_0x27b559['error'][_0x7e4b('0x1b')]);}else{logger['info'](_0x7e4b('0x16'),_0x1a5cb9,_0x7e4b('0x1c'));_0x1873d4(_0x27b559[_0x7e4b('0x1d')][_0x7e4b('0x1b')]);}})['catch'](function(_0x34bd98){logger[_0x7e4b('0x19')](_0x7e4b('0x16'),_0x1a5cb9,_0x34bd98);_0x4d357c(_0x34bd98);});});} \ No newline at end of file +var _0xc1ab=['redis','defaults','localhost','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x589f71,_0x212326){var _0x5763bd=function(_0x2cb8e1){while(--_0x2cb8e1){_0x589f71['push'](_0x589f71['shift']());}};_0x5763bd(++_0x212326);}(_0xc1ab,0x67));var _0xbc1a=function(_0x481748,_0x19cfc9){_0x481748=_0x481748-0x0;var _0x3c36ab=_0xc1ab[_0x481748];return _0x3c36ab;};'use strict';var _=require(_0xbc1a('0x0'));var util=require(_0xbc1a('0x1'));var moment=require(_0xbc1a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbc1a('0x3'));var logger=require(_0xbc1a('0x4'))(_0xbc1a('0x5'));var config=require(_0xbc1a('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xbc1a('0x7')]=_[_0xbc1a('0x8')](config[_0xbc1a('0x7')],{'host':_0xbc1a('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbc1a('0xa'))['register'](socket);function respondWithRpcPromise(_0x5d30b5,_0x42d8ab,_0x46a6f9){return new BPromise(function(_0x14ac9d,_0x39c830){return client[_0xbc1a('0xb')](_0x5d30b5,_0x46a6f9)[_0xbc1a('0xc')](function(_0x59acbd){logger[_0xbc1a('0xd')](_0xbc1a('0xe'),_0x42d8ab,_0xbc1a('0xf'));logger[_0xbc1a('0x10')](_0xbc1a('0x11'),_0x42d8ab,'request\x20sent',JSON['stringify'](_0x59acbd));if(_0x59acbd['error']){if(_0x59acbd[_0xbc1a('0x12')][_0xbc1a('0x13')]===0x1f4){logger[_0xbc1a('0x12')](_0xbc1a('0xe'),_0x42d8ab,_0x59acbd[_0xbc1a('0x12')]['message']);return _0x39c830(_0x59acbd['error']['message']);}logger[_0xbc1a('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x42d8ab,_0x59acbd[_0xbc1a('0x12')][_0xbc1a('0x14')]);return _0x14ac9d(_0x59acbd['error'][_0xbc1a('0x14')]);}else{logger[_0xbc1a('0xd')]('ChatInternalMessage,\x20%s,\x20%s',_0x42d8ab,_0xbc1a('0xf'));_0x14ac9d(_0x59acbd['result'][_0xbc1a('0x14')]);}})[_0xbc1a('0x15')](function(_0x54dbe7){logger['error'](_0xbc1a('0xe'),_0x42d8ab,_0x54dbe7);_0x39c830(_0x54dbe7);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 1287a2e..a34d767 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 _0xbb95=['chatInternalMessage:','./chatInternalMessage.events','save','emit','register','length'];(function(_0x304efd,_0x2a8940){var _0x490c74=function(_0x566702){while(--_0x566702){_0x304efd['push'](_0x304efd['shift']());}};_0x490c74(++_0x2a8940);}(_0xbb95,0x7f));var _0x5bb9=function(_0x4536d7,_0x2c14bd){_0x4536d7=_0x4536d7-0x0;var _0x268280=_0xbb95[_0x4536d7];return _0x268280;};'use strict';var ChatInternalMessageEvents=require(_0x5bb9('0x0'));var events=[_0x5bb9('0x1'),'remove','update'];function createListener(_0x15492a,_0x2a9386){return function(_0x535716){_0x2a9386[_0x5bb9('0x2')](_0x15492a,_0x535716);};}function removeListener(_0x572ef3,_0x4ef42d){return function(){ChatInternalMessageEvents['removeListener'](_0x572ef3,_0x4ef42d);};}exports[_0x5bb9('0x3')]=function(_0x2b72aa){for(var _0x49b590=0x0,_0x180e69=events[_0x5bb9('0x4')];_0x49b590<_0x180e69;_0x49b590++){var _0x39f347=events[_0x49b590];var _0x5e8b1c=createListener(_0x5bb9('0x5')+_0x39f347,_0x2b72aa);ChatInternalMessageEvents['on'](_0x39f347,_0x5e8b1c);}}; \ No newline at end of file +var _0x0487=['length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x312595,_0xd65dfa){var _0x3c32ae=function(_0x4298e5){while(--_0x4298e5){_0x312595['push'](_0x312595['shift']());}};_0x3c32ae(++_0xd65dfa);}(_0x0487,0x14f));var _0x7048=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x0487[_0x5f1617];return _0x3af5da;};'use strict';var ChatInternalMessageEvents=require(_0x7048('0x0'));var events=[_0x7048('0x1'),_0x7048('0x2'),_0x7048('0x3')];function createListener(_0x2d6c45,_0xa0ecc){return function(_0x4e824e){_0xa0ecc[_0x7048('0x4')](_0x2d6c45,_0x4e824e);};}function removeListener(_0x4e8f94,_0xf80df7){return function(){ChatInternalMessageEvents[_0x7048('0x5')](_0x4e8f94,_0xf80df7);};}exports[_0x7048('0x6')]=function(_0x3e709b){for(var _0x53c160=0x0,_0x2aaedd=events[_0x7048('0x7')];_0x53c160<_0x2aaedd;_0x53c160++){var _0xf90179=events[_0x53c160];var _0x5683ce=createListener(_0x7048('0x8')+_0xf90179,_0x3e709b);ChatInternalMessageEvents['on'](_0xf90179,_0x5683ce);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 646c895..6b40784 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 _0x4130=['post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','show'];(function(_0x5df769,_0x289d3f){var _0x1dc044=function(_0x492be3){while(--_0x492be3){_0x5df769['push'](_0x5df769['shift']());}};_0x1dc044(++_0x289d3f);}(_0x4130,0x1a6));var _0x0413=function(_0x5a6325,_0x1eb81d){_0x5a6325=_0x5a6325-0x0;var _0x3acf46=_0x4130[_0x5a6325];return _0x3acf46;};'use strict';var multer=require(_0x0413('0x0'));var util=require(_0x0413('0x1'));var path=require('path');var timeout=require(_0x0413('0x2'));var express=require('express');var router=express[_0x0413('0x3')]();var fs_extra=require(_0x0413('0x4'));var auth=require(_0x0413('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0413('0x6'));var controller=require(_0x0413('0x7'));router['get']('/',auth[_0x0413('0x8')](),controller[_0x0413('0x9')]);router[_0x0413('0xa')](_0x0413('0xb'),auth[_0x0413('0x8')](),controller[_0x0413('0xc')]);router[_0x0413('0xa')](_0x0413('0xd'),auth[_0x0413('0x8')](),controller['getUsers']);router[_0x0413('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0413('0xe')]);router[_0x0413('0xf')]('/',auth['isAuthenticated'](),controller[_0x0413('0x10')]);router[_0x0413('0x11')]('/:id',controller[_0x0413('0x12')]);router[_0x0413('0x13')](_0x0413('0x14'),auth['isAuthenticated'](),controller[_0x0413('0x15')]);module[_0x0413('0x16')]=router; \ No newline at end of file +var _0x0bbb=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','put','update','delete'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x0bbb,0xd3));var _0xb0bb=function(_0x71821,_0x2f2405){_0x71821=_0x71821-0x0;var _0x523fb4=_0x0bbb[_0x71821];return _0x523fb4;};'use strict';var multer=require(_0xb0bb('0x0'));var util=require(_0xb0bb('0x1'));var path=require(_0xb0bb('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0bb('0x3'));var router=express[_0xb0bb('0x4')]();var fs_extra=require(_0xb0bb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb0bb('0x6'));var config=require(_0xb0bb('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xb0bb('0x8')]('/',auth[_0xb0bb('0x9')](),controller[_0xb0bb('0xa')]);router[_0xb0bb('0x8')](_0xb0bb('0xb'),auth[_0xb0bb('0x9')](),controller['describe']);router[_0xb0bb('0x8')]('/users',auth[_0xb0bb('0x9')](),controller['getUsers']);router[_0xb0bb('0x8')](_0xb0bb('0xc'),auth['isAuthenticated'](),controller[_0xb0bb('0xd')]);router['post']('/',auth[_0xb0bb('0x9')](),controller['create']);router[_0xb0bb('0xe')](_0xb0bb('0xc'),controller[_0xb0bb('0xf')]);router[_0xb0bb('0x10')]('/:id',auth[_0xb0bb('0x9')](),controller[_0xb0bb('0x11')]);module[_0xb0bb('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 8cada3e..05eb8fb 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 _0xceaf=['ENUM','out','STRING','TEXT','sequelize','medium','BOOLEAN'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xceaf,0x162));var _0xfcea=function(_0xb5dd65,_0x462908){_0xb5dd65=_0xb5dd65-0x0;var _0x3c2db9=_0xceaf[_0xb5dd65];return _0x3c2db9;};'use strict';var Sequelize=require(_0xfcea('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xfcea('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xfcea('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfcea('0x3')]('in',_0xfcea('0x4')),'defaultValue':_0xfcea('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xfcea('0x5')]},'providerResponse':{'type':Sequelize[_0xfcea('0x6')]}}; \ No newline at end of file +var _0x8e92=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x1d7ce6,_0x432ab4){var _0x5127bf=function(_0x14622a){while(--_0x14622a){_0x1d7ce6['push'](_0x1d7ce6['shift']());}};_0x5127bf(++_0x432ab4);}(_0x8e92,0x133));var _0x28e9=function(_0x4515f5,_0x2a4cab){_0x4515f5=_0x4515f5-0x0;var _0x3c96e7=_0x8e92[_0x4515f5];return _0x3c96e7;};'use strict';var Sequelize=require(_0x28e9('0x0'));module['exports']={'body':{'type':Sequelize[_0x28e9('0x1')](_0x28e9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x28e9('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x28e9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x28e9('0x4')]('in',_0x28e9('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x28e9('0x6')]},'providerResponse':{'type':Sequelize[_0x28e9('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 8222ae3..ca3e0e1 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 _0xd2c5=['create','body','update','describe','../../config/logger','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','CmContact','Contact','get','isNil','interaction','user','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatMessage.socket','register','jayson/promise','client','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','ChatMessage','find'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0xd2c5,0x110));var _0x5d2c=function(_0x713836,_0x25f8e3){_0x713836=_0x713836-0x0;var _0x70ab36=_0xd2c5[_0x713836];return _0x70ab36;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5d2c('0x0'));var jsonpatch=require(_0x5d2c('0x1'));var rp=require(_0x5d2c('0x2'));var moment=require(_0x5d2c('0x3'));var BPromise=require(_0x5d2c('0x4'));var Mustache=require(_0x5d2c('0x5'));var util=require('util');var path=require(_0x5d2c('0x6'));var sox=require(_0x5d2c('0x7'));var csv=require(_0x5d2c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d2c('0x9'));var _=require(_0x5d2c('0xa'));var squel=require(_0x5d2c('0xb'));var crypto=require(_0x5d2c('0xc'));var jsforce=require(_0x5d2c('0xd'));var deskjs=require(_0x5d2c('0xe'));var toCsv=require(_0x5d2c('0x8'));var querystring=require(_0x5d2c('0xf'));var Papa=require(_0x5d2c('0x10'));var Redis=require(_0x5d2c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5d2c('0x12'));var hardwareService=require(_0x5d2c('0x13'));var logger=require('../../config/logger')(_0x5d2c('0x14'));var utils=require(_0x5d2c('0x15'));var config=require(_0x5d2c('0x16'));var licenseUtil=require(_0x5d2c('0x17'));var db=require('../../mysqldb')['db'];config[_0x5d2c('0x18')]=_['defaults'](config[_0x5d2c('0x18')],{'host':_0x5d2c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d2c('0x18')]));require(_0x5d2c('0x1a'))[_0x5d2c('0x1b')](socket);var jayson=require(_0x5d2c('0x1c'));var client=jayson[_0x5d2c('0x1d')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43e111,_0x5d2004,_0x249b24,_0x4740d0){return new BPromise(function(_0x4147f0,_0xf0a8a){var _0x55892d=_0x4740d0||client;return _0x55892d['request'](_0x43e111,_0x249b24)[_0x5d2c('0x1e')](function(_0x42c279){logger[_0x5d2c('0x1f')](_0x5d2c('0x20'),_0x5d2004,_0x5d2c('0x21'));logger[_0x5d2c('0x22')](_0x5d2c('0x23'),_0x5d2004,_0x5d2c('0x21'),JSON[_0x5d2c('0x24')](_0x42c279));if(_0x42c279['error']){if(_0x42c279[_0x5d2c('0x25')][_0x5d2c('0x26')]===0x1f4){logger[_0x5d2c('0x25')](_0x5d2c('0x20'),_0x5d2004,_0x42c279[_0x5d2c('0x25')]['message']);return _0xf0a8a(_0x42c279[_0x5d2c('0x25')]['message']);}logger[_0x5d2c('0x25')](_0x5d2c('0x20'),_0x5d2004,_0x42c279[_0x5d2c('0x25')]['message']);return _0x4147f0(_0x42c279[_0x5d2c('0x25')][_0x5d2c('0x27')]);}else{logger[_0x5d2c('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x5d2004,_0x5d2c('0x21'));_0x4147f0(_0x42c279[_0x5d2c('0x28')]['message']);}})['catch'](function(_0x38c44b){logger['error']('ChatMessage,\x20%s,\x20%s',_0x5d2004,_0x38c44b);_0xf0a8a(_0x38c44b);});});}function respondWithStatusCode(_0x52f238,_0x4322c5){_0x4322c5=_0x4322c5||0xcc;return function(_0x2b9dad){if(_0x2b9dad){return _0x52f238[_0x5d2c('0x29')](_0x4322c5);}return _0x52f238['status'](_0x4322c5)[_0x5d2c('0x2a')]();};}function respondWithResult(_0x35e0e6,_0x35a135){_0x35a135=_0x35a135||0xc8;return function(_0x57e82e){if(_0x57e82e){return _0x35e0e6[_0x5d2c('0x2b')](_0x35a135)[_0x5d2c('0x2c')](_0x57e82e);}};}function respondWithFilteredResult(_0x2f20db,_0x3b4402){return function(_0x437233){if(_0x437233){var _0x304558=_0x437233[_0x5d2c('0x2d')],_0x21b3f0=_0x3b4402['offset'],_0x36a1bc=_0x3b4402[_0x5d2c('0x2e')]+_0x3b4402[_0x5d2c('0x2f')],_0x1bb538;if(_0x36a1bc>=_0x304558){_0x36a1bc=_0x304558;_0x1bb538=0xc8;}else{_0x1bb538=0xce;}_0x2f20db[_0x5d2c('0x2b')](_0x1bb538);return _0x2f20db[_0x5d2c('0x30')]('Content-Range',_0x21b3f0+'-'+_0x36a1bc+'/'+_0x304558)['json'](_0x437233);}return null;};}function patchUpdates(_0x4fc0bc){return function(_0x38da8a){try{jsonpatch[_0x5d2c('0x31')](_0x38da8a,_0x4fc0bc,!![]);}catch(_0x2300a6){return BPromise[_0x5d2c('0x32')](_0x2300a6);}return _0x38da8a[_0x5d2c('0x33')]();};}function saveUpdates(_0x71ba9c,_0x148a4e){return function(_0x2a6c44){if(_0x2a6c44){return _0x2a6c44['update'](_0x71ba9c)[_0x5d2c('0x1e')](function(_0x2f7360){return _0x2f7360;});}return null;};}function removeEntity(_0x5a1cef,_0x5dddc4){return function(_0x4ef0f2){if(_0x4ef0f2){return _0x4ef0f2[_0x5d2c('0x34')]()[_0x5d2c('0x1e')](function(){_0x5a1cef[_0x5d2c('0x2b')](0xcc)[_0x5d2c('0x2a')]();});}};}function handleEntityNotFound(_0x5aa76c,_0x4f2d03){return function(_0x5570b6){if(!_0x5570b6){_0x5aa76c[_0x5d2c('0x29')](0x194);}return _0x5570b6;};}function handleError(_0x7b960b,_0x4cd02a){_0x4cd02a=_0x4cd02a||0x1f4;return function(_0x3d8ff0){logger['error'](_0x3d8ff0[_0x5d2c('0x35')]);if(_0x3d8ff0[_0x5d2c('0x36')]){delete _0x3d8ff0['name'];}_0x7b960b[_0x5d2c('0x2b')](_0x4cd02a)[_0x5d2c('0x37')](_0x3d8ff0);};}exports[_0x5d2c('0x38')]=function(_0xc364b7,_0x3b291a){var _0x1213f0={},_0x4bb25c={},_0x4e6690={'count':0x0,'rows':[]};var _0x5412d5=_[_0x5d2c('0x39')](db['ChatMessage'][_0x5d2c('0x3a')],function(_0x38e781){return{'name':_0x38e781[_0x5d2c('0x3b')],'type':_0x38e781[_0x5d2c('0x3c')]['key']};});_0x4bb25c['model']=_['map'](_0x5412d5,'name');_0x4bb25c[_0x5d2c('0x3d')]=_['keys'](_0xc364b7['query']);_0x4bb25c['filters']=_[_0x5d2c('0x3e')](_0x4bb25c[_0x5d2c('0x3f')],_0x4bb25c['query']);_0x1213f0[_0x5d2c('0x40')]=_[_0x5d2c('0x3e')](_0x4bb25c[_0x5d2c('0x3f')],qs['fields'](_0xc364b7[_0x5d2c('0x3d')][_0x5d2c('0x41')]));_0x1213f0[_0x5d2c('0x40')]=_0x1213f0[_0x5d2c('0x40')][_0x5d2c('0x42')]?_0x1213f0[_0x5d2c('0x40')]:_0x4bb25c[_0x5d2c('0x3f')];if(!_0xc364b7['query']['hasOwnProperty'](_0x5d2c('0x43'))){_0x1213f0['limit']=qs[_0x5d2c('0x2f')](_0xc364b7['query'][_0x5d2c('0x2f')]);_0x1213f0[_0x5d2c('0x2e')]=qs['offset'](_0xc364b7[_0x5d2c('0x3d')]['offset']);}_0x1213f0[_0x5d2c('0x44')]=qs[_0x5d2c('0x45')](_0xc364b7[_0x5d2c('0x3d')]['sort']);_0x1213f0[_0x5d2c('0x46')]=qs[_0x5d2c('0x47')](_['pick'](_0xc364b7[_0x5d2c('0x3d')],_0x4bb25c[_0x5d2c('0x47')]),_0x5412d5);if(_0xc364b7[_0x5d2c('0x3d')][_0x5d2c('0x48')]){_0x1213f0[_0x5d2c('0x46')]=_[_0x5d2c('0x49')](_0x1213f0[_0x5d2c('0x46')],{'$or':_['map'](_0x5412d5,function(_0x5ad204){if(_0x5ad204['type']!=='VIRTUAL'){var _0x10d515={};_0x10d515[_0x5ad204[_0x5d2c('0x36')]]={'$like':'%'+_0xc364b7['query'][_0x5d2c('0x48')]+'%'};return _0x10d515;}})});}_0x1213f0=_[_0x5d2c('0x49')]({},_0x1213f0,_0xc364b7[_0x5d2c('0x4a')]);var _0x4132ea={'where':_0x1213f0[_0x5d2c('0x46')]};return db['ChatMessage'][_0x5d2c('0x2d')](_0x4132ea)['then'](function(_0x51b317){_0x4e6690[_0x5d2c('0x2d')]=_0x51b317;if(_0xc364b7[_0x5d2c('0x3d')][_0x5d2c('0x4b')]){_0x1213f0[_0x5d2c('0x4c')]=[{'all':!![]}];}return db['ChatMessage'][_0x5d2c('0x4d')](_0x1213f0);})[_0x5d2c('0x1e')](function(_0x5bda56){_0x4e6690[_0x5d2c('0x4e')]=_0x5bda56;return _0x4e6690;})[_0x5d2c('0x1e')](respondWithFilteredResult(_0x3b291a,_0x1213f0))[_0x5d2c('0x4f')](handleError(_0x3b291a,null));};exports[_0x5d2c('0x50')]=function(_0x1519f9,_0xd37362){var _0x8df485={'raw':!![],'where':{'id':_0x1519f9[_0x5d2c('0x51')]['id']}},_0x358f0d={};_0x358f0d['model']=_['keys'](db['ChatMessage'][_0x5d2c('0x3a')]);_0x358f0d[_0x5d2c('0x3d')]=_[_0x5d2c('0x52')](_0x1519f9['query']);_0x358f0d[_0x5d2c('0x47')]=_[_0x5d2c('0x3e')](_0x358f0d['model'],_0x358f0d['query']);_0x8df485['attributes']=_['intersection'](_0x358f0d['model'],qs['fields'](_0x1519f9[_0x5d2c('0x3d')][_0x5d2c('0x41')]));_0x8df485[_0x5d2c('0x40')]=_0x8df485[_0x5d2c('0x40')][_0x5d2c('0x42')]?_0x8df485[_0x5d2c('0x40')]:_0x358f0d['model'];if(_0x1519f9[_0x5d2c('0x3d')][_0x5d2c('0x4b')]){_0x8df485[_0x5d2c('0x4c')]=[{'all':!![]}];}_0x8df485=_['merge']({},_0x8df485,_0x1519f9['options']);return db[_0x5d2c('0x53')][_0x5d2c('0x54')](_0x8df485)['then'](handleEntityNotFound(_0xd37362,null))[_0x5d2c('0x1e')](respondWithResult(_0xd37362,null))[_0x5d2c('0x4f')](handleError(_0xd37362,null));};exports['create']=function(_0xd9586c,_0x9104d1){return db[_0x5d2c('0x53')][_0x5d2c('0x55')](_0xd9586c[_0x5d2c('0x56')],{})['then'](respondWithResult(_0x9104d1,0xc9))['catch'](handleError(_0x9104d1,null));};exports[_0x5d2c('0x57')]=function(_0x1a05ba,_0x244122){if(_0x1a05ba[_0x5d2c('0x56')]['id']){delete _0x1a05ba['body']['id'];}return db[_0x5d2c('0x53')][_0x5d2c('0x54')]({'where':{'id':_0x1a05ba[_0x5d2c('0x51')]['id']}})[_0x5d2c('0x1e')](handleEntityNotFound(_0x244122,null))['then'](saveUpdates(_0x1a05ba[_0x5d2c('0x56')],null))[_0x5d2c('0x1e')](respondWithResult(_0x244122,null))[_0x5d2c('0x4f')](handleError(_0x244122,null));};exports[_0x5d2c('0x34')]=function(_0x5a07f1,_0x5a466c){return db[_0x5d2c('0x53')][_0x5d2c('0x54')]({'where':{'id':_0x5a07f1[_0x5d2c('0x51')]['id']}})[_0x5d2c('0x1e')](handleEntityNotFound(_0x5a466c,null))['then'](removeEntity(_0x5a466c,null))['catch'](handleError(_0x5a466c,null));};exports[_0x5d2c('0x58')]=function(_0xe1e8c4,_0x389eff){return db['ChatMessage']['describe']()[_0x5d2c('0x1e')](respondWithResult(_0x389eff,null))[_0x5d2c('0x4f')](handleError(_0x389eff,null));};var interaction_log=require(_0x5d2c('0x59'))(_0x5d2c('0x5a'));exports[_0x5d2c('0x5b')]=function(_0x547389,_0x16f6fb,_0x474f85){var _0x4a06e1={'agent':{},'channel':_0x5d2c('0x5c')};if(_0x547389[_0x5d2c('0x56')]['id']){delete _0x547389[_0x5d2c('0x56')]['id'];}_0x547389[_0x5d2c('0x56')]['read']=!![];_0x547389[_0x5d2c('0x56')]['readAt']=moment()[_0x5d2c('0x5d')](_0x5d2c('0x5e'));_0x547389[_0x5d2c('0x56')][_0x5d2c('0x5f')]=_0x547389[_0x5d2c('0x56')][_0x5d2c('0x5f')]||_0x547389['user']['id'];_0x4a06e1[_0x5d2c('0x60')]['id']=_0x547389[_0x5d2c('0x56')][_0x5d2c('0x5f')];return db[_0x5d2c('0x53')][_0x5d2c('0x54')]({'where':{'id':_0x547389[_0x5d2c('0x51')]['id'],'UserId':null},'include':[{'model':db[_0x5d2c('0x61')],'as':_0x5d2c('0x62')}]})['then'](handleEntityNotFound(_0x16f6fb,null))['then'](saveUpdates(_0x547389[_0x5d2c('0x56')],null))['then'](function(_0x106bea){if(_0x106bea){_0x4a06e1[_0x5d2c('0x27')]=_0x106bea[_0x5d2c('0x63')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x106bea['ChatInteractionId']}});}return null;})[_0x5d2c('0x1e')](handleEntityNotFound(_0x16f6fb,null))[_0x5d2c('0x1e')](function(_0xb81cf9){if(_0xb81cf9){return _0xb81cf9[_0x5d2c('0x57')]({'UserId':_0x547389[_0x5d2c('0x56')][_0x5d2c('0x5f')],'read1stAt':_[_0x5d2c('0x64')](_0xb81cf9['read1stAt'])?moment()[_0x5d2c('0x5d')](_0x5d2c('0x5e')):undefined});}return null;})[_0x5d2c('0x1e')](function(_0x3763e4){if(_0x3763e4){_0x4a06e1[_0x5d2c('0x65')]=_0x3763e4['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x547389['user']['id'],_0x547389[_0x5d2c('0x66')][_0x5d2c('0x36')],_0x547389[_0x5d2c('0x66')][_0x5d2c('0x67')],_0x4a06e1[_0x5d2c('0x65')]['id'],_0x547389[_0x5d2c('0x56')]?JSON[_0x5d2c('0x24')](_0x547389[_0x5d2c('0x56')]):_0x5d2c('0x68'));return respondWithRpcPromise(_0x5d2c('0x69'),_0x5d2c('0x6a'),_0x4a06e1);}return null;})['then'](function(_0x340694){if(_0x340694){if(_0x547389[_0x5d2c('0x56')][_0x5d2c('0x6b')]){_0x4a06e1[_0x5d2c('0x27')][_0x5d2c('0x6c')]=util['format'](_0x5d2c('0x6d'),_0x547389[_0x5d2c('0x66')][_0x5d2c('0x36')]);_0x4a06e1['message'][_0x5d2c('0x6e')]=_0x4a06e1[_0x5d2c('0x6e')];_0x4a06e1[_0x5d2c('0x27')][_0x5d2c('0x6f')]='accept';return respondWithRpcPromise(_0x5d2c('0x70'),_0x5d2c('0x70'),{'event':_0x5d2c('0x71'),'message':_[_0x5d2c('0x49')](_0x4a06e1[_0x5d2c('0x27')],JSON['parse'](_0x4a06e1['interaction']['formData']))},client9002)[_0x5d2c('0x1e')](function(){return _0x4a06e1;});}return _0x4a06e1;}return null;})[_0x5d2c('0x1e')](respondWithResult(_0x16f6fb,null))[_0x5d2c('0x4f')](handleError(_0x16f6fb,null));};var interaction_log=require(_0x5d2c('0x59'))('chat-interactions');exports[_0x5d2c('0x32')]=function(_0x3d3e0b,_0x384ab8,_0x250e32){var _0x1f4476={'agent':{},'channel':'chat'};if(_0x3d3e0b[_0x5d2c('0x56')]['id']){delete _0x3d3e0b['body']['id'];}_0x3d3e0b[_0x5d2c('0x56')][_0x5d2c('0x5f')]=_0x3d3e0b['body'][_0x5d2c('0x5f')]||_0x3d3e0b['user']['id'];_0x1f4476[_0x5d2c('0x60')]['id']=_0x3d3e0b[_0x5d2c('0x56')][_0x5d2c('0x5f')];return db[_0x5d2c('0x53')][_0x5d2c('0x54')]({'where':{'id':_0x3d3e0b[_0x5d2c('0x51')]['id'],'UserId':null}})[_0x5d2c('0x1e')](handleEntityNotFound(_0x384ab8,null))[_0x5d2c('0x1e')](function(_0x2f01a1){if(_0x2f01a1){_0x1f4476[_0x5d2c('0x27')]=_0x2f01a1[_0x5d2c('0x63')]({'plain':!![]});return db[_0x5d2c('0x72')][_0x5d2c('0x54')]({'where':{'id':_0x2f01a1[_0x5d2c('0x73')]}});}return null;})[_0x5d2c('0x1e')](handleEntityNotFound(_0x384ab8,null))[_0x5d2c('0x1e')](function(_0x8a3f9){if(_0x8a3f9){_0x1f4476[_0x5d2c('0x65')]=_0x8a3f9[_0x5d2c('0x63')]({'plain':!![]});interaction_log['info'](_0x5d2c('0x74'),_0x3d3e0b[_0x5d2c('0x66')]['id'],_0x3d3e0b[_0x5d2c('0x66')][_0x5d2c('0x36')],_0x3d3e0b[_0x5d2c('0x66')]['role'],_0x1f4476[_0x5d2c('0x65')]['id'],_0x3d3e0b[_0x5d2c('0x56')]?JSON[_0x5d2c('0x24')](_0x3d3e0b[_0x5d2c('0x56')]):_0x5d2c('0x68'));return respondWithRpcPromise('RejectMessage',_0x5d2c('0x75'),_0x1f4476);}return null;})['then'](function(_0x35f369){if(_0x35f369){_0x35f369[_0x5d2c('0x27')][_0x5d2c('0x6c')]=util[_0x5d2c('0x5d')](_0x5d2c('0x6d'),_0x3d3e0b[_0x5d2c('0x66')][_0x5d2c('0x36')]);_0x35f369[_0x5d2c('0x27')]['channel']=_0x1f4476[_0x5d2c('0x6e')];_0x35f369['message'][_0x5d2c('0x6f')]=_0x5d2c('0x32');respondWithRpcPromise(_0x5d2c('0x70'),_0x5d2c('0x70'),{'event':_0x5d2c('0x76'),'message':_0x35f369[_0x5d2c('0x27')]},client9002);return _0x1f4476;}return null;})[_0x5d2c('0x1e')](respondWithResult(_0x384ab8,null))[_0x5d2c('0x4f')](handleError(_0x384ab8,null));}; \ No newline at end of file +var _0xe6a5=['fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','findAll','rows','show','params','keys','rawAttributes','length','includeAll','include','find','create','body','destroy','describe','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','reject','rejectmessage','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','end','json','offset','limit','Content-Range','apply','save','update','status','stack','name','send','index','map','ChatMessage','type','key','model','query','filters','intersection'];(function(_0x15f1fe,_0x11db4f){var _0x523d4b=function(_0x4687ff){while(--_0x4687ff){_0x15f1fe['push'](_0x15f1fe['shift']());}};_0x523d4b(++_0x11db4f);}(_0xe6a5,0x13b));var _0x5e6a=function(_0x4fa9ea,_0xb038d8){_0x4fa9ea=_0x4fa9ea-0x0;var _0x8a1ba7=_0xe6a5[_0x4fa9ea];return _0x8a1ba7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5e6a('0x0'));var rp=require(_0x5e6a('0x1'));var moment=require(_0x5e6a('0x2'));var BPromise=require(_0x5e6a('0x3'));var Mustache=require('mustache');var util=require(_0x5e6a('0x4'));var path=require('path');var sox=require(_0x5e6a('0x5'));var csv=require(_0x5e6a('0x6'));var ejs=require(_0x5e6a('0x7'));var fs=require('fs');var fs_extra=require(_0x5e6a('0x8'));var _=require(_0x5e6a('0x9'));var squel=require(_0x5e6a('0xa'));var crypto=require(_0x5e6a('0xb'));var jsforce=require(_0x5e6a('0xc'));var deskjs=require(_0x5e6a('0xd'));var toCsv=require(_0x5e6a('0x6'));var querystring=require(_0x5e6a('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e6a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5e6a('0x10'));var as=require(_0x5e6a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e6a('0x12'))(_0x5e6a('0x13'));var utils=require(_0x5e6a('0x14'));var config=require(_0x5e6a('0x15'));var licenseUtil=require(_0x5e6a('0x16'));var db=require(_0x5e6a('0x17'))['db'];config[_0x5e6a('0x18')]=_[_0x5e6a('0x19')](config['redis'],{'host':_0x5e6a('0x1a'),'port':0x18eb});var socket=require(_0x5e6a('0x1b'))(new Redis(config[_0x5e6a('0x18')]));require(_0x5e6a('0x1c'))['register'](socket);var jayson=require(_0x5e6a('0x1d'));var client=jayson[_0x5e6a('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0x5e6a('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x106880,_0x3bd464,_0x1fa157,_0x44ce66){return new BPromise(function(_0x53d663,_0x42692d){var _0xd71c9e=_0x44ce66||client;return _0xd71c9e['request'](_0x106880,_0x1fa157)[_0x5e6a('0x20')](function(_0xa5aa55){logger['info'](_0x5e6a('0x21'),_0x3bd464,'request\x20sent');logger[_0x5e6a('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3bd464,_0x5e6a('0x23'),JSON[_0x5e6a('0x24')](_0xa5aa55));if(_0xa5aa55[_0x5e6a('0x25')]){if(_0xa5aa55[_0x5e6a('0x25')][_0x5e6a('0x26')]===0x1f4){logger[_0x5e6a('0x25')](_0x5e6a('0x21'),_0x3bd464,_0xa5aa55[_0x5e6a('0x25')][_0x5e6a('0x27')]);return _0x42692d(_0xa5aa55[_0x5e6a('0x25')][_0x5e6a('0x27')]);}logger['error'](_0x5e6a('0x21'),_0x3bd464,_0xa5aa55[_0x5e6a('0x25')]['message']);return _0x53d663(_0xa5aa55[_0x5e6a('0x25')][_0x5e6a('0x27')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3bd464,_0x5e6a('0x23'));_0x53d663(_0xa5aa55['result'][_0x5e6a('0x27')]);}})[_0x5e6a('0x28')](function(_0x5143e3){logger['error'](_0x5e6a('0x21'),_0x3bd464,_0x5143e3);_0x42692d(_0x5143e3);});});}function respondWithStatusCode(_0x1bb15b,_0x4bde32){_0x4bde32=_0x4bde32||0xcc;return function(_0x4ad0f1){if(_0x4ad0f1){return _0x1bb15b[_0x5e6a('0x29')](_0x4bde32);}return _0x1bb15b['status'](_0x4bde32)[_0x5e6a('0x2a')]();};}function respondWithResult(_0x4cdeb0,_0x1d0566){_0x1d0566=_0x1d0566||0xc8;return function(_0x2a1670){if(_0x2a1670){return _0x4cdeb0['status'](_0x1d0566)[_0x5e6a('0x2b')](_0x2a1670);}};}function respondWithFilteredResult(_0x56e258,_0x3cdb67){return function(_0xbf28e8){if(_0xbf28e8){var _0x2033d8=_0xbf28e8['count'],_0x130dda=_0x3cdb67[_0x5e6a('0x2c')],_0x3b4e34=_0x3cdb67[_0x5e6a('0x2c')]+_0x3cdb67[_0x5e6a('0x2d')],_0x9f776f;if(_0x3b4e34>=_0x2033d8){_0x3b4e34=_0x2033d8;_0x9f776f=0xc8;}else{_0x9f776f=0xce;}_0x56e258['status'](_0x9f776f);return _0x56e258['set'](_0x5e6a('0x2e'),_0x130dda+'-'+_0x3b4e34+'/'+_0x2033d8)[_0x5e6a('0x2b')](_0xbf28e8);}return null;};}function patchUpdates(_0x5bab9d){return function(_0x55e322){try{jsonpatch[_0x5e6a('0x2f')](_0x55e322,_0x5bab9d,!![]);}catch(_0x21cbdd){return BPromise['reject'](_0x21cbdd);}return _0x55e322[_0x5e6a('0x30')]();};}function saveUpdates(_0x1a76a4,_0x48ef44){return function(_0x24f567){if(_0x24f567){return _0x24f567[_0x5e6a('0x31')](_0x1a76a4)[_0x5e6a('0x20')](function(_0x60a0d0){return _0x60a0d0;});}return null;};}function removeEntity(_0x56d6b0,_0x2a6699){return function(_0x54ff95){if(_0x54ff95){return _0x54ff95['destroy']()[_0x5e6a('0x20')](function(){_0x56d6b0[_0x5e6a('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3da703,_0x5b2c3e){return function(_0x302d78){if(!_0x302d78){_0x3da703[_0x5e6a('0x29')](0x194);}return _0x302d78;};}function handleError(_0x51d782,_0x187824){_0x187824=_0x187824||0x1f4;return function(_0x14bf25){logger['error'](_0x14bf25[_0x5e6a('0x33')]);if(_0x14bf25['name']){delete _0x14bf25[_0x5e6a('0x34')];}_0x51d782[_0x5e6a('0x32')](_0x187824)[_0x5e6a('0x35')](_0x14bf25);};}exports[_0x5e6a('0x36')]=function(_0x2c8776,_0x289f0a){var _0x50afb3={},_0x229401={},_0x49ab3c={'count':0x0,'rows':[]};var _0xc2b0e3=_[_0x5e6a('0x37')](db[_0x5e6a('0x38')]['rawAttributes'],function(_0x440149){return{'name':_0x440149['fieldName'],'type':_0x440149[_0x5e6a('0x39')][_0x5e6a('0x3a')]};});_0x229401[_0x5e6a('0x3b')]=_[_0x5e6a('0x37')](_0xc2b0e3,_0x5e6a('0x34'));_0x229401[_0x5e6a('0x3c')]=_['keys'](_0x2c8776[_0x5e6a('0x3c')]);_0x229401[_0x5e6a('0x3d')]=_[_0x5e6a('0x3e')](_0x229401[_0x5e6a('0x3b')],_0x229401[_0x5e6a('0x3c')]);_0x50afb3['attributes']=_['intersection'](_0x229401[_0x5e6a('0x3b')],qs[_0x5e6a('0x3f')](_0x2c8776[_0x5e6a('0x3c')][_0x5e6a('0x3f')]));_0x50afb3[_0x5e6a('0x40')]=_0x50afb3[_0x5e6a('0x40')]['length']?_0x50afb3[_0x5e6a('0x40')]:_0x229401['model'];if(!_0x2c8776['query']['hasOwnProperty'](_0x5e6a('0x41'))){_0x50afb3[_0x5e6a('0x2d')]=qs[_0x5e6a('0x2d')](_0x2c8776[_0x5e6a('0x3c')][_0x5e6a('0x2d')]);_0x50afb3[_0x5e6a('0x2c')]=qs['offset'](_0x2c8776[_0x5e6a('0x3c')][_0x5e6a('0x2c')]);}_0x50afb3[_0x5e6a('0x42')]=qs[_0x5e6a('0x43')](_0x2c8776['query'][_0x5e6a('0x43')]);_0x50afb3[_0x5e6a('0x44')]=qs[_0x5e6a('0x3d')](_[_0x5e6a('0x45')](_0x2c8776['query'],_0x229401[_0x5e6a('0x3d')]),_0xc2b0e3);if(_0x2c8776[_0x5e6a('0x3c')][_0x5e6a('0x46')]){_0x50afb3[_0x5e6a('0x44')]=_[_0x5e6a('0x47')](_0x50afb3[_0x5e6a('0x44')],{'$or':_[_0x5e6a('0x37')](_0xc2b0e3,function(_0x1a418c){if(_0x1a418c[_0x5e6a('0x39')]!==_0x5e6a('0x48')){var _0x3f9fd0={};_0x3f9fd0[_0x1a418c[_0x5e6a('0x34')]]={'$like':'%'+_0x2c8776[_0x5e6a('0x3c')]['filter']+'%'};return _0x3f9fd0;}})});}_0x50afb3=_[_0x5e6a('0x47')]({},_0x50afb3,_0x2c8776[_0x5e6a('0x49')]);var _0x4e185a={'where':_0x50afb3['where']};return db[_0x5e6a('0x38')]['count'](_0x4e185a)[_0x5e6a('0x20')](function(_0x2b67d4){_0x49ab3c[_0x5e6a('0x4a')]=_0x2b67d4;if(_0x2c8776[_0x5e6a('0x3c')]['includeAll']){_0x50afb3['include']=[{'all':!![]}];}return db[_0x5e6a('0x38')][_0x5e6a('0x4b')](_0x50afb3);})[_0x5e6a('0x20')](function(_0x56a756){_0x49ab3c[_0x5e6a('0x4c')]=_0x56a756;return _0x49ab3c;})[_0x5e6a('0x20')](respondWithFilteredResult(_0x289f0a,_0x50afb3))[_0x5e6a('0x28')](handleError(_0x289f0a,null));};exports[_0x5e6a('0x4d')]=function(_0xeebf27,_0x3058af){var _0x2a0baa={'raw':!![],'where':{'id':_0xeebf27[_0x5e6a('0x4e')]['id']}},_0x5ee4bf={};_0x5ee4bf[_0x5e6a('0x3b')]=_[_0x5e6a('0x4f')](db[_0x5e6a('0x38')][_0x5e6a('0x50')]);_0x5ee4bf['query']=_[_0x5e6a('0x4f')](_0xeebf27['query']);_0x5ee4bf[_0x5e6a('0x3d')]=_[_0x5e6a('0x3e')](_0x5ee4bf['model'],_0x5ee4bf['query']);_0x2a0baa['attributes']=_[_0x5e6a('0x3e')](_0x5ee4bf[_0x5e6a('0x3b')],qs[_0x5e6a('0x3f')](_0xeebf27[_0x5e6a('0x3c')][_0x5e6a('0x3f')]));_0x2a0baa[_0x5e6a('0x40')]=_0x2a0baa[_0x5e6a('0x40')][_0x5e6a('0x51')]?_0x2a0baa[_0x5e6a('0x40')]:_0x5ee4bf['model'];if(_0xeebf27[_0x5e6a('0x3c')][_0x5e6a('0x52')]){_0x2a0baa[_0x5e6a('0x53')]=[{'all':!![]}];}_0x2a0baa=_[_0x5e6a('0x47')]({},_0x2a0baa,_0xeebf27['options']);return db['ChatMessage'][_0x5e6a('0x54')](_0x2a0baa)[_0x5e6a('0x20')](handleEntityNotFound(_0x3058af,null))[_0x5e6a('0x20')](respondWithResult(_0x3058af,null))[_0x5e6a('0x28')](handleError(_0x3058af,null));};exports[_0x5e6a('0x55')]=function(_0x39f38b,_0x1776ca){return db['ChatMessage']['create'](_0x39f38b['body'],{})['then'](respondWithResult(_0x1776ca,0xc9))['catch'](handleError(_0x1776ca,null));};exports[_0x5e6a('0x31')]=function(_0x428109,_0x11e315){if(_0x428109[_0x5e6a('0x56')]['id']){delete _0x428109[_0x5e6a('0x56')]['id'];}return db[_0x5e6a('0x38')][_0x5e6a('0x54')]({'where':{'id':_0x428109[_0x5e6a('0x4e')]['id']}})[_0x5e6a('0x20')](handleEntityNotFound(_0x11e315,null))[_0x5e6a('0x20')](saveUpdates(_0x428109[_0x5e6a('0x56')],null))[_0x5e6a('0x20')](respondWithResult(_0x11e315,null))['catch'](handleError(_0x11e315,null));};exports[_0x5e6a('0x57')]=function(_0x2c3ddf,_0x49ea29){return db[_0x5e6a('0x38')][_0x5e6a('0x54')]({'where':{'id':_0x2c3ddf[_0x5e6a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x49ea29,null))[_0x5e6a('0x20')](removeEntity(_0x49ea29,null))['catch'](handleError(_0x49ea29,null));};exports[_0x5e6a('0x58')]=function(_0x37c083,_0x116c03){return db[_0x5e6a('0x38')][_0x5e6a('0x58')]()[_0x5e6a('0x20')](respondWithResult(_0x116c03,null))[_0x5e6a('0x28')](handleError(_0x116c03,null));};var interaction_log=require(_0x5e6a('0x12'))(_0x5e6a('0x59'));exports[_0x5e6a('0x5a')]=function(_0x2291b7,_0x358cd5,_0xfebb48){var _0x55e7cd={'agent':{},'channel':'chat'};if(_0x2291b7[_0x5e6a('0x56')]['id']){delete _0x2291b7[_0x5e6a('0x56')]['id'];}_0x2291b7[_0x5e6a('0x56')][_0x5e6a('0x5b')]=!![];_0x2291b7[_0x5e6a('0x56')][_0x5e6a('0x5c')]=moment()[_0x5e6a('0x5d')](_0x5e6a('0x5e'));_0x2291b7[_0x5e6a('0x56')]['UserId']=_0x2291b7[_0x5e6a('0x56')]['UserId']||_0x2291b7[_0x5e6a('0x5f')]['id'];_0x55e7cd[_0x5e6a('0x60')]['id']=_0x2291b7[_0x5e6a('0x56')][_0x5e6a('0x61')];return db['ChatMessage'][_0x5e6a('0x54')]({'where':{'id':_0x2291b7[_0x5e6a('0x4e')]['id'],'UserId':null},'include':[{'model':db[_0x5e6a('0x62')],'as':_0x5e6a('0x63')}]})[_0x5e6a('0x20')](handleEntityNotFound(_0x358cd5,null))[_0x5e6a('0x20')](saveUpdates(_0x2291b7[_0x5e6a('0x56')],null))[_0x5e6a('0x20')](function(_0x38cb5b){if(_0x38cb5b){_0x55e7cd[_0x5e6a('0x27')]=_0x38cb5b[_0x5e6a('0x64')]({'plain':!![]});return db[_0x5e6a('0x65')][_0x5e6a('0x54')]({'where':{'id':_0x38cb5b[_0x5e6a('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x358cd5,null))['then'](function(_0x2da758){if(_0x2da758){return _0x2da758[_0x5e6a('0x31')]({'UserId':_0x2291b7[_0x5e6a('0x56')]['UserId'],'read1stAt':_[_0x5e6a('0x67')](_0x2da758['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5e6a('0x20')](function(_0x5093c1){if(_0x5093c1){_0x55e7cd['interaction']=_0x5093c1['get']({'plain':!![]});interaction_log[_0x5e6a('0x68')](_0x5e6a('0x69'),_0x2291b7[_0x5e6a('0x5f')]['id'],_0x2291b7[_0x5e6a('0x5f')][_0x5e6a('0x34')],_0x2291b7['user'][_0x5e6a('0x6a')],_0x55e7cd[_0x5e6a('0x6b')]['id'],_0x2291b7['body']?JSON[_0x5e6a('0x24')](_0x2291b7[_0x5e6a('0x56')]):_0x5e6a('0x6c'));return respondWithRpcPromise(_0x5e6a('0x6d'),_0x5e6a('0x6e'),_0x55e7cd);}return null;})['then'](function(_0x19e69b){if(_0x19e69b){if(_0x2291b7[_0x5e6a('0x56')][_0x5e6a('0x6f')]){_0x55e7cd[_0x5e6a('0x27')][_0x5e6a('0x70')]=util['format']('SIP/%s',_0x2291b7[_0x5e6a('0x5f')][_0x5e6a('0x34')]);_0x55e7cd[_0x5e6a('0x27')]['channel']=_0x55e7cd[_0x5e6a('0x71')];_0x55e7cd[_0x5e6a('0x27')][_0x5e6a('0x72')]='accept';return respondWithRpcPromise(_0x5e6a('0x73'),_0x5e6a('0x73'),{'event':_0x5e6a('0x74'),'message':_['merge'](_0x55e7cd['message'],JSON[_0x5e6a('0x75')](_0x55e7cd[_0x5e6a('0x6b')][_0x5e6a('0x76')]))},client9002)[_0x5e6a('0x20')](function(){return _0x55e7cd;});}return _0x55e7cd;}return null;})[_0x5e6a('0x20')](respondWithResult(_0x358cd5,null))[_0x5e6a('0x28')](handleError(_0x358cd5,null));};var interaction_log=require(_0x5e6a('0x12'))(_0x5e6a('0x59'));exports['reject']=function(_0x687aed,_0x1a8415,_0x5d58b6){var _0x3b1a8f={'agent':{},'channel':_0x5e6a('0x77')};if(_0x687aed[_0x5e6a('0x56')]['id']){delete _0x687aed['body']['id'];}_0x687aed[_0x5e6a('0x56')]['UserId']=_0x687aed[_0x5e6a('0x56')]['UserId']||_0x687aed[_0x5e6a('0x5f')]['id'];_0x3b1a8f[_0x5e6a('0x60')]['id']=_0x687aed[_0x5e6a('0x56')]['UserId'];return db[_0x5e6a('0x38')][_0x5e6a('0x54')]({'where':{'id':_0x687aed['params']['id'],'UserId':null}})[_0x5e6a('0x20')](handleEntityNotFound(_0x1a8415,null))[_0x5e6a('0x20')](function(_0x44fb0e){if(_0x44fb0e){_0x3b1a8f['message']=_0x44fb0e[_0x5e6a('0x64')]({'plain':!![]});return db[_0x5e6a('0x65')]['find']({'where':{'id':_0x44fb0e[_0x5e6a('0x66')]}});}return null;})[_0x5e6a('0x20')](handleEntityNotFound(_0x1a8415,null))[_0x5e6a('0x20')](function(_0x66a121){if(_0x66a121){_0x3b1a8f[_0x5e6a('0x6b')]=_0x66a121[_0x5e6a('0x64')]({'plain':!![]});interaction_log[_0x5e6a('0x68')](_0x5e6a('0x78'),_0x687aed[_0x5e6a('0x5f')]['id'],_0x687aed['user']['name'],_0x687aed[_0x5e6a('0x5f')][_0x5e6a('0x6a')],_0x3b1a8f['interaction']['id'],_0x687aed[_0x5e6a('0x56')]?JSON['stringify'](_0x687aed[_0x5e6a('0x56')]):_0x5e6a('0x6c'));return respondWithRpcPromise(_0x5e6a('0x79'),_0x5e6a('0x7a'),_0x3b1a8f);}return null;})[_0x5e6a('0x20')](function(_0x1c2a83){if(_0x1c2a83){_0x1c2a83[_0x5e6a('0x27')][_0x5e6a('0x70')]=util[_0x5e6a('0x5d')](_0x5e6a('0x7b'),_0x687aed[_0x5e6a('0x5f')][_0x5e6a('0x34')]);_0x1c2a83[_0x5e6a('0x27')][_0x5e6a('0x71')]=_0x3b1a8f[_0x5e6a('0x71')];_0x1c2a83[_0x5e6a('0x27')][_0x5e6a('0x72')]=_0x5e6a('0x7c');respondWithRpcPromise(_0x5e6a('0x73'),_0x5e6a('0x73'),{'event':_0x5e6a('0x7d'),'message':_0x1c2a83['message']},client9002);return _0x3b1a8f;}return null;})[_0x5e6a('0x20')](respondWithResult(_0x1a8415,null))[_0x5e6a('0x28')](handleError(_0x1a8415,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index b95dcaf..b3b86f0 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 _0xb50d=['update','remove','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x583256,_0x53c066){var _0x30bfbb=function(_0x129ccc){while(--_0x129ccc){_0x583256['push'](_0x583256['shift']());}};_0x30bfbb(++_0x53c066);}(_0xb50d,0x176));var _0xdb50=function(_0x3f20e8,_0x1876d7){_0x3f20e8=_0x3f20e8-0x0;var _0x46ab15=_0xb50d[_0x3f20e8];return _0x46ab15;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xdb50('0x0'))['db'][_0xdb50('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xdb50('0x2')](0x0);var events={'afterCreate':_0xdb50('0x3'),'afterUpdate':_0xdb50('0x4'),'afterDestroy':_0xdb50('0x5')};function emitEvent(_0x13e63b){return function(_0x4faf78,_0x240c39,_0x4a47f1){ChatMessageEvents['emit'](_0x13e63b+':'+_0x4faf78['id'],_0x4faf78);ChatMessageEvents['emit'](_0x13e63b,_0x4faf78);_0x4a47f1(null);};}for(var e in events){if(events[_0xdb50('0x6')](e)){var event=events[e];ChatMessage[_0xdb50('0x7')](e,emitEvent(event));}}module[_0xdb50('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x944d=['setMaxListeners','update','emit','hasOwnProperty','hook','events','ChatMessage'];(function(_0x8e6c92,_0x58f473){var _0x3668d8=function(_0x38869b){while(--_0x38869b){_0x8e6c92['push'](_0x8e6c92['shift']());}};_0x3668d8(++_0x58f473);}(_0x944d,0x98));var _0xd944=function(_0x26ff7e,_0x13c4f7){_0x26ff7e=_0x26ff7e-0x0;var _0x36398a=_0x944d[_0x26ff7e];return _0x36398a;};'use strict';var EventEmitter=require(_0xd944('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xd944('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd944('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd944('0x3'),'afterDestroy':'remove'};function emitEvent(_0x389505){return function(_0x344b58,_0x15d33f,_0x4cc20a){ChatMessageEvents[_0xd944('0x4')](_0x389505+':'+_0x344b58['id'],_0x344b58);ChatMessageEvents[_0xd944('0x4')](_0x389505,_0x344b58);_0x4cc20a(null);};}for(var e in events){if(events[_0xd944('0x5')](e)){var event=events[e];ChatMessage[_0xd944('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 88c3791..c075057 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 _0x737d=['update','createdAt','catch','error','lodash','util','request-promise','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','findOne','ChatInteractionId'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x737d,0xbc));var _0xd737=function(_0x57b378,_0x51613b){_0x57b378=_0x57b378-0x0;var _0x21c80a=_0x737d[_0x57b378];return _0x21c80a;};'use strict';var _=require(_0xd737('0x0'));var util=require(_0xd737('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd737('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd737('0x3'));var config=require('../../config/environment');var attributes=require(_0xd737('0x4'));module[_0xd737('0x5')]=function(_0x1cf86e,_0x2e7d75){return _0x1cf86e[_0xd737('0x6')](_0xd737('0x7'),attributes,{'tableName':_0xd737('0x8'),'paranoid':![],'indexes':[{'name':_0xd737('0x9'),'fields':[_0xd737('0xa')],'type':_0xd737('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5055a2,_0x2aa91f,_0xb243eb){var _0x51a15d=_0x1cf86e[_0xd737('0xc')];var _0x42afa9=_0x5055a2['get']({'plain':!![]});if(_0x42afa9[_0xd737('0xd')][_0xd737('0xe')]()==='in'||_0x42afa9['direction'][_0xd737('0xe')]()==='out'&&!_0x42afa9[_0xd737('0xf')]&&!_[_0xd737('0x10')](_0x42afa9['UserId'])){_0x51a15d['ChatInteraction'][_0xd737('0x11')]({'where':{'id':_0x42afa9[_0xd737('0x12')]}})['then'](function(_0x11c3ed){if(_0x11c3ed){_0x11c3ed[_0xd737('0x13')]({'lastMsgAt':_0x42afa9[_0xd737('0x14')],'lastMsgDirection':_0x42afa9[_0xd737('0xd')][_0xd737('0xe')]()});}})[_0xd737('0x15')](function(_0x3dc72f){console[_0xd737('0x16')](_0x3dc72f);});}_0xb243eb();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9589=['./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','error','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3079d8,_0x5ceadd){var _0x3c04fb=function(_0xf1a3df){while(--_0xf1a3df){_0x3079d8['push'](_0x3079d8['shift']());}};_0x3c04fb(++_0x5ceadd);}(_0x9589,0xbc));var _0x9958=function(_0x583859,_0x36f993){_0x583859=_0x583859-0x0;var _0x50f377=_0x9589[_0x583859];return _0x50f377;};'use strict';var _=require(_0x9958('0x0'));var util=require(_0x9958('0x1'));var logger=require(_0x9958('0x2'))(_0x9958('0x3'));var moment=require(_0x9958('0x4'));var BPromise=require('bluebird');var rp=require(_0x9958('0x5'));var fs=require('fs');var path=require(_0x9958('0x6'));var rimraf=require(_0x9958('0x7'));var config=require('../../config/environment');var attributes=require(_0x9958('0x8'));module[_0x9958('0x9')]=function(_0xef3597,_0x52386d){return _0xef3597[_0x9958('0xa')](_0x9958('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x9958('0xc'),'fields':[_0x9958('0xd')],'type':_0x9958('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xdeddab,_0x21f35c,_0x185b6b){var _0x1e2647=_0xef3597[_0x9958('0xf')];var _0x3369b3=_0xdeddab[_0x9958('0x10')]({'plain':!![]});if(_0x3369b3[_0x9958('0x11')][_0x9958('0x12')]()==='in'||_0x3369b3[_0x9958('0x11')][_0x9958('0x12')]()===_0x9958('0x13')&&!_0x3369b3[_0x9958('0x14')]&&!_[_0x9958('0x15')](_0x3369b3[_0x9958('0x16')])){_0x1e2647['ChatInteraction'][_0x9958('0x17')]({'where':{'id':_0x3369b3['ChatInteractionId']}})[_0x9958('0x18')](function(_0x5c903e){if(_0x5c903e){_0x5c903e[_0x9958('0x19')]({'lastMsgAt':_0x3369b3[_0x9958('0x1a')],'lastMsgDirection':_0x3369b3[_0x9958('0x11')][_0x9958('0x12')]()});}})['catch'](function(_0xe3e42d){console[_0x9958('0x1b')](_0xe3e42d);});}_0x185b6b();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 84df7d1..cdfeb9f 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 _0xf5ea=['register','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateChatMessage','create','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x13ac6f,_0x4b97e4){var _0x122bcc=function(_0x11d91f){while(--_0x11d91f){_0x13ac6f['push'](_0x13ac6f['shift']());}};_0x122bcc(++_0x4b97e4);}(_0xf5ea,0x189));var _0xaf5e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf5ea[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xaf5e('0x0'));var util=require(_0xaf5e('0x1'));var moment=require(_0xaf5e('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf5e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf5e('0x4'))['db'];var utils=require(_0xaf5e('0x5'));var logger=require('../../config/logger')(_0xaf5e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xaf5e('0x7')]({'port':0x232a});config[_0xaf5e('0x8')]=_[_0xaf5e('0x9')](config['redis'],{'host':_0xaf5e('0xa'),'port':0x18eb});var socket=require(_0xaf5e('0xb'))(new Redis(config['redis']));require(_0xaf5e('0xc'))[_0xaf5e('0xd')](socket);function respondWithRpcPromise(_0x2e6284,_0x50338a,_0x59c70e){return new BPromise(function(_0x2d265a,_0x592d2c){return client[_0xaf5e('0xe')](_0x2e6284,_0x59c70e)['then'](function(_0x3c8ace){logger[_0xaf5e('0xf')](_0xaf5e('0x10'),_0x50338a,'request\x20sent');logger[_0xaf5e('0x11')](_0xaf5e('0x12'),_0x50338a,_0xaf5e('0x13'),JSON[_0xaf5e('0x14')](_0x3c8ace));if(_0x3c8ace[_0xaf5e('0x15')]){if(_0x3c8ace[_0xaf5e('0x15')][_0xaf5e('0x16')]===0x1f4){logger[_0xaf5e('0x15')](_0xaf5e('0x10'),_0x50338a,_0x3c8ace['error'][_0xaf5e('0x17')]);return _0x592d2c(_0x3c8ace[_0xaf5e('0x15')][_0xaf5e('0x17')]);}logger[_0xaf5e('0x15')](_0xaf5e('0x10'),_0x50338a,_0x3c8ace[_0xaf5e('0x15')][_0xaf5e('0x17')]);return _0x2d265a(_0x3c8ace['error'][_0xaf5e('0x17')]);}else{logger[_0xaf5e('0xf')](_0xaf5e('0x10'),_0x50338a,_0xaf5e('0x13'));_0x2d265a(_0x3c8ace['result'][_0xaf5e('0x17')]);}})[_0xaf5e('0x18')](function(_0x3b1660){logger[_0xaf5e('0x15')]('ChatMessage,\x20%s,\x20%s',_0x50338a,_0x3b1660);_0x592d2c(_0x3b1660);});});}exports[_0xaf5e('0x19')]=function(_0x23b229){var _0x3a1465=this;return new Promise(function(_0x380f35,_0x5a8bb2){return db['ChatMessage'][_0xaf5e('0x1a')](_0x23b229['body'],{'raw':_0x23b229[_0xaf5e('0x1b')]?_0x23b229[_0xaf5e('0x1b')][_0xaf5e('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4aaf48){logger[_0xaf5e('0xf')](_0xaf5e('0x19'),_0x23b229);logger[_0xaf5e('0x11')]('CreateChatMessage',_0x23b229,JSON[_0xaf5e('0x14')](_0x4aaf48));_0x380f35(_0x4aaf48);})['catch'](function(_0x532ac8){logger[_0xaf5e('0x15')]('CreateChatMessage',_0x532ac8[_0xaf5e('0x17')],_0x23b229);_0x5a8bb2(_0x3a1465[_0xaf5e('0x15')](0x1f4,_0x532ac8[_0xaf5e('0x17')]));});});}; \ No newline at end of file +var _0x4829=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatMessage.socket','then'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x4829,0x107));var _0x9482=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x4829[_0x836465];return _0x2150ea;};'use strict';var _=require(_0x9482('0x0'));var util=require(_0x9482('0x1'));var moment=require(_0x9482('0x2'));var BPromise=require(_0x9482('0x3'));var rs=require(_0x9482('0x4'));var fs=require('fs');var Redis=require(_0x9482('0x5'));var db=require(_0x9482('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9482('0x7'))('rpc');var config=require(_0x9482('0x8'));var jayson=require(_0x9482('0x9'));var client=jayson[_0x9482('0xa')]['http']({'port':0x232a});config[_0x9482('0xb')]=_[_0x9482('0xc')](config[_0x9482('0xb')],{'host':_0x9482('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9482('0xb')]));require(_0x9482('0xe'))['register'](socket);function respondWithRpcPromise(_0xb3aef7,_0x1250d7,_0x37cdc7){return new BPromise(function(_0x323677,_0x247e32){return client['request'](_0xb3aef7,_0x37cdc7)[_0x9482('0xf')](function(_0x4b72b3){logger[_0x9482('0x10')](_0x9482('0x11'),_0x1250d7,_0x9482('0x12'));logger[_0x9482('0x13')](_0x9482('0x14'),_0x1250d7,'request\x20sent',JSON[_0x9482('0x15')](_0x4b72b3));if(_0x4b72b3[_0x9482('0x16')]){if(_0x4b72b3['error']['code']===0x1f4){logger[_0x9482('0x16')]('ChatMessage,\x20%s,\x20%s',_0x1250d7,_0x4b72b3[_0x9482('0x16')][_0x9482('0x17')]);return _0x247e32(_0x4b72b3['error'][_0x9482('0x17')]);}logger[_0x9482('0x16')](_0x9482('0x11'),_0x1250d7,_0x4b72b3[_0x9482('0x16')][_0x9482('0x17')]);return _0x323677(_0x4b72b3[_0x9482('0x16')][_0x9482('0x17')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x1250d7,'request\x20sent');_0x323677(_0x4b72b3[_0x9482('0x18')][_0x9482('0x17')]);}})[_0x9482('0x19')](function(_0x366149){logger[_0x9482('0x16')](_0x9482('0x11'),_0x1250d7,_0x366149);_0x247e32(_0x366149);});});}exports[_0x9482('0x1a')]=function(_0xc9eb5f){var _0x3b7fe1=this;return new Promise(function(_0x515036,_0x10b751){return db[_0x9482('0x1b')][_0x9482('0x1c')](_0xc9eb5f[_0x9482('0x1d')],{'raw':_0xc9eb5f[_0x9482('0x1e')]?_0xc9eb5f[_0x9482('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x58b982){logger[_0x9482('0x10')](_0x9482('0x1a'),_0xc9eb5f);logger['debug'](_0x9482('0x1a'),_0xc9eb5f,JSON['stringify'](_0x58b982));_0x515036(_0x58b982);})[_0x9482('0x19')](function(_0x3df5d8){logger[_0x9482('0x16')](_0x9482('0x1a'),_0x3df5d8[_0x9482('0x17')],_0xc9eb5f);_0x10b751(_0x3b7fe1[_0x9482('0x16')](0x1f4,_0x3df5d8[_0x9482('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 778c6d8..77252ca 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 _0x2542=['chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x192070,_0xf76853){var _0x589a61=function(_0x374494){while(--_0x374494){_0x192070['push'](_0x192070['shift']());}};_0x589a61(++_0xf76853);}(_0x2542,0x169));var _0x2254=function(_0x3ad666,_0x1efc9d){_0x3ad666=_0x3ad666-0x0;var _0x3ede48=_0x2542[_0x3ad666];return _0x3ede48;};'use strict';var ChatMessageEvents=require(_0x2254('0x0'));var events=[_0x2254('0x1'),_0x2254('0x2'),_0x2254('0x3')];function createListener(_0x578407,_0x105910){return function(_0x47b1da){_0x105910[_0x2254('0x4')](_0x578407,_0x47b1da);};}function removeListener(_0x3b3dcb,_0x27f5c9){return function(){ChatMessageEvents[_0x2254('0x5')](_0x3b3dcb,_0x27f5c9);};}exports[_0x2254('0x6')]=function(_0x508183){for(var _0x19ad3c=0x0,_0xe8ca50=events[_0x2254('0x7')];_0x19ad3c<_0xe8ca50;_0x19ad3c++){var _0x3c45ec=events[_0x19ad3c];var _0x1637ad=createListener(_0x2254('0x8')+_0x3c45ec,_0x508183);ChatMessageEvents['on'](_0x3c45ec,_0x1637ad);}}; \ No newline at end of file +var _0xc4aa=['remove','update','removeListener','register','length','./chatMessage.events','save'];(function(_0x46468d,_0x287e87){var _0x374c66=function(_0x3cb23a){while(--_0x3cb23a){_0x46468d['push'](_0x46468d['shift']());}};_0x374c66(++_0x287e87);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var ChatMessageEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){ChatMessageEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('chatMessage:'+_0x10525b,_0x215f39);ChatMessageEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index f9f09b2..c972df4 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 _0x7334=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x7334,0x184));var _0x4733=function(_0x3c45e9,_0xbea407){_0x3c45e9=_0x3c45e9-0x0;var _0x54e2ce=_0x7334[_0x3c45e9];return _0x54e2ce;};'use strict';var multer=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4733('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4733('0x4'));var interaction=require(_0x4733('0x5'));var config=require(_0x4733('0x6'));var controller=require(_0x4733('0x7'));router[_0x4733('0x8')]('/',auth[_0x4733('0x9')](),controller[_0x4733('0xa')]);router[_0x4733('0x8')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0xc')]);router[_0x4733('0x8')](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0xe')]);router[_0x4733('0xf')]('/',auth[_0x4733('0x9')](),interaction['tracked'](_0x4733('0x10'),_0x4733('0x11')),controller['create']);router[_0x4733('0x12')]('/:id',controller[_0x4733('0x13')]);router[_0x4733('0x12')](_0x4733('0x14'),auth[_0x4733('0x9')](),controller[_0x4733('0x15')]);router[_0x4733('0x12')](_0x4733('0x16'),auth['isAuthenticated'](),controller[_0x4733('0x17')]);router['delete'](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0x18')]);module[_0x4733('0x19')]=router; \ No newline at end of file +var _0xd64b=['tracked','chatmessage:create','create','put','accept','/:id/reject','reject','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','post'];(function(_0x1dcd91,_0x4a5fa3){var _0xb71e10=function(_0x46d437){while(--_0x46d437){_0x1dcd91['push'](_0x1dcd91['shift']());}};_0xb71e10(++_0x4a5fa3);}(_0xd64b,0xc1));var _0xbd64=function(_0x14f5a3,_0x268d64){_0x14f5a3=_0x14f5a3-0x0;var _0xc84d0e=_0xd64b[_0x14f5a3];return _0xc84d0e;};'use strict';var multer=require(_0xbd64('0x0'));var util=require('util');var path=require(_0xbd64('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd64('0x2'));var router=express[_0xbd64('0x3')]();var fs_extra=require(_0xbd64('0x4'));var auth=require(_0xbd64('0x5'));var interaction=require(_0xbd64('0x6'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbd64('0x7')]);router[_0xbd64('0x8')](_0xbd64('0x9'),auth[_0xbd64('0xa')](),controller[_0xbd64('0xb')]);router[_0xbd64('0x8')](_0xbd64('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbd64('0xd')]('/',auth[_0xbd64('0xa')](),interaction[_0xbd64('0xe')]('chat',_0xbd64('0xf')),controller[_0xbd64('0x10')]);router[_0xbd64('0x11')](_0xbd64('0xc'),controller['update']);router[_0xbd64('0x11')]('/:id/accept',auth[_0xbd64('0xa')](),controller[_0xbd64('0x12')]);router[_0xbd64('0x11')](_0xbd64('0x13'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x14')]);router[_0xbd64('0x15')](_0xbd64('0xc'),auth[_0xbd64('0xa')](),controller['destroy']);module[_0xbd64('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index b014fa8..b2a0571 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 _0xdc66=['sequelize','exports'];(function(_0x50797e,_0x4aa7be){var _0x5b52fd=function(_0x2dee2e){while(--_0x2dee2e){_0x50797e['push'](_0x50797e['shift']());}};_0x5b52fd(++_0x4aa7be);}(_0xdc66,0x180));var _0x6dc6=function(_0x56278e,_0x5083c5){_0x56278e=_0x56278e-0x0;var _0x46d37e=_0xdc66[_0x56278e];return _0x46d37e;};'use strict';var Sequelize=require(_0x6dc6('0x0'));module[_0x6dc6('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file +var _0xe06e=['TEXT','medium','exports'];(function(_0x5239b8,_0x4f0c10){var _0x2c2eb4=function(_0xd3c310){while(--_0xd3c310){_0x5239b8['push'](_0x5239b8['shift']());}};_0x2c2eb4(++_0x4f0c10);}(_0xe06e,0x71));var _0xee06=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0xe06e[_0x1f71d8];return _0x10b045;};'use strict';var Sequelize=require('sequelize');module[_0xee06('0x0')]={'body':{'type':Sequelize[_0xee06('0x1')](_0xee06('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 5dc4911..cb533cd 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 _0x5399=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','set','Content-Range','apply','reject','then','destroy','name','send','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','ChatOfflineMessage','findAll','rows','catch','params','find','create','body','update','forEach','join','root','server','files','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path'];(function(_0x53791a,_0x598bcd){var _0xabf652=function(_0x463ffa){while(--_0x463ffa){_0x53791a['push'](_0x53791a['shift']());}};_0xabf652(++_0x598bcd);}(_0x5399,0x188));var _0x9539=function(_0x230949,_0x790da6){_0x230949=_0x230949-0x0;var _0x54a3dd=_0x5399[_0x230949];return _0x54a3dd;};'use strict';var emlformat=require(_0x9539('0x0'));var rimraf=require(_0x9539('0x1'));var zipdir=require(_0x9539('0x2'));var jsonpatch=require(_0x9539('0x3'));var rp=require('request-promise');var moment=require(_0x9539('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9539('0x5'));var util=require(_0x9539('0x6'));var path=require(_0x9539('0x7'));var sox=require('sox');var csv=require(_0x9539('0x8'));var ejs=require(_0x9539('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9539('0xa'));var squel=require(_0x9539('0xb'));var crypto=require(_0x9539('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9539('0xd'));var toCsv=require(_0x9539('0x8'));var querystring=require(_0x9539('0xe'));var Papa=require(_0x9539('0xf'));var Redis=require(_0x9539('0x10'));var authService=require(_0x9539('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9539('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9539('0x13'))(_0x9539('0x14'));var utils=require(_0x9539('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9539('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57bc52,_0x34ad49){_0x34ad49=_0x34ad49||0xcc;return function(_0x50b3fe){if(_0x50b3fe){return _0x57bc52[_0x9539('0x17')](_0x34ad49);}return _0x57bc52[_0x9539('0x18')](_0x34ad49)[_0x9539('0x19')]();};}function respondWithResult(_0x4e7920,_0xd2ef96){_0xd2ef96=_0xd2ef96||0xc8;return function(_0xdf9235){if(_0xdf9235){return _0x4e7920[_0x9539('0x18')](_0xd2ef96)[_0x9539('0x1a')](_0xdf9235);}};}function respondWithFilteredResult(_0x101f7b,_0x2c8d82){return function(_0x291a08){if(_0x291a08){var _0x1adff7=_0x291a08['count'],_0x2db314=_0x2c8d82['offset'],_0x322240=_0x2c8d82['offset']+_0x2c8d82[_0x9539('0x1b')],_0x33d364;if(_0x322240>=_0x1adff7){_0x322240=_0x1adff7;_0x33d364=0xc8;}else{_0x33d364=0xce;}_0x101f7b[_0x9539('0x18')](_0x33d364);return _0x101f7b[_0x9539('0x1c')](_0x9539('0x1d'),_0x2db314+'-'+_0x322240+'/'+_0x1adff7)[_0x9539('0x1a')](_0x291a08);}return null;};}function patchUpdates(_0xbbbde1){return function(_0x512ce0){try{jsonpatch[_0x9539('0x1e')](_0x512ce0,_0xbbbde1,!![]);}catch(_0x58dddf){return BPromise[_0x9539('0x1f')](_0x58dddf);}return _0x512ce0['save']();};}function saveUpdates(_0x23db75,_0x28769c){return function(_0x403ec4){if(_0x403ec4){return _0x403ec4['update'](_0x23db75)[_0x9539('0x20')](function(_0x4e1900){return _0x4e1900;});}return null;};}function removeEntity(_0x59657a,_0x29c478){return function(_0x5aa001){if(_0x5aa001){return _0x5aa001[_0x9539('0x21')]()[_0x9539('0x20')](function(){_0x59657a[_0x9539('0x18')](0xcc)[_0x9539('0x19')]();});}};}function handleEntityNotFound(_0x1ca897,_0x214d1c){return function(_0x3ea42b){if(!_0x3ea42b){_0x1ca897[_0x9539('0x17')](0x194);}return _0x3ea42b;};}function handleError(_0x1ca7db,_0x366cd4){_0x366cd4=_0x366cd4||0x1f4;return function(_0x1537e4){logger['error'](_0x1537e4['stack']);if(_0x1537e4[_0x9539('0x22')]){delete _0x1537e4[_0x9539('0x22')];}_0x1ca7db[_0x9539('0x18')](_0x366cd4)[_0x9539('0x23')](_0x1537e4);};}exports[_0x9539('0x24')]=function(_0x200cc0,_0x71b273){var _0x56a1f1={},_0x1bbcb3={},_0xa4d77a={'count':0x0,'rows':[]};var _0x260caf=_[_0x9539('0x25')](db['ChatOfflineMessage']['rawAttributes'],function(_0x151c8d){return{'name':_0x151c8d[_0x9539('0x26')],'type':_0x151c8d[_0x9539('0x27')][_0x9539('0x28')]};});_0x1bbcb3[_0x9539('0x29')]=_['map'](_0x260caf,'name');_0x1bbcb3[_0x9539('0x2a')]=_[_0x9539('0x2b')](_0x200cc0[_0x9539('0x2a')]);_0x1bbcb3['filters']=_['intersection'](_0x1bbcb3['model'],_0x1bbcb3[_0x9539('0x2a')]);_0x56a1f1[_0x9539('0x2c')]=_[_0x9539('0x2d')](_0x1bbcb3[_0x9539('0x29')],qs['fields'](_0x200cc0[_0x9539('0x2a')][_0x9539('0x2e')]));_0x56a1f1['attributes']=_0x56a1f1[_0x9539('0x2c')][_0x9539('0x2f')]?_0x56a1f1[_0x9539('0x2c')]:_0x1bbcb3[_0x9539('0x29')];if(!_0x200cc0[_0x9539('0x2a')][_0x9539('0x30')](_0x9539('0x31'))){_0x56a1f1[_0x9539('0x1b')]=qs[_0x9539('0x1b')](_0x200cc0[_0x9539('0x2a')]['limit']);_0x56a1f1[_0x9539('0x32')]=qs[_0x9539('0x32')](_0x200cc0['query']['offset']);}_0x56a1f1[_0x9539('0x33')]=qs['sort'](_0x200cc0[_0x9539('0x2a')]['sort']);_0x56a1f1[_0x9539('0x34')]=qs[_0x9539('0x35')](_[_0x9539('0x36')](_0x200cc0['query'],_0x1bbcb3[_0x9539('0x35')]),_0x260caf);if(_0x200cc0['query'][_0x9539('0x37')]){_0x56a1f1[_0x9539('0x34')]=_[_0x9539('0x38')](_0x56a1f1['where'],{'$or':_[_0x9539('0x25')](_0x260caf,function(_0x39791e){if(_0x39791e[_0x9539('0x27')]!==_0x9539('0x39')){var _0x2181d5={};_0x2181d5[_0x39791e['name']]={'$like':'%'+_0x200cc0[_0x9539('0x2a')][_0x9539('0x37')]+'%'};return _0x2181d5;}})});}_0x56a1f1=_[_0x9539('0x38')]({},_0x56a1f1,_0x200cc0[_0x9539('0x3a')]);var _0x541187={'where':_0x56a1f1[_0x9539('0x34')]};return db['ChatOfflineMessage'][_0x9539('0x3b')](_0x541187)[_0x9539('0x20')](function(_0xc8ea26){_0xa4d77a[_0x9539('0x3b')]=_0xc8ea26;if(_0x200cc0[_0x9539('0x2a')][_0x9539('0x3c')]){_0x56a1f1[_0x9539('0x3d')]=[{'all':!![]}];}return db[_0x9539('0x3e')][_0x9539('0x3f')](_0x56a1f1);})[_0x9539('0x20')](function(_0xd70b10){_0xa4d77a[_0x9539('0x40')]=_0xd70b10;return _0xa4d77a;})[_0x9539('0x20')](respondWithFilteredResult(_0x71b273,_0x56a1f1))[_0x9539('0x41')](handleError(_0x71b273,null));};exports['show']=function(_0x15d6e5,_0xf43240){var _0xd07224={'raw':!![],'where':{'id':_0x15d6e5[_0x9539('0x42')]['id']}},_0x4e4900={};_0x4e4900[_0x9539('0x29')]=_[_0x9539('0x2b')](db['ChatOfflineMessage']['rawAttributes']);_0x4e4900[_0x9539('0x2a')]=_['keys'](_0x15d6e5['query']);_0x4e4900[_0x9539('0x35')]=_[_0x9539('0x2d')](_0x4e4900[_0x9539('0x29')],_0x4e4900[_0x9539('0x2a')]);_0xd07224[_0x9539('0x2c')]=_[_0x9539('0x2d')](_0x4e4900[_0x9539('0x29')],qs['fields'](_0x15d6e5[_0x9539('0x2a')][_0x9539('0x2e')]));_0xd07224[_0x9539('0x2c')]=_0xd07224[_0x9539('0x2c')][_0x9539('0x2f')]?_0xd07224['attributes']:_0x4e4900[_0x9539('0x29')];if(_0x15d6e5[_0x9539('0x2a')][_0x9539('0x3c')]){_0xd07224[_0x9539('0x3d')]=[{'all':!![]}];}_0xd07224=_[_0x9539('0x38')]({},_0xd07224,_0x15d6e5['options']);return db['ChatOfflineMessage'][_0x9539('0x43')](_0xd07224)[_0x9539('0x20')](handleEntityNotFound(_0xf43240,null))[_0x9539('0x20')](respondWithResult(_0xf43240,null))[_0x9539('0x41')](handleError(_0xf43240,null));};exports[_0x9539('0x44')]=function(_0x3057cf,_0x516671){return db[_0x9539('0x3e')]['create'](_0x3057cf[_0x9539('0x45')],{})[_0x9539('0x20')](respondWithResult(_0x516671,0xc9))[_0x9539('0x41')](handleError(_0x516671,null));};exports[_0x9539('0x46')]=function(_0x3f393a,_0xfab753){if(_0x3f393a[_0x9539('0x45')]['id']){delete _0x3f393a[_0x9539('0x45')]['id'];}return db[_0x9539('0x3e')]['find']({'where':{'id':_0x3f393a[_0x9539('0x42')]['id']}})[_0x9539('0x20')](handleEntityNotFound(_0xfab753,null))[_0x9539('0x20')](saveUpdates(_0x3f393a[_0x9539('0x45')],null))[_0x9539('0x20')](respondWithResult(_0xfab753,null))[_0x9539('0x41')](handleError(_0xfab753,null));};exports[_0x9539('0x21')]=function(_0x184eb7,_0x3d3fb){return db['Attachment'][_0x9539('0x3f')]({'where':{'ChatOfflineMessageId':_0x184eb7[_0x9539('0x42')]['id']},'raw':!![]})[_0x9539('0x20')](function(_0x529040){_0x529040[_0x9539('0x47')](function(_0xd9e5ef){var _0x3b19e6=path[_0x9539('0x48')](config[_0x9539('0x49')],_0x9539('0x4a'),_0x9539('0x4b'),'attachments',_0x9539('0x4c'),_0xd9e5ef[_0x9539('0x4d')]);var _0x50cfb8=fs['existsSync'](_0x3b19e6);if(_0x50cfb8)fs_extra[_0x9539('0x4e')](_0x3b19e6);});})['then'](function(){return db[_0x9539('0x3e')][_0x9539('0x43')]({'where':{'id':_0x184eb7[_0x9539('0x42')]['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x3d3fb,null))[_0x9539('0x20')](removeEntity(_0x3d3fb,null))['catch'](handleError(_0x3d3fb,null));};exports[_0x9539('0x4f')]=function(_0x6d556a,_0x4578f7){return db[_0x9539('0x3e')]['describe']()[_0x9539('0x20')](respondWithResult(_0x4578f7,null))[_0x9539('0x41')](handleError(_0x4578f7,null));}; \ No newline at end of file +var _0xc673=['server','files','offline-chat','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','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','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','end','error','name','index','map','ChatOfflineMessage','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','destroy','Attachment','forEach','join','root'];(function(_0xbafa33,_0x3d7ff4){var _0x3dec07=function(_0x29fec2){while(--_0x29fec2){_0xbafa33['push'](_0xbafa33['shift']());}};_0x3dec07(++_0x3d7ff4);}(_0xc673,0x103));var _0x3c67=function(_0xde7121,_0x40023e){_0xde7121=_0xde7121-0x0;var _0x3765e7=_0xc673[_0xde7121];return _0x3765e7;};'use strict';var emlformat=require(_0x3c67('0x0'));var rimraf=require(_0x3c67('0x1'));var zipdir=require(_0x3c67('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c67('0x3'));var moment=require(_0x3c67('0x4'));var BPromise=require(_0x3c67('0x5'));var Mustache=require('mustache');var util=require(_0x3c67('0x6'));var path=require(_0x3c67('0x7'));var sox=require('sox');var csv=require(_0x3c67('0x8'));var ejs=require(_0x3c67('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3c67('0xa'));var crypto=require(_0x3c67('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3c67('0xc'));var toCsv=require(_0x3c67('0x8'));var querystring=require(_0x3c67('0xd'));var Papa=require(_0x3c67('0xe'));var Redis=require(_0x3c67('0xf'));var authService=require(_0x3c67('0x10'));var qs=require(_0x3c67('0x11'));var as=require(_0x3c67('0x12'));var hardwareService=require(_0x3c67('0x13'));var logger=require(_0x3c67('0x14'))(_0x3c67('0x15'));var utils=require(_0x3c67('0x16'));var config=require(_0x3c67('0x17'));var licenseUtil=require(_0x3c67('0x18'));var db=require(_0x3c67('0x19'))['db'];function respondWithStatusCode(_0x6cfcb2,_0x1e9e90){_0x1e9e90=_0x1e9e90||0xcc;return function(_0x98f49b){if(_0x98f49b){return _0x6cfcb2[_0x3c67('0x1a')](_0x1e9e90);}return _0x6cfcb2[_0x3c67('0x1b')](_0x1e9e90)['end']();};}function respondWithResult(_0x251ce7,_0x1534ca){_0x1534ca=_0x1534ca||0xc8;return function(_0x55248a){if(_0x55248a){return _0x251ce7[_0x3c67('0x1b')](_0x1534ca)[_0x3c67('0x1c')](_0x55248a);}};}function respondWithFilteredResult(_0x48c31c,_0x3422a2){return function(_0x394a68){if(_0x394a68){var _0x1d5eed=_0x394a68[_0x3c67('0x1d')],_0x372493=_0x3422a2[_0x3c67('0x1e')],_0x3d2661=_0x3422a2[_0x3c67('0x1e')]+_0x3422a2['limit'],_0x150ec9;if(_0x3d2661>=_0x1d5eed){_0x3d2661=_0x1d5eed;_0x150ec9=0xc8;}else{_0x150ec9=0xce;}_0x48c31c['status'](_0x150ec9);return _0x48c31c[_0x3c67('0x1f')](_0x3c67('0x20'),_0x372493+'-'+_0x3d2661+'/'+_0x1d5eed)[_0x3c67('0x1c')](_0x394a68);}return null;};}function patchUpdates(_0x67f80c){return function(_0x4a4103){try{jsonpatch[_0x3c67('0x21')](_0x4a4103,_0x67f80c,!![]);}catch(_0x43a038){return BPromise[_0x3c67('0x22')](_0x43a038);}return _0x4a4103[_0x3c67('0x23')]();};}function saveUpdates(_0x5be174,_0x3d3350){return function(_0xb53df6){if(_0xb53df6){return _0xb53df6['update'](_0x5be174)[_0x3c67('0x24')](function(_0x43f915){return _0x43f915;});}return null;};}function removeEntity(_0x4b2959,_0x5132c8){return function(_0x5a9d1a){if(_0x5a9d1a){return _0x5a9d1a['destroy']()[_0x3c67('0x24')](function(){_0x4b2959[_0x3c67('0x1b')](0xcc)[_0x3c67('0x25')]();});}};}function handleEntityNotFound(_0x5e61e5,_0x29cac3){return function(_0x5b2dfd){if(!_0x5b2dfd){_0x5e61e5['sendStatus'](0x194);}return _0x5b2dfd;};}function handleError(_0x3f654f,_0x5d7d4a){_0x5d7d4a=_0x5d7d4a||0x1f4;return function(_0x25939d){logger[_0x3c67('0x26')](_0x25939d['stack']);if(_0x25939d[_0x3c67('0x27')]){delete _0x25939d['name'];}_0x3f654f['status'](_0x5d7d4a)['send'](_0x25939d);};}exports[_0x3c67('0x28')]=function(_0x48c34a,_0x4f46ed){var _0x4e7089={},_0x550396={},_0x5d22f8={'count':0x0,'rows':[]};var _0x17ef9e=_[_0x3c67('0x29')](db[_0x3c67('0x2a')][_0x3c67('0x2b')],function(_0x35fbad){return{'name':_0x35fbad['fieldName'],'type':_0x35fbad[_0x3c67('0x2c')]['key']};});_0x550396[_0x3c67('0x2d')]=_[_0x3c67('0x29')](_0x17ef9e,_0x3c67('0x27'));_0x550396[_0x3c67('0x2e')]=_['keys'](_0x48c34a[_0x3c67('0x2e')]);_0x550396[_0x3c67('0x2f')]=_[_0x3c67('0x30')](_0x550396[_0x3c67('0x2d')],_0x550396[_0x3c67('0x2e')]);_0x4e7089[_0x3c67('0x31')]=_['intersection'](_0x550396[_0x3c67('0x2d')],qs[_0x3c67('0x32')](_0x48c34a[_0x3c67('0x2e')][_0x3c67('0x32')]));_0x4e7089[_0x3c67('0x31')]=_0x4e7089[_0x3c67('0x31')][_0x3c67('0x33')]?_0x4e7089[_0x3c67('0x31')]:_0x550396['model'];if(!_0x48c34a[_0x3c67('0x2e')][_0x3c67('0x34')]('nolimit')){_0x4e7089[_0x3c67('0x35')]=qs['limit'](_0x48c34a['query'][_0x3c67('0x35')]);_0x4e7089['offset']=qs[_0x3c67('0x1e')](_0x48c34a[_0x3c67('0x2e')][_0x3c67('0x1e')]);}_0x4e7089['order']=qs[_0x3c67('0x36')](_0x48c34a['query'][_0x3c67('0x36')]);_0x4e7089[_0x3c67('0x37')]=qs[_0x3c67('0x2f')](_[_0x3c67('0x38')](_0x48c34a['query'],_0x550396[_0x3c67('0x2f')]),_0x17ef9e);if(_0x48c34a[_0x3c67('0x2e')][_0x3c67('0x39')]){_0x4e7089[_0x3c67('0x37')]=_[_0x3c67('0x3a')](_0x4e7089[_0x3c67('0x37')],{'$or':_['map'](_0x17ef9e,function(_0x24ebd0){if(_0x24ebd0[_0x3c67('0x2c')]!==_0x3c67('0x3b')){var _0x308367={};_0x308367[_0x24ebd0['name']]={'$like':'%'+_0x48c34a[_0x3c67('0x2e')][_0x3c67('0x39')]+'%'};return _0x308367;}})});}_0x4e7089=_[_0x3c67('0x3a')]({},_0x4e7089,_0x48c34a[_0x3c67('0x3c')]);var _0x4843ce={'where':_0x4e7089[_0x3c67('0x37')]};return db[_0x3c67('0x2a')]['count'](_0x4843ce)['then'](function(_0x4c9144){_0x5d22f8[_0x3c67('0x1d')]=_0x4c9144;if(_0x48c34a[_0x3c67('0x2e')][_0x3c67('0x3d')]){_0x4e7089[_0x3c67('0x3e')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x3c67('0x3f')](_0x4e7089);})[_0x3c67('0x24')](function(_0x34dd5d){_0x5d22f8[_0x3c67('0x40')]=_0x34dd5d;return _0x5d22f8;})[_0x3c67('0x24')](respondWithFilteredResult(_0x4f46ed,_0x4e7089))['catch'](handleError(_0x4f46ed,null));};exports[_0x3c67('0x41')]=function(_0x12be36,_0xc4b016){var _0x5c83a6={'raw':!![],'where':{'id':_0x12be36[_0x3c67('0x42')]['id']}},_0x5acde8={};_0x5acde8['model']=_['keys'](db[_0x3c67('0x2a')][_0x3c67('0x2b')]);_0x5acde8[_0x3c67('0x2e')]=_[_0x3c67('0x43')](_0x12be36[_0x3c67('0x2e')]);_0x5acde8[_0x3c67('0x2f')]=_['intersection'](_0x5acde8['model'],_0x5acde8[_0x3c67('0x2e')]);_0x5c83a6['attributes']=_[_0x3c67('0x30')](_0x5acde8[_0x3c67('0x2d')],qs[_0x3c67('0x32')](_0x12be36[_0x3c67('0x2e')]['fields']));_0x5c83a6[_0x3c67('0x31')]=_0x5c83a6[_0x3c67('0x31')]['length']?_0x5c83a6[_0x3c67('0x31')]:_0x5acde8[_0x3c67('0x2d')];if(_0x12be36['query'][_0x3c67('0x3d')]){_0x5c83a6[_0x3c67('0x3e')]=[{'all':!![]}];}_0x5c83a6=_['merge']({},_0x5c83a6,_0x12be36[_0x3c67('0x3c')]);return db[_0x3c67('0x2a')][_0x3c67('0x44')](_0x5c83a6)['then'](handleEntityNotFound(_0xc4b016,null))[_0x3c67('0x24')](respondWithResult(_0xc4b016,null))[_0x3c67('0x45')](handleError(_0xc4b016,null));};exports[_0x3c67('0x46')]=function(_0x6f94cb,_0x4da72c){return db['ChatOfflineMessage'][_0x3c67('0x46')](_0x6f94cb['body'],{})[_0x3c67('0x24')](respondWithResult(_0x4da72c,0xc9))[_0x3c67('0x45')](handleError(_0x4da72c,null));};exports['update']=function(_0x8c77ef,_0x409e3f){if(_0x8c77ef[_0x3c67('0x47')]['id']){delete _0x8c77ef[_0x3c67('0x47')]['id'];}return db['ChatOfflineMessage'][_0x3c67('0x44')]({'where':{'id':_0x8c77ef[_0x3c67('0x42')]['id']}})[_0x3c67('0x24')](handleEntityNotFound(_0x409e3f,null))[_0x3c67('0x24')](saveUpdates(_0x8c77ef['body'],null))['then'](respondWithResult(_0x409e3f,null))['catch'](handleError(_0x409e3f,null));};exports[_0x3c67('0x48')]=function(_0x58b797,_0x1d5050){return db[_0x3c67('0x49')]['findAll']({'where':{'ChatOfflineMessageId':_0x58b797[_0x3c67('0x42')]['id']},'raw':!![]})[_0x3c67('0x24')](function(_0x212b86){_0x212b86[_0x3c67('0x4a')](function(_0x5330ac){var _0x12a5e8=path[_0x3c67('0x4b')](config[_0x3c67('0x4c')],_0x3c67('0x4d'),_0x3c67('0x4e'),'attachments',_0x3c67('0x4f'),_0x5330ac[_0x3c67('0x50')]);var _0x54e721=fs[_0x3c67('0x51')](_0x12a5e8);if(_0x54e721)fs_extra[_0x3c67('0x52')](_0x12a5e8);});})[_0x3c67('0x24')](function(){return db[_0x3c67('0x2a')][_0x3c67('0x44')]({'where':{'id':_0x58b797['params']['id']},'individualHooks':!![]});})[_0x3c67('0x24')](handleEntityNotFound(_0x1d5050,null))[_0x3c67('0x24')](removeEntity(_0x1d5050,null))[_0x3c67('0x45')](handleError(_0x1d5050,null));};exports[_0x3c67('0x53')]=function(_0x1cedb9,_0x218405){return db[_0x3c67('0x2a')][_0x3c67('0x53')]()['then'](respondWithResult(_0x218405,null))[_0x3c67('0x45')](handleError(_0x218405,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index c4f2b1b..1845e5d 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 _0x579c=['rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x12c52d,_0x396d43){var _0x461116=function(_0x2c5461){while(--_0x2c5461){_0x12c52d['push'](_0x12c52d['shift']());}};_0x461116(++_0x396d43);}(_0x579c,0xda));var _0xc579=function(_0x2aa30c,_0x45a33b){_0x2aa30c=_0x2aa30c-0x0;var _0x22e9ae=_0x579c[_0x2aa30c];return _0x22e9ae;};'use strict';var _=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var logger=require(_0xc579('0x2'))(_0xc579('0x3'));var moment=require(_0xc579('0x4'));var BPromise=require('bluebird');var rp=require(_0xc579('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var attributes=require(_0xc579('0x8'));module[_0xc579('0x9')]=function(_0x124ee5,_0x1bd276){return _0x124ee5[_0xc579('0xa')]('ChatOfflineMessage',attributes,{'tableName':_0xc579('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc579('0xc'),'collate':_0xc579('0xd')});}; \ No newline at end of file +var _0x68fc=['./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path'];(function(_0x3d13bb,_0x262a54){var _0x4b5a1b=function(_0x53417e){while(--_0x53417e){_0x3d13bb['push'](_0x3d13bb['shift']());}};_0x4b5a1b(++_0x262a54);}(_0x68fc,0xa5));var _0xc68f=function(_0x49bafd,_0x413385){_0x49bafd=_0x49bafd-0x0;var _0x1908e2=_0x68fc[_0x49bafd];return _0x1908e2;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var logger=require(_0xc68f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc68f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc68f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc68f('0x5'));module[_0xc68f('0x6')]=function(_0x1c6df9,_0x363cdf){return _0x1c6df9['define']('ChatOfflineMessage',attributes,{'tableName':_0xc68f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc68f('0x8'),'collate':_0xc68f('0x9')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 8360cdc..526e281 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 _0xc7c5=['request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x13aad9,_0x19bd3b){var _0xeb3172=function(_0x181f00){while(--_0x181f00){_0x13aad9['push'](_0x13aad9['shift']());}};_0xeb3172(++_0x19bd3b);}(_0xc7c5,0x1ea));var _0x5c7c=function(_0x4021ae,_0x4d9ea4){_0x4021ae=_0x4021ae-0x0;var _0x3f6de7=_0xc7c5[_0x4021ae];return _0x3f6de7;};'use strict';var _=require(_0x5c7c('0x0'));var util=require(_0x5c7c('0x1'));var moment=require(_0x5c7c('0x2'));var BPromise=require(_0x5c7c('0x3'));var rs=require(_0x5c7c('0x4'));var fs=require('fs');var Redis=require(_0x5c7c('0x5'));var db=require(_0x5c7c('0x6'))['db'];var utils=require(_0x5c7c('0x7'));var logger=require(_0x5c7c('0x8'))('rpc');var config=require(_0x5c7c('0x9'));var jayson=require(_0x5c7c('0xa'));var client=jayson[_0x5c7c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1123f0,_0x14dac5,_0x5328cd){return new BPromise(function(_0x154b6a,_0x5a9671){return client[_0x5c7c('0xc')](_0x1123f0,_0x5328cd)[_0x5c7c('0xd')](function(_0x53dd4f){logger[_0x5c7c('0xe')](_0x5c7c('0xf'),_0x14dac5,_0x5c7c('0x10'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x14dac5,_0x5c7c('0x10'),JSON[_0x5c7c('0x11')](_0x53dd4f));if(_0x53dd4f[_0x5c7c('0x12')]){if(_0x53dd4f[_0x5c7c('0x12')][_0x5c7c('0x13')]===0x1f4){logger[_0x5c7c('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x14dac5,_0x53dd4f[_0x5c7c('0x12')][_0x5c7c('0x14')]);return _0x5a9671(_0x53dd4f[_0x5c7c('0x12')]['message']);}logger['error'](_0x5c7c('0xf'),_0x14dac5,_0x53dd4f[_0x5c7c('0x12')][_0x5c7c('0x14')]);return _0x154b6a(_0x53dd4f['error'][_0x5c7c('0x14')]);}else{logger[_0x5c7c('0xe')](_0x5c7c('0xf'),_0x14dac5,'request\x20sent');_0x154b6a(_0x53dd4f[_0x5c7c('0x15')][_0x5c7c('0x14')]);}})['catch'](function(_0x1d2844){logger[_0x5c7c('0x12')](_0x5c7c('0xf'),_0x14dac5,_0x1d2844);_0x5a9671(_0x1d2844);});});} \ No newline at end of file +var _0xb280=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x14a862,_0x2b559d){var _0x245eb5=function(_0x6e014c){while(--_0x6e014c){_0x14a862['push'](_0x14a862['shift']());}};_0x245eb5(++_0x2b559d);}(_0xb280,0xbd));var _0x0b28=function(_0x495501,_0x3c1ef8){_0x495501=_0x495501-0x0;var _0x1f333a=_0xb280[_0x495501];return _0x1f333a;};'use strict';var _=require(_0x0b28('0x0'));var util=require(_0x0b28('0x1'));var moment=require(_0x0b28('0x2'));var BPromise=require(_0x0b28('0x3'));var rs=require(_0x0b28('0x4'));var fs=require('fs');var Redis=require(_0x0b28('0x5'));var db=require(_0x0b28('0x6'))['db'];var utils=require(_0x0b28('0x7'));var logger=require(_0x0b28('0x8'))(_0x0b28('0x9'));var config=require(_0x0b28('0xa'));var jayson=require(_0x0b28('0xb'));var client=jayson['client'][_0x0b28('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3abc2e,_0x177a65,_0x2985db){return new BPromise(function(_0x18c05c,_0x5d6a2f){return client[_0x0b28('0xd')](_0x3abc2e,_0x2985db)[_0x0b28('0xe')](function(_0x449d6f){logger[_0x0b28('0xf')](_0x0b28('0x10'),_0x177a65,_0x0b28('0x11'));logger[_0x0b28('0x12')](_0x0b28('0x13'),_0x177a65,_0x0b28('0x11'),JSON[_0x0b28('0x14')](_0x449d6f));if(_0x449d6f['error']){if(_0x449d6f[_0x0b28('0x15')][_0x0b28('0x16')]===0x1f4){logger['error'](_0x0b28('0x10'),_0x177a65,_0x449d6f[_0x0b28('0x15')][_0x0b28('0x17')]);return _0x5d6a2f(_0x449d6f[_0x0b28('0x15')]['message']);}logger[_0x0b28('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0x177a65,_0x449d6f['error'][_0x0b28('0x17')]);return _0x18c05c(_0x449d6f['error'][_0x0b28('0x17')]);}else{logger['info'](_0x0b28('0x10'),_0x177a65,_0x0b28('0x11'));_0x18c05c(_0x449d6f[_0x0b28('0x18')][_0x0b28('0x17')]);}})[_0x0b28('0x19')](function(_0x48b829){logger[_0x0b28('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0x177a65,_0x48b829);_0x5d6a2f(_0x48b829);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index ee470b4..42d89e3 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 _0x5449=['delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x247602,_0x2c97b4){var _0x5185af=function(_0x2ca57e){while(--_0x2ca57e){_0x247602['push'](_0x247602['shift']());}};_0x5185af(++_0x2c97b4);}(_0x5449,0x129));var _0x9544=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x5449[_0x152121];return _0x592a85;};'use strict';var multer=require(_0x9544('0x0'));var util=require(_0x9544('0x1'));var path=require(_0x9544('0x2'));var timeout=require(_0x9544('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9544('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9544('0x5'));var config=require(_0x9544('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x9544('0x7')]('/',auth[_0x9544('0x8')](),controller[_0x9544('0x9')]);router[_0x9544('0x7')](_0x9544('0xa'),auth[_0x9544('0x8')](),controller[_0x9544('0xb')]);router[_0x9544('0x7')](_0x9544('0xc'),auth[_0x9544('0x8')](),controller[_0x9544('0xd')]);router[_0x9544('0xe')]('/',auth[_0x9544('0x8')](),controller[_0x9544('0xf')]);router[_0x9544('0x10')](_0x9544('0xc'),auth[_0x9544('0x8')](),controller[_0x9544('0x11')]);router[_0x9544('0x12')](_0x9544('0xc'),auth[_0x9544('0x8')](),controller[_0x9544('0x13')]);module[_0x9544('0x14')]=router; \ No newline at end of file +var _0x32ef=['describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated'];(function(_0xb12993,_0x5dc5ff){var _0x53b167=function(_0x3e5f27){while(--_0x3e5f27){_0xb12993['push'](_0xb12993['shift']());}};_0x53b167(++_0x5dc5ff);}(_0x32ef,0xa9));var _0xf32e=function(_0x47c563,_0x305d67){_0x47c563=_0x47c563-0x0;var _0x1ad5d6=_0x32ef[_0x47c563];return _0x1ad5d6;};'use strict';var multer=require(_0xf32e('0x0'));var util=require(_0xf32e('0x1'));var path=require(_0xf32e('0x2'));var timeout=require(_0xf32e('0x3'));var express=require(_0xf32e('0x4'));var router=express[_0xf32e('0x5')]();var fs_extra=require(_0xf32e('0x6'));var auth=require(_0xf32e('0x7'));var interaction=require(_0xf32e('0x8'));var config=require(_0xf32e('0x9'));var controller=require(_0xf32e('0xa'));router[_0xf32e('0xb')]('/',auth['isAuthenticated'](),controller[_0xf32e('0xc')]);router[_0xf32e('0xb')](_0xf32e('0xd'),auth[_0xf32e('0xe')](),controller[_0xf32e('0xf')]);router[_0xf32e('0xb')](_0xf32e('0x10'),auth[_0xf32e('0xe')](),controller['show']);router[_0xf32e('0x11')]('/',auth[_0xf32e('0xe')](),controller[_0xf32e('0x12')]);router[_0xf32e('0x13')](_0xf32e('0x10'),auth[_0xf32e('0xe')](),controller['update']);router[_0xf32e('0x14')]('/:id',auth[_0xf32e('0xe')](),controller[_0xf32e('0x15')]);module[_0xf32e('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 5744c41..c830618 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 _0x5a1e=['ENUM','mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x3fe8a1,_0x474f8e){var _0x33426c=function(_0x19ed9f){while(--_0x19ed9f){_0x3fe8a1['push'](_0x3fe8a1['shift']());}};_0x33426c(++_0x474f8e);}(_0x5a1e,0x123));var _0xe5a1=function(_0xec5192,_0x4d2a15){_0xec5192=_0xec5192-0x0;var _0x13cb1b=_0x5a1e[_0xec5192];return _0x13cb1b;};'use strict';var Sequelize=require(_0xe5a1('0x0'));module[_0xe5a1('0x1')]={'name':{'type':Sequelize[_0xe5a1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe5a1('0x3')](_0xe5a1('0x4'),_0xe5a1('0x5')),'defaultValue':_0xe5a1('0x4')},'selector':{'type':Sequelize[_0xe5a1('0x2')]},'timeout':{'type':Sequelize[_0xe5a1('0x6')]}}; \ No newline at end of file +var _0x8a61=['ENUM','mouseOver','timeout','INTEGER','sequelize','STRING'];(function(_0x272202,_0x569e70){var _0xcad2a7=function(_0x3b39b2){while(--_0x3b39b2){_0x272202['push'](_0x272202['shift']());}};_0xcad2a7(++_0x569e70);}(_0x8a61,0x70));var _0x18a6=function(_0x1319e2,_0x315c15){_0x1319e2=_0x1319e2-0x0;var _0x2e0e48=_0x8a61[_0x1319e2];return _0x2e0e48;};'use strict';var Sequelize=require(_0x18a6('0x0'));module['exports']={'name':{'type':Sequelize[_0x18a6('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x18a6('0x2')](_0x18a6('0x3'),_0x18a6('0x4')),'defaultValue':_0x18a6('0x3')},'selector':{'type':Sequelize[_0x18a6('0x1')]},'timeout':{'type':Sequelize[_0x18a6('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index bff7caa..b1c1540 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 _0x39e6=['error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','find','catch','create','params','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','destroy','then'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x39e6,0xca));var _0x639e=function(_0x2f8391,_0x406236){_0x2f8391=_0x2f8391-0x0;var _0x517d2a=_0x39e6[_0x2f8391];return _0x517d2a;};'use strict';var emlformat=require(_0x639e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x639e('0x1'));var jsonpatch=require(_0x639e('0x2'));var rp=require(_0x639e('0x3'));var moment=require('moment');var BPromise=require(_0x639e('0x4'));var Mustache=require(_0x639e('0x5'));var util=require(_0x639e('0x6'));var path=require('path');var sox=require(_0x639e('0x7'));var csv=require(_0x639e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x639e('0x9'));var _=require(_0x639e('0xa'));var squel=require(_0x639e('0xb'));var crypto=require(_0x639e('0xc'));var jsforce=require(_0x639e('0xd'));var deskjs=require(_0x639e('0xe'));var toCsv=require(_0x639e('0x8'));var querystring=require('querystring');var Papa=require(_0x639e('0xf'));var Redis=require('ioredis');var authService=require(_0x639e('0x10'));var qs=require(_0x639e('0x11'));var as=require(_0x639e('0x12'));var hardwareService=require(_0x639e('0x13'));var logger=require('../../config/logger')(_0x639e('0x14'));var utils=require(_0x639e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x639e('0x16'));var db=require(_0x639e('0x17'))['db'];function respondWithStatusCode(_0x55cdcf,_0x2a32c5){_0x2a32c5=_0x2a32c5||0xcc;return function(_0x3c1070){if(_0x3c1070){return _0x55cdcf[_0x639e('0x18')](_0x2a32c5);}return _0x55cdcf[_0x639e('0x19')](_0x2a32c5)[_0x639e('0x1a')]();};}function respondWithResult(_0x18fadc,_0xe5a443){_0xe5a443=_0xe5a443||0xc8;return function(_0x1c5ee8){if(_0x1c5ee8){return _0x18fadc[_0x639e('0x19')](_0xe5a443)['json'](_0x1c5ee8);}};}function respondWithFilteredResult(_0x570845,_0x49a5c6){return function(_0x4ccdb7){if(_0x4ccdb7){var _0x1642ab=_0x4ccdb7[_0x639e('0x1b')],_0x424bb1=_0x49a5c6[_0x639e('0x1c')],_0x4b4fc4=_0x49a5c6[_0x639e('0x1c')]+_0x49a5c6[_0x639e('0x1d')],_0xe2915d;if(_0x4b4fc4>=_0x1642ab){_0x4b4fc4=_0x1642ab;_0xe2915d=0xc8;}else{_0xe2915d=0xce;}_0x570845['status'](_0xe2915d);return _0x570845[_0x639e('0x1e')]('Content-Range',_0x424bb1+'-'+_0x4b4fc4+'/'+_0x1642ab)[_0x639e('0x1f')](_0x4ccdb7);}return null;};}function patchUpdates(_0x1f9944){return function(_0x5524d2){try{jsonpatch[_0x639e('0x20')](_0x5524d2,_0x1f9944,!![]);}catch(_0x60eebb){return BPromise[_0x639e('0x21')](_0x60eebb);}return _0x5524d2[_0x639e('0x22')]();};}function saveUpdates(_0x5dac9a,_0x10c68e){return function(_0x503ae6){if(_0x503ae6){return _0x503ae6[_0x639e('0x23')](_0x5dac9a)['then'](function(_0x3bbc32){return _0x3bbc32;});}return null;};}function removeEntity(_0x472706,_0x3d28b6){return function(_0x10de40){if(_0x10de40){return _0x10de40[_0x639e('0x24')]()[_0x639e('0x25')](function(){_0x472706['status'](0xcc)[_0x639e('0x1a')]();});}};}function handleEntityNotFound(_0x5e90ed,_0x493a60){return function(_0x5e3ef4){if(!_0x5e3ef4){_0x5e90ed['sendStatus'](0x194);}return _0x5e3ef4;};}function handleError(_0x35b05b,_0x503079){_0x503079=_0x503079||0x1f4;return function(_0x28c998){logger[_0x639e('0x26')](_0x28c998[_0x639e('0x27')]);if(_0x28c998[_0x639e('0x28')]){delete _0x28c998[_0x639e('0x28')];}_0x35b05b[_0x639e('0x19')](_0x503079)[_0x639e('0x29')](_0x28c998);};}exports[_0x639e('0x2a')]=function(_0x3f603b,_0xafb845){var _0x3672b1={'raw':!![],'where':{'id':_0x3f603b['params']['id']}},_0x40b058={};_0x40b058[_0x639e('0x2b')]=_[_0x639e('0x2c')](db[_0x639e('0x2d')][_0x639e('0x2e')]);_0x40b058[_0x639e('0x2f')]=_[_0x639e('0x2c')](_0x3f603b[_0x639e('0x2f')]);_0x40b058[_0x639e('0x30')]=_[_0x639e('0x31')](_0x40b058[_0x639e('0x2b')],_0x40b058[_0x639e('0x2f')]);_0x3672b1[_0x639e('0x32')]=_[_0x639e('0x31')](_0x40b058[_0x639e('0x2b')],qs[_0x639e('0x33')](_0x3f603b[_0x639e('0x2f')][_0x639e('0x33')]));_0x3672b1[_0x639e('0x32')]=_0x3672b1['attributes'][_0x639e('0x34')]?_0x3672b1[_0x639e('0x32')]:_0x40b058['model'];if(_0x3f603b[_0x639e('0x2f')]['includeAll']){_0x3672b1['include']=[{'all':!![]}];}_0x3672b1=_[_0x639e('0x35')]({},_0x3672b1,_0x3f603b[_0x639e('0x36')]);return db['ChatProactiveAction'][_0x639e('0x37')](_0x3672b1)[_0x639e('0x25')](handleEntityNotFound(_0xafb845,null))[_0x639e('0x25')](respondWithResult(_0xafb845,null))[_0x639e('0x38')](handleError(_0xafb845,null));};exports['create']=function(_0x5a8e9a,_0x166cf4){return db[_0x639e('0x2d')][_0x639e('0x39')](_0x5a8e9a['body'],{})[_0x639e('0x25')](respondWithResult(_0x166cf4,0xc9))[_0x639e('0x38')](handleError(_0x166cf4,null));};exports[_0x639e('0x23')]=function(_0x49bdb9,_0x1279e6){if(_0x49bdb9['body']['id']){delete _0x49bdb9['body']['id'];}return db[_0x639e('0x2d')][_0x639e('0x37')]({'where':{'id':_0x49bdb9[_0x639e('0x3a')]['id']}})[_0x639e('0x25')](handleEntityNotFound(_0x1279e6,null))[_0x639e('0x25')](saveUpdates(_0x49bdb9[_0x639e('0x3b')],null))[_0x639e('0x25')](respondWithResult(_0x1279e6,null))['catch'](handleError(_0x1279e6,null));};exports[_0x639e('0x24')]=function(_0xa949cd,_0x21df1f){return db[_0x639e('0x2d')]['find']({'where':{'id':_0xa949cd[_0x639e('0x3a')]['id']}})[_0x639e('0x25')](handleEntityNotFound(_0x21df1f,null))[_0x639e('0x25')](removeEntity(_0x21df1f,null))[_0x639e('0x38')](handleError(_0x21df1f,null));}; \ No newline at end of file +var _0xd4b3=['mustache','util','path','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/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','include','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4b3,0x77));var _0x3d4b=function(_0x17d188,_0x401cc5){_0x17d188=_0x17d188-0x0;var _0x3ca692=_0xd4b3[_0x17d188];return _0x3ca692;};'use strict';var emlformat=require(_0x3d4b('0x0'));var rimraf=require(_0x3d4b('0x1'));var zipdir=require(_0x3d4b('0x2'));var jsonpatch=require(_0x3d4b('0x3'));var rp=require(_0x3d4b('0x4'));var moment=require(_0x3d4b('0x5'));var BPromise=require(_0x3d4b('0x6'));var Mustache=require(_0x3d4b('0x7'));var util=require(_0x3d4b('0x8'));var path=require(_0x3d4b('0x9'));var sox=require(_0x3d4b('0xa'));var csv=require(_0x3d4b('0xb'));var ejs=require(_0x3d4b('0xc'));var fs=require('fs');var fs_extra=require(_0x3d4b('0xd'));var _=require(_0x3d4b('0xe'));var squel=require('squel');var crypto=require(_0x3d4b('0xf'));var jsforce=require(_0x3d4b('0x10'));var deskjs=require(_0x3d4b('0x11'));var toCsv=require(_0x3d4b('0xb'));var querystring=require('querystring');var Papa=require(_0x3d4b('0x12'));var Redis=require(_0x3d4b('0x13'));var authService=require(_0x3d4b('0x14'));var qs=require(_0x3d4b('0x15'));var as=require(_0x3d4b('0x16'));var hardwareService=require(_0x3d4b('0x17'));var logger=require(_0x3d4b('0x18'))(_0x3d4b('0x19'));var utils=require(_0x3d4b('0x1a'));var config=require(_0x3d4b('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1eb7a1,_0x24c3ec){_0x24c3ec=_0x24c3ec||0xcc;return function(_0x251f5d){if(_0x251f5d){return _0x1eb7a1[_0x3d4b('0x1c')](_0x24c3ec);}return _0x1eb7a1[_0x3d4b('0x1d')](_0x24c3ec)[_0x3d4b('0x1e')]();};}function respondWithResult(_0x21df66,_0x4557ce){_0x4557ce=_0x4557ce||0xc8;return function(_0x273e28){if(_0x273e28){return _0x21df66[_0x3d4b('0x1d')](_0x4557ce)[_0x3d4b('0x1f')](_0x273e28);}};}function respondWithFilteredResult(_0x12ac72,_0x512707){return function(_0x2768c2){if(_0x2768c2){var _0xf11307=_0x2768c2[_0x3d4b('0x20')],_0x48dc9c=_0x512707[_0x3d4b('0x21')],_0x3d789a=_0x512707['offset']+_0x512707[_0x3d4b('0x22')],_0x3dd4d1;if(_0x3d789a>=_0xf11307){_0x3d789a=_0xf11307;_0x3dd4d1=0xc8;}else{_0x3dd4d1=0xce;}_0x12ac72[_0x3d4b('0x1d')](_0x3dd4d1);return _0x12ac72[_0x3d4b('0x23')]('Content-Range',_0x48dc9c+'-'+_0x3d789a+'/'+_0xf11307)['json'](_0x2768c2);}return null;};}function patchUpdates(_0x336158){return function(_0x3d8835){try{jsonpatch[_0x3d4b('0x24')](_0x3d8835,_0x336158,!![]);}catch(_0x13221e){return BPromise[_0x3d4b('0x25')](_0x13221e);}return _0x3d8835[_0x3d4b('0x26')]();};}function saveUpdates(_0x501360,_0x3021b6){return function(_0x245b39){if(_0x245b39){return _0x245b39[_0x3d4b('0x27')](_0x501360)[_0x3d4b('0x28')](function(_0x343752){return _0x343752;});}return null;};}function removeEntity(_0x177354,_0x4be95c){return function(_0x5e2449){if(_0x5e2449){return _0x5e2449[_0x3d4b('0x29')]()[_0x3d4b('0x28')](function(){_0x177354[_0x3d4b('0x1d')](0xcc)[_0x3d4b('0x1e')]();});}};}function handleEntityNotFound(_0x2c19aa,_0x125554){return function(_0x2854eb){if(!_0x2854eb){_0x2c19aa[_0x3d4b('0x1c')](0x194);}return _0x2854eb;};}function handleError(_0x32e1c1,_0x26b189){_0x26b189=_0x26b189||0x1f4;return function(_0x34aa63){logger[_0x3d4b('0x2a')](_0x34aa63[_0x3d4b('0x2b')]);if(_0x34aa63[_0x3d4b('0x2c')]){delete _0x34aa63['name'];}_0x32e1c1[_0x3d4b('0x1d')](_0x26b189)[_0x3d4b('0x2d')](_0x34aa63);};}exports[_0x3d4b('0x2e')]=function(_0x409df8,_0x3aeb82){var _0x4999fd={'raw':!![],'where':{'id':_0x409df8['params']['id']}},_0x91a5b2={};_0x91a5b2[_0x3d4b('0x2f')]=_[_0x3d4b('0x30')](db[_0x3d4b('0x31')][_0x3d4b('0x32')]);_0x91a5b2[_0x3d4b('0x33')]=_[_0x3d4b('0x30')](_0x409df8[_0x3d4b('0x33')]);_0x91a5b2[_0x3d4b('0x34')]=_[_0x3d4b('0x35')](_0x91a5b2[_0x3d4b('0x2f')],_0x91a5b2[_0x3d4b('0x33')]);_0x4999fd[_0x3d4b('0x36')]=_['intersection'](_0x91a5b2['model'],qs[_0x3d4b('0x37')](_0x409df8[_0x3d4b('0x33')]['fields']));_0x4999fd[_0x3d4b('0x36')]=_0x4999fd[_0x3d4b('0x36')][_0x3d4b('0x38')]?_0x4999fd[_0x3d4b('0x36')]:_0x91a5b2[_0x3d4b('0x2f')];if(_0x409df8[_0x3d4b('0x33')]['includeAll']){_0x4999fd[_0x3d4b('0x39')]=[{'all':!![]}];}_0x4999fd=_['merge']({},_0x4999fd,_0x409df8['options']);return db[_0x3d4b('0x31')][_0x3d4b('0x3a')](_0x4999fd)[_0x3d4b('0x28')](handleEntityNotFound(_0x3aeb82,null))['then'](respondWithResult(_0x3aeb82,null))[_0x3d4b('0x3b')](handleError(_0x3aeb82,null));};exports[_0x3d4b('0x3c')]=function(_0x320a3b,_0x2aa4c2){return db[_0x3d4b('0x31')][_0x3d4b('0x3c')](_0x320a3b[_0x3d4b('0x3d')],{})[_0x3d4b('0x28')](respondWithResult(_0x2aa4c2,0xc9))[_0x3d4b('0x3b')](handleError(_0x2aa4c2,null));};exports[_0x3d4b('0x27')]=function(_0x302cb9,_0x3bc845){if(_0x302cb9[_0x3d4b('0x3d')]['id']){delete _0x302cb9[_0x3d4b('0x3d')]['id'];}return db[_0x3d4b('0x31')][_0x3d4b('0x3a')]({'where':{'id':_0x302cb9[_0x3d4b('0x3e')]['id']}})[_0x3d4b('0x28')](handleEntityNotFound(_0x3bc845,null))['then'](saveUpdates(_0x302cb9[_0x3d4b('0x3d')],null))[_0x3d4b('0x28')](respondWithResult(_0x3bc845,null))['catch'](handleError(_0x3bc845,null));};exports[_0x3d4b('0x29')]=function(_0x2d0ec2,_0x520bca){return db['ChatProactiveAction'][_0x3d4b('0x3a')]({'where':{'id':_0x2d0ec2[_0x3d4b('0x3e')]['id']}})[_0x3d4b('0x28')](handleEntityNotFound(_0x520bca,null))[_0x3d4b('0x28')](removeEntity(_0x520bca,null))[_0x3d4b('0x3b')](handleError(_0x520bca,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index d5f1f03..77472d1 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 _0x1873=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','define','lodash'];(function(_0x4441cf,_0x2a68e7){var _0x2f60bf=function(_0x2dfd25){while(--_0x2dfd25){_0x4441cf['push'](_0x4441cf['shift']());}};_0x2f60bf(++_0x2a68e7);}(_0x1873,0x1c1));var _0x3187=function(_0xe83563,_0x18ee1e){_0xe83563=_0xe83563-0x0;var _0xcea60d=_0x1873[_0xe83563];return _0xcea60d;};'use strict';var _=require(_0x3187('0x0'));var util=require(_0x3187('0x1'));var logger=require(_0x3187('0x2'))('api');var moment=require(_0x3187('0x3'));var BPromise=require(_0x3187('0x4'));var rp=require(_0x3187('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3187('0x6'));var config=require(_0x3187('0x7'));var attributes=require(_0x3187('0x8'));module['exports']=function(_0x7e9a4d,_0x2d6fd8){return _0x7e9a4d[_0x3187('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaca8=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','ChatProactiveAction','lodash','util','api','moment'];(function(_0x1af19c,_0x4f2ae2){var _0x78a547=function(_0x111883){while(--_0x111883){_0x1af19c['push'](_0x1af19c['shift']());}};_0x78a547(++_0x4f2ae2);}(_0xaca8,0x17d));var _0x8aca=function(_0x39ecda,_0x586d10){_0x39ecda=_0x39ecda-0x0;var _0x4755da=_0xaca8[_0x39ecda];return _0x4755da;};'use strict';var _=require(_0x8aca('0x0'));var util=require(_0x8aca('0x1'));var logger=require('../../config/logger')(_0x8aca('0x2'));var moment=require(_0x8aca('0x3'));var BPromise=require(_0x8aca('0x4'));var rp=require(_0x8aca('0x5'));var fs=require('fs');var path=require(_0x8aca('0x6'));var rimraf=require(_0x8aca('0x7'));var config=require(_0x8aca('0x8'));var attributes=require(_0x8aca('0x9'));module['exports']=function(_0x16e5e1,_0x8c5af0){return _0x16e5e1['define'](_0x8aca('0xa'),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 c458443..ad415de 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 _0xe230=['bluebird','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','util'];(function(_0x2982fb,_0x5aa7ad){var _0x57bd4f=function(_0x46407c){while(--_0x46407c){_0x2982fb['push'](_0x2982fb['shift']());}};_0x57bd4f(++_0x5aa7ad);}(_0xe230,0x18b));var _0x0e23=function(_0x294458,_0xdeb8ca){_0x294458=_0x294458-0x0;var _0x212dea=_0xe230[_0x294458];return _0x212dea;};'use strict';var _=require('lodash');var util=require(_0x0e23('0x0'));var moment=require('moment');var BPromise=require(_0x0e23('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0e23('0x2'));var config=require(_0x0e23('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x0e23('0x4')][_0x0e23('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x216bcc,_0x40d802,_0x26d324){return new BPromise(function(_0x320e8c,_0x4ad7a7){return client[_0x0e23('0x6')](_0x216bcc,_0x26d324)[_0x0e23('0x7')](function(_0x3c87ac){logger[_0x0e23('0x8')](_0x0e23('0x9'),_0x40d802,'request\x20sent');logger['debug'](_0x0e23('0xa'),_0x40d802,'request\x20sent',JSON[_0x0e23('0xb')](_0x3c87ac));if(_0x3c87ac['error']){if(_0x3c87ac['error'][_0x0e23('0xc')]===0x1f4){logger['error'](_0x0e23('0x9'),_0x40d802,_0x3c87ac[_0x0e23('0xd')]['message']);return _0x4ad7a7(_0x3c87ac[_0x0e23('0xd')]['message']);}logger['error'](_0x0e23('0x9'),_0x40d802,_0x3c87ac[_0x0e23('0xd')]['message']);return _0x320e8c(_0x3c87ac['error'][_0x0e23('0xe')]);}else{logger[_0x0e23('0x8')](_0x0e23('0x9'),_0x40d802,_0x0e23('0xf'));_0x320e8c(_0x3c87ac[_0x0e23('0x10')][_0x0e23('0xe')]);}})[_0x0e23('0x11')](function(_0x2dae9a){logger[_0x0e23('0xd')](_0x0e23('0x9'),_0x40d802,_0x2dae9a);_0x4ad7a7(_0x2dae9a);});});} \ No newline at end of file +var _0x0105=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment'];(function(_0x34562b,_0x4f2fb0){var _0xf2666a=function(_0x482047){while(--_0x482047){_0x34562b['push'](_0x34562b['shift']());}};_0xf2666a(++_0x4f2fb0);}(_0x0105,0x75));var _0x5010=function(_0x58ec0e,_0x45ccc3){_0x58ec0e=_0x58ec0e-0x0;var _0x227a6c=_0x0105[_0x58ec0e];return _0x227a6c;};'use strict';var _=require(_0x5010('0x0'));var util=require(_0x5010('0x1'));var moment=require(_0x5010('0x2'));var BPromise=require(_0x5010('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5010('0x4'))['db'];var utils=require(_0x5010('0x5'));var logger=require(_0x5010('0x6'))(_0x5010('0x7'));var config=require(_0x5010('0x8'));var jayson=require(_0x5010('0x9'));var client=jayson[_0x5010('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x272f70,_0x490df4,_0x303fb6){return new BPromise(function(_0xbcaa3e,_0x21bc93){return client[_0x5010('0xb')](_0x272f70,_0x303fb6)['then'](function(_0x41c1c3){logger['info'](_0x5010('0xc'),_0x490df4,_0x5010('0xd'));logger[_0x5010('0xe')](_0x5010('0xf'),_0x490df4,'request\x20sent',JSON[_0x5010('0x10')](_0x41c1c3));if(_0x41c1c3[_0x5010('0x11')]){if(_0x41c1c3[_0x5010('0x11')][_0x5010('0x12')]===0x1f4){logger['error'](_0x5010('0xc'),_0x490df4,_0x41c1c3[_0x5010('0x11')][_0x5010('0x13')]);return _0x21bc93(_0x41c1c3['error'][_0x5010('0x13')]);}logger[_0x5010('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x490df4,_0x41c1c3[_0x5010('0x11')][_0x5010('0x13')]);return _0xbcaa3e(_0x41c1c3[_0x5010('0x11')][_0x5010('0x13')]);}else{logger['info'](_0x5010('0xc'),_0x490df4,_0x5010('0xd'));_0xbcaa3e(_0x41c1c3['result'][_0x5010('0x13')]);}})['catch'](function(_0x4ccdc4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x490df4,_0x4ccdc4);_0x21bc93(_0x4ccdc4);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index faf07d3..3b60a86 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 _0x927d=['./chatProactiveAction.controller','get','/:id','isAuthenticated','post','create','update','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5e2cb4,_0x592c64){var _0x282902=function(_0x1c1836){while(--_0x1c1836){_0x5e2cb4['push'](_0x5e2cb4['shift']());}};_0x282902(++_0x592c64);}(_0x927d,0x19e));var _0xd927=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x927d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xd927('0x0'));var path=require('path');var timeout=require(_0xd927('0x1'));var express=require(_0xd927('0x2'));var router=express[_0xd927('0x3')]();var fs_extra=require(_0xd927('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd927('0x5'));var config=require('../../config/environment');var controller=require(_0xd927('0x6'));router[_0xd927('0x7')](_0xd927('0x8'),auth[_0xd927('0x9')](),controller['show']);router[_0xd927('0xa')]('/',auth[_0xd927('0x9')](),controller[_0xd927('0xb')]);router['put'](_0xd927('0x8'),auth['isAuthenticated'](),controller[_0xd927('0xc')]);router['delete']('/:id',auth[_0xd927('0x9')](),controller['destroy']);module[_0xd927('0xd')]=router; \ No newline at end of file +var _0xab06=['./chatProactiveAction.controller','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x194512,_0x1ec754){var _0x7dbdd1=function(_0x29c841){while(--_0x29c841){_0x194512['push'](_0x194512['shift']());}};_0x7dbdd1(++_0x1ec754);}(_0xab06,0x14d));var _0x6ab0=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xab06[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x6ab0('0x0'));var util=require('util');var path=require(_0x6ab0('0x1'));var timeout=require(_0x6ab0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6ab0('0x3'));var auth=require(_0x6ab0('0x4'));var interaction=require(_0x6ab0('0x5'));var config=require(_0x6ab0('0x6'));var controller=require(_0x6ab0('0x7'));router['get'](_0x6ab0('0x8'),auth[_0x6ab0('0x9')](),controller[_0x6ab0('0xa')]);router[_0x6ab0('0xb')]('/',auth[_0x6ab0('0x9')](),controller[_0x6ab0('0xc')]);router[_0x6ab0('0xd')](_0x6ab0('0x8'),auth[_0x6ab0('0x9')](),controller[_0x6ab0('0xe')]);router[_0x6ab0('0xf')](_0x6ab0('0x8'),auth[_0x6ab0('0x9')](),controller[_0x6ab0('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 9155bfc..20616c7 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 _0x5a10=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','INTEGER'];(function(_0xa1b144,_0x40422a){var _0x3006c3=function(_0x3ab21b){while(--_0x3ab21b){_0xa1b144['push'](_0xa1b144['shift']());}};_0x3006c3(++_0x40422a);}(_0x5a10,0x1ee));var _0x05a1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a10[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x05a1('0x0')]={'name':{'type':Sequelize[_0x05a1('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x05a1('0x1')]},'timeout':{'type':Sequelize[_0x05a1('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x05a1('0x3')](_0x05a1('0x4'),_0x05a1('0x5'),_0x05a1('0x6'))}}; \ No newline at end of file +var _0x7685=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x2e6dbf,_0x57dd06){var _0x2680e5=function(_0x4018f4){while(--_0x4018f4){_0x2e6dbf['push'](_0x2e6dbf['shift']());}};_0x2680e5(++_0x57dd06);}(_0x7685,0x19b));var _0x5768=function(_0x524b2c,_0x50f95d){_0x524b2c=_0x524b2c-0x0;var _0x99f319=_0x7685[_0x524b2c];return _0x99f319;};'use strict';var Sequelize=require(_0x5768('0x0'));module[_0x5768('0x1')]={'name':{'type':Sequelize[_0x5768('0x2')],'unique':_0x5768('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5768('0x2')]},'timeout':{'type':Sequelize[_0x5768('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5768('0x5'),_0x5768('0x6'),_0x5768('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 8d22d5c..4d77b43 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 _0x8378=['sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','ids','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','order','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','name','send','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','ChatQueue','includeAll','include','findAll','show','params','rawAttributes','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','addTeams','online','voicePause','interface','Agents'];(function(_0xac9c3a,_0x4d6c11){var _0x9bbfa7=function(_0x472649){while(--_0x472649){_0xac9c3a['push'](_0xac9c3a['shift']());}};_0x9bbfa7(++_0x4d6c11);}(_0x8378,0x1f3));var _0x8837=function(_0x4f4e27,_0x38c66e){_0x4f4e27=_0x4f4e27-0x0;var _0x2fe66b=_0x8378[_0x4f4e27];return _0x2fe66b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8837('0x0'));var zipdir=require(_0x8837('0x1'));var jsonpatch=require(_0x8837('0x2'));var rp=require(_0x8837('0x3'));var moment=require('moment');var BPromise=require(_0x8837('0x4'));var Mustache=require(_0x8837('0x5'));var util=require(_0x8837('0x6'));var path=require(_0x8837('0x7'));var sox=require('sox');var csv=require(_0x8837('0x8'));var ejs=require(_0x8837('0x9'));var fs=require('fs');var fs_extra=require(_0x8837('0xa'));var _=require(_0x8837('0xb'));var squel=require(_0x8837('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8837('0xd'));var toCsv=require(_0x8837('0x8'));var querystring=require(_0x8837('0xe'));var Papa=require(_0x8837('0xf'));var Redis=require(_0x8837('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8837('0x11'));var as=require(_0x8837('0x12'));var hardwareService=require(_0x8837('0x13'));var logger=require(_0x8837('0x14'))(_0x8837('0x15'));var utils=require(_0x8837('0x16'));var config=require(_0x8837('0x17'));var licenseUtil=require(_0x8837('0x18'));var db=require(_0x8837('0x19'))['db'];config[_0x8837('0x1a')]=_[_0x8837('0x1b')](config[_0x8837('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x8837('0x1c'))(new Redis(config[_0x8837('0x1a')]));require(_0x8837('0x1d'))[_0x8837('0x1e')](socket);var jayson=require(_0x8837('0x1f'));var client=jayson[_0x8837('0x20')][_0x8837('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1330b9,_0x3823d4,_0x13b86a,_0x2c46a7){return new BPromise(function(_0x3456e3,_0x10ea5c){var _0x60407=_0x2c46a7||client;return _0x60407['request'](_0x1330b9,_0x13b86a)[_0x8837('0x22')](function(_0x9357b7){logger[_0x8837('0x23')](_0x8837('0x24'),_0x3823d4,_0x8837('0x25'));logger[_0x8837('0x26')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3823d4,_0x8837('0x25'),JSON[_0x8837('0x27')](_0x9357b7));if(_0x9357b7[_0x8837('0x28')]){if(_0x9357b7['error'][_0x8837('0x29')]===0x1f4){logger[_0x8837('0x28')](_0x8837('0x24'),_0x3823d4,_0x9357b7[_0x8837('0x28')][_0x8837('0x2a')]);return _0x10ea5c(_0x9357b7[_0x8837('0x28')]['message']);}logger[_0x8837('0x28')](_0x8837('0x24'),_0x3823d4,_0x9357b7[_0x8837('0x28')]['message']);return _0x3456e3(_0x9357b7[_0x8837('0x28')][_0x8837('0x2a')]);}else{logger[_0x8837('0x23')](_0x8837('0x24'),_0x3823d4,'request\x20sent');_0x3456e3(_0x9357b7[_0x8837('0x2b')][_0x8837('0x2a')]);}})[_0x8837('0x2c')](function(_0x3a38f3){logger[_0x8837('0x28')](_0x8837('0x24'),_0x3823d4,_0x3a38f3);_0x10ea5c(_0x3a38f3);});});}function respondWithStatusCode(_0x4ee735,_0x272228){_0x272228=_0x272228||0xcc;return function(_0x54d417){if(_0x54d417){return _0x4ee735[_0x8837('0x2d')](_0x272228);}return _0x4ee735[_0x8837('0x2e')](_0x272228)[_0x8837('0x2f')]();};}function respondWithResult(_0x4c76f1,_0x4be58e){_0x4be58e=_0x4be58e||0xc8;return function(_0xe9ec81){if(_0xe9ec81){return _0x4c76f1[_0x8837('0x2e')](_0x4be58e)['json'](_0xe9ec81);}};}function respondWithFilteredResult(_0x5ec122,_0x561731){return function(_0x397872){if(_0x397872){var _0x2fdf24=_0x397872[_0x8837('0x30')],_0xcaf324=_0x561731['offset'],_0x1dfc44=_0x561731[_0x8837('0x31')]+_0x561731[_0x8837('0x32')],_0x141072;if(_0x1dfc44>=_0x2fdf24){_0x1dfc44=_0x2fdf24;_0x141072=0xc8;}else{_0x141072=0xce;}_0x5ec122[_0x8837('0x2e')](_0x141072);return _0x5ec122[_0x8837('0x33')](_0x8837('0x34'),_0xcaf324+'-'+_0x1dfc44+'/'+_0x2fdf24)['json'](_0x397872);}return null;};}function patchUpdates(_0x37359e){return function(_0x353598){try{jsonpatch[_0x8837('0x35')](_0x353598,_0x37359e,!![]);}catch(_0x25d8b0){return BPromise[_0x8837('0x36')](_0x25d8b0);}return _0x353598[_0x8837('0x37')]();};}function saveUpdates(_0x41a4b7,_0x23f2b2){return function(_0x31281f){if(_0x31281f){return _0x31281f[_0x8837('0x38')](_0x41a4b7)[_0x8837('0x22')](function(_0x2b72a4){return _0x2b72a4;});}return null;};}function removeEntity(_0x4ffde7,_0x49c0bc){return function(_0x2cd9e1){if(_0x2cd9e1){return _0x2cd9e1[_0x8837('0x39')]()[_0x8837('0x22')](function(){var _0x2f95fb=_0x2cd9e1[_0x8837('0x3a')]({'plain':!![]});var _0x27de29=_0x8837('0x3b');return db[_0x8837('0x3c')][_0x8837('0x39')]({'where':{'type':_0x27de29,'resourceId':_0x2f95fb['id']}})[_0x8837('0x22')](function(){return _0x2cd9e1;});})['then'](function(){_0x4ffde7[_0x8837('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59cd2d,_0x167459){return function(_0x577d32){if(!_0x577d32){_0x59cd2d[_0x8837('0x2d')](0x194);}return _0x577d32;};}function handleError(_0x462298,_0x52aac9){_0x52aac9=_0x52aac9||0x1f4;return function(_0x2e983b){logger['error'](_0x2e983b['stack']);if(_0x2e983b[_0x8837('0x3d')]){delete _0x2e983b[_0x8837('0x3d')];}_0x462298['status'](_0x52aac9)[_0x8837('0x3e')](_0x2e983b);};}exports['index']=function(_0x36d5b8,_0x5389f1){var _0x132aa8={},_0x28dc6d={},_0x485737={'count':0x0,'rows':[]};var _0x3b8b67=_['map'](db['ChatQueue']['rawAttributes'],function(_0x3736a4){return{'name':_0x3736a4[_0x8837('0x3f')],'type':_0x3736a4['type'][_0x8837('0x40')]};});_0x28dc6d['model']=_[_0x8837('0x41')](_0x3b8b67,_0x8837('0x3d'));_0x28dc6d['query']=_[_0x8837('0x42')](_0x36d5b8[_0x8837('0x43')]);_0x28dc6d[_0x8837('0x44')]=_[_0x8837('0x45')](_0x28dc6d[_0x8837('0x46')],_0x28dc6d[_0x8837('0x43')]);_0x132aa8[_0x8837('0x47')]=_[_0x8837('0x45')](_0x28dc6d[_0x8837('0x46')],qs[_0x8837('0x48')](_0x36d5b8[_0x8837('0x43')][_0x8837('0x48')]));_0x132aa8[_0x8837('0x47')]=_0x132aa8['attributes'][_0x8837('0x49')]?_0x132aa8[_0x8837('0x47')]:_0x28dc6d[_0x8837('0x46')];if(!_0x36d5b8[_0x8837('0x43')]['hasOwnProperty'](_0x8837('0x4a'))){_0x132aa8[_0x8837('0x32')]=qs[_0x8837('0x32')](_0x36d5b8['query']['limit']);_0x132aa8[_0x8837('0x31')]=qs['offset'](_0x36d5b8[_0x8837('0x43')][_0x8837('0x31')]);}_0x132aa8['order']=qs[_0x8837('0x4b')](_0x36d5b8[_0x8837('0x43')][_0x8837('0x4b')]);_0x132aa8[_0x8837('0x4c')]=qs[_0x8837('0x44')](_[_0x8837('0x4d')](_0x36d5b8[_0x8837('0x43')],_0x28dc6d[_0x8837('0x44')]),_0x3b8b67);if(_0x36d5b8[_0x8837('0x43')][_0x8837('0x4e')]){_0x132aa8[_0x8837('0x4c')]=_['merge'](_0x132aa8[_0x8837('0x4c')],{'$or':_[_0x8837('0x41')](_0x3b8b67,function(_0x1e0f3){if(_0x1e0f3[_0x8837('0x4f')]!==_0x8837('0x50')){var _0x302c23={};_0x302c23[_0x1e0f3[_0x8837('0x3d')]]={'$like':'%'+_0x36d5b8[_0x8837('0x43')][_0x8837('0x4e')]+'%'};return _0x302c23;}})});}_0x132aa8=_[_0x8837('0x51')]({},_0x132aa8,_0x36d5b8[_0x8837('0x52')]);var _0x32c56b={'where':_0x132aa8[_0x8837('0x4c')]};return db[_0x8837('0x53')][_0x8837('0x30')](_0x32c56b)[_0x8837('0x22')](function(_0x43eba5){_0x485737['count']=_0x43eba5;if(_0x36d5b8['query'][_0x8837('0x54')]){_0x132aa8[_0x8837('0x55')]=[{'all':!![]}];}return db['ChatQueue'][_0x8837('0x56')](_0x132aa8);})[_0x8837('0x22')](function(_0x3076ff){_0x485737['rows']=_0x3076ff;return _0x485737;})['then'](respondWithFilteredResult(_0x5389f1,_0x132aa8))[_0x8837('0x2c')](handleError(_0x5389f1,null));};exports[_0x8837('0x57')]=function(_0x1296f9,_0x5f3394){var _0x544ad4={'raw':!![],'where':{'id':_0x1296f9[_0x8837('0x58')]['id']}},_0x245e86={};_0x245e86[_0x8837('0x46')]=_[_0x8837('0x42')](db[_0x8837('0x53')][_0x8837('0x59')]);_0x245e86[_0x8837('0x43')]=_[_0x8837('0x42')](_0x1296f9['query']);_0x245e86[_0x8837('0x44')]=_['intersection'](_0x245e86[_0x8837('0x46')],_0x245e86['query']);_0x544ad4['attributes']=_[_0x8837('0x45')](_0x245e86[_0x8837('0x46')],qs[_0x8837('0x48')](_0x1296f9['query'][_0x8837('0x48')]));_0x544ad4[_0x8837('0x47')]=_0x544ad4[_0x8837('0x47')]['length']?_0x544ad4[_0x8837('0x47')]:_0x245e86[_0x8837('0x46')];if(_0x1296f9[_0x8837('0x43')]['includeAll']){_0x544ad4[_0x8837('0x55')]=[{'all':!![]}];}_0x544ad4=_[_0x8837('0x51')]({},_0x544ad4,_0x1296f9[_0x8837('0x52')]);return db['ChatQueue'][_0x8837('0x5a')](_0x544ad4)['then'](handleEntityNotFound(_0x5f3394,null))[_0x8837('0x22')](respondWithResult(_0x5f3394,null))['catch'](handleError(_0x5f3394,null));};exports['create']=function(_0x1dec77,_0x3f620c){return db['ChatQueue']['create'](_0x1dec77['body'],{})[_0x8837('0x22')](function(_0x1a3f4c){var _0x4ac2dc=_0x1dec77[_0x8837('0x5b')][_0x8837('0x3a')]({'plain':!![]});if(!_0x4ac2dc)throw new Error(_0x8837('0x5c'));if(_0x4ac2dc['role']===_0x8837('0x5b')){var _0x2604a2=_0x1a3f4c[_0x8837('0x3a')]({'plain':!![]});var _0x25b656=_0x8837('0x3b');return db[_0x8837('0x5d')]['find']({'where':{'name':_0x25b656,'userProfileId':_0x4ac2dc[_0x8837('0x5e')]},'raw':!![]})[_0x8837('0x22')](function(_0x202c00){if(_0x202c00&&_0x202c00[_0x8837('0x5f')]===0x0){return db[_0x8837('0x3c')]['create']({'name':_0x2604a2[_0x8837('0x3d')],'resourceId':_0x2604a2['id'],'type':_0x202c00[_0x8837('0x3d')],'sectionId':_0x202c00['id']},{})[_0x8837('0x22')](function(){return _0x1a3f4c;});}else{return _0x1a3f4c;}})[_0x8837('0x2c')](function(_0x57bb0f){logger['error'](_0x8837('0x60'),_0x57bb0f);throw _0x57bb0f;});}return _0x1a3f4c;})[_0x8837('0x22')](respondWithResult(_0x3f620c,0xc9))[_0x8837('0x2c')](handleError(_0x3f620c,null));};exports['update']=function(_0xa8e39d,_0x268bea){if(_0xa8e39d['body']['id']){delete _0xa8e39d[_0x8837('0x61')]['id'];}return db['ChatQueue'][_0x8837('0x5a')]({'where':{'id':_0xa8e39d['params']['id']}})['then'](handleEntityNotFound(_0x268bea,null))[_0x8837('0x22')](saveUpdates(_0xa8e39d['body'],null))[_0x8837('0x22')](respondWithResult(_0x268bea,null))['catch'](handleError(_0x268bea,null));};exports[_0x8837('0x39')]=function(_0x283b28,_0x5c1d59){return db[_0x8837('0x53')][_0x8837('0x5a')]({'where':{'id':_0x283b28[_0x8837('0x58')]['id']}})[_0x8837('0x22')](handleEntityNotFound(_0x5c1d59,null))['then'](removeEntity(_0x5c1d59,null))['catch'](handleError(_0x5c1d59,null));};exports[_0x8837('0x62')]=function(_0x57a1e9,_0x245254){return db['ChatQueue'][_0x8837('0x62')]()[_0x8837('0x22')](respondWithResult(_0x245254,null))[_0x8837('0x2c')](handleError(_0x245254,null));};exports[_0x8837('0x63')]=function(_0x1aab1e,_0x3fdb4d,_0x164ddd){var _0x3b7881={'raw':!![],'where':{}},_0x2b7c7d={},_0x271dd0;return db[_0x8837('0x53')][_0x8837('0x64')]({'where':{'id':_0x1aab1e[_0x8837('0x58')]['id']}})[_0x8837('0x22')](handleEntityNotFound(_0x3fdb4d,null))[_0x8837('0x22')](function(_0x12b848){if(_0x12b848){_0x271dd0=_0x12b848[_0x8837('0x3a')]({'plain':!![]});_0x2b7c7d[_0x8837('0x46')]=_['keys'](db[_0x8837('0x65')]['rawAttributes']);_0x2b7c7d[_0x8837('0x43')]=_[_0x8837('0x42')](_0x1aab1e['query']);_0x2b7c7d['filters']=_['intersection'](_0x2b7c7d[_0x8837('0x46')],_0x2b7c7d[_0x8837('0x43')]);_0x3b7881[_0x8837('0x47')]=_[_0x8837('0x45')](_0x2b7c7d[_0x8837('0x46')],qs[_0x8837('0x48')](_0x1aab1e[_0x8837('0x43')]['fields']));_0x3b7881[_0x8837('0x47')]=_0x3b7881['attributes'][_0x8837('0x49')]?_0x3b7881[_0x8837('0x47')]:_0x2b7c7d['model'];if(!_0x1aab1e[_0x8837('0x43')][_0x8837('0x66')]('nolimit')){_0x3b7881['limit']=qs[_0x8837('0x32')](_0x1aab1e['query']['limit']);_0x3b7881['offset']=qs['offset'](_0x1aab1e[_0x8837('0x43')][_0x8837('0x31')]);}_0x3b7881['order']=qs[_0x8837('0x4b')](_0x1aab1e['query'][_0x8837('0x4b')]);_0x3b7881['where']=qs['filters'](_[_0x8837('0x4d')](_0x1aab1e[_0x8837('0x43')],_0x2b7c7d['filters']));_0x3b7881[_0x8837('0x4c')][_0x8837('0x67')]=_0x12b848['id'];if(_0x1aab1e['query']['filter']){_0x3b7881[_0x8837('0x4c')]=_[_0x8837('0x51')](_0x3b7881[_0x8837('0x4c')],{'$or':_[_0x8837('0x41')](_0x3b7881[_0x8837('0x47')],function(_0x1f5668){var _0x820104={};_0x820104[_0x1f5668]={'$like':'%'+_0x1aab1e[_0x8837('0x43')][_0x8837('0x4e')]+'%'};return _0x820104;})});}_0x3b7881=_[_0x8837('0x51')]({},_0x3b7881,_0x1aab1e['options']);return db['UserChatQueue'][_0x8837('0x56')](_0x3b7881);}})['then'](function(_0x527700){if(_0x527700){return db[_0x8837('0x68')][_0x8837('0x69')]({'where':{'id':_['map'](_0x527700,_0x8837('0x6a')),'role':_0x8837('0x6b')},'attributes':['id',_0x8837('0x3d'),_0x8837('0x6c'),_0x8837('0x6d'),_0x8837('0x6e')]});}})[_0x8837('0x22')](function(_0x28fc87){if(_0x28fc87){return{'count':_0x28fc87[_0x8837('0x30')],'rows':_[_0x8837('0x41')](_0x28fc87[_0x8837('0x6f')],function(_0x13778b){return{'membername':_0x13778b[_0x8837('0x3d')],'UserId':_0x13778b['id'],'queue_name':_0x271dd0['name'],'ChatQueueId':_0x271dd0['id'],'interface':util[_0x8837('0x70')](_0x8837('0x71'),'SIP',_0x13778b[_0x8837('0x3d')]),'penalty':0x0,'paused':_0x13778b[_0x8837('0x6c')],'createdAt':_0x13778b[_0x8837('0x6e')],'updatedAt':_0x13778b[_0x8837('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3fdb4d,_0x3b7881))[_0x8837('0x2c')](handleError(_0x3fdb4d,null));};exports[_0x8837('0x72')]=function(_0x1e7978,_0x404fe1,_0x536462){var _0xcd7c27={};var _0x1d367b={};var _0x279fbb;var _0x274c71;return db[_0x8837('0x53')][_0x8837('0x64')]({'where':{'id':_0x1e7978[_0x8837('0x58')]['id']}})['then'](handleEntityNotFound(_0x404fe1,null))[_0x8837('0x22')](function(_0x344965){if(_0x344965){_0x279fbb=_0x344965;_0x1d367b[_0x8837('0x46')]=_[_0x8837('0x42')](db[_0x8837('0x73')][_0x8837('0x59')]);_0x1d367b[_0x8837('0x43')]=_[_0x8837('0x42')](_0x1e7978['query']);_0x1d367b[_0x8837('0x44')]=_[_0x8837('0x45')](_0x1d367b[_0x8837('0x46')],_0x1d367b['query']);_0xcd7c27['attributes']=_['intersection'](_0x1d367b[_0x8837('0x46')],qs[_0x8837('0x48')](_0x1e7978[_0x8837('0x43')][_0x8837('0x48')]));_0xcd7c27[_0x8837('0x47')]=_0xcd7c27[_0x8837('0x47')][_0x8837('0x49')]?_0xcd7c27[_0x8837('0x47')]:_0x1d367b[_0x8837('0x46')];_0xcd7c27['order']=qs[_0x8837('0x4b')](_0x1e7978[_0x8837('0x43')][_0x8837('0x4b')]);_0xcd7c27[_0x8837('0x4c')]=qs[_0x8837('0x44')](_['pick'](_0x1e7978[_0x8837('0x43')],_0x1d367b[_0x8837('0x44')]));if(_0x1e7978['query'][_0x8837('0x4e')]){_0xcd7c27['where']=_[_0x8837('0x51')](_0xcd7c27[_0x8837('0x4c')],{'$or':_[_0x8837('0x41')](_0xcd7c27[_0x8837('0x47')],function(_0x177f41){var _0x34fd6d={};_0x34fd6d[_0x177f41]={'$like':'%'+_0x1e7978['query'][_0x8837('0x4e')]+'%'};return _0x34fd6d;})});}_0xcd7c27=_[_0x8837('0x51')]({},_0xcd7c27,_0x1e7978[_0x8837('0x52')]);return _0x279fbb[_0x8837('0x72')](_0xcd7c27);}})[_0x8837('0x22')](function(_0x534e76){if(_0x534e76){_0x274c71=_0x534e76[_0x8837('0x49')];if(!_0x1e7978[_0x8837('0x43')][_0x8837('0x66')](_0x8837('0x4a'))){_0xcd7c27[_0x8837('0x32')]=qs[_0x8837('0x32')](_0x1e7978['query'][_0x8837('0x32')]);_0xcd7c27['offset']=qs[_0x8837('0x31')](_0x1e7978[_0x8837('0x43')][_0x8837('0x31')]);}return _0x279fbb[_0x8837('0x72')](_0xcd7c27);}})[_0x8837('0x22')](function(_0x1d4f78){if(_0x1d4f78){return _0x1d4f78?{'count':_0x274c71,'rows':_0x1d4f78}:null;}})[_0x8837('0x22')](respondWithResult(_0x404fe1,null))[_0x8837('0x2c')](handleError(_0x404fe1,null));};exports[_0x8837('0x74')]=function(_0x5f5468,_0xe5517e,_0x5789fe){var _0x4199a5=_0x5f5468[_0x8837('0x61')]['ids'];return db[_0x8837('0x73')][_0x8837('0x56')]({'where':{'id':_0x4199a5},'attributes':['id'],'include':[{'model':db[_0x8837('0x68')],'as':'Agents','attributes':['id','name',_0x8837('0x75'),_0x8837('0x76'),_0x8837('0x77')],'raw':!![]}]})[_0x8837('0x22')](function(_0x3a53b9){if(_0x3a53b9){var _0x935807=_['flatMap'](_0x3a53b9,function(_0x53e2d0){var _0x2fcec4=_0x53e2d0[_0x8837('0x3a')]({'plain':!![]});return _0x2fcec4[_0x8837('0x78')];});return db['ChatQueue'][_0x8837('0x5a')]({'where':{'id':_0x5f5468[_0x8837('0x58')]['id']}})[_0x8837('0x22')](function(_0x54287c){return db[_0x8837('0x79')][_0x8837('0x7a')](function(_0x5799d4){return _0x54287c[_0x8837('0x74')](_0x4199a5,{'transaction':_0x5799d4})['then'](function(){return BPromise[_0x8837('0x7b')](_0x935807,function(_0x105367){return db[_0x8837('0x65')][_0x8837('0x7c')]({'where':{'UserId':_0x105367['id'],'ChatQueueId':_0x5f5468[_0x8837('0x58')]['id']},'transaction':_0x5799d4});});})[_0x8837('0x22')](function(){_0x935807[_0x8837('0x7d')](function(_0x4e7b87){socket[_0x8837('0x7e')](_0x8837('0x7f'),{'UserId':_0x4e7b87['id'],'ChatQueueId':_0x54287c['id']});});});});});}})[_0x8837('0x22')](respondWithStatusCode(_0xe5517e,null))[_0x8837('0x2c')](handleError(_0xe5517e,null));};exports['removeTeams']=function(_0x44c7eb,_0x2bd51e,_0x3d5f09){return db[_0x8837('0x73')]['findAll']({'where':{'id':_0x44c7eb['query'][_0x8837('0x80')]},'attributes':['id'],'include':[{'model':db[_0x8837('0x68')],'as':_0x8837('0x78'),'attributes':['id'],'raw':!![]}]})[_0x8837('0x22')](handleEntityNotFound(_0x2bd51e,null))[_0x8837('0x22')](function(_0x22c833){var _0x943e78=_['map'](_0x22c833,'id');var _0x2cee4b=[];var _0x16a56f=[];var _0x5678c3=squel[_0x8837('0x81')]();_0x5678c3[_0x8837('0x82')]('tq.TeamId')[_0x8837('0x83')](_0x8837('0x84'),'tq')[_0x8837('0x85')](_0x8837('0x86'),'ut',_0x8837('0x87'))[_0x8837('0x4c')](_0x8837('0x88'),_0x44c7eb['params']['id']);for(var _0x5d1e56=0x0;_0x5d1e56<_0x22c833[_0x8837('0x49')];_0x5d1e56+=0x1){let _0x1d6743=_0x22c833[_0x5d1e56];for(var _0x453181=0x0;_0x453181<_0x1d6743[_0x8837('0x78')][_0x8837('0x49')];_0x453181+=0x1){let _0x306c37=_0x1d6743[_0x8837('0x78')][_0x453181];var _0x5922e7=_0x5678c3['clone']();_0x5922e7[_0x8837('0x4c')](_0x8837('0x89'),_0x306c37['id']);_0x16a56f['push'](db[_0x8837('0x79')][_0x8837('0x43')](_0x5922e7[_0x8837('0x8a')](),{'type':db[_0x8837('0x79')][_0x8837('0x8b')][_0x8837('0x8c')]})[_0x8837('0x22')](function(_0x1d1f83){if(_0x1d1f83['length']===0x1){return _0x306c37['id'];}else{var _0x583669=_[_0x8837('0x8d')](_['map'](_0x1d1f83,_0x8837('0x8e')),function(_0x39a561){return _['includes'](_0x943e78,_0x39a561);});if(_0x583669){return _0x306c37['id'];}}}));}}return BPromise[_0x8837('0x8f')](_0x16a56f)['then'](function(_0x3931f7){_0x2cee4b=_(_0x2cee4b)[_0x8837('0x90')](_0x3931f7)[_0x8837('0x91')]()[_0x8837('0x92')]();return db[_0x8837('0x53')]['find']({'where':{'id':_0x44c7eb[_0x8837('0x58')]['id']}})[_0x8837('0x22')](function(_0x417c38){return db[_0x8837('0x79')][_0x8837('0x7a')](function(_0x35eccc){return _0x417c38['removeTeams'](_0x44c7eb[_0x8837('0x43')][_0x8837('0x80')],{'transaction':_0x35eccc})['then'](function(){if(!_[_0x8837('0x93')](_0x2cee4b)){return _0x417c38[_0x8837('0x94')](_0x2cee4b,{'transaction':_0x35eccc});}})[_0x8837('0x22')](function(){_0x2cee4b[_0x8837('0x7d')](function(_0x9d0619){socket['emit'](_0x8837('0x95'),{'UserId':_0x9d0619,'ChatQueueId':_0x417c38['id']});});});});});});})['then'](respondWithStatusCode(_0x2bd51e,null))[_0x8837('0x2c')](handleError(_0x2bd51e,null));};exports[_0x8837('0x96')]=function(_0x1f32fe,_0x9369ac,_0x2deee5){return db[_0x8837('0x53')]['find']({'where':{'id':_0x1f32fe['params']['id']}})[_0x8837('0x22')](handleEntityNotFound(_0x9369ac,null))[_0x8837('0x22')](function(_0x3383cf){if(_0x3383cf){return _0x3383cf[_0x8837('0x96')](_0x1f32fe['body'][_0x8837('0x80')],_[_0x8837('0x97')](_0x1f32fe[_0x8837('0x61')],['ids','id'])||{})[_0x8837('0x98')](function(_0xeba9c1){for(var _0x510e9a=0x0;_0x510e9a<_0x1f32fe[_0x8837('0x61')][_0x8837('0x80')][_0x8837('0x49')];_0x510e9a+=0x1){socket[_0x8837('0x7e')](_0x8837('0x7f'),{'UserId':_0x1f32fe[_0x8837('0x61')][_0x8837('0x80')][_0x510e9a],'ChatQueueId':_0x1f32fe[_0x8837('0x58')]['id']});}return _0xeba9c1;});}})[_0x8837('0x22')](respondWithResult(_0x9369ac,null))[_0x8837('0x2c')](handleError(_0x9369ac,null));};exports[_0x8837('0x94')]=function(_0x53fec6,_0x1c2ef8,_0xc937ef){return db[_0x8837('0x53')][_0x8837('0x5a')]({'where':{'id':_0x53fec6[_0x8837('0x58')]['id']}})[_0x8837('0x22')](handleEntityNotFound(_0x1c2ef8,null))[_0x8837('0x22')](function(_0x3dfb10){if(_0x3dfb10){return _0x3dfb10[_0x8837('0x94')](_0x53fec6[_0x8837('0x43')][_0x8837('0x80')])[_0x8837('0x22')](function(){if(_['isArray'](_0x53fec6[_0x8837('0x43')][_0x8837('0x80')])){for(var _0x429c0a=0x0;_0x429c0a<_0x53fec6['query'][_0x8837('0x80')][_0x8837('0x49')];_0x429c0a+=0x1){socket[_0x8837('0x7e')](_0x8837('0x95'),{'UserId':Number(_0x53fec6[_0x8837('0x43')][_0x8837('0x80')][_0x429c0a]),'ChatQueueId':Number(_0x53fec6[_0x8837('0x58')]['id'])});}}else{socket[_0x8837('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x53fec6['query']['ids']),'ChatQueueId':Number(_0x53fec6['params']['id'])});}});}})[_0x8837('0x22')](respondWithStatusCode(_0x1c2ef8,null))[_0x8837('0x2c')](handleError(_0x1c2ef8,null));};exports[_0x8837('0x99')]=function(_0x2451fa,_0x1052d5,_0xed4f06){var _0x1c7cad={};var _0x411431={};var _0x4c1495;var _0x129b66;return db[_0x8837('0x53')][_0x8837('0x64')]({'where':{'id':_0x2451fa['params']['id']}})['then'](handleEntityNotFound(_0x1052d5,null))['then'](function(_0xdac633){if(_0xdac633){_0x4c1495=_0xdac633;_0x411431[_0x8837('0x46')]=_[_0x8837('0x42')](db['User']['rawAttributes']);_0x411431[_0x8837('0x43')]=_['keys'](_0x2451fa[_0x8837('0x43')]);_0x411431['filters']=_[_0x8837('0x45')](_0x411431['model'],_0x411431[_0x8837('0x43')]);_0x1c7cad[_0x8837('0x47')]=_[_0x8837('0x45')](_0x411431['model'],qs[_0x8837('0x48')](_0x2451fa['query'][_0x8837('0x48')]));_0x1c7cad[_0x8837('0x47')]=_0x1c7cad[_0x8837('0x47')][_0x8837('0x49')]?_0x1c7cad[_0x8837('0x47')]:_0x411431['model'];_0x1c7cad[_0x8837('0x9a')]=qs[_0x8837('0x4b')](_0x2451fa[_0x8837('0x43')][_0x8837('0x4b')]);_0x1c7cad[_0x8837('0x4c')]=qs[_0x8837('0x44')](_['pick'](_0x2451fa['query'],_0x411431[_0x8837('0x44')]));if(_0x2451fa[_0x8837('0x43')][_0x8837('0x4e')]){_0x1c7cad['where']=_[_0x8837('0x51')](_0x1c7cad[_0x8837('0x4c')],{'$or':_[_0x8837('0x41')](_0x1c7cad['attributes'],function(_0x1c5f4d){var _0x14de73={};_0x14de73[_0x1c5f4d]={'$like':'%'+_0x2451fa[_0x8837('0x43')][_0x8837('0x4e')]+'%'};return _0x14de73;})});}_0x1c7cad=_['merge']({},_0x1c7cad,_0x2451fa[_0x8837('0x52')]);return _0x4c1495[_0x8837('0x99')](_0x1c7cad);}})['then'](function(_0x29f468){if(_0x29f468){_0x129b66=_0x29f468[_0x8837('0x49')];if(!_0x2451fa[_0x8837('0x43')][_0x8837('0x66')](_0x8837('0x4a'))){_0x1c7cad[_0x8837('0x32')]=qs[_0x8837('0x32')](_0x2451fa['query'][_0x8837('0x32')]);_0x1c7cad[_0x8837('0x31')]=qs[_0x8837('0x31')](_0x2451fa['query'][_0x8837('0x31')]);}return _0x4c1495['getAgents'](_0x1c7cad);}})[_0x8837('0x22')](function(_0x4fd016){if(_0x4fd016){return _0x4fd016?{'count':_0x129b66,'rows':_0x4fd016}:null;}})[_0x8837('0x22')](respondWithResult(_0x1052d5,null))[_0x8837('0x2c')](handleError(_0x1052d5,null));}; \ No newline at end of file +var _0xad00=['./chatQueue.socket','register','client','http','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','ChatQueue','rawAttributes','type','key','map','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','length','include','find','create','user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','body','params','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','QueryTypes','every','includes','all','compact','value','removeTeams','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0xad00,0x7b));var _0x0ad0=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0xad00[_0x218994];return _0x3f350b;};'use strict';var emlformat=require(_0x0ad0('0x0'));var rimraf=require(_0x0ad0('0x1'));var zipdir=require(_0x0ad0('0x2'));var jsonpatch=require(_0x0ad0('0x3'));var rp=require(_0x0ad0('0x4'));var moment=require('moment');var BPromise=require(_0x0ad0('0x5'));var Mustache=require(_0x0ad0('0x6'));var util=require('util');var path=require(_0x0ad0('0x7'));var sox=require(_0x0ad0('0x8'));var csv=require(_0x0ad0('0x9'));var ejs=require(_0x0ad0('0xa'));var fs=require('fs');var fs_extra=require(_0x0ad0('0xb'));var _=require(_0x0ad0('0xc'));var squel=require('squel');var crypto=require(_0x0ad0('0xd'));var jsforce=require(_0x0ad0('0xe'));var deskjs=require(_0x0ad0('0xf'));var toCsv=require(_0x0ad0('0x9'));var querystring=require(_0x0ad0('0x10'));var Papa=require(_0x0ad0('0x11'));var Redis=require('ioredis');var authService=require(_0x0ad0('0x12'));var qs=require(_0x0ad0('0x13'));var as=require(_0x0ad0('0x14'));var hardwareService=require(_0x0ad0('0x15'));var logger=require('../../config/logger')(_0x0ad0('0x16'));var utils=require(_0x0ad0('0x17'));var config=require(_0x0ad0('0x18'));var licenseUtil=require(_0x0ad0('0x19'));var db=require('../../mysqldb')['db'];config[_0x0ad0('0x1a')]=_[_0x0ad0('0x1b')](config[_0x0ad0('0x1a')],{'host':_0x0ad0('0x1c'),'port':0x18eb});var socket=require(_0x0ad0('0x1d'))(new Redis(config[_0x0ad0('0x1a')]));require(_0x0ad0('0x1e'))[_0x0ad0('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0ad0('0x20')][_0x0ad0('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x16eba6,_0xd1f951,_0x211c09,_0xc42305){return new BPromise(function(_0x4e69ad,_0x13bb17){var _0x2b1160=_0xc42305||client;return _0x2b1160['request'](_0x16eba6,_0x211c09)['then'](function(_0x3ae9bc){logger[_0x0ad0('0x22')](_0x0ad0('0x23'),_0xd1f951,_0x0ad0('0x24'));logger[_0x0ad0('0x25')](_0x0ad0('0x26'),_0xd1f951,_0x0ad0('0x24'),JSON[_0x0ad0('0x27')](_0x3ae9bc));if(_0x3ae9bc['error']){if(_0x3ae9bc[_0x0ad0('0x28')]['code']===0x1f4){logger['error'](_0x0ad0('0x23'),_0xd1f951,_0x3ae9bc['error'][_0x0ad0('0x29')]);return _0x13bb17(_0x3ae9bc[_0x0ad0('0x28')][_0x0ad0('0x29')]);}logger[_0x0ad0('0x28')](_0x0ad0('0x23'),_0xd1f951,_0x3ae9bc['error'][_0x0ad0('0x29')]);return _0x4e69ad(_0x3ae9bc[_0x0ad0('0x28')][_0x0ad0('0x29')]);}else{logger['info'](_0x0ad0('0x23'),_0xd1f951,_0x0ad0('0x24'));_0x4e69ad(_0x3ae9bc[_0x0ad0('0x2a')][_0x0ad0('0x29')]);}})[_0x0ad0('0x2b')](function(_0x468341){logger['error'](_0x0ad0('0x23'),_0xd1f951,_0x468341);_0x13bb17(_0x468341);});});}function respondWithStatusCode(_0x3abecd,_0x1b69af){_0x1b69af=_0x1b69af||0xcc;return function(_0x47a3eb){if(_0x47a3eb){return _0x3abecd[_0x0ad0('0x2c')](_0x1b69af);}return _0x3abecd[_0x0ad0('0x2d')](_0x1b69af)[_0x0ad0('0x2e')]();};}function respondWithResult(_0x208a8d,_0x5d8410){_0x5d8410=_0x5d8410||0xc8;return function(_0x340de9){if(_0x340de9){return _0x208a8d[_0x0ad0('0x2d')](_0x5d8410)['json'](_0x340de9);}};}function respondWithFilteredResult(_0x45bbc6,_0x5a6c07){return function(_0x3b4dd7){if(_0x3b4dd7){var _0x581478=_0x3b4dd7[_0x0ad0('0x2f')],_0x4587c3=_0x5a6c07[_0x0ad0('0x30')],_0x402747=_0x5a6c07[_0x0ad0('0x30')]+_0x5a6c07[_0x0ad0('0x31')],_0x2ed63a;if(_0x402747>=_0x581478){_0x402747=_0x581478;_0x2ed63a=0xc8;}else{_0x2ed63a=0xce;}_0x45bbc6[_0x0ad0('0x2d')](_0x2ed63a);return _0x45bbc6[_0x0ad0('0x32')](_0x0ad0('0x33'),_0x4587c3+'-'+_0x402747+'/'+_0x581478)[_0x0ad0('0x34')](_0x3b4dd7);}return null;};}function patchUpdates(_0x2d65be){return function(_0x35819e){try{jsonpatch[_0x0ad0('0x35')](_0x35819e,_0x2d65be,!![]);}catch(_0x1fe336){return BPromise[_0x0ad0('0x36')](_0x1fe336);}return _0x35819e['save']();};}function saveUpdates(_0x240dc2,_0x24b70d){return function(_0x5fdab){if(_0x5fdab){return _0x5fdab[_0x0ad0('0x37')](_0x240dc2)[_0x0ad0('0x38')](function(_0x2a73b4){return _0x2a73b4;});}return null;};}function removeEntity(_0x27fedd,_0xe5c1f0){return function(_0x402740){if(_0x402740){return _0x402740[_0x0ad0('0x39')]()[_0x0ad0('0x38')](function(){var _0x4bca8e=_0x402740[_0x0ad0('0x3a')]({'plain':!![]});var _0x47e781='ChatQueues';return db[_0x0ad0('0x3b')][_0x0ad0('0x39')]({'where':{'type':_0x47e781,'resourceId':_0x4bca8e['id']}})[_0x0ad0('0x38')](function(){return _0x402740;});})[_0x0ad0('0x38')](function(){_0x27fedd['status'](0xcc)[_0x0ad0('0x2e')]();});}};}function handleEntityNotFound(_0x44ab6f,_0x1f596c){return function(_0x446ffd){if(!_0x446ffd){_0x44ab6f[_0x0ad0('0x2c')](0x194);}return _0x446ffd;};}function handleError(_0x4d6661,_0x4d605c){_0x4d605c=_0x4d605c||0x1f4;return function(_0x34bda3){logger['error'](_0x34bda3[_0x0ad0('0x3c')]);if(_0x34bda3[_0x0ad0('0x3d')]){delete _0x34bda3[_0x0ad0('0x3d')];}_0x4d6661[_0x0ad0('0x2d')](_0x4d605c)[_0x0ad0('0x3e')](_0x34bda3);};}exports['index']=function(_0x3c4316,_0x3816c6){var _0x165262={},_0x1b9104={},_0x5617c5={'count':0x0,'rows':[]};var _0x1d8033=_['map'](db[_0x0ad0('0x3f')][_0x0ad0('0x40')],function(_0x318c26){return{'name':_0x318c26['fieldName'],'type':_0x318c26[_0x0ad0('0x41')][_0x0ad0('0x42')]};});_0x1b9104['model']=_[_0x0ad0('0x43')](_0x1d8033,_0x0ad0('0x3d'));_0x1b9104[_0x0ad0('0x44')]=_[_0x0ad0('0x45')](_0x3c4316['query']);_0x1b9104['filters']=_['intersection'](_0x1b9104[_0x0ad0('0x46')],_0x1b9104[_0x0ad0('0x44')]);_0x165262[_0x0ad0('0x47')]=_[_0x0ad0('0x48')](_0x1b9104[_0x0ad0('0x46')],qs['fields'](_0x3c4316[_0x0ad0('0x44')][_0x0ad0('0x49')]));_0x165262['attributes']=_0x165262[_0x0ad0('0x47')]['length']?_0x165262[_0x0ad0('0x47')]:_0x1b9104[_0x0ad0('0x46')];if(!_0x3c4316[_0x0ad0('0x44')][_0x0ad0('0x4a')](_0x0ad0('0x4b'))){_0x165262[_0x0ad0('0x31')]=qs[_0x0ad0('0x31')](_0x3c4316[_0x0ad0('0x44')][_0x0ad0('0x31')]);_0x165262[_0x0ad0('0x30')]=qs[_0x0ad0('0x30')](_0x3c4316['query'][_0x0ad0('0x30')]);}_0x165262['order']=qs[_0x0ad0('0x4c')](_0x3c4316['query'][_0x0ad0('0x4c')]);_0x165262['where']=qs[_0x0ad0('0x4d')](_[_0x0ad0('0x4e')](_0x3c4316[_0x0ad0('0x44')],_0x1b9104['filters']),_0x1d8033);if(_0x3c4316[_0x0ad0('0x44')][_0x0ad0('0x4f')]){_0x165262[_0x0ad0('0x50')]=_[_0x0ad0('0x51')](_0x165262[_0x0ad0('0x50')],{'$or':_[_0x0ad0('0x43')](_0x1d8033,function(_0x434256){if(_0x434256['type']!==_0x0ad0('0x52')){var _0x44b1f5={};_0x44b1f5[_0x434256['name']]={'$like':'%'+_0x3c4316[_0x0ad0('0x44')][_0x0ad0('0x4f')]+'%'};return _0x44b1f5;}})});}_0x165262=_[_0x0ad0('0x51')]({},_0x165262,_0x3c4316[_0x0ad0('0x53')]);var _0xe9c3e4={'where':_0x165262['where']};return db[_0x0ad0('0x3f')]['count'](_0xe9c3e4)[_0x0ad0('0x38')](function(_0x211371){_0x5617c5[_0x0ad0('0x2f')]=_0x211371;if(_0x3c4316['query'][_0x0ad0('0x54')]){_0x165262['include']=[{'all':!![]}];}return db[_0x0ad0('0x3f')]['findAll'](_0x165262);})[_0x0ad0('0x38')](function(_0x48daad){_0x5617c5[_0x0ad0('0x55')]=_0x48daad;return _0x5617c5;})['then'](respondWithFilteredResult(_0x3816c6,_0x165262))['catch'](handleError(_0x3816c6,null));};exports[_0x0ad0('0x56')]=function(_0x23f402,_0x17e14f){var _0x111b2b={'raw':!![],'where':{'id':_0x23f402['params']['id']}},_0x3fd317={};_0x3fd317[_0x0ad0('0x46')]=_[_0x0ad0('0x45')](db['ChatQueue'][_0x0ad0('0x40')]);_0x3fd317[_0x0ad0('0x44')]=_[_0x0ad0('0x45')](_0x23f402[_0x0ad0('0x44')]);_0x3fd317[_0x0ad0('0x4d')]=_[_0x0ad0('0x48')](_0x3fd317[_0x0ad0('0x46')],_0x3fd317['query']);_0x111b2b[_0x0ad0('0x47')]=_[_0x0ad0('0x48')](_0x3fd317[_0x0ad0('0x46')],qs[_0x0ad0('0x49')](_0x23f402[_0x0ad0('0x44')][_0x0ad0('0x49')]));_0x111b2b[_0x0ad0('0x47')]=_0x111b2b['attributes'][_0x0ad0('0x57')]?_0x111b2b[_0x0ad0('0x47')]:_0x3fd317['model'];if(_0x23f402[_0x0ad0('0x44')]['includeAll']){_0x111b2b[_0x0ad0('0x58')]=[{'all':!![]}];}_0x111b2b=_[_0x0ad0('0x51')]({},_0x111b2b,_0x23f402['options']);return db['ChatQueue'][_0x0ad0('0x59')](_0x111b2b)[_0x0ad0('0x38')](handleEntityNotFound(_0x17e14f,null))[_0x0ad0('0x38')](respondWithResult(_0x17e14f,null))[_0x0ad0('0x2b')](handleError(_0x17e14f,null));};exports[_0x0ad0('0x5a')]=function(_0x1663e8,_0x9cb364){return db['ChatQueue'][_0x0ad0('0x5a')](_0x1663e8['body'],{})[_0x0ad0('0x38')](function(_0x20e768){var _0x1f079b=_0x1663e8[_0x0ad0('0x5b')][_0x0ad0('0x3a')]({'plain':!![]});if(!_0x1f079b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f079b[_0x0ad0('0x5c')]===_0x0ad0('0x5b')){var _0x418744=_0x20e768[_0x0ad0('0x3a')]({'plain':!![]});var _0x47f5d8=_0x0ad0('0x5d');return db[_0x0ad0('0x5e')][_0x0ad0('0x59')]({'where':{'name':_0x47f5d8,'userProfileId':_0x1f079b[_0x0ad0('0x5f')]},'raw':!![]})['then'](function(_0x3a9a8c){if(_0x3a9a8c&&_0x3a9a8c[_0x0ad0('0x60')]===0x0){return db[_0x0ad0('0x3b')]['create']({'name':_0x418744[_0x0ad0('0x3d')],'resourceId':_0x418744['id'],'type':_0x3a9a8c['name'],'sectionId':_0x3a9a8c['id']},{})['then'](function(){return _0x20e768;});}else{return _0x20e768;}})[_0x0ad0('0x2b')](function(_0x1624d4){logger[_0x0ad0('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1624d4);throw _0x1624d4;});}return _0x20e768;})[_0x0ad0('0x38')](respondWithResult(_0x9cb364,0xc9))[_0x0ad0('0x2b')](handleError(_0x9cb364,null));};exports[_0x0ad0('0x37')]=function(_0x5df57c,_0x305944){if(_0x5df57c[_0x0ad0('0x61')]['id']){delete _0x5df57c[_0x0ad0('0x61')]['id'];}return db[_0x0ad0('0x3f')][_0x0ad0('0x59')]({'where':{'id':_0x5df57c[_0x0ad0('0x62')]['id']}})['then'](handleEntityNotFound(_0x305944,null))[_0x0ad0('0x38')](saveUpdates(_0x5df57c['body'],null))[_0x0ad0('0x38')](respondWithResult(_0x305944,null))[_0x0ad0('0x2b')](handleError(_0x305944,null));};exports[_0x0ad0('0x39')]=function(_0x1f95cf,_0x241bb2){return db[_0x0ad0('0x3f')][_0x0ad0('0x59')]({'where':{'id':_0x1f95cf['params']['id']}})[_0x0ad0('0x38')](handleEntityNotFound(_0x241bb2,null))[_0x0ad0('0x38')](removeEntity(_0x241bb2,null))[_0x0ad0('0x2b')](handleError(_0x241bb2,null));};exports['describe']=function(_0x537ca7,_0x155782){return db[_0x0ad0('0x3f')][_0x0ad0('0x63')]()[_0x0ad0('0x38')](respondWithResult(_0x155782,null))['catch'](handleError(_0x155782,null));};exports[_0x0ad0('0x64')]=function(_0x3c985a,_0x42b80e,_0x298c9c){var _0x3387a9={'raw':!![],'where':{}},_0x408bbe={},_0x30a9eb;return db['ChatQueue'][_0x0ad0('0x65')]({'where':{'id':_0x3c985a[_0x0ad0('0x62')]['id']}})[_0x0ad0('0x38')](handleEntityNotFound(_0x42b80e,null))[_0x0ad0('0x38')](function(_0x12620a){if(_0x12620a){_0x30a9eb=_0x12620a[_0x0ad0('0x3a')]({'plain':!![]});_0x408bbe[_0x0ad0('0x46')]=_['keys'](db[_0x0ad0('0x66')][_0x0ad0('0x40')]);_0x408bbe['query']=_[_0x0ad0('0x45')](_0x3c985a[_0x0ad0('0x44')]);_0x408bbe[_0x0ad0('0x4d')]=_['intersection'](_0x408bbe[_0x0ad0('0x46')],_0x408bbe[_0x0ad0('0x44')]);_0x3387a9[_0x0ad0('0x47')]=_[_0x0ad0('0x48')](_0x408bbe[_0x0ad0('0x46')],qs[_0x0ad0('0x49')](_0x3c985a[_0x0ad0('0x44')][_0x0ad0('0x49')]));_0x3387a9['attributes']=_0x3387a9[_0x0ad0('0x47')][_0x0ad0('0x57')]?_0x3387a9[_0x0ad0('0x47')]:_0x408bbe[_0x0ad0('0x46')];if(!_0x3c985a['query'][_0x0ad0('0x4a')]('nolimit')){_0x3387a9[_0x0ad0('0x31')]=qs[_0x0ad0('0x31')](_0x3c985a['query']['limit']);_0x3387a9['offset']=qs[_0x0ad0('0x30')](_0x3c985a[_0x0ad0('0x44')][_0x0ad0('0x30')]);}_0x3387a9[_0x0ad0('0x67')]=qs[_0x0ad0('0x4c')](_0x3c985a[_0x0ad0('0x44')][_0x0ad0('0x4c')]);_0x3387a9[_0x0ad0('0x50')]=qs['filters'](_[_0x0ad0('0x4e')](_0x3c985a[_0x0ad0('0x44')],_0x408bbe[_0x0ad0('0x4d')]));_0x3387a9[_0x0ad0('0x50')][_0x0ad0('0x68')]=_0x12620a['id'];if(_0x3c985a[_0x0ad0('0x44')][_0x0ad0('0x4f')]){_0x3387a9[_0x0ad0('0x50')]=_[_0x0ad0('0x51')](_0x3387a9[_0x0ad0('0x50')],{'$or':_['map'](_0x3387a9[_0x0ad0('0x47')],function(_0x32e93e){var _0xd0b3ee={};_0xd0b3ee[_0x32e93e]={'$like':'%'+_0x3c985a[_0x0ad0('0x44')][_0x0ad0('0x4f')]+'%'};return _0xd0b3ee;})});}_0x3387a9=_[_0x0ad0('0x51')]({},_0x3387a9,_0x3c985a['options']);return db['UserChatQueue'][_0x0ad0('0x69')](_0x3387a9);}})[_0x0ad0('0x38')](function(_0x54d8c0){if(_0x54d8c0){return db[_0x0ad0('0x6a')][_0x0ad0('0x6b')]({'where':{'id':_[_0x0ad0('0x43')](_0x54d8c0,_0x0ad0('0x6c')),'role':_0x0ad0('0x6d')},'attributes':['id',_0x0ad0('0x3d'),_0x0ad0('0x6e'),_0x0ad0('0x6f'),_0x0ad0('0x70')]});}})[_0x0ad0('0x38')](function(_0x2a41ee){if(_0x2a41ee){return{'count':_0x2a41ee['count'],'rows':_[_0x0ad0('0x43')](_0x2a41ee[_0x0ad0('0x55')],function(_0xb55648){return{'membername':_0xb55648['name'],'UserId':_0xb55648['id'],'queue_name':_0x30a9eb[_0x0ad0('0x3d')],'ChatQueueId':_0x30a9eb['id'],'interface':util[_0x0ad0('0x71')](_0x0ad0('0x72'),_0x0ad0('0x73'),_0xb55648[_0x0ad0('0x3d')]),'penalty':0x0,'paused':_0xb55648[_0x0ad0('0x6e')],'createdAt':_0xb55648['createdAt'],'updatedAt':_0xb55648['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0ad0('0x38')](respondWithFilteredResult(_0x42b80e,_0x3387a9))['catch'](handleError(_0x42b80e,null));};exports[_0x0ad0('0x74')]=function(_0x1babfd,_0x257334,_0x429bc2){var _0x548b0c={};var _0x29e910={};var _0xbe8175;var _0x3db97f;return db[_0x0ad0('0x3f')][_0x0ad0('0x65')]({'where':{'id':_0x1babfd[_0x0ad0('0x62')]['id']}})[_0x0ad0('0x38')](handleEntityNotFound(_0x257334,null))[_0x0ad0('0x38')](function(_0x4e0a74){if(_0x4e0a74){_0xbe8175=_0x4e0a74;_0x29e910[_0x0ad0('0x46')]=_[_0x0ad0('0x45')](db[_0x0ad0('0x75')]['rawAttributes']);_0x29e910[_0x0ad0('0x44')]=_[_0x0ad0('0x45')](_0x1babfd[_0x0ad0('0x44')]);_0x29e910[_0x0ad0('0x4d')]=_[_0x0ad0('0x48')](_0x29e910['model'],_0x29e910[_0x0ad0('0x44')]);_0x548b0c['attributes']=_[_0x0ad0('0x48')](_0x29e910['model'],qs[_0x0ad0('0x49')](_0x1babfd['query'][_0x0ad0('0x49')]));_0x548b0c[_0x0ad0('0x47')]=_0x548b0c['attributes'][_0x0ad0('0x57')]?_0x548b0c[_0x0ad0('0x47')]:_0x29e910['model'];_0x548b0c[_0x0ad0('0x67')]=qs[_0x0ad0('0x4c')](_0x1babfd['query']['sort']);_0x548b0c['where']=qs[_0x0ad0('0x4d')](_[_0x0ad0('0x4e')](_0x1babfd[_0x0ad0('0x44')],_0x29e910['filters']));if(_0x1babfd[_0x0ad0('0x44')][_0x0ad0('0x4f')]){_0x548b0c[_0x0ad0('0x50')]=_[_0x0ad0('0x51')](_0x548b0c[_0x0ad0('0x50')],{'$or':_[_0x0ad0('0x43')](_0x548b0c['attributes'],function(_0x3d5387){var _0x2d5fbd={};_0x2d5fbd[_0x3d5387]={'$like':'%'+_0x1babfd['query'][_0x0ad0('0x4f')]+'%'};return _0x2d5fbd;})});}_0x548b0c=_['merge']({},_0x548b0c,_0x1babfd['options']);return _0xbe8175['getTeams'](_0x548b0c);}})[_0x0ad0('0x38')](function(_0x2154d3){if(_0x2154d3){_0x3db97f=_0x2154d3[_0x0ad0('0x57')];if(!_0x1babfd['query'][_0x0ad0('0x4a')](_0x0ad0('0x4b'))){_0x548b0c[_0x0ad0('0x31')]=qs[_0x0ad0('0x31')](_0x1babfd['query'][_0x0ad0('0x31')]);_0x548b0c[_0x0ad0('0x30')]=qs['offset'](_0x1babfd['query'][_0x0ad0('0x30')]);}return _0xbe8175['getTeams'](_0x548b0c);}})[_0x0ad0('0x38')](function(_0x16002f){if(_0x16002f){return _0x16002f?{'count':_0x3db97f,'rows':_0x16002f}:null;}})[_0x0ad0('0x38')](respondWithResult(_0x257334,null))[_0x0ad0('0x2b')](handleError(_0x257334,null));};exports['addTeams']=function(_0x5ec771,_0x10d950,_0x5795e0){var _0xf5dd0a=_0x5ec771['body'][_0x0ad0('0x76')];return db[_0x0ad0('0x75')]['findAll']({'where':{'id':_0xf5dd0a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0ad0('0x77'),'attributes':['id',_0x0ad0('0x3d'),_0x0ad0('0x78'),_0x0ad0('0x79'),_0x0ad0('0x7a')],'raw':!![]}]})[_0x0ad0('0x38')](function(_0x4cf7bd){if(_0x4cf7bd){var _0x3cb373=_[_0x0ad0('0x7b')](_0x4cf7bd,function(_0x3de0a5){var _0x223694=_0x3de0a5[_0x0ad0('0x3a')]({'plain':!![]});return _0x223694[_0x0ad0('0x77')];});return db[_0x0ad0('0x3f')][_0x0ad0('0x59')]({'where':{'id':_0x5ec771[_0x0ad0('0x62')]['id']}})[_0x0ad0('0x38')](function(_0x2ac1f5){return db[_0x0ad0('0x7c')][_0x0ad0('0x7d')](function(_0x43b898){return _0x2ac1f5['addTeams'](_0xf5dd0a,{'transaction':_0x43b898})[_0x0ad0('0x38')](function(){return BPromise['each'](_0x3cb373,function(_0x5a4bef){return db['UserChatQueue'][_0x0ad0('0x7e')]({'where':{'UserId':_0x5a4bef['id'],'ChatQueueId':_0x5ec771[_0x0ad0('0x62')]['id']},'transaction':_0x43b898});});})[_0x0ad0('0x38')](function(){_0x3cb373[_0x0ad0('0x7f')](function(_0x35ba57){socket[_0x0ad0('0x80')]('userChatQueue:save',{'UserId':_0x35ba57['id'],'ChatQueueId':_0x2ac1f5['id']});});});});});}})[_0x0ad0('0x38')](respondWithStatusCode(_0x10d950,null))[_0x0ad0('0x2b')](handleError(_0x10d950,null));};exports['removeTeams']=function(_0x46e84a,_0x2d5dfa,_0xe154e7){return db[_0x0ad0('0x75')][_0x0ad0('0x69')]({'where':{'id':_0x46e84a['query'][_0x0ad0('0x76')]},'attributes':['id'],'include':[{'model':db[_0x0ad0('0x6a')],'as':_0x0ad0('0x77'),'attributes':['id'],'raw':!![]}]})[_0x0ad0('0x38')](handleEntityNotFound(_0x2d5dfa,null))[_0x0ad0('0x38')](function(_0x56c597){var _0xeeb594=_[_0x0ad0('0x43')](_0x56c597,'id');var _0x46fc19=[];var _0x5a40d7=[];var _0x3a9d08=squel['select']();_0x3a9d08[_0x0ad0('0x81')](_0x0ad0('0x82'))[_0x0ad0('0x83')](_0x0ad0('0x84'),'tq')[_0x0ad0('0x85')](_0x0ad0('0x86'),'ut',_0x0ad0('0x87'))[_0x0ad0('0x50')](_0x0ad0('0x88'),_0x46e84a[_0x0ad0('0x62')]['id']);for(var _0x238485=0x0;_0x238485<_0x56c597[_0x0ad0('0x57')];_0x238485+=0x1){let _0x2ea47b=_0x56c597[_0x238485];for(var _0x36deb9=0x0;_0x36deb9<_0x2ea47b[_0x0ad0('0x77')][_0x0ad0('0x57')];_0x36deb9+=0x1){let _0x500f71=_0x2ea47b[_0x0ad0('0x77')][_0x36deb9];var _0x3a8996=_0x3a9d08[_0x0ad0('0x89')]();_0x3a8996[_0x0ad0('0x50')]('ut.UserId\x20=\x20?',_0x500f71['id']);_0x5a40d7[_0x0ad0('0x8a')](db['sequelize']['query'](_0x3a8996['toString'](),{'type':db['sequelize'][_0x0ad0('0x8b')]['SELECT']})[_0x0ad0('0x38')](function(_0x588948){if(_0x588948[_0x0ad0('0x57')]===0x1){return _0x500f71['id'];}else{var _0x549c6e=_[_0x0ad0('0x8c')](_['map'](_0x588948,'TeamId'),function(_0x8b7157){return _[_0x0ad0('0x8d')](_0xeeb594,_0x8b7157);});if(_0x549c6e){return _0x500f71['id'];}}}));}}return BPromise[_0x0ad0('0x8e')](_0x5a40d7)[_0x0ad0('0x38')](function(_0x29136f){_0x46fc19=_(_0x46fc19)['union'](_0x29136f)[_0x0ad0('0x8f')]()[_0x0ad0('0x90')]();return db[_0x0ad0('0x3f')]['find']({'where':{'id':_0x46e84a[_0x0ad0('0x62')]['id']}})['then'](function(_0x4d1f9f){return db[_0x0ad0('0x7c')][_0x0ad0('0x7d')](function(_0x13bf3d){return _0x4d1f9f[_0x0ad0('0x91')](_0x46e84a[_0x0ad0('0x44')]['ids'],{'transaction':_0x13bf3d})[_0x0ad0('0x38')](function(){if(!_['isEmpty'](_0x46fc19)){return _0x4d1f9f[_0x0ad0('0x92')](_0x46fc19,{'transaction':_0x13bf3d});}})[_0x0ad0('0x38')](function(){_0x46fc19[_0x0ad0('0x7f')](function(_0x1da785){socket[_0x0ad0('0x80')](_0x0ad0('0x93'),{'UserId':_0x1da785,'ChatQueueId':_0x4d1f9f['id']});});});});});});})[_0x0ad0('0x38')](respondWithStatusCode(_0x2d5dfa,null))[_0x0ad0('0x2b')](handleError(_0x2d5dfa,null));};exports[_0x0ad0('0x94')]=function(_0x511540,_0x2a314a,_0x207cfb){return db[_0x0ad0('0x3f')][_0x0ad0('0x59')]({'where':{'id':_0x511540[_0x0ad0('0x62')]['id']}})['then'](handleEntityNotFound(_0x2a314a,null))['then'](function(_0x46ca84){if(_0x46ca84){return _0x46ca84[_0x0ad0('0x94')](_0x511540[_0x0ad0('0x61')]['ids'],_[_0x0ad0('0x95')](_0x511540['body'],['ids','id'])||{})['spread'](function(_0x59fa41){for(var _0x5a49df=0x0;_0x5a49df<_0x511540[_0x0ad0('0x61')]['ids']['length'];_0x5a49df+=0x1){socket[_0x0ad0('0x80')](_0x0ad0('0x96'),{'UserId':_0x511540['body']['ids'][_0x5a49df],'ChatQueueId':_0x511540[_0x0ad0('0x62')]['id']});}return _0x59fa41;});}})[_0x0ad0('0x38')](respondWithResult(_0x2a314a,null))[_0x0ad0('0x2b')](handleError(_0x2a314a,null));};exports[_0x0ad0('0x92')]=function(_0x28bde6,_0x4c1400,_0x42745b){return db[_0x0ad0('0x3f')]['find']({'where':{'id':_0x28bde6['params']['id']}})[_0x0ad0('0x38')](handleEntityNotFound(_0x4c1400,null))[_0x0ad0('0x38')](function(_0x401e70){if(_0x401e70){return _0x401e70[_0x0ad0('0x92')](_0x28bde6[_0x0ad0('0x44')][_0x0ad0('0x76')])['then'](function(){if(_[_0x0ad0('0x97')](_0x28bde6[_0x0ad0('0x44')]['ids'])){for(var _0x38a7df=0x0;_0x38a7df<_0x28bde6[_0x0ad0('0x44')][_0x0ad0('0x76')]['length'];_0x38a7df+=0x1){socket[_0x0ad0('0x80')](_0x0ad0('0x93'),{'UserId':Number(_0x28bde6[_0x0ad0('0x44')][_0x0ad0('0x76')][_0x38a7df]),'ChatQueueId':Number(_0x28bde6['params']['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x28bde6['query'][_0x0ad0('0x76')]),'ChatQueueId':Number(_0x28bde6['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4c1400,null))[_0x0ad0('0x2b')](handleError(_0x4c1400,null));};exports['getAgents']=function(_0x364c1b,_0x32341b,_0x16d09e){var _0x59ef61={};var _0x18260c={};var _0x6c2e03;var _0x5e89a8;return db['ChatQueue'][_0x0ad0('0x65')]({'where':{'id':_0x364c1b[_0x0ad0('0x62')]['id']}})[_0x0ad0('0x38')](handleEntityNotFound(_0x32341b,null))['then'](function(_0x1a9e7b){if(_0x1a9e7b){_0x6c2e03=_0x1a9e7b;_0x18260c[_0x0ad0('0x46')]=_[_0x0ad0('0x45')](db[_0x0ad0('0x6a')][_0x0ad0('0x40')]);_0x18260c[_0x0ad0('0x44')]=_[_0x0ad0('0x45')](_0x364c1b['query']);_0x18260c[_0x0ad0('0x4d')]=_['intersection'](_0x18260c[_0x0ad0('0x46')],_0x18260c[_0x0ad0('0x44')]);_0x59ef61[_0x0ad0('0x47')]=_[_0x0ad0('0x48')](_0x18260c[_0x0ad0('0x46')],qs[_0x0ad0('0x49')](_0x364c1b[_0x0ad0('0x44')][_0x0ad0('0x49')]));_0x59ef61['attributes']=_0x59ef61[_0x0ad0('0x47')][_0x0ad0('0x57')]?_0x59ef61[_0x0ad0('0x47')]:_0x18260c[_0x0ad0('0x46')];_0x59ef61[_0x0ad0('0x67')]=qs[_0x0ad0('0x4c')](_0x364c1b[_0x0ad0('0x44')][_0x0ad0('0x4c')]);_0x59ef61[_0x0ad0('0x50')]=qs['filters'](_[_0x0ad0('0x4e')](_0x364c1b[_0x0ad0('0x44')],_0x18260c[_0x0ad0('0x4d')]));if(_0x364c1b[_0x0ad0('0x44')][_0x0ad0('0x4f')]){_0x59ef61[_0x0ad0('0x50')]=_['merge'](_0x59ef61[_0x0ad0('0x50')],{'$or':_[_0x0ad0('0x43')](_0x59ef61[_0x0ad0('0x47')],function(_0x2f5781){var _0x1e5ff0={};_0x1e5ff0[_0x2f5781]={'$like':'%'+_0x364c1b[_0x0ad0('0x44')][_0x0ad0('0x4f')]+'%'};return _0x1e5ff0;})});}_0x59ef61=_[_0x0ad0('0x51')]({},_0x59ef61,_0x364c1b[_0x0ad0('0x53')]);return _0x6c2e03[_0x0ad0('0x98')](_0x59ef61);}})[_0x0ad0('0x38')](function(_0x410f06){if(_0x410f06){_0x5e89a8=_0x410f06[_0x0ad0('0x57')];if(!_0x364c1b[_0x0ad0('0x44')][_0x0ad0('0x4a')](_0x0ad0('0x4b'))){_0x59ef61[_0x0ad0('0x31')]=qs['limit'](_0x364c1b[_0x0ad0('0x44')]['limit']);_0x59ef61[_0x0ad0('0x30')]=qs[_0x0ad0('0x30')](_0x364c1b[_0x0ad0('0x44')]['offset']);}return _0x6c2e03['getAgents'](_0x59ef61);}})['then'](function(_0x5d895c){if(_0x5d895c){return _0x5d895c?{'count':_0x5e89a8,'rows':_0x5d895c}:null;}})[_0x0ad0('0x38')](respondWithResult(_0x32341b,null))[_0x0ad0('0x2b')](handleError(_0x32341b,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 34d7819..ce7c1d4 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 _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0xadb5,0xad));var _0x5adb=function(_0xf2af57,_0x102b70){_0xf2af57=_0xf2af57-0x0;var _0xe1c19d=_0xadb5[_0xf2af57];return _0xe1c19d;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5adb('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatQueueEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatQueueEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatQueue[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x333a98,_0x4be3ea){var _0xfd491f=function(_0x4bc317){while(--_0x4bc317){_0x333a98['push'](_0x333a98['shift']());}};_0xfd491f(++_0x4be3ea);}(_0x5f2f,0x73));var _0xf5f2=function(_0x40fbdd,_0x11ebaa){_0x40fbdd=_0x40fbdd-0x0;var _0x51ce54=_0x5f2f[_0x40fbdd];return _0x51ce54;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index d61ed5e..6e4490e 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 _0x548b=['bluebird','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','moment'];(function(_0x22c50e,_0x4ea131){var _0x500f85=function(_0x412f7b){while(--_0x412f7b){_0x22c50e['push'](_0x22c50e['shift']());}};_0x500f85(++_0x4ea131);}(_0x548b,0x8d));var _0xb548=function(_0xd38c20,_0x307146){_0xd38c20=_0xd38c20-0x0;var _0x160ec7=_0x548b[_0xd38c20];return _0x160ec7;};'use strict';var _=require(_0xb548('0x0'));var util=require(_0xb548('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb548('0x2'));var BPromise=require(_0xb548('0x3'));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(_0xb548('0x4'));module[_0xb548('0x5')]=function(_0x46f2d4,_0x5044d8){return _0x46f2d4[_0xb548('0x6')](_0xb548('0x7'),attributes,{'tableName':_0xb548('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa114=['ChatQueue','chat_queues','util','../../config/logger','moment','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x4e76cd,_0x1d46e0){var _0x2606ee=function(_0x16a958){while(--_0x16a958){_0x4e76cd['push'](_0x4e76cd['shift']());}};_0x2606ee(++_0x1d46e0);}(_0xa114,0x115));var _0x4a11=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xa114[_0x11005e];return _0x29338f;};'use strict';var _=require('lodash');var util=require(_0x4a11('0x0'));var logger=require(_0x4a11('0x1'))('api');var moment=require(_0x4a11('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a11('0x3'));var rimraf=require(_0x4a11('0x4'));var config=require(_0x4a11('0x5'));var attributes=require(_0x4a11('0x6'));module[_0x4a11('0x7')]=function(_0x266312,_0x101891){return _0x266312[_0x4a11('0x8')](_0x4a11('0x9'),attributes,{'tableName':_0x4a11('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 9d0a6d8..d49a1f4 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 _0xf5c4=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','debug','catch','ShowChatQueue','find'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf5c4,0x1ae));var _0x4f5c=function(_0x1de5c5,_0x483c22){_0x1de5c5=_0x1de5c5-0x0;var _0x6eef90=_0xf5c4[_0x1de5c5];return _0x6eef90;};'use strict';var _=require(_0x4f5c('0x0'));var util=require(_0x4f5c('0x1'));var moment=require(_0x4f5c('0x2'));var BPromise=require(_0x4f5c('0x3'));var rs=require(_0x4f5c('0x4'));var fs=require('fs');var Redis=require(_0x4f5c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f5c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4f5c('0x7'));var jayson=require(_0x4f5c('0x8'));var client=jayson[_0x4f5c('0x9')]['http']({'port':0x232a});config[_0x4f5c('0xa')]=_[_0x4f5c('0xb')](config['redis'],{'host':_0x4f5c('0xc'),'port':0x18eb});var socket=require(_0x4f5c('0xd'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x4f5c('0xe')](socket);function respondWithRpcPromise(_0x4164a7,_0x3ff2f6,_0x1cb5b5){return new BPromise(function(_0x497ca3,_0x3dde08){return client['request'](_0x4164a7,_0x1cb5b5)[_0x4f5c('0xf')](function(_0x221386){logger[_0x4f5c('0x10')](_0x4f5c('0x11'),_0x3ff2f6,_0x4f5c('0x12'));logger['debug'](_0x4f5c('0x13'),_0x3ff2f6,'request\x20sent',JSON[_0x4f5c('0x14')](_0x221386));if(_0x221386[_0x4f5c('0x15')]){if(_0x221386['error']['code']===0x1f4){logger[_0x4f5c('0x15')](_0x4f5c('0x11'),_0x3ff2f6,_0x221386[_0x4f5c('0x15')]['message']);return _0x3dde08(_0x221386[_0x4f5c('0x15')][_0x4f5c('0x16')]);}logger['error'](_0x4f5c('0x11'),_0x3ff2f6,_0x221386[_0x4f5c('0x15')][_0x4f5c('0x16')]);return _0x497ca3(_0x221386[_0x4f5c('0x15')][_0x4f5c('0x16')]);}else{logger['info'](_0x4f5c('0x11'),_0x3ff2f6,_0x4f5c('0x12'));_0x497ca3(_0x221386[_0x4f5c('0x17')][_0x4f5c('0x16')]);}})['catch'](function(_0x43b178){logger[_0x4f5c('0x15')]('ChatQueue,\x20%s,\x20%s',_0x3ff2f6,_0x43b178);_0x3dde08(_0x43b178);});});}exports[_0x4f5c('0x18')]=function(_0x3e3c50){var _0x50d99f=this;return new Promise(function(_0x21f318,_0x300410){return db[_0x4f5c('0x19')][_0x4f5c('0x1a')]({'raw':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50[_0x4f5c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3e3c50['options']?_0x3e3c50[_0x4f5c('0x1b')][_0x4f5c('0x1c')]||null:null,'attributes':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50[_0x4f5c('0x1b')][_0x4f5c('0x1d')]||null:null,'limit':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50[_0x4f5c('0x1b')][_0x4f5c('0x1e')]||null:null,'include':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50['options'][_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x3e3c50['options'][_0x4f5c('0x1f')],function(_0x93f18){return{'model':db[_0x93f18[_0x4f5c('0x21')]],'as':_0x93f18['as'],'attributes':_0x93f18[_0x4f5c('0x1d')],'include':_0x93f18[_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x93f18[_0x4f5c('0x1f')],function(_0xf4910b){return{'model':db[_0xf4910b[_0x4f5c('0x21')]],'as':_0xf4910b['as'],'attributes':_0xf4910b[_0x4f5c('0x1d')],'include':_0xf4910b[_0x4f5c('0x1f')]?_['map'](_0xf4910b[_0x4f5c('0x1f')],function(_0x208695){return{'model':db[_0x208695[_0x4f5c('0x21')]],'as':_0x208695['as'],'attributes':_0x208695[_0x4f5c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4f5c('0xf')](function(_0x1fe00f){logger['info'](_0x4f5c('0x18'),_0x3e3c50);logger[_0x4f5c('0x22')](_0x4f5c('0x18'),_0x3e3c50,JSON['stringify'](_0x1fe00f));_0x21f318(_0x1fe00f);})[_0x4f5c('0x23')](function(_0x5ea0b6){logger['error'](_0x4f5c('0x18'),_0x5ea0b6[_0x4f5c('0x16')],_0x3e3c50);_0x300410(_0x50d99f[_0x4f5c('0x15')](0x1f4,_0x5ea0b6['message']));});});};exports[_0x4f5c('0x24')]=function(_0x553b3d){var _0x773f8c=this;return new Promise(function(_0x1600b1,_0x2d1db0){return db[_0x4f5c('0x19')][_0x4f5c('0x25')]({'raw':_0x553b3d[_0x4f5c('0x1b')]?_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x26')]===undefined?!![]:![]:!![],'where':_0x553b3d['options']?_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x1c')]||null:null,'attributes':_0x553b3d[_0x4f5c('0x1b')]?_0x553b3d[_0x4f5c('0x1b')]['attributes']||null:null,'include':_0x553b3d[_0x4f5c('0x1b')]?_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x1f')],function(_0x3e12c1){return{'model':db[_0x3e12c1[_0x4f5c('0x21')]],'as':_0x3e12c1['as'],'attributes':_0x3e12c1[_0x4f5c('0x1d')],'include':_0x3e12c1['include']?_[_0x4f5c('0x20')](_0x3e12c1[_0x4f5c('0x1f')],function(_0x10aa2f){return{'model':db[_0x10aa2f[_0x4f5c('0x21')]],'as':_0x10aa2f['as'],'attributes':_0x10aa2f['attributes'],'include':_0x10aa2f[_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x10aa2f[_0x4f5c('0x1f')],function(_0x20acde){return{'model':db[_0x20acde['model']],'as':_0x20acde['as'],'attributes':_0x20acde['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f5c('0xf')](function(_0x252842){logger[_0x4f5c('0x10')](_0x4f5c('0x24'),_0x553b3d);logger[_0x4f5c('0x22')]('ShowChatQueue',_0x553b3d,JSON['stringify'](_0x252842));_0x1600b1(_0x252842);})[_0x4f5c('0x23')](function(_0x64746d){logger['error'](_0x4f5c('0x24'),_0x64746d[_0x4f5c('0x16')],_0x553b3d);_0x2d1db0(_0x773f8c[_0x4f5c('0x15')](0x1f4,_0x64746d[_0x4f5c('0x16')]));});});}; \ No newline at end of file +var _0x9c30=['find','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowChatQueue'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x9c30,0x11a));var _0x09c3=function(_0x3345ed,_0x5b7144){_0x3345ed=_0x3345ed-0x0;var _0x310ff7=_0x9c30[_0x3345ed];return _0x310ff7;};'use strict';var _=require(_0x09c3('0x0'));var util=require('util');var moment=require(_0x09c3('0x1'));var BPromise=require(_0x09c3('0x2'));var rs=require(_0x09c3('0x3'));var fs=require('fs');var Redis=require(_0x09c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x09c3('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x09c3('0x6'));var client=jayson[_0x09c3('0x7')][_0x09c3('0x8')]({'port':0x232a});config[_0x09c3('0x9')]=_[_0x09c3('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x09c3('0xb'))(new Redis(config[_0x09c3('0x9')]));require(_0x09c3('0xc'))[_0x09c3('0xd')](socket);function respondWithRpcPromise(_0x48c629,_0x25dffd,_0x4acf0f){return new BPromise(function(_0x844e70,_0x355544){return client[_0x09c3('0xe')](_0x48c629,_0x4acf0f)['then'](function(_0x1afb76){logger[_0x09c3('0xf')](_0x09c3('0x10'),_0x25dffd,_0x09c3('0x11'));logger[_0x09c3('0x12')](_0x09c3('0x13'),_0x25dffd,_0x09c3('0x11'),JSON[_0x09c3('0x14')](_0x1afb76));if(_0x1afb76['error']){if(_0x1afb76[_0x09c3('0x15')][_0x09c3('0x16')]===0x1f4){logger[_0x09c3('0x15')]('ChatQueue,\x20%s,\x20%s',_0x25dffd,_0x1afb76[_0x09c3('0x15')][_0x09c3('0x17')]);return _0x355544(_0x1afb76[_0x09c3('0x15')][_0x09c3('0x17')]);}logger[_0x09c3('0x15')](_0x09c3('0x10'),_0x25dffd,_0x1afb76[_0x09c3('0x15')]['message']);return _0x844e70(_0x1afb76[_0x09c3('0x15')][_0x09c3('0x17')]);}else{logger[_0x09c3('0xf')](_0x09c3('0x10'),_0x25dffd,_0x09c3('0x11'));_0x844e70(_0x1afb76[_0x09c3('0x18')][_0x09c3('0x17')]);}})[_0x09c3('0x19')](function(_0x2e0ae0){logger[_0x09c3('0x15')](_0x09c3('0x10'),_0x25dffd,_0x2e0ae0);_0x355544(_0x2e0ae0);});});}exports[_0x09c3('0x1a')]=function(_0x2438a4){var _0xf2aacd=this;return new Promise(function(_0x140246,_0x40d136){return db[_0x09c3('0x1b')][_0x09c3('0x1c')]({'raw':_0x2438a4[_0x09c3('0x1d')]?_0x2438a4[_0x09c3('0x1d')][_0x09c3('0x1e')]===undefined?!![]:![]:!![],'where':_0x2438a4[_0x09c3('0x1d')]?_0x2438a4[_0x09c3('0x1d')][_0x09c3('0x1f')]||null:null,'attributes':_0x2438a4[_0x09c3('0x1d')]?_0x2438a4[_0x09c3('0x1d')][_0x09c3('0x20')]||null:null,'limit':_0x2438a4[_0x09c3('0x1d')]?_0x2438a4[_0x09c3('0x1d')][_0x09c3('0x21')]||null:null,'include':_0x2438a4[_0x09c3('0x1d')]?_0x2438a4[_0x09c3('0x1d')][_0x09c3('0x22')]?_['map'](_0x2438a4[_0x09c3('0x1d')]['include'],function(_0x6c611){return{'model':db[_0x6c611[_0x09c3('0x23')]],'as':_0x6c611['as'],'attributes':_0x6c611[_0x09c3('0x20')],'include':_0x6c611[_0x09c3('0x22')]?_[_0x09c3('0x24')](_0x6c611[_0x09c3('0x22')],function(_0x34d39f){return{'model':db[_0x34d39f[_0x09c3('0x23')]],'as':_0x34d39f['as'],'attributes':_0x34d39f[_0x09c3('0x20')],'include':_0x34d39f[_0x09c3('0x22')]?_[_0x09c3('0x24')](_0x34d39f[_0x09c3('0x22')],function(_0x1cb705){return{'model':db[_0x1cb705[_0x09c3('0x23')]],'as':_0x1cb705['as'],'attributes':_0x1cb705['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xcda27c){logger[_0x09c3('0xf')](_0x09c3('0x1a'),_0x2438a4);logger['debug']('GetChatQueue',_0x2438a4,JSON[_0x09c3('0x14')](_0xcda27c));_0x140246(_0xcda27c);})[_0x09c3('0x19')](function(_0x4d0706){logger[_0x09c3('0x15')](_0x09c3('0x1a'),_0x4d0706[_0x09c3('0x17')],_0x2438a4);_0x40d136(_0xf2aacd[_0x09c3('0x15')](0x1f4,_0x4d0706['message']));});});};exports[_0x09c3('0x25')]=function(_0x4dcb3b){var _0x32e5a3=this;return new Promise(function(_0x118382,_0x5cdabd){return db[_0x09c3('0x1b')][_0x09c3('0x26')]({'raw':_0x4dcb3b[_0x09c3('0x1d')]?_0x4dcb3b[_0x09c3('0x1d')][_0x09c3('0x1e')]===undefined?!![]:![]:!![],'where':_0x4dcb3b['options']?_0x4dcb3b[_0x09c3('0x1d')][_0x09c3('0x1f')]||null:null,'attributes':_0x4dcb3b[_0x09c3('0x1d')]?_0x4dcb3b[_0x09c3('0x1d')][_0x09c3('0x20')]||null:null,'include':_0x4dcb3b[_0x09c3('0x1d')]?_0x4dcb3b[_0x09c3('0x1d')][_0x09c3('0x22')]?_['map'](_0x4dcb3b[_0x09c3('0x1d')][_0x09c3('0x22')],function(_0x150ab3){return{'model':db[_0x150ab3[_0x09c3('0x23')]],'as':_0x150ab3['as'],'attributes':_0x150ab3[_0x09c3('0x20')],'include':_0x150ab3['include']?_['map'](_0x150ab3[_0x09c3('0x22')],function(_0x5b1787){return{'model':db[_0x5b1787[_0x09c3('0x23')]],'as':_0x5b1787['as'],'attributes':_0x5b1787[_0x09c3('0x20')],'include':_0x5b1787[_0x09c3('0x22')]?_[_0x09c3('0x24')](_0x5b1787['include'],function(_0xbfc666){return{'model':db[_0xbfc666['model']],'as':_0xbfc666['as'],'attributes':_0xbfc666[_0x09c3('0x20')]};}):[]};}):[]};}):[]:[]})[_0x09c3('0x27')](function(_0x1482fa){logger[_0x09c3('0xf')](_0x09c3('0x25'),_0x4dcb3b);logger['debug'](_0x09c3('0x25'),_0x4dcb3b,JSON[_0x09c3('0x14')](_0x1482fa));_0x118382(_0x1482fa);})['catch'](function(_0x30e6d4){logger['error'](_0x09c3('0x25'),_0x30e6d4[_0x09c3('0x17')],_0x4dcb3b);_0x5cdabd(_0x32e5a3[_0x09c3('0x15')](0x1f4,_0x30e6d4[_0x09c3('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index b4b54e7..391b11a 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 _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x3fdb17,_0x17f4c2){var _0x789375=function(_0x5c6d6f){while(--_0x5c6d6f){_0x3fdb17['push'](_0x3fdb17['shift']());}};_0x789375(++_0x17f4c2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x241424,_0x25eb5d){_0x241424=_0x241424-0x0;var _0x3da798=_0x0b0e[_0x241424];return _0x3da798;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file +var _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x3e0bad,_0x5b7658){var _0x10bd45=function(_0x4429a7){while(--_0x4429a7){_0x3e0bad['push'](_0x3e0bad['shift']());}};_0x10bd45(++_0x5b7658);}(_0x0b0e,0x187));var _0xe0b0=function(_0xdb0cc5,_0x33653a){_0xdb0cc5=_0xdb0cc5-0x0;var _0x153aa=_0x0b0e[_0xdb0cc5];return _0x153aa;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 530dd45..1c7f23a 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 _0x36d4=['create','post','addAgents','put','update','destroy','delete','removeTeams','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x38297a,_0x20f70e){var _0x6a66ac=function(_0x45b918){while(--_0x45b918){_0x38297a['push'](_0x38297a['shift']());}};_0x6a66ac(++_0x20f70e);}(_0x36d4,0x171));var _0x436d=function(_0x1ef8e0,_0x3ae209){_0x1ef8e0=_0x1ef8e0-0x0;var _0x259672=_0x36d4[_0x1ef8e0];return _0x259672;};'use strict';var multer=require('multer');var util=require(_0x436d('0x0'));var path=require(_0x436d('0x1'));var timeout=require(_0x436d('0x2'));var express=require(_0x436d('0x3'));var router=express[_0x436d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x436d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x436d('0x6'));var controller=require(_0x436d('0x7'));router[_0x436d('0x8')]('/',auth[_0x436d('0x9')](),controller[_0x436d('0xa')]);router['get'](_0x436d('0xb'),auth['isAuthenticated'](),controller[_0x436d('0xc')]);router[_0x436d('0x8')](_0x436d('0xd'),auth[_0x436d('0x9')](),controller[_0x436d('0xe')]);router[_0x436d('0x8')](_0x436d('0xf'),auth['isAuthenticated'](),controller[_0x436d('0x10')]);router[_0x436d('0x8')](_0x436d('0x11'),auth[_0x436d('0x9')](),controller[_0x436d('0x12')]);router['get'](_0x436d('0x13'),auth[_0x436d('0x9')](),controller[_0x436d('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x436d('0x15')]);router['post']('/:id/teams',auth[_0x436d('0x9')](),controller['addTeams']);router[_0x436d('0x16')](_0x436d('0x13'),auth[_0x436d('0x9')](),controller[_0x436d('0x17')]);router[_0x436d('0x18')](_0x436d('0xd'),auth[_0x436d('0x9')](),controller[_0x436d('0x19')]);router['delete'](_0x436d('0xd'),auth[_0x436d('0x9')](),controller[_0x436d('0x1a')]);router[_0x436d('0x1b')](_0x436d('0x11'),auth[_0x436d('0x9')](),controller[_0x436d('0x1c')]);router[_0x436d('0x1b')](_0x436d('0x13'),auth[_0x436d('0x9')](),controller['removeAgents']);module[_0x436d('0x1d')]=router; \ No newline at end of file +var _0x60ae=['getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','/:id','destroy','/:id/teams','removeTeams','removeAgents','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','isAuthenticated','get','/describe','describe','show','/:id/members'];(function(_0x35d294,_0x3a9b4){var _0xb9ae9a=function(_0x3c08ce){while(--_0x3c08ce){_0x35d294['push'](_0x35d294['shift']());}};_0xb9ae9a(++_0x3a9b4);}(_0x60ae,0xb0));var _0xe60a=function(_0x4706af,_0x24b450){_0x4706af=_0x4706af-0x0;var _0x2f75c4=_0x60ae[_0x4706af];return _0x2f75c4;};'use strict';var multer=require(_0xe60a('0x0'));var util=require('util');var path=require(_0xe60a('0x1'));var timeout=require(_0xe60a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe60a('0x3'));var auth=require(_0xe60a('0x4'));var interaction=require(_0xe60a('0x5'));var config=require('../../config/environment');var controller=require(_0xe60a('0x6'));router['get']('/',auth[_0xe60a('0x7')](),controller['index']);router[_0xe60a('0x8')](_0xe60a('0x9'),auth[_0xe60a('0x7')](),controller[_0xe60a('0xa')]);router[_0xe60a('0x8')]('/:id',auth[_0xe60a('0x7')](),controller[_0xe60a('0xb')]);router[_0xe60a('0x8')](_0xe60a('0xc'),auth[_0xe60a('0x7')](),controller['getMembers']);router[_0xe60a('0x8')]('/:id/teams',auth[_0xe60a('0x7')](),controller[_0xe60a('0xd')]);router[_0xe60a('0x8')](_0xe60a('0xe'),auth['isAuthenticated'](),controller[_0xe60a('0xf')]);router[_0xe60a('0x10')]('/',auth['isAuthenticated'](),controller[_0xe60a('0x11')]);router[_0xe60a('0x10')]('/:id/teams',auth[_0xe60a('0x7')](),controller[_0xe60a('0x12')]);router[_0xe60a('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xe60a('0x13')]);router['put']('/:id',auth[_0xe60a('0x7')](),controller[_0xe60a('0x14')]);router[_0xe60a('0x15')](_0xe60a('0x16'),auth[_0xe60a('0x7')](),controller[_0xe60a('0x17')]);router[_0xe60a('0x15')](_0xe60a('0x18'),auth[_0xe60a('0x7')](),controller[_0xe60a('0x19')]);router[_0xe60a('0x15')](_0xe60a('0xe'),auth['isAuthenticated'](),controller[_0xe60a('0x1a')]);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 2c7f2d6..8c8feb6 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 _0x539e=['STRING','DATE','moment','sequelize'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0x539e,0x96));var _0xe539=function(_0xc7d147,_0x5ce566){_0xc7d147=_0xc7d147-0x0;var _0x3b38fb=_0x539e[_0xc7d147];return _0x3b38fb;};'use strict';var moment=require(_0xe539('0x0'));var Sequelize=require(_0xe539('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe539('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe539('0x3')]},'leaveAt':{'type':Sequelize[_0xe539('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe539('0x3')]},'reason':{'type':Sequelize[_0xe539('0x2')]}}; \ No newline at end of file +var _0x8831=['moment','exports','STRING','DATE'];(function(_0x2e228a,_0xfaf72b){var _0x3c8d33=function(_0x126dc7){while(--_0x126dc7){_0x2e228a['push'](_0x2e228a['shift']());}};_0x3c8d33(++_0xfaf72b);}(_0x8831,0x1e0));var _0x1883=function(_0x108d5f,_0x33f82d){_0x108d5f=_0x108d5f-0x0;var _0x456ea3=_0x8831[_0x108d5f];return _0x456ea3;};'use strict';var moment=require(_0x1883('0x0'));var Sequelize=require('sequelize');module[_0x1883('0x1')]={'uniqueid':{'type':Sequelize[_0x1883('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1883('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1883('0x3')]},'acceptAt':{'type':Sequelize[_0x1883('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1883('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index edf4602..6255374 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 _0xd1aa=['length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields'];(function(_0x521aa0,_0x1a71c2){var _0x2e102c=function(_0x4cd068){while(--_0x4cd068){_0x521aa0['push'](_0x521aa0['shift']());}};_0x2e102c(++_0x1a71c2);}(_0xd1aa,0x13f));var _0xad1a=function(_0x485201,_0x3c533a){_0x485201=_0x485201-0x0;var _0x9ca98a=_0xd1aa[_0x485201];return _0x9ca98a;};'use strict';var emlformat=require(_0xad1a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xad1a('0x1'));var rp=require(_0xad1a('0x2'));var moment=require(_0xad1a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xad1a('0x4'));var util=require('util');var path=require('path');var sox=require(_0xad1a('0x5'));var csv=require('to-csv');var ejs=require(_0xad1a('0x6'));var fs=require('fs');var fs_extra=require(_0xad1a('0x7'));var _=require(_0xad1a('0x8'));var squel=require(_0xad1a('0x9'));var crypto=require(_0xad1a('0xa'));var jsforce=require(_0xad1a('0xb'));var deskjs=require(_0xad1a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xad1a('0xd'));var Papa=require('papaparse');var Redis=require(_0xad1a('0xe'));var authService=require(_0xad1a('0xf'));var qs=require(_0xad1a('0x10'));var as=require(_0xad1a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad1a('0x12'))(_0xad1a('0x13'));var utils=require('../../config/utils');var config=require(_0xad1a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xad1a('0x15'))['db'];function respondWithStatusCode(_0x5535be,_0x3a360f){_0x3a360f=_0x3a360f||0xcc;return function(_0x32a078){if(_0x32a078){return _0x5535be[_0xad1a('0x16')](_0x3a360f);}return _0x5535be[_0xad1a('0x17')](_0x3a360f)[_0xad1a('0x18')]();};}function respondWithResult(_0x2b29ca,_0x137d75){_0x137d75=_0x137d75||0xc8;return function(_0x2b38a8){if(_0x2b38a8){return _0x2b29ca[_0xad1a('0x17')](_0x137d75)[_0xad1a('0x19')](_0x2b38a8);}};}function respondWithFilteredResult(_0x36da03,_0x7983fe){return function(_0x203433){if(_0x203433){var _0x2dbff8=_0x203433[_0xad1a('0x1a')],_0x44cbe1=_0x7983fe[_0xad1a('0x1b')],_0x365ed9=_0x7983fe[_0xad1a('0x1b')]+_0x7983fe[_0xad1a('0x1c')],_0x1217c6;if(_0x365ed9>=_0x2dbff8){_0x365ed9=_0x2dbff8;_0x1217c6=0xc8;}else{_0x1217c6=0xce;}_0x36da03[_0xad1a('0x17')](_0x1217c6);return _0x36da03[_0xad1a('0x1d')](_0xad1a('0x1e'),_0x44cbe1+'-'+_0x365ed9+'/'+_0x2dbff8)[_0xad1a('0x19')](_0x203433);}return null;};}function patchUpdates(_0x56892e){return function(_0x16813c){try{jsonpatch[_0xad1a('0x1f')](_0x16813c,_0x56892e,!![]);}catch(_0x34b9af){return BPromise[_0xad1a('0x20')](_0x34b9af);}return _0x16813c[_0xad1a('0x21')]();};}function saveUpdates(_0x2f2714,_0x1a59d5){return function(_0x82254c){if(_0x82254c){return _0x82254c[_0xad1a('0x22')](_0x2f2714)[_0xad1a('0x23')](function(_0x3e53b7){return _0x3e53b7;});}return null;};}function removeEntity(_0x20acb1,_0x11f5df){return function(_0x187317){if(_0x187317){return _0x187317['destroy']()[_0xad1a('0x23')](function(){_0x20acb1[_0xad1a('0x17')](0xcc)[_0xad1a('0x18')]();});}};}function handleEntityNotFound(_0x9ac8a,_0x422fb0){return function(_0x1a0cbd){if(!_0x1a0cbd){_0x9ac8a['sendStatus'](0x194);}return _0x1a0cbd;};}function handleError(_0x18c725,_0x9f2a93){_0x9f2a93=_0x9f2a93||0x1f4;return function(_0xabd28b){logger['error'](_0xabd28b[_0xad1a('0x24')]);if(_0xabd28b[_0xad1a('0x25')]){delete _0xabd28b[_0xad1a('0x25')];}_0x18c725[_0xad1a('0x17')](_0x9f2a93)[_0xad1a('0x26')](_0xabd28b);};}exports[_0xad1a('0x27')]=function(_0x6bcc0e,_0x3438e9){var _0x3c6098={},_0x7f93fd={},_0x1b4db0={'count':0x0,'rows':[]};var _0x3d5557=_[_0xad1a('0x28')](db[_0xad1a('0x29')][_0xad1a('0x2a')],function(_0xc8fa6f){return{'name':_0xc8fa6f[_0xad1a('0x2b')],'type':_0xc8fa6f['type'][_0xad1a('0x2c')]};});_0x7f93fd[_0xad1a('0x2d')]=_[_0xad1a('0x28')](_0x3d5557,_0xad1a('0x25'));_0x7f93fd[_0xad1a('0x2e')]=_[_0xad1a('0x2f')](_0x6bcc0e['query']);_0x7f93fd['filters']=_['intersection'](_0x7f93fd[_0xad1a('0x2d')],_0x7f93fd['query']);_0x3c6098[_0xad1a('0x30')]=_[_0xad1a('0x31')](_0x7f93fd[_0xad1a('0x2d')],qs['fields'](_0x6bcc0e['query'][_0xad1a('0x32')]));_0x3c6098[_0xad1a('0x30')]=_0x3c6098[_0xad1a('0x30')][_0xad1a('0x33')]?_0x3c6098['attributes']:_0x7f93fd[_0xad1a('0x2d')];if(!_0x6bcc0e['query'][_0xad1a('0x34')]('nolimit')){_0x3c6098[_0xad1a('0x1c')]=qs['limit'](_0x6bcc0e['query'][_0xad1a('0x1c')]);_0x3c6098[_0xad1a('0x1b')]=qs[_0xad1a('0x1b')](_0x6bcc0e['query']['offset']);}_0x3c6098[_0xad1a('0x35')]=qs[_0xad1a('0x36')](_0x6bcc0e[_0xad1a('0x2e')]['sort']);_0x3c6098[_0xad1a('0x37')]=qs[_0xad1a('0x38')](_[_0xad1a('0x39')](_0x6bcc0e[_0xad1a('0x2e')],_0x7f93fd[_0xad1a('0x38')]),_0x3d5557);if(_0x6bcc0e[_0xad1a('0x2e')][_0xad1a('0x3a')]){_0x3c6098[_0xad1a('0x37')]=_[_0xad1a('0x3b')](_0x3c6098[_0xad1a('0x37')],{'$or':_['map'](_0x3d5557,function(_0x13d68e){if(_0x13d68e[_0xad1a('0x3c')]!==_0xad1a('0x3d')){var _0x3e0e4a={};_0x3e0e4a[_0x13d68e[_0xad1a('0x25')]]={'$like':'%'+_0x6bcc0e[_0xad1a('0x2e')][_0xad1a('0x3a')]+'%'};return _0x3e0e4a;}})});}_0x3c6098=_[_0xad1a('0x3b')]({},_0x3c6098,_0x6bcc0e[_0xad1a('0x3e')]);var _0x2a9f71={'where':_0x3c6098['where']};return db[_0xad1a('0x29')][_0xad1a('0x1a')](_0x2a9f71)[_0xad1a('0x23')](function(_0x290176){_0x1b4db0[_0xad1a('0x1a')]=_0x290176;if(_0x6bcc0e[_0xad1a('0x2e')][_0xad1a('0x3f')]){_0x3c6098[_0xad1a('0x40')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xad1a('0x41')](_0x3c6098);})['then'](function(_0x581fdc){_0x1b4db0['rows']=_0x581fdc;return _0x1b4db0;})['then'](respondWithFilteredResult(_0x3438e9,_0x3c6098))[_0xad1a('0x42')](handleError(_0x3438e9,null));};exports[_0xad1a('0x43')]=function(_0x14a73f,_0x3ad7f1){var _0x3487f0={'raw':!![],'where':{'id':_0x14a73f[_0xad1a('0x44')]['id']}},_0x38c594={};_0x38c594[_0xad1a('0x2d')]=_['keys'](db[_0xad1a('0x29')][_0xad1a('0x2a')]);_0x38c594[_0xad1a('0x2e')]=_[_0xad1a('0x2f')](_0x14a73f['query']);_0x38c594['filters']=_[_0xad1a('0x31')](_0x38c594[_0xad1a('0x2d')],_0x38c594[_0xad1a('0x2e')]);_0x3487f0['attributes']=_['intersection'](_0x38c594[_0xad1a('0x2d')],qs['fields'](_0x14a73f[_0xad1a('0x2e')][_0xad1a('0x32')]));_0x3487f0[_0xad1a('0x30')]=_0x3487f0[_0xad1a('0x30')][_0xad1a('0x33')]?_0x3487f0['attributes']:_0x38c594[_0xad1a('0x2d')];if(_0x14a73f[_0xad1a('0x2e')][_0xad1a('0x3f')]){_0x3487f0[_0xad1a('0x40')]=[{'all':!![]}];}_0x3487f0=_['merge']({},_0x3487f0,_0x14a73f[_0xad1a('0x3e')]);return db[_0xad1a('0x29')][_0xad1a('0x45')](_0x3487f0)[_0xad1a('0x23')](handleEntityNotFound(_0x3ad7f1,null))[_0xad1a('0x23')](respondWithResult(_0x3ad7f1,null))[_0xad1a('0x42')](handleError(_0x3ad7f1,null));};exports[_0xad1a('0x46')]=function(_0x1163bf,_0xa198a1){return db[_0xad1a('0x29')][_0xad1a('0x46')](_0x1163bf[_0xad1a('0x47')],{})[_0xad1a('0x23')](respondWithResult(_0xa198a1,0xc9))[_0xad1a('0x42')](handleError(_0xa198a1,null));};exports[_0xad1a('0x22')]=function(_0x1200ea,_0x3abdda){if(_0x1200ea[_0xad1a('0x47')]['id']){delete _0x1200ea[_0xad1a('0x47')]['id'];}return db[_0xad1a('0x29')]['find']({'where':{'id':_0x1200ea[_0xad1a('0x44')]['id']}})[_0xad1a('0x23')](handleEntityNotFound(_0x3abdda,null))['then'](saveUpdates(_0x1200ea[_0xad1a('0x47')],null))['then'](respondWithResult(_0x3abdda,null))[_0xad1a('0x42')](handleError(_0x3abdda,null));};exports[_0xad1a('0x48')]=function(_0x280527,_0x2c7acf){return db[_0xad1a('0x29')][_0xad1a('0x45')]({'where':{'id':_0x280527['params']['id']}})[_0xad1a('0x23')](handleEntityNotFound(_0x2c7acf,null))[_0xad1a('0x23')](removeEntity(_0x2c7acf,null))[_0xad1a('0x42')](handleError(_0x2c7acf,null));};exports[_0xad1a('0x49')]=function(_0x1a4a6e,_0x5743fa){return db[_0xad1a('0x29')][_0xad1a('0x49')]()[_0xad1a('0x23')](respondWithResult(_0x5743fa,null))[_0xad1a('0x42')](handleError(_0x5743fa,null));}; \ No newline at end of file +var _0x163a=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x345aed,_0x163b59){var _0x5a767a=function(_0x5a8e76){while(--_0x5a8e76){_0x345aed['push'](_0x345aed['shift']());}};_0x5a767a(++_0x163b59);}(_0x163a,0x1d7));var _0xa163=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0x163a[_0x46800d];return _0x3824cd;};'use strict';var emlformat=require(_0xa163('0x0'));var rimraf=require(_0xa163('0x1'));var zipdir=require(_0xa163('0x2'));var jsonpatch=require(_0xa163('0x3'));var rp=require(_0xa163('0x4'));var moment=require(_0xa163('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa163('0x6'));var util=require(_0xa163('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa163('0x8'));var fs=require('fs');var fs_extra=require(_0xa163('0x9'));var _=require(_0xa163('0xa'));var squel=require('squel');var crypto=require(_0xa163('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa163('0xc'));var toCsv=require(_0xa163('0xd'));var querystring=require(_0xa163('0xe'));var Papa=require(_0xa163('0xf'));var Redis=require(_0xa163('0x10'));var authService=require(_0xa163('0x11'));var qs=require(_0xa163('0x12'));var as=require(_0xa163('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa163('0x14'))(_0xa163('0x15'));var utils=require('../../config/utils');var config=require(_0xa163('0x16'));var licenseUtil=require(_0xa163('0x17'));var db=require(_0xa163('0x18'))['db'];function respondWithStatusCode(_0x394663,_0x279ac3){_0x279ac3=_0x279ac3||0xcc;return function(_0x47b217){if(_0x47b217){return _0x394663[_0xa163('0x19')](_0x279ac3);}return _0x394663[_0xa163('0x1a')](_0x279ac3)[_0xa163('0x1b')]();};}function respondWithResult(_0x2843b4,_0x1c370f){_0x1c370f=_0x1c370f||0xc8;return function(_0x20ae7b){if(_0x20ae7b){return _0x2843b4[_0xa163('0x1a')](_0x1c370f)['json'](_0x20ae7b);}};}function respondWithFilteredResult(_0x5e95ea,_0x388beb){return function(_0x44fbf3){if(_0x44fbf3){var _0x3ab7ec=_0x44fbf3[_0xa163('0x1c')],_0x5af809=_0x388beb[_0xa163('0x1d')],_0x2f8975=_0x388beb['offset']+_0x388beb[_0xa163('0x1e')],_0x218806;if(_0x2f8975>=_0x3ab7ec){_0x2f8975=_0x3ab7ec;_0x218806=0xc8;}else{_0x218806=0xce;}_0x5e95ea[_0xa163('0x1a')](_0x218806);return _0x5e95ea[_0xa163('0x1f')](_0xa163('0x20'),_0x5af809+'-'+_0x2f8975+'/'+_0x3ab7ec)[_0xa163('0x21')](_0x44fbf3);}return null;};}function patchUpdates(_0x59bd91){return function(_0x3a5844){try{jsonpatch[_0xa163('0x22')](_0x3a5844,_0x59bd91,!![]);}catch(_0x2f3a31){return BPromise['reject'](_0x2f3a31);}return _0x3a5844['save']();};}function saveUpdates(_0x3d0c5a,_0x3b3b05){return function(_0x63aa9b){if(_0x63aa9b){return _0x63aa9b[_0xa163('0x23')](_0x3d0c5a)['then'](function(_0x3c90dc){return _0x3c90dc;});}return null;};}function removeEntity(_0x228f8d,_0x17e937){return function(_0x372706){if(_0x372706){return _0x372706['destroy']()[_0xa163('0x24')](function(){_0x228f8d[_0xa163('0x1a')](0xcc)[_0xa163('0x1b')]();});}};}function handleEntityNotFound(_0x48edb9,_0x1a2883){return function(_0x2f44d9){if(!_0x2f44d9){_0x48edb9[_0xa163('0x19')](0x194);}return _0x2f44d9;};}function handleError(_0x437d79,_0x8c1fb6){_0x8c1fb6=_0x8c1fb6||0x1f4;return function(_0x1ac40f){logger[_0xa163('0x25')](_0x1ac40f[_0xa163('0x26')]);if(_0x1ac40f['name']){delete _0x1ac40f[_0xa163('0x27')];}_0x437d79[_0xa163('0x1a')](_0x8c1fb6)[_0xa163('0x28')](_0x1ac40f);};}exports[_0xa163('0x29')]=function(_0x34cf6f,_0x2f761a){var _0x27ab64={},_0xe4c1b2={},_0x1d2d0c={'count':0x0,'rows':[]};var _0x54861d=_[_0xa163('0x2a')](db[_0xa163('0x2b')][_0xa163('0x2c')],function(_0x53d0af){return{'name':_0x53d0af['fieldName'],'type':_0x53d0af[_0xa163('0x2d')]['key']};});_0xe4c1b2[_0xa163('0x2e')]=_[_0xa163('0x2a')](_0x54861d,_0xa163('0x27'));_0xe4c1b2[_0xa163('0x2f')]=_[_0xa163('0x30')](_0x34cf6f[_0xa163('0x2f')]);_0xe4c1b2[_0xa163('0x31')]=_[_0xa163('0x32')](_0xe4c1b2[_0xa163('0x2e')],_0xe4c1b2[_0xa163('0x2f')]);_0x27ab64['attributes']=_[_0xa163('0x32')](_0xe4c1b2[_0xa163('0x2e')],qs['fields'](_0x34cf6f['query'][_0xa163('0x33')]));_0x27ab64['attributes']=_0x27ab64[_0xa163('0x34')][_0xa163('0x35')]?_0x27ab64[_0xa163('0x34')]:_0xe4c1b2[_0xa163('0x2e')];if(!_0x34cf6f['query'][_0xa163('0x36')](_0xa163('0x37'))){_0x27ab64['limit']=qs[_0xa163('0x1e')](_0x34cf6f[_0xa163('0x2f')][_0xa163('0x1e')]);_0x27ab64[_0xa163('0x1d')]=qs[_0xa163('0x1d')](_0x34cf6f[_0xa163('0x2f')][_0xa163('0x1d')]);}_0x27ab64[_0xa163('0x38')]=qs['sort'](_0x34cf6f[_0xa163('0x2f')][_0xa163('0x39')]);_0x27ab64[_0xa163('0x3a')]=qs[_0xa163('0x31')](_[_0xa163('0x3b')](_0x34cf6f['query'],_0xe4c1b2[_0xa163('0x31')]),_0x54861d);if(_0x34cf6f[_0xa163('0x2f')][_0xa163('0x3c')]){_0x27ab64[_0xa163('0x3a')]=_[_0xa163('0x3d')](_0x27ab64['where'],{'$or':_[_0xa163('0x2a')](_0x54861d,function(_0x2381cd){if(_0x2381cd[_0xa163('0x2d')]!==_0xa163('0x3e')){var _0x5da21e={};_0x5da21e[_0x2381cd[_0xa163('0x27')]]={'$like':'%'+_0x34cf6f[_0xa163('0x2f')]['filter']+'%'};return _0x5da21e;}})});}_0x27ab64=_[_0xa163('0x3d')]({},_0x27ab64,_0x34cf6f[_0xa163('0x3f')]);var _0x3a6ff7={'where':_0x27ab64['where']};return db[_0xa163('0x2b')]['count'](_0x3a6ff7)['then'](function(_0x511bde){_0x1d2d0c[_0xa163('0x1c')]=_0x511bde;if(_0x34cf6f['query'][_0xa163('0x40')]){_0x27ab64[_0xa163('0x41')]=[{'all':!![]}];}return db[_0xa163('0x2b')]['findAll'](_0x27ab64);})[_0xa163('0x24')](function(_0x543dc4){_0x1d2d0c[_0xa163('0x42')]=_0x543dc4;return _0x1d2d0c;})['then'](respondWithFilteredResult(_0x2f761a,_0x27ab64))[_0xa163('0x43')](handleError(_0x2f761a,null));};exports[_0xa163('0x44')]=function(_0x26819e,_0x1f0dbd){var _0x278652={'raw':!![],'where':{'id':_0x26819e[_0xa163('0x45')]['id']}},_0x3baa00={};_0x3baa00[_0xa163('0x2e')]=_[_0xa163('0x30')](db[_0xa163('0x2b')]['rawAttributes']);_0x3baa00[_0xa163('0x2f')]=_[_0xa163('0x30')](_0x26819e['query']);_0x3baa00[_0xa163('0x31')]=_[_0xa163('0x32')](_0x3baa00['model'],_0x3baa00[_0xa163('0x2f')]);_0x278652['attributes']=_[_0xa163('0x32')](_0x3baa00[_0xa163('0x2e')],qs[_0xa163('0x33')](_0x26819e[_0xa163('0x2f')][_0xa163('0x33')]));_0x278652['attributes']=_0x278652[_0xa163('0x34')]['length']?_0x278652[_0xa163('0x34')]:_0x3baa00[_0xa163('0x2e')];if(_0x26819e[_0xa163('0x2f')][_0xa163('0x40')]){_0x278652[_0xa163('0x41')]=[{'all':!![]}];}_0x278652=_[_0xa163('0x3d')]({},_0x278652,_0x26819e[_0xa163('0x3f')]);return db['ChatQueueReport']['find'](_0x278652)[_0xa163('0x24')](handleEntityNotFound(_0x1f0dbd,null))[_0xa163('0x24')](respondWithResult(_0x1f0dbd,null))[_0xa163('0x43')](handleError(_0x1f0dbd,null));};exports[_0xa163('0x46')]=function(_0x1ca690,_0x47450c){return db[_0xa163('0x2b')][_0xa163('0x46')](_0x1ca690[_0xa163('0x47')],{})[_0xa163('0x24')](respondWithResult(_0x47450c,0xc9))['catch'](handleError(_0x47450c,null));};exports['update']=function(_0x4c65d7,_0x249a09){if(_0x4c65d7[_0xa163('0x47')]['id']){delete _0x4c65d7['body']['id'];}return db[_0xa163('0x2b')][_0xa163('0x48')]({'where':{'id':_0x4c65d7[_0xa163('0x45')]['id']}})['then'](handleEntityNotFound(_0x249a09,null))[_0xa163('0x24')](saveUpdates(_0x4c65d7[_0xa163('0x47')],null))['then'](respondWithResult(_0x249a09,null))[_0xa163('0x43')](handleError(_0x249a09,null));};exports[_0xa163('0x49')]=function(_0x528b80,_0x1fbc08){return db[_0xa163('0x2b')][_0xa163('0x48')]({'where':{'id':_0x528b80[_0xa163('0x45')]['id']}})[_0xa163('0x24')](handleEntityNotFound(_0x1fbc08,null))[_0xa163('0x24')](removeEntity(_0x1fbc08,null))[_0xa163('0x43')](handleError(_0x1fbc08,null));};exports[_0xa163('0x4a')]=function(_0x562e48,_0x5b52bf){return db[_0xa163('0x2b')][_0xa163('0x4a')]()[_0xa163('0x24')](respondWithResult(_0x5b52bf,null))[_0xa163('0x43')](handleError(_0x5b52bf,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index ba0c774..922f43f 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 _0xdf3c=['./chatQueueReport.attributes','exports','define','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3f2ba1,_0x1e22ef){var _0x457f60=function(_0x46f442){while(--_0x46f442){_0x3f2ba1['push'](_0x3f2ba1['shift']());}};_0x457f60(++_0x1e22ef);}(_0xdf3c,0x1a8));var _0xcdf3=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xdf3c[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xcdf3('0x0'));var util=require(_0xcdf3('0x1'));var logger=require('../../config/logger')(_0xcdf3('0x2'));var moment=require(_0xcdf3('0x3'));var BPromise=require(_0xcdf3('0x4'));var rp=require(_0xcdf3('0x5'));var fs=require('fs');var path=require(_0xcdf3('0x6'));var rimraf=require(_0xcdf3('0x7'));var config=require('../../config/environment');var attributes=require(_0xcdf3('0x8'));module[_0xcdf3('0x9')]=function(_0xd99a20,_0x27f33e){return _0xd99a20[_0xcdf3('0xa')]('ChatQueueReport',attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0xcdf3('0xb'),'fields':[_0xcdf3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd652=['./chatQueueReport.attributes','define','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x3080cb,_0x41a12e){var _0x4fbafa=function(_0x5bbf83){while(--_0x5bbf83){_0x3080cb['push'](_0x3080cb['shift']());}};_0x4fbafa(++_0x41a12e);}(_0xd652,0x148));var _0x2d65=function(_0x16957c,_0x4cfab2){_0x16957c=_0x16957c-0x0;var _0x3951f9=_0xd652[_0x16957c];return _0x3951f9;};'use strict';var _=require(_0x2d65('0x0'));var util=require(_0x2d65('0x1'));var logger=require(_0x2d65('0x2'))(_0x2d65('0x3'));var moment=require(_0x2d65('0x4'));var BPromise=require(_0x2d65('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2d65('0x6'));var config=require(_0x2d65('0x7'));var attributes=require(_0x2d65('0x8'));module['exports']=function(_0x39d3fa,_0x7f43ca){return _0x39d3fa[_0x2d65('0x9')]('ChatQueueReport',attributes,{'tableName':_0x2d65('0xa'),'paranoid':![],'indexes':[{'name':_0x2d65('0xb'),'fields':[_0x2d65('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 087a148..85a5951 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 _0x1b33=['result','CreateChatQueueReport','create','body','options','debug','stringify','catch','UpdateChatQueueReport','ChatQueueReport','update','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x3097ba,_0x2d99d7){var _0x261ea2=function(_0x54a626){while(--_0x54a626){_0x3097ba['push'](_0x3097ba['shift']());}};_0x261ea2(++_0x2d99d7);}(_0x1b33,0x14e));var _0x31b3=function(_0x1887af,_0x2a9707){_0x1887af=_0x1887af-0x0;var _0x54f769=_0x1b33[_0x1887af];return _0x54f769;};'use strict';var _=require(_0x31b3('0x0'));var util=require(_0x31b3('0x1'));var moment=require(_0x31b3('0x2'));var BPromise=require(_0x31b3('0x3'));var rs=require(_0x31b3('0x4'));var fs=require('fs');var Redis=require(_0x31b3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x31b3('0x6'))('rpc');var config=require(_0x31b3('0x7'));var jayson=require(_0x31b3('0x8'));var client=jayson['client'][_0x31b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12837e,_0x18e8b0,_0x2bc998){return new BPromise(function(_0x48955f,_0x2954ac){return client[_0x31b3('0xa')](_0x12837e,_0x2bc998)[_0x31b3('0xb')](function(_0x48e0eb){logger[_0x31b3('0xc')](_0x31b3('0xd'),_0x18e8b0,_0x31b3('0xe'));logger['debug'](_0x31b3('0xf'),_0x18e8b0,_0x31b3('0xe'),JSON['stringify'](_0x48e0eb));if(_0x48e0eb[_0x31b3('0x10')]){if(_0x48e0eb[_0x31b3('0x10')]['code']===0x1f4){logger['error'](_0x31b3('0xd'),_0x18e8b0,_0x48e0eb[_0x31b3('0x10')][_0x31b3('0x11')]);return _0x2954ac(_0x48e0eb[_0x31b3('0x10')][_0x31b3('0x11')]);}logger['error'](_0x31b3('0xd'),_0x18e8b0,_0x48e0eb[_0x31b3('0x10')][_0x31b3('0x11')]);return _0x48955f(_0x48e0eb[_0x31b3('0x10')][_0x31b3('0x11')]);}else{logger[_0x31b3('0xc')](_0x31b3('0xd'),_0x18e8b0,_0x31b3('0xe'));_0x48955f(_0x48e0eb[_0x31b3('0x12')][_0x31b3('0x11')]);}})['catch'](function(_0x2c400d){logger[_0x31b3('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x18e8b0,_0x2c400d);_0x2954ac(_0x2c400d);});});}exports[_0x31b3('0x13')]=function(_0x2306ce){var _0x225e7b=this;return new Promise(function(_0x4dc1dd,_0xd8ddc3){return db['ChatQueueReport'][_0x31b3('0x14')](_0x2306ce[_0x31b3('0x15')],{'raw':_0x2306ce[_0x31b3('0x16')]?_0x2306ce[_0x31b3('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4dab12){logger[_0x31b3('0xc')](_0x31b3('0x13'),_0x2306ce);logger[_0x31b3('0x17')](_0x31b3('0x13'),_0x2306ce,JSON[_0x31b3('0x18')](_0x4dab12));_0x4dc1dd(_0x4dab12);})[_0x31b3('0x19')](function(_0x1147b8){logger[_0x31b3('0x10')](_0x31b3('0x13'),_0x1147b8[_0x31b3('0x11')],_0x2306ce);_0xd8ddc3(_0x225e7b[_0x31b3('0x10')](0x1f4,_0x1147b8[_0x31b3('0x11')]));});});};exports[_0x31b3('0x1a')]=function(_0x2e4cd3){var _0x1032ae=this;return new Promise(function(_0x5235da,_0x37df72){return db[_0x31b3('0x1b')][_0x31b3('0x1c')](_0x2e4cd3[_0x31b3('0x15')],{'raw':_0x2e4cd3[_0x31b3('0x16')]?_0x2e4cd3['options'][_0x31b3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e4cd3['options']?_0x2e4cd3['options'][_0x31b3('0x1e')]||null:null,'attributes':_0x2e4cd3[_0x31b3('0x16')]?_0x2e4cd3['options'][_0x31b3('0x1f')]||null:null,'limit':_0x2e4cd3[_0x31b3('0x16')]?_0x2e4cd3[_0x31b3('0x16')]['limit']||null:null})[_0x31b3('0xb')](function(_0x3016ff){logger[_0x31b3('0xc')]('UpdateChatQueueReport',_0x2e4cd3);logger[_0x31b3('0x17')](_0x31b3('0x1a'),_0x2e4cd3,JSON['stringify'](_0x3016ff));_0x5235da(_0x3016ff);})[_0x31b3('0x19')](function(_0x342c32){logger[_0x31b3('0x10')](_0x31b3('0x1a'),_0x342c32[_0x31b3('0x11')],_0x2e4cd3);_0x37df72(_0x1032ae[_0x31b3('0x10')](0x1f4,_0x342c32['message']));});});}; \ No newline at end of file +var _0xe33d=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','where','attributes','limit'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xe33d,0x1f0));var _0xde33=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe33d[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xde33('0x0'));var moment=require('moment');var BPromise=require(_0xde33('0x1'));var rs=require(_0xde33('0x2'));var fs=require('fs');var Redis=require(_0xde33('0x3'));var db=require(_0xde33('0x4'))['db'];var utils=require(_0xde33('0x5'));var logger=require(_0xde33('0x6'))(_0xde33('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xde33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4420b6,_0x331c04,_0x4afb6b){return new BPromise(function(_0x54ec76,_0x4e8a21){return client[_0xde33('0x9')](_0x4420b6,_0x4afb6b)['then'](function(_0x4f3e40){logger['info'](_0xde33('0xa'),_0x331c04,_0xde33('0xb'));logger[_0xde33('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x331c04,'request\x20sent',JSON[_0xde33('0xd')](_0x4f3e40));if(_0x4f3e40['error']){if(_0x4f3e40[_0xde33('0xe')]['code']===0x1f4){logger[_0xde33('0xe')](_0xde33('0xa'),_0x331c04,_0x4f3e40['error'][_0xde33('0xf')]);return _0x4e8a21(_0x4f3e40['error'][_0xde33('0xf')]);}logger[_0xde33('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x331c04,_0x4f3e40[_0xde33('0xe')]['message']);return _0x54ec76(_0x4f3e40[_0xde33('0xe')][_0xde33('0xf')]);}else{logger[_0xde33('0x10')](_0xde33('0xa'),_0x331c04,_0xde33('0xb'));_0x54ec76(_0x4f3e40[_0xde33('0x11')]['message']);}})[_0xde33('0x12')](function(_0x308c0f){logger[_0xde33('0xe')](_0xde33('0xa'),_0x331c04,_0x308c0f);_0x4e8a21(_0x308c0f);});});}exports[_0xde33('0x13')]=function(_0x3fa271){var _0x770e63=this;return new Promise(function(_0x3c85f5,_0x58caff){return db[_0xde33('0x14')][_0xde33('0x15')](_0x3fa271[_0xde33('0x16')],{'raw':_0x3fa271[_0xde33('0x17')]?_0x3fa271[_0xde33('0x17')][_0xde33('0x18')]===undefined?!![]:![]:!![]})[_0xde33('0x19')](function(_0x187ee1){logger[_0xde33('0x10')](_0xde33('0x13'),_0x3fa271);logger[_0xde33('0xc')]('CreateChatQueueReport',_0x3fa271,JSON[_0xde33('0xd')](_0x187ee1));_0x3c85f5(_0x187ee1);})[_0xde33('0x12')](function(_0x46ed9e){logger[_0xde33('0xe')](_0xde33('0x13'),_0x46ed9e[_0xde33('0xf')],_0x3fa271);_0x58caff(_0x770e63[_0xde33('0xe')](0x1f4,_0x46ed9e[_0xde33('0xf')]));});});};exports[_0xde33('0x1a')]=function(_0x3532d7){var _0x497302=this;return new Promise(function(_0x320737,_0x46435d){return db['ChatQueueReport'][_0xde33('0x1b')](_0x3532d7['body'],{'raw':_0x3532d7[_0xde33('0x17')]?_0x3532d7[_0xde33('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3532d7[_0xde33('0x17')]?_0x3532d7['options'][_0xde33('0x1c')]||null:null,'attributes':_0x3532d7[_0xde33('0x17')]?_0x3532d7[_0xde33('0x17')][_0xde33('0x1d')]||null:null,'limit':_0x3532d7[_0xde33('0x17')]?_0x3532d7[_0xde33('0x17')][_0xde33('0x1e')]||null:null})[_0xde33('0x19')](function(_0x24156f){logger['info']('UpdateChatQueueReport',_0x3532d7);logger[_0xde33('0xc')](_0xde33('0x1a'),_0x3532d7,JSON[_0xde33('0xd')](_0x24156f));_0x320737(_0x24156f);})[_0xde33('0x12')](function(_0x17fb65){logger[_0xde33('0xe')](_0xde33('0x1a'),_0x17fb65[_0xde33('0xf')],_0x3532d7);_0x46435d(_0x497302[_0xde33('0xe')](0x1f4,_0x17fb65[_0xde33('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 1f3c22b..6f8b0c2 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 _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x5382de,_0x4a914f){var _0x3091be=function(_0x95b006){while(--_0x95b006){_0x5382de['push'](_0x5382de['shift']());}};_0x3091be(++_0x4a914f);}(_0x2ef3,0xba));var _0x32ef=function(_0x4ff6d5,_0x49ecfb){_0x4ff6d5=_0x4ff6d5-0x0;var _0x19d20f=_0x2ef3[_0x4ff6d5];return _0x19d20f;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x11c164,_0x2e71ad){var _0x2edd40=function(_0x4cb37c){while(--_0x4cb37c){_0x11c164['push'](_0x11c164['shift']());}};_0x2edd40(++_0x2e71ad);}(_0x7a54,0x106));var _0x47a5=function(_0x88c0f0,_0x550869){_0x88c0f0=_0x88c0f0-0x0;var _0x263123=_0x7a54[_0x88c0f0];return _0x263123;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index a96ec7a..4da7c04 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 _0x553d=['agent','queue','moment','sequelize','STRING','account'];(function(_0xee39cf,_0x3719fd){var _0x23c63b=function(_0x5eeafa){while(--_0x5eeafa){_0xee39cf['push'](_0xee39cf['shift']());}};_0x23c63b(++_0x3719fd);}(_0x553d,0xb0));var _0xd553=function(_0x1f9872,_0x14636b){_0x1f9872=_0x1f9872-0x0;var _0x3e2217=_0x553d[_0x1f9872];return _0x3e2217;};'use strict';var moment=require(_0xd553('0x0'));var Sequelize=require(_0xd553('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xd553('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd553('0x3'),_0xd553('0x4'),_0xd553('0x5')),'allowNull':![],'defaultValue':_0xd553('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x2306=['moment','sequelize','STRING','ENUM','account','agent','queue','DATE','NOW'];(function(_0x2fd767,_0x548bb9){var _0x358fda=function(_0x487003){while(--_0x487003){_0x2fd767['push'](_0x2fd767['shift']());}};_0x358fda(++_0x548bb9);}(_0x2306,0x13b));var _0x6230=function(_0x12889d,_0x1be6bf){_0x12889d=_0x12889d-0x0;var _0x492a1c=_0x2306[_0x12889d];return _0x492a1c;};'use strict';var moment=require(_0x6230('0x0'));var Sequelize=require(_0x6230('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x6230('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6230('0x3')](_0x6230('0x4'),_0x6230('0x5'),_0x6230('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x6230('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6230('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index c471ed3..2dd0dd6 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 _0x1a85=['fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','includeAll','findAll','catch','show','params','intersection','include','find','create','body','update','describe','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','model','query','keys','filters','attributes'];(function(_0x243bba,_0x1ea69f){var _0x12e696=function(_0x5d3ab5){while(--_0x5d3ab5){_0x243bba['push'](_0x243bba['shift']());}};_0x12e696(++_0x1ea69f);}(_0x1a85,0x178));var _0x51a8=function(_0x5f42f1,_0x956be5){_0x5f42f1=_0x5f42f1-0x0;var _0x5534ee=_0x1a85[_0x5f42f1];return _0x5534ee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=_0x2b8d37[_0x51a8('0x1a')],_0x2b0521=_0x10584b['offset'],_0x3fbd02=_0x10584b[_0x51a8('0x1b')]+_0x10584b[_0x51a8('0x1c')],_0x3e0603;if(_0x3fbd02>=_0x39cd45){_0x3fbd02=_0x39cd45;_0x3e0603=0xc8;}else{_0x3e0603=0xce;}_0x547d40[_0x51a8('0x18')](_0x3e0603);return _0x547d40[_0x51a8('0x1d')](_0x51a8('0x1e'),_0x2b0521+'-'+_0x3fbd02+'/'+_0x39cd45)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x5f3acf){return function(_0x1df8c2){try{jsonpatch[_0x51a8('0x1f')](_0x1df8c2,_0x5f3acf,!![]);}catch(_0x2217ce){return BPromise[_0x51a8('0x20')](_0x2217ce);}return _0x1df8c2[_0x51a8('0x21')]();};}function saveUpdates(_0x3bc044,_0x28aea0){return function(_0x3bf5b6){if(_0x3bf5b6){return _0x3bf5b6['update'](_0x3bc044)[_0x51a8('0x22')](function(_0x53438c){return _0x53438c;});}return null;};}function removeEntity(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x23')]()['then'](function(){_0xfe0ddb[_0x51a8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47f063,_0x23d26a){return function(_0x52e503){if(!_0x52e503){_0x47f063[_0x51a8('0x17')](0x194);}return _0x52e503;};}function handleError(_0x78d3d6,_0x20ef8b){_0x20ef8b=_0x20ef8b||0x1f4;return function(_0x18e2f3){logger[_0x51a8('0x24')](_0x18e2f3[_0x51a8('0x25')]);if(_0x18e2f3[_0x51a8('0x26')]){delete _0x18e2f3[_0x51a8('0x26')];}_0x78d3d6['status'](_0x20ef8b)[_0x51a8('0x27')](_0x18e2f3);};}exports[_0x51a8('0x28')]=function(_0xca5746,_0x3da187){var _0x1c150d={},_0x11aefc={},_0x1a886f={'count':0x0,'rows':[]};var _0x2742f5=_[_0x51a8('0x29')](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x347a02){return{'name':_0x347a02['fieldName'],'type':_0x347a02[_0x51a8('0x2c')]['key']};});_0x11aefc[_0x51a8('0x2d')]=_[_0x51a8('0x29')](_0x2742f5,_0x51a8('0x26'));_0x11aefc[_0x51a8('0x2e')]=_[_0x51a8('0x2f')](_0xca5746['query']);_0x11aefc[_0x51a8('0x30')]=_['intersection'](_0x11aefc[_0x51a8('0x2d')],_0x11aefc[_0x51a8('0x2e')]);_0x1c150d[_0x51a8('0x31')]=_['intersection'](_0x11aefc[_0x51a8('0x2d')],qs['fields'](_0xca5746[_0x51a8('0x2e')][_0x51a8('0x32')]));_0x1c150d[_0x51a8('0x31')]=_0x1c150d[_0x51a8('0x31')][_0x51a8('0x33')]?_0x1c150d['attributes']:_0x11aefc[_0x51a8('0x2d')];if(!_0xca5746['query'][_0x51a8('0x34')](_0x51a8('0x35'))){_0x1c150d[_0x51a8('0x1c')]=qs['limit'](_0xca5746[_0x51a8('0x2e')][_0x51a8('0x1c')]);_0x1c150d[_0x51a8('0x1b')]=qs[_0x51a8('0x1b')](_0xca5746[_0x51a8('0x2e')]['offset']);}_0x1c150d['order']=qs['sort'](_0xca5746[_0x51a8('0x2e')][_0x51a8('0x36')]);_0x1c150d['where']=qs[_0x51a8('0x30')](_['pick'](_0xca5746[_0x51a8('0x2e')],_0x11aefc[_0x51a8('0x30')]),_0x2742f5);if(_0xca5746[_0x51a8('0x2e')][_0x51a8('0x37')]){_0x1c150d[_0x51a8('0x38')]=_[_0x51a8('0x39')](_0x1c150d['where'],{'$or':_['map'](_0x2742f5,function(_0x377b4c){if(_0x377b4c['type']!=='VIRTUAL'){var _0x5df144={};_0x5df144[_0x377b4c[_0x51a8('0x26')]]={'$like':'%'+_0xca5746[_0x51a8('0x2e')][_0x51a8('0x37')]+'%'};return _0x5df144;}})});}_0x1c150d=_['merge']({},_0x1c150d,_0xca5746[_0x51a8('0x3a')]);var _0x25d772={'where':_0x1c150d[_0x51a8('0x38')]};return db[_0x51a8('0x2a')]['count'](_0x25d772)[_0x51a8('0x22')](function(_0xe6a86a){_0x1a886f[_0x51a8('0x1a')]=_0xe6a86a;if(_0xca5746['query'][_0x51a8('0x3b')]){_0x1c150d['include']=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3c')](_0x1c150d);})[_0x51a8('0x22')](function(_0x37d50b){_0x1a886f['rows']=_0x37d50b;return _0x1a886f;})[_0x51a8('0x22')](respondWithFilteredResult(_0x3da187,_0x1c150d))[_0x51a8('0x3d')](handleError(_0x3da187,null));};exports[_0x51a8('0x3e')]=function(_0x38849d,_0xa33fc){var _0x35c1c9={'raw':!![],'where':{'id':_0x38849d[_0x51a8('0x3f')]['id']}},_0x56b125={};_0x56b125[_0x51a8('0x2d')]=_['keys'](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x56b125['query']=_['keys'](_0x38849d[_0x51a8('0x2e')]);_0x56b125[_0x51a8('0x30')]=_[_0x51a8('0x40')](_0x56b125[_0x51a8('0x2d')],_0x56b125[_0x51a8('0x2e')]);_0x35c1c9[_0x51a8('0x31')]=_[_0x51a8('0x40')](_0x56b125[_0x51a8('0x2d')],qs[_0x51a8('0x32')](_0x38849d[_0x51a8('0x2e')]['fields']));_0x35c1c9[_0x51a8('0x31')]=_0x35c1c9[_0x51a8('0x31')][_0x51a8('0x33')]?_0x35c1c9[_0x51a8('0x31')]:_0x56b125[_0x51a8('0x2d')];if(_0x38849d[_0x51a8('0x2e')]['includeAll']){_0x35c1c9[_0x51a8('0x41')]=[{'all':!![]}];}_0x35c1c9=_['merge']({},_0x35c1c9,_0x38849d[_0x51a8('0x3a')]);return db[_0x51a8('0x2a')][_0x51a8('0x42')](_0x35c1c9)[_0x51a8('0x22')](handleEntityNotFound(_0xa33fc,null))[_0x51a8('0x22')](respondWithResult(_0xa33fc,null))['catch'](handleError(_0xa33fc,null));};exports['create']=function(_0x4653e3,_0x3ce04e){return db[_0x51a8('0x2a')][_0x51a8('0x43')](_0x4653e3[_0x51a8('0x44')],{})['then'](respondWithResult(_0x3ce04e,0xc9))['catch'](handleError(_0x3ce04e,null));};exports[_0x51a8('0x45')]=function(_0x108131,_0x24b205){if(_0x108131[_0x51a8('0x44')]['id']){delete _0x108131[_0x51a8('0x44')]['id'];}return db[_0x51a8('0x2a')][_0x51a8('0x42')]({'where':{'id':_0x108131[_0x51a8('0x3f')]['id']}})[_0x51a8('0x22')](handleEntityNotFound(_0x24b205,null))['then'](saveUpdates(_0x108131['body'],null))['then'](respondWithResult(_0x24b205,null))[_0x51a8('0x3d')](handleError(_0x24b205,null));};exports[_0x51a8('0x23')]=function(_0x103897,_0x5259f3){return db[_0x51a8('0x2a')][_0x51a8('0x42')]({'where':{'id':_0x103897['params']['id']}})[_0x51a8('0x22')](handleEntityNotFound(_0x5259f3,null))['then'](removeEntity(_0x5259f3,null))['catch'](handleError(_0x5259f3,null));};exports[_0x51a8('0x46')]=function(_0x4393c9,_0x41dd1f){return db['ChatTransferReport']['describe']()[_0x51a8('0x22')](respondWithResult(_0x41dd1f,null))['catch'](handleError(_0x41dd1f,null));}; \ No newline at end of file +var _0x66fa=['bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0xe89d97,_0x33e5ac){var _0x1b6e5d=function(_0x5618cb){while(--_0x5618cb){_0xe89d97['push'](_0xe89d97['shift']());}};_0x1b6e5d(++_0x33e5ac);}(_0x66fa,0x117));var _0xa66f=function(_0x3bcbef,_0x3b0d92){_0x3bcbef=_0x3bcbef-0x0;var _0x2dbf3b=_0x66fa[_0x3bcbef];return _0x2dbf3b;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=_0xd348f9[_0xa66f('0x18')],_0x5510dc=_0x236d64[_0xa66f('0x19')],_0x19b5ac=_0x236d64['offset']+_0x236d64[_0xa66f('0x1a')],_0x32d338;if(_0x19b5ac>=_0x567d4f){_0x19b5ac=_0x567d4f;_0x32d338=0xc8;}else{_0x32d338=0xce;}_0x267129['status'](_0x32d338);return _0x267129['set'](_0xa66f('0x1b'),_0x5510dc+'-'+_0x19b5ac+'/'+_0x567d4f)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x342477){return function(_0x355ddc){try{jsonpatch[_0xa66f('0x1c')](_0x355ddc,_0x342477,!![]);}catch(_0x408bc7){return BPromise[_0xa66f('0x1d')](_0x408bc7);}return _0x355ddc[_0xa66f('0x1e')]();};}function saveUpdates(_0x2033a4,_0x2d9602){return function(_0x235b61){if(_0x235b61){return _0x235b61[_0xa66f('0x1f')](_0x2033a4)[_0xa66f('0x20')](function(_0x2e75ab){return _0x2e75ab;});}return null;};}function removeEntity(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')]()[_0xa66f('0x20')](function(){_0x82924d[_0xa66f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x337602,_0x473822){return function(_0x209f4d){if(!_0x209f4d){_0x337602[_0xa66f('0x22')](0x194);}return _0x209f4d;};}function handleError(_0x502e21,_0x5e9639){_0x5e9639=_0x5e9639||0x1f4;return function(_0xed98b9){logger['error'](_0xed98b9[_0xa66f('0x23')]);if(_0xed98b9[_0xa66f('0x24')]){delete _0xed98b9[_0xa66f('0x24')];}_0x502e21['status'](_0x5e9639)[_0xa66f('0x25')](_0xed98b9);};}exports[_0xa66f('0x26')]=function(_0x13495f,_0x238eb2){var _0x17c103={},_0x236046={},_0x1eb86a={'count':0x0,'rows':[]};var _0xea2c89=_[_0xa66f('0x27')](db[_0xa66f('0x28')][_0xa66f('0x29')],function(_0x63650b){return{'name':_0x63650b[_0xa66f('0x2a')],'type':_0x63650b[_0xa66f('0x2b')]['key']};});_0x236046['model']=_[_0xa66f('0x27')](_0xea2c89,_0xa66f('0x24'));_0x236046['query']=_[_0xa66f('0x2c')](_0x13495f[_0xa66f('0x2d')]);_0x236046['filters']=_[_0xa66f('0x2e')](_0x236046[_0xa66f('0x2f')],_0x236046[_0xa66f('0x2d')]);_0x17c103[_0xa66f('0x30')]=_[_0xa66f('0x2e')](_0x236046['model'],qs[_0xa66f('0x31')](_0x13495f['query'][_0xa66f('0x31')]));_0x17c103[_0xa66f('0x30')]=_0x17c103[_0xa66f('0x30')]['length']?_0x17c103[_0xa66f('0x30')]:_0x236046[_0xa66f('0x2f')];if(!_0x13495f['query'][_0xa66f('0x32')](_0xa66f('0x33'))){_0x17c103[_0xa66f('0x1a')]=qs[_0xa66f('0x1a')](_0x13495f[_0xa66f('0x2d')][_0xa66f('0x1a')]);_0x17c103[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x13495f[_0xa66f('0x2d')][_0xa66f('0x19')]);}_0x17c103['order']=qs[_0xa66f('0x34')](_0x13495f['query'][_0xa66f('0x34')]);_0x17c103[_0xa66f('0x35')]=qs[_0xa66f('0x36')](_[_0xa66f('0x37')](_0x13495f[_0xa66f('0x2d')],_0x236046[_0xa66f('0x36')]),_0xea2c89);if(_0x13495f[_0xa66f('0x2d')][_0xa66f('0x38')]){_0x17c103['where']=_[_0xa66f('0x39')](_0x17c103['where'],{'$or':_[_0xa66f('0x27')](_0xea2c89,function(_0x45eeb8){if(_0x45eeb8[_0xa66f('0x2b')]!=='VIRTUAL'){var _0x4d60f9={};_0x4d60f9[_0x45eeb8[_0xa66f('0x24')]]={'$like':'%'+_0x13495f[_0xa66f('0x2d')][_0xa66f('0x38')]+'%'};return _0x4d60f9;}})});}_0x17c103=_[_0xa66f('0x39')]({},_0x17c103,_0x13495f[_0xa66f('0x3a')]);var _0x581dca={'where':_0x17c103['where']};return db['ChatTransferReport'][_0xa66f('0x18')](_0x581dca)['then'](function(_0x4d2d27){_0x1eb86a['count']=_0x4d2d27;if(_0x13495f[_0xa66f('0x2d')]['includeAll']){_0x17c103[_0xa66f('0x3b')]=[{'all':!![]}];}return db[_0xa66f('0x28')][_0xa66f('0x3c')](_0x17c103);})[_0xa66f('0x20')](function(_0xd65c5d){_0x1eb86a[_0xa66f('0x3d')]=_0xd65c5d;return _0x1eb86a;})[_0xa66f('0x20')](respondWithFilteredResult(_0x238eb2,_0x17c103))[_0xa66f('0x3e')](handleError(_0x238eb2,null));};exports[_0xa66f('0x3f')]=function(_0x2f2a98,_0x3a7929){var _0x93f6ff={'raw':!![],'where':{'id':_0x2f2a98[_0xa66f('0x40')]['id']}},_0x17e803={};_0x17e803['model']=_[_0xa66f('0x2c')](db[_0xa66f('0x28')]['rawAttributes']);_0x17e803[_0xa66f('0x2d')]=_['keys'](_0x2f2a98[_0xa66f('0x2d')]);_0x17e803[_0xa66f('0x36')]=_['intersection'](_0x17e803[_0xa66f('0x2f')],_0x17e803[_0xa66f('0x2d')]);_0x93f6ff[_0xa66f('0x30')]=_['intersection'](_0x17e803[_0xa66f('0x2f')],qs['fields'](_0x2f2a98[_0xa66f('0x2d')][_0xa66f('0x31')]));_0x93f6ff[_0xa66f('0x30')]=_0x93f6ff[_0xa66f('0x30')][_0xa66f('0x41')]?_0x93f6ff[_0xa66f('0x30')]:_0x17e803[_0xa66f('0x2f')];if(_0x2f2a98['query'][_0xa66f('0x42')]){_0x93f6ff[_0xa66f('0x3b')]=[{'all':!![]}];}_0x93f6ff=_[_0xa66f('0x39')]({},_0x93f6ff,_0x2f2a98[_0xa66f('0x3a')]);return db[_0xa66f('0x28')]['find'](_0x93f6ff)['then'](handleEntityNotFound(_0x3a7929,null))[_0xa66f('0x20')](respondWithResult(_0x3a7929,null))[_0xa66f('0x3e')](handleError(_0x3a7929,null));};exports[_0xa66f('0x43')]=function(_0x46d421,_0xbd0a48){return db[_0xa66f('0x28')]['create'](_0x46d421[_0xa66f('0x44')],{})[_0xa66f('0x20')](respondWithResult(_0xbd0a48,0xc9))[_0xa66f('0x3e')](handleError(_0xbd0a48,null));};exports['update']=function(_0x57c8a0,_0x4568f7){if(_0x57c8a0[_0xa66f('0x44')]['id']){delete _0x57c8a0[_0xa66f('0x44')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x57c8a0['params']['id']}})[_0xa66f('0x20')](handleEntityNotFound(_0x4568f7,null))[_0xa66f('0x20')](saveUpdates(_0x57c8a0[_0xa66f('0x44')],null))[_0xa66f('0x20')](respondWithResult(_0x4568f7,null))[_0xa66f('0x3e')](handleError(_0x4568f7,null));};exports[_0xa66f('0x21')]=function(_0x164242,_0x15de06){return db['ChatTransferReport'][_0xa66f('0x45')]({'where':{'id':_0x164242[_0xa66f('0x40')]['id']}})[_0xa66f('0x20')](handleEntityNotFound(_0x15de06,null))[_0xa66f('0x20')](removeEntity(_0x15de06,null))[_0xa66f('0x3e')](handleError(_0x15de06,null));};exports[_0xa66f('0x46')]=function(_0x56379e,_0x1840af){return db[_0xa66f('0x28')][_0xa66f('0x46')]()[_0xa66f('0x20')](respondWithResult(_0x1840af,null))[_0xa66f('0x3e')](handleError(_0x1840af,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 100c67f..6e9c551 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 _0xa8ca=['ChatTransferReport','report_chat_transfer','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x130b3a,_0x333f36){var _0x15604c=function(_0x3db4fc){while(--_0x3db4fc){_0x130b3a['push'](_0x130b3a['shift']());}};_0x15604c(++_0x333f36);}(_0xa8ca,0x12b));var _0xaa8c=function(_0x1b18f3,_0x2b4731){_0x1b18f3=_0x1b18f3-0x0;var _0x13636a=_0xa8ca[_0x1b18f3];return _0x13636a;};'use strict';var _=require(_0xaa8c('0x0'));var util=require('util');var logger=require(_0xaa8c('0x1'))('api');var moment=require(_0xaa8c('0x2'));var BPromise=require(_0xaa8c('0x3'));var rp=require(_0xaa8c('0x4'));var fs=require('fs');var path=require(_0xaa8c('0x5'));var rimraf=require(_0xaa8c('0x6'));var config=require(_0xaa8c('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xaa8c('0x8')]=function(_0x25dfbc,_0x57a316){return _0x25dfbc['define'](_0xaa8c('0x9'),attributes,{'tableName':_0xaa8c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd318=['api','moment','bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x1e7bfc,_0x1ec86c){var _0x1bf0d2=function(_0x4243af){while(--_0x4243af){_0x1e7bfc['push'](_0x1e7bfc['shift']());}};_0x1bf0d2(++_0x1ec86c);}(_0xd318,0x75));var _0x8d31=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd318[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x8d31('0x0'));var util=require(_0x8d31('0x1'));var logger=require(_0x8d31('0x2'))(_0x8d31('0x3'));var moment=require(_0x8d31('0x4'));var BPromise=require(_0x8d31('0x5'));var rp=require(_0x8d31('0x6'));var fs=require('fs');var path=require(_0x8d31('0x7'));var rimraf=require('rimraf');var config=require(_0x8d31('0x8'));var attributes=require(_0x8d31('0x9'));module[_0x8d31('0xa')]=function(_0x278556,_0x1a90c5){return _0x278556[_0x8d31('0xb')](_0x8d31('0xc'),attributes,{'tableName':_0x8d31('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8d31('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 47c2f5f..d4d1182 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 _0x300b=['client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5ee42c,_0xe41e8a){var _0x1b93d7=function(_0x2f1b13){while(--_0x2f1b13){_0x5ee42c['push'](_0x5ee42c['shift']());}};_0x1b93d7(++_0xe41e8a);}(_0x300b,0x1c4));var _0xb300=function(_0x583317,_0x5ef56f){_0x583317=_0x583317-0x0;var _0x36e657=_0x300b[_0x583317];return _0x36e657;};'use strict';var _=require(_0xb300('0x0'));var util=require(_0xb300('0x1'));var moment=require(_0xb300('0x2'));var BPromise=require(_0xb300('0x3'));var rs=require(_0xb300('0x4'));var fs=require('fs');var Redis=require(_0xb300('0x5'));var db=require(_0xb300('0x6'))['db'];var utils=require(_0xb300('0x7'));var logger=require(_0xb300('0x8'))(_0xb300('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb300('0xa')][_0xb300('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ccf07,_0x29b9ca,_0x1842fd){return new BPromise(function(_0x424062,_0x357d54){return client['request'](_0x4ccf07,_0x1842fd)[_0xb300('0xc')](function(_0x1d38eb){logger[_0xb300('0xd')](_0xb300('0xe'),_0x29b9ca,_0xb300('0xf'));logger[_0xb300('0x10')](_0xb300('0x11'),_0x29b9ca,_0xb300('0xf'),JSON['stringify'](_0x1d38eb));if(_0x1d38eb[_0xb300('0x12')]){if(_0x1d38eb[_0xb300('0x12')][_0xb300('0x13')]===0x1f4){logger[_0xb300('0x12')](_0xb300('0xe'),_0x29b9ca,_0x1d38eb[_0xb300('0x12')][_0xb300('0x14')]);return _0x357d54(_0x1d38eb[_0xb300('0x12')][_0xb300('0x14')]);}logger[_0xb300('0x12')](_0xb300('0xe'),_0x29b9ca,_0x1d38eb['error']['message']);return _0x424062(_0x1d38eb[_0xb300('0x12')]['message']);}else{logger[_0xb300('0xd')](_0xb300('0xe'),_0x29b9ca,_0xb300('0xf'));_0x424062(_0x1d38eb[_0xb300('0x15')][_0xb300('0x14')]);}})['catch'](function(_0x22a244){logger[_0xb300('0x12')](_0xb300('0xe'),_0x29b9ca,_0x22a244);_0x357d54(_0x22a244);});});} \ No newline at end of file +var _0xab46=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x64b9b6,_0x15d103){var _0x113353=function(_0x377162){while(--_0x377162){_0x64b9b6['push'](_0x64b9b6['shift']());}};_0x113353(++_0x15d103);}(_0xab46,0x190));var _0x6ab4=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xab46[_0x34021d];return _0x16597b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6ab4('0x0'));var rs=require(_0x6ab4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ab4('0x2'))['db'];var utils=require(_0x6ab4('0x3'));var logger=require(_0x6ab4('0x4'))('rpc');var config=require(_0x6ab4('0x5'));var jayson=require(_0x6ab4('0x6'));var client=jayson[_0x6ab4('0x7')][_0x6ab4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c78b5,_0x17498a,_0x573dbc){return new BPromise(function(_0x1320ae,_0x85691e){return client['request'](_0x3c78b5,_0x573dbc)['then'](function(_0x4cb454){logger[_0x6ab4('0x9')]('ChatTransferReport,\x20%s,\x20%s',_0x17498a,'request\x20sent');logger[_0x6ab4('0xa')](_0x6ab4('0xb'),_0x17498a,_0x6ab4('0xc'),JSON[_0x6ab4('0xd')](_0x4cb454));if(_0x4cb454[_0x6ab4('0xe')]){if(_0x4cb454[_0x6ab4('0xe')][_0x6ab4('0xf')]===0x1f4){logger[_0x6ab4('0xe')](_0x6ab4('0x10'),_0x17498a,_0x4cb454[_0x6ab4('0xe')]['message']);return _0x85691e(_0x4cb454['error'][_0x6ab4('0x11')]);}logger[_0x6ab4('0xe')](_0x6ab4('0x10'),_0x17498a,_0x4cb454[_0x6ab4('0xe')][_0x6ab4('0x11')]);return _0x1320ae(_0x4cb454['error'][_0x6ab4('0x11')]);}else{logger[_0x6ab4('0x9')](_0x6ab4('0x10'),_0x17498a,_0x6ab4('0xc'));_0x1320ae(_0x4cb454[_0x6ab4('0x12')][_0x6ab4('0x11')]);}})[_0x6ab4('0x13')](function(_0x16b845){logger[_0x6ab4('0xe')](_0x6ab4('0x10'),_0x17498a,_0x16b845);_0x85691e(_0x16b845);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 64a9e21..79b371c 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 _0x3cae=['destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','describe','post','put','/:id','update'];(function(_0x25e949,_0x391eb6){var _0x2da3bc=function(_0x243591){while(--_0x243591){_0x25e949['push'](_0x25e949['shift']());}};_0x2da3bc(++_0x391eb6);}(_0x3cae,0x172));var _0xe3ca=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x3cae[_0x487b0c];return _0x1adbdc;};'use strict';var multer=require('multer');var util=require(_0xe3ca('0x0'));var path=require('path');var timeout=require(_0xe3ca('0x1'));var express=require(_0xe3ca('0x2'));var router=express['Router']();var fs_extra=require(_0xe3ca('0x3'));var auth=require(_0xe3ca('0x4'));var interaction=require(_0xe3ca('0x5'));var config=require('../../config/environment');var controller=require(_0xe3ca('0x6'));router['get']('/',auth[_0xe3ca('0x7')](),controller[_0xe3ca('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xe3ca('0x9')]);router['get']('/:id',auth[_0xe3ca('0x7')](),controller['show']);router[_0xe3ca('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe3ca('0xb')](_0xe3ca('0xc'),auth[_0xe3ca('0x7')](),controller[_0xe3ca('0xd')]);router['delete'](_0xe3ca('0xc'),auth[_0xe3ca('0x7')](),controller[_0xe3ca('0xe')]);module[_0xe3ca('0xf')]=router; \ No newline at end of file +var _0x0d56=['isAuthenticated','show','post','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','describe','/:id'];(function(_0x3ac048,_0x3d2291){var _0xb1099d=function(_0x3ecda3){while(--_0x3ecda3){_0x3ac048['push'](_0x3ac048['shift']());}};_0xb1099d(++_0x3d2291);}(_0x0d56,0x142));var _0x60d5=function(_0xba0da5,_0x2ac024){_0xba0da5=_0xba0da5-0x0;var _0x3a5f98=_0x0d56[_0xba0da5];return _0x3a5f98;};'use strict';var multer=require(_0x60d5('0x0'));var util=require(_0x60d5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x60d5('0x2'));var router=express[_0x60d5('0x3')]();var fs_extra=require(_0x60d5('0x4'));var auth=require(_0x60d5('0x5'));var interaction=require(_0x60d5('0x6'));var config=require(_0x60d5('0x7'));var controller=require(_0x60d5('0x8'));router[_0x60d5('0x9')]('/',auth['isAuthenticated'](),controller[_0x60d5('0xa')]);router['get'](_0x60d5('0xb'),auth['isAuthenticated'](),controller[_0x60d5('0xc')]);router[_0x60d5('0x9')](_0x60d5('0xd'),auth[_0x60d5('0xe')](),controller[_0x60d5('0xf')]);router[_0x60d5('0x10')]('/',auth[_0x60d5('0xe')](),controller['create']);router[_0x60d5('0x11')](_0x60d5('0xd'),auth[_0x60d5('0xe')](),controller[_0x60d5('0x12')]);router['delete'](_0x60d5('0xd'),auth[_0x60d5('0xe')](),controller[_0x60d5('0x13')]);module[_0x60d5('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 0be3804..5739acf 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 _0x5ad3=['Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','Chat','Send','INTEGER','Powered\x20by\x20xCALLY','TEXT'];(function(_0x53d2d4,_0x1f63eb){var _0x2128d2=function(_0x5e9f21){while(--_0x5e9f21){_0x53d2d4['push'](_0x53d2d4['shift']());}};_0x2128d2(++_0x1f63eb);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x90e3d5,_0x3eea2b){_0x90e3d5=_0x90e3d5-0x0;var _0x5c2252=_0x5ad3[_0x90e3d5];return _0x5c2252;};'use strict';var Sequelize=require(_0x35ad('0x0'));var rs=require(_0x35ad('0x1'));module[_0x35ad('0x2')]={'name':{'type':Sequelize[_0x35ad('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x35ad('0x4')},'description':{'type':Sequelize[_0x35ad('0x3')]},'mapKey':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0x5')},'mapKeyOffline':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0x5')},'key':{'type':Sequelize[_0x35ad('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0x6')},'customerAlias':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ad('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x35ad('0x3')],'allowNull':![],'defaultValue':_0x35ad('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ad('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x35ad('0xa')]('rounded',_0x35ad('0xb')),'defaultValue':_0x35ad('0xc')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x35ad('0xe')},'header_offline':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x35ad('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x35ad('0x11')]},'closingQuestion':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x35ad('0x12')},'noteTitle':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x35ad('0x14')},'closingMessage':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0x15')},'closingMessageButton':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0xe')},'skipMessageButton':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x35ad('0x17'),_0x35ad('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x35ad('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x35ad('0x11')],'defaultValue':function(){return JSON[_0x35ad('0x19')]({'items':[{'type':_0x35ad('0x1a'),'variable':null,'config':{'placeholder':_0x35ad('0x1b'),'type':_0x35ad('0x1c'),'required':!![]},'props':{'title':_0x35ad('0x1b'),'helpText':''}},{'type':_0x35ad('0x1a'),'props':{'title':_0x35ad('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x35ad('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x35ad('0x1d')](_0x35ad('0x1e'))?JSON['parse'](this[_0x35ad('0x1d')](_0x35ad('0x1e'))):{};},'set':function(_0xa3cb9f){return this[_0x35ad('0x1f')](_0x35ad('0x1e'),JSON['stringify'](_0xa3cb9f));}},'offlineForm':{'type':Sequelize[_0x35ad('0x11')],'defaultValue':function(){return JSON[_0x35ad('0x19')]({'items':[{'type':_0x35ad('0x1a'),'props':{'title':_0x35ad('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x35ad('0x5'),'type':_0x35ad('0x5')},'variable':null},{'type':_0x35ad('0x20'),'config':{'placeholder':_0x35ad('0x21')},'props':{'title':'Comments','helpText':_0x35ad('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x35ad('0x1d')](_0x35ad('0x23'))?JSON[_0x35ad('0x24')](this[_0x35ad('0x1d')]('offlineForm')):{};},'set':function(_0x571ad6){return this[_0x35ad('0x1f')]('offlineForm',JSON[_0x35ad('0x19')](_0x571ad6));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x35ad('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x35ad('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x35ad('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x35ad('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x35ad('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0x29')},'sendUnmanaged':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x35ad('0x3')]},'notificationTemplate':{'type':Sequelize[_0x35ad('0x11')],'defaultValue':function(){return _0x35ad('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x35ad('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0x2c')},'defaultTitle':{'type':Sequelize[_0x35ad('0x3')]},'customerAvatar':{'type':Sequelize[_0x35ad('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x35ad('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x35ad('0x3')],'allowNull':![],'defaultValue':_0x35ad('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x35ad('0x3')],'defaultValue':_0x35ad('0x2e')},'systemAvatar':{'type':Sequelize[_0x35ad('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x35ad('0xf')],'comment':_0x35ad('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![],'comment':_0x35ad('0x30'),'set':function(_0x1bfd91){if(!_0x1bfd91)this[_0x35ad('0x1f')]('mandatoryDispositionPauseId',null);this[_0x35ad('0x1f')](_0x35ad('0x31'),_0x1bfd91);}},'vidaooEscalation':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING'],'defaultValue':![]},'openNewInteraction':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x35ad('0x11')]}}; \ No newline at end of file +var _0xcb99=['Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','address','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','BOOLEAN','TEXT'];(function(_0x1f5e4a,_0x16111e){var _0x380da7=function(_0x49dbbb){while(--_0x49dbbb){_0x1f5e4a['push'](_0x1f5e4a['shift']());}};_0x380da7(++_0x16111e);}(_0xcb99,0x8b));var _0x9cb9=function(_0x57d71f,_0x598a0e){_0x57d71f=_0x57d71f-0x0;var _0x2d1d26=_0xcb99[_0x57d71f];return _0x2d1d26;};'use strict';var Sequelize=require(_0x9cb9('0x0'));var rs=require('randomstring');module[_0x9cb9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9cb9('0x2')},'description':{'type':Sequelize[_0x9cb9('0x3')]},'mapKey':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9cb9('0x3')],'allowNull':![],'defaultValue':_0x9cb9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9cb9('0x3')],'allowNull':![],'defaultValue':_0x9cb9('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9cb9('0x3')],'allowNull':![],'defaultValue':_0x9cb9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9cb9('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9cb9('0x8')](_0x9cb9('0x9'),_0x9cb9('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0xc')},'header_offline':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9cb9('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9cb9('0x10')]},'closingQuestion':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x13')},'noteTitle':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x14')},'placeholderMessage':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x15')},'closingMessage':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x16')},'closingMessageButton':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9cb9('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9cb9('0x18')},'ratingType':{'type':Sequelize[_0x9cb9('0x8')](_0x9cb9('0x19'),_0x9cb9('0x1a')),'defaultValue':_0x9cb9('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x9cb9('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9cb9('0x10')],'defaultValue':function(){return JSON[_0x9cb9('0x1b')]({'items':[{'type':_0x9cb9('0x1c'),'variable':null,'config':{'placeholder':_0x9cb9('0x1d'),'type':_0x9cb9('0x1e'),'required':!![]},'props':{'title':_0x9cb9('0x1d'),'helpText':''}},{'type':_0x9cb9('0x1c'),'props':{'title':_0x9cb9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9cb9('0x1f')](_0x9cb9('0x20'))?JSON[_0x9cb9('0x21')](this[_0x9cb9('0x1f')](_0x9cb9('0x20'))):{};},'set':function(_0xbeefca){return this[_0x9cb9('0x22')](_0x9cb9('0x20'),JSON[_0x9cb9('0x1b')](_0xbeefca));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9cb9('0x1b')]({'items':[{'type':_0x9cb9('0x1c'),'props':{'title':_0x9cb9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9cb9('0x4'),'type':'email'},'variable':null},{'type':_0x9cb9('0x23'),'config':{'placeholder':'Comments'},'props':{'title':_0x9cb9('0x24'),'helpText':_0x9cb9('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0x9cb9('0x1f')](_0x9cb9('0x26'))?JSON['parse'](this[_0x9cb9('0x1f')](_0x9cb9('0x26'))):{};},'set':function(_0x39f9dd){return this['setDataValue'](_0x9cb9('0x26'),JSON['stringify'](_0x39f9dd));}},'token':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':function(){return rs[_0x9cb9('0x27')]();}},'autoclose':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9cb9('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9cb9('0x3')]},'waitingTitle':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x28')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x29')},'offlineMessageBody':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x9cb9('0x17')},'sendUnmanaged':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9cb9('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9cb9('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x9cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x2c')},'verticalAlignment':{'type':Sequelize[_0x9cb9('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x2d')},'defaultTitle':{'type':Sequelize[_0x9cb9('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9cb9('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9cb9('0x3')],'allowNull':![],'defaultValue':_0x9cb9('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':_0x9cb9('0x2f')},'systemAvatar':{'type':Sequelize[_0x9cb9('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9cb9('0x7')],'comment':_0x9cb9('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![],'comment':_0x9cb9('0x31'),'set':function(_0x481377){if(!_0x481377)this['setDataValue'](_0x9cb9('0x32'),null);this['setDataValue'](_0x9cb9('0x33'),_0x481377);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9cb9('0x3')],'defaultValue':![]},'openNewInteraction':{'type':Sequelize[_0x9cb9('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9cb9('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 1e9173c..b08484a 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 _0xac31=['hasOwnProperty','pick','ChatWebsiteId','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','sitepic','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','account','applications','Applications','orderBy','priority','asc','Contacts','contact','customerIp','cf-connecting-ip','first','split','firstName','lastName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','port','secure','authentication','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','x-forwarded-for','x-real-ip','connection','remoteAddress','replace','render','textColor','color_button','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','items','getOfflineMessages','Attachment','Attachments','addAgents','spread','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','params','includeAll','include','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','Disposition','getDispositions','findOne'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac31,0xca));var _0x1ac3=function(_0x287613,_0x42f188){_0x287613=_0x287613-0x0;var _0xa77c88=_0xac31[_0x287613];return _0xa77c88;};'use strict';var emlformat=require(_0x1ac3('0x0'));var rimraf=require(_0x1ac3('0x1'));var zipdir=require(_0x1ac3('0x2'));var jsonpatch=require(_0x1ac3('0x3'));var rp=require(_0x1ac3('0x4'));var moment=require(_0x1ac3('0x5'));var BPromise=require(_0x1ac3('0x6'));var Mustache=require('mustache');var util=require(_0x1ac3('0x7'));var path=require(_0x1ac3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ac3('0x9'));var fs=require('fs');var fs_extra=require(_0x1ac3('0xa'));var _=require(_0x1ac3('0xb'));var squel=require(_0x1ac3('0xc'));var crypto=require(_0x1ac3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ac3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ac3('0xf'));var Papa=require(_0x1ac3('0x10'));var Redis=require(_0x1ac3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ac3('0x12'));var as=require(_0x1ac3('0x13'));var hardwareService=require(_0x1ac3('0x14'));var logger=require(_0x1ac3('0x15'))(_0x1ac3('0x16'));var utils=require(_0x1ac3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ac3('0x18'));var db=require(_0x1ac3('0x19'))['db'];config[_0x1ac3('0x1a')]=_[_0x1ac3('0x1b')](config['redis'],{'host':_0x1ac3('0x1c'),'port':0x18eb});var socket=require(_0x1ac3('0x1d'))(new Redis(config[_0x1ac3('0x1a')]));require(_0x1ac3('0x1e'))['register'](socket);var jayson=require(_0x1ac3('0x1f'));var client=jayson[_0x1ac3('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x1ac3('0x20')][_0x1ac3('0x21')]({'port':0x232a});var client9003=jayson[_0x1ac3('0x20')]['http']({'port':0x232b});var client9001=jayson[_0x1ac3('0x20')][_0x1ac3('0x21')]({'port':0x2329});function respondWithRpcPromise(_0x23e6e9,_0x541744,_0x195683,_0x58000f){return new BPromise(function(_0x291616,_0x1e1280){var _0x20091d=_0x58000f||client;return _0x20091d[_0x1ac3('0x22')](_0x23e6e9,_0x195683)[_0x1ac3('0x23')](function(_0x557076){logger[_0x1ac3('0x24')](_0x1ac3('0x25'),_0x541744,_0x1ac3('0x26'));logger[_0x1ac3('0x27')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x541744,'request\x20sent',JSON[_0x1ac3('0x28')](_0x557076));if(_0x557076[_0x1ac3('0x29')]){if(_0x557076[_0x1ac3('0x29')][_0x1ac3('0x2a')]===0x1f4){logger[_0x1ac3('0x29')](_0x1ac3('0x25'),_0x541744,_0x557076[_0x1ac3('0x29')][_0x1ac3('0x2b')]);return _0x1e1280(_0x557076[_0x1ac3('0x29')]['message']);}logger[_0x1ac3('0x29')](_0x1ac3('0x25'),_0x541744,_0x557076['error'][_0x1ac3('0x2b')]);return _0x291616(_0x557076[_0x1ac3('0x29')]['message']);}else{logger[_0x1ac3('0x24')](_0x1ac3('0x25'),_0x541744,_0x1ac3('0x26'));_0x291616(_0x557076[_0x1ac3('0x2c')][_0x1ac3('0x2b')]);}})['catch'](function(_0x5a2ab2){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x541744,_0x5a2ab2);_0x1e1280(_0x5a2ab2);});});}function respondWithStatusCode(_0x52a1a5,_0x3ea482){_0x3ea482=_0x3ea482||0xcc;return function(_0x4b04fb){if(_0x4b04fb){return _0x52a1a5[_0x1ac3('0x2d')](_0x3ea482);}return _0x52a1a5[_0x1ac3('0x2e')](_0x3ea482)[_0x1ac3('0x2f')]();};}function respondWithResult(_0x435d6c,_0x4b3d3c){_0x4b3d3c=_0x4b3d3c||0xc8;return function(_0x61441d){if(_0x61441d){return _0x435d6c['status'](_0x4b3d3c)[_0x1ac3('0x30')](_0x61441d);}};}function respondWithFilteredResult(_0x4000b0,_0x440aed){return function(_0x1c5653){if(_0x1c5653){var _0x22da8d=_0x1c5653[_0x1ac3('0x31')],_0xc3f097=_0x440aed[_0x1ac3('0x32')],_0x9c17c2=_0x440aed[_0x1ac3('0x32')]+_0x440aed[_0x1ac3('0x33')],_0x5351b2;if(_0x9c17c2>=_0x22da8d){_0x9c17c2=_0x22da8d;_0x5351b2=0xc8;}else{_0x5351b2=0xce;}_0x4000b0['status'](_0x5351b2);return _0x4000b0[_0x1ac3('0x34')](_0x1ac3('0x35'),_0xc3f097+'-'+_0x9c17c2+'/'+_0x22da8d)[_0x1ac3('0x30')](_0x1c5653);}return null;};}function patchUpdates(_0x294513){return function(_0x204d78){try{jsonpatch['apply'](_0x204d78,_0x294513,!![]);}catch(_0xbeed18){return BPromise[_0x1ac3('0x36')](_0xbeed18);}return _0x204d78[_0x1ac3('0x37')]();};}function saveUpdates(_0x156ccd,_0x1a47d4){return function(_0x43362a){if(_0x43362a){return _0x43362a['update'](_0x156ccd)[_0x1ac3('0x23')](function(_0x174a53){return _0x174a53;});}return null;};}function removeEntity(_0x431f11,_0xf6d79e){return function(_0x586573){if(_0x586573){return _0x586573[_0x1ac3('0x38')]()[_0x1ac3('0x23')](function(){var _0x2259f5=_0x586573[_0x1ac3('0x39')]({'plain':!![]});var _0x31a932=_0x1ac3('0x3a');return db[_0x1ac3('0x3b')][_0x1ac3('0x38')]({'where':{'type':_0x31a932,'resourceId':_0x2259f5['id']}})[_0x1ac3('0x23')](function(){return _0x586573;});})['then'](function(){_0x431f11[_0x1ac3('0x2e')](0xcc)[_0x1ac3('0x2f')]();});}};}function handleEntityNotFound(_0x4e4a20,_0xc6b21f){return function(_0x1031fa){if(!_0x1031fa){_0x4e4a20[_0x1ac3('0x2d')](0x194);}return _0x1031fa;};}function handleError(_0x448fb5,_0x2e8494){_0x2e8494=_0x2e8494||0x1f4;return function(_0x4b2217){logger[_0x1ac3('0x29')](_0x4b2217[_0x1ac3('0x3c')]);if(_0x4b2217['name']){delete _0x4b2217[_0x1ac3('0x3d')];}_0x448fb5['status'](_0x2e8494)[_0x1ac3('0x3e')](_0x4b2217);};}exports[_0x1ac3('0x3f')]=function(_0x2d449e,_0x1e2f5e){var _0x3141ae={'include':[{'model':db[_0x1ac3('0x40')],'as':_0x1ac3('0x41')}]},_0x842766={},_0x5eeba5={'count':0x0,'rows':[]};var _0x43d15=_['map'](db[_0x1ac3('0x42')][_0x1ac3('0x43')],function(_0x5cec6b){return{'name':_0x5cec6b[_0x1ac3('0x44')],'type':_0x5cec6b[_0x1ac3('0x45')][_0x1ac3('0x46')]};});_0x842766[_0x1ac3('0x47')]=_[_0x1ac3('0x48')](_0x43d15,_0x1ac3('0x3d'));_0x842766[_0x1ac3('0x49')]=_[_0x1ac3('0x4a')](_0x2d449e['query']);_0x842766[_0x1ac3('0x4b')]=_[_0x1ac3('0x4c')](_0x842766[_0x1ac3('0x47')],_0x842766[_0x1ac3('0x49')]);_0x3141ae[_0x1ac3('0x4d')]=_[_0x1ac3('0x4c')](_0x842766[_0x1ac3('0x47')],qs['fields'](_0x2d449e['query'][_0x1ac3('0x4e')]));_0x3141ae[_0x1ac3('0x4d')]=_0x3141ae['attributes'][_0x1ac3('0x4f')]?_0x3141ae[_0x1ac3('0x4d')]:_0x842766['model'];if(!_0x2d449e[_0x1ac3('0x49')]['hasOwnProperty'](_0x1ac3('0x50'))){_0x3141ae[_0x1ac3('0x33')]=qs[_0x1ac3('0x33')](_0x2d449e[_0x1ac3('0x49')]['limit']);_0x3141ae[_0x1ac3('0x32')]=qs[_0x1ac3('0x32')](_0x2d449e[_0x1ac3('0x49')][_0x1ac3('0x32')]);}_0x3141ae[_0x1ac3('0x51')]=qs['sort'](_0x2d449e[_0x1ac3('0x49')][_0x1ac3('0x52')]);_0x3141ae[_0x1ac3('0x53')]=qs[_0x1ac3('0x4b')](_['pick'](_0x2d449e[_0x1ac3('0x49')],_0x842766[_0x1ac3('0x4b')]),_0x43d15);if(_0x2d449e[_0x1ac3('0x49')][_0x1ac3('0x54')]){_0x3141ae['where']=_[_0x1ac3('0x55')](_0x3141ae[_0x1ac3('0x53')],{'$or':_[_0x1ac3('0x48')](_0x43d15,function(_0x522146){if(_0x522146['type']!==_0x1ac3('0x56')){var _0x58e6c7={};_0x58e6c7[_0x522146[_0x1ac3('0x3d')]]={'$like':'%'+_0x2d449e[_0x1ac3('0x49')][_0x1ac3('0x54')]+'%'};return _0x58e6c7;}})});}_0x3141ae=_[_0x1ac3('0x55')]({},_0x3141ae,_0x2d449e[_0x1ac3('0x57')]);var _0x35ae09={'where':_0x3141ae[_0x1ac3('0x53')]};return db['ChatWebsite']['count'](_0x35ae09)[_0x1ac3('0x23')](function(_0x249c2d){_0x5eeba5[_0x1ac3('0x31')]=_0x249c2d;if(_0x2d449e['query']['includeAll']){_0x3141ae['include']=[{'all':!![]}];}return db[_0x1ac3('0x42')][_0x1ac3('0x58')](_0x3141ae);})['then'](function(_0x34322e){_0x5eeba5[_0x1ac3('0x59')]=_0x34322e;return _0x5eeba5;})[_0x1ac3('0x23')](respondWithFilteredResult(_0x1e2f5e,_0x3141ae))[_0x1ac3('0x5a')](handleError(_0x1e2f5e,null));};exports['show']=function(_0x5a890c,_0x648f3d){var _0x4749da={'raw':![],'where':{'id':_0x5a890c[_0x1ac3('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5786da={};_0x5786da[_0x1ac3('0x47')]=_[_0x1ac3('0x4a')](db['ChatWebsite'][_0x1ac3('0x43')]);_0x5786da['query']=_[_0x1ac3('0x4a')](_0x5a890c[_0x1ac3('0x49')]);_0x5786da[_0x1ac3('0x4b')]=_[_0x1ac3('0x4c')](_0x5786da[_0x1ac3('0x47')],_0x5786da[_0x1ac3('0x49')]);_0x4749da[_0x1ac3('0x4d')]=_[_0x1ac3('0x4c')](_0x5786da[_0x1ac3('0x47')],qs[_0x1ac3('0x4e')](_0x5a890c[_0x1ac3('0x49')]['fields']));_0x4749da['attributes']=_0x4749da[_0x1ac3('0x4d')][_0x1ac3('0x4f')]?_0x4749da[_0x1ac3('0x4d')]:_0x5786da[_0x1ac3('0x47')];if(_0x5a890c[_0x1ac3('0x49')][_0x1ac3('0x5c')]){_0x4749da[_0x1ac3('0x5d')]=[{'all':!![]}];}_0x4749da=_[_0x1ac3('0x55')]({},_0x4749da,_0x5a890c[_0x1ac3('0x57')]);return db[_0x1ac3('0x42')]['find'](_0x4749da)[_0x1ac3('0x23')](handleEntityNotFound(_0x648f3d,null))[_0x1ac3('0x23')](respondWithResult(_0x648f3d,null))[_0x1ac3('0x5a')](handleError(_0x648f3d,null));};exports[_0x1ac3('0x5e')]=function(_0x20c195,_0x548cab){return db[_0x1ac3('0x42')][_0x1ac3('0x5e')](_0x20c195['body'],{})['then'](function(_0x51af03){var _0x17d75c=_0x20c195[_0x1ac3('0x5f')][_0x1ac3('0x39')]({'plain':!![]});if(!_0x17d75c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17d75c[_0x1ac3('0x60')]==='user'){var _0x5035cf=_0x51af03['get']({'plain':!![]});var _0x597885=_0x1ac3('0x3a');return db[_0x1ac3('0x61')][_0x1ac3('0x62')]({'where':{'name':_0x597885,'userProfileId':_0x17d75c[_0x1ac3('0x63')]},'raw':!![]})[_0x1ac3('0x23')](function(_0x4e1fb4){if(_0x4e1fb4&&_0x4e1fb4[_0x1ac3('0x64')]===0x0){return db[_0x1ac3('0x3b')]['create']({'name':_0x5035cf[_0x1ac3('0x3d')],'resourceId':_0x5035cf['id'],'type':_0x4e1fb4[_0x1ac3('0x3d')],'sectionId':_0x4e1fb4['id']},{})[_0x1ac3('0x23')](function(){return _0x51af03;});}else{return _0x51af03;}})[_0x1ac3('0x5a')](function(_0xb35638){logger['error'](_0x1ac3('0x65'),_0xb35638);throw _0xb35638;});}return _0x51af03;})[_0x1ac3('0x23')](respondWithResult(_0x548cab,0xc9))[_0x1ac3('0x5a')](handleError(_0x548cab,null));};exports[_0x1ac3('0x66')]=function(_0x4cfa04,_0x19407a){if(_0x4cfa04[_0x1ac3('0x67')]['id']){delete _0x4cfa04[_0x1ac3('0x67')]['id'];}return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x4cfa04[_0x1ac3('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x19407a,null))['then'](saveUpdates(_0x4cfa04[_0x1ac3('0x67')],null))['then'](respondWithResult(_0x19407a,null))[_0x1ac3('0x5a')](handleError(_0x19407a,null));};exports[_0x1ac3('0x38')]=function(_0x12b2c1,_0x20fa43){return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x12b2c1['params']['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x20fa43,null))[_0x1ac3('0x23')](removeEntity(_0x20fa43,null))[_0x1ac3('0x5a')](handleError(_0x20fa43,null));};exports[_0x1ac3('0x68')]=function(_0x4e219c,_0x2e4dc0){return db[_0x1ac3('0x42')][_0x1ac3('0x68')]()[_0x1ac3('0x23')](respondWithResult(_0x2e4dc0,null))[_0x1ac3('0x5a')](handleError(_0x2e4dc0,null));};exports['addDisposition']=function(_0xdf8fb9,_0x4b2a64,_0x4d6e52){if(_0xdf8fb9[_0x1ac3('0x67')]['id']){delete _0xdf8fb9[_0x1ac3('0x67')]['id'];}return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0xdf8fb9[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x4b2a64,null))[_0x1ac3('0x23')](function(_0xdda21a){if(_0xdda21a){_0xdf8fb9[_0x1ac3('0x67')]['ChatWebsiteId']=_0xdda21a['id'];return db[_0x1ac3('0x69')][_0x1ac3('0x5e')](_0xdf8fb9[_0x1ac3('0x67')]);}})['then'](respondWithResult(_0x4b2a64,null))[_0x1ac3('0x5a')](handleError(_0x4b2a64,null));};exports[_0x1ac3('0x6a')]=function(_0x47821f,_0x2df1c0,_0x301335){var _0x1b7bf6={'raw':![],'where':{}};var _0x8740b4={};var _0x215966={'count':0x0,'rows':[]};return db[_0x1ac3('0x42')][_0x1ac3('0x6b')]({'where':{'id':_0x47821f['params']['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x2df1c0,null))[_0x1ac3('0x23')](function(_0x41ffd0){if(_0x41ffd0){_0x8740b4['model']=_[_0x1ac3('0x4a')](db[_0x1ac3('0x69')][_0x1ac3('0x43')]);_0x8740b4[_0x1ac3('0x49')]=_[_0x1ac3('0x4a')](_0x47821f['query']);_0x8740b4['filters']=_['intersection'](_0x8740b4[_0x1ac3('0x47')],_0x8740b4['query']);_0x1b7bf6[_0x1ac3('0x4d')]=_[_0x1ac3('0x4c')](_0x8740b4[_0x1ac3('0x47')],qs['fields'](_0x47821f[_0x1ac3('0x49')][_0x1ac3('0x4e')]));_0x1b7bf6[_0x1ac3('0x4d')]=_0x1b7bf6[_0x1ac3('0x4d')][_0x1ac3('0x4f')]?_0x1b7bf6['attributes']:_0x8740b4['model'];if(!_0x47821f[_0x1ac3('0x49')][_0x1ac3('0x6c')]('nolimit')){_0x1b7bf6[_0x1ac3('0x33')]=qs[_0x1ac3('0x33')](_0x47821f[_0x1ac3('0x49')]['limit']);_0x1b7bf6[_0x1ac3('0x32')]=qs[_0x1ac3('0x32')](_0x47821f['query'][_0x1ac3('0x32')]);}_0x1b7bf6['order']=qs[_0x1ac3('0x52')](_0x47821f['query']['sort']);_0x1b7bf6[_0x1ac3('0x53')]=qs[_0x1ac3('0x4b')](_[_0x1ac3('0x6d')](_0x47821f[_0x1ac3('0x49')],_0x8740b4[_0x1ac3('0x4b')]));_0x1b7bf6[_0x1ac3('0x53')][_0x1ac3('0x6e')]=_0x41ffd0['id'];if(_0x47821f[_0x1ac3('0x49')][_0x1ac3('0x54')]){_0x1b7bf6[_0x1ac3('0x53')]=_[_0x1ac3('0x55')](_0x1b7bf6[_0x1ac3('0x53')],{'$or':_['map'](_0x1b7bf6['attributes'],function(_0x588726){var _0x2ef69a={};_0x2ef69a[_0x588726]={'$like':'%'+_0x47821f[_0x1ac3('0x49')]['filter']+'%'};return _0x2ef69a;})});}_0x1b7bf6=_[_0x1ac3('0x55')]({},_0x1b7bf6,_0x47821f[_0x1ac3('0x57')]);return db[_0x1ac3('0x69')][_0x1ac3('0x31')]({'where':_0x1b7bf6[_0x1ac3('0x53')]})['then'](function(_0x24ab6e){_0x215966['count']=_0x24ab6e;if(_0x47821f[_0x1ac3('0x49')]['includeAll']){_0x1b7bf6[_0x1ac3('0x5d')]=[{'all':!![]}];}return db['Disposition'][_0x1ac3('0x58')](_0x1b7bf6);})[_0x1ac3('0x23')](function(_0x91eea8){_0x215966[_0x1ac3('0x59')]=_0x91eea8;return _0x215966;});}})[_0x1ac3('0x23')](respondWithFilteredResult(_0x2df1c0,_0x1b7bf6))['catch'](handleError(_0x2df1c0,null));};exports['removeDispositions']=function(_0x4887a5,_0x369ed0,_0x22e88d){return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x4887a5['params']['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x369ed0,null))[_0x1ac3('0x23')](function(_0x4a9c6a){if(_0x4a9c6a){return _0x4a9c6a[_0x1ac3('0x6f')](_0x4887a5['query'][_0x1ac3('0x70')]);}})['then'](respondWithStatusCode(_0x369ed0,null))['catch'](handleError(_0x369ed0,null));};exports['addAnswer']=function(_0x3ad931,_0x455ec7,_0x194801){if(_0x3ad931[_0x1ac3('0x67')]['id']){delete _0x3ad931[_0x1ac3('0x67')]['id'];}return db['ChatWebsite'][_0x1ac3('0x62')]({'where':{'id':_0x3ad931[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x455ec7,null))[_0x1ac3('0x23')](function(_0x4a272e){if(_0x4a272e){_0x3ad931[_0x1ac3('0x67')][_0x1ac3('0x6e')]=_0x4a272e['id'];return db['CannedAnswer']['create'](_0x3ad931['body']);}})[_0x1ac3('0x23')](respondWithResult(_0x455ec7,null))[_0x1ac3('0x5a')](handleError(_0x455ec7,null));};exports[_0x1ac3('0x71')]=function(_0x3e1a11,_0x582468,_0x174bd1){var _0x135898={'raw':![],'where':{}};var _0x553da5={};var _0x1d9dfc={'count':0x0,'rows':[]};return db[_0x1ac3('0x42')][_0x1ac3('0x6b')]({'where':{'id':_0x3e1a11[_0x1ac3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x582468,null))[_0x1ac3('0x23')](function(_0x74937a){if(_0x74937a){_0x553da5[_0x1ac3('0x47')]=_[_0x1ac3('0x4a')](db[_0x1ac3('0x72')]['rawAttributes']);_0x553da5[_0x1ac3('0x49')]=_[_0x1ac3('0x4a')](_0x3e1a11['query']);_0x553da5['filters']=_[_0x1ac3('0x4c')](_0x553da5[_0x1ac3('0x47')],_0x553da5['query']);_0x135898['attributes']=_[_0x1ac3('0x4c')](_0x553da5['model'],qs[_0x1ac3('0x4e')](_0x3e1a11[_0x1ac3('0x49')]['fields']));_0x135898['attributes']=_0x135898[_0x1ac3('0x4d')]['length']?_0x135898[_0x1ac3('0x4d')]:_0x553da5[_0x1ac3('0x47')];if(!_0x3e1a11[_0x1ac3('0x49')][_0x1ac3('0x6c')](_0x1ac3('0x50'))){_0x135898[_0x1ac3('0x33')]=qs[_0x1ac3('0x33')](_0x3e1a11[_0x1ac3('0x49')][_0x1ac3('0x33')]);_0x135898['offset']=qs[_0x1ac3('0x32')](_0x3e1a11[_0x1ac3('0x49')]['offset']);}_0x135898[_0x1ac3('0x51')]=qs[_0x1ac3('0x52')](_0x3e1a11['query'][_0x1ac3('0x52')]);_0x135898['where']=qs['filters'](_[_0x1ac3('0x6d')](_0x3e1a11[_0x1ac3('0x49')],_0x553da5[_0x1ac3('0x4b')]));_0x135898['where']['ChatWebsiteId']=_0x74937a['id'];if(_0x3e1a11[_0x1ac3('0x49')][_0x1ac3('0x54')]){_0x135898[_0x1ac3('0x53')]=_[_0x1ac3('0x55')](_0x135898[_0x1ac3('0x53')],{'$or':_[_0x1ac3('0x48')](_0x135898[_0x1ac3('0x4d')],function(_0x37fbab){var _0x3c0289={};_0x3c0289[_0x37fbab]={'$like':'%'+_0x3e1a11[_0x1ac3('0x49')][_0x1ac3('0x54')]+'%'};return _0x3c0289;})});}_0x135898=_[_0x1ac3('0x55')]({},_0x135898,_0x3e1a11[_0x1ac3('0x57')]);return db[_0x1ac3('0x72')][_0x1ac3('0x31')]({'where':_0x135898[_0x1ac3('0x53')]})[_0x1ac3('0x23')](function(_0xbb9f39){_0x1d9dfc[_0x1ac3('0x31')]=_0xbb9f39;if(_0x3e1a11[_0x1ac3('0x49')][_0x1ac3('0x5c')]){_0x135898[_0x1ac3('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1ac3('0x58')](_0x135898);})[_0x1ac3('0x23')](function(_0xdb9ea){_0x1d9dfc[_0x1ac3('0x59')]=_0xdb9ea;return _0x1d9dfc;});}})[_0x1ac3('0x23')](respondWithFilteredResult(_0x582468,_0x135898))[_0x1ac3('0x5a')](handleError(_0x582468,null));};exports['removeAnswers']=function(_0x56cbf3,_0x224bc5,_0x3dcc4a){return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x56cbf3[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x224bc5,null))[_0x1ac3('0x23')](function(_0x2ced57){if(_0x2ced57){return _0x2ced57[_0x1ac3('0x73')](_0x56cbf3[_0x1ac3('0x49')][_0x1ac3('0x70')]);}})['then'](respondWithStatusCode(_0x224bc5,null))[_0x1ac3('0x5a')](handleError(_0x224bc5,null));};exports[_0x1ac3('0x74')]=function(_0x110943,_0x5f52cb,_0x2f3369){_0x110943[_0x1ac3('0x67')]['sitepic']=_0x110943[_0x1ac3('0x75')][_0x1ac3('0x76')];return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x110943['params']['id']}})['then'](handleEntityNotFound(_0x5f52cb,null))['then'](saveUpdates(_0x110943[_0x1ac3('0x67')],null))[_0x1ac3('0x23')](respondWithResult(_0x5f52cb,null))[_0x1ac3('0x5a')](handleError(_0x5f52cb,null));};exports[_0x1ac3('0x77')]=function(_0xbe8fdc,_0x5a1a5b,_0x2218b1){_0xbe8fdc[_0x1ac3('0x67')][_0x1ac3('0x78')]=_0xbe8fdc['file'][_0x1ac3('0x76')];return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0xbe8fdc[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x5a1a5b,null))['then'](saveUpdates(_0xbe8fdc[_0x1ac3('0x67')],null))[_0x1ac3('0x23')](respondWithResult(_0x5a1a5b,null))[_0x1ac3('0x5a')](handleError(_0x5a1a5b,null));};exports[_0x1ac3('0x79')]=function(_0x50c04c,_0x5199d5,_0x33604f){_0x50c04c[_0x1ac3('0x67')]['customerAvatar']=_0x50c04c[_0x1ac3('0x75')][_0x1ac3('0x76')];return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x50c04c['params']['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x5199d5,null))[_0x1ac3('0x23')](saveUpdates(_0x50c04c[_0x1ac3('0x67')],null))[_0x1ac3('0x23')](respondWithResult(_0x5199d5,null))[_0x1ac3('0x5a')](handleError(_0x5199d5,null));};exports[_0x1ac3('0x7a')]=function(_0x11e2a1,_0x5531c8,_0x3f1415){_0x11e2a1[_0x1ac3('0x67')][_0x1ac3('0x7b')]=_0x11e2a1[_0x1ac3('0x75')][_0x1ac3('0x76')];return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x11e2a1[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x5531c8,null))[_0x1ac3('0x23')](saveUpdates(_0x11e2a1[_0x1ac3('0x67')],null))[_0x1ac3('0x23')](respondWithResult(_0x5531c8,null))[_0x1ac3('0x5a')](handleError(_0x5531c8,null));};exports[_0x1ac3('0x7c')]=function(_0x564645,_0x41eb8d,_0x2e9cb4){var _0x1fba37=path[_0x1ac3('0x7d')](config['root'],'server/files/images/logos/default_logo.svg');var _0x46b731={'where':{'id':_0x564645[_0x1ac3('0x5b')]['id']},'attributes':['id',_0x1ac3('0x7e')],'raw':!![]};var _0x5c85d3=![];return require('../../config/license/util')[_0x1ac3('0x7f')]()[_0x1ac3('0x23')](function(_0x1366cc){if(_0x1366cc){_0x5c85d3=_0x1366cc[_0x1ac3('0x80')];}})[_0x1ac3('0x23')](function(){return db['ChatWebsite'][_0x1ac3('0x62')](_0x46b731);})[_0x1ac3('0x23')](handleEntityNotFound(_0x41eb8d,null))[_0x1ac3('0x23')](function(_0x234c7b){if(_0x234c7b){if(!_[_0x1ac3('0x81')](_0x234c7b[_0x1ac3('0x7e')])){if(fs[_0x1ac3('0x82')](path[_0x1ac3('0x7d')](config[_0x1ac3('0x83')],_0x1ac3('0x84'),_0x234c7b[_0x1ac3('0x7e')]))&&_0x5c85d3){_0x1fba37=path['join'](config[_0x1ac3('0x83')],_0x1ac3('0x84'),_0x234c7b[_0x1ac3('0x7e')]);}}return _0x41eb8d['download'](_0x1fba37);}})['catch'](handleError(_0x41eb8d,null));};exports[_0x1ac3('0x85')]=function(_0x5b7e03,_0x2f1116,_0x246828){var _0x85bb62=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0x1ddd12={'where':{'id':_0x5b7e03[_0x1ac3('0x5b')]['id']},'attributes':['id',_0x1ac3('0x78')],'raw':!![]};return db[_0x1ac3('0x42')][_0x1ac3('0x62')](_0x1ddd12)[_0x1ac3('0x23')](handleEntityNotFound(_0x2f1116,null))[_0x1ac3('0x23')](function(_0x2de165){if(_0x2de165){if(!_[_0x1ac3('0x81')](_0x2de165[_0x1ac3('0x78')])){if(fs[_0x1ac3('0x82')](path[_0x1ac3('0x7d')](config[_0x1ac3('0x83')],_0x1ac3('0x86'),_0x2de165[_0x1ac3('0x78')]))){_0x85bb62=path[_0x1ac3('0x7d')](config[_0x1ac3('0x83')],_0x1ac3('0x86'),_0x2de165['agentAvatar']);}}return _0x2f1116[_0x1ac3('0x87')](_0x85bb62);}})[_0x1ac3('0x5a')](handleError(_0x2f1116,null));};exports[_0x1ac3('0x88')]=function(_0x389b53,_0x33daf8,_0x4c1bd1){var _0x3789e8=path[_0x1ac3('0x7d')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2e9309={'where':{'id':_0x389b53[_0x1ac3('0x5b')]['id']},'attributes':['id',_0x1ac3('0x89'),_0x1ac3('0x8a')],'raw':!![]};return db[_0x1ac3('0x42')][_0x1ac3('0x62')](_0x2e9309)[_0x1ac3('0x23')](handleEntityNotFound(_0x33daf8,null))[_0x1ac3('0x23')](function(_0x3fc067){if(_0x3fc067){if(!_[_0x1ac3('0x81')](_0x3fc067[_0x1ac3('0x89')])){if(fs[_0x1ac3('0x82')](path['join'](config[_0x1ac3('0x83')],'server/files/images/avatars/',_0x3fc067[_0x1ac3('0x89')]))&&_0x3fc067[_0x1ac3('0x8a')]){_0x3789e8=path[_0x1ac3('0x7d')](config[_0x1ac3('0x83')],_0x1ac3('0x86'),_0x3fc067[_0x1ac3('0x89')]);}}return _0x33daf8[_0x1ac3('0x87')](_0x3789e8);}})[_0x1ac3('0x5a')](handleError(_0x33daf8,null));};exports[_0x1ac3('0x8b')]=function(_0x56aa1e,_0x4a2ec7,_0x53f1a2){var _0x1b27e2=path[_0x1ac3('0x7d')](config[_0x1ac3('0x83')],'server/files/images/avatars/system_avatar.png');var _0x17e985={'where':{'id':_0x56aa1e[_0x1ac3('0x5b')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x1ac3('0x42')][_0x1ac3('0x62')](_0x17e985)[_0x1ac3('0x23')](handleEntityNotFound(_0x4a2ec7,null))['then'](function(_0xe9b3ad){if(_0xe9b3ad){if(!_['isNil'](_0xe9b3ad['systemAvatar'])){if(fs['existsSync'](path[_0x1ac3('0x7d')](config[_0x1ac3('0x83')],_0x1ac3('0x86'),_0xe9b3ad[_0x1ac3('0x7b')]))){_0x1b27e2=path[_0x1ac3('0x7d')](config[_0x1ac3('0x83')],_0x1ac3('0x86'),_0xe9b3ad[_0x1ac3('0x7b')]);}}return _0x4a2ec7[_0x1ac3('0x87')](_0x1b27e2);}})[_0x1ac3('0x5a')](handleError(_0x4a2ec7,null));};exports[_0x1ac3('0x8c')]=function(_0x128cd3,_0x113a0e,_0x588753){var _0x5af8bc=require(_0x1ac3('0x8d'));var _0x762582=new _0x5af8bc();var _0x53047d=_0x762582[_0x1ac3('0x8e')](_0x128cd3[_0x1ac3('0x8f')][_0x1ac3('0x90')])[_0x1ac3('0x91')]();var _0x2d7688={'body':_0x128cd3[_0x1ac3('0x67')],'channel':_0x1ac3('0x92')};var _0x1d651e=[];var _0x44c60e=[];var _0x55481a={};var _0x100a8c=![];return db[_0x1ac3('0x93')][_0x1ac3('0x68')]()[_0x1ac3('0x23')](function(_0x21e705){if(!_0x21e705){throw new db[(_0x1ac3('0x94'))][(_0x1ac3('0x95'))](_0x1ac3('0x96'));}_0x1d651e=_[_0x1ac3('0x97')](_['keys'](_0x21e705),[_0x1ac3('0x98'),'updatedAt']);_0x44c60e=_[_0x1ac3('0x97')](_[_0x1ac3('0x4a')](_0x21e705),['createdAt',_0x1ac3('0x99'),_0x1ac3('0x9a'),_0x1ac3('0x9b')]);if(_0x128cd3[_0x1ac3('0x67')]['id']){delete _0x128cd3['body']['id'];}if(_[_0x1ac3('0x81')](_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0x9c')])){throw new db[(_0x1ac3('0x94'))][(_0x1ac3('0x95'))](_0x1ac3('0x9d'));}if(_[_0x1ac3('0x81')](_0x128cd3['body']['body'])||_0x128cd3['body']['body']===''){throw new db[(_0x1ac3('0x94'))][(_0x1ac3('0x95'))](_0x1ac3('0x9e'));}if(_[_0x1ac3('0x81')](_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0x9f')])){throw new db[(_0x1ac3('0x94'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44c60e);}if(!_['includes'](_0x44c60e,_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0x9f')])){throw new db[(_0x1ac3('0x94'))][(_0x1ac3('0x95'))](_0x1ac3('0xa0')+_0x44c60e);}_0x55481a[_0x128cd3['body'][_0x1ac3('0x9f')]]=_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0x9c')];})[_0x1ac3('0x23')](function(){return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x128cd3[_0x1ac3('0x5b')]['id']},'include':[{'model':db[_0x1ac3('0xa1')],'as':_0x1ac3('0xa2'),'include':[{'model':db[_0x1ac3('0x93')],'as':'Contacts','where':_0x55481a,'limit':0x1,'order':[[_0x1ac3('0x99'),_0x1ac3('0xa3')]]}]},{'model':db[_0x1ac3('0xa4')],'as':'Applications'}]});})[_0x1ac3('0x23')](handleEntityNotFound(_0x113a0e,null))[_0x1ac3('0x23')](function(_0x143591){if(_0x143591&&_0x143591['List']){_0x2d7688[_0x1ac3('0xa5')]=_0x143591;_0x2d7688[_0x1ac3('0xa6')]=_0x143591[_0x1ac3('0xa7')];_0x2d7688['list']=_0x143591['List'];_0x2d7688['applications']=_[_0x1ac3('0xa8')](_0x2d7688[_0x1ac3('0xa6')],[_0x1ac3('0xa9')],[_0x1ac3('0xaa')]);if(_0x2d7688[_0x1ac3('0xa5')]['Applications']){delete _0x2d7688[_0x1ac3('0xa5')][_0x1ac3('0xa7')];}if(_0x2d7688['account'][_0x1ac3('0xa2')]&&_0x2d7688[_0x1ac3('0xa5')][_0x1ac3('0xa2')]['Contacts'][_0x1ac3('0x4f')]){return _0x2d7688[_0x1ac3('0xa5')][_0x1ac3('0xa2')][_0x1ac3('0xab')][0x0];}var _0x379731=_[_0x1ac3('0x1b')](_0x128cd3[_0x1ac3('0x67')],{'firstName':_0x128cd3[_0x1ac3('0x67')]['from'],'ListId':_0x143591['ListId']});_0x379731[_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0x9f')]]=_0x128cd3['body'][_0x1ac3('0x9c')];return db['CmContact'][_0x1ac3('0x5e')](_0x379731,{'fields':_0x1d651e,'raw':!![]});}})['then'](handleEntityNotFound(_0x113a0e,null))[_0x1ac3('0x23')](function(_0x283744){_0x2d7688[_0x1ac3('0xac')]=_0x283744;var _0x2ae900=_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xad')];if(_0x128cd3[_0x1ac3('0x8f')]['cf-connecting-ip']){_0x2ae900=_0x128cd3[_0x1ac3('0x8f')][_0x1ac3('0xae')];}else if(_0x128cd3[_0x1ac3('0x8f')]['x-forwarded-for']){_0x2ae900=_[_0x1ac3('0xaf')](_0x128cd3['headers']['x-forwarded-for'][_0x1ac3('0xb0')](','));}if(_0x283744){var _0x407eda={'ContactId':_0x283744['id'],'ChatWebsiteId':_0x128cd3['params']['id'],'from':(_0x283744[_0x1ac3('0xb1')]||'')+'\x20'+(_0x283744[_0x1ac3('0xb2')]||''),'customerIp':_0x2ae900,'customerPort':_0x128cd3[_0x1ac3('0x8f')][_0x1ac3('0xb3')]?_0x128cd3['headers'][_0x1ac3('0xb3')]:null,'referer':_0x128cd3['body'][_0x1ac3('0xb4')],'browserName':_0x53047d[_0x1ac3('0xb5')][_0x1ac3('0x3d')]&&_0x53047d[_0x1ac3('0xb5')]['version']?util[_0x1ac3('0xb6')]('%s\x20%s',_0x53047d[_0x1ac3('0xb5')][_0x1ac3('0x3d')],_0x53047d[_0x1ac3('0xb5')][_0x1ac3('0xb7')]):'unknown','browserVersion':_0x53047d[_0x1ac3('0xb5')][_0x1ac3('0xb7')]||_0x1ac3('0xb8'),'osName':util[_0x1ac3('0xb6')](_0x1ac3('0xb9'),_0x53047d['os'][_0x1ac3('0x3d')],_0x53047d['os']['version']),'osVersion':_0x53047d['os'][_0x1ac3('0xb7')],'deviceModel':_0x53047d[_0x1ac3('0xba')]['model']&&_0x53047d[_0x1ac3('0xba')]['vendor']?util['format']('%s\x20%s\x20%s',_0x53047d[_0x1ac3('0xba')][_0x1ac3('0x47')],_0x53047d['device']['vendor'],_0x53047d[_0x1ac3('0xba')][_0x1ac3('0x45')]):null,'deviceVendor':_0x53047d['device'][_0x1ac3('0xbb')],'deviceType':_0x53047d[_0x1ac3('0xba')][_0x1ac3('0x45')],'formData':JSON[_0x1ac3('0x28')](_0x128cd3[_0x1ac3('0x67')])};var _0x58cff1={'ChatWebsiteId':_0x128cd3[_0x1ac3('0x5b')]['id'],'closed':![]};if(_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xbc')]){_0x58cff1[_0x1ac3('0xbc')]=_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xbc')];return db[_0x1ac3('0xbd')][_0x1ac3('0x62')]({'where':_0x58cff1})[_0x1ac3('0x23')](function(_0x483a3e){if(_0x483a3e){return[_0x483a3e,![]];}_0x407eda['threadId']=_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xbc')];_0x407eda['externalUrl']=_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xbe')];return db[_0x1ac3('0xbd')][_0x1ac3('0x5e')](_0x407eda)[_0x1ac3('0x23')](function(_0x2506ab){return[_0x2506ab,!![]];});});}_0x58cff1[_0x1ac3('0xbf')]=_0x283744['id'];if(_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xc0')]&&_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xc0')]['id']){_0x58cff1['id']=_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xc0')]['id'];return db[_0x1ac3('0xbd')][_0x1ac3('0x62')]({'where':_0x58cff1})['then'](function(_0x161c22){if(_0x161c22){return[_0x161c22,![]];}return db[_0x1ac3('0xbd')][_0x1ac3('0x5e')](_0x407eda)['then'](function(_0x3886e5){return[_0x3886e5,!![]];});});}return db[_0x1ac3('0xbd')][_0x1ac3('0x5e')](_0x407eda)[_0x1ac3('0x23')](function(_0x2fa5a1){return[_0x2fa5a1,!![]];});}})['spread'](function(_0x2b988f,_0x3dc636){if(_0x2b988f){_0x100a8c=_0x3dc636;if(!_0x3dc636){var _0x20ef05={'from':(_0x2d7688[_0x1ac3('0xac')][_0x1ac3('0xb1')]||'')+'\x20'+(_0x2d7688[_0x1ac3('0xac')][_0x1ac3('0xb2')]||'')};if(_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xbc')]&&_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xc1')]&&_0x128cd3['body']['threadId']!=_0x128cd3[_0x1ac3('0x67')]['messageId']){_0x20ef05[_0x1ac3('0xbc')]=_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xc1')];}return _0x2b988f[_0x1ac3('0x66')](_0x20ef05);}else{return _0x2b988f;}}})[_0x1ac3('0x23')](function(_0x65b92e){_0x2d7688[_0x1ac3('0xc0')]=_0x65b92e[_0x1ac3('0x39')]({'plain':!![]});_0x2d7688['interaction'][_0x1ac3('0xc2')]=_0x100a8c;if(_0x2d7688[_0x1ac3('0xc0')][_0x1ac3('0xc2')]){if(_0x2d7688[_0x1ac3('0xa5')]['autoclose']){_0x2d7688[_0x1ac3('0xa6')][_0x1ac3('0xc3')]({'id':0x0,'priority':_0x2d7688[_0x1ac3('0xa6')][_0x1ac3('0x4f')]+0x1,'app':_0x1ac3('0xc4'),'appdata':_0x1ac3('0xc5'),'interval':_0x1ac3('0xc6')});}}return db['ChatMessage'][_0x1ac3('0x5e')]({'body':_0x128cd3['body']['body'],'ChatWebsiteId':_0x128cd3[_0x1ac3('0x5b')]['id'],'ChatInteractionId':_0x65b92e['id'],'direction':'in','ContactId':_0x2d7688['contact']['id'],'AttachmentId':_0x128cd3[_0x1ac3('0x67')][_0x1ac3('0xc7')]});})[_0x1ac3('0x23')](function(_0x35817f){_0x2d7688['message']=_0x35817f;if(_0x2d7688[_0x1ac3('0xc0')][_0x1ac3('0xc8')]){return db[_0x1ac3('0xc9')][_0x1ac3('0x62')]({'attributes':['id','name'],'where':{'id':_0x2d7688[_0x1ac3('0xc0')][_0x1ac3('0xc8')]}})[_0x1ac3('0x23')](function(_0x60474d){if(_0x60474d){_0x2d7688[_0x1ac3('0xa6')][_0x1ac3('0xca')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x60474d[_0x1ac3('0x3d')]+','+(_0x2d7688['account']['waitForTheAssignedAgent']||0xa),'interval':_0x1ac3('0xc6')});_0x2d7688['forcedOwnership']=!![];}return respondWithRpcPromise(_0x1ac3('0xcb'),_0x1ac3('0xcc'),_0x2d7688);});}return respondWithRpcPromise(_0x1ac3('0xcb'),_0x1ac3('0xcc'),_0x2d7688);})[_0x1ac3('0x23')](function(_0x10674d){respondWithRpcPromise('EventManager',_0x1ac3('0xcd'),{'event':'notify','message':_0x10674d},client9002);return _0x10674d;})[_0x1ac3('0x23')](respondWithResult(_0x113a0e,null))[_0x1ac3('0x5a')](handleError(_0x113a0e,null));};exports[_0x1ac3('0xce')]=function(_0x2b541a,_0xa2ddfb,_0x226d18){var _0x102cec,_0x3d047a,_0x3fa48e;var _0x4ed99e=[];var _0x1ca585=[];var _0x40d9cf={};var _0x502848=_0x2b541a[_0x1ac3('0xcf')]||[];var _0x4b6529=[];var _0x567e09;return db[_0x1ac3('0x93')][_0x1ac3('0x68')]()[_0x1ac3('0x23')](function(_0x18b4b0){if(!_0x18b4b0){throw new db['Sequelize'][(_0x1ac3('0x95'))](_0x1ac3('0x96'));}_0x1ca585=_[_0x1ac3('0x97')](_[_0x1ac3('0x4a')](_0x18b4b0),[_0x1ac3('0x98'),_0x1ac3('0x99')]);_0x4ed99e=_[_0x1ac3('0x97')](_[_0x1ac3('0x4a')](_0x18b4b0),[_0x1ac3('0x98'),_0x1ac3('0x99'),'CompanyId',_0x1ac3('0x9b')]);if(_0x2b541a[_0x1ac3('0x67')]['id']){delete _0x2b541a[_0x1ac3('0x67')]['id'];}if(_[_0x1ac3('0x81')](_0x2b541a[_0x1ac3('0x67')][_0x1ac3('0x9c')])){throw _0xa2ddfb['status'](0x1f4)['send'](new db[(_0x1ac3('0x94'))][(_0x1ac3('0x95'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x2b541a[_0x1ac3('0x67')][_0x1ac3('0x67')])||_0x2b541a[_0x1ac3('0x67')][_0x1ac3('0x67')]===''){throw _0xa2ddfb['status'](0x1f4)[_0x1ac3('0x3e')](new db[(_0x1ac3('0x94'))][(_0x1ac3('0x95'))](_0x1ac3('0x9e')));}if(_[_0x1ac3('0x81')](_0x2b541a['body'][_0x1ac3('0xd0')])){throw _0xa2ddfb[_0x1ac3('0x2e')](0x1f4)[_0x1ac3('0x3e')](new db[(_0x1ac3('0x94'))][(_0x1ac3('0x95'))](_0x1ac3('0xd1')+_0x4ed99e));}if(!_[_0x1ac3('0xd2')](_0x4ed99e,_0x2b541a[_0x1ac3('0x67')][_0x1ac3('0xd0')])){throw _0xa2ddfb[_0x1ac3('0x2e')](0x1f4)[_0x1ac3('0x3e')](new db[(_0x1ac3('0x94'))]['ValidationError'](_0x1ac3('0xd3')+_0x4ed99e));}_0x40d9cf[_0x2b541a[_0x1ac3('0x67')][_0x1ac3('0xd0')]]=_0x2b541a[_0x1ac3('0x67')][_0x1ac3('0x9c')];})[_0x1ac3('0x23')](function(){return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x2b541a[_0x1ac3('0x5b')]['id']},'include':[{'model':db[_0x1ac3('0xa1')],'as':_0x1ac3('0xa2')},{'model':db[_0x1ac3('0xd4')],'as':_0x1ac3('0xd4')}]});})[_0x1ac3('0x23')](handleEntityNotFound(_0xa2ddfb,null))['then'](function(_0x164ad2){if(_0x164ad2&&_0x164ad2['List']){_0x3d047a=_0x164ad2;var _0x131b6c=_[_0x1ac3('0x1b')](_0x2b541a[_0x1ac3('0x67')],{'firstName':_0x2b541a['body'][_0x1ac3('0x9c')],'phone':_0x2b541a[_0x1ac3('0x67')]['from'],'ListId':_0x164ad2[_0x1ac3('0x9b')]});_0x131b6c[_0x2b541a[_0x1ac3('0x67')][_0x1ac3('0xd0')]]=_0x2b541a[_0x1ac3('0x67')][_0x1ac3('0x9c')];return db['CmContact'][_0x1ac3('0xd5')]({'where':_0x40d9cf,'defaults':_0x131b6c});}})['spread'](function(_0x5fe055){if(_0x5fe055){_0x3fa48e=_0x5fe055;var _0x4c435c=fs[_0x1ac3('0xd6')](path[_0x1ac3('0x7d')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x1ac3('0xd7'));var _0x27d3c9=ejs['render'](_0x4c435c,{'body':_['toPairs'](_0x2b541a[_0x1ac3('0x67')]['body']),'bodyTitle':_0x3d047a[_0x1ac3('0xd8')]});return db[_0x1ac3('0xd9')]['create']({'body':_0x27d3c9,'ContactId':_0x5fe055['id'],'ChatWebsiteId':_0x3d047a['id']});}})[_0x1ac3('0x23')](function(_0x44eafc){_0x567e09=_0x44eafc;if(_0x502848[_0x1ac3('0x4f')]){var _0x42cc3d=_0x502848[_0x1ac3('0x48')](function(_0x4d2d5d){return{'name':_0x4d2d5d[_0x1ac3('0xda')],'basename':_0x4d2d5d[_0x1ac3('0x76')],'type':_0x4d2d5d[_0x1ac3('0xdb')],'ChatOfflineMessageId':_0x44eafc['id']};});_0x4b6529=_0x42cc3d[_0x1ac3('0x48')](_0x3b4bd3=>{var _0x1e795a={'filename':_0x3b4bd3['name'],'path':path[_0x1ac3('0x7d')](config[_0x1ac3('0x83')],_0x1ac3('0xdc'),_0x1ac3('0xcf'),_0x1ac3('0xdd'),_0x1ac3('0xde'),_0x3b4bd3[_0x1ac3('0xdf')])};return _0x1e795a;});if(!_0x3d047a[_0x1ac3('0xe0')]){return db[_0x1ac3('0xe1')][_0x1ac3('0xe2')](function(_0x425d51){return db['Attachment']['bulkCreate'](_0x42cc3d,{'transaction':_0x425d51});});}}})[_0x1ac3('0x23')](function(){if(_0x567e09){_0x102cec=_0x567e09;return db[_0x1ac3('0xd4')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x1ac3('0xe3')],'as':_0x1ac3('0xe4'),'raw':!![]}]});}})[_0x1ac3('0x23')](function(_0x1133a9){if(_0x1133a9&&_0x1133a9[_0x1ac3('0xe4')]&&_0x3d047a[_0x1ac3('0xe5')]&&_0x3d047a[_0x1ac3('0xe6')]){var _0x1520fc={'tls':{'rejectUnauthorized':![]}};if(_0x1133a9[_0x1ac3('0xe4')][_0x1ac3('0xe7')]){_0x1520fc['service']=_0x1133a9[_0x1ac3('0xe4')][_0x1ac3('0xe7')];}else{_0x1520fc['host']=_0x1133a9['Smtp']['host'];_0x1520fc[_0x1ac3('0xe8')]=_0x1133a9[_0x1ac3('0xe4')]['port'];_0x1520fc[_0x1ac3('0xe9')]=_0x1133a9[_0x1ac3('0xe4')][_0x1ac3('0xe9')];}if(_0x1133a9[_0x1ac3('0xe4')][_0x1ac3('0xea')]){_0x1520fc['auth']={'user':_0x1133a9['Smtp'][_0x1ac3('0x5f')],'pass':_0x1133a9['Smtp'][_0x1ac3('0xeb')]};}return respondWithRpcPromise(_0x1ac3('0xec'),'sendMail',{'account':_0x1520fc,'message':{'from':util[_0x1ac3('0xb6')](_0x1ac3('0xed'),_0x1133a9[_0x1ac3('0x3d')],_0x1133a9[_0x1ac3('0xee')]||_0x1133a9[_0x1ac3('0xe4')][_0x1ac3('0x5f')]),'to':_0x3d047a[_0x1ac3('0xe6')],'subject':_0x3d047a[_0x1ac3('0xef')],'text':_0x102cec[_0x1ac3('0x67')],'attachments':_0x4b6529}},client9003)[_0x1ac3('0x23')](function(){return _0x102cec;})['catch'](function(_0x13d245){console[_0x1ac3('0x29')](_0x13d245);});}})[_0x1ac3('0x23')](function(){if(_0x3d047a&&_0x3d047a['openNewInteraction']&&_0x3d047a[_0x1ac3('0xf0')]){var _0x18beb7=[];if(_0x502848[_0x1ac3('0x4f')]){_0x18beb7=_0x502848[_0x1ac3('0x48')](function(_0x409f22){return{'name':_0x409f22[_0x1ac3('0xda')],'basename':_0x409f22['filename'],'type':_0x409f22[_0x1ac3('0xdb')],'ChatOfflineMessageId':_0x567e09['id']};});}var _0x3b79cb;if(!_[_0x1ac3('0x81')](_0x3d047a[_0x1ac3('0xf1')])){var _0x29ece7=_['map'](_0x2b541a[_0x1ac3('0x67')],function(_0x413433){return _0x413433;});var _0x40b435=_[_0x1ac3('0xf2')](_0x29ece7)[0x0];var _0x433b63=_[_0x1ac3('0xf3')](_0x40b435,function(_0x9f186d){return _0x9f186d;});_0x3b79cb=_0x433b63[0x1][_0x3d047a[_0x1ac3('0xf1')]];}var _0x502a5a={'from':_0x3fa48e['email'],'firstName':_0x3fa48e[_0x1ac3('0xb1')],'lastName':_0x3fa48e['lastName'],'mapKey':_0x1ac3('0xee'),'message':{'from':_0x3fa48e[_0x1ac3('0xee')],'to':_0x3d047a[_0x1ac3('0xd4')][_0x1ac3('0xee')],'cc':'','subject':_[_0x1ac3('0x81')](_0x3b79cb)?_0x3d047a[_0x1ac3('0xef')]:_0x3b79cb,'messageId':'','sentAt':new Date(),'attach':_0x18beb7[_0x1ac3('0x4f')],'attachments':_0x18beb7,'originChannel':'Chat','ChatWebsiteId':_0x3d047a['id'],'ChatOfflineMessageId':_0x102cec['id'],'originTo':_0x3d047a['MailAccount']['email']},'body':_0x102cec['body']};var _0x3bd622={'account':{'id':_0x3d047a['MailAccountId']},'body':_0x502a5a,'log':_0x1ac3('0xf4')};return respondWithRpcPromise('NotifyMailAccount',_0x1ac3('0xf5'),_0x3bd622,client9001)['then'](function(){return _0x102cec;})['catch'](function(_0x4260a6){console[_0x1ac3('0x29')](_0x4260a6);});}return;})[_0x1ac3('0x23')](function(){if(_0x102cec){return _0x102cec;}})[_0x1ac3('0x23')](respondWithResult(_0xa2ddfb,null))[_0x1ac3('0x5a')](function(_0x556603){console[_0x1ac3('0x29')]('catch',_0x556603);for(var _0x2dce91 of _0x502848){var _0x5c4582=path['join'](config[_0x1ac3('0x83')],_0x1ac3('0xdc'),'files',_0x1ac3('0xdd'),_0x1ac3('0xde'),_0x2dce91[_0x1ac3('0x76')]);fs_extra[_0x1ac3('0xf6')](_0x5c4582)[_0x1ac3('0x5a')](function(_0x35e1fe){console[_0x1ac3('0x29')](_0x1ac3('0xf7'),_0x5c4582,_0x35e1fe);});}});};exports[_0x1ac3('0xf8')]=function(_0x363cef,_0x2d8843,_0x1f6078){return db[_0x1ac3('0xbd')][_0x1ac3('0x62')]({'where':{'id':_0x363cef[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x2d8843,null))['then'](function(_0x1e52a6){if(_0x1e52a6){return _0x1e52a6[_0x1ac3('0xf8')](_0x363cef[_0x1ac3('0x67')][_0x1ac3('0x70')],_[_0x1ac3('0xf9')](_0x363cef['body'],[_0x1ac3('0x70'),'id'])||{});}})[_0x1ac3('0x23')](respondWithResult(_0x2d8843,null))['catch'](handleError(_0x2d8843,null));};exports[_0x1ac3('0xfa')]=function(_0x10ffd4,_0xcbc2a3,_0x4a02e3){var _0x59fa4e={'raw':![],'where':{}};var _0x553a6d={};var _0x46f333={'count':0x0,'rows':[]};return db[_0x1ac3('0x42')][_0x1ac3('0x6b')]({'where':{'id':_0x10ffd4[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0xcbc2a3,null))['then'](function(_0x526cf6){if(_0x526cf6){_0x553a6d[_0x1ac3('0x47')]=_[_0x1ac3('0x4a')](db[_0x1ac3('0xbd')][_0x1ac3('0x43')]);_0x553a6d[_0x1ac3('0x49')]=_[_0x1ac3('0x4a')](_0x10ffd4['query']);_0x553a6d[_0x1ac3('0x4b')]=_[_0x1ac3('0x4c')](_0x553a6d[_0x1ac3('0x47')],_0x553a6d[_0x1ac3('0x49')]);_0x59fa4e[_0x1ac3('0x4d')]=_[_0x1ac3('0x4c')](_0x553a6d['model'],qs[_0x1ac3('0x4e')](_0x10ffd4['query'][_0x1ac3('0x4e')]));_0x59fa4e['attributes']=_0x59fa4e[_0x1ac3('0x4d')][_0x1ac3('0x4f')]?_0x59fa4e['attributes']:_0x553a6d[_0x1ac3('0x47')];if(!_0x10ffd4[_0x1ac3('0x49')][_0x1ac3('0x6c')]('nolimit')){_0x59fa4e['limit']=qs[_0x1ac3('0x33')](_0x10ffd4[_0x1ac3('0x49')][_0x1ac3('0x33')]);_0x59fa4e[_0x1ac3('0x32')]=qs[_0x1ac3('0x32')](_0x10ffd4[_0x1ac3('0x49')][_0x1ac3('0x32')]);}_0x59fa4e[_0x1ac3('0x51')]=qs['sort'](_0x10ffd4[_0x1ac3('0x49')][_0x1ac3('0x52')]);_0x59fa4e[_0x1ac3('0x53')]=qs[_0x1ac3('0x4b')](_['pick'](_0x10ffd4[_0x1ac3('0x49')],_0x553a6d['filters']));_0x59fa4e['where']['ChatWebsiteId']=_0x526cf6['id'];if(_0x10ffd4[_0x1ac3('0x49')][_0x1ac3('0x54')]){_0x59fa4e[_0x1ac3('0x53')]=_[_0x1ac3('0x55')](_0x59fa4e['where'],{'$or':_[_0x1ac3('0x48')](_0x59fa4e['attributes'],function(_0x687b44){var _0x40b13c={};_0x40b13c[_0x687b44]={'$like':'%'+_0x10ffd4[_0x1ac3('0x49')][_0x1ac3('0x54')]+'%'};return _0x40b13c;})});}_0x59fa4e=_[_0x1ac3('0x55')]({},_0x59fa4e,_0x10ffd4['options']);return db['ChatInteraction'][_0x1ac3('0x31')]({'where':_0x59fa4e[_0x1ac3('0x53')]})[_0x1ac3('0x23')](function(_0x40d1cc){_0x46f333['count']=_0x40d1cc;if(_0x10ffd4[_0x1ac3('0x49')]['includeAll']){_0x59fa4e[_0x1ac3('0x5d')]=[{'model':db['CmContact'],'as':_0x1ac3('0xfb'),'required':![]},{'model':db[_0x1ac3('0xc9')],'as':_0x1ac3('0xfc'),'attributes':['name',_0x1ac3('0xfd'),'internal'],'required':![]},{'model':db[_0x1ac3('0xfe')],'as':_0x1ac3('0xff'),'attributes':['id',_0x1ac3('0x3d'),_0x1ac3('0x100')],'where':_0x10ffd4[_0x1ac3('0x49')][_0x1ac3('0x101')]?{'id':_0x10ffd4[_0x1ac3('0x49')]['tag']}:undefined,'required':_0x10ffd4[_0x1ac3('0x49')][_0x1ac3('0x101')]?!![]:![]}];}return db[_0x1ac3('0xbd')][_0x1ac3('0x58')](_0x59fa4e);})[_0x1ac3('0x23')](function(_0x1ca8d7){_0x46f333['rows']=_0x1ca8d7;return _0x46f333;});}})[_0x1ac3('0x23')](respondWithFilteredResult(_0xcbc2a3,_0x59fa4e))[_0x1ac3('0x5a')](handleError(_0xcbc2a3,null));};function iftimePromise(_0x33494b,_0x1d710b){return respondWithRpcPromise(_0x1ac3('0x102'),_0x1ac3('0x103'),{'command':_0x1d710b[_0x1ac3('0x104')]?util['format'](_0x1ac3('0x105'),_0x33494b[_0x1ac3('0x106')],_0x1d710b[_0x1ac3('0x104')]):util['format']('iftime\x20%s',_0x33494b[_0x1ac3('0x106')])},client9002)[_0x1ac3('0x23')](function(_0xbbe61e){var _0x3af241=_0xbbe61e&&_0xbbe61e[_0x1ac3('0x107')](_0x1ac3('0x108'))>=0x0?!![]:![];logger['info'](_0x1ac3('0x109'),_0x1d710b['id'],_0x33494b['id'],_0x33494b[_0x1ac3('0x106')],_0x3af241?_0x1ac3('0x10a'):_0x1ac3('0x10b'),_0x1d710b[_0x1ac3('0x104')]?_0x1d710b[_0x1ac3('0x104')]:_0x1ac3('0x10c'));return _0x3af241;})['catch'](function(_0x28951d){logger[_0x1ac3('0x29')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1d710b['id'],_0x33494b['id'],_0x33494b[_0x1ac3('0x106')],util[_0x1ac3('0x10d')](_0x28951d,{'showHidden':![],'depth':null}),_0x1d710b['timezone']?_0x1d710b[_0x1ac3('0x104')]:_0x1ac3('0x10c'));return![];});}exports[_0x1ac3('0x103')]=function(_0x543676,_0x3fc28b,_0x108bae){var _0x440ba3=0x0;var _0x335a74=0x0;var _0x2fd9c3=![];var _0x5b765a;var _0x12de03;return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x543676[_0x1ac3('0x5b')]['id']},'include':[{'model':db[_0x1ac3('0x10e')],'as':_0x1ac3('0x10e'),'include':[{'model':db[_0x1ac3('0x10e')],'as':_0x1ac3('0x10f'),'attributes':['id',_0x1ac3('0x106')],'raw':!![]}]}]})[_0x1ac3('0x23')](handleEntityNotFound(_0x3fc28b,null))[_0x1ac3('0x23')](function(_0x54dcef){if(_0x54dcef){_0x5b765a=_0x54dcef;return _0x54dcef[_0x1ac3('0x110')]({'raw':!![]});}})['then'](function(_0x5727de){if(_0x5b765a){if(_0x5727de){_0x12de03=_0x5727de;}}return require('../../config/license/util')[_0x1ac3('0x7f')]();})[_0x1ac3('0x23')](function(_0x35980e){if(_0x35980e){_0x335a74=_0x35980e[_0x1ac3('0x111')];_0x2fd9c3=_0x35980e[_0x1ac3('0x80')];}})[_0x1ac3('0x23')](function(){return db[_0x1ac3('0xbd')][_0x1ac3('0x31')]({'where':{'closed':![]}});})[_0x1ac3('0x23')](function(_0x1cea4d){_0x440ba3=_0x1cea4d;if(_0x335a74&&_0x1cea4d>_0x335a74){return db[_0x1ac3('0x112')][_0x1ac3('0x6b')]({'where':{'id':0x1}})[_0x1ac3('0x23')](function(_0x29d4fc){if(_0x29d4fc){_0x29d4fc[_0x1ac3('0x113')](_0x1ac3('0x114'));}});}})[_0x1ac3('0x23')](function(){if(_0x5b765a['Interval']&&_0x5b765a[_0x1ac3('0x10e')][_0x1ac3('0x10f')]){var _0x167f0c=[];for(var _0x1f7d3e=0x0;_0x1f7d3e<_0x5b765a[_0x1ac3('0x10e')][_0x1ac3('0x10f')][_0x1ac3('0x4f')];_0x1f7d3e++){var _0x3cc1bb=_0x5b765a[_0x1ac3('0x10e')]['Intervals'][_0x1f7d3e][_0x1ac3('0x39')]({'plain':!![]});_0x167f0c[_0x1ac3('0xc3')](iftimePromise(_0x3cc1bb,_0x5b765a));}return BPromise[_0x1ac3('0x115')](_0x167f0c)['then'](function(_0x1212fd){return _[_0x1ac3('0x116')](_0x1212fd);});}else{return!![];}})['then'](function(_0x4e8d94){var _0x303ee1=fs[_0x1ac3('0xd6')](path[_0x1ac3('0x7d')](config[_0x1ac3('0x83')],_0x1ac3('0x117')),_0x1ac3('0xd7'));var _0x5e86b7={'remote':_0x5b765a[_0x1ac3('0x118')],'query':querystring['stringify'](_['merge'](_0x5b765a['get']({'plain':!![]}),{'customerIp':_0x543676[_0x1ac3('0x8f')][_0x1ac3('0x119')]||_0x543676['headers'][_0x1ac3('0x11a')]||_0x543676[_0x1ac3('0x11b')][_0x1ac3('0x11c')]||_0x543676['ip'],'referer':_0x543676[_0x1ac3('0x8f')][_0x1ac3('0xb4')],'openedInteractions':_0x440ba3,'maxInteractions':_0x335a74,'virtual':_0x2fd9c3['virtual'],'online':_0x4e8d94,'custom':_0x2fd9c3}))[_0x1ac3('0x11d')](/'/g,'\x5c\x27')};_0x3fc28b[_0x1ac3('0x3e')](ejs[_0x1ac3('0x11e')](Mustache[_0x1ac3('0x11e')](_0x303ee1,_0x5e86b7),{'proactiveActions':_0x12de03,'alignment':_0x5b765a['alignment'],'verticalAlignment':_0x5b765a['verticalAlignment'],'div_color':_0x5b765a[_0x1ac3('0x100')],'text_color':_0x5b765a[_0x1ac3('0x11f')],'button_color':_0x5b765a[_0x1ac3('0x120')],'background_color':_0x5b765a['backgroundColor']}));})['catch'](handleError(_0x3fc28b,null));};exports[_0x1ac3('0x121')]=function(_0x53eff0,_0x548881,_0x456e15){return db['ChatWebsite'][_0x1ac3('0x6b')]({'where':{'id':_0x53eff0[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x548881,null))[_0x1ac3('0x23')](function(_0x1b7955){if(_0x1b7955){return db[_0x1ac3('0xe1')][_0x1ac3('0xe2')](function(_0xd90038){return db[_0x1ac3('0xa4')][_0x1ac3('0x38')]({'where':{'ChatWebsiteId':_0x53eff0[_0x1ac3('0x5b')]['id']},'transaction':_0xd90038})['then'](function(_0xf9fee8){var _0x56003e=_[_0x1ac3('0x48')](_0x53eff0['body'],function(_0x1217a5){_0x1217a5[_0x1ac3('0x6e')]=_0x53eff0[_0x1ac3('0x5b')]['id'];return _0x1217a5;});return db[_0x1ac3('0xa4')][_0x1ac3('0x122')](_0x56003e,{'transaction':_0xd90038});});})[_0x1ac3('0x23')](function(){return db['ChatApplication'][_0x1ac3('0x123')]({'where':{'ChatWebsiteId':_0x53eff0[_0x1ac3('0x5b')]['id']},'order':'priority'});});}})[_0x1ac3('0x23')](respondWithResult(_0x548881,null))[_0x1ac3('0x5a')](handleError(_0x548881,null));};exports[_0x1ac3('0x124')]=function(_0x3e0925,_0xa2dbe9,_0xc4012){var _0x2af72a={};var _0x3c0ec5={};var _0x4fe957;var _0x11105b;return db[_0x1ac3('0x42')][_0x1ac3('0x6b')]({'where':{'id':_0x3e0925['params']['id']}})['then'](handleEntityNotFound(_0xa2dbe9,null))[_0x1ac3('0x23')](function(_0x588dba){if(_0x588dba){_0x4fe957=_0x588dba;_0x3c0ec5[_0x1ac3('0x47')]=_[_0x1ac3('0x4a')](db[_0x1ac3('0xa4')][_0x1ac3('0x43')]);_0x3c0ec5[_0x1ac3('0x49')]=_['keys'](_0x3e0925[_0x1ac3('0x49')]);_0x3c0ec5[_0x1ac3('0x4b')]=_[_0x1ac3('0x4c')](_0x3c0ec5[_0x1ac3('0x47')],_0x3c0ec5[_0x1ac3('0x49')]);_0x2af72a['attributes']=_['intersection'](_0x3c0ec5[_0x1ac3('0x47')],qs[_0x1ac3('0x4e')](_0x3e0925[_0x1ac3('0x49')][_0x1ac3('0x4e')]));_0x2af72a['attributes']=_0x2af72a[_0x1ac3('0x4d')][_0x1ac3('0x4f')]?_0x2af72a[_0x1ac3('0x4d')]:_0x3c0ec5['model'];_0x2af72a[_0x1ac3('0x51')]=qs[_0x1ac3('0x52')](_0x3e0925[_0x1ac3('0x49')]['sort']);_0x2af72a['where']=qs[_0x1ac3('0x4b')](_[_0x1ac3('0x6d')](_0x3e0925['query'],_0x3c0ec5[_0x1ac3('0x4b')]));if(_0x3e0925['query'][_0x1ac3('0x54')]){_0x2af72a[_0x1ac3('0x53')]=_[_0x1ac3('0x55')](_0x2af72a[_0x1ac3('0x53')],{'$or':_[_0x1ac3('0x48')](_0x2af72a[_0x1ac3('0x4d')],function(_0x548bf4){var _0x58e90f={};_0x58e90f[_0x548bf4]={'$like':'%'+_0x3e0925[_0x1ac3('0x49')][_0x1ac3('0x54')]+'%'};return _0x58e90f;})});}_0x2af72a=_[_0x1ac3('0x55')]({},_0x2af72a,_0x3e0925[_0x1ac3('0x57')]);return _0x4fe957[_0x1ac3('0x124')](_0x2af72a);}})[_0x1ac3('0x23')](function(_0x340d15){if(_0x340d15){_0x11105b=_0x340d15[_0x1ac3('0x4f')];if(!_0x3e0925[_0x1ac3('0x49')][_0x1ac3('0x6c')](_0x1ac3('0x50'))){_0x2af72a[_0x1ac3('0x33')]=qs[_0x1ac3('0x33')](_0x3e0925[_0x1ac3('0x49')][_0x1ac3('0x33')]);_0x2af72a['offset']=qs['offset'](_0x3e0925[_0x1ac3('0x49')][_0x1ac3('0x32')]);}return _0x4fe957[_0x1ac3('0x124')](_0x2af72a);}})[_0x1ac3('0x23')](function(_0x1dfefd){if(_0x1dfefd){return _0x1dfefd?{'count':_0x11105b,'rows':_0x1dfefd}:null;}})[_0x1ac3('0x23')](respondWithResult(_0xa2dbe9,null))[_0x1ac3('0x5a')](handleError(_0xa2dbe9,null));};exports[_0x1ac3('0x125')]=function(_0x544769,_0x25039d,_0x101a12){return db['chatProactiveAction'][_0x1ac3('0x62')]({'where':{'id':_0x544769[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x25039d,null))[_0x1ac3('0x23')](function(_0x843684){if(_0x843684){return _0x843684['addProactiveActions'](_0x544769[_0x1ac3('0x67')]['ids'],_[_0x1ac3('0xf9')](_0x544769['body'],['ids','id'])||{});}})[_0x1ac3('0x23')](respondWithResult(_0x25039d,null))['catch'](handleError(_0x25039d,null));};exports[_0x1ac3('0x110')]=function(_0x4771c0,_0x38dee5,_0x28bbab){var _0x165558={};var _0x3cc6d4={};var _0xaa6d64;var _0x35a6e8;return db['ChatWebsite'][_0x1ac3('0x6b')]({'where':{'id':_0x4771c0[_0x1ac3('0x5b')]['id']}})['then'](handleEntityNotFound(_0x38dee5,null))[_0x1ac3('0x23')](function(_0x3ab9ee){if(_0x3ab9ee){_0xaa6d64=_0x3ab9ee;_0x3cc6d4[_0x1ac3('0x47')]=_[_0x1ac3('0x4a')](db[_0x1ac3('0x126')][_0x1ac3('0x43')]);_0x3cc6d4['query']=_[_0x1ac3('0x4a')](_0x4771c0['query']);_0x3cc6d4[_0x1ac3('0x4b')]=_['intersection'](_0x3cc6d4[_0x1ac3('0x47')],_0x3cc6d4['query']);_0x165558[_0x1ac3('0x4d')]=_[_0x1ac3('0x4c')](_0x3cc6d4['model'],qs['fields'](_0x4771c0[_0x1ac3('0x49')][_0x1ac3('0x4e')]));_0x165558[_0x1ac3('0x4d')]=_0x165558[_0x1ac3('0x4d')][_0x1ac3('0x4f')]?_0x165558[_0x1ac3('0x4d')]:_0x3cc6d4[_0x1ac3('0x47')];_0x165558[_0x1ac3('0x51')]=qs[_0x1ac3('0x52')](_0x4771c0['query']['sort']);_0x165558[_0x1ac3('0x53')]=qs[_0x1ac3('0x4b')](_[_0x1ac3('0x6d')](_0x4771c0[_0x1ac3('0x49')],_0x3cc6d4['filters']));if(_0x4771c0[_0x1ac3('0x49')]['filter']){_0x165558['where']=_[_0x1ac3('0x55')](_0x165558[_0x1ac3('0x53')],{'$or':_['map'](_0x165558[_0x1ac3('0x4d')],function(_0x4b273b){var _0x953672={};_0x953672[_0x4b273b]={'$like':'%'+_0x4771c0[_0x1ac3('0x49')][_0x1ac3('0x54')]+'%'};return _0x953672;})});}_0x165558=_[_0x1ac3('0x55')]({},_0x165558,_0x4771c0[_0x1ac3('0x57')]);return _0xaa6d64[_0x1ac3('0x110')](_0x165558);}})['then'](function(_0x368572){if(_0x368572){_0x35a6e8=_0x368572[_0x1ac3('0x4f')];if(!_0x4771c0['query'][_0x1ac3('0x6c')](_0x1ac3('0x50'))){_0x165558[_0x1ac3('0x33')]=qs[_0x1ac3('0x33')](_0x4771c0[_0x1ac3('0x49')]['limit']);_0x165558[_0x1ac3('0x32')]=qs[_0x1ac3('0x32')](_0x4771c0['query'][_0x1ac3('0x32')]);}return _0xaa6d64[_0x1ac3('0x110')](_0x165558);}})[_0x1ac3('0x23')](function(_0x3b566e){if(_0x3b566e){return _0x3b566e?{'count':_0x35a6e8,'rows':_0x3b566e}:null;}})[_0x1ac3('0x23')](respondWithResult(_0x38dee5,null))[_0x1ac3('0x5a')](handleError(_0x38dee5,null));};exports[_0x1ac3('0x127')]=function(_0x216bf6,_0x48978d,_0x4193e4){var _0x2a9db2=_0x216bf6['query'][_0x1ac3('0x128')]==='false'?_0x1ac3('0x129'):'onlineForm';return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'attributes':['id',_0x2a9db2],'where':{'id':_0x216bf6[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x48978d,null))[_0x1ac3('0x23')](function(_0x1350e3){if(_0x1350e3){var _0x3389e9=_0x1350e3[_0x2a9db2];var _0xe11bd9=_0x3389e9&&_0x3389e9[_0x1ac3('0x12a')]?_0x3389e9[_0x1ac3('0x12a')]:[];_0x48978d[_0x1ac3('0x3e')]({'fromKey':_[_0x1ac3('0x81')](_0x3389e9['fromKey'])?undefined:_0x3389e9['fromKey'],'count':_0xe11bd9['length'],'rows':_0xe11bd9});}})[_0x1ac3('0x5a')](handleError(_0x48978d,null));};exports[_0x1ac3('0x12b')]=function(_0x28fc88,_0x8c7ec1,_0x2af7e1){var _0x2e6fa3={'raw':![],'where':{}};var _0x1b2f82={};var _0x2da150={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x28fc88[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x8c7ec1,null))[_0x1ac3('0x23')](function(_0x10783b){if(_0x10783b){_0x1b2f82['model']=_[_0x1ac3('0x4a')](db['ChatOfflineMessage'][_0x1ac3('0x43')]);_0x1b2f82[_0x1ac3('0x49')]=_[_0x1ac3('0x4a')](_0x28fc88[_0x1ac3('0x49')]);_0x1b2f82[_0x1ac3('0x4b')]=_['intersection'](_0x1b2f82[_0x1ac3('0x47')],_0x1b2f82[_0x1ac3('0x49')]);_0x2e6fa3[_0x1ac3('0x4d')]=_[_0x1ac3('0x4c')](_0x1b2f82[_0x1ac3('0x47')],qs[_0x1ac3('0x4e')](_0x28fc88['query']['fields']));_0x2e6fa3[_0x1ac3('0x4d')]=_0x2e6fa3[_0x1ac3('0x4d')]['length']?_0x2e6fa3[_0x1ac3('0x4d')]:_0x1b2f82[_0x1ac3('0x47')];if(!_0x28fc88[_0x1ac3('0x49')]['hasOwnProperty']('nolimit')){_0x2e6fa3[_0x1ac3('0x33')]=qs[_0x1ac3('0x33')](_0x28fc88[_0x1ac3('0x49')][_0x1ac3('0x33')]);_0x2e6fa3[_0x1ac3('0x32')]=qs['offset'](_0x28fc88['query'][_0x1ac3('0x32')]);}_0x2e6fa3[_0x1ac3('0x51')]=qs[_0x1ac3('0x52')](_0x28fc88[_0x1ac3('0x49')][_0x1ac3('0x52')]);_0x2e6fa3[_0x1ac3('0x53')]=qs[_0x1ac3('0x4b')](_[_0x1ac3('0x6d')](_0x28fc88['query'],_0x1b2f82[_0x1ac3('0x4b')]));_0x2e6fa3['where']['ChatWebsiteId']=_0x10783b['id'];if(_0x28fc88[_0x1ac3('0x49')][_0x1ac3('0x54')]){_0x2e6fa3[_0x1ac3('0x53')]=_[_0x1ac3('0x55')](_0x2e6fa3[_0x1ac3('0x53')],{'$or':_[_0x1ac3('0x48')](_0x2e6fa3['attributes'],function(_0x153846){var _0x480e58={};_0x480e58[_0x153846]={'$like':'%'+_0x28fc88[_0x1ac3('0x49')][_0x1ac3('0x54')]+'%'};return _0x480e58;})});}_0x2e6fa3=_[_0x1ac3('0x55')]({},_0x2e6fa3,_0x28fc88[_0x1ac3('0x57')]);return db[_0x1ac3('0xd9')][_0x1ac3('0x31')]({'where':_0x2e6fa3[_0x1ac3('0x53')]})[_0x1ac3('0x23')](function(_0x30feef){_0x2da150['count']=_0x30feef;if(_0x28fc88[_0x1ac3('0x49')]['includeAll']){_0x2e6fa3[_0x1ac3('0x5d')]=[{'all':!![]}];}else{_0x2e6fa3['include']=[{'model':db[_0x1ac3('0x93')],'as':_0x1ac3('0xfb'),'required':![]},{'model':db[_0x1ac3('0x12c')],'as':_0x1ac3('0x12d'),'required':![]}];}return db['ChatOfflineMessage'][_0x1ac3('0x58')](_0x2e6fa3);})[_0x1ac3('0x23')](function(_0x33987b){_0x2da150['rows']=_0x33987b;return _0x2da150;});}})[_0x1ac3('0x23')](respondWithFilteredResult(_0x8c7ec1,_0x2e6fa3))['catch'](handleError(_0x8c7ec1,null));};exports[_0x1ac3('0x12e')]=function(_0x5c9035,_0x4858ce,_0x5171b9){return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x5c9035[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x4858ce,null))[_0x1ac3('0x23')](function(_0x4075e1){if(_0x4075e1){return _0x4075e1['addAgents'](_0x5c9035[_0x1ac3('0x67')][_0x1ac3('0x70')],_[_0x1ac3('0xf9')](_0x5c9035['body'],['ids','id'])||{})[_0x1ac3('0x12f')](function(_0x2bc485){for(var _0x389d1b=0x0;_0x389d1b<_0x5c9035[_0x1ac3('0x67')][_0x1ac3('0x70')][_0x1ac3('0x4f')];_0x389d1b+=0x1){socket['emit'](_0x1ac3('0x130'),{'UserId':_0x5c9035['body'][_0x1ac3('0x70')][_0x389d1b],'ChatWebsiteId':_0x5c9035[_0x1ac3('0x5b')]['id']});}return _0x2bc485;});}})[_0x1ac3('0x23')](respondWithResult(_0x4858ce,null))[_0x1ac3('0x5a')](handleError(_0x4858ce,null));};exports[_0x1ac3('0x131')]=function(_0x4e56cb,_0x3629b3,_0x1057df){return db[_0x1ac3('0x42')][_0x1ac3('0x62')]({'where':{'id':_0x4e56cb[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x3629b3,null))['then'](function(_0x1845c0){if(_0x1845c0){return _0x1845c0[_0x1ac3('0x131')](_0x4e56cb[_0x1ac3('0x49')][_0x1ac3('0x70')])['then'](function(){if(_[_0x1ac3('0x132')](_0x4e56cb[_0x1ac3('0x49')]['ids'])){for(var _0x6da71=0x0;_0x6da71<_0x4e56cb[_0x1ac3('0x49')]['ids'][_0x1ac3('0x4f')];_0x6da71+=0x1){socket[_0x1ac3('0x133')](_0x1ac3('0x134'),{'UserId':Number(_0x4e56cb[_0x1ac3('0x49')]['ids'][_0x6da71]),'ChatWebsiteId':Number(_0x4e56cb[_0x1ac3('0x5b')]['id'])});}}else{socket[_0x1ac3('0x133')](_0x1ac3('0x134'),{'UserId':Number(_0x4e56cb[_0x1ac3('0x49')][_0x1ac3('0x70')]),'ChatWebsiteId':Number(_0x4e56cb['params']['id'])});}});}})[_0x1ac3('0x23')](respondWithStatusCode(_0x3629b3,null))['catch'](handleError(_0x3629b3,null));};exports[_0x1ac3('0x135')]=function(_0x57b40b,_0x2fca89,_0x4e3034){var _0x3bc96e={};var _0x6e5601={};var _0x4d32bd;var _0x58fd63;return db[_0x1ac3('0x42')][_0x1ac3('0x6b')]({'where':{'id':_0x57b40b[_0x1ac3('0x5b')]['id']}})[_0x1ac3('0x23')](handleEntityNotFound(_0x2fca89,null))[_0x1ac3('0x23')](function(_0x5c239e){if(_0x5c239e){_0x4d32bd=_0x5c239e;_0x6e5601[_0x1ac3('0x47')]=_[_0x1ac3('0x4a')](db[_0x1ac3('0xc9')]['rawAttributes']);_0x6e5601[_0x1ac3('0x49')]=_[_0x1ac3('0x4a')](_0x57b40b['query']);_0x6e5601['filters']=_['intersection'](_0x6e5601[_0x1ac3('0x47')],_0x6e5601['query']);_0x3bc96e[_0x1ac3('0x4d')]=_[_0x1ac3('0x4c')](_0x6e5601[_0x1ac3('0x47')],qs['fields'](_0x57b40b[_0x1ac3('0x49')][_0x1ac3('0x4e')]));_0x3bc96e[_0x1ac3('0x4d')]=_0x3bc96e[_0x1ac3('0x4d')][_0x1ac3('0x4f')]?_0x3bc96e['attributes']:_0x6e5601[_0x1ac3('0x47')];_0x3bc96e[_0x1ac3('0x51')]=qs[_0x1ac3('0x52')](_0x57b40b[_0x1ac3('0x49')]['sort']);_0x3bc96e[_0x1ac3('0x53')]=qs[_0x1ac3('0x4b')](_[_0x1ac3('0x6d')](_0x57b40b[_0x1ac3('0x49')],_0x6e5601[_0x1ac3('0x4b')]));if(_0x57b40b[_0x1ac3('0x49')][_0x1ac3('0x54')]){_0x3bc96e[_0x1ac3('0x53')]=_[_0x1ac3('0x55')](_0x3bc96e[_0x1ac3('0x53')],{'$or':_[_0x1ac3('0x48')](_0x3bc96e[_0x1ac3('0x4d')],function(_0x56034f){var _0x1259e4={};_0x1259e4[_0x56034f]={'$like':'%'+_0x57b40b['query'][_0x1ac3('0x54')]+'%'};return _0x1259e4;})});}_0x3bc96e=_[_0x1ac3('0x55')]({},_0x3bc96e,_0x57b40b[_0x1ac3('0x57')]);return _0x4d32bd['getAgents'](_0x3bc96e);}})[_0x1ac3('0x23')](function(_0x3fc48e){if(_0x3fc48e){_0x58fd63=_0x3fc48e['length'];if(!_0x57b40b[_0x1ac3('0x49')]['hasOwnProperty']('nolimit')){_0x3bc96e['limit']=qs[_0x1ac3('0x33')](_0x57b40b[_0x1ac3('0x49')][_0x1ac3('0x33')]);_0x3bc96e[_0x1ac3('0x32')]=qs[_0x1ac3('0x32')](_0x57b40b[_0x1ac3('0x49')]['offset']);}return _0x4d32bd[_0x1ac3('0x135')](_0x3bc96e);}})[_0x1ac3('0x23')](function(_0x2b622f){if(_0x2b622f){return _0x2b622f?{'count':_0x58fd63,'rows':_0x2b622f}:null;}})[_0x1ac3('0x23')](respondWithResult(_0x2fca89,null))[_0x1ac3('0x5a')](handleError(_0x2fca89,null));}; \ No newline at end of file +var _0x7a2d=['emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','then','info','debug','stringify','code','message','error','ChatWebsite,\x20%s,\x20%s','request\x20sent','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','Pause','options','find','create','role','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','filename','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','agentAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','account','applications','list','List','orderBy','asc','defaults','mapKey','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','unknown','version','format','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','contact','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','auth','user','SendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','server','files','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Owner','fullname','Tag','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','getLicense','virtual','increment','chatLicenseExceeded','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','textColor','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','spread'];(function(_0x1bd3ab,_0x352c42){var _0x37e394=function(_0x2f581d){while(--_0x2f581d){_0x1bd3ab['push'](_0x1bd3ab['shift']());}};_0x37e394(++_0x352c42);}(_0x7a2d,0x142));var _0xd7a2=function(_0x41570d,_0x35d9f8){_0x41570d=_0x41570d-0x0;var _0x36b465=_0x7a2d[_0x41570d];return _0x36b465;};'use strict';var emlformat=require(_0xd7a2('0x0'));var rimraf=require(_0xd7a2('0x1'));var zipdir=require(_0xd7a2('0x2'));var jsonpatch=require(_0xd7a2('0x3'));var rp=require(_0xd7a2('0x4'));var moment=require(_0xd7a2('0x5'));var BPromise=require(_0xd7a2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd7a2('0x7'));var sox=require(_0xd7a2('0x8'));var csv=require(_0xd7a2('0x9'));var ejs=require(_0xd7a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7a2('0xb'));var squel=require(_0xd7a2('0xc'));var crypto=require(_0xd7a2('0xd'));var jsforce=require(_0xd7a2('0xe'));var deskjs=require(_0xd7a2('0xf'));var toCsv=require(_0xd7a2('0x9'));var querystring=require(_0xd7a2('0x10'));var Papa=require(_0xd7a2('0x11'));var Redis=require(_0xd7a2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd7a2('0x13'));var as=require(_0xd7a2('0x14'));var hardwareService=require(_0xd7a2('0x15'));var logger=require(_0xd7a2('0x16'))(_0xd7a2('0x17'));var utils=require(_0xd7a2('0x18'));var config=require(_0xd7a2('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd7a2('0x1a')]=_['defaults'](config[_0xd7a2('0x1a')],{'host':_0xd7a2('0x1b'),'port':0x18eb});var socket=require(_0xd7a2('0x1c'))(new Redis(config[_0xd7a2('0x1a')]));require(_0xd7a2('0x1d'))[_0xd7a2('0x1e')](socket);var jayson=require(_0xd7a2('0x1f'));var client=jayson[_0xd7a2('0x20')][_0xd7a2('0x21')]({'port':0x232c});var client9002=jayson[_0xd7a2('0x20')][_0xd7a2('0x21')]({'port':0x232a});var client9003=jayson['client'][_0xd7a2('0x21')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x26763e,_0x3f9472,_0x2e8c80,_0x11d958){return new BPromise(function(_0x296784,_0x47210f){var _0x510caa=_0x11d958||client;return _0x510caa['request'](_0x26763e,_0x2e8c80)[_0xd7a2('0x22')](function(_0x1fe867){logger[_0xd7a2('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x3f9472,'request\x20sent');logger[_0xd7a2('0x24')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3f9472,'request\x20sent',JSON[_0xd7a2('0x25')](_0x1fe867));if(_0x1fe867['error']){if(_0x1fe867['error'][_0xd7a2('0x26')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3f9472,_0x1fe867['error'][_0xd7a2('0x27')]);return _0x47210f(_0x1fe867[_0xd7a2('0x28')][_0xd7a2('0x27')]);}logger[_0xd7a2('0x28')](_0xd7a2('0x29'),_0x3f9472,_0x1fe867[_0xd7a2('0x28')][_0xd7a2('0x27')]);return _0x296784(_0x1fe867[_0xd7a2('0x28')][_0xd7a2('0x27')]);}else{logger[_0xd7a2('0x23')](_0xd7a2('0x29'),_0x3f9472,_0xd7a2('0x2a'));_0x296784(_0x1fe867[_0xd7a2('0x2b')]['message']);}})['catch'](function(_0x11a498){logger['error'](_0xd7a2('0x29'),_0x3f9472,_0x11a498);_0x47210f(_0x11a498);});});}function respondWithStatusCode(_0x4e488a,_0x1b2caa){_0x1b2caa=_0x1b2caa||0xcc;return function(_0x3d18ce){if(_0x3d18ce){return _0x4e488a[_0xd7a2('0x2c')](_0x1b2caa);}return _0x4e488a[_0xd7a2('0x2d')](_0x1b2caa)[_0xd7a2('0x2e')]();};}function respondWithResult(_0x350447,_0x1a69e4){_0x1a69e4=_0x1a69e4||0xc8;return function(_0x303dc5){if(_0x303dc5){return _0x350447[_0xd7a2('0x2d')](_0x1a69e4)[_0xd7a2('0x2f')](_0x303dc5);}};}function respondWithFilteredResult(_0x3c04d9,_0x37a24c){return function(_0x2f5e6f){if(_0x2f5e6f){var _0x294d58=_0x2f5e6f[_0xd7a2('0x30')],_0x13f3d2=_0x37a24c['offset'],_0x5b5a49=_0x37a24c[_0xd7a2('0x31')]+_0x37a24c[_0xd7a2('0x32')],_0x3cb1ba;if(_0x5b5a49>=_0x294d58){_0x5b5a49=_0x294d58;_0x3cb1ba=0xc8;}else{_0x3cb1ba=0xce;}_0x3c04d9['status'](_0x3cb1ba);return _0x3c04d9[_0xd7a2('0x33')](_0xd7a2('0x34'),_0x13f3d2+'-'+_0x5b5a49+'/'+_0x294d58)[_0xd7a2('0x2f')](_0x2f5e6f);}return null;};}function patchUpdates(_0x50c3d7){return function(_0x3b1ccf){try{jsonpatch[_0xd7a2('0x35')](_0x3b1ccf,_0x50c3d7,!![]);}catch(_0x37b09c){return BPromise['reject'](_0x37b09c);}return _0x3b1ccf[_0xd7a2('0x36')]();};}function saveUpdates(_0x4a35e5,_0x1e4038){return function(_0x40b8f1){if(_0x40b8f1){return _0x40b8f1[_0xd7a2('0x37')](_0x4a35e5)[_0xd7a2('0x22')](function(_0x4e9697){return _0x4e9697;});}return null;};}function removeEntity(_0x3268f3,_0x29259b){return function(_0x46bd7a){if(_0x46bd7a){return _0x46bd7a[_0xd7a2('0x38')]()['then'](function(){var _0x3838ce=_0x46bd7a[_0xd7a2('0x39')]({'plain':!![]});var _0x2bd3a6=_0xd7a2('0x3a');return db[_0xd7a2('0x3b')][_0xd7a2('0x38')]({'where':{'type':_0x2bd3a6,'resourceId':_0x3838ce['id']}})[_0xd7a2('0x22')](function(){return _0x46bd7a;});})[_0xd7a2('0x22')](function(){_0x3268f3[_0xd7a2('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x356375,_0x475fae){return function(_0x229c41){if(!_0x229c41){_0x356375[_0xd7a2('0x2c')](0x194);}return _0x229c41;};}function handleError(_0x564eb6,_0x4eecce){_0x4eecce=_0x4eecce||0x1f4;return function(_0x440729){logger['error'](_0x440729[_0xd7a2('0x3c')]);if(_0x440729[_0xd7a2('0x3d')]){delete _0x440729['name'];}_0x564eb6[_0xd7a2('0x2d')](_0x4eecce)[_0xd7a2('0x3e')](_0x440729);};}exports[_0xd7a2('0x3f')]=function(_0x392ffe,_0x385baa){var _0x32942b={'include':[{'model':db['Pause'],'as':_0xd7a2('0x40')}]},_0x15ecaa={},_0x5c4a6b={'count':0x0,'rows':[]};var _0x2e4b8c=_['map'](db[_0xd7a2('0x41')][_0xd7a2('0x42')],function(_0x2ce13f){return{'name':_0x2ce13f[_0xd7a2('0x43')],'type':_0x2ce13f[_0xd7a2('0x44')][_0xd7a2('0x45')]};});_0x15ecaa[_0xd7a2('0x46')]=_[_0xd7a2('0x47')](_0x2e4b8c,_0xd7a2('0x3d'));_0x15ecaa['query']=_[_0xd7a2('0x48')](_0x392ffe[_0xd7a2('0x49')]);_0x15ecaa['filters']=_['intersection'](_0x15ecaa['model'],_0x15ecaa[_0xd7a2('0x49')]);_0x32942b[_0xd7a2('0x4a')]=_[_0xd7a2('0x4b')](_0x15ecaa[_0xd7a2('0x46')],qs[_0xd7a2('0x4c')](_0x392ffe['query']['fields']));_0x32942b[_0xd7a2('0x4a')]=_0x32942b[_0xd7a2('0x4a')][_0xd7a2('0x4d')]?_0x32942b[_0xd7a2('0x4a')]:_0x15ecaa['model'];if(!_0x392ffe[_0xd7a2('0x49')][_0xd7a2('0x4e')](_0xd7a2('0x4f'))){_0x32942b[_0xd7a2('0x32')]=qs['limit'](_0x392ffe[_0xd7a2('0x49')][_0xd7a2('0x32')]);_0x32942b['offset']=qs['offset'](_0x392ffe['query'][_0xd7a2('0x31')]);}_0x32942b[_0xd7a2('0x50')]=qs[_0xd7a2('0x51')](_0x392ffe[_0xd7a2('0x49')][_0xd7a2('0x51')]);_0x32942b[_0xd7a2('0x52')]=qs['filters'](_[_0xd7a2('0x53')](_0x392ffe['query'],_0x15ecaa[_0xd7a2('0x54')]),_0x2e4b8c);if(_0x392ffe[_0xd7a2('0x49')]['filter']){_0x32942b[_0xd7a2('0x52')]=_[_0xd7a2('0x55')](_0x32942b[_0xd7a2('0x52')],{'$or':_['map'](_0x2e4b8c,function(_0x2a8868){if(_0x2a8868[_0xd7a2('0x44')]!==_0xd7a2('0x56')){var _0xa90879={};_0xa90879[_0x2a8868[_0xd7a2('0x3d')]]={'$like':'%'+_0x392ffe[_0xd7a2('0x49')][_0xd7a2('0x57')]+'%'};return _0xa90879;}})});}_0x32942b=_[_0xd7a2('0x55')]({},_0x32942b,_0x392ffe['options']);var _0x48ba9f={'where':_0x32942b[_0xd7a2('0x52')]};return db[_0xd7a2('0x41')]['count'](_0x48ba9f)[_0xd7a2('0x22')](function(_0x4cbf90){_0x5c4a6b[_0xd7a2('0x30')]=_0x4cbf90;if(_0x392ffe[_0xd7a2('0x49')][_0xd7a2('0x58')]){_0x32942b[_0xd7a2('0x59')]=[{'all':!![]}];}return db[_0xd7a2('0x41')][_0xd7a2('0x5a')](_0x32942b);})[_0xd7a2('0x22')](function(_0x4e5450){_0x5c4a6b[_0xd7a2('0x5b')]=_0x4e5450;return _0x5c4a6b;})[_0xd7a2('0x22')](respondWithFilteredResult(_0x385baa,_0x32942b))['catch'](handleError(_0x385baa,null));};exports[_0xd7a2('0x5c')]=function(_0x4c52cd,_0x1df5fd){var _0x4a9838={'raw':![],'where':{'id':_0x4c52cd[_0xd7a2('0x5d')]['id']},'include':[{'model':db[_0xd7a2('0x5e')],'as':_0xd7a2('0x40')}]},_0x357ce0={};_0x357ce0[_0xd7a2('0x46')]=_[_0xd7a2('0x48')](db[_0xd7a2('0x41')][_0xd7a2('0x42')]);_0x357ce0[_0xd7a2('0x49')]=_[_0xd7a2('0x48')](_0x4c52cd[_0xd7a2('0x49')]);_0x357ce0[_0xd7a2('0x54')]=_[_0xd7a2('0x4b')](_0x357ce0[_0xd7a2('0x46')],_0x357ce0[_0xd7a2('0x49')]);_0x4a9838[_0xd7a2('0x4a')]=_['intersection'](_0x357ce0['model'],qs[_0xd7a2('0x4c')](_0x4c52cd[_0xd7a2('0x49')][_0xd7a2('0x4c')]));_0x4a9838[_0xd7a2('0x4a')]=_0x4a9838[_0xd7a2('0x4a')][_0xd7a2('0x4d')]?_0x4a9838[_0xd7a2('0x4a')]:_0x357ce0[_0xd7a2('0x46')];if(_0x4c52cd[_0xd7a2('0x49')][_0xd7a2('0x58')]){_0x4a9838[_0xd7a2('0x59')]=[{'all':!![]}];}_0x4a9838=_['merge']({},_0x4a9838,_0x4c52cd[_0xd7a2('0x5f')]);return db[_0xd7a2('0x41')][_0xd7a2('0x60')](_0x4a9838)[_0xd7a2('0x22')](handleEntityNotFound(_0x1df5fd,null))[_0xd7a2('0x22')](respondWithResult(_0x1df5fd,null))['catch'](handleError(_0x1df5fd,null));};exports[_0xd7a2('0x61')]=function(_0x3b6e1f,_0x4cfdf0){return db['ChatWebsite']['create'](_0x3b6e1f['body'],{})[_0xd7a2('0x22')](function(_0x52f7e2){var _0x36ef3a=_0x3b6e1f['user'][_0xd7a2('0x39')]({'plain':!![]});if(!_0x36ef3a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36ef3a[_0xd7a2('0x62')]==='user'){var _0x1fe889=_0x52f7e2[_0xd7a2('0x39')]({'plain':!![]});var _0x4436b8=_0xd7a2('0x3a');return db['UserProfileSection'][_0xd7a2('0x60')]({'where':{'name':_0x4436b8,'userProfileId':_0x36ef3a[_0xd7a2('0x63')]},'raw':!![]})['then'](function(_0x5021bf){if(_0x5021bf&&_0x5021bf['autoAssociation']===0x0){return db[_0xd7a2('0x3b')][_0xd7a2('0x61')]({'name':_0x1fe889[_0xd7a2('0x3d')],'resourceId':_0x1fe889['id'],'type':_0x5021bf['name'],'sectionId':_0x5021bf['id']},{})[_0xd7a2('0x22')](function(){return _0x52f7e2;});}else{return _0x52f7e2;}})[_0xd7a2('0x64')](function(_0x3d4f33){logger[_0xd7a2('0x28')](_0xd7a2('0x65'),_0x3d4f33);throw _0x3d4f33;});}return _0x52f7e2;})[_0xd7a2('0x22')](respondWithResult(_0x4cfdf0,0xc9))[_0xd7a2('0x64')](handleError(_0x4cfdf0,null));};exports[_0xd7a2('0x37')]=function(_0x2ac7b0,_0x28bf5a){if(_0x2ac7b0[_0xd7a2('0x66')]['id']){delete _0x2ac7b0[_0xd7a2('0x66')]['id'];}return db[_0xd7a2('0x41')][_0xd7a2('0x60')]({'where':{'id':_0x2ac7b0['params']['id']},'include':[{'model':db[_0xd7a2('0x5e')],'as':_0xd7a2('0x40')}]})['then'](handleEntityNotFound(_0x28bf5a,null))[_0xd7a2('0x22')](saveUpdates(_0x2ac7b0[_0xd7a2('0x66')],null))[_0xd7a2('0x22')](respondWithResult(_0x28bf5a,null))[_0xd7a2('0x64')](handleError(_0x28bf5a,null));};exports['destroy']=function(_0x161cfc,_0x39329e){return db[_0xd7a2('0x41')][_0xd7a2('0x60')]({'where':{'id':_0x161cfc[_0xd7a2('0x5d')]['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0x39329e,null))[_0xd7a2('0x22')](removeEntity(_0x39329e,null))[_0xd7a2('0x64')](handleError(_0x39329e,null));};exports[_0xd7a2('0x67')]=function(_0x3644ee,_0x360f1d){return db[_0xd7a2('0x41')][_0xd7a2('0x67')]()[_0xd7a2('0x22')](respondWithResult(_0x360f1d,null))['catch'](handleError(_0x360f1d,null));};exports[_0xd7a2('0x68')]=function(_0x251df7,_0x324a2e,_0xbae5c5){if(_0x251df7['body']['id']){delete _0x251df7[_0xd7a2('0x66')]['id'];}return db[_0xd7a2('0x41')][_0xd7a2('0x60')]({'where':{'id':_0x251df7[_0xd7a2('0x5d')]['id']}})['then'](handleEntityNotFound(_0x324a2e,null))[_0xd7a2('0x22')](function(_0x247796){if(_0x247796){_0x251df7[_0xd7a2('0x66')]['ChatWebsiteId']=_0x247796['id'];return db[_0xd7a2('0x69')][_0xd7a2('0x61')](_0x251df7[_0xd7a2('0x66')]);}})[_0xd7a2('0x22')](respondWithResult(_0x324a2e,null))[_0xd7a2('0x64')](handleError(_0x324a2e,null));};exports[_0xd7a2('0x6a')]=function(_0x1d9684,_0xd64d34,_0x5f24ae){var _0x54e03a={'raw':![],'where':{}};var _0x5cc23c={};var _0x501a05={'count':0x0,'rows':[]};return db[_0xd7a2('0x41')][_0xd7a2('0x6b')]({'where':{'id':_0x1d9684[_0xd7a2('0x5d')]['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0xd64d34,null))[_0xd7a2('0x22')](function(_0x53cbe2){if(_0x53cbe2){_0x5cc23c[_0xd7a2('0x46')]=_[_0xd7a2('0x48')](db[_0xd7a2('0x69')][_0xd7a2('0x42')]);_0x5cc23c[_0xd7a2('0x49')]=_[_0xd7a2('0x48')](_0x1d9684[_0xd7a2('0x49')]);_0x5cc23c[_0xd7a2('0x54')]=_['intersection'](_0x5cc23c[_0xd7a2('0x46')],_0x5cc23c[_0xd7a2('0x49')]);_0x54e03a['attributes']=_['intersection'](_0x5cc23c['model'],qs['fields'](_0x1d9684[_0xd7a2('0x49')][_0xd7a2('0x4c')]));_0x54e03a[_0xd7a2('0x4a')]=_0x54e03a[_0xd7a2('0x4a')][_0xd7a2('0x4d')]?_0x54e03a[_0xd7a2('0x4a')]:_0x5cc23c[_0xd7a2('0x46')];if(!_0x1d9684[_0xd7a2('0x49')][_0xd7a2('0x4e')](_0xd7a2('0x4f'))){_0x54e03a[_0xd7a2('0x32')]=qs[_0xd7a2('0x32')](_0x1d9684['query'][_0xd7a2('0x32')]);_0x54e03a[_0xd7a2('0x31')]=qs[_0xd7a2('0x31')](_0x1d9684[_0xd7a2('0x49')][_0xd7a2('0x31')]);}_0x54e03a[_0xd7a2('0x50')]=qs['sort'](_0x1d9684['query'][_0xd7a2('0x51')]);_0x54e03a[_0xd7a2('0x52')]=qs[_0xd7a2('0x54')](_['pick'](_0x1d9684[_0xd7a2('0x49')],_0x5cc23c[_0xd7a2('0x54')]));_0x54e03a['where'][_0xd7a2('0x6c')]=_0x53cbe2['id'];if(_0x1d9684[_0xd7a2('0x49')][_0xd7a2('0x57')]){_0x54e03a[_0xd7a2('0x52')]=_['merge'](_0x54e03a['where'],{'$or':_['map'](_0x54e03a['attributes'],function(_0x432607){var _0x1bdaa4={};_0x1bdaa4[_0x432607]={'$like':'%'+_0x1d9684[_0xd7a2('0x49')][_0xd7a2('0x57')]+'%'};return _0x1bdaa4;})});}_0x54e03a=_[_0xd7a2('0x55')]({},_0x54e03a,_0x1d9684[_0xd7a2('0x5f')]);return db[_0xd7a2('0x69')][_0xd7a2('0x30')]({'where':_0x54e03a[_0xd7a2('0x52')]})[_0xd7a2('0x22')](function(_0x1689fe){_0x501a05[_0xd7a2('0x30')]=_0x1689fe;if(_0x1d9684['query'][_0xd7a2('0x58')]){_0x54e03a['include']=[{'all':!![]}];}return db[_0xd7a2('0x69')][_0xd7a2('0x5a')](_0x54e03a);})[_0xd7a2('0x22')](function(_0x2be1e8){_0x501a05[_0xd7a2('0x5b')]=_0x2be1e8;return _0x501a05;});}})['then'](respondWithFilteredResult(_0xd64d34,_0x54e03a))['catch'](handleError(_0xd64d34,null));};exports[_0xd7a2('0x6d')]=function(_0x536d2f,_0x387333,_0x2116f4){return db['ChatWebsite'][_0xd7a2('0x60')]({'where':{'id':_0x536d2f['params']['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0x387333,null))[_0xd7a2('0x22')](function(_0x436453){if(_0x436453){return _0x436453[_0xd7a2('0x6d')](_0x536d2f['query'][_0xd7a2('0x6e')]);}})[_0xd7a2('0x22')](respondWithStatusCode(_0x387333,null))[_0xd7a2('0x64')](handleError(_0x387333,null));};exports[_0xd7a2('0x6f')]=function(_0x44383f,_0x4471c8,_0x3886c4){if(_0x44383f[_0xd7a2('0x66')]['id']){delete _0x44383f[_0xd7a2('0x66')]['id'];}return db[_0xd7a2('0x41')]['find']({'where':{'id':_0x44383f[_0xd7a2('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4471c8,null))[_0xd7a2('0x22')](function(_0x22ef7f){if(_0x22ef7f){_0x44383f[_0xd7a2('0x66')][_0xd7a2('0x6c')]=_0x22ef7f['id'];return db['CannedAnswer'][_0xd7a2('0x61')](_0x44383f['body']);}})[_0xd7a2('0x22')](respondWithResult(_0x4471c8,null))[_0xd7a2('0x64')](handleError(_0x4471c8,null));};exports[_0xd7a2('0x70')]=function(_0xd806cd,_0x26ff5f,_0x41233c){var _0x1244c2={'raw':![],'where':{}};var _0x5bc94e={};var _0x161e71={'count':0x0,'rows':[]};return db[_0xd7a2('0x41')][_0xd7a2('0x6b')]({'where':{'id':_0xd806cd[_0xd7a2('0x5d')]['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0x26ff5f,null))[_0xd7a2('0x22')](function(_0x5c376c){if(_0x5c376c){_0x5bc94e[_0xd7a2('0x46')]=_[_0xd7a2('0x48')](db['CannedAnswer']['rawAttributes']);_0x5bc94e[_0xd7a2('0x49')]=_[_0xd7a2('0x48')](_0xd806cd['query']);_0x5bc94e[_0xd7a2('0x54')]=_[_0xd7a2('0x4b')](_0x5bc94e['model'],_0x5bc94e[_0xd7a2('0x49')]);_0x1244c2[_0xd7a2('0x4a')]=_[_0xd7a2('0x4b')](_0x5bc94e[_0xd7a2('0x46')],qs[_0xd7a2('0x4c')](_0xd806cd[_0xd7a2('0x49')]['fields']));_0x1244c2[_0xd7a2('0x4a')]=_0x1244c2[_0xd7a2('0x4a')][_0xd7a2('0x4d')]?_0x1244c2[_0xd7a2('0x4a')]:_0x5bc94e[_0xd7a2('0x46')];if(!_0xd806cd['query'][_0xd7a2('0x4e')](_0xd7a2('0x4f'))){_0x1244c2[_0xd7a2('0x32')]=qs[_0xd7a2('0x32')](_0xd806cd['query'][_0xd7a2('0x32')]);_0x1244c2[_0xd7a2('0x31')]=qs[_0xd7a2('0x31')](_0xd806cd['query']['offset']);}_0x1244c2[_0xd7a2('0x50')]=qs[_0xd7a2('0x51')](_0xd806cd[_0xd7a2('0x49')]['sort']);_0x1244c2[_0xd7a2('0x52')]=qs[_0xd7a2('0x54')](_[_0xd7a2('0x53')](_0xd806cd[_0xd7a2('0x49')],_0x5bc94e[_0xd7a2('0x54')]));_0x1244c2['where'][_0xd7a2('0x6c')]=_0x5c376c['id'];if(_0xd806cd[_0xd7a2('0x49')][_0xd7a2('0x57')]){_0x1244c2[_0xd7a2('0x52')]=_[_0xd7a2('0x55')](_0x1244c2['where'],{'$or':_['map'](_0x1244c2[_0xd7a2('0x4a')],function(_0xacf43b){var _0x2308a8={};_0x2308a8[_0xacf43b]={'$like':'%'+_0xd806cd[_0xd7a2('0x49')][_0xd7a2('0x57')]+'%'};return _0x2308a8;})});}_0x1244c2=_[_0xd7a2('0x55')]({},_0x1244c2,_0xd806cd['options']);return db[_0xd7a2('0x71')][_0xd7a2('0x30')]({'where':_0x1244c2[_0xd7a2('0x52')]})[_0xd7a2('0x22')](function(_0x41110a){_0x161e71[_0xd7a2('0x30')]=_0x41110a;if(_0xd806cd[_0xd7a2('0x49')][_0xd7a2('0x58')]){_0x1244c2[_0xd7a2('0x59')]=[{'all':!![]}];}return db[_0xd7a2('0x71')]['findAll'](_0x1244c2);})['then'](function(_0x43258e){_0x161e71[_0xd7a2('0x5b')]=_0x43258e;return _0x161e71;});}})[_0xd7a2('0x22')](respondWithFilteredResult(_0x26ff5f,_0x1244c2))[_0xd7a2('0x64')](handleError(_0x26ff5f,null));};exports[_0xd7a2('0x72')]=function(_0x251966,_0x237777,_0x817405){return db[_0xd7a2('0x41')][_0xd7a2('0x60')]({'where':{'id':_0x251966[_0xd7a2('0x5d')]['id']}})['then'](handleEntityNotFound(_0x237777,null))['then'](function(_0x436eee){if(_0x436eee){return _0x436eee['removeAnswers'](_0x251966[_0xd7a2('0x49')][_0xd7a2('0x6e')]);}})[_0xd7a2('0x22')](respondWithStatusCode(_0x237777,null))[_0xd7a2('0x64')](handleError(_0x237777,null));};exports[_0xd7a2('0x73')]=function(_0x5ba0d4,_0x52cef2,_0x2ec95b){_0x5ba0d4[_0xd7a2('0x66')][_0xd7a2('0x74')]=_0x5ba0d4[_0xd7a2('0x75')]['filename'];return db[_0xd7a2('0x41')][_0xd7a2('0x60')]({'where':{'id':_0x5ba0d4[_0xd7a2('0x5d')]['id']}})['then'](handleEntityNotFound(_0x52cef2,null))[_0xd7a2('0x22')](saveUpdates(_0x5ba0d4['body'],null))[_0xd7a2('0x22')](respondWithResult(_0x52cef2,null))[_0xd7a2('0x64')](handleError(_0x52cef2,null));};exports[_0xd7a2('0x76')]=function(_0x1443d0,_0x77e514,_0x169da3){_0x1443d0[_0xd7a2('0x66')]['agentAvatar']=_0x1443d0[_0xd7a2('0x75')][_0xd7a2('0x77')];return db[_0xd7a2('0x41')]['find']({'where':{'id':_0x1443d0['params']['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0x77e514,null))[_0xd7a2('0x22')](saveUpdates(_0x1443d0[_0xd7a2('0x66')],null))[_0xd7a2('0x22')](respondWithResult(_0x77e514,null))[_0xd7a2('0x64')](handleError(_0x77e514,null));};exports['addCustomerAvatar']=function(_0x3150d8,_0x1d8b1f,_0x1fe6ca){_0x3150d8[_0xd7a2('0x66')][_0xd7a2('0x78')]=_0x3150d8[_0xd7a2('0x75')][_0xd7a2('0x77')];return db[_0xd7a2('0x41')]['find']({'where':{'id':_0x3150d8[_0xd7a2('0x5d')]['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0x1d8b1f,null))[_0xd7a2('0x22')](saveUpdates(_0x3150d8['body'],null))[_0xd7a2('0x22')](respondWithResult(_0x1d8b1f,null))[_0xd7a2('0x64')](handleError(_0x1d8b1f,null));};exports[_0xd7a2('0x79')]=function(_0x1593f8,_0x3c84c4,_0x1fcc12){_0x1593f8[_0xd7a2('0x66')]['systemAvatar']=_0x1593f8[_0xd7a2('0x75')]['filename'];return db[_0xd7a2('0x41')][_0xd7a2('0x60')]({'where':{'id':_0x1593f8['params']['id']}})['then'](handleEntityNotFound(_0x3c84c4,null))[_0xd7a2('0x22')](saveUpdates(_0x1593f8[_0xd7a2('0x66')],null))[_0xd7a2('0x22')](respondWithResult(_0x3c84c4,null))[_0xd7a2('0x64')](handleError(_0x3c84c4,null));};exports[_0xd7a2('0x7a')]=function(_0x52f8cb,_0x3c504e,_0x2af6a9){var _0x42227f=path['join'](config[_0xd7a2('0x7b')],_0xd7a2('0x7c'));var _0x12c697={'where':{'id':_0x52f8cb[_0xd7a2('0x5d')]['id']},'attributes':['id',_0xd7a2('0x74')],'raw':!![]};var _0x188ed8=![];return require(_0xd7a2('0x7d'))['getLicense']()[_0xd7a2('0x22')](function(_0x25ee51){if(_0x25ee51){_0x188ed8=_0x25ee51[_0xd7a2('0x7e')];}})[_0xd7a2('0x22')](function(){return db[_0xd7a2('0x41')][_0xd7a2('0x60')](_0x12c697);})[_0xd7a2('0x22')](handleEntityNotFound(_0x3c504e,null))[_0xd7a2('0x22')](function(_0x5472cd){if(_0x5472cd){if(!_[_0xd7a2('0x7f')](_0x5472cd['sitepic'])){if(fs['existsSync'](path[_0xd7a2('0x80')](config[_0xd7a2('0x7b')],'server/files/images/logos/',_0x5472cd[_0xd7a2('0x74')]))&&_0x188ed8){_0x42227f=path[_0xd7a2('0x80')](config[_0xd7a2('0x7b')],_0xd7a2('0x81'),_0x5472cd[_0xd7a2('0x74')]);}}return _0x3c504e[_0xd7a2('0x82')](_0x42227f);}})[_0xd7a2('0x64')](handleError(_0x3c504e,null));};exports[_0xd7a2('0x83')]=function(_0x4139c7,_0x1e962a,_0x74a3b3){var _0x55d234=path[_0xd7a2('0x80')](config[_0xd7a2('0x7b')],_0xd7a2('0x84'));var _0x5ecd42={'where':{'id':_0x4139c7['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0xd7a2('0x60')](_0x5ecd42)['then'](handleEntityNotFound(_0x1e962a,null))[_0xd7a2('0x22')](function(_0x350838){if(_0x350838){if(!_['isNil'](_0x350838['agentAvatar'])){if(fs[_0xd7a2('0x85')](path[_0xd7a2('0x80')](config['root'],_0xd7a2('0x86'),_0x350838[_0xd7a2('0x87')]))){_0x55d234=path['join'](config[_0xd7a2('0x7b')],_0xd7a2('0x86'),_0x350838[_0xd7a2('0x87')]);}}return _0x1e962a[_0xd7a2('0x82')](_0x55d234);}})['catch'](handleError(_0x1e962a,null));};exports['getCustomerAvatar']=function(_0x5b5f3d,_0x2d029e,_0x51fc35){var _0x5d043b=path[_0xd7a2('0x80')](config['root'],_0xd7a2('0x88'));var _0x4572f1={'where':{'id':_0x5b5f3d[_0xd7a2('0x5d')]['id']},'attributes':['id',_0xd7a2('0x78'),_0xd7a2('0x89')],'raw':!![]};return db['ChatWebsite'][_0xd7a2('0x60')](_0x4572f1)[_0xd7a2('0x22')](handleEntityNotFound(_0x2d029e,null))[_0xd7a2('0x22')](function(_0x5cdabc){if(_0x5cdabc){if(!_[_0xd7a2('0x7f')](_0x5cdabc[_0xd7a2('0x78')])){if(fs[_0xd7a2('0x85')](path[_0xd7a2('0x80')](config[_0xd7a2('0x7b')],_0xd7a2('0x86'),_0x5cdabc[_0xd7a2('0x78')]))&&_0x5cdabc[_0xd7a2('0x89')]){_0x5d043b=path[_0xd7a2('0x80')](config[_0xd7a2('0x7b')],'server/files/images/avatars/',_0x5cdabc['customerAvatar']);}}return _0x2d029e[_0xd7a2('0x82')](_0x5d043b);}})[_0xd7a2('0x64')](handleError(_0x2d029e,null));};exports[_0xd7a2('0x8a')]=function(_0x2e6e32,_0x54441f,_0x284b52){var _0x3d7c56=path[_0xd7a2('0x80')](config[_0xd7a2('0x7b')],_0xd7a2('0x8b'));var _0x2f4712={'where':{'id':_0x2e6e32[_0xd7a2('0x5d')]['id']},'attributes':['id',_0xd7a2('0x8c')],'raw':!![]};return db[_0xd7a2('0x41')][_0xd7a2('0x60')](_0x2f4712)[_0xd7a2('0x22')](handleEntityNotFound(_0x54441f,null))[_0xd7a2('0x22')](function(_0x129efb){if(_0x129efb){if(!_[_0xd7a2('0x7f')](_0x129efb[_0xd7a2('0x8c')])){if(fs[_0xd7a2('0x85')](path[_0xd7a2('0x80')](config[_0xd7a2('0x7b')],_0xd7a2('0x86'),_0x129efb[_0xd7a2('0x8c')]))){_0x3d7c56=path[_0xd7a2('0x80')](config['root'],'server/files/images/avatars/',_0x129efb[_0xd7a2('0x8c')]);}}return _0x54441f[_0xd7a2('0x82')](_0x3d7c56);}})[_0xd7a2('0x64')](handleError(_0x54441f,null));};exports['notify']=function(_0x263f24,_0x3aeecd,_0x51c93e){var _0x323c1d=require('user-agent-parser');var _0x57d82f=new _0x323c1d();var _0x2073dc=_0x57d82f[_0xd7a2('0x8d')](_0x263f24['headers'][_0xd7a2('0x8e')])[_0xd7a2('0x8f')]();var _0x3a43d7={'body':_0x263f24[_0xd7a2('0x66')],'channel':_0xd7a2('0x90')};var _0x3aea23=[];var _0x4eb95a=[];var _0x5e0258={};var _0x3f2130=![];return db[_0xd7a2('0x91')][_0xd7a2('0x67')]()['then'](function(_0x4b3e8c){if(!_0x4b3e8c){throw new db[(_0xd7a2('0x92'))][(_0xd7a2('0x93'))](_0xd7a2('0x94'));}_0x3aea23=_[_0xd7a2('0x95')](_[_0xd7a2('0x48')](_0x4b3e8c),[_0xd7a2('0x96'),_0xd7a2('0x97')]);_0x4eb95a=_[_0xd7a2('0x95')](_[_0xd7a2('0x48')](_0x4b3e8c),[_0xd7a2('0x96'),_0xd7a2('0x97'),'CompanyId',_0xd7a2('0x98')]);if(_0x263f24['body']['id']){delete _0x263f24[_0xd7a2('0x66')]['id'];}if(_['isNil'](_0x263f24[_0xd7a2('0x66')][_0xd7a2('0x99')])){throw new db[(_0xd7a2('0x92'))][(_0xd7a2('0x93'))](_0xd7a2('0x9a'));}if(_[_0xd7a2('0x7f')](_0x263f24[_0xd7a2('0x66')]['body'])||_0x263f24[_0xd7a2('0x66')][_0xd7a2('0x66')]===''){throw new db['Sequelize'][(_0xd7a2('0x93'))](_0xd7a2('0x9b'));}if(_[_0xd7a2('0x7f')](_0x263f24[_0xd7a2('0x66')]['mapKey'])){throw new db[(_0xd7a2('0x92'))][(_0xd7a2('0x93'))](_0xd7a2('0x9c')+_0x4eb95a);}if(!_[_0xd7a2('0x9d')](_0x4eb95a,_0x263f24['body']['mapKey'])){throw new db[(_0xd7a2('0x92'))][(_0xd7a2('0x93'))](_0xd7a2('0x9e')+_0x4eb95a);}_0x5e0258[_0x263f24[_0xd7a2('0x66')]['mapKey']]=_0x263f24[_0xd7a2('0x66')][_0xd7a2('0x99')];})['then'](function(){return db[_0xd7a2('0x41')][_0xd7a2('0x60')]({'where':{'id':_0x263f24[_0xd7a2('0x5d')]['id']},'include':[{'model':db[_0xd7a2('0x9f')],'as':'List','include':[{'model':db['CmContact'],'as':_0xd7a2('0xa0'),'where':_0x5e0258,'limit':0x1,'order':[[_0xd7a2('0x97'),_0xd7a2('0xa1')]]}]},{'model':db[_0xd7a2('0xa2')],'as':_0xd7a2('0xa3')}]});})['then'](handleEntityNotFound(_0x3aeecd,null))[_0xd7a2('0x22')](function(_0x3f01bf){if(_0x3f01bf&&_0x3f01bf['List']){_0x3a43d7[_0xd7a2('0xa4')]=_0x3f01bf;_0x3a43d7[_0xd7a2('0xa5')]=_0x3f01bf[_0xd7a2('0xa3')];_0x3a43d7[_0xd7a2('0xa6')]=_0x3f01bf[_0xd7a2('0xa7')];_0x3a43d7[_0xd7a2('0xa5')]=_[_0xd7a2('0xa8')](_0x3a43d7[_0xd7a2('0xa5')],['priority'],[_0xd7a2('0xa9')]);if(_0x3a43d7[_0xd7a2('0xa4')][_0xd7a2('0xa3')]){delete _0x3a43d7[_0xd7a2('0xa4')][_0xd7a2('0xa3')];}if(_0x3a43d7[_0xd7a2('0xa4')][_0xd7a2('0xa7')]&&_0x3a43d7[_0xd7a2('0xa4')][_0xd7a2('0xa7')][_0xd7a2('0xa0')][_0xd7a2('0x4d')]){return _0x3a43d7[_0xd7a2('0xa4')][_0xd7a2('0xa7')][_0xd7a2('0xa0')][0x0];}var _0x1b3124=_[_0xd7a2('0xaa')](_0x263f24['body'],{'firstName':_0x263f24[_0xd7a2('0x66')][_0xd7a2('0x99')],'ListId':_0x3f01bf[_0xd7a2('0x98')]});_0x1b3124[_0x263f24[_0xd7a2('0x66')][_0xd7a2('0xab')]]=_0x263f24[_0xd7a2('0x66')][_0xd7a2('0x99')];return db[_0xd7a2('0x91')][_0xd7a2('0x61')](_0x1b3124,{'fields':_0x3aea23,'raw':!![]});}})[_0xd7a2('0x22')](handleEntityNotFound(_0x3aeecd,null))['then'](function(_0x2f1ac4){_0x3a43d7['contact']=_0x2f1ac4;var _0x5e8c59=_0x263f24['body'][_0xd7a2('0xac')];if(_0x263f24[_0xd7a2('0xad')][_0xd7a2('0xae')]){_0x5e8c59=_0x263f24[_0xd7a2('0xad')]['cf-connecting-ip'];}else if(_0x263f24[_0xd7a2('0xad')][_0xd7a2('0xaf')]){_0x5e8c59=_[_0xd7a2('0xb0')](_0x263f24[_0xd7a2('0xad')]['x-forwarded-for'][_0xd7a2('0xb1')](','));}if(_0x2f1ac4){var _0x424e6f={'ContactId':_0x2f1ac4['id'],'ChatWebsiteId':_0x263f24[_0xd7a2('0x5d')]['id'],'from':(_0x2f1ac4['firstName']||'')+'\x20'+(_0x2f1ac4[_0xd7a2('0xb2')]||''),'customerIp':_0x5e8c59,'customerPort':_0x263f24[_0xd7a2('0xad')]['x-real-port']?_0x263f24[_0xd7a2('0xad')][_0xd7a2('0xb3')]:null,'referer':_0x263f24[_0xd7a2('0x66')][_0xd7a2('0xb4')],'browserName':_0x2073dc[_0xd7a2('0xb5')][_0xd7a2('0x3d')]&&_0x2073dc[_0xd7a2('0xb5')]['version']?util['format']('%s\x20%s',_0x2073dc['browser'][_0xd7a2('0x3d')],_0x2073dc[_0xd7a2('0xb5')]['version']):_0xd7a2('0xb6'),'browserVersion':_0x2073dc['browser'][_0xd7a2('0xb7')]||_0xd7a2('0xb6'),'osName':util[_0xd7a2('0xb8')](_0xd7a2('0xb9'),_0x2073dc['os'][_0xd7a2('0x3d')],_0x2073dc['os'][_0xd7a2('0xb7')]),'osVersion':_0x2073dc['os'][_0xd7a2('0xb7')],'deviceModel':_0x2073dc[_0xd7a2('0xba')]['model']&&_0x2073dc[_0xd7a2('0xba')]['vendor']?util[_0xd7a2('0xb8')](_0xd7a2('0xbb'),_0x2073dc[_0xd7a2('0xba')][_0xd7a2('0x46')],_0x2073dc[_0xd7a2('0xba')]['vendor'],_0x2073dc['device']['type']):null,'deviceVendor':_0x2073dc[_0xd7a2('0xba')][_0xd7a2('0xbc')],'deviceType':_0x2073dc['device'][_0xd7a2('0x44')],'formData':JSON['stringify'](_0x263f24[_0xd7a2('0x66')])};var _0x41af33={'ChatWebsiteId':_0x263f24[_0xd7a2('0x5d')]['id'],'closed':![]};if(_0x263f24['body'][_0xd7a2('0xbd')]){_0x41af33[_0xd7a2('0xbd')]=_0x263f24['body'][_0xd7a2('0xbd')];return db[_0xd7a2('0xbe')][_0xd7a2('0x60')]({'where':_0x41af33})[_0xd7a2('0x22')](function(_0xa02331){if(_0xa02331){return[_0xa02331,![]];}_0x424e6f['threadId']=_0x263f24['body'][_0xd7a2('0xbd')];_0x424e6f[_0xd7a2('0xbf')]=_0x263f24['body']['externalUrl'];return db[_0xd7a2('0xbe')][_0xd7a2('0x61')](_0x424e6f)[_0xd7a2('0x22')](function(_0xbc431e){return[_0xbc431e,!![]];});});}_0x41af33[_0xd7a2('0xc0')]=_0x2f1ac4['id'];if(_0x263f24[_0xd7a2('0x66')][_0xd7a2('0xc1')]&&_0x263f24[_0xd7a2('0x66')][_0xd7a2('0xc1')]['id']){_0x41af33['id']=_0x263f24['body']['interaction']['id'];return db['ChatInteraction'][_0xd7a2('0x60')]({'where':_0x41af33})[_0xd7a2('0x22')](function(_0x471daa){if(_0x471daa){return[_0x471daa,![]];}return db[_0xd7a2('0xbe')]['create'](_0x424e6f)[_0xd7a2('0x22')](function(_0x4d5b5f){return[_0x4d5b5f,!![]];});});}return db[_0xd7a2('0xbe')][_0xd7a2('0x61')](_0x424e6f)[_0xd7a2('0x22')](function(_0x5ac327){return[_0x5ac327,!![]];});}})['spread'](function(_0x5d6375,_0x599b56){if(_0x5d6375){_0x3f2130=_0x599b56;if(!_0x599b56){var _0x31f0b5={'from':(_0x3a43d7['contact'][_0xd7a2('0xc2')]||'')+'\x20'+(_0x3a43d7['contact']['lastName']||'')};if(_0x263f24[_0xd7a2('0x66')][_0xd7a2('0xbd')]&&_0x263f24[_0xd7a2('0x66')][_0xd7a2('0xc3')]&&_0x263f24[_0xd7a2('0x66')][_0xd7a2('0xbd')]!=_0x263f24[_0xd7a2('0x66')][_0xd7a2('0xc3')]){_0x31f0b5['threadId']=_0x263f24[_0xd7a2('0x66')][_0xd7a2('0xc3')];}return _0x5d6375[_0xd7a2('0x37')](_0x31f0b5);}else{return _0x5d6375;}}})['then'](function(_0x351131){_0x3a43d7['interaction']=_0x351131[_0xd7a2('0x39')]({'plain':!![]});_0x3a43d7['interaction'][_0xd7a2('0xc4')]=_0x3f2130;if(_0x3a43d7[_0xd7a2('0xc1')][_0xd7a2('0xc4')]){if(_0x3a43d7[_0xd7a2('0xa4')][_0xd7a2('0xc5')]){_0x3a43d7['applications'][_0xd7a2('0xc6')]({'id':0x0,'priority':_0x3a43d7[_0xd7a2('0xa5')][_0xd7a2('0x4d')]+0x1,'app':_0xd7a2('0xc7'),'appdata':_0xd7a2('0xc8'),'interval':_0xd7a2('0xc9')});}}return db[_0xd7a2('0xca')][_0xd7a2('0x61')]({'body':_0x263f24[_0xd7a2('0x66')]['body'],'ChatWebsiteId':_0x263f24['params']['id'],'ChatInteractionId':_0x351131['id'],'direction':'in','ContactId':_0x3a43d7[_0xd7a2('0xcb')]['id'],'AttachmentId':_0x263f24[_0xd7a2('0x66')][_0xd7a2('0xcc')]});})[_0xd7a2('0x22')](function(_0x477008){_0x3a43d7[_0xd7a2('0x27')]=_0x477008;if(_0x3a43d7[_0xd7a2('0xc1')][_0xd7a2('0xcd')]){return db['User'][_0xd7a2('0x60')]({'attributes':['id','name'],'where':{'id':_0x3a43d7[_0xd7a2('0xc1')][_0xd7a2('0xcd')]}})[_0xd7a2('0x22')](function(_0x2614d8){if(_0x2614d8){_0x3a43d7['applications'][_0xd7a2('0xce')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2614d8[_0xd7a2('0x3d')]+','+(_0x3a43d7[_0xd7a2('0xa4')][_0xd7a2('0xcf')]||0xa),'interval':'*,*,*,*'});_0x3a43d7[_0xd7a2('0xd0')]=!![];}return respondWithRpcPromise(_0xd7a2('0xd1'),_0xd7a2('0xd2'),_0x3a43d7);});}return respondWithRpcPromise('Start',_0xd7a2('0xd2'),_0x3a43d7);})[_0xd7a2('0x22')](function(_0x2b1125){respondWithRpcPromise(_0xd7a2('0xd3'),'EventManager',{'event':_0xd7a2('0xd4'),'message':_0x2b1125},client9002);return _0x2b1125;})[_0xd7a2('0x22')](respondWithResult(_0x3aeecd,null))[_0xd7a2('0x64')](handleError(_0x3aeecd,null));};exports[_0xd7a2('0xd5')]=function(_0x31c6f2,_0x34592d,_0x2a9116){var _0x25c1ba,_0x411072,_0x30bc5e;var _0x48388a=[];var _0x5b65cd=[];var _0x401113={};var _0x1496f4=_0x31c6f2['files']||[];var _0x1131af=[];var _0x2729bf;return db[_0xd7a2('0x91')][_0xd7a2('0x67')]()['then'](function(_0x3087c7){if(!_0x3087c7){throw new db[(_0xd7a2('0x92'))][(_0xd7a2('0x93'))](_0xd7a2('0x94'));}_0x5b65cd=_[_0xd7a2('0x95')](_[_0xd7a2('0x48')](_0x3087c7),[_0xd7a2('0x96'),'updatedAt']);_0x48388a=_[_0xd7a2('0x95')](_['keys'](_0x3087c7),['createdAt',_0xd7a2('0x97'),'CompanyId','ListId']);if(_0x31c6f2[_0xd7a2('0x66')]['id']){delete _0x31c6f2['body']['id'];}if(_[_0xd7a2('0x7f')](_0x31c6f2[_0xd7a2('0x66')][_0xd7a2('0x99')])){throw _0x34592d['status'](0x1f4)[_0xd7a2('0x3e')](new db[(_0xd7a2('0x92'))][(_0xd7a2('0x93'))]('from\x20is\x20mandatory'));}if(_[_0xd7a2('0x7f')](_0x31c6f2[_0xd7a2('0x66')][_0xd7a2('0x66')])||_0x31c6f2[_0xd7a2('0x66')][_0xd7a2('0x66')]===''){throw _0x34592d[_0xd7a2('0x2d')](0x1f4)['send'](new db[(_0xd7a2('0x92'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xd7a2('0x7f')](_0x31c6f2[_0xd7a2('0x66')][_0xd7a2('0xd6')])){throw _0x34592d[_0xd7a2('0x2d')](0x1f4)[_0xd7a2('0x3e')](new db[(_0xd7a2('0x92'))]['ValidationError'](_0xd7a2('0xd7')+_0x48388a));}if(!_[_0xd7a2('0x9d')](_0x48388a,_0x31c6f2['body'][_0xd7a2('0xd6')])){throw _0x34592d[_0xd7a2('0x2d')](0x1f4)[_0xd7a2('0x3e')](new db[(_0xd7a2('0x92'))][(_0xd7a2('0x93'))](_0xd7a2('0xd8')+_0x48388a));}_0x401113[_0x31c6f2['body'][_0xd7a2('0xd6')]]=_0x31c6f2['body'][_0xd7a2('0x99')];})[_0xd7a2('0x22')](function(){return db[_0xd7a2('0x41')][_0xd7a2('0x60')]({'where':{'id':_0x31c6f2[_0xd7a2('0x5d')]['id']},'include':[{'model':db[_0xd7a2('0x9f')],'as':_0xd7a2('0xa7')},{'model':db[_0xd7a2('0xd9')],'as':'MailAccount'}]});})[_0xd7a2('0x22')](handleEntityNotFound(_0x34592d,null))[_0xd7a2('0x22')](function(_0x57ffd3){if(_0x57ffd3&&_0x57ffd3['List']){_0x411072=_0x57ffd3;var _0x1170b2=_[_0xd7a2('0xaa')](_0x31c6f2[_0xd7a2('0x66')],{'firstName':_0x31c6f2[_0xd7a2('0x66')][_0xd7a2('0x99')],'phone':_0x31c6f2[_0xd7a2('0x66')][_0xd7a2('0x99')],'ListId':_0x57ffd3[_0xd7a2('0x98')]});_0x1170b2[_0x31c6f2[_0xd7a2('0x66')][_0xd7a2('0xd6')]]=_0x31c6f2[_0xd7a2('0x66')][_0xd7a2('0x99')];return db['CmContact'][_0xd7a2('0xda')]({'where':_0x401113,'defaults':_0x1170b2});}})['spread'](function(_0x5781ff){if(_0x5781ff){_0x30bc5e=_0x5781ff;var _0x3f3748=fs[_0xd7a2('0xdb')](path[_0xd7a2('0x80')](config[_0xd7a2('0x7b')],_0xd7a2('0xdc')),_0xd7a2('0xdd'));var _0x4f6d3e=ejs['render'](_0x3f3748,{'body':_[_0xd7a2('0xde')](_0x31c6f2[_0xd7a2('0x66')]['body']),'bodyTitle':_0x411072[_0xd7a2('0xdf')]});return db[_0xd7a2('0xe0')][_0xd7a2('0x61')]({'body':_0x4f6d3e,'ContactId':_0x5781ff['id'],'ChatWebsiteId':_0x411072['id']});}})[_0xd7a2('0x22')](function(_0x14e03d){_0x2729bf=_0x14e03d;if(_0x1496f4[_0xd7a2('0x4d')]){var _0x4ab176=_0x1496f4[_0xd7a2('0x47')](function(_0xc113fe){return{'name':_0xc113fe[_0xd7a2('0xe1')],'basename':_0xc113fe[_0xd7a2('0x77')],'type':_0xc113fe[_0xd7a2('0xe2')],'ChatOfflineMessageId':_0x14e03d['id']};});_0x1131af=_0x4ab176[_0xd7a2('0x47')](_0x626ed7=>{var _0x408528={'filename':_0x626ed7[_0xd7a2('0x3d')],'path':path[_0xd7a2('0x80')](config['root'],'server','files',_0xd7a2('0xe3'),_0xd7a2('0xe4'),_0x626ed7[_0xd7a2('0xe5')])};return _0x408528;});if(!_0x411072[_0xd7a2('0xe6')]){return db[_0xd7a2('0xe7')][_0xd7a2('0xe8')](function(_0x482da3){return db[_0xd7a2('0xe9')][_0xd7a2('0xea')](_0x4ab176,{'transaction':_0x482da3});});}}})[_0xd7a2('0x22')](function(){if(_0x2729bf){_0x25c1ba=_0x2729bf;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xd7a2('0xeb')],'as':_0xd7a2('0xec'),'raw':!![]}]});}})[_0xd7a2('0x22')](function(_0x56340a){if(_0x56340a&&_0x56340a[_0xd7a2('0xec')]&&_0x411072[_0xd7a2('0xed')]&&_0x411072[_0xd7a2('0xee')]){var _0x1ec494={'tls':{'rejectUnauthorized':![]}};if(_0x56340a[_0xd7a2('0xec')][_0xd7a2('0xef')]){_0x1ec494[_0xd7a2('0xef')]=_0x56340a['Smtp']['service'];}else{_0x1ec494[_0xd7a2('0xf0')]=_0x56340a[_0xd7a2('0xec')][_0xd7a2('0xf0')];_0x1ec494[_0xd7a2('0xf1')]=_0x56340a[_0xd7a2('0xec')][_0xd7a2('0xf1')];_0x1ec494['secure']=_0x56340a[_0xd7a2('0xec')]['secure'];}if(_0x56340a[_0xd7a2('0xec')]['authentication']){_0x1ec494[_0xd7a2('0xf2')]={'user':_0x56340a[_0xd7a2('0xec')][_0xd7a2('0xf3')],'pass':_0x56340a[_0xd7a2('0xec')]['pass']};}return respondWithRpcPromise(_0xd7a2('0xf4'),'sendMail',{'account':_0x1ec494,'message':{'from':util[_0xd7a2('0xb8')](_0xd7a2('0xf5'),_0x56340a[_0xd7a2('0x3d')],_0x56340a['email']||_0x56340a['Smtp'][_0xd7a2('0xf3')]),'to':_0x411072[_0xd7a2('0xee')],'subject':_0x411072[_0xd7a2('0xf6')],'text':_0x25c1ba[_0xd7a2('0x66')],'attachments':_0x1131af}},client9003)[_0xd7a2('0x22')](function(){return _0x25c1ba;})[_0xd7a2('0x64')](function(_0x4bb02c){console['error'](_0x4bb02c);});}})[_0xd7a2('0x22')](function(){if(_0x411072&&_0x411072['openNewInteraction']&&_0x411072[_0xd7a2('0xf7')]){var _0x4ff8ec=[];if(_0x1496f4['length']){_0x4ff8ec=_0x1496f4[_0xd7a2('0x47')](function(_0x4ece87){return{'name':_0x4ece87[_0xd7a2('0xe1')],'basename':_0x4ece87[_0xd7a2('0x77')],'type':_0x4ece87[_0xd7a2('0xe2')],'ChatOfflineMessageId':_0x2729bf['id']};});}var _0x29d0a6;if(!_[_0xd7a2('0x7f')](_0x411072['subjectOffline'])){var _0x352ac4=_[_0xd7a2('0x47')](_0x31c6f2[_0xd7a2('0x66')],function(_0x149a04){return _0x149a04;});var _0x503b08=_[_0xd7a2('0xf8')](_0x352ac4)[0x0];var _0x289028=_[_0xd7a2('0xf9')](_0x503b08,function(_0x24bdcc){return _0x24bdcc;});_0x29d0a6=_0x289028[0x1][_0x411072['subjectOffline']];}var _0x25654a={'from':_0x30bc5e['email'],'firstName':_0x30bc5e[_0xd7a2('0xc2')],'lastName':_0x30bc5e[_0xd7a2('0xb2')],'mapKey':_0xd7a2('0xfa'),'message':{'from':_0x30bc5e[_0xd7a2('0xfa')],'to':_0x411072[_0xd7a2('0xd9')][_0xd7a2('0xfa')],'cc':'','subject':_['isNil'](_0x29d0a6)?_0x411072[_0xd7a2('0xf6')]:_0x29d0a6,'messageId':'','sentAt':new Date(),'attach':_0x4ff8ec['length'],'attachments':_0x4ff8ec,'originChannel':_0xd7a2('0xfb'),'ChatWebsiteId':_0x411072['id'],'ChatOfflineMessageId':_0x25c1ba['id'],'originTo':_0x411072[_0xd7a2('0xd9')]['email']},'body':_0x25c1ba[_0xd7a2('0x66')]};var _0x29c6de={'account':{'id':_0x411072[_0xd7a2('0xf7')]},'body':_0x25654a,'log':_0xd7a2('0xfc')};return respondWithRpcPromise(_0xd7a2('0xfc'),_0xd7a2('0xfd'),_0x29c6de,client9001)['then'](function(){return _0x25c1ba;})['catch'](function(_0x100b6f){console[_0xd7a2('0x28')](_0x100b6f);});}return;})['then'](function(){if(_0x25c1ba){return _0x25c1ba;}})[_0xd7a2('0x22')](respondWithResult(_0x34592d,null))[_0xd7a2('0x64')](function(_0x561efa){console['error'](_0xd7a2('0x64'),_0x561efa);for(var _0x4e7d74 of _0x1496f4){var _0x443dd0=path[_0xd7a2('0x80')](config['root'],_0xd7a2('0xfe'),_0xd7a2('0xff'),'attachments','offline-chat',_0x4e7d74[_0xd7a2('0x77')]);fs_extra[_0xd7a2('0x100')](_0x443dd0)[_0xd7a2('0x64')](function(_0x49b5f9){console[_0xd7a2('0x28')](_0xd7a2('0x101'),_0x443dd0,_0x49b5f9);});}});};exports['addInteraction']=function(_0x4434c9,_0x1c20a5,_0x3f150e){return db[_0xd7a2('0xbe')]['find']({'where':{'id':_0x4434c9[_0xd7a2('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1c20a5,null))[_0xd7a2('0x22')](function(_0x5af698){if(_0x5af698){return _0x5af698[_0xd7a2('0x102')](_0x4434c9[_0xd7a2('0x66')][_0xd7a2('0x6e')],_[_0xd7a2('0x103')](_0x4434c9[_0xd7a2('0x66')],[_0xd7a2('0x6e'),'id'])||{});}})[_0xd7a2('0x22')](respondWithResult(_0x1c20a5,null))[_0xd7a2('0x64')](handleError(_0x1c20a5,null));};exports['getInteractions']=function(_0x15903a,_0xb4af79,_0x380ecd){var _0x282ee1={'raw':![],'where':{}};var _0x2eff90={};var _0x4a2816={'count':0x0,'rows':[]};return db[_0xd7a2('0x41')][_0xd7a2('0x6b')]({'where':{'id':_0x15903a[_0xd7a2('0x5d')]['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0xb4af79,null))[_0xd7a2('0x22')](function(_0x405e0c){if(_0x405e0c){_0x2eff90['model']=_[_0xd7a2('0x48')](db[_0xd7a2('0xbe')][_0xd7a2('0x42')]);_0x2eff90[_0xd7a2('0x49')]=_[_0xd7a2('0x48')](_0x15903a[_0xd7a2('0x49')]);_0x2eff90[_0xd7a2('0x54')]=_[_0xd7a2('0x4b')](_0x2eff90[_0xd7a2('0x46')],_0x2eff90[_0xd7a2('0x49')]);_0x282ee1['attributes']=_[_0xd7a2('0x4b')](_0x2eff90[_0xd7a2('0x46')],qs[_0xd7a2('0x4c')](_0x15903a[_0xd7a2('0x49')]['fields']));_0x282ee1[_0xd7a2('0x4a')]=_0x282ee1[_0xd7a2('0x4a')]['length']?_0x282ee1['attributes']:_0x2eff90[_0xd7a2('0x46')];if(!_0x15903a[_0xd7a2('0x49')]['hasOwnProperty'](_0xd7a2('0x4f'))){_0x282ee1[_0xd7a2('0x32')]=qs['limit'](_0x15903a[_0xd7a2('0x49')][_0xd7a2('0x32')]);_0x282ee1[_0xd7a2('0x31')]=qs['offset'](_0x15903a[_0xd7a2('0x49')][_0xd7a2('0x31')]);}_0x282ee1[_0xd7a2('0x50')]=qs[_0xd7a2('0x51')](_0x15903a['query'][_0xd7a2('0x51')]);_0x282ee1[_0xd7a2('0x52')]=qs[_0xd7a2('0x54')](_['pick'](_0x15903a[_0xd7a2('0x49')],_0x2eff90[_0xd7a2('0x54')]));_0x282ee1[_0xd7a2('0x52')][_0xd7a2('0x6c')]=_0x405e0c['id'];if(_0x15903a['query'][_0xd7a2('0x57')]){_0x282ee1['where']=_['merge'](_0x282ee1['where'],{'$or':_[_0xd7a2('0x47')](_0x282ee1[_0xd7a2('0x4a')],function(_0x218eae){var _0xe71b27={};_0xe71b27[_0x218eae]={'$like':'%'+_0x15903a[_0xd7a2('0x49')][_0xd7a2('0x57')]+'%'};return _0xe71b27;})});}_0x282ee1=_['merge']({},_0x282ee1,_0x15903a[_0xd7a2('0x5f')]);return db[_0xd7a2('0xbe')][_0xd7a2('0x30')]({'where':_0x282ee1['where']})[_0xd7a2('0x22')](function(_0x53885f){_0x4a2816['count']=_0x53885f;if(_0x15903a[_0xd7a2('0x49')][_0xd7a2('0x58')]){_0x282ee1[_0xd7a2('0x59')]=[{'model':db[_0xd7a2('0x91')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xd7a2('0x104'),'attributes':['name',_0xd7a2('0x105'),'internal'],'required':![]},{'model':db[_0xd7a2('0x106')],'as':'Tags','attributes':['id',_0xd7a2('0x3d'),_0xd7a2('0x107')],'where':_0x15903a['query']['tag']?{'id':_0x15903a[_0xd7a2('0x49')][_0xd7a2('0x108')]}:undefined,'required':_0x15903a[_0xd7a2('0x49')][_0xd7a2('0x108')]?!![]:![]}];}return db['ChatInteraction'][_0xd7a2('0x5a')](_0x282ee1);})[_0xd7a2('0x22')](function(_0x367546){_0x4a2816[_0xd7a2('0x5b')]=_0x367546;return _0x4a2816;});}})[_0xd7a2('0x22')](respondWithFilteredResult(_0xb4af79,_0x282ee1))[_0xd7a2('0x64')](handleError(_0xb4af79,null));};function iftimePromise(_0x52c073,_0x22c6de){return respondWithRpcPromise(_0xd7a2('0x109'),_0xd7a2('0x10a'),{'command':_0x22c6de['timezone']?util[_0xd7a2('0xb8')](_0xd7a2('0x10b'),_0x52c073[_0xd7a2('0x10c')],_0x22c6de[_0xd7a2('0x10d')]):util[_0xd7a2('0xb8')](_0xd7a2('0x10e'),_0x52c073[_0xd7a2('0x10c')])},client9002)[_0xd7a2('0x22')](function(_0x384822){var _0x3b222d=_0x384822&&_0x384822[_0xd7a2('0x10f')](_0xd7a2('0x110'))>=0x0?!![]:![];logger[_0xd7a2('0x23')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x22c6de['id'],_0x52c073['id'],_0x52c073[_0xd7a2('0x10c')],_0x3b222d?'ONLINE':_0xd7a2('0x111'),_0x22c6de[_0xd7a2('0x10d')]?_0x22c6de['timezone']:_0xd7a2('0x112'));return _0x3b222d;})['catch'](function(_0x508a31){logger['error'](_0xd7a2('0x113'),_0x22c6de['id'],_0x52c073['id'],_0x52c073[_0xd7a2('0x10c')],util['inspect'](_0x508a31,{'showHidden':![],'depth':null}),_0x22c6de[_0xd7a2('0x10d')]?_0x22c6de[_0xd7a2('0x10d')]:_0xd7a2('0x112'));return![];});}exports[_0xd7a2('0x10a')]=function(_0x46e9f0,_0x2eb4d6,_0xd01b47){var _0x29be58=0x0;var _0x25b0a9=0x0;var _0x9ec4f2=![];var _0x514d8b;var _0x2d331f;return db[_0xd7a2('0x41')][_0xd7a2('0x60')]({'where':{'id':_0x46e9f0[_0xd7a2('0x5d')]['id']},'include':[{'model':db['Interval'],'as':_0xd7a2('0x114'),'include':[{'model':db[_0xd7a2('0x114')],'as':_0xd7a2('0x115'),'attributes':['id',_0xd7a2('0x10c')],'raw':!![]}]}]})[_0xd7a2('0x22')](handleEntityNotFound(_0x2eb4d6,null))[_0xd7a2('0x22')](function(_0xb9f46){if(_0xb9f46){_0x514d8b=_0xb9f46;return _0xb9f46[_0xd7a2('0x116')]({'raw':!![]});}})[_0xd7a2('0x22')](function(_0x3b5a52){if(_0x514d8b){if(_0x3b5a52){_0x2d331f=_0x3b5a52;}}return require(_0xd7a2('0x7d'))[_0xd7a2('0x117')]();})[_0xd7a2('0x22')](function(_0xecb816){if(_0xecb816){_0x25b0a9=_0xecb816[_0xd7a2('0x118')];_0x9ec4f2=_0xecb816[_0xd7a2('0x7e')];}})['then'](function(){return db[_0xd7a2('0xbe')][_0xd7a2('0x30')]({'where':{'closed':![]}});})['then'](function(_0x4d49b4){_0x29be58=_0x4d49b4;if(_0x25b0a9&&_0x4d49b4>_0x25b0a9){return db['License'][_0xd7a2('0x6b')]({'where':{'id':0x1}})[_0xd7a2('0x22')](function(_0x362ee1){if(_0x362ee1){_0x362ee1[_0xd7a2('0x119')](_0xd7a2('0x11a'));}});}})['then'](function(){if(_0x514d8b[_0xd7a2('0x114')]&&_0x514d8b[_0xd7a2('0x114')][_0xd7a2('0x115')]){var _0x104a0b=[];for(var _0x9a133c=0x0;_0x9a133c<_0x514d8b['Interval'][_0xd7a2('0x115')][_0xd7a2('0x4d')];_0x9a133c++){var _0x455a16=_0x514d8b['Interval'][_0xd7a2('0x115')][_0x9a133c][_0xd7a2('0x39')]({'plain':!![]});_0x104a0b[_0xd7a2('0xc6')](iftimePromise(_0x455a16,_0x514d8b));}return BPromise['all'](_0x104a0b)[_0xd7a2('0x22')](function(_0x4da8b4){return _[_0xd7a2('0x11b')](_0x4da8b4);});}else{return!![];}})[_0xd7a2('0x22')](function(_0x11f581){var _0x107b7e=fs['readFileSync'](path[_0xd7a2('0x80')](config['root'],_0xd7a2('0x11c')),'utf8');var _0x177d29={'remote':_0x514d8b[_0xd7a2('0x11d')],'query':querystring[_0xd7a2('0x25')](_[_0xd7a2('0x55')](_0x514d8b['get']({'plain':!![]}),{'customerIp':_0x46e9f0[_0xd7a2('0xad')][_0xd7a2('0xaf')]||_0x46e9f0[_0xd7a2('0xad')][_0xd7a2('0x11e')]||_0x46e9f0[_0xd7a2('0x11f')][_0xd7a2('0x120')]||_0x46e9f0['ip'],'referer':_0x46e9f0[_0xd7a2('0xad')][_0xd7a2('0xb4')],'openedInteractions':_0x29be58,'maxInteractions':_0x25b0a9,'virtual':_0x9ec4f2['virtual'],'online':_0x11f581,'custom':_0x9ec4f2}))[_0xd7a2('0x121')](/'/g,'\x5c\x27')};_0x2eb4d6[_0xd7a2('0x3e')](ejs['render'](Mustache[_0xd7a2('0x122')](_0x107b7e,_0x177d29),{'proactiveActions':_0x2d331f,'alignment':_0x514d8b[_0xd7a2('0x123')],'verticalAlignment':_0x514d8b[_0xd7a2('0x124')],'div_color':_0x514d8b[_0xd7a2('0x107')],'text_color':_0x514d8b[_0xd7a2('0x125')],'button_color':_0x514d8b['color_button'],'background_color':_0x514d8b[_0xd7a2('0x126')]}));})[_0xd7a2('0x64')](handleError(_0x2eb4d6,null));};exports[_0xd7a2('0x127')]=function(_0x167b18,_0x15276a,_0x2d5375){return db[_0xd7a2('0x41')]['findOne']({'where':{'id':_0x167b18[_0xd7a2('0x5d')]['id']}})['then'](handleEntityNotFound(_0x15276a,null))[_0xd7a2('0x22')](function(_0x553662){if(_0x553662){return db[_0xd7a2('0xe7')][_0xd7a2('0xe8')](function(_0x3a4ff7){return db['ChatApplication'][_0xd7a2('0x38')]({'where':{'ChatWebsiteId':_0x167b18['params']['id']},'transaction':_0x3a4ff7})[_0xd7a2('0x22')](function(_0x53b120){var _0xdec758=_[_0xd7a2('0x47')](_0x167b18['body'],function(_0x1cbd0c){_0x1cbd0c['ChatWebsiteId']=_0x167b18['params']['id'];return _0x1cbd0c;});return db[_0xd7a2('0xa2')][_0xd7a2('0xea')](_0xdec758,{'transaction':_0x3a4ff7});});})[_0xd7a2('0x22')](function(){return db[_0xd7a2('0xa2')][_0xd7a2('0x128')]({'where':{'ChatWebsiteId':_0x167b18[_0xd7a2('0x5d')]['id']},'order':'priority'});});}})[_0xd7a2('0x22')](respondWithResult(_0x15276a,null))[_0xd7a2('0x64')](handleError(_0x15276a,null));};exports[_0xd7a2('0x129')]=function(_0x26a12a,_0x4146b4,_0xf330ac){var _0x5bdbd3={};var _0x47f958={};var _0x198151;var _0x19e54d;return db[_0xd7a2('0x41')]['findOne']({'where':{'id':_0x26a12a[_0xd7a2('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4146b4,null))[_0xd7a2('0x22')](function(_0xc93b2a){if(_0xc93b2a){_0x198151=_0xc93b2a;_0x47f958['model']=_['keys'](db[_0xd7a2('0xa2')][_0xd7a2('0x42')]);_0x47f958[_0xd7a2('0x49')]=_['keys'](_0x26a12a[_0xd7a2('0x49')]);_0x47f958['filters']=_[_0xd7a2('0x4b')](_0x47f958['model'],_0x47f958[_0xd7a2('0x49')]);_0x5bdbd3[_0xd7a2('0x4a')]=_[_0xd7a2('0x4b')](_0x47f958[_0xd7a2('0x46')],qs['fields'](_0x26a12a[_0xd7a2('0x49')][_0xd7a2('0x4c')]));_0x5bdbd3['attributes']=_0x5bdbd3['attributes'][_0xd7a2('0x4d')]?_0x5bdbd3[_0xd7a2('0x4a')]:_0x47f958[_0xd7a2('0x46')];_0x5bdbd3[_0xd7a2('0x50')]=qs[_0xd7a2('0x51')](_0x26a12a[_0xd7a2('0x49')][_0xd7a2('0x51')]);_0x5bdbd3['where']=qs[_0xd7a2('0x54')](_[_0xd7a2('0x53')](_0x26a12a['query'],_0x47f958['filters']));if(_0x26a12a['query'][_0xd7a2('0x57')]){_0x5bdbd3[_0xd7a2('0x52')]=_[_0xd7a2('0x55')](_0x5bdbd3[_0xd7a2('0x52')],{'$or':_[_0xd7a2('0x47')](_0x5bdbd3[_0xd7a2('0x4a')],function(_0x2dd03e){var _0x592910={};_0x592910[_0x2dd03e]={'$like':'%'+_0x26a12a[_0xd7a2('0x49')][_0xd7a2('0x57')]+'%'};return _0x592910;})});}_0x5bdbd3=_[_0xd7a2('0x55')]({},_0x5bdbd3,_0x26a12a[_0xd7a2('0x5f')]);return _0x198151[_0xd7a2('0x129')](_0x5bdbd3);}})[_0xd7a2('0x22')](function(_0x399c15){if(_0x399c15){_0x19e54d=_0x399c15[_0xd7a2('0x4d')];if(!_0x26a12a[_0xd7a2('0x49')][_0xd7a2('0x4e')](_0xd7a2('0x4f'))){_0x5bdbd3[_0xd7a2('0x32')]=qs['limit'](_0x26a12a['query'][_0xd7a2('0x32')]);_0x5bdbd3[_0xd7a2('0x31')]=qs[_0xd7a2('0x31')](_0x26a12a['query'][_0xd7a2('0x31')]);}return _0x198151[_0xd7a2('0x129')](_0x5bdbd3);}})['then'](function(_0x22086b){if(_0x22086b){return _0x22086b?{'count':_0x19e54d,'rows':_0x22086b}:null;}})['then'](respondWithResult(_0x4146b4,null))[_0xd7a2('0x64')](handleError(_0x4146b4,null));};exports[_0xd7a2('0x12a')]=function(_0x3a3cf5,_0x7f1443,_0x246ac1){return db[_0xd7a2('0x12b')][_0xd7a2('0x60')]({'where':{'id':_0x3a3cf5[_0xd7a2('0x5d')]['id']}})['then'](handleEntityNotFound(_0x7f1443,null))[_0xd7a2('0x22')](function(_0x529a53){if(_0x529a53){return _0x529a53[_0xd7a2('0x12a')](_0x3a3cf5['body']['ids'],_[_0xd7a2('0x103')](_0x3a3cf5['body'],['ids','id'])||{});}})[_0xd7a2('0x22')](respondWithResult(_0x7f1443,null))[_0xd7a2('0x64')](handleError(_0x7f1443,null));};exports[_0xd7a2('0x116')]=function(_0x190558,_0x2187b3,_0x5710a6){var _0x5ced26={};var _0x197fb1={};var _0x523392;var _0x1cc529;return db['ChatWebsite'][_0xd7a2('0x6b')]({'where':{'id':_0x190558[_0xd7a2('0x5d')]['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0x2187b3,null))[_0xd7a2('0x22')](function(_0x15b4fc){if(_0x15b4fc){_0x523392=_0x15b4fc;_0x197fb1[_0xd7a2('0x46')]=_['keys'](db[_0xd7a2('0x12c')][_0xd7a2('0x42')]);_0x197fb1[_0xd7a2('0x49')]=_[_0xd7a2('0x48')](_0x190558[_0xd7a2('0x49')]);_0x197fb1[_0xd7a2('0x54')]=_[_0xd7a2('0x4b')](_0x197fb1[_0xd7a2('0x46')],_0x197fb1[_0xd7a2('0x49')]);_0x5ced26[_0xd7a2('0x4a')]=_[_0xd7a2('0x4b')](_0x197fb1[_0xd7a2('0x46')],qs[_0xd7a2('0x4c')](_0x190558[_0xd7a2('0x49')][_0xd7a2('0x4c')]));_0x5ced26[_0xd7a2('0x4a')]=_0x5ced26[_0xd7a2('0x4a')]['length']?_0x5ced26[_0xd7a2('0x4a')]:_0x197fb1[_0xd7a2('0x46')];_0x5ced26[_0xd7a2('0x50')]=qs[_0xd7a2('0x51')](_0x190558[_0xd7a2('0x49')][_0xd7a2('0x51')]);_0x5ced26[_0xd7a2('0x52')]=qs[_0xd7a2('0x54')](_['pick'](_0x190558['query'],_0x197fb1['filters']));if(_0x190558[_0xd7a2('0x49')][_0xd7a2('0x57')]){_0x5ced26[_0xd7a2('0x52')]=_[_0xd7a2('0x55')](_0x5ced26[_0xd7a2('0x52')],{'$or':_['map'](_0x5ced26['attributes'],function(_0x4c8d8c){var _0x240c17={};_0x240c17[_0x4c8d8c]={'$like':'%'+_0x190558[_0xd7a2('0x49')][_0xd7a2('0x57')]+'%'};return _0x240c17;})});}_0x5ced26=_['merge']({},_0x5ced26,_0x190558[_0xd7a2('0x5f')]);return _0x523392['getProactiveActions'](_0x5ced26);}})[_0xd7a2('0x22')](function(_0x3b876f){if(_0x3b876f){_0x1cc529=_0x3b876f['length'];if(!_0x190558[_0xd7a2('0x49')]['hasOwnProperty']('nolimit')){_0x5ced26[_0xd7a2('0x32')]=qs[_0xd7a2('0x32')](_0x190558[_0xd7a2('0x49')][_0xd7a2('0x32')]);_0x5ced26['offset']=qs['offset'](_0x190558['query'][_0xd7a2('0x31')]);}return _0x523392['getProactiveActions'](_0x5ced26);}})[_0xd7a2('0x22')](function(_0x2a92ee){if(_0x2a92ee){return _0x2a92ee?{'count':_0x1cc529,'rows':_0x2a92ee}:null;}})[_0xd7a2('0x22')](respondWithResult(_0x2187b3,null))[_0xd7a2('0x64')](handleError(_0x2187b3,null));};exports[_0xd7a2('0x12d')]=function(_0x264f7b,_0xde456,_0x598598){var _0x517188=_0x264f7b[_0xd7a2('0x49')][_0xd7a2('0x12e')]===_0xd7a2('0x12f')?'offlineForm':_0xd7a2('0x130');return db[_0xd7a2('0x41')][_0xd7a2('0x60')]({'attributes':['id',_0x517188],'where':{'id':_0x264f7b[_0xd7a2('0x5d')]['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0xde456,null))[_0xd7a2('0x22')](function(_0x318ec0){if(_0x318ec0){var _0x471a03=_0x318ec0[_0x517188];var _0x196203=_0x471a03&&_0x471a03['items']?_0x471a03[_0xd7a2('0x131')]:[];_0xde456[_0xd7a2('0x3e')]({'fromKey':_[_0xd7a2('0x7f')](_0x471a03['fromKey'])?undefined:_0x471a03[_0xd7a2('0x132')],'count':_0x196203[_0xd7a2('0x4d')],'rows':_0x196203});}})[_0xd7a2('0x64')](handleError(_0xde456,null));};exports[_0xd7a2('0x133')]=function(_0x488810,_0x406992,_0xeab839){var _0x20b962={'raw':![],'where':{}};var _0x228de0={};var _0x1b0cdf={'count':0x0,'rows':[]};return db[_0xd7a2('0x41')][_0xd7a2('0x6b')]({'where':{'id':_0x488810['params']['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0x406992,null))[_0xd7a2('0x22')](function(_0x4fbcff){if(_0x4fbcff){_0x228de0[_0xd7a2('0x46')]=_[_0xd7a2('0x48')](db[_0xd7a2('0xe0')][_0xd7a2('0x42')]);_0x228de0[_0xd7a2('0x49')]=_['keys'](_0x488810[_0xd7a2('0x49')]);_0x228de0[_0xd7a2('0x54')]=_['intersection'](_0x228de0['model'],_0x228de0[_0xd7a2('0x49')]);_0x20b962[_0xd7a2('0x4a')]=_[_0xd7a2('0x4b')](_0x228de0[_0xd7a2('0x46')],qs[_0xd7a2('0x4c')](_0x488810[_0xd7a2('0x49')][_0xd7a2('0x4c')]));_0x20b962[_0xd7a2('0x4a')]=_0x20b962[_0xd7a2('0x4a')][_0xd7a2('0x4d')]?_0x20b962[_0xd7a2('0x4a')]:_0x228de0[_0xd7a2('0x46')];if(!_0x488810[_0xd7a2('0x49')][_0xd7a2('0x4e')](_0xd7a2('0x4f'))){_0x20b962[_0xd7a2('0x32')]=qs[_0xd7a2('0x32')](_0x488810['query'][_0xd7a2('0x32')]);_0x20b962[_0xd7a2('0x31')]=qs['offset'](_0x488810[_0xd7a2('0x49')][_0xd7a2('0x31')]);}_0x20b962[_0xd7a2('0x50')]=qs[_0xd7a2('0x51')](_0x488810['query']['sort']);_0x20b962[_0xd7a2('0x52')]=qs[_0xd7a2('0x54')](_[_0xd7a2('0x53')](_0x488810[_0xd7a2('0x49')],_0x228de0[_0xd7a2('0x54')]));_0x20b962['where'][_0xd7a2('0x6c')]=_0x4fbcff['id'];if(_0x488810['query'][_0xd7a2('0x57')]){_0x20b962['where']=_[_0xd7a2('0x55')](_0x20b962[_0xd7a2('0x52')],{'$or':_[_0xd7a2('0x47')](_0x20b962[_0xd7a2('0x4a')],function(_0x46490e){var _0x4fdb46={};_0x4fdb46[_0x46490e]={'$like':'%'+_0x488810[_0xd7a2('0x49')]['filter']+'%'};return _0x4fdb46;})});}_0x20b962=_[_0xd7a2('0x55')]({},_0x20b962,_0x488810[_0xd7a2('0x5f')]);return db[_0xd7a2('0xe0')][_0xd7a2('0x30')]({'where':_0x20b962[_0xd7a2('0x52')]})[_0xd7a2('0x22')](function(_0xfd7d8e){_0x1b0cdf[_0xd7a2('0x30')]=_0xfd7d8e;if(_0x488810['query']['includeAll']){_0x20b962[_0xd7a2('0x59')]=[{'all':!![]}];}else{_0x20b962[_0xd7a2('0x59')]=[{'model':db[_0xd7a2('0x91')],'as':_0xd7a2('0x134'),'required':![]},{'model':db[_0xd7a2('0xe9')],'as':_0xd7a2('0x135'),'required':![]}];}return db[_0xd7a2('0xe0')]['findAll'](_0x20b962);})['then'](function(_0x41a821){_0x1b0cdf[_0xd7a2('0x5b')]=_0x41a821;return _0x1b0cdf;});}})[_0xd7a2('0x22')](respondWithFilteredResult(_0x406992,_0x20b962))[_0xd7a2('0x64')](handleError(_0x406992,null));};exports[_0xd7a2('0x136')]=function(_0x448e84,_0x41c9f6,_0x42cb33){return db[_0xd7a2('0x41')]['find']({'where':{'id':_0x448e84['params']['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0x41c9f6,null))['then'](function(_0x286388){if(_0x286388){return _0x286388[_0xd7a2('0x136')](_0x448e84[_0xd7a2('0x66')][_0xd7a2('0x6e')],_['omit'](_0x448e84[_0xd7a2('0x66')],[_0xd7a2('0x6e'),'id'])||{})[_0xd7a2('0x137')](function(_0x597f0d){for(var _0x3d11ba=0x0;_0x3d11ba<_0x448e84[_0xd7a2('0x66')][_0xd7a2('0x6e')]['length'];_0x3d11ba+=0x1){socket[_0xd7a2('0x138')](_0xd7a2('0x139'),{'UserId':_0x448e84[_0xd7a2('0x66')][_0xd7a2('0x6e')][_0x3d11ba],'ChatWebsiteId':_0x448e84['params']['id']});}return _0x597f0d;});}})[_0xd7a2('0x22')](respondWithResult(_0x41c9f6,null))[_0xd7a2('0x64')](handleError(_0x41c9f6,null));};exports[_0xd7a2('0x13a')]=function(_0x2994d7,_0x4f7920,_0x3f7564){return db[_0xd7a2('0x41')]['find']({'where':{'id':_0x2994d7[_0xd7a2('0x5d')]['id']}})[_0xd7a2('0x22')](handleEntityNotFound(_0x4f7920,null))[_0xd7a2('0x22')](function(_0x1b0a39){if(_0x1b0a39){return _0x1b0a39[_0xd7a2('0x13a')](_0x2994d7[_0xd7a2('0x49')][_0xd7a2('0x6e')])['then'](function(){if(_['isArray'](_0x2994d7['query'][_0xd7a2('0x6e')])){for(var _0x518ab0=0x0;_0x518ab0<_0x2994d7[_0xd7a2('0x49')][_0xd7a2('0x6e')][_0xd7a2('0x4d')];_0x518ab0+=0x1){socket[_0xd7a2('0x138')](_0xd7a2('0x13b'),{'UserId':Number(_0x2994d7['query']['ids'][_0x518ab0]),'ChatWebsiteId':Number(_0x2994d7[_0xd7a2('0x5d')]['id'])});}}else{socket[_0xd7a2('0x138')]('userChatWebsite:remove',{'UserId':Number(_0x2994d7[_0xd7a2('0x49')][_0xd7a2('0x6e')]),'ChatWebsiteId':Number(_0x2994d7[_0xd7a2('0x5d')]['id'])});}});}})[_0xd7a2('0x22')](respondWithStatusCode(_0x4f7920,null))[_0xd7a2('0x64')](handleError(_0x4f7920,null));};exports[_0xd7a2('0x13c')]=function(_0x45f21f,_0x305739,_0x598d81){var _0x521007={};var _0x1f08ea={};var _0x11f089;var _0x3d1111;return db[_0xd7a2('0x41')][_0xd7a2('0x6b')]({'where':{'id':_0x45f21f['params']['id']}})['then'](handleEntityNotFound(_0x305739,null))[_0xd7a2('0x22')](function(_0x1c298a){if(_0x1c298a){_0x11f089=_0x1c298a;_0x1f08ea[_0xd7a2('0x46')]=_[_0xd7a2('0x48')](db['User'][_0xd7a2('0x42')]);_0x1f08ea[_0xd7a2('0x49')]=_[_0xd7a2('0x48')](_0x45f21f[_0xd7a2('0x49')]);_0x1f08ea[_0xd7a2('0x54')]=_['intersection'](_0x1f08ea[_0xd7a2('0x46')],_0x1f08ea[_0xd7a2('0x49')]);_0x521007[_0xd7a2('0x4a')]=_[_0xd7a2('0x4b')](_0x1f08ea[_0xd7a2('0x46')],qs[_0xd7a2('0x4c')](_0x45f21f[_0xd7a2('0x49')][_0xd7a2('0x4c')]));_0x521007['attributes']=_0x521007[_0xd7a2('0x4a')][_0xd7a2('0x4d')]?_0x521007[_0xd7a2('0x4a')]:_0x1f08ea['model'];_0x521007[_0xd7a2('0x50')]=qs[_0xd7a2('0x51')](_0x45f21f[_0xd7a2('0x49')][_0xd7a2('0x51')]);_0x521007[_0xd7a2('0x52')]=qs['filters'](_[_0xd7a2('0x53')](_0x45f21f['query'],_0x1f08ea[_0xd7a2('0x54')]));if(_0x45f21f[_0xd7a2('0x49')][_0xd7a2('0x57')]){_0x521007[_0xd7a2('0x52')]=_[_0xd7a2('0x55')](_0x521007[_0xd7a2('0x52')],{'$or':_[_0xd7a2('0x47')](_0x521007[_0xd7a2('0x4a')],function(_0x52deed){var _0x1d76a7={};_0x1d76a7[_0x52deed]={'$like':'%'+_0x45f21f[_0xd7a2('0x49')][_0xd7a2('0x57')]+'%'};return _0x1d76a7;})});}_0x521007=_[_0xd7a2('0x55')]({},_0x521007,_0x45f21f[_0xd7a2('0x5f')]);return _0x11f089[_0xd7a2('0x13c')](_0x521007);}})[_0xd7a2('0x22')](function(_0x1ad88c){if(_0x1ad88c){_0x3d1111=_0x1ad88c['length'];if(!_0x45f21f['query'][_0xd7a2('0x4e')](_0xd7a2('0x4f'))){_0x521007[_0xd7a2('0x32')]=qs[_0xd7a2('0x32')](_0x45f21f[_0xd7a2('0x49')][_0xd7a2('0x32')]);_0x521007[_0xd7a2('0x31')]=qs[_0xd7a2('0x31')](_0x45f21f[_0xd7a2('0x49')][_0xd7a2('0x31')]);}return _0x11f089['getAgents'](_0x521007);}})['then'](function(_0xedd0e6){if(_0xedd0e6){return _0xedd0e6?{'count':_0x3d1111,'rows':_0xedd0e6}:null;}})[_0xd7a2('0x22')](respondWithResult(_0x305739,null))[_0xd7a2('0x64')](handleError(_0x305739,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 1272638..40252ea 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 _0xb700=['save','update','remove','emit','hasOwnProperty','hook','exports','events','ChatWebsite','setMaxListeners'];(function(_0x5c1e62,_0xa7b6eb){var _0x39aedf=function(_0x24d054){while(--_0x24d054){_0x5c1e62['push'](_0x5c1e62['shift']());}};_0x39aedf(++_0xa7b6eb);}(_0xb700,0x1d3));var _0x0b70=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb700[_0x513aa5];return _0x1a1a7c;};'use strict';var EventEmitter=require(_0x0b70('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x0b70('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0b70('0x2')](0x0);var events={'afterCreate':_0x0b70('0x3'),'afterUpdate':_0x0b70('0x4'),'afterDestroy':_0x0b70('0x5')};function emitEvent(_0x2edc62){return function(_0x14d0ab,_0x6e83d3,_0x4f3922){ChatWebsiteEvents['emit'](_0x2edc62+':'+_0x14d0ab['id'],_0x14d0ab);ChatWebsiteEvents[_0x0b70('0x6')](_0x2edc62,_0x14d0ab);_0x4f3922(null);};}for(var e in events){if(events[_0x0b70('0x7')](e)){var event=events[e];ChatWebsite[_0x0b70('0x8')](e,emitEvent(event));}}module[_0x0b70('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x4677=['save','remove','emit','hasOwnProperty','hook','events','ChatWebsite','setMaxListeners'];(function(_0x1cfb36,_0xe3d66b){var _0x41ff23=function(_0x45332d){while(--_0x45332d){_0x1cfb36['push'](_0x1cfb36['shift']());}};_0x41ff23(++_0xe3d66b);}(_0x4677,0x155));var _0x7467=function(_0x546766,_0x3415ca){_0x546766=_0x546766-0x0;var _0x3c1b7e=_0x4677[_0x546766];return _0x3c1b7e;};'use strict';var EventEmitter=require(_0x7467('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7467('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7467('0x2')](0x0);var events={'afterCreate':_0x7467('0x3'),'afterUpdate':'update','afterDestroy':_0x7467('0x4')};function emitEvent(_0x228e93){return function(_0x22a57e,_0xe227ce,_0x21ce80){ChatWebsiteEvents[_0x7467('0x5')](_0x228e93+':'+_0x22a57e['id'],_0x22a57e);ChatWebsiteEvents[_0x7467('0x5')](_0x228e93,_0x22a57e);_0x21ce80(null);};}for(var e in events){if(events[_0x7467('0x6')](e)){var event=events[e];ChatWebsite[_0x7467('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 6afca60..f2bf653 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 _0xd8b0=['define','chat_websites','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1db181,_0x3127e8){var _0x23775a=function(_0x5e2ec0){while(--_0x5e2ec0){_0x1db181['push'](_0x1db181['shift']());}};_0x23775a(++_0x3127e8);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatWebsite',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2547=['rimraf','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x515ef1,_0x476d57){var _0x2081a6=function(_0x310edf){while(--_0x310edf){_0x515ef1['push'](_0x515ef1['shift']());}};_0x2081a6(++_0x476d57);}(_0x2547,0x1cd));var _0x7254=function(_0x50ea66,_0x53b6f4){_0x50ea66=_0x50ea66-0x0;var _0x224dcb=_0x2547[_0x50ea66];return _0x224dcb;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var moment=require(_0x7254('0x3'));var BPromise=require(_0x7254('0x4'));var rp=require(_0x7254('0x5'));var fs=require('fs');var path=require(_0x7254('0x6'));var rimraf=require(_0x7254('0x7'));var config=require('../../config/environment');var attributes=require(_0x7254('0x8'));module[_0x7254('0x9')]=function(_0x67f427,_0x119f66){return _0x67f427['define'](_0x7254('0xa'),attributes,{'tableName':_0x7254('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 5df984d..ad7dda9 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 _0x1261=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util'];(function(_0xabb290,_0x3c8584){var _0x47c31a=function(_0x2ae3ab){while(--_0x2ae3ab){_0xabb290['push'](_0xabb290['shift']());}};_0x47c31a(++_0x3c8584);}(_0x1261,0x144));var _0x1126=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x1261[_0x2d8d69];return _0x39ae22;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});} \ No newline at end of file +var _0x1a85=['catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x25b689,_0x381211){var _0x3958b2=function(_0x5e3108){while(--_0x5e3108){_0x25b689['push'](_0x25b689['shift']());}};_0x3958b2(++_0x381211);}(_0x1a85,0x178));var _0x51a8=function(_0x1850e2,_0x7dab61){_0x1850e2=_0x1850e2-0x0;var _0x1f5de4=_0x1a85[_0x1850e2];return _0x1f5de4;};'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('./chatWebsite.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 diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 3f909b5..a7e0d95 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 _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x4309e4,_0x5ca43b){var _0x1f9c9e=function(_0x1f1cc9){while(--_0x1f1cc9){_0x4309e4['push'](_0x4309e4['shift']());}};_0x1f9c9e(++_0x5ca43b);}(_0x7a54,0x106));var _0x47a5=function(_0xcf4a9e,_0x2a890b){_0xcf4a9e=_0xcf4a9e-0x0;var _0x5d1d44=_0x7a54[_0xcf4a9e];return _0x5d1d44;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x347097,_0x37a135){var _0x5dfd04=function(_0x131412){while(--_0x131412){_0x347097['push'](_0x347097['shift']());}};_0x5dfd04(++_0x37a135);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3ac99c,_0x219e27){_0x3ac99c=_0x3ac99c-0x0;var _0x57553c=_0x5f2f[_0x3ac99c];return _0x57553c;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 1ed3b1b..6d9d694 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 _0xa9e0=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','format','%s-%s','originalname','file','addLogo','now','single','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','attachments','offline-chat','extname','replace','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeAnswers','removeAgents','multer'];(function(_0x6f46a0,_0x3720b8){var _0x542992=function(_0x2acf60){while(--_0x2acf60){_0x6f46a0['push'](_0x6f46a0['shift']());}};_0x542992(++_0x3720b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x8')]('/:id/customer_avatar',controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x8')](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['get'](_0x0a9e('0x18'),controller['getSnippet']);router[_0x0a9e('0x8')](_0x0a9e('0x19'),auth['isAuthenticated'](),controller[_0x0a9e('0x1a')]);router['get'](_0x0a9e('0x1b'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x8')](_0x0a9e('0x1d'),controller[_0x0a9e('0x1e')]);router[_0x0a9e('0x8')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x8')](_0x0a9e('0x21'),auth['isAuthenticated'](),controller[_0x0a9e('0x22')]);router[_0x0a9e('0x23')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['post']('/:id/dispositions',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x23')](_0x0a9e('0x26'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x3b45bc,_0x4d00e6,_0x370d86){_0x370d86(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],'server/files/images/logos/'));},'filename':function(_0x59181e,_0x197ec0,_0x3a8e58){_0x3a8e58(null,util[_0x0a9e('0x2b')](_0x0a9e('0x2c'),Date['now'](),_0x197ec0[_0x0a9e('0x2d')]));}})});router['post'](_0x0a9e('0xf'),upload['single'](_0x0a9e('0x2e')),controller[_0x0a9e('0x2f')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x14433c,_0x140511,_0x1538a4){_0x1538a4(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,util[_0x0a9e('0x2b')]('%s-%s',Date[_0x0a9e('0x30')](),_0x468813[_0x0a9e('0x2d')]));}})});router[_0x0a9e('0x23')](_0x0a9e('0x11'),upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x32')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x1dbde2,_0x540530,_0x426950){_0x426950(null,path['join'](config[_0x0a9e('0x2a')],_0x0a9e('0x33')));},'filename':function(_0x1122db,_0x33bdb7,_0x25ce3a){_0x25ce3a(null,util['format'](_0x0a9e('0x2c'),Date[_0x0a9e('0x30')](),_0x33bdb7[_0x0a9e('0x2d')]));}})});router[_0x0a9e('0x23')](_0x0a9e('0x34'),upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x44295a,_0x5e7238,_0x2cc7a0){_0x2cc7a0(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],_0x0a9e('0x33')));},'filename':function(_0x567193,_0x191e91,_0xd1836d){_0xd1836d(null,util[_0x0a9e('0x2b')](_0x0a9e('0x2c'),Date['now'](),_0x191e91['originalname']));}})});router[_0x0a9e('0x23')]('/:id/system_avatar',upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x36')]);router[_0x0a9e('0x23')]('/:id/notify',controller[_0x0a9e('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x3cae,_0x533942,_0x1dbf74){const _0x1a180b=path[_0x0a9e('0x29')](config['root'],'server/files',_0x0a9e('0x38'),_0x0a9e('0x39'));fs_extra['ensureDir'](_0x1a180b,function(){_0x1dbf74(null,_0x1a180b);});},'filename':function(_0x2b814e,_0x419125,_0x2e1b3a){const _0x148f55=_0x419125['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x15e37d=path[_0x0a9e('0x3a')](_0x148f55);const _0x53f3ee=Date[_0x0a9e('0x30')]()+'-'+_0x148f55[_0x0a9e('0x3b')](_0x15e37d,'')+_0x15e37d;_0x2e1b3a(null,_0x53f3ee);}})});router[_0x0a9e('0x23')]('/:id/offline',offlineUploadMulter[_0x0a9e('0x3c')](),controller[_0x0a9e('0x3d')]);router[_0x0a9e('0x23')](_0x0a9e('0x16'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x3e')]);router[_0x0a9e('0x23')](_0x0a9e('0x19'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x3f')]);router[_0x0a9e('0x23')](_0x0a9e('0x1b'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x40')]);router[_0x0a9e('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0x0a9e('0x41')]);router[_0x0a9e('0x42')](_0x0a9e('0x43'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x44')]);router[_0x0a9e('0x45')](_0x0a9e('0x43'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x46')]);router[_0x0a9e('0x45')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller['removeDispositions']);router[_0x0a9e('0x45')](_0x0a9e('0x26'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x47')]);router[_0x0a9e('0x45')](_0x0a9e('0x21'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x48')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','format','%s-%s','originalname','file','addLogo','now','single','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','attachments','offline-chat','extname','replace','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeAnswers','removeAgents','multer'];(function(_0x4eeee5,_0x18be46){var _0x389ed6=function(_0x3a0097){while(--_0x3a0097){_0x4eeee5['push'](_0x4eeee5['shift']());}};_0x389ed6(++_0x18be46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x8')]('/:id/customer_avatar',controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x8')](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['get'](_0x0a9e('0x18'),controller['getSnippet']);router[_0x0a9e('0x8')](_0x0a9e('0x19'),auth['isAuthenticated'](),controller[_0x0a9e('0x1a')]);router['get'](_0x0a9e('0x1b'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x8')](_0x0a9e('0x1d'),controller[_0x0a9e('0x1e')]);router[_0x0a9e('0x8')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x8')](_0x0a9e('0x21'),auth['isAuthenticated'](),controller[_0x0a9e('0x22')]);router[_0x0a9e('0x23')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['post']('/:id/dispositions',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x23')](_0x0a9e('0x26'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x3b45bc,_0x4d00e6,_0x370d86){_0x370d86(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],'server/files/images/logos/'));},'filename':function(_0x59181e,_0x197ec0,_0x3a8e58){_0x3a8e58(null,util[_0x0a9e('0x2b')](_0x0a9e('0x2c'),Date['now'](),_0x197ec0[_0x0a9e('0x2d')]));}})});router['post'](_0x0a9e('0xf'),upload['single'](_0x0a9e('0x2e')),controller[_0x0a9e('0x2f')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x14433c,_0x140511,_0x1538a4){_0x1538a4(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,util[_0x0a9e('0x2b')]('%s-%s',Date[_0x0a9e('0x30')](),_0x468813[_0x0a9e('0x2d')]));}})});router[_0x0a9e('0x23')](_0x0a9e('0x11'),upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x32')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x1dbde2,_0x540530,_0x426950){_0x426950(null,path['join'](config[_0x0a9e('0x2a')],_0x0a9e('0x33')));},'filename':function(_0x1122db,_0x33bdb7,_0x25ce3a){_0x25ce3a(null,util['format'](_0x0a9e('0x2c'),Date[_0x0a9e('0x30')](),_0x33bdb7[_0x0a9e('0x2d')]));}})});router[_0x0a9e('0x23')](_0x0a9e('0x34'),upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x44295a,_0x5e7238,_0x2cc7a0){_0x2cc7a0(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],_0x0a9e('0x33')));},'filename':function(_0x567193,_0x191e91,_0xd1836d){_0xd1836d(null,util[_0x0a9e('0x2b')](_0x0a9e('0x2c'),Date['now'](),_0x191e91['originalname']));}})});router[_0x0a9e('0x23')]('/:id/system_avatar',upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x36')]);router[_0x0a9e('0x23')]('/:id/notify',controller[_0x0a9e('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x3cae,_0x533942,_0x1dbf74){const _0x1a180b=path[_0x0a9e('0x29')](config['root'],'server/files',_0x0a9e('0x38'),_0x0a9e('0x39'));fs_extra['ensureDir'](_0x1a180b,function(){_0x1dbf74(null,_0x1a180b);});},'filename':function(_0x2b814e,_0x419125,_0x2e1b3a){const _0x148f55=_0x419125['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x15e37d=path[_0x0a9e('0x3a')](_0x148f55);const _0x53f3ee=Date[_0x0a9e('0x30')]()+'-'+_0x148f55[_0x0a9e('0x3b')](_0x15e37d,'')+_0x15e37d;_0x2e1b3a(null,_0x53f3ee);}})});router[_0x0a9e('0x23')]('/:id/offline',offlineUploadMulter[_0x0a9e('0x3c')](),controller[_0x0a9e('0x3d')]);router[_0x0a9e('0x23')](_0x0a9e('0x16'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x3e')]);router[_0x0a9e('0x23')](_0x0a9e('0x19'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x3f')]);router[_0x0a9e('0x23')](_0x0a9e('0x1b'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x40')]);router[_0x0a9e('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0x0a9e('0x41')]);router[_0x0a9e('0x42')](_0x0a9e('0x43'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x44')]);router[_0x0a9e('0x45')](_0x0a9e('0x43'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x46')]);router[_0x0a9e('0x45')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller['removeDispositions']);router[_0x0a9e('0x45')](_0x0a9e('0x26'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x47')]);router[_0x0a9e('0x45')](_0x0a9e('0x21'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x48')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 1586736..0306549 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 _0x8838=['sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x3f13d8,_0x5d3e81){var _0x620b41=function(_0x27c176){while(--_0x27c176){_0x3f13d8['push'](_0x3f13d8['shift']());}};_0x620b41(++_0x5d3e81);}(_0x8838,0x90));var _0x8883=function(_0x535408,_0x7caf0c){_0x535408=_0x535408-0x0;var _0x4f55a7=_0x8838[_0x535408];return _0x4f55a7;};'use strict';var Sequelize=require(_0x8883('0x0'));module[_0x8883('0x1')]={'name':{'type':Sequelize[_0x8883('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8883('0x3')](_0x8883('0x4'),_0x8883('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x8883('0x2')]},'data2':{'type':Sequelize[_0x8883('0x2')]}}; \ No newline at end of file +var _0x0d4d=['sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x23700b,_0x1bc6d7){var _0x5c5c57=function(_0x495def){while(--_0x495def){_0x23700b['push'](_0x23700b['shift']());}};_0x5c5c57(++_0x1bc6d7);}(_0x0d4d,0x132));var _0xd0d4=function(_0x202691,_0x13955e){_0x202691=_0x202691-0x0;var _0x4b4327=_0x0d4d[_0x202691];return _0x4b4327;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module[_0xd0d4('0x1')]={'name':{'type':Sequelize[_0xd0d4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd0d4('0x3')](_0xd0d4('0x4'),_0xd0d4('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xd0d4('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index db5f022..1780d68 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 _0x36df=['save','update','sendStatus','stack','send','index','map','CloudProvider','rawAttributes','fieldName','type','model','name','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','show','intersection','catch','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x36df,0x72));var _0xf36d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x36df[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf36d('0x0'));var zipdir=require(_0xf36d('0x1'));var jsonpatch=require(_0xf36d('0x2'));var rp=require(_0xf36d('0x3'));var moment=require(_0xf36d('0x4'));var BPromise=require(_0xf36d('0x5'));var Mustache=require(_0xf36d('0x6'));var util=require(_0xf36d('0x7'));var path=require(_0xf36d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf36d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf36d('0xa'));var squel=require(_0xf36d('0xb'));var crypto=require(_0xf36d('0xc'));var jsforce=require(_0xf36d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf36d('0xe'));var querystring=require(_0xf36d('0xf'));var Papa=require(_0xf36d('0x10'));var Redis=require(_0xf36d('0x11'));var authService=require(_0xf36d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf36d('0x13'));var hardwareService=require(_0xf36d('0x14'));var logger=require(_0xf36d('0x15'))('api');var utils=require(_0xf36d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf36d('0x17'));var db=require(_0xf36d('0x18'))['db'];function respondWithStatusCode(_0x434f2b,_0x37e54a){_0x37e54a=_0x37e54a||0xcc;return function(_0x3ca6f0){if(_0x3ca6f0){return _0x434f2b['sendStatus'](_0x37e54a);}return _0x434f2b[_0xf36d('0x19')](_0x37e54a)[_0xf36d('0x1a')]();};}function respondWithResult(_0x3b9764,_0x347330){_0x347330=_0x347330||0xc8;return function(_0x12c67f){if(_0x12c67f){return _0x3b9764[_0xf36d('0x19')](_0x347330)[_0xf36d('0x1b')](_0x12c67f);}};}function respondWithFilteredResult(_0x1df427,_0x1f2494){return function(_0x180290){if(_0x180290){var _0x2dc5b2=_0x180290[_0xf36d('0x1c')],_0x505b72=_0x1f2494[_0xf36d('0x1d')],_0x565b8a=_0x1f2494['offset']+_0x1f2494[_0xf36d('0x1e')],_0x392fd0;if(_0x565b8a>=_0x2dc5b2){_0x565b8a=_0x2dc5b2;_0x392fd0=0xc8;}else{_0x392fd0=0xce;}_0x1df427['status'](_0x392fd0);return _0x1df427[_0xf36d('0x1f')](_0xf36d('0x20'),_0x505b72+'-'+_0x565b8a+'/'+_0x2dc5b2)['json'](_0x180290);}return null;};}function patchUpdates(_0x40c273){return function(_0x58503b){try{jsonpatch[_0xf36d('0x21')](_0x58503b,_0x40c273,!![]);}catch(_0x2e4b1d){return BPromise['reject'](_0x2e4b1d);}return _0x58503b[_0xf36d('0x22')]();};}function saveUpdates(_0x3a15a3,_0x5d4520){return function(_0xe49e0f){if(_0xe49e0f){return _0xe49e0f[_0xf36d('0x23')](_0x3a15a3)['then'](function(_0x27f793){return _0x27f793;});}return null;};}function removeEntity(_0x59b7c0,_0x2eb708){return function(_0x52e6b6){if(_0x52e6b6){return _0x52e6b6['destroy']()['then'](function(){_0x59b7c0[_0xf36d('0x19')](0xcc)[_0xf36d('0x1a')]();});}};}function handleEntityNotFound(_0x3d4ca5,_0x5446a3){return function(_0x206752){if(!_0x206752){_0x3d4ca5[_0xf36d('0x24')](0x194);}return _0x206752;};}function handleError(_0x2e622d,_0x12cd31){_0x12cd31=_0x12cd31||0x1f4;return function(_0x8165b9){logger['error'](_0x8165b9[_0xf36d('0x25')]);if(_0x8165b9['name']){delete _0x8165b9['name'];}_0x2e622d[_0xf36d('0x19')](_0x12cd31)[_0xf36d('0x26')](_0x8165b9);};}exports[_0xf36d('0x27')]=function(_0x1775ee,_0x723404){var _0x5daf15={},_0x58daeb={},_0x4c0eeb={'count':0x0,'rows':[]};var _0x5d29d4=_[_0xf36d('0x28')](db[_0xf36d('0x29')][_0xf36d('0x2a')],function(_0x183747){return{'name':_0x183747[_0xf36d('0x2b')],'type':_0x183747[_0xf36d('0x2c')]['key']};});_0x58daeb[_0xf36d('0x2d')]=_[_0xf36d('0x28')](_0x5d29d4,_0xf36d('0x2e'));_0x58daeb['query']=_[_0xf36d('0x2f')](_0x1775ee[_0xf36d('0x30')]);_0x58daeb[_0xf36d('0x31')]=_['intersection'](_0x58daeb['model'],_0x58daeb[_0xf36d('0x30')]);_0x5daf15[_0xf36d('0x32')]=_['intersection'](_0x58daeb[_0xf36d('0x2d')],qs[_0xf36d('0x33')](_0x1775ee[_0xf36d('0x30')][_0xf36d('0x33')]));_0x5daf15['attributes']=_0x5daf15['attributes'][_0xf36d('0x34')]?_0x5daf15[_0xf36d('0x32')]:_0x58daeb['model'];if(!_0x1775ee[_0xf36d('0x30')][_0xf36d('0x35')](_0xf36d('0x36'))){_0x5daf15[_0xf36d('0x1e')]=qs[_0xf36d('0x1e')](_0x1775ee[_0xf36d('0x30')][_0xf36d('0x1e')]);_0x5daf15[_0xf36d('0x1d')]=qs[_0xf36d('0x1d')](_0x1775ee[_0xf36d('0x30')][_0xf36d('0x1d')]);}_0x5daf15[_0xf36d('0x37')]=qs[_0xf36d('0x38')](_0x1775ee[_0xf36d('0x30')][_0xf36d('0x38')]);_0x5daf15[_0xf36d('0x39')]=qs[_0xf36d('0x31')](_[_0xf36d('0x3a')](_0x1775ee[_0xf36d('0x30')],_0x58daeb[_0xf36d('0x31')]),_0x5d29d4);if(_0x1775ee[_0xf36d('0x30')][_0xf36d('0x3b')]){_0x5daf15['where']=_[_0xf36d('0x3c')](_0x5daf15[_0xf36d('0x39')],{'$or':_[_0xf36d('0x28')](_0x5d29d4,function(_0x9909e3){if(_0x9909e3[_0xf36d('0x2c')]!=='VIRTUAL'){var _0x592616={};_0x592616[_0x9909e3[_0xf36d('0x2e')]]={'$like':'%'+_0x1775ee[_0xf36d('0x30')][_0xf36d('0x3b')]+'%'};return _0x592616;}})});}_0x5daf15=_[_0xf36d('0x3c')]({},_0x5daf15,_0x1775ee[_0xf36d('0x3d')]);var _0x474624={'where':_0x5daf15[_0xf36d('0x39')]};return db[_0xf36d('0x29')][_0xf36d('0x1c')](_0x474624)[_0xf36d('0x3e')](function(_0x2a7da8){_0x4c0eeb[_0xf36d('0x1c')]=_0x2a7da8;if(_0x1775ee[_0xf36d('0x30')][_0xf36d('0x3f')]){_0x5daf15[_0xf36d('0x40')]=[{'all':!![]}];}return db[_0xf36d('0x29')][_0xf36d('0x41')](_0x5daf15);})[_0xf36d('0x3e')](function(_0x18e066){_0x4c0eeb[_0xf36d('0x42')]=_0x18e066;return _0x4c0eeb;})[_0xf36d('0x3e')](respondWithFilteredResult(_0x723404,_0x5daf15))['catch'](handleError(_0x723404,null));};exports[_0xf36d('0x43')]=function(_0x779ff7,_0x208715){var _0x41f516={'raw':!![],'where':{'id':_0x779ff7['params']['id']}},_0x3ec676={};_0x3ec676[_0xf36d('0x2d')]=_[_0xf36d('0x2f')](db[_0xf36d('0x29')][_0xf36d('0x2a')]);_0x3ec676[_0xf36d('0x30')]=_[_0xf36d('0x2f')](_0x779ff7[_0xf36d('0x30')]);_0x3ec676[_0xf36d('0x31')]=_[_0xf36d('0x44')](_0x3ec676['model'],_0x3ec676['query']);_0x41f516[_0xf36d('0x32')]=_[_0xf36d('0x44')](_0x3ec676[_0xf36d('0x2d')],qs[_0xf36d('0x33')](_0x779ff7[_0xf36d('0x30')][_0xf36d('0x33')]));_0x41f516[_0xf36d('0x32')]=_0x41f516[_0xf36d('0x32')][_0xf36d('0x34')]?_0x41f516[_0xf36d('0x32')]:_0x3ec676[_0xf36d('0x2d')];if(_0x779ff7[_0xf36d('0x30')][_0xf36d('0x3f')]){_0x41f516[_0xf36d('0x40')]=[{'all':!![]}];}_0x41f516=_['merge']({},_0x41f516,_0x779ff7[_0xf36d('0x3d')]);return db[_0xf36d('0x29')]['find'](_0x41f516)['then'](handleEntityNotFound(_0x208715,null))[_0xf36d('0x3e')](respondWithResult(_0x208715,null))[_0xf36d('0x45')](handleError(_0x208715,null));};exports[_0xf36d('0x46')]=function(_0x445cad,_0x5a1a8f){return db['CloudProvider'][_0xf36d('0x46')](_0x445cad[_0xf36d('0x47')],{})[_0xf36d('0x3e')](respondWithResult(_0x5a1a8f,0xc9))[_0xf36d('0x45')](handleError(_0x5a1a8f,null));};exports['update']=function(_0x47b641,_0x16cbf8){if(_0x47b641['body']['id']){delete _0x47b641[_0xf36d('0x47')]['id'];}return db[_0xf36d('0x29')][_0xf36d('0x48')]({'where':{'id':_0x47b641['params']['id']}})[_0xf36d('0x3e')](handleEntityNotFound(_0x16cbf8,null))[_0xf36d('0x3e')](saveUpdates(_0x47b641[_0xf36d('0x47')],null))[_0xf36d('0x3e')](respondWithResult(_0x16cbf8,null))[_0xf36d('0x45')](handleError(_0x16cbf8,null));};exports['destroy']=function(_0x8d0705,_0x7da70f){return db['CloudProvider'][_0xf36d('0x48')]({'where':{'id':_0x8d0705[_0xf36d('0x49')]['id']}})[_0xf36d('0x3e')](handleEntityNotFound(_0x7da70f,null))[_0xf36d('0x3e')](removeEntity(_0x7da70f,null))['catch'](handleError(_0x7da70f,null));}; \ No newline at end of file +var _0x6674=['findAll','catch','show','params','include','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll'];(function(_0x36365a,_0x224aa9){var _0x6af70a=function(_0x3cafd2){while(--_0x3cafd2){_0x36365a['push'](_0x36365a['shift']());}};_0x6af70a(++_0x224aa9);}(_0x6674,0x9c));var _0x4667=function(_0x55c182,_0x44d873){_0x55c182=_0x55c182-0x0;var _0x4327c3=_0x6674[_0x55c182];return _0x4327c3;};'use strict';var emlformat=require(_0x4667('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4667('0x1'));var rp=require(_0x4667('0x2'));var moment=require(_0x4667('0x3'));var BPromise=require(_0x4667('0x4'));var Mustache=require(_0x4667('0x5'));var util=require('util');var path=require(_0x4667('0x6'));var sox=require('sox');var csv=require(_0x4667('0x7'));var ejs=require(_0x4667('0x8'));var fs=require('fs');var fs_extra=require(_0x4667('0x9'));var _=require(_0x4667('0xa'));var squel=require(_0x4667('0xb'));var crypto=require(_0x4667('0xc'));var jsforce=require(_0x4667('0xd'));var deskjs=require(_0x4667('0xe'));var toCsv=require(_0x4667('0x7'));var querystring=require(_0x4667('0xf'));var Papa=require(_0x4667('0x10'));var Redis=require(_0x4667('0x11'));var authService=require(_0x4667('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4667('0x13'));var hardwareService=require(_0x4667('0x14'));var logger=require(_0x4667('0x15'))(_0x4667('0x16'));var utils=require(_0x4667('0x17'));var config=require(_0x4667('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4667('0x19'))['db'];function respondWithStatusCode(_0x1c53c9,_0xb3268e){_0xb3268e=_0xb3268e||0xcc;return function(_0x22d31b){if(_0x22d31b){return _0x1c53c9[_0x4667('0x1a')](_0xb3268e);}return _0x1c53c9['status'](_0xb3268e)[_0x4667('0x1b')]();};}function respondWithResult(_0x21b83e,_0x6ac3c5){_0x6ac3c5=_0x6ac3c5||0xc8;return function(_0x59e53f){if(_0x59e53f){return _0x21b83e[_0x4667('0x1c')](_0x6ac3c5)[_0x4667('0x1d')](_0x59e53f);}};}function respondWithFilteredResult(_0x572da4,_0x37a4b4){return function(_0x277c91){if(_0x277c91){var _0x4c30b0=_0x277c91[_0x4667('0x1e')],_0x30b3c8=_0x37a4b4[_0x4667('0x1f')],_0x1ee5ff=_0x37a4b4[_0x4667('0x1f')]+_0x37a4b4[_0x4667('0x20')],_0x3e8efc;if(_0x1ee5ff>=_0x4c30b0){_0x1ee5ff=_0x4c30b0;_0x3e8efc=0xc8;}else{_0x3e8efc=0xce;}_0x572da4[_0x4667('0x1c')](_0x3e8efc);return _0x572da4['set'](_0x4667('0x21'),_0x30b3c8+'-'+_0x1ee5ff+'/'+_0x4c30b0)[_0x4667('0x1d')](_0x277c91);}return null;};}function patchUpdates(_0x504dd1){return function(_0x2bc2ed){try{jsonpatch[_0x4667('0x22')](_0x2bc2ed,_0x504dd1,!![]);}catch(_0x2013aa){return BPromise['reject'](_0x2013aa);}return _0x2bc2ed[_0x4667('0x23')]();};}function saveUpdates(_0x2fffd2,_0x37a3a8){return function(_0x2d9ef5){if(_0x2d9ef5){return _0x2d9ef5[_0x4667('0x24')](_0x2fffd2)[_0x4667('0x25')](function(_0x5a68c4){return _0x5a68c4;});}return null;};}function removeEntity(_0x27424f,_0x12a76b){return function(_0x533c46){if(_0x533c46){return _0x533c46[_0x4667('0x26')]()['then'](function(){_0x27424f[_0x4667('0x1c')](0xcc)[_0x4667('0x1b')]();});}};}function handleEntityNotFound(_0x1ae367,_0x84bea){return function(_0x19caa2){if(!_0x19caa2){_0x1ae367['sendStatus'](0x194);}return _0x19caa2;};}function handleError(_0x19808c,_0x5b1ae2){_0x5b1ae2=_0x5b1ae2||0x1f4;return function(_0xac051d){logger[_0x4667('0x27')](_0xac051d[_0x4667('0x28')]);if(_0xac051d[_0x4667('0x29')]){delete _0xac051d[_0x4667('0x29')];}_0x19808c[_0x4667('0x1c')](_0x5b1ae2)[_0x4667('0x2a')](_0xac051d);};}exports['index']=function(_0x22b968,_0x4d1fd4){var _0x372333={},_0x330898={},_0x526ab8={'count':0x0,'rows':[]};var _0x2fe3a0=_[_0x4667('0x2b')](db[_0x4667('0x2c')][_0x4667('0x2d')],function(_0x1d1a1e){return{'name':_0x1d1a1e[_0x4667('0x2e')],'type':_0x1d1a1e[_0x4667('0x2f')][_0x4667('0x30')]};});_0x330898['model']=_[_0x4667('0x2b')](_0x2fe3a0,'name');_0x330898[_0x4667('0x31')]=_[_0x4667('0x32')](_0x22b968[_0x4667('0x31')]);_0x330898[_0x4667('0x33')]=_[_0x4667('0x34')](_0x330898[_0x4667('0x35')],_0x330898[_0x4667('0x31')]);_0x372333['attributes']=_['intersection'](_0x330898[_0x4667('0x35')],qs[_0x4667('0x36')](_0x22b968[_0x4667('0x31')][_0x4667('0x36')]));_0x372333[_0x4667('0x37')]=_0x372333[_0x4667('0x37')][_0x4667('0x38')]?_0x372333[_0x4667('0x37')]:_0x330898['model'];if(!_0x22b968[_0x4667('0x31')]['hasOwnProperty'](_0x4667('0x39'))){_0x372333['limit']=qs[_0x4667('0x20')](_0x22b968[_0x4667('0x31')][_0x4667('0x20')]);_0x372333[_0x4667('0x1f')]=qs[_0x4667('0x1f')](_0x22b968[_0x4667('0x31')][_0x4667('0x1f')]);}_0x372333[_0x4667('0x3a')]=qs[_0x4667('0x3b')](_0x22b968[_0x4667('0x31')][_0x4667('0x3b')]);_0x372333[_0x4667('0x3c')]=qs[_0x4667('0x33')](_[_0x4667('0x3d')](_0x22b968['query'],_0x330898[_0x4667('0x33')]),_0x2fe3a0);if(_0x22b968[_0x4667('0x31')]['filter']){_0x372333[_0x4667('0x3c')]=_[_0x4667('0x3e')](_0x372333[_0x4667('0x3c')],{'$or':_['map'](_0x2fe3a0,function(_0x360e52){if(_0x360e52[_0x4667('0x2f')]!=='VIRTUAL'){var _0xb80fe1={};_0xb80fe1[_0x360e52['name']]={'$like':'%'+_0x22b968['query'][_0x4667('0x3f')]+'%'};return _0xb80fe1;}})});}_0x372333=_[_0x4667('0x3e')]({},_0x372333,_0x22b968[_0x4667('0x40')]);var _0x5e7e02={'where':_0x372333[_0x4667('0x3c')]};return db[_0x4667('0x2c')][_0x4667('0x1e')](_0x5e7e02)[_0x4667('0x25')](function(_0x347206){_0x526ab8[_0x4667('0x1e')]=_0x347206;if(_0x22b968[_0x4667('0x31')][_0x4667('0x41')]){_0x372333['include']=[{'all':!![]}];}return db[_0x4667('0x2c')][_0x4667('0x42')](_0x372333);})['then'](function(_0x5bccb1){_0x526ab8['rows']=_0x5bccb1;return _0x526ab8;})[_0x4667('0x25')](respondWithFilteredResult(_0x4d1fd4,_0x372333))[_0x4667('0x43')](handleError(_0x4d1fd4,null));};exports[_0x4667('0x44')]=function(_0xaee9c9,_0x1a234f){var _0x5e54fb={'raw':!![],'where':{'id':_0xaee9c9[_0x4667('0x45')]['id']}},_0x2b014b={};_0x2b014b['model']=_[_0x4667('0x32')](db[_0x4667('0x2c')][_0x4667('0x2d')]);_0x2b014b[_0x4667('0x31')]=_['keys'](_0xaee9c9[_0x4667('0x31')]);_0x2b014b[_0x4667('0x33')]=_[_0x4667('0x34')](_0x2b014b[_0x4667('0x35')],_0x2b014b[_0x4667('0x31')]);_0x5e54fb['attributes']=_['intersection'](_0x2b014b[_0x4667('0x35')],qs[_0x4667('0x36')](_0xaee9c9[_0x4667('0x31')]['fields']));_0x5e54fb[_0x4667('0x37')]=_0x5e54fb[_0x4667('0x37')][_0x4667('0x38')]?_0x5e54fb['attributes']:_0x2b014b['model'];if(_0xaee9c9[_0x4667('0x31')][_0x4667('0x41')]){_0x5e54fb[_0x4667('0x46')]=[{'all':!![]}];}_0x5e54fb=_['merge']({},_0x5e54fb,_0xaee9c9[_0x4667('0x40')]);return db[_0x4667('0x2c')][_0x4667('0x47')](_0x5e54fb)[_0x4667('0x25')](handleEntityNotFound(_0x1a234f,null))[_0x4667('0x25')](respondWithResult(_0x1a234f,null))[_0x4667('0x43')](handleError(_0x1a234f,null));};exports[_0x4667('0x48')]=function(_0x3c1e6b,_0x444f04){return db['CloudProvider'][_0x4667('0x48')](_0x3c1e6b['body'],{})[_0x4667('0x25')](respondWithResult(_0x444f04,0xc9))[_0x4667('0x43')](handleError(_0x444f04,null));};exports['update']=function(_0xae7a75,_0x110fd8){if(_0xae7a75['body']['id']){delete _0xae7a75[_0x4667('0x49')]['id'];}return db[_0x4667('0x2c')][_0x4667('0x47')]({'where':{'id':_0xae7a75[_0x4667('0x45')]['id']}})['then'](handleEntityNotFound(_0x110fd8,null))['then'](saveUpdates(_0xae7a75[_0x4667('0x49')],null))[_0x4667('0x25')](respondWithResult(_0x110fd8,null))['catch'](handleError(_0x110fd8,null));};exports[_0x4667('0x26')]=function(_0x13f478,_0x30a115){return db[_0x4667('0x2c')]['find']({'where':{'id':_0x13f478['params']['id']}})[_0x4667('0x25')](handleEntityNotFound(_0x30a115,null))['then'](removeEntity(_0x30a115,null))[_0x4667('0x43')](handleError(_0x30a115,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 3af767f..29ea065 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 _0xe061=['exports','CloudProvider','cloud_providers','lodash','util','api','moment','../../config/environment','./cloudProvider.attributes'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0xe061,0x1ce));var _0x1e06=function(_0x1959c9,_0x273ce2){_0x1959c9=_0x1959c9-0x0;var _0x3fc139=_0xe061[_0x1959c9];return _0x3fc139;};'use strict';var _=require(_0x1e06('0x0'));var util=require(_0x1e06('0x1'));var logger=require('../../config/logger')(_0x1e06('0x2'));var moment=require(_0x1e06('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(_0x1e06('0x4'));var attributes=require(_0x1e06('0x5'));module[_0x1e06('0x6')]=function(_0x37c022,_0x12633e){return _0x37c022['define'](_0x1e06('0x7'),attributes,{'tableName':_0x1e06('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2b4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','lodash','../../config/logger'];(function(_0x285077,_0x37e1fa){var _0x5702c9=function(_0x29fdfd){while(--_0x29fdfd){_0x285077['push'](_0x285077['shift']());}};_0x5702c9(++_0x37e1fa);}(_0xb2b4,0x132));var _0x4b2b=function(_0x434903,_0x2bae84){_0x434903=_0x434903-0x0;var _0x31021e=_0xb2b4[_0x434903];return _0x31021e;};'use strict';var _=require(_0x4b2b('0x0'));var util=require('util');var logger=require(_0x4b2b('0x1'))('api');var moment=require(_0x4b2b('0x2'));var BPromise=require(_0x4b2b('0x3'));var rp=require(_0x4b2b('0x4'));var fs=require('fs');var path=require(_0x4b2b('0x5'));var rimraf=require(_0x4b2b('0x6'));var config=require(_0x4b2b('0x7'));var attributes=require(_0x4b2b('0x8'));module['exports']=function(_0x13d5a7,_0x15bab8){return _0x13d5a7[_0x4b2b('0x9')]('CloudProvider',attributes,{'tableName':_0x4b2b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index da29078..08b3891 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 _0x28e3=['jayson/promise','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x129de,_0x4348ec){var _0x187733=function(_0x3f2bef){while(--_0x3f2bef){_0x129de['push'](_0x129de['shift']());}};_0x187733(++_0x4348ec);}(_0x28e3,0xc0));var _0x328e=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x28e3[_0x209fcd];return _0x501d5e;};'use strict';var _=require(_0x328e('0x0'));var util=require(_0x328e('0x1'));var moment=require('moment');var BPromise=require(_0x328e('0x2'));var rs=require(_0x328e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x328e('0x4'));var logger=require(_0x328e('0x5'))(_0x328e('0x6'));var config=require(_0x328e('0x7'));var jayson=require(_0x328e('0x8'));var client=jayson['client'][_0x328e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502083,_0x4852b6,_0x5b3029){return new BPromise(function(_0x43853,_0x4f3196){return client[_0x328e('0xa')](_0x502083,_0x5b3029)[_0x328e('0xb')](function(_0x5b7bf4){logger['info'](_0x328e('0xc'),_0x4852b6,_0x328e('0xd'));logger['debug'](_0x328e('0xe'),_0x4852b6,_0x328e('0xd'),JSON[_0x328e('0xf')](_0x5b7bf4));if(_0x5b7bf4[_0x328e('0x10')]){if(_0x5b7bf4[_0x328e('0x10')][_0x328e('0x11')]===0x1f4){logger[_0x328e('0x10')](_0x328e('0xc'),_0x4852b6,_0x5b7bf4[_0x328e('0x10')][_0x328e('0x12')]);return _0x4f3196(_0x5b7bf4[_0x328e('0x10')][_0x328e('0x12')]);}logger[_0x328e('0x10')]('CloudProvider,\x20%s,\x20%s',_0x4852b6,_0x5b7bf4[_0x328e('0x10')]['message']);return _0x43853(_0x5b7bf4[_0x328e('0x10')][_0x328e('0x12')]);}else{logger['info'](_0x328e('0xc'),_0x4852b6,_0x328e('0xd'));_0x43853(_0x5b7bf4['result'][_0x328e('0x12')]);}})[_0x328e('0x13')](function(_0x350d23){logger[_0x328e('0x10')](_0x328e('0xc'),_0x4852b6,_0x350d23);_0x4f3196(_0x350d23);});});} \ No newline at end of file +var _0xfe85=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xdba05,_0x772daf){var _0xa00b0c=function(_0xf1ba99){while(--_0xf1ba99){_0xdba05['push'](_0xdba05['shift']());}};_0xa00b0c(++_0x772daf);}(_0xfe85,0xd2));var _0x5fe8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe85[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5fe8('0x0'));var util=require(_0x5fe8('0x1'));var moment=require(_0x5fe8('0x2'));var BPromise=require(_0x5fe8('0x3'));var rs=require(_0x5fe8('0x4'));var fs=require('fs');var Redis=require(_0x5fe8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5fe8('0x6'));var logger=require('../../config/logger')(_0x5fe8('0x7'));var config=require(_0x5fe8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5fe8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bdb4b,_0x2b44ac,_0x3da972){return new BPromise(function(_0x578e38,_0x5c501e){return client[_0x5fe8('0xa')](_0x4bdb4b,_0x3da972)[_0x5fe8('0xb')](function(_0x2840f3){logger['info'](_0x5fe8('0xc'),_0x2b44ac,_0x5fe8('0xd'));logger[_0x5fe8('0xe')](_0x5fe8('0xf'),_0x2b44ac,_0x5fe8('0xd'),JSON[_0x5fe8('0x10')](_0x2840f3));if(_0x2840f3[_0x5fe8('0x11')]){if(_0x2840f3['error'][_0x5fe8('0x12')]===0x1f4){logger[_0x5fe8('0x11')]('CloudProvider,\x20%s,\x20%s',_0x2b44ac,_0x2840f3['error'][_0x5fe8('0x13')]);return _0x5c501e(_0x2840f3['error'][_0x5fe8('0x13')]);}logger['error'](_0x5fe8('0xc'),_0x2b44ac,_0x2840f3[_0x5fe8('0x11')]['message']);return _0x578e38(_0x2840f3[_0x5fe8('0x11')][_0x5fe8('0x13')]);}else{logger[_0x5fe8('0x14')](_0x5fe8('0xc'),_0x2b44ac,_0x5fe8('0xd'));_0x578e38(_0x2840f3[_0x5fe8('0x15')][_0x5fe8('0x13')]);}})[_0x5fe8('0x16')](function(_0x6fdefb){logger[_0x5fe8('0x11')](_0x5fe8('0xc'),_0x2b44ac,_0x6fdefb);_0x5c501e(_0x6fdefb);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 0d0385b..5ca9d7c 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 _0xac19=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x4be6f4,_0x385b23){var _0x3e9098=function(_0x17ff9a){while(--_0x17ff9a){_0x4be6f4['push'](_0x4be6f4['shift']());}};_0x3e9098(++_0x385b23);}(_0xac19,0x130));var _0x9ac1=function(_0x1aa5eb,_0x4efec4){_0x1aa5eb=_0x1aa5eb-0x0;var _0x45f0fa=_0xac19[_0x1aa5eb];return _0x45f0fa;};'use strict';var multer=require('multer');var util=require(_0x9ac1('0x0'));var path=require(_0x9ac1('0x1'));var timeout=require(_0x9ac1('0x2'));var express=require(_0x9ac1('0x3'));var router=express['Router']();var fs_extra=require(_0x9ac1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9ac1('0x5'));var config=require(_0x9ac1('0x6'));var controller=require('./cloudProvider.controller');router[_0x9ac1('0x7')]('/',auth[_0x9ac1('0x8')](),controller['index']);router['get']('/:id',auth[_0x9ac1('0x8')](),controller[_0x9ac1('0x9')]);router[_0x9ac1('0xa')]('/',auth[_0x9ac1('0x8')](),controller[_0x9ac1('0xb')]);router[_0x9ac1('0xc')](_0x9ac1('0xd'),auth[_0x9ac1('0x8')](),controller[_0x9ac1('0xe')]);router[_0x9ac1('0xf')](_0x9ac1('0xd'),auth[_0x9ac1('0x8')](),controller[_0x9ac1('0x10')]);module[_0x9ac1('0x11')]=router; \ No newline at end of file +var _0xabe1=['multer','util','path','connect-timeout','express','Router','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xabe1,0x1c2));var _0x1abe=function(_0x3a081d,_0x340f67){_0x3a081d=_0x3a081d-0x0;var _0x279225=_0xabe1[_0x3a081d];return _0x279225;};'use strict';var multer=require(_0x1abe('0x0'));var util=require(_0x1abe('0x1'));var path=require(_0x1abe('0x2'));var timeout=require(_0x1abe('0x3'));var express=require(_0x1abe('0x4'));var router=express[_0x1abe('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1abe('0x6'));var controller=require(_0x1abe('0x7'));router[_0x1abe('0x8')]('/',auth[_0x1abe('0x9')](),controller[_0x1abe('0xa')]);router[_0x1abe('0x8')](_0x1abe('0xb'),auth[_0x1abe('0x9')](),controller['show']);router[_0x1abe('0xc')]('/',auth[_0x1abe('0x9')](),controller['create']);router[_0x1abe('0xd')](_0x1abe('0xb'),auth[_0x1abe('0x9')](),controller[_0x1abe('0xe')]);router[_0x1abe('0xf')]('/:id',auth[_0x1abe('0x9')](),controller[_0x1abe('0x10')]);module[_0x1abe('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index e95a8ac..3b70c8d 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 _0xb018=['STRING','sequelize','exports'];(function(_0x3219bb,_0x222b4b){var _0x491e58=function(_0x5bc10e){while(--_0x5bc10e){_0x3219bb['push'](_0x3219bb['shift']());}};_0x491e58(++_0x222b4b);}(_0xb018,0x15a));var _0x8b01=function(_0x714af2,_0x121cda){_0x714af2=_0x714af2-0x0;var _0x78aa51=_0xb018[_0x714af2];return _0x78aa51;};'use strict';var Sequelize=require(_0x8b01('0x0'));module[_0x8b01('0x1')]={'name':{'type':Sequelize[_0x8b01('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8b01('0x2')]},'companyId':{'type':Sequelize[_0x8b01('0x2')]},'website':{'type':Sequelize[_0x8b01('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8b01('0x2')]},'type':{'type':Sequelize[_0x8b01('0x2')]},'street':{'type':Sequelize[_0x8b01('0x2')]},'postalCode':{'type':Sequelize[_0x8b01('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x8b01('0x2')]},'email':{'type':Sequelize[_0x8b01('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8b01('0x2')]},'sStreet':{'type':Sequelize[_0x8b01('0x2')]},'sPostalCode':{'type':Sequelize[_0x8b01('0x2')]},'sCity':{'type':Sequelize[_0x8b01('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8b01('0x2')]}}; \ No newline at end of file +var _0x2e9f=['exports','STRING','name'];(function(_0x3cc8cb,_0x31f8fe){var _0x427615=function(_0x4dda8e){while(--_0x4dda8e){_0x3cc8cb['push'](_0x3cc8cb['shift']());}};_0x427615(++_0x31f8fe);}(_0x2e9f,0x72));var _0xf2e9=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x2e9f[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require('sequelize');module[_0xf2e9('0x0')]={'name':{'type':Sequelize[_0xf2e9('0x1')],'unique':_0xf2e9('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf2e9('0x1')]},'companyId':{'type':Sequelize[_0xf2e9('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf2e9('0x1')]},'fax':{'type':Sequelize[_0xf2e9('0x1')]},'type':{'type':Sequelize[_0xf2e9('0x1')]},'street':{'type':Sequelize[_0xf2e9('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf2e9('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf2e9('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf2e9('0x1')]},'sStreet':{'type':Sequelize[_0xf2e9('0x1')]},'sPostalCode':{'type':Sequelize[_0xf2e9('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xf2e9('0x1')]},'description':{'type':Sequelize[_0xf2e9('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 1d0e535..1812efc 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 _0xa400=['CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','addContacts','CmContact','ids','omit','getContacts','findOne','pick','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','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','end','json','count','offset','limit','status','Content-Range','apply','then','get','UserProfileResource','destroy','name','index'];(function(_0x53c253,_0x314fcc){var _0x3c4d95=function(_0x29b33c){while(--_0x29b33c){_0x53c253['push'](_0x53c253['shift']());}};_0x3c4d95(++_0x314fcc);}(_0xa400,0xc1));var _0x0a40=function(_0x352859,_0xd411d5){_0x352859=_0x352859-0x0;var _0x370808=_0xa400[_0x352859];return _0x370808;};'use strict';var emlformat=require(_0x0a40('0x0'));var rimraf=require(_0x0a40('0x1'));var zipdir=require(_0x0a40('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0a40('0x3'));var Mustache=require(_0x0a40('0x4'));var util=require('util');var path=require(_0x0a40('0x5'));var sox=require('sox');var csv=require(_0x0a40('0x6'));var ejs=require(_0x0a40('0x7'));var fs=require('fs');var fs_extra=require(_0x0a40('0x8'));var _=require(_0x0a40('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a40('0xa'));var toCsv=require(_0x0a40('0x6'));var querystring=require(_0x0a40('0xb'));var Papa=require(_0x0a40('0xc'));var Redis=require(_0x0a40('0xd'));var authService=require(_0x0a40('0xe'));var qs=require(_0x0a40('0xf'));var as=require(_0x0a40('0x10'));var hardwareService=require(_0x0a40('0x11'));var logger=require(_0x0a40('0x12'))(_0x0a40('0x13'));var utils=require(_0x0a40('0x14'));var config=require(_0x0a40('0x15'));var licenseUtil=require(_0x0a40('0x16'));var db=require(_0x0a40('0x17'))['db'];function respondWithStatusCode(_0x45a6cb,_0x384eef){_0x384eef=_0x384eef||0xcc;return function(_0x5f2d82){if(_0x5f2d82){return _0x45a6cb['sendStatus'](_0x384eef);}return _0x45a6cb['status'](_0x384eef)[_0x0a40('0x18')]();};}function respondWithResult(_0x1b5104,_0x5de1de){_0x5de1de=_0x5de1de||0xc8;return function(_0x339fb6){if(_0x339fb6){return _0x1b5104['status'](_0x5de1de)[_0x0a40('0x19')](_0x339fb6);}};}function respondWithFilteredResult(_0x182cc0,_0x4e3954){return function(_0x198fed){if(_0x198fed){var _0x27b3aa=_0x198fed[_0x0a40('0x1a')],_0x5a6a44=_0x4e3954[_0x0a40('0x1b')],_0x4a064c=_0x4e3954[_0x0a40('0x1b')]+_0x4e3954[_0x0a40('0x1c')],_0x59cdbe;if(_0x4a064c>=_0x27b3aa){_0x4a064c=_0x27b3aa;_0x59cdbe=0xc8;}else{_0x59cdbe=0xce;}_0x182cc0[_0x0a40('0x1d')](_0x59cdbe);return _0x182cc0['set'](_0x0a40('0x1e'),_0x5a6a44+'-'+_0x4a064c+'/'+_0x27b3aa)[_0x0a40('0x19')](_0x198fed);}return null;};}function patchUpdates(_0x1e4eee){return function(_0x5c039a){try{jsonpatch[_0x0a40('0x1f')](_0x5c039a,_0x1e4eee,!![]);}catch(_0x531f70){return BPromise['reject'](_0x531f70);}return _0x5c039a['save']();};}function saveUpdates(_0x3e4a43,_0x3b405f){return function(_0x57afba){if(_0x57afba){return _0x57afba['update'](_0x3e4a43)[_0x0a40('0x20')](function(_0x1aebc1){return _0x1aebc1;});}return null;};}function removeEntity(_0x16edc4,_0x145ebb){return function(_0x14f35e){if(_0x14f35e){return _0x14f35e['destroy']()[_0x0a40('0x20')](function(){var _0x2c7141=_0x14f35e[_0x0a40('0x21')]({'plain':!![]});var _0x2ab128='Companies';return db[_0x0a40('0x22')][_0x0a40('0x23')]({'where':{'type':_0x2ab128,'resourceId':_0x2c7141['id']}})[_0x0a40('0x20')](function(){return _0x14f35e;});})[_0x0a40('0x20')](function(){_0x16edc4[_0x0a40('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4687fd,_0x2896df){return function(_0x21ccdc){if(!_0x21ccdc){_0x4687fd['sendStatus'](0x194);}return _0x21ccdc;};}function handleError(_0x3d08a9,_0x44ed96){_0x44ed96=_0x44ed96||0x1f4;return function(_0x4f6128){logger['error'](_0x4f6128['stack']);if(_0x4f6128[_0x0a40('0x24')]){delete _0x4f6128[_0x0a40('0x24')];}_0x3d08a9[_0x0a40('0x1d')](_0x44ed96)['send'](_0x4f6128);};}exports[_0x0a40('0x25')]=function(_0x19c28d,_0x16c784){var _0x4f98c3={},_0x329c08={},_0x3c4229={'count':0x0,'rows':[]};return db[_0x0a40('0x26')]['describe']()[_0x0a40('0x20')](function(_0x491906){_0x329c08[_0x0a40('0x27')]=_[_0x0a40('0x28')](_0x491906);_0x329c08[_0x0a40('0x29')]=_[_0x0a40('0x28')](_0x19c28d[_0x0a40('0x29')]);_0x329c08[_0x0a40('0x2a')]=_[_0x0a40('0x2b')](_0x329c08[_0x0a40('0x27')],_0x329c08[_0x0a40('0x29')]);_0x4f98c3[_0x0a40('0x2c')]=_[_0x0a40('0x2b')](_0x329c08[_0x0a40('0x27')],qs[_0x0a40('0x2d')](_0x19c28d[_0x0a40('0x29')][_0x0a40('0x2d')]));_0x4f98c3[_0x0a40('0x2c')]=_0x4f98c3['attributes'][_0x0a40('0x2e')]?_0x4f98c3['attributes']:_0x329c08['model'];if(!_0x19c28d[_0x0a40('0x29')][_0x0a40('0x2f')](_0x0a40('0x30'))){_0x4f98c3[_0x0a40('0x1c')]=qs['limit'](_0x19c28d[_0x0a40('0x29')][_0x0a40('0x1c')]);_0x4f98c3[_0x0a40('0x1b')]=qs['offset'](_0x19c28d[_0x0a40('0x29')][_0x0a40('0x1b')]);}_0x4f98c3[_0x0a40('0x31')]=qs[_0x0a40('0x32')](_0x19c28d[_0x0a40('0x29')][_0x0a40('0x32')]);_0x4f98c3[_0x0a40('0x33')]=qs['filters'](_['pick'](_0x19c28d[_0x0a40('0x29')],_0x329c08[_0x0a40('0x2a')]),_0x491906);if(_0x19c28d[_0x0a40('0x29')][_0x0a40('0x34')]){_0x4f98c3['where']=_[_0x0a40('0x35')](_0x4f98c3['where'],{'$or':_[_0x0a40('0x36')](_0x4f98c3[_0x0a40('0x2c')],function(_0x4a1ed1){var _0x3ee1f8={};_0x3ee1f8[_0x4a1ed1]={'$like':'%'+_0x19c28d[_0x0a40('0x29')]['filter']+'%'};return _0x3ee1f8;})});}_0x4f98c3=_['merge']({},_0x4f98c3,_0x19c28d[_0x0a40('0x37')]);var _0x2f9656={'where':_0x4f98c3[_0x0a40('0x33')]};return db['CmCompany'][_0x0a40('0x1a')](_0x2f9656)['then'](function(_0x410779){_0x3c4229[_0x0a40('0x1a')]=_0x410779;if(_0x19c28d[_0x0a40('0x29')][_0x0a40('0x38')]){_0x4f98c3[_0x0a40('0x39')]=[{'all':!![]}];}return db[_0x0a40('0x26')]['findAll'](_0x4f98c3);})['then'](function(_0x471484){_0x3c4229['rows']=_0x471484;return _0x3c4229;})[_0x0a40('0x20')](respondWithFilteredResult(_0x16c784,_0x4f98c3))['catch'](handleError(_0x16c784,null));})[_0x0a40('0x3a')](handleError(_0x16c784,null));};exports[_0x0a40('0x3b')]=function(_0x561da3,_0x365f98){var _0x5e2355={'raw':![],'where':{'id':_0x561da3[_0x0a40('0x3c')]['id']}},_0x3b9735={};_0x3b9735[_0x0a40('0x27')]=_['keys'](db['CmCompany'][_0x0a40('0x3d')]);_0x3b9735[_0x0a40('0x29')]=_[_0x0a40('0x28')](_0x561da3['query']);_0x3b9735[_0x0a40('0x2a')]=_[_0x0a40('0x2b')](_0x3b9735[_0x0a40('0x27')],_0x3b9735[_0x0a40('0x29')]);_0x5e2355[_0x0a40('0x2c')]=_[_0x0a40('0x2b')](_0x3b9735[_0x0a40('0x27')],qs[_0x0a40('0x2d')](_0x561da3['query'][_0x0a40('0x2d')]));_0x5e2355[_0x0a40('0x2c')]=_0x5e2355[_0x0a40('0x2c')][_0x0a40('0x2e')]?_0x5e2355[_0x0a40('0x2c')]:_0x3b9735[_0x0a40('0x27')];if(_0x561da3['query']['includeAll']){_0x5e2355[_0x0a40('0x39')]=[{'all':!![]}];}_0x5e2355=_[_0x0a40('0x35')]({},_0x5e2355,_0x561da3[_0x0a40('0x37')]);return db[_0x0a40('0x26')][_0x0a40('0x3e')](_0x5e2355)[_0x0a40('0x20')](handleEntityNotFound(_0x365f98,null))[_0x0a40('0x20')](respondWithResult(_0x365f98,null))[_0x0a40('0x3a')](handleError(_0x365f98,null));};exports[_0x0a40('0x3f')]=function(_0x224ce1,_0x545d72){return db[_0x0a40('0x26')][_0x0a40('0x3f')](_0x224ce1[_0x0a40('0x40')],{})[_0x0a40('0x20')](function(_0x508c43){var _0x583287=_0x224ce1[_0x0a40('0x41')]['get']({'plain':!![]});if(!_0x583287)throw new Error(_0x0a40('0x42'));if(_0x583287['role']==='user'){var _0x383fab=_0x508c43[_0x0a40('0x21')]({'plain':!![]});var _0x1841f1='Companies';return db['UserProfileSection'][_0x0a40('0x3e')]({'where':{'name':_0x1841f1,'userProfileId':_0x583287[_0x0a40('0x43')]},'raw':!![]})[_0x0a40('0x20')](function(_0x4fa41d){if(_0x4fa41d&&_0x4fa41d[_0x0a40('0x44')]===0x0){return db[_0x0a40('0x22')][_0x0a40('0x3f')]({'name':_0x383fab[_0x0a40('0x24')],'resourceId':_0x383fab['id'],'type':_0x4fa41d[_0x0a40('0x24')],'sectionId':_0x4fa41d['id']},{})[_0x0a40('0x20')](function(){return _0x508c43;});}else{return _0x508c43;}})['catch'](function(_0x3bfa17){logger[_0x0a40('0x45')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bfa17);throw _0x3bfa17;});}return _0x508c43;})[_0x0a40('0x20')](respondWithResult(_0x545d72,0xc9))['catch'](handleError(_0x545d72,null));};exports['update']=function(_0x1b8d48,_0x4d7ea2){if(_0x1b8d48[_0x0a40('0x40')]['id']){delete _0x1b8d48[_0x0a40('0x40')]['id'];}return db[_0x0a40('0x26')][_0x0a40('0x3e')]({'where':{'id':_0x1b8d48[_0x0a40('0x3c')]['id']}})[_0x0a40('0x20')](handleEntityNotFound(_0x4d7ea2,null))['then'](saveUpdates(_0x1b8d48[_0x0a40('0x40')],null))[_0x0a40('0x20')](respondWithResult(_0x4d7ea2,null))[_0x0a40('0x3a')](handleError(_0x4d7ea2,null));};exports[_0x0a40('0x23')]=function(_0x1d663b,_0x245df8){return db[_0x0a40('0x26')][_0x0a40('0x3e')]({'where':{'id':_0x1d663b[_0x0a40('0x3c')]['id']}})[_0x0a40('0x20')](handleEntityNotFound(_0x245df8,null))[_0x0a40('0x20')](removeEntity(_0x245df8,null))[_0x0a40('0x3a')](handleError(_0x245df8,null));};exports['describe']=function(_0x199dcb,_0x218202){return db[_0x0a40('0x26')]['describe']()['then'](respondWithResult(_0x218202,null))[_0x0a40('0x3a')](handleError(_0x218202,null));};exports[_0x0a40('0x46')]=function(_0x3c572d,_0x6df452,_0x2bec7d){return db[_0x0a40('0x47')]['find']({'where':{'id':_0x3c572d[_0x0a40('0x3c')]['id']}})['then'](handleEntityNotFound(_0x6df452,null))['then'](function(_0x1dd3e2){if(_0x1dd3e2){return _0x1dd3e2[_0x0a40('0x46')](_0x3c572d['body'][_0x0a40('0x48')],_[_0x0a40('0x49')](_0x3c572d[_0x0a40('0x40')],[_0x0a40('0x48'),'id'])||{});}})['then'](respondWithResult(_0x6df452,null))['catch'](handleError(_0x6df452,null));};exports[_0x0a40('0x4a')]=function(_0x385a7f,_0x2c5965,_0x1f6771){var _0x386389={};var _0x23d20b={};var _0x550b11;var _0xb9cecd;return db[_0x0a40('0x26')][_0x0a40('0x4b')]({'where':{'id':_0x385a7f[_0x0a40('0x3c')]['id']}})[_0x0a40('0x20')](handleEntityNotFound(_0x2c5965,null))[_0x0a40('0x20')](function(_0x251700){if(_0x251700){_0x550b11=_0x251700;_0x23d20b['model']=_[_0x0a40('0x28')](db['CmContact'][_0x0a40('0x3d')]);_0x23d20b[_0x0a40('0x29')]=_[_0x0a40('0x28')](_0x385a7f[_0x0a40('0x29')]);_0x23d20b[_0x0a40('0x2a')]=_[_0x0a40('0x2b')](_0x23d20b[_0x0a40('0x27')],_0x23d20b[_0x0a40('0x29')]);_0x386389[_0x0a40('0x2c')]=_['intersection'](_0x23d20b[_0x0a40('0x27')],qs[_0x0a40('0x2d')](_0x385a7f[_0x0a40('0x29')][_0x0a40('0x2d')]));_0x386389[_0x0a40('0x2c')]=_0x386389[_0x0a40('0x2c')][_0x0a40('0x2e')]?_0x386389[_0x0a40('0x2c')]:_0x23d20b[_0x0a40('0x27')];_0x386389[_0x0a40('0x31')]=qs[_0x0a40('0x32')](_0x385a7f[_0x0a40('0x29')]['sort']);_0x386389[_0x0a40('0x33')]=qs[_0x0a40('0x2a')](_[_0x0a40('0x4c')](_0x385a7f[_0x0a40('0x29')],_0x23d20b[_0x0a40('0x2a')]));if(_0x385a7f['query'][_0x0a40('0x34')]){_0x386389[_0x0a40('0x33')]=_[_0x0a40('0x35')](_0x386389[_0x0a40('0x33')],{'$or':_['map'](_0x386389[_0x0a40('0x2c')],function(_0x508d8e){var _0x489d35={};_0x489d35[_0x508d8e]={'$like':'%'+_0x385a7f['query'][_0x0a40('0x34')]+'%'};return _0x489d35;})});}_0x386389=_['merge']({},_0x386389,_0x385a7f[_0x0a40('0x37')]);return _0x550b11['getContacts'](_0x386389);}})[_0x0a40('0x20')](function(_0x427ef6){if(_0x427ef6){_0xb9cecd=_0x427ef6[_0x0a40('0x2e')];if(!_0x385a7f[_0x0a40('0x29')][_0x0a40('0x2f')](_0x0a40('0x30'))){_0x386389[_0x0a40('0x1c')]=qs[_0x0a40('0x1c')](_0x385a7f['query'][_0x0a40('0x1c')]);_0x386389[_0x0a40('0x1b')]=qs[_0x0a40('0x1b')](_0x385a7f[_0x0a40('0x29')][_0x0a40('0x1b')]);}return _0x550b11[_0x0a40('0x4a')](_0x386389);}})[_0x0a40('0x20')](function(_0x16c653){if(_0x16c653){return _0x16c653?{'count':_0xb9cecd,'rows':_0x16c653}:null;}})[_0x0a40('0x20')](respondWithResult(_0x2c5965,null))['catch'](handleError(_0x2c5965,null));}; \ No newline at end of file +var _0xd0a4=['status','end','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','addContacts','ids','omit','getContacts','CmContact','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x30fad0,_0x45077b){var _0x2b8d18=function(_0x3b2f07){while(--_0x3b2f07){_0x30fad0['push'](_0x30fad0['shift']());}};_0x2b8d18(++_0x45077b);}(_0xd0a4,0x13e));var _0x4d0a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd0a4[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x4d0a('0x0'));var rimraf=require(_0x4d0a('0x1'));var zipdir=require(_0x4d0a('0x2'));var jsonpatch=require(_0x4d0a('0x3'));var rp=require(_0x4d0a('0x4'));var moment=require(_0x4d0a('0x5'));var BPromise=require(_0x4d0a('0x6'));var Mustache=require('mustache');var util=require(_0x4d0a('0x7'));var path=require(_0x4d0a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d0a('0x9'));var _=require(_0x4d0a('0xa'));var squel=require('squel');var crypto=require(_0x4d0a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d0a('0xc'));var querystring=require(_0x4d0a('0xd'));var Papa=require(_0x4d0a('0xe'));var Redis=require('ioredis');var authService=require(_0x4d0a('0xf'));var qs=require(_0x4d0a('0x10'));var as=require(_0x4d0a('0x11'));var hardwareService=require(_0x4d0a('0x12'));var logger=require(_0x4d0a('0x13'))(_0x4d0a('0x14'));var utils=require(_0x4d0a('0x15'));var config=require(_0x4d0a('0x16'));var licenseUtil=require(_0x4d0a('0x17'));var db=require(_0x4d0a('0x18'))['db'];function respondWithStatusCode(_0x56ec42,_0x4c2a57){_0x4c2a57=_0x4c2a57||0xcc;return function(_0x1d535c){if(_0x1d535c){return _0x56ec42[_0x4d0a('0x19')](_0x4c2a57);}return _0x56ec42[_0x4d0a('0x1a')](_0x4c2a57)[_0x4d0a('0x1b')]();};}function respondWithResult(_0x3592d8,_0x5d9654){_0x5d9654=_0x5d9654||0xc8;return function(_0x55cc54){if(_0x55cc54){return _0x3592d8[_0x4d0a('0x1a')](_0x5d9654)['json'](_0x55cc54);}};}function respondWithFilteredResult(_0x43968d,_0x26ac0b){return function(_0x28c6fd){if(_0x28c6fd){var _0x3e8ebd=_0x28c6fd[_0x4d0a('0x1c')],_0x43c7e6=_0x26ac0b[_0x4d0a('0x1d')],_0x16966b=_0x26ac0b['offset']+_0x26ac0b[_0x4d0a('0x1e')],_0x42ed8a;if(_0x16966b>=_0x3e8ebd){_0x16966b=_0x3e8ebd;_0x42ed8a=0xc8;}else{_0x42ed8a=0xce;}_0x43968d['status'](_0x42ed8a);return _0x43968d['set'](_0x4d0a('0x1f'),_0x43c7e6+'-'+_0x16966b+'/'+_0x3e8ebd)[_0x4d0a('0x20')](_0x28c6fd);}return null;};}function patchUpdates(_0x9f9921){return function(_0x5128ef){try{jsonpatch[_0x4d0a('0x21')](_0x5128ef,_0x9f9921,!![]);}catch(_0x496a45){return BPromise['reject'](_0x496a45);}return _0x5128ef[_0x4d0a('0x22')]();};}function saveUpdates(_0x39b963,_0x5cc6d1){return function(_0x4256a0){if(_0x4256a0){return _0x4256a0[_0x4d0a('0x23')](_0x39b963)[_0x4d0a('0x24')](function(_0x5072f4){return _0x5072f4;});}return null;};}function removeEntity(_0xf38cd0,_0x588dcf){return function(_0x4ab749){if(_0x4ab749){return _0x4ab749[_0x4d0a('0x25')]()[_0x4d0a('0x24')](function(){var _0x2bb967=_0x4ab749[_0x4d0a('0x26')]({'plain':!![]});var _0x13edff=_0x4d0a('0x27');return db[_0x4d0a('0x28')]['destroy']({'where':{'type':_0x13edff,'resourceId':_0x2bb967['id']}})[_0x4d0a('0x24')](function(){return _0x4ab749;});})[_0x4d0a('0x24')](function(){_0xf38cd0[_0x4d0a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x196659,_0x1c50b4){return function(_0x342998){if(!_0x342998){_0x196659[_0x4d0a('0x19')](0x194);}return _0x342998;};}function handleError(_0xe6b132,_0x30b42e){_0x30b42e=_0x30b42e||0x1f4;return function(_0x216f3b){logger[_0x4d0a('0x29')](_0x216f3b[_0x4d0a('0x2a')]);if(_0x216f3b[_0x4d0a('0x2b')]){delete _0x216f3b[_0x4d0a('0x2b')];}_0xe6b132[_0x4d0a('0x1a')](_0x30b42e)[_0x4d0a('0x2c')](_0x216f3b);};}exports[_0x4d0a('0x2d')]=function(_0x340244,_0x5eb5cc){var _0x163b15={},_0x248d4f={},_0x4646bc={'count':0x0,'rows':[]};return db['CmCompany'][_0x4d0a('0x2e')]()[_0x4d0a('0x24')](function(_0x52bbb4){_0x248d4f['model']=_[_0x4d0a('0x2f')](_0x52bbb4);_0x248d4f[_0x4d0a('0x30')]=_[_0x4d0a('0x2f')](_0x340244['query']);_0x248d4f[_0x4d0a('0x31')]=_[_0x4d0a('0x32')](_0x248d4f[_0x4d0a('0x33')],_0x248d4f['query']);_0x163b15[_0x4d0a('0x34')]=_[_0x4d0a('0x32')](_0x248d4f[_0x4d0a('0x33')],qs[_0x4d0a('0x35')](_0x340244[_0x4d0a('0x30')][_0x4d0a('0x35')]));_0x163b15[_0x4d0a('0x34')]=_0x163b15[_0x4d0a('0x34')][_0x4d0a('0x36')]?_0x163b15[_0x4d0a('0x34')]:_0x248d4f[_0x4d0a('0x33')];if(!_0x340244['query'][_0x4d0a('0x37')](_0x4d0a('0x38'))){_0x163b15['limit']=qs[_0x4d0a('0x1e')](_0x340244[_0x4d0a('0x30')][_0x4d0a('0x1e')]);_0x163b15[_0x4d0a('0x1d')]=qs['offset'](_0x340244[_0x4d0a('0x30')][_0x4d0a('0x1d')]);}_0x163b15[_0x4d0a('0x39')]=qs[_0x4d0a('0x3a')](_0x340244['query']['sort']);_0x163b15['where']=qs[_0x4d0a('0x31')](_[_0x4d0a('0x3b')](_0x340244[_0x4d0a('0x30')],_0x248d4f[_0x4d0a('0x31')]),_0x52bbb4);if(_0x340244[_0x4d0a('0x30')]['filter']){_0x163b15[_0x4d0a('0x3c')]=_[_0x4d0a('0x3d')](_0x163b15[_0x4d0a('0x3c')],{'$or':_['map'](_0x163b15[_0x4d0a('0x34')],function(_0x23e9aa){var _0x260f17={};_0x260f17[_0x23e9aa]={'$like':'%'+_0x340244['query'][_0x4d0a('0x3e')]+'%'};return _0x260f17;})});}_0x163b15=_[_0x4d0a('0x3d')]({},_0x163b15,_0x340244[_0x4d0a('0x3f')]);var _0x11964f={'where':_0x163b15[_0x4d0a('0x3c')]};return db[_0x4d0a('0x40')][_0x4d0a('0x1c')](_0x11964f)[_0x4d0a('0x24')](function(_0x1fee21){_0x4646bc[_0x4d0a('0x1c')]=_0x1fee21;if(_0x340244[_0x4d0a('0x30')][_0x4d0a('0x41')]){_0x163b15['include']=[{'all':!![]}];}return db['CmCompany'][_0x4d0a('0x42')](_0x163b15);})[_0x4d0a('0x24')](function(_0xfc16d0){_0x4646bc[_0x4d0a('0x43')]=_0xfc16d0;return _0x4646bc;})[_0x4d0a('0x24')](respondWithFilteredResult(_0x5eb5cc,_0x163b15))[_0x4d0a('0x44')](handleError(_0x5eb5cc,null));})[_0x4d0a('0x44')](handleError(_0x5eb5cc,null));};exports[_0x4d0a('0x45')]=function(_0x290732,_0x29a17e){var _0x51b09d={'raw':![],'where':{'id':_0x290732[_0x4d0a('0x46')]['id']}},_0x5babb8={};_0x5babb8[_0x4d0a('0x33')]=_[_0x4d0a('0x2f')](db[_0x4d0a('0x40')][_0x4d0a('0x47')]);_0x5babb8[_0x4d0a('0x30')]=_[_0x4d0a('0x2f')](_0x290732[_0x4d0a('0x30')]);_0x5babb8[_0x4d0a('0x31')]=_[_0x4d0a('0x32')](_0x5babb8['model'],_0x5babb8['query']);_0x51b09d[_0x4d0a('0x34')]=_[_0x4d0a('0x32')](_0x5babb8['model'],qs[_0x4d0a('0x35')](_0x290732[_0x4d0a('0x30')][_0x4d0a('0x35')]));_0x51b09d[_0x4d0a('0x34')]=_0x51b09d['attributes'][_0x4d0a('0x36')]?_0x51b09d['attributes']:_0x5babb8['model'];if(_0x290732[_0x4d0a('0x30')][_0x4d0a('0x41')]){_0x51b09d['include']=[{'all':!![]}];}_0x51b09d=_[_0x4d0a('0x3d')]({},_0x51b09d,_0x290732[_0x4d0a('0x3f')]);return db[_0x4d0a('0x40')][_0x4d0a('0x48')](_0x51b09d)['then'](handleEntityNotFound(_0x29a17e,null))[_0x4d0a('0x24')](respondWithResult(_0x29a17e,null))[_0x4d0a('0x44')](handleError(_0x29a17e,null));};exports[_0x4d0a('0x49')]=function(_0x378367,_0x75be2e){return db[_0x4d0a('0x40')][_0x4d0a('0x49')](_0x378367['body'],{})[_0x4d0a('0x24')](function(_0x138085){var _0x10ad4e=_0x378367[_0x4d0a('0x4a')]['get']({'plain':!![]});if(!_0x10ad4e)throw new Error(_0x4d0a('0x4b'));if(_0x10ad4e[_0x4d0a('0x4c')]==='user'){var _0x4f6c1b=_0x138085[_0x4d0a('0x26')]({'plain':!![]});var _0x28bb5e=_0x4d0a('0x27');return db[_0x4d0a('0x4d')][_0x4d0a('0x48')]({'where':{'name':_0x28bb5e,'userProfileId':_0x10ad4e['userProfileId']},'raw':!![]})[_0x4d0a('0x24')](function(_0x4d9cea){if(_0x4d9cea&&_0x4d9cea[_0x4d0a('0x4e')]===0x0){return db['UserProfileResource'][_0x4d0a('0x49')]({'name':_0x4f6c1b['name'],'resourceId':_0x4f6c1b['id'],'type':_0x4d9cea[_0x4d0a('0x2b')],'sectionId':_0x4d9cea['id']},{})[_0x4d0a('0x24')](function(){return _0x138085;});}else{return _0x138085;}})[_0x4d0a('0x44')](function(_0x297335){logger[_0x4d0a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x297335);throw _0x297335;});}return _0x138085;})[_0x4d0a('0x24')](respondWithResult(_0x75be2e,0xc9))['catch'](handleError(_0x75be2e,null));};exports[_0x4d0a('0x23')]=function(_0x18163d,_0x50f758){if(_0x18163d[_0x4d0a('0x4f')]['id']){delete _0x18163d[_0x4d0a('0x4f')]['id'];}return db[_0x4d0a('0x40')][_0x4d0a('0x48')]({'where':{'id':_0x18163d['params']['id']}})[_0x4d0a('0x24')](handleEntityNotFound(_0x50f758,null))[_0x4d0a('0x24')](saveUpdates(_0x18163d['body'],null))[_0x4d0a('0x24')](respondWithResult(_0x50f758,null))['catch'](handleError(_0x50f758,null));};exports[_0x4d0a('0x25')]=function(_0x8f0417,_0x2ba0b7){return db[_0x4d0a('0x40')][_0x4d0a('0x48')]({'where':{'id':_0x8f0417[_0x4d0a('0x46')]['id']}})[_0x4d0a('0x24')](handleEntityNotFound(_0x2ba0b7,null))[_0x4d0a('0x24')](removeEntity(_0x2ba0b7,null))[_0x4d0a('0x44')](handleError(_0x2ba0b7,null));};exports[_0x4d0a('0x2e')]=function(_0x108b0b,_0x25713c){return db['CmCompany'][_0x4d0a('0x2e')]()[_0x4d0a('0x24')](respondWithResult(_0x25713c,null))[_0x4d0a('0x44')](handleError(_0x25713c,null));};exports['addContacts']=function(_0x1b61bd,_0x4702fa,_0x233451){return db['CmContact'][_0x4d0a('0x48')]({'where':{'id':_0x1b61bd[_0x4d0a('0x46')]['id']}})[_0x4d0a('0x24')](handleEntityNotFound(_0x4702fa,null))[_0x4d0a('0x24')](function(_0x165637){if(_0x165637){return _0x165637[_0x4d0a('0x50')](_0x1b61bd[_0x4d0a('0x4f')][_0x4d0a('0x51')],_[_0x4d0a('0x52')](_0x1b61bd['body'],[_0x4d0a('0x51'),'id'])||{});}})[_0x4d0a('0x24')](respondWithResult(_0x4702fa,null))[_0x4d0a('0x44')](handleError(_0x4702fa,null));};exports[_0x4d0a('0x53')]=function(_0x9f26bb,_0x5f4422,_0x3594a6){var _0x4bb127={};var _0x1b6928={};var _0x35c78f;var _0x751801;return db[_0x4d0a('0x40')]['findOne']({'where':{'id':_0x9f26bb[_0x4d0a('0x46')]['id']}})[_0x4d0a('0x24')](handleEntityNotFound(_0x5f4422,null))['then'](function(_0x57229c){if(_0x57229c){_0x35c78f=_0x57229c;_0x1b6928[_0x4d0a('0x33')]=_[_0x4d0a('0x2f')](db[_0x4d0a('0x54')][_0x4d0a('0x47')]);_0x1b6928[_0x4d0a('0x30')]=_[_0x4d0a('0x2f')](_0x9f26bb[_0x4d0a('0x30')]);_0x1b6928['filters']=_[_0x4d0a('0x32')](_0x1b6928[_0x4d0a('0x33')],_0x1b6928[_0x4d0a('0x30')]);_0x4bb127[_0x4d0a('0x34')]=_[_0x4d0a('0x32')](_0x1b6928[_0x4d0a('0x33')],qs[_0x4d0a('0x35')](_0x9f26bb[_0x4d0a('0x30')][_0x4d0a('0x35')]));_0x4bb127[_0x4d0a('0x34')]=_0x4bb127['attributes'][_0x4d0a('0x36')]?_0x4bb127[_0x4d0a('0x34')]:_0x1b6928[_0x4d0a('0x33')];_0x4bb127['order']=qs[_0x4d0a('0x3a')](_0x9f26bb[_0x4d0a('0x30')]['sort']);_0x4bb127[_0x4d0a('0x3c')]=qs[_0x4d0a('0x31')](_[_0x4d0a('0x3b')](_0x9f26bb[_0x4d0a('0x30')],_0x1b6928[_0x4d0a('0x31')]));if(_0x9f26bb[_0x4d0a('0x30')][_0x4d0a('0x3e')]){_0x4bb127[_0x4d0a('0x3c')]=_['merge'](_0x4bb127[_0x4d0a('0x3c')],{'$or':_[_0x4d0a('0x55')](_0x4bb127['attributes'],function(_0x3aca9f){var _0x3c3e00={};_0x3c3e00[_0x3aca9f]={'$like':'%'+_0x9f26bb[_0x4d0a('0x30')]['filter']+'%'};return _0x3c3e00;})});}_0x4bb127=_['merge']({},_0x4bb127,_0x9f26bb[_0x4d0a('0x3f')]);return _0x35c78f[_0x4d0a('0x53')](_0x4bb127);}})['then'](function(_0xdc2cab){if(_0xdc2cab){_0x751801=_0xdc2cab[_0x4d0a('0x36')];if(!_0x9f26bb[_0x4d0a('0x30')][_0x4d0a('0x37')](_0x4d0a('0x38'))){_0x4bb127[_0x4d0a('0x1e')]=qs[_0x4d0a('0x1e')](_0x9f26bb[_0x4d0a('0x30')]['limit']);_0x4bb127['offset']=qs[_0x4d0a('0x1d')](_0x9f26bb[_0x4d0a('0x30')][_0x4d0a('0x1d')]);}return _0x35c78f['getContacts'](_0x4bb127);}})['then'](function(_0x50df8a){if(_0x50df8a){return _0x50df8a?{'count':_0x751801,'rows':_0x50df8a}:null;}})[_0x4d0a('0x24')](respondWithResult(_0x5f4422,null))[_0x4d0a('0x44')](handleError(_0x5f4422,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 9b364f3..400aabc 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 _0xd13e=['bluebird','path','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','api'];(function(_0x4472df,_0x95132b){var _0xc260be=function(_0x27b6a3){while(--_0x27b6a3){_0x4472df['push'](_0x4472df['shift']());}};_0xc260be(++_0x95132b);}(_0xd13e,0x193));var _0xed13=function(_0x4e6c04,_0x1cf6ee){_0x4e6c04=_0x4e6c04-0x0;var _0x3c7f9a=_0xd13e[_0x4e6c04];return _0x3c7f9a;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var logger=require(_0xed13('0x2'))(_0xed13('0x3'));var moment=require('moment');var BPromise=require(_0xed13('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed13('0x5'));var rimraf=require('rimraf');var config=require(_0xed13('0x6'));var attributes=require(_0xed13('0x7'));module['exports']=function(_0x50de44,_0x5142bd){return _0x50de44[_0xed13('0x8')](_0xed13('0x9'),attributes,{'tableName':_0xed13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x097c=['bluebird','request-promise','path','../../config/environment','exports','define','cm_companies','lodash','util','../../config/logger','moment'];(function(_0x1b8e77,_0x5e1d9f){var _0xf0e877=function(_0x3ac64b){while(--_0x3ac64b){_0x1b8e77['push'](_0x1b8e77['shift']());}};_0xf0e877(++_0x5e1d9f);}(_0x097c,0x1d5));var _0xc097=function(_0x1d626e,_0x5de24c){_0x1d626e=_0x1d626e-0x0;var _0x4d6628=_0x097c[_0x1d626e];return _0x4d6628;};'use strict';var _=require(_0xc097('0x0'));var util=require(_0xc097('0x1'));var logger=require(_0xc097('0x2'))('api');var moment=require(_0xc097('0x3'));var BPromise=require(_0xc097('0x4'));var rp=require(_0xc097('0x5'));var fs=require('fs');var path=require(_0xc097('0x6'));var rimraf=require('rimraf');var config=require(_0xc097('0x7'));var attributes=require('./cmCompany.attributes');module[_0xc097('0x8')]=function(_0x3c9603,_0x31bc9a){return _0x3c9603[_0xc097('0x9')]('CmCompany',attributes,{'tableName':_0xc097('0xa'),'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 7308b4e..bf5bb48 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 _0x5166=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5166,0x147));var _0x6516=function(_0x858e,_0x8edfc3){_0x858e=_0x858e-0x0;var _0x3ca3c6=_0x5166[_0x858e];return _0x3ca3c6;};'use strict';var _=require(_0x6516('0x0'));var util=require(_0x6516('0x1'));var moment=require(_0x6516('0x2'));var BPromise=require(_0x6516('0x3'));var rs=require(_0x6516('0x4'));var fs=require('fs');var Redis=require(_0x6516('0x5'));var db=require(_0x6516('0x6'))['db'];var utils=require(_0x6516('0x7'));var logger=require(_0x6516('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6516('0x9')][_0x6516('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8db822,_0x12ab40,_0x555289){return new BPromise(function(_0x5dd887,_0x1c4363){return client[_0x6516('0xb')](_0x8db822,_0x555289)[_0x6516('0xc')](function(_0x175152){logger[_0x6516('0xd')](_0x6516('0xe'),_0x12ab40,_0x6516('0xf'));logger[_0x6516('0x10')](_0x6516('0x11'),_0x12ab40,_0x6516('0xf'),JSON[_0x6516('0x12')](_0x175152));if(_0x175152[_0x6516('0x13')]){if(_0x175152['error'][_0x6516('0x14')]===0x1f4){logger[_0x6516('0x13')](_0x6516('0xe'),_0x12ab40,_0x175152[_0x6516('0x13')]['message']);return _0x1c4363(_0x175152[_0x6516('0x13')][_0x6516('0x15')]);}logger[_0x6516('0x13')](_0x6516('0xe'),_0x12ab40,_0x175152['error'][_0x6516('0x15')]);return _0x5dd887(_0x175152[_0x6516('0x13')]['message']);}else{logger[_0x6516('0xd')](_0x6516('0xe'),_0x12ab40,'request\x20sent');_0x5dd887(_0x175152['result'][_0x6516('0x15')]);}})[_0x6516('0x16')](function(_0x250eb7){logger['error'](_0x6516('0xe'),_0x12ab40,_0x250eb7);_0x1c4363(_0x250eb7);});});} \ No newline at end of file +var _0x61cd=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','ioredis'];(function(_0x3da144,_0x578cbd){var _0x13fdc7=function(_0x2d2919){while(--_0x2d2919){_0x3da144['push'](_0x3da144['shift']());}};_0x13fdc7(++_0x578cbd);}(_0x61cd,0x11b));var _0xd61c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x61cd[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xd61c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd61c('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xd61c('0x2'));var logger=require(_0xd61c('0x3'))('rpc');var config=require(_0xd61c('0x4'));var jayson=require(_0xd61c('0x5'));var client=jayson[_0xd61c('0x6')][_0xd61c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a533c,_0x1dfaad,_0x13abfd){return new BPromise(function(_0x37674a,_0x59858b){return client['request'](_0x3a533c,_0x13abfd)[_0xd61c('0x8')](function(_0xd1184a){logger['info'](_0xd61c('0x9'),_0x1dfaad,_0xd61c('0xa'));logger[_0xd61c('0xb')](_0xd61c('0xc'),_0x1dfaad,_0xd61c('0xa'),JSON[_0xd61c('0xd')](_0xd1184a));if(_0xd1184a['error']){if(_0xd1184a[_0xd61c('0xe')][_0xd61c('0xf')]===0x1f4){logger[_0xd61c('0xe')](_0xd61c('0x9'),_0x1dfaad,_0xd1184a[_0xd61c('0xe')][_0xd61c('0x10')]);return _0x59858b(_0xd1184a[_0xd61c('0xe')][_0xd61c('0x10')]);}logger[_0xd61c('0xe')]('CmCompany,\x20%s,\x20%s',_0x1dfaad,_0xd1184a['error'][_0xd61c('0x10')]);return _0x37674a(_0xd1184a[_0xd61c('0xe')][_0xd61c('0x10')]);}else{logger[_0xd61c('0x11')](_0xd61c('0x9'),_0x1dfaad,'request\x20sent');_0x37674a(_0xd1184a[_0xd61c('0x12')][_0xd61c('0x10')]);}})['catch'](function(_0xabd2ce){logger[_0xd61c('0xe')](_0xd61c('0x9'),_0x1dfaad,_0xabd2ce);_0x59858b(_0xabd2ce);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index d65747a..3c1f7b5 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 _0xf8e1=['../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x36ce6c,_0x390f67){var _0x4fb0b6=function(_0x318846){while(--_0x318846){_0x36ce6c['push'](_0x36ce6c['shift']());}};_0x4fb0b6(++_0x390f67);}(_0xf8e1,0x13c));var _0x1f8e=function(_0x1b3205,_0x110e7b){_0x1b3205=_0x1b3205-0x0;var _0x3a96e3=_0xf8e1[_0x1b3205];return _0x3a96e3;};'use strict';var multer=require('multer');var util=require(_0x1f8e('0x0'));var path=require(_0x1f8e('0x1'));var timeout=require(_0x1f8e('0x2'));var express=require('express');var router=express[_0x1f8e('0x3')]();var fs_extra=require(_0x1f8e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1f8e('0x5'));var config=require(_0x1f8e('0x6'));var controller=require(_0x1f8e('0x7'));router[_0x1f8e('0x8')]('/',auth['isAuthenticated'](),controller[_0x1f8e('0x9')]);router[_0x1f8e('0x8')](_0x1f8e('0xa'),auth[_0x1f8e('0xb')](),controller[_0x1f8e('0xc')]);router[_0x1f8e('0x8')](_0x1f8e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x1f8e('0x8')](_0x1f8e('0xe'),auth[_0x1f8e('0xb')](),controller[_0x1f8e('0xf')]);router[_0x1f8e('0x10')]('/',auth[_0x1f8e('0xb')](),controller[_0x1f8e('0x11')]);router[_0x1f8e('0x10')](_0x1f8e('0xe'),auth[_0x1f8e('0xb')](),controller[_0x1f8e('0x12')]);router[_0x1f8e('0x13')](_0x1f8e('0xd'),auth[_0x1f8e('0xb')](),controller['update']);router[_0x1f8e('0x14')]('/:id',auth[_0x1f8e('0xb')](),controller[_0x1f8e('0x15')]);module[_0x1f8e('0x16')]=router; \ No newline at end of file +var _0x6a9e=['isAuthenticated','describe','/:id','/:id/contacts','post','create','addContacts','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe'];(function(_0x4d4ba0,_0x2b76fb){var _0x2af829=function(_0x4d2c3f){while(--_0x4d2c3f){_0x4d4ba0['push'](_0x4d4ba0['shift']());}};_0x2af829(++_0x2b76fb);}(_0x6a9e,0x6b));var _0xe6a9=function(_0x3d7b82,_0x3ea041){_0x3d7b82=_0x3d7b82-0x0;var _0x1e5a73=_0x6a9e[_0x3d7b82];return _0x1e5a73;};'use strict';var multer=require('multer');var util=require(_0xe6a9('0x0'));var path=require(_0xe6a9('0x1'));var timeout=require(_0xe6a9('0x2'));var express=require(_0xe6a9('0x3'));var router=express[_0xe6a9('0x4')]();var fs_extra=require(_0xe6a9('0x5'));var auth=require(_0xe6a9('0x6'));var interaction=require(_0xe6a9('0x7'));var config=require(_0xe6a9('0x8'));var controller=require(_0xe6a9('0x9'));router[_0xe6a9('0xa')]('/',auth['isAuthenticated'](),controller[_0xe6a9('0xb')]);router[_0xe6a9('0xa')](_0xe6a9('0xc'),auth[_0xe6a9('0xd')](),controller[_0xe6a9('0xe')]);router[_0xe6a9('0xa')](_0xe6a9('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xe6a9('0xa')](_0xe6a9('0x10'),auth['isAuthenticated'](),controller['getContacts']);router[_0xe6a9('0x11')]('/',auth[_0xe6a9('0xd')](),controller[_0xe6a9('0x12')]);router[_0xe6a9('0x11')](_0xe6a9('0x10'),auth[_0xe6a9('0xd')](),controller[_0xe6a9('0x13')]);router['put'](_0xe6a9('0xf'),auth[_0xe6a9('0xd')](),controller[_0xe6a9('0x14')]);router[_0xe6a9('0x15')](_0xe6a9('0xf'),auth[_0xe6a9('0xd')](),controller[_0xe6a9('0x16')]);module[_0xe6a9('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a20f201..00fd823 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 _0xb957=['TEXT','INTEGER','DATE','exports','STRING'];(function(_0x5252b4,_0x2e2e8b){var _0xb1fbf3=function(_0x32f37f){while(--_0x32f37f){_0x5252b4['push'](_0x5252b4['shift']());}};_0xb1fbf3(++_0x2e2e8b);}(_0xb957,0xe9));var _0x7b95=function(_0x1ff464,_0x22c96d){_0x1ff464=_0x1ff464-0x0;var _0x91bfef=_0xb957[_0x1ff464];return _0x91bfef;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x7b95('0x0')]={'firstName':{'type':Sequelize[_0x7b95('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7b95('0x1')]},'street':{'type':Sequelize[_0x7b95('0x1')]},'postalCode':{'type':Sequelize[_0x7b95('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x7b95('0x1')]},'description':{'type':Sequelize[_0x7b95('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x7b95('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x7b95('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x7b95('0x1')]},'twitter':{'type':Sequelize[_0x7b95('0x1')]},'skype':{'type':Sequelize[_0x7b95('0x1')]},'teams':{'type':Sequelize[_0x7b95('0x1')]},'viber':{'type':Sequelize[_0x7b95('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x7b95('0x1')]},'UserId':{'type':Sequelize[_0x7b95('0x3')]},'priority':{'type':Sequelize[_0x7b95('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7b95('0x4')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf121=['exports','STRING','INTEGER','UNSIGNED','DATE','NOW','sequelize'];(function(_0x30b083,_0x1154a3){var _0x5cdd47=function(_0x1df241){while(--_0x1df241){_0x30b083['push'](_0x30b083['shift']());}};_0x5cdd47(++_0x1154a3);}(_0xf121,0x76));var _0x1f12=function(_0x3a38ad,_0x3883e1){_0x3a38ad=_0x3a38ad-0x0;var _0x3265a5=_0xf121[_0x3a38ad];return _0x3265a5;};'use strict';var _=require('lodash');var Sequelize=require(_0x1f12('0x0'));module[_0x1f12('0x1')]={'firstName':{'type':Sequelize[_0x1f12('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1f12('0x2')]},'street':{'type':Sequelize[_0x1f12('0x2')]},'postalCode':{'type':Sequelize[_0x1f12('0x2')]},'city':{'type':Sequelize[_0x1f12('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1f12('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x1f12('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1f12('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x1f12('0x2')]},'fb_data':{'type':Sequelize[_0x1f12('0x2')]},'twitter':{'type':Sequelize[_0x1f12('0x2')]},'skype':{'type':Sequelize[_0x1f12('0x2')]},'teams':{'type':Sequelize[_0x1f12('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x1f12('0x2')]},'wechat':{'type':Sequelize[_0x1f12('0x2')]},'telegram':{'type':Sequelize[_0x1f12('0x2')]},'UserId':{'type':Sequelize[_0x1f12('0x3')]},'priority':{'type':Sequelize[_0x1f12('0x3')](0x2)[_0x1f12('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1f12('0x5')],'defaultValue':Sequelize[_0x1f12('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 0b45dae..0f0bc6b 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 _0x5669=['merge','c.firstName','c.lastName','c.phone','c.fax','c.email','c.ListId','c.deletedAt','TagIds','Tags','rows','catch','destroy','find','params','tags','findAll','columnName','displayName','alias','values','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','JscriptySessionReport','WhatsappMessage','create','bulkCreate','each','duplicates','$or','ListId','spread','show','omit','format','cf_%d','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','CmHopper','phone','getTags','nolimit','setTags','ids','ContactId','options','include','rawAttributes','includeAll','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','server/files/tmp','file','filename','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','path','parse','meta','import','binding','firstName','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','message','json','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','mail','chat','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','duration','createdAt','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Account','closed','closedAt','note','secondDisposition','thirdDisposition','key','customerPort','deviceModel','ratingMessage','ratingType','referer','subject','substatus','externalUrl','Owner','flatten','sortBy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','sendStatus','status','end','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','index','CmContact','describe','keys','length','startsWith','cf_','CmCustomField','findOne','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','select','field','color','from','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','search','sqlOperator','conditions','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','replace','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?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','isEmpty','sequelize','toString','keyBy'];(function(_0x20a07f,_0x12f151){var _0x1cbe78=function(_0x563eff){while(--_0x563eff){_0x20a07f['push'](_0x20a07f['shift']());}};_0x1cbe78(++_0x12f151);}(_0x5669,0x99));var _0x9566=function(_0x14e589,_0x5d5c97){_0x14e589=_0x14e589-0x0;var _0x4ceb8c=_0x5669[_0x14e589];return _0x4ceb8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9566('0x0'));var zipdir=require(_0x9566('0x1'));var jsonpatch=require(_0x9566('0x2'));var rp=require('request-promise');var moment=require(_0x9566('0x3'));var BPromise=require(_0x9566('0x4'));var Mustache=require(_0x9566('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9566('0x6'));var csv=require(_0x9566('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9566('0x8'));var _=require(_0x9566('0x9'));var squel=require('squel');var crypto=require(_0x9566('0xa'));var jsforce=require(_0x9566('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9566('0x7'));var querystring=require(_0x9566('0xc'));var Papa=require(_0x9566('0xd'));var Redis=require(_0x9566('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9566('0xf'));var as=require(_0x9566('0x10'));var hardwareService=require(_0x9566('0x11'));var logger=require(_0x9566('0x12'))(_0x9566('0x13'));var utils=require(_0x9566('0x14'));var config=require(_0x9566('0x15'));var licenseUtil=require(_0x9566('0x16'));var db=require(_0x9566('0x17'))['db'];config['redis']=_['defaults'](config[_0x9566('0x18')],{'host':_0x9566('0x19'),'port':0x18eb});var socket=require(_0x9566('0x1a'))(new Redis(config[_0x9566('0x18')]));require(_0x9566('0x1b'))['register'](socket);function respondWithStatusCode(_0x44c979,_0x5bf91e){_0x5bf91e=_0x5bf91e||0xcc;return function(_0x197cb7){if(_0x197cb7){return _0x44c979[_0x9566('0x1c')](_0x5bf91e);}return _0x44c979[_0x9566('0x1d')](_0x5bf91e)[_0x9566('0x1e')]();};}function respondWithResult(_0x1eb54c,_0x2968c9){_0x2968c9=_0x2968c9||0xc8;return function(_0x265c45){if(_0x265c45){return _0x1eb54c['status'](_0x2968c9)['json'](_0x265c45);}};}function respondWithFilteredResult(_0x1b0d78,_0x34a495){return function(_0x3dbdb6){if(_0x3dbdb6){var _0xa87115=_0x3dbdb6[_0x9566('0x1f')],_0x29961e=_0x34a495[_0x9566('0x20')],_0x59a0be=_0x34a495[_0x9566('0x20')]+_0x34a495[_0x9566('0x21')],_0x17a4c7;if(_0x59a0be>=_0xa87115){_0x59a0be=_0xa87115;_0x17a4c7=0xc8;}else{_0x17a4c7=0xce;}_0x1b0d78[_0x9566('0x1d')](_0x17a4c7);return _0x1b0d78[_0x9566('0x22')]('Content-Range',_0x29961e+'-'+_0x59a0be+'/'+_0xa87115)['json'](_0x3dbdb6);}return null;};}function patchUpdates(_0x1bbcfe){return function(_0x57796e){try{jsonpatch[_0x9566('0x23')](_0x57796e,_0x1bbcfe,!![]);}catch(_0x2ce1ab){return BPromise[_0x9566('0x24')](_0x2ce1ab);}return _0x57796e[_0x9566('0x25')]();};}function saveUpdates(_0x26e173,_0x29bfb5){return function(_0x49e579){if(_0x49e579){return _0x49e579[_0x9566('0x26')](_0x26e173)[_0x9566('0x27')](function(_0x500e26){return _0x500e26;});}return null;};}function removeEntity(_0xa16c70,_0x5a3504){return function(_0x4dc7eb){if(_0x4dc7eb){return _0x4dc7eb['destroy']()['then'](function(){_0xa16c70['status'](0xcc)[_0x9566('0x1e')]();});}};}function handleEntityNotFound(_0x2c12dd,_0x4fb655){return function(_0x35b2af){if(!_0x35b2af){_0x2c12dd[_0x9566('0x1c')](0x194);}return _0x35b2af;};}function handleError(_0x201e4e,_0x5b0edc){_0x5b0edc=_0x5b0edc||0x1f4;return function(_0x4721dd){logger[_0x9566('0x28')](_0x4721dd[_0x9566('0x29')]);if(_0x4721dd['name']){delete _0x4721dd[_0x9566('0x2a')];}_0x201e4e['status'](_0x5b0edc)['send'](_0x4721dd);};}exports[_0x9566('0x2b')]=function(_0x247bcf,_0x58ae94){var _0x5a8e61={},_0x29244e={},_0x26029b={'count':0x0,'rows':[]};return db[_0x9566('0x2c')][_0x9566('0x2d')]()[_0x9566('0x27')](function(_0x31c207){var _0x4508e9=[];for(var _0x32b7dd=0x0;_0x32b7dd0x1){_0x5acddc['or'](_0x9566('0x6a'),qs[_0x9566('0x6b')](_0x43b08d),null);}else{if(qs['isNumeric'](_0x43b08d)){_0x5acddc['or'](_0x9566('0x6c'),_0x43b08d+'%');_0x5acddc['or'](_0x9566('0x6d'),_0x43b08d+'%');_0x5acddc['or'](_0x9566('0x6e'),_0x43b08d+'%');_0x5acddc['or'](_0x9566('0x6f'),_0x43b08d+'%');}else if(qs[_0x9566('0x70')](_0x43b08d)){_0x5acddc['or'](_0x9566('0x71'),_0x43b08d+'%');}else{_0x5acddc['or'](_0x9566('0x72'),'%'+_0x43b08d+'%');_0x5acddc['or'](_0x9566('0x73'),'%'+_0x43b08d+'%');_0x5acddc['or'](_0x9566('0x71'),'%'+_0x43b08d+'%');}}}}_0x24f73a[_0x9566('0x4c')](_0x5acddc);_0x24f73a[_0x9566('0x74')](_0x9566('0x75'));var _0x5b7d20={'type':db[_0x9566('0x76')][_0x9566('0x77')]['SELECT'],'raw':!![]};var _0x31d5c2=_0x24f73a['clone']()[_0x9566('0x42')]('c.id');if(_0x5a8e61['order']){_0x5a8e61['order'][_0x9566('0x55')](function(_0xad39f2){_0x24f73a[_0x9566('0x3e')]('c.'+_0xad39f2[0x0],_0xad39f2[0x1]===_0x9566('0x78')?![]:!![]);});}if(!_['isEmpty'](_0x4874d7)){_0x24f73a[_0x9566('0x79')](_0x4fc1fa);_0x31d5c2['where'](_0x9566('0x7a'),_0x4874d7);}BPromise[_0x9566('0x7b')]()[_0x9566('0x27')](function(){if(!_0x39d9bc)return;if(_0x247bcf[_0x9566('0x7c')][_0x9566('0x7d')]!==_0x9566('0x7e'))return;if(!_[_0x9566('0x7f')](_0x39d9bc[_0x9566('0x50')],[_0x9566('0x42'),_0x9566('0x58')])){return _0x247bcf['user']['getLists']({'attributes':['id'],'raw':!![]})[_0x9566('0x27')](function(_0x5b9856){if(_[_0x9566('0x80')](_0x5b9856)){_0x31d5c2[_0x9566('0x4c')]('c.ListId\x20IS\x20NULL');_0x24f73a[_0x9566('0x4c')]('c.ListId\x20IS\x20NULL');}else{_0x31d5c2['where'](_0x9566('0x64'),_[_0x9566('0x54')](_0x5b9856,'id'));_0x24f73a[_0x9566('0x4c')](_0x9566('0x64'),_[_0x9566('0x54')](_0x5b9856,'id'));}});}})[_0x9566('0x27')](function(){if(_0x247bcf['user'][_0x9566('0x7d')]===_0x9566('0x7e')&&!_0x39d9bc&&!_0x247bcf[_0x9566('0x38')]['ListId'])return[];return db[_0x9566('0x81')]['query'](_0x31d5c2[_0x9566('0x82')](),_0x5b7d20);})[_0x9566('0x27')](function(_0x1f20b8){_0x26029b[_0x9566('0x1f')]=_0x1f20b8['length'];if(_0x26029b[_0x9566('0x1f')]===0x0)return[];return db[_0x9566('0x81')][_0x9566('0x38')](_0x5b8b0c[_0x9566('0x82')](),_0x5b7d20)[_0x9566('0x27')](function(_0xd98978){_0x3ee3a5=_[_0x9566('0x83')](_0xd98978,'id');_0x5b7d20=_[_0x9566('0x84')](_0x5b7d20,{'model':db[_0x9566('0x2c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x247bcf[_0x9566('0x38')][_0x9566('0x3c')]){_0x5a8e61[_0x9566('0x3b')][_0x9566('0x55')](function(_0x5a5441){_0x24f73a[_0x9566('0x42')]('c.'+_0x5a5441);});}else{_0x24f73a['field'](_0x9566('0x75'));_0x24f73a['field'](_0x9566('0x85'));_0x24f73a[_0x9566('0x42')](_0x9566('0x86'));_0x24f73a[_0x9566('0x42')](_0x9566('0x87'));_0x24f73a[_0x9566('0x42')]('c.mobile');_0x24f73a['field'](_0x9566('0x88'));_0x24f73a[_0x9566('0x42')](_0x9566('0x89'));_0x24f73a[_0x9566('0x42')](_0x9566('0x8a'));_0x24f73a[_0x9566('0x42')]('c.createdAt');_0x24f73a['field'](_0x9566('0x8b'));_0x24f73a[_0x9566('0x42')]('c.CompanyId');_0x24f73a['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9566('0x8c'));}if(_0x5a8e61['limit'])_0x24f73a[_0x9566('0x21')](_0x5a8e61['limit']);if(_0x5a8e61[_0x9566('0x20')])_0x24f73a[_0x9566('0x20')](_0x5a8e61[_0x9566('0x20')]);return db[_0x9566('0x81')][_0x9566('0x38')](_0x24f73a[_0x9566('0x82')](),_0x5b7d20);});})[_0x9566('0x27')](function(_0x104674){_0x104674[_0x9566('0x55')](function(_0x877937){if(_0x877937[_0x9566('0x8c')]){_0x877937[_0x9566('0x8d')]=[];_0x877937[_0x9566('0x8c')][_0x9566('0x53')](',')['forEach'](function(_0x2984b4){_0x877937[_0x9566('0x8d')][_0x9566('0x63')](_0x3ee3a5[_0x2984b4]);});}delete _0x877937[_0x9566('0x8c')];});_0x26029b[_0x9566('0x8e')]=_0x104674;return _0x26029b;})['then'](respondWithFilteredResult(_0x58ae94,_0x5a8e61));})[_0x9566('0x8f')](handleError(_0x58ae94,null));};exports[_0x9566('0x90')]=function(_0x2d76f9,_0x222ccc){return db[_0x9566('0x2c')][_0x9566('0x91')]({'where':{'id':_0x2d76f9[_0x9566('0x92')]['id']}})[_0x9566('0x27')](handleEntityNotFound(_0x222ccc,null))[_0x9566('0x27')](removeEntity(_0x222ccc,null))[_0x9566('0x8f')](handleError(_0x222ccc,null));};exports['describe']=function(_0xbab66c,_0x33a0fe){return db[_0x9566('0x2c')]['describe']()[_0x9566('0x27')](function(_0x49a189){delete _0x49a189[_0x9566('0x93')];for(var _0x46233b=0x0;_0x46233b=_0x3c4284){_0x39e952=_0x3c4284;_0x320acb=0xc8;}else{_0x320acb=0xce;}_0x2319be[_0xcc74('0x24')](_0x320acb);return _0x2319be[_0xcc74('0x28')]('Content-Range',_0x3196f0+'-'+_0x39e952+'/'+_0x3c4284)[_0xcc74('0x29')](_0x425758);}return null;};}function patchUpdates(_0x47f841){return function(_0x1405d1){try{jsonpatch[_0xcc74('0x2a')](_0x1405d1,_0x47f841,!![]);}catch(_0x40f968){return BPromise['reject'](_0x40f968);}return _0x1405d1['save']();};}function saveUpdates(_0x382e4f,_0xe62176){return function(_0x19a7d8){if(_0x19a7d8){return _0x19a7d8[_0xcc74('0x2b')](_0x382e4f)['then'](function(_0x3e88e3){return _0x3e88e3;});}return null;};}function removeEntity(_0x4d1c9e,_0x34964f){return function(_0x1e0a97){if(_0x1e0a97){return _0x1e0a97[_0xcc74('0x2c')]()[_0xcc74('0x2d')](function(){_0x4d1c9e[_0xcc74('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12ab65,_0x4c46e3){return function(_0x5ec0e6){if(!_0x5ec0e6){_0x12ab65['sendStatus'](0x194);}return _0x5ec0e6;};}function handleError(_0x28271e,_0x4f3e1d){_0x4f3e1d=_0x4f3e1d||0x1f4;return function(_0x3ae044){logger['error'](_0x3ae044[_0xcc74('0x2e')]);if(_0x3ae044[_0xcc74('0x2f')]){delete _0x3ae044[_0xcc74('0x2f')];}_0x28271e[_0xcc74('0x24')](_0x4f3e1d)[_0xcc74('0x30')](_0x3ae044);};}exports['index']=function(_0x16723b,_0x5c2b3b){var _0x5bcaa4={},_0x369d7c={},_0x3a952b={'count':0x0,'rows':[]};return db['CmContact'][_0xcc74('0x31')]()[_0xcc74('0x2d')](function(_0x1bc67f){var _0x50a51a=[];for(var _0x5022bf=0x0;_0x5022bf0x1){_0x38e3ef['or'](_0xcc74('0x69'),qs['getFullTextValue'](_0x17e692),null);}else{if(qs[_0xcc74('0x6a')](_0x17e692)){_0x38e3ef['or'](_0xcc74('0x6b'),_0x17e692+'%');_0x38e3ef['or'](_0xcc74('0x6c'),_0x17e692+'%');_0x38e3ef['or'](_0xcc74('0x6d'),_0x17e692+'%');_0x38e3ef['or'](_0xcc74('0x6e'),_0x17e692+'%');}else if(qs[_0xcc74('0x6f')](_0x17e692)){_0x38e3ef['or'](_0xcc74('0x70'),_0x17e692+'%');}else{_0x38e3ef['or'](_0xcc74('0x71'),'%'+_0x17e692+'%');_0x38e3ef['or'](_0xcc74('0x72'),'%'+_0x17e692+'%');_0x38e3ef['or'](_0xcc74('0x70'),'%'+_0x17e692+'%');}}}}_0x2e7039[_0xcc74('0x44')](_0x38e3ef);_0x2e7039['group'](_0xcc74('0x73'));var _0x622b90={'type':db[_0xcc74('0x74')][_0xcc74('0x75')][_0xcc74('0x76')],'raw':!![]};var _0x854275=_0x2e7039[_0xcc74('0x77')]()[_0xcc74('0x46')](_0xcc74('0x73'));if(_0x5bcaa4[_0xcc74('0x43')]){_0x5bcaa4['order'][_0xcc74('0x59')](function(_0x1b3e54){_0x2e7039['order']('c.'+_0x1b3e54[0x0],_0x1b3e54[0x1]===_0xcc74('0x78')?![]:!![]);});}if(!_['isEmpty'](_0x17b48c)){_0x2e7039[_0xcc74('0x79')](_0x46b18e);_0x854275[_0xcc74('0x44')](_0xcc74('0x7a'),_0x17b48c);}BPromise[_0xcc74('0x7b')]()[_0xcc74('0x2d')](function(){if(!_0x10a9ee)return;if(_0x16723b[_0xcc74('0x7c')]['role']!==_0xcc74('0x7d'))return;if(!_[_0xcc74('0x7e')](_0x10a9ee[_0xcc74('0x54')],['field',_0xcc74('0x7f')])){return _0x16723b['user'][_0xcc74('0x80')]({'attributes':['id'],'raw':!![]})[_0xcc74('0x2d')](function(_0x4a576b){if(_[_0xcc74('0x61')](_0x4a576b)){_0x854275[_0xcc74('0x44')]('c.ListId\x20IS\x20NULL');_0x2e7039[_0xcc74('0x44')](_0xcc74('0x81'));}else{_0x854275[_0xcc74('0x44')](_0xcc74('0x62'),_[_0xcc74('0x58')](_0x4a576b,'id'));_0x2e7039[_0xcc74('0x44')](_0xcc74('0x62'),_['map'](_0x4a576b,'id'));}});}})['then'](function(){if(_0x16723b[_0xcc74('0x7c')][_0xcc74('0x82')]===_0xcc74('0x7d')&&!_0x10a9ee&&!_0x16723b['query'][_0xcc74('0x83')])return[];return db[_0xcc74('0x84')]['query'](_0x854275['toString'](),_0x622b90);})[_0xcc74('0x2d')](function(_0x544513){_0x3a952b['count']=_0x544513[_0xcc74('0x33')];if(_0x3a952b['count']===0x0)return[];return db[_0xcc74('0x84')][_0xcc74('0x3b')](_0x46bf12['toString'](),_0x622b90)['then'](function(_0x434be5){_0x4451ed=_['keyBy'](_0x434be5,'id');_0x622b90=_[_0xcc74('0x85')](_0x622b90,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x16723b[_0xcc74('0x3b')][_0xcc74('0x3f')]){_0x5bcaa4['attributes'][_0xcc74('0x59')](function(_0x57c8c6){_0x2e7039[_0xcc74('0x46')]('c.'+_0x57c8c6);});}else{_0x2e7039[_0xcc74('0x46')](_0xcc74('0x73'));_0x2e7039[_0xcc74('0x46')](_0xcc74('0x86'));_0x2e7039['field']('c.lastName');_0x2e7039['field'](_0xcc74('0x87'));_0x2e7039[_0xcc74('0x46')](_0xcc74('0x88'));_0x2e7039[_0xcc74('0x46')](_0xcc74('0x89'));_0x2e7039['field'](_0xcc74('0x8a'));_0x2e7039['field']('c.ListId');_0x2e7039[_0xcc74('0x46')]('c.createdAt');_0x2e7039[_0xcc74('0x46')](_0xcc74('0x8b'));_0x2e7039[_0xcc74('0x46')](_0xcc74('0x8c'));_0x2e7039[_0xcc74('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x5bcaa4[_0xcc74('0x27')])_0x2e7039[_0xcc74('0x27')](_0x5bcaa4['limit']);if(_0x5bcaa4['offset'])_0x2e7039[_0xcc74('0x26')](_0x5bcaa4[_0xcc74('0x26')]);return db[_0xcc74('0x84')][_0xcc74('0x3b')](_0x2e7039[_0xcc74('0x8d')](),_0x622b90);});})['then'](function(_0x33b3b0){_0x33b3b0[_0xcc74('0x59')](function(_0x42eff2){if(_0x42eff2['TagIds']){_0x42eff2[_0xcc74('0x8e')]=[];_0x42eff2[_0xcc74('0x8f')][_0xcc74('0x68')](',')[_0xcc74('0x59')](function(_0x127596){_0x42eff2[_0xcc74('0x8e')]['push'](_0x4451ed[_0x127596]);});}delete _0x42eff2['TagIds'];});_0x3a952b[_0xcc74('0x90')]=_0x33b3b0;return _0x3a952b;})[_0xcc74('0x2d')](respondWithFilteredResult(_0x5c2b3b,_0x5bcaa4));})[_0xcc74('0x91')](handleError(_0x5c2b3b,null));};exports[_0xcc74('0x2c')]=function(_0x161cb4,_0x42dde1){return db[_0xcc74('0x92')]['find']({'where':{'id':_0x161cb4[_0xcc74('0x93')]['id']}})[_0xcc74('0x2d')](handleEntityNotFound(_0x42dde1,null))[_0xcc74('0x2d')](removeEntity(_0x42dde1,null))[_0xcc74('0x91')](handleError(_0x42dde1,null));};exports[_0xcc74('0x31')]=function(_0x241a0f,_0x1ab2d0){return db[_0xcc74('0x92')][_0xcc74('0x31')]()[_0xcc74('0x2d')](function(_0x2a7f9e){delete _0x2a7f9e['tags'];for(var _0x3b6877=0x0;_0x3b6877{}\s\\|]/g,'-');_0x4010cb(null,util[_0xe679('0x22')](_0xe679('0x23'),path[_0xe679('0x24')](_0x567f41[_0xe679('0x20')],path[_0xe679('0x25')](_0x567f41['originalname'])),Date[_0xe679('0x26')](),path['extname'](_0x567f41[_0xe679('0x20')])));}})});router[_0xe679('0x16')](_0xe679('0x27'),upload[_0xe679('0x28')](_0xe679('0x29')),controller[_0xe679('0x2a')]);var upload=multer({'storage':multer[_0xe679('0x1c')]({'destination':function(_0x1e0015,_0x9c5130,_0x1227d5){_0x1227d5(null,path[_0xe679('0x1d')](config['root'],_0xe679('0x1f')));},'filename':function(_0x50ca68,_0x3606bf,_0x4852e1){_0x3606bf[_0xe679('0x20')]=_0x3606bf[_0xe679('0x20')][_0xe679('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4852e1(null,util[_0xe679('0x22')](_0xe679('0x23'),path[_0xe679('0x24')](_0x3606bf['originalname'],path[_0xe679('0x25')](_0x3606bf[_0xe679('0x20')])),Date['now'](),path[_0xe679('0x25')](_0x3606bf[_0xe679('0x20')])));}})});router[_0xe679('0x16')]('/upload',upload[_0xe679('0x28')](_0xe679('0x29')),controller[_0xe679('0x2b')]);router['post'](_0xe679('0x2c'),auth[_0xe679('0xb')](),controller[_0xe679('0x2d')]);router[_0xe679('0x2e')](_0xe679('0x2f'),auth[_0xe679('0xb')](),controller['update']);router[_0xe679('0x30')](_0xe679('0x2f'),auth[_0xe679('0xb')](),controller[_0xe679('0x31')]);module['exports']=router; \ No newline at end of file +var _0x3069=['./cmContact.controller','index','get','/describe','isAuthenticated','show','/:id/tags','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','/merge','merge','post','/create_many','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','single','file','uploadCsv','/upload/:id','import','/:id','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5e2809,_0x302fa7){var _0xcf84b3=function(_0x26fbb3){while(--_0x26fbb3){_0x5e2809['push'](_0x5e2809['shift']());}};_0xcf84b3(++_0x302fa7);}(_0x3069,0x1b1));var _0x9306=function(_0x5b5fe2,_0x4f4c5c){_0x5b5fe2=_0x5b5fe2-0x0;var _0x526749=_0x3069[_0x5b5fe2];return _0x526749;};'use strict';var multer=require(_0x9306('0x0'));var util=require('util');var path=require(_0x9306('0x1'));var timeout=require(_0x9306('0x2'));var express=require(_0x9306('0x3'));var router=express[_0x9306('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9306('0x5'));var interaction=require(_0x9306('0x6'));var config=require('../../config/environment');var controller=require(_0x9306('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9306('0x8')]);router[_0x9306('0x9')](_0x9306('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x9306('0xb')](),controller[_0x9306('0xc')]);router[_0x9306('0x9')](_0x9306('0xd'),auth[_0x9306('0xb')](),controller['getTags']);router[_0x9306('0x9')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x9306('0xe')]);router[_0x9306('0x9')]('/:id/hopper_histories',auth[_0x9306('0xb')](),controller[_0x9306('0xf')]);router[_0x9306('0x9')](_0x9306('0x10'),auth['isAuthenticated'](),controller[_0x9306('0x11')]);router[_0x9306('0x9')](_0x9306('0x12'),auth[_0x9306('0xb')](),controller[_0x9306('0x13')]);router['get'](_0x9306('0x14'),auth[_0x9306('0xb')](),controller[_0x9306('0x15')]);router['post'](_0x9306('0x16'),auth[_0x9306('0xb')](),controller[_0x9306('0x17')]);router[_0x9306('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9306('0x18')](_0x9306('0x19'),auth['isAuthenticated'](),controller['bulkCreate']);router['post'](_0x9306('0xd'),auth[_0x9306('0xb')](),controller[_0x9306('0x1a')]);var upload=multer({'storage':multer[_0x9306('0x1b')]({'destination':function(_0x3a5137,_0x9024ff,_0x46af03){_0x46af03(null,path[_0x9306('0x1c')](config[_0x9306('0x1d')],_0x9306('0x1e')));},'filename':function(_0xa1af6c,_0x49891e,_0x2d19c8){_0x49891e[_0x9306('0x1f')]=_0x49891e[_0x9306('0x1f')][_0x9306('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d19c8(null,util[_0x9306('0x21')](_0x9306('0x22'),path[_0x9306('0x23')](_0x49891e[_0x9306('0x1f')],path[_0x9306('0x24')](_0x49891e[_0x9306('0x1f')])),Date['now'](),path[_0x9306('0x24')](_0x49891e[_0x9306('0x1f')])));}})});router['post']('/csv',upload[_0x9306('0x25')](_0x9306('0x26')),controller[_0x9306('0x27')]);var upload=multer({'storage':multer[_0x9306('0x1b')]({'destination':function(_0x56d931,_0x2db62f,_0x2f5e72){_0x2f5e72(null,path['join'](config[_0x9306('0x1d')],_0x9306('0x1e')));},'filename':function(_0x368384,_0x52439c,_0x9ab5af){_0x52439c[_0x9306('0x1f')]=_0x52439c['originalname'][_0x9306('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9ab5af(null,util[_0x9306('0x21')](_0x9306('0x22'),path[_0x9306('0x23')](_0x52439c[_0x9306('0x1f')],path[_0x9306('0x24')](_0x52439c[_0x9306('0x1f')])),Date['now'](),path[_0x9306('0x24')](_0x52439c['originalname'])));}})});router[_0x9306('0x18')]('/upload',upload[_0x9306('0x25')]('file'),controller['upload']);router['post'](_0x9306('0x28'),auth[_0x9306('0xb')](),controller[_0x9306('0x29')]);router['put'](_0x9306('0x2a'),auth[_0x9306('0xb')](),controller['update']);router['delete']('/:id',auth[_0x9306('0xb')](),controller[_0x9306('0x2b')]);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 5db8451..d7f3440 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 _0x3eea=['exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','type','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize'];(function(_0x40ca11,_0x28a4be){var _0x1e1544=function(_0x3e1985){while(--_0x3e1985){_0x40ca11['push'](_0x40ca11['shift']());}};_0x1e1544(++_0x28a4be);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x13e915,_0x1731a4){_0x13e915=_0x13e915-0x0;var _0x5cd3de=_0x3eea[_0x13e915];return _0x5cd3de;};'use strict';var Sequelize=require(_0xa3ee('0x0'));var _=require('lodash');module[_0xa3ee('0x1')]={'name':{'type':Sequelize[_0xa3ee('0x2')],'get':function(_0x16512c){return this[_0xa3ee('0x3')](_0xa3ee('0x4'));}},'alias':{'type':Sequelize[_0xa3ee('0x5')],'allowNull':![],'set':function(_0x104913){this[_0xa3ee('0x6')](_0xa3ee('0x4'),_0x104913?_0x104913:this[_0xa3ee('0x3')](_0xa3ee('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xa3ee('0x8')),'get':function(){if(this['getDataValue'](_0xa3ee('0x9'))==='select'){return JSON[_0xa3ee('0xa')](this['getDataValue'](_0xa3ee('0xb')));}else{return this['getDataValue'](_0xa3ee('0xb'));}},'set':function(_0x1a3ab0){if(Array[_0xa3ee('0xc')](_0x1a3ab0)){this['setDataValue'](_0xa3ee('0xb'),JSON[_0xa3ee('0xd')](_0x1a3ab0));}else{this['setDataValue']('values',_0x1a3ab0);}}},'required':{'type':Sequelize[_0xa3ee('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xa3ee('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xa3ee('0xf')](_0xa3ee('0x10'))}}; \ No newline at end of file +var _0xad36=['exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','parse','values','isArray','BOOLEAN','ENUM','voice','lodash'];(function(_0x4154bf,_0x35a765){var _0x4a909e=function(_0x2381e1){while(--_0x2381e1){_0x4154bf['push'](_0x4154bf['shift']());}};_0x4a909e(++_0x35a765);}(_0xad36,0x11c));var _0x6ad3=function(_0x3ad15c,_0x280785){_0x3ad15c=_0x3ad15c-0x0;var _0x42a8d=_0xad36[_0x3ad15c];return _0x42a8d;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6ad3('0x0'));module[_0x6ad3('0x1')]={'name':{'type':Sequelize[_0x6ad3('0x2')],'get':function(_0x1164e0){return this[_0x6ad3('0x3')](_0x6ad3('0x4'));}},'alias':{'type':Sequelize[_0x6ad3('0x5')],'allowNull':![],'set':function(_0x17a9b2){this[_0x6ad3('0x6')]('alias',_0x17a9b2?_0x17a9b2:this[_0x6ad3('0x3')](_0x6ad3('0x7')));}},'type':{'type':Sequelize[_0x6ad3('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x6ad3('0x8')]('long'),'get':function(){if(this['getDataValue']('type')==='select'){return JSON[_0x6ad3('0x9')](this[_0x6ad3('0x3')](_0x6ad3('0xa')));}else{return this[_0x6ad3('0x3')](_0x6ad3('0xa'));}},'set':function(_0xb64f36){if(Array[_0x6ad3('0xb')](_0xb64f36)){this[_0x6ad3('0x6')](_0x6ad3('0xa'),JSON['stringify'](_0xb64f36));}else{this[_0x6ad3('0x6')](_0x6ad3('0xa'),_0xb64f36);}}},'required':{'type':Sequelize[_0x6ad3('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x6ad3('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x6ad3('0xd')](_0x6ad3('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index c1eea1e..af2b6e1 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 _0x4068=['length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','catch','params','find','body','create','sequelize','transaction','Sequelize','TEXT','text','switch','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','request-promise','bluebird','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','then','error','stack','name','send','CmCustomField','rawAttributes','fieldName','type','differenceBy','map','query','keys','filters','intersection','model','attributes','fields'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0x4068,0x19a));var _0x8406=function(_0x1a7847,_0x2c248d){_0x1a7847=_0x1a7847-0x0;var _0x41ae2e=_0x4068[_0x1a7847];return _0x41ae2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8406('0x0'));var zipdir=require(_0x8406('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8406('0x2'));var moment=require('moment');var BPromise=require(_0x8406('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8406('0x4'));var csv=require(_0x8406('0x5'));var ejs=require(_0x8406('0x6'));var fs=require('fs');var fs_extra=require(_0x8406('0x7'));var _=require('lodash');var squel=require(_0x8406('0x8'));var crypto=require(_0x8406('0x9'));var jsforce=require(_0x8406('0xa'));var deskjs=require(_0x8406('0xb'));var toCsv=require(_0x8406('0x5'));var querystring=require(_0x8406('0xc'));var Papa=require(_0x8406('0xd'));var Redis=require(_0x8406('0xe'));var authService=require(_0x8406('0xf'));var qs=require(_0x8406('0x10'));var as=require(_0x8406('0x11'));var hardwareService=require(_0x8406('0x12'));var logger=require(_0x8406('0x13'))('api');var utils=require(_0x8406('0x14'));var config=require(_0x8406('0x15'));var licenseUtil=require(_0x8406('0x16'));var db=require(_0x8406('0x17'))['db'];function respondWithStatusCode(_0x494348,_0x577178){_0x577178=_0x577178||0xcc;return function(_0x384153){if(_0x384153){return _0x494348[_0x8406('0x18')](_0x577178);}return _0x494348[_0x8406('0x19')](_0x577178)['end']();};}function respondWithResult(_0x6b2bee,_0x5b83aa){_0x5b83aa=_0x5b83aa||0xc8;return function(_0xce1eca){if(_0xce1eca){return _0x6b2bee[_0x8406('0x19')](_0x5b83aa)[_0x8406('0x1a')](_0xce1eca);}};}function respondWithFilteredResult(_0x1b96f3,_0x3ffec0){return function(_0x46f480){if(_0x46f480){var _0x46efab=_0x46f480[_0x8406('0x1b')],_0x1bfd0a=_0x3ffec0['offset'],_0x3f1a53=_0x3ffec0[_0x8406('0x1c')]+_0x3ffec0[_0x8406('0x1d')],_0x2dcf66;if(_0x3f1a53>=_0x46efab){_0x3f1a53=_0x46efab;_0x2dcf66=0xc8;}else{_0x2dcf66=0xce;}_0x1b96f3[_0x8406('0x19')](_0x2dcf66);return _0x1b96f3[_0x8406('0x1e')](_0x8406('0x1f'),_0x1bfd0a+'-'+_0x3f1a53+'/'+_0x46efab)[_0x8406('0x1a')](_0x46f480);}return null;};}function patchUpdates(_0x5e99a7){return function(_0x56fd67){try{jsonpatch[_0x8406('0x20')](_0x56fd67,_0x5e99a7,!![]);}catch(_0x2cce3d){return BPromise[_0x8406('0x21')](_0x2cce3d);}return _0x56fd67['save']();};}function saveUpdates(_0x568606,_0x14aa84){return function(_0xb36b8e){if(_0xb36b8e){return _0xb36b8e['update'](_0x568606)[_0x8406('0x22')](function(_0x245999){return _0x245999;});}return null;};}function removeEntity(_0x40a000,_0xdd521c){return function(_0x453cc4){if(_0x453cc4){return _0x453cc4['destroy']()[_0x8406('0x22')](function(){_0x40a000[_0x8406('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3906af,_0x37385c){return function(_0x359538){if(!_0x359538){_0x3906af[_0x8406('0x18')](0x194);}return _0x359538;};}function handleError(_0x5dfe60,_0x38e851){_0x38e851=_0x38e851||0x1f4;return function(_0x5b3566){logger[_0x8406('0x23')](_0x5b3566[_0x8406('0x24')]);if(_0x5b3566[_0x8406('0x25')]){delete _0x5b3566[_0x8406('0x25')];}_0x5dfe60[_0x8406('0x19')](_0x38e851)[_0x8406('0x26')](_0x5b3566);};}exports['index']=function(_0x265d40,_0x2f19af){var _0x19205c={},_0x48b5b7={},_0x476e32={'count':0x0,'rows':[]};var _0x405ef9=_['map'](db[_0x8406('0x27')][_0x8406('0x28')],function(_0x4e8e1c){return{'name':_0x4e8e1c[_0x8406('0x29')],'type':_0x4e8e1c[_0x8406('0x2a')]['key']};});_0x48b5b7['model']=_[_0x8406('0x2b')](_[_0x8406('0x2c')](_0x405ef9,_0x8406('0x25')),['name']);_0x48b5b7[_0x8406('0x2d')]=_[_0x8406('0x2e')](_0x265d40[_0x8406('0x2d')]);_0x48b5b7[_0x8406('0x2f')]=_[_0x8406('0x30')](_0x48b5b7[_0x8406('0x31')],_0x48b5b7[_0x8406('0x2d')]);_0x19205c[_0x8406('0x32')]=_[_0x8406('0x30')](_0x48b5b7[_0x8406('0x31')],qs['fields'](_0x265d40[_0x8406('0x2d')][_0x8406('0x33')]));_0x19205c[_0x8406('0x32')]=_0x19205c[_0x8406('0x32')][_0x8406('0x34')]?_0x19205c[_0x8406('0x32')]:_0x48b5b7[_0x8406('0x31')];if(!_0x265d40[_0x8406('0x2d')][_0x8406('0x35')](_0x8406('0x36'))){_0x19205c[_0x8406('0x1d')]=qs['limit'](_0x265d40['query'][_0x8406('0x1d')]);_0x19205c[_0x8406('0x1c')]=qs['offset'](_0x265d40['query'][_0x8406('0x1c')]);}_0x19205c['order']=qs[_0x8406('0x37')](_0x265d40['query']['sort']);_0x19205c[_0x8406('0x38')]=qs[_0x8406('0x2f')](_[_0x8406('0x39')](_0x265d40[_0x8406('0x2d')],_0x48b5b7[_0x8406('0x2f')]),_0x405ef9);if(_0x265d40[_0x8406('0x2d')][_0x8406('0x3a')]){_0x19205c[_0x8406('0x38')]=_[_0x8406('0x3b')](_0x19205c[_0x8406('0x38')],{'$or':_[_0x8406('0x2c')](_0x405ef9,function(_0x1d3c3c){if(_0x1d3c3c[_0x8406('0x2a')]!=='VIRTUAL'){var _0x2f4ae1={};_0x2f4ae1[_0x1d3c3c[_0x8406('0x25')]]={'$like':'%'+_0x265d40[_0x8406('0x2d')]['filter']+'%'};return _0x2f4ae1;}})});}_0x19205c=_['merge']({},_0x19205c,_0x265d40['options']);var _0x4fef90={'where':_0x19205c[_0x8406('0x38')]};return db['CmCustomField']['count'](_0x4fef90)[_0x8406('0x22')](function(_0x3dc8c2){_0x476e32['count']=_0x3dc8c2;if(_0x265d40[_0x8406('0x2d')][_0x8406('0x3c')]){_0x19205c['include']=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x19205c);})[_0x8406('0x22')](function(_0x437183){_0x476e32['rows']=_0x437183;return _0x476e32;})[_0x8406('0x22')](respondWithFilteredResult(_0x2f19af,_0x19205c))[_0x8406('0x3d')](handleError(_0x2f19af,null));};exports['show']=function(_0x1a9f99,_0xd2ec8a){var _0x800795={'raw':!![],'where':{'id':_0x1a9f99[_0x8406('0x3e')]['id']}},_0x2b1388={};_0x2b1388['model']=_[_0x8406('0x2e')](db[_0x8406('0x27')]['rawAttributes']);_0x2b1388[_0x8406('0x2d')]=_[_0x8406('0x2e')](_0x1a9f99[_0x8406('0x2d')]);_0x2b1388['filters']=_['intersection'](_0x2b1388[_0x8406('0x31')],_0x2b1388['query']);_0x800795[_0x8406('0x32')]=_['intersection'](_0x2b1388[_0x8406('0x31')],qs[_0x8406('0x33')](_0x1a9f99[_0x8406('0x2d')][_0x8406('0x33')]));_0x800795['attributes']=_0x800795['attributes'][_0x8406('0x34')]?_0x800795['attributes']:_0x2b1388[_0x8406('0x31')];if(_0x1a9f99['query'][_0x8406('0x3c')]){_0x800795['include']=[{'all':!![]}];}_0x800795=_['merge']({},_0x800795,_0x1a9f99['options']);return db['CmCustomField'][_0x8406('0x3f')](_0x800795)[_0x8406('0x22')](handleEntityNotFound(_0xd2ec8a,null))['then'](respondWithResult(_0xd2ec8a,null))['catch'](handleError(_0xd2ec8a,null));};exports['update']=function(_0x1e8629,_0x26471e){if(_0x1e8629['body']['id']){delete _0x1e8629[_0x8406('0x40')]['id'];}return db[_0x8406('0x27')][_0x8406('0x3f')]({'where':{'id':_0x1e8629[_0x8406('0x3e')]['id']}})['then'](handleEntityNotFound(_0x26471e,null))[_0x8406('0x22')](saveUpdates(_0x1e8629[_0x8406('0x40')],null))[_0x8406('0x22')](respondWithResult(_0x26471e,null))[_0x8406('0x3d')](handleError(_0x26471e,null));};exports['destroy']=function(_0x467c64,_0x2eed74){return db[_0x8406('0x27')][_0x8406('0x3f')]({'where':{'id':_0x467c64['params']['id']}})[_0x8406('0x22')](handleEntityNotFound(_0x2eed74,null))['then'](removeEntity(_0x2eed74,null))[_0x8406('0x3d')](handleError(_0x2eed74,null));};exports[_0x8406('0x41')]=function(_0x5f45ab,_0x6327b8){var _0x548774;return db[_0x8406('0x42')][_0x8406('0x43')](function(_0x55e071){return db['CmCustomField'][_0x8406('0x41')](_0x5f45ab[_0x8406('0x40')],{'transaction':_0x55e071})[_0x8406('0x22')](function(_0x393bae){_0x548774=_0x393bae;var _0x5b9710={'type':db[_0x8406('0x44')][_0x8406('0x45')],'transaction':_0x55e071};switch(_0x5f45ab[_0x8406('0x40')][_0x8406('0x2a')]){case _0x8406('0x46'):_0x5b9710[_0x8406('0x2a')]=db['Sequelize']['TEXT'];break;case'number':_0x5b9710[_0x8406('0x2a')]=db[_0x8406('0x44')]['INTEGER'];break;case _0x8406('0x47'):_0x5b9710[_0x8406('0x2a')]=db[_0x8406('0x44')]['BOOLEAN'];_0x5b9710['defaultValue']=![];break;default:}return db[_0x8406('0x42')][_0x8406('0x48')][_0x8406('0x49')](_0x8406('0x4a'),util[_0x8406('0x4b')](_0x8406('0x4c'),_0x548774['id']),_0x5b9710);})[_0x8406('0x22')](function(){return _0x548774;});})['then'](respondWithResult(_0x6327b8,0xc9))[_0x8406('0x3d')](handleError(_0x6327b8,null));}; \ No newline at end of file +var _0x735a=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','keys','include','body','find','params','create','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','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','end','status','json','count','offset','limit','set','reject','save','update','then','sendStatus','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x735a,0x18c));var _0xa735=function(_0x365d42,_0x5dec47){_0x365d42=_0x365d42-0x0;var _0x267066=_0x735a[_0x365d42];return _0x267066;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa735('0x0'));var zipdir=require(_0xa735('0x1'));var jsonpatch=require(_0xa735('0x2'));var rp=require(_0xa735('0x3'));var moment=require(_0xa735('0x4'));var BPromise=require(_0xa735('0x5'));var Mustache=require('mustache');var util=require(_0xa735('0x6'));var path=require(_0xa735('0x7'));var sox=require('sox');var csv=require(_0xa735('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa735('0x9'));var _=require(_0xa735('0xa'));var squel=require('squel');var crypto=require(_0xa735('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa735('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa735('0xd'));var Papa=require('papaparse');var Redis=require(_0xa735('0xe'));var authService=require(_0xa735('0xf'));var qs=require(_0xa735('0x10'));var as=require(_0xa735('0x11'));var hardwareService=require(_0xa735('0x12'));var logger=require(_0xa735('0x13'))(_0xa735('0x14'));var utils=require(_0xa735('0x15'));var config=require(_0xa735('0x16'));var licenseUtil=require(_0xa735('0x17'));var db=require(_0xa735('0x18'))['db'];function respondWithStatusCode(_0x2b6459,_0x328feb){_0x328feb=_0x328feb||0xcc;return function(_0x45fc82){if(_0x45fc82){return _0x2b6459['sendStatus'](_0x328feb);}return _0x2b6459['status'](_0x328feb)[_0xa735('0x19')]();};}function respondWithResult(_0x22e4d7,_0xc5c7f8){_0xc5c7f8=_0xc5c7f8||0xc8;return function(_0x437dd6){if(_0x437dd6){return _0x22e4d7[_0xa735('0x1a')](_0xc5c7f8)[_0xa735('0x1b')](_0x437dd6);}};}function respondWithFilteredResult(_0xaf866a,_0x55354c){return function(_0x1ee111){if(_0x1ee111){var _0x5305c7=_0x1ee111[_0xa735('0x1c')],_0x5c141d=_0x55354c[_0xa735('0x1d')],_0x538c54=_0x55354c[_0xa735('0x1d')]+_0x55354c[_0xa735('0x1e')],_0x450602;if(_0x538c54>=_0x5305c7){_0x538c54=_0x5305c7;_0x450602=0xc8;}else{_0x450602=0xce;}_0xaf866a[_0xa735('0x1a')](_0x450602);return _0xaf866a[_0xa735('0x1f')]('Content-Range',_0x5c141d+'-'+_0x538c54+'/'+_0x5305c7)['json'](_0x1ee111);}return null;};}function patchUpdates(_0x1a7a37){return function(_0x5e0e32){try{jsonpatch['apply'](_0x5e0e32,_0x1a7a37,!![]);}catch(_0x43715){return BPromise[_0xa735('0x20')](_0x43715);}return _0x5e0e32[_0xa735('0x21')]();};}function saveUpdates(_0x481414,_0x333cb6){return function(_0x4b11a2){if(_0x4b11a2){return _0x4b11a2[_0xa735('0x22')](_0x481414)[_0xa735('0x23')](function(_0x14ec19){return _0x14ec19;});}return null;};}function removeEntity(_0x228e4c,_0x5c4d7e){return function(_0x3375e4){if(_0x3375e4){return _0x3375e4['destroy']()[_0xa735('0x23')](function(){_0x228e4c[_0xa735('0x1a')](0xcc)[_0xa735('0x19')]();});}};}function handleEntityNotFound(_0x3cc419,_0x3da811){return function(_0x370136){if(!_0x370136){_0x3cc419[_0xa735('0x24')](0x194);}return _0x370136;};}function handleError(_0x387f7f,_0x91d528){_0x91d528=_0x91d528||0x1f4;return function(_0x3a78dd){logger[_0xa735('0x25')](_0x3a78dd[_0xa735('0x26')]);if(_0x3a78dd[_0xa735('0x27')]){delete _0x3a78dd[_0xa735('0x27')];}_0x387f7f[_0xa735('0x1a')](_0x91d528)[_0xa735('0x28')](_0x3a78dd);};}exports[_0xa735('0x29')]=function(_0x24f9cb,_0x412c87){var _0x5d4751={},_0x227c79={},_0x99f3cf={'count':0x0,'rows':[]};var _0x2375f5=_[_0xa735('0x2a')](db[_0xa735('0x2b')][_0xa735('0x2c')],function(_0x1b5e6d){return{'name':_0x1b5e6d[_0xa735('0x2d')],'type':_0x1b5e6d[_0xa735('0x2e')][_0xa735('0x2f')]};});_0x227c79[_0xa735('0x30')]=_['differenceBy'](_['map'](_0x2375f5,_0xa735('0x27')),[_0xa735('0x27')]);_0x227c79[_0xa735('0x31')]=_['keys'](_0x24f9cb[_0xa735('0x31')]);_0x227c79[_0xa735('0x32')]=_[_0xa735('0x33')](_0x227c79[_0xa735('0x30')],_0x227c79[_0xa735('0x31')]);_0x5d4751[_0xa735('0x34')]=_[_0xa735('0x33')](_0x227c79[_0xa735('0x30')],qs[_0xa735('0x35')](_0x24f9cb[_0xa735('0x31')]['fields']));_0x5d4751['attributes']=_0x5d4751[_0xa735('0x34')][_0xa735('0x36')]?_0x5d4751[_0xa735('0x34')]:_0x227c79[_0xa735('0x30')];if(!_0x24f9cb[_0xa735('0x31')][_0xa735('0x37')](_0xa735('0x38'))){_0x5d4751[_0xa735('0x1e')]=qs['limit'](_0x24f9cb[_0xa735('0x31')][_0xa735('0x1e')]);_0x5d4751[_0xa735('0x1d')]=qs[_0xa735('0x1d')](_0x24f9cb[_0xa735('0x31')]['offset']);}_0x5d4751[_0xa735('0x39')]=qs['sort'](_0x24f9cb[_0xa735('0x31')][_0xa735('0x3a')]);_0x5d4751['where']=qs['filters'](_[_0xa735('0x3b')](_0x24f9cb[_0xa735('0x31')],_0x227c79['filters']),_0x2375f5);if(_0x24f9cb['query'][_0xa735('0x3c')]){_0x5d4751[_0xa735('0x3d')]=_[_0xa735('0x3e')](_0x5d4751[_0xa735('0x3d')],{'$or':_[_0xa735('0x2a')](_0x2375f5,function(_0x1d0c73){if(_0x1d0c73[_0xa735('0x2e')]!=='VIRTUAL'){var _0x59069d={};_0x59069d[_0x1d0c73[_0xa735('0x27')]]={'$like':'%'+_0x24f9cb[_0xa735('0x31')]['filter']+'%'};return _0x59069d;}})});}_0x5d4751=_[_0xa735('0x3e')]({},_0x5d4751,_0x24f9cb[_0xa735('0x3f')]);var _0x308dcf={'where':_0x5d4751[_0xa735('0x3d')]};return db[_0xa735('0x2b')][_0xa735('0x1c')](_0x308dcf)['then'](function(_0x3aa18b){_0x99f3cf[_0xa735('0x1c')]=_0x3aa18b;if(_0x24f9cb[_0xa735('0x31')][_0xa735('0x40')]){_0x5d4751['include']=[{'all':!![]}];}return db['CmCustomField'][_0xa735('0x41')](_0x5d4751);})[_0xa735('0x23')](function(_0x1c399f){_0x99f3cf[_0xa735('0x42')]=_0x1c399f;return _0x99f3cf;})[_0xa735('0x23')](respondWithFilteredResult(_0x412c87,_0x5d4751))[_0xa735('0x43')](handleError(_0x412c87,null));};exports[_0xa735('0x44')]=function(_0x16d506,_0x299722){var _0x76275f={'raw':!![],'where':{'id':_0x16d506['params']['id']}},_0x5d7e6d={};_0x5d7e6d[_0xa735('0x30')]=_[_0xa735('0x45')](db[_0xa735('0x2b')][_0xa735('0x2c')]);_0x5d7e6d['query']=_[_0xa735('0x45')](_0x16d506['query']);_0x5d7e6d['filters']=_[_0xa735('0x33')](_0x5d7e6d[_0xa735('0x30')],_0x5d7e6d['query']);_0x76275f['attributes']=_[_0xa735('0x33')](_0x5d7e6d[_0xa735('0x30')],qs['fields'](_0x16d506['query']['fields']));_0x76275f[_0xa735('0x34')]=_0x76275f[_0xa735('0x34')][_0xa735('0x36')]?_0x76275f[_0xa735('0x34')]:_0x5d7e6d[_0xa735('0x30')];if(_0x16d506[_0xa735('0x31')][_0xa735('0x40')]){_0x76275f[_0xa735('0x46')]=[{'all':!![]}];}_0x76275f=_[_0xa735('0x3e')]({},_0x76275f,_0x16d506[_0xa735('0x3f')]);return db[_0xa735('0x2b')]['find'](_0x76275f)[_0xa735('0x23')](handleEntityNotFound(_0x299722,null))[_0xa735('0x23')](respondWithResult(_0x299722,null))['catch'](handleError(_0x299722,null));};exports[_0xa735('0x22')]=function(_0x26e709,_0x3e6a13){if(_0x26e709[_0xa735('0x47')]['id']){delete _0x26e709[_0xa735('0x47')]['id'];}return db[_0xa735('0x2b')][_0xa735('0x48')]({'where':{'id':_0x26e709[_0xa735('0x49')]['id']}})[_0xa735('0x23')](handleEntityNotFound(_0x3e6a13,null))['then'](saveUpdates(_0x26e709[_0xa735('0x47')],null))['then'](respondWithResult(_0x3e6a13,null))[_0xa735('0x43')](handleError(_0x3e6a13,null));};exports['destroy']=function(_0x9c671c,_0x108e9a){return db['CmCustomField'][_0xa735('0x48')]({'where':{'id':_0x9c671c[_0xa735('0x49')]['id']}})[_0xa735('0x23')](handleEntityNotFound(_0x108e9a,null))[_0xa735('0x23')](removeEntity(_0x108e9a,null))[_0xa735('0x43')](handleError(_0x108e9a,null));};exports[_0xa735('0x4a')]=function(_0x909544,_0x262d49){var _0xa1bd90;return db[_0xa735('0x4b')][_0xa735('0x4c')](function(_0x5dad47){return db[_0xa735('0x2b')][_0xa735('0x4a')](_0x909544['body'],{'transaction':_0x5dad47})['then'](function(_0x423aa4){_0xa1bd90=_0x423aa4;var _0x261c8a={'type':db[_0xa735('0x4d')]['TEXT'],'transaction':_0x5dad47};switch(_0x909544[_0xa735('0x47')][_0xa735('0x2e')]){case _0xa735('0x4e'):_0x261c8a[_0xa735('0x2e')]=db[_0xa735('0x4d')][_0xa735('0x4f')];break;case _0xa735('0x50'):_0x261c8a[_0xa735('0x2e')]=db[_0xa735('0x4d')][_0xa735('0x51')];break;case _0xa735('0x52'):_0x261c8a[_0xa735('0x2e')]=db['Sequelize'][_0xa735('0x53')];_0x261c8a[_0xa735('0x54')]=![];break;default:}return db['sequelize'][_0xa735('0x55')][_0xa735('0x56')](_0xa735('0x57'),util['format'](_0xa735('0x58'),_0xa1bd90['id']),_0x261c8a);})[_0xa735('0x23')](function(){return _0xa1bd90;});})[_0xa735('0x23')](respondWithResult(_0x262d49,0xc9))['catch'](handleError(_0x262d49,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 9d23c09..d14ef57 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 _0xab04=['bluebird','request-promise','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','moment'];(function(_0x1a4748,_0x40c46e){var _0x28ca99=function(_0x99232c){while(--_0x99232c){_0x1a4748['push'](_0x1a4748['shift']());}};_0x28ca99(++_0x40c46e);}(_0xab04,0x1b8));var _0x4ab0=function(_0x5aef12,_0x1edd9d){_0x5aef12=_0x5aef12-0x0;var _0x245089=_0xab04[_0x5aef12];return _0x245089;};'use strict';var _=require(_0x4ab0('0x0'));var util=require(_0x4ab0('0x1'));var logger=require(_0x4ab0('0x2'))('api');var moment=require(_0x4ab0('0x3'));var BPromise=require(_0x4ab0('0x4'));var rp=require(_0x4ab0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4ab0('0x6'));var attributes=require(_0x4ab0('0x7'));module[_0x4ab0('0x8')]=function(_0x5dbc06,_0x28ef60){return _0x5dbc06[_0x4ab0('0x9')](_0x4ab0('0xa'),attributes,{'tableName':_0x4ab0('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb44a=['../../config/logger','moment','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields'];(function(_0x4d2c0a,_0x552c5f){var _0xb0a956=function(_0x4ce08c){while(--_0x4ce08c){_0x4d2c0a['push'](_0x4d2c0a['shift']());}};_0xb0a956(++_0x552c5f);}(_0xb44a,0x1c2));var _0xab44=function(_0x4b3d13,_0x1993d5){_0x4b3d13=_0x4b3d13-0x0;var _0xf64dd8=_0xb44a[_0x4b3d13];return _0xf64dd8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab44('0x0'))('api');var moment=require(_0xab44('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab44('0x2'));var rimraf=require('rimraf');var config=require(_0xab44('0x3'));var attributes=require(_0xab44('0x4'));module[_0xab44('0x5')]=function(_0x28681a,_0x2f3948){return _0x28681a[_0xab44('0x6')](_0xab44('0x7'),attributes,{'tableName':_0xab44('0x8'),'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 8942354..51bbf45 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 _0xa8a8=['stringify','error','code','CmCustomField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0xc59045,_0x4d3ab6){var _0x41e4c8=function(_0x3e8b8b){while(--_0x3e8b8b){_0xc59045['push'](_0xc59045['shift']());}};_0x41e4c8(++_0x4d3ab6);}(_0xa8a8,0xec));var _0x8a8a=function(_0x3b8f4d,_0x1caf04){_0x3b8f4d=_0x3b8f4d-0x0;var _0x443080=_0xa8a8[_0x3b8f4d];return _0x443080;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('CmCustomField,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('CmCustomField,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file +var _0x984b=['CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','then','info'];(function(_0x41e774,_0x1a0ed7){var _0x37a3df=function(_0xbaae7e){while(--_0xbaae7e){_0x41e774['push'](_0x41e774['shift']());}};_0x37a3df(++_0x1a0ed7);}(_0x984b,0xee));var _0xb984=function(_0x5d29d8,_0x34e7d4){_0x5d29d8=_0x5d29d8-0x0;var _0x511548=_0x984b[_0x5d29d8];return _0x511548;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb984('0x0'));var rs=require(_0xb984('0x1'));var fs=require('fs');var Redis=require(_0xb984('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb984('0x3'))(_0xb984('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb984('0x5')][_0xb984('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a605a,_0x7405cd,_0x1a00d6){return new BPromise(function(_0x4d72b7,_0x37fd36){return client['request'](_0x5a605a,_0x1a00d6)[_0xb984('0x7')](function(_0x42dfd9){logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,_0xb984('0xa'));logger[_0xb984('0xb')](_0xb984('0xc'),_0x7405cd,_0xb984('0xa'),JSON[_0xb984('0xd')](_0x42dfd9));if(_0x42dfd9[_0xb984('0xe')]){if(_0x42dfd9[_0xb984('0xe')][_0xb984('0xf')]===0x1f4){logger['error'](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x37fd36(_0x42dfd9[_0xb984('0xe')]['message']);}logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x4d72b7(_0x42dfd9[_0xb984('0xe')]['message']);}else{logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,'request\x20sent');_0x4d72b7(_0x42dfd9[_0xb984('0x11')]['message']);}})[_0xb984('0x12')](function(_0x1dc4df){logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x1dc4df);_0x37fd36(_0x1dc4df);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 7ab1726..608de1f 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 _0x3bae=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3bae,0x10b));var _0xe3ba=function(_0x120ead,_0x4a78f2){_0x120ead=_0x120ead-0x0;var _0x20315e=_0x3bae[_0x120ead];return _0x20315e;};'use strict';var multer=require(_0xe3ba('0x0'));var util=require(_0xe3ba('0x1'));var path=require('path');var timeout=require(_0xe3ba('0x2'));var express=require(_0xe3ba('0x3'));var router=express[_0xe3ba('0x4')]();var fs_extra=require(_0xe3ba('0x5'));var auth=require(_0xe3ba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe3ba('0x7'));var controller=require('./cmCustomField.controller');router[_0xe3ba('0x8')]('/',auth[_0xe3ba('0x9')](),controller['index']);router[_0xe3ba('0x8')](_0xe3ba('0xa'),auth[_0xe3ba('0x9')](),controller['show']);router[_0xe3ba('0xb')]('/',auth[_0xe3ba('0x9')](),controller[_0xe3ba('0xc')]);router['put'](_0xe3ba('0xa'),auth[_0xe3ba('0x9')](),controller[_0xe3ba('0xd')]);router['delete'](_0xe3ba('0xa'),auth[_0xe3ba('0x9')](),controller[_0xe3ba('0xe')]);module[_0xe3ba('0xf')]=router; \ No newline at end of file +var _0xaf45=['../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xaf45,0xbf));var _0x5af4=function(_0x3cdf76,_0x63322b){_0x3cdf76=_0x3cdf76-0x0;var _0x1f1bdb=_0xaf45[_0x3cdf76];return _0x1f1bdb;};'use strict';var multer=require(_0x5af4('0x0'));var util=require(_0x5af4('0x1'));var path=require('path');var timeout=require(_0x5af4('0x2'));var express=require(_0x5af4('0x3'));var router=express[_0x5af4('0x4')]();var fs_extra=require(_0x5af4('0x5'));var auth=require(_0x5af4('0x6'));var interaction=require(_0x5af4('0x7'));var config=require('../../config/environment');var controller=require(_0x5af4('0x8'));router[_0x5af4('0x9')]('/',auth[_0x5af4('0xa')](),controller[_0x5af4('0xb')]);router[_0x5af4('0x9')](_0x5af4('0xc'),auth[_0x5af4('0xa')](),controller['show']);router[_0x5af4('0xd')]('/',auth[_0x5af4('0xa')](),controller[_0x5af4('0xe')]);router[_0x5af4('0xf')](_0x5af4('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x5af4('0x10')]('/:id',auth[_0x5af4('0xa')](),controller['destroy']);module[_0x5af4('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b513af8..7e3564e 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 _0xf69d=['UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE'];(function(_0x32ba0d,_0x16ba81){var _0x325a02=function(_0x3634d2){while(--_0x3634d2){_0x32ba0d['push'](_0x32ba0d['shift']());}};_0x325a02(++_0x16ba81);}(_0xf69d,0xd3));var _0xdf69=function(_0x2498ef,_0x135ae5){_0x2498ef=_0x2498ef-0x0;var _0x271fc3=_0xf69d[_0x2498ef];return _0x271fc3;};'use strict';var moment=require(_0xdf69('0x0'));var Sequelize=require(_0xdf69('0x1'));module[_0xdf69('0x2')]={'phone':{'type':Sequelize[_0xdf69('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xdf69('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xdf69('0x5')](_0xdf69('0x6'))},'countbusyretry':{'type':Sequelize[_0xdf69('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdf69('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdf69('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xdf69('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdf69('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdf69('0x8')]},'priority':{'type':Sequelize[_0xdf69('0x7')](0x2)[_0xdf69('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xdf69('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xdf69('0x7')],'unique':_0xdf69('0xa')},'ListId':{'type':Sequelize[_0xdf69('0x7')],'unique':_0xdf69('0xa')},'UserId':{'type':Sequelize[_0xdf69('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xdf69('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xdf69('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xdf69('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdf69('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdf69('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdf69('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdf69('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6b8f=['DATE','UNSIGNED','contactListQueue','sequelize','STRING','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN'];(function(_0x28b164,_0x17cbc8){var _0x4d8464=function(_0x186fc3){while(--_0x186fc3){_0x28b164['push'](_0x28b164['shift']());}};_0x4d8464(++_0x17cbc8);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x26280d,_0x31c941){_0x26280d=_0x26280d-0x0;var _0xb2228=_0x6b8f[_0x26280d];return _0xb2228;};'use strict';var moment=require('moment');var Sequelize=require(_0xf6b8('0x0'));module['exports']={'phone':{'type':Sequelize[_0xf6b8('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xf6b8('0x2')](_0xf6b8('0x3'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf6b8('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf6b8('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf6b8('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf6b8('0x6')]},'priority':{'type':Sequelize[_0xf6b8('0x4')](0x2)[_0xf6b8('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf6b8('0x5')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xf6b8('0x4')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xf6b8('0x4')]},'VoiceQueueId':{'type':Sequelize[_0xf6b8('0x4')],'unique':_0xf6b8('0x8')},'CampaignId':{'type':Sequelize[_0xf6b8('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xf6b8('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf6b8('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 1e38d16..5420196 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 _0x0ccf=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','intersection','filters','concat','$gt','$gte','$lte','$not','$between','$notBetween','$in','$like','$notLike','$notILike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','rows','catch','show','params','includeAll','find','create','body','describe','VoiceQueueId','CampaignId','Campaign','omit','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','hopperIds','priority','scheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x48361e,_0x5e5921){var _0x16f1dd=function(_0x4e736b){while(--_0x4e736b){_0x48361e['push'](_0x48361e['shift']());}};_0x16f1dd(++_0x5e5921);}(_0x0ccf,0x19d));var _0xf0cc=function(_0x209526,_0x40a1f0){_0x209526=_0x209526-0x0;var _0x40d077=_0x0ccf[_0x209526];return _0x40d077;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf0cc('0x0'));var jsonpatch=require(_0xf0cc('0x1'));var rp=require(_0xf0cc('0x2'));var moment=require(_0xf0cc('0x3'));var BPromise=require(_0xf0cc('0x4'));var Mustache=require(_0xf0cc('0x5'));var util=require(_0xf0cc('0x6'));var path=require(_0xf0cc('0x7'));var sox=require(_0xf0cc('0x8'));var csv=require('to-csv');var ejs=require(_0xf0cc('0x9'));var fs=require('fs');var fs_extra=require(_0xf0cc('0xa'));var _=require(_0xf0cc('0xb'));var squel=require('squel');var crypto=require(_0xf0cc('0xc'));var jsforce=require(_0xf0cc('0xd'));var deskjs=require(_0xf0cc('0xe'));var toCsv=require(_0xf0cc('0xf'));var querystring=require(_0xf0cc('0x10'));var Papa=require('papaparse');var Redis=require(_0xf0cc('0x11'));var authService=require(_0xf0cc('0x12'));var qs=require(_0xf0cc('0x13'));var as=require(_0xf0cc('0x14'));var hardwareService=require(_0xf0cc('0x15'));var logger=require(_0xf0cc('0x16'))(_0xf0cc('0x17'));var utils=require(_0xf0cc('0x18'));var config=require(_0xf0cc('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xf0cc('0x1a'))['db'];function respondWithStatusCode(_0x5a2648,_0x3b1701){_0x3b1701=_0x3b1701||0xcc;return function(_0x218546){if(_0x218546){return _0x5a2648[_0xf0cc('0x1b')](_0x3b1701);}return _0x5a2648['status'](_0x3b1701)[_0xf0cc('0x1c')]();};}function respondWithResult(_0xfce2ac,_0x59e060){_0x59e060=_0x59e060||0xc8;return function(_0x434277){if(_0x434277){return _0xfce2ac[_0xf0cc('0x1d')](_0x59e060)['json'](_0x434277);}};}function respondWithFilteredResult(_0x5df66f,_0x2011cc){return function(_0x486deb){if(_0x486deb){var _0x27dfec=_0x486deb[_0xf0cc('0x1e')],_0x3c3acc=_0x2011cc[_0xf0cc('0x1f')],_0x28bb79=_0x2011cc[_0xf0cc('0x1f')]+_0x2011cc[_0xf0cc('0x20')],_0x38445e;if(_0x28bb79>=_0x27dfec){_0x28bb79=_0x27dfec;_0x38445e=0xc8;}else{_0x38445e=0xce;}_0x5df66f[_0xf0cc('0x1d')](_0x38445e);return _0x5df66f[_0xf0cc('0x21')]('Content-Range',_0x3c3acc+'-'+_0x28bb79+'/'+_0x27dfec)[_0xf0cc('0x22')](_0x486deb);}return null;};}function patchUpdates(_0x235ec9){return function(_0x4f44a3){try{jsonpatch[_0xf0cc('0x23')](_0x4f44a3,_0x235ec9,!![]);}catch(_0x480e40){return BPromise[_0xf0cc('0x24')](_0x480e40);}return _0x4f44a3[_0xf0cc('0x25')]();};}function saveUpdates(_0x8847f1,_0xd4bbfd){return function(_0x30e4c1){if(_0x30e4c1){return _0x30e4c1[_0xf0cc('0x26')](_0x8847f1)[_0xf0cc('0x27')](function(_0x3a8a0d){return _0x3a8a0d;});}return null;};}function removeEntity(_0x4b5ffa,_0x439993){return function(_0x2aad4e){if(_0x2aad4e){return _0x2aad4e[_0xf0cc('0x28')]()[_0xf0cc('0x27')](function(){_0x4b5ffa[_0xf0cc('0x1d')](0xcc)[_0xf0cc('0x1c')]();});}};}function handleEntityNotFound(_0x32cf9c,_0x311186){return function(_0xd7dcc4){if(!_0xd7dcc4){_0x32cf9c[_0xf0cc('0x1b')](0x194);}return _0xd7dcc4;};}function handleError(_0x228147,_0x150e1f){_0x150e1f=_0x150e1f||0x1f4;return function(_0x270850){logger[_0xf0cc('0x29')](_0x270850[_0xf0cc('0x2a')]);if(_0x270850[_0xf0cc('0x2b')]){delete _0x270850[_0xf0cc('0x2b')];}_0x228147[_0xf0cc('0x1d')](_0x150e1f)[_0xf0cc('0x2c')](_0x270850);};}exports['index']=function(_0x41cc3b,_0x163e8f){var _0x50f694={},_0xf13c3e={},_0x4199b2={'count':0x0,'rows':[]};var _0x2fc97c=_[_0xf0cc('0x2d')](db[_0xf0cc('0x2e')][_0xf0cc('0x2f')],function(_0x1cf367){return{'name':_0x1cf367[_0xf0cc('0x30')],'type':_0x1cf367[_0xf0cc('0x31')][_0xf0cc('0x32')]};});_0xf13c3e[_0xf0cc('0x33')]=_[_0xf0cc('0x2d')](_0x2fc97c,_0xf0cc('0x2b'));_0xf13c3e[_0xf0cc('0x34')]=_[_0xf0cc('0x35')](_0x41cc3b[_0xf0cc('0x34')]);_0xf13c3e['filters']=_[_0xf0cc('0x36')](_0xf13c3e['model'],_0xf13c3e[_0xf0cc('0x34')]);_0xf13c3e[_0xf0cc('0x37')]=_[_0xf0cc('0x38')](_0xf13c3e[_0xf0cc('0x37')],['$and','$or',_0xf0cc('0x39'),_0xf0cc('0x3a'),'$lt',_0xf0cc('0x3b'),'$ne','$eq',_0xf0cc('0x3c'),_0xf0cc('0x3d'),_0xf0cc('0x3e'),_0xf0cc('0x3f'),'$notIn',_0xf0cc('0x40'),_0xf0cc('0x41'),'$iLike',_0xf0cc('0x42'),'$like',_0xf0cc('0x43'),_0xf0cc('0x44'),'$contained',_0xf0cc('0x45')]);_0x50f694[_0xf0cc('0x46')]=_['intersection'](_0xf13c3e['model'],qs[_0xf0cc('0x47')](_0x41cc3b[_0xf0cc('0x34')]['fields']));_0x50f694[_0xf0cc('0x46')]=_0x50f694[_0xf0cc('0x46')][_0xf0cc('0x48')]?_0x50f694['attributes']:_0xf13c3e['model'];if(!_0x41cc3b['query'][_0xf0cc('0x49')]('nolimit')){_0x50f694[_0xf0cc('0x20')]=qs[_0xf0cc('0x20')](_0x41cc3b['query']['limit']);_0x50f694[_0xf0cc('0x1f')]=qs[_0xf0cc('0x1f')](_0x41cc3b[_0xf0cc('0x34')][_0xf0cc('0x1f')]);}_0x50f694[_0xf0cc('0x4a')]=qs[_0xf0cc('0x4b')](_0x41cc3b[_0xf0cc('0x34')][_0xf0cc('0x4b')]);_0x50f694[_0xf0cc('0x4c')]=qs[_0xf0cc('0x37')](_['pick'](_0x41cc3b[_0xf0cc('0x34')],_0xf13c3e[_0xf0cc('0x37')]),_0x2fc97c);if(_0x41cc3b[_0xf0cc('0x34')][_0xf0cc('0x4d')]){_0x50f694[_0xf0cc('0x4c')]=_['merge'](_0x50f694[_0xf0cc('0x4c')],{'$or':_[_0xf0cc('0x2d')](_0x2fc97c,function(_0x218469){if(_0x218469[_0xf0cc('0x31')]!==_0xf0cc('0x4e')){var _0x4d4525={};_0x4d4525[_0x218469[_0xf0cc('0x2b')]]={'$like':'%'+_0x41cc3b[_0xf0cc('0x34')][_0xf0cc('0x4d')]+'%'};return _0x4d4525;}})});}_0x50f694=_[_0xf0cc('0x4f')]({},_0x50f694,_0x41cc3b[_0xf0cc('0x50')]);var _0x1e2f57={'where':_0x50f694[_0xf0cc('0x4c')]};return db['CmHopper'][_0xf0cc('0x1e')](_0x1e2f57)[_0xf0cc('0x27')](function(_0x946a15){_0x4199b2[_0xf0cc('0x1e')]=_0x946a15;if(_0x41cc3b[_0xf0cc('0x34')]['includeAll']){_0x50f694['include']=[{'all':!![]}];}return db[_0xf0cc('0x2e')]['findAll'](_0x50f694);})[_0xf0cc('0x27')](function(_0x4a32cf){_0x4199b2[_0xf0cc('0x51')]=_0x4a32cf;return _0x4199b2;})['then'](respondWithFilteredResult(_0x163e8f,_0x50f694))[_0xf0cc('0x52')](handleError(_0x163e8f,null));};exports[_0xf0cc('0x53')]=function(_0x215dbc,_0x145585){var _0x196fd={'raw':!![],'where':{'id':_0x215dbc[_0xf0cc('0x54')]['id']}},_0x1f9a04={};_0x1f9a04[_0xf0cc('0x33')]=_[_0xf0cc('0x35')](db['CmHopper'][_0xf0cc('0x2f')]);_0x1f9a04[_0xf0cc('0x34')]=_[_0xf0cc('0x35')](_0x215dbc['query']);_0x1f9a04[_0xf0cc('0x37')]=_[_0xf0cc('0x36')](_0x1f9a04[_0xf0cc('0x33')],_0x1f9a04['query']);_0x196fd[_0xf0cc('0x46')]=_[_0xf0cc('0x36')](_0x1f9a04[_0xf0cc('0x33')],qs['fields'](_0x215dbc[_0xf0cc('0x34')][_0xf0cc('0x47')]));_0x196fd[_0xf0cc('0x46')]=_0x196fd[_0xf0cc('0x46')]['length']?_0x196fd['attributes']:_0x1f9a04[_0xf0cc('0x33')];if(_0x215dbc['query'][_0xf0cc('0x55')]){_0x196fd['include']=[{'all':!![]}];}_0x196fd=_[_0xf0cc('0x4f')]({},_0x196fd,_0x215dbc['options']);return db[_0xf0cc('0x2e')][_0xf0cc('0x56')](_0x196fd)['then'](handleEntityNotFound(_0x145585,null))[_0xf0cc('0x27')](respondWithResult(_0x145585,null))[_0xf0cc('0x52')](handleError(_0x145585,null));};exports[_0xf0cc('0x57')]=function(_0x1e06db,_0x5194d5){return db[_0xf0cc('0x2e')][_0xf0cc('0x57')](_0x1e06db[_0xf0cc('0x58')],{})['then'](respondWithResult(_0x5194d5,0xc9))['catch'](handleError(_0x5194d5,null));};exports[_0xf0cc('0x26')]=function(_0x270275,_0x1c5ca1){if(_0x270275[_0xf0cc('0x58')]['id']){delete _0x270275[_0xf0cc('0x58')]['id'];}return db[_0xf0cc('0x2e')][_0xf0cc('0x56')]({'where':{'id':_0x270275['params']['id']}})[_0xf0cc('0x27')](handleEntityNotFound(_0x1c5ca1,null))[_0xf0cc('0x27')](saveUpdates(_0x270275[_0xf0cc('0x58')],null))[_0xf0cc('0x27')](respondWithResult(_0x1c5ca1,null))[_0xf0cc('0x52')](handleError(_0x1c5ca1,null));};exports[_0xf0cc('0x59')]=function(_0x3b5612,_0x4d76ca){return db[_0xf0cc('0x2e')][_0xf0cc('0x59')]()[_0xf0cc('0x27')](respondWithResult(_0x4d76ca,null))[_0xf0cc('0x52')](handleError(_0x4d76ca,null));};exports[_0xf0cc('0x28')]=function(_0x1ae186,_0x56fad5){var _0x5bfa63;return db[_0xf0cc('0x2e')][_0xf0cc('0x56')]({'where':{'id':_0x1ae186['params']['id']}})['then'](handleEntityNotFound(_0x56fad5,null))[_0xf0cc('0x27')](function(_0x45cea6){if(_0x45cea6){return _0x45cea6['destroy']()['then'](function(_0x3dd5aa){return _0x3dd5aa;});}})[_0xf0cc('0x27')](function(_0xd8450b){_0x5bfa63=_0xd8450b;if(_0xd8450b){if(_0xd8450b[_0xf0cc('0x5a')]||_0xd8450b[_0xf0cc('0x5b')]){return db[_0xd8450b[_0xf0cc('0x5a')]?'VoiceQueue':_0xf0cc('0x5c')][_0xf0cc('0x56')]({'where':{'id':_0xd8450b[_0xf0cc('0x5a')]?_0xd8450b[_0xf0cc('0x5a')]:_0xd8450b['CampaignId']},'attributes':['id',_0xf0cc('0x2b')],'raw':!![]});}}})[_0xf0cc('0x27')](function(_0x2f7a65){var _0x4bf35b={};if(_0x2f7a65){_[_0xf0cc('0x4f')](_0x4bf35b,_[_0xf0cc('0x5d')](_0x5bfa63['dataValues'],[_0xf0cc('0x5e'),_0xf0cc('0x5f'),'id']));_0x4bf35b[_0xf0cc('0x60')]=0x15;_0x4bf35b[_0xf0cc('0x61')]=_0xf0cc('0x62');_0x4bf35b[_0xf0cc('0x63')]=_0x2f7a65[_0xf0cc('0x2b')];_0x4bf35b[_0xf0cc('0x64')]=_0x1ae186[_0xf0cc('0x65')][_0xf0cc('0x2b')];_0x4bf35b[_0xf0cc('0x66')]=_0x1ae186[_0xf0cc('0x65')]['id'];_0x4bf35b[_0xf0cc('0x62')]=!![];_0x4bf35b['deletedat']=moment()[_0xf0cc('0x67')](_0xf0cc('0x68'));_0x4bf35b['calleridnum']=_0x5bfa63['phone'];_0x4bf35b[_0xf0cc('0x69')]=_0x5bfa63['VoiceQueueId']?_0xf0cc('0x6a'):'ivr';return db[_0xf0cc('0x6b')][_0xf0cc('0x56')]({'where':{'id':_0x4bf35b[_0xf0cc('0x6c')]},'attributes':[_0xf0cc('0x6d'),_0xf0cc('0x6e')]})['then'](function(_0x23a13f){if(!_[_0xf0cc('0x6f')](_0x56fad5)&&!_[_0xf0cc('0x6f')](_0x23a13f['firstName'])){_0x4bf35b[_0xf0cc('0x70')]=_0x23a13f['firstName'];if(!_[_0xf0cc('0x6f')](_0x23a13f[_0xf0cc('0x6e')])){_0x4bf35b[_0xf0cc('0x70')]+='\x20'+_0x23a13f[_0xf0cc('0x6e')];}}})[_0xf0cc('0x71')](function(){return db[_0xf0cc('0x72')]['create'](_0x4bf35b);});}})['then'](function(){return _0x56fad5[_0xf0cc('0x1d')](0xcc)[_0xf0cc('0x1c')]();})['catch'](handleError(_0x56fad5,null));};exports[_0xf0cc('0x73')]=function(_0x43af11,_0x4c477e,_0x58be73){var _0x24981c=[];return db['CmContact'][_0xf0cc('0x59')]()[_0xf0cc('0x27')](function(_0x3285d0){_0x24981c=_[_0xf0cc('0x35')](_0x3285d0);return _0x43af11['user']['getVoiceQueues']({'where':{'type':_0xf0cc('0x74'),'dialActive':!![],'dialMethod':_0xf0cc('0x75')},'attributes':['id',_0xf0cc('0x76')],'raw':!![]});})[_0xf0cc('0x27')](function(_0x42d459){if(_0x42d459&&_0x42d459[_0xf0cc('0x48')]){return db[_0xf0cc('0x77')][_0xf0cc('0x78')](function(_0x1664ea){var _0x47b03f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf0cc('0x67')](_0xf0cc('0x68'))},'VoiceQueueId':{'$in':_[_0xf0cc('0x2d')](_0x42d459,'id')},'$or':[{'UserId':null},{'UserId':_0x43af11['user']['id']}]};var _0x3c0718=[];if(_0x43af11[_0xf0cc('0x58')][_0xf0cc('0x79')]&&_0x43af11[_0xf0cc('0x58')][_0xf0cc('0x79')]===_0xf0cc('0x7a')){if(!_['isEmpty'](_0x43af11['body'][_0xf0cc('0x7b')])){_0x47b03f['id']={'$in':_0x43af11[_0xf0cc('0x58')][_0xf0cc('0x7b')]};}_0x3c0718=[[_0xf0cc('0x7c'),'ASC'],[_0xf0cc('0x7d'),_0x42d459[0x0]['dialOrderByScheduledAt']===_0xf0cc('0x7e')?_0xf0cc('0x7f'):_0xf0cc('0x7e')],db[_0xf0cc('0x77')][_0xf0cc('0x80')](_0xf0cc('0x81')),['id','DESC']];}else{if(!_['isEmpty'](_0x43af11[_0xf0cc('0x58')][_0xf0cc('0x7b')])){_0x47b03f['id']={'$notIn':_0x43af11[_0xf0cc('0x58')][_0xf0cc('0x7b')]};}_0x3c0718=[[_0xf0cc('0x7c'),'DESC'],[_0xf0cc('0x7d'),_0x42d459[0x0][_0xf0cc('0x76')]],db[_0xf0cc('0x77')][_0xf0cc('0x80')](_0xf0cc('0x82')),['id','ASC']];}return db[_0xf0cc('0x2e')][_0xf0cc('0x83')]({'attributes':['id',_0xf0cc('0x84')],'where':_0x47b03f,'order':_0x3c0718,'transaction':_0x1664ea,'lock':_0x1664ea['LOCK']['UPDATE'],'include':[{'model':db[_0xf0cc('0x6b')],'as':_0xf0cc('0x85'),'attributes':_0x24981c,'include':[{'model':db[_0xf0cc('0x86')],'as':_0xf0cc('0x87'),'attributes':['id',_0xf0cc('0x2b')]}]},{'model':db[_0xf0cc('0x88')],'as':_0xf0cc('0x89'),'attributes':['id',_0xf0cc('0x2b')]},{'model':db[_0xf0cc('0x8a')],'as':_0xf0cc('0x8b'),'attributes':['id',_0xf0cc('0x2b'),_0xf0cc('0x8c')]}]})[_0xf0cc('0x27')](function(_0x2df09a){if(_0x2df09a){return _0x2df09a[_0xf0cc('0x26')]({'UserId':_0x43af11[_0xf0cc('0x65')]['id']},{'transaction':_0x1664ea});}});});}})[_0xf0cc('0x27')](handleEntityNotFound(_0x4c477e,null))['then'](respondWithResult(_0x4c477e,null))[_0xf0cc('0x52')](handleError(_0x4c477e,null));};exports[_0xf0cc('0x8d')]=function(_0x1e7de1,_0x8e32c6,_0x25f0cd){return _0x1e7de1[_0xf0cc('0x65')][_0xf0cc('0x8e')]({'where':{'type':_0xf0cc('0x74'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xf0cc('0x27')](function(_0x25a04e){if(_0x25a04e&&_0x25a04e['length']){return db[_0xf0cc('0x2e')][_0xf0cc('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf0cc('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xf0cc('0x2d')](_0x25a04e,'id')},'$or':[{'UserId':null},{'UserId':_0x1e7de1['user']['id']}]}});}return 0x0;})[_0xf0cc('0x27')](function(_0x10c597){if(!_[_0xf0cc('0x6f')](_0x10c597)&&_[_0xf0cc('0x8f')](_0x10c597)){return _0x8e32c6[_0xf0cc('0x1d')](0xc8)[_0xf0cc('0x22')]({'contacts':_0x10c597});}else{logger[_0xf0cc('0x29')](_0xf0cc('0x90'),_0xf0cc('0x8d'),0x194,'entity\x20not\x20found');_0x8e32c6[_0xf0cc('0x1b')](0x194);}})['catch'](handleError(_0x8e32c6,null));}; \ No newline at end of file +var _0x0df3=['calleridname','finally','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','scheduledAt','DESC','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmContact','Contact','CmCompany','Company','List','Queue','dialActive','getOpenContacts','isNumber','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','then','destroy','error','name','index','map','CmHopper','rawAttributes','key','model','query','keys','intersection','concat','filters','$and','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$any','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','merge','options','find','create','body','update','describe','CampaignId','VoiceQueueId','VoiceQueue','Campaign','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','firstName','isNil','lastName'];(function(_0x3d07be,_0x46360f){var _0x20ff90=function(_0x53d13a){while(--_0x53d13a){_0x3d07be['push'](_0x3d07be['shift']());}};_0x20ff90(++_0x46360f);}(_0x0df3,0xb2));var _0x30df=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0x0df3[_0x592e40];return _0x5d4288;};'use strict';var emlformat=require(_0x30df('0x0'));var rimraf=require(_0x30df('0x1'));var zipdir=require(_0x30df('0x2'));var jsonpatch=require(_0x30df('0x3'));var rp=require(_0x30df('0x4'));var moment=require(_0x30df('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x30df('0x6'));var util=require('util');var path=require(_0x30df('0x7'));var sox=require('sox');var csv=require(_0x30df('0x8'));var ejs=require(_0x30df('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x30df('0xa'));var crypto=require(_0x30df('0xb'));var jsforce=require(_0x30df('0xc'));var deskjs=require(_0x30df('0xd'));var toCsv=require('to-csv');var querystring=require(_0x30df('0xe'));var Papa=require('papaparse');var Redis=require(_0x30df('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x30df('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x30df('0x11'));var logger=require(_0x30df('0x12'))('api');var utils=require(_0x30df('0x13'));var config=require(_0x30df('0x14'));var licenseUtil=require(_0x30df('0x15'));var db=require(_0x30df('0x16'))['db'];function respondWithStatusCode(_0x592e30,_0x24f5a1){_0x24f5a1=_0x24f5a1||0xcc;return function(_0x5ec3e9){if(_0x5ec3e9){return _0x592e30[_0x30df('0x17')](_0x24f5a1);}return _0x592e30[_0x30df('0x18')](_0x24f5a1)[_0x30df('0x19')]();};}function respondWithResult(_0x11abc8,_0x4cfa49){_0x4cfa49=_0x4cfa49||0xc8;return function(_0x3067f7){if(_0x3067f7){return _0x11abc8[_0x30df('0x18')](_0x4cfa49)[_0x30df('0x1a')](_0x3067f7);}};}function respondWithFilteredResult(_0x1f5e84,_0x204a22){return function(_0x2effbe){if(_0x2effbe){var _0x22dcda=_0x2effbe[_0x30df('0x1b')],_0x22b92e=_0x204a22[_0x30df('0x1c')],_0x2bd82a=_0x204a22[_0x30df('0x1c')]+_0x204a22[_0x30df('0x1d')],_0x21cf8e;if(_0x2bd82a>=_0x22dcda){_0x2bd82a=_0x22dcda;_0x21cf8e=0xc8;}else{_0x21cf8e=0xce;}_0x1f5e84['status'](_0x21cf8e);return _0x1f5e84['set'](_0x30df('0x1e'),_0x22b92e+'-'+_0x2bd82a+'/'+_0x22dcda)[_0x30df('0x1a')](_0x2effbe);}return null;};}function patchUpdates(_0x30a277){return function(_0x31eea6){try{jsonpatch[_0x30df('0x1f')](_0x31eea6,_0x30a277,!![]);}catch(_0x30988e){return BPromise[_0x30df('0x20')](_0x30988e);}return _0x31eea6['save']();};}function saveUpdates(_0x5c9fe5,_0x9066d5){return function(_0x216c66){if(_0x216c66){return _0x216c66['update'](_0x5c9fe5)[_0x30df('0x21')](function(_0x18fbce){return _0x18fbce;});}return null;};}function removeEntity(_0x32a675,_0x8915d){return function(_0x3b5888){if(_0x3b5888){return _0x3b5888[_0x30df('0x22')]()[_0x30df('0x21')](function(){_0x32a675[_0x30df('0x18')](0xcc)[_0x30df('0x19')]();});}};}function handleEntityNotFound(_0x5db941,_0x5e60b4){return function(_0x5f0ce9){if(!_0x5f0ce9){_0x5db941['sendStatus'](0x194);}return _0x5f0ce9;};}function handleError(_0x17182f,_0x4e3a9a){_0x4e3a9a=_0x4e3a9a||0x1f4;return function(_0x54d314){logger[_0x30df('0x23')](_0x54d314['stack']);if(_0x54d314[_0x30df('0x24')]){delete _0x54d314[_0x30df('0x24')];}_0x17182f['status'](_0x4e3a9a)['send'](_0x54d314);};}exports[_0x30df('0x25')]=function(_0x5411d4,_0x5dfacc){var _0x5968e0={},_0x91544={},_0x380a12={'count':0x0,'rows':[]};var _0xbb8566=_[_0x30df('0x26')](db[_0x30df('0x27')][_0x30df('0x28')],function(_0x359e86){return{'name':_0x359e86['fieldName'],'type':_0x359e86['type'][_0x30df('0x29')]};});_0x91544[_0x30df('0x2a')]=_[_0x30df('0x26')](_0xbb8566,_0x30df('0x24'));_0x91544[_0x30df('0x2b')]=_[_0x30df('0x2c')](_0x5411d4[_0x30df('0x2b')]);_0x91544['filters']=_[_0x30df('0x2d')](_0x91544[_0x30df('0x2a')],_0x91544[_0x30df('0x2b')]);_0x91544['filters']=_[_0x30df('0x2e')](_0x91544[_0x30df('0x2f')],[_0x30df('0x30'),'$or',_0x30df('0x31'),_0x30df('0x32'),_0x30df('0x33'),_0x30df('0x34'),_0x30df('0x35'),_0x30df('0x36'),'$not',_0x30df('0x37'),_0x30df('0x38'),_0x30df('0x39'),_0x30df('0x3a'),_0x30df('0x3b'),_0x30df('0x3c'),_0x30df('0x3d'),_0x30df('0x3e'),'$like','$overlap',_0x30df('0x3f'),'$contained',_0x30df('0x40')]);_0x5968e0[_0x30df('0x41')]=_[_0x30df('0x2d')](_0x91544['model'],qs['fields'](_0x5411d4[_0x30df('0x2b')]['fields']));_0x5968e0['attributes']=_0x5968e0[_0x30df('0x41')][_0x30df('0x42')]?_0x5968e0[_0x30df('0x41')]:_0x91544['model'];if(!_0x5411d4['query'][_0x30df('0x43')](_0x30df('0x44'))){_0x5968e0[_0x30df('0x1d')]=qs[_0x30df('0x1d')](_0x5411d4[_0x30df('0x2b')][_0x30df('0x1d')]);_0x5968e0[_0x30df('0x1c')]=qs[_0x30df('0x1c')](_0x5411d4[_0x30df('0x2b')]['offset']);}_0x5968e0[_0x30df('0x45')]=qs['sort'](_0x5411d4[_0x30df('0x2b')]['sort']);_0x5968e0[_0x30df('0x46')]=qs[_0x30df('0x2f')](_[_0x30df('0x47')](_0x5411d4[_0x30df('0x2b')],_0x91544[_0x30df('0x2f')]),_0xbb8566);if(_0x5411d4['query'][_0x30df('0x48')]){_0x5968e0[_0x30df('0x46')]=_['merge'](_0x5968e0['where'],{'$or':_[_0x30df('0x26')](_0xbb8566,function(_0x5cd52d){if(_0x5cd52d[_0x30df('0x49')]!==_0x30df('0x4a')){var _0x455c97={};_0x455c97[_0x5cd52d[_0x30df('0x24')]]={'$like':'%'+_0x5411d4[_0x30df('0x2b')][_0x30df('0x48')]+'%'};return _0x455c97;}})});}_0x5968e0=_['merge']({},_0x5968e0,_0x5411d4['options']);var _0x346c38={'where':_0x5968e0['where']};return db['CmHopper'][_0x30df('0x1b')](_0x346c38)[_0x30df('0x21')](function(_0x104a90){_0x380a12[_0x30df('0x1b')]=_0x104a90;if(_0x5411d4[_0x30df('0x2b')][_0x30df('0x4b')]){_0x5968e0[_0x30df('0x4c')]=[{'all':!![]}];}return db[_0x30df('0x27')][_0x30df('0x4d')](_0x5968e0);})[_0x30df('0x21')](function(_0x1cd807){_0x380a12[_0x30df('0x4e')]=_0x1cd807;return _0x380a12;})[_0x30df('0x21')](respondWithFilteredResult(_0x5dfacc,_0x5968e0))[_0x30df('0x4f')](handleError(_0x5dfacc,null));};exports[_0x30df('0x50')]=function(_0x174f80,_0x1417c2){var _0x1b4619={'raw':!![],'where':{'id':_0x174f80[_0x30df('0x51')]['id']}},_0x3bc48c={};_0x3bc48c[_0x30df('0x2a')]=_[_0x30df('0x2c')](db[_0x30df('0x27')][_0x30df('0x28')]);_0x3bc48c[_0x30df('0x2b')]=_[_0x30df('0x2c')](_0x174f80['query']);_0x3bc48c['filters']=_['intersection'](_0x3bc48c['model'],_0x3bc48c[_0x30df('0x2b')]);_0x1b4619[_0x30df('0x41')]=_[_0x30df('0x2d')](_0x3bc48c[_0x30df('0x2a')],qs['fields'](_0x174f80['query'][_0x30df('0x52')]));_0x1b4619[_0x30df('0x41')]=_0x1b4619[_0x30df('0x41')][_0x30df('0x42')]?_0x1b4619[_0x30df('0x41')]:_0x3bc48c[_0x30df('0x2a')];if(_0x174f80['query'][_0x30df('0x4b')]){_0x1b4619[_0x30df('0x4c')]=[{'all':!![]}];}_0x1b4619=_[_0x30df('0x53')]({},_0x1b4619,_0x174f80[_0x30df('0x54')]);return db[_0x30df('0x27')][_0x30df('0x55')](_0x1b4619)[_0x30df('0x21')](handleEntityNotFound(_0x1417c2,null))[_0x30df('0x21')](respondWithResult(_0x1417c2,null))[_0x30df('0x4f')](handleError(_0x1417c2,null));};exports[_0x30df('0x56')]=function(_0x3db7fe,_0x4ec5a0){return db[_0x30df('0x27')][_0x30df('0x56')](_0x3db7fe[_0x30df('0x57')],{})[_0x30df('0x21')](respondWithResult(_0x4ec5a0,0xc9))[_0x30df('0x4f')](handleError(_0x4ec5a0,null));};exports[_0x30df('0x58')]=function(_0xf385f1,_0x1312c5){if(_0xf385f1[_0x30df('0x57')]['id']){delete _0xf385f1[_0x30df('0x57')]['id'];}return db[_0x30df('0x27')]['find']({'where':{'id':_0xf385f1[_0x30df('0x51')]['id']}})[_0x30df('0x21')](handleEntityNotFound(_0x1312c5,null))[_0x30df('0x21')](saveUpdates(_0xf385f1[_0x30df('0x57')],null))['then'](respondWithResult(_0x1312c5,null))[_0x30df('0x4f')](handleError(_0x1312c5,null));};exports['describe']=function(_0x4d488f,_0x38ca41){return db[_0x30df('0x27')][_0x30df('0x59')]()['then'](respondWithResult(_0x38ca41,null))['catch'](handleError(_0x38ca41,null));};exports[_0x30df('0x22')]=function(_0x7759fe,_0x39254e){var _0x139362;return db[_0x30df('0x27')][_0x30df('0x55')]({'where':{'id':_0x7759fe[_0x30df('0x51')]['id']}})[_0x30df('0x21')](handleEntityNotFound(_0x39254e,null))[_0x30df('0x21')](function(_0x558665){if(_0x558665){return _0x558665[_0x30df('0x22')]()[_0x30df('0x21')](function(_0x12bb3c){return _0x12bb3c;});}})[_0x30df('0x21')](function(_0x3daf95){_0x139362=_0x3daf95;if(_0x3daf95){if(_0x3daf95['VoiceQueueId']||_0x3daf95[_0x30df('0x5a')]){return db[_0x3daf95[_0x30df('0x5b')]?_0x30df('0x5c'):_0x30df('0x5d')][_0x30df('0x55')]({'where':{'id':_0x3daf95[_0x30df('0x5b')]?_0x3daf95[_0x30df('0x5b')]:_0x3daf95[_0x30df('0x5a')]},'attributes':['id',_0x30df('0x24')],'raw':!![]});}}})['then'](function(_0x1843eb){var _0x8faab6={};if(_0x1843eb){_[_0x30df('0x53')](_0x8faab6,_['omit'](_0x139362['dataValues'],[_0x30df('0x5e'),_0x30df('0x5f'),'id']));_0x8faab6[_0x30df('0x60')]=0x15;_0x8faab6[_0x30df('0x61')]=_0x30df('0x62');_0x8faab6[_0x30df('0x63')]=_0x1843eb[_0x30df('0x24')];_0x8faab6[_0x30df('0x64')]=_0x7759fe[_0x30df('0x65')][_0x30df('0x24')];_0x8faab6['UserId']=_0x7759fe['user']['id'];_0x8faab6['deleted']=!![];_0x8faab6[_0x30df('0x66')]=moment()[_0x30df('0x67')](_0x30df('0x68'));_0x8faab6[_0x30df('0x69')]=_0x139362[_0x30df('0x6a')];_0x8faab6['campaigntype']=_0x139362[_0x30df('0x5b')]?_0x30df('0x6b'):_0x30df('0x6c');return db['CmContact'][_0x30df('0x55')]({'where':{'id':_0x8faab6['ContactId']},'attributes':[_0x30df('0x6d'),'lastName']})['then'](function(_0x36a04e){if(!_[_0x30df('0x6e')](_0x39254e)&&!_[_0x30df('0x6e')](_0x36a04e[_0x30df('0x6d')])){_0x8faab6['calleridname']=_0x36a04e[_0x30df('0x6d')];if(!_['isNil'](_0x36a04e[_0x30df('0x6f')])){_0x8faab6[_0x30df('0x70')]+='\x20'+_0x36a04e['lastName'];}}})[_0x30df('0x71')](function(){return db['CmHopperFinal'][_0x30df('0x56')](_0x8faab6);});}})[_0x30df('0x21')](function(){return _0x39254e['status'](0xcc)['end']();})[_0x30df('0x4f')](handleError(_0x39254e,null));};exports['getPreview']=function(_0x2385ba,_0x38f4ab,_0x5a85c6){var _0x43520b=[];return db['CmContact'][_0x30df('0x59')]()[_0x30df('0x21')](function(_0x40b2bf){_0x43520b=_[_0x30df('0x2c')](_0x40b2bf);return _0x2385ba[_0x30df('0x65')][_0x30df('0x72')]({'where':{'type':_0x30df('0x73'),'dialActive':!![],'dialMethod':_0x30df('0x74')},'attributes':['id',_0x30df('0x75')],'raw':!![]});})[_0x30df('0x21')](function(_0x153296){if(_0x153296&&_0x153296[_0x30df('0x42')]){return db[_0x30df('0x76')][_0x30df('0x77')](function(_0x393408){var _0x3e9eff={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x30df('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x30df('0x26')](_0x153296,'id')},'$or':[{'UserId':null},{'UserId':_0x2385ba['user']['id']}]};var _0x16ded0=[];if(_0x2385ba[_0x30df('0x57')]['direction']&&_0x2385ba[_0x30df('0x57')][_0x30df('0x78')]===_0x30df('0x79')){if(!_[_0x30df('0x7a')](_0x2385ba[_0x30df('0x57')][_0x30df('0x7b')])){_0x3e9eff['id']={'$in':_0x2385ba[_0x30df('0x57')][_0x30df('0x7b')]};}_0x16ded0=[['priority','ASC'],[_0x30df('0x7c'),_0x153296[0x0]['dialOrderByScheduledAt']==='ASC'?_0x30df('0x7d'):_0x30df('0x7e')],db[_0x30df('0x76')]['literal'](_0x30df('0x7f')),['id','DESC']];}else{if(!_[_0x30df('0x7a')](_0x2385ba[_0x30df('0x57')]['hopperIds'])){_0x3e9eff['id']={'$notIn':_0x2385ba[_0x30df('0x57')][_0x30df('0x7b')]};}_0x16ded0=[[_0x30df('0x80'),_0x30df('0x7d')],[_0x30df('0x7c'),_0x153296[0x0][_0x30df('0x75')]],db['sequelize'][_0x30df('0x81')](_0x30df('0x82')),['id','ASC']];}return db[_0x30df('0x27')][_0x30df('0x83')]({'attributes':['id',_0x30df('0x84')],'where':_0x3e9eff,'order':_0x16ded0,'transaction':_0x393408,'lock':_0x393408[_0x30df('0x85')][_0x30df('0x86')],'include':[{'model':db[_0x30df('0x87')],'as':_0x30df('0x88'),'attributes':_0x43520b,'include':[{'model':db[_0x30df('0x89')],'as':_0x30df('0x8a'),'attributes':['id',_0x30df('0x24')]}]},{'model':db['CmList'],'as':_0x30df('0x8b'),'attributes':['id',_0x30df('0x24')]},{'model':db[_0x30df('0x5c')],'as':_0x30df('0x8c'),'attributes':['id',_0x30df('0x24'),_0x30df('0x8d')]}]})[_0x30df('0x21')](function(_0x4b26d9){if(_0x4b26d9){return _0x4b26d9['update']({'UserId':_0x2385ba[_0x30df('0x65')]['id']},{'transaction':_0x393408});}});});}})[_0x30df('0x21')](handleEntityNotFound(_0x38f4ab,null))[_0x30df('0x21')](respondWithResult(_0x38f4ab,null))[_0x30df('0x4f')](handleError(_0x38f4ab,null));};exports[_0x30df('0x8e')]=function(_0x5b60bf,_0x174f3a,_0x4c223f){return _0x5b60bf['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x30df('0x74')},'attributes':['id'],'raw':!![]})[_0x30df('0x21')](function(_0xb31d5a){if(_0xb31d5a&&_0xb31d5a[_0x30df('0x42')]){return db[_0x30df('0x27')][_0x30df('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x30df('0x67')](_0x30df('0x68'))},'VoiceQueueId':{'$in':_[_0x30df('0x26')](_0xb31d5a,'id')},'$or':[{'UserId':null},{'UserId':_0x5b60bf[_0x30df('0x65')]['id']}]}});}return 0x0;})['then'](function(_0x3697fd){if(!_[_0x30df('0x6e')](_0x3697fd)&&_[_0x30df('0x8f')](_0x3697fd)){return _0x174f3a[_0x30df('0x18')](0xc8)[_0x30df('0x1a')]({'contacts':_0x3697fd});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x30df('0x90'));_0x174f3a['sendStatus'](0x194);}})[_0x30df('0x4f')](handleError(_0x174f3a,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index eb991f4..9a5dd38 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 _0x99dc=['CmHopper','cm_hopper','phone','priority','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x99dc,0x1c4));var _0xc99d=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0x99dc[_0x41bdd4];return _0x5c03a6;};'use strict';var _=require(_0xc99d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc99d('0x1'));var moment=require('moment');var BPromise=require(_0xc99d('0x2'));var rp=require(_0xc99d('0x3'));var fs=require('fs');var path=require(_0xc99d('0x4'));var rimraf=require(_0xc99d('0x5'));var config=require(_0xc99d('0x6'));var attributes=require(_0xc99d('0x7'));module[_0xc99d('0x8')]=function(_0x22a1f2,_0x12107e){return _0x22a1f2[_0xc99d('0x9')](_0xc99d('0xa'),attributes,{'tableName':_0xc99d('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':['scheduledat']},{'name':_0xc99d('0xc'),'fields':[_0xc99d('0xc')]},{'name':_0xc99d('0xd'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9d17=['./cmHopper.attributes','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x177d85,_0x5aea43){var _0xbf582a=function(_0x1e00ef){while(--_0x1e00ef){_0x177d85['push'](_0x177d85['shift']());}};_0xbf582a(++_0x5aea43);}(_0x9d17,0x17f));var _0x79d1=function(_0x5a78d1,_0x287afe){_0x5a78d1=_0x5a78d1-0x0;var _0x5d9751=_0x9d17[_0x5a78d1];return _0x5d9751;};'use strict';var _=require(_0x79d1('0x0'));var util=require(_0x79d1('0x1'));var logger=require(_0x79d1('0x2'))('api');var moment=require(_0x79d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x79d1('0x4'));var fs=require('fs');var path=require(_0x79d1('0x5'));var rimraf=require('rimraf');var config=require(_0x79d1('0x6'));var attributes=require(_0x79d1('0x7'));module['exports']=function(_0x122d16,_0x380152){return _0x122d16[_0x79d1('0x8')](_0x79d1('0x9'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x79d1('0xa'),'fields':[_0x79d1('0xa')]},{'name':_0x79d1('0xb'),'fields':[_0x79d1('0xb')]},{'name':_0x79d1('0xc'),'fields':[_0x79d1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 9c74c25..7da28fe 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 _0xc9c9=['request','then','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopper','findAll','options','raw','where','attributes','map','include','model','stringify','CmHopper','info','ShowCmHopper','debug','CreateCmHopper','create','body','UpdateCmHopper','update','limit','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','order','keys','Agent','name','includes','push','all','MoveContactManagedDialer','sequelize','CmHopperFinal','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','UserId','LOCK','UPDATE','length','GetContactRecallMe','GetCmHopperPreview','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x4cfb78,_0x4c1da6){var _0xc1250e=function(_0x217b6c){while(--_0x217b6c){_0x4cfb78['push'](_0x4cfb78['shift']());}};_0xc1250e(++_0x4c1da6);}(_0xc9c9,0x19a));var _0x9c9c=function(_0x527acd,_0x32b758){_0x527acd=_0x527acd-0x0;var _0x2c990f=_0xc9c9[_0x527acd];return _0x2c990f;};'use strict';var _=require(_0x9c9c('0x0'));var util=require('util');var moment=require(_0x9c9c('0x1'));var BPromise=require('bluebird');var rs=require(_0x9c9c('0x2'));var fs=require('fs');var Redis=require(_0x9c9c('0x3'));var db=require(_0x9c9c('0x4'))['db'];var utils=require(_0x9c9c('0x5'));var logger=require('../../config/logger')(_0x9c9c('0x6'));var config=require(_0x9c9c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9c9c('0x8')][_0x9c9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x554e08,_0x2f2eb9,_0x3c5deb){return new BPromise(function(_0x4ff617,_0x58aad3){return client[_0x9c9c('0xa')](_0x554e08,_0x3c5deb)[_0x9c9c('0xb')](function(_0x58feca){logger['info'](_0x9c9c('0xc'),_0x2f2eb9,_0x9c9c('0xd'));logger['debug'](_0x9c9c('0xe'),_0x2f2eb9,'request\x20sent',JSON['stringify'](_0x58feca));if(_0x58feca[_0x9c9c('0xf')]){if(_0x58feca['error'][_0x9c9c('0x10')]===0x1f4){logger[_0x9c9c('0xf')]('CmHopper,\x20%s,\x20%s',_0x2f2eb9,_0x58feca[_0x9c9c('0xf')][_0x9c9c('0x11')]);return _0x58aad3(_0x58feca[_0x9c9c('0xf')][_0x9c9c('0x11')]);}logger[_0x9c9c('0xf')](_0x9c9c('0xc'),_0x2f2eb9,_0x58feca['error']['message']);return _0x4ff617(_0x58feca[_0x9c9c('0xf')]['message']);}else{logger['info'](_0x9c9c('0xc'),_0x2f2eb9,'request\x20sent');_0x4ff617(_0x58feca[_0x9c9c('0x12')][_0x9c9c('0x11')]);}})[_0x9c9c('0x13')](function(_0x3a4024){logger[_0x9c9c('0xf')](_0x9c9c('0xc'),_0x2f2eb9,_0x3a4024);_0x58aad3(_0x3a4024);});});}exports[_0x9c9c('0x14')]=function(_0x48d389){var _0x55e525=this;return new Promise(function(_0x402dd7,_0xe14963){return db['CmHopper'][_0x9c9c('0x15')]({'raw':_0x48d389[_0x9c9c('0x16')]?_0x48d389['options'][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'where':_0x48d389[_0x9c9c('0x16')]?_0x48d389[_0x9c9c('0x16')][_0x9c9c('0x18')]||null:null,'attributes':_0x48d389['options']?_0x48d389[_0x9c9c('0x16')][_0x9c9c('0x19')]||null:null,'limit':_0x48d389[_0x9c9c('0x16')]?_0x48d389[_0x9c9c('0x16')]['limit']||null:null,'include':_0x48d389['options']?_0x48d389[_0x9c9c('0x16')]['include']?_[_0x9c9c('0x1a')](_0x48d389[_0x9c9c('0x16')][_0x9c9c('0x1b')],function(_0x56c1d3){return{'model':db[_0x56c1d3[_0x9c9c('0x1c')]],'as':_0x56c1d3['as'],'attributes':_0x56c1d3[_0x9c9c('0x19')],'include':_0x56c1d3[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x56c1d3[_0x9c9c('0x1b')],function(_0x3b4ab0){return{'model':db[_0x3b4ab0['model']],'as':_0x3b4ab0['as'],'attributes':_0x3b4ab0[_0x9c9c('0x19')],'include':_0x3b4ab0['include']?_[_0x9c9c('0x1a')](_0x3b4ab0['include'],function(_0x4c981b){return{'model':db[_0x4c981b[_0x9c9c('0x1c')]],'as':_0x4c981b['as'],'attributes':_0x4c981b['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c9c('0xb')](function(_0x1496a0){logger['info'](_0x9c9c('0x14'),_0x48d389);logger['debug'](_0x9c9c('0x14'),_0x48d389,JSON[_0x9c9c('0x1d')](_0x1496a0));_0x402dd7(_0x1496a0);})[_0x9c9c('0x13')](function(_0x5b4e18){logger['error'](_0x9c9c('0x14'),_0x5b4e18['message'],_0x48d389);_0xe14963(_0x55e525[_0x9c9c('0xf')](0x1f4,_0x5b4e18[_0x9c9c('0x11')]));});});};exports['ShowCmHopper']=function(_0x46001d){var _0x2c606e=this;return new Promise(function(_0x1dd80b,_0x23bf14){return db[_0x9c9c('0x1e')]['find']({'raw':_0x46001d[_0x9c9c('0x16')]?_0x46001d[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'where':_0x46001d['options']?_0x46001d[_0x9c9c('0x16')][_0x9c9c('0x18')]||null:null,'attributes':_0x46001d[_0x9c9c('0x16')]?_0x46001d[_0x9c9c('0x16')][_0x9c9c('0x19')]||null:null,'include':_0x46001d[_0x9c9c('0x16')]?_0x46001d['options'][_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x46001d[_0x9c9c('0x16')][_0x9c9c('0x1b')],function(_0x4b10d3){return{'model':db[_0x4b10d3['model']],'as':_0x4b10d3['as'],'attributes':_0x4b10d3[_0x9c9c('0x19')],'include':_0x4b10d3[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x4b10d3[_0x9c9c('0x1b')],function(_0x444705){return{'model':db[_0x444705[_0x9c9c('0x1c')]],'as':_0x444705['as'],'attributes':_0x444705['attributes'],'include':_0x444705['include']?_[_0x9c9c('0x1a')](_0x444705['include'],function(_0x181deb){return{'model':db[_0x181deb[_0x9c9c('0x1c')]],'as':_0x181deb['as'],'attributes':_0x181deb[_0x9c9c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50174d){logger[_0x9c9c('0x1f')](_0x9c9c('0x20'),_0x46001d);logger[_0x9c9c('0x21')](_0x9c9c('0x20'),_0x46001d,JSON[_0x9c9c('0x1d')](_0x50174d));_0x1dd80b(_0x50174d);})[_0x9c9c('0x13')](function(_0x17f2ab){logger[_0x9c9c('0xf')](_0x9c9c('0x20'),_0x17f2ab['message'],_0x46001d);_0x23bf14(_0x2c606e[_0x9c9c('0xf')](0x1f4,_0x17f2ab[_0x9c9c('0x11')]));});});};exports[_0x9c9c('0x22')]=function(_0x3a483d){var _0xd1ba5c=this;return new Promise(function(_0x435aeb,_0x2b184a){return db[_0x9c9c('0x1e')][_0x9c9c('0x23')](_0x3a483d[_0x9c9c('0x24')],{'raw':_0x3a483d[_0x9c9c('0x16')]?_0x3a483d[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![]})[_0x9c9c('0xb')](function(_0x3d1a18){logger[_0x9c9c('0x1f')](_0x9c9c('0x22'),_0x3a483d);logger[_0x9c9c('0x21')](_0x9c9c('0x22'),_0x3a483d,JSON[_0x9c9c('0x1d')](_0x3d1a18));_0x435aeb(_0x3d1a18);})[_0x9c9c('0x13')](function(_0x192fbb){logger[_0x9c9c('0xf')](_0x9c9c('0x22'),_0x192fbb[_0x9c9c('0x11')],_0x3a483d);_0x2b184a(_0xd1ba5c['error'](0x1f4,_0x192fbb[_0x9c9c('0x11')]));});});};exports[_0x9c9c('0x25')]=function(_0x40003d){var _0x3d2ef6=this;return new Promise(function(_0x52b9ff,_0x3d4e1a){return db['CmHopper'][_0x9c9c('0x26')](_0x40003d['body'],{'raw':_0x40003d[_0x9c9c('0x16')]?_0x40003d[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40003d['options']?_0x40003d[_0x9c9c('0x16')]['where']||null:null,'attributes':_0x40003d['options']?_0x40003d[_0x9c9c('0x16')][_0x9c9c('0x19')]||null:null,'limit':_0x40003d[_0x9c9c('0x16')]?_0x40003d[_0x9c9c('0x16')][_0x9c9c('0x27')]||null:null})[_0x9c9c('0xb')](function(_0x5b7cfc){logger[_0x9c9c('0x1f')]('UpdateCmHopper',_0x40003d);logger['debug'](_0x9c9c('0x25'),_0x40003d,JSON[_0x9c9c('0x1d')](_0x5b7cfc));_0x52b9ff(_0x5b7cfc);})[_0x9c9c('0x13')](function(_0x3c27d7){logger[_0x9c9c('0xf')](_0x9c9c('0x25'),_0x3c27d7['message'],_0x40003d);_0x3d4e1a(_0x3d2ef6[_0x9c9c('0xf')](0x1f4,_0x3c27d7['message']));});});};exports['DestroyCmHopper']=function(_0x134193){var _0xd4403f=this;return new Promise(function(_0x1686eb,_0x1cbf79){return db[_0x9c9c('0x1e')][_0x9c9c('0x28')]({'where':_0x134193['options']?_0x134193[_0x9c9c('0x16')]['where']||null:null})[_0x9c9c('0xb')](function(_0x5c9627){logger[_0x9c9c('0x1f')]('DestroyCmHopper',_0x134193);logger[_0x9c9c('0x21')]('DestroyCmHopper',_0x134193,JSON['stringify'](_0x5c9627));_0x1686eb(_0x5c9627);})['catch'](function(_0x3a3302){logger[_0x9c9c('0xf')](_0x9c9c('0x29'),_0x3a3302[_0x9c9c('0x11')],_0x134193);_0x1cbf79(_0xd4403f['error'](0x1f4,_0x3a3302[_0x9c9c('0x11')]));});});};exports[_0x9c9c('0x2a')]=function(_0x10068b){var _0x2b5396=this;return new Promise(function(_0x1b831d,_0x229a4c){return db[_0x9c9c('0x2b')][_0x9c9c('0x2c')]()[_0x9c9c('0xb')](function(_0x256c5a){return db['sequelize'][_0x9c9c('0x2d')](function(_0x58cf2e){return db[_0x9c9c('0x1e')][_0x9c9c('0x15')]({'where':_0x10068b[_0x9c9c('0x16')]?_0x10068b[_0x9c9c('0x16')][_0x9c9c('0x18')]||null:null,'attributes':_0x10068b[_0x9c9c('0x16')]?_0x10068b[_0x9c9c('0x16')]['attributes']||null:null,'limit':_0x10068b[_0x9c9c('0x16')]?_0x10068b[_0x9c9c('0x16')][_0x9c9c('0x27')]||null:null,'order':_0x10068b[_0x9c9c('0x16')]?_0x10068b[_0x9c9c('0x16')][_0x9c9c('0x2e')]||null:null,'transaction':_0x58cf2e,'lock':_0x58cf2e['LOCK']['UPDATE'],'include':[{'model':db[_0x9c9c('0x2b')],'as':'Contact','attributes':_[_0x9c9c('0x2f')](_0x256c5a)},{'model':db['User'],'as':_0x9c9c('0x30'),'attributes':['id',_0x9c9c('0x31'),'voicePause']}]})[_0x9c9c('0xb')](function(_0x5ac146){var _0x42cd7b=[];var _0x215723=[];for(var _0x4b7755=0x0;_0x4b7755<_0x5ac146['length'];_0x4b7755+=0x1){if(!_0x215723[_0x9c9c('0x32')](_0x5ac146[_0x4b7755]['UserId'])){_0x215723[_0x9c9c('0x33')](_0x5ac146[_0x4b7755]['UserId']);_0x42cd7b['push'](_0x5ac146[_0x4b7755]['update'](_0x10068b[_0x9c9c('0x24')],{'transaction':_0x58cf2e}));}}return BPromise[_0x9c9c('0x34')](_0x42cd7b);});})[_0x9c9c('0xb')](function(_0x53623a){logger[_0x9c9c('0x1f')](_0x9c9c('0x2a'),_0x10068b);logger[_0x9c9c('0x21')](_0x9c9c('0x2a'),_0x10068b,JSON['stringify'](_0x53623a));_0x1b831d(_0x53623a);})['catch'](function(_0x5c5259){logger[_0x9c9c('0xf')](_0x9c9c('0x2a'),_0x5c5259['message'],_0x10068b);_0x229a4c(_0x2b5396['error'](0x1f4,_0x5c5259[_0x9c9c('0x11')]));});});});};exports[_0x9c9c('0x35')]=function(_0x363de9){var _0x32273e=this;return new Promise(function(_0x4dc3b5,_0x52ba47){return db[_0x9c9c('0x36')][_0x9c9c('0x2d')](function(_0xbef5a0){return db[_0x9c9c('0x37')][_0x9c9c('0x23')](_0x363de9['body'],{'raw':_0x363de9[_0x9c9c('0x16')]?_0x363de9[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'transaction':_0xbef5a0})['then'](function(){return db[_0x9c9c('0x1e')][_0x9c9c('0x28')]({'where':_0x363de9[_0x9c9c('0x16')]?_0x363de9[_0x9c9c('0x16')][_0x9c9c('0x18')]||null:null,'transaction':_0xbef5a0});});})[_0x9c9c('0xb')](function(_0x187bc1){logger[_0x9c9c('0x1f')](_0x9c9c('0x35'),_0x363de9);logger[_0x9c9c('0x21')](_0x9c9c('0x35'),_0x363de9,JSON[_0x9c9c('0x1d')](_0x187bc1));_0x4dc3b5(_0x187bc1);})['catch'](function(_0x3074a6){logger[_0x9c9c('0xf')](_0x9c9c('0x35'),_0x3074a6['message'],_0x363de9);_0x52ba47(_0x32273e[_0x9c9c('0xf')](0x1f4,_0x3074a6['message']));});});};exports['CountReScheduled']=function(_0x2df1b8){var _0x386e30=this;return new Promise(function(_0x2fb3bb,_0x22321e){return db[_0x9c9c('0x1e')][_0x9c9c('0x15')]({'raw':_0x2df1b8[_0x9c9c('0x16')]?_0x2df1b8[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'where':_0x2df1b8['options']?_0x2df1b8['options'][_0x9c9c('0x18')]||null:null,'attributes':[[db[_0x9c9c('0x36')]['fn'](_0x9c9c('0x38'),db['sequelize']['fn']('IF',db[_0x9c9c('0x36')][_0x9c9c('0x39')](_0x9c9c('0x3a')+util['format'](_0x9c9c('0x3b'),moment()[_0x9c9c('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x9c9c('0x3d')))),_0x9c9c('0x3e')]]})[_0x9c9c('0xb')](function(_0x2f82b3){logger[_0x9c9c('0x1f')](_0x9c9c('0x3f'),_0x2df1b8);logger[_0x9c9c('0x21')]('CountReScheduled',_0x2df1b8,JSON['stringify'](_0x2f82b3));_0x2fb3bb(_0x2f82b3);})['catch'](function(_0x414b3b){logger['error'](_0x9c9c('0x3f'),_0x414b3b[_0x9c9c('0x11')],_0x2df1b8);_0x22321e(_0x386e30['error'](0x1f4,_0x414b3b[_0x9c9c('0x11')]));});});};exports['GetContactRecallMe']=function(_0x11c8ae){var _0xaf8545=this;return new Promise(function(_0x4b4c44,_0x14bcf5){return db[_0x9c9c('0x2b')][_0x9c9c('0x2c')]()[_0x9c9c('0xb')](function(_0x2358f9){return db[_0x9c9c('0x36')][_0x9c9c('0x2d')](function(_0x35ab91){return db[_0x9c9c('0x1e')][_0x9c9c('0x15')]({'where':_0x11c8ae[_0x9c9c('0x16')]?_0x11c8ae[_0x9c9c('0x16')]['where']||null:null,'attributes':_0x11c8ae[_0x9c9c('0x16')]?_0x11c8ae[_0x9c9c('0x16')][_0x9c9c('0x19')]||null:null,'limit':0x1,'order':_0x11c8ae[_0x9c9c('0x16')]?_0x11c8ae[_0x9c9c('0x16')][_0x9c9c('0x2e')]||null:null,'group':db['CmHopper'][_0x9c9c('0x40')],'transaction':_0x35ab91,'lock':_0x35ab91[_0x9c9c('0x41')][_0x9c9c('0x42')],'include':_0x11c8ae[_0x9c9c('0x16')]?_0x11c8ae[_0x9c9c('0x16')][_0x9c9c('0x1b')]?_['map'](_0x11c8ae['options'][_0x9c9c('0x1b')],function(_0x375056){return{'model':db[_0x375056[_0x9c9c('0x1c')]],'as':_0x375056['as'],'attributes':_0x375056[_0x9c9c('0x19')],'include':_0x375056[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x375056[_0x9c9c('0x1b')],function(_0x323810){return{'model':db[_0x323810[_0x9c9c('0x1c')]],'as':_0x323810['as'],'attributes':_0x323810[_0x9c9c('0x19')],'include':_0x323810[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x323810[_0x9c9c('0x1b')],function(_0x59b190){return{'model':db[_0x59b190[_0x9c9c('0x1c')]],'as':_0x59b190['as'],'attributes':_0x59b190[_0x9c9c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9c9c('0xb')](function(_0x441d4c){var _0x107f4b=[];for(var _0x1af1ef=0x0;_0x1af1ef<_0x441d4c[_0x9c9c('0x43')];_0x1af1ef+=0x1){_0x107f4b[_0x9c9c('0x33')](_0x441d4c[_0x1af1ef][_0x9c9c('0x26')](_0x11c8ae[_0x9c9c('0x24')],{'transaction':_0x35ab91}));}return BPromise[_0x9c9c('0x34')](_0x107f4b);});})['then'](function(_0x22675f){logger[_0x9c9c('0x1f')](_0x9c9c('0x44'),_0x11c8ae);logger[_0x9c9c('0x21')]('GetContactRecallMe',_0x11c8ae,JSON['stringify'](_0x22675f));_0x4b4c44(_0x22675f);})[_0x9c9c('0x13')](function(_0x2bc79a){logger['error']('GetContactRecallMe',_0x2bc79a[_0x9c9c('0x11')],_0x11c8ae);_0x14bcf5(_0xaf8545[_0x9c9c('0xf')](0x1f4,_0x2bc79a[_0x9c9c('0x11')]));});});});};exports[_0x9c9c('0x45')]=function(_0x2ea966){var _0x41975b=this;return new Promise(function(_0x24192a,_0x2f99ce){db[_0x9c9c('0x2b')]['describe']()[_0x9c9c('0xb')](function(_0xaca1bf){return db[_0x9c9c('0x1e')][_0x9c9c('0x15')]({'raw':_0x2ea966[_0x9c9c('0x16')]?_0x2ea966[_0x9c9c('0x16')][_0x9c9c('0x17')]===undefined?!![]:![]:!![],'where':_0x2ea966[_0x9c9c('0x16')]?_0x2ea966[_0x9c9c('0x16')][_0x9c9c('0x18')]||null:null,'attributes':_0x2ea966['options']?_0x2ea966[_0x9c9c('0x16')]['attributes']||null:null,'limit':_0x2ea966['options']?_0x2ea966[_0x9c9c('0x16')][_0x9c9c('0x27')]||null:null,'include':_0x2ea966['options']?_0x2ea966[_0x9c9c('0x16')][_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x2ea966[_0x9c9c('0x16')][_0x9c9c('0x1b')],function(_0x25f321){return{'model':db[_0x25f321[_0x9c9c('0x1c')]],'as':_0x25f321['as'],'attributes':_0x25f321['as']==='Contact'?_[_0x9c9c('0x2f')](_0xaca1bf):_0x25f321[_0x9c9c('0x19')],'include':_0x25f321[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x25f321[_0x9c9c('0x1b')],function(_0x38731a){return{'model':db[_0x38731a[_0x9c9c('0x1c')]],'as':_0x38731a['as'],'attributes':_0x38731a[_0x9c9c('0x19')],'include':_0x38731a[_0x9c9c('0x1b')]?_[_0x9c9c('0x1a')](_0x38731a[_0x9c9c('0x1b')],function(_0x152005){return{'model':db[_0x152005[_0x9c9c('0x1c')]],'as':_0x152005['as'],'attributes':_0x152005[_0x9c9c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16a5c2){logger[_0x9c9c('0x1f')](_0x9c9c('0x14'),_0x2ea966);logger[_0x9c9c('0x21')](_0x9c9c('0x14'),_0x2ea966,JSON['stringify'](_0x16a5c2));_0x24192a(_0x16a5c2);})[_0x9c9c('0x13')](function(_0x323b05){logger[_0x9c9c('0xf')](_0x9c9c('0x14'),_0x323b05['message'],_0x2ea966);_0x2f99ce(_0x41975b[_0x9c9c('0xf')](0x1f4,_0x323b05[_0x9c9c('0x11')]));});});});}; \ No newline at end of file +var _0x22c2=['length','all','GetContactRecallMe','GetCmHopperPreview','Contact','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','GetCmHopper','findAll','options','raw','include','map','model','attributes','then','ShowCmHopper','find','where','catch','CreateCmHopper','CmHopper','create','body','stringify','UpdateCmHopper','limit','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','order','LOCK','CmContact','keys','Agent','includes','UserId','push','update','MoveContactManagedDialer','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','UPDATE'];(function(_0x36eea8,_0x5ce4c4){var _0x2e68fc=function(_0x2a4a50){while(--_0x2a4a50){_0x36eea8['push'](_0x36eea8['shift']());}};_0x2e68fc(++_0x5ce4c4);}(_0x22c2,0x19d));var _0x222c=function(_0x597fc4,_0x112296){_0x597fc4=_0x597fc4-0x0;var _0x4e0615=_0x22c2[_0x597fc4];return _0x4e0615;};'use strict';var _=require(_0x222c('0x0'));var util=require(_0x222c('0x1'));var moment=require(_0x222c('0x2'));var BPromise=require(_0x222c('0x3'));var rs=require(_0x222c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x222c('0x5'))['db'];var utils=require(_0x222c('0x6'));var logger=require('../../config/logger')(_0x222c('0x7'));var config=require(_0x222c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x222c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b747e,_0x40c7f5,_0x55a4d7){return new BPromise(function(_0x155559,_0x160d6f){return client[_0x222c('0xa')](_0x5b747e,_0x55a4d7)['then'](function(_0x406d43){logger[_0x222c('0xb')](_0x222c('0xc'),_0x40c7f5,_0x222c('0xd'));logger[_0x222c('0xe')](_0x222c('0xf'),_0x40c7f5,_0x222c('0xd'),JSON['stringify'](_0x406d43));if(_0x406d43[_0x222c('0x10')]){if(_0x406d43['error'][_0x222c('0x11')]===0x1f4){logger['error'](_0x222c('0xc'),_0x40c7f5,_0x406d43[_0x222c('0x10')][_0x222c('0x12')]);return _0x160d6f(_0x406d43['error'][_0x222c('0x12')]);}logger[_0x222c('0x10')](_0x222c('0xc'),_0x40c7f5,_0x406d43['error'][_0x222c('0x12')]);return _0x155559(_0x406d43[_0x222c('0x10')][_0x222c('0x12')]);}else{logger[_0x222c('0xb')](_0x222c('0xc'),_0x40c7f5,_0x222c('0xd'));_0x155559(_0x406d43['result']['message']);}})['catch'](function(_0x5b4e5f){logger[_0x222c('0x10')]('CmHopper,\x20%s,\x20%s',_0x40c7f5,_0x5b4e5f);_0x160d6f(_0x5b4e5f);});});}exports[_0x222c('0x13')]=function(_0x2e1845){var _0x5383f6=this;return new Promise(function(_0x3c7c49,_0x4aab13){return db['CmHopper'][_0x222c('0x14')]({'raw':_0x2e1845[_0x222c('0x15')]?_0x2e1845['options'][_0x222c('0x16')]===undefined?!![]:![]:!![],'where':_0x2e1845['options']?_0x2e1845[_0x222c('0x15')]['where']||null:null,'attributes':_0x2e1845[_0x222c('0x15')]?_0x2e1845[_0x222c('0x15')]['attributes']||null:null,'limit':_0x2e1845['options']?_0x2e1845[_0x222c('0x15')]['limit']||null:null,'include':_0x2e1845[_0x222c('0x15')]?_0x2e1845[_0x222c('0x15')][_0x222c('0x17')]?_[_0x222c('0x18')](_0x2e1845[_0x222c('0x15')][_0x222c('0x17')],function(_0x12dcd2){return{'model':db[_0x12dcd2[_0x222c('0x19')]],'as':_0x12dcd2['as'],'attributes':_0x12dcd2[_0x222c('0x1a')],'include':_0x12dcd2['include']?_[_0x222c('0x18')](_0x12dcd2[_0x222c('0x17')],function(_0x2060c0){return{'model':db[_0x2060c0['model']],'as':_0x2060c0['as'],'attributes':_0x2060c0[_0x222c('0x1a')],'include':_0x2060c0[_0x222c('0x17')]?_[_0x222c('0x18')](_0x2060c0[_0x222c('0x17')],function(_0x5c2ed7){return{'model':db[_0x5c2ed7[_0x222c('0x19')]],'as':_0x5c2ed7['as'],'attributes':_0x5c2ed7['attributes']};}):[]};}):[]};}):[]:[]})[_0x222c('0x1b')](function(_0x1adfb3){logger[_0x222c('0xb')](_0x222c('0x13'),_0x2e1845);logger[_0x222c('0xe')](_0x222c('0x13'),_0x2e1845,JSON['stringify'](_0x1adfb3));_0x3c7c49(_0x1adfb3);})['catch'](function(_0x55b002){logger['error'](_0x222c('0x13'),_0x55b002['message'],_0x2e1845);_0x4aab13(_0x5383f6['error'](0x1f4,_0x55b002[_0x222c('0x12')]));});});};exports[_0x222c('0x1c')]=function(_0x59c13d){var _0x38f039=this;return new Promise(function(_0x448e75,_0x124ee9){return db['CmHopper'][_0x222c('0x1d')]({'raw':_0x59c13d['options']?_0x59c13d[_0x222c('0x15')][_0x222c('0x16')]===undefined?!![]:![]:!![],'where':_0x59c13d[_0x222c('0x15')]?_0x59c13d['options'][_0x222c('0x1e')]||null:null,'attributes':_0x59c13d[_0x222c('0x15')]?_0x59c13d['options'][_0x222c('0x1a')]||null:null,'include':_0x59c13d['options']?_0x59c13d[_0x222c('0x15')][_0x222c('0x17')]?_[_0x222c('0x18')](_0x59c13d[_0x222c('0x15')]['include'],function(_0x862c54){return{'model':db[_0x862c54[_0x222c('0x19')]],'as':_0x862c54['as'],'attributes':_0x862c54[_0x222c('0x1a')],'include':_0x862c54[_0x222c('0x17')]?_[_0x222c('0x18')](_0x862c54['include'],function(_0x404d16){return{'model':db[_0x404d16[_0x222c('0x19')]],'as':_0x404d16['as'],'attributes':_0x404d16[_0x222c('0x1a')],'include':_0x404d16['include']?_['map'](_0x404d16[_0x222c('0x17')],function(_0x1a95ab){return{'model':db[_0x1a95ab[_0x222c('0x19')]],'as':_0x1a95ab['as'],'attributes':_0x1a95ab[_0x222c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x222c('0x1b')](function(_0x54598a){logger[_0x222c('0xb')](_0x222c('0x1c'),_0x59c13d);logger[_0x222c('0xe')](_0x222c('0x1c'),_0x59c13d,JSON['stringify'](_0x54598a));_0x448e75(_0x54598a);})[_0x222c('0x1f')](function(_0x267d7e){logger[_0x222c('0x10')](_0x222c('0x1c'),_0x267d7e[_0x222c('0x12')],_0x59c13d);_0x124ee9(_0x38f039[_0x222c('0x10')](0x1f4,_0x267d7e['message']));});});};exports[_0x222c('0x20')]=function(_0x55184b){var _0x301a10=this;return new Promise(function(_0x34b77b,_0x43fbb6){return db[_0x222c('0x21')][_0x222c('0x22')](_0x55184b[_0x222c('0x23')],{'raw':_0x55184b[_0x222c('0x15')]?_0x55184b[_0x222c('0x15')][_0x222c('0x16')]===undefined?!![]:![]:!![]})[_0x222c('0x1b')](function(_0x32d353){logger[_0x222c('0xb')](_0x222c('0x20'),_0x55184b);logger[_0x222c('0xe')](_0x222c('0x20'),_0x55184b,JSON[_0x222c('0x24')](_0x32d353));_0x34b77b(_0x32d353);})['catch'](function(_0x457e5a){logger[_0x222c('0x10')](_0x222c('0x20'),_0x457e5a[_0x222c('0x12')],_0x55184b);_0x43fbb6(_0x301a10[_0x222c('0x10')](0x1f4,_0x457e5a[_0x222c('0x12')]));});});};exports[_0x222c('0x25')]=function(_0x21495c){var _0x1271e3=this;return new Promise(function(_0x2abbfe,_0x592150){return db['CmHopper']['update'](_0x21495c[_0x222c('0x23')],{'raw':_0x21495c[_0x222c('0x15')]?_0x21495c[_0x222c('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21495c[_0x222c('0x15')]?_0x21495c[_0x222c('0x15')][_0x222c('0x1e')]||null:null,'attributes':_0x21495c[_0x222c('0x15')]?_0x21495c[_0x222c('0x15')][_0x222c('0x1a')]||null:null,'limit':_0x21495c[_0x222c('0x15')]?_0x21495c[_0x222c('0x15')][_0x222c('0x26')]||null:null})['then'](function(_0x1c88da){logger[_0x222c('0xb')](_0x222c('0x25'),_0x21495c);logger[_0x222c('0xe')](_0x222c('0x25'),_0x21495c,JSON[_0x222c('0x24')](_0x1c88da));_0x2abbfe(_0x1c88da);})[_0x222c('0x1f')](function(_0x1352b8){logger[_0x222c('0x10')](_0x222c('0x25'),_0x1352b8[_0x222c('0x12')],_0x21495c);_0x592150(_0x1271e3['error'](0x1f4,_0x1352b8[_0x222c('0x12')]));});});};exports[_0x222c('0x27')]=function(_0x48b7a9){var _0x523c50=this;return new Promise(function(_0x36e8aa,_0x5d264b){return db[_0x222c('0x21')][_0x222c('0x28')]({'where':_0x48b7a9[_0x222c('0x15')]?_0x48b7a9[_0x222c('0x15')][_0x222c('0x1e')]||null:null})['then'](function(_0x4f5f74){logger[_0x222c('0xb')](_0x222c('0x27'),_0x48b7a9);logger[_0x222c('0xe')](_0x222c('0x27'),_0x48b7a9,JSON[_0x222c('0x24')](_0x4f5f74));_0x36e8aa(_0x4f5f74);})['catch'](function(_0x56f7f7){logger[_0x222c('0x10')](_0x222c('0x27'),_0x56f7f7[_0x222c('0x12')],_0x48b7a9);_0x5d264b(_0x523c50[_0x222c('0x10')](0x1f4,_0x56f7f7[_0x222c('0x12')]));});});};exports[_0x222c('0x29')]=function(_0x37b653){var _0x56bff8=this;return new Promise(function(_0x20f9fe,_0x5424e0){return db['CmContact'][_0x222c('0x2a')]()['then'](function(_0x4c7bfc){return db[_0x222c('0x2b')][_0x222c('0x2c')](function(_0x23deb1){return db[_0x222c('0x21')][_0x222c('0x14')]({'where':_0x37b653[_0x222c('0x15')]?_0x37b653[_0x222c('0x15')][_0x222c('0x1e')]||null:null,'attributes':_0x37b653[_0x222c('0x15')]?_0x37b653[_0x222c('0x15')][_0x222c('0x1a')]||null:null,'limit':_0x37b653[_0x222c('0x15')]?_0x37b653[_0x222c('0x15')][_0x222c('0x26')]||null:null,'order':_0x37b653[_0x222c('0x15')]?_0x37b653[_0x222c('0x15')][_0x222c('0x2d')]||null:null,'transaction':_0x23deb1,'lock':_0x23deb1[_0x222c('0x2e')]['UPDATE'],'include':[{'model':db[_0x222c('0x2f')],'as':'Contact','attributes':_[_0x222c('0x30')](_0x4c7bfc)},{'model':db['User'],'as':_0x222c('0x31'),'attributes':['id','name','voicePause']}]})[_0x222c('0x1b')](function(_0x9d61cc){var _0x5e04ce=[];var _0x262cd3=[];for(var _0x572933=0x0;_0x572933<_0x9d61cc['length'];_0x572933+=0x1){if(!_0x262cd3[_0x222c('0x32')](_0x9d61cc[_0x572933]['UserId'])){_0x262cd3['push'](_0x9d61cc[_0x572933][_0x222c('0x33')]);_0x5e04ce[_0x222c('0x34')](_0x9d61cc[_0x572933][_0x222c('0x35')](_0x37b653[_0x222c('0x23')],{'transaction':_0x23deb1}));}}return BPromise['all'](_0x5e04ce);});})[_0x222c('0x1b')](function(_0x1b5c86){logger['info']('GetContactDialer',_0x37b653);logger[_0x222c('0xe')](_0x222c('0x29'),_0x37b653,JSON['stringify'](_0x1b5c86));_0x20f9fe(_0x1b5c86);})[_0x222c('0x1f')](function(_0x214292){logger[_0x222c('0x10')](_0x222c('0x29'),_0x214292[_0x222c('0x12')],_0x37b653);_0x5424e0(_0x56bff8[_0x222c('0x10')](0x1f4,_0x214292[_0x222c('0x12')]));});});});};exports[_0x222c('0x36')]=function(_0x1f22c9){var _0xb2051d=this;return new Promise(function(_0x15c915,_0x306166){return db[_0x222c('0x2b')][_0x222c('0x2c')](function(_0x600dd1){return db['CmHopperFinal'][_0x222c('0x22')](_0x1f22c9['body'],{'raw':_0x1f22c9[_0x222c('0x15')]?_0x1f22c9[_0x222c('0x15')][_0x222c('0x16')]===undefined?!![]:![]:!![],'transaction':_0x600dd1})[_0x222c('0x1b')](function(){return db[_0x222c('0x21')][_0x222c('0x28')]({'where':_0x1f22c9[_0x222c('0x15')]?_0x1f22c9['options'][_0x222c('0x1e')]||null:null,'transaction':_0x600dd1});});})['then'](function(_0x15e2a1){logger[_0x222c('0xb')](_0x222c('0x36'),_0x1f22c9);logger[_0x222c('0xe')](_0x222c('0x36'),_0x1f22c9,JSON['stringify'](_0x15e2a1));_0x15c915(_0x15e2a1);})['catch'](function(_0x3ab23b){logger[_0x222c('0x10')]('MoveContactManagedDialer',_0x3ab23b[_0x222c('0x12')],_0x1f22c9);_0x306166(_0xb2051d[_0x222c('0x10')](0x1f4,_0x3ab23b[_0x222c('0x12')]));});});};exports['CountReScheduled']=function(_0x3ffb5c){var _0x263f9a=this;return new Promise(function(_0x31d51d,_0x69ae1b){return db[_0x222c('0x21')]['findAll']({'raw':_0x3ffb5c[_0x222c('0x15')]?_0x3ffb5c[_0x222c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3ffb5c[_0x222c('0x15')]?_0x3ffb5c['options']['where']||null:null,'attributes':[[db[_0x222c('0x2b')]['fn'](_0x222c('0x37'),db['sequelize']['fn']('IF',db[_0x222c('0x2b')][_0x222c('0x38')]('`scheduledat`\x20>=\x20'+util[_0x222c('0x39')](_0x222c('0x3a'),moment()['format'](_0x222c('0x3b')))+_0x222c('0x3c')))),'contactsRescheduled']]})[_0x222c('0x1b')](function(_0x1a3615){logger[_0x222c('0xb')](_0x222c('0x3d'),_0x3ffb5c);logger[_0x222c('0xe')](_0x222c('0x3d'),_0x3ffb5c,JSON[_0x222c('0x24')](_0x1a3615));_0x31d51d(_0x1a3615);})['catch'](function(_0x335415){logger[_0x222c('0x10')]('CountReScheduled',_0x335415[_0x222c('0x12')],_0x3ffb5c);_0x69ae1b(_0x263f9a[_0x222c('0x10')](0x1f4,_0x335415[_0x222c('0x12')]));});});};exports['GetContactRecallMe']=function(_0x44d9d9){var _0x8ac2f1=this;return new Promise(function(_0xc67a1a,_0x47beb9){return db[_0x222c('0x2f')]['describe']()[_0x222c('0x1b')](function(_0x27854a){return db[_0x222c('0x2b')][_0x222c('0x2c')](function(_0x311f80){return db[_0x222c('0x21')][_0x222c('0x14')]({'where':_0x44d9d9[_0x222c('0x15')]?_0x44d9d9[_0x222c('0x15')][_0x222c('0x1e')]||null:null,'attributes':_0x44d9d9[_0x222c('0x15')]?_0x44d9d9[_0x222c('0x15')][_0x222c('0x1a')]||null:null,'limit':0x1,'order':_0x44d9d9[_0x222c('0x15')]?_0x44d9d9[_0x222c('0x15')][_0x222c('0x2d')]||null:null,'group':db[_0x222c('0x21')][_0x222c('0x33')],'transaction':_0x311f80,'lock':_0x311f80[_0x222c('0x2e')][_0x222c('0x3e')],'include':_0x44d9d9['options']?_0x44d9d9[_0x222c('0x15')][_0x222c('0x17')]?_[_0x222c('0x18')](_0x44d9d9[_0x222c('0x15')][_0x222c('0x17')],function(_0x480387){return{'model':db[_0x480387[_0x222c('0x19')]],'as':_0x480387['as'],'attributes':_0x480387[_0x222c('0x1a')],'include':_0x480387['include']?_[_0x222c('0x18')](_0x480387[_0x222c('0x17')],function(_0x21ccc7){return{'model':db[_0x21ccc7[_0x222c('0x19')]],'as':_0x21ccc7['as'],'attributes':_0x21ccc7[_0x222c('0x1a')],'include':_0x21ccc7[_0x222c('0x17')]?_[_0x222c('0x18')](_0x21ccc7['include'],function(_0x198c06){return{'model':db[_0x198c06[_0x222c('0x19')]],'as':_0x198c06['as'],'attributes':_0x198c06[_0x222c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x222c('0x1b')](function(_0x30767d){var _0x45570f=[];for(var _0x4e8325=0x0;_0x4e8325<_0x30767d[_0x222c('0x3f')];_0x4e8325+=0x1){_0x45570f[_0x222c('0x34')](_0x30767d[_0x4e8325][_0x222c('0x35')](_0x44d9d9[_0x222c('0x23')],{'transaction':_0x311f80}));}return BPromise[_0x222c('0x40')](_0x45570f);});})[_0x222c('0x1b')](function(_0x2d4aa6){logger[_0x222c('0xb')](_0x222c('0x41'),_0x44d9d9);logger['debug'](_0x222c('0x41'),_0x44d9d9,JSON[_0x222c('0x24')](_0x2d4aa6));_0xc67a1a(_0x2d4aa6);})[_0x222c('0x1f')](function(_0x2b06cd){logger[_0x222c('0x10')](_0x222c('0x41'),_0x2b06cd[_0x222c('0x12')],_0x44d9d9);_0x47beb9(_0x8ac2f1['error'](0x1f4,_0x2b06cd[_0x222c('0x12')]));});});});};exports[_0x222c('0x42')]=function(_0x2b5dbe){var _0x45ce96=this;return new Promise(function(_0x12bc84,_0x32e499){db[_0x222c('0x2f')][_0x222c('0x2a')]()[_0x222c('0x1b')](function(_0x3a30ff){return db[_0x222c('0x21')][_0x222c('0x14')]({'raw':_0x2b5dbe[_0x222c('0x15')]?_0x2b5dbe[_0x222c('0x15')][_0x222c('0x16')]===undefined?!![]:![]:!![],'where':_0x2b5dbe['options']?_0x2b5dbe[_0x222c('0x15')]['where']||null:null,'attributes':_0x2b5dbe[_0x222c('0x15')]?_0x2b5dbe[_0x222c('0x15')]['attributes']||null:null,'limit':_0x2b5dbe[_0x222c('0x15')]?_0x2b5dbe[_0x222c('0x15')][_0x222c('0x26')]||null:null,'include':_0x2b5dbe[_0x222c('0x15')]?_0x2b5dbe[_0x222c('0x15')]['include']?_['map'](_0x2b5dbe[_0x222c('0x15')][_0x222c('0x17')],function(_0x1803af){return{'model':db[_0x1803af['model']],'as':_0x1803af['as'],'attributes':_0x1803af['as']===_0x222c('0x43')?_[_0x222c('0x30')](_0x3a30ff):_0x1803af[_0x222c('0x1a')],'include':_0x1803af[_0x222c('0x17')]?_[_0x222c('0x18')](_0x1803af[_0x222c('0x17')],function(_0x332aca){return{'model':db[_0x332aca[_0x222c('0x19')]],'as':_0x332aca['as'],'attributes':_0x332aca[_0x222c('0x1a')],'include':_0x332aca[_0x222c('0x17')]?_[_0x222c('0x18')](_0x332aca['include'],function(_0x1135ea){return{'model':db[_0x1135ea[_0x222c('0x19')]],'as':_0x1135ea['as'],'attributes':_0x1135ea[_0x222c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x222c('0x1b')](function(_0x1c2754){logger[_0x222c('0xb')](_0x222c('0x13'),_0x2b5dbe);logger[_0x222c('0xe')](_0x222c('0x13'),_0x2b5dbe,JSON[_0x222c('0x24')](_0x1c2754));_0x12bc84(_0x1c2754);})[_0x222c('0x1f')](function(_0xc46dcc){logger[_0x222c('0x10')]('GetCmHopper',_0xc46dcc[_0x222c('0x12')],_0x2b5dbe);_0x32e499(_0x45ce96[_0x222c('0x10')](0x1f4,_0xc46dcc[_0x222c('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 900e2c0..c304c5a 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 _0x032a=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/opencontacts','getOpenContacts','/:id','show','create','/preview','getPreview','put','update','delete','destroy','exports'];(function(_0x580c47,_0x52f406){var _0x39ec27=function(_0x54d5cb){while(--_0x54d5cb){_0x580c47['push'](_0x580c47['shift']());}};_0x39ec27(++_0x52f406);}(_0x032a,0xf0));var _0xa032=function(_0x6622a2,_0x401a17){_0x6622a2=_0x6622a2-0x0;var _0x52252e=_0x032a[_0x6622a2];return _0x52252e;};'use strict';var multer=require('multer');var util=require(_0xa032('0x0'));var path=require('path');var timeout=require(_0xa032('0x1'));var express=require(_0xa032('0x2'));var router=express[_0xa032('0x3')]();var fs_extra=require(_0xa032('0x4'));var auth=require(_0xa032('0x5'));var interaction=require(_0xa032('0x6'));var config=require(_0xa032('0x7'));var controller=require(_0xa032('0x8'));router[_0xa032('0x9')]('/',auth[_0xa032('0xa')](),controller[_0xa032('0xb')]);router[_0xa032('0x9')]('/describe',auth[_0xa032('0xa')](),controller['describe']);router['get'](_0xa032('0xc'),auth['isAuthenticated'](),controller[_0xa032('0xd')]);router[_0xa032('0x9')](_0xa032('0xe'),auth[_0xa032('0xa')](),controller[_0xa032('0xf')]);router['post']('/',auth[_0xa032('0xa')](),controller[_0xa032('0x10')]);router['post'](_0xa032('0x11'),auth[_0xa032('0xa')](),controller[_0xa032('0x12')]);router[_0xa032('0x13')](_0xa032('0xe'),auth['isAuthenticated'](),controller[_0xa032('0x14')]);router[_0xa032('0x15')](_0xa032('0xe'),auth[_0xa032('0xa')](),controller[_0xa032('0x16')]);module[_0xa032('0x17')]=router; \ No newline at end of file +var _0xd737=['multer','path','express','Router','fs-extra','../../config/environment','isAuthenticated','index','get','/describe','describe','/opencontacts','/:id','show','create','post','getPreview','update','delete'];(function(_0x13fe35,_0x537cee){var _0x4875a8=function(_0x3fb855){while(--_0x3fb855){_0x13fe35['push'](_0x13fe35['shift']());}};_0x4875a8(++_0x537cee);}(_0xd737,0x85));var _0x7d73=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0xd737[_0x41d02a];return _0x4c3983;};'use strict';var multer=require(_0x7d73('0x0'));var util=require('util');var path=require(_0x7d73('0x1'));var timeout=require('connect-timeout');var express=require(_0x7d73('0x2'));var router=express[_0x7d73('0x3')]();var fs_extra=require(_0x7d73('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7d73('0x5'));var controller=require('./cmHopper.controller');router['get']('/',auth[_0x7d73('0x6')](),controller[_0x7d73('0x7')]);router[_0x7d73('0x8')](_0x7d73('0x9'),auth[_0x7d73('0x6')](),controller[_0x7d73('0xa')]);router[_0x7d73('0x8')](_0x7d73('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x7d73('0x8')](_0x7d73('0xc'),auth['isAuthenticated'](),controller[_0x7d73('0xd')]);router['post']('/',auth[_0x7d73('0x6')](),controller[_0x7d73('0xe')]);router[_0x7d73('0xf')]('/preview',auth[_0x7d73('0x6')](),controller[_0x7d73('0x10')]);router['put'](_0x7d73('0xc'),auth[_0x7d73('0x6')](),controller[_0x7d73('0x11')]);router[_0x7d73('0x12')]('/:id',auth[_0x7d73('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 5172a1e..df5448c 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 _0xba7f=['sequelize','exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xba7f,0xa1));var _0xfba7=function(_0x4b0de9,_0x50c757){_0x4b0de9=_0x4b0de9-0x0;var _0xcd2956=_0xba7f[_0x4b0de9];return _0xcd2956;};'use strict';var moment=require(_0xfba7('0x0'));var Sequelize=require(_0xfba7('0x1'));module[_0xfba7('0x2')]={'phone':{'type':Sequelize[_0xfba7('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xfba7('0x4')],'unique':_0xfba7('0x5')},'ListId':{'type':Sequelize[_0xfba7('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xfba7('0x4')],'unique':_0xfba7('0x5')}}; \ No newline at end of file +var _0x0667=['INTEGER','contactListQueue','sequelize','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0667,0x76));var _0x7066=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0667[_0x122ef9];return _0x42fba0;};'use strict';var moment=require('moment');var Sequelize=require(_0x7066('0x0'));module[_0x7066('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x7066('0x2')],'unique':_0x7066('0x3')},'ListId':{'type':Sequelize[_0x7066('0x2')],'unique':_0x7066('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x7066('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index e0fd729..ae560a5 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 _0x570b=['end','error','name','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','count','includeAll','include','findAll','show','params','find','catch','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','apply','reject','update','then','destroy'];(function(_0x5d9c6d,_0x2b4e43){var _0x48bdaa=function(_0x5a5373){while(--_0x5a5373){_0x5d9c6d['push'](_0x5d9c6d['shift']());}};_0x48bdaa(++_0x2b4e43);}(_0x570b,0x180));var _0xb570=function(_0x2ebe94,_0x3d4c21){_0x2ebe94=_0x2ebe94-0x0;var _0x540943=_0x570b[_0x2ebe94];return _0x540943;};'use strict';var emlformat=require(_0xb570('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb570('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb570('0x2'));var moment=require(_0xb570('0x3'));var BPromise=require(_0xb570('0x4'));var Mustache=require('mustache');var util=require(_0xb570('0x5'));var path=require(_0xb570('0x6'));var sox=require(_0xb570('0x7'));var csv=require(_0xb570('0x8'));var ejs=require(_0xb570('0x9'));var fs=require('fs');var fs_extra=require(_0xb570('0xa'));var _=require(_0xb570('0xb'));var squel=require('squel');var crypto=require(_0xb570('0xc'));var jsforce=require(_0xb570('0xd'));var deskjs=require(_0xb570('0xe'));var toCsv=require(_0xb570('0x8'));var querystring=require(_0xb570('0xf'));var Papa=require(_0xb570('0x10'));var Redis=require('ioredis');var authService=require(_0xb570('0x11'));var qs=require(_0xb570('0x12'));var as=require(_0xb570('0x13'));var hardwareService=require(_0xb570('0x14'));var logger=require(_0xb570('0x15'))(_0xb570('0x16'));var utils=require(_0xb570('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb570('0x18'));var db=require(_0xb570('0x19'))['db'];function respondWithStatusCode(_0x5050db,_0x25ec3b){_0x25ec3b=_0x25ec3b||0xcc;return function(_0x22ab34){if(_0x22ab34){return _0x5050db[_0xb570('0x1a')](_0x25ec3b);}return _0x5050db['status'](_0x25ec3b)['end']();};}function respondWithResult(_0x4c2d63,_0xce420d){_0xce420d=_0xce420d||0xc8;return function(_0xc5cd15){if(_0xc5cd15){return _0x4c2d63[_0xb570('0x1b')](_0xce420d)[_0xb570('0x1c')](_0xc5cd15);}};}function respondWithFilteredResult(_0xa29092,_0x10cf26){return function(_0x521def){if(_0x521def){var _0x5a419d=_0x521def['count'],_0x15321a=_0x10cf26[_0xb570('0x1d')],_0x2c5a27=_0x10cf26[_0xb570('0x1d')]+_0x10cf26[_0xb570('0x1e')],_0x411527;if(_0x2c5a27>=_0x5a419d){_0x2c5a27=_0x5a419d;_0x411527=0xc8;}else{_0x411527=0xce;}_0xa29092[_0xb570('0x1b')](_0x411527);return _0xa29092['set']('Content-Range',_0x15321a+'-'+_0x2c5a27+'/'+_0x5a419d)[_0xb570('0x1c')](_0x521def);}return null;};}function patchUpdates(_0x40435e){return function(_0x5e99f8){try{jsonpatch[_0xb570('0x1f')](_0x5e99f8,_0x40435e,!![]);}catch(_0x2ac259){return BPromise[_0xb570('0x20')](_0x2ac259);}return _0x5e99f8['save']();};}function saveUpdates(_0x867516,_0x259d76){return function(_0x361a49){if(_0x361a49){return _0x361a49[_0xb570('0x21')](_0x867516)[_0xb570('0x22')](function(_0x3fa253){return _0x3fa253;});}return null;};}function removeEntity(_0x13084d,_0x4d8fb1){return function(_0x5f54e){if(_0x5f54e){return _0x5f54e[_0xb570('0x23')]()[_0xb570('0x22')](function(){_0x13084d[_0xb570('0x1b')](0xcc)[_0xb570('0x24')]();});}};}function handleEntityNotFound(_0x52c072,_0x43b471){return function(_0x23fe0b){if(!_0x23fe0b){_0x52c072[_0xb570('0x1a')](0x194);}return _0x23fe0b;};}function handleError(_0x2cf610,_0x335d3f){_0x335d3f=_0x335d3f||0x1f4;return function(_0x5ebb13){logger[_0xb570('0x25')](_0x5ebb13['stack']);if(_0x5ebb13['name']){delete _0x5ebb13[_0xb570('0x26')];}_0x2cf610[_0xb570('0x1b')](_0x335d3f)['send'](_0x5ebb13);};}exports['index']=function(_0x36069a,_0x5e4e5e){var _0x20a5a8={},_0x1b9c2a={},_0x38c1f6={'count':0x0,'rows':[]};var _0x4eb73e=_['map'](db[_0xb570('0x27')][_0xb570('0x28')],function(_0x298794){return{'name':_0x298794[_0xb570('0x29')],'type':_0x298794[_0xb570('0x2a')][_0xb570('0x2b')]};});_0x1b9c2a[_0xb570('0x2c')]=_[_0xb570('0x2d')](_0x4eb73e,_0xb570('0x26'));_0x1b9c2a[_0xb570('0x2e')]=_[_0xb570('0x2f')](_0x36069a[_0xb570('0x2e')]);_0x1b9c2a['filters']=_[_0xb570('0x30')](_0x1b9c2a[_0xb570('0x2c')],_0x1b9c2a[_0xb570('0x2e')]);_0x20a5a8['attributes']=_['intersection'](_0x1b9c2a[_0xb570('0x2c')],qs[_0xb570('0x31')](_0x36069a[_0xb570('0x2e')][_0xb570('0x31')]));_0x20a5a8[_0xb570('0x32')]=_0x20a5a8[_0xb570('0x32')][_0xb570('0x33')]?_0x20a5a8[_0xb570('0x32')]:_0x1b9c2a[_0xb570('0x2c')];if(!_0x36069a[_0xb570('0x2e')][_0xb570('0x34')](_0xb570('0x35'))){_0x20a5a8['limit']=qs[_0xb570('0x1e')](_0x36069a[_0xb570('0x2e')][_0xb570('0x1e')]);_0x20a5a8['offset']=qs['offset'](_0x36069a[_0xb570('0x2e')]['offset']);}_0x20a5a8[_0xb570('0x36')]=qs[_0xb570('0x37')](_0x36069a[_0xb570('0x2e')][_0xb570('0x37')]);_0x20a5a8[_0xb570('0x38')]=qs['filters'](_['pick'](_0x36069a[_0xb570('0x2e')],_0x1b9c2a[_0xb570('0x39')]),_0x4eb73e);if(_0x36069a['query']['filter']){_0x20a5a8['where']=_[_0xb570('0x3a')](_0x20a5a8['where'],{'$or':_['map'](_0x4eb73e,function(_0x5c70a6){if(_0x5c70a6[_0xb570('0x2a')]!=='VIRTUAL'){var _0x483cfc={};_0x483cfc[_0x5c70a6[_0xb570('0x26')]]={'$like':'%'+_0x36069a['query']['filter']+'%'};return _0x483cfc;}})});}_0x20a5a8=_[_0xb570('0x3a')]({},_0x20a5a8,_0x36069a[_0xb570('0x3b')]);var _0x111e58={'where':_0x20a5a8[_0xb570('0x38')]};return db[_0xb570('0x27')][_0xb570('0x3c')](_0x111e58)[_0xb570('0x22')](function(_0x4e2955){_0x38c1f6[_0xb570('0x3c')]=_0x4e2955;if(_0x36069a[_0xb570('0x2e')][_0xb570('0x3d')]){_0x20a5a8[_0xb570('0x3e')]=[{'all':!![]}];}return db[_0xb570('0x27')][_0xb570('0x3f')](_0x20a5a8);})[_0xb570('0x22')](function(_0x5b553e){_0x38c1f6['rows']=_0x5b553e;return _0x38c1f6;})['then'](respondWithFilteredResult(_0x5e4e5e,_0x20a5a8))['catch'](handleError(_0x5e4e5e,null));};exports[_0xb570('0x40')]=function(_0x3421fe,_0xc9e301){var _0x2815e1={'raw':!![],'where':{'id':_0x3421fe[_0xb570('0x41')]['id']}},_0x147d2c={};_0x147d2c[_0xb570('0x2c')]=_[_0xb570('0x2f')](db[_0xb570('0x27')][_0xb570('0x28')]);_0x147d2c[_0xb570('0x2e')]=_[_0xb570('0x2f')](_0x3421fe[_0xb570('0x2e')]);_0x147d2c[_0xb570('0x39')]=_['intersection'](_0x147d2c[_0xb570('0x2c')],_0x147d2c['query']);_0x2815e1[_0xb570('0x32')]=_[_0xb570('0x30')](_0x147d2c[_0xb570('0x2c')],qs[_0xb570('0x31')](_0x3421fe[_0xb570('0x2e')][_0xb570('0x31')]));_0x2815e1[_0xb570('0x32')]=_0x2815e1[_0xb570('0x32')][_0xb570('0x33')]?_0x2815e1['attributes']:_0x147d2c[_0xb570('0x2c')];if(_0x3421fe[_0xb570('0x2e')][_0xb570('0x3d')]){_0x2815e1[_0xb570('0x3e')]=[{'all':!![]}];}_0x2815e1=_[_0xb570('0x3a')]({},_0x2815e1,_0x3421fe[_0xb570('0x3b')]);return db[_0xb570('0x27')][_0xb570('0x42')](_0x2815e1)[_0xb570('0x22')](handleEntityNotFound(_0xc9e301,null))[_0xb570('0x22')](respondWithResult(_0xc9e301,null))[_0xb570('0x43')](handleError(_0xc9e301,null));};exports[_0xb570('0x21')]=function(_0x56e8c7,_0x4b0121){if(_0x56e8c7[_0xb570('0x44')]['id']){delete _0x56e8c7[_0xb570('0x44')]['id'];}return db[_0xb570('0x27')]['find']({'where':{'id':_0x56e8c7[_0xb570('0x41')]['id']}})[_0xb570('0x22')](handleEntityNotFound(_0x4b0121,null))[_0xb570('0x22')](saveUpdates(_0x56e8c7[_0xb570('0x44')],null))['then'](respondWithResult(_0x4b0121,null))[_0xb570('0x43')](handleError(_0x4b0121,null));};exports[_0xb570('0x23')]=function(_0x50bb8e,_0x21d023){return db[_0xb570('0x27')][_0xb570('0x42')]({'where':{'id':_0x50bb8e[_0xb570('0x41')]['id']}})[_0xb570('0x22')](handleEntityNotFound(_0x21d023,null))[_0xb570('0x22')](removeEntity(_0x21d023,null))[_0xb570('0x43')](handleError(_0x21d023,null));};exports[_0xb570('0x45')]=function(_0x1be2ba,_0x538e19){return db[_0xb570('0x27')][_0xb570('0x45')]()['then'](respondWithResult(_0x538e19,null))[_0xb570('0x43')](handleError(_0x538e19,null));}; \ No newline at end of file +var _0x6c42=['body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperBlack','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x6c42,0x127));var _0x26c4=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x6c42[_0x5756f8];return _0x3bb749;};'use strict';var emlformat=require(_0x26c4('0x0'));var rimraf=require(_0x26c4('0x1'));var zipdir=require(_0x26c4('0x2'));var jsonpatch=require(_0x26c4('0x3'));var rp=require(_0x26c4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x26c4('0x5'));var util=require(_0x26c4('0x6'));var path=require(_0x26c4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x26c4('0x8'));var fs=require('fs');var fs_extra=require(_0x26c4('0x9'));var _=require(_0x26c4('0xa'));var squel=require(_0x26c4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x26c4('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x26c4('0xd'));var authService=require(_0x26c4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x26c4('0xf'));var hardwareService=require(_0x26c4('0x10'));var logger=require('../../config/logger')(_0x26c4('0x11'));var utils=require('../../config/utils');var config=require(_0x26c4('0x12'));var licenseUtil=require(_0x26c4('0x13'));var db=require(_0x26c4('0x14'))['db'];function respondWithStatusCode(_0x5da328,_0x603a2e){_0x603a2e=_0x603a2e||0xcc;return function(_0x2574c0){if(_0x2574c0){return _0x5da328[_0x26c4('0x15')](_0x603a2e);}return _0x5da328['status'](_0x603a2e)[_0x26c4('0x16')]();};}function respondWithResult(_0x235c2d,_0x5e660a){_0x5e660a=_0x5e660a||0xc8;return function(_0x38c69d){if(_0x38c69d){return _0x235c2d[_0x26c4('0x17')](_0x5e660a)[_0x26c4('0x18')](_0x38c69d);}};}function respondWithFilteredResult(_0x1a000a,_0x16d4a2){return function(_0x3742b0){if(_0x3742b0){var _0x1e9bed=_0x3742b0[_0x26c4('0x19')],_0x17ac4b=_0x16d4a2[_0x26c4('0x1a')],_0x30ff5f=_0x16d4a2[_0x26c4('0x1a')]+_0x16d4a2['limit'],_0x4f63dc;if(_0x30ff5f>=_0x1e9bed){_0x30ff5f=_0x1e9bed;_0x4f63dc=0xc8;}else{_0x4f63dc=0xce;}_0x1a000a['status'](_0x4f63dc);return _0x1a000a[_0x26c4('0x1b')](_0x26c4('0x1c'),_0x17ac4b+'-'+_0x30ff5f+'/'+_0x1e9bed)['json'](_0x3742b0);}return null;};}function patchUpdates(_0x3415a8){return function(_0x3c08df){try{jsonpatch[_0x26c4('0x1d')](_0x3c08df,_0x3415a8,!![]);}catch(_0x4d7b66){return BPromise[_0x26c4('0x1e')](_0x4d7b66);}return _0x3c08df[_0x26c4('0x1f')]();};}function saveUpdates(_0x58ec7d,_0x29efd7){return function(_0x237173){if(_0x237173){return _0x237173[_0x26c4('0x20')](_0x58ec7d)[_0x26c4('0x21')](function(_0x3e4d7f){return _0x3e4d7f;});}return null;};}function removeEntity(_0x30f38b,_0x22dd97){return function(_0x14ec32){if(_0x14ec32){return _0x14ec32[_0x26c4('0x22')]()[_0x26c4('0x21')](function(){_0x30f38b[_0x26c4('0x17')](0xcc)[_0x26c4('0x16')]();});}};}function handleEntityNotFound(_0x326a0e,_0x529583){return function(_0xf994ad){if(!_0xf994ad){_0x326a0e[_0x26c4('0x15')](0x194);}return _0xf994ad;};}function handleError(_0x340097,_0x5bf844){_0x5bf844=_0x5bf844||0x1f4;return function(_0x54bc75){logger[_0x26c4('0x23')](_0x54bc75[_0x26c4('0x24')]);if(_0x54bc75[_0x26c4('0x25')]){delete _0x54bc75['name'];}_0x340097[_0x26c4('0x17')](_0x5bf844)[_0x26c4('0x26')](_0x54bc75);};}exports[_0x26c4('0x27')]=function(_0x4a96f1,_0x2a78a5){var _0x428aa0={},_0x287cd0={},_0x3a921e={'count':0x0,'rows':[]};var _0x3785a5=_['map'](db[_0x26c4('0x28')][_0x26c4('0x29')],function(_0x48dd1f){return{'name':_0x48dd1f['fieldName'],'type':_0x48dd1f[_0x26c4('0x2a')][_0x26c4('0x2b')]};});_0x287cd0[_0x26c4('0x2c')]=_[_0x26c4('0x2d')](_0x3785a5,_0x26c4('0x25'));_0x287cd0[_0x26c4('0x2e')]=_[_0x26c4('0x2f')](_0x4a96f1[_0x26c4('0x2e')]);_0x287cd0[_0x26c4('0x30')]=_['intersection'](_0x287cd0['model'],_0x287cd0[_0x26c4('0x2e')]);_0x428aa0['attributes']=_[_0x26c4('0x31')](_0x287cd0['model'],qs[_0x26c4('0x32')](_0x4a96f1['query'][_0x26c4('0x32')]));_0x428aa0[_0x26c4('0x33')]=_0x428aa0['attributes'][_0x26c4('0x34')]?_0x428aa0[_0x26c4('0x33')]:_0x287cd0[_0x26c4('0x2c')];if(!_0x4a96f1[_0x26c4('0x2e')][_0x26c4('0x35')](_0x26c4('0x36'))){_0x428aa0[_0x26c4('0x37')]=qs[_0x26c4('0x37')](_0x4a96f1[_0x26c4('0x2e')]['limit']);_0x428aa0[_0x26c4('0x1a')]=qs[_0x26c4('0x1a')](_0x4a96f1[_0x26c4('0x2e')][_0x26c4('0x1a')]);}_0x428aa0[_0x26c4('0x38')]=qs['sort'](_0x4a96f1['query'][_0x26c4('0x39')]);_0x428aa0[_0x26c4('0x3a')]=qs[_0x26c4('0x30')](_[_0x26c4('0x3b')](_0x4a96f1[_0x26c4('0x2e')],_0x287cd0[_0x26c4('0x30')]),_0x3785a5);if(_0x4a96f1['query'][_0x26c4('0x3c')]){_0x428aa0[_0x26c4('0x3a')]=_[_0x26c4('0x3d')](_0x428aa0['where'],{'$or':_[_0x26c4('0x2d')](_0x3785a5,function(_0x2b6069){if(_0x2b6069['type']!=='VIRTUAL'){var _0xffa053={};_0xffa053[_0x2b6069[_0x26c4('0x25')]]={'$like':'%'+_0x4a96f1[_0x26c4('0x2e')][_0x26c4('0x3c')]+'%'};return _0xffa053;}})});}_0x428aa0=_[_0x26c4('0x3d')]({},_0x428aa0,_0x4a96f1[_0x26c4('0x3e')]);var _0x18325c={'where':_0x428aa0[_0x26c4('0x3a')]};return db[_0x26c4('0x28')][_0x26c4('0x19')](_0x18325c)[_0x26c4('0x21')](function(_0x167bec){_0x3a921e[_0x26c4('0x19')]=_0x167bec;if(_0x4a96f1[_0x26c4('0x2e')][_0x26c4('0x3f')]){_0x428aa0['include']=[{'all':!![]}];}return db[_0x26c4('0x28')][_0x26c4('0x40')](_0x428aa0);})[_0x26c4('0x21')](function(_0x462598){_0x3a921e[_0x26c4('0x41')]=_0x462598;return _0x3a921e;})['then'](respondWithFilteredResult(_0x2a78a5,_0x428aa0))[_0x26c4('0x42')](handleError(_0x2a78a5,null));};exports[_0x26c4('0x43')]=function(_0x1d1e98,_0x5f4fd0){var _0x52b5ef={'raw':!![],'where':{'id':_0x1d1e98[_0x26c4('0x44')]['id']}},_0x3fe1f0={};_0x3fe1f0['model']=_[_0x26c4('0x2f')](db[_0x26c4('0x28')]['rawAttributes']);_0x3fe1f0['query']=_[_0x26c4('0x2f')](_0x1d1e98[_0x26c4('0x2e')]);_0x3fe1f0[_0x26c4('0x30')]=_[_0x26c4('0x31')](_0x3fe1f0[_0x26c4('0x2c')],_0x3fe1f0[_0x26c4('0x2e')]);_0x52b5ef[_0x26c4('0x33')]=_[_0x26c4('0x31')](_0x3fe1f0['model'],qs[_0x26c4('0x32')](_0x1d1e98[_0x26c4('0x2e')][_0x26c4('0x32')]));_0x52b5ef[_0x26c4('0x33')]=_0x52b5ef[_0x26c4('0x33')]['length']?_0x52b5ef['attributes']:_0x3fe1f0[_0x26c4('0x2c')];if(_0x1d1e98[_0x26c4('0x2e')]['includeAll']){_0x52b5ef[_0x26c4('0x45')]=[{'all':!![]}];}_0x52b5ef=_[_0x26c4('0x3d')]({},_0x52b5ef,_0x1d1e98[_0x26c4('0x3e')]);return db[_0x26c4('0x28')]['find'](_0x52b5ef)[_0x26c4('0x21')](handleEntityNotFound(_0x5f4fd0,null))[_0x26c4('0x21')](respondWithResult(_0x5f4fd0,null))[_0x26c4('0x42')](handleError(_0x5f4fd0,null));};exports[_0x26c4('0x20')]=function(_0x59c6fc,_0x1d45d2){if(_0x59c6fc[_0x26c4('0x46')]['id']){delete _0x59c6fc[_0x26c4('0x46')]['id'];}return db[_0x26c4('0x28')]['find']({'where':{'id':_0x59c6fc[_0x26c4('0x44')]['id']}})[_0x26c4('0x21')](handleEntityNotFound(_0x1d45d2,null))[_0x26c4('0x21')](saveUpdates(_0x59c6fc[_0x26c4('0x46')],null))['then'](respondWithResult(_0x1d45d2,null))[_0x26c4('0x42')](handleError(_0x1d45d2,null));};exports[_0x26c4('0x22')]=function(_0x487049,_0xf585c3){return db['CmHopperBlack'][_0x26c4('0x47')]({'where':{'id':_0x487049[_0x26c4('0x44')]['id']}})[_0x26c4('0x21')](handleEntityNotFound(_0xf585c3,null))[_0x26c4('0x21')](removeEntity(_0xf585c3,null))[_0x26c4('0x42')](handleError(_0xf585c3,null));};exports[_0x26c4('0x48')]=function(_0x34dfa9,_0x148c9b){return db[_0x26c4('0x28')]['describe']()['then'](respondWithResult(_0x148c9b,null))['catch'](handleError(_0x148c9b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 6043eed..e61ddeb 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 _0xb48e=['../../config/environment','exports','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x570b68,_0x162b93){var _0x5bb6e8=function(_0x58f92b){while(--_0x58f92b){_0x570b68['push'](_0x570b68['shift']());}};_0x5bb6e8(++_0x162b93);}(_0xb48e,0x99));var _0xeb48=function(_0x79eb83,_0x3ec034){_0x79eb83=_0x79eb83-0x0;var _0x495fb6=_0xb48e[_0x79eb83];return _0x495fb6;};'use strict';var _=require(_0xeb48('0x0'));var util=require(_0xeb48('0x1'));var logger=require(_0xeb48('0x2'))(_0xeb48('0x3'));var moment=require(_0xeb48('0x4'));var BPromise=require(_0xeb48('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeb48('0x6'));var config=require(_0xeb48('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0xeb48('0x8')]=function(_0x2f430a,_0xf7b2f7){return _0x2f430a['define']('CmHopperBlack',attributes,{'tableName':_0xeb48('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadfc=['cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack'];(function(_0x42985c,_0x556090){var _0x47d5b9=function(_0xe9ffb0){while(--_0xe9ffb0){_0x42985c['push'](_0x42985c['shift']());}};_0x47d5b9(++_0x556090);}(_0xadfc,0x1bd));var _0xcadf=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xadfc[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xcadf('0x0'));var util=require(_0xcadf('0x1'));var logger=require(_0xcadf('0x2'))('api');var moment=require(_0xcadf('0x3'));var BPromise=require(_0xcadf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcadf('0x5'));var config=require(_0xcadf('0x6'));var attributes=require(_0xcadf('0x7'));module[_0xcadf('0x8')]=function(_0x1470c0,_0x192d40){return _0x1470c0[_0xcadf('0x9')](_0xcadf('0xa'),attributes,{'tableName':_0xcadf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 4aa0421..b677b63 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 _0x5938=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','CmHopperBlack,\x20%s,\x20%s','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','include','map','model','CmHopperBlack','update','body','limit','UpdateCmHopperBlack','debug','DestroyCmHopperBlack','destroy','util','bluebird','../../mysqldb'];(function(_0x1c40eb,_0x48436f){var _0x1bf5ba=function(_0xf0d5a4){while(--_0xf0d5a4){_0x1c40eb['push'](_0x1c40eb['shift']());}};_0x1bf5ba(++_0x48436f);}(_0x5938,0x8d));var _0x8593=function(_0x20c4c5,_0xd2ab15){_0x20c4c5=_0x20c4c5-0x0;var _0x336957=_0x5938[_0x20c4c5];return _0x336957;};'use strict';var _=require('lodash');var util=require(_0x8593('0x0'));var moment=require('moment');var BPromise=require(_0x8593('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8593('0x2'))['db'];var utils=require(_0x8593('0x3'));var logger=require(_0x8593('0x4'))('rpc');var config=require(_0x8593('0x5'));var jayson=require(_0x8593('0x6'));var client=jayson['client'][_0x8593('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2408db,_0x565bb1,_0x507668){return new BPromise(function(_0x14df77,_0x26fea5){return client['request'](_0x2408db,_0x507668)[_0x8593('0x8')](function(_0x3d8c3a){logger[_0x8593('0x9')](_0x8593('0xa'),_0x565bb1,'request\x20sent');logger['debug'](_0x8593('0xb'),_0x565bb1,_0x8593('0xc'),JSON[_0x8593('0xd')](_0x3d8c3a));if(_0x3d8c3a[_0x8593('0xe')]){if(_0x3d8c3a['error'][_0x8593('0xf')]===0x1f4){logger[_0x8593('0xe')](_0x8593('0xa'),_0x565bb1,_0x3d8c3a[_0x8593('0xe')]['message']);return _0x26fea5(_0x3d8c3a[_0x8593('0xe')][_0x8593('0x10')]);}logger[_0x8593('0xe')](_0x8593('0xa'),_0x565bb1,_0x3d8c3a[_0x8593('0xe')][_0x8593('0x10')]);return _0x14df77(_0x3d8c3a['error'][_0x8593('0x10')]);}else{logger[_0x8593('0x9')]('CmHopperBlack,\x20%s,\x20%s',_0x565bb1,'request\x20sent');_0x14df77(_0x3d8c3a[_0x8593('0x11')][_0x8593('0x10')]);}})[_0x8593('0x12')](function(_0x430827){logger[_0x8593('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x565bb1,_0x430827);_0x26fea5(_0x430827);});});}exports[_0x8593('0x13')]=function(_0x4d2940){var _0x18c068=this;return new Promise(function(_0x30cacb,_0x232624){return db['CmHopperBlack'][_0x8593('0x14')]({'raw':_0x4d2940[_0x8593('0x15')]?_0x4d2940['options'][_0x8593('0x16')]===undefined?!![]:![]:!![],'where':_0x4d2940[_0x8593('0x15')]?_0x4d2940['options'][_0x8593('0x17')]||null:null,'attributes':_0x4d2940[_0x8593('0x15')]?_0x4d2940[_0x8593('0x15')][_0x8593('0x18')]||null:null,'limit':_0x4d2940[_0x8593('0x15')]?_0x4d2940[_0x8593('0x15')]['limit']||null:null,'include':_0x4d2940[_0x8593('0x15')]?_0x4d2940[_0x8593('0x15')][_0x8593('0x19')]?_[_0x8593('0x1a')](_0x4d2940[_0x8593('0x15')]['include'],function(_0x739da6){return{'model':db[_0x739da6[_0x8593('0x1b')]],'as':_0x739da6['as'],'attributes':_0x739da6[_0x8593('0x18')],'include':_0x739da6[_0x8593('0x19')]?_[_0x8593('0x1a')](_0x739da6[_0x8593('0x19')],function(_0x13c7c8){return{'model':db[_0x13c7c8[_0x8593('0x1b')]],'as':_0x13c7c8['as'],'attributes':_0x13c7c8[_0x8593('0x18')],'include':_0x13c7c8['include']?_['map'](_0x13c7c8[_0x8593('0x19')],function(_0x1c5a31){return{'model':db[_0x1c5a31[_0x8593('0x1b')]],'as':_0x1c5a31['as'],'attributes':_0x1c5a31[_0x8593('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f8e50){logger[_0x8593('0x9')](_0x8593('0x13'),_0x4d2940);logger['debug'](_0x8593('0x13'),_0x4d2940,JSON[_0x8593('0xd')](_0x3f8e50));_0x30cacb(_0x3f8e50);})[_0x8593('0x12')](function(_0x525db7){logger[_0x8593('0xe')](_0x8593('0x13'),_0x525db7[_0x8593('0x10')],_0x4d2940);_0x232624(_0x18c068[_0x8593('0xe')](0x1f4,_0x525db7['message']));});});};exports['UpdateCmHopperBlack']=function(_0x2c1117){var _0x28bded=this;return new Promise(function(_0x565b6b,_0x49fd7c){return db[_0x8593('0x1c')][_0x8593('0x1d')](_0x2c1117[_0x8593('0x1e')],{'raw':_0x2c1117['options']?_0x2c1117[_0x8593('0x15')][_0x8593('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c1117['options']?_0x2c1117[_0x8593('0x15')]['where']||null:null,'attributes':_0x2c1117[_0x8593('0x15')]?_0x2c1117[_0x8593('0x15')]['attributes']||null:null,'limit':_0x2c1117[_0x8593('0x15')]?_0x2c1117[_0x8593('0x15')][_0x8593('0x1f')]||null:null})['then'](function(_0x53e92d){logger[_0x8593('0x9')](_0x8593('0x20'),_0x2c1117);logger[_0x8593('0x21')](_0x8593('0x20'),_0x2c1117,JSON[_0x8593('0xd')](_0x53e92d));_0x565b6b(_0x53e92d);})[_0x8593('0x12')](function(_0x416bd7){logger['error']('UpdateCmHopperBlack',_0x416bd7[_0x8593('0x10')],_0x2c1117);_0x49fd7c(_0x28bded['error'](0x1f4,_0x416bd7[_0x8593('0x10')]));});});};exports[_0x8593('0x22')]=function(_0x5eb083){var _0x1cff6c=this;return new Promise(function(_0x50aaed,_0x19897c){return db[_0x8593('0x1c')][_0x8593('0x23')]({'where':_0x5eb083[_0x8593('0x15')]?_0x5eb083[_0x8593('0x15')][_0x8593('0x17')]||null:null})[_0x8593('0x8')](function(_0x20612a){logger['info'](_0x8593('0x22'),_0x5eb083);logger[_0x8593('0x21')](_0x8593('0x22'),_0x5eb083,JSON['stringify'](_0x20612a));_0x50aaed(_0x20612a);})[_0x8593('0x12')](function(_0x51ffde){logger[_0x8593('0xe')](_0x8593('0x22'),_0x51ffde['message'],_0x5eb083);_0x19897c(_0x1cff6c[_0x8593('0xe')](0x1f4,_0x51ffde['message']));});});}; \ No newline at end of file +var _0x7d17=['request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','GetCmHopperBlack','findAll','options','attributes','limit','include','map','model','then','CmHopperBlack','update','body','raw','where','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x4d9d72,_0x369af5){var _0x541564=function(_0x817ba0){while(--_0x817ba0){_0x4d9d72['push'](_0x4d9d72['shift']());}};_0x541564(++_0x369af5);}(_0x7d17,0x8c));var _0x77d1=function(_0xa84730,_0x1a8a70){_0xa84730=_0xa84730-0x0;var _0x53b24b=_0x7d17[_0xa84730];return _0x53b24b;};'use strict';var _=require(_0x77d1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x77d1('0x1'));var rs=require(_0x77d1('0x2'));var fs=require('fs');var Redis=require(_0x77d1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x77d1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x77d1('0x5'));var jayson=require(_0x77d1('0x6'));var client=jayson['client'][_0x77d1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x526ae2,_0x102a14,_0xe79757){return new BPromise(function(_0x48bab0,_0x31a607){return client[_0x77d1('0x8')](_0x526ae2,_0xe79757)['then'](function(_0x213672){logger[_0x77d1('0x9')](_0x77d1('0xa'),_0x102a14,_0x77d1('0xb'));logger[_0x77d1('0xc')](_0x77d1('0xd'),_0x102a14,_0x77d1('0xb'),JSON[_0x77d1('0xe')](_0x213672));if(_0x213672['error']){if(_0x213672['error'][_0x77d1('0xf')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x102a14,_0x213672['error'][_0x77d1('0x10')]);return _0x31a607(_0x213672[_0x77d1('0x11')][_0x77d1('0x10')]);}logger[_0x77d1('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x102a14,_0x213672[_0x77d1('0x11')]['message']);return _0x48bab0(_0x213672['error']['message']);}else{logger[_0x77d1('0x9')]('CmHopperBlack,\x20%s,\x20%s',_0x102a14,_0x77d1('0xb'));_0x48bab0(_0x213672[_0x77d1('0x12')][_0x77d1('0x10')]);}})[_0x77d1('0x13')](function(_0x3aec0a){logger['error'](_0x77d1('0xa'),_0x102a14,_0x3aec0a);_0x31a607(_0x3aec0a);});});}exports[_0x77d1('0x14')]=function(_0x5e0656){var _0x49710c=this;return new Promise(function(_0x1fd284,_0x54950d){return db['CmHopperBlack'][_0x77d1('0x15')]({'raw':_0x5e0656['options']?_0x5e0656[_0x77d1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5e0656[_0x77d1('0x16')]?_0x5e0656['options']['where']||null:null,'attributes':_0x5e0656[_0x77d1('0x16')]?_0x5e0656[_0x77d1('0x16')][_0x77d1('0x17')]||null:null,'limit':_0x5e0656[_0x77d1('0x16')]?_0x5e0656[_0x77d1('0x16')][_0x77d1('0x18')]||null:null,'include':_0x5e0656[_0x77d1('0x16')]?_0x5e0656[_0x77d1('0x16')][_0x77d1('0x19')]?_[_0x77d1('0x1a')](_0x5e0656[_0x77d1('0x16')][_0x77d1('0x19')],function(_0x20bb43){return{'model':db[_0x20bb43[_0x77d1('0x1b')]],'as':_0x20bb43['as'],'attributes':_0x20bb43[_0x77d1('0x17')],'include':_0x20bb43[_0x77d1('0x19')]?_[_0x77d1('0x1a')](_0x20bb43[_0x77d1('0x19')],function(_0xc91911){return{'model':db[_0xc91911['model']],'as':_0xc91911['as'],'attributes':_0xc91911[_0x77d1('0x17')],'include':_0xc91911[_0x77d1('0x19')]?_[_0x77d1('0x1a')](_0xc91911[_0x77d1('0x19')],function(_0x3a6a1a){return{'model':db[_0x3a6a1a[_0x77d1('0x1b')]],'as':_0x3a6a1a['as'],'attributes':_0x3a6a1a[_0x77d1('0x17')]};}):[]};}):[]};}):[]:[]})[_0x77d1('0x1c')](function(_0x505426){logger['info'](_0x77d1('0x14'),_0x5e0656);logger[_0x77d1('0xc')]('GetCmHopperBlack',_0x5e0656,JSON[_0x77d1('0xe')](_0x505426));_0x1fd284(_0x505426);})[_0x77d1('0x13')](function(_0x5a8806){logger['error']('GetCmHopperBlack',_0x5a8806[_0x77d1('0x10')],_0x5e0656);_0x54950d(_0x49710c[_0x77d1('0x11')](0x1f4,_0x5a8806['message']));});});};exports['UpdateCmHopperBlack']=function(_0x49584e){var _0xc19263=this;return new Promise(function(_0x2fb476,_0x29085f){return db[_0x77d1('0x1d')][_0x77d1('0x1e')](_0x49584e[_0x77d1('0x1f')],{'raw':_0x49584e[_0x77d1('0x16')]?_0x49584e[_0x77d1('0x16')][_0x77d1('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49584e['options']?_0x49584e[_0x77d1('0x16')][_0x77d1('0x21')]||null:null,'attributes':_0x49584e[_0x77d1('0x16')]?_0x49584e[_0x77d1('0x16')][_0x77d1('0x17')]||null:null,'limit':_0x49584e[_0x77d1('0x16')]?_0x49584e['options']['limit']||null:null})['then'](function(_0x2a4b0a){logger[_0x77d1('0x9')](_0x77d1('0x22'),_0x49584e);logger[_0x77d1('0xc')](_0x77d1('0x22'),_0x49584e,JSON['stringify'](_0x2a4b0a));_0x2fb476(_0x2a4b0a);})[_0x77d1('0x13')](function(_0xdef5d3){logger[_0x77d1('0x11')](_0x77d1('0x22'),_0xdef5d3[_0x77d1('0x10')],_0x49584e);_0x29085f(_0xc19263[_0x77d1('0x11')](0x1f4,_0xdef5d3[_0x77d1('0x10')]));});});};exports[_0x77d1('0x23')]=function(_0x2b4192){var _0x54aa63=this;return new Promise(function(_0x4d6a1b,_0xaed013){return db[_0x77d1('0x1d')][_0x77d1('0x24')]({'where':_0x2b4192[_0x77d1('0x16')]?_0x2b4192[_0x77d1('0x16')][_0x77d1('0x21')]||null:null})[_0x77d1('0x1c')](function(_0x3bd7a7){logger['info']('DestroyCmHopperBlack',_0x2b4192);logger[_0x77d1('0xc')](_0x77d1('0x23'),_0x2b4192,JSON[_0x77d1('0xe')](_0x3bd7a7));_0x4d6a1b(_0x3bd7a7);})[_0x77d1('0x13')](function(_0x3679c9){logger[_0x77d1('0x11')](_0x77d1('0x23'),_0x3679c9[_0x77d1('0x10')],_0x2b4192);_0xaed013(_0x54aa63[_0x77d1('0x11')](0x1f4,_0x3679c9[_0x77d1('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index ff4210e..ed0a395 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 _0xf69d=['destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete'];(function(_0x22bacd,_0x815c02){var _0x139c95=function(_0x4a6d1b){while(--_0x4a6d1b){_0x22bacd['push'](_0x22bacd['shift']());}};_0x139c95(++_0x815c02);}(_0xf69d,0xd3));var _0xdf69=function(_0x9dfb6e,_0x2e0c28){_0x9dfb6e=_0x9dfb6e-0x0;var _0x3a9e3b=_0xf69d[_0x9dfb6e];return _0x3a9e3b;};'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')]('/:id',auth[_0xdf69('0xb')](),controller[_0xdf69('0x12')]);router[_0xdf69('0x13')](_0xdf69('0xf'),auth[_0xdf69('0xb')](),controller[_0xdf69('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7ee1=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','isAuthenticated','/:id','delete','destroy','multer','express'];(function(_0x5adf5e,_0x2a29a3){var _0x315f9f=function(_0x53e915){while(--_0x53e915){_0x5adf5e['push'](_0x5adf5e['shift']());}};_0x315f9f(++_0x2a29a3);}(_0x7ee1,0x8d));var _0x17ee=function(_0x92cf86,_0x50d034){_0x92cf86=_0x92cf86-0x0;var _0x31b1c4=_0x7ee1[_0x92cf86];return _0x31b1c4;};'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')]('/describe',auth[_0x17ee('0x9')](),controller['describe']);router[_0x17ee('0x7')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller['show']);router['put']('/:id',auth[_0x17ee('0x9')](),controller['update']);router[_0x17ee('0xb')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 99db27e..dd4bbc6 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 _0x0e85=['STRING','DATE','setDataValue','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','INTEGER'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x0e85,0x1b5));var _0x50e8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0e85[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x50e8('0x0'));var moment=require(_0x50e8('0x1'));module['exports']={'state':{'type':Sequelize[_0x50e8('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x50e8('0x3')]},'scheduledat':{'type':Sequelize[_0x50e8('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x50e8('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x50e8('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x50e8('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x50e8('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x50e8('0x3')]},'originatecalleridname':{'type':Sequelize[_0x50e8('0x3')]},'calleridnum':{'type':Sequelize[_0x50e8('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x50e8('0x4')]},'responsetime':{'type':Sequelize[_0x50e8('0x4')]},'answertime':{'type':Sequelize[_0x50e8('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x50e8('0x4')]},'ringtime':{'type':Sequelize[_0x50e8('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x50e8('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x50e8('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x50e8('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x50e8('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x50e8('0x3')]},'reason':{'type':Sequelize[_0x50e8('0x3')]},'disposition':{'type':Sequelize[_0x50e8('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x50e8('0x3')]},'dispositionat':{'type':Sequelize[_0x50e8('0x4')],'set':function(_0x403835){var _0x2dfa12=this['getDataValue']('endtime');if(_0x2dfa12&&_0x403835){this[_0x50e8('0x5')]('followuptime',moment(_0x403835)[_0x50e8('0x6')](moment(_0x2dfa12),_0x50e8('0x7')));}return this[_0x50e8('0x5')](_0x50e8('0x8'),_0x403835);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x50e8('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x50e8('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x50e8('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x50e8('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x50e8('0x4')]},'recallme':{'type':Sequelize[_0x50e8('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x50e8('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x50e8('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x50e8('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe6e3=['diff','dispositionat','BOOLEAN','sequelize','exports','INTEGER','DATE','STRING','getDataValue','setDataValue','followuptime'];(function(_0x5b10c1,_0x187cf8){var _0x2a1e4e=function(_0x3595dc){while(--_0x3595dc){_0x5b10c1['push'](_0x5b10c1['shift']());}};_0x2a1e4e(++_0x187cf8);}(_0xe6e3,0x9d));var _0x3e6e=function(_0x572944,_0xd5c0df){_0x572944=_0x572944-0x0;var _0x2f457a=_0xe6e3[_0x572944];return _0x2f457a;};'use strict';var Sequelize=require(_0x3e6e('0x0'));var moment=require('moment');module[_0x3e6e('0x1')]={'state':{'type':Sequelize[_0x3e6e('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x3e6e('0x3')]},'countbusyretry':{'type':Sequelize[_0x3e6e('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3e6e('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3e6e('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3e6e('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3e6e('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x3e6e('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3e6e('0x4')]},'calleridname':{'type':Sequelize[_0x3e6e('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x3e6e('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x3e6e('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3e6e('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3e6e('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3e6e('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x3e6e('0x4')]},'membername':{'type':Sequelize[_0x3e6e('0x4')]},'reason':{'type':Sequelize[_0x3e6e('0x4')]},'disposition':{'type':Sequelize[_0x3e6e('0x4')]},'secondDisposition':{'type':Sequelize[_0x3e6e('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x3e6e('0x3')],'set':function(_0x2d1915){var _0x11dc44=this[_0x3e6e('0x5')]('endtime');if(_0x11dc44&&_0x2d1915){this[_0x3e6e('0x6')](_0x3e6e('0x7'),moment(_0x2d1915)[_0x3e6e('0x8')](moment(_0x11dc44),'seconds'));}return this[_0x3e6e('0x6')](_0x3e6e('0x9'),_0x2d1915);}},'amd':{'type':Sequelize[_0x3e6e('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3e6e('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3e6e('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x3e6e('0x3')]},'callback':{'type':Sequelize[_0x3e6e('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3e6e('0x3')]},'deleted':{'type':Sequelize[_0x3e6e('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3e6e('0x3')]},'recallme':{'type':Sequelize[_0x3e6e('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3e6e('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3e6e('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 395f006..ff654b5 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 _0x6de5=['CmHopperFinal','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','VoiceQueueId','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','ContactId','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','createdAt','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','name','send','index','map'];(function(_0x36ae67,_0x5d460f){var _0x254a0d=function(_0x361090){while(--_0x361090){_0x36ae67['push'](_0x36ae67['shift']());}};_0x254a0d(++_0x5d460f);}(_0x6de5,0x1d7));var _0x56de=function(_0x2bd894,_0x4fe8d7){_0x2bd894=_0x2bd894-0x0;var _0x434cd7=_0x6de5[_0x2bd894];return _0x434cd7;};'use strict';var emlformat=require(_0x56de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x56de('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x56de('0x2'));var moment=require('moment');var BPromise=require(_0x56de('0x3'));var Mustache=require(_0x56de('0x4'));var util=require(_0x56de('0x5'));var path=require('path');var sox=require(_0x56de('0x6'));var csv=require(_0x56de('0x7'));var ejs=require(_0x56de('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x56de('0x9'));var squel=require(_0x56de('0xa'));var crypto=require(_0x56de('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x56de('0xc'));var toCsv=require(_0x56de('0x7'));var querystring=require(_0x56de('0xd'));var Papa=require(_0x56de('0xe'));var Redis=require(_0x56de('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x56de('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56de('0x11'));var logger=require(_0x56de('0x12'))(_0x56de('0x13'));var utils=require(_0x56de('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x56de('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4028f5,_0x26e567){_0x26e567=_0x26e567||0xcc;return function(_0x380e43){if(_0x380e43){return _0x4028f5[_0x56de('0x16')](_0x26e567);}return _0x4028f5[_0x56de('0x17')](_0x26e567)[_0x56de('0x18')]();};}function respondWithResult(_0x205d40,_0x56e420){_0x56e420=_0x56e420||0xc8;return function(_0x42c540){if(_0x42c540){return _0x205d40['status'](_0x56e420)[_0x56de('0x19')](_0x42c540);}};}function respondWithFilteredResult(_0x46a317,_0x56b4da){return function(_0x98a911){if(_0x98a911){var _0x692142=_0x98a911[_0x56de('0x1a')],_0x55877f=_0x56b4da[_0x56de('0x1b')],_0x3a81b5=_0x56b4da[_0x56de('0x1b')]+_0x56b4da[_0x56de('0x1c')],_0x485020;if(_0x3a81b5>=_0x692142){_0x3a81b5=_0x692142;_0x485020=0xc8;}else{_0x485020=0xce;}_0x46a317['status'](_0x485020);return _0x46a317[_0x56de('0x1d')](_0x56de('0x1e'),_0x55877f+'-'+_0x3a81b5+'/'+_0x692142)['json'](_0x98a911);}return null;};}function patchUpdates(_0x3c05b3){return function(_0x19dd38){try{jsonpatch[_0x56de('0x1f')](_0x19dd38,_0x3c05b3,!![]);}catch(_0xe34f37){return BPromise['reject'](_0xe34f37);}return _0x19dd38[_0x56de('0x20')]();};}function saveUpdates(_0x3a96c3,_0x1345d4){return function(_0x2c39e3){if(_0x2c39e3){return _0x2c39e3[_0x56de('0x21')](_0x3a96c3)['then'](function(_0x3a50d9){return _0x3a50d9;});}return null;};}function removeEntity(_0x57a864,_0x4f5e9){return function(_0xbe6c67){if(_0xbe6c67){return _0xbe6c67[_0x56de('0x22')]()[_0x56de('0x23')](function(){_0x57a864[_0x56de('0x17')](0xcc)[_0x56de('0x18')]();});}};}function handleEntityNotFound(_0x198d16,_0x5acdf9){return function(_0x5ea9fc){if(!_0x5ea9fc){_0x198d16[_0x56de('0x16')](0x194);}return _0x5ea9fc;};}function handleError(_0x3426c3,_0x5f325e){_0x5f325e=_0x5f325e||0x1f4;return function(_0x4a8859){logger[_0x56de('0x24')](_0x4a8859['stack']);if(_0x4a8859[_0x56de('0x25')]){delete _0x4a8859[_0x56de('0x25')];}_0x3426c3['status'](_0x5f325e)[_0x56de('0x26')](_0x4a8859);};}exports[_0x56de('0x27')]=function(_0x1f8edf,_0x2d5e18){var _0x267b83={},_0x472f42={},_0x248856={'count':0x0,'rows':[]};var _0x313f02=_[_0x56de('0x28')](db[_0x56de('0x29')]['rawAttributes'],function(_0x199f51){return{'name':_0x199f51[_0x56de('0x2a')],'type':_0x199f51[_0x56de('0x2b')]['key']};});_0x472f42[_0x56de('0x2c')]=_[_0x56de('0x28')](_0x313f02,_0x56de('0x25'));_0x472f42[_0x56de('0x2d')]=_['keys'](_0x1f8edf[_0x56de('0x2d')]);_0x472f42[_0x56de('0x2e')]=_[_0x56de('0x2f')](_0x472f42[_0x56de('0x2c')],_0x472f42[_0x56de('0x2d')]);_0x267b83[_0x56de('0x30')]=_['intersection'](_0x472f42['model'],qs['fields'](_0x1f8edf['query'][_0x56de('0x31')]));_0x267b83[_0x56de('0x30')]=_0x267b83[_0x56de('0x30')][_0x56de('0x32')]?_0x267b83['attributes']:_0x472f42['model'];if(!_0x1f8edf[_0x56de('0x2d')]['hasOwnProperty'](_0x56de('0x33'))){_0x267b83[_0x56de('0x1c')]=qs['limit'](_0x1f8edf[_0x56de('0x2d')]['limit']);_0x267b83[_0x56de('0x1b')]=qs[_0x56de('0x1b')](_0x1f8edf[_0x56de('0x2d')]['offset']);}_0x267b83['order']=qs['sort'](_0x1f8edf[_0x56de('0x2d')]['sort']);_0x267b83[_0x56de('0x34')]=qs[_0x56de('0x2e')](_[_0x56de('0x35')](_0x1f8edf[_0x56de('0x2d')],_0x472f42[_0x56de('0x2e')]),_0x313f02);if(_0x1f8edf[_0x56de('0x2d')][_0x56de('0x36')]){_0x267b83[_0x56de('0x34')]=_[_0x56de('0x37')](_0x267b83[_0x56de('0x34')],{'$or':_['map'](_0x313f02,function(_0x52dcb4){if(_0x52dcb4[_0x56de('0x2b')]!=='VIRTUAL'){var _0x1a0893={};_0x1a0893[_0x52dcb4[_0x56de('0x25')]]={'$like':'%'+_0x1f8edf[_0x56de('0x2d')][_0x56de('0x36')]+'%'};return _0x1a0893;}})});}_0x267b83=_[_0x56de('0x37')]({},_0x267b83,_0x1f8edf[_0x56de('0x38')]);var _0xfc7cbc={'where':_0x267b83['where']};return db[_0x56de('0x29')][_0x56de('0x1a')](_0xfc7cbc)[_0x56de('0x23')](function(_0xf3fc2d){_0x248856[_0x56de('0x1a')]=_0xf3fc2d;if(_0x1f8edf[_0x56de('0x2d')][_0x56de('0x39')]){_0x267b83[_0x56de('0x3a')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x56de('0x3b')](_0x267b83);})[_0x56de('0x23')](function(_0x342882){_0x248856[_0x56de('0x3c')]=_0x342882;return _0x248856;})[_0x56de('0x23')](respondWithFilteredResult(_0x2d5e18,_0x267b83))[_0x56de('0x3d')](handleError(_0x2d5e18,null));};exports[_0x56de('0x3e')]=function(_0x3aee52,_0x16bd8b){var _0x205d16={'raw':!![],'where':{'id':_0x3aee52[_0x56de('0x3f')]['id']}},_0x3fcc54={};_0x3fcc54[_0x56de('0x2c')]=_[_0x56de('0x40')](db[_0x56de('0x29')]['rawAttributes']);_0x3fcc54[_0x56de('0x2d')]=_[_0x56de('0x40')](_0x3aee52[_0x56de('0x2d')]);_0x3fcc54[_0x56de('0x2e')]=_['intersection'](_0x3fcc54['model'],_0x3fcc54[_0x56de('0x2d')]);_0x205d16[_0x56de('0x30')]=_[_0x56de('0x2f')](_0x3fcc54[_0x56de('0x2c')],qs[_0x56de('0x31')](_0x3aee52[_0x56de('0x2d')]['fields']));_0x205d16[_0x56de('0x30')]=_0x205d16[_0x56de('0x30')][_0x56de('0x32')]?_0x205d16[_0x56de('0x30')]:_0x3fcc54['model'];if(_0x3aee52[_0x56de('0x2d')][_0x56de('0x39')]){_0x205d16[_0x56de('0x3a')]=[{'all':!![]}];}_0x205d16=_[_0x56de('0x37')]({},_0x205d16,_0x3aee52['options']);return db[_0x56de('0x29')][_0x56de('0x41')](_0x205d16)[_0x56de('0x23')](handleEntityNotFound(_0x16bd8b,null))[_0x56de('0x23')](respondWithResult(_0x16bd8b,null))[_0x56de('0x3d')](handleError(_0x16bd8b,null));};exports[_0x56de('0x42')]=function(_0x36917e,_0x7056ad){return db['CmHopperFinal']['describe']()['then'](respondWithResult(_0x7056ad,null))[_0x56de('0x3d')](handleError(_0x7056ad,null));};exports[_0x56de('0x21')]=function(_0x24d4ba,_0x27d1bc){if(_0x24d4ba[_0x56de('0x43')]['uniqueid']){delete _0x24d4ba[_0x56de('0x43')][_0x56de('0x44')];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0x24d4ba[_0x56de('0x3f')]['id']}})[_0x56de('0x23')](handleEntityNotFound(_0x27d1bc,null))[_0x56de('0x23')](saveUpdates(_0x24d4ba[_0x56de('0x43')],null))[_0x56de('0x23')](respondWithResult(_0x27d1bc,null))[_0x56de('0x3d')](handleError(_0x27d1bc,null));};exports[_0x56de('0x45')]=function(_0xcdfc22,_0x1ccb02,_0x19e15c){return db[_0x56de('0x29')][_0x56de('0x3b')]({'raw':![],'where':{'VoiceQueueId':_0xcdfc22[_0x56de('0x3f')]['id']},'attributes':[[db[_0x56de('0x46')]['fn'](_0x56de('0x47'),db[_0x56de('0x46')]['fn']('IF',db[_0x56de('0x46')][_0x56de('0x48')]('`state`\x20=\x200,\x201,\x20null'))),_0x56de('0x49')],[db['sequelize']['fn'](_0x56de('0x47'),db[_0x56de('0x46')]['fn']('IF',db[_0x56de('0x46')]['literal'](_0x56de('0x4a')))),'noAnswerContacts'],[db[_0x56de('0x46')]['fn'](_0x56de('0x47'),db[_0x56de('0x46')]['fn']('IF',db[_0x56de('0x46')][_0x56de('0x48')]('`state`\x20=\x205,\x201,\x20null'))),_0x56de('0x4b')],[db[_0x56de('0x46')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x56de('0x46')][_0x56de('0x48')](_0x56de('0x4c')))),_0x56de('0x4d')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x56de('0x46')][_0x56de('0x48')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x56de('0x4e')],[db['sequelize']['fn']('COUNT',db[_0x56de('0x46')]['fn']('IF',db[_0x56de('0x46')]['literal'](_0x56de('0x4f')))),_0x56de('0x50')],[db[_0x56de('0x46')]['fn'](_0x56de('0x47'),db[_0x56de('0x46')]['fn']('IF',db[_0x56de('0x46')][_0x56de('0x48')](_0x56de('0x51')))),_0x56de('0x52')],[db[_0x56de('0x46')]['fn'](_0x56de('0x47'),db[_0x56de('0x46')]['fn']('IF',db[_0x56de('0x46')][_0x56de('0x48')]('`state`\x20=\x2019,\x201,\x20null'))),_0x56de('0x53')]]})[_0x56de('0x23')](handleEntityNotFound(_0x1ccb02,null))[_0x56de('0x23')](respondWithResult(_0x1ccb02,null))[_0x56de('0x3d')](handleError(_0x1ccb02,null));};exports[_0x56de('0x54')]=function(_0x4857b1,_0x3cdb2d,_0xea4b22){return db[_0x56de('0x29')]['findAll']({'raw':![],'where':{'CampaignId':_0x4857b1[_0x56de('0x3f')]['id']},'attributes':[[db[_0x56de('0x46')]['fn']('COUNT',db[_0x56de('0x46')]['fn']('IF',db[_0x56de('0x46')]['literal'](_0x56de('0x55')))),_0x56de('0x49')],[db[_0x56de('0x46')]['fn'](_0x56de('0x47'),db[_0x56de('0x46')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x56de('0x56')],[db[_0x56de('0x46')]['fn'](_0x56de('0x47'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x56de('0x57')))),'busyContacts'],[db[_0x56de('0x46')]['fn'](_0x56de('0x47'),db['sequelize']['fn']('IF',db[_0x56de('0x46')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x56de('0x4d')],[db[_0x56de('0x46')]['fn'](_0x56de('0x47'),db[_0x56de('0x46')]['fn']('IF',db[_0x56de('0x46')][_0x56de('0x48')](_0x56de('0x58')))),_0x56de('0x4e')],[db[_0x56de('0x46')]['fn']('COUNT',db[_0x56de('0x46')]['fn']('IF',db['sequelize'][_0x56de('0x48')](_0x56de('0x4f')))),_0x56de('0x50')],[db[_0x56de('0x46')]['fn'](_0x56de('0x47'),db[_0x56de('0x46')]['fn']('IF',db['sequelize'][_0x56de('0x48')](_0x56de('0x51')))),_0x56de('0x52')],[db[_0x56de('0x46')]['fn'](_0x56de('0x47'),db['sequelize']['fn']('IF',db[_0x56de('0x46')][_0x56de('0x48')](_0x56de('0x59')))),_0x56de('0x53')]]})['then'](handleEntityNotFound(_0x3cdb2d,null))[_0x56de('0x23')](respondWithResult(_0x3cdb2d,null))[_0x56de('0x3d')](handleError(_0x3cdb2d,null));};exports[_0x56de('0x5a')]=function(_0xa74234,_0x113463,_0x43f225){return db['VoiceQueue'][_0x56de('0x41')]({'where':{'id':_0xa74234[_0x56de('0x3f')]['id']}})['then'](handleEntityNotFound(_0x113463,null))[_0x56de('0x23')](function(_0x14ee82){var _0x100ea8;if(_0x14ee82){_0x100ea8=squel[_0x56de('0x5b')]()[_0x56de('0x5c')](_0x56de('0x5d'))[_0x56de('0x5e')](['phone',_0x56de('0x5f'),'ContactId',_0x56de('0x60'),_0x56de('0x61'),'createdAt',_0x56de('0x62')],squel[_0x56de('0x63')]()[_0x56de('0x64')](_0x56de('0x65'),_0x56de('0x66'))[_0x56de('0x64')](_0x56de('0x67'),_0x56de('0x5f'))[_0x56de('0x64')](_0x56de('0x68'),'ContactId')[_0x56de('0x64')]('ANY_VALUE(ListId)',_0x56de('0x60'))[_0x56de('0x64')](_0x56de('0x69'),_0x56de('0x61'))['field']('NOW()','createdAt')[_0x56de('0x64')](_0x56de('0x67'),_0x56de('0x62'))[_0x56de('0x6a')](_0x56de('0x6b'))[_0x56de('0x34')](_0x56de('0x6c'),_0xa74234[_0x56de('0x3f')]['id'][_0x56de('0x6d')]())[_0x56de('0x34')]('state\x20=\x20?',_0xa74234[_0x56de('0x43')][_0x56de('0x6e')][_0x56de('0x6d')]())[_0x56de('0x34')](_0x56de('0x6f'))[_0x56de('0x34')](_0x56de('0x70'),squel[_0x56de('0x63')]()['field']('phone')[_0x56de('0x6a')](_0x56de('0x5d'))['where'](_0x56de('0x6c'),_0xa74234[_0x56de('0x3f')]['id'][_0x56de('0x6d')]()))[_0x56de('0x34')](_0x56de('0x70'),squel[_0x56de('0x63')]()[_0x56de('0x64')](_0x56de('0x71'))['from'](_0x56de('0x6b'))[_0x56de('0x34')](_0x56de('0x6c'),_0xa74234[_0x56de('0x3f')]['id']['toString']())['where'](_0x56de('0x72')))[_0x56de('0x73')](_0x56de('0x74')))[_0x56de('0x6d')]();return db[_0x56de('0x46')]['query'](_0x100ea8);}return[];})[_0x56de('0x23')](respondWithResult(_0x113463,null))['catch'](handleError(_0x113463,null));};exports[_0x56de('0x75')]=function(_0x16dba6,_0x1ccc27,_0x58edff){return db[_0x56de('0x76')]['find']({'where':{'id':_0x16dba6[_0x56de('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1ccc27,null))[_0x56de('0x23')](function(_0x590fa0){var _0x9de6c7;if(_0x590fa0){_0x9de6c7=squel[_0x56de('0x5b')]()[_0x56de('0x5c')](_0x56de('0x5d'))['fromQuery']([_0x56de('0x66'),_0x56de('0x5f'),_0x56de('0x74'),_0x56de('0x60'),_0x56de('0x77'),_0x56de('0x78'),_0x56de('0x62')],squel[_0x56de('0x63')]()['field'](_0x56de('0x65'),_0x56de('0x66'))['field'](_0x56de('0x67'),_0x56de('0x5f'))[_0x56de('0x64')](_0x56de('0x68'),'ContactId')[_0x56de('0x64')](_0x56de('0x79'),_0x56de('0x60'))['field'](_0x56de('0x7a'),_0x56de('0x77'))[_0x56de('0x64')]('NOW()','createdAt')[_0x56de('0x64')](_0x56de('0x67'),'updatedAt')['from'](_0x56de('0x6b'))[_0x56de('0x34')](_0x56de('0x7b'),_0x16dba6['params']['id'][_0x56de('0x6d')]())['where'](_0x56de('0x7c'),_0x16dba6[_0x56de('0x43')][_0x56de('0x6e')][_0x56de('0x6d')]())[_0x56de('0x34')](_0x56de('0x6f'))[_0x56de('0x34')](_0x56de('0x70'),squel[_0x56de('0x63')]()[_0x56de('0x64')](_0x56de('0x66'))[_0x56de('0x6a')](_0x56de('0x5d'))[_0x56de('0x34')]('CampaignId\x20=\x20?',_0x16dba6[_0x56de('0x3f')]['id'][_0x56de('0x6d')]()))[_0x56de('0x34')](_0x56de('0x70'),squel[_0x56de('0x63')]()[_0x56de('0x64')](_0x56de('0x71'))[_0x56de('0x6a')](_0x56de('0x6b'))[_0x56de('0x34')](_0x56de('0x7b'),_0x16dba6[_0x56de('0x3f')]['id']['toString']())[_0x56de('0x34')](_0x56de('0x72')))[_0x56de('0x73')]('ContactId'))[_0x56de('0x6d')]();return db['sequelize']['query'](_0x9de6c7);}return[];})['then'](respondWithResult(_0x1ccc27,null))[_0x56de('0x3d')](handleError(_0x1ccc27,null));};exports[_0x56de('0x7d')]=function(_0x89ff94,_0x197c46,_0x373822){return db[_0x56de('0x7e')][_0x56de('0x7f')]({'where':{'VoiceQueueId':_0x89ff94[_0x56de('0x43')][_0x56de('0x61')],'CampaignId':_0x89ff94[_0x56de('0x43')][_0x56de('0x77')],'ContactId':_0x89ff94[_0x56de('0x43')][_0x56de('0x74')]}})[_0x56de('0x23')](handleEntityNotFound(_0x197c46,null))['then'](function(_0x1683f0){if(_0x1683f0){return _0x1683f0;}return null;})[_0x56de('0x23')](respondWithResult(_0x197c46,null))['catch'](handleError(_0x197c46,null));}; \ No newline at end of file +var _0xd95e=['to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperFinal','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','rawAttributes','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x203,\x201,\x20null','COUNT','`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=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','noAnswerContacts','`state`\x20=\x2010\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','cm_hopper','cm_hopper_final','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js'];(function(_0x1ff548,_0x2c1e89){var _0x113884=function(_0x250e83){while(--_0x250e83){_0x1ff548['push'](_0x1ff548['shift']());}};_0x113884(++_0x2c1e89);}(_0xd95e,0x171));var _0xed95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd95e[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xed95('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed95('0x1'));var jsonpatch=require(_0xed95('0x2'));var rp=require('request-promise');var moment=require(_0xed95('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xed95('0x4'));var util=require(_0xed95('0x5'));var path=require(_0xed95('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xed95('0x7'));var fs=require('fs');var fs_extra=require(_0xed95('0x8'));var _=require('lodash');var squel=require(_0xed95('0x9'));var crypto=require(_0xed95('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xed95('0xb'));var toCsv=require(_0xed95('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xed95('0xd'));var authService=require(_0xed95('0xe'));var qs=require(_0xed95('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed95('0x10'));var logger=require(_0xed95('0x11'))(_0xed95('0x12'));var utils=require(_0xed95('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xed95('0x14'));var db=require(_0xed95('0x15'))['db'];function respondWithStatusCode(_0x22b0b5,_0x137897){_0x137897=_0x137897||0xcc;return function(_0x17a5ae){if(_0x17a5ae){return _0x22b0b5[_0xed95('0x16')](_0x137897);}return _0x22b0b5['status'](_0x137897)['end']();};}function respondWithResult(_0x893cd8,_0x450d2e){_0x450d2e=_0x450d2e||0xc8;return function(_0x507c91){if(_0x507c91){return _0x893cd8[_0xed95('0x17')](_0x450d2e)[_0xed95('0x18')](_0x507c91);}};}function respondWithFilteredResult(_0x9f5373,_0x451064){return function(_0x2bf559){if(_0x2bf559){var _0xcdba45=_0x2bf559['count'],_0x3f8e04=_0x451064[_0xed95('0x19')],_0x4a6247=_0x451064[_0xed95('0x19')]+_0x451064['limit'],_0x1338c4;if(_0x4a6247>=_0xcdba45){_0x4a6247=_0xcdba45;_0x1338c4=0xc8;}else{_0x1338c4=0xce;}_0x9f5373[_0xed95('0x17')](_0x1338c4);return _0x9f5373['set']('Content-Range',_0x3f8e04+'-'+_0x4a6247+'/'+_0xcdba45)[_0xed95('0x18')](_0x2bf559);}return null;};}function patchUpdates(_0x2e0169){return function(_0xc05f3f){try{jsonpatch[_0xed95('0x1a')](_0xc05f3f,_0x2e0169,!![]);}catch(_0x1c9b14){return BPromise[_0xed95('0x1b')](_0x1c9b14);}return _0xc05f3f[_0xed95('0x1c')]();};}function saveUpdates(_0x59763e,_0x53943b){return function(_0x28ee66){if(_0x28ee66){return _0x28ee66[_0xed95('0x1d')](_0x59763e)[_0xed95('0x1e')](function(_0x1f6019){return _0x1f6019;});}return null;};}function removeEntity(_0xe53ad6,_0x47e242){return function(_0x5b60bb){if(_0x5b60bb){return _0x5b60bb[_0xed95('0x1f')]()[_0xed95('0x1e')](function(){_0xe53ad6[_0xed95('0x17')](0xcc)[_0xed95('0x20')]();});}};}function handleEntityNotFound(_0xad8543,_0x3cddde){return function(_0x811529){if(!_0x811529){_0xad8543[_0xed95('0x16')](0x194);}return _0x811529;};}function handleError(_0x4f15f2,_0x55455d){_0x55455d=_0x55455d||0x1f4;return function(_0x1b5091){logger[_0xed95('0x21')](_0x1b5091['stack']);if(_0x1b5091[_0xed95('0x22')]){delete _0x1b5091[_0xed95('0x22')];}_0x4f15f2['status'](_0x55455d)[_0xed95('0x23')](_0x1b5091);};}exports[_0xed95('0x24')]=function(_0x210ece,_0x973d43){var _0x386651={},_0x14c55e={},_0x4567a9={'count':0x0,'rows':[]};var _0x7515a8=_[_0xed95('0x25')](db[_0xed95('0x26')]['rawAttributes'],function(_0x2e3376){return{'name':_0x2e3376['fieldName'],'type':_0x2e3376['type']['key']};});_0x14c55e[_0xed95('0x27')]=_[_0xed95('0x25')](_0x7515a8,_0xed95('0x22'));_0x14c55e[_0xed95('0x28')]=_[_0xed95('0x29')](_0x210ece[_0xed95('0x28')]);_0x14c55e['filters']=_['intersection'](_0x14c55e[_0xed95('0x27')],_0x14c55e['query']);_0x386651['attributes']=_[_0xed95('0x2a')](_0x14c55e['model'],qs[_0xed95('0x2b')](_0x210ece[_0xed95('0x28')][_0xed95('0x2b')]));_0x386651[_0xed95('0x2c')]=_0x386651['attributes'][_0xed95('0x2d')]?_0x386651[_0xed95('0x2c')]:_0x14c55e[_0xed95('0x27')];if(!_0x210ece[_0xed95('0x28')][_0xed95('0x2e')](_0xed95('0x2f'))){_0x386651[_0xed95('0x30')]=qs[_0xed95('0x30')](_0x210ece[_0xed95('0x28')]['limit']);_0x386651[_0xed95('0x19')]=qs[_0xed95('0x19')](_0x210ece['query'][_0xed95('0x19')]);}_0x386651[_0xed95('0x31')]=qs[_0xed95('0x32')](_0x210ece[_0xed95('0x28')]['sort']);_0x386651[_0xed95('0x33')]=qs[_0xed95('0x34')](_[_0xed95('0x35')](_0x210ece['query'],_0x14c55e[_0xed95('0x34')]),_0x7515a8);if(_0x210ece['query']['filter']){_0x386651[_0xed95('0x33')]=_[_0xed95('0x36')](_0x386651[_0xed95('0x33')],{'$or':_[_0xed95('0x25')](_0x7515a8,function(_0x4d6468){if(_0x4d6468['type']!==_0xed95('0x37')){var _0x1e9e51={};_0x1e9e51[_0x4d6468['name']]={'$like':'%'+_0x210ece[_0xed95('0x28')][_0xed95('0x38')]+'%'};return _0x1e9e51;}})});}_0x386651=_['merge']({},_0x386651,_0x210ece[_0xed95('0x39')]);var _0x1ee195={'where':_0x386651[_0xed95('0x33')]};return db[_0xed95('0x26')]['count'](_0x1ee195)[_0xed95('0x1e')](function(_0x4ca04b){_0x4567a9[_0xed95('0x3a')]=_0x4ca04b;if(_0x210ece[_0xed95('0x28')][_0xed95('0x3b')]){_0x386651[_0xed95('0x3c')]=[{'all':!![]}];}return db[_0xed95('0x26')][_0xed95('0x3d')](_0x386651);})['then'](function(_0x39281d){_0x4567a9[_0xed95('0x3e')]=_0x39281d;return _0x4567a9;})[_0xed95('0x1e')](respondWithFilteredResult(_0x973d43,_0x386651))['catch'](handleError(_0x973d43,null));};exports[_0xed95('0x3f')]=function(_0x29d9b8,_0xe3c92){var _0x37aca5={'raw':!![],'where':{'id':_0x29d9b8['params']['id']}},_0x380e61={};_0x380e61[_0xed95('0x27')]=_[_0xed95('0x29')](db[_0xed95('0x26')][_0xed95('0x40')]);_0x380e61['query']=_[_0xed95('0x29')](_0x29d9b8[_0xed95('0x28')]);_0x380e61['filters']=_[_0xed95('0x2a')](_0x380e61['model'],_0x380e61[_0xed95('0x28')]);_0x37aca5[_0xed95('0x2c')]=_[_0xed95('0x2a')](_0x380e61[_0xed95('0x27')],qs[_0xed95('0x2b')](_0x29d9b8['query'][_0xed95('0x2b')]));_0x37aca5['attributes']=_0x37aca5[_0xed95('0x2c')][_0xed95('0x2d')]?_0x37aca5[_0xed95('0x2c')]:_0x380e61[_0xed95('0x27')];if(_0x29d9b8['query'][_0xed95('0x3b')]){_0x37aca5[_0xed95('0x3c')]=[{'all':!![]}];}_0x37aca5=_[_0xed95('0x36')]({},_0x37aca5,_0x29d9b8[_0xed95('0x39')]);return db[_0xed95('0x26')][_0xed95('0x41')](_0x37aca5)['then'](handleEntityNotFound(_0xe3c92,null))['then'](respondWithResult(_0xe3c92,null))[_0xed95('0x42')](handleError(_0xe3c92,null));};exports[_0xed95('0x43')]=function(_0xf13729,_0x46cfaf){return db[_0xed95('0x26')][_0xed95('0x43')]()[_0xed95('0x1e')](respondWithResult(_0x46cfaf,null))[_0xed95('0x42')](handleError(_0x46cfaf,null));};exports[_0xed95('0x1d')]=function(_0x3a115a,_0x2946d2){if(_0x3a115a[_0xed95('0x44')][_0xed95('0x45')]){delete _0x3a115a[_0xed95('0x44')][_0xed95('0x45')];}return db[_0xed95('0x26')][_0xed95('0x41')]({'where':{'uniqueid':_0x3a115a[_0xed95('0x46')]['id']}})[_0xed95('0x1e')](handleEntityNotFound(_0x2946d2,null))[_0xed95('0x1e')](saveUpdates(_0x3a115a[_0xed95('0x44')],null))['then'](respondWithResult(_0x2946d2,null))['catch'](handleError(_0x2946d2,null));};exports[_0xed95('0x47')]=function(_0x3a0946,_0x188373,_0x154171){return db[_0xed95('0x26')][_0xed95('0x3d')]({'raw':![],'where':{'VoiceQueueId':_0x3a0946[_0xed95('0x46')]['id']},'attributes':[[db[_0xed95('0x48')]['fn']('COUNT',db[_0xed95('0x48')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xed95('0x48')][_0xed95('0x49')](_0xed95('0x4a')))),'noAnswerContacts'],[db[_0xed95('0x48')]['fn'](_0xed95('0x4b'),db[_0xed95('0x48')]['fn']('IF',db[_0xed95('0x48')][_0xed95('0x49')](_0xed95('0x4c')))),_0xed95('0x4d')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xed95('0x48')][_0xed95('0x49')](_0xed95('0x4e')))),_0xed95('0x4f')],[db[_0xed95('0x48')]['fn'](_0xed95('0x4b'),db[_0xed95('0x48')]['fn']('IF',db[_0xed95('0x48')][_0xed95('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xed95('0x50')],[db[_0xed95('0x48')]['fn'](_0xed95('0x4b'),db[_0xed95('0x48')]['fn']('IF',db[_0xed95('0x48')][_0xed95('0x49')](_0xed95('0x51')))),_0xed95('0x52')],[db['sequelize']['fn'](_0xed95('0x4b'),db[_0xed95('0x48')]['fn']('IF',db[_0xed95('0x48')][_0xed95('0x49')](_0xed95('0x53')))),'reCallContacts'],[db['sequelize']['fn'](_0xed95('0x4b'),db[_0xed95('0x48')]['fn']('IF',db['sequelize'][_0xed95('0x49')](_0xed95('0x54')))),_0xed95('0x55')]]})[_0xed95('0x1e')](handleEntityNotFound(_0x188373,null))[_0xed95('0x1e')](respondWithResult(_0x188373,null))[_0xed95('0x42')](handleError(_0x188373,null));};exports[_0xed95('0x56')]=function(_0x21ca9d,_0x46b725,_0x476482){return db[_0xed95('0x26')][_0xed95('0x3d')]({'raw':![],'where':{'CampaignId':_0x21ca9d[_0xed95('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0xed95('0x4b'),db[_0xed95('0x48')]['fn']('IF',db[_0xed95('0x48')][_0xed95('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0xed95('0x57')],[db[_0xed95('0x48')]['fn'](_0xed95('0x4b'),db[_0xed95('0x48')]['fn']('IF',db[_0xed95('0x48')][_0xed95('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0xed95('0x58')],[db[_0xed95('0x48')]['fn'](_0xed95('0x4b'),db[_0xed95('0x48')]['fn']('IF',db[_0xed95('0x48')]['literal'](_0xed95('0x4c')))),_0xed95('0x4d')],[db['sequelize']['fn'](_0xed95('0x4b'),db['sequelize']['fn']('IF',db[_0xed95('0x48')][_0xed95('0x49')](_0xed95('0x4e')))),_0xed95('0x4f')],[db['sequelize']['fn'](_0xed95('0x4b'),db['sequelize']['fn']('IF',db[_0xed95('0x48')][_0xed95('0x49')](_0xed95('0x59')))),'dropContacts'],[db[_0xed95('0x48')]['fn'](_0xed95('0x4b'),db[_0xed95('0x48')]['fn']('IF',db['sequelize'][_0xed95('0x49')](_0xed95('0x51')))),_0xed95('0x52')],[db[_0xed95('0x48')]['fn']('COUNT',db[_0xed95('0x48')]['fn']('IF',db[_0xed95('0x48')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0xed95('0x5a')],[db[_0xed95('0x48')]['fn'](_0xed95('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0xed95('0x49')](_0xed95('0x54')))),_0xed95('0x55')]]})[_0xed95('0x1e')](handleEntityNotFound(_0x46b725,null))['then'](respondWithResult(_0x46b725,null))[_0xed95('0x42')](handleError(_0x46b725,null));};exports[_0xed95('0x5b')]=function(_0x5cabb1,_0x2c8cce,_0x3ae895){return db[_0xed95('0x5c')][_0xed95('0x41')]({'where':{'id':_0x5cabb1['params']['id']}})[_0xed95('0x1e')](handleEntityNotFound(_0x2c8cce,null))['then'](function(_0x2b55e0){var _0xbf0832;if(_0x2b55e0){_0xbf0832=squel[_0xed95('0x5d')]()['into']('cm_hopper')[_0xed95('0x5e')](['phone',_0xed95('0x5f'),_0xed95('0x60'),_0xed95('0x61'),_0xed95('0x62'),_0xed95('0x63'),_0xed95('0x64')],squel[_0xed95('0x65')]()[_0xed95('0x66')](_0xed95('0x67'),_0xed95('0x68'))[_0xed95('0x66')](_0xed95('0x69'),_0xed95('0x5f'))[_0xed95('0x66')](_0xed95('0x6a'),_0xed95('0x60'))[_0xed95('0x66')](_0xed95('0x6b'),_0xed95('0x61'))[_0xed95('0x66')](_0xed95('0x6c'),_0xed95('0x62'))[_0xed95('0x66')](_0xed95('0x69'),'createdAt')[_0xed95('0x66')]('NOW()',_0xed95('0x64'))['from']('cm_hopper_final')[_0xed95('0x33')](_0xed95('0x6d'),_0x5cabb1[_0xed95('0x46')]['id'][_0xed95('0x6e')]())[_0xed95('0x33')]('state\x20=\x20?',_0x5cabb1[_0xed95('0x44')][_0xed95('0x6f')]['toString']())['where'](_0xed95('0x70'))[_0xed95('0x33')](_0xed95('0x71'),squel[_0xed95('0x65')]()[_0xed95('0x66')](_0xed95('0x68'))[_0xed95('0x72')](_0xed95('0x73'))[_0xed95('0x33')](_0xed95('0x6d'),_0x5cabb1[_0xed95('0x46')]['id'][_0xed95('0x6e')]()))[_0xed95('0x33')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xed95('0x65')]()[_0xed95('0x66')]('calleridnum')[_0xed95('0x72')](_0xed95('0x74'))[_0xed95('0x33')](_0xed95('0x6d'),_0x5cabb1[_0xed95('0x46')]['id'][_0xed95('0x6e')]())['where'](_0xed95('0x75')))['group'](_0xed95('0x60')))['toString']();return db[_0xed95('0x48')][_0xed95('0x28')](_0xbf0832);}return[];})['then'](respondWithResult(_0x2c8cce,null))[_0xed95('0x42')](handleError(_0x2c8cce,null));};exports[_0xed95('0x76')]=function(_0x51d3c1,_0x172948,_0x686cc0){return db[_0xed95('0x77')][_0xed95('0x41')]({'where':{'id':_0x51d3c1[_0xed95('0x46')]['id']}})[_0xed95('0x1e')](handleEntityNotFound(_0x172948,null))['then'](function(_0x5b80f1){var _0x3e12be;if(_0x5b80f1){_0x3e12be=squel['insert']()[_0xed95('0x78')](_0xed95('0x73'))['fromQuery']([_0xed95('0x68'),_0xed95('0x5f'),_0xed95('0x60'),_0xed95('0x61'),_0xed95('0x79'),_0xed95('0x63'),_0xed95('0x64')],squel[_0xed95('0x65')]()['field'](_0xed95('0x67'),_0xed95('0x68'))[_0xed95('0x66')](_0xed95('0x69'),_0xed95('0x5f'))[_0xed95('0x66')]('ANY_VALUE(ContactId)',_0xed95('0x60'))[_0xed95('0x66')](_0xed95('0x6b'),_0xed95('0x61'))[_0xed95('0x66')](_0xed95('0x7a'),_0xed95('0x79'))[_0xed95('0x66')](_0xed95('0x69'),'createdAt')[_0xed95('0x66')]('NOW()',_0xed95('0x64'))['from'](_0xed95('0x74'))[_0xed95('0x33')](_0xed95('0x7b'),_0x51d3c1[_0xed95('0x46')]['id']['toString']())[_0xed95('0x33')]('state\x20=\x20?',_0x51d3c1[_0xed95('0x44')][_0xed95('0x6f')][_0xed95('0x6e')]())[_0xed95('0x33')](_0xed95('0x70'))[_0xed95('0x33')](_0xed95('0x71'),squel['select']()[_0xed95('0x66')]('phone')[_0xed95('0x72')]('cm_hopper')[_0xed95('0x33')](_0xed95('0x7b'),_0x51d3c1[_0xed95('0x46')]['id'][_0xed95('0x6e')]()))['where'](_0xed95('0x71'),squel[_0xed95('0x65')]()[_0xed95('0x66')](_0xed95('0x7c'))['from']('cm_hopper_final')[_0xed95('0x33')](_0xed95('0x7b'),_0x51d3c1[_0xed95('0x46')]['id'][_0xed95('0x6e')]())[_0xed95('0x33')](_0xed95('0x75')))['group'](_0xed95('0x60')))[_0xed95('0x6e')]();return db[_0xed95('0x48')]['query'](_0x3e12be);}return[];})['then'](respondWithResult(_0x172948,null))[_0xed95('0x42')](handleError(_0x172948,null));};exports[_0xed95('0x7d')]=function(_0x1a2ded,_0x2fc676,_0x230ebd){return db[_0xed95('0x7e')]['findOne']({'where':{'VoiceQueueId':_0x1a2ded['body'][_0xed95('0x62')],'CampaignId':_0x1a2ded['body'][_0xed95('0x79')],'ContactId':_0x1a2ded[_0xed95('0x44')][_0xed95('0x60')]}})[_0xed95('0x1e')](handleEntityNotFound(_0x2fc676,null))['then'](function(_0x1c5f76){if(_0x1c5f76){return _0x1c5f76;}return null;})[_0xed95('0x1e')](respondWithResult(_0x2fc676,null))[_0xed95('0x42')](handleError(_0x2fc676,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 751cff8..389ce8b 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 _0xfc5f=['request-promise','path','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','uniqueid','util','../../config/logger','moment','bluebird'];(function(_0x5cb7fa,_0x1ecfed){var _0x46d389=function(_0xcc1122){while(--_0xcc1122){_0x5cb7fa['push'](_0x5cb7fa['shift']());}};_0x46d389(++_0x1ecfed);}(_0xfc5f,0x98));var _0xffc5=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xfc5f[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require(_0xffc5('0x0'));var logger=require(_0xffc5('0x1'))('api');var moment=require(_0xffc5('0x2'));var BPromise=require(_0xffc5('0x3'));var rp=require(_0xffc5('0x4'));var fs=require('fs');var path=require(_0xffc5('0x5'));var rimraf=require(_0xffc5('0x6'));var config=require('../../config/environment');var attributes=require(_0xffc5('0x7'));module[_0xffc5('0x8')]=function(_0x1c62e4,_0x375ce7){return _0x1c62e4[_0xffc5('0x9')](_0xffc5('0xa'),attributes,{'tableName':_0xffc5('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0xffc5('0xc'),'fields':[_0xffc5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa853=['rimraf','exports','CmHopperFinal','cm_hopper_final','calleridnum','lodash','util','request-promise'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa853,0x195));var _0x3a85=function(_0x5a96fb,_0x573d18){_0x5a96fb=_0x5a96fb-0x0;var _0x55f58c=_0xa853[_0x5a96fb];return _0x55f58c;};'use strict';var _=require(_0x3a85('0x0'));var util=require(_0x3a85('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3a85('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a85('0x3'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x3a85('0x4')]=function(_0x6e51ff,_0xf12b8d){return _0x6e51ff['define'](_0x3a85('0x5'),attributes,{'tableName':_0x3a85('0x6'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x3a85('0x7')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 68e3500..abd3e2d 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 _0x31b3=['CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','then','stringify','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x31b3,0xb7));var _0x331b=function(_0x4b775b,_0x2aadc6){_0x4b775b=_0x4b775b-0x0;var _0xf84d39=_0x31b3[_0x4b775b];return _0xf84d39;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x331b('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x331b('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x331b('0x2'));var logger=require(_0x331b('0x3'))('rpc');var config=require(_0x331b('0x4'));var jayson=require(_0x331b('0x5'));var client=jayson[_0x331b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d38ec,_0x26ace4,_0x5b410c){return new BPromise(function(_0x402f36,_0xfa1b58){return client['request'](_0x3d38ec,_0x5b410c)['then'](function(_0x4ce659){logger['info'](_0x331b('0x7'),_0x26ace4,_0x331b('0x8'));logger[_0x331b('0x9')](_0x331b('0xa'),_0x26ace4,_0x331b('0x8'),JSON['stringify'](_0x4ce659));if(_0x4ce659[_0x331b('0xb')]){if(_0x4ce659['error'][_0x331b('0xc')]===0x1f4){logger[_0x331b('0xb')](_0x331b('0x7'),_0x26ace4,_0x4ce659['error']['message']);return _0xfa1b58(_0x4ce659[_0x331b('0xb')][_0x331b('0xd')]);}logger['error'](_0x331b('0x7'),_0x26ace4,_0x4ce659[_0x331b('0xb')][_0x331b('0xd')]);return _0x402f36(_0x4ce659[_0x331b('0xb')][_0x331b('0xd')]);}else{logger[_0x331b('0xe')](_0x331b('0x7'),_0x26ace4,'request\x20sent');_0x402f36(_0x4ce659[_0x331b('0xf')][_0x331b('0xd')]);}})[_0x331b('0x10')](function(_0xf7543c){logger[_0x331b('0xb')](_0x331b('0x7'),_0x26ace4,_0xf7543c);_0xfa1b58(_0xf7543c);});});}exports[_0x331b('0x11')]=function(_0x8a5577){var _0x6d0e3d=this;return new Promise(function(_0x559ed3,_0xc6d2ba){return db[_0x331b('0x12')][_0x331b('0x13')](_0x8a5577[_0x331b('0x14')],{'raw':_0x8a5577[_0x331b('0x15')]?_0x8a5577[_0x331b('0x15')][_0x331b('0x16')]===undefined?!![]:![]:!![]})[_0x331b('0x17')](function(_0x340ebf){logger[_0x331b('0xe')](_0x331b('0x11'),_0x8a5577);logger[_0x331b('0x9')]('CreateCmHopperFinal',_0x8a5577,JSON[_0x331b('0x18')](_0x340ebf));_0x559ed3(_0x340ebf);})[_0x331b('0x10')](function(_0x5040de){logger[_0x331b('0xb')]('CreateCmHopperFinal',_0x5040de[_0x331b('0xd')],_0x8a5577);_0xc6d2ba(_0x6d0e3d[_0x331b('0xb')](0x1f4,_0x5040de[_0x331b('0xd')]));});});}; \ No newline at end of file +var _0x6b0b=['body','options','raw','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateCmHopperFinal','CmHopperFinal','create'];(function(_0x375f61,_0x52b949){var _0x333182=function(_0x638bff){while(--_0x638bff){_0x375f61['push'](_0x375f61['shift']());}};_0x333182(++_0x52b949);}(_0x6b0b,0x1c6));var _0xb6b0=function(_0x2e36a9,_0x28088a){_0x2e36a9=_0x2e36a9-0x0;var _0xd7417d=_0x6b0b[_0x2e36a9];return _0xd7417d;};'use strict';var _=require(_0xb6b0('0x0'));var util=require(_0xb6b0('0x1'));var moment=require(_0xb6b0('0x2'));var BPromise=require(_0xb6b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6b0('0x4'));var db=require(_0xb6b0('0x5'))['db'];var utils=require(_0xb6b0('0x6'));var logger=require('../../config/logger')(_0xb6b0('0x7'));var config=require(_0xb6b0('0x8'));var jayson=require(_0xb6b0('0x9'));var client=jayson[_0xb6b0('0xa')][_0xb6b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x150542,_0x2b452a,_0x5ab80c){return new BPromise(function(_0x4157b6,_0x16e78a){return client[_0xb6b0('0xc')](_0x150542,_0x5ab80c)['then'](function(_0x20b9bb){logger[_0xb6b0('0xd')](_0xb6b0('0xe'),_0x2b452a,_0xb6b0('0xf'));logger[_0xb6b0('0x10')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x2b452a,_0xb6b0('0xf'),JSON[_0xb6b0('0x11')](_0x20b9bb));if(_0x20b9bb[_0xb6b0('0x12')]){if(_0x20b9bb['error'][_0xb6b0('0x13')]===0x1f4){logger[_0xb6b0('0x12')](_0xb6b0('0xe'),_0x2b452a,_0x20b9bb['error']['message']);return _0x16e78a(_0x20b9bb[_0xb6b0('0x12')][_0xb6b0('0x14')]);}logger['error']('CmHopperFinal,\x20%s,\x20%s',_0x2b452a,_0x20b9bb[_0xb6b0('0x12')][_0xb6b0('0x14')]);return _0x4157b6(_0x20b9bb[_0xb6b0('0x12')][_0xb6b0('0x14')]);}else{logger[_0xb6b0('0xd')](_0xb6b0('0xe'),_0x2b452a,_0xb6b0('0xf'));_0x4157b6(_0x20b9bb[_0xb6b0('0x15')][_0xb6b0('0x14')]);}})[_0xb6b0('0x16')](function(_0x2485a4){logger[_0xb6b0('0x12')](_0xb6b0('0xe'),_0x2b452a,_0x2485a4);_0x16e78a(_0x2485a4);});});}exports[_0xb6b0('0x17')]=function(_0x227d62){var _0xcc58d6=this;return new Promise(function(_0x1128db,_0x1af50b){return db[_0xb6b0('0x18')][_0xb6b0('0x19')](_0x227d62[_0xb6b0('0x1a')],{'raw':_0x227d62[_0xb6b0('0x1b')]?_0x227d62['options'][_0xb6b0('0x1c')]===undefined?!![]:![]:!![]})[_0xb6b0('0x1d')](function(_0x43ee99){logger[_0xb6b0('0xd')](_0xb6b0('0x17'),_0x227d62);logger['debug'](_0xb6b0('0x17'),_0x227d62,JSON[_0xb6b0('0x11')](_0x43ee99));_0x1128db(_0x43ee99);})[_0xb6b0('0x16')](function(_0x2a8401){logger['error'](_0xb6b0('0x17'),_0x2a8401[_0xb6b0('0x14')],_0x227d62);_0x1af50b(_0xcc58d6['error'](0x1f4,_0x2a8401[_0xb6b0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index d4258b1..57cf5fe 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 _0x30c5=['isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','index','get','/describe'];(function(_0x17649c,_0x1bbb50){var _0x198013=function(_0x20155a){while(--_0x20155a){_0x17649c['push'](_0x17649c['shift']());}};_0x198013(++_0x1bbb50);}(_0x30c5,0x161));var _0x530c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x30c5[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x530c('0x0'));var util=require('util');var path=require(_0x530c('0x1'));var timeout=require('connect-timeout');var express=require(_0x530c('0x2'));var router=express[_0x530c('0x3')]();var fs_extra=require(_0x530c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x530c('0x5'));var config=require(_0x530c('0x6'));var controller=require(_0x530c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x530c('0x8')]);router[_0x530c('0x9')](_0x530c('0xa'),auth[_0x530c('0xb')](),controller[_0x530c('0xc')]);router[_0x530c('0x9')](_0x530c('0xd'),auth[_0x530c('0xb')](),controller[_0x530c('0xe')]);router[_0x530c('0x9')](_0x530c('0xf'),auth[_0x530c('0xb')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x530c('0x9')](_0x530c('0x10'),auth[_0x530c('0xb')](),controller[_0x530c('0x11')]);router[_0x530c('0x12')](_0x530c('0x13'),auth['isAuthenticated'](),controller[_0x530c('0x14')]);router['post'](_0x530c('0x15'),auth[_0x530c('0xb')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x530c('0x12')](_0x530c('0x16'),auth[_0x530c('0xb')](),controller[_0x530c('0x17')]);router[_0x530c('0x18')](_0x530c('0xd'),auth[_0x530c('0xb')](),controller['update']);module[_0x530c('0x19')]=router; \ No newline at end of file +var _0x538f=['/describe','describe','isAuthenticated','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index'];(function(_0x260019,_0x158033){var _0x59929f=function(_0x5e4e2b){while(--_0x5e4e2b){_0x260019['push'](_0x260019['shift']());}};_0x59929f(++_0x158033);}(_0x538f,0x108));var _0xf538=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x538f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xf538('0x0'));var path=require(_0xf538('0x1'));var timeout=require(_0xf538('0x2'));var express=require(_0xf538('0x3'));var router=express[_0xf538('0x4')]();var fs_extra=require(_0xf538('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf538('0x6'));var config=require(_0xf538('0x7'));var controller=require(_0xf538('0x8'));router[_0xf538('0x9')]('/',auth['isAuthenticated'](),controller[_0xf538('0xa')]);router['get'](_0xf538('0xb'),auth['isAuthenticated'](),controller[_0xf538('0xc')]);router[_0xf538('0x9')]('/:id',auth[_0xf538('0xd')](),controller[_0xf538('0xe')]);router['get'](_0xf538('0xf'),auth[_0xf538('0xd')](),controller[_0xf538('0x10')]);router[_0xf538('0x9')](_0xf538('0x11'),auth[_0xf538('0xd')](),controller[_0xf538('0x12')]);router['post']('/voice/queue/moveContacts/:id',auth[_0xf538('0xd')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0xf538('0x13'),auth['isAuthenticated'](),controller[_0xf538('0x14')]);router['post'](_0xf538('0x15'),auth[_0xf538('0xd')](),controller[_0xf538('0x16')]);router['put'](_0xf538('0x17'),auth['isAuthenticated'](),controller['update']);module[_0xf538('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 7daab6e..2cf97ef 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 _0x9a0a=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9a0a,0x17c));var _0xa9a0=function(_0x5f24f5,_0x3f8e47){_0x5f24f5=_0x5f24f5-0x0;var _0x6bf464=_0x9a0a[_0x5f24f5];return _0x6bf464;};'use strict';var Sequelize=require(_0xa9a0('0x0'));module[_0xa9a0('0x1')]={'state':{'type':Sequelize[_0xa9a0('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa9a0('0x3')]},'scheduledat':{'type':Sequelize[_0xa9a0('0x4')]},'countbusyretry':{'type':Sequelize[_0xa9a0('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa9a0('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xa9a0('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa9a0('0x3')]},'calleridname':{'type':Sequelize[_0xa9a0('0x3')]},'starttime':{'type':Sequelize[_0xa9a0('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xa9a0('0x4')]},'endtime':{'type':Sequelize[_0xa9a0('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa9a0('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa9a0('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa9a0('0x3')]},'campaign':{'type':Sequelize[_0xa9a0('0x3')]},'campaigntype':{'type':Sequelize[_0xa9a0('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xa9a0('0x3')]},'amd':{'type':Sequelize[_0xa9a0('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa9a0('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa9a0('0x4')]},'edited':{'type':Sequelize[_0xa9a0('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xa9a0('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa9a0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa9a0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb0ee=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0xb0ee,0x163));var _0xeb0e=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xb0ee[_0x1b6c6d];return _0x290d9d;};'use strict';var Sequelize=require(_0xeb0e('0x0'));module[_0xeb0e('0x1')]={'state':{'type':Sequelize[_0xeb0e('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xeb0e('0x3')]},'scheduledat':{'type':Sequelize[_0xeb0e('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xeb0e('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xeb0e('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xeb0e('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xeb0e('0x3')]},'calleridname':{'type':Sequelize[_0xeb0e('0x3')]},'starttime':{'type':Sequelize[_0xeb0e('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xeb0e('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xeb0e('0x4')]},'ringtime':{'type':Sequelize[_0xeb0e('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xeb0e('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xeb0e('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xeb0e('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xeb0e('0x3')]},'campaign':{'type':Sequelize[_0xeb0e('0x3')]},'campaigntype':{'type':Sequelize[_0xeb0e('0x3')]},'membername':{'type':Sequelize[_0xeb0e('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xeb0e('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xeb0e('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xeb0e('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xeb0e('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xeb0e('0x4')]},'edited':{'type':Sequelize[_0xeb0e('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xeb0e('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xeb0e('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xeb0e('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xeb0e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index e3adca4..f5085e9 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 _0x36bb=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','rows','catch','params','include','options','find','create','describe','update','body','uniqueid','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path'];(function(_0x46c690,_0x20167f){var _0x10b408=function(_0x156f6a){while(--_0x156f6a){_0x46c690['push'](_0x46c690['shift']());}};_0x10b408(++_0x20167f);}(_0x36bb,0xdf));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb36b('0x0'));var rimraf=require(_0xb36b('0x1'));var zipdir=require(_0xb36b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb36b('0x3'));var moment=require(_0xb36b('0x4'));var BPromise=require(_0xb36b('0x5'));var Mustache=require('mustache');var util=require(_0xb36b('0x6'));var path=require(_0xb36b('0x7'));var sox=require(_0xb36b('0x8'));var csv=require(_0xb36b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb36b('0xa'));var _=require(_0xb36b('0xb'));var squel=require(_0xb36b('0xc'));var crypto=require(_0xb36b('0xd'));var jsforce=require(_0xb36b('0xe'));var deskjs=require(_0xb36b('0xf'));var toCsv=require(_0xb36b('0x9'));var querystring=require(_0xb36b('0x10'));var Papa=require(_0xb36b('0x11'));var Redis=require('ioredis');var authService=require(_0xb36b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb36b('0x13'));var logger=require(_0xb36b('0x14'))(_0xb36b('0x15'));var utils=require(_0xb36b('0x16'));var config=require(_0xb36b('0x17'));var licenseUtil=require(_0xb36b('0x18'));var db=require(_0xb36b('0x19'))['db'];function respondWithStatusCode(_0x5b1862,_0x5de220){_0x5de220=_0x5de220||0xcc;return function(_0x35efb8){if(_0x35efb8){return _0x5b1862[_0xb36b('0x1a')](_0x5de220);}return _0x5b1862[_0xb36b('0x1b')](_0x5de220)[_0xb36b('0x1c')]();};}function respondWithResult(_0x52bbd5,_0x398365){_0x398365=_0x398365||0xc8;return function(_0x39a500){if(_0x39a500){return _0x52bbd5[_0xb36b('0x1b')](_0x398365)[_0xb36b('0x1d')](_0x39a500);}};}function respondWithFilteredResult(_0x502900,_0x10aea4){return function(_0x1d8019){if(_0x1d8019){var _0xb75a11=_0x1d8019[_0xb36b('0x1e')],_0x5b11a1=_0x10aea4[_0xb36b('0x1f')],_0x101fdb=_0x10aea4[_0xb36b('0x1f')]+_0x10aea4[_0xb36b('0x20')],_0x174960;if(_0x101fdb>=_0xb75a11){_0x101fdb=_0xb75a11;_0x174960=0xc8;}else{_0x174960=0xce;}_0x502900[_0xb36b('0x1b')](_0x174960);return _0x502900[_0xb36b('0x21')](_0xb36b('0x22'),_0x5b11a1+'-'+_0x101fdb+'/'+_0xb75a11)[_0xb36b('0x1d')](_0x1d8019);}return null;};}function patchUpdates(_0x135bf9){return function(_0x126d50){try{jsonpatch[_0xb36b('0x23')](_0x126d50,_0x135bf9,!![]);}catch(_0x1022e9){return BPromise[_0xb36b('0x24')](_0x1022e9);}return _0x126d50[_0xb36b('0x25')]();};}function saveUpdates(_0x2dcc4c,_0x3bbf76){return function(_0x4e0e5a){if(_0x4e0e5a){return _0x4e0e5a['update'](_0x2dcc4c)[_0xb36b('0x26')](function(_0x1822c0){return _0x1822c0;});}return null;};}function removeEntity(_0x2358ef,_0x437aab){return function(_0x3f41c6){if(_0x3f41c6){return _0x3f41c6[_0xb36b('0x27')]()[_0xb36b('0x26')](function(){_0x2358ef[_0xb36b('0x1b')](0xcc)[_0xb36b('0x1c')]();});}};}function handleEntityNotFound(_0x2be82f,_0x651de5){return function(_0x338ee8){if(!_0x338ee8){_0x2be82f['sendStatus'](0x194);}return _0x338ee8;};}function handleError(_0x15074c,_0x1a743d){_0x1a743d=_0x1a743d||0x1f4;return function(_0x11fc07){logger[_0xb36b('0x28')](_0x11fc07[_0xb36b('0x29')]);if(_0x11fc07[_0xb36b('0x2a')]){delete _0x11fc07['name'];}_0x15074c['status'](_0x1a743d)['send'](_0x11fc07);};}exports[_0xb36b('0x2b')]=function(_0x29a4aa,_0x4e2910){var _0x33514b={},_0xc457df={},_0x40b5b4={'count':0x0,'rows':[]};var _0x2d5467=_[_0xb36b('0x2c')](db[_0xb36b('0x2d')][_0xb36b('0x2e')],function(_0x29406c){return{'name':_0x29406c[_0xb36b('0x2f')],'type':_0x29406c['type'][_0xb36b('0x30')]};});_0xc457df[_0xb36b('0x31')]=_[_0xb36b('0x2c')](_0x2d5467,'name');_0xc457df['query']=_[_0xb36b('0x32')](_0x29a4aa[_0xb36b('0x33')]);_0xc457df[_0xb36b('0x34')]=_[_0xb36b('0x35')](_0xc457df[_0xb36b('0x31')],_0xc457df['query']);_0x33514b[_0xb36b('0x36')]=_[_0xb36b('0x35')](_0xc457df[_0xb36b('0x31')],qs['fields'](_0x29a4aa[_0xb36b('0x33')][_0xb36b('0x37')]));_0x33514b['attributes']=_0x33514b[_0xb36b('0x36')][_0xb36b('0x38')]?_0x33514b[_0xb36b('0x36')]:_0xc457df[_0xb36b('0x31')];if(!_0x29a4aa[_0xb36b('0x33')][_0xb36b('0x39')]('nolimit')){_0x33514b['limit']=qs[_0xb36b('0x20')](_0x29a4aa[_0xb36b('0x33')]['limit']);_0x33514b[_0xb36b('0x1f')]=qs[_0xb36b('0x1f')](_0x29a4aa[_0xb36b('0x33')][_0xb36b('0x1f')]);}_0x33514b[_0xb36b('0x3a')]=qs[_0xb36b('0x3b')](_0x29a4aa[_0xb36b('0x33')][_0xb36b('0x3b')]);_0x33514b[_0xb36b('0x3c')]=qs[_0xb36b('0x34')](_[_0xb36b('0x3d')](_0x29a4aa[_0xb36b('0x33')],_0xc457df[_0xb36b('0x34')]),_0x2d5467);if(_0x29a4aa['query'][_0xb36b('0x3e')]){_0x33514b[_0xb36b('0x3c')]=_[_0xb36b('0x3f')](_0x33514b[_0xb36b('0x3c')],{'$or':_[_0xb36b('0x2c')](_0x2d5467,function(_0x4b3cb9){if(_0x4b3cb9[_0xb36b('0x40')]!=='VIRTUAL'){var _0x26d76b={};_0x26d76b[_0x4b3cb9['name']]={'$like':'%'+_0x29a4aa[_0xb36b('0x33')][_0xb36b('0x3e')]+'%'};return _0x26d76b;}})});}_0x33514b=_[_0xb36b('0x3f')]({},_0x33514b,_0x29a4aa['options']);var _0x52b43c={'where':_0x33514b[_0xb36b('0x3c')]};return db[_0xb36b('0x2d')][_0xb36b('0x1e')](_0x52b43c)[_0xb36b('0x26')](function(_0x5a2b7c){_0x40b5b4['count']=_0x5a2b7c;if(_0x29a4aa['query'][_0xb36b('0x41')]){_0x33514b['include']=[{'all':!![]}];}return db[_0xb36b('0x2d')]['findAll'](_0x33514b);})[_0xb36b('0x26')](function(_0x5ec109){_0x40b5b4[_0xb36b('0x42')]=_0x5ec109;return _0x40b5b4;})[_0xb36b('0x26')](respondWithFilteredResult(_0x4e2910,_0x33514b))[_0xb36b('0x43')](handleError(_0x4e2910,null));};exports['show']=function(_0x2ad93e,_0x42678e){var _0x2b550e={'raw':!![],'where':{'id':_0x2ad93e[_0xb36b('0x44')]['id']}},_0x2ea122={};_0x2ea122[_0xb36b('0x31')]=_[_0xb36b('0x32')](db['CmHopperHistory'][_0xb36b('0x2e')]);_0x2ea122[_0xb36b('0x33')]=_[_0xb36b('0x32')](_0x2ad93e[_0xb36b('0x33')]);_0x2ea122['filters']=_[_0xb36b('0x35')](_0x2ea122[_0xb36b('0x31')],_0x2ea122[_0xb36b('0x33')]);_0x2b550e['attributes']=_[_0xb36b('0x35')](_0x2ea122['model'],qs[_0xb36b('0x37')](_0x2ad93e[_0xb36b('0x33')]['fields']));_0x2b550e[_0xb36b('0x36')]=_0x2b550e[_0xb36b('0x36')][_0xb36b('0x38')]?_0x2b550e[_0xb36b('0x36')]:_0x2ea122['model'];if(_0x2ad93e[_0xb36b('0x33')][_0xb36b('0x41')]){_0x2b550e[_0xb36b('0x45')]=[{'all':!![]}];}_0x2b550e=_[_0xb36b('0x3f')]({},_0x2b550e,_0x2ad93e[_0xb36b('0x46')]);return db[_0xb36b('0x2d')][_0xb36b('0x47')](_0x2b550e)[_0xb36b('0x26')](handleEntityNotFound(_0x42678e,null))['then'](respondWithResult(_0x42678e,null))[_0xb36b('0x43')](handleError(_0x42678e,null));};exports[_0xb36b('0x48')]=function(_0x227f09,_0x3e215d){return db[_0xb36b('0x2d')][_0xb36b('0x48')](_0x227f09['body'],{})[_0xb36b('0x26')](respondWithResult(_0x3e215d,0xc9))[_0xb36b('0x43')](handleError(_0x3e215d,null));};exports[_0xb36b('0x49')]=function(_0x47e553,_0x166fa9){return db[_0xb36b('0x2d')][_0xb36b('0x49')]()[_0xb36b('0x26')](respondWithResult(_0x166fa9,null))[_0xb36b('0x43')](handleError(_0x166fa9,null));};exports[_0xb36b('0x4a')]=function(_0x50df32,_0x2f44cc){if(_0x50df32[_0xb36b('0x4b')][_0xb36b('0x4c')]){delete _0x50df32['body'][_0xb36b('0x4c')];}return db[_0xb36b('0x2d')]['find']({'where':{'uniqueid':_0x50df32['params']['id']}})[_0xb36b('0x26')](handleEntityNotFound(_0x2f44cc,null))['then'](saveUpdates(_0x50df32['body'],null))[_0xb36b('0x26')](respondWithResult(_0x2f44cc,null))[_0xb36b('0x43')](handleError(_0x2f44cc,null));}; \ No newline at end of file +var _0x7c68=['sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','params','find','create','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util'];(function(_0x12373e,_0x2a1682){var _0x54df55=function(_0x3d083e){while(--_0x3d083e){_0x12373e['push'](_0x12373e['shift']());}};_0x54df55(++_0x2a1682);}(_0x7c68,0x1d5));var _0x87c6=function(_0x314115,_0x22f606){_0x314115=_0x314115-0x0;var _0x1347df=_0x7c68[_0x314115];return _0x1347df;};'use strict';var emlformat=require(_0x87c6('0x0'));var rimraf=require(_0x87c6('0x1'));var zipdir=require(_0x87c6('0x2'));var jsonpatch=require(_0x87c6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x87c6('0x4'));var Mustache=require(_0x87c6('0x5'));var util=require(_0x87c6('0x6'));var path=require('path');var sox=require(_0x87c6('0x7'));var csv=require(_0x87c6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x87c6('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x87c6('0xa'));var jsforce=require(_0x87c6('0xb'));var deskjs=require(_0x87c6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x87c6('0xd'));var Papa=require(_0x87c6('0xe'));var Redis=require(_0x87c6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x87c6('0x10'));var as=require(_0x87c6('0x11'));var hardwareService=require(_0x87c6('0x12'));var logger=require(_0x87c6('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x87c6('0x14'));var db=require(_0x87c6('0x15'))['db'];function respondWithStatusCode(_0x3d85e3,_0x1067de){_0x1067de=_0x1067de||0xcc;return function(_0x5e1468){if(_0x5e1468){return _0x3d85e3[_0x87c6('0x16')](_0x1067de);}return _0x3d85e3[_0x87c6('0x17')](_0x1067de)[_0x87c6('0x18')]();};}function respondWithResult(_0x70a0dc,_0x506c13){_0x506c13=_0x506c13||0xc8;return function(_0x462af8){if(_0x462af8){return _0x70a0dc[_0x87c6('0x17')](_0x506c13)['json'](_0x462af8);}};}function respondWithFilteredResult(_0x27869d,_0x3a0d0b){return function(_0x3b2560){if(_0x3b2560){var _0x400e48=_0x3b2560['count'],_0x36ad68=_0x3a0d0b['offset'],_0x13359a=_0x3a0d0b[_0x87c6('0x19')]+_0x3a0d0b[_0x87c6('0x1a')],_0x729ce4;if(_0x13359a>=_0x400e48){_0x13359a=_0x400e48;_0x729ce4=0xc8;}else{_0x729ce4=0xce;}_0x27869d[_0x87c6('0x17')](_0x729ce4);return _0x27869d['set']('Content-Range',_0x36ad68+'-'+_0x13359a+'/'+_0x400e48)['json'](_0x3b2560);}return null;};}function patchUpdates(_0x256529){return function(_0x5c79ad){try{jsonpatch[_0x87c6('0x1b')](_0x5c79ad,_0x256529,!![]);}catch(_0x51d95f){return BPromise[_0x87c6('0x1c')](_0x51d95f);}return _0x5c79ad['save']();};}function saveUpdates(_0x27afa9,_0x3d2dea){return function(_0x5c971e){if(_0x5c971e){return _0x5c971e[_0x87c6('0x1d')](_0x27afa9)[_0x87c6('0x1e')](function(_0x13b18e){return _0x13b18e;});}return null;};}function removeEntity(_0x36ff40,_0x24d802){return function(_0x32722d){if(_0x32722d){return _0x32722d[_0x87c6('0x1f')]()[_0x87c6('0x1e')](function(){_0x36ff40[_0x87c6('0x17')](0xcc)[_0x87c6('0x18')]();});}};}function handleEntityNotFound(_0x1ad839,_0x16727e){return function(_0x23a787){if(!_0x23a787){_0x1ad839[_0x87c6('0x16')](0x194);}return _0x23a787;};}function handleError(_0x28846a,_0x4c0f16){_0x4c0f16=_0x4c0f16||0x1f4;return function(_0x1ec903){logger[_0x87c6('0x20')](_0x1ec903[_0x87c6('0x21')]);if(_0x1ec903[_0x87c6('0x22')]){delete _0x1ec903['name'];}_0x28846a[_0x87c6('0x17')](_0x4c0f16)[_0x87c6('0x23')](_0x1ec903);};}exports[_0x87c6('0x24')]=function(_0x37600b,_0x4b19f6){var _0x627f59={},_0x272cea={},_0x4bf432={'count':0x0,'rows':[]};var _0x129414=_[_0x87c6('0x25')](db[_0x87c6('0x26')][_0x87c6('0x27')],function(_0x1ce003){return{'name':_0x1ce003[_0x87c6('0x28')],'type':_0x1ce003[_0x87c6('0x29')][_0x87c6('0x2a')]};});_0x272cea[_0x87c6('0x2b')]=_[_0x87c6('0x25')](_0x129414,_0x87c6('0x22'));_0x272cea[_0x87c6('0x2c')]=_[_0x87c6('0x2d')](_0x37600b[_0x87c6('0x2c')]);_0x272cea[_0x87c6('0x2e')]=_[_0x87c6('0x2f')](_0x272cea[_0x87c6('0x2b')],_0x272cea['query']);_0x627f59['attributes']=_[_0x87c6('0x2f')](_0x272cea[_0x87c6('0x2b')],qs[_0x87c6('0x30')](_0x37600b[_0x87c6('0x2c')][_0x87c6('0x30')]));_0x627f59[_0x87c6('0x31')]=_0x627f59[_0x87c6('0x31')][_0x87c6('0x32')]?_0x627f59[_0x87c6('0x31')]:_0x272cea[_0x87c6('0x2b')];if(!_0x37600b[_0x87c6('0x2c')][_0x87c6('0x33')]('nolimit')){_0x627f59['limit']=qs[_0x87c6('0x1a')](_0x37600b[_0x87c6('0x2c')][_0x87c6('0x1a')]);_0x627f59[_0x87c6('0x19')]=qs['offset'](_0x37600b[_0x87c6('0x2c')][_0x87c6('0x19')]);}_0x627f59[_0x87c6('0x34')]=qs['sort'](_0x37600b[_0x87c6('0x2c')][_0x87c6('0x35')]);_0x627f59[_0x87c6('0x36')]=qs['filters'](_['pick'](_0x37600b[_0x87c6('0x2c')],_0x272cea[_0x87c6('0x2e')]),_0x129414);if(_0x37600b[_0x87c6('0x2c')]['filter']){_0x627f59[_0x87c6('0x36')]=_[_0x87c6('0x37')](_0x627f59[_0x87c6('0x36')],{'$or':_[_0x87c6('0x25')](_0x129414,function(_0x54bdd3){if(_0x54bdd3[_0x87c6('0x29')]!==_0x87c6('0x38')){var _0x23c3d2={};_0x23c3d2[_0x54bdd3[_0x87c6('0x22')]]={'$like':'%'+_0x37600b['query'][_0x87c6('0x39')]+'%'};return _0x23c3d2;}})});}_0x627f59=_['merge']({},_0x627f59,_0x37600b[_0x87c6('0x3a')]);var _0x1b87da={'where':_0x627f59[_0x87c6('0x36')]};return db[_0x87c6('0x26')]['count'](_0x1b87da)['then'](function(_0x4122ee){_0x4bf432[_0x87c6('0x3b')]=_0x4122ee;if(_0x37600b[_0x87c6('0x2c')]['includeAll']){_0x627f59[_0x87c6('0x3c')]=[{'all':!![]}];}return db[_0x87c6('0x26')][_0x87c6('0x3d')](_0x627f59);})['then'](function(_0x150fb7){_0x4bf432[_0x87c6('0x3e')]=_0x150fb7;return _0x4bf432;})[_0x87c6('0x1e')](respondWithFilteredResult(_0x4b19f6,_0x627f59))[_0x87c6('0x3f')](handleError(_0x4b19f6,null));};exports['show']=function(_0x3ef056,_0x53ba5c){var _0x321dc4={'raw':!![],'where':{'id':_0x3ef056[_0x87c6('0x40')]['id']}},_0x3f5b0e={};_0x3f5b0e[_0x87c6('0x2b')]=_['keys'](db[_0x87c6('0x26')][_0x87c6('0x27')]);_0x3f5b0e[_0x87c6('0x2c')]=_[_0x87c6('0x2d')](_0x3ef056['query']);_0x3f5b0e[_0x87c6('0x2e')]=_['intersection'](_0x3f5b0e[_0x87c6('0x2b')],_0x3f5b0e[_0x87c6('0x2c')]);_0x321dc4['attributes']=_[_0x87c6('0x2f')](_0x3f5b0e[_0x87c6('0x2b')],qs[_0x87c6('0x30')](_0x3ef056[_0x87c6('0x2c')][_0x87c6('0x30')]));_0x321dc4[_0x87c6('0x31')]=_0x321dc4[_0x87c6('0x31')]['length']?_0x321dc4[_0x87c6('0x31')]:_0x3f5b0e[_0x87c6('0x2b')];if(_0x3ef056[_0x87c6('0x2c')]['includeAll']){_0x321dc4['include']=[{'all':!![]}];}_0x321dc4=_[_0x87c6('0x37')]({},_0x321dc4,_0x3ef056[_0x87c6('0x3a')]);return db['CmHopperHistory'][_0x87c6('0x41')](_0x321dc4)[_0x87c6('0x1e')](handleEntityNotFound(_0x53ba5c,null))[_0x87c6('0x1e')](respondWithResult(_0x53ba5c,null))[_0x87c6('0x3f')](handleError(_0x53ba5c,null));};exports[_0x87c6('0x42')]=function(_0x3de313,_0xcc24b5){return db['CmHopperHistory'][_0x87c6('0x42')](_0x3de313['body'],{})[_0x87c6('0x1e')](respondWithResult(_0xcc24b5,0xc9))[_0x87c6('0x3f')](handleError(_0xcc24b5,null));};exports['describe']=function(_0x1a2af6,_0x24472b){return db['CmHopperHistory']['describe']()[_0x87c6('0x1e')](respondWithResult(_0x24472b,null))['catch'](handleError(_0x24472b,null));};exports[_0x87c6('0x1d')]=function(_0x4a6eac,_0xdbd374){if(_0x4a6eac['body'][_0x87c6('0x43')]){delete _0x4a6eac['body'][_0x87c6('0x43')];}return db[_0x87c6('0x26')]['find']({'where':{'uniqueid':_0x4a6eac[_0x87c6('0x40')]['id']}})[_0x87c6('0x1e')](handleEntityNotFound(_0xdbd374,null))[_0x87c6('0x1e')](saveUpdates(_0x4a6eac['body'],null))[_0x87c6('0x1e')](respondWithResult(_0xdbd374,null))['catch'](handleError(_0xdbd374,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 461788f..7284aa6 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 _0xe006=['../../config/environment','define','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x54f2af,_0x5d680d){var _0xa460ef=function(_0x191abf){while(--_0x191abf){_0x54f2af['push'](_0x54f2af['shift']());}};_0xa460ef(++_0x5d680d);}(_0xe006,0x1f1));var _0x6e00=function(_0x1780ec,_0x3af2fa){_0x1780ec=_0x1780ec-0x0;var _0x5c5663=_0xe006[_0x1780ec];return _0x5c5663;};'use strict';var _=require(_0x6e00('0x0'));var util=require(_0x6e00('0x1'));var logger=require(_0x6e00('0x2'))(_0x6e00('0x3'));var moment=require('moment');var BPromise=require(_0x6e00('0x4'));var rp=require(_0x6e00('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e00('0x6'));var config=require(_0x6e00('0x7'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x36bd6a,_0x4c96f2){return _0x36bd6a[_0x6e00('0x8')](_0x6e00('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x6e00('0xa')]},{'name':_0x6e00('0xb'),'fields':[_0x6e00('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2734=['../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x23fb81,_0x18f794){var _0x410fda=function(_0x13fb4f){while(--_0x13fb4f){_0x23fb81['push'](_0x23fb81['shift']());}};_0x410fda(++_0x18f794);}(_0x2734,0x19a));var _0x4273=function(_0x26ce00,_0x22b629){_0x26ce00=_0x26ce00-0x0;var _0x92767=_0x2734[_0x26ce00];return _0x92767;};'use strict';var _=require(_0x4273('0x0'));var util=require('util');var logger=require(_0x4273('0x1'))(_0x4273('0x2'));var moment=require('moment');var BPromise=require(_0x4273('0x3'));var rp=require(_0x4273('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4273('0x5'));var config=require(_0x4273('0x6'));var attributes=require(_0x4273('0x7'));module['exports']=function(_0x2a8bfb,_0x4ae0a4){return _0x2a8bfb[_0x4273('0x8')](_0x4273('0x9'),attributes,{'tableName':_0x4273('0xa'),'paranoid':![],'indexes':[{'name':_0x4273('0xb'),'fields':[_0x4273('0xb')]},{'name':'uniqueid','fields':[_0x4273('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 19ab39b..e3ef4c4 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 _0x6754=['predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','catch','CreateCmHopperHistory','CmHopperHistory','options','raw','AvgHandleTime','findAll','where','sequelize','col','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null'];(function(_0x1d0458,_0x389f29){var _0x35eea4=function(_0x181770){while(--_0x181770){_0x1d0458['push'](_0x1d0458['shift']());}};_0x35eea4(++_0x389f29);}(_0x6754,0x9d));var _0x4675=function(_0xb47c6d,_0x108563){_0xb47c6d=_0xb47c6d-0x0;var _0x1687fd=_0x6754[_0xb47c6d];return _0x1687fd;};'use strict';var _=require(_0x4675('0x0'));var util=require(_0x4675('0x1'));var moment=require(_0x4675('0x2'));var BPromise=require(_0x4675('0x3'));var rs=require(_0x4675('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4675('0x5'))['db'];var utils=require(_0x4675('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4675('0x7'));var client=jayson['client'][_0x4675('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3184b2,_0x1099c9,_0x2aaa19){return new BPromise(function(_0x53c79d,_0x111985){return client[_0x4675('0x9')](_0x3184b2,_0x2aaa19)[_0x4675('0xa')](function(_0x195eab){logger[_0x4675('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x1099c9,'request\x20sent');logger[_0x4675('0xc')](_0x4675('0xd'),_0x1099c9,_0x4675('0xe'),JSON[_0x4675('0xf')](_0x195eab));if(_0x195eab[_0x4675('0x10')]){if(_0x195eab[_0x4675('0x10')][_0x4675('0x11')]===0x1f4){logger[_0x4675('0x10')](_0x4675('0x12'),_0x1099c9,_0x195eab[_0x4675('0x10')][_0x4675('0x13')]);return _0x111985(_0x195eab[_0x4675('0x10')][_0x4675('0x13')]);}logger[_0x4675('0x10')](_0x4675('0x12'),_0x1099c9,_0x195eab[_0x4675('0x10')][_0x4675('0x13')]);return _0x53c79d(_0x195eab[_0x4675('0x10')][_0x4675('0x13')]);}else{logger['info'](_0x4675('0x12'),_0x1099c9,_0x4675('0xe'));_0x53c79d(_0x195eab['result'][_0x4675('0x13')]);}})[_0x4675('0x14')](function(_0x5eb4bf){logger[_0x4675('0x10')](_0x4675('0x12'),_0x1099c9,_0x5eb4bf);_0x111985(_0x5eb4bf);});});}exports[_0x4675('0x15')]=function(_0x474c76){var _0x38bbf8=this;return new Promise(function(_0x4575d4,_0x2f08c0){return db[_0x4675('0x16')]['create'](_0x474c76['body'],{'raw':_0x474c76[_0x4675('0x17')]?_0x474c76[_0x4675('0x17')][_0x4675('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x361444){logger[_0x4675('0xb')](_0x4675('0x15'),_0x474c76);logger['debug'](_0x4675('0x15'),_0x474c76,JSON[_0x4675('0xf')](_0x361444));_0x4575d4(_0x361444);})[_0x4675('0x14')](function(_0x3f63fb){logger['error'](_0x4675('0x15'),_0x3f63fb[_0x4675('0x13')],_0x474c76);_0x2f08c0(_0x38bbf8[_0x4675('0x10')](0x1f4,_0x3f63fb[_0x4675('0x13')]));});});};exports[_0x4675('0x19')]=function(_0x44fdfc){var _0x2b5bf4=this;return new Promise(function(_0x53d6a3,_0x127771){return db[_0x4675('0x16')][_0x4675('0x1a')]({'raw':_0x44fdfc[_0x4675('0x17')]?_0x44fdfc[_0x4675('0x17')][_0x4675('0x18')]===undefined?!![]:![]:!![],'where':_0x44fdfc[_0x4675('0x17')]?_0x44fdfc[_0x4675('0x17')][_0x4675('0x1b')]||null:null,'attributes':[[db[_0x4675('0x1c')]['fn']('COUNT',db[_0x4675('0x1c')][_0x4675('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db[_0x4675('0x1c')]['fn'](_0x4675('0x1e'),db['sequelize']['fn']('IF',db[_0x4675('0x1c')][_0x4675('0x1f')](_0x4675('0x20')))),_0x4675('0x21')],[db['sequelize']['fn'](_0x4675('0x1e'),db[_0x4675('0x1c')]['fn']('IF',db['sequelize'][_0x4675('0x1f')](_0x4675('0x22')))),_0x4675('0x23')],[db['sequelize']['fn']('COUNT',db[_0x4675('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x4675('0x24')))),_0x4675('0x25')],[db[_0x4675('0x1c')]['fn'](_0x4675('0x26'),db['sequelize']['fn']('IF',db[_0x4675('0x1c')]['literal'](_0x4675('0x27')))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn'](_0x4675('0x26'),db['sequelize']['fn']('IF',db[_0x4675('0x1c')][_0x4675('0x1f')](_0x4675('0x28')))),_0x4675('0x29')]]})[_0x4675('0xa')](function(_0x2cc166){logger[_0x4675('0xb')]('AvgHandleTime',_0x44fdfc);logger[_0x4675('0xc')]('AvgHandleTime',_0x44fdfc,JSON[_0x4675('0xf')](_0x2cc166));_0x53d6a3(_0x2cc166);})[_0x4675('0x14')](function(_0x4fd42c){logger['error'](_0x4675('0x19'),_0x4fd42c[_0x4675('0x13')],_0x44fdfc);_0x127771(_0x2b5bf4['error'](0x1f4,_0x4fd42c['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x42bed2){var _0x582f0d=this;return new Promise(function(_0x4f746c,_0x87afea){return db[_0x4675('0x16')][_0x4675('0x1a')]({'raw':_0x42bed2[_0x4675('0x17')]?_0x42bed2[_0x4675('0x17')][_0x4675('0x18')]===undefined?!![]:![]:!![],'where':_0x42bed2['options']?_0x42bed2[_0x4675('0x17')][_0x4675('0x1b')]||null:null,'attributes':[[_0x4675('0x2a'),_0x4675('0x2b')],[db[_0x4675('0x1c')]['fn'](_0x4675('0x1e'),db[_0x4675('0x1c')]['fn']('IF',db[_0x4675('0x1c')][_0x4675('0x1f')](_0x4675('0x2c')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn'](_0x4675('0x1e'),db[_0x4675('0x1c')]['fn']('IF',db[_0x4675('0x1c')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0x4675('0x1c')]['fn'](_0x4675('0x1e'),db[_0x4675('0x1c')]['fn']('IF',db['sequelize'][_0x4675('0x1f')](_0x4675('0x20')))),'outboundAnswerCallsDay'],[db[_0x4675('0x1c')]['fn'](_0x4675('0x1e'),db[_0x4675('0x1c')]['fn']('IF',db[_0x4675('0x1c')][_0x4675('0x1f')](_0x4675('0x2d')))),_0x4675('0x2e')],[db[_0x4675('0x1c')]['fn'](_0x4675('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x4675('0x1f')](_0x4675('0x2f')))),_0x4675('0x30')],[db[_0x4675('0x1c')]['fn'](_0x4675('0x1e'),db[_0x4675('0x1c')]['fn']('IF',db[_0x4675('0x1c')][_0x4675('0x1f')](_0x4675('0x31')))),'outboundDropCallsDayTimeout'],[db[_0x4675('0x1c')]['fn'](_0x4675('0x1e'),db[_0x4675('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x4675('0x32')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn']('COUNT',db[_0x4675('0x1c')]['fn']('IF',db['sequelize'][_0x4675('0x1f')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0x4675('0x1e'),db[_0x4675('0x1c')]['fn']('IF',db[_0x4675('0x1c')][_0x4675('0x1f')](_0x4675('0x33')))),_0x4675('0x34')],[db[_0x4675('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x4675('0x1f')](_0x4675('0x35')))),_0x4675('0x36')],[db[_0x4675('0x1c')]['fn'](_0x4675('0x1e'),db['sequelize']['fn']('IF',db[_0x4675('0x1c')][_0x4675('0x1f')](_0x4675('0x37')))),_0x4675('0x38')],[db[_0x4675('0x1c')]['fn']('COUNT',db[_0x4675('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x4675('0x39')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x4675('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x4675('0x3a')))),'outboundRejectCallsDay'],[db[_0x4675('0x1c')]['fn'](_0x4675('0x1e'),db[_0x4675('0x1c')]['fn']('IF',db[_0x4675('0x1c')][_0x4675('0x1f')](_0x4675('0x3b')))),_0x4675('0x3c')]],'group':[_0x4675('0x2a')]})['then'](function(_0x1e0f71){logger[_0x4675('0xb')]('GetVoiceQueueHopperHistory',_0x42bed2);logger[_0x4675('0xc')](_0x4675('0x3d'),_0x42bed2,JSON['stringify'](_0x1e0f71));_0x4f746c(_0x1e0f71);})[_0x4675('0x14')](function(_0x41d463){logger['error']('GetVoiceQueueHopperHistory',_0x41d463['message'],_0x42bed2);_0x87afea(_0x582f0d[_0x4675('0x10')](0x1f4,_0x41d463['message']));});});};exports[_0x4675('0x3e')]=function(_0xb6cb0a){var _0x55e38f=this;return new Promise(function(_0x5f0d32,_0xc255ae){return db[_0x4675('0x16')][_0x4675('0x1a')]({'raw':_0xb6cb0a[_0x4675('0x17')]?_0xb6cb0a['options'][_0x4675('0x18')]===undefined?!![]:![]:!![],'where':_0xb6cb0a[_0x4675('0x17')]?_0xb6cb0a[_0x4675('0x17')][_0x4675('0x1b')]||null:null,'attributes':[['campaign',_0x4675('0x2b')],[db[_0x4675('0x1c')]['fn']('COUNT',db[_0x4675('0x1c')][_0x4675('0x1d')]('id')),'ivrTotalCallsDays'],[db[_0x4675('0x1c')]['fn'](_0x4675('0x1e'),db[_0x4675('0x1c')]['fn']('IF',db[_0x4675('0x1c')][_0x4675('0x1f')](_0x4675('0x20')))),_0x4675('0x3f')]],'group':[_0x4675('0x2a')]})[_0x4675('0xa')](function(_0x565601){logger['info'](_0x4675('0x3e'),_0xb6cb0a);logger['debug'](_0x4675('0x3e'),_0xb6cb0a,JSON[_0x4675('0xf')](_0x565601));_0x5f0d32(_0x565601);})[_0x4675('0x14')](function(_0x224b78){logger[_0x4675('0x10')]('GetCampaignHopperHistory',_0x224b78['message'],_0xb6cb0a);_0xc255ae(_0x55e38f[_0x4675('0x10')](0x1f4,_0x224b78[_0x4675('0x13')]));});});}; \ No newline at end of file +var _0x6bc8=['predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','findAll','campaign','name','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','then','GetCampaignHopperHistory','lodash','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','request\x20sent','debug','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','CreateCmHopperHistory','CmHopperHistory','body','options','raw','info','catch','AvgHandleTime','where','sequelize','col','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null'];(function(_0x5ace6e,_0x32247a){var _0x4b3abe=function(_0x2f632e){while(--_0x2f632e){_0x5ace6e['push'](_0x5ace6e['shift']());}};_0x4b3abe(++_0x32247a);}(_0x6bc8,0x1d8));var _0x86bc=function(_0x31a176,_0x271c44){_0x31a176=_0x31a176-0x0;var _0x3ab000=_0x6bc8[_0x31a176];return _0x3ab000;};'use strict';var _=require(_0x86bc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86bc('0x1'))['db'];var utils=require(_0x86bc('0x2'));var logger=require(_0x86bc('0x3'))(_0x86bc('0x4'));var config=require('../../config/environment');var jayson=require(_0x86bc('0x5'));var client=jayson['client'][_0x86bc('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4fd9f5,_0x2910c3,_0x381f31){return new BPromise(function(_0x9f1151,_0x64ca1e){return client[_0x86bc('0x7')](_0x4fd9f5,_0x381f31)['then'](function(_0xe54467){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x2910c3,_0x86bc('0x8'));logger[_0x86bc('0x9')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x2910c3,'request\x20sent',JSON[_0x86bc('0xa')](_0xe54467));if(_0xe54467[_0x86bc('0xb')]){if(_0xe54467[_0x86bc('0xb')][_0x86bc('0xc')]===0x1f4){logger[_0x86bc('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x2910c3,_0xe54467[_0x86bc('0xb')][_0x86bc('0xd')]);return _0x64ca1e(_0xe54467[_0x86bc('0xb')]['message']);}logger[_0x86bc('0xb')](_0x86bc('0xe'),_0x2910c3,_0xe54467['error'][_0x86bc('0xd')]);return _0x9f1151(_0xe54467[_0x86bc('0xb')][_0x86bc('0xd')]);}else{logger['info'](_0x86bc('0xe'),_0x2910c3,_0x86bc('0x8'));_0x9f1151(_0xe54467[_0x86bc('0xf')][_0x86bc('0xd')]);}})['catch'](function(_0x91dfd){logger[_0x86bc('0xb')](_0x86bc('0xe'),_0x2910c3,_0x91dfd);_0x64ca1e(_0x91dfd);});});}exports[_0x86bc('0x10')]=function(_0x56d407){var _0x500517=this;return new Promise(function(_0x425c32,_0x333d62){return db[_0x86bc('0x11')]['create'](_0x56d407[_0x86bc('0x12')],{'raw':_0x56d407[_0x86bc('0x13')]?_0x56d407[_0x86bc('0x13')][_0x86bc('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x282e89){logger[_0x86bc('0x15')]('CreateCmHopperHistory',_0x56d407);logger[_0x86bc('0x9')]('CreateCmHopperHistory',_0x56d407,JSON[_0x86bc('0xa')](_0x282e89));_0x425c32(_0x282e89);})[_0x86bc('0x16')](function(_0x455ace){logger['error'](_0x86bc('0x10'),_0x455ace[_0x86bc('0xd')],_0x56d407);_0x333d62(_0x500517['error'](0x1f4,_0x455ace['message']));});});};exports[_0x86bc('0x17')]=function(_0x33cf3c){var _0x3c9c39=this;return new Promise(function(_0xf9c7b3,_0x45befd){return db[_0x86bc('0x11')]['findAll']({'raw':_0x33cf3c['options']?_0x33cf3c[_0x86bc('0x13')][_0x86bc('0x14')]===undefined?!![]:![]:!![],'where':_0x33cf3c[_0x86bc('0x13')]?_0x33cf3c[_0x86bc('0x13')][_0x86bc('0x18')]||null:null,'attributes':[[db[_0x86bc('0x19')]['fn']('COUNT',db[_0x86bc('0x19')][_0x86bc('0x1a')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')]['literal'](_0x86bc('0x1c')))),_0x86bc('0x1d')],[db['sequelize']['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')][_0x86bc('0x1e')](_0x86bc('0x1f')))),_0x86bc('0x20')],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x1b'),db['sequelize']['fn']('IF',db['sequelize'][_0x86bc('0x1e')](_0x86bc('0x21')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x86bc('0x1e')](_0x86bc('0x23')))),_0x86bc('0x24')],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x22'),db[_0x86bc('0x19')]['fn']('IF',db['sequelize'][_0x86bc('0x1e')](_0x86bc('0x25')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x2ad463){logger['info'](_0x86bc('0x17'),_0x33cf3c);logger[_0x86bc('0x9')](_0x86bc('0x17'),_0x33cf3c,JSON[_0x86bc('0xa')](_0x2ad463));_0xf9c7b3(_0x2ad463);})[_0x86bc('0x16')](function(_0x552d04){logger['error'](_0x86bc('0x17'),_0x552d04[_0x86bc('0xd')],_0x33cf3c);_0x45befd(_0x3c9c39['error'](0x1f4,_0x552d04[_0x86bc('0xd')]));});});};exports[_0x86bc('0x26')]=function(_0x55565f){var _0x38d984=this;return new Promise(function(_0xc9f8cc,_0x5aac5f){return db[_0x86bc('0x11')][_0x86bc('0x27')]({'raw':_0x55565f[_0x86bc('0x13')]?_0x55565f[_0x86bc('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x55565f[_0x86bc('0x13')]?_0x55565f[_0x86bc('0x13')][_0x86bc('0x18')]||null:null,'attributes':[[_0x86bc('0x28'),_0x86bc('0x29')],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x86bc('0x2a')],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x1b'),db['sequelize']['fn']('IF',db[_0x86bc('0x19')][_0x86bc('0x1e')]('`state`\x20=\x203,\x201,\x20null'))),_0x86bc('0x2b')],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')]['fn']('IF',db['sequelize'][_0x86bc('0x1e')](_0x86bc('0x1c')))),_0x86bc('0x2c')],[db['sequelize']['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')][_0x86bc('0x1e')](_0x86bc('0x2d')))),_0x86bc('0x2e')],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')][_0x86bc('0x1e')](_0x86bc('0x2f')))),_0x86bc('0x30')],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')][_0x86bc('0x1e')](_0x86bc('0x31')))),_0x86bc('0x32')],[db[_0x86bc('0x19')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')][_0x86bc('0x1e')](_0x86bc('0x33')))),'outboundUnknownCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')][_0x86bc('0x1e')](_0x86bc('0x34')))),_0x86bc('0x35')],[db[_0x86bc('0x19')]['fn']('COUNT',db[_0x86bc('0x19')]['fn']('IF',db['sequelize'][_0x86bc('0x1e')](_0x86bc('0x36')))),_0x86bc('0x37')],[db[_0x86bc('0x19')]['fn']('COUNT',db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')][_0x86bc('0x1e')](_0x86bc('0x38')))),_0x86bc('0x39')],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')][_0x86bc('0x1e')](_0x86bc('0x3a')))),'outboundAnswerAgiCallsDay'],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')][_0x86bc('0x1e')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x86bc('0x19')]['fn']('COUNT',db[_0x86bc('0x19')]['fn']('IF',db['sequelize'][_0x86bc('0x1e')](_0x86bc('0x3b')))),_0x86bc('0x3c')]],'group':[_0x86bc('0x28')]})[_0x86bc('0x3d')](function(_0x33dee9){logger[_0x86bc('0x15')](_0x86bc('0x26'),_0x55565f);logger[_0x86bc('0x9')](_0x86bc('0x26'),_0x55565f,JSON[_0x86bc('0xa')](_0x33dee9));_0xc9f8cc(_0x33dee9);})[_0x86bc('0x16')](function(_0x2f4b29){logger[_0x86bc('0xb')](_0x86bc('0x26'),_0x2f4b29[_0x86bc('0xd')],_0x55565f);_0x5aac5f(_0x38d984[_0x86bc('0xb')](0x1f4,_0x2f4b29[_0x86bc('0xd')]));});});};exports[_0x86bc('0x3e')]=function(_0x58a4b5){var _0x2214cc=this;return new Promise(function(_0x520244,_0x435c67){return db[_0x86bc('0x11')]['findAll']({'raw':_0x58a4b5['options']?_0x58a4b5[_0x86bc('0x13')][_0x86bc('0x14')]===undefined?!![]:![]:!![],'where':_0x58a4b5['options']?_0x58a4b5[_0x86bc('0x13')]['where']||null:null,'attributes':[[_0x86bc('0x28'),_0x86bc('0x29')],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')][_0x86bc('0x1a')]('id')),'ivrTotalCallsDays'],[db[_0x86bc('0x19')]['fn'](_0x86bc('0x1b'),db[_0x86bc('0x19')]['fn']('IF',db[_0x86bc('0x19')]['literal'](_0x86bc('0x1c')))),'ivrAnswerCallsDay']],'group':[_0x86bc('0x28')]})['then'](function(_0x57e98e){logger[_0x86bc('0x15')]('GetCampaignHopperHistory',_0x58a4b5);logger['debug'](_0x86bc('0x3e'),_0x58a4b5,JSON['stringify'](_0x57e98e));_0x520244(_0x57e98e);})['catch'](function(_0x5e4589){logger[_0x86bc('0xb')]('GetCampaignHopperHistory',_0x5e4589[_0x86bc('0xd')],_0x58a4b5);_0x435c67(_0x2214cc[_0x86bc('0xb')](0x1f4,_0x5e4589[_0x86bc('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index e5db54a..58c4d6f 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 _0xb8a4=['show','post','/:id','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./cmHopperHistory.controller','get','index','/describe','describe','isAuthenticated'];(function(_0x1cd372,_0x3c302f){var _0x169016=function(_0x3dcdef){while(--_0x3dcdef){_0x1cd372['push'](_0x1cd372['shift']());}};_0x169016(++_0x3c302f);}(_0xb8a4,0x18b));var _0x4b8a=function(_0x432c67,_0x27fbeb){_0x432c67=_0x432c67-0x0;var _0x1ead95=_0xb8a4[_0x432c67];return _0x1ead95;};'use strict';var multer=require(_0x4b8a('0x0'));var util=require(_0x4b8a('0x1'));var path=require(_0x4b8a('0x2'));var timeout=require(_0x4b8a('0x3'));var express=require('express');var router=express[_0x4b8a('0x4')]();var fs_extra=require(_0x4b8a('0x5'));var auth=require(_0x4b8a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4b8a('0x7'));router[_0x4b8a('0x8')]('/',auth['isAuthenticated'](),controller[_0x4b8a('0x9')]);router[_0x4b8a('0x8')](_0x4b8a('0xa'),auth['isAuthenticated'](),controller[_0x4b8a('0xb')]);router['get']('/:id',auth[_0x4b8a('0xc')](),controller[_0x4b8a('0xd')]);router[_0x4b8a('0xe')]('/',auth[_0x4b8a('0xc')](),controller['create']);router['put'](_0x4b8a('0xf'),auth[_0x4b8a('0xc')](),controller[_0x4b8a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x10f5=['get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x5a679d,_0x4cbeb9){var _0x4c91d0=function(_0x37e8d0){while(--_0x37e8d0){_0x5a679d['push'](_0x5a679d['shift']());}};_0x4c91d0(++_0x4cbeb9);}(_0x10f5,0x193));var _0x510f=function(_0x44c078,_0x2d9cd3){_0x44c078=_0x44c078-0x0;var _0xdef368=_0x10f5[_0x44c078];return _0xdef368;};'use strict';var multer=require(_0x510f('0x0'));var util=require(_0x510f('0x1'));var path=require(_0x510f('0x2'));var timeout=require(_0x510f('0x3'));var express=require(_0x510f('0x4'));var router=express[_0x510f('0x5')]();var fs_extra=require(_0x510f('0x6'));var auth=require(_0x510f('0x7'));var interaction=require(_0x510f('0x8'));var config=require(_0x510f('0x9'));var controller=require(_0x510f('0xa'));router[_0x510f('0xb')]('/',auth[_0x510f('0xc')](),controller[_0x510f('0xd')]);router[_0x510f('0xb')](_0x510f('0xe'),auth[_0x510f('0xc')](),controller[_0x510f('0xf')]);router['get']('/:id',auth[_0x510f('0xc')](),controller[_0x510f('0x10')]);router[_0x510f('0x11')]('/',auth[_0x510f('0xc')](),controller[_0x510f('0x12')]);router[_0x510f('0x13')](_0x510f('0x14'),auth[_0x510f('0xc')](),controller[_0x510f('0x15')]);module[_0x510f('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 63c8266..7c6302c 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 _0x6026=['sequelize','STRING','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6026,0x168));var _0x6602=function(_0x1b502d,_0x21b1ed){_0x1b502d=_0x1b502d-0x0;var _0x822ee5=_0x6026[_0x1b502d];return _0x822ee5;};'use strict';var Sequelize=require(_0x6602('0x0'));module['exports']={'name':{'type':Sequelize[_0x6602('0x1')],'unique':_0x6602('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6602('0x1')]},'dialPrefix':{'type':Sequelize[_0x6602('0x1')]}}; \ No newline at end of file +var _0x8c13=['name','sequelize','STRING'];(function(_0x4783d0,_0x4867d6){var _0x409876=function(_0xa7a817){while(--_0xa7a817){_0x4783d0['push'](_0x4783d0['shift']());}};_0x409876(++_0x4867d6);}(_0x8c13,0x1e4));var _0x38c1=function(_0x546673,_0x4af5f0){_0x546673=_0x546673-0x0;var _0x486958=_0x8c13[_0x546673];return _0x486958;};'use strict';var Sequelize=require(_0x38c1('0x0'));module['exports']={'name':{'type':Sequelize[_0x38c1('0x1')],'unique':_0x38c1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x38c1('0x1')]},'dialPrefix':{'type':Sequelize[_0x38c1('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index c9d15c5..79dfacc 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 _0x04e5=['redis','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','then','Lists','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','CmList','include','rows','catch','params','keys','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','nolimit','Disposition','includeAll','findAll','removeDispositions','addContacts','CmContact','tags','isArray','join','push','success','dataValues','message','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','addColumn','cm_contacts','getCustomFields','addAgents','ids','omit','emit','userCmList:save','removeAgents','User','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0x04e5,0x187));var _0x504e=function(_0x5208dc,_0x1b04b5){_0x5208dc=_0x5208dc-0x0;var _0x1c5d21=_0x04e5[_0x5208dc];return _0x1c5d21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x504e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x504e('0x1'));var rp=require(_0x504e('0x2'));var moment=require(_0x504e('0x3'));var BPromise=require(_0x504e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x504e('0x5'));var sox=require(_0x504e('0x6'));var csv=require(_0x504e('0x7'));var ejs=require(_0x504e('0x8'));var fs=require('fs');var fs_extra=require(_0x504e('0x9'));var _=require(_0x504e('0xa'));var squel=require(_0x504e('0xb'));var crypto=require(_0x504e('0xc'));var jsforce=require(_0x504e('0xd'));var deskjs=require(_0x504e('0xe'));var toCsv=require(_0x504e('0x7'));var querystring=require(_0x504e('0xf'));var Papa=require(_0x504e('0x10'));var Redis=require('ioredis');var authService=require(_0x504e('0x11'));var qs=require(_0x504e('0x12'));var as=require(_0x504e('0x13'));var hardwareService=require(_0x504e('0x14'));var logger=require(_0x504e('0x15'))(_0x504e('0x16'));var utils=require(_0x504e('0x17'));var config=require(_0x504e('0x18'));var licenseUtil=require(_0x504e('0x19'));var db=require('../../mysqldb')['db'];config[_0x504e('0x1a')]=_['defaults'](config[_0x504e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x504e('0x1b'))(new Redis(config['redis']));require('./cmList.socket')[_0x504e('0x1c')](socket);function respondWithStatusCode(_0x6b918,_0x993dfd){_0x993dfd=_0x993dfd||0xcc;return function(_0x4a4667){if(_0x4a4667){return _0x6b918[_0x504e('0x1d')](_0x993dfd);}return _0x6b918[_0x504e('0x1e')](_0x993dfd)[_0x504e('0x1f')]();};}function respondWithResult(_0x3d4bac,_0x18b0bf){_0x18b0bf=_0x18b0bf||0xc8;return function(_0xee6ecb){if(_0xee6ecb){return _0x3d4bac[_0x504e('0x1e')](_0x18b0bf)[_0x504e('0x20')](_0xee6ecb);}};}function respondWithFilteredResult(_0x199649,_0x30e48a){return function(_0x33e1f9){if(_0x33e1f9){var _0x5a3b9d=_0x33e1f9[_0x504e('0x21')],_0x455ffb=_0x30e48a[_0x504e('0x22')],_0x3dac98=_0x30e48a[_0x504e('0x22')]+_0x30e48a[_0x504e('0x23')],_0x7a07e4;if(_0x3dac98>=_0x5a3b9d){_0x3dac98=_0x5a3b9d;_0x7a07e4=0xc8;}else{_0x7a07e4=0xce;}_0x199649[_0x504e('0x1e')](_0x7a07e4);return _0x199649[_0x504e('0x24')](_0x504e('0x25'),_0x455ffb+'-'+_0x3dac98+'/'+_0x5a3b9d)[_0x504e('0x20')](_0x33e1f9);}return null;};}function patchUpdates(_0x3ff359){return function(_0x7f9b10){try{jsonpatch['apply'](_0x7f9b10,_0x3ff359,!![]);}catch(_0xbd9584){return BPromise[_0x504e('0x26')](_0xbd9584);}return _0x7f9b10['save']();};}function saveUpdates(_0x1f19b7,_0x4926b8){return function(_0x3fa235){if(_0x3fa235){return _0x3fa235[_0x504e('0x27')](_0x1f19b7)['then'](function(_0x489faf){return _0x489faf;});}return null;};}function removeEntity(_0x537f50,_0x235deb){return function(_0x334284){if(_0x334284){return _0x334284[_0x504e('0x28')]()[_0x504e('0x29')](function(){var _0x873040=_0x334284['get']({'plain':!![]});var _0x23d05b=_0x504e('0x2a');return db[_0x504e('0x2b')][_0x504e('0x28')]({'where':{'type':_0x23d05b,'resourceId':_0x873040['id']}})[_0x504e('0x29')](function(){return _0x334284;});})[_0x504e('0x29')](function(){_0x537f50[_0x504e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x585d32,_0x39d4a6){return function(_0x27976f){if(!_0x27976f){_0x585d32[_0x504e('0x1d')](0x194);}return _0x27976f;};}function handleError(_0x906b1c,_0x232f5b){_0x232f5b=_0x232f5b||0x1f4;return function(_0x3d7187){logger[_0x504e('0x2c')](_0x3d7187[_0x504e('0x2d')]);if(_0x3d7187[_0x504e('0x2e')]){delete _0x3d7187['name'];}_0x906b1c['status'](_0x232f5b)[_0x504e('0x2f')](_0x3d7187);};}exports['index']=function(_0x199298,_0x101159){var _0x338bc1={},_0x182b98={},_0x28b691={'count':0x0,'rows':[]};var _0x5b3d11=_['map'](db['CmList'][_0x504e('0x30')],function(_0x39861f){return{'name':_0x39861f[_0x504e('0x31')],'type':_0x39861f[_0x504e('0x32')][_0x504e('0x33')]};});_0x182b98['model']=_[_0x504e('0x34')](_0x5b3d11,'name');_0x182b98['query']=_['keys'](_0x199298[_0x504e('0x35')]);_0x182b98[_0x504e('0x36')]=_[_0x504e('0x37')](_0x182b98[_0x504e('0x38')],_0x182b98[_0x504e('0x35')]);_0x338bc1[_0x504e('0x39')]=_['intersection'](_0x182b98[_0x504e('0x38')],qs['fields'](_0x199298['query'][_0x504e('0x3a')]));_0x338bc1['attributes']=_0x338bc1[_0x504e('0x39')][_0x504e('0x3b')]?_0x338bc1['attributes']:_0x182b98[_0x504e('0x38')];if(!_0x199298[_0x504e('0x35')][_0x504e('0x3c')]('nolimit')){_0x338bc1[_0x504e('0x23')]=qs[_0x504e('0x23')](_0x199298[_0x504e('0x35')][_0x504e('0x23')]);_0x338bc1[_0x504e('0x22')]=qs[_0x504e('0x22')](_0x199298[_0x504e('0x35')]['offset']);}_0x338bc1[_0x504e('0x3d')]=qs[_0x504e('0x3e')](_0x199298[_0x504e('0x35')][_0x504e('0x3e')]);_0x338bc1[_0x504e('0x3f')]=qs[_0x504e('0x36')](_[_0x504e('0x40')](_0x199298[_0x504e('0x35')],_0x182b98['filters']),_0x5b3d11);if(_0x199298[_0x504e('0x35')]['filter']){_0x338bc1['where']=_[_0x504e('0x41')](_0x338bc1[_0x504e('0x3f')],{'$or':_[_0x504e('0x34')](_0x5b3d11,function(_0x30f4ff){if(_0x30f4ff[_0x504e('0x32')]!==_0x504e('0x42')){var _0x4d284b={};_0x4d284b[_0x30f4ff[_0x504e('0x2e')]]={'$like':'%'+_0x199298[_0x504e('0x35')][_0x504e('0x43')]+'%'};return _0x4d284b;}})});}_0x338bc1=_[_0x504e('0x41')]({},_0x338bc1,_0x199298['options']);var _0x1b8601={'where':_0x338bc1['where']};return db[_0x504e('0x44')]['count'](_0x1b8601)[_0x504e('0x29')](function(_0x25247e){_0x28b691[_0x504e('0x21')]=_0x25247e;if(_0x199298['query']['includeAll']){_0x338bc1[_0x504e('0x45')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x338bc1);})['then'](function(_0x539985){_0x28b691[_0x504e('0x46')]=_0x539985;return _0x28b691;})[_0x504e('0x29')](respondWithFilteredResult(_0x101159,_0x338bc1))[_0x504e('0x47')](handleError(_0x101159,null));};exports['show']=function(_0x4273e4,_0x47384c){var _0x533ba3={'raw':![],'where':{'id':_0x4273e4[_0x504e('0x48')]['id']}},_0x5601ab={};_0x5601ab[_0x504e('0x38')]=_[_0x504e('0x49')](db['CmList'][_0x504e('0x30')]);_0x5601ab['query']=_['keys'](_0x4273e4[_0x504e('0x35')]);_0x5601ab['filters']=_[_0x504e('0x37')](_0x5601ab[_0x504e('0x38')],_0x5601ab[_0x504e('0x35')]);_0x533ba3[_0x504e('0x39')]=_[_0x504e('0x37')](_0x5601ab[_0x504e('0x38')],qs[_0x504e('0x3a')](_0x4273e4[_0x504e('0x35')][_0x504e('0x3a')]));_0x533ba3['attributes']=_0x533ba3[_0x504e('0x39')][_0x504e('0x3b')]?_0x533ba3['attributes']:_0x5601ab[_0x504e('0x38')];if(_0x4273e4[_0x504e('0x35')]['includeAll']){_0x533ba3['include']=[{'all':!![]}];}_0x533ba3=_[_0x504e('0x41')]({},_0x533ba3,_0x4273e4[_0x504e('0x4a')]);return db[_0x504e('0x44')]['find'](_0x533ba3)['then'](handleEntityNotFound(_0x47384c,null))['then'](respondWithResult(_0x47384c,null))[_0x504e('0x47')](handleError(_0x47384c,null));};exports[_0x504e('0x4b')]=function(_0xabe87a,_0xaae13a){return db[_0x504e('0x44')][_0x504e('0x4b')](_0xabe87a[_0x504e('0x4c')],{})['then'](function(_0x4aae51){var _0x58da0e=_0xabe87a[_0x504e('0x4d')][_0x504e('0x4e')]({'plain':!![]});if(!_0x58da0e)throw new Error(_0x504e('0x4f'));if(_0x58da0e['role']===_0x504e('0x4d')){var _0x1f1d3c=_0x4aae51['get']({'plain':!![]});var _0x5aeb4c=_0x504e('0x2a');return db['UserProfileSection'][_0x504e('0x50')]({'where':{'name':_0x5aeb4c,'userProfileId':_0x58da0e[_0x504e('0x51')]},'raw':!![]})[_0x504e('0x29')](function(_0x58e52b){if(_0x58e52b&&_0x58e52b[_0x504e('0x52')]===0x0){return db[_0x504e('0x2b')][_0x504e('0x4b')]({'name':_0x1f1d3c['name'],'resourceId':_0x1f1d3c['id'],'type':_0x58e52b[_0x504e('0x2e')],'sectionId':_0x58e52b['id']},{})[_0x504e('0x29')](function(){return _0x4aae51;});}else{return _0x4aae51;}})[_0x504e('0x47')](function(_0xb625ea){logger[_0x504e('0x2c')](_0x504e('0x53'),_0xb625ea);throw _0xb625ea;});}return _0x4aae51;})['then'](respondWithResult(_0xaae13a,0xc9))[_0x504e('0x47')](handleError(_0xaae13a,null));};exports[_0x504e('0x27')]=function(_0x4d3868,_0x5a20fb){if(_0x4d3868[_0x504e('0x4c')]['id']){delete _0x4d3868['body']['id'];}return db[_0x504e('0x44')]['find']({'where':{'id':_0x4d3868['params']['id']}})[_0x504e('0x29')](handleEntityNotFound(_0x5a20fb,null))[_0x504e('0x29')](saveUpdates(_0x4d3868['body'],null))[_0x504e('0x29')](respondWithResult(_0x5a20fb,null))['catch'](handleError(_0x5a20fb,null));};exports[_0x504e('0x28')]=function(_0x4cc249,_0x156865){return db['CmList'][_0x504e('0x50')]({'where':{'id':_0x4cc249[_0x504e('0x48')]['id']}})[_0x504e('0x29')](handleEntityNotFound(_0x156865,null))['then'](removeEntity(_0x156865,null))[_0x504e('0x47')](handleError(_0x156865,null));};exports['describe']=function(_0x58e47d,_0x46a5de){return db[_0x504e('0x44')][_0x504e('0x54')]()[_0x504e('0x29')](respondWithResult(_0x46a5de,null))[_0x504e('0x47')](handleError(_0x46a5de,null));};exports[_0x504e('0x55')]=function(_0x17cc5c,_0x485f76,_0x5746e0){if(_0x17cc5c[_0x504e('0x4c')]['id']){delete _0x17cc5c[_0x504e('0x4c')]['id'];}return db[_0x504e('0x44')][_0x504e('0x50')]({'where':{'id':_0x17cc5c['params']['id']}})[_0x504e('0x29')](handleEntityNotFound(_0x485f76,null))['then'](function(_0x5b3c0f){if(_0x5b3c0f){_0x17cc5c[_0x504e('0x4c')][_0x504e('0x56')]=_0x5b3c0f['id'];return db['Disposition'][_0x504e('0x4b')](_0x17cc5c['body']);}})[_0x504e('0x29')](respondWithResult(_0x485f76,null))[_0x504e('0x47')](handleError(_0x485f76,null));};exports[_0x504e('0x57')]=function(_0x18aac3,_0x57af23,_0x2d277f){var _0x5df800={'raw':![],'where':{}};var _0x20c707={};var _0x5977fb={'count':0x0,'rows':[]};return db[_0x504e('0x44')][_0x504e('0x58')]({'where':{'id':_0x18aac3[_0x504e('0x48')]['id']}})[_0x504e('0x29')](handleEntityNotFound(_0x57af23,null))[_0x504e('0x29')](function(_0x4b9876){if(_0x4b9876){_0x20c707[_0x504e('0x38')]=_[_0x504e('0x49')](db['Disposition'][_0x504e('0x30')]);_0x20c707[_0x504e('0x35')]=_[_0x504e('0x49')](_0x18aac3[_0x504e('0x35')]);_0x20c707['filters']=_[_0x504e('0x37')](_0x20c707['model'],_0x20c707['query']);_0x5df800[_0x504e('0x39')]=_[_0x504e('0x37')](_0x20c707[_0x504e('0x38')],qs['fields'](_0x18aac3[_0x504e('0x35')][_0x504e('0x3a')]));_0x5df800['attributes']=_0x5df800[_0x504e('0x39')][_0x504e('0x3b')]?_0x5df800[_0x504e('0x39')]:_0x20c707[_0x504e('0x38')];if(!_0x18aac3['query'][_0x504e('0x3c')](_0x504e('0x59'))){_0x5df800['limit']=qs[_0x504e('0x23')](_0x18aac3[_0x504e('0x35')][_0x504e('0x23')]);_0x5df800[_0x504e('0x22')]=qs[_0x504e('0x22')](_0x18aac3['query'][_0x504e('0x22')]);}_0x5df800[_0x504e('0x3d')]=qs['sort'](_0x18aac3[_0x504e('0x35')][_0x504e('0x3e')]);_0x5df800[_0x504e('0x3f')]=qs[_0x504e('0x36')](_['pick'](_0x18aac3[_0x504e('0x35')],_0x20c707[_0x504e('0x36')]));_0x5df800[_0x504e('0x3f')][_0x504e('0x56')]=_0x4b9876['id'];if(_0x18aac3[_0x504e('0x35')][_0x504e('0x43')]){_0x5df800[_0x504e('0x3f')]=_[_0x504e('0x41')](_0x5df800[_0x504e('0x3f')],{'$or':_[_0x504e('0x34')](_0x5df800[_0x504e('0x39')],function(_0xc00779){var _0x4bb0d2={};_0x4bb0d2[_0xc00779]={'$like':'%'+_0x18aac3[_0x504e('0x35')]['filter']+'%'};return _0x4bb0d2;})});}_0x5df800=_[_0x504e('0x41')]({},_0x5df800,_0x18aac3[_0x504e('0x4a')]);return db[_0x504e('0x5a')][_0x504e('0x21')]({'where':_0x5df800[_0x504e('0x3f')]})[_0x504e('0x29')](function(_0x2aa4cd){_0x5977fb[_0x504e('0x21')]=_0x2aa4cd;if(_0x18aac3[_0x504e('0x35')][_0x504e('0x5b')]){_0x5df800[_0x504e('0x45')]=[{'all':!![]}];}return db[_0x504e('0x5a')][_0x504e('0x5c')](_0x5df800);})[_0x504e('0x29')](function(_0x27cdf6){_0x5977fb[_0x504e('0x46')]=_0x27cdf6;return _0x5977fb;});}})['then'](respondWithFilteredResult(_0x57af23,_0x5df800))['catch'](handleError(_0x57af23,null));};exports[_0x504e('0x5d')]=function(_0x123b88,_0x430a3e,_0x3b326d){return db[_0x504e('0x44')][_0x504e('0x50')]({'where':{'id':_0x123b88[_0x504e('0x48')]['id']}})['then'](handleEntityNotFound(_0x430a3e,null))[_0x504e('0x29')](function(_0xb6b467){if(_0xb6b467){return _0xb6b467[_0x504e('0x5d')](_0x123b88[_0x504e('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x430a3e,null))[_0x504e('0x47')](handleError(_0x430a3e,null));};exports[_0x504e('0x5e')]=function(_0x11abc7,_0x5d43ac,_0x4fe18e){return db[_0x504e('0x44')][_0x504e('0x50')]({'where':{'id':_0x11abc7[_0x504e('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d43ac,null))[_0x504e('0x29')](function(_0x2a2fb4){if(_0x2a2fb4){var _0x2b3fe7=[];var _0x4ca2d7={'success':[],'errors':[]};return db[_0x504e('0x5f')]['describe']()['then'](function(_0x5d4649){if(_0x11abc7['body'][_0x504e('0x60')]&&_[_0x504e('0x61')](_0x11abc7[_0x504e('0x4c')][_0x504e('0x60')])){if(_0x11abc7[_0x504e('0x4c')][_0x504e('0x60')][_0x504e('0x3b')]){_0x11abc7[_0x504e('0x4c')]['tags']=_0x11abc7[_0x504e('0x4c')][_0x504e('0x60')][_0x504e('0x62')](';')+';';}else{_0x11abc7['body'][_0x504e('0x60')]=null;}}else{_0x11abc7[_0x504e('0x4c')][_0x504e('0x60')]=null;}if(_0x11abc7[_0x504e('0x4c')]&&_[_0x504e('0x61')](_0x11abc7['body'])){for(var _0x326af0=0x0;_0x326af0<_0x11abc7[_0x504e('0x4c')][_0x504e('0x3b')];_0x326af0+=0x1){_0x11abc7['body'][_0x326af0][_0x504e('0x56')]=_0x11abc7[_0x504e('0x48')]['id'];_0x2b3fe7[_0x504e('0x63')](_0x11abc7[_0x504e('0x4c')][_0x326af0]);}return BPromise['each'](_0x2b3fe7,function(_0x1f03ba){return db['CmContact'][_0x504e('0x4b')](_['omit'](_0x1f03ba,['ids','id'])||{},{'fields':_['keys'](_0x5d4649),'raw':!![]})[_0x504e('0x29')](function(_0x35cda8){_0x4ca2d7[_0x504e('0x64')]['push'](_0x35cda8[_0x504e('0x65')]);})['catch'](function(_0x4cdcf1){_0x4ca2d7['errors'][_0x504e('0x63')]({'data':_0x1f03ba,'error':_0x4cdcf1[_0x504e('0x66')]});});})[_0x504e('0x29')](function(_0x26c3d3){return _0x4ca2d7;})[_0x504e('0x47')](function(_0x25d631){return _0x25d631;});}else{_0x5d43ac[_0x504e('0x1e')](0x190)[_0x504e('0x20')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x504e('0x29')](respondWithResult(_0x5d43ac,null))[_0x504e('0x47')](handleError(_0x5d43ac,null));};exports[_0x504e('0x67')]=function(_0x3ffcbc,_0x54a793,_0x5754c8){var _0xde4aa9;return db['CmList'][_0x504e('0x50')]({'where':{'id':_0x3ffcbc[_0x504e('0x48')]['id']},'include':[{'model':db[_0x504e('0x68')],'as':'CustomFields'}]})[_0x504e('0x29')](handleEntityNotFound(_0x54a793,null))['then'](function(_0x203425){if(_0x203425){_0xde4aa9=_0x203425;return db[_0x504e('0x5f')][_0x504e('0x30')];}})['then'](function(_0x226d89){if(_0x226d89){var _0x583894={};var _0x4aefaf={};_0x4aefaf[_0x504e('0x38')]=_[_0x504e('0x69')](_[_0x504e('0x49')](_0x226d89),_[_0x504e('0x34')](_0xde4aa9[_0x504e('0x6a')],function(_0x4e4295){return util[_0x504e('0x6b')](_0x504e('0x6c'),_0x4e4295['id']);}));_0x4aefaf[_0x504e('0x35')]=_[_0x504e('0x49')](_0x3ffcbc[_0x504e('0x35')]);_0x4aefaf[_0x504e('0x36')]=_[_0x504e('0x37')](_0x4aefaf[_0x504e('0x38')],_0x4aefaf['query']);_0x583894[_0x504e('0x39')]=_[_0x504e('0x37')](_0x4aefaf[_0x504e('0x38')],qs[_0x504e('0x3a')](_0x3ffcbc[_0x504e('0x35')]['fields']));_0x583894[_0x504e('0x39')]=_0x583894[_0x504e('0x39')][_0x504e('0x3b')]?_0x583894[_0x504e('0x39')]:_0x4aefaf[_0x504e('0x38')];if(!_0x3ffcbc[_0x504e('0x35')]['hasOwnProperty'](_0x504e('0x59'))){_0x583894[_0x504e('0x23')]=qs[_0x504e('0x23')](_0x3ffcbc[_0x504e('0x35')]['limit']);_0x583894[_0x504e('0x22')]=qs[_0x504e('0x22')](_0x3ffcbc[_0x504e('0x35')][_0x504e('0x22')]);}_0x583894[_0x504e('0x3d')]=qs[_0x504e('0x3e')](_0x3ffcbc[_0x504e('0x35')][_0x504e('0x3e')]);_0x583894['where']=qs[_0x504e('0x36')](_[_0x504e('0x40')](_0x3ffcbc[_0x504e('0x35')],_0x4aefaf[_0x504e('0x36')]));_0x583894[_0x504e('0x6d')]=!![];if(_0x3ffcbc[_0x504e('0x35')][_0x504e('0x43')]){_0x583894[_0x504e('0x3f')]=_[_0x504e('0x41')](_0x583894[_0x504e('0x3f')],{'$or':_['map'](_0x583894[_0x504e('0x39')],function(_0x106d59){var _0x127663={};_0x127663[_0x106d59]={'$like':'%'+_0x3ffcbc[_0x504e('0x35')][_0x504e('0x43')]+'%'};return _0x127663;})});}_0x583894=_[_0x504e('0x41')]({},_0x583894,_0x3ffcbc['options']);return _0xde4aa9['getContacts'](_0x583894);}})['then'](respondWithResult(_0x54a793,null))['catch'](handleError(_0x54a793,null));};exports[_0x504e('0x6e')]=function(_0x443a4c,_0x38ec75,_0x2a3cbb){var _0x48d0b7;return db[_0x504e('0x44')][_0x504e('0x50')]({'where':{'id':_0x443a4c[_0x504e('0x48')]['id']},'include':[{'model':db[_0x504e('0x68')],'as':_0x504e('0x6a')}]})['then'](handleEntityNotFound(_0x38ec75,null))[_0x504e('0x29')](function(_0x28d1a7){if(_0x28d1a7){_0x48d0b7=_0x28d1a7;return db[_0x504e('0x5f')][_0x504e('0x30')];}})[_0x504e('0x29')](function(_0x10f202){if(_0x10f202){var _0x4d4c03={};var _0x233d72={};_0x233d72[_0x504e('0x38')]=_[_0x504e('0x69')](_[_0x504e('0x49')](_0x10f202),_[_0x504e('0x34')](_0x48d0b7[_0x504e('0x6a')],function(_0xa79272){return util['format'](_0x504e('0x6c'),_0xa79272['id']);}));_0x233d72[_0x504e('0x35')]=_[_0x504e('0x49')](_0x443a4c[_0x504e('0x35')]);_0x233d72[_0x504e('0x36')]=_[_0x504e('0x37')](_0x233d72['model'],_0x233d72['query']);_0x4d4c03[_0x504e('0x39')]=_[_0x504e('0x37')](_0x233d72[_0x504e('0x38')],qs[_0x504e('0x3a')](_0x443a4c[_0x504e('0x35')][_0x504e('0x3a')]));_0x4d4c03['attributes']=_0x4d4c03[_0x504e('0x39')][_0x504e('0x3b')]?_0x4d4c03[_0x504e('0x39')]:_0x233d72[_0x504e('0x38')];if(!_0x443a4c['query'][_0x504e('0x3c')](_0x504e('0x59'))){_0x4d4c03[_0x504e('0x23')]=qs[_0x504e('0x23')](_0x443a4c[_0x504e('0x35')][_0x504e('0x23')]);_0x4d4c03[_0x504e('0x22')]=qs[_0x504e('0x22')](_0x443a4c[_0x504e('0x35')][_0x504e('0x22')]);}_0x4d4c03['order']=qs['sort'](_0x443a4c[_0x504e('0x35')][_0x504e('0x3e')]);_0x4d4c03[_0x504e('0x3f')]=qs[_0x504e('0x36')](_['pick'](_0x443a4c[_0x504e('0x35')],_0x233d72[_0x504e('0x36')]));_0x4d4c03['raw']=!![];if(_0x443a4c[_0x504e('0x35')][_0x504e('0x43')]){_0x4d4c03['where']=_[_0x504e('0x41')](_0x4d4c03['where'],{'$or':_[_0x504e('0x34')](_0x4d4c03[_0x504e('0x39')],function(_0x1ca99f){var _0x55516b={};_0x55516b[_0x1ca99f]={'$like':'%'+_0x443a4c[_0x504e('0x35')][_0x504e('0x43')]+'%'};return _0x55516b;})});}_0x4d4c03=_[_0x504e('0x41')]({},_0x4d4c03,_0x443a4c[_0x504e('0x4a')]);return _0x48d0b7[_0x504e('0x67')](_0x4d4c03);}})['then'](function(_0x33a99c){if(!_[_0x504e('0x6f')](_0x33a99c)){var _0x477ba6=toCsv(_0x33a99c);var _0x3ef9f0=Date[_0x504e('0x70')]();fs[_0x504e('0x71')](util['format'](_0x504e('0x72'),_0x48d0b7['id'],_0x3ef9f0),_0x477ba6);_0x38ec75['setHeader'](_0x504e('0x73'),_0x504e('0x74')+util['format']('list_%d_%s.csv',_0x48d0b7['id'],_0x3ef9f0));_0x38ec75[_0x504e('0x75')]('Content-type',_0x504e('0x76'));return _0x38ec75[_0x504e('0x77')](util[_0x504e('0x6b')](_0x504e('0x72'),_0x48d0b7['id'],_0x3ef9f0));}else{return _0x38ec75[_0x504e('0x1d')](0xcc);}})[_0x504e('0x47')](handleError(_0x38ec75,null));};exports[_0x504e('0x78')]=function(_0x55d9a6,_0x2b4a71,_0x4bb0d4){var _0x1f79f8;delete _0x55d9a6[_0x504e('0x4c')]['id'];return db[_0x504e('0x44')]['findOne']({'where':{'id':_0x55d9a6[_0x504e('0x48')]['id']}})[_0x504e('0x29')](handleEntityNotFound(_0x2b4a71,null))[_0x504e('0x29')](function(_0x4ddf8f){if(_0x4ddf8f){return db['sequelize'][_0x504e('0x79')](function(_0x1c12a3){return db[_0x504e('0x68')][_0x504e('0x4b')](_0x55d9a6[_0x504e('0x4c')],{'transaction':_0x1c12a3})[_0x504e('0x29')](function(_0x1508ce){_0x1f79f8=_0x1508ce;return _0x4ddf8f[_0x504e('0x7a')](_0x1508ce,{'transaction':_0x1c12a3});})['then'](function(){var _0x4f25ad={'type':db[_0x504e('0x7b')][_0x504e('0x7c')],'transaction':_0x1c12a3};switch(_0x55d9a6[_0x504e('0x4c')][_0x504e('0x32')]){case _0x504e('0x7d'):_0x4f25ad[_0x504e('0x32')]=db[_0x504e('0x7b')]['TEXT'];break;case'number':_0x4f25ad['type']=db[_0x504e('0x7b')][_0x504e('0x7e')];break;case _0x504e('0x7f'):_0x4f25ad[_0x504e('0x32')]=db[_0x504e('0x7b')][_0x504e('0x80')];_0x4f25ad['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0x504e('0x81')](_0x504e('0x82'),util[_0x504e('0x6b')]('cf_%s',_0x1f79f8['id']),_0x4f25ad);})[_0x504e('0x29')](function(){return _0x1f79f8;});});}})['then'](respondWithResult(_0x2b4a71,null))['catch'](handleError(_0x2b4a71,null));};exports[_0x504e('0x83')]=function(_0x54b0f4,_0x3324ec,_0x2506c7){var _0x15e04d={};var _0x19476e={};var _0x3d80d3;var _0x5bf9be;return db[_0x504e('0x44')][_0x504e('0x58')]({'where':{'id':_0x54b0f4[_0x504e('0x48')]['id']}})[_0x504e('0x29')](handleEntityNotFound(_0x3324ec,null))[_0x504e('0x29')](function(_0x54d97f){if(_0x54d97f){_0x3d80d3=_0x54d97f;_0x19476e[_0x504e('0x38')]=_[_0x504e('0x49')](db[_0x504e('0x68')][_0x504e('0x30')]);_0x19476e[_0x504e('0x35')]=_['keys'](_0x54b0f4[_0x504e('0x35')]);_0x19476e[_0x504e('0x36')]=_[_0x504e('0x37')](_0x19476e[_0x504e('0x38')],_0x19476e[_0x504e('0x35')]);_0x15e04d[_0x504e('0x39')]=_[_0x504e('0x37')](_0x19476e[_0x504e('0x38')],qs[_0x504e('0x3a')](_0x54b0f4[_0x504e('0x35')][_0x504e('0x3a')]));_0x15e04d[_0x504e('0x39')]=_0x15e04d[_0x504e('0x39')][_0x504e('0x3b')]?_0x15e04d['attributes']:_0x19476e[_0x504e('0x38')];_0x15e04d[_0x504e('0x3d')]=qs['sort'](_0x54b0f4['query'][_0x504e('0x3e')]);_0x15e04d['where']=qs[_0x504e('0x36')](_[_0x504e('0x40')](_0x54b0f4[_0x504e('0x35')],_0x19476e[_0x504e('0x36')]));_0x15e04d[_0x504e('0x3f')]=_[_0x504e('0x41')](_0x15e04d[_0x504e('0x3f')],{'$or':[{'ListId':_0x54d97f['id']},{'ListId':null}]});if(_0x54b0f4['query'][_0x504e('0x43')]){_0x15e04d[_0x504e('0x3f')]=_[_0x504e('0x41')](_0x15e04d[_0x504e('0x3f')],{'$or':_[_0x504e('0x34')](_0x15e04d['attributes'],function(_0x5c2184){var _0x63e016={};_0x63e016[_0x5c2184]={'$like':'%'+_0x54b0f4[_0x504e('0x35')]['filter']+'%'};return _0x63e016;})});}_0x15e04d=_[_0x504e('0x41')]({},_0x15e04d,_0x54b0f4[_0x504e('0x4a')]);return db[_0x504e('0x68')]['findAndCountAll'](_0x15e04d);}})['then'](respondWithResult(_0x3324ec,null))[_0x504e('0x47')](handleError(_0x3324ec,null));};exports[_0x504e('0x84')]=function(_0x483ccf,_0x1424e2,_0x390538){return db[_0x504e('0x44')][_0x504e('0x50')]({'where':{'id':_0x483ccf['params']['id']}})[_0x504e('0x29')](handleEntityNotFound(_0x1424e2,null))[_0x504e('0x29')](function(_0x42e547){if(_0x42e547){return _0x42e547['addAgents'](_0x483ccf[_0x504e('0x4c')][_0x504e('0x85')],_[_0x504e('0x86')](_0x483ccf[_0x504e('0x4c')],[_0x504e('0x85'),'id'])||{})['spread'](function(_0x12c035){for(var _0x3a73b3=0x0;_0x3a73b3<_0x483ccf[_0x504e('0x4c')][_0x504e('0x85')][_0x504e('0x3b')];_0x3a73b3+=0x1){socket[_0x504e('0x87')](_0x504e('0x88'),{'UserId':_0x483ccf[_0x504e('0x4c')][_0x504e('0x85')][_0x3a73b3],'CmListId':_0x483ccf[_0x504e('0x48')]['id']});}return _0x12c035;});}})[_0x504e('0x29')](respondWithResult(_0x1424e2,null))[_0x504e('0x47')](handleError(_0x1424e2,null));};exports[_0x504e('0x89')]=function(_0xfaa63a,_0x4b0910,_0x534359){return db[_0x504e('0x44')][_0x504e('0x50')]({'where':{'id':_0xfaa63a['params']['id']}})[_0x504e('0x29')](handleEntityNotFound(_0x4b0910,null))[_0x504e('0x29')](function(_0x232827){if(_0x232827){return _0x232827[_0x504e('0x89')](_0xfaa63a[_0x504e('0x35')][_0x504e('0x85')])[_0x504e('0x29')](function(){if(_['isArray'](_0xfaa63a['query'][_0x504e('0x85')])){for(var _0x2756b4=0x0;_0x2756b4<_0xfaa63a[_0x504e('0x35')][_0x504e('0x85')][_0x504e('0x3b')];_0x2756b4+=0x1){socket[_0x504e('0x87')]('userCmList:remove',{'UserId':Number(_0xfaa63a['query'][_0x504e('0x85')][_0x2756b4]),'CmListId':Number(_0xfaa63a[_0x504e('0x48')]['id'])});}}else{socket[_0x504e('0x87')]('userCmList:remove',{'UserId':Number(_0xfaa63a[_0x504e('0x35')][_0x504e('0x85')]),'CmListId':Number(_0xfaa63a[_0x504e('0x48')]['id'])});}});}})[_0x504e('0x29')](respondWithStatusCode(_0x4b0910,null))[_0x504e('0x47')](handleError(_0x4b0910,null));};exports['getAgents']=function(_0x2616f6,_0x19018d,_0x3b1876){var _0x93d9e={};var _0x551e16={};var _0x31a1ff;var _0x3fd9d7;return db['CmList'][_0x504e('0x58')]({'where':{'id':_0x2616f6['params']['id']}})[_0x504e('0x29')](handleEntityNotFound(_0x19018d,null))['then'](function(_0x5dc50d){if(_0x5dc50d){_0x31a1ff=_0x5dc50d;_0x551e16['model']=_[_0x504e('0x49')](db[_0x504e('0x8a')]['rawAttributes']);_0x551e16['query']=_[_0x504e('0x49')](_0x2616f6[_0x504e('0x35')]);_0x551e16[_0x504e('0x36')]=_[_0x504e('0x37')](_0x551e16['model'],_0x551e16['query']);_0x93d9e[_0x504e('0x39')]=_['intersection'](_0x551e16['model'],qs['fields'](_0x2616f6['query']['fields']));_0x93d9e[_0x504e('0x39')]=_0x93d9e['attributes']['length']?_0x93d9e['attributes']:_0x551e16[_0x504e('0x38')];_0x93d9e[_0x504e('0x3d')]=qs['sort'](_0x2616f6[_0x504e('0x35')][_0x504e('0x3e')]);_0x93d9e['where']=qs['filters'](_['pick'](_0x2616f6[_0x504e('0x35')],_0x551e16[_0x504e('0x36')]));if(_0x2616f6[_0x504e('0x35')][_0x504e('0x43')]){_0x93d9e[_0x504e('0x3f')]=_[_0x504e('0x41')](_0x93d9e[_0x504e('0x3f')],{'$or':_[_0x504e('0x34')](_0x93d9e['attributes'],function(_0x218e4d){var _0x23ee63={};_0x23ee63[_0x218e4d]={'$like':'%'+_0x2616f6['query'][_0x504e('0x43')]+'%'};return _0x23ee63;})});}_0x93d9e=_[_0x504e('0x41')]({},_0x93d9e,_0x2616f6['options']);return _0x31a1ff['getAgents'](_0x93d9e);}})[_0x504e('0x29')](function(_0x6ab92c){if(_0x6ab92c){_0x3fd9d7=_0x6ab92c['length'];if(!_0x2616f6[_0x504e('0x35')][_0x504e('0x3c')]('nolimit')){_0x93d9e[_0x504e('0x23')]=qs[_0x504e('0x23')](_0x2616f6['query'][_0x504e('0x23')]);_0x93d9e[_0x504e('0x22')]=qs['offset'](_0x2616f6[_0x504e('0x35')][_0x504e('0x22')]);}return _0x31a1ff['getAgents'](_0x93d9e);}})['then'](function(_0x34ecd9){if(_0x34ecd9){return _0x34ecd9?{'count':_0x3fd9d7,'rows':_0x34ecd9}:null;}})[_0x504e('0x29')](respondWithResult(_0x19018d,null))[_0x504e('0x47')](handleError(_0x19018d,null));}; \ No newline at end of file +var _0xff26=['/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','isArray','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./cmList.socket','register','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','Lists','UserProfileResource','error','name','send','index','map','CmList','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','includeAll','include','findAll','show','params','merge','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','getDispositions','findOne','options','ids','tags','join','push','each','CmContact','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','cf_%d','order','raw','format','isEmpty','writeFileSync'];(function(_0x248df4,_0x2c9820){var _0x593986=function(_0x5b69df){while(--_0x5b69df){_0x248df4['push'](_0x248df4['shift']());}};_0x593986(++_0x2c9820);}(_0xff26,0x1da));var _0x6ff2=function(_0x2af235,_0x45f664){_0x2af235=_0x2af235-0x0;var _0x593c0e=_0xff26[_0x2af235];return _0x593c0e;};'use strict';var emlformat=require(_0x6ff2('0x0'));var rimraf=require(_0x6ff2('0x1'));var zipdir=require(_0x6ff2('0x2'));var jsonpatch=require(_0x6ff2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6ff2('0x4'));var Mustache=require(_0x6ff2('0x5'));var util=require('util');var path=require(_0x6ff2('0x6'));var sox=require('sox');var csv=require(_0x6ff2('0x7'));var ejs=require(_0x6ff2('0x8'));var fs=require('fs');var fs_extra=require(_0x6ff2('0x9'));var _=require(_0x6ff2('0xa'));var squel=require(_0x6ff2('0xb'));var crypto=require(_0x6ff2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6ff2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6ff2('0xe'));var Papa=require(_0x6ff2('0xf'));var Redis=require(_0x6ff2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6ff2('0x11'));var as=require(_0x6ff2('0x12'));var hardwareService=require(_0x6ff2('0x13'));var logger=require(_0x6ff2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6ff2('0x15'));var licenseUtil=require(_0x6ff2('0x16'));var db=require(_0x6ff2('0x17'))['db'];config['redis']=_[_0x6ff2('0x18')](config[_0x6ff2('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ff2('0x19')]));require(_0x6ff2('0x1a'))[_0x6ff2('0x1b')](socket);function respondWithStatusCode(_0x5e3005,_0x124cae){_0x124cae=_0x124cae||0xcc;return function(_0x58edf9){if(_0x58edf9){return _0x5e3005[_0x6ff2('0x1c')](_0x124cae);}return _0x5e3005['status'](_0x124cae)[_0x6ff2('0x1d')]();};}function respondWithResult(_0x5f3f5b,_0x3f4994){_0x3f4994=_0x3f4994||0xc8;return function(_0x327879){if(_0x327879){return _0x5f3f5b[_0x6ff2('0x1e')](_0x3f4994)[_0x6ff2('0x1f')](_0x327879);}};}function respondWithFilteredResult(_0xf6f203,_0x5de493){return function(_0x2793fb){if(_0x2793fb){var _0x4ec2e8=_0x2793fb[_0x6ff2('0x20')],_0x198d95=_0x5de493[_0x6ff2('0x21')],_0x5c93b8=_0x5de493[_0x6ff2('0x21')]+_0x5de493[_0x6ff2('0x22')],_0x25814a;if(_0x5c93b8>=_0x4ec2e8){_0x5c93b8=_0x4ec2e8;_0x25814a=0xc8;}else{_0x25814a=0xce;}_0xf6f203[_0x6ff2('0x1e')](_0x25814a);return _0xf6f203['set'](_0x6ff2('0x23'),_0x198d95+'-'+_0x5c93b8+'/'+_0x4ec2e8)[_0x6ff2('0x1f')](_0x2793fb);}return null;};}function patchUpdates(_0x4242d7){return function(_0x38c078){try{jsonpatch[_0x6ff2('0x24')](_0x38c078,_0x4242d7,!![]);}catch(_0x45669f){return BPromise[_0x6ff2('0x25')](_0x45669f);}return _0x38c078[_0x6ff2('0x26')]();};}function saveUpdates(_0xceb810,_0x2f502b){return function(_0x2a9d88){if(_0x2a9d88){return _0x2a9d88[_0x6ff2('0x27')](_0xceb810)['then'](function(_0x336e72){return _0x336e72;});}return null;};}function removeEntity(_0x17322d,_0x24f96a){return function(_0x577bd3){if(_0x577bd3){return _0x577bd3[_0x6ff2('0x28')]()[_0x6ff2('0x29')](function(){var _0x435260=_0x577bd3[_0x6ff2('0x2a')]({'plain':!![]});var _0x5f1d03=_0x6ff2('0x2b');return db[_0x6ff2('0x2c')][_0x6ff2('0x28')]({'where':{'type':_0x5f1d03,'resourceId':_0x435260['id']}})['then'](function(){return _0x577bd3;});})['then'](function(){_0x17322d[_0x6ff2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26337c,_0x52590d){return function(_0x48633c){if(!_0x48633c){_0x26337c[_0x6ff2('0x1c')](0x194);}return _0x48633c;};}function handleError(_0x3853aa,_0x225a9a){_0x225a9a=_0x225a9a||0x1f4;return function(_0x41b2ab){logger[_0x6ff2('0x2d')](_0x41b2ab['stack']);if(_0x41b2ab[_0x6ff2('0x2e')]){delete _0x41b2ab['name'];}_0x3853aa[_0x6ff2('0x1e')](_0x225a9a)[_0x6ff2('0x2f')](_0x41b2ab);};}exports[_0x6ff2('0x30')]=function(_0x5b222d,_0xc6f200){var _0x4442cc={},_0x29c914={},_0x35e5a6={'count':0x0,'rows':[]};var _0x3fac3b=_[_0x6ff2('0x31')](db[_0x6ff2('0x32')][_0x6ff2('0x33')],function(_0x276ea2){return{'name':_0x276ea2[_0x6ff2('0x34')],'type':_0x276ea2[_0x6ff2('0x35')][_0x6ff2('0x36')]};});_0x29c914['model']=_[_0x6ff2('0x31')](_0x3fac3b,_0x6ff2('0x2e'));_0x29c914['query']=_[_0x6ff2('0x37')](_0x5b222d[_0x6ff2('0x38')]);_0x29c914['filters']=_[_0x6ff2('0x39')](_0x29c914[_0x6ff2('0x3a')],_0x29c914['query']);_0x4442cc[_0x6ff2('0x3b')]=_[_0x6ff2('0x39')](_0x29c914['model'],qs[_0x6ff2('0x3c')](_0x5b222d[_0x6ff2('0x38')][_0x6ff2('0x3c')]));_0x4442cc[_0x6ff2('0x3b')]=_0x4442cc[_0x6ff2('0x3b')][_0x6ff2('0x3d')]?_0x4442cc[_0x6ff2('0x3b')]:_0x29c914[_0x6ff2('0x3a')];if(!_0x5b222d[_0x6ff2('0x38')][_0x6ff2('0x3e')](_0x6ff2('0x3f'))){_0x4442cc['limit']=qs[_0x6ff2('0x22')](_0x5b222d[_0x6ff2('0x38')]['limit']);_0x4442cc['offset']=qs['offset'](_0x5b222d['query'][_0x6ff2('0x21')]);}_0x4442cc['order']=qs[_0x6ff2('0x40')](_0x5b222d['query'][_0x6ff2('0x40')]);_0x4442cc[_0x6ff2('0x41')]=qs[_0x6ff2('0x42')](_[_0x6ff2('0x43')](_0x5b222d[_0x6ff2('0x38')],_0x29c914['filters']),_0x3fac3b);if(_0x5b222d['query'][_0x6ff2('0x44')]){_0x4442cc[_0x6ff2('0x41')]=_['merge'](_0x4442cc[_0x6ff2('0x41')],{'$or':_[_0x6ff2('0x31')](_0x3fac3b,function(_0x49fa57){if(_0x49fa57[_0x6ff2('0x35')]!=='VIRTUAL'){var _0x475546={};_0x475546[_0x49fa57['name']]={'$like':'%'+_0x5b222d[_0x6ff2('0x38')][_0x6ff2('0x44')]+'%'};return _0x475546;}})});}_0x4442cc=_['merge']({},_0x4442cc,_0x5b222d['options']);var _0x167be7={'where':_0x4442cc[_0x6ff2('0x41')]};return db[_0x6ff2('0x32')][_0x6ff2('0x20')](_0x167be7)[_0x6ff2('0x29')](function(_0x30e504){_0x35e5a6['count']=_0x30e504;if(_0x5b222d[_0x6ff2('0x38')][_0x6ff2('0x45')]){_0x4442cc[_0x6ff2('0x46')]=[{'all':!![]}];}return db['CmList'][_0x6ff2('0x47')](_0x4442cc);})['then'](function(_0x4286d6){_0x35e5a6['rows']=_0x4286d6;return _0x35e5a6;})['then'](respondWithFilteredResult(_0xc6f200,_0x4442cc))['catch'](handleError(_0xc6f200,null));};exports[_0x6ff2('0x48')]=function(_0x22374a,_0x2f7351){var _0x5dc031={'raw':![],'where':{'id':_0x22374a[_0x6ff2('0x49')]['id']}},_0x5c9b7b={};_0x5c9b7b[_0x6ff2('0x3a')]=_[_0x6ff2('0x37')](db['CmList'][_0x6ff2('0x33')]);_0x5c9b7b[_0x6ff2('0x38')]=_[_0x6ff2('0x37')](_0x22374a['query']);_0x5c9b7b['filters']=_[_0x6ff2('0x39')](_0x5c9b7b[_0x6ff2('0x3a')],_0x5c9b7b[_0x6ff2('0x38')]);_0x5dc031[_0x6ff2('0x3b')]=_[_0x6ff2('0x39')](_0x5c9b7b['model'],qs[_0x6ff2('0x3c')](_0x22374a['query']['fields']));_0x5dc031['attributes']=_0x5dc031[_0x6ff2('0x3b')][_0x6ff2('0x3d')]?_0x5dc031[_0x6ff2('0x3b')]:_0x5c9b7b[_0x6ff2('0x3a')];if(_0x22374a['query'][_0x6ff2('0x45')]){_0x5dc031[_0x6ff2('0x46')]=[{'all':!![]}];}_0x5dc031=_[_0x6ff2('0x4a')]({},_0x5dc031,_0x22374a['options']);return db[_0x6ff2('0x32')]['find'](_0x5dc031)[_0x6ff2('0x29')](handleEntityNotFound(_0x2f7351,null))[_0x6ff2('0x29')](respondWithResult(_0x2f7351,null))['catch'](handleError(_0x2f7351,null));};exports[_0x6ff2('0x4b')]=function(_0x76c4b1,_0x50a5ca){return db[_0x6ff2('0x32')]['create'](_0x76c4b1['body'],{})['then'](function(_0x4c238e){var _0x264596=_0x76c4b1[_0x6ff2('0x4c')][_0x6ff2('0x2a')]({'plain':!![]});if(!_0x264596)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x264596[_0x6ff2('0x4d')]===_0x6ff2('0x4c')){var _0x6bbef9=_0x4c238e[_0x6ff2('0x2a')]({'plain':!![]});var _0x99f5b7=_0x6ff2('0x2b');return db[_0x6ff2('0x4e')][_0x6ff2('0x4f')]({'where':{'name':_0x99f5b7,'userProfileId':_0x264596[_0x6ff2('0x50')]},'raw':!![]})[_0x6ff2('0x29')](function(_0x3b3916){if(_0x3b3916&&_0x3b3916[_0x6ff2('0x51')]===0x0){return db[_0x6ff2('0x2c')]['create']({'name':_0x6bbef9['name'],'resourceId':_0x6bbef9['id'],'type':_0x3b3916[_0x6ff2('0x2e')],'sectionId':_0x3b3916['id']},{})[_0x6ff2('0x29')](function(){return _0x4c238e;});}else{return _0x4c238e;}})[_0x6ff2('0x52')](function(_0x47a824){logger['error'](_0x6ff2('0x53'),_0x47a824);throw _0x47a824;});}return _0x4c238e;})[_0x6ff2('0x29')](respondWithResult(_0x50a5ca,0xc9))['catch'](handleError(_0x50a5ca,null));};exports[_0x6ff2('0x27')]=function(_0x533bf4,_0x44cced){if(_0x533bf4[_0x6ff2('0x54')]['id']){delete _0x533bf4[_0x6ff2('0x54')]['id'];}return db[_0x6ff2('0x32')][_0x6ff2('0x4f')]({'where':{'id':_0x533bf4[_0x6ff2('0x49')]['id']}})[_0x6ff2('0x29')](handleEntityNotFound(_0x44cced,null))[_0x6ff2('0x29')](saveUpdates(_0x533bf4['body'],null))[_0x6ff2('0x29')](respondWithResult(_0x44cced,null))[_0x6ff2('0x52')](handleError(_0x44cced,null));};exports[_0x6ff2('0x28')]=function(_0x5f0f39,_0x1d4776){return db[_0x6ff2('0x32')][_0x6ff2('0x4f')]({'where':{'id':_0x5f0f39[_0x6ff2('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d4776,null))[_0x6ff2('0x29')](removeEntity(_0x1d4776,null))[_0x6ff2('0x52')](handleError(_0x1d4776,null));};exports[_0x6ff2('0x55')]=function(_0x2f73b8,_0x5cbe70){return db['CmList'][_0x6ff2('0x55')]()[_0x6ff2('0x29')](respondWithResult(_0x5cbe70,null))[_0x6ff2('0x52')](handleError(_0x5cbe70,null));};exports[_0x6ff2('0x56')]=function(_0x545bce,_0x398bb8,_0x15df09){if(_0x545bce[_0x6ff2('0x54')]['id']){delete _0x545bce[_0x6ff2('0x54')]['id'];}return db[_0x6ff2('0x32')][_0x6ff2('0x4f')]({'where':{'id':_0x545bce[_0x6ff2('0x49')]['id']}})['then'](handleEntityNotFound(_0x398bb8,null))[_0x6ff2('0x29')](function(_0x34f803){if(_0x34f803){_0x545bce['body'][_0x6ff2('0x57')]=_0x34f803['id'];return db[_0x6ff2('0x58')][_0x6ff2('0x4b')](_0x545bce[_0x6ff2('0x54')]);}})[_0x6ff2('0x29')](respondWithResult(_0x398bb8,null))[_0x6ff2('0x52')](handleError(_0x398bb8,null));};exports[_0x6ff2('0x59')]=function(_0x1944cd,_0x105cfc,_0xdc52bb){var _0x2fe7a4={'raw':![],'where':{}};var _0x2d3e19={};var _0x492086={'count':0x0,'rows':[]};return db['CmList'][_0x6ff2('0x5a')]({'where':{'id':_0x1944cd[_0x6ff2('0x49')]['id']}})[_0x6ff2('0x29')](handleEntityNotFound(_0x105cfc,null))[_0x6ff2('0x29')](function(_0x5935de){if(_0x5935de){_0x2d3e19[_0x6ff2('0x3a')]=_['keys'](db[_0x6ff2('0x58')][_0x6ff2('0x33')]);_0x2d3e19[_0x6ff2('0x38')]=_[_0x6ff2('0x37')](_0x1944cd[_0x6ff2('0x38')]);_0x2d3e19[_0x6ff2('0x42')]=_[_0x6ff2('0x39')](_0x2d3e19[_0x6ff2('0x3a')],_0x2d3e19['query']);_0x2fe7a4[_0x6ff2('0x3b')]=_['intersection'](_0x2d3e19[_0x6ff2('0x3a')],qs['fields'](_0x1944cd[_0x6ff2('0x38')][_0x6ff2('0x3c')]));_0x2fe7a4[_0x6ff2('0x3b')]=_0x2fe7a4[_0x6ff2('0x3b')][_0x6ff2('0x3d')]?_0x2fe7a4[_0x6ff2('0x3b')]:_0x2d3e19[_0x6ff2('0x3a')];if(!_0x1944cd[_0x6ff2('0x38')][_0x6ff2('0x3e')](_0x6ff2('0x3f'))){_0x2fe7a4[_0x6ff2('0x22')]=qs[_0x6ff2('0x22')](_0x1944cd[_0x6ff2('0x38')][_0x6ff2('0x22')]);_0x2fe7a4[_0x6ff2('0x21')]=qs[_0x6ff2('0x21')](_0x1944cd[_0x6ff2('0x38')][_0x6ff2('0x21')]);}_0x2fe7a4['order']=qs[_0x6ff2('0x40')](_0x1944cd[_0x6ff2('0x38')]['sort']);_0x2fe7a4[_0x6ff2('0x41')]=qs[_0x6ff2('0x42')](_[_0x6ff2('0x43')](_0x1944cd[_0x6ff2('0x38')],_0x2d3e19['filters']));_0x2fe7a4[_0x6ff2('0x41')]['ListId']=_0x5935de['id'];if(_0x1944cd[_0x6ff2('0x38')][_0x6ff2('0x44')]){_0x2fe7a4[_0x6ff2('0x41')]=_[_0x6ff2('0x4a')](_0x2fe7a4[_0x6ff2('0x41')],{'$or':_[_0x6ff2('0x31')](_0x2fe7a4[_0x6ff2('0x3b')],function(_0x2c05ae){var _0x3e3e3c={};_0x3e3e3c[_0x2c05ae]={'$like':'%'+_0x1944cd[_0x6ff2('0x38')][_0x6ff2('0x44')]+'%'};return _0x3e3e3c;})});}_0x2fe7a4=_[_0x6ff2('0x4a')]({},_0x2fe7a4,_0x1944cd[_0x6ff2('0x5b')]);return db['Disposition'][_0x6ff2('0x20')]({'where':_0x2fe7a4[_0x6ff2('0x41')]})[_0x6ff2('0x29')](function(_0x471d0d){_0x492086[_0x6ff2('0x20')]=_0x471d0d;if(_0x1944cd[_0x6ff2('0x38')]['includeAll']){_0x2fe7a4[_0x6ff2('0x46')]=[{'all':!![]}];}return db[_0x6ff2('0x58')][_0x6ff2('0x47')](_0x2fe7a4);})[_0x6ff2('0x29')](function(_0x295b12){_0x492086['rows']=_0x295b12;return _0x492086;});}})[_0x6ff2('0x29')](respondWithFilteredResult(_0x105cfc,_0x2fe7a4))[_0x6ff2('0x52')](handleError(_0x105cfc,null));};exports['removeDispositions']=function(_0x460e4b,_0x34a75f,_0x2ae490){return db['CmList'][_0x6ff2('0x4f')]({'where':{'id':_0x460e4b[_0x6ff2('0x49')]['id']}})[_0x6ff2('0x29')](handleEntityNotFound(_0x34a75f,null))['then'](function(_0x3015ec){if(_0x3015ec){return _0x3015ec['removeDispositions'](_0x460e4b['query'][_0x6ff2('0x5c')]);}})[_0x6ff2('0x29')](respondWithStatusCode(_0x34a75f,null))[_0x6ff2('0x52')](handleError(_0x34a75f,null));};exports['addContacts']=function(_0x28242b,_0xd2f935,_0x2f5894){return db[_0x6ff2('0x32')]['find']({'where':{'id':_0x28242b['params']['id']}})[_0x6ff2('0x29')](handleEntityNotFound(_0xd2f935,null))[_0x6ff2('0x29')](function(_0x3fd259){if(_0x3fd259){var _0x2d300e=[];var _0x3a6c96={'success':[],'errors':[]};return db['CmContact']['describe']()['then'](function(_0xc21fa7){if(_0x28242b['body'][_0x6ff2('0x5d')]&&_['isArray'](_0x28242b[_0x6ff2('0x54')][_0x6ff2('0x5d')])){if(_0x28242b[_0x6ff2('0x54')][_0x6ff2('0x5d')][_0x6ff2('0x3d')]){_0x28242b[_0x6ff2('0x54')][_0x6ff2('0x5d')]=_0x28242b['body'][_0x6ff2('0x5d')][_0x6ff2('0x5e')](';')+';';}else{_0x28242b[_0x6ff2('0x54')][_0x6ff2('0x5d')]=null;}}else{_0x28242b[_0x6ff2('0x54')]['tags']=null;}if(_0x28242b[_0x6ff2('0x54')]&&_['isArray'](_0x28242b['body'])){for(var _0x4eafb2=0x0;_0x4eafb2<_0x28242b['body']['length'];_0x4eafb2+=0x1){_0x28242b[_0x6ff2('0x54')][_0x4eafb2][_0x6ff2('0x57')]=_0x28242b[_0x6ff2('0x49')]['id'];_0x2d300e[_0x6ff2('0x5f')](_0x28242b[_0x6ff2('0x54')][_0x4eafb2]);}return BPromise[_0x6ff2('0x60')](_0x2d300e,function(_0x2f8882){return db[_0x6ff2('0x61')][_0x6ff2('0x4b')](_[_0x6ff2('0x62')](_0x2f8882,[_0x6ff2('0x5c'),'id'])||{},{'fields':_[_0x6ff2('0x37')](_0xc21fa7),'raw':!![]})[_0x6ff2('0x29')](function(_0x1c93e3){_0x3a6c96[_0x6ff2('0x63')]['push'](_0x1c93e3[_0x6ff2('0x64')]);})[_0x6ff2('0x52')](function(_0x4c1a08){_0x3a6c96[_0x6ff2('0x65')][_0x6ff2('0x5f')]({'data':_0x2f8882,'error':_0x4c1a08[_0x6ff2('0x66')]});});})['then'](function(_0x26c5d7){return _0x3a6c96;})['catch'](function(_0x1cb9cd){return _0x1cb9cd;});}else{_0xd2f935[_0x6ff2('0x1e')](0x190)[_0x6ff2('0x1f')]({'message':_0x6ff2('0x67')});}});}})[_0x6ff2('0x29')](respondWithResult(_0xd2f935,null))['catch'](handleError(_0xd2f935,null));};exports[_0x6ff2('0x68')]=function(_0x15a19c,_0x46d83c,_0xaa0822){var _0x407518;return db[_0x6ff2('0x32')][_0x6ff2('0x4f')]({'where':{'id':_0x15a19c[_0x6ff2('0x49')]['id']},'include':[{'model':db[_0x6ff2('0x69')],'as':'CustomFields'}]})[_0x6ff2('0x29')](handleEntityNotFound(_0x46d83c,null))[_0x6ff2('0x29')](function(_0x2d30cd){if(_0x2d30cd){_0x407518=_0x2d30cd;return db[_0x6ff2('0x61')][_0x6ff2('0x33')];}})[_0x6ff2('0x29')](function(_0x24274c){if(_0x24274c){var _0xbec059={};var _0x4a2911={};_0x4a2911[_0x6ff2('0x3a')]=_[_0x6ff2('0x6a')](_[_0x6ff2('0x37')](_0x24274c),_['map'](_0x407518[_0x6ff2('0x6b')],function(_0x4ac468){return util['format'](_0x6ff2('0x6c'),_0x4ac468['id']);}));_0x4a2911[_0x6ff2('0x38')]=_['keys'](_0x15a19c[_0x6ff2('0x38')]);_0x4a2911['filters']=_['intersection'](_0x4a2911[_0x6ff2('0x3a')],_0x4a2911[_0x6ff2('0x38')]);_0xbec059[_0x6ff2('0x3b')]=_['intersection'](_0x4a2911[_0x6ff2('0x3a')],qs[_0x6ff2('0x3c')](_0x15a19c['query'][_0x6ff2('0x3c')]));_0xbec059[_0x6ff2('0x3b')]=_0xbec059[_0x6ff2('0x3b')][_0x6ff2('0x3d')]?_0xbec059[_0x6ff2('0x3b')]:_0x4a2911[_0x6ff2('0x3a')];if(!_0x15a19c[_0x6ff2('0x38')][_0x6ff2('0x3e')]('nolimit')){_0xbec059['limit']=qs['limit'](_0x15a19c['query'][_0x6ff2('0x22')]);_0xbec059['offset']=qs[_0x6ff2('0x21')](_0x15a19c['query'][_0x6ff2('0x21')]);}_0xbec059[_0x6ff2('0x6d')]=qs[_0x6ff2('0x40')](_0x15a19c[_0x6ff2('0x38')]['sort']);_0xbec059[_0x6ff2('0x41')]=qs[_0x6ff2('0x42')](_[_0x6ff2('0x43')](_0x15a19c[_0x6ff2('0x38')],_0x4a2911[_0x6ff2('0x42')]));_0xbec059[_0x6ff2('0x6e')]=!![];if(_0x15a19c[_0x6ff2('0x38')]['filter']){_0xbec059[_0x6ff2('0x41')]=_[_0x6ff2('0x4a')](_0xbec059[_0x6ff2('0x41')],{'$or':_['map'](_0xbec059['attributes'],function(_0x3804b8){var _0x293310={};_0x293310[_0x3804b8]={'$like':'%'+_0x15a19c[_0x6ff2('0x38')][_0x6ff2('0x44')]+'%'};return _0x293310;})});}_0xbec059=_['merge']({},_0xbec059,_0x15a19c[_0x6ff2('0x5b')]);return _0x407518['getContacts'](_0xbec059);}})[_0x6ff2('0x29')](respondWithResult(_0x46d83c,null))['catch'](handleError(_0x46d83c,null));};exports['getContactsCsv']=function(_0x586791,_0x1aac01,_0x3cb449){var _0x18b541;return db[_0x6ff2('0x32')]['find']({'where':{'id':_0x586791[_0x6ff2('0x49')]['id']},'include':[{'model':db[_0x6ff2('0x69')],'as':_0x6ff2('0x6b')}]})['then'](handleEntityNotFound(_0x1aac01,null))['then'](function(_0x419e55){if(_0x419e55){_0x18b541=_0x419e55;return db[_0x6ff2('0x61')]['rawAttributes'];}})['then'](function(_0x7dc66d){if(_0x7dc66d){var _0x175b6f={};var _0x51ab92={};_0x51ab92['model']=_[_0x6ff2('0x6a')](_[_0x6ff2('0x37')](_0x7dc66d),_[_0x6ff2('0x31')](_0x18b541['CustomFields'],function(_0x4008d7){return util[_0x6ff2('0x6f')](_0x6ff2('0x6c'),_0x4008d7['id']);}));_0x51ab92[_0x6ff2('0x38')]=_[_0x6ff2('0x37')](_0x586791[_0x6ff2('0x38')]);_0x51ab92['filters']=_[_0x6ff2('0x39')](_0x51ab92[_0x6ff2('0x3a')],_0x51ab92[_0x6ff2('0x38')]);_0x175b6f[_0x6ff2('0x3b')]=_[_0x6ff2('0x39')](_0x51ab92['model'],qs['fields'](_0x586791[_0x6ff2('0x38')][_0x6ff2('0x3c')]));_0x175b6f[_0x6ff2('0x3b')]=_0x175b6f[_0x6ff2('0x3b')][_0x6ff2('0x3d')]?_0x175b6f[_0x6ff2('0x3b')]:_0x51ab92['model'];if(!_0x586791[_0x6ff2('0x38')]['hasOwnProperty']('nolimit')){_0x175b6f[_0x6ff2('0x22')]=qs[_0x6ff2('0x22')](_0x586791[_0x6ff2('0x38')][_0x6ff2('0x22')]);_0x175b6f[_0x6ff2('0x21')]=qs[_0x6ff2('0x21')](_0x586791[_0x6ff2('0x38')][_0x6ff2('0x21')]);}_0x175b6f[_0x6ff2('0x6d')]=qs[_0x6ff2('0x40')](_0x586791['query'][_0x6ff2('0x40')]);_0x175b6f[_0x6ff2('0x41')]=qs[_0x6ff2('0x42')](_['pick'](_0x586791[_0x6ff2('0x38')],_0x51ab92['filters']));_0x175b6f[_0x6ff2('0x6e')]=!![];if(_0x586791[_0x6ff2('0x38')][_0x6ff2('0x44')]){_0x175b6f[_0x6ff2('0x41')]=_[_0x6ff2('0x4a')](_0x175b6f[_0x6ff2('0x41')],{'$or':_[_0x6ff2('0x31')](_0x175b6f[_0x6ff2('0x3b')],function(_0x1f9fb1){var _0x4bbdbe={};_0x4bbdbe[_0x1f9fb1]={'$like':'%'+_0x586791[_0x6ff2('0x38')][_0x6ff2('0x44')]+'%'};return _0x4bbdbe;})});}_0x175b6f=_[_0x6ff2('0x4a')]({},_0x175b6f,_0x586791[_0x6ff2('0x5b')]);return _0x18b541[_0x6ff2('0x68')](_0x175b6f);}})[_0x6ff2('0x29')](function(_0x46c046){if(!_[_0x6ff2('0x70')](_0x46c046)){var _0x430c9f=toCsv(_0x46c046);var _0x277eb3=Date['now']();fs[_0x6ff2('0x71')](util['format'](_0x6ff2('0x72'),_0x18b541['id'],_0x277eb3),_0x430c9f);_0x1aac01[_0x6ff2('0x73')](_0x6ff2('0x74'),_0x6ff2('0x75')+util[_0x6ff2('0x6f')](_0x6ff2('0x76'),_0x18b541['id'],_0x277eb3));_0x1aac01[_0x6ff2('0x73')](_0x6ff2('0x77'),_0x6ff2('0x78'));return _0x1aac01['download'](util[_0x6ff2('0x6f')](_0x6ff2('0x72'),_0x18b541['id'],_0x277eb3));}else{return _0x1aac01[_0x6ff2('0x1c')](0xcc);}})[_0x6ff2('0x52')](handleError(_0x1aac01,null));};exports[_0x6ff2('0x79')]=function(_0x2e6b55,_0x318e72,_0x1e5589){var _0x140a76;delete _0x2e6b55[_0x6ff2('0x54')]['id'];return db[_0x6ff2('0x32')][_0x6ff2('0x5a')]({'where':{'id':_0x2e6b55[_0x6ff2('0x49')]['id']}})['then'](handleEntityNotFound(_0x318e72,null))[_0x6ff2('0x29')](function(_0x47323f){if(_0x47323f){return db[_0x6ff2('0x7a')][_0x6ff2('0x7b')](function(_0x48db42){return db[_0x6ff2('0x69')]['create'](_0x2e6b55[_0x6ff2('0x54')],{'transaction':_0x48db42})[_0x6ff2('0x29')](function(_0x111c35){_0x140a76=_0x111c35;return _0x47323f[_0x6ff2('0x7c')](_0x111c35,{'transaction':_0x48db42});})['then'](function(){var _0x348b73={'type':db['Sequelize'][_0x6ff2('0x7d')],'transaction':_0x48db42};switch(_0x2e6b55[_0x6ff2('0x54')][_0x6ff2('0x35')]){case _0x6ff2('0x7e'):_0x348b73[_0x6ff2('0x35')]=db[_0x6ff2('0x7f')][_0x6ff2('0x7d')];break;case _0x6ff2('0x80'):_0x348b73['type']=db[_0x6ff2('0x7f')][_0x6ff2('0x81')];break;case _0x6ff2('0x82'):_0x348b73[_0x6ff2('0x35')]=db['Sequelize'][_0x6ff2('0x83')];_0x348b73['defaultValue']=![];break;default:}return db[_0x6ff2('0x7a')][_0x6ff2('0x84')][_0x6ff2('0x85')](_0x6ff2('0x86'),util[_0x6ff2('0x6f')](_0x6ff2('0x87'),_0x140a76['id']),_0x348b73);})[_0x6ff2('0x29')](function(){return _0x140a76;});});}})[_0x6ff2('0x29')](respondWithResult(_0x318e72,null))[_0x6ff2('0x52')](handleError(_0x318e72,null));};exports[_0x6ff2('0x88')]=function(_0x3c6e26,_0x28f710,_0x4cd30a){var _0x2d3502={};var _0x16a6b4={};var _0x46138d;var _0x1105a5;return db['CmList'][_0x6ff2('0x5a')]({'where':{'id':_0x3c6e26[_0x6ff2('0x49')]['id']}})[_0x6ff2('0x29')](handleEntityNotFound(_0x28f710,null))[_0x6ff2('0x29')](function(_0x2c0015){if(_0x2c0015){_0x46138d=_0x2c0015;_0x16a6b4['model']=_[_0x6ff2('0x37')](db[_0x6ff2('0x69')][_0x6ff2('0x33')]);_0x16a6b4[_0x6ff2('0x38')]=_[_0x6ff2('0x37')](_0x3c6e26[_0x6ff2('0x38')]);_0x16a6b4[_0x6ff2('0x42')]=_[_0x6ff2('0x39')](_0x16a6b4[_0x6ff2('0x3a')],_0x16a6b4[_0x6ff2('0x38')]);_0x2d3502[_0x6ff2('0x3b')]=_[_0x6ff2('0x39')](_0x16a6b4['model'],qs['fields'](_0x3c6e26['query']['fields']));_0x2d3502[_0x6ff2('0x3b')]=_0x2d3502[_0x6ff2('0x3b')][_0x6ff2('0x3d')]?_0x2d3502[_0x6ff2('0x3b')]:_0x16a6b4['model'];_0x2d3502[_0x6ff2('0x6d')]=qs[_0x6ff2('0x40')](_0x3c6e26['query'][_0x6ff2('0x40')]);_0x2d3502[_0x6ff2('0x41')]=qs[_0x6ff2('0x42')](_[_0x6ff2('0x43')](_0x3c6e26['query'],_0x16a6b4[_0x6ff2('0x42')]));_0x2d3502['where']=_[_0x6ff2('0x4a')](_0x2d3502['where'],{'$or':[{'ListId':_0x2c0015['id']},{'ListId':null}]});if(_0x3c6e26[_0x6ff2('0x38')][_0x6ff2('0x44')]){_0x2d3502[_0x6ff2('0x41')]=_[_0x6ff2('0x4a')](_0x2d3502[_0x6ff2('0x41')],{'$or':_[_0x6ff2('0x31')](_0x2d3502[_0x6ff2('0x3b')],function(_0x5848b5){var _0x505f21={};_0x505f21[_0x5848b5]={'$like':'%'+_0x3c6e26['query'][_0x6ff2('0x44')]+'%'};return _0x505f21;})});}_0x2d3502=_[_0x6ff2('0x4a')]({},_0x2d3502,_0x3c6e26['options']);return db[_0x6ff2('0x69')][_0x6ff2('0x89')](_0x2d3502);}})['then'](respondWithResult(_0x28f710,null))[_0x6ff2('0x52')](handleError(_0x28f710,null));};exports[_0x6ff2('0x8a')]=function(_0x51c037,_0x4c39f3,_0x1ae6f1){return db['CmList'][_0x6ff2('0x4f')]({'where':{'id':_0x51c037[_0x6ff2('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c39f3,null))[_0x6ff2('0x29')](function(_0x33aa99){if(_0x33aa99){return _0x33aa99[_0x6ff2('0x8a')](_0x51c037[_0x6ff2('0x54')]['ids'],_[_0x6ff2('0x62')](_0x51c037[_0x6ff2('0x54')],[_0x6ff2('0x5c'),'id'])||{})[_0x6ff2('0x8b')](function(_0x2dd9d6){for(var _0x27d9ff=0x0;_0x27d9ff<_0x51c037['body'][_0x6ff2('0x5c')][_0x6ff2('0x3d')];_0x27d9ff+=0x1){socket[_0x6ff2('0x8c')](_0x6ff2('0x8d'),{'UserId':_0x51c037[_0x6ff2('0x54')]['ids'][_0x27d9ff],'CmListId':_0x51c037['params']['id']});}return _0x2dd9d6;});}})[_0x6ff2('0x29')](respondWithResult(_0x4c39f3,null))['catch'](handleError(_0x4c39f3,null));};exports[_0x6ff2('0x8e')]=function(_0x235f61,_0xd78186,_0x4240c6){return db['CmList'][_0x6ff2('0x4f')]({'where':{'id':_0x235f61[_0x6ff2('0x49')]['id']}})[_0x6ff2('0x29')](handleEntityNotFound(_0xd78186,null))[_0x6ff2('0x29')](function(_0x18f002){if(_0x18f002){return _0x18f002[_0x6ff2('0x8e')](_0x235f61[_0x6ff2('0x38')][_0x6ff2('0x5c')])[_0x6ff2('0x29')](function(){if(_[_0x6ff2('0x8f')](_0x235f61[_0x6ff2('0x38')][_0x6ff2('0x5c')])){for(var _0x33ad16=0x0;_0x33ad16<_0x235f61[_0x6ff2('0x38')][_0x6ff2('0x5c')]['length'];_0x33ad16+=0x1){socket[_0x6ff2('0x8c')](_0x6ff2('0x90'),{'UserId':Number(_0x235f61['query'][_0x6ff2('0x5c')][_0x33ad16]),'CmListId':Number(_0x235f61['params']['id'])});}}else{socket[_0x6ff2('0x8c')](_0x6ff2('0x90'),{'UserId':Number(_0x235f61['query'][_0x6ff2('0x5c')]),'CmListId':Number(_0x235f61[_0x6ff2('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0xd78186,null))[_0x6ff2('0x52')](handleError(_0xd78186,null));};exports[_0x6ff2('0x91')]=function(_0x4ffce2,_0x4a59a9,_0x4a24e5){var _0x458237={};var _0x250ab0={};var _0x2dc0e9;var _0x3c5401;return db['CmList'][_0x6ff2('0x5a')]({'where':{'id':_0x4ffce2[_0x6ff2('0x49')]['id']}})[_0x6ff2('0x29')](handleEntityNotFound(_0x4a59a9,null))['then'](function(_0x4a0c34){if(_0x4a0c34){_0x2dc0e9=_0x4a0c34;_0x250ab0[_0x6ff2('0x3a')]=_[_0x6ff2('0x37')](db[_0x6ff2('0x92')][_0x6ff2('0x33')]);_0x250ab0[_0x6ff2('0x38')]=_[_0x6ff2('0x37')](_0x4ffce2[_0x6ff2('0x38')]);_0x250ab0[_0x6ff2('0x42')]=_[_0x6ff2('0x39')](_0x250ab0['model'],_0x250ab0[_0x6ff2('0x38')]);_0x458237[_0x6ff2('0x3b')]=_[_0x6ff2('0x39')](_0x250ab0[_0x6ff2('0x3a')],qs[_0x6ff2('0x3c')](_0x4ffce2[_0x6ff2('0x38')][_0x6ff2('0x3c')]));_0x458237[_0x6ff2('0x3b')]=_0x458237[_0x6ff2('0x3b')][_0x6ff2('0x3d')]?_0x458237[_0x6ff2('0x3b')]:_0x250ab0[_0x6ff2('0x3a')];_0x458237[_0x6ff2('0x6d')]=qs[_0x6ff2('0x40')](_0x4ffce2['query'][_0x6ff2('0x40')]);_0x458237[_0x6ff2('0x41')]=qs['filters'](_[_0x6ff2('0x43')](_0x4ffce2[_0x6ff2('0x38')],_0x250ab0[_0x6ff2('0x42')]));if(_0x4ffce2[_0x6ff2('0x38')][_0x6ff2('0x44')]){_0x458237['where']=_[_0x6ff2('0x4a')](_0x458237[_0x6ff2('0x41')],{'$or':_[_0x6ff2('0x31')](_0x458237[_0x6ff2('0x3b')],function(_0x27b954){var _0x54da87={};_0x54da87[_0x27b954]={'$like':'%'+_0x4ffce2['query'][_0x6ff2('0x44')]+'%'};return _0x54da87;})});}_0x458237=_[_0x6ff2('0x4a')]({},_0x458237,_0x4ffce2[_0x6ff2('0x5b')]);return _0x2dc0e9['getAgents'](_0x458237);}})['then'](function(_0x402caa){if(_0x402caa){_0x3c5401=_0x402caa[_0x6ff2('0x3d')];if(!_0x4ffce2[_0x6ff2('0x38')][_0x6ff2('0x3e')]('nolimit')){_0x458237[_0x6ff2('0x22')]=qs[_0x6ff2('0x22')](_0x4ffce2[_0x6ff2('0x38')]['limit']);_0x458237[_0x6ff2('0x21')]=qs[_0x6ff2('0x21')](_0x4ffce2[_0x6ff2('0x38')]['offset']);}return _0x2dc0e9['getAgents'](_0x458237);}})['then'](function(_0x16172b){if(_0x16172b){return _0x16172b?{'count':_0x3c5401,'rows':_0x16172b}:null;}})[_0x6ff2('0x29')](respondWithResult(_0x4a59a9,null))['catch'](handleError(_0x4a59a9,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index ff74874..3ff4dc8 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 _0x2673=['events','../../mysqldb','CmList','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x2673,0x154));var _0x3267=function(_0x260d17,_0x41db16){_0x260d17=_0x260d17-0x0;var _0x11dc8d=_0x2673[_0x260d17];return _0x11dc8d;};'use strict';var EventEmitter=require(_0x3267('0x0'));var CmList=require(_0x3267('0x1'))['db'][_0x3267('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x3267('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3267('0x4'),'afterDestroy':_0x3267('0x5')};function emitEvent(_0x5ea4a4){return function(_0x8d2989,_0x3bdcb9,_0x290afa){CmListEvents[_0x3267('0x6')](_0x5ea4a4+':'+_0x8d2989['id'],_0x8d2989);CmListEvents[_0x3267('0x6')](_0x5ea4a4,_0x8d2989);_0x290afa(null);};}for(var e in events){if(events[_0x3267('0x7')](e)){var event=events[e];CmList[_0x3267('0x8')](e,emitEvent(event));}}module[_0x3267('0x9')]=CmListEvents; \ No newline at end of file +var _0x45fd=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x45fd,0x133));var _0xd45f=function(_0x4527d3,_0x3506f0){_0x4527d3=_0x4527d3-0x0;var _0x2b0a7b=_0x45fd[_0x4527d3];return _0x2b0a7b;};'use strict';var EventEmitter=require(_0xd45f('0x0'));var CmList=require(_0xd45f('0x1'))['db'][_0xd45f('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xd45f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd45f('0x4'),'afterDestroy':_0xd45f('0x5')};function emitEvent(_0x132020){return function(_0x2e970f,_0x2f4966,_0x3bca0f){CmListEvents[_0xd45f('0x6')](_0x132020+':'+_0x2e970f['id'],_0x2e970f);CmListEvents[_0xd45f('0x6')](_0x132020,_0x2e970f);_0x3bca0f(null);};}for(var e in events){if(events[_0xd45f('0x7')](e)){var event=events[e];CmList[_0xd45f('0x8')](e,emitEvent(event));}}module[_0xd45f('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index e414fa6..e5a5cf4 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 _0xc04c=['../../config/environment','exports','CmList','cm_lists','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xc04c,0x9e));var _0xcc04=function(_0x5a96a6,_0x561b6b){_0x5a96a6=_0x5a96a6-0x0;var _0x660444=_0xc04c[_0x5a96a6];return _0x660444;};'use strict';var _=require(_0xcc04('0x0'));var util=require(_0xcc04('0x1'));var logger=require(_0xcc04('0x2'))(_0xcc04('0x3'));var moment=require('moment');var BPromise=require(_0xcc04('0x4'));var rp=require(_0xcc04('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc04('0x6'));var config=require(_0xcc04('0x7'));var attributes=require('./cmList.attributes');module[_0xcc04('0x8')]=function(_0x458e55,_0x94d89d){return _0x458e55['define'](_0xcc04('0x9'),attributes,{'tableName':_0xcc04('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x796f=['request-promise','path','../../config/environment','./cmList.attributes','exports','define','lodash','util','moment','bluebird'];(function(_0x2201cd,_0x36af98){var _0x239e5e=function(_0x28863b){while(--_0x28863b){_0x2201cd['push'](_0x2201cd['shift']());}};_0x239e5e(++_0x36af98);}(_0x796f,0x1a0));var _0xf796=function(_0x40cacb,_0x2d291f){_0x40cacb=_0x40cacb-0x0;var _0x57491f=_0x796f[_0x40cacb];return _0x57491f;};'use strict';var _=require(_0xf796('0x0'));var util=require(_0xf796('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf796('0x2'));var BPromise=require(_0xf796('0x3'));var rp=require(_0xf796('0x4'));var fs=require('fs');var path=require(_0xf796('0x5'));var rimraf=require('rimraf');var config=require(_0xf796('0x6'));var attributes=require(_0xf796('0x7'));module[_0xf796('0x8')]=function(_0x29745b,_0x55958f){return _0x29745b[_0xf796('0x9')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 4ce4146..9044037 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 _0x4ae8=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2255fc,_0x5f0fd4){var _0x4bf8cd=function(_0x15f737){while(--_0x15f737){_0x2255fc['push'](_0x2255fc['shift']());}};_0x4bf8cd(++_0x5f0fd4);}(_0x4ae8,0x18d));var _0x84ae=function(_0x97378f,_0x796da5){_0x97378f=_0x97378f-0x0;var _0x1804d9=_0x4ae8[_0x97378f];return _0x1804d9;};'use strict';var _=require(_0x84ae('0x0'));var util=require(_0x84ae('0x1'));var moment=require('moment');var BPromise=require(_0x84ae('0x2'));var rs=require(_0x84ae('0x3'));var fs=require('fs');var Redis=require(_0x84ae('0x4'));var db=require(_0x84ae('0x5'))['db'];var utils=require(_0x84ae('0x6'));var logger=require(_0x84ae('0x7'))(_0x84ae('0x8'));var config=require(_0x84ae('0x9'));var jayson=require(_0x84ae('0xa'));var client=jayson[_0x84ae('0xb')][_0x84ae('0xc')]({'port':0x232a});config[_0x84ae('0xd')]=_[_0x84ae('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x84ae('0xf'))(new Redis(config[_0x84ae('0xd')]));require(_0x84ae('0x10'))['register'](socket);function respondWithRpcPromise(_0x3853e2,_0x46bf64,_0x2ed2be){return new BPromise(function(_0x2280df,_0x4012ef){return client['request'](_0x3853e2,_0x2ed2be)[_0x84ae('0x11')](function(_0x1b1626){logger[_0x84ae('0x12')](_0x84ae('0x13'),_0x46bf64,'request\x20sent');logger[_0x84ae('0x14')](_0x84ae('0x15'),_0x46bf64,_0x84ae('0x16'),JSON['stringify'](_0x1b1626));if(_0x1b1626[_0x84ae('0x17')]){if(_0x1b1626[_0x84ae('0x17')][_0x84ae('0x18')]===0x1f4){logger[_0x84ae('0x17')](_0x84ae('0x13'),_0x46bf64,_0x1b1626[_0x84ae('0x17')][_0x84ae('0x19')]);return _0x4012ef(_0x1b1626[_0x84ae('0x17')][_0x84ae('0x19')]);}logger['error']('CmList,\x20%s,\x20%s',_0x46bf64,_0x1b1626[_0x84ae('0x17')]['message']);return _0x2280df(_0x1b1626[_0x84ae('0x17')][_0x84ae('0x19')]);}else{logger[_0x84ae('0x12')](_0x84ae('0x13'),_0x46bf64,_0x84ae('0x16'));_0x2280df(_0x1b1626['result'][_0x84ae('0x19')]);}})[_0x84ae('0x1a')](function(_0x19059b){logger[_0x84ae('0x17')]('CmList,\x20%s,\x20%s',_0x46bf64,_0x19059b);_0x4012ef(_0x19059b);});});} \ No newline at end of file +var _0xf75a=['../../config/environment','client','http','redis','defaults','./cmList.socket','register','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xf75a,0x1c9));var _0xaf75=function(_0x34f456,_0x271849){_0x34f456=_0x34f456-0x0;var _0x589f55=_0xf75a[_0x34f456];return _0x589f55;};'use strict';var _=require(_0xaf75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaf75('0x1'));var fs=require('fs');var Redis=require(_0xaf75('0x2'));var db=require(_0xaf75('0x3'))['db'];var utils=require(_0xaf75('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xaf75('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xaf75('0x6')][_0xaf75('0x7')]({'port':0x232a});config[_0xaf75('0x8')]=_[_0xaf75('0x9')](config[_0xaf75('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaf75('0xa'))[_0xaf75('0xb')](socket);function respondWithRpcPromise(_0x3d7b8a,_0xa430eb,_0x3f289d){return new BPromise(function(_0x3cf542,_0xc810db){return client['request'](_0x3d7b8a,_0x3f289d)['then'](function(_0x58581e){logger[_0xaf75('0xc')](_0xaf75('0xd'),_0xa430eb,_0xaf75('0xe'));logger[_0xaf75('0xf')]('CmList,\x20%s,\x20%s,\x20%s',_0xa430eb,_0xaf75('0xe'),JSON[_0xaf75('0x10')](_0x58581e));if(_0x58581e[_0xaf75('0x11')]){if(_0x58581e[_0xaf75('0x11')][_0xaf75('0x12')]===0x1f4){logger[_0xaf75('0x11')](_0xaf75('0xd'),_0xa430eb,_0x58581e[_0xaf75('0x11')]['message']);return _0xc810db(_0x58581e[_0xaf75('0x11')][_0xaf75('0x13')]);}logger[_0xaf75('0x11')](_0xaf75('0xd'),_0xa430eb,_0x58581e['error']['message']);return _0x3cf542(_0x58581e[_0xaf75('0x11')][_0xaf75('0x13')]);}else{logger[_0xaf75('0xc')](_0xaf75('0xd'),_0xa430eb,_0xaf75('0xe'));_0x3cf542(_0x58581e[_0xaf75('0x14')]['message']);}})['catch'](function(_0x59821b){logger[_0xaf75('0x11')](_0xaf75('0xd'),_0xa430eb,_0x59821b);_0xc810db(_0x59821b);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 06139e3..9d0bbd3 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 _0x68f5=['register','cmList:','./cmList.events','save','remove','emit','removeListener'];(function(_0xe9b57d,_0x4ab7fb){var _0xd37548=function(_0x4b5a80){while(--_0x4b5a80){_0xe9b57d['push'](_0xe9b57d['shift']());}};_0xd37548(++_0x4ab7fb);}(_0x68f5,0x11a));var _0x568f=function(_0x7b18d3,_0x4bbfd3){_0x7b18d3=_0x7b18d3-0x0;var _0x12732c=_0x68f5[_0x7b18d3];return _0x12732c;};'use strict';var CmListEvents=require(_0x568f('0x0'));var events=[_0x568f('0x1'),_0x568f('0x2'),'update'];function createListener(_0x25a405,_0x44b6ad){return function(_0x23bd5b){_0x44b6ad[_0x568f('0x3')](_0x25a405,_0x23bd5b);};}function removeListener(_0x425217,_0x5de1c0){return function(){CmListEvents[_0x568f('0x4')](_0x425217,_0x5de1c0);};}exports[_0x568f('0x5')]=function(_0x31444b){for(var _0x3181fd=0x0,_0x4ca62c=events['length'];_0x3181fd<_0x4ca62c;_0x3181fd++){var _0x953f02=events[_0x3181fd];var _0x3568a0=createListener(_0x568f('0x6')+_0x953f02,_0x31444b);CmListEvents['on'](_0x953f02,_0x3568a0);}}; \ No newline at end of file +var _0x869e=['remove','emit','removeListener','register','cmList:','./cmList.events','save'];(function(_0x25e214,_0x42a13e){var _0x48ca06=function(_0x34c6ca){while(--_0x34c6ca){_0x25e214['push'](_0x25e214['shift']());}};_0x48ca06(++_0x42a13e);}(_0x869e,0x15c));var _0xe869=function(_0x1086ab,_0x1b8c5b){_0x1086ab=_0x1086ab-0x0;var _0x3472ee=_0x869e[_0x1086ab];return _0x3472ee;};'use strict';var CmListEvents=require(_0xe869('0x0'));var events=[_0xe869('0x1'),_0xe869('0x2'),'update'];function createListener(_0x1984e4,_0x14dd86){return function(_0xb2e42a){_0x14dd86[_0xe869('0x3')](_0x1984e4,_0xb2e42a);};}function removeListener(_0x39fee6,_0x597771){return function(){CmListEvents[_0xe869('0x4')](_0x39fee6,_0x597771);};}exports[_0xe869('0x5')]=function(_0x26a223){for(var _0x26afde=0x0,_0x587ead=events['length'];_0x26afde<_0x587ead;_0x26afde++){var _0xb3936=events[_0x26afde];var _0x296feb=createListener(_0xe869('0x6')+_0xb3936,_0x26a223);CmListEvents['on'](_0xb3936,_0x296feb);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 6173d25..50e53ad 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 _0x6f7a=['addContacts','addCustomField','addAgents','put','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x6f7a,0xe2));var _0xa6f7=function(_0x5ea92f,_0x5105be){_0x5ea92f=_0x5ea92f-0x0;var _0x220eb8=_0x6f7a[_0x5ea92f];return _0x220eb8;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa6f7('0x2'));var router=express[_0xa6f7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa6f7('0x4'));var config=require(_0xa6f7('0x5'));var controller=require(_0xa6f7('0x6'));router[_0xa6f7('0x7')]('/',auth['isAuthenticated'](),controller[_0xa6f7('0x8')]);router[_0xa6f7('0x7')](_0xa6f7('0x9'),auth[_0xa6f7('0xa')](),controller[_0xa6f7('0xb')]);router['get'](_0xa6f7('0xc'),auth[_0xa6f7('0xa')](),controller[_0xa6f7('0xd')]);router[_0xa6f7('0x7')](_0xa6f7('0xe'),auth[_0xa6f7('0xa')](),controller[_0xa6f7('0xf')]);router[_0xa6f7('0x7')](_0xa6f7('0x10'),auth['isAuthenticated'](),controller[_0xa6f7('0x11')]);router[_0xa6f7('0x7')](_0xa6f7('0x12'),auth[_0xa6f7('0xa')](),controller[_0xa6f7('0x13')]);router['get'](_0xa6f7('0x14'),auth[_0xa6f7('0xa')](),controller[_0xa6f7('0x15')]);router['get'](_0xa6f7('0x16'),auth[_0xa6f7('0xa')](),controller[_0xa6f7('0x17')]);router[_0xa6f7('0x18')]('/',auth[_0xa6f7('0xa')](),controller[_0xa6f7('0x19')]);router[_0xa6f7('0x18')](_0xa6f7('0xe'),auth[_0xa6f7('0xa')](),controller['addDisposition']);router[_0xa6f7('0x18')](_0xa6f7('0x10'),auth[_0xa6f7('0xa')](),controller[_0xa6f7('0x1a')]);router[_0xa6f7('0x18')](_0xa6f7('0x14'),auth[_0xa6f7('0xa')](),controller[_0xa6f7('0x1b')]);router[_0xa6f7('0x18')](_0xa6f7('0x16'),auth[_0xa6f7('0xa')](),controller[_0xa6f7('0x1c')]);router[_0xa6f7('0x1d')]('/:id',auth[_0xa6f7('0xa')](),controller[_0xa6f7('0x1e')]);router['delete'](_0xa6f7('0xc'),auth['isAuthenticated'](),controller[_0xa6f7('0x1f')]);router[_0xa6f7('0x20')](_0xa6f7('0xe'),auth[_0xa6f7('0xa')](),controller[_0xa6f7('0x21')]);router['delete'](_0xa6f7('0x16'),auth[_0xa6f7('0xa')](),controller[_0xa6f7('0x22')]);module[_0xa6f7('0x23')]=router; \ No newline at end of file +var _0x0235=['addAgents','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./cmList.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getCustomFields','getAgents','post','addContacts','addCustomField','/:id/users'];(function(_0x42a4e4,_0x52a6a0){var _0x5daedb=function(_0x322112){while(--_0x322112){_0x42a4e4['push'](_0x42a4e4['shift']());}};_0x5daedb(++_0x52a6a0);}(_0x0235,0x11c));var _0x5023=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0235[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x5023('0x0'));var util=require(_0x5023('0x1'));var path=require(_0x5023('0x2'));var timeout=require(_0x5023('0x3'));var express=require('express');var router=express[_0x5023('0x4')]();var fs_extra=require(_0x5023('0x5'));var auth=require(_0x5023('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5023('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5023('0x8')]);router[_0x5023('0x9')](_0x5023('0xa'),auth[_0x5023('0xb')](),controller[_0x5023('0xc')]);router[_0x5023('0x9')](_0x5023('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x5023('0x9')](_0x5023('0xe'),auth['isAuthenticated'](),controller[_0x5023('0xf')]);router[_0x5023('0x9')](_0x5023('0x10'),auth[_0x5023('0xb')](),controller[_0x5023('0x11')]);router['get']('/:id/contacts/csv',auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x5023('0x9')]('/:id/fields',auth[_0x5023('0xb')](),controller[_0x5023('0x12')]);router[_0x5023('0x9')]('/:id/users',auth[_0x5023('0xb')](),controller[_0x5023('0x13')]);router[_0x5023('0x14')]('/',auth[_0x5023('0xb')](),controller['create']);router[_0x5023('0x14')](_0x5023('0xe'),auth[_0x5023('0xb')](),controller['addDisposition']);router[_0x5023('0x14')]('/:id/contacts',auth[_0x5023('0xb')](),controller[_0x5023('0x15')]);router[_0x5023('0x14')]('/:id/fields',auth[_0x5023('0xb')](),controller[_0x5023('0x16')]);router[_0x5023('0x14')](_0x5023('0x17'),auth[_0x5023('0xb')](),controller[_0x5023('0x18')]);router['put'](_0x5023('0xd'),auth[_0x5023('0xb')](),controller['update']);router['delete'](_0x5023('0xd'),auth[_0x5023('0xb')](),controller['destroy']);router[_0x5023('0x19')]('/:id/dispositions',auth[_0x5023('0xb')](),controller['removeDispositions']);router['delete'](_0x5023('0x17'),auth[_0x5023('0xb')](),controller[_0x5023('0x1a')]);module[_0x5023('0x1b')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 2b194d1..dd5a7f6 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 _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x89649,_0x1c39cb){var _0x5a7611=function(_0x3caa01){while(--_0x3caa01){_0x89649['push'](_0x89649['shift']());}};_0x5a7611(++_0x1c39cb);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x2549ba,_0x165d2c){var _0x296aee=function(_0x3fc899){while(--_0x3fc899){_0x2549ba['push'](_0x2549ba['shift']());}};_0x296aee(++_0x165d2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 7effa13..a9ab8b6 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 _0x1666=['../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','body','Condition','catch','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x1915b5,_0x488d52){var _0x3cfc87=function(_0x16fc03){while(--_0x16fc03){_0x1915b5['push'](_0x1915b5['shift']());}};_0x3cfc87(++_0x488d52);}(_0x1666,0x75));var _0x6166=function(_0x5060cc,_0x187b63){_0x5060cc=_0x5060cc-0x0;var _0x5da8e4=_0x1666[_0x5060cc];return _0x5da8e4;};'use strict';var emlformat=require(_0x6166('0x0'));var rimraf=require(_0x6166('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6166('0x2'));var rp=require(_0x6166('0x3'));var moment=require(_0x6166('0x4'));var BPromise=require(_0x6166('0x5'));var Mustache=require(_0x6166('0x6'));var util=require(_0x6166('0x7'));var path=require(_0x6166('0x8'));var sox=require(_0x6166('0x9'));var csv=require('to-csv');var ejs=require(_0x6166('0xa'));var fs=require('fs');var fs_extra=require(_0x6166('0xb'));var _=require(_0x6166('0xc'));var squel=require(_0x6166('0xd'));var crypto=require(_0x6166('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6166('0xf'));var Papa=require('papaparse');var Redis=require(_0x6166('0x10'));var authService=require(_0x6166('0x11'));var qs=require(_0x6166('0x12'));var as=require(_0x6166('0x13'));var hardwareService=require(_0x6166('0x14'));var logger=require(_0x6166('0x15'))(_0x6166('0x16'));var utils=require('../../config/utils');var config=require(_0x6166('0x17'));var licenseUtil=require(_0x6166('0x18'));var db=require(_0x6166('0x19'))['db'];function respondWithStatusCode(_0x5b2335,_0x320728){_0x320728=_0x320728||0xcc;return function(_0x2ce997){if(_0x2ce997){return _0x5b2335[_0x6166('0x1a')](_0x320728);}return _0x5b2335[_0x6166('0x1b')](_0x320728)['end']();};}function respondWithResult(_0x1316f2,_0x33789f){_0x33789f=_0x33789f||0xc8;return function(_0x42abca){if(_0x42abca){return _0x1316f2[_0x6166('0x1b')](_0x33789f)[_0x6166('0x1c')](_0x42abca);}};}function respondWithFilteredResult(_0x147874,_0x56520c){return function(_0x3d2f83){if(_0x3d2f83){var _0x12f0a5=_0x3d2f83[_0x6166('0x1d')],_0x3000de=_0x56520c[_0x6166('0x1e')],_0x4eff5c=_0x56520c['offset']+_0x56520c[_0x6166('0x1f')],_0x24bdf3;if(_0x4eff5c>=_0x12f0a5){_0x4eff5c=_0x12f0a5;_0x24bdf3=0xc8;}else{_0x24bdf3=0xce;}_0x147874[_0x6166('0x1b')](_0x24bdf3);return _0x147874[_0x6166('0x20')](_0x6166('0x21'),_0x3000de+'-'+_0x4eff5c+'/'+_0x12f0a5)[_0x6166('0x1c')](_0x3d2f83);}return null;};}function patchUpdates(_0x553701){return function(_0x1c823b){try{jsonpatch[_0x6166('0x22')](_0x1c823b,_0x553701,!![]);}catch(_0x37cfe6){return BPromise[_0x6166('0x23')](_0x37cfe6);}return _0x1c823b[_0x6166('0x24')]();};}function saveUpdates(_0x28d90c,_0x2411de){return function(_0x122552){if(_0x122552){return _0x122552[_0x6166('0x25')](_0x28d90c)[_0x6166('0x26')](function(_0x30d6e5){return _0x30d6e5;});}return null;};}function removeEntity(_0x49c474,_0x1646ff){return function(_0x438ed3){if(_0x438ed3){return _0x438ed3[_0x6166('0x27')]()[_0x6166('0x26')](function(){_0x49c474[_0x6166('0x1b')](0xcc)[_0x6166('0x28')]();});}};}function handleEntityNotFound(_0x3ffd46,_0x26d926){return function(_0x57b6b5){if(!_0x57b6b5){_0x3ffd46[_0x6166('0x1a')](0x194);}return _0x57b6b5;};}function handleError(_0x5a2e7b,_0x1a1290){_0x1a1290=_0x1a1290||0x1f4;return function(_0x10a23e){logger['error'](_0x10a23e[_0x6166('0x29')]);if(_0x10a23e[_0x6166('0x2a')]){delete _0x10a23e[_0x6166('0x2a')];}_0x5a2e7b[_0x6166('0x1b')](_0x1a1290)['send'](_0x10a23e);};}exports[_0x6166('0x25')]=function(_0xcb8172,_0x47176f){if(_0xcb8172[_0x6166('0x2b')]['id']){delete _0xcb8172[_0x6166('0x2b')]['id'];}return db[_0x6166('0x2c')]['find']({'where':{'id':_0xcb8172['params']['id']}})[_0x6166('0x26')](handleEntityNotFound(_0x47176f,null))[_0x6166('0x26')](saveUpdates(_0xcb8172[_0x6166('0x2b')],null))[_0x6166('0x26')](respondWithResult(_0x47176f,null))[_0x6166('0x2d')](handleError(_0x47176f,null));};exports[_0x6166('0x27')]=function(_0x31c324,_0x57bd9e){return db['Condition'][_0x6166('0x2e')]({'where':{'id':_0x31c324['params']['id']}})[_0x6166('0x26')](handleEntityNotFound(_0x57bd9e,null))[_0x6166('0x26')](removeEntity(_0x57bd9e,null))[_0x6166('0x2d')](handleError(_0x57bd9e,null));}; \ No newline at end of file +var _0x5c71=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','save','update','then','error','name','body','Condition','find','catch','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2495a9,_0x3826c6){var _0x541445=function(_0x209986){while(--_0x209986){_0x2495a9['push'](_0x2495a9['shift']());}};_0x541445(++_0x3826c6);}(_0x5c71,0x188));var _0x15c7=function(_0x55e4e1,_0x352a79){_0x55e4e1=_0x55e4e1-0x0;var _0x1644e8=_0x5c71[_0x55e4e1];return _0x1644e8;};'use strict';var emlformat=require(_0x15c7('0x0'));var rimraf=require(_0x15c7('0x1'));var zipdir=require(_0x15c7('0x2'));var jsonpatch=require(_0x15c7('0x3'));var rp=require(_0x15c7('0x4'));var moment=require(_0x15c7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x15c7('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x15c7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15c7('0x8'));var _=require(_0x15c7('0x9'));var squel=require(_0x15c7('0xa'));var crypto=require(_0x15c7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x15c7('0xc'));var toCsv=require(_0x15c7('0x7'));var querystring=require(_0x15c7('0xd'));var Papa=require(_0x15c7('0xe'));var Redis=require(_0x15c7('0xf'));var authService=require(_0x15c7('0x10'));var qs=require(_0x15c7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x15c7('0x12'))(_0x15c7('0x13'));var utils=require(_0x15c7('0x14'));var config=require(_0x15c7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x15c7('0x16'))['db'];function respondWithStatusCode(_0x259084,_0x1b5d94){_0x1b5d94=_0x1b5d94||0xcc;return function(_0x53d48d){if(_0x53d48d){return _0x259084[_0x15c7('0x17')](_0x1b5d94);}return _0x259084['status'](_0x1b5d94)[_0x15c7('0x18')]();};}function respondWithResult(_0x31e631,_0x25f158){_0x25f158=_0x25f158||0xc8;return function(_0x582c95){if(_0x582c95){return _0x31e631[_0x15c7('0x19')](_0x25f158)[_0x15c7('0x1a')](_0x582c95);}};}function respondWithFilteredResult(_0x24e07d,_0x181c45){return function(_0x8c7ee){if(_0x8c7ee){var _0x1f00c2=_0x8c7ee[_0x15c7('0x1b')],_0x1ddeec=_0x181c45[_0x15c7('0x1c')],_0x73f0eb=_0x181c45[_0x15c7('0x1c')]+_0x181c45['limit'],_0x4d5d76;if(_0x73f0eb>=_0x1f00c2){_0x73f0eb=_0x1f00c2;_0x4d5d76=0xc8;}else{_0x4d5d76=0xce;}_0x24e07d[_0x15c7('0x19')](_0x4d5d76);return _0x24e07d['set'](_0x15c7('0x1d'),_0x1ddeec+'-'+_0x73f0eb+'/'+_0x1f00c2)['json'](_0x8c7ee);}return null;};}function patchUpdates(_0x929516){return function(_0x2bd649){try{jsonpatch['apply'](_0x2bd649,_0x929516,!![]);}catch(_0x124cc0){return BPromise['reject'](_0x124cc0);}return _0x2bd649[_0x15c7('0x1e')]();};}function saveUpdates(_0x5ae163,_0x2a3ee1){return function(_0x30cbcf){if(_0x30cbcf){return _0x30cbcf[_0x15c7('0x1f')](_0x5ae163)[_0x15c7('0x20')](function(_0x552713){return _0x552713;});}return null;};}function removeEntity(_0x3cc4bb,_0x3a6f09){return function(_0x58a0e5){if(_0x58a0e5){return _0x58a0e5['destroy']()[_0x15c7('0x20')](function(){_0x3cc4bb[_0x15c7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3862e6,_0x2abf89){return function(_0x43d22c){if(!_0x43d22c){_0x3862e6[_0x15c7('0x17')](0x194);}return _0x43d22c;};}function handleError(_0x567e51,_0x37ee3b){_0x37ee3b=_0x37ee3b||0x1f4;return function(_0x1b51b7){logger[_0x15c7('0x21')](_0x1b51b7['stack']);if(_0x1b51b7[_0x15c7('0x22')]){delete _0x1b51b7[_0x15c7('0x22')];}_0x567e51[_0x15c7('0x19')](_0x37ee3b)['send'](_0x1b51b7);};}exports[_0x15c7('0x1f')]=function(_0x30ad27,_0xd67efb){if(_0x30ad27[_0x15c7('0x23')]['id']){delete _0x30ad27[_0x15c7('0x23')]['id'];}return db[_0x15c7('0x24')][_0x15c7('0x25')]({'where':{'id':_0x30ad27['params']['id']}})[_0x15c7('0x20')](handleEntityNotFound(_0xd67efb,null))[_0x15c7('0x20')](saveUpdates(_0x30ad27[_0x15c7('0x23')],null))[_0x15c7('0x20')](respondWithResult(_0xd67efb,null))[_0x15c7('0x26')](handleError(_0xd67efb,null));};exports[_0x15c7('0x27')]=function(_0x215576,_0x1402e4){return db[_0x15c7('0x24')][_0x15c7('0x25')]({'where':{'id':_0x215576[_0x15c7('0x28')]['id']}})[_0x15c7('0x20')](handleEntityNotFound(_0x1402e4,null))[_0x15c7('0x20')](removeEntity(_0x1402e4,null))[_0x15c7('0x26')](handleError(_0x1402e4,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index a317078..30ea96d 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 _0x74c3=['path','rimraf','../../config/environment','exports','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x116f5a,_0x31a8eb){var _0xa229df=function(_0x527089){while(--_0x527089){_0x116f5a['push'](_0x116f5a['shift']());}};_0xa229df(++_0x31a8eb);}(_0x74c3,0x199));var _0x374c=function(_0x356898,_0x46610f){_0x356898=_0x356898-0x0;var _0x365c65=_0x74c3[_0x356898];return _0x365c65;};'use strict';var _=require(_0x374c('0x0'));var util=require('util');var logger=require(_0x374c('0x1'))('api');var moment=require(_0x374c('0x2'));var BPromise=require(_0x374c('0x3'));var rp=require(_0x374c('0x4'));var fs=require('fs');var path=require(_0x374c('0x5'));var rimraf=require(_0x374c('0x6'));var config=require(_0x374c('0x7'));var attributes=require('./condition.attributes');module[_0x374c('0x8')]=function(_0x146a76,_0x1d79b8){return _0x146a76['define']('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecfe=['path','rimraf','./condition.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2fe58e,_0x5c97b7){var _0x18b7f3=function(_0x28070d){while(--_0x28070d){_0x2fe58e['push'](_0x2fe58e['shift']());}};_0x18b7f3(++_0x5c97b7);}(_0xecfe,0x68));var _0xeecf=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xecfe[_0x26fc81];return _0x9feece;};'use strict';var _=require(_0xeecf('0x0'));var util=require(_0xeecf('0x1'));var logger=require(_0xeecf('0x2'))(_0xeecf('0x3'));var moment=require(_0xeecf('0x4'));var BPromise=require(_0xeecf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeecf('0x6'));var rimraf=require(_0xeecf('0x7'));var config=require('../../config/environment');var attributes=require(_0xeecf('0x8'));module[_0xeecf('0x9')]=function(_0x170ae9,_0x44b11b){return _0x170ae9[_0xeecf('0xa')]('Condition',attributes,{'tableName':'tools_conditions','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 697ba3c..9dabebe 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 _0x6193=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','code','message','error','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6193,0x11c));var _0x3619=function(_0x5d84a2,_0x56697f){_0x5d84a2=_0x5d84a2-0x0;var _0xfa6b37=_0x6193[_0x5d84a2];return _0xfa6b37;};'use strict';var _=require(_0x3619('0x0'));var util=require('util');var moment=require(_0x3619('0x1'));var BPromise=require(_0x3619('0x2'));var rs=require(_0x3619('0x3'));var fs=require('fs');var Redis=require(_0x3619('0x4'));var db=require(_0x3619('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3619('0x6'));var jayson=require(_0x3619('0x7'));var client=jayson[_0x3619('0x8')][_0x3619('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49e2dc,_0x1b6c58,_0xf8e84a){return new BPromise(function(_0x17c5ba,_0x3daeed){return client[_0x3619('0xa')](_0x49e2dc,_0xf8e84a)[_0x3619('0xb')](function(_0x29d355){logger['info'](_0x3619('0xc'),_0x1b6c58,_0x3619('0xd'));logger[_0x3619('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x1b6c58,_0x3619('0xd'),JSON['stringify'](_0x29d355));if(_0x29d355['error']){if(_0x29d355['error'][_0x3619('0xf')]===0x1f4){logger['error'](_0x3619('0xc'),_0x1b6c58,_0x29d355['error'][_0x3619('0x10')]);return _0x3daeed(_0x29d355[_0x3619('0x11')]['message']);}logger['error'](_0x3619('0xc'),_0x1b6c58,_0x29d355['error'][_0x3619('0x10')]);return _0x17c5ba(_0x29d355[_0x3619('0x11')][_0x3619('0x10')]);}else{logger['info'](_0x3619('0xc'),_0x1b6c58,_0x3619('0xd'));_0x17c5ba(_0x29d355['result']['message']);}})[_0x3619('0x12')](function(_0x5c9b00){logger['error']('Condition,\x20%s,\x20%s',_0x1b6c58,_0x5c9b00);_0x3daeed(_0x5c9b00);});});} \ No newline at end of file +var _0x0713=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0x0713,0x1a9));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3071('0x0'));var util=require(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rs=require(_0x3071('0x4'));var fs=require('fs');var Redis=require(_0x3071('0x5'));var db=require(_0x3071('0x6'))['db'];var utils=require(_0x3071('0x7'));var logger=require(_0x3071('0x8'))(_0x3071('0x9'));var config=require('../../config/environment');var jayson=require(_0x3071('0xa'));var client=jayson['client'][_0x3071('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x629b3d,_0x3ea929,_0x533555){return new BPromise(function(_0x239066,_0x3c5d39){return client[_0x3071('0xc')](_0x629b3d,_0x533555)[_0x3071('0xd')](function(_0x3b498d){logger[_0x3071('0xe')](_0x3071('0xf'),_0x3ea929,'request\x20sent');logger[_0x3071('0x10')](_0x3071('0x11'),_0x3ea929,_0x3071('0x12'),JSON[_0x3071('0x13')](_0x3b498d));if(_0x3b498d['error']){if(_0x3b498d[_0x3071('0x14')][_0x3071('0x15')]===0x1f4){logger[_0x3071('0x14')](_0x3071('0xf'),_0x3ea929,_0x3b498d[_0x3071('0x14')][_0x3071('0x16')]);return _0x3c5d39(_0x3b498d['error']['message']);}logger['error'](_0x3071('0xf'),_0x3ea929,_0x3b498d['error'][_0x3071('0x16')]);return _0x239066(_0x3b498d[_0x3071('0x14')][_0x3071('0x16')]);}else{logger[_0x3071('0xe')]('Condition,\x20%s,\x20%s',_0x3ea929,_0x3071('0x12'));_0x239066(_0x3b498d[_0x3071('0x17')][_0x3071('0x16')]);}})[_0x3071('0x18')](function(_0x5c020f){logger[_0x3071('0x14')](_0x3071('0xf'),_0x3ea929,_0x5c020f);_0x3c5d39(_0x5c020f);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 002150d..fb723c6 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 _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','delete','/:id','destroy','multer','util','path','express'];(function(_0x312316,_0x3a3e9c){var _0x721465=function(_0x5b4f2c){while(--_0x5b4f2c){_0x312316['push'](_0x312316['shift']());}};_0x721465(++_0x3a3e9c);}(_0x7a54,0x106));var _0x47a5=function(_0x158ad6,_0x913c7b){_0x158ad6=_0x158ad6-0x0;var _0x29ef1f=_0x7a54[_0x158ad6];return _0x29ef1f;};'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')]('/:id',auth[_0x47a5('0xa')](),controller['update']);router[_0x47a5('0xb')](_0x47a5('0xc'),auth['isAuthenticated'](),controller[_0x47a5('0xd')]);module['exports']=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','multer','util','path'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_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')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0xc')]);router[_0x7995('0xd')]('/:id',auth[_0x7995('0xb')](),controller[_0x7995('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index b4ec0b9..99bee31 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 _0x7e02=['name','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e02,0x71));var _0x27e0=function(_0x11d596,_0x2d4fb4){_0x11d596=_0x11d596-0x0;var _0x31a2be=_0x7e02[_0x11d596];return _0x31a2be;};'use strict';var Sequelize=require(_0x27e0('0x0'));module[_0x27e0('0x1')]={'name':{'type':Sequelize[_0x27e0('0x2')],'allowNull':![],'unique':_0x27e0('0x3')},'description':{'type':Sequelize[_0x27e0('0x2')]}}; \ No newline at end of file +var _0xd07e=['STRING','name','sequelize','exports'];(function(_0x4d022f,_0xc6b98f){var _0x214dda=function(_0x1190ff){while(--_0x1190ff){_0x4d022f['push'](_0x4d022f['shift']());}};_0x214dda(++_0xc6b98f);}(_0xd07e,0x10a));var _0xed07=function(_0x3d122b,_0x7d3dce){_0x3d122b=_0x3d122b-0x0;var _0x100174=_0xd07e[_0x3d122b];return _0x100174;};'use strict';var Sequelize=require(_0xed07('0x0'));module[_0xed07('0x1')]={'name':{'type':Sequelize[_0xed07('0x2')],'allowNull':![],'unique':_0xed07('0x3')},'description':{'type':Sequelize[_0xed07('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 2f58dfe..e3764fb 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 _0xc561=['request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','./dashboard.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','destroy','then','CustomDashboards','error','name','index','map','Dashboard','fieldName','type','key','intersection','attributes','model','fields','query','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','createdAt','body','omit','updatedAt','UserProfileSection','userProfileId','update','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrSerie1','attrSerie2','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4574d9,_0x224f1a){var _0x30cea4=function(_0x4d26a5){while(--_0x4d26a5){_0x4574d9['push'](_0x4574d9['shift']());}};_0x30cea4(++_0x224f1a);}(_0xc561,0xe0));var _0x1c56=function(_0x1f0724,_0x3a58bf){_0x1f0724=_0x1f0724-0x0;var _0x253ffb=_0xc561[_0x1f0724];return _0x253ffb;};'use strict';var emlformat=require(_0x1c56('0x0'));var rimraf=require(_0x1c56('0x1'));var zipdir=require(_0x1c56('0x2'));var jsonpatch=require(_0x1c56('0x3'));var rp=require(_0x1c56('0x4'));var moment=require(_0x1c56('0x5'));var BPromise=require(_0x1c56('0x6'));var Mustache=require(_0x1c56('0x7'));var util=require(_0x1c56('0x8'));var path=require('path');var sox=require(_0x1c56('0x9'));var csv=require(_0x1c56('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1c56('0xb'));var crypto=require(_0x1c56('0xc'));var jsforce=require(_0x1c56('0xd'));var deskjs=require(_0x1c56('0xe'));var toCsv=require(_0x1c56('0xa'));var querystring=require(_0x1c56('0xf'));var Papa=require(_0x1c56('0x10'));var Redis=require('ioredis');var authService=require(_0x1c56('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1c56('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c56('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1c56('0x14'));var licenseUtil=require(_0x1c56('0x15'));var db=require('../../mysqldb')['db'];config[_0x1c56('0x16')]=_[_0x1c56('0x17')](config[_0x1c56('0x16')],{'host':_0x1c56('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c56('0x16')]));require(_0x1c56('0x19'))['register'](socket);function respondWithStatusCode(_0x441099,_0x3a14fb){_0x3a14fb=_0x3a14fb||0xcc;return function(_0x29cb63){if(_0x29cb63){return _0x441099[_0x1c56('0x1a')](_0x3a14fb);}return _0x441099[_0x1c56('0x1b')](_0x3a14fb)[_0x1c56('0x1c')]();};}function respondWithResult(_0x3ce09a,_0x3cea29){_0x3cea29=_0x3cea29||0xc8;return function(_0x43c856){if(_0x43c856){return _0x3ce09a['status'](_0x3cea29)[_0x1c56('0x1d')](_0x43c856);}};}function respondWithFilteredResult(_0x5f1c05,_0x518748){return function(_0x4fa4c2){if(_0x4fa4c2){var _0x57cbc2=_0x4fa4c2[_0x1c56('0x1e')],_0x3f2124=_0x518748[_0x1c56('0x1f')],_0x2fcab0=_0x518748[_0x1c56('0x1f')]+_0x518748[_0x1c56('0x20')],_0xe0d853;if(_0x2fcab0>=_0x57cbc2){_0x2fcab0=_0x57cbc2;_0xe0d853=0xc8;}else{_0xe0d853=0xce;}_0x5f1c05[_0x1c56('0x1b')](_0xe0d853);return _0x5f1c05[_0x1c56('0x21')](_0x1c56('0x22'),_0x3f2124+'-'+_0x2fcab0+'/'+_0x57cbc2)[_0x1c56('0x1d')](_0x4fa4c2);}return null;};}function patchUpdates(_0x2314ed){return function(_0x801b26){try{jsonpatch[_0x1c56('0x23')](_0x801b26,_0x2314ed,!![]);}catch(_0x22e164){return BPromise['reject'](_0x22e164);}return _0x801b26['save']();};}function saveUpdates(_0xba3c52,_0x1a918c){return function(_0x4580a6){if(_0x4580a6){return _0x4580a6['update'](_0xba3c52)['then'](function(_0x43b866){return _0x43b866;});}return null;};}function removeEntity(_0x4db7dc,_0x447eb8){return function(_0x588639){if(_0x588639){return _0x588639[_0x1c56('0x24')]()[_0x1c56('0x25')](function(){var _0x3a16ce=_0x588639['get']({'plain':!![]});var _0x4cc6e4=_0x1c56('0x26');return db['UserProfileResource'][_0x1c56('0x24')]({'where':{'type':_0x4cc6e4,'resourceId':_0x3a16ce['id']}})['then'](function(){return _0x588639;});})[_0x1c56('0x25')](function(){_0x4db7dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x545790,_0x26745d){return function(_0x2209e8){if(!_0x2209e8){_0x545790['sendStatus'](0x194);}return _0x2209e8;};}function handleError(_0x4bce39,_0x381578){_0x381578=_0x381578||0x1f4;return function(_0x15d8d6){logger[_0x1c56('0x27')](_0x15d8d6['stack']);if(_0x15d8d6[_0x1c56('0x28')]){delete _0x15d8d6[_0x1c56('0x28')];}_0x4bce39[_0x1c56('0x1b')](_0x381578)['send'](_0x15d8d6);};}exports[_0x1c56('0x29')]=function(_0x38907a,_0x279c6a){var _0x5b82e3={},_0x42f525={},_0x33730c={'count':0x0,'rows':[]};var _0x2d09d7=_[_0x1c56('0x2a')](db[_0x1c56('0x2b')]['rawAttributes'],function(_0x46fc54){return{'name':_0x46fc54[_0x1c56('0x2c')],'type':_0x46fc54[_0x1c56('0x2d')][_0x1c56('0x2e')]};});_0x42f525['model']=_[_0x1c56('0x2a')](_0x2d09d7,'name');_0x42f525['query']=_['keys'](_0x38907a['query']);_0x42f525['filters']=_[_0x1c56('0x2f')](_0x42f525['model'],_0x42f525['query']);_0x5b82e3[_0x1c56('0x30')]=_[_0x1c56('0x2f')](_0x42f525[_0x1c56('0x31')],qs[_0x1c56('0x32')](_0x38907a[_0x1c56('0x33')]['fields']));_0x5b82e3[_0x1c56('0x30')]=_0x5b82e3[_0x1c56('0x30')]['length']?_0x5b82e3[_0x1c56('0x30')]:_0x42f525[_0x1c56('0x31')];if(!_0x38907a[_0x1c56('0x33')]['hasOwnProperty'](_0x1c56('0x34'))){_0x5b82e3[_0x1c56('0x20')]=qs[_0x1c56('0x20')](_0x38907a[_0x1c56('0x33')][_0x1c56('0x20')]);_0x5b82e3[_0x1c56('0x1f')]=qs['offset'](_0x38907a[_0x1c56('0x33')][_0x1c56('0x1f')]);}_0x5b82e3['order']=qs[_0x1c56('0x35')](_0x38907a[_0x1c56('0x33')][_0x1c56('0x35')]);_0x5b82e3[_0x1c56('0x36')]=qs[_0x1c56('0x37')](_[_0x1c56('0x38')](_0x38907a[_0x1c56('0x33')],_0x42f525[_0x1c56('0x37')]),_0x2d09d7);if(_0x38907a[_0x1c56('0x33')][_0x1c56('0x39')]){_0x5b82e3[_0x1c56('0x36')]=_['merge'](_0x5b82e3['where'],{'$or':_[_0x1c56('0x2a')](_0x2d09d7,function(_0x15f426){if(_0x15f426[_0x1c56('0x2d')]!==_0x1c56('0x3a')){var _0x366914={};_0x366914[_0x15f426[_0x1c56('0x28')]]={'$like':'%'+_0x38907a[_0x1c56('0x33')]['filter']+'%'};return _0x366914;}})});}_0x5b82e3=_[_0x1c56('0x3b')]({},_0x5b82e3,_0x38907a[_0x1c56('0x3c')]);var _0x245c12={'where':_0x5b82e3[_0x1c56('0x36')]};return db[_0x1c56('0x2b')][_0x1c56('0x1e')](_0x245c12)['then'](function(_0x4369c3){_0x33730c[_0x1c56('0x1e')]=_0x4369c3;if(_0x38907a[_0x1c56('0x33')][_0x1c56('0x3d')]){_0x5b82e3[_0x1c56('0x3e')]=[{'all':!![]}];}return db[_0x1c56('0x2b')][_0x1c56('0x3f')](_0x5b82e3);})[_0x1c56('0x25')](function(_0x3e9295){_0x33730c[_0x1c56('0x40')]=_0x3e9295;return _0x33730c;})[_0x1c56('0x25')](respondWithFilteredResult(_0x279c6a,_0x5b82e3))[_0x1c56('0x41')](handleError(_0x279c6a,null));};exports['show']=function(_0xca5d15,_0x30dbaf){var _0x4c9006={'raw':![],'where':{'id':_0xca5d15[_0x1c56('0x42')]['id']}},_0x1e2538={};_0x1e2538[_0x1c56('0x31')]=_[_0x1c56('0x43')](db[_0x1c56('0x2b')][_0x1c56('0x44')]);_0x1e2538[_0x1c56('0x33')]=_['keys'](_0xca5d15[_0x1c56('0x33')]);_0x1e2538[_0x1c56('0x37')]=_[_0x1c56('0x2f')](_0x1e2538[_0x1c56('0x31')],_0x1e2538['query']);_0x4c9006[_0x1c56('0x30')]=_['intersection'](_0x1e2538[_0x1c56('0x31')],qs['fields'](_0xca5d15['query'][_0x1c56('0x32')]));_0x4c9006['attributes']=_0x4c9006[_0x1c56('0x30')][_0x1c56('0x45')]?_0x4c9006[_0x1c56('0x30')]:_0x1e2538[_0x1c56('0x31')];if(_0xca5d15['query'][_0x1c56('0x3d')]){_0x4c9006[_0x1c56('0x3e')]=[{'all':!![]}];}_0x4c9006=_[_0x1c56('0x3b')]({},_0x4c9006,_0xca5d15[_0x1c56('0x3c')]);return db[_0x1c56('0x2b')]['find'](_0x4c9006)['then'](handleEntityNotFound(_0x30dbaf,null))['then'](respondWithResult(_0x30dbaf,null))[_0x1c56('0x41')](handleError(_0x30dbaf,null));};exports[_0x1c56('0x46')]=function(_0x47eeff,_0x4c0248){return db['Dashboard'][_0x1c56('0x46')](_0x47eeff['body'],{})[_0x1c56('0x25')](function(_0x5dc59c){var _0x1406a4=_0x47eeff[_0x1c56('0x47')][_0x1c56('0x48')]({'plain':!![]});if(!_0x1406a4)throw new Error(_0x1c56('0x49'));if(_0x1406a4[_0x1c56('0x4a')]===_0x1c56('0x47')){var _0x2bc9cc=_0x5dc59c[_0x1c56('0x48')]({'plain':!![]});var _0x1361c1='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x1361c1,'userProfileId':_0x1406a4['userProfileId']},'raw':!![]})[_0x1c56('0x25')](function(_0x4ee89e){if(_0x4ee89e&&_0x4ee89e[_0x1c56('0x4b')]===0x0){return db[_0x1c56('0x4c')][_0x1c56('0x46')]({'name':_0x2bc9cc[_0x1c56('0x28')],'resourceId':_0x2bc9cc['id'],'type':_0x4ee89e[_0x1c56('0x28')],'sectionId':_0x4ee89e['id']},{})[_0x1c56('0x25')](function(){return _0x5dc59c;});}else{return _0x5dc59c;}})[_0x1c56('0x41')](function(_0x18b708){logger[_0x1c56('0x27')](_0x1c56('0x4d'),_0x18b708);throw _0x18b708;});}return _0x5dc59c;})[_0x1c56('0x25')](respondWithResult(_0x4c0248,0xc9))[_0x1c56('0x41')](handleError(_0x4c0248,null));};exports[_0x1c56('0x4e')]=function(_0x43ffc8,_0x57ed0c){var _0x7df056={'where':{'id':_0x43ffc8[_0x1c56('0x42')]['id']}},_0xaaffbf={};_0xaaffbf[_0x1c56('0x31')]=_[_0x1c56('0x43')](db[_0x1c56('0x2b')]['rawAttributes']);_0x7df056[_0x1c56('0x30')]=_[_0x1c56('0x2f')](_0xaaffbf[_0x1c56('0x31')],qs[_0x1c56('0x32')](_0x43ffc8[_0x1c56('0x33')]['fields']));_0x7df056[_0x1c56('0x30')]=_0x7df056[_0x1c56('0x30')][_0x1c56('0x45')]?_0x7df056[_0x1c56('0x30')]:_0xaaffbf['model'];if(_0x43ffc8[_0x1c56('0x33')]['includeAll']){_0x7df056[_0x1c56('0x3e')]=[{'all':!![]}];}_0x7df056=_[_0x1c56('0x3b')]({},_0x7df056,_0x43ffc8[_0x1c56('0x3c')]);return db['Dashboard'][_0x1c56('0x4f')](_0x7df056)[_0x1c56('0x25')](handleEntityNotFound(_0x57ed0c,null))['then'](function(_0x335f72){if(_0x335f72){var _0x5af784=_0x335f72[_0x1c56('0x48')]({'plain':!![]});_0x5af784=qs['omit'](_0x5af784,['id',_0x1c56('0x50'),'updatedAt']);_0x43ffc8[_0x1c56('0x51')]=_[_0x1c56('0x52')](_0x43ffc8[_0x1c56('0x51')],['id',_0x1c56('0x50'),_0x1c56('0x53')]);return db[_0x1c56('0x2b')][_0x1c56('0x46')](_[_0x1c56('0x3b')](_0x5af784,_0x43ffc8[_0x1c56('0x51')]),{'include':_0x43ffc8[_0x1c56('0x33')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4087b9){var _0x1c35c9=_0x43ffc8[_0x1c56('0x47')][_0x1c56('0x48')]({'plain':!![]});if(!_0x1c35c9)throw new Error(_0x1c56('0x49'));if(_0x1c35c9[_0x1c56('0x4a')]==='user'){var _0x384e7b=_0x4087b9[_0x1c56('0x48')]({'plain':!![]});var _0x1af0d6=_0x1c56('0x26');return db[_0x1c56('0x54')][_0x1c56('0x4f')]({'where':{'name':_0x1af0d6,'userProfileId':_0x1c35c9[_0x1c56('0x55')]},'raw':!![]})[_0x1c56('0x25')](function(_0x26a03c){if(_0x26a03c&&_0x26a03c[_0x1c56('0x4b')]===0x0){return db[_0x1c56('0x4c')][_0x1c56('0x46')]({'name':_0x384e7b['name'],'resourceId':_0x384e7b['id'],'type':_0x26a03c['name'],'sectionId':_0x26a03c['id']},{})[_0x1c56('0x25')](function(){return _0x4087b9;});}else{return _0x4087b9;}})[_0x1c56('0x41')](function(_0x20c1a7){logger[_0x1c56('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20c1a7);throw _0x20c1a7;});}return _0x4087b9;});}})[_0x1c56('0x25')](respondWithResult(_0x57ed0c,0xc9))[_0x1c56('0x41')](handleError(_0x57ed0c,null));};exports[_0x1c56('0x56')]=function(_0x2f4dfa,_0x3f2eae){if(_0x2f4dfa[_0x1c56('0x51')]['id']){delete _0x2f4dfa['body']['id'];}return db[_0x1c56('0x2b')]['find']({'where':{'id':_0x2f4dfa['params']['id']}})[_0x1c56('0x25')](handleEntityNotFound(_0x3f2eae,null))['then'](saveUpdates(_0x2f4dfa[_0x1c56('0x51')],null))[_0x1c56('0x25')](respondWithResult(_0x3f2eae,null))[_0x1c56('0x41')](handleError(_0x3f2eae,null));};exports[_0x1c56('0x24')]=function(_0x117f02,_0xe26a0d){return db[_0x1c56('0x2b')][_0x1c56('0x4f')]({'where':{'id':_0x117f02[_0x1c56('0x42')]['id']}})['then'](handleEntityNotFound(_0xe26a0d,null))[_0x1c56('0x25')](removeEntity(_0xe26a0d,null))[_0x1c56('0x41')](handleError(_0xe26a0d,null));};function widgetAttributes(_0x1ee32){try{switch(_0x1ee32[_0x1c56('0x2d')]){case'iframe':return[{'name':'attrUrl','value':_0x1ee32[_0x1c56('0x57')]||(_0x1ee32['attrs']&&_0x1ee32['attrs'][0x0]?_0x1ee32[_0x1c56('0x58')][0x0][_0x1c56('0x59')]:undefined)||_0x1c56('0x5a')}];case'custom':return[{'name':_0x1c56('0x5b'),'value':_0x1ee32['attrPath']||(_0x1ee32[_0x1c56('0x58')]&&_0x1ee32[_0x1c56('0x58')][0x0]?_0x1ee32[_0x1c56('0x58')][0x0][_0x1c56('0x59')]:undefined)||''}];case'clock':return[{'name':_0x1c56('0x5c'),'value':_0x1ee32[_0x1c56('0x5c')]||(_0x1ee32[_0x1c56('0x58')]&&_0x1ee32['attrs'][0x0]?_0x1ee32[_0x1c56('0x58')][0x0]['value']:undefined)||_0x1c56('0x5d')},{'name':_0x1c56('0x5e'),'value':_0x1ee32[_0x1c56('0x5e')]||(_0x1ee32[_0x1c56('0x58')]&&_0x1ee32[_0x1c56('0x58')][0x1]?_0x1ee32[_0x1c56('0x58')][0x1]['value']:undefined)||_0x1c56('0x5f')},{'name':_0x1c56('0x60'),'value':_0x1ee32[_0x1c56('0x60')]||(_0x1ee32[_0x1c56('0x58')]&&_0x1ee32[_0x1c56('0x58')][0x2]?_0x1ee32[_0x1c56('0x58')][0x2]['value']:undefined)||0xc}];case _0x1c56('0x61'):return[{'name':_0x1c56('0x62'),'value':_0x1ee32['attrMetric']||(_0x1ee32[_0x1c56('0x58')]&&_0x1ee32[_0x1c56('0x58')][0x0]?_0x1ee32[_0x1c56('0x58')][0x0][_0x1c56('0x59')]:undefined)||_0x1c56('0x63')},{'name':_0x1c56('0x64'),'value':_0x1ee32[_0x1c56('0x64')]||(_0x1ee32['attrs']&&_0x1ee32[_0x1c56('0x58')][0x1]?_0x1ee32[_0x1c56('0x58')][0x1][_0x1c56('0x59')]:undefined)||[]},{'name':_0x1c56('0x60'),'value':_0x1ee32['attrFontSize']||(_0x1ee32[_0x1c56('0x58')]&&_0x1ee32[_0x1c56('0x58')][0x2]?_0x1ee32['attrs'][0x2]['value']:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0x1c56('0x65'),'value':_0x1ee32[_0x1c56('0x65')]||(_0x1ee32[_0x1c56('0x58')]&&_0x1ee32[_0x1c56('0x58')][0x0]?_0x1ee32[_0x1c56('0x58')][0x0][_0x1c56('0x59')]:undefined)||_0x1c56('0x63')},{'name':_0x1c56('0x66'),'value':_0x1ee32[_0x1c56('0x66')]||(_0x1ee32['attrs']&&_0x1ee32[_0x1c56('0x58')][0x1]?_0x1ee32['attrs'][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x1ee32['attrSerie3']||(_0x1ee32['attrs']&&_0x1ee32[_0x1c56('0x58')][0x2]?_0x1ee32[_0x1c56('0x58')][0x2][_0x1c56('0x59')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1ee32['attrVoiceQueues']||(_0x1ee32['attrs']&&_0x1ee32[_0x1c56('0x58')][0x3]?_0x1ee32[_0x1c56('0x58')][0x3][_0x1c56('0x59')]:undefined)||[]}];case'web-report':return[{'name':_0x1c56('0x67'),'type':_0x1ee32[_0x1c56('0x68')]||(_0x1ee32[_0x1c56('0x58')]&&_0x1ee32[_0x1c56('0x58')][0x0]?_0x1ee32['attrs'][0x0][_0x1c56('0x2d')]:undefined)||null,'value':_0x1ee32['attrReport']||(_0x1ee32[_0x1c56('0x58')]&&_0x1ee32[_0x1c56('0x58')][0x0]?_0x1ee32[_0x1c56('0x58')][0x0][_0x1c56('0x59')]:undefined)||null},{'name':_0x1c56('0x69'),'value':_0x1ee32[_0x1c56('0x69')]||(_0x1ee32['attrs']&&_0x1ee32['attrs'][0x1]?_0x1ee32['attrs'][0x1][_0x1c56('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x2f59c2){logger[_0x1c56('0x27')](_0x1c56('0x6a'),JSON[_0x1c56('0x6b')](_0x2f59c2));return[];}}exports[_0x1c56('0x6c')]=function(_0x1747ca,_0x2f3f93,_0x49ef6f){if(_0x1747ca['body']['id']){delete _0x1747ca[_0x1c56('0x51')]['id'];}return db[_0x1c56('0x2b')][_0x1c56('0x4f')]({'where':{'id':_0x1747ca[_0x1c56('0x42')]['id']}})['then'](handleEntityNotFound(_0x2f3f93,null))[_0x1c56('0x25')](function(_0x4dea3e){if(_0x4dea3e){_0x1747ca[_0x1c56('0x51')][_0x1c56('0x6d')]=_0x4dea3e['id'];_0x1747ca[_0x1c56('0x51')][_0x1c56('0x58')]=widgetAttributes(_0x1747ca['body']);return db[_0x1c56('0x6e')][_0x1c56('0x46')](_0x1747ca[_0x1c56('0x51')]);}})[_0x1c56('0x25')](respondWithResult(_0x2f3f93,null))[_0x1c56('0x41')](handleError(_0x2f3f93,null));};exports[_0x1c56('0x6f')]=function(_0x28511e,_0x3b419d,_0x26cf1a){var _0x54ee91={};var _0x4f8c56={};var _0xee862f;var _0x196241;return db[_0x1c56('0x2b')][_0x1c56('0x70')]({'where':{'id':_0x28511e[_0x1c56('0x42')]['id']}})['then'](handleEntityNotFound(_0x3b419d,null))[_0x1c56('0x25')](function(_0x5f4b95){if(_0x5f4b95){_0xee862f=_0x5f4b95;_0x4f8c56['model']=_['keys'](db['DashboardItem'][_0x1c56('0x44')]);_0x4f8c56[_0x1c56('0x33')]=_[_0x1c56('0x43')](_0x28511e['query']);_0x4f8c56[_0x1c56('0x37')]=_[_0x1c56('0x2f')](_0x4f8c56[_0x1c56('0x31')],_0x4f8c56[_0x1c56('0x33')]);_0x54ee91[_0x1c56('0x30')]=_[_0x1c56('0x2f')](_0x4f8c56['model'],qs[_0x1c56('0x32')](_0x28511e[_0x1c56('0x33')][_0x1c56('0x32')]));_0x54ee91[_0x1c56('0x30')]=_0x54ee91[_0x1c56('0x30')][_0x1c56('0x45')]?_0x54ee91['attributes']:_0x4f8c56[_0x1c56('0x31')];_0x54ee91[_0x1c56('0x71')]=qs[_0x1c56('0x35')](_0x28511e[_0x1c56('0x33')]['sort']);_0x54ee91['where']=qs[_0x1c56('0x37')](_[_0x1c56('0x38')](_0x28511e[_0x1c56('0x33')],_0x4f8c56[_0x1c56('0x37')]));if(_0x28511e['query'][_0x1c56('0x39')]){_0x54ee91[_0x1c56('0x36')]=_[_0x1c56('0x3b')](_0x54ee91[_0x1c56('0x36')],{'$or':_[_0x1c56('0x2a')](_0x54ee91[_0x1c56('0x30')],function(_0x72d061){var _0x9440a3={};_0x9440a3[_0x72d061]={'$like':'%'+_0x28511e[_0x1c56('0x33')]['filter']+'%'};return _0x9440a3;})});}_0x54ee91=_['merge']({},_0x54ee91,_0x28511e[_0x1c56('0x3c')]);return _0xee862f[_0x1c56('0x6f')](_0x54ee91);}})['then'](function(_0x5a0220){if(_0x5a0220){_0x196241=_0x5a0220[_0x1c56('0x45')];if(!_0x28511e[_0x1c56('0x33')]['hasOwnProperty'](_0x1c56('0x34'))){_0x54ee91['limit']=qs['limit'](_0x28511e[_0x1c56('0x33')][_0x1c56('0x20')]);_0x54ee91[_0x1c56('0x1f')]=qs[_0x1c56('0x1f')](_0x28511e[_0x1c56('0x33')]['offset']);}return _0xee862f[_0x1c56('0x6f')](_0x54ee91);}})[_0x1c56('0x25')](function(_0x2548c3){if(_0x2548c3){return _0x2548c3?{'count':_0x196241,'rows':_0x2548c3}:null;}})[_0x1c56('0x25')](respondWithResult(_0x3b419d,null))[_0x1c56('0x41')](handleError(_0x3b419d,null));}; \ No newline at end of file +var _0xeb4d=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./dashboard.socket','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','Dashboard','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','autoAssociation','omit','createdAt','updatedAt','body','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','findOne','DashboardItem','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs'];(function(_0x1bcda1,_0x14e777){var _0x5f171c=function(_0x2984d2){while(--_0x2984d2){_0x1bcda1['push'](_0x1bcda1['shift']());}};_0x5f171c(++_0x14e777);}(_0xeb4d,0x158));var _0xdeb4=function(_0x27d7de,_0x596ee8){_0x27d7de=_0x27d7de-0x0;var _0x47d77a=_0xeb4d[_0x27d7de];return _0x47d77a;};'use strict';var emlformat=require(_0xdeb4('0x0'));var rimraf=require(_0xdeb4('0x1'));var zipdir=require(_0xdeb4('0x2'));var jsonpatch=require(_0xdeb4('0x3'));var rp=require(_0xdeb4('0x4'));var moment=require(_0xdeb4('0x5'));var BPromise=require(_0xdeb4('0x6'));var Mustache=require(_0xdeb4('0x7'));var util=require(_0xdeb4('0x8'));var path=require(_0xdeb4('0x9'));var sox=require('sox');var csv=require(_0xdeb4('0xa'));var ejs=require(_0xdeb4('0xb'));var fs=require('fs');var fs_extra=require(_0xdeb4('0xc'));var _=require(_0xdeb4('0xd'));var squel=require('squel');var crypto=require(_0xdeb4('0xe'));var jsforce=require(_0xdeb4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdeb4('0xa'));var querystring=require(_0xdeb4('0x10'));var Papa=require('papaparse');var Redis=require(_0xdeb4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdeb4('0x12'));var as=require(_0xdeb4('0x13'));var hardwareService=require(_0xdeb4('0x14'));var logger=require(_0xdeb4('0x15'))(_0xdeb4('0x16'));var utils=require(_0xdeb4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdeb4('0x18'));var db=require('../../mysqldb')['db'];config[_0xdeb4('0x19')]=_['defaults'](config[_0xdeb4('0x19')],{'host':_0xdeb4('0x1a'),'port':0x18eb});var socket=require(_0xdeb4('0x1b'))(new Redis(config[_0xdeb4('0x19')]));require(_0xdeb4('0x1c'))['register'](socket);function respondWithStatusCode(_0x14927c,_0x2d9ded){_0x2d9ded=_0x2d9ded||0xcc;return function(_0x5b5ffd){if(_0x5b5ffd){return _0x14927c['sendStatus'](_0x2d9ded);}return _0x14927c[_0xdeb4('0x1d')](_0x2d9ded)['end']();};}function respondWithResult(_0xbdb09f,_0x4f4ec3){_0x4f4ec3=_0x4f4ec3||0xc8;return function(_0xe6bdf1){if(_0xe6bdf1){return _0xbdb09f['status'](_0x4f4ec3)[_0xdeb4('0x1e')](_0xe6bdf1);}};}function respondWithFilteredResult(_0x36e448,_0x399f04){return function(_0x4c39dd){if(_0x4c39dd){var _0x2787b6=_0x4c39dd[_0xdeb4('0x1f')],_0x2f0ba1=_0x399f04['offset'],_0x347dcf=_0x399f04[_0xdeb4('0x20')]+_0x399f04[_0xdeb4('0x21')],_0xe8c050;if(_0x347dcf>=_0x2787b6){_0x347dcf=_0x2787b6;_0xe8c050=0xc8;}else{_0xe8c050=0xce;}_0x36e448['status'](_0xe8c050);return _0x36e448[_0xdeb4('0x22')](_0xdeb4('0x23'),_0x2f0ba1+'-'+_0x347dcf+'/'+_0x2787b6)[_0xdeb4('0x1e')](_0x4c39dd);}return null;};}function patchUpdates(_0x228357){return function(_0x7559ed){try{jsonpatch['apply'](_0x7559ed,_0x228357,!![]);}catch(_0x1c6407){return BPromise[_0xdeb4('0x24')](_0x1c6407);}return _0x7559ed['save']();};}function saveUpdates(_0x47c780,_0x5ef696){return function(_0x3abd89){if(_0x3abd89){return _0x3abd89[_0xdeb4('0x25')](_0x47c780)[_0xdeb4('0x26')](function(_0x2a1509){return _0x2a1509;});}return null;};}function removeEntity(_0x107b51,_0x1225e9){return function(_0x38ad29){if(_0x38ad29){return _0x38ad29[_0xdeb4('0x27')]()[_0xdeb4('0x26')](function(){var _0x2151ad=_0x38ad29[_0xdeb4('0x28')]({'plain':!![]});var _0x1e8787='CustomDashboards';return db[_0xdeb4('0x29')][_0xdeb4('0x27')]({'where':{'type':_0x1e8787,'resourceId':_0x2151ad['id']}})[_0xdeb4('0x26')](function(){return _0x38ad29;});})[_0xdeb4('0x26')](function(){_0x107b51[_0xdeb4('0x1d')](0xcc)[_0xdeb4('0x2a')]();});}};}function handleEntityNotFound(_0x71cfbd,_0x469665){return function(_0x4a2947){if(!_0x4a2947){_0x71cfbd[_0xdeb4('0x2b')](0x194);}return _0x4a2947;};}function handleError(_0x4d858e,_0x2fafba){_0x2fafba=_0x2fafba||0x1f4;return function(_0x5e22e9){logger[_0xdeb4('0x2c')](_0x5e22e9[_0xdeb4('0x2d')]);if(_0x5e22e9[_0xdeb4('0x2e')]){delete _0x5e22e9[_0xdeb4('0x2e')];}_0x4d858e['status'](_0x2fafba)[_0xdeb4('0x2f')](_0x5e22e9);};}exports[_0xdeb4('0x30')]=function(_0x216587,_0x34d7b7){var _0x4f3c63={},_0x3af905={},_0x43e9c0={'count':0x0,'rows':[]};var _0x320afe=_['map'](db[_0xdeb4('0x31')][_0xdeb4('0x32')],function(_0x2f68f4){return{'name':_0x2f68f4['fieldName'],'type':_0x2f68f4[_0xdeb4('0x33')][_0xdeb4('0x34')]};});_0x3af905[_0xdeb4('0x35')]=_[_0xdeb4('0x36')](_0x320afe,_0xdeb4('0x2e'));_0x3af905[_0xdeb4('0x37')]=_[_0xdeb4('0x38')](_0x216587[_0xdeb4('0x37')]);_0x3af905['filters']=_['intersection'](_0x3af905[_0xdeb4('0x35')],_0x3af905[_0xdeb4('0x37')]);_0x4f3c63[_0xdeb4('0x39')]=_[_0xdeb4('0x3a')](_0x3af905[_0xdeb4('0x35')],qs[_0xdeb4('0x3b')](_0x216587['query'][_0xdeb4('0x3b')]));_0x4f3c63[_0xdeb4('0x39')]=_0x4f3c63[_0xdeb4('0x39')]['length']?_0x4f3c63[_0xdeb4('0x39')]:_0x3af905['model'];if(!_0x216587[_0xdeb4('0x37')][_0xdeb4('0x3c')](_0xdeb4('0x3d'))){_0x4f3c63[_0xdeb4('0x21')]=qs[_0xdeb4('0x21')](_0x216587[_0xdeb4('0x37')][_0xdeb4('0x21')]);_0x4f3c63[_0xdeb4('0x20')]=qs[_0xdeb4('0x20')](_0x216587[_0xdeb4('0x37')][_0xdeb4('0x20')]);}_0x4f3c63[_0xdeb4('0x3e')]=qs[_0xdeb4('0x3f')](_0x216587['query'][_0xdeb4('0x3f')]);_0x4f3c63[_0xdeb4('0x40')]=qs['filters'](_[_0xdeb4('0x41')](_0x216587[_0xdeb4('0x37')],_0x3af905[_0xdeb4('0x42')]),_0x320afe);if(_0x216587['query']['filter']){_0x4f3c63['where']=_['merge'](_0x4f3c63['where'],{'$or':_[_0xdeb4('0x36')](_0x320afe,function(_0x357833){if(_0x357833['type']!=='VIRTUAL'){var _0x41ed8a={};_0x41ed8a[_0x357833[_0xdeb4('0x2e')]]={'$like':'%'+_0x216587['query'][_0xdeb4('0x43')]+'%'};return _0x41ed8a;}})});}_0x4f3c63=_[_0xdeb4('0x44')]({},_0x4f3c63,_0x216587[_0xdeb4('0x45')]);var _0x595f45={'where':_0x4f3c63[_0xdeb4('0x40')]};return db['Dashboard'][_0xdeb4('0x1f')](_0x595f45)[_0xdeb4('0x26')](function(_0x78a238){_0x43e9c0[_0xdeb4('0x1f')]=_0x78a238;if(_0x216587['query'][_0xdeb4('0x46')]){_0x4f3c63[_0xdeb4('0x47')]=[{'all':!![]}];}return db[_0xdeb4('0x31')][_0xdeb4('0x48')](_0x4f3c63);})[_0xdeb4('0x26')](function(_0x19bb0b){_0x43e9c0['rows']=_0x19bb0b;return _0x43e9c0;})['then'](respondWithFilteredResult(_0x34d7b7,_0x4f3c63))['catch'](handleError(_0x34d7b7,null));};exports[_0xdeb4('0x49')]=function(_0x4298d2,_0x2bf95c){var _0x225f03={'raw':![],'where':{'id':_0x4298d2[_0xdeb4('0x4a')]['id']}},_0x47019b={};_0x47019b[_0xdeb4('0x35')]=_[_0xdeb4('0x38')](db[_0xdeb4('0x31')]['rawAttributes']);_0x47019b[_0xdeb4('0x37')]=_[_0xdeb4('0x38')](_0x4298d2[_0xdeb4('0x37')]);_0x47019b[_0xdeb4('0x42')]=_[_0xdeb4('0x3a')](_0x47019b['model'],_0x47019b[_0xdeb4('0x37')]);_0x225f03[_0xdeb4('0x39')]=_['intersection'](_0x47019b[_0xdeb4('0x35')],qs[_0xdeb4('0x3b')](_0x4298d2[_0xdeb4('0x37')][_0xdeb4('0x3b')]));_0x225f03[_0xdeb4('0x39')]=_0x225f03[_0xdeb4('0x39')][_0xdeb4('0x4b')]?_0x225f03['attributes']:_0x47019b['model'];if(_0x4298d2[_0xdeb4('0x37')][_0xdeb4('0x46')]){_0x225f03['include']=[{'all':!![]}];}_0x225f03=_[_0xdeb4('0x44')]({},_0x225f03,_0x4298d2['options']);return db[_0xdeb4('0x31')][_0xdeb4('0x4c')](_0x225f03)[_0xdeb4('0x26')](handleEntityNotFound(_0x2bf95c,null))['then'](respondWithResult(_0x2bf95c,null))[_0xdeb4('0x4d')](handleError(_0x2bf95c,null));};exports['create']=function(_0x138d21,_0x22d4ed){return db[_0xdeb4('0x31')][_0xdeb4('0x4e')](_0x138d21['body'],{})[_0xdeb4('0x26')](function(_0x5bccbf){var _0x434a79=_0x138d21[_0xdeb4('0x4f')][_0xdeb4('0x28')]({'plain':!![]});if(!_0x434a79)throw new Error(_0xdeb4('0x50'));if(_0x434a79[_0xdeb4('0x51')]===_0xdeb4('0x4f')){var _0x3dc2ee=_0x5bccbf[_0xdeb4('0x28')]({'plain':!![]});var _0x16b543=_0xdeb4('0x52');return db[_0xdeb4('0x53')][_0xdeb4('0x4c')]({'where':{'name':_0x16b543,'userProfileId':_0x434a79['userProfileId']},'raw':!![]})['then'](function(_0x13aa55){if(_0x13aa55&&_0x13aa55[_0xdeb4('0x54')]===0x0){return db[_0xdeb4('0x29')][_0xdeb4('0x4e')]({'name':_0x3dc2ee[_0xdeb4('0x2e')],'resourceId':_0x3dc2ee['id'],'type':_0x13aa55[_0xdeb4('0x2e')],'sectionId':_0x13aa55['id']},{})['then'](function(){return _0x5bccbf;});}else{return _0x5bccbf;}})[_0xdeb4('0x4d')](function(_0x5ac1c4){logger[_0xdeb4('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ac1c4);throw _0x5ac1c4;});}return _0x5bccbf;})[_0xdeb4('0x26')](respondWithResult(_0x22d4ed,0xc9))[_0xdeb4('0x4d')](handleError(_0x22d4ed,null));};exports['clone']=function(_0x267734,_0x27a1f4){var _0x4e774b={'where':{'id':_0x267734['params']['id']}},_0x45667e={};_0x45667e['model']=_[_0xdeb4('0x38')](db['Dashboard'][_0xdeb4('0x32')]);_0x4e774b[_0xdeb4('0x39')]=_[_0xdeb4('0x3a')](_0x45667e[_0xdeb4('0x35')],qs[_0xdeb4('0x3b')](_0x267734[_0xdeb4('0x37')][_0xdeb4('0x3b')]));_0x4e774b[_0xdeb4('0x39')]=_0x4e774b[_0xdeb4('0x39')][_0xdeb4('0x4b')]?_0x4e774b[_0xdeb4('0x39')]:_0x45667e[_0xdeb4('0x35')];if(_0x267734[_0xdeb4('0x37')][_0xdeb4('0x46')]){_0x4e774b[_0xdeb4('0x47')]=[{'all':!![]}];}_0x4e774b=_[_0xdeb4('0x44')]({},_0x4e774b,_0x267734[_0xdeb4('0x45')]);return db[_0xdeb4('0x31')]['find'](_0x4e774b)[_0xdeb4('0x26')](handleEntityNotFound(_0x27a1f4,null))['then'](function(_0x45c2d0){if(_0x45c2d0){var _0x30f0f4=_0x45c2d0[_0xdeb4('0x28')]({'plain':!![]});_0x30f0f4=qs[_0xdeb4('0x55')](_0x30f0f4,['id',_0xdeb4('0x56'),_0xdeb4('0x57')]);_0x267734[_0xdeb4('0x58')]=_[_0xdeb4('0x55')](_0x267734['body'],['id','createdAt',_0xdeb4('0x57')]);return db[_0xdeb4('0x31')][_0xdeb4('0x4e')](_[_0xdeb4('0x44')](_0x30f0f4,_0x267734[_0xdeb4('0x58')]),{'include':_0x267734[_0xdeb4('0x37')][_0xdeb4('0x46')]?[{'all':!![]}]:undefined})[_0xdeb4('0x26')](function(_0xefc9d2){var _0x53a445=_0x267734[_0xdeb4('0x4f')][_0xdeb4('0x28')]({'plain':!![]});if(!_0x53a445)throw new Error(_0xdeb4('0x50'));if(_0x53a445[_0xdeb4('0x51')]===_0xdeb4('0x4f')){var _0x343552=_0xefc9d2[_0xdeb4('0x28')]({'plain':!![]});var _0x2a8a61=_0xdeb4('0x52');return db['UserProfileSection'][_0xdeb4('0x4c')]({'where':{'name':_0x2a8a61,'userProfileId':_0x53a445[_0xdeb4('0x59')]},'raw':!![]})[_0xdeb4('0x26')](function(_0x205979){if(_0x205979&&_0x205979[_0xdeb4('0x54')]===0x0){return db[_0xdeb4('0x29')]['create']({'name':_0x343552[_0xdeb4('0x2e')],'resourceId':_0x343552['id'],'type':_0x205979[_0xdeb4('0x2e')],'sectionId':_0x205979['id']},{})['then'](function(){return _0xefc9d2;});}else{return _0xefc9d2;}})['catch'](function(_0x137669){logger[_0xdeb4('0x2c')](_0xdeb4('0x5a'),_0x137669);throw _0x137669;});}return _0xefc9d2;});}})[_0xdeb4('0x26')](respondWithResult(_0x27a1f4,0xc9))[_0xdeb4('0x4d')](handleError(_0x27a1f4,null));};exports[_0xdeb4('0x25')]=function(_0x3a64ed,_0x3e6825){if(_0x3a64ed['body']['id']){delete _0x3a64ed[_0xdeb4('0x58')]['id'];}return db[_0xdeb4('0x31')][_0xdeb4('0x4c')]({'where':{'id':_0x3a64ed[_0xdeb4('0x4a')]['id']}})[_0xdeb4('0x26')](handleEntityNotFound(_0x3e6825,null))['then'](saveUpdates(_0x3a64ed[_0xdeb4('0x58')],null))[_0xdeb4('0x26')](respondWithResult(_0x3e6825,null))['catch'](handleError(_0x3e6825,null));};exports['destroy']=function(_0x5d664e,_0x1938c3){return db[_0xdeb4('0x31')][_0xdeb4('0x4c')]({'where':{'id':_0x5d664e['params']['id']}})[_0xdeb4('0x26')](handleEntityNotFound(_0x1938c3,null))[_0xdeb4('0x26')](removeEntity(_0x1938c3,null))[_0xdeb4('0x4d')](handleError(_0x1938c3,null));};function widgetAttributes(_0x3d49af){try{switch(_0x3d49af[_0xdeb4('0x33')]){case _0xdeb4('0x5b'):return[{'name':_0xdeb4('0x5c'),'value':_0x3d49af[_0xdeb4('0x5c')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af[_0xdeb4('0x5d')][0x0]?_0x3d49af[_0xdeb4('0x5d')][0x0][_0xdeb4('0x5e')]:undefined)||_0xdeb4('0x5f')}];case _0xdeb4('0x60'):return[{'name':_0xdeb4('0x61'),'value':_0x3d49af['attrPath']||(_0x3d49af['attrs']&&_0x3d49af[_0xdeb4('0x5d')][0x0]?_0x3d49af['attrs'][0x0][_0xdeb4('0x5e')]:undefined)||''}];case _0xdeb4('0x62'):return[{'name':_0xdeb4('0x63'),'value':_0x3d49af[_0xdeb4('0x63')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af[_0xdeb4('0x5d')][0x0]?_0x3d49af[_0xdeb4('0x5d')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xdeb4('0x64'),'value':_0x3d49af['attrTimezone']||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af[_0xdeb4('0x5d')][0x1]?_0x3d49af[_0xdeb4('0x5d')][0x1][_0xdeb4('0x5e')]:undefined)||'0.00'},{'name':_0xdeb4('0x65'),'value':_0x3d49af[_0xdeb4('0x65')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af['attrs'][0x2]?_0x3d49af[_0xdeb4('0x5d')][0x2][_0xdeb4('0x5e')]:undefined)||0xc}];case'counter':return[{'name':_0xdeb4('0x66'),'value':_0x3d49af['attrMetric']||(_0x3d49af['attrs']&&_0x3d49af[_0xdeb4('0x5d')][0x0]?_0x3d49af[_0xdeb4('0x5d')][0x0][_0xdeb4('0x5e')]:undefined)||_0xdeb4('0x67')},{'name':_0xdeb4('0x68'),'value':_0x3d49af[_0xdeb4('0x68')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af[_0xdeb4('0x5d')][0x1]?_0x3d49af[_0xdeb4('0x5d')][0x1][_0xdeb4('0x5e')]:undefined)||[]},{'name':_0xdeb4('0x65'),'value':_0x3d49af[_0xdeb4('0x65')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af[_0xdeb4('0x5d')][0x2]?_0x3d49af[_0xdeb4('0x5d')][0x2][_0xdeb4('0x5e')]:undefined)||0x14}];case _0xdeb4('0x69'):case _0xdeb4('0x6a'):return[{'name':_0xdeb4('0x6b'),'value':_0x3d49af[_0xdeb4('0x6b')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af[_0xdeb4('0x5d')][0x0]?_0x3d49af['attrs'][0x0][_0xdeb4('0x5e')]:undefined)||_0xdeb4('0x67')},{'name':_0xdeb4('0x6c'),'value':_0x3d49af[_0xdeb4('0x6c')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af['attrs'][0x1]?_0x3d49af[_0xdeb4('0x5d')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x3d49af[_0xdeb4('0x6d')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af['attrs'][0x2]?_0x3d49af[_0xdeb4('0x5d')][0x2][_0xdeb4('0x5e')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x3d49af[_0xdeb4('0x68')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af[_0xdeb4('0x5d')][0x3]?_0x3d49af[_0xdeb4('0x5d')][0x3][_0xdeb4('0x5e')]:undefined)||[]}];case _0xdeb4('0x6e'):return[{'name':_0xdeb4('0x6f'),'type':_0x3d49af[_0xdeb4('0x70')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af[_0xdeb4('0x5d')][0x0]?_0x3d49af[_0xdeb4('0x5d')][0x0][_0xdeb4('0x33')]:undefined)||null,'value':_0x3d49af[_0xdeb4('0x6f')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af[_0xdeb4('0x5d')][0x0]?_0x3d49af[_0xdeb4('0x5d')][0x0][_0xdeb4('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x3d49af[_0xdeb4('0x71')]||(_0x3d49af[_0xdeb4('0x5d')]&&_0x3d49af[_0xdeb4('0x5d')][0x1]?_0x3d49af['attrs'][0x1][_0xdeb4('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x857e92){logger[_0xdeb4('0x2c')](_0xdeb4('0x72'),JSON[_0xdeb4('0x73')](_0x857e92));return[];}}exports[_0xdeb4('0x74')]=function(_0x5791f2,_0x146602,_0x599a9a){if(_0x5791f2[_0xdeb4('0x58')]['id']){delete _0x5791f2[_0xdeb4('0x58')]['id'];}return db[_0xdeb4('0x31')][_0xdeb4('0x4c')]({'where':{'id':_0x5791f2['params']['id']}})['then'](handleEntityNotFound(_0x146602,null))[_0xdeb4('0x26')](function(_0x2bfe1c){if(_0x2bfe1c){_0x5791f2[_0xdeb4('0x58')][_0xdeb4('0x75')]=_0x2bfe1c['id'];_0x5791f2['body'][_0xdeb4('0x5d')]=widgetAttributes(_0x5791f2['body']);return db['DashboardItem'][_0xdeb4('0x4e')](_0x5791f2[_0xdeb4('0x58')]);}})['then'](respondWithResult(_0x146602,null))['catch'](handleError(_0x146602,null));};exports['getItems']=function(_0x6f9c52,_0x10b7a2,_0x196147){var _0x475d46={};var _0x59aa81={};var _0x5104ca;var _0x27d008;return db['Dashboard'][_0xdeb4('0x76')]({'where':{'id':_0x6f9c52[_0xdeb4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x10b7a2,null))[_0xdeb4('0x26')](function(_0x20f9c3){if(_0x20f9c3){_0x5104ca=_0x20f9c3;_0x59aa81['model']=_[_0xdeb4('0x38')](db[_0xdeb4('0x77')][_0xdeb4('0x32')]);_0x59aa81[_0xdeb4('0x37')]=_[_0xdeb4('0x38')](_0x6f9c52[_0xdeb4('0x37')]);_0x59aa81[_0xdeb4('0x42')]=_[_0xdeb4('0x3a')](_0x59aa81[_0xdeb4('0x35')],_0x59aa81['query']);_0x475d46[_0xdeb4('0x39')]=_['intersection'](_0x59aa81[_0xdeb4('0x35')],qs['fields'](_0x6f9c52[_0xdeb4('0x37')]['fields']));_0x475d46[_0xdeb4('0x39')]=_0x475d46[_0xdeb4('0x39')][_0xdeb4('0x4b')]?_0x475d46['attributes']:_0x59aa81['model'];_0x475d46['order']=qs[_0xdeb4('0x3f')](_0x6f9c52['query'][_0xdeb4('0x3f')]);_0x475d46['where']=qs[_0xdeb4('0x42')](_[_0xdeb4('0x41')](_0x6f9c52[_0xdeb4('0x37')],_0x59aa81[_0xdeb4('0x42')]));if(_0x6f9c52['query'][_0xdeb4('0x43')]){_0x475d46[_0xdeb4('0x40')]=_[_0xdeb4('0x44')](_0x475d46[_0xdeb4('0x40')],{'$or':_[_0xdeb4('0x36')](_0x475d46['attributes'],function(_0x2e3fe2){var _0x2ed53c={};_0x2ed53c[_0x2e3fe2]={'$like':'%'+_0x6f9c52[_0xdeb4('0x37')]['filter']+'%'};return _0x2ed53c;})});}_0x475d46=_[_0xdeb4('0x44')]({},_0x475d46,_0x6f9c52[_0xdeb4('0x45')]);return _0x5104ca[_0xdeb4('0x78')](_0x475d46);}})[_0xdeb4('0x26')](function(_0x20dc17){if(_0x20dc17){_0x27d008=_0x20dc17[_0xdeb4('0x4b')];if(!_0x6f9c52[_0xdeb4('0x37')]['hasOwnProperty'](_0xdeb4('0x3d'))){_0x475d46[_0xdeb4('0x21')]=qs[_0xdeb4('0x21')](_0x6f9c52[_0xdeb4('0x37')][_0xdeb4('0x21')]);_0x475d46['offset']=qs[_0xdeb4('0x20')](_0x6f9c52[_0xdeb4('0x37')][_0xdeb4('0x20')]);}return _0x5104ca[_0xdeb4('0x78')](_0x475d46);}})[_0xdeb4('0x26')](function(_0x20a6f0){if(_0x20a6f0){return _0x20a6f0?{'count':_0x27d008,'rows':_0x20a6f0}:null;}})[_0xdeb4('0x26')](respondWithResult(_0x10b7a2,null))['catch'](handleError(_0x10b7a2,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 9d5d1df..ae3f582 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 _0xc1f9=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','Dashboard'];(function(_0x2d2313,_0x52441f){var _0xfa848e=function(_0x3be18a){while(--_0x3be18a){_0x2d2313['push'](_0x2d2313['shift']());}};_0xfa848e(++_0x52441f);}(_0xc1f9,0xbc));var _0x9c1f=function(_0x5ea993,_0x548b76){_0x5ea993=_0x5ea993-0x0;var _0x292fcd=_0xc1f9[_0x5ea993];return _0x292fcd;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x9c1f('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9c1f('0x1')](0x0);var events={'afterCreate':_0x9c1f('0x2'),'afterUpdate':_0x9c1f('0x3'),'afterDestroy':_0x9c1f('0x4')};function emitEvent(_0x1d9519){return function(_0x3ef10d,_0x5daf6f,_0x1d8494){DashboardEvents[_0x9c1f('0x5')](_0x1d9519+':'+_0x3ef10d['id'],_0x3ef10d);DashboardEvents[_0x9c1f('0x5')](_0x1d9519,_0x3ef10d);_0x1d8494(null);};}for(var e in events){if(events[_0x9c1f('0x6')](e)){var event=events[e];Dashboard[_0x9c1f('0x7')](e,emitEvent(event));}}module[_0x9c1f('0x8')]=DashboardEvents; \ No newline at end of file +var _0x3788=['events','../../mysqldb','Dashboard','setMaxListeners','update','emit','hook','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3788,0x168));var _0x8378=function(_0xba5c66,_0x5e7ad4){_0xba5c66=_0xba5c66-0x0;var _0x56b882=_0x3788[_0xba5c66];return _0x56b882;};'use strict';var EventEmitter=require(_0x8378('0x0'));var Dashboard=require(_0x8378('0x1'))['db'][_0x8378('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8378('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8378('0x4'),'afterDestroy':'remove'};function emitEvent(_0x50dc3d){return function(_0x58c99a,_0x39541d,_0xe184d6){DashboardEvents[_0x8378('0x5')](_0x50dc3d+':'+_0x58c99a['id'],_0x58c99a);DashboardEvents['emit'](_0x50dc3d,_0x58c99a);_0xe184d6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x8378('0x6')](e,emitEvent(event));}}module[_0x8378('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 55aa062..0940b25 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 _0xb3dc=['util','../../config/logger','api','bluebird','rimraf','./dashboard.attributes','exports','define','Dashboard','lodash'];(function(_0x9e76d,_0x44e7a0){var _0x320985=function(_0x32c6c9){while(--_0x32c6c9){_0x9e76d['push'](_0x9e76d['shift']());}};_0x320985(++_0x44e7a0);}(_0xb3dc,0x135));var _0xcb3d=function(_0x1969d6,_0x44c4e7){_0x1969d6=_0x1969d6-0x0;var _0x4ddba5=_0xb3dc[_0x1969d6];return _0x4ddba5;};'use strict';var _=require(_0xcb3d('0x0'));var util=require(_0xcb3d('0x1'));var logger=require(_0xcb3d('0x2'))(_0xcb3d('0x3'));var moment=require('moment');var BPromise=require(_0xcb3d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcb3d('0x5'));var config=require('../../config/environment');var attributes=require(_0xcb3d('0x6'));module[_0xcb3d('0x7')]=function(_0x19af84,_0x5509e1){return _0x19af84[_0xcb3d('0x8')](_0xcb3d('0x9'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56ad=['rimraf','../../config/environment','exports','define','Dashboard','dashboards','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x85edeb,_0x1e63cd){var _0x19973b=function(_0xa8d56f){while(--_0xa8d56f){_0x85edeb['push'](_0x85edeb['shift']());}};_0x19973b(++_0x1e63cd);}(_0x56ad,0x10a));var _0xd56a=function(_0x40ceb7,_0x3eeb17){_0x40ceb7=_0x40ceb7-0x0;var _0x4e8570=_0x56ad[_0x40ceb7];return _0x4e8570;};'use strict';var _=require(_0xd56a('0x0'));var util=require(_0xd56a('0x1'));var logger=require('../../config/logger')(_0xd56a('0x2'));var moment=require(_0xd56a('0x3'));var BPromise=require(_0xd56a('0x4'));var rp=require(_0xd56a('0x5'));var fs=require('fs');var path=require(_0xd56a('0x6'));var rimraf=require(_0xd56a('0x7'));var config=require(_0xd56a('0x8'));var attributes=require('./dashboard.attributes');module[_0xd56a('0x9')]=function(_0x1abd2b,_0x3c9426){return _0x1abd2b[_0xd56a('0xa')](_0xd56a('0xb'),attributes,{'tableName':_0xd56a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 9069a2d..d78ff35 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 _0x884b=['http','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x492c2e,_0x38a481){var _0x353426=function(_0x5ec986){while(--_0x5ec986){_0x492c2e['push'](_0x492c2e['shift']());}};_0x353426(++_0x38a481);}(_0x884b,0x154));var _0xb884=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x884b[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0xb884('0x0'));var util=require(_0xb884('0x1'));var moment=require(_0xb884('0x2'));var BPromise=require('bluebird');var rs=require(_0xb884('0x3'));var fs=require('fs');var Redis=require(_0xb884('0x4'));var db=require(_0xb884('0x5'))['db'];var utils=require(_0xb884('0x6'));var logger=require(_0xb884('0x7'))(_0xb884('0x8'));var config=require(_0xb884('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb884('0xa')][_0xb884('0xb')]({'port':0x232a});config['redis']=_[_0xb884('0xc')](config['redis'],{'host':_0xb884('0xd'),'port':0x18eb});var socket=require(_0xb884('0xe'))(new Redis(config['redis']));require(_0xb884('0xf'))[_0xb884('0x10')](socket);function respondWithRpcPromise(_0x548cf,_0x15e3c6,_0x4f18de){return new BPromise(function(_0x4977cf,_0x505f4e){return client[_0xb884('0x11')](_0x548cf,_0x4f18de)['then'](function(_0x4cee0a){logger[_0xb884('0x12')](_0xb884('0x13'),_0x15e3c6,_0xb884('0x14'));logger[_0xb884('0x15')](_0xb884('0x16'),_0x15e3c6,_0xb884('0x14'),JSON['stringify'](_0x4cee0a));if(_0x4cee0a[_0xb884('0x17')]){if(_0x4cee0a['error'][_0xb884('0x18')]===0x1f4){logger[_0xb884('0x17')](_0xb884('0x13'),_0x15e3c6,_0x4cee0a['error'][_0xb884('0x19')]);return _0x505f4e(_0x4cee0a[_0xb884('0x17')][_0xb884('0x19')]);}logger[_0xb884('0x17')](_0xb884('0x13'),_0x15e3c6,_0x4cee0a['error'][_0xb884('0x19')]);return _0x4977cf(_0x4cee0a[_0xb884('0x17')][_0xb884('0x19')]);}else{logger[_0xb884('0x12')](_0xb884('0x13'),_0x15e3c6,_0xb884('0x14'));_0x4977cf(_0x4cee0a[_0xb884('0x1a')][_0xb884('0x19')]);}})['catch'](function(_0x461524){logger[_0xb884('0x17')](_0xb884('0x13'),_0x15e3c6,_0x461524);_0x505f4e(_0x461524);});});} \ No newline at end of file +var _0x626d=['socket.io-emitter','redis','./dashboard.socket','register','request','info','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost'];(function(_0x17bfa4,_0x3eb5f7){var _0x3d9ca8=function(_0x235cd4){while(--_0x235cd4){_0x17bfa4['push'](_0x17bfa4['shift']());}};_0x3d9ca8(++_0x3eb5f7);}(_0x626d,0x15f));var _0xd626=function(_0x2106aa,_0x41c9fa){_0x2106aa=_0x2106aa-0x0;var _0x18ce53=_0x626d[_0x2106aa];return _0x18ce53;};'use strict';var _=require(_0xd626('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd626('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd626('0x2'))(_0xd626('0x3'));var config=require(_0xd626('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xd626('0x5')][_0xd626('0x6')]({'port':0x232a});config['redis']=_[_0xd626('0x7')](config['redis'],{'host':_0xd626('0x8'),'port':0x18eb});var socket=require(_0xd626('0x9'))(new Redis(config[_0xd626('0xa')]));require(_0xd626('0xb'))[_0xd626('0xc')](socket);function respondWithRpcPromise(_0x31f2b3,_0x54d050,_0x188af2){return new BPromise(function(_0x3e8d5f,_0x48ede7){return client[_0xd626('0xd')](_0x31f2b3,_0x188af2)['then'](function(_0xb9627f){logger[_0xd626('0xe')]('Dashboard,\x20%s,\x20%s',_0x54d050,_0xd626('0xf'));logger['debug'](_0xd626('0x10'),_0x54d050,_0xd626('0xf'),JSON[_0xd626('0x11')](_0xb9627f));if(_0xb9627f[_0xd626('0x12')]){if(_0xb9627f[_0xd626('0x12')][_0xd626('0x13')]===0x1f4){logger['error'](_0xd626('0x14'),_0x54d050,_0xb9627f[_0xd626('0x12')][_0xd626('0x15')]);return _0x48ede7(_0xb9627f['error'][_0xd626('0x15')]);}logger[_0xd626('0x12')]('Dashboard,\x20%s,\x20%s',_0x54d050,_0xb9627f[_0xd626('0x12')]['message']);return _0x3e8d5f(_0xb9627f[_0xd626('0x12')]['message']);}else{logger[_0xd626('0xe')](_0xd626('0x14'),_0x54d050,_0xd626('0xf'));_0x3e8d5f(_0xb9627f[_0xd626('0x16')][_0xd626('0x15')]);}})[_0xd626('0x17')](function(_0x272483){logger[_0xd626('0x12')](_0xd626('0x14'),_0x54d050,_0x272483);_0x48ede7(_0x272483);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 315ac5b..55847fa 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 _0x8a93=['length','dashboard:','./dashboard.events','remove','emit','removeListener','register'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8a93,0x19f));var _0x38a9=function(_0x559702,_0x2fa1a9){_0x559702=_0x559702-0x0;var _0x25a86b=_0x8a93[_0x559702];return _0x25a86b;};'use strict';var DashboardEvents=require(_0x38a9('0x0'));var events=['save',_0x38a9('0x1'),'update'];function createListener(_0x1a5f91,_0x74ecdb){return function(_0x4b44cb){_0x74ecdb[_0x38a9('0x2')](_0x1a5f91,_0x4b44cb);};}function removeListener(_0x1693a1,_0x3a8fb2){return function(){DashboardEvents[_0x38a9('0x3')](_0x1693a1,_0x3a8fb2);};}exports[_0x38a9('0x4')]=function(_0x148d69){for(var _0x4287d5=0x0,_0x376a14=events[_0x38a9('0x5')];_0x4287d5<_0x376a14;_0x4287d5++){var _0x2a9cb6=events[_0x4287d5];var _0x125598=createListener(_0x38a9('0x6')+_0x2a9cb6,_0x148d69);DashboardEvents['on'](_0x2a9cb6,_0x125598);}}; \ No newline at end of file +var _0x86d5=['removeListener','register','length','dashboard:','save','remove'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x86d5,0x17e));var _0x586d=function(_0x2ed7c9,_0x2c05dc){_0x2ed7c9=_0x2ed7c9-0x0;var _0x5418a0=_0x86d5[_0x2ed7c9];return _0x5418a0;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x586d('0x0'),_0x586d('0x1'),'update'];function createListener(_0x574f84,_0x34b584){return function(_0x409f1e){_0x34b584['emit'](_0x574f84,_0x409f1e);};}function removeListener(_0x17671c,_0x38f5ec){return function(){DashboardEvents[_0x586d('0x2')](_0x17671c,_0x38f5ec);};}exports[_0x586d('0x3')]=function(_0x306a64){for(var _0x31e52f=0x0,_0x2f365a=events[_0x586d('0x4')];_0x31e52f<_0x2f365a;_0x31e52f++){var _0x256dd5=events[_0x31e52f];var _0x36de8e=createListener(_0x586d('0x5')+_0x256dd5,_0x306a64);DashboardEvents['on'](_0x256dd5,_0x36de8e);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index f906777..d24c326 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 _0xed1f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post','clone','addItem','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5993bd,_0x16c874){var _0x4172a5=function(_0x46bbbf){while(--_0x46bbbf){_0x5993bd['push'](_0x5993bd['shift']());}};_0x4172a5(++_0x16c874);}(_0xed1f,0x6a));var _0xfed1=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xed1f[_0x47fd36];return _0x21a0fc;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')]('/',auth[_0xfed1('0xc')](),controller[_0xfed1('0xd')]);router[_0xfed1('0xb')](_0xfed1('0xe'),auth[_0xfed1('0xc')](),controller[_0xfed1('0xf')]);router['get'](_0xfed1('0x10'),auth[_0xfed1('0xc')](),controller['getItems']);router[_0xfed1('0x11')]('/',auth[_0xfed1('0xc')](),controller['create']);router[_0xfed1('0x11')]('/:id/clone',auth[_0xfed1('0xc')](),controller[_0xfed1('0x12')]);router['post']('/:id/items',auth[_0xfed1('0xc')](),controller[_0xfed1('0x13')]);router['put'](_0xfed1('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xfed1('0x14')](_0xfed1('0xe'),auth['isAuthenticated'](),controller[_0xfed1('0x15')]);module['exports']=router; \ No newline at end of file +var _0x425d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','destroy'];(function(_0x5c980f,_0x1efe27){var _0x50e3de=function(_0x5e5442){while(--_0x5e5442){_0x5c980f['push'](_0x5c980f['shift']());}};_0x50e3de(++_0x1efe27);}(_0x425d,0x1e0));var _0xd425=function(_0x49bd65,_0x4285dc){_0x49bd65=_0x49bd65-0x0;var _0x4f08b0=_0x425d[_0x49bd65];return _0x4f08b0;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0xb')]);router[_0xd425('0x9')](_0xd425('0xc'),auth['isAuthenticated'](),controller[_0xd425('0xd')]);router[_0xd425('0x9')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0xf')]);router[_0xd425('0x10')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0x11')]);router[_0xd425('0x10')](_0xd425('0x12'),auth[_0xd425('0xa')](),controller[_0xd425('0x13')]);router[_0xd425('0x10')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x14')]);router[_0xd425('0x15')](_0xd425('0xc'),auth[_0xd425('0xa')](),controller[_0xd425('0x16')]);router['delete'](_0xd425('0xc'),auth[_0xd425('0xa')](),controller[_0xd425('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 5d53121..470e877 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 _0xf608=['#ffffff','#2196f3','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify','INTEGER'];(function(_0x5534ce,_0x26ef5e){var _0x33042b=function(_0x48c033){while(--_0x48c033){_0x5534ce['push'](_0x5534ce['shift']());}};_0x33042b(++_0x26ef5e);}(_0xf608,0x106));var _0x8f60=function(_0x439614,_0x4a3f3d){_0x439614=_0x439614-0x0;var _0x4a7560=_0xf608[_0x439614];return _0x4a7560;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x8f60('0x0'));var _=require(_0x8f60('0x1'));module[_0x8f60('0x2')]={'title':{'type':Sequelize[_0x8f60('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8f60('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x8f60('0x4')](_0x8f60('0x5')),'get':function(){try{return JSON[_0x8f60('0x6')](this[_0x8f60('0x7')](_0x8f60('0x8')));}catch(_0x45386e){return[];}},'set':function(_0x25642a){try{this['setDataValue'](_0x8f60('0x8'),JSON['stringify'](_0x25642a));}catch(_0x8cd308){this['setDataValue']('attrs',JSON[_0x8f60('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x8f60('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x8f60('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x8f60('0xa')]},'col':{'type':Sequelize[_0x8f60('0xa')]},'background':{'type':Sequelize[_0x8f60('0x3')],'allowNull':![],'defaultValue':_0x8f60('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8f60('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x8f60('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x9bec=['sequelize','squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x3bc549,_0x456bb2){var _0x4c417c=function(_0x5f455d){while(--_0x5f455d){_0x3bc549['push'](_0x3bc549['shift']());}};_0x4c417c(++_0x456bb2);}(_0x9bec,0x134));var _0xc9be=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x9bec[_0x39096d];return _0x13da4f;};'use strict';var Sequelize=require(_0xc9be('0x0'));var squel=require(_0xc9be('0x1'));var _=require(_0xc9be('0x2'));module[_0xc9be('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc9be('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xc9be('0x5')),'get':function(){try{return JSON[_0xc9be('0x6')](this[_0xc9be('0x7')](_0xc9be('0x8')));}catch(_0x12d890){return[];}},'set':function(_0x5077b2){try{this[_0xc9be('0x9')]('attrs',JSON[_0xc9be('0xa')](_0x5077b2));}catch(_0x4b876c){this[_0xc9be('0x9')](_0xc9be('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xc9be('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc9be('0xb')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xc9be('0x4')],'allowNull':![],'defaultValue':_0xc9be('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xc9be('0x4')],'allowNull':![],'defaultValue':_0xc9be('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xc9be('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 911779c..0e04457 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 _0x96c9=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','show','keys','DashboardItem','rawAttributes','intersection','query','attributes','fields','model','includeAll','merge','find','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','body','create','params','eml-format','rimraf','zip-dir','request-promise'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x96c9,0x104));var _0x996c=function(_0x132d8b,_0x268e1c){_0x132d8b=_0x132d8b-0x0;var _0x6c5b91=_0x96c9[_0x132d8b];return _0x6c5b91;};'use strict';var emlformat=require(_0x996c('0x0'));var rimraf=require(_0x996c('0x1'));var zipdir=require(_0x996c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x996c('0x3'));var moment=require(_0x996c('0x4'));var BPromise=require(_0x996c('0x5'));var Mustache=require(_0x996c('0x6'));var util=require(_0x996c('0x7'));var path=require(_0x996c('0x8'));var sox=require('sox');var csv=require(_0x996c('0x9'));var ejs=require(_0x996c('0xa'));var fs=require('fs');var fs_extra=require(_0x996c('0xb'));var _=require('lodash');var squel=require(_0x996c('0xc'));var crypto=require(_0x996c('0xd'));var jsforce=require(_0x996c('0xe'));var deskjs=require(_0x996c('0xf'));var toCsv=require(_0x996c('0x9'));var querystring=require(_0x996c('0x10'));var Papa=require(_0x996c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x996c('0x12'));var as=require(_0x996c('0x13'));var hardwareService=require(_0x996c('0x14'));var logger=require(_0x996c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x996c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x996c('0x17'))['db'];config[_0x996c('0x18')]=_[_0x996c('0x19')](config[_0x996c('0x18')],{'host':_0x996c('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x996c('0x1b'))[_0x996c('0x1c')](socket);function respondWithStatusCode(_0xcff3ae,_0x434193){_0x434193=_0x434193||0xcc;return function(_0x5489d5){if(_0x5489d5){return _0xcff3ae[_0x996c('0x1d')](_0x434193);}return _0xcff3ae[_0x996c('0x1e')](_0x434193)[_0x996c('0x1f')]();};}function respondWithResult(_0x2479f7,_0x3127c0){_0x3127c0=_0x3127c0||0xc8;return function(_0x58231e){if(_0x58231e){return _0x2479f7[_0x996c('0x1e')](_0x3127c0)[_0x996c('0x20')](_0x58231e);}};}function respondWithFilteredResult(_0x585b83,_0x39ad74){return function(_0x2eeaae){if(_0x2eeaae){var _0x10e3b7=_0x2eeaae[_0x996c('0x21')],_0x2b0904=_0x39ad74[_0x996c('0x22')],_0x4322cd=_0x39ad74['offset']+_0x39ad74[_0x996c('0x23')],_0x186739;if(_0x4322cd>=_0x10e3b7){_0x4322cd=_0x10e3b7;_0x186739=0xc8;}else{_0x186739=0xce;}_0x585b83[_0x996c('0x1e')](_0x186739);return _0x585b83[_0x996c('0x24')]('Content-Range',_0x2b0904+'-'+_0x4322cd+'/'+_0x10e3b7)[_0x996c('0x20')](_0x2eeaae);}return null;};}function patchUpdates(_0x2924dd){return function(_0x371995){try{jsonpatch[_0x996c('0x25')](_0x371995,_0x2924dd,!![]);}catch(_0x437661){return BPromise[_0x996c('0x26')](_0x437661);}return _0x371995[_0x996c('0x27')]();};}function saveUpdates(_0x43f4f6,_0x36c7ec){return function(_0x37a721){if(_0x37a721){return _0x37a721[_0x996c('0x28')](_0x43f4f6)[_0x996c('0x29')](function(_0x1df131){return _0x1df131;});}return null;};}function removeEntity(_0x454add,_0x32ada1){return function(_0x1da5db){if(_0x1da5db){return _0x1da5db[_0x996c('0x2a')]()[_0x996c('0x29')](function(){_0x454add[_0x996c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x139204,_0x2ed47f){return function(_0x220faa){if(!_0x220faa){_0x139204[_0x996c('0x1d')](0x194);}return _0x220faa;};}function handleError(_0x50eff1,_0x2234e0){_0x2234e0=_0x2234e0||0x1f4;return function(_0x2eb8ae){logger[_0x996c('0x2b')](_0x2eb8ae[_0x996c('0x2c')]);if(_0x2eb8ae[_0x996c('0x2d')]){delete _0x2eb8ae[_0x996c('0x2d')];}_0x50eff1[_0x996c('0x1e')](_0x2234e0)[_0x996c('0x2e')](_0x2eb8ae);};}exports[_0x996c('0x2f')]=function(_0x5c25e6,_0x3bfb4f){var _0x1e663d={'raw':![],'where':{'id':_0x5c25e6['params']['id']}},_0x2f9f69={};_0x2f9f69['model']=_[_0x996c('0x30')](db[_0x996c('0x31')][_0x996c('0x32')]);_0x2f9f69['query']=_[_0x996c('0x30')](_0x5c25e6['query']);_0x2f9f69['filters']=_[_0x996c('0x33')](_0x2f9f69['model'],_0x2f9f69[_0x996c('0x34')]);_0x1e663d[_0x996c('0x35')]=_[_0x996c('0x33')](_0x2f9f69['model'],qs['fields'](_0x5c25e6[_0x996c('0x34')][_0x996c('0x36')]));_0x1e663d['attributes']=_0x1e663d[_0x996c('0x35')]['length']?_0x1e663d[_0x996c('0x35')]:_0x2f9f69[_0x996c('0x37')];if(_0x5c25e6[_0x996c('0x34')][_0x996c('0x38')]){_0x1e663d['include']=[{'all':!![]}];}_0x1e663d=_[_0x996c('0x39')]({},_0x1e663d,_0x5c25e6['options']);return db[_0x996c('0x31')][_0x996c('0x3a')](_0x1e663d)[_0x996c('0x29')](handleEntityNotFound(_0x3bfb4f,null))[_0x996c('0x29')](respondWithResult(_0x3bfb4f,null))['catch'](handleError(_0x3bfb4f,null));};exports[_0x996c('0x2a')]=function(_0xfa356b,_0x2c8c04){return db[_0x996c('0x31')][_0x996c('0x3a')]({'where':{'id':_0xfa356b['params']['id']}})[_0x996c('0x29')](handleEntityNotFound(_0x2c8c04,null))[_0x996c('0x29')](removeEntity(_0x2c8c04,null))[_0x996c('0x3b')](handleError(_0x2c8c04,null));};function widgetAttributes(_0x1749f6){try{switch(_0x1749f6['type']){case _0x996c('0x3c'):return[{'name':_0x996c('0x3d'),'value':_0x1749f6['attrUrl']||(_0x1749f6[_0x996c('0x3e')]&&_0x1749f6[_0x996c('0x3e')][0x0]?_0x1749f6['attrs'][0x0][_0x996c('0x3f')]:undefined)||_0x996c('0x40')}];case _0x996c('0x41'):return[{'name':'attrPath','value':_0x1749f6[_0x996c('0x42')]||(_0x1749f6[_0x996c('0x3e')]&&_0x1749f6['attrs'][0x0]?_0x1749f6['attrs'][0x0][_0x996c('0x3f')]:undefined)||''}];case'clock':return[{'name':_0x996c('0x43'),'value':_0x1749f6[_0x996c('0x43')]||(_0x1749f6[_0x996c('0x3e')]&&_0x1749f6[_0x996c('0x3e')][0x0]?_0x1749f6[_0x996c('0x3e')][0x0][_0x996c('0x3f')]:undefined)||'HH:mm:ss'},{'name':_0x996c('0x44'),'value':_0x1749f6['attrTimezone']||(_0x1749f6['attrs']&&_0x1749f6[_0x996c('0x3e')][0x1]?_0x1749f6[_0x996c('0x3e')][0x1][_0x996c('0x3f')]:undefined)||_0x996c('0x45')},{'name':_0x996c('0x46'),'value':_0x1749f6[_0x996c('0x46')]||(_0x1749f6[_0x996c('0x3e')]&&_0x1749f6[_0x996c('0x3e')][0x2]?_0x1749f6['attrs'][0x2]['value']:undefined)||0xc}];case _0x996c('0x47'):return[{'name':'attrMetric','value':_0x1749f6[_0x996c('0x48')]||(_0x1749f6[_0x996c('0x3e')]&&_0x1749f6['attrs'][0x0]?_0x1749f6[_0x996c('0x3e')][0x0][_0x996c('0x3f')]:undefined)||_0x996c('0x49')},{'name':_0x996c('0x4a'),'value':_0x1749f6[_0x996c('0x4a')]||(_0x1749f6[_0x996c('0x3e')]&&_0x1749f6[_0x996c('0x3e')][0x1]?_0x1749f6[_0x996c('0x3e')][0x1][_0x996c('0x3f')]:undefined)||[]},{'name':_0x996c('0x46'),'value':_0x1749f6[_0x996c('0x46')]||(_0x1749f6[_0x996c('0x3e')]&&_0x1749f6[_0x996c('0x3e')][0x2]?_0x1749f6[_0x996c('0x3e')][0x2][_0x996c('0x3f')]:undefined)||0x14}];case'multibar-chart':case _0x996c('0x4b'):return[{'name':_0x996c('0x4c'),'value':_0x1749f6['attrSerie1']||(_0x1749f6['attrs']&&_0x1749f6[_0x996c('0x3e')][0x0]?_0x1749f6[_0x996c('0x3e')][0x0][_0x996c('0x3f')]:undefined)||_0x996c('0x49')},{'name':_0x996c('0x4d'),'value':_0x1749f6[_0x996c('0x4d')]||(_0x1749f6[_0x996c('0x3e')]&&_0x1749f6[_0x996c('0x3e')][0x1]?_0x1749f6['attrs'][0x1][_0x996c('0x3f')]:undefined)||null},{'name':_0x996c('0x4e'),'value':_0x1749f6[_0x996c('0x4e')]||(_0x1749f6[_0x996c('0x3e')]&&_0x1749f6[_0x996c('0x3e')][0x2]?_0x1749f6[_0x996c('0x3e')][0x2]['value']:undefined)||null},{'name':_0x996c('0x4a'),'value':_0x1749f6['attrVoiceQueues']||(_0x1749f6['attrs']&&_0x1749f6[_0x996c('0x3e')][0x3]?_0x1749f6[_0x996c('0x3e')][0x3]['value']:undefined)||[]}];case _0x996c('0x4f'):return[{'name':_0x996c('0x50'),'type':_0x1749f6[_0x996c('0x51')]||(_0x1749f6[_0x996c('0x3e')]&&_0x1749f6[_0x996c('0x3e')][0x0]?_0x1749f6[_0x996c('0x3e')][0x0][_0x996c('0x52')]:undefined)||null,'value':_0x1749f6[_0x996c('0x50')]||(_0x1749f6['attrs']&&_0x1749f6[_0x996c('0x3e')][0x0]?_0x1749f6[_0x996c('0x3e')][0x0][_0x996c('0x3f')]:undefined)||null},{'name':_0x996c('0x53'),'value':_0x1749f6[_0x996c('0x53')]||(_0x1749f6[_0x996c('0x3e')]&&_0x1749f6[_0x996c('0x3e')][0x1]?_0x1749f6[_0x996c('0x3e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x496f82){logger[_0x996c('0x2b')](_0x996c('0x54'),JSON['stringify'](_0x496f82));return[];}}exports['create']=function(_0x2990ea,_0x146947){if(_0x2990ea['body']){_0x2990ea[_0x996c('0x55')][_0x996c('0x3e')]=widgetAttributes(_0x2990ea[_0x996c('0x55')]);}return db['DashboardItem'][_0x996c('0x56')](_0x2990ea[_0x996c('0x55')],{})[_0x996c('0x29')](respondWithResult(_0x146947,0xc9))[_0x996c('0x3b')](handleError(_0x146947,null));};exports['update']=function(_0x33a530,_0x252908){if(_0x33a530['body']['id']){delete _0x33a530[_0x996c('0x55')]['id'];}_0x33a530[_0x996c('0x55')]['attrs']=widgetAttributes(_0x33a530[_0x996c('0x55')]);return db[_0x996c('0x31')]['find']({'where':{'id':_0x33a530[_0x996c('0x57')]['id']}})[_0x996c('0x29')](handleEntityNotFound(_0x252908,null))['then'](saveUpdates(_0x33a530[_0x996c('0x55')],null))[_0x996c('0x29')](respondWithResult(_0x252908,null))[_0x996c('0x3b')](handleError(_0x252908,null));}; \ No newline at end of file +var _0xbd25=['apply','reject','save','update','then','end','error','stack','name','show','params','model','keys','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','options','DashboardItem','find','catch','destroy','type','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','stringify','body','create','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','json','count','offset','limit','set','Content-Range'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0xbd25,0x1ec));var _0x5bd2=function(_0x2c0fd2,_0x21f4b9){_0x2c0fd2=_0x2c0fd2-0x0;var _0x38a1d8=_0xbd25[_0x2c0fd2];return _0x38a1d8;};'use strict';var emlformat=require(_0x5bd2('0x0'));var rimraf=require(_0x5bd2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5bd2('0x2'));var BPromise=require(_0x5bd2('0x3'));var Mustache=require('mustache');var util=require(_0x5bd2('0x4'));var path=require(_0x5bd2('0x5'));var sox=require(_0x5bd2('0x6'));var csv=require(_0x5bd2('0x7'));var ejs=require(_0x5bd2('0x8'));var fs=require('fs');var fs_extra=require(_0x5bd2('0x9'));var _=require(_0x5bd2('0xa'));var squel=require(_0x5bd2('0xb'));var crypto=require('crypto');var jsforce=require(_0x5bd2('0xc'));var deskjs=require(_0x5bd2('0xd'));var toCsv=require(_0x5bd2('0x7'));var querystring=require(_0x5bd2('0xe'));var Papa=require(_0x5bd2('0xf'));var Redis=require(_0x5bd2('0x10'));var authService=require(_0x5bd2('0x11'));var qs=require(_0x5bd2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bd2('0x13'))('api');var utils=require(_0x5bd2('0x14'));var config=require(_0x5bd2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bd2('0x16'))['db'];config[_0x5bd2('0x17')]=_[_0x5bd2('0x18')](config[_0x5bd2('0x17')],{'host':_0x5bd2('0x19'),'port':0x18eb});var socket=require(_0x5bd2('0x1a'))(new Redis(config[_0x5bd2('0x17')]));require(_0x5bd2('0x1b'))['register'](socket);function respondWithStatusCode(_0x12f21d,_0x2b54ea){_0x2b54ea=_0x2b54ea||0xcc;return function(_0x320af4){if(_0x320af4){return _0x12f21d[_0x5bd2('0x1c')](_0x2b54ea);}return _0x12f21d[_0x5bd2('0x1d')](_0x2b54ea)['end']();};}function respondWithResult(_0xd5ed74,_0x4d1c40){_0x4d1c40=_0x4d1c40||0xc8;return function(_0x1ae64a){if(_0x1ae64a){return _0xd5ed74[_0x5bd2('0x1d')](_0x4d1c40)[_0x5bd2('0x1e')](_0x1ae64a);}};}function respondWithFilteredResult(_0x53ac7c,_0xbbc0df){return function(_0x765c0c){if(_0x765c0c){var _0x64c5c4=_0x765c0c[_0x5bd2('0x1f')],_0xf08880=_0xbbc0df[_0x5bd2('0x20')],_0x134473=_0xbbc0df[_0x5bd2('0x20')]+_0xbbc0df[_0x5bd2('0x21')],_0x2ee8b7;if(_0x134473>=_0x64c5c4){_0x134473=_0x64c5c4;_0x2ee8b7=0xc8;}else{_0x2ee8b7=0xce;}_0x53ac7c[_0x5bd2('0x1d')](_0x2ee8b7);return _0x53ac7c[_0x5bd2('0x22')](_0x5bd2('0x23'),_0xf08880+'-'+_0x134473+'/'+_0x64c5c4)[_0x5bd2('0x1e')](_0x765c0c);}return null;};}function patchUpdates(_0x1e9dfb){return function(_0x13d4af){try{jsonpatch[_0x5bd2('0x24')](_0x13d4af,_0x1e9dfb,!![]);}catch(_0x275bec){return BPromise[_0x5bd2('0x25')](_0x275bec);}return _0x13d4af[_0x5bd2('0x26')]();};}function saveUpdates(_0x4422b3,_0x70cd65){return function(_0x594035){if(_0x594035){return _0x594035[_0x5bd2('0x27')](_0x4422b3)[_0x5bd2('0x28')](function(_0x2740e2){return _0x2740e2;});}return null;};}function removeEntity(_0x59deb1,_0x59be42){return function(_0xd43275){if(_0xd43275){return _0xd43275['destroy']()[_0x5bd2('0x28')](function(){_0x59deb1[_0x5bd2('0x1d')](0xcc)[_0x5bd2('0x29')]();});}};}function handleEntityNotFound(_0x5f5d0b,_0x4c89ef){return function(_0xa0b23a){if(!_0xa0b23a){_0x5f5d0b[_0x5bd2('0x1c')](0x194);}return _0xa0b23a;};}function handleError(_0x191d7f,_0x366558){_0x366558=_0x366558||0x1f4;return function(_0x37feb0){logger[_0x5bd2('0x2a')](_0x37feb0[_0x5bd2('0x2b')]);if(_0x37feb0[_0x5bd2('0x2c')]){delete _0x37feb0[_0x5bd2('0x2c')];}_0x191d7f[_0x5bd2('0x1d')](_0x366558)['send'](_0x37feb0);};}exports[_0x5bd2('0x2d')]=function(_0x3163de,_0x215ff2){var _0x213212={'raw':![],'where':{'id':_0x3163de[_0x5bd2('0x2e')]['id']}},_0x16d16b={};_0x16d16b[_0x5bd2('0x2f')]=_[_0x5bd2('0x30')](db['DashboardItem'][_0x5bd2('0x31')]);_0x16d16b[_0x5bd2('0x32')]=_[_0x5bd2('0x30')](_0x3163de[_0x5bd2('0x32')]);_0x16d16b['filters']=_[_0x5bd2('0x33')](_0x16d16b['model'],_0x16d16b[_0x5bd2('0x32')]);_0x213212['attributes']=_['intersection'](_0x16d16b[_0x5bd2('0x2f')],qs['fields'](_0x3163de['query'][_0x5bd2('0x34')]));_0x213212[_0x5bd2('0x35')]=_0x213212[_0x5bd2('0x35')][_0x5bd2('0x36')]?_0x213212[_0x5bd2('0x35')]:_0x16d16b[_0x5bd2('0x2f')];if(_0x3163de[_0x5bd2('0x32')][_0x5bd2('0x37')]){_0x213212[_0x5bd2('0x38')]=[{'all':!![]}];}_0x213212=_['merge']({},_0x213212,_0x3163de[_0x5bd2('0x39')]);return db[_0x5bd2('0x3a')][_0x5bd2('0x3b')](_0x213212)[_0x5bd2('0x28')](handleEntityNotFound(_0x215ff2,null))[_0x5bd2('0x28')](respondWithResult(_0x215ff2,null))[_0x5bd2('0x3c')](handleError(_0x215ff2,null));};exports[_0x5bd2('0x3d')]=function(_0x5603fc,_0x20be72){return db[_0x5bd2('0x3a')][_0x5bd2('0x3b')]({'where':{'id':_0x5603fc[_0x5bd2('0x2e')]['id']}})[_0x5bd2('0x28')](handleEntityNotFound(_0x20be72,null))[_0x5bd2('0x28')](removeEntity(_0x20be72,null))[_0x5bd2('0x3c')](handleError(_0x20be72,null));};function widgetAttributes(_0x4e3048){try{switch(_0x4e3048[_0x5bd2('0x3e')]){case _0x5bd2('0x3f'):return[{'name':_0x5bd2('0x40'),'value':_0x4e3048[_0x5bd2('0x40')]||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048[_0x5bd2('0x41')][0x0]?_0x4e3048['attrs'][0x0][_0x5bd2('0x42')]:undefined)||_0x5bd2('0x43')}];case'custom':return[{'name':_0x5bd2('0x44'),'value':_0x4e3048[_0x5bd2('0x44')]||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048[_0x5bd2('0x41')][0x0]?_0x4e3048[_0x5bd2('0x41')][0x0][_0x5bd2('0x42')]:undefined)||''}];case'clock':return[{'name':_0x5bd2('0x45'),'value':_0x4e3048[_0x5bd2('0x45')]||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048[_0x5bd2('0x41')][0x0]?_0x4e3048[_0x5bd2('0x41')][0x0][_0x5bd2('0x42')]:undefined)||_0x5bd2('0x46')},{'name':_0x5bd2('0x47'),'value':_0x4e3048[_0x5bd2('0x47')]||(_0x4e3048['attrs']&&_0x4e3048[_0x5bd2('0x41')][0x1]?_0x4e3048['attrs'][0x1][_0x5bd2('0x42')]:undefined)||_0x5bd2('0x48')},{'name':'attrFontSize','value':_0x4e3048['attrFontSize']||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048[_0x5bd2('0x41')][0x2]?_0x4e3048[_0x5bd2('0x41')][0x2][_0x5bd2('0x42')]:undefined)||0xc}];case _0x5bd2('0x49'):return[{'name':_0x5bd2('0x4a'),'value':_0x4e3048[_0x5bd2('0x4a')]||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048[_0x5bd2('0x41')][0x0]?_0x4e3048[_0x5bd2('0x41')][0x0][_0x5bd2('0x42')]:undefined)||_0x5bd2('0x4b')},{'name':_0x5bd2('0x4c'),'value':_0x4e3048[_0x5bd2('0x4c')]||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048[_0x5bd2('0x41')][0x1]?_0x4e3048[_0x5bd2('0x41')][0x1]['value']:undefined)||[]},{'name':_0x5bd2('0x4d'),'value':_0x4e3048[_0x5bd2('0x4d')]||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048[_0x5bd2('0x41')][0x2]?_0x4e3048[_0x5bd2('0x41')][0x2][_0x5bd2('0x42')]:undefined)||0x14}];case'multibar-chart':case _0x5bd2('0x4e'):return[{'name':_0x5bd2('0x4f'),'value':_0x4e3048['attrSerie1']||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048[_0x5bd2('0x41')][0x0]?_0x4e3048[_0x5bd2('0x41')][0x0][_0x5bd2('0x42')]:undefined)||_0x5bd2('0x4b')},{'name':_0x5bd2('0x50'),'value':_0x4e3048['attrSerie2']||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048[_0x5bd2('0x41')][0x1]?_0x4e3048[_0x5bd2('0x41')][0x1][_0x5bd2('0x42')]:undefined)||null},{'name':_0x5bd2('0x51'),'value':_0x4e3048['attrSerie3']||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048['attrs'][0x2]?_0x4e3048[_0x5bd2('0x41')][0x2][_0x5bd2('0x42')]:undefined)||null},{'name':_0x5bd2('0x4c'),'value':_0x4e3048[_0x5bd2('0x4c')]||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048[_0x5bd2('0x41')][0x3]?_0x4e3048[_0x5bd2('0x41')][0x3][_0x5bd2('0x42')]:undefined)||[]}];case'web-report':return[{'name':_0x5bd2('0x52'),'type':_0x4e3048[_0x5bd2('0x53')]||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048[_0x5bd2('0x41')][0x0]?_0x4e3048[_0x5bd2('0x41')][0x0][_0x5bd2('0x3e')]:undefined)||null,'value':_0x4e3048['attrReport']||(_0x4e3048[_0x5bd2('0x41')]&&_0x4e3048['attrs'][0x0]?_0x4e3048[_0x5bd2('0x41')][0x0][_0x5bd2('0x42')]:undefined)||null},{'name':_0x5bd2('0x54'),'value':_0x4e3048[_0x5bd2('0x54')]||(_0x4e3048['attrs']&&_0x4e3048['attrs'][0x1]?_0x4e3048[_0x5bd2('0x41')][0x1][_0x5bd2('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x16d934){logger[_0x5bd2('0x2a')]('widgetAttributes:\x20%s',JSON[_0x5bd2('0x55')](_0x16d934));return[];}}exports['create']=function(_0x21ba60,_0x1ca75a){if(_0x21ba60[_0x5bd2('0x56')]){_0x21ba60[_0x5bd2('0x56')]['attrs']=widgetAttributes(_0x21ba60[_0x5bd2('0x56')]);}return db[_0x5bd2('0x3a')][_0x5bd2('0x57')](_0x21ba60[_0x5bd2('0x56')],{})['then'](respondWithResult(_0x1ca75a,0xc9))[_0x5bd2('0x3c')](handleError(_0x1ca75a,null));};exports[_0x5bd2('0x27')]=function(_0x23ad13,_0x338c95){if(_0x23ad13[_0x5bd2('0x56')]['id']){delete _0x23ad13[_0x5bd2('0x56')]['id'];}_0x23ad13['body'][_0x5bd2('0x41')]=widgetAttributes(_0x23ad13[_0x5bd2('0x56')]);return db['DashboardItem']['find']({'where':{'id':_0x23ad13[_0x5bd2('0x2e')]['id']}})[_0x5bd2('0x28')](handleEntityNotFound(_0x338c95,null))[_0x5bd2('0x28')](saveUpdates(_0x23ad13[_0x5bd2('0x56')],null))[_0x5bd2('0x28')](respondWithResult(_0x338c95,null))[_0x5bd2('0x3c')](handleError(_0x338c95,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 12b57af..9a6b7e4 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 _0x6fa6=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x4a8cf3,_0x37dc01){var _0x2ae4db=function(_0x52dd70){while(--_0x52dd70){_0x4a8cf3['push'](_0x4a8cf3['shift']());}};_0x2ae4db(++_0x37dc01);}(_0x6fa6,0x102));var _0x66fa=function(_0x1b9be5,_0x561f2f){_0x1b9be5=_0x1b9be5-0x0;var _0x37fa29=_0x6fa6[_0x1b9be5];return _0x37fa29;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x66fa('0x0'))['db'][_0x66fa('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x66fa('0x2')](0x0);var events={'afterCreate':_0x66fa('0x3'),'afterUpdate':_0x66fa('0x4'),'afterDestroy':_0x66fa('0x5')};function emitEvent(_0x360897){return function(_0x198576,_0x5be05f,_0x5bab86){DashboardItemEvents[_0x66fa('0x6')](_0x360897+':'+_0x198576['id'],_0x198576);DashboardItemEvents['emit'](_0x360897,_0x198576);_0x5bab86(null);};}for(var e in events){if(events[_0x66fa('0x7')](e)){var event=events[e];DashboardItem[_0x66fa('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xcc4e=['save','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4d6491,_0x1fa564){var _0x30a576=function(_0x150675){while(--_0x150675){_0x4d6491['push'](_0x4d6491['shift']());}};_0x30a576(++_0x1fa564);}(_0xcc4e,0x19d));var _0xecc4=function(_0x153120,_0x5f522c){_0x153120=_0x153120-0x0;var _0x237187=_0xcc4e[_0x153120];return _0x237187;};'use strict';var EventEmitter=require(_0xecc4('0x0'));var DashboardItem=require(_0xecc4('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xecc4('0x2')](0x0);var events={'afterCreate':_0xecc4('0x3'),'afterUpdate':'update','afterDestroy':_0xecc4('0x4')};function emitEvent(_0x41e95a){return function(_0x52284d,_0x375da0,_0x5b1f88){DashboardItemEvents[_0xecc4('0x5')](_0x41e95a+':'+_0x52284d['id'],_0x52284d);DashboardItemEvents[_0xecc4('0x5')](_0x41e95a,_0x52284d);_0x5b1f88(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xecc4('0x6')](e,emitEvent(event));}}module[_0xecc4('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index d6f86e4..ac60652 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 _0x93db=['exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./dashboardItem.attributes'];(function(_0x44f2ff,_0x4e3e17){var _0x5e0ce9=function(_0x1adf82){while(--_0x1adf82){_0x44f2ff['push'](_0x44f2ff['shift']());}};_0x5e0ce9(++_0x4e3e17);}(_0x93db,0x1be));var _0xb93d=function(_0x36a3ad,_0x1758c4){_0x36a3ad=_0x36a3ad-0x0;var _0xade64=_0x93db[_0x36a3ad];return _0xade64;};'use strict';var _=require(_0xb93d('0x0'));var util=require(_0xb93d('0x1'));var logger=require(_0xb93d('0x2'))(_0xb93d('0x3'));var moment=require(_0xb93d('0x4'));var BPromise=require(_0xb93d('0x5'));var rp=require(_0xb93d('0x6'));var fs=require('fs');var path=require(_0xb93d('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb93d('0x8'));module[_0xb93d('0x9')]=function(_0x499474,_0x5ebaa7){return _0x499474[_0xb93d('0xa')](_0xb93d('0xb'),attributes,{'tableName':_0xb93d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ea4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','dashboard_items','lodash','util','../../config/logger','api'];(function(_0x135fab,_0x2c0e24){var _0x2b7ab1=function(_0xf94b9b){while(--_0xf94b9b){_0x135fab['push'](_0x135fab['shift']());}};_0x2b7ab1(++_0x2c0e24);}(_0x5ea4,0x130));var _0x45ea=function(_0x3ca874,_0x1e07c1){_0x3ca874=_0x3ca874-0x0;var _0xd8d930=_0x5ea4[_0x3ca874];return _0xd8d930;};'use strict';var _=require(_0x45ea('0x0'));var util=require(_0x45ea('0x1'));var logger=require(_0x45ea('0x2'))(_0x45ea('0x3'));var moment=require(_0x45ea('0x4'));var BPromise=require(_0x45ea('0x5'));var rp=require(_0x45ea('0x6'));var fs=require('fs');var path=require(_0x45ea('0x7'));var rimraf=require(_0x45ea('0x8'));var config=require(_0x45ea('0x9'));var attributes=require(_0x45ea('0xa'));module[_0x45ea('0xb')]=function(_0xe83f2a,_0x3ff257){return _0xe83f2a[_0x45ea('0xc')]('DashboardItem',attributes,{'tableName':_0x45ea('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index e63e6aa..daa379e 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 _0x82ff=['./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x311aad,_0x54d658){var _0x1779bd=function(_0x2520fb){while(--_0x2520fb){_0x311aad['push'](_0x311aad['shift']());}};_0x1779bd(++_0x54d658);}(_0x82ff,0x181));var _0xf82f=function(_0x438b69,_0x3ba154){_0x438b69=_0x438b69-0x0;var _0xf573c6=_0x82ff[_0x438b69];return _0xf573c6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf82f('0x0'));var BPromise=require(_0xf82f('0x1'));var rs=require(_0xf82f('0x2'));var fs=require('fs');var Redis=require(_0xf82f('0x3'));var db=require(_0xf82f('0x4'))['db'];var utils=require(_0xf82f('0x5'));var logger=require(_0xf82f('0x6'))(_0xf82f('0x7'));var config=require(_0xf82f('0x8'));var jayson=require(_0xf82f('0x9'));var client=jayson[_0xf82f('0xa')][_0xf82f('0xb')]({'port':0x232a});config[_0xf82f('0xc')]=_['defaults'](config['redis'],{'host':_0xf82f('0xd'),'port':0x18eb});var socket=require(_0xf82f('0xe'))(new Redis(config[_0xf82f('0xc')]));require(_0xf82f('0xf'))[_0xf82f('0x10')](socket);function respondWithRpcPromise(_0x5238bf,_0xeae54,_0x477993){return new BPromise(function(_0x1b4c8f,_0x3ef78c){return client['request'](_0x5238bf,_0x477993)[_0xf82f('0x11')](function(_0x58ff2f){logger[_0xf82f('0x12')](_0xf82f('0x13'),_0xeae54,_0xf82f('0x14'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0xeae54,'request\x20sent',JSON['stringify'](_0x58ff2f));if(_0x58ff2f[_0xf82f('0x15')]){if(_0x58ff2f[_0xf82f('0x15')]['code']===0x1f4){logger[_0xf82f('0x15')](_0xf82f('0x13'),_0xeae54,_0x58ff2f[_0xf82f('0x15')][_0xf82f('0x16')]);return _0x3ef78c(_0x58ff2f[_0xf82f('0x15')][_0xf82f('0x16')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0xeae54,_0x58ff2f[_0xf82f('0x15')]['message']);return _0x1b4c8f(_0x58ff2f[_0xf82f('0x15')][_0xf82f('0x16')]);}else{logger[_0xf82f('0x12')](_0xf82f('0x13'),_0xeae54,_0xf82f('0x14'));_0x1b4c8f(_0x58ff2f[_0xf82f('0x17')][_0xf82f('0x16')]);}})[_0xf82f('0x18')](function(_0x578872){logger[_0xf82f('0x15')]('DashboardItem,\x20%s,\x20%s',_0xeae54,_0x578872);_0x3ef78c(_0x578872);});});} \ No newline at end of file +var _0xde62=['request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x364e4e,_0x44ef54){var _0x40f9dc=function(_0x37bb32){while(--_0x37bb32){_0x364e4e['push'](_0x364e4e['shift']());}};_0x40f9dc(++_0x44ef54);}(_0xde62,0x16e));var _0x2de6=function(_0x4b78a9,_0x4b550b){_0x4b78a9=_0x4b78a9-0x0;var _0x481170=_0xde62[_0x4b78a9];return _0x481170;};'use strict';var _=require(_0x2de6('0x0'));var util=require(_0x2de6('0x1'));var moment=require('moment');var BPromise=require(_0x2de6('0x2'));var rs=require(_0x2de6('0x3'));var fs=require('fs');var Redis=require(_0x2de6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2de6('0x5'));var logger=require('../../config/logger')(_0x2de6('0x6'));var config=require(_0x2de6('0x7'));var jayson=require(_0x2de6('0x8'));var client=jayson[_0x2de6('0x9')][_0x2de6('0xa')]({'port':0x232a});config[_0x2de6('0xb')]=_[_0x2de6('0xc')](config[_0x2de6('0xb')],{'host':_0x2de6('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2de6('0xb')]));require(_0x2de6('0xe'))[_0x2de6('0xf')](socket);function respondWithRpcPromise(_0x3cb37d,_0x16d76e,_0x24ad0b){return new BPromise(function(_0x15bf07,_0x23b686){return client[_0x2de6('0x10')](_0x3cb37d,_0x24ad0b)[_0x2de6('0x11')](function(_0x1af878){logger[_0x2de6('0x12')](_0x2de6('0x13'),_0x16d76e,'request\x20sent');logger['debug'](_0x2de6('0x14'),_0x16d76e,'request\x20sent',JSON[_0x2de6('0x15')](_0x1af878));if(_0x1af878[_0x2de6('0x16')]){if(_0x1af878[_0x2de6('0x16')]['code']===0x1f4){logger[_0x2de6('0x16')](_0x2de6('0x13'),_0x16d76e,_0x1af878['error'][_0x2de6('0x17')]);return _0x23b686(_0x1af878[_0x2de6('0x16')][_0x2de6('0x17')]);}logger[_0x2de6('0x16')](_0x2de6('0x13'),_0x16d76e,_0x1af878[_0x2de6('0x16')][_0x2de6('0x17')]);return _0x15bf07(_0x1af878[_0x2de6('0x16')][_0x2de6('0x17')]);}else{logger[_0x2de6('0x12')](_0x2de6('0x13'),_0x16d76e,_0x2de6('0x18'));_0x15bf07(_0x1af878['result'][_0x2de6('0x17')]);}})[_0x2de6('0x19')](function(_0x22abdd){logger[_0x2de6('0x16')](_0x2de6('0x13'),_0x16d76e,_0x22abdd);_0x23b686(_0x22abdd);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 7c8f4ed..c08d7bd 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 _0x247a=['dashboardItem:','save','remove','emit','length'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0x247a,0x14b));var _0xa247=function(_0xdbff26,_0xfc8995){_0xdbff26=_0xdbff26-0x0;var _0x4adb23=_0x247a[_0xdbff26];return _0x4adb23;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xa247('0x0'),_0xa247('0x1'),'update'];function createListener(_0x11da17,_0xe49baf){return function(_0x109727){_0xe49baf[_0xa247('0x2')](_0x11da17,_0x109727);};}function removeListener(_0x45f6c6,_0xb2e302){return function(){DashboardItemEvents['removeListener'](_0x45f6c6,_0xb2e302);};}exports['register']=function(_0x8ab449){for(var _0x825a7e=0x0,_0x29e8ef=events[_0xa247('0x3')];_0x825a7e<_0x29e8ef;_0x825a7e++){var _0x3f48c6=events[_0x825a7e];var _0x5034c8=createListener(_0xa247('0x4')+_0x3f48c6,_0x8ab449);DashboardItemEvents['on'](_0x3f48c6,_0x5034c8);}}; \ No newline at end of file +var _0xd3a2=['save','remove','update','emit','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xd3a2,0xdf));var _0x2d3a=function(_0x447afb,_0x5ce46e){_0x447afb=_0x447afb-0x0;var _0x22f026=_0xd3a2[_0x447afb];return _0x22f026;};'use strict';var DashboardItemEvents=require(_0x2d3a('0x0'));var events=[_0x2d3a('0x1'),_0x2d3a('0x2'),_0x2d3a('0x3')];function createListener(_0x12edac,_0x194de7){return function(_0x1cf865){_0x194de7[_0x2d3a('0x4')](_0x12edac,_0x1cf865);};}function removeListener(_0x4b3333,_0x3cb915){return function(){DashboardItemEvents['removeListener'](_0x4b3333,_0x3cb915);};}exports[_0x2d3a('0x5')]=function(_0x2a9848){for(var _0x9d5765=0x0,_0x39ad18=events[_0x2d3a('0x6')];_0x9d5765<_0x39ad18;_0x9d5765++){var _0x2efff2=events[_0x9d5765];var _0x988227=createListener(_0x2d3a('0x7')+_0x2efff2,_0x2a9848);DashboardItemEvents['on'](_0x2efff2,_0x988227);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index a0d2156..d5ff5eb 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 _0xd399=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x68f044,_0x1bb7a8){var _0x5741eb=function(_0x55947a){while(--_0x55947a){_0x68f044['push'](_0x68f044['shift']());}};_0x5741eb(++_0x1bb7a8);}(_0xd399,0x1e9));var _0x9d39=function(_0x9c3521,_0x22ac04){_0x9c3521=_0x9c3521-0x0;var _0x4e0064=_0xd399[_0x9c3521];return _0x4e0064;};'use strict';var multer=require(_0x9d39('0x0'));var util=require(_0x9d39('0x1'));var path=require(_0x9d39('0x2'));var timeout=require(_0x9d39('0x3'));var express=require(_0x9d39('0x4'));var router=express[_0x9d39('0x5')]();var fs_extra=require(_0x9d39('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9d39('0x7'));var config=require(_0x9d39('0x8'));var controller=require('./dashboardItem.controller');router[_0x9d39('0x9')](_0x9d39('0xa'),auth['isAuthenticated'](),controller[_0x9d39('0xb')]);router['post']('/',auth[_0x9d39('0xc')](),controller['create']);router[_0x9d39('0xd')](_0x9d39('0xa'),auth[_0x9d39('0xc')](),controller[_0x9d39('0xe')]);router[_0x9d39('0xf')](_0x9d39('0xa'),auth[_0x9d39('0xc')](),controller[_0x9d39('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf5e9=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','util'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xf5e9,0xcb));var _0x9f5e=function(_0xa7662e,_0x22304d){_0xa7662e=_0xa7662e-0x0;var _0x425053=_0xf5e9[_0xa7662e];return _0x425053;};'use strict';var multer=require('multer');var util=require(_0x9f5e('0x0'));var path=require('path');var timeout=require(_0x9f5e('0x1'));var express=require(_0x9f5e('0x2'));var router=express['Router']();var fs_extra=require(_0x9f5e('0x3'));var auth=require(_0x9f5e('0x4'));var interaction=require(_0x9f5e('0x5'));var config=require(_0x9f5e('0x6'));var controller=require(_0x9f5e('0x7'));router[_0x9f5e('0x8')](_0x9f5e('0x9'),auth[_0x9f5e('0xa')](),controller[_0x9f5e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9f5e('0xc')]);router[_0x9f5e('0xd')](_0x9f5e('0x9'),auth['isAuthenticated'](),controller[_0x9f5e('0xe')]);router[_0x9f5e('0xf')](_0x9f5e('0x9'),auth[_0x9f5e('0xa')](),controller[_0x9f5e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 0340e9b..eb8274a 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 _0x7f90=['STRING','ENUM','first','exports'];(function(_0x4d415a,_0x209743){var _0x18375d=function(_0x30f820){while(--_0x30f820){_0x4d415a['push'](_0x4d415a['shift']());}};_0x18375d(++_0x209743);}(_0x7f90,0x10f));var _0x07f9=function(_0x17bf52,_0x18f994){_0x17bf52=_0x17bf52-0x0;var _0x5a5c87=_0x7f90[_0x17bf52];return _0x5a5c87;};'use strict';var Sequelize=require('sequelize');module[_0x07f9('0x0')]={'name':{'type':Sequelize[_0x07f9('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x07f9('0x2')](_0x07f9('0x3'),'second','third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe898=['second','sequelize','exports','STRING','ENUM','first'];(function(_0x37f770,_0x5a4bf5){var _0x521711=function(_0x38d162){while(--_0x38d162){_0x37f770['push'](_0x37f770['shift']());}};_0x521711(++_0x5a4bf5);}(_0xe898,0x193));var _0x8e89=function(_0x508a3a,_0x351c88){_0x508a3a=_0x508a3a-0x0;var _0xae3151=_0xe898[_0x508a3a];return _0xae3151;};'use strict';var Sequelize=require(_0x8e89('0x0'));module[_0x8e89('0x1')]={'name':{'type':Sequelize[_0x8e89('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x8e89('0x3')](_0x8e89('0x4'),_0x8e89('0x5'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x8e89('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 313c10c..7b01a04 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 _0x903e=['Dispositions','UserProfileResource','sendStatus','error','stack','name','send','index','Disposition','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x903e,0x118));var _0xe903=function(_0x4f83ca,_0x46f67a){_0x4f83ca=_0x4f83ca-0x0;var _0x1fbac3=_0x903e[_0x4f83ca];return _0x1fbac3;};'use strict';var emlformat=require(_0xe903('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe903('0x1'));var jsonpatch=require(_0xe903('0x2'));var rp=require(_0xe903('0x3'));var moment=require('moment');var BPromise=require(_0xe903('0x4'));var Mustache=require('mustache');var util=require(_0xe903('0x5'));var path=require(_0xe903('0x6'));var sox=require(_0xe903('0x7'));var csv=require('to-csv');var ejs=require(_0xe903('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe903('0x9'));var squel=require(_0xe903('0xa'));var crypto=require(_0xe903('0xb'));var jsforce=require(_0xe903('0xc'));var deskjs=require(_0xe903('0xd'));var toCsv=require(_0xe903('0xe'));var querystring=require(_0xe903('0xf'));var Papa=require('papaparse');var Redis=require(_0xe903('0x10'));var authService=require(_0xe903('0x11'));var qs=require(_0xe903('0x12'));var as=require(_0xe903('0x13'));var hardwareService=require(_0xe903('0x14'));var logger=require(_0xe903('0x15'))(_0xe903('0x16'));var utils=require(_0xe903('0x17'));var config=require(_0xe903('0x18'));var licenseUtil=require(_0xe903('0x19'));var db=require(_0xe903('0x1a'))['db'];function respondWithStatusCode(_0x188749,_0x37896a){_0x37896a=_0x37896a||0xcc;return function(_0x6225e8){if(_0x6225e8){return _0x188749['sendStatus'](_0x37896a);}return _0x188749[_0xe903('0x1b')](_0x37896a)[_0xe903('0x1c')]();};}function respondWithResult(_0x296de0,_0x280fca){_0x280fca=_0x280fca||0xc8;return function(_0x552644){if(_0x552644){return _0x296de0[_0xe903('0x1b')](_0x280fca)[_0xe903('0x1d')](_0x552644);}};}function respondWithFilteredResult(_0x5d647a,_0x2e83a9){return function(_0x3ec70f){if(_0x3ec70f){var _0x30d092=_0x3ec70f[_0xe903('0x1e')],_0x341c62=_0x2e83a9[_0xe903('0x1f')],_0x42ff1e=_0x2e83a9[_0xe903('0x1f')]+_0x2e83a9[_0xe903('0x20')],_0xfc2d73;if(_0x42ff1e>=_0x30d092){_0x42ff1e=_0x30d092;_0xfc2d73=0xc8;}else{_0xfc2d73=0xce;}_0x5d647a[_0xe903('0x1b')](_0xfc2d73);return _0x5d647a['set'](_0xe903('0x21'),_0x341c62+'-'+_0x42ff1e+'/'+_0x30d092)[_0xe903('0x1d')](_0x3ec70f);}return null;};}function patchUpdates(_0x4c964a){return function(_0x3c50b6){try{jsonpatch[_0xe903('0x22')](_0x3c50b6,_0x4c964a,!![]);}catch(_0x576fe2){return BPromise[_0xe903('0x23')](_0x576fe2);}return _0x3c50b6['save']();};}function saveUpdates(_0x4ec4cd,_0x217983){return function(_0x18024f){if(_0x18024f){return _0x18024f[_0xe903('0x24')](_0x4ec4cd)['then'](function(_0x246283){return _0x246283;});}return null;};}function removeEntity(_0x39835c,_0x4b0b14){return function(_0x41a894){if(_0x41a894){return _0x41a894[_0xe903('0x25')]()[_0xe903('0x26')](function(){var _0x3a363b=_0x41a894[_0xe903('0x27')]({'plain':!![]});var _0x10c6c5=_0xe903('0x28');return db[_0xe903('0x29')]['destroy']({'where':{'type':_0x10c6c5,'resourceId':_0x3a363b['id']}})[_0xe903('0x26')](function(){return _0x41a894;});})[_0xe903('0x26')](function(){_0x39835c[_0xe903('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a4d47,_0x620d1a){return function(_0x26cb3b){if(!_0x26cb3b){_0x2a4d47[_0xe903('0x2a')](0x194);}return _0x26cb3b;};}function handleError(_0x16c1a8,_0xf76eae){_0xf76eae=_0xf76eae||0x1f4;return function(_0x5249aa){logger[_0xe903('0x2b')](_0x5249aa[_0xe903('0x2c')]);if(_0x5249aa[_0xe903('0x2d')]){delete _0x5249aa['name'];}_0x16c1a8[_0xe903('0x1b')](_0xf76eae)[_0xe903('0x2e')](_0x5249aa);};}exports[_0xe903('0x2f')]=function(_0x340485,_0x169488){var _0x3e72d2={},_0x22e883={},_0x4c930d={'count':0x0,'rows':[]};var _0x198fc9=_['map'](db[_0xe903('0x30')]['rawAttributes'],function(_0x344e99){return{'name':_0x344e99['fieldName'],'type':_0x344e99[_0xe903('0x31')][_0xe903('0x32')]};});_0x22e883[_0xe903('0x33')]=_[_0xe903('0x34')](_0x198fc9,_0xe903('0x2d'));_0x22e883['query']=_['keys'](_0x340485[_0xe903('0x35')]);_0x22e883[_0xe903('0x36')]=_[_0xe903('0x37')](_0x22e883[_0xe903('0x33')],_0x22e883[_0xe903('0x35')]);_0x3e72d2[_0xe903('0x38')]=_[_0xe903('0x37')](_0x22e883['model'],qs[_0xe903('0x39')](_0x340485[_0xe903('0x35')][_0xe903('0x39')]));_0x3e72d2[_0xe903('0x38')]=_0x3e72d2[_0xe903('0x38')][_0xe903('0x3a')]?_0x3e72d2[_0xe903('0x38')]:_0x22e883['model'];if(!_0x340485[_0xe903('0x35')]['hasOwnProperty'](_0xe903('0x3b'))){_0x3e72d2['limit']=qs['limit'](_0x340485[_0xe903('0x35')][_0xe903('0x20')]);_0x3e72d2[_0xe903('0x1f')]=qs[_0xe903('0x1f')](_0x340485[_0xe903('0x35')][_0xe903('0x1f')]);}_0x3e72d2[_0xe903('0x3c')]=qs[_0xe903('0x3d')](_0x340485['query']['sort']);_0x3e72d2[_0xe903('0x3e')]=qs[_0xe903('0x36')](_[_0xe903('0x3f')](_0x340485[_0xe903('0x35')],_0x22e883[_0xe903('0x36')]),_0x198fc9);if(_0x340485[_0xe903('0x35')]['filter']){_0x3e72d2[_0xe903('0x3e')]=_[_0xe903('0x40')](_0x3e72d2[_0xe903('0x3e')],{'$or':_[_0xe903('0x34')](_0x198fc9,function(_0x3af92a){if(_0x3af92a[_0xe903('0x31')]!=='VIRTUAL'){var _0x1aac6={};_0x1aac6[_0x3af92a['name']]={'$like':'%'+_0x340485['query'][_0xe903('0x41')]+'%'};return _0x1aac6;}})});}_0x3e72d2=_[_0xe903('0x40')]({},_0x3e72d2,_0x340485['options']);var _0x3dc58b={'where':_0x3e72d2[_0xe903('0x3e')]};return db['Disposition'][_0xe903('0x1e')](_0x3dc58b)['then'](function(_0x132fb6){_0x4c930d[_0xe903('0x1e')]=_0x132fb6;if(_0x340485['query'][_0xe903('0x42')]){_0x3e72d2[_0xe903('0x43')]=[{'all':!![]}];}return db[_0xe903('0x30')][_0xe903('0x44')](_0x3e72d2);})[_0xe903('0x26')](function(_0x61ea0c){_0x4c930d[_0xe903('0x45')]=_0x61ea0c;return _0x4c930d;})[_0xe903('0x26')](respondWithFilteredResult(_0x169488,_0x3e72d2))[_0xe903('0x46')](handleError(_0x169488,null));};exports[_0xe903('0x47')]=function(_0x5ea966,_0x44fd8b){var _0x244e2f={'raw':!![],'where':{'id':_0x5ea966[_0xe903('0x48')]['id']}},_0x7b9168={};_0x7b9168[_0xe903('0x33')]=_[_0xe903('0x49')](db['Disposition'][_0xe903('0x4a')]);_0x7b9168[_0xe903('0x35')]=_[_0xe903('0x49')](_0x5ea966[_0xe903('0x35')]);_0x7b9168[_0xe903('0x36')]=_[_0xe903('0x37')](_0x7b9168['model'],_0x7b9168[_0xe903('0x35')]);_0x244e2f[_0xe903('0x38')]=_[_0xe903('0x37')](_0x7b9168[_0xe903('0x33')],qs[_0xe903('0x39')](_0x5ea966[_0xe903('0x35')][_0xe903('0x39')]));_0x244e2f[_0xe903('0x38')]=_0x244e2f[_0xe903('0x38')][_0xe903('0x3a')]?_0x244e2f[_0xe903('0x38')]:_0x7b9168[_0xe903('0x33')];if(_0x5ea966[_0xe903('0x35')][_0xe903('0x42')]){_0x244e2f[_0xe903('0x43')]=[{'all':!![]}];}_0x244e2f=_[_0xe903('0x40')]({},_0x244e2f,_0x5ea966[_0xe903('0x4b')]);return db[_0xe903('0x30')][_0xe903('0x4c')](_0x244e2f)[_0xe903('0x26')](handleEntityNotFound(_0x44fd8b,null))[_0xe903('0x26')](respondWithResult(_0x44fd8b,null))[_0xe903('0x46')](handleError(_0x44fd8b,null));};exports[_0xe903('0x4d')]=function(_0x25d610,_0x596d50){return db[_0xe903('0x30')]['create'](_0x25d610['body'],{})[_0xe903('0x26')](function(_0x17c5eb){var _0x102d97=_0x25d610['user'][_0xe903('0x27')]({'plain':!![]});if(!_0x102d97)throw new Error(_0xe903('0x4e'));if(_0x102d97['role']==='user'){var _0x2b37c8=_0x17c5eb[_0xe903('0x27')]({'plain':!![]});var _0x1e6417=_0xe903('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1e6417,'userProfileId':_0x102d97['userProfileId']},'raw':!![]})['then'](function(_0x413d52){if(_0x413d52&&_0x413d52['autoAssociation']===0x0){return db[_0xe903('0x29')]['create']({'name':_0x2b37c8['name'],'resourceId':_0x2b37c8['id'],'type':_0x413d52['name'],'sectionId':_0x413d52['id']},{})[_0xe903('0x26')](function(){return _0x17c5eb;});}else{return _0x17c5eb;}})['catch'](function(_0x4064c5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4064c5);throw _0x4064c5;});}return _0x17c5eb;})[_0xe903('0x26')](respondWithResult(_0x596d50,0xc9))[_0xe903('0x46')](handleError(_0x596d50,null));};exports[_0xe903('0x24')]=function(_0x280e54,_0x47de60){if(_0x280e54[_0xe903('0x4f')]['id']){delete _0x280e54[_0xe903('0x4f')]['id'];}return db[_0xe903('0x30')]['find']({'where':{'id':_0x280e54[_0xe903('0x48')]['id']}})[_0xe903('0x26')](handleEntityNotFound(_0x47de60,null))[_0xe903('0x26')](saveUpdates(_0x280e54['body'],null))[_0xe903('0x26')](respondWithResult(_0x47de60,null))[_0xe903('0x46')](handleError(_0x47de60,null));};exports[_0xe903('0x25')]=function(_0x5deffd,_0x96a9a0){return db[_0xe903('0x30')][_0xe903('0x4c')]({'where':{'id':_0x5deffd[_0xe903('0x48')]['id']}})[_0xe903('0x26')](handleEntityNotFound(_0x96a9a0,null))[_0xe903('0x26')](removeEntity(_0x96a9a0,null))[_0xe903('0x46')](handleError(_0x96a9a0,null));}; \ No newline at end of file +var _0xf67c=['merge','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','then','destroy','get','Dispositions','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL'];(function(_0x1d664a,_0x149a34){var _0x335345=function(_0x461fac){while(--_0x461fac){_0x1d664a['push'](_0x1d664a['shift']());}};_0x335345(++_0x149a34);}(_0xf67c,0x19e));var _0xcf67=function(_0x250b21,_0x1dc47e){_0x250b21=_0x250b21-0x0;var _0x5ea20a=_0xf67c[_0x250b21];return _0x5ea20a;};'use strict';var emlformat=require(_0xcf67('0x0'));var rimraf=require(_0xcf67('0x1'));var zipdir=require(_0xcf67('0x2'));var jsonpatch=require(_0xcf67('0x3'));var rp=require('request-promise');var moment=require(_0xcf67('0x4'));var BPromise=require(_0xcf67('0x5'));var Mustache=require('mustache');var util=require(_0xcf67('0x6'));var path=require(_0xcf67('0x7'));var sox=require('sox');var csv=require(_0xcf67('0x8'));var ejs=require(_0xcf67('0x9'));var fs=require('fs');var fs_extra=require(_0xcf67('0xa'));var _=require('lodash');var squel=require(_0xcf67('0xb'));var crypto=require(_0xcf67('0xc'));var jsforce=require(_0xcf67('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcf67('0x8'));var querystring=require(_0xcf67('0xe'));var Papa=require(_0xcf67('0xf'));var Redis=require(_0xcf67('0x10'));var authService=require(_0xcf67('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf67('0x12'));var logger=require('../../config/logger')(_0xcf67('0x13'));var utils=require(_0xcf67('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d62b6,_0x50c5a6){_0x50c5a6=_0x50c5a6||0xcc;return function(_0x20ba48){if(_0x20ba48){return _0x1d62b6[_0xcf67('0x15')](_0x50c5a6);}return _0x1d62b6[_0xcf67('0x16')](_0x50c5a6)[_0xcf67('0x17')]();};}function respondWithResult(_0x21464a,_0x8549f8){_0x8549f8=_0x8549f8||0xc8;return function(_0x526fbb){if(_0x526fbb){return _0x21464a[_0xcf67('0x16')](_0x8549f8)[_0xcf67('0x18')](_0x526fbb);}};}function respondWithFilteredResult(_0x20d9bc,_0x349167){return function(_0x4a9f2d){if(_0x4a9f2d){var _0x19c329=_0x4a9f2d['count'],_0x3d3fc7=_0x349167['offset'],_0x16797c=_0x349167[_0xcf67('0x19')]+_0x349167[_0xcf67('0x1a')],_0x5cd2a1;if(_0x16797c>=_0x19c329){_0x16797c=_0x19c329;_0x5cd2a1=0xc8;}else{_0x5cd2a1=0xce;}_0x20d9bc[_0xcf67('0x16')](_0x5cd2a1);return _0x20d9bc['set'](_0xcf67('0x1b'),_0x3d3fc7+'-'+_0x16797c+'/'+_0x19c329)[_0xcf67('0x18')](_0x4a9f2d);}return null;};}function patchUpdates(_0x3579da){return function(_0x52b3e8){try{jsonpatch['apply'](_0x52b3e8,_0x3579da,!![]);}catch(_0x4557c6){return BPromise[_0xcf67('0x1c')](_0x4557c6);}return _0x52b3e8[_0xcf67('0x1d')]();};}function saveUpdates(_0x319970,_0x300674){return function(_0x25479f){if(_0x25479f){return _0x25479f[_0xcf67('0x1e')](_0x319970)[_0xcf67('0x1f')](function(_0x48eb61){return _0x48eb61;});}return null;};}function removeEntity(_0x164cea,_0x7aaf06){return function(_0x235627){if(_0x235627){return _0x235627[_0xcf67('0x20')]()[_0xcf67('0x1f')](function(){var _0x5b88e4=_0x235627[_0xcf67('0x21')]({'plain':!![]});var _0x24af2b=_0xcf67('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x24af2b,'resourceId':_0x5b88e4['id']}})[_0xcf67('0x1f')](function(){return _0x235627;});})[_0xcf67('0x1f')](function(){_0x164cea[_0xcf67('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a15a8,_0x32cdd0){return function(_0x3cda60){if(!_0x3cda60){_0x4a15a8[_0xcf67('0x15')](0x194);}return _0x3cda60;};}function handleError(_0x5240e5,_0x3940ab){_0x3940ab=_0x3940ab||0x1f4;return function(_0xcd0c00){logger[_0xcf67('0x23')](_0xcd0c00[_0xcf67('0x24')]);if(_0xcd0c00[_0xcf67('0x25')]){delete _0xcd0c00[_0xcf67('0x25')];}_0x5240e5[_0xcf67('0x16')](_0x3940ab)[_0xcf67('0x26')](_0xcd0c00);};}exports[_0xcf67('0x27')]=function(_0x5d297f,_0x39cf98){var _0x4a6e97={},_0x32540a={},_0xb1c6b5={'count':0x0,'rows':[]};var _0xcc3cbd=_[_0xcf67('0x28')](db[_0xcf67('0x29')][_0xcf67('0x2a')],function(_0x4a9ab8){return{'name':_0x4a9ab8[_0xcf67('0x2b')],'type':_0x4a9ab8['type'][_0xcf67('0x2c')]};});_0x32540a[_0xcf67('0x2d')]=_[_0xcf67('0x28')](_0xcc3cbd,_0xcf67('0x25'));_0x32540a['query']=_[_0xcf67('0x2e')](_0x5d297f[_0xcf67('0x2f')]);_0x32540a[_0xcf67('0x30')]=_['intersection'](_0x32540a[_0xcf67('0x2d')],_0x32540a['query']);_0x4a6e97['attributes']=_[_0xcf67('0x31')](_0x32540a['model'],qs['fields'](_0x5d297f['query']['fields']));_0x4a6e97[_0xcf67('0x32')]=_0x4a6e97[_0xcf67('0x32')][_0xcf67('0x33')]?_0x4a6e97['attributes']:_0x32540a['model'];if(!_0x5d297f[_0xcf67('0x2f')][_0xcf67('0x34')](_0xcf67('0x35'))){_0x4a6e97['limit']=qs[_0xcf67('0x1a')](_0x5d297f[_0xcf67('0x2f')][_0xcf67('0x1a')]);_0x4a6e97['offset']=qs[_0xcf67('0x19')](_0x5d297f[_0xcf67('0x2f')]['offset']);}_0x4a6e97['order']=qs['sort'](_0x5d297f[_0xcf67('0x2f')][_0xcf67('0x36')]);_0x4a6e97['where']=qs[_0xcf67('0x30')](_[_0xcf67('0x37')](_0x5d297f[_0xcf67('0x2f')],_0x32540a[_0xcf67('0x30')]),_0xcc3cbd);if(_0x5d297f[_0xcf67('0x2f')][_0xcf67('0x38')]){_0x4a6e97['where']=_['merge'](_0x4a6e97[_0xcf67('0x39')],{'$or':_[_0xcf67('0x28')](_0xcc3cbd,function(_0x275fd3){if(_0x275fd3[_0xcf67('0x3a')]!==_0xcf67('0x3b')){var _0x90cd53={};_0x90cd53[_0x275fd3[_0xcf67('0x25')]]={'$like':'%'+_0x5d297f[_0xcf67('0x2f')][_0xcf67('0x38')]+'%'};return _0x90cd53;}})});}_0x4a6e97=_[_0xcf67('0x3c')]({},_0x4a6e97,_0x5d297f[_0xcf67('0x3d')]);var _0x15933d={'where':_0x4a6e97[_0xcf67('0x39')]};return db[_0xcf67('0x29')]['count'](_0x15933d)['then'](function(_0xe55783){_0xb1c6b5['count']=_0xe55783;if(_0x5d297f[_0xcf67('0x2f')]['includeAll']){_0x4a6e97['include']=[{'all':!![]}];}return db[_0xcf67('0x29')][_0xcf67('0x3e')](_0x4a6e97);})['then'](function(_0x1894d6){_0xb1c6b5[_0xcf67('0x3f')]=_0x1894d6;return _0xb1c6b5;})['then'](respondWithFilteredResult(_0x39cf98,_0x4a6e97))[_0xcf67('0x40')](handleError(_0x39cf98,null));};exports[_0xcf67('0x41')]=function(_0x3e63c5,_0x1b48db){var _0x4826ad={'raw':!![],'where':{'id':_0x3e63c5[_0xcf67('0x42')]['id']}},_0x4cfc82={};_0x4cfc82['model']=_[_0xcf67('0x2e')](db[_0xcf67('0x29')]['rawAttributes']);_0x4cfc82['query']=_[_0xcf67('0x2e')](_0x3e63c5[_0xcf67('0x2f')]);_0x4cfc82[_0xcf67('0x30')]=_[_0xcf67('0x31')](_0x4cfc82['model'],_0x4cfc82[_0xcf67('0x2f')]);_0x4826ad['attributes']=_['intersection'](_0x4cfc82['model'],qs[_0xcf67('0x43')](_0x3e63c5[_0xcf67('0x2f')][_0xcf67('0x43')]));_0x4826ad[_0xcf67('0x32')]=_0x4826ad[_0xcf67('0x32')][_0xcf67('0x33')]?_0x4826ad[_0xcf67('0x32')]:_0x4cfc82[_0xcf67('0x2d')];if(_0x3e63c5['query'][_0xcf67('0x44')]){_0x4826ad[_0xcf67('0x45')]=[{'all':!![]}];}_0x4826ad=_[_0xcf67('0x3c')]({},_0x4826ad,_0x3e63c5[_0xcf67('0x3d')]);return db['Disposition'][_0xcf67('0x46')](_0x4826ad)['then'](handleEntityNotFound(_0x1b48db,null))['then'](respondWithResult(_0x1b48db,null))[_0xcf67('0x40')](handleError(_0x1b48db,null));};exports[_0xcf67('0x47')]=function(_0x29edca,_0x187fb9){return db[_0xcf67('0x29')][_0xcf67('0x47')](_0x29edca['body'],{})[_0xcf67('0x1f')](function(_0x5c275c){var _0x1d36bb=_0x29edca['user']['get']({'plain':!![]});if(!_0x1d36bb)throw new Error(_0xcf67('0x48'));if(_0x1d36bb[_0xcf67('0x49')]===_0xcf67('0x4a')){var _0x280a97=_0x5c275c[_0xcf67('0x21')]({'plain':!![]});var _0x34a7b0=_0xcf67('0x22');return db[_0xcf67('0x4b')][_0xcf67('0x46')]({'where':{'name':_0x34a7b0,'userProfileId':_0x1d36bb[_0xcf67('0x4c')]},'raw':!![]})['then'](function(_0x43f114){if(_0x43f114&&_0x43f114['autoAssociation']===0x0){return db[_0xcf67('0x4d')]['create']({'name':_0x280a97[_0xcf67('0x25')],'resourceId':_0x280a97['id'],'type':_0x43f114[_0xcf67('0x25')],'sectionId':_0x43f114['id']},{})[_0xcf67('0x1f')](function(){return _0x5c275c;});}else{return _0x5c275c;}})['catch'](function(_0x15ba72){logger[_0xcf67('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15ba72);throw _0x15ba72;});}return _0x5c275c;})[_0xcf67('0x1f')](respondWithResult(_0x187fb9,0xc9))[_0xcf67('0x40')](handleError(_0x187fb9,null));};exports['update']=function(_0x3cf4c5,_0x3f0038){if(_0x3cf4c5[_0xcf67('0x4e')]['id']){delete _0x3cf4c5[_0xcf67('0x4e')]['id'];}return db[_0xcf67('0x29')][_0xcf67('0x46')]({'where':{'id':_0x3cf4c5[_0xcf67('0x42')]['id']}})[_0xcf67('0x1f')](handleEntityNotFound(_0x3f0038,null))['then'](saveUpdates(_0x3cf4c5[_0xcf67('0x4e')],null))[_0xcf67('0x1f')](respondWithResult(_0x3f0038,null))[_0xcf67('0x40')](handleError(_0x3f0038,null));};exports[_0xcf67('0x20')]=function(_0x48dcb4,_0x3b600d){return db[_0xcf67('0x29')][_0xcf67('0x46')]({'where':{'id':_0x48dcb4['params']['id']}})[_0xcf67('0x1f')](handleEntityNotFound(_0x3b600d,null))['then'](removeEntity(_0x3b600d,null))[_0xcf67('0x40')](handleError(_0x3b600d,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 61ee990..f1cec7e 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 _0xece0=['MailAccountId','name_sms','SmsAccountId','FaxAccountId','WhatsappAccountId','lodash','util','api','moment','request-promise','path','rimraf','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat'];(function(_0x30d1ae,_0x3e076d){var _0x207e15=function(_0x5366a6){while(--_0x5366a6){_0x30d1ae['push'](_0x30d1ae['shift']());}};_0x207e15(++_0x3e076d);}(_0xece0,0xa5));var _0x0ece=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0xece0[_0x115d5b];return _0x6cfc50;};'use strict';var _=require(_0x0ece('0x0'));var util=require(_0x0ece('0x1'));var logger=require('../../config/logger')(_0x0ece('0x2'));var moment=require(_0x0ece('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ece('0x4'));var fs=require('fs');var path=require(_0x0ece('0x5'));var rimraf=require(_0x0ece('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x0ece('0x7')]=function(_0x3a107d,_0xb736f9){return _0x3a107d[_0x0ece('0x8')](_0x0ece('0x9'),attributes,{'tableName':_0x0ece('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x0ece('0xb'),'fields':[_0x0ece('0xc'),_0x0ece('0xd')]},{'unique':!![],'name':_0x0ece('0xe'),'fields':[_0x0ece('0xc'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x0ece('0xc'),_0x0ece('0xf')]},{'unique':!![],'name':_0x0ece('0x10'),'fields':[_0x0ece('0xc'),_0x0ece('0x11')]},{'unique':!![],'name':'name_fax','fields':[_0x0ece('0xc'),_0x0ece('0x12')]},{'unique':!![],'name':'name_openchannel','fields':[_0x0ece('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x0ece('0xc'),_0x0ece('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeec6=['Disposition','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','name_sms','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes'];(function(_0x3a87c1,_0x27326f){var _0x2117c2=function(_0x2602e4){while(--_0x2602e4){_0x3a87c1['push'](_0x3a87c1['shift']());}};_0x2117c2(++_0x27326f);}(_0xeec6,0x1c2));var _0x6eec=function(_0x4ccd32,_0x3b11c9){_0x4ccd32=_0x4ccd32-0x0;var _0x30b693=_0xeec6[_0x4ccd32];return _0x30b693;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var logger=require(_0x6eec('0x2'))(_0x6eec('0x3'));var moment=require('moment');var BPromise=require(_0x6eec('0x4'));var rp=require(_0x6eec('0x5'));var fs=require('fs');var path=require(_0x6eec('0x6'));var rimraf=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var attributes=require(_0x6eec('0x9'));module['exports']=function(_0x185f31,_0x3c6eda){return _0x185f31['define'](_0x6eec('0xa'),attributes,{'tableName':_0x6eec('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6eec('0xc'),'fields':[_0x6eec('0xd'),'ListId']},{'unique':!![],'name':_0x6eec('0xe'),'fields':[_0x6eec('0xd'),_0x6eec('0xf')]},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0x6eec('0x10'),'fields':[_0x6eec('0xd'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x6eec('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x6eec('0x11'),'fields':[_0x6eec('0xd'),_0x6eec('0x12')]},{'unique':!![],'name':_0x6eec('0x13'),'fields':[_0x6eec('0xd'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index a391dcd..a8e6f6e 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 _0x5650=['../../config/environment','jayson/promise','client','http','info','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','../../mysqldb','../../config/utils','rpc'];(function(_0x190ff6,_0x515cfd){var _0x5356d2=function(_0x2cf77c){while(--_0x2cf77c){_0x190ff6['push'](_0x190ff6['shift']());}};_0x5356d2(++_0x515cfd);}(_0x5650,0xcc));var _0x0565=function(_0xa22981,_0x2a7cc8){_0xa22981=_0xa22981-0x0;var _0x425b3c=_0x5650[_0xa22981];return _0x425b3c;};'use strict';var _=require(_0x0565('0x0'));var util=require(_0x0565('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0565('0x2'))['db'];var utils=require(_0x0565('0x3'));var logger=require('../../config/logger')(_0x0565('0x4'));var config=require(_0x0565('0x5'));var jayson=require(_0x0565('0x6'));var client=jayson[_0x0565('0x7')][_0x0565('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4394e3,_0x192271,_0x5b3d6e){return new BPromise(function(_0xd675c,_0x1f32b4){return client['request'](_0x4394e3,_0x5b3d6e)['then'](function(_0x1c8cac){logger[_0x0565('0x9')](_0x0565('0xa'),_0x192271,_0x0565('0xb'));logger['debug'](_0x0565('0xc'),_0x192271,_0x0565('0xb'),JSON[_0x0565('0xd')](_0x1c8cac));if(_0x1c8cac[_0x0565('0xe')]){if(_0x1c8cac['error'][_0x0565('0xf')]===0x1f4){logger[_0x0565('0xe')]('Disposition,\x20%s,\x20%s',_0x192271,_0x1c8cac['error'][_0x0565('0x10')]);return _0x1f32b4(_0x1c8cac[_0x0565('0xe')][_0x0565('0x10')]);}logger[_0x0565('0xe')]('Disposition,\x20%s,\x20%s',_0x192271,_0x1c8cac[_0x0565('0xe')][_0x0565('0x10')]);return _0xd675c(_0x1c8cac[_0x0565('0xe')][_0x0565('0x10')]);}else{logger[_0x0565('0x9')](_0x0565('0xa'),_0x192271,'request\x20sent');_0xd675c(_0x1c8cac[_0x0565('0x11')][_0x0565('0x10')]);}})[_0x0565('0x12')](function(_0x598c8c){logger[_0x0565('0xe')](_0x0565('0xa'),_0x192271,_0x598c8c);_0x1f32b4(_0x598c8c);});});} \ No newline at end of file +var _0xd9c2=['Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x421e36,_0x18776e){var _0x20b3e3=function(_0x767de4){while(--_0x767de4){_0x421e36['push'](_0x421e36['shift']());}};_0x20b3e3(++_0x18776e);}(_0xd9c2,0xd3));var _0x2d9c=function(_0x494b7f,_0x353334){_0x494b7f=_0x494b7f-0x0;var _0x37daf9=_0xd9c2[_0x494b7f];return _0x37daf9;};'use strict';var _=require(_0x2d9c('0x0'));var util=require(_0x2d9c('0x1'));var moment=require(_0x2d9c('0x2'));var BPromise=require(_0x2d9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d9c('0x4'))['db'];var utils=require(_0x2d9c('0x5'));var logger=require(_0x2d9c('0x6'))(_0x2d9c('0x7'));var config=require(_0x2d9c('0x8'));var jayson=require(_0x2d9c('0x9'));var client=jayson[_0x2d9c('0xa')][_0x2d9c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34270f,_0x4968f1,_0x4b0208){return new BPromise(function(_0x38b718,_0x5c7518){return client[_0x2d9c('0xc')](_0x34270f,_0x4b0208)[_0x2d9c('0xd')](function(_0x1467f1){logger['info'](_0x2d9c('0xe'),_0x4968f1,_0x2d9c('0xf'));logger[_0x2d9c('0x10')](_0x2d9c('0x11'),_0x4968f1,'request\x20sent',JSON[_0x2d9c('0x12')](_0x1467f1));if(_0x1467f1[_0x2d9c('0x13')]){if(_0x1467f1[_0x2d9c('0x13')][_0x2d9c('0x14')]===0x1f4){logger[_0x2d9c('0x13')](_0x2d9c('0xe'),_0x4968f1,_0x1467f1['error'][_0x2d9c('0x15')]);return _0x5c7518(_0x1467f1[_0x2d9c('0x13')][_0x2d9c('0x15')]);}logger[_0x2d9c('0x13')](_0x2d9c('0xe'),_0x4968f1,_0x1467f1['error']['message']);return _0x38b718(_0x1467f1[_0x2d9c('0x13')][_0x2d9c('0x15')]);}else{logger[_0x2d9c('0x16')]('Disposition,\x20%s,\x20%s',_0x4968f1,_0x2d9c('0xf'));_0x38b718(_0x1467f1[_0x2d9c('0x17')][_0x2d9c('0x15')]);}})[_0x2d9c('0x18')](function(_0x1ce654){logger[_0x2d9c('0x13')]('Disposition,\x20%s,\x20%s',_0x4968f1,_0x1ce654);_0x5c7518(_0x1ce654);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 6402134..762692d 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 _0x272a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','put','delete','multer','util','path','connect-timeout','express'];(function(_0x5066ce,_0x21d632){var _0x506ac4=function(_0x1a0242){while(--_0x1a0242){_0x5066ce['push'](_0x5066ce['shift']());}};_0x506ac4(++_0x21d632);}(_0x272a,0x175));var _0xa272=function(_0x15f724,_0x2794ef){_0x15f724=_0x15f724-0x0;var _0x49b152=_0x272a[_0x15f724];return _0x49b152;};'use strict';var multer=require(_0xa272('0x0'));var util=require(_0xa272('0x1'));var path=require(_0xa272('0x2'));var timeout=require(_0xa272('0x3'));var express=require(_0xa272('0x4'));var router=express[_0xa272('0x5')]();var fs_extra=require(_0xa272('0x6'));var auth=require(_0xa272('0x7'));var interaction=require(_0xa272('0x8'));var config=require(_0xa272('0x9'));var controller=require(_0xa272('0xa'));router[_0xa272('0xb')]('/',auth[_0xa272('0xc')](),controller[_0xa272('0xd')]);router[_0xa272('0xb')](_0xa272('0xe'),auth[_0xa272('0xc')](),controller[_0xa272('0xf')]);router['post']('/',auth[_0xa272('0xc')](),controller['create']);router[_0xa272('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa272('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x45a0=['create','put','delete','exports','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post'];(function(_0xd9c529,_0x19f8cc){var _0x146760=function(_0x1aa5e8){while(--_0x1aa5e8){_0xd9c529['push'](_0xd9c529['shift']());}};_0x146760(++_0x19f8cc);}(_0x45a0,0xc8));var _0x045a=function(_0x1f67c6,_0x507914){_0x1f67c6=_0x1f67c6-0x0;var _0x39a04c=_0x45a0[_0x1f67c6];return _0x39a04c;};'use strict';var multer=require('multer');var util=require(_0x045a('0x0'));var path=require(_0x045a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x045a('0x2'));var interaction=require(_0x045a('0x3'));var config=require(_0x045a('0x4'));var controller=require('./disposition.controller');router[_0x045a('0x5')]('/',auth[_0x045a('0x6')](),controller['index']);router['get'](_0x045a('0x7'),auth[_0x045a('0x6')](),controller[_0x045a('0x8')]);router[_0x045a('0x9')]('/',auth['isAuthenticated'](),controller[_0x045a('0xa')]);router[_0x045a('0xb')](_0x045a('0x7'),auth[_0x045a('0x6')](),controller['update']);router[_0x045a('0xc')](_0x045a('0x7'),auth[_0x045a('0x6')](),controller['destroy']);module[_0x045a('0xd')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 1b37d2b..d0f44ae 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 _0x76f1=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','12000','14400','2400','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x234be5,_0x2fd7c2){var _0x43d0ad=function(_0x2ad5dd){while(--_0x2ad5dd){_0x234be5['push'](_0x234be5['shift']());}};_0x43d0ad(++_0x2fd7c2);}(_0x76f1,0xd3));var _0x176f=function(_0x5303b2,_0x4a8450){_0x5303b2=_0x5303b2-0x0;var _0x30d0f4=_0x76f1[_0x5303b2];return _0x30d0f4;};'use strict';var Sequelize=require(_0x176f('0x0'));module[_0x176f('0x1')]={'name':{'type':Sequelize[_0x176f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x176f('0x3')](_0x176f('0x4'),'no'),'defaultValue':_0x176f('0x4')},'headerinfo':{'type':Sequelize[_0x176f('0x2')],'defaultValue':_0x176f('0x5')},'localstationid':{'type':Sequelize[_0x176f('0x2')],'unique':_0x176f('0x6')},'minrate':{'type':Sequelize[_0x176f('0x3')]('2400',_0x176f('0x7'),_0x176f('0x8'),'9600',_0x176f('0x9'),_0x176f('0xa')),'defaultValue':_0x176f('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0x176f('0xb'),_0x176f('0x7'),_0x176f('0x8'),'9600',_0x176f('0x9'),_0x176f('0xa')),'defaultValue':_0x176f('0xa')},'modem':{'type':Sequelize[_0x176f('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x176f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x176f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x176f('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x176f('0x3')](_0x176f('0xd'),_0x176f('0xe'),_0x176f('0xf'),_0x176f('0x10')),'defaultValue':_0x176f('0xd')},'key':{'type':Sequelize[_0x176f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x176f('0x11');}},'notificationSound':{'type':Sequelize[_0x176f('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x176f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x176f('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x176f('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x176f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x176f('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x176f('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x176f('0x12')],'defaultValue':![],'comment':_0x176f('0x14'),'set':function(_0x367163){if(!_0x367163)this[_0x176f('0x15')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x176f('0x16'),_0x367163);}}}; \ No newline at end of file +var _0x59f8=['SIP','KHOMP','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','mandatoryDisposition','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','12000','14400','9600','v17,v27,v29'];(function(_0x1dc351,_0xb21969){var _0xa08349=function(_0x4e1131){while(--_0x4e1131){_0x1dc351['push'](_0x1dc351['shift']());}};_0xa08349(++_0xb21969);}(_0x59f8,0x1d8));var _0x859f=function(_0x10dfad,_0x1a7fca){_0x10dfad=_0x10dfad-0x0;var _0x5b2e1b=_0x59f8[_0x10dfad];return _0x5b2e1b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x859f('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x859f('0x0')]},'ecm':{'type':Sequelize[_0x859f('0x1')](_0x859f('0x2'),'no'),'defaultValue':_0x859f('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x859f('0x3')},'localstationid':{'type':Sequelize[_0x859f('0x0')],'unique':_0x859f('0x4')},'minrate':{'type':Sequelize[_0x859f('0x1')](_0x859f('0x5'),_0x859f('0x6'),_0x859f('0x7'),'9600',_0x859f('0x8'),_0x859f('0x9')),'defaultValue':_0x859f('0x6')},'maxrate':{'type':Sequelize[_0x859f('0x1')]('2400',_0x859f('0x6'),_0x859f('0x7'),_0x859f('0xa'),_0x859f('0x8'),_0x859f('0x9')),'defaultValue':_0x859f('0x9')},'modem':{'type':Sequelize[_0x859f('0x0')],'defaultValue':_0x859f('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x859f('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x859f('0x1')](_0x859f('0xc'),'IAX','DADHI',_0x859f('0xd')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x859f('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x859f('0xe')],'defaultValue':function(){return _0x859f('0xf');}},'notificationSound':{'type':Sequelize[_0x859f('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x859f('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x859f('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x859f('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x859f('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x859f('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x859f('0x13'),'set':function(_0x100bd3){if(!_0x100bd3)this[_0x859f('0x14')]('mandatoryDispositionPauseId',null);this[_0x859f('0x14')](_0x859f('0x15'),_0x100bd3);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index c59e875..c722035 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 _0xb10b=['VIRTUAL','options','FaxAccount','count','includeAll','include','findAll','rows','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','nolimit','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','exten','system','description','Fax\x20Extension','appdata','push','Set','ecm','localstationid','gateway','faxdetect','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','addAccountApplications','VoiceExtension','tech','createdAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','updatedAt','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','ContactId','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xb10b,0x12a));var _0xbb10=function(_0x6ab30c,_0x2c713b){_0x6ab30c=_0x6ab30c-0x0;var _0x36e953=_0xb10b[_0x6ab30c];return _0x36e953;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config['redis']));require(_0xbb10('0x1c'))[_0xbb10('0x1d')](socket);var jayson=require(_0xbb10('0x1e'));var client=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232c});var client9002=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x36b5e8,_0x3e26f4,_0x2b184e,_0x4a2bfc){return new BPromise(function(_0x2eca0f,_0x1145f1){var _0x133ac2=_0x4a2bfc||client;return _0x133ac2[_0xbb10('0x21')](_0x36b5e8,_0x2b184e)[_0xbb10('0x22')](function(_0x1682a4){logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x3e26f4,_0xbb10('0x25'));logger[_0xbb10('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3e26f4,_0xbb10('0x25'),JSON[_0xbb10('0x27')](_0x1682a4));if(_0x1682a4[_0xbb10('0x28')]){if(_0x1682a4[_0xbb10('0x28')][_0xbb10('0x29')]===0x1f4){logger[_0xbb10('0x28')]('FaxAccount,\x20%s,\x20%s',_0x3e26f4,_0x1682a4[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x1145f1(_0x1682a4['error']['message']);}logger[_0xbb10('0x28')](_0xbb10('0x24'),_0x3e26f4,_0x1682a4[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x2eca0f(_0x1682a4[_0xbb10('0x28')][_0xbb10('0x2a')]);}else{logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x3e26f4,_0xbb10('0x25'));_0x2eca0f(_0x1682a4[_0xbb10('0x2b')][_0xbb10('0x2a')]);}})[_0xbb10('0x2c')](function(_0x537898){logger['error']('FaxAccount,\x20%s,\x20%s',_0x3e26f4,_0x537898);_0x1145f1(_0x537898);});});}function respondWithStatusCode(_0xc93a04,_0x3c5ae7){_0x3c5ae7=_0x3c5ae7||0xcc;return function(_0x2c89b9){if(_0x2c89b9){return _0xc93a04['sendStatus'](_0x3c5ae7);}return _0xc93a04[_0xbb10('0x2d')](_0x3c5ae7)[_0xbb10('0x2e')]();};}function respondWithResult(_0x6ed43b,_0x1d5e95){_0x1d5e95=_0x1d5e95||0xc8;return function(_0x1acce9){if(_0x1acce9){return _0x6ed43b[_0xbb10('0x2d')](_0x1d5e95)[_0xbb10('0x2f')](_0x1acce9);}};}function respondWithFilteredResult(_0x4aabb9,_0x3796c7){return function(_0x21ac54){if(_0x21ac54){var _0xfc3595=_0x21ac54['count'],_0x2e0249=_0x3796c7[_0xbb10('0x30')],_0x1d30aa=_0x3796c7['offset']+_0x3796c7[_0xbb10('0x31')],_0x2ff4c1;if(_0x1d30aa>=_0xfc3595){_0x1d30aa=_0xfc3595;_0x2ff4c1=0xc8;}else{_0x2ff4c1=0xce;}_0x4aabb9['status'](_0x2ff4c1);return _0x4aabb9[_0xbb10('0x32')](_0xbb10('0x33'),_0x2e0249+'-'+_0x1d30aa+'/'+_0xfc3595)[_0xbb10('0x2f')](_0x21ac54);}return null;};}function patchUpdates(_0x491db4){return function(_0x518d47){try{jsonpatch[_0xbb10('0x34')](_0x518d47,_0x491db4,!![]);}catch(_0x34f65e){return BPromise['reject'](_0x34f65e);}return _0x518d47[_0xbb10('0x35')]();};}function saveUpdates(_0x37dde7,_0x2f653f){return function(_0x1c0b57){if(_0x1c0b57){return _0x1c0b57[_0xbb10('0x36')](_0x37dde7)[_0xbb10('0x22')](function(_0xf85197){return _0xf85197;});}return null;};}function removeEntity(_0x4975f5,_0x25acb3){return function(_0x1da9c9){if(_0x1da9c9){return _0x1da9c9[_0xbb10('0x37')]()[_0xbb10('0x22')](function(){var _0xfb2c5e=_0x1da9c9[_0xbb10('0x38')]({'plain':!![]});var _0x188cbd=_0xbb10('0x39');return db[_0xbb10('0x3a')]['destroy']({'where':{'type':_0x188cbd,'resourceId':_0xfb2c5e['id']}})[_0xbb10('0x22')](function(){return _0x1da9c9;});})[_0xbb10('0x22')](function(){_0x4975f5[_0xbb10('0x2d')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x570f5a,_0x111762){return function(_0x5de37b){if(!_0x5de37b){_0x570f5a['sendStatus'](0x194);}return _0x5de37b;};}function handleError(_0x3eb3cc,_0x40c164){_0x40c164=_0x40c164||0x1f4;return function(_0x26e76a){logger[_0xbb10('0x28')](_0x26e76a[_0xbb10('0x3b')]);if(_0x26e76a[_0xbb10('0x3c')]){delete _0x26e76a['name'];}_0x3eb3cc[_0xbb10('0x2d')](_0x40c164)[_0xbb10('0x3d')](_0x26e76a);};}exports['index']=function(_0x5e3fbd,_0x5cd55f){var _0x31bee3={'include':[{'model':db['Pause'],'as':_0xbb10('0x3e')}]},_0x2b0b45={},_0x2b658a={'count':0x0,'rows':[]};var _0x3e8538=_[_0xbb10('0x3f')](db['FaxAccount'][_0xbb10('0x40')],function(_0x12238a){return{'name':_0x12238a[_0xbb10('0x41')],'type':_0x12238a[_0xbb10('0x42')]['key']};});_0x2b0b45[_0xbb10('0x43')]=_[_0xbb10('0x3f')](_0x3e8538,'name');_0x2b0b45[_0xbb10('0x44')]=_[_0xbb10('0x45')](_0x5e3fbd[_0xbb10('0x44')]);_0x2b0b45[_0xbb10('0x46')]=_[_0xbb10('0x47')](_0x2b0b45[_0xbb10('0x43')],_0x2b0b45['query']);_0x31bee3[_0xbb10('0x48')]=_[_0xbb10('0x47')](_0x2b0b45[_0xbb10('0x43')],qs[_0xbb10('0x49')](_0x5e3fbd['query'][_0xbb10('0x49')]));_0x31bee3[_0xbb10('0x48')]=_0x31bee3[_0xbb10('0x48')][_0xbb10('0x4a')]?_0x31bee3['attributes']:_0x2b0b45[_0xbb10('0x43')];if(!_0x5e3fbd[_0xbb10('0x44')]['hasOwnProperty']('nolimit')){_0x31bee3[_0xbb10('0x31')]=qs['limit'](_0x5e3fbd[_0xbb10('0x44')][_0xbb10('0x31')]);_0x31bee3['offset']=qs[_0xbb10('0x30')](_0x5e3fbd[_0xbb10('0x44')][_0xbb10('0x30')]);}_0x31bee3['order']=qs[_0xbb10('0x4b')](_0x5e3fbd[_0xbb10('0x44')][_0xbb10('0x4b')]);_0x31bee3[_0xbb10('0x4c')]=qs[_0xbb10('0x46')](_[_0xbb10('0x4d')](_0x5e3fbd[_0xbb10('0x44')],_0x2b0b45[_0xbb10('0x46')]),_0x3e8538);if(_0x5e3fbd[_0xbb10('0x44')][_0xbb10('0x4e')]){_0x31bee3[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x31bee3['where'],{'$or':_[_0xbb10('0x3f')](_0x3e8538,function(_0x41bbf8){if(_0x41bbf8['type']!==_0xbb10('0x50')){var _0x2f5027={};_0x2f5027[_0x41bbf8[_0xbb10('0x3c')]]={'$like':'%'+_0x5e3fbd[_0xbb10('0x44')][_0xbb10('0x4e')]+'%'};return _0x2f5027;}})});}_0x31bee3=_[_0xbb10('0x4f')]({},_0x31bee3,_0x5e3fbd[_0xbb10('0x51')]);var _0x5be85e={'where':_0x31bee3['where']};return db[_0xbb10('0x52')][_0xbb10('0x53')](_0x5be85e)[_0xbb10('0x22')](function(_0x57d2c0){_0x2b658a['count']=_0x57d2c0;if(_0x5e3fbd[_0xbb10('0x44')][_0xbb10('0x54')]){_0x31bee3[_0xbb10('0x55')]=[{'all':!![]}];}return db[_0xbb10('0x52')][_0xbb10('0x56')](_0x31bee3);})[_0xbb10('0x22')](function(_0x2f2552){_0x2b658a[_0xbb10('0x57')]=_0x2f2552;return _0x2b658a;})[_0xbb10('0x22')](respondWithFilteredResult(_0x5cd55f,_0x31bee3))[_0xbb10('0x2c')](handleError(_0x5cd55f,null));};exports['show']=function(_0x5eafac,_0x412e13){var _0x467dba={'raw':![],'where':{'id':_0x5eafac[_0xbb10('0x58')]['id']},'include':[{'model':db[_0xbb10('0x59')],'as':_0xbb10('0x3e')}]},_0x36ab7d={};_0x36ab7d[_0xbb10('0x43')]=_[_0xbb10('0x45')](db[_0xbb10('0x52')][_0xbb10('0x40')]);_0x36ab7d[_0xbb10('0x44')]=_[_0xbb10('0x45')](_0x5eafac[_0xbb10('0x44')]);_0x36ab7d[_0xbb10('0x46')]=_[_0xbb10('0x47')](_0x36ab7d['model'],_0x36ab7d[_0xbb10('0x44')]);_0x467dba['attributes']=_[_0xbb10('0x47')](_0x36ab7d[_0xbb10('0x43')],qs[_0xbb10('0x49')](_0x5eafac[_0xbb10('0x44')][_0xbb10('0x49')]));_0x467dba[_0xbb10('0x48')]=_0x467dba[_0xbb10('0x48')][_0xbb10('0x4a')]?_0x467dba[_0xbb10('0x48')]:_0x36ab7d[_0xbb10('0x43')];if(_0x5eafac[_0xbb10('0x44')][_0xbb10('0x54')]){_0x467dba[_0xbb10('0x55')]=[{'all':!![]}];}_0x467dba=_[_0xbb10('0x4f')]({},_0x467dba,_0x5eafac[_0xbb10('0x51')]);return db['FaxAccount'][_0xbb10('0x5a')](_0x467dba)[_0xbb10('0x22')](handleEntityNotFound(_0x412e13,null))[_0xbb10('0x22')](respondWithResult(_0x412e13,null))[_0xbb10('0x2c')](handleError(_0x412e13,null));};exports[_0xbb10('0x5b')]=function(_0x379d8c,_0x4bedd0){return db[_0xbb10('0x52')][_0xbb10('0x5b')](_0x379d8c[_0xbb10('0x5c')],{})[_0xbb10('0x22')](function(_0x432728){var _0x22de7f=_0x379d8c[_0xbb10('0x5d')][_0xbb10('0x38')]({'plain':!![]});if(!_0x22de7f)throw new Error(_0xbb10('0x5e'));if(_0x22de7f[_0xbb10('0x5f')]===_0xbb10('0x5d')){var _0x2a1ce1=_0x432728[_0xbb10('0x38')]({'plain':!![]});var _0x4e7fac='FaxAccounts';return db[_0xbb10('0x60')][_0xbb10('0x5a')]({'where':{'name':_0x4e7fac,'userProfileId':_0x22de7f[_0xbb10('0x61')]},'raw':!![]})[_0xbb10('0x22')](function(_0x5573bb){if(_0x5573bb&&_0x5573bb['autoAssociation']===0x0){return db[_0xbb10('0x3a')][_0xbb10('0x5b')]({'name':_0x2a1ce1[_0xbb10('0x3c')],'resourceId':_0x2a1ce1['id'],'type':_0x5573bb[_0xbb10('0x3c')],'sectionId':_0x5573bb['id']},{})[_0xbb10('0x22')](function(){return _0x432728;});}else{return _0x432728;}})[_0xbb10('0x2c')](function(_0x45c0dc){logger['error'](_0xbb10('0x62'),_0x45c0dc);throw _0x45c0dc;});}return _0x432728;})[_0xbb10('0x22')](respondWithResult(_0x4bedd0,0xc9))['catch'](handleError(_0x4bedd0,null));};exports['update']=function(_0x5a231f,_0x32c1e8){if(_0x5a231f[_0xbb10('0x5c')]['id']){delete _0x5a231f[_0xbb10('0x5c')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x5a231f['params']['id']},'include':[{'model':db[_0xbb10('0x59')],'as':_0xbb10('0x3e')}]})[_0xbb10('0x22')](handleEntityNotFound(_0x32c1e8,null))['then'](saveUpdates(_0x5a231f[_0xbb10('0x5c')],null))[_0xbb10('0x22')](respondWithResult(_0x32c1e8,null))['catch'](handleError(_0x32c1e8,null));};exports['destroy']=function(_0x27d7b9,_0x308896){return db[_0xbb10('0x52')][_0xbb10('0x5a')]({'where':{'id':_0x27d7b9['params']['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x308896,null))[_0xbb10('0x22')](removeEntity(_0x308896,null))[_0xbb10('0x2c')](handleError(_0x308896,null));};exports['describe']=function(_0x402a01,_0x2f05bc){return db[_0xbb10('0x52')]['describe']()[_0xbb10('0x22')](respondWithResult(_0x2f05bc,null))[_0xbb10('0x2c')](handleError(_0x2f05bc,null));};exports[_0xbb10('0x63')]=function(_0x37b65f,_0x5e4a6e,_0x251417){if(_0x37b65f[_0xbb10('0x5c')]['id']){delete _0x37b65f[_0xbb10('0x5c')]['id'];}return db[_0xbb10('0x52')]['find']({'where':{'id':_0x37b65f[_0xbb10('0x58')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5e4a6e,null))[_0xbb10('0x22')](function(_0x2ceb3e){if(_0x2ceb3e){_0x37b65f[_0xbb10('0x5c')][_0xbb10('0x64')]=_0x2ceb3e['id'];return db[_0xbb10('0x65')]['create'](_0x37b65f['body']);}})['then'](respondWithResult(_0x5e4a6e,null))[_0xbb10('0x2c')](handleError(_0x5e4a6e,null));};exports[_0xbb10('0x66')]=function(_0x3eda96,_0x5c9afc,_0x5cd089){var _0x46f462={'raw':![],'where':{}};var _0x1b11c0={};var _0xd9e743={'count':0x0,'rows':[]};return db[_0xbb10('0x52')][_0xbb10('0x67')]({'where':{'id':_0x3eda96[_0xbb10('0x58')]['id']}})['then'](handleEntityNotFound(_0x5c9afc,null))[_0xbb10('0x22')](function(_0x15fae2){if(_0x15fae2){_0x1b11c0[_0xbb10('0x43')]=_[_0xbb10('0x45')](db[_0xbb10('0x65')]['rawAttributes']);_0x1b11c0['query']=_['keys'](_0x3eda96[_0xbb10('0x44')]);_0x1b11c0[_0xbb10('0x46')]=_[_0xbb10('0x47')](_0x1b11c0[_0xbb10('0x43')],_0x1b11c0[_0xbb10('0x44')]);_0x46f462[_0xbb10('0x48')]=_['intersection'](_0x1b11c0[_0xbb10('0x43')],qs['fields'](_0x3eda96['query']['fields']));_0x46f462[_0xbb10('0x48')]=_0x46f462[_0xbb10('0x48')][_0xbb10('0x4a')]?_0x46f462[_0xbb10('0x48')]:_0x1b11c0['model'];if(!_0x3eda96[_0xbb10('0x44')]['hasOwnProperty']('nolimit')){_0x46f462[_0xbb10('0x31')]=qs[_0xbb10('0x31')](_0x3eda96[_0xbb10('0x44')][_0xbb10('0x31')]);_0x46f462[_0xbb10('0x30')]=qs['offset'](_0x3eda96[_0xbb10('0x44')][_0xbb10('0x30')]);}_0x46f462[_0xbb10('0x68')]=qs[_0xbb10('0x4b')](_0x3eda96[_0xbb10('0x44')][_0xbb10('0x4b')]);_0x46f462[_0xbb10('0x4c')]=qs['filters'](_[_0xbb10('0x4d')](_0x3eda96[_0xbb10('0x44')],_0x1b11c0[_0xbb10('0x46')]));_0x46f462[_0xbb10('0x4c')][_0xbb10('0x64')]=_0x15fae2['id'];if(_0x3eda96[_0xbb10('0x44')][_0xbb10('0x4e')]){_0x46f462[_0xbb10('0x4c')]=_['merge'](_0x46f462[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x3f')](_0x46f462[_0xbb10('0x48')],function(_0x56416a){var _0x4ee101={};_0x4ee101[_0x56416a]={'$like':'%'+_0x3eda96['query'][_0xbb10('0x4e')]+'%'};return _0x4ee101;})});}_0x46f462=_['merge']({},_0x46f462,_0x3eda96['options']);return db[_0xbb10('0x65')][_0xbb10('0x53')]({'where':_0x46f462[_0xbb10('0x4c')]})[_0xbb10('0x22')](function(_0x32ec27){_0xd9e743[_0xbb10('0x53')]=_0x32ec27;if(_0x3eda96[_0xbb10('0x44')][_0xbb10('0x54')]){_0x46f462[_0xbb10('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xbb10('0x56')](_0x46f462);})[_0xbb10('0x22')](function(_0x46b6d2){_0xd9e743[_0xbb10('0x57')]=_0x46b6d2;return _0xd9e743;});}})['then'](respondWithFilteredResult(_0x5c9afc,_0x46f462))['catch'](handleError(_0x5c9afc,null));};exports[_0xbb10('0x69')]=function(_0x2280bd,_0x30f0a4,_0x32bb25){return db['FaxAccount'][_0xbb10('0x5a')]({'where':{'id':_0x2280bd[_0xbb10('0x58')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x30f0a4,null))[_0xbb10('0x22')](function(_0x35c1e8){if(_0x35c1e8){return _0x35c1e8['removeDispositions'](_0x2280bd['query'][_0xbb10('0x6a')]);}})[_0xbb10('0x22')](respondWithStatusCode(_0x30f0a4,null))[_0xbb10('0x2c')](handleError(_0x30f0a4,null));};exports['addAnswer']=function(_0x256b35,_0x13e2ab,_0x50bcc9){if(_0x256b35['body']['id']){delete _0x256b35[_0xbb10('0x5c')]['id'];}return db[_0xbb10('0x52')][_0xbb10('0x5a')]({'where':{'id':_0x256b35['params']['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x13e2ab,null))[_0xbb10('0x22')](function(_0xfbb365){if(_0xfbb365){_0x256b35[_0xbb10('0x5c')][_0xbb10('0x64')]=_0xfbb365['id'];return db[_0xbb10('0x6b')][_0xbb10('0x5b')](_0x256b35[_0xbb10('0x5c')]);}})[_0xbb10('0x22')](respondWithResult(_0x13e2ab,null))['catch'](handleError(_0x13e2ab,null));};exports[_0xbb10('0x6c')]=function(_0x28cc46,_0x412fbf,_0xdb7d3e){var _0x3e3083={'raw':![],'where':{}};var _0x39f64b={};var _0x33a6fc={'count':0x0,'rows':[]};return db[_0xbb10('0x52')][_0xbb10('0x67')]({'where':{'id':_0x28cc46[_0xbb10('0x58')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x412fbf,null))[_0xbb10('0x22')](function(_0x59e985){if(_0x59e985){_0x39f64b['model']=_[_0xbb10('0x45')](db[_0xbb10('0x6b')][_0xbb10('0x40')]);_0x39f64b[_0xbb10('0x44')]=_[_0xbb10('0x45')](_0x28cc46['query']);_0x39f64b[_0xbb10('0x46')]=_[_0xbb10('0x47')](_0x39f64b[_0xbb10('0x43')],_0x39f64b[_0xbb10('0x44')]);_0x3e3083[_0xbb10('0x48')]=_[_0xbb10('0x47')](_0x39f64b['model'],qs[_0xbb10('0x49')](_0x28cc46[_0xbb10('0x44')]['fields']));_0x3e3083[_0xbb10('0x48')]=_0x3e3083['attributes'][_0xbb10('0x4a')]?_0x3e3083[_0xbb10('0x48')]:_0x39f64b[_0xbb10('0x43')];if(!_0x28cc46[_0xbb10('0x44')][_0xbb10('0x6d')]('nolimit')){_0x3e3083[_0xbb10('0x31')]=qs['limit'](_0x28cc46[_0xbb10('0x44')][_0xbb10('0x31')]);_0x3e3083['offset']=qs['offset'](_0x28cc46[_0xbb10('0x44')][_0xbb10('0x30')]);}_0x3e3083[_0xbb10('0x68')]=qs[_0xbb10('0x4b')](_0x28cc46[_0xbb10('0x44')][_0xbb10('0x4b')]);_0x3e3083[_0xbb10('0x4c')]=qs[_0xbb10('0x46')](_[_0xbb10('0x4d')](_0x28cc46[_0xbb10('0x44')],_0x39f64b[_0xbb10('0x46')]));_0x3e3083['where'][_0xbb10('0x64')]=_0x59e985['id'];if(_0x28cc46[_0xbb10('0x44')][_0xbb10('0x4e')]){_0x3e3083[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x3e3083[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x3f')](_0x3e3083[_0xbb10('0x48')],function(_0x3e6fe2){var _0x18a136={};_0x18a136[_0x3e6fe2]={'$like':'%'+_0x28cc46[_0xbb10('0x44')][_0xbb10('0x4e')]+'%'};return _0x18a136;})});}_0x3e3083=_['merge']({},_0x3e3083,_0x28cc46[_0xbb10('0x51')]);return db['CannedAnswer'][_0xbb10('0x53')]({'where':_0x3e3083[_0xbb10('0x4c')]})[_0xbb10('0x22')](function(_0x40236c){_0x33a6fc[_0xbb10('0x53')]=_0x40236c;if(_0x28cc46['query'][_0xbb10('0x54')]){_0x3e3083[_0xbb10('0x55')]=[{'all':!![]}];}return db[_0xbb10('0x6b')][_0xbb10('0x56')](_0x3e3083);})[_0xbb10('0x22')](function(_0x41380b){_0x33a6fc['rows']=_0x41380b;return _0x33a6fc;});}})['then'](respondWithFilteredResult(_0x412fbf,_0x3e3083))[_0xbb10('0x2c')](handleError(_0x412fbf,null));};exports[_0xbb10('0x6e')]=function(_0x41d4d0,_0x57d5a1,_0x124b32){return db[_0xbb10('0x52')]['find']({'where':{'id':_0x41d4d0[_0xbb10('0x58')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x57d5a1,null))['then'](function(_0xdd3c7e){if(_0xdd3c7e){return _0xdd3c7e['removeAnswers'](_0x41d4d0[_0xbb10('0x44')][_0xbb10('0x6a')]);}})['then'](respondWithStatusCode(_0x57d5a1,null))[_0xbb10('0x2c')](handleError(_0x57d5a1,null));};exports[_0xbb10('0x6f')]=function(_0x4bac29,_0x5dae56,_0xea6bf2){return db[_0xbb10('0x70')][_0xbb10('0x5a')]({'where':{'id':_0x4bac29[_0xbb10('0x58')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5dae56,null))['then'](function(_0xe7c0a3){if(_0xe7c0a3){return _0xe7c0a3[_0xbb10('0x6f')](_0x4bac29[_0xbb10('0x5c')]['ids'],_[_0xbb10('0x71')](_0x4bac29[_0xbb10('0x5c')],[_0xbb10('0x6a'),'id'])||{});}})[_0xbb10('0x22')](respondWithResult(_0x5dae56,null))[_0xbb10('0x2c')](handleError(_0x5dae56,null));};exports[_0xbb10('0x72')]=function(_0x1f55d3,_0x189f07,_0x2010d4){var _0x5f1fcd={'raw':![],'where':{}};var _0x4fc544={};var _0x37e40c={'count':0x0,'rows':[]};return db[_0xbb10('0x52')][_0xbb10('0x67')]({'where':{'id':_0x1f55d3[_0xbb10('0x58')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x189f07,null))[_0xbb10('0x22')](function(_0x1cccec){if(_0x1cccec){_0x4fc544[_0xbb10('0x43')]=_[_0xbb10('0x45')](db[_0xbb10('0x70')][_0xbb10('0x40')]);_0x4fc544[_0xbb10('0x44')]=_[_0xbb10('0x45')](_0x1f55d3['query']);_0x4fc544[_0xbb10('0x46')]=_[_0xbb10('0x47')](_0x4fc544[_0xbb10('0x43')],_0x4fc544[_0xbb10('0x44')]);_0x5f1fcd[_0xbb10('0x48')]=_[_0xbb10('0x47')](_0x4fc544[_0xbb10('0x43')],qs[_0xbb10('0x49')](_0x1f55d3[_0xbb10('0x44')][_0xbb10('0x49')]));_0x5f1fcd[_0xbb10('0x48')]=_0x5f1fcd['attributes'][_0xbb10('0x4a')]?_0x5f1fcd['attributes']:_0x4fc544[_0xbb10('0x43')];if(!_0x1f55d3[_0xbb10('0x44')][_0xbb10('0x6d')](_0xbb10('0x73'))){_0x5f1fcd[_0xbb10('0x31')]=qs[_0xbb10('0x31')](_0x1f55d3['query'][_0xbb10('0x31')]);_0x5f1fcd['offset']=qs[_0xbb10('0x30')](_0x1f55d3[_0xbb10('0x44')][_0xbb10('0x30')]);}_0x5f1fcd[_0xbb10('0x68')]=qs[_0xbb10('0x4b')](_0x1f55d3[_0xbb10('0x44')][_0xbb10('0x4b')]);_0x5f1fcd[_0xbb10('0x4c')]=qs[_0xbb10('0x46')](_[_0xbb10('0x4d')](_0x1f55d3[_0xbb10('0x44')],_0x4fc544[_0xbb10('0x46')]));_0x5f1fcd['where'][_0xbb10('0x64')]=_0x1cccec['id'];if(_0x1f55d3['query'][_0xbb10('0x4e')]){_0x5f1fcd[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x5f1fcd[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x3f')](_0x5f1fcd[_0xbb10('0x48')],function(_0x185ec9){var _0x5e9888={};_0x5e9888[_0x185ec9]={'$like':'%'+_0x1f55d3[_0xbb10('0x44')]['filter']+'%'};return _0x5e9888;})});}_0x5f1fcd=_['merge']({},_0x5f1fcd,_0x1f55d3[_0xbb10('0x51')]);return db[_0xbb10('0x70')][_0xbb10('0x53')]({'where':_0x5f1fcd[_0xbb10('0x4c')]})[_0xbb10('0x22')](function(_0x16b8c1){_0x37e40c['count']=_0x16b8c1;if(_0x1f55d3[_0xbb10('0x44')][_0xbb10('0x54')]){_0x5f1fcd[_0xbb10('0x55')]=[{'model':db[_0xbb10('0x74')],'as':_0xbb10('0x75'),'required':![]},{'model':db[_0xbb10('0x76')],'as':'Owner','attributes':[_0xbb10('0x3c'),_0xbb10('0x77'),_0xbb10('0x78')],'required':![]},{'model':db[_0xbb10('0x79')],'as':_0xbb10('0x7a'),'attributes':['id',_0xbb10('0x3c'),_0xbb10('0x7b')],'where':_0x1f55d3['query'][_0xbb10('0x7c')]?{'id':_0x1f55d3['query'][_0xbb10('0x7c')]}:undefined,'required':_0x1f55d3['query']['tag']?!![]:![]}];}return db[_0xbb10('0x70')][_0xbb10('0x56')](_0x5f1fcd);})[_0xbb10('0x22')](function(_0x3b7552){_0x37e40c[_0xbb10('0x57')]=_0x3b7552;return _0x37e40c;});}})['then'](respondWithFilteredResult(_0x189f07,_0x5f1fcd))[_0xbb10('0x2c')](handleError(_0x189f07,null));};exports['addApplications']=function(_0x4b877c,_0x4dd138,_0xa00798){return db[_0xbb10('0x52')][_0xbb10('0x67')]({'where':{'id':_0x4b877c[_0xbb10('0x58')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4dd138,null))['then'](function(_0x125bcf){if(_0x125bcf){return db[_0xbb10('0x7d')][_0xbb10('0x7e')](function(_0x1bd1c1){return db[_0xbb10('0x7f')][_0xbb10('0x37')]({'where':{'FaxAccountId':_0x4b877c[_0xbb10('0x58')]['id']},'transaction':_0x1bd1c1})['then'](function(_0x4c95c2){var _0x584a62=_[_0xbb10('0x3f')](_0x4b877c[_0xbb10('0x5c')],function(_0x2ae3c6){_0x2ae3c6[_0xbb10('0x64')]=_0x4b877c[_0xbb10('0x58')]['id'];return _0x2ae3c6;});return db[_0xbb10('0x7f')][_0xbb10('0x80')](_0x584a62,{'transaction':_0x1bd1c1});});})[_0xbb10('0x22')](function(){return db[_0xbb10('0x7f')][_0xbb10('0x81')]({'where':{'FaxAccountId':_0x4b877c['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4dd138,null))[_0xbb10('0x2c')](handleError(_0x4dd138,null));};exports[_0xbb10('0x82')]=function(_0x7984c1,_0x47c820,_0x2bfa8e){var _0x2f6be3={};var _0x2c638d={};var _0x290280;var _0x2a6589;return db[_0xbb10('0x52')]['findOne']({'where':{'id':_0x7984c1['params']['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x47c820,null))['then'](function(_0x370215){if(_0x370215){_0x290280=_0x370215;_0x2c638d[_0xbb10('0x43')]=_[_0xbb10('0x45')](db[_0xbb10('0x7f')][_0xbb10('0x40')]);_0x2c638d[_0xbb10('0x44')]=_[_0xbb10('0x45')](_0x7984c1[_0xbb10('0x44')]);_0x2c638d[_0xbb10('0x46')]=_[_0xbb10('0x47')](_0x2c638d['model'],_0x2c638d[_0xbb10('0x44')]);_0x2f6be3['attributes']=_[_0xbb10('0x47')](_0x2c638d['model'],qs[_0xbb10('0x49')](_0x7984c1[_0xbb10('0x44')][_0xbb10('0x49')]));_0x2f6be3[_0xbb10('0x48')]=_0x2f6be3['attributes'][_0xbb10('0x4a')]?_0x2f6be3['attributes']:_0x2c638d[_0xbb10('0x43')];_0x2f6be3[_0xbb10('0x68')]=qs[_0xbb10('0x4b')](_0x7984c1['query'][_0xbb10('0x4b')]);_0x2f6be3[_0xbb10('0x4c')]=qs[_0xbb10('0x46')](_[_0xbb10('0x4d')](_0x7984c1[_0xbb10('0x44')],_0x2c638d[_0xbb10('0x46')]));if(_0x7984c1['query']['filter']){_0x2f6be3['where']=_[_0xbb10('0x4f')](_0x2f6be3['where'],{'$or':_[_0xbb10('0x3f')](_0x2f6be3['attributes'],function(_0xf90506){var _0x34ce1b={};_0x34ce1b[_0xf90506]={'$like':'%'+_0x7984c1[_0xbb10('0x44')]['filter']+'%'};return _0x34ce1b;})});}_0x2f6be3=_['merge']({},_0x2f6be3,_0x7984c1[_0xbb10('0x51')]);return _0x290280[_0xbb10('0x82')](_0x2f6be3);}})[_0xbb10('0x22')](function(_0x59b20f){if(_0x59b20f){_0x2a6589=_0x59b20f[_0xbb10('0x4a')];if(!_0x7984c1[_0xbb10('0x44')][_0xbb10('0x6d')]('nolimit')){_0x2f6be3['limit']=qs['limit'](_0x7984c1[_0xbb10('0x44')]['limit']);_0x2f6be3[_0xbb10('0x30')]=qs[_0xbb10('0x30')](_0x7984c1[_0xbb10('0x44')][_0xbb10('0x30')]);}return _0x290280[_0xbb10('0x82')](_0x2f6be3);}})[_0xbb10('0x22')](function(_0x14fce6){if(_0x14fce6){return _0x14fce6?{'count':_0x2a6589,'rows':_0x14fce6}:null;}})[_0xbb10('0x22')](respondWithResult(_0x47c820,null))[_0xbb10('0x2c')](handleError(_0x47c820,null));};function Extension(_0x431792,_0x2e2710,_0x4e33b6,_0xaa2353){this[_0xbb10('0x83')]='from-voip-provider';this[_0xbb10('0x84')]=_0x431792['localstationid'];this['app']=_0xaa2353;this[_0xbb10('0x42')]=_0xbb10('0x85');this[_0xbb10('0x86')]=_0xbb10('0x87');this[_0xbb10('0x64')]=_0x431792['id'];this['priority']=_0x2e2710;this[_0xbb10('0x88')]=_0x4e33b6;}function createExtensionsReciveFax(_0x18b749){var _0x4f17c1=0x1;var _0xa45726=[];_0xa45726[_0xbb10('0x89')](new Extension(_0x18b749,_0x4f17c1,'','Answer'));_0x4f17c1+=0x1;_0xa45726[_0xbb10('0x89')](new Extension(_0x18b749,_0x4f17c1,'CDR(type)=inbound-fax',_0xbb10('0x8a')));_0x4f17c1+=0x1;for(var _0x8e8049 in _0x18b749){if(_0x18b749[_0xbb10('0x6d')](_0x8e8049)&&(_0x8e8049===_0xbb10('0x8b')||_0x8e8049===_0xbb10('0x8c')||_0x8e8049===_0xbb10('0x8d')||_0x8e8049===_0xbb10('0x8e')||_0x8e8049==='headerinfo'||_0x8e8049===_0xbb10('0x8f')||_0x8e8049===_0xbb10('0x90')||_0x8e8049===_0xbb10('0x91')||_0x8e8049===_0xbb10('0x92'))){_0xa45726[_0xbb10('0x89')](new Extension(_0x18b749,_0x4f17c1,_0xbb10('0x93')+_0x8e8049+')='+_0x18b749[_0x8e8049],'Set'));_0x4f17c1+=0x1;}}_0xa45726['push'](new Extension(_0x18b749,_0x4f17c1,'6','Wait'));_0x4f17c1+=0x1;_0xa45726[_0xbb10('0x89')](new Extension(_0x18b749,_0x4f17c1,_0xbb10('0x94'),_0xbb10('0x95')));_0x4f17c1=0x0;return _0xa45726;}exports[_0xbb10('0x96')]=function(_0x57700b,_0x3b01a3,_0x3d7b4d){var _0x468e26;return db['sequelize']['transaction'](function(_0xe5b08){return db['FaxAccount'][_0xbb10('0x5b')](_0x57700b[_0xbb10('0x5c')],{'transaction':_0xe5b08})[_0xbb10('0x22')](function(_0x42276f){_0x468e26=_0x42276f[_0xbb10('0x38')]({'plain':!![]});return db[_0xbb10('0x97')][_0xbb10('0x80')](createExtensionsReciveFax(_0x468e26),{'transaction':_0xe5b08});});})['then'](function(){return _0x468e26;})[_0xbb10('0x22')](respondWithResult(_0x3b01a3,null))[_0xbb10('0x2c')](handleError(_0x3b01a3,null));};exports['updateAccountApplications']=function(_0x23301a,_0x2ab7dc,_0x32f261){var _0x5b11a2;return db['sequelize']['transaction'](function(_0x3571ba){return db[_0xbb10('0x52')]['update'](_0x23301a[_0xbb10('0x5c')],{'where':{'id':_0x23301a[_0xbb10('0x5c')]['id']},'transaction':_0x3571ba})[_0xbb10('0x22')](function(_0x24b0ea){return db[_0xbb10('0x97')][_0xbb10('0x37')]({'where':{'FaxAccountId':_0x23301a[_0xbb10('0x5c')]['id']},'transaction':_0x3571ba})['then'](function(_0x304603){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x23301a[_0xbb10('0x5c')],[_0xbb10('0x98'),'key',_0xbb10('0x99'),'updatedAt',_0xbb10('0x9a'),_0xbb10('0x9b')])),{'transaction':_0x3571ba});});});})[_0xbb10('0x22')](function(){return db['FaxAccount']['findById'](_0x23301a[_0xbb10('0x5c')]['id']);})['then'](respondWithResult(_0x2ab7dc,null))[_0xbb10('0x2c')](handleError(_0x2ab7dc,null));};exports[_0xbb10('0x9c')]=function(_0x589ecb,_0x50cd00,_0xe844b0){var _0x385bab={'raw':!![],'where':{}};var _0x30e1dd={};var _0x59eaaf={'count':0x0,'rows':[]};return db[_0xbb10('0x52')][_0xbb10('0x67')]({'where':{'id':_0x589ecb[_0xbb10('0x58')]['id']}})['then'](handleEntityNotFound(_0x50cd00,null))[_0xbb10('0x22')](function(_0x203e5a){if(_0x203e5a){_0x30e1dd[_0xbb10('0x43')]=_[_0xbb10('0x45')](db[_0xbb10('0x9d')][_0xbb10('0x40')]);_0x30e1dd[_0xbb10('0x44')]=_[_0xbb10('0x45')](_0x589ecb[_0xbb10('0x44')]);_0x30e1dd[_0xbb10('0x46')]=_[_0xbb10('0x47')](_0x30e1dd[_0xbb10('0x43')],_0x30e1dd[_0xbb10('0x44')]);_0x385bab['attributes']=_['intersection'](_0x30e1dd[_0xbb10('0x43')],qs['fields'](_0x589ecb[_0xbb10('0x44')][_0xbb10('0x49')]));_0x385bab[_0xbb10('0x48')]=_0x385bab['attributes'][_0xbb10('0x4a')]?_0x385bab[_0xbb10('0x48')]:_0x30e1dd[_0xbb10('0x43')];if(!_0x589ecb[_0xbb10('0x44')][_0xbb10('0x6d')]('nolimit')){_0x385bab[_0xbb10('0x31')]=qs[_0xbb10('0x31')](_0x589ecb[_0xbb10('0x44')][_0xbb10('0x31')]);_0x385bab[_0xbb10('0x30')]=qs[_0xbb10('0x30')](_0x589ecb['query'][_0xbb10('0x30')]);}_0x385bab[_0xbb10('0x68')]=qs['sort'](_0x589ecb[_0xbb10('0x44')][_0xbb10('0x4b')]);_0x385bab[_0xbb10('0x4c')]=qs[_0xbb10('0x46')](_[_0xbb10('0x4d')](_0x589ecb[_0xbb10('0x44')],_0x30e1dd[_0xbb10('0x46')]));_0x385bab[_0xbb10('0x4c')][_0xbb10('0x64')]=_0x203e5a['id'];if(_0x589ecb[_0xbb10('0x44')][_0xbb10('0x4e')]){_0x385bab[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x385bab[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x3f')](_0x385bab['attributes'],function(_0x12e6cb){var _0x6b5fb3={};_0x6b5fb3[_0x12e6cb]={'$like':'%'+_0x589ecb['query']['filter']+'%'};return _0x6b5fb3;})});}if(_0x589ecb[_0xbb10('0x44')][_0xbb10('0x9e')]){var _0x24810b=_0x589ecb[_0xbb10('0x44')][_0xbb10('0x9e')][_0xbb10('0x9f')](',');var _0x3a696f={};_0x3a696f[_0x24810b[0x0]]={'$gte':moment(_0x24810b[0x1])[_0xbb10('0xa0')](_0xbb10('0xa1'))};_0x385bab['where']=_['merge'](_0x385bab['where'],_0x3a696f);}_0x385bab=_['merge']({},_0x385bab,_0x589ecb['options']);return db['FaxMessage'][_0xbb10('0x53')]({'where':_0x385bab[_0xbb10('0x4c')]})[_0xbb10('0x22')](function(_0x395ac8){_0x59eaaf['count']=_0x395ac8;if(_0x589ecb[_0xbb10('0x44')][_0xbb10('0x54')]){_0x385bab[_0xbb10('0x55')]=[{'all':!![]}];}return db[_0xbb10('0x9d')]['findAll'](_0x385bab);})['then'](function(_0x3057b4){_0x59eaaf[_0xbb10('0x57')]=_0x3057b4;return _0x59eaaf;});}})['then'](respondWithFilteredResult(_0x50cd00,_0x385bab))['catch'](handleError(_0x50cd00,null));};exports[_0xbb10('0x3d')]=function(_0xf1371a,_0x3706b5,_0x3bbdff){var _0x18cda3,_0x564dc6={},_0x4744f4;if(_0xf1371a['body']['to']){_0x4744f4=_0xf1371a['body']['to'][0x0];}return db[_0xbb10('0x52')][_0xbb10('0x5a')]({'where':{'id':_0xf1371a[_0xbb10('0x58')]['id']},'include':[{'model':db[_0xbb10('0xa2')],'as':_0xbb10('0xa3'),'include':[{'model':db[_0xbb10('0x74')],'as':'Contacts','where':{'fax':_0x4744f4},'limit':0x1,'order':[[_0xbb10('0xa4'),_0xbb10('0xa5')]]}]}]})[_0xbb10('0x22')](handleEntityNotFound(_0x3706b5,null))[_0xbb10('0x22')](function(_0x6f8d2){_0x18cda3=_0x6f8d2;if(_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')]&&_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][_0xbb10('0x4a')]){for(var _0xbae19c=0x0;_0xbae19c<_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][_0xbb10('0x4a')];_0xbae19c+=0x1){_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][_0xbae19c]={'filename':_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][_0xbae19c][_0xbb10('0x3c')],'id':_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][_0xbae19c]['id'],'path':path[_0xbb10('0xa7')](config['root'],_0xbb10('0xa8'),_0xf1371a['body'][_0xbb10('0xa6')][_0xbae19c][_0xbb10('0xa9')])};}}return respondWithRpcPromise(_0xbb10('0xaa'),_0xbb10('0xaa'),{'FaxAccountId':_[_0xbb10('0xab')](_0xf1371a['params']['id'])?undefined:_0xf1371a['params']['id'],'path':_['isNil'](_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][0x0]['path'])?undefined:_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][0x0][_0xbb10('0x7')],'fax':_['isNil'](_0xf1371a[_0xbb10('0x5c')]['to'][0x0])?undefined:_0xf1371a[_0xbb10('0x5c')]['to'][0x0]},client9002);})[_0xbb10('0x22')](function(){if(_0x18cda3){if(_['isNil'](_0xf1371a[_0xbb10('0x5c')]['from'])){_0xf1371a[_0xbb10('0x5c')]['from']=util['format']('\x22%s\x22\x20<%s>',_0x18cda3['name'],_0x18cda3['fax']);}if(_0x18cda3['List']){if(_0x18cda3[_0xbb10('0xa3')][_0xbb10('0xac')][_0xbb10('0x4a')]){return _0x18cda3[_0xbb10('0xa3')]['Contacts'][0x0];}else{return db[_0xbb10('0x74')][_0xbb10('0x5b')](_[_0xbb10('0x19')](_0xf1371a[_0xbb10('0x5c')],{'firstName':_0xf1371a[_0xbb10('0x5c')]['to'][0x0],'phone':_0xf1371a[_0xbb10('0x5c')]['to'][0x0],'fax':_0xf1371a[_0xbb10('0x5c')]['to'][0x0],'ListId':_0x18cda3[_0xbb10('0x9b')]}));}}else{throw new Error(_0xbb10('0xad'));}}else{throw new Error(_0xbb10('0xae'));}})['then'](function(_0x1e4ed3){if(_0x1e4ed3){return db[_0xbb10('0x70')][_0xbb10('0x5a')]({'where':{'ContactId':_0x1e4ed3['id'],'closed':![],'FaxAccountId':_0x18cda3['id']}})['then'](function(_0x873cc9){if(_0x873cc9){return[_0x873cc9,![]];}return db[_0xbb10('0x70')][_0xbb10('0x5b')]({'UserId':_0xf1371a[_0xbb10('0x5d')]['id'],'ContactId':_0x1e4ed3['id'],'FaxAccountId':_0x18cda3['id'],'fax':_0xf1371a['body']['to'][0x0],'firstMsgDirection':_0xbb10('0xaf'),'Messages':[_[_0xbb10('0x4f')](_0xf1371a[_0xbb10('0x5c')],{'read':![],'body':_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][0x0][_0xbb10('0xb0')],'FaxAccountId':_0x18cda3['id'],'UserId':_0xf1371a[_0xbb10('0x5d')]['id'],'ContactId':_0x1e4ed3['id'],'AttachmentId':_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][0x0]['id']})]},{'include':[{'model':db[_0xbb10('0x9d')],'as':_0xbb10('0xb1')}]})['then'](function(_0x59d917){return[_0x59d917,!![]];});});}else{throw new Error(_0xbb10('0xb2'));}})['spread'](function(_0x5eb1fb,_0x8c5e76){if(_0x8c5e76){return _0x5eb1fb;}return db[_0xbb10('0x9d')]['create']({'direction':_0xbb10('0xaf'),'read':![],'body':_0xf1371a[_0xbb10('0x5c')]['attachments'][0x0][_0xbb10('0xb0')],'FaxAccountId':_0x18cda3['id'],'FaxInteractionId':_0x5eb1fb['id'],'UserId':_0xf1371a[_0xbb10('0x5d')]['id'],'ContactId':_0x5eb1fb[_0xbb10('0xb3')],'AttachmentId':_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][0x0]['id']})['then'](function(_0x4fc260){_0x5eb1fb['dataValues'][_0xbb10('0xb1')]=[];_0x5eb1fb['dataValues'][_0xbb10('0xb1')]['push'](_0x4fc260['dataValues']);return _0x5eb1fb;});})[_0xbb10('0x22')](function(_0x43168d){respondWithRpcPromise(_0xbb10('0xb4'),_0xbb10('0xb4'),{'FaxAccountId':_[_0xbb10('0xab')](_0xf1371a[_0xbb10('0x58')]['id'])?undefined:_0xf1371a['params']['id'],'path':_['isNil'](_0xf1371a['body'][_0xbb10('0xa6')][0x0][_0xbb10('0x7')])?undefined:_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][0x0][_0xbb10('0x7')],'fax':_[_0xbb10('0xab')](_0xf1371a[_0xbb10('0x5c')]['to'][0x0])?undefined:_0xf1371a['body']['to'][0x0],'AttachmentId':_0xf1371a[_0xbb10('0x5c')][_0xbb10('0xa6')][0x0]['id']},client9002)[_0xbb10('0x22')](function(_0x84a51c){logger['info'](_0xbb10('0xb5'),_0x84a51c);})['catch'](function(_0x4fc743){logger[_0xbb10('0x23')](_0xbb10('0xb5'),_0x4fc743);});return _0x43168d;})[_0xbb10('0x22')](respondWithResult(_0x3706b5,null))[_0xbb10('0x2c')](handleError(_0x3706b5,null));};exports[_0xbb10('0xb6')]=function(_0x422774,_0x4b7bf8,_0x39fdd3){return db[_0xbb10('0x52')][_0xbb10('0x5a')]({'where':{'id':_0x422774[_0xbb10('0x58')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4b7bf8,null))[_0xbb10('0x22')](function(_0x19a629){if(_0x19a629){return _0x19a629['addAgents'](_0x422774[_0xbb10('0x5c')][_0xbb10('0x6a')],_[_0xbb10('0x71')](_0x422774['body'],['ids','id'])||{})[_0xbb10('0xb7')](function(_0xf07094){for(var _0x3b007e=0x0;_0x3b007e<_0x422774[_0xbb10('0x5c')][_0xbb10('0x6a')][_0xbb10('0x4a')];_0x3b007e+=0x1){socket[_0xbb10('0xb8')]('userFaxAccount:save',{'UserId':_0x422774[_0xbb10('0x5c')][_0xbb10('0x6a')][_0x3b007e],'FaxAccountId':_0x422774[_0xbb10('0x58')]['id']});}return _0xf07094;});}})['then'](respondWithResult(_0x4b7bf8,null))['catch'](handleError(_0x4b7bf8,null));};exports['removeAgents']=function(_0x4a01cd,_0x2f73e0,_0x3479ef){return db[_0xbb10('0x52')][_0xbb10('0x5a')]({'where':{'id':_0x4a01cd['params']['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x2f73e0,null))['then'](function(_0x1f071e){if(_0x1f071e){return _0x1f071e[_0xbb10('0xb9')](_0x4a01cd[_0xbb10('0x44')][_0xbb10('0x6a')])[_0xbb10('0x22')](function(){if(_[_0xbb10('0xba')](_0x4a01cd[_0xbb10('0x44')][_0xbb10('0x6a')])){for(var _0x243dc2=0x0;_0x243dc2<_0x4a01cd[_0xbb10('0x44')][_0xbb10('0x6a')][_0xbb10('0x4a')];_0x243dc2+=0x1){socket['emit'](_0xbb10('0xbb'),{'UserId':Number(_0x4a01cd[_0xbb10('0x44')][_0xbb10('0x6a')][_0x243dc2]),'FaxAccountId':Number(_0x4a01cd['params']['id'])});}}else{socket[_0xbb10('0xb8')]('userFaxAccount:remove',{'UserId':Number(_0x4a01cd[_0xbb10('0x44')][_0xbb10('0x6a')]),'FaxAccountId':Number(_0x4a01cd[_0xbb10('0x58')]['id'])});}});}})[_0xbb10('0x22')](respondWithStatusCode(_0x2f73e0,null))[_0xbb10('0x2c')](handleError(_0x2f73e0,null));};exports['getAgents']=function(_0x5345df,_0x842d94,_0x4cf5cc){var _0x553bb8={};var _0x2ff72a={};var _0x5621b1;var _0xa9ed32;return db[_0xbb10('0x52')][_0xbb10('0x67')]({'where':{'id':_0x5345df[_0xbb10('0x58')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x842d94,null))[_0xbb10('0x22')](function(_0x3a0940){if(_0x3a0940){_0x5621b1=_0x3a0940;_0x2ff72a[_0xbb10('0x43')]=_['keys'](db[_0xbb10('0x76')]['rawAttributes']);_0x2ff72a[_0xbb10('0x44')]=_['keys'](_0x5345df[_0xbb10('0x44')]);_0x2ff72a[_0xbb10('0x46')]=_['intersection'](_0x2ff72a[_0xbb10('0x43')],_0x2ff72a[_0xbb10('0x44')]);_0x553bb8[_0xbb10('0x48')]=_['intersection'](_0x2ff72a[_0xbb10('0x43')],qs[_0xbb10('0x49')](_0x5345df[_0xbb10('0x44')]['fields']));_0x553bb8[_0xbb10('0x48')]=_0x553bb8[_0xbb10('0x48')][_0xbb10('0x4a')]?_0x553bb8['attributes']:_0x2ff72a[_0xbb10('0x43')];_0x553bb8['order']=qs[_0xbb10('0x4b')](_0x5345df[_0xbb10('0x44')][_0xbb10('0x4b')]);_0x553bb8[_0xbb10('0x4c')]=qs[_0xbb10('0x46')](_[_0xbb10('0x4d')](_0x5345df[_0xbb10('0x44')],_0x2ff72a[_0xbb10('0x46')]));if(_0x5345df[_0xbb10('0x44')][_0xbb10('0x4e')]){_0x553bb8['where']=_['merge'](_0x553bb8[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x3f')](_0x553bb8[_0xbb10('0x48')],function(_0x50ea2a){var _0x3d5870={};_0x3d5870[_0x50ea2a]={'$like':'%'+_0x5345df[_0xbb10('0x44')][_0xbb10('0x4e')]+'%'};return _0x3d5870;})});}_0x553bb8=_[_0xbb10('0x4f')]({},_0x553bb8,_0x5345df[_0xbb10('0x51')]);return _0x5621b1[_0xbb10('0xbc')](_0x553bb8);}})[_0xbb10('0x22')](function(_0x2035e1){if(_0x2035e1){_0xa9ed32=_0x2035e1[_0xbb10('0x4a')];if(!_0x5345df['query'][_0xbb10('0x6d')](_0xbb10('0x73'))){_0x553bb8[_0xbb10('0x31')]=qs[_0xbb10('0x31')](_0x5345df['query'][_0xbb10('0x31')]);_0x553bb8[_0xbb10('0x30')]=qs[_0xbb10('0x30')](_0x5345df['query']['offset']);}return _0x5621b1[_0xbb10('0xbc')](_0x553bb8);}})['then'](function(_0x37c688){if(_0x37c688){return _0x37c688?{'count':_0xa9ed32,'rows':_0x37c688}:null;}})['then'](respondWithResult(_0x842d94,null))[_0xbb10('0x2c')](handleError(_0x842d94,null));}; \ No newline at end of file +var _0x5f2f=['order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','getApplications','context','from-voip-provider','exten','app','description','Fax\x20Extension','priority','appdata','push','Answer','Set','ecm','gateway','faxdetect','maxrate','minrate','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','VoiceExtension','updateAccountApplications','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','Contact\x20not\x20found','spread','out','filename','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','userFaxAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','end','status','json','count','offset','limit','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','map','FaxAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x4ca92a,_0x4a2b42){var _0x12a5a8=function(_0x14591f){while(--_0x14591f){_0x4ca92a['push'](_0x4ca92a['shift']());}};_0x12a5a8(++_0x4a2b42);}(_0x5f2f,0x73));var _0xf5f2=function(_0x170c5e,_0x19cd2d){_0x170c5e=_0x170c5e-0x0;var _0x182d10=_0x5f2f[_0x170c5e];return _0x182d10;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];config[_0xf5f2('0x18')]=_[_0xf5f2('0x19')](config[_0xf5f2('0x18')],{'host':_0xf5f2('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5f2('0x18')]));require(_0xf5f2('0x1b'))[_0xf5f2('0x1c')](socket);var jayson=require(_0xf5f2('0x1d'));var client=jayson[_0xf5f2('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xf5f2('0x1e')][_0xf5f2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x17d656,_0x1b6dd2,_0x23e23a,_0x3a9dbb){return new BPromise(function(_0xdb61b3,_0x395a5a){var _0x11f702=_0x3a9dbb||client;return _0x11f702[_0xf5f2('0x20')](_0x17d656,_0x23e23a)[_0xf5f2('0x21')](function(_0x28e097){logger[_0xf5f2('0x22')](_0xf5f2('0x23'),_0x1b6dd2,_0xf5f2('0x24'));logger[_0xf5f2('0x25')](_0xf5f2('0x26'),_0x1b6dd2,'request\x20sent',JSON[_0xf5f2('0x27')](_0x28e097));if(_0x28e097[_0xf5f2('0x28')]){if(_0x28e097['error']['code']===0x1f4){logger[_0xf5f2('0x28')](_0xf5f2('0x23'),_0x1b6dd2,_0x28e097['error'][_0xf5f2('0x29')]);return _0x395a5a(_0x28e097[_0xf5f2('0x28')][_0xf5f2('0x29')]);}logger[_0xf5f2('0x28')](_0xf5f2('0x23'),_0x1b6dd2,_0x28e097['error'][_0xf5f2('0x29')]);return _0xdb61b3(_0x28e097[_0xf5f2('0x28')][_0xf5f2('0x29')]);}else{logger[_0xf5f2('0x22')](_0xf5f2('0x23'),_0x1b6dd2,'request\x20sent');_0xdb61b3(_0x28e097['result'][_0xf5f2('0x29')]);}})[_0xf5f2('0x2a')](function(_0x13da6f){logger[_0xf5f2('0x28')](_0xf5f2('0x23'),_0x1b6dd2,_0x13da6f);_0x395a5a(_0x13da6f);});});}function respondWithStatusCode(_0x788a8d,_0x13a3be){_0x13a3be=_0x13a3be||0xcc;return function(_0x281ec8){if(_0x281ec8){return _0x788a8d[_0xf5f2('0x2b')](_0x13a3be);}return _0x788a8d['status'](_0x13a3be)[_0xf5f2('0x2c')]();};}function respondWithResult(_0x102449,_0x375ca8){_0x375ca8=_0x375ca8||0xc8;return function(_0x31bfcb){if(_0x31bfcb){return _0x102449[_0xf5f2('0x2d')](_0x375ca8)[_0xf5f2('0x2e')](_0x31bfcb);}};}function respondWithFilteredResult(_0x5b6672,_0x53cb96){return function(_0x22c826){if(_0x22c826){var _0x14c829=_0x22c826[_0xf5f2('0x2f')],_0x11c771=_0x53cb96[_0xf5f2('0x30')],_0x5027ab=_0x53cb96[_0xf5f2('0x30')]+_0x53cb96[_0xf5f2('0x31')],_0x5a2c7e;if(_0x5027ab>=_0x14c829){_0x5027ab=_0x14c829;_0x5a2c7e=0xc8;}else{_0x5a2c7e=0xce;}_0x5b6672[_0xf5f2('0x2d')](_0x5a2c7e);return _0x5b6672['set']('Content-Range',_0x11c771+'-'+_0x5027ab+'/'+_0x14c829)[_0xf5f2('0x2e')](_0x22c826);}return null;};}function patchUpdates(_0x4e19cb){return function(_0xb744b9){try{jsonpatch['apply'](_0xb744b9,_0x4e19cb,!![]);}catch(_0x45b643){return BPromise[_0xf5f2('0x32')](_0x45b643);}return _0xb744b9[_0xf5f2('0x33')]();};}function saveUpdates(_0x428770,_0x256bd9){return function(_0x277eee){if(_0x277eee){return _0x277eee[_0xf5f2('0x34')](_0x428770)[_0xf5f2('0x21')](function(_0x5ca917){return _0x5ca917;});}return null;};}function removeEntity(_0x4149e6,_0x43e4ff){return function(_0x4590ec){if(_0x4590ec){return _0x4590ec[_0xf5f2('0x35')]()[_0xf5f2('0x21')](function(){var _0x27c0e7=_0x4590ec[_0xf5f2('0x36')]({'plain':!![]});var _0x48d64d=_0xf5f2('0x37');return db[_0xf5f2('0x38')]['destroy']({'where':{'type':_0x48d64d,'resourceId':_0x27c0e7['id']}})[_0xf5f2('0x21')](function(){return _0x4590ec;});})['then'](function(){_0x4149e6[_0xf5f2('0x2d')](0xcc)[_0xf5f2('0x2c')]();});}};}function handleEntityNotFound(_0x2a2c31,_0x2e3cca){return function(_0x59a6dd){if(!_0x59a6dd){_0x2a2c31['sendStatus'](0x194);}return _0x59a6dd;};}function handleError(_0x41088b,_0x46ad4a){_0x46ad4a=_0x46ad4a||0x1f4;return function(_0x20eb74){logger['error'](_0x20eb74[_0xf5f2('0x39')]);if(_0x20eb74['name']){delete _0x20eb74[_0xf5f2('0x3a')];}_0x41088b['status'](_0x46ad4a)[_0xf5f2('0x3b')](_0x20eb74);};}exports[_0xf5f2('0x3c')]=function(_0x5337a6,_0x29694f){var _0x46eb22={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5a4441={},_0x35f738={'count':0x0,'rows':[]};var _0x3d328f=_[_0xf5f2('0x3d')](db[_0xf5f2('0x3e')][_0xf5f2('0x3f')],function(_0x2c7f65){return{'name':_0x2c7f65[_0xf5f2('0x40')],'type':_0x2c7f65[_0xf5f2('0x41')]['key']};});_0x5a4441[_0xf5f2('0x42')]=_[_0xf5f2('0x3d')](_0x3d328f,'name');_0x5a4441[_0xf5f2('0x43')]=_[_0xf5f2('0x44')](_0x5337a6[_0xf5f2('0x43')]);_0x5a4441[_0xf5f2('0x45')]=_[_0xf5f2('0x46')](_0x5a4441[_0xf5f2('0x42')],_0x5a4441[_0xf5f2('0x43')]);_0x46eb22[_0xf5f2('0x47')]=_['intersection'](_0x5a4441[_0xf5f2('0x42')],qs[_0xf5f2('0x48')](_0x5337a6[_0xf5f2('0x43')]['fields']));_0x46eb22['attributes']=_0x46eb22['attributes'][_0xf5f2('0x49')]?_0x46eb22[_0xf5f2('0x47')]:_0x5a4441['model'];if(!_0x5337a6[_0xf5f2('0x43')][_0xf5f2('0x4a')](_0xf5f2('0x4b'))){_0x46eb22[_0xf5f2('0x31')]=qs[_0xf5f2('0x31')](_0x5337a6[_0xf5f2('0x43')][_0xf5f2('0x31')]);_0x46eb22[_0xf5f2('0x30')]=qs[_0xf5f2('0x30')](_0x5337a6[_0xf5f2('0x43')][_0xf5f2('0x30')]);}_0x46eb22[_0xf5f2('0x4c')]=qs[_0xf5f2('0x4d')](_0x5337a6[_0xf5f2('0x43')]['sort']);_0x46eb22[_0xf5f2('0x4e')]=qs['filters'](_[_0xf5f2('0x4f')](_0x5337a6[_0xf5f2('0x43')],_0x5a4441[_0xf5f2('0x45')]),_0x3d328f);if(_0x5337a6[_0xf5f2('0x43')][_0xf5f2('0x50')]){_0x46eb22[_0xf5f2('0x4e')]=_['merge'](_0x46eb22[_0xf5f2('0x4e')],{'$or':_[_0xf5f2('0x3d')](_0x3d328f,function(_0x1c1497){if(_0x1c1497[_0xf5f2('0x41')]!==_0xf5f2('0x51')){var _0x10753a={};_0x10753a[_0x1c1497[_0xf5f2('0x3a')]]={'$like':'%'+_0x5337a6[_0xf5f2('0x43')]['filter']+'%'};return _0x10753a;}})});}_0x46eb22=_[_0xf5f2('0x52')]({},_0x46eb22,_0x5337a6[_0xf5f2('0x53')]);var _0x45db9a={'where':_0x46eb22['where']};return db[_0xf5f2('0x3e')][_0xf5f2('0x2f')](_0x45db9a)[_0xf5f2('0x21')](function(_0x5e761c){_0x35f738['count']=_0x5e761c;if(_0x5337a6[_0xf5f2('0x43')][_0xf5f2('0x54')]){_0x46eb22['include']=[{'all':!![]}];}return db[_0xf5f2('0x3e')]['findAll'](_0x46eb22);})[_0xf5f2('0x21')](function(_0x497eb8){_0x35f738[_0xf5f2('0x55')]=_0x497eb8;return _0x35f738;})['then'](respondWithFilteredResult(_0x29694f,_0x46eb22))[_0xf5f2('0x2a')](handleError(_0x29694f,null));};exports[_0xf5f2('0x56')]=function(_0xbb658c,_0x11a083){var _0x4fa738={'raw':![],'where':{'id':_0xbb658c[_0xf5f2('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3154c1={};_0x3154c1[_0xf5f2('0x42')]=_[_0xf5f2('0x44')](db['FaxAccount'][_0xf5f2('0x3f')]);_0x3154c1[_0xf5f2('0x43')]=_[_0xf5f2('0x44')](_0xbb658c[_0xf5f2('0x43')]);_0x3154c1['filters']=_['intersection'](_0x3154c1[_0xf5f2('0x42')],_0x3154c1[_0xf5f2('0x43')]);_0x4fa738['attributes']=_[_0xf5f2('0x46')](_0x3154c1[_0xf5f2('0x42')],qs[_0xf5f2('0x48')](_0xbb658c[_0xf5f2('0x43')][_0xf5f2('0x48')]));_0x4fa738[_0xf5f2('0x47')]=_0x4fa738[_0xf5f2('0x47')]['length']?_0x4fa738['attributes']:_0x3154c1[_0xf5f2('0x42')];if(_0xbb658c[_0xf5f2('0x43')][_0xf5f2('0x54')]){_0x4fa738[_0xf5f2('0x58')]=[{'all':!![]}];}_0x4fa738=_[_0xf5f2('0x52')]({},_0x4fa738,_0xbb658c['options']);return db[_0xf5f2('0x3e')][_0xf5f2('0x59')](_0x4fa738)[_0xf5f2('0x21')](handleEntityNotFound(_0x11a083,null))['then'](respondWithResult(_0x11a083,null))[_0xf5f2('0x2a')](handleError(_0x11a083,null));};exports['create']=function(_0x78f1d2,_0x1a8d33){return db[_0xf5f2('0x3e')][_0xf5f2('0x5a')](_0x78f1d2['body'],{})['then'](function(_0x756f1f){var _0x4de303=_0x78f1d2[_0xf5f2('0x5b')][_0xf5f2('0x36')]({'plain':!![]});if(!_0x4de303)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4de303[_0xf5f2('0x5c')]===_0xf5f2('0x5b')){var _0x2a8f6d=_0x756f1f['get']({'plain':!![]});var _0x397b99=_0xf5f2('0x37');return db[_0xf5f2('0x5d')][_0xf5f2('0x59')]({'where':{'name':_0x397b99,'userProfileId':_0x4de303['userProfileId']},'raw':!![]})[_0xf5f2('0x21')](function(_0x506fe5){if(_0x506fe5&&_0x506fe5[_0xf5f2('0x5e')]===0x0){return db[_0xf5f2('0x38')][_0xf5f2('0x5a')]({'name':_0x2a8f6d[_0xf5f2('0x3a')],'resourceId':_0x2a8f6d['id'],'type':_0x506fe5[_0xf5f2('0x3a')],'sectionId':_0x506fe5['id']},{})['then'](function(){return _0x756f1f;});}else{return _0x756f1f;}})[_0xf5f2('0x2a')](function(_0xacd80){logger[_0xf5f2('0x28')](_0xf5f2('0x5f'),_0xacd80);throw _0xacd80;});}return _0x756f1f;})[_0xf5f2('0x21')](respondWithResult(_0x1a8d33,0xc9))['catch'](handleError(_0x1a8d33,null));};exports[_0xf5f2('0x34')]=function(_0x5ee6bc,_0x4c96ee){if(_0x5ee6bc[_0xf5f2('0x60')]['id']){delete _0x5ee6bc['body']['id'];}return db[_0xf5f2('0x3e')][_0xf5f2('0x59')]({'where':{'id':_0x5ee6bc[_0xf5f2('0x57')]['id']},'include':[{'model':db[_0xf5f2('0x61')],'as':'mandatoryDispositionPause'}]})[_0xf5f2('0x21')](handleEntityNotFound(_0x4c96ee,null))[_0xf5f2('0x21')](saveUpdates(_0x5ee6bc[_0xf5f2('0x60')],null))[_0xf5f2('0x21')](respondWithResult(_0x4c96ee,null))[_0xf5f2('0x2a')](handleError(_0x4c96ee,null));};exports[_0xf5f2('0x35')]=function(_0x158768,_0x4a7be9){return db[_0xf5f2('0x3e')][_0xf5f2('0x59')]({'where':{'id':_0x158768[_0xf5f2('0x57')]['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x4a7be9,null))['then'](removeEntity(_0x4a7be9,null))[_0xf5f2('0x2a')](handleError(_0x4a7be9,null));};exports['describe']=function(_0x410866,_0x1c7f06){return db['FaxAccount'][_0xf5f2('0x62')]()[_0xf5f2('0x21')](respondWithResult(_0x1c7f06,null))[_0xf5f2('0x2a')](handleError(_0x1c7f06,null));};exports[_0xf5f2('0x63')]=function(_0x146462,_0x4bd113,_0x3e821c){if(_0x146462[_0xf5f2('0x60')]['id']){delete _0x146462[_0xf5f2('0x60')]['id'];}return db[_0xf5f2('0x3e')][_0xf5f2('0x59')]({'where':{'id':_0x146462[_0xf5f2('0x57')]['id']}})['then'](handleEntityNotFound(_0x4bd113,null))[_0xf5f2('0x21')](function(_0x3f475e){if(_0x3f475e){_0x146462['body'][_0xf5f2('0x64')]=_0x3f475e['id'];return db[_0xf5f2('0x65')][_0xf5f2('0x5a')](_0x146462['body']);}})['then'](respondWithResult(_0x4bd113,null))['catch'](handleError(_0x4bd113,null));};exports[_0xf5f2('0x66')]=function(_0x35f3f6,_0x35f6a2,_0x450691){var _0x55da4d={'raw':![],'where':{}};var _0x4d878e={};var _0x278b76={'count':0x0,'rows':[]};return db[_0xf5f2('0x3e')][_0xf5f2('0x67')]({'where':{'id':_0x35f3f6[_0xf5f2('0x57')]['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x35f6a2,null))[_0xf5f2('0x21')](function(_0x11c302){if(_0x11c302){_0x4d878e[_0xf5f2('0x42')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x65')][_0xf5f2('0x3f')]);_0x4d878e['query']=_['keys'](_0x35f3f6['query']);_0x4d878e[_0xf5f2('0x45')]=_[_0xf5f2('0x46')](_0x4d878e[_0xf5f2('0x42')],_0x4d878e[_0xf5f2('0x43')]);_0x55da4d[_0xf5f2('0x47')]=_['intersection'](_0x4d878e[_0xf5f2('0x42')],qs[_0xf5f2('0x48')](_0x35f3f6[_0xf5f2('0x43')][_0xf5f2('0x48')]));_0x55da4d[_0xf5f2('0x47')]=_0x55da4d['attributes'][_0xf5f2('0x49')]?_0x55da4d[_0xf5f2('0x47')]:_0x4d878e['model'];if(!_0x35f3f6[_0xf5f2('0x43')][_0xf5f2('0x4a')](_0xf5f2('0x4b'))){_0x55da4d[_0xf5f2('0x31')]=qs['limit'](_0x35f3f6[_0xf5f2('0x43')][_0xf5f2('0x31')]);_0x55da4d[_0xf5f2('0x30')]=qs[_0xf5f2('0x30')](_0x35f3f6[_0xf5f2('0x43')]['offset']);}_0x55da4d['order']=qs[_0xf5f2('0x4d')](_0x35f3f6[_0xf5f2('0x43')][_0xf5f2('0x4d')]);_0x55da4d[_0xf5f2('0x4e')]=qs['filters'](_['pick'](_0x35f3f6[_0xf5f2('0x43')],_0x4d878e['filters']));_0x55da4d['where']['FaxAccountId']=_0x11c302['id'];if(_0x35f3f6['query'][_0xf5f2('0x50')]){_0x55da4d[_0xf5f2('0x4e')]=_[_0xf5f2('0x52')](_0x55da4d[_0xf5f2('0x4e')],{'$or':_[_0xf5f2('0x3d')](_0x55da4d[_0xf5f2('0x47')],function(_0x164cc6){var _0x3341be={};_0x3341be[_0x164cc6]={'$like':'%'+_0x35f3f6[_0xf5f2('0x43')][_0xf5f2('0x50')]+'%'};return _0x3341be;})});}_0x55da4d=_[_0xf5f2('0x52')]({},_0x55da4d,_0x35f3f6[_0xf5f2('0x53')]);return db[_0xf5f2('0x65')][_0xf5f2('0x2f')]({'where':_0x55da4d[_0xf5f2('0x4e')]})[_0xf5f2('0x21')](function(_0x154a8b){_0x278b76[_0xf5f2('0x2f')]=_0x154a8b;if(_0x35f3f6['query'][_0xf5f2('0x54')]){_0x55da4d[_0xf5f2('0x58')]=[{'all':!![]}];}return db[_0xf5f2('0x65')][_0xf5f2('0x68')](_0x55da4d);})[_0xf5f2('0x21')](function(_0x308220){_0x278b76[_0xf5f2('0x55')]=_0x308220;return _0x278b76;});}})[_0xf5f2('0x21')](respondWithFilteredResult(_0x35f6a2,_0x55da4d))['catch'](handleError(_0x35f6a2,null));};exports[_0xf5f2('0x69')]=function(_0x57b50f,_0x4bc51a,_0x5bf3b9){return db['FaxAccount']['find']({'where':{'id':_0x57b50f['params']['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x4bc51a,null))[_0xf5f2('0x21')](function(_0x26a57c){if(_0x26a57c){return _0x26a57c[_0xf5f2('0x69')](_0x57b50f[_0xf5f2('0x43')][_0xf5f2('0x6a')]);}})['then'](respondWithStatusCode(_0x4bc51a,null))['catch'](handleError(_0x4bc51a,null));};exports[_0xf5f2('0x6b')]=function(_0x578a22,_0x418ece,_0x186fdd){if(_0x578a22['body']['id']){delete _0x578a22['body']['id'];}return db[_0xf5f2('0x3e')][_0xf5f2('0x59')]({'where':{'id':_0x578a22['params']['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x418ece,null))[_0xf5f2('0x21')](function(_0x49e363){if(_0x49e363){_0x578a22[_0xf5f2('0x60')][_0xf5f2('0x64')]=_0x49e363['id'];return db[_0xf5f2('0x6c')]['create'](_0x578a22[_0xf5f2('0x60')]);}})[_0xf5f2('0x21')](respondWithResult(_0x418ece,null))[_0xf5f2('0x2a')](handleError(_0x418ece,null));};exports[_0xf5f2('0x6d')]=function(_0x3e188e,_0x3e0288,_0x25974b){var _0x379053={'raw':![],'where':{}};var _0x25ec54={};var _0x3a6f60={'count':0x0,'rows':[]};return db[_0xf5f2('0x3e')][_0xf5f2('0x67')]({'where':{'id':_0x3e188e[_0xf5f2('0x57')]['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x3e0288,null))[_0xf5f2('0x21')](function(_0x28b9cd){if(_0x28b9cd){_0x25ec54[_0xf5f2('0x42')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x6c')][_0xf5f2('0x3f')]);_0x25ec54[_0xf5f2('0x43')]=_['keys'](_0x3e188e[_0xf5f2('0x43')]);_0x25ec54[_0xf5f2('0x45')]=_['intersection'](_0x25ec54[_0xf5f2('0x42')],_0x25ec54[_0xf5f2('0x43')]);_0x379053['attributes']=_[_0xf5f2('0x46')](_0x25ec54[_0xf5f2('0x42')],qs[_0xf5f2('0x48')](_0x3e188e['query']['fields']));_0x379053[_0xf5f2('0x47')]=_0x379053[_0xf5f2('0x47')][_0xf5f2('0x49')]?_0x379053['attributes']:_0x25ec54['model'];if(!_0x3e188e[_0xf5f2('0x43')][_0xf5f2('0x4a')](_0xf5f2('0x4b'))){_0x379053['limit']=qs['limit'](_0x3e188e['query']['limit']);_0x379053['offset']=qs[_0xf5f2('0x30')](_0x3e188e['query'][_0xf5f2('0x30')]);}_0x379053[_0xf5f2('0x4c')]=qs[_0xf5f2('0x4d')](_0x3e188e[_0xf5f2('0x43')][_0xf5f2('0x4d')]);_0x379053[_0xf5f2('0x4e')]=qs[_0xf5f2('0x45')](_[_0xf5f2('0x4f')](_0x3e188e[_0xf5f2('0x43')],_0x25ec54[_0xf5f2('0x45')]));_0x379053[_0xf5f2('0x4e')][_0xf5f2('0x64')]=_0x28b9cd['id'];if(_0x3e188e[_0xf5f2('0x43')]['filter']){_0x379053[_0xf5f2('0x4e')]=_[_0xf5f2('0x52')](_0x379053['where'],{'$or':_[_0xf5f2('0x3d')](_0x379053[_0xf5f2('0x47')],function(_0x537a7d){var _0x433ba0={};_0x433ba0[_0x537a7d]={'$like':'%'+_0x3e188e[_0xf5f2('0x43')][_0xf5f2('0x50')]+'%'};return _0x433ba0;})});}_0x379053=_['merge']({},_0x379053,_0x3e188e[_0xf5f2('0x53')]);return db[_0xf5f2('0x6c')]['count']({'where':_0x379053[_0xf5f2('0x4e')]})[_0xf5f2('0x21')](function(_0x41bf8c){_0x3a6f60['count']=_0x41bf8c;if(_0x3e188e[_0xf5f2('0x43')]['includeAll']){_0x379053[_0xf5f2('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf5f2('0x68')](_0x379053);})[_0xf5f2('0x21')](function(_0x120e2b){_0x3a6f60[_0xf5f2('0x55')]=_0x120e2b;return _0x3a6f60;});}})['then'](respondWithFilteredResult(_0x3e0288,_0x379053))[_0xf5f2('0x2a')](handleError(_0x3e0288,null));};exports['removeAnswers']=function(_0x52e037,_0x4b4d7f,_0x2a253a){return db[_0xf5f2('0x3e')]['find']({'where':{'id':_0x52e037[_0xf5f2('0x57')]['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x4b4d7f,null))[_0xf5f2('0x21')](function(_0x3962b2){if(_0x3962b2){return _0x3962b2[_0xf5f2('0x6e')](_0x52e037[_0xf5f2('0x43')]['ids']);}})[_0xf5f2('0x21')](respondWithStatusCode(_0x4b4d7f,null))[_0xf5f2('0x2a')](handleError(_0x4b4d7f,null));};exports['addInteraction']=function(_0x22865e,_0x19cbff,_0x58042c){return db[_0xf5f2('0x6f')][_0xf5f2('0x59')]({'where':{'id':_0x22865e[_0xf5f2('0x57')]['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x19cbff,null))[_0xf5f2('0x21')](function(_0x28dd0c){if(_0x28dd0c){return _0x28dd0c['addInteraction'](_0x22865e[_0xf5f2('0x60')][_0xf5f2('0x6a')],_[_0xf5f2('0x70')](_0x22865e[_0xf5f2('0x60')],[_0xf5f2('0x6a'),'id'])||{});}})[_0xf5f2('0x21')](respondWithResult(_0x19cbff,null))[_0xf5f2('0x2a')](handleError(_0x19cbff,null));};exports[_0xf5f2('0x71')]=function(_0x3e4e40,_0x5cabb2,_0x35408a){var _0x3d3b9b={'raw':![],'where':{}};var _0xdbb2cd={};var _0x934a7d={'count':0x0,'rows':[]};return db[_0xf5f2('0x3e')][_0xf5f2('0x67')]({'where':{'id':_0x3e4e40[_0xf5f2('0x57')]['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x5cabb2,null))[_0xf5f2('0x21')](function(_0x40d0eb){if(_0x40d0eb){_0xdbb2cd['model']=_['keys'](db[_0xf5f2('0x6f')][_0xf5f2('0x3f')]);_0xdbb2cd[_0xf5f2('0x43')]=_[_0xf5f2('0x44')](_0x3e4e40['query']);_0xdbb2cd[_0xf5f2('0x45')]=_[_0xf5f2('0x46')](_0xdbb2cd[_0xf5f2('0x42')],_0xdbb2cd[_0xf5f2('0x43')]);_0x3d3b9b[_0xf5f2('0x47')]=_['intersection'](_0xdbb2cd[_0xf5f2('0x42')],qs[_0xf5f2('0x48')](_0x3e4e40['query'][_0xf5f2('0x48')]));_0x3d3b9b[_0xf5f2('0x47')]=_0x3d3b9b[_0xf5f2('0x47')][_0xf5f2('0x49')]?_0x3d3b9b['attributes']:_0xdbb2cd[_0xf5f2('0x42')];if(!_0x3e4e40[_0xf5f2('0x43')][_0xf5f2('0x4a')]('nolimit')){_0x3d3b9b['limit']=qs[_0xf5f2('0x31')](_0x3e4e40[_0xf5f2('0x43')][_0xf5f2('0x31')]);_0x3d3b9b[_0xf5f2('0x30')]=qs[_0xf5f2('0x30')](_0x3e4e40[_0xf5f2('0x43')]['offset']);}_0x3d3b9b[_0xf5f2('0x4c')]=qs['sort'](_0x3e4e40[_0xf5f2('0x43')][_0xf5f2('0x4d')]);_0x3d3b9b[_0xf5f2('0x4e')]=qs[_0xf5f2('0x45')](_[_0xf5f2('0x4f')](_0x3e4e40[_0xf5f2('0x43')],_0xdbb2cd['filters']));_0x3d3b9b[_0xf5f2('0x4e')][_0xf5f2('0x64')]=_0x40d0eb['id'];if(_0x3e4e40[_0xf5f2('0x43')][_0xf5f2('0x50')]){_0x3d3b9b[_0xf5f2('0x4e')]=_[_0xf5f2('0x52')](_0x3d3b9b[_0xf5f2('0x4e')],{'$or':_['map'](_0x3d3b9b[_0xf5f2('0x47')],function(_0x4a6b83){var _0x5857d1={};_0x5857d1[_0x4a6b83]={'$like':'%'+_0x3e4e40['query'][_0xf5f2('0x50')]+'%'};return _0x5857d1;})});}_0x3d3b9b=_[_0xf5f2('0x52')]({},_0x3d3b9b,_0x3e4e40['options']);return db[_0xf5f2('0x6f')][_0xf5f2('0x2f')]({'where':_0x3d3b9b[_0xf5f2('0x4e')]})[_0xf5f2('0x21')](function(_0x4f2704){_0x934a7d[_0xf5f2('0x2f')]=_0x4f2704;if(_0x3e4e40[_0xf5f2('0x43')][_0xf5f2('0x54')]){_0x3d3b9b['include']=[{'model':db[_0xf5f2('0x72')],'as':_0xf5f2('0x73'),'required':![]},{'model':db['User'],'as':_0xf5f2('0x74'),'attributes':[_0xf5f2('0x3a'),_0xf5f2('0x75'),_0xf5f2('0x76')],'required':![]},{'model':db[_0xf5f2('0x77')],'as':_0xf5f2('0x78'),'attributes':['id',_0xf5f2('0x3a'),_0xf5f2('0x79')],'where':_0x3e4e40[_0xf5f2('0x43')][_0xf5f2('0x7a')]?{'id':_0x3e4e40[_0xf5f2('0x43')]['tag']}:undefined,'required':_0x3e4e40[_0xf5f2('0x43')][_0xf5f2('0x7a')]?!![]:![]}];}return db['FaxInteraction'][_0xf5f2('0x68')](_0x3d3b9b);})['then'](function(_0x3b2620){_0x934a7d[_0xf5f2('0x55')]=_0x3b2620;return _0x934a7d;});}})[_0xf5f2('0x21')](respondWithFilteredResult(_0x5cabb2,_0x3d3b9b))[_0xf5f2('0x2a')](handleError(_0x5cabb2,null));};exports['addApplications']=function(_0x451711,_0x5a104b,_0x55da48){return db['FaxAccount'][_0xf5f2('0x67')]({'where':{'id':_0x451711[_0xf5f2('0x57')]['id']}})['then'](handleEntityNotFound(_0x5a104b,null))[_0xf5f2('0x21')](function(_0x4525c9){if(_0x4525c9){return db[_0xf5f2('0x7b')][_0xf5f2('0x7c')](function(_0x344e90){return db[_0xf5f2('0x7d')]['destroy']({'where':{'FaxAccountId':_0x451711['params']['id']},'transaction':_0x344e90})[_0xf5f2('0x21')](function(_0x17e1eb){var _0x5dc5da=_[_0xf5f2('0x3d')](_0x451711[_0xf5f2('0x60')],function(_0xce8b64){_0xce8b64[_0xf5f2('0x64')]=_0x451711[_0xf5f2('0x57')]['id'];return _0xce8b64;});return db[_0xf5f2('0x7d')][_0xf5f2('0x7e')](_0x5dc5da,{'transaction':_0x344e90});});})['then'](function(){return db[_0xf5f2('0x7d')]['findAndCountAll']({'where':{'FaxAccountId':_0x451711[_0xf5f2('0x57')]['id']},'order':'priority'});});}})[_0xf5f2('0x21')](respondWithResult(_0x5a104b,null))['catch'](handleError(_0x5a104b,null));};exports[_0xf5f2('0x7f')]=function(_0x4d4b02,_0x51fd11,_0x2c285c){var _0x2cfb98={};var _0x57708f={};var _0x38cb63;var _0x3ebd59;return db[_0xf5f2('0x3e')][_0xf5f2('0x67')]({'where':{'id':_0x4d4b02[_0xf5f2('0x57')]['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x51fd11,null))[_0xf5f2('0x21')](function(_0x128f37){if(_0x128f37){_0x38cb63=_0x128f37;_0x57708f['model']=_['keys'](db[_0xf5f2('0x7d')]['rawAttributes']);_0x57708f[_0xf5f2('0x43')]=_[_0xf5f2('0x44')](_0x4d4b02[_0xf5f2('0x43')]);_0x57708f[_0xf5f2('0x45')]=_[_0xf5f2('0x46')](_0x57708f[_0xf5f2('0x42')],_0x57708f[_0xf5f2('0x43')]);_0x2cfb98[_0xf5f2('0x47')]=_[_0xf5f2('0x46')](_0x57708f[_0xf5f2('0x42')],qs[_0xf5f2('0x48')](_0x4d4b02[_0xf5f2('0x43')]['fields']));_0x2cfb98[_0xf5f2('0x47')]=_0x2cfb98['attributes'][_0xf5f2('0x49')]?_0x2cfb98[_0xf5f2('0x47')]:_0x57708f[_0xf5f2('0x42')];_0x2cfb98[_0xf5f2('0x4c')]=qs[_0xf5f2('0x4d')](_0x4d4b02[_0xf5f2('0x43')][_0xf5f2('0x4d')]);_0x2cfb98[_0xf5f2('0x4e')]=qs[_0xf5f2('0x45')](_[_0xf5f2('0x4f')](_0x4d4b02[_0xf5f2('0x43')],_0x57708f['filters']));if(_0x4d4b02[_0xf5f2('0x43')][_0xf5f2('0x50')]){_0x2cfb98[_0xf5f2('0x4e')]=_[_0xf5f2('0x52')](_0x2cfb98[_0xf5f2('0x4e')],{'$or':_[_0xf5f2('0x3d')](_0x2cfb98[_0xf5f2('0x47')],function(_0x55c37e){var _0x179995={};_0x179995[_0x55c37e]={'$like':'%'+_0x4d4b02[_0xf5f2('0x43')][_0xf5f2('0x50')]+'%'};return _0x179995;})});}_0x2cfb98=_[_0xf5f2('0x52')]({},_0x2cfb98,_0x4d4b02[_0xf5f2('0x53')]);return _0x38cb63[_0xf5f2('0x7f')](_0x2cfb98);}})[_0xf5f2('0x21')](function(_0x1167e2){if(_0x1167e2){_0x3ebd59=_0x1167e2[_0xf5f2('0x49')];if(!_0x4d4b02[_0xf5f2('0x43')][_0xf5f2('0x4a')](_0xf5f2('0x4b'))){_0x2cfb98[_0xf5f2('0x31')]=qs[_0xf5f2('0x31')](_0x4d4b02[_0xf5f2('0x43')][_0xf5f2('0x31')]);_0x2cfb98['offset']=qs[_0xf5f2('0x30')](_0x4d4b02[_0xf5f2('0x43')]['offset']);}return _0x38cb63['getApplications'](_0x2cfb98);}})[_0xf5f2('0x21')](function(_0x22a3dc){if(_0x22a3dc){return _0x22a3dc?{'count':_0x3ebd59,'rows':_0x22a3dc}:null;}})[_0xf5f2('0x21')](respondWithResult(_0x51fd11,null))[_0xf5f2('0x2a')](handleError(_0x51fd11,null));};function Extension(_0x529d6f,_0x28cc,_0x4b2082,_0x2e3189){this[_0xf5f2('0x80')]=_0xf5f2('0x81');this[_0xf5f2('0x82')]=_0x529d6f['localstationid'];this[_0xf5f2('0x83')]=_0x2e3189;this['type']='system';this[_0xf5f2('0x84')]=_0xf5f2('0x85');this[_0xf5f2('0x64')]=_0x529d6f['id'];this[_0xf5f2('0x86')]=_0x28cc;this[_0xf5f2('0x87')]=_0x4b2082;}function createExtensionsReciveFax(_0x2643dc){var _0xc3dfad=0x1;var _0x591f92=[];_0x591f92[_0xf5f2('0x88')](new Extension(_0x2643dc,_0xc3dfad,'',_0xf5f2('0x89')));_0xc3dfad+=0x1;_0x591f92[_0xf5f2('0x88')](new Extension(_0x2643dc,_0xc3dfad,'CDR(type)=inbound-fax',_0xf5f2('0x8a')));_0xc3dfad+=0x1;for(var _0x50e119 in _0x2643dc){if(_0x2643dc['hasOwnProperty'](_0x50e119)&&(_0x50e119===_0xf5f2('0x8b')||_0x50e119==='localstationid'||_0x50e119===_0xf5f2('0x8c')||_0x50e119===_0xf5f2('0x8d')||_0x50e119==='headerinfo'||_0x50e119===_0xf5f2('0x8e')||_0x50e119===_0xf5f2('0x8f')||_0x50e119==='modem'||_0x50e119===_0xf5f2('0x90'))){_0x591f92[_0xf5f2('0x88')](new Extension(_0x2643dc,_0xc3dfad,_0xf5f2('0x91')+_0x50e119+')='+_0x2643dc[_0x50e119],_0xf5f2('0x8a')));_0xc3dfad+=0x1;}}_0x591f92[_0xf5f2('0x88')](new Extension(_0x2643dc,_0xc3dfad,'6','Wait'));_0xc3dfad+=0x1;_0x591f92[_0xf5f2('0x88')](new Extension(_0x2643dc,_0xc3dfad,_0xf5f2('0x92'),'ReceiveFax'));_0xc3dfad=0x0;return _0x591f92;}exports['addAccountApplications']=function(_0x3dd6e8,_0x37f2f1,_0x2d3ed2){var _0x381d27;return db[_0xf5f2('0x7b')][_0xf5f2('0x7c')](function(_0xefa664){return db[_0xf5f2('0x3e')]['create'](_0x3dd6e8['body'],{'transaction':_0xefa664})[_0xf5f2('0x21')](function(_0x5be398){_0x381d27=_0x5be398[_0xf5f2('0x36')]({'plain':!![]});return db[_0xf5f2('0x93')][_0xf5f2('0x7e')](createExtensionsReciveFax(_0x381d27),{'transaction':_0xefa664});});})[_0xf5f2('0x21')](function(){return _0x381d27;})['then'](respondWithResult(_0x37f2f1,null))[_0xf5f2('0x2a')](handleError(_0x37f2f1,null));};exports[_0xf5f2('0x94')]=function(_0x29cb4b,_0x1ed9aa,_0x77e9b9){var _0x48f1ae;return db[_0xf5f2('0x7b')][_0xf5f2('0x7c')](function(_0x378009){return db[_0xf5f2('0x3e')][_0xf5f2('0x34')](_0x29cb4b[_0xf5f2('0x60')],{'where':{'id':_0x29cb4b[_0xf5f2('0x60')]['id']},'transaction':_0x378009})[_0xf5f2('0x21')](function(_0x25deee){return db[_0xf5f2('0x93')][_0xf5f2('0x35')]({'where':{'FaxAccountId':_0x29cb4b[_0xf5f2('0x60')]['id']},'transaction':_0x378009})['then'](function(_0xd05e21){return db['VoiceExtension'][_0xf5f2('0x7e')](createExtensionsReciveFax(_[_0xf5f2('0x70')](_0x29cb4b[_0xf5f2('0x60')],[_0xf5f2('0x95'),_0xf5f2('0x96'),_0xf5f2('0x97'),_0xf5f2('0x98'),_0xf5f2('0x99'),_0xf5f2('0x9a')])),{'transaction':_0x378009});});});})[_0xf5f2('0x21')](function(){return db[_0xf5f2('0x3e')][_0xf5f2('0x9b')](_0x29cb4b[_0xf5f2('0x60')]['id']);})[_0xf5f2('0x21')](respondWithResult(_0x1ed9aa,null))[_0xf5f2('0x2a')](handleError(_0x1ed9aa,null));};exports[_0xf5f2('0x9c')]=function(_0x1afc94,_0x33f987,_0x4cb93d){var _0x32ca19={'raw':!![],'where':{}};var _0x51573a={};var _0x5b96ef={'count':0x0,'rows':[]};return db[_0xf5f2('0x3e')][_0xf5f2('0x67')]({'where':{'id':_0x1afc94['params']['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x33f987,null))[_0xf5f2('0x21')](function(_0xb982a1){if(_0xb982a1){_0x51573a[_0xf5f2('0x42')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x9d')][_0xf5f2('0x3f')]);_0x51573a[_0xf5f2('0x43')]=_['keys'](_0x1afc94[_0xf5f2('0x43')]);_0x51573a[_0xf5f2('0x45')]=_[_0xf5f2('0x46')](_0x51573a['model'],_0x51573a[_0xf5f2('0x43')]);_0x32ca19[_0xf5f2('0x47')]=_[_0xf5f2('0x46')](_0x51573a[_0xf5f2('0x42')],qs['fields'](_0x1afc94['query'][_0xf5f2('0x48')]));_0x32ca19[_0xf5f2('0x47')]=_0x32ca19[_0xf5f2('0x47')][_0xf5f2('0x49')]?_0x32ca19[_0xf5f2('0x47')]:_0x51573a[_0xf5f2('0x42')];if(!_0x1afc94[_0xf5f2('0x43')][_0xf5f2('0x4a')](_0xf5f2('0x4b'))){_0x32ca19[_0xf5f2('0x31')]=qs['limit'](_0x1afc94[_0xf5f2('0x43')][_0xf5f2('0x31')]);_0x32ca19[_0xf5f2('0x30')]=qs['offset'](_0x1afc94[_0xf5f2('0x43')][_0xf5f2('0x30')]);}_0x32ca19['order']=qs[_0xf5f2('0x4d')](_0x1afc94['query'][_0xf5f2('0x4d')]);_0x32ca19[_0xf5f2('0x4e')]=qs['filters'](_[_0xf5f2('0x4f')](_0x1afc94['query'],_0x51573a[_0xf5f2('0x45')]));_0x32ca19[_0xf5f2('0x4e')]['FaxAccountId']=_0xb982a1['id'];if(_0x1afc94[_0xf5f2('0x43')][_0xf5f2('0x50')]){_0x32ca19[_0xf5f2('0x4e')]=_[_0xf5f2('0x52')](_0x32ca19[_0xf5f2('0x4e')],{'$or':_['map'](_0x32ca19[_0xf5f2('0x47')],function(_0x391a39){var _0x35284e={};_0x35284e[_0x391a39]={'$like':'%'+_0x1afc94[_0xf5f2('0x43')][_0xf5f2('0x50')]+'%'};return _0x35284e;})});}if(_0x1afc94[_0xf5f2('0x43')][_0xf5f2('0x9e')]){var _0x1d6490=_0x1afc94[_0xf5f2('0x43')]['$gte'][_0xf5f2('0x9f')](',');var _0x5d9e26={};_0x5d9e26[_0x1d6490[0x0]]={'$gte':moment(_0x1d6490[0x1])['format'](_0xf5f2('0xa0'))};_0x32ca19[_0xf5f2('0x4e')]=_[_0xf5f2('0x52')](_0x32ca19[_0xf5f2('0x4e')],_0x5d9e26);}_0x32ca19=_[_0xf5f2('0x52')]({},_0x32ca19,_0x1afc94[_0xf5f2('0x53')]);return db[_0xf5f2('0x9d')][_0xf5f2('0x2f')]({'where':_0x32ca19[_0xf5f2('0x4e')]})[_0xf5f2('0x21')](function(_0x5c2e06){_0x5b96ef['count']=_0x5c2e06;if(_0x1afc94['query'][_0xf5f2('0x54')]){_0x32ca19['include']=[{'all':!![]}];}return db[_0xf5f2('0x9d')][_0xf5f2('0x68')](_0x32ca19);})[_0xf5f2('0x21')](function(_0x5ac7ee){_0x5b96ef[_0xf5f2('0x55')]=_0x5ac7ee;return _0x5b96ef;});}})[_0xf5f2('0x21')](respondWithFilteredResult(_0x33f987,_0x32ca19))['catch'](handleError(_0x33f987,null));};exports['send']=function(_0x4d0709,_0x18cfa9,_0x139a5c){var _0x14ab4d,_0x4f9241={},_0x2cfa84;if(_0x4d0709['body']['to']){_0x2cfa84=_0x4d0709[_0xf5f2('0x60')]['to'][0x0];}return db[_0xf5f2('0x3e')][_0xf5f2('0x59')]({'where':{'id':_0x4d0709['params']['id']},'include':[{'model':db[_0xf5f2('0xa1')],'as':'List','include':[{'model':db[_0xf5f2('0x72')],'as':_0xf5f2('0xa2'),'where':{'fax':_0x2cfa84},'limit':0x1,'order':[[_0xf5f2('0x98'),'DESC']]}]}]})[_0xf5f2('0x21')](handleEntityNotFound(_0x18cfa9,null))[_0xf5f2('0x21')](function(_0x57b4a1){_0x14ab4d=_0x57b4a1;if(_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')]&&_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][_0xf5f2('0x49')]){for(var _0x439c9f=0x0;_0x439c9f<_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][_0xf5f2('0x49')];_0x439c9f+=0x1){_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][_0x439c9f]={'filename':_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][_0x439c9f][_0xf5f2('0x3a')],'id':_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][_0x439c9f]['id'],'path':path[_0xf5f2('0xa4')](config[_0xf5f2('0xa5')],_0xf5f2('0xa6'),_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][_0x439c9f][_0xf5f2('0xa7')])};}}return respondWithRpcPromise('CheckAfterSend',_0xf5f2('0xa8'),{'FaxAccountId':_[_0xf5f2('0xa9')](_0x4d0709[_0xf5f2('0x57')]['id'])?undefined:_0x4d0709[_0xf5f2('0x57')]['id'],'path':_['isNil'](_0x4d0709[_0xf5f2('0x60')]['attachments'][0x0][_0xf5f2('0xaa')])?undefined:_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][0x0][_0xf5f2('0xaa')],'fax':_[_0xf5f2('0xa9')](_0x4d0709[_0xf5f2('0x60')]['to'][0x0])?undefined:_0x4d0709[_0xf5f2('0x60')]['to'][0x0]},client9002);})['then'](function(){if(_0x14ab4d){if(_['isNil'](_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xab')])){_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xab')]=util['format'](_0xf5f2('0xac'),_0x14ab4d[_0xf5f2('0x3a')],_0x14ab4d[_0xf5f2('0xad')]);}if(_0x14ab4d[_0xf5f2('0xae')]){if(_0x14ab4d[_0xf5f2('0xae')][_0xf5f2('0xa2')]['length']){return _0x14ab4d['List']['Contacts'][0x0];}else{return db[_0xf5f2('0x72')][_0xf5f2('0x5a')](_[_0xf5f2('0x19')](_0x4d0709['body'],{'firstName':_0x4d0709[_0xf5f2('0x60')]['to'][0x0],'phone':_0x4d0709['body']['to'][0x0],'fax':_0x4d0709[_0xf5f2('0x60')]['to'][0x0],'ListId':_0x14ab4d[_0xf5f2('0x9a')]}));}}else{throw new Error(_0xf5f2('0xaf'));}}else{throw new Error(_0xf5f2('0xb0'));}})[_0xf5f2('0x21')](function(_0x1556cb){if(_0x1556cb){return db[_0xf5f2('0x6f')][_0xf5f2('0x59')]({'where':{'ContactId':_0x1556cb['id'],'closed':![],'FaxAccountId':_0x14ab4d['id']}})[_0xf5f2('0x21')](function(_0x381759){if(_0x381759){return[_0x381759,![]];}return db[_0xf5f2('0x6f')][_0xf5f2('0x5a')]({'UserId':_0x4d0709[_0xf5f2('0x5b')]['id'],'ContactId':_0x1556cb['id'],'FaxAccountId':_0x14ab4d['id'],'fax':_0x4d0709[_0xf5f2('0x60')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xf5f2('0x52')](_0x4d0709[_0xf5f2('0x60')],{'read':![],'body':_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][0x0]['filename'],'FaxAccountId':_0x14ab4d['id'],'UserId':_0x4d0709[_0xf5f2('0x5b')]['id'],'ContactId':_0x1556cb['id'],'AttachmentId':_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0xf5f2('0x9d')],'as':'Messages'}]})[_0xf5f2('0x21')](function(_0x5462ac){return[_0x5462ac,!![]];});});}else{throw new Error(_0xf5f2('0xb1'));}})[_0xf5f2('0xb2')](function(_0x20bb46,_0x17dc52){if(_0x17dc52){return _0x20bb46;}return db['FaxMessage'][_0xf5f2('0x5a')]({'direction':_0xf5f2('0xb3'),'read':![],'body':_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][0x0][_0xf5f2('0xb4')],'FaxAccountId':_0x14ab4d['id'],'FaxInteractionId':_0x20bb46['id'],'UserId':_0x4d0709[_0xf5f2('0x5b')]['id'],'ContactId':_0x20bb46['ContactId'],'AttachmentId':_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][0x0]['id']})[_0xf5f2('0x21')](function(_0x3dcf4e){_0x20bb46[_0xf5f2('0xb5')][_0xf5f2('0xb6')]=[];_0x20bb46[_0xf5f2('0xb5')][_0xf5f2('0xb6')][_0xf5f2('0x88')](_0x3dcf4e['dataValues']);return _0x20bb46;});})[_0xf5f2('0x21')](function(_0x13353f){respondWithRpcPromise(_0xf5f2('0xb7'),_0xf5f2('0xb7'),{'FaxAccountId':_['isNil'](_0x4d0709['params']['id'])?undefined:_0x4d0709[_0xf5f2('0x57')]['id'],'path':_[_0xf5f2('0xa9')](_0x4d0709[_0xf5f2('0x60')]['attachments'][0x0]['path'])?undefined:_0x4d0709[_0xf5f2('0x60')][_0xf5f2('0xa3')][0x0][_0xf5f2('0xaa')],'fax':_[_0xf5f2('0xa9')](_0x4d0709[_0xf5f2('0x60')]['to'][0x0])?undefined:_0x4d0709[_0xf5f2('0x60')]['to'][0x0],'AttachmentId':_0x4d0709['body'][_0xf5f2('0xa3')][0x0]['id']},client9002)[_0xf5f2('0x21')](function(_0x1c18a0){logger[_0xf5f2('0x22')]('SendFaxRpc,\x20%s',_0x1c18a0);})['catch'](function(_0x40f447){logger['info'](_0xf5f2('0xb8'),_0x40f447);});return _0x13353f;})[_0xf5f2('0x21')](respondWithResult(_0x18cfa9,null))[_0xf5f2('0x2a')](handleError(_0x18cfa9,null));};exports[_0xf5f2('0xb9')]=function(_0x45a01e,_0x3d6d4c,_0x40782a){return db[_0xf5f2('0x3e')][_0xf5f2('0x59')]({'where':{'id':_0x45a01e[_0xf5f2('0x57')]['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x3d6d4c,null))[_0xf5f2('0x21')](function(_0x6734c5){if(_0x6734c5){return _0x6734c5[_0xf5f2('0xb9')](_0x45a01e['body'][_0xf5f2('0x6a')],_[_0xf5f2('0x70')](_0x45a01e[_0xf5f2('0x60')],[_0xf5f2('0x6a'),'id'])||{})[_0xf5f2('0xb2')](function(_0x592ee0){for(var _0x374b5e=0x0;_0x374b5e<_0x45a01e[_0xf5f2('0x60')]['ids'][_0xf5f2('0x49')];_0x374b5e+=0x1){socket[_0xf5f2('0xba')]('userFaxAccount:save',{'UserId':_0x45a01e['body'][_0xf5f2('0x6a')][_0x374b5e],'FaxAccountId':_0x45a01e[_0xf5f2('0x57')]['id']});}return _0x592ee0;});}})[_0xf5f2('0x21')](respondWithResult(_0x3d6d4c,null))['catch'](handleError(_0x3d6d4c,null));};exports['removeAgents']=function(_0x48b359,_0x3e4c88,_0x12fdeb){return db[_0xf5f2('0x3e')][_0xf5f2('0x59')]({'where':{'id':_0x48b359[_0xf5f2('0x57')]['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x3e4c88,null))[_0xf5f2('0x21')](function(_0x4128ee){if(_0x4128ee){return _0x4128ee[_0xf5f2('0xbb')](_0x48b359['query'][_0xf5f2('0x6a')])[_0xf5f2('0x21')](function(){if(_['isArray'](_0x48b359[_0xf5f2('0x43')][_0xf5f2('0x6a')])){for(var _0xecb4d2=0x0;_0xecb4d2<_0x48b359[_0xf5f2('0x43')][_0xf5f2('0x6a')]['length'];_0xecb4d2+=0x1){socket['emit'](_0xf5f2('0xbc'),{'UserId':Number(_0x48b359[_0xf5f2('0x43')][_0xf5f2('0x6a')][_0xecb4d2]),'FaxAccountId':Number(_0x48b359[_0xf5f2('0x57')]['id'])});}}else{socket['emit'](_0xf5f2('0xbc'),{'UserId':Number(_0x48b359[_0xf5f2('0x43')][_0xf5f2('0x6a')]),'FaxAccountId':Number(_0x48b359[_0xf5f2('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x3e4c88,null))['catch'](handleError(_0x3e4c88,null));};exports['getAgents']=function(_0x4e74e0,_0x2e9d3b,_0x496802){var _0x5be074={};var _0x561666={};var _0x4966cf;var _0x16bcfa;return db['FaxAccount']['findOne']({'where':{'id':_0x4e74e0[_0xf5f2('0x57')]['id']}})[_0xf5f2('0x21')](handleEntityNotFound(_0x2e9d3b,null))[_0xf5f2('0x21')](function(_0x327e03){if(_0x327e03){_0x4966cf=_0x327e03;_0x561666['model']=_[_0xf5f2('0x44')](db[_0xf5f2('0xbd')][_0xf5f2('0x3f')]);_0x561666[_0xf5f2('0x43')]=_[_0xf5f2('0x44')](_0x4e74e0[_0xf5f2('0x43')]);_0x561666[_0xf5f2('0x45')]=_['intersection'](_0x561666[_0xf5f2('0x42')],_0x561666[_0xf5f2('0x43')]);_0x5be074['attributes']=_[_0xf5f2('0x46')](_0x561666[_0xf5f2('0x42')],qs[_0xf5f2('0x48')](_0x4e74e0[_0xf5f2('0x43')][_0xf5f2('0x48')]));_0x5be074['attributes']=_0x5be074[_0xf5f2('0x47')]['length']?_0x5be074[_0xf5f2('0x47')]:_0x561666[_0xf5f2('0x42')];_0x5be074[_0xf5f2('0x4c')]=qs[_0xf5f2('0x4d')](_0x4e74e0['query']['sort']);_0x5be074[_0xf5f2('0x4e')]=qs[_0xf5f2('0x45')](_[_0xf5f2('0x4f')](_0x4e74e0[_0xf5f2('0x43')],_0x561666[_0xf5f2('0x45')]));if(_0x4e74e0[_0xf5f2('0x43')][_0xf5f2('0x50')]){_0x5be074[_0xf5f2('0x4e')]=_['merge'](_0x5be074['where'],{'$or':_[_0xf5f2('0x3d')](_0x5be074[_0xf5f2('0x47')],function(_0x5f424e){var _0xb8bcf3={};_0xb8bcf3[_0x5f424e]={'$like':'%'+_0x4e74e0[_0xf5f2('0x43')][_0xf5f2('0x50')]+'%'};return _0xb8bcf3;})});}_0x5be074=_[_0xf5f2('0x52')]({},_0x5be074,_0x4e74e0[_0xf5f2('0x53')]);return _0x4966cf[_0xf5f2('0xbe')](_0x5be074);}})[_0xf5f2('0x21')](function(_0x4702df){if(_0x4702df){_0x16bcfa=_0x4702df[_0xf5f2('0x49')];if(!_0x4e74e0[_0xf5f2('0x43')][_0xf5f2('0x4a')](_0xf5f2('0x4b'))){_0x5be074[_0xf5f2('0x31')]=qs[_0xf5f2('0x31')](_0x4e74e0[_0xf5f2('0x43')][_0xf5f2('0x31')]);_0x5be074[_0xf5f2('0x30')]=qs['offset'](_0x4e74e0[_0xf5f2('0x43')]['offset']);}return _0x4966cf[_0xf5f2('0xbe')](_0x5be074);}})['then'](function(_0x47bc74){if(_0x47bc74){return _0x47bc74?{'count':_0x16bcfa,'rows':_0x47bc74}:null;}})[_0xf5f2('0x21')](respondWithResult(_0x2e9d3b,null))[_0xf5f2('0x2a')](handleError(_0x2e9d3b,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 30f00aa..c60c76a 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 _0x93f6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','FaxAccount'];(function(_0x4127e6,_0xbf2204){var _0x3f9211=function(_0x4cd4bc){while(--_0x4cd4bc){_0x4127e6['push'](_0x4127e6['shift']());}};_0x3f9211(++_0xbf2204);}(_0x93f6,0xc6));var _0x693f=function(_0x47e324,_0x4ed470){_0x47e324=_0x47e324-0x0;var _0x3a733c=_0x93f6[_0x47e324];return _0x3a733c;};'use strict';var EventEmitter=require(_0x693f('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x693f('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x693f('0x2')](0x0);var events={'afterCreate':_0x693f('0x3'),'afterUpdate':_0x693f('0x4'),'afterDestroy':_0x693f('0x5')};function emitEvent(_0x15ebdd){return function(_0x3345e2,_0xf57b95,_0x5c766d){FaxAccountEvents[_0x693f('0x6')](_0x15ebdd+':'+_0x3345e2['id'],_0x3345e2);FaxAccountEvents['emit'](_0x15ebdd,_0x3345e2);_0x5c766d(null);};}for(var e in events){if(events[_0x693f('0x7')](e)){var event=events[e];FaxAccount[_0x693f('0x8')](e,emitEvent(event));}}module[_0x693f('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x82f4=['save','remove','emit','hasOwnProperty','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x1b8f6f,_0x3dacc0){var _0x15410d=function(_0x1071d1){while(--_0x1071d1){_0x1b8f6f['push'](_0x1b8f6f['shift']());}};_0x15410d(++_0x3dacc0);}(_0x82f4,0x144));var _0x482f=function(_0x244694,_0x4c866f){_0x244694=_0x244694-0x0;var _0x282042=_0x82f4[_0x244694];return _0x282042;};'use strict';var EventEmitter=require(_0x482f('0x0'));var FaxAccount=require(_0x482f('0x1'))['db'][_0x482f('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x482f('0x3')](0x0);var events={'afterCreate':_0x482f('0x4'),'afterUpdate':'update','afterDestroy':_0x482f('0x5')};function emitEvent(_0x387ea8){return function(_0x25eb56,_0x22e0ca,_0x314b38){FaxAccountEvents[_0x482f('0x6')](_0x387ea8+':'+_0x25eb56['id'],_0x25eb56);FaxAccountEvents['emit'](_0x387ea8,_0x25eb56);_0x314b38(null);};}for(var e in events){if(events[_0x482f('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 46d5f06..b3955de 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 _0xe1b9=['define','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0xb946f7,_0x3e8cb5){var _0x41cf59=function(_0x549ff3){while(--_0x549ff3){_0xb946f7['push'](_0xb946f7['shift']());}};_0x41cf59(++_0x3e8cb5);}(_0xe1b9,0x1b2));var _0x9e1b=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xe1b9[_0x556927];return _0x5f1235;};'use strict';var _=require(_0x9e1b('0x0'));var util=require(_0x9e1b('0x1'));var logger=require(_0x9e1b('0x2'))(_0x9e1b('0x3'));var moment=require(_0x9e1b('0x4'));var BPromise=require(_0x9e1b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e1b('0x6'));var rimraf=require(_0x9e1b('0x7'));var config=require(_0x9e1b('0x8'));var attributes=require('./faxAccount.attributes');module[_0x9e1b('0x9')]=function(_0x41e018,_0x34faff){return _0x41e018[_0x9e1b('0xa')]('FaxAccount',attributes,{'tableName':_0x9e1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae7e=['lodash','../../config/logger','moment','rimraf','./faxAccount.attributes','define','FaxAccount','fax_accounts'];(function(_0x3760ac,_0x409368){var _0x318cf0=function(_0x27a65a){while(--_0x27a65a){_0x3760ac['push'](_0x3760ac['shift']());}};_0x318cf0(++_0x409368);}(_0xae7e,0xf8));var _0xeae7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xae7e[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xeae7('0x0'));var util=require('util');var logger=require(_0xeae7('0x1'))('api');var moment=require(_0xeae7('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeae7('0x3'));var config=require('../../config/environment');var attributes=require(_0xeae7('0x4'));module['exports']=function(_0xf629eb,_0x488123){return _0xf629eb[_0xeae7('0x5')](_0xeae7('0x6'),attributes,{'tableName':_0xeae7('0x7'),'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 f0f8f05..580fbb1 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 _0xca6e=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','NotifyFaxAccount','body','fax','CmContact','describe','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','DESC','FaxApplication','Applications','get','account','applications','orderBy','asc','Contacts','create','contact','find','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','ContactId','UserId','User','unshift','agent','name','Start','startRouting','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x408012,_0x4566f4){var _0x197899=function(_0x31ebd6){while(--_0x31ebd6){_0x408012['push'](_0x408012['shift']());}};_0x197899(++_0x4566f4);}(_0xca6e,0xac));var _0xeca6=function(_0x5f2a83,_0x223be3){_0x5f2a83=_0x5f2a83-0x0;var _0x567aeb=_0xca6e[_0x5f2a83];return _0x567aeb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeca6('0x0'));var BPromise=require(_0xeca6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeca6('0x2'));var db=require(_0xeca6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xeca6('0x4'))(_0xeca6('0x5'));var config=require('../../config/environment');var jayson=require(_0xeca6('0x6'));var client=jayson[_0xeca6('0x7')][_0xeca6('0x8')]({'port':0x232c});config[_0xeca6('0x9')]=_[_0xeca6('0xa')](config[_0xeca6('0x9')],{'host':_0xeca6('0xb'),'port':0x18eb});var socket=require(_0xeca6('0xc'))(new Redis(config[_0xeca6('0x9')]));require('./faxAccount.socket')[_0xeca6('0xd')](socket);function respondWithRpcPromise(_0x3f9b9b,_0x4f0f7e,_0x38d7b4){return new BPromise(function(_0x4952ba,_0x2f9b94){return client[_0xeca6('0xe')](_0x3f9b9b,_0x38d7b4)[_0xeca6('0xf')](function(_0x31281b){logger[_0xeca6('0x10')](_0xeca6('0x11'),_0x4f0f7e,_0xeca6('0x12'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x4f0f7e,_0xeca6('0x12'),JSON['stringify'](_0x31281b));if(_0x31281b[_0xeca6('0x13')]){if(_0x31281b[_0xeca6('0x13')][_0xeca6('0x14')]===0x1f4){logger[_0xeca6('0x13')](_0xeca6('0x11'),_0x4f0f7e,_0x31281b[_0xeca6('0x13')][_0xeca6('0x15')]);return _0x2f9b94(_0x31281b[_0xeca6('0x13')][_0xeca6('0x15')]);}logger['error'](_0xeca6('0x11'),_0x4f0f7e,_0x31281b['error']['message']);return _0x4952ba(_0x31281b[_0xeca6('0x13')][_0xeca6('0x15')]);}else{logger[_0xeca6('0x10')](_0xeca6('0x11'),_0x4f0f7e,'request\x20sent');_0x4952ba(_0x31281b[_0xeca6('0x16')][_0xeca6('0x15')]);}})[_0xeca6('0x17')](function(_0x41b209){logger[_0xeca6('0x13')]('FaxAccount,\x20%s,\x20%s',_0x4f0f7e,_0x41b209);_0x2f9b94(_0x41b209);});});}exports[_0xeca6('0x18')]=function(_0x47b4a6){var _0x164007=this;return new Promise(function(_0x5ade46,_0x2c5151){return db[_0xeca6('0x19')][_0xeca6('0x1a')]({'raw':_0x47b4a6[_0xeca6('0x1b')]?_0x47b4a6[_0xeca6('0x1b')][_0xeca6('0x1c')]===undefined?!![]:![]:!![],'where':_0x47b4a6[_0xeca6('0x1b')]?_0x47b4a6['options']['where']||null:null,'attributes':_0x47b4a6['options']?_0x47b4a6[_0xeca6('0x1b')][_0xeca6('0x1d')]||null:null,'limit':_0x47b4a6[_0xeca6('0x1b')]?_0x47b4a6[_0xeca6('0x1b')][_0xeca6('0x1e')]||null:null,'include':_0x47b4a6[_0xeca6('0x1b')]?_0x47b4a6[_0xeca6('0x1b')][_0xeca6('0x1f')]?_[_0xeca6('0x20')](_0x47b4a6[_0xeca6('0x1b')][_0xeca6('0x1f')],function(_0x21dd55){return{'model':db[_0x21dd55['model']],'as':_0x21dd55['as'],'attributes':_0x21dd55['attributes'],'include':_0x21dd55[_0xeca6('0x1f')]?_['map'](_0x21dd55['include'],function(_0x4a0908){return{'model':db[_0x4a0908[_0xeca6('0x21')]],'as':_0x4a0908['as'],'attributes':_0x4a0908[_0xeca6('0x1d')],'include':_0x4a0908[_0xeca6('0x1f')]?_[_0xeca6('0x20')](_0x4a0908[_0xeca6('0x1f')],function(_0x270d68){return{'model':db[_0x270d68[_0xeca6('0x21')]],'as':_0x270d68['as'],'attributes':_0x270d68['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x496b14){logger[_0xeca6('0x10')](_0xeca6('0x18'),_0x47b4a6);logger[_0xeca6('0x22')](_0xeca6('0x18'),_0x47b4a6,JSON[_0xeca6('0x23')](_0x496b14));_0x5ade46(_0x496b14);})['catch'](function(_0x53d19a){logger['error']('GetFaxAccount',_0x53d19a[_0xeca6('0x15')],_0x47b4a6);_0x2c5151(_0x164007[_0xeca6('0x13')](0x1f4,_0x53d19a[_0xeca6('0x15')]));});});};exports[_0xeca6('0x24')]=function(_0x395e5a,_0x224854,_0x2aba43){var _0x2bd972=this;return new Promise(function(_0x4be531,_0x2a3a71){var _0x321321={'body':_0x395e5a[_0xeca6('0x25')],'channel':_0xeca6('0x26')};var _0x240232=[];var _0x115074=[];var _0x2552f4={};return db[_0xeca6('0x27')][_0xeca6('0x28')]()[_0xeca6('0xf')](function(_0x1ad92e){if(!_0x1ad92e){throw new db['Sequelize']['ValidationError'](_0xeca6('0x29'));}_0x240232=_[_0xeca6('0x2a')](_[_0xeca6('0x2b')](_0x1ad92e),[_0xeca6('0x2c'),_0xeca6('0x2d')]);_0x115074=_[_0xeca6('0x2a')](_[_0xeca6('0x2b')](_0x1ad92e),[_0xeca6('0x2c'),'updatedAt',_0xeca6('0x2e'),_0xeca6('0x2f')]);if(_0x395e5a['body']['id']){delete _0x395e5a[_0xeca6('0x25')]['id'];}if(_['isNil'](_0x395e5a[_0xeca6('0x25')]['from'])){throw new db[(_0xeca6('0x30'))]['ValidationError'](_0xeca6('0x31'));}if(_[_0xeca6('0x32')](_0x395e5a[_0xeca6('0x25')][_0xeca6('0x25')])||_0x395e5a['body'][_0xeca6('0x25')]===''){throw new db[(_0xeca6('0x30'))][(_0xeca6('0x33'))](_0xeca6('0x34'));}if(_[_0xeca6('0x32')](_0x395e5a[_0xeca6('0x25')][_0xeca6('0x35')])){throw new db[(_0xeca6('0x30'))][(_0xeca6('0x33'))](_0xeca6('0x36')+_0x115074);}if(!_[_0xeca6('0x37')](_0x115074,_0x395e5a[_0xeca6('0x25')]['mapKey'])){throw new db[(_0xeca6('0x30'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x115074);}_0x2552f4[_0x395e5a[_0xeca6('0x25')][_0xeca6('0x35')]]=_0x395e5a[_0xeca6('0x25')][_0xeca6('0x38')];})[_0xeca6('0xf')](function(){return db[_0xeca6('0x19')]['find']({'where':{'id':_0x395e5a['account']['id']},'include':[{'model':db[_0xeca6('0x39')],'as':_0xeca6('0x3a'),'include':[{'model':db[_0xeca6('0x27')],'as':'Contacts','where':_0x2552f4,'limit':0x1,'order':[[_0xeca6('0x2d'),_0xeca6('0x3b')]]}]},{'model':db[_0xeca6('0x3c')],'as':_0xeca6('0x3d')}]});})[_0xeca6('0xf')](function(_0x26e21c){if(_0x26e21c&&_0x26e21c[_0xeca6('0x3a')]){var _0x5cae1e=_0x26e21c[_0xeca6('0x3e')]({'plain':!![]});_0x321321[_0xeca6('0x3f')]=_0x5cae1e;_0x321321[_0xeca6('0x40')]=_0x5cae1e[_0xeca6('0x3d')];_0x321321['list']=_0x5cae1e[_0xeca6('0x3a')];_0x321321[_0xeca6('0x40')]=_[_0xeca6('0x41')](_0x321321['applications'],['priority'],[_0xeca6('0x42')]);if(_0x321321[_0xeca6('0x3f')][_0xeca6('0x3d')]){delete _0x321321[_0xeca6('0x3f')][_0xeca6('0x3d')];}if(_0x321321['account'][_0xeca6('0x3a')]&&_0x321321[_0xeca6('0x3f')]['List'][_0xeca6('0x43')]['length']){return _0x321321[_0xeca6('0x3f')]['List'][_0xeca6('0x43')][0x0];}var _0x47fcb7=_[_0xeca6('0xa')](_0x395e5a[_0xeca6('0x25')],{'firstName':_0x395e5a['body'][_0xeca6('0x38')],'ListId':_0x5cae1e['ListId']});_0x47fcb7[_0x395e5a[_0xeca6('0x25')]['mapKey']]=_0x395e5a[_0xeca6('0x25')][_0xeca6('0x38')];return db['CmContact'][_0xeca6('0x44')](_0x47fcb7,{'fields':_0x240232,'raw':!![]});}})[_0xeca6('0xf')](function(_0xa929d){_0x321321[_0xeca6('0x45')]=_0xa929d;if(_0xa929d){var _0x3709d3={'ContactId':_0xa929d['id'],'FaxAccountId':_0x395e5a[_0xeca6('0x3f')]['id'],'fax':_0xa929d[_0xeca6('0x26')]};return db['FaxInteraction'][_0xeca6('0x46')]({'where':{'ContactId':_0xa929d['id'],'closed':![],'FaxAccountId':_0x395e5a['account']['id']}})[_0xeca6('0xf')](function(_0x377b69){if(_0x377b69){return[_0x377b69,![]];}return db[_0xeca6('0x47')][_0xeca6('0x44')](_0x3709d3)[_0xeca6('0xf')](function(_0x22f20b){return[_0x22f20b,!![]];});});}else{throw new Error(_0xeca6('0x48'));}})[_0xeca6('0x49')](function(_0x2b83ba,_0x17647a){var _0x405fab=_0x2b83ba[_0xeca6('0x3e')]({'plain':!![]});if(_0x17647a){if(_0x321321[_0xeca6('0x3f')][_0xeca6('0x4a')]){_0x321321[_0xeca6('0x40')][_0xeca6('0x4b')]({'id':0x0,'priority':_0x321321[_0xeca6('0x40')][_0xeca6('0x4c')]+0x1,'app':_0xeca6('0x4d'),'appdata':_0xeca6('0x4e'),'interval':_0xeca6('0x4f')});}_0x405fab[_0xeca6('0x50')]=!![];}else{_0x405fab[_0xeca6('0x50')]=![];}_0x321321[_0xeca6('0x51')]=_0x405fab;return db['FaxMessage'][_0xeca6('0x44')]({'body':_0x395e5a[_0xeca6('0x25')][_0xeca6('0x25')],'FaxAccountId':_0x395e5a['account']['id'],'FaxInteractionId':_0x2b83ba['id'],'direction':'in','ContactId':_0x2b83ba[_0xeca6('0x52')],'AttachmentId':_0x395e5a[_0xeca6('0x25')]['AttachmentId']});})[_0xeca6('0xf')](function(_0x4225fe){_0x321321[_0xeca6('0x15')]=_0x4225fe;if(_0x321321[_0xeca6('0x51')][_0xeca6('0x53')]){return db[_0xeca6('0x54')][_0xeca6('0x46')]({'attributes':['id','name'],'where':{'id':_0x321321[_0xeca6('0x51')]['UserId']}})[_0xeca6('0xf')](function(_0x47423b){if(_0x47423b){_0x321321[_0xeca6('0x40')][_0xeca6('0x55')]({'id':0x0,'priority':0x0,'app':_0xeca6('0x56'),'appdata':_0x47423b[_0xeca6('0x57')]+','+(_0x321321['account']['waitForTheAssignedAgent']||0xa),'interval':_0xeca6('0x4f')});}return respondWithRpcPromise(_0xeca6('0x58'),_0xeca6('0x59'),_0x321321);});}return respondWithRpcPromise(_0xeca6('0x58'),_0xeca6('0x59'),_0x321321);})[_0xeca6('0xf')](function(_0x553d69){_0x4be531(_0x553d69);})[_0xeca6('0x17')](function(_0x34ccfd){_0x2a3a71(_0x2bd972[_0xeca6('0x13')](0x1f4,_0x34ccfd['message']));});});}; \ No newline at end of file +var _0xf569=['redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','catch','body','fax','CmContact','describe','ValidationError','keys','createdAt','updatedAt','difference','ListId','Sequelize','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','List','Contacts','FaxApplication','Applications','account','applications','list','priority','contact','FaxInteraction','create','Contact\x20not\x20found','get','autoclose','push','length','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x3a73ef,_0x32e1ee){var _0x4f4115=function(_0x4ba4d2){while(--_0x4ba4d2){_0x3a73ef['push'](_0x3a73ef['shift']());}};_0x4f4115(++_0x32e1ee);}(_0xf569,0x142));var _0x9f56=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xf569[_0x44bcb0];return _0xfaf881;};'use strict';var _=require('lodash');var util=require(_0x9f56('0x0'));var moment=require(_0x9f56('0x1'));var BPromise=require(_0x9f56('0x2'));var rs=require(_0x9f56('0x3'));var fs=require('fs');var Redis=require(_0x9f56('0x4'));var db=require(_0x9f56('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f56('0x6'))(_0x9f56('0x7'));var config=require(_0x9f56('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9f56('0x9')]['http']({'port':0x232c});config[_0x9f56('0xa')]=_[_0x9f56('0xb')](config[_0x9f56('0xa')],{'host':_0x9f56('0xc'),'port':0x18eb});var socket=require(_0x9f56('0xd'))(new Redis(config[_0x9f56('0xa')]));require(_0x9f56('0xe'))[_0x9f56('0xf')](socket);function respondWithRpcPromise(_0x2bb55d,_0x524ceb,_0x4a4d6f){return new BPromise(function(_0x289dcb,_0x2ff284){return client['request'](_0x2bb55d,_0x4a4d6f)[_0x9f56('0x10')](function(_0x55571a){logger[_0x9f56('0x11')]('FaxAccount,\x20%s,\x20%s',_0x524ceb,_0x9f56('0x12'));logger[_0x9f56('0x13')](_0x9f56('0x14'),_0x524ceb,_0x9f56('0x12'),JSON[_0x9f56('0x15')](_0x55571a));if(_0x55571a[_0x9f56('0x16')]){if(_0x55571a[_0x9f56('0x16')][_0x9f56('0x17')]===0x1f4){logger[_0x9f56('0x16')](_0x9f56('0x18'),_0x524ceb,_0x55571a[_0x9f56('0x16')]['message']);return _0x2ff284(_0x55571a['error'][_0x9f56('0x19')]);}logger['error'](_0x9f56('0x18'),_0x524ceb,_0x55571a[_0x9f56('0x16')][_0x9f56('0x19')]);return _0x289dcb(_0x55571a[_0x9f56('0x16')][_0x9f56('0x19')]);}else{logger['info'](_0x9f56('0x18'),_0x524ceb,_0x9f56('0x12'));_0x289dcb(_0x55571a[_0x9f56('0x1a')]['message']);}})['catch'](function(_0x43b7a4){logger[_0x9f56('0x16')](_0x9f56('0x18'),_0x524ceb,_0x43b7a4);_0x2ff284(_0x43b7a4);});});}exports[_0x9f56('0x1b')]=function(_0xd6c381){var _0x4c70ef=this;return new Promise(function(_0x35e9bb,_0x2a3251){return db[_0x9f56('0x1c')][_0x9f56('0x1d')]({'raw':_0xd6c381[_0x9f56('0x1e')]?_0xd6c381['options'][_0x9f56('0x1f')]===undefined?!![]:![]:!![],'where':_0xd6c381[_0x9f56('0x1e')]?_0xd6c381[_0x9f56('0x1e')]['where']||null:null,'attributes':_0xd6c381['options']?_0xd6c381['options'][_0x9f56('0x20')]||null:null,'limit':_0xd6c381[_0x9f56('0x1e')]?_0xd6c381[_0x9f56('0x1e')][_0x9f56('0x21')]||null:null,'include':_0xd6c381[_0x9f56('0x1e')]?_0xd6c381['options'][_0x9f56('0x22')]?_[_0x9f56('0x23')](_0xd6c381[_0x9f56('0x1e')][_0x9f56('0x22')],function(_0x4d06be){return{'model':db[_0x4d06be[_0x9f56('0x24')]],'as':_0x4d06be['as'],'attributes':_0x4d06be[_0x9f56('0x20')],'include':_0x4d06be[_0x9f56('0x22')]?_[_0x9f56('0x23')](_0x4d06be[_0x9f56('0x22')],function(_0x4c19c5){return{'model':db[_0x4c19c5[_0x9f56('0x24')]],'as':_0x4c19c5['as'],'attributes':_0x4c19c5[_0x9f56('0x20')],'include':_0x4c19c5[_0x9f56('0x22')]?_[_0x9f56('0x23')](_0x4c19c5[_0x9f56('0x22')],function(_0x3e4be1){return{'model':db[_0x3e4be1['model']],'as':_0x3e4be1['as'],'attributes':_0x3e4be1['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f56('0x10')](function(_0x82052b){logger[_0x9f56('0x11')](_0x9f56('0x1b'),_0xd6c381);logger[_0x9f56('0x13')](_0x9f56('0x1b'),_0xd6c381,JSON[_0x9f56('0x15')](_0x82052b));_0x35e9bb(_0x82052b);})[_0x9f56('0x25')](function(_0x3a461a){logger['error'](_0x9f56('0x1b'),_0x3a461a[_0x9f56('0x19')],_0xd6c381);_0x2a3251(_0x4c70ef[_0x9f56('0x16')](0x1f4,_0x3a461a[_0x9f56('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x2a084a,_0xa0f20a,_0x24228d){var _0x2f2739=this;return new Promise(function(_0x5d0f63,_0x599125){var _0x4f517f={'body':_0x2a084a[_0x9f56('0x26')],'channel':_0x9f56('0x27')};var _0x2fdeaa=[];var _0x5ed2d1=[];var _0x257301={};return db[_0x9f56('0x28')][_0x9f56('0x29')]()['then'](function(_0x2873b1){if(!_0x2873b1){throw new db['Sequelize'][(_0x9f56('0x2a'))]('no\x20available\x20attributes');}_0x2fdeaa=_['difference'](_[_0x9f56('0x2b')](_0x2873b1),[_0x9f56('0x2c'),_0x9f56('0x2d')]);_0x5ed2d1=_[_0x9f56('0x2e')](_[_0x9f56('0x2b')](_0x2873b1),[_0x9f56('0x2c'),_0x9f56('0x2d'),'CompanyId',_0x9f56('0x2f')]);if(_0x2a084a[_0x9f56('0x26')]['id']){delete _0x2a084a['body']['id'];}if(_['isNil'](_0x2a084a[_0x9f56('0x26')]['from'])){throw new db[(_0x9f56('0x30'))][(_0x9f56('0x2a'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x2a084a[_0x9f56('0x26')]['body'])||_0x2a084a[_0x9f56('0x26')][_0x9f56('0x26')]===''){throw new db[(_0x9f56('0x30'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9f56('0x31')](_0x2a084a[_0x9f56('0x26')][_0x9f56('0x32')])){throw new db[(_0x9f56('0x30'))][(_0x9f56('0x2a'))](_0x9f56('0x33')+_0x5ed2d1);}if(!_[_0x9f56('0x34')](_0x5ed2d1,_0x2a084a['body']['mapKey'])){throw new db[(_0x9f56('0x30'))]['ValidationError'](_0x9f56('0x35')+_0x5ed2d1);}_0x257301[_0x2a084a['body'][_0x9f56('0x32')]]=_0x2a084a['body'][_0x9f56('0x36')];})[_0x9f56('0x10')](function(){return db[_0x9f56('0x1c')][_0x9f56('0x37')]({'where':{'id':_0x2a084a['account']['id']},'include':[{'model':db['CmList'],'as':_0x9f56('0x38'),'include':[{'model':db[_0x9f56('0x28')],'as':_0x9f56('0x39'),'where':_0x257301,'limit':0x1,'order':[[_0x9f56('0x2d'),'DESC']]}]},{'model':db[_0x9f56('0x3a')],'as':_0x9f56('0x3b')}]});})[_0x9f56('0x10')](function(_0x22ebe1){if(_0x22ebe1&&_0x22ebe1[_0x9f56('0x38')]){var _0x21604c=_0x22ebe1['get']({'plain':!![]});_0x4f517f[_0x9f56('0x3c')]=_0x21604c;_0x4f517f[_0x9f56('0x3d')]=_0x21604c[_0x9f56('0x3b')];_0x4f517f[_0x9f56('0x3e')]=_0x21604c['List'];_0x4f517f[_0x9f56('0x3d')]=_['orderBy'](_0x4f517f[_0x9f56('0x3d')],[_0x9f56('0x3f')],['asc']);if(_0x4f517f[_0x9f56('0x3c')]['Applications']){delete _0x4f517f['account'][_0x9f56('0x3b')];}if(_0x4f517f[_0x9f56('0x3c')]['List']&&_0x4f517f['account'][_0x9f56('0x38')][_0x9f56('0x39')]['length']){return _0x4f517f[_0x9f56('0x3c')][_0x9f56('0x38')]['Contacts'][0x0];}var _0xa4d97e=_[_0x9f56('0xb')](_0x2a084a['body'],{'firstName':_0x2a084a[_0x9f56('0x26')][_0x9f56('0x36')],'ListId':_0x21604c['ListId']});_0xa4d97e[_0x2a084a['body'][_0x9f56('0x32')]]=_0x2a084a[_0x9f56('0x26')][_0x9f56('0x36')];return db[_0x9f56('0x28')]['create'](_0xa4d97e,{'fields':_0x2fdeaa,'raw':!![]});}})[_0x9f56('0x10')](function(_0x369b85){_0x4f517f[_0x9f56('0x40')]=_0x369b85;if(_0x369b85){var _0x7eea79={'ContactId':_0x369b85['id'],'FaxAccountId':_0x2a084a['account']['id'],'fax':_0x369b85['fax']};return db[_0x9f56('0x41')][_0x9f56('0x37')]({'where':{'ContactId':_0x369b85['id'],'closed':![],'FaxAccountId':_0x2a084a[_0x9f56('0x3c')]['id']}})[_0x9f56('0x10')](function(_0x17012a){if(_0x17012a){return[_0x17012a,![]];}return db[_0x9f56('0x41')][_0x9f56('0x42')](_0x7eea79)[_0x9f56('0x10')](function(_0x559631){return[_0x559631,!![]];});});}else{throw new Error(_0x9f56('0x43'));}})['spread'](function(_0x51018a,_0x17ba2a){var _0x42d0b3=_0x51018a[_0x9f56('0x44')]({'plain':!![]});if(_0x17ba2a){if(_0x4f517f[_0x9f56('0x3c')][_0x9f56('0x45')]){_0x4f517f[_0x9f56('0x3d')][_0x9f56('0x46')]({'id':0x0,'priority':_0x4f517f[_0x9f56('0x3d')][_0x9f56('0x47')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x9f56('0x48')});}_0x42d0b3[_0x9f56('0x49')]=!![];}else{_0x42d0b3['created']=![];}_0x4f517f[_0x9f56('0x4a')]=_0x42d0b3;return db[_0x9f56('0x4b')]['create']({'body':_0x2a084a['body']['body'],'FaxAccountId':_0x2a084a[_0x9f56('0x3c')]['id'],'FaxInteractionId':_0x51018a['id'],'direction':'in','ContactId':_0x51018a[_0x9f56('0x4c')],'AttachmentId':_0x2a084a[_0x9f56('0x26')][_0x9f56('0x4d')]});})[_0x9f56('0x10')](function(_0xd328e6){_0x4f517f['message']=_0xd328e6;if(_0x4f517f['interaction'][_0x9f56('0x4e')]){return db['User']['find']({'attributes':['id',_0x9f56('0x4f')],'where':{'id':_0x4f517f[_0x9f56('0x4a')][_0x9f56('0x4e')]}})['then'](function(_0x3e3852){if(_0x3e3852){_0x4f517f[_0x9f56('0x3d')][_0x9f56('0x50')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3e3852['name']+','+(_0x4f517f[_0x9f56('0x3c')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x9f56('0x51'),'startRouting',_0x4f517f);});}return respondWithRpcPromise('Start',_0x9f56('0x52'),_0x4f517f);})[_0x9f56('0x10')](function(_0x11b67a){_0x5d0f63(_0x11b67a);})[_0x9f56('0x25')](function(_0x443ff7){_0x599125(_0x2f2739[_0x9f56('0x16')](0x1f4,_0x443ff7[_0x9f56('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 40b31d7..57c430f 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 _0xfb11=['length','faxAccount:','./faxAccount.events','remove','update','emit','removeListener'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xfb11[_0x54d4fe];return _0x1ab5bb;};'use strict';var FaxAccountEvents=require(_0x1fb1('0x0'));var events=['save',_0x1fb1('0x1'),_0x1fb1('0x2')];function createListener(_0x51c055,_0x1461ad){return function(_0x5af9cc){_0x1461ad[_0x1fb1('0x3')](_0x51c055,_0x5af9cc);};}function removeListener(_0x5a830e,_0x190f74){return function(){FaxAccountEvents[_0x1fb1('0x4')](_0x5a830e,_0x190f74);};}exports['register']=function(_0x25d44f){for(var _0x133727=0x0,_0x4c098d=events[_0x1fb1('0x5')];_0x133727<_0x4c098d;_0x133727++){var _0x2596c2=events[_0x133727];var _0x34e61a=createListener(_0x1fb1('0x6')+_0x2596c2,_0x25d44f);FaxAccountEvents['on'](_0x2596c2,_0x34e61a);}}; \ No newline at end of file +var _0xe5af=['faxAccount:','save','remove','register','length'];(function(_0x3a191b,_0x719cd5){var _0x354883=function(_0xc92507){while(--_0xc92507){_0x3a191b['push'](_0x3a191b['shift']());}};_0x354883(++_0x719cd5);}(_0xe5af,0x9c));var _0xfe5a=function(_0x3f0c41,_0x13ed17){_0x3f0c41=_0x3f0c41-0x0;var _0x16b224=_0xe5af[_0x3f0c41];return _0x16b224;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xfe5a('0x0'),_0xfe5a('0x1'),'update'];function createListener(_0x9a3743,_0x1bad12){return function(_0x23b7f0){_0x1bad12['emit'](_0x9a3743,_0x23b7f0);};}function removeListener(_0x1165e3,_0x48e3a7){return function(){FaxAccountEvents['removeListener'](_0x1165e3,_0x48e3a7);};}exports[_0xfe5a('0x2')]=function(_0x2039cd){for(var _0x4e418f=0x0,_0x5eea2e=events[_0xfe5a('0x3')];_0x4e418f<_0x5eea2e;_0x4e418f++){var _0x106492=events[_0x4e418f];var _0xfb4357=createListener(_0xfe5a('0x4')+_0x106492,_0x2039cd);FaxAccountEvents['on'](_0x106492,_0xfb4357);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d0d386f..a3046ce 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 _0x011b=['destroy','removeDispositions','removeAnswers','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','put','delete'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x011b,0x82));var _0xb011=function(_0x5e0dfd,_0x4bba34){_0x5e0dfd=_0x5e0dfd-0x0;var _0xc12874=_0x011b[_0x5e0dfd];return _0xc12874;};'use strict';var multer=require('multer');var util=require(_0xb011('0x0'));var path=require(_0xb011('0x1'));var timeout=require('connect-timeout');var express=require(_0xb011('0x2'));var router=express[_0xb011('0x3')]();var fs_extra=require(_0xb011('0x4'));var auth=require(_0xb011('0x5'));var interaction=require(_0xb011('0x6'));var config=require(_0xb011('0x7'));var controller=require(_0xb011('0x8'));router[_0xb011('0x9')]('/',auth[_0xb011('0xa')](),controller[_0xb011('0xb')]);router[_0xb011('0x9')](_0xb011('0xc'),auth[_0xb011('0xa')](),controller[_0xb011('0xd')]);router[_0xb011('0x9')](_0xb011('0xe'),auth[_0xb011('0xa')](),controller['show']);router[_0xb011('0x9')](_0xb011('0xf'),auth[_0xb011('0xa')](),controller[_0xb011('0x10')]);router[_0xb011('0x9')](_0xb011('0x11'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xb011('0x12'),auth[_0xb011('0xa')](),controller[_0xb011('0x13')]);router['get'](_0xb011('0x14'),auth[_0xb011('0xa')](),controller['getApplications']);router[_0xb011('0x9')](_0xb011('0x15'),auth[_0xb011('0xa')](),controller[_0xb011('0x16')]);router[_0xb011('0x9')](_0xb011('0x17'),auth[_0xb011('0xa')](),controller[_0xb011('0x18')]);router[_0xb011('0x19')]('/',auth[_0xb011('0xa')](),controller[_0xb011('0x1a')]);router['post'](_0xb011('0xf'),auth[_0xb011('0xa')](),controller[_0xb011('0x1b')]);router[_0xb011('0x19')](_0xb011('0x11'),auth[_0xb011('0xa')](),controller[_0xb011('0x1c')]);router[_0xb011('0x19')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xb011('0x1d')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xb011('0x1e')]);router[_0xb011('0x19')](_0xb011('0x1f'),auth[_0xb011('0xa')](),controller[_0xb011('0x20')]);router[_0xb011('0x19')](_0xb011('0x21'),auth[_0xb011('0xa')](),controller[_0xb011('0x22')]);router['post'](_0xb011('0x23'),auth[_0xb011('0xa')](),controller['send']);router[_0xb011('0x19')]('/:id/users',auth[_0xb011('0xa')](),controller['addAgents']);router[_0xb011('0x24')](_0xb011('0xe'),auth[_0xb011('0xa')](),controller['update']);router[_0xb011('0x25')](_0xb011('0xe'),auth['isAuthenticated'](),controller[_0xb011('0x26')]);router['delete'](_0xb011('0xf'),auth[_0xb011('0xa')](),controller[_0xb011('0x27')]);router[_0xb011('0x25')](_0xb011('0x11'),auth[_0xb011('0xa')](),controller[_0xb011('0x28')]);router['delete']('/:id/users',auth[_0xb011('0xa')](),controller['removeAgents']);module[_0xb011('0x29')]=router; \ No newline at end of file +var _0x6dd6=['delete','destroy','removeAnswers','removeAgents','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','send','addAgents','update'];(function(_0x1fec7c,_0x31c9c8){var _0x12b817=function(_0x304ea7){while(--_0x304ea7){_0x1fec7c['push'](_0x1fec7c['shift']());}};_0x12b817(++_0x31c9c8);}(_0x6dd6,0x85));var _0x66dd=function(_0x3bdd40,_0x414ee6){_0x3bdd40=_0x3bdd40-0x0;var _0x216370=_0x6dd6[_0x3bdd40];return _0x216370;};'use strict';var multer=require(_0x66dd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x66dd('0x1'));var express=require(_0x66dd('0x2'));var router=express[_0x66dd('0x3')]();var fs_extra=require(_0x66dd('0x4'));var auth=require(_0x66dd('0x5'));var interaction=require(_0x66dd('0x6'));var config=require(_0x66dd('0x7'));var controller=require('./faxAccount.controller');router['get']('/',auth[_0x66dd('0x8')](),controller[_0x66dd('0x9')]);router['get'](_0x66dd('0xa'),auth[_0x66dd('0x8')](),controller[_0x66dd('0xb')]);router[_0x66dd('0xc')](_0x66dd('0xd'),auth[_0x66dd('0x8')](),controller[_0x66dd('0xe')]);router[_0x66dd('0xc')](_0x66dd('0xf'),auth['isAuthenticated'](),controller[_0x66dd('0x10')]);router[_0x66dd('0xc')](_0x66dd('0x11'),auth[_0x66dd('0x8')](),controller[_0x66dd('0x12')]);router[_0x66dd('0xc')](_0x66dd('0x13'),auth[_0x66dd('0x8')](),controller[_0x66dd('0x14')]);router[_0x66dd('0xc')](_0x66dd('0x15'),auth[_0x66dd('0x8')](),controller[_0x66dd('0x16')]);router[_0x66dd('0xc')]('/:id/messages',auth[_0x66dd('0x8')](),controller[_0x66dd('0x17')]);router[_0x66dd('0xc')](_0x66dd('0x18'),auth['isAuthenticated'](),controller[_0x66dd('0x19')]);router['post']('/',auth[_0x66dd('0x8')](),controller[_0x66dd('0x1a')]);router[_0x66dd('0x1b')](_0x66dd('0xf'),auth['isAuthenticated'](),controller[_0x66dd('0x1c')]);router[_0x66dd('0x1b')](_0x66dd('0x11'),auth['isAuthenticated'](),controller[_0x66dd('0x1d')]);router[_0x66dd('0x1b')]('/:id/interactions',auth[_0x66dd('0x8')](),controller[_0x66dd('0x1e')]);router[_0x66dd('0x1b')](_0x66dd('0x15'),auth['isAuthenticated'](),controller[_0x66dd('0x1f')]);router[_0x66dd('0x1b')](_0x66dd('0x20'),auth[_0x66dd('0x8')](),controller[_0x66dd('0x21')]);router[_0x66dd('0x1b')](_0x66dd('0x22'),auth[_0x66dd('0x8')](),controller[_0x66dd('0x23')]);router[_0x66dd('0x1b')]('/:id/send',auth['isAuthenticated'](),controller[_0x66dd('0x24')]);router['post'](_0x66dd('0x18'),auth['isAuthenticated'](),controller[_0x66dd('0x25')]);router['put'](_0x66dd('0xd'),auth[_0x66dd('0x8')](),controller[_0x66dd('0x26')]);router[_0x66dd('0x27')]('/:id',auth['isAuthenticated'](),controller[_0x66dd('0x28')]);router['delete']('/:id/dispositions',auth[_0x66dd('0x8')](),controller['removeDispositions']);router[_0x66dd('0x27')]('/:id/canned_answers',auth[_0x66dd('0x8')](),controller[_0x66dd('0x29')]);router[_0x66dd('0x27')](_0x66dd('0x18'),auth[_0x66dd('0x8')](),controller[_0x66dd('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 8934fd8..621aaf6 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 _0xdf4d=['INTEGER','noop','TEXT','STRING','*,*,*,*','exports'];(function(_0x533e4e,_0x4eba54){var _0x1f14bb=function(_0x33a485){while(--_0x33a485){_0x533e4e['push'](_0x533e4e['shift']());}};_0x1f14bb(++_0x4eba54);}(_0xdf4d,0xcb));var _0xddf4=function(_0x1498de,_0x170ad3){_0x1498de=_0x1498de-0x0;var _0x29d4d3=_0xdf4d[_0x1498de];return _0x29d4d3;};'use strict';var Sequelize=require('sequelize');module[_0xddf4('0x0')]={'priority':{'type':Sequelize[_0xddf4('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xddf4('0x2')},'appdata':{'type':Sequelize[_0xddf4('0x3')]()},'description':{'type':Sequelize[_0xddf4('0x4')]},'interval':{'type':Sequelize[_0xddf4('0x4')],'defaultValue':_0xddf4('0x5')}}; \ No newline at end of file +var _0x5cd5=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x5cd5,0x149));var _0x55cd=function(_0x1ad40d,_0x3ee0bb){_0x1ad40d=_0x1ad40d-0x0;var _0x25869d=_0x5cd5[_0x1ad40d];return _0x25869d;};'use strict';var Sequelize=require(_0x55cd('0x0'));module[_0x55cd('0x1')]={'priority':{'type':Sequelize[_0x55cd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x55cd('0x3')],'allowNull':![],'defaultValue':_0x55cd('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x55cd('0x3')]},'interval':{'type':Sequelize[_0x55cd('0x3')],'defaultValue':_0x55cd('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index e05cd79..51a1fb2 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 _0xfc8d=['limit','Content-Range','apply','reject','update','destroy','then','error','name','send','map','FaxApplication','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfc8d,0x1e7));var _0xdfc8=function(_0x4ac397,_0x1fc9ab){_0x4ac397=_0x4ac397-0x0;var _0x298df7=_0xfc8d[_0x4ac397];return _0x298df7;};'use strict';var emlformat=require(_0xdfc8('0x0'));var rimraf=require(_0xdfc8('0x1'));var zipdir=require(_0xdfc8('0x2'));var jsonpatch=require(_0xdfc8('0x3'));var rp=require('request-promise');var moment=require(_0xdfc8('0x4'));var BPromise=require(_0xdfc8('0x5'));var Mustache=require(_0xdfc8('0x6'));var util=require('util');var path=require(_0xdfc8('0x7'));var sox=require(_0xdfc8('0x8'));var csv=require(_0xdfc8('0x9'));var ejs=require(_0xdfc8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdfc8('0xb'));var crypto=require(_0xdfc8('0xc'));var jsforce=require(_0xdfc8('0xd'));var deskjs=require(_0xdfc8('0xe'));var toCsv=require(_0xdfc8('0x9'));var querystring=require(_0xdfc8('0xf'));var Papa=require(_0xdfc8('0x10'));var Redis=require(_0xdfc8('0x11'));var authService=require(_0xdfc8('0x12'));var qs=require(_0xdfc8('0x13'));var as=require(_0xdfc8('0x14'));var hardwareService=require(_0xdfc8('0x15'));var logger=require(_0xdfc8('0x16'))('api');var utils=require(_0xdfc8('0x17'));var config=require(_0xdfc8('0x18'));var licenseUtil=require(_0xdfc8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x246470,_0x49a4b2){_0x49a4b2=_0x49a4b2||0xcc;return function(_0x17ec5d){if(_0x17ec5d){return _0x246470[_0xdfc8('0x1a')](_0x49a4b2);}return _0x246470[_0xdfc8('0x1b')](_0x49a4b2)[_0xdfc8('0x1c')]();};}function respondWithResult(_0x425f37,_0x36cef4){_0x36cef4=_0x36cef4||0xc8;return function(_0xd3c713){if(_0xd3c713){return _0x425f37[_0xdfc8('0x1b')](_0x36cef4)[_0xdfc8('0x1d')](_0xd3c713);}};}function respondWithFilteredResult(_0x11ea61,_0x3740b5){return function(_0x24b196){if(_0x24b196){var _0x4ce9dc=_0x24b196['count'],_0x72ddaf=_0x3740b5[_0xdfc8('0x1e')],_0x1b91f1=_0x3740b5[_0xdfc8('0x1e')]+_0x3740b5[_0xdfc8('0x1f')],_0x100f38;if(_0x1b91f1>=_0x4ce9dc){_0x1b91f1=_0x4ce9dc;_0x100f38=0xc8;}else{_0x100f38=0xce;}_0x11ea61[_0xdfc8('0x1b')](_0x100f38);return _0x11ea61['set'](_0xdfc8('0x20'),_0x72ddaf+'-'+_0x1b91f1+'/'+_0x4ce9dc)[_0xdfc8('0x1d')](_0x24b196);}return null;};}function patchUpdates(_0x3f6259){return function(_0x3cd794){try{jsonpatch[_0xdfc8('0x21')](_0x3cd794,_0x3f6259,!![]);}catch(_0x24b77e){return BPromise[_0xdfc8('0x22')](_0x24b77e);}return _0x3cd794['save']();};}function saveUpdates(_0x5eaced,_0x722c2a){return function(_0x58e2dc){if(_0x58e2dc){return _0x58e2dc[_0xdfc8('0x23')](_0x5eaced)['then'](function(_0x13af6b){return _0x13af6b;});}return null;};}function removeEntity(_0x144520,_0x156f01){return function(_0x17352f){if(_0x17352f){return _0x17352f[_0xdfc8('0x24')]()[_0xdfc8('0x25')](function(){_0x144520[_0xdfc8('0x1b')](0xcc)[_0xdfc8('0x1c')]();});}};}function handleEntityNotFound(_0x4dccae,_0x32c387){return function(_0x498217){if(!_0x498217){_0x4dccae[_0xdfc8('0x1a')](0x194);}return _0x498217;};}function handleError(_0x52b914,_0xeff4f1){_0xeff4f1=_0xeff4f1||0x1f4;return function(_0x40702a){logger[_0xdfc8('0x26')](_0x40702a['stack']);if(_0x40702a[_0xdfc8('0x27')]){delete _0x40702a['name'];}_0x52b914[_0xdfc8('0x1b')](_0xeff4f1)[_0xdfc8('0x28')](_0x40702a);};}exports['index']=function(_0xaa1ad9,_0x1a0fed){var _0xac27e1={},_0x50af33={},_0x4e8268={'count':0x0,'rows':[]};var _0x1c4e55=_[_0xdfc8('0x29')](db[_0xdfc8('0x2a')][_0xdfc8('0x2b')],function(_0x3f6a6b){return{'name':_0x3f6a6b['fieldName'],'type':_0x3f6a6b[_0xdfc8('0x2c')]['key']};});_0x50af33['model']=_['map'](_0x1c4e55,_0xdfc8('0x27'));_0x50af33[_0xdfc8('0x2d')]=_[_0xdfc8('0x2e')](_0xaa1ad9['query']);_0x50af33[_0xdfc8('0x2f')]=_[_0xdfc8('0x30')](_0x50af33[_0xdfc8('0x31')],_0x50af33[_0xdfc8('0x2d')]);_0xac27e1['attributes']=_[_0xdfc8('0x30')](_0x50af33['model'],qs[_0xdfc8('0x32')](_0xaa1ad9['query'][_0xdfc8('0x32')]));_0xac27e1[_0xdfc8('0x33')]=_0xac27e1['attributes'][_0xdfc8('0x34')]?_0xac27e1[_0xdfc8('0x33')]:_0x50af33[_0xdfc8('0x31')];if(!_0xaa1ad9['query'][_0xdfc8('0x35')](_0xdfc8('0x36'))){_0xac27e1[_0xdfc8('0x1f')]=qs['limit'](_0xaa1ad9[_0xdfc8('0x2d')][_0xdfc8('0x1f')]);_0xac27e1[_0xdfc8('0x1e')]=qs[_0xdfc8('0x1e')](_0xaa1ad9[_0xdfc8('0x2d')][_0xdfc8('0x1e')]);}_0xac27e1[_0xdfc8('0x37')]=qs[_0xdfc8('0x38')](_0xaa1ad9[_0xdfc8('0x2d')][_0xdfc8('0x38')]);_0xac27e1[_0xdfc8('0x39')]=qs[_0xdfc8('0x2f')](_[_0xdfc8('0x3a')](_0xaa1ad9[_0xdfc8('0x2d')],_0x50af33[_0xdfc8('0x2f')]),_0x1c4e55);if(_0xaa1ad9['query'][_0xdfc8('0x3b')]){_0xac27e1['where']=_[_0xdfc8('0x3c')](_0xac27e1[_0xdfc8('0x39')],{'$or':_[_0xdfc8('0x29')](_0x1c4e55,function(_0x5e17e5){if(_0x5e17e5['type']!==_0xdfc8('0x3d')){var _0x1e4443={};_0x1e4443[_0x5e17e5[_0xdfc8('0x27')]]={'$like':'%'+_0xaa1ad9[_0xdfc8('0x2d')]['filter']+'%'};return _0x1e4443;}})});}_0xac27e1=_[_0xdfc8('0x3c')]({},_0xac27e1,_0xaa1ad9[_0xdfc8('0x3e')]);var _0x2272b9={'where':_0xac27e1['where']};return db[_0xdfc8('0x2a')][_0xdfc8('0x3f')](_0x2272b9)[_0xdfc8('0x25')](function(_0x3cf102){_0x4e8268[_0xdfc8('0x3f')]=_0x3cf102;if(_0xaa1ad9[_0xdfc8('0x2d')][_0xdfc8('0x40')]){_0xac27e1[_0xdfc8('0x41')]=[{'all':!![]}];}return db[_0xdfc8('0x2a')][_0xdfc8('0x42')](_0xac27e1);})[_0xdfc8('0x25')](function(_0x2ad3e3){_0x4e8268[_0xdfc8('0x43')]=_0x2ad3e3;return _0x4e8268;})['then'](respondWithFilteredResult(_0x1a0fed,_0xac27e1))['catch'](handleError(_0x1a0fed,null));};exports[_0xdfc8('0x44')]=function(_0x1c8420,_0x5041fb){var _0x8d9974={'raw':!![],'where':{'id':_0x1c8420[_0xdfc8('0x45')]['id']}},_0x4e0f28={};_0x4e0f28[_0xdfc8('0x31')]=_[_0xdfc8('0x2e')](db[_0xdfc8('0x2a')]['rawAttributes']);_0x4e0f28['query']=_['keys'](_0x1c8420[_0xdfc8('0x2d')]);_0x4e0f28[_0xdfc8('0x2f')]=_[_0xdfc8('0x30')](_0x4e0f28['model'],_0x4e0f28[_0xdfc8('0x2d')]);_0x8d9974['attributes']=_[_0xdfc8('0x30')](_0x4e0f28[_0xdfc8('0x31')],qs[_0xdfc8('0x32')](_0x1c8420[_0xdfc8('0x2d')][_0xdfc8('0x32')]));_0x8d9974[_0xdfc8('0x33')]=_0x8d9974[_0xdfc8('0x33')][_0xdfc8('0x34')]?_0x8d9974[_0xdfc8('0x33')]:_0x4e0f28['model'];if(_0x1c8420[_0xdfc8('0x2d')]['includeAll']){_0x8d9974[_0xdfc8('0x41')]=[{'all':!![]}];}_0x8d9974=_[_0xdfc8('0x3c')]({},_0x8d9974,_0x1c8420[_0xdfc8('0x3e')]);return db['FaxApplication'][_0xdfc8('0x46')](_0x8d9974)['then'](handleEntityNotFound(_0x5041fb,null))[_0xdfc8('0x25')](respondWithResult(_0x5041fb,null))[_0xdfc8('0x47')](handleError(_0x5041fb,null));};exports[_0xdfc8('0x48')]=function(_0x4dd4f0,_0x35bdb0){return db[_0xdfc8('0x2a')]['create'](_0x4dd4f0['body'],{})['then'](respondWithResult(_0x35bdb0,0xc9))['catch'](handleError(_0x35bdb0,null));};exports[_0xdfc8('0x23')]=function(_0xfee6ec,_0x330f5e){if(_0xfee6ec[_0xdfc8('0x49')]['id']){delete _0xfee6ec[_0xdfc8('0x49')]['id'];}return db[_0xdfc8('0x2a')][_0xdfc8('0x46')]({'where':{'id':_0xfee6ec[_0xdfc8('0x45')]['id']}})[_0xdfc8('0x25')](handleEntityNotFound(_0x330f5e,null))[_0xdfc8('0x25')](saveUpdates(_0xfee6ec['body'],null))[_0xdfc8('0x25')](respondWithResult(_0x330f5e,null))[_0xdfc8('0x47')](handleError(_0x330f5e,null));};exports[_0xdfc8('0x24')]=function(_0x178011,_0x2084c3){return db[_0xdfc8('0x2a')][_0xdfc8('0x46')]({'where':{'id':_0x178011[_0xdfc8('0x45')]['id']}})[_0xdfc8('0x25')](handleEntityNotFound(_0x2084c3,null))[_0xdfc8('0x25')](removeEntity(_0x2084c3,null))[_0xdfc8('0x47')](handleError(_0x2084c3,null));}; \ No newline at end of file +var _0xdaf5=['name','send','index','map','FaxApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','options','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','status','error','stack'];(function(_0x3bb995,_0x4c3f72){var _0x4496aa=function(_0x15b09f){while(--_0x15b09f){_0x3bb995['push'](_0x3bb995['shift']());}};_0x4496aa(++_0x4c3f72);}(_0xdaf5,0x1d9));var _0x5daf=function(_0x2b91ac,_0x310741){_0x2b91ac=_0x2b91ac-0x0;var _0xe88814=_0xdaf5[_0x2b91ac];return _0xe88814;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5daf('0x0'));var zipdir=require(_0x5daf('0x1'));var jsonpatch=require(_0x5daf('0x2'));var rp=require(_0x5daf('0x3'));var moment=require(_0x5daf('0x4'));var BPromise=require(_0x5daf('0x5'));var Mustache=require('mustache');var util=require(_0x5daf('0x6'));var path=require(_0x5daf('0x7'));var sox=require(_0x5daf('0x8'));var csv=require('to-csv');var ejs=require(_0x5daf('0x9'));var fs=require('fs');var fs_extra=require(_0x5daf('0xa'));var _=require(_0x5daf('0xb'));var squel=require(_0x5daf('0xc'));var crypto=require('crypto');var jsforce=require(_0x5daf('0xd'));var deskjs=require(_0x5daf('0xe'));var toCsv=require(_0x5daf('0xf'));var querystring=require(_0x5daf('0x10'));var Papa=require(_0x5daf('0x11'));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(_0x5daf('0x12'));var logger=require(_0x5daf('0x13'))(_0x5daf('0x14'));var utils=require('../../config/utils');var config=require(_0x5daf('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5daf('0x16'))['db'];function respondWithStatusCode(_0x53247c,_0x53b1c5){_0x53b1c5=_0x53b1c5||0xcc;return function(_0x426faa){if(_0x426faa){return _0x53247c[_0x5daf('0x17')](_0x53b1c5);}return _0x53247c['status'](_0x53b1c5)[_0x5daf('0x18')]();};}function respondWithResult(_0x5d8ce3,_0x11c0b4){_0x11c0b4=_0x11c0b4||0xc8;return function(_0x21659c){if(_0x21659c){return _0x5d8ce3['status'](_0x11c0b4)[_0x5daf('0x19')](_0x21659c);}};}function respondWithFilteredResult(_0x4196de,_0x51fc10){return function(_0x481c5d){if(_0x481c5d){var _0x5d9b28=_0x481c5d[_0x5daf('0x1a')],_0x12717b=_0x51fc10['offset'],_0x4dde8a=_0x51fc10[_0x5daf('0x1b')]+_0x51fc10[_0x5daf('0x1c')],_0x1cea70;if(_0x4dde8a>=_0x5d9b28){_0x4dde8a=_0x5d9b28;_0x1cea70=0xc8;}else{_0x1cea70=0xce;}_0x4196de['status'](_0x1cea70);return _0x4196de[_0x5daf('0x1d')](_0x5daf('0x1e'),_0x12717b+'-'+_0x4dde8a+'/'+_0x5d9b28)[_0x5daf('0x19')](_0x481c5d);}return null;};}function patchUpdates(_0x46470a){return function(_0x4a9a52){try{jsonpatch[_0x5daf('0x1f')](_0x4a9a52,_0x46470a,!![]);}catch(_0x107018){return BPromise['reject'](_0x107018);}return _0x4a9a52['save']();};}function saveUpdates(_0x3d1606,_0x591a1f){return function(_0x6407bf){if(_0x6407bf){return _0x6407bf[_0x5daf('0x20')](_0x3d1606)[_0x5daf('0x21')](function(_0xeb25d8){return _0xeb25d8;});}return null;};}function removeEntity(_0xdebc75,_0x227c0d){return function(_0x1e1f4f){if(_0x1e1f4f){return _0x1e1f4f[_0x5daf('0x22')]()[_0x5daf('0x21')](function(){_0xdebc75[_0x5daf('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e1fa6,_0x2924fc){return function(_0x21d875){if(!_0x21d875){_0x2e1fa6['sendStatus'](0x194);}return _0x21d875;};}function handleError(_0x19d135,_0x2be0ff){_0x2be0ff=_0x2be0ff||0x1f4;return function(_0x20c7b4){logger[_0x5daf('0x24')](_0x20c7b4[_0x5daf('0x25')]);if(_0x20c7b4[_0x5daf('0x26')]){delete _0x20c7b4[_0x5daf('0x26')];}_0x19d135[_0x5daf('0x23')](_0x2be0ff)[_0x5daf('0x27')](_0x20c7b4);};}exports[_0x5daf('0x28')]=function(_0x258237,_0x3fd75e){var _0x1dd039={},_0x5c2ed1={},_0x19ce4d={'count':0x0,'rows':[]};var _0x429dce=_[_0x5daf('0x29')](db[_0x5daf('0x2a')][_0x5daf('0x2b')],function(_0x3d48b4){return{'name':_0x3d48b4[_0x5daf('0x2c')],'type':_0x3d48b4['type'][_0x5daf('0x2d')]};});_0x5c2ed1['model']=_['map'](_0x429dce,_0x5daf('0x26'));_0x5c2ed1[_0x5daf('0x2e')]=_[_0x5daf('0x2f')](_0x258237['query']);_0x5c2ed1[_0x5daf('0x30')]=_[_0x5daf('0x31')](_0x5c2ed1[_0x5daf('0x32')],_0x5c2ed1[_0x5daf('0x2e')]);_0x1dd039[_0x5daf('0x33')]=_[_0x5daf('0x31')](_0x5c2ed1[_0x5daf('0x32')],qs['fields'](_0x258237[_0x5daf('0x2e')][_0x5daf('0x34')]));_0x1dd039['attributes']=_0x1dd039[_0x5daf('0x33')]['length']?_0x1dd039[_0x5daf('0x33')]:_0x5c2ed1[_0x5daf('0x32')];if(!_0x258237[_0x5daf('0x2e')][_0x5daf('0x35')](_0x5daf('0x36'))){_0x1dd039[_0x5daf('0x1c')]=qs[_0x5daf('0x1c')](_0x258237[_0x5daf('0x2e')][_0x5daf('0x1c')]);_0x1dd039[_0x5daf('0x1b')]=qs['offset'](_0x258237['query'][_0x5daf('0x1b')]);}_0x1dd039[_0x5daf('0x37')]=qs['sort'](_0x258237['query'][_0x5daf('0x38')]);_0x1dd039[_0x5daf('0x39')]=qs[_0x5daf('0x30')](_['pick'](_0x258237[_0x5daf('0x2e')],_0x5c2ed1[_0x5daf('0x30')]),_0x429dce);if(_0x258237['query'][_0x5daf('0x3a')]){_0x1dd039[_0x5daf('0x39')]=_[_0x5daf('0x3b')](_0x1dd039['where'],{'$or':_['map'](_0x429dce,function(_0xbc70fc){if(_0xbc70fc['type']!==_0x5daf('0x3c')){var _0x2fdfc6={};_0x2fdfc6[_0xbc70fc['name']]={'$like':'%'+_0x258237[_0x5daf('0x2e')][_0x5daf('0x3a')]+'%'};return _0x2fdfc6;}})});}_0x1dd039=_[_0x5daf('0x3b')]({},_0x1dd039,_0x258237['options']);var _0x5ae11e={'where':_0x1dd039[_0x5daf('0x39')]};return db['FaxApplication']['count'](_0x5ae11e)['then'](function(_0x3b462e){_0x19ce4d[_0x5daf('0x1a')]=_0x3b462e;if(_0x258237[_0x5daf('0x2e')][_0x5daf('0x3d')]){_0x1dd039['include']=[{'all':!![]}];}return db['FaxApplication'][_0x5daf('0x3e')](_0x1dd039);})[_0x5daf('0x21')](function(_0xc0184a){_0x19ce4d[_0x5daf('0x3f')]=_0xc0184a;return _0x19ce4d;})['then'](respondWithFilteredResult(_0x3fd75e,_0x1dd039))[_0x5daf('0x40')](handleError(_0x3fd75e,null));};exports[_0x5daf('0x41')]=function(_0x418df4,_0x40d322){var _0x3f8533={'raw':!![],'where':{'id':_0x418df4[_0x5daf('0x42')]['id']}},_0x3d916c={};_0x3d916c[_0x5daf('0x32')]=_[_0x5daf('0x2f')](db[_0x5daf('0x2a')][_0x5daf('0x2b')]);_0x3d916c[_0x5daf('0x2e')]=_[_0x5daf('0x2f')](_0x418df4['query']);_0x3d916c['filters']=_['intersection'](_0x3d916c['model'],_0x3d916c['query']);_0x3f8533[_0x5daf('0x33')]=_[_0x5daf('0x31')](_0x3d916c[_0x5daf('0x32')],qs['fields'](_0x418df4['query']['fields']));_0x3f8533['attributes']=_0x3f8533[_0x5daf('0x33')][_0x5daf('0x43')]?_0x3f8533[_0x5daf('0x33')]:_0x3d916c[_0x5daf('0x32')];if(_0x418df4[_0x5daf('0x2e')]['includeAll']){_0x3f8533[_0x5daf('0x44')]=[{'all':!![]}];}_0x3f8533=_[_0x5daf('0x3b')]({},_0x3f8533,_0x418df4[_0x5daf('0x45')]);return db['FaxApplication']['find'](_0x3f8533)[_0x5daf('0x21')](handleEntityNotFound(_0x40d322,null))[_0x5daf('0x21')](respondWithResult(_0x40d322,null))['catch'](handleError(_0x40d322,null));};exports[_0x5daf('0x46')]=function(_0xdfd8b6,_0x10c43e){return db[_0x5daf('0x2a')][_0x5daf('0x46')](_0xdfd8b6[_0x5daf('0x47')],{})['then'](respondWithResult(_0x10c43e,0xc9))[_0x5daf('0x40')](handleError(_0x10c43e,null));};exports[_0x5daf('0x20')]=function(_0x326581,_0x411f52){if(_0x326581[_0x5daf('0x47')]['id']){delete _0x326581['body']['id'];}return db[_0x5daf('0x2a')][_0x5daf('0x48')]({'where':{'id':_0x326581[_0x5daf('0x42')]['id']}})[_0x5daf('0x21')](handleEntityNotFound(_0x411f52,null))[_0x5daf('0x21')](saveUpdates(_0x326581['body'],null))[_0x5daf('0x21')](respondWithResult(_0x411f52,null))[_0x5daf('0x40')](handleError(_0x411f52,null));};exports[_0x5daf('0x22')]=function(_0x4b6daa,_0x439fca){return db[_0x5daf('0x2a')][_0x5daf('0x48')]({'where':{'id':_0x4b6daa['params']['id']}})['then'](handleEntityNotFound(_0x439fca,null))[_0x5daf('0x21')](removeEntity(_0x439fca,null))[_0x5daf('0x40')](handleError(_0x439fca,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 7dab2db..d7b7884 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 _0xe84f=['path','rimraf','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x150bce,_0x58266c){var _0x96578b=function(_0x252cea){while(--_0x252cea){_0x150bce['push'](_0x150bce['shift']());}};_0x96578b(++_0x58266c);}(_0xe84f,0x133));var _0xfe84=function(_0x2ebb03,_0x495b26){_0x2ebb03=_0x2ebb03-0x0;var _0x54d4ba=_0xe84f[_0x2ebb03];return _0x54d4ba;};'use strict';var _=require(_0xfe84('0x0'));var util=require(_0xfe84('0x1'));var logger=require('../../config/logger')(_0xfe84('0x2'));var moment=require(_0xfe84('0x3'));var BPromise=require(_0xfe84('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe84('0x5'));var rimraf=require(_0xfe84('0x6'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x57dca8,_0x3d3936){return _0x57dca8[_0xfe84('0x7')](_0xfe84('0x8'),attributes,{'tableName':_0xfe84('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfe84('0xa'),'collate':_0xfe84('0xb')});}; \ No newline at end of file +var _0x6d1b=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4'];(function(_0x22e34e,_0x598a1d){var _0x411e59=function(_0x63f722){while(--_0x63f722){_0x22e34e['push'](_0x22e34e['shift']());}};_0x411e59(++_0x598a1d);}(_0x6d1b,0x191));var _0xb6d1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6d1b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb6d1('0x0'));var util=require(_0xb6d1('0x1'));var logger=require(_0xb6d1('0x2'))(_0xb6d1('0x3'));var moment=require(_0xb6d1('0x4'));var BPromise=require(_0xb6d1('0x5'));var rp=require(_0xb6d1('0x6'));var fs=require('fs');var path=require(_0xb6d1('0x7'));var rimraf=require(_0xb6d1('0x8'));var config=require(_0xb6d1('0x9'));var attributes=require(_0xb6d1('0xa'));module[_0xb6d1('0xb')]=function(_0x2ad2f2,_0xef8a49){return _0x2ad2f2[_0xb6d1('0xc')](_0xb6d1('0xd'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb6d1('0xe'),'collate':_0xb6d1('0xf')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index dc691b7..1fe22c7 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 _0xa3c0=['then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','UpdateFaxApplication','FaxApplication','options','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x559ac2,_0x3da489){var _0xc3e79d=function(_0x121c3c){while(--_0x121c3c){_0x559ac2['push'](_0x559ac2['shift']());}};_0xc3e79d(++_0x3da489);}(_0xa3c0,0xc5));var _0x0a3c=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa3c0[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x0a3c('0x0'));var util=require(_0x0a3c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a3c('0x2'));var fs=require('fs');var Redis=require(_0x0a3c('0x3'));var db=require(_0x0a3c('0x4'))['db'];var utils=require(_0x0a3c('0x5'));var logger=require(_0x0a3c('0x6'))(_0x0a3c('0x7'));var config=require(_0x0a3c('0x8'));var jayson=require(_0x0a3c('0x9'));var client=jayson[_0x0a3c('0xa')][_0x0a3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dc6c4,_0x422683,_0x2216d6){return new BPromise(function(_0x163799,_0x5d36a6){return client[_0x0a3c('0xc')](_0x1dc6c4,_0x2216d6)[_0x0a3c('0xd')](function(_0x16a816){logger['info'](_0x0a3c('0xe'),_0x422683,_0x0a3c('0xf'));logger[_0x0a3c('0x10')](_0x0a3c('0x11'),_0x422683,_0x0a3c('0xf'),JSON[_0x0a3c('0x12')](_0x16a816));if(_0x16a816['error']){if(_0x16a816['error'][_0x0a3c('0x13')]===0x1f4){logger[_0x0a3c('0x14')](_0x0a3c('0xe'),_0x422683,_0x16a816[_0x0a3c('0x14')][_0x0a3c('0x15')]);return _0x5d36a6(_0x16a816[_0x0a3c('0x14')][_0x0a3c('0x15')]);}logger[_0x0a3c('0x14')](_0x0a3c('0xe'),_0x422683,_0x16a816[_0x0a3c('0x14')][_0x0a3c('0x15')]);return _0x163799(_0x16a816[_0x0a3c('0x14')][_0x0a3c('0x15')]);}else{logger[_0x0a3c('0x16')]('FaxApplication,\x20%s,\x20%s',_0x422683,_0x0a3c('0xf'));_0x163799(_0x16a816['result'][_0x0a3c('0x15')]);}})[_0x0a3c('0x17')](function(_0x275e1b){logger[_0x0a3c('0x14')](_0x0a3c('0xe'),_0x422683,_0x275e1b);_0x5d36a6(_0x275e1b);});});}exports[_0x0a3c('0x18')]=function(_0x193851){var _0x2c7b24=this;return new Promise(function(_0x1b2734,_0x34f31b){return db[_0x0a3c('0x19')]['update'](_0x193851['body'],{'raw':_0x193851[_0x0a3c('0x1a')]?_0x193851['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x193851[_0x0a3c('0x1a')]?_0x193851[_0x0a3c('0x1a')][_0x0a3c('0x1b')]||null:null,'attributes':_0x193851[_0x0a3c('0x1a')]?_0x193851[_0x0a3c('0x1a')][_0x0a3c('0x1c')]||null:null,'limit':_0x193851[_0x0a3c('0x1a')]?_0x193851[_0x0a3c('0x1a')][_0x0a3c('0x1d')]||null:null})['then'](function(_0xbe9834){logger['info'](_0x0a3c('0x18'),_0x193851);logger['debug'](_0x0a3c('0x18'),_0x193851,JSON['stringify'](_0xbe9834));_0x1b2734(_0xbe9834);})[_0x0a3c('0x17')](function(_0x509e80){logger[_0x0a3c('0x14')](_0x0a3c('0x18'),_0x509e80[_0x0a3c('0x15')],_0x193851);_0x34f31b(_0x2c7b24['error'](0x1f4,_0x509e80[_0x0a3c('0x15')]));});});}; \ No newline at end of file +var _0xb54e=['FaxApplication','options','raw','where','limit','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb54e,0xee));var _0xeb54=function(_0x41084f,_0x257353){_0x41084f=_0x41084f-0x0;var _0x1fda9a=_0xb54e[_0x41084f];return _0x1fda9a;};'use strict';var _=require('lodash');var util=require(_0xeb54('0x0'));var moment=require(_0xeb54('0x1'));var BPromise=require(_0xeb54('0x2'));var rs=require(_0xeb54('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb54('0x4'))['db'];var utils=require(_0xeb54('0x5'));var logger=require(_0xeb54('0x6'))('rpc');var config=require(_0xeb54('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xeb54('0x8')][_0xeb54('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2641e0,_0xb4f0d7,_0x585d8f){return new BPromise(function(_0x4b9ce1,_0x5e3fe9){return client[_0xeb54('0xa')](_0x2641e0,_0x585d8f)[_0xeb54('0xb')](function(_0x5cdd44){logger[_0xeb54('0xc')](_0xeb54('0xd'),_0xb4f0d7,_0xeb54('0xe'));logger['debug'](_0xeb54('0xf'),_0xb4f0d7,'request\x20sent',JSON[_0xeb54('0x10')](_0x5cdd44));if(_0x5cdd44[_0xeb54('0x11')]){if(_0x5cdd44[_0xeb54('0x11')][_0xeb54('0x12')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0xb4f0d7,_0x5cdd44['error']['message']);return _0x5e3fe9(_0x5cdd44['error']['message']);}logger[_0xeb54('0x11')](_0xeb54('0xd'),_0xb4f0d7,_0x5cdd44[_0xeb54('0x11')][_0xeb54('0x13')]);return _0x4b9ce1(_0x5cdd44[_0xeb54('0x11')][_0xeb54('0x13')]);}else{logger['info'](_0xeb54('0xd'),_0xb4f0d7,'request\x20sent');_0x4b9ce1(_0x5cdd44[_0xeb54('0x14')]['message']);}})[_0xeb54('0x15')](function(_0x2bd8e9){logger[_0xeb54('0x11')](_0xeb54('0xd'),_0xb4f0d7,_0x2bd8e9);_0x5e3fe9(_0x2bd8e9);});});}exports[_0xeb54('0x16')]=function(_0x2f34e1){var _0x168f7d=this;return new Promise(function(_0x35fabd,_0x4580ac){return db[_0xeb54('0x17')]['update'](_0x2f34e1['body'],{'raw':_0x2f34e1[_0xeb54('0x18')]?_0x2f34e1[_0xeb54('0x18')][_0xeb54('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f34e1[_0xeb54('0x18')]?_0x2f34e1['options'][_0xeb54('0x1a')]||null:null,'attributes':_0x2f34e1[_0xeb54('0x18')]?_0x2f34e1['options']['attributes']||null:null,'limit':_0x2f34e1[_0xeb54('0x18')]?_0x2f34e1[_0xeb54('0x18')][_0xeb54('0x1b')]||null:null})[_0xeb54('0xb')](function(_0xd848f){logger[_0xeb54('0xc')](_0xeb54('0x16'),_0x2f34e1);logger[_0xeb54('0x1c')](_0xeb54('0x16'),_0x2f34e1,JSON['stringify'](_0xd848f));_0x35fabd(_0xd848f);})[_0xeb54('0x15')](function(_0x1908cc){logger[_0xeb54('0x11')](_0xeb54('0x16'),_0x1908cc[_0xeb54('0x13')],_0x2f34e1);_0x4580ac(_0x168f7d[_0xeb54('0x11')](0x1f4,_0x1908cc[_0xeb54('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 932952a..4e63c5c 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 _0xcc61=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x233622,_0x458f9f){var _0x559f1f=function(_0x482c15){while(--_0x482c15){_0x233622['push'](_0x233622['shift']());}};_0x559f1f(++_0x458f9f);}(_0xcc61,0x15b));var _0x1cc6=function(_0x4be008,_0x5e2d40){_0x4be008=_0x4be008-0x0;var _0x2877fe=_0xcc61[_0x4be008];return _0x2877fe;};'use strict';var multer=require(_0x1cc6('0x0'));var util=require(_0x1cc6('0x1'));var path=require(_0x1cc6('0x2'));var timeout=require(_0x1cc6('0x3'));var express=require(_0x1cc6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1cc6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1cc6('0x6'));router[_0x1cc6('0x7')]('/',auth[_0x1cc6('0x8')](),controller[_0x1cc6('0x9')]);router[_0x1cc6('0x7')](_0x1cc6('0xa'),auth[_0x1cc6('0x8')](),controller[_0x1cc6('0xb')]);router[_0x1cc6('0xc')]('/',auth[_0x1cc6('0x8')](),controller[_0x1cc6('0xd')]);router['put'](_0x1cc6('0xa'),auth[_0x1cc6('0x8')](),controller[_0x1cc6('0xe')]);router[_0x1cc6('0xf')](_0x1cc6('0xa'),auth['isAuthenticated'](),controller[_0x1cc6('0x10')]);module[_0x1cc6('0x11')]=router; \ No newline at end of file +var _0x9305=['./faxApplication.controller','get','index','/:id','isAuthenticated','show','post','create','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x22ea67,_0x46182b){var _0x3e859d=function(_0x8941d){while(--_0x8941d){_0x22ea67['push'](_0x22ea67['shift']());}};_0x3e859d(++_0x46182b);}(_0x9305,0x1b3));var _0x5930=function(_0x3c64e4,_0x385581){_0x3c64e4=_0x3c64e4-0x0;var _0x546166=_0x9305[_0x3c64e4];return _0x546166;};'use strict';var multer=require(_0x5930('0x0'));var util=require('util');var path=require(_0x5930('0x1'));var timeout=require(_0x5930('0x2'));var express=require(_0x5930('0x3'));var router=express[_0x5930('0x4')]();var fs_extra=require(_0x5930('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5930('0x6'));var config=require('../../config/environment');var controller=require(_0x5930('0x7'));router[_0x5930('0x8')]('/',auth['isAuthenticated'](),controller[_0x5930('0x9')]);router[_0x5930('0x8')](_0x5930('0xa'),auth[_0x5930('0xb')](),controller[_0x5930('0xc')]);router[_0x5930('0xd')]('/',auth['isAuthenticated'](),controller[_0x5930('0xe')]);router['put'](_0x5930('0xa'),auth[_0x5930('0xb')](),controller['update']);router['delete'](_0x5930('0xa'),auth['isAuthenticated'](),controller[_0x5930('0xf')]);module[_0x5930('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 644836d..7513a30 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 _0x2975=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x4208b5,_0x159c6c){var _0x41a778=function(_0xdb8568){while(--_0xdb8568){_0x4208b5['push'](_0x4208b5['shift']());}};_0x41a778(++_0x159c6c);}(_0x2975,0x1c5));var _0x5297=function(_0x419a89,_0x5e6385){_0x419a89=_0x419a89-0x0;var _0x1bfa6a=_0x2975[_0x419a89];return _0x1bfa6a;};'use strict';var Sequelize=require('sequelize');module[_0x5297('0x0')]={'closed':{'type':Sequelize[_0x5297('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5297('0x2')]},'disposition':{'type':Sequelize[_0x5297('0x3')]},'secondDisposition':{'type':Sequelize[_0x5297('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5297('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x5297('0x4')]('in',_0x5297('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5297('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x5297('0x4')]('in',_0x5297('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xf29c=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x1814c2,_0x40fea0){var _0x4cb863=function(_0x561685){while(--_0x561685){_0x1814c2['push'](_0x1814c2['shift']());}};_0x4cb863(++_0x40fea0);}(_0xf29c,0xc7));var _0xcf29=function(_0x4e6b32,_0x2e9dd7){_0x4e6b32=_0x4e6b32-0x0;var _0x13d680=_0xf29c[_0x4e6b32];return _0x13d680;};'use strict';var Sequelize=require('sequelize');module[_0xcf29('0x0')]={'closed':{'type':Sequelize[_0xcf29('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcf29('0x2')]},'disposition':{'type':Sequelize[_0xcf29('0x3')]},'secondDisposition':{'type':Sequelize[_0xcf29('0x3')]},'thirdDisposition':{'type':Sequelize[_0xcf29('0x3')]},'note':{'type':Sequelize[_0xcf29('0x3')]},'read1stAt':{'type':Sequelize[_0xcf29('0x2')]},'fax':{'type':Sequelize[_0xcf29('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcf29('0x4')]('in',_0xcf29('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcf29('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xcf29('0x4')]('in',_0xcf29('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 4ad14f4..317da3c 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 _0x18b0=['SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','toString','sequelize','FaxInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.firstName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','intersection','includeAll','include','merge','options','create','describe','addMessage','FaxMessage','ids','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','omit','spread','Tag','color','emit','faxInteractionTags:save','removeTags','unix','join','server','root','files','attachments','Attachment','Messages','get','basename','existsSync','createReadStream','pipe','createWriteStream','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','squel','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','Users','map','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','field','from','select','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','isArray','filter','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x18b0,0x124));var _0x018b=function(_0x19ae46,_0x32f946){_0x19ae46=_0x19ae46-0x0;var _0x5e19e4=_0x18b0[_0x19ae46];return _0x5e19e4;};'use strict';var emlformat=require(_0x018b('0x0'));var rimraf=require(_0x018b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x018b('0x2'));var rp=require(_0x018b('0x3'));var moment=require(_0x018b('0x4'));var BPromise=require(_0x018b('0x5'));var Mustache=require('mustache');var util=require(_0x018b('0x6'));var path=require('path');var sox=require(_0x018b('0x7'));var csv=require('to-csv');var ejs=require(_0x018b('0x8'));var fs=require('fs');var fs_extra=require(_0x018b('0x9'));var _=require('lodash');var squel=require(_0x018b('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x018b('0xb'));var toCsv=require(_0x018b('0xc'));var querystring=require('querystring');var Papa=require(_0x018b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x018b('0xe'));var as=require(_0x018b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x018b('0x10'));var utils=require(_0x018b('0x11'));var config=require(_0x018b('0x12'));var licenseUtil=require(_0x018b('0x13'));var db=require(_0x018b('0x14'))['db'];config[_0x018b('0x15')]=_[_0x018b('0x16')](config['redis'],{'host':_0x018b('0x17'),'port':0x18eb});var socket=require(_0x018b('0x18'))(new Redis(config[_0x018b('0x15')]));require(_0x018b('0x19'))['register'](socket);function respondWithStatusCode(_0x3c9035,_0x4e38fc){_0x4e38fc=_0x4e38fc||0xcc;return function(_0x52debe){if(_0x52debe){return _0x3c9035[_0x018b('0x1a')](_0x4e38fc);}return _0x3c9035['status'](_0x4e38fc)[_0x018b('0x1b')]();};}function respondWithResult(_0x23d7ae,_0x1f3b6c){_0x1f3b6c=_0x1f3b6c||0xc8;return function(_0x4072d5){if(_0x4072d5){return _0x23d7ae[_0x018b('0x1c')](_0x1f3b6c)[_0x018b('0x1d')](_0x4072d5);}};}function respondWithFilteredResult(_0x3a6c89,_0x370b90){return function(_0x4227ff){if(_0x4227ff){var _0x1ddaba=_0x4227ff[_0x018b('0x1e')],_0x27dc09=_0x370b90['offset'],_0x18e5ee=_0x370b90[_0x018b('0x1f')]+_0x370b90[_0x018b('0x20')],_0x3c6fb5;if(_0x18e5ee>=_0x1ddaba){_0x18e5ee=_0x1ddaba;_0x3c6fb5=0xc8;}else{_0x3c6fb5=0xce;}_0x3a6c89['status'](_0x3c6fb5);return _0x3a6c89[_0x018b('0x21')](_0x018b('0x22'),_0x27dc09+'-'+_0x18e5ee+'/'+_0x1ddaba)['json'](_0x4227ff);}return null;};}function patchUpdates(_0x34dede){return function(_0x1b38f2){try{jsonpatch[_0x018b('0x23')](_0x1b38f2,_0x34dede,!![]);}catch(_0x1d878a){return BPromise[_0x018b('0x24')](_0x1d878a);}return _0x1b38f2[_0x018b('0x25')]();};}function saveUpdates(_0x4817ec,_0x2723aa){return function(_0x38252e){if(_0x38252e){return _0x38252e[_0x018b('0x26')](_0x4817ec)[_0x018b('0x27')](function(_0x718f68){return _0x718f68;});}return null;};}function removeEntity(_0x412ec3,_0x3f5793){return function(_0x21070f){if(_0x21070f){return _0x21070f[_0x018b('0x28')]()[_0x018b('0x27')](function(){_0x412ec3[_0x018b('0x1c')](0xcc)[_0x018b('0x1b')]();});}};}function handleEntityNotFound(_0x1a61da,_0x3c70a4){return function(_0x3d800){if(!_0x3d800){_0x1a61da[_0x018b('0x1a')](0x194);}return _0x3d800;};}function handleError(_0x5d8402,_0x3ee94e){_0x3ee94e=_0x3ee94e||0x1f4;return function(_0x163836){logger['error'](_0x163836[_0x018b('0x29')]);if(_0x163836[_0x018b('0x2a')]){delete _0x163836['name'];}_0x5d8402[_0x018b('0x1c')](_0x3ee94e)['send'](_0x163836);};}function getInteractionUsers(_0x3d3ffb,_0x58eab1){return new BPromise(function(_0x5e639a,_0x472cc9){try{if(_0x58eab1[_0x3d3ffb['id']]){_0x3d3ffb[_0x018b('0x2b')]=_[_0x018b('0x2c')](_0x58eab1[_0x3d3ffb['id']],function(_0xf07ef4){return{'id':_0xf07ef4['id'],'fullname':_0xf07ef4['fullname']};});}}catch(_0x40d0a1){_0x472cc9(_0x40d0a1);}_0x5e639a(_0x3d3ffb);});}function getInteractionTags(_0x56dbae,_0x568e11){return new BPromise(function(_0x4af697,_0x109275){try{if(_0x56dbae[_0x018b('0x2d')]){_0x56dbae[_0x018b('0x2e')]=[];_0x56dbae['TagIds'][_0x018b('0x2f')](',')[_0x018b('0x30')](function(_0x5203d8){_0x56dbae[_0x018b('0x2e')][_0x018b('0x31')](_0x568e11[_0x5203d8]);});}delete _0x56dbae['TagIds'];}catch(_0x36160b){_0x109275(_0x36160b);}_0x4af697(_0x56dbae);});}function updateFaxInteraction(_0x51ddb2,_0x3f8973,_0x4d0538){return new BPromise(function(_0x5b63e4,_0x3d2dcd){return getInteractionUsers(_0x51ddb2,_0x4d0538)[_0x018b('0x27')](function(_0x57473d){return getInteractionTags(_0x57473d,_0x3f8973);})[_0x018b('0x27')](function(_0x49b9b8){_0x5b63e4(_0x49b9b8);})[_0x018b('0x32')](function(_0x38da44){_0x3d2dcd(_0x38da44);});});}exports[_0x018b('0x33')]=function(_0x59efbe,_0x1b94dc){var _0x390be2={},_0x20e53f={},_0x123a7b={'count':0x0,'rows':[]};var _0x3acb05=_[_0x018b('0x2c')](db['FaxInteraction'][_0x018b('0x34')],function(_0x4c8228){return{'name':_0x4c8228['fieldName'],'type':_0x4c8228[_0x018b('0x35')]['key']};});_0x20e53f[_0x018b('0x36')]=_[_0x018b('0x2c')](_0x3acb05,'name');_0x20e53f[_0x018b('0x37')]=_[_0x018b('0x38')](_0x59efbe['query']);_0x20e53f[_0x018b('0x39')]=_['intersection'](_0x20e53f[_0x018b('0x36')],_0x20e53f['query']);_0x390be2[_0x018b('0x3a')]=_['intersection'](_0x20e53f[_0x018b('0x36')],qs[_0x018b('0x3b')](_0x59efbe[_0x018b('0x37')][_0x018b('0x3b')]));_0x390be2[_0x018b('0x3a')]=_0x390be2[_0x018b('0x3a')][_0x018b('0x3c')]?_0x390be2['attributes']:_0x20e53f[_0x018b('0x36')];if(!_0x59efbe['query'][_0x018b('0x3d')]('nolimit')){_0x390be2[_0x018b('0x20')]=qs[_0x018b('0x20')](_0x59efbe[_0x018b('0x37')][_0x018b('0x20')]);_0x390be2[_0x018b('0x1f')]=qs[_0x018b('0x1f')](_0x59efbe[_0x018b('0x37')][_0x018b('0x1f')]);}_0x390be2[_0x018b('0x3e')]=qs[_0x018b('0x3f')](_0x59efbe[_0x018b('0x37')]['sort']);_0x390be2[_0x018b('0x40')]=qs[_0x018b('0x39')](_['pick'](_0x59efbe[_0x018b('0x37')],_0x20e53f[_0x018b('0x39')]),_0x3acb05);var _0x315f60=[];var _0x22cf5b=squel['select']()[_0x018b('0x41')]('id')['field'](_0x018b('0x2a'))['field']('color')[_0x018b('0x42')]('tools_tags');var _0x4fb13a=squel[_0x018b('0x43')]()['field'](_0x018b('0x44'))[_0x018b('0x41')](_0x018b('0x45'))[_0x018b('0x41')](_0x018b('0x46'))[_0x018b('0x42')](_0x018b('0x47'),'ui')[_0x018b('0x48')](_0x018b('0x49'),'u',_0x018b('0x4a'));var _0x5767db=squel[_0x018b('0x43')]()[_0x018b('0x42')](_0x018b('0x4b'),'i')[_0x018b('0x48')](_0x018b('0x4c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x018b('0x49'),'o',_0x018b('0x4d'))['left_join'](_0x018b('0x4e'),'a',_0x018b('0x4f'))['left_join']('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')['left_join'](_0x018b('0x50'),'it',_0x018b('0x51'))[_0x018b('0x48')](_0x018b('0x52'),'t',_0x018b('0x53'));var _0x16cd57=squel['expr']();var _0x2610b1=[];var _0x41f5da=squel[_0x018b('0x54')]();var _0x3b8ca1;if(_0x59efbe[_0x018b('0x37')][_0x018b('0x55')]){_0x3b8ca1=as[_0x018b('0x56')](_0x59efbe[_0x018b('0x37')][_0x018b('0x55')]);var _0x57875a=_0x3b8ca1[_0x018b('0x57')];for(var _0x40a0bd=0x0;_0x40a0bd<_0x3b8ca1[_0x018b('0x58')]['length'];_0x40a0bd++){var _0x14c298=_0x3b8ca1[_0x018b('0x58')][_0x40a0bd];var _0x1c840c='i';var _0x93b878=_['find'](_0x3acb05,[_0x018b('0x2a'),_0x14c298[_0x018b('0x41')]]);if(!_0x93b878){switch(_0x14c298[_0x018b('0x41')]){case _0x018b('0x59'):if(_0x14c298[_0x018b('0x5a')]==0x1){_0x5767db['having']('`'+_0x14c298[_0x018b('0x41')]+_0x018b('0x5b'));}else{_0x5767db['having']('`'+_0x14c298['field']+'`\x20>\x200');}break;case'Contact':if(_0x14c298[_0x018b('0x5c')]===_0x018b('0x5d')){if(_0x14c298[_0x018b('0x5a')][_0x018b('0x2f')]('\x20')[_0x018b('0x3c')]>0x1){_0x16cd57[_0x57875a](_0x018b('0x5e'),qs[_0x018b('0x5f')](_0x14c298['value']),null);}else{var _0x383df2='%'+_0x14c298['value']+'%';_0x16cd57[_0x57875a](_0x018b('0x60'),_0x383df2,_0x383df2,_0x383df2);}}else{_0x93b878=_[_0x018b('0x61')](_0x3acb05,['name','ContactId']);_0x14c298[_0x018b('0x41')]=_0x018b('0x62');_0x1bd0ae=as[_0x018b('0x63')](_0x1c840c,_0x93b878[_0x018b('0x35')],_0x14c298);_0x16cd57[_0x57875a](_0x1bd0ae[_0x018b('0x64')],_0x1bd0ae[_0x018b('0x5a')]['start'],_0x1bd0ae[_0x018b('0x5a')][_0x018b('0x1b')]);}break;case'Tag':var _0x341df3=_0x14c298[_0x018b('0x5a')][_0x018b('0x2f')](',')['map'](function(_0x3467e6){return Number(_0x3467e6);});_0x341df3[_0x018b('0x30')](function(_0x2c7dbf){_0x41f5da['or'](_0x018b('0x65'),'%,'+_0x2c7dbf+',%');});_0x2610b1=_['union'](_0x2610b1,_0x341df3);break;case _0x018b('0x66'):if(_0x14c298[_0x018b('0x5c')]===_0x018b('0x5d')){_0x16cd57[_0x57875a](_0x018b('0x67'),'%'+_0x14c298['value']+'%',null);}else{_0x93b878=_[_0x018b('0x61')](_0x3acb05,[_0x018b('0x2a'),_0x018b('0x68')]);_0x14c298['field']=_0x018b('0x68');_0x1bd0ae=as[_0x018b('0x63')](_0x1c840c,_0x93b878[_0x018b('0x35')],_0x14c298);_0x16cd57[_0x57875a](_0x1bd0ae[_0x018b('0x64')],_0x1bd0ae['value'][_0x018b('0x69')],_0x1bd0ae['value']['end']);}break;case _0x018b('0x6a'):_0x1bd0ae=as[_0x018b('0x63')]('me',null,_0x14c298);_0x16cd57[_0x57875a](_0x1bd0ae[_0x018b('0x64')],_0x1bd0ae[_0x018b('0x5a')]['start'],_0x1bd0ae[_0x018b('0x5a')][_0x018b('0x1b')]);break;}}else{var _0x1bd0ae=as[_0x018b('0x63')](_0x1c840c,_0x93b878[_0x018b('0x35')],_0x14c298);_0x16cd57[_0x57875a](_0x1bd0ae[_0x018b('0x64')],_0x1bd0ae[_0x018b('0x5a')][_0x018b('0x69')],_0x1bd0ae[_0x018b('0x5a')]['end']);}}}else{var _0x3a9eda=_(_0x59efbe['query'])[_0x018b('0x38')]()['map'](function(_0x183070){return _[_0x018b('0x6b')](_0x3acb05,[_0x018b('0x2a'),_0x183070])?_0x183070:undefined;})[_0x018b('0x6c')]()[_0x018b('0x5a')]();if(!_[_0x018b('0x6d')](_0x3a9eda)){_0x3a9eda[_0x018b('0x30')](function(_0x10dc4b){if(_0x10dc4b==='FaxAccountId'){_0x5767db[_0x018b('0x40')](_0x018b('0x6e'),[][_0x018b('0x6f')](_0x59efbe[_0x018b('0x37')][_0x10dc4b]));}else if(_0x10dc4b===_0x018b('0x70')){var _0x5ca241=JSON[_0x018b('0x71')](_0x59efbe[_0x018b('0x37')][_0x10dc4b])[_0x018b('0x72')];var _0xc48f7b=JSON[_0x018b('0x71')](_0x59efbe[_0x018b('0x37')][_0x10dc4b])['$lte'];_0x5767db['where'](_0x018b('0x73'),_0x5ca241,_0xc48f7b);}else{if(_0x59efbe[_0x018b('0x37')][_0x10dc4b]===_0x018b('0x74')){_0x5767db[_0x018b('0x40')]('i.'+_0x10dc4b+_0x018b('0x75'));}else{_0x5767db['where']('i.'+_0x10dc4b+_0x018b('0x76'),_0x59efbe['query'][_0x10dc4b]);}}});}if(_0x59efbe[_0x018b('0x37')][_0x018b('0x77')]){if(_0x59efbe[_0x018b('0x37')][_0x018b('0x77')]==0x1){_0x5767db['having']('`unreadMessages`\x20=\x200');}else{_0x5767db[_0x018b('0x78')](_0x018b('0x79'));}}if(_0x59efbe[_0x018b('0x37')][_0x018b('0x7a')]){_0x2610b1=_[_0x018b('0x7b')](_0x59efbe[_0x018b('0x37')][_0x018b('0x7a')])?_0x59efbe['query'][_0x018b('0x7a')]:new Array(_0x59efbe[_0x018b('0x37')][_0x018b('0x7a')]);_0x2610b1[_0x018b('0x30')](function(_0x5cb264){_0x41f5da['or'](_0x018b('0x65'),'%,'+_0x5cb264+',%');});}if(_0x59efbe[_0x018b('0x37')][_0x018b('0x7c')]){var _0x336522=_0x59efbe[_0x018b('0x37')][_0x018b('0x7c')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x336522)){_0x16cd57['or'](_0x018b('0x7d'),_0x336522+'%')['or'](_0x018b('0x7e'),_0x336522+'%');}_0x16cd57['or'](_0x018b('0x7f'),_0x336522+'%');}}_0x5767db[_0x018b('0x40')](_0x16cd57);_0x5767db['group'](_0x018b('0x80'));var _0x2e3193={'type':db['Sequelize'][_0x018b('0x81')][_0x018b('0x82')],'raw':!![]};var _0x4e83c2=_0x5767db['clone']();_0x4e83c2[_0x018b('0x41')](_0x018b('0x80'));_0x4e83c2[_0x018b('0x41')](_0x018b('0x83'),_0x018b('0x59'));if(_0x390be2['order']){_0x390be2[_0x018b('0x3e')][_0x018b('0x30')](function(_0xff4627){var _0x3266fc=_0xff4627[0x0]===_0x018b('0x84')?_0xff4627[0x0]:'i.'+_0xff4627[0x0];_0x5767db[_0x018b('0x3e')](_0x3266fc,_0xff4627[0x1]===_0x018b('0x85')?![]:!![]);});}if(!_[_0x018b('0x6d')](_0x2610b1)){_0x5767db[_0x018b('0x78')](_0x41f5da);_0x4e83c2[_0x018b('0x40')](_0x018b('0x86'),_0x2610b1);}BPromise[_0x018b('0x87')]()[_0x018b('0x27')](function(){if(!_0x3b8ca1){if(_0x59efbe['query'][_0x018b('0x88')])return;_0x4e83c2[_0x018b('0x40')](_0x018b('0x89'));_0x5767db[_0x018b('0x40')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x59efbe[_0x018b('0x8a')][_0x018b('0x8b')]!==_0x018b('0x8c'))return;return _0x59efbe['user'][_0x018b('0x8d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x12ca8e){if(_[_0x018b('0x6d')](_0x12ca8e)){_0x4e83c2[_0x018b('0x40')](_0x018b('0x8e'));_0x5767db[_0x018b('0x40')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x4e83c2['where'](_0x018b('0x6e'),_[_0x018b('0x2c')](_0x12ca8e,'id'));_0x5767db[_0x018b('0x40')](_0x018b('0x6e'),_['map'](_0x12ca8e,'id'));}});})[_0x018b('0x27')](function(){if(_0x59efbe[_0x018b('0x8a')][_0x018b('0x8b')]==='agent'&&!_0x3b8ca1&&!_0x59efbe[_0x018b('0x37')][_0x018b('0x88')])return[];return db['sequelize']['query'](_0x4e83c2[_0x018b('0x8f')](),_0x2e3193);})[_0x018b('0x27')](function(_0x19642e){_0x123a7b[_0x018b('0x1e')]=_0x19642e[_0x018b('0x3c')];if(_0x123a7b['count']===0x0)return[];return db[_0x018b('0x90')][_0x018b('0x37')](_0x22cf5b[_0x018b('0x8f')](),_0x2e3193)[_0x018b('0x27')](function(_0x12b7ee){_0x315f60=_['keyBy'](_0x12b7ee,'id');_0x2e3193=_['merge'](_0x2e3193,{'model':db[_0x018b('0x91')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x59efbe[_0x018b('0x37')][_0x018b('0x3b')]){_0x390be2[_0x018b('0x3a')]['forEach'](function(_0x38aedd){_0x5767db[_0x018b('0x41')]('i.'+_0x38aedd);});}else{_0x5767db[_0x018b('0x41')](_0x018b('0x83'),_0x018b('0x59'));_0x5767db['field'](_0x018b('0x92'),_0x018b('0x93'));_0x5767db[_0x018b('0x41')](_0x018b('0x94'),_0x018b('0x95'));_0x5767db[_0x018b('0x41')]('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',_0x018b('0x84'));_0x5767db[_0x018b('0x41')]('i.*');_0x5767db[_0x018b('0x41')]('c.firstName',_0x018b('0x96'));_0x5767db['field']('c.lastName','Contact.lastName');_0x5767db['field'](_0x018b('0x97'),_0x018b('0x98'));_0x5767db['field'](_0x018b('0x99'),'Contact.phone');_0x5767db['field'](_0x018b('0x9a'),_0x018b('0x9b'));_0x5767db[_0x018b('0x41')](_0x018b('0x9c'),_0x018b('0x9d'));_0x5767db[_0x018b('0x41')](_0x018b('0x9e'),_0x018b('0x9f'));_0x5767db[_0x018b('0x41')](_0x018b('0xa0'),_0x018b('0xa1'));_0x5767db['field'](_0x018b('0xa2'),_0x018b('0x2d'));}if(_0x390be2[_0x018b('0x20')])_0x5767db[_0x018b('0x20')](_0x390be2[_0x018b('0x20')]);if(_0x390be2[_0x018b('0x1f')])_0x5767db[_0x018b('0x1f')](_0x390be2[_0x018b('0x1f')]);return db['sequelize'][_0x018b('0x37')](_0x5767db['toString'](),_0x2e3193);})[_0x018b('0x27')](function(_0x428422){_0x4fb13a[_0x018b('0x40')](_0x018b('0xa3'),_[_0x018b('0x2c')](_0x428422,'id'));return db[_0x018b('0x90')][_0x018b('0x37')](_0x4fb13a[_0x018b('0x8f')](),_0x2e3193)[_0x018b('0x27')](function(_0x1ce673){var _0x14c20c=_[_0x018b('0xa4')](_0x1ce673,_0x018b('0xa5'));var _0xccd4fe=[];_0x428422['forEach'](function(_0x5eb7dd){_0xccd4fe[_0x018b('0x31')](updateFaxInteraction(_0x5eb7dd,_0x315f60,_0x14c20c));});return BPromise[_0x018b('0xa6')](_0xccd4fe);});});})[_0x018b('0x27')](function(_0x469ed6){_0x123a7b[_0x018b('0xa7')]=_0x469ed6;return _0x123a7b;})[_0x018b('0x27')](respondWithFilteredResult(_0x1b94dc,_0x390be2))['catch'](handleError(_0x1b94dc,null));};exports[_0x018b('0xa8')]=function(_0x5e34cb,_0x539739){var _0x3c33d8={'raw':![],'where':{'id':_0x5e34cb[_0x018b('0xa9')]['id']}},_0x2464da={};_0x2464da[_0x018b('0x36')]=_[_0x018b('0x38')](db['FaxInteraction'][_0x018b('0x34')]);_0x2464da[_0x018b('0x37')]=_['keys'](_0x5e34cb[_0x018b('0x37')]);_0x2464da['filters']=_[_0x018b('0xaa')](_0x2464da[_0x018b('0x36')],_0x2464da[_0x018b('0x37')]);_0x3c33d8[_0x018b('0x3a')]=_[_0x018b('0xaa')](_0x2464da['model'],qs[_0x018b('0x3b')](_0x5e34cb[_0x018b('0x37')]['fields']));_0x3c33d8[_0x018b('0x3a')]=_0x3c33d8['attributes']['length']?_0x3c33d8[_0x018b('0x3a')]:_0x2464da[_0x018b('0x36')];if(_0x5e34cb[_0x018b('0x37')][_0x018b('0xab')]){_0x3c33d8[_0x018b('0xac')]=[{'all':!![]}];}_0x3c33d8=_[_0x018b('0xad')]({},_0x3c33d8,_0x5e34cb[_0x018b('0xae')]);return db['FaxInteraction'][_0x018b('0x61')](_0x3c33d8)[_0x018b('0x27')](handleEntityNotFound(_0x539739,null))['then'](respondWithResult(_0x539739,null))[_0x018b('0x32')](handleError(_0x539739,null));};exports['create']=function(_0x16e58f,_0x18b717){return db['FaxInteraction'][_0x018b('0xaf')](_0x16e58f[_0x018b('0x6a')],{})['then'](respondWithResult(_0x18b717,0xc9))[_0x018b('0x32')](handleError(_0x18b717,null));};exports[_0x018b('0x26')]=function(_0x2c78cb,_0x31545d){if(_0x2c78cb['body']['id']){delete _0x2c78cb[_0x018b('0x6a')]['id'];}return db[_0x018b('0x91')][_0x018b('0x61')]({'where':{'id':_0x2c78cb[_0x018b('0xa9')]['id']}})[_0x018b('0x27')](handleEntityNotFound(_0x31545d,null))[_0x018b('0x27')](saveUpdates(_0x2c78cb[_0x018b('0x6a')],null))[_0x018b('0x27')](respondWithResult(_0x31545d,null))[_0x018b('0x32')](handleError(_0x31545d,null));};exports[_0x018b('0x28')]=function(_0x32bf1e,_0x49dd7b){return db[_0x018b('0x91')][_0x018b('0x61')]({'where':{'id':_0x32bf1e['params']['id']}})['then'](handleEntityNotFound(_0x49dd7b,null))[_0x018b('0x27')](removeEntity(_0x49dd7b,null))['catch'](handleError(_0x49dd7b,null));};exports[_0x018b('0xb0')]=function(_0x113067,_0x3f96db){return db['FaxInteraction']['describe']()[_0x018b('0x27')](respondWithResult(_0x3f96db,null))[_0x018b('0x32')](handleError(_0x3f96db,null));};exports[_0x018b('0xb1')]=function(_0x10c99b,_0x3575c8,_0x253302){return db[_0x018b('0xb2')][_0x018b('0x61')]({'where':{'id':_0x10c99b[_0x018b('0xa9')]['id']}})[_0x018b('0x27')](handleEntityNotFound(_0x3575c8,null))['then'](function(_0x5126b2){if(_0x5126b2){return _0x5126b2[_0x018b('0xb1')](_0x10c99b[_0x018b('0x6a')]['ids'],_['omit'](_0x10c99b['body'],[_0x018b('0xb3'),'id'])||{});}})[_0x018b('0x27')](respondWithResult(_0x3575c8,null))['catch'](handleError(_0x3575c8,null));};exports['getMessages']=function(_0x46ba3e,_0x1d50a5,_0x472e8c){var _0x4d00d3={'raw':![],'where':{}};var _0x38d110={};var _0x1e4c33={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x018b('0xb4')]({'where':{'id':_0x46ba3e[_0x018b('0xa9')]['id']}})[_0x018b('0x27')](handleEntityNotFound(_0x1d50a5,null))[_0x018b('0x27')](function(_0x565e44){if(_0x565e44){_0x38d110[_0x018b('0x36')]=_[_0x018b('0x38')](db[_0x018b('0xb2')][_0x018b('0x34')]);_0x38d110[_0x018b('0x37')]=_[_0x018b('0x38')](_0x46ba3e['query']);_0x38d110['filters']=_['intersection'](_0x38d110['model'],_0x38d110['query']);_0x4d00d3[_0x018b('0x3a')]=_[_0x018b('0xaa')](_0x38d110[_0x018b('0x36')],qs[_0x018b('0x3b')](_0x46ba3e[_0x018b('0x37')]['fields']));_0x4d00d3[_0x018b('0x3a')]=_0x4d00d3[_0x018b('0x3a')][_0x018b('0x3c')]?_0x4d00d3[_0x018b('0x3a')]:_0x38d110[_0x018b('0x36')];if(!_0x46ba3e[_0x018b('0x37')][_0x018b('0x3d')]('nolimit')){_0x4d00d3['limit']=qs[_0x018b('0x20')](_0x46ba3e[_0x018b('0x37')][_0x018b('0x20')]);_0x4d00d3[_0x018b('0x1f')]=qs[_0x018b('0x1f')](_0x46ba3e[_0x018b('0x37')][_0x018b('0x1f')]);}_0x4d00d3[_0x018b('0x3e')]=qs[_0x018b('0x3f')](_0x46ba3e['query'][_0x018b('0x3f')]);_0x4d00d3['where']=qs['filters'](_[_0x018b('0xb5')](_0x46ba3e[_0x018b('0x37')],_0x38d110[_0x018b('0x39')]));_0x4d00d3[_0x018b('0x40')][_0x018b('0xa5')]=_0x565e44['id'];if(_0x46ba3e[_0x018b('0x37')][_0x018b('0x7c')]){_0x4d00d3['where']=_[_0x018b('0xad')](_0x4d00d3['where'],{'$or':_[_0x018b('0x2c')](_0x4d00d3[_0x018b('0x3a')],function(_0x2a593e){var _0x269a22={};_0x269a22[_0x2a593e]={'$like':'%'+_0x46ba3e[_0x018b('0x37')]['filter']+'%'};return _0x269a22;})});}if(_0x46ba3e[_0x018b('0x37')][_0x018b('0x72')]){var _0x3e3469=_0x46ba3e[_0x018b('0x37')][_0x018b('0x72')][_0x018b('0x2f')](',');var _0x1873c7={};_0x1873c7[_0x3e3469[0x0]]={'$gte':moment(_0x3e3469[0x1])[_0x018b('0xb6')](_0x018b('0xb7'))};_0x4d00d3['where']=_[_0x018b('0xad')](_0x4d00d3[_0x018b('0x40')],_0x1873c7);}_0x4d00d3=_[_0x018b('0xad')]({},_0x4d00d3,_0x46ba3e[_0x018b('0xae')]);return db[_0x018b('0xb2')][_0x018b('0x1e')]({'where':_0x4d00d3['where']})[_0x018b('0x27')](function(_0x3db283){_0x1e4c33[_0x018b('0x1e')]=_0x3db283;if(_0x46ba3e[_0x018b('0x37')][_0x018b('0xab')]){_0x4d00d3[_0x018b('0xac')]=[{'all':!![]}];}return db[_0x018b('0xb2')][_0x018b('0xb8')](_0x4d00d3);})['then'](function(_0x4fdbd8){_0x1e4c33[_0x018b('0xa7')]=_0x4fdbd8;return _0x1e4c33;});}})[_0x018b('0x27')](respondWithFilteredResult(_0x1d50a5,_0x4d00d3))[_0x018b('0x32')](handleError(_0x1d50a5,null));};exports['addTags']=function(_0x10e467,_0x5acb02,_0x162751){return db[_0x018b('0x91')][_0x018b('0x61')]({'where':{'id':_0x10e467[_0x018b('0xa9')]['id']}})[_0x018b('0x27')](handleEntityNotFound(_0x5acb02,null))[_0x018b('0x27')](function(_0x18860e){if(_0x18860e){return _0x18860e[_0x018b('0xb9')](_0x10e467['body'][_0x018b('0xb3')],_[_0x018b('0xba')](_0x10e467[_0x018b('0x6a')],[_0x018b('0xb3'),'id'])||{})[_0x018b('0xbb')](function(){return db[_0x018b('0xbc')][_0x018b('0xb8')]({'attributes':['id',_0x018b('0x2a'),_0x018b('0xbd')],'where':{'id':_0x10e467[_0x018b('0x6a')]['ids']}});})[_0x018b('0x27')](function(_0x53ad62){socket[_0x018b('0xbe')](_0x018b('0xbf'),{'id':Number(_0x10e467[_0x018b('0xa9')]['id']),'tags':_0x53ad62||[]});return{'id':Number(_0x10e467['params']['id']),'tags':_0x53ad62||[]};});}})[_0x018b('0x27')](respondWithResult(_0x5acb02,null))['catch'](handleError(_0x5acb02,null));};exports['removeTags']=function(_0x264308,_0x3a4d67,_0x38e862){return db[_0x018b('0x91')][_0x018b('0x61')]({'where':{'id':_0x264308['params']['id']}})[_0x018b('0x27')](handleEntityNotFound(_0x3a4d67,null))[_0x018b('0x27')](function(_0x48afd4){if(_0x48afd4){return _0x48afd4[_0x018b('0xc0')](_0x264308[_0x018b('0x37')][_0x018b('0xb3')]);}})['then'](respondWithStatusCode(_0x3a4d67,null))[_0x018b('0x32')](handleError(_0x3a4d67,null));};exports['download']=function(_0x22d8e2,_0x383563){var _0xca4b24=moment()[_0x018b('0xc1')]()[_0x018b('0x8f')]();var _0xaefd4f=path[_0x018b('0xc2')](config['root'],_0x018b('0xc3'),'files','tmp');var _0x119beb=path['join'](config[_0x018b('0xc4')],'server',_0x018b('0xc5'),_0x018b('0xc6'));var _0x339a11=path[_0x018b('0xc2')](_0xaefd4f,_0xca4b24);var _0xa7f40f=util['format']('transcript-%d-%s.zip',_0x22d8e2[_0x018b('0xa9')]['id'],_0xca4b24);var _0x1d4b53=path[_0x018b('0xc2')](_0xaefd4f,_0xa7f40f);var _0x3e7c5b=[];_0x3e7c5b[_0x018b('0x31')]({'model':db[_0x018b('0xc7')],'as':_0x018b('0xc7'),'raw':!![]});var _0x69d469=[{'model':db[_0x018b('0xb2')],'as':_0x018b('0xc8'),'attributes':['id','body',_0x018b('0x70')],'include':_0x3e7c5b}];return db['FaxInteraction'][_0x018b('0x61')]({'where':{'id':_0x22d8e2[_0x018b('0xa9')]['id']},'include':_0x69d469})['then'](handleEntityNotFound(_0x383563,null))[_0x018b('0x27')](function(_0x58b072){if(_0x58b072&&_0x58b072['Messages']){var _0x26a612=_0x58b072[_0x018b('0xc9')]({'plain':!![]});fs['mkdirSync'](_0x339a11);for(var _0x550547=0x0;_0x550547<_0x26a612[_0x018b('0xc8')]['length'];_0x550547++){var _0x11e98b=_0x26a612[_0x018b('0xc8')][_0x550547][_0x018b('0xc7')];if(_0x11e98b){var _0x3f89cd=path[_0x018b('0xc2')](_0x119beb,_0x11e98b[_0x018b('0xca')]);if(fs[_0x018b('0xcb')](_0x3f89cd)){fs[_0x018b('0xcc')](_0x3f89cd)[_0x018b('0xcd')](fs[_0x018b('0xce')](path['join'](_0x339a11,_0x11e98b[_0x018b('0xca')])));}}}return BPromise[_0x018b('0x87')]()[_0x018b('0x27')](function(){return new BPromise(function(_0x4a32ea,_0x2c8c7b){zipdir(_0x339a11,{'saveTo':_0x1d4b53},function(_0x305588,_0x6051a){if(_0x305588)return _0x2c8c7b(_0x305588);return _0x4a32ea(_0x6051a);});})[_0x018b('0x27')](function(){return new BPromise(function(_0x258fd5,_0x487a4a){rimraf(_0x339a11,function(_0x1c4231){if(_0x1c4231)_0x487a4a(_0x1c4231);return _0x258fd5();});});})[_0x018b('0x27')](function(){return _0x383563[_0x018b('0xcf')](_0x1d4b53,_0xa7f40f,function(_0x507dc9){if(_0x507dc9){console[_0x018b('0xd0')](_0x018b('0xd1'),_0x507dc9);}else{fs[_0x018b('0xd2')](_0x1d4b53);}});});});}else{return _0x383563[_0x018b('0x1a')](0xc8);}})[_0x018b('0x32')](handleError(_0x383563,null));}; \ No newline at end of file +var _0xcfc8=['isArray','tag','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','params','FaxInteraction','includeAll','include','options','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findAll','addTags','spread','Tag','emit','removeTags','download','unix','root','server','files','tmp','join','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','catch','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','$substring','UserId','start','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','where','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200'];(function(_0x4d76ec,_0x3927b4){var _0x448b7a=function(_0x11ddb5){while(--_0x11ddb5){_0x4d76ec['push'](_0x4d76ec['shift']());}};_0x448b7a(++_0x3927b4);}(_0xcfc8,0x12d));var _0x8cfc=function(_0x125a30,_0x456104){_0x125a30=_0x125a30-0x0;var _0x34cf02=_0xcfc8[_0x125a30];return _0x34cf02;};'use strict';var emlformat=require(_0x8cfc('0x0'));var rimraf=require(_0x8cfc('0x1'));var zipdir=require(_0x8cfc('0x2'));var jsonpatch=require(_0x8cfc('0x3'));var rp=require(_0x8cfc('0x4'));var moment=require(_0x8cfc('0x5'));var BPromise=require(_0x8cfc('0x6'));var Mustache=require(_0x8cfc('0x7'));var util=require(_0x8cfc('0x8'));var path=require(_0x8cfc('0x9'));var sox=require(_0x8cfc('0xa'));var csv=require('to-csv');var ejs=require(_0x8cfc('0xb'));var fs=require('fs');var fs_extra=require(_0x8cfc('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8cfc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8cfc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8cfc('0xf'));var Papa=require('papaparse');var Redis=require(_0x8cfc('0x10'));var authService=require(_0x8cfc('0x11'));var qs=require(_0x8cfc('0x12'));var as=require(_0x8cfc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8cfc('0x14'))(_0x8cfc('0x15'));var utils=require(_0x8cfc('0x16'));var config=require(_0x8cfc('0x17'));var licenseUtil=require(_0x8cfc('0x18'));var db=require(_0x8cfc('0x19'))['db'];config[_0x8cfc('0x1a')]=_[_0x8cfc('0x1b')](config[_0x8cfc('0x1a')],{'host':_0x8cfc('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8cfc('0x1a')]));require('./faxInteraction.socket')[_0x8cfc('0x1d')](socket);function respondWithStatusCode(_0x5875e9,_0x5d3ba9){_0x5d3ba9=_0x5d3ba9||0xcc;return function(_0x7dd5fd){if(_0x7dd5fd){return _0x5875e9['sendStatus'](_0x5d3ba9);}return _0x5875e9[_0x8cfc('0x1e')](_0x5d3ba9)[_0x8cfc('0x1f')]();};}function respondWithResult(_0x451eaa,_0x4555af){_0x4555af=_0x4555af||0xc8;return function(_0x232627){if(_0x232627){return _0x451eaa['status'](_0x4555af)[_0x8cfc('0x20')](_0x232627);}};}function respondWithFilteredResult(_0x11e91e,_0x5c48c6){return function(_0x1bfa05){if(_0x1bfa05){var _0x20c09c=_0x1bfa05[_0x8cfc('0x21')],_0xf1eca4=_0x5c48c6[_0x8cfc('0x22')],_0x3c07c0=_0x5c48c6[_0x8cfc('0x22')]+_0x5c48c6['limit'],_0x4f42e4;if(_0x3c07c0>=_0x20c09c){_0x3c07c0=_0x20c09c;_0x4f42e4=0xc8;}else{_0x4f42e4=0xce;}_0x11e91e[_0x8cfc('0x1e')](_0x4f42e4);return _0x11e91e[_0x8cfc('0x23')](_0x8cfc('0x24'),_0xf1eca4+'-'+_0x3c07c0+'/'+_0x20c09c)['json'](_0x1bfa05);}return null;};}function patchUpdates(_0xa70f54){return function(_0x2d8c9c){try{jsonpatch[_0x8cfc('0x25')](_0x2d8c9c,_0xa70f54,!![]);}catch(_0x430a6f){return BPromise[_0x8cfc('0x26')](_0x430a6f);}return _0x2d8c9c[_0x8cfc('0x27')]();};}function saveUpdates(_0x5bd13,_0x529021){return function(_0x304000){if(_0x304000){return _0x304000[_0x8cfc('0x28')](_0x5bd13)[_0x8cfc('0x29')](function(_0x4816b2){return _0x4816b2;});}return null;};}function removeEntity(_0x37d4a5,_0x5680b9){return function(_0x1f3c33){if(_0x1f3c33){return _0x1f3c33[_0x8cfc('0x2a')]()[_0x8cfc('0x29')](function(){_0x37d4a5[_0x8cfc('0x1e')](0xcc)[_0x8cfc('0x1f')]();});}};}function handleEntityNotFound(_0x1af8eb,_0x3bd646){return function(_0x1a9f80){if(!_0x1a9f80){_0x1af8eb[_0x8cfc('0x2b')](0x194);}return _0x1a9f80;};}function handleError(_0x41377a,_0xc0e36e){_0xc0e36e=_0xc0e36e||0x1f4;return function(_0x414848){logger['error'](_0x414848[_0x8cfc('0x2c')]);if(_0x414848[_0x8cfc('0x2d')]){delete _0x414848[_0x8cfc('0x2d')];}_0x41377a[_0x8cfc('0x1e')](_0xc0e36e)[_0x8cfc('0x2e')](_0x414848);};}function getInteractionUsers(_0x541681,_0x2cb771){return new BPromise(function(_0x31bada,_0x22e5e2){try{if(_0x2cb771[_0x541681['id']]){_0x541681[_0x8cfc('0x2f')]=_[_0x8cfc('0x30')](_0x2cb771[_0x541681['id']],function(_0x1622dd){return{'id':_0x1622dd['id'],'fullname':_0x1622dd[_0x8cfc('0x31')]};});}}catch(_0x360f63){_0x22e5e2(_0x360f63);}_0x31bada(_0x541681);});}function getInteractionTags(_0x2f63ae,_0x2de770){return new BPromise(function(_0x4b2d66,_0x4236f4){try{if(_0x2f63ae[_0x8cfc('0x32')]){_0x2f63ae[_0x8cfc('0x33')]=[];_0x2f63ae[_0x8cfc('0x32')]['split'](',')[_0x8cfc('0x34')](function(_0x338f4d){_0x2f63ae[_0x8cfc('0x33')][_0x8cfc('0x35')](_0x2de770[_0x338f4d]);});}delete _0x2f63ae['TagIds'];}catch(_0x38fb7b){_0x4236f4(_0x38fb7b);}_0x4b2d66(_0x2f63ae);});}function updateFaxInteraction(_0x4b8bec,_0x59c2b1,_0x4efa20){return new BPromise(function(_0x9e9c31,_0xbe83bc){return getInteractionUsers(_0x4b8bec,_0x4efa20)[_0x8cfc('0x29')](function(_0x8b44c4){return getInteractionTags(_0x8b44c4,_0x59c2b1);})[_0x8cfc('0x29')](function(_0x57525a){_0x9e9c31(_0x57525a);})[_0x8cfc('0x36')](function(_0x94ebce){_0xbe83bc(_0x94ebce);});});}exports[_0x8cfc('0x37')]=function(_0x83e413,_0x54324d){var _0x4e0c9a={},_0x44b4c4={},_0x26e739={'count':0x0,'rows':[]};var _0x4ac696=_['map'](db['FaxInteraction'][_0x8cfc('0x38')],function(_0x5414c2){return{'name':_0x5414c2[_0x8cfc('0x39')],'type':_0x5414c2[_0x8cfc('0x3a')]['key']};});_0x44b4c4[_0x8cfc('0x3b')]=_[_0x8cfc('0x30')](_0x4ac696,_0x8cfc('0x2d'));_0x44b4c4[_0x8cfc('0x3c')]=_[_0x8cfc('0x3d')](_0x83e413['query']);_0x44b4c4[_0x8cfc('0x3e')]=_[_0x8cfc('0x3f')](_0x44b4c4[_0x8cfc('0x3b')],_0x44b4c4[_0x8cfc('0x3c')]);_0x4e0c9a[_0x8cfc('0x40')]=_[_0x8cfc('0x3f')](_0x44b4c4['model'],qs[_0x8cfc('0x41')](_0x83e413[_0x8cfc('0x3c')][_0x8cfc('0x41')]));_0x4e0c9a[_0x8cfc('0x40')]=_0x4e0c9a['attributes']['length']?_0x4e0c9a[_0x8cfc('0x40')]:_0x44b4c4[_0x8cfc('0x3b')];if(!_0x83e413['query'][_0x8cfc('0x42')](_0x8cfc('0x43'))){_0x4e0c9a[_0x8cfc('0x44')]=qs['limit'](_0x83e413[_0x8cfc('0x3c')][_0x8cfc('0x44')]);_0x4e0c9a[_0x8cfc('0x22')]=qs[_0x8cfc('0x22')](_0x83e413[_0x8cfc('0x3c')]['offset']);}_0x4e0c9a[_0x8cfc('0x45')]=qs[_0x8cfc('0x46')](_0x83e413['query'][_0x8cfc('0x46')]);_0x4e0c9a['where']=qs[_0x8cfc('0x3e')](_[_0x8cfc('0x47')](_0x83e413[_0x8cfc('0x3c')],_0x44b4c4['filters']),_0x4ac696);var _0x155945=[];var _0x4074b7=squel[_0x8cfc('0x48')]()['field']('id')['field'](_0x8cfc('0x2d'))[_0x8cfc('0x49')](_0x8cfc('0x4a'))[_0x8cfc('0x4b')](_0x8cfc('0x4c'));var _0x1c79c8=squel['select']()[_0x8cfc('0x49')](_0x8cfc('0x4d'))[_0x8cfc('0x49')](_0x8cfc('0x4e'))[_0x8cfc('0x49')](_0x8cfc('0x4f'))[_0x8cfc('0x4b')]('user_has_fax_interactions','ui')[_0x8cfc('0x50')]('users','u','u.id\x20=\x20ui.UserId');var _0x444bf1=squel['select']()[_0x8cfc('0x4b')]('fax_interactions','i')[_0x8cfc('0x50')](_0x8cfc('0x51'),'c',_0x8cfc('0x52'))[_0x8cfc('0x50')]('users','o','o.id\x20=\x20i.UserId')[_0x8cfc('0x50')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0x8cfc('0x53'),'me',_0x8cfc('0x54'))[_0x8cfc('0x50')](_0x8cfc('0x55'),'it',_0x8cfc('0x56'))['left_join'](_0x8cfc('0x4c'),'t',_0x8cfc('0x57'));var _0x58c262=squel[_0x8cfc('0x58')]();var _0x17e130=[];var _0x3255b3=squel[_0x8cfc('0x58')]();var _0x25d430;if(_0x83e413[_0x8cfc('0x3c')][_0x8cfc('0x59')]){_0x25d430=as[_0x8cfc('0x5a')](_0x83e413[_0x8cfc('0x3c')][_0x8cfc('0x59')]);var _0x2cae6c=_0x25d430[_0x8cfc('0x5b')];for(var _0x15d0ba=0x0;_0x15d0ba<_0x25d430[_0x8cfc('0x5c')][_0x8cfc('0x5d')];_0x15d0ba++){var _0x50a16c=_0x25d430[_0x8cfc('0x5c')][_0x15d0ba];var _0x197371='i';var _0x120e8a=_[_0x8cfc('0x5e')](_0x4ac696,[_0x8cfc('0x2d'),_0x50a16c[_0x8cfc('0x49')]]);if(!_0x120e8a){switch(_0x50a16c[_0x8cfc('0x49')]){case _0x8cfc('0x5f'):if(_0x50a16c[_0x8cfc('0x60')]==0x1){_0x444bf1[_0x8cfc('0x61')]('`'+_0x50a16c[_0x8cfc('0x49')]+_0x8cfc('0x62'));}else{_0x444bf1[_0x8cfc('0x61')]('`'+_0x50a16c[_0x8cfc('0x49')]+_0x8cfc('0x63'));}break;case'Contact':if(_0x50a16c['operator']==='$substring'){if(_0x50a16c['value'][_0x8cfc('0x64')]('\x20')[_0x8cfc('0x5d')]>0x1){_0x58c262[_0x2cae6c](_0x8cfc('0x65'),qs[_0x8cfc('0x66')](_0x50a16c['value']),null);}else{var _0x1d81be='%'+_0x50a16c[_0x8cfc('0x60')]+'%';_0x58c262[_0x2cae6c](_0x8cfc('0x67'),_0x1d81be,_0x1d81be,_0x1d81be);}}else{_0x120e8a=_[_0x8cfc('0x5e')](_0x4ac696,[_0x8cfc('0x2d'),_0x8cfc('0x68')]);_0x50a16c[_0x8cfc('0x49')]='ContactId';_0xc9e214=as[_0x8cfc('0x69')](_0x197371,_0x120e8a[_0x8cfc('0x3a')],_0x50a16c);_0x58c262[_0x2cae6c](_0xc9e214[_0x8cfc('0x6a')],_0xc9e214[_0x8cfc('0x60')]['start'],_0xc9e214['value'][_0x8cfc('0x1f')]);}break;case'Tag':var _0x1e1ce8=_0x50a16c[_0x8cfc('0x60')][_0x8cfc('0x64')](',')[_0x8cfc('0x30')](function(_0x539c21){return Number(_0x539c21);});_0x1e1ce8['forEach'](function(_0x184575){_0x3255b3['or'](_0x8cfc('0x6b'),'%,'+_0x184575+',%');});_0x17e130=_['union'](_0x17e130,_0x1e1ce8);break;case _0x8cfc('0x6c'):if(_0x50a16c[_0x8cfc('0x6d')]===_0x8cfc('0x6e')){_0x58c262[_0x2cae6c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x50a16c['value']+'%',null);}else{_0x120e8a=_['find'](_0x4ac696,[_0x8cfc('0x2d'),_0x8cfc('0x6f')]);_0x50a16c['field']=_0x8cfc('0x6f');_0xc9e214=as[_0x8cfc('0x69')](_0x197371,_0x120e8a[_0x8cfc('0x3a')],_0x50a16c);_0x58c262[_0x2cae6c](_0xc9e214[_0x8cfc('0x6a')],_0xc9e214[_0x8cfc('0x60')][_0x8cfc('0x70')],_0xc9e214[_0x8cfc('0x60')]['end']);}break;case'body':_0xc9e214=as['buildExpression']('me',null,_0x50a16c);_0x58c262[_0x2cae6c](_0xc9e214['text'],_0xc9e214[_0x8cfc('0x60')]['start'],_0xc9e214[_0x8cfc('0x60')][_0x8cfc('0x1f')]);break;}}else{var _0xc9e214=as['buildExpression'](_0x197371,_0x120e8a[_0x8cfc('0x3a')],_0x50a16c);_0x58c262[_0x2cae6c](_0xc9e214[_0x8cfc('0x6a')],_0xc9e214[_0x8cfc('0x60')][_0x8cfc('0x70')],_0xc9e214[_0x8cfc('0x60')][_0x8cfc('0x1f')]);}}}else{var _0x103ddd=_(_0x83e413[_0x8cfc('0x3c')])['keys']()[_0x8cfc('0x30')](function(_0x50bcc9){return _[_0x8cfc('0x71')](_0x4ac696,[_0x8cfc('0x2d'),_0x50bcc9])?_0x50bcc9:undefined;})[_0x8cfc('0x72')]()['value']();if(!_[_0x8cfc('0x73')](_0x103ddd)){_0x103ddd['forEach'](function(_0x397fa8){if(_0x397fa8===_0x8cfc('0x74')){_0x444bf1['where'](_0x8cfc('0x75'),[][_0x8cfc('0x76')](_0x83e413[_0x8cfc('0x3c')][_0x397fa8]));}else if(_0x397fa8===_0x8cfc('0x77')){var _0x42d5a0=JSON[_0x8cfc('0x78')](_0x83e413[_0x8cfc('0x3c')][_0x397fa8])[_0x8cfc('0x79')];var _0x1aa057=JSON[_0x8cfc('0x78')](_0x83e413['query'][_0x397fa8])['$lte'];_0x444bf1[_0x8cfc('0x7a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x42d5a0,_0x1aa057);}else{if(_0x83e413[_0x8cfc('0x3c')][_0x397fa8]===_0x8cfc('0x7b')){_0x444bf1[_0x8cfc('0x7a')]('i.'+_0x397fa8+'\x20IS\x20NULL');}else{_0x444bf1['where']('i.'+_0x397fa8+'\x20=\x20?',_0x83e413[_0x8cfc('0x3c')][_0x397fa8]);}}});}if(_0x83e413['query'][_0x8cfc('0x7c')]){if(_0x83e413[_0x8cfc('0x3c')][_0x8cfc('0x7c')]==0x1){_0x444bf1[_0x8cfc('0x61')](_0x8cfc('0x7d'));}else{_0x444bf1[_0x8cfc('0x61')](_0x8cfc('0x7e'));}}if(_0x83e413[_0x8cfc('0x3c')]['tag']){_0x17e130=_[_0x8cfc('0x7f')](_0x83e413[_0x8cfc('0x3c')][_0x8cfc('0x80')])?_0x83e413[_0x8cfc('0x3c')]['tag']:new Array(_0x83e413[_0x8cfc('0x3c')][_0x8cfc('0x80')]);_0x17e130[_0x8cfc('0x34')](function(_0x3a0969){_0x3255b3['or'](_0x8cfc('0x6b'),'%,'+_0x3a0969+',%');});}if(_0x83e413[_0x8cfc('0x3c')]['filter']){var _0x21dc8f=_0x83e413['query'][_0x8cfc('0x81')][_0x8cfc('0x82')]('\x5c','\x5c\x5c')[_0x8cfc('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x21dc8f)){_0x58c262['or'](_0x8cfc('0x83'),_0x21dc8f+'%')['or'](_0x8cfc('0x84'),_0x21dc8f+'%');}_0x58c262['or'](_0x8cfc('0x85'),_0x21dc8f+'%');}}_0x444bf1['where'](_0x58c262);_0x444bf1[_0x8cfc('0x86')](_0x8cfc('0x87'));var _0x502388={'type':db[_0x8cfc('0x88')][_0x8cfc('0x89')][_0x8cfc('0x8a')],'raw':!![]};var _0x518a5b=_0x444bf1[_0x8cfc('0x8b')]();_0x518a5b[_0x8cfc('0x49')](_0x8cfc('0x87'));_0x518a5b['field'](_0x8cfc('0x8c'),'unreadMessages');if(_0x4e0c9a[_0x8cfc('0x45')]){_0x4e0c9a['order'][_0x8cfc('0x34')](function(_0xc521ff){var _0x2a292b=_0xc521ff[0x0]===_0x8cfc('0x8d')?_0xc521ff[0x0]:'i.'+_0xc521ff[0x0];_0x444bf1[_0x8cfc('0x45')](_0x2a292b,_0xc521ff[0x1]===_0x8cfc('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x17e130)){_0x444bf1[_0x8cfc('0x61')](_0x3255b3);_0x518a5b[_0x8cfc('0x7a')](_0x8cfc('0x8f'),_0x17e130);}BPromise[_0x8cfc('0x90')]()['then'](function(){if(!_0x25d430){if(_0x83e413[_0x8cfc('0x3c')][_0x8cfc('0x74')])return;_0x518a5b[_0x8cfc('0x7a')](_0x8cfc('0x91'));_0x444bf1[_0x8cfc('0x7a')](_0x8cfc('0x91'));return;}if(_0x83e413['user'][_0x8cfc('0x92')]!==_0x8cfc('0x93'))return;return _0x83e413[_0x8cfc('0x94')][_0x8cfc('0x95')]({'attributes':['id'],'raw':!![]})[_0x8cfc('0x29')](function(_0xe6dbd3){if(_[_0x8cfc('0x73')](_0xe6dbd3)){_0x518a5b[_0x8cfc('0x7a')]('i.FaxAccountId\x20IS\x20NULL');_0x444bf1['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x518a5b[_0x8cfc('0x7a')]('i.FaxAccountId\x20IN\x20?',_[_0x8cfc('0x30')](_0xe6dbd3,'id'));_0x444bf1[_0x8cfc('0x7a')](_0x8cfc('0x75'),_[_0x8cfc('0x30')](_0xe6dbd3,'id'));}});})[_0x8cfc('0x29')](function(){if(_0x83e413[_0x8cfc('0x94')]['role']===_0x8cfc('0x93')&&!_0x25d430&&!_0x83e413[_0x8cfc('0x3c')][_0x8cfc('0x74')])return[];return db['sequelize'][_0x8cfc('0x3c')](_0x518a5b[_0x8cfc('0x96')](),_0x502388);})[_0x8cfc('0x29')](function(_0x1dd6de){_0x26e739['count']=_0x1dd6de[_0x8cfc('0x5d')];if(_0x26e739[_0x8cfc('0x21')]===0x0)return[];return db[_0x8cfc('0x97')]['query'](_0x4074b7[_0x8cfc('0x96')](),_0x502388)['then'](function(_0x81cdf8){_0x155945=_[_0x8cfc('0x98')](_0x81cdf8,'id');_0x502388=_[_0x8cfc('0x99')](_0x502388,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x83e413[_0x8cfc('0x3c')][_0x8cfc('0x41')]){_0x4e0c9a[_0x8cfc('0x40')][_0x8cfc('0x34')](function(_0x598fae){_0x444bf1[_0x8cfc('0x49')]('i.'+_0x598fae);});}else{_0x444bf1[_0x8cfc('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8cfc('0x5f'));_0x444bf1[_0x8cfc('0x49')](_0x8cfc('0x9a'),_0x8cfc('0x9b'));_0x444bf1[_0x8cfc('0x49')](_0x8cfc('0x9c'),'Account.mandatoryDisposition');_0x444bf1[_0x8cfc('0x49')](_0x8cfc('0x9d'),_0x8cfc('0x8d'));_0x444bf1[_0x8cfc('0x49')](_0x8cfc('0x9e'));_0x444bf1[_0x8cfc('0x49')]('c.firstName',_0x8cfc('0x9f'));_0x444bf1[_0x8cfc('0x49')](_0x8cfc('0xa0'),_0x8cfc('0xa1'));_0x444bf1['field']('c.email',_0x8cfc('0xa2'));_0x444bf1['field']('c.phone',_0x8cfc('0xa3'));_0x444bf1[_0x8cfc('0x49')](_0x8cfc('0xa4'),_0x8cfc('0xa5'));_0x444bf1['field'](_0x8cfc('0xa6'),_0x8cfc('0xa7'));_0x444bf1['field']('o.fullname',_0x8cfc('0xa8'));_0x444bf1[_0x8cfc('0x49')](_0x8cfc('0xa9'),_0x8cfc('0xaa'));_0x444bf1[_0x8cfc('0x49')](_0x8cfc('0xab'),_0x8cfc('0x32'));}if(_0x4e0c9a[_0x8cfc('0x44')])_0x444bf1[_0x8cfc('0x44')](_0x4e0c9a[_0x8cfc('0x44')]);if(_0x4e0c9a[_0x8cfc('0x22')])_0x444bf1['offset'](_0x4e0c9a[_0x8cfc('0x22')]);return db['sequelize']['query'](_0x444bf1[_0x8cfc('0x96')](),_0x502388);})[_0x8cfc('0x29')](function(_0x405fc9){_0x1c79c8[_0x8cfc('0x7a')](_0x8cfc('0xac'),_['map'](_0x405fc9,'id'));return db[_0x8cfc('0x97')]['query'](_0x1c79c8[_0x8cfc('0x96')](),_0x502388)[_0x8cfc('0x29')](function(_0x52c594){var _0x168e89=_[_0x8cfc('0xad')](_0x52c594,_0x8cfc('0xae'));var _0x393d84=[];_0x405fc9[_0x8cfc('0x34')](function(_0x4f5968){_0x393d84[_0x8cfc('0x35')](updateFaxInteraction(_0x4f5968,_0x155945,_0x168e89));});return BPromise[_0x8cfc('0xaf')](_0x393d84);});});})[_0x8cfc('0x29')](function(_0x58722a){_0x26e739['rows']=_0x58722a;return _0x26e739;})[_0x8cfc('0x29')](respondWithFilteredResult(_0x54324d,_0x4e0c9a))[_0x8cfc('0x36')](handleError(_0x54324d,null));};exports[_0x8cfc('0xb0')]=function(_0x45cc47,_0x5092af){var _0xa1c59={'raw':![],'where':{'id':_0x45cc47[_0x8cfc('0xb1')]['id']}},_0x53e984={};_0x53e984[_0x8cfc('0x3b')]=_['keys'](db[_0x8cfc('0xb2')][_0x8cfc('0x38')]);_0x53e984[_0x8cfc('0x3c')]=_[_0x8cfc('0x3d')](_0x45cc47['query']);_0x53e984[_0x8cfc('0x3e')]=_[_0x8cfc('0x3f')](_0x53e984[_0x8cfc('0x3b')],_0x53e984[_0x8cfc('0x3c')]);_0xa1c59[_0x8cfc('0x40')]=_[_0x8cfc('0x3f')](_0x53e984['model'],qs[_0x8cfc('0x41')](_0x45cc47[_0x8cfc('0x3c')][_0x8cfc('0x41')]));_0xa1c59['attributes']=_0xa1c59[_0x8cfc('0x40')][_0x8cfc('0x5d')]?_0xa1c59[_0x8cfc('0x40')]:_0x53e984[_0x8cfc('0x3b')];if(_0x45cc47['query'][_0x8cfc('0xb3')]){_0xa1c59[_0x8cfc('0xb4')]=[{'all':!![]}];}_0xa1c59=_['merge']({},_0xa1c59,_0x45cc47[_0x8cfc('0xb5')]);return db[_0x8cfc('0xb2')][_0x8cfc('0x5e')](_0xa1c59)[_0x8cfc('0x29')](handleEntityNotFound(_0x5092af,null))[_0x8cfc('0x29')](respondWithResult(_0x5092af,null))[_0x8cfc('0x36')](handleError(_0x5092af,null));};exports[_0x8cfc('0xb6')]=function(_0xa507b6,_0x2b0e3d){return db['FaxInteraction'][_0x8cfc('0xb6')](_0xa507b6[_0x8cfc('0xb7')],{})[_0x8cfc('0x29')](respondWithResult(_0x2b0e3d,0xc9))[_0x8cfc('0x36')](handleError(_0x2b0e3d,null));};exports['update']=function(_0x572a43,_0x42c7f0){if(_0x572a43[_0x8cfc('0xb7')]['id']){delete _0x572a43[_0x8cfc('0xb7')]['id'];}return db[_0x8cfc('0xb2')][_0x8cfc('0x5e')]({'where':{'id':_0x572a43['params']['id']}})[_0x8cfc('0x29')](handleEntityNotFound(_0x42c7f0,null))[_0x8cfc('0x29')](saveUpdates(_0x572a43['body'],null))['then'](respondWithResult(_0x42c7f0,null))[_0x8cfc('0x36')](handleError(_0x42c7f0,null));};exports[_0x8cfc('0x2a')]=function(_0x3516fc,_0x34a73d){return db[_0x8cfc('0xb2')][_0x8cfc('0x5e')]({'where':{'id':_0x3516fc[_0x8cfc('0xb1')]['id']}})[_0x8cfc('0x29')](handleEntityNotFound(_0x34a73d,null))[_0x8cfc('0x29')](removeEntity(_0x34a73d,null))[_0x8cfc('0x36')](handleError(_0x34a73d,null));};exports['describe']=function(_0xd536a3,_0x38fa66){return db[_0x8cfc('0xb2')][_0x8cfc('0xb8')]()[_0x8cfc('0x29')](respondWithResult(_0x38fa66,null))['catch'](handleError(_0x38fa66,null));};exports[_0x8cfc('0xb9')]=function(_0x208cec,_0x3ee89a,_0x1111a1){return db[_0x8cfc('0xba')][_0x8cfc('0x5e')]({'where':{'id':_0x208cec['params']['id']}})[_0x8cfc('0x29')](handleEntityNotFound(_0x3ee89a,null))['then'](function(_0x4efc63){if(_0x4efc63){return _0x4efc63[_0x8cfc('0xb9')](_0x208cec[_0x8cfc('0xb7')][_0x8cfc('0xbb')],_[_0x8cfc('0xbc')](_0x208cec['body'],['ids','id'])||{});}})[_0x8cfc('0x29')](respondWithResult(_0x3ee89a,null))['catch'](handleError(_0x3ee89a,null));};exports[_0x8cfc('0xbd')]=function(_0x402308,_0x14e489,_0x17a2b2){var _0x4cfcd3={'raw':![],'where':{}};var _0x245575={};var _0x79f53c={'count':0x0,'rows':[]};return db[_0x8cfc('0xb2')]['findOne']({'where':{'id':_0x402308[_0x8cfc('0xb1')]['id']}})[_0x8cfc('0x29')](handleEntityNotFound(_0x14e489,null))[_0x8cfc('0x29')](function(_0xe23aa0){if(_0xe23aa0){_0x245575[_0x8cfc('0x3b')]=_[_0x8cfc('0x3d')](db['FaxMessage'][_0x8cfc('0x38')]);_0x245575['query']=_['keys'](_0x402308[_0x8cfc('0x3c')]);_0x245575[_0x8cfc('0x3e')]=_[_0x8cfc('0x3f')](_0x245575[_0x8cfc('0x3b')],_0x245575[_0x8cfc('0x3c')]);_0x4cfcd3['attributes']=_[_0x8cfc('0x3f')](_0x245575[_0x8cfc('0x3b')],qs[_0x8cfc('0x41')](_0x402308['query'][_0x8cfc('0x41')]));_0x4cfcd3[_0x8cfc('0x40')]=_0x4cfcd3['attributes'][_0x8cfc('0x5d')]?_0x4cfcd3[_0x8cfc('0x40')]:_0x245575[_0x8cfc('0x3b')];if(!_0x402308[_0x8cfc('0x3c')][_0x8cfc('0x42')](_0x8cfc('0x43'))){_0x4cfcd3[_0x8cfc('0x44')]=qs['limit'](_0x402308[_0x8cfc('0x3c')]['limit']);_0x4cfcd3[_0x8cfc('0x22')]=qs[_0x8cfc('0x22')](_0x402308[_0x8cfc('0x3c')][_0x8cfc('0x22')]);}_0x4cfcd3[_0x8cfc('0x45')]=qs['sort'](_0x402308[_0x8cfc('0x3c')][_0x8cfc('0x46')]);_0x4cfcd3[_0x8cfc('0x7a')]=qs['filters'](_[_0x8cfc('0x47')](_0x402308['query'],_0x245575[_0x8cfc('0x3e')]));_0x4cfcd3['where'][_0x8cfc('0xae')]=_0xe23aa0['id'];if(_0x402308[_0x8cfc('0x3c')]['filter']){_0x4cfcd3[_0x8cfc('0x7a')]=_[_0x8cfc('0x99')](_0x4cfcd3[_0x8cfc('0x7a')],{'$or':_[_0x8cfc('0x30')](_0x4cfcd3[_0x8cfc('0x40')],function(_0x7500f1){var _0x353c04={};_0x353c04[_0x7500f1]={'$like':'%'+_0x402308[_0x8cfc('0x3c')][_0x8cfc('0x81')]+'%'};return _0x353c04;})});}if(_0x402308[_0x8cfc('0x3c')][_0x8cfc('0x79')]){var _0x584791=_0x402308[_0x8cfc('0x3c')][_0x8cfc('0x79')][_0x8cfc('0x64')](',');var _0x5213a4={};_0x5213a4[_0x584791[0x0]]={'$gte':moment(_0x584791[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4cfcd3['where']=_[_0x8cfc('0x99')](_0x4cfcd3[_0x8cfc('0x7a')],_0x5213a4);}_0x4cfcd3=_[_0x8cfc('0x99')]({},_0x4cfcd3,_0x402308[_0x8cfc('0xb5')]);return db[_0x8cfc('0xba')]['count']({'where':_0x4cfcd3['where']})[_0x8cfc('0x29')](function(_0x1bba44){_0x79f53c[_0x8cfc('0x21')]=_0x1bba44;if(_0x402308[_0x8cfc('0x3c')]['includeAll']){_0x4cfcd3['include']=[{'all':!![]}];}return db['FaxMessage'][_0x8cfc('0xbe')](_0x4cfcd3);})[_0x8cfc('0x29')](function(_0x31d86e){_0x79f53c['rows']=_0x31d86e;return _0x79f53c;});}})['then'](respondWithFilteredResult(_0x14e489,_0x4cfcd3))[_0x8cfc('0x36')](handleError(_0x14e489,null));};exports[_0x8cfc('0xbf')]=function(_0x299adc,_0x3ca677,_0x30b77e){return db[_0x8cfc('0xb2')]['find']({'where':{'id':_0x299adc[_0x8cfc('0xb1')]['id']}})[_0x8cfc('0x29')](handleEntityNotFound(_0x3ca677,null))[_0x8cfc('0x29')](function(_0x14986e){if(_0x14986e){return _0x14986e['setTags'](_0x299adc[_0x8cfc('0xb7')][_0x8cfc('0xbb')],_[_0x8cfc('0xbc')](_0x299adc[_0x8cfc('0xb7')],[_0x8cfc('0xbb'),'id'])||{})[_0x8cfc('0xc0')](function(){return db[_0x8cfc('0xc1')][_0x8cfc('0xbe')]({'attributes':['id',_0x8cfc('0x2d'),_0x8cfc('0x4a')],'where':{'id':_0x299adc[_0x8cfc('0xb7')][_0x8cfc('0xbb')]}});})['then'](function(_0x1c7281){socket[_0x8cfc('0xc2')]('faxInteractionTags:save',{'id':Number(_0x299adc[_0x8cfc('0xb1')]['id']),'tags':_0x1c7281||[]});return{'id':Number(_0x299adc[_0x8cfc('0xb1')]['id']),'tags':_0x1c7281||[]};});}})['then'](respondWithResult(_0x3ca677,null))['catch'](handleError(_0x3ca677,null));};exports[_0x8cfc('0xc3')]=function(_0x36d242,_0x4f209c,_0x3eb072){return db[_0x8cfc('0xb2')][_0x8cfc('0x5e')]({'where':{'id':_0x36d242[_0x8cfc('0xb1')]['id']}})[_0x8cfc('0x29')](handleEntityNotFound(_0x4f209c,null))[_0x8cfc('0x29')](function(_0x590686){if(_0x590686){return _0x590686[_0x8cfc('0xc3')](_0x36d242[_0x8cfc('0x3c')]['ids']);}})[_0x8cfc('0x29')](respondWithStatusCode(_0x4f209c,null))[_0x8cfc('0x36')](handleError(_0x4f209c,null));};exports[_0x8cfc('0xc4')]=function(_0x3e31a5,_0x19ba97){var _0x591f41=moment()[_0x8cfc('0xc5')]()[_0x8cfc('0x96')]();var _0x248c31=path['join'](config[_0x8cfc('0xc6')],_0x8cfc('0xc7'),_0x8cfc('0xc8'),_0x8cfc('0xc9'));var _0x2566ca=path[_0x8cfc('0xca')](config[_0x8cfc('0xc6')],_0x8cfc('0xc7'),_0x8cfc('0xc8'),'attachments');var _0x1d365e=path[_0x8cfc('0xca')](_0x248c31,_0x591f41);var _0x11192e=util['format'](_0x8cfc('0xcb'),_0x3e31a5[_0x8cfc('0xb1')]['id'],_0x591f41);var _0x1bbfbe=path[_0x8cfc('0xca')](_0x248c31,_0x11192e);var _0x46f20b=[];_0x46f20b[_0x8cfc('0x35')]({'model':db[_0x8cfc('0xcc')],'as':_0x8cfc('0xcc'),'raw':!![]});var _0x19ff58=[{'model':db[_0x8cfc('0xba')],'as':_0x8cfc('0xcd'),'attributes':['id','body',_0x8cfc('0x77')],'include':_0x46f20b}];return db[_0x8cfc('0xb2')][_0x8cfc('0x5e')]({'where':{'id':_0x3e31a5[_0x8cfc('0xb1')]['id']},'include':_0x19ff58})[_0x8cfc('0x29')](handleEntityNotFound(_0x19ba97,null))['then'](function(_0x5d5f20){if(_0x5d5f20&&_0x5d5f20[_0x8cfc('0xcd')]){var _0x5e93c0=_0x5d5f20[_0x8cfc('0xce')]({'plain':!![]});fs[_0x8cfc('0xcf')](_0x1d365e);for(var _0x2d9c2d=0x0;_0x2d9c2d<_0x5e93c0[_0x8cfc('0xcd')][_0x8cfc('0x5d')];_0x2d9c2d++){var _0x216ddf=_0x5e93c0[_0x8cfc('0xcd')][_0x2d9c2d][_0x8cfc('0xcc')];if(_0x216ddf){var _0x3e52d7=path['join'](_0x2566ca,_0x216ddf[_0x8cfc('0xd0')]);if(fs[_0x8cfc('0xd1')](_0x3e52d7)){fs['createReadStream'](_0x3e52d7)[_0x8cfc('0xd2')](fs['createWriteStream'](path['join'](_0x1d365e,_0x216ddf[_0x8cfc('0xd0')])));}}}return BPromise[_0x8cfc('0x90')]()[_0x8cfc('0x29')](function(){return new BPromise(function(_0xc9fdea,_0x530013){zipdir(_0x1d365e,{'saveTo':_0x1bbfbe},function(_0x11e209,_0x3d1897){if(_0x11e209)return _0x530013(_0x11e209);return _0xc9fdea(_0x3d1897);});})[_0x8cfc('0x29')](function(){return new BPromise(function(_0x470d09,_0x1df605){rimraf(_0x1d365e,function(_0x682856){if(_0x682856)_0x1df605(_0x682856);return _0x470d09();});});})[_0x8cfc('0x29')](function(){return _0x19ba97[_0x8cfc('0xc4')](_0x1bbfbe,_0x11192e,function(_0x337d06){if(_0x337d06){console[_0x8cfc('0xd3')](_0x8cfc('0xd4'),_0x337d06);}else{fs[_0x8cfc('0xd5')](_0x1bbfbe);}});});});}else{return _0x19ba97['sendStatus'](0xc8);}})[_0x8cfc('0x36')](handleError(_0x19ba97,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 6e759de..1360581 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 _0xadb5=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x2771b4,_0x191b27){var _0x56e70f=function(_0x20987c){while(--_0x20987c){_0x2771b4['push'](_0x2771b4['shift']());}};_0x56e70f(++_0x191b27);}(_0xadb5,0xad));var _0x5adb=function(_0x5a5b8f,_0x206ae6){_0x5a5b8f=_0x5a5b8f-0x0;var _0x47e320=_0xadb5[_0x5a5b8f];return _0x47e320;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x5adb('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x5adb('0x0'))['db'][_0x5adb('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5adb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5adb('0x3'),'afterDestroy':_0x5adb('0x4')};function emitEvent(_0x2e3ef4){return function(_0x4cb1d1,_0x35a5d3,_0x168d89){_0x4cb1d1[_0x5adb('0x5')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x6')](function(_0xdf3776){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0x8'),_0xdf3776[_0x5adb('0x9')](function(_0x41261c){return{'id':_0x41261c['id']};}));return FaxMessage[_0x5adb('0xa')]({'where':{'FaxInteractionId':_0x4cb1d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5adb('0x6')](function(_0x336bad){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0xb'),_0x336bad['length']);FaxInteractionEvents['emit'](_0x2e3ef4+':'+_0x4cb1d1['id'],_0x4cb1d1);FaxInteractionEvents[_0x5adb('0xc')](_0x2e3ef4,_0x4cb1d1);_0x168d89(null);})[_0x5adb('0xd')](_0x168d89(null));};}for(var e in events){if(events[_0x5adb('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x5adb('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x326f=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','hasOwnProperty','exports','events'];(function(_0x39b006,_0x15d8c1){var _0x216223=function(_0x5e0911){while(--_0x5e0911){_0x39b006['push'](_0x39b006['shift']());}};_0x216223(++_0x15d8c1);}(_0x326f,0xd1));var _0xf326=function(_0x56d023,_0x47a354){_0x56d023=_0x56d023-0x0;var _0x526074=_0x326f[_0x56d023];return _0x526074;};'use strict';var EventEmitter=require(_0xf326('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xf326('0x1'))['db'][_0xf326('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf326('0x3')](0x0);var events={'afterCreate':_0xf326('0x4'),'afterUpdate':_0xf326('0x5'),'afterDestroy':_0xf326('0x6')};function emitEvent(_0x9445c6){return function(_0xf1c243,_0x1b5a56,_0x3ace29){_0xf1c243['getUsers']({'attributes':['id'],'raw':!![]})[_0xf326('0x7')](function(_0x3851eb){_0xf1c243[_0xf326('0x8')](_0xf326('0x9'),_0x3851eb['map'](function(_0x4c206c){return{'id':_0x4c206c['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0xf1c243['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf326('0x7')](function(_0x1fc80e){_0xf1c243[_0xf326('0x8')](_0xf326('0xa'),_0x1fc80e[_0xf326('0xb')]);FaxInteractionEvents['emit'](_0x9445c6+':'+_0xf1c243['id'],_0xf1c243);FaxInteractionEvents[_0xf326('0xc')](_0x9445c6,_0xf1c243);_0x3ace29(null);})['catch'](_0x3ace29(null));};}for(var e in events){if(events[_0xf326('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xf326('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 551d4f6..fab2844 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 _0x5ab5=['fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction'];(function(_0x38d1dd,_0x238dd3){var _0x441dd7=function(_0x947607){while(--_0x947607){_0x38d1dd['push'](_0x38d1dd['shift']());}};_0x441dd7(++_0x238dd3);}(_0x5ab5,0x105));var _0x55ab=function(_0x449e69,_0x9287f3){_0x449e69=_0x449e69-0x0;var _0x154eed=_0x5ab5[_0x449e69];return _0x154eed;};'use strict';var _=require(_0x55ab('0x0'));var util=require(_0x55ab('0x1'));var logger=require(_0x55ab('0x2'))(_0x55ab('0x3'));var moment=require(_0x55ab('0x4'));var BPromise=require(_0x55ab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x55ab('0x6'));var attributes=require(_0x55ab('0x7'));module[_0x55ab('0x8')]=function(_0x2181e6,_0x24cca7){return _0x2181e6[_0x55ab('0x9')](_0x55ab('0xa'),attributes,{'tableName':_0x55ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45db62,_0x5963b8,_0x28bcd5){if(_0x45db62[_0x55ab('0xc')](_0x55ab('0xd'))){_0x45db62[_0x55ab('0xe')]=moment()['format'](_0x55ab('0xf'));}_0x28bcd5(null,_0x45db62);}}});}; \ No newline at end of file +var _0xed52=['path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise'];(function(_0x1c0c69,_0x20d14a){var _0x3eb30d=function(_0x56fd1e){while(--_0x56fd1e){_0x1c0c69['push'](_0x1c0c69['shift']());}};_0x3eb30d(++_0x20d14a);}(_0xed52,0x12d));var _0x2ed5=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xed52[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0x2ed5('0x0'));var util=require(_0x2ed5('0x1'));var logger=require(_0x2ed5('0x2'))(_0x2ed5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2ed5('0x4'));var fs=require('fs');var path=require(_0x2ed5('0x5'));var rimraf=require(_0x2ed5('0x6'));var config=require(_0x2ed5('0x7'));var attributes=require(_0x2ed5('0x8'));module[_0x2ed5('0x9')]=function(_0x308ae8,_0x30e3a2){return _0x308ae8[_0x2ed5('0xa')](_0x2ed5('0xb'),attributes,{'tableName':_0x2ed5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4da780,_0x2494f7,_0x215ccf){if(_0x4da780[_0x2ed5('0xd')](_0x2ed5('0xe'))){_0x4da780['closedAt']=moment()[_0x2ed5('0xf')](_0x2ed5('0x10'));}_0x215ccf(null,_0x4da780);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index d480372..c8786f0 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 _0xa2ba=['limit','AddTagsToFaxInteraction','addTags','ids','omit','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xa2ba,0x11e));var _0xaa2b=function(_0x122961,_0x12bf20){_0x122961=_0x122961-0x0;var _0x3e21b5=_0xa2ba[_0x122961];return _0x3e21b5;};'use strict';var _=require(_0xaa2b('0x0'));var util=require(_0xaa2b('0x1'));var moment=require(_0xaa2b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa2b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa2b('0x4'));var logger=require(_0xaa2b('0x5'))('rpc');var config=require(_0xaa2b('0x6'));var jayson=require(_0xaa2b('0x7'));var client=jayson[_0xaa2b('0x8')]['http']({'port':0x232a});config[_0xaa2b('0x9')]=_[_0xaa2b('0xa')](config[_0xaa2b('0x9')],{'host':_0xaa2b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaa2b('0xc'))[_0xaa2b('0xd')](socket);function respondWithRpcPromise(_0x44994f,_0x72d7e0,_0x23e773){return new BPromise(function(_0x198eae,_0x49e523){return client[_0xaa2b('0xe')](_0x44994f,_0x23e773)[_0xaa2b('0xf')](function(_0x3f34cf){logger[_0xaa2b('0x10')](_0xaa2b('0x11'),_0x72d7e0,'request\x20sent');logger[_0xaa2b('0x12')](_0xaa2b('0x13'),_0x72d7e0,'request\x20sent',JSON[_0xaa2b('0x14')](_0x3f34cf));if(_0x3f34cf[_0xaa2b('0x15')]){if(_0x3f34cf['error'][_0xaa2b('0x16')]===0x1f4){logger[_0xaa2b('0x15')](_0xaa2b('0x11'),_0x72d7e0,_0x3f34cf[_0xaa2b('0x15')]['message']);return _0x49e523(_0x3f34cf[_0xaa2b('0x15')]['message']);}logger['error'](_0xaa2b('0x11'),_0x72d7e0,_0x3f34cf[_0xaa2b('0x15')][_0xaa2b('0x17')]);return _0x198eae(_0x3f34cf[_0xaa2b('0x15')]['message']);}else{logger[_0xaa2b('0x10')](_0xaa2b('0x11'),_0x72d7e0,_0xaa2b('0x18'));_0x198eae(_0x3f34cf[_0xaa2b('0x19')][_0xaa2b('0x17')]);}})[_0xaa2b('0x1a')](function(_0x3fae96){logger['error'](_0xaa2b('0x11'),_0x72d7e0,_0x3fae96);_0x49e523(_0x3fae96);});});}exports[_0xaa2b('0x1b')]=function(_0x52276a){var _0x3403a7=this;return new Promise(function(_0x5d3eb6,_0x34d01f){return db[_0xaa2b('0x1c')][_0xaa2b('0x1d')](_0x52276a[_0xaa2b('0x1e')],{'raw':_0x52276a[_0xaa2b('0x1f')]?_0x52276a[_0xaa2b('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52276a[_0xaa2b('0x1f')]?_0x52276a['options'][_0xaa2b('0x20')]||null:null,'attributes':_0x52276a[_0xaa2b('0x1f')]?_0x52276a[_0xaa2b('0x1f')][_0xaa2b('0x21')]||null:null,'limit':_0x52276a[_0xaa2b('0x1f')]?_0x52276a[_0xaa2b('0x1f')][_0xaa2b('0x22')]||null:null})[_0xaa2b('0xf')](function(_0x901561){logger['info'](_0xaa2b('0x1b'),_0x52276a);logger[_0xaa2b('0x12')](_0xaa2b('0x1b'),_0x52276a,JSON[_0xaa2b('0x14')](_0x901561));_0x5d3eb6(_0x901561);})[_0xaa2b('0x1a')](function(_0x229f06){logger[_0xaa2b('0x15')](_0xaa2b('0x1b'),_0x229f06[_0xaa2b('0x17')],_0x52276a);_0x34d01f(_0x3403a7[_0xaa2b('0x15')](0x1f4,_0x229f06[_0xaa2b('0x17')]));});});};exports[_0xaa2b('0x23')]=function(_0x69a268){return new Promise(function(_0x1963fa,_0x474763){return db[_0xaa2b('0x1c')]['find']({'where':_0x69a268[_0xaa2b('0x1f')]?_0x69a268['options'][_0xaa2b('0x20')]||null:null})[_0xaa2b('0xf')](function(_0x10ee1b){if(_0x10ee1b){return _0x10ee1b[_0xaa2b('0x24')](_0x69a268[_0xaa2b('0x1e')][_0xaa2b('0x25')],_[_0xaa2b('0x26')](_0x69a268[_0xaa2b('0x1e')],[_0xaa2b('0x25'),'id'])||{});}})['spread'](function(_0x17ce67){logger[_0xaa2b('0x10')](_0xaa2b('0x27'),_0x69a268);logger[_0xaa2b('0x12')](_0xaa2b('0x27'),_0x69a268,JSON['stringify'](_0x17ce67));_0x1963fa(_0x17ce67);})[_0xaa2b('0x1a')](function(_0x46b66a){logger['error'](_0xaa2b('0x27'),_0x46b66a[_0xaa2b('0x17')],_0x69a268);_0x474763(_this[_0xaa2b('0x15')](0x1f4,_0x46b66a[_0xaa2b('0x17')]));});});}; \ No newline at end of file +var _0x3da5=['debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','stringify','AddTagsToFaxInteraction','find','then','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','FaxInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x18e65d,_0x4f701b){var _0x31a380=function(_0x138843){while(--_0x138843){_0x18e65d['push'](_0x18e65d['shift']());}};_0x31a380(++_0x4f701b);}(_0x3da5,0x170));var _0x53da=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x3da5[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x53da('0x0'));var util=require(_0x53da('0x1'));var moment=require(_0x53da('0x2'));var BPromise=require('bluebird');var rs=require(_0x53da('0x3'));var fs=require('fs');var Redis=require(_0x53da('0x4'));var db=require(_0x53da('0x5'))['db'];var utils=require(_0x53da('0x6'));var logger=require(_0x53da('0x7'))(_0x53da('0x8'));var config=require(_0x53da('0x9'));var jayson=require(_0x53da('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x53da('0xb')]=_[_0x53da('0xc')](config[_0x53da('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x53da('0xd'))(new Redis(config[_0x53da('0xb')]));require(_0x53da('0xe'))[_0x53da('0xf')](socket);function respondWithRpcPromise(_0x308964,_0x54026d,_0x51ea7c){return new BPromise(function(_0xf02bd6,_0x5a4c29){return client[_0x53da('0x10')](_0x308964,_0x51ea7c)['then'](function(_0xc27b08){logger['info'](_0x53da('0x11'),_0x54026d,_0x53da('0x12'));logger[_0x53da('0x13')](_0x53da('0x14'),_0x54026d,_0x53da('0x12'),JSON['stringify'](_0xc27b08));if(_0xc27b08['error']){if(_0xc27b08[_0x53da('0x15')]['code']===0x1f4){logger[_0x53da('0x15')](_0x53da('0x11'),_0x54026d,_0xc27b08[_0x53da('0x15')][_0x53da('0x16')]);return _0x5a4c29(_0xc27b08[_0x53da('0x15')][_0x53da('0x16')]);}logger[_0x53da('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x54026d,_0xc27b08['error'][_0x53da('0x16')]);return _0xf02bd6(_0xc27b08[_0x53da('0x15')][_0x53da('0x16')]);}else{logger[_0x53da('0x17')](_0x53da('0x11'),_0x54026d,'request\x20sent');_0xf02bd6(_0xc27b08[_0x53da('0x18')]['message']);}})[_0x53da('0x19')](function(_0x24bd70){logger[_0x53da('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x54026d,_0x24bd70);_0x5a4c29(_0x24bd70);});});}exports[_0x53da('0x1a')]=function(_0x22f4ee){var _0x156573=this;return new Promise(function(_0x32e3c5,_0x2291ac){return db[_0x53da('0x1b')][_0x53da('0x1c')](_0x22f4ee[_0x53da('0x1d')],{'raw':_0x22f4ee[_0x53da('0x1e')]?_0x22f4ee[_0x53da('0x1e')][_0x53da('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22f4ee[_0x53da('0x1e')]?_0x22f4ee[_0x53da('0x1e')][_0x53da('0x20')]||null:null,'attributes':_0x22f4ee[_0x53da('0x1e')]?_0x22f4ee[_0x53da('0x1e')][_0x53da('0x21')]||null:null,'limit':_0x22f4ee[_0x53da('0x1e')]?_0x22f4ee['options']['limit']||null:null})['then'](function(_0x11862e){logger['info'](_0x53da('0x1a'),_0x22f4ee);logger[_0x53da('0x13')](_0x53da('0x1a'),_0x22f4ee,JSON[_0x53da('0x22')](_0x11862e));_0x32e3c5(_0x11862e);})['catch'](function(_0x3317ed){logger[_0x53da('0x15')](_0x53da('0x1a'),_0x3317ed[_0x53da('0x16')],_0x22f4ee);_0x2291ac(_0x156573[_0x53da('0x15')](0x1f4,_0x3317ed['message']));});});};exports[_0x53da('0x23')]=function(_0x263a2f){return new Promise(function(_0x5919d7,_0xcb30d2){return db[_0x53da('0x1b')][_0x53da('0x24')]({'where':_0x263a2f[_0x53da('0x1e')]?_0x263a2f[_0x53da('0x1e')][_0x53da('0x20')]||null:null})[_0x53da('0x25')](function(_0x789d5f){if(_0x789d5f){return _0x789d5f[_0x53da('0x26')](_0x263a2f[_0x53da('0x1d')][_0x53da('0x27')],_[_0x53da('0x28')](_0x263a2f[_0x53da('0x1d')],[_0x53da('0x27'),'id'])||{});}})[_0x53da('0x29')](function(_0x24dba6){logger['info'](_0x53da('0x2a'),_0x263a2f);logger[_0x53da('0x13')]('AddTags',_0x263a2f,JSON[_0x53da('0x22')](_0x24dba6));_0x5919d7(_0x24dba6);})[_0x53da('0x19')](function(_0x5d7f74){logger[_0x53da('0x15')](_0x53da('0x2a'),_0x5d7f74[_0x53da('0x16')],_0x263a2f);_0xcb30d2(_this[_0x53da('0x15')](0x1f4,_0x5d7f74[_0x53da('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index b8c0e34..e663552 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 _0xcfa1=['./faxInteraction.events','remove','update','emit','removeListener','register','length','faxInteraction:'];(function(_0x45342b,_0x29558b){var _0x2bd5dc=function(_0x4ccef3){while(--_0x4ccef3){_0x45342b['push'](_0x45342b['shift']());}};_0x2bd5dc(++_0x29558b);}(_0xcfa1,0xc8));var _0x1cfa=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcfa1[_0x397e5f];return _0x5302b8;};'use strict';var FaxInteractionEvents=require(_0x1cfa('0x0'));var events=['save',_0x1cfa('0x1'),_0x1cfa('0x2')];function createListener(_0xf0cf79,_0x49ff4d){return function(_0x5a6e87){_0x49ff4d[_0x1cfa('0x3')](_0xf0cf79,_0x5a6e87);};}function removeListener(_0x1640d5,_0x36d0fe){return function(){FaxInteractionEvents[_0x1cfa('0x4')](_0x1640d5,_0x36d0fe);};}exports[_0x1cfa('0x5')]=function(_0xead195){for(var _0xe059db=0x0,_0x1fd666=events[_0x1cfa('0x6')];_0xe059db<_0x1fd666;_0xe059db++){var _0x25d5c1=events[_0xe059db];var _0x546189=createListener(_0x1cfa('0x7')+_0x25d5c1,_0xead195);FaxInteractionEvents['on'](_0x25d5c1,_0x546189);}}; \ No newline at end of file +var _0x026a=['faxInteraction:','./faxInteraction.events','remove','update','emit','length'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x026a,0xd9));var _0xa026=function(_0x18e975,_0x5f2e3c){_0x18e975=_0x18e975-0x0;var _0x4d3222=_0x026a[_0x18e975];return _0x4d3222;};'use strict';var FaxInteractionEvents=require(_0xa026('0x0'));var events=['save',_0xa026('0x1'),_0xa026('0x2')];function createListener(_0x29779f,_0x3eda9f){return function(_0x1abae6){_0x3eda9f[_0xa026('0x3')](_0x29779f,_0x1abae6);};}function removeListener(_0x5a5aa4,_0x5ddfa8){return function(){FaxInteractionEvents['removeListener'](_0x5a5aa4,_0x5ddfa8);};}exports['register']=function(_0x336b69){for(var _0x2ae530=0x0,_0x50a230=events[_0xa026('0x4')];_0x2ae530<_0x50a230;_0x2ae530++){var _0x1b9d5b=events[_0x2ae530];var _0x2b1f8d=createListener(_0xa026('0x5')+_0x1b9d5b,_0x336b69);FaxInteractionEvents['on'](_0x1b9d5b,_0x2b1f8d);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index d961e93..2cff0d5 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 _0x34d8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','addMessage','post','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router'];(function(_0x2cb08e,_0x48f58a){var _0x3b5f48=function(_0x41c7bf){while(--_0x41c7bf){_0x2cb08e['push'](_0x2cb08e['shift']());}};_0x3b5f48(++_0x48f58a);}(_0x34d8,0xae));var _0x834d=function(_0x4e34ac,_0x3266d2){_0x4e34ac=_0x4e34ac-0x0;var _0x134952=_0x34d8[_0x4e34ac];return _0x134952;};'use strict';var multer=require(_0x834d('0x0'));var util=require(_0x834d('0x1'));var path=require(_0x834d('0x2'));var timeout=require(_0x834d('0x3'));var express=require(_0x834d('0x4'));var router=express[_0x834d('0x5')]();var fs_extra=require(_0x834d('0x6'));var auth=require(_0x834d('0x7'));var interaction=require(_0x834d('0x8'));var config=require(_0x834d('0x9'));var controller=require(_0x834d('0xa'));router[_0x834d('0xb')]('/',auth[_0x834d('0xc')](),controller[_0x834d('0xd')]);router[_0x834d('0xb')](_0x834d('0xe'),auth[_0x834d('0xc')](),controller[_0x834d('0xf')]);router[_0x834d('0xb')](_0x834d('0x10'),auth[_0x834d('0xc')](),controller[_0x834d('0x11')]);router['get'](_0x834d('0x12'),auth[_0x834d('0xc')](),controller[_0x834d('0x13')]);router[_0x834d('0xb')](_0x834d('0x14'),auth[_0x834d('0xc')](),controller['download']);router['post']('/',auth[_0x834d('0xc')](),controller[_0x834d('0x15')]);router['post'](_0x834d('0x12'),auth[_0x834d('0xc')](),controller[_0x834d('0x16')]);router[_0x834d('0x17')](_0x834d('0x18'),auth[_0x834d('0xc')](),interaction[_0x834d('0x19')]('fax',_0x834d('0x1a')),controller[_0x834d('0x1b')]);router[_0x834d('0x1c')](_0x834d('0x10'),auth[_0x834d('0xc')](),interaction['tracked'](_0x834d('0x1d'),_0x834d('0x1e')),controller[_0x834d('0x1f')]);router[_0x834d('0x20')](_0x834d('0x10'),auth[_0x834d('0xc')](),interaction[_0x834d('0x19')](_0x834d('0x1d'),_0x834d('0x21')),controller[_0x834d('0x22')]);router[_0x834d('0x20')](_0x834d('0x18'),auth[_0x834d('0xc')](),controller[_0x834d('0x23')]);module['exports']=router; \ No newline at end of file +var _0xe335=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','describe','/:id','show','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','put','fax','faxinteraction:update','update','delete','destroy','removeTags','multer','util'];(function(_0x3b14ad,_0x5e4401){var _0x392677=function(_0x4c9139){while(--_0x4c9139){_0x3b14ad['push'](_0x3b14ad['shift']());}};_0x392677(++_0x5e4401);}(_0xe335,0x1de));var _0x5e33=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe335[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x5e33('0x0'));var util=require(_0x5e33('0x1'));var path=require(_0x5e33('0x2'));var timeout=require(_0x5e33('0x3'));var express=require(_0x5e33('0x4'));var router=express[_0x5e33('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5e33('0x6'));var interaction=require(_0x5e33('0x7'));var config=require(_0x5e33('0x8'));var controller=require(_0x5e33('0x9'));router['get']('/',auth[_0x5e33('0xa')](),controller[_0x5e33('0xb')]);router[_0x5e33('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x5e33('0xd')]);router[_0x5e33('0xc')](_0x5e33('0xe'),auth[_0x5e33('0xa')](),controller[_0x5e33('0xf')]);router[_0x5e33('0xc')]('/:id/messages',auth['isAuthenticated'](),controller[_0x5e33('0x10')]);router[_0x5e33('0xc')](_0x5e33('0x11'),auth[_0x5e33('0xa')](),controller[_0x5e33('0x12')]);router[_0x5e33('0x13')]('/',auth[_0x5e33('0xa')](),controller[_0x5e33('0x14')]);router['post']('/:id/messages',auth[_0x5e33('0xa')](),controller[_0x5e33('0x15')]);router[_0x5e33('0x13')](_0x5e33('0x16'),auth[_0x5e33('0xa')](),interaction[_0x5e33('0x17')]('fax',_0x5e33('0x18')),controller['addTags']);router[_0x5e33('0x19')](_0x5e33('0xe'),auth[_0x5e33('0xa')](),interaction['tracked'](_0x5e33('0x1a'),_0x5e33('0x1b')),controller[_0x5e33('0x1c')]);router[_0x5e33('0x1d')](_0x5e33('0xe'),auth['isAuthenticated'](),interaction[_0x5e33('0x17')](_0x5e33('0x1a'),'faxinteraction:destroy'),controller[_0x5e33('0x1e')]);router[_0x5e33('0x1d')](_0x5e33('0x16'),auth['isAuthenticated'](),controller[_0x5e33('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 74221e8..5f222fd 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 _0xfb2d=['out','exports','TEXT','ENUM'];(function(_0x1cc2d6,_0x103a3e){var _0x94d041=function(_0x70d641){while(--_0x70d641){_0x1cc2d6['push'](_0x1cc2d6['shift']());}};_0x94d041(++_0x103a3e);}(_0xfb2d,0x175));var _0xdfb2=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0xfb2d[_0x529f1c];return _0x4d57ab;};'use strict';var Sequelize=require('sequelize');module[_0xdfb2('0x0')]={'body':{'type':Sequelize[_0xdfb2('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdfb2('0x2')]('in',_0xdfb2('0x3')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xdfb2('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x1d3e=['exports','TEXT','medium','BOOLEAN','out','DATE','sequelize'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0x1d3e,0x1db));var _0xe1d3=function(_0x18f294,_0x4726d9){_0x18f294=_0x18f294-0x0;var _0x2841a6=_0x1d3e[_0x18f294];return _0x2841a6;};'use strict';var Sequelize=require(_0xe1d3('0x0'));module[_0xe1d3('0x1')]={'body':{'type':Sequelize[_0xe1d3('0x2')](_0xe1d3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe1d3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe1d3('0x5')),'defaultValue':_0xe1d3('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xe1d3('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xe1d3('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index b71a1be..e1f3249 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 _0x3d04=['where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','keys','find','body','describe','fax-interactions','accept','fax','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','CmContact','FaxInteraction','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','acceptMessage','interface','channel','event','EventManager','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','rejectmessage','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort'];(function(_0xe4da20,_0x2d6ac7){var _0x1a4906=function(_0x1d3f08){while(--_0x1d3f08){_0xe4da20['push'](_0xe4da20['shift']());}};_0x1a4906(++_0x2d6ac7);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x43d0('0x0'));var rimraf=require(_0x43d0('0x1'));var zipdir=require(_0x43d0('0x2'));var jsonpatch=require(_0x43d0('0x3'));var rp=require(_0x43d0('0x4'));var moment=require(_0x43d0('0x5'));var BPromise=require(_0x43d0('0x6'));var Mustache=require(_0x43d0('0x7'));var util=require('util');var path=require(_0x43d0('0x8'));var sox=require(_0x43d0('0x9'));var csv=require(_0x43d0('0xa'));var ejs=require(_0x43d0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43d0('0xc'));var deskjs=require(_0x43d0('0xd'));var toCsv=require(_0x43d0('0xa'));var querystring=require(_0x43d0('0xe'));var Papa=require(_0x43d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43d0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43d0('0x11'))(_0x43d0('0x12'));var utils=require(_0x43d0('0x13'));var config=require(_0x43d0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43d0('0x15'))['db'];config[_0x43d0('0x16')]=_['defaults'](config[_0x43d0('0x16')],{'host':_0x43d0('0x17'),'port':0x18eb});var socket=require(_0x43d0('0x18'))(new Redis(config['redis']));require(_0x43d0('0x19'))[_0x43d0('0x1a')](socket);var jayson=require(_0x43d0('0x1b'));var client=jayson['client'][_0x43d0('0x1c')]({'port':0x232c});var client9002=jayson[_0x43d0('0x1d')][_0x43d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1218b5,_0x91b4a1,_0x4aa32a,_0x5d4fc4){return new BPromise(function(_0x1e91a7,_0x3356f1){var _0x35decf=_0x5d4fc4||client;return _0x35decf['request'](_0x1218b5,_0x4aa32a)[_0x43d0('0x1e')](function(_0x532402){logger[_0x43d0('0x1f')](_0x43d0('0x20'),_0x91b4a1,_0x43d0('0x21'));logger['debug'](_0x43d0('0x22'),_0x91b4a1,_0x43d0('0x21'),JSON['stringify'](_0x532402));if(_0x532402[_0x43d0('0x23')]){if(_0x532402[_0x43d0('0x23')][_0x43d0('0x24')]===0x1f4){logger[_0x43d0('0x23')](_0x43d0('0x20'),_0x91b4a1,_0x532402[_0x43d0('0x23')][_0x43d0('0x25')]);return _0x3356f1(_0x532402[_0x43d0('0x23')][_0x43d0('0x25')]);}logger[_0x43d0('0x23')](_0x43d0('0x20'),_0x91b4a1,_0x532402[_0x43d0('0x23')][_0x43d0('0x25')]);return _0x1e91a7(_0x532402[_0x43d0('0x23')][_0x43d0('0x25')]);}else{logger['info'](_0x43d0('0x20'),_0x91b4a1,_0x43d0('0x21'));_0x1e91a7(_0x532402['result'][_0x43d0('0x25')]);}})['catch'](function(_0x29c111){logger[_0x43d0('0x23')]('FaxMessage,\x20%s,\x20%s',_0x91b4a1,_0x29c111);_0x3356f1(_0x29c111);});});}function respondWithStatusCode(_0x3e38e4,_0x238c64){_0x238c64=_0x238c64||0xcc;return function(_0x5ac4c0){if(_0x5ac4c0){return _0x3e38e4[_0x43d0('0x26')](_0x238c64);}return _0x3e38e4[_0x43d0('0x27')](_0x238c64)[_0x43d0('0x28')]();};}function respondWithResult(_0x5f16ac,_0x447725){_0x447725=_0x447725||0xc8;return function(_0x38e89e){if(_0x38e89e){return _0x5f16ac[_0x43d0('0x27')](_0x447725)[_0x43d0('0x29')](_0x38e89e);}};}function respondWithFilteredResult(_0x37d78f,_0x440ecb){return function(_0x31a057){if(_0x31a057){var _0x4a3cd4=_0x31a057['count'],_0x2b0784=_0x440ecb['offset'],_0x2f5bc5=_0x440ecb['offset']+_0x440ecb[_0x43d0('0x2a')],_0x6bc471;if(_0x2f5bc5>=_0x4a3cd4){_0x2f5bc5=_0x4a3cd4;_0x6bc471=0xc8;}else{_0x6bc471=0xce;}_0x37d78f[_0x43d0('0x27')](_0x6bc471);return _0x37d78f[_0x43d0('0x2b')](_0x43d0('0x2c'),_0x2b0784+'-'+_0x2f5bc5+'/'+_0x4a3cd4)[_0x43d0('0x29')](_0x31a057);}return null;};}function patchUpdates(_0x12950d){return function(_0x5d23c2){try{jsonpatch[_0x43d0('0x2d')](_0x5d23c2,_0x12950d,!![]);}catch(_0x167217){return BPromise[_0x43d0('0x2e')](_0x167217);}return _0x5d23c2[_0x43d0('0x2f')]();};}function saveUpdates(_0xbc5a4,_0x2b0ce8){return function(_0x12a8b9){if(_0x12a8b9){return _0x12a8b9[_0x43d0('0x30')](_0xbc5a4)[_0x43d0('0x1e')](function(_0x89799a){return _0x89799a;});}return null;};}function removeEntity(_0x42de80,_0x5385ee){return function(_0x3d2c3b){if(_0x3d2c3b){return _0x3d2c3b[_0x43d0('0x31')]()[_0x43d0('0x1e')](function(){_0x42de80[_0x43d0('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x336695,_0x493409){return function(_0x11f3d7){if(!_0x11f3d7){_0x336695[_0x43d0('0x26')](0x194);}return _0x11f3d7;};}function handleError(_0x4824bc,_0x423a3f){_0x423a3f=_0x423a3f||0x1f4;return function(_0x266339){logger[_0x43d0('0x23')](_0x266339[_0x43d0('0x32')]);if(_0x266339[_0x43d0('0x33')]){delete _0x266339[_0x43d0('0x33')];}_0x4824bc[_0x43d0('0x27')](_0x423a3f)[_0x43d0('0x34')](_0x266339);};}exports[_0x43d0('0x35')]=function(_0x3c56fc,_0x41ff64){var _0x498334={},_0x3afb3b={},_0x397bd6={'count':0x0,'rows':[]};var _0x31f4e8=_[_0x43d0('0x36')](db[_0x43d0('0x37')][_0x43d0('0x38')],function(_0x314360){return{'name':_0x314360[_0x43d0('0x39')],'type':_0x314360[_0x43d0('0x3a')][_0x43d0('0x3b')]};});_0x3afb3b[_0x43d0('0x3c')]=_[_0x43d0('0x36')](_0x31f4e8,_0x43d0('0x33'));_0x3afb3b[_0x43d0('0x3d')]=_['keys'](_0x3c56fc[_0x43d0('0x3d')]);_0x3afb3b[_0x43d0('0x3e')]=_[_0x43d0('0x3f')](_0x3afb3b[_0x43d0('0x3c')],_0x3afb3b[_0x43d0('0x3d')]);_0x498334[_0x43d0('0x40')]=_[_0x43d0('0x3f')](_0x3afb3b[_0x43d0('0x3c')],qs['fields'](_0x3c56fc['query'][_0x43d0('0x41')]));_0x498334['attributes']=_0x498334['attributes'][_0x43d0('0x42')]?_0x498334['attributes']:_0x3afb3b[_0x43d0('0x3c')];if(!_0x3c56fc['query'][_0x43d0('0x43')]('nolimit')){_0x498334[_0x43d0('0x2a')]=qs[_0x43d0('0x2a')](_0x3c56fc[_0x43d0('0x3d')]['limit']);_0x498334[_0x43d0('0x44')]=qs['offset'](_0x3c56fc[_0x43d0('0x3d')]['offset']);}_0x498334['order']=qs[_0x43d0('0x45')](_0x3c56fc[_0x43d0('0x3d')]['sort']);_0x498334[_0x43d0('0x46')]=qs[_0x43d0('0x3e')](_[_0x43d0('0x47')](_0x3c56fc[_0x43d0('0x3d')],_0x3afb3b[_0x43d0('0x3e')]),_0x31f4e8);if(_0x3c56fc['query'][_0x43d0('0x48')]){_0x498334[_0x43d0('0x46')]=_[_0x43d0('0x49')](_0x498334[_0x43d0('0x46')],{'$or':_['map'](_0x31f4e8,function(_0x33fd62){if(_0x33fd62[_0x43d0('0x3a')]!==_0x43d0('0x4a')){var _0x17396f={};_0x17396f[_0x33fd62[_0x43d0('0x33')]]={'$like':'%'+_0x3c56fc['query'][_0x43d0('0x48')]+'%'};return _0x17396f;}})});}_0x498334=_[_0x43d0('0x49')]({},_0x498334,_0x3c56fc['options']);var _0x19baae={'where':_0x498334[_0x43d0('0x46')]};return db[_0x43d0('0x37')]['count'](_0x19baae)[_0x43d0('0x1e')](function(_0x5ad7df){_0x397bd6[_0x43d0('0x4b')]=_0x5ad7df;if(_0x3c56fc['query'][_0x43d0('0x4c')]){_0x498334[_0x43d0('0x4d')]=[{'all':!![]}];}return db[_0x43d0('0x37')][_0x43d0('0x4e')](_0x498334);})[_0x43d0('0x1e')](function(_0x4d8b86){_0x397bd6[_0x43d0('0x4f')]=_0x4d8b86;return _0x397bd6;})['then'](respondWithFilteredResult(_0x41ff64,_0x498334))[_0x43d0('0x50')](handleError(_0x41ff64,null));};exports[_0x43d0('0x51')]=function(_0xddcadc,_0x94df19){var _0x3b7e25={'raw':!![],'where':{'id':_0xddcadc[_0x43d0('0x52')]['id']}},_0x28d2b8={};_0x28d2b8[_0x43d0('0x3c')]=_[_0x43d0('0x53')](db[_0x43d0('0x37')][_0x43d0('0x38')]);_0x28d2b8[_0x43d0('0x3d')]=_['keys'](_0xddcadc[_0x43d0('0x3d')]);_0x28d2b8[_0x43d0('0x3e')]=_[_0x43d0('0x3f')](_0x28d2b8['model'],_0x28d2b8[_0x43d0('0x3d')]);_0x3b7e25['attributes']=_['intersection'](_0x28d2b8[_0x43d0('0x3c')],qs[_0x43d0('0x41')](_0xddcadc[_0x43d0('0x3d')][_0x43d0('0x41')]));_0x3b7e25[_0x43d0('0x40')]=_0x3b7e25['attributes']['length']?_0x3b7e25[_0x43d0('0x40')]:_0x28d2b8['model'];if(_0xddcadc[_0x43d0('0x3d')][_0x43d0('0x4c')]){_0x3b7e25['include']=[{'all':!![]}];}_0x3b7e25=_['merge']({},_0x3b7e25,_0xddcadc['options']);return db[_0x43d0('0x37')][_0x43d0('0x54')](_0x3b7e25)[_0x43d0('0x1e')](handleEntityNotFound(_0x94df19,null))[_0x43d0('0x1e')](respondWithResult(_0x94df19,null))[_0x43d0('0x50')](handleError(_0x94df19,null));};exports[_0x43d0('0x30')]=function(_0x33fa51,_0x1747d8){if(_0x33fa51[_0x43d0('0x55')]['id']){delete _0x33fa51['body']['id'];}return db[_0x43d0('0x37')][_0x43d0('0x54')]({'where':{'id':_0x33fa51[_0x43d0('0x52')]['id']}})[_0x43d0('0x1e')](handleEntityNotFound(_0x1747d8,null))[_0x43d0('0x1e')](saveUpdates(_0x33fa51[_0x43d0('0x55')],null))[_0x43d0('0x1e')](respondWithResult(_0x1747d8,null))[_0x43d0('0x50')](handleError(_0x1747d8,null));};exports[_0x43d0('0x31')]=function(_0x47650c,_0x47f811){return db['FaxMessage'][_0x43d0('0x54')]({'where':{'id':_0x47650c[_0x43d0('0x52')]['id']}})[_0x43d0('0x1e')](handleEntityNotFound(_0x47f811,null))[_0x43d0('0x1e')](removeEntity(_0x47f811,null))[_0x43d0('0x50')](handleError(_0x47f811,null));};exports[_0x43d0('0x56')]=function(_0x1ffe72,_0x2e9bb2){return db[_0x43d0('0x37')][_0x43d0('0x56')]()[_0x43d0('0x1e')](respondWithResult(_0x2e9bb2,null))[_0x43d0('0x50')](handleError(_0x2e9bb2,null));};var interaction_log=require(_0x43d0('0x11'))(_0x43d0('0x57'));exports[_0x43d0('0x58')]=function(_0x534d4c,_0x4d7549,_0x5e1f2e){var _0x1f7fa8={'agent':{},'channel':_0x43d0('0x59')};if(_0x534d4c[_0x43d0('0x55')]['id']){delete _0x534d4c['body']['id'];}_0x534d4c['body']['read']=!![];_0x534d4c[_0x43d0('0x55')]['readAt']=moment()[_0x43d0('0x5a')](_0x43d0('0x5b'));_0x534d4c[_0x43d0('0x55')]['UserId']=_0x534d4c[_0x43d0('0x55')][_0x43d0('0x5c')]||_0x534d4c[_0x43d0('0x5d')]['id'];_0x1f7fa8[_0x43d0('0x5e')]['id']=_0x534d4c[_0x43d0('0x55')][_0x43d0('0x5c')];return db[_0x43d0('0x37')][_0x43d0('0x54')]({'where':{'id':_0x534d4c[_0x43d0('0x52')]['id'],'UserId':null},'include':[{'model':db[_0x43d0('0x5f')],'as':'Contact'}]})[_0x43d0('0x1e')](handleEntityNotFound(_0x4d7549,null))[_0x43d0('0x1e')](saveUpdates(_0x534d4c[_0x43d0('0x55')],null))[_0x43d0('0x1e')](function(_0x39f5b2){if(_0x39f5b2){_0x1f7fa8[_0x43d0('0x25')]=_0x39f5b2['get']({'plain':!![]});return db[_0x43d0('0x60')][_0x43d0('0x54')]({'where':{'id':_0x39f5b2[_0x43d0('0x61')]}});}return null;})[_0x43d0('0x1e')](handleEntityNotFound(_0x4d7549,null))[_0x43d0('0x1e')](function(_0x3de90d){if(_0x3de90d){return _0x3de90d['update']({'UserId':_0x534d4c[_0x43d0('0x55')][_0x43d0('0x5c')],'read1stAt':_[_0x43d0('0x62')](_0x3de90d[_0x43d0('0x63')])?moment()['format'](_0x43d0('0x5b')):undefined});}return null;})[_0x43d0('0x1e')](function(_0x2c9b0d){if(_0x2c9b0d){_0x1f7fa8['interaction']=_0x2c9b0d['get']({'plain':!![]});interaction_log[_0x43d0('0x1f')](_0x43d0('0x64'),_0x534d4c['user']['id'],_0x534d4c['user'][_0x43d0('0x33')],_0x534d4c[_0x43d0('0x5d')][_0x43d0('0x65')],_0x1f7fa8[_0x43d0('0x66')]['id'],_0x534d4c[_0x43d0('0x55')]?JSON[_0x43d0('0x67')](_0x534d4c[_0x43d0('0x55')]):_0x43d0('0x68'));return respondWithRpcPromise('AcceptMessage',_0x43d0('0x69'),_0x1f7fa8);}return null;})[_0x43d0('0x1e')](function(_0x594847){if(_0x594847){if(_0x534d4c['body']['manual']){_0x1f7fa8[_0x43d0('0x25')][_0x43d0('0x6a')]=util[_0x43d0('0x5a')]('SIP/%s',_0x534d4c[_0x43d0('0x5d')][_0x43d0('0x33')]);_0x1f7fa8['message'][_0x43d0('0x6b')]=_0x1f7fa8[_0x43d0('0x6b')];_0x1f7fa8['message'][_0x43d0('0x6c')]='accept';return respondWithRpcPromise(_0x43d0('0x6d'),_0x43d0('0x6d'),{'event':'acceptmessage','message':_0x1f7fa8['message']},client9002)[_0x43d0('0x1e')](function(){return _0x1f7fa8;});}return _0x1f7fa8;}return null;})[_0x43d0('0x1e')](respondWithResult(_0x4d7549,null))[_0x43d0('0x50')](handleError(_0x4d7549,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x43d0('0x2e')]=function(_0x3047f1,_0x4b0cf3,_0x7dce8d){var _0x59ebde={'agent':{},'channel':'fax'};if(_0x3047f1[_0x43d0('0x55')]['id']){delete _0x3047f1[_0x43d0('0x55')]['id'];}_0x3047f1[_0x43d0('0x55')][_0x43d0('0x5c')]=_0x3047f1[_0x43d0('0x55')][_0x43d0('0x5c')]||_0x3047f1[_0x43d0('0x5d')]['id'];_0x59ebde[_0x43d0('0x5e')]['id']=_0x3047f1[_0x43d0('0x55')][_0x43d0('0x5c')];return db[_0x43d0('0x37')]['find']({'where':{'id':_0x3047f1[_0x43d0('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4b0cf3,null))['then'](function(_0x3accf3){if(_0x3accf3){_0x59ebde[_0x43d0('0x25')]=_0x3accf3['get']({'plain':!![]});return db[_0x43d0('0x60')][_0x43d0('0x54')]({'where':{'id':_0x3accf3[_0x43d0('0x61')]}});}return null;})[_0x43d0('0x1e')](handleEntityNotFound(_0x4b0cf3,null))[_0x43d0('0x1e')](function(_0x21ff6f){if(_0x21ff6f){_0x59ebde[_0x43d0('0x66')]=_0x21ff6f[_0x43d0('0x6e')]({'plain':!![]});interaction_log[_0x43d0('0x1f')](_0x43d0('0x6f'),_0x3047f1[_0x43d0('0x5d')]['id'],_0x3047f1[_0x43d0('0x5d')][_0x43d0('0x33')],_0x3047f1[_0x43d0('0x5d')][_0x43d0('0x65')],_0x59ebde['interaction']['id'],_0x3047f1[_0x43d0('0x55')]?JSON[_0x43d0('0x67')](_0x3047f1[_0x43d0('0x55')]):_0x43d0('0x68'));return respondWithRpcPromise(_0x43d0('0x70'),_0x43d0('0x71'),_0x59ebde);}return null;})['then'](function(_0xe58708){if(_0xe58708){_0xe58708['message'][_0x43d0('0x6a')]=util[_0x43d0('0x5a')](_0x43d0('0x72'),_0x3047f1[_0x43d0('0x5d')][_0x43d0('0x33')]);_0xe58708[_0x43d0('0x25')][_0x43d0('0x6b')]=_0x59ebde['channel'];_0xe58708['message'][_0x43d0('0x6c')]=_0x43d0('0x2e');respondWithRpcPromise(_0x43d0('0x6d'),_0x43d0('0x6d'),{'event':_0x43d0('0x73'),'message':_0xe58708[_0x43d0('0x25')]},client9002);return _0x59ebde;}return null;})['then'](respondWithResult(_0x4b0cf3,null))['catch'](handleError(_0x4b0cf3,null));};exports[_0x43d0('0x74')]=function(_0x5c6b0b,_0x1ed60f){var _0x2cc15b;return db[_0x43d0('0x37')][_0x43d0('0x74')](_0x5c6b0b[_0x43d0('0x55')],{})[_0x43d0('0x1e')](function(_0x10444e){_0x2cc15b=_0x10444e;return db['CmContact'][_0x43d0('0x75')]({'where':{'id':_0x2cc15b[_0x43d0('0x76')]}});})[_0x43d0('0x1e')](function(_0x10ea32){if(_[_0x43d0('0x62')](_0x10ea32)){return;}else{_0x2cc15b[_0x43d0('0x59')]=_0x10ea32[_0x43d0('0x59')];return db[_0x43d0('0x77')][_0x43d0('0x75')]({'where':{'id':_0x2cc15b[_0x43d0('0x78')]}});}})[_0x43d0('0x1e')](function(_0x2f2c3e){return respondWithRpcPromise(_0x43d0('0x79'),_0x43d0('0x79'),{'FaxAccountId':_['isNil'](_0x5c6b0b['body'])?undefined:_0x5c6b0b['body'][_0x43d0('0x7a')],'path':_[_0x43d0('0x62')](_0x2f2c3e)?undefined:util[_0x43d0('0x5a')](_0x43d0('0x7b'),_0x2f2c3e['basename']),'fax':_[_0x43d0('0x62')](_0x2cc15b['fax'])?undefined:_0x2cc15b[_0x43d0('0x59')],'AttachmentId':_0x2cc15b[_0x43d0('0x78')]},client9002);})[_0x43d0('0x1e')](respondWithResult(_0x1ed60f,0xc9))[_0x43d0('0x50')](handleError(_0x1ed60f,null));};exports[_0x43d0('0x7c')]=function(_0xee9f4c,_0x1ab610){var _0x531ba2=path[_0x43d0('0x7d')](config[_0x43d0('0x7e')],_0x43d0('0x7f'),_0x43d0('0x80'),'attachments');return db[_0x43d0('0x37')]['find']({'where':{'id':_0xee9f4c[_0x43d0('0x52')]['id']},'include':[{'model':db['Attachment'],'as':_0x43d0('0x77')}]})[_0x43d0('0x1e')](handleEntityNotFound(_0x1ab610,null))[_0x43d0('0x1e')](function(_0x533338){if(_0x533338){return _0x1ab610[_0x43d0('0x7c')](path[_0x43d0('0x7d')](_0x531ba2,_0x533338[_0x43d0('0x77')][_0x43d0('0x81')]));}})['catch'](handleError(_0x1ab610,null));}; \ No newline at end of file +var _0x1eba=['apply','reject','save','destroy','end','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','find','update','body','describe','fax-interactions','accept','fax','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','FaxInteraction','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','interface','format','channel','event','EventManager','acceptmessage','../../config/logger','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','files','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','register','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','count','offset','limit','Content-Range','json'];(function(_0x1a71da,_0x54d72d){var _0x3895f3=function(_0x51c87c){while(--_0x51c87c){_0x1a71da['push'](_0x1a71da['shift']());}};_0x3895f3(++_0x54d72d);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x1eba[_0x37756b];return _0x46efec;};'use strict';var emlformat=require(_0xa1eb('0x0'));var rimraf=require(_0xa1eb('0x1'));var zipdir=require(_0xa1eb('0x2'));var jsonpatch=require(_0xa1eb('0x3'));var rp=require(_0xa1eb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1eb('0x5'));var util=require(_0xa1eb('0x6'));var path=require(_0xa1eb('0x7'));var sox=require(_0xa1eb('0x8'));var csv=require(_0xa1eb('0x9'));var ejs=require(_0xa1eb('0xa'));var fs=require('fs');var fs_extra=require(_0xa1eb('0xb'));var _=require(_0xa1eb('0xc'));var squel=require(_0xa1eb('0xd'));var crypto=require(_0xa1eb('0xe'));var jsforce=require(_0xa1eb('0xf'));var deskjs=require(_0xa1eb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1eb('0x11'));var Papa=require('papaparse');var Redis=require(_0xa1eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa1eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1eb('0x14'));var logger=require('../../config/logger')(_0xa1eb('0x15'));var utils=require(_0xa1eb('0x16'));var config=require(_0xa1eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa1eb('0x18'))['db'];config[_0xa1eb('0x19')]=_['defaults'](config[_0xa1eb('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1eb('0x19')]));require('./faxMessage.socket')[_0xa1eb('0x1a')](socket);var jayson=require(_0xa1eb('0x1b'));var client=jayson[_0xa1eb('0x1c')][_0xa1eb('0x1d')]({'port':0x232c});var client9002=jayson[_0xa1eb('0x1c')][_0xa1eb('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1c858c,_0x45d6dd,_0x211e42,_0x4aa527){return new BPromise(function(_0xbd6a6b,_0x495ec4){var _0x1401ef=_0x4aa527||client;return _0x1401ef[_0xa1eb('0x1e')](_0x1c858c,_0x211e42)[_0xa1eb('0x1f')](function(_0x1a5d2c){logger['info'](_0xa1eb('0x20'),_0x45d6dd,_0xa1eb('0x21'));logger[_0xa1eb('0x22')](_0xa1eb('0x23'),_0x45d6dd,_0xa1eb('0x21'),JSON[_0xa1eb('0x24')](_0x1a5d2c));if(_0x1a5d2c[_0xa1eb('0x25')]){if(_0x1a5d2c[_0xa1eb('0x25')]['code']===0x1f4){logger[_0xa1eb('0x25')]('FaxMessage,\x20%s,\x20%s',_0x45d6dd,_0x1a5d2c[_0xa1eb('0x25')][_0xa1eb('0x26')]);return _0x495ec4(_0x1a5d2c[_0xa1eb('0x25')][_0xa1eb('0x26')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x45d6dd,_0x1a5d2c[_0xa1eb('0x25')][_0xa1eb('0x26')]);return _0xbd6a6b(_0x1a5d2c['error'][_0xa1eb('0x26')]);}else{logger[_0xa1eb('0x27')](_0xa1eb('0x20'),_0x45d6dd,_0xa1eb('0x21'));_0xbd6a6b(_0x1a5d2c[_0xa1eb('0x28')][_0xa1eb('0x26')]);}})[_0xa1eb('0x29')](function(_0x364b1c){logger[_0xa1eb('0x25')](_0xa1eb('0x20'),_0x45d6dd,_0x364b1c);_0x495ec4(_0x364b1c);});});}function respondWithStatusCode(_0xb77fd6,_0x208844){_0x208844=_0x208844||0xcc;return function(_0x57d089){if(_0x57d089){return _0xb77fd6[_0xa1eb('0x2a')](_0x208844);}return _0xb77fd6[_0xa1eb('0x2b')](_0x208844)['end']();};}function respondWithResult(_0x2680c0,_0x4e2aa7){_0x4e2aa7=_0x4e2aa7||0xc8;return function(_0x3aae71){if(_0x3aae71){return _0x2680c0[_0xa1eb('0x2b')](_0x4e2aa7)['json'](_0x3aae71);}};}function respondWithFilteredResult(_0x45ff0d,_0x1581ee){return function(_0x136835){if(_0x136835){var _0x4f64bb=_0x136835[_0xa1eb('0x2c')],_0x12cf56=_0x1581ee[_0xa1eb('0x2d')],_0x41b3ad=_0x1581ee[_0xa1eb('0x2d')]+_0x1581ee[_0xa1eb('0x2e')],_0x55f5cc;if(_0x41b3ad>=_0x4f64bb){_0x41b3ad=_0x4f64bb;_0x55f5cc=0xc8;}else{_0x55f5cc=0xce;}_0x45ff0d[_0xa1eb('0x2b')](_0x55f5cc);return _0x45ff0d['set'](_0xa1eb('0x2f'),_0x12cf56+'-'+_0x41b3ad+'/'+_0x4f64bb)[_0xa1eb('0x30')](_0x136835);}return null;};}function patchUpdates(_0x198fdb){return function(_0x2ae21d){try{jsonpatch[_0xa1eb('0x31')](_0x2ae21d,_0x198fdb,!![]);}catch(_0xcd9efd){return BPromise[_0xa1eb('0x32')](_0xcd9efd);}return _0x2ae21d[_0xa1eb('0x33')]();};}function saveUpdates(_0x254727,_0x2e2cdb){return function(_0x4345a3){if(_0x4345a3){return _0x4345a3['update'](_0x254727)['then'](function(_0x126d50){return _0x126d50;});}return null;};}function removeEntity(_0xb267e0,_0x24d3aa){return function(_0x36cc2a){if(_0x36cc2a){return _0x36cc2a[_0xa1eb('0x34')]()['then'](function(){_0xb267e0['status'](0xcc)[_0xa1eb('0x35')]();});}};}function handleEntityNotFound(_0x2d2890,_0x516c14){return function(_0x48b23d){if(!_0x48b23d){_0x2d2890[_0xa1eb('0x2a')](0x194);}return _0x48b23d;};}function handleError(_0x47dc2c,_0x1f33dc){_0x1f33dc=_0x1f33dc||0x1f4;return function(_0x534fe4){logger[_0xa1eb('0x25')](_0x534fe4[_0xa1eb('0x36')]);if(_0x534fe4[_0xa1eb('0x37')]){delete _0x534fe4['name'];}_0x47dc2c[_0xa1eb('0x2b')](_0x1f33dc)[_0xa1eb('0x38')](_0x534fe4);};}exports[_0xa1eb('0x39')]=function(_0x481405,_0x140f1e){var _0x27273a={},_0x430ffe={},_0x156b91={'count':0x0,'rows':[]};var _0x3c3982=_['map'](db[_0xa1eb('0x3a')][_0xa1eb('0x3b')],function(_0x46374c){return{'name':_0x46374c[_0xa1eb('0x3c')],'type':_0x46374c[_0xa1eb('0x3d')][_0xa1eb('0x3e')]};});_0x430ffe[_0xa1eb('0x3f')]=_[_0xa1eb('0x40')](_0x3c3982,'name');_0x430ffe[_0xa1eb('0x41')]=_[_0xa1eb('0x42')](_0x481405[_0xa1eb('0x41')]);_0x430ffe[_0xa1eb('0x43')]=_[_0xa1eb('0x44')](_0x430ffe['model'],_0x430ffe[_0xa1eb('0x41')]);_0x27273a[_0xa1eb('0x45')]=_[_0xa1eb('0x44')](_0x430ffe['model'],qs[_0xa1eb('0x46')](_0x481405[_0xa1eb('0x41')][_0xa1eb('0x46')]));_0x27273a[_0xa1eb('0x45')]=_0x27273a[_0xa1eb('0x45')][_0xa1eb('0x47')]?_0x27273a[_0xa1eb('0x45')]:_0x430ffe['model'];if(!_0x481405[_0xa1eb('0x41')][_0xa1eb('0x48')]('nolimit')){_0x27273a[_0xa1eb('0x2e')]=qs['limit'](_0x481405[_0xa1eb('0x41')][_0xa1eb('0x2e')]);_0x27273a[_0xa1eb('0x2d')]=qs[_0xa1eb('0x2d')](_0x481405[_0xa1eb('0x41')][_0xa1eb('0x2d')]);}_0x27273a[_0xa1eb('0x49')]=qs[_0xa1eb('0x4a')](_0x481405[_0xa1eb('0x41')][_0xa1eb('0x4a')]);_0x27273a[_0xa1eb('0x4b')]=qs[_0xa1eb('0x43')](_[_0xa1eb('0x4c')](_0x481405[_0xa1eb('0x41')],_0x430ffe[_0xa1eb('0x43')]),_0x3c3982);if(_0x481405[_0xa1eb('0x41')]['filter']){_0x27273a[_0xa1eb('0x4b')]=_['merge'](_0x27273a[_0xa1eb('0x4b')],{'$or':_[_0xa1eb('0x40')](_0x3c3982,function(_0x54a29f){if(_0x54a29f['type']!==_0xa1eb('0x4d')){var _0x12ec0b={};_0x12ec0b[_0x54a29f[_0xa1eb('0x37')]]={'$like':'%'+_0x481405['query'][_0xa1eb('0x4e')]+'%'};return _0x12ec0b;}})});}_0x27273a=_[_0xa1eb('0x4f')]({},_0x27273a,_0x481405[_0xa1eb('0x50')]);var _0x23c986={'where':_0x27273a[_0xa1eb('0x4b')]};return db[_0xa1eb('0x3a')][_0xa1eb('0x2c')](_0x23c986)[_0xa1eb('0x1f')](function(_0xf6da59){_0x156b91[_0xa1eb('0x2c')]=_0xf6da59;if(_0x481405[_0xa1eb('0x41')][_0xa1eb('0x51')]){_0x27273a[_0xa1eb('0x52')]=[{'all':!![]}];}return db[_0xa1eb('0x3a')]['findAll'](_0x27273a);})[_0xa1eb('0x1f')](function(_0x3c15c4){_0x156b91[_0xa1eb('0x53')]=_0x3c15c4;return _0x156b91;})[_0xa1eb('0x1f')](respondWithFilteredResult(_0x140f1e,_0x27273a))[_0xa1eb('0x29')](handleError(_0x140f1e,null));};exports[_0xa1eb('0x54')]=function(_0x2374c0,_0x5a4a0c){var _0x2e0292={'raw':!![],'where':{'id':_0x2374c0[_0xa1eb('0x55')]['id']}},_0x4144cf={};_0x4144cf[_0xa1eb('0x3f')]=_[_0xa1eb('0x42')](db[_0xa1eb('0x3a')][_0xa1eb('0x3b')]);_0x4144cf[_0xa1eb('0x41')]=_[_0xa1eb('0x42')](_0x2374c0['query']);_0x4144cf[_0xa1eb('0x43')]=_['intersection'](_0x4144cf[_0xa1eb('0x3f')],_0x4144cf['query']);_0x2e0292[_0xa1eb('0x45')]=_[_0xa1eb('0x44')](_0x4144cf[_0xa1eb('0x3f')],qs['fields'](_0x2374c0[_0xa1eb('0x41')][_0xa1eb('0x46')]));_0x2e0292['attributes']=_0x2e0292[_0xa1eb('0x45')][_0xa1eb('0x47')]?_0x2e0292[_0xa1eb('0x45')]:_0x4144cf[_0xa1eb('0x3f')];if(_0x2374c0[_0xa1eb('0x41')][_0xa1eb('0x51')]){_0x2e0292[_0xa1eb('0x52')]=[{'all':!![]}];}_0x2e0292=_[_0xa1eb('0x4f')]({},_0x2e0292,_0x2374c0[_0xa1eb('0x50')]);return db[_0xa1eb('0x3a')][_0xa1eb('0x56')](_0x2e0292)[_0xa1eb('0x1f')](handleEntityNotFound(_0x5a4a0c,null))[_0xa1eb('0x1f')](respondWithResult(_0x5a4a0c,null))[_0xa1eb('0x29')](handleError(_0x5a4a0c,null));};exports[_0xa1eb('0x57')]=function(_0x2ba6c0,_0x168994){if(_0x2ba6c0['body']['id']){delete _0x2ba6c0[_0xa1eb('0x58')]['id'];}return db[_0xa1eb('0x3a')][_0xa1eb('0x56')]({'where':{'id':_0x2ba6c0[_0xa1eb('0x55')]['id']}})[_0xa1eb('0x1f')](handleEntityNotFound(_0x168994,null))[_0xa1eb('0x1f')](saveUpdates(_0x2ba6c0['body'],null))[_0xa1eb('0x1f')](respondWithResult(_0x168994,null))[_0xa1eb('0x29')](handleError(_0x168994,null));};exports[_0xa1eb('0x34')]=function(_0xf9d185,_0xa46d79){return db[_0xa1eb('0x3a')][_0xa1eb('0x56')]({'where':{'id':_0xf9d185['params']['id']}})[_0xa1eb('0x1f')](handleEntityNotFound(_0xa46d79,null))[_0xa1eb('0x1f')](removeEntity(_0xa46d79,null))[_0xa1eb('0x29')](handleError(_0xa46d79,null));};exports[_0xa1eb('0x59')]=function(_0x4c30ad,_0x5af1e6){return db['FaxMessage']['describe']()[_0xa1eb('0x1f')](respondWithResult(_0x5af1e6,null))[_0xa1eb('0x29')](handleError(_0x5af1e6,null));};var interaction_log=require('../../config/logger')(_0xa1eb('0x5a'));exports[_0xa1eb('0x5b')]=function(_0x262b22,_0x167be2,_0x4edf8e){var _0x481d19={'agent':{},'channel':_0xa1eb('0x5c')};if(_0x262b22[_0xa1eb('0x58')]['id']){delete _0x262b22[_0xa1eb('0x58')]['id'];}_0x262b22[_0xa1eb('0x58')][_0xa1eb('0x5d')]=!![];_0x262b22[_0xa1eb('0x58')]['readAt']=moment()['format'](_0xa1eb('0x5e'));_0x262b22['body'][_0xa1eb('0x5f')]=_0x262b22['body'][_0xa1eb('0x5f')]||_0x262b22[_0xa1eb('0x60')]['id'];_0x481d19['agent']['id']=_0x262b22[_0xa1eb('0x58')][_0xa1eb('0x5f')];return db['FaxMessage'][_0xa1eb('0x56')]({'where':{'id':_0x262b22[_0xa1eb('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xa1eb('0x61')],'as':'Contact'}]})[_0xa1eb('0x1f')](handleEntityNotFound(_0x167be2,null))[_0xa1eb('0x1f')](saveUpdates(_0x262b22['body'],null))[_0xa1eb('0x1f')](function(_0x151adf){if(_0x151adf){_0x481d19[_0xa1eb('0x26')]=_0x151adf['get']({'plain':!![]});return db[_0xa1eb('0x62')]['find']({'where':{'id':_0x151adf[_0xa1eb('0x63')]}});}return null;})[_0xa1eb('0x1f')](handleEntityNotFound(_0x167be2,null))[_0xa1eb('0x1f')](function(_0x331a80){if(_0x331a80){return _0x331a80[_0xa1eb('0x57')]({'UserId':_0x262b22['body'][_0xa1eb('0x5f')],'read1stAt':_[_0xa1eb('0x64')](_0x331a80[_0xa1eb('0x65')])?moment()['format'](_0xa1eb('0x5e')):undefined});}return null;})['then'](function(_0x4e582c){if(_0x4e582c){_0x481d19['interaction']=_0x4e582c['get']({'plain':!![]});interaction_log[_0xa1eb('0x27')](_0xa1eb('0x66'),_0x262b22[_0xa1eb('0x60')]['id'],_0x262b22[_0xa1eb('0x60')][_0xa1eb('0x37')],_0x262b22[_0xa1eb('0x60')][_0xa1eb('0x67')],_0x481d19[_0xa1eb('0x68')]['id'],_0x262b22[_0xa1eb('0x58')]?JSON[_0xa1eb('0x24')](_0x262b22['body']):_0xa1eb('0x69'));return respondWithRpcPromise(_0xa1eb('0x6a'),_0xa1eb('0x6b'),_0x481d19);}return null;})[_0xa1eb('0x1f')](function(_0x1a9afe){if(_0x1a9afe){if(_0x262b22[_0xa1eb('0x58')]['manual']){_0x481d19[_0xa1eb('0x26')][_0xa1eb('0x6c')]=util[_0xa1eb('0x6d')]('SIP/%s',_0x262b22[_0xa1eb('0x60')][_0xa1eb('0x37')]);_0x481d19[_0xa1eb('0x26')][_0xa1eb('0x6e')]=_0x481d19[_0xa1eb('0x6e')];_0x481d19['message'][_0xa1eb('0x6f')]='accept';return respondWithRpcPromise(_0xa1eb('0x70'),'EventManager',{'event':_0xa1eb('0x71'),'message':_0x481d19[_0xa1eb('0x26')]},client9002)[_0xa1eb('0x1f')](function(){return _0x481d19;});}return _0x481d19;}return null;})[_0xa1eb('0x1f')](respondWithResult(_0x167be2,null))['catch'](handleError(_0x167be2,null));};var interaction_log=require(_0xa1eb('0x72'))(_0xa1eb('0x5a'));exports[_0xa1eb('0x32')]=function(_0x293f74,_0x49824a,_0x324922){var _0x30bd95={'agent':{},'channel':_0xa1eb('0x5c')};if(_0x293f74[_0xa1eb('0x58')]['id']){delete _0x293f74[_0xa1eb('0x58')]['id'];}_0x293f74[_0xa1eb('0x58')][_0xa1eb('0x5f')]=_0x293f74[_0xa1eb('0x58')][_0xa1eb('0x5f')]||_0x293f74['user']['id'];_0x30bd95['agent']['id']=_0x293f74['body'][_0xa1eb('0x5f')];return db['FaxMessage'][_0xa1eb('0x56')]({'where':{'id':_0x293f74[_0xa1eb('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x49824a,null))['then'](function(_0xdcaac3){if(_0xdcaac3){_0x30bd95[_0xa1eb('0x26')]=_0xdcaac3[_0xa1eb('0x73')]({'plain':!![]});return db[_0xa1eb('0x62')][_0xa1eb('0x56')]({'where':{'id':_0xdcaac3['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x49824a,null))[_0xa1eb('0x1f')](function(_0x212e57){if(_0x212e57){_0x30bd95[_0xa1eb('0x68')]=_0x212e57[_0xa1eb('0x73')]({'plain':!![]});interaction_log['info'](_0xa1eb('0x74'),_0x293f74[_0xa1eb('0x60')]['id'],_0x293f74[_0xa1eb('0x60')][_0xa1eb('0x37')],_0x293f74[_0xa1eb('0x60')][_0xa1eb('0x67')],_0x30bd95[_0xa1eb('0x68')]['id'],_0x293f74[_0xa1eb('0x58')]?JSON[_0xa1eb('0x24')](_0x293f74[_0xa1eb('0x58')]):_0xa1eb('0x69'));return respondWithRpcPromise('RejectMessage',_0xa1eb('0x75'),_0x30bd95);}return null;})[_0xa1eb('0x1f')](function(_0x4721b4){if(_0x4721b4){_0x4721b4[_0xa1eb('0x26')][_0xa1eb('0x6c')]=util[_0xa1eb('0x6d')]('SIP/%s',_0x293f74[_0xa1eb('0x60')][_0xa1eb('0x37')]);_0x4721b4[_0xa1eb('0x26')][_0xa1eb('0x6e')]=_0x30bd95['channel'];_0x4721b4['message'][_0xa1eb('0x6f')]='reject';respondWithRpcPromise(_0xa1eb('0x70'),_0xa1eb('0x70'),{'event':'rejectmessage','message':_0x4721b4[_0xa1eb('0x26')]},client9002);return _0x30bd95;}return null;})[_0xa1eb('0x1f')](respondWithResult(_0x49824a,null))['catch'](handleError(_0x49824a,null));};exports[_0xa1eb('0x76')]=function(_0x3a6be1,_0x3dc3bf){var _0x2d54e9;return db[_0xa1eb('0x3a')][_0xa1eb('0x76')](_0x3a6be1[_0xa1eb('0x58')],{})[_0xa1eb('0x1f')](function(_0x3d32da){_0x2d54e9=_0x3d32da;return db[_0xa1eb('0x61')][_0xa1eb('0x77')]({'where':{'id':_0x2d54e9['ContactId']}});})[_0xa1eb('0x1f')](function(_0x394af7){if(_[_0xa1eb('0x64')](_0x394af7)){return;}else{_0x2d54e9[_0xa1eb('0x5c')]=_0x394af7['fax'];return db[_0xa1eb('0x78')][_0xa1eb('0x77')]({'where':{'id':_0x2d54e9[_0xa1eb('0x79')]}});}})['then'](function(_0x214913){return respondWithRpcPromise(_0xa1eb('0x7a'),_0xa1eb('0x7a'),{'FaxAccountId':_['isNil'](_0x3a6be1[_0xa1eb('0x58')])?undefined:_0x3a6be1['body'][_0xa1eb('0x7b')],'path':_[_0xa1eb('0x64')](_0x214913)?undefined:util[_0xa1eb('0x6d')](_0xa1eb('0x7c'),_0x214913[_0xa1eb('0x7d')]),'fax':_[_0xa1eb('0x64')](_0x2d54e9[_0xa1eb('0x5c')])?undefined:_0x2d54e9[_0xa1eb('0x5c')],'AttachmentId':_0x2d54e9['AttachmentId']},client9002);})[_0xa1eb('0x1f')](respondWithResult(_0x3dc3bf,0xc9))[_0xa1eb('0x29')](handleError(_0x3dc3bf,null));};exports[_0xa1eb('0x7e')]=function(_0x3ae7e1,_0x454320){var _0x4d4df8=path[_0xa1eb('0x7f')](config[_0xa1eb('0x80')],'server',_0xa1eb('0x81'),'attachments');return db['FaxMessage'][_0xa1eb('0x56')]({'where':{'id':_0x3ae7e1[_0xa1eb('0x55')]['id']},'include':[{'model':db['Attachment'],'as':_0xa1eb('0x78')}]})[_0xa1eb('0x1f')](handleEntityNotFound(_0x454320,null))['then'](function(_0xf4b767){if(_0xf4b767){return _0x454320[_0xa1eb('0x7e')](path['join'](_0x4d4df8,_0xf4b767['Attachment'][_0xa1eb('0x7d')]));}})['catch'](handleError(_0x454320,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 0717d8c..1675991 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 _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x55ca,0x126));var _0xa55c=function(_0x161ac3,_0x142e49){_0x161ac3=_0x161ac3-0x0;var _0x3bb837=_0x55ca[_0x161ac3];return _0x3bb837;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var FaxMessage=require(_0xa55c('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){FaxMessageEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);FaxMessageEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];FaxMessage[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x2915c4,_0x42443d){var _0x1e079e=function(_0x5a6689){while(--_0x5a6689){_0x2915c4['push'](_0x2915c4['shift']());}};_0x1e079e(++_0x42443d);}(_0x008c,0x188));var _0xc008=function(_0x4b2ed7,_0x5b3100){_0x4b2ed7=_0x4b2ed7-0x0;var _0x55a953=_0x008c[_0x4b2ed7];return _0x55a953;};'use strict';var EventEmitter=require(_0xc008('0x0'));var FaxMessage=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){FaxMessageEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);FaxMessageEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];FaxMessage[_0xc008('0x8')](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 a7dbb9f..4c290cc 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 _0x81cc=['secret','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','api','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x81cc,0xaa));var _0xc81c=function(_0x2e7007,_0x41ffa9){_0x2e7007=_0x2e7007-0x0;var _0x2d353a=_0x81cc[_0x2e7007];return _0x2d353a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc81c('0x0'));var moment=require(_0xc81c('0x1'));var BPromise=require(_0xc81c('0x2'));var rp=require(_0xc81c('0x3'));var fs=require('fs');var path=require(_0xc81c('0x4'));var rimraf=require('rimraf');var config=require(_0xc81c('0x5'));var attributes=require(_0xc81c('0x6'));module[_0xc81c('0x7')]=function(_0x1a4cbf,_0x4556e8){return _0x1a4cbf[_0xc81c('0x8')](_0xc81c('0x9'),attributes,{'tableName':_0xc81c('0xa'),'paranoid':![],'indexes':[{'name':_0xc81c('0xb'),'fields':[_0xc81c('0xc')],'type':_0xc81c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x558b24,_0x2fc817,_0x26a172){var _0x29cfc5=_0x1a4cbf[_0xc81c('0xe')];var _0x444318=_0x558b24[_0xc81c('0xf')]({'plain':!![]});if(_0x444318['direction']['toLowerCase']()==='in'||_0x444318[_0xc81c('0x10')][_0xc81c('0x11')]()===_0xc81c('0x12')&&!_0x444318[_0xc81c('0x13')]&&!_['isNil'](_0x444318[_0xc81c('0x14')])){_0x29cfc5[_0xc81c('0x15')]['findOne']({'where':{'id':_0x444318[_0xc81c('0x16')]}})[_0xc81c('0x17')](function(_0x536ae6){if(_0x536ae6){_0x536ae6[_0xc81c('0x18')]({'lastMsgAt':_0x444318[_0xc81c('0x19')],'lastMsgDirection':_0x444318[_0xc81c('0x10')][_0xc81c('0x11')]()});}})[_0xc81c('0x1a')](function(_0x4caf54){console['error'](_0x4caf54);});}_0x26a172();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6730=['utf8mb4_unicode_ci','api','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','direction','toLowerCase','error','utf8mb4'];(function(_0x2f26ab,_0x2f1f10){var _0x42024c=function(_0x4fab05){while(--_0x4fab05){_0x2f26ab['push'](_0x2f26ab['shift']());}};_0x42024c(++_0x2f1f10);}(_0x6730,0xe1));var _0x0673=function(_0xb36c53,_0x5e0101){_0xb36c53=_0xb36c53-0x0;var _0x22e801=_0x6730[_0xb36c53];return _0x22e801;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0673('0x0'));var moment=require('moment');var BPromise=require(_0x0673('0x1'));var rp=require(_0x0673('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0673('0x3'));var config=require(_0x0673('0x4'));var attributes=require(_0x0673('0x5'));module[_0x0673('0x6')]=function(_0x455309,_0x52e4d3){return _0x455309[_0x0673('0x7')](_0x0673('0x8'),attributes,{'tableName':_0x0673('0x9'),'paranoid':![],'indexes':[{'name':_0x0673('0xa'),'fields':[_0x0673('0xb')],'type':_0x0673('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x441fac,_0x3fa38a,_0x592efb){var _0x16e6ad=_0x455309[_0x0673('0xd')];var _0x4919d0=_0x441fac['get']({'plain':!![]});if(_0x4919d0['direction']['toLowerCase']()==='in'||_0x4919d0['direction']['toLowerCase']()==='out'&&!_0x4919d0[_0x0673('0xe')]&&!_[_0x0673('0xf')](_0x4919d0[_0x0673('0x10')])){_0x16e6ad[_0x0673('0x11')][_0x0673('0x12')]({'where':{'id':_0x4919d0[_0x0673('0x13')]}})[_0x0673('0x14')](function(_0x4f8bc2){if(_0x4f8bc2){_0x4f8bc2[_0x0673('0x15')]({'lastMsgAt':_0x4919d0[_0x0673('0x16')],'lastMsgDirection':_0x4919d0[_0x0673('0x17')][_0x0673('0x18')]()});}})['catch'](function(_0x164d08){console[_0x0673('0x19')](_0x164d08);});}_0x592efb();}},'charset':_0x0673('0x1a'),'collate':_0x0673('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index a0c5587..41dfe83 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 _0x6a6c=['debug','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','CreateFaxMessage','FaxMessage','create','options','raw'];(function(_0x14d2ce,_0x55f131){var _0x54516d=function(_0x18db10){while(--_0x18db10){_0x14d2ce['push'](_0x14d2ce['shift']());}};_0x54516d(++_0x55f131);}(_0x6a6c,0x83));var _0xc6a6=function(_0x463681,_0x588505){_0x463681=_0x463681-0x0;var _0xf614b2=_0x6a6c[_0x463681];return _0xf614b2;};'use strict';var _=require(_0xc6a6('0x0'));var util=require(_0xc6a6('0x1'));var moment=require(_0xc6a6('0x2'));var BPromise=require(_0xc6a6('0x3'));var rs=require(_0xc6a6('0x4'));var fs=require('fs');var Redis=require(_0xc6a6('0x5'));var db=require(_0xc6a6('0x6'))['db'];var utils=require(_0xc6a6('0x7'));var logger=require(_0xc6a6('0x8'))(_0xc6a6('0x9'));var config=require(_0xc6a6('0xa'));var jayson=require(_0xc6a6('0xb'));var client=jayson[_0xc6a6('0xc')][_0xc6a6('0xd')]({'port':0x232a});config[_0xc6a6('0xe')]=_[_0xc6a6('0xf')](config[_0xc6a6('0xe')],{'host':_0xc6a6('0x10'),'port':0x18eb});var socket=require(_0xc6a6('0x11'))(new Redis(config[_0xc6a6('0xe')]));require(_0xc6a6('0x12'))[_0xc6a6('0x13')](socket);function respondWithRpcPromise(_0x146260,_0x42a05f,_0x15f357){return new BPromise(function(_0x2ae8cf,_0x4beb69){return client[_0xc6a6('0x14')](_0x146260,_0x15f357)[_0xc6a6('0x15')](function(_0x4847ba){logger['info'](_0xc6a6('0x16'),_0x42a05f,'request\x20sent');logger['debug'](_0xc6a6('0x17'),_0x42a05f,'request\x20sent',JSON[_0xc6a6('0x18')](_0x4847ba));if(_0x4847ba[_0xc6a6('0x19')]){if(_0x4847ba[_0xc6a6('0x19')][_0xc6a6('0x1a')]===0x1f4){logger[_0xc6a6('0x19')]('FaxMessage,\x20%s,\x20%s',_0x42a05f,_0x4847ba[_0xc6a6('0x19')]['message']);return _0x4beb69(_0x4847ba[_0xc6a6('0x19')]['message']);}logger['error'](_0xc6a6('0x16'),_0x42a05f,_0x4847ba['error'][_0xc6a6('0x1b')]);return _0x2ae8cf(_0x4847ba[_0xc6a6('0x19')][_0xc6a6('0x1b')]);}else{logger[_0xc6a6('0x1c')]('FaxMessage,\x20%s,\x20%s',_0x42a05f,_0xc6a6('0x1d'));_0x2ae8cf(_0x4847ba[_0xc6a6('0x1e')][_0xc6a6('0x1b')]);}})[_0xc6a6('0x1f')](function(_0x1c09b2){logger[_0xc6a6('0x19')](_0xc6a6('0x16'),_0x42a05f,_0x1c09b2);_0x4beb69(_0x1c09b2);});});}exports[_0xc6a6('0x20')]=function(_0x5ee826){var _0x2756c5=this;return new Promise(function(_0x36a838,_0x1eaaf9){return db[_0xc6a6('0x21')][_0xc6a6('0x22')](_0x5ee826['body'],{'raw':_0x5ee826['options']?_0x5ee826[_0xc6a6('0x23')][_0xc6a6('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x12c1b3){logger[_0xc6a6('0x1c')](_0xc6a6('0x20'),_0x5ee826);logger[_0xc6a6('0x25')](_0xc6a6('0x20'),_0x5ee826,JSON[_0xc6a6('0x18')](_0x12c1b3));_0x36a838(_0x12c1b3);})[_0xc6a6('0x1f')](function(_0x500f85){logger[_0xc6a6('0x19')](_0xc6a6('0x20'),_0x500f85[_0xc6a6('0x1b')],_0x5ee826);_0x1eaaf9(_0x2756c5['error'](0x1f4,_0x500f85[_0xc6a6('0x1b')]));});});};exports[_0xc6a6('0x26')]=function(_0x457dec){var _0x5ebdfc=this;return new Promise(function(_0x3d9e2e,_0x8d3314){return db[_0xc6a6('0x21')][_0xc6a6('0x27')](_0x457dec['body'],{'raw':_0x457dec['options']?_0x457dec[_0xc6a6('0x23')][_0xc6a6('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x457dec[_0xc6a6('0x23')]?_0x457dec[_0xc6a6('0x23')]['where']||null:null,'attributes':_0x457dec[_0xc6a6('0x23')]?_0x457dec[_0xc6a6('0x23')][_0xc6a6('0x28')]||null:null,'limit':_0x457dec[_0xc6a6('0x23')]?_0x457dec[_0xc6a6('0x23')][_0xc6a6('0x29')]||null:null})['then'](function(_0x12b31e){logger['info'](_0xc6a6('0x26'),_0x457dec);logger['debug']('UpdateFaxMessage',_0x457dec,JSON[_0xc6a6('0x18')](_0x12b31e));_0x3d9e2e(_0x12b31e);})[_0xc6a6('0x1f')](function(_0x518dc4){logger[_0xc6a6('0x19')](_0xc6a6('0x26'),_0x518dc4[_0xc6a6('0x1b')],_0x457dec);_0x8d3314(_0x5ebdfc[_0xc6a6('0x19')](0x1f4,_0x518dc4[_0xc6a6('0x1b')]));});});}; \ No newline at end of file +var _0x8ba5=['../../config/utils','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','create','body','options','raw','update','where','attributes','limit','UpdateFaxMessage','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8ba5,0x8f));var _0x58ba=function(_0x1aae33,_0x110a80){_0x1aae33=_0x1aae33-0x0;var _0x2e91e9=_0x8ba5[_0x1aae33];return _0x2e91e9;};'use strict';var _=require('lodash');var util=require(_0x58ba('0x0'));var moment=require(_0x58ba('0x1'));var BPromise=require(_0x58ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58ba('0x3'));var db=require(_0x58ba('0x4'))['db'];var utils=require(_0x58ba('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x58ba('0x6'));var jayson=require(_0x58ba('0x7'));var client=jayson[_0x58ba('0x8')]['http']({'port':0x232a});config['redis']=_[_0x58ba('0x9')](config['redis'],{'host':_0x58ba('0xa'),'port':0x18eb});var socket=require(_0x58ba('0xb'))(new Redis(config[_0x58ba('0xc')]));require(_0x58ba('0xd'))['register'](socket);function respondWithRpcPromise(_0xe1c094,_0x589234,_0x54ab72){return new BPromise(function(_0x4894b5,_0x331f2d){return client[_0x58ba('0xe')](_0xe1c094,_0x54ab72)[_0x58ba('0xf')](function(_0x496445){logger[_0x58ba('0x10')](_0x58ba('0x11'),_0x589234,_0x58ba('0x12'));logger[_0x58ba('0x13')](_0x58ba('0x14'),_0x589234,_0x58ba('0x12'),JSON[_0x58ba('0x15')](_0x496445));if(_0x496445[_0x58ba('0x16')]){if(_0x496445['error'][_0x58ba('0x17')]===0x1f4){logger[_0x58ba('0x16')](_0x58ba('0x11'),_0x589234,_0x496445['error'][_0x58ba('0x18')]);return _0x331f2d(_0x496445[_0x58ba('0x16')][_0x58ba('0x18')]);}logger[_0x58ba('0x16')](_0x58ba('0x11'),_0x589234,_0x496445[_0x58ba('0x16')][_0x58ba('0x18')]);return _0x4894b5(_0x496445[_0x58ba('0x16')][_0x58ba('0x18')]);}else{logger[_0x58ba('0x10')]('FaxMessage,\x20%s,\x20%s',_0x589234,_0x58ba('0x12'));_0x4894b5(_0x496445[_0x58ba('0x19')][_0x58ba('0x18')]);}})[_0x58ba('0x1a')](function(_0x1ed83e){logger[_0x58ba('0x16')]('FaxMessage,\x20%s,\x20%s',_0x589234,_0x1ed83e);_0x331f2d(_0x1ed83e);});});}exports[_0x58ba('0x1b')]=function(_0x215685){var _0x4f1058=this;return new Promise(function(_0x392633,_0x3af74d){return db['FaxMessage'][_0x58ba('0x1c')](_0x215685[_0x58ba('0x1d')],{'raw':_0x215685[_0x58ba('0x1e')]?_0x215685[_0x58ba('0x1e')][_0x58ba('0x1f')]===undefined?!![]:![]:!![]})[_0x58ba('0xf')](function(_0xb07407){logger['info'](_0x58ba('0x1b'),_0x215685);logger[_0x58ba('0x13')](_0x58ba('0x1b'),_0x215685,JSON[_0x58ba('0x15')](_0xb07407));_0x392633(_0xb07407);})['catch'](function(_0x5e951e){logger[_0x58ba('0x16')](_0x58ba('0x1b'),_0x5e951e['message'],_0x215685);_0x3af74d(_0x4f1058[_0x58ba('0x16')](0x1f4,_0x5e951e[_0x58ba('0x18')]));});});};exports['UpdateFaxMessage']=function(_0xa7419b){var _0x1460e6=this;return new Promise(function(_0x5c2377,_0x29517b){return db['FaxMessage'][_0x58ba('0x20')](_0xa7419b[_0x58ba('0x1d')],{'raw':_0xa7419b[_0x58ba('0x1e')]?_0xa7419b[_0x58ba('0x1e')][_0x58ba('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7419b[_0x58ba('0x1e')]?_0xa7419b['options'][_0x58ba('0x21')]||null:null,'attributes':_0xa7419b[_0x58ba('0x1e')]?_0xa7419b[_0x58ba('0x1e')][_0x58ba('0x22')]||null:null,'limit':_0xa7419b['options']?_0xa7419b[_0x58ba('0x1e')][_0x58ba('0x23')]||null:null})[_0x58ba('0xf')](function(_0x6e175f){logger['info']('UpdateFaxMessage',_0xa7419b);logger[_0x58ba('0x13')](_0x58ba('0x24'),_0xa7419b,JSON[_0x58ba('0x15')](_0x6e175f));_0x5c2377(_0x6e175f);})[_0x58ba('0x1a')](function(_0x57f444){logger[_0x58ba('0x16')](_0x58ba('0x24'),_0x57f444['message'],_0xa7419b);_0x29517b(_0x1460e6[_0x58ba('0x16')](0x1f4,_0x57f444['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index cd6df99..1901c32 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 _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file +var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x543c51,_0xff0084){var _0x360555=function(_0x2a0801){while(--_0x2a0801){_0x543c51['push'](_0x543c51['shift']());}};_0x360555(++_0xff0084);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 383d21b..4a5b097 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 _0xdfbe=['post','tracked','fax','faxmessage:create','create','put','/:id','accept','/:id/reject','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/download'];(function(_0x1d1963,_0x32cc0e){var _0x3f58bb=function(_0x514823){while(--_0x514823){_0x1d1963['push'](_0x1d1963['shift']());}};_0x3f58bb(++_0x32cc0e);}(_0xdfbe,0x1ab));var _0xedfb=function(_0xba2b90,_0x591d59){_0xba2b90=_0xba2b90-0x0;var _0x44068e=_0xdfbe[_0xba2b90];return _0x44068e;};'use strict';var multer=require('multer');var util=require(_0xedfb('0x0'));var path=require('path');var timeout=require(_0xedfb('0x1'));var express=require(_0xedfb('0x2'));var router=express[_0xedfb('0x3')]();var fs_extra=require(_0xedfb('0x4'));var auth=require(_0xedfb('0x5'));var interaction=require(_0xedfb('0x6'));var config=require(_0xedfb('0x7'));var controller=require('./faxMessage.controller');router[_0xedfb('0x8')]('/',auth[_0xedfb('0x9')](),controller[_0xedfb('0xa')]);router['get'](_0xedfb('0xb'),auth[_0xedfb('0x9')](),controller[_0xedfb('0xc')]);router[_0xedfb('0x8')]('/:id',auth[_0xedfb('0x9')](),controller[_0xedfb('0xd')]);router[_0xedfb('0x8')](_0xedfb('0xe'),auth[_0xedfb('0x9')](),controller['download']);router[_0xedfb('0xf')]('/',auth['isAuthenticated'](),interaction[_0xedfb('0x10')](_0xedfb('0x11'),_0xedfb('0x12')),controller[_0xedfb('0x13')]);router[_0xedfb('0x14')](_0xedfb('0x15'),auth['isAuthenticated'](),controller['update']);router[_0xedfb('0x14')]('/:id/accept',auth[_0xedfb('0x9')](),controller[_0xedfb('0x16')]);router['put'](_0xedfb('0x17'),auth[_0xedfb('0x9')](),controller['reject']);router['delete'](_0xedfb('0x15'),auth[_0xedfb('0x9')](),controller[_0xedfb('0x18')]);module[_0xedfb('0x19')]=router; \ No newline at end of file +var _0x4c29=['post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x5b59ff,_0x3e830a){var _0x5f5604=function(_0x4193ab){while(--_0x4193ab){_0x5b59ff['push'](_0x5b59ff['shift']());}};_0x5f5604(++_0x3e830a);}(_0x4c29,0x16a));var _0x94c2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4c29[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x94c2('0x0'));var util=require(_0x94c2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x94c2('0x2'));var router=express['Router']();var fs_extra=require(_0x94c2('0x3'));var auth=require(_0x94c2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x94c2('0x5'));var controller=require(_0x94c2('0x6'));router['get']('/',auth[_0x94c2('0x7')](),controller['index']);router[_0x94c2('0x8')](_0x94c2('0x9'),auth['isAuthenticated'](),controller[_0x94c2('0xa')]);router[_0x94c2('0x8')](_0x94c2('0xb'),auth[_0x94c2('0x7')](),controller[_0x94c2('0xc')]);router[_0x94c2('0x8')]('/:id/download',auth[_0x94c2('0x7')](),controller['download']);router[_0x94c2('0xd')]('/',auth[_0x94c2('0x7')](),interaction[_0x94c2('0xe')](_0x94c2('0xf'),_0x94c2('0x10')),controller[_0x94c2('0x11')]);router[_0x94c2('0x12')](_0x94c2('0xb'),auth[_0x94c2('0x7')](),controller[_0x94c2('0x13')]);router['put'](_0x94c2('0x14'),auth[_0x94c2('0x7')](),controller[_0x94c2('0x15')]);router[_0x94c2('0x12')](_0x94c2('0x16'),auth[_0x94c2('0x7')](),controller[_0x94c2('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x94c2('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index d592cab..6dd86bf 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 _0x13ad=['rrmemory','roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13ad,0x142));var _0xd13a=function(_0x330e5e,_0x14b1d7){_0x330e5e=_0x330e5e-0x0;var _0xfdb9d6=_0x13ad[_0x330e5e];return _0xfdb9d6;};'use strict';var Sequelize=require(_0xd13a('0x0'));module[_0xd13a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd13a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd13a('0x3')]},'timeout':{'type':Sequelize[_0xd13a('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd13a('0x5')](_0xd13a('0x6'),'beepall',_0xd13a('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xd13a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd517=['INTEGER','sequelize','exports','STRING','name','ENUM','roundrobin'];(function(_0xd637a3,_0x19b904){var _0x180a84=function(_0x2fc05a){while(--_0x2fc05a){_0xd637a3['push'](_0xd637a3['shift']());}};_0x180a84(++_0x19b904);}(_0xd517,0x1dd));var _0x7d51=function(_0x58cbde,_0x4b0f62){_0x58cbde=_0x58cbde-0x0;var _0x5799f3=_0xd517[_0x58cbde];return _0x5799f3;};'use strict';var Sequelize=require(_0x7d51('0x0'));module[_0x7d51('0x1')]={'name':{'type':Sequelize[_0x7d51('0x2')],'unique':_0x7d51('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7d51('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7d51('0x4')]('rrmemory','beepall',_0x7d51('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7d51('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index d72b7ed..ca5075a 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 _0xafdd=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','index','map','FaxQueue','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserFaxQueue','hasOwnProperty','FaxQueueId','agent','updatedAt','createdAt','rows','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','removeTeams','User','select','tq.TeamId','from','team_has_fax_queues','join','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeAgents','emit','userFaxQueue:remove','addAgents','spread','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x1845a0,_0x500431){var _0x2de0bc=function(_0x1e779e){while(--_0x1e779e){_0x1845a0['push'](_0x1845a0['shift']());}};_0x2de0bc(++_0x500431);}(_0xafdd,0x19a));var _0xdafd=function(_0x1c7dd5,_0x56ae30){_0x1c7dd5=_0x1c7dd5-0x0;var _0x2714ba=_0xafdd[_0x1c7dd5];return _0x2714ba;};'use strict';var emlformat=require(_0xdafd('0x0'));var rimraf=require(_0xdafd('0x1'));var zipdir=require(_0xdafd('0x2'));var jsonpatch=require(_0xdafd('0x3'));var rp=require(_0xdafd('0x4'));var moment=require(_0xdafd('0x5'));var BPromise=require(_0xdafd('0x6'));var Mustache=require(_0xdafd('0x7'));var util=require('util');var path=require(_0xdafd('0x8'));var sox=require(_0xdafd('0x9'));var csv=require(_0xdafd('0xa'));var ejs=require(_0xdafd('0xb'));var fs=require('fs');var fs_extra=require(_0xdafd('0xc'));var _=require(_0xdafd('0xd'));var squel=require(_0xdafd('0xe'));var crypto=require('crypto');var jsforce=require(_0xdafd('0xf'));var deskjs=require(_0xdafd('0x10'));var toCsv=require(_0xdafd('0xa'));var querystring=require('querystring');var Papa=require(_0xdafd('0x11'));var Redis=require(_0xdafd('0x12'));var authService=require(_0xdafd('0x13'));var qs=require(_0xdafd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdafd('0x15'));var logger=require(_0xdafd('0x16'))(_0xdafd('0x17'));var utils=require(_0xdafd('0x18'));var config=require(_0xdafd('0x19'));var licenseUtil=require(_0xdafd('0x1a'));var db=require('../../mysqldb')['db'];config[_0xdafd('0x1b')]=_['defaults'](config['redis'],{'host':_0xdafd('0x1c'),'port':0x18eb});var socket=require(_0xdafd('0x1d'))(new Redis(config['redis']));require(_0xdafd('0x1e'))['register'](socket);function respondWithStatusCode(_0x4b09da,_0x1c312d){_0x1c312d=_0x1c312d||0xcc;return function(_0x14b895){if(_0x14b895){return _0x4b09da[_0xdafd('0x1f')](_0x1c312d);}return _0x4b09da[_0xdafd('0x20')](_0x1c312d)[_0xdafd('0x21')]();};}function respondWithResult(_0x496515,_0x47240f){_0x47240f=_0x47240f||0xc8;return function(_0x1842d3){if(_0x1842d3){return _0x496515[_0xdafd('0x20')](_0x47240f)['json'](_0x1842d3);}};}function respondWithFilteredResult(_0xb382ca,_0x15beca){return function(_0x4fc3a4){if(_0x4fc3a4){var _0x4e6ccc=_0x4fc3a4[_0xdafd('0x22')],_0x2569b2=_0x15beca[_0xdafd('0x23')],_0x5acc78=_0x15beca[_0xdafd('0x23')]+_0x15beca[_0xdafd('0x24')],_0x3556da;if(_0x5acc78>=_0x4e6ccc){_0x5acc78=_0x4e6ccc;_0x3556da=0xc8;}else{_0x3556da=0xce;}_0xb382ca[_0xdafd('0x20')](_0x3556da);return _0xb382ca[_0xdafd('0x25')](_0xdafd('0x26'),_0x2569b2+'-'+_0x5acc78+'/'+_0x4e6ccc)[_0xdafd('0x27')](_0x4fc3a4);}return null;};}function patchUpdates(_0x10c353){return function(_0xee767e){try{jsonpatch[_0xdafd('0x28')](_0xee767e,_0x10c353,!![]);}catch(_0xa6ddd7){return BPromise[_0xdafd('0x29')](_0xa6ddd7);}return _0xee767e['save']();};}function saveUpdates(_0x230495,_0x5127a2){return function(_0x31bcd1){if(_0x31bcd1){return _0x31bcd1['update'](_0x230495)[_0xdafd('0x2a')](function(_0x35ef78){return _0x35ef78;});}return null;};}function removeEntity(_0x7f10f6,_0x3d250d){return function(_0xfc36d7){if(_0xfc36d7){return _0xfc36d7[_0xdafd('0x2b')]()[_0xdafd('0x2a')](function(){var _0x30cba9=_0xfc36d7[_0xdafd('0x2c')]({'plain':!![]});var _0x5cd11d=_0xdafd('0x2d');return db[_0xdafd('0x2e')][_0xdafd('0x2b')]({'where':{'type':_0x5cd11d,'resourceId':_0x30cba9['id']}})[_0xdafd('0x2a')](function(){return _0xfc36d7;});})[_0xdafd('0x2a')](function(){_0x7f10f6[_0xdafd('0x20')](0xcc)[_0xdafd('0x21')]();});}};}function handleEntityNotFound(_0x29037e,_0x1c7083){return function(_0x18dd7a){if(!_0x18dd7a){_0x29037e['sendStatus'](0x194);}return _0x18dd7a;};}function handleError(_0x243182,_0x14626b){_0x14626b=_0x14626b||0x1f4;return function(_0x13ab81){logger[_0xdafd('0x2f')](_0x13ab81[_0xdafd('0x30')]);if(_0x13ab81[_0xdafd('0x31')]){delete _0x13ab81['name'];}_0x243182['status'](_0x14626b)['send'](_0x13ab81);};}exports[_0xdafd('0x32')]=function(_0xdb822e,_0x568996){var _0x4f6cb1={},_0x4172ea={},_0x3e7b4d={'count':0x0,'rows':[]};var _0x432210=_[_0xdafd('0x33')](db[_0xdafd('0x34')][_0xdafd('0x35')],function(_0x3e1287){return{'name':_0x3e1287['fieldName'],'type':_0x3e1287[_0xdafd('0x36')][_0xdafd('0x37')]};});_0x4172ea[_0xdafd('0x38')]=_['map'](_0x432210,_0xdafd('0x31'));_0x4172ea[_0xdafd('0x39')]=_['keys'](_0xdb822e[_0xdafd('0x39')]);_0x4172ea[_0xdafd('0x3a')]=_[_0xdafd('0x3b')](_0x4172ea['model'],_0x4172ea[_0xdafd('0x39')]);_0x4f6cb1[_0xdafd('0x3c')]=_[_0xdafd('0x3b')](_0x4172ea[_0xdafd('0x38')],qs[_0xdafd('0x3d')](_0xdb822e[_0xdafd('0x39')][_0xdafd('0x3d')]));_0x4f6cb1['attributes']=_0x4f6cb1[_0xdafd('0x3c')][_0xdafd('0x3e')]?_0x4f6cb1[_0xdafd('0x3c')]:_0x4172ea[_0xdafd('0x38')];if(!_0xdb822e[_0xdafd('0x39')]['hasOwnProperty'](_0xdafd('0x3f'))){_0x4f6cb1[_0xdafd('0x24')]=qs['limit'](_0xdb822e[_0xdafd('0x39')][_0xdafd('0x24')]);_0x4f6cb1[_0xdafd('0x23')]=qs[_0xdafd('0x23')](_0xdb822e[_0xdafd('0x39')][_0xdafd('0x23')]);}_0x4f6cb1[_0xdafd('0x40')]=qs[_0xdafd('0x41')](_0xdb822e[_0xdafd('0x39')][_0xdafd('0x41')]);_0x4f6cb1[_0xdafd('0x42')]=qs[_0xdafd('0x3a')](_[_0xdafd('0x43')](_0xdb822e[_0xdafd('0x39')],_0x4172ea[_0xdafd('0x3a')]),_0x432210);if(_0xdb822e[_0xdafd('0x39')][_0xdafd('0x44')]){_0x4f6cb1[_0xdafd('0x42')]=_[_0xdafd('0x45')](_0x4f6cb1[_0xdafd('0x42')],{'$or':_[_0xdafd('0x33')](_0x432210,function(_0x2605d2){if(_0x2605d2[_0xdafd('0x36')]!==_0xdafd('0x46')){var _0x46f65e={};_0x46f65e[_0x2605d2[_0xdafd('0x31')]]={'$like':'%'+_0xdb822e['query']['filter']+'%'};return _0x46f65e;}})});}_0x4f6cb1=_[_0xdafd('0x45')]({},_0x4f6cb1,_0xdb822e['options']);var _0x12d1ab={'where':_0x4f6cb1[_0xdafd('0x42')]};return db['FaxQueue']['count'](_0x12d1ab)[_0xdafd('0x2a')](function(_0x3382d3){_0x3e7b4d[_0xdafd('0x22')]=_0x3382d3;if(_0xdb822e[_0xdafd('0x39')][_0xdafd('0x47')]){_0x4f6cb1[_0xdafd('0x48')]=[{'all':!![]}];}return db[_0xdafd('0x34')][_0xdafd('0x49')](_0x4f6cb1);})[_0xdafd('0x2a')](function(_0x4bc176){_0x3e7b4d['rows']=_0x4bc176;return _0x3e7b4d;})[_0xdafd('0x2a')](respondWithFilteredResult(_0x568996,_0x4f6cb1))[_0xdafd('0x4a')](handleError(_0x568996,null));};exports[_0xdafd('0x4b')]=function(_0x42aa6c,_0x3bd35b){var _0x2d93b6={'raw':!![],'where':{'id':_0x42aa6c[_0xdafd('0x4c')]['id']}},_0x2b8b47={};_0x2b8b47[_0xdafd('0x38')]=_[_0xdafd('0x4d')](db[_0xdafd('0x34')][_0xdafd('0x35')]);_0x2b8b47[_0xdafd('0x39')]=_['keys'](_0x42aa6c[_0xdafd('0x39')]);_0x2b8b47['filters']=_[_0xdafd('0x3b')](_0x2b8b47['model'],_0x2b8b47[_0xdafd('0x39')]);_0x2d93b6[_0xdafd('0x3c')]=_[_0xdafd('0x3b')](_0x2b8b47[_0xdafd('0x38')],qs[_0xdafd('0x3d')](_0x42aa6c[_0xdafd('0x39')]['fields']));_0x2d93b6[_0xdafd('0x3c')]=_0x2d93b6[_0xdafd('0x3c')][_0xdafd('0x3e')]?_0x2d93b6[_0xdafd('0x3c')]:_0x2b8b47[_0xdafd('0x38')];if(_0x42aa6c['query']['includeAll']){_0x2d93b6[_0xdafd('0x48')]=[{'all':!![]}];}_0x2d93b6=_[_0xdafd('0x45')]({},_0x2d93b6,_0x42aa6c[_0xdafd('0x4e')]);return db[_0xdafd('0x34')][_0xdafd('0x4f')](_0x2d93b6)[_0xdafd('0x2a')](handleEntityNotFound(_0x3bd35b,null))[_0xdafd('0x2a')](respondWithResult(_0x3bd35b,null))[_0xdafd('0x4a')](handleError(_0x3bd35b,null));};exports[_0xdafd('0x50')]=function(_0x5058b1,_0x6f2f39){return db[_0xdafd('0x34')][_0xdafd('0x50')](_0x5058b1[_0xdafd('0x51')],{})['then'](function(_0xf8fcb8){var _0x343ef5=_0x5058b1[_0xdafd('0x52')][_0xdafd('0x2c')]({'plain':!![]});if(!_0x343ef5)throw new Error(_0xdafd('0x53'));if(_0x343ef5['role']==='user'){var _0xc1dadb=_0xf8fcb8[_0xdafd('0x2c')]({'plain':!![]});var _0x5a145e='FaxQueues';return db[_0xdafd('0x54')][_0xdafd('0x4f')]({'where':{'name':_0x5a145e,'userProfileId':_0x343ef5['userProfileId']},'raw':!![]})[_0xdafd('0x2a')](function(_0x5dc9a0){if(_0x5dc9a0&&_0x5dc9a0[_0xdafd('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0xc1dadb[_0xdafd('0x31')],'resourceId':_0xc1dadb['id'],'type':_0x5dc9a0[_0xdafd('0x31')],'sectionId':_0x5dc9a0['id']},{})['then'](function(){return _0xf8fcb8;});}else{return _0xf8fcb8;}})[_0xdafd('0x4a')](function(_0x4e10ce){logger['error'](_0xdafd('0x56'),_0x4e10ce);throw _0x4e10ce;});}return _0xf8fcb8;})[_0xdafd('0x2a')](respondWithResult(_0x6f2f39,0xc9))[_0xdafd('0x4a')](handleError(_0x6f2f39,null));};exports[_0xdafd('0x57')]=function(_0x150fe1,_0x307f35){if(_0x150fe1[_0xdafd('0x51')]['id']){delete _0x150fe1[_0xdafd('0x51')]['id'];}return db['FaxQueue'][_0xdafd('0x4f')]({'where':{'id':_0x150fe1[_0xdafd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x307f35,null))[_0xdafd('0x2a')](saveUpdates(_0x150fe1[_0xdafd('0x51')],null))[_0xdafd('0x2a')](respondWithResult(_0x307f35,null))[_0xdafd('0x4a')](handleError(_0x307f35,null));};exports[_0xdafd('0x2b')]=function(_0x556f7e,_0x464e49){return db[_0xdafd('0x34')][_0xdafd('0x4f')]({'where':{'id':_0x556f7e[_0xdafd('0x4c')]['id']}})[_0xdafd('0x2a')](handleEntityNotFound(_0x464e49,null))['then'](removeEntity(_0x464e49,null))[_0xdafd('0x4a')](handleError(_0x464e49,null));};exports[_0xdafd('0x58')]=function(_0x55284e,_0x4f3059){return db[_0xdafd('0x34')]['describe']()[_0xdafd('0x2a')](respondWithResult(_0x4f3059,null))['catch'](handleError(_0x4f3059,null));};exports[_0xdafd('0x59')]=function(_0x12c412,_0x403a3b,_0x589664){var _0xf2f551={'raw':!![],'where':{}},_0x5210be={},_0xf9cc85;return db[_0xdafd('0x34')]['findOne']({'where':{'id':_0x12c412[_0xdafd('0x4c')]['id']}})[_0xdafd('0x2a')](handleEntityNotFound(_0x403a3b,null))[_0xdafd('0x2a')](function(_0x223190){if(_0x223190){_0xf9cc85=_0x223190[_0xdafd('0x2c')]({'plain':!![]});_0x5210be['model']=_[_0xdafd('0x4d')](db[_0xdafd('0x5a')]['rawAttributes']);_0x5210be[_0xdafd('0x39')]=_[_0xdafd('0x4d')](_0x12c412[_0xdafd('0x39')]);_0x5210be[_0xdafd('0x3a')]=_[_0xdafd('0x3b')](_0x5210be['model'],_0x5210be[_0xdafd('0x39')]);_0xf2f551['attributes']=_['intersection'](_0x5210be[_0xdafd('0x38')],qs['fields'](_0x12c412[_0xdafd('0x39')][_0xdafd('0x3d')]));_0xf2f551[_0xdafd('0x3c')]=_0xf2f551[_0xdafd('0x3c')]['length']?_0xf2f551[_0xdafd('0x3c')]:_0x5210be[_0xdafd('0x38')];if(!_0x12c412[_0xdafd('0x39')][_0xdafd('0x5b')](_0xdafd('0x3f'))){_0xf2f551[_0xdafd('0x24')]=qs[_0xdafd('0x24')](_0x12c412[_0xdafd('0x39')][_0xdafd('0x24')]);_0xf2f551[_0xdafd('0x23')]=qs[_0xdafd('0x23')](_0x12c412[_0xdafd('0x39')][_0xdafd('0x23')]);}_0xf2f551[_0xdafd('0x40')]=qs[_0xdafd('0x41')](_0x12c412[_0xdafd('0x39')][_0xdafd('0x41')]);_0xf2f551['where']=qs[_0xdafd('0x3a')](_['pick'](_0x12c412[_0xdafd('0x39')],_0x5210be['filters']));_0xf2f551[_0xdafd('0x42')][_0xdafd('0x5c')]=_0x223190['id'];if(_0x12c412['query']['filter']){_0xf2f551[_0xdafd('0x42')]=_[_0xdafd('0x45')](_0xf2f551[_0xdafd('0x42')],{'$or':_['map'](_0xf2f551['attributes'],function(_0x4f6bbb){var _0xfe8337={};_0xfe8337[_0x4f6bbb]={'$like':'%'+_0x12c412['query'][_0xdafd('0x44')]+'%'};return _0xfe8337;})});}_0xf2f551=_['merge']({},_0xf2f551,_0x12c412[_0xdafd('0x4e')]);return db[_0xdafd('0x5a')][_0xdafd('0x49')](_0xf2f551);}})[_0xdafd('0x2a')](function(_0x3f64fe){if(_0x3f64fe){return db['User']['findAndCountAll']({'where':{'id':_[_0xdafd('0x33')](_0x3f64fe,'UserId'),'role':_0xdafd('0x5d')},'attributes':['id',_0xdafd('0x31'),'faxPause',_0xdafd('0x5e'),_0xdafd('0x5f')]});}})[_0xdafd('0x2a')](function(_0x2524b5){if(_0x2524b5){return{'count':_0x2524b5[_0xdafd('0x22')],'rows':_[_0xdafd('0x33')](_0x2524b5[_0xdafd('0x60')],function(_0x1255bb){return{'membername':_0x1255bb['name'],'UserId':_0x1255bb['id'],'queue_name':_0xf9cc85[_0xdafd('0x31')],'FaxQueueId':_0xf9cc85['id'],'interface':util[_0xdafd('0x61')]('%s/%s',_0xdafd('0x62'),_0x1255bb[_0xdafd('0x31')]),'penalty':0x0,'paused':_0x1255bb['faxPause'],'createdAt':_0x1255bb[_0xdafd('0x5f')],'updatedAt':_0x1255bb[_0xdafd('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x403a3b,_0xf2f551))[_0xdafd('0x4a')](handleError(_0x403a3b,null));};exports[_0xdafd('0x63')]=function(_0x1e47bf,_0x547571,_0x1a0f40){var _0xb4166f={};var _0x406001={};var _0x2ee557;var _0x4ad46f;return db['FaxQueue'][_0xdafd('0x64')]({'where':{'id':_0x1e47bf[_0xdafd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x547571,null))[_0xdafd('0x2a')](function(_0x3d3862){if(_0x3d3862){_0x2ee557=_0x3d3862;_0x406001[_0xdafd('0x38')]=_[_0xdafd('0x4d')](db[_0xdafd('0x65')][_0xdafd('0x35')]);_0x406001['query']=_[_0xdafd('0x4d')](_0x1e47bf[_0xdafd('0x39')]);_0x406001['filters']=_[_0xdafd('0x3b')](_0x406001[_0xdafd('0x38')],_0x406001[_0xdafd('0x39')]);_0xb4166f[_0xdafd('0x3c')]=_[_0xdafd('0x3b')](_0x406001[_0xdafd('0x38')],qs[_0xdafd('0x3d')](_0x1e47bf[_0xdafd('0x39')][_0xdafd('0x3d')]));_0xb4166f[_0xdafd('0x3c')]=_0xb4166f[_0xdafd('0x3c')]['length']?_0xb4166f[_0xdafd('0x3c')]:_0x406001[_0xdafd('0x38')];_0xb4166f[_0xdafd('0x40')]=qs[_0xdafd('0x41')](_0x1e47bf[_0xdafd('0x39')][_0xdafd('0x41')]);_0xb4166f[_0xdafd('0x42')]=qs[_0xdafd('0x3a')](_[_0xdafd('0x43')](_0x1e47bf[_0xdafd('0x39')],_0x406001[_0xdafd('0x3a')]));if(_0x1e47bf['query'][_0xdafd('0x44')]){_0xb4166f[_0xdafd('0x42')]=_['merge'](_0xb4166f[_0xdafd('0x42')],{'$or':_[_0xdafd('0x33')](_0xb4166f[_0xdafd('0x3c')],function(_0x53e68a){var _0x153578={};_0x153578[_0x53e68a]={'$like':'%'+_0x1e47bf['query'][_0xdafd('0x44')]+'%'};return _0x153578;})});}_0xb4166f=_[_0xdafd('0x45')]({},_0xb4166f,_0x1e47bf['options']);return _0x2ee557[_0xdafd('0x63')](_0xb4166f);}})[_0xdafd('0x2a')](function(_0x2a92d6){if(_0x2a92d6){_0x4ad46f=_0x2a92d6[_0xdafd('0x3e')];if(!_0x1e47bf[_0xdafd('0x39')][_0xdafd('0x5b')](_0xdafd('0x3f'))){_0xb4166f[_0xdafd('0x24')]=qs[_0xdafd('0x24')](_0x1e47bf[_0xdafd('0x39')][_0xdafd('0x24')]);_0xb4166f[_0xdafd('0x23')]=qs['offset'](_0x1e47bf['query'][_0xdafd('0x23')]);}return _0x2ee557[_0xdafd('0x63')](_0xb4166f);}})[_0xdafd('0x2a')](function(_0x39f42d){if(_0x39f42d){return _0x39f42d?{'count':_0x4ad46f,'rows':_0x39f42d}:null;}})[_0xdafd('0x2a')](respondWithResult(_0x547571,null))[_0xdafd('0x4a')](handleError(_0x547571,null));};exports[_0xdafd('0x66')]=function(_0x65ad7b,_0x538449,_0x705220){var _0x368142=_0x65ad7b[_0xdafd('0x51')][_0xdafd('0x67')];return db['Team']['findAll']({'where':{'id':_0x368142},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdafd('0x68'),'attributes':['id','name',_0xdafd('0x69'),_0xdafd('0x6a'),_0xdafd('0x6b')],'raw':!![]}]})[_0xdafd('0x2a')](function(_0x4ff7d5){if(_0x4ff7d5){var _0xed0633=_[_0xdafd('0x6c')](_0x4ff7d5,function(_0x1a3652){var _0x1243e5=_0x1a3652[_0xdafd('0x2c')]({'plain':!![]});return _0x1243e5['Agents'];});return db[_0xdafd('0x34')]['find']({'where':{'id':_0x65ad7b[_0xdafd('0x4c')]['id']}})[_0xdafd('0x2a')](function(_0x5c82e9){return db[_0xdafd('0x6d')][_0xdafd('0x6e')](function(_0x4d4d66){return _0x5c82e9[_0xdafd('0x66')](_0x368142,{'transaction':_0x4d4d66})[_0xdafd('0x2a')](function(){return BPromise[_0xdafd('0x6f')](_0xed0633,function(_0x54d7db){return db[_0xdafd('0x5a')]['findOrCreate']({'where':{'UserId':_0x54d7db['id'],'FaxQueueId':_0x65ad7b[_0xdafd('0x4c')]['id']},'transaction':_0x4d4d66});});})[_0xdafd('0x2a')](function(){_0xed0633[_0xdafd('0x70')](function(_0x2d5dd4){socket['emit']('userFaxQueue:save',{'UserId':_0x2d5dd4['id'],'FaxQueueId':_0x5c82e9['id']});});});});});}})[_0xdafd('0x2a')](respondWithStatusCode(_0x538449,null))[_0xdafd('0x4a')](handleError(_0x538449,null));};exports[_0xdafd('0x71')]=function(_0x49e087,_0x37b837,_0x2cdcff){return db[_0xdafd('0x65')][_0xdafd('0x49')]({'where':{'id':_0x49e087['query'][_0xdafd('0x67')]},'attributes':['id'],'include':[{'model':db[_0xdafd('0x72')],'as':_0xdafd('0x68'),'attributes':['id'],'raw':!![]}]})[_0xdafd('0x2a')](handleEntityNotFound(_0x37b837,null))['then'](function(_0x2fd239){var _0x342ed1=_['map'](_0x2fd239,'id');var _0xe7595d=[];var _0x2763df=[];var _0x4c910a=squel[_0xdafd('0x73')]();_0x4c910a['field'](_0xdafd('0x74'))[_0xdafd('0x75')](_0xdafd('0x76'),'tq')[_0xdafd('0x77')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdafd('0x42')](_0xdafd('0x78'),_0x49e087['params']['id']);for(var _0x258696=0x0;_0x258696<_0x2fd239[_0xdafd('0x3e')];_0x258696+=0x1){let _0x3b8f4b=_0x2fd239[_0x258696];for(var _0x3c08a6=0x0;_0x3c08a6<_0x3b8f4b['Agents'][_0xdafd('0x3e')];_0x3c08a6+=0x1){let _0x504358=_0x3b8f4b[_0xdafd('0x68')][_0x3c08a6];var _0x1948f7=_0x4c910a[_0xdafd('0x79')]();_0x1948f7['where'](_0xdafd('0x7a'),_0x504358['id']);_0x2763df['push'](db[_0xdafd('0x6d')][_0xdafd('0x39')](_0x1948f7[_0xdafd('0x7b')](),{'type':db[_0xdafd('0x6d')][_0xdafd('0x7c')][_0xdafd('0x7d')]})[_0xdafd('0x2a')](function(_0x58edbb){if(_0x58edbb[_0xdafd('0x3e')]===0x1){return _0x504358['id'];}else{var _0x132fdf=_[_0xdafd('0x7e')](_['map'](_0x58edbb,_0xdafd('0x7f')),function(_0x4e7112){return _[_0xdafd('0x80')](_0x342ed1,_0x4e7112);});if(_0x132fdf){return _0x504358['id'];}}}));}}return BPromise[_0xdafd('0x81')](_0x2763df)[_0xdafd('0x2a')](function(_0x1fd99b){_0xe7595d=_(_0xe7595d)['union'](_0x1fd99b)[_0xdafd('0x82')]()[_0xdafd('0x83')]();return db[_0xdafd('0x34')][_0xdafd('0x4f')]({'where':{'id':_0x49e087[_0xdafd('0x4c')]['id']}})['then'](function(_0x2f4c79){return db['sequelize'][_0xdafd('0x6e')](function(_0x3a4eb3){return _0x2f4c79['removeTeams'](_0x49e087['query'][_0xdafd('0x67')],{'transaction':_0x3a4eb3})[_0xdafd('0x2a')](function(){if(!_['isEmpty'](_0xe7595d)){return _0x2f4c79[_0xdafd('0x84')](_0xe7595d,{'transaction':_0x3a4eb3});}})['then'](function(){_0xe7595d[_0xdafd('0x70')](function(_0x26b2f3){socket[_0xdafd('0x85')](_0xdafd('0x86'),{'UserId':_0x26b2f3,'FaxQueueId':_0x2f4c79['id']});});});});});});})[_0xdafd('0x2a')](respondWithStatusCode(_0x37b837,null))[_0xdafd('0x4a')](handleError(_0x37b837,null));};exports[_0xdafd('0x87')]=function(_0x3861c1,_0x30d2d5,_0x227a8e){return db[_0xdafd('0x34')][_0xdafd('0x4f')]({'where':{'id':_0x3861c1[_0xdafd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x30d2d5,null))[_0xdafd('0x2a')](function(_0x1879cb){if(_0x1879cb){return _0x1879cb[_0xdafd('0x87')](_0x3861c1['body'][_0xdafd('0x67')],_['omit'](_0x3861c1[_0xdafd('0x51')],[_0xdafd('0x67'),'id'])||{})[_0xdafd('0x88')](function(_0x418fcc){for(var _0x4d535e=0x0;_0x4d535e<_0x3861c1[_0xdafd('0x51')][_0xdafd('0x67')][_0xdafd('0x3e')];_0x4d535e+=0x1){socket[_0xdafd('0x85')](_0xdafd('0x89'),{'UserId':_0x3861c1[_0xdafd('0x51')][_0xdafd('0x67')][_0x4d535e],'FaxQueueId':_0x3861c1[_0xdafd('0x4c')]['id']});}return _0x418fcc;});}})[_0xdafd('0x2a')](respondWithResult(_0x30d2d5,null))['catch'](handleError(_0x30d2d5,null));};exports[_0xdafd('0x84')]=function(_0x47e4a2,_0x5cbc6f,_0x25d569){return db[_0xdafd('0x34')]['find']({'where':{'id':_0x47e4a2[_0xdafd('0x4c')]['id']}})[_0xdafd('0x2a')](handleEntityNotFound(_0x5cbc6f,null))[_0xdafd('0x2a')](function(_0x34b7db){if(_0x34b7db){return _0x34b7db['removeAgents'](_0x47e4a2[_0xdafd('0x39')][_0xdafd('0x67')])[_0xdafd('0x2a')](function(){if(_[_0xdafd('0x8a')](_0x47e4a2[_0xdafd('0x39')][_0xdafd('0x67')])){for(var _0x36eaa7=0x0;_0x36eaa7<_0x47e4a2[_0xdafd('0x39')][_0xdafd('0x67')][_0xdafd('0x3e')];_0x36eaa7+=0x1){socket[_0xdafd('0x85')]('userFaxQueue:remove',{'UserId':Number(_0x47e4a2['query'][_0xdafd('0x67')][_0x36eaa7]),'FaxQueueId':Number(_0x47e4a2[_0xdafd('0x4c')]['id'])});}}else{socket[_0xdafd('0x85')]('userFaxQueue:remove',{'UserId':Number(_0x47e4a2['query'][_0xdafd('0x67')]),'FaxQueueId':Number(_0x47e4a2['params']['id'])});}});}})[_0xdafd('0x2a')](respondWithStatusCode(_0x5cbc6f,null))[_0xdafd('0x4a')](handleError(_0x5cbc6f,null));};exports[_0xdafd('0x8b')]=function(_0x48acb9,_0x3d5c79,_0x13d7e9){var _0x326745={};var _0x4d3a3a={};var _0x40abe6;var _0x17e66f;return db[_0xdafd('0x34')][_0xdafd('0x64')]({'where':{'id':_0x48acb9[_0xdafd('0x4c')]['id']}})[_0xdafd('0x2a')](handleEntityNotFound(_0x3d5c79,null))[_0xdafd('0x2a')](function(_0x4ab1c8){if(_0x4ab1c8){_0x40abe6=_0x4ab1c8;_0x4d3a3a[_0xdafd('0x38')]=_[_0xdafd('0x4d')](db['User'][_0xdafd('0x35')]);_0x4d3a3a[_0xdafd('0x39')]=_[_0xdafd('0x4d')](_0x48acb9[_0xdafd('0x39')]);_0x4d3a3a['filters']=_[_0xdafd('0x3b')](_0x4d3a3a[_0xdafd('0x38')],_0x4d3a3a[_0xdafd('0x39')]);_0x326745['attributes']=_['intersection'](_0x4d3a3a['model'],qs[_0xdafd('0x3d')](_0x48acb9[_0xdafd('0x39')][_0xdafd('0x3d')]));_0x326745[_0xdafd('0x3c')]=_0x326745[_0xdafd('0x3c')][_0xdafd('0x3e')]?_0x326745[_0xdafd('0x3c')]:_0x4d3a3a['model'];_0x326745[_0xdafd('0x40')]=qs['sort'](_0x48acb9[_0xdafd('0x39')][_0xdafd('0x41')]);_0x326745[_0xdafd('0x42')]=qs[_0xdafd('0x3a')](_['pick'](_0x48acb9[_0xdafd('0x39')],_0x4d3a3a['filters']));if(_0x48acb9[_0xdafd('0x39')]['filter']){_0x326745['where']=_[_0xdafd('0x45')](_0x326745[_0xdafd('0x42')],{'$or':_['map'](_0x326745[_0xdafd('0x3c')],function(_0x5843b5){var _0x2f5efc={};_0x2f5efc[_0x5843b5]={'$like':'%'+_0x48acb9[_0xdafd('0x39')][_0xdafd('0x44')]+'%'};return _0x2f5efc;})});}_0x326745=_[_0xdafd('0x45')]({},_0x326745,_0x48acb9[_0xdafd('0x4e')]);return _0x40abe6[_0xdafd('0x8b')](_0x326745);}})[_0xdafd('0x2a')](function(_0x415849){if(_0x415849){_0x17e66f=_0x415849['length'];if(!_0x48acb9[_0xdafd('0x39')][_0xdafd('0x5b')]('nolimit')){_0x326745[_0xdafd('0x24')]=qs[_0xdafd('0x24')](_0x48acb9[_0xdafd('0x39')][_0xdafd('0x24')]);_0x326745[_0xdafd('0x23')]=qs[_0xdafd('0x23')](_0x48acb9[_0xdafd('0x39')][_0xdafd('0x23')]);}return _0x40abe6[_0xdafd('0x8b')](_0x326745);}})[_0xdafd('0x2a')](function(_0x20e712){if(_0x20e712){return _0x20e712?{'count':_0x17e66f,'rows':_0x20e712}:null;}})['then'](respondWithResult(_0x3d5c79,null))[_0xdafd('0x4a')](handleError(_0x3d5c79,null));}; \ No newline at end of file +var _0xfb65=['to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','update','destroy','then','FaxQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','FaxQueue','findAll','show','params','length','find','catch','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','getMembers','findOne','UserFaxQueue','order','User','UserId','updatedAt','createdAt','rows','format','%s/%s','SIP','faxPause','pick','getTeams','addTeams','ids','Team','Agents','online','flatMap','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox'];(function(_0x3b35d5,_0x1553c3){var _0x2b1dbb=function(_0xe720b1){while(--_0xe720b1){_0x3b35d5['push'](_0x3b35d5['shift']());}};_0x2b1dbb(++_0x1553c3);}(_0xfb65,0x82));var _0x5fb6=function(_0x467c05,_0x2cbb49){_0x467c05=_0x467c05-0x0;var _0x192eee=_0xfb65[_0x467c05];return _0x192eee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5fb6('0x0'));var zipdir=require(_0x5fb6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5fb6('0x2'));var moment=require('moment');var BPromise=require(_0x5fb6('0x3'));var Mustache=require(_0x5fb6('0x4'));var util=require(_0x5fb6('0x5'));var path=require(_0x5fb6('0x6'));var sox=require(_0x5fb6('0x7'));var csv=require(_0x5fb6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5fb6('0x9'));var squel=require(_0x5fb6('0xa'));var crypto=require(_0x5fb6('0xb'));var jsforce=require(_0x5fb6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5fb6('0x8'));var querystring=require(_0x5fb6('0xd'));var Papa=require(_0x5fb6('0xe'));var Redis=require(_0x5fb6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5fb6('0x10'));var as=require(_0x5fb6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fb6('0x12'))(_0x5fb6('0x13'));var utils=require(_0x5fb6('0x14'));var config=require(_0x5fb6('0x15'));var licenseUtil=require(_0x5fb6('0x16'));var db=require('../../mysqldb')['db'];config[_0x5fb6('0x17')]=_[_0x5fb6('0x18')](config[_0x5fb6('0x17')],{'host':_0x5fb6('0x19'),'port':0x18eb});var socket=require(_0x5fb6('0x1a'))(new Redis(config[_0x5fb6('0x17')]));require(_0x5fb6('0x1b'))[_0x5fb6('0x1c')](socket);function respondWithStatusCode(_0x5e69c3,_0x47a197){_0x47a197=_0x47a197||0xcc;return function(_0x46f1cf){if(_0x46f1cf){return _0x5e69c3[_0x5fb6('0x1d')](_0x47a197);}return _0x5e69c3['status'](_0x47a197)[_0x5fb6('0x1e')]();};}function respondWithResult(_0x21ddd3,_0x11bb78){_0x11bb78=_0x11bb78||0xc8;return function(_0x5d71c0){if(_0x5d71c0){return _0x21ddd3[_0x5fb6('0x1f')](_0x11bb78)[_0x5fb6('0x20')](_0x5d71c0);}};}function respondWithFilteredResult(_0x27bd8b,_0x182af5){return function(_0x167354){if(_0x167354){var _0x226c61=_0x167354[_0x5fb6('0x21')],_0x50bca8=_0x182af5['offset'],_0xf4ae5d=_0x182af5[_0x5fb6('0x22')]+_0x182af5[_0x5fb6('0x23')],_0x5aeb08;if(_0xf4ae5d>=_0x226c61){_0xf4ae5d=_0x226c61;_0x5aeb08=0xc8;}else{_0x5aeb08=0xce;}_0x27bd8b[_0x5fb6('0x1f')](_0x5aeb08);return _0x27bd8b[_0x5fb6('0x24')](_0x5fb6('0x25'),_0x50bca8+'-'+_0xf4ae5d+'/'+_0x226c61)[_0x5fb6('0x20')](_0x167354);}return null;};}function patchUpdates(_0x11c21b){return function(_0x50a414){try{jsonpatch['apply'](_0x50a414,_0x11c21b,!![]);}catch(_0xfd8d78){return BPromise[_0x5fb6('0x26')](_0xfd8d78);}return _0x50a414['save']();};}function saveUpdates(_0xdf1794,_0xe58cb1){return function(_0x331bba){if(_0x331bba){return _0x331bba[_0x5fb6('0x27')](_0xdf1794)['then'](function(_0x2fca34){return _0x2fca34;});}return null;};}function removeEntity(_0x44aebe,_0x45b484){return function(_0x20de69){if(_0x20de69){return _0x20de69[_0x5fb6('0x28')]()[_0x5fb6('0x29')](function(){var _0x4e2bff=_0x20de69['get']({'plain':!![]});var _0x298b44=_0x5fb6('0x2a');return db[_0x5fb6('0x2b')][_0x5fb6('0x28')]({'where':{'type':_0x298b44,'resourceId':_0x4e2bff['id']}})[_0x5fb6('0x29')](function(){return _0x20de69;});})[_0x5fb6('0x29')](function(){_0x44aebe[_0x5fb6('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe9a4cc,_0x3f9b86){return function(_0xac9a34){if(!_0xac9a34){_0xe9a4cc['sendStatus'](0x194);}return _0xac9a34;};}function handleError(_0x2afc08,_0x1b4ae4){_0x1b4ae4=_0x1b4ae4||0x1f4;return function(_0x49a828){logger[_0x5fb6('0x2c')](_0x49a828[_0x5fb6('0x2d')]);if(_0x49a828['name']){delete _0x49a828[_0x5fb6('0x2e')];}_0x2afc08['status'](_0x1b4ae4)[_0x5fb6('0x2f')](_0x49a828);};}exports['index']=function(_0x4e7587,_0x159971){var _0x30bc6c={},_0x3199d4={},_0x13e045={'count':0x0,'rows':[]};var _0x36fc09=_[_0x5fb6('0x30')](db['FaxQueue'][_0x5fb6('0x31')],function(_0x39569e){return{'name':_0x39569e[_0x5fb6('0x32')],'type':_0x39569e[_0x5fb6('0x33')][_0x5fb6('0x34')]};});_0x3199d4[_0x5fb6('0x35')]=_[_0x5fb6('0x30')](_0x36fc09,_0x5fb6('0x2e'));_0x3199d4[_0x5fb6('0x36')]=_[_0x5fb6('0x37')](_0x4e7587[_0x5fb6('0x36')]);_0x3199d4['filters']=_[_0x5fb6('0x38')](_0x3199d4[_0x5fb6('0x35')],_0x3199d4['query']);_0x30bc6c[_0x5fb6('0x39')]=_['intersection'](_0x3199d4['model'],qs[_0x5fb6('0x3a')](_0x4e7587[_0x5fb6('0x36')][_0x5fb6('0x3a')]));_0x30bc6c['attributes']=_0x30bc6c[_0x5fb6('0x39')]['length']?_0x30bc6c['attributes']:_0x3199d4[_0x5fb6('0x35')];if(!_0x4e7587[_0x5fb6('0x36')][_0x5fb6('0x3b')](_0x5fb6('0x3c'))){_0x30bc6c[_0x5fb6('0x23')]=qs[_0x5fb6('0x23')](_0x4e7587[_0x5fb6('0x36')][_0x5fb6('0x23')]);_0x30bc6c[_0x5fb6('0x22')]=qs[_0x5fb6('0x22')](_0x4e7587[_0x5fb6('0x36')][_0x5fb6('0x22')]);}_0x30bc6c['order']=qs[_0x5fb6('0x3d')](_0x4e7587[_0x5fb6('0x36')][_0x5fb6('0x3d')]);_0x30bc6c['where']=qs[_0x5fb6('0x3e')](_['pick'](_0x4e7587[_0x5fb6('0x36')],_0x3199d4['filters']),_0x36fc09);if(_0x4e7587[_0x5fb6('0x36')][_0x5fb6('0x3f')]){_0x30bc6c[_0x5fb6('0x40')]=_[_0x5fb6('0x41')](_0x30bc6c[_0x5fb6('0x40')],{'$or':_['map'](_0x36fc09,function(_0x1a6518){if(_0x1a6518[_0x5fb6('0x33')]!==_0x5fb6('0x42')){var _0x3e40e5={};_0x3e40e5[_0x1a6518['name']]={'$like':'%'+_0x4e7587[_0x5fb6('0x36')][_0x5fb6('0x3f')]+'%'};return _0x3e40e5;}})});}_0x30bc6c=_[_0x5fb6('0x41')]({},_0x30bc6c,_0x4e7587[_0x5fb6('0x43')]);var _0x4047f5={'where':_0x30bc6c[_0x5fb6('0x40')]};return db['FaxQueue'][_0x5fb6('0x21')](_0x4047f5)[_0x5fb6('0x29')](function(_0x290714){_0x13e045[_0x5fb6('0x21')]=_0x290714;if(_0x4e7587[_0x5fb6('0x36')][_0x5fb6('0x44')]){_0x30bc6c[_0x5fb6('0x45')]=[{'all':!![]}];}return db[_0x5fb6('0x46')][_0x5fb6('0x47')](_0x30bc6c);})[_0x5fb6('0x29')](function(_0x3a4b28){_0x13e045['rows']=_0x3a4b28;return _0x13e045;})[_0x5fb6('0x29')](respondWithFilteredResult(_0x159971,_0x30bc6c))['catch'](handleError(_0x159971,null));};exports[_0x5fb6('0x48')]=function(_0x17ff8c,_0x540215){var _0x116119={'raw':!![],'where':{'id':_0x17ff8c[_0x5fb6('0x49')]['id']}},_0x28d92a={};_0x28d92a['model']=_['keys'](db[_0x5fb6('0x46')][_0x5fb6('0x31')]);_0x28d92a[_0x5fb6('0x36')]=_[_0x5fb6('0x37')](_0x17ff8c[_0x5fb6('0x36')]);_0x28d92a[_0x5fb6('0x3e')]=_[_0x5fb6('0x38')](_0x28d92a[_0x5fb6('0x35')],_0x28d92a[_0x5fb6('0x36')]);_0x116119[_0x5fb6('0x39')]=_[_0x5fb6('0x38')](_0x28d92a['model'],qs[_0x5fb6('0x3a')](_0x17ff8c['query']['fields']));_0x116119[_0x5fb6('0x39')]=_0x116119[_0x5fb6('0x39')][_0x5fb6('0x4a')]?_0x116119[_0x5fb6('0x39')]:_0x28d92a[_0x5fb6('0x35')];if(_0x17ff8c[_0x5fb6('0x36')][_0x5fb6('0x44')]){_0x116119['include']=[{'all':!![]}];}_0x116119=_[_0x5fb6('0x41')]({},_0x116119,_0x17ff8c[_0x5fb6('0x43')]);return db['FaxQueue'][_0x5fb6('0x4b')](_0x116119)[_0x5fb6('0x29')](handleEntityNotFound(_0x540215,null))[_0x5fb6('0x29')](respondWithResult(_0x540215,null))[_0x5fb6('0x4c')](handleError(_0x540215,null));};exports[_0x5fb6('0x4d')]=function(_0x136a54,_0x1db3c3){return db[_0x5fb6('0x46')]['create'](_0x136a54[_0x5fb6('0x4e')],{})[_0x5fb6('0x29')](function(_0x4be1df){var _0x236377=_0x136a54[_0x5fb6('0x4f')][_0x5fb6('0x50')]({'plain':!![]});if(!_0x236377)throw new Error(_0x5fb6('0x51'));if(_0x236377['role']==='user'){var _0xd287ab=_0x4be1df[_0x5fb6('0x50')]({'plain':!![]});var _0x3eddfc='FaxQueues';return db[_0x5fb6('0x52')]['find']({'where':{'name':_0x3eddfc,'userProfileId':_0x236377[_0x5fb6('0x53')]},'raw':!![]})['then'](function(_0xa949ae){if(_0xa949ae&&_0xa949ae[_0x5fb6('0x54')]===0x0){return db[_0x5fb6('0x2b')]['create']({'name':_0xd287ab[_0x5fb6('0x2e')],'resourceId':_0xd287ab['id'],'type':_0xa949ae[_0x5fb6('0x2e')],'sectionId':_0xa949ae['id']},{})[_0x5fb6('0x29')](function(){return _0x4be1df;});}else{return _0x4be1df;}})[_0x5fb6('0x4c')](function(_0x1d89db){logger[_0x5fb6('0x2c')](_0x5fb6('0x55'),_0x1d89db);throw _0x1d89db;});}return _0x4be1df;})[_0x5fb6('0x29')](respondWithResult(_0x1db3c3,0xc9))[_0x5fb6('0x4c')](handleError(_0x1db3c3,null));};exports[_0x5fb6('0x27')]=function(_0xff6370,_0x4ae2fb){if(_0xff6370[_0x5fb6('0x4e')]['id']){delete _0xff6370['body']['id'];}return db[_0x5fb6('0x46')][_0x5fb6('0x4b')]({'where':{'id':_0xff6370[_0x5fb6('0x49')]['id']}})[_0x5fb6('0x29')](handleEntityNotFound(_0x4ae2fb,null))[_0x5fb6('0x29')](saveUpdates(_0xff6370[_0x5fb6('0x4e')],null))['then'](respondWithResult(_0x4ae2fb,null))['catch'](handleError(_0x4ae2fb,null));};exports['destroy']=function(_0x58b068,_0x314128){return db[_0x5fb6('0x46')][_0x5fb6('0x4b')]({'where':{'id':_0x58b068[_0x5fb6('0x49')]['id']}})['then'](handleEntityNotFound(_0x314128,null))[_0x5fb6('0x29')](removeEntity(_0x314128,null))[_0x5fb6('0x4c')](handleError(_0x314128,null));};exports['describe']=function(_0xbd31ab,_0x492e94){return db[_0x5fb6('0x46')][_0x5fb6('0x56')]()['then'](respondWithResult(_0x492e94,null))[_0x5fb6('0x4c')](handleError(_0x492e94,null));};exports[_0x5fb6('0x57')]=function(_0x1b9bd8,_0x4da260,_0x300225){var _0x3b3f98={'raw':!![],'where':{}},_0x27ae23={},_0x3b154b;return db[_0x5fb6('0x46')][_0x5fb6('0x58')]({'where':{'id':_0x1b9bd8[_0x5fb6('0x49')]['id']}})['then'](handleEntityNotFound(_0x4da260,null))[_0x5fb6('0x29')](function(_0x45419b){if(_0x45419b){_0x3b154b=_0x45419b[_0x5fb6('0x50')]({'plain':!![]});_0x27ae23[_0x5fb6('0x35')]=_[_0x5fb6('0x37')](db[_0x5fb6('0x59')]['rawAttributes']);_0x27ae23[_0x5fb6('0x36')]=_['keys'](_0x1b9bd8[_0x5fb6('0x36')]);_0x27ae23[_0x5fb6('0x3e')]=_[_0x5fb6('0x38')](_0x27ae23[_0x5fb6('0x35')],_0x27ae23[_0x5fb6('0x36')]);_0x3b3f98[_0x5fb6('0x39')]=_[_0x5fb6('0x38')](_0x27ae23[_0x5fb6('0x35')],qs['fields'](_0x1b9bd8['query'][_0x5fb6('0x3a')]));_0x3b3f98[_0x5fb6('0x39')]=_0x3b3f98[_0x5fb6('0x39')][_0x5fb6('0x4a')]?_0x3b3f98['attributes']:_0x27ae23['model'];if(!_0x1b9bd8[_0x5fb6('0x36')]['hasOwnProperty']('nolimit')){_0x3b3f98[_0x5fb6('0x23')]=qs[_0x5fb6('0x23')](_0x1b9bd8[_0x5fb6('0x36')][_0x5fb6('0x23')]);_0x3b3f98[_0x5fb6('0x22')]=qs['offset'](_0x1b9bd8[_0x5fb6('0x36')]['offset']);}_0x3b3f98[_0x5fb6('0x5a')]=qs[_0x5fb6('0x3d')](_0x1b9bd8[_0x5fb6('0x36')][_0x5fb6('0x3d')]);_0x3b3f98[_0x5fb6('0x40')]=qs[_0x5fb6('0x3e')](_['pick'](_0x1b9bd8[_0x5fb6('0x36')],_0x27ae23[_0x5fb6('0x3e')]));_0x3b3f98[_0x5fb6('0x40')]['FaxQueueId']=_0x45419b['id'];if(_0x1b9bd8['query']['filter']){_0x3b3f98[_0x5fb6('0x40')]=_[_0x5fb6('0x41')](_0x3b3f98[_0x5fb6('0x40')],{'$or':_[_0x5fb6('0x30')](_0x3b3f98[_0x5fb6('0x39')],function(_0x377d3d){var _0x464574={};_0x464574[_0x377d3d]={'$like':'%'+_0x1b9bd8['query'][_0x5fb6('0x3f')]+'%'};return _0x464574;})});}_0x3b3f98=_[_0x5fb6('0x41')]({},_0x3b3f98,_0x1b9bd8[_0x5fb6('0x43')]);return db[_0x5fb6('0x59')][_0x5fb6('0x47')](_0x3b3f98);}})['then'](function(_0x56223d){if(_0x56223d){return db[_0x5fb6('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x56223d,_0x5fb6('0x5c')),'role':'agent'},'attributes':['id','name','faxPause',_0x5fb6('0x5d'),_0x5fb6('0x5e')]});}})[_0x5fb6('0x29')](function(_0x39e103){if(_0x39e103){return{'count':_0x39e103[_0x5fb6('0x21')],'rows':_[_0x5fb6('0x30')](_0x39e103[_0x5fb6('0x5f')],function(_0x266e7c){return{'membername':_0x266e7c[_0x5fb6('0x2e')],'UserId':_0x266e7c['id'],'queue_name':_0x3b154b[_0x5fb6('0x2e')],'FaxQueueId':_0x3b154b['id'],'interface':util[_0x5fb6('0x60')](_0x5fb6('0x61'),_0x5fb6('0x62'),_0x266e7c[_0x5fb6('0x2e')]),'penalty':0x0,'paused':_0x266e7c[_0x5fb6('0x63')],'createdAt':_0x266e7c[_0x5fb6('0x5e')],'updatedAt':_0x266e7c[_0x5fb6('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5fb6('0x29')](respondWithFilteredResult(_0x4da260,_0x3b3f98))['catch'](handleError(_0x4da260,null));};exports['getTeams']=function(_0x377d13,_0x55d588,_0x5afa87){var _0x2694d1={};var _0x3986f1={};var _0x5843d5;var _0x2f04b0;return db[_0x5fb6('0x46')][_0x5fb6('0x58')]({'where':{'id':_0x377d13['params']['id']}})[_0x5fb6('0x29')](handleEntityNotFound(_0x55d588,null))[_0x5fb6('0x29')](function(_0x1d7b9f){if(_0x1d7b9f){_0x5843d5=_0x1d7b9f;_0x3986f1[_0x5fb6('0x35')]=_[_0x5fb6('0x37')](db['Team']['rawAttributes']);_0x3986f1['query']=_[_0x5fb6('0x37')](_0x377d13[_0x5fb6('0x36')]);_0x3986f1[_0x5fb6('0x3e')]=_[_0x5fb6('0x38')](_0x3986f1[_0x5fb6('0x35')],_0x3986f1[_0x5fb6('0x36')]);_0x2694d1[_0x5fb6('0x39')]=_[_0x5fb6('0x38')](_0x3986f1[_0x5fb6('0x35')],qs[_0x5fb6('0x3a')](_0x377d13[_0x5fb6('0x36')]['fields']));_0x2694d1['attributes']=_0x2694d1['attributes'][_0x5fb6('0x4a')]?_0x2694d1[_0x5fb6('0x39')]:_0x3986f1[_0x5fb6('0x35')];_0x2694d1[_0x5fb6('0x5a')]=qs[_0x5fb6('0x3d')](_0x377d13['query'][_0x5fb6('0x3d')]);_0x2694d1['where']=qs[_0x5fb6('0x3e')](_[_0x5fb6('0x64')](_0x377d13['query'],_0x3986f1[_0x5fb6('0x3e')]));if(_0x377d13['query'][_0x5fb6('0x3f')]){_0x2694d1[_0x5fb6('0x40')]=_[_0x5fb6('0x41')](_0x2694d1[_0x5fb6('0x40')],{'$or':_['map'](_0x2694d1[_0x5fb6('0x39')],function(_0x1e79eb){var _0x34a69a={};_0x34a69a[_0x1e79eb]={'$like':'%'+_0x377d13[_0x5fb6('0x36')][_0x5fb6('0x3f')]+'%'};return _0x34a69a;})});}_0x2694d1=_[_0x5fb6('0x41')]({},_0x2694d1,_0x377d13[_0x5fb6('0x43')]);return _0x5843d5[_0x5fb6('0x65')](_0x2694d1);}})[_0x5fb6('0x29')](function(_0x39d738){if(_0x39d738){_0x2f04b0=_0x39d738[_0x5fb6('0x4a')];if(!_0x377d13[_0x5fb6('0x36')]['hasOwnProperty'](_0x5fb6('0x3c'))){_0x2694d1[_0x5fb6('0x23')]=qs[_0x5fb6('0x23')](_0x377d13[_0x5fb6('0x36')][_0x5fb6('0x23')]);_0x2694d1['offset']=qs[_0x5fb6('0x22')](_0x377d13['query']['offset']);}return _0x5843d5['getTeams'](_0x2694d1);}})[_0x5fb6('0x29')](function(_0x308599){if(_0x308599){return _0x308599?{'count':_0x2f04b0,'rows':_0x308599}:null;}})[_0x5fb6('0x29')](respondWithResult(_0x55d588,null))['catch'](handleError(_0x55d588,null));};exports[_0x5fb6('0x66')]=function(_0x5793c8,_0x5885ad,_0x4341d3){var _0x1609ca=_0x5793c8[_0x5fb6('0x4e')][_0x5fb6('0x67')];return db[_0x5fb6('0x68')][_0x5fb6('0x47')]({'where':{'id':_0x1609ca},'attributes':['id'],'include':[{'model':db[_0x5fb6('0x5b')],'as':_0x5fb6('0x69'),'attributes':['id',_0x5fb6('0x2e'),_0x5fb6('0x6a'),'voicePause','interface'],'raw':!![]}]})[_0x5fb6('0x29')](function(_0x817cec){if(_0x817cec){var _0x1fc37b=_[_0x5fb6('0x6b')](_0x817cec,function(_0x15b8f3){var _0x4b2b0a=_0x15b8f3[_0x5fb6('0x50')]({'plain':!![]});return _0x4b2b0a[_0x5fb6('0x69')];});return db[_0x5fb6('0x46')][_0x5fb6('0x4b')]({'where':{'id':_0x5793c8[_0x5fb6('0x49')]['id']}})[_0x5fb6('0x29')](function(_0x3840b3){return db[_0x5fb6('0x6c')][_0x5fb6('0x6d')](function(_0x498b66){return _0x3840b3['addTeams'](_0x1609ca,{'transaction':_0x498b66})['then'](function(){return BPromise[_0x5fb6('0x6e')](_0x1fc37b,function(_0x35c837){return db[_0x5fb6('0x59')][_0x5fb6('0x6f')]({'where':{'UserId':_0x35c837['id'],'FaxQueueId':_0x5793c8[_0x5fb6('0x49')]['id']},'transaction':_0x498b66});});})['then'](function(){_0x1fc37b[_0x5fb6('0x70')](function(_0x2b6a65){socket['emit'](_0x5fb6('0x71'),{'UserId':_0x2b6a65['id'],'FaxQueueId':_0x3840b3['id']});});});});});}})[_0x5fb6('0x29')](respondWithStatusCode(_0x5885ad,null))[_0x5fb6('0x4c')](handleError(_0x5885ad,null));};exports[_0x5fb6('0x72')]=function(_0xdf1fcc,_0x3997b1,_0x39e7f6){return db[_0x5fb6('0x68')][_0x5fb6('0x47')]({'where':{'id':_0xdf1fcc['query'][_0x5fb6('0x67')]},'attributes':['id'],'include':[{'model':db[_0x5fb6('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5fb6('0x29')](handleEntityNotFound(_0x3997b1,null))[_0x5fb6('0x29')](function(_0x21591b){var _0x2d0848=_[_0x5fb6('0x30')](_0x21591b,'id');var _0x29a18d=[];var _0x3181f1=[];var _0x1c184c=squel['select']();_0x1c184c['field'](_0x5fb6('0x73'))[_0x5fb6('0x74')](_0x5fb6('0x75'),'tq')['join'](_0x5fb6('0x76'),'ut',_0x5fb6('0x77'))[_0x5fb6('0x40')]('FaxQueueId\x20=\x20?',_0xdf1fcc[_0x5fb6('0x49')]['id']);for(var _0x1d1416=0x0;_0x1d1416<_0x21591b['length'];_0x1d1416+=0x1){let _0x4dcf77=_0x21591b[_0x1d1416];for(var _0x46f5ff=0x0;_0x46f5ff<_0x4dcf77[_0x5fb6('0x69')]['length'];_0x46f5ff+=0x1){let _0x4610bb=_0x4dcf77[_0x5fb6('0x69')][_0x46f5ff];var _0x195bca=_0x1c184c['clone']();_0x195bca['where'](_0x5fb6('0x78'),_0x4610bb['id']);_0x3181f1[_0x5fb6('0x79')](db[_0x5fb6('0x6c')][_0x5fb6('0x36')](_0x195bca[_0x5fb6('0x7a')](),{'type':db[_0x5fb6('0x6c')][_0x5fb6('0x7b')][_0x5fb6('0x7c')]})['then'](function(_0x4b6da0){if(_0x4b6da0[_0x5fb6('0x4a')]===0x1){return _0x4610bb['id'];}else{var _0x401efd=_[_0x5fb6('0x7d')](_[_0x5fb6('0x30')](_0x4b6da0,_0x5fb6('0x7e')),function(_0x53ea06){return _[_0x5fb6('0x7f')](_0x2d0848,_0x53ea06);});if(_0x401efd){return _0x4610bb['id'];}}}));}}return BPromise['all'](_0x3181f1)[_0x5fb6('0x29')](function(_0x2e8810){_0x29a18d=_(_0x29a18d)[_0x5fb6('0x80')](_0x2e8810)['compact']()[_0x5fb6('0x81')]();return db[_0x5fb6('0x46')]['find']({'where':{'id':_0xdf1fcc[_0x5fb6('0x49')]['id']}})[_0x5fb6('0x29')](function(_0xdbdf3d){return db[_0x5fb6('0x6c')][_0x5fb6('0x6d')](function(_0x2eabd3){return _0xdbdf3d['removeTeams'](_0xdf1fcc[_0x5fb6('0x36')][_0x5fb6('0x67')],{'transaction':_0x2eabd3})[_0x5fb6('0x29')](function(){if(!_[_0x5fb6('0x82')](_0x29a18d)){return _0xdbdf3d[_0x5fb6('0x83')](_0x29a18d,{'transaction':_0x2eabd3});}})[_0x5fb6('0x29')](function(){_0x29a18d[_0x5fb6('0x70')](function(_0x3c7c02){socket[_0x5fb6('0x84')](_0x5fb6('0x85'),{'UserId':_0x3c7c02,'FaxQueueId':_0xdbdf3d['id']});});});});});});})['then'](respondWithStatusCode(_0x3997b1,null))['catch'](handleError(_0x3997b1,null));};exports[_0x5fb6('0x86')]=function(_0x56fe96,_0x9e0eb1,_0x27c042){return db[_0x5fb6('0x46')]['find']({'where':{'id':_0x56fe96['params']['id']}})[_0x5fb6('0x29')](handleEntityNotFound(_0x9e0eb1,null))['then'](function(_0x407c37){if(_0x407c37){return _0x407c37[_0x5fb6('0x86')](_0x56fe96['body']['ids'],_['omit'](_0x56fe96[_0x5fb6('0x4e')],[_0x5fb6('0x67'),'id'])||{})[_0x5fb6('0x87')](function(_0x3b607a){for(var _0xf74c31=0x0;_0xf74c31<_0x56fe96[_0x5fb6('0x4e')][_0x5fb6('0x67')][_0x5fb6('0x4a')];_0xf74c31+=0x1){socket['emit'](_0x5fb6('0x71'),{'UserId':_0x56fe96[_0x5fb6('0x4e')][_0x5fb6('0x67')][_0xf74c31],'FaxQueueId':_0x56fe96[_0x5fb6('0x49')]['id']});}return _0x3b607a;});}})[_0x5fb6('0x29')](respondWithResult(_0x9e0eb1,null))[_0x5fb6('0x4c')](handleError(_0x9e0eb1,null));};exports[_0x5fb6('0x83')]=function(_0x58c1a4,_0x323fb4,_0x284fb3){return db['FaxQueue'][_0x5fb6('0x4b')]({'where':{'id':_0x58c1a4[_0x5fb6('0x49')]['id']}})[_0x5fb6('0x29')](handleEntityNotFound(_0x323fb4,null))['then'](function(_0x2e3403){if(_0x2e3403){return _0x2e3403[_0x5fb6('0x83')](_0x58c1a4[_0x5fb6('0x36')][_0x5fb6('0x67')])[_0x5fb6('0x29')](function(){if(_[_0x5fb6('0x88')](_0x58c1a4[_0x5fb6('0x36')][_0x5fb6('0x67')])){for(var _0x1cdab5=0x0;_0x1cdab5<_0x58c1a4['query'][_0x5fb6('0x67')][_0x5fb6('0x4a')];_0x1cdab5+=0x1){socket[_0x5fb6('0x84')](_0x5fb6('0x85'),{'UserId':Number(_0x58c1a4[_0x5fb6('0x36')][_0x5fb6('0x67')][_0x1cdab5]),'FaxQueueId':Number(_0x58c1a4[_0x5fb6('0x49')]['id'])});}}else{socket[_0x5fb6('0x84')](_0x5fb6('0x85'),{'UserId':Number(_0x58c1a4[_0x5fb6('0x36')][_0x5fb6('0x67')]),'FaxQueueId':Number(_0x58c1a4[_0x5fb6('0x49')]['id'])});}});}})[_0x5fb6('0x29')](respondWithStatusCode(_0x323fb4,null))['catch'](handleError(_0x323fb4,null));};exports[_0x5fb6('0x89')]=function(_0x3fb8c4,_0x1af4b6,_0x325dbc){var _0x340214={};var _0x194cb2={};var _0x16d62c;var _0x386143;return db[_0x5fb6('0x46')][_0x5fb6('0x58')]({'where':{'id':_0x3fb8c4[_0x5fb6('0x49')]['id']}})[_0x5fb6('0x29')](handleEntityNotFound(_0x1af4b6,null))['then'](function(_0xebf06f){if(_0xebf06f){_0x16d62c=_0xebf06f;_0x194cb2['model']=_['keys'](db[_0x5fb6('0x5b')]['rawAttributes']);_0x194cb2[_0x5fb6('0x36')]=_[_0x5fb6('0x37')](_0x3fb8c4[_0x5fb6('0x36')]);_0x194cb2[_0x5fb6('0x3e')]=_['intersection'](_0x194cb2['model'],_0x194cb2[_0x5fb6('0x36')]);_0x340214['attributes']=_[_0x5fb6('0x38')](_0x194cb2[_0x5fb6('0x35')],qs[_0x5fb6('0x3a')](_0x3fb8c4['query'][_0x5fb6('0x3a')]));_0x340214[_0x5fb6('0x39')]=_0x340214[_0x5fb6('0x39')][_0x5fb6('0x4a')]?_0x340214[_0x5fb6('0x39')]:_0x194cb2[_0x5fb6('0x35')];_0x340214['order']=qs[_0x5fb6('0x3d')](_0x3fb8c4[_0x5fb6('0x36')][_0x5fb6('0x3d')]);_0x340214['where']=qs['filters'](_[_0x5fb6('0x64')](_0x3fb8c4[_0x5fb6('0x36')],_0x194cb2[_0x5fb6('0x3e')]));if(_0x3fb8c4[_0x5fb6('0x36')][_0x5fb6('0x3f')]){_0x340214['where']=_[_0x5fb6('0x41')](_0x340214['where'],{'$or':_['map'](_0x340214[_0x5fb6('0x39')],function(_0x3662ea){var _0x620213={};_0x620213[_0x3662ea]={'$like':'%'+_0x3fb8c4[_0x5fb6('0x36')][_0x5fb6('0x3f')]+'%'};return _0x620213;})});}_0x340214=_[_0x5fb6('0x41')]({},_0x340214,_0x3fb8c4[_0x5fb6('0x43')]);return _0x16d62c[_0x5fb6('0x89')](_0x340214);}})[_0x5fb6('0x29')](function(_0x49d97a){if(_0x49d97a){_0x386143=_0x49d97a['length'];if(!_0x3fb8c4[_0x5fb6('0x36')][_0x5fb6('0x3b')](_0x5fb6('0x3c'))){_0x340214[_0x5fb6('0x23')]=qs[_0x5fb6('0x23')](_0x3fb8c4['query'][_0x5fb6('0x23')]);_0x340214[_0x5fb6('0x22')]=qs['offset'](_0x3fb8c4['query'][_0x5fb6('0x22')]);}return _0x16d62c['getAgents'](_0x340214);}})[_0x5fb6('0x29')](function(_0x4a0569){if(_0x4a0569){return _0x4a0569?{'count':_0x386143,'rows':_0x4a0569}:null;}})['then'](respondWithResult(_0x1af4b6,null))[_0x5fb6('0x4c')](handleError(_0x1af4b6,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 5d702ac..0c64146 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 _0x7ba7=['../../mysqldb','FaxQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x7ba7,0x1e9));var _0x77ba=function(_0x6e17f2,_0xcc4a45){_0x6e17f2=_0x6e17f2-0x0;var _0x1cc6b5=_0x7ba7[_0x6e17f2];return _0x1cc6b5;};'use strict';var EventEmitter=require(_0x77ba('0x0'));var FaxQueue=require(_0x77ba('0x1'))['db'][_0x77ba('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x77ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x77ba('0x4'),'afterDestroy':_0x77ba('0x5')};function emitEvent(_0x1f834a){return function(_0x4b36eb,_0x5acb41,_0x26f7a7){FaxQueueEvents['emit'](_0x1f834a+':'+_0x4b36eb['id'],_0x4b36eb);FaxQueueEvents[_0x77ba('0x6')](_0x1f834a,_0x4b36eb);_0x26f7a7(null);};}for(var e in events){if(events[_0x77ba('0x7')](e)){var event=events[e];FaxQueue[_0x77ba('0x8')](e,emitEvent(event));}}module[_0x77ba('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x18c3=['events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x42145e,_0x4f1f4f){var _0x4493a1=function(_0x137f00){while(--_0x137f00){_0x42145e['push'](_0x42145e['shift']());}};_0x4493a1(++_0x4f1f4f);}(_0x18c3,0xaa));var _0x318c=function(_0x168c4b,_0x12457b){_0x168c4b=_0x168c4b-0x0;var _0x1126fe=_0x18c3[_0x168c4b];return _0x1126fe;};'use strict';var EventEmitter=require(_0x318c('0x0'));var FaxQueue=require(_0x318c('0x1'))['db'][_0x318c('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x318c('0x3')](0x0);var events={'afterCreate':_0x318c('0x4'),'afterUpdate':_0x318c('0x5'),'afterDestroy':_0x318c('0x6')};function emitEvent(_0x37d190){return function(_0x1bdf55,_0x3e3552,_0x476163){FaxQueueEvents[_0x318c('0x7')](_0x37d190+':'+_0x1bdf55['id'],_0x1bdf55);FaxQueueEvents[_0x318c('0x7')](_0x37d190,_0x1bdf55);_0x476163(null);};}for(var e in events){if(events[_0x318c('0x8')](e)){var event=events[e];FaxQueue[_0x318c('0x9')](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 a153b7d..ec0a039 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 _0xdd2c=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2fb4ae,_0x57f6b8){var _0x37b1be=function(_0x1af391){while(--_0x1af391){_0x2fb4ae['push'](_0x2fb4ae['shift']());}};_0x37b1be(++_0x57f6b8);}(_0xdd2c,0x86));var _0xcdd2=function(_0x211e33,_0x3864ad){_0x211e33=_0x211e33-0x0;var _0xbc616e=_0xdd2c[_0x211e33];return _0xbc616e;};'use strict';var _=require(_0xcdd2('0x0'));var util=require(_0xcdd2('0x1'));var logger=require(_0xcdd2('0x2'))(_0xcdd2('0x3'));var moment=require(_0xcdd2('0x4'));var BPromise=require('bluebird');var rp=require(_0xcdd2('0x5'));var fs=require('fs');var path=require(_0xcdd2('0x6'));var rimraf=require(_0xcdd2('0x7'));var config=require(_0xcdd2('0x8'));var attributes=require(_0xcdd2('0x9'));module[_0xcdd2('0xa')]=function(_0x82a485,_0x3dc492){return _0x82a485[_0xcdd2('0xb')](_0xcdd2('0xc'),attributes,{'tableName':_0xcdd2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b81=['api','moment','bluebird','request-promise','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','util','../../config/logger'];(function(_0x3f4634,_0x16aed2){var _0x4b17d0=function(_0x12d76b){while(--_0x12d76b){_0x3f4634['push'](_0x3f4634['shift']());}};_0x4b17d0(++_0x16aed2);}(_0x6b81,0x14d));var _0x16b8=function(_0x4a4922,_0x82cb8f){_0x4a4922=_0x4a4922-0x0;var _0x55a8c6=_0x6b81[_0x4a4922];return _0x55a8c6;};'use strict';var _=require(_0x16b8('0x0'));var util=require(_0x16b8('0x1'));var logger=require(_0x16b8('0x2'))(_0x16b8('0x3'));var moment=require(_0x16b8('0x4'));var BPromise=require(_0x16b8('0x5'));var rp=require(_0x16b8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x16b8('0x7'));var attributes=require(_0x16b8('0x8'));module[_0x16b8('0x9')]=function(_0x3ec4dd,_0x2d55c8){return _0x3ec4dd[_0x16b8('0xa')]('FaxQueue',attributes,{'tableName':_0x16b8('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 6dc41f6..6d15937 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 _0x640b=['GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x3e9d11,_0x141319){var _0xed8a75=function(_0x43ddee){while(--_0x43ddee){_0x3e9d11['push'](_0x3e9d11['shift']());}};_0xed8a75(++_0x141319);}(_0x640b,0x11b));var _0xb640=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x640b[_0x1064bc];return _0x5edc45;};'use strict';var _=require(_0xb640('0x0'));var util=require('util');var moment=require(_0xb640('0x1'));var BPromise=require(_0xb640('0x2'));var rs=require(_0xb640('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb640('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb640('0x5'))(_0xb640('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb640('0x7')]({'port':0x232a});config[_0xb640('0x8')]=_[_0xb640('0x9')](config[_0xb640('0x8')],{'host':_0xb640('0xa'),'port':0x18eb});var socket=require(_0xb640('0xb'))(new Redis(config[_0xb640('0x8')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4788c9,_0x147af4,_0x85979f){return new BPromise(function(_0x4242eb,_0x592731){return client[_0xb640('0xc')](_0x4788c9,_0x85979f)[_0xb640('0xd')](function(_0x36a6c9){logger[_0xb640('0xe')](_0xb640('0xf'),_0x147af4,_0xb640('0x10'));logger[_0xb640('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x147af4,_0xb640('0x10'),JSON[_0xb640('0x12')](_0x36a6c9));if(_0x36a6c9[_0xb640('0x13')]){if(_0x36a6c9[_0xb640('0x13')][_0xb640('0x14')]===0x1f4){logger[_0xb640('0x13')]('FaxQueue,\x20%s,\x20%s',_0x147af4,_0x36a6c9[_0xb640('0x13')]['message']);return _0x592731(_0x36a6c9['error'][_0xb640('0x15')]);}logger[_0xb640('0x13')](_0xb640('0xf'),_0x147af4,_0x36a6c9[_0xb640('0x13')]['message']);return _0x4242eb(_0x36a6c9['error'][_0xb640('0x15')]);}else{logger[_0xb640('0xe')](_0xb640('0xf'),_0x147af4,_0xb640('0x10'));_0x4242eb(_0x36a6c9['result'][_0xb640('0x15')]);}})[_0xb640('0x16')](function(_0x10167a){logger[_0xb640('0x13')](_0xb640('0xf'),_0x147af4,_0x10167a);_0x592731(_0x10167a);});});}exports[_0xb640('0x17')]=function(_0x4c039d){var _0x420a2f=this;return new Promise(function(_0x2c115b,_0x522bf1){return db[_0xb640('0x18')]['findAll']({'raw':_0x4c039d[_0xb640('0x19')]?_0x4c039d['options'][_0xb640('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c039d[_0xb640('0x19')]?_0x4c039d[_0xb640('0x19')][_0xb640('0x1b')]||null:null,'attributes':_0x4c039d[_0xb640('0x19')]?_0x4c039d[_0xb640('0x19')][_0xb640('0x1c')]||null:null,'limit':_0x4c039d[_0xb640('0x19')]?_0x4c039d['options'][_0xb640('0x1d')]||null:null,'include':_0x4c039d[_0xb640('0x19')]?_0x4c039d['options'][_0xb640('0x1e')]?_[_0xb640('0x1f')](_0x4c039d[_0xb640('0x19')]['include'],function(_0x4a3caa){return{'model':db[_0x4a3caa[_0xb640('0x20')]],'as':_0x4a3caa['as'],'attributes':_0x4a3caa['attributes'],'include':_0x4a3caa[_0xb640('0x1e')]?_[_0xb640('0x1f')](_0x4a3caa[_0xb640('0x1e')],function(_0x472782){return{'model':db[_0x472782[_0xb640('0x20')]],'as':_0x472782['as'],'attributes':_0x472782[_0xb640('0x1c')],'include':_0x472782['include']?_['map'](_0x472782[_0xb640('0x1e')],function(_0x481f6b){return{'model':db[_0x481f6b[_0xb640('0x20')]],'as':_0x481f6b['as'],'attributes':_0x481f6b[_0xb640('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x80fbd9){logger['info'](_0xb640('0x17'),_0x4c039d);logger[_0xb640('0x11')](_0xb640('0x17'),_0x4c039d,JSON[_0xb640('0x12')](_0x80fbd9));_0x2c115b(_0x80fbd9);})[_0xb640('0x16')](function(_0x11d9a1){logger[_0xb640('0x13')](_0xb640('0x17'),_0x11d9a1[_0xb640('0x15')],_0x4c039d);_0x522bf1(_0x420a2f['error'](0x1f4,_0x11d9a1[_0xb640('0x15')]));});});};exports[_0xb640('0x21')]=function(_0x36355d){var _0x4c15cf=this;return new Promise(function(_0x5c7aa1,_0x24d62b){return db['FaxQueue']['find']({'raw':_0x36355d['options']?_0x36355d['options'][_0xb640('0x1a')]===undefined?!![]:![]:!![],'where':_0x36355d['options']?_0x36355d['options'][_0xb640('0x1b')]||null:null,'attributes':_0x36355d[_0xb640('0x19')]?_0x36355d['options'][_0xb640('0x1c')]||null:null,'include':_0x36355d['options']?_0x36355d[_0xb640('0x19')][_0xb640('0x1e')]?_[_0xb640('0x1f')](_0x36355d[_0xb640('0x19')]['include'],function(_0x49b0ee){return{'model':db[_0x49b0ee['model']],'as':_0x49b0ee['as'],'attributes':_0x49b0ee[_0xb640('0x1c')],'include':_0x49b0ee[_0xb640('0x1e')]?_[_0xb640('0x1f')](_0x49b0ee['include'],function(_0x3adefa){return{'model':db[_0x3adefa[_0xb640('0x20')]],'as':_0x3adefa['as'],'attributes':_0x3adefa[_0xb640('0x1c')],'include':_0x3adefa[_0xb640('0x1e')]?_[_0xb640('0x1f')](_0x3adefa['include'],function(_0x5530b8){return{'model':db[_0x5530b8['model']],'as':_0x5530b8['as'],'attributes':_0x5530b8[_0xb640('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb640('0xd')](function(_0x247edf){logger[_0xb640('0xe')](_0xb640('0x21'),_0x36355d);logger[_0xb640('0x11')]('ShowFaxQueue',_0x36355d,JSON[_0xb640('0x12')](_0x247edf));_0x5c7aa1(_0x247edf);})['catch'](function(_0x3fba94){logger['error'](_0xb640('0x21'),_0x3fba94[_0xb640('0x15')],_0x36355d);_0x24d62b(_0x4c15cf['error'](0x1f4,_0x3fba94[_0xb640('0x15')]));});});}; \ No newline at end of file +var _0xa6d7=['./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','map','include','model','catch','ShowFaxQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter'];(function(_0x1bc60d,_0x339872){var _0x110702=function(_0x1dfb6b){while(--_0x1dfb6b){_0x1bc60d['push'](_0x1bc60d['shift']());}};_0x110702(++_0x339872);}(_0xa6d7,0x15a));var _0x7a6d=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa6d7[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x7a6d('0x0'));var util=require(_0x7a6d('0x1'));var moment=require(_0x7a6d('0x2'));var BPromise=require('bluebird');var rs=require(_0x7a6d('0x3'));var fs=require('fs');var Redis=require(_0x7a6d('0x4'));var db=require(_0x7a6d('0x5'))['db'];var utils=require(_0x7a6d('0x6'));var logger=require('../../config/logger')(_0x7a6d('0x7'));var config=require(_0x7a6d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7a6d('0x9')][_0x7a6d('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7a6d('0xb')],{'host':_0x7a6d('0xc'),'port':0x18eb});var socket=require(_0x7a6d('0xd'))(new Redis(config[_0x7a6d('0xb')]));require(_0x7a6d('0xe'))[_0x7a6d('0xf')](socket);function respondWithRpcPromise(_0x2a5eb6,_0x2a98c8,_0xae8e19){return new BPromise(function(_0x39cf64,_0x219dfb){return client[_0x7a6d('0x10')](_0x2a5eb6,_0xae8e19)[_0x7a6d('0x11')](function(_0x54ef0f){logger[_0x7a6d('0x12')](_0x7a6d('0x13'),_0x2a98c8,_0x7a6d('0x14'));logger[_0x7a6d('0x15')](_0x7a6d('0x16'),_0x2a98c8,_0x7a6d('0x14'),JSON[_0x7a6d('0x17')](_0x54ef0f));if(_0x54ef0f[_0x7a6d('0x18')]){if(_0x54ef0f['error'][_0x7a6d('0x19')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x2a98c8,_0x54ef0f[_0x7a6d('0x18')][_0x7a6d('0x1a')]);return _0x219dfb(_0x54ef0f[_0x7a6d('0x18')][_0x7a6d('0x1a')]);}logger[_0x7a6d('0x18')](_0x7a6d('0x13'),_0x2a98c8,_0x54ef0f[_0x7a6d('0x18')]['message']);return _0x39cf64(_0x54ef0f['error'][_0x7a6d('0x1a')]);}else{logger[_0x7a6d('0x12')]('FaxQueue,\x20%s,\x20%s',_0x2a98c8,_0x7a6d('0x14'));_0x39cf64(_0x54ef0f[_0x7a6d('0x1b')]['message']);}})['catch'](function(_0x517688){logger[_0x7a6d('0x18')]('FaxQueue,\x20%s,\x20%s',_0x2a98c8,_0x517688);_0x219dfb(_0x517688);});});}exports[_0x7a6d('0x1c')]=function(_0x52604e){var _0x1f8c5d=this;return new Promise(function(_0x1ff0bc,_0x5a7a14){return db[_0x7a6d('0x1d')][_0x7a6d('0x1e')]({'raw':_0x52604e[_0x7a6d('0x1f')]?_0x52604e['options']['raw']===undefined?!![]:![]:!![],'where':_0x52604e[_0x7a6d('0x1f')]?_0x52604e[_0x7a6d('0x1f')][_0x7a6d('0x20')]||null:null,'attributes':_0x52604e['options']?_0x52604e[_0x7a6d('0x1f')][_0x7a6d('0x21')]||null:null,'limit':_0x52604e[_0x7a6d('0x1f')]?_0x52604e[_0x7a6d('0x1f')][_0x7a6d('0x22')]||null:null,'include':_0x52604e[_0x7a6d('0x1f')]?_0x52604e[_0x7a6d('0x1f')]['include']?_[_0x7a6d('0x23')](_0x52604e[_0x7a6d('0x1f')][_0x7a6d('0x24')],function(_0x3d535d){return{'model':db[_0x3d535d['model']],'as':_0x3d535d['as'],'attributes':_0x3d535d[_0x7a6d('0x21')],'include':_0x3d535d['include']?_[_0x7a6d('0x23')](_0x3d535d[_0x7a6d('0x24')],function(_0xeb0025){return{'model':db[_0xeb0025[_0x7a6d('0x25')]],'as':_0xeb0025['as'],'attributes':_0xeb0025[_0x7a6d('0x21')],'include':_0xeb0025['include']?_[_0x7a6d('0x23')](_0xeb0025[_0x7a6d('0x24')],function(_0x461b73){return{'model':db[_0x461b73[_0x7a6d('0x25')]],'as':_0x461b73['as'],'attributes':_0x461b73[_0x7a6d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7a6d('0x11')](function(_0x1be483){logger[_0x7a6d('0x12')](_0x7a6d('0x1c'),_0x52604e);logger[_0x7a6d('0x15')](_0x7a6d('0x1c'),_0x52604e,JSON[_0x7a6d('0x17')](_0x1be483));_0x1ff0bc(_0x1be483);})[_0x7a6d('0x26')](function(_0x3c0044){logger[_0x7a6d('0x18')](_0x7a6d('0x1c'),_0x3c0044['message'],_0x52604e);_0x5a7a14(_0x1f8c5d[_0x7a6d('0x18')](0x1f4,_0x3c0044[_0x7a6d('0x1a')]));});});};exports['ShowFaxQueue']=function(_0x36b337){var _0x2a1db5=this;return new Promise(function(_0x599223,_0x2447ad){return db[_0x7a6d('0x1d')]['find']({'raw':_0x36b337['options']?_0x36b337[_0x7a6d('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x36b337[_0x7a6d('0x1f')]?_0x36b337['options']['where']||null:null,'attributes':_0x36b337[_0x7a6d('0x1f')]?_0x36b337['options'][_0x7a6d('0x21')]||null:null,'include':_0x36b337[_0x7a6d('0x1f')]?_0x36b337[_0x7a6d('0x1f')]['include']?_[_0x7a6d('0x23')](_0x36b337[_0x7a6d('0x1f')][_0x7a6d('0x24')],function(_0x9320c6){return{'model':db[_0x9320c6[_0x7a6d('0x25')]],'as':_0x9320c6['as'],'attributes':_0x9320c6['attributes'],'include':_0x9320c6['include']?_[_0x7a6d('0x23')](_0x9320c6['include'],function(_0xe5d50f){return{'model':db[_0xe5d50f[_0x7a6d('0x25')]],'as':_0xe5d50f['as'],'attributes':_0xe5d50f['attributes'],'include':_0xe5d50f[_0x7a6d('0x24')]?_[_0x7a6d('0x23')](_0xe5d50f['include'],function(_0x2cc028){return{'model':db[_0x2cc028[_0x7a6d('0x25')]],'as':_0x2cc028['as'],'attributes':_0x2cc028['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a6d('0x11')](function(_0x2a77b1){logger[_0x7a6d('0x12')](_0x7a6d('0x27'),_0x36b337);logger[_0x7a6d('0x15')](_0x7a6d('0x27'),_0x36b337,JSON[_0x7a6d('0x17')](_0x2a77b1));_0x599223(_0x2a77b1);})[_0x7a6d('0x26')](function(_0x8df140){logger[_0x7a6d('0x18')](_0x7a6d('0x27'),_0x8df140[_0x7a6d('0x1a')],_0x36b337);_0x2447ad(_0x2a1db5['error'](0x1f4,_0x8df140[_0x7a6d('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index ac1554c..ea11645 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 _0xd776=['length','faxQueue:','./faxQueue.events','save','remove','update','emit'];(function(_0x3d63cf,_0x4d141d){var _0x1d959e=function(_0x26e82a){while(--_0x26e82a){_0x3d63cf['push'](_0x3d63cf['shift']());}};_0x1d959e(++_0x4d141d);}(_0xd776,0x8e));var _0x6d77=function(_0x4a5dae,_0x37c20e){_0x4a5dae=_0x4a5dae-0x0;var _0x4d8ff9=_0xd776[_0x4a5dae];return _0x4d8ff9;};'use strict';var FaxQueueEvents=require(_0x6d77('0x0'));var events=[_0x6d77('0x1'),_0x6d77('0x2'),_0x6d77('0x3')];function createListener(_0x2cf3fe,_0x11ac39){return function(_0x8b03fc){_0x11ac39[_0x6d77('0x4')](_0x2cf3fe,_0x8b03fc);};}function removeListener(_0x471627,_0x4f510d){return function(){FaxQueueEvents['removeListener'](_0x471627,_0x4f510d);};}exports['register']=function(_0x267439){for(var _0x2b95a5=0x0,_0x4f7480=events[_0x6d77('0x5')];_0x2b95a5<_0x4f7480;_0x2b95a5++){var _0x4b16a7=events[_0x2b95a5];var _0xa1c190=createListener(_0x6d77('0x6')+_0x4b16a7,_0x267439);FaxQueueEvents['on'](_0x4b16a7,_0xa1c190);}}; \ No newline at end of file +var _0xa542=['length','faxQueue:','./faxQueue.events','save','update','emit','removeListener','register'];(function(_0x38f529,_0x258d83){var _0x21fde5=function(_0x237c36){while(--_0x237c36){_0x38f529['push'](_0x38f529['shift']());}};_0x21fde5(++_0x258d83);}(_0xa542,0x15a));var _0x2a54=function(_0x4dd66d,_0x3a04ff){_0x4dd66d=_0x4dd66d-0x0;var _0x549c02=_0xa542[_0x4dd66d];return _0x549c02;};'use strict';var FaxQueueEvents=require(_0x2a54('0x0'));var events=[_0x2a54('0x1'),'remove',_0x2a54('0x2')];function createListener(_0x19426b,_0x373e7e){return function(_0x511c5d){_0x373e7e[_0x2a54('0x3')](_0x19426b,_0x511c5d);};}function removeListener(_0xeedb98,_0x540eb7){return function(){FaxQueueEvents[_0x2a54('0x4')](_0xeedb98,_0x540eb7);};}exports[_0x2a54('0x5')]=function(_0x2c034c){for(var _0x4aafc4=0x0,_0x253122=events[_0x2a54('0x6')];_0x4aafc4<_0x253122;_0x4aafc4++){var _0x5166a0=events[_0x4aafc4];var _0x2ca0d9=createListener(_0x2a54('0x7')+_0x5166a0,_0x2c034c);FaxQueueEvents['on'](_0x5166a0,_0x2ca0d9);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index fe168d2..dc2012b 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 _0xdac6=['multer','util','path','express','Router','fs-extra','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports'];(function(_0x2bfef7,_0x54322c){var _0x4babfd=function(_0x356366){while(--_0x356366){_0x2bfef7['push'](_0x2bfef7['shift']());}};_0x4babfd(++_0x54322c);}(_0xdac6,0x174));var _0x6dac=function(_0x1bcd24,_0x2fe246){_0x1bcd24=_0x1bcd24-0x0;var _0x125333=_0xdac6[_0x1bcd24];return _0x125333;};'use strict';var multer=require(_0x6dac('0x0'));var util=require(_0x6dac('0x1'));var path=require(_0x6dac('0x2'));var timeout=require('connect-timeout');var express=require(_0x6dac('0x3'));var router=express[_0x6dac('0x4')]();var fs_extra=require(_0x6dac('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6dac('0x6'));var controller=require(_0x6dac('0x7'));router[_0x6dac('0x8')]('/',auth[_0x6dac('0x9')](),controller[_0x6dac('0xa')]);router[_0x6dac('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x6dac('0xb')]);router[_0x6dac('0x8')](_0x6dac('0xc'),auth[_0x6dac('0x9')](),controller[_0x6dac('0xd')]);router['get'](_0x6dac('0xe'),auth[_0x6dac('0x9')](),controller[_0x6dac('0xf')]);router[_0x6dac('0x8')](_0x6dac('0x10'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x11')]);router[_0x6dac('0x8')](_0x6dac('0x12'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x13')]);router[_0x6dac('0x14')]('/',auth['isAuthenticated'](),controller[_0x6dac('0x15')]);router[_0x6dac('0x14')](_0x6dac('0x10'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x16')]);router[_0x6dac('0x14')](_0x6dac('0x12'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x17')]);router[_0x6dac('0x18')](_0x6dac('0xc'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x19')]);router[_0x6dac('0x1a')]('/:id',auth[_0x6dac('0x9')](),controller[_0x6dac('0x1b')]);router['delete'](_0x6dac('0x10'),auth['isAuthenticated'](),controller[_0x6dac('0x1c')]);router[_0x6dac('0x1a')](_0x6dac('0x12'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x1d')]);module[_0x6dac('0x1e')]=router; \ No newline at end of file +var _0xfbd6=['util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','/describe','describe','show','get','/:id/members','getMembers','/:id/users','getAgents','create','post','/:id/teams','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xfbd6,0xdf));var _0x6fbd=function(_0x8f2060,_0x5b7e23){_0x8f2060=_0x8f2060-0x0;var _0x1727d9=_0xfbd6[_0x8f2060];return _0x1727d9;};'use strict';var multer=require(_0x6fbd('0x0'));var util=require(_0x6fbd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6fbd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6fbd('0x3'));var interaction=require(_0x6fbd('0x4'));var config=require(_0x6fbd('0x5'));var controller=require(_0x6fbd('0x6'));router['get']('/',auth[_0x6fbd('0x7')](),controller[_0x6fbd('0x8')]);router['get'](_0x6fbd('0x9'),auth['isAuthenticated'](),controller[_0x6fbd('0xa')]);router['get']('/:id',auth[_0x6fbd('0x7')](),controller[_0x6fbd('0xb')]);router[_0x6fbd('0xc')](_0x6fbd('0xd'),auth['isAuthenticated'](),controller[_0x6fbd('0xe')]);router['get']('/:id/teams',auth[_0x6fbd('0x7')](),controller['getTeams']);router[_0x6fbd('0xc')](_0x6fbd('0xf'),auth[_0x6fbd('0x7')](),controller[_0x6fbd('0x10')]);router['post']('/',auth[_0x6fbd('0x7')](),controller[_0x6fbd('0x11')]);router[_0x6fbd('0x12')](_0x6fbd('0x13'),auth[_0x6fbd('0x7')](),controller[_0x6fbd('0x14')]);router['post'](_0x6fbd('0xf'),auth[_0x6fbd('0x7')](),controller['addAgents']);router[_0x6fbd('0x15')]('/:id',auth[_0x6fbd('0x7')](),controller[_0x6fbd('0x16')]);router[_0x6fbd('0x17')]('/:id',auth[_0x6fbd('0x7')](),controller[_0x6fbd('0x18')]);router['delete'](_0x6fbd('0x13'),auth[_0x6fbd('0x7')](),controller[_0x6fbd('0x19')]);router['delete']('/:id/users',auth[_0x6fbd('0x7')](),controller[_0x6fbd('0x1a')]);module[_0x6fbd('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 0cba62e..2b8ff91 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 _0x9a28=['STRING','DATE','moment','sequelize','exports'];(function(_0x492210,_0x3b6e9e){var _0xd565b2=function(_0xa4ed04){while(--_0xa4ed04){_0x492210['push'](_0x492210['shift']());}};_0xd565b2(++_0x3b6e9e);}(_0x9a28,0x7a));var _0x89a2=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x9a28[_0x4b2863];return _0x567d67;};'use strict';var moment=require(_0x89a2('0x0'));var Sequelize=require(_0x89a2('0x1'));module[_0x89a2('0x2')]={'uniqueid':{'type':Sequelize[_0x89a2('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x89a2('0x4')]},'acceptAt':{'type':Sequelize[_0x89a2('0x4')]},'exitAt':{'type':Sequelize[_0x89a2('0x4')]},'reason':{'type':Sequelize[_0x89a2('0x3')]}}; \ No newline at end of file +var _0x72a0=['DATE','exports','STRING'];(function(_0x236673,_0x11daf2){var _0x44e60a=function(_0x10f2a5){while(--_0x10f2a5){_0x236673['push'](_0x236673['shift']());}};_0x44e60a(++_0x11daf2);}(_0x72a0,0x166));var _0x072a=function(_0x34c6b9,_0x16b412){_0x34c6b9=_0x34c6b9-0x0;var _0x536293=_0x72a0[_0x34c6b9];return _0x536293;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x072a('0x0')]={'uniqueid':{'type':Sequelize[_0x072a('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x072a('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x072a('0x2')]},'exitAt':{'type':Sequelize[_0x072a('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 50b6b00..8c92f39 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 _0xb10b=['include','findAll','rows','catch','model','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','index','FaxQueueReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll'];(function(_0x1f3360,_0x6d9ecb){var _0x6b2920=function(_0x1d3876){while(--_0x1d3876){_0x1f3360['push'](_0x1f3360['shift']());}};_0x6b2920(++_0x6d9ecb);}(_0xb10b,0x12a));var _0xbb10=function(_0x5089ea,_0x3d8378){_0x5089ea=_0x5089ea-0x0;var _0xabe953=_0xb10b[_0x5089ea];return _0xabe953;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=_0x36b5e8[_0xbb10('0x1b')],_0x2b184e=_0x24a57b[_0xbb10('0x1c')],_0x4a2bfc=_0x24a57b[_0xbb10('0x1c')]+_0x24a57b[_0xbb10('0x1d')],_0x2eca0f;if(_0x4a2bfc>=_0x3e26f4){_0x4a2bfc=_0x3e26f4;_0x2eca0f=0xc8;}else{_0x2eca0f=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x2eca0f);return _0x2f2ebf[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x2b184e+'-'+_0x4a2bfc+'/'+_0x3e26f4)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xe1c665){return function(_0x48b6e9){try{jsonpatch[_0xbb10('0x20')](_0x48b6e9,_0xe1c665,!![]);}catch(_0x19f48d){return BPromise[_0xbb10('0x21')](_0x19f48d);}return _0x48b6e9[_0xbb10('0x22')]();};}function saveUpdates(_0xdf237d,_0x44e563){return function(_0x4deb49){if(_0x4deb49){return _0x4deb49[_0xbb10('0x23')](_0xdf237d)[_0xbb10('0x24')](function(_0x50aea1){return _0x50aea1;});}return null;};}function removeEntity(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x25')]()[_0xbb10('0x24')](function(){_0x4c4b0d[_0xbb10('0x19')](0xcc)[_0xbb10('0x26')]();});}};}function handleEntityNotFound(_0x407cb4,_0x436104){return function(_0x7f2377){if(!_0x7f2377){_0x407cb4[_0xbb10('0x18')](0x194);}return _0x7f2377;};}function handleError(_0x3ba6cd,_0x26ad93){_0x26ad93=_0x26ad93||0x1f4;return function(_0x537898){logger['error'](_0x537898['stack']);if(_0x537898[_0xbb10('0x27')]){delete _0x537898[_0xbb10('0x27')];}_0x3ba6cd[_0xbb10('0x19')](_0x26ad93)['send'](_0x537898);};}exports[_0xbb10('0x28')]=function(_0x24d586,_0x6ed43b){var _0x1d5e95={},_0x1acce9={},_0x20d946={'count':0x0,'rows':[]};var _0x2a0e8b=_['map'](db[_0xbb10('0x29')][_0xbb10('0x2a')],function(_0xfc3595){return{'name':_0xfc3595[_0xbb10('0x2b')],'type':_0xfc3595[_0xbb10('0x2c')][_0xbb10('0x2d')]};});_0x1acce9['model']=_[_0xbb10('0x2e')](_0x2a0e8b,'name');_0x1acce9[_0xbb10('0x2f')]=_['keys'](_0x24d586[_0xbb10('0x2f')]);_0x1acce9[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x1acce9['model'],_0x1acce9['query']);_0x1d5e95[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x1acce9['model'],qs[_0xbb10('0x33')](_0x24d586[_0xbb10('0x2f')][_0xbb10('0x33')]));_0x1d5e95[_0xbb10('0x32')]=_0x1d5e95[_0xbb10('0x32')][_0xbb10('0x34')]?_0x1d5e95[_0xbb10('0x32')]:_0x1acce9['model'];if(!_0x24d586[_0xbb10('0x2f')][_0xbb10('0x35')](_0xbb10('0x36'))){_0x1d5e95[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x24d586[_0xbb10('0x2f')][_0xbb10('0x1d')]);_0x1d5e95[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x24d586['query'][_0xbb10('0x1c')]);}_0x1d5e95[_0xbb10('0x37')]=qs[_0xbb10('0x38')](_0x24d586[_0xbb10('0x2f')]['sort']);_0x1d5e95[_0xbb10('0x39')]=qs['filters'](_['pick'](_0x24d586[_0xbb10('0x2f')],_0x1acce9[_0xbb10('0x30')]),_0x2a0e8b);if(_0x24d586[_0xbb10('0x2f')][_0xbb10('0x3a')]){_0x1d5e95[_0xbb10('0x39')]=_[_0xbb10('0x3b')](_0x1d5e95['where'],{'$or':_[_0xbb10('0x2e')](_0x2a0e8b,function(_0x25d72f){if(_0x25d72f['type']!=='VIRTUAL'){var _0x5cd55f={};_0x5cd55f[_0x25d72f[_0xbb10('0x27')]]={'$like':'%'+_0x24d586[_0xbb10('0x2f')][_0xbb10('0x3a')]+'%'};return _0x5cd55f;}})});}_0x1d5e95=_['merge']({},_0x1d5e95,_0x24d586[_0xbb10('0x3c')]);var _0x3e8538={'where':_0x1d5e95[_0xbb10('0x39')]};return db['FaxQueueReport'][_0xbb10('0x1b')](_0x3e8538)[_0xbb10('0x24')](function(_0x1dcd38){_0x20d946[_0xbb10('0x1b')]=_0x1dcd38;if(_0x24d586['query'][_0xbb10('0x3d')]){_0x1d5e95[_0xbb10('0x3e')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xbb10('0x3f')](_0x1d5e95);})[_0xbb10('0x24')](function(_0x44d6ae){_0x20d946[_0xbb10('0x40')]=_0x44d6ae;return _0x20d946;})[_0xbb10('0x24')](respondWithFilteredResult(_0x6ed43b,_0x1d5e95))[_0xbb10('0x41')](handleError(_0x6ed43b,null));};exports['show']=function(_0x1e8f79,_0x1c7fae){var _0x3e7b4c={'raw':!![],'where':{'id':_0x1e8f79['params']['id']}},_0x3d3c41={};_0x3d3c41[_0xbb10('0x42')]=_[_0xbb10('0x43')](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x3d3c41['query']=_[_0xbb10('0x43')](_0x1e8f79[_0xbb10('0x2f')]);_0x3d3c41['filters']=_['intersection'](_0x3d3c41[_0xbb10('0x42')],_0x3d3c41['query']);_0x3e7b4c[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x3d3c41['model'],qs[_0xbb10('0x33')](_0x1e8f79[_0xbb10('0x2f')][_0xbb10('0x33')]));_0x3e7b4c['attributes']=_0x3e7b4c[_0xbb10('0x32')][_0xbb10('0x34')]?_0x3e7b4c[_0xbb10('0x32')]:_0x3d3c41[_0xbb10('0x42')];if(_0x1e8f79[_0xbb10('0x2f')][_0xbb10('0x3d')]){_0x3e7b4c[_0xbb10('0x3e')]=[{'all':!![]}];}_0x3e7b4c=_[_0xbb10('0x3b')]({},_0x3e7b4c,_0x1e8f79[_0xbb10('0x3c')]);return db[_0xbb10('0x29')][_0xbb10('0x44')](_0x3e7b4c)[_0xbb10('0x24')](handleEntityNotFound(_0x1c7fae,null))['then'](respondWithResult(_0x1c7fae,null))[_0xbb10('0x41')](handleError(_0x1c7fae,null));};exports[_0xbb10('0x45')]=function(_0x4a1248,_0x14e1cb){return db[_0xbb10('0x29')][_0xbb10('0x45')](_0x4a1248[_0xbb10('0x46')],{})[_0xbb10('0x24')](respondWithResult(_0x14e1cb,0xc9))[_0xbb10('0x41')](handleError(_0x14e1cb,null));};exports[_0xbb10('0x23')]=function(_0x5be85e,_0x4a9793){if(_0x5be85e[_0xbb10('0x46')]['id']){delete _0x5be85e[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x29')]['find']({'where':{'id':_0x5be85e['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x4a9793,null))[_0xbb10('0x24')](saveUpdates(_0x5be85e[_0xbb10('0x46')],null))[_0xbb10('0x24')](respondWithResult(_0x4a9793,null))[_0xbb10('0x41')](handleError(_0x4a9793,null));};exports[_0xbb10('0x25')]=function(_0x2f2552,_0x460788){return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x2f2552['params']['id']}})['then'](handleEntityNotFound(_0x460788,null))[_0xbb10('0x24')](removeEntity(_0x460788,null))[_0xbb10('0x41')](handleError(_0x460788,null));};exports[_0xbb10('0x47')]=function(_0xb014b0,_0x36aa7d){return db[_0xbb10('0x29')][_0xbb10('0x47')]()[_0xbb10('0x24')](respondWithResult(_0x36aa7d,null))[_0xbb10('0x41')](handleError(_0x36aa7d,null));}; \ No newline at end of file +var _0xb10b=['include','findAll','rows','catch','model','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','index','FaxQueueReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll'];(function(_0x37ce45,_0xda6746){var _0x17d5f7=function(_0x559ab7){while(--_0x559ab7){_0x37ce45['push'](_0x37ce45['shift']());}};_0x17d5f7(++_0xda6746);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d6e56,_0x1959b9){_0x1d6e56=_0x1d6e56-0x0;var _0xef8e84=_0xb10b[_0x1d6e56];return _0xef8e84;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=_0x36b5e8[_0xbb10('0x1b')],_0x2b184e=_0x24a57b[_0xbb10('0x1c')],_0x4a2bfc=_0x24a57b[_0xbb10('0x1c')]+_0x24a57b[_0xbb10('0x1d')],_0x2eca0f;if(_0x4a2bfc>=_0x3e26f4){_0x4a2bfc=_0x3e26f4;_0x2eca0f=0xc8;}else{_0x2eca0f=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x2eca0f);return _0x2f2ebf[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x2b184e+'-'+_0x4a2bfc+'/'+_0x3e26f4)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xe1c665){return function(_0x48b6e9){try{jsonpatch[_0xbb10('0x20')](_0x48b6e9,_0xe1c665,!![]);}catch(_0x19f48d){return BPromise[_0xbb10('0x21')](_0x19f48d);}return _0x48b6e9[_0xbb10('0x22')]();};}function saveUpdates(_0xdf237d,_0x44e563){return function(_0x4deb49){if(_0x4deb49){return _0x4deb49[_0xbb10('0x23')](_0xdf237d)[_0xbb10('0x24')](function(_0x50aea1){return _0x50aea1;});}return null;};}function removeEntity(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x25')]()[_0xbb10('0x24')](function(){_0x4c4b0d[_0xbb10('0x19')](0xcc)[_0xbb10('0x26')]();});}};}function handleEntityNotFound(_0x407cb4,_0x436104){return function(_0x7f2377){if(!_0x7f2377){_0x407cb4[_0xbb10('0x18')](0x194);}return _0x7f2377;};}function handleError(_0x3ba6cd,_0x26ad93){_0x26ad93=_0x26ad93||0x1f4;return function(_0x537898){logger['error'](_0x537898['stack']);if(_0x537898[_0xbb10('0x27')]){delete _0x537898[_0xbb10('0x27')];}_0x3ba6cd[_0xbb10('0x19')](_0x26ad93)['send'](_0x537898);};}exports[_0xbb10('0x28')]=function(_0x24d586,_0x6ed43b){var _0x1d5e95={},_0x1acce9={},_0x20d946={'count':0x0,'rows':[]};var _0x2a0e8b=_['map'](db[_0xbb10('0x29')][_0xbb10('0x2a')],function(_0xfc3595){return{'name':_0xfc3595[_0xbb10('0x2b')],'type':_0xfc3595[_0xbb10('0x2c')][_0xbb10('0x2d')]};});_0x1acce9['model']=_[_0xbb10('0x2e')](_0x2a0e8b,'name');_0x1acce9[_0xbb10('0x2f')]=_['keys'](_0x24d586[_0xbb10('0x2f')]);_0x1acce9[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x1acce9['model'],_0x1acce9['query']);_0x1d5e95[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x1acce9['model'],qs[_0xbb10('0x33')](_0x24d586[_0xbb10('0x2f')][_0xbb10('0x33')]));_0x1d5e95[_0xbb10('0x32')]=_0x1d5e95[_0xbb10('0x32')][_0xbb10('0x34')]?_0x1d5e95[_0xbb10('0x32')]:_0x1acce9['model'];if(!_0x24d586[_0xbb10('0x2f')][_0xbb10('0x35')](_0xbb10('0x36'))){_0x1d5e95[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x24d586[_0xbb10('0x2f')][_0xbb10('0x1d')]);_0x1d5e95[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x24d586['query'][_0xbb10('0x1c')]);}_0x1d5e95[_0xbb10('0x37')]=qs[_0xbb10('0x38')](_0x24d586[_0xbb10('0x2f')]['sort']);_0x1d5e95[_0xbb10('0x39')]=qs['filters'](_['pick'](_0x24d586[_0xbb10('0x2f')],_0x1acce9[_0xbb10('0x30')]),_0x2a0e8b);if(_0x24d586[_0xbb10('0x2f')][_0xbb10('0x3a')]){_0x1d5e95[_0xbb10('0x39')]=_[_0xbb10('0x3b')](_0x1d5e95['where'],{'$or':_[_0xbb10('0x2e')](_0x2a0e8b,function(_0x25d72f){if(_0x25d72f['type']!=='VIRTUAL'){var _0x5cd55f={};_0x5cd55f[_0x25d72f[_0xbb10('0x27')]]={'$like':'%'+_0x24d586[_0xbb10('0x2f')][_0xbb10('0x3a')]+'%'};return _0x5cd55f;}})});}_0x1d5e95=_['merge']({},_0x1d5e95,_0x24d586[_0xbb10('0x3c')]);var _0x3e8538={'where':_0x1d5e95[_0xbb10('0x39')]};return db['FaxQueueReport'][_0xbb10('0x1b')](_0x3e8538)[_0xbb10('0x24')](function(_0x1dcd38){_0x20d946[_0xbb10('0x1b')]=_0x1dcd38;if(_0x24d586['query'][_0xbb10('0x3d')]){_0x1d5e95[_0xbb10('0x3e')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xbb10('0x3f')](_0x1d5e95);})[_0xbb10('0x24')](function(_0x44d6ae){_0x20d946[_0xbb10('0x40')]=_0x44d6ae;return _0x20d946;})[_0xbb10('0x24')](respondWithFilteredResult(_0x6ed43b,_0x1d5e95))[_0xbb10('0x41')](handleError(_0x6ed43b,null));};exports['show']=function(_0x1e8f79,_0x1c7fae){var _0x3e7b4c={'raw':!![],'where':{'id':_0x1e8f79['params']['id']}},_0x3d3c41={};_0x3d3c41[_0xbb10('0x42')]=_[_0xbb10('0x43')](db[_0xbb10('0x29')][_0xbb10('0x2a')]);_0x3d3c41['query']=_[_0xbb10('0x43')](_0x1e8f79[_0xbb10('0x2f')]);_0x3d3c41['filters']=_['intersection'](_0x3d3c41[_0xbb10('0x42')],_0x3d3c41['query']);_0x3e7b4c[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x3d3c41['model'],qs[_0xbb10('0x33')](_0x1e8f79[_0xbb10('0x2f')][_0xbb10('0x33')]));_0x3e7b4c['attributes']=_0x3e7b4c[_0xbb10('0x32')][_0xbb10('0x34')]?_0x3e7b4c[_0xbb10('0x32')]:_0x3d3c41[_0xbb10('0x42')];if(_0x1e8f79[_0xbb10('0x2f')][_0xbb10('0x3d')]){_0x3e7b4c[_0xbb10('0x3e')]=[{'all':!![]}];}_0x3e7b4c=_[_0xbb10('0x3b')]({},_0x3e7b4c,_0x1e8f79[_0xbb10('0x3c')]);return db[_0xbb10('0x29')][_0xbb10('0x44')](_0x3e7b4c)[_0xbb10('0x24')](handleEntityNotFound(_0x1c7fae,null))['then'](respondWithResult(_0x1c7fae,null))[_0xbb10('0x41')](handleError(_0x1c7fae,null));};exports[_0xbb10('0x45')]=function(_0x4a1248,_0x14e1cb){return db[_0xbb10('0x29')][_0xbb10('0x45')](_0x4a1248[_0xbb10('0x46')],{})[_0xbb10('0x24')](respondWithResult(_0x14e1cb,0xc9))[_0xbb10('0x41')](handleError(_0x14e1cb,null));};exports[_0xbb10('0x23')]=function(_0x5be85e,_0x4a9793){if(_0x5be85e[_0xbb10('0x46')]['id']){delete _0x5be85e[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x29')]['find']({'where':{'id':_0x5be85e['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x4a9793,null))[_0xbb10('0x24')](saveUpdates(_0x5be85e[_0xbb10('0x46')],null))[_0xbb10('0x24')](respondWithResult(_0x4a9793,null))[_0xbb10('0x41')](handleError(_0x4a9793,null));};exports[_0xbb10('0x25')]=function(_0x2f2552,_0x460788){return db[_0xbb10('0x29')][_0xbb10('0x44')]({'where':{'id':_0x2f2552['params']['id']}})['then'](handleEntityNotFound(_0x460788,null))[_0xbb10('0x24')](removeEntity(_0x460788,null))[_0xbb10('0x41')](handleError(_0x460788,null));};exports[_0xbb10('0x47')]=function(_0xb014b0,_0x36aa7d){return db[_0xbb10('0x29')][_0xbb10('0x47')]()[_0xbb10('0x24')](respondWithResult(_0x36aa7d,null))[_0xbb10('0x41')](handleError(_0x36aa7d,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index d90bd10..0be130e 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 _0xaea5=['../../config/logger','api','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash','util'];(function(_0x2a672e,_0x1020ec){var _0x394528=function(_0x6f3ac8){while(--_0x6f3ac8){_0x2a672e['push'](_0x2a672e['shift']());}};_0x394528(++_0x1020ec);}(_0xaea5,0xbe));var _0x5aea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaea5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5aea('0x0'));var util=require(_0x5aea('0x1'));var logger=require(_0x5aea('0x2'))(_0x5aea('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5aea('0x4'));var fs=require('fs');var path=require(_0x5aea('0x5'));var rimraf=require('rimraf');var config=require(_0x5aea('0x6'));var attributes=require(_0x5aea('0x7'));module[_0x5aea('0x8')]=function(_0x2fd100,_0xe92c0){return _0x2fd100[_0x5aea('0x9')]('FaxQueueReport',attributes,{'tableName':_0x5aea('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5aea('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x272c=['define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxQueueReport.attributes','exports'];(function(_0x2fd22a,_0x3d1a91){var _0x1205a9=function(_0x2f443b){while(--_0x2f443b){_0x2fd22a['push'](_0x2fd22a['shift']());}};_0x1205a9(++_0x3d1a91);}(_0x272c,0x1bd));var _0xc272=function(_0x230807,_0x530704){_0x230807=_0x230807-0x0;var _0x527549=_0x272c[_0x230807];return _0x527549;};'use strict';var _=require(_0xc272('0x0'));var util=require(_0xc272('0x1'));var logger=require(_0xc272('0x2'))(_0xc272('0x3'));var moment=require(_0xc272('0x4'));var BPromise=require('bluebird');var rp=require(_0xc272('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc272('0x6'));var config=require(_0xc272('0x7'));var attributes=require(_0xc272('0x8'));module[_0xc272('0x9')]=function(_0x1ab84d,_0x2bbfd1){return _0x1ab84d[_0xc272('0xa')]('FaxQueueReport',attributes,{'tableName':_0xc272('0xb'),'paranoid':![],'indexes':[{'name':_0xc272('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index c6f767f..9493ada 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 _0x65cf=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','update','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3d6b3e,_0x5cbb23){var _0x2bb283=function(_0x2c2ddd){while(--_0x2c2ddd){_0x3d6b3e['push'](_0x3d6b3e['shift']());}};_0x2bb283(++_0x5cbb23);}(_0x65cf,0xe0));var _0xf65c=function(_0x4861f2,_0x599fbe){_0x4861f2=_0x4861f2-0x0;var _0x45827e=_0x65cf[_0x4861f2];return _0x45827e;};'use strict';var _=require(_0xf65c('0x0'));var util=require(_0xf65c('0x1'));var moment=require(_0xf65c('0x2'));var BPromise=require('bluebird');var rs=require(_0xf65c('0x3'));var fs=require('fs');var Redis=require(_0xf65c('0x4'));var db=require(_0xf65c('0x5'))['db'];var utils=require(_0xf65c('0x6'));var logger=require(_0xf65c('0x7'))(_0xf65c('0x8'));var config=require(_0xf65c('0x9'));var jayson=require(_0xf65c('0xa'));var client=jayson['client'][_0xf65c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6638b8,_0x1749a7,_0x14a1b0){return new BPromise(function(_0x1d1b16,_0x419298){return client[_0xf65c('0xc')](_0x6638b8,_0x14a1b0)[_0xf65c('0xd')](function(_0x488bd8){logger[_0xf65c('0xe')](_0xf65c('0xf'),_0x1749a7,_0xf65c('0x10'));logger[_0xf65c('0x11')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1749a7,_0xf65c('0x10'),JSON[_0xf65c('0x12')](_0x488bd8));if(_0x488bd8[_0xf65c('0x13')]){if(_0x488bd8[_0xf65c('0x13')]['code']===0x1f4){logger[_0xf65c('0x13')](_0xf65c('0xf'),_0x1749a7,_0x488bd8['error']['message']);return _0x419298(_0x488bd8['error'][_0xf65c('0x14')]);}logger[_0xf65c('0x13')](_0xf65c('0xf'),_0x1749a7,_0x488bd8[_0xf65c('0x13')]['message']);return _0x1d1b16(_0x488bd8[_0xf65c('0x13')][_0xf65c('0x14')]);}else{logger[_0xf65c('0xe')](_0xf65c('0xf'),_0x1749a7,'request\x20sent');_0x1d1b16(_0x488bd8[_0xf65c('0x15')][_0xf65c('0x14')]);}})[_0xf65c('0x16')](function(_0x112d68){logger[_0xf65c('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x1749a7,_0x112d68);_0x419298(_0x112d68);});});}exports[_0xf65c('0x17')]=function(_0x3d60c2){var _0x25c361=this;return new Promise(function(_0x2a52ed,_0x3bf9a1){return db[_0xf65c('0x18')][_0xf65c('0x19')](_0x3d60c2[_0xf65c('0x1a')],{'raw':_0x3d60c2[_0xf65c('0x1b')]?_0x3d60c2[_0xf65c('0x1b')][_0xf65c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x53e02f){logger[_0xf65c('0xe')](_0xf65c('0x17'),_0x3d60c2);logger['debug'](_0xf65c('0x17'),_0x3d60c2,JSON[_0xf65c('0x12')](_0x53e02f));_0x2a52ed(_0x53e02f);})[_0xf65c('0x16')](function(_0x39cff0){logger[_0xf65c('0x13')](_0xf65c('0x17'),_0x39cff0[_0xf65c('0x14')],_0x3d60c2);_0x3bf9a1(_0x25c361[_0xf65c('0x13')](0x1f4,_0x39cff0[_0xf65c('0x14')]));});});};exports['UpdateFaxQueueReport']=function(_0x1c8259){var _0x23d839=this;return new Promise(function(_0x103635,_0x507691){return db[_0xf65c('0x18')][_0xf65c('0x1d')](_0x1c8259[_0xf65c('0x1a')],{'raw':_0x1c8259[_0xf65c('0x1b')]?_0x1c8259[_0xf65c('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c8259[_0xf65c('0x1b')]?_0x1c8259[_0xf65c('0x1b')]['where']||null:null,'attributes':_0x1c8259[_0xf65c('0x1b')]?_0x1c8259[_0xf65c('0x1b')][_0xf65c('0x1e')]||null:null,'limit':_0x1c8259[_0xf65c('0x1b')]?_0x1c8259['options'][_0xf65c('0x1f')]||null:null})[_0xf65c('0xd')](function(_0x4f7ac8){logger['info'](_0xf65c('0x20'),_0x1c8259);logger[_0xf65c('0x11')]('UpdateFaxQueueReport',_0x1c8259,JSON[_0xf65c('0x12')](_0x4f7ac8));_0x103635(_0x4f7ac8);})[_0xf65c('0x16')](function(_0x4d695f){logger['error']('UpdateFaxQueueReport',_0x4d695f[_0xf65c('0x14')],_0x1c8259);_0x507691(_0x23d839['error'](0x1f4,_0x4d695f[_0xf65c('0x14')]));});});}; \ No newline at end of file +var _0x8ecb=['result','catch','CreateFaxQueueReport','FaxQueueReport','options','raw','UpdateFaxQueueReport','where','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x358320,_0xaf1acc){var _0x1973e4=function(_0xd9bfc4){while(--_0xd9bfc4){_0x358320['push'](_0x358320['shift']());}};_0x1973e4(++_0xaf1acc);}(_0x8ecb,0x129));var _0xb8ec=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x8ecb[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xb8ec('0x0'));var util=require(_0xb8ec('0x1'));var moment=require('moment');var BPromise=require(_0xb8ec('0x2'));var rs=require(_0xb8ec('0x3'));var fs=require('fs');var Redis=require(_0xb8ec('0x4'));var db=require(_0xb8ec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb8ec('0x6'))(_0xb8ec('0x7'));var config=require(_0xb8ec('0x8'));var jayson=require(_0xb8ec('0x9'));var client=jayson[_0xb8ec('0xa')][_0xb8ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x486e89,_0x2219b1,_0x27fb22){return new BPromise(function(_0x47324f,_0x1d9d32){return client[_0xb8ec('0xc')](_0x486e89,_0x27fb22)[_0xb8ec('0xd')](function(_0x4aad66){logger[_0xb8ec('0xe')](_0xb8ec('0xf'),_0x2219b1,_0xb8ec('0x10'));logger[_0xb8ec('0x11')](_0xb8ec('0x12'),_0x2219b1,_0xb8ec('0x10'),JSON[_0xb8ec('0x13')](_0x4aad66));if(_0x4aad66['error']){if(_0x4aad66[_0xb8ec('0x14')][_0xb8ec('0x15')]===0x1f4){logger[_0xb8ec('0x14')](_0xb8ec('0xf'),_0x2219b1,_0x4aad66[_0xb8ec('0x14')]['message']);return _0x1d9d32(_0x4aad66[_0xb8ec('0x14')][_0xb8ec('0x16')]);}logger[_0xb8ec('0x14')](_0xb8ec('0xf'),_0x2219b1,_0x4aad66['error']['message']);return _0x47324f(_0x4aad66[_0xb8ec('0x14')][_0xb8ec('0x16')]);}else{logger[_0xb8ec('0xe')](_0xb8ec('0xf'),_0x2219b1,'request\x20sent');_0x47324f(_0x4aad66[_0xb8ec('0x17')]['message']);}})[_0xb8ec('0x18')](function(_0x16aa98){logger[_0xb8ec('0x14')](_0xb8ec('0xf'),_0x2219b1,_0x16aa98);_0x1d9d32(_0x16aa98);});});}exports[_0xb8ec('0x19')]=function(_0x1b4519){var _0x225cc4=this;return new Promise(function(_0x22d3e7,_0x5b93f4){return db[_0xb8ec('0x1a')]['create'](_0x1b4519['body'],{'raw':_0x1b4519['options']?_0x1b4519[_0xb8ec('0x1b')][_0xb8ec('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x438487){logger[_0xb8ec('0xe')](_0xb8ec('0x19'),_0x1b4519);logger[_0xb8ec('0x11')](_0xb8ec('0x19'),_0x1b4519,JSON[_0xb8ec('0x13')](_0x438487));_0x22d3e7(_0x438487);})[_0xb8ec('0x18')](function(_0x15647f){logger[_0xb8ec('0x14')](_0xb8ec('0x19'),_0x15647f[_0xb8ec('0x16')],_0x1b4519);_0x5b93f4(_0x225cc4[_0xb8ec('0x14')](0x1f4,_0x15647f[_0xb8ec('0x16')]));});});};exports[_0xb8ec('0x1d')]=function(_0x4be3af){var _0x102b79=this;return new Promise(function(_0x17bf45,_0x3841ba){return db[_0xb8ec('0x1a')]['update'](_0x4be3af['body'],{'raw':_0x4be3af[_0xb8ec('0x1b')]?_0x4be3af[_0xb8ec('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4be3af[_0xb8ec('0x1b')]?_0x4be3af[_0xb8ec('0x1b')][_0xb8ec('0x1e')]||null:null,'attributes':_0x4be3af[_0xb8ec('0x1b')]?_0x4be3af[_0xb8ec('0x1b')]['attributes']||null:null,'limit':_0x4be3af[_0xb8ec('0x1b')]?_0x4be3af[_0xb8ec('0x1b')][_0xb8ec('0x1f')]||null:null})['then'](function(_0x335c2e){logger[_0xb8ec('0xe')](_0xb8ec('0x1d'),_0x4be3af);logger[_0xb8ec('0x11')]('UpdateFaxQueueReport',_0x4be3af,JSON[_0xb8ec('0x13')](_0x335c2e));_0x17bf45(_0x335c2e);})['catch'](function(_0xde9c){logger['error']('UpdateFaxQueueReport',_0xde9c[_0xb8ec('0x16')],_0x4be3af);_0x3841ba(_0x102b79[_0xb8ec('0x14')](0x1f4,_0xde9c['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ef81d77..14beaba 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 _0xa3a9=['Router','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','exports','multer','util','path','connect-timeout','express'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xa3a9,0xb9));var _0x9a3a=function(_0x58b2ef,_0x53180d){_0x58b2ef=_0x58b2ef-0x0;var _0x4e3465=_0xa3a9[_0x58b2ef];return _0x4e3465;};'use strict';var multer=require(_0x9a3a('0x0'));var util=require(_0x9a3a('0x1'));var path=require(_0x9a3a('0x2'));var timeout=require(_0x9a3a('0x3'));var express=require(_0x9a3a('0x4'));var router=express[_0x9a3a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9a3a('0x6'));var config=require('../../config/environment');var controller=require(_0x9a3a('0x7'));router[_0x9a3a('0x8')]('/',auth[_0x9a3a('0x9')](),controller[_0x9a3a('0xa')]);router[_0x9a3a('0x8')](_0x9a3a('0xb'),auth[_0x9a3a('0x9')](),controller[_0x9a3a('0xc')]);router[_0x9a3a('0x8')](_0x9a3a('0xd'),auth['isAuthenticated'](),controller[_0x9a3a('0xe')]);router[_0x9a3a('0xf')]('/',auth[_0x9a3a('0x9')](),controller[_0x9a3a('0x10')]);router[_0x9a3a('0x11')](_0x9a3a('0xd'),auth[_0x9a3a('0x9')](),controller['update']);router['delete'](_0x9a3a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x9a3a('0x12')]=router; \ No newline at end of file +var _0x5816=['update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','put'];(function(_0x1c22f0,_0x1da98b){var _0x43cf98=function(_0x49c8df){while(--_0x49c8df){_0x1c22f0['push'](_0x1c22f0['shift']());}};_0x43cf98(++_0x1da98b);}(_0x5816,0x158));var _0x6581=function(_0x30b5d8,_0x4cc93c){_0x30b5d8=_0x30b5d8-0x0;var _0x3bbf71=_0x5816[_0x30b5d8];return _0x3bbf71;};'use strict';var multer=require(_0x6581('0x0'));var util=require(_0x6581('0x1'));var path=require(_0x6581('0x2'));var timeout=require(_0x6581('0x3'));var express=require(_0x6581('0x4'));var router=express[_0x6581('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6581('0x6'));var interaction=require(_0x6581('0x7'));var config=require(_0x6581('0x8'));var controller=require('./faxQueueReport.controller');router[_0x6581('0x9')]('/',auth[_0x6581('0xa')](),controller['index']);router[_0x6581('0x9')](_0x6581('0xb'),auth['isAuthenticated'](),controller[_0x6581('0xc')]);router[_0x6581('0x9')](_0x6581('0xd'),auth['isAuthenticated'](),controller[_0x6581('0xe')]);router[_0x6581('0xf')]('/',auth[_0x6581('0xa')](),controller['create']);router[_0x6581('0x10')]('/:id',auth[_0x6581('0xa')](),controller[_0x6581('0x11')]);router['delete'](_0x6581('0xd'),auth[_0x6581('0xa')](),controller[_0x6581('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 95957a7..fbdc99a 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 _0x876a=['moment','sequelize','STRING','ENUM','account','agent','queue','NOW'];(function(_0x51ab83,_0x2721b9){var _0x14b6de=function(_0x243483){while(--_0x243483){_0x51ab83['push'](_0x51ab83['shift']());}};_0x14b6de(++_0x2721b9);}(_0x876a,0x90));var _0xa876=function(_0x344ba3,_0x2dd592){_0x344ba3=_0x344ba3-0x0;var _0x2cf800=_0x876a[_0x344ba3];return _0x2cf800;};'use strict';var moment=require(_0xa876('0x0'));var Sequelize=require(_0xa876('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xa876('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa876('0x3')](_0xa876('0x4'),_0xa876('0x5'),_0xa876('0x6')),'allowNull':![],'defaultValue':_0xa876('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xa876('0x7')]}}; \ No newline at end of file +var _0xd68e=['exports','STRING','agent','DATE','NOW'];(function(_0x155852,_0x4fb051){var _0x35b0a8=function(_0x38398f){while(--_0x38398f){_0x155852['push'](_0x155852['shift']());}};_0x35b0a8(++_0x4fb051);}(_0xd68e,0x195));var _0xed68=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0xd68e[_0x34df4a];return _0x145c69;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xed68('0x0')]={'uniqueid':{'type':Sequelize[_0xed68('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xed68('0x2'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xed68('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xed68('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index a2454f7..aa1dabe 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 _0x8e74=['includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','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','count','offset','limit','Content-Range','reject','save','then','destroy','name','index','FaxTransferReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options'];(function(_0x4884a7,_0x18e38a){var _0x56b60e=function(_0x2ba8a3){while(--_0x2ba8a3){_0x4884a7['push'](_0x4884a7['shift']());}};_0x56b60e(++_0x18e38a);}(_0x8e74,0x97));var _0x48e7=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x8e74[_0x20ef64];return _0x3707d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48e7('0x0'));var zipdir=require(_0x48e7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48e7('0x2'));var moment=require(_0x48e7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x48e7('0x4'));var path=require(_0x48e7('0x5'));var sox=require('sox');var csv=require(_0x48e7('0x6'));var ejs=require(_0x48e7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x48e7('0x8'));var squel=require('squel');var crypto=require(_0x48e7('0x9'));var jsforce=require(_0x48e7('0xa'));var deskjs=require(_0x48e7('0xb'));var toCsv=require(_0x48e7('0x6'));var querystring=require(_0x48e7('0xc'));var Papa=require(_0x48e7('0xd'));var Redis=require('ioredis');var authService=require(_0x48e7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x48e7('0xf'));var hardwareService=require(_0x48e7('0x10'));var logger=require(_0x48e7('0x11'))(_0x48e7('0x12'));var utils=require(_0x48e7('0x13'));var config=require(_0x48e7('0x14'));var licenseUtil=require(_0x48e7('0x15'));var db=require(_0x48e7('0x16'))['db'];function respondWithStatusCode(_0x40dd12,_0x1fbf79){_0x1fbf79=_0x1fbf79||0xcc;return function(_0x5b6238){if(_0x5b6238){return _0x40dd12[_0x48e7('0x17')](_0x1fbf79);}return _0x40dd12['status'](_0x1fbf79)[_0x48e7('0x18')]();};}function respondWithResult(_0x2ee279,_0x3b95dd){_0x3b95dd=_0x3b95dd||0xc8;return function(_0x1a3368){if(_0x1a3368){return _0x2ee279[_0x48e7('0x19')](_0x3b95dd)[_0x48e7('0x1a')](_0x1a3368);}};}function respondWithFilteredResult(_0x51358e,_0xc20016){return function(_0x573bb9){if(_0x573bb9){var _0x360ad5=_0x573bb9[_0x48e7('0x1b')],_0x1d98ae=_0xc20016[_0x48e7('0x1c')],_0x361dda=_0xc20016[_0x48e7('0x1c')]+_0xc20016[_0x48e7('0x1d')],_0x5dfa95;if(_0x361dda>=_0x360ad5){_0x361dda=_0x360ad5;_0x5dfa95=0xc8;}else{_0x5dfa95=0xce;}_0x51358e['status'](_0x5dfa95);return _0x51358e['set'](_0x48e7('0x1e'),_0x1d98ae+'-'+_0x361dda+'/'+_0x360ad5)[_0x48e7('0x1a')](_0x573bb9);}return null;};}function patchUpdates(_0x46856b){return function(_0x36b202){try{jsonpatch['apply'](_0x36b202,_0x46856b,!![]);}catch(_0x5cc946){return BPromise[_0x48e7('0x1f')](_0x5cc946);}return _0x36b202[_0x48e7('0x20')]();};}function saveUpdates(_0x95398e,_0x3c6deb){return function(_0x57330f){if(_0x57330f){return _0x57330f['update'](_0x95398e)[_0x48e7('0x21')](function(_0x4d4e15){return _0x4d4e15;});}return null;};}function removeEntity(_0x418c0c,_0x1e85fc){return function(_0x3be26d){if(_0x3be26d){return _0x3be26d[_0x48e7('0x22')]()['then'](function(){_0x418c0c[_0x48e7('0x19')](0xcc)[_0x48e7('0x18')]();});}};}function handleEntityNotFound(_0x446a28,_0x566655){return function(_0x1f7640){if(!_0x1f7640){_0x446a28['sendStatus'](0x194);}return _0x1f7640;};}function handleError(_0x2fc785,_0x2a75d3){_0x2a75d3=_0x2a75d3||0x1f4;return function(_0x47217d){logger['error'](_0x47217d['stack']);if(_0x47217d[_0x48e7('0x23')]){delete _0x47217d[_0x48e7('0x23')];}_0x2fc785[_0x48e7('0x19')](_0x2a75d3)['send'](_0x47217d);};}exports[_0x48e7('0x24')]=function(_0x18db89,_0x4d72ea){var _0x11ddc5={},_0xda6345={},_0x287477={'count':0x0,'rows':[]};var _0x106a2f=_['map'](db[_0x48e7('0x25')][_0x48e7('0x26')],function(_0x5bbf02){return{'name':_0x5bbf02[_0x48e7('0x27')],'type':_0x5bbf02[_0x48e7('0x28')]['key']};});_0xda6345[_0x48e7('0x29')]=_[_0x48e7('0x2a')](_0x106a2f,'name');_0xda6345[_0x48e7('0x2b')]=_[_0x48e7('0x2c')](_0x18db89['query']);_0xda6345[_0x48e7('0x2d')]=_['intersection'](_0xda6345['model'],_0xda6345['query']);_0x11ddc5['attributes']=_[_0x48e7('0x2e')](_0xda6345[_0x48e7('0x29')],qs[_0x48e7('0x2f')](_0x18db89[_0x48e7('0x2b')][_0x48e7('0x2f')]));_0x11ddc5[_0x48e7('0x30')]=_0x11ddc5['attributes'][_0x48e7('0x31')]?_0x11ddc5['attributes']:_0xda6345[_0x48e7('0x29')];if(!_0x18db89[_0x48e7('0x2b')][_0x48e7('0x32')](_0x48e7('0x33'))){_0x11ddc5[_0x48e7('0x1d')]=qs[_0x48e7('0x1d')](_0x18db89['query']['limit']);_0x11ddc5['offset']=qs[_0x48e7('0x1c')](_0x18db89['query'][_0x48e7('0x1c')]);}_0x11ddc5[_0x48e7('0x34')]=qs['sort'](_0x18db89['query'][_0x48e7('0x35')]);_0x11ddc5[_0x48e7('0x36')]=qs[_0x48e7('0x2d')](_['pick'](_0x18db89[_0x48e7('0x2b')],_0xda6345['filters']),_0x106a2f);if(_0x18db89[_0x48e7('0x2b')][_0x48e7('0x37')]){_0x11ddc5['where']=_['merge'](_0x11ddc5[_0x48e7('0x36')],{'$or':_[_0x48e7('0x2a')](_0x106a2f,function(_0x18485b){if(_0x18485b[_0x48e7('0x28')]!==_0x48e7('0x38')){var _0x533f25={};_0x533f25[_0x18485b['name']]={'$like':'%'+_0x18db89[_0x48e7('0x2b')][_0x48e7('0x37')]+'%'};return _0x533f25;}})});}_0x11ddc5=_[_0x48e7('0x39')]({},_0x11ddc5,_0x18db89[_0x48e7('0x3a')]);var _0x314f31={'where':_0x11ddc5[_0x48e7('0x36')]};return db[_0x48e7('0x25')][_0x48e7('0x1b')](_0x314f31)[_0x48e7('0x21')](function(_0x4189a7){_0x287477['count']=_0x4189a7;if(_0x18db89[_0x48e7('0x2b')][_0x48e7('0x3b')]){_0x11ddc5[_0x48e7('0x3c')]=[{'all':!![]}];}return db[_0x48e7('0x25')][_0x48e7('0x3d')](_0x11ddc5);})[_0x48e7('0x21')](function(_0x5466b8){_0x287477[_0x48e7('0x3e')]=_0x5466b8;return _0x287477;})[_0x48e7('0x21')](respondWithFilteredResult(_0x4d72ea,_0x11ddc5))[_0x48e7('0x3f')](handleError(_0x4d72ea,null));};exports['show']=function(_0x49bf34,_0x2fdd72){var _0x544fbb={'raw':!![],'where':{'id':_0x49bf34[_0x48e7('0x40')]['id']}},_0x46b43d={};_0x46b43d[_0x48e7('0x29')]=_['keys'](db[_0x48e7('0x25')]['rawAttributes']);_0x46b43d[_0x48e7('0x2b')]=_['keys'](_0x49bf34[_0x48e7('0x2b')]);_0x46b43d['filters']=_[_0x48e7('0x2e')](_0x46b43d[_0x48e7('0x29')],_0x46b43d['query']);_0x544fbb[_0x48e7('0x30')]=_['intersection'](_0x46b43d[_0x48e7('0x29')],qs[_0x48e7('0x2f')](_0x49bf34[_0x48e7('0x2b')][_0x48e7('0x2f')]));_0x544fbb[_0x48e7('0x30')]=_0x544fbb[_0x48e7('0x30')]['length']?_0x544fbb[_0x48e7('0x30')]:_0x46b43d[_0x48e7('0x29')];if(_0x49bf34[_0x48e7('0x2b')]['includeAll']){_0x544fbb['include']=[{'all':!![]}];}_0x544fbb=_[_0x48e7('0x39')]({},_0x544fbb,_0x49bf34[_0x48e7('0x3a')]);return db[_0x48e7('0x25')][_0x48e7('0x41')](_0x544fbb)[_0x48e7('0x21')](handleEntityNotFound(_0x2fdd72,null))[_0x48e7('0x21')](respondWithResult(_0x2fdd72,null))['catch'](handleError(_0x2fdd72,null));};exports[_0x48e7('0x42')]=function(_0x4d9259,_0x143ce4){return db[_0x48e7('0x25')][_0x48e7('0x42')](_0x4d9259[_0x48e7('0x43')],{})[_0x48e7('0x21')](respondWithResult(_0x143ce4,0xc9))[_0x48e7('0x3f')](handleError(_0x143ce4,null));};exports[_0x48e7('0x44')]=function(_0x923d77,_0x396291){if(_0x923d77[_0x48e7('0x43')]['id']){delete _0x923d77['body']['id'];}return db[_0x48e7('0x25')][_0x48e7('0x41')]({'where':{'id':_0x923d77[_0x48e7('0x40')]['id']}})[_0x48e7('0x21')](handleEntityNotFound(_0x396291,null))[_0x48e7('0x21')](saveUpdates(_0x923d77['body'],null))[_0x48e7('0x21')](respondWithResult(_0x396291,null))['catch'](handleError(_0x396291,null));};exports[_0x48e7('0x22')]=function(_0x578c77,_0x351631){return db[_0x48e7('0x25')]['find']({'where':{'id':_0x578c77['params']['id']}})[_0x48e7('0x21')](handleEntityNotFound(_0x351631,null))[_0x48e7('0x21')](removeEntity(_0x351631,null))[_0x48e7('0x3f')](handleError(_0x351631,null));};exports[_0x48e7('0x45')]=function(_0x31328f,_0x216e97){return db[_0x48e7('0x25')][_0x48e7('0x45')]()[_0x48e7('0x21')](respondWithResult(_0x216e97,null))[_0x48e7('0x3f')](handleError(_0x216e97,null));}; \ No newline at end of file +var _0x6081=['json','count','offset','limit','set','reject','save','update','then','destroy','error','stack','name','send','index','FaxTransferReport','fieldName','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','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'];(function(_0x400f01,_0x5ef8e7){var _0x5ee526=function(_0x13e39f){while(--_0x13e39f){_0x400f01['push'](_0x400f01['shift']());}};_0x5ee526(++_0x5ef8e7);}(_0x6081,0x76));var _0x1608=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6081[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x1608('0x0'));var rimraf=require(_0x1608('0x1'));var zipdir=require(_0x1608('0x2'));var jsonpatch=require(_0x1608('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1608('0x4'));var Mustache=require(_0x1608('0x5'));var util=require(_0x1608('0x6'));var path=require(_0x1608('0x7'));var sox=require(_0x1608('0x8'));var csv=require(_0x1608('0x9'));var ejs=require(_0x1608('0xa'));var fs=require('fs');var fs_extra=require(_0x1608('0xb'));var _=require(_0x1608('0xc'));var squel=require('squel');var crypto=require(_0x1608('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1608('0x9'));var querystring=require(_0x1608('0xe'));var Papa=require('papaparse');var Redis=require(_0x1608('0xf'));var authService=require(_0x1608('0x10'));var qs=require(_0x1608('0x11'));var as=require(_0x1608('0x12'));var hardwareService=require(_0x1608('0x13'));var logger=require(_0x1608('0x14'))(_0x1608('0x15'));var utils=require('../../config/utils');var config=require(_0x1608('0x16'));var licenseUtil=require(_0x1608('0x17'));var db=require(_0x1608('0x18'))['db'];function respondWithStatusCode(_0x33f104,_0x5caa04){_0x5caa04=_0x5caa04||0xcc;return function(_0x31cd7e){if(_0x31cd7e){return _0x33f104[_0x1608('0x19')](_0x5caa04);}return _0x33f104[_0x1608('0x1a')](_0x5caa04)[_0x1608('0x1b')]();};}function respondWithResult(_0x3b7cd3,_0x4f93a9){_0x4f93a9=_0x4f93a9||0xc8;return function(_0x1ea5bd){if(_0x1ea5bd){return _0x3b7cd3[_0x1608('0x1a')](_0x4f93a9)[_0x1608('0x1c')](_0x1ea5bd);}};}function respondWithFilteredResult(_0x264c96,_0x3c8f03){return function(_0x59bad1){if(_0x59bad1){var _0x148c28=_0x59bad1[_0x1608('0x1d')],_0x46b746=_0x3c8f03[_0x1608('0x1e')],_0x2730c8=_0x3c8f03['offset']+_0x3c8f03[_0x1608('0x1f')],_0x5054ea;if(_0x2730c8>=_0x148c28){_0x2730c8=_0x148c28;_0x5054ea=0xc8;}else{_0x5054ea=0xce;}_0x264c96['status'](_0x5054ea);return _0x264c96[_0x1608('0x20')]('Content-Range',_0x46b746+'-'+_0x2730c8+'/'+_0x148c28)[_0x1608('0x1c')](_0x59bad1);}return null;};}function patchUpdates(_0x387f07){return function(_0x59ad4d){try{jsonpatch['apply'](_0x59ad4d,_0x387f07,!![]);}catch(_0x3a91af){return BPromise[_0x1608('0x21')](_0x3a91af);}return _0x59ad4d[_0x1608('0x22')]();};}function saveUpdates(_0x487630,_0x4c6a85){return function(_0x559e37){if(_0x559e37){return _0x559e37[_0x1608('0x23')](_0x487630)[_0x1608('0x24')](function(_0x433e0b){return _0x433e0b;});}return null;};}function removeEntity(_0x5b7258,_0x283159){return function(_0x3ddd47){if(_0x3ddd47){return _0x3ddd47[_0x1608('0x25')]()[_0x1608('0x24')](function(){_0x5b7258['status'](0xcc)[_0x1608('0x1b')]();});}};}function handleEntityNotFound(_0x48bd31,_0xa3a0b3){return function(_0x715330){if(!_0x715330){_0x48bd31[_0x1608('0x19')](0x194);}return _0x715330;};}function handleError(_0x2c7ef2,_0x50e0c1){_0x50e0c1=_0x50e0c1||0x1f4;return function(_0x4f3a9d){logger[_0x1608('0x26')](_0x4f3a9d[_0x1608('0x27')]);if(_0x4f3a9d[_0x1608('0x28')]){delete _0x4f3a9d[_0x1608('0x28')];}_0x2c7ef2['status'](_0x50e0c1)[_0x1608('0x29')](_0x4f3a9d);};}exports[_0x1608('0x2a')]=function(_0x1a2226,_0xada2e8){var _0x25ef33={},_0x361a08={},_0x1787d5={'count':0x0,'rows':[]};var _0x49b2d0=_['map'](db[_0x1608('0x2b')]['rawAttributes'],function(_0x2514cf){return{'name':_0x2514cf[_0x1608('0x2c')],'type':_0x2514cf['type'][_0x1608('0x2d')]};});_0x361a08[_0x1608('0x2e')]=_['map'](_0x49b2d0,'name');_0x361a08[_0x1608('0x2f')]=_['keys'](_0x1a2226[_0x1608('0x2f')]);_0x361a08[_0x1608('0x30')]=_['intersection'](_0x361a08[_0x1608('0x2e')],_0x361a08['query']);_0x25ef33[_0x1608('0x31')]=_[_0x1608('0x32')](_0x361a08[_0x1608('0x2e')],qs['fields'](_0x1a2226[_0x1608('0x2f')]['fields']));_0x25ef33[_0x1608('0x31')]=_0x25ef33[_0x1608('0x31')][_0x1608('0x33')]?_0x25ef33[_0x1608('0x31')]:_0x361a08[_0x1608('0x2e')];if(!_0x1a2226[_0x1608('0x2f')][_0x1608('0x34')](_0x1608('0x35'))){_0x25ef33[_0x1608('0x1f')]=qs[_0x1608('0x1f')](_0x1a2226[_0x1608('0x2f')][_0x1608('0x1f')]);_0x25ef33[_0x1608('0x1e')]=qs['offset'](_0x1a2226['query'][_0x1608('0x1e')]);}_0x25ef33['order']=qs[_0x1608('0x36')](_0x1a2226[_0x1608('0x2f')][_0x1608('0x36')]);_0x25ef33[_0x1608('0x37')]=qs[_0x1608('0x30')](_['pick'](_0x1a2226[_0x1608('0x2f')],_0x361a08[_0x1608('0x30')]),_0x49b2d0);if(_0x1a2226[_0x1608('0x2f')]['filter']){_0x25ef33[_0x1608('0x37')]=_[_0x1608('0x38')](_0x25ef33[_0x1608('0x37')],{'$or':_['map'](_0x49b2d0,function(_0x1036ab){if(_0x1036ab[_0x1608('0x39')]!==_0x1608('0x3a')){var _0x300993={};_0x300993[_0x1036ab[_0x1608('0x28')]]={'$like':'%'+_0x1a2226[_0x1608('0x2f')]['filter']+'%'};return _0x300993;}})});}_0x25ef33=_['merge']({},_0x25ef33,_0x1a2226['options']);var _0x7da579={'where':_0x25ef33[_0x1608('0x37')]};return db[_0x1608('0x2b')]['count'](_0x7da579)[_0x1608('0x24')](function(_0x2d2f80){_0x1787d5[_0x1608('0x1d')]=_0x2d2f80;if(_0x1a2226[_0x1608('0x2f')]['includeAll']){_0x25ef33[_0x1608('0x3b')]=[{'all':!![]}];}return db[_0x1608('0x2b')][_0x1608('0x3c')](_0x25ef33);})[_0x1608('0x24')](function(_0x33a5aa){_0x1787d5[_0x1608('0x3d')]=_0x33a5aa;return _0x1787d5;})[_0x1608('0x24')](respondWithFilteredResult(_0xada2e8,_0x25ef33))[_0x1608('0x3e')](handleError(_0xada2e8,null));};exports[_0x1608('0x3f')]=function(_0x3296a3,_0x332146){var _0x42de5c={'raw':!![],'where':{'id':_0x3296a3[_0x1608('0x40')]['id']}},_0x393681={};_0x393681[_0x1608('0x2e')]=_['keys'](db[_0x1608('0x2b')][_0x1608('0x41')]);_0x393681[_0x1608('0x2f')]=_['keys'](_0x3296a3['query']);_0x393681['filters']=_[_0x1608('0x32')](_0x393681[_0x1608('0x2e')],_0x393681[_0x1608('0x2f')]);_0x42de5c[_0x1608('0x31')]=_[_0x1608('0x32')](_0x393681[_0x1608('0x2e')],qs['fields'](_0x3296a3['query'][_0x1608('0x42')]));_0x42de5c['attributes']=_0x42de5c[_0x1608('0x31')]['length']?_0x42de5c[_0x1608('0x31')]:_0x393681[_0x1608('0x2e')];if(_0x3296a3['query'][_0x1608('0x43')]){_0x42de5c['include']=[{'all':!![]}];}_0x42de5c=_[_0x1608('0x38')]({},_0x42de5c,_0x3296a3[_0x1608('0x44')]);return db[_0x1608('0x2b')][_0x1608('0x45')](_0x42de5c)[_0x1608('0x24')](handleEntityNotFound(_0x332146,null))[_0x1608('0x24')](respondWithResult(_0x332146,null))[_0x1608('0x3e')](handleError(_0x332146,null));};exports[_0x1608('0x46')]=function(_0x4db77c,_0x3f6084){return db[_0x1608('0x2b')][_0x1608('0x46')](_0x4db77c[_0x1608('0x47')],{})[_0x1608('0x24')](respondWithResult(_0x3f6084,0xc9))[_0x1608('0x3e')](handleError(_0x3f6084,null));};exports['update']=function(_0x32e15f,_0x5d51f6){if(_0x32e15f['body']['id']){delete _0x32e15f[_0x1608('0x47')]['id'];}return db[_0x1608('0x2b')][_0x1608('0x45')]({'where':{'id':_0x32e15f[_0x1608('0x40')]['id']}})[_0x1608('0x24')](handleEntityNotFound(_0x5d51f6,null))[_0x1608('0x24')](saveUpdates(_0x32e15f[_0x1608('0x47')],null))[_0x1608('0x24')](respondWithResult(_0x5d51f6,null))['catch'](handleError(_0x5d51f6,null));};exports['destroy']=function(_0x393e7f,_0x318405){return db[_0x1608('0x2b')][_0x1608('0x45')]({'where':{'id':_0x393e7f[_0x1608('0x40')]['id']}})['then'](handleEntityNotFound(_0x318405,null))[_0x1608('0x24')](removeEntity(_0x318405,null))['catch'](handleError(_0x318405,null));};exports['describe']=function(_0xd32974,_0x663867){return db['FaxTransferReport'][_0x1608('0x48')]()[_0x1608('0x24')](respondWithResult(_0x663867,null))['catch'](handleError(_0x663867,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 777d545..87b534b 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 _0x2103=['api','moment','request-promise','path','rimraf','../../config/environment','exports','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x2103,0x12a));var _0x3210=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2103[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3210('0x0'));var logger=require(_0x3210('0x1'))(_0x3210('0x2'));var moment=require(_0x3210('0x3'));var BPromise=require('bluebird');var rp=require(_0x3210('0x4'));var fs=require('fs');var path=require(_0x3210('0x5'));var rimraf=require(_0x3210('0x6'));var config=require(_0x3210('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0x3210('0x8')]=function(_0xb869b4,_0x4cd10d){return _0xb869b4['define'](_0x3210('0x9'),attributes,{'tableName':_0x3210('0xa'),'paranoid':![],'indexes':[{'name':_0x3210('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xee59=['bluebird','rimraf','../../config/environment','./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x349118,_0x325854){var _0x2e86c9=function(_0x52d628){while(--_0x52d628){_0x349118['push'](_0x349118['shift']());}};_0x2e86c9(++_0x325854);}(_0xee59,0x8b));var _0x9ee5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xee59[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9ee5('0x0'));var util=require(_0x9ee5('0x1'));var logger=require(_0x9ee5('0x2'))(_0x9ee5('0x3'));var moment=require(_0x9ee5('0x4'));var BPromise=require(_0x9ee5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9ee5('0x6'));var config=require(_0x9ee5('0x7'));var attributes=require(_0x9ee5('0x8'));module[_0x9ee5('0x9')]=function(_0x2f8ace,_0x3f92c4){return _0x2f8ace['define']('FaxTransferReport',attributes,{'tableName':_0x9ee5('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9ee5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 8da287b..407411a 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 _0x2ea0=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x18a6cd,_0x5aa78b){var _0x217f80=function(_0x54c446){while(--_0x54c446){_0x18a6cd['push'](_0x18a6cd['shift']());}};_0x217f80(++_0x5aa78b);}(_0x2ea0,0xd9));var _0x02ea=function(_0x416df5,_0x5cd9e7){_0x416df5=_0x416df5-0x0;var _0x53235b=_0x2ea0[_0x416df5];return _0x53235b;};'use strict';var _=require(_0x02ea('0x0'));var util=require(_0x02ea('0x1'));var moment=require(_0x02ea('0x2'));var BPromise=require(_0x02ea('0x3'));var rs=require(_0x02ea('0x4'));var fs=require('fs');var Redis=require(_0x02ea('0x5'));var db=require(_0x02ea('0x6'))['db'];var utils=require(_0x02ea('0x7'));var logger=require(_0x02ea('0x8'))(_0x02ea('0x9'));var config=require(_0x02ea('0xa'));var jayson=require(_0x02ea('0xb'));var client=jayson[_0x02ea('0xc')][_0x02ea('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x409dae,_0x455b79,_0x5c083e){return new BPromise(function(_0x21df04,_0xe59337){return client['request'](_0x409dae,_0x5c083e)['then'](function(_0x5f3a09){logger[_0x02ea('0xe')](_0x02ea('0xf'),_0x455b79,_0x02ea('0x10'));logger[_0x02ea('0x11')](_0x02ea('0x12'),_0x455b79,_0x02ea('0x10'),JSON[_0x02ea('0x13')](_0x5f3a09));if(_0x5f3a09[_0x02ea('0x14')]){if(_0x5f3a09['error'][_0x02ea('0x15')]===0x1f4){logger[_0x02ea('0x14')](_0x02ea('0xf'),_0x455b79,_0x5f3a09[_0x02ea('0x14')][_0x02ea('0x16')]);return _0xe59337(_0x5f3a09['error']['message']);}logger[_0x02ea('0x14')](_0x02ea('0xf'),_0x455b79,_0x5f3a09['error'][_0x02ea('0x16')]);return _0x21df04(_0x5f3a09[_0x02ea('0x14')][_0x02ea('0x16')]);}else{logger[_0x02ea('0xe')](_0x02ea('0xf'),_0x455b79,_0x02ea('0x10'));_0x21df04(_0x5f3a09[_0x02ea('0x17')][_0x02ea('0x16')]);}})[_0x02ea('0x18')](function(_0x1b381f){logger[_0x02ea('0x14')](_0x02ea('0xf'),_0x455b79,_0x1b381f);_0xe59337(_0x1b381f);});});} \ No newline at end of file +var _0x12c7=['client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5d5892,_0xe4dc7b){var _0x46b936=function(_0x452e67){while(--_0x452e67){_0x5d5892['push'](_0x5d5892['shift']());}};_0x46b936(++_0xe4dc7b);}(_0x12c7,0x112));var _0x712c=function(_0x4ea569,_0x290307){_0x4ea569=_0x4ea569-0x0;var _0x51399a=_0x12c7[_0x4ea569];return _0x51399a;};'use strict';var _=require(_0x712c('0x0'));var util=require(_0x712c('0x1'));var moment=require(_0x712c('0x2'));var BPromise=require(_0x712c('0x3'));var rs=require(_0x712c('0x4'));var fs=require('fs');var Redis=require(_0x712c('0x5'));var db=require(_0x712c('0x6'))['db'];var utils=require(_0x712c('0x7'));var logger=require(_0x712c('0x8'))(_0x712c('0x9'));var config=require(_0x712c('0xa'));var jayson=require(_0x712c('0xb'));var client=jayson[_0x712c('0xc')][_0x712c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1f6670,_0x1715c3,_0x3aee18){return new BPromise(function(_0x22e9b8,_0x2fcc86){return client[_0x712c('0xe')](_0x1f6670,_0x3aee18)[_0x712c('0xf')](function(_0x582f3d){logger[_0x712c('0x10')](_0x712c('0x11'),_0x1715c3,'request\x20sent');logger[_0x712c('0x12')](_0x712c('0x13'),_0x1715c3,_0x712c('0x14'),JSON[_0x712c('0x15')](_0x582f3d));if(_0x582f3d[_0x712c('0x16')]){if(_0x582f3d[_0x712c('0x16')][_0x712c('0x17')]===0x1f4){logger['error'](_0x712c('0x11'),_0x1715c3,_0x582f3d[_0x712c('0x16')][_0x712c('0x18')]);return _0x2fcc86(_0x582f3d[_0x712c('0x16')][_0x712c('0x18')]);}logger['error'](_0x712c('0x11'),_0x1715c3,_0x582f3d[_0x712c('0x16')][_0x712c('0x18')]);return _0x22e9b8(_0x582f3d[_0x712c('0x16')][_0x712c('0x18')]);}else{logger[_0x712c('0x10')](_0x712c('0x11'),_0x1715c3,_0x712c('0x14'));_0x22e9b8(_0x582f3d[_0x712c('0x19')][_0x712c('0x18')]);}})['catch'](function(_0x10570f){logger[_0x712c('0x16')](_0x712c('0x11'),_0x1715c3,_0x10570f);_0x2fcc86(_0x10570f);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index f36d864..7035f05 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 _0x1d2a=['put','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','show','post','create'];(function(_0x141539,_0x19935a){var _0x2cb127=function(_0x24a47a){while(--_0x24a47a){_0x141539['push'](_0x141539['shift']());}};_0x2cb127(++_0x19935a);}(_0x1d2a,0x136));var _0xa1d2=function(_0x32037a,_0x38c989){_0x32037a=_0x32037a-0x0;var _0x250725=_0x1d2a[_0x32037a];return _0x250725;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa1d2('0x0'));var express=require(_0xa1d2('0x1'));var router=express[_0xa1d2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa1d2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa1d2('0x4'));var controller=require(_0xa1d2('0x5'));router[_0xa1d2('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa1d2('0x6')](_0xa1d2('0x7'),auth['isAuthenticated'](),controller[_0xa1d2('0x8')]);router['get'](_0xa1d2('0x9'),auth[_0xa1d2('0xa')](),controller[_0xa1d2('0xb')]);router[_0xa1d2('0xc')]('/',auth['isAuthenticated'](),controller[_0xa1d2('0xd')]);router[_0xa1d2('0xe')](_0xa1d2('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xa1d2('0xf')](_0xa1d2('0x9'),auth[_0xa1d2('0xa')](),controller[_0xa1d2('0x10')]);module[_0xa1d2('0x11')]=router; \ No newline at end of file +var _0xc59f=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','show','create','put','/:id','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc59f,0x1a7));var _0xfc59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc59f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfc59('0x0'));var util=require('util');var path=require(_0xfc59('0x1'));var timeout=require(_0xfc59('0x2'));var express=require(_0xfc59('0x3'));var router=express[_0xfc59('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfc59('0x5'));var config=require(_0xfc59('0x6'));var controller=require(_0xfc59('0x7'));router[_0xfc59('0x8')]('/',auth[_0xfc59('0x9')](),controller['index']);router['get'](_0xfc59('0xa'),auth[_0xfc59('0x9')](),controller[_0xfc59('0xb')]);router[_0xfc59('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xfc59('0xc')]);router['post']('/',auth[_0xfc59('0x9')](),controller[_0xfc59('0xd')]);router[_0xfc59('0xe')](_0xfc59('0xf'),auth['isAuthenticated'](),controller[_0xfc59('0x10')]);router[_0xfc59('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xfc59('0x12')]);module[_0xfc59('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index e10d3fd..75c69f8 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 _0x9e10=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','addConfiguration','update','util'];(function(_0x70f02,_0x166066){var _0x43282e=function(_0x525026){while(--_0x525026){_0x70f02['push'](_0x70f02['shift']());}};_0x43282e(++_0x166066);}(_0x9e10,0x7d));var _0x09e1=function(_0x36ac1b,_0x3b48a0){_0x36ac1b=_0x36ac1b-0x0;var _0x42b967=_0x9e10[_0x36ac1b];return _0x42b967;};'use strict';var multer=require('multer');var util=require(_0x09e1('0x0'));var path=require(_0x09e1('0x1'));var timeout=require(_0x09e1('0x2'));var express=require(_0x09e1('0x3'));var router=express[_0x09e1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x09e1('0x5'));var interaction=require(_0x09e1('0x6'));var config=require(_0x09e1('0x7'));var controller=require(_0x09e1('0x8'));router[_0x09e1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x09e1('0xa'),auth[_0x09e1('0xb')](),controller[_0x09e1('0xc')]);router[_0x09e1('0x9')](_0x09e1('0xd'),auth[_0x09e1('0xb')](),controller[_0x09e1('0xe')]);router[_0x09e1('0x9')]('/:id/fields',auth[_0x09e1('0xb')](),controller[_0x09e1('0xf')]);router['post']('/',auth[_0x09e1('0xb')](),controller['create']);router['post'](_0x09e1('0xd'),auth['isAuthenticated'](),controller[_0x09e1('0x10')]);router['put'](_0x09e1('0xa'),auth[_0x09e1('0xb')](),controller[_0x09e1('0x11')]);router['delete'](_0x09e1('0xa'),auth[_0x09e1('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8e71=['../../config/environment','./intDeskAccount.controller','index','isAuthenticated','show','get','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x15bc2f,_0x25e563){var _0x574008=function(_0x220bee){while(--_0x220bee){_0x15bc2f['push'](_0x15bc2f['shift']());}};_0x574008(++_0x25e563);}(_0x8e71,0x179));var _0x18e7=function(_0x5aa4cc,_0x49d641){_0x5aa4cc=_0x5aa4cc-0x0;var _0x52b505=_0x8e71[_0x5aa4cc];return _0x52b505;};'use strict';var multer=require(_0x18e7('0x0'));var util=require(_0x18e7('0x1'));var path=require(_0x18e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x18e7('0x3'));var router=express['Router']();var fs_extra=require(_0x18e7('0x4'));var auth=require(_0x18e7('0x5'));var interaction=require(_0x18e7('0x6'));var config=require(_0x18e7('0x7'));var controller=require(_0x18e7('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x18e7('0x9')]);router['get']('/:id',auth[_0x18e7('0xa')](),controller[_0x18e7('0xb')]);router[_0x18e7('0xc')]('/:id/configurations',auth[_0x18e7('0xa')](),controller[_0x18e7('0xd')]);router['get'](_0x18e7('0xe'),auth[_0x18e7('0xa')](),controller[_0x18e7('0xf')]);router[_0x18e7('0x10')]('/',auth[_0x18e7('0xa')](),controller['create']);router[_0x18e7('0x10')](_0x18e7('0x11'),auth[_0x18e7('0xa')](),controller[_0x18e7('0x12')]);router[_0x18e7('0x13')](_0x18e7('0x14'),auth[_0x18e7('0xa')](),controller[_0x18e7('0x15')]);router[_0x18e7('0x16')](_0x18e7('0x14'),auth[_0x18e7('0xa')](),controller[_0x18e7('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 183dc74..fcc82e7 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 _0x96f2=['integrationTab','newTab','sequelize','STRING','ENUM','basic'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x96f2,0xb0));var _0x296f=function(_0x1eca97,_0x1e1c87){_0x1eca97=_0x1eca97-0x0;var _0x25c9f6=_0x96f2[_0x1eca97];return _0x25c9f6;};'use strict';var Sequelize=require(_0x296f('0x0'));module['exports']={'name':{'type':Sequelize[_0x296f('0x1')]},'description':{'type':Sequelize[_0x296f('0x1')]},'username':{'type':Sequelize[_0x296f('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x296f('0x2')](_0x296f('0x3')),'defaultValue':_0x296f('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x296f('0x1')]},'consumerSecret':{'type':Sequelize[_0x296f('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x296f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x296f('0x2')](_0x296f('0x4'),_0x296f('0x5')),'defaultValue':_0x296f('0x4')}}; \ No newline at end of file +var _0x94d4=['basic','newTab','integrationTab','sequelize','exports','STRING'];(function(_0x324e96,_0x5b47ed){var _0x825c09=function(_0x455aa6){while(--_0x455aa6){_0x324e96['push'](_0x324e96['shift']());}};_0x825c09(++_0x5b47ed);}(_0x94d4,0xa5));var _0x494d=function(_0x296295,_0x218428){_0x296295=_0x296295-0x0;var _0x546d2c=_0x94d4[_0x296295];return _0x546d2c;};'use strict';var Sequelize=require(_0x494d('0x0'));module[_0x494d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x494d('0x2')]},'username':{'type':Sequelize[_0x494d('0x2')]},'remoteUri':{'type':Sequelize[_0x494d('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x494d('0x3')),'defaultValue':_0x494d('0x3')},'password':{'type':Sequelize[_0x494d('0x2')]},'consumerKey':{'type':Sequelize[_0x494d('0x2')]},'consumerSecret':{'type':Sequelize[_0x494d('0x2')]},'token':{'type':Sequelize[_0x494d('0x2')]},'tokenSecret':{'type':Sequelize[_0x494d('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x494d('0x4')),'defaultValue':_0x494d('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index f55b02e..e74d85b 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 _0x158f=['%s/custom_fields','application/json','authType','headers','Authorization','Basic\x20%s','%s:%s','base64','concat','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','end','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','params','length','options','find','create','body','destroy','getConfigurations','DeskConfiguration','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','GET','format'];(function(_0x578df3,_0x406d91){var _0x40d36e=function(_0x338ce8){while(--_0x338ce8){_0x578df3['push'](_0x578df3['shift']());}};_0x40d36e(++_0x406d91);}(_0x158f,0x189));var _0xf158=function(_0xecf14c,_0x25eb68){_0xecf14c=_0xecf14c-0x0;var _0x328c11=_0x158f[_0xecf14c];return _0x328c11;};'use strict';var emlformat=require(_0xf158('0x0'));var rimraf=require(_0xf158('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf158('0x2'));var rp=require(_0xf158('0x3'));var moment=require(_0xf158('0x4'));var BPromise=require(_0xf158('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf158('0x6'));var sox=require(_0xf158('0x7'));var csv=require(_0xf158('0x8'));var ejs=require(_0xf158('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf158('0xa'));var squel=require('squel');var crypto=require(_0xf158('0xb'));var jsforce=require(_0xf158('0xc'));var deskjs=require(_0xf158('0xd'));var toCsv=require(_0xf158('0x8'));var querystring=require(_0xf158('0xe'));var Papa=require('papaparse');var Redis=require(_0xf158('0xf'));var authService=require(_0xf158('0x10'));var qs=require(_0xf158('0x11'));var as=require(_0xf158('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf158('0x13'))(_0xf158('0x14'));var utils=require('../../config/utils');var config=require(_0xf158('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf158('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xf158('0x17'));var client=jayson[_0xf158('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25f326,_0xeefdb4,_0x2502cf,_0x4cd90c){return new BPromise(function(_0x5c804d,_0x240b71){var _0x405c87=_0x4cd90c||client;return _0x405c87[_0xf158('0x19')](_0x25f326,_0x2502cf)[_0xf158('0x1a')](function(_0x39ceed){logger[_0xf158('0x1b')](_0xf158('0x1c'),_0xeefdb4,_0xf158('0x1d'));logger[_0xf158('0x1e')](_0xf158('0x1f'),_0xeefdb4,'request\x20sent',JSON['stringify'](_0x39ceed));if(_0x39ceed[_0xf158('0x20')]){if(_0x39ceed[_0xf158('0x20')][_0xf158('0x21')]===0x1f4){logger[_0xf158('0x20')](_0xf158('0x1c'),_0xeefdb4,_0x39ceed[_0xf158('0x20')][_0xf158('0x22')]);return _0x240b71(_0x39ceed[_0xf158('0x20')][_0xf158('0x22')]);}logger['error'](_0xf158('0x1c'),_0xeefdb4,_0x39ceed[_0xf158('0x20')][_0xf158('0x22')]);return _0x5c804d(_0x39ceed[_0xf158('0x20')][_0xf158('0x22')]);}else{logger['info'](_0xf158('0x1c'),_0xeefdb4,_0xf158('0x1d'));_0x5c804d(_0x39ceed[_0xf158('0x23')][_0xf158('0x22')]);}})['catch'](function(_0x2f5c2e){logger['error'](_0xf158('0x1c'),_0xeefdb4,_0x2f5c2e);_0x240b71(_0x2f5c2e);});});}function respondWithStatusCode(_0x2d2b57,_0x31c6e9){_0x31c6e9=_0x31c6e9||0xcc;return function(_0x501fc4){if(_0x501fc4){return _0x2d2b57[_0xf158('0x24')](_0x31c6e9);}return _0x2d2b57[_0xf158('0x25')](_0x31c6e9)['end']();};}function respondWithResult(_0x87a310,_0x1d5e15){_0x1d5e15=_0x1d5e15||0xc8;return function(_0x50a966){if(_0x50a966){return _0x87a310[_0xf158('0x25')](_0x1d5e15)[_0xf158('0x26')](_0x50a966);}};}function respondWithFilteredResult(_0x21af34,_0x4cfbbf){return function(_0xd23ab9){if(_0xd23ab9){var _0x709272=_0xd23ab9[_0xf158('0x27')],_0x25ad8c=_0x4cfbbf[_0xf158('0x28')],_0x965114=_0x4cfbbf['offset']+_0x4cfbbf['limit'],_0x258b47;if(_0x965114>=_0x709272){_0x965114=_0x709272;_0x258b47=0xc8;}else{_0x258b47=0xce;}_0x21af34[_0xf158('0x25')](_0x258b47);return _0x21af34[_0xf158('0x29')](_0xf158('0x2a'),_0x25ad8c+'-'+_0x965114+'/'+_0x709272)[_0xf158('0x26')](_0xd23ab9);}return null;};}function patchUpdates(_0x55e5ef){return function(_0x369b72){try{jsonpatch[_0xf158('0x2b')](_0x369b72,_0x55e5ef,!![]);}catch(_0x1379f5){return BPromise['reject'](_0x1379f5);}return _0x369b72[_0xf158('0x2c')]();};}function saveUpdates(_0x3bf8c5,_0x37e648){return function(_0x2db4b5){if(_0x2db4b5){return _0x2db4b5[_0xf158('0x2d')](_0x3bf8c5)[_0xf158('0x1a')](function(_0xe5ade){return _0xe5ade;});}return null;};}function removeEntity(_0x510082,_0x388bbf){return function(_0x626d94){if(_0x626d94){return _0x626d94['destroy']()['then'](function(){_0x510082[_0xf158('0x25')](0xcc)[_0xf158('0x2e')]();});}};}function handleEntityNotFound(_0x404da6,_0x349627){return function(_0x566336){if(!_0x566336){_0x404da6[_0xf158('0x24')](0x194);}return _0x566336;};}function handleError(_0x2bb893,_0x22eefd){_0x22eefd=_0x22eefd||0x1f4;return function(_0x1a52c5){logger[_0xf158('0x20')](_0x1a52c5[_0xf158('0x2f')]);if(_0x1a52c5[_0xf158('0x30')]){delete _0x1a52c5[_0xf158('0x30')];}_0x2bb893[_0xf158('0x25')](_0x22eefd)[_0xf158('0x31')](_0x1a52c5);};}exports[_0xf158('0x32')]=function(_0x730918,_0xb51d57){var _0x45dc4c={},_0x29d724={},_0x59a550={'count':0x0,'rows':[]};var _0x5cecff=_[_0xf158('0x33')](db[_0xf158('0x34')][_0xf158('0x35')],function(_0x157cd7){return{'name':_0x157cd7[_0xf158('0x36')],'type':_0x157cd7[_0xf158('0x37')][_0xf158('0x38')]};});_0x29d724[_0xf158('0x39')]=_[_0xf158('0x33')](_0x5cecff,_0xf158('0x30'));_0x29d724['query']=_[_0xf158('0x3a')](_0x730918['query']);_0x29d724[_0xf158('0x3b')]=_[_0xf158('0x3c')](_0x29d724[_0xf158('0x39')],_0x29d724[_0xf158('0x3d')]);_0x45dc4c['attributes']=_[_0xf158('0x3c')](_0x29d724[_0xf158('0x39')],qs[_0xf158('0x3e')](_0x730918['query'][_0xf158('0x3e')]));_0x45dc4c[_0xf158('0x3f')]=_0x45dc4c[_0xf158('0x3f')]['length']?_0x45dc4c[_0xf158('0x3f')]:_0x29d724[_0xf158('0x39')];if(!_0x730918[_0xf158('0x3d')][_0xf158('0x40')]('nolimit')){_0x45dc4c[_0xf158('0x41')]=qs[_0xf158('0x41')](_0x730918[_0xf158('0x3d')][_0xf158('0x41')]);_0x45dc4c[_0xf158('0x28')]=qs[_0xf158('0x28')](_0x730918[_0xf158('0x3d')]['offset']);}_0x45dc4c[_0xf158('0x42')]=qs[_0xf158('0x43')](_0x730918[_0xf158('0x3d')]['sort']);_0x45dc4c[_0xf158('0x44')]=qs[_0xf158('0x3b')](_[_0xf158('0x45')](_0x730918['query'],_0x29d724[_0xf158('0x3b')]),_0x5cecff);if(_0x730918[_0xf158('0x3d')]['filter']){_0x45dc4c[_0xf158('0x44')]=_[_0xf158('0x46')](_0x45dc4c[_0xf158('0x44')],{'$or':_['map'](_0x5cecff,function(_0x5053d6){if(_0x5053d6[_0xf158('0x37')]!==_0xf158('0x47')){var _0x446e7d={};_0x446e7d[_0x5053d6['name']]={'$like':'%'+_0x730918[_0xf158('0x3d')][_0xf158('0x48')]+'%'};return _0x446e7d;}})});}_0x45dc4c=_[_0xf158('0x46')]({},_0x45dc4c,_0x730918['options']);var _0x523121={'where':_0x45dc4c[_0xf158('0x44')]};return db[_0xf158('0x34')][_0xf158('0x27')](_0x523121)[_0xf158('0x1a')](function(_0x53a4be){_0x59a550[_0xf158('0x27')]=_0x53a4be;if(_0x730918['query'][_0xf158('0x49')]){_0x45dc4c[_0xf158('0x4a')]=[{'all':!![]}];}return db[_0xf158('0x34')][_0xf158('0x4b')](_0x45dc4c);})[_0xf158('0x1a')](function(_0x153756){_0x59a550['rows']=_0x153756;return _0x59a550;})[_0xf158('0x1a')](respondWithFilteredResult(_0xb51d57,_0x45dc4c))[_0xf158('0x4c')](handleError(_0xb51d57,null));};exports['show']=function(_0x5b77ae,_0x3ae63c){var _0x2c8c33={'raw':![],'where':{'id':_0x5b77ae[_0xf158('0x4d')]['id']}},_0x173f5c={};_0x173f5c[_0xf158('0x39')]=_[_0xf158('0x3a')](db[_0xf158('0x34')]['rawAttributes']);_0x173f5c[_0xf158('0x3d')]=_['keys'](_0x5b77ae[_0xf158('0x3d')]);_0x173f5c[_0xf158('0x3b')]=_[_0xf158('0x3c')](_0x173f5c[_0xf158('0x39')],_0x173f5c[_0xf158('0x3d')]);_0x2c8c33[_0xf158('0x3f')]=_[_0xf158('0x3c')](_0x173f5c[_0xf158('0x39')],qs[_0xf158('0x3e')](_0x5b77ae[_0xf158('0x3d')]['fields']));_0x2c8c33['attributes']=_0x2c8c33[_0xf158('0x3f')][_0xf158('0x4e')]?_0x2c8c33[_0xf158('0x3f')]:_0x173f5c[_0xf158('0x39')];if(_0x5b77ae[_0xf158('0x3d')]['includeAll']){_0x2c8c33[_0xf158('0x4a')]=[{'all':!![]}];}_0x2c8c33=_['merge']({},_0x2c8c33,_0x5b77ae[_0xf158('0x4f')]);return db[_0xf158('0x34')][_0xf158('0x50')](_0x2c8c33)[_0xf158('0x1a')](handleEntityNotFound(_0x3ae63c,null))[_0xf158('0x1a')](respondWithResult(_0x3ae63c,null))['catch'](handleError(_0x3ae63c,null));};exports[_0xf158('0x51')]=function(_0xa0c07e,_0x1dbce5){return db[_0xf158('0x34')][_0xf158('0x51')](_0xa0c07e['body'],{})[_0xf158('0x1a')](respondWithResult(_0x1dbce5,0xc9))[_0xf158('0x4c')](handleError(_0x1dbce5,null));};exports[_0xf158('0x2d')]=function(_0x48f197,_0x2bcb16){if(_0x48f197[_0xf158('0x52')]['id']){delete _0x48f197[_0xf158('0x52')]['id'];}return db['DeskAccount'][_0xf158('0x50')]({'where':{'id':_0x48f197[_0xf158('0x4d')]['id']}})[_0xf158('0x1a')](handleEntityNotFound(_0x2bcb16,null))[_0xf158('0x1a')](saveUpdates(_0x48f197[_0xf158('0x52')],null))['then'](respondWithResult(_0x2bcb16,null))[_0xf158('0x4c')](handleError(_0x2bcb16,null));};exports[_0xf158('0x53')]=function(_0x5c447a,_0x2893a2){return db[_0xf158('0x34')][_0xf158('0x50')]({'where':{'id':_0x5c447a[_0xf158('0x4d')]['id']}})[_0xf158('0x1a')](handleEntityNotFound(_0x2893a2,null))[_0xf158('0x1a')](removeEntity(_0x2893a2,null))[_0xf158('0x4c')](handleError(_0x2893a2,null));};exports[_0xf158('0x54')]=function(_0x19ca23,_0x51305e,_0x40afc9){var _0x1433d1={};var _0x1bae52={};var _0x100813;var _0x44d8d3;return db[_0xf158('0x34')]['findOne']({'where':{'id':_0x19ca23[_0xf158('0x4d')]['id']}})['then'](handleEntityNotFound(_0x51305e,null))[_0xf158('0x1a')](function(_0x2b41c1){if(_0x2b41c1){_0x100813=_0x2b41c1;_0x1bae52[_0xf158('0x39')]=_['keys'](db[_0xf158('0x55')]['rawAttributes']);_0x1bae52[_0xf158('0x3d')]=_[_0xf158('0x3a')](_0x19ca23['query']);_0x1bae52[_0xf158('0x3b')]=_['intersection'](_0x1bae52[_0xf158('0x39')],_0x1bae52[_0xf158('0x3d')]);_0x1433d1[_0xf158('0x3f')]=_[_0xf158('0x3c')](_0x1bae52[_0xf158('0x39')],qs[_0xf158('0x3e')](_0x19ca23[_0xf158('0x3d')][_0xf158('0x3e')]));_0x1433d1[_0xf158('0x3f')]=_0x1433d1[_0xf158('0x3f')][_0xf158('0x4e')]?_0x1433d1[_0xf158('0x3f')]:_0x1bae52[_0xf158('0x39')];_0x1433d1[_0xf158('0x42')]=qs[_0xf158('0x43')](_0x19ca23['query']['sort']);_0x1433d1[_0xf158('0x44')]=qs['filters'](_[_0xf158('0x45')](_0x19ca23['query'],_0x1bae52[_0xf158('0x3b')]));if(_0x19ca23['query'][_0xf158('0x48')]){_0x1433d1['where']=_[_0xf158('0x46')](_0x1433d1['where'],{'$or':_[_0xf158('0x33')](_0x1433d1['attributes'],function(_0x396208){var _0x485d2f={};_0x485d2f[_0x396208]={'$like':'%'+_0x19ca23[_0xf158('0x3d')]['filter']+'%'};return _0x485d2f;})});}_0x1433d1=_[_0xf158('0x46')]({},_0x1433d1,_0x19ca23[_0xf158('0x4f')]);return _0x100813[_0xf158('0x54')](_0x1433d1);}})[_0xf158('0x1a')](function(_0x11de35){if(_0x11de35){_0x44d8d3=_0x11de35['length'];if(!_0x19ca23[_0xf158('0x3d')][_0xf158('0x40')](_0xf158('0x56'))){_0x1433d1[_0xf158('0x41')]=qs[_0xf158('0x41')](_0x19ca23[_0xf158('0x3d')][_0xf158('0x41')]);_0x1433d1['offset']=qs[_0xf158('0x28')](_0x19ca23[_0xf158('0x3d')][_0xf158('0x28')]);}return _0x100813[_0xf158('0x54')](_0x1433d1);}})[_0xf158('0x1a')](function(_0x15845a){if(_0x15845a){return _0x15845a?{'count':_0x44d8d3,'rows':_0x15845a}:null;}})[_0xf158('0x1a')](respondWithResult(_0x51305e,null))[_0xf158('0x4c')](handleError(_0x51305e,null));};exports[_0xf158('0x57')]=function(_0x24f1de,_0x13e8f3,_0x4666fe){if(_0x24f1de[_0xf158('0x52')]['id']){delete _0x24f1de['body']['id'];}return db['DeskAccount'][_0xf158('0x58')]({'where':{'id':_0x24f1de[_0xf158('0x4d')]['id']}})[_0xf158('0x1a')](handleEntityNotFound(_0x13e8f3,null))[_0xf158('0x1a')](function(_0x43b7c1){if(_0x43b7c1){_0x24f1de[_0xf158('0x52')][_0xf158('0x59')]=_0x43b7c1['id'];_0x24f1de[_0xf158('0x52')][_0xf158('0x5a')]=integrations[_0xf158('0x5b')](_0x24f1de[_0xf158('0x52')][_0xf158('0x5c')],_0x24f1de[_0xf158('0x52')][_0xf158('0x37')]);_0x24f1de[_0xf158('0x52')][_0xf158('0x5d')]=integrations['getDescriptions'](_0x24f1de[_0xf158('0x52')][_0xf158('0x5c')],_0x24f1de[_0xf158('0x52')]['type']);return db['DeskConfiguration'][_0xf158('0x51')](_0x24f1de['body'],{'include':[{'model':db[_0xf158('0x5e')],'as':_0xf158('0x5a')},{'model':db[_0xf158('0x5e')],'as':_0xf158('0x5d')}]});}return null;})['then'](respondWithResult(_0x13e8f3,null))[_0xf158('0x4c')](handleError(_0x13e8f3,null));};exports[_0xf158('0x5f')]=function(_0x4619a5,_0x4f7208,_0x5c4de1){var _0x177bd4=[{'name':_0xf158('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2489aa='';return db['DeskAccount'][_0xf158('0x58')]({'where':{'id':_0x4619a5[_0xf158('0x4d')]['id']},'attributes':['id',_0xf158('0x61'),'authType',_0xf158('0x62'),_0xf158('0x63'),_0xf158('0x64'),_0xf158('0x65'),'token',_0xf158('0x66')]})['then'](handleEntityNotFound(_0x4f7208,null))['then'](function(_0x497ddf){if(_0x497ddf){_0x2489aa=_0x497ddf[_0xf158('0x61')];var _0x35e237=_0x2489aa[_0xf158('0x67')](-0x1);if(_0x35e237==='/'){_0x2489aa=_0x2489aa[_0xf158('0x68')](0x0,_0x2489aa['lastIndexOf'](_0x35e237));}var _0x503950={'method':_0xf158('0x69'),'uri':util[_0xf158('0x6a')](_0xf158('0x6b'),_0x2489aa),'headers':{'Content-Type':_0xf158('0x6c'),'Accept':'application/json'},'json':!![]};if(_0x497ddf[_0xf158('0x6d')]==='basic'){_0x503950[_0xf158('0x6e')][_0xf158('0x6f')]=util[_0xf158('0x6a')](_0xf158('0x70'),new Buffer(util[_0xf158('0x6a')](_0xf158('0x71'),_0x497ddf['username'],_0x497ddf[_0xf158('0x63')]))['toString'](_0xf158('0x72')));}return rp(_0x503950)[_0xf158('0x1a')](function(_0xf578b8){return _0x177bd4[_0xf158('0x73')](_['map'](_0xf578b8[_0xf158('0x74')][_0xf158('0x75')],function(_0x490830){return{'id':_0x490830[_0xf158('0x30')],'name':_0x490830[_0xf158('0x30')],'type':_0x490830['type'],'active':_0x490830[_0xf158('0x76')],'label':_0x490830[_0xf158('0x77')],'custom':!![]};}));});}})[_0xf158('0x1a')](function(_0x682d3c){return{'count':_0x682d3c[_0xf158('0x4e')],'rows':_0x682d3c};})[_0xf158('0x1a')](respondWithResult(_0x4f7208,null))[_0xf158('0x4c')](function(_0x93d96e){var _0x24033=_0x4619a5[_0xf158('0x3d')]['test']?0x1f4:_0x93d96e[_0xf158('0x78')]||0x1f4;logger[_0xf158('0x20')](_0xf158('0x79'),_0xf158('0x5f'),_0x24033,JSON[_0xf158('0x7a')](_0x93d96e));delete _0x93d96e[_0xf158('0x30')];if(_0x24033===0x191){_0x24033=0x190;}_0x4f7208[_0xf158('0x25')](_0x24033)[_0xf158('0x31')](_0x4619a5[_0xf158('0x3d')][_0xf158('0x7b')]?{'message':_0xf158('0x7c'),'statusCode':_0x93d96e[_0xf158('0x78')]}:_0x93d96e);});}; \ No newline at end of file +var _0xfaf8=['../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','stack','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','rows','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','order','options','addConfiguration','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','getFields','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','base64','concat','_embedded','active','test','statusCode','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3e3308,_0x22629a){var _0x31a96f=function(_0x5ad856){while(--_0x5ad856){_0x3e3308['push'](_0x3e3308['shift']());}};_0x31a96f(++_0x22629a);}(_0xfaf8,0x64));var _0x8faf=function(_0x3c8e64,_0x5aad5d){_0x3c8e64=_0x3c8e64-0x0;var _0x3f7c73=_0xfaf8[_0x3c8e64];return _0x3f7c73;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8faf('0x0'));var zipdir=require(_0x8faf('0x1'));var jsonpatch=require(_0x8faf('0x2'));var rp=require(_0x8faf('0x3'));var moment=require(_0x8faf('0x4'));var BPromise=require(_0x8faf('0x5'));var Mustache=require(_0x8faf('0x6'));var util=require(_0x8faf('0x7'));var path=require(_0x8faf('0x8'));var sox=require('sox');var csv=require(_0x8faf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8faf('0xa'));var squel=require(_0x8faf('0xb'));var crypto=require(_0x8faf('0xc'));var jsforce=require(_0x8faf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8faf('0x9'));var querystring=require(_0x8faf('0xe'));var Papa=require(_0x8faf('0xf'));var Redis=require('ioredis');var authService=require(_0x8faf('0x10'));var qs=require(_0x8faf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8faf('0x12'));var logger=require(_0x8faf('0x13'))(_0x8faf('0x14'));var utils=require(_0x8faf('0x15'));var config=require(_0x8faf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8faf('0x17'))['db'];var integrations=require(_0x8faf('0x18'));var jayson=require(_0x8faf('0x19'));var client=jayson[_0x8faf('0x1a')][_0x8faf('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1638fb,_0x55ab43,_0x177a95,_0x22fdb6){return new BPromise(function(_0x37dbd6,_0x5e0f48){var _0x15a1f7=_0x22fdb6||client;return _0x15a1f7['request'](_0x1638fb,_0x177a95)[_0x8faf('0x1c')](function(_0x1a6855){logger[_0x8faf('0x1d')](_0x8faf('0x1e'),_0x55ab43,_0x8faf('0x1f'));logger[_0x8faf('0x20')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x55ab43,_0x8faf('0x1f'),JSON[_0x8faf('0x21')](_0x1a6855));if(_0x1a6855[_0x8faf('0x22')]){if(_0x1a6855[_0x8faf('0x22')]['code']===0x1f4){logger['error'](_0x8faf('0x1e'),_0x55ab43,_0x1a6855[_0x8faf('0x22')][_0x8faf('0x23')]);return _0x5e0f48(_0x1a6855[_0x8faf('0x22')]['message']);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x55ab43,_0x1a6855[_0x8faf('0x22')][_0x8faf('0x23')]);return _0x37dbd6(_0x1a6855['error'][_0x8faf('0x23')]);}else{logger[_0x8faf('0x1d')]('DeskAccount,\x20%s,\x20%s',_0x55ab43,_0x8faf('0x1f'));_0x37dbd6(_0x1a6855[_0x8faf('0x24')][_0x8faf('0x23')]);}})[_0x8faf('0x25')](function(_0x271f0c){logger[_0x8faf('0x22')](_0x8faf('0x1e'),_0x55ab43,_0x271f0c);_0x5e0f48(_0x271f0c);});});}function respondWithStatusCode(_0x2ad7fb,_0x3f3151){_0x3f3151=_0x3f3151||0xcc;return function(_0x48f42f){if(_0x48f42f){return _0x2ad7fb[_0x8faf('0x26')](_0x3f3151);}return _0x2ad7fb[_0x8faf('0x27')](_0x3f3151)[_0x8faf('0x28')]();};}function respondWithResult(_0x497fd6,_0x43578e){_0x43578e=_0x43578e||0xc8;return function(_0x2e4f5c){if(_0x2e4f5c){return _0x497fd6[_0x8faf('0x27')](_0x43578e)[_0x8faf('0x29')](_0x2e4f5c);}};}function respondWithFilteredResult(_0x57ff5f,_0x46c3c7){return function(_0x1511ff){if(_0x1511ff){var _0x2b37e5=_0x1511ff[_0x8faf('0x2a')],_0x388458=_0x46c3c7['offset'],_0x11d330=_0x46c3c7[_0x8faf('0x2b')]+_0x46c3c7[_0x8faf('0x2c')],_0x52871b;if(_0x11d330>=_0x2b37e5){_0x11d330=_0x2b37e5;_0x52871b=0xc8;}else{_0x52871b=0xce;}_0x57ff5f[_0x8faf('0x27')](_0x52871b);return _0x57ff5f['set']('Content-Range',_0x388458+'-'+_0x11d330+'/'+_0x2b37e5)[_0x8faf('0x29')](_0x1511ff);}return null;};}function patchUpdates(_0x1b9f6c){return function(_0x2c66b6){try{jsonpatch[_0x8faf('0x2d')](_0x2c66b6,_0x1b9f6c,!![]);}catch(_0x2c4aa7){return BPromise[_0x8faf('0x2e')](_0x2c4aa7);}return _0x2c66b6[_0x8faf('0x2f')]();};}function saveUpdates(_0x361dda,_0x495e0a){return function(_0x2e41c0){if(_0x2e41c0){return _0x2e41c0[_0x8faf('0x30')](_0x361dda)[_0x8faf('0x1c')](function(_0xbf666a){return _0xbf666a;});}return null;};}function removeEntity(_0x5d064d,_0x453228){return function(_0x3dbf06){if(_0x3dbf06){return _0x3dbf06[_0x8faf('0x31')]()[_0x8faf('0x1c')](function(){_0x5d064d['status'](0xcc)[_0x8faf('0x28')]();});}};}function handleEntityNotFound(_0x4bc818,_0x960566){return function(_0x3b9967){if(!_0x3b9967){_0x4bc818[_0x8faf('0x26')](0x194);}return _0x3b9967;};}function handleError(_0x470a5b,_0x5aa08a){_0x5aa08a=_0x5aa08a||0x1f4;return function(_0x2d4317){logger[_0x8faf('0x22')](_0x2d4317[_0x8faf('0x32')]);if(_0x2d4317[_0x8faf('0x33')]){delete _0x2d4317['name'];}_0x470a5b['status'](_0x5aa08a)[_0x8faf('0x34')](_0x2d4317);};}exports[_0x8faf('0x35')]=function(_0x58ed40,_0x19bac3){var _0x5af868={},_0x5006a6={},_0x2dc01e={'count':0x0,'rows':[]};var _0x92adc0=_['map'](db[_0x8faf('0x36')][_0x8faf('0x37')],function(_0x20d648){return{'name':_0x20d648[_0x8faf('0x38')],'type':_0x20d648[_0x8faf('0x39')][_0x8faf('0x3a')]};});_0x5006a6[_0x8faf('0x3b')]=_['map'](_0x92adc0,_0x8faf('0x33'));_0x5006a6[_0x8faf('0x3c')]=_[_0x8faf('0x3d')](_0x58ed40[_0x8faf('0x3c')]);_0x5006a6[_0x8faf('0x3e')]=_[_0x8faf('0x3f')](_0x5006a6[_0x8faf('0x3b')],_0x5006a6[_0x8faf('0x3c')]);_0x5af868['attributes']=_[_0x8faf('0x3f')](_0x5006a6[_0x8faf('0x3b')],qs[_0x8faf('0x40')](_0x58ed40[_0x8faf('0x3c')][_0x8faf('0x40')]));_0x5af868[_0x8faf('0x41')]=_0x5af868[_0x8faf('0x41')][_0x8faf('0x42')]?_0x5af868[_0x8faf('0x41')]:_0x5006a6[_0x8faf('0x3b')];if(!_0x58ed40['query']['hasOwnProperty'](_0x8faf('0x43'))){_0x5af868[_0x8faf('0x2c')]=qs[_0x8faf('0x2c')](_0x58ed40[_0x8faf('0x3c')][_0x8faf('0x2c')]);_0x5af868[_0x8faf('0x2b')]=qs[_0x8faf('0x2b')](_0x58ed40['query'][_0x8faf('0x2b')]);}_0x5af868['order']=qs['sort'](_0x58ed40[_0x8faf('0x3c')][_0x8faf('0x44')]);_0x5af868[_0x8faf('0x45')]=qs[_0x8faf('0x3e')](_[_0x8faf('0x46')](_0x58ed40['query'],_0x5006a6[_0x8faf('0x3e')]),_0x92adc0);if(_0x58ed40['query'][_0x8faf('0x47')]){_0x5af868[_0x8faf('0x45')]=_[_0x8faf('0x48')](_0x5af868[_0x8faf('0x45')],{'$or':_[_0x8faf('0x49')](_0x92adc0,function(_0x25da8a){if(_0x25da8a[_0x8faf('0x39')]!==_0x8faf('0x4a')){var _0x3eaa42={};_0x3eaa42[_0x25da8a[_0x8faf('0x33')]]={'$like':'%'+_0x58ed40[_0x8faf('0x3c')][_0x8faf('0x47')]+'%'};return _0x3eaa42;}})});}_0x5af868=_[_0x8faf('0x48')]({},_0x5af868,_0x58ed40['options']);var _0x314e93={'where':_0x5af868['where']};return db['DeskAccount'][_0x8faf('0x2a')](_0x314e93)[_0x8faf('0x1c')](function(_0x29a16d){_0x2dc01e[_0x8faf('0x2a')]=_0x29a16d;if(_0x58ed40['query'][_0x8faf('0x4b')]){_0x5af868[_0x8faf('0x4c')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x5af868);})['then'](function(_0x188c1b){_0x2dc01e[_0x8faf('0x4d')]=_0x188c1b;return _0x2dc01e;})['then'](respondWithFilteredResult(_0x19bac3,_0x5af868))[_0x8faf('0x25')](handleError(_0x19bac3,null));};exports[_0x8faf('0x4e')]=function(_0x101dd2,_0x53751a){var _0x545330={'raw':![],'where':{'id':_0x101dd2[_0x8faf('0x4f')]['id']}},_0x41bad7={};_0x41bad7['model']=_[_0x8faf('0x3d')](db[_0x8faf('0x36')][_0x8faf('0x37')]);_0x41bad7[_0x8faf('0x3c')]=_[_0x8faf('0x3d')](_0x101dd2[_0x8faf('0x3c')]);_0x41bad7[_0x8faf('0x3e')]=_[_0x8faf('0x3f')](_0x41bad7[_0x8faf('0x3b')],_0x41bad7[_0x8faf('0x3c')]);_0x545330[_0x8faf('0x41')]=_['intersection'](_0x41bad7[_0x8faf('0x3b')],qs[_0x8faf('0x40')](_0x101dd2[_0x8faf('0x3c')]['fields']));_0x545330['attributes']=_0x545330['attributes']['length']?_0x545330[_0x8faf('0x41')]:_0x41bad7[_0x8faf('0x3b')];if(_0x101dd2['query'][_0x8faf('0x4b')]){_0x545330[_0x8faf('0x4c')]=[{'all':!![]}];}_0x545330=_['merge']({},_0x545330,_0x101dd2['options']);return db[_0x8faf('0x36')][_0x8faf('0x50')](_0x545330)[_0x8faf('0x1c')](handleEntityNotFound(_0x53751a,null))['then'](respondWithResult(_0x53751a,null))[_0x8faf('0x25')](handleError(_0x53751a,null));};exports[_0x8faf('0x51')]=function(_0x6c1d35,_0x578955){return db[_0x8faf('0x36')][_0x8faf('0x51')](_0x6c1d35[_0x8faf('0x52')],{})['then'](respondWithResult(_0x578955,0xc9))['catch'](handleError(_0x578955,null));};exports[_0x8faf('0x30')]=function(_0x1c015c,_0x1869ed){if(_0x1c015c[_0x8faf('0x52')]['id']){delete _0x1c015c[_0x8faf('0x52')]['id'];}return db[_0x8faf('0x36')][_0x8faf('0x50')]({'where':{'id':_0x1c015c[_0x8faf('0x4f')]['id']}})[_0x8faf('0x1c')](handleEntityNotFound(_0x1869ed,null))['then'](saveUpdates(_0x1c015c[_0x8faf('0x52')],null))['then'](respondWithResult(_0x1869ed,null))[_0x8faf('0x25')](handleError(_0x1869ed,null));};exports[_0x8faf('0x31')]=function(_0x5dabd5,_0x5e530c){return db[_0x8faf('0x36')][_0x8faf('0x50')]({'where':{'id':_0x5dabd5[_0x8faf('0x4f')]['id']}})[_0x8faf('0x1c')](handleEntityNotFound(_0x5e530c,null))[_0x8faf('0x1c')](removeEntity(_0x5e530c,null))['catch'](handleError(_0x5e530c,null));};exports[_0x8faf('0x53')]=function(_0x17f221,_0x176293,_0xc25fbb){var _0x270a5c={};var _0x325b52={};var _0x20c378;var _0x4b6000;return db[_0x8faf('0x36')][_0x8faf('0x54')]({'where':{'id':_0x17f221[_0x8faf('0x4f')]['id']}})[_0x8faf('0x1c')](handleEntityNotFound(_0x176293,null))['then'](function(_0x506086){if(_0x506086){_0x20c378=_0x506086;_0x325b52[_0x8faf('0x3b')]=_[_0x8faf('0x3d')](db[_0x8faf('0x55')]['rawAttributes']);_0x325b52[_0x8faf('0x3c')]=_[_0x8faf('0x3d')](_0x17f221[_0x8faf('0x3c')]);_0x325b52[_0x8faf('0x3e')]=_[_0x8faf('0x3f')](_0x325b52['model'],_0x325b52[_0x8faf('0x3c')]);_0x270a5c[_0x8faf('0x41')]=_[_0x8faf('0x3f')](_0x325b52['model'],qs[_0x8faf('0x40')](_0x17f221[_0x8faf('0x3c')][_0x8faf('0x40')]));_0x270a5c[_0x8faf('0x41')]=_0x270a5c[_0x8faf('0x41')][_0x8faf('0x42')]?_0x270a5c[_0x8faf('0x41')]:_0x325b52['model'];_0x270a5c[_0x8faf('0x56')]=qs['sort'](_0x17f221[_0x8faf('0x3c')][_0x8faf('0x44')]);_0x270a5c[_0x8faf('0x45')]=qs[_0x8faf('0x3e')](_['pick'](_0x17f221[_0x8faf('0x3c')],_0x325b52['filters']));if(_0x17f221[_0x8faf('0x3c')][_0x8faf('0x47')]){_0x270a5c[_0x8faf('0x45')]=_[_0x8faf('0x48')](_0x270a5c[_0x8faf('0x45')],{'$or':_[_0x8faf('0x49')](_0x270a5c['attributes'],function(_0x3d1fc8){var _0x2f4710={};_0x2f4710[_0x3d1fc8]={'$like':'%'+_0x17f221['query'][_0x8faf('0x47')]+'%'};return _0x2f4710;})});}_0x270a5c=_[_0x8faf('0x48')]({},_0x270a5c,_0x17f221[_0x8faf('0x57')]);return _0x20c378[_0x8faf('0x53')](_0x270a5c);}})[_0x8faf('0x1c')](function(_0x49d346){if(_0x49d346){_0x4b6000=_0x49d346[_0x8faf('0x42')];if(!_0x17f221['query']['hasOwnProperty']('nolimit')){_0x270a5c['limit']=qs['limit'](_0x17f221[_0x8faf('0x3c')]['limit']);_0x270a5c[_0x8faf('0x2b')]=qs[_0x8faf('0x2b')](_0x17f221[_0x8faf('0x3c')]['offset']);}return _0x20c378['getConfigurations'](_0x270a5c);}})['then'](function(_0x5965f2){if(_0x5965f2){return _0x5965f2?{'count':_0x4b6000,'rows':_0x5965f2}:null;}})[_0x8faf('0x1c')](respondWithResult(_0x176293,null))[_0x8faf('0x25')](handleError(_0x176293,null));};exports[_0x8faf('0x58')]=function(_0x27d94b,_0x3e8c64,_0x1e294c){if(_0x27d94b['body']['id']){delete _0x27d94b[_0x8faf('0x52')]['id'];}return db[_0x8faf('0x36')]['findOne']({'where':{'id':_0x27d94b[_0x8faf('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3e8c64,null))[_0x8faf('0x1c')](function(_0x2c6b80){if(_0x2c6b80){_0x27d94b[_0x8faf('0x52')]['AccountId']=_0x2c6b80['id'];_0x27d94b[_0x8faf('0x52')][_0x8faf('0x59')]=integrations[_0x8faf('0x5a')](_0x27d94b[_0x8faf('0x52')][_0x8faf('0x5b')],_0x27d94b[_0x8faf('0x52')][_0x8faf('0x39')]);_0x27d94b[_0x8faf('0x52')]['Descriptions']=integrations[_0x8faf('0x5c')](_0x27d94b[_0x8faf('0x52')]['channel'],_0x27d94b[_0x8faf('0x52')][_0x8faf('0x39')]);return db[_0x8faf('0x55')][_0x8faf('0x51')](_0x27d94b[_0x8faf('0x52')],{'include':[{'model':db[_0x8faf('0x5d')],'as':_0x8faf('0x59')},{'model':db[_0x8faf('0x5d')],'as':_0x8faf('0x5e')}]});}return null;})['then'](respondWithResult(_0x3e8c64,null))['catch'](handleError(_0x3e8c64,null));};exports[_0x8faf('0x5f')]=function(_0xdfbf57,_0x1e200d,_0xc5e114){var _0x6bf177=[{'name':_0x8faf('0x60'),'label':_0x8faf('0x60'),'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 _0x4067cf='';return db[_0x8faf('0x36')][_0x8faf('0x54')]({'where':{'id':_0xdfbf57['params']['id']},'attributes':['id','remoteUri',_0x8faf('0x61'),_0x8faf('0x62'),_0x8faf('0x63'),_0x8faf('0x64'),_0x8faf('0x65'),_0x8faf('0x66'),_0x8faf('0x67')]})['then'](handleEntityNotFound(_0x1e200d,null))[_0x8faf('0x1c')](function(_0x4efc0c){if(_0x4efc0c){_0x4067cf=_0x4efc0c[_0x8faf('0x68')];var _0x3b91ba=_0x4067cf[_0x8faf('0x69')](-0x1);if(_0x3b91ba==='/'){_0x4067cf=_0x4067cf[_0x8faf('0x6a')](0x0,_0x4067cf[_0x8faf('0x6b')](_0x3b91ba));}var _0x53429f={'method':'GET','uri':util[_0x8faf('0x6c')](_0x8faf('0x6d'),_0x4067cf),'headers':{'Content-Type':'application/json','Accept':_0x8faf('0x6e')},'json':!![]};if(_0x4efc0c['authType']===_0x8faf('0x6f')){_0x53429f[_0x8faf('0x70')][_0x8faf('0x71')]=util[_0x8faf('0x6c')](_0x8faf('0x72'),new Buffer(util[_0x8faf('0x6c')](_0x8faf('0x73'),_0x4efc0c[_0x8faf('0x62')],_0x4efc0c['password']))['toString'](_0x8faf('0x74')));}return rp(_0x53429f)[_0x8faf('0x1c')](function(_0x2aa68f){return _0x6bf177[_0x8faf('0x75')](_['map'](_0x2aa68f[_0x8faf('0x76')]['entries'],function(_0x5ec2e0){return{'id':_0x5ec2e0[_0x8faf('0x33')],'name':_0x5ec2e0['name'],'type':_0x5ec2e0['type'],'active':_0x5ec2e0[_0x8faf('0x77')],'label':_0x5ec2e0['label'],'custom':!![]};}));});}})[_0x8faf('0x1c')](function(_0x2c51fd){return{'count':_0x2c51fd[_0x8faf('0x42')],'rows':_0x2c51fd};})['then'](respondWithResult(_0x1e200d,null))['catch'](function(_0x2907b3){var _0x5a4dfa=_0xdfbf57[_0x8faf('0x3c')][_0x8faf('0x78')]?0x1f4:_0x2907b3[_0x8faf('0x79')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5a4dfa,JSON[_0x8faf('0x21')](_0x2907b3));delete _0x2907b3[_0x8faf('0x33')];if(_0x5a4dfa===0x191){_0x5a4dfa=0x190;}_0x1e200d[_0x8faf('0x27')](_0x5a4dfa)[_0x8faf('0x34')](_0xdfbf57[_0x8faf('0x3c')][_0x8faf('0x78')]?{'message':_0x8faf('0x7a'),'statusCode':_0x2907b3[_0x8faf('0x79')]}:_0x2907b3);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 49c5f2d..8690b55 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 _0x8bff=['rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','bluebird','request-promise','path'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x8bff,0x190));var _0xf8bf=function(_0x421630,_0x49cb1b){_0x421630=_0x421630-0x0;var _0x911b44=_0x8bff[_0x421630];return _0x911b44;};'use strict';var _=require(_0xf8bf('0x0'));var util=require(_0xf8bf('0x1'));var logger=require('../../config/logger')(_0xf8bf('0x2'));var moment=require('moment');var BPromise=require(_0xf8bf('0x3'));var rp=require(_0xf8bf('0x4'));var fs=require('fs');var path=require(_0xf8bf('0x5'));var rimraf=require(_0xf8bf('0x6'));var config=require(_0xf8bf('0x7'));var attributes=require(_0xf8bf('0x8'));var integrations=require(_0xf8bf('0x9'));module[_0xf8bf('0xa')]=function(_0x4c48c3,_0x17702a){return _0x4c48c3[_0xf8bf('0xb')](_0xf8bf('0xc'),attributes,{'tableName':_0xf8bf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0612=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts'];(function(_0x483592,_0x143c23){var _0x3b9fdc=function(_0x585f02){while(--_0x585f02){_0x483592['push'](_0x483592['shift']());}};_0x3b9fdc(++_0x143c23);}(_0x0612,0xc3));var _0x2061=function(_0xa88075,_0x2811f1){_0xa88075=_0xa88075-0x0;var _0x4e9998=_0x0612[_0xa88075];return _0x4e9998;};'use strict';var _=require(_0x2061('0x0'));var util=require(_0x2061('0x1'));var logger=require(_0x2061('0x2'))(_0x2061('0x3'));var moment=require(_0x2061('0x4'));var BPromise=require(_0x2061('0x5'));var rp=require(_0x2061('0x6'));var fs=require('fs');var path=require(_0x2061('0x7'));var rimraf=require(_0x2061('0x8'));var config=require(_0x2061('0x9'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x2061('0xa'));module[_0x2061('0xb')]=function(_0x29b52b,_0x22136c){return _0x29b52b[_0x2061('0xc')](_0x2061('0xd'),attributes,{'tableName':_0x2061('0xe'),'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 05fa1c3..dc968fd 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 _0x6dbc=['info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowDeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6dbc,0xd1));var _0xc6db=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x6dbc[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xc6db('0x0'));var util=require(_0xc6db('0x1'));var moment=require(_0xc6db('0x2'));var BPromise=require(_0xc6db('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6db('0x4'));var db=require(_0xc6db('0x5'))['db'];var utils=require(_0xc6db('0x6'));var logger=require(_0xc6db('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc6db('0x8'));var client=jayson[_0xc6db('0x9')][_0xc6db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d0f29,_0x19d577,_0x4904f4){return new BPromise(function(_0x339fca,_0x2e2f7b){return client[_0xc6db('0xb')](_0x2d0f29,_0x4904f4)[_0xc6db('0xc')](function(_0x1187d4){logger[_0xc6db('0xd')](_0xc6db('0xe'),_0x19d577,_0xc6db('0xf'));logger[_0xc6db('0x10')](_0xc6db('0x11'),_0x19d577,_0xc6db('0xf'),JSON[_0xc6db('0x12')](_0x1187d4));if(_0x1187d4[_0xc6db('0x13')]){if(_0x1187d4[_0xc6db('0x13')][_0xc6db('0x14')]===0x1f4){logger[_0xc6db('0x13')]('DeskAccount,\x20%s,\x20%s',_0x19d577,_0x1187d4['error'][_0xc6db('0x15')]);return _0x2e2f7b(_0x1187d4['error'][_0xc6db('0x15')]);}logger[_0xc6db('0x13')]('DeskAccount,\x20%s,\x20%s',_0x19d577,_0x1187d4[_0xc6db('0x13')][_0xc6db('0x15')]);return _0x339fca(_0x1187d4[_0xc6db('0x13')][_0xc6db('0x15')]);}else{logger[_0xc6db('0xd')](_0xc6db('0xe'),_0x19d577,_0xc6db('0xf'));_0x339fca(_0x1187d4[_0xc6db('0x16')]['message']);}})[_0xc6db('0x17')](function(_0x20c9f1){logger['error'](_0xc6db('0xe'),_0x19d577,_0x20c9f1);_0x2e2f7b(_0x20c9f1);});});}exports[_0xc6db('0x18')]=function(_0x3a0524){var _0x1fa13c=this;return new Promise(function(_0x2c3b16,_0x264c96){return db[_0xc6db('0x19')][_0xc6db('0x1a')]({'raw':_0x3a0524[_0xc6db('0x1b')]?_0x3a0524[_0xc6db('0x1b')][_0xc6db('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a0524[_0xc6db('0x1b')]?_0x3a0524[_0xc6db('0x1b')][_0xc6db('0x1d')]||null:null,'attributes':_0x3a0524[_0xc6db('0x1b')]?_0x3a0524[_0xc6db('0x1b')][_0xc6db('0x1e')]||null:null,'limit':_0x3a0524['options']?_0x3a0524[_0xc6db('0x1b')][_0xc6db('0x1f')]||null:null,'include':_0x3a0524[_0xc6db('0x1b')]?_0x3a0524['options']['include']?_[_0xc6db('0x20')](_0x3a0524[_0xc6db('0x1b')][_0xc6db('0x21')],function(_0x1ce867){return{'model':db[_0x1ce867[_0xc6db('0x22')]],'as':_0x1ce867['as'],'attributes':_0x1ce867[_0xc6db('0x1e')],'include':_0x1ce867[_0xc6db('0x21')]?_[_0xc6db('0x20')](_0x1ce867[_0xc6db('0x21')],function(_0x79ac18){return{'model':db[_0x79ac18['model']],'as':_0x79ac18['as'],'attributes':_0x79ac18[_0xc6db('0x1e')],'include':_0x79ac18[_0xc6db('0x21')]?_[_0xc6db('0x20')](_0x79ac18[_0xc6db('0x21')],function(_0x1c3456){return{'model':db[_0x1c3456[_0xc6db('0x22')]],'as':_0x1c3456['as'],'attributes':_0x1c3456[_0xc6db('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc6db('0xc')](function(_0x4829de){logger[_0xc6db('0xd')](_0xc6db('0x18'),_0x3a0524);logger[_0xc6db('0x10')]('GetDeskAccount',_0x3a0524,JSON[_0xc6db('0x12')](_0x4829de));_0x2c3b16(_0x4829de);})[_0xc6db('0x17')](function(_0x28c9ad){logger[_0xc6db('0x13')]('GetDeskAccount',_0x28c9ad[_0xc6db('0x15')],_0x3a0524);_0x264c96(_0x1fa13c[_0xc6db('0x13')](0x1f4,_0x28c9ad[_0xc6db('0x15')]));});});};exports[_0xc6db('0x23')]=function(_0x492072){var _0x2491e4=this;return new Promise(function(_0x4c7cde,_0x58eefc){return db[_0xc6db('0x19')][_0xc6db('0x24')]({'raw':_0x492072[_0xc6db('0x1b')]?_0x492072[_0xc6db('0x1b')][_0xc6db('0x1c')]===undefined?!![]:![]:!![],'where':_0x492072[_0xc6db('0x1b')]?_0x492072[_0xc6db('0x1b')][_0xc6db('0x1d')]||null:null,'attributes':_0x492072[_0xc6db('0x1b')]?_0x492072[_0xc6db('0x1b')][_0xc6db('0x1e')]||null:null,'include':_0x492072[_0xc6db('0x1b')]?_0x492072[_0xc6db('0x1b')]['include']?_['map'](_0x492072[_0xc6db('0x1b')][_0xc6db('0x21')],function(_0x1d98c0){return{'model':db[_0x1d98c0['model']],'as':_0x1d98c0['as'],'attributes':_0x1d98c0[_0xc6db('0x1e')],'include':_0x1d98c0['include']?_[_0xc6db('0x20')](_0x1d98c0[_0xc6db('0x21')],function(_0x560286){return{'model':db[_0x560286[_0xc6db('0x22')]],'as':_0x560286['as'],'attributes':_0x560286[_0xc6db('0x1e')],'include':_0x560286['include']?_[_0xc6db('0x20')](_0x560286[_0xc6db('0x21')],function(_0x579cdd){return{'model':db[_0x579cdd[_0xc6db('0x22')]],'as':_0x579cdd['as'],'attributes':_0x579cdd['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6db('0xc')](function(_0x38622b){logger[_0xc6db('0xd')](_0xc6db('0x23'),_0x492072);logger[_0xc6db('0x10')]('ShowDeskAccount',_0x492072,JSON[_0xc6db('0x12')](_0x38622b));_0x4c7cde(_0x38622b);})[_0xc6db('0x17')](function(_0x529322){logger[_0xc6db('0x13')]('ShowDeskAccount',_0x529322[_0xc6db('0x15')],_0x492072);_0x58eefc(_0x2491e4[_0xc6db('0x13')](0x1f4,_0x529322[_0xc6db('0x15')]));});});}; \ No newline at end of file +var _0x17d5=['lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','DeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','info','GetDeskAccount','ShowDeskAccount'];(function(_0x179c0c,_0x20fe42){var _0x2ab663=function(_0x3b9c1f){while(--_0x3b9c1f){_0x179c0c['push'](_0x179c0c['shift']());}};_0x2ab663(++_0x20fe42);}(_0x17d5,0xc6));var _0x517d=function(_0x436ab8,_0x3029cd){_0x436ab8=_0x436ab8-0x0;var _0x337028=_0x17d5[_0x436ab8];return _0x337028;};'use strict';var _=require(_0x517d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x517d('0x1'));var rs=require(_0x517d('0x2'));var fs=require('fs');var Redis=require(_0x517d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x517d('0x4'));var logger=require('../../config/logger')(_0x517d('0x5'));var config=require(_0x517d('0x6'));var jayson=require(_0x517d('0x7'));var client=jayson[_0x517d('0x8')][_0x517d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c1dbd,_0x3d3074,_0x77e827){return new BPromise(function(_0x5b57bc,_0x4522a5){return client[_0x517d('0xa')](_0x5c1dbd,_0x77e827)[_0x517d('0xb')](function(_0x321369){logger['info'](_0x517d('0xc'),_0x3d3074,_0x517d('0xd'));logger[_0x517d('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x3d3074,_0x517d('0xd'),JSON[_0x517d('0xf')](_0x321369));if(_0x321369[_0x517d('0x10')]){if(_0x321369[_0x517d('0x10')][_0x517d('0x11')]===0x1f4){logger['error'](_0x517d('0xc'),_0x3d3074,_0x321369[_0x517d('0x10')][_0x517d('0x12')]);return _0x4522a5(_0x321369[_0x517d('0x10')]['message']);}logger[_0x517d('0x10')](_0x517d('0xc'),_0x3d3074,_0x321369[_0x517d('0x10')][_0x517d('0x12')]);return _0x5b57bc(_0x321369[_0x517d('0x10')]['message']);}else{logger['info'](_0x517d('0xc'),_0x3d3074,'request\x20sent');_0x5b57bc(_0x321369['result'][_0x517d('0x12')]);}})[_0x517d('0x13')](function(_0x2d6681){logger[_0x517d('0x10')]('DeskAccount,\x20%s,\x20%s',_0x3d3074,_0x2d6681);_0x4522a5(_0x2d6681);});});}exports['GetDeskAccount']=function(_0x58c5be){var _0x5a0696=this;return new Promise(function(_0x10f326,_0x561e4b){return db[_0x517d('0x14')][_0x517d('0x15')]({'raw':_0x58c5be[_0x517d('0x16')]?_0x58c5be[_0x517d('0x16')][_0x517d('0x17')]===undefined?!![]:![]:!![],'where':_0x58c5be[_0x517d('0x16')]?_0x58c5be['options'][_0x517d('0x18')]||null:null,'attributes':_0x58c5be[_0x517d('0x16')]?_0x58c5be[_0x517d('0x16')]['attributes']||null:null,'limit':_0x58c5be[_0x517d('0x16')]?_0x58c5be[_0x517d('0x16')][_0x517d('0x19')]||null:null,'include':_0x58c5be[_0x517d('0x16')]?_0x58c5be[_0x517d('0x16')][_0x517d('0x1a')]?_[_0x517d('0x1b')](_0x58c5be[_0x517d('0x16')][_0x517d('0x1a')],function(_0x22b798){return{'model':db[_0x22b798[_0x517d('0x1c')]],'as':_0x22b798['as'],'attributes':_0x22b798[_0x517d('0x1d')],'include':_0x22b798['include']?_[_0x517d('0x1b')](_0x22b798[_0x517d('0x1a')],function(_0x58901a){return{'model':db[_0x58901a[_0x517d('0x1c')]],'as':_0x58901a['as'],'attributes':_0x58901a[_0x517d('0x1d')],'include':_0x58901a[_0x517d('0x1a')]?_[_0x517d('0x1b')](_0x58901a[_0x517d('0x1a')],function(_0x43f002){return{'model':db[_0x43f002[_0x517d('0x1c')]],'as':_0x43f002['as'],'attributes':_0x43f002[_0x517d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x517d('0xb')](function(_0x2f57db){logger[_0x517d('0x1e')](_0x517d('0x1f'),_0x58c5be);logger[_0x517d('0xe')](_0x517d('0x1f'),_0x58c5be,JSON[_0x517d('0xf')](_0x2f57db));_0x10f326(_0x2f57db);})['catch'](function(_0x482da2){logger[_0x517d('0x10')](_0x517d('0x1f'),_0x482da2[_0x517d('0x12')],_0x58c5be);_0x561e4b(_0x5a0696[_0x517d('0x10')](0x1f4,_0x482da2[_0x517d('0x12')]));});});};exports['ShowDeskAccount']=function(_0x5d779d){var _0x1d004d=this;return new Promise(function(_0x3c8d49,_0x3b2002){return db['DeskAccount']['find']({'raw':_0x5d779d[_0x517d('0x16')]?_0x5d779d[_0x517d('0x16')][_0x517d('0x17')]===undefined?!![]:![]:!![],'where':_0x5d779d[_0x517d('0x16')]?_0x5d779d['options'][_0x517d('0x18')]||null:null,'attributes':_0x5d779d[_0x517d('0x16')]?_0x5d779d['options']['attributes']||null:null,'include':_0x5d779d['options']?_0x5d779d[_0x517d('0x16')][_0x517d('0x1a')]?_['map'](_0x5d779d['options'][_0x517d('0x1a')],function(_0x10948f){return{'model':db[_0x10948f[_0x517d('0x1c')]],'as':_0x10948f['as'],'attributes':_0x10948f[_0x517d('0x1d')],'include':_0x10948f[_0x517d('0x1a')]?_[_0x517d('0x1b')](_0x10948f[_0x517d('0x1a')],function(_0xc2180d){return{'model':db[_0xc2180d[_0x517d('0x1c')]],'as':_0xc2180d['as'],'attributes':_0xc2180d[_0x517d('0x1d')],'include':_0xc2180d[_0x517d('0x1a')]?_[_0x517d('0x1b')](_0xc2180d[_0x517d('0x1a')],function(_0x44fad8){return{'model':db[_0x44fad8['model']],'as':_0x44fad8['as'],'attributes':_0x44fad8[_0x517d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23fd31){logger[_0x517d('0x1e')](_0x517d('0x20'),_0x5d779d);logger[_0x517d('0xe')]('ShowDeskAccount',_0x5d779d,JSON[_0x517d('0xf')](_0x23fd31));_0x3c8d49(_0x23fd31);})['catch'](function(_0x57c8fd){logger['error']('ShowDeskAccount',_0x57c8fd['message'],_0x5d779d);_0x3b2002(_0x1d004d[_0x517d('0x10')](0x1f4,_0x57c8fd[_0x517d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 5c9c3f6..e322c0f 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 _0x7541=['/:id/fields','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','index','get','isAuthenticated'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x7541,0x106));var _0x1754=function(_0x4d05a0,_0x53aa7e){_0x4d05a0=_0x4d05a0-0x0;var _0x4c999c=_0x7541[_0x4d05a0];return _0x4c999c;};'use strict';var multer=require(_0x1754('0x0'));var util=require(_0x1754('0x1'));var path=require('path');var timeout=require(_0x1754('0x2'));var express=require(_0x1754('0x3'));var router=express[_0x1754('0x4')]();var fs_extra=require(_0x1754('0x5'));var auth=require(_0x1754('0x6'));var interaction=require(_0x1754('0x7'));var config=require(_0x1754('0x8'));var controller=require(_0x1754('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1754('0xa')]);router[_0x1754('0xb')]('/:id',auth[_0x1754('0xc')](),controller['show']);router[_0x1754('0xb')](_0x1754('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x1754('0xb')]('/:id/subjects',auth[_0x1754('0xc')](),controller[_0x1754('0xe')]);router[_0x1754('0xb')](_0x1754('0xf'),auth[_0x1754('0xc')](),controller['getDescriptions']);router[_0x1754('0xb')](_0x1754('0x10'),auth[_0x1754('0xc')](),controller[_0x1754('0x11')]);router[_0x1754('0x12')]('/',auth[_0x1754('0xc')](),controller[_0x1754('0x13')]);router[_0x1754('0x12')](_0x1754('0x10'),auth[_0x1754('0xc')](),controller[_0x1754('0x14')]);router['put'](_0x1754('0x15'),auth['isAuthenticated'](),controller['update']);router[_0x1754('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x1754('0x17')]);module[_0x1754('0x18')]=router; \ No newline at end of file +var _0x6e1d=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','show','getFields','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','util'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x6e1d,0xa6));var _0xd6e1=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x6e1d[_0x22f8ab];return _0x2a70e5;};'use strict';var multer=require(_0xd6e1('0x0'));var util=require(_0xd6e1('0x1'));var path=require(_0xd6e1('0x2'));var timeout=require(_0xd6e1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd6e1('0x4'));var interaction=require(_0xd6e1('0x5'));var config=require(_0xd6e1('0x6'));var controller=require(_0xd6e1('0x7'));router[_0xd6e1('0x8')]('/',auth[_0xd6e1('0x9')](),controller['index']);router[_0xd6e1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd6e1('0xa')]);router[_0xd6e1('0x8')]('/:id/fields',auth[_0xd6e1('0x9')](),controller[_0xd6e1('0xb')]);router[_0xd6e1('0x8')]('/:id/subjects',auth[_0xd6e1('0x9')](),controller[_0xd6e1('0xc')]);router['get'](_0xd6e1('0xd'),auth[_0xd6e1('0x9')](),controller['getDescriptions']);router['get'](_0xd6e1('0xe'),auth[_0xd6e1('0x9')](),controller[_0xd6e1('0xf')]);router[_0xd6e1('0x10')]('/',auth['isAuthenticated'](),controller[_0xd6e1('0x11')]);router[_0xd6e1('0x10')]('/:id/tags',auth[_0xd6e1('0x9')](),controller[_0xd6e1('0x12')]);router[_0xd6e1('0x13')](_0xd6e1('0x14'),auth['isAuthenticated'](),controller[_0xd6e1('0x15')]);router[_0xd6e1('0x16')](_0xd6e1('0x14'),auth[_0xd6e1('0x9')](),controller[_0xd6e1('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 332433f..c8bc0df 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 _0x014a=['STRING','sequelize'];(function(_0x570759,_0x2354b7){var _0x152ff8=function(_0x319c92){while(--_0x319c92){_0x570759['push'](_0x570759['shift']());}};_0x152ff8(++_0x2354b7);}(_0x014a,0x1a1));var _0xa014=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x014a[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0xa014('0x0'));module['exports']={'name':{'type':Sequelize[_0xa014('0x1')]},'description':{'type':Sequelize[_0xa014('0x1')]}}; \ No newline at end of file +var _0x385f=['STRING','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x385f,0x95));var _0xf385=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0x385f[_0xcfc44];return _0x307a25;};'use strict';var Sequelize=require('sequelize');module[_0xf385('0x0')]={'name':{'type':Sequelize[_0xf385('0x1')]},'description':{'type':Sequelize[_0xf385('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index e695c26..0971a6b 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 _0xb277=['../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','DeskConfiguration','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','length','find','create','body','getFields','DeskField','rawAttributes','order','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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'];(function(_0x201223,_0x3b4566){var _0x3eb0ed=function(_0x1f950f){while(--_0x1f950f){_0x201223['push'](_0x201223['shift']());}};_0x3eb0ed(++_0x3b4566);}(_0xb277,0x10e));var _0x7b27=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xb277[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7b27('0x0'));var rimraf=require(_0x7b27('0x1'));var zipdir=require(_0x7b27('0x2'));var jsonpatch=require(_0x7b27('0x3'));var rp=require(_0x7b27('0x4'));var moment=require(_0x7b27('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7b27('0x6'));var util=require(_0x7b27('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7b27('0x8'));var ejs=require(_0x7b27('0x9'));var fs=require('fs');var fs_extra=require(_0x7b27('0xa'));var _=require(_0x7b27('0xb'));var squel=require(_0x7b27('0xc'));var crypto=require(_0x7b27('0xd'));var jsforce=require(_0x7b27('0xe'));var deskjs=require(_0x7b27('0xf'));var toCsv=require(_0x7b27('0x8'));var querystring=require(_0x7b27('0x10'));var Papa=require(_0x7b27('0x11'));var Redis=require(_0x7b27('0x12'));var authService=require(_0x7b27('0x13'));var qs=require(_0x7b27('0x14'));var as=require(_0x7b27('0x15'));var hardwareService=require(_0x7b27('0x16'));var logger=require('../../config/logger')(_0x7b27('0x17'));var utils=require(_0x7b27('0x18'));var config=require(_0x7b27('0x19'));var licenseUtil=require(_0x7b27('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7b27('0x1b'));var client=jayson[_0x7b27('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x446aaf,_0x457751,_0x11a044,_0xf0066a){return new BPromise(function(_0x57710c,_0x5c23fe){var _0x4296da=_0xf0066a||client;return _0x4296da[_0x7b27('0x1d')](_0x446aaf,_0x11a044)['then'](function(_0x3fdea1){logger[_0x7b27('0x1e')](_0x7b27('0x1f'),_0x457751,_0x7b27('0x20'));logger[_0x7b27('0x21')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x457751,'request\x20sent',JSON[_0x7b27('0x22')](_0x3fdea1));if(_0x3fdea1[_0x7b27('0x23')]){if(_0x3fdea1['error'][_0x7b27('0x24')]===0x1f4){logger[_0x7b27('0x23')](_0x7b27('0x1f'),_0x457751,_0x3fdea1[_0x7b27('0x23')][_0x7b27('0x25')]);return _0x5c23fe(_0x3fdea1[_0x7b27('0x23')][_0x7b27('0x25')]);}logger[_0x7b27('0x23')]('DeskConfiguration,\x20%s,\x20%s',_0x457751,_0x3fdea1['error'][_0x7b27('0x25')]);return _0x57710c(_0x3fdea1[_0x7b27('0x23')]['message']);}else{logger[_0x7b27('0x1e')](_0x7b27('0x1f'),_0x457751,_0x7b27('0x20'));_0x57710c(_0x3fdea1[_0x7b27('0x26')][_0x7b27('0x25')]);}})['catch'](function(_0xa5f67f){logger[_0x7b27('0x23')](_0x7b27('0x1f'),_0x457751,_0xa5f67f);_0x5c23fe(_0xa5f67f);});});}function respondWithStatusCode(_0x20e754,_0x15f8b4){_0x15f8b4=_0x15f8b4||0xcc;return function(_0x455bb0){if(_0x455bb0){return _0x20e754[_0x7b27('0x27')](_0x15f8b4);}return _0x20e754[_0x7b27('0x28')](_0x15f8b4)[_0x7b27('0x29')]();};}function respondWithResult(_0x2b3835,_0x193f8f){_0x193f8f=_0x193f8f||0xc8;return function(_0x41c842){if(_0x41c842){return _0x2b3835['status'](_0x193f8f)[_0x7b27('0x2a')](_0x41c842);}};}function respondWithFilteredResult(_0x1e6ae6,_0x2dca91){return function(_0x38eb6e){if(_0x38eb6e){var _0x467b35=_0x38eb6e[_0x7b27('0x2b')],_0x219367=_0x2dca91['offset'],_0x3263a8=_0x2dca91[_0x7b27('0x2c')]+_0x2dca91['limit'],_0x5560ec;if(_0x3263a8>=_0x467b35){_0x3263a8=_0x467b35;_0x5560ec=0xc8;}else{_0x5560ec=0xce;}_0x1e6ae6[_0x7b27('0x28')](_0x5560ec);return _0x1e6ae6[_0x7b27('0x2d')](_0x7b27('0x2e'),_0x219367+'-'+_0x3263a8+'/'+_0x467b35)[_0x7b27('0x2a')](_0x38eb6e);}return null;};}function patchUpdates(_0x3dc3c7){return function(_0x1f1f56){try{jsonpatch[_0x7b27('0x2f')](_0x1f1f56,_0x3dc3c7,!![]);}catch(_0x4908ee){return BPromise[_0x7b27('0x30')](_0x4908ee);}return _0x1f1f56[_0x7b27('0x31')]();};}function saveUpdates(_0x301d6e,_0x484d65){return function(_0x407261){if(_0x407261){return _0x407261[_0x7b27('0x32')](_0x301d6e)['then'](function(_0x55ff28){return _0x55ff28;});}return null;};}function removeEntity(_0x5bbd60,_0x415b23){return function(_0x441d3b){if(_0x441d3b){return _0x441d3b[_0x7b27('0x33')]()['then'](function(){_0x5bbd60[_0x7b27('0x28')](0xcc)[_0x7b27('0x29')]();});}};}function handleEntityNotFound(_0x214933,_0x111354){return function(_0x1387df){if(!_0x1387df){_0x214933[_0x7b27('0x27')](0x194);}return _0x1387df;};}function handleError(_0x4e8091,_0x2fd675){_0x2fd675=_0x2fd675||0x1f4;return function(_0x1e0d8e){logger[_0x7b27('0x23')](_0x1e0d8e['stack']);if(_0x1e0d8e[_0x7b27('0x34')]){delete _0x1e0d8e[_0x7b27('0x34')];}_0x4e8091[_0x7b27('0x28')](_0x2fd675)[_0x7b27('0x35')](_0x1e0d8e);};}exports[_0x7b27('0x36')]=function(_0x52a140,_0x231c81){var _0x1be013={},_0x11b4ec={},_0xe6ccab={'count':0x0,'rows':[]};var _0x56461a=_[_0x7b27('0x37')](db[_0x7b27('0x38')]['rawAttributes'],function(_0x27a375){return{'name':_0x27a375[_0x7b27('0x39')],'type':_0x27a375[_0x7b27('0x3a')]['key']};});_0x11b4ec[_0x7b27('0x3b')]=_[_0x7b27('0x37')](_0x56461a,'name');_0x11b4ec[_0x7b27('0x3c')]=_[_0x7b27('0x3d')](_0x52a140[_0x7b27('0x3c')]);_0x11b4ec[_0x7b27('0x3e')]=_['intersection'](_0x11b4ec[_0x7b27('0x3b')],_0x11b4ec[_0x7b27('0x3c')]);_0x1be013[_0x7b27('0x3f')]=_[_0x7b27('0x40')](_0x11b4ec[_0x7b27('0x3b')],qs[_0x7b27('0x41')](_0x52a140[_0x7b27('0x3c')][_0x7b27('0x41')]));_0x1be013[_0x7b27('0x3f')]=_0x1be013['attributes']['length']?_0x1be013['attributes']:_0x11b4ec[_0x7b27('0x3b')];if(!_0x52a140[_0x7b27('0x3c')][_0x7b27('0x42')](_0x7b27('0x43'))){_0x1be013[_0x7b27('0x44')]=qs[_0x7b27('0x44')](_0x52a140[_0x7b27('0x3c')][_0x7b27('0x44')]);_0x1be013[_0x7b27('0x2c')]=qs[_0x7b27('0x2c')](_0x52a140[_0x7b27('0x3c')][_0x7b27('0x2c')]);}_0x1be013['order']=qs[_0x7b27('0x45')](_0x52a140[_0x7b27('0x3c')][_0x7b27('0x45')]);_0x1be013[_0x7b27('0x46')]=qs[_0x7b27('0x3e')](_[_0x7b27('0x47')](_0x52a140['query'],_0x11b4ec[_0x7b27('0x3e')]),_0x56461a);if(_0x52a140[_0x7b27('0x3c')][_0x7b27('0x48')]){_0x1be013[_0x7b27('0x46')]=_[_0x7b27('0x49')](_0x1be013[_0x7b27('0x46')],{'$or':_[_0x7b27('0x37')](_0x56461a,function(_0x10f760){if(_0x10f760['type']!==_0x7b27('0x4a')){var _0x4c6fb5={};_0x4c6fb5[_0x10f760[_0x7b27('0x34')]]={'$like':'%'+_0x52a140['query'][_0x7b27('0x48')]+'%'};return _0x4c6fb5;}})});}_0x1be013=_[_0x7b27('0x49')]({},_0x1be013,_0x52a140[_0x7b27('0x4b')]);var _0x2b96ce={'where':_0x1be013['where']};return db[_0x7b27('0x38')][_0x7b27('0x2b')](_0x2b96ce)[_0x7b27('0x4c')](function(_0x31be47){_0xe6ccab[_0x7b27('0x2b')]=_0x31be47;if(_0x52a140['query'][_0x7b27('0x4d')]){_0x1be013[_0x7b27('0x4e')]=[{'all':!![]}];}return db[_0x7b27('0x38')][_0x7b27('0x4f')](_0x1be013);})[_0x7b27('0x4c')](function(_0x20f8ff){_0xe6ccab['rows']=_0x20f8ff;return _0xe6ccab;})['then'](respondWithFilteredResult(_0x231c81,_0x1be013))[_0x7b27('0x50')](handleError(_0x231c81,null));};exports[_0x7b27('0x51')]=function(_0x496df2,_0x112e58){var _0x574ee4={'raw':![],'where':{'id':_0x496df2[_0x7b27('0x52')]['id']}},_0x4cc845={};_0x4cc845['model']=_[_0x7b27('0x3d')](db[_0x7b27('0x38')]['rawAttributes']);_0x4cc845['query']=_[_0x7b27('0x3d')](_0x496df2['query']);_0x4cc845[_0x7b27('0x3e')]=_[_0x7b27('0x40')](_0x4cc845[_0x7b27('0x3b')],_0x4cc845[_0x7b27('0x3c')]);_0x574ee4[_0x7b27('0x3f')]=_[_0x7b27('0x40')](_0x4cc845[_0x7b27('0x3b')],qs[_0x7b27('0x41')](_0x496df2['query'][_0x7b27('0x41')]));_0x574ee4['attributes']=_0x574ee4[_0x7b27('0x3f')][_0x7b27('0x53')]?_0x574ee4[_0x7b27('0x3f')]:_0x4cc845[_0x7b27('0x3b')];if(_0x496df2[_0x7b27('0x3c')][_0x7b27('0x4d')]){_0x574ee4[_0x7b27('0x4e')]=[{'all':!![]}];}_0x574ee4=_[_0x7b27('0x49')]({},_0x574ee4,_0x496df2[_0x7b27('0x4b')]);return db[_0x7b27('0x38')][_0x7b27('0x54')](_0x574ee4)[_0x7b27('0x4c')](handleEntityNotFound(_0x112e58,null))[_0x7b27('0x4c')](respondWithResult(_0x112e58,null))[_0x7b27('0x50')](handleError(_0x112e58,null));};exports['create']=function(_0x2f9fd2,_0x27c55f){return db[_0x7b27('0x38')][_0x7b27('0x55')](_0x2f9fd2[_0x7b27('0x56')],{})['then'](respondWithResult(_0x27c55f,0xc9))[_0x7b27('0x50')](handleError(_0x27c55f,null));};exports[_0x7b27('0x32')]=function(_0x188f8a,_0x2a7a37){if(_0x188f8a[_0x7b27('0x56')]['id']){delete _0x188f8a[_0x7b27('0x56')]['id'];}return db[_0x7b27('0x38')][_0x7b27('0x54')]({'where':{'id':_0x188f8a[_0x7b27('0x52')]['id']}})[_0x7b27('0x4c')](handleEntityNotFound(_0x2a7a37,null))[_0x7b27('0x4c')](saveUpdates(_0x188f8a[_0x7b27('0x56')],null))[_0x7b27('0x4c')](respondWithResult(_0x2a7a37,null))['catch'](handleError(_0x2a7a37,null));};exports[_0x7b27('0x33')]=function(_0x2f821a,_0x3d1f8b){return db[_0x7b27('0x38')][_0x7b27('0x54')]({'where':{'id':_0x2f821a[_0x7b27('0x52')]['id']}})[_0x7b27('0x4c')](handleEntityNotFound(_0x3d1f8b,null))[_0x7b27('0x4c')](removeEntity(_0x3d1f8b,null))[_0x7b27('0x50')](handleError(_0x3d1f8b,null));};exports[_0x7b27('0x57')]=function(_0x25084e,_0x195676,_0x67bb1b){var _0x539cf0={};var _0x2fa897={};var _0x445862;var _0x5b4a0b;return db[_0x7b27('0x38')]['findOne']({'where':{'id':_0x25084e['params']['id']}})['then'](handleEntityNotFound(_0x195676,null))[_0x7b27('0x4c')](function(_0x46a60a){if(_0x46a60a){_0x445862=_0x46a60a;_0x2fa897['model']=_[_0x7b27('0x3d')](db[_0x7b27('0x58')][_0x7b27('0x59')]);_0x2fa897['query']=_['keys'](_0x25084e[_0x7b27('0x3c')]);_0x2fa897[_0x7b27('0x3e')]=_[_0x7b27('0x40')](_0x2fa897[_0x7b27('0x3b')],_0x2fa897[_0x7b27('0x3c')]);_0x539cf0['attributes']=_[_0x7b27('0x40')](_0x2fa897['model'],qs[_0x7b27('0x41')](_0x25084e['query'][_0x7b27('0x41')]));_0x539cf0['attributes']=_0x539cf0[_0x7b27('0x3f')][_0x7b27('0x53')]?_0x539cf0[_0x7b27('0x3f')]:_0x2fa897[_0x7b27('0x3b')];_0x539cf0[_0x7b27('0x5a')]=qs['sort'](_0x25084e[_0x7b27('0x3c')][_0x7b27('0x45')]);_0x539cf0['where']=qs[_0x7b27('0x3e')](_[_0x7b27('0x47')](_0x25084e[_0x7b27('0x3c')],_0x2fa897['filters']));if(_0x25084e['query'][_0x7b27('0x48')]){_0x539cf0['where']=_['merge'](_0x539cf0[_0x7b27('0x46')],{'$or':_[_0x7b27('0x37')](_0x539cf0[_0x7b27('0x3f')],function(_0x17b16c){var _0x247d51={};_0x247d51[_0x17b16c]={'$like':'%'+_0x25084e[_0x7b27('0x3c')][_0x7b27('0x48')]+'%'};return _0x247d51;})});}_0x539cf0=_[_0x7b27('0x49')]({},_0x539cf0,_0x25084e[_0x7b27('0x4b')]);return _0x445862['getFields'](_0x539cf0);}})['then'](function(_0x51d012){if(_0x51d012){_0x5b4a0b=_0x51d012[_0x7b27('0x53')];if(!_0x25084e[_0x7b27('0x3c')]['hasOwnProperty']('nolimit')){_0x539cf0[_0x7b27('0x44')]=qs[_0x7b27('0x44')](_0x25084e[_0x7b27('0x3c')]['limit']);_0x539cf0[_0x7b27('0x2c')]=qs[_0x7b27('0x2c')](_0x25084e['query'][_0x7b27('0x2c')]);}return _0x445862['getFields'](_0x539cf0);}})[_0x7b27('0x4c')](function(_0x2e0e6e){if(_0x2e0e6e){return _0x2e0e6e?{'count':_0x5b4a0b,'rows':_0x2e0e6e}:null;}})[_0x7b27('0x4c')](respondWithResult(_0x195676,null))[_0x7b27('0x50')](handleError(_0x195676,null));};exports[_0x7b27('0x5b')]=function(_0x5d1be5,_0x49ea14,_0x4678e2){var _0x347333={};var _0x2c03b6={};var _0xe1a31;var _0x325258;return db[_0x7b27('0x38')]['findOne']({'where':{'id':_0x5d1be5[_0x7b27('0x52')]['id']}})[_0x7b27('0x4c')](handleEntityNotFound(_0x49ea14,null))[_0x7b27('0x4c')](function(_0x1b8a68){if(_0x1b8a68){_0xe1a31=_0x1b8a68;_0x2c03b6[_0x7b27('0x3b')]=_['keys'](db[_0x7b27('0x58')][_0x7b27('0x59')]);_0x2c03b6['query']=_[_0x7b27('0x3d')](_0x5d1be5[_0x7b27('0x3c')]);_0x2c03b6[_0x7b27('0x3e')]=_[_0x7b27('0x40')](_0x2c03b6[_0x7b27('0x3b')],_0x2c03b6['query']);_0x347333[_0x7b27('0x3f')]=_[_0x7b27('0x40')](_0x2c03b6[_0x7b27('0x3b')],qs['fields'](_0x5d1be5[_0x7b27('0x3c')][_0x7b27('0x41')]));_0x347333[_0x7b27('0x3f')]=_0x347333[_0x7b27('0x3f')]['length']?_0x347333[_0x7b27('0x3f')]:_0x2c03b6[_0x7b27('0x3b')];_0x347333[_0x7b27('0x5a')]=qs[_0x7b27('0x45')](_0x5d1be5[_0x7b27('0x3c')]['sort']);_0x347333[_0x7b27('0x46')]=qs[_0x7b27('0x3e')](_[_0x7b27('0x47')](_0x5d1be5[_0x7b27('0x3c')],_0x2c03b6[_0x7b27('0x3e')]));if(_0x5d1be5['query'][_0x7b27('0x48')]){_0x347333['where']=_['merge'](_0x347333[_0x7b27('0x46')],{'$or':_[_0x7b27('0x37')](_0x347333[_0x7b27('0x3f')],function(_0x424464){var _0x514321={};_0x514321[_0x424464]={'$like':'%'+_0x5d1be5[_0x7b27('0x3c')][_0x7b27('0x48')]+'%'};return _0x514321;})});}_0x347333=_[_0x7b27('0x49')]({},_0x347333,_0x5d1be5[_0x7b27('0x4b')]);return _0xe1a31['getSubjects'](_0x347333);}})['then'](function(_0x154dd8){if(_0x154dd8){_0x325258=_0x154dd8['length'];if(!_0x5d1be5[_0x7b27('0x3c')]['hasOwnProperty']('nolimit')){_0x347333[_0x7b27('0x44')]=qs[_0x7b27('0x44')](_0x5d1be5['query'][_0x7b27('0x44')]);_0x347333[_0x7b27('0x2c')]=qs[_0x7b27('0x2c')](_0x5d1be5[_0x7b27('0x3c')][_0x7b27('0x2c')]);}return _0xe1a31['getSubjects'](_0x347333);}})[_0x7b27('0x4c')](function(_0x3cc545){if(_0x3cc545){return _0x3cc545?{'count':_0x325258,'rows':_0x3cc545}:null;}})[_0x7b27('0x4c')](respondWithResult(_0x49ea14,null))[_0x7b27('0x50')](handleError(_0x49ea14,null));};exports[_0x7b27('0x5c')]=function(_0xca0abd,_0x506a43,_0x48d7b2){var _0x4978d3={};var _0x34885f={};var _0x2073b3;var _0x148629;return db[_0x7b27('0x38')][_0x7b27('0x5d')]({'where':{'id':_0xca0abd[_0x7b27('0x52')]['id']}})['then'](handleEntityNotFound(_0x506a43,null))['then'](function(_0x3e6754){if(_0x3e6754){_0x2073b3=_0x3e6754;_0x34885f['model']=_[_0x7b27('0x3d')](db[_0x7b27('0x58')]['rawAttributes']);_0x34885f[_0x7b27('0x3c')]=_['keys'](_0xca0abd[_0x7b27('0x3c')]);_0x34885f[_0x7b27('0x3e')]=_[_0x7b27('0x40')](_0x34885f['model'],_0x34885f[_0x7b27('0x3c')]);_0x4978d3['attributes']=_['intersection'](_0x34885f[_0x7b27('0x3b')],qs[_0x7b27('0x41')](_0xca0abd[_0x7b27('0x3c')][_0x7b27('0x41')]));_0x4978d3['attributes']=_0x4978d3['attributes'][_0x7b27('0x53')]?_0x4978d3['attributes']:_0x34885f['model'];_0x4978d3[_0x7b27('0x5a')]=qs[_0x7b27('0x45')](_0xca0abd[_0x7b27('0x3c')][_0x7b27('0x45')]);_0x4978d3[_0x7b27('0x46')]=qs[_0x7b27('0x3e')](_[_0x7b27('0x47')](_0xca0abd[_0x7b27('0x3c')],_0x34885f['filters']));if(_0xca0abd['query'][_0x7b27('0x48')]){_0x4978d3[_0x7b27('0x46')]=_[_0x7b27('0x49')](_0x4978d3[_0x7b27('0x46')],{'$or':_[_0x7b27('0x37')](_0x4978d3['attributes'],function(_0x5668c2){var _0x40ff7d={};_0x40ff7d[_0x5668c2]={'$like':'%'+_0xca0abd[_0x7b27('0x3c')][_0x7b27('0x48')]+'%'};return _0x40ff7d;})});}_0x4978d3=_[_0x7b27('0x49')]({},_0x4978d3,_0xca0abd[_0x7b27('0x4b')]);return _0x2073b3[_0x7b27('0x5c')](_0x4978d3);}})[_0x7b27('0x4c')](function(_0x5853a8){if(_0x5853a8){_0x148629=_0x5853a8[_0x7b27('0x53')];if(!_0xca0abd[_0x7b27('0x3c')][_0x7b27('0x42')](_0x7b27('0x43'))){_0x4978d3[_0x7b27('0x44')]=qs['limit'](_0xca0abd['query'][_0x7b27('0x44')]);_0x4978d3[_0x7b27('0x2c')]=qs[_0x7b27('0x2c')](_0xca0abd[_0x7b27('0x3c')][_0x7b27('0x2c')]);}return _0x2073b3[_0x7b27('0x5c')](_0x4978d3);}})[_0x7b27('0x4c')](function(_0x11014f){if(_0x11014f){return _0x11014f?{'count':_0x148629,'rows':_0x11014f}:null;}})[_0x7b27('0x4c')](respondWithResult(_0x506a43,null))[_0x7b27('0x50')](handleError(_0x506a43,null));};exports[_0x7b27('0x5e')]=function(_0x5628b1,_0x2026e2,_0x1ee42d){var _0x1ee570={};var _0x43b925={};var _0x46027d;var _0x16dae4;return db[_0x7b27('0x38')][_0x7b27('0x5d')]({'where':{'id':_0x5628b1['params']['id']}})['then'](handleEntityNotFound(_0x2026e2,null))[_0x7b27('0x4c')](function(_0x2675f1){if(_0x2675f1){_0x46027d=_0x2675f1;_0x43b925[_0x7b27('0x3b')]=_[_0x7b27('0x3d')](db[_0x7b27('0x5f')][_0x7b27('0x59')]);_0x43b925[_0x7b27('0x3c')]=_[_0x7b27('0x3d')](_0x5628b1[_0x7b27('0x3c')]);_0x43b925['filters']=_[_0x7b27('0x40')](_0x43b925[_0x7b27('0x3b')],_0x43b925['query']);_0x1ee570[_0x7b27('0x3f')]=_[_0x7b27('0x40')](_0x43b925[_0x7b27('0x3b')],qs[_0x7b27('0x41')](_0x5628b1[_0x7b27('0x3c')][_0x7b27('0x41')]));_0x1ee570['attributes']=_0x1ee570[_0x7b27('0x3f')]['length']?_0x1ee570[_0x7b27('0x3f')]:_0x43b925['model'];_0x1ee570[_0x7b27('0x5a')]=qs[_0x7b27('0x45')](_0x5628b1[_0x7b27('0x3c')]['sort']);_0x1ee570[_0x7b27('0x46')]=qs['filters'](_[_0x7b27('0x47')](_0x5628b1[_0x7b27('0x3c')],_0x43b925[_0x7b27('0x3e')]));if(_0x5628b1[_0x7b27('0x3c')][_0x7b27('0x48')]){_0x1ee570['where']=_[_0x7b27('0x49')](_0x1ee570[_0x7b27('0x46')],{'$or':_[_0x7b27('0x37')](_0x1ee570[_0x7b27('0x3f')],function(_0x1deb5c){var _0x1ba3f2={};_0x1ba3f2[_0x1deb5c]={'$like':'%'+_0x5628b1[_0x7b27('0x3c')][_0x7b27('0x48')]+'%'};return _0x1ba3f2;})});}_0x1ee570=_['merge']({},_0x1ee570,_0x5628b1[_0x7b27('0x4b')]);return _0x46027d[_0x7b27('0x5e')](_0x1ee570);}})[_0x7b27('0x4c')](function(_0xf8a99d){if(_0xf8a99d){_0x16dae4=_0xf8a99d['length'];if(!_0x5628b1['query']['hasOwnProperty']('nolimit')){_0x1ee570[_0x7b27('0x44')]=qs[_0x7b27('0x44')](_0x5628b1[_0x7b27('0x3c')]['limit']);_0x1ee570[_0x7b27('0x2c')]=qs['offset'](_0x5628b1[_0x7b27('0x3c')][_0x7b27('0x2c')]);}return _0x46027d['getTags'](_0x1ee570);}})[_0x7b27('0x4c')](function(_0x285e3f){if(_0x285e3f){return _0x285e3f?{'count':_0x16dae4,'rows':_0x285e3f}:null;}})[_0x7b27('0x4c')](respondWithResult(_0x2026e2,null))[_0x7b27('0x50')](handleError(_0x2026e2,null));};exports[_0x7b27('0x60')]=function(_0x7c31ce,_0x570bbf,_0x17509b){if(_0x7c31ce[_0x7b27('0x56')]['id']){delete _0x7c31ce['body']['id'];}return db[_0x7b27('0x38')][_0x7b27('0x5d')]({'where':{'id':_0x7c31ce[_0x7b27('0x52')]['id']}})[_0x7b27('0x4c')](handleEntityNotFound(_0x570bbf,null))[_0x7b27('0x4c')](function(_0x324243){if(_0x324243){return _0x324243[_0x7b27('0x60')](_0x7c31ce[_0x7b27('0x56')][_0x7b27('0x61')]||[]);}return null;})['then'](respondWithResult(_0x570bbf,null))[_0x7b27('0x50')](handleError(_0x570bbf,null));}; \ No newline at end of file +var _0x04de=['includeAll','include','rows','show','params','keys','create','body','find','DeskField','getFields','order','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','index','map','DeskConfiguration','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x04de,0x1da));var _0xe04d=function(_0x3d5c32,_0x5caba3){_0x3d5c32=_0x3d5c32-0x0;var _0x1551e2=_0x04de[_0x3d5c32];return _0x1551e2;};'use strict';var emlformat=require(_0xe04d('0x0'));var rimraf=require(_0xe04d('0x1'));var zipdir=require(_0xe04d('0x2'));var jsonpatch=require(_0xe04d('0x3'));var rp=require(_0xe04d('0x4'));var moment=require(_0xe04d('0x5'));var BPromise=require(_0xe04d('0x6'));var Mustache=require(_0xe04d('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe04d('0x8'));var csv=require(_0xe04d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe04d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe04d('0xb'));var deskjs=require(_0xe04d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe04d('0xd'));var Papa=require(_0xe04d('0xe'));var Redis=require(_0xe04d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe04d('0x10'));var as=require(_0xe04d('0x11'));var hardwareService=require(_0xe04d('0x12'));var logger=require('../../config/logger')(_0xe04d('0x13'));var utils=require(_0xe04d('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xe04d('0x15'));var client=jayson[_0xe04d('0x16')][_0xe04d('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x1aad09,_0x303b78,_0x33ca0c,_0x113993){return new BPromise(function(_0x42d19f,_0x599a9d){var _0x4c944a=_0x113993||client;return _0x4c944a[_0xe04d('0x18')](_0x1aad09,_0x33ca0c)[_0xe04d('0x19')](function(_0x485b09){logger[_0xe04d('0x1a')](_0xe04d('0x1b'),_0x303b78,_0xe04d('0x1c'));logger[_0xe04d('0x1d')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x303b78,_0xe04d('0x1c'),JSON['stringify'](_0x485b09));if(_0x485b09[_0xe04d('0x1e')]){if(_0x485b09[_0xe04d('0x1e')][_0xe04d('0x1f')]===0x1f4){logger[_0xe04d('0x1e')](_0xe04d('0x1b'),_0x303b78,_0x485b09[_0xe04d('0x1e')]['message']);return _0x599a9d(_0x485b09[_0xe04d('0x1e')][_0xe04d('0x20')]);}logger[_0xe04d('0x1e')](_0xe04d('0x1b'),_0x303b78,_0x485b09['error'][_0xe04d('0x20')]);return _0x42d19f(_0x485b09[_0xe04d('0x1e')][_0xe04d('0x20')]);}else{logger[_0xe04d('0x1a')]('DeskConfiguration,\x20%s,\x20%s',_0x303b78,_0xe04d('0x1c'));_0x42d19f(_0x485b09[_0xe04d('0x21')][_0xe04d('0x20')]);}})[_0xe04d('0x22')](function(_0x1ad253){logger[_0xe04d('0x1e')]('DeskConfiguration,\x20%s,\x20%s',_0x303b78,_0x1ad253);_0x599a9d(_0x1ad253);});});}function respondWithStatusCode(_0x551c4a,_0x4a994e){_0x4a994e=_0x4a994e||0xcc;return function(_0x8b0893){if(_0x8b0893){return _0x551c4a[_0xe04d('0x23')](_0x4a994e);}return _0x551c4a[_0xe04d('0x24')](_0x4a994e)[_0xe04d('0x25')]();};}function respondWithResult(_0x44b5e6,_0xbe5820){_0xbe5820=_0xbe5820||0xc8;return function(_0x397aef){if(_0x397aef){return _0x44b5e6[_0xe04d('0x24')](_0xbe5820)[_0xe04d('0x26')](_0x397aef);}};}function respondWithFilteredResult(_0x150aab,_0x2fb3b8){return function(_0x4bba37){if(_0x4bba37){var _0x290e6b=_0x4bba37[_0xe04d('0x27')],_0xd52b95=_0x2fb3b8[_0xe04d('0x28')],_0x13ccda=_0x2fb3b8[_0xe04d('0x28')]+_0x2fb3b8[_0xe04d('0x29')],_0x3a536e;if(_0x13ccda>=_0x290e6b){_0x13ccda=_0x290e6b;_0x3a536e=0xc8;}else{_0x3a536e=0xce;}_0x150aab['status'](_0x3a536e);return _0x150aab[_0xe04d('0x2a')](_0xe04d('0x2b'),_0xd52b95+'-'+_0x13ccda+'/'+_0x290e6b)[_0xe04d('0x26')](_0x4bba37);}return null;};}function patchUpdates(_0x4a57de){return function(_0x21af7f){try{jsonpatch[_0xe04d('0x2c')](_0x21af7f,_0x4a57de,!![]);}catch(_0x5b9762){return BPromise[_0xe04d('0x2d')](_0x5b9762);}return _0x21af7f['save']();};}function saveUpdates(_0x3636e6,_0xc77177){return function(_0x5dfa5b){if(_0x5dfa5b){return _0x5dfa5b[_0xe04d('0x2e')](_0x3636e6)[_0xe04d('0x19')](function(_0x442b6b){return _0x442b6b;});}return null;};}function removeEntity(_0x596bf9,_0x18c7bd){return function(_0x1f0dc2){if(_0x1f0dc2){return _0x1f0dc2[_0xe04d('0x2f')]()['then'](function(){_0x596bf9[_0xe04d('0x24')](0xcc)[_0xe04d('0x25')]();});}};}function handleEntityNotFound(_0x2ac471,_0x113577){return function(_0x170bac){if(!_0x170bac){_0x2ac471[_0xe04d('0x23')](0x194);}return _0x170bac;};}function handleError(_0x552850,_0x163eb5){_0x163eb5=_0x163eb5||0x1f4;return function(_0x1e2edc){logger['error'](_0x1e2edc[_0xe04d('0x30')]);if(_0x1e2edc[_0xe04d('0x31')]){delete _0x1e2edc[_0xe04d('0x31')];}_0x552850['status'](_0x163eb5)['send'](_0x1e2edc);};}exports[_0xe04d('0x32')]=function(_0x531b6a,_0x54960d){var _0x58d359={},_0x2e7ac={},_0x1280d0={'count':0x0,'rows':[]};var _0xec0cdf=_[_0xe04d('0x33')](db[_0xe04d('0x34')][_0xe04d('0x35')],function(_0x2bbeaf){return{'name':_0x2bbeaf['fieldName'],'type':_0x2bbeaf['type'][_0xe04d('0x36')]};});_0x2e7ac[_0xe04d('0x37')]=_['map'](_0xec0cdf,'name');_0x2e7ac['query']=_['keys'](_0x531b6a[_0xe04d('0x38')]);_0x2e7ac[_0xe04d('0x39')]=_[_0xe04d('0x3a')](_0x2e7ac['model'],_0x2e7ac['query']);_0x58d359[_0xe04d('0x3b')]=_[_0xe04d('0x3a')](_0x2e7ac[_0xe04d('0x37')],qs[_0xe04d('0x3c')](_0x531b6a[_0xe04d('0x38')][_0xe04d('0x3c')]));_0x58d359[_0xe04d('0x3b')]=_0x58d359[_0xe04d('0x3b')][_0xe04d('0x3d')]?_0x58d359['attributes']:_0x2e7ac[_0xe04d('0x37')];if(!_0x531b6a[_0xe04d('0x38')][_0xe04d('0x3e')](_0xe04d('0x3f'))){_0x58d359['limit']=qs[_0xe04d('0x29')](_0x531b6a[_0xe04d('0x38')][_0xe04d('0x29')]);_0x58d359[_0xe04d('0x28')]=qs[_0xe04d('0x28')](_0x531b6a[_0xe04d('0x38')][_0xe04d('0x28')]);}_0x58d359['order']=qs[_0xe04d('0x40')](_0x531b6a['query']['sort']);_0x58d359[_0xe04d('0x41')]=qs['filters'](_[_0xe04d('0x42')](_0x531b6a[_0xe04d('0x38')],_0x2e7ac[_0xe04d('0x39')]),_0xec0cdf);if(_0x531b6a[_0xe04d('0x38')][_0xe04d('0x43')]){_0x58d359[_0xe04d('0x41')]=_[_0xe04d('0x44')](_0x58d359[_0xe04d('0x41')],{'$or':_[_0xe04d('0x33')](_0xec0cdf,function(_0x35eea9){if(_0x35eea9[_0xe04d('0x45')]!==_0xe04d('0x46')){var _0xe61bd7={};_0xe61bd7[_0x35eea9[_0xe04d('0x31')]]={'$like':'%'+_0x531b6a['query']['filter']+'%'};return _0xe61bd7;}})});}_0x58d359=_[_0xe04d('0x44')]({},_0x58d359,_0x531b6a[_0xe04d('0x47')]);var _0xdd150c={'where':_0x58d359[_0xe04d('0x41')]};return db[_0xe04d('0x34')]['count'](_0xdd150c)['then'](function(_0xb3b4ef){_0x1280d0[_0xe04d('0x27')]=_0xb3b4ef;if(_0x531b6a[_0xe04d('0x38')][_0xe04d('0x48')]){_0x58d359[_0xe04d('0x49')]=[{'all':!![]}];}return db[_0xe04d('0x34')]['findAll'](_0x58d359);})['then'](function(_0x2346e8){_0x1280d0[_0xe04d('0x4a')]=_0x2346e8;return _0x1280d0;})[_0xe04d('0x19')](respondWithFilteredResult(_0x54960d,_0x58d359))[_0xe04d('0x22')](handleError(_0x54960d,null));};exports[_0xe04d('0x4b')]=function(_0x5c83db,_0x48d29f){var _0xa08f8b={'raw':![],'where':{'id':_0x5c83db[_0xe04d('0x4c')]['id']}},_0x42095c={};_0x42095c[_0xe04d('0x37')]=_[_0xe04d('0x4d')](db['DeskConfiguration'][_0xe04d('0x35')]);_0x42095c['query']=_[_0xe04d('0x4d')](_0x5c83db[_0xe04d('0x38')]);_0x42095c[_0xe04d('0x39')]=_[_0xe04d('0x3a')](_0x42095c[_0xe04d('0x37')],_0x42095c[_0xe04d('0x38')]);_0xa08f8b[_0xe04d('0x3b')]=_[_0xe04d('0x3a')](_0x42095c['model'],qs[_0xe04d('0x3c')](_0x5c83db[_0xe04d('0x38')][_0xe04d('0x3c')]));_0xa08f8b[_0xe04d('0x3b')]=_0xa08f8b[_0xe04d('0x3b')][_0xe04d('0x3d')]?_0xa08f8b['attributes']:_0x42095c[_0xe04d('0x37')];if(_0x5c83db[_0xe04d('0x38')][_0xe04d('0x48')]){_0xa08f8b[_0xe04d('0x49')]=[{'all':!![]}];}_0xa08f8b=_['merge']({},_0xa08f8b,_0x5c83db[_0xe04d('0x47')]);return db['DeskConfiguration']['find'](_0xa08f8b)[_0xe04d('0x19')](handleEntityNotFound(_0x48d29f,null))[_0xe04d('0x19')](respondWithResult(_0x48d29f,null))[_0xe04d('0x22')](handleError(_0x48d29f,null));};exports[_0xe04d('0x4e')]=function(_0x4eb72d,_0x53ee4a){return db['DeskConfiguration'][_0xe04d('0x4e')](_0x4eb72d[_0xe04d('0x4f')],{})[_0xe04d('0x19')](respondWithResult(_0x53ee4a,0xc9))[_0xe04d('0x22')](handleError(_0x53ee4a,null));};exports[_0xe04d('0x2e')]=function(_0x43de80,_0x12644c){if(_0x43de80[_0xe04d('0x4f')]['id']){delete _0x43de80[_0xe04d('0x4f')]['id'];}return db['DeskConfiguration'][_0xe04d('0x50')]({'where':{'id':_0x43de80['params']['id']}})[_0xe04d('0x19')](handleEntityNotFound(_0x12644c,null))[_0xe04d('0x19')](saveUpdates(_0x43de80[_0xe04d('0x4f')],null))['then'](respondWithResult(_0x12644c,null))[_0xe04d('0x22')](handleError(_0x12644c,null));};exports[_0xe04d('0x2f')]=function(_0x585a8,_0x5b159e){return db['DeskConfiguration'][_0xe04d('0x50')]({'where':{'id':_0x585a8[_0xe04d('0x4c')]['id']}})[_0xe04d('0x19')](handleEntityNotFound(_0x5b159e,null))[_0xe04d('0x19')](removeEntity(_0x5b159e,null))[_0xe04d('0x22')](handleError(_0x5b159e,null));};exports['getFields']=function(_0x3005e5,_0x122524,_0x5beaa2){var _0x37aa39={};var _0x2d8b96={};var _0x1a6caf;var _0x46a55c;return db[_0xe04d('0x34')]['findOne']({'where':{'id':_0x3005e5['params']['id']}})[_0xe04d('0x19')](handleEntityNotFound(_0x122524,null))[_0xe04d('0x19')](function(_0x19656f){if(_0x19656f){_0x1a6caf=_0x19656f;_0x2d8b96[_0xe04d('0x37')]=_[_0xe04d('0x4d')](db[_0xe04d('0x51')][_0xe04d('0x35')]);_0x2d8b96[_0xe04d('0x38')]=_[_0xe04d('0x4d')](_0x3005e5['query']);_0x2d8b96[_0xe04d('0x39')]=_[_0xe04d('0x3a')](_0x2d8b96[_0xe04d('0x37')],_0x2d8b96[_0xe04d('0x38')]);_0x37aa39[_0xe04d('0x3b')]=_[_0xe04d('0x3a')](_0x2d8b96[_0xe04d('0x37')],qs[_0xe04d('0x3c')](_0x3005e5['query'][_0xe04d('0x3c')]));_0x37aa39['attributes']=_0x37aa39[_0xe04d('0x3b')]['length']?_0x37aa39[_0xe04d('0x3b')]:_0x2d8b96[_0xe04d('0x37')];_0x37aa39['order']=qs[_0xe04d('0x40')](_0x3005e5['query'][_0xe04d('0x40')]);_0x37aa39[_0xe04d('0x41')]=qs[_0xe04d('0x39')](_[_0xe04d('0x42')](_0x3005e5[_0xe04d('0x38')],_0x2d8b96['filters']));if(_0x3005e5[_0xe04d('0x38')][_0xe04d('0x43')]){_0x37aa39[_0xe04d('0x41')]=_[_0xe04d('0x44')](_0x37aa39[_0xe04d('0x41')],{'$or':_[_0xe04d('0x33')](_0x37aa39['attributes'],function(_0x4c9ec8){var _0x401702={};_0x401702[_0x4c9ec8]={'$like':'%'+_0x3005e5[_0xe04d('0x38')][_0xe04d('0x43')]+'%'};return _0x401702;})});}_0x37aa39=_[_0xe04d('0x44')]({},_0x37aa39,_0x3005e5['options']);return _0x1a6caf[_0xe04d('0x52')](_0x37aa39);}})[_0xe04d('0x19')](function(_0x11f354){if(_0x11f354){_0x46a55c=_0x11f354[_0xe04d('0x3d')];if(!_0x3005e5['query'][_0xe04d('0x3e')](_0xe04d('0x3f'))){_0x37aa39['limit']=qs[_0xe04d('0x29')](_0x3005e5[_0xe04d('0x38')][_0xe04d('0x29')]);_0x37aa39[_0xe04d('0x28')]=qs[_0xe04d('0x28')](_0x3005e5[_0xe04d('0x38')]['offset']);}return _0x1a6caf[_0xe04d('0x52')](_0x37aa39);}})[_0xe04d('0x19')](function(_0x60689b){if(_0x60689b){return _0x60689b?{'count':_0x46a55c,'rows':_0x60689b}:null;}})[_0xe04d('0x19')](respondWithResult(_0x122524,null))[_0xe04d('0x22')](handleError(_0x122524,null));};exports['getSubjects']=function(_0x79a172,_0x5c45ce,_0x509767){var _0x2402dd={};var _0x4004e4={};var _0x228699;var _0x4e0880;return db['DeskConfiguration']['findOne']({'where':{'id':_0x79a172['params']['id']}})[_0xe04d('0x19')](handleEntityNotFound(_0x5c45ce,null))['then'](function(_0x3124bd){if(_0x3124bd){_0x228699=_0x3124bd;_0x4004e4[_0xe04d('0x37')]=_['keys'](db[_0xe04d('0x51')]['rawAttributes']);_0x4004e4[_0xe04d('0x38')]=_['keys'](_0x79a172[_0xe04d('0x38')]);_0x4004e4['filters']=_[_0xe04d('0x3a')](_0x4004e4[_0xe04d('0x37')],_0x4004e4[_0xe04d('0x38')]);_0x2402dd['attributes']=_['intersection'](_0x4004e4[_0xe04d('0x37')],qs[_0xe04d('0x3c')](_0x79a172[_0xe04d('0x38')][_0xe04d('0x3c')]));_0x2402dd[_0xe04d('0x3b')]=_0x2402dd[_0xe04d('0x3b')][_0xe04d('0x3d')]?_0x2402dd[_0xe04d('0x3b')]:_0x4004e4[_0xe04d('0x37')];_0x2402dd[_0xe04d('0x53')]=qs[_0xe04d('0x40')](_0x79a172[_0xe04d('0x38')][_0xe04d('0x40')]);_0x2402dd[_0xe04d('0x41')]=qs[_0xe04d('0x39')](_[_0xe04d('0x42')](_0x79a172[_0xe04d('0x38')],_0x4004e4[_0xe04d('0x39')]));if(_0x79a172[_0xe04d('0x38')][_0xe04d('0x43')]){_0x2402dd['where']=_[_0xe04d('0x44')](_0x2402dd['where'],{'$or':_[_0xe04d('0x33')](_0x2402dd[_0xe04d('0x3b')],function(_0x3b5a72){var _0x228529={};_0x228529[_0x3b5a72]={'$like':'%'+_0x79a172[_0xe04d('0x38')][_0xe04d('0x43')]+'%'};return _0x228529;})});}_0x2402dd=_['merge']({},_0x2402dd,_0x79a172[_0xe04d('0x47')]);return _0x228699[_0xe04d('0x54')](_0x2402dd);}})['then'](function(_0x4af929){if(_0x4af929){_0x4e0880=_0x4af929['length'];if(!_0x79a172[_0xe04d('0x38')][_0xe04d('0x3e')]('nolimit')){_0x2402dd[_0xe04d('0x29')]=qs[_0xe04d('0x29')](_0x79a172[_0xe04d('0x38')][_0xe04d('0x29')]);_0x2402dd[_0xe04d('0x28')]=qs[_0xe04d('0x28')](_0x79a172[_0xe04d('0x38')]['offset']);}return _0x228699[_0xe04d('0x54')](_0x2402dd);}})['then'](function(_0x3e235f){if(_0x3e235f){return _0x3e235f?{'count':_0x4e0880,'rows':_0x3e235f}:null;}})[_0xe04d('0x19')](respondWithResult(_0x5c45ce,null))['catch'](handleError(_0x5c45ce,null));};exports[_0xe04d('0x55')]=function(_0x3c28e1,_0x565301,_0x37eaea){var _0x1db0ef={};var _0x5a60ed={};var _0x87d4ae;var _0x285c38;return db[_0xe04d('0x34')][_0xe04d('0x56')]({'where':{'id':_0x3c28e1[_0xe04d('0x4c')]['id']}})[_0xe04d('0x19')](handleEntityNotFound(_0x565301,null))[_0xe04d('0x19')](function(_0x47e609){if(_0x47e609){_0x87d4ae=_0x47e609;_0x5a60ed['model']=_[_0xe04d('0x4d')](db[_0xe04d('0x51')][_0xe04d('0x35')]);_0x5a60ed[_0xe04d('0x38')]=_[_0xe04d('0x4d')](_0x3c28e1[_0xe04d('0x38')]);_0x5a60ed[_0xe04d('0x39')]=_['intersection'](_0x5a60ed['model'],_0x5a60ed[_0xe04d('0x38')]);_0x1db0ef[_0xe04d('0x3b')]=_[_0xe04d('0x3a')](_0x5a60ed[_0xe04d('0x37')],qs[_0xe04d('0x3c')](_0x3c28e1[_0xe04d('0x38')][_0xe04d('0x3c')]));_0x1db0ef['attributes']=_0x1db0ef[_0xe04d('0x3b')][_0xe04d('0x3d')]?_0x1db0ef[_0xe04d('0x3b')]:_0x5a60ed['model'];_0x1db0ef[_0xe04d('0x53')]=qs[_0xe04d('0x40')](_0x3c28e1[_0xe04d('0x38')][_0xe04d('0x40')]);_0x1db0ef[_0xe04d('0x41')]=qs['filters'](_[_0xe04d('0x42')](_0x3c28e1[_0xe04d('0x38')],_0x5a60ed['filters']));if(_0x3c28e1[_0xe04d('0x38')][_0xe04d('0x43')]){_0x1db0ef[_0xe04d('0x41')]=_[_0xe04d('0x44')](_0x1db0ef[_0xe04d('0x41')],{'$or':_[_0xe04d('0x33')](_0x1db0ef['attributes'],function(_0x162cea){var _0xca7387={};_0xca7387[_0x162cea]={'$like':'%'+_0x3c28e1[_0xe04d('0x38')][_0xe04d('0x43')]+'%'};return _0xca7387;})});}_0x1db0ef=_[_0xe04d('0x44')]({},_0x1db0ef,_0x3c28e1[_0xe04d('0x47')]);return _0x87d4ae[_0xe04d('0x55')](_0x1db0ef);}})[_0xe04d('0x19')](function(_0x5c9bca){if(_0x5c9bca){_0x285c38=_0x5c9bca['length'];if(!_0x3c28e1[_0xe04d('0x38')][_0xe04d('0x3e')]('nolimit')){_0x1db0ef[_0xe04d('0x29')]=qs[_0xe04d('0x29')](_0x3c28e1['query'][_0xe04d('0x29')]);_0x1db0ef['offset']=qs[_0xe04d('0x28')](_0x3c28e1[_0xe04d('0x38')]['offset']);}return _0x87d4ae[_0xe04d('0x55')](_0x1db0ef);}})[_0xe04d('0x19')](function(_0x126a2d){if(_0x126a2d){return _0x126a2d?{'count':_0x285c38,'rows':_0x126a2d}:null;}})[_0xe04d('0x19')](respondWithResult(_0x565301,null))['catch'](handleError(_0x565301,null));};exports[_0xe04d('0x57')]=function(_0x11a723,_0x4f2a84,_0xd914b5){var _0x16426b={};var _0x502a94={};var _0x3fbc75;var _0x170fb5;return db[_0xe04d('0x34')][_0xe04d('0x56')]({'where':{'id':_0x11a723[_0xe04d('0x4c')]['id']}})[_0xe04d('0x19')](handleEntityNotFound(_0x4f2a84,null))[_0xe04d('0x19')](function(_0x51a096){if(_0x51a096){_0x3fbc75=_0x51a096;_0x502a94[_0xe04d('0x37')]=_[_0xe04d('0x4d')](db[_0xe04d('0x58')][_0xe04d('0x35')]);_0x502a94[_0xe04d('0x38')]=_[_0xe04d('0x4d')](_0x11a723[_0xe04d('0x38')]);_0x502a94[_0xe04d('0x39')]=_['intersection'](_0x502a94[_0xe04d('0x37')],_0x502a94[_0xe04d('0x38')]);_0x16426b[_0xe04d('0x3b')]=_[_0xe04d('0x3a')](_0x502a94[_0xe04d('0x37')],qs[_0xe04d('0x3c')](_0x11a723[_0xe04d('0x38')][_0xe04d('0x3c')]));_0x16426b['attributes']=_0x16426b[_0xe04d('0x3b')][_0xe04d('0x3d')]?_0x16426b[_0xe04d('0x3b')]:_0x502a94[_0xe04d('0x37')];_0x16426b[_0xe04d('0x53')]=qs[_0xe04d('0x40')](_0x11a723['query'][_0xe04d('0x40')]);_0x16426b[_0xe04d('0x41')]=qs[_0xe04d('0x39')](_['pick'](_0x11a723['query'],_0x502a94[_0xe04d('0x39')]));if(_0x11a723[_0xe04d('0x38')][_0xe04d('0x43')]){_0x16426b[_0xe04d('0x41')]=_[_0xe04d('0x44')](_0x16426b[_0xe04d('0x41')],{'$or':_[_0xe04d('0x33')](_0x16426b[_0xe04d('0x3b')],function(_0x2ff04e){var _0x649bcc={};_0x649bcc[_0x2ff04e]={'$like':'%'+_0x11a723[_0xe04d('0x38')]['filter']+'%'};return _0x649bcc;})});}_0x16426b=_[_0xe04d('0x44')]({},_0x16426b,_0x11a723[_0xe04d('0x47')]);return _0x3fbc75['getTags'](_0x16426b);}})[_0xe04d('0x19')](function(_0x2c83d4){if(_0x2c83d4){_0x170fb5=_0x2c83d4[_0xe04d('0x3d')];if(!_0x11a723[_0xe04d('0x38')][_0xe04d('0x3e')](_0xe04d('0x3f'))){_0x16426b[_0xe04d('0x29')]=qs[_0xe04d('0x29')](_0x11a723[_0xe04d('0x38')][_0xe04d('0x29')]);_0x16426b[_0xe04d('0x28')]=qs[_0xe04d('0x28')](_0x11a723[_0xe04d('0x38')][_0xe04d('0x28')]);}return _0x3fbc75[_0xe04d('0x57')](_0x16426b);}})[_0xe04d('0x19')](function(_0x5c66b0){if(_0x5c66b0){return _0x5c66b0?{'count':_0x170fb5,'rows':_0x5c66b0}:null;}})['then'](respondWithResult(_0x4f2a84,null))['catch'](handleError(_0x4f2a84,null));};exports[_0xe04d('0x59')]=function(_0x1484eb,_0x25b153,_0x384835){if(_0x1484eb[_0xe04d('0x4f')]['id']){delete _0x1484eb['body']['id'];}return db[_0xe04d('0x34')]['findOne']({'where':{'id':_0x1484eb['params']['id']}})[_0xe04d('0x19')](handleEntityNotFound(_0x25b153,null))[_0xe04d('0x19')](function(_0x559338){if(_0x559338){return _0x559338[_0xe04d('0x59')](_0x1484eb['body'][_0xe04d('0x5a')]||[]);}return null;})[_0xe04d('0x19')](respondWithResult(_0x25b153,null))[_0xe04d('0x22')](handleError(_0x25b153,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 6b7e97c..5eab15e 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 _0x3f20=['define','DeskConfiguration','int_desk_configurations','lodash','api','bluebird','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x2724e5,_0x229d74){var _0x4b6621=function(_0x787046){while(--_0x787046){_0x2724e5['push'](_0x2724e5['shift']());}};_0x4b6621(++_0x229d74);}(_0x3f20,0x67));var _0x03f2=function(_0x4b1bb4,_0x1438dc){_0x4b1bb4=_0x4b1bb4-0x0;var _0x651b4d=_0x3f20[_0x4b1bb4];return _0x651b4d;};'use strict';var _=require(_0x03f2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x03f2('0x1'));var moment=require('moment');var BPromise=require(_0x03f2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x03f2('0x3'));var config=require(_0x03f2('0x4'));var attributes=require(_0x03f2('0x5'));module[_0x03f2('0x6')]=function(_0x518a4f,_0x3d8d18){return _0x518a4f[_0x03f2('0x7')](_0x03f2('0x8'),attributes,{'tableName':_0x03f2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60b3=['./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x44e327,_0x159ff7){var _0x2712fc=function(_0x43940c){while(--_0x43940c){_0x44e327['push'](_0x44e327['shift']());}};_0x2712fc(++_0x159ff7);}(_0x60b3,0x184));var _0x360b=function(_0x55cf7a,_0x3e6bc5){_0x55cf7a=_0x55cf7a-0x0;var _0x3b79f2=_0x60b3[_0x55cf7a];return _0x3b79f2;};'use strict';var _=require('lodash');var util=require(_0x360b('0x0'));var logger=require(_0x360b('0x1'))('api');var moment=require(_0x360b('0x2'));var BPromise=require(_0x360b('0x3'));var rp=require(_0x360b('0x4'));var fs=require('fs');var path=require(_0x360b('0x5'));var rimraf=require(_0x360b('0x6'));var config=require(_0x360b('0x7'));var attributes=require(_0x360b('0x8'));module['exports']=function(_0x5ea76e,_0x9149ad){return _0x5ea76e[_0x360b('0x9')](_0x360b('0xa'),attributes,{'tableName':_0x360b('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 35d7972..889d5d3 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 _0x0efe=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird'];(function(_0x1bcb46,_0x3123a8){var _0x12b4d6=function(_0x5030d1){while(--_0x5030d1){_0x1bcb46['push'](_0x1bcb46['shift']());}};_0x12b4d6(++_0x3123a8);}(_0x0efe,0x110));var _0xe0ef=function(_0x10383f,_0x502df9){_0x10383f=_0x10383f-0x0;var _0x2dd203=_0x0efe[_0x10383f];return _0x2dd203;};'use strict';var _=require(_0xe0ef('0x0'));var util=require(_0xe0ef('0x1'));var moment=require('moment');var BPromise=require(_0xe0ef('0x2'));var rs=require(_0xe0ef('0x3'));var fs=require('fs');var Redis=require(_0xe0ef('0x4'));var db=require(_0xe0ef('0x5'))['db'];var utils=require(_0xe0ef('0x6'));var logger=require(_0xe0ef('0x7'))(_0xe0ef('0x8'));var config=require(_0xe0ef('0x9'));var jayson=require(_0xe0ef('0xa'));var client=jayson[_0xe0ef('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49643a,_0x3a6030,_0x1a57fb){return new BPromise(function(_0x161f87,_0xa4f9be){return client[_0xe0ef('0xc')](_0x49643a,_0x1a57fb)[_0xe0ef('0xd')](function(_0x18f982){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x3a6030,_0xe0ef('0xe'));logger[_0xe0ef('0xf')](_0xe0ef('0x10'),_0x3a6030,'request\x20sent',JSON[_0xe0ef('0x11')](_0x18f982));if(_0x18f982[_0xe0ef('0x12')]){if(_0x18f982['error'][_0xe0ef('0x13')]===0x1f4){logger['error'](_0xe0ef('0x14'),_0x3a6030,_0x18f982[_0xe0ef('0x12')][_0xe0ef('0x15')]);return _0xa4f9be(_0x18f982['error']['message']);}logger[_0xe0ef('0x12')](_0xe0ef('0x14'),_0x3a6030,_0x18f982[_0xe0ef('0x12')][_0xe0ef('0x15')]);return _0x161f87(_0x18f982[_0xe0ef('0x12')][_0xe0ef('0x15')]);}else{logger[_0xe0ef('0x16')](_0xe0ef('0x14'),_0x3a6030,'request\x20sent');_0x161f87(_0x18f982[_0xe0ef('0x17')][_0xe0ef('0x15')]);}})[_0xe0ef('0x18')](function(_0xe9b6d4){logger[_0xe0ef('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x3a6030,_0xe9b6d4);_0xa4f9be(_0xe9b6d4);});});} \ No newline at end of file +var _0xf9f7=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0xe8be29,_0x33ef0c){var _0xdffcd0=function(_0xa97134){while(--_0xa97134){_0xe8be29['push'](_0xe8be29['shift']());}};_0xdffcd0(++_0x33ef0c);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x45138b,_0xec2bd6){_0x45138b=_0x45138b-0x0;var _0x398884=_0xf9f7[_0x45138b];return _0x398884;};'use strict';var _=require(_0x7f9f('0x0'));var util=require(_0x7f9f('0x1'));var moment=require(_0x7f9f('0x2'));var BPromise=require(_0x7f9f('0x3'));var rs=require(_0x7f9f('0x4'));var fs=require('fs');var Redis=require(_0x7f9f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7f9f('0x6'))(_0x7f9f('0x7'));var config=require(_0x7f9f('0x8'));var jayson=require(_0x7f9f('0x9'));var client=jayson[_0x7f9f('0xa')][_0x7f9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b5819,_0x37e39f,_0x3da87e){return new BPromise(function(_0x181328,_0x3e9e75){return client[_0x7f9f('0xc')](_0x5b5819,_0x3da87e)['then'](function(_0x3fda85){logger[_0x7f9f('0xd')](_0x7f9f('0xe'),_0x37e39f,_0x7f9f('0xf'));logger[_0x7f9f('0x10')](_0x7f9f('0x11'),_0x37e39f,_0x7f9f('0xf'),JSON['stringify'](_0x3fda85));if(_0x3fda85[_0x7f9f('0x12')]){if(_0x3fda85[_0x7f9f('0x12')]['code']===0x1f4){logger['error'](_0x7f9f('0xe'),_0x37e39f,_0x3fda85['error'][_0x7f9f('0x13')]);return _0x3e9e75(_0x3fda85[_0x7f9f('0x12')]['message']);}logger[_0x7f9f('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x37e39f,_0x3fda85[_0x7f9f('0x12')][_0x7f9f('0x13')]);return _0x181328(_0x3fda85[_0x7f9f('0x12')][_0x7f9f('0x13')]);}else{logger[_0x7f9f('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x37e39f,_0x7f9f('0xf'));_0x181328(_0x3fda85[_0x7f9f('0x14')]['message']);}})[_0x7f9f('0x15')](function(_0x4a36c8){logger[_0x7f9f('0x12')](_0x7f9f('0xe'),_0x37e39f,_0x4a36c8);_0x3e9e75(_0x4a36c8);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 6cc85c0..ce9f9d6 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 _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x7a54,0x106));var _0x47a5=function(_0x349370,_0x49d604){_0x349370=_0x349370-0x0;var _0x577af5=_0x7a54[_0x349370];return _0x577af5;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x7a54,0x106));var _0x47a5=function(_0x6711dd,_0x2b0526){_0x6711dd=_0x6711dd-0x0;var _0x1e51dd=_0x7a54[_0x6711dd];return _0x1e51dd;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index a1c1266..4c96a03 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 _0xcb5d=['STRING','string','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb5d,0xdb));var _0xdcb5=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0xcb5d[_0x365be9];return _0x185c12;};'use strict';var Sequelize=require(_0xdcb5('0x0'));module[_0xdcb5('0x1')]={'type':{'type':Sequelize[_0xdcb5('0x2')]('string',_0xdcb5('0x3'),_0xdcb5('0x4'),_0xdcb5('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xdcb5('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdcb5('0x2')](_0xdcb5('0x7'),_0xdcb5('0x3'),_0xdcb5('0x4'))},'keyContent':{'type':Sequelize[_0xdcb5('0x6')]},'idField':{'type':Sequelize[_0xdcb5('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xdcb5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7006=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1105a5,_0x36da99){var _0xa310d4=function(_0x514f70){while(--_0x514f70){_0x1105a5['push'](_0x1105a5['shift']());}};_0xa310d4(++_0x36da99);}(_0x7006,0x169));var _0x6700=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x7006[_0x2c0be1];return _0x3d4bd2;};'use strict';var Sequelize=require(_0x6700('0x0'));module['exports']={'type':{'type':Sequelize[_0x6700('0x1')](_0x6700('0x2'),_0x6700('0x3'),_0x6700('0x4'),_0x6700('0x5'),_0x6700('0x6')),'defaultValue':_0x6700('0x2')},'content':{'type':Sequelize[_0x6700('0x7')]},'key':{'type':Sequelize[_0x6700('0x7')]},'keyType':{'type':Sequelize[_0x6700('0x1')](_0x6700('0x2'),'variable',_0x6700('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6700('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6700('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 8b258fb..61c9205 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 _0xf65e=['api','../../config/environment','../../config/license/util','../../mysqldb','status','end','count','offset','limit','set','json','reject','save','destroy','then','error','name','index','map','DeskField','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','fields','include','find','create','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x34165b,_0x5d2c5f){var _0x3124a3=function(_0x40eab9){while(--_0x40eab9){_0x34165b['push'](_0x34165b['shift']());}};_0x3124a3(++_0x5d2c5f);}(_0xf65e,0x104));var _0xef65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf65e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xef65('0x0'));var rimraf=require(_0xef65('0x1'));var zipdir=require(_0xef65('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef65('0x3'));var moment=require(_0xef65('0x4'));var BPromise=require(_0xef65('0x5'));var Mustache=require(_0xef65('0x6'));var util=require('util');var path=require('path');var sox=require(_0xef65('0x7'));var csv=require(_0xef65('0x8'));var ejs=require(_0xef65('0x9'));var fs=require('fs');var fs_extra=require(_0xef65('0xa'));var _=require(_0xef65('0xb'));var squel=require(_0xef65('0xc'));var crypto=require(_0xef65('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xef65('0x8'));var querystring=require(_0xef65('0xe'));var Papa=require(_0xef65('0xf'));var Redis=require('ioredis');var authService=require(_0xef65('0x10'));var qs=require(_0xef65('0x11'));var as=require(_0xef65('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef65('0x13'))(_0xef65('0x14'));var utils=require('../../config/utils');var config=require(_0xef65('0x15'));var licenseUtil=require(_0xef65('0x16'));var db=require(_0xef65('0x17'))['db'];function respondWithStatusCode(_0x550689,_0x423a8f){_0x423a8f=_0x423a8f||0xcc;return function(_0x5c04c8){if(_0x5c04c8){return _0x550689['sendStatus'](_0x423a8f);}return _0x550689[_0xef65('0x18')](_0x423a8f)[_0xef65('0x19')]();};}function respondWithResult(_0x664e1,_0x523ae6){_0x523ae6=_0x523ae6||0xc8;return function(_0x3e2d8c){if(_0x3e2d8c){return _0x664e1['status'](_0x523ae6)['json'](_0x3e2d8c);}};}function respondWithFilteredResult(_0x321938,_0x1f0f3c){return function(_0x546964){if(_0x546964){var _0x47077d=_0x546964[_0xef65('0x1a')],_0x414405=_0x1f0f3c[_0xef65('0x1b')],_0x364ade=_0x1f0f3c[_0xef65('0x1b')]+_0x1f0f3c[_0xef65('0x1c')],_0x1c54e4;if(_0x364ade>=_0x47077d){_0x364ade=_0x47077d;_0x1c54e4=0xc8;}else{_0x1c54e4=0xce;}_0x321938[_0xef65('0x18')](_0x1c54e4);return _0x321938[_0xef65('0x1d')]('Content-Range',_0x414405+'-'+_0x364ade+'/'+_0x47077d)[_0xef65('0x1e')](_0x546964);}return null;};}function patchUpdates(_0x189ee8){return function(_0x253722){try{jsonpatch['apply'](_0x253722,_0x189ee8,!![]);}catch(_0x4c5389){return BPromise[_0xef65('0x1f')](_0x4c5389);}return _0x253722[_0xef65('0x20')]();};}function saveUpdates(_0x3ef889,_0x2087de){return function(_0x181583){if(_0x181583){return _0x181583['update'](_0x3ef889)['then'](function(_0x3d8874){return _0x3d8874;});}return null;};}function removeEntity(_0x35c4d7,_0x2ac3fe){return function(_0x3fc52e){if(_0x3fc52e){return _0x3fc52e[_0xef65('0x21')]()[_0xef65('0x22')](function(){_0x35c4d7[_0xef65('0x18')](0xcc)[_0xef65('0x19')]();});}};}function handleEntityNotFound(_0x33032d,_0x4e9701){return function(_0x22fb4f){if(!_0x22fb4f){_0x33032d['sendStatus'](0x194);}return _0x22fb4f;};}function handleError(_0x2afca7,_0xb7eca9){_0xb7eca9=_0xb7eca9||0x1f4;return function(_0x386756){logger[_0xef65('0x23')](_0x386756['stack']);if(_0x386756[_0xef65('0x24')]){delete _0x386756[_0xef65('0x24')];}_0x2afca7[_0xef65('0x18')](_0xb7eca9)['send'](_0x386756);};}exports[_0xef65('0x25')]=function(_0x47063b,_0x48fa9e){var _0x256cf9={},_0x355a41={},_0x117ccc={'count':0x0,'rows':[]};var _0x371227=_[_0xef65('0x26')](db[_0xef65('0x27')][_0xef65('0x28')],function(_0x19a81c){return{'name':_0x19a81c[_0xef65('0x29')],'type':_0x19a81c['type']['key']};});_0x355a41[_0xef65('0x2a')]=_[_0xef65('0x26')](_0x371227,_0xef65('0x24'));_0x355a41['query']=_[_0xef65('0x2b')](_0x47063b[_0xef65('0x2c')]);_0x355a41[_0xef65('0x2d')]=_[_0xef65('0x2e')](_0x355a41[_0xef65('0x2a')],_0x355a41[_0xef65('0x2c')]);_0x256cf9[_0xef65('0x2f')]=_[_0xef65('0x2e')](_0x355a41[_0xef65('0x2a')],qs['fields'](_0x47063b['query']['fields']));_0x256cf9[_0xef65('0x2f')]=_0x256cf9[_0xef65('0x2f')][_0xef65('0x30')]?_0x256cf9[_0xef65('0x2f')]:_0x355a41[_0xef65('0x2a')];if(!_0x47063b[_0xef65('0x2c')]['hasOwnProperty'](_0xef65('0x31'))){_0x256cf9[_0xef65('0x1c')]=qs[_0xef65('0x1c')](_0x47063b[_0xef65('0x2c')][_0xef65('0x1c')]);_0x256cf9[_0xef65('0x1b')]=qs[_0xef65('0x1b')](_0x47063b[_0xef65('0x2c')][_0xef65('0x1b')]);}_0x256cf9[_0xef65('0x32')]=qs[_0xef65('0x33')](_0x47063b['query'][_0xef65('0x33')]);_0x256cf9[_0xef65('0x34')]=qs[_0xef65('0x2d')](_[_0xef65('0x35')](_0x47063b[_0xef65('0x2c')],_0x355a41[_0xef65('0x2d')]),_0x371227);if(_0x47063b['query'][_0xef65('0x36')]){_0x256cf9[_0xef65('0x34')]=_[_0xef65('0x37')](_0x256cf9[_0xef65('0x34')],{'$or':_[_0xef65('0x26')](_0x371227,function(_0x2e1472){if(_0x2e1472[_0xef65('0x38')]!==_0xef65('0x39')){var _0x6c956d={};_0x6c956d[_0x2e1472['name']]={'$like':'%'+_0x47063b[_0xef65('0x2c')][_0xef65('0x36')]+'%'};return _0x6c956d;}})});}_0x256cf9=_[_0xef65('0x37')]({},_0x256cf9,_0x47063b[_0xef65('0x3a')]);var _0x52519a={'where':_0x256cf9[_0xef65('0x34')]};return db[_0xef65('0x27')]['count'](_0x52519a)[_0xef65('0x22')](function(_0x39a60b){_0x117ccc[_0xef65('0x1a')]=_0x39a60b;if(_0x47063b[_0xef65('0x2c')][_0xef65('0x3b')]){_0x256cf9['include']=[{'all':!![]}];}return db[_0xef65('0x27')]['findAll'](_0x256cf9);})[_0xef65('0x22')](function(_0x4621c0){_0x117ccc[_0xef65('0x3c')]=_0x4621c0;return _0x117ccc;})[_0xef65('0x22')](respondWithFilteredResult(_0x48fa9e,_0x256cf9))[_0xef65('0x3d')](handleError(_0x48fa9e,null));};exports[_0xef65('0x3e')]=function(_0x421466,_0x4811ff){var _0x3ffa48={'raw':!![],'where':{'id':_0x421466['params']['id']}},_0x2a7e7d={};_0x2a7e7d[_0xef65('0x2a')]=_[_0xef65('0x2b')](db[_0xef65('0x27')][_0xef65('0x28')]);_0x2a7e7d['query']=_['keys'](_0x421466[_0xef65('0x2c')]);_0x2a7e7d[_0xef65('0x2d')]=_['intersection'](_0x2a7e7d[_0xef65('0x2a')],_0x2a7e7d[_0xef65('0x2c')]);_0x3ffa48[_0xef65('0x2f')]=_[_0xef65('0x2e')](_0x2a7e7d[_0xef65('0x2a')],qs[_0xef65('0x3f')](_0x421466[_0xef65('0x2c')][_0xef65('0x3f')]));_0x3ffa48['attributes']=_0x3ffa48[_0xef65('0x2f')][_0xef65('0x30')]?_0x3ffa48[_0xef65('0x2f')]:_0x2a7e7d[_0xef65('0x2a')];if(_0x421466[_0xef65('0x2c')][_0xef65('0x3b')]){_0x3ffa48[_0xef65('0x40')]=[{'all':!![]}];}_0x3ffa48=_['merge']({},_0x3ffa48,_0x421466[_0xef65('0x3a')]);return db[_0xef65('0x27')][_0xef65('0x41')](_0x3ffa48)[_0xef65('0x22')](handleEntityNotFound(_0x4811ff,null))[_0xef65('0x22')](respondWithResult(_0x4811ff,null))['catch'](handleError(_0x4811ff,null));};exports[_0xef65('0x42')]=function(_0x20c4e6,_0x2a8222){return db[_0xef65('0x27')][_0xef65('0x42')](_0x20c4e6['body'],{})[_0xef65('0x22')](respondWithResult(_0x2a8222,0xc9))[_0xef65('0x3d')](handleError(_0x2a8222,null));};exports[_0xef65('0x43')]=function(_0x303037,_0x37c59f){if(_0x303037[_0xef65('0x44')]['id']){delete _0x303037[_0xef65('0x44')]['id'];}return db[_0xef65('0x27')][_0xef65('0x41')]({'where':{'id':_0x303037[_0xef65('0x45')]['id']}})[_0xef65('0x22')](handleEntityNotFound(_0x37c59f,null))[_0xef65('0x22')](saveUpdates(_0x303037[_0xef65('0x44')],null))[_0xef65('0x22')](respondWithResult(_0x37c59f,null))[_0xef65('0x3d')](handleError(_0x37c59f,null));};exports[_0xef65('0x21')]=function(_0x12817e,_0x301329){return db['DeskField']['find']({'where':{'id':_0x12817e['params']['id']}})[_0xef65('0x22')](handleEntityNotFound(_0x301329,null))[_0xef65('0x22')](removeEntity(_0x301329,null))[_0xef65('0x3d')](handleError(_0x301329,null));}; \ No newline at end of file +var _0xa337=['filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','merge','VIRTUAL','options','where','count','includeAll','findAll','rows','catch','show','params','keys','include','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','DeskField','rawAttributes','fieldName','type','key','model','map','name','query'];(function(_0xd983d3,_0x1c5b1b){var _0x488e12=function(_0x48084d){while(--_0x48084d){_0xd983d3['push'](_0xd983d3['shift']());}};_0x488e12(++_0x1c5b1b);}(_0xa337,0x13f));var _0x7a33=function(_0x39cd14,_0x420897){_0x39cd14=_0x39cd14-0x0;var _0x49b692=_0xa337[_0x39cd14];return _0x49b692;};'use strict';var emlformat=require(_0x7a33('0x0'));var rimraf=require(_0x7a33('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a33('0x2'));var rp=require(_0x7a33('0x3'));var moment=require(_0x7a33('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7a33('0x5'));var path=require(_0x7a33('0x6'));var sox=require(_0x7a33('0x7'));var csv=require(_0x7a33('0x8'));var ejs=require(_0x7a33('0x9'));var fs=require('fs');var fs_extra=require(_0x7a33('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7a33('0xb'));var toCsv=require(_0x7a33('0x8'));var querystring=require(_0x7a33('0xc'));var Papa=require(_0x7a33('0xd'));var Redis=require(_0x7a33('0xe'));var authService=require(_0x7a33('0xf'));var qs=require(_0x7a33('0x10'));var as=require(_0x7a33('0x11'));var hardwareService=require(_0x7a33('0x12'));var logger=require(_0x7a33('0x13'))('api');var utils=require(_0x7a33('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7a33('0x15'));var db=require(_0x7a33('0x16'))['db'];function respondWithStatusCode(_0x28c550,_0x3b18e9){_0x3b18e9=_0x3b18e9||0xcc;return function(_0x418bd7){if(_0x418bd7){return _0x28c550[_0x7a33('0x17')](_0x3b18e9);}return _0x28c550[_0x7a33('0x18')](_0x3b18e9)[_0x7a33('0x19')]();};}function respondWithResult(_0x6a1640,_0xd44f25){_0xd44f25=_0xd44f25||0xc8;return function(_0x22ff47){if(_0x22ff47){return _0x6a1640[_0x7a33('0x18')](_0xd44f25)[_0x7a33('0x1a')](_0x22ff47);}};}function respondWithFilteredResult(_0xfadfc1,_0x154b53){return function(_0xf0dc0a){if(_0xf0dc0a){var _0x597898=_0xf0dc0a['count'],_0x3e1458=_0x154b53[_0x7a33('0x1b')],_0x326568=_0x154b53[_0x7a33('0x1b')]+_0x154b53['limit'],_0x3131e6;if(_0x326568>=_0x597898){_0x326568=_0x597898;_0x3131e6=0xc8;}else{_0x3131e6=0xce;}_0xfadfc1[_0x7a33('0x18')](_0x3131e6);return _0xfadfc1[_0x7a33('0x1c')](_0x7a33('0x1d'),_0x3e1458+'-'+_0x326568+'/'+_0x597898)[_0x7a33('0x1a')](_0xf0dc0a);}return null;};}function patchUpdates(_0x6e1922){return function(_0x37d918){try{jsonpatch[_0x7a33('0x1e')](_0x37d918,_0x6e1922,!![]);}catch(_0x1f8e4b){return BPromise[_0x7a33('0x1f')](_0x1f8e4b);}return _0x37d918[_0x7a33('0x20')]();};}function saveUpdates(_0x1d9198,_0x9c595){return function(_0x3f6751){if(_0x3f6751){return _0x3f6751[_0x7a33('0x21')](_0x1d9198)[_0x7a33('0x22')](function(_0x12e619){return _0x12e619;});}return null;};}function removeEntity(_0x614bf8,_0xcfda43){return function(_0x53db44){if(_0x53db44){return _0x53db44[_0x7a33('0x23')]()[_0x7a33('0x22')](function(){_0x614bf8[_0x7a33('0x18')](0xcc)[_0x7a33('0x19')]();});}};}function handleEntityNotFound(_0x159a5c,_0x1fac3d){return function(_0x3f775f){if(!_0x3f775f){_0x159a5c[_0x7a33('0x17')](0x194);}return _0x3f775f;};}function handleError(_0x265e90,_0x73cadb){_0x73cadb=_0x73cadb||0x1f4;return function(_0x7638a2){logger['error'](_0x7638a2[_0x7a33('0x24')]);if(_0x7638a2['name']){delete _0x7638a2['name'];}_0x265e90[_0x7a33('0x18')](_0x73cadb)['send'](_0x7638a2);};}exports['index']=function(_0x36ad3f,_0x4c6af3){var _0x75e989={},_0x34db65={},_0xa4866e={'count':0x0,'rows':[]};var _0x55b589=_['map'](db[_0x7a33('0x25')][_0x7a33('0x26')],function(_0x5999cf){return{'name':_0x5999cf[_0x7a33('0x27')],'type':_0x5999cf[_0x7a33('0x28')][_0x7a33('0x29')]};});_0x34db65[_0x7a33('0x2a')]=_[_0x7a33('0x2b')](_0x55b589,_0x7a33('0x2c'));_0x34db65[_0x7a33('0x2d')]=_['keys'](_0x36ad3f[_0x7a33('0x2d')]);_0x34db65[_0x7a33('0x2e')]=_[_0x7a33('0x2f')](_0x34db65[_0x7a33('0x2a')],_0x34db65[_0x7a33('0x2d')]);_0x75e989[_0x7a33('0x30')]=_[_0x7a33('0x2f')](_0x34db65[_0x7a33('0x2a')],qs[_0x7a33('0x31')](_0x36ad3f['query'][_0x7a33('0x31')]));_0x75e989[_0x7a33('0x30')]=_0x75e989['attributes'][_0x7a33('0x32')]?_0x75e989[_0x7a33('0x30')]:_0x34db65['model'];if(!_0x36ad3f[_0x7a33('0x2d')][_0x7a33('0x33')]('nolimit')){_0x75e989[_0x7a33('0x34')]=qs[_0x7a33('0x34')](_0x36ad3f[_0x7a33('0x2d')]['limit']);_0x75e989[_0x7a33('0x1b')]=qs[_0x7a33('0x1b')](_0x36ad3f[_0x7a33('0x2d')][_0x7a33('0x1b')]);}_0x75e989[_0x7a33('0x35')]=qs['sort'](_0x36ad3f[_0x7a33('0x2d')][_0x7a33('0x36')]);_0x75e989['where']=qs[_0x7a33('0x2e')](_[_0x7a33('0x37')](_0x36ad3f[_0x7a33('0x2d')],_0x34db65[_0x7a33('0x2e')]),_0x55b589);if(_0x36ad3f[_0x7a33('0x2d')][_0x7a33('0x38')]){_0x75e989['where']=_[_0x7a33('0x39')](_0x75e989['where'],{'$or':_[_0x7a33('0x2b')](_0x55b589,function(_0x3a94d0){if(_0x3a94d0[_0x7a33('0x28')]!==_0x7a33('0x3a')){var _0xef147e={};_0xef147e[_0x3a94d0[_0x7a33('0x2c')]]={'$like':'%'+_0x36ad3f[_0x7a33('0x2d')][_0x7a33('0x38')]+'%'};return _0xef147e;}})});}_0x75e989=_['merge']({},_0x75e989,_0x36ad3f[_0x7a33('0x3b')]);var _0xbf2e76={'where':_0x75e989[_0x7a33('0x3c')]};return db[_0x7a33('0x25')]['count'](_0xbf2e76)[_0x7a33('0x22')](function(_0x5a9694){_0xa4866e[_0x7a33('0x3d')]=_0x5a9694;if(_0x36ad3f[_0x7a33('0x2d')][_0x7a33('0x3e')]){_0x75e989['include']=[{'all':!![]}];}return db[_0x7a33('0x25')][_0x7a33('0x3f')](_0x75e989);})['then'](function(_0x15bbe2){_0xa4866e[_0x7a33('0x40')]=_0x15bbe2;return _0xa4866e;})[_0x7a33('0x22')](respondWithFilteredResult(_0x4c6af3,_0x75e989))[_0x7a33('0x41')](handleError(_0x4c6af3,null));};exports[_0x7a33('0x42')]=function(_0x1fd407,_0x42bfe5){var _0x72db39={'raw':!![],'where':{'id':_0x1fd407[_0x7a33('0x43')]['id']}},_0x2e71f4={};_0x2e71f4[_0x7a33('0x2a')]=_[_0x7a33('0x44')](db[_0x7a33('0x25')][_0x7a33('0x26')]);_0x2e71f4[_0x7a33('0x2d')]=_[_0x7a33('0x44')](_0x1fd407[_0x7a33('0x2d')]);_0x2e71f4[_0x7a33('0x2e')]=_[_0x7a33('0x2f')](_0x2e71f4[_0x7a33('0x2a')],_0x2e71f4[_0x7a33('0x2d')]);_0x72db39[_0x7a33('0x30')]=_['intersection'](_0x2e71f4[_0x7a33('0x2a')],qs[_0x7a33('0x31')](_0x1fd407[_0x7a33('0x2d')]['fields']));_0x72db39[_0x7a33('0x30')]=_0x72db39[_0x7a33('0x30')][_0x7a33('0x32')]?_0x72db39[_0x7a33('0x30')]:_0x2e71f4['model'];if(_0x1fd407['query'][_0x7a33('0x3e')]){_0x72db39[_0x7a33('0x45')]=[{'all':!![]}];}_0x72db39=_[_0x7a33('0x39')]({},_0x72db39,_0x1fd407['options']);return db[_0x7a33('0x25')]['find'](_0x72db39)[_0x7a33('0x22')](handleEntityNotFound(_0x42bfe5,null))['then'](respondWithResult(_0x42bfe5,null))[_0x7a33('0x41')](handleError(_0x42bfe5,null));};exports[_0x7a33('0x46')]=function(_0x16c631,_0x1f905b){return db[_0x7a33('0x25')]['create'](_0x16c631[_0x7a33('0x47')],{})[_0x7a33('0x22')](respondWithResult(_0x1f905b,0xc9))[_0x7a33('0x41')](handleError(_0x1f905b,null));};exports[_0x7a33('0x21')]=function(_0x4353e4,_0x17ae3e){if(_0x4353e4[_0x7a33('0x47')]['id']){delete _0x4353e4[_0x7a33('0x47')]['id'];}return db['DeskField'][_0x7a33('0x48')]({'where':{'id':_0x4353e4['params']['id']}})[_0x7a33('0x22')](handleEntityNotFound(_0x17ae3e,null))[_0x7a33('0x22')](saveUpdates(_0x4353e4['body'],null))[_0x7a33('0x22')](respondWithResult(_0x17ae3e,null))['catch'](handleError(_0x17ae3e,null));};exports[_0x7a33('0x23')]=function(_0x4cdd43,_0x15b7e4){return db[_0x7a33('0x25')][_0x7a33('0x48')]({'where':{'id':_0x4cdd43[_0x7a33('0x43')]['id']}})['then'](handleEntityNotFound(_0x15b7e4,null))[_0x7a33('0x22')](removeEntity(_0x15b7e4,null))['catch'](handleError(_0x15b7e4,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 4e71b2e..0ea3de0 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 _0x236b=['moment','bluebird','path','rimraf','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0x51d5c1,_0x1ae343){var _0x3f3cf8=function(_0x222272){while(--_0x222272){_0x51d5c1['push'](_0x51d5c1['shift']());}};_0x3f3cf8(++_0x1ae343);}(_0x236b,0xd5));var _0xb236=function(_0x279271,_0x49bb0a){_0x279271=_0x279271-0x0;var _0x301f31=_0x236b[_0x279271];return _0x301f31;};'use strict';var _=require('lodash');var util=require(_0xb236('0x0'));var logger=require(_0xb236('0x1'))(_0xb236('0x2'));var moment=require(_0xb236('0x3'));var BPromise=require(_0xb236('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb236('0x5'));var rimraf=require(_0xb236('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module['exports']=function(_0x5525fc,_0x434e88){return _0x5525fc['define'](_0xb236('0x7'),attributes,{'tableName':_0xb236('0x8'),'paranoid':![],'indexes':[{'name':_0xb236('0x9'),'fields':[_0xb236('0xa'),_0xb236('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5bb6=['desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField'];(function(_0x363313,_0x2e0255){var _0x24403c=function(_0x157da2){while(--_0x157da2){_0x363313['push'](_0x363313['shift']());}};_0x24403c(++_0x2e0255);}(_0x5bb6,0x89));var _0x65bb=function(_0xa05f08,_0x10d686){_0xa05f08=_0xa05f08-0x0;var _0x348d9f=_0x5bb6[_0xa05f08];return _0x348d9f;};'use strict';var _=require(_0x65bb('0x0'));var util=require(_0x65bb('0x1'));var logger=require(_0x65bb('0x2'))(_0x65bb('0x3'));var moment=require(_0x65bb('0x4'));var BPromise=require(_0x65bb('0x5'));var rp=require(_0x65bb('0x6'));var fs=require('fs');var path=require(_0x65bb('0x7'));var rimraf=require(_0x65bb('0x8'));var config=require(_0x65bb('0x9'));var attributes=require(_0x65bb('0xa'));module['exports']=function(_0x26e10e,_0x433179){return _0x26e10e[_0x65bb('0xb')](_0x65bb('0xc'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x65bb('0xd'),'fields':['idField',_0x65bb('0xe')],'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 152d61e..94d7fb6 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 _0x0079=['DeskField,\x20%s,\x20%s,\x20%s','error','message','result','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x588e84,_0x16896e){var _0x2178d9=function(_0x125b4a){while(--_0x125b4a){_0x588e84['push'](_0x588e84['shift']());}};_0x2178d9(++_0x16896e);}(_0x0079,0x17a));var _0x9007=function(_0x5cb5f9,_0x24879a){_0x5cb5f9=_0x5cb5f9-0x0;var _0x3dc30a=_0x0079[_0x5cb5f9];return _0x3dc30a;};'use strict';var _=require('lodash');var util=require(_0x9007('0x0'));var moment=require('moment');var BPromise=require(_0x9007('0x1'));var rs=require(_0x9007('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9007('0x3'));var logger=require(_0x9007('0x4'))('rpc');var config=require(_0x9007('0x5'));var jayson=require(_0x9007('0x6'));var client=jayson['client'][_0x9007('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x499cdf,_0x5e3340,_0x4151d8){return new BPromise(function(_0x193e84,_0x339ab3){return client[_0x9007('0x8')](_0x499cdf,_0x4151d8)['then'](function(_0xd5a332){logger[_0x9007('0x9')](_0x9007('0xa'),_0x5e3340,_0x9007('0xb'));logger[_0x9007('0xc')](_0x9007('0xd'),_0x5e3340,_0x9007('0xb'),JSON['stringify'](_0xd5a332));if(_0xd5a332[_0x9007('0xe')]){if(_0xd5a332[_0x9007('0xe')]['code']===0x1f4){logger[_0x9007('0xe')](_0x9007('0xa'),_0x5e3340,_0xd5a332[_0x9007('0xe')][_0x9007('0xf')]);return _0x339ab3(_0xd5a332[_0x9007('0xe')][_0x9007('0xf')]);}logger[_0x9007('0xe')](_0x9007('0xa'),_0x5e3340,_0xd5a332[_0x9007('0xe')]['message']);return _0x193e84(_0xd5a332[_0x9007('0xe')]['message']);}else{logger['info'](_0x9007('0xa'),_0x5e3340,_0x9007('0xb'));_0x193e84(_0xd5a332[_0x9007('0x10')][_0x9007('0xf')]);}})['catch'](function(_0x446e3b){logger['error']('DeskField,\x20%s,\x20%s',_0x5e3340,_0x446e3b);_0x339ab3(_0x446e3b);});});} \ No newline at end of file +var _0x7096=['http','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client'];(function(_0x2df1f2,_0x58d388){var _0x38652b=function(_0x18e322){while(--_0x18e322){_0x2df1f2['push'](_0x2df1f2['shift']());}};_0x38652b(++_0x58d388);}(_0x7096,0xa0));var _0x6709=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x7096[_0x1e7b16];return _0x37fadc;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require(_0x6709('0x1'));var BPromise=require(_0x6709('0x2'));var rs=require(_0x6709('0x3'));var fs=require('fs');var Redis=require(_0x6709('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6709('0x5'));var logger=require(_0x6709('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6709('0x7')][_0x6709('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x390473,_0x3421b3,_0x1f50af){return new BPromise(function(_0x2acf56,_0x199362){return client['request'](_0x390473,_0x1f50af)[_0x6709('0x9')](function(_0x3c1911){logger[_0x6709('0xa')]('DeskField,\x20%s,\x20%s',_0x3421b3,_0x6709('0xb'));logger[_0x6709('0xc')](_0x6709('0xd'),_0x3421b3,_0x6709('0xb'),JSON[_0x6709('0xe')](_0x3c1911));if(_0x3c1911[_0x6709('0xf')]){if(_0x3c1911[_0x6709('0xf')][_0x6709('0x10')]===0x1f4){logger[_0x6709('0xf')](_0x6709('0x11'),_0x3421b3,_0x3c1911[_0x6709('0xf')][_0x6709('0x12')]);return _0x199362(_0x3c1911[_0x6709('0xf')][_0x6709('0x12')]);}logger[_0x6709('0xf')](_0x6709('0x11'),_0x3421b3,_0x3c1911[_0x6709('0xf')][_0x6709('0x12')]);return _0x2acf56(_0x3c1911[_0x6709('0xf')][_0x6709('0x12')]);}else{logger[_0x6709('0xa')](_0x6709('0x11'),_0x3421b3,'request\x20sent');_0x2acf56(_0x3c1911[_0x6709('0x13')][_0x6709('0x12')]);}})[_0x6709('0x14')](function(_0x4c2af7){logger[_0x6709('0xf')](_0x6709('0x11'),_0x3421b3,_0x4c2af7);_0x199362(_0x4c2af7);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 1725ddc..3986af2 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 _0xefe7=['isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index'];(function(_0x5d9c37,_0x518b93){var _0x1ba9eb=function(_0xae2d11){while(--_0xae2d11){_0x5d9c37['push'](_0x5d9c37['shift']());}};_0x1ba9eb(++_0x518b93);}(_0xefe7,0xc4));var _0x7efe=function(_0x329e40,_0x5ab84a){_0x329e40=_0x329e40-0x0;var _0x2c6493=_0xefe7[_0x329e40];return _0x2c6493;};'use strict';var multer=require(_0x7efe('0x0'));var util=require(_0x7efe('0x1'));var path=require('path');var timeout=require(_0x7efe('0x2'));var express=require(_0x7efe('0x3'));var router=express[_0x7efe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7efe('0x5'));var interaction=require(_0x7efe('0x6'));var config=require(_0x7efe('0x7'));var controller=require(_0x7efe('0x8'));router[_0x7efe('0x9')]('/',auth['isAuthenticated'](),controller[_0x7efe('0xa')]);router[_0x7efe('0x9')]('/:id',auth[_0x7efe('0xb')](),controller[_0x7efe('0xc')]);router[_0x7efe('0x9')](_0x7efe('0xd'),auth[_0x7efe('0xb')](),controller[_0x7efe('0xe')]);router[_0x7efe('0x9')](_0x7efe('0xf'),auth[_0x7efe('0xb')](),controller[_0x7efe('0x10')]);router[_0x7efe('0x11')]('/',auth[_0x7efe('0xb')](),controller[_0x7efe('0x12')]);router['post'](_0x7efe('0xd'),auth[_0x7efe('0xb')](),controller['addConfiguration']);router[_0x7efe('0x13')](_0x7efe('0x14'),auth['isAuthenticated'](),controller[_0x7efe('0x15')]);router['delete'](_0x7efe('0x14'),auth[_0x7efe('0xb')](),controller['destroy']);module[_0x7efe('0x16')]=router; \ No newline at end of file +var _0x9c9e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xe43c80,_0x53e965){var _0x59a7c5=function(_0x5c162d){while(--_0x5c162d){_0xe43c80['push'](_0xe43c80['shift']());}};_0x59a7c5(++_0x53e965);}(_0x9c9e,0x1af));var _0xe9c9=function(_0x2f9b5e,_0x48e1b9){_0x2f9b5e=_0x2f9b5e-0x0;var _0xb4cdab=_0x9c9e[_0x2f9b5e];return _0xb4cdab;};'use strict';var multer=require('multer');var util=require(_0xe9c9('0x0'));var path=require(_0xe9c9('0x1'));var timeout=require(_0xe9c9('0x2'));var express=require(_0xe9c9('0x3'));var router=express[_0xe9c9('0x4')]();var fs_extra=require(_0xe9c9('0x5'));var auth=require(_0xe9c9('0x6'));var interaction=require(_0xe9c9('0x7'));var config=require(_0xe9c9('0x8'));var controller=require('./intDynamics365Account.controller');router[_0xe9c9('0x9')]('/',auth[_0xe9c9('0xa')](),controller[_0xe9c9('0xb')]);router['get']('/:id',auth[_0xe9c9('0xa')](),controller[_0xe9c9('0xc')]);router['get'](_0xe9c9('0xd'),auth[_0xe9c9('0xa')](),controller[_0xe9c9('0xe')]);router[_0xe9c9('0x9')]('/:id/fields',auth[_0xe9c9('0xa')](),controller['getFields']);router[_0xe9c9('0xf')]('/',auth[_0xe9c9('0xa')](),controller[_0xe9c9('0x10')]);router['post'](_0xe9c9('0xd'),auth[_0xe9c9('0xa')](),controller[_0xe9c9('0x11')]);router[_0xe9c9('0x12')](_0xe9c9('0x13'),auth['isAuthenticated'](),controller[_0xe9c9('0x14')]);router['delete'](_0xe9c9('0x13'),auth[_0xe9c9('0xa')](),controller[_0xe9c9('0x15')]);module[_0xe9c9('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 53729a4..33199cd 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 _0x6ccd=['exports','STRING','sequelize'];(function(_0xce7f62,_0x55acdf){var _0x35a598=function(_0x445b15){while(--_0x445b15){_0xce7f62['push'](_0xce7f62['shift']());}};_0x35a598(++_0x55acdf);}(_0x6ccd,0x1e8));var _0xd6cc=function(_0x11145b,_0x3ef975){_0x11145b=_0x11145b-0x0;var _0x18c591=_0x6ccd[_0x11145b];return _0x18c591;};'use strict';var Sequelize=require(_0xd6cc('0x0'));module[_0xd6cc('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd6cc('0x2')]},'password':{'type':Sequelize[_0xd6cc('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xd6cc('0x2')]},'clientId':{'type':Sequelize[_0xd6cc('0x2')]},'clientSecret':{'type':Sequelize[_0xd6cc('0x2')]},'serverUrl':{'type':Sequelize[_0xd6cc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd6cc('0x2')]}}; \ No newline at end of file +var _0xfb6e=['STRING','exports'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0xfb6e,0x1df));var _0xefb6=function(_0x1fbc79,_0x28b174){_0x1fbc79=_0x1fbc79-0x0;var _0xe701c6=_0xfb6e[_0x1fbc79];return _0xe701c6;};'use strict';var Sequelize=require('sequelize');module[_0xefb6('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xefb6('0x1')]},'password':{'type':Sequelize[_0xefb6('0x1')]},'remoteUri':{'type':Sequelize[_0xefb6('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xefb6('0x1')]},'clientSecret':{'type':Sequelize[_0xefb6('0x1')]},'serverUrl':{'type':Sequelize[_0xefb6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xefb6('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 685214e..e55662f 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 _0xe53a=['responseby','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','@odata.type','push','all','forEach','isNil','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','send','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','count','offset','limit','set','json','reject','save','update','destroy','stack','name','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','options','include','findAll','rows','catch','params','includeAll','find','create','body','getConfigurations','findOne','Dynamics365Configuration','sort','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonecall_activity_parties','accountidname','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','emailaddress','entitlementidname','exchangerate','firstresponsebykpiidname','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname'];(function(_0x39028e,_0x2610f2){var _0x1c353d=function(_0x4bd7e8){while(--_0x4bd7e8){_0x39028e['push'](_0x39028e['shift']());}};_0x1c353d(++_0x2610f2);}(_0xe53a,0x1e1));var _0xae53=function(_0x221f8b,_0x750c0b){_0x221f8b=_0x221f8b-0x0;var _0x468973=_0xe53a[_0x221f8b];return _0x468973;};'use strict';var emlformat=require(_0xae53('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xae53('0x1'));var rp=require(_0xae53('0x2'));var moment=require(_0xae53('0x3'));var BPromise=require(_0xae53('0x4'));var Mustache=require(_0xae53('0x5'));var util=require(_0xae53('0x6'));var path=require(_0xae53('0x7'));var sox=require('sox');var csv=require(_0xae53('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae53('0x9'));var squel=require(_0xae53('0xa'));var crypto=require(_0xae53('0xb'));var jsforce=require(_0xae53('0xc'));var deskjs=require(_0xae53('0xd'));var toCsv=require(_0xae53('0x8'));var querystring=require(_0xae53('0xe'));var Papa=require('papaparse');var Redis=require(_0xae53('0xf'));var authService=require(_0xae53('0x10'));var qs=require(_0xae53('0x11'));var as=require(_0xae53('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae53('0x13'))(_0xae53('0x14'));var utils=require(_0xae53('0x15'));var config=require(_0xae53('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xae53('0x17'));var client=jayson['client'][_0xae53('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1c1036,_0xfca5dc,_0x3ef8a0,_0xd7f660){return new BPromise(function(_0x128e51,_0x1798ba){var _0x3a541e=_0xd7f660||client;return _0x3a541e[_0xae53('0x19')](_0x1c1036,_0x3ef8a0)[_0xae53('0x1a')](function(_0x519268){logger[_0xae53('0x1b')](_0xae53('0x1c'),_0xfca5dc,_0xae53('0x1d'));logger[_0xae53('0x1e')](_0xae53('0x1f'),_0xfca5dc,_0xae53('0x1d'),JSON[_0xae53('0x20')](_0x519268));if(_0x519268['error']){if(_0x519268[_0xae53('0x21')]['code']===0x1f4){logger['error'](_0xae53('0x1c'),_0xfca5dc,_0x519268[_0xae53('0x21')]['message']);return _0x1798ba(_0x519268[_0xae53('0x21')][_0xae53('0x22')]);}logger[_0xae53('0x21')]('Dynamics365Account,\x20%s,\x20%s',_0xfca5dc,_0x519268[_0xae53('0x21')]['message']);return _0x128e51(_0x519268[_0xae53('0x21')][_0xae53('0x22')]);}else{logger[_0xae53('0x1b')](_0xae53('0x1c'),_0xfca5dc,_0xae53('0x1d'));_0x128e51(_0x519268[_0xae53('0x23')][_0xae53('0x22')]);}})['catch'](function(_0x4f9c76){logger['error'](_0xae53('0x1c'),_0xfca5dc,_0x4f9c76);_0x1798ba(_0x4f9c76);});});}function respondWithStatusCode(_0x5d9610,_0xb1ca7d){_0xb1ca7d=_0xb1ca7d||0xcc;return function(_0x235790){if(_0x235790){return _0x5d9610['sendStatus'](_0xb1ca7d);}return _0x5d9610[_0xae53('0x24')](_0xb1ca7d)[_0xae53('0x25')]();};}function respondWithResult(_0x7f3029,_0x39b9f9){_0x39b9f9=_0x39b9f9||0xc8;return function(_0x1de7b0){if(_0x1de7b0){return _0x7f3029[_0xae53('0x24')](_0x39b9f9)['json'](_0x1de7b0);}};}function respondWithFilteredResult(_0x4ba788,_0x2b0162){return function(_0x1bfde7){if(_0x1bfde7){var _0x5be673=_0x1bfde7[_0xae53('0x26')],_0x1c0a97=_0x2b0162[_0xae53('0x27')],_0x3dca5c=_0x2b0162[_0xae53('0x27')]+_0x2b0162[_0xae53('0x28')],_0xd0b508;if(_0x3dca5c>=_0x5be673){_0x3dca5c=_0x5be673;_0xd0b508=0xc8;}else{_0xd0b508=0xce;}_0x4ba788[_0xae53('0x24')](_0xd0b508);return _0x4ba788[_0xae53('0x29')]('Content-Range',_0x1c0a97+'-'+_0x3dca5c+'/'+_0x5be673)[_0xae53('0x2a')](_0x1bfde7);}return null;};}function patchUpdates(_0x3e64d3){return function(_0x568052){try{jsonpatch['apply'](_0x568052,_0x3e64d3,!![]);}catch(_0x3e88c4){return BPromise[_0xae53('0x2b')](_0x3e88c4);}return _0x568052[_0xae53('0x2c')]();};}function saveUpdates(_0x52c09d,_0x4cc0c9){return function(_0x3415d7){if(_0x3415d7){return _0x3415d7[_0xae53('0x2d')](_0x52c09d)['then'](function(_0x34138e){return _0x34138e;});}return null;};}function removeEntity(_0x31f386,_0x1506c0){return function(_0x1291b0){if(_0x1291b0){return _0x1291b0[_0xae53('0x2e')]()[_0xae53('0x1a')](function(){_0x31f386['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x767bda,_0x2cec95){return function(_0x57b1ff){if(!_0x57b1ff){_0x767bda['sendStatus'](0x194);}return _0x57b1ff;};}function handleError(_0x47f625,_0x393724){_0x393724=_0x393724||0x1f4;return function(_0x15bd0c){logger[_0xae53('0x21')](_0x15bd0c[_0xae53('0x2f')]);if(_0x15bd0c['name']){delete _0x15bd0c[_0xae53('0x30')];}_0x47f625[_0xae53('0x24')](_0x393724)['send'](_0x15bd0c);};}exports[_0xae53('0x31')]=function(_0x114681,_0x17109e){var _0x549a65={},_0x13e84c={},_0x1804e8={'count':0x0,'rows':[]};var _0x440643=_[_0xae53('0x32')](db[_0xae53('0x33')][_0xae53('0x34')],function(_0x53d8eb){return{'name':_0x53d8eb[_0xae53('0x35')],'type':_0x53d8eb[_0xae53('0x36')][_0xae53('0x37')]};});_0x13e84c['model']=_[_0xae53('0x32')](_0x440643,_0xae53('0x30'));_0x13e84c[_0xae53('0x38')]=_[_0xae53('0x39')](_0x114681[_0xae53('0x38')]);_0x13e84c['filters']=_[_0xae53('0x3a')](_0x13e84c[_0xae53('0x3b')],_0x13e84c[_0xae53('0x38')]);_0x549a65['attributes']=_[_0xae53('0x3a')](_0x13e84c['model'],qs[_0xae53('0x3c')](_0x114681[_0xae53('0x38')][_0xae53('0x3c')]));_0x549a65[_0xae53('0x3d')]=_0x549a65['attributes'][_0xae53('0x3e')]?_0x549a65['attributes']:_0x13e84c[_0xae53('0x3b')];if(!_0x114681['query'][_0xae53('0x3f')](_0xae53('0x40'))){_0x549a65[_0xae53('0x28')]=qs[_0xae53('0x28')](_0x114681[_0xae53('0x38')]['limit']);_0x549a65['offset']=qs[_0xae53('0x27')](_0x114681[_0xae53('0x38')][_0xae53('0x27')]);}_0x549a65[_0xae53('0x41')]=qs['sort'](_0x114681[_0xae53('0x38')]['sort']);_0x549a65[_0xae53('0x42')]=qs['filters'](_[_0xae53('0x43')](_0x114681[_0xae53('0x38')],_0x13e84c[_0xae53('0x44')]),_0x440643);if(_0x114681[_0xae53('0x38')][_0xae53('0x45')]){_0x549a65[_0xae53('0x42')]=_['merge'](_0x549a65[_0xae53('0x42')],{'$or':_[_0xae53('0x32')](_0x440643,function(_0x10de5d){if(_0x10de5d['type']!=='VIRTUAL'){var _0x557ff5={};_0x557ff5[_0x10de5d[_0xae53('0x30')]]={'$like':'%'+_0x114681[_0xae53('0x38')][_0xae53('0x45')]+'%'};return _0x557ff5;}})});}_0x549a65=_[_0xae53('0x46')]({},_0x549a65,_0x114681[_0xae53('0x47')]);var _0x1a59bd={'where':_0x549a65[_0xae53('0x42')]};return db[_0xae53('0x33')][_0xae53('0x26')](_0x1a59bd)[_0xae53('0x1a')](function(_0xb31368){_0x1804e8[_0xae53('0x26')]=_0xb31368;if(_0x114681[_0xae53('0x38')]['includeAll']){_0x549a65[_0xae53('0x48')]=[{'all':!![]}];}return db[_0xae53('0x33')][_0xae53('0x49')](_0x549a65);})[_0xae53('0x1a')](function(_0x144aa3){_0x1804e8[_0xae53('0x4a')]=_0x144aa3;return _0x1804e8;})['then'](respondWithFilteredResult(_0x17109e,_0x549a65))[_0xae53('0x4b')](handleError(_0x17109e,null));};exports['show']=function(_0x1a98bd,_0x192440){var _0x10ef53={'raw':![],'where':{'id':_0x1a98bd[_0xae53('0x4c')]['id']}},_0x3c8f0c={};_0x3c8f0c['model']=_[_0xae53('0x39')](db['Dynamics365Account'][_0xae53('0x34')]);_0x3c8f0c[_0xae53('0x38')]=_[_0xae53('0x39')](_0x1a98bd[_0xae53('0x38')]);_0x3c8f0c[_0xae53('0x44')]=_[_0xae53('0x3a')](_0x3c8f0c[_0xae53('0x3b')],_0x3c8f0c[_0xae53('0x38')]);_0x10ef53['attributes']=_[_0xae53('0x3a')](_0x3c8f0c[_0xae53('0x3b')],qs['fields'](_0x1a98bd['query'][_0xae53('0x3c')]));_0x10ef53[_0xae53('0x3d')]=_0x10ef53[_0xae53('0x3d')][_0xae53('0x3e')]?_0x10ef53[_0xae53('0x3d')]:_0x3c8f0c[_0xae53('0x3b')];if(_0x1a98bd[_0xae53('0x38')][_0xae53('0x4d')]){_0x10ef53[_0xae53('0x48')]=[{'all':!![]}];}_0x10ef53=_[_0xae53('0x46')]({},_0x10ef53,_0x1a98bd[_0xae53('0x47')]);return db['Dynamics365Account'][_0xae53('0x4e')](_0x10ef53)['then'](handleEntityNotFound(_0x192440,null))[_0xae53('0x1a')](respondWithResult(_0x192440,null))[_0xae53('0x4b')](handleError(_0x192440,null));};exports['create']=function(_0x217813,_0xa2518d){return db[_0xae53('0x33')][_0xae53('0x4f')](_0x217813[_0xae53('0x50')],{})['then'](respondWithResult(_0xa2518d,0xc9))[_0xae53('0x4b')](handleError(_0xa2518d,null));};exports[_0xae53('0x2d')]=function(_0x430a7d,_0x562572){if(_0x430a7d[_0xae53('0x50')]['id']){delete _0x430a7d[_0xae53('0x50')]['id'];}return db[_0xae53('0x33')][_0xae53('0x4e')]({'where':{'id':_0x430a7d[_0xae53('0x4c')]['id']}})[_0xae53('0x1a')](handleEntityNotFound(_0x562572,null))[_0xae53('0x1a')](saveUpdates(_0x430a7d[_0xae53('0x50')],null))[_0xae53('0x1a')](respondWithResult(_0x562572,null))['catch'](handleError(_0x562572,null));};exports[_0xae53('0x2e')]=function(_0x4945d1,_0x4328c3){return db[_0xae53('0x33')][_0xae53('0x4e')]({'where':{'id':_0x4945d1[_0xae53('0x4c')]['id']}})[_0xae53('0x1a')](handleEntityNotFound(_0x4328c3,null))[_0xae53('0x1a')](removeEntity(_0x4328c3,null))[_0xae53('0x4b')](handleError(_0x4328c3,null));};exports[_0xae53('0x51')]=function(_0x3ece84,_0x2eecc0,_0xf20d8c){var _0x3b7f05={};var _0xb586a4={};var _0x2c354d;var _0x2b700d;return db[_0xae53('0x33')][_0xae53('0x52')]({'where':{'id':_0x3ece84[_0xae53('0x4c')]['id']}})[_0xae53('0x1a')](handleEntityNotFound(_0x2eecc0,null))[_0xae53('0x1a')](function(_0x56acfe){if(_0x56acfe){_0x2c354d=_0x56acfe;_0xb586a4[_0xae53('0x3b')]=_[_0xae53('0x39')](db[_0xae53('0x53')][_0xae53('0x34')]);_0xb586a4[_0xae53('0x38')]=_['keys'](_0x3ece84[_0xae53('0x38')]);_0xb586a4[_0xae53('0x44')]=_[_0xae53('0x3a')](_0xb586a4[_0xae53('0x3b')],_0xb586a4[_0xae53('0x38')]);_0x3b7f05[_0xae53('0x3d')]=_[_0xae53('0x3a')](_0xb586a4[_0xae53('0x3b')],qs[_0xae53('0x3c')](_0x3ece84['query'][_0xae53('0x3c')]));_0x3b7f05[_0xae53('0x3d')]=_0x3b7f05[_0xae53('0x3d')][_0xae53('0x3e')]?_0x3b7f05[_0xae53('0x3d')]:_0xb586a4[_0xae53('0x3b')];_0x3b7f05[_0xae53('0x41')]=qs[_0xae53('0x54')](_0x3ece84[_0xae53('0x38')]['sort']);_0x3b7f05['where']=qs['filters'](_['pick'](_0x3ece84[_0xae53('0x38')],_0xb586a4[_0xae53('0x44')]));if(_0x3ece84[_0xae53('0x38')][_0xae53('0x45')]){_0x3b7f05[_0xae53('0x42')]=_[_0xae53('0x46')](_0x3b7f05['where'],{'$or':_[_0xae53('0x32')](_0x3b7f05[_0xae53('0x3d')],function(_0x42079d){var _0x5ee960={};_0x5ee960[_0x42079d]={'$like':'%'+_0x3ece84[_0xae53('0x38')][_0xae53('0x45')]+'%'};return _0x5ee960;})});}_0x3b7f05=_[_0xae53('0x46')]({},_0x3b7f05,_0x3ece84[_0xae53('0x47')]);return _0x2c354d[_0xae53('0x51')](_0x3b7f05);}})['then'](function(_0x5450ea){if(_0x5450ea){_0x2b700d=_0x5450ea[_0xae53('0x3e')];if(!_0x3ece84['query']['hasOwnProperty']('nolimit')){_0x3b7f05['limit']=qs[_0xae53('0x28')](_0x3ece84['query'][_0xae53('0x28')]);_0x3b7f05[_0xae53('0x27')]=qs[_0xae53('0x27')](_0x3ece84[_0xae53('0x38')][_0xae53('0x27')]);}return _0x2c354d[_0xae53('0x51')](_0x3b7f05);}})[_0xae53('0x1a')](function(_0x349c28){if(_0x349c28){return _0x349c28?{'count':_0x2b700d,'rows':_0x349c28}:null;}})['then'](respondWithResult(_0x2eecc0,null))['catch'](handleError(_0x2eecc0,null));};exports['addConfiguration']=function(_0x2679b4,_0x1ba180,_0x1e4163){if(_0x2679b4[_0xae53('0x50')]['id']){delete _0x2679b4[_0xae53('0x50')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x2679b4[_0xae53('0x4c')]['id']}})[_0xae53('0x1a')](handleEntityNotFound(_0x1ba180,null))['then'](function(_0x167d72){if(_0x167d72){_0x2679b4[_0xae53('0x50')][_0xae53('0x55')]=_0x167d72['id'];_0x2679b4[_0xae53('0x50')][_0xae53('0x56')]=integrations[_0xae53('0x57')](_0x2679b4['body'][_0xae53('0x58')],_0x2679b4[_0xae53('0x50')][_0xae53('0x36')]);_0x2679b4[_0xae53('0x50')][_0xae53('0x59')]=integrations[_0xae53('0x5a')](_0x2679b4['body'][_0xae53('0x58')],_0x2679b4[_0xae53('0x50')][_0xae53('0x36')]);return db['Dynamics365Configuration']['create'](_0x2679b4[_0xae53('0x50')],{'include':[{'model':db[_0xae53('0x5b')],'as':_0xae53('0x56')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1ba180,null))['catch'](handleError(_0x1ba180,null));};exports[_0xae53('0x5c')]=function(_0x46b8f4,_0x12fb1f,_0x1cbbe3){var _0x3fbd07=_0x46b8f4['query'][_0xae53('0x5d')];var _0x45c3e0=_0x3fbd07===_0xae53('0x5e')?_0xae53('0x5f'):_0xae53('0x60');var _0x304929='';var _0x4b26b6='';var _0x313fa1='';var _0x1f6aab='';var _0x474c07='';var _0x1dbc5f='';var _0x56f9df='';var _0x56bc5d='';var _0x3564c9=[_0xae53('0x61'),_0xae53('0x62'),_0xae53('0x63'),_0xae53('0x64'),_0xae53('0x65'),_0xae53('0x66'),'phonenumber','regardingobjectid','directioncode',_0xae53('0x67')];var _0x377468=[_0xae53('0x68'),'accountidyominame','actualserviceunits',_0xae53('0x69'),_0xae53('0x6a'),_0xae53('0x6b'),_0xae53('0x6c'),_0xae53('0x6d'),_0xae53('0x6e'),_0xae53('0x6f'),_0xae53('0x70'),_0xae53('0x71'),'createdon',_0xae53('0x72'),_0xae53('0x73'),_0xae53('0x74'),'customeridtype','customeridyominame',_0xae53('0x75'),_0xae53('0x76'),'entityimage_timestamp','entityimage_url','escalatedon',_0xae53('0x77'),_0xae53('0x78'),'followupby','importsequencenumber','influencescore',_0xae53('0x79'),_0xae53('0x7a'),'masteridname',_0xae53('0x7b'),_0xae53('0x7c'),_0xae53('0x7d'),'modifiedbyyominame','modifiedon','modifiedonbehalfbyname',_0xae53('0x7e'),_0xae53('0x7f'),'msdyn_iotalertname',_0xae53('0x80'),_0xae53('0x81'),_0xae53('0x82'),_0xae53('0x83'),_0xae53('0x84'),'owneridyominame',_0xae53('0x85'),_0xae53('0x86'),_0xae53('0x87'),_0xae53('0x88'),_0xae53('0x89'),'productserialnumber',_0xae53('0x8a'),_0xae53('0x8b'),_0xae53('0x8c'),'responsiblecontactidname','responsiblecontactidyominame',_0xae53('0x8d'),_0xae53('0x8e'),'slaname',_0xae53('0x8f'),_0xae53('0x90'),_0xae53('0x91'),'subjectidname','ticketnumber',_0xae53('0x92'),_0xae53('0x93'),_0xae53('0x94'),_0xae53('0x95'),_0xae53('0x96')];var _0x1829af=_0x3564c9[_0xae53('0x97')](_0x377468);return db[_0xae53('0x33')][_0xae53('0x52')]({'where':{'id':_0x46b8f4[_0xae53('0x4c')]['id']},'attributes':['id',_0xae53('0x98'),_0xae53('0x99'),_0xae53('0x9a'),'tenantId',_0xae53('0x9b'),_0xae53('0x9c')]})[_0xae53('0x1a')](handleEntityNotFound(_0x12fb1f,null))[_0xae53('0x1a')](function(_0x483a49){if(_0x483a49){_0x56bc5d=_0x483a49[_0xae53('0x9a')];var _0x507c2e=_0x56bc5d[_0xae53('0x9d')](-0x1);if(_0x507c2e==='/'){_0x56bc5d=_0x56bc5d[_0xae53('0x9e')](0x0,_0x56bc5d[_0xae53('0x9f')](_0x507c2e));}_0x56f9df=util[_0xae53('0xa0')]('%s/api/data/v9.0/',_0x56bc5d);var _0x29b002={'method':_0xae53('0xa1'),'uri':_0xae53('0xa2')+_0x483a49[_0xae53('0xa3')]+_0xae53('0xa4'),'form':{'client_id':_0x483a49['clientId'],'resource':_0x56bc5d,'username':_0x483a49[_0xae53('0x98')],'password':_0x483a49[_0xae53('0x99')],'grant_type':_0xae53('0x99'),'client_secret':_0x483a49[_0xae53('0x9c')]},'json':!![]};return rp(_0x29b002);}})['then'](function(_0x709348){_0x1dbc5f=_0x709348[_0xae53('0xa5')];var _0x551246={'method':_0xae53('0xa6'),'uri':encodeURI(_0x56f9df+_0xae53('0xa7')+_0x45c3e0+'\x27'),'headers':{'Authorization':_0xae53('0xa8')+_0x1dbc5f,'If-None-Match':null,'OData-Version':_0xae53('0xa9')},'json':!![]};return rp(_0x551246);})['then'](function(_0xa00d5f){var _0x5ac33f=_0xa00d5f[_0xae53('0xaa')][0x0];var _0x5386c1=_0x5ac33f[_0xae53('0xab')];var _0x5e21b8={'method':_0xae53('0xa6'),'uri':_0x56f9df+_0xae53('0xac')+_0x5386c1+_0xae53('0xad'),'headers':{'Authorization':_0xae53('0xa8')+_0x1dbc5f,'If-None-Match':null,'OData-Version':_0xae53('0xa9')},'json':!![]};return rp(_0x5e21b8);})['then'](function(_0x426f00){_0x304929=_0x426f00;_0x4b26b6=_0x304929[_0xae53('0xae')];_0x4b26b6=_[_0xae53('0xaf')](_0x4b26b6,function(_0x34ed22){return!_0x1829af['includes'](_0x34ed22['LogicalName']);});var _0x2aae10=[];var _0x2663ed=[];_0x4b26b6['forEach'](function(_0x3421df){if(_0x3421df[_0xae53('0xb0')]){var _0x20b09a=_0x3421df[_0xae53('0xb0')][_0xae53('0x9e')](_0x3421df[_0xae53('0xb0')][_0xae53('0x9f')]('.')+0x1);if(_0x20b09a==='PicklistAttributeMetadata'){_0x2aae10[_0xae53('0xb1')](getSelectList(_0x56f9df,_0x3fbd07,_0x2663ed,_0x304929[_0xae53('0xab')],_0x3421df[_0xae53('0xab')],_0x1dbc5f));}}});return Promise[_0xae53('0xb2')](_0x2aae10);})[_0xae53('0x1a')](function(_0x4ed30d){_0x313fa1=_0x4ed30d[0x0];var _0x571df4=[];var _0x30022c=[];_0x4b26b6[_0xae53('0xb3')](function(_0x35fb58){if(!_[_0xae53('0xb4')](_0x35fb58[_0xae53('0xb0')])){var _0x38eb74=_0x35fb58[_0xae53('0xb0')]['substring'](_0x35fb58[_0xae53('0xb0')][_0xae53('0x9f')]('.')+0x1);if(_0x38eb74===_0xae53('0xb5')){_0x571df4['push'](getBooleanList(_0x56f9df,_0x3fbd07,_0x30022c,_0x304929[_0xae53('0xab')],_0x35fb58['MetadataId'],_0x1dbc5f));}}});return Promise[_0xae53('0xb2')](_0x571df4);})[_0xae53('0x1a')](function(_0x7868cb){_0x1f6aab=_0x7868cb[0x0];var _0x31c8ea=[];var _0x124de1=[];_0x4b26b6[_0xae53('0xb3')](function(_0x4708c8){if(_0x4708c8[_0xae53('0xb0')]){var _0x426b4a=_0x4708c8[_0xae53('0xb0')][_0xae53('0x9e')](_0x4708c8[_0xae53('0xb0')][_0xae53('0x9f')]('.')+0x1);if(_0x426b4a===_0xae53('0xb6')||_0x426b4a==='DoubleAttributeMetadata'||_0x426b4a===_0xae53('0xb7')||_0x426b4a===_0xae53('0xb8')||_0x426b4a===_0xae53('0xb9')||_0x426b4a===_0xae53('0xba')||_0x426b4a===_0xae53('0xbb')||_0x426b4a==='EntityNameAttributeMetadata'||_0x426b4a===_0xae53('0xbc')||_0x426b4a===_0xae53('0xbd')){_0x31c8ea[_0xae53('0xb1')](getInputList(_0x56f9df,_0x3fbd07,_0x426b4a,_0x124de1,_0x304929[_0xae53('0xab')],_0x4708c8[_0xae53('0xab')],_0x1dbc5f));}}});return Promise['all'](_0x31c8ea);})[_0xae53('0x1a')](function(_0x3d33b7){_0x474c07=_0x3d33b7[0x0];var _0x3fabc9=_0x313fa1[_0xae53('0x97')](_0x1f6aab)['concat'](_0x474c07);var _0xab2576={'count':_0x3fabc9[_0xae53('0x3e')],'rows':_0x3fabc9};return _0xab2576;})[_0xae53('0x1a')](respondWithResult(_0x12fb1f,null))[_0xae53('0x4b')](function(_0x37bcce){var _0x6cb305=_0x46b8f4['query'][_0xae53('0xbe')]?0x1f4:_0x37bcce[_0xae53('0xbf')]||0x1f4;logger[_0xae53('0x21')](_0x37bcce[_0xae53('0x2f')]);delete _0x37bcce[_0xae53('0x30')];if(_0x6cb305===0x191){_0x6cb305=0x190;}_0x12fb1f[_0xae53('0x24')](_0x6cb305)[_0xae53('0xc0')](_0x46b8f4[_0xae53('0x38')]['test']?{'message':_0xae53('0xc1'),'statusCode':_0x37bcce[_0xae53('0xbf')]}:_0x37bcce);});};function getSelectList(_0x2c4a32,_0x381ae8,_0x387600,_0x1b0a25,_0x5b862a,_0x173e2c){var _0x69bd97={'method':'GET','uri':_0x2c4a32+_0xae53('0xac')+_0x1b0a25+_0xae53('0xc2')+_0x5b862a+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xae53('0xc3'),'headers':{'Authorization':_0xae53('0xa8')+_0x173e2c,'If-None-Match':null,'OData-Version':_0xae53('0xa9')},'json':!![]};return rp(_0x69bd97)['then'](function(_0x5e1f7f){var _0x11ad61=[];var _0x2d2c52=_0x5e1f7f[_0xae53('0xc4')]['Options'];_0x2d2c52['forEach'](function(_0x1b5bde){_0x11ad61['push']({'name':_0x1b5bde[_0xae53('0xc5')][_0xae53('0xc6')][_0xae53('0xc5')],'value':String(_0x1b5bde['Value'])});});var _0x4fce23={'id':_0x381ae8+'_'+_0x5e1f7f[_0xae53('0xc7')],'name':_0x5e1f7f[_0xae53('0xc8')][_0xae53('0xc6')][_0xae53('0xc5')],'custom':![],'options':_0x11ad61};_0x387600[_0xae53('0xb1')](_0x4fce23);return _0x387600;});}function getBooleanList(_0x4240b0,_0x17561a,_0x181313,_0x3678a2,_0x3d94bb,_0xfa96b2){var _0x2c6061={'method':_0xae53('0xa6'),'uri':_0x4240b0+'EntityDefinitions('+_0x3678a2+_0xae53('0xc2')+_0x3d94bb+_0xae53('0xc9'),'headers':{'Authorization':_0xae53('0xa8')+_0xfa96b2,'If-None-Match':null,'OData-Version':_0xae53('0xa9')},'json':!![]};return rp(_0x2c6061)['then'](function(_0x475405){var _0x1beffe=[];_0x1beffe['push']({'name':_0x475405[_0xae53('0xc4')][_0xae53('0xca')]['Label'][_0xae53('0xc6')][_0xae53('0xc5')],'value':_0xae53('0xcb')},{'name':_0x475405[_0xae53('0xc4')][_0xae53('0xcc')][_0xae53('0xc5')][_0xae53('0xc6')][_0xae53('0xc5')],'value':_0xae53('0xcd')});var _0x308b86={'id':_0x17561a+'_'+_0x475405['LogicalName'],'name':_0x475405['DisplayName'][_0xae53('0xc6')][_0xae53('0xc5')],'custom':![],'options':_0x1beffe};_0x181313[_0xae53('0xb1')](_0x308b86);return _0x181313;});}function getInputList(_0x168552,_0x49f144,_0x480d49,_0x1e4980,_0x30e2a5,_0x14a9f2,_0x1ebe42){var _0x1f974c={'method':'GET','uri':_0x168552+_0xae53('0xac')+_0x30e2a5+_0xae53('0xc2')+_0x14a9f2+_0xae53('0xce')+_0x480d49+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xae53('0xa8')+_0x1ebe42,'If-None-Match':null,'OData-Version':_0xae53('0xa9')},'json':!![]};return rp(_0x1f974c)['then'](function(_0x524f53){var _0x4cae21={'id':_0x49f144+'_'+_0x524f53[_0xae53('0xc7')],'name':_0x524f53[_0xae53('0xc8')]['UserLocalizedLabel']?_0x524f53['DisplayName'][_0xae53('0xc6')]['Label']:_0x524f53[_0xae53('0xc7')],'custom':![],'options':[]};_0x1e4980[_0xae53('0xb1')](_0x4cae21);return _0x1e4980;});} \ No newline at end of file +var _0x846a=['concat','password','clientSecret','remoteUri','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','BooleanAttributeMetadata','all','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','LogicalName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false','DisplayName','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Dynamics365Account','includeAll','include','findAll','show','params','create','update','body','find','getConfigurations','findOne','map','addConfiguration','AccountId','Subjects','getDescriptions','Dynamics365Configuration','Dynamics365Field','Descriptions','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','subjectidname','ticketnumber','traversedpath','versionnumber'];(function(_0x551290,_0x46417f){var _0x492792=function(_0x53a808){while(--_0x53a808){_0x551290['push'](_0x551290['shift']());}};_0x492792(++_0x46417f);}(_0x846a,0x108));var _0xa846=function(_0x588705,_0x4c18d6){_0x588705=_0x588705-0x0;var _0xb6966e=_0x846a[_0x588705];return _0xb6966e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa846('0x0'));var rp=require('request-promise');var moment=require(_0xa846('0x1'));var BPromise=require(_0xa846('0x2'));var Mustache=require(_0xa846('0x3'));var util=require(_0xa846('0x4'));var path=require(_0xa846('0x5'));var sox=require(_0xa846('0x6'));var csv=require(_0xa846('0x7'));var ejs=require(_0xa846('0x8'));var fs=require('fs');var fs_extra=require(_0xa846('0x9'));var _=require(_0xa846('0xa'));var squel=require(_0xa846('0xb'));var crypto=require(_0xa846('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa846('0xd'));var toCsv=require(_0xa846('0x7'));var querystring=require(_0xa846('0xe'));var Papa=require(_0xa846('0xf'));var Redis=require(_0xa846('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa846('0x11'));var logger=require(_0xa846('0x12'))(_0xa846('0x13'));var utils=require(_0xa846('0x14'));var config=require(_0xa846('0x15'));var licenseUtil=require(_0xa846('0x16'));var db=require(_0xa846('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xa846('0x18'));var client=jayson[_0xa846('0x19')][_0xa846('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4091cf,_0x317d5b,_0x3320a7,_0x498de9){return new BPromise(function(_0x4743e9,_0x16e73f){var _0x54de97=_0x498de9||client;return _0x54de97[_0xa846('0x1b')](_0x4091cf,_0x3320a7)[_0xa846('0x1c')](function(_0x4f1b9e){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x317d5b,_0xa846('0x1d'));logger[_0xa846('0x1e')](_0xa846('0x1f'),_0x317d5b,'request\x20sent',JSON[_0xa846('0x20')](_0x4f1b9e));if(_0x4f1b9e[_0xa846('0x21')]){if(_0x4f1b9e[_0xa846('0x21')][_0xa846('0x22')]===0x1f4){logger[_0xa846('0x21')](_0xa846('0x23'),_0x317d5b,_0x4f1b9e[_0xa846('0x21')][_0xa846('0x24')]);return _0x16e73f(_0x4f1b9e[_0xa846('0x21')]['message']);}logger['error'](_0xa846('0x23'),_0x317d5b,_0x4f1b9e[_0xa846('0x21')][_0xa846('0x24')]);return _0x4743e9(_0x4f1b9e['error'][_0xa846('0x24')]);}else{logger['info'](_0xa846('0x23'),_0x317d5b,'request\x20sent');_0x4743e9(_0x4f1b9e[_0xa846('0x25')][_0xa846('0x24')]);}})[_0xa846('0x26')](function(_0x2a16be){logger[_0xa846('0x21')](_0xa846('0x23'),_0x317d5b,_0x2a16be);_0x16e73f(_0x2a16be);});});}function respondWithStatusCode(_0x1e49c8,_0x47d816){_0x47d816=_0x47d816||0xcc;return function(_0x49589e){if(_0x49589e){return _0x1e49c8[_0xa846('0x27')](_0x47d816);}return _0x1e49c8[_0xa846('0x28')](_0x47d816)[_0xa846('0x29')]();};}function respondWithResult(_0x205134,_0xa50191){_0xa50191=_0xa50191||0xc8;return function(_0x266f0c){if(_0x266f0c){return _0x205134['status'](_0xa50191)[_0xa846('0x2a')](_0x266f0c);}};}function respondWithFilteredResult(_0x4ad53b,_0x174684){return function(_0x5e0aa6){if(_0x5e0aa6){var _0xf7e5d=_0x5e0aa6[_0xa846('0x2b')],_0x342ffb=_0x174684[_0xa846('0x2c')],_0x4536c9=_0x174684['offset']+_0x174684[_0xa846('0x2d')],_0xd6b7f6;if(_0x4536c9>=_0xf7e5d){_0x4536c9=_0xf7e5d;_0xd6b7f6=0xc8;}else{_0xd6b7f6=0xce;}_0x4ad53b[_0xa846('0x28')](_0xd6b7f6);return _0x4ad53b[_0xa846('0x2e')](_0xa846('0x2f'),_0x342ffb+'-'+_0x4536c9+'/'+_0xf7e5d)[_0xa846('0x2a')](_0x5e0aa6);}return null;};}function patchUpdates(_0x1f3ecc){return function(_0x49b0a2){try{jsonpatch[_0xa846('0x30')](_0x49b0a2,_0x1f3ecc,!![]);}catch(_0x197eef){return BPromise[_0xa846('0x31')](_0x197eef);}return _0x49b0a2[_0xa846('0x32')]();};}function saveUpdates(_0x5304c0,_0x352353){return function(_0x10de85){if(_0x10de85){return _0x10de85['update'](_0x5304c0)[_0xa846('0x1c')](function(_0x1e74d3){return _0x1e74d3;});}return null;};}function removeEntity(_0x2ec7dd,_0x211a3d){return function(_0x247a2a){if(_0x247a2a){return _0x247a2a[_0xa846('0x33')]()['then'](function(){_0x2ec7dd[_0xa846('0x28')](0xcc)[_0xa846('0x29')]();});}};}function handleEntityNotFound(_0xeba9b,_0x25b4f0){return function(_0x23e396){if(!_0x23e396){_0xeba9b[_0xa846('0x27')](0x194);}return _0x23e396;};}function handleError(_0x6556c,_0x81af18){_0x81af18=_0x81af18||0x1f4;return function(_0x531d9c){logger[_0xa846('0x21')](_0x531d9c[_0xa846('0x34')]);if(_0x531d9c[_0xa846('0x35')]){delete _0x531d9c[_0xa846('0x35')];}_0x6556c[_0xa846('0x28')](_0x81af18)[_0xa846('0x36')](_0x531d9c);};}exports['index']=function(_0x18e5e0,_0x227d48){var _0x143fa2={},_0x5b0394={},_0x34fea5={'count':0x0,'rows':[]};var _0x417bbb=_['map'](db['Dynamics365Account'][_0xa846('0x37')],function(_0x207140){return{'name':_0x207140['fieldName'],'type':_0x207140[_0xa846('0x38')]['key']};});_0x5b0394['model']=_['map'](_0x417bbb,_0xa846('0x35'));_0x5b0394[_0xa846('0x39')]=_[_0xa846('0x3a')](_0x18e5e0[_0xa846('0x39')]);_0x5b0394[_0xa846('0x3b')]=_[_0xa846('0x3c')](_0x5b0394[_0xa846('0x3d')],_0x5b0394['query']);_0x143fa2['attributes']=_[_0xa846('0x3c')](_0x5b0394['model'],qs[_0xa846('0x3e')](_0x18e5e0[_0xa846('0x39')][_0xa846('0x3e')]));_0x143fa2['attributes']=_0x143fa2[_0xa846('0x3f')][_0xa846('0x40')]?_0x143fa2[_0xa846('0x3f')]:_0x5b0394['model'];if(!_0x18e5e0['query'][_0xa846('0x41')](_0xa846('0x42'))){_0x143fa2[_0xa846('0x2d')]=qs[_0xa846('0x2d')](_0x18e5e0['query'][_0xa846('0x2d')]);_0x143fa2[_0xa846('0x2c')]=qs['offset'](_0x18e5e0['query']['offset']);}_0x143fa2[_0xa846('0x43')]=qs[_0xa846('0x44')](_0x18e5e0[_0xa846('0x39')]['sort']);_0x143fa2[_0xa846('0x45')]=qs[_0xa846('0x3b')](_[_0xa846('0x46')](_0x18e5e0[_0xa846('0x39')],_0x5b0394['filters']),_0x417bbb);if(_0x18e5e0['query']['filter']){_0x143fa2['where']=_[_0xa846('0x47')](_0x143fa2['where'],{'$or':_['map'](_0x417bbb,function(_0x24885f){if(_0x24885f[_0xa846('0x38')]!==_0xa846('0x48')){var _0x464c3c={};_0x464c3c[_0x24885f[_0xa846('0x35')]]={'$like':'%'+_0x18e5e0['query'][_0xa846('0x49')]+'%'};return _0x464c3c;}})});}_0x143fa2=_[_0xa846('0x47')]({},_0x143fa2,_0x18e5e0[_0xa846('0x4a')]);var _0x2e69af={'where':_0x143fa2[_0xa846('0x45')]};return db[_0xa846('0x4b')]['count'](_0x2e69af)[_0xa846('0x1c')](function(_0x512932){_0x34fea5[_0xa846('0x2b')]=_0x512932;if(_0x18e5e0['query'][_0xa846('0x4c')]){_0x143fa2[_0xa846('0x4d')]=[{'all':!![]}];}return db[_0xa846('0x4b')][_0xa846('0x4e')](_0x143fa2);})[_0xa846('0x1c')](function(_0x34b020){_0x34fea5['rows']=_0x34b020;return _0x34fea5;})['then'](respondWithFilteredResult(_0x227d48,_0x143fa2))[_0xa846('0x26')](handleError(_0x227d48,null));};exports[_0xa846('0x4f')]=function(_0x5e7593,_0x5c924a){var _0x1d84be={'raw':![],'where':{'id':_0x5e7593[_0xa846('0x50')]['id']}},_0x36898={};_0x36898[_0xa846('0x3d')]=_[_0xa846('0x3a')](db[_0xa846('0x4b')]['rawAttributes']);_0x36898['query']=_[_0xa846('0x3a')](_0x5e7593[_0xa846('0x39')]);_0x36898[_0xa846('0x3b')]=_['intersection'](_0x36898[_0xa846('0x3d')],_0x36898[_0xa846('0x39')]);_0x1d84be[_0xa846('0x3f')]=_[_0xa846('0x3c')](_0x36898[_0xa846('0x3d')],qs[_0xa846('0x3e')](_0x5e7593['query'][_0xa846('0x3e')]));_0x1d84be['attributes']=_0x1d84be[_0xa846('0x3f')][_0xa846('0x40')]?_0x1d84be[_0xa846('0x3f')]:_0x36898[_0xa846('0x3d')];if(_0x5e7593[_0xa846('0x39')][_0xa846('0x4c')]){_0x1d84be[_0xa846('0x4d')]=[{'all':!![]}];}_0x1d84be=_[_0xa846('0x47')]({},_0x1d84be,_0x5e7593[_0xa846('0x4a')]);return db['Dynamics365Account']['find'](_0x1d84be)['then'](handleEntityNotFound(_0x5c924a,null))['then'](respondWithResult(_0x5c924a,null))[_0xa846('0x26')](handleError(_0x5c924a,null));};exports[_0xa846('0x51')]=function(_0x4204c0,_0x44d86a){return db[_0xa846('0x4b')][_0xa846('0x51')](_0x4204c0['body'],{})[_0xa846('0x1c')](respondWithResult(_0x44d86a,0xc9))[_0xa846('0x26')](handleError(_0x44d86a,null));};exports[_0xa846('0x52')]=function(_0x2fcbec,_0x41f6bf){if(_0x2fcbec[_0xa846('0x53')]['id']){delete _0x2fcbec[_0xa846('0x53')]['id'];}return db[_0xa846('0x4b')][_0xa846('0x54')]({'where':{'id':_0x2fcbec[_0xa846('0x50')]['id']}})[_0xa846('0x1c')](handleEntityNotFound(_0x41f6bf,null))['then'](saveUpdates(_0x2fcbec['body'],null))[_0xa846('0x1c')](respondWithResult(_0x41f6bf,null))['catch'](handleError(_0x41f6bf,null));};exports[_0xa846('0x33')]=function(_0x41a954,_0x264024){return db[_0xa846('0x4b')]['find']({'where':{'id':_0x41a954[_0xa846('0x50')]['id']}})[_0xa846('0x1c')](handleEntityNotFound(_0x264024,null))[_0xa846('0x1c')](removeEntity(_0x264024,null))['catch'](handleError(_0x264024,null));};exports[_0xa846('0x55')]=function(_0x135aef,_0x2dce17,_0x3b984a){var _0x5c2297={};var _0x366bb9={};var _0x48fcd5;var _0x5e994d;return db[_0xa846('0x4b')][_0xa846('0x56')]({'where':{'id':_0x135aef[_0xa846('0x50')]['id']}})['then'](handleEntityNotFound(_0x2dce17,null))[_0xa846('0x1c')](function(_0xa64fbd){if(_0xa64fbd){_0x48fcd5=_0xa64fbd;_0x366bb9['model']=_[_0xa846('0x3a')](db['Dynamics365Configuration']['rawAttributes']);_0x366bb9['query']=_[_0xa846('0x3a')](_0x135aef[_0xa846('0x39')]);_0x366bb9[_0xa846('0x3b')]=_[_0xa846('0x3c')](_0x366bb9[_0xa846('0x3d')],_0x366bb9['query']);_0x5c2297[_0xa846('0x3f')]=_['intersection'](_0x366bb9[_0xa846('0x3d')],qs[_0xa846('0x3e')](_0x135aef[_0xa846('0x39')][_0xa846('0x3e')]));_0x5c2297[_0xa846('0x3f')]=_0x5c2297[_0xa846('0x3f')][_0xa846('0x40')]?_0x5c2297['attributes']:_0x366bb9[_0xa846('0x3d')];_0x5c2297['order']=qs[_0xa846('0x44')](_0x135aef[_0xa846('0x39')][_0xa846('0x44')]);_0x5c2297['where']=qs[_0xa846('0x3b')](_[_0xa846('0x46')](_0x135aef[_0xa846('0x39')],_0x366bb9[_0xa846('0x3b')]));if(_0x135aef[_0xa846('0x39')]['filter']){_0x5c2297[_0xa846('0x45')]=_[_0xa846('0x47')](_0x5c2297[_0xa846('0x45')],{'$or':_[_0xa846('0x57')](_0x5c2297[_0xa846('0x3f')],function(_0x4b3b4f){var _0x3f7b5d={};_0x3f7b5d[_0x4b3b4f]={'$like':'%'+_0x135aef[_0xa846('0x39')][_0xa846('0x49')]+'%'};return _0x3f7b5d;})});}_0x5c2297=_['merge']({},_0x5c2297,_0x135aef['options']);return _0x48fcd5[_0xa846('0x55')](_0x5c2297);}})[_0xa846('0x1c')](function(_0x15e14d){if(_0x15e14d){_0x5e994d=_0x15e14d[_0xa846('0x40')];if(!_0x135aef[_0xa846('0x39')][_0xa846('0x41')](_0xa846('0x42'))){_0x5c2297[_0xa846('0x2d')]=qs[_0xa846('0x2d')](_0x135aef[_0xa846('0x39')][_0xa846('0x2d')]);_0x5c2297[_0xa846('0x2c')]=qs[_0xa846('0x2c')](_0x135aef['query']['offset']);}return _0x48fcd5[_0xa846('0x55')](_0x5c2297);}})['then'](function(_0x57573c){if(_0x57573c){return _0x57573c?{'count':_0x5e994d,'rows':_0x57573c}:null;}})[_0xa846('0x1c')](respondWithResult(_0x2dce17,null))[_0xa846('0x26')](handleError(_0x2dce17,null));};exports[_0xa846('0x58')]=function(_0x1f3859,_0x14f67d,_0x2fd7c3){if(_0x1f3859['body']['id']){delete _0x1f3859[_0xa846('0x53')]['id'];}return db[_0xa846('0x4b')]['findOne']({'where':{'id':_0x1f3859[_0xa846('0x50')]['id']}})[_0xa846('0x1c')](handleEntityNotFound(_0x14f67d,null))[_0xa846('0x1c')](function(_0x374ccb){if(_0x374ccb){_0x1f3859[_0xa846('0x53')][_0xa846('0x59')]=_0x374ccb['id'];_0x1f3859['body'][_0xa846('0x5a')]=integrations['getSubjects'](_0x1f3859[_0xa846('0x53')]['channel'],_0x1f3859[_0xa846('0x53')]['type']);_0x1f3859[_0xa846('0x53')]['Descriptions']=integrations[_0xa846('0x5b')](_0x1f3859[_0xa846('0x53')]['channel'],_0x1f3859[_0xa846('0x53')][_0xa846('0x38')]);return db[_0xa846('0x5c')][_0xa846('0x51')](_0x1f3859[_0xa846('0x53')],{'include':[{'model':db[_0xa846('0x5d')],'as':'Subjects'},{'model':db[_0xa846('0x5d')],'as':_0xa846('0x5e')}]});}return null;})[_0xa846('0x1c')](respondWithResult(_0x14f67d,null))[_0xa846('0x26')](handleError(_0x14f67d,null));};exports[_0xa846('0x5f')]=function(_0x2061da,_0x4a9997,_0x4f5f11){var _0x271e55=_0x2061da['query'][_0xa846('0x60')];var _0x778d65=_0x271e55===_0xa846('0x61')?_0xa846('0x62'):_0xa846('0x63');var _0x225e21='';var _0x54d8c8='';var _0x432729='';var _0x5be1c9='';var _0x1a577b='';var _0x328c8b='';var _0x3c23ff='';var _0x333b05='';var _0x29ee4b=[_0xa846('0x64'),_0xa846('0x65'),_0xa846('0x66'),'ownerid',_0xa846('0x67'),'subject',_0xa846('0x68'),_0xa846('0x69'),_0xa846('0x6a'),_0xa846('0x6b')];var _0x781c8d=[_0xa846('0x6c'),'accountidyominame',_0xa846('0x6d'),_0xa846('0x6e'),_0xa846('0x6f'),_0xa846('0x70'),_0xa846('0x71'),_0xa846('0x72'),_0xa846('0x73'),'createdbyexternalpartyyominame','createdbyname',_0xa846('0x74'),_0xa846('0x75'),_0xa846('0x76'),_0xa846('0x77'),_0xa846('0x78'),_0xa846('0x79'),_0xa846('0x7a'),_0xa846('0x7b'),'entitlementidname',_0xa846('0x7c'),_0xa846('0x7d'),_0xa846('0x7e'),_0xa846('0x7f'),_0xa846('0x80'),_0xa846('0x81'),_0xa846('0x82'),_0xa846('0x83'),_0xa846('0x84'),_0xa846('0x85'),_0xa846('0x86'),_0xa846('0x87'),_0xa846('0x88'),_0xa846('0x89'),_0xa846('0x8a'),_0xa846('0x8b'),_0xa846('0x8c'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xa846('0x8d'),_0xa846('0x8e'),'onholdtime',_0xa846('0x8f'),_0xa846('0x90'),_0xa846('0x91'),_0xa846('0x92'),_0xa846('0x93'),_0xa846('0x94'),_0xa846('0x95'),_0xa846('0x96'),_0xa846('0x97'),_0xa846('0x98'),'resolveby','resolvebykpiidname','responseby',_0xa846('0x99'),'responsiblecontactidyominame',_0xa846('0x9a'),_0xa846('0x9b'),_0xa846('0x9c'),_0xa846('0x9d'),'statecode','statuscode',_0xa846('0x9e'),_0xa846('0x9f'),'timezoneruleversionnumber','transactioncurrencyidname',_0xa846('0xa0'),'utcconversiontimezonecode',_0xa846('0xa1')];var _0x279b5b=_0x29ee4b[_0xa846('0xa2')](_0x781c8d);return db[_0xa846('0x4b')][_0xa846('0x56')]({'where':{'id':_0x2061da[_0xa846('0x50')]['id']},'attributes':['id','username',_0xa846('0xa3'),'remoteUri','tenantId','clientId',_0xa846('0xa4')]})['then'](handleEntityNotFound(_0x4a9997,null))[_0xa846('0x1c')](function(_0x2ae44e){if(_0x2ae44e){_0x333b05=_0x2ae44e[_0xa846('0xa5')];var _0x51ac4c=_0x333b05['slice'](-0x1);if(_0x51ac4c==='/'){_0x333b05=_0x333b05[_0xa846('0xa6')](0x0,_0x333b05[_0xa846('0xa7')](_0x51ac4c));}_0x3c23ff=util[_0xa846('0xa8')](_0xa846('0xa9'),_0x333b05);var _0x5b16ce={'method':_0xa846('0xaa'),'uri':_0xa846('0xab')+_0x2ae44e['tenantId']+_0xa846('0xac'),'form':{'client_id':_0x2ae44e['clientId'],'resource':_0x333b05,'username':_0x2ae44e[_0xa846('0xad')],'password':_0x2ae44e[_0xa846('0xa3')],'grant_type':_0xa846('0xa3'),'client_secret':_0x2ae44e[_0xa846('0xa4')]},'json':!![]};return rp(_0x5b16ce);}})['then'](function(_0xdb3843){_0x328c8b=_0xdb3843[_0xa846('0xae')];var _0x183dd8={'method':_0xa846('0xaf'),'uri':encodeURI(_0x3c23ff+_0xa846('0xb0')+_0x778d65+'\x27'),'headers':{'Authorization':_0xa846('0xb1')+_0x328c8b,'If-None-Match':null,'OData-Version':_0xa846('0xb2')},'json':!![]};return rp(_0x183dd8);})[_0xa846('0x1c')](function(_0x12020a){var _0x552b72=_0x12020a[_0xa846('0xb3')][0x0];var _0x322812=_0x552b72['MetadataId'];var _0x5bf698={'method':'GET','uri':_0x3c23ff+_0xa846('0xb4')+_0x322812+_0xa846('0xb5'),'headers':{'Authorization':_0xa846('0xb1')+_0x328c8b,'If-None-Match':null,'OData-Version':_0xa846('0xb2')},'json':!![]};return rp(_0x5bf698);})['then'](function(_0xf5e789){_0x225e21=_0xf5e789;_0x54d8c8=_0x225e21[_0xa846('0xb6')];_0x54d8c8=_[_0xa846('0xb7')](_0x54d8c8,function(_0x3c5571){return!_0x279b5b[_0xa846('0xb8')](_0x3c5571['LogicalName']);});var _0x233c71=[];var _0x17b2ec=[];_0x54d8c8[_0xa846('0xb9')](function(_0x27b509){if(_0x27b509[_0xa846('0xba')]){var _0x267096=_0x27b509[_0xa846('0xba')]['substring'](_0x27b509[_0xa846('0xba')][_0xa846('0xa7')]('.')+0x1);if(_0x267096===_0xa846('0xbb')){_0x233c71[_0xa846('0xbc')](getSelectList(_0x3c23ff,_0x271e55,_0x17b2ec,_0x225e21[_0xa846('0xbd')],_0x27b509[_0xa846('0xbd')],_0x328c8b));}}});return Promise['all'](_0x233c71);})[_0xa846('0x1c')](function(_0x4994ca){_0x432729=_0x4994ca[0x0];var _0x5a9d41=[];var _0x487cf1=[];_0x54d8c8[_0xa846('0xb9')](function(_0xba37ef){if(!_['isNil'](_0xba37ef[_0xa846('0xba')])){var _0x455c71=_0xba37ef[_0xa846('0xba')][_0xa846('0xa6')](_0xba37ef['@odata.type']['lastIndexOf']('.')+0x1);if(_0x455c71===_0xa846('0xbe')){_0x5a9d41[_0xa846('0xbc')](getBooleanList(_0x3c23ff,_0x271e55,_0x487cf1,_0x225e21[_0xa846('0xbd')],_0xba37ef[_0xa846('0xbd')],_0x328c8b));}}});return Promise[_0xa846('0xbf')](_0x5a9d41);})[_0xa846('0x1c')](function(_0x3ed195){_0x5be1c9=_0x3ed195[0x0];var _0x2310aa=[];var _0x35be25=[];_0x54d8c8['forEach'](function(_0xbc680d){if(_0xbc680d[_0xa846('0xba')]){var _0x24c7d1=_0xbc680d[_0xa846('0xba')]['substring'](_0xbc680d['@odata.type']['lastIndexOf']('.')+0x1);if(_0x24c7d1==='StringAttributeMetadata'||_0x24c7d1===_0xa846('0xc0')||_0x24c7d1==='BigIntAttributeMetadata'||_0x24c7d1===_0xa846('0xc1')||_0x24c7d1===_0xa846('0xc2')||_0x24c7d1===_0xa846('0xc3')||_0x24c7d1===_0xa846('0xc4')||_0x24c7d1===_0xa846('0xc5')||_0x24c7d1==='StateAttributeMetadata'||_0x24c7d1===_0xa846('0xc6')){_0x2310aa[_0xa846('0xbc')](getInputList(_0x3c23ff,_0x271e55,_0x24c7d1,_0x35be25,_0x225e21[_0xa846('0xbd')],_0xbc680d[_0xa846('0xbd')],_0x328c8b));}}});return Promise[_0xa846('0xbf')](_0x2310aa);})[_0xa846('0x1c')](function(_0x2e5d8f){_0x1a577b=_0x2e5d8f[0x0];var _0x13e8a0=_0x432729[_0xa846('0xa2')](_0x5be1c9)[_0xa846('0xa2')](_0x1a577b);var _0x389cd1={'count':_0x13e8a0[_0xa846('0x40')],'rows':_0x13e8a0};return _0x389cd1;})[_0xa846('0x1c')](respondWithResult(_0x4a9997,null))[_0xa846('0x26')](function(_0x3c6a8a){var _0x465f60=_0x2061da[_0xa846('0x39')][_0xa846('0xc7')]?0x1f4:_0x3c6a8a[_0xa846('0xc8')]||0x1f4;logger[_0xa846('0x21')](_0x3c6a8a[_0xa846('0x34')]);delete _0x3c6a8a['name'];if(_0x465f60===0x191){_0x465f60=0x190;}_0x4a9997['status'](_0x465f60)[_0xa846('0x36')](_0x2061da[_0xa846('0x39')][_0xa846('0xc7')]?{'message':_0xa846('0xc9'),'statusCode':_0x3c6a8a[_0xa846('0xc8')]}:_0x3c6a8a);});};function getSelectList(_0x3fdaae,_0x1a076e,_0x4e15e2,_0x331c9e,_0x22bfbb,_0x4eb86f){var _0x17685e={'method':_0xa846('0xaf'),'uri':_0x3fdaae+_0xa846('0xb4')+_0x331c9e+_0xa846('0xca')+_0x22bfbb+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xa846('0xcb'),'headers':{'Authorization':'Bearer\x20'+_0x4eb86f,'If-None-Match':null,'OData-Version':_0xa846('0xb2')},'json':!![]};return rp(_0x17685e)[_0xa846('0x1c')](function(_0x45d0b7){var _0x1f5e66=[];var _0xe9d006=_0x45d0b7['OptionSet'][_0xa846('0xcc')];_0xe9d006['forEach'](function(_0x4b9de4){_0x1f5e66[_0xa846('0xbc')]({'name':_0x4b9de4[_0xa846('0xcd')][_0xa846('0xce')]['Label'],'value':String(_0x4b9de4['Value'])});});var _0x178c38={'id':_0x1a076e+'_'+_0x45d0b7[_0xa846('0xcf')],'name':_0x45d0b7['DisplayName'][_0xa846('0xce')]['Label'],'custom':![],'options':_0x1f5e66};_0x4e15e2[_0xa846('0xbc')](_0x178c38);return _0x4e15e2;});}function getBooleanList(_0x159ca3,_0x5e70c1,_0xbda53,_0x4bdba7,_0x458351,_0x27be82){var _0x325d78={'method':_0xa846('0xaf'),'uri':_0x159ca3+'EntityDefinitions('+_0x4bdba7+_0xa846('0xca')+_0x458351+_0xa846('0xd0'),'headers':{'Authorization':_0xa846('0xb1')+_0x27be82,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x325d78)[_0xa846('0x1c')](function(_0x565fb1){var _0x3bf699=[];_0x3bf699[_0xa846('0xbc')]({'name':_0x565fb1['OptionSet'][_0xa846('0xd1')][_0xa846('0xcd')][_0xa846('0xce')][_0xa846('0xcd')],'value':'true'},{'name':_0x565fb1['OptionSet'][_0xa846('0xd2')][_0xa846('0xcd')][_0xa846('0xce')]['Label'],'value':_0xa846('0xd3')});var _0x1d2c01={'id':_0x5e70c1+'_'+_0x565fb1[_0xa846('0xcf')],'name':_0x565fb1['DisplayName'][_0xa846('0xce')][_0xa846('0xcd')],'custom':![],'options':_0x3bf699};_0xbda53[_0xa846('0xbc')](_0x1d2c01);return _0xbda53;});}function getInputList(_0x27b469,_0x33872f,_0x50d388,_0x3268f4,_0x3e0bf3,_0x96246e,_0x141d9d){var _0x6c40d5={'method':'GET','uri':_0x27b469+_0xa846('0xb4')+_0x3e0bf3+_0xa846('0xca')+_0x96246e+')/Microsoft.Dynamics.CRM.'+_0x50d388+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xa846('0xb1')+_0x141d9d,'If-None-Match':null,'OData-Version':_0xa846('0xb2')},'json':!![]};return rp(_0x6c40d5)[_0xa846('0x1c')](function(_0x58449d){var _0x4ec152={'id':_0x33872f+'_'+_0x58449d[_0xa846('0xcf')],'name':_0x58449d['DisplayName'][_0xa846('0xce')]?_0x58449d[_0xa846('0xd4')]['UserLocalizedLabel'][_0xa846('0xcd')]:_0x58449d[_0xa846('0xcf')],'custom':![],'options':[]};_0x3268f4[_0xa846('0xbc')](_0x4ec152);return _0x3268f4;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index c579f78..97cd0bb 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 _0xce3f=['exports','define','int_dynamics365_accounts','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x458ed6,_0x504646){var _0xa5dfd9=function(_0x504e7b){while(--_0x504e7b){_0x458ed6['push'](_0x458ed6['shift']());}};_0xa5dfd9(++_0x504646);}(_0xce3f,0x87));var _0xfce3=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xce3f[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xfce3('0x0'));var util=require('util');var logger=require(_0xfce3('0x1'))(_0xfce3('0x2'));var moment=require('moment');var BPromise=require(_0xfce3('0x3'));var rp=require(_0xfce3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfce3('0x5'));var config=require(_0xfce3('0x6'));var attributes=require(_0xfce3('0x7'));var integrations=require(_0xfce3('0x8'));module[_0xfce3('0x9')]=function(_0x3ec280,_0x2366b7){return _0x3ec280[_0xfce3('0xa')]('Dynamics365Account',attributes,{'tableName':_0xfce3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e7d=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x37dbf3,_0x4ad77d){var _0x1cda9b=function(_0x5d1a10){while(--_0x5d1a10){_0x37dbf3['push'](_0x37dbf3['shift']());}};_0x1cda9b(++_0x4ad77d);}(_0x0e7d,0x138));var _0xd0e7=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x0e7d[_0x5cc8b9];return _0x58892e;};'use strict';var _=require('lodash');var util=require(_0xd0e7('0x0'));var logger=require(_0xd0e7('0x1'))(_0xd0e7('0x2'));var moment=require(_0xd0e7('0x3'));var BPromise=require(_0xd0e7('0x4'));var rp=require(_0xd0e7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0e7('0x6'));var config=require(_0xd0e7('0x7'));var attributes=require(_0xd0e7('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd0e7('0x9')]=function(_0x26b85a,_0x5c6874){return _0x26b85a[_0xd0e7('0xa')](_0xd0e7('0xb'),attributes,{'tableName':_0xd0e7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 82ebecc..9b82b3a 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 _0x8ba0=['request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','catch','find','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x4e1bae,_0x1cfc32){var _0x184151=function(_0x371d80){while(--_0x371d80){_0x4e1bae['push'](_0x4e1bae['shift']());}};_0x184151(++_0x1cfc32);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x4a0299,_0x39dbd7){_0x4a0299=_0x4a0299-0x0;var _0x54d6c3=_0x8ba0[_0x4a0299];return _0x54d6c3;};'use strict';var _=require(_0x08ba('0x0'));var util=require(_0x08ba('0x1'));var moment=require(_0x08ba('0x2'));var BPromise=require(_0x08ba('0x3'));var rs=require(_0x08ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x08ba('0x5'));var logger=require(_0x08ba('0x6'))(_0x08ba('0x7'));var config=require(_0x08ba('0x8'));var jayson=require(_0x08ba('0x9'));var client=jayson[_0x08ba('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x235354,_0x11f6a1,_0x37bcdf){return new BPromise(function(_0x451f15,_0x1f6051){return client['request'](_0x235354,_0x37bcdf)[_0x08ba('0xb')](function(_0x5eb94f){logger[_0x08ba('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x11f6a1,_0x08ba('0xd'));logger[_0x08ba('0xe')](_0x08ba('0xf'),_0x11f6a1,_0x08ba('0xd'),JSON[_0x08ba('0x10')](_0x5eb94f));if(_0x5eb94f[_0x08ba('0x11')]){if(_0x5eb94f[_0x08ba('0x11')][_0x08ba('0x12')]===0x1f4){logger[_0x08ba('0x11')](_0x08ba('0x13'),_0x11f6a1,_0x5eb94f[_0x08ba('0x11')][_0x08ba('0x14')]);return _0x1f6051(_0x5eb94f['error'][_0x08ba('0x14')]);}logger[_0x08ba('0x11')](_0x08ba('0x13'),_0x11f6a1,_0x5eb94f[_0x08ba('0x11')][_0x08ba('0x14')]);return _0x451f15(_0x5eb94f[_0x08ba('0x11')]['message']);}else{logger[_0x08ba('0xc')](_0x08ba('0x13'),_0x11f6a1,_0x08ba('0xd'));_0x451f15(_0x5eb94f[_0x08ba('0x15')][_0x08ba('0x14')]);}})['catch'](function(_0x4b5a04){logger[_0x08ba('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x11f6a1,_0x4b5a04);_0x1f6051(_0x4b5a04);});});}exports[_0x08ba('0x16')]=function(_0x57e1d5){var _0x5c385d=this;return new Promise(function(_0x24623c,_0x2643fe){return db[_0x08ba('0x17')][_0x08ba('0x18')]({'raw':_0x57e1d5[_0x08ba('0x19')]?_0x57e1d5[_0x08ba('0x19')][_0x08ba('0x1a')]===undefined?!![]:![]:!![],'where':_0x57e1d5['options']?_0x57e1d5['options'][_0x08ba('0x1b')]||null:null,'attributes':_0x57e1d5['options']?_0x57e1d5[_0x08ba('0x19')][_0x08ba('0x1c')]||null:null,'limit':_0x57e1d5['options']?_0x57e1d5[_0x08ba('0x19')][_0x08ba('0x1d')]||null:null,'include':_0x57e1d5[_0x08ba('0x19')]?_0x57e1d5[_0x08ba('0x19')][_0x08ba('0x1e')]?_[_0x08ba('0x1f')](_0x57e1d5[_0x08ba('0x19')][_0x08ba('0x1e')],function(_0x3741bf){return{'model':db[_0x3741bf[_0x08ba('0x20')]],'as':_0x3741bf['as'],'attributes':_0x3741bf[_0x08ba('0x1c')],'include':_0x3741bf[_0x08ba('0x1e')]?_['map'](_0x3741bf[_0x08ba('0x1e')],function(_0x17c24c){return{'model':db[_0x17c24c[_0x08ba('0x20')]],'as':_0x17c24c['as'],'attributes':_0x17c24c[_0x08ba('0x1c')],'include':_0x17c24c[_0x08ba('0x1e')]?_[_0x08ba('0x1f')](_0x17c24c[_0x08ba('0x1e')],function(_0x529c32){return{'model':db[_0x529c32[_0x08ba('0x20')]],'as':_0x529c32['as'],'attributes':_0x529c32[_0x08ba('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x08ba('0xb')](function(_0x5140d6){logger['info']('GetDynamics365Account',_0x57e1d5);logger[_0x08ba('0xe')](_0x08ba('0x16'),_0x57e1d5,JSON[_0x08ba('0x10')](_0x5140d6));_0x24623c(_0x5140d6);})[_0x08ba('0x21')](function(_0x419ff7){logger['error'](_0x08ba('0x16'),_0x419ff7['message'],_0x57e1d5);_0x2643fe(_0x5c385d[_0x08ba('0x11')](0x1f4,_0x419ff7[_0x08ba('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x4e30ba){var _0x5e4463=this;return new Promise(function(_0x86dcb0,_0x26a61d){return db[_0x08ba('0x17')][_0x08ba('0x22')]({'raw':_0x4e30ba['options']?_0x4e30ba[_0x08ba('0x19')][_0x08ba('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e30ba[_0x08ba('0x19')]?_0x4e30ba[_0x08ba('0x19')]['where']||null:null,'attributes':_0x4e30ba[_0x08ba('0x19')]?_0x4e30ba[_0x08ba('0x19')][_0x08ba('0x1c')]||null:null,'include':_0x4e30ba[_0x08ba('0x19')]?_0x4e30ba[_0x08ba('0x19')][_0x08ba('0x1e')]?_[_0x08ba('0x1f')](_0x4e30ba[_0x08ba('0x19')]['include'],function(_0xa9a499){return{'model':db[_0xa9a499[_0x08ba('0x20')]],'as':_0xa9a499['as'],'attributes':_0xa9a499[_0x08ba('0x1c')],'include':_0xa9a499[_0x08ba('0x1e')]?_[_0x08ba('0x1f')](_0xa9a499['include'],function(_0x1bea38){return{'model':db[_0x1bea38[_0x08ba('0x20')]],'as':_0x1bea38['as'],'attributes':_0x1bea38[_0x08ba('0x1c')],'include':_0x1bea38[_0x08ba('0x1e')]?_[_0x08ba('0x1f')](_0x1bea38['include'],function(_0x3303a7){return{'model':db[_0x3303a7['model']],'as':_0x3303a7['as'],'attributes':_0x3303a7[_0x08ba('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xabc61f){logger[_0x08ba('0xc')](_0x08ba('0x23'),_0x4e30ba);logger[_0x08ba('0xe')](_0x08ba('0x23'),_0x4e30ba,JSON[_0x08ba('0x10')](_0xabc61f));_0x86dcb0(_0xabc61f);})[_0x08ba('0x21')](function(_0x430571){logger[_0x08ba('0x11')](_0x08ba('0x23'),_0x430571[_0x08ba('0x14')],_0x4e30ba);_0x26a61d(_0x5e4463[_0x08ba('0x11')](0x1f4,_0x430571[_0x08ba('0x14')]));});});}; \ No newline at end of file +var _0xdbb1=['GetDynamics365Account','Dynamics365Account','findAll','options','attributes','limit','include','map','model','then','ShowDynamics365Account','find','raw','lodash','randomstring','../../config/utils','rpc','../../config/environment','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x32bbce,_0x86945e){var _0x294549=function(_0x2ede20){while(--_0x2ede20){_0x32bbce['push'](_0x32bbce['shift']());}};_0x294549(++_0x86945e);}(_0xdbb1,0x105));var _0x1dbb=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xdbb1[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x1dbb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1dbb('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1dbb('0x2'));var logger=require('../../config/logger')(_0x1dbb('0x3'));var config=require(_0x1dbb('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1dbb('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x38259d,_0x2070a8,_0x7c2269){return new BPromise(function(_0x5e622c,_0x3ffb54){return client[_0x1dbb('0x6')](_0x38259d,_0x7c2269)['then'](function(_0x208220){logger[_0x1dbb('0x7')](_0x1dbb('0x8'),_0x2070a8,_0x1dbb('0x9'));logger[_0x1dbb('0xa')](_0x1dbb('0xb'),_0x2070a8,_0x1dbb('0x9'),JSON[_0x1dbb('0xc')](_0x208220));if(_0x208220[_0x1dbb('0xd')]){if(_0x208220[_0x1dbb('0xd')][_0x1dbb('0xe')]===0x1f4){logger['error'](_0x1dbb('0x8'),_0x2070a8,_0x208220[_0x1dbb('0xd')][_0x1dbb('0xf')]);return _0x3ffb54(_0x208220[_0x1dbb('0xd')]['message']);}logger['error'](_0x1dbb('0x8'),_0x2070a8,_0x208220[_0x1dbb('0xd')][_0x1dbb('0xf')]);return _0x5e622c(_0x208220[_0x1dbb('0xd')][_0x1dbb('0xf')]);}else{logger['info'](_0x1dbb('0x8'),_0x2070a8,_0x1dbb('0x9'));_0x5e622c(_0x208220[_0x1dbb('0x10')]['message']);}})[_0x1dbb('0x11')](function(_0x363224){logger['error'](_0x1dbb('0x8'),_0x2070a8,_0x363224);_0x3ffb54(_0x363224);});});}exports[_0x1dbb('0x12')]=function(_0x98b8d2){var _0x440c9f=this;return new Promise(function(_0xb21bc5,_0x41e9fc){return db[_0x1dbb('0x13')][_0x1dbb('0x14')]({'raw':_0x98b8d2['options']?_0x98b8d2['options']['raw']===undefined?!![]:![]:!![],'where':_0x98b8d2[_0x1dbb('0x15')]?_0x98b8d2[_0x1dbb('0x15')]['where']||null:null,'attributes':_0x98b8d2[_0x1dbb('0x15')]?_0x98b8d2[_0x1dbb('0x15')][_0x1dbb('0x16')]||null:null,'limit':_0x98b8d2[_0x1dbb('0x15')]?_0x98b8d2[_0x1dbb('0x15')][_0x1dbb('0x17')]||null:null,'include':_0x98b8d2[_0x1dbb('0x15')]?_0x98b8d2[_0x1dbb('0x15')][_0x1dbb('0x18')]?_[_0x1dbb('0x19')](_0x98b8d2[_0x1dbb('0x15')][_0x1dbb('0x18')],function(_0x2c0993){return{'model':db[_0x2c0993[_0x1dbb('0x1a')]],'as':_0x2c0993['as'],'attributes':_0x2c0993[_0x1dbb('0x16')],'include':_0x2c0993[_0x1dbb('0x18')]?_[_0x1dbb('0x19')](_0x2c0993[_0x1dbb('0x18')],function(_0x18f188){return{'model':db[_0x18f188['model']],'as':_0x18f188['as'],'attributes':_0x18f188[_0x1dbb('0x16')],'include':_0x18f188['include']?_[_0x1dbb('0x19')](_0x18f188['include'],function(_0x72cfed){return{'model':db[_0x72cfed[_0x1dbb('0x1a')]],'as':_0x72cfed['as'],'attributes':_0x72cfed[_0x1dbb('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1dbb('0x1b')](function(_0x271ee5){logger[_0x1dbb('0x7')]('GetDynamics365Account',_0x98b8d2);logger[_0x1dbb('0xa')](_0x1dbb('0x12'),_0x98b8d2,JSON[_0x1dbb('0xc')](_0x271ee5));_0xb21bc5(_0x271ee5);})['catch'](function(_0x5557ad){logger[_0x1dbb('0xd')]('GetDynamics365Account',_0x5557ad['message'],_0x98b8d2);_0x41e9fc(_0x440c9f[_0x1dbb('0xd')](0x1f4,_0x5557ad[_0x1dbb('0xf')]));});});};exports[_0x1dbb('0x1c')]=function(_0x151525){var _0x292a36=this;return new Promise(function(_0x154884,_0x15cc71){return db[_0x1dbb('0x13')][_0x1dbb('0x1d')]({'raw':_0x151525['options']?_0x151525['options'][_0x1dbb('0x1e')]===undefined?!![]:![]:!![],'where':_0x151525[_0x1dbb('0x15')]?_0x151525[_0x1dbb('0x15')]['where']||null:null,'attributes':_0x151525['options']?_0x151525[_0x1dbb('0x15')][_0x1dbb('0x16')]||null:null,'include':_0x151525[_0x1dbb('0x15')]?_0x151525['options']['include']?_[_0x1dbb('0x19')](_0x151525[_0x1dbb('0x15')]['include'],function(_0x3c22f8){return{'model':db[_0x3c22f8[_0x1dbb('0x1a')]],'as':_0x3c22f8['as'],'attributes':_0x3c22f8[_0x1dbb('0x16')],'include':_0x3c22f8[_0x1dbb('0x18')]?_['map'](_0x3c22f8[_0x1dbb('0x18')],function(_0x22e40b){return{'model':db[_0x22e40b[_0x1dbb('0x1a')]],'as':_0x22e40b['as'],'attributes':_0x22e40b[_0x1dbb('0x16')],'include':_0x22e40b[_0x1dbb('0x18')]?_[_0x1dbb('0x19')](_0x22e40b['include'],function(_0x5a9c2){return{'model':db[_0x5a9c2[_0x1dbb('0x1a')]],'as':_0x5a9c2['as'],'attributes':_0x5a9c2['attributes']};}):[]};}):[]};}):[]:[]})[_0x1dbb('0x1b')](function(_0x3436b9){logger[_0x1dbb('0x7')](_0x1dbb('0x1c'),_0x151525);logger[_0x1dbb('0xa')]('ShowDynamics365Account',_0x151525,JSON[_0x1dbb('0xc')](_0x3436b9));_0x154884(_0x3436b9);})[_0x1dbb('0x11')](function(_0x58536e){logger[_0x1dbb('0xd')](_0x1dbb('0x1c'),_0x58536e[_0x1dbb('0xf')],_0x151525);_0x15cc71(_0x292a36['error'](0x1f4,_0x58536e[_0x1dbb('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index ed51f5b..03be8d6 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 _0x1996=['getDescriptions','post','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/descriptions'];(function(_0x48aa4a,_0x1a0d4a){var _0x5a5e2a=function(_0xadc49f){while(--_0xadc49f){_0x48aa4a['push'](_0x48aa4a['shift']());}};_0x5a5e2a(++_0x1a0d4a);}(_0x1996,0x1d5));var _0x6199=function(_0x4694a6,_0x23bd6a){_0x4694a6=_0x4694a6-0x0;var _0x5b349b=_0x1996[_0x4694a6];return _0x5b349b;};'use strict';var multer=require(_0x6199('0x0'));var util=require(_0x6199('0x1'));var path=require(_0x6199('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6199('0x3')]();var fs_extra=require(_0x6199('0x4'));var auth=require(_0x6199('0x5'));var interaction=require(_0x6199('0x6'));var config=require(_0x6199('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0x6199('0x8')]('/',auth[_0x6199('0x9')](),controller[_0x6199('0xa')]);router[_0x6199('0x8')](_0x6199('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x6199('0xc'),auth['isAuthenticated'](),controller[_0x6199('0xd')]);router[_0x6199('0x8')]('/:id/subjects',auth[_0x6199('0x9')](),controller['getSubjects']);router['get'](_0x6199('0xe'),auth['isAuthenticated'](),controller[_0x6199('0xf')]);router[_0x6199('0x10')]('/',auth[_0x6199('0x9')](),controller[_0x6199('0x11')]);router[_0x6199('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x6199('0x13')]);router[_0x6199('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6199('0x15')]=router; \ No newline at end of file +var _0x7e51=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','util','path'];(function(_0xd98ca3,_0x38fbd9){var _0x35960d=function(_0x52e8ee){while(--_0x52e8ee){_0xd98ca3['push'](_0xd98ca3['shift']());}};_0x35960d(++_0x38fbd9);}(_0x7e51,0xc5));var _0x17e5=function(_0x58d310,_0x374f78){_0x58d310=_0x58d310-0x0;var _0x306d58=_0x7e51[_0x58d310];return _0x306d58;};'use strict';var multer=require(_0x17e5('0x0'));var util=require(_0x17e5('0x1'));var path=require(_0x17e5('0x2'));var timeout=require(_0x17e5('0x3'));var express=require(_0x17e5('0x4'));var router=express[_0x17e5('0x5')]();var fs_extra=require(_0x17e5('0x6'));var auth=require(_0x17e5('0x7'));var interaction=require(_0x17e5('0x8'));var config=require('../../config/environment');var controller=require(_0x17e5('0x9'));router[_0x17e5('0xa')]('/',auth[_0x17e5('0xb')](),controller[_0x17e5('0xc')]);router[_0x17e5('0xa')](_0x17e5('0xd'),auth['isAuthenticated'](),controller[_0x17e5('0xe')]);router[_0x17e5('0xa')](_0x17e5('0xf'),auth['isAuthenticated'](),controller[_0x17e5('0x10')]);router['get']('/:id/subjects',auth[_0x17e5('0xb')](),controller[_0x17e5('0x11')]);router[_0x17e5('0xa')](_0x17e5('0x12'),auth[_0x17e5('0xb')](),controller[_0x17e5('0x13')]);router['post']('/',auth[_0x17e5('0xb')](),controller['create']);router[_0x17e5('0x14')]('/:id',auth[_0x17e5('0xb')](),controller[_0x17e5('0x15')]);router[_0x17e5('0x16')](_0x17e5('0xd'),auth[_0x17e5('0xb')](),controller[_0x17e5('0x17')]);module[_0x17e5('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index bb83994..491c6a6 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 _0x7e18=['phonecall','sequelize','exports','ENUM','incident'];(function(_0x160c42,_0x383a96){var _0xcc4c25=function(_0x6e66fd){while(--_0x6e66fd){_0x160c42['push'](_0x160c42['shift']());}};_0xcc4c25(++_0x383a96);}(_0x7e18,0x169));var _0x87e1=function(_0x58661b,_0x5953fd){_0x58661b=_0x58661b-0x0;var _0x472220=_0x7e18[_0x58661b];return _0x472220;};'use strict';var Sequelize=require(_0x87e1('0x0'));module[_0x87e1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x87e1('0x2')](_0x87e1('0x3'),_0x87e1('0x4')),'defaultValue':_0x87e1('0x3')}}; \ No newline at end of file +var _0x06f0=['phonecall','sequelize','exports','STRING','ENUM','incident'];(function(_0x4514ae,_0x32a72c){var _0x471544=function(_0x5b13ad){while(--_0x5b13ad){_0x4514ae['push'](_0x4514ae['shift']());}};_0x471544(++_0x32a72c);}(_0x06f0,0x16f));var _0x006f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06f0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x006f('0x0'));module[_0x006f('0x1')]={'name':{'type':Sequelize[_0x006f('0x2')]},'description':{'type':Sequelize[_0x006f('0x2')]},'ticketType':{'type':Sequelize[_0x006f('0x3')](_0x006f('0x4'),_0x006f('0x5')),'defaultValue':_0x006f('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 94831c3..5319641 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 _0xf79b=['../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','info','result','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','sendStatus','stack','name','send','index','map','Dynamics365Configuration','type','key','query','keys','filters','model','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','attributes','find','create','body','getFields','nolimit','getSubjects','getDescriptions','findOne','Dynamics365Field','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x46c42d,_0x42074b){var _0x376aa8=function(_0x191c2d){while(--_0x191c2d){_0x46c42d['push'](_0x46c42d['shift']());}};_0x376aa8(++_0x42074b);}(_0xf79b,0xa0));var _0xbf79=function(_0xcfdfeb,_0x46203b){_0xcfdfeb=_0xcfdfeb-0x0;var _0x5027a8=_0xf79b[_0xcfdfeb];return _0x5027a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf79('0x0'));var zipdir=require(_0xbf79('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf79('0x2'));var moment=require(_0xbf79('0x3'));var BPromise=require(_0xbf79('0x4'));var Mustache=require('mustache');var util=require(_0xbf79('0x5'));var path=require(_0xbf79('0x6'));var sox=require(_0xbf79('0x7'));var csv=require(_0xbf79('0x8'));var ejs=require(_0xbf79('0x9'));var fs=require('fs');var fs_extra=require(_0xbf79('0xa'));var _=require(_0xbf79('0xb'));var squel=require(_0xbf79('0xc'));var crypto=require('crypto');var jsforce=require(_0xbf79('0xd'));var deskjs=require(_0xbf79('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbf79('0xf'));var Papa=require('papaparse');var Redis=require(_0xbf79('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbf79('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf79('0x12'))(_0xbf79('0x13'));var utils=require(_0xbf79('0x14'));var config=require(_0xbf79('0x15'));var licenseUtil=require(_0xbf79('0x16'));var db=require(_0xbf79('0x17'))['db'];var jayson=require(_0xbf79('0x18'));var client=jayson[_0xbf79('0x19')][_0xbf79('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xa36c06,_0x1eb9ef,_0x97f300,_0x23fe13){return new BPromise(function(_0x26ea5f,_0x47cc95){var _0x3ca33b=_0x23fe13||client;return _0x3ca33b[_0xbf79('0x1b')](_0xa36c06,_0x97f300)[_0xbf79('0x1c')](function(_0x3b88dc){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x1eb9ef,_0xbf79('0x1d'));logger['debug'](_0xbf79('0x1e'),_0x1eb9ef,_0xbf79('0x1d'),JSON[_0xbf79('0x1f')](_0x3b88dc));if(_0x3b88dc['error']){if(_0x3b88dc[_0xbf79('0x20')][_0xbf79('0x21')]===0x1f4){logger[_0xbf79('0x20')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1eb9ef,_0x3b88dc[_0xbf79('0x20')][_0xbf79('0x22')]);return _0x47cc95(_0x3b88dc[_0xbf79('0x20')][_0xbf79('0x22')]);}logger[_0xbf79('0x20')](_0xbf79('0x23'),_0x1eb9ef,_0x3b88dc[_0xbf79('0x20')][_0xbf79('0x22')]);return _0x26ea5f(_0x3b88dc[_0xbf79('0x20')][_0xbf79('0x22')]);}else{logger[_0xbf79('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1eb9ef,_0xbf79('0x1d'));_0x26ea5f(_0x3b88dc[_0xbf79('0x25')][_0xbf79('0x22')]);}})['catch'](function(_0x4e0907){logger[_0xbf79('0x20')](_0xbf79('0x23'),_0x1eb9ef,_0x4e0907);_0x47cc95(_0x4e0907);});});}function respondWithStatusCode(_0x5badd1,_0x4ed375){_0x4ed375=_0x4ed375||0xcc;return function(_0x187a86){if(_0x187a86){return _0x5badd1['sendStatus'](_0x4ed375);}return _0x5badd1[_0xbf79('0x26')](_0x4ed375)[_0xbf79('0x27')]();};}function respondWithResult(_0x1fb682,_0x143e96){_0x143e96=_0x143e96||0xc8;return function(_0x41146b){if(_0x41146b){return _0x1fb682['status'](_0x143e96)[_0xbf79('0x28')](_0x41146b);}};}function respondWithFilteredResult(_0x5ba540,_0x49f57d){return function(_0x36f889){if(_0x36f889){var _0x4db121=_0x36f889[_0xbf79('0x29')],_0x1317c0=_0x49f57d['offset'],_0x1c03b7=_0x49f57d[_0xbf79('0x2a')]+_0x49f57d[_0xbf79('0x2b')],_0x50bc5f;if(_0x1c03b7>=_0x4db121){_0x1c03b7=_0x4db121;_0x50bc5f=0xc8;}else{_0x50bc5f=0xce;}_0x5ba540[_0xbf79('0x26')](_0x50bc5f);return _0x5ba540[_0xbf79('0x2c')](_0xbf79('0x2d'),_0x1317c0+'-'+_0x1c03b7+'/'+_0x4db121)['json'](_0x36f889);}return null;};}function patchUpdates(_0x5e11ad){return function(_0x3c4c5f){try{jsonpatch[_0xbf79('0x2e')](_0x3c4c5f,_0x5e11ad,!![]);}catch(_0x2bbf5c){return BPromise['reject'](_0x2bbf5c);}return _0x3c4c5f['save']();};}function saveUpdates(_0xf7e3eb,_0x227a84){return function(_0x34b4a4){if(_0x34b4a4){return _0x34b4a4[_0xbf79('0x2f')](_0xf7e3eb)[_0xbf79('0x1c')](function(_0x2d0575){return _0x2d0575;});}return null;};}function removeEntity(_0x1461bf,_0x400e7e){return function(_0xa669de){if(_0xa669de){return _0xa669de[_0xbf79('0x30')]()[_0xbf79('0x1c')](function(){_0x1461bf[_0xbf79('0x26')](0xcc)[_0xbf79('0x27')]();});}};}function handleEntityNotFound(_0x446dc3,_0x1ac0fb){return function(_0x3f49e3){if(!_0x3f49e3){_0x446dc3[_0xbf79('0x31')](0x194);}return _0x3f49e3;};}function handleError(_0x3a8dee,_0x659912){_0x659912=_0x659912||0x1f4;return function(_0x3a2422){logger[_0xbf79('0x20')](_0x3a2422[_0xbf79('0x32')]);if(_0x3a2422[_0xbf79('0x33')]){delete _0x3a2422['name'];}_0x3a8dee[_0xbf79('0x26')](_0x659912)[_0xbf79('0x34')](_0x3a2422);};}exports[_0xbf79('0x35')]=function(_0x33c930,_0x2e1e5b){var _0x31a75b={},_0x361705={},_0x4121fc={'count':0x0,'rows':[]};var _0x484662=_[_0xbf79('0x36')](db[_0xbf79('0x37')]['rawAttributes'],function(_0x571db8){return{'name':_0x571db8['fieldName'],'type':_0x571db8[_0xbf79('0x38')][_0xbf79('0x39')]};});_0x361705['model']=_['map'](_0x484662,_0xbf79('0x33'));_0x361705[_0xbf79('0x3a')]=_[_0xbf79('0x3b')](_0x33c930[_0xbf79('0x3a')]);_0x361705[_0xbf79('0x3c')]=_['intersection'](_0x361705[_0xbf79('0x3d')],_0x361705[_0xbf79('0x3a')]);_0x31a75b['attributes']=_[_0xbf79('0x3e')](_0x361705[_0xbf79('0x3d')],qs['fields'](_0x33c930[_0xbf79('0x3a')][_0xbf79('0x3f')]));_0x31a75b['attributes']=_0x31a75b['attributes'][_0xbf79('0x40')]?_0x31a75b['attributes']:_0x361705['model'];if(!_0x33c930[_0xbf79('0x3a')][_0xbf79('0x41')]('nolimit')){_0x31a75b[_0xbf79('0x2b')]=qs[_0xbf79('0x2b')](_0x33c930[_0xbf79('0x3a')][_0xbf79('0x2b')]);_0x31a75b[_0xbf79('0x2a')]=qs[_0xbf79('0x2a')](_0x33c930[_0xbf79('0x3a')][_0xbf79('0x2a')]);}_0x31a75b[_0xbf79('0x42')]=qs[_0xbf79('0x43')](_0x33c930[_0xbf79('0x3a')][_0xbf79('0x43')]);_0x31a75b[_0xbf79('0x44')]=qs[_0xbf79('0x3c')](_[_0xbf79('0x45')](_0x33c930[_0xbf79('0x3a')],_0x361705['filters']),_0x484662);if(_0x33c930[_0xbf79('0x3a')][_0xbf79('0x46')]){_0x31a75b[_0xbf79('0x44')]=_[_0xbf79('0x47')](_0x31a75b[_0xbf79('0x44')],{'$or':_[_0xbf79('0x36')](_0x484662,function(_0x43641b){if(_0x43641b['type']!==_0xbf79('0x48')){var _0x4b2405={};_0x4b2405[_0x43641b['name']]={'$like':'%'+_0x33c930[_0xbf79('0x3a')][_0xbf79('0x46')]+'%'};return _0x4b2405;}})});}_0x31a75b=_[_0xbf79('0x47')]({},_0x31a75b,_0x33c930[_0xbf79('0x49')]);var _0x482fcb={'where':_0x31a75b[_0xbf79('0x44')]};return db[_0xbf79('0x37')]['count'](_0x482fcb)[_0xbf79('0x1c')](function(_0x1e55e0){_0x4121fc[_0xbf79('0x29')]=_0x1e55e0;if(_0x33c930[_0xbf79('0x3a')][_0xbf79('0x4a')]){_0x31a75b['include']=[{'all':!![]}];}return db[_0xbf79('0x37')][_0xbf79('0x4b')](_0x31a75b);})['then'](function(_0xb18da6){_0x4121fc[_0xbf79('0x4c')]=_0xb18da6;return _0x4121fc;})[_0xbf79('0x1c')](respondWithFilteredResult(_0x2e1e5b,_0x31a75b))[_0xbf79('0x4d')](handleError(_0x2e1e5b,null));};exports[_0xbf79('0x4e')]=function(_0x51ae9e,_0x5c999d){var _0x1258f6={'raw':![],'where':{'id':_0x51ae9e[_0xbf79('0x4f')]['id']}},_0x1ef09d={};_0x1ef09d['model']=_[_0xbf79('0x3b')](db[_0xbf79('0x37')][_0xbf79('0x50')]);_0x1ef09d[_0xbf79('0x3a')]=_[_0xbf79('0x3b')](_0x51ae9e[_0xbf79('0x3a')]);_0x1ef09d['filters']=_['intersection'](_0x1ef09d[_0xbf79('0x3d')],_0x1ef09d[_0xbf79('0x3a')]);_0x1258f6[_0xbf79('0x51')]=_['intersection'](_0x1ef09d[_0xbf79('0x3d')],qs[_0xbf79('0x3f')](_0x51ae9e[_0xbf79('0x3a')]['fields']));_0x1258f6[_0xbf79('0x51')]=_0x1258f6[_0xbf79('0x51')][_0xbf79('0x40')]?_0x1258f6['attributes']:_0x1ef09d[_0xbf79('0x3d')];if(_0x51ae9e['query'][_0xbf79('0x4a')]){_0x1258f6['include']=[{'all':!![]}];}_0x1258f6=_['merge']({},_0x1258f6,_0x51ae9e[_0xbf79('0x49')]);return db['Dynamics365Configuration'][_0xbf79('0x52')](_0x1258f6)[_0xbf79('0x1c')](handleEntityNotFound(_0x5c999d,null))[_0xbf79('0x1c')](respondWithResult(_0x5c999d,null))[_0xbf79('0x4d')](handleError(_0x5c999d,null));};exports['create']=function(_0x2c302b,_0x26fd8f){return db[_0xbf79('0x37')][_0xbf79('0x53')](_0x2c302b[_0xbf79('0x54')],{})[_0xbf79('0x1c')](respondWithResult(_0x26fd8f,0xc9))[_0xbf79('0x4d')](handleError(_0x26fd8f,null));};exports['update']=function(_0xd6dcac,_0x25fbdc){if(_0xd6dcac[_0xbf79('0x54')]['id']){delete _0xd6dcac[_0xbf79('0x54')]['id'];}return db[_0xbf79('0x37')]['find']({'where':{'id':_0xd6dcac[_0xbf79('0x4f')]['id']}})[_0xbf79('0x1c')](handleEntityNotFound(_0x25fbdc,null))[_0xbf79('0x1c')](saveUpdates(_0xd6dcac[_0xbf79('0x54')],null))[_0xbf79('0x1c')](respondWithResult(_0x25fbdc,null))[_0xbf79('0x4d')](handleError(_0x25fbdc,null));};exports['destroy']=function(_0x526d8c,_0x5872a6){return db['Dynamics365Configuration'][_0xbf79('0x52')]({'where':{'id':_0x526d8c[_0xbf79('0x4f')]['id']}})[_0xbf79('0x1c')](handleEntityNotFound(_0x5872a6,null))[_0xbf79('0x1c')](removeEntity(_0x5872a6,null))[_0xbf79('0x4d')](handleError(_0x5872a6,null));};exports[_0xbf79('0x55')]=function(_0x2ca011,_0x15d6db,_0x4625b8){var _0x277a2d={};var _0x4a5863={};var _0x1ef495;var _0x241b1b;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2ca011[_0xbf79('0x4f')]['id']}})[_0xbf79('0x1c')](handleEntityNotFound(_0x15d6db,null))[_0xbf79('0x1c')](function(_0x59de2a){if(_0x59de2a){_0x1ef495=_0x59de2a;_0x4a5863[_0xbf79('0x3d')]=_[_0xbf79('0x3b')](db['Dynamics365Field'][_0xbf79('0x50')]);_0x4a5863[_0xbf79('0x3a')]=_['keys'](_0x2ca011['query']);_0x4a5863['filters']=_[_0xbf79('0x3e')](_0x4a5863[_0xbf79('0x3d')],_0x4a5863[_0xbf79('0x3a')]);_0x277a2d[_0xbf79('0x51')]=_[_0xbf79('0x3e')](_0x4a5863['model'],qs[_0xbf79('0x3f')](_0x2ca011[_0xbf79('0x3a')][_0xbf79('0x3f')]));_0x277a2d[_0xbf79('0x51')]=_0x277a2d[_0xbf79('0x51')][_0xbf79('0x40')]?_0x277a2d[_0xbf79('0x51')]:_0x4a5863[_0xbf79('0x3d')];_0x277a2d['order']=qs[_0xbf79('0x43')](_0x2ca011['query']['sort']);_0x277a2d[_0xbf79('0x44')]=qs[_0xbf79('0x3c')](_[_0xbf79('0x45')](_0x2ca011[_0xbf79('0x3a')],_0x4a5863['filters']));if(_0x2ca011[_0xbf79('0x3a')][_0xbf79('0x46')]){_0x277a2d[_0xbf79('0x44')]=_[_0xbf79('0x47')](_0x277a2d[_0xbf79('0x44')],{'$or':_[_0xbf79('0x36')](_0x277a2d[_0xbf79('0x51')],function(_0x235cee){var _0x49a56e={};_0x49a56e[_0x235cee]={'$like':'%'+_0x2ca011[_0xbf79('0x3a')]['filter']+'%'};return _0x49a56e;})});}_0x277a2d=_['merge']({},_0x277a2d,_0x2ca011['options']);return _0x1ef495[_0xbf79('0x55')](_0x277a2d);}})[_0xbf79('0x1c')](function(_0x17884c){if(_0x17884c){_0x241b1b=_0x17884c['length'];if(!_0x2ca011[_0xbf79('0x3a')][_0xbf79('0x41')](_0xbf79('0x56'))){_0x277a2d[_0xbf79('0x2b')]=qs[_0xbf79('0x2b')](_0x2ca011[_0xbf79('0x3a')]['limit']);_0x277a2d[_0xbf79('0x2a')]=qs['offset'](_0x2ca011['query']['offset']);}return _0x1ef495[_0xbf79('0x55')](_0x277a2d);}})[_0xbf79('0x1c')](function(_0x130bf5){if(_0x130bf5){return _0x130bf5?{'count':_0x241b1b,'rows':_0x130bf5}:null;}})[_0xbf79('0x1c')](respondWithResult(_0x15d6db,null))[_0xbf79('0x4d')](handleError(_0x15d6db,null));};exports['getSubjects']=function(_0x217ab6,_0x5b3a3a,_0x485cd6){var _0x5934f1={};var _0x4bd678={};var _0x248031;var _0x4e3417;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x217ab6[_0xbf79('0x4f')]['id']}})[_0xbf79('0x1c')](handleEntityNotFound(_0x5b3a3a,null))[_0xbf79('0x1c')](function(_0x3747f6){if(_0x3747f6){_0x248031=_0x3747f6;_0x4bd678[_0xbf79('0x3d')]=_[_0xbf79('0x3b')](db['Dynamics365Field'][_0xbf79('0x50')]);_0x4bd678['query']=_['keys'](_0x217ab6[_0xbf79('0x3a')]);_0x4bd678[_0xbf79('0x3c')]=_['intersection'](_0x4bd678[_0xbf79('0x3d')],_0x4bd678[_0xbf79('0x3a')]);_0x5934f1[_0xbf79('0x51')]=_[_0xbf79('0x3e')](_0x4bd678[_0xbf79('0x3d')],qs[_0xbf79('0x3f')](_0x217ab6['query'][_0xbf79('0x3f')]));_0x5934f1[_0xbf79('0x51')]=_0x5934f1[_0xbf79('0x51')][_0xbf79('0x40')]?_0x5934f1[_0xbf79('0x51')]:_0x4bd678[_0xbf79('0x3d')];_0x5934f1[_0xbf79('0x42')]=qs[_0xbf79('0x43')](_0x217ab6[_0xbf79('0x3a')][_0xbf79('0x43')]);_0x5934f1[_0xbf79('0x44')]=qs['filters'](_[_0xbf79('0x45')](_0x217ab6[_0xbf79('0x3a')],_0x4bd678[_0xbf79('0x3c')]));if(_0x217ab6['query'][_0xbf79('0x46')]){_0x5934f1[_0xbf79('0x44')]=_[_0xbf79('0x47')](_0x5934f1[_0xbf79('0x44')],{'$or':_[_0xbf79('0x36')](_0x5934f1[_0xbf79('0x51')],function(_0x15e161){var _0x4ba8a4={};_0x4ba8a4[_0x15e161]={'$like':'%'+_0x217ab6[_0xbf79('0x3a')][_0xbf79('0x46')]+'%'};return _0x4ba8a4;})});}_0x5934f1=_[_0xbf79('0x47')]({},_0x5934f1,_0x217ab6[_0xbf79('0x49')]);return _0x248031[_0xbf79('0x57')](_0x5934f1);}})[_0xbf79('0x1c')](function(_0x2a78b3){if(_0x2a78b3){_0x4e3417=_0x2a78b3[_0xbf79('0x40')];if(!_0x217ab6['query'][_0xbf79('0x41')](_0xbf79('0x56'))){_0x5934f1[_0xbf79('0x2b')]=qs[_0xbf79('0x2b')](_0x217ab6[_0xbf79('0x3a')][_0xbf79('0x2b')]);_0x5934f1[_0xbf79('0x2a')]=qs['offset'](_0x217ab6[_0xbf79('0x3a')][_0xbf79('0x2a')]);}return _0x248031[_0xbf79('0x57')](_0x5934f1);}})[_0xbf79('0x1c')](function(_0x1fbd75){if(_0x1fbd75){return _0x1fbd75?{'count':_0x4e3417,'rows':_0x1fbd75}:null;}})[_0xbf79('0x1c')](respondWithResult(_0x5b3a3a,null))[_0xbf79('0x4d')](handleError(_0x5b3a3a,null));};exports[_0xbf79('0x58')]=function(_0x44b647,_0x46b4c8,_0x16f122){var _0x229c73={};var _0x357b9b={};var _0x3a80fa;var _0x49c2c1;return db[_0xbf79('0x37')][_0xbf79('0x59')]({'where':{'id':_0x44b647[_0xbf79('0x4f')]['id']}})[_0xbf79('0x1c')](handleEntityNotFound(_0x46b4c8,null))[_0xbf79('0x1c')](function(_0x59d491){if(_0x59d491){_0x3a80fa=_0x59d491;_0x357b9b[_0xbf79('0x3d')]=_[_0xbf79('0x3b')](db[_0xbf79('0x5a')][_0xbf79('0x50')]);_0x357b9b[_0xbf79('0x3a')]=_[_0xbf79('0x3b')](_0x44b647[_0xbf79('0x3a')]);_0x357b9b['filters']=_[_0xbf79('0x3e')](_0x357b9b[_0xbf79('0x3d')],_0x357b9b['query']);_0x229c73['attributes']=_[_0xbf79('0x3e')](_0x357b9b[_0xbf79('0x3d')],qs[_0xbf79('0x3f')](_0x44b647[_0xbf79('0x3a')]['fields']));_0x229c73[_0xbf79('0x51')]=_0x229c73[_0xbf79('0x51')][_0xbf79('0x40')]?_0x229c73[_0xbf79('0x51')]:_0x357b9b[_0xbf79('0x3d')];_0x229c73[_0xbf79('0x42')]=qs[_0xbf79('0x43')](_0x44b647[_0xbf79('0x3a')][_0xbf79('0x43')]);_0x229c73[_0xbf79('0x44')]=qs[_0xbf79('0x3c')](_[_0xbf79('0x45')](_0x44b647[_0xbf79('0x3a')],_0x357b9b[_0xbf79('0x3c')]));if(_0x44b647['query'][_0xbf79('0x46')]){_0x229c73[_0xbf79('0x44')]=_[_0xbf79('0x47')](_0x229c73[_0xbf79('0x44')],{'$or':_['map'](_0x229c73[_0xbf79('0x51')],function(_0x32434c){var _0x5ba5df={};_0x5ba5df[_0x32434c]={'$like':'%'+_0x44b647[_0xbf79('0x3a')][_0xbf79('0x46')]+'%'};return _0x5ba5df;})});}_0x229c73=_[_0xbf79('0x47')]({},_0x229c73,_0x44b647['options']);return _0x3a80fa['getDescriptions'](_0x229c73);}})[_0xbf79('0x1c')](function(_0x58555e){if(_0x58555e){_0x49c2c1=_0x58555e['length'];if(!_0x44b647['query']['hasOwnProperty'](_0xbf79('0x56'))){_0x229c73[_0xbf79('0x2b')]=qs[_0xbf79('0x2b')](_0x44b647['query']['limit']);_0x229c73['offset']=qs[_0xbf79('0x2a')](_0x44b647[_0xbf79('0x3a')]['offset']);}return _0x3a80fa[_0xbf79('0x58')](_0x229c73);}})[_0xbf79('0x1c')](function(_0x20993d){if(_0x20993d){return _0x20993d?{'count':_0x49c2c1,'rows':_0x20993d}:null;}})['then'](respondWithResult(_0x46b4c8,null))[_0xbf79('0x4d')](handleError(_0x46b4c8,null));}; \ No newline at end of file +var _0xa902=['end','json','offset','set','Content-Range','reject','save','update','destroy','then','stack','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','keys','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','create','body','find','getFields','findOne','Dynamics365Field','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status'];(function(_0x3edffb,_0x1a5860){var _0x5cec47=function(_0x1e4373){while(--_0x1e4373){_0x3edffb['push'](_0x3edffb['shift']());}};_0x5cec47(++_0x1a5860);}(_0xa902,0x8d));var _0x2a90=function(_0x400794,_0x35e792){_0x400794=_0x400794-0x0;var _0x148aec=_0xa902[_0x400794];return _0x148aec;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a90('0x6'));var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require(_0x2a90('0xa'));var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x8'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var Redis=require(_0x2a90('0xf'));var authService=require(_0x2a90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a90('0x11'));var hardwareService=require(_0x2a90('0x12'));var logger=require(_0x2a90('0x13'))(_0x2a90('0x14'));var utils=require('../../config/utils');var config=require(_0x2a90('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a90('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2a90('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x407ce5,_0x30e166,_0x113912,_0x4c328b){return new BPromise(function(_0x56d1b8,_0x57227c){var _0x46cb32=_0x4c328b||client;return _0x46cb32[_0x2a90('0x18')](_0x407ce5,_0x113912)['then'](function(_0x1ff63d){logger[_0x2a90('0x19')](_0x2a90('0x1a'),_0x30e166,_0x2a90('0x1b'));logger[_0x2a90('0x1c')](_0x2a90('0x1d'),_0x30e166,_0x2a90('0x1b'),JSON[_0x2a90('0x1e')](_0x1ff63d));if(_0x1ff63d[_0x2a90('0x1f')]){if(_0x1ff63d['error'][_0x2a90('0x20')]===0x1f4){logger[_0x2a90('0x1f')](_0x2a90('0x1a'),_0x30e166,_0x1ff63d['error'][_0x2a90('0x21')]);return _0x57227c(_0x1ff63d[_0x2a90('0x1f')][_0x2a90('0x21')]);}logger[_0x2a90('0x1f')](_0x2a90('0x1a'),_0x30e166,_0x1ff63d[_0x2a90('0x1f')][_0x2a90('0x21')]);return _0x56d1b8(_0x1ff63d[_0x2a90('0x1f')][_0x2a90('0x21')]);}else{logger[_0x2a90('0x19')](_0x2a90('0x1a'),_0x30e166,_0x2a90('0x1b'));_0x56d1b8(_0x1ff63d['result'][_0x2a90('0x21')]);}})[_0x2a90('0x22')](function(_0x2955a9){logger[_0x2a90('0x1f')]('Dynamics365Configuration,\x20%s,\x20%s',_0x30e166,_0x2955a9);_0x57227c(_0x2955a9);});});}function respondWithStatusCode(_0x180485,_0xd033d){_0xd033d=_0xd033d||0xcc;return function(_0x4ed9e6){if(_0x4ed9e6){return _0x180485[_0x2a90('0x23')](_0xd033d);}return _0x180485[_0x2a90('0x24')](_0xd033d)[_0x2a90('0x25')]();};}function respondWithResult(_0x2a4e28,_0x2a212c){_0x2a212c=_0x2a212c||0xc8;return function(_0x1303d9){if(_0x1303d9){return _0x2a4e28[_0x2a90('0x24')](_0x2a212c)[_0x2a90('0x26')](_0x1303d9);}};}function respondWithFilteredResult(_0x48c2f9,_0x27f883){return function(_0x17f978){if(_0x17f978){var _0x3934d4=_0x17f978['count'],_0x40c61a=_0x27f883[_0x2a90('0x27')],_0x8544e5=_0x27f883['offset']+_0x27f883['limit'],_0x5208d8;if(_0x8544e5>=_0x3934d4){_0x8544e5=_0x3934d4;_0x5208d8=0xc8;}else{_0x5208d8=0xce;}_0x48c2f9['status'](_0x5208d8);return _0x48c2f9[_0x2a90('0x28')](_0x2a90('0x29'),_0x40c61a+'-'+_0x8544e5+'/'+_0x3934d4)['json'](_0x17f978);}return null;};}function patchUpdates(_0x5bd700){return function(_0x1add9a){try{jsonpatch['apply'](_0x1add9a,_0x5bd700,!![]);}catch(_0x35570e){return BPromise[_0x2a90('0x2a')](_0x35570e);}return _0x1add9a[_0x2a90('0x2b')]();};}function saveUpdates(_0x27b6b6,_0xf18d11){return function(_0x11586c){if(_0x11586c){return _0x11586c[_0x2a90('0x2c')](_0x27b6b6)['then'](function(_0x427918){return _0x427918;});}return null;};}function removeEntity(_0x22b1f3,_0xfa5ce8){return function(_0x5cdeb4){if(_0x5cdeb4){return _0x5cdeb4[_0x2a90('0x2d')]()[_0x2a90('0x2e')](function(){_0x22b1f3[_0x2a90('0x24')](0xcc)[_0x2a90('0x25')]();});}};}function handleEntityNotFound(_0x4f8316,_0x44899d){return function(_0x1b5f73){if(!_0x1b5f73){_0x4f8316[_0x2a90('0x23')](0x194);}return _0x1b5f73;};}function handleError(_0x38158b,_0x129d6e){_0x129d6e=_0x129d6e||0x1f4;return function(_0x431942){logger['error'](_0x431942[_0x2a90('0x2f')]);if(_0x431942[_0x2a90('0x30')]){delete _0x431942[_0x2a90('0x30')];}_0x38158b[_0x2a90('0x24')](_0x129d6e)['send'](_0x431942);};}exports[_0x2a90('0x31')]=function(_0x27e2f0,_0x4a8870){var _0x3e5002={},_0x1410eb={},_0x4bcfb5={'count':0x0,'rows':[]};var _0x5073a4=_[_0x2a90('0x32')](db[_0x2a90('0x33')][_0x2a90('0x34')],function(_0x4cd36c){return{'name':_0x4cd36c[_0x2a90('0x35')],'type':_0x4cd36c['type'][_0x2a90('0x36')]};});_0x1410eb['model']=_[_0x2a90('0x32')](_0x5073a4,'name');_0x1410eb['query']=_[_0x2a90('0x37')](_0x27e2f0['query']);_0x1410eb[_0x2a90('0x38')]=_[_0x2a90('0x39')](_0x1410eb[_0x2a90('0x3a')],_0x1410eb['query']);_0x3e5002[_0x2a90('0x3b')]=_[_0x2a90('0x39')](_0x1410eb[_0x2a90('0x3a')],qs['fields'](_0x27e2f0[_0x2a90('0x3c')][_0x2a90('0x3d')]));_0x3e5002[_0x2a90('0x3b')]=_0x3e5002['attributes'][_0x2a90('0x3e')]?_0x3e5002[_0x2a90('0x3b')]:_0x1410eb['model'];if(!_0x27e2f0[_0x2a90('0x3c')][_0x2a90('0x3f')](_0x2a90('0x40'))){_0x3e5002[_0x2a90('0x41')]=qs[_0x2a90('0x41')](_0x27e2f0[_0x2a90('0x3c')][_0x2a90('0x41')]);_0x3e5002[_0x2a90('0x27')]=qs[_0x2a90('0x27')](_0x27e2f0[_0x2a90('0x3c')][_0x2a90('0x27')]);}_0x3e5002[_0x2a90('0x42')]=qs[_0x2a90('0x43')](_0x27e2f0[_0x2a90('0x3c')]['sort']);_0x3e5002[_0x2a90('0x44')]=qs[_0x2a90('0x38')](_['pick'](_0x27e2f0[_0x2a90('0x3c')],_0x1410eb[_0x2a90('0x38')]),_0x5073a4);if(_0x27e2f0[_0x2a90('0x3c')][_0x2a90('0x45')]){_0x3e5002[_0x2a90('0x44')]=_['merge'](_0x3e5002[_0x2a90('0x44')],{'$or':_['map'](_0x5073a4,function(_0x4566a6){if(_0x4566a6['type']!==_0x2a90('0x46')){var _0x19d268={};_0x19d268[_0x4566a6[_0x2a90('0x30')]]={'$like':'%'+_0x27e2f0[_0x2a90('0x3c')][_0x2a90('0x45')]+'%'};return _0x19d268;}})});}_0x3e5002=_[_0x2a90('0x47')]({},_0x3e5002,_0x27e2f0[_0x2a90('0x48')]);var _0x48d464={'where':_0x3e5002['where']};return db[_0x2a90('0x33')][_0x2a90('0x49')](_0x48d464)[_0x2a90('0x2e')](function(_0x28944c){_0x4bcfb5[_0x2a90('0x49')]=_0x28944c;if(_0x27e2f0[_0x2a90('0x3c')][_0x2a90('0x4a')]){_0x3e5002[_0x2a90('0x4b')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x2a90('0x4c')](_0x3e5002);})['then'](function(_0x3e0380){_0x4bcfb5[_0x2a90('0x4d')]=_0x3e0380;return _0x4bcfb5;})['then'](respondWithFilteredResult(_0x4a8870,_0x3e5002))[_0x2a90('0x22')](handleError(_0x4a8870,null));};exports[_0x2a90('0x4e')]=function(_0x280e63,_0x1d55db){var _0x175d59={'raw':![],'where':{'id':_0x280e63[_0x2a90('0x4f')]['id']}},_0x43a931={};_0x43a931['model']=_['keys'](db[_0x2a90('0x33')][_0x2a90('0x34')]);_0x43a931[_0x2a90('0x3c')]=_[_0x2a90('0x37')](_0x280e63[_0x2a90('0x3c')]);_0x43a931['filters']=_['intersection'](_0x43a931[_0x2a90('0x3a')],_0x43a931[_0x2a90('0x3c')]);_0x175d59['attributes']=_['intersection'](_0x43a931['model'],qs[_0x2a90('0x3d')](_0x280e63['query'][_0x2a90('0x3d')]));_0x175d59[_0x2a90('0x3b')]=_0x175d59[_0x2a90('0x3b')][_0x2a90('0x3e')]?_0x175d59[_0x2a90('0x3b')]:_0x43a931[_0x2a90('0x3a')];if(_0x280e63['query'][_0x2a90('0x4a')]){_0x175d59[_0x2a90('0x4b')]=[{'all':!![]}];}_0x175d59=_['merge']({},_0x175d59,_0x280e63[_0x2a90('0x48')]);return db['Dynamics365Configuration']['find'](_0x175d59)[_0x2a90('0x2e')](handleEntityNotFound(_0x1d55db,null))[_0x2a90('0x2e')](respondWithResult(_0x1d55db,null))['catch'](handleError(_0x1d55db,null));};exports['create']=function(_0x2dd550,_0x5951eb){return db[_0x2a90('0x33')][_0x2a90('0x50')](_0x2dd550['body'],{})[_0x2a90('0x2e')](respondWithResult(_0x5951eb,0xc9))[_0x2a90('0x22')](handleError(_0x5951eb,null));};exports[_0x2a90('0x2c')]=function(_0x52f2ca,_0x44b3eb){if(_0x52f2ca[_0x2a90('0x51')]['id']){delete _0x52f2ca['body']['id'];}return db['Dynamics365Configuration'][_0x2a90('0x52')]({'where':{'id':_0x52f2ca[_0x2a90('0x4f')]['id']}})['then'](handleEntityNotFound(_0x44b3eb,null))[_0x2a90('0x2e')](saveUpdates(_0x52f2ca['body'],null))[_0x2a90('0x2e')](respondWithResult(_0x44b3eb,null))['catch'](handleError(_0x44b3eb,null));};exports[_0x2a90('0x2d')]=function(_0x1c8bbf,_0x25b1ca){return db['Dynamics365Configuration']['find']({'where':{'id':_0x1c8bbf['params']['id']}})[_0x2a90('0x2e')](handleEntityNotFound(_0x25b1ca,null))[_0x2a90('0x2e')](removeEntity(_0x25b1ca,null))[_0x2a90('0x22')](handleError(_0x25b1ca,null));};exports[_0x2a90('0x53')]=function(_0x2e5762,_0x1f08d4,_0x5148ce){var _0x37f34b={};var _0x69c213={};var _0x4f4dc6;var _0x18bb86;return db[_0x2a90('0x33')][_0x2a90('0x54')]({'where':{'id':_0x2e5762['params']['id']}})['then'](handleEntityNotFound(_0x1f08d4,null))['then'](function(_0x3550c1){if(_0x3550c1){_0x4f4dc6=_0x3550c1;_0x69c213[_0x2a90('0x3a')]=_[_0x2a90('0x37')](db[_0x2a90('0x55')][_0x2a90('0x34')]);_0x69c213[_0x2a90('0x3c')]=_[_0x2a90('0x37')](_0x2e5762[_0x2a90('0x3c')]);_0x69c213[_0x2a90('0x38')]=_[_0x2a90('0x39')](_0x69c213[_0x2a90('0x3a')],_0x69c213[_0x2a90('0x3c')]);_0x37f34b[_0x2a90('0x3b')]=_[_0x2a90('0x39')](_0x69c213[_0x2a90('0x3a')],qs[_0x2a90('0x3d')](_0x2e5762['query'][_0x2a90('0x3d')]));_0x37f34b['attributes']=_0x37f34b[_0x2a90('0x3b')][_0x2a90('0x3e')]?_0x37f34b[_0x2a90('0x3b')]:_0x69c213[_0x2a90('0x3a')];_0x37f34b[_0x2a90('0x42')]=qs[_0x2a90('0x43')](_0x2e5762[_0x2a90('0x3c')]['sort']);_0x37f34b[_0x2a90('0x44')]=qs[_0x2a90('0x38')](_[_0x2a90('0x56')](_0x2e5762['query'],_0x69c213[_0x2a90('0x38')]));if(_0x2e5762[_0x2a90('0x3c')][_0x2a90('0x45')]){_0x37f34b[_0x2a90('0x44')]=_['merge'](_0x37f34b[_0x2a90('0x44')],{'$or':_['map'](_0x37f34b[_0x2a90('0x3b')],function(_0x94e9fb){var _0x368ec6={};_0x368ec6[_0x94e9fb]={'$like':'%'+_0x2e5762[_0x2a90('0x3c')][_0x2a90('0x45')]+'%'};return _0x368ec6;})});}_0x37f34b=_[_0x2a90('0x47')]({},_0x37f34b,_0x2e5762['options']);return _0x4f4dc6[_0x2a90('0x53')](_0x37f34b);}})[_0x2a90('0x2e')](function(_0x120c17){if(_0x120c17){_0x18bb86=_0x120c17[_0x2a90('0x3e')];if(!_0x2e5762[_0x2a90('0x3c')][_0x2a90('0x3f')](_0x2a90('0x40'))){_0x37f34b[_0x2a90('0x41')]=qs[_0x2a90('0x41')](_0x2e5762['query'][_0x2a90('0x41')]);_0x37f34b[_0x2a90('0x27')]=qs[_0x2a90('0x27')](_0x2e5762['query'][_0x2a90('0x27')]);}return _0x4f4dc6[_0x2a90('0x53')](_0x37f34b);}})[_0x2a90('0x2e')](function(_0x9030a1){if(_0x9030a1){return _0x9030a1?{'count':_0x18bb86,'rows':_0x9030a1}:null;}})[_0x2a90('0x2e')](respondWithResult(_0x1f08d4,null))['catch'](handleError(_0x1f08d4,null));};exports[_0x2a90('0x57')]=function(_0x5e0bf2,_0x5a770b,_0x9fafd){var _0x4e1dcd={};var _0x49dcda={};var _0x3b24ee;var _0x5f3ae1;return db[_0x2a90('0x33')][_0x2a90('0x54')]({'where':{'id':_0x5e0bf2['params']['id']}})['then'](handleEntityNotFound(_0x5a770b,null))[_0x2a90('0x2e')](function(_0x4eaacb){if(_0x4eaacb){_0x3b24ee=_0x4eaacb;_0x49dcda['model']=_[_0x2a90('0x37')](db[_0x2a90('0x55')][_0x2a90('0x34')]);_0x49dcda[_0x2a90('0x3c')]=_['keys'](_0x5e0bf2['query']);_0x49dcda[_0x2a90('0x38')]=_[_0x2a90('0x39')](_0x49dcda[_0x2a90('0x3a')],_0x49dcda[_0x2a90('0x3c')]);_0x4e1dcd[_0x2a90('0x3b')]=_[_0x2a90('0x39')](_0x49dcda[_0x2a90('0x3a')],qs[_0x2a90('0x3d')](_0x5e0bf2[_0x2a90('0x3c')][_0x2a90('0x3d')]));_0x4e1dcd[_0x2a90('0x3b')]=_0x4e1dcd[_0x2a90('0x3b')]['length']?_0x4e1dcd[_0x2a90('0x3b')]:_0x49dcda['model'];_0x4e1dcd[_0x2a90('0x42')]=qs['sort'](_0x5e0bf2[_0x2a90('0x3c')]['sort']);_0x4e1dcd['where']=qs[_0x2a90('0x38')](_[_0x2a90('0x56')](_0x5e0bf2[_0x2a90('0x3c')],_0x49dcda[_0x2a90('0x38')]));if(_0x5e0bf2['query']['filter']){_0x4e1dcd[_0x2a90('0x44')]=_[_0x2a90('0x47')](_0x4e1dcd[_0x2a90('0x44')],{'$or':_[_0x2a90('0x32')](_0x4e1dcd[_0x2a90('0x3b')],function(_0x3b0d5e){var _0xf7527e={};_0xf7527e[_0x3b0d5e]={'$like':'%'+_0x5e0bf2[_0x2a90('0x3c')][_0x2a90('0x45')]+'%'};return _0xf7527e;})});}_0x4e1dcd=_[_0x2a90('0x47')]({},_0x4e1dcd,_0x5e0bf2[_0x2a90('0x48')]);return _0x3b24ee[_0x2a90('0x57')](_0x4e1dcd);}})['then'](function(_0x324a72){if(_0x324a72){_0x5f3ae1=_0x324a72[_0x2a90('0x3e')];if(!_0x5e0bf2[_0x2a90('0x3c')][_0x2a90('0x3f')](_0x2a90('0x40'))){_0x4e1dcd[_0x2a90('0x41')]=qs[_0x2a90('0x41')](_0x5e0bf2[_0x2a90('0x3c')]['limit']);_0x4e1dcd[_0x2a90('0x27')]=qs[_0x2a90('0x27')](_0x5e0bf2['query'][_0x2a90('0x27')]);}return _0x3b24ee[_0x2a90('0x57')](_0x4e1dcd);}})[_0x2a90('0x2e')](function(_0xaf1b4a){if(_0xaf1b4a){return _0xaf1b4a?{'count':_0x5f3ae1,'rows':_0xaf1b4a}:null;}})[_0x2a90('0x2e')](respondWithResult(_0x5a770b,null))[_0x2a90('0x22')](handleError(_0x5a770b,null));};exports['getDescriptions']=function(_0x45ea35,_0x4123e9,_0x22edda){var _0x1c0aa6={};var _0x4695ee={};var _0x3ff142;var _0x106d31;return db[_0x2a90('0x33')]['findOne']({'where':{'id':_0x45ea35[_0x2a90('0x4f')]['id']}})[_0x2a90('0x2e')](handleEntityNotFound(_0x4123e9,null))[_0x2a90('0x2e')](function(_0x256346){if(_0x256346){_0x3ff142=_0x256346;_0x4695ee[_0x2a90('0x3a')]=_[_0x2a90('0x37')](db['Dynamics365Field'][_0x2a90('0x34')]);_0x4695ee[_0x2a90('0x3c')]=_[_0x2a90('0x37')](_0x45ea35['query']);_0x4695ee[_0x2a90('0x38')]=_[_0x2a90('0x39')](_0x4695ee[_0x2a90('0x3a')],_0x4695ee['query']);_0x1c0aa6['attributes']=_[_0x2a90('0x39')](_0x4695ee[_0x2a90('0x3a')],qs['fields'](_0x45ea35[_0x2a90('0x3c')][_0x2a90('0x3d')]));_0x1c0aa6['attributes']=_0x1c0aa6[_0x2a90('0x3b')][_0x2a90('0x3e')]?_0x1c0aa6['attributes']:_0x4695ee[_0x2a90('0x3a')];_0x1c0aa6[_0x2a90('0x42')]=qs['sort'](_0x45ea35['query'][_0x2a90('0x43')]);_0x1c0aa6[_0x2a90('0x44')]=qs[_0x2a90('0x38')](_[_0x2a90('0x56')](_0x45ea35[_0x2a90('0x3c')],_0x4695ee[_0x2a90('0x38')]));if(_0x45ea35[_0x2a90('0x3c')][_0x2a90('0x45')]){_0x1c0aa6[_0x2a90('0x44')]=_[_0x2a90('0x47')](_0x1c0aa6[_0x2a90('0x44')],{'$or':_['map'](_0x1c0aa6[_0x2a90('0x3b')],function(_0x42bac8){var _0x415b21={};_0x415b21[_0x42bac8]={'$like':'%'+_0x45ea35['query'][_0x2a90('0x45')]+'%'};return _0x415b21;})});}_0x1c0aa6=_[_0x2a90('0x47')]({},_0x1c0aa6,_0x45ea35[_0x2a90('0x48')]);return _0x3ff142['getDescriptions'](_0x1c0aa6);}})[_0x2a90('0x2e')](function(_0x11a311){if(_0x11a311){_0x106d31=_0x11a311[_0x2a90('0x3e')];if(!_0x45ea35[_0x2a90('0x3c')][_0x2a90('0x3f')](_0x2a90('0x40'))){_0x1c0aa6[_0x2a90('0x41')]=qs['limit'](_0x45ea35['query'][_0x2a90('0x41')]);_0x1c0aa6['offset']=qs[_0x2a90('0x27')](_0x45ea35[_0x2a90('0x3c')]['offset']);}return _0x3ff142[_0x2a90('0x58')](_0x1c0aa6);}})[_0x2a90('0x2e')](function(_0xa47128){if(_0xa47128){return _0xa47128?{'count':_0x106d31,'rows':_0xa47128}:null;}})[_0x2a90('0x2e')](respondWithResult(_0x4123e9,null))[_0x2a90('0x22')](handleError(_0x4123e9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 4b141e3..8b78d5b 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 _0x1fde=['bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','define','lodash','util','../../config/logger','moment'];(function(_0x5db98e,_0x571189){var _0x47f337=function(_0x2ef632){while(--_0x2ef632){_0x5db98e['push'](_0x5db98e['shift']());}};_0x47f337(++_0x571189);}(_0x1fde,0x74));var _0xe1fd=function(_0x54d49e,_0x5d9911){_0x54d49e=_0x54d49e-0x0;var _0x4af0f1=_0x1fde[_0x54d49e];return _0x4af0f1;};'use strict';var _=require(_0xe1fd('0x0'));var util=require(_0xe1fd('0x1'));var logger=require(_0xe1fd('0x2'))('api');var moment=require(_0xe1fd('0x3'));var BPromise=require(_0xe1fd('0x4'));var rp=require(_0xe1fd('0x5'));var fs=require('fs');var path=require(_0xe1fd('0x6'));var rimraf=require(_0xe1fd('0x7'));var config=require('../../config/environment');var attributes=require(_0xe1fd('0x8'));module['exports']=function(_0x274a00,_0x473f3a){return _0x274a00[_0xe1fd('0x9')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7aea=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','lodash','util','../../config/logger','api'];(function(_0x2e2411,_0x3d0ee9){var _0x5a1f85=function(_0x21f4e2){while(--_0x21f4e2){_0x2e2411['push'](_0x2e2411['shift']());}};_0x5a1f85(++_0x3d0ee9);}(_0x7aea,0xac));var _0xa7ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7aea[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa7ae('0x0'));var util=require(_0xa7ae('0x1'));var logger=require(_0xa7ae('0x2'))(_0xa7ae('0x3'));var moment=require(_0xa7ae('0x4'));var BPromise=require(_0xa7ae('0x5'));var rp=require(_0xa7ae('0x6'));var fs=require('fs');var path=require(_0xa7ae('0x7'));var rimraf=require(_0xa7ae('0x8'));var config=require(_0xa7ae('0x9'));var attributes=require(_0xa7ae('0xa'));module['exports']=function(_0x199e03,_0x3f8825){return _0x199e03['define']('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','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 ffb570f..b2ff651 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 _0x119f=['jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../config/logger','rpc'];(function(_0xa5c14d,_0x36b019){var _0x1ebd94=function(_0x13d349){while(--_0x13d349){_0xa5c14d['push'](_0xa5c14d['shift']());}};_0x1ebd94(++_0x36b019);}(_0x119f,0x80));var _0xf119=function(_0x4e4228,_0xc9d3b8){_0x4e4228=_0x4e4228-0x0;var _0x4103f7=_0x119f[_0x4e4228];return _0x4103f7;};'use strict';var _=require('lodash');var util=require(_0xf119('0x0'));var moment=require('moment');var BPromise=require(_0xf119('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf119('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf119('0x3'))(_0xf119('0x4'));var config=require('../../config/environment');var jayson=require(_0xf119('0x5'));var client=jayson['client'][_0xf119('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x10215d,_0x128675,_0x11cc48){return new BPromise(function(_0x3a91f4,_0x1a6649){return client[_0xf119('0x7')](_0x10215d,_0x11cc48)[_0xf119('0x8')](function(_0x43ccf8){logger[_0xf119('0x9')](_0xf119('0xa'),_0x128675,_0xf119('0xb'));logger['debug'](_0xf119('0xc'),_0x128675,_0xf119('0xb'),JSON[_0xf119('0xd')](_0x43ccf8));if(_0x43ccf8[_0xf119('0xe')]){if(_0x43ccf8[_0xf119('0xe')][_0xf119('0xf')]===0x1f4){logger[_0xf119('0xe')](_0xf119('0xa'),_0x128675,_0x43ccf8[_0xf119('0xe')][_0xf119('0x10')]);return _0x1a6649(_0x43ccf8[_0xf119('0xe')][_0xf119('0x10')]);}logger[_0xf119('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x128675,_0x43ccf8[_0xf119('0xe')][_0xf119('0x10')]);return _0x3a91f4(_0x43ccf8[_0xf119('0xe')]['message']);}else{logger[_0xf119('0x9')]('Dynamics365Configuration,\x20%s,\x20%s',_0x128675,'request\x20sent');_0x3a91f4(_0x43ccf8[_0xf119('0x11')][_0xf119('0x10')]);}})[_0xf119('0x12')](function(_0x369c40){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x128675,_0x369c40);_0x1a6649(_0x369c40);});});} \ No newline at end of file +var _0x4377=['error','code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1b20b3,_0x3cc702){var _0x5a1d56=function(_0x4d568d){while(--_0x4d568d){_0x1b20b3['push'](_0x1b20b3['shift']());}};_0x5a1d56(++_0x3cc702);}(_0x4377,0x1e8));var _0x7437=function(_0x28e78b,_0x30623b){_0x28e78b=_0x28e78b-0x0;var _0xd07693=_0x4377[_0x28e78b];return _0xd07693;};'use strict';var _=require(_0x7437('0x0'));var util=require(_0x7437('0x1'));var moment=require('moment');var BPromise=require(_0x7437('0x2'));var rs=require(_0x7437('0x3'));var fs=require('fs');var Redis=require(_0x7437('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7437('0x5'));var logger=require(_0x7437('0x6'))(_0x7437('0x7'));var config=require('../../config/environment');var jayson=require(_0x7437('0x8'));var client=jayson[_0x7437('0x9')][_0x7437('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52ee51,_0x414459,_0x3f4e61){return new BPromise(function(_0x45a38f,_0x4543d2){return client[_0x7437('0xb')](_0x52ee51,_0x3f4e61)['then'](function(_0x18fb8d){logger[_0x7437('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x414459,_0x7437('0xd'));logger['debug'](_0x7437('0xe'),_0x414459,'request\x20sent',JSON[_0x7437('0xf')](_0x18fb8d));if(_0x18fb8d[_0x7437('0x10')]){if(_0x18fb8d[_0x7437('0x10')][_0x7437('0x11')]===0x1f4){logger['error'](_0x7437('0x12'),_0x414459,_0x18fb8d[_0x7437('0x10')][_0x7437('0x13')]);return _0x4543d2(_0x18fb8d[_0x7437('0x10')]['message']);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x414459,_0x18fb8d[_0x7437('0x10')][_0x7437('0x13')]);return _0x45a38f(_0x18fb8d[_0x7437('0x10')][_0x7437('0x13')]);}else{logger[_0x7437('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x414459,_0x7437('0xd'));_0x45a38f(_0x18fb8d['result']['message']);}})[_0x7437('0x14')](function(_0x4ed06a){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x414459,_0x4ed06a);_0x4543d2(_0x4ed06a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 4e79831..fb49e2b 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 _0xd957=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer','util','connect-timeout'];(function(_0x4f7b63,_0x440d69){var _0x3ab461=function(_0xfdf6ff){while(--_0xfdf6ff){_0x4f7b63['push'](_0x4f7b63['shift']());}};_0x3ab461(++_0x440d69);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var path=require('path');var timeout=require(_0x7d95('0x2'));var express=require(_0x7d95('0x3'));var router=express['Router']();var fs_extra=require(_0x7d95('0x4'));var auth=require(_0x7d95('0x5'));var interaction=require(_0x7d95('0x6'));var config=require(_0x7d95('0x7'));var controller=require(_0x7d95('0x8'));router[_0x7d95('0x9')]('/',auth[_0x7d95('0xa')](),controller['index']);router[_0x7d95('0x9')](_0x7d95('0xb'),auth['isAuthenticated'](),controller[_0x7d95('0xc')]);router[_0x7d95('0xd')]('/',auth[_0x7d95('0xa')](),controller[_0x7d95('0xe')]);router[_0x7d95('0xf')]('/:id',auth[_0x7d95('0xa')](),controller[_0x7d95('0x10')]);router[_0x7d95('0x11')](_0x7d95('0xb'),auth[_0x7d95('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf874=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','create','/:id','update','delete','destroy','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf874,0xed));var _0x4f87=function(_0x495309,_0x1dcc43){_0x495309=_0x495309-0x0;var _0x4d46dc=_0xf874[_0x495309];return _0x4d46dc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4f87('0x0'));var timeout=require(_0x4f87('0x1'));var express=require(_0x4f87('0x2'));var router=express[_0x4f87('0x3')]();var fs_extra=require(_0x4f87('0x4'));var auth=require(_0x4f87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4f87('0x6'));var controller=require(_0x4f87('0x7'));router[_0x4f87('0x8')]('/',auth[_0x4f87('0x9')](),controller[_0x4f87('0xa')]);router[_0x4f87('0x8')]('/:id',auth[_0x4f87('0x9')](),controller[_0x4f87('0xb')]);router['post']('/',auth[_0x4f87('0x9')](),controller[_0x4f87('0xc')]);router['put'](_0x4f87('0xd'),auth[_0x4f87('0x9')](),controller[_0x4f87('0xe')]);router[_0x4f87('0xf')](_0x4f87('0xd'),auth[_0x4f87('0x9')](),controller[_0x4f87('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index d6fc075..07038d1 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 _0xca9e=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x22193e,_0x2ae001){var _0x10c378=function(_0x411e3f){while(--_0x411e3f){_0x22193e['push'](_0x22193e['shift']());}};_0x10c378(++_0x2ae001);}(_0xca9e,0x136));var _0xeca9=function(_0x7bcbba,_0x52309a){_0x7bcbba=_0x7bcbba-0x0;var _0x377abe=_0xca9e[_0x7bcbba];return _0x377abe;};'use strict';var Sequelize=require(_0xeca9('0x0'));module[_0xeca9('0x1')]={'type':{'type':Sequelize[_0xeca9('0x2')](_0xeca9('0x3'),_0xeca9('0x4'),_0xeca9('0x5'),_0xeca9('0x6'),_0xeca9('0x7')),'defaultValue':_0xeca9('0x3')},'content':{'type':Sequelize[_0xeca9('0x8')]},'key':{'type':Sequelize[_0xeca9('0x8')]},'keyType':{'type':Sequelize[_0xeca9('0x2')](_0xeca9('0x3'),_0xeca9('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xeca9('0x8')]},'idField':{'type':Sequelize[_0xeca9('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeca9('0x8')]}}; \ No newline at end of file +var _0xdc97=['picklist','STRING','string','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x43a0ad,_0x161e4e){var _0x4dbeb1=function(_0x3076cf){while(--_0x3076cf){_0x43a0ad['push'](_0x43a0ad['shift']());}};_0x4dbeb1(++_0x161e4e);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3e80c5,_0x21053f){_0x3e80c5=_0x3e80c5-0x0;var _0x5eb16f=_0xdc97[_0x3e80c5];return _0x5eb16f;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'type':{'type':Sequelize[_0x7dc9('0x2')]('string',_0x7dc9('0x3'),'customVariable',_0x7dc9('0x4'),_0x7dc9('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7dc9('0x6')]},'key':{'type':Sequelize[_0x7dc9('0x6')]},'keyType':{'type':Sequelize[_0x7dc9('0x2')](_0x7dc9('0x7'),'variable',_0x7dc9('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7dc9('0x6')]},'customField':{'type':Sequelize[_0x7dc9('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7dc9('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 0116b41..2d38555 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 _0x4e8c=['stack','name','send','index','map','Dynamics365Field','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error'];(function(_0x11f48b,_0x1dc2ac){var _0x3f5ffc=function(_0x284cb3){while(--_0x284cb3){_0x11f48b['push'](_0x11f48b['shift']());}};_0x3f5ffc(++_0x1dc2ac);}(_0x4e8c,0xf4));var _0xc4e8=function(_0x1b68ba,_0x23687a){_0x1b68ba=_0x1b68ba-0x0;var _0xf49b11=_0x4e8c[_0x1b68ba];return _0xf49b11;};'use strict';var emlformat=require(_0xc4e8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc4e8('0x1'));var rp=require(_0xc4e8('0x2'));var moment=require(_0xc4e8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc4e8('0x4'));var util=require(_0xc4e8('0x5'));var path=require(_0xc4e8('0x6'));var sox=require(_0xc4e8('0x7'));var csv=require(_0xc4e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4e8('0x9'));var _=require(_0xc4e8('0xa'));var squel=require('squel');var crypto=require(_0xc4e8('0xb'));var jsforce=require(_0xc4e8('0xc'));var deskjs=require(_0xc4e8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc4e8('0xe'));var Papa=require(_0xc4e8('0xf'));var Redis=require(_0xc4e8('0x10'));var authService=require(_0xc4e8('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc4e8('0x12'));var config=require(_0xc4e8('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4e8('0x14'))['db'];function respondWithStatusCode(_0x144d5e,_0x5e1426){_0x5e1426=_0x5e1426||0xcc;return function(_0xf13c50){if(_0xf13c50){return _0x144d5e['sendStatus'](_0x5e1426);}return _0x144d5e['status'](_0x5e1426)[_0xc4e8('0x15')]();};}function respondWithResult(_0x232c0b,_0x196882){_0x196882=_0x196882||0xc8;return function(_0xdd85bf){if(_0xdd85bf){return _0x232c0b[_0xc4e8('0x16')](_0x196882)['json'](_0xdd85bf);}};}function respondWithFilteredResult(_0xceb1fe,_0x36c068){return function(_0x213b55){if(_0x213b55){var _0x11b5cb=_0x213b55[_0xc4e8('0x17')],_0x2882b8=_0x36c068['offset'],_0x286d48=_0x36c068[_0xc4e8('0x18')]+_0x36c068['limit'],_0x4493f8;if(_0x286d48>=_0x11b5cb){_0x286d48=_0x11b5cb;_0x4493f8=0xc8;}else{_0x4493f8=0xce;}_0xceb1fe[_0xc4e8('0x16')](_0x4493f8);return _0xceb1fe[_0xc4e8('0x19')](_0xc4e8('0x1a'),_0x2882b8+'-'+_0x286d48+'/'+_0x11b5cb)[_0xc4e8('0x1b')](_0x213b55);}return null;};}function patchUpdates(_0x3124a0){return function(_0x2b3a6e){try{jsonpatch[_0xc4e8('0x1c')](_0x2b3a6e,_0x3124a0,!![]);}catch(_0x5c923a){return BPromise[_0xc4e8('0x1d')](_0x5c923a);}return _0x2b3a6e[_0xc4e8('0x1e')]();};}function saveUpdates(_0x5038a9,_0x3f5543){return function(_0x474098){if(_0x474098){return _0x474098[_0xc4e8('0x1f')](_0x5038a9)['then'](function(_0x1b41b1){return _0x1b41b1;});}return null;};}function removeEntity(_0x4b0e09,_0x1041e6){return function(_0x2ffc95){if(_0x2ffc95){return _0x2ffc95[_0xc4e8('0x20')]()[_0xc4e8('0x21')](function(){_0x4b0e09[_0xc4e8('0x16')](0xcc)[_0xc4e8('0x15')]();});}};}function handleEntityNotFound(_0x41a898,_0x33469b){return function(_0x18483a){if(!_0x18483a){_0x41a898[_0xc4e8('0x22')](0x194);}return _0x18483a;};}function handleError(_0x293ace,_0x84537d){_0x84537d=_0x84537d||0x1f4;return function(_0x4f97fc){logger[_0xc4e8('0x23')](_0x4f97fc[_0xc4e8('0x24')]);if(_0x4f97fc[_0xc4e8('0x25')]){delete _0x4f97fc[_0xc4e8('0x25')];}_0x293ace[_0xc4e8('0x16')](_0x84537d)[_0xc4e8('0x26')](_0x4f97fc);};}exports[_0xc4e8('0x27')]=function(_0x19e42e,_0x5d92fc){var _0x2bd997={},_0x2d4e3f={},_0x1a4429={'count':0x0,'rows':[]};var _0x40bf37=_[_0xc4e8('0x28')](db[_0xc4e8('0x29')][_0xc4e8('0x2a')],function(_0x1dfafc){return{'name':_0x1dfafc['fieldName'],'type':_0x1dfafc[_0xc4e8('0x2b')]['key']};});_0x2d4e3f[_0xc4e8('0x2c')]=_[_0xc4e8('0x28')](_0x40bf37,_0xc4e8('0x25'));_0x2d4e3f[_0xc4e8('0x2d')]=_['keys'](_0x19e42e[_0xc4e8('0x2d')]);_0x2d4e3f[_0xc4e8('0x2e')]=_[_0xc4e8('0x2f')](_0x2d4e3f[_0xc4e8('0x2c')],_0x2d4e3f[_0xc4e8('0x2d')]);_0x2bd997[_0xc4e8('0x30')]=_[_0xc4e8('0x2f')](_0x2d4e3f[_0xc4e8('0x2c')],qs[_0xc4e8('0x31')](_0x19e42e[_0xc4e8('0x2d')][_0xc4e8('0x31')]));_0x2bd997['attributes']=_0x2bd997[_0xc4e8('0x30')][_0xc4e8('0x32')]?_0x2bd997[_0xc4e8('0x30')]:_0x2d4e3f[_0xc4e8('0x2c')];if(!_0x19e42e[_0xc4e8('0x2d')]['hasOwnProperty'](_0xc4e8('0x33'))){_0x2bd997['limit']=qs[_0xc4e8('0x34')](_0x19e42e[_0xc4e8('0x2d')][_0xc4e8('0x34')]);_0x2bd997[_0xc4e8('0x18')]=qs[_0xc4e8('0x18')](_0x19e42e[_0xc4e8('0x2d')][_0xc4e8('0x18')]);}_0x2bd997[_0xc4e8('0x35')]=qs[_0xc4e8('0x36')](_0x19e42e[_0xc4e8('0x2d')][_0xc4e8('0x36')]);_0x2bd997[_0xc4e8('0x37')]=qs['filters'](_[_0xc4e8('0x38')](_0x19e42e['query'],_0x2d4e3f[_0xc4e8('0x2e')]),_0x40bf37);if(_0x19e42e['query'][_0xc4e8('0x39')]){_0x2bd997['where']=_['merge'](_0x2bd997[_0xc4e8('0x37')],{'$or':_[_0xc4e8('0x28')](_0x40bf37,function(_0x52f5bb){if(_0x52f5bb['type']!==_0xc4e8('0x3a')){var _0x370e40={};_0x370e40[_0x52f5bb[_0xc4e8('0x25')]]={'$like':'%'+_0x19e42e[_0xc4e8('0x2d')][_0xc4e8('0x39')]+'%'};return _0x370e40;}})});}_0x2bd997=_[_0xc4e8('0x3b')]({},_0x2bd997,_0x19e42e['options']);var _0x3151ba={'where':_0x2bd997[_0xc4e8('0x37')]};return db[_0xc4e8('0x29')][_0xc4e8('0x17')](_0x3151ba)[_0xc4e8('0x21')](function(_0x181067){_0x1a4429[_0xc4e8('0x17')]=_0x181067;if(_0x19e42e[_0xc4e8('0x2d')][_0xc4e8('0x3c')]){_0x2bd997[_0xc4e8('0x3d')]=[{'all':!![]}];}return db[_0xc4e8('0x29')]['findAll'](_0x2bd997);})[_0xc4e8('0x21')](function(_0x4cc54f){_0x1a4429[_0xc4e8('0x3e')]=_0x4cc54f;return _0x1a4429;})[_0xc4e8('0x21')](respondWithFilteredResult(_0x5d92fc,_0x2bd997))[_0xc4e8('0x3f')](handleError(_0x5d92fc,null));};exports[_0xc4e8('0x40')]=function(_0xf8c7f2,_0x3f960b){var _0x1f7734={'raw':!![],'where':{'id':_0xf8c7f2[_0xc4e8('0x41')]['id']}},_0x410a9d={};_0x410a9d[_0xc4e8('0x2c')]=_['keys'](db[_0xc4e8('0x29')]['rawAttributes']);_0x410a9d[_0xc4e8('0x2d')]=_[_0xc4e8('0x42')](_0xf8c7f2[_0xc4e8('0x2d')]);_0x410a9d['filters']=_[_0xc4e8('0x2f')](_0x410a9d[_0xc4e8('0x2c')],_0x410a9d['query']);_0x1f7734[_0xc4e8('0x30')]=_[_0xc4e8('0x2f')](_0x410a9d[_0xc4e8('0x2c')],qs[_0xc4e8('0x31')](_0xf8c7f2['query'][_0xc4e8('0x31')]));_0x1f7734['attributes']=_0x1f7734['attributes'][_0xc4e8('0x32')]?_0x1f7734['attributes']:_0x410a9d[_0xc4e8('0x2c')];if(_0xf8c7f2['query'][_0xc4e8('0x3c')]){_0x1f7734[_0xc4e8('0x3d')]=[{'all':!![]}];}_0x1f7734=_[_0xc4e8('0x3b')]({},_0x1f7734,_0xf8c7f2['options']);return db[_0xc4e8('0x29')][_0xc4e8('0x43')](_0x1f7734)[_0xc4e8('0x21')](handleEntityNotFound(_0x3f960b,null))[_0xc4e8('0x21')](respondWithResult(_0x3f960b,null))['catch'](handleError(_0x3f960b,null));};exports[_0xc4e8('0x44')]=function(_0x147826,_0xf701a6){return db['Dynamics365Field'][_0xc4e8('0x44')](_0x147826['body'],{})[_0xc4e8('0x21')](respondWithResult(_0xf701a6,0xc9))[_0xc4e8('0x3f')](handleError(_0xf701a6,null));};exports['update']=function(_0x19607e,_0x2dd314){if(_0x19607e[_0xc4e8('0x45')]['id']){delete _0x19607e['body']['id'];}return db['Dynamics365Field'][_0xc4e8('0x43')]({'where':{'id':_0x19607e[_0xc4e8('0x41')]['id']}})[_0xc4e8('0x21')](handleEntityNotFound(_0x2dd314,null))[_0xc4e8('0x21')](saveUpdates(_0x19607e[_0xc4e8('0x45')],null))['then'](respondWithResult(_0x2dd314,null))['catch'](handleError(_0x2dd314,null));};exports[_0xc4e8('0x20')]=function(_0xc25719,_0x366c9d){return db[_0xc4e8('0x29')][_0xc4e8('0x43')]({'where':{'id':_0xc25719[_0xc4e8('0x41')]['id']}})[_0xc4e8('0x21')](handleEntityNotFound(_0x366c9d,null))[_0xc4e8('0x21')](removeEntity(_0x366c9d,null))[_0xc4e8('0x3f')](handleError(_0x366c9d,null));}; \ No newline at end of file +var _0x453d=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','name','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x535430,_0x1951a2){var _0x5094cf=function(_0x15d8d2){while(--_0x15d8d2){_0x535430['push'](_0x535430['shift']());}};_0x5094cf(++_0x1951a2);}(_0x453d,0xd6));var _0xd453=function(_0x184876,_0x1bb7be){_0x184876=_0x184876-0x0;var _0x40f0d8=_0x453d[_0x184876];return _0x40f0d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd453('0x0'));var zipdir=require(_0xd453('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd453('0x2'));var moment=require(_0xd453('0x3'));var BPromise=require(_0xd453('0x4'));var Mustache=require(_0xd453('0x5'));var util=require(_0xd453('0x6'));var path=require(_0xd453('0x7'));var sox=require(_0xd453('0x8'));var csv=require(_0xd453('0x9'));var ejs=require(_0xd453('0xa'));var fs=require('fs');var fs_extra=require(_0xd453('0xb'));var _=require(_0xd453('0xc'));var squel=require(_0xd453('0xd'));var crypto=require(_0xd453('0xe'));var jsforce=require(_0xd453('0xf'));var deskjs=require(_0xd453('0x10'));var toCsv=require(_0xd453('0x9'));var querystring=require(_0xd453('0x11'));var Papa=require(_0xd453('0x12'));var Redis=require(_0xd453('0x13'));var authService=require(_0xd453('0x14'));var qs=require(_0xd453('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd453('0x16'));var logger=require(_0xd453('0x17'))(_0xd453('0x18'));var utils=require('../../config/utils');var config=require(_0xd453('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fd5cc,_0x2dbebb){_0x2dbebb=_0x2dbebb||0xcc;return function(_0xd9e664){if(_0xd9e664){return _0x1fd5cc[_0xd453('0x1a')](_0x2dbebb);}return _0x1fd5cc[_0xd453('0x1b')](_0x2dbebb)[_0xd453('0x1c')]();};}function respondWithResult(_0x462b56,_0x3129e3){_0x3129e3=_0x3129e3||0xc8;return function(_0x2701b6){if(_0x2701b6){return _0x462b56[_0xd453('0x1b')](_0x3129e3)['json'](_0x2701b6);}};}function respondWithFilteredResult(_0x1d1781,_0xf44211){return function(_0x33e13b){if(_0x33e13b){var _0x15d703=_0x33e13b[_0xd453('0x1d')],_0x4c5e16=_0xf44211[_0xd453('0x1e')],_0x3eeb6a=_0xf44211[_0xd453('0x1e')]+_0xf44211[_0xd453('0x1f')],_0x2ad424;if(_0x3eeb6a>=_0x15d703){_0x3eeb6a=_0x15d703;_0x2ad424=0xc8;}else{_0x2ad424=0xce;}_0x1d1781['status'](_0x2ad424);return _0x1d1781[_0xd453('0x20')](_0xd453('0x21'),_0x4c5e16+'-'+_0x3eeb6a+'/'+_0x15d703)[_0xd453('0x22')](_0x33e13b);}return null;};}function patchUpdates(_0x273c14){return function(_0x3a0bd8){try{jsonpatch[_0xd453('0x23')](_0x3a0bd8,_0x273c14,!![]);}catch(_0x2bb375){return BPromise[_0xd453('0x24')](_0x2bb375);}return _0x3a0bd8[_0xd453('0x25')]();};}function saveUpdates(_0x138242,_0x4c3a93){return function(_0x2a9514){if(_0x2a9514){return _0x2a9514[_0xd453('0x26')](_0x138242)['then'](function(_0x2e2b5f){return _0x2e2b5f;});}return null;};}function removeEntity(_0x12e588,_0x233062){return function(_0x2a78a0){if(_0x2a78a0){return _0x2a78a0[_0xd453('0x27')]()[_0xd453('0x28')](function(){_0x12e588['status'](0xcc)[_0xd453('0x1c')]();});}};}function handleEntityNotFound(_0x20368b,_0x7fbe3f){return function(_0x615c85){if(!_0x615c85){_0x20368b[_0xd453('0x1a')](0x194);}return _0x615c85;};}function handleError(_0x52d4fe,_0x53e610){_0x53e610=_0x53e610||0x1f4;return function(_0x27e89d){logger['error'](_0x27e89d['stack']);if(_0x27e89d[_0xd453('0x29')]){delete _0x27e89d['name'];}_0x52d4fe[_0xd453('0x1b')](_0x53e610)['send'](_0x27e89d);};}exports[_0xd453('0x2a')]=function(_0x2d4f7f,_0x1be4b6){var _0xf83c8f={},_0x13ac33={},_0xa91784={'count':0x0,'rows':[]};var _0x85990f=_[_0xd453('0x2b')](db[_0xd453('0x2c')][_0xd453('0x2d')],function(_0x4b55cd){return{'name':_0x4b55cd[_0xd453('0x2e')],'type':_0x4b55cd[_0xd453('0x2f')][_0xd453('0x30')]};});_0x13ac33['model']=_[_0xd453('0x2b')](_0x85990f,'name');_0x13ac33['query']=_[_0xd453('0x31')](_0x2d4f7f[_0xd453('0x32')]);_0x13ac33[_0xd453('0x33')]=_[_0xd453('0x34')](_0x13ac33[_0xd453('0x35')],_0x13ac33[_0xd453('0x32')]);_0xf83c8f[_0xd453('0x36')]=_['intersection'](_0x13ac33['model'],qs['fields'](_0x2d4f7f[_0xd453('0x32')][_0xd453('0x37')]));_0xf83c8f[_0xd453('0x36')]=_0xf83c8f[_0xd453('0x36')][_0xd453('0x38')]?_0xf83c8f[_0xd453('0x36')]:_0x13ac33[_0xd453('0x35')];if(!_0x2d4f7f[_0xd453('0x32')][_0xd453('0x39')]('nolimit')){_0xf83c8f[_0xd453('0x1f')]=qs[_0xd453('0x1f')](_0x2d4f7f[_0xd453('0x32')][_0xd453('0x1f')]);_0xf83c8f[_0xd453('0x1e')]=qs[_0xd453('0x1e')](_0x2d4f7f[_0xd453('0x32')]['offset']);}_0xf83c8f['order']=qs[_0xd453('0x3a')](_0x2d4f7f[_0xd453('0x32')][_0xd453('0x3a')]);_0xf83c8f[_0xd453('0x3b')]=qs['filters'](_['pick'](_0x2d4f7f[_0xd453('0x32')],_0x13ac33['filters']),_0x85990f);if(_0x2d4f7f['query'][_0xd453('0x3c')]){_0xf83c8f[_0xd453('0x3b')]=_[_0xd453('0x3d')](_0xf83c8f[_0xd453('0x3b')],{'$or':_[_0xd453('0x2b')](_0x85990f,function(_0x7ec1d5){if(_0x7ec1d5[_0xd453('0x2f')]!==_0xd453('0x3e')){var _0x379fd6={};_0x379fd6[_0x7ec1d5[_0xd453('0x29')]]={'$like':'%'+_0x2d4f7f['query'][_0xd453('0x3c')]+'%'};return _0x379fd6;}})});}_0xf83c8f=_[_0xd453('0x3d')]({},_0xf83c8f,_0x2d4f7f['options']);var _0x33a112={'where':_0xf83c8f['where']};return db[_0xd453('0x2c')][_0xd453('0x1d')](_0x33a112)[_0xd453('0x28')](function(_0x52f832){_0xa91784[_0xd453('0x1d')]=_0x52f832;if(_0x2d4f7f[_0xd453('0x32')][_0xd453('0x3f')]){_0xf83c8f['include']=[{'all':!![]}];}return db[_0xd453('0x2c')][_0xd453('0x40')](_0xf83c8f);})['then'](function(_0x2e6d40){_0xa91784[_0xd453('0x41')]=_0x2e6d40;return _0xa91784;})[_0xd453('0x28')](respondWithFilteredResult(_0x1be4b6,_0xf83c8f))[_0xd453('0x42')](handleError(_0x1be4b6,null));};exports['show']=function(_0x1058e0,_0x24a7e3){var _0x3aaac7={'raw':!![],'where':{'id':_0x1058e0[_0xd453('0x43')]['id']}},_0x14d19f={};_0x14d19f[_0xd453('0x35')]=_['keys'](db[_0xd453('0x2c')]['rawAttributes']);_0x14d19f[_0xd453('0x32')]=_[_0xd453('0x31')](_0x1058e0[_0xd453('0x32')]);_0x14d19f['filters']=_[_0xd453('0x34')](_0x14d19f[_0xd453('0x35')],_0x14d19f[_0xd453('0x32')]);_0x3aaac7[_0xd453('0x36')]=_[_0xd453('0x34')](_0x14d19f[_0xd453('0x35')],qs[_0xd453('0x37')](_0x1058e0[_0xd453('0x32')][_0xd453('0x37')]));_0x3aaac7[_0xd453('0x36')]=_0x3aaac7['attributes'][_0xd453('0x38')]?_0x3aaac7[_0xd453('0x36')]:_0x14d19f[_0xd453('0x35')];if(_0x1058e0[_0xd453('0x32')]['includeAll']){_0x3aaac7[_0xd453('0x44')]=[{'all':!![]}];}_0x3aaac7=_[_0xd453('0x3d')]({},_0x3aaac7,_0x1058e0[_0xd453('0x45')]);return db[_0xd453('0x2c')][_0xd453('0x46')](_0x3aaac7)[_0xd453('0x28')](handleEntityNotFound(_0x24a7e3,null))[_0xd453('0x28')](respondWithResult(_0x24a7e3,null))[_0xd453('0x42')](handleError(_0x24a7e3,null));};exports[_0xd453('0x47')]=function(_0x13065f,_0x4d99b9){return db['Dynamics365Field'][_0xd453('0x47')](_0x13065f[_0xd453('0x48')],{})[_0xd453('0x28')](respondWithResult(_0x4d99b9,0xc9))[_0xd453('0x42')](handleError(_0x4d99b9,null));};exports[_0xd453('0x26')]=function(_0x4044e7,_0x5c1366){if(_0x4044e7['body']['id']){delete _0x4044e7[_0xd453('0x48')]['id'];}return db[_0xd453('0x2c')][_0xd453('0x46')]({'where':{'id':_0x4044e7[_0xd453('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c1366,null))['then'](saveUpdates(_0x4044e7[_0xd453('0x48')],null))[_0xd453('0x28')](respondWithResult(_0x5c1366,null))[_0xd453('0x42')](handleError(_0x5c1366,null));};exports[_0xd453('0x27')]=function(_0x349a50,_0x5ae679){return db['Dynamics365Field'][_0xd453('0x46')]({'where':{'id':_0x349a50[_0xd453('0x43')]['id']}})[_0xd453('0x28')](handleEntityNotFound(_0x5ae679,null))['then'](removeEntity(_0x5ae679,null))['catch'](handleError(_0x5ae679,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 1164f8d..ebab1a4 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 _0x175c=['../../config/environment','./intDynamics365Field.attributes','exports','int_dynamics365_fields','dynamics365_unique_index','idField','util','api','request-promise','path','rimraf'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x175c,0x103));var _0xc175=function(_0x33a220,_0x5d83fd){_0x33a220=_0x33a220-0x0;var _0x4af1f0=_0x175c[_0x33a220];return _0x4af1f0;};'use strict';var _=require('lodash');var util=require(_0xc175('0x0'));var logger=require('../../config/logger')(_0xc175('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc175('0x2'));var fs=require('fs');var path=require(_0xc175('0x3'));var rimraf=require(_0xc175('0x4'));var config=require(_0xc175('0x5'));var attributes=require(_0xc175('0x6'));module[_0xc175('0x7')]=function(_0x380262,_0x245d8d){return _0x380262['define']('Dynamics365Field',attributes,{'tableName':_0xc175('0x8'),'paranoid':![],'indexes':[{'name':_0xc175('0x9'),'fields':[_0xc175('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeaa3=['idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x1d2288,_0x5e9e2b){var _0x795c95=function(_0x3705ea){while(--_0x3705ea){_0x1d2288['push'](_0x1d2288['shift']());}};_0x795c95(++_0x5e9e2b);}(_0xeaa3,0xaa));var _0x3eaa=function(_0x1ddf32,_0x4508f0){_0x1ddf32=_0x1ddf32-0x0;var _0x4da79b=_0xeaa3[_0x1ddf32];return _0x4da79b;};'use strict';var _=require(_0x3eaa('0x0'));var util=require(_0x3eaa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3eaa('0x2'));var BPromise=require(_0x3eaa('0x3'));var rp=require(_0x3eaa('0x4'));var fs=require('fs');var path=require(_0x3eaa('0x5'));var rimraf=require(_0x3eaa('0x6'));var config=require(_0x3eaa('0x7'));var attributes=require(_0x3eaa('0x8'));module['exports']=function(_0x3bb723,_0x355c94){return _0x3bb723['define'](_0x3eaa('0x9'),attributes,{'tableName':_0x3eaa('0xa'),'paranoid':![],'indexes':[{'name':_0x3eaa('0xb'),'fields':[_0x3eaa('0xc'),_0x3eaa('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 35e7743..a731dba 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 _0x4753=['lodash','util','moment','randomstring','ioredis','../../config/utils','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x469fe3,_0x1c116f){var _0x323496=function(_0x5a639f){while(--_0x5a639f){_0x469fe3['push'](_0x469fe3['shift']());}};_0x323496(++_0x1c116f);}(_0x4753,0x1f4));var _0x3475=function(_0x4c38a2,_0x9a5327){_0x4c38a2=_0x4c38a2-0x0;var _0x461bec=_0x4753[_0x4c38a2];return _0x461bec;};'use strict';var _=require(_0x3475('0x0'));var util=require(_0x3475('0x1'));var moment=require(_0x3475('0x2'));var BPromise=require('bluebird');var rs=require(_0x3475('0x3'));var fs=require('fs');var Redis=require(_0x3475('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3475('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3475('0x6')][_0x3475('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48c6af,_0x820cbe,_0x157c1e){return new BPromise(function(_0x409bfc,_0x1d021b){return client[_0x3475('0x8')](_0x48c6af,_0x157c1e)[_0x3475('0x9')](function(_0x2c4cd7){logger[_0x3475('0xa')](_0x3475('0xb'),_0x820cbe,_0x3475('0xc'));logger['debug'](_0x3475('0xd'),_0x820cbe,_0x3475('0xc'),JSON[_0x3475('0xe')](_0x2c4cd7));if(_0x2c4cd7['error']){if(_0x2c4cd7[_0x3475('0xf')][_0x3475('0x10')]===0x1f4){logger['error'](_0x3475('0xb'),_0x820cbe,_0x2c4cd7['error'][_0x3475('0x11')]);return _0x1d021b(_0x2c4cd7[_0x3475('0xf')][_0x3475('0x11')]);}logger['error'](_0x3475('0xb'),_0x820cbe,_0x2c4cd7[_0x3475('0xf')][_0x3475('0x11')]);return _0x409bfc(_0x2c4cd7[_0x3475('0xf')]['message']);}else{logger[_0x3475('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x820cbe,'request\x20sent');_0x409bfc(_0x2c4cd7[_0x3475('0x12')][_0x3475('0x11')]);}})[_0x3475('0x13')](function(_0x1e0c0a){logger[_0x3475('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x820cbe,_0x1e0c0a);_0x1d021b(_0x1e0c0a);});});} \ No newline at end of file +var _0x964b=['../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x5dd744,_0x4ad820){var _0x434ecd=function(_0x568b68){while(--_0x568b68){_0x5dd744['push'](_0x5dd744['shift']());}};_0x434ecd(++_0x4ad820);}(_0x964b,0x112));var _0xb964=function(_0xc1a8a2,_0x1509b3){_0xc1a8a2=_0xc1a8a2-0x0;var _0xafa56a=_0x964b[_0xc1a8a2];return _0xafa56a;};'use strict';var _=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var moment=require('moment');var BPromise=require(_0xb964('0x2'));var rs=require(_0xb964('0x3'));var fs=require('fs');var Redis=require(_0xb964('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb964('0x5'))('rpc');var config=require(_0xb964('0x6'));var jayson=require(_0xb964('0x7'));var client=jayson[_0xb964('0x8')][_0xb964('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x204c7d,_0xde47d5,_0x3fe401){return new BPromise(function(_0x53b463,_0x58e49e){return client[_0xb964('0xa')](_0x204c7d,_0x3fe401)['then'](function(_0x55e697){logger[_0xb964('0xb')](_0xb964('0xc'),_0xde47d5,_0xb964('0xd'));logger[_0xb964('0xe')](_0xb964('0xf'),_0xde47d5,_0xb964('0xd'),JSON['stringify'](_0x55e697));if(_0x55e697[_0xb964('0x10')]){if(_0x55e697[_0xb964('0x10')][_0xb964('0x11')]===0x1f4){logger[_0xb964('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0xde47d5,_0x55e697[_0xb964('0x10')]['message']);return _0x58e49e(_0x55e697['error'][_0xb964('0x12')]);}logger[_0xb964('0x10')](_0xb964('0xc'),_0xde47d5,_0x55e697[_0xb964('0x10')][_0xb964('0x12')]);return _0x53b463(_0x55e697[_0xb964('0x10')][_0xb964('0x12')]);}else{logger['info'](_0xb964('0xc'),_0xde47d5,'request\x20sent');_0x53b463(_0x55e697['result'][_0xb964('0x12')]);}})[_0xb964('0x13')](function(_0x26aa2c){logger[_0xb964('0x10')](_0xb964('0xc'),_0xde47d5,_0x26aa2c);_0x58e49e(_0x26aa2c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 4285086..f22ad24 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 _0x3aa6=['show','getConfigurations','getFields','post','/:id/configurations','update','delete','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0x3aa6,0x1e3));var _0x63aa=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x3aa6[_0xbb14db];return _0x36bed7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x63aa('0x0'));var router=express[_0x63aa('0x1')]();var fs_extra=require(_0x63aa('0x2'));var auth=require(_0x63aa('0x3'));var interaction=require(_0x63aa('0x4'));var config=require(_0x63aa('0x5'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x63aa('0x6')](),controller[_0x63aa('0x7')]);router[_0x63aa('0x8')](_0x63aa('0x9'),auth[_0x63aa('0x6')](),controller[_0x63aa('0xa')]);router[_0x63aa('0x8')]('/:id/configurations',auth[_0x63aa('0x6')](),controller[_0x63aa('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x63aa('0xc')]);router[_0x63aa('0xd')]('/',auth[_0x63aa('0x6')](),controller['create']);router[_0x63aa('0xd')](_0x63aa('0xe'),auth[_0x63aa('0x6')](),controller['addConfiguration']);router['put'](_0x63aa('0x9'),auth[_0x63aa('0x6')](),controller[_0x63aa('0xf')]);router[_0x63aa('0x10')](_0x63aa('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7cfc=['put','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7cfc,0x10a));var _0xc7cf=function(_0x312962,_0x282d40){_0x312962=_0x312962-0x0;var _0x3e85d0=_0x7cfc[_0x312962];return _0x3e85d0;};'use strict';var multer=require(_0xc7cf('0x0'));var util=require('util');var path=require(_0xc7cf('0x1'));var timeout=require(_0xc7cf('0x2'));var express=require('express');var router=express[_0xc7cf('0x3')]();var fs_extra=require(_0xc7cf('0x4'));var auth=require(_0xc7cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc7cf('0x6'));var controller=require(_0xc7cf('0x7'));router[_0xc7cf('0x8')]('/',auth[_0xc7cf('0x9')](),controller[_0xc7cf('0xa')]);router['get'](_0xc7cf('0xb'),auth['isAuthenticated'](),controller[_0xc7cf('0xc')]);router['get']('/:id/configurations',auth[_0xc7cf('0x9')](),controller[_0xc7cf('0xd')]);router['get'](_0xc7cf('0xe'),auth[_0xc7cf('0x9')](),controller[_0xc7cf('0xf')]);router[_0xc7cf('0x10')]('/',auth['isAuthenticated'](),controller[_0xc7cf('0x11')]);router['post'](_0xc7cf('0x12'),auth[_0xc7cf('0x9')](),controller[_0xc7cf('0x13')]);router[_0xc7cf('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc7cf('0x15')]('/:id',auth['isAuthenticated'](),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 47726c0..597e663 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 _0xb7b4=['STRING','username','remoteUri','sequelize','exports'];(function(_0x4bb9da,_0x457c27){var _0x4e9eba=function(_0x5a2a50){while(--_0x5a2a50){_0x4bb9da['push'](_0x4bb9da['shift']());}};_0x4e9eba(++_0x457c27);}(_0xb7b4,0x16b));var _0x4b7b=function(_0x1cdd9e,_0x2cd3f4){_0x1cdd9e=_0x1cdd9e-0x0;var _0x152285=_0xb7b4[_0x1cdd9e];return _0x152285;};'use strict';var Sequelize=require(_0x4b7b('0x0'));module[_0x4b7b('0x1')]={'name':{'type':Sequelize[_0x4b7b('0x2')]},'description':{'type':Sequelize[_0x4b7b('0x2')]},'username':{'type':Sequelize[_0x4b7b('0x2')],'unique':_0x4b7b('0x3')},'apiKey':{'type':Sequelize[_0x4b7b('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4b7b('0x4')},'serverUrl':{'type':Sequelize[_0x4b7b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc615=['username','remoteUri','sequelize','exports','STRING'];(function(_0x1e2e3d,_0x54de95){var _0x155aa2=function(_0x1bbe29){while(--_0x1bbe29){_0x1e2e3d['push'](_0x1e2e3d['shift']());}};_0x155aa2(++_0x54de95);}(_0xc615,0x1ab));var _0x5c61=function(_0x51244e,_0x24c7e6){_0x51244e=_0x51244e-0x0;var _0x58d71c=_0xc615[_0x51244e];return _0x58d71c;};'use strict';var Sequelize=require(_0x5c61('0x0'));module[_0x5c61('0x1')]={'name':{'type':Sequelize[_0x5c61('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x5c61('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5c61('0x2')],'unique':_0x5c61('0x4')},'serverUrl':{'type':Sequelize[_0x5c61('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 f480139..64d04f6 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 _0x8c33=['source','ticket_type','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','jayson/promise','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','count','offset','limit','set','reject','update','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','FreshdeskAccount','includeAll','include','findAll','rows','show','find','create','body','catch','params','destroy','getConfigurations','findOne','length','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','group'];(function(_0x108051,_0x49d00e){var _0x33c663=function(_0x3a0734){while(--_0x3a0734){_0x108051['push'](_0x108051['shift']());}};_0x33c663(++_0x49d00e);}(_0x8c33,0x100));var _0x38c3=function(_0x49d958,_0x4af761){_0x49d958=_0x49d958-0x0;var _0x4107a3=_0x8c33[_0x49d958];return _0x4107a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38c3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38c3('0x1'));var rp=require(_0x38c3('0x2'));var moment=require(_0x38c3('0x3'));var BPromise=require(_0x38c3('0x4'));var Mustache=require(_0x38c3('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x38c3('0x6'));var ejs=require(_0x38c3('0x7'));var fs=require('fs');var fs_extra=require(_0x38c3('0x8'));var _=require(_0x38c3('0x9'));var squel=require(_0x38c3('0xa'));var crypto=require(_0x38c3('0xb'));var jsforce=require(_0x38c3('0xc'));var deskjs=require(_0x38c3('0xd'));var toCsv=require(_0x38c3('0x6'));var querystring=require('querystring');var Papa=require(_0x38c3('0xe'));var Redis=require(_0x38c3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x38c3('0x10'));var as=require(_0x38c3('0x11'));var hardwareService=require(_0x38c3('0x12'));var logger=require(_0x38c3('0x13'))(_0x38c3('0x14'));var utils=require('../../config/utils');var config=require(_0x38c3('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x38c3('0x16'));var jayson=require(_0x38c3('0x17'));var client=jayson['client'][_0x38c3('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x4a0cee,_0x19cfe2,_0x486a8f,_0x521192){return new BPromise(function(_0x61a124,_0x45adec){var _0x1e962d=_0x521192||client;return _0x1e962d['request'](_0x4a0cee,_0x486a8f)[_0x38c3('0x19')](function(_0x376005){logger[_0x38c3('0x1a')](_0x38c3('0x1b'),_0x19cfe2,_0x38c3('0x1c'));logger[_0x38c3('0x1d')](_0x38c3('0x1e'),_0x19cfe2,'request\x20sent',JSON[_0x38c3('0x1f')](_0x376005));if(_0x376005[_0x38c3('0x20')]){if(_0x376005[_0x38c3('0x20')][_0x38c3('0x21')]===0x1f4){logger[_0x38c3('0x20')](_0x38c3('0x1b'),_0x19cfe2,_0x376005[_0x38c3('0x20')][_0x38c3('0x22')]);return _0x45adec(_0x376005[_0x38c3('0x20')][_0x38c3('0x22')]);}logger[_0x38c3('0x20')](_0x38c3('0x1b'),_0x19cfe2,_0x376005[_0x38c3('0x20')][_0x38c3('0x22')]);return _0x61a124(_0x376005[_0x38c3('0x20')]['message']);}else{logger[_0x38c3('0x1a')](_0x38c3('0x1b'),_0x19cfe2,_0x38c3('0x1c'));_0x61a124(_0x376005[_0x38c3('0x23')][_0x38c3('0x22')]);}})['catch'](function(_0x487c35){logger[_0x38c3('0x20')]('FreshdeskAccount,\x20%s,\x20%s',_0x19cfe2,_0x487c35);_0x45adec(_0x487c35);});});}function respondWithStatusCode(_0x205b59,_0x68dd11){_0x68dd11=_0x68dd11||0xcc;return function(_0x31e8ab){if(_0x31e8ab){return _0x205b59['sendStatus'](_0x68dd11);}return _0x205b59[_0x38c3('0x24')](_0x68dd11)[_0x38c3('0x25')]();};}function respondWithResult(_0x148f54,_0x205b93){_0x205b93=_0x205b93||0xc8;return function(_0x570e45){if(_0x570e45){return _0x148f54[_0x38c3('0x24')](_0x205b93)[_0x38c3('0x26')](_0x570e45);}};}function respondWithFilteredResult(_0x164aa8,_0x214bf8){return function(_0x4855d0){if(_0x4855d0){var _0x2845f0=_0x4855d0[_0x38c3('0x27')],_0x6ec5cc=_0x214bf8[_0x38c3('0x28')],_0x380f0f=_0x214bf8['offset']+_0x214bf8[_0x38c3('0x29')],_0x24f2d3;if(_0x380f0f>=_0x2845f0){_0x380f0f=_0x2845f0;_0x24f2d3=0xc8;}else{_0x24f2d3=0xce;}_0x164aa8[_0x38c3('0x24')](_0x24f2d3);return _0x164aa8[_0x38c3('0x2a')]('Content-Range',_0x6ec5cc+'-'+_0x380f0f+'/'+_0x2845f0)[_0x38c3('0x26')](_0x4855d0);}return null;};}function patchUpdates(_0x3a3fba){return function(_0x595559){try{jsonpatch['apply'](_0x595559,_0x3a3fba,!![]);}catch(_0x587f46){return BPromise[_0x38c3('0x2b')](_0x587f46);}return _0x595559['save']();};}function saveUpdates(_0x4d330b,_0xfb3ad5){return function(_0x1d40a4){if(_0x1d40a4){return _0x1d40a4[_0x38c3('0x2c')](_0x4d330b)[_0x38c3('0x19')](function(_0xda4ed4){return _0xda4ed4;});}return null;};}function removeEntity(_0x55cbce,_0x51f6c4){return function(_0x1bf08b){if(_0x1bf08b){return _0x1bf08b['destroy']()[_0x38c3('0x19')](function(){_0x55cbce['status'](0xcc)[_0x38c3('0x25')]();});}};}function handleEntityNotFound(_0x1ce338,_0x400c19){return function(_0x10016b){if(!_0x10016b){_0x1ce338[_0x38c3('0x2d')](0x194);}return _0x10016b;};}function handleError(_0x46c44e,_0x2a457d){_0x2a457d=_0x2a457d||0x1f4;return function(_0xca94e2){logger['error'](_0xca94e2[_0x38c3('0x2e')]);if(_0xca94e2[_0x38c3('0x2f')]){delete _0xca94e2[_0x38c3('0x2f')];}_0x46c44e[_0x38c3('0x24')](_0x2a457d)[_0x38c3('0x30')](_0xca94e2);};}exports[_0x38c3('0x31')]=function(_0x19df54,_0x2f26cc){var _0x4b5a60={},_0x13b686={},_0x583039={'count':0x0,'rows':[]};var _0x59bacc=_[_0x38c3('0x32')](db['FreshdeskAccount'][_0x38c3('0x33')],function(_0x19ff56){return{'name':_0x19ff56['fieldName'],'type':_0x19ff56[_0x38c3('0x34')][_0x38c3('0x35')]};});_0x13b686[_0x38c3('0x36')]=_[_0x38c3('0x32')](_0x59bacc,_0x38c3('0x2f'));_0x13b686[_0x38c3('0x37')]=_[_0x38c3('0x38')](_0x19df54[_0x38c3('0x37')]);_0x13b686[_0x38c3('0x39')]=_[_0x38c3('0x3a')](_0x13b686[_0x38c3('0x36')],_0x13b686['query']);_0x4b5a60[_0x38c3('0x3b')]=_[_0x38c3('0x3a')](_0x13b686['model'],qs[_0x38c3('0x3c')](_0x19df54[_0x38c3('0x37')][_0x38c3('0x3c')]));_0x4b5a60[_0x38c3('0x3b')]=_0x4b5a60[_0x38c3('0x3b')]['length']?_0x4b5a60[_0x38c3('0x3b')]:_0x13b686['model'];if(!_0x19df54['query'][_0x38c3('0x3d')]('nolimit')){_0x4b5a60['limit']=qs[_0x38c3('0x29')](_0x19df54['query']['limit']);_0x4b5a60[_0x38c3('0x28')]=qs['offset'](_0x19df54[_0x38c3('0x37')][_0x38c3('0x28')]);}_0x4b5a60[_0x38c3('0x3e')]=qs[_0x38c3('0x3f')](_0x19df54[_0x38c3('0x37')][_0x38c3('0x3f')]);_0x4b5a60['where']=qs[_0x38c3('0x39')](_[_0x38c3('0x40')](_0x19df54['query'],_0x13b686[_0x38c3('0x39')]),_0x59bacc);if(_0x19df54[_0x38c3('0x37')][_0x38c3('0x41')]){_0x4b5a60[_0x38c3('0x42')]=_[_0x38c3('0x43')](_0x4b5a60[_0x38c3('0x42')],{'$or':_[_0x38c3('0x32')](_0x59bacc,function(_0x5e2e9f){if(_0x5e2e9f[_0x38c3('0x34')]!==_0x38c3('0x44')){var _0x342c52={};_0x342c52[_0x5e2e9f['name']]={'$like':'%'+_0x19df54['query'][_0x38c3('0x41')]+'%'};return _0x342c52;}})});}_0x4b5a60=_[_0x38c3('0x43')]({},_0x4b5a60,_0x19df54[_0x38c3('0x45')]);var _0x1321b2={'where':_0x4b5a60[_0x38c3('0x42')]};return db[_0x38c3('0x46')][_0x38c3('0x27')](_0x1321b2)[_0x38c3('0x19')](function(_0xb747c2){_0x583039[_0x38c3('0x27')]=_0xb747c2;if(_0x19df54[_0x38c3('0x37')][_0x38c3('0x47')]){_0x4b5a60[_0x38c3('0x48')]=[{'all':!![]}];}return db[_0x38c3('0x46')][_0x38c3('0x49')](_0x4b5a60);})[_0x38c3('0x19')](function(_0x589a1d){_0x583039[_0x38c3('0x4a')]=_0x589a1d;return _0x583039;})[_0x38c3('0x19')](respondWithFilteredResult(_0x2f26cc,_0x4b5a60))['catch'](handleError(_0x2f26cc,null));};exports[_0x38c3('0x4b')]=function(_0x1910e7,_0x15b244){var _0x218e59={'raw':![],'where':{'id':_0x1910e7['params']['id']}},_0xb37d08={};_0xb37d08[_0x38c3('0x36')]=_['keys'](db[_0x38c3('0x46')][_0x38c3('0x33')]);_0xb37d08[_0x38c3('0x37')]=_[_0x38c3('0x38')](_0x1910e7['query']);_0xb37d08[_0x38c3('0x39')]=_[_0x38c3('0x3a')](_0xb37d08['model'],_0xb37d08[_0x38c3('0x37')]);_0x218e59['attributes']=_[_0x38c3('0x3a')](_0xb37d08[_0x38c3('0x36')],qs[_0x38c3('0x3c')](_0x1910e7[_0x38c3('0x37')][_0x38c3('0x3c')]));_0x218e59[_0x38c3('0x3b')]=_0x218e59[_0x38c3('0x3b')]['length']?_0x218e59[_0x38c3('0x3b')]:_0xb37d08['model'];if(_0x1910e7['query'][_0x38c3('0x47')]){_0x218e59['include']=[{'all':!![]}];}_0x218e59=_[_0x38c3('0x43')]({},_0x218e59,_0x1910e7[_0x38c3('0x45')]);return db[_0x38c3('0x46')][_0x38c3('0x4c')](_0x218e59)[_0x38c3('0x19')](handleEntityNotFound(_0x15b244,null))[_0x38c3('0x19')](respondWithResult(_0x15b244,null))['catch'](handleError(_0x15b244,null));};exports[_0x38c3('0x4d')]=function(_0x531a04,_0x5ec8ab){return db[_0x38c3('0x46')]['create'](_0x531a04[_0x38c3('0x4e')],{})[_0x38c3('0x19')](respondWithResult(_0x5ec8ab,0xc9))[_0x38c3('0x4f')](handleError(_0x5ec8ab,null));};exports[_0x38c3('0x2c')]=function(_0xedefec,_0x15fa71){if(_0xedefec[_0x38c3('0x4e')]['id']){delete _0xedefec[_0x38c3('0x4e')]['id'];}return db[_0x38c3('0x46')][_0x38c3('0x4c')]({'where':{'id':_0xedefec[_0x38c3('0x50')]['id']}})['then'](handleEntityNotFound(_0x15fa71,null))[_0x38c3('0x19')](saveUpdates(_0xedefec[_0x38c3('0x4e')],null))['then'](respondWithResult(_0x15fa71,null))[_0x38c3('0x4f')](handleError(_0x15fa71,null));};exports[_0x38c3('0x51')]=function(_0x37de3a,_0x4ce8b1){return db[_0x38c3('0x46')]['find']({'where':{'id':_0x37de3a['params']['id']}})[_0x38c3('0x19')](handleEntityNotFound(_0x4ce8b1,null))[_0x38c3('0x19')](removeEntity(_0x4ce8b1,null))[_0x38c3('0x4f')](handleError(_0x4ce8b1,null));};exports[_0x38c3('0x52')]=function(_0x53542b,_0x22ce95,_0x113e55){var _0x16c350={};var _0x2a484b={};var _0x45439f;var _0x3c6169;return db[_0x38c3('0x46')][_0x38c3('0x53')]({'where':{'id':_0x53542b[_0x38c3('0x50')]['id']}})['then'](handleEntityNotFound(_0x22ce95,null))[_0x38c3('0x19')](function(_0x4965b6){if(_0x4965b6){_0x45439f=_0x4965b6;_0x2a484b[_0x38c3('0x36')]=_[_0x38c3('0x38')](db['FreshdeskConfiguration'][_0x38c3('0x33')]);_0x2a484b['query']=_['keys'](_0x53542b[_0x38c3('0x37')]);_0x2a484b[_0x38c3('0x39')]=_[_0x38c3('0x3a')](_0x2a484b[_0x38c3('0x36')],_0x2a484b[_0x38c3('0x37')]);_0x16c350[_0x38c3('0x3b')]=_[_0x38c3('0x3a')](_0x2a484b['model'],qs[_0x38c3('0x3c')](_0x53542b[_0x38c3('0x37')][_0x38c3('0x3c')]));_0x16c350[_0x38c3('0x3b')]=_0x16c350[_0x38c3('0x3b')][_0x38c3('0x54')]?_0x16c350[_0x38c3('0x3b')]:_0x2a484b[_0x38c3('0x36')];_0x16c350[_0x38c3('0x3e')]=qs[_0x38c3('0x3f')](_0x53542b[_0x38c3('0x37')][_0x38c3('0x3f')]);_0x16c350[_0x38c3('0x42')]=qs[_0x38c3('0x39')](_['pick'](_0x53542b[_0x38c3('0x37')],_0x2a484b[_0x38c3('0x39')]));if(_0x53542b['query']['filter']){_0x16c350['where']=_[_0x38c3('0x43')](_0x16c350[_0x38c3('0x42')],{'$or':_[_0x38c3('0x32')](_0x16c350[_0x38c3('0x3b')],function(_0x54aee0){var _0x2538a4={};_0x2538a4[_0x54aee0]={'$like':'%'+_0x53542b[_0x38c3('0x37')][_0x38c3('0x41')]+'%'};return _0x2538a4;})});}_0x16c350=_[_0x38c3('0x43')]({},_0x16c350,_0x53542b[_0x38c3('0x45')]);return _0x45439f['getConfigurations'](_0x16c350);}})[_0x38c3('0x19')](function(_0x179df1){if(_0x179df1){_0x3c6169=_0x179df1[_0x38c3('0x54')];if(!_0x53542b['query']['hasOwnProperty'](_0x38c3('0x55'))){_0x16c350[_0x38c3('0x29')]=qs[_0x38c3('0x29')](_0x53542b[_0x38c3('0x37')][_0x38c3('0x29')]);_0x16c350[_0x38c3('0x28')]=qs['offset'](_0x53542b['query'][_0x38c3('0x28')]);}return _0x45439f['getConfigurations'](_0x16c350);}})[_0x38c3('0x19')](function(_0x87ce80){if(_0x87ce80){return _0x87ce80?{'count':_0x3c6169,'rows':_0x87ce80}:null;}})['then'](respondWithResult(_0x22ce95,null))[_0x38c3('0x4f')](handleError(_0x22ce95,null));};exports[_0x38c3('0x56')]=function(_0x5e4a21,_0x475c3c,_0x140f8b){if(_0x5e4a21[_0x38c3('0x4e')]['id']){delete _0x5e4a21['body']['id'];}return db[_0x38c3('0x46')][_0x38c3('0x53')]({'where':{'id':_0x5e4a21['params']['id']}})['then'](handleEntityNotFound(_0x475c3c,null))[_0x38c3('0x19')](function(_0x263201){if(_0x263201){_0x5e4a21[_0x38c3('0x4e')]['AccountId']=_0x263201['id'];_0x5e4a21['body'][_0x38c3('0x57')]=integrations[_0x38c3('0x58')](_0x5e4a21[_0x38c3('0x4e')][_0x38c3('0x59')],_0x5e4a21[_0x38c3('0x4e')]['type']);_0x5e4a21['body']['Descriptions']=integrations[_0x38c3('0x5a')](_0x5e4a21[_0x38c3('0x4e')][_0x38c3('0x59')],_0x5e4a21[_0x38c3('0x4e')]['type']);return db['FreshdeskConfiguration']['create'](_0x5e4a21[_0x38c3('0x4e')],{'include':[{'model':db[_0x38c3('0x5b')],'as':'Subjects'},{'model':db[_0x38c3('0x5b')],'as':_0x38c3('0x5c')}]});}return null;})[_0x38c3('0x19')](respondWithResult(_0x475c3c,null))[_0x38c3('0x4f')](handleError(_0x475c3c,null));};exports[_0x38c3('0x5d')]=function(_0x3a95e1,_0x4d0240,_0x39b9f6){var _0x26d7b4='';return db[_0x38c3('0x46')][_0x38c3('0x53')]({'where':{'id':_0x3a95e1[_0x38c3('0x50')]['id']},'attributes':['id',_0x38c3('0x5e'),_0x38c3('0x5f')]})[_0x38c3('0x19')](handleEntityNotFound(_0x4d0240,null))[_0x38c3('0x19')](function(_0x5f3203){if(_0x5f3203){_0x26d7b4=_0x5f3203[_0x38c3('0x5e')];var _0x38093b=_0x26d7b4['slice'](-0x1);if(_0x38093b==='/'){_0x26d7b4=_0x26d7b4['substring'](0x0,_0x26d7b4[_0x38c3('0x60')](_0x38093b));}return rp({'method':_0x38c3('0x61'),'uri':util[_0x38c3('0x62')](_0x38c3('0x63'),_0x26d7b4,_0x38c3('0x64')),'headers':{'Authorization':util[_0x38c3('0x62')](_0x38c3('0x65'),new Buffer(util[_0x38c3('0x62')](_0x38c3('0x66'),_0x5f3203[_0x38c3('0x5f')]))[_0x38c3('0x67')](_0x38c3('0x68')))},'json':!![]});}})[_0x38c3('0x19')](function(_0x26057a){if(_0x26057a){var _0x5765e1=[_0x38c3('0x69'),_0x38c3('0x6a'),_0x38c3('0x6b'),_0x38c3('0x6c'),_0x38c3('0x24'),'priority',_0x38c3('0x6d'),_0x38c3('0x6e'),_0x38c3('0x6f'),_0x38c3('0x6d'),'company'];_['remove'](_0x26057a,function(_0x2b94e3){return _0x5765e1[_0x38c3('0x70')](_0x2b94e3[_0x38c3('0x2f')])||!_0x2b94e3[_0x38c3('0x71')]&&_0x2b94e3['type']!==_0x38c3('0x72')&&_0x2b94e3[_0x38c3('0x34')]!==_0x38c3('0x73');});return{'count':_0x26057a[_0x38c3('0x54')],'rows':_['map'](_0x26057a,function(_0x549137){return{'id':_0x549137[_0x38c3('0x2f')],'name':_0x549137[_0x38c3('0x74')],'custom':!_0x549137[_0x38c3('0x71')],'options':_0x549137[_0x38c3('0x75')]?_[_0x38c3('0x32')](_0x549137[_0x38c3('0x75')],function(_0x230276){return{'name':_[_0x38c3('0x76')](_0x230276),'value':_0x230276};}):[]};})};}})[_0x38c3('0x19')](respondWithResult(_0x4d0240,null))['catch'](function(_0x16d835){var _0x5d2b9c=_0x3a95e1[_0x38c3('0x37')][_0x38c3('0x77')]?0x1f4:_0x16d835[_0x38c3('0x78')]||0x1f4;logger['error'](_0x38c3('0x79'),_0x38c3('0x5d'),_0x5d2b9c,JSON[_0x38c3('0x1f')](_0x16d835));delete _0x16d835[_0x38c3('0x2f')];if(_0x5d2b9c===0x191){_0x5d2b9c=0x190;}_0x4d0240[_0x38c3('0x24')](_0x5d2b9c)[_0x38c3('0x30')](_0x3a95e1['query'][_0x38c3('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x16d835[_0x38c3('0x78')]}:_0x16d835);});}; \ No newline at end of file +var _0x29cd=['sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','FreshdeskAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','length','limit','order','sort','where','VIRTUAL','filter','merge','options','count','includeAll','rows','catch','params','keys','fields','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','%s:X','apiKey','toString','base64','requester','subject','agent','description','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util'];(function(_0x4e1bf4,_0x52aabb){var _0x45250b=function(_0x2902cc){while(--_0x2902cc){_0x4e1bf4['push'](_0x4e1bf4['shift']());}};_0x45250b(++_0x52aabb);}(_0x29cd,0xec));var _0xd29c=function(_0x8b7185,_0x3624ca){_0x8b7185=_0x8b7185-0x0;var _0x33f5bf=_0x29cd[_0x8b7185];return _0x33f5bf;};'use strict';var emlformat=require(_0xd29c('0x0'));var rimraf=require(_0xd29c('0x1'));var zipdir=require(_0xd29c('0x2'));var jsonpatch=require(_0xd29c('0x3'));var rp=require(_0xd29c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd29c('0x5'));var path=require('path');var sox=require(_0xd29c('0x6'));var csv=require('to-csv');var ejs=require(_0xd29c('0x7'));var fs=require('fs');var fs_extra=require(_0xd29c('0x8'));var _=require('lodash');var squel=require(_0xd29c('0x9'));var crypto=require(_0xd29c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd29c('0xb'));var toCsv=require(_0xd29c('0xc'));var querystring=require(_0xd29c('0xd'));var Papa=require(_0xd29c('0xe'));var Redis=require(_0xd29c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd29c('0x10'));var hardwareService=require(_0xd29c('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xd29c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd29c('0x13'));var db=require(_0xd29c('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xd29c('0x15'));var client=jayson[_0xd29c('0x16')][_0xd29c('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x12a7aa,_0x14bac9,_0x3a5f12,_0x24c037){return new BPromise(function(_0x35a890,_0x3923bf){var _0xee5126=_0x24c037||client;return _0xee5126['request'](_0x12a7aa,_0x3a5f12)['then'](function(_0x3db53a){logger[_0xd29c('0x18')](_0xd29c('0x19'),_0x14bac9,_0xd29c('0x1a'));logger[_0xd29c('0x1b')](_0xd29c('0x1c'),_0x14bac9,_0xd29c('0x1a'),JSON['stringify'](_0x3db53a));if(_0x3db53a['error']){if(_0x3db53a['error'][_0xd29c('0x1d')]===0x1f4){logger['error'](_0xd29c('0x19'),_0x14bac9,_0x3db53a[_0xd29c('0x1e')]['message']);return _0x3923bf(_0x3db53a[_0xd29c('0x1e')]['message']);}logger[_0xd29c('0x1e')](_0xd29c('0x19'),_0x14bac9,_0x3db53a['error']['message']);return _0x35a890(_0x3db53a[_0xd29c('0x1e')][_0xd29c('0x1f')]);}else{logger[_0xd29c('0x18')](_0xd29c('0x19'),_0x14bac9,_0xd29c('0x1a'));_0x35a890(_0x3db53a[_0xd29c('0x20')][_0xd29c('0x1f')]);}})['catch'](function(_0x10f95c){logger['error'](_0xd29c('0x19'),_0x14bac9,_0x10f95c);_0x3923bf(_0x10f95c);});});}function respondWithStatusCode(_0x109256,_0x2018b6){_0x2018b6=_0x2018b6||0xcc;return function(_0x464308){if(_0x464308){return _0x109256['sendStatus'](_0x2018b6);}return _0x109256[_0xd29c('0x21')](_0x2018b6)['end']();};}function respondWithResult(_0x2dca40,_0x14af61){_0x14af61=_0x14af61||0xc8;return function(_0x412034){if(_0x412034){return _0x2dca40['status'](_0x14af61)[_0xd29c('0x22')](_0x412034);}};}function respondWithFilteredResult(_0x53a129,_0x1464e2){return function(_0x91d001){if(_0x91d001){var _0x1e274d=_0x91d001['count'],_0x3c0f90=_0x1464e2[_0xd29c('0x23')],_0x381921=_0x1464e2[_0xd29c('0x23')]+_0x1464e2['limit'],_0x16be1f;if(_0x381921>=_0x1e274d){_0x381921=_0x1e274d;_0x16be1f=0xc8;}else{_0x16be1f=0xce;}_0x53a129[_0xd29c('0x21')](_0x16be1f);return _0x53a129[_0xd29c('0x24')](_0xd29c('0x25'),_0x3c0f90+'-'+_0x381921+'/'+_0x1e274d)['json'](_0x91d001);}return null;};}function patchUpdates(_0x4f6242){return function(_0x3986a6){try{jsonpatch[_0xd29c('0x26')](_0x3986a6,_0x4f6242,!![]);}catch(_0x256304){return BPromise[_0xd29c('0x27')](_0x256304);}return _0x3986a6[_0xd29c('0x28')]();};}function saveUpdates(_0x144b2f,_0x5c7559){return function(_0x46a284){if(_0x46a284){return _0x46a284[_0xd29c('0x29')](_0x144b2f)[_0xd29c('0x2a')](function(_0x98b035){return _0x98b035;});}return null;};}function removeEntity(_0x5d1de8,_0x29392e){return function(_0x3d1b01){if(_0x3d1b01){return _0x3d1b01[_0xd29c('0x2b')]()[_0xd29c('0x2a')](function(){_0x5d1de8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17aa3a,_0x511a23){return function(_0x368ea8){if(!_0x368ea8){_0x17aa3a[_0xd29c('0x2c')](0x194);}return _0x368ea8;};}function handleError(_0x4ffb24,_0x1890bb){_0x1890bb=_0x1890bb||0x1f4;return function(_0x5854e1){logger[_0xd29c('0x1e')](_0x5854e1[_0xd29c('0x2d')]);if(_0x5854e1[_0xd29c('0x2e')]){delete _0x5854e1[_0xd29c('0x2e')];}_0x4ffb24[_0xd29c('0x21')](_0x1890bb)[_0xd29c('0x2f')](_0x5854e1);};}exports[_0xd29c('0x30')]=function(_0x4c0ff6,_0x52a143){var _0x51bb10={},_0x303370={},_0x33c870={'count':0x0,'rows':[]};var _0x3ea2d2=_[_0xd29c('0x31')](db[_0xd29c('0x32')][_0xd29c('0x33')],function(_0x37c611){return{'name':_0x37c611['fieldName'],'type':_0x37c611[_0xd29c('0x34')][_0xd29c('0x35')]};});_0x303370[_0xd29c('0x36')]=_[_0xd29c('0x31')](_0x3ea2d2,_0xd29c('0x2e'));_0x303370['query']=_['keys'](_0x4c0ff6[_0xd29c('0x37')]);_0x303370[_0xd29c('0x38')]=_[_0xd29c('0x39')](_0x303370[_0xd29c('0x36')],_0x303370[_0xd29c('0x37')]);_0x51bb10[_0xd29c('0x3a')]=_[_0xd29c('0x39')](_0x303370[_0xd29c('0x36')],qs['fields'](_0x4c0ff6[_0xd29c('0x37')]['fields']));_0x51bb10[_0xd29c('0x3a')]=_0x51bb10[_0xd29c('0x3a')][_0xd29c('0x3b')]?_0x51bb10[_0xd29c('0x3a')]:_0x303370['model'];if(!_0x4c0ff6[_0xd29c('0x37')]['hasOwnProperty']('nolimit')){_0x51bb10[_0xd29c('0x3c')]=qs['limit'](_0x4c0ff6['query']['limit']);_0x51bb10[_0xd29c('0x23')]=qs['offset'](_0x4c0ff6[_0xd29c('0x37')][_0xd29c('0x23')]);}_0x51bb10[_0xd29c('0x3d')]=qs[_0xd29c('0x3e')](_0x4c0ff6['query'][_0xd29c('0x3e')]);_0x51bb10[_0xd29c('0x3f')]=qs[_0xd29c('0x38')](_['pick'](_0x4c0ff6[_0xd29c('0x37')],_0x303370[_0xd29c('0x38')]),_0x3ea2d2);if(_0x4c0ff6[_0xd29c('0x37')]['filter']){_0x51bb10[_0xd29c('0x3f')]=_['merge'](_0x51bb10[_0xd29c('0x3f')],{'$or':_[_0xd29c('0x31')](_0x3ea2d2,function(_0x518eca){if(_0x518eca[_0xd29c('0x34')]!==_0xd29c('0x40')){var _0x5499cb={};_0x5499cb[_0x518eca[_0xd29c('0x2e')]]={'$like':'%'+_0x4c0ff6[_0xd29c('0x37')][_0xd29c('0x41')]+'%'};return _0x5499cb;}})});}_0x51bb10=_[_0xd29c('0x42')]({},_0x51bb10,_0x4c0ff6[_0xd29c('0x43')]);var _0xfb670b={'where':_0x51bb10[_0xd29c('0x3f')]};return db[_0xd29c('0x32')]['count'](_0xfb670b)['then'](function(_0x710849){_0x33c870[_0xd29c('0x44')]=_0x710849;if(_0x4c0ff6[_0xd29c('0x37')][_0xd29c('0x45')]){_0x51bb10['include']=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x51bb10);})[_0xd29c('0x2a')](function(_0x2207b4){_0x33c870[_0xd29c('0x46')]=_0x2207b4;return _0x33c870;})[_0xd29c('0x2a')](respondWithFilteredResult(_0x52a143,_0x51bb10))[_0xd29c('0x47')](handleError(_0x52a143,null));};exports['show']=function(_0x214c96,_0x596fa4){var _0x1460b1={'raw':![],'where':{'id':_0x214c96[_0xd29c('0x48')]['id']}},_0x5d66d7={};_0x5d66d7[_0xd29c('0x36')]=_[_0xd29c('0x49')](db[_0xd29c('0x32')][_0xd29c('0x33')]);_0x5d66d7[_0xd29c('0x37')]=_[_0xd29c('0x49')](_0x214c96[_0xd29c('0x37')]);_0x5d66d7['filters']=_['intersection'](_0x5d66d7['model'],_0x5d66d7[_0xd29c('0x37')]);_0x1460b1['attributes']=_[_0xd29c('0x39')](_0x5d66d7[_0xd29c('0x36')],qs[_0xd29c('0x4a')](_0x214c96[_0xd29c('0x37')]['fields']));_0x1460b1[_0xd29c('0x3a')]=_0x1460b1[_0xd29c('0x3a')]['length']?_0x1460b1[_0xd29c('0x3a')]:_0x5d66d7['model'];if(_0x214c96['query'][_0xd29c('0x45')]){_0x1460b1['include']=[{'all':!![]}];}_0x1460b1=_['merge']({},_0x1460b1,_0x214c96['options']);return db[_0xd29c('0x32')]['find'](_0x1460b1)[_0xd29c('0x2a')](handleEntityNotFound(_0x596fa4,null))[_0xd29c('0x2a')](respondWithResult(_0x596fa4,null))['catch'](handleError(_0x596fa4,null));};exports[_0xd29c('0x4b')]=function(_0x17f2a8,_0xc69258){return db['FreshdeskAccount'][_0xd29c('0x4b')](_0x17f2a8[_0xd29c('0x4c')],{})[_0xd29c('0x2a')](respondWithResult(_0xc69258,0xc9))['catch'](handleError(_0xc69258,null));};exports[_0xd29c('0x29')]=function(_0x218a20,_0x486844){if(_0x218a20['body']['id']){delete _0x218a20[_0xd29c('0x4c')]['id'];}return db[_0xd29c('0x32')]['find']({'where':{'id':_0x218a20[_0xd29c('0x48')]['id']}})[_0xd29c('0x2a')](handleEntityNotFound(_0x486844,null))['then'](saveUpdates(_0x218a20[_0xd29c('0x4c')],null))['then'](respondWithResult(_0x486844,null))[_0xd29c('0x47')](handleError(_0x486844,null));};exports[_0xd29c('0x2b')]=function(_0x2534a3,_0x11dadf){return db[_0xd29c('0x32')][_0xd29c('0x4d')]({'where':{'id':_0x2534a3[_0xd29c('0x48')]['id']}})[_0xd29c('0x2a')](handleEntityNotFound(_0x11dadf,null))[_0xd29c('0x2a')](removeEntity(_0x11dadf,null))[_0xd29c('0x47')](handleError(_0x11dadf,null));};exports[_0xd29c('0x4e')]=function(_0x2b6a9c,_0x23b756,_0x33680c){var _0x59be15={};var _0x22949b={};var _0x58322c;var _0x7fdcd0;return db[_0xd29c('0x32')][_0xd29c('0x4f')]({'where':{'id':_0x2b6a9c['params']['id']}})[_0xd29c('0x2a')](handleEntityNotFound(_0x23b756,null))[_0xd29c('0x2a')](function(_0x5c1e46){if(_0x5c1e46){_0x58322c=_0x5c1e46;_0x22949b[_0xd29c('0x36')]=_[_0xd29c('0x49')](db[_0xd29c('0x50')][_0xd29c('0x33')]);_0x22949b[_0xd29c('0x37')]=_[_0xd29c('0x49')](_0x2b6a9c[_0xd29c('0x37')]);_0x22949b[_0xd29c('0x38')]=_[_0xd29c('0x39')](_0x22949b[_0xd29c('0x36')],_0x22949b[_0xd29c('0x37')]);_0x59be15[_0xd29c('0x3a')]=_['intersection'](_0x22949b['model'],qs['fields'](_0x2b6a9c[_0xd29c('0x37')]['fields']));_0x59be15[_0xd29c('0x3a')]=_0x59be15[_0xd29c('0x3a')]['length']?_0x59be15[_0xd29c('0x3a')]:_0x22949b['model'];_0x59be15[_0xd29c('0x3d')]=qs[_0xd29c('0x3e')](_0x2b6a9c[_0xd29c('0x37')][_0xd29c('0x3e')]);_0x59be15['where']=qs[_0xd29c('0x38')](_['pick'](_0x2b6a9c[_0xd29c('0x37')],_0x22949b[_0xd29c('0x38')]));if(_0x2b6a9c[_0xd29c('0x37')][_0xd29c('0x41')]){_0x59be15[_0xd29c('0x3f')]=_[_0xd29c('0x42')](_0x59be15['where'],{'$or':_[_0xd29c('0x31')](_0x59be15[_0xd29c('0x3a')],function(_0xbde5ca){var _0x42fec5={};_0x42fec5[_0xbde5ca]={'$like':'%'+_0x2b6a9c[_0xd29c('0x37')][_0xd29c('0x41')]+'%'};return _0x42fec5;})});}_0x59be15=_[_0xd29c('0x42')]({},_0x59be15,_0x2b6a9c[_0xd29c('0x43')]);return _0x58322c[_0xd29c('0x4e')](_0x59be15);}})[_0xd29c('0x2a')](function(_0x3eae6b){if(_0x3eae6b){_0x7fdcd0=_0x3eae6b[_0xd29c('0x3b')];if(!_0x2b6a9c[_0xd29c('0x37')][_0xd29c('0x51')](_0xd29c('0x52'))){_0x59be15[_0xd29c('0x3c')]=qs['limit'](_0x2b6a9c[_0xd29c('0x37')][_0xd29c('0x3c')]);_0x59be15[_0xd29c('0x23')]=qs[_0xd29c('0x23')](_0x2b6a9c['query']['offset']);}return _0x58322c[_0xd29c('0x4e')](_0x59be15);}})['then'](function(_0x16609b){if(_0x16609b){return _0x16609b?{'count':_0x7fdcd0,'rows':_0x16609b}:null;}})['then'](respondWithResult(_0x23b756,null))['catch'](handleError(_0x23b756,null));};exports['addConfiguration']=function(_0x18a528,_0x2ef948,_0x411046){if(_0x18a528['body']['id']){delete _0x18a528[_0xd29c('0x4c')]['id'];}return db[_0xd29c('0x32')][_0xd29c('0x4f')]({'where':{'id':_0x18a528[_0xd29c('0x48')]['id']}})[_0xd29c('0x2a')](handleEntityNotFound(_0x2ef948,null))[_0xd29c('0x2a')](function(_0x25664f){if(_0x25664f){_0x18a528[_0xd29c('0x4c')][_0xd29c('0x53')]=_0x25664f['id'];_0x18a528[_0xd29c('0x4c')][_0xd29c('0x54')]=integrations[_0xd29c('0x55')](_0x18a528[_0xd29c('0x4c')][_0xd29c('0x56')],_0x18a528[_0xd29c('0x4c')]['type']);_0x18a528[_0xd29c('0x4c')][_0xd29c('0x57')]=integrations[_0xd29c('0x58')](_0x18a528[_0xd29c('0x4c')][_0xd29c('0x56')],_0x18a528[_0xd29c('0x4c')][_0xd29c('0x34')]);return db[_0xd29c('0x50')]['create'](_0x18a528[_0xd29c('0x4c')],{'include':[{'model':db[_0xd29c('0x59')],'as':_0xd29c('0x54')},{'model':db[_0xd29c('0x59')],'as':'Descriptions'}]});}return null;})[_0xd29c('0x2a')](respondWithResult(_0x2ef948,null))[_0xd29c('0x47')](handleError(_0x2ef948,null));};exports['getFields']=function(_0x232d2e,_0x1ae40a,_0xc73fd6){var _0x335d65='';return db[_0xd29c('0x32')][_0xd29c('0x4f')]({'where':{'id':_0x232d2e[_0xd29c('0x48')]['id']},'attributes':['id',_0xd29c('0x5a'),'apiKey']})[_0xd29c('0x2a')](handleEntityNotFound(_0x1ae40a,null))[_0xd29c('0x2a')](function(_0x555c92){if(_0x555c92){_0x335d65=_0x555c92[_0xd29c('0x5a')];var _0x350030=_0x335d65['slice'](-0x1);if(_0x350030==='/'){_0x335d65=_0x335d65[_0xd29c('0x5b')](0x0,_0x335d65[_0xd29c('0x5c')](_0x350030));}return rp({'method':_0xd29c('0x5d'),'uri':util['format'](_0xd29c('0x5e'),_0x335d65,_0xd29c('0x5f')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xd29c('0x60')](_0xd29c('0x61'),_0x555c92[_0xd29c('0x62')]))[_0xd29c('0x63')](_0xd29c('0x64')))},'json':!![]});}})[_0xd29c('0x2a')](function(_0x5a6f66){if(_0x5a6f66){var _0x205094=[_0xd29c('0x65'),_0xd29c('0x66'),_0xd29c('0x67'),_0xd29c('0x68'),_0xd29c('0x21'),'priority',_0xd29c('0x69'),_0xd29c('0x6a'),_0xd29c('0x6b'),_0xd29c('0x69'),_0xd29c('0x6c')];_[_0xd29c('0x6d')](_0x5a6f66,function(_0x10dc35){return _0x205094[_0xd29c('0x6e')](_0x10dc35[_0xd29c('0x2e')])||!_0x10dc35[_0xd29c('0x6f')]&&_0x10dc35[_0xd29c('0x34')]!=='custom_text'&&_0x10dc35[_0xd29c('0x34')]!==_0xd29c('0x70');});return{'count':_0x5a6f66[_0xd29c('0x3b')],'rows':_['map'](_0x5a6f66,function(_0x2d72fd){return{'id':_0x2d72fd[_0xd29c('0x2e')],'name':_0x2d72fd[_0xd29c('0x71')],'custom':!_0x2d72fd[_0xd29c('0x6f')],'options':_0x2d72fd[_0xd29c('0x72')]?_[_0xd29c('0x31')](_0x2d72fd[_0xd29c('0x72')],function(_0xc8b870){return{'name':_[_0xd29c('0x73')](_0xc8b870),'value':_0xc8b870};}):[]};})};}})[_0xd29c('0x2a')](respondWithResult(_0x1ae40a,null))[_0xd29c('0x47')](function(_0x4b1eeb){var _0x4bd4b2=_0x232d2e[_0xd29c('0x37')][_0xd29c('0x74')]?0x1f4:_0x4b1eeb[_0xd29c('0x75')]||0x1f4;logger[_0xd29c('0x1e')]('getFields,\x20%s,\x20%s,\x20%s',_0xd29c('0x76'),_0x4bd4b2,JSON[_0xd29c('0x77')](_0x4b1eeb));delete _0x4b1eeb[_0xd29c('0x2e')];if(_0x4bd4b2===0x191){_0x4bd4b2=0x190;}_0x1ae40a['status'](_0x4bd4b2)[_0xd29c('0x2f')](_0x232d2e[_0xd29c('0x37')][_0xd29c('0x74')]?{'message':_0xd29c('0x78'),'statusCode':_0x4b1eeb['statusCode']}:_0x4b1eeb);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 051ce99..06134c7 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 _0x993b=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x2e789d,_0x598440){var _0x2161f4=function(_0x142a68){while(--_0x142a68){_0x2e789d['push'](_0x2e789d['shift']());}};_0x2161f4(++_0x598440);}(_0x993b,0x130));var _0xb993=function(_0x2b32fd,_0x5a159d){_0x2b32fd=_0x2b32fd-0x0;var _0x131020=_0x993b[_0x2b32fd];return _0x131020;};'use strict';var _=require(_0xb993('0x0'));var util=require('util');var logger=require(_0xb993('0x1'))(_0xb993('0x2'));var moment=require(_0xb993('0x3'));var BPromise=require(_0xb993('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb993('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb993('0x6'));var integrations=require(_0xb993('0x7'));module['exports']=function(_0x2a7dc0,_0x5e5129){return _0x2a7dc0[_0xb993('0x8')](_0xb993('0x9'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb42c=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','util','../../config/logger','api','moment'];(function(_0x429370,_0x46ff4c){var _0x41a3ad=function(_0x47d51e){while(--_0x47d51e){_0x429370['push'](_0x429370['shift']());}};_0x41a3ad(++_0x46ff4c);}(_0xb42c,0xdc));var _0xcb42=function(_0x5ba0a2,_0x33db8a){_0x5ba0a2=_0x5ba0a2-0x0;var _0x3d2423=_0xb42c[_0x5ba0a2];return _0x3d2423;};'use strict';var _=require(_0xcb42('0x0'));var util=require(_0xcb42('0x1'));var logger=require(_0xcb42('0x2'))(_0xcb42('0x3'));var moment=require(_0xcb42('0x4'));var BPromise=require(_0xcb42('0x5'));var rp=require(_0xcb42('0x6'));var fs=require('fs');var path=require(_0xcb42('0x7'));var rimraf=require(_0xcb42('0x8'));var config=require(_0xcb42('0x9'));var attributes=require(_0xcb42('0xa'));var integrations=require(_0xcb42('0xb'));module[_0xcb42('0xc')]=function(_0x35fe59,_0x43905e){return _0x35fe59[_0xcb42('0xd')](_0xcb42('0xe'),attributes,{'tableName':'int_freshdesk_accounts','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 931d92f..b6799c7 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 _0xc2ff=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','findAll','options','raw','attributes','map','include','model','GetFreshdeskAccount','stringify','catch','ShowFreshdeskAccount','FreshdeskAccount','find','where','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2ff,0x69));var _0xfc2f=function(_0x32e7d5,_0x5e70f6){_0x32e7d5=_0x32e7d5-0x0;var _0x5c7664=_0xc2ff[_0x32e7d5];return _0x5c7664;};'use strict';var _=require(_0xfc2f('0x0'));var util=require(_0xfc2f('0x1'));var moment=require(_0xfc2f('0x2'));var BPromise=require('bluebird');var rs=require(_0xfc2f('0x3'));var fs=require('fs');var Redis=require(_0xfc2f('0x4'));var db=require(_0xfc2f('0x5'))['db'];var utils=require(_0xfc2f('0x6'));var logger=require(_0xfc2f('0x7'))(_0xfc2f('0x8'));var config=require(_0xfc2f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfc2f('0xa')][_0xfc2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1535df,_0x225daf,_0x546a3f){return new BPromise(function(_0x2e8cee,_0x46ecaf){return client[_0xfc2f('0xc')](_0x1535df,_0x546a3f)[_0xfc2f('0xd')](function(_0x5a41ee){logger['info'](_0xfc2f('0xe'),_0x225daf,_0xfc2f('0xf'));logger[_0xfc2f('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x225daf,_0xfc2f('0xf'),JSON['stringify'](_0x5a41ee));if(_0x5a41ee[_0xfc2f('0x11')]){if(_0x5a41ee[_0xfc2f('0x11')][_0xfc2f('0x12')]===0x1f4){logger[_0xfc2f('0x11')](_0xfc2f('0xe'),_0x225daf,_0x5a41ee[_0xfc2f('0x11')]['message']);return _0x46ecaf(_0x5a41ee[_0xfc2f('0x11')][_0xfc2f('0x13')]);}logger['error'](_0xfc2f('0xe'),_0x225daf,_0x5a41ee[_0xfc2f('0x11')]['message']);return _0x2e8cee(_0x5a41ee[_0xfc2f('0x11')][_0xfc2f('0x13')]);}else{logger[_0xfc2f('0x14')](_0xfc2f('0xe'),_0x225daf,_0xfc2f('0xf'));_0x2e8cee(_0x5a41ee[_0xfc2f('0x15')][_0xfc2f('0x13')]);}})['catch'](function(_0x15215c){logger[_0xfc2f('0x11')](_0xfc2f('0xe'),_0x225daf,_0x15215c);_0x46ecaf(_0x15215c);});});}exports['GetFreshdeskAccount']=function(_0x540bf5){var _0x40b99c=this;return new Promise(function(_0xdcb8a6,_0x3bb12a){return db['FreshdeskAccount'][_0xfc2f('0x16')]({'raw':_0x540bf5[_0xfc2f('0x17')]?_0x540bf5['options'][_0xfc2f('0x18')]===undefined?!![]:![]:!![],'where':_0x540bf5['options']?_0x540bf5[_0xfc2f('0x17')]['where']||null:null,'attributes':_0x540bf5[_0xfc2f('0x17')]?_0x540bf5[_0xfc2f('0x17')][_0xfc2f('0x19')]||null:null,'limit':_0x540bf5[_0xfc2f('0x17')]?_0x540bf5[_0xfc2f('0x17')]['limit']||null:null,'include':_0x540bf5['options']?_0x540bf5[_0xfc2f('0x17')]['include']?_[_0xfc2f('0x1a')](_0x540bf5[_0xfc2f('0x17')][_0xfc2f('0x1b')],function(_0x3caf26){return{'model':db[_0x3caf26['model']],'as':_0x3caf26['as'],'attributes':_0x3caf26[_0xfc2f('0x19')],'include':_0x3caf26[_0xfc2f('0x1b')]?_[_0xfc2f('0x1a')](_0x3caf26['include'],function(_0x12511a){return{'model':db[_0x12511a[_0xfc2f('0x1c')]],'as':_0x12511a['as'],'attributes':_0x12511a['attributes'],'include':_0x12511a[_0xfc2f('0x1b')]?_[_0xfc2f('0x1a')](_0x12511a[_0xfc2f('0x1b')],function(_0x3f867a){return{'model':db[_0x3f867a['model']],'as':_0x3f867a['as'],'attributes':_0x3f867a[_0xfc2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfc2f('0xd')](function(_0x1d9494){logger[_0xfc2f('0x14')](_0xfc2f('0x1d'),_0x540bf5);logger['debug'](_0xfc2f('0x1d'),_0x540bf5,JSON[_0xfc2f('0x1e')](_0x1d9494));_0xdcb8a6(_0x1d9494);})[_0xfc2f('0x1f')](function(_0x5ceff4){logger[_0xfc2f('0x11')](_0xfc2f('0x1d'),_0x5ceff4['message'],_0x540bf5);_0x3bb12a(_0x40b99c[_0xfc2f('0x11')](0x1f4,_0x5ceff4[_0xfc2f('0x13')]));});});};exports[_0xfc2f('0x20')]=function(_0xdd8e22){var _0x4b9def=this;return new Promise(function(_0x28d0ea,_0x289ea9){return db[_0xfc2f('0x21')][_0xfc2f('0x22')]({'raw':_0xdd8e22[_0xfc2f('0x17')]?_0xdd8e22['options'][_0xfc2f('0x18')]===undefined?!![]:![]:!![],'where':_0xdd8e22[_0xfc2f('0x17')]?_0xdd8e22['options'][_0xfc2f('0x23')]||null:null,'attributes':_0xdd8e22[_0xfc2f('0x17')]?_0xdd8e22[_0xfc2f('0x17')][_0xfc2f('0x19')]||null:null,'include':_0xdd8e22[_0xfc2f('0x17')]?_0xdd8e22[_0xfc2f('0x17')][_0xfc2f('0x1b')]?_[_0xfc2f('0x1a')](_0xdd8e22[_0xfc2f('0x17')][_0xfc2f('0x1b')],function(_0x464914){return{'model':db[_0x464914[_0xfc2f('0x1c')]],'as':_0x464914['as'],'attributes':_0x464914[_0xfc2f('0x19')],'include':_0x464914['include']?_[_0xfc2f('0x1a')](_0x464914[_0xfc2f('0x1b')],function(_0x526176){return{'model':db[_0x526176[_0xfc2f('0x1c')]],'as':_0x526176['as'],'attributes':_0x526176[_0xfc2f('0x19')],'include':_0x526176['include']?_['map'](_0x526176[_0xfc2f('0x1b')],function(_0x338376){return{'model':db[_0x338376['model']],'as':_0x338376['as'],'attributes':_0x338376[_0xfc2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfc2f('0xd')](function(_0x576a5f){logger[_0xfc2f('0x14')](_0xfc2f('0x20'),_0xdd8e22);logger['debug'](_0xfc2f('0x20'),_0xdd8e22,JSON['stringify'](_0x576a5f));_0x28d0ea(_0x576a5f);})[_0xfc2f('0x1f')](function(_0x1c7e47){logger[_0xfc2f('0x11')](_0xfc2f('0x20'),_0x1c7e47[_0xfc2f('0x13')],_0xdd8e22);_0x289ea9(_0x4b9def[_0xfc2f('0x11')](0x1f4,_0x1c7e47[_0xfc2f('0x13')]));});});}; \ No newline at end of file +var _0xd771=['attributes','model','debug','catch','ShowFreshdeskAccount','find','map','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','limit','include'];(function(_0x314112,_0x211859){var _0x36a9e3=function(_0x13d836){while(--_0x13d836){_0x314112['push'](_0x314112['shift']());}};_0x36a9e3(++_0x211859);}(_0xd771,0x14b));var _0x1d77=function(_0x51abea,_0x1bc835){_0x51abea=_0x51abea-0x0;var _0x30a9fe=_0xd771[_0x51abea];return _0x30a9fe;};'use strict';var _=require(_0x1d77('0x0'));var util=require(_0x1d77('0x1'));var moment=require(_0x1d77('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d77('0x3'));var fs=require('fs');var Redis=require(_0x1d77('0x4'));var db=require(_0x1d77('0x5'))['db'];var utils=require(_0x1d77('0x6'));var logger=require(_0x1d77('0x7'))(_0x1d77('0x8'));var config=require('../../config/environment');var jayson=require(_0x1d77('0x9'));var client=jayson[_0x1d77('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bfc22,_0x52d954,_0x3b6a61){return new BPromise(function(_0x59072c,_0x3ff013){return client[_0x1d77('0xb')](_0x1bfc22,_0x3b6a61)[_0x1d77('0xc')](function(_0x47535c){logger[_0x1d77('0xd')](_0x1d77('0xe'),_0x52d954,_0x1d77('0xf'));logger['debug'](_0x1d77('0x10'),_0x52d954,_0x1d77('0xf'),JSON[_0x1d77('0x11')](_0x47535c));if(_0x47535c[_0x1d77('0x12')]){if(_0x47535c[_0x1d77('0x12')][_0x1d77('0x13')]===0x1f4){logger[_0x1d77('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x52d954,_0x47535c[_0x1d77('0x12')][_0x1d77('0x14')]);return _0x3ff013(_0x47535c[_0x1d77('0x12')][_0x1d77('0x14')]);}logger[_0x1d77('0x12')](_0x1d77('0xe'),_0x52d954,_0x47535c[_0x1d77('0x12')][_0x1d77('0x14')]);return _0x59072c(_0x47535c[_0x1d77('0x12')][_0x1d77('0x14')]);}else{logger[_0x1d77('0xd')](_0x1d77('0xe'),_0x52d954,_0x1d77('0xf'));_0x59072c(_0x47535c[_0x1d77('0x15')][_0x1d77('0x14')]);}})['catch'](function(_0x37def0){logger[_0x1d77('0x12')](_0x1d77('0xe'),_0x52d954,_0x37def0);_0x3ff013(_0x37def0);});});}exports[_0x1d77('0x16')]=function(_0x20240b){var _0x48c99b=this;return new Promise(function(_0x3444b9,_0x1bb792){return db[_0x1d77('0x17')]['findAll']({'raw':_0x20240b['options']?_0x20240b[_0x1d77('0x18')][_0x1d77('0x19')]===undefined?!![]:![]:!![],'where':_0x20240b['options']?_0x20240b[_0x1d77('0x18')][_0x1d77('0x1a')]||null:null,'attributes':_0x20240b[_0x1d77('0x18')]?_0x20240b[_0x1d77('0x18')]['attributes']||null:null,'limit':_0x20240b[_0x1d77('0x18')]?_0x20240b[_0x1d77('0x18')][_0x1d77('0x1b')]||null:null,'include':_0x20240b[_0x1d77('0x18')]?_0x20240b[_0x1d77('0x18')][_0x1d77('0x1c')]?_['map'](_0x20240b[_0x1d77('0x18')]['include'],function(_0x562c4f){return{'model':db[_0x562c4f['model']],'as':_0x562c4f['as'],'attributes':_0x562c4f[_0x1d77('0x1d')],'include':_0x562c4f[_0x1d77('0x1c')]?_['map'](_0x562c4f[_0x1d77('0x1c')],function(_0x143506){return{'model':db[_0x143506[_0x1d77('0x1e')]],'as':_0x143506['as'],'attributes':_0x143506[_0x1d77('0x1d')],'include':_0x143506[_0x1d77('0x1c')]?_['map'](_0x143506[_0x1d77('0x1c')],function(_0x59a11f){return{'model':db[_0x59a11f[_0x1d77('0x1e')]],'as':_0x59a11f['as'],'attributes':_0x59a11f[_0x1d77('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d77('0xc')](function(_0x5d4239){logger[_0x1d77('0xd')]('GetFreshdeskAccount',_0x20240b);logger[_0x1d77('0x1f')](_0x1d77('0x16'),_0x20240b,JSON['stringify'](_0x5d4239));_0x3444b9(_0x5d4239);})[_0x1d77('0x20')](function(_0x3c5194){logger[_0x1d77('0x12')]('GetFreshdeskAccount',_0x3c5194[_0x1d77('0x14')],_0x20240b);_0x1bb792(_0x48c99b[_0x1d77('0x12')](0x1f4,_0x3c5194[_0x1d77('0x14')]));});});};exports[_0x1d77('0x21')]=function(_0xb7f0f9){var _0x4a4450=this;return new Promise(function(_0x32e9,_0x3a31a6){return db[_0x1d77('0x17')][_0x1d77('0x22')]({'raw':_0xb7f0f9['options']?_0xb7f0f9[_0x1d77('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xb7f0f9[_0x1d77('0x18')]?_0xb7f0f9[_0x1d77('0x18')][_0x1d77('0x1a')]||null:null,'attributes':_0xb7f0f9['options']?_0xb7f0f9['options']['attributes']||null:null,'include':_0xb7f0f9['options']?_0xb7f0f9[_0x1d77('0x18')]['include']?_[_0x1d77('0x23')](_0xb7f0f9[_0x1d77('0x18')][_0x1d77('0x1c')],function(_0x3103a3){return{'model':db[_0x3103a3[_0x1d77('0x1e')]],'as':_0x3103a3['as'],'attributes':_0x3103a3[_0x1d77('0x1d')],'include':_0x3103a3[_0x1d77('0x1c')]?_['map'](_0x3103a3['include'],function(_0x2fc520){return{'model':db[_0x2fc520[_0x1d77('0x1e')]],'as':_0x2fc520['as'],'attributes':_0x2fc520['attributes'],'include':_0x2fc520['include']?_['map'](_0x2fc520[_0x1d77('0x1c')],function(_0x4276a7){return{'model':db[_0x4276a7[_0x1d77('0x1e')]],'as':_0x4276a7['as'],'attributes':_0x4276a7[_0x1d77('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d77('0xc')](function(_0x309157){logger[_0x1d77('0xd')](_0x1d77('0x21'),_0xb7f0f9);logger[_0x1d77('0x1f')](_0x1d77('0x21'),_0xb7f0f9,JSON[_0x1d77('0x11')](_0x309157));_0x32e9(_0x309157);})[_0x1d77('0x20')](function(_0x4f5628){logger[_0x1d77('0x12')](_0x1d77('0x21'),_0x4f5628[_0x1d77('0x14')],_0xb7f0f9);_0x3a31a6(_0x4a4450[_0x1d77('0x12')](0x1f4,_0x4f5628[_0x1d77('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 969a76b..4ec4bc6 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 _0x7002=['isAuthenticated','/:id','show','get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intFreshdeskConfiguration.controller'];(function(_0x2dafef,_0x5ba5c9){var _0x571a58=function(_0x4c899b){while(--_0x4c899b){_0x2dafef['push'](_0x2dafef['shift']());}};_0x571a58(++_0x5ba5c9);}(_0x7002,0x82));var _0x2700=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0x7002[_0x996bc8];return _0x20b0ea;};'use strict';var multer=require(_0x2700('0x0'));var util=require(_0x2700('0x1'));var path=require(_0x2700('0x2'));var timeout=require(_0x2700('0x3'));var express=require(_0x2700('0x4'));var router=express['Router']();var fs_extra=require(_0x2700('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2700('0x6'));var config=require('../../config/environment');var controller=require(_0x2700('0x7'));router['get']('/',auth[_0x2700('0x8')](),controller['index']);router['get'](_0x2700('0x9'),auth['isAuthenticated'](),controller[_0x2700('0xa')]);router[_0x2700('0xb')](_0x2700('0xc'),auth[_0x2700('0x8')](),controller['getFields']);router[_0x2700('0xb')](_0x2700('0xd'),auth['isAuthenticated'](),controller[_0x2700('0xe')]);router['get'](_0x2700('0xf'),auth[_0x2700('0x8')](),controller[_0x2700('0x10')]);router[_0x2700('0xb')]('/:id/tags',auth[_0x2700('0x8')](),controller[_0x2700('0x11')]);router[_0x2700('0x12')]('/',auth[_0x2700('0x8')](),controller[_0x2700('0x13')]);router[_0x2700('0x12')](_0x2700('0x14'),auth[_0x2700('0x8')](),controller['setTags']);router[_0x2700('0x15')]('/:id',auth[_0x2700('0x8')](),controller[_0x2700('0x16')]);router['delete'](_0x2700('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa25c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','index','/:id','isAuthenticated','show','get','/:id/fields','getSubjects','/:id/tags','post','setTags','put','update','delete','exports','util','path','connect-timeout'];(function(_0x10ed52,_0x4dcad2){var _0x2f4623=function(_0x4fc455){while(--_0x4fc455){_0x10ed52['push'](_0x10ed52['shift']());}};_0x2f4623(++_0x4dcad2);}(_0xa25c,0x13f));var _0xca25=function(_0x5b8155,_0x51c636){_0x5b8155=_0x5b8155-0x0;var _0x1d6f07=_0xa25c[_0x5b8155];return _0x1d6f07;};'use strict';var multer=require('multer');var util=require(_0xca25('0x0'));var path=require(_0xca25('0x1'));var timeout=require(_0xca25('0x2'));var express=require(_0xca25('0x3'));var router=express[_0xca25('0x4')]();var fs_extra=require(_0xca25('0x5'));var auth=require(_0xca25('0x6'));var interaction=require(_0xca25('0x7'));var config=require('../../config/environment');var controller=require(_0xca25('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xca25('0x9')]);router['get'](_0xca25('0xa'),auth[_0xca25('0xb')](),controller[_0xca25('0xc')]);router[_0xca25('0xd')](_0xca25('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xca25('0xd')]('/:id/subjects',auth[_0xca25('0xb')](),controller[_0xca25('0xf')]);router[_0xca25('0xd')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xca25('0xd')](_0xca25('0x10'),auth[_0xca25('0xb')](),controller['getTags']);router['post']('/',auth[_0xca25('0xb')](),controller['create']);router[_0xca25('0x11')](_0xca25('0x10'),auth[_0xca25('0xb')](),controller[_0xca25('0x12')]);router[_0xca25('0x13')](_0xca25('0xa'),auth[_0xca25('0xb')](),controller[_0xca25('0x14')]);router[_0xca25('0x15')](_0xca25('0xa'),auth[_0xca25('0xb')](),controller['destroy']);module[_0xca25('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 9a52aab..f869d62 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 _0xc8ab=['exports','STRING','sequelize'];(function(_0x225dbc,_0x21af28){var _0x26628d=function(_0x521d99){while(--_0x521d99){_0x225dbc['push'](_0x225dbc['shift']());}};_0x26628d(++_0x21af28);}(_0xc8ab,0x65));var _0xbc8a=function(_0x342548,_0x31c72e){_0x342548=_0x342548-0x0;var _0x107140=_0xc8ab[_0x342548];return _0x107140;};'use strict';var Sequelize=require(_0xbc8a('0x0'));module[_0xbc8a('0x1')]={'name':{'type':Sequelize[_0xbc8a('0x2')]},'description':{'type':Sequelize[_0xbc8a('0x2')]}}; \ No newline at end of file +var _0x0b50=['sequelize','exports','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0b50,0x180));var _0x00b5=function(_0x42fc8e,_0x26620d){_0x42fc8e=_0x42fc8e-0x0;var _0x4ad7b5=_0x0b50[_0x42fc8e];return _0x4ad7b5;};'use strict';var Sequelize=require(_0x00b5('0x0'));module[_0x00b5('0x1')]={'name':{'type':Sequelize[_0x00b5('0x2')]},'description':{'type':Sequelize[_0x00b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index cded2a9..99d7481 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 _0xa9e0=['filter','merge','options','FreshdeskConfiguration','count','includeAll','include','findAll','rows','params','intersection','find','body','findOne','FreshdeskField','order','getFields','getSubjects','getDescriptions','Tag','getTags','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','jayson/promise','client','http','request','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x4310b1,_0x2dd4bf){var _0x15d209=function(_0x25dfe6){while(--_0x25dfe6){_0x4310b1['push'](_0x4310b1['shift']());}};_0x15d209(++_0x2dd4bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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'];var jayson=require(_0x0a9e('0x15'));var client=jayson[_0x0a9e('0x16')][_0x0a9e('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x69aeb7,_0x5db4b0,_0x4283ce,_0x239b12){return new BPromise(function(_0x2b4227,_0x281129){var _0x44dcfd=_0x239b12||client;return _0x44dcfd[_0x0a9e('0x18')](_0x69aeb7,_0x4283ce)['then'](function(_0x22dccb){logger['info'](_0x0a9e('0x19'),_0x5db4b0,'request\x20sent');logger[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5db4b0,'request\x20sent',JSON[_0x0a9e('0x1c')](_0x22dccb));if(_0x22dccb['error']){if(_0x22dccb[_0x0a9e('0x1d')][_0x0a9e('0x1e')]===0x1f4){logger[_0x0a9e('0x1d')](_0x0a9e('0x19'),_0x5db4b0,_0x22dccb[_0x0a9e('0x1d')][_0x0a9e('0x1f')]);return _0x281129(_0x22dccb[_0x0a9e('0x1d')][_0x0a9e('0x1f')]);}logger[_0x0a9e('0x1d')](_0x0a9e('0x19'),_0x5db4b0,_0x22dccb[_0x0a9e('0x1d')][_0x0a9e('0x1f')]);return _0x2b4227(_0x22dccb['error'][_0x0a9e('0x1f')]);}else{logger[_0x0a9e('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5db4b0,_0x0a9e('0x21'));_0x2b4227(_0x22dccb['result']['message']);}})[_0x0a9e('0x22')](function(_0x432e56){logger[_0x0a9e('0x1d')](_0x0a9e('0x19'),_0x5db4b0,_0x432e56);_0x281129(_0x432e56);});});}function respondWithStatusCode(_0x4abc77,_0xfb6e48){_0xfb6e48=_0xfb6e48||0xcc;return function(_0x2fb0e4){if(_0x2fb0e4){return _0x4abc77[_0x0a9e('0x23')](_0xfb6e48);}return _0x4abc77[_0x0a9e('0x24')](_0xfb6e48)[_0x0a9e('0x25')]();};}function respondWithResult(_0x42ac8f,_0x16b1ca){_0x16b1ca=_0x16b1ca||0xc8;return function(_0x5ea472){if(_0x5ea472){return _0x42ac8f['status'](_0x16b1ca)[_0x0a9e('0x26')](_0x5ea472);}};}function respondWithFilteredResult(_0x3a8e58,_0x40c424){return function(_0x33161b){if(_0x33161b){var _0x526cf3=_0x33161b['count'],_0x384319=_0x40c424[_0x0a9e('0x27')],_0x479bc4=_0x40c424[_0x0a9e('0x27')]+_0x40c424[_0x0a9e('0x28')],_0x45a1e7;if(_0x479bc4>=_0x526cf3){_0x479bc4=_0x526cf3;_0x45a1e7=0xc8;}else{_0x45a1e7=0xce;}_0x3a8e58[_0x0a9e('0x24')](_0x45a1e7);return _0x3a8e58[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x384319+'-'+_0x479bc4+'/'+_0x526cf3)[_0x0a9e('0x26')](_0x33161b);}return null;};}function patchUpdates(_0x14de77){return function(_0x5a101a){try{jsonpatch[_0x0a9e('0x2b')](_0x5a101a,_0x14de77,!![]);}catch(_0x468813){return BPromise[_0x0a9e('0x2c')](_0x468813);}return _0x5a101a[_0x0a9e('0x2d')]();};}function saveUpdates(_0x5c877d,_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x2e')](_0x5c877d)[_0x0a9e('0x2f')](function(_0x58b06f){return _0x58b06f;});}return null;};}function removeEntity(_0x563b45,_0x296f41){return function(_0x2e8759){if(_0x2e8759){return _0x2e8759[_0x0a9e('0x30')]()['then'](function(){_0x563b45[_0x0a9e('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2407f9,_0x3ae878){return function(_0x1122db){if(!_0x1122db){_0x2407f9[_0x0a9e('0x23')](0x194);}return _0x1122db;};}function handleError(_0x25ce3a,_0x5180f1){_0x5180f1=_0x5180f1||0x1f4;return function(_0x66c1d2){logger[_0x0a9e('0x1d')](_0x66c1d2[_0x0a9e('0x31')]);if(_0x66c1d2[_0x0a9e('0x32')]){delete _0x66c1d2[_0x0a9e('0x32')];}_0x25ce3a[_0x0a9e('0x24')](_0x5180f1)[_0x0a9e('0x33')](_0x66c1d2);};}exports[_0x0a9e('0x34')]=function(_0x5583a4,_0x44295a){var _0x5e7238={},_0x2cc7a0={},_0x14b13f={'count':0x0,'rows':[]};var _0x2b7e7f=_[_0x0a9e('0x35')](db['FreshdeskConfiguration'][_0x0a9e('0x36')],function(_0xd1836d){return{'name':_0xd1836d[_0x0a9e('0x37')],'type':_0xd1836d[_0x0a9e('0x38')]['key']};});_0x2cc7a0['model']=_[_0x0a9e('0x35')](_0x2b7e7f,'name');_0x2cc7a0[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x5583a4[_0x0a9e('0x39')]);_0x2cc7a0[_0x0a9e('0x3b')]=_['intersection'](_0x2cc7a0[_0x0a9e('0x3c')],_0x2cc7a0[_0x0a9e('0x39')]);_0x5e7238[_0x0a9e('0x3d')]=_['intersection'](_0x2cc7a0[_0x0a9e('0x3c')],qs[_0x0a9e('0x3e')](_0x5583a4[_0x0a9e('0x39')]['fields']));_0x5e7238['attributes']=_0x5e7238[_0x0a9e('0x3d')][_0x0a9e('0x3f')]?_0x5e7238['attributes']:_0x2cc7a0[_0x0a9e('0x3c')];if(!_0x5583a4[_0x0a9e('0x39')][_0x0a9e('0x40')](_0x0a9e('0x41'))){_0x5e7238['limit']=qs['limit'](_0x5583a4[_0x0a9e('0x39')][_0x0a9e('0x28')]);_0x5e7238['offset']=qs[_0x0a9e('0x27')](_0x5583a4[_0x0a9e('0x39')][_0x0a9e('0x27')]);}_0x5e7238['order']=qs[_0x0a9e('0x42')](_0x5583a4[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x5e7238[_0x0a9e('0x43')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x44')](_0x5583a4[_0x0a9e('0x39')],_0x2cc7a0[_0x0a9e('0x3b')]),_0x2b7e7f);if(_0x5583a4[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x5e7238[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x5e7238[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x35')](_0x2b7e7f,function(_0x37f6cc){if(_0x37f6cc['type']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x37f6cc[_0x0a9e('0x32')]]={'$like':'%'+_0x5583a4[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x5e7238=_[_0x0a9e('0x46')]({},_0x5e7238,_0x5583a4[_0x0a9e('0x47')]);var _0x10b040={'where':_0x5e7238[_0x0a9e('0x43')]};return db[_0x0a9e('0x48')][_0x0a9e('0x49')](_0x10b040)[_0x0a9e('0x2f')](function(_0x35ed4a){_0x14b13f['count']=_0x35ed4a;if(_0x5583a4[_0x0a9e('0x39')][_0x0a9e('0x4a')]){_0x5e7238[_0x0a9e('0x4b')]=[{'all':!![]}];}return db[_0x0a9e('0x48')][_0x0a9e('0x4c')](_0x5e7238);})[_0x0a9e('0x2f')](function(_0x21eb86){_0x14b13f[_0x0a9e('0x4d')]=_0x21eb86;return _0x14b13f;})['then'](respondWithFilteredResult(_0x44295a,_0x5e7238))[_0x0a9e('0x22')](handleError(_0x44295a,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4e')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x3c')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x48')][_0x0a9e('0x36')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3b')]=_[_0x0a9e('0x4f')](_0x562fb4[_0x0a9e('0x3c')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3d')]=_[_0x0a9e('0x4f')](_0x562fb4[_0x0a9e('0x3c')],qs[_0x0a9e('0x3e')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3d')]=_0x8d6dd1[_0x0a9e('0x3d')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4a')]){_0x8d6dd1[_0x0a9e('0x4b')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x47')]);return db[_0x0a9e('0x48')][_0x0a9e('0x50')](_0x8d6dd1)[_0x0a9e('0x2f')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x48')]['create'](_0x39d77d[_0x0a9e('0x51')],{})[_0x0a9e('0x2f')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x51')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x48')][_0x0a9e('0x50')]({'where':{'id':_0x2ef381[_0x0a9e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x2f')](saveUpdates(_0x2ef381[_0x0a9e('0x51')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x48')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x2f')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getFields']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x48')][_0x0a9e('0x52')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x2f')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x3c')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x53')][_0x0a9e('0x36')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3b')]=_['intersection'](_0x65432[_0x0a9e('0x3c')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3d')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3d')]=_0x2f7092[_0x0a9e('0x3d')][_0x0a9e('0x3f')]?_0x2f7092[_0x0a9e('0x3d')]:_0x65432[_0x0a9e('0x3c')];_0x2f7092[_0x0a9e('0x54')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3b')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x35')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x55')](_0x2f7092);}})[_0x0a9e('0x2f')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);_0x2f7092[_0x0a9e('0x27')]=qs[_0x0a9e('0x27')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x27')]);}return _0x3cfd00[_0x0a9e('0x55')](_0x2f7092);}})[_0x0a9e('0x2f')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x2f')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x22')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x56')]=function(_0x320898,_0x412a72,_0x2a28c0){var _0x4257c9={};var _0x5150a4={};var _0x1b0b98;var _0x295763;return db[_0x0a9e('0x48')]['findOne']({'where':{'id':_0x320898[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x2f')](handleEntityNotFound(_0x412a72,null))['then'](function(_0x83f0b2){if(_0x83f0b2){_0x1b0b98=_0x83f0b2;_0x5150a4[_0x0a9e('0x3c')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x53')][_0x0a9e('0x36')]);_0x5150a4['query']=_['keys'](_0x320898['query']);_0x5150a4[_0x0a9e('0x3b')]=_[_0x0a9e('0x4f')](_0x5150a4[_0x0a9e('0x3c')],_0x5150a4[_0x0a9e('0x39')]);_0x4257c9[_0x0a9e('0x3d')]=_[_0x0a9e('0x4f')](_0x5150a4[_0x0a9e('0x3c')],qs[_0x0a9e('0x3e')](_0x320898['query'][_0x0a9e('0x3e')]));_0x4257c9[_0x0a9e('0x3d')]=_0x4257c9[_0x0a9e('0x3d')]['length']?_0x4257c9[_0x0a9e('0x3d')]:_0x5150a4['model'];_0x4257c9[_0x0a9e('0x54')]=qs[_0x0a9e('0x42')](_0x320898['query'][_0x0a9e('0x42')]);_0x4257c9[_0x0a9e('0x43')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x44')](_0x320898['query'],_0x5150a4[_0x0a9e('0x3b')]));if(_0x320898[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x4257c9[_0x0a9e('0x43')]=_['merge'](_0x4257c9[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x35')](_0x4257c9[_0x0a9e('0x3d')],function(_0x361b21){var _0x4abc8f={};_0x4abc8f[_0x361b21]={'$like':'%'+_0x320898[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x4abc8f;})});}_0x4257c9=_[_0x0a9e('0x46')]({},_0x4257c9,_0x320898[_0x0a9e('0x47')]);return _0x1b0b98[_0x0a9e('0x56')](_0x4257c9);}})[_0x0a9e('0x2f')](function(_0x40fc56){if(_0x40fc56){_0x295763=_0x40fc56[_0x0a9e('0x3f')];if(!_0x320898[_0x0a9e('0x39')][_0x0a9e('0x40')](_0x0a9e('0x41'))){_0x4257c9[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x320898[_0x0a9e('0x39')]['limit']);_0x4257c9[_0x0a9e('0x27')]=qs[_0x0a9e('0x27')](_0x320898[_0x0a9e('0x39')]['offset']);}return _0x1b0b98[_0x0a9e('0x56')](_0x4257c9);}})[_0x0a9e('0x2f')](function(_0x8cea96){if(_0x8cea96){return _0x8cea96?{'count':_0x295763,'rows':_0x8cea96}:null;}})[_0x0a9e('0x2f')](respondWithResult(_0x412a72,null))['catch'](handleError(_0x412a72,null));};exports['getDescriptions']=function(_0x7ebea8,_0x2bbdb5,_0x4c54fa){var _0x45108c={};var _0x53a6a1={};var _0x260f4b;var _0x8ebf02;return db['FreshdeskConfiguration'][_0x0a9e('0x52')]({'where':{'id':_0x7ebea8[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x2f')](handleEntityNotFound(_0x2bbdb5,null))[_0x0a9e('0x2f')](function(_0x3755fe){if(_0x3755fe){_0x260f4b=_0x3755fe;_0x53a6a1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3a')](db['FreshdeskField'][_0x0a9e('0x36')]);_0x53a6a1[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x7ebea8[_0x0a9e('0x39')]);_0x53a6a1['filters']=_[_0x0a9e('0x4f')](_0x53a6a1[_0x0a9e('0x3c')],_0x53a6a1['query']);_0x45108c[_0x0a9e('0x3d')]=_['intersection'](_0x53a6a1[_0x0a9e('0x3c')],qs[_0x0a9e('0x3e')](_0x7ebea8[_0x0a9e('0x39')][_0x0a9e('0x3e')]));_0x45108c['attributes']=_0x45108c['attributes'][_0x0a9e('0x3f')]?_0x45108c[_0x0a9e('0x3d')]:_0x53a6a1[_0x0a9e('0x3c')];_0x45108c['order']=qs[_0x0a9e('0x42')](_0x7ebea8[_0x0a9e('0x39')]['sort']);_0x45108c['where']=qs[_0x0a9e('0x3b')](_['pick'](_0x7ebea8['query'],_0x53a6a1['filters']));if(_0x7ebea8[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x45108c[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x45108c[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x35')](_0x45108c['attributes'],function(_0x5fd5db){var _0x5955f1={};_0x5955f1[_0x5fd5db]={'$like':'%'+_0x7ebea8[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x5955f1;})});}_0x45108c=_[_0x0a9e('0x46')]({},_0x45108c,_0x7ebea8[_0x0a9e('0x47')]);return _0x260f4b['getDescriptions'](_0x45108c);}})[_0x0a9e('0x2f')](function(_0x32f761){if(_0x32f761){_0x8ebf02=_0x32f761[_0x0a9e('0x3f')];if(!_0x7ebea8['query'][_0x0a9e('0x40')](_0x0a9e('0x41'))){_0x45108c[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x7ebea8[_0x0a9e('0x39')][_0x0a9e('0x28')]);_0x45108c[_0x0a9e('0x27')]=qs[_0x0a9e('0x27')](_0x7ebea8['query'][_0x0a9e('0x27')]);}return _0x260f4b[_0x0a9e('0x57')](_0x45108c);}})['then'](function(_0x40e0f0){if(_0x40e0f0){return _0x40e0f0?{'count':_0x8ebf02,'rows':_0x40e0f0}:null;}})[_0x0a9e('0x2f')](respondWithResult(_0x2bbdb5,null))[_0x0a9e('0x22')](handleError(_0x2bbdb5,null));};exports['getTags']=function(_0x96672f,_0x52ec10,_0x8c8fbe){var _0x2b5148={};var _0x558a87={};var _0x1f29bd;var _0x842d6f;return db[_0x0a9e('0x48')][_0x0a9e('0x52')]({'where':{'id':_0x96672f[_0x0a9e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x52ec10,null))[_0x0a9e('0x2f')](function(_0x31d25a){if(_0x31d25a){_0x1f29bd=_0x31d25a;_0x558a87[_0x0a9e('0x3c')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x58')][_0x0a9e('0x36')]);_0x558a87[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x96672f[_0x0a9e('0x39')]);_0x558a87[_0x0a9e('0x3b')]=_[_0x0a9e('0x4f')](_0x558a87[_0x0a9e('0x3c')],_0x558a87[_0x0a9e('0x39')]);_0x2b5148['attributes']=_[_0x0a9e('0x4f')](_0x558a87[_0x0a9e('0x3c')],qs[_0x0a9e('0x3e')](_0x96672f[_0x0a9e('0x39')][_0x0a9e('0x3e')]));_0x2b5148['attributes']=_0x2b5148[_0x0a9e('0x3d')][_0x0a9e('0x3f')]?_0x2b5148['attributes']:_0x558a87[_0x0a9e('0x3c')];_0x2b5148['order']=qs[_0x0a9e('0x42')](_0x96672f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x2b5148[_0x0a9e('0x43')]=qs['filters'](_[_0x0a9e('0x44')](_0x96672f['query'],_0x558a87[_0x0a9e('0x3b')]));if(_0x96672f[_0x0a9e('0x39')]['filter']){_0x2b5148[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x2b5148[_0x0a9e('0x43')],{'$or':_['map'](_0x2b5148['attributes'],function(_0x1b82b7){var _0x6ba2be={};_0x6ba2be[_0x1b82b7]={'$like':'%'+_0x96672f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x6ba2be;})});}_0x2b5148=_[_0x0a9e('0x46')]({},_0x2b5148,_0x96672f[_0x0a9e('0x47')]);return _0x1f29bd[_0x0a9e('0x59')](_0x2b5148);}})[_0x0a9e('0x2f')](function(_0x3f8124){if(_0x3f8124){_0x842d6f=_0x3f8124['length'];if(!_0x96672f[_0x0a9e('0x39')]['hasOwnProperty'](_0x0a9e('0x41'))){_0x2b5148[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x96672f[_0x0a9e('0x39')][_0x0a9e('0x28')]);_0x2b5148['offset']=qs[_0x0a9e('0x27')](_0x96672f[_0x0a9e('0x39')][_0x0a9e('0x27')]);}return _0x1f29bd[_0x0a9e('0x59')](_0x2b5148);}})[_0x0a9e('0x2f')](function(_0x5c66ef){if(_0x5c66ef){return _0x5c66ef?{'count':_0x842d6f,'rows':_0x5c66ef}:null;}})['then'](respondWithResult(_0x52ec10,null))[_0x0a9e('0x22')](handleError(_0x52ec10,null));};exports['setTags']=function(_0x25eae0,_0x4658df,_0x4672e1){if(_0x25eae0[_0x0a9e('0x51')]['id']){delete _0x25eae0[_0x0a9e('0x51')]['id'];}return db[_0x0a9e('0x48')]['findOne']({'where':{'id':_0x25eae0['params']['id']}})[_0x0a9e('0x2f')](handleEntityNotFound(_0x4658df,null))['then'](function(_0x2469d1){if(_0x2469d1){return _0x2469d1['setTags'](_0x25eae0[_0x0a9e('0x51')]['ids']||[]);}return null;})['then'](respondWithResult(_0x4658df,null))[_0x0a9e('0x22')](handleError(_0x4658df,null));}; \ No newline at end of file +var _0xd8b0=['jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','limit','order','sort','filter','where','merge','include','findAll','rows','catch','show','params','length','find','create','body','getFields','findOne','FreshdeskField','pick','options','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto'];(function(_0x2fbca6,_0x3f876f){var _0x330da4=function(_0x3c8b35){while(--_0x3c8b35){_0x2fbca6['push'](_0x2fbca6['shift']());}};_0x330da4(++_0x3f876f);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];var jayson=require(_0x0d8b('0x18'));var client=jayson[_0x0d8b('0x19')][_0x0d8b('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x15dd0f,_0x31a8cc,_0x1d4bbc,_0x2ce75e){return new BPromise(function(_0x5ad086,_0xe65334){var _0x1567ce=_0x2ce75e||client;return _0x1567ce[_0x0d8b('0x1b')](_0x15dd0f,_0x1d4bbc)['then'](function(_0x23eb7b){logger[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x31a8cc,_0x0d8b('0x1e'));logger[_0x0d8b('0x1f')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x31a8cc,_0x0d8b('0x1e'),JSON[_0x0d8b('0x20')](_0x23eb7b));if(_0x23eb7b[_0x0d8b('0x21')]){if(_0x23eb7b[_0x0d8b('0x21')][_0x0d8b('0x22')]===0x1f4){logger[_0x0d8b('0x21')](_0x0d8b('0x1d'),_0x31a8cc,_0x23eb7b[_0x0d8b('0x21')]['message']);return _0xe65334(_0x23eb7b[_0x0d8b('0x21')][_0x0d8b('0x23')]);}logger[_0x0d8b('0x21')](_0x0d8b('0x1d'),_0x31a8cc,_0x23eb7b[_0x0d8b('0x21')][_0x0d8b('0x23')]);return _0x5ad086(_0x23eb7b[_0x0d8b('0x21')][_0x0d8b('0x23')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x31a8cc,_0x0d8b('0x1e'));_0x5ad086(_0x23eb7b['result']['message']);}})['catch'](function(_0x238728){logger[_0x0d8b('0x21')](_0x0d8b('0x1d'),_0x31a8cc,_0x238728);_0xe65334(_0x238728);});});}function respondWithStatusCode(_0x38efc8,_0x221071){_0x221071=_0x221071||0xcc;return function(_0x2c64e2){if(_0x2c64e2){return _0x38efc8[_0x0d8b('0x24')](_0x221071);}return _0x38efc8[_0x0d8b('0x25')](_0x221071)[_0x0d8b('0x26')]();};}function respondWithResult(_0x5e5bc3,_0xe8bbee){_0xe8bbee=_0xe8bbee||0xc8;return function(_0x4463ee){if(_0x4463ee){return _0x5e5bc3['status'](_0xe8bbee)[_0x0d8b('0x27')](_0x4463ee);}};}function respondWithFilteredResult(_0x4a0ae4,_0x3dd149){return function(_0x234bdd){if(_0x234bdd){var _0xa2af02=_0x234bdd[_0x0d8b('0x28')],_0x4fe6f9=_0x3dd149['offset'],_0x59a905=_0x3dd149[_0x0d8b('0x29')]+_0x3dd149['limit'],_0x28f639;if(_0x59a905>=_0xa2af02){_0x59a905=_0xa2af02;_0x28f639=0xc8;}else{_0x28f639=0xce;}_0x4a0ae4[_0x0d8b('0x25')](_0x28f639);return _0x4a0ae4['set'](_0x0d8b('0x2a'),_0x4fe6f9+'-'+_0x59a905+'/'+_0xa2af02)['json'](_0x234bdd);}return null;};}function patchUpdates(_0x2ab00d){return function(_0x546bf6){try{jsonpatch[_0x0d8b('0x2b')](_0x546bf6,_0x2ab00d,!![]);}catch(_0x544735){return BPromise[_0x0d8b('0x2c')](_0x544735);}return _0x546bf6[_0x0d8b('0x2d')]();};}function saveUpdates(_0x2c058d,_0x56120a){return function(_0x4c80a2){if(_0x4c80a2){return _0x4c80a2['update'](_0x2c058d)[_0x0d8b('0x2e')](function(_0x5515d2){return _0x5515d2;});}return null;};}function removeEntity(_0x3cdf3c,_0x54f6f3){return function(_0x5d05fc){if(_0x5d05fc){return _0x5d05fc[_0x0d8b('0x2f')]()[_0x0d8b('0x2e')](function(){_0x3cdf3c[_0x0d8b('0x25')](0xcc)[_0x0d8b('0x26')]();});}};}function handleEntityNotFound(_0x183220,_0xeaa769){return function(_0x4a99d3){if(!_0x4a99d3){_0x183220[_0x0d8b('0x24')](0x194);}return _0x4a99d3;};}function handleError(_0x553e03,_0x37ca42){_0x37ca42=_0x37ca42||0x1f4;return function(_0x3ef48d){logger['error'](_0x3ef48d[_0x0d8b('0x30')]);if(_0x3ef48d[_0x0d8b('0x31')]){delete _0x3ef48d[_0x0d8b('0x31')];}_0x553e03['status'](_0x37ca42)[_0x0d8b('0x32')](_0x3ef48d);};}exports[_0x0d8b('0x33')]=function(_0x206157,_0x31ceba){var _0x933e01={},_0x55d742={},_0x3f1cb3={'count':0x0,'rows':[]};var _0x1649fc=_['map'](db[_0x0d8b('0x34')][_0x0d8b('0x35')],function(_0x188af2){return{'name':_0x188af2[_0x0d8b('0x36')],'type':_0x188af2[_0x0d8b('0x37')]['key']};});_0x55d742['model']=_[_0x0d8b('0x38')](_0x1649fc,'name');_0x55d742['query']=_[_0x0d8b('0x39')](_0x206157[_0x0d8b('0x3a')]);_0x55d742[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x55d742[_0x0d8b('0x3d')],_0x55d742[_0x0d8b('0x3a')]);_0x933e01['attributes']=_[_0x0d8b('0x3c')](_0x55d742[_0x0d8b('0x3d')],qs[_0x0d8b('0x3e')](_0x206157[_0x0d8b('0x3a')][_0x0d8b('0x3e')]));_0x933e01[_0x0d8b('0x3f')]=_0x933e01[_0x0d8b('0x3f')]['length']?_0x933e01[_0x0d8b('0x3f')]:_0x55d742[_0x0d8b('0x3d')];if(!_0x206157[_0x0d8b('0x3a')][_0x0d8b('0x40')]('nolimit')){_0x933e01[_0x0d8b('0x41')]=qs['limit'](_0x206157[_0x0d8b('0x3a')][_0x0d8b('0x41')]);_0x933e01[_0x0d8b('0x29')]=qs[_0x0d8b('0x29')](_0x206157[_0x0d8b('0x3a')][_0x0d8b('0x29')]);}_0x933e01[_0x0d8b('0x42')]=qs[_0x0d8b('0x43')](_0x206157[_0x0d8b('0x3a')][_0x0d8b('0x43')]);_0x933e01['where']=qs['filters'](_['pick'](_0x206157['query'],_0x55d742['filters']),_0x1649fc);if(_0x206157[_0x0d8b('0x3a')][_0x0d8b('0x44')]){_0x933e01[_0x0d8b('0x45')]=_['merge'](_0x933e01['where'],{'$or':_[_0x0d8b('0x38')](_0x1649fc,function(_0x192de1){if(_0x192de1[_0x0d8b('0x37')]!=='VIRTUAL'){var _0x214583={};_0x214583[_0x192de1[_0x0d8b('0x31')]]={'$like':'%'+_0x206157['query']['filter']+'%'};return _0x214583;}})});}_0x933e01=_[_0x0d8b('0x46')]({},_0x933e01,_0x206157['options']);var _0x1e22e5={'where':_0x933e01['where']};return db['FreshdeskConfiguration'][_0x0d8b('0x28')](_0x1e22e5)[_0x0d8b('0x2e')](function(_0x5a75c7){_0x3f1cb3['count']=_0x5a75c7;if(_0x206157['query']['includeAll']){_0x933e01[_0x0d8b('0x47')]=[{'all':!![]}];}return db[_0x0d8b('0x34')][_0x0d8b('0x48')](_0x933e01);})['then'](function(_0xb0910e){_0x3f1cb3[_0x0d8b('0x49')]=_0xb0910e;return _0x3f1cb3;})[_0x0d8b('0x2e')](respondWithFilteredResult(_0x31ceba,_0x933e01))[_0x0d8b('0x4a')](handleError(_0x31ceba,null));};exports[_0x0d8b('0x4b')]=function(_0x2d5246,_0x11d22b){var _0x1d5067={'raw':![],'where':{'id':_0x2d5246[_0x0d8b('0x4c')]['id']}},_0x384a5e={};_0x384a5e[_0x0d8b('0x3d')]=_[_0x0d8b('0x39')](db[_0x0d8b('0x34')][_0x0d8b('0x35')]);_0x384a5e[_0x0d8b('0x3a')]=_[_0x0d8b('0x39')](_0x2d5246[_0x0d8b('0x3a')]);_0x384a5e[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x384a5e['model'],_0x384a5e[_0x0d8b('0x3a')]);_0x1d5067['attributes']=_['intersection'](_0x384a5e[_0x0d8b('0x3d')],qs[_0x0d8b('0x3e')](_0x2d5246[_0x0d8b('0x3a')][_0x0d8b('0x3e')]));_0x1d5067['attributes']=_0x1d5067[_0x0d8b('0x3f')][_0x0d8b('0x4d')]?_0x1d5067[_0x0d8b('0x3f')]:_0x384a5e[_0x0d8b('0x3d')];if(_0x2d5246[_0x0d8b('0x3a')]['includeAll']){_0x1d5067['include']=[{'all':!![]}];}_0x1d5067=_['merge']({},_0x1d5067,_0x2d5246['options']);return db[_0x0d8b('0x34')][_0x0d8b('0x4e')](_0x1d5067)['then'](handleEntityNotFound(_0x11d22b,null))['then'](respondWithResult(_0x11d22b,null))[_0x0d8b('0x4a')](handleError(_0x11d22b,null));};exports[_0x0d8b('0x4f')]=function(_0x5c5bd7,_0x5ef6c3){return db[_0x0d8b('0x34')][_0x0d8b('0x4f')](_0x5c5bd7[_0x0d8b('0x50')],{})[_0x0d8b('0x2e')](respondWithResult(_0x5ef6c3,0xc9))[_0x0d8b('0x4a')](handleError(_0x5ef6c3,null));};exports['update']=function(_0x2de903,_0x2afe34){if(_0x2de903['body']['id']){delete _0x2de903['body']['id'];}return db[_0x0d8b('0x34')][_0x0d8b('0x4e')]({'where':{'id':_0x2de903['params']['id']}})['then'](handleEntityNotFound(_0x2afe34,null))[_0x0d8b('0x2e')](saveUpdates(_0x2de903[_0x0d8b('0x50')],null))[_0x0d8b('0x2e')](respondWithResult(_0x2afe34,null))[_0x0d8b('0x4a')](handleError(_0x2afe34,null));};exports['destroy']=function(_0x356b3d,_0x598e03){return db['FreshdeskConfiguration'][_0x0d8b('0x4e')]({'where':{'id':_0x356b3d[_0x0d8b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x598e03,null))['then'](removeEntity(_0x598e03,null))[_0x0d8b('0x4a')](handleError(_0x598e03,null));};exports[_0x0d8b('0x51')]=function(_0xccc2a9,_0x2c1eb0,_0x3afc3a){var _0xb66e76={};var _0x3978e5={};var _0x3bead7;var _0x5418d8;return db[_0x0d8b('0x34')][_0x0d8b('0x52')]({'where':{'id':_0xccc2a9[_0x0d8b('0x4c')]['id']}})[_0x0d8b('0x2e')](handleEntityNotFound(_0x2c1eb0,null))[_0x0d8b('0x2e')](function(_0x47104e){if(_0x47104e){_0x3bead7=_0x47104e;_0x3978e5[_0x0d8b('0x3d')]=_[_0x0d8b('0x39')](db[_0x0d8b('0x53')]['rawAttributes']);_0x3978e5[_0x0d8b('0x3a')]=_[_0x0d8b('0x39')](_0xccc2a9[_0x0d8b('0x3a')]);_0x3978e5[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x3978e5['model'],_0x3978e5[_0x0d8b('0x3a')]);_0xb66e76[_0x0d8b('0x3f')]=_[_0x0d8b('0x3c')](_0x3978e5[_0x0d8b('0x3d')],qs[_0x0d8b('0x3e')](_0xccc2a9['query']['fields']));_0xb66e76[_0x0d8b('0x3f')]=_0xb66e76[_0x0d8b('0x3f')][_0x0d8b('0x4d')]?_0xb66e76[_0x0d8b('0x3f')]:_0x3978e5['model'];_0xb66e76[_0x0d8b('0x42')]=qs[_0x0d8b('0x43')](_0xccc2a9[_0x0d8b('0x3a')]['sort']);_0xb66e76[_0x0d8b('0x45')]=qs['filters'](_[_0x0d8b('0x54')](_0xccc2a9[_0x0d8b('0x3a')],_0x3978e5[_0x0d8b('0x3b')]));if(_0xccc2a9[_0x0d8b('0x3a')][_0x0d8b('0x44')]){_0xb66e76[_0x0d8b('0x45')]=_['merge'](_0xb66e76[_0x0d8b('0x45')],{'$or':_['map'](_0xb66e76[_0x0d8b('0x3f')],function(_0x4577c8){var _0xafeeb0={};_0xafeeb0[_0x4577c8]={'$like':'%'+_0xccc2a9[_0x0d8b('0x3a')]['filter']+'%'};return _0xafeeb0;})});}_0xb66e76=_[_0x0d8b('0x46')]({},_0xb66e76,_0xccc2a9[_0x0d8b('0x55')]);return _0x3bead7[_0x0d8b('0x51')](_0xb66e76);}})[_0x0d8b('0x2e')](function(_0x2ccdae){if(_0x2ccdae){_0x5418d8=_0x2ccdae[_0x0d8b('0x4d')];if(!_0xccc2a9[_0x0d8b('0x3a')][_0x0d8b('0x40')](_0x0d8b('0x56'))){_0xb66e76[_0x0d8b('0x41')]=qs['limit'](_0xccc2a9['query'][_0x0d8b('0x41')]);_0xb66e76[_0x0d8b('0x29')]=qs['offset'](_0xccc2a9[_0x0d8b('0x3a')]['offset']);}return _0x3bead7['getFields'](_0xb66e76);}})[_0x0d8b('0x2e')](function(_0x1c4e96){if(_0x1c4e96){return _0x1c4e96?{'count':_0x5418d8,'rows':_0x1c4e96}:null;}})['then'](respondWithResult(_0x2c1eb0,null))['catch'](handleError(_0x2c1eb0,null));};exports[_0x0d8b('0x57')]=function(_0x1c007b,_0x70e4b2,_0x435090){var _0x2ab72b={};var _0x156859={};var _0x40d265;var _0x5b4402;return db[_0x0d8b('0x34')]['findOne']({'where':{'id':_0x1c007b[_0x0d8b('0x4c')]['id']}})[_0x0d8b('0x2e')](handleEntityNotFound(_0x70e4b2,null))[_0x0d8b('0x2e')](function(_0x14a34b){if(_0x14a34b){_0x40d265=_0x14a34b;_0x156859['model']=_[_0x0d8b('0x39')](db['FreshdeskField'][_0x0d8b('0x35')]);_0x156859[_0x0d8b('0x3a')]=_[_0x0d8b('0x39')](_0x1c007b[_0x0d8b('0x3a')]);_0x156859[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x156859[_0x0d8b('0x3d')],_0x156859[_0x0d8b('0x3a')]);_0x2ab72b[_0x0d8b('0x3f')]=_[_0x0d8b('0x3c')](_0x156859['model'],qs[_0x0d8b('0x3e')](_0x1c007b['query'][_0x0d8b('0x3e')]));_0x2ab72b[_0x0d8b('0x3f')]=_0x2ab72b['attributes'][_0x0d8b('0x4d')]?_0x2ab72b['attributes']:_0x156859[_0x0d8b('0x3d')];_0x2ab72b[_0x0d8b('0x42')]=qs[_0x0d8b('0x43')](_0x1c007b[_0x0d8b('0x3a')][_0x0d8b('0x43')]);_0x2ab72b[_0x0d8b('0x45')]=qs[_0x0d8b('0x3b')](_[_0x0d8b('0x54')](_0x1c007b['query'],_0x156859[_0x0d8b('0x3b')]));if(_0x1c007b[_0x0d8b('0x3a')]['filter']){_0x2ab72b[_0x0d8b('0x45')]=_[_0x0d8b('0x46')](_0x2ab72b[_0x0d8b('0x45')],{'$or':_[_0x0d8b('0x38')](_0x2ab72b[_0x0d8b('0x3f')],function(_0x9e44b4){var _0x40ff07={};_0x40ff07[_0x9e44b4]={'$like':'%'+_0x1c007b[_0x0d8b('0x3a')][_0x0d8b('0x44')]+'%'};return _0x40ff07;})});}_0x2ab72b=_[_0x0d8b('0x46')]({},_0x2ab72b,_0x1c007b[_0x0d8b('0x55')]);return _0x40d265[_0x0d8b('0x57')](_0x2ab72b);}})['then'](function(_0x1ece98){if(_0x1ece98){_0x5b4402=_0x1ece98[_0x0d8b('0x4d')];if(!_0x1c007b[_0x0d8b('0x3a')]['hasOwnProperty']('nolimit')){_0x2ab72b[_0x0d8b('0x41')]=qs[_0x0d8b('0x41')](_0x1c007b[_0x0d8b('0x3a')]['limit']);_0x2ab72b['offset']=qs[_0x0d8b('0x29')](_0x1c007b[_0x0d8b('0x3a')][_0x0d8b('0x29')]);}return _0x40d265[_0x0d8b('0x57')](_0x2ab72b);}})[_0x0d8b('0x2e')](function(_0x3f7895){if(_0x3f7895){return _0x3f7895?{'count':_0x5b4402,'rows':_0x3f7895}:null;}})[_0x0d8b('0x2e')](respondWithResult(_0x70e4b2,null))[_0x0d8b('0x4a')](handleError(_0x70e4b2,null));};exports[_0x0d8b('0x58')]=function(_0x3a5aea,_0x195901,_0x291336){var _0x3b060e={};var _0x5dbc6b={};var _0x3d3b0b;var _0x1b8b12;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x3a5aea[_0x0d8b('0x4c')]['id']}})[_0x0d8b('0x2e')](handleEntityNotFound(_0x195901,null))[_0x0d8b('0x2e')](function(_0x14b1b8){if(_0x14b1b8){_0x3d3b0b=_0x14b1b8;_0x5dbc6b[_0x0d8b('0x3d')]=_[_0x0d8b('0x39')](db['FreshdeskField']['rawAttributes']);_0x5dbc6b['query']=_[_0x0d8b('0x39')](_0x3a5aea[_0x0d8b('0x3a')]);_0x5dbc6b[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x5dbc6b[_0x0d8b('0x3d')],_0x5dbc6b[_0x0d8b('0x3a')]);_0x3b060e['attributes']=_[_0x0d8b('0x3c')](_0x5dbc6b[_0x0d8b('0x3d')],qs['fields'](_0x3a5aea[_0x0d8b('0x3a')]['fields']));_0x3b060e[_0x0d8b('0x3f')]=_0x3b060e[_0x0d8b('0x3f')][_0x0d8b('0x4d')]?_0x3b060e[_0x0d8b('0x3f')]:_0x5dbc6b[_0x0d8b('0x3d')];_0x3b060e[_0x0d8b('0x42')]=qs[_0x0d8b('0x43')](_0x3a5aea[_0x0d8b('0x3a')][_0x0d8b('0x43')]);_0x3b060e[_0x0d8b('0x45')]=qs[_0x0d8b('0x3b')](_[_0x0d8b('0x54')](_0x3a5aea['query'],_0x5dbc6b['filters']));if(_0x3a5aea[_0x0d8b('0x3a')][_0x0d8b('0x44')]){_0x3b060e[_0x0d8b('0x45')]=_[_0x0d8b('0x46')](_0x3b060e[_0x0d8b('0x45')],{'$or':_[_0x0d8b('0x38')](_0x3b060e[_0x0d8b('0x3f')],function(_0x54674f){var _0x246152={};_0x246152[_0x54674f]={'$like':'%'+_0x3a5aea['query'][_0x0d8b('0x44')]+'%'};return _0x246152;})});}_0x3b060e=_['merge']({},_0x3b060e,_0x3a5aea['options']);return _0x3d3b0b[_0x0d8b('0x58')](_0x3b060e);}})[_0x0d8b('0x2e')](function(_0x25d99f){if(_0x25d99f){_0x1b8b12=_0x25d99f[_0x0d8b('0x4d')];if(!_0x3a5aea[_0x0d8b('0x3a')][_0x0d8b('0x40')](_0x0d8b('0x56'))){_0x3b060e[_0x0d8b('0x41')]=qs[_0x0d8b('0x41')](_0x3a5aea[_0x0d8b('0x3a')][_0x0d8b('0x41')]);_0x3b060e[_0x0d8b('0x29')]=qs['offset'](_0x3a5aea[_0x0d8b('0x3a')][_0x0d8b('0x29')]);}return _0x3d3b0b[_0x0d8b('0x58')](_0x3b060e);}})['then'](function(_0x4ce443){if(_0x4ce443){return _0x4ce443?{'count':_0x1b8b12,'rows':_0x4ce443}:null;}})[_0x0d8b('0x2e')](respondWithResult(_0x195901,null))[_0x0d8b('0x4a')](handleError(_0x195901,null));};exports[_0x0d8b('0x59')]=function(_0x374181,_0xae81df,_0xb8ffcb){var _0x5648eb={};var _0x1a96ce={};var _0x3d6267;var _0x1c5e90;return db[_0x0d8b('0x34')][_0x0d8b('0x52')]({'where':{'id':_0x374181['params']['id']}})['then'](handleEntityNotFound(_0xae81df,null))[_0x0d8b('0x2e')](function(_0x41ea29){if(_0x41ea29){_0x3d6267=_0x41ea29;_0x1a96ce[_0x0d8b('0x3d')]=_['keys'](db[_0x0d8b('0x5a')][_0x0d8b('0x35')]);_0x1a96ce[_0x0d8b('0x3a')]=_['keys'](_0x374181[_0x0d8b('0x3a')]);_0x1a96ce[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x1a96ce[_0x0d8b('0x3d')],_0x1a96ce[_0x0d8b('0x3a')]);_0x5648eb[_0x0d8b('0x3f')]=_[_0x0d8b('0x3c')](_0x1a96ce[_0x0d8b('0x3d')],qs[_0x0d8b('0x3e')](_0x374181['query'][_0x0d8b('0x3e')]));_0x5648eb[_0x0d8b('0x3f')]=_0x5648eb[_0x0d8b('0x3f')][_0x0d8b('0x4d')]?_0x5648eb[_0x0d8b('0x3f')]:_0x1a96ce[_0x0d8b('0x3d')];_0x5648eb[_0x0d8b('0x42')]=qs[_0x0d8b('0x43')](_0x374181[_0x0d8b('0x3a')]['sort']);_0x5648eb['where']=qs[_0x0d8b('0x3b')](_[_0x0d8b('0x54')](_0x374181[_0x0d8b('0x3a')],_0x1a96ce[_0x0d8b('0x3b')]));if(_0x374181['query'][_0x0d8b('0x44')]){_0x5648eb[_0x0d8b('0x45')]=_['merge'](_0x5648eb[_0x0d8b('0x45')],{'$or':_['map'](_0x5648eb[_0x0d8b('0x3f')],function(_0x2e5f7a){var _0x33965a={};_0x33965a[_0x2e5f7a]={'$like':'%'+_0x374181[_0x0d8b('0x3a')][_0x0d8b('0x44')]+'%'};return _0x33965a;})});}_0x5648eb=_[_0x0d8b('0x46')]({},_0x5648eb,_0x374181[_0x0d8b('0x55')]);return _0x3d6267[_0x0d8b('0x59')](_0x5648eb);}})['then'](function(_0x39df85){if(_0x39df85){_0x1c5e90=_0x39df85['length'];if(!_0x374181['query'][_0x0d8b('0x40')]('nolimit')){_0x5648eb[_0x0d8b('0x41')]=qs[_0x0d8b('0x41')](_0x374181['query'][_0x0d8b('0x41')]);_0x5648eb['offset']=qs['offset'](_0x374181[_0x0d8b('0x3a')][_0x0d8b('0x29')]);}return _0x3d6267[_0x0d8b('0x59')](_0x5648eb);}})[_0x0d8b('0x2e')](function(_0x18570d){if(_0x18570d){return _0x18570d?{'count':_0x1c5e90,'rows':_0x18570d}:null;}})['then'](respondWithResult(_0xae81df,null))['catch'](handleError(_0xae81df,null));};exports[_0x0d8b('0x5b')]=function(_0x2e446a,_0x411c15,_0x42a074){if(_0x2e446a[_0x0d8b('0x50')]['id']){delete _0x2e446a[_0x0d8b('0x50')]['id'];}return db[_0x0d8b('0x34')][_0x0d8b('0x52')]({'where':{'id':_0x2e446a['params']['id']}})['then'](handleEntityNotFound(_0x411c15,null))[_0x0d8b('0x2e')](function(_0x2640a6){if(_0x2640a6){return _0x2640a6['setTags'](_0x2e446a['body']['ids']||[]);}return null;})[_0x0d8b('0x2e')](respondWithResult(_0x411c15,null))[_0x0d8b('0x4a')](handleError(_0x411c15,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index f0479d1..8cf26b3 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 _0x8088=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','bluebird','request-promise','path'];(function(_0xe89347,_0x4590e1){var _0x372533=function(_0x14d709){while(--_0x14d709){_0xe89347['push'](_0xe89347['shift']());}};_0x372533(++_0x4590e1);}(_0x8088,0x126));var _0x8808=function(_0x187a63,_0x38b95f){_0x187a63=_0x187a63-0x0;var _0x2ec239=_0x8088[_0x187a63];return _0x2ec239;};'use strict';var _=require(_0x8808('0x0'));var util=require(_0x8808('0x1'));var logger=require('../../config/logger')(_0x8808('0x2'));var moment=require('moment');var BPromise=require(_0x8808('0x3'));var rp=require(_0x8808('0x4'));var fs=require('fs');var path=require(_0x8808('0x5'));var rimraf=require(_0x8808('0x6'));var config=require(_0x8808('0x7'));var attributes=require(_0x8808('0x8'));module['exports']=function(_0x1ae25a,_0x8428fa){return _0x1ae25a[_0x8808('0x9')](_0x8808('0xa'),attributes,{'tableName':_0x8808('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e0a=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x6e0a,0xe6));var _0xa6e0=function(_0x369f28,_0x2c949d){_0x369f28=_0x369f28-0x0;var _0x584c8c=_0x6e0a[_0x369f28];return _0x584c8c;};'use strict';var _=require(_0xa6e0('0x0'));var util=require(_0xa6e0('0x1'));var logger=require('../../config/logger')(_0xa6e0('0x2'));var moment=require(_0xa6e0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6e0('0x4'));var rimraf=require(_0xa6e0('0x5'));var config=require(_0xa6e0('0x6'));var attributes=require(_0xa6e0('0x7'));module[_0xa6e0('0x8')]=function(_0x2a9fc6,_0x561844){return _0x2a9fc6[_0xa6e0('0x9')](_0xa6e0('0xa'),attributes,{'tableName':_0xa6e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 09c7622..927f00b 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 _0xb07d=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','FreshdeskConfiguration,\x20%s,\x20%s','message','lodash','moment'];(function(_0x3a9cae,_0x29b84a){var _0x342f94=function(_0x910cdc){while(--_0x910cdc){_0x3a9cae['push'](_0x3a9cae['shift']());}};_0x342f94(++_0x29b84a);}(_0xb07d,0xfa));var _0xdb07=function(_0x49dbee,_0x43f55e){_0x49dbee=_0x49dbee-0x0;var _0x1b4021=_0xb07d[_0x49dbee];return _0x1b4021;};'use strict';var _=require(_0xdb07('0x0'));var util=require('util');var moment=require(_0xdb07('0x1'));var BPromise=require(_0xdb07('0x2'));var rs=require(_0xdb07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb07('0x4'))['db'];var utils=require(_0xdb07('0x5'));var logger=require('../../config/logger')(_0xdb07('0x6'));var config=require(_0xdb07('0x7'));var jayson=require(_0xdb07('0x8'));var client=jayson[_0xdb07('0x9')][_0xdb07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56dac3,_0xf16502,_0x562c3f){return new BPromise(function(_0x28ea68,_0x55cbff){return client[_0xdb07('0xb')](_0x56dac3,_0x562c3f)[_0xdb07('0xc')](function(_0xd164bf){logger[_0xdb07('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xf16502,'request\x20sent');logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0xf16502,_0xdb07('0xe'),JSON['stringify'](_0xd164bf));if(_0xd164bf['error']){if(_0xd164bf[_0xdb07('0xf')]['code']===0x1f4){logger['error'](_0xdb07('0x10'),_0xf16502,_0xd164bf[_0xdb07('0xf')][_0xdb07('0x11')]);return _0x55cbff(_0xd164bf[_0xdb07('0xf')][_0xdb07('0x11')]);}logger[_0xdb07('0xf')](_0xdb07('0x10'),_0xf16502,_0xd164bf[_0xdb07('0xf')][_0xdb07('0x11')]);return _0x28ea68(_0xd164bf[_0xdb07('0xf')][_0xdb07('0x11')]);}else{logger[_0xdb07('0xd')](_0xdb07('0x10'),_0xf16502,_0xdb07('0xe'));_0x28ea68(_0xd164bf['result'][_0xdb07('0x11')]);}})['catch'](function(_0x4160fb){logger[_0xdb07('0xf')](_0xdb07('0x10'),_0xf16502,_0x4160fb);_0x55cbff(_0x4160fb);});});} \ No newline at end of file +var _0x1018=['stringify','error','message','request\x20sent','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0x1018,0x15a));var _0x8101=function(_0x8acc21,_0x30c6d0){_0x8acc21=_0x8acc21-0x0;var _0x299092=_0x1018[_0x8acc21];return _0x299092;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8101('0x0'));var BPromise=require(_0x8101('0x1'));var rs=require(_0x8101('0x2'));var fs=require('fs');var Redis=require(_0x8101('0x3'));var db=require(_0x8101('0x4'))['db'];var utils=require(_0x8101('0x5'));var logger=require('../../config/logger')(_0x8101('0x6'));var config=require(_0x8101('0x7'));var jayson=require(_0x8101('0x8'));var client=jayson[_0x8101('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7e1e,_0x38e81f,_0x45408c){return new BPromise(function(_0x1c012e,_0x4b8459){return client[_0x8101('0xa')](_0x3f7e1e,_0x45408c)[_0x8101('0xb')](function(_0x2d5458){logger[_0x8101('0xc')](_0x8101('0xd'),_0x38e81f,'request\x20sent');logger['debug'](_0x8101('0xe'),_0x38e81f,'request\x20sent',JSON[_0x8101('0xf')](_0x2d5458));if(_0x2d5458[_0x8101('0x10')]){if(_0x2d5458[_0x8101('0x10')]['code']===0x1f4){logger[_0x8101('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x38e81f,_0x2d5458['error'][_0x8101('0x11')]);return _0x4b8459(_0x2d5458['error']['message']);}logger[_0x8101('0x10')](_0x8101('0xd'),_0x38e81f,_0x2d5458[_0x8101('0x10')][_0x8101('0x11')]);return _0x1c012e(_0x2d5458[_0x8101('0x10')][_0x8101('0x11')]);}else{logger[_0x8101('0xc')](_0x8101('0xd'),_0x38e81f,_0x8101('0x12'));_0x1c012e(_0x2d5458['result'][_0x8101('0x11')]);}})['catch'](function(_0x3616a6){logger[_0x8101('0x10')](_0x8101('0xd'),_0x38e81f,_0x3616a6);_0x4b8459(_0x3616a6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 9f0f55e..b7ae9ed 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 _0x630e=['create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','/:id','post'];(function(_0xa73b06,_0x21dc0c){var _0x56fa10=function(_0x5cd9fd){while(--_0x5cd9fd){_0xa73b06['push'](_0xa73b06['shift']());}};_0x56fa10(++_0x21dc0c);}(_0x630e,0x71));var _0xe630=function(_0x2c6b83,_0x2f3ca3){_0x2c6b83=_0x2c6b83-0x0;var _0x16ed8d=_0x630e[_0x2c6b83];return _0x16ed8d;};'use strict';var multer=require(_0xe630('0x0'));var util=require(_0xe630('0x1'));var path=require(_0xe630('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe630('0x3')]();var fs_extra=require(_0xe630('0x4'));var auth=require(_0xe630('0x5'));var interaction=require(_0xe630('0x6'));var config=require(_0xe630('0x7'));var controller=require(_0xe630('0x8'));router['get']('/',auth[_0xe630('0x9')](),controller[_0xe630('0xa')]);router['get'](_0xe630('0xb'),auth[_0xe630('0x9')](),controller['show']);router[_0xe630('0xc')]('/',auth[_0xe630('0x9')](),controller[_0xe630('0xd')]);router[_0xe630('0xe')]('/:id',auth[_0xe630('0x9')](),controller['update']);router[_0xe630('0xf')]('/:id',auth[_0xe630('0x9')](),controller[_0xe630('0x10')]);module[_0xe630('0x11')]=router; \ No newline at end of file +var _0x7c1a=['/:id','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','show','create'];(function(_0x29cb61,_0x494484){var _0x21d3e0=function(_0x3e0ac4){while(--_0x3e0ac4){_0x29cb61['push'](_0x29cb61['shift']());}};_0x21d3e0(++_0x494484);}(_0x7c1a,0xc7));var _0xa7c1=function(_0x37db8e,_0xabccb8){_0x37db8e=_0x37db8e-0x0;var _0x2cd105=_0x7c1a[_0x37db8e];return _0x2cd105;};'use strict';var multer=require('multer');var util=require(_0xa7c1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa7c1('0x1')]();var fs_extra=require(_0xa7c1('0x2'));var auth=require(_0xa7c1('0x3'));var interaction=require(_0xa7c1('0x4'));var config=require(_0xa7c1('0x5'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0xa7c1('0x6')](),controller['index']);router['get']('/:id',auth[_0xa7c1('0x6')](),controller[_0xa7c1('0x7')]);router['post']('/',auth[_0xa7c1('0x6')](),controller[_0xa7c1('0x8')]);router['put'](_0xa7c1('0x9'),auth[_0xa7c1('0x6')](),controller['update']);router[_0xa7c1('0xa')](_0xa7c1('0x9'),auth[_0xa7c1('0x6')](),controller[_0xa7c1('0xb')]);module[_0xa7c1('0xc')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 021e7c2..60ebe70 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 _0x668b=['string','variable','keyValue','STRING','customVariable','sequelize','exports'];(function(_0x5e9b98,_0x2f612d){var _0x5062d9=function(_0x5245ab){while(--_0x5245ab){_0x5e9b98['push'](_0x5e9b98['shift']());}};_0x5062d9(++_0x2f612d);}(_0x668b,0x140));var _0xb668=function(_0x42c118,_0x197006){_0x42c118=_0x42c118-0x0;var _0x112ebd=_0x668b[_0x42c118];return _0x112ebd;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb668('0x2'),_0xb668('0x3'),'customVariable',_0xb668('0x4'),'picklist'),'defaultValue':_0xb668('0x2')},'content':{'type':Sequelize[_0xb668('0x5')]},'key':{'type':Sequelize[_0xb668('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb668('0x2'),_0xb668('0x3'),_0xb668('0x6'))},'keyContent':{'type':Sequelize[_0xb668('0x5')]},'idField':{'type':Sequelize[_0xb668('0x5')]},'nameField':{'type':Sequelize[_0xb668('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb668('0x5')]}}; \ No newline at end of file +var _0x84ab=['string','variable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x293440,_0x357eff){var _0x596af9=function(_0x37d50c){while(--_0x37d50c){_0x293440['push'](_0x293440['shift']());}};_0x596af9(++_0x357eff);}(_0x84ab,0x12f));var _0xb84a=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x84ab[_0x277fa3];return _0x2e4520;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'type':{'type':Sequelize[_0xb84a('0x2')](_0xb84a('0x3'),_0xb84a('0x4'),'customVariable',_0xb84a('0x5'),_0xb84a('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb84a('0x7')]},'key':{'type':Sequelize[_0xb84a('0x7')]},'keyType':{'type':Sequelize[_0xb84a('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xb84a('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb84a('0x7')]},'customField':{'type':Sequelize[_0xb84a('0x8')],'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 c5a3d6f..8f9058d 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 _0xa9e0=['VIRTUAL','merge','count','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','name','send','map','FreshdeskField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter'];(function(_0x11737b,_0x1f7699){var _0xc71be4=function(_0x4afc54){while(--_0x4afc54){_0x11737b['push'](_0x11737b['shift']());}};_0xc71be4(++_0x1f7699);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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=_0x5d0880['count'],_0x519dfd=_0x22dccb[_0x0a9e('0x19')],_0x16033c=_0x22dccb['offset']+_0x22dccb[_0x0a9e('0x1a')],_0x12066b;if(_0x16033c>=_0x1985b6){_0x16033c=_0x1985b6;_0x12066b=0xc8;}else{_0x12066b=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x12066b);return _0x52a03d[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x519dfd+'-'+_0x16033c+'/'+_0x1985b6)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x2eb11f){return function(_0x530eb7){try{jsonpatch[_0x0a9e('0x1d')](_0x530eb7,_0x2eb11f,!![]);}catch(_0x1314ae){return BPromise[_0x0a9e('0x1e')](_0x1314ae);}return _0x530eb7[_0x0a9e('0x1f')]();};}function saveUpdates(_0x105080,_0x4bb1e3){return function(_0x2c3407){if(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')](_0x105080)['then'](function(_0x20f109){return _0x20f109;});}return null;};}function removeEntity(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x5a09ef[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfb6e48,_0x2fb0e4){return function(_0x3b45bc){if(!_0x3b45bc){_0xfb6e48[_0x0a9e('0x15')](0x194);}return _0x3b45bc;};}function handleError(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0x1f4;return function(_0x16b1ca){logger['error'](_0x16b1ca['stack']);if(_0x16b1ca[_0x0a9e('0x23')]){delete _0x16b1ca[_0x0a9e('0x23')];}_0x370d86[_0x0a9e('0x17')](_0x42ac8f)[_0x0a9e('0x24')](_0x16b1ca);};}exports['index']=function(_0x384319,_0x479bc4){var _0x45a1e7={},_0x5bfb33={},_0x1dc186={'count':0x0,'rows':[]};var _0x34dc65=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x1538a4){return{'name':_0x1538a4[_0x0a9e('0x28')],'type':_0x1538a4[_0x0a9e('0x29')]['key']};});_0x5bfb33[_0x0a9e('0x2a')]=_[_0x0a9e('0x25')](_0x34dc65,_0x0a9e('0x23'));_0x5bfb33[_0x0a9e('0x2b')]=_['keys'](_0x384319[_0x0a9e('0x2b')]);_0x5bfb33[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x5bfb33[_0x0a9e('0x2a')],_0x5bfb33[_0x0a9e('0x2b')]);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5bfb33[_0x0a9e('0x2a')],qs[_0x0a9e('0x2f')](_0x384319['query'][_0x0a9e('0x2f')]));_0x45a1e7['attributes']=_0x45a1e7[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x45a1e7[_0x0a9e('0x2e')]:_0x5bfb33[_0x0a9e('0x2a')];if(!_0x384319[_0x0a9e('0x2b')]['hasOwnProperty'](_0x0a9e('0x31'))){_0x45a1e7[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x1a')]);_0x45a1e7[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x384319[_0x0a9e('0x2b')]['offset']);}_0x45a1e7[_0x0a9e('0x32')]=qs['sort'](_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x33')]);_0x45a1e7[_0x0a9e('0x34')]=qs[_0x0a9e('0x2c')](_['pick'](_0x384319[_0x0a9e('0x2b')],_0x5bfb33[_0x0a9e('0x2c')]),_0x34dc65);if(_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x35')]){_0x45a1e7['where']=_['merge'](_0x45a1e7[_0x0a9e('0x34')],{'$or':_['map'](_0x34dc65,function(_0x24936a){if(_0x24936a[_0x0a9e('0x29')]!==_0x0a9e('0x36')){var _0x1ef87a={};_0x1ef87a[_0x24936a['name']]={'$like':'%'+_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x35')]+'%'};return _0x1ef87a;}})});}_0x45a1e7=_[_0x0a9e('0x37')]({},_0x45a1e7,_0x384319['options']);var _0x1dbf74={'where':_0x45a1e7[_0x0a9e('0x34')]};return db[_0x0a9e('0x26')]['count'](_0x1dbf74)['then'](function(_0x11b61d){_0x1dc186[_0x0a9e('0x38')]=_0x11b61d;if(_0x384319['query'][_0x0a9e('0x39')]){_0x45a1e7[_0x0a9e('0x3a')]=[{'all':!![]}];}return db[_0x0a9e('0x26')][_0x0a9e('0x3b')](_0x45a1e7);})['then'](function(_0x5a594b){_0x1dc186[_0x0a9e('0x3c')]=_0x5a594b;return _0x1dc186;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x479bc4,_0x45a1e7))['catch'](handleError(_0x479bc4,null));};exports[_0x0a9e('0x3d')]=function(_0x1dec2e,_0x1459bb){var _0x5b4f5e={'raw':!![],'where':{'id':_0x1dec2e[_0x0a9e('0x3e')]['id']}},_0x316c8f={};_0x316c8f[_0x0a9e('0x2a')]=_[_0x0a9e('0x3f')](db[_0x0a9e('0x26')][_0x0a9e('0x27')]);_0x316c8f[_0x0a9e('0x2b')]=_[_0x0a9e('0x3f')](_0x1dec2e[_0x0a9e('0x2b')]);_0x316c8f[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x316c8f[_0x0a9e('0x2a')],_0x316c8f[_0x0a9e('0x2b')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x316c8f['model'],qs['fields'](_0x1dec2e[_0x0a9e('0x2b')][_0x0a9e('0x2f')]));_0x5b4f5e[_0x0a9e('0x2e')]=_0x5b4f5e[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x5b4f5e[_0x0a9e('0x2e')]:_0x316c8f[_0x0a9e('0x2a')];if(_0x1dec2e[_0x0a9e('0x2b')][_0x0a9e('0x39')]){_0x5b4f5e[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5b4f5e=_[_0x0a9e('0x37')]({},_0x5b4f5e,_0x1dec2e[_0x0a9e('0x40')]);return db['FreshdeskField'][_0x0a9e('0x41')](_0x5b4f5e)[_0x0a9e('0x22')](handleEntityNotFound(_0x1459bb,null))[_0x0a9e('0x22')](respondWithResult(_0x1459bb,null))[_0x0a9e('0x42')](handleError(_0x1459bb,null));};exports[_0x0a9e('0x43')]=function(_0xbe9d19,_0x21eb86){return db[_0x0a9e('0x26')]['create'](_0xbe9d19[_0x0a9e('0x44')],{})['then'](respondWithResult(_0x21eb86,0xc9))[_0x0a9e('0x42')](handleError(_0x21eb86,null));};exports[_0x0a9e('0x20')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x44')]['id']){delete _0x8d6dd1[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x41')]({'where':{'id':_0x8d6dd1[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x22')](saveUpdates(_0x8d6dd1['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x42')](handleError(_0x562fb4,null));};exports[_0x0a9e('0x21')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x26')][_0x0a9e('0x41')]({'where':{'id':_0x16f976[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x409789,null))['then'](removeEntity(_0x409789,null))[_0x0a9e('0x42')](handleError(_0x409789,null));}; \ No newline at end of file +var _0xa9e0=['VIRTUAL','merge','count','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','name','send','map','FreshdeskField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter'];(function(_0x22b0fd,_0x4b7c20){var _0x3d70ec=function(_0x84695){while(--_0x84695){_0x22b0fd['push'](_0x22b0fd['shift']());}};_0x3d70ec(++_0x4b7c20);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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=_0x5d0880['count'],_0x519dfd=_0x22dccb[_0x0a9e('0x19')],_0x16033c=_0x22dccb['offset']+_0x22dccb[_0x0a9e('0x1a')],_0x12066b;if(_0x16033c>=_0x1985b6){_0x16033c=_0x1985b6;_0x12066b=0xc8;}else{_0x12066b=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x12066b);return _0x52a03d[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x519dfd+'-'+_0x16033c+'/'+_0x1985b6)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x2eb11f){return function(_0x530eb7){try{jsonpatch[_0x0a9e('0x1d')](_0x530eb7,_0x2eb11f,!![]);}catch(_0x1314ae){return BPromise[_0x0a9e('0x1e')](_0x1314ae);}return _0x530eb7[_0x0a9e('0x1f')]();};}function saveUpdates(_0x105080,_0x4bb1e3){return function(_0x2c3407){if(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')](_0x105080)['then'](function(_0x20f109){return _0x20f109;});}return null;};}function removeEntity(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x5a09ef[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfb6e48,_0x2fb0e4){return function(_0x3b45bc){if(!_0x3b45bc){_0xfb6e48[_0x0a9e('0x15')](0x194);}return _0x3b45bc;};}function handleError(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0x1f4;return function(_0x16b1ca){logger['error'](_0x16b1ca['stack']);if(_0x16b1ca[_0x0a9e('0x23')]){delete _0x16b1ca[_0x0a9e('0x23')];}_0x370d86[_0x0a9e('0x17')](_0x42ac8f)[_0x0a9e('0x24')](_0x16b1ca);};}exports['index']=function(_0x384319,_0x479bc4){var _0x45a1e7={},_0x5bfb33={},_0x1dc186={'count':0x0,'rows':[]};var _0x34dc65=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x1538a4){return{'name':_0x1538a4[_0x0a9e('0x28')],'type':_0x1538a4[_0x0a9e('0x29')]['key']};});_0x5bfb33[_0x0a9e('0x2a')]=_[_0x0a9e('0x25')](_0x34dc65,_0x0a9e('0x23'));_0x5bfb33[_0x0a9e('0x2b')]=_['keys'](_0x384319[_0x0a9e('0x2b')]);_0x5bfb33[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x5bfb33[_0x0a9e('0x2a')],_0x5bfb33[_0x0a9e('0x2b')]);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5bfb33[_0x0a9e('0x2a')],qs[_0x0a9e('0x2f')](_0x384319['query'][_0x0a9e('0x2f')]));_0x45a1e7['attributes']=_0x45a1e7[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x45a1e7[_0x0a9e('0x2e')]:_0x5bfb33[_0x0a9e('0x2a')];if(!_0x384319[_0x0a9e('0x2b')]['hasOwnProperty'](_0x0a9e('0x31'))){_0x45a1e7[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x1a')]);_0x45a1e7[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x384319[_0x0a9e('0x2b')]['offset']);}_0x45a1e7[_0x0a9e('0x32')]=qs['sort'](_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x33')]);_0x45a1e7[_0x0a9e('0x34')]=qs[_0x0a9e('0x2c')](_['pick'](_0x384319[_0x0a9e('0x2b')],_0x5bfb33[_0x0a9e('0x2c')]),_0x34dc65);if(_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x35')]){_0x45a1e7['where']=_['merge'](_0x45a1e7[_0x0a9e('0x34')],{'$or':_['map'](_0x34dc65,function(_0x24936a){if(_0x24936a[_0x0a9e('0x29')]!==_0x0a9e('0x36')){var _0x1ef87a={};_0x1ef87a[_0x24936a['name']]={'$like':'%'+_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x35')]+'%'};return _0x1ef87a;}})});}_0x45a1e7=_[_0x0a9e('0x37')]({},_0x45a1e7,_0x384319['options']);var _0x1dbf74={'where':_0x45a1e7[_0x0a9e('0x34')]};return db[_0x0a9e('0x26')]['count'](_0x1dbf74)['then'](function(_0x11b61d){_0x1dc186[_0x0a9e('0x38')]=_0x11b61d;if(_0x384319['query'][_0x0a9e('0x39')]){_0x45a1e7[_0x0a9e('0x3a')]=[{'all':!![]}];}return db[_0x0a9e('0x26')][_0x0a9e('0x3b')](_0x45a1e7);})['then'](function(_0x5a594b){_0x1dc186[_0x0a9e('0x3c')]=_0x5a594b;return _0x1dc186;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x479bc4,_0x45a1e7))['catch'](handleError(_0x479bc4,null));};exports[_0x0a9e('0x3d')]=function(_0x1dec2e,_0x1459bb){var _0x5b4f5e={'raw':!![],'where':{'id':_0x1dec2e[_0x0a9e('0x3e')]['id']}},_0x316c8f={};_0x316c8f[_0x0a9e('0x2a')]=_[_0x0a9e('0x3f')](db[_0x0a9e('0x26')][_0x0a9e('0x27')]);_0x316c8f[_0x0a9e('0x2b')]=_[_0x0a9e('0x3f')](_0x1dec2e[_0x0a9e('0x2b')]);_0x316c8f[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x316c8f[_0x0a9e('0x2a')],_0x316c8f[_0x0a9e('0x2b')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x316c8f['model'],qs['fields'](_0x1dec2e[_0x0a9e('0x2b')][_0x0a9e('0x2f')]));_0x5b4f5e[_0x0a9e('0x2e')]=_0x5b4f5e[_0x0a9e('0x2e')][_0x0a9e('0x30')]?_0x5b4f5e[_0x0a9e('0x2e')]:_0x316c8f[_0x0a9e('0x2a')];if(_0x1dec2e[_0x0a9e('0x2b')][_0x0a9e('0x39')]){_0x5b4f5e[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5b4f5e=_[_0x0a9e('0x37')]({},_0x5b4f5e,_0x1dec2e[_0x0a9e('0x40')]);return db['FreshdeskField'][_0x0a9e('0x41')](_0x5b4f5e)[_0x0a9e('0x22')](handleEntityNotFound(_0x1459bb,null))[_0x0a9e('0x22')](respondWithResult(_0x1459bb,null))[_0x0a9e('0x42')](handleError(_0x1459bb,null));};exports[_0x0a9e('0x43')]=function(_0xbe9d19,_0x21eb86){return db[_0x0a9e('0x26')]['create'](_0xbe9d19[_0x0a9e('0x44')],{})['then'](respondWithResult(_0x21eb86,0xc9))[_0x0a9e('0x42')](handleError(_0x21eb86,null));};exports[_0x0a9e('0x20')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x44')]['id']){delete _0x8d6dd1[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x41')]({'where':{'id':_0x8d6dd1[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x22')](saveUpdates(_0x8d6dd1['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x42')](handleError(_0x562fb4,null));};exports[_0x0a9e('0x21')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x26')][_0x0a9e('0x41')]({'where':{'id':_0x16f976[_0x0a9e('0x3e')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x409789,null))['then'](removeEntity(_0x409789,null))[_0x0a9e('0x42')](handleError(_0x409789,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 8fb5811..c235b09 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 _0x612c=['FreshdeskField','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define'];(function(_0x1153c8,_0x565c55){var _0xd35977=function(_0x137eb8){while(--_0x137eb8){_0x1153c8['push'](_0x1153c8['shift']());}};_0xd35977(++_0x565c55);}(_0x612c,0x145));var _0xc612=function(_0x206593,_0x3cf9ae){_0x206593=_0x206593-0x0;var _0x25be66=_0x612c[_0x206593];return _0x25be66;};'use strict';var _=require(_0xc612('0x0'));var util=require(_0xc612('0x1'));var logger=require(_0xc612('0x2'))('api');var moment=require(_0xc612('0x3'));var BPromise=require(_0xc612('0x4'));var rp=require(_0xc612('0x5'));var fs=require('fs');var path=require(_0xc612('0x6'));var rimraf=require(_0xc612('0x7'));var config=require('../../config/environment');var attributes=require(_0xc612('0x8'));module[_0xc612('0x9')]=function(_0x1fd035,_0x3992ca){return _0x1fd035[_0xc612('0xa')](_0xc612('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xc612('0xc'),_0xc612('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b10=['int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','FreshdeskField'];(function(_0x2c5a4d,_0x34b2d3){var _0x470917=function(_0x3db66e){while(--_0x3db66e){_0x2c5a4d['push'](_0x2c5a4d['shift']());}};_0x470917(++_0x34b2d3);}(_0x7b10,0x90));var _0x07b1=function(_0x703a9,_0x1688cd){_0x703a9=_0x703a9-0x0;var _0x3ad645=_0x7b10[_0x703a9];return _0x3ad645;};'use strict';var _=require(_0x07b1('0x0'));var util=require(_0x07b1('0x1'));var logger=require('../../config/logger')(_0x07b1('0x2'));var moment=require(_0x07b1('0x3'));var BPromise=require(_0x07b1('0x4'));var rp=require(_0x07b1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07b1('0x6'));var config=require(_0x07b1('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x07b1('0x8')]=function(_0x17d7fb,_0x1e6aeb){return _0x17d7fb['define'](_0x07b1('0x9'),attributes,{'tableName':_0x07b1('0xa'),'paranoid':![],'indexes':[{'name':_0x07b1('0xb'),'fields':[_0x07b1('0xc'),_0x07b1('0xd')],'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 2db07ee..39aee64 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 _0x7a54=['info','FreshdeskField,\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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x3065b3,_0x1e9307){_0x3065b3=_0x3065b3-0x0;var _0x20227a=_0x7a54[_0x3065b3];return _0x20227a;};'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')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x32c1b7,_0x5b8e53){var _0x3651cb=function(_0x56e135){while(--_0x56e135){_0x32c1b7['push'](_0x32c1b7['shift']());}};_0x3651cb(++_0x5b8e53);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ce301,_0x858468){_0x3ce301=_0x3ce301-0x0;var _0x323499=_0xb10b[_0x3ce301];return _0x323499;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 6503fd3..6523610 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 _0xd8c1=['put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x272257,_0x3aa65b){var _0x4de1d1=function(_0x56d0bc){while(--_0x56d0bc){_0x272257['push'](_0x272257['shift']());}};_0x4de1d1(++_0x3aa65b);}(_0xd8c1,0x10d));var _0x1d8c=function(_0x43a276,_0x476c47){_0x43a276=_0x43a276-0x0;var _0x176888=_0xd8c1[_0x43a276];return _0x176888;};'use strict';var multer=require('multer');var util=require(_0x1d8c('0x0'));var path=require('path');var timeout=require(_0x1d8c('0x1'));var express=require(_0x1d8c('0x2'));var router=express[_0x1d8c('0x3')]();var fs_extra=require(_0x1d8c('0x4'));var auth=require(_0x1d8c('0x5'));var interaction=require(_0x1d8c('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0x1d8c('0x7')]('/',auth[_0x1d8c('0x8')](),controller[_0x1d8c('0x9')]);router[_0x1d8c('0x7')](_0x1d8c('0xa'),auth[_0x1d8c('0x8')](),controller[_0x1d8c('0xb')]);router[_0x1d8c('0x7')](_0x1d8c('0xc'),auth[_0x1d8c('0x8')](),controller[_0x1d8c('0xd')]);router[_0x1d8c('0x7')](_0x1d8c('0xe'),auth['isAuthenticated'](),controller[_0x1d8c('0xf')]);router[_0x1d8c('0x10')]('/',auth[_0x1d8c('0x8')](),controller[_0x1d8c('0x11')]);router[_0x1d8c('0x10')](_0x1d8c('0xc'),auth['isAuthenticated'](),controller[_0x1d8c('0x12')]);router[_0x1d8c('0x13')]('/:id',auth[_0x1d8c('0x8')](),controller[_0x1d8c('0x14')]);router[_0x1d8c('0x15')](_0x1d8c('0xa'),auth[_0x1d8c('0x8')](),controller[_0x1d8c('0x16')]);module[_0x1d8c('0x17')]=router; \ No newline at end of file +var _0x58bd=['getFields','addConfiguration','put','update','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations'];(function(_0x33350b,_0x3ae04e){var _0x547688=function(_0x1ee3f3){while(--_0x1ee3f3){_0x33350b['push'](_0x33350b['shift']());}};_0x547688(++_0x3ae04e);}(_0x58bd,0x18b));var _0xd58b=function(_0xdb7d96,_0x507658){_0xdb7d96=_0xdb7d96-0x0;var _0x169d91=_0x58bd[_0xdb7d96];return _0x169d91;};'use strict';var multer=require(_0xd58b('0x0'));var util=require(_0xd58b('0x1'));var path=require(_0xd58b('0x2'));var timeout=require('connect-timeout');var express=require(_0xd58b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd58b('0x4'));var interaction=require(_0xd58b('0x5'));var config=require(_0xd58b('0x6'));var controller=require(_0xd58b('0x7'));router[_0xd58b('0x8')]('/',auth['isAuthenticated'](),controller[_0xd58b('0x9')]);router[_0xd58b('0x8')](_0xd58b('0xa'),auth[_0xd58b('0xb')](),controller['show']);router[_0xd58b('0x8')](_0xd58b('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xd58b('0xb')](),controller[_0xd58b('0xd')]);router['post']('/',auth[_0xd58b('0xb')](),controller['create']);router['post'](_0xd58b('0xc'),auth[_0xd58b('0xb')](),controller[_0xd58b('0xe')]);router[_0xd58b('0xf')](_0xd58b('0xa'),auth['isAuthenticated'](),controller[_0xd58b('0x10')]);router['delete'](_0xd58b('0xa'),auth[_0xd58b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index c560935..8570dc3 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 _0x7969=['remoteUri','sequelize','STRING','username'];(function(_0x3de040,_0x3091b4){var _0x42a505=function(_0x548de9){while(--_0x548de9){_0x3de040['push'](_0x3de040['shift']());}};_0x42a505(++_0x3091b4);}(_0x7969,0x121));var _0x9796=function(_0x33313c,_0xb186ec){_0x33313c=_0x33313c-0x0;var _0xa97a82=_0x7969[_0x33313c];return _0xa97a82;};'use strict';var Sequelize=require(_0x9796('0x0'));module['exports']={'name':{'type':Sequelize[_0x9796('0x1')]},'description':{'type':Sequelize[_0x9796('0x1')]},'username':{'type':Sequelize[_0x9796('0x1')],'unique':_0x9796('0x2')},'apiKey':{'type':Sequelize[_0x9796('0x1')]},'remoteUri':{'type':Sequelize[_0x9796('0x1')],'unique':_0x9796('0x3')},'serverUrl':{'type':Sequelize[_0x9796('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x27d8=['exports','STRING'];(function(_0x31ddea,_0x40de6d){var _0x12539b=function(_0x1d353b){while(--_0x1d353b){_0x31ddea['push'](_0x31ddea['shift']());}};_0x12539b(++_0x40de6d);}(_0x27d8,0x1b4));var _0x827d=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x27d8[_0x47a349];return _0x18ab75;};'use strict';var Sequelize=require('sequelize');module[_0x827d('0x0')]={'name':{'type':Sequelize[_0x827d('0x1')]},'description':{'type':Sequelize[_0x827d('0x1')]},'username':{'type':Sequelize[_0x827d('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x827d('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 0c65e76..260227f 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 _0xbb14=['count','offset','limit','json','apply','update','then','name','send','map','FreshsalesAccount','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','destroy','findOne','FreshsalesConfiguration','order','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end'];(function(_0x2d4f80,_0x544bbd){var _0x5e884d=function(_0x17f4a6){while(--_0x17f4a6){_0x2d4f80['push'](_0x2d4f80['shift']());}};_0x5e884d(++_0x544bbd);}(_0xbb14,0xb1));var _0x4bb1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbb14[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x4bb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4bb1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4bb1('0x2'));var BPromise=require(_0x4bb1('0x3'));var Mustache=require(_0x4bb1('0x4'));var util=require('util');var path=require(_0x4bb1('0x5'));var sox=require(_0x4bb1('0x6'));var csv=require(_0x4bb1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4bb1('0x8'));var _=require(_0x4bb1('0x9'));var squel=require(_0x4bb1('0xa'));var crypto=require(_0x4bb1('0xb'));var jsforce=require(_0x4bb1('0xc'));var deskjs=require(_0x4bb1('0xd'));var toCsv=require(_0x4bb1('0x7'));var querystring=require(_0x4bb1('0xe'));var Papa=require('papaparse');var Redis=require(_0x4bb1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4bb1('0x10'));var as=require(_0x4bb1('0x11'));var hardwareService=require(_0x4bb1('0x12'));var logger=require(_0x4bb1('0x13'))(_0x4bb1('0x14'));var utils=require(_0x4bb1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4bb1('0x16'));var db=require(_0x4bb1('0x17'))['db'];var integrations=require(_0x4bb1('0x18'));var jayson=require(_0x4bb1('0x19'));var client=jayson[_0x4bb1('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d5cf4,_0x4651d1,_0x26ddb3,_0xeea40d){return new BPromise(function(_0x2753fb,_0x33a851){var _0x206cfd=_0xeea40d||client;return _0x206cfd['request'](_0x2d5cf4,_0x26ddb3)['then'](function(_0x1c7d4f){logger[_0x4bb1('0x1b')](_0x4bb1('0x1c'),_0x4651d1,_0x4bb1('0x1d'));logger[_0x4bb1('0x1e')](_0x4bb1('0x1f'),_0x4651d1,'request\x20sent',JSON['stringify'](_0x1c7d4f));if(_0x1c7d4f[_0x4bb1('0x20')]){if(_0x1c7d4f[_0x4bb1('0x20')][_0x4bb1('0x21')]===0x1f4){logger['error'](_0x4bb1('0x1c'),_0x4651d1,_0x1c7d4f[_0x4bb1('0x20')][_0x4bb1('0x22')]);return _0x33a851(_0x1c7d4f[_0x4bb1('0x20')][_0x4bb1('0x22')]);}logger[_0x4bb1('0x20')](_0x4bb1('0x1c'),_0x4651d1,_0x1c7d4f[_0x4bb1('0x20')][_0x4bb1('0x22')]);return _0x2753fb(_0x1c7d4f['error'][_0x4bb1('0x22')]);}else{logger['info'](_0x4bb1('0x1c'),_0x4651d1,_0x4bb1('0x1d'));_0x2753fb(_0x1c7d4f[_0x4bb1('0x23')][_0x4bb1('0x22')]);}})['catch'](function(_0x3df5ff){logger[_0x4bb1('0x20')](_0x4bb1('0x1c'),_0x4651d1,_0x3df5ff);_0x33a851(_0x3df5ff);});});}function respondWithStatusCode(_0x39d401,_0x41b1d3){_0x41b1d3=_0x41b1d3||0xcc;return function(_0x58d7f9){if(_0x58d7f9){return _0x39d401[_0x4bb1('0x24')](_0x41b1d3);}return _0x39d401[_0x4bb1('0x25')](_0x41b1d3)[_0x4bb1('0x26')]();};}function respondWithResult(_0x5c5689,_0x3c018c){_0x3c018c=_0x3c018c||0xc8;return function(_0x3b9194){if(_0x3b9194){return _0x5c5689[_0x4bb1('0x25')](_0x3c018c)['json'](_0x3b9194);}};}function respondWithFilteredResult(_0x3dbc70,_0x2dd188){return function(_0x543179){if(_0x543179){var _0x27c3c7=_0x543179[_0x4bb1('0x27')],_0x51fdb0=_0x2dd188['offset'],_0xc2f321=_0x2dd188[_0x4bb1('0x28')]+_0x2dd188[_0x4bb1('0x29')],_0x1b7535;if(_0xc2f321>=_0x27c3c7){_0xc2f321=_0x27c3c7;_0x1b7535=0xc8;}else{_0x1b7535=0xce;}_0x3dbc70[_0x4bb1('0x25')](_0x1b7535);return _0x3dbc70['set']('Content-Range',_0x51fdb0+'-'+_0xc2f321+'/'+_0x27c3c7)[_0x4bb1('0x2a')](_0x543179);}return null;};}function patchUpdates(_0x287545){return function(_0x1d158c){try{jsonpatch[_0x4bb1('0x2b')](_0x1d158c,_0x287545,!![]);}catch(_0x52c7b4){return BPromise['reject'](_0x52c7b4);}return _0x1d158c['save']();};}function saveUpdates(_0x243309,_0x52375b){return function(_0x43e0ab){if(_0x43e0ab){return _0x43e0ab[_0x4bb1('0x2c')](_0x243309)['then'](function(_0x542c85){return _0x542c85;});}return null;};}function removeEntity(_0x1877b1,_0x4d4532){return function(_0x2ddb25){if(_0x2ddb25){return _0x2ddb25['destroy']()[_0x4bb1('0x2d')](function(){_0x1877b1['status'](0xcc)[_0x4bb1('0x26')]();});}};}function handleEntityNotFound(_0x13e645,_0x5b7288){return function(_0x5a83c8){if(!_0x5a83c8){_0x13e645['sendStatus'](0x194);}return _0x5a83c8;};}function handleError(_0x36b5f2,_0x5694c9){_0x5694c9=_0x5694c9||0x1f4;return function(_0x245d95){logger[_0x4bb1('0x20')](_0x245d95['stack']);if(_0x245d95[_0x4bb1('0x2e')]){delete _0x245d95['name'];}_0x36b5f2['status'](_0x5694c9)[_0x4bb1('0x2f')](_0x245d95);};}exports['index']=function(_0x2578ad,_0x247a3e){var _0x409edc={},_0x147d3d={},_0x2ce9fd={'count':0x0,'rows':[]};var _0x30a8e8=_[_0x4bb1('0x30')](db[_0x4bb1('0x31')]['rawAttributes'],function(_0x475525){return{'name':_0x475525['fieldName'],'type':_0x475525['type'][_0x4bb1('0x32')]};});_0x147d3d[_0x4bb1('0x33')]=_[_0x4bb1('0x30')](_0x30a8e8,'name');_0x147d3d[_0x4bb1('0x34')]=_['keys'](_0x2578ad[_0x4bb1('0x34')]);_0x147d3d[_0x4bb1('0x35')]=_['intersection'](_0x147d3d['model'],_0x147d3d[_0x4bb1('0x34')]);_0x409edc[_0x4bb1('0x36')]=_[_0x4bb1('0x37')](_0x147d3d[_0x4bb1('0x33')],qs[_0x4bb1('0x38')](_0x2578ad[_0x4bb1('0x34')][_0x4bb1('0x38')]));_0x409edc[_0x4bb1('0x36')]=_0x409edc[_0x4bb1('0x36')][_0x4bb1('0x39')]?_0x409edc[_0x4bb1('0x36')]:_0x147d3d[_0x4bb1('0x33')];if(!_0x2578ad['query'][_0x4bb1('0x3a')](_0x4bb1('0x3b'))){_0x409edc[_0x4bb1('0x29')]=qs[_0x4bb1('0x29')](_0x2578ad[_0x4bb1('0x34')][_0x4bb1('0x29')]);_0x409edc[_0x4bb1('0x28')]=qs[_0x4bb1('0x28')](_0x2578ad[_0x4bb1('0x34')][_0x4bb1('0x28')]);}_0x409edc['order']=qs[_0x4bb1('0x3c')](_0x2578ad['query'][_0x4bb1('0x3c')]);_0x409edc['where']=qs['filters'](_[_0x4bb1('0x3d')](_0x2578ad[_0x4bb1('0x34')],_0x147d3d['filters']),_0x30a8e8);if(_0x2578ad[_0x4bb1('0x34')][_0x4bb1('0x3e')]){_0x409edc[_0x4bb1('0x3f')]=_[_0x4bb1('0x40')](_0x409edc['where'],{'$or':_[_0x4bb1('0x30')](_0x30a8e8,function(_0x40c339){if(_0x40c339[_0x4bb1('0x41')]!==_0x4bb1('0x42')){var _0x406325={};_0x406325[_0x40c339[_0x4bb1('0x2e')]]={'$like':'%'+_0x2578ad['query'][_0x4bb1('0x3e')]+'%'};return _0x406325;}})});}_0x409edc=_[_0x4bb1('0x40')]({},_0x409edc,_0x2578ad['options']);var _0x33d247={'where':_0x409edc[_0x4bb1('0x3f')]};return db[_0x4bb1('0x31')]['count'](_0x33d247)[_0x4bb1('0x2d')](function(_0x5f5f6f){_0x2ce9fd[_0x4bb1('0x27')]=_0x5f5f6f;if(_0x2578ad[_0x4bb1('0x34')]['includeAll']){_0x409edc[_0x4bb1('0x43')]=[{'all':!![]}];}return db[_0x4bb1('0x31')][_0x4bb1('0x44')](_0x409edc);})['then'](function(_0x409674){_0x2ce9fd[_0x4bb1('0x45')]=_0x409674;return _0x2ce9fd;})['then'](respondWithFilteredResult(_0x247a3e,_0x409edc))[_0x4bb1('0x46')](handleError(_0x247a3e,null));};exports[_0x4bb1('0x47')]=function(_0x3e3e74,_0x3db47c){var _0x1df786={'raw':![],'where':{'id':_0x3e3e74[_0x4bb1('0x48')]['id']}},_0x4b3d96={};_0x4b3d96[_0x4bb1('0x33')]=_[_0x4bb1('0x49')](db[_0x4bb1('0x31')][_0x4bb1('0x4a')]);_0x4b3d96[_0x4bb1('0x34')]=_[_0x4bb1('0x49')](_0x3e3e74['query']);_0x4b3d96['filters']=_[_0x4bb1('0x37')](_0x4b3d96[_0x4bb1('0x33')],_0x4b3d96['query']);_0x1df786[_0x4bb1('0x36')]=_[_0x4bb1('0x37')](_0x4b3d96['model'],qs[_0x4bb1('0x38')](_0x3e3e74[_0x4bb1('0x34')]['fields']));_0x1df786[_0x4bb1('0x36')]=_0x1df786[_0x4bb1('0x36')]['length']?_0x1df786[_0x4bb1('0x36')]:_0x4b3d96[_0x4bb1('0x33')];if(_0x3e3e74[_0x4bb1('0x34')]['includeAll']){_0x1df786[_0x4bb1('0x43')]=[{'all':!![]}];}_0x1df786=_['merge']({},_0x1df786,_0x3e3e74[_0x4bb1('0x4b')]);return db['FreshsalesAccount'][_0x4bb1('0x4c')](_0x1df786)[_0x4bb1('0x2d')](handleEntityNotFound(_0x3db47c,null))[_0x4bb1('0x2d')](respondWithResult(_0x3db47c,null))[_0x4bb1('0x46')](handleError(_0x3db47c,null));};exports[_0x4bb1('0x4d')]=function(_0x1df50f,_0x234047){return db[_0x4bb1('0x31')][_0x4bb1('0x4d')](_0x1df50f[_0x4bb1('0x4e')],{})['then'](respondWithResult(_0x234047,0xc9))[_0x4bb1('0x46')](handleError(_0x234047,null));};exports[_0x4bb1('0x2c')]=function(_0xe57b6a,_0x41880f){if(_0xe57b6a['body']['id']){delete _0xe57b6a[_0x4bb1('0x4e')]['id'];}return db[_0x4bb1('0x31')][_0x4bb1('0x4c')]({'where':{'id':_0xe57b6a[_0x4bb1('0x48')]['id']}})[_0x4bb1('0x2d')](handleEntityNotFound(_0x41880f,null))[_0x4bb1('0x2d')](saveUpdates(_0xe57b6a[_0x4bb1('0x4e')],null))[_0x4bb1('0x2d')](respondWithResult(_0x41880f,null))['catch'](handleError(_0x41880f,null));};exports[_0x4bb1('0x4f')]=function(_0x2d8347,_0x9de3d0){return db[_0x4bb1('0x31')][_0x4bb1('0x4c')]({'where':{'id':_0x2d8347[_0x4bb1('0x48')]['id']}})[_0x4bb1('0x2d')](handleEntityNotFound(_0x9de3d0,null))['then'](removeEntity(_0x9de3d0,null))[_0x4bb1('0x46')](handleError(_0x9de3d0,null));};exports['getConfigurations']=function(_0x33edd1,_0x175eb3,_0x1011f8){var _0x3df2a2={};var _0x2071b2={};var _0x314625;var _0x3a0d45;return db[_0x4bb1('0x31')][_0x4bb1('0x50')]({'where':{'id':_0x33edd1[_0x4bb1('0x48')]['id']}})[_0x4bb1('0x2d')](handleEntityNotFound(_0x175eb3,null))['then'](function(_0x197dfe){if(_0x197dfe){_0x314625=_0x197dfe;_0x2071b2['model']=_['keys'](db[_0x4bb1('0x51')][_0x4bb1('0x4a')]);_0x2071b2[_0x4bb1('0x34')]=_[_0x4bb1('0x49')](_0x33edd1[_0x4bb1('0x34')]);_0x2071b2['filters']=_['intersection'](_0x2071b2['model'],_0x2071b2[_0x4bb1('0x34')]);_0x3df2a2[_0x4bb1('0x36')]=_[_0x4bb1('0x37')](_0x2071b2[_0x4bb1('0x33')],qs[_0x4bb1('0x38')](_0x33edd1[_0x4bb1('0x34')][_0x4bb1('0x38')]));_0x3df2a2[_0x4bb1('0x36')]=_0x3df2a2[_0x4bb1('0x36')][_0x4bb1('0x39')]?_0x3df2a2['attributes']:_0x2071b2[_0x4bb1('0x33')];_0x3df2a2[_0x4bb1('0x52')]=qs[_0x4bb1('0x3c')](_0x33edd1[_0x4bb1('0x34')]['sort']);_0x3df2a2[_0x4bb1('0x3f')]=qs[_0x4bb1('0x35')](_[_0x4bb1('0x3d')](_0x33edd1['query'],_0x2071b2[_0x4bb1('0x35')]));if(_0x33edd1['query'][_0x4bb1('0x3e')]){_0x3df2a2[_0x4bb1('0x3f')]=_[_0x4bb1('0x40')](_0x3df2a2[_0x4bb1('0x3f')],{'$or':_[_0x4bb1('0x30')](_0x3df2a2[_0x4bb1('0x36')],function(_0x453f6f){var _0x3ce75e={};_0x3ce75e[_0x453f6f]={'$like':'%'+_0x33edd1[_0x4bb1('0x34')][_0x4bb1('0x3e')]+'%'};return _0x3ce75e;})});}_0x3df2a2=_[_0x4bb1('0x40')]({},_0x3df2a2,_0x33edd1[_0x4bb1('0x4b')]);return _0x314625[_0x4bb1('0x53')](_0x3df2a2);}})[_0x4bb1('0x2d')](function(_0x4a65fd){if(_0x4a65fd){_0x3a0d45=_0x4a65fd[_0x4bb1('0x39')];if(!_0x33edd1[_0x4bb1('0x34')]['hasOwnProperty']('nolimit')){_0x3df2a2[_0x4bb1('0x29')]=qs[_0x4bb1('0x29')](_0x33edd1[_0x4bb1('0x34')][_0x4bb1('0x29')]);_0x3df2a2[_0x4bb1('0x28')]=qs[_0x4bb1('0x28')](_0x33edd1[_0x4bb1('0x34')][_0x4bb1('0x28')]);}return _0x314625['getConfigurations'](_0x3df2a2);}})[_0x4bb1('0x2d')](function(_0x56fa3a){if(_0x56fa3a){return _0x56fa3a?{'count':_0x3a0d45,'rows':_0x56fa3a}:null;}})[_0x4bb1('0x2d')](respondWithResult(_0x175eb3,null))[_0x4bb1('0x46')](handleError(_0x175eb3,null));};exports[_0x4bb1('0x54')]=function(_0x20bc80,_0x5abcac,_0x506c7a){if(_0x20bc80[_0x4bb1('0x4e')]['id']){delete _0x20bc80[_0x4bb1('0x4e')]['id'];}return db['FreshsalesAccount'][_0x4bb1('0x50')]({'where':{'id':_0x20bc80[_0x4bb1('0x48')]['id']}})['then'](handleEntityNotFound(_0x5abcac,null))[_0x4bb1('0x2d')](function(_0x49975e){if(_0x49975e){_0x20bc80[_0x4bb1('0x4e')]['AccountId']=_0x49975e['id'];_0x20bc80['body'][_0x4bb1('0x55')]=integrations[_0x4bb1('0x56')](_0x20bc80[_0x4bb1('0x4e')][_0x4bb1('0x57')],_0x20bc80[_0x4bb1('0x4e')][_0x4bb1('0x41')]);_0x20bc80[_0x4bb1('0x4e')]['Descriptions']=integrations['getDescriptions'](_0x20bc80[_0x4bb1('0x4e')][_0x4bb1('0x57')],_0x20bc80[_0x4bb1('0x4e')][_0x4bb1('0x41')]);return db[_0x4bb1('0x51')]['create'](_0x20bc80[_0x4bb1('0x4e')],{'include':[{'model':db['FreshsalesField'],'as':_0x4bb1('0x55')},{'model':db['FreshsalesField'],'as':_0x4bb1('0x58')}]});}return null;})[_0x4bb1('0x2d')](respondWithResult(_0x5abcac,null))[_0x4bb1('0x46')](handleError(_0x5abcac,null));};exports[_0x4bb1('0x59')]=function(_0x228285,_0x3a5b36,_0x492feb){var _0x292829='';var _0xd44311='';return db[_0x4bb1('0x31')][_0x4bb1('0x50')]({'where':{'id':_0x228285[_0x4bb1('0x48')]['id']},'attributes':['id',_0x4bb1('0x5a'),_0x4bb1('0x5b'),_0x4bb1('0x5c')]})['then'](handleEntityNotFound(_0x3a5b36,null))[_0x4bb1('0x2d')](function(_0x4734f3){if(_0x4734f3){_0xd44311=_0x4734f3[_0x4bb1('0x5a')];_0x292829=_0x4734f3['remoteUri'];var _0x1d4187=_0x4734f3[_0x4bb1('0x5b')][_0x4bb1('0x5d')](-0x1);if(_0x1d4187==='/'){_0x292829=_0x292829[_0x4bb1('0x5e')](0x0,_0x292829[_0x4bb1('0x5f')](_0x1d4187));}return rp({'method':_0x4bb1('0x60'),'uri':util[_0x4bb1('0x61')](_0x4bb1('0x62'),_0x292829,_0x4bb1('0x63')),'headers':{'Authorization':_0x4bb1('0x64')+_0x4734f3[_0x4bb1('0x5c')]},'json':!![]});}})[_0x4bb1('0x2d')](function(_0x388857){if(_0x388857){var _0x3b57ca=_0x388857['users'];var _0x1c6f6a=![];var _0x298ca5=null;for(_0x298ca5=0x0;_0x298ca5<_0x3b57ca[_0x4bb1('0x39')];_0x298ca5++){if(_0x3b57ca[_0x298ca5][_0x4bb1('0x65')]===_0xd44311){_0x1c6f6a=!![];}}if(_0x1c6f6a){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4bb1('0x66')});}}})[_0x4bb1('0x2d')](respondWithResult(_0x3a5b36,null))[_0x4bb1('0x46')](function(_0x4fc193){var _0x2ac754=_0x228285['query'][_0x4bb1('0x67')]?0x1f4:_0x4fc193[_0x4bb1('0x68')]||0x1f4;logger['error'](_0x4bb1('0x69'),'getFields',_0x2ac754,JSON[_0x4bb1('0x6a')](_0x4fc193));delete _0x4fc193[_0x4bb1('0x2e')];if(_0x2ac754===0x191){_0x2ac754=0x190;}_0x3a5b36[_0x4bb1('0x25')](_0x2ac754)[_0x4bb1('0x2f')](_0x228285[_0x4bb1('0x34')]['test']?{'message':_0x4bb1('0x6b'),'statusCode':_0x4fc193[_0x4bb1('0x68')]}:_0x4fc193);});}; \ No newline at end of file +var _0x4e67=['name','send','FreshsalesAccount','rawAttributes','type','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','params','keys','find','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','getFields','username','apiKey','remoteUri','slice','GET','%s%s','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','jayson/promise','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','end','stack'];(function(_0x129c49,_0x2c2242){var _0x1794c7=function(_0x32c0f6){while(--_0x32c0f6){_0x129c49['push'](_0x129c49['shift']());}};_0x1794c7(++_0x2c2242);}(_0x4e67,0xfb));var _0x74e6=function(_0x1876b2,_0x5d0225){_0x1876b2=_0x1876b2-0x0;var _0x9fb1e0=_0x4e67[_0x1876b2];return _0x9fb1e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74e6('0x0'));var zipdir=require(_0x74e6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74e6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x74e6('0x3'));var util=require('util');var path=require(_0x74e6('0x4'));var sox=require('sox');var csv=require(_0x74e6('0x5'));var ejs=require(_0x74e6('0x6'));var fs=require('fs');var fs_extra=require(_0x74e6('0x7'));var _=require(_0x74e6('0x8'));var squel=require(_0x74e6('0x9'));var crypto=require('crypto');var jsforce=require(_0x74e6('0xa'));var deskjs=require(_0x74e6('0xb'));var toCsv=require(_0x74e6('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x74e6('0xc'));var qs=require(_0x74e6('0xd'));var as=require(_0x74e6('0xe'));var hardwareService=require(_0x74e6('0xf'));var logger=require(_0x74e6('0x10'))(_0x74e6('0x11'));var utils=require('../../config/utils');var config=require(_0x74e6('0x12'));var licenseUtil=require(_0x74e6('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x74e6('0x14'));var jayson=require(_0x74e6('0x15'));var client=jayson['client'][_0x74e6('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x372aa9,_0x2baba1,_0x3bb291,_0x4d74c1){return new BPromise(function(_0xf234b0,_0x5b2bf4){var _0x2bc26e=_0x4d74c1||client;return _0x2bc26e[_0x74e6('0x17')](_0x372aa9,_0x3bb291)[_0x74e6('0x18')](function(_0x37d910){logger[_0x74e6('0x19')](_0x74e6('0x1a'),_0x2baba1,_0x74e6('0x1b'));logger[_0x74e6('0x1c')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x2baba1,_0x74e6('0x1b'),JSON['stringify'](_0x37d910));if(_0x37d910[_0x74e6('0x1d')]){if(_0x37d910['error'][_0x74e6('0x1e')]===0x1f4){logger[_0x74e6('0x1d')](_0x74e6('0x1a'),_0x2baba1,_0x37d910[_0x74e6('0x1d')][_0x74e6('0x1f')]);return _0x5b2bf4(_0x37d910['error'][_0x74e6('0x1f')]);}logger['error'](_0x74e6('0x1a'),_0x2baba1,_0x37d910['error']['message']);return _0xf234b0(_0x37d910[_0x74e6('0x1d')][_0x74e6('0x1f')]);}else{logger['info'](_0x74e6('0x1a'),_0x2baba1,_0x74e6('0x1b'));_0xf234b0(_0x37d910[_0x74e6('0x20')][_0x74e6('0x1f')]);}})[_0x74e6('0x21')](function(_0x2b1ea4){logger[_0x74e6('0x1d')](_0x74e6('0x1a'),_0x2baba1,_0x2b1ea4);_0x5b2bf4(_0x2b1ea4);});});}function respondWithStatusCode(_0x5c581b,_0x45a4e9){_0x45a4e9=_0x45a4e9||0xcc;return function(_0xcbb8c0){if(_0xcbb8c0){return _0x5c581b[_0x74e6('0x22')](_0x45a4e9);}return _0x5c581b['status'](_0x45a4e9)['end']();};}function respondWithResult(_0x211e32,_0x4cb3fc){_0x4cb3fc=_0x4cb3fc||0xc8;return function(_0x465a2b){if(_0x465a2b){return _0x211e32[_0x74e6('0x23')](_0x4cb3fc)[_0x74e6('0x24')](_0x465a2b);}};}function respondWithFilteredResult(_0x597c17,_0x28b01c){return function(_0x42c404){if(_0x42c404){var _0x337ede=_0x42c404['count'],_0x3a975d=_0x28b01c[_0x74e6('0x25')],_0x2b47ad=_0x28b01c[_0x74e6('0x25')]+_0x28b01c[_0x74e6('0x26')],_0x1ea6af;if(_0x2b47ad>=_0x337ede){_0x2b47ad=_0x337ede;_0x1ea6af=0xc8;}else{_0x1ea6af=0xce;}_0x597c17[_0x74e6('0x23')](_0x1ea6af);return _0x597c17['set'](_0x74e6('0x27'),_0x3a975d+'-'+_0x2b47ad+'/'+_0x337ede)[_0x74e6('0x24')](_0x42c404);}return null;};}function patchUpdates(_0x476819){return function(_0x521721){try{jsonpatch[_0x74e6('0x28')](_0x521721,_0x476819,!![]);}catch(_0x476a1e){return BPromise[_0x74e6('0x29')](_0x476a1e);}return _0x521721[_0x74e6('0x2a')]();};}function saveUpdates(_0x2613da,_0x503517){return function(_0x98e8c0){if(_0x98e8c0){return _0x98e8c0[_0x74e6('0x2b')](_0x2613da)[_0x74e6('0x18')](function(_0x5a89b2){return _0x5a89b2;});}return null;};}function removeEntity(_0x19f8c7,_0x53f697){return function(_0x3abb37){if(_0x3abb37){return _0x3abb37['destroy']()[_0x74e6('0x18')](function(){_0x19f8c7[_0x74e6('0x23')](0xcc)[_0x74e6('0x2c')]();});}};}function handleEntityNotFound(_0x39c178,_0x4d57e){return function(_0x63e394){if(!_0x63e394){_0x39c178[_0x74e6('0x22')](0x194);}return _0x63e394;};}function handleError(_0xb8d109,_0x1a2d5a){_0x1a2d5a=_0x1a2d5a||0x1f4;return function(_0x47acfd){logger[_0x74e6('0x1d')](_0x47acfd[_0x74e6('0x2d')]);if(_0x47acfd[_0x74e6('0x2e')]){delete _0x47acfd[_0x74e6('0x2e')];}_0xb8d109[_0x74e6('0x23')](_0x1a2d5a)[_0x74e6('0x2f')](_0x47acfd);};}exports['index']=function(_0x50f7fd,_0x50c708){var _0xc4b4ce={},_0x3fd62f={},_0x59b7b8={'count':0x0,'rows':[]};var _0x477521=_['map'](db[_0x74e6('0x30')][_0x74e6('0x31')],function(_0x9095b6){return{'name':_0x9095b6['fieldName'],'type':_0x9095b6[_0x74e6('0x32')]['key']};});_0x3fd62f[_0x74e6('0x33')]=_[_0x74e6('0x34')](_0x477521,'name');_0x3fd62f[_0x74e6('0x35')]=_['keys'](_0x50f7fd[_0x74e6('0x35')]);_0x3fd62f['filters']=_['intersection'](_0x3fd62f['model'],_0x3fd62f['query']);_0xc4b4ce[_0x74e6('0x36')]=_[_0x74e6('0x37')](_0x3fd62f[_0x74e6('0x33')],qs[_0x74e6('0x38')](_0x50f7fd['query'][_0x74e6('0x38')]));_0xc4b4ce[_0x74e6('0x36')]=_0xc4b4ce[_0x74e6('0x36')][_0x74e6('0x39')]?_0xc4b4ce[_0x74e6('0x36')]:_0x3fd62f['model'];if(!_0x50f7fd[_0x74e6('0x35')][_0x74e6('0x3a')](_0x74e6('0x3b'))){_0xc4b4ce[_0x74e6('0x26')]=qs[_0x74e6('0x26')](_0x50f7fd[_0x74e6('0x35')][_0x74e6('0x26')]);_0xc4b4ce['offset']=qs[_0x74e6('0x25')](_0x50f7fd[_0x74e6('0x35')][_0x74e6('0x25')]);}_0xc4b4ce[_0x74e6('0x3c')]=qs[_0x74e6('0x3d')](_0x50f7fd['query'][_0x74e6('0x3d')]);_0xc4b4ce[_0x74e6('0x3e')]=qs[_0x74e6('0x3f')](_[_0x74e6('0x40')](_0x50f7fd['query'],_0x3fd62f['filters']),_0x477521);if(_0x50f7fd[_0x74e6('0x35')][_0x74e6('0x41')]){_0xc4b4ce[_0x74e6('0x3e')]=_[_0x74e6('0x42')](_0xc4b4ce[_0x74e6('0x3e')],{'$or':_[_0x74e6('0x34')](_0x477521,function(_0x325f1c){if(_0x325f1c['type']!==_0x74e6('0x43')){var _0x57fbc3={};_0x57fbc3[_0x325f1c[_0x74e6('0x2e')]]={'$like':'%'+_0x50f7fd[_0x74e6('0x35')][_0x74e6('0x41')]+'%'};return _0x57fbc3;}})});}_0xc4b4ce=_['merge']({},_0xc4b4ce,_0x50f7fd[_0x74e6('0x44')]);var _0x45a3e6={'where':_0xc4b4ce[_0x74e6('0x3e')]};return db[_0x74e6('0x30')][_0x74e6('0x45')](_0x45a3e6)[_0x74e6('0x18')](function(_0x34e73b){_0x59b7b8[_0x74e6('0x45')]=_0x34e73b;if(_0x50f7fd[_0x74e6('0x35')][_0x74e6('0x46')]){_0xc4b4ce[_0x74e6('0x47')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0xc4b4ce);})[_0x74e6('0x18')](function(_0x23db97){_0x59b7b8['rows']=_0x23db97;return _0x59b7b8;})[_0x74e6('0x18')](respondWithFilteredResult(_0x50c708,_0xc4b4ce))[_0x74e6('0x21')](handleError(_0x50c708,null));};exports['show']=function(_0x541da1,_0x183fa4){var _0x422dfb={'raw':![],'where':{'id':_0x541da1[_0x74e6('0x48')]['id']}},_0x40319b={};_0x40319b[_0x74e6('0x33')]=_[_0x74e6('0x49')](db[_0x74e6('0x30')][_0x74e6('0x31')]);_0x40319b[_0x74e6('0x35')]=_[_0x74e6('0x49')](_0x541da1[_0x74e6('0x35')]);_0x40319b[_0x74e6('0x3f')]=_['intersection'](_0x40319b['model'],_0x40319b[_0x74e6('0x35')]);_0x422dfb[_0x74e6('0x36')]=_[_0x74e6('0x37')](_0x40319b[_0x74e6('0x33')],qs[_0x74e6('0x38')](_0x541da1['query'][_0x74e6('0x38')]));_0x422dfb[_0x74e6('0x36')]=_0x422dfb[_0x74e6('0x36')][_0x74e6('0x39')]?_0x422dfb[_0x74e6('0x36')]:_0x40319b[_0x74e6('0x33')];if(_0x541da1[_0x74e6('0x35')][_0x74e6('0x46')]){_0x422dfb[_0x74e6('0x47')]=[{'all':!![]}];}_0x422dfb=_['merge']({},_0x422dfb,_0x541da1['options']);return db[_0x74e6('0x30')][_0x74e6('0x4a')](_0x422dfb)[_0x74e6('0x18')](handleEntityNotFound(_0x183fa4,null))['then'](respondWithResult(_0x183fa4,null))[_0x74e6('0x21')](handleError(_0x183fa4,null));};exports[_0x74e6('0x4b')]=function(_0x2a1b47,_0x5ce114){return db['FreshsalesAccount'][_0x74e6('0x4b')](_0x2a1b47[_0x74e6('0x4c')],{})[_0x74e6('0x18')](respondWithResult(_0x5ce114,0xc9))[_0x74e6('0x21')](handleError(_0x5ce114,null));};exports['update']=function(_0x30b40c,_0x235b14){if(_0x30b40c[_0x74e6('0x4c')]['id']){delete _0x30b40c[_0x74e6('0x4c')]['id'];}return db[_0x74e6('0x30')][_0x74e6('0x4a')]({'where':{'id':_0x30b40c[_0x74e6('0x48')]['id']}})[_0x74e6('0x18')](handleEntityNotFound(_0x235b14,null))[_0x74e6('0x18')](saveUpdates(_0x30b40c[_0x74e6('0x4c')],null))[_0x74e6('0x18')](respondWithResult(_0x235b14,null))[_0x74e6('0x21')](handleError(_0x235b14,null));};exports[_0x74e6('0x4d')]=function(_0x5949ca,_0x3156a0){return db['FreshsalesAccount'][_0x74e6('0x4a')]({'where':{'id':_0x5949ca['params']['id']}})[_0x74e6('0x18')](handleEntityNotFound(_0x3156a0,null))['then'](removeEntity(_0x3156a0,null))[_0x74e6('0x21')](handleError(_0x3156a0,null));};exports[_0x74e6('0x4e')]=function(_0x195dda,_0x1522cd,_0x4961bf){var _0x16553d={};var _0x3b7cdd={};var _0x5e0f18;var _0xc522f4;return db[_0x74e6('0x30')][_0x74e6('0x4f')]({'where':{'id':_0x195dda['params']['id']}})[_0x74e6('0x18')](handleEntityNotFound(_0x1522cd,null))[_0x74e6('0x18')](function(_0x297754){if(_0x297754){_0x5e0f18=_0x297754;_0x3b7cdd['model']=_[_0x74e6('0x49')](db[_0x74e6('0x50')][_0x74e6('0x31')]);_0x3b7cdd[_0x74e6('0x35')]=_['keys'](_0x195dda[_0x74e6('0x35')]);_0x3b7cdd[_0x74e6('0x3f')]=_['intersection'](_0x3b7cdd[_0x74e6('0x33')],_0x3b7cdd['query']);_0x16553d[_0x74e6('0x36')]=_[_0x74e6('0x37')](_0x3b7cdd[_0x74e6('0x33')],qs[_0x74e6('0x38')](_0x195dda[_0x74e6('0x35')][_0x74e6('0x38')]));_0x16553d[_0x74e6('0x36')]=_0x16553d[_0x74e6('0x36')]['length']?_0x16553d['attributes']:_0x3b7cdd[_0x74e6('0x33')];_0x16553d[_0x74e6('0x3c')]=qs[_0x74e6('0x3d')](_0x195dda[_0x74e6('0x35')]['sort']);_0x16553d[_0x74e6('0x3e')]=qs['filters'](_[_0x74e6('0x40')](_0x195dda['query'],_0x3b7cdd[_0x74e6('0x3f')]));if(_0x195dda[_0x74e6('0x35')][_0x74e6('0x41')]){_0x16553d[_0x74e6('0x3e')]=_['merge'](_0x16553d['where'],{'$or':_[_0x74e6('0x34')](_0x16553d[_0x74e6('0x36')],function(_0x282ea9){var _0x3e4781={};_0x3e4781[_0x282ea9]={'$like':'%'+_0x195dda[_0x74e6('0x35')][_0x74e6('0x41')]+'%'};return _0x3e4781;})});}_0x16553d=_[_0x74e6('0x42')]({},_0x16553d,_0x195dda['options']);return _0x5e0f18[_0x74e6('0x4e')](_0x16553d);}})[_0x74e6('0x18')](function(_0x35e5b9){if(_0x35e5b9){_0xc522f4=_0x35e5b9['length'];if(!_0x195dda['query'][_0x74e6('0x3a')](_0x74e6('0x3b'))){_0x16553d[_0x74e6('0x26')]=qs[_0x74e6('0x26')](_0x195dda[_0x74e6('0x35')][_0x74e6('0x26')]);_0x16553d[_0x74e6('0x25')]=qs[_0x74e6('0x25')](_0x195dda[_0x74e6('0x35')][_0x74e6('0x25')]);}return _0x5e0f18[_0x74e6('0x4e')](_0x16553d);}})['then'](function(_0x437cf3){if(_0x437cf3){return _0x437cf3?{'count':_0xc522f4,'rows':_0x437cf3}:null;}})[_0x74e6('0x18')](respondWithResult(_0x1522cd,null))['catch'](handleError(_0x1522cd,null));};exports['addConfiguration']=function(_0x1f080a,_0x39db68,_0x477769){if(_0x1f080a[_0x74e6('0x4c')]['id']){delete _0x1f080a[_0x74e6('0x4c')]['id'];}return db[_0x74e6('0x30')][_0x74e6('0x4f')]({'where':{'id':_0x1f080a[_0x74e6('0x48')]['id']}})[_0x74e6('0x18')](handleEntityNotFound(_0x39db68,null))[_0x74e6('0x18')](function(_0x16dfe9){if(_0x16dfe9){_0x1f080a[_0x74e6('0x4c')][_0x74e6('0x51')]=_0x16dfe9['id'];_0x1f080a[_0x74e6('0x4c')][_0x74e6('0x52')]=integrations[_0x74e6('0x53')](_0x1f080a['body'][_0x74e6('0x54')],_0x1f080a[_0x74e6('0x4c')][_0x74e6('0x32')]);_0x1f080a['body']['Descriptions']=integrations[_0x74e6('0x55')](_0x1f080a[_0x74e6('0x4c')][_0x74e6('0x54')],_0x1f080a['body'][_0x74e6('0x32')]);return db[_0x74e6('0x50')][_0x74e6('0x4b')](_0x1f080a['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x74e6('0x52')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x39db68,null))['catch'](handleError(_0x39db68,null));};exports[_0x74e6('0x56')]=function(_0x597a5f,_0x52a568,_0x2bfdfe){var _0x1b5ee6='';var _0x72f0a7='';return db['FreshsalesAccount'][_0x74e6('0x4f')]({'where':{'id':_0x597a5f['params']['id']},'attributes':['id',_0x74e6('0x57'),'remoteUri',_0x74e6('0x58')]})[_0x74e6('0x18')](handleEntityNotFound(_0x52a568,null))[_0x74e6('0x18')](function(_0x2d7bdd){if(_0x2d7bdd){_0x72f0a7=_0x2d7bdd[_0x74e6('0x57')];_0x1b5ee6=_0x2d7bdd[_0x74e6('0x59')];var _0x172cb8=_0x2d7bdd[_0x74e6('0x59')][_0x74e6('0x5a')](-0x1);if(_0x172cb8==='/'){_0x1b5ee6=_0x1b5ee6['substring'](0x0,_0x1b5ee6['lastIndexOf'](_0x172cb8));}return rp({'method':_0x74e6('0x5b'),'uri':util['format'](_0x74e6('0x5c'),_0x1b5ee6,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x2d7bdd[_0x74e6('0x58')]},'json':!![]});}})['then'](function(_0x4325b1){if(_0x4325b1){var _0x10c950=_0x4325b1[_0x74e6('0x5d')];var _0x444a3b=![];var _0x79acba=null;for(_0x79acba=0x0;_0x79acba<_0x10c950[_0x74e6('0x39')];_0x79acba++){if(_0x10c950[_0x79acba][_0x74e6('0x5e')]===_0x72f0a7){_0x444a3b=!![];}}if(_0x444a3b){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x74e6('0x18')](respondWithResult(_0x52a568,null))[_0x74e6('0x21')](function(_0x1bc119){var _0x11a3d3=_0x597a5f[_0x74e6('0x35')][_0x74e6('0x5f')]?0x1f4:_0x1bc119[_0x74e6('0x60')]||0x1f4;logger['error'](_0x74e6('0x61'),_0x74e6('0x56'),_0x11a3d3,JSON[_0x74e6('0x62')](_0x1bc119));delete _0x1bc119[_0x74e6('0x2e')];if(_0x11a3d3===0x191){_0x11a3d3=0x190;}_0x52a568[_0x74e6('0x23')](_0x11a3d3)[_0x74e6('0x2f')](_0x597a5f[_0x74e6('0x35')][_0x74e6('0x5f')]?{'message':'Wrong\x20credentials','statusCode':_0x1bc119['statusCode']}:_0x1bc119);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 9d0f9f8..e90de73 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 _0x416b=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount'];(function(_0x4729ae,_0x35a7c4){var _0x464880=function(_0x2e6d08){while(--_0x2e6d08){_0x4729ae['push'](_0x4729ae['shift']());}};_0x464880(++_0x35a7c4);}(_0x416b,0x1c8));var _0xb416=function(_0x5ac5d6,_0x51eb3e){_0x5ac5d6=_0x5ac5d6-0x0;var _0x2c8e34=_0x416b[_0x5ac5d6];return _0x2c8e34;};'use strict';var _=require(_0xb416('0x0'));var util=require(_0xb416('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb416('0x2'));var BPromise=require('bluebird');var rp=require(_0xb416('0x3'));var fs=require('fs');var path=require(_0xb416('0x4'));var rimraf=require(_0xb416('0x5'));var config=require(_0xb416('0x6'));var attributes=require(_0xb416('0x7'));var integrations=require(_0xb416('0x8'));module[_0xb416('0x9')]=function(_0x35bf96,_0x11956d){return _0x35bf96[_0xb416('0xa')](_0xb416('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0058=['lodash','../../config/logger','moment','request-promise','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount'];(function(_0x5bd565,_0x43dfe0){var _0x41cc80=function(_0x320223){while(--_0x320223){_0x5bd565['push'](_0x5bd565['shift']());}};_0x41cc80(++_0x43dfe0);}(_0x0058,0x1ae));var _0x8005=function(_0x780b25,_0x337877){_0x780b25=_0x780b25-0x0;var _0x2c3295=_0x0058[_0x780b25];return _0x2c3295;};'use strict';var _=require(_0x8005('0x0'));var util=require('util');var logger=require(_0x8005('0x1'))('api');var moment=require(_0x8005('0x2'));var BPromise=require('bluebird');var rp=require(_0x8005('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8005('0x4'));var attributes=require(_0x8005('0x5'));var integrations=require(_0x8005('0x6'));module[_0x8005('0x7')]=function(_0x311eea,_0x456d4f){return _0x311eea[_0x8005('0x8')](_0x8005('0x9'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 8206735..0abe20f 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 _0x75ea=['error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','limit','map','include','model','attributes','then','info','find','raw','where','ShowFreshsalesAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','FreshsalesAccount,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x5279a5,_0x43cdf5){var _0x5cba01=function(_0x57fd08){while(--_0x57fd08){_0x5279a5['push'](_0x5279a5['shift']());}};_0x5cba01(++_0x43cdf5);}(_0x75ea,0x7d));var _0xa75e=function(_0x385543,_0x56eaab){_0x385543=_0x385543-0x0;var _0x305952=_0x75ea[_0x385543];return _0x305952;};'use strict';var _=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var moment=require('moment');var BPromise=require(_0xa75e('0x2'));var rs=require(_0xa75e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa75e('0x4'))['db'];var utils=require(_0xa75e('0x5'));var logger=require(_0xa75e('0x6'))(_0xa75e('0x7'));var config=require(_0xa75e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa75e('0x9')][_0xa75e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f666f,_0x2c71ef,_0x148a23){return new BPromise(function(_0x31a28d,_0x351164){return client['request'](_0x1f666f,_0x148a23)['then'](function(_0x560baa){logger['info'](_0xa75e('0xb'),_0x2c71ef,'request\x20sent');logger[_0xa75e('0xc')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x2c71ef,_0xa75e('0xd'),JSON[_0xa75e('0xe')](_0x560baa));if(_0x560baa['error']){if(_0x560baa[_0xa75e('0xf')][_0xa75e('0x10')]===0x1f4){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);return _0x351164(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}logger[_0xa75e('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x2c71ef,_0x560baa[_0xa75e('0xf')]['message']);return _0x31a28d(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}else{logger['info'](_0xa75e('0xb'),_0x2c71ef,_0xa75e('0xd'));_0x31a28d(_0x560baa[_0xa75e('0x12')]['message']);}})[_0xa75e('0x13')](function(_0x315fde){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x315fde);_0x351164(_0x315fde);});});}exports[_0xa75e('0x14')]=function(_0x71fd71){var _0x34c0c2=this;return new Promise(function(_0x44a786,_0x5812ba){return db[_0xa75e('0x15')][_0xa75e('0x16')]({'raw':_0x71fd71[_0xa75e('0x17')]?_0x71fd71['options']['raw']===undefined?!![]:![]:!![],'where':_0x71fd71[_0xa75e('0x17')]?_0x71fd71['options']['where']||null:null,'attributes':_0x71fd71['options']?_0x71fd71[_0xa75e('0x17')]['attributes']||null:null,'limit':_0x71fd71[_0xa75e('0x17')]?_0x71fd71['options'][_0xa75e('0x18')]||null:null,'include':_0x71fd71[_0xa75e('0x17')]?_0x71fd71[_0xa75e('0x17')]['include']?_[_0xa75e('0x19')](_0x71fd71[_0xa75e('0x17')][_0xa75e('0x1a')],function(_0x4e64aa){return{'model':db[_0x4e64aa[_0xa75e('0x1b')]],'as':_0x4e64aa['as'],'attributes':_0x4e64aa[_0xa75e('0x1c')],'include':_0x4e64aa[_0xa75e('0x1a')]?_[_0xa75e('0x19')](_0x4e64aa[_0xa75e('0x1a')],function(_0x29c9df){return{'model':db[_0x29c9df[_0xa75e('0x1b')]],'as':_0x29c9df['as'],'attributes':_0x29c9df[_0xa75e('0x1c')],'include':_0x29c9df[_0xa75e('0x1a')]?_['map'](_0x29c9df['include'],function(_0x278e4a){return{'model':db[_0x278e4a[_0xa75e('0x1b')]],'as':_0x278e4a['as'],'attributes':_0x278e4a['attributes']};}):[]};}):[]};}):[]:[]})[_0xa75e('0x1d')](function(_0x316197){logger[_0xa75e('0x1e')](_0xa75e('0x14'),_0x71fd71);logger[_0xa75e('0xc')](_0xa75e('0x14'),_0x71fd71,JSON['stringify'](_0x316197));_0x44a786(_0x316197);})[_0xa75e('0x13')](function(_0x15241f){logger[_0xa75e('0xf')](_0xa75e('0x14'),_0x15241f[_0xa75e('0x11')],_0x71fd71);_0x5812ba(_0x34c0c2['error'](0x1f4,_0x15241f[_0xa75e('0x11')]));});});};exports['ShowFreshsalesAccount']=function(_0x5799d8){var _0xf86d31=this;return new Promise(function(_0x2a6c74,_0x207be3){return db[_0xa75e('0x15')][_0xa75e('0x1f')]({'raw':_0x5799d8[_0xa75e('0x17')]?_0x5799d8[_0xa75e('0x17')][_0xa75e('0x20')]===undefined?!![]:![]:!![],'where':_0x5799d8[_0xa75e('0x17')]?_0x5799d8[_0xa75e('0x17')][_0xa75e('0x21')]||null:null,'attributes':_0x5799d8[_0xa75e('0x17')]?_0x5799d8[_0xa75e('0x17')]['attributes']||null:null,'include':_0x5799d8[_0xa75e('0x17')]?_0x5799d8[_0xa75e('0x17')][_0xa75e('0x1a')]?_[_0xa75e('0x19')](_0x5799d8[_0xa75e('0x17')][_0xa75e('0x1a')],function(_0x5c1200){return{'model':db[_0x5c1200['model']],'as':_0x5c1200['as'],'attributes':_0x5c1200['attributes'],'include':_0x5c1200[_0xa75e('0x1a')]?_['map'](_0x5c1200['include'],function(_0x2824d0){return{'model':db[_0x2824d0['model']],'as':_0x2824d0['as'],'attributes':_0x2824d0[_0xa75e('0x1c')],'include':_0x2824d0[_0xa75e('0x1a')]?_[_0xa75e('0x19')](_0x2824d0[_0xa75e('0x1a')],function(_0x4a9356){return{'model':db[_0x4a9356[_0xa75e('0x1b')]],'as':_0x4a9356['as'],'attributes':_0x4a9356[_0xa75e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa75e('0x1d')](function(_0x5f3d8f){logger['info'](_0xa75e('0x22'),_0x5799d8);logger[_0xa75e('0xc')]('ShowFreshsalesAccount',_0x5799d8,JSON[_0xa75e('0xe')](_0x5f3d8f));_0x2a6c74(_0x5f3d8f);})[_0xa75e('0x13')](function(_0x582d73){logger[_0xa75e('0xf')](_0xa75e('0x22'),_0x582d73['message'],_0x5799d8);_0x207be3(_0xf86d31[_0xa75e('0xf')](0x1f4,_0x582d73[_0xa75e('0x11')]));});});}; \ No newline at end of file +var _0x3f48=['attributes','model','debug','ShowFreshsalesAccount','find','then','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','limit','map','include'];(function(_0x55b121,_0x317a6e){var _0x25112c=function(_0x23873d){while(--_0x23873d){_0x55b121['push'](_0x55b121['shift']());}};_0x25112c(++_0x317a6e);}(_0x3f48,0x17c));var _0x83f4=function(_0x1aaaf3,_0x416999){_0x1aaaf3=_0x1aaaf3-0x0;var _0x24851c=_0x3f48[_0x1aaaf3];return _0x24851c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x83f4('0x0'));var BPromise=require(_0x83f4('0x1'));var rs=require(_0x83f4('0x2'));var fs=require('fs');var Redis=require(_0x83f4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x83f4('0x4'));var logger=require(_0x83f4('0x5'))('rpc');var config=require(_0x83f4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x83f4('0x7')][_0x83f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3898cf,_0x2ef14a,_0xc5db57){return new BPromise(function(_0x178e11,_0x1e8e5c){return client[_0x83f4('0x9')](_0x3898cf,_0xc5db57)['then'](function(_0x11a159){logger[_0x83f4('0xa')](_0x83f4('0xb'),_0x2ef14a,'request\x20sent');logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x2ef14a,_0x83f4('0xc'),JSON[_0x83f4('0xd')](_0x11a159));if(_0x11a159[_0x83f4('0xe')]){if(_0x11a159['error'][_0x83f4('0xf')]===0x1f4){logger[_0x83f4('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x2ef14a,_0x11a159[_0x83f4('0xe')][_0x83f4('0x10')]);return _0x1e8e5c(_0x11a159[_0x83f4('0xe')][_0x83f4('0x10')]);}logger[_0x83f4('0xe')](_0x83f4('0xb'),_0x2ef14a,_0x11a159[_0x83f4('0xe')]['message']);return _0x178e11(_0x11a159[_0x83f4('0xe')][_0x83f4('0x10')]);}else{logger[_0x83f4('0xa')](_0x83f4('0xb'),_0x2ef14a,_0x83f4('0xc'));_0x178e11(_0x11a159[_0x83f4('0x11')]['message']);}})[_0x83f4('0x12')](function(_0x37dbac){logger[_0x83f4('0xe')](_0x83f4('0xb'),_0x2ef14a,_0x37dbac);_0x1e8e5c(_0x37dbac);});});}exports[_0x83f4('0x13')]=function(_0x5db794){var _0x1b4702=this;return new Promise(function(_0x495305,_0x302089){return db[_0x83f4('0x14')][_0x83f4('0x15')]({'raw':_0x5db794[_0x83f4('0x16')]?_0x5db794[_0x83f4('0x16')][_0x83f4('0x17')]===undefined?!![]:![]:!![],'where':_0x5db794['options']?_0x5db794[_0x83f4('0x16')][_0x83f4('0x18')]||null:null,'attributes':_0x5db794[_0x83f4('0x16')]?_0x5db794[_0x83f4('0x16')]['attributes']||null:null,'limit':_0x5db794['options']?_0x5db794[_0x83f4('0x16')][_0x83f4('0x19')]||null:null,'include':_0x5db794[_0x83f4('0x16')]?_0x5db794[_0x83f4('0x16')]['include']?_[_0x83f4('0x1a')](_0x5db794[_0x83f4('0x16')][_0x83f4('0x1b')],function(_0x10c3b8){return{'model':db[_0x10c3b8['model']],'as':_0x10c3b8['as'],'attributes':_0x10c3b8[_0x83f4('0x1c')],'include':_0x10c3b8['include']?_[_0x83f4('0x1a')](_0x10c3b8[_0x83f4('0x1b')],function(_0x224d63){return{'model':db[_0x224d63[_0x83f4('0x1d')]],'as':_0x224d63['as'],'attributes':_0x224d63[_0x83f4('0x1c')],'include':_0x224d63[_0x83f4('0x1b')]?_[_0x83f4('0x1a')](_0x224d63[_0x83f4('0x1b')],function(_0x18bbc5){return{'model':db[_0x18bbc5[_0x83f4('0x1d')]],'as':_0x18bbc5['as'],'attributes':_0x18bbc5[_0x83f4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2530be){logger['info']('GetFreshsalesAccount',_0x5db794);logger[_0x83f4('0x1e')]('GetFreshsalesAccount',_0x5db794,JSON[_0x83f4('0xd')](_0x2530be));_0x495305(_0x2530be);})[_0x83f4('0x12')](function(_0x139913){logger['error']('GetFreshsalesAccount',_0x139913['message'],_0x5db794);_0x302089(_0x1b4702[_0x83f4('0xe')](0x1f4,_0x139913[_0x83f4('0x10')]));});});};exports[_0x83f4('0x1f')]=function(_0x1b48fa){var _0x57fd72=this;return new Promise(function(_0x29350b,_0xb60421){return db[_0x83f4('0x14')][_0x83f4('0x20')]({'raw':_0x1b48fa[_0x83f4('0x16')]?_0x1b48fa[_0x83f4('0x16')][_0x83f4('0x17')]===undefined?!![]:![]:!![],'where':_0x1b48fa[_0x83f4('0x16')]?_0x1b48fa['options'][_0x83f4('0x18')]||null:null,'attributes':_0x1b48fa['options']?_0x1b48fa[_0x83f4('0x16')]['attributes']||null:null,'include':_0x1b48fa[_0x83f4('0x16')]?_0x1b48fa['options'][_0x83f4('0x1b')]?_[_0x83f4('0x1a')](_0x1b48fa['options'][_0x83f4('0x1b')],function(_0x4bc911){return{'model':db[_0x4bc911[_0x83f4('0x1d')]],'as':_0x4bc911['as'],'attributes':_0x4bc911['attributes'],'include':_0x4bc911[_0x83f4('0x1b')]?_['map'](_0x4bc911[_0x83f4('0x1b')],function(_0x210a20){return{'model':db[_0x210a20[_0x83f4('0x1d')]],'as':_0x210a20['as'],'attributes':_0x210a20[_0x83f4('0x1c')],'include':_0x210a20[_0x83f4('0x1b')]?_[_0x83f4('0x1a')](_0x210a20['include'],function(_0x1546a1){return{'model':db[_0x1546a1[_0x83f4('0x1d')]],'as':_0x1546a1['as'],'attributes':_0x1546a1[_0x83f4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x83f4('0x21')](function(_0x19fcdd){logger[_0x83f4('0xa')](_0x83f4('0x1f'),_0x1b48fa);logger[_0x83f4('0x1e')](_0x83f4('0x1f'),_0x1b48fa,JSON[_0x83f4('0xd')](_0x19fcdd));_0x29350b(_0x19fcdd);})[_0x83f4('0x12')](function(_0x3a7c22){logger[_0x83f4('0xe')](_0x83f4('0x1f'),_0x3a7c22[_0x83f4('0x10')],_0x1b48fa);_0xb60421(_0x57fd72[_0x83f4('0xe')](0x1f4,_0x3a7c22[_0x83f4('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 1b74eca..e06bf3d 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 _0x410c=['getFields','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields'];(function(_0x45f2b9,_0x451730){var _0x117326=function(_0x4dfc8c){while(--_0x4dfc8c){_0x45f2b9['push'](_0x45f2b9['shift']());}};_0x117326(++_0x451730);}(_0x410c,0x1b2));var _0xc410=function(_0x583dde,_0x5c0cc0){_0x583dde=_0x583dde-0x0;var _0x304c53=_0x410c[_0x583dde];return _0x304c53;};'use strict';var multer=require(_0xc410('0x0'));var util=require(_0xc410('0x1'));var path=require(_0xc410('0x2'));var timeout=require('connect-timeout');var express=require(_0xc410('0x3'));var router=express[_0xc410('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc410('0x5'));var config=require(_0xc410('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xc410('0x7')]('/',auth[_0xc410('0x8')](),controller[_0xc410('0x9')]);router[_0xc410('0x7')]('/:id',auth[_0xc410('0x8')](),controller[_0xc410('0xa')]);router[_0xc410('0x7')](_0xc410('0xb'),auth['isAuthenticated'](),controller[_0xc410('0xc')]);router[_0xc410('0x7')](_0xc410('0xd'),auth['isAuthenticated'](),controller[_0xc410('0xe')]);router['get'](_0xc410('0xf'),auth[_0xc410('0x8')](),controller[_0xc410('0x10')]);router[_0xc410('0x11')]('/',auth[_0xc410('0x8')](),controller[_0xc410('0x12')]);router[_0xc410('0x13')]('/:id',auth[_0xc410('0x8')](),controller[_0xc410('0x14')]);router[_0xc410('0x15')](_0xc410('0x16'),auth[_0xc410('0x8')](),controller[_0xc410('0x17')]);module[_0xc410('0x18')]=router; \ No newline at end of file +var _0x6baa=['path','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','/:id','show','get','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','create','put','update','delete','destroy','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6baa,0x1e2));var _0xa6ba=function(_0x33c5d4,_0x37651a){_0x33c5d4=_0x33c5d4-0x0;var _0x285217=_0x6baa[_0x33c5d4];return _0x285217;};'use strict';var multer=require(_0xa6ba('0x0'));var util=require(_0xa6ba('0x1'));var path=require(_0xa6ba('0x2'));var timeout=require('connect-timeout');var express=require(_0xa6ba('0x3'));var router=express[_0xa6ba('0x4')]();var fs_extra=require(_0xa6ba('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa6ba('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0xa6ba('0x7')](),controller[_0xa6ba('0x8')]);router['get'](_0xa6ba('0x9'),auth[_0xa6ba('0x7')](),controller[_0xa6ba('0xa')]);router[_0xa6ba('0xb')](_0xa6ba('0xc'),auth[_0xa6ba('0x7')](),controller[_0xa6ba('0xd')]);router[_0xa6ba('0xb')](_0xa6ba('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xa6ba('0xb')](_0xa6ba('0xf'),auth[_0xa6ba('0x7')](),controller[_0xa6ba('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa6ba('0x11')]);router[_0xa6ba('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa6ba('0x13')]);router[_0xa6ba('0x14')](_0xa6ba('0x9'),auth[_0xa6ba('0x7')](),controller[_0xa6ba('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 4731ad6..7333938 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 _0x8b6a=['STRING','sequelize','exports'];(function(_0xa4b885,_0x1e725a){var _0x2be448=function(_0x57cacb){while(--_0x57cacb){_0xa4b885['push'](_0xa4b885['shift']());}};_0x2be448(++_0x1e725a);}(_0x8b6a,0xeb));var _0xa8b6=function(_0xe46d7f,_0x3a4970){_0xe46d7f=_0xe46d7f-0x0;var _0x13806b=_0x8b6a[_0xe46d7f];return _0x13806b;};'use strict';var Sequelize=require(_0xa8b6('0x0'));module[_0xa8b6('0x1')]={'name':{'type':Sequelize[_0xa8b6('0x2')]},'description':{'type':Sequelize[_0xa8b6('0x2')]}}; \ No newline at end of file +var _0x7846=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7846,0x17e));var _0x6784=function(_0x59e862,_0x477bf2){_0x59e862=_0x59e862-0x0;var _0x1a25ee=_0x7846[_0x59e862];return _0x1a25ee;};'use strict';var Sequelize=require(_0x6784('0x0'));module[_0x6784('0x1')]={'name':{'type':Sequelize[_0x6784('0x2')]},'description':{'type':Sequelize[_0x6784('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 3d99612..9be8477 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 _0xd69e=['then','destroy','end','sendStatus','stack','name','send','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','status','count','offset','limit','Content-Range','json','apply','reject','update'];(function(_0x1cfcc9,_0x26d912){var _0x5ab846=function(_0xd45a4e){while(--_0xd45a4e){_0x1cfcc9['push'](_0x1cfcc9['shift']());}};_0x5ab846(++_0x26d912);}(_0xd69e,0x13d));var _0xed69=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd69e[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xed69('0x0'));var rimraf=require(_0xed69('0x1'));var zipdir=require(_0xed69('0x2'));var jsonpatch=require(_0xed69('0x3'));var rp=require('request-promise');var moment=require(_0xed69('0x4'));var BPromise=require(_0xed69('0x5'));var Mustache=require(_0xed69('0x6'));var util=require('util');var path=require(_0xed69('0x7'));var sox=require(_0xed69('0x8'));var csv=require(_0xed69('0x9'));var ejs=require(_0xed69('0xa'));var fs=require('fs');var fs_extra=require(_0xed69('0xb'));var _=require(_0xed69('0xc'));var squel=require(_0xed69('0xd'));var crypto=require(_0xed69('0xe'));var jsforce=require(_0xed69('0xf'));var deskjs=require(_0xed69('0x10'));var toCsv=require(_0xed69('0x9'));var querystring=require(_0xed69('0x11'));var Papa=require('papaparse');var Redis=require(_0xed69('0x12'));var authService=require(_0xed69('0x13'));var qs=require(_0xed69('0x14'));var as=require(_0xed69('0x15'));var hardwareService=require(_0xed69('0x16'));var logger=require(_0xed69('0x17'))(_0xed69('0x18'));var utils=require(_0xed69('0x19'));var config=require(_0xed69('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xed69('0x1b'));var client=jayson[_0xed69('0x1c')][_0xed69('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2e113b,_0x1f2beb,_0x4bb695,_0x1c7b09){return new BPromise(function(_0x20b3d8,_0x46dfd0){var _0x24cfa1=_0x1c7b09||client;return _0x24cfa1['request'](_0x2e113b,_0x4bb695)['then'](function(_0x3b92a4){logger[_0xed69('0x1e')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1f2beb,_0xed69('0x1f'));logger[_0xed69('0x20')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1f2beb,_0xed69('0x1f'),JSON[_0xed69('0x21')](_0x3b92a4));if(_0x3b92a4[_0xed69('0x22')]){if(_0x3b92a4[_0xed69('0x22')][_0xed69('0x23')]===0x1f4){logger[_0xed69('0x22')](_0xed69('0x24'),_0x1f2beb,_0x3b92a4[_0xed69('0x22')][_0xed69('0x25')]);return _0x46dfd0(_0x3b92a4[_0xed69('0x22')][_0xed69('0x25')]);}logger['error'](_0xed69('0x24'),_0x1f2beb,_0x3b92a4['error']['message']);return _0x20b3d8(_0x3b92a4[_0xed69('0x22')]['message']);}else{logger[_0xed69('0x1e')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1f2beb,_0xed69('0x1f'));_0x20b3d8(_0x3b92a4['result'][_0xed69('0x25')]);}})['catch'](function(_0x54d521){logger['error'](_0xed69('0x24'),_0x1f2beb,_0x54d521);_0x46dfd0(_0x54d521);});});}function respondWithStatusCode(_0x5ad0b0,_0x179535){_0x179535=_0x179535||0xcc;return function(_0x5f0f00){if(_0x5f0f00){return _0x5ad0b0['sendStatus'](_0x179535);}return _0x5ad0b0['status'](_0x179535)['end']();};}function respondWithResult(_0x39b836,_0x1b68a7){_0x1b68a7=_0x1b68a7||0xc8;return function(_0x175ebe){if(_0x175ebe){return _0x39b836[_0xed69('0x26')](_0x1b68a7)['json'](_0x175ebe);}};}function respondWithFilteredResult(_0xcb69f6,_0x50bad2){return function(_0x360e64){if(_0x360e64){var _0x16f8e0=_0x360e64[_0xed69('0x27')],_0xd00abb=_0x50bad2[_0xed69('0x28')],_0x54311e=_0x50bad2[_0xed69('0x28')]+_0x50bad2[_0xed69('0x29')],_0x264045;if(_0x54311e>=_0x16f8e0){_0x54311e=_0x16f8e0;_0x264045=0xc8;}else{_0x264045=0xce;}_0xcb69f6[_0xed69('0x26')](_0x264045);return _0xcb69f6['set'](_0xed69('0x2a'),_0xd00abb+'-'+_0x54311e+'/'+_0x16f8e0)[_0xed69('0x2b')](_0x360e64);}return null;};}function patchUpdates(_0x2e058d){return function(_0x19921a){try{jsonpatch[_0xed69('0x2c')](_0x19921a,_0x2e058d,!![]);}catch(_0x62bfaa){return BPromise[_0xed69('0x2d')](_0x62bfaa);}return _0x19921a['save']();};}function saveUpdates(_0x4c500a,_0x102426){return function(_0xcf0620){if(_0xcf0620){return _0xcf0620[_0xed69('0x2e')](_0x4c500a)[_0xed69('0x2f')](function(_0x13c04f){return _0x13c04f;});}return null;};}function removeEntity(_0x30fd9d,_0x5758aa){return function(_0x34d8b1){if(_0x34d8b1){return _0x34d8b1[_0xed69('0x30')]()[_0xed69('0x2f')](function(){_0x30fd9d[_0xed69('0x26')](0xcc)[_0xed69('0x31')]();});}};}function handleEntityNotFound(_0x44f325,_0x81a6ca){return function(_0x327e5f){if(!_0x327e5f){_0x44f325[_0xed69('0x32')](0x194);}return _0x327e5f;};}function handleError(_0x59b38c,_0x4ad093){_0x4ad093=_0x4ad093||0x1f4;return function(_0x41a1a7){logger['error'](_0x41a1a7[_0xed69('0x33')]);if(_0x41a1a7[_0xed69('0x34')]){delete _0x41a1a7['name'];}_0x59b38c[_0xed69('0x26')](_0x4ad093)[_0xed69('0x35')](_0x41a1a7);};}exports['index']=function(_0x38ae52,_0x2b7e9e){var _0x5a38ac={},_0x3d80da={},_0x315a2b={'count':0x0,'rows':[]};var _0x5bd6b1=_[_0xed69('0x36')](db[_0xed69('0x37')][_0xed69('0x38')],function(_0x39eb16){return{'name':_0x39eb16['fieldName'],'type':_0x39eb16[_0xed69('0x39')][_0xed69('0x3a')]};});_0x3d80da[_0xed69('0x3b')]=_['map'](_0x5bd6b1,_0xed69('0x34'));_0x3d80da[_0xed69('0x3c')]=_[_0xed69('0x3d')](_0x38ae52[_0xed69('0x3c')]);_0x3d80da['filters']=_[_0xed69('0x3e')](_0x3d80da['model'],_0x3d80da['query']);_0x5a38ac['attributes']=_[_0xed69('0x3e')](_0x3d80da['model'],qs[_0xed69('0x3f')](_0x38ae52[_0xed69('0x3c')]['fields']));_0x5a38ac[_0xed69('0x40')]=_0x5a38ac['attributes']['length']?_0x5a38ac[_0xed69('0x40')]:_0x3d80da[_0xed69('0x3b')];if(!_0x38ae52[_0xed69('0x3c')][_0xed69('0x41')](_0xed69('0x42'))){_0x5a38ac[_0xed69('0x29')]=qs[_0xed69('0x29')](_0x38ae52[_0xed69('0x3c')][_0xed69('0x29')]);_0x5a38ac['offset']=qs[_0xed69('0x28')](_0x38ae52[_0xed69('0x3c')][_0xed69('0x28')]);}_0x5a38ac[_0xed69('0x43')]=qs['sort'](_0x38ae52['query'][_0xed69('0x44')]);_0x5a38ac[_0xed69('0x45')]=qs[_0xed69('0x46')](_[_0xed69('0x47')](_0x38ae52[_0xed69('0x3c')],_0x3d80da[_0xed69('0x46')]),_0x5bd6b1);if(_0x38ae52[_0xed69('0x3c')][_0xed69('0x48')]){_0x5a38ac[_0xed69('0x45')]=_['merge'](_0x5a38ac['where'],{'$or':_[_0xed69('0x36')](_0x5bd6b1,function(_0x28e194){if(_0x28e194[_0xed69('0x39')]!=='VIRTUAL'){var _0x55b57d={};_0x55b57d[_0x28e194[_0xed69('0x34')]]={'$like':'%'+_0x38ae52[_0xed69('0x3c')][_0xed69('0x48')]+'%'};return _0x55b57d;}})});}_0x5a38ac=_['merge']({},_0x5a38ac,_0x38ae52[_0xed69('0x49')]);var _0x2ab1a7={'where':_0x5a38ac[_0xed69('0x45')]};return db['FreshsalesConfiguration'][_0xed69('0x27')](_0x2ab1a7)['then'](function(_0x92d4f5){_0x315a2b[_0xed69('0x27')]=_0x92d4f5;if(_0x38ae52[_0xed69('0x3c')][_0xed69('0x4a')]){_0x5a38ac[_0xed69('0x4b')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xed69('0x4c')](_0x5a38ac);})[_0xed69('0x2f')](function(_0x4d1877){_0x315a2b[_0xed69('0x4d')]=_0x4d1877;return _0x315a2b;})['then'](respondWithFilteredResult(_0x2b7e9e,_0x5a38ac))[_0xed69('0x4e')](handleError(_0x2b7e9e,null));};exports[_0xed69('0x4f')]=function(_0x1e3a24,_0x127f67){var _0x1f6810={'raw':![],'where':{'id':_0x1e3a24[_0xed69('0x50')]['id']}},_0x30e7ab={};_0x30e7ab[_0xed69('0x3b')]=_[_0xed69('0x3d')](db['FreshsalesConfiguration'][_0xed69('0x38')]);_0x30e7ab[_0xed69('0x3c')]=_[_0xed69('0x3d')](_0x1e3a24[_0xed69('0x3c')]);_0x30e7ab['filters']=_[_0xed69('0x3e')](_0x30e7ab[_0xed69('0x3b')],_0x30e7ab[_0xed69('0x3c')]);_0x1f6810[_0xed69('0x40')]=_['intersection'](_0x30e7ab[_0xed69('0x3b')],qs[_0xed69('0x3f')](_0x1e3a24[_0xed69('0x3c')]['fields']));_0x1f6810[_0xed69('0x40')]=_0x1f6810['attributes'][_0xed69('0x51')]?_0x1f6810[_0xed69('0x40')]:_0x30e7ab[_0xed69('0x3b')];if(_0x1e3a24['query']['includeAll']){_0x1f6810[_0xed69('0x4b')]=[{'all':!![]}];}_0x1f6810=_[_0xed69('0x52')]({},_0x1f6810,_0x1e3a24[_0xed69('0x49')]);return db[_0xed69('0x37')][_0xed69('0x53')](_0x1f6810)[_0xed69('0x2f')](handleEntityNotFound(_0x127f67,null))[_0xed69('0x2f')](respondWithResult(_0x127f67,null))[_0xed69('0x4e')](handleError(_0x127f67,null));};exports[_0xed69('0x54')]=function(_0x3dbbeb,_0x385b96){return db[_0xed69('0x37')][_0xed69('0x54')](_0x3dbbeb[_0xed69('0x55')],{})[_0xed69('0x2f')](respondWithResult(_0x385b96,0xc9))['catch'](handleError(_0x385b96,null));};exports['update']=function(_0x1c866a,_0x2ddf38){if(_0x1c866a['body']['id']){delete _0x1c866a['body']['id'];}return db[_0xed69('0x37')][_0xed69('0x53')]({'where':{'id':_0x1c866a[_0xed69('0x50')]['id']}})[_0xed69('0x2f')](handleEntityNotFound(_0x2ddf38,null))[_0xed69('0x2f')](saveUpdates(_0x1c866a[_0xed69('0x55')],null))[_0xed69('0x2f')](respondWithResult(_0x2ddf38,null))[_0xed69('0x4e')](handleError(_0x2ddf38,null));};exports[_0xed69('0x30')]=function(_0x265e97,_0x3afb0c){return db[_0xed69('0x37')]['find']({'where':{'id':_0x265e97[_0xed69('0x50')]['id']}})[_0xed69('0x2f')](handleEntityNotFound(_0x3afb0c,null))['then'](removeEntity(_0x3afb0c,null))[_0xed69('0x4e')](handleError(_0x3afb0c,null));};exports[_0xed69('0x56')]=function(_0x5bf3d6,_0x3a1d83,_0x127f9f){var _0x1d8c2a={};var _0x1173b5={};var _0x30407d;var _0x5912d0;return db[_0xed69('0x37')][_0xed69('0x57')]({'where':{'id':_0x5bf3d6[_0xed69('0x50')]['id']}})[_0xed69('0x2f')](handleEntityNotFound(_0x3a1d83,null))['then'](function(_0x1ca183){if(_0x1ca183){_0x30407d=_0x1ca183;_0x1173b5[_0xed69('0x3b')]=_[_0xed69('0x3d')](db[_0xed69('0x58')][_0xed69('0x38')]);_0x1173b5['query']=_[_0xed69('0x3d')](_0x5bf3d6[_0xed69('0x3c')]);_0x1173b5['filters']=_[_0xed69('0x3e')](_0x1173b5['model'],_0x1173b5['query']);_0x1d8c2a[_0xed69('0x40')]=_[_0xed69('0x3e')](_0x1173b5[_0xed69('0x3b')],qs[_0xed69('0x3f')](_0x5bf3d6[_0xed69('0x3c')][_0xed69('0x3f')]));_0x1d8c2a[_0xed69('0x40')]=_0x1d8c2a[_0xed69('0x40')]['length']?_0x1d8c2a[_0xed69('0x40')]:_0x1173b5[_0xed69('0x3b')];_0x1d8c2a[_0xed69('0x43')]=qs['sort'](_0x5bf3d6[_0xed69('0x3c')]['sort']);_0x1d8c2a[_0xed69('0x45')]=qs[_0xed69('0x46')](_[_0xed69('0x47')](_0x5bf3d6[_0xed69('0x3c')],_0x1173b5[_0xed69('0x46')]));if(_0x5bf3d6['query']['filter']){_0x1d8c2a[_0xed69('0x45')]=_['merge'](_0x1d8c2a[_0xed69('0x45')],{'$or':_['map'](_0x1d8c2a[_0xed69('0x40')],function(_0x3eb77a){var _0x5b7715={};_0x5b7715[_0x3eb77a]={'$like':'%'+_0x5bf3d6['query'][_0xed69('0x48')]+'%'};return _0x5b7715;})});}_0x1d8c2a=_[_0xed69('0x52')]({},_0x1d8c2a,_0x5bf3d6[_0xed69('0x49')]);return _0x30407d[_0xed69('0x56')](_0x1d8c2a);}})[_0xed69('0x2f')](function(_0x1a0379){if(_0x1a0379){_0x5912d0=_0x1a0379['length'];if(!_0x5bf3d6[_0xed69('0x3c')][_0xed69('0x41')](_0xed69('0x42'))){_0x1d8c2a['limit']=qs['limit'](_0x5bf3d6[_0xed69('0x3c')][_0xed69('0x29')]);_0x1d8c2a['offset']=qs[_0xed69('0x28')](_0x5bf3d6[_0xed69('0x3c')][_0xed69('0x28')]);}return _0x30407d[_0xed69('0x56')](_0x1d8c2a);}})['then'](function(_0xa18d8a){if(_0xa18d8a){return _0xa18d8a?{'count':_0x5912d0,'rows':_0xa18d8a}:null;}})[_0xed69('0x2f')](respondWithResult(_0x3a1d83,null))[_0xed69('0x4e')](handleError(_0x3a1d83,null));};exports['getDescriptions']=function(_0x57065c,_0x23c7c3,_0x104077){var _0x4e4f69={};var _0x3b73f3={};var _0x4f052c;var _0x2204f2;return db[_0xed69('0x37')][_0xed69('0x57')]({'where':{'id':_0x57065c[_0xed69('0x50')]['id']}})[_0xed69('0x2f')](handleEntityNotFound(_0x23c7c3,null))[_0xed69('0x2f')](function(_0x365181){if(_0x365181){_0x4f052c=_0x365181;_0x3b73f3[_0xed69('0x3b')]=_[_0xed69('0x3d')](db['FreshsalesField'][_0xed69('0x38')]);_0x3b73f3[_0xed69('0x3c')]=_[_0xed69('0x3d')](_0x57065c[_0xed69('0x3c')]);_0x3b73f3[_0xed69('0x46')]=_[_0xed69('0x3e')](_0x3b73f3[_0xed69('0x3b')],_0x3b73f3[_0xed69('0x3c')]);_0x4e4f69['attributes']=_[_0xed69('0x3e')](_0x3b73f3[_0xed69('0x3b')],qs[_0xed69('0x3f')](_0x57065c[_0xed69('0x3c')]['fields']));_0x4e4f69[_0xed69('0x40')]=_0x4e4f69[_0xed69('0x40')][_0xed69('0x51')]?_0x4e4f69[_0xed69('0x40')]:_0x3b73f3[_0xed69('0x3b')];_0x4e4f69[_0xed69('0x43')]=qs[_0xed69('0x44')](_0x57065c[_0xed69('0x3c')]['sort']);_0x4e4f69[_0xed69('0x45')]=qs[_0xed69('0x46')](_[_0xed69('0x47')](_0x57065c[_0xed69('0x3c')],_0x3b73f3[_0xed69('0x46')]));if(_0x57065c[_0xed69('0x3c')][_0xed69('0x48')]){_0x4e4f69[_0xed69('0x45')]=_[_0xed69('0x52')](_0x4e4f69[_0xed69('0x45')],{'$or':_[_0xed69('0x36')](_0x4e4f69[_0xed69('0x40')],function(_0x118c58){var _0x8480bb={};_0x8480bb[_0x118c58]={'$like':'%'+_0x57065c[_0xed69('0x3c')]['filter']+'%'};return _0x8480bb;})});}_0x4e4f69=_['merge']({},_0x4e4f69,_0x57065c['options']);return _0x4f052c[_0xed69('0x59')](_0x4e4f69);}})[_0xed69('0x2f')](function(_0x53cf32){if(_0x53cf32){_0x2204f2=_0x53cf32[_0xed69('0x51')];if(!_0x57065c[_0xed69('0x3c')]['hasOwnProperty'](_0xed69('0x42'))){_0x4e4f69[_0xed69('0x29')]=qs[_0xed69('0x29')](_0x57065c[_0xed69('0x3c')][_0xed69('0x29')]);_0x4e4f69[_0xed69('0x28')]=qs[_0xed69('0x28')](_0x57065c[_0xed69('0x3c')][_0xed69('0x28')]);}return _0x4f052c['getDescriptions'](_0x4e4f69);}})[_0xed69('0x2f')](function(_0x51e189){if(_0x51e189){return _0x51e189?{'count':_0x2204f2,'rows':_0x51e189}:null;}})[_0xed69('0x2f')](respondWithResult(_0x23c7c3,null))[_0xed69('0x4e')](handleError(_0x23c7c3,null));};exports[_0xed69('0x5a')]=function(_0x543251,_0x21fe7,_0x33363b){var _0x2f39c5={};var _0x5d9144={};var _0x42a3c9;var _0x3156f1;return db[_0xed69('0x37')][_0xed69('0x57')]({'where':{'id':_0x543251[_0xed69('0x50')]['id']}})[_0xed69('0x2f')](handleEntityNotFound(_0x21fe7,null))[_0xed69('0x2f')](function(_0x1da59c){if(_0x1da59c){_0x42a3c9=_0x1da59c;_0x5d9144[_0xed69('0x3b')]=_[_0xed69('0x3d')](db[_0xed69('0x58')][_0xed69('0x38')]);_0x5d9144['query']=_[_0xed69('0x3d')](_0x543251[_0xed69('0x3c')]);_0x5d9144['filters']=_[_0xed69('0x3e')](_0x5d9144[_0xed69('0x3b')],_0x5d9144[_0xed69('0x3c')]);_0x2f39c5[_0xed69('0x40')]=_[_0xed69('0x3e')](_0x5d9144['model'],qs['fields'](_0x543251[_0xed69('0x3c')][_0xed69('0x3f')]));_0x2f39c5[_0xed69('0x40')]=_0x2f39c5[_0xed69('0x40')][_0xed69('0x51')]?_0x2f39c5['attributes']:_0x5d9144['model'];_0x2f39c5[_0xed69('0x43')]=qs['sort'](_0x543251['query'][_0xed69('0x44')]);_0x2f39c5['where']=qs['filters'](_['pick'](_0x543251[_0xed69('0x3c')],_0x5d9144[_0xed69('0x46')]));if(_0x543251[_0xed69('0x3c')][_0xed69('0x48')]){_0x2f39c5['where']=_[_0xed69('0x52')](_0x2f39c5[_0xed69('0x45')],{'$or':_[_0xed69('0x36')](_0x2f39c5[_0xed69('0x40')],function(_0x425236){var _0x22917e={};_0x22917e[_0x425236]={'$like':'%'+_0x543251[_0xed69('0x3c')][_0xed69('0x48')]+'%'};return _0x22917e;})});}_0x2f39c5=_[_0xed69('0x52')]({},_0x2f39c5,_0x543251[_0xed69('0x49')]);return _0x42a3c9[_0xed69('0x5a')](_0x2f39c5);}})[_0xed69('0x2f')](function(_0x137450){if(_0x137450){_0x3156f1=_0x137450[_0xed69('0x51')];if(!_0x543251[_0xed69('0x3c')][_0xed69('0x41')]('nolimit')){_0x2f39c5[_0xed69('0x29')]=qs[_0xed69('0x29')](_0x543251[_0xed69('0x3c')][_0xed69('0x29')]);_0x2f39c5[_0xed69('0x28')]=qs['offset'](_0x543251['query'][_0xed69('0x28')]);}return _0x42a3c9[_0xed69('0x5a')](_0x2f39c5);}})[_0xed69('0x2f')](function(_0x494bb1){if(_0x494bb1){return _0x494bb1?{'count':_0x3156f1,'rows':_0x494bb1}:null;}})[_0xed69('0x2f')](respondWithResult(_0x21fe7,null))[_0xed69('0x4e')](handleError(_0x21fe7,null));}; \ No newline at end of file +var _0x374c=['getSubjects','findOne','FreshsalesField','merge','nolimit','getDescriptions','getFields','rimraf','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows','params','find','create','body'];(function(_0x5a0019,_0x5a3b0e){var _0x43f01a=function(_0x3e7717){while(--_0x3e7717){_0x5a0019['push'](_0x5a0019['shift']());}};_0x43f01a(++_0x5a3b0e);}(_0x374c,0xc1));var _0xc374=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x374c[_0x50aa2e];return _0x5e07f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc374('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc374('0x1'));var rp=require(_0xc374('0x2'));var moment=require(_0xc374('0x3'));var BPromise=require(_0xc374('0x4'));var Mustache=require(_0xc374('0x5'));var util=require(_0xc374('0x6'));var path=require(_0xc374('0x7'));var sox=require(_0xc374('0x8'));var csv=require(_0xc374('0x9'));var ejs=require(_0xc374('0xa'));var fs=require('fs');var fs_extra=require(_0xc374('0xb'));var _=require(_0xc374('0xc'));var squel=require(_0xc374('0xd'));var crypto=require(_0xc374('0xe'));var jsforce=require(_0xc374('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc374('0x9'));var querystring=require(_0xc374('0x10'));var Papa=require(_0xc374('0x11'));var Redis=require(_0xc374('0x12'));var authService=require(_0xc374('0x13'));var qs=require(_0xc374('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc374('0x15'));var logger=require(_0xc374('0x16'))(_0xc374('0x17'));var utils=require(_0xc374('0x18'));var config=require(_0xc374('0x19'));var licenseUtil=require(_0xc374('0x1a'));var db=require(_0xc374('0x1b'))['db'];var jayson=require(_0xc374('0x1c'));var client=jayson['client'][_0xc374('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x580eb7,_0x1c5edf,_0x43b75e,_0x3bf4dd){return new BPromise(function(_0x5275e4,_0x106913){var _0x513694=_0x3bf4dd||client;return _0x513694[_0xc374('0x1e')](_0x580eb7,_0x43b75e)[_0xc374('0x1f')](function(_0x107db2){logger[_0xc374('0x20')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1c5edf,_0xc374('0x21'));logger[_0xc374('0x22')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1c5edf,_0xc374('0x21'),JSON[_0xc374('0x23')](_0x107db2));if(_0x107db2[_0xc374('0x24')]){if(_0x107db2[_0xc374('0x24')]['code']===0x1f4){logger['error'](_0xc374('0x25'),_0x1c5edf,_0x107db2[_0xc374('0x24')][_0xc374('0x26')]);return _0x106913(_0x107db2[_0xc374('0x24')][_0xc374('0x26')]);}logger[_0xc374('0x24')](_0xc374('0x25'),_0x1c5edf,_0x107db2[_0xc374('0x24')][_0xc374('0x26')]);return _0x5275e4(_0x107db2[_0xc374('0x24')][_0xc374('0x26')]);}else{logger['info'](_0xc374('0x25'),_0x1c5edf,_0xc374('0x21'));_0x5275e4(_0x107db2[_0xc374('0x27')][_0xc374('0x26')]);}})[_0xc374('0x28')](function(_0x432f23){logger['error'](_0xc374('0x25'),_0x1c5edf,_0x432f23);_0x106913(_0x432f23);});});}function respondWithStatusCode(_0x43df50,_0x4c0d5d){_0x4c0d5d=_0x4c0d5d||0xcc;return function(_0x50a85f){if(_0x50a85f){return _0x43df50[_0xc374('0x29')](_0x4c0d5d);}return _0x43df50['status'](_0x4c0d5d)[_0xc374('0x2a')]();};}function respondWithResult(_0x16ffcc,_0x1e7da5){_0x1e7da5=_0x1e7da5||0xc8;return function(_0x1e88b7){if(_0x1e88b7){return _0x16ffcc[_0xc374('0x2b')](_0x1e7da5)[_0xc374('0x2c')](_0x1e88b7);}};}function respondWithFilteredResult(_0x38d017,_0x5f3efd){return function(_0xa17894){if(_0xa17894){var _0x81ee49=_0xa17894[_0xc374('0x2d')],_0xea3e7=_0x5f3efd[_0xc374('0x2e')],_0x4020ec=_0x5f3efd[_0xc374('0x2e')]+_0x5f3efd[_0xc374('0x2f')],_0x32819b;if(_0x4020ec>=_0x81ee49){_0x4020ec=_0x81ee49;_0x32819b=0xc8;}else{_0x32819b=0xce;}_0x38d017[_0xc374('0x2b')](_0x32819b);return _0x38d017[_0xc374('0x30')](_0xc374('0x31'),_0xea3e7+'-'+_0x4020ec+'/'+_0x81ee49)['json'](_0xa17894);}return null;};}function patchUpdates(_0x3ec0fd){return function(_0x597423){try{jsonpatch['apply'](_0x597423,_0x3ec0fd,!![]);}catch(_0x8a55cf){return BPromise[_0xc374('0x32')](_0x8a55cf);}return _0x597423[_0xc374('0x33')]();};}function saveUpdates(_0x4a9ad8,_0x20d08b){return function(_0xea30dc){if(_0xea30dc){return _0xea30dc[_0xc374('0x34')](_0x4a9ad8)['then'](function(_0x1b6a3c){return _0x1b6a3c;});}return null;};}function removeEntity(_0x33cb4f,_0x1b26ce){return function(_0x596b1e){if(_0x596b1e){return _0x596b1e[_0xc374('0x35')]()[_0xc374('0x1f')](function(){_0x33cb4f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7fd4e8,_0x220087){return function(_0x3789d5){if(!_0x3789d5){_0x7fd4e8[_0xc374('0x29')](0x194);}return _0x3789d5;};}function handleError(_0x49bcfa,_0x48944f){_0x48944f=_0x48944f||0x1f4;return function(_0x4efccb){logger['error'](_0x4efccb[_0xc374('0x36')]);if(_0x4efccb[_0xc374('0x37')]){delete _0x4efccb[_0xc374('0x37')];}_0x49bcfa[_0xc374('0x2b')](_0x48944f)[_0xc374('0x38')](_0x4efccb);};}exports[_0xc374('0x39')]=function(_0x1a6c69,_0x102ca2){var _0x27ed7e={},_0x397a49={},_0x56f378={'count':0x0,'rows':[]};var _0x16e96a=_[_0xc374('0x3a')](db[_0xc374('0x3b')][_0xc374('0x3c')],function(_0x37843e){return{'name':_0x37843e['fieldName'],'type':_0x37843e[_0xc374('0x3d')][_0xc374('0x3e')]};});_0x397a49[_0xc374('0x3f')]=_['map'](_0x16e96a,'name');_0x397a49[_0xc374('0x40')]=_[_0xc374('0x41')](_0x1a6c69[_0xc374('0x40')]);_0x397a49[_0xc374('0x42')]=_[_0xc374('0x43')](_0x397a49[_0xc374('0x3f')],_0x397a49[_0xc374('0x40')]);_0x27ed7e[_0xc374('0x44')]=_['intersection'](_0x397a49[_0xc374('0x3f')],qs['fields'](_0x1a6c69['query'][_0xc374('0x45')]));_0x27ed7e['attributes']=_0x27ed7e[_0xc374('0x44')][_0xc374('0x46')]?_0x27ed7e[_0xc374('0x44')]:_0x397a49[_0xc374('0x3f')];if(!_0x1a6c69[_0xc374('0x40')][_0xc374('0x47')]('nolimit')){_0x27ed7e[_0xc374('0x2f')]=qs[_0xc374('0x2f')](_0x1a6c69[_0xc374('0x40')]['limit']);_0x27ed7e[_0xc374('0x2e')]=qs[_0xc374('0x2e')](_0x1a6c69[_0xc374('0x40')]['offset']);}_0x27ed7e[_0xc374('0x48')]=qs[_0xc374('0x49')](_0x1a6c69[_0xc374('0x40')][_0xc374('0x49')]);_0x27ed7e['where']=qs[_0xc374('0x42')](_[_0xc374('0x4a')](_0x1a6c69['query'],_0x397a49[_0xc374('0x42')]),_0x16e96a);if(_0x1a6c69[_0xc374('0x40')][_0xc374('0x4b')]){_0x27ed7e['where']=_['merge'](_0x27ed7e[_0xc374('0x4c')],{'$or':_['map'](_0x16e96a,function(_0x324a34){if(_0x324a34[_0xc374('0x3d')]!==_0xc374('0x4d')){var _0x1655c6={};_0x1655c6[_0x324a34[_0xc374('0x37')]]={'$like':'%'+_0x1a6c69[_0xc374('0x40')][_0xc374('0x4b')]+'%'};return _0x1655c6;}})});}_0x27ed7e=_['merge']({},_0x27ed7e,_0x1a6c69[_0xc374('0x4e')]);var _0x1f36f1={'where':_0x27ed7e['where']};return db[_0xc374('0x3b')]['count'](_0x1f36f1)['then'](function(_0x34cb19){_0x56f378[_0xc374('0x2d')]=_0x34cb19;if(_0x1a6c69[_0xc374('0x40')][_0xc374('0x4f')]){_0x27ed7e[_0xc374('0x50')]=[{'all':!![]}];}return db[_0xc374('0x3b')]['findAll'](_0x27ed7e);})[_0xc374('0x1f')](function(_0x164c4e){_0x56f378[_0xc374('0x51')]=_0x164c4e;return _0x56f378;})['then'](respondWithFilteredResult(_0x102ca2,_0x27ed7e))['catch'](handleError(_0x102ca2,null));};exports['show']=function(_0x4e4968,_0x4f24a5){var _0x23abf9={'raw':![],'where':{'id':_0x4e4968[_0xc374('0x52')]['id']}},_0xb5716e={};_0xb5716e[_0xc374('0x3f')]=_[_0xc374('0x41')](db[_0xc374('0x3b')]['rawAttributes']);_0xb5716e[_0xc374('0x40')]=_['keys'](_0x4e4968[_0xc374('0x40')]);_0xb5716e[_0xc374('0x42')]=_[_0xc374('0x43')](_0xb5716e[_0xc374('0x3f')],_0xb5716e[_0xc374('0x40')]);_0x23abf9['attributes']=_[_0xc374('0x43')](_0xb5716e['model'],qs[_0xc374('0x45')](_0x4e4968[_0xc374('0x40')][_0xc374('0x45')]));_0x23abf9[_0xc374('0x44')]=_0x23abf9[_0xc374('0x44')][_0xc374('0x46')]?_0x23abf9[_0xc374('0x44')]:_0xb5716e[_0xc374('0x3f')];if(_0x4e4968[_0xc374('0x40')][_0xc374('0x4f')]){_0x23abf9[_0xc374('0x50')]=[{'all':!![]}];}_0x23abf9=_['merge']({},_0x23abf9,_0x4e4968[_0xc374('0x4e')]);return db['FreshsalesConfiguration'][_0xc374('0x53')](_0x23abf9)[_0xc374('0x1f')](handleEntityNotFound(_0x4f24a5,null))[_0xc374('0x1f')](respondWithResult(_0x4f24a5,null))[_0xc374('0x28')](handleError(_0x4f24a5,null));};exports[_0xc374('0x54')]=function(_0x416838,_0x1c25c2){return db[_0xc374('0x3b')][_0xc374('0x54')](_0x416838[_0xc374('0x55')],{})[_0xc374('0x1f')](respondWithResult(_0x1c25c2,0xc9))[_0xc374('0x28')](handleError(_0x1c25c2,null));};exports['update']=function(_0x19bb73,_0x3f8ace){if(_0x19bb73['body']['id']){delete _0x19bb73[_0xc374('0x55')]['id'];}return db[_0xc374('0x3b')][_0xc374('0x53')]({'where':{'id':_0x19bb73['params']['id']}})['then'](handleEntityNotFound(_0x3f8ace,null))['then'](saveUpdates(_0x19bb73[_0xc374('0x55')],null))[_0xc374('0x1f')](respondWithResult(_0x3f8ace,null))['catch'](handleError(_0x3f8ace,null));};exports[_0xc374('0x35')]=function(_0x36d905,_0xb6ed46){return db[_0xc374('0x3b')]['find']({'where':{'id':_0x36d905[_0xc374('0x52')]['id']}})['then'](handleEntityNotFound(_0xb6ed46,null))[_0xc374('0x1f')](removeEntity(_0xb6ed46,null))['catch'](handleError(_0xb6ed46,null));};exports[_0xc374('0x56')]=function(_0x1544af,_0x5b6aec,_0x4dad8d){var _0x38a8dd={};var _0x1f5152={};var _0x13a74c;var _0x1c2837;return db[_0xc374('0x3b')][_0xc374('0x57')]({'where':{'id':_0x1544af['params']['id']}})[_0xc374('0x1f')](handleEntityNotFound(_0x5b6aec,null))[_0xc374('0x1f')](function(_0x47db75){if(_0x47db75){_0x13a74c=_0x47db75;_0x1f5152[_0xc374('0x3f')]=_[_0xc374('0x41')](db[_0xc374('0x58')][_0xc374('0x3c')]);_0x1f5152[_0xc374('0x40')]=_[_0xc374('0x41')](_0x1544af[_0xc374('0x40')]);_0x1f5152['filters']=_[_0xc374('0x43')](_0x1f5152[_0xc374('0x3f')],_0x1f5152[_0xc374('0x40')]);_0x38a8dd['attributes']=_[_0xc374('0x43')](_0x1f5152['model'],qs['fields'](_0x1544af[_0xc374('0x40')]['fields']));_0x38a8dd['attributes']=_0x38a8dd[_0xc374('0x44')][_0xc374('0x46')]?_0x38a8dd[_0xc374('0x44')]:_0x1f5152[_0xc374('0x3f')];_0x38a8dd[_0xc374('0x48')]=qs['sort'](_0x1544af['query'][_0xc374('0x49')]);_0x38a8dd[_0xc374('0x4c')]=qs[_0xc374('0x42')](_['pick'](_0x1544af[_0xc374('0x40')],_0x1f5152[_0xc374('0x42')]));if(_0x1544af[_0xc374('0x40')][_0xc374('0x4b')]){_0x38a8dd[_0xc374('0x4c')]=_['merge'](_0x38a8dd['where'],{'$or':_[_0xc374('0x3a')](_0x38a8dd[_0xc374('0x44')],function(_0x2be560){var _0x498f99={};_0x498f99[_0x2be560]={'$like':'%'+_0x1544af[_0xc374('0x40')][_0xc374('0x4b')]+'%'};return _0x498f99;})});}_0x38a8dd=_[_0xc374('0x59')]({},_0x38a8dd,_0x1544af[_0xc374('0x4e')]);return _0x13a74c[_0xc374('0x56')](_0x38a8dd);}})[_0xc374('0x1f')](function(_0x197d03){if(_0x197d03){_0x1c2837=_0x197d03[_0xc374('0x46')];if(!_0x1544af[_0xc374('0x40')][_0xc374('0x47')](_0xc374('0x5a'))){_0x38a8dd['limit']=qs[_0xc374('0x2f')](_0x1544af[_0xc374('0x40')][_0xc374('0x2f')]);_0x38a8dd[_0xc374('0x2e')]=qs[_0xc374('0x2e')](_0x1544af[_0xc374('0x40')][_0xc374('0x2e')]);}return _0x13a74c['getSubjects'](_0x38a8dd);}})['then'](function(_0x1781e6){if(_0x1781e6){return _0x1781e6?{'count':_0x1c2837,'rows':_0x1781e6}:null;}})[_0xc374('0x1f')](respondWithResult(_0x5b6aec,null))[_0xc374('0x28')](handleError(_0x5b6aec,null));};exports[_0xc374('0x5b')]=function(_0x5bc743,_0x1f9b99,_0x2b300f){var _0x4e1df5={};var _0x3125d7={};var _0x2a9ba2;var _0x2a79d5;return db[_0xc374('0x3b')][_0xc374('0x57')]({'where':{'id':_0x5bc743[_0xc374('0x52')]['id']}})[_0xc374('0x1f')](handleEntityNotFound(_0x1f9b99,null))['then'](function(_0x40c8a0){if(_0x40c8a0){_0x2a9ba2=_0x40c8a0;_0x3125d7[_0xc374('0x3f')]=_[_0xc374('0x41')](db[_0xc374('0x58')][_0xc374('0x3c')]);_0x3125d7[_0xc374('0x40')]=_[_0xc374('0x41')](_0x5bc743[_0xc374('0x40')]);_0x3125d7[_0xc374('0x42')]=_[_0xc374('0x43')](_0x3125d7[_0xc374('0x3f')],_0x3125d7[_0xc374('0x40')]);_0x4e1df5[_0xc374('0x44')]=_['intersection'](_0x3125d7['model'],qs['fields'](_0x5bc743[_0xc374('0x40')]['fields']));_0x4e1df5[_0xc374('0x44')]=_0x4e1df5['attributes'][_0xc374('0x46')]?_0x4e1df5[_0xc374('0x44')]:_0x3125d7[_0xc374('0x3f')];_0x4e1df5[_0xc374('0x48')]=qs[_0xc374('0x49')](_0x5bc743[_0xc374('0x40')][_0xc374('0x49')]);_0x4e1df5[_0xc374('0x4c')]=qs[_0xc374('0x42')](_[_0xc374('0x4a')](_0x5bc743[_0xc374('0x40')],_0x3125d7['filters']));if(_0x5bc743[_0xc374('0x40')][_0xc374('0x4b')]){_0x4e1df5[_0xc374('0x4c')]=_['merge'](_0x4e1df5[_0xc374('0x4c')],{'$or':_['map'](_0x4e1df5['attributes'],function(_0x4b7176){var _0x49eb4e={};_0x49eb4e[_0x4b7176]={'$like':'%'+_0x5bc743[_0xc374('0x40')][_0xc374('0x4b')]+'%'};return _0x49eb4e;})});}_0x4e1df5=_[_0xc374('0x59')]({},_0x4e1df5,_0x5bc743[_0xc374('0x4e')]);return _0x2a9ba2[_0xc374('0x5b')](_0x4e1df5);}})[_0xc374('0x1f')](function(_0x3dc65b){if(_0x3dc65b){_0x2a79d5=_0x3dc65b[_0xc374('0x46')];if(!_0x5bc743[_0xc374('0x40')]['hasOwnProperty'](_0xc374('0x5a'))){_0x4e1df5[_0xc374('0x2f')]=qs[_0xc374('0x2f')](_0x5bc743[_0xc374('0x40')]['limit']);_0x4e1df5[_0xc374('0x2e')]=qs[_0xc374('0x2e')](_0x5bc743['query'][_0xc374('0x2e')]);}return _0x2a9ba2[_0xc374('0x5b')](_0x4e1df5);}})[_0xc374('0x1f')](function(_0x3599d5){if(_0x3599d5){return _0x3599d5?{'count':_0x2a79d5,'rows':_0x3599d5}:null;}})[_0xc374('0x1f')](respondWithResult(_0x1f9b99,null))['catch'](handleError(_0x1f9b99,null));};exports[_0xc374('0x5c')]=function(_0x42c358,_0x4cfa32,_0x2877c7){var _0x310594={};var _0x2ff969={};var _0x547204;var _0x4809c8;return db[_0xc374('0x3b')][_0xc374('0x57')]({'where':{'id':_0x42c358[_0xc374('0x52')]['id']}})[_0xc374('0x1f')](handleEntityNotFound(_0x4cfa32,null))['then'](function(_0x4a789a){if(_0x4a789a){_0x547204=_0x4a789a;_0x2ff969['model']=_['keys'](db[_0xc374('0x58')][_0xc374('0x3c')]);_0x2ff969[_0xc374('0x40')]=_[_0xc374('0x41')](_0x42c358['query']);_0x2ff969[_0xc374('0x42')]=_[_0xc374('0x43')](_0x2ff969['model'],_0x2ff969['query']);_0x310594[_0xc374('0x44')]=_[_0xc374('0x43')](_0x2ff969[_0xc374('0x3f')],qs[_0xc374('0x45')](_0x42c358[_0xc374('0x40')][_0xc374('0x45')]));_0x310594['attributes']=_0x310594[_0xc374('0x44')]['length']?_0x310594[_0xc374('0x44')]:_0x2ff969['model'];_0x310594[_0xc374('0x48')]=qs[_0xc374('0x49')](_0x42c358[_0xc374('0x40')][_0xc374('0x49')]);_0x310594[_0xc374('0x4c')]=qs[_0xc374('0x42')](_[_0xc374('0x4a')](_0x42c358[_0xc374('0x40')],_0x2ff969[_0xc374('0x42')]));if(_0x42c358['query'][_0xc374('0x4b')]){_0x310594['where']=_[_0xc374('0x59')](_0x310594['where'],{'$or':_[_0xc374('0x3a')](_0x310594[_0xc374('0x44')],function(_0x129c53){var _0x49a0d3={};_0x49a0d3[_0x129c53]={'$like':'%'+_0x42c358[_0xc374('0x40')][_0xc374('0x4b')]+'%'};return _0x49a0d3;})});}_0x310594=_[_0xc374('0x59')]({},_0x310594,_0x42c358[_0xc374('0x4e')]);return _0x547204['getFields'](_0x310594);}})[_0xc374('0x1f')](function(_0x110c4e){if(_0x110c4e){_0x4809c8=_0x110c4e[_0xc374('0x46')];if(!_0x42c358[_0xc374('0x40')]['hasOwnProperty'](_0xc374('0x5a'))){_0x310594[_0xc374('0x2f')]=qs[_0xc374('0x2f')](_0x42c358[_0xc374('0x40')]['limit']);_0x310594[_0xc374('0x2e')]=qs['offset'](_0x42c358[_0xc374('0x40')][_0xc374('0x2e')]);}return _0x547204[_0xc374('0x5c')](_0x310594);}})[_0xc374('0x1f')](function(_0x1270a7){if(_0x1270a7){return _0x1270a7?{'count':_0x4809c8,'rows':_0x1270a7}:null;}})[_0xc374('0x1f')](respondWithResult(_0x4cfa32,null))[_0xc374('0x28')](handleError(_0x4cfa32,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 41e02e6..d08ddc6 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 _0x1bca=['FreshsalesConfiguration','int_freshsales_configurations','util','moment','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports'];(function(_0x4c5cf3,_0x2d608e){var _0x1eee77=function(_0x1577ff){while(--_0x1577ff){_0x4c5cf3['push'](_0x4c5cf3['shift']());}};_0x1eee77(++_0x2d608e);}(_0x1bca,0xb6));var _0xa1bc=function(_0x582a25,_0x20f53e){_0x582a25=_0x582a25-0x0;var _0x13cfa2=_0x1bca[_0x582a25];return _0x13cfa2;};'use strict';var _=require('lodash');var util=require(_0xa1bc('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa1bc('0x1'));var BPromise=require('bluebird');var rp=require(_0xa1bc('0x2'));var fs=require('fs');var path=require(_0xa1bc('0x3'));var rimraf=require(_0xa1bc('0x4'));var config=require('../../config/environment');var attributes=require(_0xa1bc('0x5'));module[_0xa1bc('0x6')]=function(_0x168b44,_0x268ced){return _0x168b44['define'](_0xa1bc('0x7'),attributes,{'tableName':_0xa1bc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x038d=['./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x14f5ed,_0x3fd34d){var _0x49f682=function(_0x42f660){while(--_0x42f660){_0x14f5ed['push'](_0x14f5ed['shift']());}};_0x49f682(++_0x3fd34d);}(_0x038d,0xae));var _0xd038=function(_0x5ab290,_0x367eeb){_0x5ab290=_0x5ab290-0x0;var _0x2f01d5=_0x038d[_0x5ab290];return _0x2f01d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd038('0x0'))(_0xd038('0x1'));var moment=require(_0xd038('0x2'));var BPromise=require(_0xd038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd038('0x4'));var config=require(_0xd038('0x5'));var attributes=require(_0xd038('0x6'));module['exports']=function(_0x5b709c,_0x5d549e){return _0x5b709c[_0xd038('0x7')](_0xd038('0x8'),attributes,{'tableName':'int_freshsales_configurations','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 134df3a..61b5f26 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 _0xb12d=['rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshsalesConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x453894,_0x20bccb){var _0x29016e=function(_0x3502e5){while(--_0x3502e5){_0x453894['push'](_0x453894['shift']());}};_0x29016e(++_0x20bccb);}(_0xb12d,0x124));var _0xdb12=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0xb12d[_0x43de22];return _0x4b15ee;};'use strict';var _=require(_0xdb12('0x0'));var util=require(_0xdb12('0x1'));var moment=require(_0xdb12('0x2'));var BPromise=require('bluebird');var rs=require(_0xdb12('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb12('0x4'))['db'];var utils=require(_0xdb12('0x5'));var logger=require(_0xdb12('0x6'))(_0xdb12('0x7'));var config=require(_0xdb12('0x8'));var jayson=require(_0xdb12('0x9'));var client=jayson['client'][_0xdb12('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e73f,_0x27eb31,_0x3872c3){return new BPromise(function(_0x11385d,_0x11d97c){return client[_0xdb12('0xb')](_0x19e73f,_0x3872c3)[_0xdb12('0xc')](function(_0x54eb5b){logger[_0xdb12('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x27eb31,_0xdb12('0xe'));logger[_0xdb12('0xf')](_0xdb12('0x10'),_0x27eb31,'request\x20sent',JSON[_0xdb12('0x11')](_0x54eb5b));if(_0x54eb5b[_0xdb12('0x12')]){if(_0x54eb5b[_0xdb12('0x12')]['code']===0x1f4){logger[_0xdb12('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x27eb31,_0x54eb5b[_0xdb12('0x12')][_0xdb12('0x13')]);return _0x11d97c(_0x54eb5b[_0xdb12('0x12')]['message']);}logger[_0xdb12('0x12')](_0xdb12('0x14'),_0x27eb31,_0x54eb5b['error'][_0xdb12('0x13')]);return _0x11385d(_0x54eb5b['error'][_0xdb12('0x13')]);}else{logger[_0xdb12('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x27eb31,_0xdb12('0xe'));_0x11385d(_0x54eb5b[_0xdb12('0x15')][_0xdb12('0x13')]);}})[_0xdb12('0x16')](function(_0x504cf5){logger['error'](_0xdb12('0x14'),_0x27eb31,_0x504cf5);_0x11d97c(_0x504cf5);});});} \ No newline at end of file +var _0x9000=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0x9000,0x19e));var _0x0900=function(_0x1c66d8,_0x16d85d){_0x1c66d8=_0x1c66d8-0x0;var _0xf1cc0a=_0x9000[_0x1c66d8];return _0xf1cc0a;};'use strict';var _=require(_0x0900('0x0'));var util=require(_0x0900('0x1'));var moment=require('moment');var BPromise=require(_0x0900('0x2'));var rs=require(_0x0900('0x3'));var fs=require('fs');var Redis=require(_0x0900('0x4'));var db=require(_0x0900('0x5'))['db'];var utils=require(_0x0900('0x6'));var logger=require(_0x0900('0x7'))(_0x0900('0x8'));var config=require(_0x0900('0x9'));var jayson=require(_0x0900('0xa'));var client=jayson['client'][_0x0900('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f6314,_0x5c4b2e,_0x153c20){return new BPromise(function(_0xedb70a,_0x5eccf6){return client['request'](_0x4f6314,_0x153c20)[_0x0900('0xc')](function(_0x75e296){logger[_0x0900('0xd')](_0x0900('0xe'),_0x5c4b2e,_0x0900('0xf'));logger[_0x0900('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5c4b2e,_0x0900('0xf'),JSON[_0x0900('0x11')](_0x75e296));if(_0x75e296[_0x0900('0x12')]){if(_0x75e296[_0x0900('0x12')][_0x0900('0x13')]===0x1f4){logger[_0x0900('0x12')](_0x0900('0xe'),_0x5c4b2e,_0x75e296[_0x0900('0x12')][_0x0900('0x14')]);return _0x5eccf6(_0x75e296[_0x0900('0x12')]['message']);}logger[_0x0900('0x12')](_0x0900('0xe'),_0x5c4b2e,_0x75e296['error'][_0x0900('0x14')]);return _0xedb70a(_0x75e296[_0x0900('0x12')]['message']);}else{logger[_0x0900('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5c4b2e,_0x0900('0xf'));_0xedb70a(_0x75e296[_0x0900('0x15')][_0x0900('0x14')]);}})[_0x0900('0x16')](function(_0x4bbe8f){logger['error'](_0x0900('0xe'),_0x5c4b2e,_0x4bbe8f);_0x5eccf6(_0x4bbe8f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 5b1173e..bd0b6bb 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 _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x127587,_0x5cef0){_0x127587=_0x127587-0x0;var _0x3f9909=_0x9ffd[_0x127587];return _0x3f9909;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0xed3c=['index','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated'];(function(_0x545aec,_0x51becd){var _0x286bcb=function(_0xc6cec1){while(--_0xc6cec1){_0x545aec['push'](_0x545aec['shift']());}};_0x286bcb(++_0x51becd);}(_0xed3c,0x1a6));var _0xced3=function(_0x33f34e,_0x4fde5b){_0x33f34e=_0x33f34e-0x0;var _0x58dc01=_0xed3c[_0x33f34e];return _0x58dc01;};'use strict';var multer=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var path=require(_0xced3('0x2'));var timeout=require(_0xced3('0x3'));var express=require('express');var router=express[_0xced3('0x4')]();var fs_extra=require(_0xced3('0x5'));var auth=require(_0xced3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xced3('0x7'));router[_0xced3('0x8')]('/',auth[_0xced3('0x9')](),controller[_0xced3('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xced3('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xced3('0xc')](_0xced3('0xd'),auth[_0xced3('0x9')](),controller[_0xced3('0xe')]);router[_0xced3('0xf')]('/:id',auth[_0xced3('0x9')](),controller[_0xced3('0x10')]);module[_0xced3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index d309dbf..3e90282 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 _0x5292=['exports','string','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x2a19ac,_0x32d845){var _0x4734ea=function(_0x49482a){while(--_0x49482a){_0x2a19ac['push'](_0x2a19ac['shift']());}};_0x4734ea(++_0x32d845);}(_0x5292,0xf7));var _0x2529=function(_0x41f69d,_0xde8d57){_0x41f69d=_0x41f69d-0x0;var _0x1b163b=_0x5292[_0x41f69d];return _0x1b163b;};'use strict';var Sequelize=require(_0x2529('0x0'));module[_0x2529('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2529('0x2'),'variable',_0x2529('0x3'),_0x2529('0x4'),_0x2529('0x5')),'defaultValue':_0x2529('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2529('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x2529('0x3'))},'keyContent':{'type':Sequelize[_0x2529('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2529('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2529('0x6')]}}; \ No newline at end of file +var _0x2123=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x856fb0,_0x571677){var _0x2e35ca=function(_0xdf485a){while(--_0xdf485a){_0x856fb0['push'](_0x856fb0['shift']());}};_0x2e35ca(++_0x571677);}(_0x2123,0x190));var _0x3212=function(_0x3eeb44,_0x5731e4){_0x3eeb44=_0x3eeb44-0x0;var _0x13eb8f=_0x2123[_0x3eeb44];return _0x13eb8f;};'use strict';var Sequelize=require(_0x3212('0x0'));module[_0x3212('0x1')]={'type':{'type':Sequelize[_0x3212('0x2')](_0x3212('0x3'),_0x3212('0x4'),_0x3212('0x5'),_0x3212('0x6'),_0x3212('0x7')),'defaultValue':_0x3212('0x3')},'content':{'type':Sequelize[_0x3212('0x8')]},'key':{'type':Sequelize[_0x3212('0x8')]},'keyType':{'type':Sequelize[_0x3212('0x2')]('string',_0x3212('0x4'),_0x3212('0x5'))},'keyContent':{'type':Sequelize[_0x3212('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3212('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3212('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index c23bc17..06e13a3 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 _0xa101=['VIRTUAL','filter','options','FreshsalesField','then','findAll','catch','show','params','keys','rawAttributes','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','save','update','destroy','end','error','stack','name','send','map','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa101,0x178));var _0x1a10=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0xa101[_0x3df871];return _0x570f7b;};'use strict';var emlformat=require(_0x1a10('0x0'));var rimraf=require(_0x1a10('0x1'));var zipdir=require(_0x1a10('0x2'));var jsonpatch=require(_0x1a10('0x3'));var rp=require(_0x1a10('0x4'));var moment=require('moment');var BPromise=require(_0x1a10('0x5'));var Mustache=require(_0x1a10('0x6'));var util=require(_0x1a10('0x7'));var path=require(_0x1a10('0x8'));var sox=require(_0x1a10('0x9'));var csv=require(_0x1a10('0xa'));var ejs=require(_0x1a10('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a10('0xc'));var squel=require(_0x1a10('0xd'));var crypto=require('crypto');var jsforce=require(_0x1a10('0xe'));var deskjs=require(_0x1a10('0xf'));var toCsv=require(_0x1a10('0xa'));var querystring=require('querystring');var Papa=require(_0x1a10('0x10'));var Redis=require(_0x1a10('0x11'));var authService=require(_0x1a10('0x12'));var qs=require(_0x1a10('0x13'));var as=require(_0x1a10('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1a10('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1a10('0x16'));var db=require(_0x1a10('0x17'))['db'];function respondWithStatusCode(_0x103d4d,_0x3f65b5){_0x3f65b5=_0x3f65b5||0xcc;return function(_0x1fb9a8){if(_0x1fb9a8){return _0x103d4d[_0x1a10('0x18')](_0x3f65b5);}return _0x103d4d[_0x1a10('0x19')](_0x3f65b5)['end']();};}function respondWithResult(_0x55d8d6,_0x2b6414){_0x2b6414=_0x2b6414||0xc8;return function(_0x29068f){if(_0x29068f){return _0x55d8d6['status'](_0x2b6414)[_0x1a10('0x1a')](_0x29068f);}};}function respondWithFilteredResult(_0x407a56,_0x38ccdf){return function(_0xe9905f){if(_0xe9905f){var _0x360445=_0xe9905f[_0x1a10('0x1b')],_0x169e71=_0x38ccdf[_0x1a10('0x1c')],_0x435c5c=_0x38ccdf[_0x1a10('0x1c')]+_0x38ccdf[_0x1a10('0x1d')],_0x32ff1d;if(_0x435c5c>=_0x360445){_0x435c5c=_0x360445;_0x32ff1d=0xc8;}else{_0x32ff1d=0xce;}_0x407a56[_0x1a10('0x19')](_0x32ff1d);return _0x407a56[_0x1a10('0x1e')]('Content-Range',_0x169e71+'-'+_0x435c5c+'/'+_0x360445)[_0x1a10('0x1a')](_0xe9905f);}return null;};}function patchUpdates(_0x5d07c5){return function(_0x10c8bf){try{jsonpatch[_0x1a10('0x1f')](_0x10c8bf,_0x5d07c5,!![]);}catch(_0xf4f48d){return BPromise['reject'](_0xf4f48d);}return _0x10c8bf[_0x1a10('0x20')]();};}function saveUpdates(_0x185287,_0x273667){return function(_0x275c2d){if(_0x275c2d){return _0x275c2d[_0x1a10('0x21')](_0x185287)['then'](function(_0x195715){return _0x195715;});}return null;};}function removeEntity(_0x225dba,_0x19b6cd){return function(_0x1ad18e){if(_0x1ad18e){return _0x1ad18e[_0x1a10('0x22')]()['then'](function(){_0x225dba[_0x1a10('0x19')](0xcc)[_0x1a10('0x23')]();});}};}function handleEntityNotFound(_0x1d5471,_0x1f9645){return function(_0x23904b){if(!_0x23904b){_0x1d5471[_0x1a10('0x18')](0x194);}return _0x23904b;};}function handleError(_0x5d1c6c,_0x5c2d89){_0x5c2d89=_0x5c2d89||0x1f4;return function(_0x346d7c){logger[_0x1a10('0x24')](_0x346d7c[_0x1a10('0x25')]);if(_0x346d7c[_0x1a10('0x26')]){delete _0x346d7c[_0x1a10('0x26')];}_0x5d1c6c[_0x1a10('0x19')](_0x5c2d89)[_0x1a10('0x27')](_0x346d7c);};}exports['index']=function(_0x3d3943,_0x2f2035){var _0x30dae5={},_0xa195c={},_0x570261={'count':0x0,'rows':[]};var _0x389433=_[_0x1a10('0x28')](db['FreshsalesField']['rawAttributes'],function(_0x2b6c53){return{'name':_0x2b6c53[_0x1a10('0x29')],'type':_0x2b6c53[_0x1a10('0x2a')]['key']};});_0xa195c[_0x1a10('0x2b')]=_[_0x1a10('0x28')](_0x389433,'name');_0xa195c['query']=_['keys'](_0x3d3943[_0x1a10('0x2c')]);_0xa195c[_0x1a10('0x2d')]=_[_0x1a10('0x2e')](_0xa195c[_0x1a10('0x2b')],_0xa195c['query']);_0x30dae5[_0x1a10('0x2f')]=_[_0x1a10('0x2e')](_0xa195c[_0x1a10('0x2b')],qs['fields'](_0x3d3943[_0x1a10('0x2c')][_0x1a10('0x30')]));_0x30dae5[_0x1a10('0x2f')]=_0x30dae5[_0x1a10('0x2f')][_0x1a10('0x31')]?_0x30dae5[_0x1a10('0x2f')]:_0xa195c[_0x1a10('0x2b')];if(!_0x3d3943[_0x1a10('0x2c')][_0x1a10('0x32')](_0x1a10('0x33'))){_0x30dae5['limit']=qs[_0x1a10('0x1d')](_0x3d3943['query'][_0x1a10('0x1d')]);_0x30dae5['offset']=qs['offset'](_0x3d3943[_0x1a10('0x2c')][_0x1a10('0x1c')]);}_0x30dae5[_0x1a10('0x34')]=qs[_0x1a10('0x35')](_0x3d3943[_0x1a10('0x2c')]['sort']);_0x30dae5[_0x1a10('0x36')]=qs[_0x1a10('0x2d')](_['pick'](_0x3d3943[_0x1a10('0x2c')],_0xa195c[_0x1a10('0x2d')]),_0x389433);if(_0x3d3943[_0x1a10('0x2c')]['filter']){_0x30dae5[_0x1a10('0x36')]=_[_0x1a10('0x37')](_0x30dae5[_0x1a10('0x36')],{'$or':_['map'](_0x389433,function(_0x59d42c){if(_0x59d42c[_0x1a10('0x2a')]!==_0x1a10('0x38')){var _0x25a888={};_0x25a888[_0x59d42c['name']]={'$like':'%'+_0x3d3943[_0x1a10('0x2c')][_0x1a10('0x39')]+'%'};return _0x25a888;}})});}_0x30dae5=_[_0x1a10('0x37')]({},_0x30dae5,_0x3d3943[_0x1a10('0x3a')]);var _0xe9b67f={'where':_0x30dae5[_0x1a10('0x36')]};return db[_0x1a10('0x3b')]['count'](_0xe9b67f)[_0x1a10('0x3c')](function(_0xca648){_0x570261[_0x1a10('0x1b')]=_0xca648;if(_0x3d3943[_0x1a10('0x2c')]['includeAll']){_0x30dae5['include']=[{'all':!![]}];}return db[_0x1a10('0x3b')][_0x1a10('0x3d')](_0x30dae5);})[_0x1a10('0x3c')](function(_0x2ba39c){_0x570261['rows']=_0x2ba39c;return _0x570261;})[_0x1a10('0x3c')](respondWithFilteredResult(_0x2f2035,_0x30dae5))[_0x1a10('0x3e')](handleError(_0x2f2035,null));};exports[_0x1a10('0x3f')]=function(_0x5eaee2,_0x52218b){var _0x302ec1={'raw':!![],'where':{'id':_0x5eaee2[_0x1a10('0x40')]['id']}},_0x225cf6={};_0x225cf6['model']=_[_0x1a10('0x41')](db[_0x1a10('0x3b')][_0x1a10('0x42')]);_0x225cf6[_0x1a10('0x2c')]=_[_0x1a10('0x41')](_0x5eaee2[_0x1a10('0x2c')]);_0x225cf6['filters']=_[_0x1a10('0x2e')](_0x225cf6[_0x1a10('0x2b')],_0x225cf6[_0x1a10('0x2c')]);_0x302ec1['attributes']=_[_0x1a10('0x2e')](_0x225cf6['model'],qs[_0x1a10('0x30')](_0x5eaee2['query']['fields']));_0x302ec1[_0x1a10('0x2f')]=_0x302ec1[_0x1a10('0x2f')][_0x1a10('0x31')]?_0x302ec1[_0x1a10('0x2f')]:_0x225cf6[_0x1a10('0x2b')];if(_0x5eaee2[_0x1a10('0x2c')][_0x1a10('0x43')]){_0x302ec1[_0x1a10('0x44')]=[{'all':!![]}];}_0x302ec1=_['merge']({},_0x302ec1,_0x5eaee2[_0x1a10('0x3a')]);return db[_0x1a10('0x3b')][_0x1a10('0x45')](_0x302ec1)[_0x1a10('0x3c')](handleEntityNotFound(_0x52218b,null))[_0x1a10('0x3c')](respondWithResult(_0x52218b,null))[_0x1a10('0x3e')](handleError(_0x52218b,null));};exports['create']=function(_0x2778f7,_0x460be9){return db['FreshsalesField'][_0x1a10('0x46')](_0x2778f7[_0x1a10('0x47')],{})[_0x1a10('0x3c')](respondWithResult(_0x460be9,0xc9))[_0x1a10('0x3e')](handleError(_0x460be9,null));};exports[_0x1a10('0x21')]=function(_0x2ce268,_0x4991a9){if(_0x2ce268[_0x1a10('0x47')]['id']){delete _0x2ce268[_0x1a10('0x47')]['id'];}return db[_0x1a10('0x3b')][_0x1a10('0x45')]({'where':{'id':_0x2ce268['params']['id']}})[_0x1a10('0x3c')](handleEntityNotFound(_0x4991a9,null))['then'](saveUpdates(_0x2ce268['body'],null))[_0x1a10('0x3c')](respondWithResult(_0x4991a9,null))[_0x1a10('0x3e')](handleError(_0x4991a9,null));};exports[_0x1a10('0x22')]=function(_0x1a4b99,_0x240035){return db['FreshsalesField']['find']({'where':{'id':_0x1a4b99[_0x1a10('0x40')]['id']}})['then'](handleEntityNotFound(_0x240035,null))[_0x1a10('0x3c')](removeEntity(_0x240035,null))['catch'](handleError(_0x240035,null));}; \ No newline at end of file +var _0x102b=['to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','status','Content-Range','save','update','then','destroy','stack','send','map','FreshsalesField','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','type','options','count','includeAll','rows','catch','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4fda54,_0x5338c4){var _0x196748=function(_0x233736){while(--_0x233736){_0x4fda54['push'](_0x4fda54['shift']());}};_0x196748(++_0x5338c4);}(_0x102b,0xfe));var _0xb102=function(_0x52e9ee,_0x3c39e1){_0x52e9ee=_0x52e9ee-0x0;var _0x593594=_0x102b[_0x52e9ee];return _0x593594;};'use strict';var emlformat=require(_0xb102('0x0'));var rimraf=require(_0xb102('0x1'));var zipdir=require(_0xb102('0x2'));var jsonpatch=require(_0xb102('0x3'));var rp=require(_0xb102('0x4'));var moment=require('moment');var BPromise=require(_0xb102('0x5'));var Mustache=require(_0xb102('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb102('0x7'));var csv=require('to-csv');var ejs=require(_0xb102('0x8'));var fs=require('fs');var fs_extra=require(_0xb102('0x9'));var _=require(_0xb102('0xa'));var squel=require(_0xb102('0xb'));var crypto=require(_0xb102('0xc'));var jsforce=require(_0xb102('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb102('0xe'));var querystring=require(_0xb102('0xf'));var Papa=require('papaparse');var Redis=require(_0xb102('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb102('0x11'));var as=require(_0xb102('0x12'));var hardwareService=require(_0xb102('0x13'));var logger=require(_0xb102('0x14'))(_0xb102('0x15'));var utils=require(_0xb102('0x16'));var config=require(_0xb102('0x17'));var licenseUtil=require(_0xb102('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17f211,_0x486311){_0x486311=_0x486311||0xcc;return function(_0x1cde04){if(_0x1cde04){return _0x17f211[_0xb102('0x19')](_0x486311);}return _0x17f211['status'](_0x486311)[_0xb102('0x1a')]();};}function respondWithResult(_0x108ba2,_0x50b286){_0x50b286=_0x50b286||0xc8;return function(_0x232c03){if(_0x232c03){return _0x108ba2['status'](_0x50b286)[_0xb102('0x1b')](_0x232c03);}};}function respondWithFilteredResult(_0x155c01,_0x124809){return function(_0xda07e2){if(_0xda07e2){var _0x12a500=_0xda07e2['count'],_0x19f3b4=_0x124809['offset'],_0x3ef573=_0x124809[_0xb102('0x1c')]+_0x124809[_0xb102('0x1d')],_0x9950f9;if(_0x3ef573>=_0x12a500){_0x3ef573=_0x12a500;_0x9950f9=0xc8;}else{_0x9950f9=0xce;}_0x155c01[_0xb102('0x1e')](_0x9950f9);return _0x155c01['set'](_0xb102('0x1f'),_0x19f3b4+'-'+_0x3ef573+'/'+_0x12a500)[_0xb102('0x1b')](_0xda07e2);}return null;};}function patchUpdates(_0x4a71ba){return function(_0x2c3fc3){try{jsonpatch['apply'](_0x2c3fc3,_0x4a71ba,!![]);}catch(_0xcf565d){return BPromise['reject'](_0xcf565d);}return _0x2c3fc3[_0xb102('0x20')]();};}function saveUpdates(_0x57dfc2,_0xbe186d){return function(_0x4a536f){if(_0x4a536f){return _0x4a536f[_0xb102('0x21')](_0x57dfc2)[_0xb102('0x22')](function(_0x1b8875){return _0x1b8875;});}return null;};}function removeEntity(_0x3300f8,_0x5e869f){return function(_0x59c946){if(_0x59c946){return _0x59c946[_0xb102('0x23')]()['then'](function(){_0x3300f8[_0xb102('0x1e')](0xcc)[_0xb102('0x1a')]();});}};}function handleEntityNotFound(_0x905f5f,_0xad7186){return function(_0x97eaf){if(!_0x97eaf){_0x905f5f['sendStatus'](0x194);}return _0x97eaf;};}function handleError(_0x59a458,_0xa59382){_0xa59382=_0xa59382||0x1f4;return function(_0x1047ed){logger['error'](_0x1047ed[_0xb102('0x24')]);if(_0x1047ed['name']){delete _0x1047ed['name'];}_0x59a458[_0xb102('0x1e')](_0xa59382)[_0xb102('0x25')](_0x1047ed);};}exports['index']=function(_0x16de98,_0x5ee9db){var _0x28b499={},_0x5c0140={},_0x12499b={'count':0x0,'rows':[]};var _0x4c8164=_[_0xb102('0x26')](db[_0xb102('0x27')]['rawAttributes'],function(_0x21ae7f){return{'name':_0x21ae7f[_0xb102('0x28')],'type':_0x21ae7f['type'][_0xb102('0x29')]};});_0x5c0140[_0xb102('0x2a')]=_['map'](_0x4c8164,_0xb102('0x2b'));_0x5c0140[_0xb102('0x2c')]=_[_0xb102('0x2d')](_0x16de98[_0xb102('0x2c')]);_0x5c0140[_0xb102('0x2e')]=_[_0xb102('0x2f')](_0x5c0140['model'],_0x5c0140[_0xb102('0x2c')]);_0x28b499[_0xb102('0x30')]=_[_0xb102('0x2f')](_0x5c0140['model'],qs[_0xb102('0x31')](_0x16de98[_0xb102('0x2c')][_0xb102('0x31')]));_0x28b499[_0xb102('0x30')]=_0x28b499[_0xb102('0x30')]['length']?_0x28b499[_0xb102('0x30')]:_0x5c0140['model'];if(!_0x16de98['query'][_0xb102('0x32')]('nolimit')){_0x28b499[_0xb102('0x1d')]=qs[_0xb102('0x1d')](_0x16de98[_0xb102('0x2c')][_0xb102('0x1d')]);_0x28b499['offset']=qs[_0xb102('0x1c')](_0x16de98[_0xb102('0x2c')][_0xb102('0x1c')]);}_0x28b499['order']=qs[_0xb102('0x33')](_0x16de98[_0xb102('0x2c')][_0xb102('0x33')]);_0x28b499[_0xb102('0x34')]=qs['filters'](_[_0xb102('0x35')](_0x16de98[_0xb102('0x2c')],_0x5c0140['filters']),_0x4c8164);if(_0x16de98['query'][_0xb102('0x36')]){_0x28b499[_0xb102('0x34')]=_[_0xb102('0x37')](_0x28b499['where'],{'$or':_[_0xb102('0x26')](_0x4c8164,function(_0x1b6b46){if(_0x1b6b46[_0xb102('0x38')]!=='VIRTUAL'){var _0x26a7fc={};_0x26a7fc[_0x1b6b46[_0xb102('0x2b')]]={'$like':'%'+_0x16de98[_0xb102('0x2c')][_0xb102('0x36')]+'%'};return _0x26a7fc;}})});}_0x28b499=_[_0xb102('0x37')]({},_0x28b499,_0x16de98[_0xb102('0x39')]);var _0x20c7ff={'where':_0x28b499[_0xb102('0x34')]};return db[_0xb102('0x27')]['count'](_0x20c7ff)[_0xb102('0x22')](function(_0x3365a0){_0x12499b[_0xb102('0x3a')]=_0x3365a0;if(_0x16de98['query'][_0xb102('0x3b')]){_0x28b499['include']=[{'all':!![]}];}return db[_0xb102('0x27')]['findAll'](_0x28b499);})[_0xb102('0x22')](function(_0x306493){_0x12499b[_0xb102('0x3c')]=_0x306493;return _0x12499b;})['then'](respondWithFilteredResult(_0x5ee9db,_0x28b499))[_0xb102('0x3d')](handleError(_0x5ee9db,null));};exports['show']=function(_0x58f3a3,_0x5ca099){var _0x22b7be={'raw':!![],'where':{'id':_0x58f3a3[_0xb102('0x3e')]['id']}},_0x2a265e={};_0x2a265e[_0xb102('0x2a')]=_[_0xb102('0x2d')](db[_0xb102('0x27')][_0xb102('0x3f')]);_0x2a265e[_0xb102('0x2c')]=_[_0xb102('0x2d')](_0x58f3a3[_0xb102('0x2c')]);_0x2a265e[_0xb102('0x2e')]=_[_0xb102('0x2f')](_0x2a265e[_0xb102('0x2a')],_0x2a265e[_0xb102('0x2c')]);_0x22b7be[_0xb102('0x30')]=_[_0xb102('0x2f')](_0x2a265e[_0xb102('0x2a')],qs[_0xb102('0x31')](_0x58f3a3['query'][_0xb102('0x31')]));_0x22b7be[_0xb102('0x30')]=_0x22b7be[_0xb102('0x30')]['length']?_0x22b7be[_0xb102('0x30')]:_0x2a265e[_0xb102('0x2a')];if(_0x58f3a3[_0xb102('0x2c')][_0xb102('0x3b')]){_0x22b7be['include']=[{'all':!![]}];}_0x22b7be=_[_0xb102('0x37')]({},_0x22b7be,_0x58f3a3[_0xb102('0x39')]);return db['FreshsalesField'][_0xb102('0x40')](_0x22b7be)['then'](handleEntityNotFound(_0x5ca099,null))[_0xb102('0x22')](respondWithResult(_0x5ca099,null))['catch'](handleError(_0x5ca099,null));};exports[_0xb102('0x41')]=function(_0x335af2,_0x29f882){return db['FreshsalesField'][_0xb102('0x41')](_0x335af2[_0xb102('0x42')],{})['then'](respondWithResult(_0x29f882,0xc9))[_0xb102('0x3d')](handleError(_0x29f882,null));};exports[_0xb102('0x21')]=function(_0x2d1745,_0x5ecbf5){if(_0x2d1745[_0xb102('0x42')]['id']){delete _0x2d1745['body']['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x2d1745[_0xb102('0x3e')]['id']}})[_0xb102('0x22')](handleEntityNotFound(_0x5ecbf5,null))[_0xb102('0x22')](saveUpdates(_0x2d1745[_0xb102('0x42')],null))[_0xb102('0x22')](respondWithResult(_0x5ecbf5,null))[_0xb102('0x3d')](handleError(_0x5ecbf5,null));};exports[_0xb102('0x23')]=function(_0x155ca9,_0x43403d){return db[_0xb102('0x27')][_0xb102('0x40')]({'where':{'id':_0x155ca9[_0xb102('0x3e')]['id']}})[_0xb102('0x22')](handleEntityNotFound(_0x43403d,null))['then'](removeEntity(_0x43403d,null))['catch'](handleError(_0x43403d,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index df0882a..1095928 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 _0x9657=['../../config/logger','api','moment','request-promise','path','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','util'];(function(_0x2bbad5,_0x37be02){var _0x12d3d4=function(_0x119f5a){while(--_0x119f5a){_0x2bbad5['push'](_0x2bbad5['shift']());}};_0x12d3d4(++_0x37be02);}(_0x9657,0x110));var _0x7965=function(_0x3c861d,_0x48f475){_0x3c861d=_0x3c861d-0x0;var _0x139f04=_0x9657[_0x3c861d];return _0x139f04;};'use strict';var _=require('lodash');var util=require(_0x7965('0x0'));var logger=require(_0x7965('0x1'))(_0x7965('0x2'));var moment=require(_0x7965('0x3'));var BPromise=require('bluebird');var rp=require(_0x7965('0x4'));var fs=require('fs');var path=require(_0x7965('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module[_0x7965('0x6')]=function(_0xa0bcad,_0x45e340){return _0xa0bcad[_0x7965('0x7')](_0x7965('0x8'),attributes,{'tableName':_0x7965('0x9'),'paranoid':![],'indexes':[{'name':_0x7965('0xa'),'fields':[_0x7965('0xb'),_0x7965('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x868d=['../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x868d,0x143));var _0xd868=function(_0xe6b674,_0x267db9){_0xe6b674=_0xe6b674-0x0;var _0x2a6236=_0x868d[_0xe6b674];return _0x2a6236;};'use strict';var _=require(_0xd868('0x0'));var util=require('util');var logger=require(_0xd868('0x1'))(_0xd868('0x2'));var moment=require('moment');var BPromise=require(_0xd868('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd868('0x4'));var config=require(_0xd868('0x5'));var attributes=require('./intFreshsalesField.attributes');module[_0xd868('0x6')]=function(_0x36e13e,_0x444c4e){return _0x36e13e[_0xd868('0x7')](_0xd868('0x8'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xd868('0x9'),'fields':[_0xd868('0xa'),_0xd868('0xb')],'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 706b7d0..62d18b3 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 _0xd738=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesField,\x20%s,\x20%s','result','lodash','util'];(function(_0x486f6b,_0x7db838){var _0x45c03c=function(_0x2cb178){while(--_0x2cb178){_0x486f6b['push'](_0x486f6b['shift']());}};_0x45c03c(++_0x7db838);}(_0xd738,0x19c));var _0x8d73=function(_0x4ac1fc,_0x2315c6){_0x4ac1fc=_0x4ac1fc-0x0;var _0x1c2165=_0xd738[_0x4ac1fc];return _0x1c2165;};'use strict';var _=require(_0x8d73('0x0'));var util=require(_0x8d73('0x1'));var moment=require(_0x8d73('0x2'));var BPromise=require(_0x8d73('0x3'));var rs=require(_0x8d73('0x4'));var fs=require('fs');var Redis=require(_0x8d73('0x5'));var db=require(_0x8d73('0x6'))['db'];var utils=require(_0x8d73('0x7'));var logger=require(_0x8d73('0x8'))(_0x8d73('0x9'));var config=require('../../config/environment');var jayson=require(_0x8d73('0xa'));var client=jayson[_0x8d73('0xb')][_0x8d73('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x448567,_0x365669,_0x19fe44){return new BPromise(function(_0x5639b6,_0x6d021f){return client[_0x8d73('0xd')](_0x448567,_0x19fe44)['then'](function(_0x4e9445){logger[_0x8d73('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x365669,_0x8d73('0xf'));logger['debug'](_0x8d73('0x10'),_0x365669,_0x8d73('0xf'),JSON[_0x8d73('0x11')](_0x4e9445));if(_0x4e9445[_0x8d73('0x12')]){if(_0x4e9445[_0x8d73('0x12')][_0x8d73('0x13')]===0x1f4){logger[_0x8d73('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x365669,_0x4e9445[_0x8d73('0x12')][_0x8d73('0x14')]);return _0x6d021f(_0x4e9445[_0x8d73('0x12')][_0x8d73('0x14')]);}logger[_0x8d73('0x12')](_0x8d73('0x15'),_0x365669,_0x4e9445[_0x8d73('0x12')][_0x8d73('0x14')]);return _0x5639b6(_0x4e9445[_0x8d73('0x12')][_0x8d73('0x14')]);}else{logger[_0x8d73('0xe')](_0x8d73('0x15'),_0x365669,_0x8d73('0xf'));_0x5639b6(_0x4e9445[_0x8d73('0x16')][_0x8d73('0x14')]);}})['catch'](function(_0x508ac9){logger[_0x8d73('0x12')](_0x8d73('0x15'),_0x365669,_0x508ac9);_0x6d021f(_0x508ac9);});});} \ No newline at end of file +var _0x5776=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshsalesField,\x20%s,\x20%s','result','lodash','util','moment'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x5776,0x17d));var _0x6577=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5776[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x6577('0x0'));var util=require(_0x6577('0x1'));var moment=require(_0x6577('0x2'));var BPromise=require(_0x6577('0x3'));var rs=require(_0x6577('0x4'));var fs=require('fs');var Redis=require(_0x6577('0x5'));var db=require(_0x6577('0x6'))['db'];var utils=require(_0x6577('0x7'));var logger=require(_0x6577('0x8'))(_0x6577('0x9'));var config=require(_0x6577('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6577('0xb')][_0x6577('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5dee9c,_0x193262,_0x43324a){return new BPromise(function(_0x1ec3dc,_0x4f1f8b){return client[_0x6577('0xd')](_0x5dee9c,_0x43324a)[_0x6577('0xe')](function(_0x19b47c){logger[_0x6577('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x193262,_0x6577('0x10'));logger[_0x6577('0x11')](_0x6577('0x12'),_0x193262,_0x6577('0x10'),JSON[_0x6577('0x13')](_0x19b47c));if(_0x19b47c[_0x6577('0x14')]){if(_0x19b47c[_0x6577('0x14')]['code']===0x1f4){logger[_0x6577('0x14')]('FreshsalesField,\x20%s,\x20%s',_0x193262,_0x19b47c['error'][_0x6577('0x15')]);return _0x4f1f8b(_0x19b47c[_0x6577('0x14')][_0x6577('0x15')]);}logger['error'](_0x6577('0x16'),_0x193262,_0x19b47c['error'][_0x6577('0x15')]);return _0x1ec3dc(_0x19b47c[_0x6577('0x14')][_0x6577('0x15')]);}else{logger[_0x6577('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x193262,_0x6577('0x10'));_0x1ec3dc(_0x19b47c[_0x6577('0x17')][_0x6577('0x15')]);}})['catch'](function(_0x1bea1d){logger['error'](_0x6577('0x16'),_0x193262,_0x1bea1d);_0x4f1f8b(_0x1bea1d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index dfb2d24..b03e5ba 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 _0x7b00=['../../config/environment','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3011fc,_0x383c6e){var _0x108bfc=function(_0x25e41c){while(--_0x25e41c){_0x3011fc['push'](_0x3011fc['shift']());}};_0x108bfc(++_0x383c6e);}(_0x7b00,0x1dd));var _0x07b0=function(_0x54252d,_0x31de7b){_0x54252d=_0x54252d-0x0;var _0x515a1e=_0x7b00[_0x54252d];return _0x515a1e;};'use strict';var multer=require(_0x07b0('0x0'));var util=require(_0x07b0('0x1'));var path=require(_0x07b0('0x2'));var timeout=require(_0x07b0('0x3'));var express=require('express');var router=express[_0x07b0('0x4')]();var fs_extra=require(_0x07b0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x07b0('0x6'));var controller=require('./intSalesforceAccount.controller');router['get']('/',auth[_0x07b0('0x7')](),controller[_0x07b0('0x8')]);router[_0x07b0('0x9')]('/:id',auth[_0x07b0('0x7')](),controller[_0x07b0('0xa')]);router[_0x07b0('0x9')](_0x07b0('0xb'),auth[_0x07b0('0x7')](),controller[_0x07b0('0xc')]);router[_0x07b0('0x9')](_0x07b0('0xd'),auth[_0x07b0('0x7')](),controller[_0x07b0('0xe')]);router[_0x07b0('0xf')]('/',auth[_0x07b0('0x7')](),controller['create']);router['post'](_0x07b0('0xb'),auth[_0x07b0('0x7')](),controller[_0x07b0('0x10')]);router[_0x07b0('0x11')](_0x07b0('0x12'),auth['isAuthenticated'](),controller[_0x07b0('0x13')]);router[_0x07b0('0x14')]('/:id',auth[_0x07b0('0x7')](),controller[_0x07b0('0x15')]);module[_0x07b0('0x16')]=router; \ No newline at end of file +var _0x0ad0=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceAccount.controller','get'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0ad0,0x141));var _0x00ad=function(_0x1cab00,_0xdcef79){_0x1cab00=_0x1cab00-0x0;var _0x37153e=_0x0ad0[_0x1cab00];return _0x37153e;};'use strict';var multer=require(_0x00ad('0x0'));var util=require(_0x00ad('0x1'));var path=require('path');var timeout=require(_0x00ad('0x2'));var express=require('express');var router=express[_0x00ad('0x3')]();var fs_extra=require(_0x00ad('0x4'));var auth=require(_0x00ad('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x00ad('0x6'));var controller=require(_0x00ad('0x7'));router[_0x00ad('0x8')]('/',auth[_0x00ad('0x9')](),controller[_0x00ad('0xa')]);router['get'](_0x00ad('0xb'),auth[_0x00ad('0x9')](),controller[_0x00ad('0xc')]);router['get'](_0x00ad('0xd'),auth[_0x00ad('0x9')](),controller[_0x00ad('0xe')]);router[_0x00ad('0x8')]('/:id/fields',auth[_0x00ad('0x9')](),controller[_0x00ad('0xf')]);router[_0x00ad('0x10')]('/',auth[_0x00ad('0x9')](),controller[_0x00ad('0x11')]);router['post'](_0x00ad('0xd'),auth[_0x00ad('0x9')](),controller[_0x00ad('0x12')]);router['put'](_0x00ad('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x00ad('0x13')](_0x00ad('0xb'),auth['isAuthenticated'](),controller[_0x00ad('0x14')]);module[_0x00ad('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 5d056b8..ee54f10 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 _0xafdf=['newTab','sequelize','exports','STRING','ENUM','integrationTab'];(function(_0x4ca9cc,_0x164ac5){var _0x3141b3=function(_0x48e403){while(--_0x48e403){_0x4ca9cc['push'](_0x4ca9cc['shift']());}};_0x3141b3(++_0x164ac5);}(_0xafdf,0xaf));var _0xfafd=function(_0x14a40a,_0x3cccb1){_0x14a40a=_0x14a40a-0x0;var _0x17f92c=_0xafdf[_0x14a40a];return _0x17f92c;};'use strict';var Sequelize=require(_0xfafd('0x0'));module[_0xfafd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfafd('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xfafd('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xfafd('0x2')]},'clientSecret':{'type':Sequelize[_0xfafd('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfafd('0x3')](_0xfafd('0x4'),_0xfafd('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x2915=['newTab','sequelize','exports','STRING','ENUM','integrationTab'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0x2915,0x145));var _0x5291=function(_0x118bdf,_0x34a405){_0x118bdf=_0x118bdf-0x0;var _0x143b37=_0x2915[_0x118bdf];return _0x143b37;};'use strict';var Sequelize=require(_0x5291('0x0'));module[_0x5291('0x1')]={'name':{'type':Sequelize[_0x5291('0x2')]},'description':{'type':Sequelize[_0x5291('0x2')]},'username':{'type':Sequelize[_0x5291('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x5291('0x2')]},'password':{'type':Sequelize[_0x5291('0x2')]},'clientId':{'type':Sequelize[_0x5291('0x2')]},'clientSecret':{'type':Sequelize[_0x5291('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5291('0x3')](_0x5291('0x4'),_0x5291('0x5')),'defaultValue':_0x5291('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index dec293e..cf28ba2 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 _0x26a8=['clientId','login','password','concat','securityToken','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','Subject','Description','string','int','picklist','email','textarea','phone','includes','label','picklistValues','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','json','apply','reject','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','SalesforceAccount','count','includeAll','include','rows','params','keys','options','find','create','update','body','getConfigurations','findOne','SalesforceConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientSecret','username','substring','lastIndexOf','Connection'];(function(_0x24aeeb,_0x3ae73e){var _0x2a96af=function(_0x2e1ec7){while(--_0x2e1ec7){_0x24aeeb['push'](_0x24aeeb['shift']());}};_0x2a96af(++_0x3ae73e);}(_0x26a8,0x19d));var _0x826a=function(_0x1aa6b3,_0x2d09ea){_0x1aa6b3=_0x1aa6b3-0x0;var _0xf8d8fd=_0x26a8[_0x1aa6b3];return _0xf8d8fd;};'use strict';var emlformat=require(_0x826a('0x0'));var rimraf=require(_0x826a('0x1'));var zipdir=require(_0x826a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x826a('0x3'));var moment=require(_0x826a('0x4'));var BPromise=require(_0x826a('0x5'));var Mustache=require('mustache');var util=require(_0x826a('0x6'));var path=require(_0x826a('0x7'));var sox=require(_0x826a('0x8'));var csv=require(_0x826a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x826a('0xa'));var _=require(_0x826a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x826a('0xc'));var toCsv=require(_0x826a('0x9'));var querystring=require(_0x826a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x826a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x826a('0xf'));var hardwareService=require(_0x826a('0x10'));var logger=require(_0x826a('0x11'))(_0x826a('0x12'));var utils=require(_0x826a('0x13'));var config=require(_0x826a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x826a('0x15'))['db'];var integrations=require(_0x826a('0x16'));var jayson=require(_0x826a('0x17'));var client=jayson[_0x826a('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1df75f,_0x51d319,_0x5370c0,_0x473eba){return new BPromise(function(_0x1dd826,_0x1cf978){var _0x4567d1=_0x473eba||client;return _0x4567d1[_0x826a('0x19')](_0x1df75f,_0x5370c0)[_0x826a('0x1a')](function(_0x4fa0b8){logger[_0x826a('0x1b')](_0x826a('0x1c'),_0x51d319,'request\x20sent');logger[_0x826a('0x1d')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x51d319,_0x826a('0x1e'),JSON[_0x826a('0x1f')](_0x4fa0b8));if(_0x4fa0b8[_0x826a('0x20')]){if(_0x4fa0b8[_0x826a('0x20')][_0x826a('0x21')]===0x1f4){logger[_0x826a('0x20')](_0x826a('0x1c'),_0x51d319,_0x4fa0b8[_0x826a('0x20')]['message']);return _0x1cf978(_0x4fa0b8[_0x826a('0x20')]['message']);}logger[_0x826a('0x20')](_0x826a('0x1c'),_0x51d319,_0x4fa0b8[_0x826a('0x20')]['message']);return _0x1dd826(_0x4fa0b8['error'][_0x826a('0x22')]);}else{logger[_0x826a('0x1b')]('SalesforceAccount,\x20%s,\x20%s',_0x51d319,_0x826a('0x1e'));_0x1dd826(_0x4fa0b8[_0x826a('0x23')][_0x826a('0x22')]);}})[_0x826a('0x24')](function(_0x272519){logger[_0x826a('0x20')](_0x826a('0x1c'),_0x51d319,_0x272519);_0x1cf978(_0x272519);});});}function respondWithStatusCode(_0x3402fe,_0x118fe5){_0x118fe5=_0x118fe5||0xcc;return function(_0x1e763c){if(_0x1e763c){return _0x3402fe[_0x826a('0x25')](_0x118fe5);}return _0x3402fe[_0x826a('0x26')](_0x118fe5)[_0x826a('0x27')]();};}function respondWithResult(_0x58727a,_0x1a35e8){_0x1a35e8=_0x1a35e8||0xc8;return function(_0x4ad402){if(_0x4ad402){return _0x58727a[_0x826a('0x26')](_0x1a35e8)['json'](_0x4ad402);}};}function respondWithFilteredResult(_0x2871cc,_0x29f5c0){return function(_0x54bca6){if(_0x54bca6){var _0x1d9b16=_0x54bca6['count'],_0x24c6b4=_0x29f5c0[_0x826a('0x28')],_0x134ccc=_0x29f5c0[_0x826a('0x28')]+_0x29f5c0[_0x826a('0x29')],_0x375db7;if(_0x134ccc>=_0x1d9b16){_0x134ccc=_0x1d9b16;_0x375db7=0xc8;}else{_0x375db7=0xce;}_0x2871cc['status'](_0x375db7);return _0x2871cc[_0x826a('0x2a')]('Content-Range',_0x24c6b4+'-'+_0x134ccc+'/'+_0x1d9b16)[_0x826a('0x2b')](_0x54bca6);}return null;};}function patchUpdates(_0x31181a){return function(_0x32161e){try{jsonpatch[_0x826a('0x2c')](_0x32161e,_0x31181a,!![]);}catch(_0x58c6a6){return BPromise[_0x826a('0x2d')](_0x58c6a6);}return _0x32161e['save']();};}function saveUpdates(_0x3f9233,_0xff084d){return function(_0x34376e){if(_0x34376e){return _0x34376e['update'](_0x3f9233)[_0x826a('0x1a')](function(_0x143ca8){return _0x143ca8;});}return null;};}function removeEntity(_0xb68bbf,_0x642b77){return function(_0x301eb1){if(_0x301eb1){return _0x301eb1[_0x826a('0x2e')]()[_0x826a('0x1a')](function(){_0xb68bbf[_0x826a('0x26')](0xcc)[_0x826a('0x27')]();});}};}function handleEntityNotFound(_0x4b51eb,_0x4142fd){return function(_0x5ca0e0){if(!_0x5ca0e0){_0x4b51eb[_0x826a('0x25')](0x194);}return _0x5ca0e0;};}function handleError(_0x3ab851,_0x1e3150){_0x1e3150=_0x1e3150||0x1f4;return function(_0x5805ed){logger[_0x826a('0x20')](_0x5805ed[_0x826a('0x2f')]);if(_0x5805ed['name']){delete _0x5805ed[_0x826a('0x30')];}_0x3ab851[_0x826a('0x26')](_0x1e3150)[_0x826a('0x31')](_0x5805ed);};}exports[_0x826a('0x32')]=function(_0x14a256,_0x3d25cd){var _0x451d9a={},_0x16e395={},_0x11b773={'count':0x0,'rows':[]};var _0x40de4f=_[_0x826a('0x33')](db['SalesforceAccount'][_0x826a('0x34')],function(_0x3d78c0){return{'name':_0x3d78c0['fieldName'],'type':_0x3d78c0[_0x826a('0x35')][_0x826a('0x36')]};});_0x16e395[_0x826a('0x37')]=_[_0x826a('0x33')](_0x40de4f,_0x826a('0x30'));_0x16e395[_0x826a('0x38')]=_['keys'](_0x14a256[_0x826a('0x38')]);_0x16e395[_0x826a('0x39')]=_[_0x826a('0x3a')](_0x16e395['model'],_0x16e395[_0x826a('0x38')]);_0x451d9a[_0x826a('0x3b')]=_[_0x826a('0x3a')](_0x16e395[_0x826a('0x37')],qs[_0x826a('0x3c')](_0x14a256[_0x826a('0x38')][_0x826a('0x3c')]));_0x451d9a[_0x826a('0x3b')]=_0x451d9a[_0x826a('0x3b')][_0x826a('0x3d')]?_0x451d9a[_0x826a('0x3b')]:_0x16e395[_0x826a('0x37')];if(!_0x14a256[_0x826a('0x38')][_0x826a('0x3e')](_0x826a('0x3f'))){_0x451d9a[_0x826a('0x29')]=qs['limit'](_0x14a256['query']['limit']);_0x451d9a[_0x826a('0x28')]=qs[_0x826a('0x28')](_0x14a256[_0x826a('0x38')][_0x826a('0x28')]);}_0x451d9a[_0x826a('0x40')]=qs[_0x826a('0x41')](_0x14a256[_0x826a('0x38')][_0x826a('0x41')]);_0x451d9a['where']=qs[_0x826a('0x39')](_['pick'](_0x14a256['query'],_0x16e395['filters']),_0x40de4f);if(_0x14a256[_0x826a('0x38')][_0x826a('0x42')]){_0x451d9a['where']=_[_0x826a('0x43')](_0x451d9a[_0x826a('0x44')],{'$or':_['map'](_0x40de4f,function(_0x390bfa){if(_0x390bfa[_0x826a('0x35')]!=='VIRTUAL'){var _0x52def3={};_0x52def3[_0x390bfa[_0x826a('0x30')]]={'$like':'%'+_0x14a256[_0x826a('0x38')][_0x826a('0x42')]+'%'};return _0x52def3;}})});}_0x451d9a=_[_0x826a('0x43')]({},_0x451d9a,_0x14a256['options']);var _0x2c81c3={'where':_0x451d9a['where']};return db[_0x826a('0x45')][_0x826a('0x46')](_0x2c81c3)['then'](function(_0xc79fa5){_0x11b773['count']=_0xc79fa5;if(_0x14a256[_0x826a('0x38')][_0x826a('0x47')]){_0x451d9a[_0x826a('0x48')]=[{'all':!![]}];}return db[_0x826a('0x45')]['findAll'](_0x451d9a);})['then'](function(_0x367b56){_0x11b773[_0x826a('0x49')]=_0x367b56;return _0x11b773;})[_0x826a('0x1a')](respondWithFilteredResult(_0x3d25cd,_0x451d9a))[_0x826a('0x24')](handleError(_0x3d25cd,null));};exports['show']=function(_0x4bda7f,_0x5bb7a9){var _0x3df418={'raw':![],'where':{'id':_0x4bda7f[_0x826a('0x4a')]['id']}},_0x4920c1={};_0x4920c1[_0x826a('0x37')]=_[_0x826a('0x4b')](db[_0x826a('0x45')][_0x826a('0x34')]);_0x4920c1[_0x826a('0x38')]=_[_0x826a('0x4b')](_0x4bda7f['query']);_0x4920c1[_0x826a('0x39')]=_[_0x826a('0x3a')](_0x4920c1[_0x826a('0x37')],_0x4920c1[_0x826a('0x38')]);_0x3df418[_0x826a('0x3b')]=_[_0x826a('0x3a')](_0x4920c1[_0x826a('0x37')],qs[_0x826a('0x3c')](_0x4bda7f['query']['fields']));_0x3df418[_0x826a('0x3b')]=_0x3df418['attributes'][_0x826a('0x3d')]?_0x3df418[_0x826a('0x3b')]:_0x4920c1[_0x826a('0x37')];if(_0x4bda7f[_0x826a('0x38')][_0x826a('0x47')]){_0x3df418['include']=[{'all':!![]}];}_0x3df418=_[_0x826a('0x43')]({},_0x3df418,_0x4bda7f[_0x826a('0x4c')]);return db['SalesforceAccount'][_0x826a('0x4d')](_0x3df418)[_0x826a('0x1a')](handleEntityNotFound(_0x5bb7a9,null))[_0x826a('0x1a')](respondWithResult(_0x5bb7a9,null))[_0x826a('0x24')](handleError(_0x5bb7a9,null));};exports['create']=function(_0x228097,_0x448e25){return db[_0x826a('0x45')][_0x826a('0x4e')](_0x228097['body'],{})[_0x826a('0x1a')](respondWithResult(_0x448e25,0xc9))[_0x826a('0x24')](handleError(_0x448e25,null));};exports[_0x826a('0x4f')]=function(_0x5604de,_0x47835d){if(_0x5604de[_0x826a('0x50')]['id']){delete _0x5604de[_0x826a('0x50')]['id'];}return db['SalesforceAccount'][_0x826a('0x4d')]({'where':{'id':_0x5604de[_0x826a('0x4a')]['id']}})[_0x826a('0x1a')](handleEntityNotFound(_0x47835d,null))[_0x826a('0x1a')](saveUpdates(_0x5604de['body'],null))['then'](respondWithResult(_0x47835d,null))[_0x826a('0x24')](handleError(_0x47835d,null));};exports[_0x826a('0x2e')]=function(_0xfdd3c2,_0x4afde8){return db[_0x826a('0x45')][_0x826a('0x4d')]({'where':{'id':_0xfdd3c2[_0x826a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4afde8,null))['then'](removeEntity(_0x4afde8,null))[_0x826a('0x24')](handleError(_0x4afde8,null));};exports[_0x826a('0x51')]=function(_0x29f4ee,_0xb24699,_0x1ba3db){var _0x309879={};var _0x4ce00f={};var _0x38b218;var _0x4a53dc;return db['SalesforceAccount'][_0x826a('0x52')]({'where':{'id':_0x29f4ee[_0x826a('0x4a')]['id']}})[_0x826a('0x1a')](handleEntityNotFound(_0xb24699,null))[_0x826a('0x1a')](function(_0x179395){if(_0x179395){_0x38b218=_0x179395;_0x4ce00f[_0x826a('0x37')]=_['keys'](db[_0x826a('0x53')][_0x826a('0x34')]);_0x4ce00f['query']=_[_0x826a('0x4b')](_0x29f4ee['query']);_0x4ce00f['filters']=_[_0x826a('0x3a')](_0x4ce00f[_0x826a('0x37')],_0x4ce00f[_0x826a('0x38')]);_0x309879['attributes']=_[_0x826a('0x3a')](_0x4ce00f[_0x826a('0x37')],qs[_0x826a('0x3c')](_0x29f4ee[_0x826a('0x38')]['fields']));_0x309879['attributes']=_0x309879[_0x826a('0x3b')]['length']?_0x309879[_0x826a('0x3b')]:_0x4ce00f['model'];_0x309879[_0x826a('0x40')]=qs[_0x826a('0x41')](_0x29f4ee['query'][_0x826a('0x41')]);_0x309879[_0x826a('0x44')]=qs['filters'](_['pick'](_0x29f4ee['query'],_0x4ce00f['filters']));if(_0x29f4ee[_0x826a('0x38')]['filter']){_0x309879[_0x826a('0x44')]=_[_0x826a('0x43')](_0x309879['where'],{'$or':_['map'](_0x309879[_0x826a('0x3b')],function(_0xa8b918){var _0x3e75ce={};_0x3e75ce[_0xa8b918]={'$like':'%'+_0x29f4ee[_0x826a('0x38')][_0x826a('0x42')]+'%'};return _0x3e75ce;})});}_0x309879=_['merge']({},_0x309879,_0x29f4ee[_0x826a('0x4c')]);return _0x38b218[_0x826a('0x51')](_0x309879);}})[_0x826a('0x1a')](function(_0x1da1fd){if(_0x1da1fd){_0x4a53dc=_0x1da1fd['length'];if(!_0x29f4ee[_0x826a('0x38')]['hasOwnProperty'](_0x826a('0x3f'))){_0x309879['limit']=qs[_0x826a('0x29')](_0x29f4ee[_0x826a('0x38')][_0x826a('0x29')]);_0x309879['offset']=qs[_0x826a('0x28')](_0x29f4ee['query'][_0x826a('0x28')]);}return _0x38b218[_0x826a('0x51')](_0x309879);}})[_0x826a('0x1a')](function(_0x3c6e09){if(_0x3c6e09){return _0x3c6e09?{'count':_0x4a53dc,'rows':_0x3c6e09}:null;}})[_0x826a('0x1a')](respondWithResult(_0xb24699,null))[_0x826a('0x24')](handleError(_0xb24699,null));};exports['addConfiguration']=function(_0xa6a029,_0x600b74,_0x1c865f){if(_0xa6a029['body']['id']){delete _0xa6a029[_0x826a('0x50')]['id'];}return db[_0x826a('0x45')]['findOne']({'where':{'id':_0xa6a029[_0x826a('0x4a')]['id']}})[_0x826a('0x1a')](handleEntityNotFound(_0x600b74,null))[_0x826a('0x1a')](function(_0x328009){if(_0x328009){_0xa6a029[_0x826a('0x50')][_0x826a('0x54')]=_0x328009['id'];_0xa6a029['body'][_0x826a('0x55')]=integrations[_0x826a('0x56')](_0xa6a029['body']['channel'],_0xa6a029[_0x826a('0x50')][_0x826a('0x35')]);_0xa6a029['body'][_0x826a('0x57')]=integrations[_0x826a('0x58')](_0xa6a029['body'][_0x826a('0x59')],_0xa6a029['body']['type']);return db['SalesforceConfiguration'][_0x826a('0x4e')](_0xa6a029[_0x826a('0x50')],{'include':[{'model':db[_0x826a('0x5a')],'as':_0x826a('0x55')},{'model':db[_0x826a('0x5a')],'as':_0x826a('0x57')}]});}return null;})[_0x826a('0x1a')](respondWithResult(_0x600b74,null))[_0x826a('0x24')](handleError(_0x600b74,null));};exports[_0x826a('0x5b')]=function(_0x1fe6a8,_0x5dbdf8,_0xbe5e09){var _0x105e77;var _0x164704='';var _0x37666b=_0x826a('0x5c');return db[_0x826a('0x45')][_0x826a('0x52')]({'where':{'id':_0x1fe6a8[_0x826a('0x4a')]['id']},'attributes':['id',_0x826a('0x5d'),'clientId',_0x826a('0x5e'),_0x826a('0x5f'),'password','securityToken']})[_0x826a('0x1a')](handleEntityNotFound(_0x5dbdf8,null))[_0x826a('0x1a')](function(_0x5a6f69){if(_0x5a6f69){_0x164704=_0x5a6f69[_0x826a('0x5d')];var _0x3e2f5f=_0x164704['slice'](-0x1);if(_0x3e2f5f==='/'){_0x164704=_0x164704[_0x826a('0x60')](0x0,_0x164704[_0x826a('0x61')](_0x3e2f5f));}_0x105e77=new jsforce[(_0x826a('0x62'))]({'oauth2':{'loginUrl':_0x164704,'clientId':_0x5a6f69[_0x826a('0x63')],'clientSecret':_0x5a6f69[_0x826a('0x5e')]}});return _0x105e77[_0x826a('0x64')](_0x5a6f69[_0x826a('0x5f')],_0x5a6f69[_0x826a('0x65')][_0x826a('0x66')](_0x5a6f69[_0x826a('0x67')]));}})['then'](function(_0x4f1c7c){if(_0x4f1c7c){if(!_[_0x826a('0x68')](_0x1fe6a8[_0x826a('0x38')][_0x826a('0x69')])){_0x37666b=_0x1fe6a8[_0x826a('0x38')][_0x826a('0x69')];}return _0x105e77['sobject'](_0x37666b)[_0x826a('0x6a')]();}})[_0x826a('0x1a')](function(_0x16fc2b){var _0xbc3de0=[_0x826a('0x6b'),_0x826a('0x6c'),_0x826a('0x6d'),'IsRecurrence',_0x826a('0x6e'),_0x826a('0x6f')];var _0x6db229=[_0x826a('0x70'),_0x826a('0x71'),_0x826a('0x72'),'boolean',_0x826a('0x73'),_0x826a('0x74'),_0x826a('0x75')];if(_0x16fc2b){_['remove'](_0x16fc2b[_0x826a('0x3c')],function(_0x3bf420){return _0xbc3de0[_0x826a('0x76')](_0x3bf420[_0x826a('0x30')])||!_0x6db229[_0x826a('0x76')](_0x3bf420[_0x826a('0x35')]);});return{'count':_0x16fc2b['fields'][_0x826a('0x3d')],'rows':_[_0x826a('0x33')](_0x16fc2b['fields'],function(_0x36fb31){return{'id':_0x36fb31[_0x826a('0x30')],'name':_0x36fb31[_0x826a('0x77')],'custom':_0x36fb31['custom'],'options':_0x36fb31['picklistValues'][_0x826a('0x3d')]>0x0?_[_0x826a('0x33')](_0x36fb31[_0x826a('0x78')],function(_0x52af57){return{'name':_0x52af57['label'],'value':_0x52af57['value']};}):_0x36fb31[_0x826a('0x35')]=='boolean'?[{'name':_0x826a('0x79'),'value':_0x826a('0x7a')},{'name':_0x826a('0x7b'),'value':'false'}]:[]};})};}})[_0x826a('0x1a')](respondWithResult(_0x5dbdf8,null))['catch'](function(_0x5d1e5a){var _0x3b30a9=_0x1fe6a8[_0x826a('0x38')][_0x826a('0x7c')]?0x1f4:_0x5d1e5a[_0x826a('0x7d')]||0x1f4;logger[_0x826a('0x20')](_0x826a('0x7e'),_0x826a('0x5b'),_0x3b30a9,JSON[_0x826a('0x1f')](_0x5d1e5a));delete _0x5d1e5a[_0x826a('0x30')];if(_0x3b30a9===0x191){_0x3b30a9=0x190;}_0x5dbdf8[_0x826a('0x26')](_0x3b30a9)[_0x826a('0x31')](_0x1fe6a8[_0x826a('0x38')]['test']?{'message':_0x826a('0x7f'),'statusCode':_0x5d1e5a[_0x826a('0x7d')]}:_0x5d1e5a);});}; \ No newline at end of file +var _0x511a=['IsReminderSet','Subject','Description','int','picklist','email','textarea','phone','includes','label','custom','picklistValues','value','boolean','True','true','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','rows','includeAll','include','options','find','create','body','params','getConfigurations','findOne','SalesforceConfiguration','merge','nolimit','addConfiguration','Subjects','getSubjects','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','password','securityToken','slice','substring','lastIndexOf','clientId','clientSecret','login','username','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate'];(function(_0x15d504,_0x505b14){var _0x13c2fd=function(_0x1241d4){while(--_0x1241d4){_0x15d504['push'](_0x15d504['shift']());}};_0x13c2fd(++_0x505b14);}(_0x511a,0x129));var _0xa511=function(_0x5a4628,_0x426ff5){_0x5a4628=_0x5a4628-0x0;var _0x23fd07=_0x511a[_0x5a4628];return _0x23fd07;};'use strict';var emlformat=require(_0xa511('0x0'));var rimraf=require(_0xa511('0x1'));var zipdir=require(_0xa511('0x2'));var jsonpatch=require(_0xa511('0x3'));var rp=require(_0xa511('0x4'));var moment=require(_0xa511('0x5'));var BPromise=require(_0xa511('0x6'));var Mustache=require(_0xa511('0x7'));var util=require(_0xa511('0x8'));var path=require(_0xa511('0x9'));var sox=require('sox');var csv=require(_0xa511('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa511('0xb'));var _=require(_0xa511('0xc'));var squel=require(_0xa511('0xd'));var crypto=require(_0xa511('0xe'));var jsforce=require(_0xa511('0xf'));var deskjs=require(_0xa511('0x10'));var toCsv=require(_0xa511('0xa'));var querystring=require(_0xa511('0x11'));var Papa=require(_0xa511('0x12'));var Redis=require(_0xa511('0x13'));var authService=require(_0xa511('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xa511('0x15'));var hardwareService=require(_0xa511('0x16'));var logger=require('../../config/logger')(_0xa511('0x17'));var utils=require('../../config/utils');var config=require(_0xa511('0x18'));var licenseUtil=require(_0xa511('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa511('0x1a'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa511('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1d6d1f,_0x383b10,_0x523a96,_0x59687f){return new BPromise(function(_0x50fa32,_0x13a733){var _0x30657c=_0x59687f||client;return _0x30657c[_0xa511('0x1c')](_0x1d6d1f,_0x523a96)[_0xa511('0x1d')](function(_0x428db8){logger[_0xa511('0x1e')](_0xa511('0x1f'),_0x383b10,_0xa511('0x20'));logger[_0xa511('0x21')](_0xa511('0x22'),_0x383b10,_0xa511('0x20'),JSON['stringify'](_0x428db8));if(_0x428db8['error']){if(_0x428db8[_0xa511('0x23')][_0xa511('0x24')]===0x1f4){logger[_0xa511('0x23')](_0xa511('0x1f'),_0x383b10,_0x428db8[_0xa511('0x23')][_0xa511('0x25')]);return _0x13a733(_0x428db8[_0xa511('0x23')][_0xa511('0x25')]);}logger[_0xa511('0x23')](_0xa511('0x1f'),_0x383b10,_0x428db8['error'][_0xa511('0x25')]);return _0x50fa32(_0x428db8[_0xa511('0x23')][_0xa511('0x25')]);}else{logger[_0xa511('0x1e')](_0xa511('0x1f'),_0x383b10,'request\x20sent');_0x50fa32(_0x428db8[_0xa511('0x26')]['message']);}})[_0xa511('0x27')](function(_0x3a2da5){logger['error'](_0xa511('0x1f'),_0x383b10,_0x3a2da5);_0x13a733(_0x3a2da5);});});}function respondWithStatusCode(_0x29e80d,_0x4b79da){_0x4b79da=_0x4b79da||0xcc;return function(_0x560c82){if(_0x560c82){return _0x29e80d[_0xa511('0x28')](_0x4b79da);}return _0x29e80d[_0xa511('0x29')](_0x4b79da)['end']();};}function respondWithResult(_0x47f692,_0x113228){_0x113228=_0x113228||0xc8;return function(_0x360a50){if(_0x360a50){return _0x47f692['status'](_0x113228)[_0xa511('0x2a')](_0x360a50);}};}function respondWithFilteredResult(_0x528ccf,_0x557fcf){return function(_0x51c227){if(_0x51c227){var _0xea9866=_0x51c227[_0xa511('0x2b')],_0x2e3769=_0x557fcf[_0xa511('0x2c')],_0x12d4a6=_0x557fcf[_0xa511('0x2c')]+_0x557fcf[_0xa511('0x2d')],_0x2c51d5;if(_0x12d4a6>=_0xea9866){_0x12d4a6=_0xea9866;_0x2c51d5=0xc8;}else{_0x2c51d5=0xce;}_0x528ccf[_0xa511('0x29')](_0x2c51d5);return _0x528ccf[_0xa511('0x2e')](_0xa511('0x2f'),_0x2e3769+'-'+_0x12d4a6+'/'+_0xea9866)['json'](_0x51c227);}return null;};}function patchUpdates(_0x4ba77c){return function(_0x1ff376){try{jsonpatch[_0xa511('0x30')](_0x1ff376,_0x4ba77c,!![]);}catch(_0x2938d5){return BPromise[_0xa511('0x31')](_0x2938d5);}return _0x1ff376[_0xa511('0x32')]();};}function saveUpdates(_0x39902e,_0x346115){return function(_0x79ae66){if(_0x79ae66){return _0x79ae66[_0xa511('0x33')](_0x39902e)['then'](function(_0x325bc2){return _0x325bc2;});}return null;};}function removeEntity(_0x5de840,_0x13c3d0){return function(_0x3d84a0){if(_0x3d84a0){return _0x3d84a0[_0xa511('0x34')]()[_0xa511('0x1d')](function(){_0x5de840[_0xa511('0x29')](0xcc)[_0xa511('0x35')]();});}};}function handleEntityNotFound(_0x49d2f9,_0xc6009a){return function(_0x5b2da3){if(!_0x5b2da3){_0x49d2f9[_0xa511('0x28')](0x194);}return _0x5b2da3;};}function handleError(_0x172d95,_0x1b27f1){_0x1b27f1=_0x1b27f1||0x1f4;return function(_0x8fe18b){logger[_0xa511('0x23')](_0x8fe18b[_0xa511('0x36')]);if(_0x8fe18b[_0xa511('0x37')]){delete _0x8fe18b['name'];}_0x172d95[_0xa511('0x29')](_0x1b27f1)[_0xa511('0x38')](_0x8fe18b);};}exports[_0xa511('0x39')]=function(_0x7f655,_0x10ca73){var _0x357a12={},_0x244c45={},_0x1d44b9={'count':0x0,'rows':[]};var _0x257a4a=_[_0xa511('0x3a')](db[_0xa511('0x3b')][_0xa511('0x3c')],function(_0x1790a0){return{'name':_0x1790a0[_0xa511('0x3d')],'type':_0x1790a0['type'][_0xa511('0x3e')]};});_0x244c45['model']=_['map'](_0x257a4a,'name');_0x244c45['query']=_[_0xa511('0x3f')](_0x7f655[_0xa511('0x40')]);_0x244c45[_0xa511('0x41')]=_[_0xa511('0x42')](_0x244c45['model'],_0x244c45[_0xa511('0x40')]);_0x357a12[_0xa511('0x43')]=_[_0xa511('0x42')](_0x244c45[_0xa511('0x44')],qs['fields'](_0x7f655[_0xa511('0x40')][_0xa511('0x45')]));_0x357a12[_0xa511('0x43')]=_0x357a12[_0xa511('0x43')][_0xa511('0x46')]?_0x357a12[_0xa511('0x43')]:_0x244c45['model'];if(!_0x7f655[_0xa511('0x40')][_0xa511('0x47')]('nolimit')){_0x357a12[_0xa511('0x2d')]=qs[_0xa511('0x2d')](_0x7f655[_0xa511('0x40')][_0xa511('0x2d')]);_0x357a12[_0xa511('0x2c')]=qs[_0xa511('0x2c')](_0x7f655[_0xa511('0x40')][_0xa511('0x2c')]);}_0x357a12[_0xa511('0x48')]=qs['sort'](_0x7f655[_0xa511('0x40')][_0xa511('0x49')]);_0x357a12[_0xa511('0x4a')]=qs[_0xa511('0x41')](_[_0xa511('0x4b')](_0x7f655[_0xa511('0x40')],_0x244c45['filters']),_0x257a4a);if(_0x7f655[_0xa511('0x40')][_0xa511('0x4c')]){_0x357a12[_0xa511('0x4a')]=_['merge'](_0x357a12[_0xa511('0x4a')],{'$or':_['map'](_0x257a4a,function(_0x4fae8c){if(_0x4fae8c[_0xa511('0x4d')]!==_0xa511('0x4e')){var _0x53d3a0={};_0x53d3a0[_0x4fae8c[_0xa511('0x37')]]={'$like':'%'+_0x7f655[_0xa511('0x40')]['filter']+'%'};return _0x53d3a0;}})});}_0x357a12=_['merge']({},_0x357a12,_0x7f655['options']);var _0xdd4802={'where':_0x357a12[_0xa511('0x4a')]};return db[_0xa511('0x3b')][_0xa511('0x2b')](_0xdd4802)['then'](function(_0x209956){_0x1d44b9[_0xa511('0x2b')]=_0x209956;if(_0x7f655[_0xa511('0x40')]['includeAll']){_0x357a12['include']=[{'all':!![]}];}return db[_0xa511('0x3b')]['findAll'](_0x357a12);})[_0xa511('0x1d')](function(_0xd4c328){_0x1d44b9[_0xa511('0x4f')]=_0xd4c328;return _0x1d44b9;})[_0xa511('0x1d')](respondWithFilteredResult(_0x10ca73,_0x357a12))[_0xa511('0x27')](handleError(_0x10ca73,null));};exports['show']=function(_0x2b45e2,_0x39216d){var _0x2d6413={'raw':![],'where':{'id':_0x2b45e2['params']['id']}},_0x3e2ac9={};_0x3e2ac9[_0xa511('0x44')]=_[_0xa511('0x3f')](db['SalesforceAccount'][_0xa511('0x3c')]);_0x3e2ac9[_0xa511('0x40')]=_[_0xa511('0x3f')](_0x2b45e2[_0xa511('0x40')]);_0x3e2ac9[_0xa511('0x41')]=_[_0xa511('0x42')](_0x3e2ac9['model'],_0x3e2ac9[_0xa511('0x40')]);_0x2d6413['attributes']=_['intersection'](_0x3e2ac9['model'],qs[_0xa511('0x45')](_0x2b45e2[_0xa511('0x40')][_0xa511('0x45')]));_0x2d6413['attributes']=_0x2d6413[_0xa511('0x43')][_0xa511('0x46')]?_0x2d6413[_0xa511('0x43')]:_0x3e2ac9[_0xa511('0x44')];if(_0x2b45e2[_0xa511('0x40')][_0xa511('0x50')]){_0x2d6413[_0xa511('0x51')]=[{'all':!![]}];}_0x2d6413=_['merge']({},_0x2d6413,_0x2b45e2[_0xa511('0x52')]);return db[_0xa511('0x3b')][_0xa511('0x53')](_0x2d6413)[_0xa511('0x1d')](handleEntityNotFound(_0x39216d,null))['then'](respondWithResult(_0x39216d,null))[_0xa511('0x27')](handleError(_0x39216d,null));};exports[_0xa511('0x54')]=function(_0x331ef7,_0x16ad15){return db[_0xa511('0x3b')][_0xa511('0x54')](_0x331ef7[_0xa511('0x55')],{})[_0xa511('0x1d')](respondWithResult(_0x16ad15,0xc9))['catch'](handleError(_0x16ad15,null));};exports['update']=function(_0x4a66ba,_0x303410){if(_0x4a66ba[_0xa511('0x55')]['id']){delete _0x4a66ba[_0xa511('0x55')]['id'];}return db[_0xa511('0x3b')]['find']({'where':{'id':_0x4a66ba[_0xa511('0x56')]['id']}})['then'](handleEntityNotFound(_0x303410,null))[_0xa511('0x1d')](saveUpdates(_0x4a66ba[_0xa511('0x55')],null))['then'](respondWithResult(_0x303410,null))[_0xa511('0x27')](handleError(_0x303410,null));};exports[_0xa511('0x34')]=function(_0x523fe9,_0x59d9bd){return db[_0xa511('0x3b')][_0xa511('0x53')]({'where':{'id':_0x523fe9[_0xa511('0x56')]['id']}})['then'](handleEntityNotFound(_0x59d9bd,null))[_0xa511('0x1d')](removeEntity(_0x59d9bd,null))[_0xa511('0x27')](handleError(_0x59d9bd,null));};exports[_0xa511('0x57')]=function(_0x21266e,_0x150825,_0x41420f){var _0x3051bd={};var _0x40da85={};var _0x55ad3a;var _0x13a082;return db['SalesforceAccount'][_0xa511('0x58')]({'where':{'id':_0x21266e['params']['id']}})[_0xa511('0x1d')](handleEntityNotFound(_0x150825,null))[_0xa511('0x1d')](function(_0x1604c3){if(_0x1604c3){_0x55ad3a=_0x1604c3;_0x40da85['model']=_['keys'](db[_0xa511('0x59')][_0xa511('0x3c')]);_0x40da85[_0xa511('0x40')]=_['keys'](_0x21266e[_0xa511('0x40')]);_0x40da85['filters']=_[_0xa511('0x42')](_0x40da85[_0xa511('0x44')],_0x40da85[_0xa511('0x40')]);_0x3051bd['attributes']=_[_0xa511('0x42')](_0x40da85[_0xa511('0x44')],qs[_0xa511('0x45')](_0x21266e[_0xa511('0x40')]['fields']));_0x3051bd[_0xa511('0x43')]=_0x3051bd['attributes'][_0xa511('0x46')]?_0x3051bd['attributes']:_0x40da85[_0xa511('0x44')];_0x3051bd['order']=qs[_0xa511('0x49')](_0x21266e[_0xa511('0x40')][_0xa511('0x49')]);_0x3051bd[_0xa511('0x4a')]=qs[_0xa511('0x41')](_['pick'](_0x21266e[_0xa511('0x40')],_0x40da85[_0xa511('0x41')]));if(_0x21266e[_0xa511('0x40')][_0xa511('0x4c')]){_0x3051bd['where']=_[_0xa511('0x5a')](_0x3051bd[_0xa511('0x4a')],{'$or':_[_0xa511('0x3a')](_0x3051bd[_0xa511('0x43')],function(_0x25e9ba){var _0x2b6ba1={};_0x2b6ba1[_0x25e9ba]={'$like':'%'+_0x21266e[_0xa511('0x40')][_0xa511('0x4c')]+'%'};return _0x2b6ba1;})});}_0x3051bd=_[_0xa511('0x5a')]({},_0x3051bd,_0x21266e[_0xa511('0x52')]);return _0x55ad3a[_0xa511('0x57')](_0x3051bd);}})[_0xa511('0x1d')](function(_0x1573d3){if(_0x1573d3){_0x13a082=_0x1573d3[_0xa511('0x46')];if(!_0x21266e[_0xa511('0x40')][_0xa511('0x47')](_0xa511('0x5b'))){_0x3051bd[_0xa511('0x2d')]=qs[_0xa511('0x2d')](_0x21266e[_0xa511('0x40')][_0xa511('0x2d')]);_0x3051bd['offset']=qs[_0xa511('0x2c')](_0x21266e['query']['offset']);}return _0x55ad3a[_0xa511('0x57')](_0x3051bd);}})['then'](function(_0x391488){if(_0x391488){return _0x391488?{'count':_0x13a082,'rows':_0x391488}:null;}})['then'](respondWithResult(_0x150825,null))[_0xa511('0x27')](handleError(_0x150825,null));};exports[_0xa511('0x5c')]=function(_0x3f25e2,_0x370615,_0x5062df){if(_0x3f25e2['body']['id']){delete _0x3f25e2['body']['id'];}return db[_0xa511('0x3b')]['findOne']({'where':{'id':_0x3f25e2[_0xa511('0x56')]['id']}})[_0xa511('0x1d')](handleEntityNotFound(_0x370615,null))[_0xa511('0x1d')](function(_0x342f05){if(_0x342f05){_0x3f25e2['body']['AccountId']=_0x342f05['id'];_0x3f25e2[_0xa511('0x55')][_0xa511('0x5d')]=integrations[_0xa511('0x5e')](_0x3f25e2[_0xa511('0x55')]['channel'],_0x3f25e2[_0xa511('0x55')][_0xa511('0x4d')]);_0x3f25e2[_0xa511('0x55')]['Descriptions']=integrations[_0xa511('0x5f')](_0x3f25e2[_0xa511('0x55')][_0xa511('0x60')],_0x3f25e2[_0xa511('0x55')][_0xa511('0x4d')]);return db['SalesforceConfiguration']['create'](_0x3f25e2['body'],{'include':[{'model':db[_0xa511('0x61')],'as':_0xa511('0x5d')},{'model':db[_0xa511('0x61')],'as':'Descriptions'}]});}return null;})[_0xa511('0x1d')](respondWithResult(_0x370615,null))[_0xa511('0x27')](handleError(_0x370615,null));};exports[_0xa511('0x62')]=function(_0xe2a9ea,_0x5d3203,_0x11e965){var _0x2de987;var _0x540770='';var _0x2eebe1=_0xa511('0x63');return db['SalesforceAccount'][_0xa511('0x58')]({'where':{'id':_0xe2a9ea[_0xa511('0x56')]['id']},'attributes':['id',_0xa511('0x64'),'clientId','clientSecret','username',_0xa511('0x65'),_0xa511('0x66')]})[_0xa511('0x1d')](handleEntityNotFound(_0x5d3203,null))[_0xa511('0x1d')](function(_0x4eae89){if(_0x4eae89){_0x540770=_0x4eae89['remoteUri'];var _0x481717=_0x540770[_0xa511('0x67')](-0x1);if(_0x481717==='/'){_0x540770=_0x540770[_0xa511('0x68')](0x0,_0x540770[_0xa511('0x69')](_0x481717));}_0x2de987=new jsforce['Connection']({'oauth2':{'loginUrl':_0x540770,'clientId':_0x4eae89[_0xa511('0x6a')],'clientSecret':_0x4eae89[_0xa511('0x6b')]}});return _0x2de987[_0xa511('0x6c')](_0x4eae89[_0xa511('0x6d')],_0x4eae89[_0xa511('0x65')][_0xa511('0x6e')](_0x4eae89[_0xa511('0x66')]));}})[_0xa511('0x1d')](function(_0x106c36){if(_0x106c36){if(!_[_0xa511('0x6f')](_0xe2a9ea[_0xa511('0x40')]['ticketType'])){_0x2eebe1=_0xe2a9ea[_0xa511('0x40')][_0xa511('0x70')];}return _0x2de987[_0xa511('0x71')](_0x2eebe1)[_0xa511('0x72')]();}})[_0xa511('0x1d')](function(_0x4010cb){var _0x28ecba=[_0xa511('0x73'),_0xa511('0x74'),_0xa511('0x75'),'IsRecurrence',_0xa511('0x76'),_0xa511('0x77')];var _0x357caf=['string',_0xa511('0x78'),_0xa511('0x79'),'boolean',_0xa511('0x7a'),_0xa511('0x7b'),_0xa511('0x7c')];if(_0x4010cb){_['remove'](_0x4010cb[_0xa511('0x45')],function(_0x154813){return _0x28ecba['includes'](_0x154813[_0xa511('0x37')])||!_0x357caf[_0xa511('0x7d')](_0x154813[_0xa511('0x4d')]);});return{'count':_0x4010cb[_0xa511('0x45')][_0xa511('0x46')],'rows':_[_0xa511('0x3a')](_0x4010cb[_0xa511('0x45')],function(_0x15bdfa){return{'id':_0x15bdfa[_0xa511('0x37')],'name':_0x15bdfa[_0xa511('0x7e')],'custom':_0x15bdfa[_0xa511('0x7f')],'options':_0x15bdfa[_0xa511('0x80')][_0xa511('0x46')]>0x0?_[_0xa511('0x3a')](_0x15bdfa['picklistValues'],function(_0x9a5b84){return{'name':_0x9a5b84[_0xa511('0x7e')],'value':_0x9a5b84[_0xa511('0x81')]};}):_0x15bdfa[_0xa511('0x4d')]==_0xa511('0x82')?[{'name':_0xa511('0x83'),'value':_0xa511('0x84')},{'name':'False','value':'false'}]:[]};})};}})[_0xa511('0x1d')](respondWithResult(_0x5d3203,null))[_0xa511('0x27')](function(_0x637055){var _0x18649c=_0xe2a9ea['query']['test']?0x1f4:_0x637055[_0xa511('0x85')]||0x1f4;logger[_0xa511('0x23')](_0xa511('0x86'),_0xa511('0x62'),_0x18649c,JSON[_0xa511('0x87')](_0x637055));delete _0x637055[_0xa511('0x37')];if(_0x18649c===0x191){_0x18649c=0x190;}_0x5d3203[_0xa511('0x29')](_0x18649c)[_0xa511('0x38')](_0xe2a9ea[_0xa511('0x40')][_0xa511('0x88')]?{'message':_0xa511('0x89'),'statusCode':_0x637055[_0xa511('0x85')]}:_0x637055);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 55adb52..30339ca 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 _0xcc29=['util','api','moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0xcc29,0x1ae));var _0x9cc2=function(_0xa16351,_0xc8494f){_0xa16351=_0xa16351-0x0;var _0x35712c=_0xcc29[_0xa16351];return _0x35712c;};'use strict';var _=require('lodash');var util=require(_0x9cc2('0x0'));var logger=require('../../config/logger')(_0x9cc2('0x1'));var moment=require(_0x9cc2('0x2'));var BPromise=require('bluebird');var rp=require(_0x9cc2('0x3'));var fs=require('fs');var path=require(_0x9cc2('0x4'));var rimraf=require(_0x9cc2('0x5'));var config=require(_0x9cc2('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x9cc2('0x7'));module['exports']=function(_0x2a051d,_0x5e5d16){return _0x2a051d['define'](_0x9cc2('0x8'),attributes,{'tableName':_0x9cc2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcec0=['define','lodash','../../config/logger','bluebird','request-promise','../../config/environment','exports'];(function(_0x5d0ca9,_0x47f08d){var _0x366d01=function(_0xf7f96a){while(--_0xf7f96a){_0x5d0ca9['push'](_0x5d0ca9['shift']());}};_0x366d01(++_0x47f08d);}(_0xcec0,0x1ba));var _0x0cec=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xcec0[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x0cec('0x0'));var util=require('util');var logger=require(_0x0cec('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0cec('0x2'));var rp=require(_0x0cec('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0cec('0x4'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0cec('0x5')]=function(_0x401bf8,_0x3d92a2){return _0x401bf8[_0x0cec('0x6')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','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 818c8c8..4ece62d 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 _0xf4eb=['SalesforceAccount','findAll','options','where','attributes','limit','map','model','include','find','raw','ShowSalesforceAccount','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetSalesforceAccount'];(function(_0x55a117,_0x398e0c){var _0x13130a=function(_0x1f360d){while(--_0x1f360d){_0x55a117['push'](_0x55a117['shift']());}};_0x13130a(++_0x398e0c);}(_0xf4eb,0xec));var _0xbf4e=function(_0xb23baf,_0x3ca8b6){_0xb23baf=_0xb23baf-0x0;var _0x4a631b=_0xf4eb[_0xb23baf];return _0x4a631b;};'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')]('SalesforceAccount,\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')]('SalesforceAccount,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}exports[_0xbf4e('0x13')]=function(_0x577c27){var _0x5db03f=this;return new Promise(function(_0x566ec3,_0x4f8762){return db[_0xbf4e('0x14')][_0xbf4e('0x15')]({'raw':_0x577c27[_0xbf4e('0x16')]?_0x577c27['options']['raw']===undefined?!![]:![]:!![],'where':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x17')]||null:null,'attributes':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x18')]||null:null,'limit':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x19')]||null:null,'include':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')]['include']?_[_0xbf4e('0x1a')](_0x577c27[_0xbf4e('0x16')]['include'],function(_0x31e3f5){return{'model':db[_0x31e3f5[_0xbf4e('0x1b')]],'as':_0x31e3f5['as'],'attributes':_0x31e3f5[_0xbf4e('0x18')],'include':_0x31e3f5[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x31e3f5['include'],function(_0x90635e){return{'model':db[_0x90635e[_0xbf4e('0x1b')]],'as':_0x90635e['as'],'attributes':_0x90635e[_0xbf4e('0x18')],'include':_0x90635e['include']?_[_0xbf4e('0x1a')](_0x90635e['include'],function(_0x5bcf71){return{'model':db[_0x5bcf71[_0xbf4e('0x1b')]],'as':_0x5bcf71['as'],'attributes':_0x5bcf71['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf4e('0x9')](function(_0x315df3){logger[_0xbf4e('0xa')](_0xbf4e('0x13'),_0x577c27);logger['debug'](_0xbf4e('0x13'),_0x577c27,JSON[_0xbf4e('0xe')](_0x315df3));_0x566ec3(_0x315df3);})[_0xbf4e('0x12')](function(_0x4cd4a1){logger[_0xbf4e('0xf')]('GetSalesforceAccount',_0x4cd4a1[_0xbf4e('0x11')],_0x577c27);_0x4f8762(_0x5db03f[_0xbf4e('0xf')](0x1f4,_0x4cd4a1[_0xbf4e('0x11')]));});});};exports['ShowSalesforceAccount']=function(_0x1d12e2){var _0x362716=this;return new Promise(function(_0x2f3cf8,_0xc7ca87){return db[_0xbf4e('0x14')][_0xbf4e('0x1d')]({'raw':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')][_0xbf4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')][_0xbf4e('0x17')]||null:null,'attributes':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')]['attributes']||null:null,'include':_0x1d12e2[_0xbf4e('0x16')]?_0x1d12e2['options'][_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x1d12e2[_0xbf4e('0x16')]['include'],function(_0x2716b7){return{'model':db[_0x2716b7[_0xbf4e('0x1b')]],'as':_0x2716b7['as'],'attributes':_0x2716b7[_0xbf4e('0x18')],'include':_0x2716b7[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x2716b7[_0xbf4e('0x1c')],function(_0x5b8440){return{'model':db[_0x5b8440[_0xbf4e('0x1b')]],'as':_0x5b8440['as'],'attributes':_0x5b8440[_0xbf4e('0x18')],'include':_0x5b8440[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x5b8440[_0xbf4e('0x1c')],function(_0x5b7ea1){return{'model':db[_0x5b7ea1['model']],'as':_0x5b7ea1['as'],'attributes':_0x5b7ea1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x429c07){logger[_0xbf4e('0xa')](_0xbf4e('0x1f'),_0x1d12e2);logger[_0xbf4e('0xd')](_0xbf4e('0x1f'),_0x1d12e2,JSON[_0xbf4e('0xe')](_0x429c07));_0x2f3cf8(_0x429c07);})[_0xbf4e('0x12')](function(_0x467b74){logger[_0xbf4e('0xf')]('ShowSalesforceAccount',_0x467b74['message'],_0x1d12e2);_0xc7ca87(_0x362716[_0xbf4e('0xf')](0x1f4,_0x467b74[_0xbf4e('0x11')]));});});}; \ No newline at end of file +var _0xb332=['catch','SalesforceAccount','findAll','options','raw','where','attributes','include','map','model','GetSalesforceAccount','find','ShowSalesforceAccount','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result'];(function(_0x56489a,_0x1323f0){var _0x2b22c9=function(_0x165f67){while(--_0x165f67){_0x56489a['push'](_0x56489a['shift']());}};_0x2b22c9(++_0x1323f0);}(_0xb332,0xd9));var _0x2b33=function(_0x385eb1,_0x497a94){_0x385eb1=_0x385eb1-0x0;var _0x5d40eb=_0xb332[_0x385eb1];return _0x5d40eb;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var moment=require(_0x2b33('0x1'));var BPromise=require(_0x2b33('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b33('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b33('0x4'));var logger=require('../../config/logger')(_0x2b33('0x5'));var config=require('../../config/environment');var jayson=require(_0x2b33('0x6'));var client=jayson[_0x2b33('0x7')][_0x2b33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x461d44,_0x5a7a3f,_0x5ccf2d){return new BPromise(function(_0x4302b7,_0x5f29ab){return client[_0x2b33('0x9')](_0x461d44,_0x5ccf2d)[_0x2b33('0xa')](function(_0x2f2cb3){logger[_0x2b33('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x5a7a3f,_0x2b33('0xc'));logger[_0x2b33('0xd')](_0x2b33('0xe'),_0x5a7a3f,_0x2b33('0xc'),JSON[_0x2b33('0xf')](_0x2f2cb3));if(_0x2f2cb3[_0x2b33('0x10')]){if(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x11')]===0x1f4){logger[_0x2b33('0x10')](_0x2b33('0x12'),_0x5a7a3f,_0x2f2cb3[_0x2b33('0x10')]['message']);return _0x5f29ab(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x13')]);}logger[_0x2b33('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x5a7a3f,_0x2f2cb3[_0x2b33('0x10')]['message']);return _0x4302b7(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x13')]);}else{logger[_0x2b33('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x5a7a3f,'request\x20sent');_0x4302b7(_0x2f2cb3[_0x2b33('0x14')][_0x2b33('0x13')]);}})[_0x2b33('0x15')](function(_0x2f5119){logger[_0x2b33('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x5a7a3f,_0x2f5119);_0x5f29ab(_0x2f5119);});});}exports['GetSalesforceAccount']=function(_0x59f0b6){var _0x4041bd=this;return new Promise(function(_0x4f10c4,_0x543d52){return db[_0x2b33('0x16')][_0x2b33('0x17')]({'raw':_0x59f0b6[_0x2b33('0x18')]?_0x59f0b6['options'][_0x2b33('0x19')]===undefined?!![]:![]:!![],'where':_0x59f0b6['options']?_0x59f0b6[_0x2b33('0x18')][_0x2b33('0x1a')]||null:null,'attributes':_0x59f0b6[_0x2b33('0x18')]?_0x59f0b6[_0x2b33('0x18')][_0x2b33('0x1b')]||null:null,'limit':_0x59f0b6[_0x2b33('0x18')]?_0x59f0b6[_0x2b33('0x18')]['limit']||null:null,'include':_0x59f0b6[_0x2b33('0x18')]?_0x59f0b6[_0x2b33('0x18')][_0x2b33('0x1c')]?_[_0x2b33('0x1d')](_0x59f0b6[_0x2b33('0x18')][_0x2b33('0x1c')],function(_0x27f1b8){return{'model':db[_0x27f1b8[_0x2b33('0x1e')]],'as':_0x27f1b8['as'],'attributes':_0x27f1b8['attributes'],'include':_0x27f1b8[_0x2b33('0x1c')]?_[_0x2b33('0x1d')](_0x27f1b8[_0x2b33('0x1c')],function(_0x32b835){return{'model':db[_0x32b835['model']],'as':_0x32b835['as'],'attributes':_0x32b835[_0x2b33('0x1b')],'include':_0x32b835['include']?_[_0x2b33('0x1d')](_0x32b835['include'],function(_0x2e74d0){return{'model':db[_0x2e74d0[_0x2b33('0x1e')]],'as':_0x2e74d0['as'],'attributes':_0x2e74d0['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b33('0xa')](function(_0x53c2ad){logger[_0x2b33('0xb')]('GetSalesforceAccount',_0x59f0b6);logger[_0x2b33('0xd')](_0x2b33('0x1f'),_0x59f0b6,JSON[_0x2b33('0xf')](_0x53c2ad));_0x4f10c4(_0x53c2ad);})[_0x2b33('0x15')](function(_0xaa6643){logger[_0x2b33('0x10')](_0x2b33('0x1f'),_0xaa6643[_0x2b33('0x13')],_0x59f0b6);_0x543d52(_0x4041bd[_0x2b33('0x10')](0x1f4,_0xaa6643[_0x2b33('0x13')]));});});};exports['ShowSalesforceAccount']=function(_0x5b6527){var _0x106ea0=this;return new Promise(function(_0x2a081c,_0x3282bf){return db[_0x2b33('0x16')][_0x2b33('0x20')]({'raw':_0x5b6527['options']?_0x5b6527['options'][_0x2b33('0x19')]===undefined?!![]:![]:!![],'where':_0x5b6527[_0x2b33('0x18')]?_0x5b6527[_0x2b33('0x18')][_0x2b33('0x1a')]||null:null,'attributes':_0x5b6527[_0x2b33('0x18')]?_0x5b6527[_0x2b33('0x18')]['attributes']||null:null,'include':_0x5b6527[_0x2b33('0x18')]?_0x5b6527['options'][_0x2b33('0x1c')]?_[_0x2b33('0x1d')](_0x5b6527[_0x2b33('0x18')][_0x2b33('0x1c')],function(_0x594d66){return{'model':db[_0x594d66[_0x2b33('0x1e')]],'as':_0x594d66['as'],'attributes':_0x594d66[_0x2b33('0x1b')],'include':_0x594d66[_0x2b33('0x1c')]?_[_0x2b33('0x1d')](_0x594d66[_0x2b33('0x1c')],function(_0x782a64){return{'model':db[_0x782a64[_0x2b33('0x1e')]],'as':_0x782a64['as'],'attributes':_0x782a64[_0x2b33('0x1b')],'include':_0x782a64[_0x2b33('0x1c')]?_[_0x2b33('0x1d')](_0x782a64[_0x2b33('0x1c')],function(_0x565c14){return{'model':db[_0x565c14['model']],'as':_0x565c14['as'],'attributes':_0x565c14['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b33('0xa')](function(_0xcaf635){logger[_0x2b33('0xb')](_0x2b33('0x21'),_0x5b6527);logger[_0x2b33('0xd')]('ShowSalesforceAccount',_0x5b6527,JSON['stringify'](_0xcaf635));_0x2a081c(_0xcaf635);})[_0x2b33('0x15')](function(_0x4c3997){logger[_0x2b33('0x10')](_0x2b33('0x21'),_0x4c3997[_0x2b33('0x13')],_0x5b6527);_0x3282bf(_0x106ea0[_0x2b33('0x10')](0x1f4,_0x4c3997[_0x2b33('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index cbe949f..00cb43b 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 _0xbf35=['show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xbf35,0xb4));var _0x5bf3=function(_0x30f91a,_0x2b3e77){_0x30f91a=_0x30f91a-0x0;var _0x268def=_0xbf35[_0x30f91a];return _0x268def;};'use strict';var multer=require(_0x5bf3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5bf3('0x1'));var express=require(_0x5bf3('0x2'));var router=express[_0x5bf3('0x3')]();var fs_extra=require(_0x5bf3('0x4'));var auth=require(_0x5bf3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5bf3('0x6'));var controller=require(_0x5bf3('0x7'));router[_0x5bf3('0x8')]('/',auth[_0x5bf3('0x9')](),controller[_0x5bf3('0xa')]);router['get'](_0x5bf3('0xb'),auth[_0x5bf3('0x9')](),controller[_0x5bf3('0xc')]);router[_0x5bf3('0x8')](_0x5bf3('0xd'),auth[_0x5bf3('0x9')](),controller['getFields']);router[_0x5bf3('0x8')](_0x5bf3('0xe'),auth[_0x5bf3('0x9')](),controller[_0x5bf3('0xf')]);router[_0x5bf3('0x8')](_0x5bf3('0x10'),auth[_0x5bf3('0x9')](),controller[_0x5bf3('0x11')]);router[_0x5bf3('0x12')]('/',auth['isAuthenticated'](),controller[_0x5bf3('0x13')]);router[_0x5bf3('0x14')]('/:id',auth[_0x5bf3('0x9')](),controller[_0x5bf3('0x15')]);router[_0x5bf3('0x16')](_0x5bf3('0xb'),auth[_0x5bf3('0x9')](),controller['destroy']);module[_0x5bf3('0x17')]=router; \ No newline at end of file +var _0xed1c=['express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','delete','destroy','multer','util','connect-timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xed1c,0x131));var _0xced1=function(_0x39ac6e,_0x3d9e6d){_0x39ac6e=_0x39ac6e-0x0;var _0x789fea=_0xed1c[_0x39ac6e];return _0x789fea;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require(_0xced1('0x2'));var express=require(_0xced1('0x3'));var router=express[_0xced1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xced1('0x5'));var interaction=require(_0xced1('0x6'));var config=require('../../config/environment');var controller=require(_0xced1('0x7'));router[_0xced1('0x8')]('/',auth[_0xced1('0x9')](),controller[_0xced1('0xa')]);router[_0xced1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xced1('0xb')]);router[_0xced1('0x8')](_0xced1('0xc'),auth[_0xced1('0x9')](),controller[_0xced1('0xd')]);router['get'](_0xced1('0xe'),auth[_0xced1('0x9')](),controller[_0xced1('0xf')]);router[_0xced1('0x8')]('/:id/descriptions',auth[_0xced1('0x9')](),controller[_0xced1('0x10')]);router[_0xced1('0x11')]('/',auth[_0xced1('0x9')](),controller[_0xced1('0x12')]);router['put']('/:id',auth[_0xced1('0x9')](),controller[_0xced1('0x13')]);router[_0xced1('0x14')]('/:id',auth[_0xced1('0x9')](),controller[_0xced1('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 9521144..531fe4e 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 _0x09ed=['account_contact_lead','nothing','account','lead','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x41e0f5,_0x23a841){var _0x20fa91=function(_0x421dd5){while(--_0x421dd5){_0x41e0f5['push'](_0x41e0f5['shift']());}};_0x20fa91(++_0x23a841);}(_0x09ed,0x178));var _0xd09e=function(_0x394248,_0x560a63){_0x394248=_0x394248-0x0;var _0x5c50c0=_0x09ed[_0x394248];return _0x5c50c0;};'use strict';var Sequelize=require(_0xd09e('0x0'));module[_0xd09e('0x1')]={'name':{'type':Sequelize[_0xd09e('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xd09e('0x3')](_0xd09e('0x4'),_0xd09e('0x5')),'defaultValue':_0xd09e('0x4')},'moduleSearch':{'type':Sequelize[_0xd09e('0x3')](_0xd09e('0x6'),_0xd09e('0x7'),'lead',_0xd09e('0x8'),'account'),'defaultValue':_0xd09e('0x6')},'moduleCreate':{'type':Sequelize[_0xd09e('0x3')](_0xd09e('0x9'),_0xd09e('0x7'),'lead',_0xd09e('0xa')),'defaultValue':_0xd09e('0xb')},'leadId':{'type':Sequelize[_0xd09e('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xd09e('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9490=['STRING','Task','ENUM','contact_lead','contact','lead','account_contact_lead','account','sequelize','exports'];(function(_0x100789,_0x41a69c){var _0x274c37=function(_0x10cdcb){while(--_0x10cdcb){_0x100789['push'](_0x100789['shift']());}};_0x274c37(++_0x41a69c);}(_0x9490,0x148));var _0x0949=function(_0x214a08,_0xe13a1){_0x214a08=_0x214a08-0x0;var _0x3472bb=_0x9490[_0x214a08];return _0x3472bb;};'use strict';var Sequelize=require(_0x0949('0x0'));module[_0x0949('0x1')]={'name':{'type':Sequelize[_0x0949('0x2')]},'description':{'type':Sequelize[_0x0949('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x0949('0x3'),'Case'),'defaultValue':_0x0949('0x3')},'moduleSearch':{'type':Sequelize[_0x0949('0x4')](_0x0949('0x5'),_0x0949('0x6'),_0x0949('0x7'),_0x0949('0x8'),_0x0949('0x9')),'defaultValue':_0x0949('0x5')},'moduleCreate':{'type':Sequelize[_0x0949('0x4')]('nothing',_0x0949('0x6'),'lead',_0x0949('0x9')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x0949('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x0949('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x0949('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x0949('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index eabfa9f..27271d2 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 _0xac93=['end','sendStatus','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','count','findAll','rows','show','params','includeAll','find','create','body','getFields','findOne','SalesforceField','nolimit','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy'];(function(_0x30ea66,_0x3dec2b){var _0x5333d5=function(_0x41675d){while(--_0x41675d){_0x30ea66['push'](_0x30ea66['shift']());}};_0x5333d5(++_0x3dec2b);}(_0xac93,0x1dc));var _0x3ac9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xac93[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x3ac9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3ac9('0x1'));var rp=require(_0x3ac9('0x2'));var moment=require(_0x3ac9('0x3'));var BPromise=require(_0x3ac9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3ac9('0x5'));var sox=require(_0x3ac9('0x6'));var csv=require(_0x3ac9('0x7'));var ejs=require(_0x3ac9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3ac9('0x9'));var crypto=require('crypto');var jsforce=require(_0x3ac9('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3ac9('0x7'));var querystring=require('querystring');var Papa=require(_0x3ac9('0xb'));var Redis=require(_0x3ac9('0xc'));var authService=require(_0x3ac9('0xd'));var qs=require(_0x3ac9('0xe'));var as=require(_0x3ac9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ac9('0x10'))(_0x3ac9('0x11'));var utils=require(_0x3ac9('0x12'));var config=require(_0x3ac9('0x13'));var licenseUtil=require(_0x3ac9('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x3ac9('0x15'));var client=jayson[_0x3ac9('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21745a,_0x11cf53,_0x25f7a7,_0x316726){return new BPromise(function(_0x4da078,_0x111fa8){var _0xd962a5=_0x316726||client;return _0xd962a5['request'](_0x21745a,_0x25f7a7)[_0x3ac9('0x17')](function(_0x3b34d2){logger[_0x3ac9('0x18')](_0x3ac9('0x19'),_0x11cf53,_0x3ac9('0x1a'));logger[_0x3ac9('0x1b')](_0x3ac9('0x1c'),_0x11cf53,_0x3ac9('0x1a'),JSON[_0x3ac9('0x1d')](_0x3b34d2));if(_0x3b34d2[_0x3ac9('0x1e')]){if(_0x3b34d2['error'][_0x3ac9('0x1f')]===0x1f4){logger[_0x3ac9('0x1e')](_0x3ac9('0x19'),_0x11cf53,_0x3b34d2['error'][_0x3ac9('0x20')]);return _0x111fa8(_0x3b34d2[_0x3ac9('0x1e')][_0x3ac9('0x20')]);}logger['error'](_0x3ac9('0x19'),_0x11cf53,_0x3b34d2[_0x3ac9('0x1e')][_0x3ac9('0x20')]);return _0x4da078(_0x3b34d2[_0x3ac9('0x1e')][_0x3ac9('0x20')]);}else{logger[_0x3ac9('0x18')](_0x3ac9('0x19'),_0x11cf53,_0x3ac9('0x1a'));_0x4da078(_0x3b34d2[_0x3ac9('0x21')]['message']);}})[_0x3ac9('0x22')](function(_0x33295e){logger[_0x3ac9('0x1e')](_0x3ac9('0x19'),_0x11cf53,_0x33295e);_0x111fa8(_0x33295e);});});}function respondWithStatusCode(_0x3d80cb,_0x5bdc39){_0x5bdc39=_0x5bdc39||0xcc;return function(_0x3f4bf3){if(_0x3f4bf3){return _0x3d80cb['sendStatus'](_0x5bdc39);}return _0x3d80cb['status'](_0x5bdc39)['end']();};}function respondWithResult(_0x2a802a,_0x45d213){_0x45d213=_0x45d213||0xc8;return function(_0x38b2de){if(_0x38b2de){return _0x2a802a[_0x3ac9('0x23')](_0x45d213)['json'](_0x38b2de);}};}function respondWithFilteredResult(_0x7f6839,_0x53f982){return function(_0x18b864){if(_0x18b864){var _0x534900=_0x18b864['count'],_0x39aea4=_0x53f982[_0x3ac9('0x24')],_0x40c7db=_0x53f982[_0x3ac9('0x24')]+_0x53f982[_0x3ac9('0x25')],_0x43dfab;if(_0x40c7db>=_0x534900){_0x40c7db=_0x534900;_0x43dfab=0xc8;}else{_0x43dfab=0xce;}_0x7f6839[_0x3ac9('0x23')](_0x43dfab);return _0x7f6839[_0x3ac9('0x26')](_0x3ac9('0x27'),_0x39aea4+'-'+_0x40c7db+'/'+_0x534900)[_0x3ac9('0x28')](_0x18b864);}return null;};}function patchUpdates(_0x125f78){return function(_0x1d134f){try{jsonpatch[_0x3ac9('0x29')](_0x1d134f,_0x125f78,!![]);}catch(_0x243b16){return BPromise[_0x3ac9('0x2a')](_0x243b16);}return _0x1d134f[_0x3ac9('0x2b')]();};}function saveUpdates(_0x486f17,_0x1c2929){return function(_0x4a7f13){if(_0x4a7f13){return _0x4a7f13[_0x3ac9('0x2c')](_0x486f17)[_0x3ac9('0x17')](function(_0x23001b){return _0x23001b;});}return null;};}function removeEntity(_0x5da002,_0x22f29b){return function(_0x475245){if(_0x475245){return _0x475245[_0x3ac9('0x2d')]()[_0x3ac9('0x17')](function(){_0x5da002[_0x3ac9('0x23')](0xcc)[_0x3ac9('0x2e')]();});}};}function handleEntityNotFound(_0x5a2000,_0x397314){return function(_0x2172c9){if(!_0x2172c9){_0x5a2000[_0x3ac9('0x2f')](0x194);}return _0x2172c9;};}function handleError(_0x5b2c11,_0x11a093){_0x11a093=_0x11a093||0x1f4;return function(_0x56e1a0){logger[_0x3ac9('0x1e')](_0x56e1a0[_0x3ac9('0x30')]);if(_0x56e1a0[_0x3ac9('0x31')]){delete _0x56e1a0[_0x3ac9('0x31')];}_0x5b2c11[_0x3ac9('0x23')](_0x11a093)['send'](_0x56e1a0);};}exports[_0x3ac9('0x32')]=function(_0x3e19ec,_0x1ea57f){var _0x27293f={},_0x1f24de={},_0x4d545d={'count':0x0,'rows':[]};var _0x166582=_[_0x3ac9('0x33')](db[_0x3ac9('0x34')][_0x3ac9('0x35')],function(_0x4a4bdb){return{'name':_0x4a4bdb[_0x3ac9('0x36')],'type':_0x4a4bdb[_0x3ac9('0x37')]['key']};});_0x1f24de['model']=_['map'](_0x166582,_0x3ac9('0x31'));_0x1f24de[_0x3ac9('0x38')]=_[_0x3ac9('0x39')](_0x3e19ec[_0x3ac9('0x38')]);_0x1f24de['filters']=_[_0x3ac9('0x3a')](_0x1f24de[_0x3ac9('0x3b')],_0x1f24de['query']);_0x27293f[_0x3ac9('0x3c')]=_[_0x3ac9('0x3a')](_0x1f24de[_0x3ac9('0x3b')],qs['fields'](_0x3e19ec['query'][_0x3ac9('0x3d')]));_0x27293f['attributes']=_0x27293f[_0x3ac9('0x3c')][_0x3ac9('0x3e')]?_0x27293f[_0x3ac9('0x3c')]:_0x1f24de[_0x3ac9('0x3b')];if(!_0x3e19ec[_0x3ac9('0x38')][_0x3ac9('0x3f')]('nolimit')){_0x27293f[_0x3ac9('0x25')]=qs['limit'](_0x3e19ec[_0x3ac9('0x38')][_0x3ac9('0x25')]);_0x27293f[_0x3ac9('0x24')]=qs[_0x3ac9('0x24')](_0x3e19ec[_0x3ac9('0x38')]['offset']);}_0x27293f[_0x3ac9('0x40')]=qs[_0x3ac9('0x41')](_0x3e19ec[_0x3ac9('0x38')]['sort']);_0x27293f['where']=qs[_0x3ac9('0x42')](_[_0x3ac9('0x43')](_0x3e19ec[_0x3ac9('0x38')],_0x1f24de['filters']),_0x166582);if(_0x3e19ec[_0x3ac9('0x38')][_0x3ac9('0x44')]){_0x27293f['where']=_['merge'](_0x27293f[_0x3ac9('0x45')],{'$or':_[_0x3ac9('0x33')](_0x166582,function(_0x4d13de){if(_0x4d13de[_0x3ac9('0x37')]!=='VIRTUAL'){var _0x49ef13={};_0x49ef13[_0x4d13de[_0x3ac9('0x31')]]={'$like':'%'+_0x3e19ec['query']['filter']+'%'};return _0x49ef13;}})});}_0x27293f=_[_0x3ac9('0x46')]({},_0x27293f,_0x3e19ec[_0x3ac9('0x47')]);var _0x3f7f03={'where':_0x27293f['where']};return db[_0x3ac9('0x34')]['count'](_0x3f7f03)[_0x3ac9('0x17')](function(_0x116b6b){_0x4d545d[_0x3ac9('0x48')]=_0x116b6b;if(_0x3e19ec[_0x3ac9('0x38')]['includeAll']){_0x27293f['include']=[{'all':!![]}];}return db[_0x3ac9('0x34')][_0x3ac9('0x49')](_0x27293f);})[_0x3ac9('0x17')](function(_0x114e6c){_0x4d545d[_0x3ac9('0x4a')]=_0x114e6c;return _0x4d545d;})['then'](respondWithFilteredResult(_0x1ea57f,_0x27293f))[_0x3ac9('0x22')](handleError(_0x1ea57f,null));};exports[_0x3ac9('0x4b')]=function(_0x1a870a,_0x47b204){var _0x3efa36={'raw':![],'where':{'id':_0x1a870a[_0x3ac9('0x4c')]['id']}},_0x589e4b={};_0x589e4b[_0x3ac9('0x3b')]=_['keys'](db[_0x3ac9('0x34')][_0x3ac9('0x35')]);_0x589e4b[_0x3ac9('0x38')]=_[_0x3ac9('0x39')](_0x1a870a['query']);_0x589e4b[_0x3ac9('0x42')]=_[_0x3ac9('0x3a')](_0x589e4b[_0x3ac9('0x3b')],_0x589e4b[_0x3ac9('0x38')]);_0x3efa36['attributes']=_[_0x3ac9('0x3a')](_0x589e4b[_0x3ac9('0x3b')],qs['fields'](_0x1a870a[_0x3ac9('0x38')][_0x3ac9('0x3d')]));_0x3efa36['attributes']=_0x3efa36[_0x3ac9('0x3c')][_0x3ac9('0x3e')]?_0x3efa36[_0x3ac9('0x3c')]:_0x589e4b['model'];if(_0x1a870a['query'][_0x3ac9('0x4d')]){_0x3efa36['include']=[{'all':!![]}];}_0x3efa36=_['merge']({},_0x3efa36,_0x1a870a[_0x3ac9('0x47')]);return db[_0x3ac9('0x34')][_0x3ac9('0x4e')](_0x3efa36)[_0x3ac9('0x17')](handleEntityNotFound(_0x47b204,null))[_0x3ac9('0x17')](respondWithResult(_0x47b204,null))['catch'](handleError(_0x47b204,null));};exports[_0x3ac9('0x4f')]=function(_0x3c4dbe,_0x328f78){return db['SalesforceConfiguration'][_0x3ac9('0x4f')](_0x3c4dbe[_0x3ac9('0x50')],{})[_0x3ac9('0x17')](respondWithResult(_0x328f78,0xc9))[_0x3ac9('0x22')](handleError(_0x328f78,null));};exports[_0x3ac9('0x2c')]=function(_0x5b284b,_0x1a889d){if(_0x5b284b['body']['id']){delete _0x5b284b[_0x3ac9('0x50')]['id'];}return db[_0x3ac9('0x34')][_0x3ac9('0x4e')]({'where':{'id':_0x5b284b[_0x3ac9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1a889d,null))[_0x3ac9('0x17')](saveUpdates(_0x5b284b['body'],null))[_0x3ac9('0x17')](respondWithResult(_0x1a889d,null))[_0x3ac9('0x22')](handleError(_0x1a889d,null));};exports['destroy']=function(_0x4738bd,_0x190589){return db[_0x3ac9('0x34')][_0x3ac9('0x4e')]({'where':{'id':_0x4738bd[_0x3ac9('0x4c')]['id']}})[_0x3ac9('0x17')](handleEntityNotFound(_0x190589,null))[_0x3ac9('0x17')](removeEntity(_0x190589,null))[_0x3ac9('0x22')](handleError(_0x190589,null));};exports[_0x3ac9('0x51')]=function(_0x38ad99,_0x54344f,_0x55c6e1){var _0x6be3={};var _0x14977f={};var _0x2b956f;var _0x5eb832;return db[_0x3ac9('0x34')][_0x3ac9('0x52')]({'where':{'id':_0x38ad99[_0x3ac9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x54344f,null))[_0x3ac9('0x17')](function(_0x504ded){if(_0x504ded){_0x2b956f=_0x504ded;_0x14977f['model']=_[_0x3ac9('0x39')](db[_0x3ac9('0x53')][_0x3ac9('0x35')]);_0x14977f[_0x3ac9('0x38')]=_[_0x3ac9('0x39')](_0x38ad99['query']);_0x14977f[_0x3ac9('0x42')]=_[_0x3ac9('0x3a')](_0x14977f['model'],_0x14977f[_0x3ac9('0x38')]);_0x6be3[_0x3ac9('0x3c')]=_['intersection'](_0x14977f[_0x3ac9('0x3b')],qs['fields'](_0x38ad99[_0x3ac9('0x38')][_0x3ac9('0x3d')]));_0x6be3[_0x3ac9('0x3c')]=_0x6be3[_0x3ac9('0x3c')]['length']?_0x6be3[_0x3ac9('0x3c')]:_0x14977f[_0x3ac9('0x3b')];_0x6be3[_0x3ac9('0x40')]=qs[_0x3ac9('0x41')](_0x38ad99[_0x3ac9('0x38')][_0x3ac9('0x41')]);_0x6be3[_0x3ac9('0x45')]=qs['filters'](_['pick'](_0x38ad99[_0x3ac9('0x38')],_0x14977f['filters']));if(_0x38ad99[_0x3ac9('0x38')]['filter']){_0x6be3[_0x3ac9('0x45')]=_[_0x3ac9('0x46')](_0x6be3[_0x3ac9('0x45')],{'$or':_[_0x3ac9('0x33')](_0x6be3['attributes'],function(_0x2aac5c){var _0xe4c8be={};_0xe4c8be[_0x2aac5c]={'$like':'%'+_0x38ad99['query'][_0x3ac9('0x44')]+'%'};return _0xe4c8be;})});}_0x6be3=_[_0x3ac9('0x46')]({},_0x6be3,_0x38ad99[_0x3ac9('0x47')]);return _0x2b956f[_0x3ac9('0x51')](_0x6be3);}})['then'](function(_0x4004e3){if(_0x4004e3){_0x5eb832=_0x4004e3['length'];if(!_0x38ad99[_0x3ac9('0x38')][_0x3ac9('0x3f')](_0x3ac9('0x54'))){_0x6be3['limit']=qs[_0x3ac9('0x25')](_0x38ad99[_0x3ac9('0x38')][_0x3ac9('0x25')]);_0x6be3[_0x3ac9('0x24')]=qs['offset'](_0x38ad99[_0x3ac9('0x38')][_0x3ac9('0x24')]);}return _0x2b956f[_0x3ac9('0x51')](_0x6be3);}})[_0x3ac9('0x17')](function(_0x49b4da){if(_0x49b4da){return _0x49b4da?{'count':_0x5eb832,'rows':_0x49b4da}:null;}})[_0x3ac9('0x17')](respondWithResult(_0x54344f,null))[_0x3ac9('0x22')](handleError(_0x54344f,null));};exports[_0x3ac9('0x55')]=function(_0x13bec9,_0x10eabc,_0x104cc1){var _0x568890={};var _0x446ef5={};var _0x480c85;var _0xe74e17;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x13bec9['params']['id']}})[_0x3ac9('0x17')](handleEntityNotFound(_0x10eabc,null))[_0x3ac9('0x17')](function(_0x20b0ee){if(_0x20b0ee){_0x480c85=_0x20b0ee;_0x446ef5[_0x3ac9('0x3b')]=_[_0x3ac9('0x39')](db[_0x3ac9('0x53')][_0x3ac9('0x35')]);_0x446ef5[_0x3ac9('0x38')]=_['keys'](_0x13bec9['query']);_0x446ef5[_0x3ac9('0x42')]=_['intersection'](_0x446ef5[_0x3ac9('0x3b')],_0x446ef5['query']);_0x568890[_0x3ac9('0x3c')]=_[_0x3ac9('0x3a')](_0x446ef5['model'],qs[_0x3ac9('0x3d')](_0x13bec9[_0x3ac9('0x38')][_0x3ac9('0x3d')]));_0x568890['attributes']=_0x568890[_0x3ac9('0x3c')][_0x3ac9('0x3e')]?_0x568890[_0x3ac9('0x3c')]:_0x446ef5[_0x3ac9('0x3b')];_0x568890['order']=qs[_0x3ac9('0x41')](_0x13bec9['query'][_0x3ac9('0x41')]);_0x568890['where']=qs['filters'](_['pick'](_0x13bec9[_0x3ac9('0x38')],_0x446ef5[_0x3ac9('0x42')]));if(_0x13bec9[_0x3ac9('0x38')][_0x3ac9('0x44')]){_0x568890['where']=_[_0x3ac9('0x46')](_0x568890[_0x3ac9('0x45')],{'$or':_[_0x3ac9('0x33')](_0x568890[_0x3ac9('0x3c')],function(_0x37f8fd){var _0x3de2f7={};_0x3de2f7[_0x37f8fd]={'$like':'%'+_0x13bec9[_0x3ac9('0x38')][_0x3ac9('0x44')]+'%'};return _0x3de2f7;})});}_0x568890=_[_0x3ac9('0x46')]({},_0x568890,_0x13bec9[_0x3ac9('0x47')]);return _0x480c85[_0x3ac9('0x55')](_0x568890);}})[_0x3ac9('0x17')](function(_0x25548f){if(_0x25548f){_0xe74e17=_0x25548f[_0x3ac9('0x3e')];if(!_0x13bec9['query'][_0x3ac9('0x3f')](_0x3ac9('0x54'))){_0x568890['limit']=qs['limit'](_0x13bec9[_0x3ac9('0x38')][_0x3ac9('0x25')]);_0x568890[_0x3ac9('0x24')]=qs[_0x3ac9('0x24')](_0x13bec9[_0x3ac9('0x38')][_0x3ac9('0x24')]);}return _0x480c85[_0x3ac9('0x55')](_0x568890);}})[_0x3ac9('0x17')](function(_0x19edd8){if(_0x19edd8){return _0x19edd8?{'count':_0xe74e17,'rows':_0x19edd8}:null;}})['then'](respondWithResult(_0x10eabc,null))[_0x3ac9('0x22')](handleError(_0x10eabc,null));};exports['getDescriptions']=function(_0x86ac81,_0x2311f9,_0x11cb18){var _0x1903fd={};var _0x3adcbd={};var _0x4f6dbc;var _0x1edd09;return db[_0x3ac9('0x34')][_0x3ac9('0x52')]({'where':{'id':_0x86ac81['params']['id']}})[_0x3ac9('0x17')](handleEntityNotFound(_0x2311f9,null))[_0x3ac9('0x17')](function(_0x2a927d){if(_0x2a927d){_0x4f6dbc=_0x2a927d;_0x3adcbd[_0x3ac9('0x3b')]=_['keys'](db[_0x3ac9('0x53')][_0x3ac9('0x35')]);_0x3adcbd[_0x3ac9('0x38')]=_['keys'](_0x86ac81[_0x3ac9('0x38')]);_0x3adcbd[_0x3ac9('0x42')]=_[_0x3ac9('0x3a')](_0x3adcbd[_0x3ac9('0x3b')],_0x3adcbd[_0x3ac9('0x38')]);_0x1903fd[_0x3ac9('0x3c')]=_['intersection'](_0x3adcbd['model'],qs[_0x3ac9('0x3d')](_0x86ac81[_0x3ac9('0x38')]['fields']));_0x1903fd[_0x3ac9('0x3c')]=_0x1903fd['attributes'][_0x3ac9('0x3e')]?_0x1903fd[_0x3ac9('0x3c')]:_0x3adcbd[_0x3ac9('0x3b')];_0x1903fd[_0x3ac9('0x40')]=qs['sort'](_0x86ac81[_0x3ac9('0x38')][_0x3ac9('0x41')]);_0x1903fd['where']=qs['filters'](_[_0x3ac9('0x43')](_0x86ac81[_0x3ac9('0x38')],_0x3adcbd[_0x3ac9('0x42')]));if(_0x86ac81[_0x3ac9('0x38')][_0x3ac9('0x44')]){_0x1903fd[_0x3ac9('0x45')]=_[_0x3ac9('0x46')](_0x1903fd['where'],{'$or':_['map'](_0x1903fd[_0x3ac9('0x3c')],function(_0xad08b4){var _0x29c037={};_0x29c037[_0xad08b4]={'$like':'%'+_0x86ac81[_0x3ac9('0x38')]['filter']+'%'};return _0x29c037;})});}_0x1903fd=_[_0x3ac9('0x46')]({},_0x1903fd,_0x86ac81['options']);return _0x4f6dbc[_0x3ac9('0x56')](_0x1903fd);}})['then'](function(_0x1ba5db){if(_0x1ba5db){_0x1edd09=_0x1ba5db[_0x3ac9('0x3e')];if(!_0x86ac81[_0x3ac9('0x38')]['hasOwnProperty'](_0x3ac9('0x54'))){_0x1903fd[_0x3ac9('0x25')]=qs['limit'](_0x86ac81[_0x3ac9('0x38')][_0x3ac9('0x25')]);_0x1903fd[_0x3ac9('0x24')]=qs['offset'](_0x86ac81['query'][_0x3ac9('0x24')]);}return _0x4f6dbc['getDescriptions'](_0x1903fd);}})[_0x3ac9('0x17')](function(_0x4d21af){if(_0x4d21af){return _0x4d21af?{'count':_0x1edd09,'rows':_0x4d21af}:null;}})[_0x3ac9('0x17')](respondWithResult(_0x2311f9,null))[_0x3ac9('0x22')](handleError(_0x2311f9,null));}; \ No newline at end of file +var _0xd33d=['model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','find','create','body','params','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','index','SalesforceConfiguration','rawAttributes','fieldName','type','key'];(function(_0x536aa0,_0x4299db){var _0x15bd4e=function(_0x4f3ad8){while(--_0x4f3ad8){_0x536aa0['push'](_0x536aa0['shift']());}};_0x15bd4e(++_0x4299db);}(_0xd33d,0x199));var _0xdd33=function(_0x253b0c,_0x982c0f){_0x253b0c=_0x253b0c-0x0;var _0x6a0ea2=_0xd33d[_0x253b0c];return _0x6a0ea2;};'use strict';var emlformat=require(_0xdd33('0x0'));var rimraf=require(_0xdd33('0x1'));var zipdir=require(_0xdd33('0x2'));var jsonpatch=require(_0xdd33('0x3'));var rp=require(_0xdd33('0x4'));var moment=require(_0xdd33('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdd33('0x6'));var util=require(_0xdd33('0x7'));var path=require('path');var sox=require(_0xdd33('0x8'));var csv=require(_0xdd33('0x9'));var ejs=require(_0xdd33('0xa'));var fs=require('fs');var fs_extra=require(_0xdd33('0xb'));var _=require('lodash');var squel=require(_0xdd33('0xc'));var crypto=require('crypto');var jsforce=require(_0xdd33('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdd33('0xe'));var Papa=require(_0xdd33('0xf'));var Redis=require(_0xdd33('0x10'));var authService=require(_0xdd33('0x11'));var qs=require(_0xdd33('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd33('0x13'));var logger=require(_0xdd33('0x14'))(_0xdd33('0x15'));var utils=require(_0xdd33('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdd33('0x17'));var db=require(_0xdd33('0x18'))['db'];var jayson=require(_0xdd33('0x19'));var client=jayson[_0xdd33('0x1a')][_0xdd33('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x23f11f,_0x267937,_0x2dec42,_0x4c6b1b){return new BPromise(function(_0xed4b6,_0x44d133){var _0x2f13b2=_0x4c6b1b||client;return _0x2f13b2[_0xdd33('0x1c')](_0x23f11f,_0x2dec42)['then'](function(_0x4da117){logger[_0xdd33('0x1d')](_0xdd33('0x1e'),_0x267937,_0xdd33('0x1f'));logger[_0xdd33('0x20')](_0xdd33('0x21'),_0x267937,'request\x20sent',JSON[_0xdd33('0x22')](_0x4da117));if(_0x4da117[_0xdd33('0x23')]){if(_0x4da117[_0xdd33('0x23')][_0xdd33('0x24')]===0x1f4){logger[_0xdd33('0x23')](_0xdd33('0x1e'),_0x267937,_0x4da117['error'][_0xdd33('0x25')]);return _0x44d133(_0x4da117[_0xdd33('0x23')]['message']);}logger['error'](_0xdd33('0x1e'),_0x267937,_0x4da117[_0xdd33('0x23')][_0xdd33('0x25')]);return _0xed4b6(_0x4da117[_0xdd33('0x23')][_0xdd33('0x25')]);}else{logger[_0xdd33('0x1d')](_0xdd33('0x1e'),_0x267937,'request\x20sent');_0xed4b6(_0x4da117[_0xdd33('0x26')][_0xdd33('0x25')]);}})[_0xdd33('0x27')](function(_0x27aa55){logger[_0xdd33('0x23')](_0xdd33('0x1e'),_0x267937,_0x27aa55);_0x44d133(_0x27aa55);});});}function respondWithStatusCode(_0x8bad5a,_0x4666c3){_0x4666c3=_0x4666c3||0xcc;return function(_0x3ed226){if(_0x3ed226){return _0x8bad5a[_0xdd33('0x28')](_0x4666c3);}return _0x8bad5a[_0xdd33('0x29')](_0x4666c3)[_0xdd33('0x2a')]();};}function respondWithResult(_0x1565be,_0x432c21){_0x432c21=_0x432c21||0xc8;return function(_0x57148f){if(_0x57148f){return _0x1565be[_0xdd33('0x29')](_0x432c21)[_0xdd33('0x2b')](_0x57148f);}};}function respondWithFilteredResult(_0x14ff87,_0x282126){return function(_0x9b1008){if(_0x9b1008){var _0x3ab316=_0x9b1008['count'],_0x142c82=_0x282126['offset'],_0x40f456=_0x282126[_0xdd33('0x2c')]+_0x282126[_0xdd33('0x2d')],_0x29d9e2;if(_0x40f456>=_0x3ab316){_0x40f456=_0x3ab316;_0x29d9e2=0xc8;}else{_0x29d9e2=0xce;}_0x14ff87[_0xdd33('0x29')](_0x29d9e2);return _0x14ff87[_0xdd33('0x2e')](_0xdd33('0x2f'),_0x142c82+'-'+_0x40f456+'/'+_0x3ab316)[_0xdd33('0x2b')](_0x9b1008);}return null;};}function patchUpdates(_0x13c18b){return function(_0x504fac){try{jsonpatch[_0xdd33('0x30')](_0x504fac,_0x13c18b,!![]);}catch(_0x4ff586){return BPromise[_0xdd33('0x31')](_0x4ff586);}return _0x504fac[_0xdd33('0x32')]();};}function saveUpdates(_0x11e868,_0x3f3250){return function(_0x47f082){if(_0x47f082){return _0x47f082[_0xdd33('0x33')](_0x11e868)[_0xdd33('0x34')](function(_0x1b384c){return _0x1b384c;});}return null;};}function removeEntity(_0x145ca0,_0x2508f9){return function(_0x1114b8){if(_0x1114b8){return _0x1114b8[_0xdd33('0x35')]()[_0xdd33('0x34')](function(){_0x145ca0['status'](0xcc)[_0xdd33('0x2a')]();});}};}function handleEntityNotFound(_0x46e6c4,_0x110f17){return function(_0x378eb1){if(!_0x378eb1){_0x46e6c4['sendStatus'](0x194);}return _0x378eb1;};}function handleError(_0x590dc2,_0x2ca196){_0x2ca196=_0x2ca196||0x1f4;return function(_0x5d504d){logger[_0xdd33('0x23')](_0x5d504d['stack']);if(_0x5d504d[_0xdd33('0x36')]){delete _0x5d504d['name'];}_0x590dc2[_0xdd33('0x29')](_0x2ca196)['send'](_0x5d504d);};}exports[_0xdd33('0x37')]=function(_0x476f03,_0x11450e){var _0x9aa8ca={},_0x49b82d={},_0x359fd2={'count':0x0,'rows':[]};var _0x4014a0=_['map'](db[_0xdd33('0x38')][_0xdd33('0x39')],function(_0xb6e437){return{'name':_0xb6e437[_0xdd33('0x3a')],'type':_0xb6e437[_0xdd33('0x3b')][_0xdd33('0x3c')]};});_0x49b82d[_0xdd33('0x3d')]=_[_0xdd33('0x3e')](_0x4014a0,_0xdd33('0x36'));_0x49b82d[_0xdd33('0x3f')]=_[_0xdd33('0x40')](_0x476f03['query']);_0x49b82d['filters']=_[_0xdd33('0x41')](_0x49b82d[_0xdd33('0x3d')],_0x49b82d['query']);_0x9aa8ca['attributes']=_[_0xdd33('0x41')](_0x49b82d[_0xdd33('0x3d')],qs['fields'](_0x476f03[_0xdd33('0x3f')][_0xdd33('0x42')]));_0x9aa8ca[_0xdd33('0x43')]=_0x9aa8ca[_0xdd33('0x43')][_0xdd33('0x44')]?_0x9aa8ca[_0xdd33('0x43')]:_0x49b82d[_0xdd33('0x3d')];if(!_0x476f03[_0xdd33('0x3f')][_0xdd33('0x45')](_0xdd33('0x46'))){_0x9aa8ca[_0xdd33('0x2d')]=qs[_0xdd33('0x2d')](_0x476f03['query'][_0xdd33('0x2d')]);_0x9aa8ca[_0xdd33('0x2c')]=qs[_0xdd33('0x2c')](_0x476f03['query']['offset']);}_0x9aa8ca[_0xdd33('0x47')]=qs[_0xdd33('0x48')](_0x476f03['query']['sort']);_0x9aa8ca[_0xdd33('0x49')]=qs[_0xdd33('0x4a')](_[_0xdd33('0x4b')](_0x476f03[_0xdd33('0x3f')],_0x49b82d[_0xdd33('0x4a')]),_0x4014a0);if(_0x476f03[_0xdd33('0x3f')][_0xdd33('0x4c')]){_0x9aa8ca[_0xdd33('0x49')]=_[_0xdd33('0x4d')](_0x9aa8ca[_0xdd33('0x49')],{'$or':_[_0xdd33('0x3e')](_0x4014a0,function(_0x1b37de){if(_0x1b37de[_0xdd33('0x3b')]!==_0xdd33('0x4e')){var _0x5dd2c2={};_0x5dd2c2[_0x1b37de[_0xdd33('0x36')]]={'$like':'%'+_0x476f03[_0xdd33('0x3f')][_0xdd33('0x4c')]+'%'};return _0x5dd2c2;}})});}_0x9aa8ca=_['merge']({},_0x9aa8ca,_0x476f03[_0xdd33('0x4f')]);var _0x5c7167={'where':_0x9aa8ca[_0xdd33('0x49')]};return db[_0xdd33('0x38')]['count'](_0x5c7167)[_0xdd33('0x34')](function(_0x16c146){_0x359fd2[_0xdd33('0x50')]=_0x16c146;if(_0x476f03[_0xdd33('0x3f')][_0xdd33('0x51')]){_0x9aa8ca[_0xdd33('0x52')]=[{'all':!![]}];}return db[_0xdd33('0x38')][_0xdd33('0x53')](_0x9aa8ca);})[_0xdd33('0x34')](function(_0x232347){_0x359fd2['rows']=_0x232347;return _0x359fd2;})[_0xdd33('0x34')](respondWithFilteredResult(_0x11450e,_0x9aa8ca))['catch'](handleError(_0x11450e,null));};exports[_0xdd33('0x54')]=function(_0x11685e,_0x39bd93){var _0x289dc2={'raw':![],'where':{'id':_0x11685e['params']['id']}},_0x536165={};_0x536165[_0xdd33('0x3d')]=_[_0xdd33('0x40')](db['SalesforceConfiguration'][_0xdd33('0x39')]);_0x536165[_0xdd33('0x3f')]=_[_0xdd33('0x40')](_0x11685e['query']);_0x536165[_0xdd33('0x4a')]=_[_0xdd33('0x41')](_0x536165[_0xdd33('0x3d')],_0x536165[_0xdd33('0x3f')]);_0x289dc2[_0xdd33('0x43')]=_[_0xdd33('0x41')](_0x536165[_0xdd33('0x3d')],qs[_0xdd33('0x42')](_0x11685e[_0xdd33('0x3f')][_0xdd33('0x42')]));_0x289dc2['attributes']=_0x289dc2['attributes'][_0xdd33('0x44')]?_0x289dc2[_0xdd33('0x43')]:_0x536165['model'];if(_0x11685e[_0xdd33('0x3f')][_0xdd33('0x51')]){_0x289dc2[_0xdd33('0x52')]=[{'all':!![]}];}_0x289dc2=_[_0xdd33('0x4d')]({},_0x289dc2,_0x11685e[_0xdd33('0x4f')]);return db[_0xdd33('0x38')][_0xdd33('0x55')](_0x289dc2)[_0xdd33('0x34')](handleEntityNotFound(_0x39bd93,null))[_0xdd33('0x34')](respondWithResult(_0x39bd93,null))['catch'](handleError(_0x39bd93,null));};exports[_0xdd33('0x56')]=function(_0x125418,_0x3aab08){return db['SalesforceConfiguration']['create'](_0x125418[_0xdd33('0x57')],{})['then'](respondWithResult(_0x3aab08,0xc9))[_0xdd33('0x27')](handleError(_0x3aab08,null));};exports['update']=function(_0x2f6538,_0x555ea5){if(_0x2f6538[_0xdd33('0x57')]['id']){delete _0x2f6538[_0xdd33('0x57')]['id'];}return db[_0xdd33('0x38')]['find']({'where':{'id':_0x2f6538[_0xdd33('0x58')]['id']}})[_0xdd33('0x34')](handleEntityNotFound(_0x555ea5,null))[_0xdd33('0x34')](saveUpdates(_0x2f6538['body'],null))[_0xdd33('0x34')](respondWithResult(_0x555ea5,null))[_0xdd33('0x27')](handleError(_0x555ea5,null));};exports['destroy']=function(_0x1612a6,_0x55d04f){return db['SalesforceConfiguration'][_0xdd33('0x55')]({'where':{'id':_0x1612a6[_0xdd33('0x58')]['id']}})['then'](handleEntityNotFound(_0x55d04f,null))['then'](removeEntity(_0x55d04f,null))['catch'](handleError(_0x55d04f,null));};exports[_0xdd33('0x59')]=function(_0x52908f,_0xbb076,_0x14ca09){var _0x384c08={};var _0x526965={};var _0x533547;var _0x491ef6;return db[_0xdd33('0x38')][_0xdd33('0x5a')]({'where':{'id':_0x52908f['params']['id']}})['then'](handleEntityNotFound(_0xbb076,null))[_0xdd33('0x34')](function(_0x10928c){if(_0x10928c){_0x533547=_0x10928c;_0x526965[_0xdd33('0x3d')]=_['keys'](db[_0xdd33('0x5b')][_0xdd33('0x39')]);_0x526965[_0xdd33('0x3f')]=_[_0xdd33('0x40')](_0x52908f[_0xdd33('0x3f')]);_0x526965['filters']=_[_0xdd33('0x41')](_0x526965[_0xdd33('0x3d')],_0x526965[_0xdd33('0x3f')]);_0x384c08[_0xdd33('0x43')]=_[_0xdd33('0x41')](_0x526965[_0xdd33('0x3d')],qs[_0xdd33('0x42')](_0x52908f[_0xdd33('0x3f')][_0xdd33('0x42')]));_0x384c08['attributes']=_0x384c08[_0xdd33('0x43')]['length']?_0x384c08[_0xdd33('0x43')]:_0x526965['model'];_0x384c08[_0xdd33('0x47')]=qs[_0xdd33('0x48')](_0x52908f[_0xdd33('0x3f')][_0xdd33('0x48')]);_0x384c08['where']=qs[_0xdd33('0x4a')](_[_0xdd33('0x4b')](_0x52908f['query'],_0x526965[_0xdd33('0x4a')]));if(_0x52908f['query'][_0xdd33('0x4c')]){_0x384c08['where']=_[_0xdd33('0x4d')](_0x384c08[_0xdd33('0x49')],{'$or':_['map'](_0x384c08[_0xdd33('0x43')],function(_0xc0c55d){var _0x3c30a9={};_0x3c30a9[_0xc0c55d]={'$like':'%'+_0x52908f[_0xdd33('0x3f')][_0xdd33('0x4c')]+'%'};return _0x3c30a9;})});}_0x384c08=_[_0xdd33('0x4d')]({},_0x384c08,_0x52908f[_0xdd33('0x4f')]);return _0x533547[_0xdd33('0x59')](_0x384c08);}})[_0xdd33('0x34')](function(_0x53403c){if(_0x53403c){_0x491ef6=_0x53403c[_0xdd33('0x44')];if(!_0x52908f[_0xdd33('0x3f')][_0xdd33('0x45')](_0xdd33('0x46'))){_0x384c08[_0xdd33('0x2d')]=qs['limit'](_0x52908f[_0xdd33('0x3f')][_0xdd33('0x2d')]);_0x384c08['offset']=qs['offset'](_0x52908f[_0xdd33('0x3f')][_0xdd33('0x2c')]);}return _0x533547[_0xdd33('0x59')](_0x384c08);}})[_0xdd33('0x34')](function(_0x8fd45a){if(_0x8fd45a){return _0x8fd45a?{'count':_0x491ef6,'rows':_0x8fd45a}:null;}})['then'](respondWithResult(_0xbb076,null))[_0xdd33('0x27')](handleError(_0xbb076,null));};exports[_0xdd33('0x5c')]=function(_0x1ac409,_0x3001cc,_0x59b414){var _0x5a5f8b={};var _0x3c7cb5={};var _0x215b03;var _0x3497aa;return db['SalesforceConfiguration'][_0xdd33('0x5a')]({'where':{'id':_0x1ac409[_0xdd33('0x58')]['id']}})[_0xdd33('0x34')](handleEntityNotFound(_0x3001cc,null))[_0xdd33('0x34')](function(_0xa955b){if(_0xa955b){_0x215b03=_0xa955b;_0x3c7cb5[_0xdd33('0x3d')]=_[_0xdd33('0x40')](db[_0xdd33('0x5b')][_0xdd33('0x39')]);_0x3c7cb5['query']=_['keys'](_0x1ac409[_0xdd33('0x3f')]);_0x3c7cb5[_0xdd33('0x4a')]=_['intersection'](_0x3c7cb5[_0xdd33('0x3d')],_0x3c7cb5['query']);_0x5a5f8b[_0xdd33('0x43')]=_['intersection'](_0x3c7cb5[_0xdd33('0x3d')],qs[_0xdd33('0x42')](_0x1ac409['query'][_0xdd33('0x42')]));_0x5a5f8b['attributes']=_0x5a5f8b[_0xdd33('0x43')]['length']?_0x5a5f8b['attributes']:_0x3c7cb5[_0xdd33('0x3d')];_0x5a5f8b[_0xdd33('0x47')]=qs['sort'](_0x1ac409[_0xdd33('0x3f')][_0xdd33('0x48')]);_0x5a5f8b['where']=qs[_0xdd33('0x4a')](_[_0xdd33('0x4b')](_0x1ac409['query'],_0x3c7cb5['filters']));if(_0x1ac409[_0xdd33('0x3f')]['filter']){_0x5a5f8b[_0xdd33('0x49')]=_[_0xdd33('0x4d')](_0x5a5f8b[_0xdd33('0x49')],{'$or':_[_0xdd33('0x3e')](_0x5a5f8b['attributes'],function(_0x3d5824){var _0x880a29={};_0x880a29[_0x3d5824]={'$like':'%'+_0x1ac409['query'][_0xdd33('0x4c')]+'%'};return _0x880a29;})});}_0x5a5f8b=_[_0xdd33('0x4d')]({},_0x5a5f8b,_0x1ac409['options']);return _0x215b03[_0xdd33('0x5c')](_0x5a5f8b);}})[_0xdd33('0x34')](function(_0x24554e){if(_0x24554e){_0x3497aa=_0x24554e[_0xdd33('0x44')];if(!_0x1ac409['query'][_0xdd33('0x45')]('nolimit')){_0x5a5f8b[_0xdd33('0x2d')]=qs[_0xdd33('0x2d')](_0x1ac409[_0xdd33('0x3f')][_0xdd33('0x2d')]);_0x5a5f8b[_0xdd33('0x2c')]=qs[_0xdd33('0x2c')](_0x1ac409[_0xdd33('0x3f')][_0xdd33('0x2c')]);}return _0x215b03[_0xdd33('0x5c')](_0x5a5f8b);}})['then'](function(_0x12bcb9){if(_0x12bcb9){return _0x12bcb9?{'count':_0x3497aa,'rows':_0x12bcb9}:null;}})['then'](respondWithResult(_0x3001cc,null))[_0xdd33('0x27')](handleError(_0x3001cc,null));};exports[_0xdd33('0x5d')]=function(_0xdd74cc,_0x2daf43,_0x19323c){var _0xa7d4a7={};var _0x20895e={};var _0x43c787;var _0x41ac53;return db[_0xdd33('0x38')][_0xdd33('0x5a')]({'where':{'id':_0xdd74cc[_0xdd33('0x58')]['id']}})[_0xdd33('0x34')](handleEntityNotFound(_0x2daf43,null))[_0xdd33('0x34')](function(_0x4e8ae9){if(_0x4e8ae9){_0x43c787=_0x4e8ae9;_0x20895e[_0xdd33('0x3d')]=_[_0xdd33('0x40')](db['SalesforceField'][_0xdd33('0x39')]);_0x20895e[_0xdd33('0x3f')]=_[_0xdd33('0x40')](_0xdd74cc[_0xdd33('0x3f')]);_0x20895e[_0xdd33('0x4a')]=_[_0xdd33('0x41')](_0x20895e['model'],_0x20895e['query']);_0xa7d4a7[_0xdd33('0x43')]=_[_0xdd33('0x41')](_0x20895e['model'],qs['fields'](_0xdd74cc[_0xdd33('0x3f')][_0xdd33('0x42')]));_0xa7d4a7[_0xdd33('0x43')]=_0xa7d4a7[_0xdd33('0x43')][_0xdd33('0x44')]?_0xa7d4a7[_0xdd33('0x43')]:_0x20895e['model'];_0xa7d4a7['order']=qs[_0xdd33('0x48')](_0xdd74cc[_0xdd33('0x3f')]['sort']);_0xa7d4a7[_0xdd33('0x49')]=qs[_0xdd33('0x4a')](_[_0xdd33('0x4b')](_0xdd74cc[_0xdd33('0x3f')],_0x20895e[_0xdd33('0x4a')]));if(_0xdd74cc['query'][_0xdd33('0x4c')]){_0xa7d4a7['where']=_['merge'](_0xa7d4a7['where'],{'$or':_[_0xdd33('0x3e')](_0xa7d4a7[_0xdd33('0x43')],function(_0x1fe26c){var _0x298662={};_0x298662[_0x1fe26c]={'$like':'%'+_0xdd74cc['query'][_0xdd33('0x4c')]+'%'};return _0x298662;})});}_0xa7d4a7=_[_0xdd33('0x4d')]({},_0xa7d4a7,_0xdd74cc[_0xdd33('0x4f')]);return _0x43c787[_0xdd33('0x5d')](_0xa7d4a7);}})[_0xdd33('0x34')](function(_0x1e1538){if(_0x1e1538){_0x41ac53=_0x1e1538[_0xdd33('0x44')];if(!_0xdd74cc[_0xdd33('0x3f')][_0xdd33('0x45')](_0xdd33('0x46'))){_0xa7d4a7[_0xdd33('0x2d')]=qs[_0xdd33('0x2d')](_0xdd74cc[_0xdd33('0x3f')][_0xdd33('0x2d')]);_0xa7d4a7['offset']=qs[_0xdd33('0x2c')](_0xdd74cc[_0xdd33('0x3f')][_0xdd33('0x2c')]);}return _0x43c787[_0xdd33('0x5d')](_0xa7d4a7);}})[_0xdd33('0x34')](function(_0x325bb8){if(_0x325bb8){return _0x325bb8?{'count':_0x41ac53,'rows':_0x325bb8}:null;}})['then'](respondWithResult(_0x2daf43,null))[_0xdd33('0x27')](handleError(_0x2daf43,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 258ce09..0f1faa5 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 _0x0c2f=['lodash','util','api','moment','path','rimraf','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x20f549,_0x277e01){var _0x324c4a=function(_0x11abe4){while(--_0x11abe4){_0x20f549['push'](_0x20f549['shift']());}};_0x324c4a(++_0x277e01);}(_0x0c2f,0x17c));var _0xf0c2=function(_0x1fb2fe,_0x544a05){_0x1fb2fe=_0x1fb2fe-0x0;var _0x31e4a8=_0x0c2f[_0x1fb2fe];return _0x31e4a8;};'use strict';var _=require(_0xf0c2('0x0'));var util=require(_0xf0c2('0x1'));var logger=require('../../config/logger')(_0xf0c2('0x2'));var moment=require(_0xf0c2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0c2('0x4'));var rimraf=require(_0xf0c2('0x5'));var config=require('../../config/environment');var attributes=require(_0xf0c2('0x6'));module[_0xf0c2('0x7')]=function(_0x2cf33e,_0x326d05){return _0x2cf33e['define'](_0xf0c2('0x8'),attributes,{'tableName':_0xf0c2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ee0=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','int_salesforce_configurations','lodash','util','api','moment'];(function(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0x6ee0,0x134));var _0x06ee=function(_0x5bd71f,_0x15356a){_0x5bd71f=_0x5bd71f-0x0;var _0x50d523=_0x6ee0[_0x5bd71f];return _0x50d523;};'use strict';var _=require(_0x06ee('0x0'));var util=require(_0x06ee('0x1'));var logger=require('../../config/logger')(_0x06ee('0x2'));var moment=require(_0x06ee('0x3'));var BPromise=require(_0x06ee('0x4'));var rp=require(_0x06ee('0x5'));var fs=require('fs');var path=require(_0x06ee('0x6'));var rimraf=require(_0x06ee('0x7'));var config=require(_0x06ee('0x8'));var attributes=require(_0x06ee('0x9'));module['exports']=function(_0x1d1da0,_0x3b6941){return _0x1d1da0[_0x06ee('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0x06ee('0xb'),'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 24622c6..36a0c13 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 _0xb515=['request\x20sent','debug','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xb515,0x118));var _0x5b51=function(_0x385467,_0x298239){_0x385467=_0x385467-0x0;var _0x5ed67e=_0xb515[_0x385467];return _0x5ed67e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5b51('0x0'));var BPromise=require(_0x5b51('0x1'));var rs=require(_0x5b51('0x2'));var fs=require('fs');var Redis=require(_0x5b51('0x3'));var db=require(_0x5b51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b51('0x5'))(_0x5b51('0x6'));var config=require(_0x5b51('0x7'));var jayson=require(_0x5b51('0x8'));var client=jayson[_0x5b51('0x9')][_0x5b51('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x253df9,_0x127e39,_0xc62460){return new BPromise(function(_0x45b1fb,_0x22ee49){return client[_0x5b51('0xb')](_0x253df9,_0xc62460)[_0x5b51('0xc')](function(_0x20c5f9){logger['info'](_0x5b51('0xd'),_0x127e39,_0x5b51('0xe'));logger[_0x5b51('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x127e39,_0x5b51('0xe'),JSON['stringify'](_0x20c5f9));if(_0x20c5f9[_0x5b51('0x10')]){if(_0x20c5f9['error'][_0x5b51('0x11')]===0x1f4){logger[_0x5b51('0x10')](_0x5b51('0xd'),_0x127e39,_0x20c5f9[_0x5b51('0x10')][_0x5b51('0x12')]);return _0x22ee49(_0x20c5f9[_0x5b51('0x10')][_0x5b51('0x12')]);}logger[_0x5b51('0x10')](_0x5b51('0xd'),_0x127e39,_0x20c5f9[_0x5b51('0x10')]['message']);return _0x45b1fb(_0x20c5f9['error'][_0x5b51('0x12')]);}else{logger['info'](_0x5b51('0xd'),_0x127e39,_0x5b51('0xe'));_0x45b1fb(_0x20c5f9[_0x5b51('0x13')][_0x5b51('0x12')]);}})[_0x5b51('0x14')](function(_0x144a1a){logger[_0x5b51('0x10')](_0x5b51('0xd'),_0x127e39,_0x144a1a);_0x22ee49(_0x144a1a);});});} \ No newline at end of file +var _0xa9da=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','lodash','randomstring'];(function(_0x2411b1,_0x191016){var _0x2fabde=function(_0x58e05c){while(--_0x58e05c){_0x2411b1['push'](_0x2411b1['shift']());}};_0x2fabde(++_0x191016);}(_0xa9da,0x108));var _0xaa9d=function(_0x1b8fad,_0x24a56b){_0x1b8fad=_0x1b8fad-0x0;var _0x1e85ec=_0xa9da[_0x1b8fad];return _0x1e85ec;};'use strict';var _=require(_0xaa9d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaa9d('0x1'));var fs=require('fs');var Redis=require(_0xaa9d('0x2'));var db=require(_0xaa9d('0x3'))['db'];var utils=require(_0xaa9d('0x4'));var logger=require(_0xaa9d('0x5'))(_0xaa9d('0x6'));var config=require(_0xaa9d('0x7'));var jayson=require(_0xaa9d('0x8'));var client=jayson[_0xaa9d('0x9')][_0xaa9d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cbf02,_0x480a10,_0x1d970d){return new BPromise(function(_0x4b7ee8,_0x12eeed){return client['request'](_0x5cbf02,_0x1d970d)[_0xaa9d('0xb')](function(_0x1b7fce){logger['info'](_0xaa9d('0xc'),_0x480a10,_0xaa9d('0xd'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x480a10,_0xaa9d('0xd'),JSON['stringify'](_0x1b7fce));if(_0x1b7fce['error']){if(_0x1b7fce[_0xaa9d('0xe')][_0xaa9d('0xf')]===0x1f4){logger['error'](_0xaa9d('0xc'),_0x480a10,_0x1b7fce[_0xaa9d('0xe')]['message']);return _0x12eeed(_0x1b7fce['error'][_0xaa9d('0x10')]);}logger[_0xaa9d('0xe')](_0xaa9d('0xc'),_0x480a10,_0x1b7fce['error'][_0xaa9d('0x10')]);return _0x4b7ee8(_0x1b7fce[_0xaa9d('0xe')][_0xaa9d('0x10')]);}else{logger[_0xaa9d('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x480a10,'request\x20sent');_0x4b7ee8(_0x1b7fce['result'][_0xaa9d('0x10')]);}})[_0xaa9d('0x12')](function(_0x4b2663){logger['error'](_0xaa9d('0xc'),_0x480a10,_0x4b2663);_0x12eeed(_0x4b2663);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 44c4b1f..9670af8 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 _0x5b47=['multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','/:id','show','post','isAuthenticated','create','put','update','delete','exports'];(function(_0x1a286f,_0x374d52){var _0x33e8b0=function(_0xc49f77){while(--_0xc49f77){_0x1a286f['push'](_0x1a286f['shift']());}};_0x33e8b0(++_0x374d52);}(_0x5b47,0x120));var _0x75b4=function(_0x15bdbf,_0x58fa07){_0x15bdbf=_0x15bdbf-0x0;var _0x15bc02=_0x5b47[_0x15bdbf];return _0x15bc02;};'use strict';var multer=require(_0x75b4('0x0'));var util=require(_0x75b4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x75b4('0x2'));var interaction=require(_0x75b4('0x3'));var config=require(_0x75b4('0x4'));var controller=require(_0x75b4('0x5'));router[_0x75b4('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x75b4('0x7'),auth['isAuthenticated'](),controller[_0x75b4('0x8')]);router[_0x75b4('0x9')]('/',auth[_0x75b4('0xa')](),controller[_0x75b4('0xb')]);router[_0x75b4('0xc')](_0x75b4('0x7'),auth[_0x75b4('0xa')](),controller[_0x75b4('0xd')]);router[_0x75b4('0xe')]('/:id',auth[_0x75b4('0xa')](),controller['destroy']);module[_0x75b4('0xf')]=router; \ No newline at end of file +var _0x5ae0=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router'];(function(_0x3967b4,_0x34ea5f){var _0x16e7bc=function(_0x23962a){while(--_0x23962a){_0x3967b4['push'](_0x3967b4['shift']());}};_0x16e7bc(++_0x34ea5f);}(_0x5ae0,0xf8));var _0x05ae=function(_0x1a7a20,_0x13afdd){_0x1a7a20=_0x1a7a20-0x0;var _0x42e15b=_0x5ae0[_0x1a7a20];return _0x42e15b;};'use strict';var multer=require('multer');var util=require(_0x05ae('0x0'));var path=require(_0x05ae('0x1'));var timeout=require('connect-timeout');var express=require(_0x05ae('0x2'));var router=express[_0x05ae('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x05ae('0x4'));var interaction=require(_0x05ae('0x5'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x05ae('0x6')]('/',auth[_0x05ae('0x7')](),controller[_0x05ae('0x8')]);router['get'](_0x05ae('0x9'),auth[_0x05ae('0x7')](),controller[_0x05ae('0xa')]);router[_0x05ae('0xb')]('/',auth[_0x05ae('0x7')](),controller[_0x05ae('0xc')]);router[_0x05ae('0xd')](_0x05ae('0x9'),auth[_0x05ae('0x7')](),controller[_0x05ae('0xe')]);router[_0x05ae('0xf')](_0x05ae('0x9'),auth[_0x05ae('0x7')](),controller[_0x05ae('0x10')]);module[_0x05ae('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 910b69f..12ce396 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 _0xe706=['STRING','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x264ca6,_0x99377){var _0x2ce798=function(_0xaa8d6b){while(--_0xaa8d6b){_0x264ca6['push'](_0x264ca6['shift']());}};_0x2ce798(++_0x99377);}(_0xe706,0xa3));var _0x6e70=function(_0x3382e5,_0x4bfaa8){_0x3382e5=_0x3382e5-0x0;var _0x5efe1a=_0xe706[_0x3382e5];return _0x5efe1a;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'type':{'type':Sequelize[_0x6e70('0x2')]('string',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'defaultValue':_0x6e70('0x7')},'content':{'type':Sequelize[_0x6e70('0x8')]},'key':{'type':Sequelize[_0x6e70('0x8')]},'keyType':{'type':Sequelize[_0x6e70('0x2')](_0x6e70('0x7'),_0x6e70('0x3'),_0x6e70('0x4'))},'keyContent':{'type':Sequelize[_0x6e70('0x8')]},'idField':{'type':Sequelize[_0x6e70('0x8')]},'variableName':{'type':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xa9e0=['string','STRING','variable','sequelize','exports','ENUM','customVariable','picklist'];(function(_0x4e4b45,_0x2503e1){var _0x33c04b=function(_0x26ed22){while(--_0x26ed22){_0x4e4b45['push'](_0x4e4b45['shift']());}};_0x33c04b(++_0x2503e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('string','variable',_0x0a9e('0x3'),'keyValue',_0x0a9e('0x4')),'defaultValue':_0x0a9e('0x5')},'content':{'type':Sequelize[_0x0a9e('0x6')]},'key':{'type':Sequelize[_0x0a9e('0x6')]},'keyType':{'type':Sequelize[_0x0a9e('0x2')]('string',_0x0a9e('0x7'),_0x0a9e('0x3'))},'keyContent':{'type':Sequelize[_0x0a9e('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index e297338..dddcf40 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 _0xd8fb=['merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8fb,0x99));var _0xbd8f=function(_0x1c09a1,_0x3d332b){_0x1c09a1=_0x1c09a1-0x0;var _0x508e3e=_0xd8fb[_0x1c09a1];return _0x508e3e;};'use strict';var emlformat=require(_0xbd8f('0x0'));var rimraf=require(_0xbd8f('0x1'));var zipdir=require(_0xbd8f('0x2'));var jsonpatch=require(_0xbd8f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbd8f('0x4'));var util=require(_0xbd8f('0x5'));var path=require('path');var sox=require(_0xbd8f('0x6'));var csv=require(_0xbd8f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd8f('0x8'));var _=require('lodash');var squel=require(_0xbd8f('0x9'));var crypto=require('crypto');var jsforce=require(_0xbd8f('0xa'));var deskjs=require(_0xbd8f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd8f('0xc'));var Redis=require(_0xbd8f('0xd'));var authService=require(_0xbd8f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbd8f('0xf'));var hardwareService=require(_0xbd8f('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xbd8f('0x11'));var config=require(_0xbd8f('0x12'));var licenseUtil=require(_0xbd8f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x230988,_0x159f09){_0x159f09=_0x159f09||0xcc;return function(_0x39be16){if(_0x39be16){return _0x230988[_0xbd8f('0x14')](_0x159f09);}return _0x230988[_0xbd8f('0x15')](_0x159f09)[_0xbd8f('0x16')]();};}function respondWithResult(_0x37d4d5,_0x29ffe8){_0x29ffe8=_0x29ffe8||0xc8;return function(_0x14606c){if(_0x14606c){return _0x37d4d5['status'](_0x29ffe8)[_0xbd8f('0x17')](_0x14606c);}};}function respondWithFilteredResult(_0x829fb2,_0xa57e91){return function(_0x10d72e){if(_0x10d72e){var _0x4da96f=_0x10d72e[_0xbd8f('0x18')],_0x174929=_0xa57e91[_0xbd8f('0x19')],_0x63db18=_0xa57e91['offset']+_0xa57e91[_0xbd8f('0x1a')],_0x5ebf8b;if(_0x63db18>=_0x4da96f){_0x63db18=_0x4da96f;_0x5ebf8b=0xc8;}else{_0x5ebf8b=0xce;}_0x829fb2[_0xbd8f('0x15')](_0x5ebf8b);return _0x829fb2['set']('Content-Range',_0x174929+'-'+_0x63db18+'/'+_0x4da96f)[_0xbd8f('0x17')](_0x10d72e);}return null;};}function patchUpdates(_0x5d2fdb){return function(_0x5705c5){try{jsonpatch[_0xbd8f('0x1b')](_0x5705c5,_0x5d2fdb,!![]);}catch(_0x4b5fac){return BPromise[_0xbd8f('0x1c')](_0x4b5fac);}return _0x5705c5[_0xbd8f('0x1d')]();};}function saveUpdates(_0xb47c8e,_0x897f25){return function(_0xdc11cc){if(_0xdc11cc){return _0xdc11cc[_0xbd8f('0x1e')](_0xb47c8e)[_0xbd8f('0x1f')](function(_0x90eff8){return _0x90eff8;});}return null;};}function removeEntity(_0x2fbe3b,_0x775acc){return function(_0xfe4048){if(_0xfe4048){return _0xfe4048[_0xbd8f('0x20')]()[_0xbd8f('0x1f')](function(){_0x2fbe3b[_0xbd8f('0x15')](0xcc)[_0xbd8f('0x16')]();});}};}function handleEntityNotFound(_0xd11ae,_0x395b1b){return function(_0x4ba8db){if(!_0x4ba8db){_0xd11ae[_0xbd8f('0x14')](0x194);}return _0x4ba8db;};}function handleError(_0x9fa3b1,_0x1f9fcc){_0x1f9fcc=_0x1f9fcc||0x1f4;return function(_0x2f3df7){logger[_0xbd8f('0x21')](_0x2f3df7[_0xbd8f('0x22')]);if(_0x2f3df7[_0xbd8f('0x23')]){delete _0x2f3df7[_0xbd8f('0x23')];}_0x9fa3b1['status'](_0x1f9fcc)[_0xbd8f('0x24')](_0x2f3df7);};}exports[_0xbd8f('0x25')]=function(_0x5a3a8c,_0x339df7){var _0x557daa={},_0x41b2a6={},_0x30d62e={'count':0x0,'rows':[]};var _0x991401=_[_0xbd8f('0x26')](db[_0xbd8f('0x27')][_0xbd8f('0x28')],function(_0x4c4431){return{'name':_0x4c4431[_0xbd8f('0x29')],'type':_0x4c4431[_0xbd8f('0x2a')][_0xbd8f('0x2b')]};});_0x41b2a6[_0xbd8f('0x2c')]=_[_0xbd8f('0x26')](_0x991401,_0xbd8f('0x23'));_0x41b2a6[_0xbd8f('0x2d')]=_['keys'](_0x5a3a8c[_0xbd8f('0x2d')]);_0x41b2a6[_0xbd8f('0x2e')]=_[_0xbd8f('0x2f')](_0x41b2a6[_0xbd8f('0x2c')],_0x41b2a6['query']);_0x557daa['attributes']=_[_0xbd8f('0x2f')](_0x41b2a6[_0xbd8f('0x2c')],qs[_0xbd8f('0x30')](_0x5a3a8c[_0xbd8f('0x2d')]['fields']));_0x557daa[_0xbd8f('0x31')]=_0x557daa[_0xbd8f('0x31')][_0xbd8f('0x32')]?_0x557daa[_0xbd8f('0x31')]:_0x41b2a6[_0xbd8f('0x2c')];if(!_0x5a3a8c['query'][_0xbd8f('0x33')](_0xbd8f('0x34'))){_0x557daa[_0xbd8f('0x1a')]=qs[_0xbd8f('0x1a')](_0x5a3a8c[_0xbd8f('0x2d')]['limit']);_0x557daa[_0xbd8f('0x19')]=qs['offset'](_0x5a3a8c[_0xbd8f('0x2d')][_0xbd8f('0x19')]);}_0x557daa[_0xbd8f('0x35')]=qs[_0xbd8f('0x36')](_0x5a3a8c[_0xbd8f('0x2d')][_0xbd8f('0x36')]);_0x557daa['where']=qs['filters'](_['pick'](_0x5a3a8c[_0xbd8f('0x2d')],_0x41b2a6[_0xbd8f('0x2e')]),_0x991401);if(_0x5a3a8c[_0xbd8f('0x2d')][_0xbd8f('0x37')]){_0x557daa[_0xbd8f('0x38')]=_[_0xbd8f('0x39')](_0x557daa[_0xbd8f('0x38')],{'$or':_[_0xbd8f('0x26')](_0x991401,function(_0x2d4882){if(_0x2d4882[_0xbd8f('0x2a')]!==_0xbd8f('0x3a')){var _0x339c70={};_0x339c70[_0x2d4882[_0xbd8f('0x23')]]={'$like':'%'+_0x5a3a8c[_0xbd8f('0x2d')][_0xbd8f('0x37')]+'%'};return _0x339c70;}})});}_0x557daa=_['merge']({},_0x557daa,_0x5a3a8c[_0xbd8f('0x3b')]);var _0x4181e0={'where':_0x557daa['where']};return db[_0xbd8f('0x27')][_0xbd8f('0x18')](_0x4181e0)[_0xbd8f('0x1f')](function(_0x582bcf){_0x30d62e[_0xbd8f('0x18')]=_0x582bcf;if(_0x5a3a8c['query'][_0xbd8f('0x3c')]){_0x557daa[_0xbd8f('0x3d')]=[{'all':!![]}];}return db[_0xbd8f('0x27')]['findAll'](_0x557daa);})[_0xbd8f('0x1f')](function(_0x72fe99){_0x30d62e[_0xbd8f('0x3e')]=_0x72fe99;return _0x30d62e;})['then'](respondWithFilteredResult(_0x339df7,_0x557daa))[_0xbd8f('0x3f')](handleError(_0x339df7,null));};exports[_0xbd8f('0x40')]=function(_0x2c1397,_0x351027){var _0x280d95={'raw':!![],'where':{'id':_0x2c1397[_0xbd8f('0x41')]['id']}},_0x1db8c7={};_0x1db8c7[_0xbd8f('0x2c')]=_[_0xbd8f('0x42')](db['SalesforceField']['rawAttributes']);_0x1db8c7[_0xbd8f('0x2d')]=_[_0xbd8f('0x42')](_0x2c1397[_0xbd8f('0x2d')]);_0x1db8c7[_0xbd8f('0x2e')]=_['intersection'](_0x1db8c7[_0xbd8f('0x2c')],_0x1db8c7[_0xbd8f('0x2d')]);_0x280d95[_0xbd8f('0x31')]=_[_0xbd8f('0x2f')](_0x1db8c7[_0xbd8f('0x2c')],qs['fields'](_0x2c1397['query'][_0xbd8f('0x30')]));_0x280d95['attributes']=_0x280d95[_0xbd8f('0x31')][_0xbd8f('0x32')]?_0x280d95[_0xbd8f('0x31')]:_0x1db8c7[_0xbd8f('0x2c')];if(_0x2c1397[_0xbd8f('0x2d')][_0xbd8f('0x3c')]){_0x280d95[_0xbd8f('0x3d')]=[{'all':!![]}];}_0x280d95=_[_0xbd8f('0x39')]({},_0x280d95,_0x2c1397['options']);return db[_0xbd8f('0x27')][_0xbd8f('0x43')](_0x280d95)[_0xbd8f('0x1f')](handleEntityNotFound(_0x351027,null))[_0xbd8f('0x1f')](respondWithResult(_0x351027,null))[_0xbd8f('0x3f')](handleError(_0x351027,null));};exports[_0xbd8f('0x44')]=function(_0x272f70,_0x3918a5){return db['SalesforceField'][_0xbd8f('0x44')](_0x272f70[_0xbd8f('0x45')],{})[_0xbd8f('0x1f')](respondWithResult(_0x3918a5,0xc9))[_0xbd8f('0x3f')](handleError(_0x3918a5,null));};exports[_0xbd8f('0x1e')]=function(_0x1e40f2,_0x42bada){if(_0x1e40f2[_0xbd8f('0x45')]['id']){delete _0x1e40f2[_0xbd8f('0x45')]['id'];}return db[_0xbd8f('0x27')][_0xbd8f('0x43')]({'where':{'id':_0x1e40f2[_0xbd8f('0x41')]['id']}})[_0xbd8f('0x1f')](handleEntityNotFound(_0x42bada,null))[_0xbd8f('0x1f')](saveUpdates(_0x1e40f2[_0xbd8f('0x45')],null))[_0xbd8f('0x1f')](respondWithResult(_0x42bada,null))[_0xbd8f('0x3f')](handleError(_0x42bada,null));};exports[_0xbd8f('0x20')]=function(_0x2668a4,_0x4d32c4){return db[_0xbd8f('0x27')][_0xbd8f('0x43')]({'where':{'id':_0x2668a4[_0xbd8f('0x41')]['id']}})[_0xbd8f('0x1f')](handleEntityNotFound(_0x4d32c4,null))['then'](removeEntity(_0x4d32c4,null))[_0xbd8f('0x3f')](handleError(_0x4d32c4,null));}; \ No newline at end of file +var _0x524e=['error','stack','name','send','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','SalesforceField','count','includeAll','include','rows','catch','show','params','keys','intersection','find','create','body','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','end','json','limit','set','Content-Range','apply','save','update','then','destroy'];(function(_0x54e2c3,_0x4b9c78){var _0x3a7910=function(_0x432ea5){while(--_0x432ea5){_0x54e2c3['push'](_0x54e2c3['shift']());}};_0x3a7910(++_0x4b9c78);}(_0x524e,0x15e));var _0xe524=function(_0x590c06,_0x2c889b){_0x590c06=_0x590c06-0x0;var _0x3b58a5=_0x524e[_0x590c06];return _0x3b58a5;};'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=_0x569660['count'],_0x109795=_0x48165e['offset'],_0x538754=_0x48165e['offset']+_0x48165e[_0xe524('0x20')],_0x29a031;if(_0x538754>=_0x488fce){_0x538754=_0x488fce;_0x29a031=0xc8;}else{_0x29a031=0xce;}_0x1b0af6['status'](_0x29a031);return _0x1b0af6[_0xe524('0x21')](_0xe524('0x22'),_0x109795+'-'+_0x538754+'/'+_0x488fce)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x209d0b){return function(_0x5d7b17){try{jsonpatch[_0xe524('0x23')](_0x5d7b17,_0x209d0b,!![]);}catch(_0x3ccb3f){return BPromise['reject'](_0x3ccb3f);}return _0x5d7b17[_0xe524('0x24')]();};}function saveUpdates(_0x309f85,_0x43a4f9){return function(_0x1dcc0f){if(_0x1dcc0f){return _0x1dcc0f[_0xe524('0x25')](_0x309f85)[_0xe524('0x26')](function(_0xbf059b){return _0xbf059b;});}return null;};}function removeEntity(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')]()['then'](function(){_0x375219['status'](0xcc)[_0xe524('0x1e')]();});}};}function handleEntityNotFound(_0x23df5e,_0x1ad106){return function(_0x85fc51){if(!_0x85fc51){_0x23df5e['sendStatus'](0x194);}return _0x85fc51;};}function handleError(_0x158f07,_0x4a03bc){_0x4a03bc=_0x4a03bc||0x1f4;return function(_0x17e245){logger[_0xe524('0x28')](_0x17e245[_0xe524('0x29')]);if(_0x17e245[_0xe524('0x2a')]){delete _0x17e245[_0xe524('0x2a')];}_0x158f07[_0xe524('0x1d')](_0x4a03bc)[_0xe524('0x2b')](_0x17e245);};}exports['index']=function(_0x58a896,_0x283f18){var _0x45abad={},_0x476572={},_0x109a96={'count':0x0,'rows':[]};var _0x359c8b=_['map'](db['SalesforceField'][_0xe524('0x2c')],function(_0x25e7a7){return{'name':_0x25e7a7[_0xe524('0x2d')],'type':_0x25e7a7[_0xe524('0x2e')][_0xe524('0x2f')]};});_0x476572['model']=_[_0xe524('0x30')](_0x359c8b,_0xe524('0x2a'));_0x476572['query']=_['keys'](_0x58a896[_0xe524('0x31')]);_0x476572[_0xe524('0x32')]=_['intersection'](_0x476572[_0xe524('0x33')],_0x476572['query']);_0x45abad[_0xe524('0x34')]=_['intersection'](_0x476572[_0xe524('0x33')],qs[_0xe524('0x35')](_0x58a896[_0xe524('0x31')]['fields']));_0x45abad[_0xe524('0x34')]=_0x45abad['attributes'][_0xe524('0x36')]?_0x45abad[_0xe524('0x34')]:_0x476572[_0xe524('0x33')];if(!_0x58a896['query'][_0xe524('0x37')](_0xe524('0x38'))){_0x45abad['limit']=qs[_0xe524('0x20')](_0x58a896[_0xe524('0x31')][_0xe524('0x20')]);_0x45abad[_0xe524('0x39')]=qs['offset'](_0x58a896[_0xe524('0x31')][_0xe524('0x39')]);}_0x45abad[_0xe524('0x3a')]=qs[_0xe524('0x3b')](_0x58a896[_0xe524('0x31')][_0xe524('0x3b')]);_0x45abad[_0xe524('0x3c')]=qs[_0xe524('0x32')](_['pick'](_0x58a896[_0xe524('0x31')],_0x476572['filters']),_0x359c8b);if(_0x58a896[_0xe524('0x31')][_0xe524('0x3d')]){_0x45abad['where']=_[_0xe524('0x3e')](_0x45abad['where'],{'$or':_[_0xe524('0x30')](_0x359c8b,function(_0x41af26){if(_0x41af26[_0xe524('0x2e')]!==_0xe524('0x3f')){var _0x82a87b={};_0x82a87b[_0x41af26[_0xe524('0x2a')]]={'$like':'%'+_0x58a896[_0xe524('0x31')][_0xe524('0x3d')]+'%'};return _0x82a87b;}})});}_0x45abad=_['merge']({},_0x45abad,_0x58a896[_0xe524('0x40')]);var _0x940c05={'where':_0x45abad[_0xe524('0x3c')]};return db[_0xe524('0x41')][_0xe524('0x42')](_0x940c05)[_0xe524('0x26')](function(_0x1d9648){_0x109a96[_0xe524('0x42')]=_0x1d9648;if(_0x58a896['query'][_0xe524('0x43')]){_0x45abad[_0xe524('0x44')]=[{'all':!![]}];}return db[_0xe524('0x41')]['findAll'](_0x45abad);})[_0xe524('0x26')](function(_0x5213ed){_0x109a96[_0xe524('0x45')]=_0x5213ed;return _0x109a96;})[_0xe524('0x26')](respondWithFilteredResult(_0x283f18,_0x45abad))[_0xe524('0x46')](handleError(_0x283f18,null));};exports[_0xe524('0x47')]=function(_0x27a9e5,_0x4746cd){var _0xbeb2a9={'raw':!![],'where':{'id':_0x27a9e5[_0xe524('0x48')]['id']}},_0x52cd0e={};_0x52cd0e[_0xe524('0x33')]=_[_0xe524('0x49')](db[_0xe524('0x41')][_0xe524('0x2c')]);_0x52cd0e[_0xe524('0x31')]=_['keys'](_0x27a9e5[_0xe524('0x31')]);_0x52cd0e[_0xe524('0x32')]=_[_0xe524('0x4a')](_0x52cd0e['model'],_0x52cd0e[_0xe524('0x31')]);_0xbeb2a9['attributes']=_['intersection'](_0x52cd0e[_0xe524('0x33')],qs[_0xe524('0x35')](_0x27a9e5['query'][_0xe524('0x35')]));_0xbeb2a9[_0xe524('0x34')]=_0xbeb2a9[_0xe524('0x34')][_0xe524('0x36')]?_0xbeb2a9['attributes']:_0x52cd0e['model'];if(_0x27a9e5[_0xe524('0x31')][_0xe524('0x43')]){_0xbeb2a9['include']=[{'all':!![]}];}_0xbeb2a9=_[_0xe524('0x3e')]({},_0xbeb2a9,_0x27a9e5['options']);return db[_0xe524('0x41')][_0xe524('0x4b')](_0xbeb2a9)[_0xe524('0x26')](handleEntityNotFound(_0x4746cd,null))[_0xe524('0x26')](respondWithResult(_0x4746cd,null))[_0xe524('0x46')](handleError(_0x4746cd,null));};exports[_0xe524('0x4c')]=function(_0x305503,_0x22fb42){return db[_0xe524('0x41')][_0xe524('0x4c')](_0x305503[_0xe524('0x4d')],{})[_0xe524('0x26')](respondWithResult(_0x22fb42,0xc9))[_0xe524('0x46')](handleError(_0x22fb42,null));};exports[_0xe524('0x25')]=function(_0x37d44d,_0x4dff40){if(_0x37d44d[_0xe524('0x4d')]['id']){delete _0x37d44d['body']['id'];}return db['SalesforceField'][_0xe524('0x4b')]({'where':{'id':_0x37d44d['params']['id']}})[_0xe524('0x26')](handleEntityNotFound(_0x4dff40,null))[_0xe524('0x26')](saveUpdates(_0x37d44d['body'],null))[_0xe524('0x26')](respondWithResult(_0x4dff40,null))['catch'](handleError(_0x4dff40,null));};exports['destroy']=function(_0x2fa574,_0x1e5687){return db[_0xe524('0x41')]['find']({'where':{'id':_0x2fa574['params']['id']}})['then'](handleEntityNotFound(_0x1e5687,null))['then'](removeEntity(_0x1e5687,null))['catch'](handleError(_0x1e5687,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 3657fee..b4c9d99 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 _0xd9c6=['util','../../config/logger','api','bluebird','request-promise','path','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash'];(function(_0x5f07f0,_0x1b1d8c){var _0x18358b=function(_0x531167){while(--_0x531167){_0x5f07f0['push'](_0x5f07f0['shift']());}};_0x18358b(++_0x1b1d8c);}(_0xd9c6,0x99));var _0x6d9c=function(_0x3f9654,_0x39767f){_0x3f9654=_0x3f9654-0x0;var _0x4f68d3=_0xd9c6[_0x3f9654];return _0x4f68d3;};'use strict';var _=require(_0x6d9c('0x0'));var util=require(_0x6d9c('0x1'));var logger=require(_0x6d9c('0x2'))(_0x6d9c('0x3'));var moment=require('moment');var BPromise=require(_0x6d9c('0x4'));var rp=require(_0x6d9c('0x5'));var fs=require('fs');var path=require(_0x6d9c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d9c('0x7'));module['exports']=function(_0x37f03e,_0x5e00ab){return _0x37f03e[_0x6d9c('0x8')](_0x6d9c('0x9'),attributes,{'tableName':_0x6d9c('0xa'),'paranoid':![],'indexes':[{'name':_0x6d9c('0xb'),'fields':[_0x6d9c('0xc'),_0x6d9c('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7940=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7940,0x1ee));var _0x0794=function(_0x1b2bfc,_0x383b80){_0x1b2bfc=_0x1b2bfc-0x0;var _0x4d3091=_0x7940[_0x1b2bfc];return _0x4d3091;};'use strict';var _=require(_0x0794('0x0'));var util=require('util');var logger=require(_0x0794('0x1'))(_0x0794('0x2'));var moment=require(_0x0794('0x3'));var BPromise=require('bluebird');var rp=require(_0x0794('0x4'));var fs=require('fs');var path=require(_0x0794('0x5'));var rimraf=require(_0x0794('0x6'));var config=require(_0x0794('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x0794('0x8')]=function(_0x3a74d2,_0x1597f0){return _0x3a74d2[_0x0794('0x9')](_0x0794('0xa'),attributes,{'tableName':_0x0794('0xb'),'paranoid':![],'indexes':[{'name':_0x0794('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 28e4520..d5de3ac 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 _0x9ffd=['SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SalesforceField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x1a976f,_0xd3e7d5){var _0x2a776d=function(_0x151842){while(--_0x151842){_0x1a976f['push'](_0x1a976f['shift']());}};_0x2a776d(++_0xd3e7d5);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1633a0,_0x198d6f){_0x1633a0=_0x1633a0-0x0;var _0x4a5d10=_0x9ffd[_0x1633a0];return _0x4a5d10;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('SalesforceField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('SalesforceField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('SalesforceField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0xa9e0=['http','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\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(_0x2cdc85,_0x5df741){var _0x41c4e6=function(_0x19269c){while(--_0x19269c){_0x2cdc85['push'](_0x2cdc85['shift']());}};_0x41c4e6(++_0x5df741);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index f9225c5..1e05470 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 _0x7916=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','path','connect-timeout'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7916,0x128));var _0x6791=function(_0x4e3f96,_0x5c775f){_0x4e3f96=_0x4e3f96-0x0;var _0x5dd244=_0x7916[_0x4e3f96];return _0x5dd244;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['get']('/:id/configurations',auth[_0x6791('0x8')](),controller[_0x6791('0xc')]);router['get'](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router['post']('/',auth[_0x6791('0x8')](),controller[_0x6791('0xf')]);router[_0x6791('0x10')](_0x6791('0x11'),auth[_0x6791('0x8')](),controller[_0x6791('0x12')]);router[_0x6791('0x13')](_0x6791('0xa'),auth[_0x6791('0x8')](),controller[_0x6791('0x14')]);router[_0x6791('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x6791('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0102=['getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','destroy','exports','util','path','connect-timeout','express','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x0102,0x186));var _0x2010=function(_0x252bb7,_0x390f2a){_0x252bb7=_0x252bb7-0x0;var _0x40f805=_0x0102[_0x252bb7];return _0x40f805;};'use strict';var multer=require('multer');var util=require(_0x2010('0x0'));var path=require(_0x2010('0x1'));var timeout=require(_0x2010('0x2'));var express=require(_0x2010('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2010('0x4'));router[_0x2010('0x5')]('/',auth[_0x2010('0x6')](),controller[_0x2010('0x7')]);router['get'](_0x2010('0x8'),auth['isAuthenticated'](),controller[_0x2010('0x9')]);router[_0x2010('0x5')]('/:id/configurations',auth[_0x2010('0x6')](),controller[_0x2010('0xa')]);router[_0x2010('0x5')](_0x2010('0xb'),auth[_0x2010('0x6')](),controller[_0x2010('0xc')]);router[_0x2010('0xd')]('/',auth[_0x2010('0x6')](),controller[_0x2010('0xe')]);router[_0x2010('0xd')](_0x2010('0xf'),auth[_0x2010('0x6')](),controller[_0x2010('0x10')]);router[_0x2010('0x11')](_0x2010('0x8'),auth[_0x2010('0x6')](),controller['update']);router['delete'](_0x2010('0x8'),auth[_0x2010('0x6')](),controller[_0x2010('0x12')]);module[_0x2010('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index fbb6efb..70f6782 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 _0x267a=['STRING','username','sequelize','exports'];(function(_0x38d333,_0x1d0bbe){var _0x193fff=function(_0x5c03b4){while(--_0x5c03b4){_0x38d333['push'](_0x38d333['shift']());}};_0x193fff(++_0x1d0bbe);}(_0x267a,0x13e));var _0xa267=function(_0x2fc113,_0x45ec6e){_0x2fc113=_0x2fc113-0x0;var _0x5144ce=_0x267a[_0x2fc113];return _0x5144ce;};'use strict';var Sequelize=require(_0xa267('0x0'));module[_0xa267('0x1')]={'name':{'type':Sequelize[_0xa267('0x2')]},'description':{'type':Sequelize[_0xa267('0x2')]},'username':{'type':Sequelize[_0xa267('0x2')],'unique':_0xa267('0x3')},'password':{'type':Sequelize[_0xa267('0x2')]},'email':{'type':Sequelize[_0xa267('0x2')]},'remoteUri':{'type':Sequelize[_0xa267('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa267('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xddb8=['sequelize','exports','STRING','username','remoteUri'];(function(_0x4a2e12,_0x8b172b){var _0x2b8506=function(_0x5b9d30){while(--_0x5b9d30){_0x4a2e12['push'](_0x4a2e12['shift']());}};_0x2b8506(++_0x8b172b);}(_0xddb8,0x10e));var _0x8ddb=function(_0x493ead,_0x3e2028){_0x493ead=_0x493ead-0x0;var _0x3f84b1=_0xddb8[_0x493ead];return _0x3f84b1;};'use strict';var Sequelize=require(_0x8ddb('0x0'));module[_0x8ddb('0x1')]={'name':{'type':Sequelize[_0x8ddb('0x2')]},'description':{'type':Sequelize[_0x8ddb('0x2')]},'username':{'type':Sequelize[_0x8ddb('0x2')],'unique':_0x8ddb('0x3')},'password':{'type':Sequelize[_0x8ddb('0x2')]},'email':{'type':Sequelize[_0x8ddb('0x2')]},'remoteUri':{'type':Sequelize[_0x8ddb('0x2')],'unique':_0x8ddb('0x4')},'serverUrl':{'type':Sequelize[_0x8ddb('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 f47e012..e6c899a 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 _0xbff5=['type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','count','includeAll','findAll','rows','show','params','include','find','create','body','getConfigurations','ServicenowConfiguration','addConfiguration','findOne','Subjects','Descriptions','getDescriptions','ServicenowField','getFields','knowledge','subcategory','close_code','severity','category','made_sla','caused_by','watch_list','upon_reject','hold_reason','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','notify','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','activity_due','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','password','remoteUri','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','label','assign','TCL:\x20_object','internalType','push','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','client','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','map','ServicenowAccount','rawAttributes','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbff5,0x86));var _0x5bff=function(_0x290440,_0x5a139d){_0x290440=_0x290440-0x0;var _0x52d33e=_0xbff5[_0x290440];return _0x52d33e;};'use strict';var emlformat=require(_0x5bff('0x0'));var rimraf=require(_0x5bff('0x1'));var zipdir=require(_0x5bff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5bff('0x3'));var moment=require(_0x5bff('0x4'));var BPromise=require(_0x5bff('0x5'));var Mustache=require('mustache');var util=require(_0x5bff('0x6'));var path=require(_0x5bff('0x7'));var sox=require(_0x5bff('0x8'));var csv=require(_0x5bff('0x9'));var ejs=require(_0x5bff('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5bff('0xb'));var squel=require(_0x5bff('0xc'));var crypto=require(_0x5bff('0xd'));var jsforce=require(_0x5bff('0xe'));var deskjs=require(_0x5bff('0xf'));var toCsv=require(_0x5bff('0x9'));var querystring=require('querystring');var Papa=require(_0x5bff('0x10'));var Redis=require(_0x5bff('0x11'));var authService=require(_0x5bff('0x12'));var qs=require(_0x5bff('0x13'));var as=require(_0x5bff('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bff('0x15'))(_0x5bff('0x16'));var utils=require(_0x5bff('0x17'));var config=require(_0x5bff('0x18'));var licenseUtil=require(_0x5bff('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5bff('0x1a'));var jayson=require('jayson/promise');var client=jayson[_0x5bff('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28e891,_0x288a18,_0x15f029,_0xc61c3f){return new BPromise(function(_0x4fe8a8,_0x1df002){var _0x1d50f5=_0xc61c3f||client;return _0x1d50f5['request'](_0x28e891,_0x15f029)[_0x5bff('0x1c')](function(_0x51ad14){logger[_0x5bff('0x1d')]('ServicenowAccount,\x20%s,\x20%s',_0x288a18,_0x5bff('0x1e'));logger[_0x5bff('0x1f')](_0x5bff('0x20'),_0x288a18,_0x5bff('0x1e'),JSON[_0x5bff('0x21')](_0x51ad14));if(_0x51ad14[_0x5bff('0x22')]){if(_0x51ad14[_0x5bff('0x22')][_0x5bff('0x23')]===0x1f4){logger[_0x5bff('0x22')]('ServicenowAccount,\x20%s,\x20%s',_0x288a18,_0x51ad14[_0x5bff('0x22')][_0x5bff('0x24')]);return _0x1df002(_0x51ad14[_0x5bff('0x22')][_0x5bff('0x24')]);}logger[_0x5bff('0x22')](_0x5bff('0x25'),_0x288a18,_0x51ad14[_0x5bff('0x22')][_0x5bff('0x24')]);return _0x4fe8a8(_0x51ad14[_0x5bff('0x22')][_0x5bff('0x24')]);}else{logger[_0x5bff('0x1d')](_0x5bff('0x25'),_0x288a18,_0x5bff('0x1e'));_0x4fe8a8(_0x51ad14['result']['message']);}})[_0x5bff('0x26')](function(_0x30a4df){logger['error'](_0x5bff('0x25'),_0x288a18,_0x30a4df);_0x1df002(_0x30a4df);});});}function respondWithStatusCode(_0x3b40d8,_0x564138){_0x564138=_0x564138||0xcc;return function(_0xcc07d5){if(_0xcc07d5){return _0x3b40d8[_0x5bff('0x27')](_0x564138);}return _0x3b40d8[_0x5bff('0x28')](_0x564138)[_0x5bff('0x29')]();};}function respondWithResult(_0x17f2ef,_0x50dd92){_0x50dd92=_0x50dd92||0xc8;return function(_0x100ff9){if(_0x100ff9){return _0x17f2ef[_0x5bff('0x28')](_0x50dd92)[_0x5bff('0x2a')](_0x100ff9);}};}function respondWithFilteredResult(_0xafa982,_0x1b9ec3){return function(_0xfb59e2){if(_0xfb59e2){var _0xf148b1=_0xfb59e2['count'],_0x175e42=_0x1b9ec3['offset'],_0x21a705=_0x1b9ec3[_0x5bff('0x2b')]+_0x1b9ec3[_0x5bff('0x2c')],_0x5cb094;if(_0x21a705>=_0xf148b1){_0x21a705=_0xf148b1;_0x5cb094=0xc8;}else{_0x5cb094=0xce;}_0xafa982[_0x5bff('0x28')](_0x5cb094);return _0xafa982[_0x5bff('0x2d')](_0x5bff('0x2e'),_0x175e42+'-'+_0x21a705+'/'+_0xf148b1)[_0x5bff('0x2a')](_0xfb59e2);}return null;};}function patchUpdates(_0xd4cf29){return function(_0x38ebca){try{jsonpatch[_0x5bff('0x2f')](_0x38ebca,_0xd4cf29,!![]);}catch(_0x781ca7){return BPromise[_0x5bff('0x30')](_0x781ca7);}return _0x38ebca[_0x5bff('0x31')]();};}function saveUpdates(_0x4868a0,_0x1b562b){return function(_0x4dd83c){if(_0x4dd83c){return _0x4dd83c[_0x5bff('0x32')](_0x4868a0)[_0x5bff('0x1c')](function(_0x5625eb){return _0x5625eb;});}return null;};}function removeEntity(_0x529643,_0x5c5f0e){return function(_0x197373){if(_0x197373){return _0x197373[_0x5bff('0x33')]()[_0x5bff('0x1c')](function(){_0x529643['status'](0xcc)[_0x5bff('0x29')]();});}};}function handleEntityNotFound(_0x4ea578,_0x3f1973){return function(_0x38fc67){if(!_0x38fc67){_0x4ea578['sendStatus'](0x194);}return _0x38fc67;};}function handleError(_0x11d3ae,_0x1b1373){_0x1b1373=_0x1b1373||0x1f4;return function(_0x7776bc){logger[_0x5bff('0x22')](_0x7776bc[_0x5bff('0x34')]);if(_0x7776bc[_0x5bff('0x35')]){delete _0x7776bc[_0x5bff('0x35')];}_0x11d3ae[_0x5bff('0x28')](_0x1b1373)['send'](_0x7776bc);};}exports['index']=function(_0x1a4970,_0x3df3cb){var _0x15a275={},_0x50a2cb={},_0xc6cf3e={'count':0x0,'rows':[]};var _0x1c2c8e=_[_0x5bff('0x36')](db[_0x5bff('0x37')][_0x5bff('0x38')],function(_0x1a98a3){return{'name':_0x1a98a3[_0x5bff('0x39')],'type':_0x1a98a3[_0x5bff('0x3a')][_0x5bff('0x3b')]};});_0x50a2cb[_0x5bff('0x3c')]=_[_0x5bff('0x36')](_0x1c2c8e,_0x5bff('0x35'));_0x50a2cb[_0x5bff('0x3d')]=_[_0x5bff('0x3e')](_0x1a4970[_0x5bff('0x3d')]);_0x50a2cb['filters']=_[_0x5bff('0x3f')](_0x50a2cb[_0x5bff('0x3c')],_0x50a2cb[_0x5bff('0x3d')]);_0x15a275[_0x5bff('0x40')]=_[_0x5bff('0x3f')](_0x50a2cb[_0x5bff('0x3c')],qs[_0x5bff('0x41')](_0x1a4970[_0x5bff('0x3d')]['fields']));_0x15a275['attributes']=_0x15a275['attributes'][_0x5bff('0x42')]?_0x15a275[_0x5bff('0x40')]:_0x50a2cb[_0x5bff('0x3c')];if(!_0x1a4970[_0x5bff('0x3d')][_0x5bff('0x43')](_0x5bff('0x44'))){_0x15a275[_0x5bff('0x2c')]=qs[_0x5bff('0x2c')](_0x1a4970[_0x5bff('0x3d')][_0x5bff('0x2c')]);_0x15a275['offset']=qs[_0x5bff('0x2b')](_0x1a4970[_0x5bff('0x3d')][_0x5bff('0x2b')]);}_0x15a275[_0x5bff('0x45')]=qs[_0x5bff('0x46')](_0x1a4970[_0x5bff('0x3d')][_0x5bff('0x46')]);_0x15a275[_0x5bff('0x47')]=qs['filters'](_[_0x5bff('0x48')](_0x1a4970['query'],_0x50a2cb[_0x5bff('0x49')]),_0x1c2c8e);if(_0x1a4970[_0x5bff('0x3d')]['filter']){_0x15a275['where']=_[_0x5bff('0x4a')](_0x15a275[_0x5bff('0x47')],{'$or':_[_0x5bff('0x36')](_0x1c2c8e,function(_0x395542){if(_0x395542['type']!==_0x5bff('0x4b')){var _0x39d38c={};_0x39d38c[_0x395542[_0x5bff('0x35')]]={'$like':'%'+_0x1a4970[_0x5bff('0x3d')][_0x5bff('0x4c')]+'%'};return _0x39d38c;}})});}_0x15a275=_[_0x5bff('0x4a')]({},_0x15a275,_0x1a4970[_0x5bff('0x4d')]);var _0x5ebe4f={'where':_0x15a275[_0x5bff('0x47')]};return db['ServicenowAccount']['count'](_0x5ebe4f)[_0x5bff('0x1c')](function(_0x41b0e7){_0xc6cf3e[_0x5bff('0x4e')]=_0x41b0e7;if(_0x1a4970[_0x5bff('0x3d')][_0x5bff('0x4f')]){_0x15a275['include']=[{'all':!![]}];}return db[_0x5bff('0x37')][_0x5bff('0x50')](_0x15a275);})[_0x5bff('0x1c')](function(_0x4e8aa4){_0xc6cf3e[_0x5bff('0x51')]=_0x4e8aa4;return _0xc6cf3e;})[_0x5bff('0x1c')](respondWithFilteredResult(_0x3df3cb,_0x15a275))[_0x5bff('0x26')](handleError(_0x3df3cb,null));};exports[_0x5bff('0x52')]=function(_0x3ad2ed,_0x346e21){var _0x3d1544={'raw':![],'where':{'id':_0x3ad2ed[_0x5bff('0x53')]['id']}},_0x21334f={};_0x21334f['model']=_[_0x5bff('0x3e')](db[_0x5bff('0x37')][_0x5bff('0x38')]);_0x21334f[_0x5bff('0x3d')]=_[_0x5bff('0x3e')](_0x3ad2ed[_0x5bff('0x3d')]);_0x21334f['filters']=_[_0x5bff('0x3f')](_0x21334f[_0x5bff('0x3c')],_0x21334f[_0x5bff('0x3d')]);_0x3d1544[_0x5bff('0x40')]=_[_0x5bff('0x3f')](_0x21334f[_0x5bff('0x3c')],qs['fields'](_0x3ad2ed['query'][_0x5bff('0x41')]));_0x3d1544[_0x5bff('0x40')]=_0x3d1544[_0x5bff('0x40')][_0x5bff('0x42')]?_0x3d1544[_0x5bff('0x40')]:_0x21334f[_0x5bff('0x3c')];if(_0x3ad2ed[_0x5bff('0x3d')]['includeAll']){_0x3d1544[_0x5bff('0x54')]=[{'all':!![]}];}_0x3d1544=_['merge']({},_0x3d1544,_0x3ad2ed[_0x5bff('0x4d')]);return db[_0x5bff('0x37')][_0x5bff('0x55')](_0x3d1544)[_0x5bff('0x1c')](handleEntityNotFound(_0x346e21,null))[_0x5bff('0x1c')](respondWithResult(_0x346e21,null))[_0x5bff('0x26')](handleError(_0x346e21,null));};exports['create']=function(_0xfbc0c8,_0x5135b5){return db['ServicenowAccount'][_0x5bff('0x56')](_0xfbc0c8[_0x5bff('0x57')],{})['then'](respondWithResult(_0x5135b5,0xc9))['catch'](handleError(_0x5135b5,null));};exports['update']=function(_0x31a2a8,_0x5926ed){if(_0x31a2a8[_0x5bff('0x57')]['id']){delete _0x31a2a8[_0x5bff('0x57')]['id'];}return db['ServicenowAccount'][_0x5bff('0x55')]({'where':{'id':_0x31a2a8['params']['id']}})['then'](handleEntityNotFound(_0x5926ed,null))[_0x5bff('0x1c')](saveUpdates(_0x31a2a8['body'],null))[_0x5bff('0x1c')](respondWithResult(_0x5926ed,null))[_0x5bff('0x26')](handleError(_0x5926ed,null));};exports['destroy']=function(_0x2378e9,_0x5a6207){return db[_0x5bff('0x37')][_0x5bff('0x55')]({'where':{'id':_0x2378e9[_0x5bff('0x53')]['id']}})['then'](handleEntityNotFound(_0x5a6207,null))[_0x5bff('0x1c')](removeEntity(_0x5a6207,null))[_0x5bff('0x26')](handleError(_0x5a6207,null));};exports[_0x5bff('0x58')]=function(_0x10df10,_0x2b0e70,_0x1575ab){var _0x5dc23a={};var _0x197110={};var _0x143149;var _0x162962;return db['ServicenowAccount']['findOne']({'where':{'id':_0x10df10[_0x5bff('0x53')]['id']}})['then'](handleEntityNotFound(_0x2b0e70,null))[_0x5bff('0x1c')](function(_0x126095){if(_0x126095){_0x143149=_0x126095;_0x197110[_0x5bff('0x3c')]=_[_0x5bff('0x3e')](db[_0x5bff('0x59')][_0x5bff('0x38')]);_0x197110[_0x5bff('0x3d')]=_[_0x5bff('0x3e')](_0x10df10[_0x5bff('0x3d')]);_0x197110[_0x5bff('0x49')]=_['intersection'](_0x197110[_0x5bff('0x3c')],_0x197110[_0x5bff('0x3d')]);_0x5dc23a[_0x5bff('0x40')]=_['intersection'](_0x197110[_0x5bff('0x3c')],qs[_0x5bff('0x41')](_0x10df10[_0x5bff('0x3d')][_0x5bff('0x41')]));_0x5dc23a[_0x5bff('0x40')]=_0x5dc23a[_0x5bff('0x40')][_0x5bff('0x42')]?_0x5dc23a['attributes']:_0x197110['model'];_0x5dc23a[_0x5bff('0x45')]=qs[_0x5bff('0x46')](_0x10df10[_0x5bff('0x3d')][_0x5bff('0x46')]);_0x5dc23a[_0x5bff('0x47')]=qs[_0x5bff('0x49')](_['pick'](_0x10df10[_0x5bff('0x3d')],_0x197110['filters']));if(_0x10df10[_0x5bff('0x3d')][_0x5bff('0x4c')]){_0x5dc23a[_0x5bff('0x47')]=_[_0x5bff('0x4a')](_0x5dc23a[_0x5bff('0x47')],{'$or':_[_0x5bff('0x36')](_0x5dc23a[_0x5bff('0x40')],function(_0x1b4235){var _0x2ea15e={};_0x2ea15e[_0x1b4235]={'$like':'%'+_0x10df10[_0x5bff('0x3d')][_0x5bff('0x4c')]+'%'};return _0x2ea15e;})});}_0x5dc23a=_[_0x5bff('0x4a')]({},_0x5dc23a,_0x10df10['options']);return _0x143149[_0x5bff('0x58')](_0x5dc23a);}})['then'](function(_0xba3d30){if(_0xba3d30){_0x162962=_0xba3d30[_0x5bff('0x42')];if(!_0x10df10['query'][_0x5bff('0x43')](_0x5bff('0x44'))){_0x5dc23a[_0x5bff('0x2c')]=qs[_0x5bff('0x2c')](_0x10df10['query'][_0x5bff('0x2c')]);_0x5dc23a[_0x5bff('0x2b')]=qs[_0x5bff('0x2b')](_0x10df10[_0x5bff('0x3d')][_0x5bff('0x2b')]);}return _0x143149['getConfigurations'](_0x5dc23a);}})['then'](function(_0x2a3a0a){if(_0x2a3a0a){return _0x2a3a0a?{'count':_0x162962,'rows':_0x2a3a0a}:null;}})[_0x5bff('0x1c')](respondWithResult(_0x2b0e70,null))[_0x5bff('0x26')](handleError(_0x2b0e70,null));};exports[_0x5bff('0x5a')]=function(_0x1206f7,_0x3ede1c,_0x536abb){if(_0x1206f7['body']['id']){delete _0x1206f7[_0x5bff('0x57')]['id'];}return db[_0x5bff('0x37')][_0x5bff('0x5b')]({'where':{'id':_0x1206f7['params']['id']}})[_0x5bff('0x1c')](handleEntityNotFound(_0x3ede1c,null))['then'](function(_0x5a9a7c){if(_0x5a9a7c){_0x1206f7[_0x5bff('0x57')]['AccountId']=_0x5a9a7c['id'];_0x1206f7[_0x5bff('0x57')][_0x5bff('0x5c')]=integrations['getSubjects'](_0x1206f7[_0x5bff('0x57')]['channel'],_0x1206f7['body']['type']);_0x1206f7['body'][_0x5bff('0x5d')]=integrations[_0x5bff('0x5e')](_0x1206f7[_0x5bff('0x57')]['channel'],_0x1206f7[_0x5bff('0x57')][_0x5bff('0x3a')]);return db[_0x5bff('0x59')][_0x5bff('0x56')](_0x1206f7[_0x5bff('0x57')],{'include':[{'model':db[_0x5bff('0x5f')],'as':'Subjects'},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x5bff('0x1c')](respondWithResult(_0x3ede1c,null))[_0x5bff('0x26')](handleError(_0x3ede1c,null));};exports[_0x5bff('0x60')]=function(_0x2b0dc7,_0x5e05be,_0x4b822b){var _0x133912=['made_sla','hold_reason',_0x5bff('0x61'),_0x5bff('0x62'),_0x5bff('0x63'),'notify','incident_state',_0x5bff('0x64'),_0x5bff('0x65')];var _0x3ed7a3=['parent',_0x5bff('0x66'),_0x5bff('0x67'),_0x5bff('0x68'),_0x5bff('0x69'),'sys_updated_on','child_incidents',_0x5bff('0x6a'),'approval_history',_0x5bff('0x6b'),_0x5bff('0x6c'),_0x5bff('0x6d'),_0x5bff('0x6e'),_0x5bff('0x6f'),_0x5bff('0x70'),_0x5bff('0x71'),_0x5bff('0x72'),_0x5bff('0x73'),'knowledge',_0x5bff('0x45'),_0x5bff('0x74'),_0x5bff('0x75'),_0x5bff('0x76'),'delivery_plan',_0x5bff('0x77'),_0x5bff('0x78'),_0x5bff('0x79'),_0x5bff('0x7a'),_0x5bff('0x7b'),_0x5bff('0x7c'),'rfc','time_worked','expected_start','opened_at',_0x5bff('0x7d'),_0x5bff('0x7e'),_0x5bff('0x7f'),_0x5bff('0x80'),_0x5bff('0x81'),_0x5bff('0x82'),'approval_set',_0x5bff('0x62'),_0x5bff('0x83'),_0x5bff('0x84'),_0x5bff('0x63'),_0x5bff('0x85'),_0x5bff('0x86'),_0x5bff('0x87'),_0x5bff('0x88'),'business_stc',_0x5bff('0x89'),_0x5bff('0x8a'),_0x5bff('0x8b'),_0x5bff('0x8c'),'sys_class_name',_0x5bff('0x8d'),_0x5bff('0x8e'),_0x5bff('0x8f'),_0x5bff('0x90'),_0x5bff('0x91'),_0x5bff('0x92'),_0x5bff('0x93'),'incident_state','urgency',_0x5bff('0x94'),_0x5bff('0x95'),'reassignment_count',_0x5bff('0x96'),'assigned_to',_0x5bff('0x64'),'comments',_0x5bff('0x97'),_0x5bff('0x98'),_0x5bff('0x99'),_0x5bff('0x9a'),_0x5bff('0x9b'),_0x5bff('0x9c'),_0x5bff('0x9d'),_0x5bff('0x9e'),'upon_approval',_0x5bff('0x9f'),_0x5bff('0xa0'),_0x5bff('0x65')];var _0xeaef76='';var _0x3f75d7='';var _0x183976=[];var _0x595887='';var _0x396fc2='';var _0x3e2e63=[];var _0x5652c7='';var _0x5983fa='';var _0x3d8a89={};var _0x3def1e='';return db['ServicenowAccount'][_0x5bff('0x5b')]({'where':{'id':_0x2b0dc7[_0x5bff('0x53')]['id']},'attributes':['id','username',_0x5bff('0xa1'),'email','remoteUri','serverUrl']})['then'](handleEntityNotFound(_0x5e05be,null))['then'](function(_0x4d1725){if(_0x4d1725){_0x3def1e=_0x4d1725[_0x5bff('0xa2')];var _0x55c8d9=_0x3def1e['slice'](-0x1);if(_0x55c8d9==='/'){_0x3def1e=_0x3def1e[_0x5bff('0xa3')](0x0,_0x3def1e['lastIndexOf'](_0x55c8d9));}_0x5983fa=util[_0x5bff('0xa4')](_0x5bff('0xa5'),_0x3def1e);_0x5652c7=util['format'](_0x5bff('0xa6'),_0x3def1e);_0x3d8a89={'user':_0x4d1725[_0x5bff('0xa7')],'pass':_0x4d1725['password']};var _0x5ebad3={'method':_0x5bff('0xa8'),'uri':_0x5983fa+_0x5bff('0xa9'),'auth':_0x3d8a89,'json':!![]};return rp(_0x5ebad3);}})[_0x5bff('0x1c')](function(_0x3d8c4a){if(_0x3d8c4a['result'][_0x5bff('0x42')]>0x0){_0xeaef76=_0x3d8c4a[_0x5bff('0xaa')];}console[_0x5bff('0xab')](_0x5bff('0xac'),_0xeaef76);_0x3e2e63=[];_0x3f75d7=Object['assign']([],_0xeaef76);_[_0x5bff('0xad')](_0x3f75d7,function(_0x51d0d4){return!_0x133912[_0x5bff('0xae')](_0x51d0d4[_0x5bff('0x35')]);});_0x3f75d7[_0x5bff('0xaf')](function(_0x2ec528){var _0x576260=createFieldObject(_0x5652c7,_0x3d8a89,_0x2ec528['internalType'],_0x2ec528[_0x5bff('0x35')],_0x2ec528[_0x5bff('0xb0')],![]);_0x3e2e63['push'](_0x576260);});return Promise['all'](_0x3e2e63);})['then'](function(_0x1e9df6){_0x183976=_0x1e9df6;_0x595887=Object[_0x5bff('0xb1')]([],_0xeaef76);console[_0x5bff('0xab')](_0x5bff('0xb2'),_0xeaef76);_[_0x5bff('0xad')](_0x595887,function(_0x43ee05){return _0x3ed7a3[_0x5bff('0xae')](_0x43ee05[_0x5bff('0x35')]);});console[_0x5bff('0xab')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x595887);_0x3e2e63=[];_0x595887[_0x5bff('0xaf')](function(_0x40a44f){var _0x1b5917=createFieldObject(_0x5652c7,_0x3d8a89,_0x40a44f[_0x5bff('0xb3')],_0x40a44f[_0x5bff('0x35')],_0x40a44f[_0x5bff('0xb0')],!![]);_0x3e2e63[_0x5bff('0xb4')](_0x1b5917);});return Promise['all'](_0x3e2e63);})[_0x5bff('0x1c')](function(_0x780920){_0x396fc2=_0x780920;var _0x46e90b=_0x183976[_0x5bff('0xb5')](_0x396fc2);return{'count':_0x46e90b[_0x5bff('0x42')],'rows':_0x46e90b};})[_0x5bff('0x1c')](respondWithResult(_0x5e05be,null))[_0x5bff('0x26')](function(_0x2849e8){console[_0x5bff('0xab')](_0x5bff('0xb6')+_0x2849e8);var _0x5b6b67=_0x2b0dc7[_0x5bff('0x3d')][_0x5bff('0xb7')]?0x1f4:_0x2849e8[_0x5bff('0xb8')]||0x1f4;logger[_0x5bff('0x22')](_0x2849e8[_0x5bff('0x34')]);delete _0x2849e8[_0x5bff('0x35')];if(_0x5b6b67===0x191){_0x5b6b67=0x190;}_0x5e05be[_0x5bff('0x28')](_0x5b6b67)['send'](_0x2b0dc7[_0x5bff('0x3d')][_0x5bff('0xb7')]?{'message':_0x5bff('0xb9'),'statusCode':_0x2849e8[_0x5bff('0xb8')]}:_0x2849e8);});};function createFieldObject(_0x5308bc,_0x20735c,_0x4b1108,_0x391db5,_0x569956,_0x2c0bc0){return new Promise(function(_0x27b240,_0x40185a){var _0x4b20bb={'id':_0x391db5,'name':_0x569956,'custom':_0x2c0bc0};if(_0x4b1108===_0x5bff('0xba')){_0x4b20bb[_0x5bff('0x4d')]=[{'name':'True','value':_0x5bff('0xbb')},{'name':_0x5bff('0xbc'),'value':'false'}];_0x27b240(_0x4b20bb);}else{var _0x452cba={'method':'GET','uri':_0x5308bc+_0x5bff('0xbd')+_0x391db5,'auth':_0x20735c,'json':!![]};return rp(_0x452cba)[_0x5bff('0x1c')](function(_0x3a3bae){var _0x4f6511=[];if(_0x3a3bae['result'][_0x5bff('0x42')]>0x0){_0x3a3bae[_0x5bff('0xaa')][_0x5bff('0xaf')](function(_0x6adc36){if(_0x6adc36[_0x5bff('0xbe')]==='false'){var _0xe3cd80={'name':_0x6adc36[_0x5bff('0xb0')],'value':_0x6adc36[_0x5bff('0xbf')]};_0x4f6511[_0x5bff('0xb4')](_0xe3cd80);}});}_0x4b20bb[_0x5bff('0x4d')]=_0x4f6511;if(_0x4b20bb['options'][_0x5bff('0x42')]>0x0){_0x27b240(_0x4b20bb);}else{if(_0x2c0bc0==![]){_0x27b240();}else{_0x27b240(_0x4b20bb);}}});}});} \ No newline at end of file +var _0x1cf7=['ServicenowAccount,\x20%s,\x20%s','message','catch','status','json','count','offset','limit','set','reject','save','update','end','stack','name','send','index','ServicenowAccount','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','rawAttributes','include','body','find','destroy','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','ServicenowConfiguration','ServicenowField','Descriptions','getFields','made_sla','knowledge','close_code','incident_state','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','description','notify','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','category','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','debug','request\x20sent','stringify','error'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x1cf7,0x16a));var _0x71cf=function(_0x4c13ee,_0x310d44){_0x4c13ee=_0x4c13ee-0x0;var _0x390198=_0x1cf7[_0x4c13ee];return _0x390198;};'use strict';var emlformat=require(_0x71cf('0x0'));var rimraf=require(_0x71cf('0x1'));var zipdir=require(_0x71cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x71cf('0x3'));var moment=require('moment');var BPromise=require(_0x71cf('0x4'));var Mustache=require(_0x71cf('0x5'));var util=require(_0x71cf('0x6'));var path=require(_0x71cf('0x7'));var sox=require(_0x71cf('0x8'));var csv=require(_0x71cf('0x9'));var ejs=require(_0x71cf('0xa'));var fs=require('fs');var fs_extra=require(_0x71cf('0xb'));var _=require(_0x71cf('0xc'));var squel=require(_0x71cf('0xd'));var crypto=require(_0x71cf('0xe'));var jsforce=require(_0x71cf('0xf'));var deskjs=require(_0x71cf('0x10'));var toCsv=require(_0x71cf('0x9'));var querystring=require(_0x71cf('0x11'));var Papa=require(_0x71cf('0x12'));var Redis=require(_0x71cf('0x13'));var authService=require(_0x71cf('0x14'));var qs=require(_0x71cf('0x15'));var as=require(_0x71cf('0x16'));var hardwareService=require(_0x71cf('0x17'));var logger=require(_0x71cf('0x18'))(_0x71cf('0x19'));var utils=require(_0x71cf('0x1a'));var config=require(_0x71cf('0x1b'));var licenseUtil=require(_0x71cf('0x1c'));var db=require(_0x71cf('0x1d'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x71cf('0x1e'));var client=jayson[_0x71cf('0x1f')][_0x71cf('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x12fda5,_0x26af4b,_0x2ac9b6,_0x17ac21){return new BPromise(function(_0x4beb3e,_0x5f465b){var _0x589083=_0x17ac21||client;return _0x589083['request'](_0x12fda5,_0x2ac9b6)[_0x71cf('0x21')](function(_0x3cd502){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x26af4b,'request\x20sent');logger[_0x71cf('0x22')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x26af4b,_0x71cf('0x23'),JSON[_0x71cf('0x24')](_0x3cd502));if(_0x3cd502[_0x71cf('0x25')]){if(_0x3cd502[_0x71cf('0x25')]['code']===0x1f4){logger[_0x71cf('0x25')](_0x71cf('0x26'),_0x26af4b,_0x3cd502[_0x71cf('0x25')][_0x71cf('0x27')]);return _0x5f465b(_0x3cd502['error'][_0x71cf('0x27')]);}logger[_0x71cf('0x25')](_0x71cf('0x26'),_0x26af4b,_0x3cd502['error'][_0x71cf('0x27')]);return _0x4beb3e(_0x3cd502[_0x71cf('0x25')][_0x71cf('0x27')]);}else{logger['info'](_0x71cf('0x26'),_0x26af4b,_0x71cf('0x23'));_0x4beb3e(_0x3cd502['result']['message']);}})[_0x71cf('0x28')](function(_0x199dbe){logger[_0x71cf('0x25')](_0x71cf('0x26'),_0x26af4b,_0x199dbe);_0x5f465b(_0x199dbe);});});}function respondWithStatusCode(_0x226b60,_0x10cb1e){_0x10cb1e=_0x10cb1e||0xcc;return function(_0x195628){if(_0x195628){return _0x226b60['sendStatus'](_0x10cb1e);}return _0x226b60[_0x71cf('0x29')](_0x10cb1e)['end']();};}function respondWithResult(_0x3885b2,_0x539c9b){_0x539c9b=_0x539c9b||0xc8;return function(_0x20ca19){if(_0x20ca19){return _0x3885b2[_0x71cf('0x29')](_0x539c9b)[_0x71cf('0x2a')](_0x20ca19);}};}function respondWithFilteredResult(_0x1a83bb,_0x16524a){return function(_0x2556ef){if(_0x2556ef){var _0x58a5cc=_0x2556ef[_0x71cf('0x2b')],_0x136bda=_0x16524a['offset'],_0x790ccf=_0x16524a[_0x71cf('0x2c')]+_0x16524a[_0x71cf('0x2d')],_0x36b49b;if(_0x790ccf>=_0x58a5cc){_0x790ccf=_0x58a5cc;_0x36b49b=0xc8;}else{_0x36b49b=0xce;}_0x1a83bb[_0x71cf('0x29')](_0x36b49b);return _0x1a83bb[_0x71cf('0x2e')]('Content-Range',_0x136bda+'-'+_0x790ccf+'/'+_0x58a5cc)['json'](_0x2556ef);}return null;};}function patchUpdates(_0x49db66){return function(_0x455049){try{jsonpatch['apply'](_0x455049,_0x49db66,!![]);}catch(_0x224501){return BPromise[_0x71cf('0x2f')](_0x224501);}return _0x455049[_0x71cf('0x30')]();};}function saveUpdates(_0x459c7d,_0x5f4294){return function(_0x1e2da8){if(_0x1e2da8){return _0x1e2da8[_0x71cf('0x31')](_0x459c7d)['then'](function(_0x5e7e9f){return _0x5e7e9f;});}return null;};}function removeEntity(_0x23de1f,_0x3db989){return function(_0x28a83f){if(_0x28a83f){return _0x28a83f['destroy']()[_0x71cf('0x21')](function(){_0x23de1f['status'](0xcc)[_0x71cf('0x32')]();});}};}function handleEntityNotFound(_0x5654df,_0x3b0bb5){return function(_0x4957db){if(!_0x4957db){_0x5654df['sendStatus'](0x194);}return _0x4957db;};}function handleError(_0x2f143b,_0x38084a){_0x38084a=_0x38084a||0x1f4;return function(_0x3dfca4){logger[_0x71cf('0x25')](_0x3dfca4[_0x71cf('0x33')]);if(_0x3dfca4[_0x71cf('0x34')]){delete _0x3dfca4['name'];}_0x2f143b['status'](_0x38084a)[_0x71cf('0x35')](_0x3dfca4);};}exports[_0x71cf('0x36')]=function(_0xa7ba74,_0x831a9c){var _0xa979dd={},_0xcf5aa7={},_0x1c08a0={'count':0x0,'rows':[]};var _0x4a1e54=_['map'](db[_0x71cf('0x37')]['rawAttributes'],function(_0x451c68){return{'name':_0x451c68[_0x71cf('0x38')],'type':_0x451c68[_0x71cf('0x39')][_0x71cf('0x3a')]};});_0xcf5aa7['model']=_[_0x71cf('0x3b')](_0x4a1e54,_0x71cf('0x34'));_0xcf5aa7[_0x71cf('0x3c')]=_[_0x71cf('0x3d')](_0xa7ba74['query']);_0xcf5aa7[_0x71cf('0x3e')]=_[_0x71cf('0x3f')](_0xcf5aa7[_0x71cf('0x40')],_0xcf5aa7[_0x71cf('0x3c')]);_0xa979dd[_0x71cf('0x41')]=_[_0x71cf('0x3f')](_0xcf5aa7['model'],qs[_0x71cf('0x42')](_0xa7ba74[_0x71cf('0x3c')][_0x71cf('0x42')]));_0xa979dd[_0x71cf('0x41')]=_0xa979dd[_0x71cf('0x41')][_0x71cf('0x43')]?_0xa979dd[_0x71cf('0x41')]:_0xcf5aa7[_0x71cf('0x40')];if(!_0xa7ba74[_0x71cf('0x3c')][_0x71cf('0x44')](_0x71cf('0x45'))){_0xa979dd[_0x71cf('0x2d')]=qs[_0x71cf('0x2d')](_0xa7ba74[_0x71cf('0x3c')]['limit']);_0xa979dd['offset']=qs[_0x71cf('0x2c')](_0xa7ba74['query'][_0x71cf('0x2c')]);}_0xa979dd[_0x71cf('0x46')]=qs['sort'](_0xa7ba74['query'][_0x71cf('0x47')]);_0xa979dd['where']=qs['filters'](_[_0x71cf('0x48')](_0xa7ba74[_0x71cf('0x3c')],_0xcf5aa7['filters']),_0x4a1e54);if(_0xa7ba74[_0x71cf('0x3c')][_0x71cf('0x49')]){_0xa979dd[_0x71cf('0x4a')]=_[_0x71cf('0x4b')](_0xa979dd['where'],{'$or':_[_0x71cf('0x3b')](_0x4a1e54,function(_0x2d80bb){if(_0x2d80bb[_0x71cf('0x39')]!==_0x71cf('0x4c')){var _0x4e88dd={};_0x4e88dd[_0x2d80bb[_0x71cf('0x34')]]={'$like':'%'+_0xa7ba74[_0x71cf('0x3c')][_0x71cf('0x49')]+'%'};return _0x4e88dd;}})});}_0xa979dd=_[_0x71cf('0x4b')]({},_0xa979dd,_0xa7ba74[_0x71cf('0x4d')]);var _0x2cffca={'where':_0xa979dd[_0x71cf('0x4a')]};return db['ServicenowAccount'][_0x71cf('0x2b')](_0x2cffca)[_0x71cf('0x21')](function(_0x157dc4){_0x1c08a0[_0x71cf('0x2b')]=_0x157dc4;if(_0xa7ba74[_0x71cf('0x3c')][_0x71cf('0x4e')]){_0xa979dd['include']=[{'all':!![]}];}return db[_0x71cf('0x37')]['findAll'](_0xa979dd);})[_0x71cf('0x21')](function(_0x1c6366){_0x1c08a0[_0x71cf('0x4f')]=_0x1c6366;return _0x1c08a0;})['then'](respondWithFilteredResult(_0x831a9c,_0xa979dd))[_0x71cf('0x28')](handleError(_0x831a9c,null));};exports[_0x71cf('0x50')]=function(_0x1f6d97,_0x354ca9){var _0x501ddc={'raw':![],'where':{'id':_0x1f6d97[_0x71cf('0x51')]['id']}},_0x312e33={};_0x312e33[_0x71cf('0x40')]=_[_0x71cf('0x3d')](db[_0x71cf('0x37')][_0x71cf('0x52')]);_0x312e33['query']=_['keys'](_0x1f6d97[_0x71cf('0x3c')]);_0x312e33[_0x71cf('0x3e')]=_[_0x71cf('0x3f')](_0x312e33['model'],_0x312e33[_0x71cf('0x3c')]);_0x501ddc[_0x71cf('0x41')]=_[_0x71cf('0x3f')](_0x312e33['model'],qs[_0x71cf('0x42')](_0x1f6d97[_0x71cf('0x3c')][_0x71cf('0x42')]));_0x501ddc['attributes']=_0x501ddc[_0x71cf('0x41')][_0x71cf('0x43')]?_0x501ddc[_0x71cf('0x41')]:_0x312e33['model'];if(_0x1f6d97[_0x71cf('0x3c')][_0x71cf('0x4e')]){_0x501ddc[_0x71cf('0x53')]=[{'all':!![]}];}_0x501ddc=_[_0x71cf('0x4b')]({},_0x501ddc,_0x1f6d97[_0x71cf('0x4d')]);return db['ServicenowAccount']['find'](_0x501ddc)[_0x71cf('0x21')](handleEntityNotFound(_0x354ca9,null))[_0x71cf('0x21')](respondWithResult(_0x354ca9,null))['catch'](handleError(_0x354ca9,null));};exports['create']=function(_0xda254a,_0x109c4e){return db['ServicenowAccount']['create'](_0xda254a['body'],{})['then'](respondWithResult(_0x109c4e,0xc9))['catch'](handleError(_0x109c4e,null));};exports['update']=function(_0x2557b8,_0x4f505e){if(_0x2557b8[_0x71cf('0x54')]['id']){delete _0x2557b8['body']['id'];}return db[_0x71cf('0x37')][_0x71cf('0x55')]({'where':{'id':_0x2557b8[_0x71cf('0x51')]['id']}})[_0x71cf('0x21')](handleEntityNotFound(_0x4f505e,null))[_0x71cf('0x21')](saveUpdates(_0x2557b8[_0x71cf('0x54')],null))[_0x71cf('0x21')](respondWithResult(_0x4f505e,null))['catch'](handleError(_0x4f505e,null));};exports[_0x71cf('0x56')]=function(_0x5d5495,_0x342876){return db[_0x71cf('0x37')][_0x71cf('0x55')]({'where':{'id':_0x5d5495[_0x71cf('0x51')]['id']}})[_0x71cf('0x21')](handleEntityNotFound(_0x342876,null))['then'](removeEntity(_0x342876,null))[_0x71cf('0x28')](handleError(_0x342876,null));};exports[_0x71cf('0x57')]=function(_0x54e199,_0x16bccf,_0x17533f){var _0x681b21={};var _0x150aca={};var _0x5a4337;var _0x5e22c4;return db[_0x71cf('0x37')]['findOne']({'where':{'id':_0x54e199[_0x71cf('0x51')]['id']}})[_0x71cf('0x21')](handleEntityNotFound(_0x16bccf,null))[_0x71cf('0x21')](function(_0x4a9c3a){if(_0x4a9c3a){_0x5a4337=_0x4a9c3a;_0x150aca['model']=_[_0x71cf('0x3d')](db['ServicenowConfiguration'][_0x71cf('0x52')]);_0x150aca[_0x71cf('0x3c')]=_[_0x71cf('0x3d')](_0x54e199['query']);_0x150aca[_0x71cf('0x3e')]=_['intersection'](_0x150aca[_0x71cf('0x40')],_0x150aca[_0x71cf('0x3c')]);_0x681b21[_0x71cf('0x41')]=_[_0x71cf('0x3f')](_0x150aca[_0x71cf('0x40')],qs[_0x71cf('0x42')](_0x54e199[_0x71cf('0x3c')][_0x71cf('0x42')]));_0x681b21[_0x71cf('0x41')]=_0x681b21['attributes'][_0x71cf('0x43')]?_0x681b21[_0x71cf('0x41')]:_0x150aca[_0x71cf('0x40')];_0x681b21[_0x71cf('0x46')]=qs['sort'](_0x54e199['query'][_0x71cf('0x47')]);_0x681b21[_0x71cf('0x4a')]=qs[_0x71cf('0x3e')](_[_0x71cf('0x48')](_0x54e199[_0x71cf('0x3c')],_0x150aca[_0x71cf('0x3e')]));if(_0x54e199[_0x71cf('0x3c')][_0x71cf('0x49')]){_0x681b21[_0x71cf('0x4a')]=_[_0x71cf('0x4b')](_0x681b21[_0x71cf('0x4a')],{'$or':_[_0x71cf('0x3b')](_0x681b21['attributes'],function(_0x8841d4){var _0x108306={};_0x108306[_0x8841d4]={'$like':'%'+_0x54e199[_0x71cf('0x3c')][_0x71cf('0x49')]+'%'};return _0x108306;})});}_0x681b21=_[_0x71cf('0x4b')]({},_0x681b21,_0x54e199[_0x71cf('0x4d')]);return _0x5a4337[_0x71cf('0x57')](_0x681b21);}})[_0x71cf('0x21')](function(_0x2cfbb4){if(_0x2cfbb4){_0x5e22c4=_0x2cfbb4['length'];if(!_0x54e199[_0x71cf('0x3c')][_0x71cf('0x44')]('nolimit')){_0x681b21['limit']=qs['limit'](_0x54e199[_0x71cf('0x3c')]['limit']);_0x681b21[_0x71cf('0x2c')]=qs[_0x71cf('0x2c')](_0x54e199['query'][_0x71cf('0x2c')]);}return _0x5a4337[_0x71cf('0x57')](_0x681b21);}})[_0x71cf('0x21')](function(_0x128524){if(_0x128524){return _0x128524?{'count':_0x5e22c4,'rows':_0x128524}:null;}})[_0x71cf('0x21')](respondWithResult(_0x16bccf,null))[_0x71cf('0x28')](handleError(_0x16bccf,null));};exports[_0x71cf('0x58')]=function(_0x5993f0,_0x1590fd,_0x11b958){if(_0x5993f0[_0x71cf('0x54')]['id']){delete _0x5993f0[_0x71cf('0x54')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x5993f0[_0x71cf('0x51')]['id']}})[_0x71cf('0x21')](handleEntityNotFound(_0x1590fd,null))['then'](function(_0x2fd366){if(_0x2fd366){_0x5993f0['body'][_0x71cf('0x59')]=_0x2fd366['id'];_0x5993f0[_0x71cf('0x54')][_0x71cf('0x5a')]=integrations[_0x71cf('0x5b')](_0x5993f0[_0x71cf('0x54')][_0x71cf('0x5c')],_0x5993f0[_0x71cf('0x54')][_0x71cf('0x39')]);_0x5993f0['body']['Descriptions']=integrations['getDescriptions'](_0x5993f0[_0x71cf('0x54')][_0x71cf('0x5c')],_0x5993f0['body']['type']);return db[_0x71cf('0x5d')]['create'](_0x5993f0['body'],{'include':[{'model':db[_0x71cf('0x5e')],'as':_0x71cf('0x5a')},{'model':db[_0x71cf('0x5e')],'as':_0x71cf('0x5f')}]});}return null;})['then'](respondWithResult(_0x1590fd,null))[_0x71cf('0x28')](handleError(_0x1590fd,null));};exports[_0x71cf('0x60')]=function(_0x304654,_0x16baa9,_0x370f07){var _0x15661b=[_0x71cf('0x61'),'hold_reason',_0x71cf('0x62'),'subcategory',_0x71cf('0x63'),'notify',_0x71cf('0x64'),'severity','category'];var _0x28a610=['parent','made_sla',_0x71cf('0x65'),_0x71cf('0x66'),_0x71cf('0x67'),_0x71cf('0x68'),_0x71cf('0x69'),_0x71cf('0x6a'),_0x71cf('0x6b'),_0x71cf('0x6c'),_0x71cf('0x6d'),_0x71cf('0x6e'),'opened_by',_0x71cf('0x6f'),_0x71cf('0x70'),_0x71cf('0x71'),_0x71cf('0x72'),_0x71cf('0x73'),'knowledge',_0x71cf('0x46'),'calendar_stc',_0x71cf('0x74'),_0x71cf('0x75'),_0x71cf('0x76'),_0x71cf('0x77'),_0x71cf('0x78'),_0x71cf('0x79'),_0x71cf('0x7a'),_0x71cf('0x7b'),_0x71cf('0x7c'),_0x71cf('0x7d'),_0x71cf('0x7e'),_0x71cf('0x7f'),_0x71cf('0x80'),_0x71cf('0x81'),_0x71cf('0x82'),_0x71cf('0x83'),'reopened_time',_0x71cf('0x84'),_0x71cf('0x85'),_0x71cf('0x86'),_0x71cf('0x87'),_0x71cf('0x88'),_0x71cf('0x89'),_0x71cf('0x63'),_0x71cf('0x8a'),'delivery_task',_0x71cf('0x8b'),_0x71cf('0x8c'),_0x71cf('0x8d'),'additional_assignee_list',_0x71cf('0x8e'),'calendar_duration',_0x71cf('0x8f'),'sys_class_name','close_notes',_0x71cf('0x90'),'follow_up',_0x71cf('0x91'),_0x71cf('0x92'),_0x71cf('0x93'),_0x71cf('0x94'),_0x71cf('0x64'),_0x71cf('0x95'),'problem_id',_0x71cf('0x96'),_0x71cf('0x97'),'activity_due',_0x71cf('0x98'),'severity','comments',_0x71cf('0x99'),_0x71cf('0x9a'),_0x71cf('0x9b'),_0x71cf('0x9c'),_0x71cf('0x9d'),_0x71cf('0x9e'),_0x71cf('0x9f'),'escalation',_0x71cf('0xa0'),_0x71cf('0xa1'),_0x71cf('0xa2'),_0x71cf('0xa3')];var _0x2bed42='';var _0x31b93a='';var _0x316b5d=[];var _0x4c2aae='';var _0x33ceb7='';var _0x2df293=[];var _0x28749c='';var _0x1d8ea6='';var _0x5c613c={};var _0x44d0dd='';return db[_0x71cf('0x37')]['findOne']({'where':{'id':_0x304654[_0x71cf('0x51')]['id']},'attributes':['id',_0x71cf('0xa4'),_0x71cf('0xa5'),_0x71cf('0xa6'),_0x71cf('0xa7'),_0x71cf('0xa8')]})[_0x71cf('0x21')](handleEntityNotFound(_0x16baa9,null))[_0x71cf('0x21')](function(_0x1bd954){if(_0x1bd954){_0x44d0dd=_0x1bd954[_0x71cf('0xa7')];var _0xe1ce6a=_0x44d0dd[_0x71cf('0xa9')](-0x1);if(_0xe1ce6a==='/'){_0x44d0dd=_0x44d0dd[_0x71cf('0xaa')](0x0,_0x44d0dd['lastIndexOf'](_0xe1ce6a));}_0x1d8ea6=util[_0x71cf('0xab')](_0x71cf('0xac'),_0x44d0dd);_0x28749c=util[_0x71cf('0xab')](_0x71cf('0xad'),_0x44d0dd);_0x5c613c={'user':_0x1bd954[_0x71cf('0xa4')],'pass':_0x1bd954[_0x71cf('0xa5')]};var _0x5e881f={'method':'GET','uri':_0x1d8ea6+_0x71cf('0xae'),'auth':_0x5c613c,'json':!![]};return rp(_0x5e881f);}})[_0x71cf('0x21')](function(_0x5d6093){if(_0x5d6093['result'][_0x71cf('0x43')]>0x0){_0x2bed42=_0x5d6093[_0x71cf('0xaf')];}console[_0x71cf('0xb0')](_0x71cf('0xb1'),_0x2bed42);_0x2df293=[];_0x31b93a=Object[_0x71cf('0xb2')]([],_0x2bed42);_[_0x71cf('0xb3')](_0x31b93a,function(_0x22eaa4){return!_0x15661b[_0x71cf('0xb4')](_0x22eaa4['name']);});_0x31b93a[_0x71cf('0xb5')](function(_0x4ec864){var _0x2e9883=createFieldObject(_0x28749c,_0x5c613c,_0x4ec864[_0x71cf('0xb6')],_0x4ec864['name'],_0x4ec864[_0x71cf('0xb7')],![]);_0x2df293[_0x71cf('0xb8')](_0x2e9883);});return Promise[_0x71cf('0xb9')](_0x2df293);})[_0x71cf('0x21')](function(_0x21a31b){_0x316b5d=_0x21a31b;_0x4c2aae=Object['assign']([],_0x2bed42);console[_0x71cf('0xb0')](_0x71cf('0xba'),_0x2bed42);_[_0x71cf('0xb3')](_0x4c2aae,function(_0x7b767f){return _0x28a610[_0x71cf('0xb4')](_0x7b767f[_0x71cf('0x34')]);});console[_0x71cf('0xb0')](_0x71cf('0xbb'),_0x4c2aae);_0x2df293=[];_0x4c2aae[_0x71cf('0xb5')](function(_0x5b3878){var _0x47b411=createFieldObject(_0x28749c,_0x5c613c,_0x5b3878[_0x71cf('0xb6')],_0x5b3878[_0x71cf('0x34')],_0x5b3878[_0x71cf('0xb7')],!![]);_0x2df293[_0x71cf('0xb8')](_0x47b411);});return Promise[_0x71cf('0xb9')](_0x2df293);})[_0x71cf('0x21')](function(_0x46d128){_0x33ceb7=_0x46d128;var _0x34f1e0=_0x316b5d['concat'](_0x33ceb7);return{'count':_0x34f1e0[_0x71cf('0x43')],'rows':_0x34f1e0};})['then'](respondWithResult(_0x16baa9,null))[_0x71cf('0x28')](function(_0x310192){console[_0x71cf('0xb0')](_0x71cf('0xbc')+_0x310192);var _0x5c0fc2=_0x304654[_0x71cf('0x3c')][_0x71cf('0xbd')]?0x1f4:_0x310192['statusCode']||0x1f4;logger[_0x71cf('0x25')](_0x310192[_0x71cf('0x33')]);delete _0x310192[_0x71cf('0x34')];if(_0x5c0fc2===0x191){_0x5c0fc2=0x190;}_0x16baa9['status'](_0x5c0fc2)[_0x71cf('0x35')](_0x304654[_0x71cf('0x3c')][_0x71cf('0xbd')]?{'message':_0x71cf('0xbe'),'statusCode':_0x310192[_0x71cf('0xbf')]}:_0x310192);});};function createFieldObject(_0x1efbb,_0x2d7dba,_0x37ca4a,_0x577e09,_0x2c4d82,_0x5ad099){return new Promise(function(_0x119e9c,_0x1a0b19){var _0x684fb0={'id':_0x577e09,'name':_0x2c4d82,'custom':_0x5ad099};if(_0x37ca4a===_0x71cf('0xc0')){_0x684fb0[_0x71cf('0x4d')]=[{'name':'True','value':_0x71cf('0xc1')},{'name':_0x71cf('0xc2'),'value':_0x71cf('0xc3')}];_0x119e9c(_0x684fb0);}else{var _0x3e5daf={'method':_0x71cf('0xc4'),'uri':_0x1efbb+_0x71cf('0xc5')+_0x577e09,'auth':_0x2d7dba,'json':!![]};return rp(_0x3e5daf)[_0x71cf('0x21')](function(_0x16cca3){var _0x1b9ba8=[];if(_0x16cca3['result'][_0x71cf('0x43')]>0x0){_0x16cca3['result']['forEach'](function(_0x230fcc){if(_0x230fcc[_0x71cf('0xc6')]==='false'){var _0x4fd3f4={'name':_0x230fcc[_0x71cf('0xb7')],'value':_0x230fcc[_0x71cf('0xc7')]};_0x1b9ba8[_0x71cf('0xb8')](_0x4fd3f4);}});}_0x684fb0[_0x71cf('0x4d')]=_0x1b9ba8;if(_0x684fb0[_0x71cf('0x4d')]['length']>0x0){_0x119e9c(_0x684fb0);}else{if(_0x5ad099==![]){_0x119e9c();}else{_0x119e9c(_0x684fb0);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index a5c792f..bc0bf49 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 _0x5292=['path','rimraf','./intServicenowAccount.attributes','define','lodash','util','api','bluebird','request-promise'];(function(_0x5355b3,_0x2f1e18){var _0x1dbf46=function(_0x2139fe){while(--_0x2139fe){_0x5355b3['push'](_0x5355b3['shift']());}};_0x1dbf46(++_0x2f1e18);}(_0x5292,0xf7));var _0x2529=function(_0x531b74,_0x3a473b){_0x531b74=_0x531b74-0x0;var _0x513d17=_0x5292[_0x531b74];return _0x513d17;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var logger=require('../../config/logger')(_0x2529('0x2'));var moment=require('moment');var BPromise=require(_0x2529('0x3'));var rp=require(_0x2529('0x4'));var fs=require('fs');var path=require(_0x2529('0x5'));var rimraf=require(_0x2529('0x6'));var config=require('../../config/environment');var attributes=require(_0x2529('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4e7a9e,_0x407277){return _0x4e7a9e[_0x2529('0x8')]('ServicenowAccount',attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81bd=['../../config/environment','./intServicenowAccount.attributes','exports','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x81bd,0x7c));var _0xd81b=function(_0x1b97f3,_0xce63f3){_0x1b97f3=_0x1b97f3-0x0;var _0x32d818=_0x81bd[_0x1b97f3];return _0x32d818;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xd81b('0xa')]=function(_0x34eb73,_0x1f3f2c){return _0x34eb73['define']('ServicenowAccount',attributes,{'tableName':_0xd81b('0xb'),'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 caba1c7..3791c26 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 _0x46b3=['ShowServicenowAccount','find','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x2a5d62,_0x1f81da){var _0x197518=function(_0x2d3a41){while(--_0x2d3a41){_0x2a5d62['push'](_0x2a5d62['shift']());}};_0x197518(++_0x1f81da);}(_0x46b3,0xf0));var _0x346b=function(_0x22a387,_0xb3cee){_0x22a387=_0x22a387-0x0;var _0x3ee0c2=_0x46b3[_0x22a387];return _0x3ee0c2;};'use strict';var _=require(_0x346b('0x0'));var util=require(_0x346b('0x1'));var moment=require(_0x346b('0x2'));var BPromise=require('bluebird');var rs=require(_0x346b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x346b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x346b('0x5'));var config=require(_0x346b('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x346b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x462a9b,_0x3fe926,_0x4b9e8d){return new BPromise(function(_0x1f3f8f,_0x5e86c3){return client[_0x346b('0x8')](_0x462a9b,_0x4b9e8d)[_0x346b('0x9')](function(_0x111e56){logger[_0x346b('0xa')](_0x346b('0xb'),_0x3fe926,'request\x20sent');logger[_0x346b('0xc')](_0x346b('0xd'),_0x3fe926,_0x346b('0xe'),JSON[_0x346b('0xf')](_0x111e56));if(_0x111e56[_0x346b('0x10')]){if(_0x111e56[_0x346b('0x10')][_0x346b('0x11')]===0x1f4){logger[_0x346b('0x10')](_0x346b('0xb'),_0x3fe926,_0x111e56['error'][_0x346b('0x12')]);return _0x5e86c3(_0x111e56[_0x346b('0x10')][_0x346b('0x12')]);}logger[_0x346b('0x10')](_0x346b('0xb'),_0x3fe926,_0x111e56['error'][_0x346b('0x12')]);return _0x1f3f8f(_0x111e56[_0x346b('0x10')][_0x346b('0x12')]);}else{logger[_0x346b('0xa')](_0x346b('0xb'),_0x3fe926,_0x346b('0xe'));_0x1f3f8f(_0x111e56[_0x346b('0x13')][_0x346b('0x12')]);}})[_0x346b('0x14')](function(_0x10778d){logger[_0x346b('0x10')](_0x346b('0xb'),_0x3fe926,_0x10778d);_0x5e86c3(_0x10778d);});});}exports[_0x346b('0x15')]=function(_0x3a919e){var _0x1cc912=this;return new Promise(function(_0x425e92,_0x297c65){return db[_0x346b('0x16')][_0x346b('0x17')]({'raw':_0x3a919e[_0x346b('0x18')]?_0x3a919e[_0x346b('0x18')][_0x346b('0x19')]===undefined?!![]:![]:!![],'where':_0x3a919e['options']?_0x3a919e['options'][_0x346b('0x1a')]||null:null,'attributes':_0x3a919e[_0x346b('0x18')]?_0x3a919e['options'][_0x346b('0x1b')]||null:null,'limit':_0x3a919e['options']?_0x3a919e[_0x346b('0x18')][_0x346b('0x1c')]||null:null,'include':_0x3a919e[_0x346b('0x18')]?_0x3a919e[_0x346b('0x18')][_0x346b('0x1d')]?_[_0x346b('0x1e')](_0x3a919e['options'][_0x346b('0x1d')],function(_0x2355db){return{'model':db[_0x2355db[_0x346b('0x1f')]],'as':_0x2355db['as'],'attributes':_0x2355db['attributes'],'include':_0x2355db[_0x346b('0x1d')]?_[_0x346b('0x1e')](_0x2355db[_0x346b('0x1d')],function(_0x252591){return{'model':db[_0x252591['model']],'as':_0x252591['as'],'attributes':_0x252591[_0x346b('0x1b')],'include':_0x252591[_0x346b('0x1d')]?_[_0x346b('0x1e')](_0x252591['include'],function(_0x595f92){return{'model':db[_0x595f92[_0x346b('0x1f')]],'as':_0x595f92['as'],'attributes':_0x595f92['attributes']};}):[]};}):[]};}):[]:[]})[_0x346b('0x9')](function(_0x1ff559){logger[_0x346b('0xa')](_0x346b('0x15'),_0x3a919e);logger[_0x346b('0xc')](_0x346b('0x15'),_0x3a919e,JSON[_0x346b('0xf')](_0x1ff559));_0x425e92(_0x1ff559);})['catch'](function(_0x4ab3fa){logger[_0x346b('0x10')](_0x346b('0x15'),_0x4ab3fa['message'],_0x3a919e);_0x297c65(_0x1cc912['error'](0x1f4,_0x4ab3fa[_0x346b('0x12')]));});});};exports[_0x346b('0x20')]=function(_0x10936f){var _0x434580=this;return new Promise(function(_0x24a11a,_0x368fba){return db['ServicenowAccount'][_0x346b('0x21')]({'raw':_0x10936f[_0x346b('0x18')]?_0x10936f[_0x346b('0x18')][_0x346b('0x19')]===undefined?!![]:![]:!![],'where':_0x10936f[_0x346b('0x18')]?_0x10936f[_0x346b('0x18')]['where']||null:null,'attributes':_0x10936f[_0x346b('0x18')]?_0x10936f[_0x346b('0x18')]['attributes']||null:null,'include':_0x10936f[_0x346b('0x18')]?_0x10936f[_0x346b('0x18')]['include']?_[_0x346b('0x1e')](_0x10936f[_0x346b('0x18')][_0x346b('0x1d')],function(_0x5f3174){return{'model':db[_0x5f3174['model']],'as':_0x5f3174['as'],'attributes':_0x5f3174[_0x346b('0x1b')],'include':_0x5f3174[_0x346b('0x1d')]?_[_0x346b('0x1e')](_0x5f3174['include'],function(_0x163822){return{'model':db[_0x163822[_0x346b('0x1f')]],'as':_0x163822['as'],'attributes':_0x163822[_0x346b('0x1b')],'include':_0x163822[_0x346b('0x1d')]?_['map'](_0x163822[_0x346b('0x1d')],function(_0xa84826){return{'model':db[_0xa84826[_0x346b('0x1f')]],'as':_0xa84826['as'],'attributes':_0xa84826[_0x346b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x346b('0x9')](function(_0x16e443){logger[_0x346b('0xa')](_0x346b('0x20'),_0x10936f);logger[_0x346b('0xc')](_0x346b('0x20'),_0x10936f,JSON[_0x346b('0xf')](_0x16e443));_0x24a11a(_0x16e443);})[_0x346b('0x14')](function(_0x3e6a16){logger[_0x346b('0x10')]('ShowServicenowAccount',_0x3e6a16[_0x346b('0x12')],_0x10936f);_0x368fba(_0x434580[_0x346b('0x10')](0x1f4,_0x3e6a16['message']));});});}; \ No newline at end of file +var _0xe0dd=['model','GetServicenowAccount','ShowServicenowAccount','find','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','info','request\x20sent','result','catch','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0dd,0x1ee));var _0xde0d=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xe0dd[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var moment=require(_0xde0d('0x2'));var BPromise=require('bluebird');var rs=require(_0xde0d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xde0d('0x4'));var logger=require(_0xde0d('0x5'))(_0xde0d('0x6'));var config=require(_0xde0d('0x7'));var jayson=require(_0xde0d('0x8'));var client=jayson['client'][_0xde0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c6457,_0x4e718d,_0x3915bd){return new BPromise(function(_0x26e6eb,_0x2cf755){return client[_0xde0d('0xa')](_0x1c6457,_0x3915bd)[_0xde0d('0xb')](function(_0x3091a2){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x4e718d,'request\x20sent');logger[_0xde0d('0xc')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x4e718d,'request\x20sent',JSON[_0xde0d('0xd')](_0x3091a2));if(_0x3091a2[_0xde0d('0xe')]){if(_0x3091a2['error'][_0xde0d('0xf')]===0x1f4){logger[_0xde0d('0xe')](_0xde0d('0x10'),_0x4e718d,_0x3091a2['error'][_0xde0d('0x11')]);return _0x2cf755(_0x3091a2[_0xde0d('0xe')]['message']);}logger[_0xde0d('0xe')](_0xde0d('0x10'),_0x4e718d,_0x3091a2[_0xde0d('0xe')][_0xde0d('0x11')]);return _0x26e6eb(_0x3091a2[_0xde0d('0xe')][_0xde0d('0x11')]);}else{logger[_0xde0d('0x12')](_0xde0d('0x10'),_0x4e718d,_0xde0d('0x13'));_0x26e6eb(_0x3091a2[_0xde0d('0x14')][_0xde0d('0x11')]);}})[_0xde0d('0x15')](function(_0x1a3efa){logger['error'](_0xde0d('0x10'),_0x4e718d,_0x1a3efa);_0x2cf755(_0x1a3efa);});});}exports['GetServicenowAccount']=function(_0x35b5b1){var _0x3ae5b5=this;return new Promise(function(_0x5bc3d0,_0x289e7c){return db[_0xde0d('0x16')][_0xde0d('0x17')]({'raw':_0x35b5b1[_0xde0d('0x18')]?_0x35b5b1[_0xde0d('0x18')][_0xde0d('0x19')]===undefined?!![]:![]:!![],'where':_0x35b5b1['options']?_0x35b5b1[_0xde0d('0x18')][_0xde0d('0x1a')]||null:null,'attributes':_0x35b5b1[_0xde0d('0x18')]?_0x35b5b1[_0xde0d('0x18')][_0xde0d('0x1b')]||null:null,'limit':_0x35b5b1[_0xde0d('0x18')]?_0x35b5b1[_0xde0d('0x18')][_0xde0d('0x1c')]||null:null,'include':_0x35b5b1[_0xde0d('0x18')]?_0x35b5b1[_0xde0d('0x18')][_0xde0d('0x1d')]?_[_0xde0d('0x1e')](_0x35b5b1[_0xde0d('0x18')][_0xde0d('0x1d')],function(_0x103c12){return{'model':db[_0x103c12[_0xde0d('0x1f')]],'as':_0x103c12['as'],'attributes':_0x103c12['attributes'],'include':_0x103c12['include']?_['map'](_0x103c12[_0xde0d('0x1d')],function(_0x89891d){return{'model':db[_0x89891d['model']],'as':_0x89891d['as'],'attributes':_0x89891d[_0xde0d('0x1b')],'include':_0x89891d[_0xde0d('0x1d')]?_[_0xde0d('0x1e')](_0x89891d[_0xde0d('0x1d')],function(_0x218551){return{'model':db[_0x218551[_0xde0d('0x1f')]],'as':_0x218551['as'],'attributes':_0x218551['attributes']};}):[]};}):[]};}):[]:[]})[_0xde0d('0xb')](function(_0x2f23a3){logger[_0xde0d('0x12')]('GetServicenowAccount',_0x35b5b1);logger[_0xde0d('0xc')](_0xde0d('0x20'),_0x35b5b1,JSON[_0xde0d('0xd')](_0x2f23a3));_0x5bc3d0(_0x2f23a3);})['catch'](function(_0x4b98a0){logger['error'](_0xde0d('0x20'),_0x4b98a0[_0xde0d('0x11')],_0x35b5b1);_0x289e7c(_0x3ae5b5[_0xde0d('0xe')](0x1f4,_0x4b98a0['message']));});});};exports[_0xde0d('0x21')]=function(_0xa2bcca){var _0x5d534b=this;return new Promise(function(_0x3200de,_0x41d4cd){return db[_0xde0d('0x16')][_0xde0d('0x22')]({'raw':_0xa2bcca[_0xde0d('0x18')]?_0xa2bcca[_0xde0d('0x18')][_0xde0d('0x19')]===undefined?!![]:![]:!![],'where':_0xa2bcca[_0xde0d('0x18')]?_0xa2bcca[_0xde0d('0x18')][_0xde0d('0x1a')]||null:null,'attributes':_0xa2bcca[_0xde0d('0x18')]?_0xa2bcca[_0xde0d('0x18')][_0xde0d('0x1b')]||null:null,'include':_0xa2bcca[_0xde0d('0x18')]?_0xa2bcca['options'][_0xde0d('0x1d')]?_['map'](_0xa2bcca[_0xde0d('0x18')]['include'],function(_0x3380f0){return{'model':db[_0x3380f0[_0xde0d('0x1f')]],'as':_0x3380f0['as'],'attributes':_0x3380f0[_0xde0d('0x1b')],'include':_0x3380f0[_0xde0d('0x1d')]?_[_0xde0d('0x1e')](_0x3380f0[_0xde0d('0x1d')],function(_0x3cc3b2){return{'model':db[_0x3cc3b2[_0xde0d('0x1f')]],'as':_0x3cc3b2['as'],'attributes':_0x3cc3b2[_0xde0d('0x1b')],'include':_0x3cc3b2[_0xde0d('0x1d')]?_[_0xde0d('0x1e')](_0x3cc3b2[_0xde0d('0x1d')],function(_0x39b3ad){return{'model':db[_0x39b3ad[_0xde0d('0x1f')]],'as':_0x39b3ad['as'],'attributes':_0x39b3ad[_0xde0d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30d37f){logger[_0xde0d('0x12')](_0xde0d('0x21'),_0xa2bcca);logger['debug']('ShowServicenowAccount',_0xa2bcca,JSON[_0xde0d('0xd')](_0x30d37f));_0x3200de(_0x30d37f);})[_0xde0d('0x15')](function(_0x480843){logger[_0xde0d('0xe')](_0xde0d('0x21'),_0x480843[_0xde0d('0x11')],_0xa2bcca);_0x41d4cd(_0x5d534b[_0xde0d('0xe')](0x1f4,_0x480843[_0xde0d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 6ebb085..6b761be 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 _0x74bb=['update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x74bb,0x6c));var _0xb74b=function(_0x295009,_0x5cb59c){_0x295009=_0x295009-0x0;var _0x40556a=_0x74bb[_0x295009];return _0x40556a;};'use strict';var multer=require('multer');var util=require(_0xb74b('0x0'));var path=require(_0xb74b('0x1'));var timeout=require(_0xb74b('0x2'));var express=require('express');var router=express[_0xb74b('0x3')]();var fs_extra=require(_0xb74b('0x4'));var auth=require(_0xb74b('0x5'));var interaction=require(_0xb74b('0x6'));var config=require(_0xb74b('0x7'));var controller=require(_0xb74b('0x8'));router[_0xb74b('0x9')]('/',auth['isAuthenticated'](),controller[_0xb74b('0xa')]);router['get'](_0xb74b('0xb'),auth[_0xb74b('0xc')](),controller[_0xb74b('0xd')]);router[_0xb74b('0x9')](_0xb74b('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xb74b('0x9')](_0xb74b('0xf'),auth[_0xb74b('0xc')](),controller[_0xb74b('0x10')]);router[_0xb74b('0x9')](_0xb74b('0x11'),auth[_0xb74b('0xc')](),controller[_0xb74b('0x12')]);router[_0xb74b('0x13')]('/',auth[_0xb74b('0xc')](),controller[_0xb74b('0x14')]);router[_0xb74b('0x15')](_0xb74b('0xb'),auth[_0xb74b('0xc')](),controller[_0xb74b('0x16')]);router[_0xb74b('0x17')](_0xb74b('0xb'),auth[_0xb74b('0xc')](),controller[_0xb74b('0x18')]);module[_0xb74b('0x19')]=router; \ No newline at end of file +var _0x0704=['/:id/descriptions','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects'];(function(_0x4923f9,_0x2ddd56){var _0xbb628a=function(_0x2b8a22){while(--_0x2b8a22){_0x4923f9['push'](_0x4923f9['shift']());}};_0xbb628a(++_0x2ddd56);}(_0x0704,0x117));var _0x4070=function(_0x9541a3,_0x99b1a2){_0x9541a3=_0x9541a3-0x0;var _0x274245=_0x0704[_0x9541a3];return _0x274245;};'use strict';var multer=require(_0x4070('0x0'));var util=require('util');var path=require(_0x4070('0x1'));var timeout=require(_0x4070('0x2'));var express=require(_0x4070('0x3'));var router=express[_0x4070('0x4')]();var fs_extra=require(_0x4070('0x5'));var auth=require(_0x4070('0x6'));var interaction=require(_0x4070('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x4070('0x8')]('/',auth[_0x4070('0x9')](),controller['index']);router[_0x4070('0x8')](_0x4070('0xa'),auth[_0x4070('0x9')](),controller[_0x4070('0xb')]);router[_0x4070('0x8')](_0x4070('0xc'),auth['isAuthenticated'](),controller[_0x4070('0xd')]);router['get']('/:id/subjects',auth[_0x4070('0x9')](),controller[_0x4070('0xe')]);router[_0x4070('0x8')](_0x4070('0xf'),auth[_0x4070('0x9')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x4070('0x10')]);router[_0x4070('0x11')](_0x4070('0xa'),auth[_0x4070('0x9')](),controller[_0x4070('0x12')]);router['delete'](_0x4070('0xa'),auth[_0x4070('0x9')](),controller[_0x4070('0x13')]);module[_0x4070('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 01e02fa..7054bfc 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 _0x17cb=['exports','STRING','sequelize'];(function(_0x2f2e96,_0x295cd4){var _0x30ec07=function(_0x415ae6){while(--_0x415ae6){_0x2f2e96['push'](_0x2f2e96['shift']());}};_0x30ec07(++_0x295cd4);}(_0x17cb,0x9e));var _0xb17c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x17cb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb17c('0x0'));module[_0xb17c('0x1')]={'name':{'type':Sequelize[_0xb17c('0x2')]},'description':{'type':Sequelize[_0xb17c('0x2')]}}; \ No newline at end of file +var _0x1865=['exports','STRING'];(function(_0x4f290e,_0xff8ceb){var _0x21b5c9=function(_0x282bd2){while(--_0x282bd2){_0x4f290e['push'](_0x4f290e['shift']());}};_0x21b5c9(++_0xff8ceb);}(_0x1865,0x168));var _0x5186=function(_0x5b83b1,_0x3d175a){_0x5b83b1=_0x5b83b1-0x0;var _0x1ddca1=_0x1865[_0x5b83b1];return _0x1ddca1;};'use strict';var Sequelize=require('sequelize');module[_0x5186('0x0')]={'name':{'type':Sequelize[_0x5186('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 8ce15f2..be9deab 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 _0x9259=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ServicenowConfiguration','include','findAll','rows','catch','params','keys','find','create','body','ServicenowField','getFields','getSubjects','findOne','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','destroy','stack','name','index','map','rawAttributes','fieldName','type','key'];(function(_0x3867e7,_0x3eacfb){var _0x2b6e4b=function(_0x52a4d9){while(--_0x52a4d9){_0x3867e7['push'](_0x3867e7['shift']());}};_0x2b6e4b(++_0x3eacfb);}(_0x9259,0x125));var _0x9925=function(_0x47cd62,_0x19bbf3){_0x47cd62=_0x47cd62-0x0;var _0x7923b9=_0x9259[_0x47cd62];return _0x7923b9;};'use strict';var emlformat=require(_0x9925('0x0'));var rimraf=require(_0x9925('0x1'));var zipdir=require(_0x9925('0x2'));var jsonpatch=require(_0x9925('0x3'));var rp=require(_0x9925('0x4'));var moment=require(_0x9925('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9925('0x6'));var util=require(_0x9925('0x7'));var path=require(_0x9925('0x8'));var sox=require('sox');var csv=require(_0x9925('0x9'));var ejs=require(_0x9925('0xa'));var fs=require('fs');var fs_extra=require(_0x9925('0xb'));var _=require(_0x9925('0xc'));var squel=require(_0x9925('0xd'));var crypto=require('crypto');var jsforce=require(_0x9925('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9925('0x9'));var querystring=require(_0x9925('0xf'));var Papa=require('papaparse');var Redis=require(_0x9925('0x10'));var authService=require(_0x9925('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9925('0x12'));var logger=require('../../config/logger')(_0x9925('0x13'));var utils=require(_0x9925('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9925('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x9925('0x16'));var client=jayson[_0x9925('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4451f9,_0x4d05ec,_0x17ef6b,_0x476dd6){return new BPromise(function(_0x339906,_0x15b29f){var _0x3e89d8=_0x476dd6||client;return _0x3e89d8[_0x9925('0x18')](_0x4451f9,_0x17ef6b)[_0x9925('0x19')](function(_0x3e7adb){logger[_0x9925('0x1a')](_0x9925('0x1b'),_0x4d05ec,_0x9925('0x1c'));logger[_0x9925('0x1d')](_0x9925('0x1e'),_0x4d05ec,_0x9925('0x1c'),JSON[_0x9925('0x1f')](_0x3e7adb));if(_0x3e7adb['error']){if(_0x3e7adb[_0x9925('0x20')][_0x9925('0x21')]===0x1f4){logger[_0x9925('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4d05ec,_0x3e7adb[_0x9925('0x20')][_0x9925('0x22')]);return _0x15b29f(_0x3e7adb[_0x9925('0x20')][_0x9925('0x22')]);}logger[_0x9925('0x20')](_0x9925('0x1b'),_0x4d05ec,_0x3e7adb[_0x9925('0x20')]['message']);return _0x339906(_0x3e7adb[_0x9925('0x20')][_0x9925('0x22')]);}else{logger[_0x9925('0x1a')](_0x9925('0x1b'),_0x4d05ec,_0x9925('0x1c'));_0x339906(_0x3e7adb[_0x9925('0x23')][_0x9925('0x22')]);}})['catch'](function(_0xee7c43){logger[_0x9925('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4d05ec,_0xee7c43);_0x15b29f(_0xee7c43);});});}function respondWithStatusCode(_0x5a15dc,_0x280c9a){_0x280c9a=_0x280c9a||0xcc;return function(_0xdb68d7){if(_0xdb68d7){return _0x5a15dc[_0x9925('0x24')](_0x280c9a);}return _0x5a15dc[_0x9925('0x25')](_0x280c9a)[_0x9925('0x26')]();};}function respondWithResult(_0x58db9a,_0x2177f3){_0x2177f3=_0x2177f3||0xc8;return function(_0x79f7d7){if(_0x79f7d7){return _0x58db9a[_0x9925('0x25')](_0x2177f3)[_0x9925('0x27')](_0x79f7d7);}};}function respondWithFilteredResult(_0x498c6d,_0x53a0b3){return function(_0x5eb7da){if(_0x5eb7da){var _0x453f3f=_0x5eb7da[_0x9925('0x28')],_0x3908c7=_0x53a0b3[_0x9925('0x29')],_0x3d6632=_0x53a0b3[_0x9925('0x29')]+_0x53a0b3[_0x9925('0x2a')],_0x5173d9;if(_0x3d6632>=_0x453f3f){_0x3d6632=_0x453f3f;_0x5173d9=0xc8;}else{_0x5173d9=0xce;}_0x498c6d[_0x9925('0x25')](_0x5173d9);return _0x498c6d['set'](_0x9925('0x2b'),_0x3908c7+'-'+_0x3d6632+'/'+_0x453f3f)[_0x9925('0x27')](_0x5eb7da);}return null;};}function patchUpdates(_0x2b63b0){return function(_0x2ae83e){try{jsonpatch['apply'](_0x2ae83e,_0x2b63b0,!![]);}catch(_0x32a10b){return BPromise[_0x9925('0x2c')](_0x32a10b);}return _0x2ae83e['save']();};}function saveUpdates(_0x58ca24,_0x814927){return function(_0xbaab23){if(_0xbaab23){return _0xbaab23[_0x9925('0x2d')](_0x58ca24)[_0x9925('0x19')](function(_0x1b1335){return _0x1b1335;});}return null;};}function removeEntity(_0x30313a,_0xa2c863){return function(_0x35c534){if(_0x35c534){return _0x35c534[_0x9925('0x2e')]()[_0x9925('0x19')](function(){_0x30313a[_0x9925('0x25')](0xcc)[_0x9925('0x26')]();});}};}function handleEntityNotFound(_0x330dbd,_0x228216){return function(_0x468f48){if(!_0x468f48){_0x330dbd[_0x9925('0x24')](0x194);}return _0x468f48;};}function handleError(_0x380603,_0x3c1224){_0x3c1224=_0x3c1224||0x1f4;return function(_0xfc405b){logger[_0x9925('0x20')](_0xfc405b[_0x9925('0x2f')]);if(_0xfc405b[_0x9925('0x30')]){delete _0xfc405b[_0x9925('0x30')];}_0x380603[_0x9925('0x25')](_0x3c1224)['send'](_0xfc405b);};}exports[_0x9925('0x31')]=function(_0x1d2f9a,_0x4d65a3){var _0x504cc4={},_0x38ea5a={},_0xcdf1ea={'count':0x0,'rows':[]};var _0x1e0526=_[_0x9925('0x32')](db['ServicenowConfiguration'][_0x9925('0x33')],function(_0x466606){return{'name':_0x466606[_0x9925('0x34')],'type':_0x466606[_0x9925('0x35')][_0x9925('0x36')]};});_0x38ea5a[_0x9925('0x37')]=_[_0x9925('0x32')](_0x1e0526,_0x9925('0x30'));_0x38ea5a['query']=_['keys'](_0x1d2f9a[_0x9925('0x38')]);_0x38ea5a[_0x9925('0x39')]=_[_0x9925('0x3a')](_0x38ea5a[_0x9925('0x37')],_0x38ea5a[_0x9925('0x38')]);_0x504cc4[_0x9925('0x3b')]=_[_0x9925('0x3a')](_0x38ea5a['model'],qs['fields'](_0x1d2f9a['query'][_0x9925('0x3c')]));_0x504cc4[_0x9925('0x3b')]=_0x504cc4[_0x9925('0x3b')][_0x9925('0x3d')]?_0x504cc4[_0x9925('0x3b')]:_0x38ea5a[_0x9925('0x37')];if(!_0x1d2f9a[_0x9925('0x38')][_0x9925('0x3e')](_0x9925('0x3f'))){_0x504cc4['limit']=qs['limit'](_0x1d2f9a['query'][_0x9925('0x2a')]);_0x504cc4[_0x9925('0x29')]=qs[_0x9925('0x29')](_0x1d2f9a[_0x9925('0x38')][_0x9925('0x29')]);}_0x504cc4[_0x9925('0x40')]=qs[_0x9925('0x41')](_0x1d2f9a['query'][_0x9925('0x41')]);_0x504cc4[_0x9925('0x42')]=qs['filters'](_['pick'](_0x1d2f9a[_0x9925('0x38')],_0x38ea5a[_0x9925('0x39')]),_0x1e0526);if(_0x1d2f9a[_0x9925('0x38')][_0x9925('0x43')]){_0x504cc4[_0x9925('0x42')]=_[_0x9925('0x44')](_0x504cc4[_0x9925('0x42')],{'$or':_['map'](_0x1e0526,function(_0x4b4a5c){if(_0x4b4a5c[_0x9925('0x35')]!==_0x9925('0x45')){var _0x5e048c={};_0x5e048c[_0x4b4a5c[_0x9925('0x30')]]={'$like':'%'+_0x1d2f9a[_0x9925('0x38')][_0x9925('0x43')]+'%'};return _0x5e048c;}})});}_0x504cc4=_['merge']({},_0x504cc4,_0x1d2f9a[_0x9925('0x46')]);var _0x24690d={'where':_0x504cc4[_0x9925('0x42')]};return db[_0x9925('0x47')][_0x9925('0x28')](_0x24690d)[_0x9925('0x19')](function(_0x518a4c){_0xcdf1ea[_0x9925('0x28')]=_0x518a4c;if(_0x1d2f9a['query']['includeAll']){_0x504cc4[_0x9925('0x48')]=[{'all':!![]}];}return db[_0x9925('0x47')][_0x9925('0x49')](_0x504cc4);})['then'](function(_0x2653a0){_0xcdf1ea[_0x9925('0x4a')]=_0x2653a0;return _0xcdf1ea;})[_0x9925('0x19')](respondWithFilteredResult(_0x4d65a3,_0x504cc4))[_0x9925('0x4b')](handleError(_0x4d65a3,null));};exports['show']=function(_0x342c14,_0x3b29eb){var _0x4ba42e={'raw':![],'where':{'id':_0x342c14[_0x9925('0x4c')]['id']}},_0x5b23e1={};_0x5b23e1[_0x9925('0x37')]=_[_0x9925('0x4d')](db[_0x9925('0x47')][_0x9925('0x33')]);_0x5b23e1['query']=_[_0x9925('0x4d')](_0x342c14['query']);_0x5b23e1[_0x9925('0x39')]=_[_0x9925('0x3a')](_0x5b23e1[_0x9925('0x37')],_0x5b23e1[_0x9925('0x38')]);_0x4ba42e[_0x9925('0x3b')]=_[_0x9925('0x3a')](_0x5b23e1[_0x9925('0x37')],qs['fields'](_0x342c14['query'][_0x9925('0x3c')]));_0x4ba42e[_0x9925('0x3b')]=_0x4ba42e[_0x9925('0x3b')][_0x9925('0x3d')]?_0x4ba42e[_0x9925('0x3b')]:_0x5b23e1[_0x9925('0x37')];if(_0x342c14[_0x9925('0x38')]['includeAll']){_0x4ba42e[_0x9925('0x48')]=[{'all':!![]}];}_0x4ba42e=_[_0x9925('0x44')]({},_0x4ba42e,_0x342c14[_0x9925('0x46')]);return db[_0x9925('0x47')][_0x9925('0x4e')](_0x4ba42e)[_0x9925('0x19')](handleEntityNotFound(_0x3b29eb,null))[_0x9925('0x19')](respondWithResult(_0x3b29eb,null))[_0x9925('0x4b')](handleError(_0x3b29eb,null));};exports[_0x9925('0x4f')]=function(_0x519779,_0x4a4dbb){return db['ServicenowConfiguration'][_0x9925('0x4f')](_0x519779['body'],{})['then'](respondWithResult(_0x4a4dbb,0xc9))['catch'](handleError(_0x4a4dbb,null));};exports[_0x9925('0x2d')]=function(_0x42285c,_0x58abcb){if(_0x42285c[_0x9925('0x50')]['id']){delete _0x42285c[_0x9925('0x50')]['id'];}return db[_0x9925('0x47')]['find']({'where':{'id':_0x42285c[_0x9925('0x4c')]['id']}})[_0x9925('0x19')](handleEntityNotFound(_0x58abcb,null))[_0x9925('0x19')](saveUpdates(_0x42285c[_0x9925('0x50')],null))['then'](respondWithResult(_0x58abcb,null))['catch'](handleError(_0x58abcb,null));};exports['destroy']=function(_0x3468f4,_0x4ecb88){return db['ServicenowConfiguration']['find']({'where':{'id':_0x3468f4['params']['id']}})[_0x9925('0x19')](handleEntityNotFound(_0x4ecb88,null))['then'](removeEntity(_0x4ecb88,null))['catch'](handleError(_0x4ecb88,null));};exports['getFields']=function(_0x3c740c,_0x3bdd4e,_0x14fb71){var _0x2807af={};var _0x41ab8f={};var _0x1bf8f0;var _0x4becf0;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x3c740c[_0x9925('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3bdd4e,null))[_0x9925('0x19')](function(_0x5c7220){if(_0x5c7220){_0x1bf8f0=_0x5c7220;_0x41ab8f[_0x9925('0x37')]=_['keys'](db[_0x9925('0x51')][_0x9925('0x33')]);_0x41ab8f['query']=_[_0x9925('0x4d')](_0x3c740c['query']);_0x41ab8f['filters']=_['intersection'](_0x41ab8f[_0x9925('0x37')],_0x41ab8f[_0x9925('0x38')]);_0x2807af[_0x9925('0x3b')]=_[_0x9925('0x3a')](_0x41ab8f['model'],qs[_0x9925('0x3c')](_0x3c740c[_0x9925('0x38')][_0x9925('0x3c')]));_0x2807af['attributes']=_0x2807af[_0x9925('0x3b')][_0x9925('0x3d')]?_0x2807af['attributes']:_0x41ab8f[_0x9925('0x37')];_0x2807af[_0x9925('0x40')]=qs['sort'](_0x3c740c['query'][_0x9925('0x41')]);_0x2807af[_0x9925('0x42')]=qs[_0x9925('0x39')](_['pick'](_0x3c740c[_0x9925('0x38')],_0x41ab8f[_0x9925('0x39')]));if(_0x3c740c[_0x9925('0x38')]['filter']){_0x2807af[_0x9925('0x42')]=_[_0x9925('0x44')](_0x2807af[_0x9925('0x42')],{'$or':_[_0x9925('0x32')](_0x2807af[_0x9925('0x3b')],function(_0x12569e){var _0x283dad={};_0x283dad[_0x12569e]={'$like':'%'+_0x3c740c[_0x9925('0x38')][_0x9925('0x43')]+'%'};return _0x283dad;})});}_0x2807af=_[_0x9925('0x44')]({},_0x2807af,_0x3c740c['options']);return _0x1bf8f0[_0x9925('0x52')](_0x2807af);}})[_0x9925('0x19')](function(_0x1a2278){if(_0x1a2278){_0x4becf0=_0x1a2278[_0x9925('0x3d')];if(!_0x3c740c[_0x9925('0x38')]['hasOwnProperty'](_0x9925('0x3f'))){_0x2807af['limit']=qs[_0x9925('0x2a')](_0x3c740c[_0x9925('0x38')][_0x9925('0x2a')]);_0x2807af[_0x9925('0x29')]=qs[_0x9925('0x29')](_0x3c740c[_0x9925('0x38')]['offset']);}return _0x1bf8f0[_0x9925('0x52')](_0x2807af);}})[_0x9925('0x19')](function(_0x53452b){if(_0x53452b){return _0x53452b?{'count':_0x4becf0,'rows':_0x53452b}:null;}})[_0x9925('0x19')](respondWithResult(_0x3bdd4e,null))['catch'](handleError(_0x3bdd4e,null));};exports[_0x9925('0x53')]=function(_0x15b074,_0x1ce779,_0x1c6197){var _0x5cad03={};var _0x438cb8={};var _0xf73569;var _0x4cd0f5;return db[_0x9925('0x47')][_0x9925('0x54')]({'where':{'id':_0x15b074['params']['id']}})[_0x9925('0x19')](handleEntityNotFound(_0x1ce779,null))[_0x9925('0x19')](function(_0x85b804){if(_0x85b804){_0xf73569=_0x85b804;_0x438cb8[_0x9925('0x37')]=_[_0x9925('0x4d')](db[_0x9925('0x51')][_0x9925('0x33')]);_0x438cb8[_0x9925('0x38')]=_[_0x9925('0x4d')](_0x15b074[_0x9925('0x38')]);_0x438cb8['filters']=_[_0x9925('0x3a')](_0x438cb8['model'],_0x438cb8[_0x9925('0x38')]);_0x5cad03[_0x9925('0x3b')]=_[_0x9925('0x3a')](_0x438cb8[_0x9925('0x37')],qs[_0x9925('0x3c')](_0x15b074[_0x9925('0x38')][_0x9925('0x3c')]));_0x5cad03[_0x9925('0x3b')]=_0x5cad03[_0x9925('0x3b')][_0x9925('0x3d')]?_0x5cad03[_0x9925('0x3b')]:_0x438cb8['model'];_0x5cad03['order']=qs[_0x9925('0x41')](_0x15b074[_0x9925('0x38')][_0x9925('0x41')]);_0x5cad03[_0x9925('0x42')]=qs[_0x9925('0x39')](_[_0x9925('0x55')](_0x15b074[_0x9925('0x38')],_0x438cb8['filters']));if(_0x15b074[_0x9925('0x38')][_0x9925('0x43')]){_0x5cad03[_0x9925('0x42')]=_['merge'](_0x5cad03[_0x9925('0x42')],{'$or':_[_0x9925('0x32')](_0x5cad03[_0x9925('0x3b')],function(_0x31a8fe){var _0x415676={};_0x415676[_0x31a8fe]={'$like':'%'+_0x15b074[_0x9925('0x38')][_0x9925('0x43')]+'%'};return _0x415676;})});}_0x5cad03=_[_0x9925('0x44')]({},_0x5cad03,_0x15b074[_0x9925('0x46')]);return _0xf73569[_0x9925('0x53')](_0x5cad03);}})[_0x9925('0x19')](function(_0x1c5625){if(_0x1c5625){_0x4cd0f5=_0x1c5625['length'];if(!_0x15b074[_0x9925('0x38')][_0x9925('0x3e')]('nolimit')){_0x5cad03[_0x9925('0x2a')]=qs[_0x9925('0x2a')](_0x15b074['query'][_0x9925('0x2a')]);_0x5cad03[_0x9925('0x29')]=qs[_0x9925('0x29')](_0x15b074[_0x9925('0x38')][_0x9925('0x29')]);}return _0xf73569['getSubjects'](_0x5cad03);}})[_0x9925('0x19')](function(_0x1022f0){if(_0x1022f0){return _0x1022f0?{'count':_0x4cd0f5,'rows':_0x1022f0}:null;}})[_0x9925('0x19')](respondWithResult(_0x1ce779,null))[_0x9925('0x4b')](handleError(_0x1ce779,null));};exports['getDescriptions']=function(_0x4011d4,_0xb4c7c6,_0x2d58fa){var _0x4ee27f={};var _0x145824={};var _0x1faf68;var _0x55affc;return db[_0x9925('0x47')]['findOne']({'where':{'id':_0x4011d4[_0x9925('0x4c')]['id']}})[_0x9925('0x19')](handleEntityNotFound(_0xb4c7c6,null))[_0x9925('0x19')](function(_0x47b7cb){if(_0x47b7cb){_0x1faf68=_0x47b7cb;_0x145824[_0x9925('0x37')]=_[_0x9925('0x4d')](db[_0x9925('0x51')]['rawAttributes']);_0x145824['query']=_[_0x9925('0x4d')](_0x4011d4[_0x9925('0x38')]);_0x145824[_0x9925('0x39')]=_[_0x9925('0x3a')](_0x145824[_0x9925('0x37')],_0x145824['query']);_0x4ee27f[_0x9925('0x3b')]=_[_0x9925('0x3a')](_0x145824[_0x9925('0x37')],qs[_0x9925('0x3c')](_0x4011d4[_0x9925('0x38')][_0x9925('0x3c')]));_0x4ee27f['attributes']=_0x4ee27f[_0x9925('0x3b')][_0x9925('0x3d')]?_0x4ee27f[_0x9925('0x3b')]:_0x145824[_0x9925('0x37')];_0x4ee27f[_0x9925('0x40')]=qs[_0x9925('0x41')](_0x4011d4[_0x9925('0x38')][_0x9925('0x41')]);_0x4ee27f[_0x9925('0x42')]=qs['filters'](_[_0x9925('0x55')](_0x4011d4['query'],_0x145824[_0x9925('0x39')]));if(_0x4011d4[_0x9925('0x38')][_0x9925('0x43')]){_0x4ee27f[_0x9925('0x42')]=_[_0x9925('0x44')](_0x4ee27f[_0x9925('0x42')],{'$or':_[_0x9925('0x32')](_0x4ee27f['attributes'],function(_0x582c86){var _0x27e1c7={};_0x27e1c7[_0x582c86]={'$like':'%'+_0x4011d4[_0x9925('0x38')][_0x9925('0x43')]+'%'};return _0x27e1c7;})});}_0x4ee27f=_[_0x9925('0x44')]({},_0x4ee27f,_0x4011d4['options']);return _0x1faf68[_0x9925('0x56')](_0x4ee27f);}})[_0x9925('0x19')](function(_0x40124e){if(_0x40124e){_0x55affc=_0x40124e[_0x9925('0x3d')];if(!_0x4011d4[_0x9925('0x38')][_0x9925('0x3e')]('nolimit')){_0x4ee27f[_0x9925('0x2a')]=qs[_0x9925('0x2a')](_0x4011d4[_0x9925('0x38')]['limit']);_0x4ee27f[_0x9925('0x29')]=qs[_0x9925('0x29')](_0x4011d4[_0x9925('0x38')]['offset']);}return _0x1faf68[_0x9925('0x56')](_0x4ee27f);}})['then'](function(_0xb42783){if(_0xb42783){return _0xb42783?{'count':_0x55affc,'rows':_0xb42783}:null;}})['then'](respondWithResult(_0xb4c7c6,null))['catch'](handleError(_0xb4c7c6,null));}; \ No newline at end of file +var _0x819a=['send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','count','include','rows','show','params','length','includeAll','options','find','create','body','findOne','ServicenowField','getFields','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','end','status','json','offset','limit','set','apply','update','destroy','then','name'];(function(_0x534944,_0x134d68){var _0x57f82f=function(_0x325fa1){while(--_0x325fa1){_0x534944['push'](_0x534944['shift']());}};_0x57f82f(++_0x134d68);}(_0x819a,0x139));var _0xa819=function(_0x17a22a,_0x4d1ba7){_0x17a22a=_0x17a22a-0x0;var _0x1c1735=_0x819a[_0x17a22a];return _0x1c1735;};'use strict';var emlformat=require(_0xa819('0x0'));var rimraf=require(_0xa819('0x1'));var zipdir=require(_0xa819('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa819('0x3'));var BPromise=require(_0xa819('0x4'));var Mustache=require(_0xa819('0x5'));var util=require(_0xa819('0x6'));var path=require(_0xa819('0x7'));var sox=require(_0xa819('0x8'));var csv=require(_0xa819('0x9'));var ejs=require(_0xa819('0xa'));var fs=require('fs');var fs_extra=require(_0xa819('0xb'));var _=require(_0xa819('0xc'));var squel=require('squel');var crypto=require(_0xa819('0xd'));var jsforce=require(_0xa819('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa819('0x9'));var querystring=require(_0xa819('0xf'));var Papa=require(_0xa819('0x10'));var Redis=require(_0xa819('0x11'));var authService=require(_0xa819('0x12'));var qs=require(_0xa819('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa819('0x14'));var logger=require(_0xa819('0x15'))(_0xa819('0x16'));var utils=require(_0xa819('0x17'));var config=require(_0xa819('0x18'));var licenseUtil=require(_0xa819('0x19'));var db=require(_0xa819('0x1a'))['db'];var jayson=require(_0xa819('0x1b'));var client=jayson[_0xa819('0x1c')][_0xa819('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4432be,_0x59cc7a,_0x16f3e7,_0x75dd59){return new BPromise(function(_0x49c716,_0x3dfb97){var _0x363944=_0x75dd59||client;return _0x363944[_0xa819('0x1e')](_0x4432be,_0x16f3e7)['then'](function(_0x3712d5){logger[_0xa819('0x1f')](_0xa819('0x20'),_0x59cc7a,'request\x20sent');logger['debug'](_0xa819('0x21'),_0x59cc7a,_0xa819('0x22'),JSON[_0xa819('0x23')](_0x3712d5));if(_0x3712d5[_0xa819('0x24')]){if(_0x3712d5['error']['code']===0x1f4){logger[_0xa819('0x24')]('ServicenowConfiguration,\x20%s,\x20%s',_0x59cc7a,_0x3712d5[_0xa819('0x24')][_0xa819('0x25')]);return _0x3dfb97(_0x3712d5[_0xa819('0x24')][_0xa819('0x25')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x59cc7a,_0x3712d5[_0xa819('0x24')][_0xa819('0x25')]);return _0x49c716(_0x3712d5[_0xa819('0x24')][_0xa819('0x25')]);}else{logger[_0xa819('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s',_0x59cc7a,_0xa819('0x22'));_0x49c716(_0x3712d5['result'][_0xa819('0x25')]);}})[_0xa819('0x26')](function(_0x5e9085){logger[_0xa819('0x24')]('ServicenowConfiguration,\x20%s,\x20%s',_0x59cc7a,_0x5e9085);_0x3dfb97(_0x5e9085);});});}function respondWithStatusCode(_0x1c69d0,_0x4b5aad){_0x4b5aad=_0x4b5aad||0xcc;return function(_0x71dbf6){if(_0x71dbf6){return _0x1c69d0[_0xa819('0x27')](_0x4b5aad);}return _0x1c69d0['status'](_0x4b5aad)[_0xa819('0x28')]();};}function respondWithResult(_0x1432b1,_0x47fb98){_0x47fb98=_0x47fb98||0xc8;return function(_0x690bb0){if(_0x690bb0){return _0x1432b1[_0xa819('0x29')](_0x47fb98)[_0xa819('0x2a')](_0x690bb0);}};}function respondWithFilteredResult(_0x42c4e9,_0x48f9dc){return function(_0x4c44b0){if(_0x4c44b0){var _0x4e8fde=_0x4c44b0['count'],_0x1aca62=_0x48f9dc[_0xa819('0x2b')],_0x471591=_0x48f9dc['offset']+_0x48f9dc[_0xa819('0x2c')],_0x3bdffc;if(_0x471591>=_0x4e8fde){_0x471591=_0x4e8fde;_0x3bdffc=0xc8;}else{_0x3bdffc=0xce;}_0x42c4e9[_0xa819('0x29')](_0x3bdffc);return _0x42c4e9[_0xa819('0x2d')]('Content-Range',_0x1aca62+'-'+_0x471591+'/'+_0x4e8fde)[_0xa819('0x2a')](_0x4c44b0);}return null;};}function patchUpdates(_0x1dddc8){return function(_0x117e53){try{jsonpatch[_0xa819('0x2e')](_0x117e53,_0x1dddc8,!![]);}catch(_0x9b4d0b){return BPromise['reject'](_0x9b4d0b);}return _0x117e53['save']();};}function saveUpdates(_0xab26de,_0x29d71b){return function(_0x15492d){if(_0x15492d){return _0x15492d[_0xa819('0x2f')](_0xab26de)['then'](function(_0x345d3d){return _0x345d3d;});}return null;};}function removeEntity(_0x17bce1,_0xfbb743){return function(_0x13c345){if(_0x13c345){return _0x13c345[_0xa819('0x30')]()[_0xa819('0x31')](function(){_0x17bce1[_0xa819('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56782a,_0x5a57ca){return function(_0x45da03){if(!_0x45da03){_0x56782a[_0xa819('0x27')](0x194);}return _0x45da03;};}function handleError(_0x59214d,_0x1c6523){_0x1c6523=_0x1c6523||0x1f4;return function(_0x1ae87e){logger[_0xa819('0x24')](_0x1ae87e['stack']);if(_0x1ae87e[_0xa819('0x32')]){delete _0x1ae87e[_0xa819('0x32')];}_0x59214d[_0xa819('0x29')](_0x1c6523)[_0xa819('0x33')](_0x1ae87e);};}exports[_0xa819('0x34')]=function(_0x2199d1,_0x3a9733){var _0x98fd2d={},_0x407261={},_0x1728fe={'count':0x0,'rows':[]};var _0x322949=_['map'](db[_0xa819('0x35')][_0xa819('0x36')],function(_0x181284){return{'name':_0x181284[_0xa819('0x37')],'type':_0x181284[_0xa819('0x38')][_0xa819('0x39')]};});_0x407261[_0xa819('0x3a')]=_[_0xa819('0x3b')](_0x322949,_0xa819('0x32'));_0x407261['query']=_[_0xa819('0x3c')](_0x2199d1[_0xa819('0x3d')]);_0x407261['filters']=_[_0xa819('0x3e')](_0x407261[_0xa819('0x3a')],_0x407261[_0xa819('0x3d')]);_0x98fd2d[_0xa819('0x3f')]=_[_0xa819('0x3e')](_0x407261['model'],qs[_0xa819('0x40')](_0x2199d1[_0xa819('0x3d')]['fields']));_0x98fd2d['attributes']=_0x98fd2d[_0xa819('0x3f')]['length']?_0x98fd2d[_0xa819('0x3f')]:_0x407261[_0xa819('0x3a')];if(!_0x2199d1[_0xa819('0x3d')][_0xa819('0x41')]('nolimit')){_0x98fd2d[_0xa819('0x2c')]=qs[_0xa819('0x2c')](_0x2199d1[_0xa819('0x3d')][_0xa819('0x2c')]);_0x98fd2d[_0xa819('0x2b')]=qs[_0xa819('0x2b')](_0x2199d1[_0xa819('0x3d')]['offset']);}_0x98fd2d[_0xa819('0x42')]=qs[_0xa819('0x43')](_0x2199d1[_0xa819('0x3d')][_0xa819('0x43')]);_0x98fd2d[_0xa819('0x44')]=qs[_0xa819('0x45')](_[_0xa819('0x46')](_0x2199d1['query'],_0x407261[_0xa819('0x45')]),_0x322949);if(_0x2199d1['query']['filter']){_0x98fd2d[_0xa819('0x44')]=_[_0xa819('0x47')](_0x98fd2d[_0xa819('0x44')],{'$or':_['map'](_0x322949,function(_0xacbe13){if(_0xacbe13['type']!==_0xa819('0x48')){var _0x56dd5a={};_0x56dd5a[_0xacbe13[_0xa819('0x32')]]={'$like':'%'+_0x2199d1[_0xa819('0x3d')][_0xa819('0x49')]+'%'};return _0x56dd5a;}})});}_0x98fd2d=_[_0xa819('0x47')]({},_0x98fd2d,_0x2199d1['options']);var _0x5aa49c={'where':_0x98fd2d['where']};return db[_0xa819('0x35')][_0xa819('0x4a')](_0x5aa49c)[_0xa819('0x31')](function(_0x2512d8){_0x1728fe[_0xa819('0x4a')]=_0x2512d8;if(_0x2199d1[_0xa819('0x3d')]['includeAll']){_0x98fd2d[_0xa819('0x4b')]=[{'all':!![]}];}return db[_0xa819('0x35')]['findAll'](_0x98fd2d);})['then'](function(_0xb07b4d){_0x1728fe[_0xa819('0x4c')]=_0xb07b4d;return _0x1728fe;})['then'](respondWithFilteredResult(_0x3a9733,_0x98fd2d))['catch'](handleError(_0x3a9733,null));};exports[_0xa819('0x4d')]=function(_0x2442c6,_0x324401){var _0x21afe5={'raw':![],'where':{'id':_0x2442c6[_0xa819('0x4e')]['id']}},_0x198428={};_0x198428['model']=_[_0xa819('0x3c')](db[_0xa819('0x35')]['rawAttributes']);_0x198428[_0xa819('0x3d')]=_[_0xa819('0x3c')](_0x2442c6[_0xa819('0x3d')]);_0x198428[_0xa819('0x45')]=_['intersection'](_0x198428[_0xa819('0x3a')],_0x198428[_0xa819('0x3d')]);_0x21afe5[_0xa819('0x3f')]=_[_0xa819('0x3e')](_0x198428[_0xa819('0x3a')],qs[_0xa819('0x40')](_0x2442c6[_0xa819('0x3d')][_0xa819('0x40')]));_0x21afe5[_0xa819('0x3f')]=_0x21afe5[_0xa819('0x3f')][_0xa819('0x4f')]?_0x21afe5[_0xa819('0x3f')]:_0x198428[_0xa819('0x3a')];if(_0x2442c6[_0xa819('0x3d')][_0xa819('0x50')]){_0x21afe5['include']=[{'all':!![]}];}_0x21afe5=_['merge']({},_0x21afe5,_0x2442c6[_0xa819('0x51')]);return db['ServicenowConfiguration'][_0xa819('0x52')](_0x21afe5)[_0xa819('0x31')](handleEntityNotFound(_0x324401,null))[_0xa819('0x31')](respondWithResult(_0x324401,null))[_0xa819('0x26')](handleError(_0x324401,null));};exports[_0xa819('0x53')]=function(_0x382de5,_0x27e267){return db[_0xa819('0x35')][_0xa819('0x53')](_0x382de5[_0xa819('0x54')],{})[_0xa819('0x31')](respondWithResult(_0x27e267,0xc9))['catch'](handleError(_0x27e267,null));};exports[_0xa819('0x2f')]=function(_0x7b2a8f,_0x180106){if(_0x7b2a8f[_0xa819('0x54')]['id']){delete _0x7b2a8f[_0xa819('0x54')]['id'];}return db[_0xa819('0x35')][_0xa819('0x52')]({'where':{'id':_0x7b2a8f[_0xa819('0x4e')]['id']}})[_0xa819('0x31')](handleEntityNotFound(_0x180106,null))['then'](saveUpdates(_0x7b2a8f['body'],null))[_0xa819('0x31')](respondWithResult(_0x180106,null))[_0xa819('0x26')](handleError(_0x180106,null));};exports[_0xa819('0x30')]=function(_0x6cd2a8,_0xc29cee){return db[_0xa819('0x35')][_0xa819('0x52')]({'where':{'id':_0x6cd2a8['params']['id']}})[_0xa819('0x31')](handleEntityNotFound(_0xc29cee,null))[_0xa819('0x31')](removeEntity(_0xc29cee,null))[_0xa819('0x26')](handleError(_0xc29cee,null));};exports['getFields']=function(_0x1e75b9,_0x559eca,_0x3f1157){var _0x574071={};var _0x4e25cf={};var _0x5bbb21;var _0x516d7e;return db['ServicenowConfiguration'][_0xa819('0x55')]({'where':{'id':_0x1e75b9[_0xa819('0x4e')]['id']}})[_0xa819('0x31')](handleEntityNotFound(_0x559eca,null))[_0xa819('0x31')](function(_0x35d832){if(_0x35d832){_0x5bbb21=_0x35d832;_0x4e25cf['model']=_[_0xa819('0x3c')](db[_0xa819('0x56')]['rawAttributes']);_0x4e25cf['query']=_[_0xa819('0x3c')](_0x1e75b9['query']);_0x4e25cf[_0xa819('0x45')]=_[_0xa819('0x3e')](_0x4e25cf['model'],_0x4e25cf[_0xa819('0x3d')]);_0x574071['attributes']=_['intersection'](_0x4e25cf[_0xa819('0x3a')],qs[_0xa819('0x40')](_0x1e75b9[_0xa819('0x3d')]['fields']));_0x574071['attributes']=_0x574071[_0xa819('0x3f')][_0xa819('0x4f')]?_0x574071[_0xa819('0x3f')]:_0x4e25cf['model'];_0x574071['order']=qs['sort'](_0x1e75b9['query'][_0xa819('0x43')]);_0x574071[_0xa819('0x44')]=qs[_0xa819('0x45')](_['pick'](_0x1e75b9['query'],_0x4e25cf[_0xa819('0x45')]));if(_0x1e75b9[_0xa819('0x3d')]['filter']){_0x574071[_0xa819('0x44')]=_['merge'](_0x574071[_0xa819('0x44')],{'$or':_[_0xa819('0x3b')](_0x574071[_0xa819('0x3f')],function(_0x2f01a8){var _0x26b474={};_0x26b474[_0x2f01a8]={'$like':'%'+_0x1e75b9[_0xa819('0x3d')][_0xa819('0x49')]+'%'};return _0x26b474;})});}_0x574071=_[_0xa819('0x47')]({},_0x574071,_0x1e75b9['options']);return _0x5bbb21['getFields'](_0x574071);}})[_0xa819('0x31')](function(_0x4ca065){if(_0x4ca065){_0x516d7e=_0x4ca065[_0xa819('0x4f')];if(!_0x1e75b9[_0xa819('0x3d')]['hasOwnProperty']('nolimit')){_0x574071[_0xa819('0x2c')]=qs[_0xa819('0x2c')](_0x1e75b9[_0xa819('0x3d')][_0xa819('0x2c')]);_0x574071[_0xa819('0x2b')]=qs[_0xa819('0x2b')](_0x1e75b9[_0xa819('0x3d')][_0xa819('0x2b')]);}return _0x5bbb21[_0xa819('0x57')](_0x574071);}})['then'](function(_0x2d73e0){if(_0x2d73e0){return _0x2d73e0?{'count':_0x516d7e,'rows':_0x2d73e0}:null;}})[_0xa819('0x31')](respondWithResult(_0x559eca,null))[_0xa819('0x26')](handleError(_0x559eca,null));};exports['getSubjects']=function(_0x1f18e9,_0x302d6c,_0x2cb56f){var _0x5385c9={};var _0x535349={};var _0x47b53f;var _0xd769e5;return db[_0xa819('0x35')][_0xa819('0x55')]({'where':{'id':_0x1f18e9['params']['id']}})['then'](handleEntityNotFound(_0x302d6c,null))[_0xa819('0x31')](function(_0x53a8a3){if(_0x53a8a3){_0x47b53f=_0x53a8a3;_0x535349[_0xa819('0x3a')]=_[_0xa819('0x3c')](db[_0xa819('0x56')]['rawAttributes']);_0x535349[_0xa819('0x3d')]=_[_0xa819('0x3c')](_0x1f18e9['query']);_0x535349[_0xa819('0x45')]=_[_0xa819('0x3e')](_0x535349[_0xa819('0x3a')],_0x535349[_0xa819('0x3d')]);_0x5385c9[_0xa819('0x3f')]=_[_0xa819('0x3e')](_0x535349['model'],qs['fields'](_0x1f18e9[_0xa819('0x3d')][_0xa819('0x40')]));_0x5385c9[_0xa819('0x3f')]=_0x5385c9[_0xa819('0x3f')][_0xa819('0x4f')]?_0x5385c9[_0xa819('0x3f')]:_0x535349[_0xa819('0x3a')];_0x5385c9[_0xa819('0x42')]=qs[_0xa819('0x43')](_0x1f18e9[_0xa819('0x3d')]['sort']);_0x5385c9['where']=qs[_0xa819('0x45')](_['pick'](_0x1f18e9['query'],_0x535349[_0xa819('0x45')]));if(_0x1f18e9[_0xa819('0x3d')]['filter']){_0x5385c9['where']=_['merge'](_0x5385c9[_0xa819('0x44')],{'$or':_[_0xa819('0x3b')](_0x5385c9[_0xa819('0x3f')],function(_0x8f6a8c){var _0x173138={};_0x173138[_0x8f6a8c]={'$like':'%'+_0x1f18e9[_0xa819('0x3d')]['filter']+'%'};return _0x173138;})});}_0x5385c9=_[_0xa819('0x47')]({},_0x5385c9,_0x1f18e9['options']);return _0x47b53f[_0xa819('0x58')](_0x5385c9);}})[_0xa819('0x31')](function(_0xba9c33){if(_0xba9c33){_0xd769e5=_0xba9c33[_0xa819('0x4f')];if(!_0x1f18e9[_0xa819('0x3d')][_0xa819('0x41')](_0xa819('0x59'))){_0x5385c9['limit']=qs[_0xa819('0x2c')](_0x1f18e9['query'][_0xa819('0x2c')]);_0x5385c9['offset']=qs[_0xa819('0x2b')](_0x1f18e9[_0xa819('0x3d')][_0xa819('0x2b')]);}return _0x47b53f[_0xa819('0x58')](_0x5385c9);}})['then'](function(_0x52b96e){if(_0x52b96e){return _0x52b96e?{'count':_0xd769e5,'rows':_0x52b96e}:null;}})[_0xa819('0x31')](respondWithResult(_0x302d6c,null))[_0xa819('0x26')](handleError(_0x302d6c,null));};exports[_0xa819('0x5a')]=function(_0x34fb43,_0x3c16a0,_0x58864b){var _0x5e66dc={};var _0x38500e={};var _0x40657f;var _0x58b895;return db[_0xa819('0x35')][_0xa819('0x55')]({'where':{'id':_0x34fb43['params']['id']}})[_0xa819('0x31')](handleEntityNotFound(_0x3c16a0,null))[_0xa819('0x31')](function(_0x3cd9cf){if(_0x3cd9cf){_0x40657f=_0x3cd9cf;_0x38500e['model']=_[_0xa819('0x3c')](db[_0xa819('0x56')]['rawAttributes']);_0x38500e[_0xa819('0x3d')]=_[_0xa819('0x3c')](_0x34fb43[_0xa819('0x3d')]);_0x38500e[_0xa819('0x45')]=_[_0xa819('0x3e')](_0x38500e[_0xa819('0x3a')],_0x38500e['query']);_0x5e66dc['attributes']=_[_0xa819('0x3e')](_0x38500e[_0xa819('0x3a')],qs['fields'](_0x34fb43[_0xa819('0x3d')][_0xa819('0x40')]));_0x5e66dc[_0xa819('0x3f')]=_0x5e66dc[_0xa819('0x3f')]['length']?_0x5e66dc[_0xa819('0x3f')]:_0x38500e[_0xa819('0x3a')];_0x5e66dc[_0xa819('0x42')]=qs[_0xa819('0x43')](_0x34fb43['query'][_0xa819('0x43')]);_0x5e66dc[_0xa819('0x44')]=qs[_0xa819('0x45')](_[_0xa819('0x46')](_0x34fb43[_0xa819('0x3d')],_0x38500e[_0xa819('0x45')]));if(_0x34fb43[_0xa819('0x3d')][_0xa819('0x49')]){_0x5e66dc[_0xa819('0x44')]=_[_0xa819('0x47')](_0x5e66dc[_0xa819('0x44')],{'$or':_[_0xa819('0x3b')](_0x5e66dc[_0xa819('0x3f')],function(_0xb6d50f){var _0xd55497={};_0xd55497[_0xb6d50f]={'$like':'%'+_0x34fb43[_0xa819('0x3d')][_0xa819('0x49')]+'%'};return _0xd55497;})});}_0x5e66dc=_[_0xa819('0x47')]({},_0x5e66dc,_0x34fb43[_0xa819('0x51')]);return _0x40657f['getDescriptions'](_0x5e66dc);}})['then'](function(_0x375d89){if(_0x375d89){_0x58b895=_0x375d89['length'];if(!_0x34fb43['query'][_0xa819('0x41')](_0xa819('0x59'))){_0x5e66dc['limit']=qs['limit'](_0x34fb43[_0xa819('0x3d')]['limit']);_0x5e66dc[_0xa819('0x2b')]=qs['offset'](_0x34fb43[_0xa819('0x3d')][_0xa819('0x2b')]);}return _0x40657f[_0xa819('0x5a')](_0x5e66dc);}})[_0xa819('0x31')](function(_0x47c059){if(_0x47c059){return _0x47c059?{'count':_0x58b895,'rows':_0x47c059}:null;}})[_0xa819('0x31')](respondWithResult(_0x3c16a0,null))[_0xa819('0x26')](handleError(_0x3c16a0,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 4bb3f5c..33f4726 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 _0x7bd5=['moment','bluebird','path','rimraf','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api'];(function(_0x44c7a2,_0x449be7){var _0x3efc90=function(_0x114726){while(--_0x114726){_0x44c7a2['push'](_0x44c7a2['shift']());}};_0x3efc90(++_0x449be7);}(_0x7bd5,0x1e1));var _0x57bd=function(_0x5863f2,_0x1b319d){_0x5863f2=_0x5863f2-0x0;var _0x1cd9e6=_0x7bd5[_0x5863f2];return _0x1cd9e6;};'use strict';var _=require(_0x57bd('0x0'));var util=require('util');var logger=require(_0x57bd('0x1'))(_0x57bd('0x2'));var moment=require(_0x57bd('0x3'));var BPromise=require(_0x57bd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57bd('0x5'));var rimraf=require(_0x57bd('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module[_0x57bd('0x7')]=function(_0x3bee18,_0xd63e7b){return _0x3bee18[_0x57bd('0x8')](_0x57bd('0x9'),attributes,{'tableName':_0x57bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b58=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api'];(function(_0x52f975,_0x305404){var _0x1b15a3=function(_0x5e9a63){while(--_0x5e9a63){_0x52f975['push'](_0x52f975['shift']());}};_0x1b15a3(++_0x305404);}(_0x6b58,0x128));var _0x86b5=function(_0x1602fb,_0x20b6b3){_0x1602fb=_0x1602fb-0x0;var _0x461831=_0x6b58[_0x1602fb];return _0x461831;};'use strict';var _=require(_0x86b5('0x0'));var util=require('util');var logger=require(_0x86b5('0x1'))(_0x86b5('0x2'));var moment=require(_0x86b5('0x3'));var BPromise=require(_0x86b5('0x4'));var rp=require(_0x86b5('0x5'));var fs=require('fs');var path=require(_0x86b5('0x6'));var rimraf=require(_0x86b5('0x7'));var config=require(_0x86b5('0x8'));var attributes=require(_0x86b5('0x9'));module[_0x86b5('0xa')]=function(_0x5b0a78,_0x10a38a){return _0x5b0a78['define'](_0x86b5('0xb'),attributes,{'tableName':_0x86b5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index dc566a1..72d7361 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 _0xe49f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment'];(function(_0x52b34e,_0x26bfbe){var _0x3d6a3d=function(_0xcbaae2){while(--_0xcbaae2){_0x52b34e['push'](_0x52b34e['shift']());}};_0x3d6a3d(++_0x26bfbe);}(_0xe49f,0x7c));var _0xfe49=function(_0x5b4071,_0x4a507c){_0x5b4071=_0x5b4071-0x0;var _0x2a6ed0=_0xe49f[_0x5b4071];return _0x2a6ed0;};'use strict';var _=require('lodash');var util=require(_0xfe49('0x0'));var moment=require(_0xfe49('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe49('0x2'));var fs=require('fs');var Redis=require(_0xfe49('0x3'));var db=require(_0xfe49('0x4'))['db'];var utils=require(_0xfe49('0x5'));var logger=require(_0xfe49('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe49('0x7'));var client=jayson[_0xfe49('0x8')][_0xfe49('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf2de6f,_0x46a630,_0x580759){return new BPromise(function(_0x130e05,_0x74e88c){return client[_0xfe49('0xa')](_0xf2de6f,_0x580759)[_0xfe49('0xb')](function(_0xd64d15){logger[_0xfe49('0xc')](_0xfe49('0xd'),_0x46a630,_0xfe49('0xe'));logger[_0xfe49('0xf')](_0xfe49('0x10'),_0x46a630,_0xfe49('0xe'),JSON[_0xfe49('0x11')](_0xd64d15));if(_0xd64d15['error']){if(_0xd64d15[_0xfe49('0x12')][_0xfe49('0x13')]===0x1f4){logger[_0xfe49('0x12')](_0xfe49('0xd'),_0x46a630,_0xd64d15['error']['message']);return _0x74e88c(_0xd64d15[_0xfe49('0x12')][_0xfe49('0x14')]);}logger[_0xfe49('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x46a630,_0xd64d15[_0xfe49('0x12')][_0xfe49('0x14')]);return _0x130e05(_0xd64d15['error'][_0xfe49('0x14')]);}else{logger[_0xfe49('0xc')](_0xfe49('0xd'),_0x46a630,_0xfe49('0xe'));_0x130e05(_0xd64d15['result'][_0xfe49('0x14')]);}})['catch'](function(_0xa14332){logger[_0xfe49('0x12')](_0xfe49('0xd'),_0x46a630,_0xa14332);_0x74e88c(_0xa14332);});});} \ No newline at end of file +var _0x96ec=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3efe78,_0x49399b){var _0x58e5fe=function(_0x27cf1e){while(--_0x27cf1e){_0x3efe78['push'](_0x3efe78['shift']());}};_0x58e5fe(++_0x49399b);}(_0x96ec,0x12b));var _0xc96e=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0x96ec[_0x59b439];return _0x521ea3;};'use strict';var _=require(_0xc96e('0x0'));var util=require('util');var moment=require(_0xc96e('0x1'));var BPromise=require('bluebird');var rs=require(_0xc96e('0x2'));var fs=require('fs');var Redis=require(_0xc96e('0x3'));var db=require(_0xc96e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc96e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc96e('0x6'));var client=jayson[_0xc96e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fc4d8,_0x2d32ca,_0xb3dd54){return new BPromise(function(_0x13e81e,_0x1b36a3){return client[_0xc96e('0x8')](_0x4fc4d8,_0xb3dd54)['then'](function(_0x2b8430){logger[_0xc96e('0x9')](_0xc96e('0xa'),_0x2d32ca,_0xc96e('0xb'));logger[_0xc96e('0xc')](_0xc96e('0xd'),_0x2d32ca,_0xc96e('0xb'),JSON[_0xc96e('0xe')](_0x2b8430));if(_0x2b8430[_0xc96e('0xf')]){if(_0x2b8430[_0xc96e('0xf')][_0xc96e('0x10')]===0x1f4){logger[_0xc96e('0xf')](_0xc96e('0xa'),_0x2d32ca,_0x2b8430[_0xc96e('0xf')][_0xc96e('0x11')]);return _0x1b36a3(_0x2b8430[_0xc96e('0xf')][_0xc96e('0x11')]);}logger[_0xc96e('0xf')](_0xc96e('0xa'),_0x2d32ca,_0x2b8430['error'][_0xc96e('0x11')]);return _0x13e81e(_0x2b8430[_0xc96e('0xf')][_0xc96e('0x11')]);}else{logger[_0xc96e('0x9')](_0xc96e('0xa'),_0x2d32ca,_0xc96e('0xb'));_0x13e81e(_0x2b8430[_0xc96e('0x12')][_0xc96e('0x11')]);}})[_0xc96e('0x13')](function(_0x3ae6ed){logger[_0xc96e('0xf')](_0xc96e('0xa'),_0x2d32ca,_0x3ae6ed);_0x1b36a3(_0x3ae6ed);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 6d788c3..c52b002 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 _0x5c2c=['index','put','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated'];(function(_0x49caf2,_0x5dbbf5){var _0x3e5933=function(_0x1bbe77){while(--_0x1bbe77){_0x49caf2['push'](_0x49caf2['shift']());}};_0x3e5933(++_0x5dbbf5);}(_0x5c2c,0x114));var _0xc5c2=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0x5c2c[_0x4eec9b];return _0x2e3849;};'use strict';var multer=require(_0xc5c2('0x0'));var util=require(_0xc5c2('0x1'));var path=require(_0xc5c2('0x2'));var timeout=require('connect-timeout');var express=require(_0xc5c2('0x3'));var router=express[_0xc5c2('0x4')]();var fs_extra=require(_0xc5c2('0x5'));var auth=require(_0xc5c2('0x6'));var interaction=require(_0xc5c2('0x7'));var config=require(_0xc5c2('0x8'));var controller=require(_0xc5c2('0x9'));router[_0xc5c2('0xa')]('/',auth[_0xc5c2('0xb')](),controller[_0xc5c2('0xc')]);router['get']('/:id',auth[_0xc5c2('0xb')](),controller['show']);router['post']('/',auth[_0xc5c2('0xb')](),controller['create']);router[_0xc5c2('0xd')](_0xc5c2('0xe'),auth['isAuthenticated'](),controller[_0xc5c2('0xf')]);router[_0xc5c2('0x10')](_0xc5c2('0xe'),auth[_0xc5c2('0xb')](),controller[_0xc5c2('0x11')]);module['exports']=router; \ No newline at end of file +var _0x26a2=['show','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x302290,_0xe9c620){var _0x450d8e=function(_0xe0a144){while(--_0xe0a144){_0x302290['push'](_0x302290['shift']());}};_0x450d8e(++_0xe9c620);}(_0x26a2,0x91));var _0x226a=function(_0x38040e,_0x2c5db2){_0x38040e=_0x38040e-0x0;var _0x266775=_0x26a2[_0x38040e];return _0x266775;};'use strict';var multer=require('multer');var util=require(_0x226a('0x0'));var path=require(_0x226a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x226a('0x2')]();var fs_extra=require(_0x226a('0x3'));var auth=require(_0x226a('0x4'));var interaction=require(_0x226a('0x5'));var config=require(_0x226a('0x6'));var controller=require('./intServicenowField.controller');router[_0x226a('0x7')]('/',auth[_0x226a('0x8')](),controller[_0x226a('0x9')]);router[_0x226a('0x7')](_0x226a('0xa'),auth['isAuthenticated'](),controller[_0x226a('0xb')]);router['post']('/',auth[_0x226a('0x8')](),controller['create']);router['put'](_0x226a('0xa'),auth[_0x226a('0x8')](),controller['update']);router['delete']('/:id',auth[_0x226a('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index ffcb400..27c423e 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 _0x0a6b=['string','STRING','sequelize','variable','keyValue','picklist'];(function(_0x18a997,_0x5d5357){var _0x58cc4b=function(_0x49f8cc){while(--_0x49f8cc){_0x18a997['push'](_0x18a997['shift']());}};_0x58cc4b(++_0x5d5357);}(_0x0a6b,0x18e));var _0xb0a6=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0x0a6b[_0xa28b1a];return _0x4c9b78;};'use strict';var Sequelize=require(_0xb0a6('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xb0a6('0x1'),'customVariable',_0xb0a6('0x2'),_0xb0a6('0x3')),'defaultValue':_0xb0a6('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb0a6('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb0a6('0x4'),_0xb0a6('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0xb0a6('0x5')]},'idField':{'type':Sequelize[_0xb0a6('0x5')]},'nameField':{'type':Sequelize[_0xb0a6('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8f9d=['string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0x8f9d,0x93));var _0xd8f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8f9d[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xd8f9('0x0'));module['exports']={'type':{'type':Sequelize[_0xd8f9('0x1')]('string',_0xd8f9('0x2'),_0xd8f9('0x3'),_0xd8f9('0x4'),_0xd8f9('0x5')),'defaultValue':_0xd8f9('0x6')},'content':{'type':Sequelize[_0xd8f9('0x7')]},'key':{'type':Sequelize[_0xd8f9('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xd8f9('0x6'),_0xd8f9('0x2'),_0xd8f9('0x3'))},'keyContent':{'type':Sequelize[_0xd8f9('0x7')]},'idField':{'type':Sequelize[_0xd8f9('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd8f9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd8f9('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index cd353bf..5804b44 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 _0x3ceb=['catch','show','params','create','body','destroy','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','ServicenowField','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','options','includeAll','include','rows'];(function(_0xa0bac4,_0x248a16){var _0x1312ff=function(_0x3eb7a9){while(--_0x3eb7a9){_0xa0bac4['push'](_0xa0bac4['shift']());}};_0x1312ff(++_0x248a16);}(_0x3ceb,0xdf));var _0xb3ce=function(_0x2be63f,_0x184496){_0x2be63f=_0x2be63f-0x0;var _0x8b9219=_0x3ceb[_0x2be63f];return _0x8b9219;};'use strict';var emlformat=require(_0xb3ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3ce('0x1'));var jsonpatch=require(_0xb3ce('0x2'));var rp=require(_0xb3ce('0x3'));var moment=require(_0xb3ce('0x4'));var BPromise=require(_0xb3ce('0x5'));var Mustache=require('mustache');var util=require(_0xb3ce('0x6'));var path=require(_0xb3ce('0x7'));var sox=require(_0xb3ce('0x8'));var csv=require(_0xb3ce('0x9'));var ejs=require(_0xb3ce('0xa'));var fs=require('fs');var fs_extra=require(_0xb3ce('0xb'));var _=require(_0xb3ce('0xc'));var squel=require('squel');var crypto=require(_0xb3ce('0xd'));var jsforce=require(_0xb3ce('0xe'));var deskjs=require(_0xb3ce('0xf'));var toCsv=require(_0xb3ce('0x9'));var querystring=require('querystring');var Papa=require(_0xb3ce('0x10'));var Redis=require(_0xb3ce('0x11'));var authService=require(_0xb3ce('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3ce('0x13'));var logger=require(_0xb3ce('0x14'))(_0xb3ce('0x15'));var utils=require(_0xb3ce('0x16'));var config=require(_0xb3ce('0x17'));var licenseUtil=require(_0xb3ce('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fe84f,_0x3ca364){_0x3ca364=_0x3ca364||0xcc;return function(_0x87cf2d){if(_0x87cf2d){return _0x4fe84f[_0xb3ce('0x19')](_0x3ca364);}return _0x4fe84f[_0xb3ce('0x1a')](_0x3ca364)[_0xb3ce('0x1b')]();};}function respondWithResult(_0xe3fab7,_0x1b8485){_0x1b8485=_0x1b8485||0xc8;return function(_0x31c497){if(_0x31c497){return _0xe3fab7['status'](_0x1b8485)[_0xb3ce('0x1c')](_0x31c497);}};}function respondWithFilteredResult(_0x5b3850,_0x5cc5a1){return function(_0x1cfa6a){if(_0x1cfa6a){var _0x461010=_0x1cfa6a[_0xb3ce('0x1d')],_0xa1ccab=_0x5cc5a1[_0xb3ce('0x1e')],_0x453f75=_0x5cc5a1[_0xb3ce('0x1e')]+_0x5cc5a1[_0xb3ce('0x1f')],_0x3997fe;if(_0x453f75>=_0x461010){_0x453f75=_0x461010;_0x3997fe=0xc8;}else{_0x3997fe=0xce;}_0x5b3850['status'](_0x3997fe);return _0x5b3850[_0xb3ce('0x20')](_0xb3ce('0x21'),_0xa1ccab+'-'+_0x453f75+'/'+_0x461010)[_0xb3ce('0x1c')](_0x1cfa6a);}return null;};}function patchUpdates(_0x571604){return function(_0x4c7206){try{jsonpatch[_0xb3ce('0x22')](_0x4c7206,_0x571604,!![]);}catch(_0x561e0d){return BPromise[_0xb3ce('0x23')](_0x561e0d);}return _0x4c7206['save']();};}function saveUpdates(_0x4522b1,_0x9122b4){return function(_0x4b6685){if(_0x4b6685){return _0x4b6685[_0xb3ce('0x24')](_0x4522b1)[_0xb3ce('0x25')](function(_0x3d40bc){return _0x3d40bc;});}return null;};}function removeEntity(_0x3aea9e,_0x418dba){return function(_0x4a2daf){if(_0x4a2daf){return _0x4a2daf['destroy']()['then'](function(){_0x3aea9e[_0xb3ce('0x1a')](0xcc)[_0xb3ce('0x1b')]();});}};}function handleEntityNotFound(_0xb25176,_0x3830c6){return function(_0x35ed05){if(!_0x35ed05){_0xb25176[_0xb3ce('0x19')](0x194);}return _0x35ed05;};}function handleError(_0x3ccdae,_0xcfbbd5){_0xcfbbd5=_0xcfbbd5||0x1f4;return function(_0x1e87b8){logger[_0xb3ce('0x26')](_0x1e87b8[_0xb3ce('0x27')]);if(_0x1e87b8['name']){delete _0x1e87b8[_0xb3ce('0x28')];}_0x3ccdae[_0xb3ce('0x1a')](_0xcfbbd5)['send'](_0x1e87b8);};}exports[_0xb3ce('0x29')]=function(_0x2e11d6,_0x42b808){var _0x3f75b8={},_0x1f8df2={},_0x569241={'count':0x0,'rows':[]};var _0x6cbb45=_[_0xb3ce('0x2a')](db[_0xb3ce('0x2b')]['rawAttributes'],function(_0x49707a){return{'name':_0x49707a[_0xb3ce('0x2c')],'type':_0x49707a['type'][_0xb3ce('0x2d')]};});_0x1f8df2[_0xb3ce('0x2e')]=_['map'](_0x6cbb45,_0xb3ce('0x28'));_0x1f8df2[_0xb3ce('0x2f')]=_[_0xb3ce('0x30')](_0x2e11d6[_0xb3ce('0x2f')]);_0x1f8df2[_0xb3ce('0x31')]=_[_0xb3ce('0x32')](_0x1f8df2[_0xb3ce('0x2e')],_0x1f8df2['query']);_0x3f75b8[_0xb3ce('0x33')]=_[_0xb3ce('0x32')](_0x1f8df2['model'],qs[_0xb3ce('0x34')](_0x2e11d6[_0xb3ce('0x2f')]['fields']));_0x3f75b8[_0xb3ce('0x33')]=_0x3f75b8[_0xb3ce('0x33')]['length']?_0x3f75b8[_0xb3ce('0x33')]:_0x1f8df2[_0xb3ce('0x2e')];if(!_0x2e11d6['query'][_0xb3ce('0x35')](_0xb3ce('0x36'))){_0x3f75b8['limit']=qs[_0xb3ce('0x1f')](_0x2e11d6['query'][_0xb3ce('0x1f')]);_0x3f75b8['offset']=qs['offset'](_0x2e11d6[_0xb3ce('0x2f')][_0xb3ce('0x1e')]);}_0x3f75b8[_0xb3ce('0x37')]=qs['sort'](_0x2e11d6[_0xb3ce('0x2f')][_0xb3ce('0x38')]);_0x3f75b8['where']=qs['filters'](_['pick'](_0x2e11d6[_0xb3ce('0x2f')],_0x1f8df2[_0xb3ce('0x31')]),_0x6cbb45);if(_0x2e11d6[_0xb3ce('0x2f')][_0xb3ce('0x39')]){_0x3f75b8[_0xb3ce('0x3a')]=_[_0xb3ce('0x3b')](_0x3f75b8[_0xb3ce('0x3a')],{'$or':_[_0xb3ce('0x2a')](_0x6cbb45,function(_0x2e418d){if(_0x2e418d[_0xb3ce('0x3c')]!=='VIRTUAL'){var _0x54eac9={};_0x54eac9[_0x2e418d['name']]={'$like':'%'+_0x2e11d6[_0xb3ce('0x2f')]['filter']+'%'};return _0x54eac9;}})});}_0x3f75b8=_['merge']({},_0x3f75b8,_0x2e11d6[_0xb3ce('0x3d')]);var _0xb4e96c={'where':_0x3f75b8[_0xb3ce('0x3a')]};return db[_0xb3ce('0x2b')][_0xb3ce('0x1d')](_0xb4e96c)['then'](function(_0x1a7013){_0x569241[_0xb3ce('0x1d')]=_0x1a7013;if(_0x2e11d6[_0xb3ce('0x2f')][_0xb3ce('0x3e')]){_0x3f75b8[_0xb3ce('0x3f')]=[{'all':!![]}];}return db[_0xb3ce('0x2b')]['findAll'](_0x3f75b8);})[_0xb3ce('0x25')](function(_0x3d6de9){_0x569241[_0xb3ce('0x40')]=_0x3d6de9;return _0x569241;})[_0xb3ce('0x25')](respondWithFilteredResult(_0x42b808,_0x3f75b8))[_0xb3ce('0x41')](handleError(_0x42b808,null));};exports[_0xb3ce('0x42')]=function(_0x42cde6,_0x3186fd){var _0x3fcb78={'raw':!![],'where':{'id':_0x42cde6[_0xb3ce('0x43')]['id']}},_0x30dc7b={};_0x30dc7b[_0xb3ce('0x2e')]=_[_0xb3ce('0x30')](db[_0xb3ce('0x2b')]['rawAttributes']);_0x30dc7b[_0xb3ce('0x2f')]=_[_0xb3ce('0x30')](_0x42cde6[_0xb3ce('0x2f')]);_0x30dc7b[_0xb3ce('0x31')]=_[_0xb3ce('0x32')](_0x30dc7b['model'],_0x30dc7b[_0xb3ce('0x2f')]);_0x3fcb78[_0xb3ce('0x33')]=_[_0xb3ce('0x32')](_0x30dc7b[_0xb3ce('0x2e')],qs[_0xb3ce('0x34')](_0x42cde6['query'][_0xb3ce('0x34')]));_0x3fcb78[_0xb3ce('0x33')]=_0x3fcb78[_0xb3ce('0x33')]['length']?_0x3fcb78[_0xb3ce('0x33')]:_0x30dc7b['model'];if(_0x42cde6[_0xb3ce('0x2f')][_0xb3ce('0x3e')]){_0x3fcb78[_0xb3ce('0x3f')]=[{'all':!![]}];}_0x3fcb78=_[_0xb3ce('0x3b')]({},_0x3fcb78,_0x42cde6['options']);return db['ServicenowField']['find'](_0x3fcb78)[_0xb3ce('0x25')](handleEntityNotFound(_0x3186fd,null))[_0xb3ce('0x25')](respondWithResult(_0x3186fd,null))[_0xb3ce('0x41')](handleError(_0x3186fd,null));};exports[_0xb3ce('0x44')]=function(_0x12277,_0xffdfba){return db[_0xb3ce('0x2b')][_0xb3ce('0x44')](_0x12277[_0xb3ce('0x45')],{})[_0xb3ce('0x25')](respondWithResult(_0xffdfba,0xc9))[_0xb3ce('0x41')](handleError(_0xffdfba,null));};exports[_0xb3ce('0x24')]=function(_0x182b8b,_0x201ce3){if(_0x182b8b[_0xb3ce('0x45')]['id']){delete _0x182b8b['body']['id'];}return db[_0xb3ce('0x2b')]['find']({'where':{'id':_0x182b8b[_0xb3ce('0x43')]['id']}})['then'](handleEntityNotFound(_0x201ce3,null))[_0xb3ce('0x25')](saveUpdates(_0x182b8b[_0xb3ce('0x45')],null))[_0xb3ce('0x25')](respondWithResult(_0x201ce3,null))[_0xb3ce('0x41')](handleError(_0x201ce3,null));};exports[_0xb3ce('0x46')]=function(_0x49ce52,_0x88a5c4){return db['ServicenowField'][_0xb3ce('0x47')]({'where':{'id':_0x49ce52[_0xb3ce('0x43')]['id']}})[_0xb3ce('0x25')](handleEntityNotFound(_0x88a5c4,null))[_0xb3ce('0x25')](removeEntity(_0x88a5c4,null))[_0xb3ce('0x41')](handleError(_0x88a5c4,null));}; \ No newline at end of file +var _0x1f76=['../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','VIRTUAL','options','ServicenowField','includeAll','include','rows','catch','params','rawAttributes','length','find','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0xe0065c,_0x853b78){var _0xc816fe=function(_0x1a7144){while(--_0x1a7144){_0xe0065c['push'](_0xe0065c['shift']());}};_0xc816fe(++_0x853b78);}(_0x1f76,0xb8));var _0x61f7=function(_0x337c21,_0x220df7){_0x337c21=_0x337c21-0x0;var _0x56082a=_0x1f76[_0x337c21];return _0x56082a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x61f7('0x0'));var zipdir=require(_0x61f7('0x1'));var jsonpatch=require(_0x61f7('0x2'));var rp=require(_0x61f7('0x3'));var moment=require(_0x61f7('0x4'));var BPromise=require(_0x61f7('0x5'));var Mustache=require(_0x61f7('0x6'));var util=require('util');var path=require('path');var sox=require(_0x61f7('0x7'));var csv=require(_0x61f7('0x8'));var ejs=require(_0x61f7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61f7('0xa'));var squel=require(_0x61f7('0xb'));var crypto=require(_0x61f7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x61f7('0xd'));var toCsv=require(_0x61f7('0x8'));var querystring=require(_0x61f7('0xe'));var Papa=require(_0x61f7('0xf'));var Redis=require(_0x61f7('0x10'));var authService=require(_0x61f7('0x11'));var qs=require(_0x61f7('0x12'));var as=require(_0x61f7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61f7('0x14'))(_0x61f7('0x15'));var utils=require(_0x61f7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x61f7('0x17'));var db=require(_0x61f7('0x18'))['db'];function respondWithStatusCode(_0x13aa8e,_0x2914f4){_0x2914f4=_0x2914f4||0xcc;return function(_0x1d4c34){if(_0x1d4c34){return _0x13aa8e[_0x61f7('0x19')](_0x2914f4);}return _0x13aa8e[_0x61f7('0x1a')](_0x2914f4)[_0x61f7('0x1b')]();};}function respondWithResult(_0x4a14e3,_0x480de1){_0x480de1=_0x480de1||0xc8;return function(_0x26e028){if(_0x26e028){return _0x4a14e3[_0x61f7('0x1a')](_0x480de1)['json'](_0x26e028);}};}function respondWithFilteredResult(_0x4ab59b,_0x3a7a45){return function(_0x13d419){if(_0x13d419){var _0x1af427=_0x13d419[_0x61f7('0x1c')],_0x518399=_0x3a7a45[_0x61f7('0x1d')],_0x242156=_0x3a7a45['offset']+_0x3a7a45['limit'],_0x41d90d;if(_0x242156>=_0x1af427){_0x242156=_0x1af427;_0x41d90d=0xc8;}else{_0x41d90d=0xce;}_0x4ab59b[_0x61f7('0x1a')](_0x41d90d);return _0x4ab59b['set'](_0x61f7('0x1e'),_0x518399+'-'+_0x242156+'/'+_0x1af427)[_0x61f7('0x1f')](_0x13d419);}return null;};}function patchUpdates(_0x1b755f){return function(_0x58a1b4){try{jsonpatch[_0x61f7('0x20')](_0x58a1b4,_0x1b755f,!![]);}catch(_0x40753a){return BPromise[_0x61f7('0x21')](_0x40753a);}return _0x58a1b4[_0x61f7('0x22')]();};}function saveUpdates(_0x591ed4,_0x267eee){return function(_0x58614a){if(_0x58614a){return _0x58614a[_0x61f7('0x23')](_0x591ed4)['then'](function(_0x39529e){return _0x39529e;});}return null;};}function removeEntity(_0xaf852d,_0x3b3f88){return function(_0x5a0674){if(_0x5a0674){return _0x5a0674['destroy']()[_0x61f7('0x24')](function(){_0xaf852d[_0x61f7('0x1a')](0xcc)[_0x61f7('0x1b')]();});}};}function handleEntityNotFound(_0x1d914b,_0xd4b676){return function(_0x34c240){if(!_0x34c240){_0x1d914b[_0x61f7('0x19')](0x194);}return _0x34c240;};}function handleError(_0x570753,_0x561116){_0x561116=_0x561116||0x1f4;return function(_0x2eb545){logger[_0x61f7('0x25')](_0x2eb545[_0x61f7('0x26')]);if(_0x2eb545[_0x61f7('0x27')]){delete _0x2eb545[_0x61f7('0x27')];}_0x570753[_0x61f7('0x1a')](_0x561116)['send'](_0x2eb545);};}exports[_0x61f7('0x28')]=function(_0x2e046b,_0x5604d3){var _0x5e0196={},_0x58f9e9={},_0x3f03b2={'count':0x0,'rows':[]};var _0x1b1aa1=_['map'](db['ServicenowField']['rawAttributes'],function(_0x1b4cc4){return{'name':_0x1b4cc4['fieldName'],'type':_0x1b4cc4['type']['key']};});_0x58f9e9[_0x61f7('0x29')]=_['map'](_0x1b1aa1,_0x61f7('0x27'));_0x58f9e9[_0x61f7('0x2a')]=_[_0x61f7('0x2b')](_0x2e046b[_0x61f7('0x2a')]);_0x58f9e9[_0x61f7('0x2c')]=_[_0x61f7('0x2d')](_0x58f9e9[_0x61f7('0x29')],_0x58f9e9[_0x61f7('0x2a')]);_0x5e0196['attributes']=_['intersection'](_0x58f9e9[_0x61f7('0x29')],qs['fields'](_0x2e046b[_0x61f7('0x2a')][_0x61f7('0x2e')]));_0x5e0196[_0x61f7('0x2f')]=_0x5e0196[_0x61f7('0x2f')]['length']?_0x5e0196[_0x61f7('0x2f')]:_0x58f9e9[_0x61f7('0x29')];if(!_0x2e046b[_0x61f7('0x2a')][_0x61f7('0x30')](_0x61f7('0x31'))){_0x5e0196[_0x61f7('0x32')]=qs['limit'](_0x2e046b['query'][_0x61f7('0x32')]);_0x5e0196['offset']=qs['offset'](_0x2e046b['query'][_0x61f7('0x1d')]);}_0x5e0196['order']=qs[_0x61f7('0x33')](_0x2e046b[_0x61f7('0x2a')]['sort']);_0x5e0196[_0x61f7('0x34')]=qs[_0x61f7('0x2c')](_['pick'](_0x2e046b[_0x61f7('0x2a')],_0x58f9e9[_0x61f7('0x2c')]),_0x1b1aa1);if(_0x2e046b[_0x61f7('0x2a')][_0x61f7('0x35')]){_0x5e0196[_0x61f7('0x34')]=_[_0x61f7('0x36')](_0x5e0196[_0x61f7('0x34')],{'$or':_[_0x61f7('0x37')](_0x1b1aa1,function(_0x18b10e){if(_0x18b10e['type']!==_0x61f7('0x38')){var _0x35783e={};_0x35783e[_0x18b10e[_0x61f7('0x27')]]={'$like':'%'+_0x2e046b[_0x61f7('0x2a')]['filter']+'%'};return _0x35783e;}})});}_0x5e0196=_['merge']({},_0x5e0196,_0x2e046b[_0x61f7('0x39')]);var _0x57091a={'where':_0x5e0196[_0x61f7('0x34')]};return db[_0x61f7('0x3a')][_0x61f7('0x1c')](_0x57091a)['then'](function(_0x550a5d){_0x3f03b2[_0x61f7('0x1c')]=_0x550a5d;if(_0x2e046b[_0x61f7('0x2a')][_0x61f7('0x3b')]){_0x5e0196[_0x61f7('0x3c')]=[{'all':!![]}];}return db[_0x61f7('0x3a')]['findAll'](_0x5e0196);})['then'](function(_0x1f5d76){_0x3f03b2[_0x61f7('0x3d')]=_0x1f5d76;return _0x3f03b2;})[_0x61f7('0x24')](respondWithFilteredResult(_0x5604d3,_0x5e0196))[_0x61f7('0x3e')](handleError(_0x5604d3,null));};exports['show']=function(_0x344de1,_0x1e3115){var _0x276a99={'raw':!![],'where':{'id':_0x344de1[_0x61f7('0x3f')]['id']}},_0x3c1cb5={};_0x3c1cb5[_0x61f7('0x29')]=_[_0x61f7('0x2b')](db[_0x61f7('0x3a')][_0x61f7('0x40')]);_0x3c1cb5['query']=_['keys'](_0x344de1[_0x61f7('0x2a')]);_0x3c1cb5[_0x61f7('0x2c')]=_[_0x61f7('0x2d')](_0x3c1cb5[_0x61f7('0x29')],_0x3c1cb5[_0x61f7('0x2a')]);_0x276a99[_0x61f7('0x2f')]=_[_0x61f7('0x2d')](_0x3c1cb5[_0x61f7('0x29')],qs[_0x61f7('0x2e')](_0x344de1[_0x61f7('0x2a')]['fields']));_0x276a99[_0x61f7('0x2f')]=_0x276a99[_0x61f7('0x2f')][_0x61f7('0x41')]?_0x276a99[_0x61f7('0x2f')]:_0x3c1cb5[_0x61f7('0x29')];if(_0x344de1[_0x61f7('0x2a')][_0x61f7('0x3b')]){_0x276a99[_0x61f7('0x3c')]=[{'all':!![]}];}_0x276a99=_['merge']({},_0x276a99,_0x344de1[_0x61f7('0x39')]);return db[_0x61f7('0x3a')][_0x61f7('0x42')](_0x276a99)[_0x61f7('0x24')](handleEntityNotFound(_0x1e3115,null))[_0x61f7('0x24')](respondWithResult(_0x1e3115,null))[_0x61f7('0x3e')](handleError(_0x1e3115,null));};exports['create']=function(_0xf7dc2,_0xd9170b){return db[_0x61f7('0x3a')]['create'](_0xf7dc2[_0x61f7('0x43')],{})['then'](respondWithResult(_0xd9170b,0xc9))[_0x61f7('0x3e')](handleError(_0xd9170b,null));};exports[_0x61f7('0x23')]=function(_0x5e6ee4,_0x515222){if(_0x5e6ee4[_0x61f7('0x43')]['id']){delete _0x5e6ee4['body']['id'];}return db[_0x61f7('0x3a')]['find']({'where':{'id':_0x5e6ee4['params']['id']}})['then'](handleEntityNotFound(_0x515222,null))['then'](saveUpdates(_0x5e6ee4[_0x61f7('0x43')],null))[_0x61f7('0x24')](respondWithResult(_0x515222,null))[_0x61f7('0x3e')](handleError(_0x515222,null));};exports[_0x61f7('0x44')]=function(_0x5e5f8c,_0x154631){return db[_0x61f7('0x3a')][_0x61f7('0x42')]({'where':{'id':_0x5e5f8c['params']['id']}})[_0x61f7('0x24')](handleEntityNotFound(_0x154631,null))[_0x61f7('0x24')](removeEntity(_0x154631,null))[_0x61f7('0x3e')](handleError(_0x154631,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index ca3e6ec..e64eed8 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 _0xd9e5=['exports','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd9e5,0x14c));var _0x5d9e=function(_0x315d72,_0x15a582){_0x315d72=_0x315d72-0x0;var _0x4aa64e=_0xd9e5[_0x315d72];return _0x4aa64e;};'use strict';var _=require(_0x5d9e('0x0'));var util=require(_0x5d9e('0x1'));var logger=require(_0x5d9e('0x2'))(_0x5d9e('0x3'));var moment=require('moment');var BPromise=require(_0x5d9e('0x4'));var rp=require(_0x5d9e('0x5'));var fs=require('fs');var path=require(_0x5d9e('0x6'));var rimraf=require(_0x5d9e('0x7'));var config=require(_0x5d9e('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x5d9e('0x9')]=function(_0x4ceb09,_0x1134e8){return _0x4ceb09['define']('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x5d9e('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4839=['rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','path'];(function(_0x4f870e,_0x3ace09){var _0x5d27a6=function(_0x59d6e9){while(--_0x59d6e9){_0x4f870e['push'](_0x4f870e['shift']());}};_0x5d27a6(++_0x3ace09);}(_0x4839,0x108));var _0x9483=function(_0x4d798a,_0x422042){_0x4d798a=_0x4d798a-0x0;var _0x475310=_0x4839[_0x4d798a];return _0x475310;};'use strict';var _=require(_0x9483('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9483('0x1'));var moment=require(_0x9483('0x2'));var BPromise=require(_0x9483('0x3'));var rp=require(_0x9483('0x4'));var fs=require('fs');var path=require(_0x9483('0x5'));var rimraf=require(_0x9483('0x6'));var config=require(_0x9483('0x7'));var attributes=require(_0x9483('0x8'));module[_0x9483('0x9')]=function(_0x2be8c9,_0x18d0e4){return _0x2be8c9['define'](_0x9483('0xa'),attributes,{'tableName':_0x9483('0xb'),'paranoid':![],'indexes':[{'name':_0x9483('0xc'),'fields':[_0x9483('0xd'),_0x9483('0xe')],'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 38d5385..d08b509 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 _0x9694=['message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowField,\x20%s,\x20%s'];(function(_0x4e0f56,_0x1ad173){var _0x347ed6=function(_0x2a48f4){while(--_0x2a48f4){_0x4e0f56['push'](_0x4e0f56['shift']());}};_0x347ed6(++_0x1ad173);}(_0x9694,0x1a4));var _0x4969=function(_0x36328f,_0x47b04d){_0x36328f=_0x36328f-0x0;var _0x5543f5=_0x9694[_0x36328f];return _0x5543f5;};'use strict';var _=require(_0x4969('0x0'));var util=require('util');var moment=require(_0x4969('0x1'));var BPromise=require(_0x4969('0x2'));var rs=require(_0x4969('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4969('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4969('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4969('0x6'));var client=jayson[_0x4969('0x7')][_0x4969('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x324a28,_0x569654,_0x57ddb7){return new BPromise(function(_0x51b8ba,_0x135eff){return client[_0x4969('0x9')](_0x324a28,_0x57ddb7)[_0x4969('0xa')](function(_0x1424f5){logger['info']('ServicenowField,\x20%s,\x20%s',_0x569654,_0x4969('0xb'));logger[_0x4969('0xc')](_0x4969('0xd'),_0x569654,_0x4969('0xb'),JSON[_0x4969('0xe')](_0x1424f5));if(_0x1424f5[_0x4969('0xf')]){if(_0x1424f5[_0x4969('0xf')]['code']===0x1f4){logger[_0x4969('0xf')](_0x4969('0x10'),_0x569654,_0x1424f5[_0x4969('0xf')]['message']);return _0x135eff(_0x1424f5[_0x4969('0xf')][_0x4969('0x11')]);}logger[_0x4969('0xf')](_0x4969('0x10'),_0x569654,_0x1424f5['error']['message']);return _0x51b8ba(_0x1424f5[_0x4969('0xf')][_0x4969('0x11')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x569654,_0x4969('0xb'));_0x51b8ba(_0x1424f5['result'][_0x4969('0x11')]);}})[_0x4969('0x12')](function(_0x4bb1e7){logger[_0x4969('0xf')](_0x4969('0x10'),_0x569654,_0x4bb1e7);_0x135eff(_0x4bb1e7);});});} \ No newline at end of file +var _0x90dc=['../../config/environment','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x90dc,0x188));var _0xc90d=function(_0x376125,_0x1958ac){_0x376125=_0x376125-0x0;var _0x431d34=_0x90dc[_0x376125];return _0x431d34;};'use strict';var _=require('lodash');var util=require(_0xc90d('0x0'));var moment=require(_0xc90d('0x1'));var BPromise=require(_0xc90d('0x2'));var rs=require(_0xc90d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc90d('0x4'))['db'];var utils=require(_0xc90d('0x5'));var logger=require(_0xc90d('0x6'))('rpc');var config=require(_0xc90d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc90d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12980e,_0x63ee45,_0x1d1ffc){return new BPromise(function(_0x4ac066,_0x30f29c){return client[_0xc90d('0x9')](_0x12980e,_0x1d1ffc)[_0xc90d('0xa')](function(_0x453390){logger[_0xc90d('0xb')](_0xc90d('0xc'),_0x63ee45,_0xc90d('0xd'));logger['debug'](_0xc90d('0xe'),_0x63ee45,_0xc90d('0xd'),JSON['stringify'](_0x453390));if(_0x453390['error']){if(_0x453390[_0xc90d('0xf')]['code']===0x1f4){logger[_0xc90d('0xf')](_0xc90d('0xc'),_0x63ee45,_0x453390[_0xc90d('0xf')][_0xc90d('0x10')]);return _0x30f29c(_0x453390[_0xc90d('0xf')]['message']);}logger[_0xc90d('0xf')](_0xc90d('0xc'),_0x63ee45,_0x453390[_0xc90d('0xf')][_0xc90d('0x10')]);return _0x4ac066(_0x453390['error'][_0xc90d('0x10')]);}else{logger[_0xc90d('0xb')](_0xc90d('0xc'),_0x63ee45,_0xc90d('0xd'));_0x4ac066(_0x453390[_0xc90d('0x11')][_0xc90d('0x10')]);}})[_0xc90d('0x12')](function(_0xe4a634){logger[_0xc90d('0xf')]('ServicenowField,\x20%s,\x20%s',_0x63ee45,_0xe4a634);_0x30f29c(_0xe4a634);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index d2aa0ba..5635edb 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 _0xce6b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','path','express'];(function(_0xa2b098,_0x461a08){var _0x29502e=function(_0x43291a){while(--_0x43291a){_0xa2b098['push'](_0xa2b098['shift']());}};_0x29502e(++_0x461a08);}(_0xce6b,0x140));var _0xbce6=function(_0xe7c08c,_0x25298f){_0xe7c08c=_0xe7c08c-0x0;var _0x15db48=_0xce6b[_0xe7c08c];return _0x15db48;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbce6('0x0'));var timeout=require('connect-timeout');var express=require(_0xbce6('0x1'));var router=express[_0xbce6('0x2')]();var fs_extra=require(_0xbce6('0x3'));var auth=require(_0xbce6('0x4'));var interaction=require(_0xbce6('0x5'));var config=require('../../config/environment');var controller=require(_0xbce6('0x6'));router[_0xbce6('0x7')]('/',auth[_0xbce6('0x8')](),controller[_0xbce6('0x9')]);router[_0xbce6('0x7')](_0xbce6('0xa'),auth[_0xbce6('0x8')](),controller['show']);router[_0xbce6('0x7')](_0xbce6('0xb'),auth[_0xbce6('0x8')](),controller[_0xbce6('0xc')]);router[_0xbce6('0x7')](_0xbce6('0xd'),auth[_0xbce6('0x8')](),controller[_0xbce6('0xe')]);router[_0xbce6('0xf')]('/',auth['isAuthenticated'](),controller[_0xbce6('0x10')]);router[_0xbce6('0xf')](_0xbce6('0xb'),auth['isAuthenticated'](),controller[_0xbce6('0x11')]);router[_0xbce6('0x12')](_0xbce6('0xa'),auth[_0xbce6('0x8')](),controller[_0xbce6('0x13')]);router[_0xbce6('0x14')](_0xbce6('0xa'),auth[_0xbce6('0x8')](),controller[_0xbce6('0x15')]);module[_0xbce6('0x16')]=router; \ No newline at end of file +var _0xc62b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','index','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','addConfiguration','put','delete','destroy','exports','multer','util','path'];(function(_0x20c7d9,_0x2f688c){var _0x355dcd=function(_0x35c603){while(--_0x35c603){_0x20c7d9['push'](_0x20c7d9['shift']());}};_0x355dcd(++_0x2f688c);}(_0xc62b,0x13f));var _0xbc62=function(_0x180704,_0x450e33){_0x180704=_0x180704-0x0;var _0x49acad=_0xc62b[_0x180704];return _0x49acad;};'use strict';var multer=require(_0xbc62('0x0'));var util=require(_0xbc62('0x1'));var path=require(_0xbc62('0x2'));var timeout=require(_0xbc62('0x3'));var express=require('express');var router=express[_0xbc62('0x4')]();var fs_extra=require(_0xbc62('0x5'));var auth=require(_0xbc62('0x6'));var interaction=require(_0xbc62('0x7'));var config=require('../../config/environment');var controller=require(_0xbc62('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbc62('0x9')]);router[_0xbc62('0xa')](_0xbc62('0xb'),auth['isAuthenticated'](),controller[_0xbc62('0xc')]);router['get'](_0xbc62('0xd'),auth[_0xbc62('0xe')](),controller[_0xbc62('0xf')]);router[_0xbc62('0xa')](_0xbc62('0x10'),auth[_0xbc62('0xe')](),controller['getFields']);router[_0xbc62('0x11')]('/',auth[_0xbc62('0xe')](),controller['create']);router[_0xbc62('0x11')](_0xbc62('0xd'),auth[_0xbc62('0xe')](),controller[_0xbc62('0x12')]);router[_0xbc62('0x13')](_0xbc62('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xbc62('0x14')](_0xbc62('0xb'),auth[_0xbc62('0xe')](),controller[_0xbc62('0x15')]);module[_0xbc62('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index e4082e2..9cb634b 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 _0x6873=['exports','STRING','remoteUri','sequelize'];(function(_0x2fbd40,_0x287bc0){var _0x28d887=function(_0x56b734){while(--_0x56b734){_0x2fbd40['push'](_0x2fbd40['shift']());}};_0x28d887(++_0x287bc0);}(_0x6873,0x12f));var _0x3687=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0x6873[_0x42ebba];return _0x3fd2af;};'use strict';var Sequelize=require(_0x3687('0x0'));module[_0x3687('0x1')]={'name':{'type':Sequelize[_0x3687('0x2')]},'description':{'type':Sequelize[_0x3687('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x3687('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3687('0x3')},'serverUrl':{'type':Sequelize[_0x3687('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x48b0=['username','sequelize','exports','STRING'];(function(_0x158b98,_0x42454b){var _0x4d9542=function(_0x51e1ee){while(--_0x51e1ee){_0x158b98['push'](_0x158b98['shift']());}};_0x4d9542(++_0x42454b);}(_0x48b0,0x6d));var _0x048b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x48b0[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x048b('0x0'));module[_0x048b('0x1')]={'name':{'type':Sequelize[_0x048b('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x048b('0x2')],'unique':_0x048b('0x3')},'password':{'type':Sequelize[_0x048b('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x048b('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 67f8aa1..aec330b 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 _0x8048=['filter','options','count','includeAll','include','rows','show','params','catch','create','body','find','findOne','SugarcrmConfiguration','pick','hasOwnProperty','nolimit','AccountId','Subjects','getSubjects','channel','type','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','PLAIN','/service/v4_1/rest.php','get_module_fields','Calls','remove','includes','label','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','client','request','then','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','result','sendStatus','end','status','offset','limit','Content-Range','apply','reject','save','destroy','name','index','SugarcrmAccount','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL'];(function(_0x574dea,_0x4cf209){var _0x3ed444=function(_0x3423a2){while(--_0x3423a2){_0x574dea['push'](_0x574dea['shift']());}};_0x3ed444(++_0x4cf209);}(_0x8048,0xbc));var _0x8804=function(_0x560232,_0x3d3008){_0x560232=_0x560232-0x0;var _0x478ab6=_0x8048[_0x560232];return _0x478ab6;};'use strict';var emlformat=require(_0x8804('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8804('0x1'));var jsonpatch=require(_0x8804('0x2'));var rp=require(_0x8804('0x3'));var moment=require(_0x8804('0x4'));var BPromise=require(_0x8804('0x5'));var Mustache=require(_0x8804('0x6'));var util=require(_0x8804('0x7'));var path=require(_0x8804('0x8'));var sox=require('sox');var csv=require(_0x8804('0x9'));var ejs=require(_0x8804('0xa'));var fs=require('fs');var fs_extra=require(_0x8804('0xb'));var _=require(_0x8804('0xc'));var squel=require('squel');var crypto=require(_0x8804('0xd'));var jsforce=require(_0x8804('0xe'));var deskjs=require(_0x8804('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8804('0x10'));var Papa=require(_0x8804('0x11'));var Redis=require(_0x8804('0x12'));var authService=require(_0x8804('0x13'));var qs=require(_0x8804('0x14'));var as=require(_0x8804('0x15'));var hardwareService=require(_0x8804('0x16'));var logger=require(_0x8804('0x17'))(_0x8804('0x18'));var utils=require(_0x8804('0x19'));var config=require(_0x8804('0x1a'));var licenseUtil=require(_0x8804('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8804('0x1c'));var jayson=require('jayson/promise');var client=jayson[_0x8804('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19df56,_0x1f6131,_0x55df06,_0x20810f){return new BPromise(function(_0x34fd90,_0x167e34){var _0x59dbc1=_0x20810f||client;return _0x59dbc1[_0x8804('0x1e')](_0x19df56,_0x55df06)[_0x8804('0x1f')](function(_0x4d4aed){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x1f6131,_0x8804('0x20'));logger[_0x8804('0x21')](_0x8804('0x22'),_0x1f6131,_0x8804('0x20'),JSON[_0x8804('0x23')](_0x4d4aed));if(_0x4d4aed[_0x8804('0x24')]){if(_0x4d4aed[_0x8804('0x24')][_0x8804('0x25')]===0x1f4){logger[_0x8804('0x24')](_0x8804('0x26'),_0x1f6131,_0x4d4aed[_0x8804('0x24')]['message']);return _0x167e34(_0x4d4aed[_0x8804('0x24')][_0x8804('0x27')]);}logger['error'](_0x8804('0x26'),_0x1f6131,_0x4d4aed['error'][_0x8804('0x27')]);return _0x34fd90(_0x4d4aed[_0x8804('0x24')][_0x8804('0x27')]);}else{logger[_0x8804('0x28')](_0x8804('0x26'),_0x1f6131,_0x8804('0x20'));_0x34fd90(_0x4d4aed[_0x8804('0x29')][_0x8804('0x27')]);}})['catch'](function(_0x50bf13){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1f6131,_0x50bf13);_0x167e34(_0x50bf13);});});}function respondWithStatusCode(_0x34aca5,_0x188792){_0x188792=_0x188792||0xcc;return function(_0x1b7a6b){if(_0x1b7a6b){return _0x34aca5[_0x8804('0x2a')](_0x188792);}return _0x34aca5['status'](_0x188792)[_0x8804('0x2b')]();};}function respondWithResult(_0x4f9471,_0x3d4811){_0x3d4811=_0x3d4811||0xc8;return function(_0x244091){if(_0x244091){return _0x4f9471[_0x8804('0x2c')](_0x3d4811)['json'](_0x244091);}};}function respondWithFilteredResult(_0x12c46e,_0x289b67){return function(_0x650867){if(_0x650867){var _0x1f25d0=_0x650867['count'],_0x344dac=_0x289b67[_0x8804('0x2d')],_0x25dad6=_0x289b67[_0x8804('0x2d')]+_0x289b67[_0x8804('0x2e')],_0x3510a1;if(_0x25dad6>=_0x1f25d0){_0x25dad6=_0x1f25d0;_0x3510a1=0xc8;}else{_0x3510a1=0xce;}_0x12c46e[_0x8804('0x2c')](_0x3510a1);return _0x12c46e['set'](_0x8804('0x2f'),_0x344dac+'-'+_0x25dad6+'/'+_0x1f25d0)['json'](_0x650867);}return null;};}function patchUpdates(_0x1aaa26){return function(_0x20dd20){try{jsonpatch[_0x8804('0x30')](_0x20dd20,_0x1aaa26,!![]);}catch(_0x1a041d){return BPromise[_0x8804('0x31')](_0x1a041d);}return _0x20dd20[_0x8804('0x32')]();};}function saveUpdates(_0x305af2,_0x17048c){return function(_0x36838a){if(_0x36838a){return _0x36838a['update'](_0x305af2)[_0x8804('0x1f')](function(_0x5bbcfb){return _0x5bbcfb;});}return null;};}function removeEntity(_0x530050,_0x5a9d9b){return function(_0x1d522c){if(_0x1d522c){return _0x1d522c[_0x8804('0x33')]()['then'](function(){_0x530050[_0x8804('0x2c')](0xcc)[_0x8804('0x2b')]();});}};}function handleEntityNotFound(_0x179166,_0x4318cd){return function(_0x1b10d5){if(!_0x1b10d5){_0x179166[_0x8804('0x2a')](0x194);}return _0x1b10d5;};}function handleError(_0x4cfa8b,_0x52be45){_0x52be45=_0x52be45||0x1f4;return function(_0x59c392){logger[_0x8804('0x24')](_0x59c392['stack']);if(_0x59c392[_0x8804('0x34')]){delete _0x59c392['name'];}_0x4cfa8b[_0x8804('0x2c')](_0x52be45)['send'](_0x59c392);};}exports[_0x8804('0x35')]=function(_0x1ae22d,_0x5c1d5e){var _0x613965={},_0x21bad0={},_0x430499={'count':0x0,'rows':[]};var _0x22a3fa=_['map'](db[_0x8804('0x36')][_0x8804('0x37')],function(_0x1468bd){return{'name':_0x1468bd['fieldName'],'type':_0x1468bd['type']['key']};});_0x21bad0[_0x8804('0x38')]=_[_0x8804('0x39')](_0x22a3fa,_0x8804('0x34'));_0x21bad0[_0x8804('0x3a')]=_[_0x8804('0x3b')](_0x1ae22d['query']);_0x21bad0[_0x8804('0x3c')]=_[_0x8804('0x3d')](_0x21bad0[_0x8804('0x38')],_0x21bad0[_0x8804('0x3a')]);_0x613965[_0x8804('0x3e')]=_[_0x8804('0x3d')](_0x21bad0[_0x8804('0x38')],qs[_0x8804('0x3f')](_0x1ae22d['query'][_0x8804('0x3f')]));_0x613965['attributes']=_0x613965[_0x8804('0x3e')][_0x8804('0x40')]?_0x613965['attributes']:_0x21bad0[_0x8804('0x38')];if(!_0x1ae22d[_0x8804('0x3a')]['hasOwnProperty']('nolimit')){_0x613965[_0x8804('0x2e')]=qs[_0x8804('0x2e')](_0x1ae22d['query'][_0x8804('0x2e')]);_0x613965['offset']=qs['offset'](_0x1ae22d[_0x8804('0x3a')][_0x8804('0x2d')]);}_0x613965[_0x8804('0x41')]=qs[_0x8804('0x42')](_0x1ae22d['query'][_0x8804('0x42')]);_0x613965[_0x8804('0x43')]=qs[_0x8804('0x3c')](_['pick'](_0x1ae22d[_0x8804('0x3a')],_0x21bad0['filters']),_0x22a3fa);if(_0x1ae22d['query']['filter']){_0x613965[_0x8804('0x43')]=_[_0x8804('0x44')](_0x613965[_0x8804('0x43')],{'$or':_['map'](_0x22a3fa,function(_0x43fa53){if(_0x43fa53['type']!==_0x8804('0x45')){var _0x34dd2a={};_0x34dd2a[_0x43fa53[_0x8804('0x34')]]={'$like':'%'+_0x1ae22d[_0x8804('0x3a')][_0x8804('0x46')]+'%'};return _0x34dd2a;}})});}_0x613965=_[_0x8804('0x44')]({},_0x613965,_0x1ae22d[_0x8804('0x47')]);var _0xaf48ad={'where':_0x613965[_0x8804('0x43')]};return db[_0x8804('0x36')][_0x8804('0x48')](_0xaf48ad)['then'](function(_0x3fe3a7){_0x430499[_0x8804('0x48')]=_0x3fe3a7;if(_0x1ae22d[_0x8804('0x3a')][_0x8804('0x49')]){_0x613965[_0x8804('0x4a')]=[{'all':!![]}];}return db[_0x8804('0x36')]['findAll'](_0x613965);})[_0x8804('0x1f')](function(_0x34ee3f){_0x430499[_0x8804('0x4b')]=_0x34ee3f;return _0x430499;})['then'](respondWithFilteredResult(_0x5c1d5e,_0x613965))['catch'](handleError(_0x5c1d5e,null));};exports[_0x8804('0x4c')]=function(_0x190d5a,_0x1f253b){var _0x56bcf2={'raw':![],'where':{'id':_0x190d5a[_0x8804('0x4d')]['id']}},_0x582208={};_0x582208[_0x8804('0x38')]=_[_0x8804('0x3b')](db[_0x8804('0x36')][_0x8804('0x37')]);_0x582208[_0x8804('0x3a')]=_['keys'](_0x190d5a[_0x8804('0x3a')]);_0x582208[_0x8804('0x3c')]=_['intersection'](_0x582208[_0x8804('0x38')],_0x582208[_0x8804('0x3a')]);_0x56bcf2[_0x8804('0x3e')]=_[_0x8804('0x3d')](_0x582208[_0x8804('0x38')],qs[_0x8804('0x3f')](_0x190d5a[_0x8804('0x3a')][_0x8804('0x3f')]));_0x56bcf2[_0x8804('0x3e')]=_0x56bcf2['attributes'][_0x8804('0x40')]?_0x56bcf2[_0x8804('0x3e')]:_0x582208[_0x8804('0x38')];if(_0x190d5a[_0x8804('0x3a')][_0x8804('0x49')]){_0x56bcf2[_0x8804('0x4a')]=[{'all':!![]}];}_0x56bcf2=_[_0x8804('0x44')]({},_0x56bcf2,_0x190d5a['options']);return db['SugarcrmAccount']['find'](_0x56bcf2)[_0x8804('0x1f')](handleEntityNotFound(_0x1f253b,null))[_0x8804('0x1f')](respondWithResult(_0x1f253b,null))[_0x8804('0x4e')](handleError(_0x1f253b,null));};exports['create']=function(_0x14209e,_0x50a557){return db[_0x8804('0x36')][_0x8804('0x4f')](_0x14209e[_0x8804('0x50')],{})['then'](respondWithResult(_0x50a557,0xc9))[_0x8804('0x4e')](handleError(_0x50a557,null));};exports['update']=function(_0x3435b5,_0x1ce112){if(_0x3435b5[_0x8804('0x50')]['id']){delete _0x3435b5['body']['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x3435b5[_0x8804('0x4d')]['id']}})[_0x8804('0x1f')](handleEntityNotFound(_0x1ce112,null))['then'](saveUpdates(_0x3435b5['body'],null))[_0x8804('0x1f')](respondWithResult(_0x1ce112,null))[_0x8804('0x4e')](handleError(_0x1ce112,null));};exports['destroy']=function(_0x2198a6,_0x3fe29c){return db[_0x8804('0x36')][_0x8804('0x51')]({'where':{'id':_0x2198a6[_0x8804('0x4d')]['id']}})[_0x8804('0x1f')](handleEntityNotFound(_0x3fe29c,null))[_0x8804('0x1f')](removeEntity(_0x3fe29c,null))[_0x8804('0x4e')](handleError(_0x3fe29c,null));};exports['getConfigurations']=function(_0x5653e4,_0x5c01a3,_0x59f9f4){var _0x59527b={};var _0xf2e25a={};var _0x396e9e;var _0x505458;return db[_0x8804('0x36')][_0x8804('0x52')]({'where':{'id':_0x5653e4[_0x8804('0x4d')]['id']}})[_0x8804('0x1f')](handleEntityNotFound(_0x5c01a3,null))[_0x8804('0x1f')](function(_0x581887){if(_0x581887){_0x396e9e=_0x581887;_0xf2e25a[_0x8804('0x38')]=_[_0x8804('0x3b')](db[_0x8804('0x53')][_0x8804('0x37')]);_0xf2e25a['query']=_[_0x8804('0x3b')](_0x5653e4[_0x8804('0x3a')]);_0xf2e25a[_0x8804('0x3c')]=_[_0x8804('0x3d')](_0xf2e25a[_0x8804('0x38')],_0xf2e25a[_0x8804('0x3a')]);_0x59527b[_0x8804('0x3e')]=_[_0x8804('0x3d')](_0xf2e25a['model'],qs['fields'](_0x5653e4[_0x8804('0x3a')][_0x8804('0x3f')]));_0x59527b[_0x8804('0x3e')]=_0x59527b[_0x8804('0x3e')][_0x8804('0x40')]?_0x59527b[_0x8804('0x3e')]:_0xf2e25a['model'];_0x59527b[_0x8804('0x41')]=qs[_0x8804('0x42')](_0x5653e4['query']['sort']);_0x59527b['where']=qs[_0x8804('0x3c')](_[_0x8804('0x54')](_0x5653e4[_0x8804('0x3a')],_0xf2e25a[_0x8804('0x3c')]));if(_0x5653e4[_0x8804('0x3a')][_0x8804('0x46')]){_0x59527b[_0x8804('0x43')]=_[_0x8804('0x44')](_0x59527b[_0x8804('0x43')],{'$or':_[_0x8804('0x39')](_0x59527b[_0x8804('0x3e')],function(_0x18919c){var _0x2d1000={};_0x2d1000[_0x18919c]={'$like':'%'+_0x5653e4[_0x8804('0x3a')][_0x8804('0x46')]+'%'};return _0x2d1000;})});}_0x59527b=_['merge']({},_0x59527b,_0x5653e4[_0x8804('0x47')]);return _0x396e9e['getConfigurations'](_0x59527b);}})[_0x8804('0x1f')](function(_0x3511ac){if(_0x3511ac){_0x505458=_0x3511ac[_0x8804('0x40')];if(!_0x5653e4['query'][_0x8804('0x55')](_0x8804('0x56'))){_0x59527b[_0x8804('0x2e')]=qs[_0x8804('0x2e')](_0x5653e4[_0x8804('0x3a')][_0x8804('0x2e')]);_0x59527b[_0x8804('0x2d')]=qs[_0x8804('0x2d')](_0x5653e4[_0x8804('0x3a')][_0x8804('0x2d')]);}return _0x396e9e['getConfigurations'](_0x59527b);}})[_0x8804('0x1f')](function(_0x325b2e){if(_0x325b2e){return _0x325b2e?{'count':_0x505458,'rows':_0x325b2e}:null;}})[_0x8804('0x1f')](respondWithResult(_0x5c01a3,null))[_0x8804('0x4e')](handleError(_0x5c01a3,null));};exports['addConfiguration']=function(_0x351b5d,_0x4ebd07,_0x496187){if(_0x351b5d[_0x8804('0x50')]['id']){delete _0x351b5d['body']['id'];}return db[_0x8804('0x36')][_0x8804('0x52')]({'where':{'id':_0x351b5d[_0x8804('0x4d')]['id']}})[_0x8804('0x1f')](handleEntityNotFound(_0x4ebd07,null))['then'](function(_0x1f4513){if(_0x1f4513){_0x351b5d[_0x8804('0x50')][_0x8804('0x57')]=_0x1f4513['id'];_0x351b5d[_0x8804('0x50')][_0x8804('0x58')]=integrations[_0x8804('0x59')](_0x351b5d[_0x8804('0x50')][_0x8804('0x5a')],_0x351b5d[_0x8804('0x50')][_0x8804('0x5b')]);_0x351b5d['body']['Descriptions']=integrations['getDescriptions'](_0x351b5d[_0x8804('0x50')][_0x8804('0x5a')],_0x351b5d[_0x8804('0x50')][_0x8804('0x5b')]);return db[_0x8804('0x53')][_0x8804('0x4f')](_0x351b5d[_0x8804('0x50')],{'include':[{'model':db[_0x8804('0x5c')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x8804('0x5d')}]});}return null;})['then'](respondWithResult(_0x4ebd07,null))[_0x8804('0x4e')](handleError(_0x4ebd07,null));};exports[_0x8804('0x5e')]=function(_0x2927c8,_0x748075,_0xb82245){var _0xb74a19='';var _0x2ef9e8=['id',_0x8804('0x34'),_0x8804('0x5f'),_0x8804('0x60'),_0x8804('0x61'),_0x8804('0x62'),'duration_hours',_0x8804('0x63'),_0x8804('0x64'),'parent_type',_0x8804('0x65'),_0x8804('0x66')];return db['SugarcrmAccount'][_0x8804('0x52')]({'where':{'id':_0x2927c8[_0x8804('0x4d')]['id']},'attributes':['id',_0x8804('0x67'),_0x8804('0x68'),'remoteUri']})[_0x8804('0x1f')](handleEntityNotFound(_0x748075,null))['then'](function(_0x436ead){if(_0x436ead){_0xb74a19=_0x436ead[_0x8804('0x69')];var _0x586653=_0xb74a19[_0x8804('0x6a')](-0x1);if(_0x586653==='/'){_0xb74a19=_0xb74a19[_0x8804('0x6b')](0x0,_0xb74a19[_0x8804('0x6c')](_0x586653));}return rp({'method':_0x8804('0x6d'),'uri':util[_0x8804('0x6e')](_0x8804('0x6f'),_0xb74a19,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x8804('0x70'),'input_type':_0x8804('0x71'),'response_type':_0x8804('0x71'),'rest_data':JSON[_0x8804('0x23')]({'user_auth':{'user_name':_0x436ead[_0x8804('0x67')],'password':_0x436ead[_0x8804('0x68')],'encryption':_0x8804('0x72')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x658e2a){if(_0x658e2a&&_0x658e2a['name']!=='Invalid\x20Login'&&_0x658e2a[_0x8804('0x34')]!=='Password\x20Expired'){return rp({'method':_0x8804('0x6d'),'uri':util['format']('%s%s',_0xb74a19,_0x8804('0x73')),'json':!![],'form':{'method':_0x8804('0x74'),'input_type':_0x8804('0x71'),'response_type':_0x8804('0x71'),'rest_data':JSON[_0x8804('0x23')]({'session':_0x658e2a['id'],'module_name':_0x8804('0x75')})}})['then'](function(_0x6e7358){if(_0x6e7358){var _0x2de039=_['values'](_0x6e7358['module_fields']);_[_0x8804('0x76')](_0x2de039,function(_0xe40730){return _0x2ef9e8[_0x8804('0x77')](_0xe40730[_0x8804('0x34')]);});return{'count':_0x2de039['length'],'rows':_['map'](_0x2de039,function(_0x4cc452){return{'id':_0x4cc452[_0x8804('0x34')],'name':_0x4cc452[_0x8804('0x78')],'custom':_[_0x8804('0x79')](_0x4cc452[_0x8804('0x34')],'_c')?!![]:![],'options':_0x4cc452[_0x8804('0x47')]?_[_0x8804('0x39')](_[_0x8804('0x7a')](_0x4cc452[_0x8804('0x47')]),function(_0x40c714){return{'name':_0x40c714[_0x8804('0x7b')],'value':_0x40c714[_0x8804('0x34')]};}):[]};})};}})[_0x8804('0x1f')](respondWithResult(_0x748075,null))['catch'](function(_0xc4a4b4){var _0x45ce6c=_0x2927c8[_0x8804('0x3a')][_0x8804('0x7c')]?0x1f4:_0xc4a4b4[_0x8804('0x7d')]||0x1f4;logger[_0x8804('0x24')](_0x8804('0x7e'),_0x8804('0x5e'),_0x45ce6c,JSON[_0x8804('0x23')](_0xc4a4b4));delete _0xc4a4b4[_0x8804('0x34')];if(_0x45ce6c===0x191){_0x45ce6c=0x190;}_0x748075[_0x8804('0x2c')](_0x45ce6c)[_0x8804('0x7f')](_0x2927c8[_0x8804('0x3a')][_0x8804('0x7c')]?{'message':_0x8804('0x80'),'statusCode':_0xc4a4b4[_0x8804('0x7d')]}:_0xc4a4b4);});}else{var _0xc2fc2b=0x1f4;_0x748075[_0x8804('0x2c')](_0xc2fc2b)[_0x8804('0x7f')]({'message':_0x8804('0x80'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xa91b=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','SugarcrmAccount','includeAll','findAll','rows','show','params','include','options','find','create','body','update','getConfigurations','findOne','SugarcrmConfiguration','rawAttributes','order','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_name','password','remoteUri','slice','lastIndexOf','POST','format','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','%s%s','/service/v4_1/rest.php','get_module_fields','Calls','values','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x153da6,_0xc9bfde){var _0xf01a0d=function(_0x409ed5){while(--_0x409ed5){_0x153da6['push'](_0x153da6['shift']());}};_0xf01a0d(++_0xc9bfde);}(_0xa91b,0xfc));var _0xba91=function(_0x1fac38,_0x370031){_0x1fac38=_0x1fac38-0x0;var _0x24884a=_0xa91b[_0x1fac38];return _0x24884a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba91('0x0'));var zipdir=require(_0xba91('0x1'));var jsonpatch=require(_0xba91('0x2'));var rp=require(_0xba91('0x3'));var moment=require('moment');var BPromise=require(_0xba91('0x4'));var Mustache=require(_0xba91('0x5'));var util=require(_0xba91('0x6'));var path=require(_0xba91('0x7'));var sox=require(_0xba91('0x8'));var csv=require(_0xba91('0x9'));var ejs=require(_0xba91('0xa'));var fs=require('fs');var fs_extra=require(_0xba91('0xb'));var _=require(_0xba91('0xc'));var squel=require(_0xba91('0xd'));var crypto=require(_0xba91('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba91('0x9'));var querystring=require(_0xba91('0xf'));var Papa=require(_0xba91('0x10'));var Redis=require(_0xba91('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xba91('0x12'));var as=require(_0xba91('0x13'));var hardwareService=require(_0xba91('0x14'));var logger=require(_0xba91('0x15'))(_0xba91('0x16'));var utils=require('../../config/utils');var config=require(_0xba91('0x17'));var licenseUtil=require(_0xba91('0x18'));var db=require(_0xba91('0x19'))['db'];var integrations=require(_0xba91('0x1a'));var jayson=require(_0xba91('0x1b'));var client=jayson[_0xba91('0x1c')][_0xba91('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x28d859,_0x344456,_0x3f4166,_0x431bb0){return new BPromise(function(_0x3d3465,_0x5afc2c){var _0x581c54=_0x431bb0||client;return _0x581c54[_0xba91('0x1e')](_0x28d859,_0x3f4166)['then'](function(_0x5acffc){logger['info'](_0xba91('0x1f'),_0x344456,_0xba91('0x20'));logger[_0xba91('0x21')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x344456,_0xba91('0x20'),JSON[_0xba91('0x22')](_0x5acffc));if(_0x5acffc[_0xba91('0x23')]){if(_0x5acffc['error']['code']===0x1f4){logger[_0xba91('0x23')](_0xba91('0x1f'),_0x344456,_0x5acffc[_0xba91('0x23')][_0xba91('0x24')]);return _0x5afc2c(_0x5acffc[_0xba91('0x23')]['message']);}logger[_0xba91('0x23')]('SugarcrmAccount,\x20%s,\x20%s',_0x344456,_0x5acffc[_0xba91('0x23')][_0xba91('0x24')]);return _0x3d3465(_0x5acffc[_0xba91('0x23')][_0xba91('0x24')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x344456,_0xba91('0x20'));_0x3d3465(_0x5acffc[_0xba91('0x25')][_0xba91('0x24')]);}})[_0xba91('0x26')](function(_0x4d4514){logger[_0xba91('0x23')](_0xba91('0x1f'),_0x344456,_0x4d4514);_0x5afc2c(_0x4d4514);});});}function respondWithStatusCode(_0x25424a,_0x308496){_0x308496=_0x308496||0xcc;return function(_0x5ebe4e){if(_0x5ebe4e){return _0x25424a[_0xba91('0x27')](_0x308496);}return _0x25424a[_0xba91('0x28')](_0x308496)[_0xba91('0x29')]();};}function respondWithResult(_0x258122,_0x4c2292){_0x4c2292=_0x4c2292||0xc8;return function(_0x1b9c13){if(_0x1b9c13){return _0x258122['status'](_0x4c2292)['json'](_0x1b9c13);}};}function respondWithFilteredResult(_0x1d036e,_0x296120){return function(_0x39c0d7){if(_0x39c0d7){var _0x587a58=_0x39c0d7[_0xba91('0x2a')],_0x3dc230=_0x296120['offset'],_0x1ce2a5=_0x296120[_0xba91('0x2b')]+_0x296120[_0xba91('0x2c')],_0x1deb2c;if(_0x1ce2a5>=_0x587a58){_0x1ce2a5=_0x587a58;_0x1deb2c=0xc8;}else{_0x1deb2c=0xce;}_0x1d036e[_0xba91('0x28')](_0x1deb2c);return _0x1d036e[_0xba91('0x2d')](_0xba91('0x2e'),_0x3dc230+'-'+_0x1ce2a5+'/'+_0x587a58)[_0xba91('0x2f')](_0x39c0d7);}return null;};}function patchUpdates(_0x45fc8a){return function(_0x20ea81){try{jsonpatch[_0xba91('0x30')](_0x20ea81,_0x45fc8a,!![]);}catch(_0x53cbe6){return BPromise[_0xba91('0x31')](_0x53cbe6);}return _0x20ea81[_0xba91('0x32')]();};}function saveUpdates(_0x15b417,_0x1bb0a5){return function(_0x7e3c56){if(_0x7e3c56){return _0x7e3c56['update'](_0x15b417)[_0xba91('0x33')](function(_0x586fc5){return _0x586fc5;});}return null;};}function removeEntity(_0x1372fb,_0x37517b){return function(_0x5b05a4){if(_0x5b05a4){return _0x5b05a4[_0xba91('0x34')]()[_0xba91('0x33')](function(){_0x1372fb[_0xba91('0x28')](0xcc)[_0xba91('0x29')]();});}};}function handleEntityNotFound(_0x40225c,_0x53309b){return function(_0x1d494d){if(!_0x1d494d){_0x40225c['sendStatus'](0x194);}return _0x1d494d;};}function handleError(_0xe8b0a1,_0x29dbe2){_0x29dbe2=_0x29dbe2||0x1f4;return function(_0x4ff871){logger[_0xba91('0x23')](_0x4ff871[_0xba91('0x35')]);if(_0x4ff871['name']){delete _0x4ff871[_0xba91('0x36')];}_0xe8b0a1[_0xba91('0x28')](_0x29dbe2)[_0xba91('0x37')](_0x4ff871);};}exports[_0xba91('0x38')]=function(_0x53b3ff,_0x2b2a64){var _0x21e358={},_0x2349b2={},_0x2a826e={'count':0x0,'rows':[]};var _0x3c5d3a=_[_0xba91('0x39')](db['SugarcrmAccount']['rawAttributes'],function(_0x167f0a){return{'name':_0x167f0a[_0xba91('0x3a')],'type':_0x167f0a[_0xba91('0x3b')][_0xba91('0x3c')]};});_0x2349b2[_0xba91('0x3d')]=_[_0xba91('0x39')](_0x3c5d3a,_0xba91('0x36'));_0x2349b2[_0xba91('0x3e')]=_[_0xba91('0x3f')](_0x53b3ff[_0xba91('0x3e')]);_0x2349b2[_0xba91('0x40')]=_[_0xba91('0x41')](_0x2349b2[_0xba91('0x3d')],_0x2349b2[_0xba91('0x3e')]);_0x21e358['attributes']=_[_0xba91('0x41')](_0x2349b2[_0xba91('0x3d')],qs['fields'](_0x53b3ff[_0xba91('0x3e')][_0xba91('0x42')]));_0x21e358[_0xba91('0x43')]=_0x21e358['attributes'][_0xba91('0x44')]?_0x21e358[_0xba91('0x43')]:_0x2349b2[_0xba91('0x3d')];if(!_0x53b3ff[_0xba91('0x3e')][_0xba91('0x45')]('nolimit')){_0x21e358['limit']=qs[_0xba91('0x2c')](_0x53b3ff[_0xba91('0x3e')][_0xba91('0x2c')]);_0x21e358[_0xba91('0x2b')]=qs['offset'](_0x53b3ff[_0xba91('0x3e')]['offset']);}_0x21e358['order']=qs[_0xba91('0x46')](_0x53b3ff[_0xba91('0x3e')][_0xba91('0x46')]);_0x21e358[_0xba91('0x47')]=qs['filters'](_['pick'](_0x53b3ff[_0xba91('0x3e')],_0x2349b2[_0xba91('0x40')]),_0x3c5d3a);if(_0x53b3ff[_0xba91('0x3e')][_0xba91('0x48')]){_0x21e358[_0xba91('0x47')]=_['merge'](_0x21e358[_0xba91('0x47')],{'$or':_[_0xba91('0x39')](_0x3c5d3a,function(_0x321db7){if(_0x321db7[_0xba91('0x3b')]!=='VIRTUAL'){var _0x27ef75={};_0x27ef75[_0x321db7[_0xba91('0x36')]]={'$like':'%'+_0x53b3ff[_0xba91('0x3e')][_0xba91('0x48')]+'%'};return _0x27ef75;}})});}_0x21e358=_[_0xba91('0x49')]({},_0x21e358,_0x53b3ff['options']);var _0x62fffd={'where':_0x21e358[_0xba91('0x47')]};return db[_0xba91('0x4a')]['count'](_0x62fffd)[_0xba91('0x33')](function(_0xc3cd6a){_0x2a826e[_0xba91('0x2a')]=_0xc3cd6a;if(_0x53b3ff[_0xba91('0x3e')][_0xba91('0x4b')]){_0x21e358['include']=[{'all':!![]}];}return db[_0xba91('0x4a')][_0xba91('0x4c')](_0x21e358);})[_0xba91('0x33')](function(_0x5234e1){_0x2a826e[_0xba91('0x4d')]=_0x5234e1;return _0x2a826e;})[_0xba91('0x33')](respondWithFilteredResult(_0x2b2a64,_0x21e358))[_0xba91('0x26')](handleError(_0x2b2a64,null));};exports[_0xba91('0x4e')]=function(_0x3f9f3d,_0x49c68f){var _0x1b7777={'raw':![],'where':{'id':_0x3f9f3d[_0xba91('0x4f')]['id']}},_0x2f103f={};_0x2f103f[_0xba91('0x3d')]=_[_0xba91('0x3f')](db[_0xba91('0x4a')]['rawAttributes']);_0x2f103f[_0xba91('0x3e')]=_['keys'](_0x3f9f3d[_0xba91('0x3e')]);_0x2f103f[_0xba91('0x40')]=_[_0xba91('0x41')](_0x2f103f[_0xba91('0x3d')],_0x2f103f[_0xba91('0x3e')]);_0x1b7777[_0xba91('0x43')]=_[_0xba91('0x41')](_0x2f103f[_0xba91('0x3d')],qs[_0xba91('0x42')](_0x3f9f3d['query'][_0xba91('0x42')]));_0x1b7777[_0xba91('0x43')]=_0x1b7777[_0xba91('0x43')][_0xba91('0x44')]?_0x1b7777[_0xba91('0x43')]:_0x2f103f[_0xba91('0x3d')];if(_0x3f9f3d[_0xba91('0x3e')][_0xba91('0x4b')]){_0x1b7777[_0xba91('0x50')]=[{'all':!![]}];}_0x1b7777=_['merge']({},_0x1b7777,_0x3f9f3d[_0xba91('0x51')]);return db['SugarcrmAccount'][_0xba91('0x52')](_0x1b7777)[_0xba91('0x33')](handleEntityNotFound(_0x49c68f,null))[_0xba91('0x33')](respondWithResult(_0x49c68f,null))[_0xba91('0x26')](handleError(_0x49c68f,null));};exports[_0xba91('0x53')]=function(_0x1dd1bd,_0x40407e){return db[_0xba91('0x4a')]['create'](_0x1dd1bd[_0xba91('0x54')],{})[_0xba91('0x33')](respondWithResult(_0x40407e,0xc9))[_0xba91('0x26')](handleError(_0x40407e,null));};exports[_0xba91('0x55')]=function(_0x52c4d0,_0x5b5dfc){if(_0x52c4d0['body']['id']){delete _0x52c4d0[_0xba91('0x54')]['id'];}return db[_0xba91('0x4a')]['find']({'where':{'id':_0x52c4d0[_0xba91('0x4f')]['id']}})[_0xba91('0x33')](handleEntityNotFound(_0x5b5dfc,null))[_0xba91('0x33')](saveUpdates(_0x52c4d0['body'],null))['then'](respondWithResult(_0x5b5dfc,null))['catch'](handleError(_0x5b5dfc,null));};exports[_0xba91('0x34')]=function(_0x1577b0,_0x10bc6f){return db['SugarcrmAccount']['find']({'where':{'id':_0x1577b0[_0xba91('0x4f')]['id']}})[_0xba91('0x33')](handleEntityNotFound(_0x10bc6f,null))[_0xba91('0x33')](removeEntity(_0x10bc6f,null))[_0xba91('0x26')](handleError(_0x10bc6f,null));};exports[_0xba91('0x56')]=function(_0x4be87a,_0x1aaa20,_0x4ee666){var _0x14db0e={};var _0x30660f={};var _0x11842e;var _0xcf74ba;return db[_0xba91('0x4a')][_0xba91('0x57')]({'where':{'id':_0x4be87a[_0xba91('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1aaa20,null))[_0xba91('0x33')](function(_0x4679a3){if(_0x4679a3){_0x11842e=_0x4679a3;_0x30660f[_0xba91('0x3d')]=_['keys'](db[_0xba91('0x58')][_0xba91('0x59')]);_0x30660f[_0xba91('0x3e')]=_[_0xba91('0x3f')](_0x4be87a[_0xba91('0x3e')]);_0x30660f[_0xba91('0x40')]=_['intersection'](_0x30660f[_0xba91('0x3d')],_0x30660f[_0xba91('0x3e')]);_0x14db0e['attributes']=_[_0xba91('0x41')](_0x30660f[_0xba91('0x3d')],qs['fields'](_0x4be87a[_0xba91('0x3e')][_0xba91('0x42')]));_0x14db0e[_0xba91('0x43')]=_0x14db0e[_0xba91('0x43')]['length']?_0x14db0e[_0xba91('0x43')]:_0x30660f[_0xba91('0x3d')];_0x14db0e[_0xba91('0x5a')]=qs[_0xba91('0x46')](_0x4be87a[_0xba91('0x3e')][_0xba91('0x46')]);_0x14db0e[_0xba91('0x47')]=qs[_0xba91('0x40')](_[_0xba91('0x5b')](_0x4be87a['query'],_0x30660f['filters']));if(_0x4be87a[_0xba91('0x3e')][_0xba91('0x48')]){_0x14db0e['where']=_['merge'](_0x14db0e[_0xba91('0x47')],{'$or':_[_0xba91('0x39')](_0x14db0e[_0xba91('0x43')],function(_0x3d449f){var _0x41bd4a={};_0x41bd4a[_0x3d449f]={'$like':'%'+_0x4be87a[_0xba91('0x3e')]['filter']+'%'};return _0x41bd4a;})});}_0x14db0e=_[_0xba91('0x49')]({},_0x14db0e,_0x4be87a[_0xba91('0x51')]);return _0x11842e[_0xba91('0x56')](_0x14db0e);}})[_0xba91('0x33')](function(_0x5a8e62){if(_0x5a8e62){_0xcf74ba=_0x5a8e62[_0xba91('0x44')];if(!_0x4be87a['query'][_0xba91('0x45')](_0xba91('0x5c'))){_0x14db0e[_0xba91('0x2c')]=qs[_0xba91('0x2c')](_0x4be87a[_0xba91('0x3e')][_0xba91('0x2c')]);_0x14db0e[_0xba91('0x2b')]=qs[_0xba91('0x2b')](_0x4be87a[_0xba91('0x3e')][_0xba91('0x2b')]);}return _0x11842e[_0xba91('0x56')](_0x14db0e);}})['then'](function(_0x1251a8){if(_0x1251a8){return _0x1251a8?{'count':_0xcf74ba,'rows':_0x1251a8}:null;}})[_0xba91('0x33')](respondWithResult(_0x1aaa20,null))[_0xba91('0x26')](handleError(_0x1aaa20,null));};exports[_0xba91('0x5d')]=function(_0x54d146,_0x29ed81,_0x1adf82){if(_0x54d146[_0xba91('0x54')]['id']){delete _0x54d146[_0xba91('0x54')]['id'];}return db['SugarcrmAccount'][_0xba91('0x57')]({'where':{'id':_0x54d146[_0xba91('0x4f')]['id']}})[_0xba91('0x33')](handleEntityNotFound(_0x29ed81,null))[_0xba91('0x33')](function(_0x54cf62){if(_0x54cf62){_0x54d146['body'][_0xba91('0x5e')]=_0x54cf62['id'];_0x54d146[_0xba91('0x54')][_0xba91('0x5f')]=integrations[_0xba91('0x60')](_0x54d146[_0xba91('0x54')][_0xba91('0x61')],_0x54d146[_0xba91('0x54')]['type']);_0x54d146[_0xba91('0x54')]['Descriptions']=integrations['getDescriptions'](_0x54d146[_0xba91('0x54')][_0xba91('0x61')],_0x54d146[_0xba91('0x54')]['type']);return db[_0xba91('0x58')][_0xba91('0x53')](_0x54d146[_0xba91('0x54')],{'include':[{'model':db[_0xba91('0x62')],'as':'Subjects'},{'model':db[_0xba91('0x62')],'as':_0xba91('0x63')}]});}return null;})[_0xba91('0x33')](respondWithResult(_0x29ed81,null))[_0xba91('0x26')](handleError(_0x29ed81,null));};exports[_0xba91('0x64')]=function(_0x1ca9b6,_0x26f43e,_0x3bf635){var _0x1ed36e='';var _0x446c4f=['id',_0xba91('0x36'),_0xba91('0x65'),_0xba91('0x66'),_0xba91('0x67'),_0xba91('0x68'),_0xba91('0x69'),'duration_minutes',_0xba91('0x6a'),'parent_type',_0xba91('0x6b'),'direction'];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x1ca9b6[_0xba91('0x4f')]['id']},'attributes':['id','username',_0xba91('0x6c'),_0xba91('0x6d')]})[_0xba91('0x33')](handleEntityNotFound(_0x26f43e,null))[_0xba91('0x33')](function(_0x38211b){if(_0x38211b){_0x1ed36e=_0x38211b[_0xba91('0x6d')];var _0x5c4622=_0x1ed36e[_0xba91('0x6e')](-0x1);if(_0x5c4622==='/'){_0x1ed36e=_0x1ed36e['substring'](0x0,_0x1ed36e[_0xba91('0x6f')](_0x5c4622));}return rp({'method':_0xba91('0x70'),'uri':util[_0xba91('0x71')]('%s%s',_0x1ed36e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xba91('0x72'),'input_type':_0xba91('0x73'),'response_type':_0xba91('0x73'),'rest_data':JSON[_0xba91('0x22')]({'user_auth':{'user_name':_0x38211b[_0xba91('0x74')],'password':_0x38211b[_0xba91('0x6c')],'encryption':_0xba91('0x75')},'application':_0xba91('0x76')})}});}})['then'](function(_0x537e58){if(_0x537e58&&_0x537e58[_0xba91('0x36')]!=='Invalid\x20Login'&&_0x537e58[_0xba91('0x36')]!==_0xba91('0x77')){return rp({'method':_0xba91('0x70'),'uri':util[_0xba91('0x71')](_0xba91('0x78'),_0x1ed36e,_0xba91('0x79')),'json':!![],'form':{'method':_0xba91('0x7a'),'input_type':_0xba91('0x73'),'response_type':_0xba91('0x73'),'rest_data':JSON['stringify']({'session':_0x537e58['id'],'module_name':_0xba91('0x7b')})}})[_0xba91('0x33')](function(_0x4d7c7c){if(_0x4d7c7c){var _0x224d10=_[_0xba91('0x7c')](_0x4d7c7c['module_fields']);_['remove'](_0x224d10,function(_0x323049){return _0x446c4f['includes'](_0x323049[_0xba91('0x36')]);});return{'count':_0x224d10[_0xba91('0x44')],'rows':_['map'](_0x224d10,function(_0x5c2bea){return{'id':_0x5c2bea[_0xba91('0x36')],'name':_0x5c2bea[_0xba91('0x7d')],'custom':_['endsWith'](_0x5c2bea['name'],'_c')?!![]:![],'options':_0x5c2bea[_0xba91('0x51')]?_[_0xba91('0x39')](_[_0xba91('0x7c')](_0x5c2bea[_0xba91('0x51')]),function(_0x59a7b2){return{'name':_0x59a7b2['value'],'value':_0x59a7b2[_0xba91('0x36')]};}):[]};})};}})['then'](respondWithResult(_0x26f43e,null))[_0xba91('0x26')](function(_0x37911b){var _0x325968=_0x1ca9b6[_0xba91('0x3e')][_0xba91('0x7e')]?0x1f4:_0x37911b[_0xba91('0x7f')]||0x1f4;logger[_0xba91('0x23')](_0xba91('0x80'),'getFields',_0x325968,JSON[_0xba91('0x22')](_0x37911b));delete _0x37911b[_0xba91('0x36')];if(_0x325968===0x191){_0x325968=0x190;}_0x26f43e[_0xba91('0x28')](_0x325968)[_0xba91('0x37')](_0x1ca9b6[_0xba91('0x3e')][_0xba91('0x7e')]?{'message':_0xba91('0x81'),'statusCode':_0x37911b[_0xba91('0x7f')]}:_0x37911b);});}else{var _0x2e52ea=0x1f4;_0x26f43e[_0xba91('0x28')](_0x2e52ea)['send']({'message':_0xba91('0x81'),'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 73502c2..a1723fe 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 _0x298e=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x298e,0x171));var _0xe298=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x298e[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0xe298('0x0'));var logger=require('../../config/logger')(_0xe298('0x1'));var moment=require(_0xe298('0x2'));var BPromise=require(_0xe298('0x3'));var rp=require(_0xe298('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe298('0x5'));var config=require(_0xe298('0x6'));var attributes=require(_0xe298('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xe298('0x8')]=function(_0x416cc4,_0x43c842){return _0x416cc4['define'](_0xe298('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1780=['bluebird','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts','lodash','util','api','moment'];(function(_0x17ec07,_0xe3ca90){var _0x5a6c45=function(_0x59b715){while(--_0x59b715){_0x17ec07['push'](_0x17ec07['shift']());}};_0x5a6c45(++_0xe3ca90);}(_0x1780,0x125));var _0x0178=function(_0x496152,_0x1dac84){_0x496152=_0x496152-0x0;var _0x435a8a=_0x1780[_0x496152];return _0x435a8a;};'use strict';var _=require(_0x0178('0x0'));var util=require(_0x0178('0x1'));var logger=require('../../config/logger')(_0x0178('0x2'));var moment=require(_0x0178('0x3'));var BPromise=require(_0x0178('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0178('0x5'));var config=require('../../config/environment');var attributes=require(_0x0178('0x6'));var integrations=require(_0x0178('0x7'));module[_0x0178('0x8')]=function(_0x4eee4a,_0x177bc2){return _0x4eee4a[_0x0178('0x9')]('SugarcrmAccount',attributes,{'tableName':_0x0178('0xa'),'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 328fc36..9d9b475 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 _0x2772=['find','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','info','SugarcrmAccount,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowSugarcrmAccount'];(function(_0x118cbb,_0x2f1d27){var _0x3299d5=function(_0x4fbfc5){while(--_0x4fbfc5){_0x118cbb['push'](_0x118cbb['shift']());}};_0x3299d5(++_0x2f1d27);}(_0x2772,0xc2));var _0x2277=function(_0x3a265f,_0x460d09){_0x3a265f=_0x3a265f-0x0;var _0x4fc9b9=_0x2772[_0x3a265f];return _0x4fc9b9;};'use strict';var _=require('lodash');var util=require(_0x2277('0x0'));var moment=require(_0x2277('0x1'));var BPromise=require(_0x2277('0x2'));var rs=require(_0x2277('0x3'));var fs=require('fs');var Redis=require(_0x2277('0x4'));var db=require(_0x2277('0x5'))['db'];var utils=require(_0x2277('0x6'));var logger=require('../../config/logger')(_0x2277('0x7'));var config=require(_0x2277('0x8'));var jayson=require(_0x2277('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5532e6,_0xe1e280,_0x2664b6){return new BPromise(function(_0x2d791e,_0xbf1bf2){return client[_0x2277('0xa')](_0x5532e6,_0x2664b6)['then'](function(_0x4d8cc1){logger[_0x2277('0xb')](_0x2277('0xc'),_0xe1e280,'request\x20sent');logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0xe1e280,'request\x20sent',JSON[_0x2277('0xd')](_0x4d8cc1));if(_0x4d8cc1[_0x2277('0xe')]){if(_0x4d8cc1['error']['code']===0x1f4){logger[_0x2277('0xe')](_0x2277('0xc'),_0xe1e280,_0x4d8cc1['error'][_0x2277('0xf')]);return _0xbf1bf2(_0x4d8cc1[_0x2277('0xe')][_0x2277('0xf')]);}logger[_0x2277('0xe')](_0x2277('0xc'),_0xe1e280,_0x4d8cc1['error'][_0x2277('0xf')]);return _0x2d791e(_0x4d8cc1[_0x2277('0xe')][_0x2277('0xf')]);}else{logger['info'](_0x2277('0xc'),_0xe1e280,_0x2277('0x10'));_0x2d791e(_0x4d8cc1['result'][_0x2277('0xf')]);}})[_0x2277('0x11')](function(_0x5629a8){logger['error'](_0x2277('0xc'),_0xe1e280,_0x5629a8);_0xbf1bf2(_0x5629a8);});});}exports[_0x2277('0x12')]=function(_0xc533d8){var _0x3ddae7=this;return new Promise(function(_0xbeccf2,_0x4d9954){return db[_0x2277('0x13')][_0x2277('0x14')]({'raw':_0xc533d8[_0x2277('0x15')]?_0xc533d8[_0x2277('0x15')][_0x2277('0x16')]===undefined?!![]:![]:!![],'where':_0xc533d8[_0x2277('0x15')]?_0xc533d8[_0x2277('0x15')]['where']||null:null,'attributes':_0xc533d8[_0x2277('0x15')]?_0xc533d8[_0x2277('0x15')][_0x2277('0x17')]||null:null,'limit':_0xc533d8[_0x2277('0x15')]?_0xc533d8[_0x2277('0x15')][_0x2277('0x18')]||null:null,'include':_0xc533d8['options']?_0xc533d8[_0x2277('0x15')][_0x2277('0x19')]?_[_0x2277('0x1a')](_0xc533d8[_0x2277('0x15')][_0x2277('0x19')],function(_0x4f0c91){return{'model':db[_0x4f0c91[_0x2277('0x1b')]],'as':_0x4f0c91['as'],'attributes':_0x4f0c91[_0x2277('0x17')],'include':_0x4f0c91['include']?_[_0x2277('0x1a')](_0x4f0c91[_0x2277('0x19')],function(_0x232f61){return{'model':db[_0x232f61[_0x2277('0x1b')]],'as':_0x232f61['as'],'attributes':_0x232f61['attributes'],'include':_0x232f61[_0x2277('0x19')]?_[_0x2277('0x1a')](_0x232f61['include'],function(_0x292d2f){return{'model':db[_0x292d2f[_0x2277('0x1b')]],'as':_0x292d2f['as'],'attributes':_0x292d2f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f8f84){logger['info']('GetSugarcrmAccount',_0xc533d8);logger[_0x2277('0x1c')](_0x2277('0x12'),_0xc533d8,JSON[_0x2277('0xd')](_0x5f8f84));_0xbeccf2(_0x5f8f84);})[_0x2277('0x11')](function(_0x5e377e){logger[_0x2277('0xe')](_0x2277('0x12'),_0x5e377e[_0x2277('0xf')],_0xc533d8);_0x4d9954(_0x3ddae7['error'](0x1f4,_0x5e377e[_0x2277('0xf')]));});});};exports[_0x2277('0x1d')]=function(_0x31e378){var _0x5dbd5f=this;return new Promise(function(_0x1001df,_0x5307af){return db[_0x2277('0x13')][_0x2277('0x1e')]({'raw':_0x31e378[_0x2277('0x15')]?_0x31e378[_0x2277('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x31e378['options']?_0x31e378[_0x2277('0x15')]['where']||null:null,'attributes':_0x31e378[_0x2277('0x15')]?_0x31e378[_0x2277('0x15')][_0x2277('0x17')]||null:null,'include':_0x31e378[_0x2277('0x15')]?_0x31e378[_0x2277('0x15')][_0x2277('0x19')]?_[_0x2277('0x1a')](_0x31e378[_0x2277('0x15')][_0x2277('0x19')],function(_0x2fe260){return{'model':db[_0x2fe260[_0x2277('0x1b')]],'as':_0x2fe260['as'],'attributes':_0x2fe260[_0x2277('0x17')],'include':_0x2fe260[_0x2277('0x19')]?_[_0x2277('0x1a')](_0x2fe260[_0x2277('0x19')],function(_0x4ccd32){return{'model':db[_0x4ccd32[_0x2277('0x1b')]],'as':_0x4ccd32['as'],'attributes':_0x4ccd32[_0x2277('0x17')],'include':_0x4ccd32[_0x2277('0x19')]?_[_0x2277('0x1a')](_0x4ccd32[_0x2277('0x19')],function(_0x13801c){return{'model':db[_0x13801c[_0x2277('0x1b')]],'as':_0x13801c['as'],'attributes':_0x13801c[_0x2277('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2277('0x1f')](function(_0xac4ed1){logger['info'](_0x2277('0x1d'),_0x31e378);logger[_0x2277('0x1c')]('ShowSugarcrmAccount',_0x31e378,JSON[_0x2277('0xd')](_0xac4ed1));_0x1001df(_0xac4ed1);})['catch'](function(_0x5b76da){logger['error']('ShowSugarcrmAccount',_0x5b76da[_0x2277('0xf')],_0x31e378);_0x5307af(_0x5dbd5f[_0x2277('0xe')](0x1f4,_0x5b76da[_0x2277('0xf')]));});});}; \ No newline at end of file +var _0x5b69=['find','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','include','model','map','ShowSugarcrmAccount'];(function(_0x293c66,_0x44d892){var _0x12d852=function(_0x34a774){while(--_0x34a774){_0x293c66['push'](_0x293c66['shift']());}};_0x12d852(++_0x44d892);}(_0x5b69,0x10a));var _0x95b6=function(_0x31300c,_0x2823e1){_0x31300c=_0x31300c-0x0;var _0x462408=_0x5b69[_0x31300c];return _0x462408;};'use strict';var _=require('lodash');var util=require(_0x95b6('0x0'));var moment=require(_0x95b6('0x1'));var BPromise=require(_0x95b6('0x2'));var rs=require(_0x95b6('0x3'));var fs=require('fs');var Redis=require(_0x95b6('0x4'));var db=require(_0x95b6('0x5'))['db'];var utils=require(_0x95b6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x95b6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x95b6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34d503,_0x47e75f,_0x450d8c){return new BPromise(function(_0x578f2f,_0x5444b3){return client[_0x95b6('0x9')](_0x34d503,_0x450d8c)[_0x95b6('0xa')](function(_0x3b9ef5){logger[_0x95b6('0xb')](_0x95b6('0xc'),_0x47e75f,'request\x20sent');logger[_0x95b6('0xd')](_0x95b6('0xe'),_0x47e75f,_0x95b6('0xf'),JSON['stringify'](_0x3b9ef5));if(_0x3b9ef5['error']){if(_0x3b9ef5[_0x95b6('0x10')]['code']===0x1f4){logger['error'](_0x95b6('0xc'),_0x47e75f,_0x3b9ef5[_0x95b6('0x10')]['message']);return _0x5444b3(_0x3b9ef5['error'][_0x95b6('0x11')]);}logger['error'](_0x95b6('0xc'),_0x47e75f,_0x3b9ef5[_0x95b6('0x10')]['message']);return _0x578f2f(_0x3b9ef5[_0x95b6('0x10')]['message']);}else{logger[_0x95b6('0xb')](_0x95b6('0xc'),_0x47e75f,'request\x20sent');_0x578f2f(_0x3b9ef5[_0x95b6('0x12')]['message']);}})[_0x95b6('0x13')](function(_0x1a6f65){logger[_0x95b6('0x10')](_0x95b6('0xc'),_0x47e75f,_0x1a6f65);_0x5444b3(_0x1a6f65);});});}exports[_0x95b6('0x14')]=function(_0x5012ab){var _0x37a804=this;return new Promise(function(_0x137cf3,_0x10d51c){return db[_0x95b6('0x15')][_0x95b6('0x16')]({'raw':_0x5012ab[_0x95b6('0x17')]?_0x5012ab['options'][_0x95b6('0x18')]===undefined?!![]:![]:!![],'where':_0x5012ab[_0x95b6('0x17')]?_0x5012ab[_0x95b6('0x17')]['where']||null:null,'attributes':_0x5012ab[_0x95b6('0x17')]?_0x5012ab['options'][_0x95b6('0x19')]||null:null,'limit':_0x5012ab[_0x95b6('0x17')]?_0x5012ab[_0x95b6('0x17')][_0x95b6('0x1a')]||null:null,'include':_0x5012ab[_0x95b6('0x17')]?_0x5012ab[_0x95b6('0x17')][_0x95b6('0x1b')]?_['map'](_0x5012ab[_0x95b6('0x17')][_0x95b6('0x1b')],function(_0xbfd1d9){return{'model':db[_0xbfd1d9[_0x95b6('0x1c')]],'as':_0xbfd1d9['as'],'attributes':_0xbfd1d9[_0x95b6('0x19')],'include':_0xbfd1d9[_0x95b6('0x1b')]?_[_0x95b6('0x1d')](_0xbfd1d9[_0x95b6('0x1b')],function(_0x144d55){return{'model':db[_0x144d55['model']],'as':_0x144d55['as'],'attributes':_0x144d55[_0x95b6('0x19')],'include':_0x144d55[_0x95b6('0x1b')]?_['map'](_0x144d55['include'],function(_0x2b7f6e){return{'model':db[_0x2b7f6e['model']],'as':_0x2b7f6e['as'],'attributes':_0x2b7f6e[_0x95b6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x95b6('0xa')](function(_0x234cd3){logger[_0x95b6('0xb')](_0x95b6('0x14'),_0x5012ab);logger[_0x95b6('0xd')](_0x95b6('0x14'),_0x5012ab,JSON['stringify'](_0x234cd3));_0x137cf3(_0x234cd3);})['catch'](function(_0x4a6845){logger[_0x95b6('0x10')](_0x95b6('0x14'),_0x4a6845[_0x95b6('0x11')],_0x5012ab);_0x10d51c(_0x37a804[_0x95b6('0x10')](0x1f4,_0x4a6845[_0x95b6('0x11')]));});});};exports[_0x95b6('0x1e')]=function(_0x520486){var _0x139db7=this;return new Promise(function(_0x54126c,_0x348610){return db[_0x95b6('0x15')][_0x95b6('0x1f')]({'raw':_0x520486[_0x95b6('0x17')]?_0x520486[_0x95b6('0x17')][_0x95b6('0x18')]===undefined?!![]:![]:!![],'where':_0x520486['options']?_0x520486[_0x95b6('0x17')]['where']||null:null,'attributes':_0x520486['options']?_0x520486[_0x95b6('0x17')][_0x95b6('0x19')]||null:null,'include':_0x520486['options']?_0x520486['options']['include']?_[_0x95b6('0x1d')](_0x520486[_0x95b6('0x17')][_0x95b6('0x1b')],function(_0x5c30f1){return{'model':db[_0x5c30f1[_0x95b6('0x1c')]],'as':_0x5c30f1['as'],'attributes':_0x5c30f1[_0x95b6('0x19')],'include':_0x5c30f1[_0x95b6('0x1b')]?_[_0x95b6('0x1d')](_0x5c30f1['include'],function(_0x4adf3d){return{'model':db[_0x4adf3d[_0x95b6('0x1c')]],'as':_0x4adf3d['as'],'attributes':_0x4adf3d[_0x95b6('0x19')],'include':_0x4adf3d[_0x95b6('0x1b')]?_[_0x95b6('0x1d')](_0x4adf3d[_0x95b6('0x1b')],function(_0x3d8e85){return{'model':db[_0x3d8e85[_0x95b6('0x1c')]],'as':_0x3d8e85['as'],'attributes':_0x3d8e85[_0x95b6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x95b6('0xa')](function(_0xebc1ea){logger[_0x95b6('0xb')]('ShowSugarcrmAccount',_0x520486);logger[_0x95b6('0xd')]('ShowSugarcrmAccount',_0x520486,JSON[_0x95b6('0x20')](_0xebc1ea));_0x54126c(_0xebc1ea);})[_0x95b6('0x13')](function(_0x10a02d){logger[_0x95b6('0x10')](_0x95b6('0x1e'),_0x10a02d['message'],_0x520486);_0x348610(_0x139db7[_0x95b6('0x10')](0x1f4,_0x10a02d['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 3cec1e7..eb45bf7 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 _0xf065=['create','/:id','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','show','/:id/fields','getFields','get','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf065,0x1e4));var _0x5f06=function(_0x1e921c,_0x2f5173){_0x1e921c=_0x1e921c-0x0;var _0x2f9649=_0xf065[_0x1e921c];return _0x2f9649;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5f06('0x0'));var timeout=require(_0x5f06('0x1'));var express=require(_0x5f06('0x2'));var router=express[_0x5f06('0x3')]();var fs_extra=require(_0x5f06('0x4'));var auth=require(_0x5f06('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5f06('0x6'));var controller=require(_0x5f06('0x7'));router['get']('/',auth[_0x5f06('0x8')](),controller['index']);router['get']('/:id',auth[_0x5f06('0x8')](),controller[_0x5f06('0x9')]);router['get'](_0x5f06('0xa'),auth[_0x5f06('0x8')](),controller[_0x5f06('0xb')]);router[_0x5f06('0xc')](_0x5f06('0xd'),auth[_0x5f06('0x8')](),controller['getSubjects']);router[_0x5f06('0xc')](_0x5f06('0xe'),auth['isAuthenticated'](),controller[_0x5f06('0xf')]);router['post']('/',auth[_0x5f06('0x8')](),controller[_0x5f06('0x10')]);router['put'](_0x5f06('0x11'),auth[_0x5f06('0x8')](),controller[_0x5f06('0x12')]);router['delete']('/:id',auth[_0x5f06('0x8')](),controller['destroy']);module[_0x5f06('0x13')]=router; \ No newline at end of file +var _0xfd53=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','multer','util','path'];(function(_0x1b7516,_0x2fbe81){var _0x14983b=function(_0x435b5f){while(--_0x435b5f){_0x1b7516['push'](_0x1b7516['shift']());}};_0x14983b(++_0x2fbe81);}(_0xfd53,0x93));var _0x3fd5=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xfd53[_0x2f1762];return _0x8ab21;};'use strict';var multer=require(_0x3fd5('0x0'));var util=require(_0x3fd5('0x1'));var path=require(_0x3fd5('0x2'));var timeout=require(_0x3fd5('0x3'));var express=require(_0x3fd5('0x4'));var router=express[_0x3fd5('0x5')]();var fs_extra=require(_0x3fd5('0x6'));var auth=require(_0x3fd5('0x7'));var interaction=require(_0x3fd5('0x8'));var config=require(_0x3fd5('0x9'));var controller=require(_0x3fd5('0xa'));router[_0x3fd5('0xb')]('/',auth[_0x3fd5('0xc')](),controller[_0x3fd5('0xd')]);router[_0x3fd5('0xb')](_0x3fd5('0xe'),auth[_0x3fd5('0xc')](),controller[_0x3fd5('0xf')]);router[_0x3fd5('0xb')]('/:id/fields',auth[_0x3fd5('0xc')](),controller['getFields']);router[_0x3fd5('0xb')](_0x3fd5('0x10'),auth[_0x3fd5('0xc')](),controller[_0x3fd5('0x11')]);router[_0x3fd5('0xb')](_0x3fd5('0x12'),auth[_0x3fd5('0xc')](),controller[_0x3fd5('0x13')]);router[_0x3fd5('0x14')]('/',auth[_0x3fd5('0xc')](),controller[_0x3fd5('0x15')]);router[_0x3fd5('0x16')](_0x3fd5('0xe'),auth[_0x3fd5('0xc')](),controller['update']);router[_0x3fd5('0x17')](_0x3fd5('0xe'),auth[_0x3fd5('0xc')](),controller[_0x3fd5('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 8eb8b26..d1ef875 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 _0xc745=['sequelize','exports','STRING'];(function(_0x22dba1,_0x24f885){var _0x485244=function(_0x59b02b){while(--_0x59b02b){_0x22dba1['push'](_0x22dba1['shift']());}};_0x485244(++_0x24f885);}(_0xc745,0x78));var _0x5c74=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc745[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x5c74('0x0'));module[_0x5c74('0x1')]={'name':{'type':Sequelize[_0x5c74('0x2')]},'description':{'type':Sequelize[_0x5c74('0x2')]}}; \ No newline at end of file +var _0xf054=['exports','STRING','sequelize'];(function(_0x357e06,_0x17e4e9){var _0x137954=function(_0x3b9080){while(--_0x3b9080){_0x357e06['push'](_0x357e06['shift']());}};_0x137954(++_0x17e4e9);}(_0xf054,0x185));var _0x4f05=function(_0x502048,_0x212464){_0x502048=_0x502048-0x0;var _0x2e19da=_0xf054[_0x502048];return _0x2e19da;};'use strict';var Sequelize=require(_0x4f05('0x0'));module[_0x4f05('0x1')]={'name':{'type':Sequelize[_0x4f05('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 1126a74..c2ac698 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 _0x2ef4=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','includeAll','findAll','show','params','options','find','create','body','update','findOne','SugarcrmField','rawAttributes','length','order','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','destroy','end','stack','name','send','index','map','SugarcrmConfiguration','fieldName','model','query','keys'];(function(_0x5e8d8b,_0x3defdb){var _0xc38051=function(_0x12dca7){while(--_0x12dca7){_0x5e8d8b['push'](_0x5e8d8b['shift']());}};_0xc38051(++_0x3defdb);}(_0x2ef4,0x1e0));var _0x42ef=function(_0x4c3953,_0x571b3a){_0x4c3953=_0x4c3953-0x0;var _0x28362e=_0x2ef4[_0x4c3953];return _0x28362e;};'use strict';var emlformat=require(_0x42ef('0x0'));var rimraf=require(_0x42ef('0x1'));var zipdir=require(_0x42ef('0x2'));var jsonpatch=require(_0x42ef('0x3'));var rp=require(_0x42ef('0x4'));var moment=require(_0x42ef('0x5'));var BPromise=require(_0x42ef('0x6'));var Mustache=require('mustache');var util=require(_0x42ef('0x7'));var path=require(_0x42ef('0x8'));var sox=require(_0x42ef('0x9'));var csv=require(_0x42ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42ef('0xb'));var _=require('lodash');var squel=require(_0x42ef('0xc'));var crypto=require(_0x42ef('0xd'));var jsforce=require(_0x42ef('0xe'));var deskjs=require(_0x42ef('0xf'));var toCsv=require(_0x42ef('0xa'));var querystring=require('querystring');var Papa=require(_0x42ef('0x10'));var Redis=require('ioredis');var authService=require(_0x42ef('0x11'));var qs=require(_0x42ef('0x12'));var as=require(_0x42ef('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x42ef('0x14'))(_0x42ef('0x15'));var utils=require('../../config/utils');var config=require(_0x42ef('0x16'));var licenseUtil=require(_0x42ef('0x17'));var db=require(_0x42ef('0x18'))['db'];var jayson=require(_0x42ef('0x19'));var client=jayson['client'][_0x42ef('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4b21f4,_0x35fab8,_0xa0560f,_0x50f5ca){return new BPromise(function(_0x1114fa,_0x52658a){var _0x5d501b=_0x50f5ca||client;return _0x5d501b[_0x42ef('0x1b')](_0x4b21f4,_0xa0560f)[_0x42ef('0x1c')](function(_0x1ebcac){logger[_0x42ef('0x1d')](_0x42ef('0x1e'),_0x35fab8,'request\x20sent');logger['debug'](_0x42ef('0x1f'),_0x35fab8,_0x42ef('0x20'),JSON[_0x42ef('0x21')](_0x1ebcac));if(_0x1ebcac[_0x42ef('0x22')]){if(_0x1ebcac['error'][_0x42ef('0x23')]===0x1f4){logger['error'](_0x42ef('0x1e'),_0x35fab8,_0x1ebcac[_0x42ef('0x22')][_0x42ef('0x24')]);return _0x52658a(_0x1ebcac[_0x42ef('0x22')]['message']);}logger[_0x42ef('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x35fab8,_0x1ebcac[_0x42ef('0x22')][_0x42ef('0x24')]);return _0x1114fa(_0x1ebcac[_0x42ef('0x22')][_0x42ef('0x24')]);}else{logger[_0x42ef('0x1d')](_0x42ef('0x1e'),_0x35fab8,_0x42ef('0x20'));_0x1114fa(_0x1ebcac['result'][_0x42ef('0x24')]);}})[_0x42ef('0x25')](function(_0xca1345){logger[_0x42ef('0x22')](_0x42ef('0x1e'),_0x35fab8,_0xca1345);_0x52658a(_0xca1345);});});}function respondWithStatusCode(_0x285e21,_0x49e348){_0x49e348=_0x49e348||0xcc;return function(_0x3baede){if(_0x3baede){return _0x285e21[_0x42ef('0x26')](_0x49e348);}return _0x285e21[_0x42ef('0x27')](_0x49e348)['end']();};}function respondWithResult(_0x401a4f,_0x26e106){_0x26e106=_0x26e106||0xc8;return function(_0x5d327c){if(_0x5d327c){return _0x401a4f[_0x42ef('0x27')](_0x26e106)[_0x42ef('0x28')](_0x5d327c);}};}function respondWithFilteredResult(_0x2416d0,_0xa3e16a){return function(_0xfbb535){if(_0xfbb535){var _0x433f95=_0xfbb535[_0x42ef('0x29')],_0x3e0bab=_0xa3e16a[_0x42ef('0x2a')],_0x5ee9f9=_0xa3e16a['offset']+_0xa3e16a[_0x42ef('0x2b')],_0x2483e6;if(_0x5ee9f9>=_0x433f95){_0x5ee9f9=_0x433f95;_0x2483e6=0xc8;}else{_0x2483e6=0xce;}_0x2416d0[_0x42ef('0x27')](_0x2483e6);return _0x2416d0[_0x42ef('0x2c')](_0x42ef('0x2d'),_0x3e0bab+'-'+_0x5ee9f9+'/'+_0x433f95)[_0x42ef('0x28')](_0xfbb535);}return null;};}function patchUpdates(_0x2593ad){return function(_0x54f3cb){try{jsonpatch[_0x42ef('0x2e')](_0x54f3cb,_0x2593ad,!![]);}catch(_0x29216c){return BPromise[_0x42ef('0x2f')](_0x29216c);}return _0x54f3cb['save']();};}function saveUpdates(_0x157bca,_0x104a0c){return function(_0x22c996){if(_0x22c996){return _0x22c996['update'](_0x157bca)[_0x42ef('0x1c')](function(_0xaa4846){return _0xaa4846;});}return null;};}function removeEntity(_0x2ff201,_0x3b46f8){return function(_0x38d816){if(_0x38d816){return _0x38d816[_0x42ef('0x30')]()[_0x42ef('0x1c')](function(){_0x2ff201[_0x42ef('0x27')](0xcc)[_0x42ef('0x31')]();});}};}function handleEntityNotFound(_0x53584f,_0x1b1bc4){return function(_0x2e401f){if(!_0x2e401f){_0x53584f[_0x42ef('0x26')](0x194);}return _0x2e401f;};}function handleError(_0x2d15aa,_0x486a51){_0x486a51=_0x486a51||0x1f4;return function(_0x223ba2){logger[_0x42ef('0x22')](_0x223ba2[_0x42ef('0x32')]);if(_0x223ba2[_0x42ef('0x33')]){delete _0x223ba2[_0x42ef('0x33')];}_0x2d15aa[_0x42ef('0x27')](_0x486a51)[_0x42ef('0x34')](_0x223ba2);};}exports[_0x42ef('0x35')]=function(_0x26b88e,_0x2cdf19){var _0x577ec2={},_0x1499a5={},_0x387ff0={'count':0x0,'rows':[]};var _0x29c6b0=_[_0x42ef('0x36')](db[_0x42ef('0x37')]['rawAttributes'],function(_0x4dcdcc){return{'name':_0x4dcdcc[_0x42ef('0x38')],'type':_0x4dcdcc['type']['key']};});_0x1499a5[_0x42ef('0x39')]=_[_0x42ef('0x36')](_0x29c6b0,_0x42ef('0x33'));_0x1499a5[_0x42ef('0x3a')]=_[_0x42ef('0x3b')](_0x26b88e['query']);_0x1499a5[_0x42ef('0x3c')]=_[_0x42ef('0x3d')](_0x1499a5['model'],_0x1499a5['query']);_0x577ec2[_0x42ef('0x3e')]=_[_0x42ef('0x3d')](_0x1499a5['model'],qs[_0x42ef('0x3f')](_0x26b88e[_0x42ef('0x3a')][_0x42ef('0x3f')]));_0x577ec2[_0x42ef('0x3e')]=_0x577ec2[_0x42ef('0x3e')]['length']?_0x577ec2[_0x42ef('0x3e')]:_0x1499a5[_0x42ef('0x39')];if(!_0x26b88e[_0x42ef('0x3a')][_0x42ef('0x40')](_0x42ef('0x41'))){_0x577ec2[_0x42ef('0x2b')]=qs['limit'](_0x26b88e[_0x42ef('0x3a')]['limit']);_0x577ec2[_0x42ef('0x2a')]=qs[_0x42ef('0x2a')](_0x26b88e[_0x42ef('0x3a')][_0x42ef('0x2a')]);}_0x577ec2['order']=qs['sort'](_0x26b88e[_0x42ef('0x3a')][_0x42ef('0x42')]);_0x577ec2['where']=qs[_0x42ef('0x3c')](_['pick'](_0x26b88e['query'],_0x1499a5[_0x42ef('0x3c')]),_0x29c6b0);if(_0x26b88e[_0x42ef('0x3a')][_0x42ef('0x43')]){_0x577ec2[_0x42ef('0x44')]=_[_0x42ef('0x45')](_0x577ec2[_0x42ef('0x44')],{'$or':_[_0x42ef('0x36')](_0x29c6b0,function(_0x29725d){if(_0x29725d[_0x42ef('0x46')]!==_0x42ef('0x47')){var _0x12c77d={};_0x12c77d[_0x29725d['name']]={'$like':'%'+_0x26b88e[_0x42ef('0x3a')][_0x42ef('0x43')]+'%'};return _0x12c77d;}})});}_0x577ec2=_[_0x42ef('0x45')]({},_0x577ec2,_0x26b88e['options']);var _0x3c002e={'where':_0x577ec2['where']};return db[_0x42ef('0x37')]['count'](_0x3c002e)[_0x42ef('0x1c')](function(_0x19633d){_0x387ff0['count']=_0x19633d;if(_0x26b88e[_0x42ef('0x3a')][_0x42ef('0x48')]){_0x577ec2['include']=[{'all':!![]}];}return db[_0x42ef('0x37')][_0x42ef('0x49')](_0x577ec2);})[_0x42ef('0x1c')](function(_0xc8722f){_0x387ff0['rows']=_0xc8722f;return _0x387ff0;})[_0x42ef('0x1c')](respondWithFilteredResult(_0x2cdf19,_0x577ec2))[_0x42ef('0x25')](handleError(_0x2cdf19,null));};exports[_0x42ef('0x4a')]=function(_0x11aecf,_0x5e5b39){var _0x36877e={'raw':![],'where':{'id':_0x11aecf[_0x42ef('0x4b')]['id']}},_0x7f3465={};_0x7f3465[_0x42ef('0x39')]=_[_0x42ef('0x3b')](db[_0x42ef('0x37')]['rawAttributes']);_0x7f3465['query']=_['keys'](_0x11aecf[_0x42ef('0x3a')]);_0x7f3465[_0x42ef('0x3c')]=_[_0x42ef('0x3d')](_0x7f3465[_0x42ef('0x39')],_0x7f3465[_0x42ef('0x3a')]);_0x36877e[_0x42ef('0x3e')]=_['intersection'](_0x7f3465[_0x42ef('0x39')],qs[_0x42ef('0x3f')](_0x11aecf[_0x42ef('0x3a')]['fields']));_0x36877e['attributes']=_0x36877e[_0x42ef('0x3e')]['length']?_0x36877e[_0x42ef('0x3e')]:_0x7f3465['model'];if(_0x11aecf[_0x42ef('0x3a')]['includeAll']){_0x36877e['include']=[{'all':!![]}];}_0x36877e=_[_0x42ef('0x45')]({},_0x36877e,_0x11aecf[_0x42ef('0x4c')]);return db['SugarcrmConfiguration'][_0x42ef('0x4d')](_0x36877e)[_0x42ef('0x1c')](handleEntityNotFound(_0x5e5b39,null))[_0x42ef('0x1c')](respondWithResult(_0x5e5b39,null))['catch'](handleError(_0x5e5b39,null));};exports[_0x42ef('0x4e')]=function(_0x353ba6,_0x24b118){return db[_0x42ef('0x37')][_0x42ef('0x4e')](_0x353ba6[_0x42ef('0x4f')],{})['then'](respondWithResult(_0x24b118,0xc9))[_0x42ef('0x25')](handleError(_0x24b118,null));};exports[_0x42ef('0x50')]=function(_0x353b27,_0x76632b){if(_0x353b27['body']['id']){delete _0x353b27['body']['id'];}return db['SugarcrmConfiguration'][_0x42ef('0x4d')]({'where':{'id':_0x353b27[_0x42ef('0x4b')]['id']}})[_0x42ef('0x1c')](handleEntityNotFound(_0x76632b,null))[_0x42ef('0x1c')](saveUpdates(_0x353b27['body'],null))[_0x42ef('0x1c')](respondWithResult(_0x76632b,null))[_0x42ef('0x25')](handleError(_0x76632b,null));};exports[_0x42ef('0x30')]=function(_0x382aa2,_0x34a8b7){return db[_0x42ef('0x37')][_0x42ef('0x4d')]({'where':{'id':_0x382aa2['params']['id']}})[_0x42ef('0x1c')](handleEntityNotFound(_0x34a8b7,null))[_0x42ef('0x1c')](removeEntity(_0x34a8b7,null))['catch'](handleError(_0x34a8b7,null));};exports['getFields']=function(_0x566b62,_0x293417,_0x3acc31){var _0x1dd495={};var _0x4985bc={};var _0x4020d6;var _0x295cc4;return db[_0x42ef('0x37')][_0x42ef('0x51')]({'where':{'id':_0x566b62[_0x42ef('0x4b')]['id']}})[_0x42ef('0x1c')](handleEntityNotFound(_0x293417,null))[_0x42ef('0x1c')](function(_0x303967){if(_0x303967){_0x4020d6=_0x303967;_0x4985bc[_0x42ef('0x39')]=_[_0x42ef('0x3b')](db[_0x42ef('0x52')][_0x42ef('0x53')]);_0x4985bc['query']=_[_0x42ef('0x3b')](_0x566b62[_0x42ef('0x3a')]);_0x4985bc[_0x42ef('0x3c')]=_[_0x42ef('0x3d')](_0x4985bc[_0x42ef('0x39')],_0x4985bc['query']);_0x1dd495[_0x42ef('0x3e')]=_[_0x42ef('0x3d')](_0x4985bc[_0x42ef('0x39')],qs[_0x42ef('0x3f')](_0x566b62[_0x42ef('0x3a')]['fields']));_0x1dd495[_0x42ef('0x3e')]=_0x1dd495[_0x42ef('0x3e')][_0x42ef('0x54')]?_0x1dd495[_0x42ef('0x3e')]:_0x4985bc['model'];_0x1dd495[_0x42ef('0x55')]=qs['sort'](_0x566b62[_0x42ef('0x3a')][_0x42ef('0x42')]);_0x1dd495[_0x42ef('0x44')]=qs[_0x42ef('0x3c')](_[_0x42ef('0x56')](_0x566b62[_0x42ef('0x3a')],_0x4985bc['filters']));if(_0x566b62[_0x42ef('0x3a')][_0x42ef('0x43')]){_0x1dd495['where']=_[_0x42ef('0x45')](_0x1dd495[_0x42ef('0x44')],{'$or':_['map'](_0x1dd495[_0x42ef('0x3e')],function(_0x14355c){var _0x2c0659={};_0x2c0659[_0x14355c]={'$like':'%'+_0x566b62[_0x42ef('0x3a')]['filter']+'%'};return _0x2c0659;})});}_0x1dd495=_['merge']({},_0x1dd495,_0x566b62['options']);return _0x4020d6[_0x42ef('0x57')](_0x1dd495);}})[_0x42ef('0x1c')](function(_0xa2859d){if(_0xa2859d){_0x295cc4=_0xa2859d[_0x42ef('0x54')];if(!_0x566b62[_0x42ef('0x3a')][_0x42ef('0x40')](_0x42ef('0x41'))){_0x1dd495['limit']=qs[_0x42ef('0x2b')](_0x566b62[_0x42ef('0x3a')][_0x42ef('0x2b')]);_0x1dd495['offset']=qs[_0x42ef('0x2a')](_0x566b62[_0x42ef('0x3a')][_0x42ef('0x2a')]);}return _0x4020d6[_0x42ef('0x57')](_0x1dd495);}})[_0x42ef('0x1c')](function(_0x3f8b8c){if(_0x3f8b8c){return _0x3f8b8c?{'count':_0x295cc4,'rows':_0x3f8b8c}:null;}})['then'](respondWithResult(_0x293417,null))[_0x42ef('0x25')](handleError(_0x293417,null));};exports['getSubjects']=function(_0x514b89,_0x1488ed,_0x142e95){var _0x44f533={};var _0x18b752={};var _0x527766;var _0x1f18cb;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x514b89[_0x42ef('0x4b')]['id']}})[_0x42ef('0x1c')](handleEntityNotFound(_0x1488ed,null))[_0x42ef('0x1c')](function(_0x384b75){if(_0x384b75){_0x527766=_0x384b75;_0x18b752[_0x42ef('0x39')]=_[_0x42ef('0x3b')](db[_0x42ef('0x52')][_0x42ef('0x53')]);_0x18b752[_0x42ef('0x3a')]=_['keys'](_0x514b89[_0x42ef('0x3a')]);_0x18b752[_0x42ef('0x3c')]=_[_0x42ef('0x3d')](_0x18b752[_0x42ef('0x39')],_0x18b752[_0x42ef('0x3a')]);_0x44f533[_0x42ef('0x3e')]=_['intersection'](_0x18b752[_0x42ef('0x39')],qs['fields'](_0x514b89[_0x42ef('0x3a')]['fields']));_0x44f533[_0x42ef('0x3e')]=_0x44f533[_0x42ef('0x3e')][_0x42ef('0x54')]?_0x44f533[_0x42ef('0x3e')]:_0x18b752[_0x42ef('0x39')];_0x44f533['order']=qs[_0x42ef('0x42')](_0x514b89[_0x42ef('0x3a')][_0x42ef('0x42')]);_0x44f533[_0x42ef('0x44')]=qs[_0x42ef('0x3c')](_[_0x42ef('0x56')](_0x514b89['query'],_0x18b752[_0x42ef('0x3c')]));if(_0x514b89[_0x42ef('0x3a')]['filter']){_0x44f533[_0x42ef('0x44')]=_[_0x42ef('0x45')](_0x44f533[_0x42ef('0x44')],{'$or':_[_0x42ef('0x36')](_0x44f533[_0x42ef('0x3e')],function(_0x5a16e4){var _0x2b3a30={};_0x2b3a30[_0x5a16e4]={'$like':'%'+_0x514b89[_0x42ef('0x3a')][_0x42ef('0x43')]+'%'};return _0x2b3a30;})});}_0x44f533=_['merge']({},_0x44f533,_0x514b89[_0x42ef('0x4c')]);return _0x527766[_0x42ef('0x58')](_0x44f533);}})[_0x42ef('0x1c')](function(_0x5d5330){if(_0x5d5330){_0x1f18cb=_0x5d5330[_0x42ef('0x54')];if(!_0x514b89['query'][_0x42ef('0x40')](_0x42ef('0x41'))){_0x44f533['limit']=qs[_0x42ef('0x2b')](_0x514b89[_0x42ef('0x3a')][_0x42ef('0x2b')]);_0x44f533[_0x42ef('0x2a')]=qs['offset'](_0x514b89['query'][_0x42ef('0x2a')]);}return _0x527766[_0x42ef('0x58')](_0x44f533);}})[_0x42ef('0x1c')](function(_0x44fc89){if(_0x44fc89){return _0x44fc89?{'count':_0x1f18cb,'rows':_0x44fc89}:null;}})[_0x42ef('0x1c')](respondWithResult(_0x1488ed,null))[_0x42ef('0x25')](handleError(_0x1488ed,null));};exports[_0x42ef('0x59')]=function(_0x355624,_0x3574cf,_0x4080b5){var _0x3789e3={};var _0x1e545a={};var _0x351614;var _0x13b730;return db[_0x42ef('0x37')][_0x42ef('0x51')]({'where':{'id':_0x355624[_0x42ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3574cf,null))[_0x42ef('0x1c')](function(_0x11fd43){if(_0x11fd43){_0x351614=_0x11fd43;_0x1e545a['model']=_['keys'](db[_0x42ef('0x52')][_0x42ef('0x53')]);_0x1e545a['query']=_[_0x42ef('0x3b')](_0x355624[_0x42ef('0x3a')]);_0x1e545a[_0x42ef('0x3c')]=_['intersection'](_0x1e545a[_0x42ef('0x39')],_0x1e545a[_0x42ef('0x3a')]);_0x3789e3[_0x42ef('0x3e')]=_[_0x42ef('0x3d')](_0x1e545a['model'],qs[_0x42ef('0x3f')](_0x355624[_0x42ef('0x3a')][_0x42ef('0x3f')]));_0x3789e3['attributes']=_0x3789e3[_0x42ef('0x3e')][_0x42ef('0x54')]?_0x3789e3[_0x42ef('0x3e')]:_0x1e545a[_0x42ef('0x39')];_0x3789e3[_0x42ef('0x55')]=qs[_0x42ef('0x42')](_0x355624[_0x42ef('0x3a')]['sort']);_0x3789e3['where']=qs[_0x42ef('0x3c')](_['pick'](_0x355624[_0x42ef('0x3a')],_0x1e545a['filters']));if(_0x355624[_0x42ef('0x3a')]['filter']){_0x3789e3['where']=_[_0x42ef('0x45')](_0x3789e3[_0x42ef('0x44')],{'$or':_[_0x42ef('0x36')](_0x3789e3[_0x42ef('0x3e')],function(_0x20c76c){var _0x547147={};_0x547147[_0x20c76c]={'$like':'%'+_0x355624[_0x42ef('0x3a')]['filter']+'%'};return _0x547147;})});}_0x3789e3=_[_0x42ef('0x45')]({},_0x3789e3,_0x355624['options']);return _0x351614[_0x42ef('0x59')](_0x3789e3);}})['then'](function(_0x529a40){if(_0x529a40){_0x13b730=_0x529a40[_0x42ef('0x54')];if(!_0x355624['query']['hasOwnProperty']('nolimit')){_0x3789e3[_0x42ef('0x2b')]=qs['limit'](_0x355624[_0x42ef('0x3a')]['limit']);_0x3789e3[_0x42ef('0x2a')]=qs[_0x42ef('0x2a')](_0x355624[_0x42ef('0x3a')][_0x42ef('0x2a')]);}return _0x351614['getDescriptions'](_0x3789e3);}})[_0x42ef('0x1c')](function(_0x1a1eeb){if(_0x1a1eeb){return _0x1a1eeb?{'count':_0x13b730,'rows':_0x1a1eeb}:null;}})[_0x42ef('0x1c')](respondWithResult(_0x3574cf,null))['catch'](handleError(_0x3574cf,null));}; \ No newline at end of file +var _0xb288=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','SugarcrmConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','show','params','options','find','create','body','getFields','findOne','SugarcrmField','length','pick','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','util','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'];(function(_0x1baafc,_0x5d52d2){var _0x155d2f=function(_0x2edd09){while(--_0x2edd09){_0x1baafc['push'](_0x1baafc['shift']());}};_0x155d2f(++_0x5d52d2);}(_0xb288,0x1ae));var _0x8b28=function(_0x4926b0,_0x186923){_0x4926b0=_0x4926b0-0x0;var _0x254f83=_0xb288[_0x4926b0];return _0x254f83;};'use strict';var emlformat=require(_0x8b28('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b28('0x1'));var jsonpatch=require(_0x8b28('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8b28('0x3'));var Mustache=require('mustache');var util=require(_0x8b28('0x4'));var path=require('path');var sox=require(_0x8b28('0x5'));var csv=require(_0x8b28('0x6'));var ejs=require(_0x8b28('0x7'));var fs=require('fs');var fs_extra=require(_0x8b28('0x8'));var _=require(_0x8b28('0x9'));var squel=require(_0x8b28('0xa'));var crypto=require('crypto');var jsforce=require(_0x8b28('0xb'));var deskjs=require(_0x8b28('0xc'));var toCsv=require(_0x8b28('0x6'));var querystring=require(_0x8b28('0xd'));var Papa=require(_0x8b28('0xe'));var Redis=require('ioredis');var authService=require(_0x8b28('0xf'));var qs=require(_0x8b28('0x10'));var as=require(_0x8b28('0x11'));var hardwareService=require(_0x8b28('0x12'));var logger=require(_0x8b28('0x13'))(_0x8b28('0x14'));var utils=require(_0x8b28('0x15'));var config=require(_0x8b28('0x16'));var licenseUtil=require(_0x8b28('0x17'));var db=require(_0x8b28('0x18'))['db'];var jayson=require(_0x8b28('0x19'));var client=jayson[_0x8b28('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd7886e,_0x308131,_0x1a0120,_0x30a592){return new BPromise(function(_0x3f122d,_0xcdc98a){var _0x3b2b5d=_0x30a592||client;return _0x3b2b5d['request'](_0xd7886e,_0x1a0120)[_0x8b28('0x1b')](function(_0x4a3e97){logger[_0x8b28('0x1c')](_0x8b28('0x1d'),_0x308131,_0x8b28('0x1e'));logger[_0x8b28('0x1f')](_0x8b28('0x20'),_0x308131,_0x8b28('0x1e'),JSON['stringify'](_0x4a3e97));if(_0x4a3e97['error']){if(_0x4a3e97['error'][_0x8b28('0x21')]===0x1f4){logger['error'](_0x8b28('0x1d'),_0x308131,_0x4a3e97[_0x8b28('0x22')][_0x8b28('0x23')]);return _0xcdc98a(_0x4a3e97['error'][_0x8b28('0x23')]);}logger[_0x8b28('0x22')](_0x8b28('0x1d'),_0x308131,_0x4a3e97[_0x8b28('0x22')][_0x8b28('0x23')]);return _0x3f122d(_0x4a3e97[_0x8b28('0x22')][_0x8b28('0x23')]);}else{logger[_0x8b28('0x1c')](_0x8b28('0x1d'),_0x308131,_0x8b28('0x1e'));_0x3f122d(_0x4a3e97[_0x8b28('0x24')][_0x8b28('0x23')]);}})[_0x8b28('0x25')](function(_0x215045){logger[_0x8b28('0x22')](_0x8b28('0x1d'),_0x308131,_0x215045);_0xcdc98a(_0x215045);});});}function respondWithStatusCode(_0x52c45e,_0x3df305){_0x3df305=_0x3df305||0xcc;return function(_0xf9b7e1){if(_0xf9b7e1){return _0x52c45e[_0x8b28('0x26')](_0x3df305);}return _0x52c45e[_0x8b28('0x27')](_0x3df305)[_0x8b28('0x28')]();};}function respondWithResult(_0x2967ca,_0x27aac7){_0x27aac7=_0x27aac7||0xc8;return function(_0x4ea43a){if(_0x4ea43a){return _0x2967ca['status'](_0x27aac7)[_0x8b28('0x29')](_0x4ea43a);}};}function respondWithFilteredResult(_0x58811d,_0x4ec727){return function(_0x50b6d6){if(_0x50b6d6){var _0x3cf277=_0x50b6d6[_0x8b28('0x2a')],_0x355da0=_0x4ec727[_0x8b28('0x2b')],_0x545ed7=_0x4ec727[_0x8b28('0x2b')]+_0x4ec727[_0x8b28('0x2c')],_0x38abe7;if(_0x545ed7>=_0x3cf277){_0x545ed7=_0x3cf277;_0x38abe7=0xc8;}else{_0x38abe7=0xce;}_0x58811d['status'](_0x38abe7);return _0x58811d[_0x8b28('0x2d')](_0x8b28('0x2e'),_0x355da0+'-'+_0x545ed7+'/'+_0x3cf277)[_0x8b28('0x29')](_0x50b6d6);}return null;};}function patchUpdates(_0x1fd005){return function(_0x54d7a8){try{jsonpatch[_0x8b28('0x2f')](_0x54d7a8,_0x1fd005,!![]);}catch(_0x1c30d5){return BPromise['reject'](_0x1c30d5);}return _0x54d7a8[_0x8b28('0x30')]();};}function saveUpdates(_0x2d5c0a,_0x47a6ff){return function(_0x3e328f){if(_0x3e328f){return _0x3e328f[_0x8b28('0x31')](_0x2d5c0a)['then'](function(_0x769aef){return _0x769aef;});}return null;};}function removeEntity(_0x99d398,_0x36305f){return function(_0x39b50e){if(_0x39b50e){return _0x39b50e[_0x8b28('0x32')]()[_0x8b28('0x1b')](function(){_0x99d398[_0x8b28('0x27')](0xcc)[_0x8b28('0x28')]();});}};}function handleEntityNotFound(_0x449b33,_0x273de3){return function(_0x1f7acd){if(!_0x1f7acd){_0x449b33[_0x8b28('0x26')](0x194);}return _0x1f7acd;};}function handleError(_0x5ab578,_0x493663){_0x493663=_0x493663||0x1f4;return function(_0x415504){logger[_0x8b28('0x22')](_0x415504[_0x8b28('0x33')]);if(_0x415504['name']){delete _0x415504[_0x8b28('0x34')];}_0x5ab578[_0x8b28('0x27')](_0x493663)[_0x8b28('0x35')](_0x415504);};}exports['index']=function(_0x21e87e,_0x6fe77b){var _0xd4e429={},_0x455ec4={},_0x11f471={'count':0x0,'rows':[]};var _0x14ac85=_['map'](db[_0x8b28('0x36')][_0x8b28('0x37')],function(_0x5ad692){return{'name':_0x5ad692[_0x8b28('0x38')],'type':_0x5ad692[_0x8b28('0x39')]['key']};});_0x455ec4[_0x8b28('0x3a')]=_[_0x8b28('0x3b')](_0x14ac85,_0x8b28('0x34'));_0x455ec4[_0x8b28('0x3c')]=_[_0x8b28('0x3d')](_0x21e87e['query']);_0x455ec4[_0x8b28('0x3e')]=_['intersection'](_0x455ec4[_0x8b28('0x3a')],_0x455ec4[_0x8b28('0x3c')]);_0xd4e429['attributes']=_[_0x8b28('0x3f')](_0x455ec4[_0x8b28('0x3a')],qs[_0x8b28('0x40')](_0x21e87e[_0x8b28('0x3c')][_0x8b28('0x40')]));_0xd4e429['attributes']=_0xd4e429['attributes']['length']?_0xd4e429[_0x8b28('0x41')]:_0x455ec4[_0x8b28('0x3a')];if(!_0x21e87e[_0x8b28('0x3c')][_0x8b28('0x42')](_0x8b28('0x43'))){_0xd4e429[_0x8b28('0x2c')]=qs[_0x8b28('0x2c')](_0x21e87e[_0x8b28('0x3c')][_0x8b28('0x2c')]);_0xd4e429['offset']=qs[_0x8b28('0x2b')](_0x21e87e[_0x8b28('0x3c')]['offset']);}_0xd4e429[_0x8b28('0x44')]=qs[_0x8b28('0x45')](_0x21e87e[_0x8b28('0x3c')][_0x8b28('0x45')]);_0xd4e429[_0x8b28('0x46')]=qs[_0x8b28('0x3e')](_['pick'](_0x21e87e[_0x8b28('0x3c')],_0x455ec4[_0x8b28('0x3e')]),_0x14ac85);if(_0x21e87e[_0x8b28('0x3c')][_0x8b28('0x47')]){_0xd4e429['where']=_[_0x8b28('0x48')](_0xd4e429['where'],{'$or':_[_0x8b28('0x3b')](_0x14ac85,function(_0x4ad7f0){if(_0x4ad7f0[_0x8b28('0x39')]!=='VIRTUAL'){var _0x2c759b={};_0x2c759b[_0x4ad7f0[_0x8b28('0x34')]]={'$like':'%'+_0x21e87e[_0x8b28('0x3c')][_0x8b28('0x47')]+'%'};return _0x2c759b;}})});}_0xd4e429=_[_0x8b28('0x48')]({},_0xd4e429,_0x21e87e['options']);var _0x1975b8={'where':_0xd4e429[_0x8b28('0x46')]};return db['SugarcrmConfiguration'][_0x8b28('0x2a')](_0x1975b8)[_0x8b28('0x1b')](function(_0x54da2a){_0x11f471[_0x8b28('0x2a')]=_0x54da2a;if(_0x21e87e['query'][_0x8b28('0x49')]){_0xd4e429[_0x8b28('0x4a')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x8b28('0x4b')](_0xd4e429);})[_0x8b28('0x1b')](function(_0x881b0){_0x11f471[_0x8b28('0x4c')]=_0x881b0;return _0x11f471;})[_0x8b28('0x1b')](respondWithFilteredResult(_0x6fe77b,_0xd4e429))['catch'](handleError(_0x6fe77b,null));};exports[_0x8b28('0x4d')]=function(_0x45a00a,_0xffec73){var _0x42e4bd={'raw':![],'where':{'id':_0x45a00a[_0x8b28('0x4e')]['id']}},_0x329a45={};_0x329a45[_0x8b28('0x3a')]=_['keys'](db[_0x8b28('0x36')]['rawAttributes']);_0x329a45[_0x8b28('0x3c')]=_[_0x8b28('0x3d')](_0x45a00a['query']);_0x329a45['filters']=_['intersection'](_0x329a45[_0x8b28('0x3a')],_0x329a45[_0x8b28('0x3c')]);_0x42e4bd[_0x8b28('0x41')]=_['intersection'](_0x329a45[_0x8b28('0x3a')],qs[_0x8b28('0x40')](_0x45a00a[_0x8b28('0x3c')]['fields']));_0x42e4bd[_0x8b28('0x41')]=_0x42e4bd[_0x8b28('0x41')]['length']?_0x42e4bd[_0x8b28('0x41')]:_0x329a45['model'];if(_0x45a00a['query']['includeAll']){_0x42e4bd[_0x8b28('0x4a')]=[{'all':!![]}];}_0x42e4bd=_[_0x8b28('0x48')]({},_0x42e4bd,_0x45a00a[_0x8b28('0x4f')]);return db[_0x8b28('0x36')][_0x8b28('0x50')](_0x42e4bd)[_0x8b28('0x1b')](handleEntityNotFound(_0xffec73,null))[_0x8b28('0x1b')](respondWithResult(_0xffec73,null))[_0x8b28('0x25')](handleError(_0xffec73,null));};exports[_0x8b28('0x51')]=function(_0x5ed259,_0x2df8aa){return db[_0x8b28('0x36')][_0x8b28('0x51')](_0x5ed259[_0x8b28('0x52')],{})[_0x8b28('0x1b')](respondWithResult(_0x2df8aa,0xc9))[_0x8b28('0x25')](handleError(_0x2df8aa,null));};exports[_0x8b28('0x31')]=function(_0xff5938,_0xa44aa4){if(_0xff5938['body']['id']){delete _0xff5938[_0x8b28('0x52')]['id'];}return db['SugarcrmConfiguration'][_0x8b28('0x50')]({'where':{'id':_0xff5938[_0x8b28('0x4e')]['id']}})[_0x8b28('0x1b')](handleEntityNotFound(_0xa44aa4,null))[_0x8b28('0x1b')](saveUpdates(_0xff5938[_0x8b28('0x52')],null))[_0x8b28('0x1b')](respondWithResult(_0xa44aa4,null))['catch'](handleError(_0xa44aa4,null));};exports[_0x8b28('0x32')]=function(_0xcf9737,_0x10efe2){return db[_0x8b28('0x36')][_0x8b28('0x50')]({'where':{'id':_0xcf9737['params']['id']}})[_0x8b28('0x1b')](handleEntityNotFound(_0x10efe2,null))['then'](removeEntity(_0x10efe2,null))[_0x8b28('0x25')](handleError(_0x10efe2,null));};exports[_0x8b28('0x53')]=function(_0x39ae2f,_0x22e430,_0x6b31ae){var _0x3d889e={};var _0x3553d5={};var _0x466460;var _0x57630c;return db['SugarcrmConfiguration'][_0x8b28('0x54')]({'where':{'id':_0x39ae2f[_0x8b28('0x4e')]['id']}})['then'](handleEntityNotFound(_0x22e430,null))['then'](function(_0x2c3836){if(_0x2c3836){_0x466460=_0x2c3836;_0x3553d5[_0x8b28('0x3a')]=_[_0x8b28('0x3d')](db[_0x8b28('0x55')][_0x8b28('0x37')]);_0x3553d5[_0x8b28('0x3c')]=_[_0x8b28('0x3d')](_0x39ae2f[_0x8b28('0x3c')]);_0x3553d5[_0x8b28('0x3e')]=_[_0x8b28('0x3f')](_0x3553d5[_0x8b28('0x3a')],_0x3553d5[_0x8b28('0x3c')]);_0x3d889e[_0x8b28('0x41')]=_[_0x8b28('0x3f')](_0x3553d5[_0x8b28('0x3a')],qs[_0x8b28('0x40')](_0x39ae2f[_0x8b28('0x3c')][_0x8b28('0x40')]));_0x3d889e['attributes']=_0x3d889e[_0x8b28('0x41')][_0x8b28('0x56')]?_0x3d889e[_0x8b28('0x41')]:_0x3553d5[_0x8b28('0x3a')];_0x3d889e['order']=qs['sort'](_0x39ae2f[_0x8b28('0x3c')]['sort']);_0x3d889e[_0x8b28('0x46')]=qs[_0x8b28('0x3e')](_[_0x8b28('0x57')](_0x39ae2f[_0x8b28('0x3c')],_0x3553d5[_0x8b28('0x3e')]));if(_0x39ae2f['query']['filter']){_0x3d889e[_0x8b28('0x46')]=_[_0x8b28('0x48')](_0x3d889e[_0x8b28('0x46')],{'$or':_[_0x8b28('0x3b')](_0x3d889e['attributes'],function(_0x1569d3){var _0x387a9f={};_0x387a9f[_0x1569d3]={'$like':'%'+_0x39ae2f[_0x8b28('0x3c')][_0x8b28('0x47')]+'%'};return _0x387a9f;})});}_0x3d889e=_[_0x8b28('0x48')]({},_0x3d889e,_0x39ae2f[_0x8b28('0x4f')]);return _0x466460[_0x8b28('0x53')](_0x3d889e);}})['then'](function(_0x5eff6e){if(_0x5eff6e){_0x57630c=_0x5eff6e[_0x8b28('0x56')];if(!_0x39ae2f['query'][_0x8b28('0x42')](_0x8b28('0x43'))){_0x3d889e[_0x8b28('0x2c')]=qs[_0x8b28('0x2c')](_0x39ae2f[_0x8b28('0x3c')][_0x8b28('0x2c')]);_0x3d889e[_0x8b28('0x2b')]=qs[_0x8b28('0x2b')](_0x39ae2f[_0x8b28('0x3c')][_0x8b28('0x2b')]);}return _0x466460[_0x8b28('0x53')](_0x3d889e);}})['then'](function(_0x1ad481){if(_0x1ad481){return _0x1ad481?{'count':_0x57630c,'rows':_0x1ad481}:null;}})[_0x8b28('0x1b')](respondWithResult(_0x22e430,null))[_0x8b28('0x25')](handleError(_0x22e430,null));};exports[_0x8b28('0x58')]=function(_0x550d76,_0x3191ef,_0x5ac432){var _0x28b3e0={};var _0x3ad2d6={};var _0x209cd7;var _0x556f03;return db['SugarcrmConfiguration'][_0x8b28('0x54')]({'where':{'id':_0x550d76[_0x8b28('0x4e')]['id']}})[_0x8b28('0x1b')](handleEntityNotFound(_0x3191ef,null))['then'](function(_0x585c93){if(_0x585c93){_0x209cd7=_0x585c93;_0x3ad2d6['model']=_['keys'](db['SugarcrmField'][_0x8b28('0x37')]);_0x3ad2d6[_0x8b28('0x3c')]=_[_0x8b28('0x3d')](_0x550d76['query']);_0x3ad2d6[_0x8b28('0x3e')]=_['intersection'](_0x3ad2d6['model'],_0x3ad2d6[_0x8b28('0x3c')]);_0x28b3e0[_0x8b28('0x41')]=_[_0x8b28('0x3f')](_0x3ad2d6[_0x8b28('0x3a')],qs[_0x8b28('0x40')](_0x550d76[_0x8b28('0x3c')][_0x8b28('0x40')]));_0x28b3e0[_0x8b28('0x41')]=_0x28b3e0['attributes'][_0x8b28('0x56')]?_0x28b3e0[_0x8b28('0x41')]:_0x3ad2d6[_0x8b28('0x3a')];_0x28b3e0['order']=qs[_0x8b28('0x45')](_0x550d76['query']['sort']);_0x28b3e0[_0x8b28('0x46')]=qs[_0x8b28('0x3e')](_[_0x8b28('0x57')](_0x550d76[_0x8b28('0x3c')],_0x3ad2d6[_0x8b28('0x3e')]));if(_0x550d76[_0x8b28('0x3c')]['filter']){_0x28b3e0[_0x8b28('0x46')]=_[_0x8b28('0x48')](_0x28b3e0[_0x8b28('0x46')],{'$or':_[_0x8b28('0x3b')](_0x28b3e0[_0x8b28('0x41')],function(_0x351726){var _0x17bcb3={};_0x17bcb3[_0x351726]={'$like':'%'+_0x550d76[_0x8b28('0x3c')][_0x8b28('0x47')]+'%'};return _0x17bcb3;})});}_0x28b3e0=_[_0x8b28('0x48')]({},_0x28b3e0,_0x550d76[_0x8b28('0x4f')]);return _0x209cd7[_0x8b28('0x58')](_0x28b3e0);}})[_0x8b28('0x1b')](function(_0x4e2294){if(_0x4e2294){_0x556f03=_0x4e2294['length'];if(!_0x550d76[_0x8b28('0x3c')]['hasOwnProperty'](_0x8b28('0x43'))){_0x28b3e0[_0x8b28('0x2c')]=qs['limit'](_0x550d76[_0x8b28('0x3c')][_0x8b28('0x2c')]);_0x28b3e0[_0x8b28('0x2b')]=qs[_0x8b28('0x2b')](_0x550d76[_0x8b28('0x3c')][_0x8b28('0x2b')]);}return _0x209cd7[_0x8b28('0x58')](_0x28b3e0);}})['then'](function(_0x256255){if(_0x256255){return _0x256255?{'count':_0x556f03,'rows':_0x256255}:null;}})['then'](respondWithResult(_0x3191ef,null))['catch'](handleError(_0x3191ef,null));};exports[_0x8b28('0x59')]=function(_0x39b04d,_0x4de3de,_0x10e462){var _0xcbc44d={};var _0x4ffadb={};var _0x27d659;var _0x4576e4;return db[_0x8b28('0x36')][_0x8b28('0x54')]({'where':{'id':_0x39b04d[_0x8b28('0x4e')]['id']}})[_0x8b28('0x1b')](handleEntityNotFound(_0x4de3de,null))['then'](function(_0xa76d3){if(_0xa76d3){_0x27d659=_0xa76d3;_0x4ffadb[_0x8b28('0x3a')]=_[_0x8b28('0x3d')](db['SugarcrmField'][_0x8b28('0x37')]);_0x4ffadb[_0x8b28('0x3c')]=_[_0x8b28('0x3d')](_0x39b04d[_0x8b28('0x3c')]);_0x4ffadb['filters']=_['intersection'](_0x4ffadb[_0x8b28('0x3a')],_0x4ffadb[_0x8b28('0x3c')]);_0xcbc44d[_0x8b28('0x41')]=_[_0x8b28('0x3f')](_0x4ffadb['model'],qs[_0x8b28('0x40')](_0x39b04d[_0x8b28('0x3c')]['fields']));_0xcbc44d['attributes']=_0xcbc44d['attributes'][_0x8b28('0x56')]?_0xcbc44d[_0x8b28('0x41')]:_0x4ffadb['model'];_0xcbc44d[_0x8b28('0x44')]=qs[_0x8b28('0x45')](_0x39b04d[_0x8b28('0x3c')]['sort']);_0xcbc44d[_0x8b28('0x46')]=qs[_0x8b28('0x3e')](_['pick'](_0x39b04d[_0x8b28('0x3c')],_0x4ffadb['filters']));if(_0x39b04d['query'][_0x8b28('0x47')]){_0xcbc44d[_0x8b28('0x46')]=_[_0x8b28('0x48')](_0xcbc44d[_0x8b28('0x46')],{'$or':_['map'](_0xcbc44d['attributes'],function(_0x3785d5){var _0x2f03a1={};_0x2f03a1[_0x3785d5]={'$like':'%'+_0x39b04d[_0x8b28('0x3c')][_0x8b28('0x47')]+'%'};return _0x2f03a1;})});}_0xcbc44d=_[_0x8b28('0x48')]({},_0xcbc44d,_0x39b04d[_0x8b28('0x4f')]);return _0x27d659[_0x8b28('0x59')](_0xcbc44d);}})[_0x8b28('0x1b')](function(_0x4f537b){if(_0x4f537b){_0x4576e4=_0x4f537b[_0x8b28('0x56')];if(!_0x39b04d['query'][_0x8b28('0x42')](_0x8b28('0x43'))){_0xcbc44d['limit']=qs[_0x8b28('0x2c')](_0x39b04d[_0x8b28('0x3c')][_0x8b28('0x2c')]);_0xcbc44d['offset']=qs[_0x8b28('0x2b')](_0x39b04d[_0x8b28('0x3c')][_0x8b28('0x2b')]);}return _0x27d659[_0x8b28('0x59')](_0xcbc44d);}})[_0x8b28('0x1b')](function(_0x2d58cf){if(_0x2d58cf){return _0x2d58cf?{'count':_0x4576e4,'rows':_0x2d58cf}:null;}})[_0x8b28('0x1b')](respondWithResult(_0x4de3de,null))[_0x8b28('0x25')](handleError(_0x4de3de,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 8e87de6..15b7a0d 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 _0x1db0=['request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x56e2ac,_0x176706){var _0x3aac5b=function(_0x3850e8){while(--_0x3850e8){_0x56e2ac['push'](_0x56e2ac['shift']());}};_0x3aac5b(++_0x176706);}(_0x1db0,0x14a));var _0x01db=function(_0x3c3e72,_0x3e1858){_0x3c3e72=_0x3c3e72-0x0;var _0x48a7e5=_0x1db0[_0x3c3e72];return _0x48a7e5;};'use strict';var _=require(_0x01db('0x0'));var util=require(_0x01db('0x1'));var logger=require(_0x01db('0x2'))(_0x01db('0x3'));var moment=require(_0x01db('0x4'));var BPromise=require(_0x01db('0x5'));var rp=require(_0x01db('0x6'));var fs=require('fs');var path=require(_0x01db('0x7'));var rimraf=require(_0x01db('0x8'));var config=require(_0x01db('0x9'));var attributes=require(_0x01db('0xa'));module['exports']=function(_0x3f7d28,_0x9516c){return _0x3f7d28[_0x01db('0xb')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd48c=['exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','moment','bluebird','rimraf'];(function(_0x30464b,_0x5c2178){var _0x132696=function(_0x3ed111){while(--_0x3ed111){_0x30464b['push'](_0x30464b['shift']());}};_0x132696(++_0x5c2178);}(_0xd48c,0x18a));var _0xcd48=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0xd48c[_0x52e363];return _0x3fc2b5;};'use strict';var _=require(_0xcd48('0x0'));var util=require(_0xcd48('0x1'));var logger=require('../../config/logger')(_0xcd48('0x2'));var moment=require(_0xcd48('0x3'));var BPromise=require(_0xcd48('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcd48('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xcd48('0x6')]=function(_0x3bb75d,_0x18e9d9){return _0x3bb75d[_0xcd48('0x7')](_0xcd48('0x8'),attributes,{'tableName':_0xcd48('0x9'),'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 8e881e9..29412f7 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 _0xb8e3=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info'];(function(_0x3ea765,_0x4593f6){var _0x201138=function(_0x25a2e2){while(--_0x25a2e2){_0x3ea765['push'](_0x3ea765['shift']());}};_0x201138(++_0x4593f6);}(_0xb8e3,0x1c4));var _0x3b8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb8e3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3b8e('0x0'));var util=require(_0x3b8e('0x1'));var moment=require('moment');var BPromise=require(_0x3b8e('0x2'));var rs=require(_0x3b8e('0x3'));var fs=require('fs');var Redis=require(_0x3b8e('0x4'));var db=require(_0x3b8e('0x5'))['db'];var utils=require(_0x3b8e('0x6'));var logger=require(_0x3b8e('0x7'))(_0x3b8e('0x8'));var config=require(_0x3b8e('0x9'));var jayson=require(_0x3b8e('0xa'));var client=jayson[_0x3b8e('0xb')][_0x3b8e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e49a6,_0x872a50,_0x5cd94d){return new BPromise(function(_0x145352,_0xd59795){return client[_0x3b8e('0xd')](_0x3e49a6,_0x5cd94d)['then'](function(_0x4dfa20){logger['info'](_0x3b8e('0xe'),_0x872a50,_0x3b8e('0xf'));logger[_0x3b8e('0x10')](_0x3b8e('0x11'),_0x872a50,'request\x20sent',JSON[_0x3b8e('0x12')](_0x4dfa20));if(_0x4dfa20['error']){if(_0x4dfa20['error'][_0x3b8e('0x13')]===0x1f4){logger['error'](_0x3b8e('0xe'),_0x872a50,_0x4dfa20['error'][_0x3b8e('0x14')]);return _0xd59795(_0x4dfa20[_0x3b8e('0x15')][_0x3b8e('0x14')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x872a50,_0x4dfa20['error'][_0x3b8e('0x14')]);return _0x145352(_0x4dfa20[_0x3b8e('0x15')][_0x3b8e('0x14')]);}else{logger[_0x3b8e('0x16')](_0x3b8e('0xe'),_0x872a50,_0x3b8e('0xf'));_0x145352(_0x4dfa20[_0x3b8e('0x17')][_0x3b8e('0x14')]);}})[_0x3b8e('0x18')](function(_0x3d9488){logger[_0x3b8e('0x15')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x872a50,_0x3d9488);_0xd59795(_0x3d9488);});});} \ No newline at end of file +var _0x05d8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x44f240,_0x245f33){var _0xedd84e=function(_0x5561aa){while(--_0x5561aa){_0x44f240['push'](_0x44f240['shift']());}};_0xedd84e(++_0x245f33);}(_0x05d8,0x7f));var _0x805d=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x05d8[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0x805d('0x0'));var util=require(_0x805d('0x1'));var moment=require(_0x805d('0x2'));var BPromise=require(_0x805d('0x3'));var rs=require(_0x805d('0x4'));var fs=require('fs');var Redis=require(_0x805d('0x5'));var db=require(_0x805d('0x6'))['db'];var utils=require(_0x805d('0x7'));var logger=require(_0x805d('0x8'))('rpc');var config=require(_0x805d('0x9'));var jayson=require(_0x805d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ec853,_0x35d1e8,_0x1e9e3d){return new BPromise(function(_0x52f7d0,_0x3b6dd4){return client[_0x805d('0xb')](_0x3ec853,_0x1e9e3d)[_0x805d('0xc')](function(_0x4c8833){logger[_0x805d('0xd')](_0x805d('0xe'),_0x35d1e8,_0x805d('0xf'));logger['debug'](_0x805d('0x10'),_0x35d1e8,_0x805d('0xf'),JSON[_0x805d('0x11')](_0x4c8833));if(_0x4c8833[_0x805d('0x12')]){if(_0x4c8833[_0x805d('0x12')][_0x805d('0x13')]===0x1f4){logger[_0x805d('0x12')](_0x805d('0xe'),_0x35d1e8,_0x4c8833[_0x805d('0x12')]['message']);return _0x3b6dd4(_0x4c8833[_0x805d('0x12')][_0x805d('0x14')]);}logger[_0x805d('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x35d1e8,_0x4c8833[_0x805d('0x12')][_0x805d('0x14')]);return _0x52f7d0(_0x4c8833[_0x805d('0x12')][_0x805d('0x14')]);}else{logger['info'](_0x805d('0xe'),_0x35d1e8,'request\x20sent');_0x52f7d0(_0x4c8833['result'][_0x805d('0x14')]);}})[_0x805d('0x15')](function(_0x382c97){logger['error'](_0x805d('0xe'),_0x35d1e8,_0x382c97);_0x3b6dd4(_0x382c97);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index cef20b1..496cf9d 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 _0x84d8=['create','update','delete','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','show','post'];(function(_0x16a407,_0x378a23){var _0x73e38e=function(_0x345907){while(--_0x345907){_0x16a407['push'](_0x16a407['shift']());}};_0x73e38e(++_0x378a23);}(_0x84d8,0x8b));var _0x884d=function(_0x5de9a0,_0x1a23ef){_0x5de9a0=_0x5de9a0-0x0;var _0x4b75ec=_0x84d8[_0x5de9a0];return _0x4b75ec;};'use strict';var multer=require(_0x884d('0x0'));var util=require(_0x884d('0x1'));var path=require(_0x884d('0x2'));var timeout=require('connect-timeout');var express=require(_0x884d('0x3'));var router=express['Router']();var fs_extra=require(_0x884d('0x4'));var auth=require(_0x884d('0x5'));var interaction=require(_0x884d('0x6'));var config=require(_0x884d('0x7'));var controller=require(_0x884d('0x8'));router[_0x884d('0x9')]('/',auth[_0x884d('0xa')](),controller['index']);router['get']('/:id',auth[_0x884d('0xa')](),controller[_0x884d('0xb')]);router[_0x884d('0xc')]('/',auth['isAuthenticated'](),controller[_0x884d('0xd')]);router['put']('/:id',auth[_0x884d('0xa')](),controller[_0x884d('0xe')]);router[_0x884d('0xf')](_0x884d('0x10'),auth[_0x884d('0xa')](),controller[_0x884d('0x11')]);module[_0x884d('0x12')]=router; \ No newline at end of file +var _0x4ce5=['delete','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','index','get','/:id','isAuthenticated','post','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ce5,0x1b2));var _0x54ce=function(_0x29df62,_0x3c2b42){_0x29df62=_0x29df62-0x0;var _0x44a5f1=_0x4ce5[_0x29df62];return _0x44a5f1;};'use strict';var multer=require(_0x54ce('0x0'));var util=require('util');var path=require(_0x54ce('0x1'));var timeout=require(_0x54ce('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x54ce('0x3'));var auth=require(_0x54ce('0x4'));var interaction=require(_0x54ce('0x5'));var config=require(_0x54ce('0x6'));var controller=require(_0x54ce('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x54ce('0x8')]);router[_0x54ce('0x9')](_0x54ce('0xa'),auth[_0x54ce('0xb')](),controller['show']);router[_0x54ce('0xc')]('/',auth[_0x54ce('0xb')](),controller[_0x54ce('0xd')]);router[_0x54ce('0xe')](_0x54ce('0xa'),auth[_0x54ce('0xb')](),controller[_0x54ce('0xf')]);router[_0x54ce('0x10')](_0x54ce('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x54ce('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index d3e7cae..76da940 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 _0x4ab0=['customVariable','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x4ab0,0xd5));var _0x04ab=function(_0x576be5,_0x3bf4c6){_0x576be5=_0x576be5-0x0;var _0x80fd26=_0x4ab0[_0x576be5];return _0x80fd26;};'use strict';var Sequelize=require('sequelize');module[_0x04ab('0x0')]={'type':{'type':Sequelize[_0x04ab('0x1')](_0x04ab('0x2'),_0x04ab('0x3'),_0x04ab('0x4'),'keyValue','picklist'),'defaultValue':_0x04ab('0x2')},'content':{'type':Sequelize[_0x04ab('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x04ab('0x1')](_0x04ab('0x2'),'variable',_0x04ab('0x4'))},'keyContent':{'type':Sequelize[_0x04ab('0x5')]},'idField':{'type':Sequelize[_0x04ab('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x04ab('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x04ab('0x5')]}}; \ No newline at end of file +var _0xbd50=['STRING','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x32c907,_0x2109e6){var _0x5bd0a9=function(_0x516af2){while(--_0x516af2){_0x32c907['push'](_0x32c907['shift']());}};_0x5bd0a9(++_0x2109e6);}(_0xbd50,0x196));var _0x0bd5=function(_0x512e10,_0xd00c6){_0x512e10=_0x512e10-0x0;var _0x5e7064=_0xbd50[_0x512e10];return _0x5e7064;};'use strict';var Sequelize=require(_0x0bd5('0x0'));module[_0x0bd5('0x1')]={'type':{'type':Sequelize[_0x0bd5('0x2')]('string',_0x0bd5('0x3'),_0x0bd5('0x4'),_0x0bd5('0x5'),_0x0bd5('0x6')),'defaultValue':_0x0bd5('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x0bd5('0x7'),_0x0bd5('0x3'),_0x0bd5('0x4'))},'keyContent':{'type':Sequelize[_0x0bd5('0x8')]},'idField':{'type':Sequelize[_0x0bd5('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0bd5('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 54f1e77..ef9e2ed 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 _0x6ca5=['status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x4f1a5b,_0x53c5f7){var _0x2a0e3a=function(_0x1fdffc){while(--_0x1fdffc){_0x4f1a5b['push'](_0x4f1a5b['shift']());}};_0x2a0e3a(++_0x53c5f7);}(_0x6ca5,0x119));var _0x56ca=function(_0x31458a,_0x2774c3){_0x31458a=_0x31458a-0x0;var _0x157a9b=_0x6ca5[_0x31458a];return _0x157a9b;};'use strict';var emlformat=require(_0x56ca('0x0'));var rimraf=require(_0x56ca('0x1'));var zipdir=require(_0x56ca('0x2'));var jsonpatch=require(_0x56ca('0x3'));var rp=require(_0x56ca('0x4'));var moment=require(_0x56ca('0x5'));var BPromise=require(_0x56ca('0x6'));var Mustache=require('mustache');var util=require(_0x56ca('0x7'));var path=require(_0x56ca('0x8'));var sox=require(_0x56ca('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56ca('0xa'));var _=require(_0x56ca('0xb'));var squel=require(_0x56ca('0xc'));var crypto=require(_0x56ca('0xd'));var jsforce=require(_0x56ca('0xe'));var deskjs=require(_0x56ca('0xf'));var toCsv=require(_0x56ca('0x10'));var querystring=require('querystring');var Papa=require(_0x56ca('0x11'));var Redis=require(_0x56ca('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x56ca('0x13'));var as=require(_0x56ca('0x14'));var hardwareService=require(_0x56ca('0x15'));var logger=require(_0x56ca('0x16'))(_0x56ca('0x17'));var utils=require(_0x56ca('0x18'));var config=require(_0x56ca('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x56ca('0x1a'))['db'];function respondWithStatusCode(_0x246179,_0x19e965){_0x19e965=_0x19e965||0xcc;return function(_0x3d411b){if(_0x3d411b){return _0x246179['sendStatus'](_0x19e965);}return _0x246179[_0x56ca('0x1b')](_0x19e965)[_0x56ca('0x1c')]();};}function respondWithResult(_0x5d55a3,_0x3614ac){_0x3614ac=_0x3614ac||0xc8;return function(_0x1f3f57){if(_0x1f3f57){return _0x5d55a3[_0x56ca('0x1b')](_0x3614ac)[_0x56ca('0x1d')](_0x1f3f57);}};}function respondWithFilteredResult(_0x3517cd,_0x177882){return function(_0x4151f8){if(_0x4151f8){var _0x3fe5b9=_0x4151f8[_0x56ca('0x1e')],_0xaf94d7=_0x177882[_0x56ca('0x1f')],_0x187576=_0x177882[_0x56ca('0x1f')]+_0x177882[_0x56ca('0x20')],_0x53adaa;if(_0x187576>=_0x3fe5b9){_0x187576=_0x3fe5b9;_0x53adaa=0xc8;}else{_0x53adaa=0xce;}_0x3517cd['status'](_0x53adaa);return _0x3517cd[_0x56ca('0x21')](_0x56ca('0x22'),_0xaf94d7+'-'+_0x187576+'/'+_0x3fe5b9)['json'](_0x4151f8);}return null;};}function patchUpdates(_0xc679a2){return function(_0x5453c4){try{jsonpatch[_0x56ca('0x23')](_0x5453c4,_0xc679a2,!![]);}catch(_0x479d29){return BPromise[_0x56ca('0x24')](_0x479d29);}return _0x5453c4[_0x56ca('0x25')]();};}function saveUpdates(_0x41a965,_0x3cb10a){return function(_0x3edcc0){if(_0x3edcc0){return _0x3edcc0[_0x56ca('0x26')](_0x41a965)['then'](function(_0x713820){return _0x713820;});}return null;};}function removeEntity(_0x1647e0,_0x2addf2){return function(_0x4286ba){if(_0x4286ba){return _0x4286ba[_0x56ca('0x27')]()['then'](function(){_0x1647e0[_0x56ca('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x245af3,_0x36a607){return function(_0x13a2e7){if(!_0x13a2e7){_0x245af3[_0x56ca('0x28')](0x194);}return _0x13a2e7;};}function handleError(_0x3d26be,_0x117864){_0x117864=_0x117864||0x1f4;return function(_0x4d567e){logger[_0x56ca('0x29')](_0x4d567e[_0x56ca('0x2a')]);if(_0x4d567e[_0x56ca('0x2b')]){delete _0x4d567e[_0x56ca('0x2b')];}_0x3d26be[_0x56ca('0x1b')](_0x117864)['send'](_0x4d567e);};}exports[_0x56ca('0x2c')]=function(_0x2d8167,_0x2f2ddd){var _0x1420df={},_0x361b3c={},_0x533d5c={'count':0x0,'rows':[]};var _0x2abacb=_['map'](db[_0x56ca('0x2d')][_0x56ca('0x2e')],function(_0x30c1e1){return{'name':_0x30c1e1[_0x56ca('0x2f')],'type':_0x30c1e1[_0x56ca('0x30')][_0x56ca('0x31')]};});_0x361b3c[_0x56ca('0x32')]=_[_0x56ca('0x33')](_0x2abacb,'name');_0x361b3c[_0x56ca('0x34')]=_[_0x56ca('0x35')](_0x2d8167[_0x56ca('0x34')]);_0x361b3c[_0x56ca('0x36')]=_[_0x56ca('0x37')](_0x361b3c[_0x56ca('0x32')],_0x361b3c[_0x56ca('0x34')]);_0x1420df[_0x56ca('0x38')]=_[_0x56ca('0x37')](_0x361b3c[_0x56ca('0x32')],qs[_0x56ca('0x39')](_0x2d8167[_0x56ca('0x34')][_0x56ca('0x39')]));_0x1420df[_0x56ca('0x38')]=_0x1420df[_0x56ca('0x38')][_0x56ca('0x3a')]?_0x1420df[_0x56ca('0x38')]:_0x361b3c[_0x56ca('0x32')];if(!_0x2d8167[_0x56ca('0x34')][_0x56ca('0x3b')](_0x56ca('0x3c'))){_0x1420df['limit']=qs[_0x56ca('0x20')](_0x2d8167[_0x56ca('0x34')][_0x56ca('0x20')]);_0x1420df['offset']=qs[_0x56ca('0x1f')](_0x2d8167['query'][_0x56ca('0x1f')]);}_0x1420df[_0x56ca('0x3d')]=qs['sort'](_0x2d8167[_0x56ca('0x34')][_0x56ca('0x3e')]);_0x1420df[_0x56ca('0x3f')]=qs['filters'](_['pick'](_0x2d8167[_0x56ca('0x34')],_0x361b3c[_0x56ca('0x36')]),_0x2abacb);if(_0x2d8167[_0x56ca('0x34')][_0x56ca('0x40')]){_0x1420df['where']=_[_0x56ca('0x41')](_0x1420df[_0x56ca('0x3f')],{'$or':_[_0x56ca('0x33')](_0x2abacb,function(_0x1c8261){if(_0x1c8261['type']!==_0x56ca('0x42')){var _0x3bf063={};_0x3bf063[_0x1c8261[_0x56ca('0x2b')]]={'$like':'%'+_0x2d8167[_0x56ca('0x34')][_0x56ca('0x40')]+'%'};return _0x3bf063;}})});}_0x1420df=_[_0x56ca('0x41')]({},_0x1420df,_0x2d8167['options']);var _0xd942d1={'where':_0x1420df[_0x56ca('0x3f')]};return db['SugarcrmField'][_0x56ca('0x1e')](_0xd942d1)[_0x56ca('0x43')](function(_0x4a1e6b){_0x533d5c[_0x56ca('0x1e')]=_0x4a1e6b;if(_0x2d8167[_0x56ca('0x34')][_0x56ca('0x44')]){_0x1420df[_0x56ca('0x45')]=[{'all':!![]}];}return db[_0x56ca('0x2d')][_0x56ca('0x46')](_0x1420df);})[_0x56ca('0x43')](function(_0x56cc9e){_0x533d5c[_0x56ca('0x47')]=_0x56cc9e;return _0x533d5c;})['then'](respondWithFilteredResult(_0x2f2ddd,_0x1420df))['catch'](handleError(_0x2f2ddd,null));};exports['show']=function(_0x2a4b63,_0x438308){var _0x41174c={'raw':!![],'where':{'id':_0x2a4b63[_0x56ca('0x48')]['id']}},_0x10904f={};_0x10904f[_0x56ca('0x32')]=_[_0x56ca('0x35')](db[_0x56ca('0x2d')][_0x56ca('0x2e')]);_0x10904f[_0x56ca('0x34')]=_[_0x56ca('0x35')](_0x2a4b63[_0x56ca('0x34')]);_0x10904f[_0x56ca('0x36')]=_[_0x56ca('0x37')](_0x10904f['model'],_0x10904f[_0x56ca('0x34')]);_0x41174c['attributes']=_[_0x56ca('0x37')](_0x10904f[_0x56ca('0x32')],qs[_0x56ca('0x39')](_0x2a4b63[_0x56ca('0x34')][_0x56ca('0x39')]));_0x41174c[_0x56ca('0x38')]=_0x41174c[_0x56ca('0x38')][_0x56ca('0x3a')]?_0x41174c['attributes']:_0x10904f[_0x56ca('0x32')];if(_0x2a4b63[_0x56ca('0x34')][_0x56ca('0x44')]){_0x41174c[_0x56ca('0x45')]=[{'all':!![]}];}_0x41174c=_[_0x56ca('0x41')]({},_0x41174c,_0x2a4b63['options']);return db['SugarcrmField'][_0x56ca('0x49')](_0x41174c)[_0x56ca('0x43')](handleEntityNotFound(_0x438308,null))['then'](respondWithResult(_0x438308,null))[_0x56ca('0x4a')](handleError(_0x438308,null));};exports[_0x56ca('0x4b')]=function(_0x4e8a77,_0x2db84c){return db[_0x56ca('0x2d')][_0x56ca('0x4b')](_0x4e8a77['body'],{})[_0x56ca('0x43')](respondWithResult(_0x2db84c,0xc9))[_0x56ca('0x4a')](handleError(_0x2db84c,null));};exports['update']=function(_0x25d446,_0x522d20){if(_0x25d446['body']['id']){delete _0x25d446[_0x56ca('0x4c')]['id'];}return db[_0x56ca('0x2d')][_0x56ca('0x49')]({'where':{'id':_0x25d446[_0x56ca('0x48')]['id']}})[_0x56ca('0x43')](handleEntityNotFound(_0x522d20,null))[_0x56ca('0x43')](saveUpdates(_0x25d446[_0x56ca('0x4c')],null))[_0x56ca('0x43')](respondWithResult(_0x522d20,null))[_0x56ca('0x4a')](handleError(_0x522d20,null));};exports[_0x56ca('0x27')]=function(_0x9de875,_0xe38bff){return db[_0x56ca('0x2d')][_0x56ca('0x49')]({'where':{'id':_0x9de875[_0x56ca('0x48')]['id']}})[_0x56ca('0x43')](handleEntityNotFound(_0xe38bff,null))[_0x56ca('0x43')](removeEntity(_0xe38bff,null))[_0x56ca('0x4a')](handleError(_0xe38bff,null));}; \ No newline at end of file +var _0x27f7=['jsforce','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','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','lodash','squel','crypto'];(function(_0x37bcd8,_0x27bed9){var _0x422480=function(_0x510db3){while(--_0x510db3){_0x37bcd8['push'](_0x37bcd8['shift']());}};_0x422480(++_0x27bed9);}(_0x27f7,0xcc));var _0x727f=function(_0x2f916e,_0x11011d){_0x2f916e=_0x2f916e-0x0;var _0x3eb589=_0x27f7[_0x2f916e];return _0x3eb589;};'use strict';var emlformat=require(_0x727f('0x0'));var rimraf=require(_0x727f('0x1'));var zipdir=require(_0x727f('0x2'));var jsonpatch=require(_0x727f('0x3'));var rp=require(_0x727f('0x4'));var moment=require('moment');var BPromise=require(_0x727f('0x5'));var Mustache=require('mustache');var util=require(_0x727f('0x6'));var path=require(_0x727f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x727f('0x8'));var _=require(_0x727f('0x9'));var squel=require(_0x727f('0xa'));var crypto=require(_0x727f('0xb'));var jsforce=require(_0x727f('0xc'));var deskjs=require(_0x727f('0xd'));var toCsv=require(_0x727f('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x727f('0xf'));var authService=require(_0x727f('0x10'));var qs=require(_0x727f('0x11'));var as=require(_0x727f('0x12'));var hardwareService=require(_0x727f('0x13'));var logger=require(_0x727f('0x14'))(_0x727f('0x15'));var utils=require(_0x727f('0x16'));var config=require(_0x727f('0x17'));var licenseUtil=require(_0x727f('0x18'));var db=require(_0x727f('0x19'))['db'];function respondWithStatusCode(_0x3a41d0,_0x27685f){_0x27685f=_0x27685f||0xcc;return function(_0x53a43e){if(_0x53a43e){return _0x3a41d0[_0x727f('0x1a')](_0x27685f);}return _0x3a41d0[_0x727f('0x1b')](_0x27685f)[_0x727f('0x1c')]();};}function respondWithResult(_0x3da157,_0x4e806a){_0x4e806a=_0x4e806a||0xc8;return function(_0x2fedf1){if(_0x2fedf1){return _0x3da157['status'](_0x4e806a)['json'](_0x2fedf1);}};}function respondWithFilteredResult(_0x548d7a,_0x418a37){return function(_0x2e7037){if(_0x2e7037){var _0x5716cb=_0x2e7037[_0x727f('0x1d')],_0x1ed186=_0x418a37['offset'],_0x3dd7e5=_0x418a37[_0x727f('0x1e')]+_0x418a37[_0x727f('0x1f')],_0x3a026a;if(_0x3dd7e5>=_0x5716cb){_0x3dd7e5=_0x5716cb;_0x3a026a=0xc8;}else{_0x3a026a=0xce;}_0x548d7a[_0x727f('0x1b')](_0x3a026a);return _0x548d7a['set'](_0x727f('0x20'),_0x1ed186+'-'+_0x3dd7e5+'/'+_0x5716cb)[_0x727f('0x21')](_0x2e7037);}return null;};}function patchUpdates(_0x2a5557){return function(_0x49bca2){try{jsonpatch['apply'](_0x49bca2,_0x2a5557,!![]);}catch(_0x1583cf){return BPromise[_0x727f('0x22')](_0x1583cf);}return _0x49bca2[_0x727f('0x23')]();};}function saveUpdates(_0x4777d6,_0x264cbf){return function(_0x50805b){if(_0x50805b){return _0x50805b[_0x727f('0x24')](_0x4777d6)[_0x727f('0x25')](function(_0x5748d6){return _0x5748d6;});}return null;};}function removeEntity(_0xf1f1fc,_0x33ac4d){return function(_0x1e0813){if(_0x1e0813){return _0x1e0813[_0x727f('0x26')]()['then'](function(){_0xf1f1fc[_0x727f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bcaed,_0x53620e){return function(_0x2d6ef0){if(!_0x2d6ef0){_0x5bcaed[_0x727f('0x1a')](0x194);}return _0x2d6ef0;};}function handleError(_0x56cfa2,_0x41b7c1){_0x41b7c1=_0x41b7c1||0x1f4;return function(_0x29d5f2){logger[_0x727f('0x27')](_0x29d5f2[_0x727f('0x28')]);if(_0x29d5f2[_0x727f('0x29')]){delete _0x29d5f2[_0x727f('0x29')];}_0x56cfa2['status'](_0x41b7c1)[_0x727f('0x2a')](_0x29d5f2);};}exports[_0x727f('0x2b')]=function(_0x541bb4,_0x29442f){var _0x3ef439={},_0xa1be9={},_0x3d72ee={'count':0x0,'rows':[]};var _0xf03e05=_[_0x727f('0x2c')](db[_0x727f('0x2d')]['rawAttributes'],function(_0x56255f){return{'name':_0x56255f[_0x727f('0x2e')],'type':_0x56255f['type']['key']};});_0xa1be9[_0x727f('0x2f')]=_[_0x727f('0x2c')](_0xf03e05,_0x727f('0x29'));_0xa1be9[_0x727f('0x30')]=_['keys'](_0x541bb4[_0x727f('0x30')]);_0xa1be9[_0x727f('0x31')]=_[_0x727f('0x32')](_0xa1be9[_0x727f('0x2f')],_0xa1be9[_0x727f('0x30')]);_0x3ef439[_0x727f('0x33')]=_[_0x727f('0x32')](_0xa1be9[_0x727f('0x2f')],qs[_0x727f('0x34')](_0x541bb4[_0x727f('0x30')][_0x727f('0x34')]));_0x3ef439[_0x727f('0x33')]=_0x3ef439[_0x727f('0x33')][_0x727f('0x35')]?_0x3ef439[_0x727f('0x33')]:_0xa1be9[_0x727f('0x2f')];if(!_0x541bb4['query']['hasOwnProperty'](_0x727f('0x36'))){_0x3ef439[_0x727f('0x1f')]=qs[_0x727f('0x1f')](_0x541bb4[_0x727f('0x30')][_0x727f('0x1f')]);_0x3ef439[_0x727f('0x1e')]=qs[_0x727f('0x1e')](_0x541bb4['query']['offset']);}_0x3ef439[_0x727f('0x37')]=qs[_0x727f('0x38')](_0x541bb4[_0x727f('0x30')][_0x727f('0x38')]);_0x3ef439[_0x727f('0x39')]=qs['filters'](_['pick'](_0x541bb4[_0x727f('0x30')],_0xa1be9[_0x727f('0x31')]),_0xf03e05);if(_0x541bb4['query']['filter']){_0x3ef439[_0x727f('0x39')]=_[_0x727f('0x3a')](_0x3ef439[_0x727f('0x39')],{'$or':_[_0x727f('0x2c')](_0xf03e05,function(_0x522fa6){if(_0x522fa6['type']!==_0x727f('0x3b')){var _0x34af3a={};_0x34af3a[_0x522fa6[_0x727f('0x29')]]={'$like':'%'+_0x541bb4[_0x727f('0x30')][_0x727f('0x3c')]+'%'};return _0x34af3a;}})});}_0x3ef439=_[_0x727f('0x3a')]({},_0x3ef439,_0x541bb4[_0x727f('0x3d')]);var _0x4a3f03={'where':_0x3ef439[_0x727f('0x39')]};return db[_0x727f('0x2d')][_0x727f('0x1d')](_0x4a3f03)[_0x727f('0x25')](function(_0x3b9121){_0x3d72ee[_0x727f('0x1d')]=_0x3b9121;if(_0x541bb4[_0x727f('0x30')]['includeAll']){_0x3ef439[_0x727f('0x3e')]=[{'all':!![]}];}return db[_0x727f('0x2d')][_0x727f('0x3f')](_0x3ef439);})[_0x727f('0x25')](function(_0x4de4c1){_0x3d72ee[_0x727f('0x40')]=_0x4de4c1;return _0x3d72ee;})[_0x727f('0x25')](respondWithFilteredResult(_0x29442f,_0x3ef439))[_0x727f('0x41')](handleError(_0x29442f,null));};exports[_0x727f('0x42')]=function(_0xac577,_0x2623c4){var _0x1d0918={'raw':!![],'where':{'id':_0xac577['params']['id']}},_0x251364={};_0x251364[_0x727f('0x2f')]=_['keys'](db[_0x727f('0x2d')]['rawAttributes']);_0x251364[_0x727f('0x30')]=_[_0x727f('0x43')](_0xac577[_0x727f('0x30')]);_0x251364[_0x727f('0x31')]=_[_0x727f('0x32')](_0x251364[_0x727f('0x2f')],_0x251364[_0x727f('0x30')]);_0x1d0918['attributes']=_['intersection'](_0x251364['model'],qs['fields'](_0xac577[_0x727f('0x30')][_0x727f('0x34')]));_0x1d0918['attributes']=_0x1d0918[_0x727f('0x33')][_0x727f('0x35')]?_0x1d0918[_0x727f('0x33')]:_0x251364[_0x727f('0x2f')];if(_0xac577[_0x727f('0x30')]['includeAll']){_0x1d0918[_0x727f('0x3e')]=[{'all':!![]}];}_0x1d0918=_[_0x727f('0x3a')]({},_0x1d0918,_0xac577['options']);return db[_0x727f('0x2d')][_0x727f('0x44')](_0x1d0918)['then'](handleEntityNotFound(_0x2623c4,null))[_0x727f('0x25')](respondWithResult(_0x2623c4,null))[_0x727f('0x41')](handleError(_0x2623c4,null));};exports[_0x727f('0x45')]=function(_0x5ef5d2,_0x2f067c){return db[_0x727f('0x2d')]['create'](_0x5ef5d2[_0x727f('0x46')],{})[_0x727f('0x25')](respondWithResult(_0x2f067c,0xc9))['catch'](handleError(_0x2f067c,null));};exports[_0x727f('0x24')]=function(_0x426813,_0x37c93d){if(_0x426813[_0x727f('0x46')]['id']){delete _0x426813[_0x727f('0x46')]['id'];}return db[_0x727f('0x2d')][_0x727f('0x44')]({'where':{'id':_0x426813[_0x727f('0x47')]['id']}})[_0x727f('0x25')](handleEntityNotFound(_0x37c93d,null))['then'](saveUpdates(_0x426813[_0x727f('0x46')],null))[_0x727f('0x25')](respondWithResult(_0x37c93d,null))[_0x727f('0x41')](handleError(_0x37c93d,null));};exports['destroy']=function(_0x498de5,_0x1f3833){return db[_0x727f('0x2d')]['find']({'where':{'id':_0x498de5[_0x727f('0x47')]['id']}})[_0x727f('0x25')](handleEntityNotFound(_0x1f3833,null))[_0x727f('0x25')](removeEntity(_0x1f3833,null))['catch'](handleError(_0x1f3833,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 5a4a191..f5d601a 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 _0xde17=['exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes'];(function(_0x2850c0,_0x1363a7){var _0x21e830=function(_0x3ec70a){while(--_0x3ec70a){_0x2850c0['push'](_0x2850c0['shift']());}};_0x21e830(++_0x1363a7);}(_0xde17,0x19b));var _0x7de1=function(_0x1cf529,_0x3bc3cc){_0x1cf529=_0x1cf529-0x0;var _0x26e475=_0xde17[_0x1cf529];return _0x26e475;};'use strict';var _=require(_0x7de1('0x0'));var util=require(_0x7de1('0x1'));var logger=require(_0x7de1('0x2'))(_0x7de1('0x3'));var moment=require('moment');var BPromise=require(_0x7de1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7de1('0x5'));var rimraf=require(_0x7de1('0x6'));var config=require(_0x7de1('0x7'));var attributes=require(_0x7de1('0x8'));module[_0x7de1('0x9')]=function(_0x228623,_0x2c562c){return _0x228623['define'](_0x7de1('0xa'),attributes,{'tableName':_0x7de1('0xb'),'paranoid':![],'indexes':[{'name':_0x7de1('0xc'),'fields':[_0x7de1('0xd'),_0x7de1('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4936=['bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x4cd383,_0x3b689f){var _0x14b237=function(_0x2857e2){while(--_0x2857e2){_0x4cd383['push'](_0x4cd383['shift']());}};_0x14b237(++_0x3b689f);}(_0x4936,0x13b));var _0x6493=function(_0x1d8098,_0x3fde27){_0x1d8098=_0x1d8098-0x0;var _0x207f0c=_0x4936[_0x1d8098];return _0x207f0c;};'use strict';var _=require(_0x6493('0x0'));var util=require(_0x6493('0x1'));var logger=require(_0x6493('0x2'))(_0x6493('0x3'));var moment=require(_0x6493('0x4'));var BPromise=require(_0x6493('0x5'));var rp=require(_0x6493('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6493('0x7'));var config=require(_0x6493('0x8'));var attributes=require(_0x6493('0x9'));module[_0x6493('0xa')]=function(_0x50f817,_0x22e6ab){return _0x50f817[_0x6493('0xb')](_0x6493('0xc'),attributes,{'tableName':_0x6493('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x6493('0xe'),_0x6493('0xf')],'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 f8f30d3..1e362cf 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x5478de,_0x82fe9){var _0x475b8f=function(_0x1e3388){while(--_0x1e3388){_0x5478de['push'](_0x5478de['shift']());}};_0x475b8f(++_0x82fe9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4bb172,_0x986e3e){var _0x5ef0f9=function(_0x4b2666){while(--_0x4b2666){_0x4bb172['push'](_0x4bb172['shift']());}};_0x5ef0f9(++_0x986e3e);}(_0xb10b,0x12a));var _0xbb10=function(_0x42e495,_0x49d9da){_0x42e495=_0x42e495-0x0;var _0x595da1=_0xb10b[_0x42e495];return _0x595da1;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 4abd04c..27bf565 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 _0x7da7=['/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/configurations'];(function(_0x22d7e6,_0xa620e7){var _0x72bc58=function(_0x2c75f6){while(--_0x2c75f6){_0x22d7e6['push'](_0x22d7e6['shift']());}};_0x72bc58(++_0xa620e7);}(_0x7da7,0x10d));var _0x77da=function(_0x1943d9,_0x245bb8){_0x1943d9=_0x1943d9-0x0;var _0x4b4f3f=_0x7da7[_0x1943d9];return _0x4b4f3f;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./intVtigerAccount.controller');router[_0x77da('0x7')]('/',auth[_0x77da('0x8')](),controller['index']);router[_0x77da('0x7')]('/:id',auth[_0x77da('0x8')](),controller[_0x77da('0x9')]);router[_0x77da('0x7')](_0x77da('0xa'),auth[_0x77da('0x8')](),controller['getConfigurations']);router[_0x77da('0x7')](_0x77da('0xb'),auth[_0x77da('0x8')](),controller['getFields']);router[_0x77da('0xc')]('/',auth[_0x77da('0x8')](),controller[_0x77da('0xd')]);router[_0x77da('0xc')]('/:id/configurations',auth[_0x77da('0x8')](),controller[_0x77da('0xe')]);router[_0x77da('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x77da('0x10')]);router[_0x77da('0x11')]('/:id',auth[_0x77da('0x8')](),controller[_0x77da('0x12')]);module[_0x77da('0x13')]=router; \ No newline at end of file +var _0xb5fd=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3adaaa,_0x2d681c){var _0x5b675a=function(_0x3d9523){while(--_0x3d9523){_0x3adaaa['push'](_0x3adaaa['shift']());}};_0x5b675a(++_0x2d681c);}(_0xb5fd,0x71));var _0xdb5f=function(_0x144ec5,_0x499f0e){_0x144ec5=_0x144ec5-0x0;var _0x212a7b=_0xb5fd[_0x144ec5];return _0x212a7b;};'use strict';var multer=require('multer');var util=require(_0xdb5f('0x0'));var path=require(_0xdb5f('0x1'));var timeout=require(_0xdb5f('0x2'));var express=require(_0xdb5f('0x3'));var router=express[_0xdb5f('0x4')]();var fs_extra=require(_0xdb5f('0x5'));var auth=require(_0xdb5f('0x6'));var interaction=require(_0xdb5f('0x7'));var config=require(_0xdb5f('0x8'));var controller=require(_0xdb5f('0x9'));router[_0xdb5f('0xa')]('/',auth[_0xdb5f('0xb')](),controller['index']);router['get'](_0xdb5f('0xc'),auth[_0xdb5f('0xb')](),controller[_0xdb5f('0xd')]);router[_0xdb5f('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xdb5f('0xe')]);router[_0xdb5f('0xa')](_0xdb5f('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xdb5f('0x10')]('/',auth[_0xdb5f('0xb')](),controller[_0xdb5f('0x11')]);router[_0xdb5f('0x10')](_0xdb5f('0x12'),auth[_0xdb5f('0xb')](),controller[_0xdb5f('0x13')]);router[_0xdb5f('0x14')](_0xdb5f('0xc'),auth[_0xdb5f('0xb')](),controller[_0xdb5f('0x15')]);router[_0xdb5f('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xdb5f('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 82906de..5427612 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 _0xe202=['exports','STRING','sequelize'];(function(_0x578208,_0x200573){var _0x1ac7a1=function(_0x28c29d){while(--_0x28c29d){_0x578208['push'](_0x578208['shift']());}};_0x1ac7a1(++_0x200573);}(_0xe202,0x194));var _0x2e20=function(_0x3352c5,_0x14ad86){_0x3352c5=_0x3352c5-0x0;var _0x5c9191=_0xe202[_0x3352c5];return _0x5c9191;};'use strict';var Sequelize=require(_0x2e20('0x0'));module[_0x2e20('0x1')]={'name':{'type':Sequelize[_0x2e20('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2e20('0x2')]},'username':{'type':Sequelize[_0x2e20('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x2e20('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2e20('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2e65=['exports','STRING','HelpDesk','sequelize'];(function(_0x6bc26,_0x59d229){var _0x420728=function(_0x419348){while(--_0x419348){_0x6bc26['push'](_0x6bc26['shift']());}};_0x420728(++_0x59d229);}(_0x2e65,0x193));var _0x52e6=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0x2e65[_0x1347f8];return _0x218368;};'use strict';var Sequelize=require(_0x52e6('0x0'));module[_0x52e6('0x1')]={'name':{'type':Sequelize[_0x52e6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x52e6('0x2')]},'username':{'type':Sequelize[_0x52e6('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x52e6('0x2')],'allowNull':![],'defaultValue':_0x52e6('0x3')},'remoteUri':{'type':Sequelize[_0x52e6('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x52e6('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 debfb3e..ec02597 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 _0x9348=['picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','update','destroy','VtigerConfiguration','length','filter','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','POST','login','GET','describe','sessionName','autogenerated','reference','owner','remove','picklist'];(function(_0x5a243a,_0x36d07f){var _0x210c5a=function(_0x596251){while(--_0x596251){_0x5a243a['push'](_0x5a243a['shift']());}};_0x210c5a(++_0x36d07f);}(_0x9348,0x10d));var _0x8934=function(_0x423b58,_0x51b931){_0x423b58=_0x423b58-0x0;var _0x3de544=_0x9348[_0x423b58];return _0x3de544;};'use strict';var emlformat=require(_0x8934('0x0'));var rimraf=require(_0x8934('0x1'));var zipdir=require(_0x8934('0x2'));var jsonpatch=require(_0x8934('0x3'));var rp=require(_0x8934('0x4'));var moment=require('moment');var BPromise=require(_0x8934('0x5'));var Mustache=require(_0x8934('0x6'));var util=require('util');var path=require(_0x8934('0x7'));var sox=require(_0x8934('0x8'));var csv=require(_0x8934('0x9'));var ejs=require(_0x8934('0xa'));var fs=require('fs');var fs_extra=require(_0x8934('0xb'));var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8934('0x11'));var hardwareService=require(_0x8934('0x12'));var logger=require(_0x8934('0x13'))(_0x8934('0x14'));var utils=require(_0x8934('0x15'));var config=require(_0x8934('0x16'));var licenseUtil=require(_0x8934('0x17'));var db=require(_0x8934('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x8934('0x19'));var client=jayson[_0x8934('0x1a')][_0x8934('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1906d0,_0xbc487e,_0xdf59f4,_0x5b560f){return new BPromise(function(_0x254720,_0x38230a){var _0xdfc97c=_0x5b560f||client;return _0xdfc97c[_0x8934('0x1c')](_0x1906d0,_0xdf59f4)[_0x8934('0x1d')](function(_0x41e6a9){logger[_0x8934('0x1e')](_0x8934('0x1f'),_0xbc487e,'request\x20sent');logger[_0x8934('0x20')](_0x8934('0x21'),_0xbc487e,_0x8934('0x22'),JSON['stringify'](_0x41e6a9));if(_0x41e6a9['error']){if(_0x41e6a9['error'][_0x8934('0x23')]===0x1f4){logger['error'](_0x8934('0x1f'),_0xbc487e,_0x41e6a9[_0x8934('0x24')][_0x8934('0x25')]);return _0x38230a(_0x41e6a9[_0x8934('0x24')][_0x8934('0x25')]);}logger['error'](_0x8934('0x1f'),_0xbc487e,_0x41e6a9['error'][_0x8934('0x25')]);return _0x254720(_0x41e6a9[_0x8934('0x24')][_0x8934('0x25')]);}else{logger[_0x8934('0x1e')](_0x8934('0x1f'),_0xbc487e,_0x8934('0x22'));_0x254720(_0x41e6a9[_0x8934('0x26')]['message']);}})[_0x8934('0x27')](function(_0x2a5e67){logger[_0x8934('0x24')](_0x8934('0x1f'),_0xbc487e,_0x2a5e67);_0x38230a(_0x2a5e67);});});}function respondWithStatusCode(_0x43b89a,_0x5e593b){_0x5e593b=_0x5e593b||0xcc;return function(_0x3cf295){if(_0x3cf295){return _0x43b89a[_0x8934('0x28')](_0x5e593b);}return _0x43b89a[_0x8934('0x29')](_0x5e593b)['end']();};}function respondWithResult(_0x16cfc2,_0x561df2){_0x561df2=_0x561df2||0xc8;return function(_0x14c5f0){if(_0x14c5f0){return _0x16cfc2[_0x8934('0x29')](_0x561df2)[_0x8934('0x2a')](_0x14c5f0);}};}function respondWithFilteredResult(_0x5ef0ed,_0x1fd5eb){return function(_0x15910b){if(_0x15910b){var _0x310454=_0x15910b[_0x8934('0x2b')],_0x50b89e=_0x1fd5eb[_0x8934('0x2c')],_0x4b5780=_0x1fd5eb[_0x8934('0x2c')]+_0x1fd5eb[_0x8934('0x2d')],_0x3db790;if(_0x4b5780>=_0x310454){_0x4b5780=_0x310454;_0x3db790=0xc8;}else{_0x3db790=0xce;}_0x5ef0ed[_0x8934('0x29')](_0x3db790);return _0x5ef0ed[_0x8934('0x2e')](_0x8934('0x2f'),_0x50b89e+'-'+_0x4b5780+'/'+_0x310454)[_0x8934('0x2a')](_0x15910b);}return null;};}function patchUpdates(_0x18938a){return function(_0x592b99){try{jsonpatch[_0x8934('0x30')](_0x592b99,_0x18938a,!![]);}catch(_0x3e973e){return BPromise['reject'](_0x3e973e);}return _0x592b99[_0x8934('0x31')]();};}function saveUpdates(_0x3d60f9,_0x1a17b5){return function(_0x13aeeb){if(_0x13aeeb){return _0x13aeeb['update'](_0x3d60f9)[_0x8934('0x1d')](function(_0x18e881){return _0x18e881;});}return null;};}function removeEntity(_0x11844a,_0x1af54b){return function(_0x382d81){if(_0x382d81){return _0x382d81['destroy']()[_0x8934('0x1d')](function(){_0x11844a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xff95be,_0x2447e6){return function(_0x2f5880){if(!_0x2f5880){_0xff95be[_0x8934('0x28')](0x194);}return _0x2f5880;};}function handleError(_0x50bbb4,_0x2b4db6){_0x2b4db6=_0x2b4db6||0x1f4;return function(_0x22aebe){logger[_0x8934('0x24')](_0x22aebe[_0x8934('0x32')]);if(_0x22aebe[_0x8934('0x33')]){delete _0x22aebe['name'];}_0x50bbb4[_0x8934('0x29')](_0x2b4db6)[_0x8934('0x34')](_0x22aebe);};}exports['index']=function(_0x5914b9,_0x845028){var _0x2a790f={},_0x4a4a50={},_0x519273={'count':0x0,'rows':[]};var _0x1a30c1=_[_0x8934('0x35')](db[_0x8934('0x36')][_0x8934('0x37')],function(_0x834d54){return{'name':_0x834d54[_0x8934('0x38')],'type':_0x834d54[_0x8934('0x39')][_0x8934('0x3a')]};});_0x4a4a50[_0x8934('0x3b')]=_[_0x8934('0x35')](_0x1a30c1,_0x8934('0x33'));_0x4a4a50['query']=_[_0x8934('0x3c')](_0x5914b9[_0x8934('0x3d')]);_0x4a4a50['filters']=_[_0x8934('0x3e')](_0x4a4a50[_0x8934('0x3b')],_0x4a4a50[_0x8934('0x3d')]);_0x2a790f[_0x8934('0x3f')]=_[_0x8934('0x3e')](_0x4a4a50['model'],qs['fields'](_0x5914b9['query'][_0x8934('0x40')]));_0x2a790f[_0x8934('0x3f')]=_0x2a790f[_0x8934('0x3f')]['length']?_0x2a790f[_0x8934('0x3f')]:_0x4a4a50['model'];if(!_0x5914b9['query'][_0x8934('0x41')](_0x8934('0x42'))){_0x2a790f['limit']=qs['limit'](_0x5914b9[_0x8934('0x3d')][_0x8934('0x2d')]);_0x2a790f[_0x8934('0x2c')]=qs['offset'](_0x5914b9[_0x8934('0x3d')]['offset']);}_0x2a790f[_0x8934('0x43')]=qs['sort'](_0x5914b9[_0x8934('0x3d')][_0x8934('0x44')]);_0x2a790f[_0x8934('0x45')]=qs['filters'](_[_0x8934('0x46')](_0x5914b9[_0x8934('0x3d')],_0x4a4a50[_0x8934('0x47')]),_0x1a30c1);if(_0x5914b9[_0x8934('0x3d')]['filter']){_0x2a790f[_0x8934('0x45')]=_[_0x8934('0x48')](_0x2a790f[_0x8934('0x45')],{'$or':_[_0x8934('0x35')](_0x1a30c1,function(_0x6e63ff){if(_0x6e63ff[_0x8934('0x39')]!==_0x8934('0x49')){var _0x877e71={};_0x877e71[_0x6e63ff['name']]={'$like':'%'+_0x5914b9['query']['filter']+'%'};return _0x877e71;}})});}_0x2a790f=_[_0x8934('0x48')]({},_0x2a790f,_0x5914b9[_0x8934('0x4a')]);var _0x58206c={'where':_0x2a790f[_0x8934('0x45')]};return db['VtigerAccount'][_0x8934('0x2b')](_0x58206c)[_0x8934('0x1d')](function(_0x4be80d){_0x519273[_0x8934('0x2b')]=_0x4be80d;if(_0x5914b9[_0x8934('0x3d')][_0x8934('0x4b')]){_0x2a790f[_0x8934('0x4c')]=[{'all':!![]}];}return db['VtigerAccount'][_0x8934('0x4d')](_0x2a790f);})[_0x8934('0x1d')](function(_0x5991fc){_0x519273[_0x8934('0x4e')]=_0x5991fc;return _0x519273;})[_0x8934('0x1d')](respondWithFilteredResult(_0x845028,_0x2a790f))[_0x8934('0x27')](handleError(_0x845028,null));};exports[_0x8934('0x4f')]=function(_0x406d0a,_0x419e30){var _0xa45543={'raw':![],'where':{'id':_0x406d0a[_0x8934('0x50')]['id']}},_0x2a1ce9={};_0x2a1ce9[_0x8934('0x3b')]=_[_0x8934('0x3c')](db[_0x8934('0x36')][_0x8934('0x37')]);_0x2a1ce9[_0x8934('0x3d')]=_[_0x8934('0x3c')](_0x406d0a[_0x8934('0x3d')]);_0x2a1ce9[_0x8934('0x47')]=_[_0x8934('0x3e')](_0x2a1ce9['model'],_0x2a1ce9[_0x8934('0x3d')]);_0xa45543[_0x8934('0x3f')]=_['intersection'](_0x2a1ce9['model'],qs['fields'](_0x406d0a['query'][_0x8934('0x40')]));_0xa45543[_0x8934('0x3f')]=_0xa45543[_0x8934('0x3f')]['length']?_0xa45543['attributes']:_0x2a1ce9[_0x8934('0x3b')];if(_0x406d0a['query']['includeAll']){_0xa45543[_0x8934('0x4c')]=[{'all':!![]}];}_0xa45543=_[_0x8934('0x48')]({},_0xa45543,_0x406d0a[_0x8934('0x4a')]);return db[_0x8934('0x36')][_0x8934('0x51')](_0xa45543)[_0x8934('0x1d')](handleEntityNotFound(_0x419e30,null))[_0x8934('0x1d')](respondWithResult(_0x419e30,null))['catch'](handleError(_0x419e30,null));};exports[_0x8934('0x52')]=function(_0x5d2ff7,_0x18e08b){return db[_0x8934('0x36')][_0x8934('0x52')](_0x5d2ff7[_0x8934('0x53')],{})[_0x8934('0x1d')](respondWithResult(_0x18e08b,0xc9))[_0x8934('0x27')](handleError(_0x18e08b,null));};exports[_0x8934('0x54')]=function(_0x251cfe,_0x597e04){if(_0x251cfe[_0x8934('0x53')]['id']){delete _0x251cfe[_0x8934('0x53')]['id'];}return db[_0x8934('0x36')][_0x8934('0x51')]({'where':{'id':_0x251cfe[_0x8934('0x50')]['id']}})['then'](handleEntityNotFound(_0x597e04,null))[_0x8934('0x1d')](saveUpdates(_0x251cfe[_0x8934('0x53')],null))[_0x8934('0x1d')](respondWithResult(_0x597e04,null))['catch'](handleError(_0x597e04,null));};exports[_0x8934('0x55')]=function(_0x2922a1,_0x1e61cc){return db['VtigerAccount']['find']({'where':{'id':_0x2922a1['params']['id']}})[_0x8934('0x1d')](handleEntityNotFound(_0x1e61cc,null))[_0x8934('0x1d')](removeEntity(_0x1e61cc,null))[_0x8934('0x27')](handleError(_0x1e61cc,null));};exports['getConfigurations']=function(_0x280809,_0x10ff96,_0x5f447c){var _0x5157d7={};var _0xf993d2={};var _0x429769;var _0x44d892;return db[_0x8934('0x36')]['findOne']({'where':{'id':_0x280809['params']['id']}})['then'](handleEntityNotFound(_0x10ff96,null))['then'](function(_0x43933f){if(_0x43933f){_0x429769=_0x43933f;_0xf993d2[_0x8934('0x3b')]=_[_0x8934('0x3c')](db[_0x8934('0x56')][_0x8934('0x37')]);_0xf993d2[_0x8934('0x3d')]=_['keys'](_0x280809[_0x8934('0x3d')]);_0xf993d2[_0x8934('0x47')]=_['intersection'](_0xf993d2[_0x8934('0x3b')],_0xf993d2['query']);_0x5157d7[_0x8934('0x3f')]=_['intersection'](_0xf993d2[_0x8934('0x3b')],qs[_0x8934('0x40')](_0x280809[_0x8934('0x3d')][_0x8934('0x40')]));_0x5157d7[_0x8934('0x3f')]=_0x5157d7[_0x8934('0x3f')][_0x8934('0x57')]?_0x5157d7['attributes']:_0xf993d2['model'];_0x5157d7[_0x8934('0x43')]=qs[_0x8934('0x44')](_0x280809[_0x8934('0x3d')][_0x8934('0x44')]);_0x5157d7[_0x8934('0x45')]=qs[_0x8934('0x47')](_[_0x8934('0x46')](_0x280809[_0x8934('0x3d')],_0xf993d2[_0x8934('0x47')]));if(_0x280809[_0x8934('0x3d')][_0x8934('0x58')]){_0x5157d7[_0x8934('0x45')]=_[_0x8934('0x48')](_0x5157d7[_0x8934('0x45')],{'$or':_['map'](_0x5157d7['attributes'],function(_0x1a52be){var _0x11b2c6={};_0x11b2c6[_0x1a52be]={'$like':'%'+_0x280809[_0x8934('0x3d')][_0x8934('0x58')]+'%'};return _0x11b2c6;})});}_0x5157d7=_[_0x8934('0x48')]({},_0x5157d7,_0x280809[_0x8934('0x4a')]);return _0x429769[_0x8934('0x59')](_0x5157d7);}})['then'](function(_0x1ccd22){if(_0x1ccd22){_0x44d892=_0x1ccd22[_0x8934('0x57')];if(!_0x280809['query'][_0x8934('0x41')]('nolimit')){_0x5157d7[_0x8934('0x2d')]=qs[_0x8934('0x2d')](_0x280809[_0x8934('0x3d')]['limit']);_0x5157d7[_0x8934('0x2c')]=qs[_0x8934('0x2c')](_0x280809['query'][_0x8934('0x2c')]);}return _0x429769['getConfigurations'](_0x5157d7);}})[_0x8934('0x1d')](function(_0x583448){if(_0x583448){return _0x583448?{'count':_0x44d892,'rows':_0x583448}:null;}})[_0x8934('0x1d')](respondWithResult(_0x10ff96,null))[_0x8934('0x27')](handleError(_0x10ff96,null));};exports[_0x8934('0x5a')]=function(_0x5ea4fe,_0x196372,_0xfbad9){if(_0x5ea4fe[_0x8934('0x53')]['id']){delete _0x5ea4fe[_0x8934('0x53')]['id'];}return db['VtigerAccount'][_0x8934('0x5b')]({'where':{'id':_0x5ea4fe['params']['id']}})[_0x8934('0x1d')](handleEntityNotFound(_0x196372,null))[_0x8934('0x1d')](function(_0x14992b){if(_0x14992b){_0x5ea4fe[_0x8934('0x53')]['AccountId']=_0x14992b['id'];_0x5ea4fe[_0x8934('0x53')][_0x8934('0x5c')]=integrations[_0x8934('0x5d')](_0x5ea4fe['body'][_0x8934('0x5e')],_0x5ea4fe[_0x8934('0x53')][_0x8934('0x39')]);_0x5ea4fe['body']['Descriptions']=integrations[_0x8934('0x5f')](_0x5ea4fe[_0x8934('0x53')][_0x8934('0x5e')],_0x5ea4fe[_0x8934('0x53')][_0x8934('0x39')]);return db[_0x8934('0x56')][_0x8934('0x52')](_0x5ea4fe[_0x8934('0x53')],{'include':[{'model':db[_0x8934('0x60')],'as':'Subjects'},{'model':db[_0x8934('0x60')],'as':_0x8934('0x61')}]});}return null;})[_0x8934('0x1d')](respondWithResult(_0x196372,null))[_0x8934('0x27')](handleError(_0x196372,null));};var md5=require(_0x8934('0x62'));exports['getFields']=function(_0x333d74,_0x288133,_0x5d88fb){var _0x620ac8=null;var _0x548617=null;var _0x57d745=null;var _0x5cf833=null;var _0xa263a8='';return db[_0x8934('0x36')][_0x8934('0x5b')]({'where':{'id':_0x333d74['params']['id']},'attributes':['id',_0x8934('0x33'),_0x8934('0x63'),'description',_0x8934('0x64'),_0x8934('0x65'),_0x8934('0x66'),_0x8934('0x67')]})[_0x8934('0x1d')](handleEntityNotFound(_0x288133,null))[_0x8934('0x1d')](function(_0x293bb8){if(_0x293bb8){_0x620ac8=_0x293bb8[_0x8934('0x63')];_0x548617=_0x293bb8[_0x8934('0x67')];_0x57d745=_0x293bb8[_0x8934('0x64')];_0xa263a8=_0x293bb8['remoteUri'];var _0x3b3fb4=_0xa263a8[_0x8934('0x68')](-0x1);if(_0x3b3fb4==='/'){_0xa263a8=_0xa263a8[_0x8934('0x69')](0x0,_0xa263a8[_0x8934('0x6a')](_0x3b3fb4));}_0x5cf833=util[_0x8934('0x6b')](_0x8934('0x6c'),_0xa263a8);var _0x395e41={'method':'GET','uri':_0x5cf833,'qs':{'operation':_0x8934('0x6d'),'username':_0x293bb8[_0x8934('0x63')]},'json':!![]};return rp(_0x395e41);}})[_0x8934('0x1d')](function(_0x3c7ce7){if(_0x3c7ce7[_0x8934('0x6e')]){var _0xdf0ab2={'method':_0x8934('0x6f'),'uri':_0x5cf833,'form':{'operation':_0x8934('0x70'),'username':_0x620ac8,'accessKey':md5(_0x3c7ce7[_0x8934('0x26')]['token']+_0x548617)},'json':!![]};return rp(_0xdf0ab2);}})['then'](function(_0x1d1590){if(_0x1d1590[_0x8934('0x6e')]){var _0x4faab2={'method':_0x8934('0x71'),'uri':_0x5cf833,'qs':{'operation':_0x8934('0x72'),'username':_0x620ac8,'sessionName':_0x1d1590[_0x8934('0x26')][_0x8934('0x73')],'elementType':_0x57d745},'json':!![]};return rp(_0x4faab2);}})[_0x8934('0x1d')](function(_0x1894ff){if(_0x1894ff[_0x8934('0x6e')]){var _0x2dad95=[_0x8934('0x74'),_0x8934('0x75'),_0x8934('0x76')];_['remove'](_0x1894ff[_0x8934('0x26')][_0x8934('0x40')],function(_0x460cef){return _0x2dad95['includes'](_0x460cef[_0x8934('0x39')]['name']);});_[_0x8934('0x77')](_0x1894ff[_0x8934('0x26')][_0x8934('0x40')],function(_0x39a833){return _0x39a833['editable']==='false';});return{'count':_0x1894ff[_0x8934('0x26')]['fields'][_0x8934('0x57')],'rows':_[_0x8934('0x35')](_0x1894ff[_0x8934('0x26')][_0x8934('0x40')],function(_0x52c2b9){return{'id':_0x52c2b9[_0x8934('0x33')],'name':_0x52c2b9['label'],'custom':_['startsWith'](_0x52c2b9['name'],'cf_')?!![]:![],'options':_0x52c2b9[_0x8934('0x39')][_0x8934('0x33')]===_0x8934('0x78')&&_0x52c2b9[_0x8934('0x39')][_0x8934('0x79')]['length']>0x0?_['map'](_0x52c2b9[_0x8934('0x39')][_0x8934('0x79')],function(_0x2e43ce){return{'name':_0x2e43ce[_0x8934('0x7a')],'value':_0x2e43ce[_0x8934('0x7b')]};}):[]};})};}})[_0x8934('0x1d')](respondWithResult(_0x288133,null))[_0x8934('0x27')](function(_0x2839dd){console[_0x8934('0x7c')](_0x8934('0x7d')+_0x2839dd);var _0x211a9a=_0x333d74[_0x8934('0x3d')][_0x8934('0x7e')]?0x1f4:_0x2839dd[_0x8934('0x7f')]||0x1f4;logger[_0x8934('0x24')](_0x8934('0x80'),'getFields',_0x211a9a,JSON['stringify'](_0x2839dd));delete _0x2839dd[_0x8934('0x33')];if(_0x211a9a===0x191){_0x211a9a=0x190;}_0x288133[_0x8934('0x29')](_0x211a9a)['send'](_0x333d74[_0x8934('0x3d')][_0x8934('0x7e')]?{'message':_0x8934('0x81'),'statusCode':_0x2839dd[_0x8934('0x7f')]}:_0x2839dd);});}; \ No newline at end of file +var _0x36ee=['querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','apply','save','update','destroy','stack','index','map','VtigerAccount','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','show','find','create','body','params','getConfigurations','findOne','VtigerConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','VtigerField','description','moduleName','remoteUri','serverUrl','username','substring','%s/webservice.php','GET','success','POST','token','describe','sessionName','autogenerated','reference','remove','includes','editable','false','label','startsWith','cf_','picklistValues','vTiger\x20error:\x20','test','statusCode','send','Wrong\x20credentials','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0xb3c73b,_0x2547fb){var _0x37f92d=function(_0x2c2485){while(--_0x2c2485){_0xb3c73b['push'](_0xb3c73b['shift']());}};_0x37f92d(++_0x2547fb);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xe36e('0x19'));var client=jayson[_0xe36e('0x1a')][_0xe36e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1fdea2,_0x5c3f3c,_0x3e264a,_0x521afa){return new BPromise(function(_0x525155,_0x27ff47){var _0x300f21=_0x521afa||client;return _0x300f21[_0xe36e('0x1c')](_0x1fdea2,_0x3e264a)[_0xe36e('0x1d')](function(_0xd6828e){logger[_0xe36e('0x1e')](_0xe36e('0x1f'),_0x5c3f3c,_0xe36e('0x20'));logger[_0xe36e('0x21')](_0xe36e('0x22'),_0x5c3f3c,'request\x20sent',JSON[_0xe36e('0x23')](_0xd6828e));if(_0xd6828e[_0xe36e('0x24')]){if(_0xd6828e['error'][_0xe36e('0x25')]===0x1f4){logger['error'](_0xe36e('0x1f'),_0x5c3f3c,_0xd6828e[_0xe36e('0x24')]['message']);return _0x27ff47(_0xd6828e[_0xe36e('0x24')][_0xe36e('0x26')]);}logger[_0xe36e('0x24')]('VtigerAccount,\x20%s,\x20%s',_0x5c3f3c,_0xd6828e[_0xe36e('0x24')][_0xe36e('0x26')]);return _0x525155(_0xd6828e[_0xe36e('0x24')][_0xe36e('0x26')]);}else{logger[_0xe36e('0x1e')](_0xe36e('0x1f'),_0x5c3f3c,'request\x20sent');_0x525155(_0xd6828e[_0xe36e('0x27')][_0xe36e('0x26')]);}})[_0xe36e('0x28')](function(_0x333197){logger[_0xe36e('0x24')]('VtigerAccount,\x20%s,\x20%s',_0x5c3f3c,_0x333197);_0x27ff47(_0x333197);});});}function respondWithStatusCode(_0x598a7a,_0x4749a8){_0x4749a8=_0x4749a8||0xcc;return function(_0x10818d){if(_0x10818d){return _0x598a7a[_0xe36e('0x29')](_0x4749a8);}return _0x598a7a[_0xe36e('0x2a')](_0x4749a8)[_0xe36e('0x2b')]();};}function respondWithResult(_0x1507f9,_0x1a045c){_0x1a045c=_0x1a045c||0xc8;return function(_0x5ac484){if(_0x5ac484){return _0x1507f9[_0xe36e('0x2a')](_0x1a045c)[_0xe36e('0x2c')](_0x5ac484);}};}function respondWithFilteredResult(_0x10597f,_0x262caa){return function(_0x5e58d8){if(_0x5e58d8){var _0x2d757c=_0x5e58d8[_0xe36e('0x2d')],_0x5a3133=_0x262caa['offset'],_0xf7b02e=_0x262caa[_0xe36e('0x2e')]+_0x262caa['limit'],_0x5993de;if(_0xf7b02e>=_0x2d757c){_0xf7b02e=_0x2d757c;_0x5993de=0xc8;}else{_0x5993de=0xce;}_0x10597f[_0xe36e('0x2a')](_0x5993de);return _0x10597f['set']('Content-Range',_0x5a3133+'-'+_0xf7b02e+'/'+_0x2d757c)['json'](_0x5e58d8);}return null;};}function patchUpdates(_0x5b5d53){return function(_0x203fa2){try{jsonpatch[_0xe36e('0x2f')](_0x203fa2,_0x5b5d53,!![]);}catch(_0x4cf185){return BPromise['reject'](_0x4cf185);}return _0x203fa2[_0xe36e('0x30')]();};}function saveUpdates(_0xb8d44e,_0x259e19){return function(_0x1b18aa){if(_0x1b18aa){return _0x1b18aa[_0xe36e('0x31')](_0xb8d44e)[_0xe36e('0x1d')](function(_0x57bb9b){return _0x57bb9b;});}return null;};}function removeEntity(_0xb98e78,_0x11c95d){return function(_0x57272f){if(_0x57272f){return _0x57272f[_0xe36e('0x32')]()[_0xe36e('0x1d')](function(){_0xb98e78[_0xe36e('0x2a')](0xcc)[_0xe36e('0x2b')]();});}};}function handleEntityNotFound(_0x21623e,_0x253cdc){return function(_0xfe4ee8){if(!_0xfe4ee8){_0x21623e[_0xe36e('0x29')](0x194);}return _0xfe4ee8;};}function handleError(_0x36cee2,_0x1cc329){_0x1cc329=_0x1cc329||0x1f4;return function(_0xf808f5){logger['error'](_0xf808f5[_0xe36e('0x33')]);if(_0xf808f5['name']){delete _0xf808f5['name'];}_0x36cee2[_0xe36e('0x2a')](_0x1cc329)['send'](_0xf808f5);};}exports[_0xe36e('0x34')]=function(_0x248f39,_0x38bdbc){var _0x235437={},_0x4a6a2b={},_0x56135c={'count':0x0,'rows':[]};var _0x45689d=_[_0xe36e('0x35')](db[_0xe36e('0x36')][_0xe36e('0x37')],function(_0x51894c){return{'name':_0x51894c[_0xe36e('0x38')],'type':_0x51894c[_0xe36e('0x39')][_0xe36e('0x3a')]};});_0x4a6a2b['model']=_[_0xe36e('0x35')](_0x45689d,_0xe36e('0x3b'));_0x4a6a2b['query']=_[_0xe36e('0x3c')](_0x248f39[_0xe36e('0x3d')]);_0x4a6a2b[_0xe36e('0x3e')]=_[_0xe36e('0x3f')](_0x4a6a2b[_0xe36e('0x40')],_0x4a6a2b[_0xe36e('0x3d')]);_0x235437[_0xe36e('0x41')]=_[_0xe36e('0x3f')](_0x4a6a2b[_0xe36e('0x40')],qs[_0xe36e('0x42')](_0x248f39[_0xe36e('0x3d')][_0xe36e('0x42')]));_0x235437[_0xe36e('0x41')]=_0x235437['attributes'][_0xe36e('0x43')]?_0x235437[_0xe36e('0x41')]:_0x4a6a2b[_0xe36e('0x40')];if(!_0x248f39[_0xe36e('0x3d')][_0xe36e('0x44')]('nolimit')){_0x235437['limit']=qs[_0xe36e('0x45')](_0x248f39[_0xe36e('0x3d')][_0xe36e('0x45')]);_0x235437[_0xe36e('0x2e')]=qs[_0xe36e('0x2e')](_0x248f39[_0xe36e('0x3d')][_0xe36e('0x2e')]);}_0x235437[_0xe36e('0x46')]=qs['sort'](_0x248f39[_0xe36e('0x3d')][_0xe36e('0x47')]);_0x235437['where']=qs[_0xe36e('0x3e')](_['pick'](_0x248f39[_0xe36e('0x3d')],_0x4a6a2b[_0xe36e('0x3e')]),_0x45689d);if(_0x248f39[_0xe36e('0x3d')][_0xe36e('0x48')]){_0x235437[_0xe36e('0x49')]=_['merge'](_0x235437[_0xe36e('0x49')],{'$or':_[_0xe36e('0x35')](_0x45689d,function(_0x2265c4){if(_0x2265c4[_0xe36e('0x39')]!==_0xe36e('0x4a')){var _0x31760e={};_0x31760e[_0x2265c4['name']]={'$like':'%'+_0x248f39[_0xe36e('0x3d')][_0xe36e('0x48')]+'%'};return _0x31760e;}})});}_0x235437=_[_0xe36e('0x4b')]({},_0x235437,_0x248f39[_0xe36e('0x4c')]);var _0x1cbb7d={'where':_0x235437['where']};return db[_0xe36e('0x36')][_0xe36e('0x2d')](_0x1cbb7d)[_0xe36e('0x1d')](function(_0x9debd7){_0x56135c[_0xe36e('0x2d')]=_0x9debd7;if(_0x248f39[_0xe36e('0x3d')][_0xe36e('0x4d')]){_0x235437[_0xe36e('0x4e')]=[{'all':!![]}];}return db[_0xe36e('0x36')]['findAll'](_0x235437);})['then'](function(_0x101098){_0x56135c['rows']=_0x101098;return _0x56135c;})[_0xe36e('0x1d')](respondWithFilteredResult(_0x38bdbc,_0x235437))[_0xe36e('0x28')](handleError(_0x38bdbc,null));};exports[_0xe36e('0x4f')]=function(_0x25aa09,_0x51641c){var _0x15c846={'raw':![],'where':{'id':_0x25aa09['params']['id']}},_0x40b94a={};_0x40b94a[_0xe36e('0x40')]=_[_0xe36e('0x3c')](db[_0xe36e('0x36')][_0xe36e('0x37')]);_0x40b94a[_0xe36e('0x3d')]=_[_0xe36e('0x3c')](_0x25aa09[_0xe36e('0x3d')]);_0x40b94a[_0xe36e('0x3e')]=_[_0xe36e('0x3f')](_0x40b94a[_0xe36e('0x40')],_0x40b94a[_0xe36e('0x3d')]);_0x15c846[_0xe36e('0x41')]=_[_0xe36e('0x3f')](_0x40b94a[_0xe36e('0x40')],qs[_0xe36e('0x42')](_0x25aa09['query'][_0xe36e('0x42')]));_0x15c846['attributes']=_0x15c846['attributes'][_0xe36e('0x43')]?_0x15c846[_0xe36e('0x41')]:_0x40b94a['model'];if(_0x25aa09[_0xe36e('0x3d')][_0xe36e('0x4d')]){_0x15c846[_0xe36e('0x4e')]=[{'all':!![]}];}_0x15c846=_[_0xe36e('0x4b')]({},_0x15c846,_0x25aa09[_0xe36e('0x4c')]);return db[_0xe36e('0x36')][_0xe36e('0x50')](_0x15c846)[_0xe36e('0x1d')](handleEntityNotFound(_0x51641c,null))[_0xe36e('0x1d')](respondWithResult(_0x51641c,null))['catch'](handleError(_0x51641c,null));};exports[_0xe36e('0x51')]=function(_0x837e8,_0x546509){return db[_0xe36e('0x36')][_0xe36e('0x51')](_0x837e8[_0xe36e('0x52')],{})[_0xe36e('0x1d')](respondWithResult(_0x546509,0xc9))[_0xe36e('0x28')](handleError(_0x546509,null));};exports['update']=function(_0x59d4b3,_0x56f5b6){if(_0x59d4b3['body']['id']){delete _0x59d4b3[_0xe36e('0x52')]['id'];}return db[_0xe36e('0x36')][_0xe36e('0x50')]({'where':{'id':_0x59d4b3[_0xe36e('0x53')]['id']}})[_0xe36e('0x1d')](handleEntityNotFound(_0x56f5b6,null))[_0xe36e('0x1d')](saveUpdates(_0x59d4b3[_0xe36e('0x52')],null))[_0xe36e('0x1d')](respondWithResult(_0x56f5b6,null))[_0xe36e('0x28')](handleError(_0x56f5b6,null));};exports['destroy']=function(_0x3385ea,_0x478138){return db['VtigerAccount'][_0xe36e('0x50')]({'where':{'id':_0x3385ea[_0xe36e('0x53')]['id']}})[_0xe36e('0x1d')](handleEntityNotFound(_0x478138,null))[_0xe36e('0x1d')](removeEntity(_0x478138,null))[_0xe36e('0x28')](handleError(_0x478138,null));};exports[_0xe36e('0x54')]=function(_0x3cf731,_0x1a70d1,_0x1fe174){var _0x374032={};var _0x56718a={};var _0x2cf7fc;var _0x389e91;return db[_0xe36e('0x36')][_0xe36e('0x55')]({'where':{'id':_0x3cf731[_0xe36e('0x53')]['id']}})[_0xe36e('0x1d')](handleEntityNotFound(_0x1a70d1,null))[_0xe36e('0x1d')](function(_0x14738a){if(_0x14738a){_0x2cf7fc=_0x14738a;_0x56718a[_0xe36e('0x40')]=_[_0xe36e('0x3c')](db[_0xe36e('0x56')][_0xe36e('0x37')]);_0x56718a[_0xe36e('0x3d')]=_[_0xe36e('0x3c')](_0x3cf731['query']);_0x56718a[_0xe36e('0x3e')]=_[_0xe36e('0x3f')](_0x56718a['model'],_0x56718a[_0xe36e('0x3d')]);_0x374032[_0xe36e('0x41')]=_[_0xe36e('0x3f')](_0x56718a[_0xe36e('0x40')],qs[_0xe36e('0x42')](_0x3cf731[_0xe36e('0x3d')]['fields']));_0x374032[_0xe36e('0x41')]=_0x374032['attributes'][_0xe36e('0x43')]?_0x374032[_0xe36e('0x41')]:_0x56718a[_0xe36e('0x40')];_0x374032[_0xe36e('0x46')]=qs[_0xe36e('0x47')](_0x3cf731[_0xe36e('0x3d')][_0xe36e('0x47')]);_0x374032[_0xe36e('0x49')]=qs['filters'](_[_0xe36e('0x57')](_0x3cf731[_0xe36e('0x3d')],_0x56718a['filters']));if(_0x3cf731[_0xe36e('0x3d')][_0xe36e('0x48')]){_0x374032[_0xe36e('0x49')]=_[_0xe36e('0x4b')](_0x374032[_0xe36e('0x49')],{'$or':_[_0xe36e('0x35')](_0x374032[_0xe36e('0x41')],function(_0x48ff05){var _0x2d34fc={};_0x2d34fc[_0x48ff05]={'$like':'%'+_0x3cf731[_0xe36e('0x3d')][_0xe36e('0x48')]+'%'};return _0x2d34fc;})});}_0x374032=_[_0xe36e('0x4b')]({},_0x374032,_0x3cf731[_0xe36e('0x4c')]);return _0x2cf7fc[_0xe36e('0x54')](_0x374032);}})[_0xe36e('0x1d')](function(_0x441d87){if(_0x441d87){_0x389e91=_0x441d87[_0xe36e('0x43')];if(!_0x3cf731[_0xe36e('0x3d')][_0xe36e('0x44')]('nolimit')){_0x374032[_0xe36e('0x45')]=qs[_0xe36e('0x45')](_0x3cf731[_0xe36e('0x3d')][_0xe36e('0x45')]);_0x374032['offset']=qs['offset'](_0x3cf731[_0xe36e('0x3d')]['offset']);}return _0x2cf7fc['getConfigurations'](_0x374032);}})['then'](function(_0xe0a282){if(_0xe0a282){return _0xe0a282?{'count':_0x389e91,'rows':_0xe0a282}:null;}})['then'](respondWithResult(_0x1a70d1,null))[_0xe36e('0x28')](handleError(_0x1a70d1,null));};exports[_0xe36e('0x58')]=function(_0x258a63,_0x221a90,_0x1bd60d){if(_0x258a63[_0xe36e('0x52')]['id']){delete _0x258a63[_0xe36e('0x52')]['id'];}return db[_0xe36e('0x36')][_0xe36e('0x55')]({'where':{'id':_0x258a63['params']['id']}})[_0xe36e('0x1d')](handleEntityNotFound(_0x221a90,null))['then'](function(_0x13ad07){if(_0x13ad07){_0x258a63['body'][_0xe36e('0x59')]=_0x13ad07['id'];_0x258a63[_0xe36e('0x52')][_0xe36e('0x5a')]=integrations[_0xe36e('0x5b')](_0x258a63['body']['channel'],_0x258a63[_0xe36e('0x52')][_0xe36e('0x39')]);_0x258a63[_0xe36e('0x52')][_0xe36e('0x5c')]=integrations[_0xe36e('0x5d')](_0x258a63[_0xe36e('0x52')]['channel'],_0x258a63[_0xe36e('0x52')][_0xe36e('0x39')]);return db['VtigerConfiguration'][_0xe36e('0x51')](_0x258a63['body'],{'include':[{'model':db[_0xe36e('0x5e')],'as':_0xe36e('0x5a')},{'model':db[_0xe36e('0x5e')],'as':_0xe36e('0x5c')}]});}return null;})['then'](respondWithResult(_0x221a90,null))[_0xe36e('0x28')](handleError(_0x221a90,null));};var md5=require('md5');exports['getFields']=function(_0x39ace1,_0x26cbbf,_0x5554ab){var _0x51f319=null;var _0x460cc9=null;var _0x5ae7c6=null;var _0x33f3f5=null;var _0x36ddc0='';return db[_0xe36e('0x36')][_0xe36e('0x55')]({'where':{'id':_0x39ace1[_0xe36e('0x53')]['id']},'attributes':['id',_0xe36e('0x3b'),'username',_0xe36e('0x5f'),_0xe36e('0x60'),_0xe36e('0x61'),_0xe36e('0x62'),'accessKey']})[_0xe36e('0x1d')](handleEntityNotFound(_0x26cbbf,null))[_0xe36e('0x1d')](function(_0x2eef73){if(_0x2eef73){_0x51f319=_0x2eef73[_0xe36e('0x63')];_0x460cc9=_0x2eef73['accessKey'];_0x5ae7c6=_0x2eef73[_0xe36e('0x60')];_0x36ddc0=_0x2eef73['remoteUri'];var _0x1dae76=_0x36ddc0['slice'](-0x1);if(_0x1dae76==='/'){_0x36ddc0=_0x36ddc0[_0xe36e('0x64')](0x0,_0x36ddc0['lastIndexOf'](_0x1dae76));}_0x33f3f5=util['format'](_0xe36e('0x65'),_0x36ddc0);var _0x1fcddb={'method':_0xe36e('0x66'),'uri':_0x33f3f5,'qs':{'operation':'getchallenge','username':_0x2eef73[_0xe36e('0x63')]},'json':!![]};return rp(_0x1fcddb);}})[_0xe36e('0x1d')](function(_0x48e4f5){if(_0x48e4f5[_0xe36e('0x67')]){var _0x369576={'method':_0xe36e('0x68'),'uri':_0x33f3f5,'form':{'operation':'login','username':_0x51f319,'accessKey':md5(_0x48e4f5['result'][_0xe36e('0x69')]+_0x460cc9)},'json':!![]};return rp(_0x369576);}})[_0xe36e('0x1d')](function(_0x3bd3c2){if(_0x3bd3c2[_0xe36e('0x67')]){var _0x411305={'method':'GET','uri':_0x33f3f5,'qs':{'operation':_0xe36e('0x6a'),'username':_0x51f319,'sessionName':_0x3bd3c2[_0xe36e('0x27')][_0xe36e('0x6b')],'elementType':_0x5ae7c6},'json':!![]};return rp(_0x411305);}})[_0xe36e('0x1d')](function(_0xdc59c5){if(_0xdc59c5['success']){var _0x3712f6=[_0xe36e('0x6c'),_0xe36e('0x6d'),'owner'];_[_0xe36e('0x6e')](_0xdc59c5['result'][_0xe36e('0x42')],function(_0x4c1845){return _0x3712f6[_0xe36e('0x6f')](_0x4c1845[_0xe36e('0x39')]['name']);});_[_0xe36e('0x6e')](_0xdc59c5['result'][_0xe36e('0x42')],function(_0x25bc80){return _0x25bc80[_0xe36e('0x70')]===_0xe36e('0x71');});return{'count':_0xdc59c5[_0xe36e('0x27')]['fields'][_0xe36e('0x43')],'rows':_['map'](_0xdc59c5[_0xe36e('0x27')][_0xe36e('0x42')],function(_0x40361c){return{'id':_0x40361c[_0xe36e('0x3b')],'name':_0x40361c[_0xe36e('0x72')],'custom':_[_0xe36e('0x73')](_0x40361c['name'],_0xe36e('0x74'))?!![]:![],'options':_0x40361c[_0xe36e('0x39')][_0xe36e('0x3b')]==='picklist'&&_0x40361c[_0xe36e('0x39')][_0xe36e('0x75')][_0xe36e('0x43')]>0x0?_[_0xe36e('0x35')](_0x40361c['type'][_0xe36e('0x75')],function(_0x588999){return{'name':_0x588999[_0xe36e('0x72')],'value':_0x588999['value']};}):[]};})};}})[_0xe36e('0x1d')](respondWithResult(_0x26cbbf,null))[_0xe36e('0x28')](function(_0xecf9d8){console['log'](_0xe36e('0x76')+_0xecf9d8);var _0x28111b=_0x39ace1['query'][_0xe36e('0x77')]?0x1f4:_0xecf9d8[_0xe36e('0x78')]||0x1f4;logger[_0xe36e('0x24')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x28111b,JSON[_0xe36e('0x23')](_0xecf9d8));delete _0xecf9d8[_0xe36e('0x3b')];if(_0x28111b===0x191){_0x28111b=0x190;}_0x26cbbf[_0xe36e('0x2a')](_0x28111b)[_0xe36e('0x79')](_0x39ace1[_0xe36e('0x3d')]['test']?{'message':_0xe36e('0x7a'),'statusCode':_0xecf9d8[_0xe36e('0x78')]}:_0xecf9d8);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 29974eb..43e3efd 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 _0x2946=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x2946,0x165));var _0x6294=function(_0x181ff9,_0x246339){_0x181ff9=_0x181ff9-0x0;var _0x28bd75=_0x2946[_0x181ff9];return _0x28bd75;};'use strict';var _=require(_0x6294('0x0'));var util=require('util');var logger=require(_0x6294('0x1'))(_0x6294('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6294('0x3'));var rimraf=require(_0x6294('0x4'));var config=require(_0x6294('0x5'));var attributes=require(_0x6294('0x6'));var integrations=require(_0x6294('0x7'));module[_0x6294('0x8')]=function(_0x3d94a2,_0x12c857){return _0x3d94a2['define'](_0x6294('0x9'),attributes,{'tableName':_0x6294('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c65=['define','VtigerAccount','moment','bluebird','path','rimraf','exports'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x5c65,0x144));var _0x55c6=function(_0xef69ae,_0x433252){_0xef69ae=_0xef69ae-0x0;var _0x290406=_0x5c65[_0xef69ae];return _0x290406;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x55c6('0x0'));var BPromise=require(_0x55c6('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x55c6('0x2'));var rimraf=require(_0x55c6('0x3'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x55c6('0x4')]=function(_0x510de3,_0x5396fc){return _0x510de3[_0x55c6('0x5')](_0x55c6('0x6'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 2340dbc..f42e057 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 _0xdab4=['find','raw','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','GetVtigerAccount','ShowVtigerAccount'];(function(_0x3855f7,_0x42ed28){var _0xe7e9ef=function(_0x145f2d){while(--_0x145f2d){_0x3855f7['push'](_0x3855f7['shift']());}};_0xe7e9ef(++_0x42ed28);}(_0xdab4,0x122));var _0x4dab=function(_0x5d7782,_0x2b9fb8){_0x5d7782=_0x5d7782-0x0;var _0x47a155=_0xdab4[_0x5d7782];return _0x47a155;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4dab('0x0'));var BPromise=require(_0x4dab('0x1'));var rs=require(_0x4dab('0x2'));var fs=require('fs');var Redis=require(_0x4dab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4dab('0x4'));var logger=require(_0x4dab('0x5'))(_0x4dab('0x6'));var config=require(_0x4dab('0x7'));var jayson=require(_0x4dab('0x8'));var client=jayson[_0x4dab('0x9')][_0x4dab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1da4f4,_0x13527d,_0x2648d5){return new BPromise(function(_0x1d24ea,_0x4ea4ef){return client[_0x4dab('0xb')](_0x1da4f4,_0x2648d5)[_0x4dab('0xc')](function(_0x3fdc1c){logger[_0x4dab('0xd')](_0x4dab('0xe'),_0x13527d,_0x4dab('0xf'));logger[_0x4dab('0x10')](_0x4dab('0x11'),_0x13527d,_0x4dab('0xf'),JSON[_0x4dab('0x12')](_0x3fdc1c));if(_0x3fdc1c[_0x4dab('0x13')]){if(_0x3fdc1c[_0x4dab('0x13')][_0x4dab('0x14')]===0x1f4){logger[_0x4dab('0x13')](_0x4dab('0xe'),_0x13527d,_0x3fdc1c[_0x4dab('0x13')][_0x4dab('0x15')]);return _0x4ea4ef(_0x3fdc1c['error']['message']);}logger[_0x4dab('0x13')](_0x4dab('0xe'),_0x13527d,_0x3fdc1c[_0x4dab('0x13')][_0x4dab('0x15')]);return _0x1d24ea(_0x3fdc1c[_0x4dab('0x13')][_0x4dab('0x15')]);}else{logger[_0x4dab('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x13527d,_0x4dab('0xf'));_0x1d24ea(_0x3fdc1c['result'][_0x4dab('0x15')]);}})[_0x4dab('0x16')](function(_0x256876){logger[_0x4dab('0x13')](_0x4dab('0xe'),_0x13527d,_0x256876);_0x4ea4ef(_0x256876);});});}exports['GetVtigerAccount']=function(_0x2f91d7){var _0x2d9ddf=this;return new Promise(function(_0xee0861,_0xa9c5fe){return db[_0x4dab('0x17')][_0x4dab('0x18')]({'raw':_0x2f91d7[_0x4dab('0x19')]?_0x2f91d7[_0x4dab('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2f91d7[_0x4dab('0x19')]?_0x2f91d7[_0x4dab('0x19')][_0x4dab('0x1a')]||null:null,'attributes':_0x2f91d7[_0x4dab('0x19')]?_0x2f91d7['options'][_0x4dab('0x1b')]||null:null,'limit':_0x2f91d7[_0x4dab('0x19')]?_0x2f91d7[_0x4dab('0x19')][_0x4dab('0x1c')]||null:null,'include':_0x2f91d7[_0x4dab('0x19')]?_0x2f91d7[_0x4dab('0x19')][_0x4dab('0x1d')]?_[_0x4dab('0x1e')](_0x2f91d7[_0x4dab('0x19')]['include'],function(_0x34d187){return{'model':db[_0x34d187[_0x4dab('0x1f')]],'as':_0x34d187['as'],'attributes':_0x34d187[_0x4dab('0x1b')],'include':_0x34d187['include']?_[_0x4dab('0x1e')](_0x34d187[_0x4dab('0x1d')],function(_0x205f18){return{'model':db[_0x205f18[_0x4dab('0x1f')]],'as':_0x205f18['as'],'attributes':_0x205f18[_0x4dab('0x1b')],'include':_0x205f18['include']?_[_0x4dab('0x1e')](_0x205f18[_0x4dab('0x1d')],function(_0xfda171){return{'model':db[_0xfda171[_0x4dab('0x1f')]],'as':_0xfda171['as'],'attributes':_0xfda171['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c6be7){logger[_0x4dab('0xd')](_0x4dab('0x20'),_0x2f91d7);logger['debug']('GetVtigerAccount',_0x2f91d7,JSON[_0x4dab('0x12')](_0x1c6be7));_0xee0861(_0x1c6be7);})[_0x4dab('0x16')](function(_0x10b718){logger[_0x4dab('0x13')](_0x4dab('0x20'),_0x10b718[_0x4dab('0x15')],_0x2f91d7);_0xa9c5fe(_0x2d9ddf[_0x4dab('0x13')](0x1f4,_0x10b718[_0x4dab('0x15')]));});});};exports[_0x4dab('0x21')]=function(_0xb99e3){var _0x14cf17=this;return new Promise(function(_0xcbe4ad,_0x283622){return db['VtigerAccount'][_0x4dab('0x22')]({'raw':_0xb99e3[_0x4dab('0x19')]?_0xb99e3['options'][_0x4dab('0x23')]===undefined?!![]:![]:!![],'where':_0xb99e3[_0x4dab('0x19')]?_0xb99e3[_0x4dab('0x19')]['where']||null:null,'attributes':_0xb99e3['options']?_0xb99e3['options']['attributes']||null:null,'include':_0xb99e3[_0x4dab('0x19')]?_0xb99e3[_0x4dab('0x19')][_0x4dab('0x1d')]?_[_0x4dab('0x1e')](_0xb99e3['options'][_0x4dab('0x1d')],function(_0x3eda4a){return{'model':db[_0x3eda4a[_0x4dab('0x1f')]],'as':_0x3eda4a['as'],'attributes':_0x3eda4a[_0x4dab('0x1b')],'include':_0x3eda4a[_0x4dab('0x1d')]?_[_0x4dab('0x1e')](_0x3eda4a[_0x4dab('0x1d')],function(_0x2dc8a3){return{'model':db[_0x2dc8a3[_0x4dab('0x1f')]],'as':_0x2dc8a3['as'],'attributes':_0x2dc8a3[_0x4dab('0x1b')],'include':_0x2dc8a3[_0x4dab('0x1d')]?_[_0x4dab('0x1e')](_0x2dc8a3['include'],function(_0x51a3a0){return{'model':db[_0x51a3a0[_0x4dab('0x1f')]],'as':_0x51a3a0['as'],'attributes':_0x51a3a0[_0x4dab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4dab('0xc')](function(_0x1a142d){logger['info'](_0x4dab('0x21'),_0xb99e3);logger[_0x4dab('0x10')](_0x4dab('0x21'),_0xb99e3,JSON[_0x4dab('0x12')](_0x1a142d));_0xcbe4ad(_0x1a142d);})[_0x4dab('0x16')](function(_0x27e50e){logger[_0x4dab('0x13')]('ShowVtigerAccount',_0x27e50e[_0x4dab('0x15')],_0xb99e3);_0x283622(_0x14cf17[_0x4dab('0x13')](0x1f4,_0x27e50e['message']));});});}; \ No newline at end of file +var _0x8d05=['debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','include','map','model','attributes','ShowVtigerAccount','raw','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1d94d1,_0x347bb8){var _0x23c397=function(_0x489441){while(--_0x489441){_0x1d94d1['push'](_0x1d94d1['shift']());}};_0x23c397(++_0x347bb8);}(_0x8d05,0x1a0));var _0x58d0=function(_0x3a2e76,_0x45e819){_0x3a2e76=_0x3a2e76-0x0;var _0x21ad01=_0x8d05[_0x3a2e76];return _0x21ad01;};'use strict';var _=require('lodash');var util=require(_0x58d0('0x0'));var moment=require('moment');var BPromise=require(_0x58d0('0x1'));var rs=require(_0x58d0('0x2'));var fs=require('fs');var Redis=require(_0x58d0('0x3'));var db=require(_0x58d0('0x4'))['db'];var utils=require(_0x58d0('0x5'));var logger=require(_0x58d0('0x6'))(_0x58d0('0x7'));var config=require(_0x58d0('0x8'));var jayson=require(_0x58d0('0x9'));var client=jayson['client'][_0x58d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x181922,_0x58e571,_0x1be948){return new BPromise(function(_0x1f95b2,_0x33cdaf){return client[_0x58d0('0xb')](_0x181922,_0x1be948)[_0x58d0('0xc')](function(_0x2dff44){logger[_0x58d0('0xd')](_0x58d0('0xe'),_0x58e571,_0x58d0('0xf'));logger[_0x58d0('0x10')](_0x58d0('0x11'),_0x58e571,_0x58d0('0xf'),JSON['stringify'](_0x2dff44));if(_0x2dff44[_0x58d0('0x12')]){if(_0x2dff44[_0x58d0('0x12')][_0x58d0('0x13')]===0x1f4){logger[_0x58d0('0x12')](_0x58d0('0xe'),_0x58e571,_0x2dff44[_0x58d0('0x12')][_0x58d0('0x14')]);return _0x33cdaf(_0x2dff44[_0x58d0('0x12')][_0x58d0('0x14')]);}logger[_0x58d0('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x58e571,_0x2dff44[_0x58d0('0x12')][_0x58d0('0x14')]);return _0x1f95b2(_0x2dff44[_0x58d0('0x12')][_0x58d0('0x14')]);}else{logger[_0x58d0('0xd')](_0x58d0('0xe'),_0x58e571,_0x58d0('0xf'));_0x1f95b2(_0x2dff44[_0x58d0('0x15')][_0x58d0('0x14')]);}})[_0x58d0('0x16')](function(_0x19da74){logger[_0x58d0('0x12')](_0x58d0('0xe'),_0x58e571,_0x19da74);_0x33cdaf(_0x19da74);});});}exports[_0x58d0('0x17')]=function(_0x2e9895){var _0x15536b=this;return new Promise(function(_0x18f323,_0xdb86a9){return db[_0x58d0('0x18')][_0x58d0('0x19')]({'raw':_0x2e9895[_0x58d0('0x1a')]?_0x2e9895[_0x58d0('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2e9895[_0x58d0('0x1a')]?_0x2e9895['options'][_0x58d0('0x1b')]||null:null,'attributes':_0x2e9895['options']?_0x2e9895[_0x58d0('0x1a')]['attributes']||null:null,'limit':_0x2e9895[_0x58d0('0x1a')]?_0x2e9895[_0x58d0('0x1a')][_0x58d0('0x1c')]||null:null,'include':_0x2e9895[_0x58d0('0x1a')]?_0x2e9895[_0x58d0('0x1a')][_0x58d0('0x1d')]?_[_0x58d0('0x1e')](_0x2e9895[_0x58d0('0x1a')]['include'],function(_0x373a0c){return{'model':db[_0x373a0c[_0x58d0('0x1f')]],'as':_0x373a0c['as'],'attributes':_0x373a0c[_0x58d0('0x20')],'include':_0x373a0c['include']?_[_0x58d0('0x1e')](_0x373a0c['include'],function(_0x5c9fea){return{'model':db[_0x5c9fea['model']],'as':_0x5c9fea['as'],'attributes':_0x5c9fea['attributes'],'include':_0x5c9fea[_0x58d0('0x1d')]?_[_0x58d0('0x1e')](_0x5c9fea[_0x58d0('0x1d')],function(_0x392bb9){return{'model':db[_0x392bb9[_0x58d0('0x1f')]],'as':_0x392bb9['as'],'attributes':_0x392bb9[_0x58d0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4740f8){logger[_0x58d0('0xd')](_0x58d0('0x17'),_0x2e9895);logger[_0x58d0('0x10')]('GetVtigerAccount',_0x2e9895,JSON['stringify'](_0x4740f8));_0x18f323(_0x4740f8);})['catch'](function(_0x534f2e){logger['error'](_0x58d0('0x17'),_0x534f2e['message'],_0x2e9895);_0xdb86a9(_0x15536b[_0x58d0('0x12')](0x1f4,_0x534f2e['message']));});});};exports[_0x58d0('0x21')]=function(_0x5d75c2){var _0x10ee92=this;return new Promise(function(_0x1909c8,_0x95e10){return db[_0x58d0('0x18')]['find']({'raw':_0x5d75c2[_0x58d0('0x1a')]?_0x5d75c2[_0x58d0('0x1a')][_0x58d0('0x22')]===undefined?!![]:![]:!![],'where':_0x5d75c2[_0x58d0('0x1a')]?_0x5d75c2[_0x58d0('0x1a')][_0x58d0('0x1b')]||null:null,'attributes':_0x5d75c2['options']?_0x5d75c2[_0x58d0('0x1a')][_0x58d0('0x20')]||null:null,'include':_0x5d75c2[_0x58d0('0x1a')]?_0x5d75c2['options'][_0x58d0('0x1d')]?_[_0x58d0('0x1e')](_0x5d75c2[_0x58d0('0x1a')][_0x58d0('0x1d')],function(_0x19a58a){return{'model':db[_0x19a58a[_0x58d0('0x1f')]],'as':_0x19a58a['as'],'attributes':_0x19a58a[_0x58d0('0x20')],'include':_0x19a58a[_0x58d0('0x1d')]?_[_0x58d0('0x1e')](_0x19a58a[_0x58d0('0x1d')],function(_0x45f645){return{'model':db[_0x45f645[_0x58d0('0x1f')]],'as':_0x45f645['as'],'attributes':_0x45f645[_0x58d0('0x20')],'include':_0x45f645[_0x58d0('0x1d')]?_['map'](_0x45f645[_0x58d0('0x1d')],function(_0x4a620a){return{'model':db[_0x4a620a['model']],'as':_0x4a620a['as'],'attributes':_0x4a620a[_0x58d0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x58d0('0xc')](function(_0x1330af){logger[_0x58d0('0xd')](_0x58d0('0x21'),_0x5d75c2);logger[_0x58d0('0x10')]('ShowVtigerAccount',_0x5d75c2,JSON[_0x58d0('0x23')](_0x1330af));_0x1909c8(_0x1330af);})[_0x58d0('0x16')](function(_0x21a7d4){logger[_0x58d0('0x12')](_0x58d0('0x21'),_0x21a7d4['message'],_0x5d75c2);_0x95e10(_0x10ee92['error'](0x1f4,_0x21a7d4['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 0f04533..eb2e113 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 _0xc4aa=['getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0x12')]);router[_0xac4a('0x13')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x14')]);router[_0xac4a('0x15')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x16')]);module[_0xac4a('0x17')]=router; \ No newline at end of file +var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x5a3f6b,_0x120fb0){var _0x2af25c=function(_0x4d1c49){while(--_0x4d1c49){_0x5a3f6b['push'](_0x5a3f6b['shift']());}};_0x2af25c(++_0x120fb0);}(_0x7a54,0x106));var _0x47a5=function(_0x30099e,_0x4b3ddd){_0x30099e=_0x30099e-0x0;var _0x5db64c=_0x7a54[_0x30099e];return _0x5db64c;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index f4fdb4e..5132060 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 _0x9570=['sequelize','STRING'];(function(_0x5d8623,_0x23828e){var _0x350815=function(_0x38b380){while(--_0x38b380){_0x5d8623['push'](_0x5d8623['shift']());}};_0x350815(++_0x23828e);}(_0x9570,0xe4));var _0x0957=function(_0x31e94f,_0x42ecd6){_0x31e94f=_0x31e94f-0x0;var _0x1b8494=_0x9570[_0x31e94f];return _0x1b8494;};'use strict';var Sequelize=require(_0x0957('0x0'));module['exports']={'name':{'type':Sequelize[_0x0957('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2558=['STRING','sequelize','exports'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x2558,0xee));var _0x8255=function(_0x3fe6db,_0x1bf309){_0x3fe6db=_0x3fe6db-0x0;var _0x17da42=_0x2558[_0x3fe6db];return _0x17da42;};'use strict';var Sequelize=require(_0x8255('0x0'));module[_0x8255('0x1')]={'name':{'type':Sequelize[_0x8255('0x2')]},'description':{'type':Sequelize[_0x8255('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2af8d32..b625802 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 _0x996b=['model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','length','includeAll','find','create','update','body','getFields','findOne','VtigerField','getSubjects','order','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type'];(function(_0x2f2a6f,_0xe63e10){var _0x14441d=function(_0x3ab031){while(--_0x3ab031){_0x2f2a6f['push'](_0x2f2a6f['shift']());}};_0x14441d(++_0xe63e10);}(_0x996b,0xd1));var _0xb996=function(_0x13bf33,_0x45e23f){_0x13bf33=_0x13bf33-0x0;var _0x55d062=_0x996b[_0x13bf33];return _0x55d062;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb996('0x0'));var zipdir=require(_0xb996('0x1'));var jsonpatch=require(_0xb996('0x2'));var rp=require(_0xb996('0x3'));var moment=require('moment');var BPromise=require(_0xb996('0x4'));var Mustache=require(_0xb996('0x5'));var util=require(_0xb996('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb996('0x7'));var ejs=require(_0xb996('0x8'));var fs=require('fs');var fs_extra=require(_0xb996('0x9'));var _=require(_0xb996('0xa'));var squel=require(_0xb996('0xb'));var crypto=require(_0xb996('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb996('0xd'));var toCsv=require(_0xb996('0x7'));var querystring=require(_0xb996('0xe'));var Papa=require(_0xb996('0xf'));var Redis=require(_0xb996('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb996('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb996('0x12'));var logger=require('../../config/logger')(_0xb996('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb996('0x14'))['db'];var jayson=require(_0xb996('0x15'));var client=jayson[_0xb996('0x16')][_0xb996('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x3c1918,_0x3167c1,_0x18b9d9,_0x450f61){return new BPromise(function(_0x2d4f33,_0x1d30a1){var _0x46ae56=_0x450f61||client;return _0x46ae56['request'](_0x3c1918,_0x18b9d9)[_0xb996('0x18')](function(_0x3b46f1){logger[_0xb996('0x19')](_0xb996('0x1a'),_0x3167c1,_0xb996('0x1b'));logger[_0xb996('0x1c')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3167c1,_0xb996('0x1b'),JSON[_0xb996('0x1d')](_0x3b46f1));if(_0x3b46f1[_0xb996('0x1e')]){if(_0x3b46f1[_0xb996('0x1e')]['code']===0x1f4){logger[_0xb996('0x1e')](_0xb996('0x1a'),_0x3167c1,_0x3b46f1[_0xb996('0x1e')][_0xb996('0x1f')]);return _0x1d30a1(_0x3b46f1[_0xb996('0x1e')]['message']);}logger[_0xb996('0x1e')]('VtigerConfiguration,\x20%s,\x20%s',_0x3167c1,_0x3b46f1[_0xb996('0x1e')]['message']);return _0x2d4f33(_0x3b46f1[_0xb996('0x1e')]['message']);}else{logger[_0xb996('0x19')](_0xb996('0x1a'),_0x3167c1,_0xb996('0x1b'));_0x2d4f33(_0x3b46f1[_0xb996('0x20')][_0xb996('0x1f')]);}})[_0xb996('0x21')](function(_0x27bd9a){logger[_0xb996('0x1e')]('VtigerConfiguration,\x20%s,\x20%s',_0x3167c1,_0x27bd9a);_0x1d30a1(_0x27bd9a);});});}function respondWithStatusCode(_0x29e3d3,_0x1a672a){_0x1a672a=_0x1a672a||0xcc;return function(_0x180ab9){if(_0x180ab9){return _0x29e3d3[_0xb996('0x22')](_0x1a672a);}return _0x29e3d3['status'](_0x1a672a)[_0xb996('0x23')]();};}function respondWithResult(_0x535218,_0x1a059d){_0x1a059d=_0x1a059d||0xc8;return function(_0x238009){if(_0x238009){return _0x535218[_0xb996('0x24')](_0x1a059d)[_0xb996('0x25')](_0x238009);}};}function respondWithFilteredResult(_0x4c6573,_0x540a51){return function(_0x370b32){if(_0x370b32){var _0x5dd8ec=_0x370b32[_0xb996('0x26')],_0x4bc1f4=_0x540a51['offset'],_0x1859e7=_0x540a51[_0xb996('0x27')]+_0x540a51[_0xb996('0x28')],_0x26ecb7;if(_0x1859e7>=_0x5dd8ec){_0x1859e7=_0x5dd8ec;_0x26ecb7=0xc8;}else{_0x26ecb7=0xce;}_0x4c6573['status'](_0x26ecb7);return _0x4c6573[_0xb996('0x29')](_0xb996('0x2a'),_0x4bc1f4+'-'+_0x1859e7+'/'+_0x5dd8ec)[_0xb996('0x25')](_0x370b32);}return null;};}function patchUpdates(_0x78cc03){return function(_0x1876c2){try{jsonpatch[_0xb996('0x2b')](_0x1876c2,_0x78cc03,!![]);}catch(_0x457e19){return BPromise[_0xb996('0x2c')](_0x457e19);}return _0x1876c2[_0xb996('0x2d')]();};}function saveUpdates(_0xe4b7a6,_0xd8ccac){return function(_0x46cce8){if(_0x46cce8){return _0x46cce8['update'](_0xe4b7a6)[_0xb996('0x18')](function(_0x144472){return _0x144472;});}return null;};}function removeEntity(_0x1ce1ed,_0x9d1fde){return function(_0x573594){if(_0x573594){return _0x573594[_0xb996('0x2e')]()[_0xb996('0x18')](function(){_0x1ce1ed[_0xb996('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x234a40,_0x4ac440){return function(_0x217563){if(!_0x217563){_0x234a40[_0xb996('0x22')](0x194);}return _0x217563;};}function handleError(_0x16a63e,_0x5aee64){_0x5aee64=_0x5aee64||0x1f4;return function(_0x305a55){logger[_0xb996('0x1e')](_0x305a55[_0xb996('0x2f')]);if(_0x305a55[_0xb996('0x30')]){delete _0x305a55[_0xb996('0x30')];}_0x16a63e[_0xb996('0x24')](_0x5aee64)['send'](_0x305a55);};}exports[_0xb996('0x31')]=function(_0x220617,_0x4ef6d6){var _0x294953={},_0x4d059a={},_0x9e73c2={'count':0x0,'rows':[]};var _0x57ca54=_[_0xb996('0x32')](db[_0xb996('0x33')][_0xb996('0x34')],function(_0x29fca5){return{'name':_0x29fca5[_0xb996('0x35')],'type':_0x29fca5[_0xb996('0x36')]['key']};});_0x4d059a[_0xb996('0x37')]=_[_0xb996('0x32')](_0x57ca54,_0xb996('0x30'));_0x4d059a[_0xb996('0x38')]=_['keys'](_0x220617[_0xb996('0x38')]);_0x4d059a[_0xb996('0x39')]=_[_0xb996('0x3a')](_0x4d059a[_0xb996('0x37')],_0x4d059a[_0xb996('0x38')]);_0x294953[_0xb996('0x3b')]=_[_0xb996('0x3a')](_0x4d059a[_0xb996('0x37')],qs[_0xb996('0x3c')](_0x220617['query'][_0xb996('0x3c')]));_0x294953[_0xb996('0x3b')]=_0x294953[_0xb996('0x3b')]['length']?_0x294953[_0xb996('0x3b')]:_0x4d059a[_0xb996('0x37')];if(!_0x220617[_0xb996('0x38')][_0xb996('0x3d')](_0xb996('0x3e'))){_0x294953['limit']=qs[_0xb996('0x28')](_0x220617[_0xb996('0x38')][_0xb996('0x28')]);_0x294953['offset']=qs[_0xb996('0x27')](_0x220617[_0xb996('0x38')]['offset']);}_0x294953['order']=qs['sort'](_0x220617[_0xb996('0x38')][_0xb996('0x3f')]);_0x294953['where']=qs[_0xb996('0x39')](_[_0xb996('0x40')](_0x220617[_0xb996('0x38')],_0x4d059a[_0xb996('0x39')]),_0x57ca54);if(_0x220617[_0xb996('0x38')][_0xb996('0x41')]){_0x294953[_0xb996('0x42')]=_[_0xb996('0x43')](_0x294953[_0xb996('0x42')],{'$or':_[_0xb996('0x32')](_0x57ca54,function(_0x1e88be){if(_0x1e88be[_0xb996('0x36')]!==_0xb996('0x44')){var _0x523c78={};_0x523c78[_0x1e88be[_0xb996('0x30')]]={'$like':'%'+_0x220617[_0xb996('0x38')]['filter']+'%'};return _0x523c78;}})});}_0x294953=_[_0xb996('0x43')]({},_0x294953,_0x220617[_0xb996('0x45')]);var _0x2278fc={'where':_0x294953['where']};return db[_0xb996('0x33')][_0xb996('0x26')](_0x2278fc)[_0xb996('0x18')](function(_0x4b586f){_0x9e73c2[_0xb996('0x26')]=_0x4b586f;if(_0x220617[_0xb996('0x38')]['includeAll']){_0x294953[_0xb996('0x46')]=[{'all':!![]}];}return db[_0xb996('0x33')][_0xb996('0x47')](_0x294953);})[_0xb996('0x18')](function(_0x3d13a1){_0x9e73c2[_0xb996('0x48')]=_0x3d13a1;return _0x9e73c2;})['then'](respondWithFilteredResult(_0x4ef6d6,_0x294953))['catch'](handleError(_0x4ef6d6,null));};exports[_0xb996('0x49')]=function(_0x295a6f,_0x4bbd91){var _0x2e1149={'raw':![],'where':{'id':_0x295a6f[_0xb996('0x4a')]['id']}},_0x4ea054={};_0x4ea054['model']=_['keys'](db[_0xb996('0x33')][_0xb996('0x34')]);_0x4ea054[_0xb996('0x38')]=_[_0xb996('0x4b')](_0x295a6f[_0xb996('0x38')]);_0x4ea054[_0xb996('0x39')]=_['intersection'](_0x4ea054[_0xb996('0x37')],_0x4ea054[_0xb996('0x38')]);_0x2e1149[_0xb996('0x3b')]=_[_0xb996('0x3a')](_0x4ea054[_0xb996('0x37')],qs[_0xb996('0x3c')](_0x295a6f[_0xb996('0x38')][_0xb996('0x3c')]));_0x2e1149['attributes']=_0x2e1149[_0xb996('0x3b')][_0xb996('0x4c')]?_0x2e1149['attributes']:_0x4ea054[_0xb996('0x37')];if(_0x295a6f[_0xb996('0x38')][_0xb996('0x4d')]){_0x2e1149[_0xb996('0x46')]=[{'all':!![]}];}_0x2e1149=_[_0xb996('0x43')]({},_0x2e1149,_0x295a6f[_0xb996('0x45')]);return db[_0xb996('0x33')][_0xb996('0x4e')](_0x2e1149)[_0xb996('0x18')](handleEntityNotFound(_0x4bbd91,null))[_0xb996('0x18')](respondWithResult(_0x4bbd91,null))[_0xb996('0x21')](handleError(_0x4bbd91,null));};exports['create']=function(_0x48f2c6,_0x343360){return db[_0xb996('0x33')][_0xb996('0x4f')](_0x48f2c6['body'],{})[_0xb996('0x18')](respondWithResult(_0x343360,0xc9))['catch'](handleError(_0x343360,null));};exports[_0xb996('0x50')]=function(_0x2d8886,_0x7650e3){if(_0x2d8886['body']['id']){delete _0x2d8886[_0xb996('0x51')]['id'];}return db['VtigerConfiguration'][_0xb996('0x4e')]({'where':{'id':_0x2d8886['params']['id']}})[_0xb996('0x18')](handleEntityNotFound(_0x7650e3,null))['then'](saveUpdates(_0x2d8886[_0xb996('0x51')],null))[_0xb996('0x18')](respondWithResult(_0x7650e3,null))[_0xb996('0x21')](handleError(_0x7650e3,null));};exports['destroy']=function(_0x25bec7,_0x2f724c){return db[_0xb996('0x33')][_0xb996('0x4e')]({'where':{'id':_0x25bec7[_0xb996('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f724c,null))['then'](removeEntity(_0x2f724c,null))[_0xb996('0x21')](handleError(_0x2f724c,null));};exports[_0xb996('0x52')]=function(_0x4710e0,_0x4cf036,_0x24d558){var _0x2aa551={};var _0x34421b={};var _0x259288;var _0x38dbd4;return db[_0xb996('0x33')][_0xb996('0x53')]({'where':{'id':_0x4710e0[_0xb996('0x4a')]['id']}})[_0xb996('0x18')](handleEntityNotFound(_0x4cf036,null))[_0xb996('0x18')](function(_0x4f9abe){if(_0x4f9abe){_0x259288=_0x4f9abe;_0x34421b[_0xb996('0x37')]=_['keys'](db[_0xb996('0x54')][_0xb996('0x34')]);_0x34421b['query']=_[_0xb996('0x4b')](_0x4710e0['query']);_0x34421b[_0xb996('0x39')]=_['intersection'](_0x34421b[_0xb996('0x37')],_0x34421b[_0xb996('0x38')]);_0x2aa551['attributes']=_['intersection'](_0x34421b[_0xb996('0x37')],qs['fields'](_0x4710e0['query'][_0xb996('0x3c')]));_0x2aa551[_0xb996('0x3b')]=_0x2aa551[_0xb996('0x3b')][_0xb996('0x4c')]?_0x2aa551[_0xb996('0x3b')]:_0x34421b[_0xb996('0x37')];_0x2aa551['order']=qs[_0xb996('0x3f')](_0x4710e0[_0xb996('0x38')][_0xb996('0x3f')]);_0x2aa551[_0xb996('0x42')]=qs[_0xb996('0x39')](_[_0xb996('0x40')](_0x4710e0[_0xb996('0x38')],_0x34421b[_0xb996('0x39')]));if(_0x4710e0[_0xb996('0x38')][_0xb996('0x41')]){_0x2aa551[_0xb996('0x42')]=_[_0xb996('0x43')](_0x2aa551[_0xb996('0x42')],{'$or':_['map'](_0x2aa551[_0xb996('0x3b')],function(_0x5d3416){var _0x54b476={};_0x54b476[_0x5d3416]={'$like':'%'+_0x4710e0[_0xb996('0x38')]['filter']+'%'};return _0x54b476;})});}_0x2aa551=_[_0xb996('0x43')]({},_0x2aa551,_0x4710e0['options']);return _0x259288[_0xb996('0x52')](_0x2aa551);}})[_0xb996('0x18')](function(_0x308f18){if(_0x308f18){_0x38dbd4=_0x308f18[_0xb996('0x4c')];if(!_0x4710e0[_0xb996('0x38')][_0xb996('0x3d')](_0xb996('0x3e'))){_0x2aa551[_0xb996('0x28')]=qs[_0xb996('0x28')](_0x4710e0[_0xb996('0x38')][_0xb996('0x28')]);_0x2aa551[_0xb996('0x27')]=qs[_0xb996('0x27')](_0x4710e0[_0xb996('0x38')]['offset']);}return _0x259288[_0xb996('0x52')](_0x2aa551);}})[_0xb996('0x18')](function(_0x16bc8b){if(_0x16bc8b){return _0x16bc8b?{'count':_0x38dbd4,'rows':_0x16bc8b}:null;}})[_0xb996('0x18')](respondWithResult(_0x4cf036,null))[_0xb996('0x21')](handleError(_0x4cf036,null));};exports[_0xb996('0x55')]=function(_0x5039ce,_0x28cc07,_0x6bd5b4){var _0x4cf9bc={};var _0x235dfe={};var _0x445657;var _0x274bfb;return db[_0xb996('0x33')]['findOne']({'where':{'id':_0x5039ce[_0xb996('0x4a')]['id']}})[_0xb996('0x18')](handleEntityNotFound(_0x28cc07,null))[_0xb996('0x18')](function(_0x2853ed){if(_0x2853ed){_0x445657=_0x2853ed;_0x235dfe['model']=_[_0xb996('0x4b')](db['VtigerField'][_0xb996('0x34')]);_0x235dfe['query']=_['keys'](_0x5039ce[_0xb996('0x38')]);_0x235dfe[_0xb996('0x39')]=_['intersection'](_0x235dfe['model'],_0x235dfe[_0xb996('0x38')]);_0x4cf9bc[_0xb996('0x3b')]=_[_0xb996('0x3a')](_0x235dfe[_0xb996('0x37')],qs[_0xb996('0x3c')](_0x5039ce[_0xb996('0x38')][_0xb996('0x3c')]));_0x4cf9bc['attributes']=_0x4cf9bc[_0xb996('0x3b')][_0xb996('0x4c')]?_0x4cf9bc['attributes']:_0x235dfe[_0xb996('0x37')];_0x4cf9bc['order']=qs[_0xb996('0x3f')](_0x5039ce['query']['sort']);_0x4cf9bc['where']=qs[_0xb996('0x39')](_['pick'](_0x5039ce[_0xb996('0x38')],_0x235dfe[_0xb996('0x39')]));if(_0x5039ce[_0xb996('0x38')]['filter']){_0x4cf9bc[_0xb996('0x42')]=_['merge'](_0x4cf9bc['where'],{'$or':_[_0xb996('0x32')](_0x4cf9bc[_0xb996('0x3b')],function(_0x29b0d9){var _0x4d02da={};_0x4d02da[_0x29b0d9]={'$like':'%'+_0x5039ce[_0xb996('0x38')]['filter']+'%'};return _0x4d02da;})});}_0x4cf9bc=_['merge']({},_0x4cf9bc,_0x5039ce[_0xb996('0x45')]);return _0x445657[_0xb996('0x55')](_0x4cf9bc);}})[_0xb996('0x18')](function(_0x2faca5){if(_0x2faca5){_0x274bfb=_0x2faca5[_0xb996('0x4c')];if(!_0x5039ce[_0xb996('0x38')]['hasOwnProperty']('nolimit')){_0x4cf9bc[_0xb996('0x28')]=qs[_0xb996('0x28')](_0x5039ce[_0xb996('0x38')][_0xb996('0x28')]);_0x4cf9bc[_0xb996('0x27')]=qs[_0xb996('0x27')](_0x5039ce[_0xb996('0x38')][_0xb996('0x27')]);}return _0x445657[_0xb996('0x55')](_0x4cf9bc);}})[_0xb996('0x18')](function(_0x2c18e2){if(_0x2c18e2){return _0x2c18e2?{'count':_0x274bfb,'rows':_0x2c18e2}:null;}})[_0xb996('0x18')](respondWithResult(_0x28cc07,null))[_0xb996('0x21')](handleError(_0x28cc07,null));};exports['getDescriptions']=function(_0x5a6f17,_0xed9e3c,_0x25a178){var _0x3cf93b={};var _0x98bc87={};var _0xbeb841;var _0x2e8fa7;return db[_0xb996('0x33')][_0xb996('0x53')]({'where':{'id':_0x5a6f17[_0xb996('0x4a')]['id']}})[_0xb996('0x18')](handleEntityNotFound(_0xed9e3c,null))[_0xb996('0x18')](function(_0x57516b){if(_0x57516b){_0xbeb841=_0x57516b;_0x98bc87[_0xb996('0x37')]=_[_0xb996('0x4b')](db[_0xb996('0x54')][_0xb996('0x34')]);_0x98bc87[_0xb996('0x38')]=_[_0xb996('0x4b')](_0x5a6f17[_0xb996('0x38')]);_0x98bc87[_0xb996('0x39')]=_['intersection'](_0x98bc87[_0xb996('0x37')],_0x98bc87['query']);_0x3cf93b[_0xb996('0x3b')]=_[_0xb996('0x3a')](_0x98bc87[_0xb996('0x37')],qs[_0xb996('0x3c')](_0x5a6f17[_0xb996('0x38')][_0xb996('0x3c')]));_0x3cf93b[_0xb996('0x3b')]=_0x3cf93b[_0xb996('0x3b')][_0xb996('0x4c')]?_0x3cf93b[_0xb996('0x3b')]:_0x98bc87['model'];_0x3cf93b[_0xb996('0x56')]=qs[_0xb996('0x3f')](_0x5a6f17[_0xb996('0x38')][_0xb996('0x3f')]);_0x3cf93b[_0xb996('0x42')]=qs[_0xb996('0x39')](_[_0xb996('0x40')](_0x5a6f17[_0xb996('0x38')],_0x98bc87[_0xb996('0x39')]));if(_0x5a6f17[_0xb996('0x38')][_0xb996('0x41')]){_0x3cf93b['where']=_[_0xb996('0x43')](_0x3cf93b[_0xb996('0x42')],{'$or':_[_0xb996('0x32')](_0x3cf93b[_0xb996('0x3b')],function(_0x5e89ab){var _0x968620={};_0x968620[_0x5e89ab]={'$like':'%'+_0x5a6f17[_0xb996('0x38')][_0xb996('0x41')]+'%'};return _0x968620;})});}_0x3cf93b=_['merge']({},_0x3cf93b,_0x5a6f17[_0xb996('0x45')]);return _0xbeb841[_0xb996('0x57')](_0x3cf93b);}})[_0xb996('0x18')](function(_0x2ac54){if(_0x2ac54){_0x2e8fa7=_0x2ac54['length'];if(!_0x5a6f17[_0xb996('0x38')][_0xb996('0x3d')](_0xb996('0x3e'))){_0x3cf93b[_0xb996('0x28')]=qs[_0xb996('0x28')](_0x5a6f17[_0xb996('0x38')]['limit']);_0x3cf93b[_0xb996('0x27')]=qs['offset'](_0x5a6f17[_0xb996('0x38')][_0xb996('0x27')]);}return _0xbeb841[_0xb996('0x57')](_0x3cf93b);}})[_0xb996('0x18')](function(_0x1ebc92){if(_0x1ebc92){return _0x1ebc92?{'count':_0x2e8fa7,'rows':_0x1ebc92}:null;}})['then'](respondWithResult(_0xed9e3c,null))[_0xb996('0x21')](handleError(_0xed9e3c,null));}; \ No newline at end of file +var _0xa78b=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','show','params','merge','find','create','body','findOne','VtigerField','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','model','query'];(function(_0x3bdcb3,_0x177e50){var _0xc93db3=function(_0x2d976a){while(--_0x2d976a){_0x3bdcb3['push'](_0x3bdcb3['shift']());}};_0xc93db3(++_0x177e50);}(_0xa78b,0xd5));var _0xba78=function(_0x1caf1e,_0x34fbb4){_0x1caf1e=_0x1caf1e-0x0;var _0x2f485d=_0xa78b[_0x1caf1e];return _0x2f485d;};'use strict';var emlformat=require(_0xba78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba78('0x1'));var jsonpatch=require(_0xba78('0x2'));var rp=require(_0xba78('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xba78('0x4'));var util=require('util');var path=require(_0xba78('0x5'));var sox=require(_0xba78('0x6'));var csv=require(_0xba78('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba78('0x8'));var squel=require('squel');var crypto=require(_0xba78('0x9'));var jsforce=require(_0xba78('0xa'));var deskjs=require(_0xba78('0xb'));var toCsv=require(_0xba78('0x7'));var querystring=require(_0xba78('0xc'));var Papa=require(_0xba78('0xd'));var Redis=require(_0xba78('0xe'));var authService=require(_0xba78('0xf'));var qs=require(_0xba78('0x10'));var as=require(_0xba78('0x11'));var hardwareService=require(_0xba78('0x12'));var logger=require(_0xba78('0x13'))(_0xba78('0x14'));var utils=require(_0xba78('0x15'));var config=require(_0xba78('0x16'));var licenseUtil=require(_0xba78('0x17'));var db=require(_0xba78('0x18'))['db'];var jayson=require(_0xba78('0x19'));var client=jayson[_0xba78('0x1a')][_0xba78('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x12625f,_0x1b810a,_0x3bcffd,_0x1905e5){return new BPromise(function(_0x3b2862,_0x86967f){var _0xa1a8b3=_0x1905e5||client;return _0xa1a8b3['request'](_0x12625f,_0x3bcffd)['then'](function(_0x5e5acf){logger[_0xba78('0x1c')](_0xba78('0x1d'),_0x1b810a,_0xba78('0x1e'));logger['debug'](_0xba78('0x1f'),_0x1b810a,_0xba78('0x1e'),JSON[_0xba78('0x20')](_0x5e5acf));if(_0x5e5acf['error']){if(_0x5e5acf['error']['code']===0x1f4){logger[_0xba78('0x21')](_0xba78('0x1d'),_0x1b810a,_0x5e5acf[_0xba78('0x21')][_0xba78('0x22')]);return _0x86967f(_0x5e5acf[_0xba78('0x21')][_0xba78('0x22')]);}logger[_0xba78('0x21')](_0xba78('0x1d'),_0x1b810a,_0x5e5acf[_0xba78('0x21')][_0xba78('0x22')]);return _0x3b2862(_0x5e5acf['error'][_0xba78('0x22')]);}else{logger['info'](_0xba78('0x1d'),_0x1b810a,'request\x20sent');_0x3b2862(_0x5e5acf[_0xba78('0x23')][_0xba78('0x22')]);}})[_0xba78('0x24')](function(_0x352a4f){logger[_0xba78('0x21')](_0xba78('0x1d'),_0x1b810a,_0x352a4f);_0x86967f(_0x352a4f);});});}function respondWithStatusCode(_0x1f1c48,_0x425dff){_0x425dff=_0x425dff||0xcc;return function(_0x4072db){if(_0x4072db){return _0x1f1c48[_0xba78('0x25')](_0x425dff);}return _0x1f1c48['status'](_0x425dff)[_0xba78('0x26')]();};}function respondWithResult(_0x2c9d8c,_0xfb1ca4){_0xfb1ca4=_0xfb1ca4||0xc8;return function(_0x19e88e){if(_0x19e88e){return _0x2c9d8c['status'](_0xfb1ca4)['json'](_0x19e88e);}};}function respondWithFilteredResult(_0x5d51c0,_0x548179){return function(_0x7355d9){if(_0x7355d9){var _0x3d678a=_0x7355d9[_0xba78('0x27')],_0x3384a7=_0x548179[_0xba78('0x28')],_0x27f97e=_0x548179[_0xba78('0x28')]+_0x548179[_0xba78('0x29')],_0x330ac6;if(_0x27f97e>=_0x3d678a){_0x27f97e=_0x3d678a;_0x330ac6=0xc8;}else{_0x330ac6=0xce;}_0x5d51c0[_0xba78('0x2a')](_0x330ac6);return _0x5d51c0[_0xba78('0x2b')](_0xba78('0x2c'),_0x3384a7+'-'+_0x27f97e+'/'+_0x3d678a)[_0xba78('0x2d')](_0x7355d9);}return null;};}function patchUpdates(_0x298b40){return function(_0x3e6f91){try{jsonpatch[_0xba78('0x2e')](_0x3e6f91,_0x298b40,!![]);}catch(_0x1da01d){return BPromise[_0xba78('0x2f')](_0x1da01d);}return _0x3e6f91[_0xba78('0x30')]();};}function saveUpdates(_0x8c792e,_0x441873){return function(_0x1f9bef){if(_0x1f9bef){return _0x1f9bef[_0xba78('0x31')](_0x8c792e)[_0xba78('0x32')](function(_0x5bbb07){return _0x5bbb07;});}return null;};}function removeEntity(_0x18dc1b,_0x5816b8){return function(_0x1bb72d){if(_0x1bb72d){return _0x1bb72d[_0xba78('0x33')]()[_0xba78('0x32')](function(){_0x18dc1b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10d4c2,_0x365637){return function(_0x4e8edb){if(!_0x4e8edb){_0x10d4c2['sendStatus'](0x194);}return _0x4e8edb;};}function handleError(_0x3a1700,_0x4b5da0){_0x4b5da0=_0x4b5da0||0x1f4;return function(_0x2e7f2d){logger[_0xba78('0x21')](_0x2e7f2d[_0xba78('0x34')]);if(_0x2e7f2d[_0xba78('0x35')]){delete _0x2e7f2d[_0xba78('0x35')];}_0x3a1700[_0xba78('0x2a')](_0x4b5da0)[_0xba78('0x36')](_0x2e7f2d);};}exports[_0xba78('0x37')]=function(_0x5cc774,_0x4ee2d5){var _0x4796ef={},_0x5d469c={},_0x1ff4c0={'count':0x0,'rows':[]};var _0xbace79=_[_0xba78('0x38')](db[_0xba78('0x39')][_0xba78('0x3a')],function(_0x33eb48){return{'name':_0x33eb48[_0xba78('0x3b')],'type':_0x33eb48[_0xba78('0x3c')]['key']};});_0x5d469c[_0xba78('0x3d')]=_[_0xba78('0x38')](_0xbace79,_0xba78('0x35'));_0x5d469c[_0xba78('0x3e')]=_[_0xba78('0x3f')](_0x5cc774[_0xba78('0x3e')]);_0x5d469c[_0xba78('0x40')]=_[_0xba78('0x41')](_0x5d469c[_0xba78('0x3d')],_0x5d469c['query']);_0x4796ef['attributes']=_[_0xba78('0x41')](_0x5d469c[_0xba78('0x3d')],qs[_0xba78('0x42')](_0x5cc774[_0xba78('0x3e')][_0xba78('0x42')]));_0x4796ef[_0xba78('0x43')]=_0x4796ef[_0xba78('0x43')][_0xba78('0x44')]?_0x4796ef[_0xba78('0x43')]:_0x5d469c[_0xba78('0x3d')];if(!_0x5cc774[_0xba78('0x3e')][_0xba78('0x45')](_0xba78('0x46'))){_0x4796ef[_0xba78('0x29')]=qs[_0xba78('0x29')](_0x5cc774['query'][_0xba78('0x29')]);_0x4796ef['offset']=qs[_0xba78('0x28')](_0x5cc774[_0xba78('0x3e')][_0xba78('0x28')]);}_0x4796ef[_0xba78('0x47')]=qs[_0xba78('0x48')](_0x5cc774[_0xba78('0x3e')]['sort']);_0x4796ef[_0xba78('0x49')]=qs['filters'](_[_0xba78('0x4a')](_0x5cc774['query'],_0x5d469c[_0xba78('0x40')]),_0xbace79);if(_0x5cc774[_0xba78('0x3e')][_0xba78('0x4b')]){_0x4796ef[_0xba78('0x49')]=_['merge'](_0x4796ef[_0xba78('0x49')],{'$or':_['map'](_0xbace79,function(_0x49eae8){if(_0x49eae8['type']!=='VIRTUAL'){var _0x3fc41d={};_0x3fc41d[_0x49eae8[_0xba78('0x35')]]={'$like':'%'+_0x5cc774['query'][_0xba78('0x4b')]+'%'};return _0x3fc41d;}})});}_0x4796ef=_['merge']({},_0x4796ef,_0x5cc774[_0xba78('0x4c')]);var _0x42ab77={'where':_0x4796ef[_0xba78('0x49')]};return db['VtigerConfiguration']['count'](_0x42ab77)[_0xba78('0x32')](function(_0x4b298e){_0x1ff4c0[_0xba78('0x27')]=_0x4b298e;if(_0x5cc774[_0xba78('0x3e')][_0xba78('0x4d')]){_0x4796ef[_0xba78('0x4e')]=[{'all':!![]}];}return db[_0xba78('0x39')][_0xba78('0x4f')](_0x4796ef);})['then'](function(_0x3ffae9){_0x1ff4c0[_0xba78('0x50')]=_0x3ffae9;return _0x1ff4c0;})[_0xba78('0x32')](respondWithFilteredResult(_0x4ee2d5,_0x4796ef))[_0xba78('0x24')](handleError(_0x4ee2d5,null));};exports[_0xba78('0x51')]=function(_0x3e33fc,_0xb25da){var _0x5df8d2={'raw':![],'where':{'id':_0x3e33fc[_0xba78('0x52')]['id']}},_0x448a2a={};_0x448a2a[_0xba78('0x3d')]=_[_0xba78('0x3f')](db[_0xba78('0x39')][_0xba78('0x3a')]);_0x448a2a['query']=_[_0xba78('0x3f')](_0x3e33fc['query']);_0x448a2a[_0xba78('0x40')]=_[_0xba78('0x41')](_0x448a2a[_0xba78('0x3d')],_0x448a2a[_0xba78('0x3e')]);_0x5df8d2[_0xba78('0x43')]=_[_0xba78('0x41')](_0x448a2a[_0xba78('0x3d')],qs[_0xba78('0x42')](_0x3e33fc['query'][_0xba78('0x42')]));_0x5df8d2[_0xba78('0x43')]=_0x5df8d2[_0xba78('0x43')][_0xba78('0x44')]?_0x5df8d2[_0xba78('0x43')]:_0x448a2a[_0xba78('0x3d')];if(_0x3e33fc[_0xba78('0x3e')][_0xba78('0x4d')]){_0x5df8d2['include']=[{'all':!![]}];}_0x5df8d2=_[_0xba78('0x53')]({},_0x5df8d2,_0x3e33fc['options']);return db[_0xba78('0x39')][_0xba78('0x54')](_0x5df8d2)[_0xba78('0x32')](handleEntityNotFound(_0xb25da,null))[_0xba78('0x32')](respondWithResult(_0xb25da,null))[_0xba78('0x24')](handleError(_0xb25da,null));};exports[_0xba78('0x55')]=function(_0x31ea2b,_0x33c5d6){return db[_0xba78('0x39')]['create'](_0x31ea2b['body'],{})[_0xba78('0x32')](respondWithResult(_0x33c5d6,0xc9))[_0xba78('0x24')](handleError(_0x33c5d6,null));};exports[_0xba78('0x31')]=function(_0x4070cd,_0x2e56a7){if(_0x4070cd['body']['id']){delete _0x4070cd[_0xba78('0x56')]['id'];}return db[_0xba78('0x39')]['find']({'where':{'id':_0x4070cd[_0xba78('0x52')]['id']}})[_0xba78('0x32')](handleEntityNotFound(_0x2e56a7,null))['then'](saveUpdates(_0x4070cd[_0xba78('0x56')],null))[_0xba78('0x32')](respondWithResult(_0x2e56a7,null))[_0xba78('0x24')](handleError(_0x2e56a7,null));};exports['destroy']=function(_0x5a3a98,_0x28fef6){return db['VtigerConfiguration'][_0xba78('0x54')]({'where':{'id':_0x5a3a98[_0xba78('0x52')]['id']}})[_0xba78('0x32')](handleEntityNotFound(_0x28fef6,null))[_0xba78('0x32')](removeEntity(_0x28fef6,null))[_0xba78('0x24')](handleError(_0x28fef6,null));};exports['getFields']=function(_0x10d094,_0x50a4a6,_0x3275b7){var _0x44154c={};var _0x15826d={};var _0xa8854d;var _0x464c4;return db['VtigerConfiguration'][_0xba78('0x57')]({'where':{'id':_0x10d094[_0xba78('0x52')]['id']}})[_0xba78('0x32')](handleEntityNotFound(_0x50a4a6,null))['then'](function(_0x657a9){if(_0x657a9){_0xa8854d=_0x657a9;_0x15826d[_0xba78('0x3d')]=_[_0xba78('0x3f')](db[_0xba78('0x58')][_0xba78('0x3a')]);_0x15826d[_0xba78('0x3e')]=_[_0xba78('0x3f')](_0x10d094[_0xba78('0x3e')]);_0x15826d['filters']=_[_0xba78('0x41')](_0x15826d[_0xba78('0x3d')],_0x15826d['query']);_0x44154c['attributes']=_['intersection'](_0x15826d['model'],qs[_0xba78('0x42')](_0x10d094['query']['fields']));_0x44154c[_0xba78('0x43')]=_0x44154c[_0xba78('0x43')][_0xba78('0x44')]?_0x44154c[_0xba78('0x43')]:_0x15826d[_0xba78('0x3d')];_0x44154c[_0xba78('0x47')]=qs[_0xba78('0x48')](_0x10d094[_0xba78('0x3e')][_0xba78('0x48')]);_0x44154c[_0xba78('0x49')]=qs[_0xba78('0x40')](_[_0xba78('0x4a')](_0x10d094[_0xba78('0x3e')],_0x15826d[_0xba78('0x40')]));if(_0x10d094[_0xba78('0x3e')][_0xba78('0x4b')]){_0x44154c[_0xba78('0x49')]=_[_0xba78('0x53')](_0x44154c[_0xba78('0x49')],{'$or':_[_0xba78('0x38')](_0x44154c['attributes'],function(_0x3b4337){var _0x220e23={};_0x220e23[_0x3b4337]={'$like':'%'+_0x10d094['query']['filter']+'%'};return _0x220e23;})});}_0x44154c=_[_0xba78('0x53')]({},_0x44154c,_0x10d094['options']);return _0xa8854d[_0xba78('0x59')](_0x44154c);}})[_0xba78('0x32')](function(_0x494606){if(_0x494606){_0x464c4=_0x494606[_0xba78('0x44')];if(!_0x10d094[_0xba78('0x3e')]['hasOwnProperty'](_0xba78('0x46'))){_0x44154c['limit']=qs['limit'](_0x10d094[_0xba78('0x3e')]['limit']);_0x44154c[_0xba78('0x28')]=qs[_0xba78('0x28')](_0x10d094[_0xba78('0x3e')]['offset']);}return _0xa8854d['getFields'](_0x44154c);}})[_0xba78('0x32')](function(_0x4d3681){if(_0x4d3681){return _0x4d3681?{'count':_0x464c4,'rows':_0x4d3681}:null;}})[_0xba78('0x32')](respondWithResult(_0x50a4a6,null))[_0xba78('0x24')](handleError(_0x50a4a6,null));};exports[_0xba78('0x5a')]=function(_0x178298,_0x41ed6f,_0x187616){var _0x504345={};var _0x2a8fc7={};var _0x5e8b42;var _0x1e5342;return db[_0xba78('0x39')][_0xba78('0x57')]({'where':{'id':_0x178298[_0xba78('0x52')]['id']}})[_0xba78('0x32')](handleEntityNotFound(_0x41ed6f,null))[_0xba78('0x32')](function(_0x58154a){if(_0x58154a){_0x5e8b42=_0x58154a;_0x2a8fc7['model']=_[_0xba78('0x3f')](db[_0xba78('0x58')]['rawAttributes']);_0x2a8fc7[_0xba78('0x3e')]=_[_0xba78('0x3f')](_0x178298[_0xba78('0x3e')]);_0x2a8fc7[_0xba78('0x40')]=_['intersection'](_0x2a8fc7[_0xba78('0x3d')],_0x2a8fc7[_0xba78('0x3e')]);_0x504345[_0xba78('0x43')]=_[_0xba78('0x41')](_0x2a8fc7[_0xba78('0x3d')],qs['fields'](_0x178298[_0xba78('0x3e')][_0xba78('0x42')]));_0x504345[_0xba78('0x43')]=_0x504345[_0xba78('0x43')][_0xba78('0x44')]?_0x504345[_0xba78('0x43')]:_0x2a8fc7[_0xba78('0x3d')];_0x504345[_0xba78('0x47')]=qs['sort'](_0x178298[_0xba78('0x3e')][_0xba78('0x48')]);_0x504345[_0xba78('0x49')]=qs['filters'](_[_0xba78('0x4a')](_0x178298[_0xba78('0x3e')],_0x2a8fc7[_0xba78('0x40')]));if(_0x178298[_0xba78('0x3e')][_0xba78('0x4b')]){_0x504345['where']=_['merge'](_0x504345[_0xba78('0x49')],{'$or':_[_0xba78('0x38')](_0x504345[_0xba78('0x43')],function(_0x4a44ea){var _0xbc16f3={};_0xbc16f3[_0x4a44ea]={'$like':'%'+_0x178298[_0xba78('0x3e')]['filter']+'%'};return _0xbc16f3;})});}_0x504345=_['merge']({},_0x504345,_0x178298[_0xba78('0x4c')]);return _0x5e8b42['getSubjects'](_0x504345);}})['then'](function(_0x4666a8){if(_0x4666a8){_0x1e5342=_0x4666a8[_0xba78('0x44')];if(!_0x178298[_0xba78('0x3e')]['hasOwnProperty'](_0xba78('0x46'))){_0x504345[_0xba78('0x29')]=qs['limit'](_0x178298[_0xba78('0x3e')][_0xba78('0x29')]);_0x504345[_0xba78('0x28')]=qs[_0xba78('0x28')](_0x178298[_0xba78('0x3e')]['offset']);}return _0x5e8b42[_0xba78('0x5a')](_0x504345);}})[_0xba78('0x32')](function(_0x45bf45){if(_0x45bf45){return _0x45bf45?{'count':_0x1e5342,'rows':_0x45bf45}:null;}})['then'](respondWithResult(_0x41ed6f,null))[_0xba78('0x24')](handleError(_0x41ed6f,null));};exports[_0xba78('0x5b')]=function(_0x69b1f1,_0xa2eb86,_0x335e82){var _0x1a569c={};var _0xc8d1c9={};var _0x4df928;var _0x5c7316;return db[_0xba78('0x39')]['findOne']({'where':{'id':_0x69b1f1[_0xba78('0x52')]['id']}})[_0xba78('0x32')](handleEntityNotFound(_0xa2eb86,null))[_0xba78('0x32')](function(_0x438903){if(_0x438903){_0x4df928=_0x438903;_0xc8d1c9['model']=_[_0xba78('0x3f')](db[_0xba78('0x58')]['rawAttributes']);_0xc8d1c9[_0xba78('0x3e')]=_[_0xba78('0x3f')](_0x69b1f1[_0xba78('0x3e')]);_0xc8d1c9['filters']=_['intersection'](_0xc8d1c9[_0xba78('0x3d')],_0xc8d1c9[_0xba78('0x3e')]);_0x1a569c[_0xba78('0x43')]=_[_0xba78('0x41')](_0xc8d1c9[_0xba78('0x3d')],qs[_0xba78('0x42')](_0x69b1f1[_0xba78('0x3e')][_0xba78('0x42')]));_0x1a569c[_0xba78('0x43')]=_0x1a569c['attributes'][_0xba78('0x44')]?_0x1a569c[_0xba78('0x43')]:_0xc8d1c9[_0xba78('0x3d')];_0x1a569c['order']=qs[_0xba78('0x48')](_0x69b1f1['query']['sort']);_0x1a569c[_0xba78('0x49')]=qs[_0xba78('0x40')](_[_0xba78('0x4a')](_0x69b1f1['query'],_0xc8d1c9[_0xba78('0x40')]));if(_0x69b1f1['query']['filter']){_0x1a569c[_0xba78('0x49')]=_[_0xba78('0x53')](_0x1a569c[_0xba78('0x49')],{'$or':_['map'](_0x1a569c[_0xba78('0x43')],function(_0x562159){var _0x1880ea={};_0x1880ea[_0x562159]={'$like':'%'+_0x69b1f1['query'][_0xba78('0x4b')]+'%'};return _0x1880ea;})});}_0x1a569c=_['merge']({},_0x1a569c,_0x69b1f1[_0xba78('0x4c')]);return _0x4df928[_0xba78('0x5b')](_0x1a569c);}})[_0xba78('0x32')](function(_0x1b33f9){if(_0x1b33f9){_0x5c7316=_0x1b33f9['length'];if(!_0x69b1f1[_0xba78('0x3e')][_0xba78('0x45')]('nolimit')){_0x1a569c['limit']=qs['limit'](_0x69b1f1[_0xba78('0x3e')][_0xba78('0x29')]);_0x1a569c[_0xba78('0x28')]=qs[_0xba78('0x28')](_0x69b1f1[_0xba78('0x3e')][_0xba78('0x28')]);}return _0x4df928[_0xba78('0x5b')](_0x1a569c);}})[_0xba78('0x32')](function(_0x193744){if(_0x193744){return _0x193744?{'count':_0x5c7316,'rows':_0x193744}:null;}})[_0xba78('0x32')](respondWithResult(_0xa2eb86,null))[_0xba78('0x24')](handleError(_0xa2eb86,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 4a213ed..2e5b93c 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 _0x85cc=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x5601a3,_0x57e8a6){var _0x53535e=function(_0xd57850){while(--_0xd57850){_0x5601a3['push'](_0x5601a3['shift']());}};_0x53535e(++_0x57e8a6);}(_0x85cc,0x104));var _0xc85c=function(_0x3d16e4,_0x302851){_0x3d16e4=_0x3d16e4-0x0;var _0x47c0e3=_0x85cc[_0x3d16e4];return _0x47c0e3;};'use strict';var _=require(_0xc85c('0x0'));var util=require(_0xc85c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc85c('0x2'));var BPromise=require(_0xc85c('0x3'));var rp=require(_0xc85c('0x4'));var fs=require('fs');var path=require(_0xc85c('0x5'));var rimraf=require(_0xc85c('0x6'));var config=require(_0xc85c('0x7'));var attributes=require(_0xc85c('0x8'));module[_0xc85c('0x9')]=function(_0x606736,_0x379ada){return _0x606736[_0xc85c('0xa')](_0xc85c('0xb'),attributes,{'tableName':_0xc85c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae4d=['request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','bluebird'];(function(_0x20336b,_0x511e35){var _0x21ee85=function(_0x24d839){while(--_0x24d839){_0x20336b['push'](_0x20336b['shift']());}};_0x21ee85(++_0x511e35);}(_0xae4d,0x70));var _0xdae4=function(_0x453ce4,_0xec797e){_0x453ce4=_0x453ce4-0x0;var _0x7ed05b=_0xae4d[_0x453ce4];return _0x7ed05b;};'use strict';var _=require(_0xdae4('0x0'));var util=require(_0xdae4('0x1'));var logger=require(_0xdae4('0x2'))(_0xdae4('0x3'));var moment=require('moment');var BPromise=require(_0xdae4('0x4'));var rp=require(_0xdae4('0x5'));var fs=require('fs');var path=require(_0xdae4('0x6'));var rimraf=require(_0xdae4('0x7'));var config=require('../../config/environment');var attributes=require(_0xdae4('0x8'));module[_0xdae4('0x9')]=function(_0x3f0ceb,_0x599bec){return _0x3f0ceb[_0xdae4('0xa')](_0xdae4('0xb'),attributes,{'tableName':_0xdae4('0xc'),'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 abf2021..8577021 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 _0x2661=['then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','VtigerConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x8b4f0,_0x234824){var _0x104190=function(_0x27e06b){while(--_0x27e06b){_0x8b4f0['push'](_0x8b4f0['shift']());}};_0x104190(++_0x234824);}(_0x2661,0x143));var _0x1266=function(_0x429ec2,_0x39c338){_0x429ec2=_0x429ec2-0x0;var _0x23b0b7=_0x2661[_0x429ec2];return _0x23b0b7;};'use strict';var _=require(_0x1266('0x0'));var util=require(_0x1266('0x1'));var moment=require(_0x1266('0x2'));var BPromise=require(_0x1266('0x3'));var rs=require(_0x1266('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1266('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1266('0x6'))(_0x1266('0x7'));var config=require(_0x1266('0x8'));var jayson=require(_0x1266('0x9'));var client=jayson[_0x1266('0xa')][_0x1266('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c86bb,_0x571f06,_0x35c97b){return new BPromise(function(_0x29758a,_0x41ffc4){return client[_0x1266('0xc')](_0x4c86bb,_0x35c97b)[_0x1266('0xd')](function(_0x1b5dd9){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x571f06,_0x1266('0xe'));logger[_0x1266('0xf')](_0x1266('0x10'),_0x571f06,_0x1266('0xe'),JSON['stringify'](_0x1b5dd9));if(_0x1b5dd9['error']){if(_0x1b5dd9[_0x1266('0x11')][_0x1266('0x12')]===0x1f4){logger[_0x1266('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x571f06,_0x1b5dd9[_0x1266('0x11')][_0x1266('0x13')]);return _0x41ffc4(_0x1b5dd9['error'][_0x1266('0x13')]);}logger['error'](_0x1266('0x14'),_0x571f06,_0x1b5dd9[_0x1266('0x11')]['message']);return _0x29758a(_0x1b5dd9[_0x1266('0x11')][_0x1266('0x13')]);}else{logger[_0x1266('0x15')]('VtigerConfiguration,\x20%s,\x20%s',_0x571f06,_0x1266('0xe'));_0x29758a(_0x1b5dd9[_0x1266('0x16')]['message']);}})[_0x1266('0x17')](function(_0x2bc268){logger[_0x1266('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x571f06,_0x2bc268);_0x41ffc4(_0x2bc268);});});} \ No newline at end of file +var _0x2851=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x2575ac,_0x1ebeae){var _0x3cd595=function(_0x5d6f43){while(--_0x5d6f43){_0x2575ac['push'](_0x2575ac['shift']());}};_0x3cd595(++_0x1ebeae);}(_0x2851,0x1d6));var _0x1285=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2851[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x1285('0x0'));var moment=require(_0x1285('0x1'));var BPromise=require(_0x1285('0x2'));var rs=require(_0x1285('0x3'));var fs=require('fs');var Redis=require(_0x1285('0x4'));var db=require(_0x1285('0x5'))['db'];var utils=require(_0x1285('0x6'));var logger=require(_0x1285('0x7'))(_0x1285('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1285('0x9')][_0x1285('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13b15e,_0x301f16,_0x2ff7ca){return new BPromise(function(_0x364f94,_0x291843){return client[_0x1285('0xb')](_0x13b15e,_0x2ff7ca)[_0x1285('0xc')](function(_0x4c437a){logger[_0x1285('0xd')](_0x1285('0xe'),_0x301f16,_0x1285('0xf'));logger['debug'](_0x1285('0x10'),_0x301f16,'request\x20sent',JSON[_0x1285('0x11')](_0x4c437a));if(_0x4c437a[_0x1285('0x12')]){if(_0x4c437a['error'][_0x1285('0x13')]===0x1f4){logger[_0x1285('0x12')](_0x1285('0xe'),_0x301f16,_0x4c437a[_0x1285('0x12')]['message']);return _0x291843(_0x4c437a[_0x1285('0x12')][_0x1285('0x14')]);}logger['error'](_0x1285('0xe'),_0x301f16,_0x4c437a['error'][_0x1285('0x14')]);return _0x364f94(_0x4c437a[_0x1285('0x12')][_0x1285('0x14')]);}else{logger[_0x1285('0xd')](_0x1285('0xe'),_0x301f16,_0x1285('0xf'));_0x364f94(_0x4c437a[_0x1285('0x15')][_0x1285('0x14')]);}})[_0x1285('0x16')](function(_0x1fc7c4){logger[_0x1285('0x12')](_0x1285('0xe'),_0x301f16,_0x1fc7c4);_0x291843(_0x1fc7c4);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index bb75ead..9b65cb2 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 _0xc4aa=['connect-timeout','express','Router','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','create','put','update','delete','exports','multer','util','path'];(function(_0x2f99dc,_0x4dcd01){var _0x58e1a0=function(_0x5aae62){while(--_0x5aae62){_0x2f99dc['push'](_0x2f99dc['shift']());}};_0x58e1a0(++_0x4dcd01);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xc')]);router[_0xac4a('0xd')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['destroy']);module[_0xac4a('0x10')]=router; \ No newline at end of file +var _0x1261=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','index','get','isAuthenticated','show','post','create','/:id','update'];(function(_0x4e8286,_0x4eaeb4){var _0x44a440=function(_0x5e0907){while(--_0x5e0907){_0x4e8286['push'](_0x4e8286['shift']());}};_0x44a440(++_0x4eaeb4);}(_0x1261,0x144));var _0x1126=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0x1261[_0x316904];return _0xfa9a21;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xe')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0xf')]);router['put'](_0x1126('0x10'),auth[_0x1126('0xc')](),controller[_0x1126('0x11')]);router['delete'](_0x1126('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x1126('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 61a96cb..b9df403 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 _0x6a24=['STRING','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x43bf57,_0xfa0fa8){var _0x5e3f4a=function(_0x230b20){while(--_0x230b20){_0x43bf57['push'](_0x43bf57['shift']());}};_0x5e3f4a(++_0xfa0fa8);}(_0x6a24,0xd1));var _0x46a2=function(_0x4c4b44,_0x4ea2c4){_0x4c4b44=_0x4c4b44-0x0;var _0x1ad502=_0x6a24[_0x4c4b44];return _0x1ad502;};'use strict';var Sequelize=require(_0x46a2('0x0'));module[_0x46a2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x46a2('0x2'),_0x46a2('0x3'),_0x46a2('0x4'),_0x46a2('0x5'),_0x46a2('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x46a2('0x7')]},'key':{'type':Sequelize[_0x46a2('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x46a2('0x2'),_0x46a2('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x46a2('0x7')]},'nameField':{'type':Sequelize[_0x46a2('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x46a2('0x7')]}}; \ No newline at end of file +var _0x9099=['customVariable','keyValue','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x216145,_0x955864){var _0xd1901c=function(_0x4310b4){while(--_0x4310b4){_0x216145['push'](_0x216145['shift']());}};_0xd1901c(++_0x955864);}(_0x9099,0x1ac));var _0x9909=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0x9099[_0x261e29];return _0x25ef43;};'use strict';var Sequelize=require(_0x9909('0x0'));module['exports']={'type':{'type':Sequelize[_0x9909('0x1')](_0x9909('0x2'),_0x9909('0x3'),_0x9909('0x4'),_0x9909('0x5'),_0x9909('0x6')),'defaultValue':_0x9909('0x2')},'content':{'type':Sequelize[_0x9909('0x7')]},'key':{'type':Sequelize[_0x9909('0x7')]},'keyType':{'type':Sequelize[_0x9909('0x1')](_0x9909('0x2'),_0x9909('0x3'),_0x9909('0x4'))},'keyContent':{'type':Sequelize[_0x9909('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9909('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 97e6773..96a0012 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 _0xe3ff=['limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x58a431,_0x34d871){var _0x1266f5=function(_0x426fea){while(--_0x426fea){_0x58a431['push'](_0x58a431['shift']());}};_0x1266f5(++_0x34d871);}(_0xe3ff,0x1a3));var _0xfe3f=function(_0x41d6f4,_0x3e0260){_0x41d6f4=_0x41d6f4-0x0;var _0x1549ea=_0xe3ff[_0x41d6f4];return _0x1549ea;};'use strict';var emlformat=require(_0xfe3f('0x0'));var rimraf=require(_0xfe3f('0x1'));var zipdir=require(_0xfe3f('0x2'));var jsonpatch=require(_0xfe3f('0x3'));var rp=require(_0xfe3f('0x4'));var moment=require('moment');var BPromise=require(_0xfe3f('0x5'));var Mustache=require(_0xfe3f('0x6'));var util=require(_0xfe3f('0x7'));var path=require(_0xfe3f('0x8'));var sox=require(_0xfe3f('0x9'));var csv=require(_0xfe3f('0xa'));var ejs=require(_0xfe3f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe3f('0xc'));var squel=require('squel');var crypto=require(_0xfe3f('0xd'));var jsforce=require(_0xfe3f('0xe'));var deskjs=require(_0xfe3f('0xf'));var toCsv=require(_0xfe3f('0xa'));var querystring=require(_0xfe3f('0x10'));var Papa=require(_0xfe3f('0x11'));var Redis=require(_0xfe3f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfe3f('0x13'));var as=require(_0xfe3f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe3f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xfe3f('0x16'));var licenseUtil=require(_0xfe3f('0x17'));var db=require(_0xfe3f('0x18'))['db'];function respondWithStatusCode(_0x2b4893,_0x556251){_0x556251=_0x556251||0xcc;return function(_0x313765){if(_0x313765){return _0x2b4893[_0xfe3f('0x19')](_0x556251);}return _0x2b4893[_0xfe3f('0x1a')](_0x556251)[_0xfe3f('0x1b')]();};}function respondWithResult(_0x58c383,_0x383d4c){_0x383d4c=_0x383d4c||0xc8;return function(_0x47558f){if(_0x47558f){return _0x58c383[_0xfe3f('0x1a')](_0x383d4c)[_0xfe3f('0x1c')](_0x47558f);}};}function respondWithFilteredResult(_0x2158fb,_0x5c43cb){return function(_0x10a8b5){if(_0x10a8b5){var _0x34f417=_0x10a8b5[_0xfe3f('0x1d')],_0x544dfc=_0x5c43cb[_0xfe3f('0x1e')],_0x2809be=_0x5c43cb[_0xfe3f('0x1e')]+_0x5c43cb[_0xfe3f('0x1f')],_0x13f60b;if(_0x2809be>=_0x34f417){_0x2809be=_0x34f417;_0x13f60b=0xc8;}else{_0x13f60b=0xce;}_0x2158fb[_0xfe3f('0x1a')](_0x13f60b);return _0x2158fb[_0xfe3f('0x20')](_0xfe3f('0x21'),_0x544dfc+'-'+_0x2809be+'/'+_0x34f417)['json'](_0x10a8b5);}return null;};}function patchUpdates(_0x41ca21){return function(_0x2a35a8){try{jsonpatch[_0xfe3f('0x22')](_0x2a35a8,_0x41ca21,!![]);}catch(_0x160918){return BPromise['reject'](_0x160918);}return _0x2a35a8[_0xfe3f('0x23')]();};}function saveUpdates(_0xd8835f,_0x12186a){return function(_0x2f62df){if(_0x2f62df){return _0x2f62df[_0xfe3f('0x24')](_0xd8835f)[_0xfe3f('0x25')](function(_0x2a0180){return _0x2a0180;});}return null;};}function removeEntity(_0x5daee0,_0x2e0060){return function(_0x127b6e){if(_0x127b6e){return _0x127b6e[_0xfe3f('0x26')]()['then'](function(){_0x5daee0['status'](0xcc)[_0xfe3f('0x1b')]();});}};}function handleEntityNotFound(_0x371e29,_0x4f629a){return function(_0x2e85ca){if(!_0x2e85ca){_0x371e29['sendStatus'](0x194);}return _0x2e85ca;};}function handleError(_0x188ff4,_0x987a67){_0x987a67=_0x987a67||0x1f4;return function(_0xe0d943){logger['error'](_0xe0d943[_0xfe3f('0x27')]);if(_0xe0d943[_0xfe3f('0x28')]){delete _0xe0d943[_0xfe3f('0x28')];}_0x188ff4['status'](_0x987a67)[_0xfe3f('0x29')](_0xe0d943);};}exports[_0xfe3f('0x2a')]=function(_0x4cdfd3,_0x41d6cb){var _0x2bdcae={},_0x4f8613={},_0x364048={'count':0x0,'rows':[]};var _0xfc4b9=_[_0xfe3f('0x2b')](db[_0xfe3f('0x2c')][_0xfe3f('0x2d')],function(_0x262ede){return{'name':_0x262ede[_0xfe3f('0x2e')],'type':_0x262ede[_0xfe3f('0x2f')]['key']};});_0x4f8613[_0xfe3f('0x30')]=_[_0xfe3f('0x2b')](_0xfc4b9,_0xfe3f('0x28'));_0x4f8613[_0xfe3f('0x31')]=_['keys'](_0x4cdfd3['query']);_0x4f8613[_0xfe3f('0x32')]=_[_0xfe3f('0x33')](_0x4f8613[_0xfe3f('0x30')],_0x4f8613[_0xfe3f('0x31')]);_0x2bdcae[_0xfe3f('0x34')]=_[_0xfe3f('0x33')](_0x4f8613[_0xfe3f('0x30')],qs[_0xfe3f('0x35')](_0x4cdfd3[_0xfe3f('0x31')][_0xfe3f('0x35')]));_0x2bdcae[_0xfe3f('0x34')]=_0x2bdcae['attributes'][_0xfe3f('0x36')]?_0x2bdcae['attributes']:_0x4f8613['model'];if(!_0x4cdfd3[_0xfe3f('0x31')]['hasOwnProperty'](_0xfe3f('0x37'))){_0x2bdcae[_0xfe3f('0x1f')]=qs['limit'](_0x4cdfd3['query']['limit']);_0x2bdcae['offset']=qs[_0xfe3f('0x1e')](_0x4cdfd3[_0xfe3f('0x31')][_0xfe3f('0x1e')]);}_0x2bdcae[_0xfe3f('0x38')]=qs[_0xfe3f('0x39')](_0x4cdfd3[_0xfe3f('0x31')]['sort']);_0x2bdcae[_0xfe3f('0x3a')]=qs['filters'](_[_0xfe3f('0x3b')](_0x4cdfd3['query'],_0x4f8613['filters']),_0xfc4b9);if(_0x4cdfd3['query'][_0xfe3f('0x3c')]){_0x2bdcae[_0xfe3f('0x3a')]=_[_0xfe3f('0x3d')](_0x2bdcae[_0xfe3f('0x3a')],{'$or':_[_0xfe3f('0x2b')](_0xfc4b9,function(_0x1da90d){if(_0x1da90d['type']!==_0xfe3f('0x3e')){var _0x52311f={};_0x52311f[_0x1da90d['name']]={'$like':'%'+_0x4cdfd3[_0xfe3f('0x31')][_0xfe3f('0x3c')]+'%'};return _0x52311f;}})});}_0x2bdcae=_['merge']({},_0x2bdcae,_0x4cdfd3[_0xfe3f('0x3f')]);var _0x4f482b={'where':_0x2bdcae['where']};return db[_0xfe3f('0x2c')][_0xfe3f('0x1d')](_0x4f482b)[_0xfe3f('0x25')](function(_0x1b620a){_0x364048[_0xfe3f('0x1d')]=_0x1b620a;if(_0x4cdfd3[_0xfe3f('0x31')][_0xfe3f('0x40')]){_0x2bdcae[_0xfe3f('0x41')]=[{'all':!![]}];}return db[_0xfe3f('0x2c')][_0xfe3f('0x42')](_0x2bdcae);})[_0xfe3f('0x25')](function(_0x4b2dee){_0x364048[_0xfe3f('0x43')]=_0x4b2dee;return _0x364048;})['then'](respondWithFilteredResult(_0x41d6cb,_0x2bdcae))['catch'](handleError(_0x41d6cb,null));};exports[_0xfe3f('0x44')]=function(_0x193ada,_0x1c659a){var _0x23cdfb={'raw':!![],'where':{'id':_0x193ada['params']['id']}},_0x5d0d89={};_0x5d0d89['model']=_[_0xfe3f('0x45')](db['VtigerField'][_0xfe3f('0x2d')]);_0x5d0d89[_0xfe3f('0x31')]=_[_0xfe3f('0x45')](_0x193ada[_0xfe3f('0x31')]);_0x5d0d89[_0xfe3f('0x32')]=_['intersection'](_0x5d0d89['model'],_0x5d0d89[_0xfe3f('0x31')]);_0x23cdfb[_0xfe3f('0x34')]=_[_0xfe3f('0x33')](_0x5d0d89['model'],qs[_0xfe3f('0x35')](_0x193ada[_0xfe3f('0x31')][_0xfe3f('0x35')]));_0x23cdfb['attributes']=_0x23cdfb[_0xfe3f('0x34')][_0xfe3f('0x36')]?_0x23cdfb['attributes']:_0x5d0d89[_0xfe3f('0x30')];if(_0x193ada[_0xfe3f('0x31')]['includeAll']){_0x23cdfb[_0xfe3f('0x41')]=[{'all':!![]}];}_0x23cdfb=_[_0xfe3f('0x3d')]({},_0x23cdfb,_0x193ada[_0xfe3f('0x3f')]);return db['VtigerField'][_0xfe3f('0x46')](_0x23cdfb)[_0xfe3f('0x25')](handleEntityNotFound(_0x1c659a,null))[_0xfe3f('0x25')](respondWithResult(_0x1c659a,null))[_0xfe3f('0x47')](handleError(_0x1c659a,null));};exports[_0xfe3f('0x48')]=function(_0x1ef4e7,_0x4adb02){return db[_0xfe3f('0x2c')][_0xfe3f('0x48')](_0x1ef4e7[_0xfe3f('0x49')],{})[_0xfe3f('0x25')](respondWithResult(_0x4adb02,0xc9))['catch'](handleError(_0x4adb02,null));};exports['update']=function(_0x4ea5f5,_0x3a01d8){if(_0x4ea5f5[_0xfe3f('0x49')]['id']){delete _0x4ea5f5['body']['id'];}return db['VtigerField'][_0xfe3f('0x46')]({'where':{'id':_0x4ea5f5['params']['id']}})[_0xfe3f('0x25')](handleEntityNotFound(_0x3a01d8,null))['then'](saveUpdates(_0x4ea5f5[_0xfe3f('0x49')],null))[_0xfe3f('0x25')](respondWithResult(_0x3a01d8,null))[_0xfe3f('0x47')](handleError(_0x3a01d8,null));};exports['destroy']=function(_0x64b1ac,_0x276d9b){return db[_0xfe3f('0x2c')][_0xfe3f('0x46')]({'where':{'id':_0x64b1ac[_0xfe3f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x276d9b,null))[_0xfe3f('0x25')](removeEntity(_0x276d9b,null))[_0xfe3f('0x47')](handleError(_0x276d9b,null));}; \ No newline at end of file +var _0x6821=['order','sort','where','pick','filter','merge','VtigerField','count','includeAll','include','findAll','rows','catch','intersection','options','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','end','offset','limit','status','set','Content-Range','json','apply','save','update','destroy','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','fields','length'];(function(_0x35e7f5,_0x505458){var _0x21327e=function(_0x24ee98){while(--_0x24ee98){_0x35e7f5['push'](_0x35e7f5['shift']());}};_0x21327e(++_0x505458);}(_0x6821,0x1c9));var _0x1682=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x6821[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require(_0x1682('0x0'));var rimraf=require(_0x1682('0x1'));var zipdir=require(_0x1682('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1682('0x3'));var moment=require(_0x1682('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1682('0x5'));var util=require(_0x1682('0x6'));var path=require(_0x1682('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1682('0x8'));var fs=require('fs');var fs_extra=require(_0x1682('0x9'));var _=require(_0x1682('0xa'));var squel=require('squel');var crypto=require(_0x1682('0xb'));var jsforce=require(_0x1682('0xc'));var deskjs=require(_0x1682('0xd'));var toCsv=require(_0x1682('0xe'));var querystring=require(_0x1682('0xf'));var Papa=require(_0x1682('0x10'));var Redis=require(_0x1682('0x11'));var authService=require(_0x1682('0x12'));var qs=require(_0x1682('0x13'));var as=require(_0x1682('0x14'));var hardwareService=require(_0x1682('0x15'));var logger=require('../../config/logger')(_0x1682('0x16'));var utils=require(_0x1682('0x17'));var config=require(_0x1682('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a23e8,_0x28bb78){_0x28bb78=_0x28bb78||0xcc;return function(_0x52b975){if(_0x52b975){return _0x3a23e8['sendStatus'](_0x28bb78);}return _0x3a23e8['status'](_0x28bb78)[_0x1682('0x19')]();};}function respondWithResult(_0x57f0cb,_0x14af00){_0x14af00=_0x14af00||0xc8;return function(_0x3ad710){if(_0x3ad710){return _0x57f0cb['status'](_0x14af00)['json'](_0x3ad710);}};}function respondWithFilteredResult(_0x3a0aef,_0x578351){return function(_0x2fbf3c){if(_0x2fbf3c){var _0x298db5=_0x2fbf3c['count'],_0x2e7089=_0x578351[_0x1682('0x1a')],_0x3d00be=_0x578351[_0x1682('0x1a')]+_0x578351[_0x1682('0x1b')],_0x3a162e;if(_0x3d00be>=_0x298db5){_0x3d00be=_0x298db5;_0x3a162e=0xc8;}else{_0x3a162e=0xce;}_0x3a0aef[_0x1682('0x1c')](_0x3a162e);return _0x3a0aef[_0x1682('0x1d')](_0x1682('0x1e'),_0x2e7089+'-'+_0x3d00be+'/'+_0x298db5)[_0x1682('0x1f')](_0x2fbf3c);}return null;};}function patchUpdates(_0x3b4397){return function(_0x274830){try{jsonpatch[_0x1682('0x20')](_0x274830,_0x3b4397,!![]);}catch(_0x2433cf){return BPromise['reject'](_0x2433cf);}return _0x274830[_0x1682('0x21')]();};}function saveUpdates(_0x230793,_0x35b0c5){return function(_0x2a1a57){if(_0x2a1a57){return _0x2a1a57[_0x1682('0x22')](_0x230793)['then'](function(_0x2ed24b){return _0x2ed24b;});}return null;};}function removeEntity(_0x357462,_0x54f5cd){return function(_0x27ef84){if(_0x27ef84){return _0x27ef84[_0x1682('0x23')]()[_0x1682('0x24')](function(){_0x357462[_0x1682('0x1c')](0xcc)[_0x1682('0x19')]();});}};}function handleEntityNotFound(_0x28a684,_0x447627){return function(_0x3e25ec){if(!_0x3e25ec){_0x28a684[_0x1682('0x25')](0x194);}return _0x3e25ec;};}function handleError(_0x2cc36a,_0xbf45a5){_0xbf45a5=_0xbf45a5||0x1f4;return function(_0x268787){logger['error'](_0x268787[_0x1682('0x26')]);if(_0x268787[_0x1682('0x27')]){delete _0x268787['name'];}_0x2cc36a['status'](_0xbf45a5)[_0x1682('0x28')](_0x268787);};}exports[_0x1682('0x29')]=function(_0x1e9619,_0x44e30d){var _0x976200={},_0x5bd496={},_0x3067e9={'count':0x0,'rows':[]};var _0x4b73f8=_['map'](db['VtigerField'][_0x1682('0x2a')],function(_0x46bc71){return{'name':_0x46bc71[_0x1682('0x2b')],'type':_0x46bc71[_0x1682('0x2c')][_0x1682('0x2d')]};});_0x5bd496[_0x1682('0x2e')]=_[_0x1682('0x2f')](_0x4b73f8,'name');_0x5bd496['query']=_[_0x1682('0x30')](_0x1e9619[_0x1682('0x31')]);_0x5bd496[_0x1682('0x32')]=_['intersection'](_0x5bd496[_0x1682('0x2e')],_0x5bd496[_0x1682('0x31')]);_0x976200[_0x1682('0x33')]=_['intersection'](_0x5bd496[_0x1682('0x2e')],qs[_0x1682('0x34')](_0x1e9619['query'][_0x1682('0x34')]));_0x976200[_0x1682('0x33')]=_0x976200[_0x1682('0x33')][_0x1682('0x35')]?_0x976200[_0x1682('0x33')]:_0x5bd496[_0x1682('0x2e')];if(!_0x1e9619[_0x1682('0x31')]['hasOwnProperty']('nolimit')){_0x976200[_0x1682('0x1b')]=qs['limit'](_0x1e9619[_0x1682('0x31')][_0x1682('0x1b')]);_0x976200[_0x1682('0x1a')]=qs[_0x1682('0x1a')](_0x1e9619['query'][_0x1682('0x1a')]);}_0x976200[_0x1682('0x36')]=qs[_0x1682('0x37')](_0x1e9619[_0x1682('0x31')][_0x1682('0x37')]);_0x976200[_0x1682('0x38')]=qs['filters'](_[_0x1682('0x39')](_0x1e9619[_0x1682('0x31')],_0x5bd496[_0x1682('0x32')]),_0x4b73f8);if(_0x1e9619['query'][_0x1682('0x3a')]){_0x976200[_0x1682('0x38')]=_[_0x1682('0x3b')](_0x976200[_0x1682('0x38')],{'$or':_[_0x1682('0x2f')](_0x4b73f8,function(_0x53d185){if(_0x53d185[_0x1682('0x2c')]!=='VIRTUAL'){var _0x43fdaf={};_0x43fdaf[_0x53d185[_0x1682('0x27')]]={'$like':'%'+_0x1e9619[_0x1682('0x31')]['filter']+'%'};return _0x43fdaf;}})});}_0x976200=_[_0x1682('0x3b')]({},_0x976200,_0x1e9619['options']);var _0x2ca2a1={'where':_0x976200['where']};return db[_0x1682('0x3c')][_0x1682('0x3d')](_0x2ca2a1)['then'](function(_0x4471e6){_0x3067e9['count']=_0x4471e6;if(_0x1e9619[_0x1682('0x31')][_0x1682('0x3e')]){_0x976200[_0x1682('0x3f')]=[{'all':!![]}];}return db['VtigerField'][_0x1682('0x40')](_0x976200);})[_0x1682('0x24')](function(_0x1a60d4){_0x3067e9[_0x1682('0x41')]=_0x1a60d4;return _0x3067e9;})[_0x1682('0x24')](respondWithFilteredResult(_0x44e30d,_0x976200))[_0x1682('0x42')](handleError(_0x44e30d,null));};exports['show']=function(_0x5afbea,_0x137bd9){var _0x37257f={'raw':!![],'where':{'id':_0x5afbea['params']['id']}},_0x31981b={};_0x31981b[_0x1682('0x2e')]=_[_0x1682('0x30')](db[_0x1682('0x3c')]['rawAttributes']);_0x31981b[_0x1682('0x31')]=_[_0x1682('0x30')](_0x5afbea['query']);_0x31981b[_0x1682('0x32')]=_[_0x1682('0x43')](_0x31981b[_0x1682('0x2e')],_0x31981b[_0x1682('0x31')]);_0x37257f[_0x1682('0x33')]=_[_0x1682('0x43')](_0x31981b[_0x1682('0x2e')],qs[_0x1682('0x34')](_0x5afbea['query'][_0x1682('0x34')]));_0x37257f['attributes']=_0x37257f['attributes']['length']?_0x37257f[_0x1682('0x33')]:_0x31981b[_0x1682('0x2e')];if(_0x5afbea['query'][_0x1682('0x3e')]){_0x37257f[_0x1682('0x3f')]=[{'all':!![]}];}_0x37257f=_['merge']({},_0x37257f,_0x5afbea[_0x1682('0x44')]);return db[_0x1682('0x3c')][_0x1682('0x45')](_0x37257f)[_0x1682('0x24')](handleEntityNotFound(_0x137bd9,null))[_0x1682('0x24')](respondWithResult(_0x137bd9,null))[_0x1682('0x42')](handleError(_0x137bd9,null));};exports[_0x1682('0x46')]=function(_0x552c0b,_0x1bdd29){return db[_0x1682('0x3c')][_0x1682('0x46')](_0x552c0b[_0x1682('0x47')],{})[_0x1682('0x24')](respondWithResult(_0x1bdd29,0xc9))[_0x1682('0x42')](handleError(_0x1bdd29,null));};exports[_0x1682('0x22')]=function(_0x4a8412,_0x59971d){if(_0x4a8412[_0x1682('0x47')]['id']){delete _0x4a8412[_0x1682('0x47')]['id'];}return db[_0x1682('0x3c')][_0x1682('0x45')]({'where':{'id':_0x4a8412[_0x1682('0x48')]['id']}})[_0x1682('0x24')](handleEntityNotFound(_0x59971d,null))[_0x1682('0x24')](saveUpdates(_0x4a8412[_0x1682('0x47')],null))['then'](respondWithResult(_0x59971d,null))['catch'](handleError(_0x59971d,null));};exports[_0x1682('0x23')]=function(_0x210b9f,_0x49eb73){return db[_0x1682('0x3c')]['find']({'where':{'id':_0x210b9f[_0x1682('0x48')]['id']}})['then'](handleEntityNotFound(_0x49eb73,null))[_0x1682('0x24')](removeEntity(_0x49eb73,null))[_0x1682('0x42')](handleError(_0x49eb73,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index de3f058..e5a3a83 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 _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x2aea10,_0x57c61a){var _0x2be93f=function(_0x3c8ee3){while(--_0x3c8ee3){_0x2aea10['push'](_0x2aea10['shift']());}};_0x2be93f(++_0x57c61a);}(_0x7a54,0x106));var _0x47a5=function(_0x58392e,_0x331ffa){_0x58392e=_0x58392e-0x0;var _0x8b374e=_0x7a54[_0x58392e];return _0x8b374e;};'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':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'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 418dc69..383b3d5 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 _0x9805=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xc82d53,_0x2cc67e){var _0xbeeb91=function(_0x4cf3ba){while(--_0x4cf3ba){_0xc82d53['push'](_0xc82d53['shift']());}};_0xbeeb91(++_0x2cc67e);}(_0x9805,0x18f));var _0x5980=function(_0x48b8ad,_0xe28403){_0x48b8ad=_0x48b8ad-0x0;var _0x4d1bae=_0x9805[_0x48b8ad];return _0x4d1bae;};'use strict';var _=require(_0x5980('0x0'));var util=require(_0x5980('0x1'));var moment=require(_0x5980('0x2'));var BPromise=require(_0x5980('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5980('0x4'))['db'];var utils=require(_0x5980('0x5'));var logger=require(_0x5980('0x6'))(_0x5980('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5980('0x8')][_0x5980('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x326b9b,_0x1d6536,_0x175728){return new BPromise(function(_0x3399a9,_0xf8b3c0){return client[_0x5980('0xa')](_0x326b9b,_0x175728)[_0x5980('0xb')](function(_0x35b0ad){logger[_0x5980('0xc')](_0x5980('0xd'),_0x1d6536,'request\x20sent');logger['debug'](_0x5980('0xe'),_0x1d6536,_0x5980('0xf'),JSON[_0x5980('0x10')](_0x35b0ad));if(_0x35b0ad[_0x5980('0x11')]){if(_0x35b0ad['error'][_0x5980('0x12')]===0x1f4){logger[_0x5980('0x11')]('VtigerField,\x20%s,\x20%s',_0x1d6536,_0x35b0ad['error'][_0x5980('0x13')]);return _0xf8b3c0(_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);}logger[_0x5980('0x11')](_0x5980('0xd'),_0x1d6536,_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);return _0x3399a9(_0x35b0ad[_0x5980('0x11')]['message']);}else{logger[_0x5980('0xc')]('VtigerField,\x20%s,\x20%s',_0x1d6536,_0x5980('0xf'));_0x3399a9(_0x35b0ad[_0x5980('0x14')][_0x5980('0x13')]);}})[_0x5980('0x15')](function(_0x183261){logger['error'](_0x5980('0xd'),_0x1d6536,_0x183261);_0xf8b3c0(_0x183261);});});} \ No newline at end of file +var _0xe61a=['rpc','../../config/environment','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x19115e,_0x507bab){var _0x45bbd4=function(_0x1308bf){while(--_0x1308bf){_0x19115e['push'](_0x19115e['shift']());}};_0x45bbd4(++_0x507bab);}(_0xe61a,0x120));var _0xae61=function(_0x9f1f8b,_0x3a4a00){_0x9f1f8b=_0x9f1f8b-0x0;var _0x3b87b1=_0xe61a[_0x9f1f8b];return _0x3b87b1;};'use strict';var _=require(_0xae61('0x0'));var util=require(_0xae61('0x1'));var moment=require('moment');var BPromise=require(_0xae61('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae61('0x3'));var db=require(_0xae61('0x4'))['db'];var utils=require(_0xae61('0x5'));var logger=require('../../config/logger')(_0xae61('0x6'));var config=require(_0xae61('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xae61('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b02ca,_0x453410,_0x251fc3){return new BPromise(function(_0x4290b0,_0x48951b){return client[_0xae61('0x9')](_0x2b02ca,_0x251fc3)[_0xae61('0xa')](function(_0x33a612){logger['info'](_0xae61('0xb'),_0x453410,_0xae61('0xc'));logger[_0xae61('0xd')](_0xae61('0xe'),_0x453410,'request\x20sent',JSON[_0xae61('0xf')](_0x33a612));if(_0x33a612[_0xae61('0x10')]){if(_0x33a612[_0xae61('0x10')]['code']===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x453410,_0x33a612[_0xae61('0x10')][_0xae61('0x11')]);return _0x48951b(_0x33a612['error'][_0xae61('0x11')]);}logger[_0xae61('0x10')](_0xae61('0xb'),_0x453410,_0x33a612[_0xae61('0x10')][_0xae61('0x11')]);return _0x4290b0(_0x33a612['error'][_0xae61('0x11')]);}else{logger[_0xae61('0x12')]('VtigerField,\x20%s,\x20%s',_0x453410,_0xae61('0xc'));_0x4290b0(_0x33a612[_0xae61('0x13')][_0xae61('0x11')]);}})[_0xae61('0x14')](function(_0x4a8d17){logger[_0xae61('0x10')](_0xae61('0xb'),_0x453410,_0x4a8d17);_0x48951b(_0x4a8d17);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index f65e846..5198b5e 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 _0x23f4=['/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x23f4,0x1ee));var _0x423f=function(_0xcb7a7c,_0x1e95a0){_0xcb7a7c=_0xcb7a7c-0x0;var _0x4bf51c=_0x23f4[_0xcb7a7c];return _0x4bf51c;};'use strict';var multer=require('multer');var util=require(_0x423f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x423f('0x1'));var router=express[_0x423f('0x2')]();var fs_extra=require(_0x423f('0x3'));var auth=require(_0x423f('0x4'));var interaction=require(_0x423f('0x5'));var config=require(_0x423f('0x6'));var controller=require(_0x423f('0x7'));router[_0x423f('0x8')]('/',auth[_0x423f('0x9')](),controller['index']);router[_0x423f('0x8')](_0x423f('0xa'),auth['isAuthenticated'](),controller[_0x423f('0xb')]);router[_0x423f('0x8')](_0x423f('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x423f('0xd'),auth['isAuthenticated'](),controller[_0x423f('0xe')]);router[_0x423f('0xf')]('/',auth[_0x423f('0x9')](),controller[_0x423f('0x10')]);router['post'](_0x423f('0xc'),auth[_0x423f('0x9')](),controller[_0x423f('0x11')]);router[_0x423f('0x12')](_0x423f('0xa'),auth['isAuthenticated'](),controller[_0x423f('0x13')]);router[_0x423f('0x14')](_0x423f('0xa'),auth[_0x423f('0x9')](),controller[_0x423f('0x15')]);module[_0x423f('0x16')]=router; \ No newline at end of file +var _0x1228=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getConfigurations','post','create','/:id/configurations','addConfiguration','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1228,0x12f));var _0x8122=function(_0x2a32a1,_0x6c6cbb){_0x2a32a1=_0x2a32a1-0x0;var _0xfba034=_0x1228[_0x2a32a1];return _0xfba034;};'use strict';var multer=require(_0x8122('0x0'));var util=require('util');var path=require(_0x8122('0x1'));var timeout=require('connect-timeout');var express=require(_0x8122('0x2'));var router=express[_0x8122('0x3')]();var fs_extra=require(_0x8122('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8122('0x5'));var config=require(_0x8122('0x6'));var controller=require('./intZendeskAccount.controller');router[_0x8122('0x7')]('/',auth[_0x8122('0x8')](),controller['index']);router[_0x8122('0x7')](_0x8122('0x9'),auth['isAuthenticated'](),controller[_0x8122('0xa')]);router[_0x8122('0x7')]('/:id/configurations',auth[_0x8122('0x8')](),controller[_0x8122('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x8122('0xc')]('/',auth['isAuthenticated'](),controller[_0x8122('0xd')]);router[_0x8122('0xc')](_0x8122('0xe'),auth['isAuthenticated'](),controller[_0x8122('0xf')]);router['put'](_0x8122('0x9'),auth[_0x8122('0x8')](),controller[_0x8122('0x10')]);router[_0x8122('0x11')](_0x8122('0x9'),auth[_0x8122('0x8')](),controller[_0x8122('0x12')]);module[_0x8122('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 415a527..6dc6239 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 _0x4350=['ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x4cfb78,_0x4c1da6){var _0xc1250e=function(_0x217b6c){while(--_0x217b6c){_0x4cfb78['push'](_0x4cfb78['shift']());}};_0xc1250e(++_0x4c1da6);}(_0x4350,0xd4));var _0x0435=function(_0x2b1bfa,_0x429aa4){_0x2b1bfa=_0x2b1bfa-0x0;var _0x2bb2f8=_0x4350[_0x2b1bfa];return _0x2bb2f8;};'use strict';var Sequelize=require(_0x0435('0x0'));module[_0x0435('0x1')]={'name':{'type':Sequelize[_0x0435('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0435('0x2')],'unique':_0x0435('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0435('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x0435('0x4')](_0x0435('0x5'),_0x0435('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x0435('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0435('0x4')](_0x0435('0x7'),_0x0435('0x8')),'defaultValue':_0x0435('0x7')}}; \ No newline at end of file +var _0xfd3b=['token','integrationTab','sequelize','exports','username','STRING','remoteUri','ENUM','password'];(function(_0x131edc,_0x251ac4){var _0x648d58=function(_0x23e3a4){while(--_0x23e3a4){_0x131edc['push'](_0x131edc['shift']());}};_0x648d58(++_0x251ac4);}(_0xfd3b,0x1a9));var _0xbfd3=function(_0x38df13,_0x219452){_0x38df13=_0x38df13-0x0;var _0x4ffb06=_0xfd3b[_0x38df13];return _0x4ffb06;};'use strict';var Sequelize=require(_0xbfd3('0x0'));module[_0xbfd3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xbfd3('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xbfd3('0x3')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xbfd3('0x4')},'authType':{'type':Sequelize[_0xbfd3('0x5')](_0xbfd3('0x6'),_0xbfd3('0x7')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xbfd3('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xbfd3('0x5')](_0xbfd3('0x8'),'newTab'),'defaultValue':_0xbfd3('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 25cb5c0..7a30dfd 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 _0xadf0=['show','params','keys','fields','includeAll','include','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','GET','%s/%s','ticket_fields','Basic\x20%s','format','toString','headers','%s/token:%s','base64','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','findAll','rows'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadf0,0x12d));var _0x0adf=function(_0x210ff7,_0x45ed46){_0x210ff7=_0x210ff7-0x0;var _0x330a3d=_0xadf0[_0x210ff7];return _0x330a3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0adf('0x0'));var zipdir=require(_0x0adf('0x1'));var jsonpatch=require(_0x0adf('0x2'));var rp=require(_0x0adf('0x3'));var moment=require(_0x0adf('0x4'));var BPromise=require(_0x0adf('0x5'));var Mustache=require(_0x0adf('0x6'));var util=require('util');var path=require(_0x0adf('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0adf('0x8'));var squel=require(_0x0adf('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0adf('0xa'));var toCsv=require(_0x0adf('0xb'));var querystring=require('querystring');var Papa=require(_0x0adf('0xc'));var Redis=require(_0x0adf('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x0adf('0xe'));var as=require(_0x0adf('0xf'));var hardwareService=require(_0x0adf('0x10'));var logger=require('../../config/logger')(_0x0adf('0x11'));var utils=require(_0x0adf('0x12'));var config=require(_0x0adf('0x13'));var licenseUtil=require(_0x0adf('0x14'));var db=require(_0x0adf('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x0adf('0x16'));var client=jayson[_0x0adf('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57418c,_0x5637ec,_0xb018be,_0x4d4f0d){return new BPromise(function(_0x75ddac,_0x45bbab){var _0x3d7528=_0x4d4f0d||client;return _0x3d7528[_0x0adf('0x18')](_0x57418c,_0xb018be)[_0x0adf('0x19')](function(_0x2db0a2){logger[_0x0adf('0x1a')](_0x0adf('0x1b'),_0x5637ec,'request\x20sent');logger[_0x0adf('0x1c')](_0x0adf('0x1d'),_0x5637ec,'request\x20sent',JSON[_0x0adf('0x1e')](_0x2db0a2));if(_0x2db0a2['error']){if(_0x2db0a2[_0x0adf('0x1f')][_0x0adf('0x20')]===0x1f4){logger[_0x0adf('0x1f')](_0x0adf('0x1b'),_0x5637ec,_0x2db0a2['error'][_0x0adf('0x21')]);return _0x45bbab(_0x2db0a2[_0x0adf('0x1f')][_0x0adf('0x21')]);}logger[_0x0adf('0x1f')](_0x0adf('0x1b'),_0x5637ec,_0x2db0a2[_0x0adf('0x1f')]['message']);return _0x75ddac(_0x2db0a2[_0x0adf('0x1f')][_0x0adf('0x21')]);}else{logger[_0x0adf('0x1a')](_0x0adf('0x1b'),_0x5637ec,'request\x20sent');_0x75ddac(_0x2db0a2[_0x0adf('0x22')][_0x0adf('0x21')]);}})[_0x0adf('0x23')](function(_0x53bfdd){logger[_0x0adf('0x1f')](_0x0adf('0x1b'),_0x5637ec,_0x53bfdd);_0x45bbab(_0x53bfdd);});});}function respondWithStatusCode(_0x152694,_0x4094ab){_0x4094ab=_0x4094ab||0xcc;return function(_0x2b6a57){if(_0x2b6a57){return _0x152694[_0x0adf('0x24')](_0x4094ab);}return _0x152694['status'](_0x4094ab)[_0x0adf('0x25')]();};}function respondWithResult(_0x314f00,_0x80f962){_0x80f962=_0x80f962||0xc8;return function(_0x39a337){if(_0x39a337){return _0x314f00[_0x0adf('0x26')](_0x80f962)[_0x0adf('0x27')](_0x39a337);}};}function respondWithFilteredResult(_0x4b0076,_0x306f94){return function(_0x2ebba2){if(_0x2ebba2){var _0x272205=_0x2ebba2[_0x0adf('0x28')],_0x5a7992=_0x306f94[_0x0adf('0x29')],_0x4ed6ad=_0x306f94[_0x0adf('0x29')]+_0x306f94[_0x0adf('0x2a')],_0x4e8301;if(_0x4ed6ad>=_0x272205){_0x4ed6ad=_0x272205;_0x4e8301=0xc8;}else{_0x4e8301=0xce;}_0x4b0076[_0x0adf('0x26')](_0x4e8301);return _0x4b0076[_0x0adf('0x2b')](_0x0adf('0x2c'),_0x5a7992+'-'+_0x4ed6ad+'/'+_0x272205)[_0x0adf('0x27')](_0x2ebba2);}return null;};}function patchUpdates(_0x2a0fcc){return function(_0x2b1f14){try{jsonpatch[_0x0adf('0x2d')](_0x2b1f14,_0x2a0fcc,!![]);}catch(_0x3dadfb){return BPromise[_0x0adf('0x2e')](_0x3dadfb);}return _0x2b1f14[_0x0adf('0x2f')]();};}function saveUpdates(_0x46dbba,_0x512260){return function(_0x168f04){if(_0x168f04){return _0x168f04[_0x0adf('0x30')](_0x46dbba)[_0x0adf('0x19')](function(_0x44a2ba){return _0x44a2ba;});}return null;};}function removeEntity(_0x1fe2e5,_0x363959){return function(_0x1931ca){if(_0x1931ca){return _0x1931ca['destroy']()[_0x0adf('0x19')](function(){_0x1fe2e5['status'](0xcc)[_0x0adf('0x25')]();});}};}function handleEntityNotFound(_0x33830c,_0x175d7e){return function(_0x39e5c2){if(!_0x39e5c2){_0x33830c[_0x0adf('0x24')](0x194);}return _0x39e5c2;};}function handleError(_0x35532f,_0x4161cf){_0x4161cf=_0x4161cf||0x1f4;return function(_0x2862fb){logger[_0x0adf('0x1f')](_0x2862fb['stack']);if(_0x2862fb[_0x0adf('0x31')]){delete _0x2862fb[_0x0adf('0x31')];}_0x35532f[_0x0adf('0x26')](_0x4161cf)[_0x0adf('0x32')](_0x2862fb);};}exports[_0x0adf('0x33')]=function(_0x4cdf07,_0x11224d){var _0x201e5d={},_0x38603b={},_0x2069f0={'count':0x0,'rows':[]};var _0x4b9f02=_['map'](db[_0x0adf('0x34')][_0x0adf('0x35')],function(_0x3b0367){return{'name':_0x3b0367[_0x0adf('0x36')],'type':_0x3b0367[_0x0adf('0x37')]['key']};});_0x38603b['model']=_[_0x0adf('0x38')](_0x4b9f02,_0x0adf('0x31'));_0x38603b['query']=_['keys'](_0x4cdf07[_0x0adf('0x39')]);_0x38603b[_0x0adf('0x3a')]=_[_0x0adf('0x3b')](_0x38603b[_0x0adf('0x3c')],_0x38603b[_0x0adf('0x39')]);_0x201e5d[_0x0adf('0x3d')]=_[_0x0adf('0x3b')](_0x38603b[_0x0adf('0x3c')],qs['fields'](_0x4cdf07[_0x0adf('0x39')]['fields']));_0x201e5d[_0x0adf('0x3d')]=_0x201e5d[_0x0adf('0x3d')][_0x0adf('0x3e')]?_0x201e5d[_0x0adf('0x3d')]:_0x38603b['model'];if(!_0x4cdf07[_0x0adf('0x39')][_0x0adf('0x3f')](_0x0adf('0x40'))){_0x201e5d[_0x0adf('0x2a')]=qs['limit'](_0x4cdf07[_0x0adf('0x39')][_0x0adf('0x2a')]);_0x201e5d[_0x0adf('0x29')]=qs['offset'](_0x4cdf07['query'][_0x0adf('0x29')]);}_0x201e5d[_0x0adf('0x41')]=qs[_0x0adf('0x42')](_0x4cdf07[_0x0adf('0x39')][_0x0adf('0x42')]);_0x201e5d[_0x0adf('0x43')]=qs['filters'](_['pick'](_0x4cdf07[_0x0adf('0x39')],_0x38603b[_0x0adf('0x3a')]),_0x4b9f02);if(_0x4cdf07[_0x0adf('0x39')]['filter']){_0x201e5d[_0x0adf('0x43')]=_['merge'](_0x201e5d[_0x0adf('0x43')],{'$or':_['map'](_0x4b9f02,function(_0x11e656){if(_0x11e656[_0x0adf('0x37')]!==_0x0adf('0x44')){var _0x1cad8a={};_0x1cad8a[_0x11e656[_0x0adf('0x31')]]={'$like':'%'+_0x4cdf07[_0x0adf('0x39')][_0x0adf('0x45')]+'%'};return _0x1cad8a;}})});}_0x201e5d=_[_0x0adf('0x46')]({},_0x201e5d,_0x4cdf07[_0x0adf('0x47')]);var _0x1f4429={'where':_0x201e5d[_0x0adf('0x43')]};return db['ZendeskAccount']['count'](_0x1f4429)['then'](function(_0x49a19a){_0x2069f0['count']=_0x49a19a;if(_0x4cdf07[_0x0adf('0x39')]['includeAll']){_0x201e5d['include']=[{'all':!![]}];}return db[_0x0adf('0x34')][_0x0adf('0x48')](_0x201e5d);})[_0x0adf('0x19')](function(_0x3e5907){_0x2069f0[_0x0adf('0x49')]=_0x3e5907;return _0x2069f0;})[_0x0adf('0x19')](respondWithFilteredResult(_0x11224d,_0x201e5d))['catch'](handleError(_0x11224d,null));};exports[_0x0adf('0x4a')]=function(_0x31e964,_0x252ae1){var _0x340049={'raw':![],'where':{'id':_0x31e964[_0x0adf('0x4b')]['id']}},_0x5b077f={};_0x5b077f[_0x0adf('0x3c')]=_[_0x0adf('0x4c')](db[_0x0adf('0x34')][_0x0adf('0x35')]);_0x5b077f[_0x0adf('0x39')]=_['keys'](_0x31e964[_0x0adf('0x39')]);_0x5b077f['filters']=_['intersection'](_0x5b077f[_0x0adf('0x3c')],_0x5b077f['query']);_0x340049['attributes']=_['intersection'](_0x5b077f[_0x0adf('0x3c')],qs[_0x0adf('0x4d')](_0x31e964[_0x0adf('0x39')][_0x0adf('0x4d')]));_0x340049[_0x0adf('0x3d')]=_0x340049[_0x0adf('0x3d')][_0x0adf('0x3e')]?_0x340049[_0x0adf('0x3d')]:_0x5b077f[_0x0adf('0x3c')];if(_0x31e964[_0x0adf('0x39')][_0x0adf('0x4e')]){_0x340049[_0x0adf('0x4f')]=[{'all':!![]}];}_0x340049=_[_0x0adf('0x46')]({},_0x340049,_0x31e964[_0x0adf('0x47')]);return db[_0x0adf('0x34')][_0x0adf('0x50')](_0x340049)[_0x0adf('0x19')](handleEntityNotFound(_0x252ae1,null))['then'](respondWithResult(_0x252ae1,null))['catch'](handleError(_0x252ae1,null));};exports[_0x0adf('0x51')]=function(_0x8c93e9,_0x1eba36){return db[_0x0adf('0x34')][_0x0adf('0x51')](_0x8c93e9[_0x0adf('0x52')],{})['then'](respondWithResult(_0x1eba36,0xc9))['catch'](handleError(_0x1eba36,null));};exports[_0x0adf('0x30')]=function(_0x19245f,_0x3cc263){if(_0x19245f[_0x0adf('0x52')]['id']){delete _0x19245f[_0x0adf('0x52')]['id'];}return db['ZendeskAccount'][_0x0adf('0x50')]({'where':{'id':_0x19245f['params']['id']}})[_0x0adf('0x19')](handleEntityNotFound(_0x3cc263,null))[_0x0adf('0x19')](saveUpdates(_0x19245f['body'],null))[_0x0adf('0x19')](respondWithResult(_0x3cc263,null))['catch'](handleError(_0x3cc263,null));};exports[_0x0adf('0x53')]=function(_0x4a024b,_0x28b9ba){return db[_0x0adf('0x34')][_0x0adf('0x50')]({'where':{'id':_0x4a024b[_0x0adf('0x4b')]['id']}})[_0x0adf('0x19')](handleEntityNotFound(_0x28b9ba,null))[_0x0adf('0x19')](removeEntity(_0x28b9ba,null))[_0x0adf('0x23')](handleError(_0x28b9ba,null));};exports[_0x0adf('0x54')]=function(_0x461586,_0x582351,_0x576c95){var _0x1920ae={};var _0x4fb54b={};var _0x2be6cd;var _0x1597de;return db[_0x0adf('0x34')][_0x0adf('0x55')]({'where':{'id':_0x461586['params']['id']}})[_0x0adf('0x19')](handleEntityNotFound(_0x582351,null))[_0x0adf('0x19')](function(_0x5eb691){if(_0x5eb691){_0x2be6cd=_0x5eb691;_0x4fb54b[_0x0adf('0x3c')]=_[_0x0adf('0x4c')](db[_0x0adf('0x56')][_0x0adf('0x35')]);_0x4fb54b[_0x0adf('0x39')]=_[_0x0adf('0x4c')](_0x461586[_0x0adf('0x39')]);_0x4fb54b['filters']=_[_0x0adf('0x3b')](_0x4fb54b[_0x0adf('0x3c')],_0x4fb54b[_0x0adf('0x39')]);_0x1920ae[_0x0adf('0x3d')]=_['intersection'](_0x4fb54b['model'],qs[_0x0adf('0x4d')](_0x461586[_0x0adf('0x39')]['fields']));_0x1920ae[_0x0adf('0x3d')]=_0x1920ae[_0x0adf('0x3d')][_0x0adf('0x3e')]?_0x1920ae[_0x0adf('0x3d')]:_0x4fb54b[_0x0adf('0x3c')];_0x1920ae[_0x0adf('0x41')]=qs[_0x0adf('0x42')](_0x461586[_0x0adf('0x39')][_0x0adf('0x42')]);_0x1920ae[_0x0adf('0x43')]=qs[_0x0adf('0x3a')](_['pick'](_0x461586[_0x0adf('0x39')],_0x4fb54b['filters']));if(_0x461586[_0x0adf('0x39')][_0x0adf('0x45')]){_0x1920ae[_0x0adf('0x43')]=_[_0x0adf('0x46')](_0x1920ae[_0x0adf('0x43')],{'$or':_[_0x0adf('0x38')](_0x1920ae['attributes'],function(_0x285a06){var _0x4e9efb={};_0x4e9efb[_0x285a06]={'$like':'%'+_0x461586[_0x0adf('0x39')][_0x0adf('0x45')]+'%'};return _0x4e9efb;})});}_0x1920ae=_[_0x0adf('0x46')]({},_0x1920ae,_0x461586['options']);return _0x2be6cd[_0x0adf('0x54')](_0x1920ae);}})[_0x0adf('0x19')](function(_0x457f4a){if(_0x457f4a){_0x1597de=_0x457f4a[_0x0adf('0x3e')];if(!_0x461586[_0x0adf('0x39')][_0x0adf('0x3f')](_0x0adf('0x40'))){_0x1920ae[_0x0adf('0x2a')]=qs[_0x0adf('0x2a')](_0x461586[_0x0adf('0x39')][_0x0adf('0x2a')]);_0x1920ae[_0x0adf('0x29')]=qs[_0x0adf('0x29')](_0x461586['query']['offset']);}return _0x2be6cd['getConfigurations'](_0x1920ae);}})[_0x0adf('0x19')](function(_0x699b7f){if(_0x699b7f){return _0x699b7f?{'count':_0x1597de,'rows':_0x699b7f}:null;}})[_0x0adf('0x19')](respondWithResult(_0x582351,null))[_0x0adf('0x23')](handleError(_0x582351,null));};exports[_0x0adf('0x57')]=function(_0x4c36fc,_0x22d5a6,_0x262e04){if(_0x4c36fc[_0x0adf('0x52')]['id']){delete _0x4c36fc[_0x0adf('0x52')]['id'];}return db[_0x0adf('0x34')][_0x0adf('0x55')]({'where':{'id':_0x4c36fc[_0x0adf('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22d5a6,null))[_0x0adf('0x19')](function(_0x3aa8cd){if(_0x3aa8cd){_0x4c36fc[_0x0adf('0x52')][_0x0adf('0x58')]=_0x3aa8cd['id'];_0x4c36fc['body'][_0x0adf('0x59')]=integrations['getSubjects'](_0x4c36fc[_0x0adf('0x52')]['channel'],_0x4c36fc[_0x0adf('0x52')][_0x0adf('0x37')]);_0x4c36fc[_0x0adf('0x52')][_0x0adf('0x5a')]=integrations[_0x0adf('0x5b')](_0x4c36fc[_0x0adf('0x52')][_0x0adf('0x5c')],_0x4c36fc['body']['type']);return db[_0x0adf('0x56')][_0x0adf('0x51')](_0x4c36fc[_0x0adf('0x52')],{'include':[{'model':db[_0x0adf('0x5d')],'as':_0x0adf('0x59')},{'model':db[_0x0adf('0x5d')],'as':'Descriptions'}]});}return null;})[_0x0adf('0x19')](respondWithResult(_0x22d5a6,null))[_0x0adf('0x23')](handleError(_0x22d5a6,null));};exports[_0x0adf('0x5e')]=function(_0x4c5419,_0x331ead,_0x1e7162){var _0x3df1a7='';return db['ZendeskAccount'][_0x0adf('0x55')]({'where':{'id':_0x4c5419[_0x0adf('0x4b')]['id']},'attributes':['id',_0x0adf('0x5f'),_0x0adf('0x60'),_0x0adf('0x61'),'authType','remoteUri']})['then'](handleEntityNotFound(_0x331ead,null))['then'](function(_0x257fd2){if(_0x257fd2){_0x3df1a7=_0x257fd2[_0x0adf('0x62')];var _0x42d1fd=_0x3df1a7[_0x0adf('0x63')](-0x1);if(_0x42d1fd==='/'){_0x3df1a7=_0x3df1a7[_0x0adf('0x64')](0x0,_0x3df1a7['lastIndexOf'](_0x42d1fd));}var _0x1bffa1={'method':_0x0adf('0x65'),'uri':util['format'](_0x0adf('0x66'),_0x3df1a7,_0x0adf('0x67')),'json':!![]};switch(_0x257fd2['authType']){case _0x0adf('0x60'):_0x1bffa1['headers']={'Authorization':util['format'](_0x0adf('0x68'),new Buffer(util[_0x0adf('0x69')]('%s:%s',_0x257fd2[_0x0adf('0x5f')],_0x257fd2[_0x0adf('0x60')]))[_0x0adf('0x6a')]('base64'))};break;case'token':_0x1bffa1[_0x0adf('0x6b')]={'Authorization':util[_0x0adf('0x69')](_0x0adf('0x68'),new Buffer(util[_0x0adf('0x69')](_0x0adf('0x6c'),_0x257fd2['username'],_0x257fd2[_0x0adf('0x61')]))[_0x0adf('0x6a')](_0x0adf('0x6d')))};break;default:throw new db[(_0x0adf('0x6e'))]['ValidationError'](_0x0adf('0x6f'));}return rp(_0x1bffa1);}})[_0x0adf('0x19')](function(_0x15ad7c){if(_0x15ad7c){var _0x201ac5=[_0x0adf('0x70'),_0x0adf('0x71'),_0x0adf('0x72'),_0x0adf('0x73')];_[_0x0adf('0x74')](_0x15ad7c[_0x0adf('0x67')],function(_0x4c94f0){return _0x201ac5[_0x0adf('0x75')](_0x4c94f0['type']);});return{'count':_0x15ad7c[_0x0adf('0x67')][_0x0adf('0x3e')],'rows':_[_0x0adf('0x38')](_0x15ad7c['ticket_fields'],function(_0x479a34){return{'id':_0x479a34['id'],'name':_0x479a34[_0x0adf('0x76')]>0x7?_0x479a34[_0x0adf('0x77')]:_0x479a34[_0x0adf('0x37')],'custom':_0x479a34[_0x0adf('0x76')]>0x7?!![]:![],'options':_0x479a34['system_field_options']?_0x479a34['system_field_options']:_0x479a34[_0x0adf('0x78')]?_0x479a34['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x331ead,null))[_0x0adf('0x23')](function(_0x6aa492){var _0x5eb3b4=_0x4c5419[_0x0adf('0x39')][_0x0adf('0x79')]?0x1f4:_0x6aa492[_0x0adf('0x7a')]||0x1f4;logger['error'](_0x0adf('0x7b'),_0x0adf('0x5e'),_0x5eb3b4,JSON['stringify'](_0x6aa492));delete _0x6aa492['name'];if(_0x5eb3b4===0x191){_0x5eb3b4=0x190;}_0x331ead[_0x0adf('0x26')](_0x5eb3b4)[_0x0adf('0x32')](_0x4c5419['query'][_0x0adf('0x79')]?{'message':_0x0adf('0x7c'),'statusCode':_0x6aa492['statusCode']}:_0x6aa492);});}; \ No newline at end of file +var _0x826a=['Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','%s/%s','headers','Basic\x20%s','%s:%s','toString','%s/token:%s','base64','Sequelize','subject','description','group','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','reject','save','then','destroy','stack','name','send','index','ZendeskAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','rawAttributes','length','find','create','body','update','params','getConfigurations','findOne','ZendeskConfiguration','order','options','addConfiguration','AccountId','Subjects','getSubjects'];(function(_0x4bada7,_0x2a529e){var _0x33832f=function(_0x35cd5c){while(--_0x35cd5c){_0x4bada7['push'](_0x4bada7['shift']());}};_0x33832f(++_0x2a529e);}(_0x826a,0x1aa));var _0xa826=function(_0x7a71dc,_0x196f65){_0x7a71dc=_0x7a71dc-0x0;var _0x295fe2=_0x826a[_0x7a71dc];return _0x295fe2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa826('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa826('0x1'));var rp=require('request-promise');var moment=require(_0xa826('0x2'));var BPromise=require(_0xa826('0x3'));var Mustache=require(_0xa826('0x4'));var util=require(_0xa826('0x5'));var path=require('path');var sox=require(_0xa826('0x6'));var csv=require(_0xa826('0x7'));var ejs=require(_0xa826('0x8'));var fs=require('fs');var fs_extra=require(_0xa826('0x9'));var _=require(_0xa826('0xa'));var squel=require(_0xa826('0xb'));var crypto=require(_0xa826('0xc'));var jsforce=require(_0xa826('0xd'));var deskjs=require(_0xa826('0xe'));var toCsv=require(_0xa826('0x7'));var querystring=require(_0xa826('0xf'));var Papa=require(_0xa826('0x10'));var Redis=require(_0xa826('0x11'));var authService=require(_0xa826('0x12'));var qs=require(_0xa826('0x13'));var as=require(_0xa826('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa826('0x15'))('api');var utils=require(_0xa826('0x16'));var config=require(_0xa826('0x17'));var licenseUtil=require(_0xa826('0x18'));var db=require(_0xa826('0x19'))['db'];var integrations=require(_0xa826('0x1a'));var jayson=require(_0xa826('0x1b'));var client=jayson[_0xa826('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x74f6ec,_0x5c6cee,_0x3e99b0,_0x41c0c2){return new BPromise(function(_0x5dc0c7,_0x512ba9){var _0x49c91e=_0x41c0c2||client;return _0x49c91e[_0xa826('0x1d')](_0x74f6ec,_0x3e99b0)['then'](function(_0x4c546b){logger[_0xa826('0x1e')](_0xa826('0x1f'),_0x5c6cee,_0xa826('0x20'));logger['debug'](_0xa826('0x21'),_0x5c6cee,_0xa826('0x20'),JSON[_0xa826('0x22')](_0x4c546b));if(_0x4c546b[_0xa826('0x23')]){if(_0x4c546b[_0xa826('0x23')]['code']===0x1f4){logger[_0xa826('0x23')](_0xa826('0x1f'),_0x5c6cee,_0x4c546b[_0xa826('0x23')]['message']);return _0x512ba9(_0x4c546b['error'][_0xa826('0x24')]);}logger[_0xa826('0x23')](_0xa826('0x1f'),_0x5c6cee,_0x4c546b[_0xa826('0x23')][_0xa826('0x24')]);return _0x5dc0c7(_0x4c546b['error'][_0xa826('0x24')]);}else{logger[_0xa826('0x1e')](_0xa826('0x1f'),_0x5c6cee,'request\x20sent');_0x5dc0c7(_0x4c546b['result'][_0xa826('0x24')]);}})[_0xa826('0x25')](function(_0x3b43da){logger['error'](_0xa826('0x1f'),_0x5c6cee,_0x3b43da);_0x512ba9(_0x3b43da);});});}function respondWithStatusCode(_0x26ef25,_0x1d4ade){_0x1d4ade=_0x1d4ade||0xcc;return function(_0x448b4d){if(_0x448b4d){return _0x26ef25[_0xa826('0x26')](_0x1d4ade);}return _0x26ef25['status'](_0x1d4ade)[_0xa826('0x27')]();};}function respondWithResult(_0x4fa5db,_0x17ef2d){_0x17ef2d=_0x17ef2d||0xc8;return function(_0x174f16){if(_0x174f16){return _0x4fa5db['status'](_0x17ef2d)[_0xa826('0x28')](_0x174f16);}};}function respondWithFilteredResult(_0xfa4d94,_0x38c919){return function(_0xf132e0){if(_0xf132e0){var _0x1107a4=_0xf132e0[_0xa826('0x29')],_0x3c6307=_0x38c919[_0xa826('0x2a')],_0x14e836=_0x38c919[_0xa826('0x2a')]+_0x38c919[_0xa826('0x2b')],_0x3b9c6d;if(_0x14e836>=_0x1107a4){_0x14e836=_0x1107a4;_0x3b9c6d=0xc8;}else{_0x3b9c6d=0xce;}_0xfa4d94[_0xa826('0x2c')](_0x3b9c6d);return _0xfa4d94[_0xa826('0x2d')](_0xa826('0x2e'),_0x3c6307+'-'+_0x14e836+'/'+_0x1107a4)[_0xa826('0x28')](_0xf132e0);}return null;};}function patchUpdates(_0x55886f){return function(_0x19bd84){try{jsonpatch['apply'](_0x19bd84,_0x55886f,!![]);}catch(_0x2dd810){return BPromise[_0xa826('0x2f')](_0x2dd810);}return _0x19bd84[_0xa826('0x30')]();};}function saveUpdates(_0x27d779,_0xddac0f){return function(_0x5d40f5){if(_0x5d40f5){return _0x5d40f5['update'](_0x27d779)[_0xa826('0x31')](function(_0x6bf769){return _0x6bf769;});}return null;};}function removeEntity(_0xd666b7,_0x45a69e){return function(_0x4cec68){if(_0x4cec68){return _0x4cec68[_0xa826('0x32')]()[_0xa826('0x31')](function(){_0xd666b7['status'](0xcc)[_0xa826('0x27')]();});}};}function handleEntityNotFound(_0x56ddc4,_0x189c71){return function(_0x40093a){if(!_0x40093a){_0x56ddc4[_0xa826('0x26')](0x194);}return _0x40093a;};}function handleError(_0x16700f,_0x24efa7){_0x24efa7=_0x24efa7||0x1f4;return function(_0x4c00bd){logger[_0xa826('0x23')](_0x4c00bd[_0xa826('0x33')]);if(_0x4c00bd[_0xa826('0x34')]){delete _0x4c00bd[_0xa826('0x34')];}_0x16700f[_0xa826('0x2c')](_0x24efa7)[_0xa826('0x35')](_0x4c00bd);};}exports[_0xa826('0x36')]=function(_0x1aaeae,_0x3bbbdc){var _0xd2b875={},_0xd82ea2={},_0x5e5916={'count':0x0,'rows':[]};var _0x46f50e=_['map'](db[_0xa826('0x37')]['rawAttributes'],function(_0x179c29){return{'name':_0x179c29[_0xa826('0x38')],'type':_0x179c29[_0xa826('0x39')][_0xa826('0x3a')]};});_0xd82ea2[_0xa826('0x3b')]=_[_0xa826('0x3c')](_0x46f50e,_0xa826('0x34'));_0xd82ea2[_0xa826('0x3d')]=_[_0xa826('0x3e')](_0x1aaeae[_0xa826('0x3d')]);_0xd82ea2[_0xa826('0x3f')]=_[_0xa826('0x40')](_0xd82ea2['model'],_0xd82ea2[_0xa826('0x3d')]);_0xd2b875[_0xa826('0x41')]=_[_0xa826('0x40')](_0xd82ea2['model'],qs[_0xa826('0x42')](_0x1aaeae[_0xa826('0x3d')]['fields']));_0xd2b875[_0xa826('0x41')]=_0xd2b875['attributes']['length']?_0xd2b875[_0xa826('0x41')]:_0xd82ea2[_0xa826('0x3b')];if(!_0x1aaeae[_0xa826('0x3d')][_0xa826('0x43')](_0xa826('0x44'))){_0xd2b875[_0xa826('0x2b')]=qs['limit'](_0x1aaeae[_0xa826('0x3d')][_0xa826('0x2b')]);_0xd2b875[_0xa826('0x2a')]=qs[_0xa826('0x2a')](_0x1aaeae[_0xa826('0x3d')][_0xa826('0x2a')]);}_0xd2b875['order']=qs[_0xa826('0x45')](_0x1aaeae[_0xa826('0x3d')][_0xa826('0x45')]);_0xd2b875[_0xa826('0x46')]=qs[_0xa826('0x3f')](_['pick'](_0x1aaeae[_0xa826('0x3d')],_0xd82ea2[_0xa826('0x3f')]),_0x46f50e);if(_0x1aaeae[_0xa826('0x3d')][_0xa826('0x47')]){_0xd2b875[_0xa826('0x46')]=_[_0xa826('0x48')](_0xd2b875[_0xa826('0x46')],{'$or':_[_0xa826('0x3c')](_0x46f50e,function(_0x459c79){if(_0x459c79[_0xa826('0x39')]!==_0xa826('0x49')){var _0x2921a5={};_0x2921a5[_0x459c79['name']]={'$like':'%'+_0x1aaeae[_0xa826('0x3d')][_0xa826('0x47')]+'%'};return _0x2921a5;}})});}_0xd2b875=_[_0xa826('0x48')]({},_0xd2b875,_0x1aaeae['options']);var _0x24122e={'where':_0xd2b875[_0xa826('0x46')]};return db[_0xa826('0x37')][_0xa826('0x29')](_0x24122e)[_0xa826('0x31')](function(_0x58ac74){_0x5e5916[_0xa826('0x29')]=_0x58ac74;if(_0x1aaeae[_0xa826('0x3d')][_0xa826('0x4a')]){_0xd2b875[_0xa826('0x4b')]=[{'all':!![]}];}return db[_0xa826('0x37')][_0xa826('0x4c')](_0xd2b875);})[_0xa826('0x31')](function(_0x5def02){_0x5e5916[_0xa826('0x4d')]=_0x5def02;return _0x5e5916;})['then'](respondWithFilteredResult(_0x3bbbdc,_0xd2b875))['catch'](handleError(_0x3bbbdc,null));};exports['show']=function(_0x26a858,_0x35d118){var _0x15a137={'raw':![],'where':{'id':_0x26a858['params']['id']}},_0x24143b={};_0x24143b[_0xa826('0x3b')]=_['keys'](db['ZendeskAccount'][_0xa826('0x4e')]);_0x24143b[_0xa826('0x3d')]=_['keys'](_0x26a858[_0xa826('0x3d')]);_0x24143b[_0xa826('0x3f')]=_['intersection'](_0x24143b['model'],_0x24143b['query']);_0x15a137['attributes']=_['intersection'](_0x24143b['model'],qs['fields'](_0x26a858[_0xa826('0x3d')]['fields']));_0x15a137[_0xa826('0x41')]=_0x15a137['attributes'][_0xa826('0x4f')]?_0x15a137[_0xa826('0x41')]:_0x24143b[_0xa826('0x3b')];if(_0x26a858[_0xa826('0x3d')][_0xa826('0x4a')]){_0x15a137['include']=[{'all':!![]}];}_0x15a137=_[_0xa826('0x48')]({},_0x15a137,_0x26a858['options']);return db['ZendeskAccount'][_0xa826('0x50')](_0x15a137)[_0xa826('0x31')](handleEntityNotFound(_0x35d118,null))['then'](respondWithResult(_0x35d118,null))[_0xa826('0x25')](handleError(_0x35d118,null));};exports[_0xa826('0x51')]=function(_0x410840,_0x4be11a){return db[_0xa826('0x37')][_0xa826('0x51')](_0x410840[_0xa826('0x52')],{})[_0xa826('0x31')](respondWithResult(_0x4be11a,0xc9))[_0xa826('0x25')](handleError(_0x4be11a,null));};exports[_0xa826('0x53')]=function(_0x18ffd7,_0x1080d1){if(_0x18ffd7['body']['id']){delete _0x18ffd7[_0xa826('0x52')]['id'];}return db[_0xa826('0x37')][_0xa826('0x50')]({'where':{'id':_0x18ffd7[_0xa826('0x54')]['id']}})[_0xa826('0x31')](handleEntityNotFound(_0x1080d1,null))['then'](saveUpdates(_0x18ffd7[_0xa826('0x52')],null))[_0xa826('0x31')](respondWithResult(_0x1080d1,null))[_0xa826('0x25')](handleError(_0x1080d1,null));};exports['destroy']=function(_0x19f2c0,_0x1623e2){return db['ZendeskAccount'][_0xa826('0x50')]({'where':{'id':_0x19f2c0[_0xa826('0x54')]['id']}})[_0xa826('0x31')](handleEntityNotFound(_0x1623e2,null))[_0xa826('0x31')](removeEntity(_0x1623e2,null))[_0xa826('0x25')](handleError(_0x1623e2,null));};exports[_0xa826('0x55')]=function(_0x21469f,_0x115337,_0x1d5ad1){var _0x2287ea={};var _0x1745ea={};var _0x4a7ba6;var _0x39132b;return db[_0xa826('0x37')][_0xa826('0x56')]({'where':{'id':_0x21469f[_0xa826('0x54')]['id']}})[_0xa826('0x31')](handleEntityNotFound(_0x115337,null))[_0xa826('0x31')](function(_0x2e746a){if(_0x2e746a){_0x4a7ba6=_0x2e746a;_0x1745ea[_0xa826('0x3b')]=_['keys'](db[_0xa826('0x57')][_0xa826('0x4e')]);_0x1745ea[_0xa826('0x3d')]=_['keys'](_0x21469f[_0xa826('0x3d')]);_0x1745ea[_0xa826('0x3f')]=_[_0xa826('0x40')](_0x1745ea['model'],_0x1745ea['query']);_0x2287ea[_0xa826('0x41')]=_[_0xa826('0x40')](_0x1745ea[_0xa826('0x3b')],qs[_0xa826('0x42')](_0x21469f['query'][_0xa826('0x42')]));_0x2287ea[_0xa826('0x41')]=_0x2287ea[_0xa826('0x41')][_0xa826('0x4f')]?_0x2287ea[_0xa826('0x41')]:_0x1745ea[_0xa826('0x3b')];_0x2287ea[_0xa826('0x58')]=qs[_0xa826('0x45')](_0x21469f[_0xa826('0x3d')]['sort']);_0x2287ea['where']=qs['filters'](_['pick'](_0x21469f[_0xa826('0x3d')],_0x1745ea[_0xa826('0x3f')]));if(_0x21469f[_0xa826('0x3d')][_0xa826('0x47')]){_0x2287ea[_0xa826('0x46')]=_[_0xa826('0x48')](_0x2287ea['where'],{'$or':_[_0xa826('0x3c')](_0x2287ea[_0xa826('0x41')],function(_0x33e682){var _0x5a5bce={};_0x5a5bce[_0x33e682]={'$like':'%'+_0x21469f[_0xa826('0x3d')][_0xa826('0x47')]+'%'};return _0x5a5bce;})});}_0x2287ea=_[_0xa826('0x48')]({},_0x2287ea,_0x21469f[_0xa826('0x59')]);return _0x4a7ba6[_0xa826('0x55')](_0x2287ea);}})[_0xa826('0x31')](function(_0x3b440a){if(_0x3b440a){_0x39132b=_0x3b440a[_0xa826('0x4f')];if(!_0x21469f[_0xa826('0x3d')][_0xa826('0x43')](_0xa826('0x44'))){_0x2287ea[_0xa826('0x2b')]=qs[_0xa826('0x2b')](_0x21469f[_0xa826('0x3d')][_0xa826('0x2b')]);_0x2287ea['offset']=qs[_0xa826('0x2a')](_0x21469f['query'][_0xa826('0x2a')]);}return _0x4a7ba6['getConfigurations'](_0x2287ea);}})[_0xa826('0x31')](function(_0x53311f){if(_0x53311f){return _0x53311f?{'count':_0x39132b,'rows':_0x53311f}:null;}})[_0xa826('0x31')](respondWithResult(_0x115337,null))[_0xa826('0x25')](handleError(_0x115337,null));};exports[_0xa826('0x5a')]=function(_0x545eaa,_0x5d41f8,_0x5ea2d2){if(_0x545eaa[_0xa826('0x52')]['id']){delete _0x545eaa[_0xa826('0x52')]['id'];}return db[_0xa826('0x37')]['findOne']({'where':{'id':_0x545eaa[_0xa826('0x54')]['id']}})[_0xa826('0x31')](handleEntityNotFound(_0x5d41f8,null))[_0xa826('0x31')](function(_0x425fe2){if(_0x425fe2){_0x545eaa['body'][_0xa826('0x5b')]=_0x425fe2['id'];_0x545eaa[_0xa826('0x52')][_0xa826('0x5c')]=integrations[_0xa826('0x5d')](_0x545eaa[_0xa826('0x52')]['channel'],_0x545eaa['body'][_0xa826('0x39')]);_0x545eaa[_0xa826('0x52')][_0xa826('0x5e')]=integrations[_0xa826('0x5f')](_0x545eaa[_0xa826('0x52')]['channel'],_0x545eaa['body'][_0xa826('0x39')]);return db[_0xa826('0x57')][_0xa826('0x51')](_0x545eaa[_0xa826('0x52')],{'include':[{'model':db[_0xa826('0x60')],'as':_0xa826('0x5c')},{'model':db['ZendeskField'],'as':_0xa826('0x5e')}]});}return null;})['then'](respondWithResult(_0x5d41f8,null))[_0xa826('0x25')](handleError(_0x5d41f8,null));};exports[_0xa826('0x61')]=function(_0x53b55f,_0x2addbf,_0x556a5d){var _0x108510='';return db['ZendeskAccount'][_0xa826('0x56')]({'where':{'id':_0x53b55f[_0xa826('0x54')]['id']},'attributes':['id',_0xa826('0x62'),_0xa826('0x63'),_0xa826('0x64'),_0xa826('0x65'),'remoteUri']})['then'](handleEntityNotFound(_0x2addbf,null))[_0xa826('0x31')](function(_0x575185){if(_0x575185){_0x108510=_0x575185[_0xa826('0x66')];var _0x1b3c99=_0x108510[_0xa826('0x67')](-0x1);if(_0x1b3c99==='/'){_0x108510=_0x108510['substring'](0x0,_0x108510[_0xa826('0x68')](_0x1b3c99));}var _0x3c4ea8={'method':_0xa826('0x69'),'uri':util[_0xa826('0x6a')](_0xa826('0x6b'),_0x108510,'ticket_fields'),'json':!![]};switch(_0x575185[_0xa826('0x65')]){case _0xa826('0x63'):_0x3c4ea8[_0xa826('0x6c')]={'Authorization':util[_0xa826('0x6a')](_0xa826('0x6d'),new Buffer(util[_0xa826('0x6a')](_0xa826('0x6e'),_0x575185[_0xa826('0x62')],_0x575185[_0xa826('0x63')]))[_0xa826('0x6f')]('base64'))};break;case _0xa826('0x64'):_0x3c4ea8[_0xa826('0x6c')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xa826('0x6a')](_0xa826('0x70'),_0x575185['username'],_0x575185[_0xa826('0x64')]))[_0xa826('0x6f')](_0xa826('0x71')))};break;default:throw new db[(_0xa826('0x72'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x3c4ea8);}})[_0xa826('0x31')](function(_0x16056e){if(_0x16056e){var _0x4fb14a=[_0xa826('0x73'),_0xa826('0x74'),_0xa826('0x75'),_0xa826('0x76')];_[_0xa826('0x77')](_0x16056e[_0xa826('0x78')],function(_0x22baee){return _0x4fb14a[_0xa826('0x79')](_0x22baee['type']);});return{'count':_0x16056e[_0xa826('0x78')][_0xa826('0x4f')],'rows':_[_0xa826('0x3c')](_0x16056e[_0xa826('0x78')],function(_0x4c2d51){return{'id':_0x4c2d51['id'],'name':_0x4c2d51[_0xa826('0x7a')]>0x7?_0x4c2d51[_0xa826('0x7b')]:_0x4c2d51[_0xa826('0x39')],'custom':_0x4c2d51[_0xa826('0x7a')]>0x7?!![]:![],'options':_0x4c2d51[_0xa826('0x7c')]?_0x4c2d51[_0xa826('0x7c')]:_0x4c2d51[_0xa826('0x7d')]?_0x4c2d51['custom_field_options']:[]};})};}})[_0xa826('0x31')](respondWithResult(_0x2addbf,null))[_0xa826('0x25')](function(_0x17caf5){var _0x2188b6=_0x53b55f[_0xa826('0x3d')][_0xa826('0x7e')]?0x1f4:_0x17caf5['statusCode']||0x1f4;logger[_0xa826('0x23')](_0xa826('0x7f'),_0xa826('0x61'),_0x2188b6,JSON['stringify'](_0x17caf5));delete _0x17caf5[_0xa826('0x34')];if(_0x2188b6===0x191){_0x2188b6=0x190;}_0x2addbf[_0xa826('0x2c')](_0x2188b6)[_0xa826('0x35')](_0x53b55f[_0xa826('0x3d')]['test']?{'message':_0xa826('0x80'),'statusCode':_0x17caf5[_0xa826('0x81')]}:_0x17caf5);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 968716a..04524a4 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 _0x5ab5=['../../components/integrations/configuration','exports','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4cb8e7,_0x2e1d22){var _0x3d0188=function(_0x6c6a39){while(--_0x6c6a39){_0x4cb8e7['push'](_0x4cb8e7['shift']());}};_0x3d0188(++_0x2e1d22);}(_0x5ab5,0x175));var _0x55ab=function(_0x19035d,_0x36947b){_0x19035d=_0x19035d-0x0;var _0x481037=_0x5ab5[_0x19035d];return _0x481037;};'use strict';var _=require(_0x55ab('0x0'));var util=require(_0x55ab('0x1'));var logger=require(_0x55ab('0x2'))(_0x55ab('0x3'));var moment=require(_0x55ab('0x4'));var BPromise=require(_0x55ab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x55ab('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x55ab('0x7'));module[_0x55ab('0x8')]=function(_0x72aa2c,_0x1dd42a){return _0x72aa2c['define']('ZendeskAccount',attributes,{'tableName':_0x55ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79f7=['moment','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','lodash','../../config/logger','api'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x79f7,0x152));var _0x779f=function(_0x388a4c,_0x18317d){_0x388a4c=_0x388a4c-0x0;var _0x33b8a1=_0x79f7[_0x388a4c];return _0x33b8a1;};'use strict';var _=require(_0x779f('0x0'));var util=require('util');var logger=require(_0x779f('0x1'))(_0x779f('0x2'));var moment=require(_0x779f('0x3'));var BPromise=require('bluebird');var rp=require(_0x779f('0x4'));var fs=require('fs');var path=require(_0x779f('0x5'));var rimraf=require(_0x779f('0x6'));var config=require(_0x779f('0x7'));var attributes=require(_0x779f('0x8'));var integrations=require(_0x779f('0x9'));module['exports']=function(_0x5c4abf,_0x19fb12){return _0x5c4abf[_0x779f('0xa')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 8ab1c77..414f783 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 _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowZendeskAccount','ZendeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','findAll'];(function(_0x4d2225,_0x1754b3){var _0x41a059=function(_0x29b5c4){while(--_0x29b5c4){_0x4d2225['push'](_0x4d2225['shift']());}};_0x41a059(++_0x1754b3);}(_0xe706,0xa3));var _0x6e70=function(_0x165ca9,_0x36e359){_0x165ca9=_0x165ca9-0x0;var _0x25f49a=_0xe706[_0x165ca9];return _0x25f49a;};'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']('ZendeskAccount,\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']('ZendeskAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['ZendeskAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetZendeskAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});}; \ No newline at end of file +var _0xd8b0=['raw','where','include','map','model','attributes','ShowZendeskAccount','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','options'];(function(_0x19201b,_0x216e48){var _0x2a13e2=function(_0x35112f){while(--_0x35112f){_0x19201b['push'](_0x19201b['shift']());}};_0x2a13e2(++_0x216e48);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['findAll']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'limit':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['limit']||null:null,'include':_0x5fecbd['options']?_0x5fecbd['options'][_0x0d8b('0x1b')]?_[_0x0d8b('0x1c')](_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1b')],function(_0x221071){return{'model':db[_0x221071[_0x0d8b('0x1d')]],'as':_0x221071['as'],'attributes':_0x221071[_0x0d8b('0x1e')],'include':_0x221071[_0x0d8b('0x1b')]?_[_0x0d8b('0x1c')](_0x221071['include'],function(_0xe8bbee){return{'model':db[_0xe8bbee[_0x0d8b('0x1d')]],'as':_0xe8bbee['as'],'attributes':_0xe8bbee['attributes'],'include':_0xe8bbee[_0x0d8b('0x1b')]?_['map'](_0xe8bbee[_0x0d8b('0x1b')],function(_0x234bdd){return{'model':db[_0x234bdd[_0x0d8b('0x1d')]],'as':_0x234bdd['as'],'attributes':_0x234bdd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28f639){logger[_0x0d8b('0xb')]('GetZendeskAccount',_0x5fecbd);logger[_0x0d8b('0xe')]('GetZendeskAccount',_0x5fecbd,JSON[_0x0d8b('0x10')](_0x28f639));_0x18dd2d(_0x28f639);})['catch'](function(_0x97050a){logger['error'](_0x0d8b('0x16'),_0x97050a['message'],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x97050a['message']));});});};exports[_0x0d8b('0x1f')]=function(_0x106e4c){var _0x2c058d=this;return new Promise(function(_0x56120a,_0x4c80a2){return db['ZendeskAccount'][_0x0d8b('0x20')]({'raw':_0x106e4c['options']?_0x106e4c[_0x0d8b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x106e4c['options']?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x106e4c[_0x0d8b('0x18')]?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1e')]||null:null,'include':_0x106e4c[_0x0d8b('0x18')]?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1b')]?_['map'](_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1b')],function(_0x4b3ea0){return{'model':db[_0x4b3ea0[_0x0d8b('0x1d')]],'as':_0x4b3ea0['as'],'attributes':_0x4b3ea0[_0x0d8b('0x1e')],'include':_0x4b3ea0[_0x0d8b('0x1b')]?_['map'](_0x4b3ea0[_0x0d8b('0x1b')],function(_0x2c507e){return{'model':db[_0x2c507e[_0x0d8b('0x1d')]],'as':_0x2c507e['as'],'attributes':_0x2c507e[_0x0d8b('0x1e')],'include':_0x2c507e[_0x0d8b('0x1b')]?_['map'](_0x2c507e[_0x0d8b('0x1b')],function(_0x1649fc){return{'model':db[_0x1649fc['model']],'as':_0x1649fc['as'],'attributes':_0x1649fc[_0x0d8b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0x188af2){logger[_0x0d8b('0xb')](_0x0d8b('0x1f'),_0x106e4c);logger['debug']('ShowZendeskAccount',_0x106e4c,JSON[_0x0d8b('0x10')](_0x188af2));_0x56120a(_0x188af2);})['catch'](function(_0x531c55){logger[_0x0d8b('0x11')](_0x0d8b('0x1f'),_0x531c55[_0x0d8b('0x13')],_0x106e4c);_0x4c80a2(_0x2c058d[_0x0d8b('0x11')](0x1f4,_0x531c55[_0x0d8b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 9d536b2..e38c6b7 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 _0xde59=['setTags','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','post','create'];(function(_0x491e37,_0x556820){var _0x4c0225=function(_0x5b6db6){while(--_0x5b6db6){_0x491e37['push'](_0x491e37['shift']());}};_0x4c0225(++_0x556820);}(_0xde59,0x19d));var _0x9de5=function(_0x36cb41,_0x4b3926){_0x36cb41=_0x36cb41-0x0;var _0xd3d076=_0xde59[_0x36cb41];return _0xd3d076;};'use strict';var multer=require(_0x9de5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9de5('0x1'));var express=require(_0x9de5('0x2'));var router=express[_0x9de5('0x3')]();var fs_extra=require(_0x9de5('0x4'));var auth=require(_0x9de5('0x5'));var interaction=require(_0x9de5('0x6'));var config=require(_0x9de5('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x9de5('0x8')]('/',auth[_0x9de5('0x9')](),controller['index']);router['get'](_0x9de5('0xa'),auth[_0x9de5('0x9')](),controller[_0x9de5('0xb')]);router[_0x9de5('0x8')]('/:id/fields',auth[_0x9de5('0x9')](),controller[_0x9de5('0xc')]);router[_0x9de5('0x8')](_0x9de5('0xd'),auth[_0x9de5('0x9')](),controller['getSubjects']);router[_0x9de5('0x8')](_0x9de5('0xe'),auth[_0x9de5('0x9')](),controller[_0x9de5('0xf')]);router['get'](_0x9de5('0x10'),auth[_0x9de5('0x9')](),controller['getTags']);router[_0x9de5('0x11')]('/',auth['isAuthenticated'](),controller[_0x9de5('0x12')]);router[_0x9de5('0x11')](_0x9de5('0x10'),auth['isAuthenticated'](),controller[_0x9de5('0x13')]);router[_0x9de5('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x9de5('0x15')]);router[_0x9de5('0x16')](_0x9de5('0xa'),auth[_0x9de5('0x9')](),controller['destroy']);module[_0x9de5('0x17')]=router; \ No newline at end of file +var _0xd252=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','/:id','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xd252,0x167));var _0x2d25=function(_0x14d175,_0x230bf7){_0x14d175=_0x14d175-0x0;var _0x2946e9=_0xd252[_0x14d175];return _0x2946e9;};'use strict';var multer=require(_0x2d25('0x0'));var util=require('util');var path=require(_0x2d25('0x1'));var timeout=require(_0x2d25('0x2'));var express=require(_0x2d25('0x3'));var router=express[_0x2d25('0x4')]();var fs_extra=require(_0x2d25('0x5'));var auth=require(_0x2d25('0x6'));var interaction=require(_0x2d25('0x7'));var config=require(_0x2d25('0x8'));var controller=require(_0x2d25('0x9'));router[_0x2d25('0xa')]('/',auth[_0x2d25('0xb')](),controller['index']);router[_0x2d25('0xa')](_0x2d25('0xc'),auth[_0x2d25('0xb')](),controller['show']);router['get']('/:id/fields',auth[_0x2d25('0xb')](),controller[_0x2d25('0xd')]);router[_0x2d25('0xa')](_0x2d25('0xe'),auth[_0x2d25('0xb')](),controller['getSubjects']);router['get'](_0x2d25('0xf'),auth['isAuthenticated'](),controller[_0x2d25('0x10')]);router[_0x2d25('0xa')](_0x2d25('0x11'),auth[_0x2d25('0xb')](),controller['getTags']);router[_0x2d25('0x12')]('/',auth['isAuthenticated'](),controller[_0x2d25('0x13')]);router[_0x2d25('0x12')](_0x2d25('0x11'),auth[_0x2d25('0xb')](),controller[_0x2d25('0x14')]);router[_0x2d25('0x15')]('/:id',auth[_0x2d25('0xb')](),controller[_0x2d25('0x16')]);router[_0x2d25('0x17')](_0x2d25('0xc'),auth[_0x2d25('0xb')](),controller[_0x2d25('0x18')]);module[_0x2d25('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 e3fc3eb..2e31f78 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 _0xdce2=['STRING','sequelize'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xdce2,0x19b));var _0x2dce=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xdce2[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x2dce('0x0'));module['exports']={'name':{'type':Sequelize[_0x2dce('0x1')]},'description':{'type':Sequelize[_0x2dce('0x1')]}}; \ No newline at end of file +var _0xef06=['exports','STRING'];(function(_0x24fed0,_0x24c270){var _0x1d9d08=function(_0x573975){while(--_0x573975){_0x24fed0['push'](_0x24fed0['shift']());}};_0x1d9d08(++_0x24c270);}(_0xef06,0x90));var _0x6ef0=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xef06[_0x36ed3c];return _0x52a2e0;};'use strict';var Sequelize=require('sequelize');module[_0x6ef0('0x0')]={'name':{'type':Sequelize[_0x6ef0('0x1')]},'description':{'type':Sequelize[_0x6ef0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 9c7aa5e..c890662 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 _0xeb1c=['code','message','result','catch','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','end','name','map','ZendeskConfiguration','fieldName','type','model','query','keys','filters','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','attributes','create','body','update','destroy','find','params','getFields','findOne','ZendeskField','rawAttributes','getSubjects','hasOwnProperty','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5dcc12,_0x3b84d9){var _0xc2294e=function(_0x4076f4){while(--_0x4076f4){_0x5dcc12['push'](_0x5dcc12['shift']());}};_0xc2294e(++_0x3b84d9);}(_0xeb1c,0x14e));var _0xceb1=function(_0x3afc58,_0x5d7815){_0x3afc58=_0x3afc58-0x0;var _0x10e00e=_0xeb1c[_0x3afc58];return _0x10e00e;};'use strict';var emlformat=require(_0xceb1('0x0'));var rimraf=require(_0xceb1('0x1'));var zipdir=require(_0xceb1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xceb1('0x3'));var moment=require(_0xceb1('0x4'));var BPromise=require(_0xceb1('0x5'));var Mustache=require(_0xceb1('0x6'));var util=require('util');var path=require('path');var sox=require(_0xceb1('0x7'));var csv=require(_0xceb1('0x8'));var ejs=require(_0xceb1('0x9'));var fs=require('fs');var fs_extra=require(_0xceb1('0xa'));var _=require(_0xceb1('0xb'));var squel=require(_0xceb1('0xc'));var crypto=require(_0xceb1('0xd'));var jsforce=require(_0xceb1('0xe'));var deskjs=require(_0xceb1('0xf'));var toCsv=require(_0xceb1('0x8'));var querystring=require(_0xceb1('0x10'));var Papa=require('papaparse');var Redis=require(_0xceb1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xceb1('0x12'));var as=require(_0xceb1('0x13'));var hardwareService=require(_0xceb1('0x14'));var logger=require(_0xceb1('0x15'))('api');var utils=require(_0xceb1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xceb1('0x17'));var db=require(_0xceb1('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xceb1('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x17f460,_0x2e8836,_0x414eb6,_0x295a78){return new BPromise(function(_0x1d9042,_0x5dc062){var _0x1d5530=_0x295a78||client;return _0x1d5530[_0xceb1('0x1a')](_0x17f460,_0x414eb6)[_0xceb1('0x1b')](function(_0x267270){logger[_0xceb1('0x1c')](_0xceb1('0x1d'),_0x2e8836,_0xceb1('0x1e'));logger['debug'](_0xceb1('0x1f'),_0x2e8836,_0xceb1('0x1e'),JSON[_0xceb1('0x20')](_0x267270));if(_0x267270['error']){if(_0x267270[_0xceb1('0x21')][_0xceb1('0x22')]===0x1f4){logger[_0xceb1('0x21')](_0xceb1('0x1d'),_0x2e8836,_0x267270['error']['message']);return _0x5dc062(_0x267270[_0xceb1('0x21')][_0xceb1('0x23')]);}logger[_0xceb1('0x21')](_0xceb1('0x1d'),_0x2e8836,_0x267270[_0xceb1('0x21')][_0xceb1('0x23')]);return _0x1d9042(_0x267270[_0xceb1('0x21')][_0xceb1('0x23')]);}else{logger[_0xceb1('0x1c')](_0xceb1('0x1d'),_0x2e8836,_0xceb1('0x1e'));_0x1d9042(_0x267270[_0xceb1('0x24')]['message']);}})[_0xceb1('0x25')](function(_0x1d0be1){logger[_0xceb1('0x21')](_0xceb1('0x1d'),_0x2e8836,_0x1d0be1);_0x5dc062(_0x1d0be1);});});}function respondWithStatusCode(_0x41e4a2,_0x1c508c){_0x1c508c=_0x1c508c||0xcc;return function(_0x5e861e){if(_0x5e861e){return _0x41e4a2[_0xceb1('0x26')](_0x1c508c);}return _0x41e4a2[_0xceb1('0x27')](_0x1c508c)['end']();};}function respondWithResult(_0x138a6b,_0x5aeda4){_0x5aeda4=_0x5aeda4||0xc8;return function(_0x39c328){if(_0x39c328){return _0x138a6b[_0xceb1('0x27')](_0x5aeda4)[_0xceb1('0x28')](_0x39c328);}};}function respondWithFilteredResult(_0x4e4c4f,_0xe53ac6){return function(_0xe67f0b){if(_0xe67f0b){var _0x5b2371=_0xe67f0b['count'],_0x2c14f5=_0xe53ac6[_0xceb1('0x29')],_0x2f9bc5=_0xe53ac6[_0xceb1('0x29')]+_0xe53ac6['limit'],_0xccd591;if(_0x2f9bc5>=_0x5b2371){_0x2f9bc5=_0x5b2371;_0xccd591=0xc8;}else{_0xccd591=0xce;}_0x4e4c4f['status'](_0xccd591);return _0x4e4c4f[_0xceb1('0x2a')](_0xceb1('0x2b'),_0x2c14f5+'-'+_0x2f9bc5+'/'+_0x5b2371)['json'](_0xe67f0b);}return null;};}function patchUpdates(_0x43a0df){return function(_0x520f63){try{jsonpatch[_0xceb1('0x2c')](_0x520f63,_0x43a0df,!![]);}catch(_0x51d4cc){return BPromise[_0xceb1('0x2d')](_0x51d4cc);}return _0x520f63[_0xceb1('0x2e')]();};}function saveUpdates(_0x1761d3,_0x37cee2){return function(_0x232bbe){if(_0x232bbe){return _0x232bbe['update'](_0x1761d3)[_0xceb1('0x1b')](function(_0x525d17){return _0x525d17;});}return null;};}function removeEntity(_0x39aec5,_0x16b3e0){return function(_0x17b710){if(_0x17b710){return _0x17b710['destroy']()[_0xceb1('0x1b')](function(){_0x39aec5[_0xceb1('0x27')](0xcc)[_0xceb1('0x2f')]();});}};}function handleEntityNotFound(_0x25be51,_0x2ef35c){return function(_0x4b56f8){if(!_0x4b56f8){_0x25be51[_0xceb1('0x26')](0x194);}return _0x4b56f8;};}function handleError(_0x16aeb6,_0x19d10b){_0x19d10b=_0x19d10b||0x1f4;return function(_0x924be4){logger[_0xceb1('0x21')](_0x924be4['stack']);if(_0x924be4[_0xceb1('0x30')]){delete _0x924be4[_0xceb1('0x30')];}_0x16aeb6[_0xceb1('0x27')](_0x19d10b)['send'](_0x924be4);};}exports['index']=function(_0xc288fa,_0xfe69b8){var _0x373a22={},_0x460300={},_0x4ae5d2={'count':0x0,'rows':[]};var _0xf5ac8=_[_0xceb1('0x31')](db[_0xceb1('0x32')]['rawAttributes'],function(_0xfa7459){return{'name':_0xfa7459[_0xceb1('0x33')],'type':_0xfa7459[_0xceb1('0x34')]['key']};});_0x460300[_0xceb1('0x35')]=_[_0xceb1('0x31')](_0xf5ac8,_0xceb1('0x30'));_0x460300[_0xceb1('0x36')]=_[_0xceb1('0x37')](_0xc288fa[_0xceb1('0x36')]);_0x460300[_0xceb1('0x38')]=_[_0xceb1('0x39')](_0x460300['model'],_0x460300['query']);_0x373a22['attributes']=_['intersection'](_0x460300[_0xceb1('0x35')],qs[_0xceb1('0x3a')](_0xc288fa[_0xceb1('0x36')]['fields']));_0x373a22['attributes']=_0x373a22['attributes'][_0xceb1('0x3b')]?_0x373a22['attributes']:_0x460300[_0xceb1('0x35')];if(!_0xc288fa[_0xceb1('0x36')]['hasOwnProperty'](_0xceb1('0x3c'))){_0x373a22[_0xceb1('0x3d')]=qs['limit'](_0xc288fa['query'][_0xceb1('0x3d')]);_0x373a22[_0xceb1('0x29')]=qs[_0xceb1('0x29')](_0xc288fa[_0xceb1('0x36')][_0xceb1('0x29')]);}_0x373a22[_0xceb1('0x3e')]=qs[_0xceb1('0x3f')](_0xc288fa['query'][_0xceb1('0x3f')]);_0x373a22[_0xceb1('0x40')]=qs['filters'](_[_0xceb1('0x41')](_0xc288fa['query'],_0x460300[_0xceb1('0x38')]),_0xf5ac8);if(_0xc288fa['query'][_0xceb1('0x42')]){_0x373a22[_0xceb1('0x40')]=_[_0xceb1('0x43')](_0x373a22[_0xceb1('0x40')],{'$or':_[_0xceb1('0x31')](_0xf5ac8,function(_0xbb43df){if(_0xbb43df[_0xceb1('0x34')]!==_0xceb1('0x44')){var _0x43b747={};_0x43b747[_0xbb43df[_0xceb1('0x30')]]={'$like':'%'+_0xc288fa[_0xceb1('0x36')][_0xceb1('0x42')]+'%'};return _0x43b747;}})});}_0x373a22=_['merge']({},_0x373a22,_0xc288fa[_0xceb1('0x45')]);var _0x237daf={'where':_0x373a22[_0xceb1('0x40')]};return db['ZendeskConfiguration'][_0xceb1('0x46')](_0x237daf)[_0xceb1('0x1b')](function(_0x466f93){_0x4ae5d2[_0xceb1('0x46')]=_0x466f93;if(_0xc288fa[_0xceb1('0x36')][_0xceb1('0x47')]){_0x373a22[_0xceb1('0x48')]=[{'all':!![]}];}return db[_0xceb1('0x32')][_0xceb1('0x49')](_0x373a22);})[_0xceb1('0x1b')](function(_0x2bde7a){_0x4ae5d2['rows']=_0x2bde7a;return _0x4ae5d2;})[_0xceb1('0x1b')](respondWithFilteredResult(_0xfe69b8,_0x373a22))['catch'](handleError(_0xfe69b8,null));};exports[_0xceb1('0x4a')]=function(_0x3e0d68,_0xf394a5){var _0x45943a={'raw':![],'where':{'id':_0x3e0d68['params']['id']}},_0x37aba4={};_0x37aba4['model']=_[_0xceb1('0x37')](db[_0xceb1('0x32')]['rawAttributes']);_0x37aba4[_0xceb1('0x36')]=_[_0xceb1('0x37')](_0x3e0d68[_0xceb1('0x36')]);_0x37aba4['filters']=_[_0xceb1('0x39')](_0x37aba4[_0xceb1('0x35')],_0x37aba4[_0xceb1('0x36')]);_0x45943a[_0xceb1('0x4b')]=_['intersection'](_0x37aba4[_0xceb1('0x35')],qs[_0xceb1('0x3a')](_0x3e0d68['query'][_0xceb1('0x3a')]));_0x45943a[_0xceb1('0x4b')]=_0x45943a[_0xceb1('0x4b')]['length']?_0x45943a[_0xceb1('0x4b')]:_0x37aba4['model'];if(_0x3e0d68[_0xceb1('0x36')]['includeAll']){_0x45943a[_0xceb1('0x48')]=[{'all':!![]}];}_0x45943a=_['merge']({},_0x45943a,_0x3e0d68[_0xceb1('0x45')]);return db[_0xceb1('0x32')]['find'](_0x45943a)['then'](handleEntityNotFound(_0xf394a5,null))[_0xceb1('0x1b')](respondWithResult(_0xf394a5,null))['catch'](handleError(_0xf394a5,null));};exports['create']=function(_0x245c55,_0x4aa115){return db[_0xceb1('0x32')][_0xceb1('0x4c')](_0x245c55[_0xceb1('0x4d')],{})[_0xceb1('0x1b')](respondWithResult(_0x4aa115,0xc9))[_0xceb1('0x25')](handleError(_0x4aa115,null));};exports[_0xceb1('0x4e')]=function(_0x5e8c76,_0x51795c){if(_0x5e8c76[_0xceb1('0x4d')]['id']){delete _0x5e8c76['body']['id'];}return db[_0xceb1('0x32')]['find']({'where':{'id':_0x5e8c76['params']['id']}})[_0xceb1('0x1b')](handleEntityNotFound(_0x51795c,null))['then'](saveUpdates(_0x5e8c76[_0xceb1('0x4d')],null))[_0xceb1('0x1b')](respondWithResult(_0x51795c,null))[_0xceb1('0x25')](handleError(_0x51795c,null));};exports[_0xceb1('0x4f')]=function(_0x19f759,_0x49cba6){return db[_0xceb1('0x32')][_0xceb1('0x50')]({'where':{'id':_0x19f759[_0xceb1('0x51')]['id']}})[_0xceb1('0x1b')](handleEntityNotFound(_0x49cba6,null))[_0xceb1('0x1b')](removeEntity(_0x49cba6,null))[_0xceb1('0x25')](handleError(_0x49cba6,null));};exports[_0xceb1('0x52')]=function(_0x51dac8,_0x4873ed,_0x90e819){var _0x1f0285={};var _0x27f577={};var _0x2fd75c;var _0x38f1f8;return db['ZendeskConfiguration'][_0xceb1('0x53')]({'where':{'id':_0x51dac8[_0xceb1('0x51')]['id']}})['then'](handleEntityNotFound(_0x4873ed,null))[_0xceb1('0x1b')](function(_0x5176e7){if(_0x5176e7){_0x2fd75c=_0x5176e7;_0x27f577[_0xceb1('0x35')]=_[_0xceb1('0x37')](db[_0xceb1('0x54')][_0xceb1('0x55')]);_0x27f577[_0xceb1('0x36')]=_[_0xceb1('0x37')](_0x51dac8[_0xceb1('0x36')]);_0x27f577[_0xceb1('0x38')]=_[_0xceb1('0x39')](_0x27f577['model'],_0x27f577[_0xceb1('0x36')]);_0x1f0285[_0xceb1('0x4b')]=_[_0xceb1('0x39')](_0x27f577[_0xceb1('0x35')],qs[_0xceb1('0x3a')](_0x51dac8[_0xceb1('0x36')]['fields']));_0x1f0285[_0xceb1('0x4b')]=_0x1f0285['attributes'][_0xceb1('0x3b')]?_0x1f0285[_0xceb1('0x4b')]:_0x27f577[_0xceb1('0x35')];_0x1f0285[_0xceb1('0x3e')]=qs[_0xceb1('0x3f')](_0x51dac8[_0xceb1('0x36')][_0xceb1('0x3f')]);_0x1f0285[_0xceb1('0x40')]=qs[_0xceb1('0x38')](_['pick'](_0x51dac8[_0xceb1('0x36')],_0x27f577[_0xceb1('0x38')]));if(_0x51dac8[_0xceb1('0x36')][_0xceb1('0x42')]){_0x1f0285['where']=_[_0xceb1('0x43')](_0x1f0285[_0xceb1('0x40')],{'$or':_[_0xceb1('0x31')](_0x1f0285[_0xceb1('0x4b')],function(_0x50024d){var _0x660552={};_0x660552[_0x50024d]={'$like':'%'+_0x51dac8[_0xceb1('0x36')][_0xceb1('0x42')]+'%'};return _0x660552;})});}_0x1f0285=_[_0xceb1('0x43')]({},_0x1f0285,_0x51dac8[_0xceb1('0x45')]);return _0x2fd75c[_0xceb1('0x52')](_0x1f0285);}})[_0xceb1('0x1b')](function(_0x10ac63){if(_0x10ac63){_0x38f1f8=_0x10ac63[_0xceb1('0x3b')];if(!_0x51dac8[_0xceb1('0x36')]['hasOwnProperty']('nolimit')){_0x1f0285[_0xceb1('0x3d')]=qs[_0xceb1('0x3d')](_0x51dac8['query']['limit']);_0x1f0285[_0xceb1('0x29')]=qs[_0xceb1('0x29')](_0x51dac8[_0xceb1('0x36')][_0xceb1('0x29')]);}return _0x2fd75c[_0xceb1('0x52')](_0x1f0285);}})[_0xceb1('0x1b')](function(_0x225085){if(_0x225085){return _0x225085?{'count':_0x38f1f8,'rows':_0x225085}:null;}})[_0xceb1('0x1b')](respondWithResult(_0x4873ed,null))[_0xceb1('0x25')](handleError(_0x4873ed,null));};exports[_0xceb1('0x56')]=function(_0x7dc743,_0x99f6f3,_0xc44f2b){var _0x356e2b={};var _0x163419={};var _0x2d8dfa;var _0x29412f;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x7dc743[_0xceb1('0x51')]['id']}})[_0xceb1('0x1b')](handleEntityNotFound(_0x99f6f3,null))[_0xceb1('0x1b')](function(_0x148848){if(_0x148848){_0x2d8dfa=_0x148848;_0x163419['model']=_[_0xceb1('0x37')](db[_0xceb1('0x54')][_0xceb1('0x55')]);_0x163419[_0xceb1('0x36')]=_['keys'](_0x7dc743['query']);_0x163419[_0xceb1('0x38')]=_[_0xceb1('0x39')](_0x163419['model'],_0x163419[_0xceb1('0x36')]);_0x356e2b[_0xceb1('0x4b')]=_[_0xceb1('0x39')](_0x163419[_0xceb1('0x35')],qs[_0xceb1('0x3a')](_0x7dc743[_0xceb1('0x36')][_0xceb1('0x3a')]));_0x356e2b[_0xceb1('0x4b')]=_0x356e2b[_0xceb1('0x4b')][_0xceb1('0x3b')]?_0x356e2b[_0xceb1('0x4b')]:_0x163419[_0xceb1('0x35')];_0x356e2b[_0xceb1('0x3e')]=qs[_0xceb1('0x3f')](_0x7dc743[_0xceb1('0x36')]['sort']);_0x356e2b[_0xceb1('0x40')]=qs[_0xceb1('0x38')](_[_0xceb1('0x41')](_0x7dc743['query'],_0x163419[_0xceb1('0x38')]));if(_0x7dc743[_0xceb1('0x36')]['filter']){_0x356e2b[_0xceb1('0x40')]=_['merge'](_0x356e2b['where'],{'$or':_[_0xceb1('0x31')](_0x356e2b[_0xceb1('0x4b')],function(_0x250dba){var _0x355f07={};_0x355f07[_0x250dba]={'$like':'%'+_0x7dc743['query']['filter']+'%'};return _0x355f07;})});}_0x356e2b=_[_0xceb1('0x43')]({},_0x356e2b,_0x7dc743[_0xceb1('0x45')]);return _0x2d8dfa[_0xceb1('0x56')](_0x356e2b);}})['then'](function(_0x2012d0){if(_0x2012d0){_0x29412f=_0x2012d0[_0xceb1('0x3b')];if(!_0x7dc743[_0xceb1('0x36')][_0xceb1('0x57')](_0xceb1('0x3c'))){_0x356e2b[_0xceb1('0x3d')]=qs[_0xceb1('0x3d')](_0x7dc743[_0xceb1('0x36')]['limit']);_0x356e2b[_0xceb1('0x29')]=qs['offset'](_0x7dc743[_0xceb1('0x36')][_0xceb1('0x29')]);}return _0x2d8dfa[_0xceb1('0x56')](_0x356e2b);}})[_0xceb1('0x1b')](function(_0x5c51d3){if(_0x5c51d3){return _0x5c51d3?{'count':_0x29412f,'rows':_0x5c51d3}:null;}})[_0xceb1('0x1b')](respondWithResult(_0x99f6f3,null))[_0xceb1('0x25')](handleError(_0x99f6f3,null));};exports[_0xceb1('0x58')]=function(_0x194b69,_0x2a8cb4,_0x42ae38){var _0x1248c5={};var _0x548660={};var _0x105abe;var _0x2519eb;return db['ZendeskConfiguration'][_0xceb1('0x53')]({'where':{'id':_0x194b69[_0xceb1('0x51')]['id']}})[_0xceb1('0x1b')](handleEntityNotFound(_0x2a8cb4,null))[_0xceb1('0x1b')](function(_0x2b6aa4){if(_0x2b6aa4){_0x105abe=_0x2b6aa4;_0x548660[_0xceb1('0x35')]=_['keys'](db[_0xceb1('0x54')][_0xceb1('0x55')]);_0x548660[_0xceb1('0x36')]=_[_0xceb1('0x37')](_0x194b69[_0xceb1('0x36')]);_0x548660[_0xceb1('0x38')]=_[_0xceb1('0x39')](_0x548660[_0xceb1('0x35')],_0x548660[_0xceb1('0x36')]);_0x1248c5[_0xceb1('0x4b')]=_[_0xceb1('0x39')](_0x548660[_0xceb1('0x35')],qs[_0xceb1('0x3a')](_0x194b69[_0xceb1('0x36')]['fields']));_0x1248c5[_0xceb1('0x4b')]=_0x1248c5['attributes'][_0xceb1('0x3b')]?_0x1248c5['attributes']:_0x548660[_0xceb1('0x35')];_0x1248c5['order']=qs[_0xceb1('0x3f')](_0x194b69['query']['sort']);_0x1248c5[_0xceb1('0x40')]=qs[_0xceb1('0x38')](_[_0xceb1('0x41')](_0x194b69[_0xceb1('0x36')],_0x548660[_0xceb1('0x38')]));if(_0x194b69[_0xceb1('0x36')]['filter']){_0x1248c5['where']=_[_0xceb1('0x43')](_0x1248c5[_0xceb1('0x40')],{'$or':_[_0xceb1('0x31')](_0x1248c5[_0xceb1('0x4b')],function(_0x474fbc){var _0x66157f={};_0x66157f[_0x474fbc]={'$like':'%'+_0x194b69[_0xceb1('0x36')][_0xceb1('0x42')]+'%'};return _0x66157f;})});}_0x1248c5=_[_0xceb1('0x43')]({},_0x1248c5,_0x194b69[_0xceb1('0x45')]);return _0x105abe[_0xceb1('0x58')](_0x1248c5);}})[_0xceb1('0x1b')](function(_0x587af9){if(_0x587af9){_0x2519eb=_0x587af9[_0xceb1('0x3b')];if(!_0x194b69[_0xceb1('0x36')][_0xceb1('0x57')]('nolimit')){_0x1248c5[_0xceb1('0x3d')]=qs[_0xceb1('0x3d')](_0x194b69[_0xceb1('0x36')]['limit']);_0x1248c5['offset']=qs['offset'](_0x194b69[_0xceb1('0x36')][_0xceb1('0x29')]);}return _0x105abe[_0xceb1('0x58')](_0x1248c5);}})[_0xceb1('0x1b')](function(_0x3dae3d){if(_0x3dae3d){return _0x3dae3d?{'count':_0x2519eb,'rows':_0x3dae3d}:null;}})[_0xceb1('0x1b')](respondWithResult(_0x2a8cb4,null))[_0xceb1('0x25')](handleError(_0x2a8cb4,null));};exports['getTags']=function(_0x1626ed,_0x95230c,_0x2175b1){var _0x5b6a14={};var _0xedd4bd={};var _0x5854c1;var _0x3aa14a;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x1626ed[_0xceb1('0x51')]['id']}})[_0xceb1('0x1b')](handleEntityNotFound(_0x95230c,null))[_0xceb1('0x1b')](function(_0x23c322){if(_0x23c322){_0x5854c1=_0x23c322;_0xedd4bd[_0xceb1('0x35')]=_[_0xceb1('0x37')](db['Tag'][_0xceb1('0x55')]);_0xedd4bd[_0xceb1('0x36')]=_[_0xceb1('0x37')](_0x1626ed['query']);_0xedd4bd[_0xceb1('0x38')]=_[_0xceb1('0x39')](_0xedd4bd['model'],_0xedd4bd['query']);_0x5b6a14[_0xceb1('0x4b')]=_[_0xceb1('0x39')](_0xedd4bd[_0xceb1('0x35')],qs['fields'](_0x1626ed[_0xceb1('0x36')][_0xceb1('0x3a')]));_0x5b6a14[_0xceb1('0x4b')]=_0x5b6a14['attributes'][_0xceb1('0x3b')]?_0x5b6a14[_0xceb1('0x4b')]:_0xedd4bd[_0xceb1('0x35')];_0x5b6a14[_0xceb1('0x3e')]=qs['sort'](_0x1626ed[_0xceb1('0x36')]['sort']);_0x5b6a14[_0xceb1('0x40')]=qs[_0xceb1('0x38')](_['pick'](_0x1626ed[_0xceb1('0x36')],_0xedd4bd[_0xceb1('0x38')]));if(_0x1626ed['query'][_0xceb1('0x42')]){_0x5b6a14[_0xceb1('0x40')]=_[_0xceb1('0x43')](_0x5b6a14[_0xceb1('0x40')],{'$or':_[_0xceb1('0x31')](_0x5b6a14['attributes'],function(_0x20e94c){var _0x53cd53={};_0x53cd53[_0x20e94c]={'$like':'%'+_0x1626ed['query']['filter']+'%'};return _0x53cd53;})});}_0x5b6a14=_[_0xceb1('0x43')]({},_0x5b6a14,_0x1626ed[_0xceb1('0x45')]);return _0x5854c1[_0xceb1('0x59')](_0x5b6a14);}})[_0xceb1('0x1b')](function(_0x4a781e){if(_0x4a781e){_0x3aa14a=_0x4a781e[_0xceb1('0x3b')];if(!_0x1626ed[_0xceb1('0x36')][_0xceb1('0x57')](_0xceb1('0x3c'))){_0x5b6a14['limit']=qs[_0xceb1('0x3d')](_0x1626ed[_0xceb1('0x36')]['limit']);_0x5b6a14['offset']=qs[_0xceb1('0x29')](_0x1626ed[_0xceb1('0x36')][_0xceb1('0x29')]);}return _0x5854c1[_0xceb1('0x59')](_0x5b6a14);}})[_0xceb1('0x1b')](function(_0x341688){if(_0x341688){return _0x341688?{'count':_0x3aa14a,'rows':_0x341688}:null;}})[_0xceb1('0x1b')](respondWithResult(_0x95230c,null))[_0xceb1('0x25')](handleError(_0x95230c,null));};exports[_0xceb1('0x5a')]=function(_0x5ca8f1,_0x38891e,_0x10f0a3){if(_0x5ca8f1['body']['id']){delete _0x5ca8f1['body']['id'];}return db[_0xceb1('0x32')]['findOne']({'where':{'id':_0x5ca8f1[_0xceb1('0x51')]['id']}})[_0xceb1('0x1b')](handleEntityNotFound(_0x38891e,null))['then'](function(_0x23db26){if(_0x23db26){return _0x23db26['setTags'](_0x5ca8f1[_0xceb1('0x4d')][_0xceb1('0x5b')]||[]);}return null;})[_0xceb1('0x1b')](respondWithResult(_0x38891e,null))[_0xceb1('0x25')](handleError(_0x38891e,null));}; \ No newline at end of file +var _0xe689=['ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','save','destroy','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','show','keys','find','create','body','update','params','getFields','findOne','ZendeskField','order','nolimit','getSubjects','getDescriptions','getTags','setTags'];(function(_0x2ace95,_0x186b37){var _0x35ecfa=function(_0x26ce5a){while(--_0x26ce5a){_0x2ace95['push'](_0x2ace95['shift']());}};_0x35ecfa(++_0x186b37);}(_0xe689,0x1dc));var _0x9e68=function(_0x2c129f,_0xda24b5){_0x2c129f=_0x2c129f-0x0;var _0x1f7219=_0xe689[_0x2c129f];return _0x1f7219;};'use strict';var emlformat=require(_0x9e68('0x0'));var rimraf=require(_0x9e68('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9e68('0x2'));var moment=require(_0x9e68('0x3'));var BPromise=require(_0x9e68('0x4'));var Mustache=require(_0x9e68('0x5'));var util=require('util');var path=require(_0x9e68('0x6'));var sox=require(_0x9e68('0x7'));var csv=require('to-csv');var ejs=require(_0x9e68('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e68('0x9'));var squel=require(_0x9e68('0xa'));var crypto=require(_0x9e68('0xb'));var jsforce=require(_0x9e68('0xc'));var deskjs=require(_0x9e68('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9e68('0xe'));var Papa=require(_0x9e68('0xf'));var Redis=require(_0x9e68('0x10'));var authService=require(_0x9e68('0x11'));var qs=require(_0x9e68('0x12'));var as=require(_0x9e68('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9e68('0x14'));var utils=require(_0x9e68('0x15'));var config=require(_0x9e68('0x16'));var licenseUtil=require(_0x9e68('0x17'));var db=require(_0x9e68('0x18'))['db'];var jayson=require(_0x9e68('0x19'));var client=jayson['client'][_0x9e68('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2b52b9,_0x36bbf7,_0x18022c,_0x46c748){return new BPromise(function(_0x47b0b9,_0x5548b9){var _0x2f5024=_0x46c748||client;return _0x2f5024[_0x9e68('0x1b')](_0x2b52b9,_0x18022c)[_0x9e68('0x1c')](function(_0x36ea0e){logger[_0x9e68('0x1d')](_0x9e68('0x1e'),_0x36bbf7,_0x9e68('0x1f'));logger[_0x9e68('0x20')](_0x9e68('0x21'),_0x36bbf7,_0x9e68('0x1f'),JSON[_0x9e68('0x22')](_0x36ea0e));if(_0x36ea0e['error']){if(_0x36ea0e[_0x9e68('0x23')][_0x9e68('0x24')]===0x1f4){logger[_0x9e68('0x23')](_0x9e68('0x1e'),_0x36bbf7,_0x36ea0e[_0x9e68('0x23')]['message']);return _0x5548b9(_0x36ea0e['error'][_0x9e68('0x25')]);}logger[_0x9e68('0x23')](_0x9e68('0x1e'),_0x36bbf7,_0x36ea0e['error'][_0x9e68('0x25')]);return _0x47b0b9(_0x36ea0e[_0x9e68('0x23')]['message']);}else{logger[_0x9e68('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x36bbf7,_0x9e68('0x1f'));_0x47b0b9(_0x36ea0e[_0x9e68('0x26')][_0x9e68('0x25')]);}})[_0x9e68('0x27')](function(_0x483a98){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x36bbf7,_0x483a98);_0x5548b9(_0x483a98);});});}function respondWithStatusCode(_0x369696,_0x46c605){_0x46c605=_0x46c605||0xcc;return function(_0x4c27b4){if(_0x4c27b4){return _0x369696[_0x9e68('0x28')](_0x46c605);}return _0x369696['status'](_0x46c605)[_0x9e68('0x29')]();};}function respondWithResult(_0x4266a8,_0x389486){_0x389486=_0x389486||0xc8;return function(_0x48781b){if(_0x48781b){return _0x4266a8[_0x9e68('0x2a')](_0x389486)['json'](_0x48781b);}};}function respondWithFilteredResult(_0x2def53,_0x613874){return function(_0x3266cb){if(_0x3266cb){var _0x34bdcb=_0x3266cb['count'],_0x4ae0ec=_0x613874[_0x9e68('0x2b')],_0xa8bf8c=_0x613874[_0x9e68('0x2b')]+_0x613874[_0x9e68('0x2c')],_0x419b05;if(_0xa8bf8c>=_0x34bdcb){_0xa8bf8c=_0x34bdcb;_0x419b05=0xc8;}else{_0x419b05=0xce;}_0x2def53['status'](_0x419b05);return _0x2def53[_0x9e68('0x2d')](_0x9e68('0x2e'),_0x4ae0ec+'-'+_0xa8bf8c+'/'+_0x34bdcb)[_0x9e68('0x2f')](_0x3266cb);}return null;};}function patchUpdates(_0x79a2e9){return function(_0x115618){try{jsonpatch[_0x9e68('0x30')](_0x115618,_0x79a2e9,!![]);}catch(_0xd0fa0){return BPromise['reject'](_0xd0fa0);}return _0x115618[_0x9e68('0x31')]();};}function saveUpdates(_0x4646b2,_0x223e58){return function(_0x51b7d1){if(_0x51b7d1){return _0x51b7d1['update'](_0x4646b2)[_0x9e68('0x1c')](function(_0x234813){return _0x234813;});}return null;};}function removeEntity(_0xbb7510,_0x5cae98){return function(_0x325632){if(_0x325632){return _0x325632[_0x9e68('0x32')]()[_0x9e68('0x1c')](function(){_0xbb7510['status'](0xcc)[_0x9e68('0x29')]();});}};}function handleEntityNotFound(_0x1d4384,_0xcfc306){return function(_0x25d17c){if(!_0x25d17c){_0x1d4384['sendStatus'](0x194);}return _0x25d17c;};}function handleError(_0x274d18,_0x3164b1){_0x3164b1=_0x3164b1||0x1f4;return function(_0x445154){logger['error'](_0x445154['stack']);if(_0x445154['name']){delete _0x445154['name'];}_0x274d18[_0x9e68('0x2a')](_0x3164b1)[_0x9e68('0x33')](_0x445154);};}exports[_0x9e68('0x34')]=function(_0x38048a,_0x49036a){var _0x413fc7={},_0x2aca43={},_0x226f40={'count':0x0,'rows':[]};var _0xe4b94d=_[_0x9e68('0x35')](db[_0x9e68('0x36')][_0x9e68('0x37')],function(_0xbc5949){return{'name':_0xbc5949[_0x9e68('0x38')],'type':_0xbc5949['type']['key']};});_0x2aca43[_0x9e68('0x39')]=_['map'](_0xe4b94d,_0x9e68('0x3a'));_0x2aca43['query']=_['keys'](_0x38048a[_0x9e68('0x3b')]);_0x2aca43[_0x9e68('0x3c')]=_[_0x9e68('0x3d')](_0x2aca43[_0x9e68('0x39')],_0x2aca43[_0x9e68('0x3b')]);_0x413fc7[_0x9e68('0x3e')]=_[_0x9e68('0x3d')](_0x2aca43[_0x9e68('0x39')],qs[_0x9e68('0x3f')](_0x38048a[_0x9e68('0x3b')][_0x9e68('0x3f')]));_0x413fc7[_0x9e68('0x3e')]=_0x413fc7[_0x9e68('0x3e')][_0x9e68('0x40')]?_0x413fc7[_0x9e68('0x3e')]:_0x2aca43['model'];if(!_0x38048a[_0x9e68('0x3b')][_0x9e68('0x41')]('nolimit')){_0x413fc7[_0x9e68('0x2c')]=qs['limit'](_0x38048a[_0x9e68('0x3b')]['limit']);_0x413fc7[_0x9e68('0x2b')]=qs[_0x9e68('0x2b')](_0x38048a['query'][_0x9e68('0x2b')]);}_0x413fc7['order']=qs[_0x9e68('0x42')](_0x38048a[_0x9e68('0x3b')]['sort']);_0x413fc7[_0x9e68('0x43')]=qs[_0x9e68('0x3c')](_[_0x9e68('0x44')](_0x38048a[_0x9e68('0x3b')],_0x2aca43[_0x9e68('0x3c')]),_0xe4b94d);if(_0x38048a[_0x9e68('0x3b')][_0x9e68('0x45')]){_0x413fc7[_0x9e68('0x43')]=_[_0x9e68('0x46')](_0x413fc7[_0x9e68('0x43')],{'$or':_['map'](_0xe4b94d,function(_0x1628fe){if(_0x1628fe[_0x9e68('0x47')]!==_0x9e68('0x48')){var _0x48b874={};_0x48b874[_0x1628fe['name']]={'$like':'%'+_0x38048a[_0x9e68('0x3b')][_0x9e68('0x45')]+'%'};return _0x48b874;}})});}_0x413fc7=_['merge']({},_0x413fc7,_0x38048a[_0x9e68('0x49')]);var _0x346eef={'where':_0x413fc7[_0x9e68('0x43')]};return db[_0x9e68('0x36')][_0x9e68('0x4a')](_0x346eef)[_0x9e68('0x1c')](function(_0x5737cb){_0x226f40[_0x9e68('0x4a')]=_0x5737cb;if(_0x38048a[_0x9e68('0x3b')][_0x9e68('0x4b')]){_0x413fc7['include']=[{'all':!![]}];}return db[_0x9e68('0x36')][_0x9e68('0x4c')](_0x413fc7);})[_0x9e68('0x1c')](function(_0x4a15c4){_0x226f40[_0x9e68('0x4d')]=_0x4a15c4;return _0x226f40;})[_0x9e68('0x1c')](respondWithFilteredResult(_0x49036a,_0x413fc7))[_0x9e68('0x27')](handleError(_0x49036a,null));};exports[_0x9e68('0x4e')]=function(_0x3103e6,_0x240541){var _0x26db33={'raw':![],'where':{'id':_0x3103e6['params']['id']}},_0x12e44f={};_0x12e44f[_0x9e68('0x39')]=_[_0x9e68('0x4f')](db[_0x9e68('0x36')][_0x9e68('0x37')]);_0x12e44f[_0x9e68('0x3b')]=_['keys'](_0x3103e6[_0x9e68('0x3b')]);_0x12e44f['filters']=_['intersection'](_0x12e44f['model'],_0x12e44f[_0x9e68('0x3b')]);_0x26db33[_0x9e68('0x3e')]=_[_0x9e68('0x3d')](_0x12e44f[_0x9e68('0x39')],qs[_0x9e68('0x3f')](_0x3103e6['query']['fields']));_0x26db33['attributes']=_0x26db33['attributes'][_0x9e68('0x40')]?_0x26db33['attributes']:_0x12e44f['model'];if(_0x3103e6[_0x9e68('0x3b')][_0x9e68('0x4b')]){_0x26db33['include']=[{'all':!![]}];}_0x26db33=_[_0x9e68('0x46')]({},_0x26db33,_0x3103e6[_0x9e68('0x49')]);return db[_0x9e68('0x36')][_0x9e68('0x50')](_0x26db33)[_0x9e68('0x1c')](handleEntityNotFound(_0x240541,null))['then'](respondWithResult(_0x240541,null))[_0x9e68('0x27')](handleError(_0x240541,null));};exports[_0x9e68('0x51')]=function(_0x2ddf16,_0x42e95a){return db['ZendeskConfiguration'][_0x9e68('0x51')](_0x2ddf16[_0x9e68('0x52')],{})[_0x9e68('0x1c')](respondWithResult(_0x42e95a,0xc9))[_0x9e68('0x27')](handleError(_0x42e95a,null));};exports[_0x9e68('0x53')]=function(_0x2b8a8a,_0x279efe){if(_0x2b8a8a[_0x9e68('0x52')]['id']){delete _0x2b8a8a[_0x9e68('0x52')]['id'];}return db[_0x9e68('0x36')][_0x9e68('0x50')]({'where':{'id':_0x2b8a8a[_0x9e68('0x54')]['id']}})[_0x9e68('0x1c')](handleEntityNotFound(_0x279efe,null))[_0x9e68('0x1c')](saveUpdates(_0x2b8a8a[_0x9e68('0x52')],null))['then'](respondWithResult(_0x279efe,null))[_0x9e68('0x27')](handleError(_0x279efe,null));};exports['destroy']=function(_0x3f3349,_0x124abd){return db[_0x9e68('0x36')][_0x9e68('0x50')]({'where':{'id':_0x3f3349[_0x9e68('0x54')]['id']}})['then'](handleEntityNotFound(_0x124abd,null))[_0x9e68('0x1c')](removeEntity(_0x124abd,null))[_0x9e68('0x27')](handleError(_0x124abd,null));};exports[_0x9e68('0x55')]=function(_0x551907,_0x2b10f8,_0x3bd728){var _0x1f7cb2={};var _0x4e6832={};var _0x1e3435;var _0x234e46;return db[_0x9e68('0x36')][_0x9e68('0x56')]({'where':{'id':_0x551907[_0x9e68('0x54')]['id']}})['then'](handleEntityNotFound(_0x2b10f8,null))[_0x9e68('0x1c')](function(_0x5189e6){if(_0x5189e6){_0x1e3435=_0x5189e6;_0x4e6832[_0x9e68('0x39')]=_[_0x9e68('0x4f')](db[_0x9e68('0x57')][_0x9e68('0x37')]);_0x4e6832[_0x9e68('0x3b')]=_[_0x9e68('0x4f')](_0x551907[_0x9e68('0x3b')]);_0x4e6832[_0x9e68('0x3c')]=_[_0x9e68('0x3d')](_0x4e6832['model'],_0x4e6832[_0x9e68('0x3b')]);_0x1f7cb2['attributes']=_[_0x9e68('0x3d')](_0x4e6832[_0x9e68('0x39')],qs[_0x9e68('0x3f')](_0x551907[_0x9e68('0x3b')][_0x9e68('0x3f')]));_0x1f7cb2[_0x9e68('0x3e')]=_0x1f7cb2['attributes']['length']?_0x1f7cb2[_0x9e68('0x3e')]:_0x4e6832[_0x9e68('0x39')];_0x1f7cb2[_0x9e68('0x58')]=qs[_0x9e68('0x42')](_0x551907['query'][_0x9e68('0x42')]);_0x1f7cb2[_0x9e68('0x43')]=qs['filters'](_['pick'](_0x551907[_0x9e68('0x3b')],_0x4e6832[_0x9e68('0x3c')]));if(_0x551907[_0x9e68('0x3b')][_0x9e68('0x45')]){_0x1f7cb2['where']=_['merge'](_0x1f7cb2[_0x9e68('0x43')],{'$or':_[_0x9e68('0x35')](_0x1f7cb2['attributes'],function(_0x59bdb1){var _0x402d37={};_0x402d37[_0x59bdb1]={'$like':'%'+_0x551907[_0x9e68('0x3b')]['filter']+'%'};return _0x402d37;})});}_0x1f7cb2=_[_0x9e68('0x46')]({},_0x1f7cb2,_0x551907['options']);return _0x1e3435[_0x9e68('0x55')](_0x1f7cb2);}})[_0x9e68('0x1c')](function(_0x17f2cd){if(_0x17f2cd){_0x234e46=_0x17f2cd[_0x9e68('0x40')];if(!_0x551907['query'][_0x9e68('0x41')](_0x9e68('0x59'))){_0x1f7cb2[_0x9e68('0x2c')]=qs[_0x9e68('0x2c')](_0x551907['query'][_0x9e68('0x2c')]);_0x1f7cb2['offset']=qs[_0x9e68('0x2b')](_0x551907[_0x9e68('0x3b')][_0x9e68('0x2b')]);}return _0x1e3435['getFields'](_0x1f7cb2);}})[_0x9e68('0x1c')](function(_0x38f743){if(_0x38f743){return _0x38f743?{'count':_0x234e46,'rows':_0x38f743}:null;}})[_0x9e68('0x1c')](respondWithResult(_0x2b10f8,null))['catch'](handleError(_0x2b10f8,null));};exports[_0x9e68('0x5a')]=function(_0x541a17,_0x27afa4,_0xa7321f){var _0x4efa74={};var _0x1d858b={};var _0x130d56;var _0x370e4c;return db[_0x9e68('0x36')][_0x9e68('0x56')]({'where':{'id':_0x541a17[_0x9e68('0x54')]['id']}})[_0x9e68('0x1c')](handleEntityNotFound(_0x27afa4,null))['then'](function(_0x16500d){if(_0x16500d){_0x130d56=_0x16500d;_0x1d858b[_0x9e68('0x39')]=_[_0x9e68('0x4f')](db['ZendeskField'][_0x9e68('0x37')]);_0x1d858b[_0x9e68('0x3b')]=_['keys'](_0x541a17[_0x9e68('0x3b')]);_0x1d858b[_0x9e68('0x3c')]=_['intersection'](_0x1d858b[_0x9e68('0x39')],_0x1d858b[_0x9e68('0x3b')]);_0x4efa74[_0x9e68('0x3e')]=_[_0x9e68('0x3d')](_0x1d858b[_0x9e68('0x39')],qs[_0x9e68('0x3f')](_0x541a17[_0x9e68('0x3b')][_0x9e68('0x3f')]));_0x4efa74[_0x9e68('0x3e')]=_0x4efa74[_0x9e68('0x3e')][_0x9e68('0x40')]?_0x4efa74['attributes']:_0x1d858b[_0x9e68('0x39')];_0x4efa74['order']=qs[_0x9e68('0x42')](_0x541a17[_0x9e68('0x3b')][_0x9e68('0x42')]);_0x4efa74[_0x9e68('0x43')]=qs['filters'](_[_0x9e68('0x44')](_0x541a17[_0x9e68('0x3b')],_0x1d858b[_0x9e68('0x3c')]));if(_0x541a17[_0x9e68('0x3b')][_0x9e68('0x45')]){_0x4efa74[_0x9e68('0x43')]=_[_0x9e68('0x46')](_0x4efa74[_0x9e68('0x43')],{'$or':_['map'](_0x4efa74[_0x9e68('0x3e')],function(_0x5bf143){var _0x5bad04={};_0x5bad04[_0x5bf143]={'$like':'%'+_0x541a17[_0x9e68('0x3b')]['filter']+'%'};return _0x5bad04;})});}_0x4efa74=_[_0x9e68('0x46')]({},_0x4efa74,_0x541a17[_0x9e68('0x49')]);return _0x130d56['getSubjects'](_0x4efa74);}})[_0x9e68('0x1c')](function(_0x2cb319){if(_0x2cb319){_0x370e4c=_0x2cb319[_0x9e68('0x40')];if(!_0x541a17[_0x9e68('0x3b')][_0x9e68('0x41')]('nolimit')){_0x4efa74['limit']=qs['limit'](_0x541a17[_0x9e68('0x3b')][_0x9e68('0x2c')]);_0x4efa74[_0x9e68('0x2b')]=qs['offset'](_0x541a17[_0x9e68('0x3b')][_0x9e68('0x2b')]);}return _0x130d56[_0x9e68('0x5a')](_0x4efa74);}})[_0x9e68('0x1c')](function(_0x14af0a){if(_0x14af0a){return _0x14af0a?{'count':_0x370e4c,'rows':_0x14af0a}:null;}})['then'](respondWithResult(_0x27afa4,null))[_0x9e68('0x27')](handleError(_0x27afa4,null));};exports[_0x9e68('0x5b')]=function(_0x27e3fa,_0x263a5d,_0x1abda2){var _0x1201df={};var _0x4dca52={};var _0x268cb9;var _0x2d7d8a;return db[_0x9e68('0x36')][_0x9e68('0x56')]({'where':{'id':_0x27e3fa['params']['id']}})[_0x9e68('0x1c')](handleEntityNotFound(_0x263a5d,null))[_0x9e68('0x1c')](function(_0xfdbc7d){if(_0xfdbc7d){_0x268cb9=_0xfdbc7d;_0x4dca52[_0x9e68('0x39')]=_[_0x9e68('0x4f')](db['ZendeskField']['rawAttributes']);_0x4dca52['query']=_[_0x9e68('0x4f')](_0x27e3fa[_0x9e68('0x3b')]);_0x4dca52[_0x9e68('0x3c')]=_[_0x9e68('0x3d')](_0x4dca52[_0x9e68('0x39')],_0x4dca52['query']);_0x1201df['attributes']=_[_0x9e68('0x3d')](_0x4dca52[_0x9e68('0x39')],qs[_0x9e68('0x3f')](_0x27e3fa[_0x9e68('0x3b')][_0x9e68('0x3f')]));_0x1201df['attributes']=_0x1201df['attributes'][_0x9e68('0x40')]?_0x1201df[_0x9e68('0x3e')]:_0x4dca52[_0x9e68('0x39')];_0x1201df[_0x9e68('0x58')]=qs[_0x9e68('0x42')](_0x27e3fa[_0x9e68('0x3b')][_0x9e68('0x42')]);_0x1201df['where']=qs[_0x9e68('0x3c')](_[_0x9e68('0x44')](_0x27e3fa[_0x9e68('0x3b')],_0x4dca52['filters']));if(_0x27e3fa[_0x9e68('0x3b')][_0x9e68('0x45')]){_0x1201df[_0x9e68('0x43')]=_['merge'](_0x1201df[_0x9e68('0x43')],{'$or':_[_0x9e68('0x35')](_0x1201df['attributes'],function(_0x4918c0){var _0x1ddcc2={};_0x1ddcc2[_0x4918c0]={'$like':'%'+_0x27e3fa[_0x9e68('0x3b')][_0x9e68('0x45')]+'%'};return _0x1ddcc2;})});}_0x1201df=_[_0x9e68('0x46')]({},_0x1201df,_0x27e3fa[_0x9e68('0x49')]);return _0x268cb9[_0x9e68('0x5b')](_0x1201df);}})['then'](function(_0x5a5f71){if(_0x5a5f71){_0x2d7d8a=_0x5a5f71[_0x9e68('0x40')];if(!_0x27e3fa[_0x9e68('0x3b')]['hasOwnProperty']('nolimit')){_0x1201df[_0x9e68('0x2c')]=qs[_0x9e68('0x2c')](_0x27e3fa[_0x9e68('0x3b')]['limit']);_0x1201df['offset']=qs[_0x9e68('0x2b')](_0x27e3fa['query']['offset']);}return _0x268cb9[_0x9e68('0x5b')](_0x1201df);}})[_0x9e68('0x1c')](function(_0x14e0e6){if(_0x14e0e6){return _0x14e0e6?{'count':_0x2d7d8a,'rows':_0x14e0e6}:null;}})[_0x9e68('0x1c')](respondWithResult(_0x263a5d,null))[_0x9e68('0x27')](handleError(_0x263a5d,null));};exports[_0x9e68('0x5c')]=function(_0x4a9243,_0x37e57a,_0xcd8a7e){var _0x17201a={};var _0xdb9762={};var _0x14d6d2;var _0x7c7523;return db[_0x9e68('0x36')][_0x9e68('0x56')]({'where':{'id':_0x4a9243[_0x9e68('0x54')]['id']}})[_0x9e68('0x1c')](handleEntityNotFound(_0x37e57a,null))[_0x9e68('0x1c')](function(_0xafd241){if(_0xafd241){_0x14d6d2=_0xafd241;_0xdb9762[_0x9e68('0x39')]=_['keys'](db['Tag'][_0x9e68('0x37')]);_0xdb9762['query']=_[_0x9e68('0x4f')](_0x4a9243[_0x9e68('0x3b')]);_0xdb9762[_0x9e68('0x3c')]=_[_0x9e68('0x3d')](_0xdb9762[_0x9e68('0x39')],_0xdb9762['query']);_0x17201a['attributes']=_[_0x9e68('0x3d')](_0xdb9762[_0x9e68('0x39')],qs[_0x9e68('0x3f')](_0x4a9243['query'][_0x9e68('0x3f')]));_0x17201a['attributes']=_0x17201a[_0x9e68('0x3e')][_0x9e68('0x40')]?_0x17201a['attributes']:_0xdb9762[_0x9e68('0x39')];_0x17201a[_0x9e68('0x58')]=qs[_0x9e68('0x42')](_0x4a9243['query'][_0x9e68('0x42')]);_0x17201a[_0x9e68('0x43')]=qs[_0x9e68('0x3c')](_[_0x9e68('0x44')](_0x4a9243[_0x9e68('0x3b')],_0xdb9762[_0x9e68('0x3c')]));if(_0x4a9243[_0x9e68('0x3b')][_0x9e68('0x45')]){_0x17201a['where']=_['merge'](_0x17201a[_0x9e68('0x43')],{'$or':_['map'](_0x17201a[_0x9e68('0x3e')],function(_0x3fd51a){var _0x11dbe4={};_0x11dbe4[_0x3fd51a]={'$like':'%'+_0x4a9243[_0x9e68('0x3b')]['filter']+'%'};return _0x11dbe4;})});}_0x17201a=_[_0x9e68('0x46')]({},_0x17201a,_0x4a9243['options']);return _0x14d6d2[_0x9e68('0x5c')](_0x17201a);}})[_0x9e68('0x1c')](function(_0x12be68){if(_0x12be68){_0x7c7523=_0x12be68['length'];if(!_0x4a9243[_0x9e68('0x3b')][_0x9e68('0x41')](_0x9e68('0x59'))){_0x17201a[_0x9e68('0x2c')]=qs[_0x9e68('0x2c')](_0x4a9243[_0x9e68('0x3b')][_0x9e68('0x2c')]);_0x17201a[_0x9e68('0x2b')]=qs[_0x9e68('0x2b')](_0x4a9243[_0x9e68('0x3b')]['offset']);}return _0x14d6d2[_0x9e68('0x5c')](_0x17201a);}})[_0x9e68('0x1c')](function(_0xb3d0c5){if(_0xb3d0c5){return _0xb3d0c5?{'count':_0x7c7523,'rows':_0xb3d0c5}:null;}})[_0x9e68('0x1c')](respondWithResult(_0x37e57a,null))[_0x9e68('0x27')](handleError(_0x37e57a,null));};exports[_0x9e68('0x5d')]=function(_0x5f0a23,_0x494443,_0x1156cc){if(_0x5f0a23[_0x9e68('0x52')]['id']){delete _0x5f0a23[_0x9e68('0x52')]['id'];}return db[_0x9e68('0x36')][_0x9e68('0x56')]({'where':{'id':_0x5f0a23[_0x9e68('0x54')]['id']}})[_0x9e68('0x1c')](handleEntityNotFound(_0x494443,null))[_0x9e68('0x1c')](function(_0xa70d82){if(_0xa70d82){return _0xa70d82[_0x9e68('0x5d')](_0x5f0a23[_0x9e68('0x52')][_0x9e68('0x5e')]||[]);}return null;})[_0x9e68('0x1c')](respondWithResult(_0x494443,null))[_0x9e68('0x27')](handleError(_0x494443,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index ac561c4..186ecd0 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 _0xaa51=['request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0xaa51,0x1e5));var _0x1aa5=function(_0x408c29,_0x4f7939){_0x408c29=_0x408c29-0x0;var _0x51e3da=_0xaa51[_0x408c29];return _0x51e3da;};'use strict';var _=require('lodash');var util=require(_0x1aa5('0x0'));var logger=require(_0x1aa5('0x1'))(_0x1aa5('0x2'));var moment=require(_0x1aa5('0x3'));var BPromise=require(_0x1aa5('0x4'));var rp=require(_0x1aa5('0x5'));var fs=require('fs');var path=require(_0x1aa5('0x6'));var rimraf=require(_0x1aa5('0x7'));var config=require(_0x1aa5('0x8'));var attributes=require(_0x1aa5('0x9'));module[_0x1aa5('0xa')]=function(_0x268f3d,_0x2a5188){return _0x268f3d[_0x1aa5('0xb')](_0x1aa5('0xc'),attributes,{'tableName':_0x1aa5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7690=['request-promise','path','rimraf','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','moment','bluebird'];(function(_0x3253ed,_0x1adb4e){var _0x2081ad=function(_0x4cd21a){while(--_0x4cd21a){_0x3253ed['push'](_0x3253ed['shift']());}};_0x2081ad(++_0x1adb4e);}(_0x7690,0x1f3));var _0x0769=function(_0x5e5d4e,_0x5f409a){_0x5e5d4e=_0x5e5d4e-0x0;var _0x3a70f9=_0x7690[_0x5e5d4e];return _0x3a70f9;};'use strict';var _=require(_0x0769('0x0'));var util=require(_0x0769('0x1'));var logger=require('../../config/logger')(_0x0769('0x2'));var moment=require(_0x0769('0x3'));var BPromise=require(_0x0769('0x4'));var rp=require(_0x0769('0x5'));var fs=require('fs');var path=require(_0x0769('0x6'));var rimraf=require(_0x0769('0x7'));var config=require('../../config/environment');var attributes=require(_0x0769('0x8'));module[_0x0769('0x9')]=function(_0x4d1b41,_0x5b64e8){return _0x4d1b41['define'](_0x0769('0xa'),attributes,{'tableName':_0x0769('0xb'),'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 f9e57bf..8bc13b4 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 _0x8463=['info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\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','request','then'];(function(_0x3bfded,_0x22db94){var _0x26e313=function(_0x1e4d76){while(--_0x1e4d76){_0x3bfded['push'](_0x3bfded['shift']());}};_0x26e313(++_0x22db94);}(_0x8463,0x135));var _0x3846=function(_0x25403c,_0x1e2bae){_0x25403c=_0x25403c-0x0;var _0x45786a=_0x8463[_0x25403c];return _0x45786a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3846('0x0'));var BPromise=require(_0x3846('0x1'));var rs=require(_0x3846('0x2'));var fs=require('fs');var Redis=require(_0x3846('0x3'));var db=require(_0x3846('0x4'))['db'];var utils=require(_0x3846('0x5'));var logger=require(_0x3846('0x6'))(_0x3846('0x7'));var config=require(_0x3846('0x8'));var jayson=require(_0x3846('0x9'));var client=jayson[_0x3846('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x293c48,_0x2fa551,_0x32bb11){return new BPromise(function(_0x4aeca4,_0x258fe2){return client[_0x3846('0xb')](_0x293c48,_0x32bb11)[_0x3846('0xc')](function(_0x13db70){logger[_0x3846('0xd')](_0x3846('0xe'),_0x2fa551,_0x3846('0xf'));logger['debug'](_0x3846('0x10'),_0x2fa551,_0x3846('0xf'),JSON[_0x3846('0x11')](_0x13db70));if(_0x13db70[_0x3846('0x12')]){if(_0x13db70['error'][_0x3846('0x13')]===0x1f4){logger[_0x3846('0x12')](_0x3846('0xe'),_0x2fa551,_0x13db70[_0x3846('0x12')]['message']);return _0x258fe2(_0x13db70[_0x3846('0x12')][_0x3846('0x14')]);}logger[_0x3846('0x12')](_0x3846('0xe'),_0x2fa551,_0x13db70[_0x3846('0x12')][_0x3846('0x14')]);return _0x4aeca4(_0x13db70['error'][_0x3846('0x14')]);}else{logger[_0x3846('0xd')](_0x3846('0xe'),_0x2fa551,_0x3846('0xf'));_0x4aeca4(_0x13db70[_0x3846('0x15')]['message']);}})[_0x3846('0x16')](function(_0x24e809){logger[_0x3846('0x12')](_0x3846('0xe'),_0x2fa551,_0x24e809);_0x258fe2(_0x24e809);});});} \ No newline at end of file +var _0x311f=['../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x892454,_0x57c029){var _0x4598c7=function(_0x130c03){while(--_0x130c03){_0x892454['push'](_0x892454['shift']());}};_0x4598c7(++_0x57c029);}(_0x311f,0x188));var _0xf311=function(_0x2b46ae,_0xae0e7c){_0x2b46ae=_0x2b46ae-0x0;var _0x237cef=_0x311f[_0x2b46ae];return _0x237cef;};'use strict';var _=require(_0xf311('0x0'));var util=require('util');var moment=require(_0xf311('0x1'));var BPromise=require(_0xf311('0x2'));var rs=require(_0xf311('0x3'));var fs=require('fs');var Redis=require(_0xf311('0x4'));var db=require(_0xf311('0x5'))['db'];var utils=require(_0xf311('0x6'));var logger=require(_0xf311('0x7'))(_0xf311('0x8'));var config=require('../../config/environment');var jayson=require(_0xf311('0x9'));var client=jayson['client'][_0xf311('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39d3df,_0x35a2d4,_0x3c260a){return new BPromise(function(_0x2a748e,_0x1b1bf5){return client[_0xf311('0xb')](_0x39d3df,_0x3c260a)['then'](function(_0x1ddd4a){logger[_0xf311('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x35a2d4,_0xf311('0xd'));logger[_0xf311('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x35a2d4,_0xf311('0xd'),JSON[_0xf311('0xf')](_0x1ddd4a));if(_0x1ddd4a[_0xf311('0x10')]){if(_0x1ddd4a[_0xf311('0x10')]['code']===0x1f4){logger[_0xf311('0x10')](_0xf311('0x11'),_0x35a2d4,_0x1ddd4a[_0xf311('0x10')][_0xf311('0x12')]);return _0x1b1bf5(_0x1ddd4a[_0xf311('0x10')][_0xf311('0x12')]);}logger[_0xf311('0x10')](_0xf311('0x11'),_0x35a2d4,_0x1ddd4a[_0xf311('0x10')]['message']);return _0x2a748e(_0x1ddd4a[_0xf311('0x10')]['message']);}else{logger[_0xf311('0xc')](_0xf311('0x11'),_0x35a2d4,_0xf311('0xd'));_0x2a748e(_0x1ddd4a['result']['message']);}})['catch'](function(_0x2a7f34){logger[_0xf311('0x10')](_0xf311('0x11'),_0x35a2d4,_0x2a7f34);_0x1b1bf5(_0x2a7f34);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index e4b70b3..56c15b5 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 _0x286e=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x286e,0x1cd));var _0xe286=function(_0x3adae5,_0x1fa321){_0x3adae5=_0x3adae5-0x0;var _0x11ca6d=_0x286e[_0x3adae5];return _0x11ca6d;};'use strict';var multer=require(_0xe286('0x0'));var util=require(_0xe286('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe286('0x2'));var router=express[_0xe286('0x3')]();var fs_extra=require(_0xe286('0x4'));var auth=require(_0xe286('0x5'));var interaction=require(_0xe286('0x6'));var config=require(_0xe286('0x7'));var controller=require('./intZendeskField.controller');router[_0xe286('0x8')]('/',auth[_0xe286('0x9')](),controller['index']);router['get'](_0xe286('0xa'),auth[_0xe286('0x9')](),controller[_0xe286('0xb')]);router[_0xe286('0xc')]('/',auth[_0xe286('0x9')](),controller[_0xe286('0xd')]);router[_0xe286('0xe')](_0xe286('0xa'),auth[_0xe286('0x9')](),controller[_0xe286('0xf')]);router[_0xe286('0x10')](_0xe286('0xa'),auth['isAuthenticated'](),controller[_0xe286('0x11')]);module['exports']=router; \ No newline at end of file +var _0x08d6=['destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x08d6,0x101));var _0x608d=function(_0x23b9e4,_0x3e4fb6){_0x23b9e4=_0x23b9e4-0x0;var _0x3e17b0=_0x08d6[_0x23b9e4];return _0x3e17b0;};'use strict';var multer=require(_0x608d('0x0'));var util=require(_0x608d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x608d('0x2'));var router=express[_0x608d('0x3')]();var fs_extra=require(_0x608d('0x4'));var auth=require(_0x608d('0x5'));var interaction=require(_0x608d('0x6'));var config=require(_0x608d('0x7'));var controller=require('./intZendeskField.controller');router['get']('/',auth[_0x608d('0x8')](),controller[_0x608d('0x9')]);router['get'](_0x608d('0xa'),auth[_0x608d('0x8')](),controller[_0x608d('0xb')]);router[_0x608d('0xc')]('/',auth[_0x608d('0x8')](),controller[_0x608d('0xd')]);router[_0x608d('0xe')](_0x608d('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x608d('0xa'),auth[_0x608d('0x8')](),controller[_0x608d('0xf')]);module[_0x608d('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 24a2d49..cd1dc9c 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 _0xb469=['customVariable','keyValue','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x233cb1,_0x8ca9a2){var _0x29ee7e=function(_0x20e277){while(--_0x20e277){_0x233cb1['push'](_0x233cb1['shift']());}};_0x29ee7e(++_0x8ca9a2);}(_0xb469,0x13b));var _0x9b46=function(_0x46170a,_0x4ec4be){_0x46170a=_0x46170a-0x0;var _0x25e0cf=_0xb469[_0x46170a];return _0x25e0cf;};'use strict';var Sequelize=require(_0x9b46('0x0'));module[_0x9b46('0x1')]={'type':{'type':Sequelize[_0x9b46('0x2')](_0x9b46('0x3'),_0x9b46('0x4'),_0x9b46('0x5'),_0x9b46('0x6'),'picklist'),'defaultValue':_0x9b46('0x3')},'content':{'type':Sequelize[_0x9b46('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9b46('0x2')](_0x9b46('0x3'),'variable',_0x9b46('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9b46('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9b46('0x7')]}}; \ No newline at end of file +var _0xc6d8=['ENUM','variable','keyValue','STRING','string','customVariable','BOOLEAN','sequelize'];(function(_0x4a8ac4,_0x5857a3){var _0x5137df=function(_0x103118){while(--_0x103118){_0x4a8ac4['push'](_0x4a8ac4['shift']());}};_0x5137df(++_0x5857a3);}(_0xc6d8,0xd7));var _0x8c6d=function(_0xb89eab,_0x905eba){_0xb89eab=_0xb89eab-0x0;var _0x1706ba=_0xc6d8[_0xb89eab];return _0x1706ba;};'use strict';var Sequelize=require(_0x8c6d('0x0'));module['exports']={'type':{'type':Sequelize[_0x8c6d('0x1')]('string',_0x8c6d('0x2'),'customVariable',_0x8c6d('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x8c6d('0x4')]},'key':{'type':Sequelize[_0x8c6d('0x4')]},'keyType':{'type':Sequelize[_0x8c6d('0x1')](_0x8c6d('0x5'),_0x8c6d('0x2'),_0x8c6d('0x6'))},'keyContent':{'type':Sequelize[_0x8c6d('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8c6d('0x4')]},'customField':{'type':Sequelize[_0x8c6d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8c6d('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 2f32724..924ba33 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 _0xfc73=['fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','count','include','findAll','rows','show','params','rawAttributes','length','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','ZendeskField','fieldName','model','query','keys','filters','intersection','attributes'];(function(_0x1fbd7f,_0xb760d3){var _0x3ed290=function(_0x431303){while(--_0x431303){_0x1fbd7f['push'](_0x1fbd7f['shift']());}};_0x3ed290(++_0xb760d3);}(_0xfc73,0x153));var _0x3fc7=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xfc73[_0x411017];return _0x2adeea;};'use strict';var emlformat=require(_0x3fc7('0x0'));var rimraf=require(_0x3fc7('0x1'));var zipdir=require(_0x3fc7('0x2'));var jsonpatch=require(_0x3fc7('0x3'));var rp=require(_0x3fc7('0x4'));var moment=require(_0x3fc7('0x5'));var BPromise=require(_0x3fc7('0x6'));var Mustache=require(_0x3fc7('0x7'));var util=require(_0x3fc7('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fc7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3fc7('0xa'));var jsforce=require(_0x3fc7('0xb'));var deskjs=require(_0x3fc7('0xc'));var toCsv=require(_0x3fc7('0xd'));var querystring=require(_0x3fc7('0xe'));var Papa=require(_0x3fc7('0xf'));var Redis=require(_0x3fc7('0x10'));var authService=require(_0x3fc7('0x11'));var qs=require(_0x3fc7('0x12'));var as=require(_0x3fc7('0x13'));var hardwareService=require(_0x3fc7('0x14'));var logger=require(_0x3fc7('0x15'))(_0x3fc7('0x16'));var utils=require(_0x3fc7('0x17'));var config=require(_0x3fc7('0x18'));var licenseUtil=require(_0x3fc7('0x19'));var db=require(_0x3fc7('0x1a'))['db'];function respondWithStatusCode(_0xaa1e5e,_0x50e6cb){_0x50e6cb=_0x50e6cb||0xcc;return function(_0x11b300){if(_0x11b300){return _0xaa1e5e[_0x3fc7('0x1b')](_0x50e6cb);}return _0xaa1e5e[_0x3fc7('0x1c')](_0x50e6cb)[_0x3fc7('0x1d')]();};}function respondWithResult(_0x2bdc84,_0x548649){_0x548649=_0x548649||0xc8;return function(_0x592433){if(_0x592433){return _0x2bdc84['status'](_0x548649)['json'](_0x592433);}};}function respondWithFilteredResult(_0x285302,_0x16d139){return function(_0x5c5d23){if(_0x5c5d23){var _0x35c273=_0x5c5d23['count'],_0xef2df2=_0x16d139[_0x3fc7('0x1e')],_0x2798d1=_0x16d139[_0x3fc7('0x1e')]+_0x16d139['limit'],_0x4c3c6d;if(_0x2798d1>=_0x35c273){_0x2798d1=_0x35c273;_0x4c3c6d=0xc8;}else{_0x4c3c6d=0xce;}_0x285302[_0x3fc7('0x1c')](_0x4c3c6d);return _0x285302[_0x3fc7('0x1f')](_0x3fc7('0x20'),_0xef2df2+'-'+_0x2798d1+'/'+_0x35c273)[_0x3fc7('0x21')](_0x5c5d23);}return null;};}function patchUpdates(_0x33f10f){return function(_0xeaff){try{jsonpatch[_0x3fc7('0x22')](_0xeaff,_0x33f10f,!![]);}catch(_0x1ab33d){return BPromise[_0x3fc7('0x23')](_0x1ab33d);}return _0xeaff[_0x3fc7('0x24')]();};}function saveUpdates(_0x328ee1,_0x55da0b){return function(_0x190907){if(_0x190907){return _0x190907[_0x3fc7('0x25')](_0x328ee1)[_0x3fc7('0x26')](function(_0x4a7b47){return _0x4a7b47;});}return null;};}function removeEntity(_0x18f7f0,_0x3769bc){return function(_0x51e097){if(_0x51e097){return _0x51e097[_0x3fc7('0x27')]()[_0x3fc7('0x26')](function(){_0x18f7f0[_0x3fc7('0x1c')](0xcc)[_0x3fc7('0x1d')]();});}};}function handleEntityNotFound(_0x1d31ec,_0x208b78){return function(_0x118dc1){if(!_0x118dc1){_0x1d31ec[_0x3fc7('0x1b')](0x194);}return _0x118dc1;};}function handleError(_0x31cc0b,_0x1e9930){_0x1e9930=_0x1e9930||0x1f4;return function(_0x2de965){logger['error'](_0x2de965['stack']);if(_0x2de965['name']){delete _0x2de965[_0x3fc7('0x28')];}_0x31cc0b[_0x3fc7('0x1c')](_0x1e9930)[_0x3fc7('0x29')](_0x2de965);};}exports[_0x3fc7('0x2a')]=function(_0x231450,_0x292f4d){var _0x18abd4={},_0x3e2497={},_0x4f34fe={'count':0x0,'rows':[]};var _0x388be5=_['map'](db[_0x3fc7('0x2b')]['rawAttributes'],function(_0x1f7302){return{'name':_0x1f7302[_0x3fc7('0x2c')],'type':_0x1f7302['type']['key']};});_0x3e2497[_0x3fc7('0x2d')]=_['map'](_0x388be5,_0x3fc7('0x28'));_0x3e2497[_0x3fc7('0x2e')]=_[_0x3fc7('0x2f')](_0x231450['query']);_0x3e2497[_0x3fc7('0x30')]=_[_0x3fc7('0x31')](_0x3e2497['model'],_0x3e2497[_0x3fc7('0x2e')]);_0x18abd4[_0x3fc7('0x32')]=_[_0x3fc7('0x31')](_0x3e2497[_0x3fc7('0x2d')],qs[_0x3fc7('0x33')](_0x231450['query'][_0x3fc7('0x33')]));_0x18abd4[_0x3fc7('0x32')]=_0x18abd4['attributes']['length']?_0x18abd4[_0x3fc7('0x32')]:_0x3e2497[_0x3fc7('0x2d')];if(!_0x231450[_0x3fc7('0x2e')][_0x3fc7('0x34')](_0x3fc7('0x35'))){_0x18abd4['limit']=qs[_0x3fc7('0x36')](_0x231450['query'][_0x3fc7('0x36')]);_0x18abd4[_0x3fc7('0x1e')]=qs[_0x3fc7('0x1e')](_0x231450['query'][_0x3fc7('0x1e')]);}_0x18abd4[_0x3fc7('0x37')]=qs['sort'](_0x231450[_0x3fc7('0x2e')][_0x3fc7('0x38')]);_0x18abd4[_0x3fc7('0x39')]=qs[_0x3fc7('0x30')](_[_0x3fc7('0x3a')](_0x231450[_0x3fc7('0x2e')],_0x3e2497['filters']),_0x388be5);if(_0x231450[_0x3fc7('0x2e')][_0x3fc7('0x3b')]){_0x18abd4[_0x3fc7('0x39')]=_['merge'](_0x18abd4['where'],{'$or':_[_0x3fc7('0x3c')](_0x388be5,function(_0x49157c){if(_0x49157c[_0x3fc7('0x3d')]!==_0x3fc7('0x3e')){var _0x2f62f6={};_0x2f62f6[_0x49157c[_0x3fc7('0x28')]]={'$like':'%'+_0x231450[_0x3fc7('0x2e')][_0x3fc7('0x3b')]+'%'};return _0x2f62f6;}})});}_0x18abd4=_[_0x3fc7('0x3f')]({},_0x18abd4,_0x231450[_0x3fc7('0x40')]);var _0x4688a6={'where':_0x18abd4[_0x3fc7('0x39')]};return db['ZendeskField'][_0x3fc7('0x41')](_0x4688a6)['then'](function(_0x43b165){_0x4f34fe[_0x3fc7('0x41')]=_0x43b165;if(_0x231450[_0x3fc7('0x2e')]['includeAll']){_0x18abd4[_0x3fc7('0x42')]=[{'all':!![]}];}return db[_0x3fc7('0x2b')][_0x3fc7('0x43')](_0x18abd4);})[_0x3fc7('0x26')](function(_0x3fee5d){_0x4f34fe[_0x3fc7('0x44')]=_0x3fee5d;return _0x4f34fe;})[_0x3fc7('0x26')](respondWithFilteredResult(_0x292f4d,_0x18abd4))['catch'](handleError(_0x292f4d,null));};exports[_0x3fc7('0x45')]=function(_0x14d4e7,_0x3ff3d5){var _0x250174={'raw':!![],'where':{'id':_0x14d4e7[_0x3fc7('0x46')]['id']}},_0x333300={};_0x333300['model']=_[_0x3fc7('0x2f')](db[_0x3fc7('0x2b')][_0x3fc7('0x47')]);_0x333300['query']=_[_0x3fc7('0x2f')](_0x14d4e7[_0x3fc7('0x2e')]);_0x333300[_0x3fc7('0x30')]=_[_0x3fc7('0x31')](_0x333300[_0x3fc7('0x2d')],_0x333300[_0x3fc7('0x2e')]);_0x250174[_0x3fc7('0x32')]=_[_0x3fc7('0x31')](_0x333300[_0x3fc7('0x2d')],qs[_0x3fc7('0x33')](_0x14d4e7[_0x3fc7('0x2e')][_0x3fc7('0x33')]));_0x250174[_0x3fc7('0x32')]=_0x250174[_0x3fc7('0x32')][_0x3fc7('0x48')]?_0x250174['attributes']:_0x333300[_0x3fc7('0x2d')];if(_0x14d4e7[_0x3fc7('0x2e')][_0x3fc7('0x49')]){_0x250174[_0x3fc7('0x42')]=[{'all':!![]}];}_0x250174=_[_0x3fc7('0x3f')]({},_0x250174,_0x14d4e7[_0x3fc7('0x40')]);return db[_0x3fc7('0x2b')][_0x3fc7('0x4a')](_0x250174)[_0x3fc7('0x26')](handleEntityNotFound(_0x3ff3d5,null))[_0x3fc7('0x26')](respondWithResult(_0x3ff3d5,null))[_0x3fc7('0x4b')](handleError(_0x3ff3d5,null));};exports['create']=function(_0x496fbb,_0x178401){return db[_0x3fc7('0x2b')][_0x3fc7('0x4c')](_0x496fbb[_0x3fc7('0x4d')],{})[_0x3fc7('0x26')](respondWithResult(_0x178401,0xc9))[_0x3fc7('0x4b')](handleError(_0x178401,null));};exports['update']=function(_0x2b3c5c,_0x574f58){if(_0x2b3c5c[_0x3fc7('0x4d')]['id']){delete _0x2b3c5c[_0x3fc7('0x4d')]['id'];}return db[_0x3fc7('0x2b')][_0x3fc7('0x4a')]({'where':{'id':_0x2b3c5c[_0x3fc7('0x46')]['id']}})['then'](handleEntityNotFound(_0x574f58,null))[_0x3fc7('0x26')](saveUpdates(_0x2b3c5c['body'],null))[_0x3fc7('0x26')](respondWithResult(_0x574f58,null))['catch'](handleError(_0x574f58,null));};exports['destroy']=function(_0x4d4017,_0x2efa91){return db[_0x3fc7('0x2b')][_0x3fc7('0x4a')]({'where':{'id':_0x4d4017[_0x3fc7('0x46')]['id']}})[_0x3fc7('0x26')](handleEntityNotFound(_0x2efa91,null))[_0x3fc7('0x26')](removeEntity(_0x2efa91,null))[_0x3fc7('0x4b')](handleError(_0x2efa91,null));}; \ No newline at end of file +var _0x5a5f=['status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','ZendeskField','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x10fc6b,_0x31c06a){var _0x338746=function(_0x29cedb){while(--_0x29cedb){_0x10fc6b['push'](_0x10fc6b['shift']());}};_0x338746(++_0x31c06a);}(_0x5a5f,0x153));var _0xf5a5=function(_0xeb4c8b,_0x1dc497){_0xeb4c8b=_0xeb4c8b-0x0;var _0x90b0d0=_0x5a5f[_0xeb4c8b];return _0x90b0d0;};'use strict';var emlformat=require(_0xf5a5('0x0'));var rimraf=require(_0xf5a5('0x1'));var zipdir=require(_0xf5a5('0x2'));var jsonpatch=require(_0xf5a5('0x3'));var rp=require(_0xf5a5('0x4'));var moment=require(_0xf5a5('0x5'));var BPromise=require(_0xf5a5('0x6'));var Mustache=require(_0xf5a5('0x7'));var util=require(_0xf5a5('0x8'));var path=require(_0xf5a5('0x9'));var sox=require('sox');var csv=require(_0xf5a5('0xa'));var ejs=require(_0xf5a5('0xb'));var fs=require('fs');var fs_extra=require(_0xf5a5('0xc'));var _=require(_0xf5a5('0xd'));var squel=require(_0xf5a5('0xe'));var crypto=require('crypto');var jsforce=require(_0xf5a5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf5a5('0xa'));var querystring=require('querystring');var Papa=require(_0xf5a5('0x10'));var Redis=require('ioredis');var authService=require(_0xf5a5('0x11'));var qs=require(_0xf5a5('0x12'));var as=require(_0xf5a5('0x13'));var hardwareService=require(_0xf5a5('0x14'));var logger=require('../../config/logger')(_0xf5a5('0x15'));var utils=require(_0xf5a5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf5a5('0x17'));var db=require(_0xf5a5('0x18'))['db'];function respondWithStatusCode(_0x230f76,_0x39d5eb){_0x39d5eb=_0x39d5eb||0xcc;return function(_0x22d361){if(_0x22d361){return _0x230f76[_0xf5a5('0x19')](_0x39d5eb);}return _0x230f76[_0xf5a5('0x1a')](_0x39d5eb)[_0xf5a5('0x1b')]();};}function respondWithResult(_0xe9f7e0,_0x361b2b){_0x361b2b=_0x361b2b||0xc8;return function(_0x35f204){if(_0x35f204){return _0xe9f7e0['status'](_0x361b2b)[_0xf5a5('0x1c')](_0x35f204);}};}function respondWithFilteredResult(_0x3cf1f7,_0x21db53){return function(_0x12eab0){if(_0x12eab0){var _0x1e1504=_0x12eab0['count'],_0x12af2b=_0x21db53[_0xf5a5('0x1d')],_0x39335e=_0x21db53[_0xf5a5('0x1d')]+_0x21db53[_0xf5a5('0x1e')],_0x34d9cf;if(_0x39335e>=_0x1e1504){_0x39335e=_0x1e1504;_0x34d9cf=0xc8;}else{_0x34d9cf=0xce;}_0x3cf1f7['status'](_0x34d9cf);return _0x3cf1f7[_0xf5a5('0x1f')](_0xf5a5('0x20'),_0x12af2b+'-'+_0x39335e+'/'+_0x1e1504)['json'](_0x12eab0);}return null;};}function patchUpdates(_0x3417a3){return function(_0x291fdd){try{jsonpatch[_0xf5a5('0x21')](_0x291fdd,_0x3417a3,!![]);}catch(_0x58c4d8){return BPromise[_0xf5a5('0x22')](_0x58c4d8);}return _0x291fdd['save']();};}function saveUpdates(_0x565b8b,_0x6d5d9e){return function(_0x108ae6){if(_0x108ae6){return _0x108ae6[_0xf5a5('0x23')](_0x565b8b)[_0xf5a5('0x24')](function(_0x43d581){return _0x43d581;});}return null;};}function removeEntity(_0x173ccf,_0x15589e){return function(_0x5ca3ae){if(_0x5ca3ae){return _0x5ca3ae[_0xf5a5('0x25')]()[_0xf5a5('0x24')](function(){_0x173ccf['status'](0xcc)[_0xf5a5('0x1b')]();});}};}function handleEntityNotFound(_0x14f558,_0x5edcd6){return function(_0x401a32){if(!_0x401a32){_0x14f558[_0xf5a5('0x19')](0x194);}return _0x401a32;};}function handleError(_0x195811,_0x18ebec){_0x18ebec=_0x18ebec||0x1f4;return function(_0x2a67ea){logger[_0xf5a5('0x26')](_0x2a67ea['stack']);if(_0x2a67ea['name']){delete _0x2a67ea[_0xf5a5('0x27')];}_0x195811[_0xf5a5('0x1a')](_0x18ebec)[_0xf5a5('0x28')](_0x2a67ea);};}exports[_0xf5a5('0x29')]=function(_0x111693,_0x2fced8){var _0x56a0b0={},_0x5ac9ee={},_0x140720={'count':0x0,'rows':[]};var _0x18c739=_['map'](db[_0xf5a5('0x2a')][_0xf5a5('0x2b')],function(_0xce8ea1){return{'name':_0xce8ea1['fieldName'],'type':_0xce8ea1[_0xf5a5('0x2c')]['key']};});_0x5ac9ee[_0xf5a5('0x2d')]=_['map'](_0x18c739,_0xf5a5('0x27'));_0x5ac9ee[_0xf5a5('0x2e')]=_['keys'](_0x111693[_0xf5a5('0x2e')]);_0x5ac9ee[_0xf5a5('0x2f')]=_[_0xf5a5('0x30')](_0x5ac9ee[_0xf5a5('0x2d')],_0x5ac9ee['query']);_0x56a0b0['attributes']=_[_0xf5a5('0x30')](_0x5ac9ee['model'],qs['fields'](_0x111693[_0xf5a5('0x2e')][_0xf5a5('0x31')]));_0x56a0b0[_0xf5a5('0x32')]=_0x56a0b0[_0xf5a5('0x32')][_0xf5a5('0x33')]?_0x56a0b0[_0xf5a5('0x32')]:_0x5ac9ee[_0xf5a5('0x2d')];if(!_0x111693['query']['hasOwnProperty'](_0xf5a5('0x34'))){_0x56a0b0[_0xf5a5('0x1e')]=qs[_0xf5a5('0x1e')](_0x111693[_0xf5a5('0x2e')]['limit']);_0x56a0b0[_0xf5a5('0x1d')]=qs[_0xf5a5('0x1d')](_0x111693[_0xf5a5('0x2e')][_0xf5a5('0x1d')]);}_0x56a0b0[_0xf5a5('0x35')]=qs['sort'](_0x111693[_0xf5a5('0x2e')]['sort']);_0x56a0b0[_0xf5a5('0x36')]=qs[_0xf5a5('0x2f')](_[_0xf5a5('0x37')](_0x111693[_0xf5a5('0x2e')],_0x5ac9ee[_0xf5a5('0x2f')]),_0x18c739);if(_0x111693[_0xf5a5('0x2e')][_0xf5a5('0x38')]){_0x56a0b0['where']=_[_0xf5a5('0x39')](_0x56a0b0[_0xf5a5('0x36')],{'$or':_[_0xf5a5('0x3a')](_0x18c739,function(_0x1f616a){if(_0x1f616a['type']!==_0xf5a5('0x3b')){var _0x4c25cf={};_0x4c25cf[_0x1f616a[_0xf5a5('0x27')]]={'$like':'%'+_0x111693['query']['filter']+'%'};return _0x4c25cf;}})});}_0x56a0b0=_[_0xf5a5('0x39')]({},_0x56a0b0,_0x111693[_0xf5a5('0x3c')]);var _0x51d4de={'where':_0x56a0b0['where']};return db[_0xf5a5('0x2a')][_0xf5a5('0x3d')](_0x51d4de)[_0xf5a5('0x24')](function(_0x5316c5){_0x140720[_0xf5a5('0x3d')]=_0x5316c5;if(_0x111693['query'][_0xf5a5('0x3e')]){_0x56a0b0[_0xf5a5('0x3f')]=[{'all':!![]}];}return db[_0xf5a5('0x2a')][_0xf5a5('0x40')](_0x56a0b0);})[_0xf5a5('0x24')](function(_0x25b99b){_0x140720[_0xf5a5('0x41')]=_0x25b99b;return _0x140720;})['then'](respondWithFilteredResult(_0x2fced8,_0x56a0b0))[_0xf5a5('0x42')](handleError(_0x2fced8,null));};exports[_0xf5a5('0x43')]=function(_0x3b7dc6,_0x5d1a03){var _0x53ea33={'raw':!![],'where':{'id':_0x3b7dc6['params']['id']}},_0x538fc2={};_0x538fc2[_0xf5a5('0x2d')]=_[_0xf5a5('0x44')](db[_0xf5a5('0x2a')][_0xf5a5('0x2b')]);_0x538fc2[_0xf5a5('0x2e')]=_[_0xf5a5('0x44')](_0x3b7dc6[_0xf5a5('0x2e')]);_0x538fc2[_0xf5a5('0x2f')]=_['intersection'](_0x538fc2['model'],_0x538fc2[_0xf5a5('0x2e')]);_0x53ea33['attributes']=_[_0xf5a5('0x30')](_0x538fc2[_0xf5a5('0x2d')],qs[_0xf5a5('0x31')](_0x3b7dc6[_0xf5a5('0x2e')]['fields']));_0x53ea33[_0xf5a5('0x32')]=_0x53ea33[_0xf5a5('0x32')][_0xf5a5('0x33')]?_0x53ea33[_0xf5a5('0x32')]:_0x538fc2[_0xf5a5('0x2d')];if(_0x3b7dc6[_0xf5a5('0x2e')][_0xf5a5('0x3e')]){_0x53ea33[_0xf5a5('0x3f')]=[{'all':!![]}];}_0x53ea33=_['merge']({},_0x53ea33,_0x3b7dc6['options']);return db[_0xf5a5('0x2a')][_0xf5a5('0x45')](_0x53ea33)[_0xf5a5('0x24')](handleEntityNotFound(_0x5d1a03,null))[_0xf5a5('0x24')](respondWithResult(_0x5d1a03,null))[_0xf5a5('0x42')](handleError(_0x5d1a03,null));};exports[_0xf5a5('0x46')]=function(_0x4810c9,_0x4fb97a){return db[_0xf5a5('0x2a')][_0xf5a5('0x46')](_0x4810c9[_0xf5a5('0x47')],{})[_0xf5a5('0x24')](respondWithResult(_0x4fb97a,0xc9))[_0xf5a5('0x42')](handleError(_0x4fb97a,null));};exports['update']=function(_0x52d49c,_0x3d2294){if(_0x52d49c[_0xf5a5('0x47')]['id']){delete _0x52d49c['body']['id'];}return db[_0xf5a5('0x2a')][_0xf5a5('0x45')]({'where':{'id':_0x52d49c['params']['id']}})['then'](handleEntityNotFound(_0x3d2294,null))[_0xf5a5('0x24')](saveUpdates(_0x52d49c[_0xf5a5('0x47')],null))[_0xf5a5('0x24')](respondWithResult(_0x3d2294,null))[_0xf5a5('0x42')](handleError(_0x3d2294,null));};exports[_0xf5a5('0x25')]=function(_0x4b8902,_0x47c21b){return db['ZendeskField']['find']({'where':{'id':_0x4b8902[_0xf5a5('0x48')]['id']}})[_0xf5a5('0x24')](handleEntityNotFound(_0x47c21b,null))[_0xf5a5('0x24')](removeEntity(_0x47c21b,null))[_0xf5a5('0x42')](handleError(_0x47c21b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index d0676d4..40802a9 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 _0x7b6b=['exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x47f445,_0x26bd4e){var _0x34150f=function(_0x5e9cf6){while(--_0x5e9cf6){_0x47f445['push'](_0x47f445['shift']());}};_0x34150f(++_0x26bd4e);}(_0x7b6b,0xac));var _0xb7b6=function(_0x14b7f7,_0x142805){_0x14b7f7=_0x14b7f7-0x0;var _0x14c8f7=_0x7b6b[_0x14b7f7];return _0x14c8f7;};'use strict';var _=require(_0xb7b6('0x0'));var util=require('util');var logger=require(_0xb7b6('0x1'))(_0xb7b6('0x2'));var moment=require(_0xb7b6('0x3'));var BPromise=require('bluebird');var rp=require(_0xb7b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7b6('0x5'));var config=require(_0xb7b6('0x6'));var attributes=require(_0xb7b6('0x7'));module[_0xb7b6('0x8')]=function(_0xde6ac0,_0x4109d2){return _0xde6ac0[_0xb7b6('0x9')](_0xb7b6('0xa'),attributes,{'tableName':_0xb7b6('0xb'),'paranoid':![],'indexes':[{'name':_0xb7b6('0xc'),'fields':[_0xb7b6('0xd'),_0xb7b6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xffe1=['FieldId','lodash','util','api','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index'];(function(_0x19c9f1,_0x458187){var _0x20bfd6=function(_0x18a24e){while(--_0x18a24e){_0x19c9f1['push'](_0x19c9f1['shift']());}};_0x20bfd6(++_0x458187);}(_0xffe1,0x187));var _0x1ffe=function(_0x35294f,_0x536280){_0x35294f=_0x35294f-0x0;var _0x4befd4=_0xffe1[_0x35294f];return _0x4befd4;};'use strict';var _=require(_0x1ffe('0x0'));var util=require(_0x1ffe('0x1'));var logger=require('../../config/logger')(_0x1ffe('0x2'));var moment=require('moment');var BPromise=require(_0x1ffe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ffe('0x4'));var rimraf=require(_0x1ffe('0x5'));var config=require(_0x1ffe('0x6'));var attributes=require(_0x1ffe('0x7'));module[_0x1ffe('0x8')]=function(_0x378bbc,_0xb5517d){return _0x378bbc[_0x1ffe('0x9')](_0x1ffe('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x1ffe('0xb'),'fields':['idField',_0x1ffe('0xc')],'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 75d4ef0..7f135f1 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 _0xb962=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0xd3a563,_0x39ddd2){var _0x46c915=function(_0x486a1a){while(--_0x486a1a){_0xd3a563['push'](_0xd3a563['shift']());}};_0x46c915(++_0x39ddd2);}(_0xb962,0x11b));var _0x2b96=function(_0x179adc,_0x20f40e){_0x179adc=_0x179adc-0x0;var _0xfc5916=_0xb962[_0x179adc];return _0xfc5916;};'use strict';var _=require(_0x2b96('0x0'));var util=require('util');var moment=require(_0x2b96('0x1'));var BPromise=require(_0x2b96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b96('0x3'));var db=require(_0x2b96('0x4'))['db'];var utils=require(_0x2b96('0x5'));var logger=require('../../config/logger')(_0x2b96('0x6'));var config=require(_0x2b96('0x7'));var jayson=require(_0x2b96('0x8'));var client=jayson[_0x2b96('0x9')][_0x2b96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25de43,_0x116f56,_0x4a59dc){return new BPromise(function(_0xcbafd9,_0x1a7fcd){return client[_0x2b96('0xb')](_0x25de43,_0x4a59dc)['then'](function(_0x19aab5){logger[_0x2b96('0xc')](_0x2b96('0xd'),_0x116f56,'request\x20sent');logger['debug'](_0x2b96('0xe'),_0x116f56,_0x2b96('0xf'),JSON[_0x2b96('0x10')](_0x19aab5));if(_0x19aab5[_0x2b96('0x11')]){if(_0x19aab5[_0x2b96('0x11')][_0x2b96('0x12')]===0x1f4){logger[_0x2b96('0x11')](_0x2b96('0xd'),_0x116f56,_0x19aab5[_0x2b96('0x11')][_0x2b96('0x13')]);return _0x1a7fcd(_0x19aab5[_0x2b96('0x11')][_0x2b96('0x13')]);}logger[_0x2b96('0x11')](_0x2b96('0xd'),_0x116f56,_0x19aab5[_0x2b96('0x11')]['message']);return _0xcbafd9(_0x19aab5['error'][_0x2b96('0x13')]);}else{logger['info'](_0x2b96('0xd'),_0x116f56,'request\x20sent');_0xcbafd9(_0x19aab5[_0x2b96('0x14')][_0x2b96('0x13')]);}})[_0x2b96('0x15')](function(_0x12874f){logger[_0x2b96('0x11')](_0x2b96('0xd'),_0x116f56,_0x12874f);_0x1a7fcd(_0x12874f);});});} \ No newline at end of file +var _0x3c4a=['request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0xe4b9d8,_0x26bcfd){var _0x49d48f=function(_0x10a281){while(--_0x10a281){_0xe4b9d8['push'](_0xe4b9d8['shift']());}};_0x49d48f(++_0x26bcfd);}(_0x3c4a,0x105));var _0xa3c4=function(_0x2dfd2b,_0x522d82){_0x2dfd2b=_0x2dfd2b-0x0;var _0x3fda3a=_0x3c4a[_0x2dfd2b];return _0x3fda3a;};'use strict';var _=require(_0xa3c4('0x0'));var util=require('util');var moment=require(_0xa3c4('0x1'));var BPromise=require(_0xa3c4('0x2'));var rs=require(_0xa3c4('0x3'));var fs=require('fs');var Redis=require(_0xa3c4('0x4'));var db=require(_0xa3c4('0x5'))['db'];var utils=require(_0xa3c4('0x6'));var logger=require('../../config/logger')(_0xa3c4('0x7'));var config=require('../../config/environment');var jayson=require(_0xa3c4('0x8'));var client=jayson[_0xa3c4('0x9')][_0xa3c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b4864,_0x5f55ba,_0x1bf9f4){return new BPromise(function(_0xec6f43,_0x560241){return client[_0xa3c4('0xb')](_0x2b4864,_0x1bf9f4)[_0xa3c4('0xc')](function(_0x39c046){logger[_0xa3c4('0xd')](_0xa3c4('0xe'),_0x5f55ba,_0xa3c4('0xf'));logger[_0xa3c4('0x10')](_0xa3c4('0x11'),_0x5f55ba,'request\x20sent',JSON[_0xa3c4('0x12')](_0x39c046));if(_0x39c046[_0xa3c4('0x13')]){if(_0x39c046[_0xa3c4('0x13')][_0xa3c4('0x14')]===0x1f4){logger[_0xa3c4('0x13')](_0xa3c4('0xe'),_0x5f55ba,_0x39c046[_0xa3c4('0x13')][_0xa3c4('0x15')]);return _0x560241(_0x39c046[_0xa3c4('0x13')][_0xa3c4('0x15')]);}logger[_0xa3c4('0x13')](_0xa3c4('0xe'),_0x5f55ba,_0x39c046[_0xa3c4('0x13')][_0xa3c4('0x15')]);return _0xec6f43(_0x39c046['error']['message']);}else{logger[_0xa3c4('0xd')](_0xa3c4('0xe'),_0x5f55ba,_0xa3c4('0xf'));_0xec6f43(_0x39c046['result'][_0xa3c4('0x15')]);}})[_0xa3c4('0x16')](function(_0x3fad28){logger[_0xa3c4('0x13')]('ZendeskField,\x20%s,\x20%s',_0x5f55ba,_0x3fad28);_0x560241(_0x3fad28);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 046cc91..8204b32 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 _0xd4a7=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd4a7,0x72));var _0x7d4a=function(_0x4ee2fb,_0x12073c){_0x4ee2fb=_0x4ee2fb-0x0;var _0x160cf2=_0xd4a7[_0x4ee2fb];return _0x160cf2;};'use strict';var multer=require(_0x7d4a('0x0'));var util=require(_0x7d4a('0x1'));var path=require(_0x7d4a('0x2'));var timeout=require(_0x7d4a('0x3'));var express=require('express');var router=express[_0x7d4a('0x4')]();var fs_extra=require(_0x7d4a('0x5'));var auth=require(_0x7d4a('0x6'));var interaction=require(_0x7d4a('0x7'));var config=require(_0x7d4a('0x8'));var controller=require(_0x7d4a('0x9'));router[_0x7d4a('0xa')]('/',auth[_0x7d4a('0xb')](),controller[_0x7d4a('0xc')]);router[_0x7d4a('0xa')](_0x7d4a('0xd'),auth[_0x7d4a('0xb')](),controller[_0x7d4a('0xe')]);router[_0x7d4a('0xa')](_0x7d4a('0xf'),auth[_0x7d4a('0xb')](),controller[_0x7d4a('0x10')]);router[_0x7d4a('0xa')](_0x7d4a('0x11'),auth['isAuthenticated'](),controller[_0x7d4a('0x12')]);router[_0x7d4a('0x13')]('/',auth['isAuthenticated'](),controller[_0x7d4a('0x14')]);router[_0x7d4a('0x13')](_0x7d4a('0xf'),auth[_0x7d4a('0xb')](),controller[_0x7d4a('0x15')]);router['put'](_0x7d4a('0xd'),auth['isAuthenticated'](),controller[_0x7d4a('0x16')]);router['delete'](_0x7d4a('0xd'),auth[_0x7d4a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc592=['/:id','show','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','delete','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index'];(function(_0x2fddde,_0x2b5f8e){var _0x551ade=function(_0x512c20){while(--_0x512c20){_0x2fddde['push'](_0x2fddde['shift']());}};_0x551ade(++_0x2b5f8e);}(_0xc592,0xf2));var _0x2c59=function(_0x92bb14,_0x31bb92){_0x92bb14=_0x92bb14-0x0;var _0x1f23cb=_0xc592[_0x92bb14];return _0x1f23cb;};'use strict';var multer=require('multer');var util=require(_0x2c59('0x0'));var path=require('path');var timeout=require(_0x2c59('0x1'));var express=require(_0x2c59('0x2'));var router=express[_0x2c59('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2c59('0x4'));var config=require(_0x2c59('0x5'));var controller=require(_0x2c59('0x6'));router[_0x2c59('0x7')]('/',auth[_0x2c59('0x8')](),controller[_0x2c59('0x9')]);router['get'](_0x2c59('0xa'),auth['isAuthenticated'](),controller[_0x2c59('0xb')]);router[_0x2c59('0x7')]('/:id/configurations',auth[_0x2c59('0x8')](),controller[_0x2c59('0xc')]);router[_0x2c59('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2c59('0xd')]);router[_0x2c59('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x2c59('0xf'),auth[_0x2c59('0x8')](),controller[_0x2c59('0x10')]);router[_0x2c59('0x11')](_0x2c59('0xa'),auth[_0x2c59('0x8')](),controller['update']);router[_0x2c59('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2c59('0x13')]);module[_0x2c59('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 1890081..33bed1e 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 _0x6625=['sequelize','exports','STRING'];(function(_0x445ff2,_0x34dd7b){var _0x3594f3=function(_0x49e246){while(--_0x49e246){_0x445ff2['push'](_0x445ff2['shift']());}};_0x3594f3(++_0x34dd7b);}(_0x6625,0x141));var _0x5662=function(_0x122adf,_0x20e886){_0x122adf=_0x122adf-0x0;var _0x407edc=_0x6625[_0x122adf];return _0x407edc;};'use strict';var Sequelize=require(_0x5662('0x0'));module[_0x5662('0x1')]={'name':{'type':Sequelize[_0x5662('0x2')]},'description':{'type':Sequelize[_0x5662('0x2')]},'host':{'type':Sequelize[_0x5662('0x2')]},'zone':{'type':Sequelize[_0x5662('0x2')]},'clientId':{'type':Sequelize[_0x5662('0x2')]},'clientSecret':{'type':Sequelize[_0x5662('0x2')]},'serverUrl':{'type':Sequelize[_0x5662('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x5662('0x2')]},'refreshToken':{'type':Sequelize[_0x5662('0x2')]}}; \ No newline at end of file +var _0x0c8d=['sequelize','STRING'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x0c8d,0x194));var _0xd0c8=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x0c8d[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0xd0c8('0x0'));module['exports']={'name':{'type':Sequelize[_0xd0c8('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd0c8('0x1')]},'zone':{'type':Sequelize[_0xd0c8('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xd0c8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index b7dc438..90e98fe 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 _0xf972=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','includeAll','findAll','rows','show','keys','include','options','find','create','body','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientId','serverUrl','com','slice','substring','lastIndexOf','refreshToken','GET','format','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','WhoId','Call_Result','Call_Start_Time','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','test','getFields','stringify','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x36e3ed,_0x57052f){var _0x2e9fe2=function(_0x55fb45){while(--_0x55fb45){_0x36e3ed['push'](_0x36e3ed['shift']());}};_0x2e9fe2(++_0x57052f);}(_0xf972,0x18e));var _0x2f97=function(_0x45b9e8,_0xbd91b5){_0x45b9e8=_0x45b9e8-0x0;var _0x53739=_0xf972[_0x45b9e8];return _0x53739;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2f97('0x0'));var jsonpatch=require(_0x2f97('0x1'));var rp=require(_0x2f97('0x2'));var moment=require(_0x2f97('0x3'));var BPromise=require(_0x2f97('0x4'));var Mustache=require(_0x2f97('0x5'));var util=require(_0x2f97('0x6'));var path=require('path');var sox=require(_0x2f97('0x7'));var csv=require(_0x2f97('0x8'));var ejs=require(_0x2f97('0x9'));var fs=require('fs');var fs_extra=require(_0x2f97('0xa'));var _=require(_0x2f97('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2f97('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2f97('0x8'));var querystring=require(_0x2f97('0xd'));var Papa=require(_0x2f97('0xe'));var Redis=require(_0x2f97('0xf'));var authService=require(_0x2f97('0x10'));var qs=require(_0x2f97('0x11'));var as=require(_0x2f97('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f97('0x13'))(_0x2f97('0x14'));var utils=require(_0x2f97('0x15'));var config=require(_0x2f97('0x16'));var licenseUtil=require(_0x2f97('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2f97('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x2f97('0x19')][_0x2f97('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xe69433,_0x4aa145,_0x5772e8,_0x4f8509){return new BPromise(function(_0xca34bc,_0x29aea3){var _0x5a417e=_0x4f8509||client;return _0x5a417e[_0x2f97('0x1b')](_0xe69433,_0x5772e8)[_0x2f97('0x1c')](function(_0x2de24e){logger['info'](_0x2f97('0x1d'),_0x4aa145,_0x2f97('0x1e'));logger[_0x2f97('0x1f')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x4aa145,_0x2f97('0x1e'),JSON['stringify'](_0x2de24e));if(_0x2de24e[_0x2f97('0x20')]){if(_0x2de24e[_0x2f97('0x20')][_0x2f97('0x21')]===0x1f4){logger[_0x2f97('0x20')](_0x2f97('0x1d'),_0x4aa145,_0x2de24e[_0x2f97('0x20')][_0x2f97('0x22')]);return _0x29aea3(_0x2de24e['error'][_0x2f97('0x22')]);}logger[_0x2f97('0x20')](_0x2f97('0x1d'),_0x4aa145,_0x2de24e[_0x2f97('0x20')][_0x2f97('0x22')]);return _0xca34bc(_0x2de24e['error'][_0x2f97('0x22')]);}else{logger[_0x2f97('0x23')](_0x2f97('0x1d'),_0x4aa145,'request\x20sent');_0xca34bc(_0x2de24e[_0x2f97('0x24')]['message']);}})[_0x2f97('0x25')](function(_0x588246){logger[_0x2f97('0x20')](_0x2f97('0x1d'),_0x4aa145,_0x588246);_0x29aea3(_0x588246);});});}function respondWithStatusCode(_0x27c50c,_0x54740a){_0x54740a=_0x54740a||0xcc;return function(_0x4dacd1){if(_0x4dacd1){return _0x27c50c[_0x2f97('0x26')](_0x54740a);}return _0x27c50c[_0x2f97('0x27')](_0x54740a)[_0x2f97('0x28')]();};}function respondWithResult(_0x14686a,_0x4722b4){_0x4722b4=_0x4722b4||0xc8;return function(_0x189a7e){if(_0x189a7e){return _0x14686a['status'](_0x4722b4)[_0x2f97('0x29')](_0x189a7e);}};}function respondWithFilteredResult(_0x6fa98b,_0x3d2f7e){return function(_0x64ec20){if(_0x64ec20){var _0x43f417=_0x64ec20[_0x2f97('0x2a')],_0x1d9874=_0x3d2f7e[_0x2f97('0x2b')],_0x4a9464=_0x3d2f7e['offset']+_0x3d2f7e[_0x2f97('0x2c')],_0x68d5a;if(_0x4a9464>=_0x43f417){_0x4a9464=_0x43f417;_0x68d5a=0xc8;}else{_0x68d5a=0xce;}_0x6fa98b[_0x2f97('0x27')](_0x68d5a);return _0x6fa98b['set']('Content-Range',_0x1d9874+'-'+_0x4a9464+'/'+_0x43f417)['json'](_0x64ec20);}return null;};}function patchUpdates(_0xdcb3e3){return function(_0x49b529){try{jsonpatch[_0x2f97('0x2d')](_0x49b529,_0xdcb3e3,!![]);}catch(_0x118ccd){return BPromise[_0x2f97('0x2e')](_0x118ccd);}return _0x49b529[_0x2f97('0x2f')]();};}function saveUpdates(_0x291b66,_0x242dc2){return function(_0x8e9ecd){if(_0x8e9ecd){return _0x8e9ecd[_0x2f97('0x30')](_0x291b66)[_0x2f97('0x1c')](function(_0x105494){return _0x105494;});}return null;};}function removeEntity(_0x4600a4,_0x57ab50){return function(_0x122be7){if(_0x122be7){return _0x122be7[_0x2f97('0x31')]()[_0x2f97('0x1c')](function(){_0x4600a4[_0x2f97('0x27')](0xcc)[_0x2f97('0x28')]();});}};}function handleEntityNotFound(_0x5799e4,_0x1e0eb8){return function(_0x46013e){if(!_0x46013e){_0x5799e4[_0x2f97('0x26')](0x194);}return _0x46013e;};}function handleError(_0x203fe,_0x48c856){_0x48c856=_0x48c856||0x1f4;return function(_0x270096){logger[_0x2f97('0x20')](_0x270096['stack']);if(_0x270096[_0x2f97('0x32')]){delete _0x270096[_0x2f97('0x32')];}_0x203fe['status'](_0x48c856)[_0x2f97('0x33')](_0x270096);};}exports[_0x2f97('0x34')]=function(_0x56a3e6,_0x58d4f6){var _0x3c02d9={},_0x254d8f={},_0x385280={'count':0x0,'rows':[]};var _0x2a568e=_[_0x2f97('0x35')](db[_0x2f97('0x36')][_0x2f97('0x37')],function(_0x454cb9){return{'name':_0x454cb9[_0x2f97('0x38')],'type':_0x454cb9[_0x2f97('0x39')]['key']};});_0x254d8f[_0x2f97('0x3a')]=_[_0x2f97('0x35')](_0x2a568e,_0x2f97('0x32'));_0x254d8f[_0x2f97('0x3b')]=_['keys'](_0x56a3e6[_0x2f97('0x3b')]);_0x254d8f[_0x2f97('0x3c')]=_['intersection'](_0x254d8f[_0x2f97('0x3a')],_0x254d8f['query']);_0x3c02d9[_0x2f97('0x3d')]=_[_0x2f97('0x3e')](_0x254d8f[_0x2f97('0x3a')],qs[_0x2f97('0x3f')](_0x56a3e6[_0x2f97('0x3b')][_0x2f97('0x3f')]));_0x3c02d9[_0x2f97('0x3d')]=_0x3c02d9[_0x2f97('0x3d')][_0x2f97('0x40')]?_0x3c02d9[_0x2f97('0x3d')]:_0x254d8f[_0x2f97('0x3a')];if(!_0x56a3e6[_0x2f97('0x3b')][_0x2f97('0x41')](_0x2f97('0x42'))){_0x3c02d9['limit']=qs['limit'](_0x56a3e6[_0x2f97('0x3b')]['limit']);_0x3c02d9['offset']=qs[_0x2f97('0x2b')](_0x56a3e6[_0x2f97('0x3b')][_0x2f97('0x2b')]);}_0x3c02d9[_0x2f97('0x43')]=qs[_0x2f97('0x44')](_0x56a3e6[_0x2f97('0x3b')]['sort']);_0x3c02d9[_0x2f97('0x45')]=qs[_0x2f97('0x3c')](_['pick'](_0x56a3e6['query'],_0x254d8f[_0x2f97('0x3c')]),_0x2a568e);if(_0x56a3e6[_0x2f97('0x3b')]['filter']){_0x3c02d9[_0x2f97('0x45')]=_[_0x2f97('0x46')](_0x3c02d9[_0x2f97('0x45')],{'$or':_[_0x2f97('0x35')](_0x2a568e,function(_0x59181b){if(_0x59181b['type']!=='VIRTUAL'){var _0x547b10={};_0x547b10[_0x59181b['name']]={'$like':'%'+_0x56a3e6[_0x2f97('0x3b')][_0x2f97('0x47')]+'%'};return _0x547b10;}})});}_0x3c02d9=_['merge']({},_0x3c02d9,_0x56a3e6['options']);var _0x2ffd5f={'where':_0x3c02d9[_0x2f97('0x45')]};return db[_0x2f97('0x36')]['count'](_0x2ffd5f)[_0x2f97('0x1c')](function(_0x233997){_0x385280[_0x2f97('0x2a')]=_0x233997;if(_0x56a3e6['query'][_0x2f97('0x48')]){_0x3c02d9['include']=[{'all':!![]}];}return db[_0x2f97('0x36')][_0x2f97('0x49')](_0x3c02d9);})[_0x2f97('0x1c')](function(_0x10d478){_0x385280[_0x2f97('0x4a')]=_0x10d478;return _0x385280;})['then'](respondWithFilteredResult(_0x58d4f6,_0x3c02d9))[_0x2f97('0x25')](handleError(_0x58d4f6,null));};exports[_0x2f97('0x4b')]=function(_0x4ac38c,_0x2ba1d7){var _0x402c49={'raw':![],'where':{'id':_0x4ac38c['params']['id']}},_0x57a28a={};_0x57a28a[_0x2f97('0x3a')]=_[_0x2f97('0x4c')](db[_0x2f97('0x36')][_0x2f97('0x37')]);_0x57a28a[_0x2f97('0x3b')]=_[_0x2f97('0x4c')](_0x4ac38c[_0x2f97('0x3b')]);_0x57a28a[_0x2f97('0x3c')]=_[_0x2f97('0x3e')](_0x57a28a[_0x2f97('0x3a')],_0x57a28a[_0x2f97('0x3b')]);_0x402c49[_0x2f97('0x3d')]=_[_0x2f97('0x3e')](_0x57a28a['model'],qs[_0x2f97('0x3f')](_0x4ac38c[_0x2f97('0x3b')][_0x2f97('0x3f')]));_0x402c49[_0x2f97('0x3d')]=_0x402c49[_0x2f97('0x3d')][_0x2f97('0x40')]?_0x402c49[_0x2f97('0x3d')]:_0x57a28a[_0x2f97('0x3a')];if(_0x4ac38c['query'][_0x2f97('0x48')]){_0x402c49[_0x2f97('0x4d')]=[{'all':!![]}];}_0x402c49=_['merge']({},_0x402c49,_0x4ac38c[_0x2f97('0x4e')]);return db[_0x2f97('0x36')][_0x2f97('0x4f')](_0x402c49)[_0x2f97('0x1c')](handleEntityNotFound(_0x2ba1d7,null))[_0x2f97('0x1c')](respondWithResult(_0x2ba1d7,null))[_0x2f97('0x25')](handleError(_0x2ba1d7,null));};exports['create']=function(_0x3afe13,_0x13f024){return db[_0x2f97('0x36')][_0x2f97('0x50')](_0x3afe13['body'],{})['then'](respondWithResult(_0x13f024,0xc9))[_0x2f97('0x25')](handleError(_0x13f024,null));};exports[_0x2f97('0x30')]=function(_0xd6d73c,_0x2ae0f6){if(_0xd6d73c[_0x2f97('0x51')]['id']){delete _0xd6d73c[_0x2f97('0x51')]['id'];}return db[_0x2f97('0x36')]['find']({'where':{'id':_0xd6d73c[_0x2f97('0x52')]['id']}})['then'](handleEntityNotFound(_0x2ae0f6,null))[_0x2f97('0x1c')](saveUpdates(_0xd6d73c['body'],null))[_0x2f97('0x1c')](respondWithResult(_0x2ae0f6,null))['catch'](handleError(_0x2ae0f6,null));};exports[_0x2f97('0x31')]=function(_0xf90cdd,_0x53604f){return db[_0x2f97('0x36')][_0x2f97('0x4f')]({'where':{'id':_0xf90cdd[_0x2f97('0x52')]['id']}})[_0x2f97('0x1c')](handleEntityNotFound(_0x53604f,null))[_0x2f97('0x1c')](removeEntity(_0x53604f,null))['catch'](handleError(_0x53604f,null));};exports[_0x2f97('0x53')]=function(_0x3e9c9d,_0x5088d0,_0x7912c6){var _0x133f3a={};var _0x3ae32a={};var _0x517a58;var _0xed8306;return db[_0x2f97('0x36')][_0x2f97('0x54')]({'where':{'id':_0x3e9c9d[_0x2f97('0x52')]['id']}})['then'](handleEntityNotFound(_0x5088d0,null))['then'](function(_0x9f1353){if(_0x9f1353){_0x517a58=_0x9f1353;_0x3ae32a['model']=_['keys'](db['ZohoConfiguration'][_0x2f97('0x37')]);_0x3ae32a['query']=_[_0x2f97('0x4c')](_0x3e9c9d[_0x2f97('0x3b')]);_0x3ae32a[_0x2f97('0x3c')]=_[_0x2f97('0x3e')](_0x3ae32a[_0x2f97('0x3a')],_0x3ae32a[_0x2f97('0x3b')]);_0x133f3a[_0x2f97('0x3d')]=_[_0x2f97('0x3e')](_0x3ae32a['model'],qs[_0x2f97('0x3f')](_0x3e9c9d['query'][_0x2f97('0x3f')]));_0x133f3a[_0x2f97('0x3d')]=_0x133f3a[_0x2f97('0x3d')]['length']?_0x133f3a['attributes']:_0x3ae32a['model'];_0x133f3a[_0x2f97('0x43')]=qs[_0x2f97('0x44')](_0x3e9c9d[_0x2f97('0x3b')]['sort']);_0x133f3a[_0x2f97('0x45')]=qs[_0x2f97('0x3c')](_['pick'](_0x3e9c9d[_0x2f97('0x3b')],_0x3ae32a['filters']));if(_0x3e9c9d['query'][_0x2f97('0x47')]){_0x133f3a[_0x2f97('0x45')]=_[_0x2f97('0x46')](_0x133f3a[_0x2f97('0x45')],{'$or':_['map'](_0x133f3a['attributes'],function(_0x2a57b5){var _0x32b262={};_0x32b262[_0x2a57b5]={'$like':'%'+_0x3e9c9d[_0x2f97('0x3b')][_0x2f97('0x47')]+'%'};return _0x32b262;})});}_0x133f3a=_[_0x2f97('0x46')]({},_0x133f3a,_0x3e9c9d[_0x2f97('0x4e')]);return _0x517a58[_0x2f97('0x53')](_0x133f3a);}})[_0x2f97('0x1c')](function(_0x187203){if(_0x187203){_0xed8306=_0x187203['length'];if(!_0x3e9c9d['query'][_0x2f97('0x41')]('nolimit')){_0x133f3a[_0x2f97('0x2c')]=qs['limit'](_0x3e9c9d[_0x2f97('0x3b')]['limit']);_0x133f3a['offset']=qs[_0x2f97('0x2b')](_0x3e9c9d[_0x2f97('0x3b')][_0x2f97('0x2b')]);}return _0x517a58['getConfigurations'](_0x133f3a);}})[_0x2f97('0x1c')](function(_0x26e851){if(_0x26e851){return _0x26e851?{'count':_0xed8306,'rows':_0x26e851}:null;}})[_0x2f97('0x1c')](respondWithResult(_0x5088d0,null))[_0x2f97('0x25')](handleError(_0x5088d0,null));};exports[_0x2f97('0x55')]=function(_0x2f493e,_0x18d072,_0x56dd5b){if(_0x2f493e[_0x2f97('0x51')]['id']){delete _0x2f493e[_0x2f97('0x51')]['id'];}return db[_0x2f97('0x36')][_0x2f97('0x54')]({'where':{'id':_0x2f493e[_0x2f97('0x52')]['id']}})[_0x2f97('0x1c')](handleEntityNotFound(_0x18d072,null))[_0x2f97('0x1c')](function(_0x5b91f1){if(_0x5b91f1){_0x2f493e[_0x2f97('0x51')][_0x2f97('0x56')]=_0x5b91f1['id'];_0x2f493e['body'][_0x2f97('0x57')]=integrations[_0x2f97('0x58')](_0x2f493e[_0x2f97('0x51')][_0x2f97('0x59')],_0x2f493e[_0x2f97('0x51')]['type']);_0x2f493e[_0x2f97('0x51')][_0x2f97('0x5a')]=integrations[_0x2f97('0x5b')](_0x2f493e[_0x2f97('0x51')][_0x2f97('0x59')],_0x2f493e[_0x2f97('0x51')]['type']);return db[_0x2f97('0x5c')][_0x2f97('0x50')](_0x2f493e[_0x2f97('0x51')],{'include':[{'model':db[_0x2f97('0x5d')],'as':'Subjects'},{'model':db[_0x2f97('0x5d')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x18d072,null))[_0x2f97('0x25')](handleError(_0x18d072,null));};function getAccessToken(_0x97f9b9){return new Promise(function(_0x9e32ed,_0x38ad3b){var _0x524ed9;switch(_0x97f9b9[_0x2f97('0x5e')]){case'US':_0x524ed9=_0x2f97('0x5f');break;case'AU':_0x524ed9=_0x2f97('0x60');break;case'EU':_0x524ed9=_0x2f97('0x61');break;case'IN':_0x524ed9=_0x2f97('0x62');break;case'CN':_0x524ed9=_0x2f97('0x63');break;default:_0x524ed9=_0x2f97('0x61');break;}var _0x44ecb8={'method':'POST','uri':_0x524ed9+'/oauth/v2/token','qs':{'refresh_token':_0x97f9b9['refreshToken'],'client_id':_0x97f9b9['clientId'],'client_secret':_0x97f9b9[_0x2f97('0x64')],'grant_type':_0x2f97('0x65')},'json':!![]};return rp(_0x44ecb8)[_0x2f97('0x1c')](function(_0x384653){if(_0x384653[_0x2f97('0x66')]){_0x9e32ed(_0x384653[_0x2f97('0x66')]);}else{_0x38ad3b(_0x2f97('0x67'));}})[_0x2f97('0x25')](function(_0x2e2711){_0x38ad3b(_0x2e2711);});});}exports['getFields']=function(_0x15ef7c,_0xd12a33,_0x1966e0){var _0x2ec875,_0x2845e5,_0x22da69,_0x5236a9,_0x8dfbb3;return db['ZohoAccount']['findOne']({'where':{'id':_0x15ef7c['params']['id']},'attributes':['id',_0x2f97('0x68'),'zone',_0x2f97('0x69'),_0x2f97('0x64'),_0x2f97('0x6a'),_0x2f97('0x21'),'refreshToken']})['then'](handleEntityNotFound(_0xd12a33,null))[_0x2f97('0x1c')](function(_0x4932f2){_0x8dfbb3=_0x4932f2;_0x2ec875=_0x8dfbb3[_0x2f97('0x68')];_0x2845e5=_0x2ec875==='zoho.eu'?'eu':_0x2f97('0x6b');_0x22da69=_0x8dfbb3['serverUrl'];var _0x517238=_0x22da69[_0x2f97('0x6c')](-0x1);if(_0x517238==='/'||_0x517238==='\x5c'||_0x517238===':'){_0x22da69=_0x22da69[_0x2f97('0x6d')](0x0,_0x22da69[_0x2f97('0x6e')](_0x517238));}if(!_0x8dfbb3[_0x2f97('0x6f')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x8dfbb3);})[_0x2f97('0x1c')](function(_0x5c6814){if(_0x5c6814){return rp({'method':_0x2f97('0x70'),'uri':util[_0x2f97('0x71')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x2845e5),'qs':{'module':_0x2f97('0x72')},'headers':{'Authorization':_0x2f97('0x73')+_0x5c6814},'json':!![]});}})[_0x2f97('0x1c')](function(_0x4d5eb5){if(_0x4d5eb5){if(_0x4d5eb5['response']&&_0x4d5eb5[_0x2f97('0x74')][_0x2f97('0x20')]){throw new Error(_0x4d5eb5[_0x2f97('0x74')][_0x2f97('0x20')][_0x2f97('0x22')]);}var _0x3373b6=[];var _0xa02eae=[];var _0x2638d8=[_0x2f97('0x75'),_0x2f97('0x76'),'Description',_0x2f97('0x77'),'Call_Duration',_0x2f97('0x78'),_0x2f97('0x79'),'Call_Type'];_0xa02eae=_['remove'](_0x4d5eb5[_0x2f97('0x3f')],function(_0x20f27a){return _0x2638d8[_0x2f97('0x7a')](_0x20f27a[_0x2f97('0x7b')]);});for(var _0x49f075=0x0;_0x49f075<_0xa02eae[_0x2f97('0x40')];_0x49f075++){if(_0xa02eae[_0x49f075][_0x2f97('0x7c')]===![]){_0x3373b6[_0x2f97('0x7d')]({'id':_0xa02eae[_0x49f075]['id'],'name':_0xa02eae[_0x49f075][_0x2f97('0x7e')],'custom':_0xa02eae[_0x49f075][_0x2f97('0x7f')],'options':_0xa02eae[_0x49f075][_0x2f97('0x80')]==='picklist'&&_0xa02eae[_0x49f075]['pick_list_values'][_0x2f97('0x40')]>-0x1?_[_0x2f97('0x35')](_0xa02eae[_0x49f075]['pick_list_values'],function(_0x17ae65){return{'name':_0x17ae65,'value':_0x17ae65};}):[]});}}return{'count':_0x3373b6[_0x2f97('0x40')],'rows':_0x3373b6};}else{return{'count':0x0,'rows':[]};}})[_0x2f97('0x1c')](respondWithResult(_0xd12a33,null))[_0x2f97('0x25')](function(_0x2d0c31){var _0x2c3199=_0x15ef7c[_0x2f97('0x3b')][_0x2f97('0x81')]?0x1f4:_0x2d0c31['statusCode']||0x1f4;logger[_0x2f97('0x20')]('getFields,\x20%s,\x20%s,\x20%s',_0x2f97('0x82'),_0x2c3199,JSON[_0x2f97('0x83')](_0x2d0c31));delete _0x2d0c31[_0x2f97('0x32')];if(_0x2c3199===0x191){_0x2c3199=0x190;}_0xd12a33['status'](_0x2c3199)[_0x2f97('0x33')](_0x15ef7c[_0x2f97('0x3b')][_0x2f97('0x81')]?{'message':_0x2f97('0x84'),'statusCode':_0x2d0c31[_0x2f97('0x85')]}:_0x2d0c31);});}; \ No newline at end of file +var _0x152d=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','end','status','json','count','offset','limit','set','apply','reject','save','stack','name','send','index','map','ZohoAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','update','destroy','findOne','ZohoConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','serverUrl','code','host','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','Subject','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x23c1db,_0x3d5f68){var _0x3c4686=function(_0x3fedc9){while(--_0x3fedc9){_0x23c1db['push'](_0x23c1db['shift']());}};_0x3c4686(++_0x3d5f68);}(_0x152d,0x10e));var _0xd152=function(_0x4efc39,_0x335bc2){_0x4efc39=_0x4efc39-0x0;var _0xe8d5eb=_0x152d[_0x4efc39];return _0xe8d5eb;};'use strict';var emlformat=require(_0xd152('0x0'));var rimraf=require(_0xd152('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd152('0x2'));var moment=require(_0xd152('0x3'));var BPromise=require(_0xd152('0x4'));var Mustache=require(_0xd152('0x5'));var util=require(_0xd152('0x6'));var path=require(_0xd152('0x7'));var sox=require(_0xd152('0x8'));var csv=require(_0xd152('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd152('0xa'));var _=require(_0xd152('0xb'));var squel=require(_0xd152('0xc'));var crypto=require(_0xd152('0xd'));var jsforce=require(_0xd152('0xe'));var deskjs=require(_0xd152('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd152('0x10'));var Papa=require(_0xd152('0x11'));var Redis=require(_0xd152('0x12'));var authService=require(_0xd152('0x13'));var qs=require(_0xd152('0x14'));var as=require(_0xd152('0x15'));var hardwareService=require(_0xd152('0x16'));var logger=require(_0xd152('0x17'))('api');var utils=require(_0xd152('0x18'));var config=require(_0xd152('0x19'));var licenseUtil=require(_0xd152('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd152('0x1b'));var jayson=require(_0xd152('0x1c'));var client=jayson[_0xd152('0x1d')][_0xd152('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2516a6,_0x355c63,_0xec45a0,_0x2fafa5){return new BPromise(function(_0x992da4,_0x212765){var _0x9ccde3=_0x2fafa5||client;return _0x9ccde3[_0xd152('0x1f')](_0x2516a6,_0xec45a0)[_0xd152('0x20')](function(_0x49303f){logger[_0xd152('0x21')]('ZohoAccount,\x20%s,\x20%s',_0x355c63,_0xd152('0x22'));logger[_0xd152('0x23')](_0xd152('0x24'),_0x355c63,'request\x20sent',JSON[_0xd152('0x25')](_0x49303f));if(_0x49303f[_0xd152('0x26')]){if(_0x49303f[_0xd152('0x26')]['code']===0x1f4){logger[_0xd152('0x26')](_0xd152('0x27'),_0x355c63,_0x49303f[_0xd152('0x26')][_0xd152('0x28')]);return _0x212765(_0x49303f[_0xd152('0x26')][_0xd152('0x28')]);}logger[_0xd152('0x26')](_0xd152('0x27'),_0x355c63,_0x49303f[_0xd152('0x26')]['message']);return _0x992da4(_0x49303f[_0xd152('0x26')][_0xd152('0x28')]);}else{logger[_0xd152('0x21')](_0xd152('0x27'),_0x355c63,_0xd152('0x22'));_0x992da4(_0x49303f[_0xd152('0x29')][_0xd152('0x28')]);}})[_0xd152('0x2a')](function(_0xbcec23){logger[_0xd152('0x26')]('ZohoAccount,\x20%s,\x20%s',_0x355c63,_0xbcec23);_0x212765(_0xbcec23);});});}function respondWithStatusCode(_0x14689f,_0x514fed){_0x514fed=_0x514fed||0xcc;return function(_0x548cfb){if(_0x548cfb){return _0x14689f['sendStatus'](_0x514fed);}return _0x14689f['status'](_0x514fed)[_0xd152('0x2b')]();};}function respondWithResult(_0x4160e7,_0x3b99be){_0x3b99be=_0x3b99be||0xc8;return function(_0x34468d){if(_0x34468d){return _0x4160e7[_0xd152('0x2c')](_0x3b99be)[_0xd152('0x2d')](_0x34468d);}};}function respondWithFilteredResult(_0x3e42df,_0x212e9c){return function(_0x4cf473){if(_0x4cf473){var _0x10b0c9=_0x4cf473[_0xd152('0x2e')],_0xe0d343=_0x212e9c[_0xd152('0x2f')],_0x1b7c66=_0x212e9c[_0xd152('0x2f')]+_0x212e9c[_0xd152('0x30')],_0x45bdbd;if(_0x1b7c66>=_0x10b0c9){_0x1b7c66=_0x10b0c9;_0x45bdbd=0xc8;}else{_0x45bdbd=0xce;}_0x3e42df[_0xd152('0x2c')](_0x45bdbd);return _0x3e42df[_0xd152('0x31')]('Content-Range',_0xe0d343+'-'+_0x1b7c66+'/'+_0x10b0c9)[_0xd152('0x2d')](_0x4cf473);}return null;};}function patchUpdates(_0x4dd656){return function(_0x12344d){try{jsonpatch[_0xd152('0x32')](_0x12344d,_0x4dd656,!![]);}catch(_0x7c7438){return BPromise[_0xd152('0x33')](_0x7c7438);}return _0x12344d[_0xd152('0x34')]();};}function saveUpdates(_0x2aa0cd,_0x5f2b35){return function(_0xf4a306){if(_0xf4a306){return _0xf4a306['update'](_0x2aa0cd)[_0xd152('0x20')](function(_0x36409d){return _0x36409d;});}return null;};}function removeEntity(_0x27606d,_0x583866){return function(_0x4d91d1){if(_0x4d91d1){return _0x4d91d1['destroy']()[_0xd152('0x20')](function(){_0x27606d[_0xd152('0x2c')](0xcc)[_0xd152('0x2b')]();});}};}function handleEntityNotFound(_0x21e21a,_0x3d6181){return function(_0xc9755b){if(!_0xc9755b){_0x21e21a['sendStatus'](0x194);}return _0xc9755b;};}function handleError(_0x3afff9,_0x55b35f){_0x55b35f=_0x55b35f||0x1f4;return function(_0x43c266){logger['error'](_0x43c266[_0xd152('0x35')]);if(_0x43c266[_0xd152('0x36')]){delete _0x43c266['name'];}_0x3afff9[_0xd152('0x2c')](_0x55b35f)[_0xd152('0x37')](_0x43c266);};}exports[_0xd152('0x38')]=function(_0x9c6007,_0x589de5){var _0x5810c4={},_0x444603={},_0x4c04f1={'count':0x0,'rows':[]};var _0x345049=_[_0xd152('0x39')](db[_0xd152('0x3a')][_0xd152('0x3b')],function(_0x2d20a8){return{'name':_0x2d20a8['fieldName'],'type':_0x2d20a8[_0xd152('0x3c')][_0xd152('0x3d')]};});_0x444603[_0xd152('0x3e')]=_[_0xd152('0x39')](_0x345049,_0xd152('0x36'));_0x444603[_0xd152('0x3f')]=_[_0xd152('0x40')](_0x9c6007[_0xd152('0x3f')]);_0x444603['filters']=_[_0xd152('0x41')](_0x444603['model'],_0x444603[_0xd152('0x3f')]);_0x5810c4[_0xd152('0x42')]=_[_0xd152('0x41')](_0x444603[_0xd152('0x3e')],qs[_0xd152('0x43')](_0x9c6007[_0xd152('0x3f')][_0xd152('0x43')]));_0x5810c4[_0xd152('0x42')]=_0x5810c4['attributes'][_0xd152('0x44')]?_0x5810c4[_0xd152('0x42')]:_0x444603[_0xd152('0x3e')];if(!_0x9c6007['query']['hasOwnProperty'](_0xd152('0x45'))){_0x5810c4['limit']=qs[_0xd152('0x30')](_0x9c6007[_0xd152('0x3f')][_0xd152('0x30')]);_0x5810c4[_0xd152('0x2f')]=qs[_0xd152('0x2f')](_0x9c6007[_0xd152('0x3f')]['offset']);}_0x5810c4[_0xd152('0x46')]=qs[_0xd152('0x47')](_0x9c6007['query'][_0xd152('0x47')]);_0x5810c4['where']=qs[_0xd152('0x48')](_[_0xd152('0x49')](_0x9c6007[_0xd152('0x3f')],_0x444603[_0xd152('0x48')]),_0x345049);if(_0x9c6007[_0xd152('0x3f')][_0xd152('0x4a')]){_0x5810c4['where']=_['merge'](_0x5810c4[_0xd152('0x4b')],{'$or':_[_0xd152('0x39')](_0x345049,function(_0x19d611){if(_0x19d611[_0xd152('0x3c')]!==_0xd152('0x4c')){var _0x4f27c3={};_0x4f27c3[_0x19d611[_0xd152('0x36')]]={'$like':'%'+_0x9c6007[_0xd152('0x3f')][_0xd152('0x4a')]+'%'};return _0x4f27c3;}})});}_0x5810c4=_[_0xd152('0x4d')]({},_0x5810c4,_0x9c6007[_0xd152('0x4e')]);var _0x12680c={'where':_0x5810c4['where']};return db[_0xd152('0x3a')][_0xd152('0x2e')](_0x12680c)[_0xd152('0x20')](function(_0xd70f6e){_0x4c04f1[_0xd152('0x2e')]=_0xd70f6e;if(_0x9c6007['query'][_0xd152('0x4f')]){_0x5810c4[_0xd152('0x50')]=[{'all':!![]}];}return db[_0xd152('0x3a')][_0xd152('0x51')](_0x5810c4);})[_0xd152('0x20')](function(_0x1c3e35){_0x4c04f1[_0xd152('0x52')]=_0x1c3e35;return _0x4c04f1;})[_0xd152('0x20')](respondWithFilteredResult(_0x589de5,_0x5810c4))[_0xd152('0x2a')](handleError(_0x589de5,null));};exports[_0xd152('0x53')]=function(_0x5056cb,_0x16f843){var _0x496b7c={'raw':![],'where':{'id':_0x5056cb[_0xd152('0x54')]['id']}},_0x3a6df6={};_0x3a6df6[_0xd152('0x3e')]=_[_0xd152('0x40')](db['ZohoAccount'][_0xd152('0x3b')]);_0x3a6df6['query']=_[_0xd152('0x40')](_0x5056cb[_0xd152('0x3f')]);_0x3a6df6['filters']=_[_0xd152('0x41')](_0x3a6df6[_0xd152('0x3e')],_0x3a6df6[_0xd152('0x3f')]);_0x496b7c[_0xd152('0x42')]=_[_0xd152('0x41')](_0x3a6df6['model'],qs[_0xd152('0x43')](_0x5056cb[_0xd152('0x3f')][_0xd152('0x43')]));_0x496b7c[_0xd152('0x42')]=_0x496b7c[_0xd152('0x42')]['length']?_0x496b7c[_0xd152('0x42')]:_0x3a6df6[_0xd152('0x3e')];if(_0x5056cb[_0xd152('0x3f')][_0xd152('0x4f')]){_0x496b7c[_0xd152('0x50')]=[{'all':!![]}];}_0x496b7c=_['merge']({},_0x496b7c,_0x5056cb[_0xd152('0x4e')]);return db[_0xd152('0x3a')][_0xd152('0x55')](_0x496b7c)[_0xd152('0x20')](handleEntityNotFound(_0x16f843,null))['then'](respondWithResult(_0x16f843,null))[_0xd152('0x2a')](handleError(_0x16f843,null));};exports[_0xd152('0x56')]=function(_0x36a603,_0xd3a64d){return db['ZohoAccount']['create'](_0x36a603[_0xd152('0x57')],{})[_0xd152('0x20')](respondWithResult(_0xd3a64d,0xc9))[_0xd152('0x2a')](handleError(_0xd3a64d,null));};exports[_0xd152('0x58')]=function(_0x51a67f,_0x4f5566){if(_0x51a67f[_0xd152('0x57')]['id']){delete _0x51a67f[_0xd152('0x57')]['id'];}return db['ZohoAccount'][_0xd152('0x55')]({'where':{'id':_0x51a67f[_0xd152('0x54')]['id']}})[_0xd152('0x20')](handleEntityNotFound(_0x4f5566,null))['then'](saveUpdates(_0x51a67f[_0xd152('0x57')],null))[_0xd152('0x20')](respondWithResult(_0x4f5566,null))[_0xd152('0x2a')](handleError(_0x4f5566,null));};exports[_0xd152('0x59')]=function(_0x412aac,_0x2fea51){return db[_0xd152('0x3a')][_0xd152('0x55')]({'where':{'id':_0x412aac[_0xd152('0x54')]['id']}})[_0xd152('0x20')](handleEntityNotFound(_0x2fea51,null))[_0xd152('0x20')](removeEntity(_0x2fea51,null))[_0xd152('0x2a')](handleError(_0x2fea51,null));};exports['getConfigurations']=function(_0x4d6f08,_0x344914,_0x34a071){var _0x36e7df={};var _0x2d3fdb={};var _0x19c793;var _0x2e9e79;return db[_0xd152('0x3a')][_0xd152('0x5a')]({'where':{'id':_0x4d6f08[_0xd152('0x54')]['id']}})[_0xd152('0x20')](handleEntityNotFound(_0x344914,null))[_0xd152('0x20')](function(_0x234230){if(_0x234230){_0x19c793=_0x234230;_0x2d3fdb[_0xd152('0x3e')]=_[_0xd152('0x40')](db[_0xd152('0x5b')][_0xd152('0x3b')]);_0x2d3fdb['query']=_[_0xd152('0x40')](_0x4d6f08[_0xd152('0x3f')]);_0x2d3fdb[_0xd152('0x48')]=_[_0xd152('0x41')](_0x2d3fdb[_0xd152('0x3e')],_0x2d3fdb[_0xd152('0x3f')]);_0x36e7df[_0xd152('0x42')]=_['intersection'](_0x2d3fdb[_0xd152('0x3e')],qs[_0xd152('0x43')](_0x4d6f08[_0xd152('0x3f')]['fields']));_0x36e7df['attributes']=_0x36e7df[_0xd152('0x42')][_0xd152('0x44')]?_0x36e7df['attributes']:_0x2d3fdb['model'];_0x36e7df[_0xd152('0x46')]=qs[_0xd152('0x47')](_0x4d6f08[_0xd152('0x3f')][_0xd152('0x47')]);_0x36e7df['where']=qs[_0xd152('0x48')](_['pick'](_0x4d6f08[_0xd152('0x3f')],_0x2d3fdb[_0xd152('0x48')]));if(_0x4d6f08[_0xd152('0x3f')][_0xd152('0x4a')]){_0x36e7df[_0xd152('0x4b')]=_[_0xd152('0x4d')](_0x36e7df[_0xd152('0x4b')],{'$or':_[_0xd152('0x39')](_0x36e7df[_0xd152('0x42')],function(_0x1eecf1){var _0x2de56e={};_0x2de56e[_0x1eecf1]={'$like':'%'+_0x4d6f08[_0xd152('0x3f')]['filter']+'%'};return _0x2de56e;})});}_0x36e7df=_[_0xd152('0x4d')]({},_0x36e7df,_0x4d6f08[_0xd152('0x4e')]);return _0x19c793[_0xd152('0x5c')](_0x36e7df);}})[_0xd152('0x20')](function(_0x1b956d){if(_0x1b956d){_0x2e9e79=_0x1b956d[_0xd152('0x44')];if(!_0x4d6f08['query'][_0xd152('0x5d')](_0xd152('0x45'))){_0x36e7df['limit']=qs['limit'](_0x4d6f08['query']['limit']);_0x36e7df[_0xd152('0x2f')]=qs[_0xd152('0x2f')](_0x4d6f08[_0xd152('0x3f')]['offset']);}return _0x19c793[_0xd152('0x5c')](_0x36e7df);}})[_0xd152('0x20')](function(_0x26334b){if(_0x26334b){return _0x26334b?{'count':_0x2e9e79,'rows':_0x26334b}:null;}})[_0xd152('0x20')](respondWithResult(_0x344914,null))[_0xd152('0x2a')](handleError(_0x344914,null));};exports[_0xd152('0x5e')]=function(_0x42b588,_0x41814a,_0x3dec0c){if(_0x42b588[_0xd152('0x57')]['id']){delete _0x42b588[_0xd152('0x57')]['id'];}return db[_0xd152('0x3a')][_0xd152('0x5a')]({'where':{'id':_0x42b588[_0xd152('0x54')]['id']}})[_0xd152('0x20')](handleEntityNotFound(_0x41814a,null))['then'](function(_0x2abd31){if(_0x2abd31){_0x42b588[_0xd152('0x57')][_0xd152('0x5f')]=_0x2abd31['id'];_0x42b588['body'][_0xd152('0x60')]=integrations[_0xd152('0x61')](_0x42b588[_0xd152('0x57')][_0xd152('0x62')],_0x42b588['body']['type']);_0x42b588['body'][_0xd152('0x63')]=integrations[_0xd152('0x64')](_0x42b588['body']['channel'],_0x42b588[_0xd152('0x57')][_0xd152('0x3c')]);return db[_0xd152('0x5b')][_0xd152('0x56')](_0x42b588['body'],{'include':[{'model':db[_0xd152('0x65')],'as':_0xd152('0x60')},{'model':db[_0xd152('0x65')],'as':_0xd152('0x63')}]});}return null;})['then'](respondWithResult(_0x41814a,null))['catch'](handleError(_0x41814a,null));};function getAccessToken(_0x22effe){return new Promise(function(_0x468590,_0x255a3f){var _0x361a8c;switch(_0x22effe[_0xd152('0x66')]){case'US':_0x361a8c=_0xd152('0x67');break;case'AU':_0x361a8c=_0xd152('0x68');break;case'EU':_0x361a8c=_0xd152('0x69');break;case'IN':_0x361a8c=_0xd152('0x6a');break;case'CN':_0x361a8c=_0xd152('0x6b');break;default:_0x361a8c=_0xd152('0x69');break;}var _0x1c5384={'method':'POST','uri':_0x361a8c+'/oauth/v2/token','qs':{'refresh_token':_0x22effe[_0xd152('0x6c')],'client_id':_0x22effe[_0xd152('0x6d')],'client_secret':_0x22effe[_0xd152('0x6e')],'grant_type':_0xd152('0x6f')},'json':!![]};return rp(_0x1c5384)[_0xd152('0x20')](function(_0x4801a5){if(_0x4801a5[_0xd152('0x70')]){_0x468590(_0x4801a5[_0xd152('0x70')]);}else{_0x255a3f('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0xf014c2){_0x255a3f(_0xf014c2);});});}exports[_0xd152('0x71')]=function(_0x1e5bfa,_0x552795,_0x3766c9){var _0x487885,_0x91670,_0x4f4d48,_0x27a64d,_0x3d7934;return db[_0xd152('0x3a')]['findOne']({'where':{'id':_0x1e5bfa[_0xd152('0x54')]['id']},'attributes':['id','host','zone',_0xd152('0x6d'),_0xd152('0x6e'),_0xd152('0x72'),_0xd152('0x73'),_0xd152('0x6c')]})[_0xd152('0x20')](handleEntityNotFound(_0x552795,null))[_0xd152('0x20')](function(_0x3a95f4){_0x3d7934=_0x3a95f4;_0x487885=_0x3d7934[_0xd152('0x74')];_0x91670=_0x487885==='zoho.eu'?'eu':_0xd152('0x75');_0x4f4d48=_0x3d7934[_0xd152('0x72')];var _0x2d565a=_0x4f4d48[_0xd152('0x76')](-0x1);if(_0x2d565a==='/'||_0x2d565a==='\x5c'||_0x2d565a===':'){_0x4f4d48=_0x4f4d48[_0xd152('0x77')](0x0,_0x4f4d48[_0xd152('0x78')](_0x2d565a));}if(!_0x3d7934[_0xd152('0x6c')]){throw new Error(_0xd152('0x79'));}return getAccessToken(_0x3d7934);})[_0xd152('0x20')](function(_0x2bb6c2){if(_0x2bb6c2){return rp({'method':_0xd152('0x7a'),'uri':util[_0xd152('0x7b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x91670),'qs':{'module':_0xd152('0x7c')},'headers':{'Authorization':_0xd152('0x7d')+_0x2bb6c2},'json':!![]});}})[_0xd152('0x20')](function(_0x46c4af){if(_0x46c4af){if(_0x46c4af['response']&&_0x46c4af[_0xd152('0x7e')][_0xd152('0x26')]){throw new Error(_0x46c4af['response']['error'][_0xd152('0x28')]);}var _0x616a1=[];var _0x4732bb=[];var _0x4002da=['Owner',_0xd152('0x7f'),'Description',_0xd152('0x80'),_0xd152('0x81'),'Call_Result',_0xd152('0x82'),_0xd152('0x83')];_0x4732bb=_[_0xd152('0x84')](_0x46c4af[_0xd152('0x43')],function(_0x17b936){return _0x4002da['includes'](_0x17b936[_0xd152('0x85')]);});for(var _0x7447d9=0x0;_0x7447d9<_0x4732bb['length'];_0x7447d9++){if(_0x4732bb[_0x7447d9][_0xd152('0x86')]===![]){_0x616a1[_0xd152('0x87')]({'id':_0x4732bb[_0x7447d9]['id'],'name':_0x4732bb[_0x7447d9][_0xd152('0x88')],'custom':_0x4732bb[_0x7447d9][_0xd152('0x89')],'options':_0x4732bb[_0x7447d9][_0xd152('0x8a')]===_0xd152('0x8b')&&_0x4732bb[_0x7447d9][_0xd152('0x8c')][_0xd152('0x44')]>-0x1?_['map'](_0x4732bb[_0x7447d9][_0xd152('0x8c')],function(_0x1f276e){return{'name':_0x1f276e,'value':_0x1f276e};}):[]});}}return{'count':_0x616a1[_0xd152('0x44')],'rows':_0x616a1};}else{return{'count':0x0,'rows':[]};}})[_0xd152('0x20')](respondWithResult(_0x552795,null))[_0xd152('0x2a')](function(_0x39524a){var _0x39c57c=_0x1e5bfa['query'][_0xd152('0x8d')]?0x1f4:_0x39524a[_0xd152('0x8e')]||0x1f4;logger['error'](_0xd152('0x8f'),_0xd152('0x71'),_0x39c57c,JSON['stringify'](_0x39524a));delete _0x39524a['name'];if(_0x39c57c===0x191){_0x39c57c=0x190;}_0x552795[_0xd152('0x2c')](_0x39c57c)['send'](_0x1e5bfa['query'][_0xd152('0x8d')]?{'message':'Wrong\x20credentials','statusCode':_0x39524a[_0xd152('0x8e')]}:_0x39524a);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index d05e6e1..bd81504 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 _0x318a=['ZohoAccount','int_zoho_accounts','changed','clientId','code','host','serverUrl','slice','substring','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','zone','lastIndexOf','https://accounts.zoho.com','refresh_token','catch','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x7992c1,_0x43bd8f){var _0x193b10=function(_0x4826b9){while(--_0x4826b9){_0x7992c1['push'](_0x7992c1['shift']());}};_0x193b10(++_0x43bd8f);}(_0x318a,0x199));var _0xa318=function(_0x503c2d,_0x20e920){_0x503c2d=_0x503c2d-0x0;var _0x196169=_0x318a[_0x503c2d];return _0x196169;};'use strict';var _=require(_0xa318('0x0'));var util=require(_0xa318('0x1'));var logger=require(_0xa318('0x2'))(_0xa318('0x3'));var moment=require('moment');var BPromise=require(_0xa318('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa318('0x5'));var rimraf=require(_0xa318('0x6'));var config=require(_0xa318('0x7'));var attributes=require(_0xa318('0x8'));var integrations=require(_0xa318('0x9'));module[_0xa318('0xa')]=function(_0x1d6f63,_0x1ef1fb){return _0x1d6f63['define'](_0xa318('0xb'),attributes,{'tableName':_0xa318('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3c7ab8,_0x511ff3,_0x3349a6){if(_0x3c7ab8[_0xa318('0xd')]('zone')||_0x3c7ab8[_0xa318('0xd')]('serverUrl')||_0x3c7ab8[_0xa318('0xd')](_0xa318('0xe'))||_0x3c7ab8[_0xa318('0xd')]('clientSecret')||_0x3c7ab8[_0xa318('0xd')](_0xa318('0xf'))||_0x3c7ab8[_0xa318('0xd')](_0xa318('0x10'))){var _0x164848,_0x31de04;_0x164848=_0x3c7ab8[_0xa318('0x11')];var _0xb0b093=_0x164848[_0xa318('0x12')](-0x1);if(_0xb0b093==='/'||_0xb0b093==='\x5c'||_0xb0b093===':'){_0x164848=_0x164848[_0xa318('0x13')](0x0,_0x164848['lastIndexOf'](_0xb0b093));}switch(_0x3c7ab8['zone']){case'US':_0x31de04='https://accounts.zoho.com';break;case'AU':_0x31de04='https://accounts.zoho.com.au';break;case'IN':_0x31de04=_0xa318('0x14');break;case'CN':_0x31de04=_0xa318('0x15');break;default:_0x31de04=_0xa318('0x16');break;}var _0x4484d3={'method':_0xa318('0x17'),'uri':_0x31de04+_0xa318('0x18'),'form':{'grant_type':_0xa318('0x19'),'client_id':_0x3c7ab8[_0xa318('0xe')],'client_secret':_0x3c7ab8[_0xa318('0x1a')],'redirect_uri':_0x3c7ab8[_0xa318('0x11')],'code':_0x3c7ab8[_0xa318('0xf')]},'headers':{'Content-Type':_0xa318('0x1b')}};return rp(_0x4484d3)[_0xa318('0x1c')](function(_0x4ff86b){var _0x5e3f5e=JSON[_0xa318('0x1d')](_0x4ff86b);if(_0x5e3f5e['refresh_token']){_0x3c7ab8[_0xa318('0x1e')]=_0x5e3f5e['refresh_token'];logger[_0xa318('0x1f')](util[_0xa318('0x20')](_0xa318('0x21'),_0x3c7ab8['name'],_0x3c7ab8['id']));}else{logger[_0xa318('0x22')](util[_0xa318('0x20')](_0xa318('0x23'),_0x3c7ab8[_0xa318('0x24')],_0x3c7ab8['id']),util['inspect'](_0x5e3f5e,{'showHidden':![],'depth':null}));}return _0x3349a6(null,_0x511ff3);})['catch'](function(_0x4805a2){logger['error'](util[_0xa318('0x20')](_0xa318('0x23'),_0x3c7ab8[_0xa318('0x24')],_0x3c7ab8['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x3349a6(_0x4805a2);});}else{return _0x3349a6(null,_0x511ff3);}},'beforeUpdate':function(_0x2ef735,_0x3e22d3,_0x495dec){if(_0x2ef735[_0xa318('0xd')](_0xa318('0x25'))||_0x2ef735[_0xa318('0xd')](_0xa318('0x11'))||_0x2ef735[_0xa318('0xd')](_0xa318('0xe'))||_0x2ef735['changed'](_0xa318('0x1a'))||_0x2ef735[_0xa318('0xd')](_0xa318('0xf'))||_0x2ef735[_0xa318('0xd')]('host')){var _0x1fd4d4,_0x5bab54;_0x1fd4d4=_0x2ef735[_0xa318('0x11')];var _0x30be61=_0x1fd4d4['slice'](-0x1);if(_0x30be61==='/'||_0x30be61==='\x5c'||_0x30be61===':'){_0x1fd4d4=_0x1fd4d4[_0xa318('0x13')](0x0,_0x1fd4d4[_0xa318('0x26')](_0x30be61));}switch(_0x2ef735[_0xa318('0x25')]){case'US':_0x5bab54=_0xa318('0x27');break;case'AU':_0x5bab54='https://accounts.zoho.com.au';break;case'IN':_0x5bab54=_0xa318('0x14');break;case'CN':_0x5bab54='https://accounts.zoho.com.cn';break;default:_0x5bab54=_0xa318('0x16');break;}var _0x5d3edd={'method':_0xa318('0x17'),'uri':_0x5bab54+_0xa318('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x2ef735['clientId'],'client_secret':_0x2ef735['clientSecret'],'redirect_uri':_0x2ef735[_0xa318('0x11')],'code':_0x2ef735[_0xa318('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5d3edd)[_0xa318('0x1c')](function(_0x4ba184){var _0x23d3ec=JSON[_0xa318('0x1d')](_0x4ba184);if(_0x23d3ec[_0xa318('0x28')]){_0x2ef735[_0xa318('0x1e')]=_0x23d3ec[_0xa318('0x28')];logger[_0xa318('0x1f')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2ef735[_0xa318('0x24')],_0x2ef735['id']));}else{logger[_0xa318('0x22')](util[_0xa318('0x20')](_0xa318('0x23'),_0x2ef735[_0xa318('0x24')],_0x2ef735['id']),util['inspect'](_0x23d3ec,{'showHidden':![],'depth':null}));}return _0x495dec(null,_0x3e22d3);})[_0xa318('0x29')](function(_0x420eeb){logger['error'](util[_0xa318('0x20')](_0xa318('0x23'),_0x2ef735[_0xa318('0x24')],_0x2ef735['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x495dec(_0x420eeb);});}else{return _0x495dec(null,_0x3e22d3);}}}});}; \ No newline at end of file +var _0xaf8a=['https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','slice','https://accounts.zoho.in','/oauth/v2/token','authorization_code','parse','error','lodash','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','int_zoho_accounts','zone','changed','serverUrl','clientId','clientSecret','code','host','substring','lastIndexOf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaf8a,0x190));var _0xaaf8=function(_0xeb17cc,_0x40c096){_0xeb17cc=_0xeb17cc-0x0;var _0x3b9ae3=_0xaf8a[_0xeb17cc];return _0x3b9ae3;};'use strict';var _=require(_0xaaf8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xaaf8('0x1'));var rp=require(_0xaaf8('0x2'));var fs=require('fs');var path=require(_0xaaf8('0x3'));var rimraf=require('rimraf');var config=require(_0xaaf8('0x4'));var attributes=require(_0xaaf8('0x5'));var integrations=require(_0xaaf8('0x6'));module[_0xaaf8('0x7')]=function(_0x5d1293,_0xcec73){return _0x5d1293['define']('ZohoAccount',attributes,{'tableName':_0xaaf8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x6e7159,_0x687b93,_0x1d7670){if(_0x6e7159['changed'](_0xaaf8('0x9'))||_0x6e7159[_0xaaf8('0xa')](_0xaaf8('0xb'))||_0x6e7159[_0xaaf8('0xa')](_0xaaf8('0xc'))||_0x6e7159[_0xaaf8('0xa')](_0xaaf8('0xd'))||_0x6e7159[_0xaaf8('0xa')](_0xaaf8('0xe'))||_0x6e7159[_0xaaf8('0xa')](_0xaaf8('0xf'))){var _0x49b530,_0x346735;_0x49b530=_0x6e7159[_0xaaf8('0xb')];var _0x489305=_0x49b530['slice'](-0x1);if(_0x489305==='/'||_0x489305==='\x5c'||_0x489305===':'){_0x49b530=_0x49b530[_0xaaf8('0x10')](0x0,_0x49b530[_0xaaf8('0x11')](_0x489305));}switch(_0x6e7159[_0xaaf8('0x9')]){case'US':_0x346735=_0xaaf8('0x12');break;case'AU':_0x346735='https://accounts.zoho.com.au';break;case'IN':_0x346735='https://accounts.zoho.in';break;case'CN':_0x346735=_0xaaf8('0x13');break;default:_0x346735=_0xaaf8('0x14');break;}var _0x13d38e={'method':'POST','uri':_0x346735+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x6e7159[_0xaaf8('0xc')],'client_secret':_0x6e7159[_0xaaf8('0xd')],'redirect_uri':_0x6e7159[_0xaaf8('0xb')],'code':_0x6e7159[_0xaaf8('0xe')]},'headers':{'Content-Type':_0xaaf8('0x15')}};return rp(_0x13d38e)[_0xaaf8('0x16')](function(_0x3707b2){var _0x1a0a57=JSON['parse'](_0x3707b2);if(_0x1a0a57[_0xaaf8('0x17')]){_0x6e7159[_0xaaf8('0x18')]=_0x1a0a57[_0xaaf8('0x17')];logger[_0xaaf8('0x19')](util[_0xaaf8('0x1a')](_0xaaf8('0x1b'),_0x6e7159[_0xaaf8('0x1c')],_0x6e7159['id']));}else{logger['error'](util[_0xaaf8('0x1a')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x6e7159[_0xaaf8('0x1c')],_0x6e7159['id']),util['inspect'](_0x1a0a57,{'showHidden':![],'depth':null}));}return _0x1d7670(null,_0x687b93);})[_0xaaf8('0x1d')](function(_0x1f3802){logger['error'](util[_0xaaf8('0x1a')](_0xaaf8('0x1e'),_0x6e7159['name'],_0x6e7159['id']),util[_0xaaf8('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x1d7670(_0x1f3802);});}else{return _0x1d7670(null,_0x687b93);}},'beforeUpdate':function(_0xbf5def,_0x167de6,_0x3372da){if(_0xbf5def[_0xaaf8('0xa')](_0xaaf8('0x9'))||_0xbf5def['changed'](_0xaaf8('0xb'))||_0xbf5def[_0xaaf8('0xa')](_0xaaf8('0xc'))||_0xbf5def[_0xaaf8('0xa')](_0xaaf8('0xd'))||_0xbf5def['changed']('code')||_0xbf5def[_0xaaf8('0xa')](_0xaaf8('0xf'))){var _0x3b7323,_0x79aef;_0x3b7323=_0xbf5def[_0xaaf8('0xb')];var _0x3dd3e5=_0x3b7323[_0xaaf8('0x20')](-0x1);if(_0x3dd3e5==='/'||_0x3dd3e5==='\x5c'||_0x3dd3e5===':'){_0x3b7323=_0x3b7323[_0xaaf8('0x10')](0x0,_0x3b7323[_0xaaf8('0x11')](_0x3dd3e5));}switch(_0xbf5def[_0xaaf8('0x9')]){case'US':_0x79aef=_0xaaf8('0x12');break;case'AU':_0x79aef='https://accounts.zoho.com.au';break;case'IN':_0x79aef=_0xaaf8('0x21');break;case'CN':_0x79aef=_0xaaf8('0x13');break;default:_0x79aef='https://accounts.zoho.eu';break;}var _0x5e6126={'method':'POST','uri':_0x79aef+_0xaaf8('0x22'),'form':{'grant_type':_0xaaf8('0x23'),'client_id':_0xbf5def[_0xaaf8('0xc')],'client_secret':_0xbf5def[_0xaaf8('0xd')],'redirect_uri':_0xbf5def[_0xaaf8('0xb')],'code':_0xbf5def[_0xaaf8('0xe')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5e6126)[_0xaaf8('0x16')](function(_0x47f3a7){var _0x5cab39=JSON[_0xaaf8('0x24')](_0x47f3a7);if(_0x5cab39[_0xaaf8('0x17')]){_0xbf5def[_0xaaf8('0x18')]=_0x5cab39[_0xaaf8('0x17')];logger['info'](util[_0xaaf8('0x1a')](_0xaaf8('0x1b'),_0xbf5def[_0xaaf8('0x1c')],_0xbf5def['id']));}else{logger[_0xaaf8('0x25')](util[_0xaaf8('0x1a')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xbf5def['name'],_0xbf5def['id']),util[_0xaaf8('0x1f')](_0x5cab39,{'showHidden':![],'depth':null}));}return _0x3372da(null,_0x167de6);})['catch'](function(_0x8e05d8){logger[_0xaaf8('0x25')](util[_0xaaf8('0x1a')](_0xaaf8('0x1e'),_0xbf5def[_0xaaf8('0x1c')],_0xbf5def['id']),util[_0xaaf8('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x3372da(_0x8e05d8);});}else{return _0x3372da(null,_0x167de6);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 8fef505..e531242 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 _0xcd47=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','raw','options','where','limit','include','map','model','attributes','then','ShowZohoAccount','lodash','moment'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xcd47,0x1c5));var _0x7cd4=function(_0x29d4ed,_0x264f8e){_0x29d4ed=_0x29d4ed-0x0;var _0x21a4a6=_0xcd47[_0x29d4ed];return _0x21a4a6;};'use strict';var _=require(_0x7cd4('0x0'));var util=require('util');var moment=require(_0x7cd4('0x1'));var BPromise=require(_0x7cd4('0x2'));var rs=require(_0x7cd4('0x3'));var fs=require('fs');var Redis=require(_0x7cd4('0x4'));var db=require(_0x7cd4('0x5'))['db'];var utils=require(_0x7cd4('0x6'));var logger=require(_0x7cd4('0x7'))(_0x7cd4('0x8'));var config=require(_0x7cd4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7cd4('0xa')][_0x7cd4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19d371,_0x4c9fcf,_0x176e15){return new BPromise(function(_0x195667,_0x3cc9a5){return client['request'](_0x19d371,_0x176e15)['then'](function(_0x351c92){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x4c9fcf,_0x7cd4('0xc'));logger[_0x7cd4('0xd')](_0x7cd4('0xe'),_0x4c9fcf,_0x7cd4('0xc'),JSON[_0x7cd4('0xf')](_0x351c92));if(_0x351c92[_0x7cd4('0x10')]){if(_0x351c92[_0x7cd4('0x10')]['code']===0x1f4){logger[_0x7cd4('0x10')](_0x7cd4('0x11'),_0x4c9fcf,_0x351c92[_0x7cd4('0x10')][_0x7cd4('0x12')]);return _0x3cc9a5(_0x351c92[_0x7cd4('0x10')][_0x7cd4('0x12')]);}logger[_0x7cd4('0x10')](_0x7cd4('0x11'),_0x4c9fcf,_0x351c92[_0x7cd4('0x10')][_0x7cd4('0x12')]);return _0x195667(_0x351c92[_0x7cd4('0x10')][_0x7cd4('0x12')]);}else{logger[_0x7cd4('0x13')](_0x7cd4('0x11'),_0x4c9fcf,_0x7cd4('0xc'));_0x195667(_0x351c92[_0x7cd4('0x14')][_0x7cd4('0x12')]);}})[_0x7cd4('0x15')](function(_0x129a85){logger[_0x7cd4('0x10')](_0x7cd4('0x11'),_0x4c9fcf,_0x129a85);_0x3cc9a5(_0x129a85);});});}exports[_0x7cd4('0x16')]=function(_0x2774d5){var _0x255ec6=this;return new Promise(function(_0xa3898e,_0x1586ca){return db[_0x7cd4('0x17')][_0x7cd4('0x18')]({'raw':_0x2774d5['options']?_0x2774d5['options'][_0x7cd4('0x19')]===undefined?!![]:![]:!![],'where':_0x2774d5[_0x7cd4('0x1a')]?_0x2774d5[_0x7cd4('0x1a')][_0x7cd4('0x1b')]||null:null,'attributes':_0x2774d5[_0x7cd4('0x1a')]?_0x2774d5['options']['attributes']||null:null,'limit':_0x2774d5[_0x7cd4('0x1a')]?_0x2774d5['options'][_0x7cd4('0x1c')]||null:null,'include':_0x2774d5[_0x7cd4('0x1a')]?_0x2774d5[_0x7cd4('0x1a')][_0x7cd4('0x1d')]?_[_0x7cd4('0x1e')](_0x2774d5[_0x7cd4('0x1a')]['include'],function(_0x2f517a){return{'model':db[_0x2f517a[_0x7cd4('0x1f')]],'as':_0x2f517a['as'],'attributes':_0x2f517a[_0x7cd4('0x20')],'include':_0x2f517a[_0x7cd4('0x1d')]?_[_0x7cd4('0x1e')](_0x2f517a[_0x7cd4('0x1d')],function(_0x42bb10){return{'model':db[_0x42bb10[_0x7cd4('0x1f')]],'as':_0x42bb10['as'],'attributes':_0x42bb10[_0x7cd4('0x20')],'include':_0x42bb10['include']?_[_0x7cd4('0x1e')](_0x42bb10[_0x7cd4('0x1d')],function(_0x300a47){return{'model':db[_0x300a47[_0x7cd4('0x1f')]],'as':_0x300a47['as'],'attributes':_0x300a47[_0x7cd4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7cd4('0x21')](function(_0x5e34b0){logger[_0x7cd4('0x13')](_0x7cd4('0x16'),_0x2774d5);logger[_0x7cd4('0xd')](_0x7cd4('0x16'),_0x2774d5,JSON['stringify'](_0x5e34b0));_0xa3898e(_0x5e34b0);})[_0x7cd4('0x15')](function(_0x5ba030){logger[_0x7cd4('0x10')](_0x7cd4('0x16'),_0x5ba030['message'],_0x2774d5);_0x1586ca(_0x255ec6[_0x7cd4('0x10')](0x1f4,_0x5ba030[_0x7cd4('0x12')]));});});};exports[_0x7cd4('0x22')]=function(_0x501f2a){var _0x480400=this;return new Promise(function(_0x51424a,_0x437e4f){return db[_0x7cd4('0x17')]['find']({'raw':_0x501f2a['options']?_0x501f2a[_0x7cd4('0x1a')][_0x7cd4('0x19')]===undefined?!![]:![]:!![],'where':_0x501f2a[_0x7cd4('0x1a')]?_0x501f2a['options'][_0x7cd4('0x1b')]||null:null,'attributes':_0x501f2a['options']?_0x501f2a[_0x7cd4('0x1a')][_0x7cd4('0x20')]||null:null,'include':_0x501f2a[_0x7cd4('0x1a')]?_0x501f2a[_0x7cd4('0x1a')]['include']?_[_0x7cd4('0x1e')](_0x501f2a[_0x7cd4('0x1a')][_0x7cd4('0x1d')],function(_0x24f6ad){return{'model':db[_0x24f6ad['model']],'as':_0x24f6ad['as'],'attributes':_0x24f6ad[_0x7cd4('0x20')],'include':_0x24f6ad[_0x7cd4('0x1d')]?_[_0x7cd4('0x1e')](_0x24f6ad['include'],function(_0x1b6da4){return{'model':db[_0x1b6da4[_0x7cd4('0x1f')]],'as':_0x1b6da4['as'],'attributes':_0x1b6da4[_0x7cd4('0x20')],'include':_0x1b6da4[_0x7cd4('0x1d')]?_[_0x7cd4('0x1e')](_0x1b6da4[_0x7cd4('0x1d')],function(_0x1a04b1){return{'model':db[_0x1a04b1[_0x7cd4('0x1f')]],'as':_0x1a04b1['as'],'attributes':_0x1a04b1[_0x7cd4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7cd4('0x21')](function(_0x18b987){logger['info'](_0x7cd4('0x22'),_0x501f2a);logger[_0x7cd4('0xd')](_0x7cd4('0x22'),_0x501f2a,JSON[_0x7cd4('0xf')](_0x18b987));_0x51424a(_0x18b987);})[_0x7cd4('0x15')](function(_0x349fcb){logger['error'](_0x7cd4('0x22'),_0x349fcb[_0x7cd4('0x12')],_0x501f2a);_0x437e4f(_0x480400[_0x7cd4('0x10')](0x1f4,_0x349fcb[_0x7cd4('0x12')]));});});}; \ No newline at end of file +var _0xc274=['../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','debug','util','randomstring','ioredis','../../mysqldb'];(function(_0x430741,_0x46bcee){var _0x59b1e9=function(_0x52d092){while(--_0x52d092){_0x430741['push'](_0x430741['shift']());}};_0x59b1e9(++_0x46bcee);}(_0xc274,0x151));var _0x4c27=function(_0x35a033,_0x6716d3){_0x35a033=_0x35a033-0x0;var _0x159b48=_0xc274[_0x35a033];return _0x159b48;};'use strict';var _=require('lodash');var util=require(_0x4c27('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4c27('0x1'));var fs=require('fs');var Redis=require(_0x4c27('0x2'));var db=require(_0x4c27('0x3'))['db'];var utils=require(_0x4c27('0x4'));var logger=require(_0x4c27('0x5'))(_0x4c27('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c27('0x7'));var client=jayson['client'][_0x4c27('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18fd2c,_0x38de2d,_0x5f5058){return new BPromise(function(_0x478a91,_0x36daa2){return client['request'](_0x18fd2c,_0x5f5058)[_0x4c27('0x9')](function(_0x2a0c76){logger[_0x4c27('0xa')](_0x4c27('0xb'),_0x38de2d,_0x4c27('0xc'));logger['debug'](_0x4c27('0xd'),_0x38de2d,_0x4c27('0xc'),JSON[_0x4c27('0xe')](_0x2a0c76));if(_0x2a0c76[_0x4c27('0xf')]){if(_0x2a0c76['error']['code']===0x1f4){logger[_0x4c27('0xf')](_0x4c27('0xb'),_0x38de2d,_0x2a0c76['error']['message']);return _0x36daa2(_0x2a0c76[_0x4c27('0xf')][_0x4c27('0x10')]);}logger[_0x4c27('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x38de2d,_0x2a0c76[_0x4c27('0xf')][_0x4c27('0x10')]);return _0x478a91(_0x2a0c76[_0x4c27('0xf')]['message']);}else{logger[_0x4c27('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x38de2d,'request\x20sent');_0x478a91(_0x2a0c76[_0x4c27('0x11')][_0x4c27('0x10')]);}})[_0x4c27('0x12')](function(_0x4762ad){logger['error'](_0x4c27('0xb'),_0x38de2d,_0x4762ad);_0x36daa2(_0x4762ad);});});}exports[_0x4c27('0x13')]=function(_0x4bf2fb){var _0x355fde=this;return new Promise(function(_0x37eb5d,_0x413dcd){return db[_0x4c27('0x14')]['findAll']({'raw':_0x4bf2fb[_0x4c27('0x15')]?_0x4bf2fb[_0x4c27('0x15')][_0x4c27('0x16')]===undefined?!![]:![]:!![],'where':_0x4bf2fb['options']?_0x4bf2fb[_0x4c27('0x15')][_0x4c27('0x17')]||null:null,'attributes':_0x4bf2fb[_0x4c27('0x15')]?_0x4bf2fb[_0x4c27('0x15')][_0x4c27('0x18')]||null:null,'limit':_0x4bf2fb[_0x4c27('0x15')]?_0x4bf2fb[_0x4c27('0x15')][_0x4c27('0x19')]||null:null,'include':_0x4bf2fb[_0x4c27('0x15')]?_0x4bf2fb[_0x4c27('0x15')][_0x4c27('0x1a')]?_[_0x4c27('0x1b')](_0x4bf2fb[_0x4c27('0x15')][_0x4c27('0x1a')],function(_0x35dbd1){return{'model':db[_0x35dbd1[_0x4c27('0x1c')]],'as':_0x35dbd1['as'],'attributes':_0x35dbd1[_0x4c27('0x18')],'include':_0x35dbd1[_0x4c27('0x1a')]?_[_0x4c27('0x1b')](_0x35dbd1[_0x4c27('0x1a')],function(_0x5a769b){return{'model':db[_0x5a769b[_0x4c27('0x1c')]],'as':_0x5a769b['as'],'attributes':_0x5a769b[_0x4c27('0x18')],'include':_0x5a769b[_0x4c27('0x1a')]?_[_0x4c27('0x1b')](_0x5a769b[_0x4c27('0x1a')],function(_0x57bc09){return{'model':db[_0x57bc09[_0x4c27('0x1c')]],'as':_0x57bc09['as'],'attributes':_0x57bc09[_0x4c27('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4c27('0x9')](function(_0x2ed090){logger[_0x4c27('0xa')]('GetZohoAccount',_0x4bf2fb);logger['debug'](_0x4c27('0x13'),_0x4bf2fb,JSON[_0x4c27('0xe')](_0x2ed090));_0x37eb5d(_0x2ed090);})[_0x4c27('0x12')](function(_0x10b935){logger['error']('GetZohoAccount',_0x10b935[_0x4c27('0x10')],_0x4bf2fb);_0x413dcd(_0x355fde[_0x4c27('0xf')](0x1f4,_0x10b935['message']));});});};exports[_0x4c27('0x1d')]=function(_0x1753ab){var _0x21f8e9=this;return new Promise(function(_0xc219a4,_0x5c0b24){return db[_0x4c27('0x14')]['find']({'raw':_0x1753ab[_0x4c27('0x15')]?_0x1753ab[_0x4c27('0x15')][_0x4c27('0x16')]===undefined?!![]:![]:!![],'where':_0x1753ab[_0x4c27('0x15')]?_0x1753ab['options'][_0x4c27('0x17')]||null:null,'attributes':_0x1753ab[_0x4c27('0x15')]?_0x1753ab[_0x4c27('0x15')]['attributes']||null:null,'include':_0x1753ab[_0x4c27('0x15')]?_0x1753ab[_0x4c27('0x15')][_0x4c27('0x1a')]?_[_0x4c27('0x1b')](_0x1753ab[_0x4c27('0x15')][_0x4c27('0x1a')],function(_0x1866bc){return{'model':db[_0x1866bc[_0x4c27('0x1c')]],'as':_0x1866bc['as'],'attributes':_0x1866bc[_0x4c27('0x18')],'include':_0x1866bc[_0x4c27('0x1a')]?_[_0x4c27('0x1b')](_0x1866bc[_0x4c27('0x1a')],function(_0x503fe7){return{'model':db[_0x503fe7[_0x4c27('0x1c')]],'as':_0x503fe7['as'],'attributes':_0x503fe7['attributes'],'include':_0x503fe7[_0x4c27('0x1a')]?_[_0x4c27('0x1b')](_0x503fe7[_0x4c27('0x1a')],function(_0x29c327){return{'model':db[_0x29c327[_0x4c27('0x1c')]],'as':_0x29c327['as'],'attributes':_0x29c327[_0x4c27('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9fcd1b){logger['info'](_0x4c27('0x1d'),_0x1753ab);logger[_0x4c27('0x1e')](_0x4c27('0x1d'),_0x1753ab,JSON[_0x4c27('0xe')](_0x9fcd1b));_0xc219a4(_0x9fcd1b);})[_0x4c27('0x12')](function(_0x492d09){logger[_0x4c27('0xf')](_0x4c27('0x1d'),_0x492d09[_0x4c27('0x10')],_0x1753ab);_0x5c0b24(_0x21f8e9[_0x4c27('0xf')](0x1f4,_0x492d09[_0x4c27('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index a488153..4557401 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 _0xa66a=['./intZohoConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getDescriptions','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa66a,0x116));var _0xaa66=function(_0x108c33,_0x37b05e){_0x108c33=_0x108c33-0x0;var _0x3ff366=_0xa66a[_0x108c33];return _0x3ff366;};'use strict';var multer=require(_0xaa66('0x0'));var util=require(_0xaa66('0x1'));var path=require(_0xaa66('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa66('0x3'));var router=express[_0xaa66('0x4')]();var fs_extra=require(_0xaa66('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaa66('0x6'));var config=require(_0xaa66('0x7'));var controller=require(_0xaa66('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xaa66('0x9')](_0xaa66('0xa'),auth[_0xaa66('0xb')](),controller[_0xaa66('0xc')]);router['get'](_0xaa66('0xd'),auth[_0xaa66('0xb')](),controller[_0xaa66('0xe')]);router[_0xaa66('0x9')](_0xaa66('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xaa66('0x9')]('/:id/descriptions',auth[_0xaa66('0xb')](),controller[_0xaa66('0x10')]);router['post']('/',auth[_0xaa66('0xb')](),controller[_0xaa66('0x11')]);router['put'](_0xaa66('0xa'),auth[_0xaa66('0xb')](),controller[_0xaa66('0x12')]);router[_0xaa66('0x13')](_0xaa66('0xa'),auth['isAuthenticated'](),controller[_0xaa66('0x14')]);module[_0xaa66('0x15')]=router; \ No newline at end of file +var _0x7932=['post','create','put','/:id','update','path','connect-timeout','express','Router','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x31581f,_0x2645ad){var _0x46c1d5=function(_0x435e85){while(--_0x435e85){_0x31581f['push'](_0x31581f['shift']());}};_0x46c1d5(++_0x2645ad);}(_0x7932,0x9d));var _0x2793=function(_0x259f32,_0x2feaa9){_0x259f32=_0x259f32-0x0;var _0x2bf896=_0x7932[_0x259f32];return _0x2bf896;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2793('0x0'));var timeout=require(_0x2793('0x1'));var express=require(_0x2793('0x2'));var router=express[_0x2793('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2793('0x4'));var config=require('../../config/environment');var controller=require(_0x2793('0x5'));router[_0x2793('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2793('0x6')]('/:id',auth[_0x2793('0x7')](),controller['show']);router[_0x2793('0x6')](_0x2793('0x8'),auth['isAuthenticated'](),controller[_0x2793('0x9')]);router[_0x2793('0x6')](_0x2793('0xa'),auth[_0x2793('0x7')](),controller[_0x2793('0xb')]);router['get'](_0x2793('0xc'),auth[_0x2793('0x7')](),controller[_0x2793('0xd')]);router[_0x2793('0xe')]('/',auth[_0x2793('0x7')](),controller[_0x2793('0xf')]);router[_0x2793('0x10')](_0x2793('0x11'),auth[_0x2793('0x7')](),controller[_0x2793('0x12')]);router['delete'](_0x2793('0x11'),auth[_0x2793('0x7')](),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 594794d..3c8c12e 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 _0xb399=['contact','nothing','ENUM','sequelize','exports','STRING','lead'];(function(_0x14c3cd,_0x333a30){var _0xf0c6ce=function(_0x4f4121){while(--_0x4f4121){_0x14c3cd['push'](_0x14c3cd['shift']());}};_0xf0c6ce(++_0x333a30);}(_0xb399,0x1ae));var _0x9b39=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb399[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0x9b39('0x0'));module[_0x9b39('0x1')]={'name':{'type':Sequelize[_0x9b39('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x9b39('0x3'),_0x9b39('0x4'),_0x9b39('0x5')),'defaultValue':_0x9b39('0x3')},'moduleSearch':{'type':Sequelize[_0x9b39('0x6')]('contact_lead',_0x9b39('0x4'),_0x9b39('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3e6a=['contact_lead','sequelize','exports','STRING','ENUM','nothing','lead'];(function(_0x2230d1,_0x48a20f){var _0x3825d1=function(_0x5c9344){while(--_0x5c9344){_0x2230d1['push'](_0x2230d1['shift']());}};_0x3825d1(++_0x48a20f);}(_0x3e6a,0xe1));var _0xa3e6=function(_0x43fc7e,_0xbf8e31){_0x43fc7e=_0x43fc7e-0x0;var _0x5b39a8=_0x3e6a[_0x43fc7e];return _0x5b39a8;};'use strict';var Sequelize=require(_0xa3e6('0x0'));module[_0xa3e6('0x1')]={'name':{'type':Sequelize[_0xa3e6('0x2')]},'moduleCreate':{'type':Sequelize[_0xa3e6('0x3')]('lead','contact',_0xa3e6('0x4')),'defaultValue':_0xa3e6('0x5')},'moduleSearch':{'type':Sequelize[_0xa3e6('0x3')](_0xa3e6('0x6'),'contact',_0xa3e6('0x5')),'defaultValue':_0xa3e6('0x6')},'description':{'type':Sequelize[_0xa3e6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 30898b5..08852dc 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 _0x6e2a=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','json','offset','limit','set','Content-Range','reject','save','update','status','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ZohoConfiguration','count','includeAll','include','findAll','rows','show','params','find','create','body','getFields','findOne','getSubjects','ZohoField','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x49627f,_0x470e77){var _0x4da04c=function(_0x1d02d1){while(--_0x1d02d1){_0x49627f['push'](_0x49627f['shift']());}};_0x4da04c(++_0x470e77);}(_0x6e2a,0xfa));var _0xa6e2=function(_0xd59417,_0x2f2ea7){_0xd59417=_0xd59417-0x0;var _0xcf2e00=_0x6e2a[_0xd59417];return _0xcf2e00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6e2('0x0'));var zipdir=require(_0xa6e2('0x1'));var jsonpatch=require(_0xa6e2('0x2'));var rp=require(_0xa6e2('0x3'));var moment=require(_0xa6e2('0x4'));var BPromise=require(_0xa6e2('0x5'));var Mustache=require('mustache');var util=require(_0xa6e2('0x6'));var path=require(_0xa6e2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6e2('0x8'));var _=require('lodash');var squel=require(_0xa6e2('0x9'));var crypto=require(_0xa6e2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa6e2('0xb'));var toCsv=require(_0xa6e2('0xc'));var querystring=require('querystring');var Papa=require(_0xa6e2('0xd'));var Redis=require('ioredis');var authService=require(_0xa6e2('0xe'));var qs=require(_0xa6e2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6e2('0x10'));var logger=require(_0xa6e2('0x11'))(_0xa6e2('0x12'));var utils=require(_0xa6e2('0x13'));var config=require(_0xa6e2('0x14'));var licenseUtil=require(_0xa6e2('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa6e2('0x16'));var client=jayson['client'][_0xa6e2('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xdfbca4,_0x13c790,_0x3b0024,_0x4870cd){return new BPromise(function(_0x3ae6a6,_0x20ea95){var _0x53dce3=_0x4870cd||client;return _0x53dce3[_0xa6e2('0x18')](_0xdfbca4,_0x3b0024)[_0xa6e2('0x19')](function(_0x2c5dbd){logger[_0xa6e2('0x1a')](_0xa6e2('0x1b'),_0x13c790,_0xa6e2('0x1c'));logger[_0xa6e2('0x1d')](_0xa6e2('0x1e'),_0x13c790,'request\x20sent',JSON[_0xa6e2('0x1f')](_0x2c5dbd));if(_0x2c5dbd[_0xa6e2('0x20')]){if(_0x2c5dbd[_0xa6e2('0x20')]['code']===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x13c790,_0x2c5dbd[_0xa6e2('0x20')][_0xa6e2('0x21')]);return _0x20ea95(_0x2c5dbd[_0xa6e2('0x20')]['message']);}logger[_0xa6e2('0x20')](_0xa6e2('0x1b'),_0x13c790,_0x2c5dbd[_0xa6e2('0x20')][_0xa6e2('0x21')]);return _0x3ae6a6(_0x2c5dbd['error'][_0xa6e2('0x21')]);}else{logger[_0xa6e2('0x1a')](_0xa6e2('0x1b'),_0x13c790,_0xa6e2('0x1c'));_0x3ae6a6(_0x2c5dbd[_0xa6e2('0x22')][_0xa6e2('0x21')]);}})[_0xa6e2('0x23')](function(_0x31ee77){logger[_0xa6e2('0x20')](_0xa6e2('0x1b'),_0x13c790,_0x31ee77);_0x20ea95(_0x31ee77);});});}function respondWithStatusCode(_0xa09158,_0x48783e){_0x48783e=_0x48783e||0xcc;return function(_0x27e4f8){if(_0x27e4f8){return _0xa09158[_0xa6e2('0x24')](_0x48783e);}return _0xa09158['status'](_0x48783e)[_0xa6e2('0x25')]();};}function respondWithResult(_0x2ade3d,_0x2c1e5b){_0x2c1e5b=_0x2c1e5b||0xc8;return function(_0x2383e3){if(_0x2383e3){return _0x2ade3d['status'](_0x2c1e5b)[_0xa6e2('0x26')](_0x2383e3);}};}function respondWithFilteredResult(_0x4ee4d5,_0x2416db){return function(_0x54998c){if(_0x54998c){var _0x433410=_0x54998c['count'],_0x31f044=_0x2416db[_0xa6e2('0x27')],_0x32ff56=_0x2416db[_0xa6e2('0x27')]+_0x2416db[_0xa6e2('0x28')],_0x424576;if(_0x32ff56>=_0x433410){_0x32ff56=_0x433410;_0x424576=0xc8;}else{_0x424576=0xce;}_0x4ee4d5['status'](_0x424576);return _0x4ee4d5[_0xa6e2('0x29')](_0xa6e2('0x2a'),_0x31f044+'-'+_0x32ff56+'/'+_0x433410)['json'](_0x54998c);}return null;};}function patchUpdates(_0x5af20e){return function(_0x44eb2a){try{jsonpatch['apply'](_0x44eb2a,_0x5af20e,!![]);}catch(_0x3be98b){return BPromise[_0xa6e2('0x2b')](_0x3be98b);}return _0x44eb2a[_0xa6e2('0x2c')]();};}function saveUpdates(_0x1ae52d,_0xcb0531){return function(_0xc2a570){if(_0xc2a570){return _0xc2a570[_0xa6e2('0x2d')](_0x1ae52d)[_0xa6e2('0x19')](function(_0x3bff73){return _0x3bff73;});}return null;};}function removeEntity(_0x883bfc,_0x2bac5c){return function(_0xf72cfa){if(_0xf72cfa){return _0xf72cfa['destroy']()['then'](function(){_0x883bfc[_0xa6e2('0x2e')](0xcc)[_0xa6e2('0x25')]();});}};}function handleEntityNotFound(_0x412692,_0x36f975){return function(_0x55a272){if(!_0x55a272){_0x412692[_0xa6e2('0x24')](0x194);}return _0x55a272;};}function handleError(_0x575962,_0x4f9186){_0x4f9186=_0x4f9186||0x1f4;return function(_0x8deaa9){logger[_0xa6e2('0x20')](_0x8deaa9[_0xa6e2('0x2f')]);if(_0x8deaa9[_0xa6e2('0x30')]){delete _0x8deaa9['name'];}_0x575962[_0xa6e2('0x2e')](_0x4f9186)[_0xa6e2('0x31')](_0x8deaa9);};}exports[_0xa6e2('0x32')]=function(_0x26024b,_0x49b0d){var _0x3d731f={},_0x46f934={},_0x47c95a={'count':0x0,'rows':[]};var _0x2cec5c=_[_0xa6e2('0x33')](db['ZohoConfiguration'][_0xa6e2('0x34')],function(_0xe62c50){return{'name':_0xe62c50[_0xa6e2('0x35')],'type':_0xe62c50[_0xa6e2('0x36')][_0xa6e2('0x37')]};});_0x46f934[_0xa6e2('0x38')]=_[_0xa6e2('0x33')](_0x2cec5c,_0xa6e2('0x30'));_0x46f934[_0xa6e2('0x39')]=_[_0xa6e2('0x3a')](_0x26024b[_0xa6e2('0x39')]);_0x46f934[_0xa6e2('0x3b')]=_[_0xa6e2('0x3c')](_0x46f934['model'],_0x46f934[_0xa6e2('0x39')]);_0x3d731f['attributes']=_[_0xa6e2('0x3c')](_0x46f934['model'],qs[_0xa6e2('0x3d')](_0x26024b['query'][_0xa6e2('0x3d')]));_0x3d731f[_0xa6e2('0x3e')]=_0x3d731f[_0xa6e2('0x3e')][_0xa6e2('0x3f')]?_0x3d731f[_0xa6e2('0x3e')]:_0x46f934[_0xa6e2('0x38')];if(!_0x26024b['query'][_0xa6e2('0x40')](_0xa6e2('0x41'))){_0x3d731f[_0xa6e2('0x28')]=qs[_0xa6e2('0x28')](_0x26024b['query']['limit']);_0x3d731f[_0xa6e2('0x27')]=qs[_0xa6e2('0x27')](_0x26024b[_0xa6e2('0x39')][_0xa6e2('0x27')]);}_0x3d731f[_0xa6e2('0x42')]=qs[_0xa6e2('0x43')](_0x26024b[_0xa6e2('0x39')][_0xa6e2('0x43')]);_0x3d731f[_0xa6e2('0x44')]=qs[_0xa6e2('0x3b')](_[_0xa6e2('0x45')](_0x26024b[_0xa6e2('0x39')],_0x46f934['filters']),_0x2cec5c);if(_0x26024b[_0xa6e2('0x39')][_0xa6e2('0x46')]){_0x3d731f[_0xa6e2('0x44')]=_[_0xa6e2('0x47')](_0x3d731f[_0xa6e2('0x44')],{'$or':_['map'](_0x2cec5c,function(_0x306136){if(_0x306136[_0xa6e2('0x36')]!=='VIRTUAL'){var _0x440ace={};_0x440ace[_0x306136[_0xa6e2('0x30')]]={'$like':'%'+_0x26024b[_0xa6e2('0x39')][_0xa6e2('0x46')]+'%'};return _0x440ace;}})});}_0x3d731f=_['merge']({},_0x3d731f,_0x26024b[_0xa6e2('0x48')]);var _0x25adce={'where':_0x3d731f[_0xa6e2('0x44')]};return db[_0xa6e2('0x49')]['count'](_0x25adce)['then'](function(_0x29a82e){_0x47c95a[_0xa6e2('0x4a')]=_0x29a82e;if(_0x26024b[_0xa6e2('0x39')][_0xa6e2('0x4b')]){_0x3d731f[_0xa6e2('0x4c')]=[{'all':!![]}];}return db[_0xa6e2('0x49')][_0xa6e2('0x4d')](_0x3d731f);})[_0xa6e2('0x19')](function(_0x406227){_0x47c95a[_0xa6e2('0x4e')]=_0x406227;return _0x47c95a;})[_0xa6e2('0x19')](respondWithFilteredResult(_0x49b0d,_0x3d731f))[_0xa6e2('0x23')](handleError(_0x49b0d,null));};exports[_0xa6e2('0x4f')]=function(_0x22d305,_0x445682){var _0x404409={'raw':![],'where':{'id':_0x22d305[_0xa6e2('0x50')]['id']}},_0x3ff85b={};_0x3ff85b[_0xa6e2('0x38')]=_['keys'](db['ZohoConfiguration'][_0xa6e2('0x34')]);_0x3ff85b[_0xa6e2('0x39')]=_[_0xa6e2('0x3a')](_0x22d305[_0xa6e2('0x39')]);_0x3ff85b['filters']=_[_0xa6e2('0x3c')](_0x3ff85b[_0xa6e2('0x38')],_0x3ff85b['query']);_0x404409['attributes']=_['intersection'](_0x3ff85b[_0xa6e2('0x38')],qs[_0xa6e2('0x3d')](_0x22d305[_0xa6e2('0x39')]['fields']));_0x404409[_0xa6e2('0x3e')]=_0x404409['attributes'][_0xa6e2('0x3f')]?_0x404409[_0xa6e2('0x3e')]:_0x3ff85b[_0xa6e2('0x38')];if(_0x22d305[_0xa6e2('0x39')][_0xa6e2('0x4b')]){_0x404409['include']=[{'all':!![]}];}_0x404409=_[_0xa6e2('0x47')]({},_0x404409,_0x22d305[_0xa6e2('0x48')]);return db['ZohoConfiguration'][_0xa6e2('0x51')](_0x404409)[_0xa6e2('0x19')](handleEntityNotFound(_0x445682,null))[_0xa6e2('0x19')](respondWithResult(_0x445682,null))[_0xa6e2('0x23')](handleError(_0x445682,null));};exports[_0xa6e2('0x52')]=function(_0xb9a972,_0x2e05f0){return db[_0xa6e2('0x49')][_0xa6e2('0x52')](_0xb9a972[_0xa6e2('0x53')],{})[_0xa6e2('0x19')](respondWithResult(_0x2e05f0,0xc9))['catch'](handleError(_0x2e05f0,null));};exports[_0xa6e2('0x2d')]=function(_0x27b80c,_0x10cdb2){if(_0x27b80c[_0xa6e2('0x53')]['id']){delete _0x27b80c[_0xa6e2('0x53')]['id'];}return db[_0xa6e2('0x49')][_0xa6e2('0x51')]({'where':{'id':_0x27b80c[_0xa6e2('0x50')]['id']}})['then'](handleEntityNotFound(_0x10cdb2,null))[_0xa6e2('0x19')](saveUpdates(_0x27b80c[_0xa6e2('0x53')],null))[_0xa6e2('0x19')](respondWithResult(_0x10cdb2,null))[_0xa6e2('0x23')](handleError(_0x10cdb2,null));};exports['destroy']=function(_0x1e8dfb,_0x5286e9){return db['ZohoConfiguration']['find']({'where':{'id':_0x1e8dfb[_0xa6e2('0x50')]['id']}})[_0xa6e2('0x19')](handleEntityNotFound(_0x5286e9,null))[_0xa6e2('0x19')](removeEntity(_0x5286e9,null))['catch'](handleError(_0x5286e9,null));};exports[_0xa6e2('0x54')]=function(_0x372500,_0x211b27,_0x45fbdb){var _0x2b7da2={};var _0x38240e={};var _0xb7c1e0;var _0x4cab76;return db[_0xa6e2('0x49')][_0xa6e2('0x55')]({'where':{'id':_0x372500[_0xa6e2('0x50')]['id']}})['then'](handleEntityNotFound(_0x211b27,null))[_0xa6e2('0x19')](function(_0x5b946c){if(_0x5b946c){_0xb7c1e0=_0x5b946c;_0x38240e[_0xa6e2('0x38')]=_[_0xa6e2('0x3a')](db['ZohoField'][_0xa6e2('0x34')]);_0x38240e[_0xa6e2('0x39')]=_[_0xa6e2('0x3a')](_0x372500['query']);_0x38240e[_0xa6e2('0x3b')]=_['intersection'](_0x38240e[_0xa6e2('0x38')],_0x38240e[_0xa6e2('0x39')]);_0x2b7da2[_0xa6e2('0x3e')]=_[_0xa6e2('0x3c')](_0x38240e['model'],qs['fields'](_0x372500['query'][_0xa6e2('0x3d')]));_0x2b7da2[_0xa6e2('0x3e')]=_0x2b7da2[_0xa6e2('0x3e')][_0xa6e2('0x3f')]?_0x2b7da2[_0xa6e2('0x3e')]:_0x38240e[_0xa6e2('0x38')];_0x2b7da2['order']=qs[_0xa6e2('0x43')](_0x372500[_0xa6e2('0x39')]['sort']);_0x2b7da2[_0xa6e2('0x44')]=qs[_0xa6e2('0x3b')](_[_0xa6e2('0x45')](_0x372500[_0xa6e2('0x39')],_0x38240e['filters']));if(_0x372500[_0xa6e2('0x39')][_0xa6e2('0x46')]){_0x2b7da2[_0xa6e2('0x44')]=_[_0xa6e2('0x47')](_0x2b7da2[_0xa6e2('0x44')],{'$or':_['map'](_0x2b7da2[_0xa6e2('0x3e')],function(_0x12c144){var _0x2aa491={};_0x2aa491[_0x12c144]={'$like':'%'+_0x372500['query'][_0xa6e2('0x46')]+'%'};return _0x2aa491;})});}_0x2b7da2=_[_0xa6e2('0x47')]({},_0x2b7da2,_0x372500[_0xa6e2('0x48')]);return _0xb7c1e0['getFields'](_0x2b7da2);}})[_0xa6e2('0x19')](function(_0x280c5c){if(_0x280c5c){_0x4cab76=_0x280c5c[_0xa6e2('0x3f')];if(!_0x372500[_0xa6e2('0x39')][_0xa6e2('0x40')](_0xa6e2('0x41'))){_0x2b7da2['limit']=qs['limit'](_0x372500['query'][_0xa6e2('0x28')]);_0x2b7da2[_0xa6e2('0x27')]=qs[_0xa6e2('0x27')](_0x372500[_0xa6e2('0x39')][_0xa6e2('0x27')]);}return _0xb7c1e0[_0xa6e2('0x54')](_0x2b7da2);}})[_0xa6e2('0x19')](function(_0x2a230d){if(_0x2a230d){return _0x2a230d?{'count':_0x4cab76,'rows':_0x2a230d}:null;}})[_0xa6e2('0x19')](respondWithResult(_0x211b27,null))['catch'](handleError(_0x211b27,null));};exports[_0xa6e2('0x56')]=function(_0x5dd60a,_0x124f96,_0x2c1035){var _0x37cf94={};var _0x337fd7={};var _0x523407;var _0x66f086;return db['ZohoConfiguration'][_0xa6e2('0x55')]({'where':{'id':_0x5dd60a[_0xa6e2('0x50')]['id']}})['then'](handleEntityNotFound(_0x124f96,null))['then'](function(_0x3facba){if(_0x3facba){_0x523407=_0x3facba;_0x337fd7[_0xa6e2('0x38')]=_[_0xa6e2('0x3a')](db[_0xa6e2('0x57')][_0xa6e2('0x34')]);_0x337fd7[_0xa6e2('0x39')]=_[_0xa6e2('0x3a')](_0x5dd60a[_0xa6e2('0x39')]);_0x337fd7['filters']=_[_0xa6e2('0x3c')](_0x337fd7[_0xa6e2('0x38')],_0x337fd7['query']);_0x37cf94[_0xa6e2('0x3e')]=_[_0xa6e2('0x3c')](_0x337fd7[_0xa6e2('0x38')],qs['fields'](_0x5dd60a[_0xa6e2('0x39')][_0xa6e2('0x3d')]));_0x37cf94[_0xa6e2('0x3e')]=_0x37cf94[_0xa6e2('0x3e')][_0xa6e2('0x3f')]?_0x37cf94['attributes']:_0x337fd7[_0xa6e2('0x38')];_0x37cf94[_0xa6e2('0x42')]=qs[_0xa6e2('0x43')](_0x5dd60a['query']['sort']);_0x37cf94['where']=qs[_0xa6e2('0x3b')](_[_0xa6e2('0x45')](_0x5dd60a[_0xa6e2('0x39')],_0x337fd7[_0xa6e2('0x3b')]));if(_0x5dd60a[_0xa6e2('0x39')][_0xa6e2('0x46')]){_0x37cf94['where']=_[_0xa6e2('0x47')](_0x37cf94[_0xa6e2('0x44')],{'$or':_[_0xa6e2('0x33')](_0x37cf94[_0xa6e2('0x3e')],function(_0x91043b){var _0x2d49e3={};_0x2d49e3[_0x91043b]={'$like':'%'+_0x5dd60a['query'][_0xa6e2('0x46')]+'%'};return _0x2d49e3;})});}_0x37cf94=_['merge']({},_0x37cf94,_0x5dd60a[_0xa6e2('0x48')]);return _0x523407[_0xa6e2('0x56')](_0x37cf94);}})[_0xa6e2('0x19')](function(_0xe0a285){if(_0xe0a285){_0x66f086=_0xe0a285['length'];if(!_0x5dd60a[_0xa6e2('0x39')][_0xa6e2('0x40')](_0xa6e2('0x41'))){_0x37cf94[_0xa6e2('0x28')]=qs[_0xa6e2('0x28')](_0x5dd60a['query'][_0xa6e2('0x28')]);_0x37cf94[_0xa6e2('0x27')]=qs[_0xa6e2('0x27')](_0x5dd60a[_0xa6e2('0x39')][_0xa6e2('0x27')]);}return _0x523407[_0xa6e2('0x56')](_0x37cf94);}})[_0xa6e2('0x19')](function(_0x3211da){if(_0x3211da){return _0x3211da?{'count':_0x66f086,'rows':_0x3211da}:null;}})[_0xa6e2('0x19')](respondWithResult(_0x124f96,null))['catch'](handleError(_0x124f96,null));};exports['getDescriptions']=function(_0x57bc74,_0x4bae51,_0x13aca1){var _0x32cf5e={};var _0x3fa70b={};var _0x299f63;var _0x296132;return db[_0xa6e2('0x49')]['findOne']({'where':{'id':_0x57bc74[_0xa6e2('0x50')]['id']}})['then'](handleEntityNotFound(_0x4bae51,null))[_0xa6e2('0x19')](function(_0xf28f71){if(_0xf28f71){_0x299f63=_0xf28f71;_0x3fa70b['model']=_[_0xa6e2('0x3a')](db[_0xa6e2('0x57')][_0xa6e2('0x34')]);_0x3fa70b[_0xa6e2('0x39')]=_[_0xa6e2('0x3a')](_0x57bc74[_0xa6e2('0x39')]);_0x3fa70b[_0xa6e2('0x3b')]=_[_0xa6e2('0x3c')](_0x3fa70b[_0xa6e2('0x38')],_0x3fa70b['query']);_0x32cf5e['attributes']=_[_0xa6e2('0x3c')](_0x3fa70b[_0xa6e2('0x38')],qs['fields'](_0x57bc74[_0xa6e2('0x39')][_0xa6e2('0x3d')]));_0x32cf5e[_0xa6e2('0x3e')]=_0x32cf5e[_0xa6e2('0x3e')][_0xa6e2('0x3f')]?_0x32cf5e['attributes']:_0x3fa70b[_0xa6e2('0x38')];_0x32cf5e[_0xa6e2('0x42')]=qs[_0xa6e2('0x43')](_0x57bc74[_0xa6e2('0x39')][_0xa6e2('0x43')]);_0x32cf5e[_0xa6e2('0x44')]=qs[_0xa6e2('0x3b')](_['pick'](_0x57bc74['query'],_0x3fa70b[_0xa6e2('0x3b')]));if(_0x57bc74['query']['filter']){_0x32cf5e[_0xa6e2('0x44')]=_[_0xa6e2('0x47')](_0x32cf5e['where'],{'$or':_[_0xa6e2('0x33')](_0x32cf5e[_0xa6e2('0x3e')],function(_0x31b14e){var _0x4343f4={};_0x4343f4[_0x31b14e]={'$like':'%'+_0x57bc74[_0xa6e2('0x39')]['filter']+'%'};return _0x4343f4;})});}_0x32cf5e=_[_0xa6e2('0x47')]({},_0x32cf5e,_0x57bc74['options']);return _0x299f63['getDescriptions'](_0x32cf5e);}})[_0xa6e2('0x19')](function(_0x59eef6){if(_0x59eef6){_0x296132=_0x59eef6[_0xa6e2('0x3f')];if(!_0x57bc74[_0xa6e2('0x39')][_0xa6e2('0x40')](_0xa6e2('0x41'))){_0x32cf5e[_0xa6e2('0x28')]=qs[_0xa6e2('0x28')](_0x57bc74[_0xa6e2('0x39')][_0xa6e2('0x28')]);_0x32cf5e[_0xa6e2('0x27')]=qs[_0xa6e2('0x27')](_0x57bc74[_0xa6e2('0x39')]['offset']);}return _0x299f63[_0xa6e2('0x58')](_0x32cf5e);}})[_0xa6e2('0x19')](function(_0x50b470){if(_0x50b470){return _0x50b470?{'count':_0x296132,'rows':_0x50b470}:null;}})[_0xa6e2('0x19')](respondWithResult(_0x4bae51,null))[_0xa6e2('0x23')](handleError(_0x4bae51,null));}; \ No newline at end of file +var _0xaa55=['reject','save','update','destroy','end','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','then','keys','find','create','body','params','ZohoField','getFields','hasOwnProperty','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','sendStatus','status','json','count','offset','limit','set','Content-Range'];(function(_0x303c3d,_0x43cd12){var _0x533c30=function(_0x384807){while(--_0x384807){_0x303c3d['push'](_0x303c3d['shift']());}};_0x533c30(++_0x43cd12);}(_0xaa55,0x183));var _0x5aa5=function(_0x33b09a,_0x7f5b07){_0x33b09a=_0x33b09a-0x0;var _0xaf12c1=_0xaa55[_0x33b09a];return _0xaf12c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5aa5('0x0'));var zipdir=require(_0x5aa5('0x1'));var jsonpatch=require(_0x5aa5('0x2'));var rp=require(_0x5aa5('0x3'));var moment=require(_0x5aa5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5aa5('0x5'));var path=require(_0x5aa5('0x6'));var sox=require('sox');var csv=require(_0x5aa5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5aa5('0x8'));var _=require(_0x5aa5('0x9'));var squel=require('squel');var crypto=require(_0x5aa5('0xa'));var jsforce=require(_0x5aa5('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5aa5('0xc'));var Papa=require(_0x5aa5('0xd'));var Redis=require(_0x5aa5('0xe'));var authService=require(_0x5aa5('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5aa5('0x10'));var logger=require(_0x5aa5('0x11'))(_0x5aa5('0x12'));var utils=require(_0x5aa5('0x13'));var config=require(_0x5aa5('0x14'));var licenseUtil=require(_0x5aa5('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5aa5('0x16'));var client=jayson[_0x5aa5('0x17')][_0x5aa5('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x480aa4,_0x1dd73a,_0x1809cf,_0x277edd){return new BPromise(function(_0x3f6379,_0x420f23){var _0x1dff78=_0x277edd||client;return _0x1dff78[_0x5aa5('0x19')](_0x480aa4,_0x1809cf)['then'](function(_0x18a904){logger[_0x5aa5('0x1a')](_0x5aa5('0x1b'),_0x1dd73a,'request\x20sent');logger['debug'](_0x5aa5('0x1c'),_0x1dd73a,_0x5aa5('0x1d'),JSON[_0x5aa5('0x1e')](_0x18a904));if(_0x18a904['error']){if(_0x18a904['error'][_0x5aa5('0x1f')]===0x1f4){logger[_0x5aa5('0x20')](_0x5aa5('0x1b'),_0x1dd73a,_0x18a904[_0x5aa5('0x20')][_0x5aa5('0x21')]);return _0x420f23(_0x18a904[_0x5aa5('0x20')][_0x5aa5('0x21')]);}logger[_0x5aa5('0x20')](_0x5aa5('0x1b'),_0x1dd73a,_0x18a904[_0x5aa5('0x20')]['message']);return _0x3f6379(_0x18a904[_0x5aa5('0x20')]['message']);}else{logger[_0x5aa5('0x1a')](_0x5aa5('0x1b'),_0x1dd73a,_0x5aa5('0x1d'));_0x3f6379(_0x18a904['result'][_0x5aa5('0x21')]);}})[_0x5aa5('0x22')](function(_0x3001c4){logger[_0x5aa5('0x20')]('ZohoConfiguration,\x20%s,\x20%s',_0x1dd73a,_0x3001c4);_0x420f23(_0x3001c4);});});}function respondWithStatusCode(_0x5242b5,_0x44e436){_0x44e436=_0x44e436||0xcc;return function(_0x460877){if(_0x460877){return _0x5242b5[_0x5aa5('0x23')](_0x44e436);}return _0x5242b5[_0x5aa5('0x24')](_0x44e436)['end']();};}function respondWithResult(_0x3b9e3b,_0x3b4ba5){_0x3b4ba5=_0x3b4ba5||0xc8;return function(_0x2c2a76){if(_0x2c2a76){return _0x3b9e3b['status'](_0x3b4ba5)[_0x5aa5('0x25')](_0x2c2a76);}};}function respondWithFilteredResult(_0x1df82b,_0xf9bce1){return function(_0xc9404c){if(_0xc9404c){var _0x224ca9=_0xc9404c[_0x5aa5('0x26')],_0x5ef070=_0xf9bce1[_0x5aa5('0x27')],_0x378ad3=_0xf9bce1['offset']+_0xf9bce1[_0x5aa5('0x28')],_0x1321b8;if(_0x378ad3>=_0x224ca9){_0x378ad3=_0x224ca9;_0x1321b8=0xc8;}else{_0x1321b8=0xce;}_0x1df82b['status'](_0x1321b8);return _0x1df82b[_0x5aa5('0x29')](_0x5aa5('0x2a'),_0x5ef070+'-'+_0x378ad3+'/'+_0x224ca9)['json'](_0xc9404c);}return null;};}function patchUpdates(_0xd06645){return function(_0x1bef4b){try{jsonpatch['apply'](_0x1bef4b,_0xd06645,!![]);}catch(_0xc6aa61){return BPromise[_0x5aa5('0x2b')](_0xc6aa61);}return _0x1bef4b[_0x5aa5('0x2c')]();};}function saveUpdates(_0x10c916,_0x22e318){return function(_0x32e146){if(_0x32e146){return _0x32e146[_0x5aa5('0x2d')](_0x10c916)['then'](function(_0x59c4c4){return _0x59c4c4;});}return null;};}function removeEntity(_0x432a99,_0x345ddf){return function(_0x2f9026){if(_0x2f9026){return _0x2f9026[_0x5aa5('0x2e')]()['then'](function(){_0x432a99[_0x5aa5('0x24')](0xcc)[_0x5aa5('0x2f')]();});}};}function handleEntityNotFound(_0x81d12,_0x5c1a02){return function(_0x46d50d){if(!_0x46d50d){_0x81d12[_0x5aa5('0x23')](0x194);}return _0x46d50d;};}function handleError(_0x329c23,_0x57e892){_0x57e892=_0x57e892||0x1f4;return function(_0x5a4b92){logger[_0x5aa5('0x20')](_0x5a4b92['stack']);if(_0x5a4b92[_0x5aa5('0x30')]){delete _0x5a4b92['name'];}_0x329c23[_0x5aa5('0x24')](_0x57e892)[_0x5aa5('0x31')](_0x5a4b92);};}exports['index']=function(_0xdaa1a7,_0x3180f0){var _0x166c3d={},_0x5ad969={},_0x2164c2={'count':0x0,'rows':[]};var _0x3d41fd=_[_0x5aa5('0x32')](db[_0x5aa5('0x33')][_0x5aa5('0x34')],function(_0x3f6c9a){return{'name':_0x3f6c9a[_0x5aa5('0x35')],'type':_0x3f6c9a[_0x5aa5('0x36')]['key']};});_0x5ad969[_0x5aa5('0x37')]=_['map'](_0x3d41fd,_0x5aa5('0x30'));_0x5ad969[_0x5aa5('0x38')]=_['keys'](_0xdaa1a7[_0x5aa5('0x38')]);_0x5ad969[_0x5aa5('0x39')]=_[_0x5aa5('0x3a')](_0x5ad969[_0x5aa5('0x37')],_0x5ad969[_0x5aa5('0x38')]);_0x166c3d['attributes']=_[_0x5aa5('0x3a')](_0x5ad969[_0x5aa5('0x37')],qs[_0x5aa5('0x3b')](_0xdaa1a7[_0x5aa5('0x38')][_0x5aa5('0x3b')]));_0x166c3d[_0x5aa5('0x3c')]=_0x166c3d['attributes'][_0x5aa5('0x3d')]?_0x166c3d['attributes']:_0x5ad969[_0x5aa5('0x37')];if(!_0xdaa1a7[_0x5aa5('0x38')]['hasOwnProperty'](_0x5aa5('0x3e'))){_0x166c3d['limit']=qs[_0x5aa5('0x28')](_0xdaa1a7[_0x5aa5('0x38')][_0x5aa5('0x28')]);_0x166c3d[_0x5aa5('0x27')]=qs['offset'](_0xdaa1a7[_0x5aa5('0x38')][_0x5aa5('0x27')]);}_0x166c3d[_0x5aa5('0x3f')]=qs['sort'](_0xdaa1a7[_0x5aa5('0x38')][_0x5aa5('0x40')]);_0x166c3d[_0x5aa5('0x41')]=qs[_0x5aa5('0x39')](_[_0x5aa5('0x42')](_0xdaa1a7[_0x5aa5('0x38')],_0x5ad969['filters']),_0x3d41fd);if(_0xdaa1a7[_0x5aa5('0x38')]['filter']){_0x166c3d[_0x5aa5('0x41')]=_['merge'](_0x166c3d[_0x5aa5('0x41')],{'$or':_['map'](_0x3d41fd,function(_0x2c8999){if(_0x2c8999[_0x5aa5('0x36')]!==_0x5aa5('0x43')){var _0x33e0c6={};_0x33e0c6[_0x2c8999[_0x5aa5('0x30')]]={'$like':'%'+_0xdaa1a7[_0x5aa5('0x38')][_0x5aa5('0x44')]+'%'};return _0x33e0c6;}})});}_0x166c3d=_[_0x5aa5('0x45')]({},_0x166c3d,_0xdaa1a7[_0x5aa5('0x46')]);var _0x40e928={'where':_0x166c3d[_0x5aa5('0x41')]};return db[_0x5aa5('0x33')][_0x5aa5('0x26')](_0x40e928)['then'](function(_0x3f3dea){_0x2164c2[_0x5aa5('0x26')]=_0x3f3dea;if(_0xdaa1a7[_0x5aa5('0x38')][_0x5aa5('0x47')]){_0x166c3d[_0x5aa5('0x48')]=[{'all':!![]}];}return db[_0x5aa5('0x33')][_0x5aa5('0x49')](_0x166c3d);})['then'](function(_0x4e8f53){_0x2164c2['rows']=_0x4e8f53;return _0x2164c2;})[_0x5aa5('0x4a')](respondWithFilteredResult(_0x3180f0,_0x166c3d))[_0x5aa5('0x22')](handleError(_0x3180f0,null));};exports['show']=function(_0x3fed11,_0x54a1d9){var _0x571ad2={'raw':![],'where':{'id':_0x3fed11['params']['id']}},_0x76d9e0={};_0x76d9e0['model']=_[_0x5aa5('0x4b')](db[_0x5aa5('0x33')]['rawAttributes']);_0x76d9e0['query']=_[_0x5aa5('0x4b')](_0x3fed11[_0x5aa5('0x38')]);_0x76d9e0[_0x5aa5('0x39')]=_[_0x5aa5('0x3a')](_0x76d9e0['model'],_0x76d9e0[_0x5aa5('0x38')]);_0x571ad2[_0x5aa5('0x3c')]=_[_0x5aa5('0x3a')](_0x76d9e0['model'],qs[_0x5aa5('0x3b')](_0x3fed11[_0x5aa5('0x38')]['fields']));_0x571ad2[_0x5aa5('0x3c')]=_0x571ad2[_0x5aa5('0x3c')][_0x5aa5('0x3d')]?_0x571ad2[_0x5aa5('0x3c')]:_0x76d9e0[_0x5aa5('0x37')];if(_0x3fed11[_0x5aa5('0x38')][_0x5aa5('0x47')]){_0x571ad2[_0x5aa5('0x48')]=[{'all':!![]}];}_0x571ad2=_[_0x5aa5('0x45')]({},_0x571ad2,_0x3fed11['options']);return db['ZohoConfiguration'][_0x5aa5('0x4c')](_0x571ad2)['then'](handleEntityNotFound(_0x54a1d9,null))[_0x5aa5('0x4a')](respondWithResult(_0x54a1d9,null))['catch'](handleError(_0x54a1d9,null));};exports[_0x5aa5('0x4d')]=function(_0x74bec8,_0x419f95){return db[_0x5aa5('0x33')][_0x5aa5('0x4d')](_0x74bec8[_0x5aa5('0x4e')],{})['then'](respondWithResult(_0x419f95,0xc9))[_0x5aa5('0x22')](handleError(_0x419f95,null));};exports[_0x5aa5('0x2d')]=function(_0xabdaf5,_0x2b47b0){if(_0xabdaf5[_0x5aa5('0x4e')]['id']){delete _0xabdaf5[_0x5aa5('0x4e')]['id'];}return db[_0x5aa5('0x33')]['find']({'where':{'id':_0xabdaf5[_0x5aa5('0x4f')]['id']}})[_0x5aa5('0x4a')](handleEntityNotFound(_0x2b47b0,null))['then'](saveUpdates(_0xabdaf5[_0x5aa5('0x4e')],null))[_0x5aa5('0x4a')](respondWithResult(_0x2b47b0,null))[_0x5aa5('0x22')](handleError(_0x2b47b0,null));};exports[_0x5aa5('0x2e')]=function(_0x800f35,_0x44cee2){return db[_0x5aa5('0x33')][_0x5aa5('0x4c')]({'where':{'id':_0x800f35['params']['id']}})['then'](handleEntityNotFound(_0x44cee2,null))[_0x5aa5('0x4a')](removeEntity(_0x44cee2,null))[_0x5aa5('0x22')](handleError(_0x44cee2,null));};exports['getFields']=function(_0x431513,_0x5705ab,_0x4da956){var _0x173fca={};var _0x578836={};var _0x116a45;var _0x521a0c;return db[_0x5aa5('0x33')]['findOne']({'where':{'id':_0x431513[_0x5aa5('0x4f')]['id']}})[_0x5aa5('0x4a')](handleEntityNotFound(_0x5705ab,null))[_0x5aa5('0x4a')](function(_0x45bdc1){if(_0x45bdc1){_0x116a45=_0x45bdc1;_0x578836[_0x5aa5('0x37')]=_[_0x5aa5('0x4b')](db[_0x5aa5('0x50')][_0x5aa5('0x34')]);_0x578836[_0x5aa5('0x38')]=_[_0x5aa5('0x4b')](_0x431513[_0x5aa5('0x38')]);_0x578836[_0x5aa5('0x39')]=_[_0x5aa5('0x3a')](_0x578836['model'],_0x578836['query']);_0x173fca['attributes']=_[_0x5aa5('0x3a')](_0x578836[_0x5aa5('0x37')],qs[_0x5aa5('0x3b')](_0x431513[_0x5aa5('0x38')]['fields']));_0x173fca[_0x5aa5('0x3c')]=_0x173fca[_0x5aa5('0x3c')][_0x5aa5('0x3d')]?_0x173fca[_0x5aa5('0x3c')]:_0x578836[_0x5aa5('0x37')];_0x173fca['order']=qs[_0x5aa5('0x40')](_0x431513[_0x5aa5('0x38')][_0x5aa5('0x40')]);_0x173fca['where']=qs[_0x5aa5('0x39')](_['pick'](_0x431513[_0x5aa5('0x38')],_0x578836[_0x5aa5('0x39')]));if(_0x431513['query']['filter']){_0x173fca[_0x5aa5('0x41')]=_[_0x5aa5('0x45')](_0x173fca[_0x5aa5('0x41')],{'$or':_['map'](_0x173fca[_0x5aa5('0x3c')],function(_0x2f5f6c){var _0x5890ef={};_0x5890ef[_0x2f5f6c]={'$like':'%'+_0x431513[_0x5aa5('0x38')]['filter']+'%'};return _0x5890ef;})});}_0x173fca=_[_0x5aa5('0x45')]({},_0x173fca,_0x431513[_0x5aa5('0x46')]);return _0x116a45[_0x5aa5('0x51')](_0x173fca);}})[_0x5aa5('0x4a')](function(_0x2cad94){if(_0x2cad94){_0x521a0c=_0x2cad94[_0x5aa5('0x3d')];if(!_0x431513['query'][_0x5aa5('0x52')](_0x5aa5('0x3e'))){_0x173fca[_0x5aa5('0x28')]=qs[_0x5aa5('0x28')](_0x431513['query'][_0x5aa5('0x28')]);_0x173fca['offset']=qs['offset'](_0x431513[_0x5aa5('0x38')][_0x5aa5('0x27')]);}return _0x116a45[_0x5aa5('0x51')](_0x173fca);}})[_0x5aa5('0x4a')](function(_0x3b7964){if(_0x3b7964){return _0x3b7964?{'count':_0x521a0c,'rows':_0x3b7964}:null;}})[_0x5aa5('0x4a')](respondWithResult(_0x5705ab,null))[_0x5aa5('0x22')](handleError(_0x5705ab,null));};exports[_0x5aa5('0x53')]=function(_0x4ced06,_0x4b0e9f,_0x1f7372){var _0x1b0e21={};var _0x315651={};var _0x2c3043;var _0x364ffe;return db[_0x5aa5('0x33')][_0x5aa5('0x54')]({'where':{'id':_0x4ced06[_0x5aa5('0x4f')]['id']}})[_0x5aa5('0x4a')](handleEntityNotFound(_0x4b0e9f,null))['then'](function(_0x59a977){if(_0x59a977){_0x2c3043=_0x59a977;_0x315651[_0x5aa5('0x37')]=_[_0x5aa5('0x4b')](db[_0x5aa5('0x50')][_0x5aa5('0x34')]);_0x315651[_0x5aa5('0x38')]=_[_0x5aa5('0x4b')](_0x4ced06[_0x5aa5('0x38')]);_0x315651[_0x5aa5('0x39')]=_['intersection'](_0x315651[_0x5aa5('0x37')],_0x315651[_0x5aa5('0x38')]);_0x1b0e21['attributes']=_[_0x5aa5('0x3a')](_0x315651[_0x5aa5('0x37')],qs[_0x5aa5('0x3b')](_0x4ced06[_0x5aa5('0x38')][_0x5aa5('0x3b')]));_0x1b0e21[_0x5aa5('0x3c')]=_0x1b0e21[_0x5aa5('0x3c')][_0x5aa5('0x3d')]?_0x1b0e21['attributes']:_0x315651[_0x5aa5('0x37')];_0x1b0e21[_0x5aa5('0x3f')]=qs[_0x5aa5('0x40')](_0x4ced06[_0x5aa5('0x38')][_0x5aa5('0x40')]);_0x1b0e21[_0x5aa5('0x41')]=qs[_0x5aa5('0x39')](_[_0x5aa5('0x42')](_0x4ced06['query'],_0x315651[_0x5aa5('0x39')]));if(_0x4ced06['query']['filter']){_0x1b0e21[_0x5aa5('0x41')]=_['merge'](_0x1b0e21['where'],{'$or':_[_0x5aa5('0x32')](_0x1b0e21['attributes'],function(_0xa15c28){var _0x1e559e={};_0x1e559e[_0xa15c28]={'$like':'%'+_0x4ced06['query']['filter']+'%'};return _0x1e559e;})});}_0x1b0e21=_[_0x5aa5('0x45')]({},_0x1b0e21,_0x4ced06[_0x5aa5('0x46')]);return _0x2c3043[_0x5aa5('0x53')](_0x1b0e21);}})[_0x5aa5('0x4a')](function(_0x48a127){if(_0x48a127){_0x364ffe=_0x48a127[_0x5aa5('0x3d')];if(!_0x4ced06[_0x5aa5('0x38')][_0x5aa5('0x52')]('nolimit')){_0x1b0e21[_0x5aa5('0x28')]=qs[_0x5aa5('0x28')](_0x4ced06[_0x5aa5('0x38')][_0x5aa5('0x28')]);_0x1b0e21[_0x5aa5('0x27')]=qs[_0x5aa5('0x27')](_0x4ced06[_0x5aa5('0x38')][_0x5aa5('0x27')]);}return _0x2c3043[_0x5aa5('0x53')](_0x1b0e21);}})[_0x5aa5('0x4a')](function(_0xf39202){if(_0xf39202){return _0xf39202?{'count':_0x364ffe,'rows':_0xf39202}:null;}})[_0x5aa5('0x4a')](respondWithResult(_0x4b0e9f,null))[_0x5aa5('0x22')](handleError(_0x4b0e9f,null));};exports[_0x5aa5('0x55')]=function(_0x2e106f,_0x31118a,_0x295049){var _0x505dfc={};var _0x15ed07={};var _0x143603;var _0x5f1914;return db[_0x5aa5('0x33')][_0x5aa5('0x54')]({'where':{'id':_0x2e106f[_0x5aa5('0x4f')]['id']}})[_0x5aa5('0x4a')](handleEntityNotFound(_0x31118a,null))['then'](function(_0x1b943c){if(_0x1b943c){_0x143603=_0x1b943c;_0x15ed07['model']=_[_0x5aa5('0x4b')](db[_0x5aa5('0x50')][_0x5aa5('0x34')]);_0x15ed07[_0x5aa5('0x38')]=_['keys'](_0x2e106f[_0x5aa5('0x38')]);_0x15ed07[_0x5aa5('0x39')]=_['intersection'](_0x15ed07[_0x5aa5('0x37')],_0x15ed07[_0x5aa5('0x38')]);_0x505dfc['attributes']=_[_0x5aa5('0x3a')](_0x15ed07[_0x5aa5('0x37')],qs[_0x5aa5('0x3b')](_0x2e106f[_0x5aa5('0x38')]['fields']));_0x505dfc[_0x5aa5('0x3c')]=_0x505dfc['attributes'][_0x5aa5('0x3d')]?_0x505dfc[_0x5aa5('0x3c')]:_0x15ed07['model'];_0x505dfc[_0x5aa5('0x3f')]=qs[_0x5aa5('0x40')](_0x2e106f['query']['sort']);_0x505dfc['where']=qs[_0x5aa5('0x39')](_[_0x5aa5('0x42')](_0x2e106f[_0x5aa5('0x38')],_0x15ed07[_0x5aa5('0x39')]));if(_0x2e106f[_0x5aa5('0x38')][_0x5aa5('0x44')]){_0x505dfc['where']=_[_0x5aa5('0x45')](_0x505dfc[_0x5aa5('0x41')],{'$or':_[_0x5aa5('0x32')](_0x505dfc['attributes'],function(_0x2f2bad){var _0x6aae1c={};_0x6aae1c[_0x2f2bad]={'$like':'%'+_0x2e106f[_0x5aa5('0x38')][_0x5aa5('0x44')]+'%'};return _0x6aae1c;})});}_0x505dfc=_['merge']({},_0x505dfc,_0x2e106f[_0x5aa5('0x46')]);return _0x143603[_0x5aa5('0x55')](_0x505dfc);}})[_0x5aa5('0x4a')](function(_0x441be7){if(_0x441be7){_0x5f1914=_0x441be7[_0x5aa5('0x3d')];if(!_0x2e106f[_0x5aa5('0x38')][_0x5aa5('0x52')](_0x5aa5('0x3e'))){_0x505dfc['limit']=qs[_0x5aa5('0x28')](_0x2e106f[_0x5aa5('0x38')][_0x5aa5('0x28')]);_0x505dfc[_0x5aa5('0x27')]=qs[_0x5aa5('0x27')](_0x2e106f[_0x5aa5('0x38')][_0x5aa5('0x27')]);}return _0x143603[_0x5aa5('0x55')](_0x505dfc);}})['then'](function(_0x284a52){if(_0x284a52){return _0x284a52?{'count':_0x5f1914,'rows':_0x284a52}:null;}})[_0x5aa5('0x4a')](respondWithResult(_0x31118a,null))['catch'](handleError(_0x31118a,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 3251f84..f716e3a 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 _0xf46c=['../../config/logger','moment','path','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','util'];(function(_0x2d9602,_0x33a997){var _0x4d5fee=function(_0x18a144){while(--_0x18a144){_0x2d9602['push'](_0x2d9602['shift']());}};_0x4d5fee(++_0x33a997);}(_0xf46c,0x1b8));var _0xcf46=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf46c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xcf46('0x0'));var logger=require(_0xcf46('0x1'))('api');var moment=require(_0xcf46('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf46('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf46('0x4'));module[_0xcf46('0x5')]=function(_0x514efd,_0x32e693){return _0x514efd[_0xcf46('0x6')](_0xcf46('0x7'),attributes,{'tableName':_0xcf46('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e86=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x267c52,_0x3c0df3){var _0x46c47b=function(_0x3c3740){while(--_0x3c3740){_0x267c52['push'](_0x267c52['shift']());}};_0x46c47b(++_0x3c0df3);}(_0x1e86,0x129));var _0x61e8=function(_0x31c06f,_0x39b3a3){_0x31c06f=_0x31c06f-0x0;var _0xcb4a8e=_0x1e86[_0x31c06f];return _0xcb4a8e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x61e8('0x0'))('api');var moment=require(_0x61e8('0x1'));var BPromise=require(_0x61e8('0x2'));var rp=require(_0x61e8('0x3'));var fs=require('fs');var path=require(_0x61e8('0x4'));var rimraf=require('rimraf');var config=require(_0x61e8('0x5'));var attributes=require(_0x61e8('0x6'));module[_0x61e8('0x7')]=function(_0x57fe47,_0x87a1da){return _0x57fe47[_0x61e8('0x8')](_0x61e8('0x9'),attributes,{'tableName':_0x61e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index cfc9e09..51d2455 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 _0xb1a2=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x403fbc,_0x27dc37){var _0x1075f0=function(_0x47c59b){while(--_0x47c59b){_0x403fbc['push'](_0x403fbc['shift']());}};_0x1075f0(++_0x27dc37);}(_0xb1a2,0x1d6));var _0x2b1a=function(_0x4c0a42,_0x33686b){_0x4c0a42=_0x4c0a42-0x0;var _0x3be7b4=_0xb1a2[_0x4c0a42];return _0x3be7b4;};'use strict';var _=require(_0x2b1a('0x0'));var util=require('util');var moment=require(_0x2b1a('0x1'));var BPromise=require(_0x2b1a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b1a('0x3'));var db=require(_0x2b1a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b1a('0x5'))(_0x2b1a('0x6'));var config=require(_0x2b1a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b1a('0x8')][_0x2b1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33d736,_0x5499e7,_0x3eefd2){return new BPromise(function(_0x738302,_0x2c039b){return client[_0x2b1a('0xa')](_0x33d736,_0x3eefd2)[_0x2b1a('0xb')](function(_0x2f45f5){logger[_0x2b1a('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x5499e7,_0x2b1a('0xd'));logger['debug'](_0x2b1a('0xe'),_0x5499e7,_0x2b1a('0xd'),JSON[_0x2b1a('0xf')](_0x2f45f5));if(_0x2f45f5['error']){if(_0x2f45f5[_0x2b1a('0x10')][_0x2b1a('0x11')]===0x1f4){logger[_0x2b1a('0x10')](_0x2b1a('0x12'),_0x5499e7,_0x2f45f5[_0x2b1a('0x10')]['message']);return _0x2c039b(_0x2f45f5[_0x2b1a('0x10')]['message']);}logger['error'](_0x2b1a('0x12'),_0x5499e7,_0x2f45f5['error'][_0x2b1a('0x13')]);return _0x738302(_0x2f45f5[_0x2b1a('0x10')]['message']);}else{logger['info'](_0x2b1a('0x12'),_0x5499e7,_0x2b1a('0xd'));_0x738302(_0x2f45f5[_0x2b1a('0x14')][_0x2b1a('0x13')]);}})[_0x2b1a('0x15')](function(_0x1432d6){logger['error'](_0x2b1a('0x12'),_0x5499e7,_0x1432d6);_0x2c039b(_0x1432d6);});});} \ No newline at end of file +var _0x0aff=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x1241a0,_0x2a9a57){var _0x4c9a7f=function(_0x444c1f){while(--_0x444c1f){_0x1241a0['push'](_0x1241a0['shift']());}};_0x4c9a7f(++_0x2a9a57);}(_0x0aff,0x174));var _0xf0af=function(_0x319e2e,_0x2f727f){_0x319e2e=_0x319e2e-0x0;var _0x302524=_0x0aff[_0x319e2e];return _0x302524;};'use strict';var _=require('lodash');var util=require(_0xf0af('0x0'));var moment=require(_0xf0af('0x1'));var BPromise=require(_0xf0af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0af('0x3'));var db=require(_0xf0af('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0af('0x5'))('rpc');var config=require(_0xf0af('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf0af('0x7')][_0xf0af('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a8fbd,_0x4b9464,_0x115c87){return new BPromise(function(_0x14b4d8,_0xb1fa2f){return client[_0xf0af('0x9')](_0x5a8fbd,_0x115c87)[_0xf0af('0xa')](function(_0x6b3be4){logger['info'](_0xf0af('0xb'),_0x4b9464,'request\x20sent');logger[_0xf0af('0xc')](_0xf0af('0xd'),_0x4b9464,_0xf0af('0xe'),JSON[_0xf0af('0xf')](_0x6b3be4));if(_0x6b3be4[_0xf0af('0x10')]){if(_0x6b3be4[_0xf0af('0x10')][_0xf0af('0x11')]===0x1f4){logger[_0xf0af('0x10')](_0xf0af('0xb'),_0x4b9464,_0x6b3be4[_0xf0af('0x10')][_0xf0af('0x12')]);return _0xb1fa2f(_0x6b3be4[_0xf0af('0x10')][_0xf0af('0x12')]);}logger['error'](_0xf0af('0xb'),_0x4b9464,_0x6b3be4[_0xf0af('0x10')][_0xf0af('0x12')]);return _0x14b4d8(_0x6b3be4[_0xf0af('0x10')][_0xf0af('0x12')]);}else{logger[_0xf0af('0x13')](_0xf0af('0xb'),_0x4b9464,'request\x20sent');_0x14b4d8(_0x6b3be4[_0xf0af('0x14')][_0xf0af('0x12')]);}})[_0xf0af('0x15')](function(_0x3f0aed){logger[_0xf0af('0x10')](_0xf0af('0xb'),_0x4b9464,_0x3f0aed);_0xb1fa2f(_0x3f0aed);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index c595784..89485cf 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 _0xa846=['../../config/environment','get','isAuthenticated','index','post','create','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x589248,_0x31dea3){var _0x486750=function(_0x3e7c21){while(--_0x3e7c21){_0x589248['push'](_0x589248['shift']());}};_0x486750(++_0x31dea3);}(_0xa846,0x70));var _0x6a84=function(_0x11dc88,_0x2416fe){_0x11dc88=_0x11dc88-0x0;var _0x5c8870=_0xa846[_0x11dc88];return _0x5c8870;};'use strict';var multer=require('multer');var util=require(_0x6a84('0x0'));var path=require(_0x6a84('0x1'));var timeout=require(_0x6a84('0x2'));var express=require(_0x6a84('0x3'));var router=express[_0x6a84('0x4')]();var fs_extra=require(_0x6a84('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6a84('0x6'));var config=require(_0x6a84('0x7'));var controller=require('./intZohoField.controller');router[_0x6a84('0x8')]('/',auth[_0x6a84('0x9')](),controller[_0x6a84('0xa')]);router[_0x6a84('0x8')]('/:id',auth[_0x6a84('0x9')](),controller['show']);router[_0x6a84('0xb')]('/',auth['isAuthenticated'](),controller[_0x6a84('0xc')]);router['put'](_0x6a84('0xd'),auth[_0x6a84('0x9')](),controller[_0x6a84('0xe')]);router[_0x6a84('0xf')](_0x6a84('0xd'),auth[_0x6a84('0x9')](),controller[_0x6a84('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3070=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','create','put','/:id','update','delete','exports','util','connect-timeout'];(function(_0x3626dd,_0x46c99c){var _0x58c083=function(_0x46ec74){while(--_0x46ec74){_0x3626dd['push'](_0x3626dd['shift']());}};_0x58c083(++_0x46c99c);}(_0x3070,0x75));var _0x0307=function(_0x2ea6f0,_0x58d636){_0x2ea6f0=_0x2ea6f0-0x0;var _0x33ec46=_0x3070[_0x2ea6f0];return _0x33ec46;};'use strict';var multer=require('multer');var util=require(_0x0307('0x0'));var path=require('path');var timeout=require(_0x0307('0x1'));var express=require(_0x0307('0x2'));var router=express[_0x0307('0x3')]();var fs_extra=require(_0x0307('0x4'));var auth=require(_0x0307('0x5'));var interaction=require(_0x0307('0x6'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0x0307('0x7')]('/',auth[_0x0307('0x8')](),controller[_0x0307('0x9')]);router[_0x0307('0x7')]('/:id',auth[_0x0307('0x8')](),controller[_0x0307('0xa')]);router['post']('/',auth[_0x0307('0x8')](),controller[_0x0307('0xb')]);router[_0x0307('0xc')](_0x0307('0xd'),auth[_0x0307('0x8')](),controller[_0x0307('0xe')]);router[_0x0307('0xf')](_0x0307('0xd'),auth[_0x0307('0x8')](),controller['destroy']);module[_0x0307('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index f24b8d2..9c7cbb4 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 _0x5ad3=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x11a1d5,_0x2d556d){var _0x1be5d3=function(_0x152f41){while(--_0x152f41){_0x11a1d5['push'](_0x11a1d5['shift']());}};_0x1be5d3(++_0x2d556d);}(_0x5ad3,0x1e2));var _0x35ad=function(_0xd4ec0c,_0x2afcd2){_0xd4ec0c=_0xd4ec0c-0x0;var _0x580218=_0x5ad3[_0xd4ec0c];return _0x580218;};'use strict';var Sequelize=require(_0x35ad('0x0'));module[_0x35ad('0x1')]={'type':{'type':Sequelize[_0x35ad('0x2')](_0x35ad('0x3'),'variable',_0x35ad('0x4'),_0x35ad('0x5'),_0x35ad('0x6')),'defaultValue':_0x35ad('0x3')},'content':{'type':Sequelize[_0x35ad('0x7')]},'key':{'type':Sequelize[_0x35ad('0x7')]},'keyType':{'type':Sequelize[_0x35ad('0x2')](_0x35ad('0x3'),_0x35ad('0x8'),_0x35ad('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x35ad('0x7')]},'nameField':{'type':Sequelize[_0x35ad('0x7')]},'customField':{'type':Sequelize[_0x35ad('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6c32=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x5e5f05,_0x5cb316){var _0x8147b3=function(_0x2e637a){while(--_0x2e637a){_0x5e5f05['push'](_0x5e5f05['shift']());}};_0x8147b3(++_0x5cb316);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x26c3('0x0'));module[_0x26c3('0x1')]={'type':{'type':Sequelize[_0x26c3('0x2')](_0x26c3('0x3'),_0x26c3('0x4'),_0x26c3('0x5'),_0x26c3('0x6'),_0x26c3('0x7')),'defaultValue':_0x26c3('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x26c3('0x8')]},'keyType':{'type':Sequelize[_0x26c3('0x2')](_0x26c3('0x3'),'variable',_0x26c3('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x26c3('0x8')]},'nameField':{'type':Sequelize[_0x26c3('0x8')]},'customField':{'type':Sequelize[_0x26c3('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x26c3('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index f4b4478..d78b9f1 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 _0x43cb=['type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','stack','name','index','map','ZohoField'];(function(_0x2e440b,_0x540f27){var _0x46e1a4=function(_0x953321){while(--_0x953321){_0x2e440b['push'](_0x2e440b['shift']());}};_0x46e1a4(++_0x540f27);}(_0x43cb,0xaf));var _0xb43c=function(_0x364009,_0x12b686){_0x364009=_0x364009-0x0;var _0x5cf365=_0x43cb[_0x364009];return _0x5cf365;};'use strict';var emlformat=require(_0xb43c('0x0'));var rimraf=require(_0xb43c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb43c('0x2'));var rp=require(_0xb43c('0x3'));var moment=require(_0xb43c('0x4'));var BPromise=require(_0xb43c('0x5'));var Mustache=require(_0xb43c('0x6'));var util=require(_0xb43c('0x7'));var path=require(_0xb43c('0x8'));var sox=require(_0xb43c('0x9'));var csv=require(_0xb43c('0xa'));var ejs=require(_0xb43c('0xb'));var fs=require('fs');var fs_extra=require(_0xb43c('0xc'));var _=require(_0xb43c('0xd'));var squel=require('squel');var crypto=require(_0xb43c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb43c('0xf'));var toCsv=require(_0xb43c('0xa'));var querystring=require(_0xb43c('0x10'));var Papa=require(_0xb43c('0x11'));var Redis=require('ioredis');var authService=require(_0xb43c('0x12'));var qs=require(_0xb43c('0x13'));var as=require(_0xb43c('0x14'));var hardwareService=require(_0xb43c('0x15'));var logger=require(_0xb43c('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xb43c('0x17'));var licenseUtil=require(_0xb43c('0x18'));var db=require(_0xb43c('0x19'))['db'];function respondWithStatusCode(_0xf2ca0d,_0x53125a){_0x53125a=_0x53125a||0xcc;return function(_0x24de93){if(_0x24de93){return _0xf2ca0d[_0xb43c('0x1a')](_0x53125a);}return _0xf2ca0d['status'](_0x53125a)['end']();};}function respondWithResult(_0x201ac5,_0x14e89a){_0x14e89a=_0x14e89a||0xc8;return function(_0x59039a){if(_0x59039a){return _0x201ac5[_0xb43c('0x1b')](_0x14e89a)[_0xb43c('0x1c')](_0x59039a);}};}function respondWithFilteredResult(_0x4d62a3,_0x208d11){return function(_0x46fa46){if(_0x46fa46){var _0x33131b=_0x46fa46[_0xb43c('0x1d')],_0x340404=_0x208d11[_0xb43c('0x1e')],_0xb829c8=_0x208d11['offset']+_0x208d11[_0xb43c('0x1f')],_0x1a78d3;if(_0xb829c8>=_0x33131b){_0xb829c8=_0x33131b;_0x1a78d3=0xc8;}else{_0x1a78d3=0xce;}_0x4d62a3[_0xb43c('0x1b')](_0x1a78d3);return _0x4d62a3[_0xb43c('0x20')](_0xb43c('0x21'),_0x340404+'-'+_0xb829c8+'/'+_0x33131b)[_0xb43c('0x1c')](_0x46fa46);}return null;};}function patchUpdates(_0x4fecca){return function(_0x91ebdb){try{jsonpatch['apply'](_0x91ebdb,_0x4fecca,!![]);}catch(_0x43183d){return BPromise[_0xb43c('0x22')](_0x43183d);}return _0x91ebdb[_0xb43c('0x23')]();};}function saveUpdates(_0x3517b5,_0x556646){return function(_0x18a133){if(_0x18a133){return _0x18a133[_0xb43c('0x24')](_0x3517b5)['then'](function(_0x4ba5da){return _0x4ba5da;});}return null;};}function removeEntity(_0x8df91,_0x460fcb){return function(_0x494d16){if(_0x494d16){return _0x494d16['destroy']()[_0xb43c('0x25')](function(){_0x8df91[_0xb43c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x294565,_0x28b70f){return function(_0x2f3b13){if(!_0x2f3b13){_0x294565[_0xb43c('0x1a')](0x194);}return _0x2f3b13;};}function handleError(_0x17ea4c,_0x465532){_0x465532=_0x465532||0x1f4;return function(_0x519307){logger[_0xb43c('0x26')](_0x519307[_0xb43c('0x27')]);if(_0x519307['name']){delete _0x519307[_0xb43c('0x28')];}_0x17ea4c[_0xb43c('0x1b')](_0x465532)['send'](_0x519307);};}exports[_0xb43c('0x29')]=function(_0x5dd31b,_0x3887f0){var _0x31224c={},_0x25c93d={},_0x4a1949={'count':0x0,'rows':[]};var _0x52cb1a=_[_0xb43c('0x2a')](db[_0xb43c('0x2b')]['rawAttributes'],function(_0x11926b){return{'name':_0x11926b['fieldName'],'type':_0x11926b[_0xb43c('0x2c')]['key']};});_0x25c93d[_0xb43c('0x2d')]=_[_0xb43c('0x2a')](_0x52cb1a,_0xb43c('0x28'));_0x25c93d[_0xb43c('0x2e')]=_[_0xb43c('0x2f')](_0x5dd31b[_0xb43c('0x2e')]);_0x25c93d[_0xb43c('0x30')]=_[_0xb43c('0x31')](_0x25c93d[_0xb43c('0x2d')],_0x25c93d['query']);_0x31224c['attributes']=_[_0xb43c('0x31')](_0x25c93d[_0xb43c('0x2d')],qs['fields'](_0x5dd31b[_0xb43c('0x2e')][_0xb43c('0x32')]));_0x31224c[_0xb43c('0x33')]=_0x31224c[_0xb43c('0x33')][_0xb43c('0x34')]?_0x31224c['attributes']:_0x25c93d[_0xb43c('0x2d')];if(!_0x5dd31b[_0xb43c('0x2e')][_0xb43c('0x35')](_0xb43c('0x36'))){_0x31224c[_0xb43c('0x1f')]=qs[_0xb43c('0x1f')](_0x5dd31b[_0xb43c('0x2e')][_0xb43c('0x1f')]);_0x31224c[_0xb43c('0x1e')]=qs[_0xb43c('0x1e')](_0x5dd31b[_0xb43c('0x2e')][_0xb43c('0x1e')]);}_0x31224c[_0xb43c('0x37')]=qs[_0xb43c('0x38')](_0x5dd31b[_0xb43c('0x2e')][_0xb43c('0x38')]);_0x31224c['where']=qs[_0xb43c('0x30')](_[_0xb43c('0x39')](_0x5dd31b['query'],_0x25c93d[_0xb43c('0x30')]),_0x52cb1a);if(_0x5dd31b[_0xb43c('0x2e')][_0xb43c('0x3a')]){_0x31224c[_0xb43c('0x3b')]=_[_0xb43c('0x3c')](_0x31224c[_0xb43c('0x3b')],{'$or':_[_0xb43c('0x2a')](_0x52cb1a,function(_0x440add){if(_0x440add[_0xb43c('0x2c')]!==_0xb43c('0x3d')){var _0x19604b={};_0x19604b[_0x440add[_0xb43c('0x28')]]={'$like':'%'+_0x5dd31b[_0xb43c('0x2e')]['filter']+'%'};return _0x19604b;}})});}_0x31224c=_['merge']({},_0x31224c,_0x5dd31b[_0xb43c('0x3e')]);var _0x5b0010={'where':_0x31224c[_0xb43c('0x3b')]};return db['ZohoField']['count'](_0x5b0010)[_0xb43c('0x25')](function(_0x59dd3c){_0x4a1949['count']=_0x59dd3c;if(_0x5dd31b[_0xb43c('0x2e')][_0xb43c('0x3f')]){_0x31224c[_0xb43c('0x40')]=[{'all':!![]}];}return db[_0xb43c('0x2b')]['findAll'](_0x31224c);})[_0xb43c('0x25')](function(_0x230529){_0x4a1949[_0xb43c('0x41')]=_0x230529;return _0x4a1949;})[_0xb43c('0x25')](respondWithFilteredResult(_0x3887f0,_0x31224c))[_0xb43c('0x42')](handleError(_0x3887f0,null));};exports['show']=function(_0x2d7165,_0x482c86){var _0x58ec25={'raw':!![],'where':{'id':_0x2d7165[_0xb43c('0x43')]['id']}},_0x3ae888={};_0x3ae888[_0xb43c('0x2d')]=_[_0xb43c('0x2f')](db[_0xb43c('0x2b')][_0xb43c('0x44')]);_0x3ae888['query']=_['keys'](_0x2d7165['query']);_0x3ae888[_0xb43c('0x30')]=_[_0xb43c('0x31')](_0x3ae888[_0xb43c('0x2d')],_0x3ae888[_0xb43c('0x2e')]);_0x58ec25[_0xb43c('0x33')]=_[_0xb43c('0x31')](_0x3ae888[_0xb43c('0x2d')],qs['fields'](_0x2d7165[_0xb43c('0x2e')][_0xb43c('0x32')]));_0x58ec25[_0xb43c('0x33')]=_0x58ec25[_0xb43c('0x33')]['length']?_0x58ec25[_0xb43c('0x33')]:_0x3ae888[_0xb43c('0x2d')];if(_0x2d7165['query'][_0xb43c('0x3f')]){_0x58ec25[_0xb43c('0x40')]=[{'all':!![]}];}_0x58ec25=_['merge']({},_0x58ec25,_0x2d7165[_0xb43c('0x3e')]);return db[_0xb43c('0x2b')]['find'](_0x58ec25)[_0xb43c('0x25')](handleEntityNotFound(_0x482c86,null))['then'](respondWithResult(_0x482c86,null))['catch'](handleError(_0x482c86,null));};exports[_0xb43c('0x45')]=function(_0x160a43,_0x5dd9f4){return db[_0xb43c('0x2b')][_0xb43c('0x45')](_0x160a43['body'],{})['then'](respondWithResult(_0x5dd9f4,0xc9))[_0xb43c('0x42')](handleError(_0x5dd9f4,null));};exports[_0xb43c('0x24')]=function(_0x567647,_0x1952bb){if(_0x567647[_0xb43c('0x46')]['id']){delete _0x567647['body']['id'];}return db[_0xb43c('0x2b')][_0xb43c('0x47')]({'where':{'id':_0x567647[_0xb43c('0x43')]['id']}})[_0xb43c('0x25')](handleEntityNotFound(_0x1952bb,null))['then'](saveUpdates(_0x567647['body'],null))[_0xb43c('0x25')](respondWithResult(_0x1952bb,null))[_0xb43c('0x42')](handleError(_0x1952bb,null));};exports[_0xb43c('0x48')]=function(_0x317090,_0x183079){return db[_0xb43c('0x2b')][_0xb43c('0x47')]({'where':{'id':_0x317090[_0xb43c('0x43')]['id']}})[_0xb43c('0x25')](handleEntityNotFound(_0x183079,null))['then'](removeEntity(_0x183079,null))[_0xb43c('0x42')](handleError(_0x183079,null));}; \ No newline at end of file +var _0xb588=['save','update','then','destroy','error','name','send','index','ZohoField','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','include','catch','show','params','includeAll','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','limit','json','apply','reject'];(function(_0x53a568,_0x2587ac){var _0x17fe17=function(_0x37f932){while(--_0x37f932){_0x53a568['push'](_0x53a568['shift']());}};_0x17fe17(++_0x2587ac);}(_0xb588,0x185));var _0x8b58=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb588[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x8b58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b58('0x1'));var jsonpatch=require(_0x8b58('0x2'));var rp=require(_0x8b58('0x3'));var moment=require(_0x8b58('0x4'));var BPromise=require(_0x8b58('0x5'));var Mustache=require(_0x8b58('0x6'));var util=require(_0x8b58('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8b58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b58('0x9'));var squel=require(_0x8b58('0xa'));var crypto=require(_0x8b58('0xb'));var jsforce=require(_0x8b58('0xc'));var deskjs=require(_0x8b58('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8b58('0xe'));var Papa=require(_0x8b58('0xf'));var Redis=require('ioredis');var authService=require(_0x8b58('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8b58('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8b58('0x12'));var utils=require('../../config/utils');var config=require(_0x8b58('0x13'));var licenseUtil=require(_0x8b58('0x14'));var db=require(_0x8b58('0x15'))['db'];function respondWithStatusCode(_0x103e52,_0xa3fba3){_0xa3fba3=_0xa3fba3||0xcc;return function(_0x31e34d){if(_0x31e34d){return _0x103e52[_0x8b58('0x16')](_0xa3fba3);}return _0x103e52[_0x8b58('0x17')](_0xa3fba3)[_0x8b58('0x18')]();};}function respondWithResult(_0x257856,_0xc78a5c){_0xc78a5c=_0xc78a5c||0xc8;return function(_0x3b0a3c){if(_0x3b0a3c){return _0x257856['status'](_0xc78a5c)['json'](_0x3b0a3c);}};}function respondWithFilteredResult(_0x574d4d,_0x23f5bb){return function(_0x3edea7){if(_0x3edea7){var _0x784e19=_0x3edea7[_0x8b58('0x19')],_0x1744c3=_0x23f5bb[_0x8b58('0x1a')],_0x197604=_0x23f5bb[_0x8b58('0x1a')]+_0x23f5bb[_0x8b58('0x1b')],_0x5863da;if(_0x197604>=_0x784e19){_0x197604=_0x784e19;_0x5863da=0xc8;}else{_0x5863da=0xce;}_0x574d4d['status'](_0x5863da);return _0x574d4d['set']('Content-Range',_0x1744c3+'-'+_0x197604+'/'+_0x784e19)[_0x8b58('0x1c')](_0x3edea7);}return null;};}function patchUpdates(_0x25bf5d){return function(_0xa3ba0c){try{jsonpatch[_0x8b58('0x1d')](_0xa3ba0c,_0x25bf5d,!![]);}catch(_0x9dbb3a){return BPromise[_0x8b58('0x1e')](_0x9dbb3a);}return _0xa3ba0c[_0x8b58('0x1f')]();};}function saveUpdates(_0x3d8721,_0x12139a){return function(_0x552467){if(_0x552467){return _0x552467[_0x8b58('0x20')](_0x3d8721)[_0x8b58('0x21')](function(_0x475185){return _0x475185;});}return null;};}function removeEntity(_0x554595,_0x11d748){return function(_0x1109c2){if(_0x1109c2){return _0x1109c2[_0x8b58('0x22')]()[_0x8b58('0x21')](function(){_0x554595['status'](0xcc)[_0x8b58('0x18')]();});}};}function handleEntityNotFound(_0x13f887,_0x4e783b){return function(_0x307e8f){if(!_0x307e8f){_0x13f887[_0x8b58('0x16')](0x194);}return _0x307e8f;};}function handleError(_0x9cbce4,_0x1391e8){_0x1391e8=_0x1391e8||0x1f4;return function(_0x3f0524){logger[_0x8b58('0x23')](_0x3f0524['stack']);if(_0x3f0524[_0x8b58('0x24')]){delete _0x3f0524['name'];}_0x9cbce4[_0x8b58('0x17')](_0x1391e8)[_0x8b58('0x25')](_0x3f0524);};}exports[_0x8b58('0x26')]=function(_0x7614c8,_0x16c484){var _0x55857d={},_0x385260={},_0x13ce40={'count':0x0,'rows':[]};var _0x541989=_['map'](db[_0x8b58('0x27')]['rawAttributes'],function(_0x71526d){return{'name':_0x71526d[_0x8b58('0x28')],'type':_0x71526d['type'][_0x8b58('0x29')]};});_0x385260[_0x8b58('0x2a')]=_['map'](_0x541989,'name');_0x385260[_0x8b58('0x2b')]=_[_0x8b58('0x2c')](_0x7614c8[_0x8b58('0x2b')]);_0x385260['filters']=_[_0x8b58('0x2d')](_0x385260['model'],_0x385260['query']);_0x55857d[_0x8b58('0x2e')]=_[_0x8b58('0x2d')](_0x385260[_0x8b58('0x2a')],qs[_0x8b58('0x2f')](_0x7614c8[_0x8b58('0x2b')][_0x8b58('0x2f')]));_0x55857d[_0x8b58('0x2e')]=_0x55857d['attributes'][_0x8b58('0x30')]?_0x55857d[_0x8b58('0x2e')]:_0x385260['model'];if(!_0x7614c8[_0x8b58('0x2b')][_0x8b58('0x31')](_0x8b58('0x32'))){_0x55857d[_0x8b58('0x1b')]=qs[_0x8b58('0x1b')](_0x7614c8[_0x8b58('0x2b')]['limit']);_0x55857d['offset']=qs[_0x8b58('0x1a')](_0x7614c8[_0x8b58('0x2b')][_0x8b58('0x1a')]);}_0x55857d[_0x8b58('0x33')]=qs[_0x8b58('0x34')](_0x7614c8['query'][_0x8b58('0x34')]);_0x55857d[_0x8b58('0x35')]=qs[_0x8b58('0x36')](_[_0x8b58('0x37')](_0x7614c8['query'],_0x385260[_0x8b58('0x36')]),_0x541989);if(_0x7614c8['query'][_0x8b58('0x38')]){_0x55857d[_0x8b58('0x35')]=_[_0x8b58('0x39')](_0x55857d[_0x8b58('0x35')],{'$or':_[_0x8b58('0x3a')](_0x541989,function(_0x155148){if(_0x155148[_0x8b58('0x3b')]!==_0x8b58('0x3c')){var _0x2c0fe1={};_0x2c0fe1[_0x155148[_0x8b58('0x24')]]={'$like':'%'+_0x7614c8['query'][_0x8b58('0x38')]+'%'};return _0x2c0fe1;}})});}_0x55857d=_[_0x8b58('0x39')]({},_0x55857d,_0x7614c8['options']);var _0x521d34={'where':_0x55857d[_0x8b58('0x35')]};return db[_0x8b58('0x27')][_0x8b58('0x19')](_0x521d34)[_0x8b58('0x21')](function(_0x59c1d2){_0x13ce40[_0x8b58('0x19')]=_0x59c1d2;if(_0x7614c8[_0x8b58('0x2b')]['includeAll']){_0x55857d[_0x8b58('0x3d')]=[{'all':!![]}];}return db[_0x8b58('0x27')]['findAll'](_0x55857d);})[_0x8b58('0x21')](function(_0x480df6){_0x13ce40['rows']=_0x480df6;return _0x13ce40;})[_0x8b58('0x21')](respondWithFilteredResult(_0x16c484,_0x55857d))[_0x8b58('0x3e')](handleError(_0x16c484,null));};exports[_0x8b58('0x3f')]=function(_0x47c31e,_0x1984e8){var _0x2003f0={'raw':!![],'where':{'id':_0x47c31e[_0x8b58('0x40')]['id']}},_0x2d197b={};_0x2d197b['model']=_['keys'](db[_0x8b58('0x27')]['rawAttributes']);_0x2d197b[_0x8b58('0x2b')]=_[_0x8b58('0x2c')](_0x47c31e[_0x8b58('0x2b')]);_0x2d197b[_0x8b58('0x36')]=_[_0x8b58('0x2d')](_0x2d197b[_0x8b58('0x2a')],_0x2d197b['query']);_0x2003f0[_0x8b58('0x2e')]=_['intersection'](_0x2d197b[_0x8b58('0x2a')],qs[_0x8b58('0x2f')](_0x47c31e[_0x8b58('0x2b')]['fields']));_0x2003f0[_0x8b58('0x2e')]=_0x2003f0[_0x8b58('0x2e')][_0x8b58('0x30')]?_0x2003f0[_0x8b58('0x2e')]:_0x2d197b[_0x8b58('0x2a')];if(_0x47c31e[_0x8b58('0x2b')][_0x8b58('0x41')]){_0x2003f0['include']=[{'all':!![]}];}_0x2003f0=_[_0x8b58('0x39')]({},_0x2003f0,_0x47c31e[_0x8b58('0x42')]);return db[_0x8b58('0x27')][_0x8b58('0x43')](_0x2003f0)[_0x8b58('0x21')](handleEntityNotFound(_0x1984e8,null))[_0x8b58('0x21')](respondWithResult(_0x1984e8,null))[_0x8b58('0x3e')](handleError(_0x1984e8,null));};exports[_0x8b58('0x44')]=function(_0x4112dd,_0x24e0ce){return db['ZohoField'][_0x8b58('0x44')](_0x4112dd[_0x8b58('0x45')],{})[_0x8b58('0x21')](respondWithResult(_0x24e0ce,0xc9))[_0x8b58('0x3e')](handleError(_0x24e0ce,null));};exports[_0x8b58('0x20')]=function(_0x26f652,_0x31a948){if(_0x26f652[_0x8b58('0x45')]['id']){delete _0x26f652[_0x8b58('0x45')]['id'];}return db[_0x8b58('0x27')][_0x8b58('0x43')]({'where':{'id':_0x26f652[_0x8b58('0x40')]['id']}})[_0x8b58('0x21')](handleEntityNotFound(_0x31a948,null))[_0x8b58('0x21')](saveUpdates(_0x26f652[_0x8b58('0x45')],null))[_0x8b58('0x21')](respondWithResult(_0x31a948,null))['catch'](handleError(_0x31a948,null));};exports[_0x8b58('0x22')]=function(_0x195402,_0x4f7ede){return db[_0x8b58('0x27')][_0x8b58('0x43')]({'where':{'id':_0x195402[_0x8b58('0x40')]['id']}})[_0x8b58('0x21')](handleEntityNotFound(_0x4f7ede,null))[_0x8b58('0x21')](removeEntity(_0x4f7ede,null))[_0x8b58('0x3e')](handleError(_0x4f7ede,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index d212f01..986732f 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 _0xbacf=['rimraf','../../config/environment','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x495e9f,_0x1b1d80){var _0xb249d2=function(_0x3db4e4){while(--_0x3db4e4){_0x495e9f['push'](_0x495e9f['shift']());}};_0xb249d2(++_0x1b1d80);}(_0xbacf,0x10e));var _0xfbac=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0xbacf[_0x5ad220];return _0xdec77d;};'use strict';var _=require(_0xfbac('0x0'));var util=require(_0xfbac('0x1'));var logger=require(_0xfbac('0x2'))('api');var moment=require(_0xfbac('0x3'));var BPromise=require(_0xfbac('0x4'));var rp=require(_0xfbac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbac('0x6'));var config=require(_0xfbac('0x7'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x1c9eda,_0x40aa88){return _0x1c9eda['define'](_0xfbac('0x8'),attributes,{'tableName':_0xfbac('0x9'),'paranoid':![],'indexes':[{'name':_0xfbac('0xa'),'fields':[_0xfbac('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb9ed=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb9ed,0xbd));var _0xdb9e=function(_0x2b8d5b,_0x62fcaa){_0x2b8d5b=_0x2b8d5b-0x0;var _0x261bbf=_0xb9ed[_0x2b8d5b];return _0x261bbf;};'use strict';var _=require(_0xdb9e('0x0'));var util=require(_0xdb9e('0x1'));var logger=require(_0xdb9e('0x2'))(_0xdb9e('0x3'));var moment=require(_0xdb9e('0x4'));var BPromise=require(_0xdb9e('0x5'));var rp=require(_0xdb9e('0x6'));var fs=require('fs');var path=require(_0xdb9e('0x7'));var rimraf=require('rimraf');var config=require(_0xdb9e('0x8'));var attributes=require(_0xdb9e('0x9'));module[_0xdb9e('0xa')]=function(_0x330659,_0x1d85a2){return _0x330659[_0xdb9e('0xb')](_0xdb9e('0xc'),attributes,{'tableName':_0xdb9e('0xd'),'paranoid':![],'indexes':[{'name':_0xdb9e('0xe'),'fields':[_0xdb9e('0xf'),_0xdb9e('0x10')],'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 e5e147a..e933c70 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 _0x0a9a=['ZohoField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x2eddb9,_0x41e214){var _0x541be9=function(_0x34ace7){while(--_0x34ace7){_0x2eddb9['push'](_0x2eddb9['shift']());}};_0x541be9(++_0x41e214);}(_0x0a9a,0x183));var _0xa0a9=function(_0x114ee9,_0x1e0fc6){_0x114ee9=_0x114ee9-0x0;var _0x13c8e0=_0x0a9a[_0x114ee9];return _0x13c8e0;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('ZohoField,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('ZohoField,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});} \ No newline at end of file +var _0xe5b3=['request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZohoField,\x20%s,\x20%s'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5767af,_0x552873){_0x5767af=_0x5767af-0x0;var _0x211aea=_0xe5b3[_0x5767af];return _0x211aea;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('ZohoField,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('ZohoField,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 453803f..9e31cc5 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 _0x4227=['fs-extra','../../components/auth/service','../../config/environment','exports','multer','connect-timeout','Router'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0x4227,0x89));var _0x7422=function(_0x4de536,_0x243b45){_0x4de536=_0x4de536-0x0;var _0x1b95bc=_0x4227[_0x4de536];return _0x1b95bc;};'use strict';var multer=require(_0x7422('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7422('0x1'));var express=require('express');var router=express[_0x7422('0x2')]();var fs_extra=require(_0x7422('0x3'));var auth=require(_0x7422('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7422('0x5'));module[_0x7422('0x6')]=router; \ No newline at end of file +var _0x88a6=['../../components/auth/service','exports','util','path','express','Router','fs-extra'];(function(_0x4de037,_0x285699){var _0x8d34af=function(_0x389093){while(--_0x389093){_0x4de037['push'](_0x4de037['shift']());}};_0x8d34af(++_0x285699);}(_0x88a6,0x121));var _0x688a=function(_0x4ae578,_0x47156f){_0x4ae578=_0x4ae578-0x0;var _0x386e83=_0x88a6[_0x4ae578];return _0x386e83;};'use strict';var multer=require('multer');var util=require(_0x688a('0x0'));var path=require(_0x688a('0x1'));var timeout=require('connect-timeout');var express=require(_0x688a('0x2'));var router=express[_0x688a('0x3')]();var fs_extra=require(_0x688a('0x4'));var auth=require(_0x688a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x688a('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 5f2a99a..a7d993a 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 _0x8030=['INTEGER','BOOLEAN','exports','STRING','unique_name_and_version','app.js'];(function(_0x3ea5c1,_0x22a76a){var _0x3f0c15=function(_0x20c6cf){while(--_0x20c6cf){_0x3ea5c1['push'](_0x3ea5c1['shift']());}};_0x3f0c15(++_0x22a76a);}(_0x8030,0x18e));var _0x0803=function(_0x3fd797,_0x3d01f0){_0x3fd797=_0x3fd797-0x0;var _0x427f0b=_0x8030[_0x3fd797];return _0x427f0b;};'use strict';var Sequelize=require('sequelize');module[_0x0803('0x0')]={'name':{'type':Sequelize[_0x0803('0x1')],'allowNull':![],'unique':_0x0803('0x2')},'version':{'type':Sequelize[_0x0803('0x1')],'allowNull':![],'unique':_0x0803('0x2')},'main':{'type':Sequelize[_0x0803('0x1')],'defaultValue':_0x0803('0x3')},'filename':{'type':Sequelize[_0x0803('0x1')]},'path':{'type':Sequelize[_0x0803('0x1')]},'type':{'type':Sequelize[_0x0803('0x1')]},'size':{'type':Sequelize[_0x0803('0x4')]},'active':{'type':Sequelize[_0x0803('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x0803('0x1')]},'logo':{'type':Sequelize[_0x0803('0x1')]},'state':{'type':Sequelize[_0x0803('0x1')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x0803('0x1')]},'remoteUri':{'type':Sequelize[_0x0803('0x1')]},'link':{'type':Sequelize[_0x0803('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xc547=['app.js','INTEGER','state','sequelize','exports','unique_name_and_version','STRING'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xc547,0xdc));var _0x7c54=function(_0x44664c,_0x5ba9ff){_0x44664c=_0x44664c-0x0;var _0x41427b=_0xc547[_0x44664c];return _0x41427b;};'use strict';var Sequelize=require(_0x7c54('0x0'));module[_0x7c54('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7c54('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7c54('0x2')},'main':{'type':Sequelize[_0x7c54('0x3')],'defaultValue':_0x7c54('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x7c54('0x3')]},'type':{'type':Sequelize[_0x7c54('0x3')]},'size':{'type':Sequelize[_0x7c54('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x7c54('0x3')]},'logo':{'type':Sequelize[_0x7c54('0x3')]},'state':{'type':Sequelize[_0x7c54('0x3')],'unique':_0x7c54('0x6')},'description':{'type':Sequelize[_0x7c54('0x3')]},'title':{'type':Sequelize[_0x7c54('0x3')]},'remoteUri':{'type':Sequelize[_0x7c54('0x3')]},'link':{'type':Sequelize[_0x7c54('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index af4e065..9727134 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 _0xfe6e=['intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','Integration','includeAll','include','rows','catch','show','params','create','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters'];(function(_0x5967ba,_0x2a30f4){var _0x278cf9=function(_0x17b230){while(--_0x17b230){_0x5967ba['push'](_0x5967ba['shift']());}};_0x278cf9(++_0x2a30f4);}(_0xfe6e,0x1ce));var _0xefe6=function(_0x3d33bb,_0x1f6fad){_0x3d33bb=_0x3d33bb-0x0;var _0x38b190=_0xfe6e[_0x3d33bb];return _0x38b190;};'use strict';var emlformat=require(_0xefe6('0x0'));var rimraf=require(_0xefe6('0x1'));var zipdir=require(_0xefe6('0x2'));var jsonpatch=require(_0xefe6('0x3'));var rp=require(_0xefe6('0x4'));var moment=require('moment');var BPromise=require(_0xefe6('0x5'));var Mustache=require(_0xefe6('0x6'));var util=require('util');var path=require('path');var sox=require(_0xefe6('0x7'));var csv=require(_0xefe6('0x8'));var ejs=require(_0xefe6('0x9'));var fs=require('fs');var fs_extra=require(_0xefe6('0xa'));var _=require(_0xefe6('0xb'));var squel=require(_0xefe6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xefe6('0x8'));var querystring=require(_0xefe6('0xd'));var Papa=require(_0xefe6('0xe'));var Redis=require(_0xefe6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xefe6('0x10'));var as=require(_0xefe6('0x11'));var hardwareService=require(_0xefe6('0x12'));var logger=require(_0xefe6('0x13'))(_0xefe6('0x14'));var utils=require(_0xefe6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xefe6('0x16'));var db=require(_0xefe6('0x17'))['db'];function respondWithStatusCode(_0x22cd47,_0x4e9d10){_0x4e9d10=_0x4e9d10||0xcc;return function(_0x5dd1d9){if(_0x5dd1d9){return _0x22cd47['sendStatus'](_0x4e9d10);}return _0x22cd47['status'](_0x4e9d10)[_0xefe6('0x18')]();};}function respondWithResult(_0x17d13c,_0x13e3d4){_0x13e3d4=_0x13e3d4||0xc8;return function(_0x2ab6e7){if(_0x2ab6e7){return _0x17d13c[_0xefe6('0x19')](_0x13e3d4)[_0xefe6('0x1a')](_0x2ab6e7);}};}function respondWithFilteredResult(_0x66267a,_0x2c3fdf){return function(_0x10c3c0){if(_0x10c3c0){var _0x534d0d=_0x10c3c0[_0xefe6('0x1b')],_0x2489e6=_0x2c3fdf[_0xefe6('0x1c')],_0x4c9c80=_0x2c3fdf['offset']+_0x2c3fdf[_0xefe6('0x1d')],_0x2efb17;if(_0x4c9c80>=_0x534d0d){_0x4c9c80=_0x534d0d;_0x2efb17=0xc8;}else{_0x2efb17=0xce;}_0x66267a[_0xefe6('0x19')](_0x2efb17);return _0x66267a[_0xefe6('0x1e')](_0xefe6('0x1f'),_0x2489e6+'-'+_0x4c9c80+'/'+_0x534d0d)[_0xefe6('0x1a')](_0x10c3c0);}return null;};}function patchUpdates(_0x1976ec){return function(_0x17435){try{jsonpatch[_0xefe6('0x20')](_0x17435,_0x1976ec,!![]);}catch(_0x2bb60d){return BPromise[_0xefe6('0x21')](_0x2bb60d);}return _0x17435['save']();};}function saveUpdates(_0x4e6910,_0x305f3d){return function(_0x10c4b0){if(_0x10c4b0){return _0x10c4b0[_0xefe6('0x22')](_0x4e6910)[_0xefe6('0x23')](function(_0x505ff3){return _0x505ff3;});}return null;};}function removeEntity(_0x2fc6e4,_0x48adce){return function(_0x135118){if(_0x135118){return _0x135118['destroy']()[_0xefe6('0x23')](function(){_0x2fc6e4['status'](0xcc)[_0xefe6('0x18')]();});}};}function handleEntityNotFound(_0x27aedf,_0x202341){return function(_0x59846c){if(!_0x59846c){_0x27aedf[_0xefe6('0x24')](0x194);}return _0x59846c;};}function handleError(_0x407080,_0x4a43ad){_0x4a43ad=_0x4a43ad||0x1f4;return function(_0x4bdb8f){logger[_0xefe6('0x25')](_0x4bdb8f['stack']);if(_0x4bdb8f[_0xefe6('0x26')]){delete _0x4bdb8f[_0xefe6('0x26')];}_0x407080[_0xefe6('0x19')](_0x4a43ad)[_0xefe6('0x27')](_0x4bdb8f);};}exports[_0xefe6('0x28')]=function(_0x51f7b2,_0x4c8f11){var _0x39c982={},_0x968327={},_0xbbcc35={'count':0x0,'rows':[]};var _0x1f7300=_[_0xefe6('0x29')](db['Integration'][_0xefe6('0x2a')],function(_0x272787){return{'name':_0x272787[_0xefe6('0x2b')],'type':_0x272787['type'][_0xefe6('0x2c')]};});_0x968327[_0xefe6('0x2d')]=_['map'](_0x1f7300,_0xefe6('0x26'));_0x968327[_0xefe6('0x2e')]=_[_0xefe6('0x2f')](_0x51f7b2[_0xefe6('0x2e')]);_0x968327[_0xefe6('0x30')]=_[_0xefe6('0x31')](_0x968327['model'],_0x968327[_0xefe6('0x2e')]);_0x39c982[_0xefe6('0x32')]=_['intersection'](_0x968327[_0xefe6('0x2d')],qs[_0xefe6('0x33')](_0x51f7b2[_0xefe6('0x2e')][_0xefe6('0x33')]));_0x39c982[_0xefe6('0x32')]=_0x39c982[_0xefe6('0x32')][_0xefe6('0x34')]?_0x39c982[_0xefe6('0x32')]:_0x968327[_0xefe6('0x2d')];if(!_0x51f7b2[_0xefe6('0x2e')][_0xefe6('0x35')]('nolimit')){_0x39c982[_0xefe6('0x1d')]=qs['limit'](_0x51f7b2['query']['limit']);_0x39c982[_0xefe6('0x1c')]=qs[_0xefe6('0x1c')](_0x51f7b2[_0xefe6('0x2e')][_0xefe6('0x1c')]);}_0x39c982[_0xefe6('0x36')]=qs[_0xefe6('0x37')](_0x51f7b2[_0xefe6('0x2e')][_0xefe6('0x37')]);_0x39c982[_0xefe6('0x38')]=qs[_0xefe6('0x30')](_[_0xefe6('0x39')](_0x51f7b2[_0xefe6('0x2e')],_0x968327[_0xefe6('0x30')]),_0x1f7300);if(_0x51f7b2[_0xefe6('0x2e')][_0xefe6('0x3a')]){_0x39c982[_0xefe6('0x38')]=_['merge'](_0x39c982['where'],{'$or':_[_0xefe6('0x29')](_0x1f7300,function(_0x128361){if(_0x128361[_0xefe6('0x3b')]!=='VIRTUAL'){var _0x501099={};_0x501099[_0x128361['name']]={'$like':'%'+_0x51f7b2[_0xefe6('0x2e')][_0xefe6('0x3a')]+'%'};return _0x501099;}})});}_0x39c982=_[_0xefe6('0x3c')]({},_0x39c982,_0x51f7b2[_0xefe6('0x3d')]);var _0x452cd7={'where':_0x39c982[_0xefe6('0x38')]};return db[_0xefe6('0x3e')][_0xefe6('0x1b')](_0x452cd7)['then'](function(_0x5b48af){_0xbbcc35['count']=_0x5b48af;if(_0x51f7b2[_0xefe6('0x2e')][_0xefe6('0x3f')]){_0x39c982[_0xefe6('0x40')]=[{'all':!![]}];}return db[_0xefe6('0x3e')]['findAll'](_0x39c982);})[_0xefe6('0x23')](function(_0xcfc075){_0xbbcc35[_0xefe6('0x41')]=_0xcfc075;return _0xbbcc35;})[_0xefe6('0x23')](respondWithFilteredResult(_0x4c8f11,_0x39c982))[_0xefe6('0x42')](handleError(_0x4c8f11,null));};exports[_0xefe6('0x43')]=function(_0x5498bc,_0x48a0b6){var _0x4c109f={'raw':![],'where':{'id':_0x5498bc[_0xefe6('0x44')]['id']}},_0x5829a5={};_0x5829a5[_0xefe6('0x2d')]=_['keys'](db[_0xefe6('0x3e')]['rawAttributes']);_0x5829a5[_0xefe6('0x2e')]=_[_0xefe6('0x2f')](_0x5498bc[_0xefe6('0x2e')]);_0x5829a5['filters']=_['intersection'](_0x5829a5['model'],_0x5829a5[_0xefe6('0x2e')]);_0x4c109f['attributes']=_[_0xefe6('0x31')](_0x5829a5[_0xefe6('0x2d')],qs[_0xefe6('0x33')](_0x5498bc['query'][_0xefe6('0x33')]));_0x4c109f[_0xefe6('0x32')]=_0x4c109f[_0xefe6('0x32')][_0xefe6('0x34')]?_0x4c109f[_0xefe6('0x32')]:_0x5829a5[_0xefe6('0x2d')];if(_0x5498bc[_0xefe6('0x2e')][_0xefe6('0x3f')]){_0x4c109f['include']=[{'all':!![]}];}_0x4c109f=_['merge']({},_0x4c109f,_0x5498bc[_0xefe6('0x3d')]);return db[_0xefe6('0x3e')]['find'](_0x4c109f)['then'](handleEntityNotFound(_0x48a0b6,null))[_0xefe6('0x23')](respondWithResult(_0x48a0b6,null))[_0xefe6('0x42')](handleError(_0x48a0b6,null));};exports[_0xefe6('0x45')]=function(_0x4ee61e,_0x55791a){return db[_0xefe6('0x3e')][_0xefe6('0x45')](_0x4ee61e['body'],{})[_0xefe6('0x23')](respondWithResult(_0x55791a,0xc9))[_0xefe6('0x42')](handleError(_0x55791a,null));};exports['update']=function(_0x423e8e,_0x1f5fd8){if(_0x423e8e['body']['id']){delete _0x423e8e['body']['id'];}return db['Integration'][_0xefe6('0x46')]({'where':{'id':_0x423e8e[_0xefe6('0x44')]['id']}})[_0xefe6('0x23')](handleEntityNotFound(_0x1f5fd8,null))['then'](saveUpdates(_0x423e8e[_0xefe6('0x47')],null))[_0xefe6('0x23')](respondWithResult(_0x1f5fd8,null))[_0xefe6('0x42')](handleError(_0x1f5fd8,null));};exports[_0xefe6('0x48')]=function(_0x462819,_0x4b7dd7){return db[_0xefe6('0x3e')]['find']({'where':{'id':_0x462819['params']['id']}})[_0xefe6('0x23')](handleEntityNotFound(_0x4b7dd7,null))[_0xefe6('0x23')](removeEntity(_0x4b7dd7,null))['catch'](handleError(_0x4b7dd7,null));}; \ No newline at end of file +var _0xd342=['where','pick','filter','merge','VIRTUAL','options','Integration','includeAll','then','catch','show','params','keys','include','create','body','find','eml-format','rimraf','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','reject','save','update','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0xd342,0xd1));var _0x2d34=function(_0x16a085,_0x2a7172){_0x16a085=_0x16a085-0x0;var _0x75e021=_0xd342[_0x16a085];return _0x75e021;};'use strict';var emlformat=require(_0x2d34('0x0'));var rimraf=require(_0x2d34('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2d34('0x2'));var path=require('path');var sox=require('sox');var csv=require(_0x2d34('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d34('0x4'));var _=require('lodash');var squel=require(_0x2d34('0x5'));var crypto=require(_0x2d34('0x6'));var jsforce=require(_0x2d34('0x7'));var deskjs=require(_0x2d34('0x8'));var toCsv=require(_0x2d34('0x3'));var querystring=require('querystring');var Papa=require(_0x2d34('0x9'));var Redis=require(_0x2d34('0xa'));var authService=require(_0x2d34('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x2d34('0xc'));var hardwareService=require(_0x2d34('0xd'));var logger=require('../../config/logger')(_0x2d34('0xe'));var utils=require(_0x2d34('0xf'));var config=require(_0x2d34('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x2d34('0x11'))['db'];function respondWithStatusCode(_0x2090a3,_0x5e10e8){_0x5e10e8=_0x5e10e8||0xcc;return function(_0x4d9d39){if(_0x4d9d39){return _0x2090a3[_0x2d34('0x12')](_0x5e10e8);}return _0x2090a3[_0x2d34('0x13')](_0x5e10e8)['end']();};}function respondWithResult(_0xe8ef87,_0xef04ac){_0xef04ac=_0xef04ac||0xc8;return function(_0x4f5b01){if(_0x4f5b01){return _0xe8ef87[_0x2d34('0x13')](_0xef04ac)[_0x2d34('0x14')](_0x4f5b01);}};}function respondWithFilteredResult(_0x3c8c14,_0x375828){return function(_0x534312){if(_0x534312){var _0x141274=_0x534312[_0x2d34('0x15')],_0x5a8f53=_0x375828[_0x2d34('0x16')],_0x4870ff=_0x375828[_0x2d34('0x16')]+_0x375828[_0x2d34('0x17')],_0xe0a1c4;if(_0x4870ff>=_0x141274){_0x4870ff=_0x141274;_0xe0a1c4=0xc8;}else{_0xe0a1c4=0xce;}_0x3c8c14[_0x2d34('0x13')](_0xe0a1c4);return _0x3c8c14[_0x2d34('0x18')]('Content-Range',_0x5a8f53+'-'+_0x4870ff+'/'+_0x141274)[_0x2d34('0x14')](_0x534312);}return null;};}function patchUpdates(_0x3cae2f){return function(_0x9a4b8a){try{jsonpatch['apply'](_0x9a4b8a,_0x3cae2f,!![]);}catch(_0x4aa2f9){return BPromise[_0x2d34('0x19')](_0x4aa2f9);}return _0x9a4b8a[_0x2d34('0x1a')]();};}function saveUpdates(_0x2c5a27,_0x572c0e){return function(_0xcfc2f2){if(_0xcfc2f2){return _0xcfc2f2[_0x2d34('0x1b')](_0x2c5a27)['then'](function(_0x5e56a7){return _0x5e56a7;});}return null;};}function removeEntity(_0x472014,_0x3b4c0f){return function(_0xe58c54){if(_0xe58c54){return _0xe58c54[_0x2d34('0x1c')]()['then'](function(){_0x472014[_0x2d34('0x13')](0xcc)[_0x2d34('0x1d')]();});}};}function handleEntityNotFound(_0x1620ef,_0x1ed2da){return function(_0x2586bf){if(!_0x2586bf){_0x1620ef['sendStatus'](0x194);}return _0x2586bf;};}function handleError(_0x2f89ab,_0x31d21e){_0x31d21e=_0x31d21e||0x1f4;return function(_0x583a9e){logger[_0x2d34('0x1e')](_0x583a9e['stack']);if(_0x583a9e[_0x2d34('0x1f')]){delete _0x583a9e['name'];}_0x2f89ab['status'](_0x31d21e)[_0x2d34('0x20')](_0x583a9e);};}exports[_0x2d34('0x21')]=function(_0x8bc8a6,_0x242c43){var _0x55a0df={},_0x33002a={},_0x48f771={'count':0x0,'rows':[]};var _0x2a2e3d=_[_0x2d34('0x22')](db['Integration'][_0x2d34('0x23')],function(_0x4ffceb){return{'name':_0x4ffceb[_0x2d34('0x24')],'type':_0x4ffceb[_0x2d34('0x25')][_0x2d34('0x26')]};});_0x33002a[_0x2d34('0x27')]=_[_0x2d34('0x22')](_0x2a2e3d,_0x2d34('0x1f'));_0x33002a[_0x2d34('0x28')]=_['keys'](_0x8bc8a6[_0x2d34('0x28')]);_0x33002a[_0x2d34('0x29')]=_[_0x2d34('0x2a')](_0x33002a[_0x2d34('0x27')],_0x33002a[_0x2d34('0x28')]);_0x55a0df[_0x2d34('0x2b')]=_[_0x2d34('0x2a')](_0x33002a[_0x2d34('0x27')],qs[_0x2d34('0x2c')](_0x8bc8a6['query'][_0x2d34('0x2c')]));_0x55a0df[_0x2d34('0x2b')]=_0x55a0df[_0x2d34('0x2b')]['length']?_0x55a0df[_0x2d34('0x2b')]:_0x33002a[_0x2d34('0x27')];if(!_0x8bc8a6[_0x2d34('0x28')][_0x2d34('0x2d')]('nolimit')){_0x55a0df[_0x2d34('0x17')]=qs[_0x2d34('0x17')](_0x8bc8a6[_0x2d34('0x28')][_0x2d34('0x17')]);_0x55a0df['offset']=qs[_0x2d34('0x16')](_0x8bc8a6[_0x2d34('0x28')]['offset']);}_0x55a0df['order']=qs['sort'](_0x8bc8a6[_0x2d34('0x28')][_0x2d34('0x2e')]);_0x55a0df[_0x2d34('0x2f')]=qs['filters'](_[_0x2d34('0x30')](_0x8bc8a6[_0x2d34('0x28')],_0x33002a[_0x2d34('0x29')]),_0x2a2e3d);if(_0x8bc8a6[_0x2d34('0x28')][_0x2d34('0x31')]){_0x55a0df[_0x2d34('0x2f')]=_[_0x2d34('0x32')](_0x55a0df[_0x2d34('0x2f')],{'$or':_[_0x2d34('0x22')](_0x2a2e3d,function(_0x421001){if(_0x421001[_0x2d34('0x25')]!==_0x2d34('0x33')){var _0x3eac7c={};_0x3eac7c[_0x421001[_0x2d34('0x1f')]]={'$like':'%'+_0x8bc8a6[_0x2d34('0x28')][_0x2d34('0x31')]+'%'};return _0x3eac7c;}})});}_0x55a0df=_[_0x2d34('0x32')]({},_0x55a0df,_0x8bc8a6[_0x2d34('0x34')]);var _0x4997da={'where':_0x55a0df[_0x2d34('0x2f')]};return db[_0x2d34('0x35')][_0x2d34('0x15')](_0x4997da)['then'](function(_0xda5b57){_0x48f771[_0x2d34('0x15')]=_0xda5b57;if(_0x8bc8a6[_0x2d34('0x28')][_0x2d34('0x36')]){_0x55a0df['include']=[{'all':!![]}];}return db[_0x2d34('0x35')]['findAll'](_0x55a0df);})[_0x2d34('0x37')](function(_0x17f23c){_0x48f771['rows']=_0x17f23c;return _0x48f771;})[_0x2d34('0x37')](respondWithFilteredResult(_0x242c43,_0x55a0df))[_0x2d34('0x38')](handleError(_0x242c43,null));};exports[_0x2d34('0x39')]=function(_0x14d8be,_0x262c53){var _0x6afef0={'raw':![],'where':{'id':_0x14d8be[_0x2d34('0x3a')]['id']}},_0x21947a={};_0x21947a[_0x2d34('0x27')]=_[_0x2d34('0x3b')](db[_0x2d34('0x35')][_0x2d34('0x23')]);_0x21947a['query']=_['keys'](_0x14d8be[_0x2d34('0x28')]);_0x21947a[_0x2d34('0x29')]=_[_0x2d34('0x2a')](_0x21947a[_0x2d34('0x27')],_0x21947a[_0x2d34('0x28')]);_0x6afef0[_0x2d34('0x2b')]=_[_0x2d34('0x2a')](_0x21947a[_0x2d34('0x27')],qs[_0x2d34('0x2c')](_0x14d8be[_0x2d34('0x28')][_0x2d34('0x2c')]));_0x6afef0[_0x2d34('0x2b')]=_0x6afef0[_0x2d34('0x2b')]['length']?_0x6afef0[_0x2d34('0x2b')]:_0x21947a[_0x2d34('0x27')];if(_0x14d8be[_0x2d34('0x28')][_0x2d34('0x36')]){_0x6afef0[_0x2d34('0x3c')]=[{'all':!![]}];}_0x6afef0=_['merge']({},_0x6afef0,_0x14d8be[_0x2d34('0x34')]);return db[_0x2d34('0x35')]['find'](_0x6afef0)['then'](handleEntityNotFound(_0x262c53,null))['then'](respondWithResult(_0x262c53,null))[_0x2d34('0x38')](handleError(_0x262c53,null));};exports[_0x2d34('0x3d')]=function(_0x53d9cb,_0x40e2a5){return db[_0x2d34('0x35')]['create'](_0x53d9cb['body'],{})['then'](respondWithResult(_0x40e2a5,0xc9))[_0x2d34('0x38')](handleError(_0x40e2a5,null));};exports['update']=function(_0x2e5aa3,_0x13c3ac){if(_0x2e5aa3[_0x2d34('0x3e')]['id']){delete _0x2e5aa3[_0x2d34('0x3e')]['id'];}return db[_0x2d34('0x35')][_0x2d34('0x3f')]({'where':{'id':_0x2e5aa3['params']['id']}})['then'](handleEntityNotFound(_0x13c3ac,null))[_0x2d34('0x37')](saveUpdates(_0x2e5aa3['body'],null))[_0x2d34('0x37')](respondWithResult(_0x13c3ac,null))[_0x2d34('0x38')](handleError(_0x13c3ac,null));};exports[_0x2d34('0x1c')]=function(_0x34b6b9,_0x2d2bf6){return db[_0x2d34('0x35')][_0x2d34('0x3f')]({'where':{'id':_0x34b6b9[_0x2d34('0x3a')]['id']}})[_0x2d34('0x37')](handleEntityNotFound(_0x2d2bf6,null))[_0x2d34('0x37')](removeEntity(_0x2d2bf6,null))['catch'](handleError(_0x2d2bf6,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 32d25fb..cd911b3 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 _0x7e11=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger'];(function(_0x333835,_0x5c9507){var _0x43ca51=function(_0x4f95a9){while(--_0x4f95a9){_0x333835['push'](_0x333835['shift']());}};_0x43ca51(++_0x5c9507);}(_0x7e11,0x185));var _0x17e1=function(_0x4b457e,_0x3b6c7d){_0x4b457e=_0x4b457e-0x0;var _0x4e68b7=_0x7e11[_0x4b457e];return _0x4e68b7;};'use strict';var _=require(_0x17e1('0x0'));var util=require(_0x17e1('0x1'));var logger=require(_0x17e1('0x2'))(_0x17e1('0x3'));var moment=require(_0x17e1('0x4'));var BPromise=require(_0x17e1('0x5'));var rp=require(_0x17e1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17e1('0x7'));var config=require(_0x17e1('0x8'));var attributes=require(_0x17e1('0x9'));module[_0x17e1('0xa')]=function(_0x49a55c,_0x1ad71b){return _0x49a55c[_0x17e1('0xb')](_0x17e1('0xc'),attributes,{'tableName':_0x17e1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9932=['Integration','integrations','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./integration.attributes'];(function(_0xb27e08,_0x24205b){var _0x369a71=function(_0x3320cf){while(--_0x3320cf){_0xb27e08['push'](_0xb27e08['shift']());}};_0x369a71(++_0x24205b);}(_0x9932,0x192));var _0x2993=function(_0x164760,_0x5874b0){_0x164760=_0x164760-0x0;var _0x8b91b2=_0x9932[_0x164760];return _0x8b91b2;};'use strict';var _=require(_0x2993('0x0'));var util=require(_0x2993('0x1'));var logger=require(_0x2993('0x2'))('api');var moment=require(_0x2993('0x3'));var BPromise=require(_0x2993('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2993('0x5'));var rimraf=require(_0x2993('0x6'));var config=require('../../config/environment');var attributes=require(_0x2993('0x7'));module['exports']=function(_0x2410fc,_0x43ba13){return _0x2410fc['define'](_0x2993('0x8'),attributes,{'tableName':_0x2993('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 1111709..ff6d407 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 _0x444a=['request','info','debug','request\x20sent','stringify','error','code','message','Integration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x444a,0x170));var _0xa444=function(_0x3a607e,_0x54d530){_0x3a607e=_0x3a607e-0x0;var _0x37b106=_0x444a[_0x3a607e];return _0x37b106;};'use strict';var _=require(_0xa444('0x0'));var util=require('util');var moment=require(_0xa444('0x1'));var BPromise=require(_0xa444('0x2'));var rs=require(_0xa444('0x3'));var fs=require('fs');var Redis=require(_0xa444('0x4'));var db=require(_0xa444('0x5'))['db'];var utils=require(_0xa444('0x6'));var logger=require('../../config/logger')(_0xa444('0x7'));var config=require('../../config/environment');var jayson=require(_0xa444('0x8'));var client=jayson['client'][_0xa444('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1782e4,_0x16c38d,_0x136a95){return new BPromise(function(_0x56b735,_0x22830f){return client[_0xa444('0xa')](_0x1782e4,_0x136a95)['then'](function(_0x1e4332){logger[_0xa444('0xb')]('Integration,\x20%s,\x20%s',_0x16c38d,'request\x20sent');logger[_0xa444('0xc')]('Integration,\x20%s,\x20%s,\x20%s',_0x16c38d,_0xa444('0xd'),JSON[_0xa444('0xe')](_0x1e4332));if(_0x1e4332[_0xa444('0xf')]){if(_0x1e4332[_0xa444('0xf')][_0xa444('0x10')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x16c38d,_0x1e4332[_0xa444('0xf')]['message']);return _0x22830f(_0x1e4332['error']['message']);}logger[_0xa444('0xf')]('Integration,\x20%s,\x20%s',_0x16c38d,_0x1e4332[_0xa444('0xf')][_0xa444('0x11')]);return _0x56b735(_0x1e4332[_0xa444('0xf')][_0xa444('0x11')]);}else{logger[_0xa444('0xb')](_0xa444('0x12'),_0x16c38d,_0xa444('0xd'));_0x56b735(_0x1e4332[_0xa444('0x13')][_0xa444('0x11')]);}})[_0xa444('0x14')](function(_0x21ee23){logger[_0xa444('0xf')](_0xa444('0x12'),_0x16c38d,_0x21ee23);_0x22830f(_0x21ee23);});});} \ No newline at end of file +var _0xef8b=['error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2de57e,_0x592c32){var _0x318a6e=function(_0xd16801){while(--_0xd16801){_0x2de57e['push'](_0x2de57e['shift']());}};_0x318a6e(++_0x592c32);}(_0xef8b,0x192));var _0xbef8=function(_0x3a3b9e,_0xc59037){_0x3a3b9e=_0x3a3b9e-0x0;var _0x148103=_0xef8b[_0x3a3b9e];return _0x148103;};'use strict';var _=require('lodash');var util=require(_0xbef8('0x0'));var moment=require(_0xbef8('0x1'));var BPromise=require(_0xbef8('0x2'));var rs=require(_0xbef8('0x3'));var fs=require('fs');var Redis=require(_0xbef8('0x4'));var db=require(_0xbef8('0x5'))['db'];var utils=require(_0xbef8('0x6'));var logger=require(_0xbef8('0x7'))(_0xbef8('0x8'));var config=require(_0xbef8('0x9'));var jayson=require(_0xbef8('0xa'));var client=jayson['client'][_0xbef8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x359be9,_0x26b756,_0x5d2773){return new BPromise(function(_0x22d84e,_0x1a6d83){return client['request'](_0x359be9,_0x5d2773)['then'](function(_0x48addc){logger[_0xbef8('0xc')](_0xbef8('0xd'),_0x26b756,_0xbef8('0xe'));logger[_0xbef8('0xf')](_0xbef8('0x10'),_0x26b756,_0xbef8('0xe'),JSON[_0xbef8('0x11')](_0x48addc));if(_0x48addc[_0xbef8('0x12')]){if(_0x48addc[_0xbef8('0x12')]['code']===0x1f4){logger[_0xbef8('0x12')](_0xbef8('0xd'),_0x26b756,_0x48addc[_0xbef8('0x12')]['message']);return _0x1a6d83(_0x48addc['error']['message']);}logger[_0xbef8('0x12')]('Integration,\x20%s,\x20%s',_0x26b756,_0x48addc[_0xbef8('0x12')][_0xbef8('0x13')]);return _0x22d84e(_0x48addc['error'][_0xbef8('0x13')]);}else{logger['info']('Integration,\x20%s,\x20%s',_0x26b756,_0xbef8('0xe'));_0x22d84e(_0x48addc['result']['message']);}})[_0xbef8('0x14')](function(_0x1e8060){logger[_0xbef8('0x12')](_0xbef8('0xd'),_0x26b756,_0x1e8060);_0x1a6d83(_0x1e8060);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 2b7429c..b80044a 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 _0xdf2c=['show','post','create','put','update','delete','exports','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2241e1,_0x2d07bf){var _0x5e8a3a=function(_0x215002){while(--_0x215002){_0x2241e1['push'](_0x2241e1['shift']());}};_0x5e8a3a(++_0x2d07bf);}(_0xdf2c,0x16f));var _0xcdf2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdf2c[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcdf2('0x0'));var timeout=require('connect-timeout');var express=require(_0xcdf2('0x1'));var router=express[_0xcdf2('0x2')]();var fs_extra=require(_0xcdf2('0x3'));var auth=require(_0xcdf2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcdf2('0x5'));var controller=require(_0xcdf2('0x6'));router[_0xcdf2('0x7')]('/',auth[_0xcdf2('0x8')](),controller[_0xcdf2('0x9')]);router['get'](_0xcdf2('0xa'),auth['isAuthenticated'](),controller[_0xcdf2('0xb')]);router[_0xcdf2('0x7')](_0xcdf2('0xc'),auth[_0xcdf2('0x8')](),controller[_0xcdf2('0xd')]);router[_0xcdf2('0xe')]('/',auth['isAuthenticated'](),controller[_0xcdf2('0xf')]);router[_0xcdf2('0x10')]('/:id',auth[_0xcdf2('0x8')](),controller[_0xcdf2('0x11')]);router[_0xcdf2('0x12')](_0xcdf2('0xc'),auth[_0xcdf2('0x8')](),controller['destroy']);module[_0xcdf2('0x13')]=router; \ No newline at end of file +var _0xa4da=['../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','show','post','create','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x27cbb2,_0x9e317b){var _0x50db55=function(_0x23ac18){while(--_0x23ac18){_0x27cbb2['push'](_0x27cbb2['shift']());}};_0x50db55(++_0x9e317b);}(_0xa4da,0x188));var _0xaa4d=function(_0x500785,_0x15e5ff){_0x500785=_0x500785-0x0;var _0x1f8bcc=_0xa4da[_0x500785];return _0x1f8bcc;};'use strict';var multer=require(_0xaa4d('0x0'));var util=require(_0xaa4d('0x1'));var path=require(_0xaa4d('0x2'));var timeout=require(_0xaa4d('0x3'));var express=require('express');var router=express[_0xaa4d('0x4')]();var fs_extra=require(_0xaa4d('0x5'));var auth=require(_0xaa4d('0x6'));var interaction=require(_0xaa4d('0x7'));var config=require(_0xaa4d('0x8'));var controller=require(_0xaa4d('0x9'));router[_0xaa4d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaa4d('0xa')](_0xaa4d('0xb'),auth[_0xaa4d('0xc')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xaa4d('0xd')]);router[_0xaa4d('0xe')]('/',auth[_0xaa4d('0xc')](),controller[_0xaa4d('0xf')]);router['put'](_0xaa4d('0x10'),auth['isAuthenticated'](),controller[_0xaa4d('0x11')]);router[_0xaa4d('0x12')]('/:id',auth[_0xaa4d('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index b6350e7..dbdca6e 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 _0xbb39=['BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED','sequelize','STRING','INTEGER','DATE'];(function(_0xe64d38,_0x578aab){var _0x198922=function(_0x580e80){while(--_0x580e80){_0xe64d38['push'](_0xe64d38['shift']());}};_0x198922(++_0x578aab);}(_0xbb39,0x1c8));var _0x9bb3=function(_0x2d460c,_0x4f08c0){_0x2d460c=_0x2d460c-0x0;var _0xf6fc4c=_0xbb39[_0x2d460c];return _0xf6fc4c;};'use strict';var Sequelize=require(_0x9bb3('0x0'));module['exports']={'integration':{'type':Sequelize[_0x9bb3('0x1')]},'eventChannel':{'type':Sequelize[_0x9bb3('0x1')]},'exitStatus':{'type':Sequelize[_0x9bb3('0x1')]},'ticketId':{'type':Sequelize[_0x9bb3('0x1')]},'integrationId':{'type':Sequelize[_0x9bb3('0x2')]},'contacts':{'type':Sequelize[_0x9bb3('0x1')]},'uniqueid':{'type':Sequelize[_0x9bb3('0x1')]},'calleridnum':{'type':Sequelize[_0x9bb3('0x1')]},'calleridname':{'type':Sequelize[_0x9bb3('0x1')]},'queue':{'type':Sequelize[_0x9bb3('0x1')]},'interface':{'type':Sequelize[_0x9bb3('0x1')]},'membername':{'type':Sequelize[_0x9bb3('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x9bb3('0x3')]},'holdtime':{'type':Sequelize[_0x9bb3('0x2')]},'agentcomplete':{'type':Sequelize[_0x9bb3('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x9bb3('0x3')]},'talktime':{'type':Sequelize[_0x9bb3('0x2')]},'agentacw':{'type':Sequelize[_0x9bb3('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9bb3('0x2')]},'reason':{'type':Sequelize[_0x9bb3('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x9bb3('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x9bb3('0x3')]},'agentdump':{'type':Sequelize[_0x9bb3('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x9bb3('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9bb3('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9bb3('0x1')]},'connectedlinename':{'type':Sequelize[_0x9bb3('0x1')]},'language':{'type':Sequelize[_0x9bb3('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9bb3('0x1')]},'exten':{'type':Sequelize[_0x9bb3('0x1')]},'priority':{'type':Sequelize[_0x9bb3('0x1')]},'destchannel':{'type':Sequelize[_0x9bb3('0x1')]},'destchannelstate':{'type':Sequelize[_0x9bb3('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9bb3('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x9bb3('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x9bb3('0x1')]},'destlanguage':{'type':Sequelize[_0x9bb3('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9bb3('0x1')]},'destexten':{'type':Sequelize[_0x9bb3('0x1')]},'destpriority':{'type':Sequelize[_0x9bb3('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x9bb3('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x9bb3('0x1')]},'from':{'type':Sequelize[_0x9bb3('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x9bb3('0x1')]},'attachment':{'type':Sequelize[_0x9bb3('0x5')]},'html':{'type':Sequelize[_0x9bb3('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x9bb3('0x6')](_0x9bb3('0x7'),_0x9bb3('0x8'),'RECEIVED',_0x9bb3('0x9'))},'url':{'type':Sequelize[_0x9bb3('0x1')]},'app':{'type':Sequelize[_0x9bb3('0x1')]},'appdata':{'type':Sequelize[_0x9bb3('0x1')]},'projectId':{'type':Sequelize[_0x9bb3('0x2')]}}; \ No newline at end of file +var _0xb2d7=['SENDING','RECEIVED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0xb2d7,0x107));var _0x7b2d=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0xb2d7[_0x4394b6];return _0x360244;};'use strict';var Sequelize=require('sequelize');module[_0x7b2d('0x0')]={'integration':{'type':Sequelize[_0x7b2d('0x1')]},'eventChannel':{'type':Sequelize[_0x7b2d('0x1')]},'exitStatus':{'type':Sequelize[_0x7b2d('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x7b2d('0x2')]},'contacts':{'type':Sequelize[_0x7b2d('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7b2d('0x1')]},'calleridname':{'type':Sequelize[_0x7b2d('0x1')]},'queue':{'type':Sequelize[_0x7b2d('0x1')]},'interface':{'type':Sequelize[_0x7b2d('0x1')]},'membername':{'type':Sequelize[_0x7b2d('0x1')]},'agentcalledAt':{'type':Sequelize[_0x7b2d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x7b2d('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7b2d('0x3')]},'talktime':{'type':Sequelize[_0x7b2d('0x2')]},'agentacw':{'type':Sequelize[_0x7b2d('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x7b2d('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x7b2d('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7b2d('0x3')]},'agentdump':{'type':Sequelize[_0x7b2d('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7b2d('0x3')]},'lastevent':{'type':Sequelize[_0x7b2d('0x1')]},'channel':{'type':Sequelize[_0x7b2d('0x1')]},'channelstate':{'type':Sequelize[_0x7b2d('0x2')]},'channelstatedesc':{'type':Sequelize[_0x7b2d('0x1')]},'connectedlinenum':{'type':Sequelize[_0x7b2d('0x1')]},'connectedlinename':{'type':Sequelize[_0x7b2d('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7b2d('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7b2d('0x1')]},'priority':{'type':Sequelize[_0x7b2d('0x1')]},'destchannel':{'type':Sequelize[_0x7b2d('0x1')]},'destchannelstate':{'type':Sequelize[_0x7b2d('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x7b2d('0x1')]},'destcalleridnum':{'type':Sequelize[_0x7b2d('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x7b2d('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x7b2d('0x1')]},'destlanguage':{'type':Sequelize[_0x7b2d('0x1')]},'destaccountcode':{'type':Sequelize[_0x7b2d('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x7b2d('0x1')]},'destpriority':{'type':Sequelize[_0x7b2d('0x1')]},'destuniqueid':{'type':Sequelize[_0x7b2d('0x1')]},'messageId':{'type':Sequelize[_0x7b2d('0x1')]},'inReplyTo':{'type':Sequelize[_0x7b2d('0x1')]},'subject':{'type':Sequelize[_0x7b2d('0x1')]},'from':{'type':Sequelize[_0x7b2d('0x1')]},'to':{'type':Sequelize[_0x7b2d('0x1')]},'cc':{'type':Sequelize[_0x7b2d('0x1')]},'attachment':{'type':Sequelize[_0x7b2d('0x5')]},'html':{'type':Sequelize[_0x7b2d('0x5')]},'text':{'type':Sequelize[_0x7b2d('0x5')]},'status':{'type':Sequelize[_0x7b2d('0x6')]('SENT',_0x7b2d('0x7'),_0x7b2d('0x8'),'FAILED')},'url':{'type':Sequelize[_0x7b2d('0x1')]},'app':{'type':Sequelize[_0x7b2d('0x1')]},'appdata':{'type':Sequelize[_0x7b2d('0x1')]},'projectId':{'type':Sequelize[_0x7b2d('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index b0e6451..4901452 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 _0x7f47=['rows','catch','rawAttributes','includeAll','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','count','offset','limit','status','Content-Range','json','apply','reject','save','update','then','destroy','error','name','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','IntegrationReport'];(function(_0x321248,_0x1bf881){var _0x32db83=function(_0x2321fc){while(--_0x2321fc){_0x321248['push'](_0x321248['shift']());}};_0x32db83(++_0x1bf881);}(_0x7f47,0x12e));var _0x77f4=function(_0x1d3791,_0x51c613){_0x1d3791=_0x1d3791-0x0;var _0x40fbf5=_0x7f47[_0x1d3791];return _0x40fbf5;};'use strict';var emlformat=require(_0x77f4('0x0'));var rimraf=require(_0x77f4('0x1'));var zipdir=require(_0x77f4('0x2'));var jsonpatch=require(_0x77f4('0x3'));var rp=require(_0x77f4('0x4'));var moment=require(_0x77f4('0x5'));var BPromise=require(_0x77f4('0x6'));var Mustache=require(_0x77f4('0x7'));var util=require('util');var path=require(_0x77f4('0x8'));var sox=require(_0x77f4('0x9'));var csv=require(_0x77f4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77f4('0xb'));var _=require('lodash');var squel=require(_0x77f4('0xc'));var crypto=require(_0x77f4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x77f4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x77f4('0xf'));var Papa=require(_0x77f4('0x10'));var Redis=require('ioredis');var authService=require(_0x77f4('0x11'));var qs=require(_0x77f4('0x12'));var as=require(_0x77f4('0x13'));var hardwareService=require(_0x77f4('0x14'));var logger=require('../../config/logger')(_0x77f4('0x15'));var utils=require(_0x77f4('0x16'));var config=require(_0x77f4('0x17'));var licenseUtil=require(_0x77f4('0x18'));var db=require(_0x77f4('0x19'))['db'];function respondWithStatusCode(_0x2a0243,_0x47428a){_0x47428a=_0x47428a||0xcc;return function(_0x15cce6){if(_0x15cce6){return _0x2a0243[_0x77f4('0x1a')](_0x47428a);}return _0x2a0243['status'](_0x47428a)[_0x77f4('0x1b')]();};}function respondWithResult(_0xd23097,_0x15a137){_0x15a137=_0x15a137||0xc8;return function(_0x2fadaf){if(_0x2fadaf){return _0xd23097['status'](_0x15a137)['json'](_0x2fadaf);}};}function respondWithFilteredResult(_0x2d2dbb,_0x18848d){return function(_0x249237){if(_0x249237){var _0x395bb1=_0x249237[_0x77f4('0x1c')],_0x5a8a43=_0x18848d[_0x77f4('0x1d')],_0x310435=_0x18848d[_0x77f4('0x1d')]+_0x18848d[_0x77f4('0x1e')],_0x9ed030;if(_0x310435>=_0x395bb1){_0x310435=_0x395bb1;_0x9ed030=0xc8;}else{_0x9ed030=0xce;}_0x2d2dbb[_0x77f4('0x1f')](_0x9ed030);return _0x2d2dbb['set'](_0x77f4('0x20'),_0x5a8a43+'-'+_0x310435+'/'+_0x395bb1)[_0x77f4('0x21')](_0x249237);}return null;};}function patchUpdates(_0xdf6582){return function(_0x3773a5){try{jsonpatch[_0x77f4('0x22')](_0x3773a5,_0xdf6582,!![]);}catch(_0x39e15c){return BPromise[_0x77f4('0x23')](_0x39e15c);}return _0x3773a5[_0x77f4('0x24')]();};}function saveUpdates(_0x49a688,_0x46ac19){return function(_0x2c7faa){if(_0x2c7faa){return _0x2c7faa[_0x77f4('0x25')](_0x49a688)[_0x77f4('0x26')](function(_0x4067a4){return _0x4067a4;});}return null;};}function removeEntity(_0x20cd71,_0x4ad47b){return function(_0x5ea739){if(_0x5ea739){return _0x5ea739[_0x77f4('0x27')]()[_0x77f4('0x26')](function(){_0x20cd71[_0x77f4('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12c3d5,_0x4a3e98){return function(_0x508076){if(!_0x508076){_0x12c3d5[_0x77f4('0x1a')](0x194);}return _0x508076;};}function handleError(_0x20519d,_0x560213){_0x560213=_0x560213||0x1f4;return function(_0x16c4a6){logger[_0x77f4('0x28')](_0x16c4a6['stack']);if(_0x16c4a6['name']){delete _0x16c4a6[_0x77f4('0x29')];}_0x20519d[_0x77f4('0x1f')](_0x560213)['send'](_0x16c4a6);};}exports['index']=function(_0x98b961,_0x3d487c){var _0x22a69d={},_0x4bef97={},_0x3f45a1={'count':0x0,'rows':[]};var _0x1542c8=_['map'](db['IntegrationReport']['rawAttributes'],function(_0x5c6c27){return{'name':_0x5c6c27['fieldName'],'type':_0x5c6c27[_0x77f4('0x2a')][_0x77f4('0x2b')]};});_0x4bef97[_0x77f4('0x2c')]=_[_0x77f4('0x2d')](_0x1542c8,_0x77f4('0x29'));_0x4bef97[_0x77f4('0x2e')]=_[_0x77f4('0x2f')](_0x98b961[_0x77f4('0x2e')]);_0x4bef97[_0x77f4('0x30')]=_[_0x77f4('0x31')](_0x4bef97[_0x77f4('0x2c')],_0x4bef97['query']);_0x22a69d[_0x77f4('0x32')]=_['intersection'](_0x4bef97[_0x77f4('0x2c')],qs[_0x77f4('0x33')](_0x98b961[_0x77f4('0x2e')][_0x77f4('0x33')]));_0x22a69d[_0x77f4('0x32')]=_0x22a69d[_0x77f4('0x32')][_0x77f4('0x34')]?_0x22a69d[_0x77f4('0x32')]:_0x4bef97['model'];if(!_0x98b961[_0x77f4('0x2e')][_0x77f4('0x35')](_0x77f4('0x36'))){_0x22a69d[_0x77f4('0x1e')]=qs['limit'](_0x98b961[_0x77f4('0x2e')][_0x77f4('0x1e')]);_0x22a69d[_0x77f4('0x1d')]=qs['offset'](_0x98b961[_0x77f4('0x2e')][_0x77f4('0x1d')]);}_0x22a69d['order']=qs[_0x77f4('0x37')](_0x98b961[_0x77f4('0x2e')][_0x77f4('0x37')]);_0x22a69d['where']=qs['filters'](_[_0x77f4('0x38')](_0x98b961[_0x77f4('0x2e')],_0x4bef97['filters']),_0x1542c8);if(_0x98b961[_0x77f4('0x2e')]['filter']){_0x22a69d[_0x77f4('0x39')]=_[_0x77f4('0x3a')](_0x22a69d[_0x77f4('0x39')],{'$or':_[_0x77f4('0x2d')](_0x1542c8,function(_0x4390e3){if(_0x4390e3['type']!==_0x77f4('0x3b')){var _0x398369={};_0x398369[_0x4390e3[_0x77f4('0x29')]]={'$like':'%'+_0x98b961['query'][_0x77f4('0x3c')]+'%'};return _0x398369;}})});}_0x22a69d=_[_0x77f4('0x3a')]({},_0x22a69d,_0x98b961[_0x77f4('0x3d')]);var _0x4be843={'where':_0x22a69d['where']};return db['IntegrationReport'][_0x77f4('0x1c')](_0x4be843)[_0x77f4('0x26')](function(_0x1ab721){_0x3f45a1[_0x77f4('0x1c')]=_0x1ab721;if(_0x98b961['query']['includeAll']){_0x22a69d['include']=[{'all':!![]}];}return db[_0x77f4('0x3e')]['findAll'](_0x22a69d);})['then'](function(_0x4b098a){_0x3f45a1[_0x77f4('0x3f')]=_0x4b098a;return _0x3f45a1;})[_0x77f4('0x26')](respondWithFilteredResult(_0x3d487c,_0x22a69d))[_0x77f4('0x40')](handleError(_0x3d487c,null));};exports['show']=function(_0x26fed3,_0x372618){var _0x4ed9c9={'raw':![],'where':{'id':_0x26fed3['params']['id']}},_0x56d0d8={};_0x56d0d8[_0x77f4('0x2c')]=_['keys'](db[_0x77f4('0x3e')][_0x77f4('0x41')]);_0x56d0d8['query']=_[_0x77f4('0x2f')](_0x26fed3[_0x77f4('0x2e')]);_0x56d0d8[_0x77f4('0x30')]=_[_0x77f4('0x31')](_0x56d0d8[_0x77f4('0x2c')],_0x56d0d8['query']);_0x4ed9c9['attributes']=_[_0x77f4('0x31')](_0x56d0d8[_0x77f4('0x2c')],qs[_0x77f4('0x33')](_0x26fed3[_0x77f4('0x2e')][_0x77f4('0x33')]));_0x4ed9c9[_0x77f4('0x32')]=_0x4ed9c9[_0x77f4('0x32')][_0x77f4('0x34')]?_0x4ed9c9[_0x77f4('0x32')]:_0x56d0d8[_0x77f4('0x2c')];if(_0x26fed3[_0x77f4('0x2e')][_0x77f4('0x42')]){_0x4ed9c9[_0x77f4('0x43')]=[{'all':!![]}];}_0x4ed9c9=_[_0x77f4('0x3a')]({},_0x4ed9c9,_0x26fed3[_0x77f4('0x3d')]);return db[_0x77f4('0x3e')][_0x77f4('0x44')](_0x4ed9c9)['then'](handleEntityNotFound(_0x372618,null))[_0x77f4('0x26')](respondWithResult(_0x372618,null))[_0x77f4('0x40')](handleError(_0x372618,null));};exports[_0x77f4('0x45')]=function(_0x5d4d06,_0x251dfe){return db[_0x77f4('0x3e')][_0x77f4('0x45')](_0x5d4d06['body'],{})[_0x77f4('0x26')](respondWithResult(_0x251dfe,0xc9))[_0x77f4('0x40')](handleError(_0x251dfe,null));};exports['update']=function(_0x39d7bb,_0x186bb8){if(_0x39d7bb[_0x77f4('0x46')]['id']){delete _0x39d7bb['body']['id'];}return db[_0x77f4('0x3e')][_0x77f4('0x44')]({'where':{'id':_0x39d7bb[_0x77f4('0x47')]['id']}})['then'](handleEntityNotFound(_0x186bb8,null))[_0x77f4('0x26')](saveUpdates(_0x39d7bb[_0x77f4('0x46')],null))[_0x77f4('0x26')](respondWithResult(_0x186bb8,null))[_0x77f4('0x40')](handleError(_0x186bb8,null));};exports['destroy']=function(_0x456f19,_0x92f207){return db[_0x77f4('0x3e')]['find']({'where':{'id':_0x456f19['params']['id']}})[_0x77f4('0x26')](handleEntityNotFound(_0x92f207,null))[_0x77f4('0x26')](removeEntity(_0x92f207,null))[_0x77f4('0x40')](handleError(_0x92f207,null));};exports[_0x77f4('0x48')]=function(_0xbb2a3a,_0x158e1c){return db[_0x77f4('0x3e')][_0x77f4('0x48')]()[_0x77f4('0x26')](respondWithResult(_0x158e1c,null))[_0x77f4('0x40')](handleError(_0x158e1c,null));}; \ No newline at end of file +var _0x1e7c=['reject','save','update','destroy','then','error','stack','name','send','index','IntegrationReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','includeAll','include','catch','params','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1e7c,0x186));var _0xc1e7=function(_0x585dfa,_0x522eac){_0x585dfa=_0x585dfa-0x0;var _0x34dc0e=_0x1e7c[_0x585dfa];return _0x34dc0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1e7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1e7('0x1'));var rp=require(_0xc1e7('0x2'));var moment=require(_0xc1e7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc1e7('0x4'));var util=require(_0xc1e7('0x5'));var path=require(_0xc1e7('0x6'));var sox=require(_0xc1e7('0x7'));var csv=require(_0xc1e7('0x8'));var ejs=require(_0xc1e7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1e7('0xa'));var squel=require(_0xc1e7('0xb'));var crypto=require('crypto');var jsforce=require(_0xc1e7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc1e7('0x8'));var querystring=require(_0xc1e7('0xd'));var Papa=require(_0xc1e7('0xe'));var Redis=require(_0xc1e7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc1e7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc1e7('0x11'));var config=require(_0xc1e7('0x12'));var licenseUtil=require(_0xc1e7('0x13'));var db=require(_0xc1e7('0x14'))['db'];function respondWithStatusCode(_0x37ded2,_0x3c20a3){_0x3c20a3=_0x3c20a3||0xcc;return function(_0x5babc9){if(_0x5babc9){return _0x37ded2[_0xc1e7('0x15')](_0x3c20a3);}return _0x37ded2[_0xc1e7('0x16')](_0x3c20a3)[_0xc1e7('0x17')]();};}function respondWithResult(_0x13b196,_0x2d1b00){_0x2d1b00=_0x2d1b00||0xc8;return function(_0x4495e1){if(_0x4495e1){return _0x13b196[_0xc1e7('0x16')](_0x2d1b00)[_0xc1e7('0x18')](_0x4495e1);}};}function respondWithFilteredResult(_0x30e68e,_0x49ed02){return function(_0x5c0820){if(_0x5c0820){var _0x333061=_0x5c0820[_0xc1e7('0x19')],_0x472a8c=_0x49ed02[_0xc1e7('0x1a')],_0xbcbb6=_0x49ed02['offset']+_0x49ed02['limit'],_0x2e3bac;if(_0xbcbb6>=_0x333061){_0xbcbb6=_0x333061;_0x2e3bac=0xc8;}else{_0x2e3bac=0xce;}_0x30e68e['status'](_0x2e3bac);return _0x30e68e[_0xc1e7('0x1b')](_0xc1e7('0x1c'),_0x472a8c+'-'+_0xbcbb6+'/'+_0x333061)[_0xc1e7('0x18')](_0x5c0820);}return null;};}function patchUpdates(_0xb2e5c6){return function(_0x407efd){try{jsonpatch[_0xc1e7('0x1d')](_0x407efd,_0xb2e5c6,!![]);}catch(_0x27cd7d){return BPromise[_0xc1e7('0x1e')](_0x27cd7d);}return _0x407efd[_0xc1e7('0x1f')]();};}function saveUpdates(_0x1cb888,_0x22eee9){return function(_0x5a2ddd){if(_0x5a2ddd){return _0x5a2ddd[_0xc1e7('0x20')](_0x1cb888)['then'](function(_0x40d28c){return _0x40d28c;});}return null;};}function removeEntity(_0x4fba30,_0x581596){return function(_0x3006f2){if(_0x3006f2){return _0x3006f2[_0xc1e7('0x21')]()[_0xc1e7('0x22')](function(){_0x4fba30[_0xc1e7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c5164,_0x918393){return function(_0x4de930){if(!_0x4de930){_0x1c5164['sendStatus'](0x194);}return _0x4de930;};}function handleError(_0x554b34,_0x360403){_0x360403=_0x360403||0x1f4;return function(_0xbef4eb){logger[_0xc1e7('0x23')](_0xbef4eb[_0xc1e7('0x24')]);if(_0xbef4eb[_0xc1e7('0x25')]){delete _0xbef4eb[_0xc1e7('0x25')];}_0x554b34[_0xc1e7('0x16')](_0x360403)[_0xc1e7('0x26')](_0xbef4eb);};}exports[_0xc1e7('0x27')]=function(_0x5dfe6e,_0x4acfab){var _0x3f30f1={},_0x5dee9f={},_0x1f39c1={'count':0x0,'rows':[]};var _0x37c8e2=_['map'](db[_0xc1e7('0x28')][_0xc1e7('0x29')],function(_0x5ad1fd){return{'name':_0x5ad1fd['fieldName'],'type':_0x5ad1fd[_0xc1e7('0x2a')][_0xc1e7('0x2b')]};});_0x5dee9f[_0xc1e7('0x2c')]=_[_0xc1e7('0x2d')](_0x37c8e2,_0xc1e7('0x25'));_0x5dee9f[_0xc1e7('0x2e')]=_[_0xc1e7('0x2f')](_0x5dfe6e[_0xc1e7('0x2e')]);_0x5dee9f['filters']=_[_0xc1e7('0x30')](_0x5dee9f['model'],_0x5dee9f['query']);_0x3f30f1[_0xc1e7('0x31')]=_[_0xc1e7('0x30')](_0x5dee9f[_0xc1e7('0x2c')],qs[_0xc1e7('0x32')](_0x5dfe6e['query'][_0xc1e7('0x32')]));_0x3f30f1[_0xc1e7('0x31')]=_0x3f30f1[_0xc1e7('0x31')][_0xc1e7('0x33')]?_0x3f30f1[_0xc1e7('0x31')]:_0x5dee9f[_0xc1e7('0x2c')];if(!_0x5dfe6e['query'][_0xc1e7('0x34')](_0xc1e7('0x35'))){_0x3f30f1[_0xc1e7('0x36')]=qs[_0xc1e7('0x36')](_0x5dfe6e[_0xc1e7('0x2e')][_0xc1e7('0x36')]);_0x3f30f1[_0xc1e7('0x1a')]=qs[_0xc1e7('0x1a')](_0x5dfe6e[_0xc1e7('0x2e')][_0xc1e7('0x1a')]);}_0x3f30f1[_0xc1e7('0x37')]=qs[_0xc1e7('0x38')](_0x5dfe6e['query'][_0xc1e7('0x38')]);_0x3f30f1[_0xc1e7('0x39')]=qs[_0xc1e7('0x3a')](_['pick'](_0x5dfe6e['query'],_0x5dee9f['filters']),_0x37c8e2);if(_0x5dfe6e[_0xc1e7('0x2e')][_0xc1e7('0x3b')]){_0x3f30f1['where']=_[_0xc1e7('0x3c')](_0x3f30f1['where'],{'$or':_['map'](_0x37c8e2,function(_0x350469){if(_0x350469[_0xc1e7('0x2a')]!=='VIRTUAL'){var _0x2b9751={};_0x2b9751[_0x350469[_0xc1e7('0x25')]]={'$like':'%'+_0x5dfe6e['query'][_0xc1e7('0x3b')]+'%'};return _0x2b9751;}})});}_0x3f30f1=_['merge']({},_0x3f30f1,_0x5dfe6e[_0xc1e7('0x3d')]);var _0x34ca6c={'where':_0x3f30f1[_0xc1e7('0x39')]};return db['IntegrationReport'][_0xc1e7('0x19')](_0x34ca6c)[_0xc1e7('0x22')](function(_0x3452c1){_0x1f39c1['count']=_0x3452c1;if(_0x5dfe6e['query'][_0xc1e7('0x3e')]){_0x3f30f1[_0xc1e7('0x3f')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x3f30f1);})[_0xc1e7('0x22')](function(_0x4de23b){_0x1f39c1['rows']=_0x4de23b;return _0x1f39c1;})['then'](respondWithFilteredResult(_0x4acfab,_0x3f30f1))[_0xc1e7('0x40')](handleError(_0x4acfab,null));};exports['show']=function(_0x535fba,_0x4a987b){var _0x1505fc={'raw':![],'where':{'id':_0x535fba[_0xc1e7('0x41')]['id']}},_0x4255fd={};_0x4255fd[_0xc1e7('0x2c')]=_[_0xc1e7('0x2f')](db[_0xc1e7('0x28')]['rawAttributes']);_0x4255fd[_0xc1e7('0x2e')]=_[_0xc1e7('0x2f')](_0x535fba[_0xc1e7('0x2e')]);_0x4255fd[_0xc1e7('0x3a')]=_['intersection'](_0x4255fd[_0xc1e7('0x2c')],_0x4255fd[_0xc1e7('0x2e')]);_0x1505fc['attributes']=_['intersection'](_0x4255fd[_0xc1e7('0x2c')],qs[_0xc1e7('0x32')](_0x535fba[_0xc1e7('0x2e')][_0xc1e7('0x32')]));_0x1505fc['attributes']=_0x1505fc[_0xc1e7('0x31')][_0xc1e7('0x33')]?_0x1505fc[_0xc1e7('0x31')]:_0x4255fd[_0xc1e7('0x2c')];if(_0x535fba['query'][_0xc1e7('0x3e')]){_0x1505fc[_0xc1e7('0x3f')]=[{'all':!![]}];}_0x1505fc=_[_0xc1e7('0x3c')]({},_0x1505fc,_0x535fba[_0xc1e7('0x3d')]);return db[_0xc1e7('0x28')][_0xc1e7('0x42')](_0x1505fc)['then'](handleEntityNotFound(_0x4a987b,null))[_0xc1e7('0x22')](respondWithResult(_0x4a987b,null))[_0xc1e7('0x40')](handleError(_0x4a987b,null));};exports[_0xc1e7('0x43')]=function(_0x11172f,_0x2cf325){return db[_0xc1e7('0x28')][_0xc1e7('0x43')](_0x11172f[_0xc1e7('0x44')],{})[_0xc1e7('0x22')](respondWithResult(_0x2cf325,0xc9))[_0xc1e7('0x40')](handleError(_0x2cf325,null));};exports[_0xc1e7('0x20')]=function(_0x2b6097,_0x444d56){if(_0x2b6097['body']['id']){delete _0x2b6097['body']['id'];}return db['IntegrationReport'][_0xc1e7('0x42')]({'where':{'id':_0x2b6097[_0xc1e7('0x41')]['id']}})[_0xc1e7('0x22')](handleEntityNotFound(_0x444d56,null))[_0xc1e7('0x22')](saveUpdates(_0x2b6097[_0xc1e7('0x44')],null))['then'](respondWithResult(_0x444d56,null))[_0xc1e7('0x40')](handleError(_0x444d56,null));};exports[_0xc1e7('0x21')]=function(_0x5e14ce,_0x2ad137){return db[_0xc1e7('0x28')][_0xc1e7('0x42')]({'where':{'id':_0x5e14ce[_0xc1e7('0x41')]['id']}})[_0xc1e7('0x22')](handleEntityNotFound(_0x2ad137,null))['then'](removeEntity(_0x2ad137,null))['catch'](handleError(_0x2ad137,null));};exports[_0xc1e7('0x45')]=function(_0x133507,_0x325186){return db['IntegrationReport']['describe']()[_0xc1e7('0x22')](respondWithResult(_0x325186,null))[_0xc1e7('0x40')](handleError(_0x325186,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 0f50a22..c748709 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 _0x763c=['path','../../config/environment','./integrationReport.attributes','exports','define','report_integration','util','../../config/logger','api','request-promise'];(function(_0x3d5f84,_0x569548){var _0x1981b8=function(_0x3bf9f3){while(--_0x3bf9f3){_0x3d5f84['push'](_0x3d5f84['shift']());}};_0x1981b8(++_0x569548);}(_0x763c,0x11e));var _0xc763=function(_0x48573f,_0xbd33c1){_0x48573f=_0x48573f-0x0;var _0x498930=_0x763c[_0x48573f];return _0x498930;};'use strict';var _=require('lodash');var util=require(_0xc763('0x0'));var logger=require(_0xc763('0x1'))(_0xc763('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc763('0x3'));var fs=require('fs');var path=require(_0xc763('0x4'));var rimraf=require('rimraf');var config=require(_0xc763('0x5'));var attributes=require(_0xc763('0x6'));module[_0xc763('0x7')]=function(_0x2490ba,_0xd25714){return _0x2490ba[_0xc763('0x8')]('IntegrationReport',attributes,{'tableName':_0xc763('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00d0=['./integrationReport.attributes','exports','IntegrationReport','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x518bc1,_0x190288){var _0x558563=function(_0x4dd804){while(--_0x4dd804){_0x518bc1['push'](_0x518bc1['shift']());}};_0x558563(++_0x190288);}(_0x00d0,0x13e));var _0x000d=function(_0x14582e,_0x45dd61){_0x14582e=_0x14582e-0x0;var _0x3aa429=_0x00d0[_0x14582e];return _0x3aa429;};'use strict';var _=require(_0x000d('0x0'));var util=require(_0x000d('0x1'));var logger=require(_0x000d('0x2'))('api');var moment=require(_0x000d('0x3'));var BPromise=require('bluebird');var rp=require(_0x000d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x000d('0x5'));var config=require('../../config/environment');var attributes=require(_0x000d('0x6'));module[_0x000d('0x7')]=function(_0x2c8588,_0x14888d){return _0x2c8588['define'](_0x000d('0x8'),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 7261bfa..71412bf 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x503790,_0x525c78){var _0x388092=function(_0x2ab2b8){while(--_0x2ab2b8){_0x503790['push'](_0x503790['shift']());}};_0x388092(++_0x525c78);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0x5eb8=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x314db1,_0x4c798e){var _0x3c5419=function(_0x23e04d){while(--_0x23e04d){_0x314db1['push'](_0x314db1['shift']());}};_0x3c5419(++_0x4c798e);}(_0x5eb8,0xb0));var _0x85eb=function(_0x22ccc0,_0x914457){_0x22ccc0=_0x22ccc0-0x0;var _0xe2af6a=_0x5eb8[_0x22ccc0];return _0xe2af6a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index a5316f3..567649e 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 _0xf682=['destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','index','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','addIntervals','put','/:id','delete'];(function(_0x23dce1,_0xd47d81){var _0x16ae88=function(_0x4c6bbf){while(--_0x4c6bbf){_0x23dce1['push'](_0x23dce1['shift']());}};_0x16ae88(++_0xd47d81);}(_0xf682,0x1a4));var _0x2f68=function(_0x5189cb,_0x5e5d42){_0x5189cb=_0x5189cb-0x0;var _0x1741ac=_0xf682[_0x5189cb];return _0x1741ac;};'use strict';var multer=require('multer');var util=require(_0x2f68('0x0'));var path=require(_0x2f68('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2f68('0x2'));var auth=require(_0x2f68('0x3'));var interaction=require(_0x2f68('0x4'));var config=require(_0x2f68('0x5'));var controller=require(_0x2f68('0x6'));router[_0x2f68('0x7')]('/',auth['isAuthenticated'](),controller[_0x2f68('0x8')]);router[_0x2f68('0x7')]('/:id',auth[_0x2f68('0x9')](),controller[_0x2f68('0xa')]);router[_0x2f68('0x7')](_0x2f68('0xb'),auth[_0x2f68('0x9')](),controller[_0x2f68('0xc')]);router[_0x2f68('0xd')]('/',auth[_0x2f68('0x9')](),controller[_0x2f68('0xe')]);router[_0x2f68('0xd')](_0x2f68('0xb'),auth['isAuthenticated'](),controller[_0x2f68('0xf')]);router[_0x2f68('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x2f68('0x10')]);router[_0x2f68('0x11')](_0x2f68('0x12'),auth[_0x2f68('0x9')](),controller['update']);router[_0x2f68('0x13')](_0x2f68('0x12'),auth[_0x2f68('0x9')](),controller[_0x2f68('0x14')]);module[_0x2f68('0x15')]=router; \ No newline at end of file +var _0xb647=['create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id/sub_intervals','post'];(function(_0x5f5c1d,_0x314ad0){var _0x547aa3=function(_0x10e717){while(--_0x10e717){_0x5f5c1d['push'](_0x5f5c1d['shift']());}};_0x547aa3(++_0x314ad0);}(_0xb647,0x1e8));var _0x7b64=function(_0x4ea7b4,_0x4e9f11){_0x4ea7b4=_0x4ea7b4-0x0;var _0x2ed067=_0xb647[_0x4ea7b4];return _0x2ed067;};'use strict';var multer=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var path=require(_0x7b64('0x2'));var timeout=require(_0x7b64('0x3'));var express=require(_0x7b64('0x4'));var router=express[_0x7b64('0x5')]();var fs_extra=require(_0x7b64('0x6'));var auth=require(_0x7b64('0x7'));var interaction=require(_0x7b64('0x8'));var config=require(_0x7b64('0x9'));var controller=require(_0x7b64('0xa'));router[_0x7b64('0xb')]('/',auth[_0x7b64('0xc')](),controller[_0x7b64('0xd')]);router[_0x7b64('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7b64('0xb')](_0x7b64('0xe'),auth[_0x7b64('0xc')](),controller['getIntervals']);router[_0x7b64('0xf')]('/',auth[_0x7b64('0xc')](),controller[_0x7b64('0x10')]);router['post'](_0x7b64('0xe'),auth[_0x7b64('0xc')](),controller[_0x7b64('0x11')]);router[_0x7b64('0xf')](_0x7b64('0x12'),auth[_0x7b64('0xc')](),controller[_0x7b64('0x13')]);router[_0x7b64('0x14')](_0x7b64('0x15'),auth[_0x7b64('0xc')](),controller['update']);router['delete'](_0x7b64('0x15'),auth[_0x7b64('0xc')](),controller[_0x7b64('0x16')]);module[_0x7b64('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 46afda3..e0d0a13 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 _0xdf61=['sequelize','STRING'];(function(_0x3b52fa,_0x4d2715){var _0x538844=function(_0x52d0d5){while(--_0x52d0d5){_0x3b52fa['push'](_0x3b52fa['shift']());}};_0x538844(++_0x4d2715);}(_0xdf61,0x180));var _0x1df6=function(_0x413da8,_0x1ab174){_0x413da8=_0x413da8-0x0;var _0x2c5bc4=_0xdf61[_0x413da8];return _0x2c5bc4;};'use strict';var Sequelize=require(_0x1df6('0x0'));module['exports']={'name':{'type':Sequelize[_0x1df6('0x1')]},'description':{'type':Sequelize[_0x1df6('0x1')]},'interval':{'type':Sequelize[_0x1df6('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x243d=['exports','STRING'];(function(_0x4465b1,_0x45a233){var _0x2490eb=function(_0x5dad00){while(--_0x5dad00){_0x4465b1['push'](_0x4465b1['shift']());}};_0x2490eb(++_0x45a233);}(_0x243d,0x12a));var _0xd243=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x243d[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0xd243('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd243('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 3513af2..d18a242 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 _0x4b17=['addInterval','getIntervals','findOne','order','nolimit','addIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','Intervals','end','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x273f1e,_0x33703d){var _0x37f080=function(_0x5388e8){while(--_0x5388e8){_0x273f1e['push'](_0x273f1e['shift']());}};_0x37f080(++_0x33703d);}(_0x4b17,0x10f));var _0x74b1=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0x4b17[_0x471448];return _0x38190b;};'use strict';var emlformat=require(_0x74b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b1('0x2'));var moment=require(_0x74b1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74b1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x74b1('0x5'));var csv=require(_0x74b1('0x6'));var ejs=require(_0x74b1('0x7'));var fs=require('fs');var fs_extra=require(_0x74b1('0x8'));var _=require(_0x74b1('0x9'));var squel=require(_0x74b1('0xa'));var crypto=require(_0x74b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x74b1('0xc'));var toCsv=require(_0x74b1('0x6'));var querystring=require(_0x74b1('0xd'));var Papa=require(_0x74b1('0xe'));var Redis=require(_0x74b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74b1('0x10'));var as=require(_0x74b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b1('0x12'))(_0x74b1('0x13'));var utils=require(_0x74b1('0x14'));var config=require(_0x74b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x74b1('0x16'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x5f2865,_0x239d04){_0x239d04=_0x239d04||0xcc;return function(_0x34d1e2){if(_0x34d1e2){return _0x5f2865['sendStatus'](_0x239d04);}return _0x5f2865['status'](_0x239d04)['end']();};}function respondWithResult(_0x86390,_0x5c12eb){_0x5c12eb=_0x5c12eb||0xc8;return function(_0x4e289b){if(_0x4e289b){return _0x86390[_0x74b1('0x17')](_0x5c12eb)[_0x74b1('0x18')](_0x4e289b);}};}function respondWithFilteredResult(_0x3779c5,_0x420662){return function(_0x16b147){if(_0x16b147){var _0x10138e=_0x16b147[_0x74b1('0x19')],_0x528e8c=_0x420662[_0x74b1('0x1a')],_0x6237be=_0x420662[_0x74b1('0x1a')]+_0x420662[_0x74b1('0x1b')],_0x213b28;if(_0x6237be>=_0x10138e){_0x6237be=_0x10138e;_0x213b28=0xc8;}else{_0x213b28=0xce;}_0x3779c5[_0x74b1('0x17')](_0x213b28);return _0x3779c5['set'](_0x74b1('0x1c'),_0x528e8c+'-'+_0x6237be+'/'+_0x10138e)[_0x74b1('0x18')](_0x16b147);}return null;};}function patchUpdates(_0x524ece){return function(_0x16d415){try{jsonpatch[_0x74b1('0x1d')](_0x16d415,_0x524ece,!![]);}catch(_0x39f261){return BPromise[_0x74b1('0x1e')](_0x39f261);}return _0x16d415[_0x74b1('0x1f')]();};}function saveUpdates(_0x33fee9,_0x3ff3f4){return function(_0xaac5f7){if(_0xaac5f7){return _0xaac5f7['update'](_0x33fee9)[_0x74b1('0x20')](function(_0x4f1ec9){return _0x4f1ec9;});}return null;};}function removeEntity(_0x5da0f7,_0x481bf2){return function(_0x27fd1a){if(_0x27fd1a){return _0x27fd1a[_0x74b1('0x21')]()[_0x74b1('0x20')](function(){var _0x44bf7e=_0x27fd1a[_0x74b1('0x22')]({'plain':!![]});var _0x4ee88b=_0x74b1('0x23');return db['UserProfileResource'][_0x74b1('0x21')]({'where':{'type':_0x4ee88b,'resourceId':_0x44bf7e['id']}})[_0x74b1('0x20')](function(){return _0x27fd1a;});})[_0x74b1('0x20')](function(){_0x5da0f7[_0x74b1('0x17')](0xcc)[_0x74b1('0x24')]();});}};}function handleEntityNotFound(_0x322de5,_0x115918){return function(_0x33fa8e){if(!_0x33fa8e){_0x322de5['sendStatus'](0x194);}return _0x33fa8e;};}function handleError(_0x322e61,_0x42b69d){_0x42b69d=_0x42b69d||0x1f4;return function(_0x4099af){logger['error'](_0x4099af[_0x74b1('0x25')]);if(_0x4099af[_0x74b1('0x26')]){delete _0x4099af[_0x74b1('0x26')];}_0x322e61[_0x74b1('0x17')](_0x42b69d)[_0x74b1('0x27')](_0x4099af);};}exports[_0x74b1('0x28')]=function(_0x436eda,_0x3ce043){var _0x4fbe3d={},_0xe74c82={},_0x40b32a={'count':0x0,'rows':[]};var _0x51ce6d=_[_0x74b1('0x29')](db[_0x74b1('0x2a')][_0x74b1('0x2b')],function(_0x5f4d1b){return{'name':_0x5f4d1b[_0x74b1('0x2c')],'type':_0x5f4d1b[_0x74b1('0x2d')]['key']};});_0xe74c82[_0x74b1('0x2e')]=_[_0x74b1('0x29')](_0x51ce6d,_0x74b1('0x26'));_0xe74c82[_0x74b1('0x2f')]=_[_0x74b1('0x30')](_0x436eda[_0x74b1('0x2f')]);_0xe74c82[_0x74b1('0x31')]=_[_0x74b1('0x32')](_0xe74c82['model'],_0xe74c82[_0x74b1('0x2f')]);_0x4fbe3d['attributes']=_['intersection'](_0xe74c82[_0x74b1('0x2e')],qs['fields'](_0x436eda['query'][_0x74b1('0x33')]));_0x4fbe3d[_0x74b1('0x34')]=_0x4fbe3d[_0x74b1('0x34')][_0x74b1('0x35')]?_0x4fbe3d[_0x74b1('0x34')]:_0xe74c82[_0x74b1('0x2e')];if(!_0x436eda[_0x74b1('0x2f')][_0x74b1('0x36')]('nolimit')){_0x4fbe3d['limit']=qs['limit'](_0x436eda[_0x74b1('0x2f')]['limit']);_0x4fbe3d['offset']=qs[_0x74b1('0x1a')](_0x436eda[_0x74b1('0x2f')][_0x74b1('0x1a')]);}_0x4fbe3d['order']=qs[_0x74b1('0x37')](_0x436eda['query'][_0x74b1('0x37')]);_0x4fbe3d[_0x74b1('0x38')]=qs['filters'](_['pick'](_0x436eda[_0x74b1('0x2f')],_0xe74c82[_0x74b1('0x31')]),_0x51ce6d);if(_0x436eda['query']['filter']){_0x4fbe3d[_0x74b1('0x38')]=_['merge'](_0x4fbe3d[_0x74b1('0x38')],{'$or':_[_0x74b1('0x29')](_0x51ce6d,function(_0x15e695){if(_0x15e695[_0x74b1('0x2d')]!==_0x74b1('0x39')){var _0x4ad742={};_0x4ad742[_0x15e695[_0x74b1('0x26')]]={'$like':'%'+_0x436eda['query'][_0x74b1('0x3a')]+'%'};return _0x4ad742;}})});}_0x4fbe3d=_['merge']({},_0x4fbe3d,_0x436eda[_0x74b1('0x3b')]);var _0x4a222c={'where':_0x4fbe3d['where']};return db[_0x74b1('0x2a')][_0x74b1('0x19')](_0x4a222c)[_0x74b1('0x20')](function(_0x49f7da){_0x40b32a[_0x74b1('0x19')]=_0x49f7da;if(_0x436eda[_0x74b1('0x2f')][_0x74b1('0x3c')]){_0x4fbe3d['include']=[{'all':!![]}];}return db[_0x74b1('0x2a')][_0x74b1('0x3d')](_0x4fbe3d);})['then'](function(_0x48ac05){_0x40b32a[_0x74b1('0x3e')]=_0x48ac05;return _0x40b32a;})[_0x74b1('0x20')](respondWithFilteredResult(_0x3ce043,_0x4fbe3d))[_0x74b1('0x3f')](handleError(_0x3ce043,null));};exports[_0x74b1('0x40')]=function(_0x1d9f5b,_0x1cded3){var _0x4732e7={'raw':!![],'where':{'id':_0x1d9f5b[_0x74b1('0x41')]['id']}},_0x480212={};_0x480212[_0x74b1('0x2e')]=_[_0x74b1('0x30')](db[_0x74b1('0x2a')][_0x74b1('0x2b')]);_0x480212['query']=_[_0x74b1('0x30')](_0x1d9f5b[_0x74b1('0x2f')]);_0x480212['filters']=_['intersection'](_0x480212[_0x74b1('0x2e')],_0x480212[_0x74b1('0x2f')]);_0x4732e7['attributes']=_[_0x74b1('0x32')](_0x480212[_0x74b1('0x2e')],qs[_0x74b1('0x33')](_0x1d9f5b[_0x74b1('0x2f')][_0x74b1('0x33')]));_0x4732e7[_0x74b1('0x34')]=_0x4732e7[_0x74b1('0x34')]['length']?_0x4732e7['attributes']:_0x480212['model'];if(_0x1d9f5b[_0x74b1('0x2f')][_0x74b1('0x3c')]){_0x4732e7[_0x74b1('0x42')]=[{'all':!![]}];}_0x4732e7=_[_0x74b1('0x43')]({},_0x4732e7,_0x1d9f5b[_0x74b1('0x3b')]);return db['Interval'][_0x74b1('0x44')](_0x4732e7)[_0x74b1('0x20')](handleEntityNotFound(_0x1cded3,null))[_0x74b1('0x20')](respondWithResult(_0x1cded3,null))[_0x74b1('0x3f')](handleError(_0x1cded3,null));};exports[_0x74b1('0x45')]=function(_0x1c92f0,_0x36f349){return db[_0x74b1('0x2a')][_0x74b1('0x45')](_0x1c92f0[_0x74b1('0x46')],{})[_0x74b1('0x20')](function(_0x3038f9){var _0x52dad7=_0x1c92f0[_0x74b1('0x47')][_0x74b1('0x22')]({'plain':!![]});if(!_0x52dad7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52dad7[_0x74b1('0x48')]==='user'){var _0x4b1add=_0x3038f9[_0x74b1('0x22')]({'plain':!![]});var _0x5459b6=_0x74b1('0x23');return db[_0x74b1('0x49')][_0x74b1('0x44')]({'where':{'name':_0x5459b6,'userProfileId':_0x52dad7['userProfileId']},'raw':!![]})[_0x74b1('0x20')](function(_0x418652){if(_0x418652&&_0x418652[_0x74b1('0x4a')]===0x0){return db[_0x74b1('0x4b')][_0x74b1('0x45')]({'name':_0x4b1add['name'],'resourceId':_0x4b1add['id'],'type':_0x418652[_0x74b1('0x26')],'sectionId':_0x418652['id']},{})['then'](function(){return _0x3038f9;});}else{return _0x3038f9;}})[_0x74b1('0x3f')](function(_0x4085b8){logger['error'](_0x74b1('0x4c'),_0x4085b8);throw _0x4085b8;});}return _0x3038f9;})[_0x74b1('0x20')](respondWithResult(_0x36f349,0xc9))[_0x74b1('0x3f')](handleError(_0x36f349,null));};exports['update']=function(_0x3b6838,_0x37b907){if(_0x3b6838['body']['id']){delete _0x3b6838[_0x74b1('0x46')]['id'];}return db['Interval']['find']({'where':{'id':_0x3b6838[_0x74b1('0x41')]['id']}})[_0x74b1('0x20')](handleEntityNotFound(_0x37b907,null))[_0x74b1('0x20')](saveUpdates(_0x3b6838[_0x74b1('0x46')],null))[_0x74b1('0x20')](respondWithResult(_0x37b907,null))['catch'](handleError(_0x37b907,null));};exports[_0x74b1('0x21')]=function(_0xf3786f,_0x56544a){return db[_0x74b1('0x2a')][_0x74b1('0x44')]({'where':{'id':_0xf3786f[_0x74b1('0x41')]['id']}})['then'](handleEntityNotFound(_0x56544a,null))[_0x74b1('0x20')](removeEntity(_0x56544a,null))[_0x74b1('0x3f')](handleError(_0x56544a,null));};exports[_0x74b1('0x4d')]=function(_0x5b2549,_0x2f09d6,_0x3b4338){if(_0x5b2549[_0x74b1('0x46')]['id']){delete _0x5b2549[_0x74b1('0x46')]['id'];}return db[_0x74b1('0x2a')][_0x74b1('0x44')]({'where':{'id':_0x5b2549['params']['id']}})[_0x74b1('0x20')](handleEntityNotFound(_0x2f09d6,null))['then'](function(_0x5343c4){if(_0x5343c4){_0x5b2549[_0x74b1('0x46')]['IntervalId']=_0x5343c4['id'];return db['Interval'][_0x74b1('0x45')](_0x5b2549[_0x74b1('0x46')]);}})[_0x74b1('0x20')](respondWithResult(_0x2f09d6,null))['catch'](handleError(_0x2f09d6,null));};exports[_0x74b1('0x4e')]=function(_0xa82c55,_0x37637a,_0x1fe728){var _0x2f363d={};var _0x39a4e0={};var _0x54fb57;var _0x38b985;return db[_0x74b1('0x2a')][_0x74b1('0x4f')]({'where':{'id':_0xa82c55[_0x74b1('0x41')]['id']}})[_0x74b1('0x20')](handleEntityNotFound(_0x37637a,null))['then'](function(_0x598daa){if(_0x598daa){_0x54fb57=_0x598daa;_0x39a4e0[_0x74b1('0x2e')]=_['keys'](db[_0x74b1('0x2a')][_0x74b1('0x2b')]);_0x39a4e0['query']=_['keys'](_0xa82c55[_0x74b1('0x2f')]);_0x39a4e0[_0x74b1('0x31')]=_[_0x74b1('0x32')](_0x39a4e0[_0x74b1('0x2e')],_0x39a4e0[_0x74b1('0x2f')]);_0x2f363d[_0x74b1('0x34')]=_[_0x74b1('0x32')](_0x39a4e0[_0x74b1('0x2e')],qs[_0x74b1('0x33')](_0xa82c55[_0x74b1('0x2f')][_0x74b1('0x33')]));_0x2f363d[_0x74b1('0x34')]=_0x2f363d['attributes'][_0x74b1('0x35')]?_0x2f363d[_0x74b1('0x34')]:_0x39a4e0[_0x74b1('0x2e')];_0x2f363d[_0x74b1('0x50')]=qs['sort'](_0xa82c55[_0x74b1('0x2f')][_0x74b1('0x37')]);_0x2f363d['where']=qs[_0x74b1('0x31')](_['pick'](_0xa82c55[_0x74b1('0x2f')],_0x39a4e0[_0x74b1('0x31')]));if(_0xa82c55['query'][_0x74b1('0x3a')]){_0x2f363d[_0x74b1('0x38')]=_[_0x74b1('0x43')](_0x2f363d['where'],{'$or':_[_0x74b1('0x29')](_0x2f363d['attributes'],function(_0xadef91){var _0x154ad4={};_0x154ad4[_0xadef91]={'$like':'%'+_0xa82c55[_0x74b1('0x2f')][_0x74b1('0x3a')]+'%'};return _0x154ad4;})});}_0x2f363d=_[_0x74b1('0x43')]({},_0x2f363d,_0xa82c55[_0x74b1('0x3b')]);return _0x54fb57[_0x74b1('0x4e')](_0x2f363d);}})[_0x74b1('0x20')](function(_0x52b243){if(_0x52b243){_0x38b985=_0x52b243[_0x74b1('0x35')];if(!_0xa82c55[_0x74b1('0x2f')][_0x74b1('0x36')](_0x74b1('0x51'))){_0x2f363d['limit']=qs[_0x74b1('0x1b')](_0xa82c55[_0x74b1('0x2f')][_0x74b1('0x1b')]);_0x2f363d[_0x74b1('0x1a')]=qs[_0x74b1('0x1a')](_0xa82c55[_0x74b1('0x2f')][_0x74b1('0x1a')]);}return _0x54fb57[_0x74b1('0x4e')](_0x2f363d);}})[_0x74b1('0x20')](function(_0x512e3d){if(_0x512e3d){return _0x512e3d?{'count':_0x38b985,'rows':_0x512e3d}:null;}})[_0x74b1('0x20')](respondWithResult(_0x37637a,null))['catch'](handleError(_0x37637a,null));};exports[_0x74b1('0x52')]=function(_0x4e18c0,_0x5886d1,_0x427385){return db[_0x74b1('0x2a')][_0x74b1('0x4f')]({'where':{'id':_0x4e18c0['params']['id']}})[_0x74b1('0x20')](handleEntityNotFound(_0x5886d1,null))[_0x74b1('0x20')](function(_0x4943b3){if(_0x4943b3){return db[_0x74b1('0x53')][_0x74b1('0x54')](function(_0x2d3796){return db[_0x74b1('0x2a')][_0x74b1('0x21')]({'where':{'IntervalId':_0x4e18c0[_0x74b1('0x41')]['id']},'transaction':_0x2d3796})[_0x74b1('0x20')](function(_0x390189){var _0x43aaf6=_[_0x74b1('0x29')](_0x4e18c0['body'],function(_0x2b1119){delete _0x2b1119['id'];_0x2b1119[_0x74b1('0x55')]=_0x4e18c0[_0x74b1('0x41')]['id'];return _0x2b1119;});return db['Interval'][_0x74b1('0x56')](_0x43aaf6,{'transaction':_0x2d3796});});})[_0x74b1('0x20')](function(){return db[_0x74b1('0x2a')][_0x74b1('0x3d')]({'where':{'IntervalId':_0x4e18c0[_0x74b1('0x41')]['id']}});});}})['then'](respondWithResult(_0x5886d1,null))[_0x74b1('0x3f')](handleError(_0x5886d1,null));}; \ No newline at end of file +var _0x3de3=['keys','rawAttributes','create','user','get','role','Intervals','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','addInterval','IntervalId','getIntervals','findOne','order','options','sequelize','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','end','json','count','offset','limit','status','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','send','map','Interval','fieldName','type','key','filters','intersection','query','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show'];(function(_0x2cc205,_0x224db8){var _0x2b978f=function(_0x12c310){while(--_0x12c310){_0x2cc205['push'](_0x2cc205['shift']());}};_0x2b978f(++_0x224db8);}(_0x3de3,0x1ce));var _0x33de=function(_0xc95a4d,_0x5e4302){_0xc95a4d=_0xc95a4d-0x0;var _0x33a715=_0x3de3[_0xc95a4d];return _0x33a715;};'use strict';var emlformat=require(_0x33de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33de('0x1'));var jsonpatch=require(_0x33de('0x2'));var rp=require('request-promise');var moment=require(_0x33de('0x3'));var BPromise=require(_0x33de('0x4'));var Mustache=require(_0x33de('0x5'));var util=require(_0x33de('0x6'));var path=require('path');var sox=require(_0x33de('0x7'));var csv=require(_0x33de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33de('0x9'));var _=require('lodash');var squel=require(_0x33de('0xa'));var crypto=require(_0x33de('0xb'));var jsforce=require(_0x33de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x33de('0x8'));var querystring=require(_0x33de('0xd'));var Papa=require(_0x33de('0xe'));var Redis=require('ioredis');var authService=require(_0x33de('0xf'));var qs=require(_0x33de('0x10'));var as=require(_0x33de('0x11'));var hardwareService=require(_0x33de('0x12'));var logger=require(_0x33de('0x13'))(_0x33de('0x14'));var utils=require(_0x33de('0x15'));var config=require(_0x33de('0x16'));var licenseUtil=require(_0x33de('0x17'));var db=require(_0x33de('0x18'))['db'];var extensions=require(_0x33de('0x19'));function respondWithStatusCode(_0x5170ad,_0x6b1a4c){_0x6b1a4c=_0x6b1a4c||0xcc;return function(_0x25d069){if(_0x25d069){return _0x5170ad['sendStatus'](_0x6b1a4c);}return _0x5170ad['status'](_0x6b1a4c)[_0x33de('0x1a')]();};}function respondWithResult(_0x22bda8,_0x2b3748){_0x2b3748=_0x2b3748||0xc8;return function(_0x57a2a1){if(_0x57a2a1){return _0x22bda8['status'](_0x2b3748)[_0x33de('0x1b')](_0x57a2a1);}};}function respondWithFilteredResult(_0x1b1166,_0x522ba0){return function(_0x4ff69f){if(_0x4ff69f){var _0x185849=_0x4ff69f[_0x33de('0x1c')],_0x16c050=_0x522ba0[_0x33de('0x1d')],_0x13e832=_0x522ba0['offset']+_0x522ba0[_0x33de('0x1e')],_0x4de4ef;if(_0x13e832>=_0x185849){_0x13e832=_0x185849;_0x4de4ef=0xc8;}else{_0x4de4ef=0xce;}_0x1b1166[_0x33de('0x1f')](_0x4de4ef);return _0x1b1166['set']('Content-Range',_0x16c050+'-'+_0x13e832+'/'+_0x185849)[_0x33de('0x1b')](_0x4ff69f);}return null;};}function patchUpdates(_0x52d718){return function(_0x16255f){try{jsonpatch[_0x33de('0x20')](_0x16255f,_0x52d718,!![]);}catch(_0x3810b5){return BPromise[_0x33de('0x21')](_0x3810b5);}return _0x16255f[_0x33de('0x22')]();};}function saveUpdates(_0x40a8e6,_0x6cdc4f){return function(_0x493263){if(_0x493263){return _0x493263['update'](_0x40a8e6)[_0x33de('0x23')](function(_0x5af3fa){return _0x5af3fa;});}return null;};}function removeEntity(_0x8acd8d,_0x4cd8db){return function(_0x28ed17){if(_0x28ed17){return _0x28ed17[_0x33de('0x24')]()['then'](function(){var _0x2dbcf2=_0x28ed17['get']({'plain':!![]});var _0x67d040='Intervals';return db[_0x33de('0x25')][_0x33de('0x24')]({'where':{'type':_0x67d040,'resourceId':_0x2dbcf2['id']}})[_0x33de('0x23')](function(){return _0x28ed17;});})['then'](function(){_0x8acd8d[_0x33de('0x1f')](0xcc)[_0x33de('0x1a')]();});}};}function handleEntityNotFound(_0x140979,_0x5cd31e){return function(_0x34fba3){if(!_0x34fba3){_0x140979['sendStatus'](0x194);}return _0x34fba3;};}function handleError(_0x566373,_0x1c8de9){_0x1c8de9=_0x1c8de9||0x1f4;return function(_0x17c760){logger[_0x33de('0x26')](_0x17c760[_0x33de('0x27')]);if(_0x17c760[_0x33de('0x28')]){delete _0x17c760[_0x33de('0x28')];}_0x566373[_0x33de('0x1f')](_0x1c8de9)[_0x33de('0x29')](_0x17c760);};}exports['index']=function(_0x5ae0e8,_0x2755e6){var _0x1420d2={},_0xaeaec5={},_0x451ff5={'count':0x0,'rows':[]};var _0x167cec=_[_0x33de('0x2a')](db[_0x33de('0x2b')]['rawAttributes'],function(_0x282158){return{'name':_0x282158[_0x33de('0x2c')],'type':_0x282158[_0x33de('0x2d')][_0x33de('0x2e')]};});_0xaeaec5['model']=_[_0x33de('0x2a')](_0x167cec,_0x33de('0x28'));_0xaeaec5['query']=_['keys'](_0x5ae0e8['query']);_0xaeaec5[_0x33de('0x2f')]=_[_0x33de('0x30')](_0xaeaec5['model'],_0xaeaec5[_0x33de('0x31')]);_0x1420d2['attributes']=_['intersection'](_0xaeaec5[_0x33de('0x32')],qs[_0x33de('0x33')](_0x5ae0e8[_0x33de('0x31')][_0x33de('0x33')]));_0x1420d2[_0x33de('0x34')]=_0x1420d2[_0x33de('0x34')][_0x33de('0x35')]?_0x1420d2[_0x33de('0x34')]:_0xaeaec5['model'];if(!_0x5ae0e8[_0x33de('0x31')]['hasOwnProperty'](_0x33de('0x36'))){_0x1420d2['limit']=qs['limit'](_0x5ae0e8[_0x33de('0x31')][_0x33de('0x1e')]);_0x1420d2[_0x33de('0x1d')]=qs[_0x33de('0x1d')](_0x5ae0e8[_0x33de('0x31')][_0x33de('0x1d')]);}_0x1420d2['order']=qs[_0x33de('0x37')](_0x5ae0e8[_0x33de('0x31')][_0x33de('0x37')]);_0x1420d2[_0x33de('0x38')]=qs[_0x33de('0x2f')](_[_0x33de('0x39')](_0x5ae0e8[_0x33de('0x31')],_0xaeaec5['filters']),_0x167cec);if(_0x5ae0e8[_0x33de('0x31')][_0x33de('0x3a')]){_0x1420d2[_0x33de('0x38')]=_[_0x33de('0x3b')](_0x1420d2[_0x33de('0x38')],{'$or':_[_0x33de('0x2a')](_0x167cec,function(_0x1126b6){if(_0x1126b6['type']!==_0x33de('0x3c')){var _0x33a8d6={};_0x33a8d6[_0x1126b6[_0x33de('0x28')]]={'$like':'%'+_0x5ae0e8[_0x33de('0x31')][_0x33de('0x3a')]+'%'};return _0x33a8d6;}})});}_0x1420d2=_[_0x33de('0x3b')]({},_0x1420d2,_0x5ae0e8['options']);var _0x3924af={'where':_0x1420d2['where']};return db[_0x33de('0x2b')][_0x33de('0x1c')](_0x3924af)['then'](function(_0x198b72){_0x451ff5[_0x33de('0x1c')]=_0x198b72;if(_0x5ae0e8[_0x33de('0x31')][_0x33de('0x3d')]){_0x1420d2[_0x33de('0x3e')]=[{'all':!![]}];}return db[_0x33de('0x2b')][_0x33de('0x3f')](_0x1420d2);})[_0x33de('0x23')](function(_0x48e0fc){_0x451ff5['rows']=_0x48e0fc;return _0x451ff5;})['then'](respondWithFilteredResult(_0x2755e6,_0x1420d2))[_0x33de('0x40')](handleError(_0x2755e6,null));};exports[_0x33de('0x41')]=function(_0x20d04f,_0x376c55){var _0x54acde={'raw':!![],'where':{'id':_0x20d04f['params']['id']}},_0x2ac6a0={};_0x2ac6a0['model']=_[_0x33de('0x42')](db[_0x33de('0x2b')][_0x33de('0x43')]);_0x2ac6a0[_0x33de('0x31')]=_[_0x33de('0x42')](_0x20d04f[_0x33de('0x31')]);_0x2ac6a0[_0x33de('0x2f')]=_['intersection'](_0x2ac6a0[_0x33de('0x32')],_0x2ac6a0['query']);_0x54acde[_0x33de('0x34')]=_['intersection'](_0x2ac6a0[_0x33de('0x32')],qs[_0x33de('0x33')](_0x20d04f['query'][_0x33de('0x33')]));_0x54acde[_0x33de('0x34')]=_0x54acde[_0x33de('0x34')]['length']?_0x54acde['attributes']:_0x2ac6a0[_0x33de('0x32')];if(_0x20d04f[_0x33de('0x31')]['includeAll']){_0x54acde['include']=[{'all':!![]}];}_0x54acde=_[_0x33de('0x3b')]({},_0x54acde,_0x20d04f['options']);return db['Interval']['find'](_0x54acde)[_0x33de('0x23')](handleEntityNotFound(_0x376c55,null))[_0x33de('0x23')](respondWithResult(_0x376c55,null))[_0x33de('0x40')](handleError(_0x376c55,null));};exports[_0x33de('0x44')]=function(_0x51730a,_0x4a0ad8){return db[_0x33de('0x2b')][_0x33de('0x44')](_0x51730a['body'],{})[_0x33de('0x23')](function(_0xc23633){var _0x23a5e7=_0x51730a[_0x33de('0x45')][_0x33de('0x46')]({'plain':!![]});if(!_0x23a5e7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23a5e7[_0x33de('0x47')]===_0x33de('0x45')){var _0x4fe3a2=_0xc23633[_0x33de('0x46')]({'plain':!![]});var _0xab2a13=_0x33de('0x48');return db[_0x33de('0x49')][_0x33de('0x4a')]({'where':{'name':_0xab2a13,'userProfileId':_0x23a5e7[_0x33de('0x4b')]},'raw':!![]})[_0x33de('0x23')](function(_0x7538fa){if(_0x7538fa&&_0x7538fa[_0x33de('0x4c')]===0x0){return db[_0x33de('0x25')]['create']({'name':_0x4fe3a2[_0x33de('0x28')],'resourceId':_0x4fe3a2['id'],'type':_0x7538fa[_0x33de('0x28')],'sectionId':_0x7538fa['id']},{})[_0x33de('0x23')](function(){return _0xc23633;});}else{return _0xc23633;}})[_0x33de('0x40')](function(_0xe6d59){logger[_0x33de('0x26')](_0x33de('0x4d'),_0xe6d59);throw _0xe6d59;});}return _0xc23633;})['then'](respondWithResult(_0x4a0ad8,0xc9))[_0x33de('0x40')](handleError(_0x4a0ad8,null));};exports[_0x33de('0x4e')]=function(_0x3c8904,_0x4f0e9f){if(_0x3c8904[_0x33de('0x4f')]['id']){delete _0x3c8904[_0x33de('0x4f')]['id'];}return db[_0x33de('0x2b')][_0x33de('0x4a')]({'where':{'id':_0x3c8904['params']['id']}})['then'](handleEntityNotFound(_0x4f0e9f,null))[_0x33de('0x23')](saveUpdates(_0x3c8904[_0x33de('0x4f')],null))[_0x33de('0x23')](respondWithResult(_0x4f0e9f,null))[_0x33de('0x40')](handleError(_0x4f0e9f,null));};exports[_0x33de('0x24')]=function(_0x51d0cb,_0x5c7df7){return db[_0x33de('0x2b')][_0x33de('0x4a')]({'where':{'id':_0x51d0cb[_0x33de('0x50')]['id']}})[_0x33de('0x23')](handleEntityNotFound(_0x5c7df7,null))[_0x33de('0x23')](removeEntity(_0x5c7df7,null))[_0x33de('0x40')](handleError(_0x5c7df7,null));};exports[_0x33de('0x51')]=function(_0x18a14b,_0x35f529,_0x5de12f){if(_0x18a14b[_0x33de('0x4f')]['id']){delete _0x18a14b[_0x33de('0x4f')]['id'];}return db[_0x33de('0x2b')]['find']({'where':{'id':_0x18a14b[_0x33de('0x50')]['id']}})['then'](handleEntityNotFound(_0x35f529,null))['then'](function(_0x4dae6d){if(_0x4dae6d){_0x18a14b['body'][_0x33de('0x52')]=_0x4dae6d['id'];return db[_0x33de('0x2b')]['create'](_0x18a14b[_0x33de('0x4f')]);}})[_0x33de('0x23')](respondWithResult(_0x35f529,null))['catch'](handleError(_0x35f529,null));};exports[_0x33de('0x53')]=function(_0x7ad0c1,_0x5395a7,_0x32e7a1){var _0x2bd687={};var _0x277bb7={};var _0x3a7c4a;var _0x125dd6;return db[_0x33de('0x2b')][_0x33de('0x54')]({'where':{'id':_0x7ad0c1['params']['id']}})['then'](handleEntityNotFound(_0x5395a7,null))[_0x33de('0x23')](function(_0x49516d){if(_0x49516d){_0x3a7c4a=_0x49516d;_0x277bb7[_0x33de('0x32')]=_[_0x33de('0x42')](db['Interval'][_0x33de('0x43')]);_0x277bb7['query']=_[_0x33de('0x42')](_0x7ad0c1[_0x33de('0x31')]);_0x277bb7['filters']=_['intersection'](_0x277bb7[_0x33de('0x32')],_0x277bb7[_0x33de('0x31')]);_0x2bd687[_0x33de('0x34')]=_[_0x33de('0x30')](_0x277bb7[_0x33de('0x32')],qs['fields'](_0x7ad0c1[_0x33de('0x31')][_0x33de('0x33')]));_0x2bd687['attributes']=_0x2bd687[_0x33de('0x34')][_0x33de('0x35')]?_0x2bd687['attributes']:_0x277bb7[_0x33de('0x32')];_0x2bd687[_0x33de('0x55')]=qs['sort'](_0x7ad0c1['query'][_0x33de('0x37')]);_0x2bd687['where']=qs[_0x33de('0x2f')](_['pick'](_0x7ad0c1[_0x33de('0x31')],_0x277bb7['filters']));if(_0x7ad0c1['query']['filter']){_0x2bd687['where']=_['merge'](_0x2bd687['where'],{'$or':_[_0x33de('0x2a')](_0x2bd687['attributes'],function(_0x1a5b4f){var _0x530b87={};_0x530b87[_0x1a5b4f]={'$like':'%'+_0x7ad0c1['query'][_0x33de('0x3a')]+'%'};return _0x530b87;})});}_0x2bd687=_[_0x33de('0x3b')]({},_0x2bd687,_0x7ad0c1[_0x33de('0x56')]);return _0x3a7c4a[_0x33de('0x53')](_0x2bd687);}})[_0x33de('0x23')](function(_0x2c127d){if(_0x2c127d){_0x125dd6=_0x2c127d[_0x33de('0x35')];if(!_0x7ad0c1[_0x33de('0x31')]['hasOwnProperty'](_0x33de('0x36'))){_0x2bd687['limit']=qs[_0x33de('0x1e')](_0x7ad0c1[_0x33de('0x31')][_0x33de('0x1e')]);_0x2bd687[_0x33de('0x1d')]=qs[_0x33de('0x1d')](_0x7ad0c1[_0x33de('0x31')][_0x33de('0x1d')]);}return _0x3a7c4a[_0x33de('0x53')](_0x2bd687);}})[_0x33de('0x23')](function(_0x2cfd36){if(_0x2cfd36){return _0x2cfd36?{'count':_0x125dd6,'rows':_0x2cfd36}:null;}})[_0x33de('0x23')](respondWithResult(_0x5395a7,null))['catch'](handleError(_0x5395a7,null));};exports['addIntervals']=function(_0x516a33,_0x1179f6,_0x371ced){return db[_0x33de('0x2b')][_0x33de('0x54')]({'where':{'id':_0x516a33[_0x33de('0x50')]['id']}})[_0x33de('0x23')](handleEntityNotFound(_0x1179f6,null))[_0x33de('0x23')](function(_0x1b3166){if(_0x1b3166){return db[_0x33de('0x57')]['transaction'](function(_0x174636){return db[_0x33de('0x2b')][_0x33de('0x24')]({'where':{'IntervalId':_0x516a33[_0x33de('0x50')]['id']},'transaction':_0x174636})[_0x33de('0x23')](function(_0x2541d3){var _0x4c38ae=_['map'](_0x516a33['body'],function(_0x1370ac){delete _0x1370ac['id'];_0x1370ac[_0x33de('0x52')]=_0x516a33[_0x33de('0x50')]['id'];return _0x1370ac;});return db[_0x33de('0x2b')]['bulkCreate'](_0x4c38ae,{'transaction':_0x174636});});})[_0x33de('0x23')](function(){return db[_0x33de('0x2b')]['findAll']({'where':{'IntervalId':_0x516a33['params']['id']}});});}})['then'](respondWithResult(_0x1179f6,null))[_0x33de('0x40')](handleError(_0x1179f6,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 6985eec..f58b091 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 _0xbccf=['moment','bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','../../config/logger'];(function(_0x52faa9,_0x11c12e){var _0x1c5310=function(_0x53a0f3){while(--_0x53a0f3){_0x52faa9['push'](_0x52faa9['shift']());}};_0x1c5310(++_0x11c12e);}(_0xbccf,0x1d2));var _0xfbcc=function(_0x325501,_0x5242f6){_0x325501=_0x325501-0x0;var _0x2c1626=_0xbccf[_0x325501];return _0x2c1626;};'use strict';var _=require(_0xfbcc('0x0'));var util=require('util');var logger=require(_0xfbcc('0x1'))('api');var moment=require(_0xfbcc('0x2'));var BPromise=require(_0xfbcc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfbcc('0x4'));var config=require(_0xfbcc('0x5'));var attributes=require(_0xfbcc('0x6'));var extensions=require(_0xfbcc('0x7'));module[_0xfbcc('0x8')]=function(_0x1f6935,_0x1c07f6){return _0x1f6935[_0xfbcc('0x9')](_0xfbcc('0xa'),attributes,{'tableName':_0xfbcc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x142a2c,_0x2c83aa){extensions[_0xfbcc('0xc')](_0x1f6935,_0x142a2c);},'afterBulkCreate':function(_0x3c3f72,_0x2b617e,_0x112f1d){_0x112f1d();extensions['rewrite'](_0x1f6935,_0x3c3f72[0x0]);},'afterUpdate':function(_0x26b71a,_0x2cd0b6){extensions['rewrite'](_0x1f6935,_0x26b71a);},'afterDestroy':function(_0x143b20,_0x5504a4){extensions['rewrite'](_0x1f6935,_0x143b20);}}});}; \ No newline at end of file +var _0x2750=['rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval','rewrite','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4921d5,_0x2e52c5){var _0x25a0fe=function(_0x31acfd){while(--_0x31acfd){_0x4921d5['push'](_0x4921d5['shift']());}};_0x25a0fe(++_0x2e52c5);}(_0x2750,0x13b));var _0x0275=function(_0x246d20,_0x26fa58){_0x246d20=_0x246d20-0x0;var _0x45da7c=_0x2750[_0x246d20];return _0x45da7c;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var fs=require('fs');var path=require(_0x0275('0x6'));var rimraf=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var attributes=require(_0x0275('0x9'));var extensions=require(_0x0275('0xa'));module['exports']=function(_0x3f645f,_0x2421fd){return _0x3f645f[_0x0275('0xb')](_0x0275('0xc'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f7c4a,_0x30632d){extensions[_0x0275('0xd')](_0x3f645f,_0x1f7c4a);},'afterBulkCreate':function(_0x5e0e4a,_0x5ae225,_0x224e0f){_0x224e0f();extensions['rewrite'](_0x3f645f,_0x5e0e4a[0x0]);},'afterUpdate':function(_0x26fa6b,_0x377087){extensions[_0x0275('0xd')](_0x3f645f,_0x26fa6b);},'afterDestroy':function(_0x41e828,_0x14bc3e){extensions['rewrite'](_0x3f645f,_0x41e828);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index a1b3019..74d9fff 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 _0x3a36=['attributes','limit','map','model','include','ShowInterval','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Interval,\x20%s,\x20%s','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','GetInterval','Interval','findAll','options','where'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3a36,0x189));var _0x63a3=function(_0x40b8b2,_0x17304a){_0x40b8b2=_0x40b8b2-0x0;var _0xd6df0f=_0x3a36[_0x40b8b2];return _0xd6df0f;};'use strict';var _=require(_0x63a3('0x0'));var util=require('util');var moment=require(_0x63a3('0x1'));var BPromise=require(_0x63a3('0x2'));var rs=require(_0x63a3('0x3'));var fs=require('fs');var Redis=require(_0x63a3('0x4'));var db=require(_0x63a3('0x5'))['db'];var utils=require(_0x63a3('0x6'));var logger=require('../../config/logger')(_0x63a3('0x7'));var config=require(_0x63a3('0x8'));var jayson=require(_0x63a3('0x9'));var client=jayson[_0x63a3('0xa')][_0x63a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1aba79,_0x364975,_0x5a082c){return new BPromise(function(_0x6771af,_0x136708){return client[_0x63a3('0xc')](_0x1aba79,_0x5a082c)['then'](function(_0x15b669){logger[_0x63a3('0xd')](_0x63a3('0xe'),_0x364975,'request\x20sent');logger[_0x63a3('0xf')](_0x63a3('0x10'),_0x364975,'request\x20sent',JSON[_0x63a3('0x11')](_0x15b669));if(_0x15b669[_0x63a3('0x12')]){if(_0x15b669['error']['code']===0x1f4){logger[_0x63a3('0x12')](_0x63a3('0xe'),_0x364975,_0x15b669[_0x63a3('0x12')][_0x63a3('0x13')]);return _0x136708(_0x15b669[_0x63a3('0x12')][_0x63a3('0x13')]);}logger['error'](_0x63a3('0xe'),_0x364975,_0x15b669[_0x63a3('0x12')][_0x63a3('0x13')]);return _0x6771af(_0x15b669[_0x63a3('0x12')]['message']);}else{logger[_0x63a3('0xd')](_0x63a3('0xe'),_0x364975,_0x63a3('0x14'));_0x6771af(_0x15b669[_0x63a3('0x15')][_0x63a3('0x13')]);}})['catch'](function(_0x314c60){logger[_0x63a3('0x12')](_0x63a3('0xe'),_0x364975,_0x314c60);_0x136708(_0x314c60);});});}exports[_0x63a3('0x16')]=function(_0x1fb9fd){var _0x1d5f67=this;return new Promise(function(_0x1e4934,_0x123167){return db[_0x63a3('0x17')][_0x63a3('0x18')]({'raw':_0x1fb9fd[_0x63a3('0x19')]?_0x1fb9fd[_0x63a3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1fb9fd[_0x63a3('0x19')]?_0x1fb9fd[_0x63a3('0x19')][_0x63a3('0x1a')]||null:null,'attributes':_0x1fb9fd[_0x63a3('0x19')]?_0x1fb9fd[_0x63a3('0x19')][_0x63a3('0x1b')]||null:null,'limit':_0x1fb9fd[_0x63a3('0x19')]?_0x1fb9fd['options'][_0x63a3('0x1c')]||null:null,'include':_0x1fb9fd[_0x63a3('0x19')]?_0x1fb9fd[_0x63a3('0x19')]['include']?_[_0x63a3('0x1d')](_0x1fb9fd[_0x63a3('0x19')]['include'],function(_0x23eec5){return{'model':db[_0x23eec5[_0x63a3('0x1e')]],'as':_0x23eec5['as'],'attributes':_0x23eec5[_0x63a3('0x1b')],'include':_0x23eec5[_0x63a3('0x1f')]?_['map'](_0x23eec5[_0x63a3('0x1f')],function(_0x9dc9aa){return{'model':db[_0x9dc9aa[_0x63a3('0x1e')]],'as':_0x9dc9aa['as'],'attributes':_0x9dc9aa[_0x63a3('0x1b')],'include':_0x9dc9aa[_0x63a3('0x1f')]?_[_0x63a3('0x1d')](_0x9dc9aa[_0x63a3('0x1f')],function(_0xb2d36d){return{'model':db[_0xb2d36d['model']],'as':_0xb2d36d['as'],'attributes':_0xb2d36d[_0x63a3('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc0e44f){logger['info'](_0x63a3('0x16'),_0x1fb9fd);logger[_0x63a3('0xf')](_0x63a3('0x16'),_0x1fb9fd,JSON[_0x63a3('0x11')](_0xc0e44f));_0x1e4934(_0xc0e44f);})['catch'](function(_0xa1b184){logger[_0x63a3('0x12')](_0x63a3('0x16'),_0xa1b184[_0x63a3('0x13')],_0x1fb9fd);_0x123167(_0x1d5f67[_0x63a3('0x12')](0x1f4,_0xa1b184[_0x63a3('0x13')]));});});};exports[_0x63a3('0x20')]=function(_0x1aebd3){var _0x4593b9=this;return new Promise(function(_0x416b84,_0x5ba24b){return db[_0x63a3('0x17')]['find']({'raw':_0x1aebd3['options']?_0x1aebd3[_0x63a3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1aebd3[_0x63a3('0x19')]?_0x1aebd3[_0x63a3('0x19')][_0x63a3('0x1a')]||null:null,'attributes':_0x1aebd3[_0x63a3('0x19')]?_0x1aebd3[_0x63a3('0x19')][_0x63a3('0x1b')]||null:null,'include':_0x1aebd3[_0x63a3('0x19')]?_0x1aebd3[_0x63a3('0x19')][_0x63a3('0x1f')]?_['map'](_0x1aebd3[_0x63a3('0x19')][_0x63a3('0x1f')],function(_0x414acc){return{'model':db[_0x414acc[_0x63a3('0x1e')]],'as':_0x414acc['as'],'attributes':_0x414acc[_0x63a3('0x1b')],'include':_0x414acc['include']?_['map'](_0x414acc[_0x63a3('0x1f')],function(_0x4fae09){return{'model':db[_0x4fae09[_0x63a3('0x1e')]],'as':_0x4fae09['as'],'attributes':_0x4fae09[_0x63a3('0x1b')],'include':_0x4fae09[_0x63a3('0x1f')]?_[_0x63a3('0x1d')](_0x4fae09[_0x63a3('0x1f')],function(_0x462a6a){return{'model':db[_0x462a6a['model']],'as':_0x462a6a['as'],'attributes':_0x462a6a[_0x63a3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x63a3('0x21')](function(_0x508f2b){logger[_0x63a3('0xd')](_0x63a3('0x20'),_0x1aebd3);logger[_0x63a3('0xf')]('ShowInterval',_0x1aebd3,JSON[_0x63a3('0x11')](_0x508f2b));_0x416b84(_0x508f2b);})[_0x63a3('0x22')](function(_0x57b2b8){logger['error'](_0x63a3('0x20'),_0x57b2b8['message'],_0x1aebd3);_0x5ba24b(_0x4593b9[_0x63a3('0x12')](0x1f4,_0x57b2b8[_0x63a3('0x13')]));});});}; \ No newline at end of file +var _0x4bfc=['findAll','options','raw','where','include','attributes','model','map','Interval','find','then','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetInterval'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x4bfc,0x8f));var _0xc4bf=function(_0x1376b8,_0x375d1d){_0x1376b8=_0x1376b8-0x0;var _0x2e1629=_0x4bfc[_0x1376b8];return _0x2e1629;};'use strict';var _=require(_0xc4bf('0x0'));var util=require(_0xc4bf('0x1'));var moment=require(_0xc4bf('0x2'));var BPromise=require(_0xc4bf('0x3'));var rs=require(_0xc4bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc4bf('0x5'));var logger=require(_0xc4bf('0x6'))(_0xc4bf('0x7'));var config=require('../../config/environment');var jayson=require(_0xc4bf('0x8'));var client=jayson['client'][_0xc4bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5559e0,_0x233c15,_0x1a266a){return new BPromise(function(_0x515166,_0x155fe7){return client['request'](_0x5559e0,_0x1a266a)['then'](function(_0x4a2c8a){logger[_0xc4bf('0xa')](_0xc4bf('0xb'),_0x233c15,_0xc4bf('0xc'));logger[_0xc4bf('0xd')](_0xc4bf('0xe'),_0x233c15,_0xc4bf('0xc'),JSON[_0xc4bf('0xf')](_0x4a2c8a));if(_0x4a2c8a['error']){if(_0x4a2c8a[_0xc4bf('0x10')][_0xc4bf('0x11')]===0x1f4){logger[_0xc4bf('0x10')](_0xc4bf('0xb'),_0x233c15,_0x4a2c8a[_0xc4bf('0x10')][_0xc4bf('0x12')]);return _0x155fe7(_0x4a2c8a[_0xc4bf('0x10')][_0xc4bf('0x12')]);}logger[_0xc4bf('0x10')](_0xc4bf('0xb'),_0x233c15,_0x4a2c8a['error'][_0xc4bf('0x12')]);return _0x515166(_0x4a2c8a[_0xc4bf('0x10')]['message']);}else{logger[_0xc4bf('0xa')]('Interval,\x20%s,\x20%s',_0x233c15,'request\x20sent');_0x515166(_0x4a2c8a[_0xc4bf('0x13')]['message']);}})[_0xc4bf('0x14')](function(_0xba32d0){logger[_0xc4bf('0x10')]('Interval,\x20%s,\x20%s',_0x233c15,_0xba32d0);_0x155fe7(_0xba32d0);});});}exports[_0xc4bf('0x15')]=function(_0x1ec700){var _0x5db786=this;return new Promise(function(_0x2fb9d8,_0x1de32f){return db['Interval'][_0xc4bf('0x16')]({'raw':_0x1ec700['options']?_0x1ec700[_0xc4bf('0x17')][_0xc4bf('0x18')]===undefined?!![]:![]:!![],'where':_0x1ec700[_0xc4bf('0x17')]?_0x1ec700[_0xc4bf('0x17')][_0xc4bf('0x19')]||null:null,'attributes':_0x1ec700[_0xc4bf('0x17')]?_0x1ec700[_0xc4bf('0x17')]['attributes']||null:null,'limit':_0x1ec700['options']?_0x1ec700['options']['limit']||null:null,'include':_0x1ec700[_0xc4bf('0x17')]?_0x1ec700['options'][_0xc4bf('0x1a')]?_['map'](_0x1ec700[_0xc4bf('0x17')]['include'],function(_0x252423){return{'model':db[_0x252423['model']],'as':_0x252423['as'],'attributes':_0x252423[_0xc4bf('0x1b')],'include':_0x252423['include']?_['map'](_0x252423[_0xc4bf('0x1a')],function(_0x29b473){return{'model':db[_0x29b473[_0xc4bf('0x1c')]],'as':_0x29b473['as'],'attributes':_0x29b473['attributes'],'include':_0x29b473['include']?_[_0xc4bf('0x1d')](_0x29b473[_0xc4bf('0x1a')],function(_0x47cb6c){return{'model':db[_0x47cb6c['model']],'as':_0x47cb6c['as'],'attributes':_0x47cb6c[_0xc4bf('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x317800){logger[_0xc4bf('0xa')](_0xc4bf('0x15'),_0x1ec700);logger['debug'](_0xc4bf('0x15'),_0x1ec700,JSON['stringify'](_0x317800));_0x2fb9d8(_0x317800);})[_0xc4bf('0x14')](function(_0x416475){logger[_0xc4bf('0x10')](_0xc4bf('0x15'),_0x416475['message'],_0x1ec700);_0x1de32f(_0x5db786[_0xc4bf('0x10')](0x1f4,_0x416475[_0xc4bf('0x12')]));});});};exports['ShowInterval']=function(_0x14476d){var _0x3ff129=this;return new Promise(function(_0x5e3bc1,_0x51f03b){return db[_0xc4bf('0x1e')][_0xc4bf('0x1f')]({'raw':_0x14476d[_0xc4bf('0x17')]?_0x14476d[_0xc4bf('0x17')][_0xc4bf('0x18')]===undefined?!![]:![]:!![],'where':_0x14476d[_0xc4bf('0x17')]?_0x14476d[_0xc4bf('0x17')]['where']||null:null,'attributes':_0x14476d[_0xc4bf('0x17')]?_0x14476d[_0xc4bf('0x17')][_0xc4bf('0x1b')]||null:null,'include':_0x14476d[_0xc4bf('0x17')]?_0x14476d[_0xc4bf('0x17')][_0xc4bf('0x1a')]?_[_0xc4bf('0x1d')](_0x14476d[_0xc4bf('0x17')][_0xc4bf('0x1a')],function(_0x144703){return{'model':db[_0x144703['model']],'as':_0x144703['as'],'attributes':_0x144703['attributes'],'include':_0x144703[_0xc4bf('0x1a')]?_[_0xc4bf('0x1d')](_0x144703[_0xc4bf('0x1a')],function(_0x311b4c){return{'model':db[_0x311b4c[_0xc4bf('0x1c')]],'as':_0x311b4c['as'],'attributes':_0x311b4c[_0xc4bf('0x1b')],'include':_0x311b4c[_0xc4bf('0x1a')]?_[_0xc4bf('0x1d')](_0x311b4c[_0xc4bf('0x1a')],function(_0xcdaa6b){return{'model':db[_0xcdaa6b['model']],'as':_0xcdaa6b['as'],'attributes':_0xcdaa6b['attributes']};}):[]};}):[]};}):[]:[]})[_0xc4bf('0x20')](function(_0x26477d){logger[_0xc4bf('0xa')]('ShowInterval',_0x14476d);logger[_0xc4bf('0xd')]('ShowInterval',_0x14476d,JSON['stringify'](_0x26477d));_0x5e3bc1(_0x26477d);})['catch'](function(_0x317715){logger[_0xc4bf('0x10')]('ShowInterval',_0x317715[_0xc4bf('0x12')],_0x14476d);_0x51f03b(_0x3ff129['error'](0x1f4,_0x317715[_0xc4bf('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 9d6c14c..f9350ab 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 _0x2376=['post','isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x25ecd2,_0x46ba89){var _0x4bb7bb=function(_0x2805d5){while(--_0x2805d5){_0x25ecd2['push'](_0x25ecd2['shift']());}};_0x4bb7bb(++_0x46ba89);}(_0x2376,0x1d7));var _0x6237=function(_0x3c852b,_0x44c896){_0x3c852b=_0x3c852b-0x0;var _0x31a826=_0x2376[_0x3c852b];return _0x31a826;};'use strict';var express=require('express');var router=express[_0x6237('0x0')]();var auth=require(_0x6237('0x1'));var controller=require(_0x6237('0x2'));router[_0x6237('0x3')]('/',auth[_0x6237('0x4')](),controller[_0x6237('0x5')]);module['exports']=router; \ No newline at end of file +var _0x6ece=['exports','express','Router','./jira.controller','post','isAuthenticated'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x6ece,0x13f));var _0xe6ec=function(_0x2f9bf,_0x2bedc8){_0x2f9bf=_0x2f9bf-0x0;var _0x4cba13=_0x6ece[_0x2f9bf];return _0x4cba13;};'use strict';var express=require(_0xe6ec('0x0'));var router=express[_0xe6ec('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xe6ec('0x2'));router[_0xe6ec('0x3')]('/',auth[_0xe6ec('0x4')](),controller['send']);module[_0xe6ec('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 24aa2d9..f7edf63 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 _0xa3e9=['key','MOTGUI','summary','Report','description','stringify','issuetype','Bug','email','fields','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','setEncoding','utf8','data','end','statusCode','json','parse','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','api','3eAmWpBVP0'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa3e9,0x1c9));var _0x9a3e=function(_0x8ea17b,_0x2fb0f5){_0x8ea17b=_0x8ea17b-0x0;var _0x1189e5=_0xa3e9[_0x8ea17b];return _0x1189e5;};'use strict';var BPromise=require('bluebird');var https=require(_0x9a3e('0x0'));var logger=require('../../config/logger')(_0x9a3e('0x1'));var USERNAME='support';var PASSWORD=_0x9a3e('0x2');function openIssue(_0x3bf143,_0x50775a){var _0xf1344e={'fields':{'project':{'key':_0x3bf143[_0x9a3e('0x3')]||_0x9a3e('0x4')},'summary':(_0x3bf143[_0x9a3e('0x5')]||_0x9a3e('0x6'))+'\x20from\x20'+_0x3bf143['ip'],'description':_0x3bf143[_0x9a3e('0x7')]||JSON[_0x9a3e('0x8')](_0x3bf143),'issuetype':{'name':_0x3bf143[_0x9a3e('0x9')]||_0x9a3e('0xa')}}};_0xf1344e['fields']['customfield_11500']=_0x3bf143[_0x9a3e('0xb')];_0xf1344e[_0x9a3e('0xc')][_0x9a3e('0xd')]=_0x3bf143[_0x9a3e('0xe')];_0xf1344e[_0x9a3e('0xc')][_0x9a3e('0xf')]=_0x3bf143[_0x9a3e('0x10')];_0xf1344e[_0x9a3e('0xc')]['customfield_11503']=_0x3bf143[_0x9a3e('0x11')];_0xf1344e[_0x9a3e('0xc')][_0x9a3e('0x12')]=_0x3bf143[_0x9a3e('0x13')];_0xf1344e[_0x9a3e('0xc')][_0x9a3e('0x14')]=_0x3bf143['ip'];var _0x46a357={'host':_0x9a3e('0x15'),'port':0x1bb,'path':_0x9a3e('0x16'),'method':_0x9a3e('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x9a3e('0x18'),'Authorization':_0x9a3e('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x9a3e('0x1a')](_0x9a3e('0x1b'))}};var _0xd0512e=JSON[_0x9a3e('0x8')](_0xf1344e);var _0xb9c4f5=https['request'](_0x46a357,function(_0x5d6b31){_0x5d6b31[_0x9a3e('0x1c')](_0x9a3e('0x1d'));var _0x5c9cb7='';_0x5d6b31['on'](_0x9a3e('0x1e'),function(_0x53c19e){_0x5c9cb7+=_0x53c19e;});_0x5d6b31['on'](_0x9a3e('0x1f'),function(){if(_0x50775a){return _0x50775a['status'](_0x5d6b31[_0x9a3e('0x20')])[_0x9a3e('0x21')](JSON[_0x9a3e('0x22')](_0x5c9cb7));}});});_0xb9c4f5['on']('error',function(_0x51ee51){if(_0x50775a){return _0x50775a[_0x9a3e('0x23')](0x1f4)[_0x9a3e('0x21')]({'errors':[{'message':_0x9a3e('0x24'),'type':_0x9a3e('0x25')}]});}});_0xb9c4f5['write'](_0xd0512e);_0xb9c4f5[_0x9a3e('0x1f')]();}exports[_0x9a3e('0x26')]=openIssue;exports[_0x9a3e('0x27')]=function(_0x2331ef,_0x2077b7){_0x2331ef[_0x9a3e('0x28')]['ip']=_0x2331ef[_0x9a3e('0x29')][_0x9a3e('0x2a')]||_0x2331ef[_0x9a3e('0x2b')][_0x9a3e('0x2c')]||_0x2331ef[_0x9a3e('0x2d')][_0x9a3e('0x2c')]||_0x2331ef[_0x9a3e('0x2b')][_0x9a3e('0x2d')][_0x9a3e('0x2c')];return openIssue(_0x2331ef[_0x9a3e('0x28')],_0x2077b7);}; \ No newline at end of file +var _0xad2e=['connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','key','MOTGUI','summary','Report','description','stringify','issuetype','Bug','customfield_11500','email','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','setEncoding','data','end','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','headers','x-forwarded-for'];(function(_0x26a627,_0x1ee3f5){var _0x2f80e9=function(_0x110fd1){while(--_0x110fd1){_0x26a627['push'](_0x26a627['shift']());}};_0x2f80e9(++_0x1ee3f5);}(_0xad2e,0x1aa));var _0xead2=function(_0x89913f,_0x47fc9b){_0x89913f=_0x89913f-0x0;var _0xd6d9e2=_0xad2e[_0x89913f];return _0xd6d9e2;};'use strict';var BPromise=require(_0xead2('0x0'));var https=require(_0xead2('0x1'));var logger=require(_0xead2('0x2'))(_0xead2('0x3'));var USERNAME=_0xead2('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x25d159,_0x186862){var _0x17f7e8={'fields':{'project':{'key':_0x25d159[_0xead2('0x5')]||_0xead2('0x6')},'summary':(_0x25d159[_0xead2('0x7')]||_0xead2('0x8'))+'\x20from\x20'+_0x25d159['ip'],'description':_0x25d159[_0xead2('0x9')]||JSON[_0xead2('0xa')](_0x25d159),'issuetype':{'name':_0x25d159[_0xead2('0xb')]||_0xead2('0xc')}}};_0x17f7e8['fields'][_0xead2('0xd')]=_0x25d159[_0xead2('0xe')];_0x17f7e8[_0xead2('0xf')][_0xead2('0x10')]=_0x25d159[_0xead2('0x11')];_0x17f7e8[_0xead2('0xf')][_0xead2('0x12')]=_0x25d159[_0xead2('0x13')];_0x17f7e8['fields'][_0xead2('0x14')]=_0x25d159[_0xead2('0x15')];_0x17f7e8[_0xead2('0xf')]['customfield_11504']=_0x25d159[_0xead2('0x16')];_0x17f7e8['fields'][_0xead2('0x17')]=_0x25d159['ip'];var _0x4300bb={'host':_0xead2('0x18'),'port':0x1bb,'path':_0xead2('0x19'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xead2('0x1a'),'Authorization':_0xead2('0x1b')+new Buffer(USERNAME+':'+PASSWORD)[_0xead2('0x1c')](_0xead2('0x1d'))}};var _0x2517a5=JSON[_0xead2('0xa')](_0x17f7e8);var _0x51af78=https['request'](_0x4300bb,function(_0x564ef1){_0x564ef1[_0xead2('0x1e')]('utf8');var _0x4c6392='';_0x564ef1['on'](_0xead2('0x1f'),function(_0x231011){_0x4c6392+=_0x231011;});_0x564ef1['on'](_0xead2('0x20'),function(){if(_0x186862){return _0x186862['status'](_0x564ef1[_0xead2('0x21')])[_0xead2('0x22')](JSON[_0xead2('0x23')](_0x4c6392));}});});_0x51af78['on'](_0xead2('0x24'),function(_0x1a3f13){if(_0x186862){return _0x186862['status'](0x1f4)['json']({'errors':[{'message':_0xead2('0x25'),'type':_0xead2('0x26')}]});}});_0x51af78['write'](_0x2517a5);_0x51af78[_0xead2('0x20')]();}exports[_0xead2('0x27')]=openIssue;exports[_0xead2('0x28')]=function(_0x3008a5,_0x4d4c7e){_0x3008a5[_0xead2('0x29')]['ip']=_0x3008a5[_0xead2('0x2a')][_0xead2('0x2b')]||_0x3008a5[_0xead2('0x2c')][_0xead2('0x2d')]||_0x3008a5['socket'][_0xead2('0x2d')]||_0x3008a5['connection'][_0xead2('0x2e')][_0xead2('0x2d')];return openIssue(_0x3008a5[_0xead2('0x29')],_0x4d4c7e);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index e854a3e..4a42af0 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 _0x223a=['../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','post','put','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x2db6d9,_0x4c8160){var _0x47491c=function(_0x399655){while(--_0x399655){_0x2db6d9['push'](_0x2db6d9['shift']());}};_0x47491c(++_0x4c8160);}(_0x223a,0x94));var _0xa223=function(_0x98813e,_0x2128b4){_0x98813e=_0x98813e-0x0;var _0x14803a=_0x223a[_0x98813e];return _0x14803a;};'use strict';var multer=require(_0xa223('0x0'));var util=require(_0xa223('0x1'));var path=require(_0xa223('0x2'));var timeout=require(_0xa223('0x3'));var express=require('express');var router=express[_0xa223('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa223('0x5'));var config=require(_0xa223('0x6'));var controller=require(_0xa223('0x7'));router[_0xa223('0x8')]('/',auth[_0xa223('0x9')](),controller[_0xa223('0xa')]);router[_0xa223('0x8')](_0xa223('0xb'),auth[_0xa223('0x9')](),controller['describe']);router[_0xa223('0x8')](_0xa223('0xc'),auth[_0xa223('0x9')](),controller['show']);router[_0xa223('0xd')]('/',auth[_0xa223('0x9')](),controller['create']);router[_0xa223('0xe')]('/:id',auth[_0xa223('0x9')](),controller['update']);router['delete'](_0xa223('0xc'),auth[_0xa223('0x9')](),controller[_0xa223('0xf')]);module[_0xa223('0x10')]=router; \ No newline at end of file +var _0x1f86=['../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','isAuthenticated','describe','/:id','show','create','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1f86,0x1b0));var _0x61f8=function(_0x100786,_0x59c23c){_0x100786=_0x100786-0x0;var _0x55a5d2=_0x1f86[_0x100786];return _0x55a5d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x61f8('0x0'));var timeout=require(_0x61f8('0x1'));var express=require(_0x61f8('0x2'));var router=express[_0x61f8('0x3')]();var fs_extra=require(_0x61f8('0x4'));var auth=require(_0x61f8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x61f8('0x6'));var controller=require(_0x61f8('0x7'));router[_0x61f8('0x8')]('/',auth['isAuthenticated'](),controller[_0x61f8('0x9')]);router['get']('/describe',auth[_0x61f8('0xa')](),controller[_0x61f8('0xb')]);router['get'](_0x61f8('0xc'),auth[_0x61f8('0xa')](),controller[_0x61f8('0xd')]);router['post']('/',auth[_0x61f8('0xa')](),controller[_0x61f8('0xe')]);router[_0x61f8('0xf')](_0x61f8('0xc'),auth[_0x61f8('0xa')](),controller['update']);router[_0x61f8('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x61f8('0x11')]);module[_0x61f8('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 75f74b4..7fe0c23 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 _0x823c=['TEXT','long','STRING','sequelize'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x823c,0x143));var _0xc823=function(_0x387168,_0x2a5e85){_0x387168=_0x387168-0x0;var _0x43a0ae=_0x823c[_0x387168];return _0x43a0ae;};'use strict';var Sequelize=require(_0xc823('0x0'));module['exports']={'question':{'type':Sequelize[_0xc823('0x1')]},'answer':{'type':Sequelize[_0xc823('0x1')](_0xc823('0x2'))},'membername':{'type':Sequelize[_0xc823('0x3')]},'projectname':{'type':Sequelize[_0xc823('0x3')]},'queue':{'type':Sequelize[_0xc823('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc823('0x3')]},'calleridnum':{'type':Sequelize[_0xc823('0x3')]},'questionId':{'type':Sequelize[_0xc823('0x3')]}}; \ No newline at end of file +var _0x4024=['long','STRING','sequelize','exports','TEXT'];(function(_0x494659,_0x1b8e75){var _0x36a11d=function(_0x1b4e77){while(--_0x1b4e77){_0x494659['push'](_0x494659['shift']());}};_0x36a11d(++_0x1b8e75);}(_0x4024,0x89));var _0x4402=function(_0x4c59c3,_0x363e17){_0x4c59c3=_0x4c59c3-0x0;var _0x33115d=_0x4024[_0x4c59c3];return _0x33115d;};'use strict';var Sequelize=require(_0x4402('0x0'));module[_0x4402('0x1')]={'question':{'type':Sequelize['TEXT']},'answer':{'type':Sequelize[_0x4402('0x2')](_0x4402('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x4402('0x4')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4402('0x4')]},'calleridname':{'type':Sequelize[_0x4402('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index b4696f5..a5f4084 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 _0xdc7a=['destroy','then','end','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','findAll','rows','catch','params','create','body','find','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update'];(function(_0x40b4ab,_0x4789bf){var _0x4a432a=function(_0x2cbf2f){while(--_0x2cbf2f){_0x40b4ab['push'](_0x40b4ab['shift']());}};_0x4a432a(++_0x4789bf);}(_0xdc7a,0x6e));var _0xadc7=function(_0x41b4a9,_0x2a6605){_0x41b4a9=_0x41b4a9-0x0;var _0x4a0854=_0xdc7a[_0x41b4a9];return _0x4a0854;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xadc7('0x0'));var jsonpatch=require(_0xadc7('0x1'));var rp=require(_0xadc7('0x2'));var moment=require(_0xadc7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xadc7('0x4'));var util=require('util');var path=require(_0xadc7('0x5'));var sox=require(_0xadc7('0x6'));var csv=require(_0xadc7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xadc7('0x8'));var _=require(_0xadc7('0x9'));var squel=require(_0xadc7('0xa'));var crypto=require(_0xadc7('0xb'));var jsforce=require(_0xadc7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xadc7('0x7'));var querystring=require(_0xadc7('0xd'));var Papa=require(_0xadc7('0xe'));var Redis=require(_0xadc7('0xf'));var authService=require(_0xadc7('0x10'));var qs=require(_0xadc7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xadc7('0x12'));var logger=require(_0xadc7('0x13'))(_0xadc7('0x14'));var utils=require('../../config/utils');var config=require(_0xadc7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xadc7('0x16'))['db'];function respondWithStatusCode(_0x3644b8,_0x578d39){_0x578d39=_0x578d39||0xcc;return function(_0x40b1be){if(_0x40b1be){return _0x3644b8[_0xadc7('0x17')](_0x578d39);}return _0x3644b8[_0xadc7('0x18')](_0x578d39)['end']();};}function respondWithResult(_0x45aa5f,_0x5e9a37){_0x5e9a37=_0x5e9a37||0xc8;return function(_0x519dab){if(_0x519dab){return _0x45aa5f[_0xadc7('0x18')](_0x5e9a37)[_0xadc7('0x19')](_0x519dab);}};}function respondWithFilteredResult(_0x2a7398,_0x3f3d1f){return function(_0xcebe0b){if(_0xcebe0b){var _0x339b87=_0xcebe0b[_0xadc7('0x1a')],_0x3b090a=_0x3f3d1f[_0xadc7('0x1b')],_0x2e56de=_0x3f3d1f[_0xadc7('0x1b')]+_0x3f3d1f[_0xadc7('0x1c')],_0x5053c9;if(_0x2e56de>=_0x339b87){_0x2e56de=_0x339b87;_0x5053c9=0xc8;}else{_0x5053c9=0xce;}_0x2a7398[_0xadc7('0x18')](_0x5053c9);return _0x2a7398['set'](_0xadc7('0x1d'),_0x3b090a+'-'+_0x2e56de+'/'+_0x339b87)['json'](_0xcebe0b);}return null;};}function patchUpdates(_0x399d0e){return function(_0x48e30f){try{jsonpatch[_0xadc7('0x1e')](_0x48e30f,_0x399d0e,!![]);}catch(_0x42d731){return BPromise[_0xadc7('0x1f')](_0x42d731);}return _0x48e30f[_0xadc7('0x20')]();};}function saveUpdates(_0x22d92a,_0x46a191){return function(_0x4bf882){if(_0x4bf882){return _0x4bf882[_0xadc7('0x21')](_0x22d92a)['then'](function(_0x2a10ea){return _0x2a10ea;});}return null;};}function removeEntity(_0x4b1755,_0x147e48){return function(_0x3ee173){if(_0x3ee173){return _0x3ee173[_0xadc7('0x22')]()[_0xadc7('0x23')](function(){_0x4b1755[_0xadc7('0x18')](0xcc)[_0xadc7('0x24')]();});}};}function handleEntityNotFound(_0x19b8c4,_0x57b6c8){return function(_0x9d2c89){if(!_0x9d2c89){_0x19b8c4['sendStatus'](0x194);}return _0x9d2c89;};}function handleError(_0x1b2a0b,_0x408f8a){_0x408f8a=_0x408f8a||0x1f4;return function(_0x42a92f){logger['error'](_0x42a92f[_0xadc7('0x25')]);if(_0x42a92f[_0xadc7('0x26')]){delete _0x42a92f['name'];}_0x1b2a0b[_0xadc7('0x18')](_0x408f8a)[_0xadc7('0x27')](_0x42a92f);};}exports['index']=function(_0x908a34,_0x4ef0fd){var _0x1bb791={},_0x5e8c81={},_0x1d957f={'count':0x0,'rows':[]};var _0x143d86=_[_0xadc7('0x28')](db['JscriptyAnswerReport'][_0xadc7('0x29')],function(_0xc1a554){return{'name':_0xc1a554[_0xadc7('0x2a')],'type':_0xc1a554[_0xadc7('0x2b')]['key']};});_0x5e8c81['model']=_[_0xadc7('0x28')](_0x143d86,_0xadc7('0x26'));_0x5e8c81[_0xadc7('0x2c')]=_[_0xadc7('0x2d')](_0x908a34[_0xadc7('0x2c')]);_0x5e8c81[_0xadc7('0x2e')]=_[_0xadc7('0x2f')](_0x5e8c81[_0xadc7('0x30')],_0x5e8c81[_0xadc7('0x2c')]);_0x1bb791['attributes']=_[_0xadc7('0x2f')](_0x5e8c81[_0xadc7('0x30')],qs[_0xadc7('0x31')](_0x908a34[_0xadc7('0x2c')][_0xadc7('0x31')]));_0x1bb791[_0xadc7('0x32')]=_0x1bb791[_0xadc7('0x32')][_0xadc7('0x33')]?_0x1bb791[_0xadc7('0x32')]:_0x5e8c81[_0xadc7('0x30')];if(!_0x908a34[_0xadc7('0x2c')][_0xadc7('0x34')](_0xadc7('0x35'))){_0x1bb791[_0xadc7('0x1c')]=qs['limit'](_0x908a34[_0xadc7('0x2c')]['limit']);_0x1bb791[_0xadc7('0x1b')]=qs['offset'](_0x908a34[_0xadc7('0x2c')][_0xadc7('0x1b')]);}_0x1bb791[_0xadc7('0x36')]=qs[_0xadc7('0x37')](_0x908a34[_0xadc7('0x2c')][_0xadc7('0x37')]);_0x1bb791['where']=qs[_0xadc7('0x2e')](_[_0xadc7('0x38')](_0x908a34['query'],_0x5e8c81[_0xadc7('0x2e')]),_0x143d86);if(_0x908a34[_0xadc7('0x2c')][_0xadc7('0x39')]){_0x1bb791[_0xadc7('0x3a')]=_[_0xadc7('0x3b')](_0x1bb791[_0xadc7('0x3a')],{'$or':_[_0xadc7('0x28')](_0x143d86,function(_0x3cc8fa){if(_0x3cc8fa[_0xadc7('0x2b')]!==_0xadc7('0x3c')){var _0x3f0d42={};_0x3f0d42[_0x3cc8fa[_0xadc7('0x26')]]={'$like':'%'+_0x908a34[_0xadc7('0x2c')]['filter']+'%'};return _0x3f0d42;}})});}_0x1bb791=_[_0xadc7('0x3b')]({},_0x1bb791,_0x908a34[_0xadc7('0x3d')]);var _0x3b92a7={'where':_0x1bb791[_0xadc7('0x3a')]};return db[_0xadc7('0x3e')][_0xadc7('0x1a')](_0x3b92a7)[_0xadc7('0x23')](function(_0x308c0c){_0x1d957f[_0xadc7('0x1a')]=_0x308c0c;if(_0x908a34[_0xadc7('0x2c')][_0xadc7('0x3f')]){_0x1bb791['include']=[{'all':!![]}];}return db[_0xadc7('0x3e')][_0xadc7('0x40')](_0x1bb791);})['then'](function(_0x20e077){_0x1d957f[_0xadc7('0x41')]=_0x20e077;return _0x1d957f;})[_0xadc7('0x23')](respondWithFilteredResult(_0x4ef0fd,_0x1bb791))[_0xadc7('0x42')](handleError(_0x4ef0fd,null));};exports['show']=function(_0x4d3a84,_0x2182c8){var _0x3842fb={'raw':!![],'where':{'id':_0x4d3a84[_0xadc7('0x43')]['id']}},_0x7fc40c={};_0x7fc40c[_0xadc7('0x30')]=_[_0xadc7('0x2d')](db[_0xadc7('0x3e')]['rawAttributes']);_0x7fc40c[_0xadc7('0x2c')]=_[_0xadc7('0x2d')](_0x4d3a84[_0xadc7('0x2c')]);_0x7fc40c[_0xadc7('0x2e')]=_[_0xadc7('0x2f')](_0x7fc40c[_0xadc7('0x30')],_0x7fc40c[_0xadc7('0x2c')]);_0x3842fb['attributes']=_[_0xadc7('0x2f')](_0x7fc40c[_0xadc7('0x30')],qs[_0xadc7('0x31')](_0x4d3a84[_0xadc7('0x2c')][_0xadc7('0x31')]));_0x3842fb[_0xadc7('0x32')]=_0x3842fb[_0xadc7('0x32')][_0xadc7('0x33')]?_0x3842fb['attributes']:_0x7fc40c[_0xadc7('0x30')];if(_0x4d3a84['query'][_0xadc7('0x3f')]){_0x3842fb['include']=[{'all':!![]}];}_0x3842fb=_['merge']({},_0x3842fb,_0x4d3a84[_0xadc7('0x3d')]);return db['JscriptyAnswerReport']['find'](_0x3842fb)['then'](handleEntityNotFound(_0x2182c8,null))[_0xadc7('0x23')](respondWithResult(_0x2182c8,null))[_0xadc7('0x42')](handleError(_0x2182c8,null));};exports[_0xadc7('0x44')]=function(_0x56901e,_0x5f3663){return db[_0xadc7('0x3e')]['create'](_0x56901e[_0xadc7('0x45')],{})[_0xadc7('0x23')](respondWithResult(_0x5f3663,0xc9))[_0xadc7('0x42')](handleError(_0x5f3663,null));};exports['update']=function(_0x53abd9,_0xae2c0e){if(_0x53abd9[_0xadc7('0x45')]['id']){delete _0x53abd9[_0xadc7('0x45')]['id'];}return db[_0xadc7('0x3e')][_0xadc7('0x46')]({'where':{'id':_0x53abd9[_0xadc7('0x43')]['id']}})[_0xadc7('0x23')](handleEntityNotFound(_0xae2c0e,null))['then'](saveUpdates(_0x53abd9['body'],null))['then'](respondWithResult(_0xae2c0e,null))[_0xadc7('0x42')](handleError(_0xae2c0e,null));};exports[_0xadc7('0x22')]=function(_0x18cc55,_0x5e6a67){return db[_0xadc7('0x3e')][_0xadc7('0x46')]({'where':{'id':_0x18cc55[_0xadc7('0x43')]['id']}})[_0xadc7('0x23')](handleEntityNotFound(_0x5e6a67,null))[_0xadc7('0x23')](removeEntity(_0x5e6a67,null))[_0xadc7('0x42')](handleError(_0x5e6a67,null));};exports['describe']=function(_0x19992d,_0x1dfcf8){return db[_0xadc7('0x3e')][_0xadc7('0x47')]()[_0xadc7('0x23')](respondWithResult(_0x1dfcf8,null))['catch'](handleError(_0x1dfcf8,null));}; \ No newline at end of file +var _0x880e=['set','Content-Range','apply','update','destroy','then','error','name','send','index','JscriptyAnswerReport','fieldName','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','VIRTUAL','filter','merge','options','count','includeAll','rows','catch','params','rawAttributes','fields','include','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x880e,0x103));var _0xe880=function(_0x2a0350,_0x249319){_0x2a0350=_0x2a0350-0x0;var _0x425220=_0x880e[_0x2a0350];return _0x425220;};'use strict';var emlformat=require(_0xe880('0x0'));var rimraf=require(_0xe880('0x1'));var zipdir=require(_0xe880('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe880('0x3'));var moment=require(_0xe880('0x4'));var BPromise=require(_0xe880('0x5'));var Mustache=require(_0xe880('0x6'));var util=require(_0xe880('0x7'));var path=require(_0xe880('0x8'));var sox=require(_0xe880('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe880('0xa'));var _=require(_0xe880('0xb'));var squel=require(_0xe880('0xc'));var crypto=require('crypto');var jsforce=require(_0xe880('0xd'));var deskjs=require(_0xe880('0xe'));var toCsv=require(_0xe880('0xf'));var querystring=require(_0xe880('0x10'));var Papa=require(_0xe880('0x11'));var Redis=require('ioredis');var authService=require(_0xe880('0x12'));var qs=require(_0xe880('0x13'));var as=require(_0xe880('0x14'));var hardwareService=require(_0xe880('0x15'));var logger=require(_0xe880('0x16'))(_0xe880('0x17'));var utils=require('../../config/utils');var config=require(_0xe880('0x18'));var licenseUtil=require(_0xe880('0x19'));var db=require(_0xe880('0x1a'))['db'];function respondWithStatusCode(_0x3df47d,_0x49d681){_0x49d681=_0x49d681||0xcc;return function(_0x56f327){if(_0x56f327){return _0x3df47d[_0xe880('0x1b')](_0x49d681);}return _0x3df47d[_0xe880('0x1c')](_0x49d681)[_0xe880('0x1d')]();};}function respondWithResult(_0x4ca8a2,_0x233d87){_0x233d87=_0x233d87||0xc8;return function(_0x418212){if(_0x418212){return _0x4ca8a2[_0xe880('0x1c')](_0x233d87)[_0xe880('0x1e')](_0x418212);}};}function respondWithFilteredResult(_0x2178e6,_0x454753){return function(_0x5e2564){if(_0x5e2564){var _0x22e549=_0x5e2564['count'],_0x30ecfe=_0x454753[_0xe880('0x1f')],_0x5469a5=_0x454753[_0xe880('0x1f')]+_0x454753[_0xe880('0x20')],_0x39d766;if(_0x5469a5>=_0x22e549){_0x5469a5=_0x22e549;_0x39d766=0xc8;}else{_0x39d766=0xce;}_0x2178e6['status'](_0x39d766);return _0x2178e6[_0xe880('0x21')](_0xe880('0x22'),_0x30ecfe+'-'+_0x5469a5+'/'+_0x22e549)[_0xe880('0x1e')](_0x5e2564);}return null;};}function patchUpdates(_0x4e2dc3){return function(_0x3cfc6d){try{jsonpatch[_0xe880('0x23')](_0x3cfc6d,_0x4e2dc3,!![]);}catch(_0xcdbfeb){return BPromise['reject'](_0xcdbfeb);}return _0x3cfc6d['save']();};}function saveUpdates(_0x5788d7,_0x14a424){return function(_0x4b0e05){if(_0x4b0e05){return _0x4b0e05[_0xe880('0x24')](_0x5788d7)['then'](function(_0x308ef5){return _0x308ef5;});}return null;};}function removeEntity(_0x31554b,_0x3c2f4c){return function(_0x1fd703){if(_0x1fd703){return _0x1fd703[_0xe880('0x25')]()[_0xe880('0x26')](function(){_0x31554b[_0xe880('0x1c')](0xcc)[_0xe880('0x1d')]();});}};}function handleEntityNotFound(_0x4d281f,_0x8f1100){return function(_0x3ae325){if(!_0x3ae325){_0x4d281f[_0xe880('0x1b')](0x194);}return _0x3ae325;};}function handleError(_0x5997ec,_0x504041){_0x504041=_0x504041||0x1f4;return function(_0x52e99a){logger[_0xe880('0x27')](_0x52e99a['stack']);if(_0x52e99a['name']){delete _0x52e99a[_0xe880('0x28')];}_0x5997ec[_0xe880('0x1c')](_0x504041)[_0xe880('0x29')](_0x52e99a);};}exports[_0xe880('0x2a')]=function(_0x212974,_0x3140d6){var _0x4d854f={},_0x3151ec={},_0x50094e={'count':0x0,'rows':[]};var _0x4ef2d2=_['map'](db[_0xe880('0x2b')]['rawAttributes'],function(_0x49c77b){return{'name':_0x49c77b[_0xe880('0x2c')],'type':_0x49c77b[_0xe880('0x2d')]['key']};});_0x3151ec[_0xe880('0x2e')]=_[_0xe880('0x2f')](_0x4ef2d2,_0xe880('0x28'));_0x3151ec[_0xe880('0x30')]=_[_0xe880('0x31')](_0x212974['query']);_0x3151ec[_0xe880('0x32')]=_[_0xe880('0x33')](_0x3151ec['model'],_0x3151ec[_0xe880('0x30')]);_0x4d854f[_0xe880('0x34')]=_['intersection'](_0x3151ec['model'],qs['fields'](_0x212974[_0xe880('0x30')]['fields']));_0x4d854f['attributes']=_0x4d854f[_0xe880('0x34')][_0xe880('0x35')]?_0x4d854f[_0xe880('0x34')]:_0x3151ec[_0xe880('0x2e')];if(!_0x212974[_0xe880('0x30')][_0xe880('0x36')](_0xe880('0x37'))){_0x4d854f[_0xe880('0x20')]=qs[_0xe880('0x20')](_0x212974[_0xe880('0x30')][_0xe880('0x20')]);_0x4d854f[_0xe880('0x1f')]=qs['offset'](_0x212974[_0xe880('0x30')][_0xe880('0x1f')]);}_0x4d854f[_0xe880('0x38')]=qs['sort'](_0x212974['query']['sort']);_0x4d854f[_0xe880('0x39')]=qs[_0xe880('0x32')](_['pick'](_0x212974[_0xe880('0x30')],_0x3151ec[_0xe880('0x32')]),_0x4ef2d2);if(_0x212974[_0xe880('0x30')]['filter']){_0x4d854f[_0xe880('0x39')]=_['merge'](_0x4d854f[_0xe880('0x39')],{'$or':_[_0xe880('0x2f')](_0x4ef2d2,function(_0x25a83e){if(_0x25a83e[_0xe880('0x2d')]!==_0xe880('0x3a')){var _0x29ffb6={};_0x29ffb6[_0x25a83e[_0xe880('0x28')]]={'$like':'%'+_0x212974['query'][_0xe880('0x3b')]+'%'};return _0x29ffb6;}})});}_0x4d854f=_[_0xe880('0x3c')]({},_0x4d854f,_0x212974[_0xe880('0x3d')]);var _0x45a82b={'where':_0x4d854f[_0xe880('0x39')]};return db[_0xe880('0x2b')][_0xe880('0x3e')](_0x45a82b)[_0xe880('0x26')](function(_0x805688){_0x50094e[_0xe880('0x3e')]=_0x805688;if(_0x212974[_0xe880('0x30')][_0xe880('0x3f')]){_0x4d854f['include']=[{'all':!![]}];}return db[_0xe880('0x2b')]['findAll'](_0x4d854f);})['then'](function(_0x52be8e){_0x50094e[_0xe880('0x40')]=_0x52be8e;return _0x50094e;})['then'](respondWithFilteredResult(_0x3140d6,_0x4d854f))[_0xe880('0x41')](handleError(_0x3140d6,null));};exports['show']=function(_0x397be7,_0x43ea94){var _0x5b9ad6={'raw':!![],'where':{'id':_0x397be7[_0xe880('0x42')]['id']}},_0x50d1c1={};_0x50d1c1[_0xe880('0x2e')]=_[_0xe880('0x31')](db[_0xe880('0x2b')][_0xe880('0x43')]);_0x50d1c1[_0xe880('0x30')]=_['keys'](_0x397be7[_0xe880('0x30')]);_0x50d1c1['filters']=_[_0xe880('0x33')](_0x50d1c1[_0xe880('0x2e')],_0x50d1c1[_0xe880('0x30')]);_0x5b9ad6[_0xe880('0x34')]=_[_0xe880('0x33')](_0x50d1c1['model'],qs[_0xe880('0x44')](_0x397be7[_0xe880('0x30')]['fields']));_0x5b9ad6[_0xe880('0x34')]=_0x5b9ad6['attributes'][_0xe880('0x35')]?_0x5b9ad6[_0xe880('0x34')]:_0x50d1c1[_0xe880('0x2e')];if(_0x397be7[_0xe880('0x30')]['includeAll']){_0x5b9ad6[_0xe880('0x45')]=[{'all':!![]}];}_0x5b9ad6=_[_0xe880('0x3c')]({},_0x5b9ad6,_0x397be7['options']);return db[_0xe880('0x2b')]['find'](_0x5b9ad6)[_0xe880('0x26')](handleEntityNotFound(_0x43ea94,null))[_0xe880('0x26')](respondWithResult(_0x43ea94,null))[_0xe880('0x41')](handleError(_0x43ea94,null));};exports[_0xe880('0x46')]=function(_0x576d35,_0x5cd78e){return db[_0xe880('0x2b')][_0xe880('0x46')](_0x576d35['body'],{})[_0xe880('0x26')](respondWithResult(_0x5cd78e,0xc9))[_0xe880('0x41')](handleError(_0x5cd78e,null));};exports[_0xe880('0x24')]=function(_0x20cdde,_0x1ae8f0){if(_0x20cdde[_0xe880('0x47')]['id']){delete _0x20cdde[_0xe880('0x47')]['id'];}return db['JscriptyAnswerReport'][_0xe880('0x48')]({'where':{'id':_0x20cdde[_0xe880('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ae8f0,null))[_0xe880('0x26')](saveUpdates(_0x20cdde['body'],null))[_0xe880('0x26')](respondWithResult(_0x1ae8f0,null))['catch'](handleError(_0x1ae8f0,null));};exports['destroy']=function(_0x583570,_0x5170f2){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x583570[_0xe880('0x42')]['id']}})[_0xe880('0x26')](handleEntityNotFound(_0x5170f2,null))['then'](removeEntity(_0x5170f2,null))[_0xe880('0x41')](handleError(_0x5170f2,null));};exports['describe']=function(_0x1e2b70,_0x205dd4){return db[_0xe880('0x2b')]['describe']()['then'](respondWithResult(_0x205dd4,null))[_0xe880('0x41')](handleError(_0x205dd4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 04fb4b1..669954b 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 _0x77f5=['lodash','util','api','bluebird','request-promise','rimraf','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x245e65,_0x4cc92c){var _0x2a19e2=function(_0xb7f9cf){while(--_0xb7f9cf){_0x245e65['push'](_0x245e65['shift']());}};_0x2a19e2(++_0x4cc92c);}(_0x77f5,0x12c));var _0x577f=function(_0x5ba5a0,_0x22a50a){_0x5ba5a0=_0x5ba5a0-0x0;var _0x147187=_0x77f5[_0x5ba5a0];return _0x147187;};'use strict';var _=require(_0x577f('0x0'));var util=require(_0x577f('0x1'));var logger=require('../../config/logger')(_0x577f('0x2'));var moment=require('moment');var BPromise=require(_0x577f('0x3'));var rp=require(_0x577f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x577f('0x5'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x577f('0x6')]=function(_0x5f1c56,_0x5ece60){return _0x5f1c56[_0x577f('0x7')](_0x577f('0x8'),attributes,{'tableName':_0x577f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4481=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./jscriptyAnswerReport.attributes'];(function(_0x50fde6,_0x4ae533){var _0x3ddb2d=function(_0x526232){while(--_0x526232){_0x50fde6['push'](_0x50fde6['shift']());}};_0x3ddb2d(++_0x4ae533);}(_0x4481,0x1c4));var _0x1448=function(_0x2d9f32,_0x407aa6){_0x2d9f32=_0x2d9f32-0x0;var _0x196e59=_0x4481[_0x2d9f32];return _0x196e59;};'use strict';var _=require(_0x1448('0x0'));var util=require(_0x1448('0x1'));var logger=require(_0x1448('0x2'))(_0x1448('0x3'));var moment=require(_0x1448('0x4'));var BPromise=require(_0x1448('0x5'));var rp=require(_0x1448('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1448('0x7'));module['exports']=function(_0x3ca35c,_0x476a25){return _0x3ca35c['define'](_0x1448('0x8'),attributes,{'tableName':_0x1448('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 7512c54..ca19406 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 _0xd28d=['info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x1f9700,_0x4ba3b4){var _0x3b0601=function(_0x3805d5){while(--_0x3805d5){_0x1f9700['push'](_0x1f9700['shift']());}};_0x3b0601(++_0x4ba3b4);}(_0xd28d,0x1e3));var _0xdd28=function(_0x5a0e36,_0x50c36a){_0x5a0e36=_0x5a0e36-0x0;var _0x5b9082=_0xd28d[_0x5a0e36];return _0x5b9082;};'use strict';var _=require(_0xdd28('0x0'));var util=require(_0xdd28('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdd28('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd28('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd28('0x4'))(_0xdd28('0x5'));var config=require(_0xdd28('0x6'));var jayson=require(_0xdd28('0x7'));var client=jayson[_0xdd28('0x8')][_0xdd28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x523b31,_0x221cee,_0x2ae21f){return new BPromise(function(_0x9a80e5,_0x531cbd){return client[_0xdd28('0xa')](_0x523b31,_0x2ae21f)[_0xdd28('0xb')](function(_0x21870f){logger['info'](_0xdd28('0xc'),_0x221cee,_0xdd28('0xd'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x221cee,_0xdd28('0xd'),JSON[_0xdd28('0xe')](_0x21870f));if(_0x21870f[_0xdd28('0xf')]){if(_0x21870f['error']['code']===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x221cee,_0x21870f[_0xdd28('0xf')][_0xdd28('0x10')]);return _0x531cbd(_0x21870f[_0xdd28('0xf')]['message']);}logger[_0xdd28('0xf')](_0xdd28('0xc'),_0x221cee,_0x21870f[_0xdd28('0xf')][_0xdd28('0x10')]);return _0x9a80e5(_0x21870f[_0xdd28('0xf')][_0xdd28('0x10')]);}else{logger[_0xdd28('0x11')](_0xdd28('0xc'),_0x221cee,_0xdd28('0xd'));_0x9a80e5(_0x21870f[_0xdd28('0x12')]['message']);}})[_0xdd28('0x13')](function(_0x3db30b){logger[_0xdd28('0xf')](_0xdd28('0xc'),_0x221cee,_0x3db30b);_0x531cbd(_0x3db30b);});});} \ No newline at end of file +var _0x97d1=['jayson/promise','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0x97d1,0x1e6));var _0x197d=function(_0x2d3d18,_0x475f4c){_0x2d3d18=_0x2d3d18-0x0;var _0x202f49=_0x97d1[_0x2d3d18];return _0x202f49;};'use strict';var _=require(_0x197d('0x0'));var util=require('util');var moment=require(_0x197d('0x1'));var BPromise=require(_0x197d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x197d('0x3'));var db=require(_0x197d('0x4'))['db'];var utils=require(_0x197d('0x5'));var logger=require(_0x197d('0x6'))('rpc');var config=require(_0x197d('0x7'));var jayson=require(_0x197d('0x8'));var client=jayson['client'][_0x197d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1538ac,_0x38b3ce,_0xb849e7){return new BPromise(function(_0x379dc9,_0x3cf0aa){return client[_0x197d('0xa')](_0x1538ac,_0xb849e7)['then'](function(_0x38e4c4){logger[_0x197d('0xb')](_0x197d('0xc'),_0x38b3ce,'request\x20sent');logger[_0x197d('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x38b3ce,'request\x20sent',JSON[_0x197d('0xe')](_0x38e4c4));if(_0x38e4c4[_0x197d('0xf')]){if(_0x38e4c4[_0x197d('0xf')]['code']===0x1f4){logger[_0x197d('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x38b3ce,_0x38e4c4[_0x197d('0xf')]['message']);return _0x3cf0aa(_0x38e4c4['error']['message']);}logger[_0x197d('0xf')](_0x197d('0xc'),_0x38b3ce,_0x38e4c4[_0x197d('0xf')][_0x197d('0x10')]);return _0x379dc9(_0x38e4c4[_0x197d('0xf')][_0x197d('0x10')]);}else{logger[_0x197d('0xb')](_0x197d('0xc'),_0x38b3ce,_0x197d('0x11'));_0x379dc9(_0x38e4c4['result'][_0x197d('0x10')]);}})[_0x197d('0x12')](function(_0x54c862){logger[_0x197d('0xf')](_0x197d('0xc'),_0x38b3ce,_0x54c862);_0x3cf0aa(_0x54c862);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index d7c931f..30257ef 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 _0x68b3=['clone','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone'];(function(_0x4263c6,_0x239009){var _0x47b675=function(_0x3502e8){while(--_0x3502e8){_0x4263c6['push'](_0x4263c6['shift']());}};_0x47b675(++_0x239009);}(_0x68b3,0x1d8));var _0x368b=function(_0x3500cc,_0x320544){_0x3500cc=_0x3500cc-0x0;var _0x4b72ae=_0x68b3[_0x3500cc];return _0x4b72ae;};'use strict';var multer=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var path=require(_0x368b('0x2'));var timeout=require(_0x368b('0x3'));var express=require(_0x368b('0x4'));var router=express['Router']();var fs_extra=require(_0x368b('0x5'));var auth=require(_0x368b('0x6'));var interaction=require(_0x368b('0x7'));var config=require(_0x368b('0x8'));var controller=require('./jscriptyProject.controller');router[_0x368b('0x9')]('/',auth[_0x368b('0xa')](),controller[_0x368b('0xb')]);router[_0x368b('0x9')](_0x368b('0xc'),auth[_0x368b('0xa')](),controller[_0x368b('0xd')]);router[_0x368b('0x9')](_0x368b('0xe'),auth[_0x368b('0xa')](),controller[_0x368b('0xf')]);router['get'](_0x368b('0x10'),auth[_0x368b('0xa')](),controller[_0x368b('0x11')]);router['get'](_0x368b('0x12'),auth[_0x368b('0xa')](),timeout(_0x368b('0x13')),controller['getSummary']);router[_0x368b('0x14')]('/',auth[_0x368b('0xa')](),controller['create']);router[_0x368b('0x14')](_0x368b('0x15'),auth[_0x368b('0xa')](),controller[_0x368b('0x16')]);router[_0x368b('0x17')]('/:id',auth[_0x368b('0xa')](),controller[_0x368b('0x18')]);router['delete'](_0x368b('0xc'),auth[_0x368b('0xa')](),controller[_0x368b('0x19')]);module['exports']=router; \ No newline at end of file +var _0x5204=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','destroy','exports','multer'];(function(_0x336092,_0x22c0e1){var _0x57c708=function(_0x2cd18b){while(--_0x2cd18b){_0x336092['push'](_0x336092['shift']());}};_0x57c708(++_0x22c0e1);}(_0x5204,0xdf));var _0x4520=function(_0x507c81,_0x3e1b56){_0x507c81=_0x507c81-0x0;var _0x368a25=_0x5204[_0x507c81];return _0x368a25;};'use strict';var multer=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var path=require('path');var timeout=require(_0x4520('0x2'));var express=require(_0x4520('0x3'));var router=express[_0x4520('0x4')]();var fs_extra=require(_0x4520('0x5'));var auth=require(_0x4520('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4520('0x7'));var controller=require('./jscriptyProject.controller');router[_0x4520('0x8')]('/',auth[_0x4520('0x9')](),controller[_0x4520('0xa')]);router[_0x4520('0x8')](_0x4520('0xb'),auth[_0x4520('0x9')](),controller[_0x4520('0xc')]);router['get'](_0x4520('0xd'),auth['isAuthenticated'](),controller[_0x4520('0xe')]);router[_0x4520('0x8')](_0x4520('0xf'),auth[_0x4520('0x9')](),controller[_0x4520('0x10')]);router[_0x4520('0x8')](_0x4520('0x11'),auth[_0x4520('0x9')](),timeout(_0x4520('0x12')),controller[_0x4520('0x13')]);router[_0x4520('0x14')]('/',auth[_0x4520('0x9')](),controller[_0x4520('0x15')]);router[_0x4520('0x14')](_0x4520('0x16'),auth[_0x4520('0x9')](),controller[_0x4520('0x17')]);router[_0x4520('0x18')](_0x4520('0xb'),auth[_0x4520('0x9')](),controller[_0x4520('0x19')]);router['delete'](_0x4520('0xb'),auth[_0x4520('0x9')](),controller[_0x4520('0x1a')]);module[_0x4520('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 56a6c81..3fd76cd 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 _0xc4c5=['lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize'];(function(_0x483b66,_0x75e963){var _0x5d38f1=function(_0x27e6a2){while(--_0x27e6a2){_0x483b66['push'](_0x483b66['shift']());}};_0x5d38f1(++_0x75e963);}(_0xc4c5,0x1a8));var _0x5c4c=function(_0x38f367,_0x22df2a){_0x38f367=_0x38f367-0x0;var _0x4f864a=_0xc4c5[_0x38f367];return _0x4f864a;};'use strict';var Sequelize=require(_0x5c4c('0x0'));var _=require(_0x5c4c('0x1'));var util=require(_0x5c4c('0x2'));module[_0x5c4c('0x3')]={'name':{'type':Sequelize[_0x5c4c('0x4')],'unique':_0x5c4c('0x5')},'description':{'type':Sequelize[_0x5c4c('0x4')]},'formData':{'type':Sequelize[_0x5c4c('0x6')](_0x5c4c('0x7')),'set':function(_0x41f0bc){if(_[_0x5c4c('0x8')](_0x41f0bc)){this[_0x5c4c('0x9')](_0x5c4c('0xa'),JSON[_0x5c4c('0xb')](_0x41f0bc));}else if(_[_0x5c4c('0xc')](_0x41f0bc)){this[_0x5c4c('0x9')](_0x5c4c('0xa'),_0x41f0bc);}else{this['setDataValue'](_0x5c4c('0xa'),util[_0x5c4c('0xd')](_0x5c4c('0xe'),this[_0x5c4c('0xf')]('name')||'',this[_0x5c4c('0xf')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x5c4c('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x5c4c('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x3eaf=['BOOLEAN','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','description'];(function(_0x4bb09b,_0x4523df){var _0x5e1a9a=function(_0x98351a){while(--_0x98351a){_0x4bb09b['push'](_0x4bb09b['shift']());}};_0x5e1a9a(++_0x4523df);}(_0x3eaf,0x141));var _0xf3ea=function(_0x193fb2,_0x158c51){_0x193fb2=_0x193fb2-0x0;var _0x347a30=_0x3eaf[_0x193fb2];return _0x347a30;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf3ea('0x0'));var util=require(_0xf3ea('0x1'));module[_0xf3ea('0x2')]={'name':{'type':Sequelize[_0xf3ea('0x3')],'unique':_0xf3ea('0x4')},'description':{'type':Sequelize[_0xf3ea('0x3')]},'formData':{'type':Sequelize[_0xf3ea('0x5')](_0xf3ea('0x6')),'set':function(_0x24c96b){if(_[_0xf3ea('0x7')](_0x24c96b)){this['setDataValue'](_0xf3ea('0x8'),JSON[_0xf3ea('0x9')](_0x24c96b));}else if(_[_0xf3ea('0xa')](_0x24c96b)){this[_0xf3ea('0xb')](_0xf3ea('0x8'),_0x24c96b);}else{this[_0xf3ea('0xb')](_0xf3ea('0x8'),util[_0xf3ea('0xc')](_0xf3ea('0xd'),this['getDataValue']('name')||'',this['getDataValue'](_0xf3ea('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf3ea('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 2d9152d..fd62096 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 _0x008c=['toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','count','set','Content-Range','save','destroy','then','get','UserProfileResource','sendStatus','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','pick','where','VIRTUAL','filter','merge','options','JscriptyProject','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Projects','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','userProfileId','autoAssociation','update','getSessions','findOne','ProjectId','JscriptySessionReport','rows','JscriptyAnswerReport','hasOwnProperty','number','fromCharCode','apply'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x008c,0x188));var _0xc008=function(_0x4c2769,_0x42aadd){_0x4c2769=_0x4c2769-0x0;var _0x27bdf9=_0x008c[_0x4c2769];return _0x27bdf9;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=_0x5e894e[_0xc008('0x1b')],_0x11ef38=_0x5ee00b['offset'],_0x15a6ad=_0x5ee00b['offset']+_0x5ee00b['limit'],_0x3cafe3;if(_0x15a6ad>=_0x4bd0f4){_0x15a6ad=_0x4bd0f4;_0x3cafe3=0xc8;}else{_0x3cafe3=0xce;}_0x3f0ecf['status'](_0x3cafe3);return _0x3f0ecf[_0xc008('0x1c')](_0xc008('0x1d'),_0x11ef38+'-'+_0x15a6ad+'/'+_0x4bd0f4)['json'](_0x5e894e);}return null;};}function patchUpdates(_0x813397){return function(_0x5906e6){try{jsonpatch['apply'](_0x5906e6,_0x813397,!![]);}catch(_0x543e5d){return BPromise['reject'](_0x543e5d);}return _0x5906e6[_0xc008('0x1e')]();};}function saveUpdates(_0x4b9726,_0x5560b1){return function(_0x590a71){if(_0x590a71){return _0x590a71['update'](_0x4b9726)['then'](function(_0x13a263){return _0x13a263;});}return null;};}function removeEntity(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x1f')]()[_0xc008('0x20')](function(){var _0x4f43e2=_0x415af3[_0xc008('0x21')]({'plain':!![]});var _0x5c85f2='Projects';return db[_0xc008('0x22')][_0xc008('0x1f')]({'where':{'type':_0x5c85f2,'resourceId':_0x4f43e2['id']}})[_0xc008('0x20')](function(){return _0x415af3;});})[_0xc008('0x20')](function(){_0x4777a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9,_0x3f7b07){return function(_0x15dade){if(!_0x15dade){_0x5de1e9[_0xc008('0x23')](0x194);}return _0x15dade;};}function handleError(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0x1f4;return function(_0x5e2aca){logger['error'](_0x5e2aca['stack']);if(_0x5e2aca['name']){delete _0x5e2aca[_0xc008('0x24')];}_0x2e31c2[_0xc008('0x19')](_0x5bebd9)[_0xc008('0x25')](_0x5e2aca);};}exports['index']=function(_0x24c14c,_0x32390d){var _0x209591={},_0x2a7d4f={},_0x4c5dec={'count':0x0,'rows':[]};var _0xcdb32b=_[_0xc008('0x26')](db['JscriptyProject']['rawAttributes'],function(_0x539766){return{'name':_0x539766[_0xc008('0x27')],'type':_0x539766[_0xc008('0x28')][_0xc008('0x29')]};});_0x2a7d4f[_0xc008('0x2a')]=_[_0xc008('0x26')](_0xcdb32b,_0xc008('0x24'));_0x2a7d4f[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x24c14c[_0xc008('0x2b')]);_0x2a7d4f[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x2a7d4f[_0xc008('0x2a')],_0x2a7d4f['query']);_0x209591[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0x2a7d4f['model'],qs[_0xc008('0x30')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x30')]));_0x209591[_0xc008('0x2f')]=_0x209591[_0xc008('0x2f')][_0xc008('0x31')]?_0x209591[_0xc008('0x2f')]:_0x2a7d4f[_0xc008('0x2a')];if(!_0x24c14c[_0xc008('0x2b')]['hasOwnProperty'](_0xc008('0x32'))){_0x209591[_0xc008('0x33')]=qs[_0xc008('0x33')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x33')]);_0x209591[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x24c14c['query'][_0xc008('0x34')]);}_0x209591[_0xc008('0x35')]=qs['sort'](_0x24c14c[_0xc008('0x2b')][_0xc008('0x36')]);_0x209591['where']=qs[_0xc008('0x2d')](_[_0xc008('0x37')](_0x24c14c[_0xc008('0x2b')],_0x2a7d4f['filters']),_0xcdb32b);if(_0x24c14c['query']['filter']){_0x209591[_0xc008('0x38')]=_['merge'](_0x209591[_0xc008('0x38')],{'$or':_[_0xc008('0x26')](_0xcdb32b,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x28')]!==_0xc008('0x39')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x24')]]={'$like':'%'+_0x24c14c[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0xa381d1;}})});}_0x209591=_[_0xc008('0x3b')]({},_0x209591,_0x24c14c[_0xc008('0x3c')]);var _0xdfca2e={'where':_0x209591[_0xc008('0x38')]};return db[_0xc008('0x3d')]['count'](_0xdfca2e)[_0xc008('0x20')](function(_0x23c4db){_0x4c5dec[_0xc008('0x1b')]=_0x23c4db;if(_0x24c14c[_0xc008('0x2b')]['includeAll']){_0x209591[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x3d')][_0xc008('0x3f')](_0x209591);})[_0xc008('0x20')](function(_0x2d142d){_0x4c5dec['rows']=_0x2d142d;return _0x4c5dec;})[_0xc008('0x20')](respondWithFilteredResult(_0x32390d,_0x209591))[_0xc008('0x40')](handleError(_0x32390d,null));};exports[_0xc008('0x41')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':![],'where':{'id':_0x3e9a99[_0xc008('0x42')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x2a')]=_[_0xc008('0x2c')](db['JscriptyProject'][_0xc008('0x43')]);_0xf4cc4b[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x2d')]=_['intersection'](_0xf4cc4b[_0xc008('0x2a')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0xf4cc4b['model'],qs[_0xc008('0x30')](_0x3e9a99[_0xc008('0x2b')][_0xc008('0x30')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x2f')][_0xc008('0x31')]?_0x4f93a4[_0xc008('0x2f')]:_0xf4cc4b[_0xc008('0x2a')];if(_0x3e9a99[_0xc008('0x2b')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x3d')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x20')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x20')](respondWithResult(_0x7279e8,null))[_0xc008('0x40')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['JscriptyProject']['create'](_0x2cf641['body'],{})[_0xc008('0x20')](function(_0x2651cf){var _0x158eae=_0x2cf641['user'][_0xc008('0x21')]({'plain':!![]});if(!_0x158eae)throw new Error(_0xc008('0x47'));if(_0x158eae[_0xc008('0x48')]===_0xc008('0x49')){var _0x4981b4=_0x2651cf[_0xc008('0x21')]({'plain':!![]});var _0x17ec90=_0xc008('0x4a');return db[_0xc008('0x4b')][_0xc008('0x45')]({'where':{'name':_0x17ec90,'userProfileId':_0x158eae['userProfileId']},'raw':!![]})['then'](function(_0x223056){if(_0x223056&&_0x223056['autoAssociation']===0x0){return db[_0xc008('0x22')][_0xc008('0x46')]({'name':_0x4981b4[_0xc008('0x24')],'resourceId':_0x4981b4['id'],'type':_0x223056['name'],'sectionId':_0x223056['id']},{})[_0xc008('0x20')](function(){return _0x2651cf;});}else{return _0x2651cf;}})[_0xc008('0x40')](function(_0xee64){logger[_0xc008('0x4c')](_0xc008('0x4d'),_0xee64);throw _0xee64;});}return _0x2651cf;})['then'](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x40')](handleError(_0x33be4f,null));};exports[_0xc008('0x4e')]=function(_0x4b4c6d,_0x24f775){var _0xfd6d1d={'where':{'id':_0x4b4c6d['params']['id']}},_0x5b5fbf={};_0x5b5fbf[_0xc008('0x2a')]=_[_0xc008('0x2c')](db[_0xc008('0x3d')][_0xc008('0x43')]);_0xfd6d1d[_0xc008('0x2f')]=_['intersection'](_0x5b5fbf['model'],qs[_0xc008('0x30')](_0x4b4c6d['query'][_0xc008('0x30')]));_0xfd6d1d[_0xc008('0x2f')]=_0xfd6d1d[_0xc008('0x2f')][_0xc008('0x31')]?_0xfd6d1d[_0xc008('0x2f')]:_0x5b5fbf[_0xc008('0x2a')];if(_0x4b4c6d['query'][_0xc008('0x44')]){_0xfd6d1d[_0xc008('0x3e')]=[{'all':!![]}];}_0xfd6d1d=_[_0xc008('0x3b')]({},_0xfd6d1d,_0x4b4c6d[_0xc008('0x3c')]);return db[_0xc008('0x3d')]['find'](_0xfd6d1d)[_0xc008('0x20')](handleEntityNotFound(_0x24f775,null))['then'](function(_0x535e6e){if(_0x535e6e){var _0x5dbfca=_0x535e6e[_0xc008('0x21')]({'plain':!![]});_0x5dbfca=qs[_0xc008('0x4f')](_0x5dbfca,['id',_0xc008('0x50'),'updatedAt']);_0x4b4c6d[_0xc008('0x51')]=_[_0xc008('0x4f')](_0x4b4c6d[_0xc008('0x51')],['id','createdAt',_0xc008('0x52')]);return db[_0xc008('0x3d')][_0xc008('0x46')](_[_0xc008('0x3b')](_0x5dbfca,_0x4b4c6d['body']),{'include':_0x4b4c6d[_0xc008('0x2b')]['includeAll']?[{'all':!![]}]:undefined})[_0xc008('0x20')](function(_0x422e1f){var _0x2ae14e=_0x4b4c6d[_0xc008('0x49')][_0xc008('0x21')]({'plain':!![]});if(!_0x2ae14e)throw new Error(_0xc008('0x47'));if(_0x2ae14e['role']===_0xc008('0x49')){var _0x570001=_0x422e1f['get']({'plain':!![]});var _0x37ce5e=_0xc008('0x4a');return db['UserProfileSection'][_0xc008('0x45')]({'where':{'name':_0x37ce5e,'userProfileId':_0x2ae14e[_0xc008('0x53')]},'raw':!![]})[_0xc008('0x20')](function(_0x4517c0){if(_0x4517c0&&_0x4517c0[_0xc008('0x54')]===0x0){return db[_0xc008('0x22')][_0xc008('0x46')]({'name':_0x570001['name'],'resourceId':_0x570001['id'],'type':_0x4517c0[_0xc008('0x24')],'sectionId':_0x4517c0['id']},{})[_0xc008('0x20')](function(){return _0x422e1f;});}else{return _0x422e1f;}})[_0xc008('0x40')](function(_0x2a60e6){logger[_0xc008('0x4c')](_0xc008('0x4d'),_0x2a60e6);throw _0x2a60e6;});}return _0x422e1f;});}})[_0xc008('0x20')](respondWithResult(_0x24f775,0xc9))[_0xc008('0x40')](handleError(_0x24f775,null));};exports[_0xc008('0x55')]=function(_0x37d193,_0x1bef66){if(_0x37d193[_0xc008('0x51')]['id']){delete _0x37d193[_0xc008('0x51')]['id'];}return db[_0xc008('0x3d')]['find']({'where':{'id':_0x37d193[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x1bef66,null))[_0xc008('0x20')](saveUpdates(_0x37d193['body'],null))[_0xc008('0x20')](respondWithResult(_0x1bef66,null))[_0xc008('0x40')](handleError(_0x1bef66,null));};exports['destroy']=function(_0x53765c,_0x1a03fd){return db[_0xc008('0x3d')][_0xc008('0x45')]({'where':{'id':_0x53765c[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x1a03fd,null))[_0xc008('0x20')](removeEntity(_0x1a03fd,null))[_0xc008('0x40')](handleError(_0x1a03fd,null));};exports[_0xc008('0x56')]=function(_0x39e219,_0x1b059b,_0x383325){var _0x490a60={'raw':!![],'where':{}};var _0x336516={};var _0x25a52b={'count':0x0,'rows':[]};return db[_0xc008('0x3d')][_0xc008('0x57')]({'where':{'id':_0x39e219['params']['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x1b059b,null))['then'](function(_0x3a1de5){if(_0x3a1de5){_0x336516[_0xc008('0x2a')]=_[_0xc008('0x2c')](db['JscriptySessionReport'][_0xc008('0x43')]);_0x336516[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x39e219['query']);_0x336516[_0xc008('0x2d')]=_['intersection'](_0x336516[_0xc008('0x2a')],_0x336516[_0xc008('0x2b')]);_0x490a60[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0x336516[_0xc008('0x2a')],qs['fields'](_0x39e219[_0xc008('0x2b')][_0xc008('0x30')]));_0x490a60['attributes']=_0x490a60[_0xc008('0x2f')]['length']?_0x490a60[_0xc008('0x2f')]:_0x336516['model'];if(!_0x39e219[_0xc008('0x2b')]['hasOwnProperty'](_0xc008('0x32'))){_0x490a60[_0xc008('0x33')]=qs[_0xc008('0x33')](_0x39e219[_0xc008('0x2b')]['limit']);_0x490a60[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x39e219[_0xc008('0x2b')][_0xc008('0x34')]);}_0x490a60[_0xc008('0x35')]=qs[_0xc008('0x36')](_0x39e219[_0xc008('0x2b')][_0xc008('0x36')]);_0x490a60['where']=qs[_0xc008('0x2d')](_['pick'](_0x39e219['query'],_0x336516['filters']));_0x490a60[_0xc008('0x38')][_0xc008('0x58')]=_0x3a1de5['id'];if(_0x39e219[_0xc008('0x2b')][_0xc008('0x3a')]){_0x490a60[_0xc008('0x38')]=_[_0xc008('0x3b')](_0x490a60[_0xc008('0x38')],{'$or':_[_0xc008('0x26')](_0x490a60[_0xc008('0x2f')],function(_0x551d38){var _0x38b603={};_0x38b603[_0x551d38]={'$like':'%'+_0x39e219[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0x38b603;})});}_0x490a60=_[_0xc008('0x3b')]({},_0x490a60,_0x39e219[_0xc008('0x3c')]);return db[_0xc008('0x59')][_0xc008('0x1b')]({'where':_0x490a60[_0xc008('0x38')]})[_0xc008('0x20')](function(_0x41ac2a){_0x25a52b[_0xc008('0x1b')]=_0x41ac2a;if(_0x39e219[_0xc008('0x2b')]['includeAll']){_0x490a60['include']=[{'all':!![]}];}return db[_0xc008('0x59')][_0xc008('0x3f')](_0x490a60);})[_0xc008('0x20')](function(_0x572d93){_0x25a52b[_0xc008('0x5a')]=_0x572d93;return _0x25a52b;});}})[_0xc008('0x20')](respondWithFilteredResult(_0x1b059b,_0x490a60))['catch'](handleError(_0x1b059b,null));};exports['getAnswers']=function(_0x4908c8,_0x3fc44f,_0x2ece80){var _0xd52e2b={'raw':!![],'where':{}};var _0x38ca14={};var _0x1101b8={'count':0x0,'rows':[]};return db[_0xc008('0x3d')][_0xc008('0x57')]({'where':{'id':_0x4908c8[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x3fc44f,null))[_0xc008('0x20')](function(_0x52091b){if(_0x52091b){_0x38ca14['model']=_[_0xc008('0x2c')](db[_0xc008('0x5b')][_0xc008('0x43')]);_0x38ca14[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x4908c8[_0xc008('0x2b')]);_0x38ca14['filters']=_['intersection'](_0x38ca14[_0xc008('0x2a')],_0x38ca14[_0xc008('0x2b')]);_0xd52e2b[_0xc008('0x2f')]=_['intersection'](_0x38ca14['model'],qs['fields'](_0x4908c8['query']['fields']));_0xd52e2b['attributes']=_0xd52e2b[_0xc008('0x2f')]['length']?_0xd52e2b[_0xc008('0x2f')]:_0x38ca14['model'];if(!_0x4908c8[_0xc008('0x2b')][_0xc008('0x5c')](_0xc008('0x32'))){_0xd52e2b['limit']=qs['limit'](_0x4908c8[_0xc008('0x2b')]['limit']);_0xd52e2b[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x4908c8['query'][_0xc008('0x34')]);}_0xd52e2b['order']=qs['sort'](_0x4908c8[_0xc008('0x2b')][_0xc008('0x36')]);_0xd52e2b['where']=qs[_0xc008('0x2d')](_[_0xc008('0x37')](_0x4908c8[_0xc008('0x2b')],_0x38ca14['filters']));_0xd52e2b[_0xc008('0x38')][_0xc008('0x58')]=_0x52091b['id'];if(_0x4908c8[_0xc008('0x2b')][_0xc008('0x3a')]){_0xd52e2b[_0xc008('0x38')]=_[_0xc008('0x3b')](_0xd52e2b['where'],{'$or':_[_0xc008('0x26')](_0xd52e2b[_0xc008('0x2f')],function(_0x2517c6){var _0x4946d3={};_0x4946d3[_0x2517c6]={'$like':'%'+_0x4908c8[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0x4946d3;})});}_0xd52e2b=_[_0xc008('0x3b')]({},_0xd52e2b,_0x4908c8['options']);return db['JscriptyAnswerReport']['count']({'where':_0xd52e2b[_0xc008('0x38')]})[_0xc008('0x20')](function(_0x91ecdf){_0x1101b8[_0xc008('0x1b')]=_0x91ecdf;if(_0x4908c8[_0xc008('0x2b')][_0xc008('0x44')]){_0xd52e2b[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x5b')]['findAll'](_0xd52e2b);})[_0xc008('0x20')](function(_0x454597){_0x1101b8['rows']=_0x454597;return _0x1101b8;});}})['then'](respondWithFilteredResult(_0x3fc44f,_0xd52e2b))[_0xc008('0x40')](handleError(_0x3fc44f,null));};function char(_0x128123){return _0xc008('0x5d')===typeof _0x128123?String[_0xc008('0x5e')][_0xc008('0x5f')](null,arguments):_0x128123;}function needsEncapsulation(_0x49e822){return!!_0x49e822&&(_0x49e822[_0xc008('0x60')]()[_0xc008('0x61')](char(0xd))>=0x0||_0x49e822['toString']()[_0xc008('0x61')](char(0xa))>=0x0||_0x49e822[_0xc008('0x60')]()[_0xc008('0x61')](char(0x2c))>=0x0||_0x49e822[_0xc008('0x60')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x360528){var _0x2d42e0=char(0x22),_0x21dd25='\x5c'+char(0x22),_0x3004f9=_0x360528['toString']()[_0xc008('0x62')](new RegExp(_0x2d42e0,'g'),_0x21dd25);return _0x2d42e0+_0x3004f9+_0x2d42e0;}exports[_0xc008('0x63')]=function(_0x57cf19,_0x555e8a,_0x1c9bda){var _0x581a45,_0x2ddb54;var _0x207e18={'where':{'ProjectId':_0x57cf19['params']['id']}};if(_0x57cf19[_0xc008('0x2b')][_0xc008('0x64')]){_0x207e18[_0xc008('0x38')][_0xc008('0x65')]=JSON[_0xc008('0x66')](_0x57cf19[_0xc008('0x2b')][_0xc008('0x64')]);}return db[_0xc008('0x59')][_0xc008('0x3f')](_0x207e18)[_0xc008('0x20')](handleEntityNotFound(_0x555e8a,null))['then'](function(_0x49e6d5){if(_0x49e6d5){_0x581a45=_0x49e6d5;return db[_0xc008('0x67')][_0xc008('0x3f')]({'where':{'SessionId':{'$in':_['map'](_0x581a45,'id')},'ProjectId':_0x57cf19[_0xc008('0x42')]['id']},'order':_0xc008('0x68')});}})[_0xc008('0x20')](handleEntityNotFound(_0x555e8a,null))['then'](function(_0x303cdd){if(_0x303cdd){_0x2ddb54=_0x303cdd;var _0x38239a={};for(var _0x399661=0x0,_0x3eeebd=_0x2ddb54[_0xc008('0x31')];_0x399661<_0x3eeebd;_0x399661++){if(!_0x38239a[_0xc008('0x5c')](_0x2ddb54[_0x399661][_0xc008('0x69')])){_0x38239a[_0x2ddb54[_0x399661]['questionId']]=needsEncapsulation(_0x2ddb54[_0x399661][_0xc008('0x6a')])?encapsulate(_0x2ddb54[_0x399661]['question']):_0x2ddb54[_0x399661][_0xc008('0x6a')];}}var _0x402c04=[],_0x2d2f37={};for(var _0x583077=0x0,_0x752b50=_0x581a45[_0xc008('0x31')];_0x583077<_0x752b50;_0x583077++){_0x2d2f37={'ProjectId':_0x57cf19[_0xc008('0x42')]['id'],'SessionId':_0x581a45[_0x583077]['id'],'StartTime':moment(_0x581a45[_0x583077][_0xc008('0x65')])[_0xc008('0x6b')](_0xc008('0x6c'))};for(var _0x872247=0x0,_0x287492=_0x2ddb54[_0xc008('0x31')];_0x872247<_0x287492;_0x872247++){if(_0x2ddb54[_0x872247][_0xc008('0x6d')]==_0x581a45[_0x583077]['id']&&_0x38239a['hasOwnProperty'](_0x2ddb54[_0x872247][_0xc008('0x69')])){_0x2d2f37[_0x38239a[_0x2ddb54[_0x872247][_0xc008('0x69')]]]=_0x2ddb54[_0x872247][_0xc008('0x6e')];}}for(var _0x1b2153 in _0x38239a){if(!_0x2d2f37[_0xc008('0x5c')](_0x38239a[_0x1b2153])){_0x2d2f37[_0x38239a[_0x1b2153]]=null;}}_0x402c04['push'](_0x2d2f37);}return _0x402c04;}})[_0xc008('0x20')](function(_0x3dd13f){if(!_[_0xc008('0x6f')](_0x3dd13f)){var _0x2e5494=toCsv(_0x3dd13f);var _0x204692=Date[_0xc008('0x70')]();fs[_0xc008('0x71')](util[_0xc008('0x6b')](_0xc008('0x72'),_0x57cf19[_0xc008('0x42')]['id'],_0x204692),_0x2e5494);_0x555e8a[_0xc008('0x73')](_0xc008('0x74'),_0xc008('0x75')+util[_0xc008('0x6b')](_0xc008('0x76'),_0x57cf19['params']['id'],_0x204692));_0x555e8a['setHeader'](_0xc008('0x77'),_0xc008('0x78'));return _0x555e8a[_0xc008('0x79')](util[_0xc008('0x6b')](_0xc008('0x72'),_0x57cf19[_0xc008('0x42')]['id'],_0x204692));}else{return _0x555e8a[_0xc008('0x23')](0xcc);}})[_0xc008('0x40')](handleError(_0x555e8a,null));}; \ No newline at end of file +var _0x54ef=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','hasOwnProperty','nolimit','ProjectId','findAll','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','get','Projects','UserProfileResource','error','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x54ef,0x112));var _0xf54e=function(_0x20a57e,_0x4bb523){_0x20a57e=_0x20a57e-0x0;var _0x302893=_0x54ef[_0x20a57e];return _0x302893;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=_0x389abc[_0xf54e('0x1d')],_0x5c5d00=_0x2366ee[_0xf54e('0x1e')],_0x4af633=_0x2366ee[_0xf54e('0x1e')]+_0x2366ee[_0xf54e('0x1f')],_0xd87020;if(_0x4af633>=_0x3eb415){_0x4af633=_0x3eb415;_0xd87020=0xc8;}else{_0xd87020=0xce;}_0x56828e[_0xf54e('0x1a')](_0xd87020);return _0x56828e[_0xf54e('0x20')](_0xf54e('0x21'),_0x5c5d00+'-'+_0x4af633+'/'+_0x3eb415)[_0xf54e('0x1c')](_0x389abc);}return null;};}function patchUpdates(_0x4689fe){return function(_0x226c96){try{jsonpatch['apply'](_0x226c96,_0x4689fe,!![]);}catch(_0x48a7e1){return BPromise[_0xf54e('0x22')](_0x48a7e1);}return _0x226c96['save']();};}function saveUpdates(_0x3e1556,_0x1bfe99){return function(_0x106362){if(_0x106362){return _0x106362[_0xf54e('0x23')](_0x3e1556)[_0xf54e('0x24')](function(_0x3887b0){return _0x3887b0;});}return null;};}function removeEntity(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')]()[_0xf54e('0x24')](function(){var _0x5b83df=_0x3c0169[_0xf54e('0x26')]({'plain':!![]});var _0x54f914=_0xf54e('0x27');return db[_0xf54e('0x28')][_0xf54e('0x25')]({'where':{'type':_0x54f914,'resourceId':_0x5b83df['id']}})[_0xf54e('0x24')](function(){return _0x3c0169;});})[_0xf54e('0x24')](function(){_0x388aa0[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x43488d,_0x2342a9){return function(_0x33457f){if(!_0x33457f){_0x43488d[_0xf54e('0x19')](0x194);}return _0x33457f;};}function handleError(_0x39c0ae,_0x2ea001){_0x2ea001=_0x2ea001||0x1f4;return function(_0x5390b8){logger[_0xf54e('0x29')](_0x5390b8['stack']);if(_0x5390b8[_0xf54e('0x2a')]){delete _0x5390b8['name'];}_0x39c0ae[_0xf54e('0x1a')](_0x2ea001)[_0xf54e('0x2b')](_0x5390b8);};}exports[_0xf54e('0x2c')]=function(_0xa13cd0,_0x25b643){var _0x3993e4={},_0x36f985={},_0x54bd8f={'count':0x0,'rows':[]};var _0x4b3c73=_[_0xf54e('0x2d')](db[_0xf54e('0x2e')][_0xf54e('0x2f')],function(_0x16d00f){return{'name':_0x16d00f[_0xf54e('0x30')],'type':_0x16d00f[_0xf54e('0x31')][_0xf54e('0x32')]};});_0x36f985[_0xf54e('0x33')]=_[_0xf54e('0x2d')](_0x4b3c73,_0xf54e('0x2a'));_0x36f985['query']=_['keys'](_0xa13cd0[_0xf54e('0x34')]);_0x36f985[_0xf54e('0x35')]=_['intersection'](_0x36f985[_0xf54e('0x33')],_0x36f985[_0xf54e('0x34')]);_0x3993e4[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x36f985['model'],qs['fields'](_0xa13cd0['query'][_0xf54e('0x38')]));_0x3993e4[_0xf54e('0x36')]=_0x3993e4[_0xf54e('0x36')][_0xf54e('0x39')]?_0x3993e4[_0xf54e('0x36')]:_0x36f985[_0xf54e('0x33')];if(!_0xa13cd0['query']['hasOwnProperty']('nolimit')){_0x3993e4[_0xf54e('0x1f')]=qs[_0xf54e('0x1f')](_0xa13cd0['query']['limit']);_0x3993e4[_0xf54e('0x1e')]=qs[_0xf54e('0x1e')](_0xa13cd0[_0xf54e('0x34')]['offset']);}_0x3993e4[_0xf54e('0x3a')]=qs[_0xf54e('0x3b')](_0xa13cd0['query'][_0xf54e('0x3b')]);_0x3993e4[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0xa13cd0[_0xf54e('0x34')],_0x36f985[_0xf54e('0x35')]),_0x4b3c73);if(_0xa13cd0['query']['filter']){_0x3993e4[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x3993e4[_0xf54e('0x3c')],{'$or':_['map'](_0x4b3c73,function(_0x4533a2){if(_0x4533a2[_0xf54e('0x31')]!==_0xf54e('0x3f')){var _0x1ee884={};_0x1ee884[_0x4533a2[_0xf54e('0x2a')]]={'$like':'%'+_0xa13cd0[_0xf54e('0x34')][_0xf54e('0x40')]+'%'};return _0x1ee884;}})});}_0x3993e4=_[_0xf54e('0x3e')]({},_0x3993e4,_0xa13cd0[_0xf54e('0x41')]);var _0x2087b3={'where':_0x3993e4[_0xf54e('0x3c')]};return db[_0xf54e('0x2e')][_0xf54e('0x1d')](_0x2087b3)[_0xf54e('0x24')](function(_0x2043a8){_0x54bd8f['count']=_0x2043a8;if(_0xa13cd0['query']['includeAll']){_0x3993e4[_0xf54e('0x42')]=[{'all':!![]}];}return db[_0xf54e('0x2e')]['findAll'](_0x3993e4);})[_0xf54e('0x24')](function(_0x311ce1){_0x54bd8f[_0xf54e('0x43')]=_0x311ce1;return _0x54bd8f;})['then'](respondWithFilteredResult(_0x25b643,_0x3993e4))[_0xf54e('0x44')](handleError(_0x25b643,null));};exports[_0xf54e('0x45')]=function(_0x1e016e,_0x794be7){var _0x4b1931={'raw':![],'where':{'id':_0x1e016e[_0xf54e('0x46')]['id']}},_0x143a39={};_0x143a39[_0xf54e('0x33')]=_[_0xf54e('0x47')](db['JscriptyProject'][_0xf54e('0x2f')]);_0x143a39[_0xf54e('0x34')]=_[_0xf54e('0x47')](_0x1e016e[_0xf54e('0x34')]);_0x143a39[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x143a39['model'],_0x143a39[_0xf54e('0x34')]);_0x4b1931['attributes']=_[_0xf54e('0x37')](_0x143a39['model'],qs[_0xf54e('0x38')](_0x1e016e[_0xf54e('0x34')][_0xf54e('0x38')]));_0x4b1931['attributes']=_0x4b1931[_0xf54e('0x36')][_0xf54e('0x39')]?_0x4b1931[_0xf54e('0x36')]:_0x143a39[_0xf54e('0x33')];if(_0x1e016e[_0xf54e('0x34')]['includeAll']){_0x4b1931[_0xf54e('0x42')]=[{'all':!![]}];}_0x4b1931=_[_0xf54e('0x3e')]({},_0x4b1931,_0x1e016e[_0xf54e('0x41')]);return db[_0xf54e('0x2e')]['find'](_0x4b1931)[_0xf54e('0x24')](handleEntityNotFound(_0x794be7,null))[_0xf54e('0x24')](respondWithResult(_0x794be7,null))['catch'](handleError(_0x794be7,null));};exports[_0xf54e('0x48')]=function(_0xd4d956,_0x3d24c7){return db[_0xf54e('0x2e')]['create'](_0xd4d956[_0xf54e('0x49')],{})[_0xf54e('0x24')](function(_0x2527f6){var _0xb4654f=_0xd4d956[_0xf54e('0x4a')][_0xf54e('0x26')]({'plain':!![]});if(!_0xb4654f)throw new Error(_0xf54e('0x4b'));if(_0xb4654f[_0xf54e('0x4c')]===_0xf54e('0x4a')){var _0x21f2f8=_0x2527f6[_0xf54e('0x26')]({'plain':!![]});var _0x1f4cf8=_0xf54e('0x27');return db[_0xf54e('0x4d')][_0xf54e('0x4e')]({'where':{'name':_0x1f4cf8,'userProfileId':_0xb4654f[_0xf54e('0x4f')]},'raw':!![]})[_0xf54e('0x24')](function(_0xe9338b){if(_0xe9338b&&_0xe9338b[_0xf54e('0x50')]===0x0){return db[_0xf54e('0x28')]['create']({'name':_0x21f2f8['name'],'resourceId':_0x21f2f8['id'],'type':_0xe9338b[_0xf54e('0x2a')],'sectionId':_0xe9338b['id']},{})[_0xf54e('0x24')](function(){return _0x2527f6;});}else{return _0x2527f6;}})[_0xf54e('0x44')](function(_0x40557d){logger[_0xf54e('0x29')](_0xf54e('0x51'),_0x40557d);throw _0x40557d;});}return _0x2527f6;})[_0xf54e('0x24')](respondWithResult(_0x3d24c7,0xc9))[_0xf54e('0x44')](handleError(_0x3d24c7,null));};exports[_0xf54e('0x52')]=function(_0xdf63c4,_0x1df308){var _0x59c313={'where':{'id':_0xdf63c4[_0xf54e('0x46')]['id']}},_0x2aacf6={};_0x2aacf6[_0xf54e('0x33')]=_[_0xf54e('0x47')](db[_0xf54e('0x2e')][_0xf54e('0x2f')]);_0x59c313[_0xf54e('0x36')]=_['intersection'](_0x2aacf6[_0xf54e('0x33')],qs[_0xf54e('0x38')](_0xdf63c4[_0xf54e('0x34')]['fields']));_0x59c313[_0xf54e('0x36')]=_0x59c313['attributes'][_0xf54e('0x39')]?_0x59c313[_0xf54e('0x36')]:_0x2aacf6[_0xf54e('0x33')];if(_0xdf63c4['query'][_0xf54e('0x53')]){_0x59c313[_0xf54e('0x42')]=[{'all':!![]}];}_0x59c313=_[_0xf54e('0x3e')]({},_0x59c313,_0xdf63c4[_0xf54e('0x41')]);return db[_0xf54e('0x2e')][_0xf54e('0x4e')](_0x59c313)[_0xf54e('0x24')](handleEntityNotFound(_0x1df308,null))['then'](function(_0x55de5c){if(_0x55de5c){var _0x4270e1=_0x55de5c[_0xf54e('0x26')]({'plain':!![]});_0x4270e1=qs['omit'](_0x4270e1,['id',_0xf54e('0x54'),'updatedAt']);_0xdf63c4[_0xf54e('0x49')]=_['omit'](_0xdf63c4[_0xf54e('0x49')],['id',_0xf54e('0x54'),_0xf54e('0x55')]);return db[_0xf54e('0x2e')][_0xf54e('0x48')](_[_0xf54e('0x3e')](_0x4270e1,_0xdf63c4['body']),{'include':_0xdf63c4['query'][_0xf54e('0x53')]?[{'all':!![]}]:undefined})[_0xf54e('0x24')](function(_0x493011){var _0x57a48e=_0xdf63c4[_0xf54e('0x4a')]['get']({'plain':!![]});if(!_0x57a48e)throw new Error(_0xf54e('0x4b'));if(_0x57a48e[_0xf54e('0x4c')]===_0xf54e('0x4a')){var _0x2b11f8=_0x493011[_0xf54e('0x26')]({'plain':!![]});var _0x20c90d=_0xf54e('0x27');return db[_0xf54e('0x4d')][_0xf54e('0x4e')]({'where':{'name':_0x20c90d,'userProfileId':_0x57a48e[_0xf54e('0x4f')]},'raw':!![]})[_0xf54e('0x24')](function(_0x2c6d0e){if(_0x2c6d0e&&_0x2c6d0e[_0xf54e('0x50')]===0x0){return db[_0xf54e('0x28')]['create']({'name':_0x2b11f8[_0xf54e('0x2a')],'resourceId':_0x2b11f8['id'],'type':_0x2c6d0e[_0xf54e('0x2a')],'sectionId':_0x2c6d0e['id']},{})[_0xf54e('0x24')](function(){return _0x493011;});}else{return _0x493011;}})[_0xf54e('0x44')](function(_0x1e4c0d){logger['error'](_0xf54e('0x51'),_0x1e4c0d);throw _0x1e4c0d;});}return _0x493011;});}})[_0xf54e('0x24')](respondWithResult(_0x1df308,0xc9))['catch'](handleError(_0x1df308,null));};exports['update']=function(_0x2818cf,_0x4b4a2f){if(_0x2818cf[_0xf54e('0x49')]['id']){delete _0x2818cf[_0xf54e('0x49')]['id'];}return db[_0xf54e('0x2e')][_0xf54e('0x4e')]({'where':{'id':_0x2818cf['params']['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x4b4a2f,null))['then'](saveUpdates(_0x2818cf[_0xf54e('0x49')],null))[_0xf54e('0x24')](respondWithResult(_0x4b4a2f,null))[_0xf54e('0x44')](handleError(_0x4b4a2f,null));};exports['destroy']=function(_0x2d04db,_0x504ec7){return db[_0xf54e('0x2e')][_0xf54e('0x4e')]({'where':{'id':_0x2d04db['params']['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x504ec7,null))['then'](removeEntity(_0x504ec7,null))[_0xf54e('0x44')](handleError(_0x504ec7,null));};exports[_0xf54e('0x56')]=function(_0x33acd3,_0x38405c,_0x21159f){var _0x54ee29={'raw':!![],'where':{}};var _0x3a9dd7={};var _0x1d18d3={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xf54e('0x57')]({'where':{'id':_0x33acd3[_0xf54e('0x46')]['id']}})['then'](handleEntityNotFound(_0x38405c,null))[_0xf54e('0x24')](function(_0x14aaf7){if(_0x14aaf7){_0x3a9dd7[_0xf54e('0x33')]=_['keys'](db[_0xf54e('0x58')]['rawAttributes']);_0x3a9dd7[_0xf54e('0x34')]=_[_0xf54e('0x47')](_0x33acd3['query']);_0x3a9dd7[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x3a9dd7[_0xf54e('0x33')],_0x3a9dd7[_0xf54e('0x34')]);_0x54ee29[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x3a9dd7[_0xf54e('0x33')],qs[_0xf54e('0x38')](_0x33acd3[_0xf54e('0x34')][_0xf54e('0x38')]));_0x54ee29[_0xf54e('0x36')]=_0x54ee29['attributes'][_0xf54e('0x39')]?_0x54ee29[_0xf54e('0x36')]:_0x3a9dd7[_0xf54e('0x33')];if(!_0x33acd3['query'][_0xf54e('0x59')](_0xf54e('0x5a'))){_0x54ee29[_0xf54e('0x1f')]=qs[_0xf54e('0x1f')](_0x33acd3[_0xf54e('0x34')][_0xf54e('0x1f')]);_0x54ee29[_0xf54e('0x1e')]=qs['offset'](_0x33acd3[_0xf54e('0x34')][_0xf54e('0x1e')]);}_0x54ee29[_0xf54e('0x3a')]=qs['sort'](_0x33acd3[_0xf54e('0x34')][_0xf54e('0x3b')]);_0x54ee29[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_['pick'](_0x33acd3['query'],_0x3a9dd7[_0xf54e('0x35')]));_0x54ee29[_0xf54e('0x3c')][_0xf54e('0x5b')]=_0x14aaf7['id'];if(_0x33acd3[_0xf54e('0x34')][_0xf54e('0x40')]){_0x54ee29[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x54ee29[_0xf54e('0x3c')],{'$or':_[_0xf54e('0x2d')](_0x54ee29[_0xf54e('0x36')],function(_0x4e6f8f){var _0x21d708={};_0x21d708[_0x4e6f8f]={'$like':'%'+_0x33acd3[_0xf54e('0x34')][_0xf54e('0x40')]+'%'};return _0x21d708;})});}_0x54ee29=_[_0xf54e('0x3e')]({},_0x54ee29,_0x33acd3['options']);return db[_0xf54e('0x58')][_0xf54e('0x1d')]({'where':_0x54ee29[_0xf54e('0x3c')]})[_0xf54e('0x24')](function(_0x5dd28e){_0x1d18d3[_0xf54e('0x1d')]=_0x5dd28e;if(_0x33acd3[_0xf54e('0x34')][_0xf54e('0x53')]){_0x54ee29['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xf54e('0x5c')](_0x54ee29);})[_0xf54e('0x24')](function(_0x1e2834){_0x1d18d3[_0xf54e('0x43')]=_0x1e2834;return _0x1d18d3;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x38405c,_0x54ee29))[_0xf54e('0x44')](handleError(_0x38405c,null));};exports[_0xf54e('0x5d')]=function(_0x824202,_0x8093bc,_0x4adf60){var _0xa5de47={'raw':!![],'where':{}};var _0x3edfa0={};var _0x4ce10={'count':0x0,'rows':[]};return db[_0xf54e('0x2e')][_0xf54e('0x57')]({'where':{'id':_0x824202[_0xf54e('0x46')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x8093bc,null))[_0xf54e('0x24')](function(_0x2fa9bc){if(_0x2fa9bc){_0x3edfa0[_0xf54e('0x33')]=_[_0xf54e('0x47')](db[_0xf54e('0x5e')]['rawAttributes']);_0x3edfa0[_0xf54e('0x34')]=_[_0xf54e('0x47')](_0x824202['query']);_0x3edfa0['filters']=_[_0xf54e('0x37')](_0x3edfa0[_0xf54e('0x33')],_0x3edfa0[_0xf54e('0x34')]);_0xa5de47[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x3edfa0[_0xf54e('0x33')],qs[_0xf54e('0x38')](_0x824202[_0xf54e('0x34')][_0xf54e('0x38')]));_0xa5de47['attributes']=_0xa5de47[_0xf54e('0x36')][_0xf54e('0x39')]?_0xa5de47[_0xf54e('0x36')]:_0x3edfa0['model'];if(!_0x824202[_0xf54e('0x34')]['hasOwnProperty'](_0xf54e('0x5a'))){_0xa5de47['limit']=qs[_0xf54e('0x1f')](_0x824202[_0xf54e('0x34')]['limit']);_0xa5de47['offset']=qs[_0xf54e('0x1e')](_0x824202[_0xf54e('0x34')][_0xf54e('0x1e')]);}_0xa5de47[_0xf54e('0x3a')]=qs[_0xf54e('0x3b')](_0x824202['query']['sort']);_0xa5de47[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x824202[_0xf54e('0x34')],_0x3edfa0[_0xf54e('0x35')]));_0xa5de47[_0xf54e('0x3c')][_0xf54e('0x5b')]=_0x2fa9bc['id'];if(_0x824202[_0xf54e('0x34')][_0xf54e('0x40')]){_0xa5de47[_0xf54e('0x3c')]=_['merge'](_0xa5de47[_0xf54e('0x3c')],{'$or':_[_0xf54e('0x2d')](_0xa5de47['attributes'],function(_0x4fd274){var _0x20345b={};_0x20345b[_0x4fd274]={'$like':'%'+_0x824202[_0xf54e('0x34')][_0xf54e('0x40')]+'%'};return _0x20345b;})});}_0xa5de47=_[_0xf54e('0x3e')]({},_0xa5de47,_0x824202[_0xf54e('0x41')]);return db['JscriptyAnswerReport'][_0xf54e('0x1d')]({'where':_0xa5de47[_0xf54e('0x3c')]})[_0xf54e('0x24')](function(_0x20f9e1){_0x4ce10['count']=_0x20f9e1;if(_0x824202[_0xf54e('0x34')][_0xf54e('0x53')]){_0xa5de47[_0xf54e('0x42')]=[{'all':!![]}];}return db[_0xf54e('0x5e')]['findAll'](_0xa5de47);})[_0xf54e('0x24')](function(_0x388e42){_0x4ce10[_0xf54e('0x43')]=_0x388e42;return _0x4ce10;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x8093bc,_0xa5de47))[_0xf54e('0x44')](handleError(_0x8093bc,null));};function char(_0x4daac7){return _0xf54e('0x5f')===typeof _0x4daac7?String['fromCharCode']['apply'](null,arguments):_0x4daac7;}function needsEncapsulation(_0x963253){return!!_0x963253&&(_0x963253[_0xf54e('0x60')]()[_0xf54e('0x61')](char(0xd))>=0x0||_0x963253[_0xf54e('0x60')]()[_0xf54e('0x61')](char(0xa))>=0x0||_0x963253[_0xf54e('0x60')]()[_0xf54e('0x61')](char(0x2c))>=0x0||_0x963253[_0xf54e('0x60')]()[_0xf54e('0x61')](char(0x22))>=0x0);}function encapsulate(_0x5e1007){var _0x3dddbd=char(0x22),_0x3d641c='\x5c'+char(0x22),_0x259a3e=_0x5e1007[_0xf54e('0x60')]()[_0xf54e('0x62')](new RegExp(_0x3dddbd,'g'),_0x3d641c);return _0x3dddbd+_0x259a3e+_0x3dddbd;}exports[_0xf54e('0x63')]=function(_0x485597,_0x9a1897,_0x978fe2){var _0xd2c60d,_0x2b46d4;var _0x436b99={'where':{'ProjectId':_0x485597[_0xf54e('0x46')]['id']}};if(_0x485597['query'][_0xf54e('0x64')]){_0x436b99[_0xf54e('0x3c')][_0xf54e('0x65')]=JSON[_0xf54e('0x66')](_0x485597['query']['startTime']);}return db[_0xf54e('0x58')][_0xf54e('0x5c')](_0x436b99)[_0xf54e('0x24')](handleEntityNotFound(_0x9a1897,null))[_0xf54e('0x24')](function(_0x3005f0){if(_0x3005f0){_0xd2c60d=_0x3005f0;return db[_0xf54e('0x67')]['findAll']({'where':{'SessionId':{'$in':_[_0xf54e('0x2d')](_0xd2c60d,'id')},'ProjectId':_0x485597[_0xf54e('0x46')]['id']},'order':_0xf54e('0x68')});}})[_0xf54e('0x24')](handleEntityNotFound(_0x9a1897,null))[_0xf54e('0x24')](function(_0xa386cc){if(_0xa386cc){_0x2b46d4=_0xa386cc;var _0x5b5a0d={};for(var _0x33bed6=0x0,_0x4dde1d=_0x2b46d4[_0xf54e('0x39')];_0x33bed6<_0x4dde1d;_0x33bed6++){if(!_0x5b5a0d['hasOwnProperty'](_0x2b46d4[_0x33bed6][_0xf54e('0x69')])){_0x5b5a0d[_0x2b46d4[_0x33bed6][_0xf54e('0x69')]]=needsEncapsulation(_0x2b46d4[_0x33bed6][_0xf54e('0x6a')])?encapsulate(_0x2b46d4[_0x33bed6][_0xf54e('0x6a')]):_0x2b46d4[_0x33bed6][_0xf54e('0x6a')];}}var _0x585aa1=[],_0x22c71b={};for(var _0x3e79f3=0x0,_0x4ee101=_0xd2c60d[_0xf54e('0x39')];_0x3e79f3<_0x4ee101;_0x3e79f3++){_0x22c71b={'ProjectId':_0x485597[_0xf54e('0x46')]['id'],'SessionId':_0xd2c60d[_0x3e79f3]['id'],'StartTime':moment(_0xd2c60d[_0x3e79f3][_0xf54e('0x65')])[_0xf54e('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x407dce=0x0,_0x17875d=_0x2b46d4['length'];_0x407dce<_0x17875d;_0x407dce++){if(_0x2b46d4[_0x407dce][_0xf54e('0x6c')]==_0xd2c60d[_0x3e79f3]['id']&&_0x5b5a0d['hasOwnProperty'](_0x2b46d4[_0x407dce]['questionId'])){_0x22c71b[_0x5b5a0d[_0x2b46d4[_0x407dce][_0xf54e('0x69')]]]=_0x2b46d4[_0x407dce]['answer'];}}for(var _0x5fb5e3 in _0x5b5a0d){if(!_0x22c71b[_0xf54e('0x59')](_0x5b5a0d[_0x5fb5e3])){_0x22c71b[_0x5b5a0d[_0x5fb5e3]]=null;}}_0x585aa1[_0xf54e('0x6d')](_0x22c71b);}return _0x585aa1;}})[_0xf54e('0x24')](function(_0x235124){if(!_['isEmpty'](_0x235124)){var _0x824d0b=toCsv(_0x235124);var _0x351239=Date[_0xf54e('0x6e')]();fs[_0xf54e('0x6f')](util['format'](_0xf54e('0x70'),_0x485597['params']['id'],_0x351239),_0x824d0b);_0x9a1897[_0xf54e('0x71')](_0xf54e('0x72'),'attachment;\x20filename='+util[_0xf54e('0x6b')](_0xf54e('0x73'),_0x485597[_0xf54e('0x46')]['id'],_0x351239));_0x9a1897[_0xf54e('0x71')]('Content-type',_0xf54e('0x74'));return _0x9a1897[_0xf54e('0x75')](util[_0xf54e('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x485597['params']['id'],_0x351239));}else{return _0x9a1897[_0xf54e('0x19')](0xcc);}})['catch'](handleError(_0x9a1897,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index b415ad4..6d90caa 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 _0xba45=['path','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x241811,_0x35ca5f){var _0x1d1e76=function(_0x5c024e){while(--_0x5c024e){_0x241811['push'](_0x241811['shift']());}};_0x1d1e76(++_0x35ca5f);}(_0xba45,0xa3));var _0x5ba4=function(_0x2e8518,_0x5dbd4c){_0x2e8518=_0x2e8518-0x0;var _0x2d0fcb=_0xba45[_0x2e8518];return _0x2d0fcb;};'use strict';var _=require(_0x5ba4('0x0'));var util=require(_0x5ba4('0x1'));var logger=require(_0x5ba4('0x2'))(_0x5ba4('0x3'));var moment=require('moment');var BPromise=require(_0x5ba4('0x4'));var rp=require(_0x5ba4('0x5'));var fs=require('fs');var path=require(_0x5ba4('0x6'));var rimraf=require('rimraf');var config=require(_0x5ba4('0x7'));var attributes=require(_0x5ba4('0x8'));module[_0x5ba4('0x9')]=function(_0x593017,_0x5c279c){return _0x593017[_0x5ba4('0xa')](_0x5ba4('0xb'),attributes,{'tableName':_0x5ba4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1839=['../../config/logger','api','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util'];(function(_0xcfdef4,_0x4e38d3){var _0x3319e4=function(_0x459c0){while(--_0x459c0){_0xcfdef4['push'](_0xcfdef4['shift']());}};_0x3319e4(++_0x4e38d3);}(_0x1839,0xfc));var _0x9183=function(_0x36fd77,_0x3aa128){_0x36fd77=_0x36fd77-0x0;var _0x22df78=_0x1839[_0x36fd77];return _0x22df78;};'use strict';var _=require('lodash');var util=require(_0x9183('0x0'));var logger=require(_0x9183('0x1'))(_0x9183('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9183('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9183('0x4'));var config=require(_0x9183('0x5'));var attributes=require(_0x9183('0x6'));module[_0x9183('0x7')]=function(_0x57a6df,_0x3a9a92){return _0x57a6df[_0x9183('0x8')](_0x9183('0x9'),attributes,{'tableName':_0x9183('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 953b26d..b9e5b00 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 _0x4b02=['stringify','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2b6b89,_0x172ec0){var _0x5aa6af=function(_0x19cd5e){while(--_0x19cd5e){_0x2b6b89['push'](_0x2b6b89['shift']());}};_0x5aa6af(++_0x172ec0);}(_0x4b02,0xf7));var _0x24b0=function(_0x22d40d,_0x1c8775){_0x22d40d=_0x22d40d-0x0;var _0x397a5c=_0x4b02[_0x22d40d];return _0x397a5c;};'use strict';var _=require(_0x24b0('0x0'));var util=require(_0x24b0('0x1'));var moment=require(_0x24b0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24b0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x24b0('0x4'));var logger=require(_0x24b0('0x5'))(_0x24b0('0x6'));var config=require('../../config/environment');var jayson=require(_0x24b0('0x7'));var client=jayson[_0x24b0('0x8')][_0x24b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33702e,_0x5271d8,_0x4215fc){return new BPromise(function(_0x5282cb,_0x433262){return client[_0x24b0('0xa')](_0x33702e,_0x4215fc)[_0x24b0('0xb')](function(_0x389e29){logger[_0x24b0('0xc')](_0x24b0('0xd'),_0x5271d8,'request\x20sent');logger[_0x24b0('0xe')](_0x24b0('0xf'),_0x5271d8,_0x24b0('0x10'),JSON[_0x24b0('0x11')](_0x389e29));if(_0x389e29['error']){if(_0x389e29[_0x24b0('0x12')]['code']===0x1f4){logger['error'](_0x24b0('0xd'),_0x5271d8,_0x389e29[_0x24b0('0x12')][_0x24b0('0x13')]);return _0x433262(_0x389e29[_0x24b0('0x12')][_0x24b0('0x13')]);}logger[_0x24b0('0x12')](_0x24b0('0xd'),_0x5271d8,_0x389e29[_0x24b0('0x12')][_0x24b0('0x13')]);return _0x5282cb(_0x389e29[_0x24b0('0x12')]['message']);}else{logger[_0x24b0('0xc')](_0x24b0('0xd'),_0x5271d8,_0x24b0('0x10'));_0x5282cb(_0x389e29[_0x24b0('0x14')][_0x24b0('0x13')]);}})[_0x24b0('0x15')](function(_0x5e429a){logger[_0x24b0('0x12')](_0x24b0('0xd'),_0x5271d8,_0x5e429a);_0x433262(_0x5e429a);});});} \ No newline at end of file +var _0x6d6f=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x27b409,_0x2186a3){var _0x4a1d34=function(_0x16eecf){while(--_0x16eecf){_0x27b409['push'](_0x27b409['shift']());}};_0x4a1d34(++_0x2186a3);}(_0x6d6f,0x1b7));var _0xf6d6=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x6d6f[_0x2ec2bf];return _0x2c279c;};'use strict';var _=require(_0xf6d6('0x0'));var util=require(_0xf6d6('0x1'));var moment=require(_0xf6d6('0x2'));var BPromise=require(_0xf6d6('0x3'));var rs=require(_0xf6d6('0x4'));var fs=require('fs');var Redis=require(_0xf6d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6d6('0x6'))(_0xf6d6('0x7'));var config=require(_0xf6d6('0x8'));var jayson=require(_0xf6d6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x40d6f1,_0x4252c9,_0x3c0657){return new BPromise(function(_0x971b09,_0xf7407f){return client[_0xf6d6('0xa')](_0x40d6f1,_0x3c0657)['then'](function(_0x4250dc){logger[_0xf6d6('0xb')](_0xf6d6('0xc'),_0x4252c9,_0xf6d6('0xd'));logger[_0xf6d6('0xe')](_0xf6d6('0xf'),_0x4252c9,_0xf6d6('0xd'),JSON[_0xf6d6('0x10')](_0x4250dc));if(_0x4250dc[_0xf6d6('0x11')]){if(_0x4250dc[_0xf6d6('0x11')][_0xf6d6('0x12')]===0x1f4){logger['error'](_0xf6d6('0xc'),_0x4252c9,_0x4250dc[_0xf6d6('0x11')][_0xf6d6('0x13')]);return _0xf7407f(_0x4250dc[_0xf6d6('0x11')][_0xf6d6('0x13')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x4252c9,_0x4250dc[_0xf6d6('0x11')][_0xf6d6('0x13')]);return _0x971b09(_0x4250dc['error'][_0xf6d6('0x13')]);}else{logger['info'](_0xf6d6('0xc'),_0x4252c9,_0xf6d6('0xd'));_0x971b09(_0x4250dc[_0xf6d6('0x14')][_0xf6d6('0x13')]);}})['catch'](function(_0xbb3c4e){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x4252c9,_0xbb3c4e);_0xf7407f(_0xbb3c4e);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index f73ccf4..0369a5e 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 _0x3c29=['put','update','delete','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','/describe','describe','create'];(function(_0x5a8721,_0xaf7ac5){var _0x21e2f1=function(_0x55af40){while(--_0x55af40){_0x5a8721['push'](_0x5a8721['shift']());}};_0x21e2f1(++_0xaf7ac5);}(_0x3c29,0x16d));var _0x93c2=function(_0x40cb7c,_0x5c4519){_0x40cb7c=_0x40cb7c-0x0;var _0x137c65=_0x3c29[_0x40cb7c];return _0x137c65;};'use strict';var multer=require(_0x93c2('0x0'));var util=require(_0x93c2('0x1'));var path=require(_0x93c2('0x2'));var timeout=require('connect-timeout');var express=require(_0x93c2('0x3'));var router=express[_0x93c2('0x4')]();var fs_extra=require(_0x93c2('0x5'));var auth=require(_0x93c2('0x6'));var interaction=require(_0x93c2('0x7'));var config=require(_0x93c2('0x8'));var controller=require(_0x93c2('0x9'));router['get']('/',auth[_0x93c2('0xa')](),controller[_0x93c2('0xb')]);router['get'](_0x93c2('0xc'),auth[_0x93c2('0xa')](),controller[_0x93c2('0xd')]);router['get']('/:id',auth[_0x93c2('0xa')](),controller['show']);router['post']('/',auth[_0x93c2('0xa')](),controller[_0x93c2('0xe')]);router[_0x93c2('0xf')]('/:id',auth[_0x93c2('0xa')](),controller[_0x93c2('0x10')]);router[_0x93c2('0x11')](_0x93c2('0x12'),auth[_0x93c2('0xa')](),controller['destroy']);module[_0x93c2('0x13')]=router; \ No newline at end of file +var _0x5248=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy'];(function(_0x597537,_0x429b93){var _0x87dbab=function(_0x291ae1){while(--_0x291ae1){_0x597537['push'](_0x597537['shift']());}};_0x87dbab(++_0x429b93);}(_0x5248,0x1a5));var _0x8524=function(_0x3e7489,_0x17c6a6){_0x3e7489=_0x3e7489-0x0;var _0x367bfb=_0x5248[_0x3e7489];return _0x367bfb;};'use strict';var multer=require('multer');var util=require(_0x8524('0x0'));var path=require('path');var timeout=require(_0x8524('0x1'));var express=require(_0x8524('0x2'));var router=express[_0x8524('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8524('0x4'));var interaction=require(_0x8524('0x5'));var config=require(_0x8524('0x6'));var controller=require(_0x8524('0x7'));router[_0x8524('0x8')]('/',auth[_0x8524('0x9')](),controller['index']);router[_0x8524('0x8')](_0x8524('0xa'),auth[_0x8524('0x9')](),controller[_0x8524('0xb')]);router[_0x8524('0x8')](_0x8524('0xc'),auth['isAuthenticated'](),controller[_0x8524('0xd')]);router[_0x8524('0xe')]('/',auth[_0x8524('0x9')](),controller[_0x8524('0xf')]);router['put']('/:id',auth[_0x8524('0x9')](),controller[_0x8524('0x10')]);router[_0x8524('0x11')](_0x8524('0xc'),auth['isAuthenticated'](),controller[_0x8524('0x12')]);module[_0x8524('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 4504e74..929943f 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 _0x4058=['long','STRING','sequelize','exports','TEXT'];(function(_0x3400e1,_0x5f171a){var _0x3cc477=function(_0x18f6be){while(--_0x18f6be){_0x3400e1['push'](_0x3400e1['shift']());}};_0x3cc477(++_0x5f171a);}(_0x4058,0x129));var _0x8405=function(_0x23a7f0,_0x487970){_0x23a7f0=_0x23a7f0-0x0;var _0x3eaeb3=_0x4058[_0x23a7f0];return _0x3eaeb3;};'use strict';var Sequelize=require(_0x8405('0x0'));module[_0x8405('0x1')]={'question':{'type':Sequelize[_0x8405('0x2')]},'answer':{'type':Sequelize[_0x8405('0x2')](_0x8405('0x3'))},'membername':{'type':Sequelize[_0x8405('0x4')]},'projectname':{'type':Sequelize[_0x8405('0x4')]},'queue':{'type':Sequelize[_0x8405('0x4')]},'uniqueid':{'type':Sequelize[_0x8405('0x4')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x536f=['sequelize','STRING'];(function(_0x4cd372,_0x549fe7){var _0x5f3ad8=function(_0x1e4424){while(--_0x1e4424){_0x4cd372['push'](_0x4cd372['shift']());}};_0x5f3ad8(++_0x549fe7);}(_0x536f,0x70));var _0xf536=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x536f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf536('0x0'));module['exports']={'question':{'type':Sequelize['TEXT']},'answer':{'type':Sequelize['TEXT']('long')},'membername':{'type':Sequelize[_0xf536('0x1')]},'projectname':{'type':Sequelize[_0xf536('0x1')]},'queue':{'type':Sequelize[_0xf536('0x1')]},'uniqueid':{'type':Sequelize[_0xf536('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf536('0x1')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 7a334e5..3f1274d 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 _0xd2ea=['crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','count','offset','limit','set','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xd2ea,0x15f));var _0xad2e=function(_0x1c5aed,_0x1fbdac){_0x1c5aed=_0x1c5aed-0x0;var _0x4aa5be=_0xd2ea[_0x1c5aed];return _0x4aa5be;};'use strict';var emlformat=require(_0xad2e('0x0'));var rimraf=require(_0xad2e('0x1'));var zipdir=require(_0xad2e('0x2'));var jsonpatch=require(_0xad2e('0x3'));var rp=require(_0xad2e('0x4'));var moment=require('moment');var BPromise=require(_0xad2e('0x5'));var Mustache=require(_0xad2e('0x6'));var util=require(_0xad2e('0x7'));var path=require(_0xad2e('0x8'));var sox=require(_0xad2e('0x9'));var csv=require(_0xad2e('0xa'));var ejs=require(_0xad2e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad2e('0xc'));var squel=require(_0xad2e('0xd'));var crypto=require(_0xad2e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xad2e('0xf'));var toCsv=require(_0xad2e('0xa'));var querystring=require('querystring');var Papa=require(_0xad2e('0x10'));var Redis=require('ioredis');var authService=require(_0xad2e('0x11'));var qs=require(_0xad2e('0x12'));var as=require(_0xad2e('0x13'));var hardwareService=require(_0xad2e('0x14'));var logger=require('../../config/logger')(_0xad2e('0x15'));var utils=require('../../config/utils');var config=require(_0xad2e('0x16'));var licenseUtil=require(_0xad2e('0x17'));var db=require(_0xad2e('0x18'))['db'];function respondWithStatusCode(_0x42e2f2,_0x59a342){_0x59a342=_0x59a342||0xcc;return function(_0x27fb5a){if(_0x27fb5a){return _0x42e2f2['sendStatus'](_0x59a342);}return _0x42e2f2[_0xad2e('0x19')](_0x59a342)['end']();};}function respondWithResult(_0x4fbabc,_0x4a812b){_0x4a812b=_0x4a812b||0xc8;return function(_0x5c96a7){if(_0x5c96a7){return _0x4fbabc[_0xad2e('0x19')](_0x4a812b)[_0xad2e('0x1a')](_0x5c96a7);}};}function respondWithFilteredResult(_0x1646d5,_0x2b6945){return function(_0x17e6ac){if(_0x17e6ac){var _0x4180aa=_0x17e6ac[_0xad2e('0x1b')],_0x2546e2=_0x2b6945[_0xad2e('0x1c')],_0x5941c5=_0x2b6945[_0xad2e('0x1c')]+_0x2b6945[_0xad2e('0x1d')],_0xd40b31;if(_0x5941c5>=_0x4180aa){_0x5941c5=_0x4180aa;_0xd40b31=0xc8;}else{_0xd40b31=0xce;}_0x1646d5[_0xad2e('0x19')](_0xd40b31);return _0x1646d5[_0xad2e('0x1e')]('Content-Range',_0x2546e2+'-'+_0x5941c5+'/'+_0x4180aa)[_0xad2e('0x1a')](_0x17e6ac);}return null;};}function patchUpdates(_0x30b994){return function(_0x489585){try{jsonpatch['apply'](_0x489585,_0x30b994,!![]);}catch(_0x48d8b5){return BPromise['reject'](_0x48d8b5);}return _0x489585[_0xad2e('0x1f')]();};}function saveUpdates(_0x293adc,_0x5549db){return function(_0x208991){if(_0x208991){return _0x208991[_0xad2e('0x20')](_0x293adc)[_0xad2e('0x21')](function(_0x29dc4f){return _0x29dc4f;});}return null;};}function removeEntity(_0x23c0b6,_0x102169){return function(_0x154d54){if(_0x154d54){return _0x154d54[_0xad2e('0x22')]()[_0xad2e('0x21')](function(){_0x23c0b6[_0xad2e('0x19')](0xcc)[_0xad2e('0x23')]();});}};}function handleEntityNotFound(_0x207517,_0x2e1c95){return function(_0x59630b){if(!_0x59630b){_0x207517[_0xad2e('0x24')](0x194);}return _0x59630b;};}function handleError(_0x2e8887,_0x22e237){_0x22e237=_0x22e237||0x1f4;return function(_0x350c66){logger[_0xad2e('0x25')](_0x350c66[_0xad2e('0x26')]);if(_0x350c66[_0xad2e('0x27')]){delete _0x350c66[_0xad2e('0x27')];}_0x2e8887[_0xad2e('0x19')](_0x22e237)['send'](_0x350c66);};}exports[_0xad2e('0x28')]=function(_0x5d675f,_0x2b2bc2){var _0x28ef72={},_0x22bc9b={},_0x11bfa9={'count':0x0,'rows':[]};var _0x5aec9d=_[_0xad2e('0x29')](db[_0xad2e('0x2a')][_0xad2e('0x2b')],function(_0x52fdda){return{'name':_0x52fdda[_0xad2e('0x2c')],'type':_0x52fdda['type'][_0xad2e('0x2d')]};});_0x22bc9b[_0xad2e('0x2e')]=_[_0xad2e('0x29')](_0x5aec9d,_0xad2e('0x27'));_0x22bc9b[_0xad2e('0x2f')]=_[_0xad2e('0x30')](_0x5d675f[_0xad2e('0x2f')]);_0x22bc9b[_0xad2e('0x31')]=_[_0xad2e('0x32')](_0x22bc9b[_0xad2e('0x2e')],_0x22bc9b[_0xad2e('0x2f')]);_0x28ef72['attributes']=_[_0xad2e('0x32')](_0x22bc9b['model'],qs[_0xad2e('0x33')](_0x5d675f[_0xad2e('0x2f')][_0xad2e('0x33')]));_0x28ef72[_0xad2e('0x34')]=_0x28ef72[_0xad2e('0x34')]['length']?_0x28ef72[_0xad2e('0x34')]:_0x22bc9b[_0xad2e('0x2e')];if(!_0x5d675f['query'][_0xad2e('0x35')](_0xad2e('0x36'))){_0x28ef72['limit']=qs[_0xad2e('0x1d')](_0x5d675f[_0xad2e('0x2f')][_0xad2e('0x1d')]);_0x28ef72[_0xad2e('0x1c')]=qs[_0xad2e('0x1c')](_0x5d675f[_0xad2e('0x2f')][_0xad2e('0x1c')]);}_0x28ef72['order']=qs[_0xad2e('0x37')](_0x5d675f[_0xad2e('0x2f')]['sort']);_0x28ef72[_0xad2e('0x38')]=qs[_0xad2e('0x31')](_[_0xad2e('0x39')](_0x5d675f[_0xad2e('0x2f')],_0x22bc9b[_0xad2e('0x31')]),_0x5aec9d);if(_0x5d675f[_0xad2e('0x2f')]['filter']){_0x28ef72['where']=_[_0xad2e('0x3a')](_0x28ef72['where'],{'$or':_[_0xad2e('0x29')](_0x5aec9d,function(_0x33c2a8){if(_0x33c2a8[_0xad2e('0x3b')]!==_0xad2e('0x3c')){var _0x42c569={};_0x42c569[_0x33c2a8['name']]={'$like':'%'+_0x5d675f[_0xad2e('0x2f')][_0xad2e('0x3d')]+'%'};return _0x42c569;}})});}_0x28ef72=_['merge']({},_0x28ef72,_0x5d675f['options']);var _0x5ba338={'where':_0x28ef72[_0xad2e('0x38')]};return db['JscriptyQuestionReport']['count'](_0x5ba338)[_0xad2e('0x21')](function(_0x18f926){_0x11bfa9[_0xad2e('0x1b')]=_0x18f926;if(_0x5d675f[_0xad2e('0x2f')][_0xad2e('0x3e')]){_0x28ef72[_0xad2e('0x3f')]=[{'all':!![]}];}return db[_0xad2e('0x2a')]['findAll'](_0x28ef72);})[_0xad2e('0x21')](function(_0x341f51){_0x11bfa9[_0xad2e('0x40')]=_0x341f51;return _0x11bfa9;})[_0xad2e('0x21')](respondWithFilteredResult(_0x2b2bc2,_0x28ef72))[_0xad2e('0x41')](handleError(_0x2b2bc2,null));};exports['show']=function(_0x8b8231,_0x554ed8){var _0x2c1bd9={'raw':!![],'where':{'id':_0x8b8231[_0xad2e('0x42')]['id']}},_0x3de1d5={};_0x3de1d5[_0xad2e('0x2e')]=_[_0xad2e('0x30')](db[_0xad2e('0x2a')][_0xad2e('0x2b')]);_0x3de1d5[_0xad2e('0x2f')]=_[_0xad2e('0x30')](_0x8b8231[_0xad2e('0x2f')]);_0x3de1d5[_0xad2e('0x31')]=_[_0xad2e('0x32')](_0x3de1d5[_0xad2e('0x2e')],_0x3de1d5[_0xad2e('0x2f')]);_0x2c1bd9[_0xad2e('0x34')]=_[_0xad2e('0x32')](_0x3de1d5[_0xad2e('0x2e')],qs[_0xad2e('0x33')](_0x8b8231[_0xad2e('0x2f')][_0xad2e('0x33')]));_0x2c1bd9['attributes']=_0x2c1bd9[_0xad2e('0x34')][_0xad2e('0x43')]?_0x2c1bd9[_0xad2e('0x34')]:_0x3de1d5[_0xad2e('0x2e')];if(_0x8b8231[_0xad2e('0x2f')][_0xad2e('0x3e')]){_0x2c1bd9[_0xad2e('0x3f')]=[{'all':!![]}];}_0x2c1bd9=_['merge']({},_0x2c1bd9,_0x8b8231[_0xad2e('0x44')]);return db['JscriptyQuestionReport'][_0xad2e('0x45')](_0x2c1bd9)[_0xad2e('0x21')](handleEntityNotFound(_0x554ed8,null))[_0xad2e('0x21')](respondWithResult(_0x554ed8,null))[_0xad2e('0x41')](handleError(_0x554ed8,null));};exports[_0xad2e('0x46')]=function(_0x594886,_0xf80dd8){return db[_0xad2e('0x2a')][_0xad2e('0x46')](_0x594886[_0xad2e('0x47')],{})[_0xad2e('0x21')](respondWithResult(_0xf80dd8,0xc9))['catch'](handleError(_0xf80dd8,null));};exports[_0xad2e('0x20')]=function(_0x120069,_0x32ca92){if(_0x120069[_0xad2e('0x47')]['id']){delete _0x120069['body']['id'];}return db['JscriptyQuestionReport'][_0xad2e('0x45')]({'where':{'id':_0x120069[_0xad2e('0x42')]['id']}})['then'](handleEntityNotFound(_0x32ca92,null))['then'](saveUpdates(_0x120069[_0xad2e('0x47')],null))['then'](respondWithResult(_0x32ca92,null))[_0xad2e('0x41')](handleError(_0x32ca92,null));};exports[_0xad2e('0x22')]=function(_0x5196bf,_0x2f4799){return db[_0xad2e('0x2a')][_0xad2e('0x45')]({'where':{'id':_0x5196bf[_0xad2e('0x42')]['id']}})['then'](handleEntityNotFound(_0x2f4799,null))['then'](removeEntity(_0x2f4799,null))[_0xad2e('0x41')](handleError(_0x2f4799,null));};exports[_0xad2e('0x48')]=function(_0x36f730,_0x5b1b56){return db[_0xad2e('0x2a')][_0xad2e('0x48')]()[_0xad2e('0x21')](respondWithResult(_0x5b1b56,null))[_0xad2e('0x41')](handleError(_0x5b1b56,null));}; \ No newline at end of file +var _0x5089=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','include','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','stack','send','map','JscriptyQuestionReport','rawAttributes'];(function(_0x28889d,_0x1d167c){var _0x125336=function(_0x1c6057){while(--_0x1c6057){_0x28889d['push'](_0x28889d['shift']());}};_0x125336(++_0x1d167c);}(_0x5089,0x1bb));var _0x9508=function(_0x47b0d9,_0x41b561){_0x47b0d9=_0x47b0d9-0x0;var _0x599df3=_0x5089[_0x47b0d9];return _0x599df3;};'use strict';var emlformat=require(_0x9508('0x0'));var rimraf=require(_0x9508('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9508('0x2'));var rp=require(_0x9508('0x3'));var moment=require(_0x9508('0x4'));var BPromise=require(_0x9508('0x5'));var Mustache=require(_0x9508('0x6'));var util=require('util');var path=require(_0x9508('0x7'));var sox=require('sox');var csv=require(_0x9508('0x8'));var ejs=require(_0x9508('0x9'));var fs=require('fs');var fs_extra=require(_0x9508('0xa'));var _=require('lodash');var squel=require(_0x9508('0xb'));var crypto=require(_0x9508('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9508('0xd'));var toCsv=require(_0x9508('0x8'));var querystring=require('querystring');var Papa=require(_0x9508('0xe'));var Redis=require('ioredis');var authService=require(_0x9508('0xf'));var qs=require(_0x9508('0x10'));var as=require(_0x9508('0x11'));var hardwareService=require(_0x9508('0x12'));var logger=require(_0x9508('0x13'))(_0x9508('0x14'));var utils=require('../../config/utils');var config=require(_0x9508('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9508('0x16'))['db'];function respondWithStatusCode(_0x396896,_0x554c90){_0x554c90=_0x554c90||0xcc;return function(_0x11dc7f){if(_0x11dc7f){return _0x396896[_0x9508('0x17')](_0x554c90);}return _0x396896[_0x9508('0x18')](_0x554c90)[_0x9508('0x19')]();};}function respondWithResult(_0x51ef92,_0x440709){_0x440709=_0x440709||0xc8;return function(_0x21b2d1){if(_0x21b2d1){return _0x51ef92['status'](_0x440709)[_0x9508('0x1a')](_0x21b2d1);}};}function respondWithFilteredResult(_0x539746,_0x25d4d6){return function(_0x418889){if(_0x418889){var _0x374c03=_0x418889[_0x9508('0x1b')],_0x255a03=_0x25d4d6[_0x9508('0x1c')],_0x127340=_0x25d4d6['offset']+_0x25d4d6[_0x9508('0x1d')],_0x343802;if(_0x127340>=_0x374c03){_0x127340=_0x374c03;_0x343802=0xc8;}else{_0x343802=0xce;}_0x539746[_0x9508('0x18')](_0x343802);return _0x539746[_0x9508('0x1e')](_0x9508('0x1f'),_0x255a03+'-'+_0x127340+'/'+_0x374c03)[_0x9508('0x1a')](_0x418889);}return null;};}function patchUpdates(_0x22a9fe){return function(_0x52e3c4){try{jsonpatch['apply'](_0x52e3c4,_0x22a9fe,!![]);}catch(_0x17e43c){return BPromise['reject'](_0x17e43c);}return _0x52e3c4[_0x9508('0x20')]();};}function saveUpdates(_0x4e9e9f,_0x3ba927){return function(_0x22ff69){if(_0x22ff69){return _0x22ff69[_0x9508('0x21')](_0x4e9e9f)[_0x9508('0x22')](function(_0x1edf1b){return _0x1edf1b;});}return null;};}function removeEntity(_0x2f8106,_0x20eb53){return function(_0x5f4f0c){if(_0x5f4f0c){return _0x5f4f0c['destroy']()[_0x9508('0x22')](function(){_0x2f8106[_0x9508('0x18')](0xcc)[_0x9508('0x19')]();});}};}function handleEntityNotFound(_0xf70830,_0x16c54f){return function(_0x20d2ce){if(!_0x20d2ce){_0xf70830['sendStatus'](0x194);}return _0x20d2ce;};}function handleError(_0x5e9a80,_0x46d23f){_0x46d23f=_0x46d23f||0x1f4;return function(_0x55cc4d){logger['error'](_0x55cc4d[_0x9508('0x23')]);if(_0x55cc4d['name']){delete _0x55cc4d['name'];}_0x5e9a80[_0x9508('0x18')](_0x46d23f)[_0x9508('0x24')](_0x55cc4d);};}exports['index']=function(_0x49246b,_0x32b0dd){var _0x22b2e2={},_0x4529a8={},_0x1f7755={'count':0x0,'rows':[]};var _0x175088=_[_0x9508('0x25')](db[_0x9508('0x26')][_0x9508('0x27')],function(_0x24df6){return{'name':_0x24df6[_0x9508('0x28')],'type':_0x24df6['type'][_0x9508('0x29')]};});_0x4529a8[_0x9508('0x2a')]=_[_0x9508('0x25')](_0x175088,'name');_0x4529a8[_0x9508('0x2b')]=_[_0x9508('0x2c')](_0x49246b['query']);_0x4529a8[_0x9508('0x2d')]=_[_0x9508('0x2e')](_0x4529a8['model'],_0x4529a8[_0x9508('0x2b')]);_0x22b2e2[_0x9508('0x2f')]=_[_0x9508('0x2e')](_0x4529a8[_0x9508('0x2a')],qs['fields'](_0x49246b['query'][_0x9508('0x30')]));_0x22b2e2[_0x9508('0x2f')]=_0x22b2e2[_0x9508('0x2f')]['length']?_0x22b2e2['attributes']:_0x4529a8[_0x9508('0x2a')];if(!_0x49246b[_0x9508('0x2b')][_0x9508('0x31')](_0x9508('0x32'))){_0x22b2e2[_0x9508('0x1d')]=qs[_0x9508('0x1d')](_0x49246b[_0x9508('0x2b')][_0x9508('0x1d')]);_0x22b2e2[_0x9508('0x1c')]=qs[_0x9508('0x1c')](_0x49246b['query'][_0x9508('0x1c')]);}_0x22b2e2[_0x9508('0x33')]=qs['sort'](_0x49246b[_0x9508('0x2b')][_0x9508('0x34')]);_0x22b2e2[_0x9508('0x35')]=qs[_0x9508('0x2d')](_[_0x9508('0x36')](_0x49246b[_0x9508('0x2b')],_0x4529a8[_0x9508('0x2d')]),_0x175088);if(_0x49246b[_0x9508('0x2b')][_0x9508('0x37')]){_0x22b2e2[_0x9508('0x35')]=_[_0x9508('0x38')](_0x22b2e2['where'],{'$or':_[_0x9508('0x25')](_0x175088,function(_0x5b690e){if(_0x5b690e[_0x9508('0x39')]!==_0x9508('0x3a')){var _0x23a8b6={};_0x23a8b6[_0x5b690e['name']]={'$like':'%'+_0x49246b['query'][_0x9508('0x37')]+'%'};return _0x23a8b6;}})});}_0x22b2e2=_[_0x9508('0x38')]({},_0x22b2e2,_0x49246b[_0x9508('0x3b')]);var _0x41ebd9={'where':_0x22b2e2['where']};return db[_0x9508('0x26')]['count'](_0x41ebd9)[_0x9508('0x22')](function(_0x174e83){_0x1f7755['count']=_0x174e83;if(_0x49246b[_0x9508('0x2b')][_0x9508('0x3c')]){_0x22b2e2['include']=[{'all':!![]}];}return db[_0x9508('0x26')][_0x9508('0x3d')](_0x22b2e2);})[_0x9508('0x22')](function(_0x12fdc6){_0x1f7755['rows']=_0x12fdc6;return _0x1f7755;})['then'](respondWithFilteredResult(_0x32b0dd,_0x22b2e2))[_0x9508('0x3e')](handleError(_0x32b0dd,null));};exports['show']=function(_0x254e7f,_0x22c135){var _0x10e8f5={'raw':!![],'where':{'id':_0x254e7f['params']['id']}},_0x4215e9={};_0x4215e9['model']=_['keys'](db[_0x9508('0x26')]['rawAttributes']);_0x4215e9[_0x9508('0x2b')]=_['keys'](_0x254e7f[_0x9508('0x2b')]);_0x4215e9[_0x9508('0x2d')]=_[_0x9508('0x2e')](_0x4215e9[_0x9508('0x2a')],_0x4215e9['query']);_0x10e8f5[_0x9508('0x2f')]=_[_0x9508('0x2e')](_0x4215e9[_0x9508('0x2a')],qs['fields'](_0x254e7f[_0x9508('0x2b')][_0x9508('0x30')]));_0x10e8f5['attributes']=_0x10e8f5[_0x9508('0x2f')]['length']?_0x10e8f5[_0x9508('0x2f')]:_0x4215e9['model'];if(_0x254e7f['query'][_0x9508('0x3c')]){_0x10e8f5[_0x9508('0x3f')]=[{'all':!![]}];}_0x10e8f5=_[_0x9508('0x38')]({},_0x10e8f5,_0x254e7f[_0x9508('0x3b')]);return db[_0x9508('0x26')][_0x9508('0x40')](_0x10e8f5)['then'](handleEntityNotFound(_0x22c135,null))[_0x9508('0x22')](respondWithResult(_0x22c135,null))[_0x9508('0x3e')](handleError(_0x22c135,null));};exports[_0x9508('0x41')]=function(_0x4c860a,_0x2ee9e){return db[_0x9508('0x26')][_0x9508('0x41')](_0x4c860a[_0x9508('0x42')],{})['then'](respondWithResult(_0x2ee9e,0xc9))[_0x9508('0x3e')](handleError(_0x2ee9e,null));};exports['update']=function(_0x155928,_0xef021a){if(_0x155928['body']['id']){delete _0x155928[_0x9508('0x42')]['id'];}return db[_0x9508('0x26')]['find']({'where':{'id':_0x155928[_0x9508('0x43')]['id']}})[_0x9508('0x22')](handleEntityNotFound(_0xef021a,null))['then'](saveUpdates(_0x155928[_0x9508('0x42')],null))['then'](respondWithResult(_0xef021a,null))[_0x9508('0x3e')](handleError(_0xef021a,null));};exports['destroy']=function(_0x1e6c8c,_0x55a023){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x1e6c8c['params']['id']}})[_0x9508('0x22')](handleEntityNotFound(_0x55a023,null))[_0x9508('0x22')](removeEntity(_0x55a023,null))[_0x9508('0x3e')](handleError(_0x55a023,null));};exports[_0x9508('0x44')]=function(_0x40e385,_0x4542a2){return db[_0x9508('0x26')][_0x9508('0x44')]()[_0x9508('0x22')](respondWithResult(_0x4542a2,null))['catch'](handleError(_0x4542a2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index fdd34af..d9f3192 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 _0x115d=['request-promise','../../config/environment','define','JscriptyQuestionReport','lodash','../../config/logger','api','moment'];(function(_0x5084cd,_0x5392e3){var _0x53a662=function(_0x1dc82f){while(--_0x1dc82f){_0x5084cd['push'](_0x5084cd['shift']());}};_0x53a662(++_0x5392e3);}(_0x115d,0x84));var _0xd115=function(_0x433fda,_0x2a4442){_0x433fda=_0x433fda-0x0;var _0x26f32d=_0x115d[_0x433fda];return _0x26f32d;};'use strict';var _=require(_0xd115('0x0'));var util=require('util');var logger=require(_0xd115('0x1'))(_0xd115('0x2'));var moment=require(_0xd115('0x3'));var BPromise=require('bluebird');var rp=require(_0xd115('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd115('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0xc3f4a2,_0x4621f1){return _0xc3f4a2[_0xd115('0x6')](_0xd115('0x7'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5875=['path','exports','define','JscriptyQuestionReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x5875,0x67));var _0x5587=function(_0x4b7297,_0xc9fd3f){_0x4b7297=_0x4b7297-0x0;var _0x253f80=_0x5875[_0x4b7297];return _0x253f80;};'use strict';var _=require(_0x5587('0x0'));var util=require(_0x5587('0x1'));var logger=require(_0x5587('0x2'))(_0x5587('0x3'));var moment=require(_0x5587('0x4'));var BPromise=require(_0x5587('0x5'));var rp=require(_0x5587('0x6'));var fs=require('fs');var path=require(_0x5587('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0x5587('0x8')]=function(_0x1fd567,_0x8ccb9e){return _0x1fd567[_0x5587('0x9')](_0x5587('0xa'),attributes,{'tableName':'report_jscripty_questions','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 a7e92da..39c891f 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 _0x5e9d=['message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x278e95,_0x232748){var _0x37a6a1=function(_0x508bf4){while(--_0x508bf4){_0x278e95['push'](_0x278e95['shift']());}};_0x37a6a1(++_0x232748);}(_0x5e9d,0x19b));var _0xd5e9=function(_0x39c235,_0x18c81b){_0x39c235=_0x39c235-0x0;var _0x1b06f3=_0x5e9d[_0x39c235];return _0x1b06f3;};'use strict';var _=require(_0xd5e9('0x0'));var util=require(_0xd5e9('0x1'));var moment=require('moment');var BPromise=require(_0xd5e9('0x2'));var rs=require(_0xd5e9('0x3'));var fs=require('fs');var Redis=require(_0xd5e9('0x4'));var db=require(_0xd5e9('0x5'))['db'];var utils=require(_0xd5e9('0x6'));var logger=require(_0xd5e9('0x7'))(_0xd5e9('0x8'));var config=require(_0xd5e9('0x9'));var jayson=require(_0xd5e9('0xa'));var client=jayson[_0xd5e9('0xb')][_0xd5e9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a902c,_0x275621,_0xdddbbf){return new BPromise(function(_0x46cfbf,_0x5e0991){return client[_0xd5e9('0xd')](_0x1a902c,_0xdddbbf)[_0xd5e9('0xe')](function(_0x112d7a){logger['info'](_0xd5e9('0xf'),_0x275621,_0xd5e9('0x10'));logger[_0xd5e9('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x275621,_0xd5e9('0x10'),JSON[_0xd5e9('0x12')](_0x112d7a));if(_0x112d7a[_0xd5e9('0x13')]){if(_0x112d7a[_0xd5e9('0x13')][_0xd5e9('0x14')]===0x1f4){logger[_0xd5e9('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x275621,_0x112d7a[_0xd5e9('0x13')][_0xd5e9('0x15')]);return _0x5e0991(_0x112d7a['error'][_0xd5e9('0x15')]);}logger['error'](_0xd5e9('0xf'),_0x275621,_0x112d7a['error']['message']);return _0x46cfbf(_0x112d7a['error']['message']);}else{logger[_0xd5e9('0x16')](_0xd5e9('0xf'),_0x275621,_0xd5e9('0x10'));_0x46cfbf(_0x112d7a[_0xd5e9('0x17')][_0xd5e9('0x15')]);}})['catch'](function(_0x16761b){logger[_0xd5e9('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x275621,_0x16761b);_0x5e0991(_0x16761b);});});} \ No newline at end of file +var _0xbeca=['rpc','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xbeca,0x11a));var _0xabec=function(_0x3c9741,_0x557e3d){_0x3c9741=_0x3c9741-0x0;var _0x72aa01=_0xbeca[_0x3c9741];return _0x72aa01;};'use strict';var _=require('lodash');var util=require(_0xabec('0x0'));var moment=require(_0xabec('0x1'));var BPromise=require('bluebird');var rs=require(_0xabec('0x2'));var fs=require('fs');var Redis=require(_0xabec('0x3'));var db=require(_0xabec('0x4'))['db'];var utils=require(_0xabec('0x5'));var logger=require(_0xabec('0x6'))(_0xabec('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xabec('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3546ac,_0x2fd4d0,_0x32b5aa){return new BPromise(function(_0x498086,_0x3f4e41){return client['request'](_0x3546ac,_0x32b5aa)[_0xabec('0x9')](function(_0x4feb79){logger[_0xabec('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2fd4d0,'request\x20sent');logger['debug'](_0xabec('0xb'),_0x2fd4d0,_0xabec('0xc'),JSON['stringify'](_0x4feb79));if(_0x4feb79[_0xabec('0xd')]){if(_0x4feb79[_0xabec('0xd')][_0xabec('0xe')]===0x1f4){logger['error'](_0xabec('0xf'),_0x2fd4d0,_0x4feb79['error'][_0xabec('0x10')]);return _0x3f4e41(_0x4feb79['error']['message']);}logger[_0xabec('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2fd4d0,_0x4feb79[_0xabec('0xd')][_0xabec('0x10')]);return _0x498086(_0x4feb79[_0xabec('0xd')][_0xabec('0x10')]);}else{logger['info'](_0xabec('0xf'),_0x2fd4d0,_0xabec('0xc'));_0x498086(_0x4feb79['result']['message']);}})['catch'](function(_0x3183ca){logger[_0xabec('0xd')](_0xabec('0xf'),_0x2fd4d0,_0x3183ca);_0x3f4e41(_0x3183ca);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 6ce0671..4165727 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 _0xeda8=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id','getQuestions','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0xeda8,0x104));var _0x8eda=function(_0x109904,_0x75c5c8){_0x109904=_0x109904-0x0;var _0x41d920=_0xeda8[_0x109904];return _0x41d920;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0xc')]);router[_0x8eda('0xa')]('/describe',auth[_0x8eda('0xb')](),controller[_0x8eda('0xd')]);router[_0x8eda('0xa')](_0x8eda('0xe'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/questions',auth[_0x8eda('0xb')](),controller[_0x8eda('0xf')]);router[_0x8eda('0x10')]('/',auth['isAuthenticated'](),controller[_0x8eda('0x11')]);router['put'](_0x8eda('0xe'),auth[_0x8eda('0xb')](),controller[_0x8eda('0x12')]);router[_0x8eda('0x13')](_0x8eda('0xe'),auth[_0x8eda('0xb')](),controller[_0x8eda('0x14')]);module[_0x8eda('0x15')]=router; \ No newline at end of file +var _0xc1c6=['put','/:id','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','/:id/questions','getQuestions','post','create'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x231dfe,_0x1d9dac){_0x231dfe=_0x231dfe-0x0;var _0x47bc60=_0xc1c6[_0x231dfe];return _0x47bc60;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var fs_extra=require(_0x6c1c('0x4'));var auth=require(_0x6c1c('0x5'));var interaction=require(_0x6c1c('0x6'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0x6c1c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x8')]);router['get'](_0x6c1c('0x9'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xb')]);router[_0x6c1c('0x7')]('/:id',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xc')]);router['get'](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xe')]);router[_0x6c1c('0xf')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x10')]);router[_0x6c1c('0x11')](_0x6c1c('0x12'),auth['isAuthenticated'](),controller[_0x6c1c('0x13')]);router[_0x6c1c('0x14')](_0x6c1c('0x12'),auth['isAuthenticated'](),controller[_0x6c1c('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 3625b15..d78e14e 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 _0xe356=['setDataValue','starttime','endtime','STRING','BOOLEAN','moment','sequelize','exports','DATE'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xe356,0x101));var _0x6e35=function(_0x4aae0f,_0x34f6c2){_0x4aae0f=_0x4aae0f-0x0;var _0xcb6772=_0xe356[_0x4aae0f];return _0xcb6772;};'use strict';var moment=require(_0x6e35('0x0'));var Sequelize=require(_0x6e35('0x1'));module[_0x6e35('0x2')]={'starttime':{'type':Sequelize[_0x6e35('0x3')],'set':function(_0x521261){this[_0x6e35('0x4')](_0x6e35('0x5'),_0x521261);this[_0x6e35('0x4')](_0x6e35('0x6'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x6e35('0x3')]},'membername':{'type':Sequelize[_0x6e35('0x7')]},'projectname':{'type':Sequelize[_0x6e35('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6e35('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6e35('0x7')]},'completed':{'type':Sequelize[_0x6e35('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x2471=['setDataValue','starttime','endtime','STRING','BOOLEAN','moment','sequelize','exports','DATE'];(function(_0x52167f,_0x26a203){var _0x54c292=function(_0x34cf4d){while(--_0x34cf4d){_0x52167f['push'](_0x52167f['shift']());}};_0x54c292(++_0x26a203);}(_0x2471,0x188));var _0x1247=function(_0x14d250,_0x4b2e12){_0x14d250=_0x14d250-0x0;var _0xb991d8=_0x2471[_0x14d250];return _0xb991d8;};'use strict';var moment=require(_0x1247('0x0'));var Sequelize=require(_0x1247('0x1'));module[_0x1247('0x2')]={'starttime':{'type':Sequelize[_0x1247('0x3')],'set':function(_0x58e4d8){this[_0x1247('0x4')](_0x1247('0x5'),_0x58e4d8);this[_0x1247('0x4')](_0x1247('0x6'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x1247('0x7')]},'projectname':{'type':Sequelize[_0x1247('0x7')]},'queue':{'type':Sequelize[_0x1247('0x7')]},'uniqueid':{'type':Sequelize[_0x1247('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1247('0x7')]},'completed':{'type':Sequelize[_0x1247('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 5520ddf..2e60458 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 _0xd6db=['nolimit','pick','SessionId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','JscriptySessionReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','VIRTUAL','options','count','includeAll','include','findAll','rows','params','keys','merge','find','catch','create','body','getQuestions','findOne','JscriptyQuestionReport'];(function(_0x357936,_0x13c4cb){var _0x5f1157=function(_0x524343){while(--_0x524343){_0x357936['push'](_0x357936['shift']());}};_0x5f1157(++_0x13c4cb);}(_0xd6db,0x184));var _0xbd6d=function(_0x36fdc3,_0x5ab849){_0x36fdc3=_0x36fdc3-0x0;var _0x45a51c=_0xd6db[_0x36fdc3];return _0x45a51c;};'use strict';var emlformat=require(_0xbd6d('0x0'));var rimraf=require(_0xbd6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd6d('0x2'));var rp=require(_0xbd6d('0x3'));var moment=require('moment');var BPromise=require(_0xbd6d('0x4'));var Mustache=require('mustache');var util=require(_0xbd6d('0x5'));var path=require(_0xbd6d('0x6'));var sox=require(_0xbd6d('0x7'));var csv=require(_0xbd6d('0x8'));var ejs=require(_0xbd6d('0x9'));var fs=require('fs');var fs_extra=require(_0xbd6d('0xa'));var _=require('lodash');var squel=require(_0xbd6d('0xb'));var crypto=require(_0xbd6d('0xc'));var jsforce=require(_0xbd6d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbd6d('0x8'));var querystring=require('querystring');var Papa=require(_0xbd6d('0xe'));var Redis=require(_0xbd6d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbd6d('0x10'));var as=require(_0xbd6d('0x11'));var hardwareService=require(_0xbd6d('0x12'));var logger=require(_0xbd6d('0x13'))(_0xbd6d('0x14'));var utils=require('../../config/utils');var config=require(_0xbd6d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf92674,_0x548097){_0x548097=_0x548097||0xcc;return function(_0x2d37dc){if(_0x2d37dc){return _0xf92674['sendStatus'](_0x548097);}return _0xf92674[_0xbd6d('0x16')](_0x548097)[_0xbd6d('0x17')]();};}function respondWithResult(_0x4613c2,_0xba9e1b){_0xba9e1b=_0xba9e1b||0xc8;return function(_0x4c26a9){if(_0x4c26a9){return _0x4613c2[_0xbd6d('0x16')](_0xba9e1b)[_0xbd6d('0x18')](_0x4c26a9);}};}function respondWithFilteredResult(_0x27e7e5,_0x2bc51b){return function(_0x59e418){if(_0x59e418){var _0x4a76b9=_0x59e418['count'],_0x344504=_0x2bc51b['offset'],_0x57cc62=_0x2bc51b[_0xbd6d('0x19')]+_0x2bc51b['limit'],_0x1dde35;if(_0x57cc62>=_0x4a76b9){_0x57cc62=_0x4a76b9;_0x1dde35=0xc8;}else{_0x1dde35=0xce;}_0x27e7e5[_0xbd6d('0x16')](_0x1dde35);return _0x27e7e5[_0xbd6d('0x1a')](_0xbd6d('0x1b'),_0x344504+'-'+_0x57cc62+'/'+_0x4a76b9)[_0xbd6d('0x18')](_0x59e418);}return null;};}function patchUpdates(_0x2d76ff){return function(_0x1db41a){try{jsonpatch[_0xbd6d('0x1c')](_0x1db41a,_0x2d76ff,!![]);}catch(_0x492628){return BPromise[_0xbd6d('0x1d')](_0x492628);}return _0x1db41a[_0xbd6d('0x1e')]();};}function saveUpdates(_0x2d93cd,_0x1d971f){return function(_0x5a5a32){if(_0x5a5a32){return _0x5a5a32[_0xbd6d('0x1f')](_0x2d93cd)[_0xbd6d('0x20')](function(_0x14a617){return _0x14a617;});}return null;};}function removeEntity(_0x38b2bd,_0x406528){return function(_0x20ad35){if(_0x20ad35){return _0x20ad35[_0xbd6d('0x21')]()[_0xbd6d('0x20')](function(){_0x38b2bd[_0xbd6d('0x16')](0xcc)[_0xbd6d('0x17')]();});}};}function handleEntityNotFound(_0x4f2b5c,_0xd8a6e7){return function(_0x58424d){if(!_0x58424d){_0x4f2b5c[_0xbd6d('0x22')](0x194);}return _0x58424d;};}function handleError(_0x4d5830,_0x2f5b44){_0x2f5b44=_0x2f5b44||0x1f4;return function(_0xa13047){logger[_0xbd6d('0x23')](_0xa13047[_0xbd6d('0x24')]);if(_0xa13047[_0xbd6d('0x25')]){delete _0xa13047['name'];}_0x4d5830[_0xbd6d('0x16')](_0x2f5b44)[_0xbd6d('0x26')](_0xa13047);};}exports['index']=function(_0x50fc2a,_0x243534){var _0x42e3b9={},_0x2a9ed9={},_0x205f99={'count':0x0,'rows':[]};var _0xfafa=_[_0xbd6d('0x27')](db[_0xbd6d('0x28')][_0xbd6d('0x29')],function(_0x22ec6c){return{'name':_0x22ec6c['fieldName'],'type':_0x22ec6c[_0xbd6d('0x2a')][_0xbd6d('0x2b')]};});_0x2a9ed9[_0xbd6d('0x2c')]=_[_0xbd6d('0x27')](_0xfafa,_0xbd6d('0x25'));_0x2a9ed9[_0xbd6d('0x2d')]=_['keys'](_0x50fc2a[_0xbd6d('0x2d')]);_0x2a9ed9[_0xbd6d('0x2e')]=_[_0xbd6d('0x2f')](_0x2a9ed9[_0xbd6d('0x2c')],_0x2a9ed9[_0xbd6d('0x2d')]);_0x42e3b9[_0xbd6d('0x30')]=_['intersection'](_0x2a9ed9['model'],qs[_0xbd6d('0x31')](_0x50fc2a['query'][_0xbd6d('0x31')]));_0x42e3b9['attributes']=_0x42e3b9[_0xbd6d('0x30')][_0xbd6d('0x32')]?_0x42e3b9[_0xbd6d('0x30')]:_0x2a9ed9[_0xbd6d('0x2c')];if(!_0x50fc2a[_0xbd6d('0x2d')][_0xbd6d('0x33')]('nolimit')){_0x42e3b9[_0xbd6d('0x34')]=qs[_0xbd6d('0x34')](_0x50fc2a[_0xbd6d('0x2d')][_0xbd6d('0x34')]);_0x42e3b9[_0xbd6d('0x19')]=qs['offset'](_0x50fc2a['query'][_0xbd6d('0x19')]);}_0x42e3b9[_0xbd6d('0x35')]=qs[_0xbd6d('0x36')](_0x50fc2a[_0xbd6d('0x2d')][_0xbd6d('0x36')]);_0x42e3b9[_0xbd6d('0x37')]=qs[_0xbd6d('0x2e')](_['pick'](_0x50fc2a[_0xbd6d('0x2d')],_0x2a9ed9[_0xbd6d('0x2e')]),_0xfafa);if(_0x50fc2a[_0xbd6d('0x2d')][_0xbd6d('0x38')]){_0x42e3b9[_0xbd6d('0x37')]=_['merge'](_0x42e3b9[_0xbd6d('0x37')],{'$or':_[_0xbd6d('0x27')](_0xfafa,function(_0xd5b755){if(_0xd5b755['type']!==_0xbd6d('0x39')){var _0x32a54f={};_0x32a54f[_0xd5b755[_0xbd6d('0x25')]]={'$like':'%'+_0x50fc2a[_0xbd6d('0x2d')][_0xbd6d('0x38')]+'%'};return _0x32a54f;}})});}_0x42e3b9=_['merge']({},_0x42e3b9,_0x50fc2a[_0xbd6d('0x3a')]);var _0x3b65e9={'where':_0x42e3b9[_0xbd6d('0x37')]};return db[_0xbd6d('0x28')][_0xbd6d('0x3b')](_0x3b65e9)[_0xbd6d('0x20')](function(_0x143a21){_0x205f99[_0xbd6d('0x3b')]=_0x143a21;if(_0x50fc2a['query'][_0xbd6d('0x3c')]){_0x42e3b9[_0xbd6d('0x3d')]=[{'all':!![]}];}return db[_0xbd6d('0x28')][_0xbd6d('0x3e')](_0x42e3b9);})['then'](function(_0x46660b){_0x205f99[_0xbd6d('0x3f')]=_0x46660b;return _0x205f99;})[_0xbd6d('0x20')](respondWithFilteredResult(_0x243534,_0x42e3b9))['catch'](handleError(_0x243534,null));};exports['show']=function(_0x9b2dbf,_0x48c059){var _0x134577={'raw':!![],'where':{'id':_0x9b2dbf[_0xbd6d('0x40')]['id']}},_0xde20ce={};_0xde20ce[_0xbd6d('0x2c')]=_[_0xbd6d('0x41')](db[_0xbd6d('0x28')][_0xbd6d('0x29')]);_0xde20ce['query']=_[_0xbd6d('0x41')](_0x9b2dbf[_0xbd6d('0x2d')]);_0xde20ce[_0xbd6d('0x2e')]=_[_0xbd6d('0x2f')](_0xde20ce[_0xbd6d('0x2c')],_0xde20ce[_0xbd6d('0x2d')]);_0x134577[_0xbd6d('0x30')]=_['intersection'](_0xde20ce[_0xbd6d('0x2c')],qs[_0xbd6d('0x31')](_0x9b2dbf[_0xbd6d('0x2d')][_0xbd6d('0x31')]));_0x134577[_0xbd6d('0x30')]=_0x134577[_0xbd6d('0x30')][_0xbd6d('0x32')]?_0x134577[_0xbd6d('0x30')]:_0xde20ce['model'];if(_0x9b2dbf[_0xbd6d('0x2d')][_0xbd6d('0x3c')]){_0x134577[_0xbd6d('0x3d')]=[{'all':!![]}];}_0x134577=_[_0xbd6d('0x42')]({},_0x134577,_0x9b2dbf['options']);return db[_0xbd6d('0x28')][_0xbd6d('0x43')](_0x134577)[_0xbd6d('0x20')](handleEntityNotFound(_0x48c059,null))['then'](respondWithResult(_0x48c059,null))[_0xbd6d('0x44')](handleError(_0x48c059,null));};exports[_0xbd6d('0x45')]=function(_0x302ca5,_0x123a08){return db[_0xbd6d('0x28')][_0xbd6d('0x45')](_0x302ca5[_0xbd6d('0x46')],{})[_0xbd6d('0x20')](respondWithResult(_0x123a08,0xc9))['catch'](handleError(_0x123a08,null));};exports[_0xbd6d('0x1f')]=function(_0x4d5b03,_0x191039){if(_0x4d5b03['body']['id']){delete _0x4d5b03[_0xbd6d('0x46')]['id'];}return db[_0xbd6d('0x28')]['find']({'where':{'id':_0x4d5b03[_0xbd6d('0x40')]['id']}})['then'](handleEntityNotFound(_0x191039,null))['then'](saveUpdates(_0x4d5b03[_0xbd6d('0x46')],null))['then'](respondWithResult(_0x191039,null))['catch'](handleError(_0x191039,null));};exports['destroy']=function(_0x5163a9,_0x2b732c){return db[_0xbd6d('0x28')][_0xbd6d('0x43')]({'where':{'id':_0x5163a9[_0xbd6d('0x40')]['id']}})[_0xbd6d('0x20')](handleEntityNotFound(_0x2b732c,null))[_0xbd6d('0x20')](removeEntity(_0x2b732c,null))[_0xbd6d('0x44')](handleError(_0x2b732c,null));};exports['describe']=function(_0x369e9e,_0x6bee6d){return db[_0xbd6d('0x28')]['describe']()['then'](respondWithResult(_0x6bee6d,null))['catch'](handleError(_0x6bee6d,null));};exports[_0xbd6d('0x47')]=function(_0x1b2b80,_0x52835f,_0x401c28){var _0x468bde={'raw':!![],'where':{}};var _0xa3a687={};var _0xdaeb71={'count':0x0,'rows':[]};return db[_0xbd6d('0x28')][_0xbd6d('0x48')]({'where':{'id':_0x1b2b80[_0xbd6d('0x40')]['id']}})[_0xbd6d('0x20')](handleEntityNotFound(_0x52835f,null))[_0xbd6d('0x20')](function(_0x3eb4b8){if(_0x3eb4b8){_0xa3a687[_0xbd6d('0x2c')]=_[_0xbd6d('0x41')](db[_0xbd6d('0x49')][_0xbd6d('0x29')]);_0xa3a687['query']=_[_0xbd6d('0x41')](_0x1b2b80['query']);_0xa3a687[_0xbd6d('0x2e')]=_[_0xbd6d('0x2f')](_0xa3a687[_0xbd6d('0x2c')],_0xa3a687[_0xbd6d('0x2d')]);_0x468bde[_0xbd6d('0x30')]=_[_0xbd6d('0x2f')](_0xa3a687[_0xbd6d('0x2c')],qs[_0xbd6d('0x31')](_0x1b2b80[_0xbd6d('0x2d')][_0xbd6d('0x31')]));_0x468bde['attributes']=_0x468bde[_0xbd6d('0x30')]['length']?_0x468bde[_0xbd6d('0x30')]:_0xa3a687[_0xbd6d('0x2c')];if(!_0x1b2b80[_0xbd6d('0x2d')][_0xbd6d('0x33')](_0xbd6d('0x4a'))){_0x468bde[_0xbd6d('0x34')]=qs[_0xbd6d('0x34')](_0x1b2b80[_0xbd6d('0x2d')][_0xbd6d('0x34')]);_0x468bde[_0xbd6d('0x19')]=qs['offset'](_0x1b2b80[_0xbd6d('0x2d')][_0xbd6d('0x19')]);}_0x468bde['order']=qs[_0xbd6d('0x36')](_0x1b2b80['query'][_0xbd6d('0x36')]);_0x468bde[_0xbd6d('0x37')]=qs[_0xbd6d('0x2e')](_[_0xbd6d('0x4b')](_0x1b2b80[_0xbd6d('0x2d')],_0xa3a687[_0xbd6d('0x2e')]));_0x468bde[_0xbd6d('0x37')][_0xbd6d('0x4c')]=_0x3eb4b8['id'];if(_0x1b2b80[_0xbd6d('0x2d')][_0xbd6d('0x38')]){_0x468bde[_0xbd6d('0x37')]=_[_0xbd6d('0x42')](_0x468bde[_0xbd6d('0x37')],{'$or':_[_0xbd6d('0x27')](_0x468bde[_0xbd6d('0x30')],function(_0x96fd0){var _0x379b9f={};_0x379b9f[_0x96fd0]={'$like':'%'+_0x1b2b80[_0xbd6d('0x2d')][_0xbd6d('0x38')]+'%'};return _0x379b9f;})});}_0x468bde=_[_0xbd6d('0x42')]({},_0x468bde,_0x1b2b80[_0xbd6d('0x3a')]);return db['JscriptyQuestionReport'][_0xbd6d('0x3b')]({'where':_0x468bde[_0xbd6d('0x37')]})[_0xbd6d('0x20')](function(_0x1d37dd){_0xdaeb71[_0xbd6d('0x3b')]=_0x1d37dd;if(_0x1b2b80[_0xbd6d('0x2d')][_0xbd6d('0x3c')]){_0x468bde[_0xbd6d('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xbd6d('0x3e')](_0x468bde);})[_0xbd6d('0x20')](function(_0x5e3175){_0xdaeb71[_0xbd6d('0x3f')]=_0x5e3175;return _0xdaeb71;});}})[_0xbd6d('0x20')](respondWithFilteredResult(_0x52835f,_0x468bde))['catch'](handleError(_0x52835f,null));}; \ No newline at end of file +var _0x04df=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','SessionId','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','JscriptySessionReport','rawAttributes','fieldName','type'];(function(_0x1120c7,_0x18f931){var _0x436f8a=function(_0x19f1dd){while(--_0x19f1dd){_0x1120c7['push'](_0x1120c7['shift']());}};_0x436f8a(++_0x18f931);}(_0x04df,0x70));var _0xf04d=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x04df[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf04d('0x0'));var zipdir=require(_0xf04d('0x1'));var jsonpatch=require(_0xf04d('0x2'));var rp=require(_0xf04d('0x3'));var moment=require(_0xf04d('0x4'));var BPromise=require(_0xf04d('0x5'));var Mustache=require('mustache');var util=require(_0xf04d('0x6'));var path=require(_0xf04d('0x7'));var sox=require(_0xf04d('0x8'));var csv=require('to-csv');var ejs=require(_0xf04d('0x9'));var fs=require('fs');var fs_extra=require(_0xf04d('0xa'));var _=require('lodash');var squel=require(_0xf04d('0xb'));var crypto=require(_0xf04d('0xc'));var jsforce=require(_0xf04d('0xd'));var deskjs=require(_0xf04d('0xe'));var toCsv=require(_0xf04d('0xf'));var querystring=require(_0xf04d('0x10'));var Papa=require(_0xf04d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf04d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf04d('0x13'))(_0xf04d('0x14'));var utils=require(_0xf04d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf04d('0x16'));var db=require(_0xf04d('0x17'))['db'];function respondWithStatusCode(_0x54aa14,_0x2ef860){_0x2ef860=_0x2ef860||0xcc;return function(_0xcb4059){if(_0xcb4059){return _0x54aa14[_0xf04d('0x18')](_0x2ef860);}return _0x54aa14[_0xf04d('0x19')](_0x2ef860)[_0xf04d('0x1a')]();};}function respondWithResult(_0x5d06d1,_0x3ca63b){_0x3ca63b=_0x3ca63b||0xc8;return function(_0x5049b1){if(_0x5049b1){return _0x5d06d1[_0xf04d('0x19')](_0x3ca63b)[_0xf04d('0x1b')](_0x5049b1);}};}function respondWithFilteredResult(_0x2bde24,_0x5eb580){return function(_0x1ea0c2){if(_0x1ea0c2){var _0x3f9d67=_0x1ea0c2[_0xf04d('0x1c')],_0x20b839=_0x5eb580[_0xf04d('0x1d')],_0x317f68=_0x5eb580[_0xf04d('0x1d')]+_0x5eb580[_0xf04d('0x1e')],_0x5b46ce;if(_0x317f68>=_0x3f9d67){_0x317f68=_0x3f9d67;_0x5b46ce=0xc8;}else{_0x5b46ce=0xce;}_0x2bde24[_0xf04d('0x19')](_0x5b46ce);return _0x2bde24[_0xf04d('0x1f')](_0xf04d('0x20'),_0x20b839+'-'+_0x317f68+'/'+_0x3f9d67)[_0xf04d('0x1b')](_0x1ea0c2);}return null;};}function patchUpdates(_0x247f60){return function(_0x59300f){try{jsonpatch['apply'](_0x59300f,_0x247f60,!![]);}catch(_0x16f611){return BPromise[_0xf04d('0x21')](_0x16f611);}return _0x59300f['save']();};}function saveUpdates(_0x51a49f,_0x2e96ea){return function(_0x542912){if(_0x542912){return _0x542912[_0xf04d('0x22')](_0x51a49f)[_0xf04d('0x23')](function(_0x2645c1){return _0x2645c1;});}return null;};}function removeEntity(_0x747bc2,_0x2771b8){return function(_0x1697fa){if(_0x1697fa){return _0x1697fa[_0xf04d('0x24')]()[_0xf04d('0x23')](function(){_0x747bc2[_0xf04d('0x19')](0xcc)[_0xf04d('0x1a')]();});}};}function handleEntityNotFound(_0x362e36,_0x43bad8){return function(_0x221c2d){if(!_0x221c2d){_0x362e36[_0xf04d('0x18')](0x194);}return _0x221c2d;};}function handleError(_0x34c2cf,_0x1d84c7){_0x1d84c7=_0x1d84c7||0x1f4;return function(_0xf3c23){logger['error'](_0xf3c23[_0xf04d('0x25')]);if(_0xf3c23[_0xf04d('0x26')]){delete _0xf3c23[_0xf04d('0x26')];}_0x34c2cf['status'](_0x1d84c7)[_0xf04d('0x27')](_0xf3c23);};}exports['index']=function(_0x5b9624,_0x1910a9){var _0x98f852={},_0x18d654={},_0x198ba0={'count':0x0,'rows':[]};var _0x371d6f=_['map'](db[_0xf04d('0x28')][_0xf04d('0x29')],function(_0x129afb){return{'name':_0x129afb[_0xf04d('0x2a')],'type':_0x129afb[_0xf04d('0x2b')][_0xf04d('0x2c')]};});_0x18d654[_0xf04d('0x2d')]=_[_0xf04d('0x2e')](_0x371d6f,'name');_0x18d654[_0xf04d('0x2f')]=_[_0xf04d('0x30')](_0x5b9624[_0xf04d('0x2f')]);_0x18d654[_0xf04d('0x31')]=_[_0xf04d('0x32')](_0x18d654[_0xf04d('0x2d')],_0x18d654['query']);_0x98f852[_0xf04d('0x33')]=_[_0xf04d('0x32')](_0x18d654['model'],qs[_0xf04d('0x34')](_0x5b9624[_0xf04d('0x2f')][_0xf04d('0x34')]));_0x98f852['attributes']=_0x98f852[_0xf04d('0x33')][_0xf04d('0x35')]?_0x98f852[_0xf04d('0x33')]:_0x18d654['model'];if(!_0x5b9624[_0xf04d('0x2f')][_0xf04d('0x36')]('nolimit')){_0x98f852[_0xf04d('0x1e')]=qs['limit'](_0x5b9624['query'][_0xf04d('0x1e')]);_0x98f852[_0xf04d('0x1d')]=qs['offset'](_0x5b9624[_0xf04d('0x2f')][_0xf04d('0x1d')]);}_0x98f852[_0xf04d('0x37')]=qs['sort'](_0x5b9624[_0xf04d('0x2f')][_0xf04d('0x38')]);_0x98f852[_0xf04d('0x39')]=qs['filters'](_[_0xf04d('0x3a')](_0x5b9624[_0xf04d('0x2f')],_0x18d654['filters']),_0x371d6f);if(_0x5b9624['query'][_0xf04d('0x3b')]){_0x98f852['where']=_[_0xf04d('0x3c')](_0x98f852[_0xf04d('0x39')],{'$or':_[_0xf04d('0x2e')](_0x371d6f,function(_0x480c4d){if(_0x480c4d[_0xf04d('0x2b')]!=='VIRTUAL'){var _0x5ebaa3={};_0x5ebaa3[_0x480c4d[_0xf04d('0x26')]]={'$like':'%'+_0x5b9624[_0xf04d('0x2f')][_0xf04d('0x3b')]+'%'};return _0x5ebaa3;}})});}_0x98f852=_[_0xf04d('0x3c')]({},_0x98f852,_0x5b9624['options']);var _0x5aa89c={'where':_0x98f852[_0xf04d('0x39')]};return db[_0xf04d('0x28')][_0xf04d('0x1c')](_0x5aa89c)['then'](function(_0x49e602){_0x198ba0['count']=_0x49e602;if(_0x5b9624['query'][_0xf04d('0x3d')]){_0x98f852[_0xf04d('0x3e')]=[{'all':!![]}];}return db[_0xf04d('0x28')]['findAll'](_0x98f852);})[_0xf04d('0x23')](function(_0x4ff7af){_0x198ba0[_0xf04d('0x3f')]=_0x4ff7af;return _0x198ba0;})['then'](respondWithFilteredResult(_0x1910a9,_0x98f852))[_0xf04d('0x40')](handleError(_0x1910a9,null));};exports[_0xf04d('0x41')]=function(_0x2b5676,_0x3e937c){var _0x5d0208={'raw':!![],'where':{'id':_0x2b5676[_0xf04d('0x42')]['id']}},_0x18d41d={};_0x18d41d[_0xf04d('0x2d')]=_['keys'](db[_0xf04d('0x28')]['rawAttributes']);_0x18d41d['query']=_[_0xf04d('0x30')](_0x2b5676['query']);_0x18d41d['filters']=_['intersection'](_0x18d41d[_0xf04d('0x2d')],_0x18d41d[_0xf04d('0x2f')]);_0x5d0208[_0xf04d('0x33')]=_[_0xf04d('0x32')](_0x18d41d[_0xf04d('0x2d')],qs['fields'](_0x2b5676['query']['fields']));_0x5d0208[_0xf04d('0x33')]=_0x5d0208[_0xf04d('0x33')]['length']?_0x5d0208['attributes']:_0x18d41d['model'];if(_0x2b5676['query'][_0xf04d('0x3d')]){_0x5d0208[_0xf04d('0x3e')]=[{'all':!![]}];}_0x5d0208=_[_0xf04d('0x3c')]({},_0x5d0208,_0x2b5676[_0xf04d('0x43')]);return db[_0xf04d('0x28')][_0xf04d('0x44')](_0x5d0208)[_0xf04d('0x23')](handleEntityNotFound(_0x3e937c,null))[_0xf04d('0x23')](respondWithResult(_0x3e937c,null))['catch'](handleError(_0x3e937c,null));};exports[_0xf04d('0x45')]=function(_0x2f4239,_0x177ddd){return db['JscriptySessionReport'][_0xf04d('0x45')](_0x2f4239['body'],{})[_0xf04d('0x23')](respondWithResult(_0x177ddd,0xc9))[_0xf04d('0x40')](handleError(_0x177ddd,null));};exports[_0xf04d('0x22')]=function(_0x50b23a,_0x44f574){if(_0x50b23a[_0xf04d('0x46')]['id']){delete _0x50b23a[_0xf04d('0x46')]['id'];}return db[_0xf04d('0x28')][_0xf04d('0x44')]({'where':{'id':_0x50b23a[_0xf04d('0x42')]['id']}})[_0xf04d('0x23')](handleEntityNotFound(_0x44f574,null))[_0xf04d('0x23')](saveUpdates(_0x50b23a['body'],null))[_0xf04d('0x23')](respondWithResult(_0x44f574,null))[_0xf04d('0x40')](handleError(_0x44f574,null));};exports[_0xf04d('0x24')]=function(_0x2b7d27,_0x4f4dd6){return db[_0xf04d('0x28')]['find']({'where':{'id':_0x2b7d27[_0xf04d('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f4dd6,null))['then'](removeEntity(_0x4f4dd6,null))[_0xf04d('0x40')](handleError(_0x4f4dd6,null));};exports[_0xf04d('0x47')]=function(_0x1ad13f,_0x5998a2){return db[_0xf04d('0x28')][_0xf04d('0x47')]()[_0xf04d('0x23')](respondWithResult(_0x5998a2,null))['catch'](handleError(_0x5998a2,null));};exports[_0xf04d('0x48')]=function(_0x45074b,_0x4b1826,_0x21cf4f){var _0x4ce131={'raw':!![],'where':{}};var _0x1403d5={};var _0x479e2f={'count':0x0,'rows':[]};return db[_0xf04d('0x28')][_0xf04d('0x49')]({'where':{'id':_0x45074b[_0xf04d('0x42')]['id']}})[_0xf04d('0x23')](handleEntityNotFound(_0x4b1826,null))[_0xf04d('0x23')](function(_0x4c0209){if(_0x4c0209){_0x1403d5['model']=_['keys'](db[_0xf04d('0x4a')]['rawAttributes']);_0x1403d5['query']=_['keys'](_0x45074b[_0xf04d('0x2f')]);_0x1403d5['filters']=_[_0xf04d('0x32')](_0x1403d5['model'],_0x1403d5[_0xf04d('0x2f')]);_0x4ce131['attributes']=_[_0xf04d('0x32')](_0x1403d5[_0xf04d('0x2d')],qs['fields'](_0x45074b[_0xf04d('0x2f')][_0xf04d('0x34')]));_0x4ce131[_0xf04d('0x33')]=_0x4ce131[_0xf04d('0x33')][_0xf04d('0x35')]?_0x4ce131['attributes']:_0x1403d5[_0xf04d('0x2d')];if(!_0x45074b[_0xf04d('0x2f')][_0xf04d('0x36')](_0xf04d('0x4b'))){_0x4ce131[_0xf04d('0x1e')]=qs[_0xf04d('0x1e')](_0x45074b[_0xf04d('0x2f')]['limit']);_0x4ce131[_0xf04d('0x1d')]=qs[_0xf04d('0x1d')](_0x45074b['query'][_0xf04d('0x1d')]);}_0x4ce131[_0xf04d('0x37')]=qs[_0xf04d('0x38')](_0x45074b['query'][_0xf04d('0x38')]);_0x4ce131['where']=qs['filters'](_[_0xf04d('0x3a')](_0x45074b[_0xf04d('0x2f')],_0x1403d5[_0xf04d('0x31')]));_0x4ce131[_0xf04d('0x39')][_0xf04d('0x4c')]=_0x4c0209['id'];if(_0x45074b[_0xf04d('0x2f')][_0xf04d('0x3b')]){_0x4ce131[_0xf04d('0x39')]=_[_0xf04d('0x3c')](_0x4ce131['where'],{'$or':_['map'](_0x4ce131['attributes'],function(_0x15d017){var _0x21b21a={};_0x21b21a[_0x15d017]={'$like':'%'+_0x45074b[_0xf04d('0x2f')][_0xf04d('0x3b')]+'%'};return _0x21b21a;})});}_0x4ce131=_[_0xf04d('0x3c')]({},_0x4ce131,_0x45074b['options']);return db['JscriptyQuestionReport'][_0xf04d('0x1c')]({'where':_0x4ce131[_0xf04d('0x39')]})[_0xf04d('0x23')](function(_0x5637d3){_0x479e2f[_0xf04d('0x1c')]=_0x5637d3;if(_0x45074b['query']['includeAll']){_0x4ce131[_0xf04d('0x3e')]=[{'all':!![]}];}return db[_0xf04d('0x4a')][_0xf04d('0x4d')](_0x4ce131);})[_0xf04d('0x23')](function(_0x4fcc75){_0x479e2f[_0xf04d('0x3f')]=_0x4fcc75;return _0x479e2f;});}})['then'](respondWithFilteredResult(_0x4b1826,_0x4ce131))[_0xf04d('0x40')](handleError(_0x4b1826,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index a7bd0f4..f64e7b2 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 _0x1ee3=['request-promise','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xc7b01f,_0x316398){var _0x1304bb=function(_0x2b44d5){while(--_0x2b44d5){_0xc7b01f['push'](_0xc7b01f['shift']());}};_0x1304bb(++_0x316398);}(_0x1ee3,0x14a));var _0x31ee=function(_0x4b97d7,_0x1c12e6){_0x4b97d7=_0x4b97d7-0x0;var _0x1543e4=_0x1ee3[_0x4b97d7];return _0x1543e4;};'use strict';var _=require(_0x31ee('0x0'));var util=require(_0x31ee('0x1'));var logger=require(_0x31ee('0x2'))(_0x31ee('0x3'));var moment=require(_0x31ee('0x4'));var BPromise=require(_0x31ee('0x5'));var rp=require(_0x31ee('0x6'));var fs=require('fs');var path=require(_0x31ee('0x7'));var rimraf=require(_0x31ee('0x8'));var config=require('../../config/environment');var attributes=require(_0x31ee('0x9'));module[_0x31ee('0xa')]=function(_0x346311,_0x26859b){return _0x346311[_0x31ee('0xb')](_0x31ee('0xc'),attributes,{'tableName':_0x31ee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4aa=['moment','bluebird','rimraf','./jscriptySessionReport.attributes','define','JscriptySessionReport','util','../../config/logger','api'];(function(_0x385662,_0x25e737){var _0x237d45=function(_0x345494){while(--_0x345494){_0x385662['push'](_0x385662['shift']());}};_0x237d45(++_0x25e737);}(_0xe4aa,0x8d));var _0xae4a=function(_0x2390a6,_0x4e4999){_0x2390a6=_0x2390a6-0x0;var _0x163c8f=_0xe4aa[_0x2390a6];return _0x163c8f;};'use strict';var _=require('lodash');var util=require(_0xae4a('0x0'));var logger=require(_0xae4a('0x1'))(_0xae4a('0x2'));var moment=require(_0xae4a('0x3'));var BPromise=require(_0xae4a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xae4a('0x5'));var config=require('../../config/environment');var attributes=require(_0xae4a('0x6'));module['exports']=function(_0x401ee6,_0x35fcf1){return _0x401ee6[_0xae4a('0x7')](_0xae4a('0x8'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 3b3d43c..1007c10 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 _0x956a=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x11fb85,_0x90cf41){var _0x14038f=function(_0x418783){while(--_0x418783){_0x11fb85['push'](_0x11fb85['shift']());}};_0x14038f(++_0x90cf41);}(_0x956a,0x1cc));var _0xa956=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x956a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa956('0x0'));var util=require('util');var moment=require(_0xa956('0x1'));var BPromise=require(_0xa956('0x2'));var rs=require(_0xa956('0x3'));var fs=require('fs');var Redis=require(_0xa956('0x4'));var db=require(_0xa956('0x5'))['db'];var utils=require(_0xa956('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa956('0x7'));var jayson=require(_0xa956('0x8'));var client=jayson[_0xa956('0x9')][_0xa956('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ae68f,_0x261d32,_0x186b69){return new BPromise(function(_0x5b68ab,_0x25bd4d){return client[_0xa956('0xb')](_0x2ae68f,_0x186b69)[_0xa956('0xc')](function(_0x5346af){logger[_0xa956('0xd')](_0xa956('0xe'),_0x261d32,_0xa956('0xf'));logger[_0xa956('0x10')](_0xa956('0x11'),_0x261d32,_0xa956('0xf'),JSON[_0xa956('0x12')](_0x5346af));if(_0x5346af[_0xa956('0x13')]){if(_0x5346af['error'][_0xa956('0x14')]===0x1f4){logger['error'](_0xa956('0xe'),_0x261d32,_0x5346af['error'][_0xa956('0x15')]);return _0x25bd4d(_0x5346af['error'][_0xa956('0x15')]);}logger[_0xa956('0x13')](_0xa956('0xe'),_0x261d32,_0x5346af['error'][_0xa956('0x15')]);return _0x5b68ab(_0x5346af[_0xa956('0x13')]['message']);}else{logger[_0xa956('0xd')](_0xa956('0xe'),_0x261d32,_0xa956('0xf'));_0x5b68ab(_0x5346af[_0xa956('0x16')][_0xa956('0x15')]);}})[_0xa956('0x17')](function(_0x247a43){logger['error'](_0xa956('0xe'),_0x261d32,_0x247a43);_0x25bd4d(_0x247a43);});});} \ No newline at end of file +var _0xd230=['http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0xf65a82,_0x32be76){var _0x311838=function(_0x421f5d){while(--_0x421f5d){_0xf65a82['push'](_0xf65a82['shift']());}};_0x311838(++_0x32be76);}(_0xd230,0x107));var _0x0d23=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xd230[_0xa6cc5c];return _0x44803d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0d23('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d23('0x1'));var db=require(_0x0d23('0x2'))['db'];var utils=require(_0x0d23('0x3'));var logger=require('../../config/logger')(_0x0d23('0x4'));var config=require('../../config/environment');var jayson=require(_0x0d23('0x5'));var client=jayson[_0x0d23('0x6')][_0x0d23('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34c2d2,_0x2abb34,_0x113a96){return new BPromise(function(_0x4685b7,_0x46f938){return client['request'](_0x34c2d2,_0x113a96)[_0x0d23('0x8')](function(_0x114931){logger[_0x0d23('0x9')](_0x0d23('0xa'),_0x2abb34,_0x0d23('0xb'));logger[_0x0d23('0xc')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x2abb34,_0x0d23('0xb'),JSON[_0x0d23('0xd')](_0x114931));if(_0x114931[_0x0d23('0xe')]){if(_0x114931['error'][_0x0d23('0xf')]===0x1f4){logger[_0x0d23('0xe')](_0x0d23('0xa'),_0x2abb34,_0x114931[_0x0d23('0xe')]['message']);return _0x46f938(_0x114931[_0x0d23('0xe')][_0x0d23('0x10')]);}logger['error'](_0x0d23('0xa'),_0x2abb34,_0x114931['error'][_0x0d23('0x10')]);return _0x4685b7(_0x114931[_0x0d23('0xe')]['message']);}else{logger[_0x0d23('0x9')]('JscriptySessionReport,\x20%s,\x20%s',_0x2abb34,_0x0d23('0xb'));_0x4685b7(_0x114931['result'][_0x0d23('0x10')]);}})[_0x0d23('0x11')](function(_0x4bf68d){logger[_0x0d23('0xe')](_0x0d23('0xa'),_0x2abb34,_0x4bf68d);_0x46f938(_0x4bf68d);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index b58ce98..4204e18 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 _0x0c37=['fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','exports','multer','util','path','connect-timeout','Router'];(function(_0xc37579,_0x3b67d4){var _0x1e5239=function(_0x904142){while(--_0x904142){_0xc37579['push'](_0xc37579['shift']());}};_0x1e5239(++_0x3b67d4);}(_0x0c37,0x183));var _0x70c3=function(_0x42ce25,_0x7f11aa){_0x42ce25=_0x42ce25-0x0;var _0x14b4cd=_0x0c37[_0x42ce25];return _0x14b4cd;};'use strict';var multer=require(_0x70c3('0x0'));var util=require(_0x70c3('0x1'));var path=require(_0x70c3('0x2'));var timeout=require(_0x70c3('0x3'));var express=require('express');var router=express[_0x70c3('0x4')]();var fs_extra=require(_0x70c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x70c3('0x6'));var config=require(_0x70c3('0x7'));var controller=require(_0x70c3('0x8'));router[_0x70c3('0x9')]('/',controller[_0x70c3('0xa')]);router['put'](_0x70c3('0xb'),auth[_0x70c3('0xc')](),controller['update']);module[_0x70c3('0xd')]=router; \ No newline at end of file +var _0x70c2=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','put','isAuthenticated','update','exports','multer','util','path','connect-timeout'];(function(_0x483a46,_0x1a2fc8){var _0x15f360=function(_0x43a9d7){while(--_0x43a9d7){_0x483a46['push'](_0x483a46['shift']());}};_0x15f360(++_0x1a2fc8);}(_0x70c2,0x83));var _0x270c=function(_0x189d60,_0x5db550){_0x189d60=_0x189d60-0x0;var _0x500cf7=_0x70c2[_0x189d60];return _0x500cf7;};'use strict';var multer=require(_0x270c('0x0'));var util=require(_0x270c('0x1'));var path=require(_0x270c('0x2'));var timeout=require(_0x270c('0x3'));var express=require(_0x270c('0x4'));var router=express[_0x270c('0x5')]();var fs_extra=require(_0x270c('0x6'));var auth=require(_0x270c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x270c('0x8'));var controller=require('./license.controller');router[_0x270c('0x9')]('/',controller[_0x270c('0xa')]);router[_0x270c('0xb')]('/:id',auth[_0x270c('0xc')](),controller[_0x270c('0xd')]);module[_0x270c('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 b2115b0..9f12174 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 _0x31f0=['TEXT','STRING','INTEGER','sequelize'];(function(_0x12d917,_0x59ddd4){var _0x576d1a=function(_0x360f23){while(--_0x360f23){_0x12d917['push'](_0x12d917['shift']());}};_0x576d1a(++_0x59ddd4);}(_0x31f0,0xb7));var _0x031f=function(_0x1c3d27,_0x132036){_0x1c3d27=_0x1c3d27-0x0;var _0x2de9e3=_0x31f0[_0x1c3d27];return _0x2de9e3;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'license':{'type':Sequelize[_0x031f('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x031f('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x031f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7a54=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x4f34d8,_0x40f022){var _0xc97536=function(_0xef9dfc){while(--_0xef9dfc){_0x4f34d8['push'](_0x4f34d8['shift']());}};_0xc97536(++_0x40f022);}(_0x7a54,0x106));var _0x47a5=function(_0x324e15,_0x5a915a){_0x324e15=_0x324e15-0x0;var _0x18a081=_0x7a54[_0x324e15];return _0x18a081;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'license':{'type':Sequelize[_0x47a5('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x47a5('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x47a5('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 ac770eb..9f0d7f9 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 _0x3c26=['../../config/license/util','index','model','keys','License','rawAttributes','query','attributes','intersection','fields','length','merge','options','getLicense','catch','body','find','checkLicense','key','demo','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','reject','save','update','destroy','then','sendStatus','stack','name','send'];(function(_0x380ac7,_0x257211){var _0x545078=function(_0x2d159c){while(--_0x2d159c){_0x380ac7['push'](_0x380ac7['shift']());}};_0x545078(++_0x257211);}(_0x3c26,0x100));var _0x63c2=function(_0x9401d4,_0x552f8c){_0x9401d4=_0x9401d4-0x0;var _0x15914d=_0x3c26[_0x9401d4];return _0x15914d;};'use strict';var emlformat=require(_0x63c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x63c2('0x1'));var jsonpatch=require(_0x63c2('0x2'));var rp=require('request-promise');var moment=require(_0x63c2('0x3'));var BPromise=require(_0x63c2('0x4'));var Mustache=require(_0x63c2('0x5'));var util=require(_0x63c2('0x6'));var path=require(_0x63c2('0x7'));var sox=require('sox');var csv=require(_0x63c2('0x8'));var ejs=require(_0x63c2('0x9'));var fs=require('fs');var fs_extra=require(_0x63c2('0xa'));var _=require(_0x63c2('0xb'));var squel=require(_0x63c2('0xc'));var crypto=require(_0x63c2('0xd'));var jsforce=require(_0x63c2('0xe'));var deskjs=require(_0x63c2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x63c2('0x10'));var Papa=require(_0x63c2('0x11'));var Redis=require(_0x63c2('0x12'));var authService=require(_0x63c2('0x13'));var qs=require(_0x63c2('0x14'));var as=require(_0x63c2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x63c2('0x16'))(_0x63c2('0x17'));var utils=require(_0x63c2('0x18'));var config=require(_0x63c2('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b03fd,_0x409978){_0x409978=_0x409978||0xcc;return function(_0x6bbf5f){if(_0x6bbf5f){return _0x3b03fd['sendStatus'](_0x409978);}return _0x3b03fd[_0x63c2('0x1a')](_0x409978)[_0x63c2('0x1b')]();};}function respondWithResult(_0x2590a2,_0x26591d){_0x26591d=_0x26591d||0xc8;return function(_0x39135b){if(_0x39135b){return _0x2590a2['status'](_0x26591d)[_0x63c2('0x1c')](_0x39135b);}};}function respondWithFilteredResult(_0x364e83,_0x515695){return function(_0x2c5347){if(_0x2c5347){var _0x558ec6=_0x2c5347['count'],_0x469794=_0x515695[_0x63c2('0x1d')],_0x19e4bc=_0x515695[_0x63c2('0x1d')]+_0x515695['limit'],_0x5b113f;if(_0x19e4bc>=_0x558ec6){_0x19e4bc=_0x558ec6;_0x5b113f=0xc8;}else{_0x5b113f=0xce;}_0x364e83[_0x63c2('0x1a')](_0x5b113f);return _0x364e83['set']('Content-Range',_0x469794+'-'+_0x19e4bc+'/'+_0x558ec6)[_0x63c2('0x1c')](_0x2c5347);}return null;};}function patchUpdates(_0x752355){return function(_0x1908c2){try{jsonpatch['apply'](_0x1908c2,_0x752355,!![]);}catch(_0x5c0f5f){return BPromise[_0x63c2('0x1e')](_0x5c0f5f);}return _0x1908c2[_0x63c2('0x1f')]();};}function saveUpdates(_0x5bc9fa,_0xa32ac2){return function(_0x436f89){if(_0x436f89){return _0x436f89[_0x63c2('0x20')](_0x5bc9fa)['then'](function(_0x46d485){return _0x46d485;});}return null;};}function removeEntity(_0x35f126,_0x167fc0){return function(_0x2d05f7){if(_0x2d05f7){return _0x2d05f7[_0x63c2('0x21')]()[_0x63c2('0x22')](function(){_0x35f126['status'](0xcc)[_0x63c2('0x1b')]();});}};}function handleEntityNotFound(_0x1b4d04,_0x1ea75c){return function(_0x2d47cd){if(!_0x2d47cd){_0x1b4d04[_0x63c2('0x23')](0x194);}return _0x2d47cd;};}function handleError(_0x184a09,_0x37d561){_0x37d561=_0x37d561||0x1f4;return function(_0x1f0e76){logger['error'](_0x1f0e76[_0x63c2('0x24')]);if(_0x1f0e76[_0x63c2('0x25')]){delete _0x1f0e76[_0x63c2('0x25')];}_0x184a09[_0x63c2('0x1a')](_0x37d561)[_0x63c2('0x26')](_0x1f0e76);};}var utilLicense=require(_0x63c2('0x27'));exports[_0x63c2('0x28')]=function(_0x581941,_0x39eae7){var _0x38e933={'raw':!![],'where':{'id':0x1}},_0x103b06={};_0x103b06[_0x63c2('0x29')]=_[_0x63c2('0x2a')](db[_0x63c2('0x2b')][_0x63c2('0x2c')]);_0x103b06[_0x63c2('0x2d')]=_[_0x63c2('0x2a')](_0x581941[_0x63c2('0x2d')]);_0x103b06['filters']=_['intersection'](_0x103b06['model'],_0x103b06[_0x63c2('0x2d')]);_0x38e933[_0x63c2('0x2e')]=_[_0x63c2('0x2f')](_0x103b06[_0x63c2('0x29')],qs['fields'](_0x581941[_0x63c2('0x2d')][_0x63c2('0x30')]));_0x38e933[_0x63c2('0x2e')]=_0x38e933['attributes'][_0x63c2('0x31')]?_0x38e933[_0x63c2('0x2e')]:_0x103b06[_0x63c2('0x29')];_0x38e933=_[_0x63c2('0x32')]({},_0x38e933,_0x581941[_0x63c2('0x33')]);return utilLicense[_0x63c2('0x34')](_0x38e933)[_0x63c2('0x22')](respondWithResult(_0x39eae7,null))[_0x63c2('0x35')](handleError(_0x39eae7,null));};exports['update']=function(_0x154c56,_0x289961){if(_0x154c56[_0x63c2('0x36')]['id']){delete _0x154c56[_0x63c2('0x36')]['id'];}return db[_0x63c2('0x2b')][_0x63c2('0x37')]({'where':{'id':_0x154c56['params']['id']}})[_0x63c2('0x22')](handleEntityNotFound(_0x289961,null))[_0x63c2('0x22')](function(_0x572841){var _0x4ec00f=_0x572841['get']({'plain':!![]});return utilLicense[_0x63c2('0x38')](_0x4ec00f,_0x154c56[_0x63c2('0x36')][_0x63c2('0x39')]);})[_0x63c2('0x22')](function(_0x3e0df3){if(!_0x3e0df3[_0x63c2('0x3a')]){return saveUpdates(_0x154c56[_0x63c2('0x36')],null);}return _0x3e0df3;})[_0x63c2('0x22')](respondWithResult(_0x289961,null))[_0x63c2('0x35')](handleError(_0x289961,null));}; \ No newline at end of file +var _0x125a=['save','update','destroy','then','name','index','model','License','rawAttributes','query','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','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','set','Content-Range','apply','reject'];(function(_0x1fb4a0,_0x48a602){var _0x1094e7=function(_0x25fcd5){while(--_0x25fcd5){_0x1fb4a0['push'](_0x1fb4a0['shift']());}};_0x1094e7(++_0x48a602);}(_0x125a,0x101));var _0xa125=function(_0xea1570,_0x2f7856){_0xea1570=_0xea1570-0x0;var _0x579e74=_0x125a[_0xea1570];return _0x579e74;};'use strict';var emlformat=require(_0xa125('0x0'));var rimraf=require(_0xa125('0x1'));var zipdir=require(_0xa125('0x2'));var jsonpatch=require(_0xa125('0x3'));var rp=require('request-promise');var moment=require(_0xa125('0x4'));var BPromise=require(_0xa125('0x5'));var Mustache=require('mustache');var util=require(_0xa125('0x6'));var path=require(_0xa125('0x7'));var sox=require(_0xa125('0x8'));var csv=require(_0xa125('0x9'));var ejs=require(_0xa125('0xa'));var fs=require('fs');var fs_extra=require(_0xa125('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa125('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa125('0x9'));var querystring=require(_0xa125('0xd'));var Papa=require('papaparse');var Redis=require(_0xa125('0xe'));var authService=require(_0xa125('0xf'));var qs=require(_0xa125('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa125('0x11'));var logger=require(_0xa125('0x12'))(_0xa125('0x13'));var utils=require('../../config/utils');var config=require(_0xa125('0x14'));var licenseUtil=require(_0xa125('0x15'));var db=require(_0xa125('0x16'))['db'];function respondWithStatusCode(_0xd7a0ae,_0x3bb1f1){_0x3bb1f1=_0x3bb1f1||0xcc;return function(_0x1857fe){if(_0x1857fe){return _0xd7a0ae[_0xa125('0x17')](_0x3bb1f1);}return _0xd7a0ae['status'](_0x3bb1f1)[_0xa125('0x18')]();};}function respondWithResult(_0x483628,_0x304da5){_0x304da5=_0x304da5||0xc8;return function(_0x222e48){if(_0x222e48){return _0x483628[_0xa125('0x19')](_0x304da5)[_0xa125('0x1a')](_0x222e48);}};}function respondWithFilteredResult(_0x389242,_0x499b44){return function(_0x3c7568){if(_0x3c7568){var _0x5d34f6=_0x3c7568['count'],_0x447b6a=_0x499b44[_0xa125('0x1b')],_0x5820ec=_0x499b44[_0xa125('0x1b')]+_0x499b44[_0xa125('0x1c')],_0x454de9;if(_0x5820ec>=_0x5d34f6){_0x5820ec=_0x5d34f6;_0x454de9=0xc8;}else{_0x454de9=0xce;}_0x389242[_0xa125('0x19')](_0x454de9);return _0x389242[_0xa125('0x1d')](_0xa125('0x1e'),_0x447b6a+'-'+_0x5820ec+'/'+_0x5d34f6)[_0xa125('0x1a')](_0x3c7568);}return null;};}function patchUpdates(_0x3ac439){return function(_0x198c0e){try{jsonpatch[_0xa125('0x1f')](_0x198c0e,_0x3ac439,!![]);}catch(_0x595cff){return BPromise[_0xa125('0x20')](_0x595cff);}return _0x198c0e[_0xa125('0x21')]();};}function saveUpdates(_0x446ace,_0x4f97d7){return function(_0x1a0d30){if(_0x1a0d30){return _0x1a0d30[_0xa125('0x22')](_0x446ace)['then'](function(_0x107a83){return _0x107a83;});}return null;};}function removeEntity(_0x56e044,_0x1bab6a){return function(_0x44ff01){if(_0x44ff01){return _0x44ff01[_0xa125('0x23')]()[_0xa125('0x24')](function(){_0x56e044[_0xa125('0x19')](0xcc)[_0xa125('0x18')]();});}};}function handleEntityNotFound(_0x7ae788,_0x10217b){return function(_0x8b3bf2){if(!_0x8b3bf2){_0x7ae788[_0xa125('0x17')](0x194);}return _0x8b3bf2;};}function handleError(_0x2f0e6e,_0x44aede){_0x44aede=_0x44aede||0x1f4;return function(_0x32945c){logger['error'](_0x32945c['stack']);if(_0x32945c[_0xa125('0x25')]){delete _0x32945c['name'];}_0x2f0e6e[_0xa125('0x19')](_0x44aede)['send'](_0x32945c);};}var utilLicense=require('../../config/license/util');exports[_0xa125('0x26')]=function(_0x1d1d8a,_0x2197cd){var _0x378f05={'raw':!![],'where':{'id':0x1}},_0x377fc3={};_0x377fc3[_0xa125('0x27')]=_['keys'](db[_0xa125('0x28')][_0xa125('0x29')]);_0x377fc3[_0xa125('0x2a')]=_['keys'](_0x1d1d8a[_0xa125('0x2a')]);_0x377fc3['filters']=_[_0xa125('0x2b')](_0x377fc3[_0xa125('0x27')],_0x377fc3[_0xa125('0x2a')]);_0x378f05[_0xa125('0x2c')]=_['intersection'](_0x377fc3[_0xa125('0x27')],qs[_0xa125('0x2d')](_0x1d1d8a[_0xa125('0x2a')][_0xa125('0x2d')]));_0x378f05[_0xa125('0x2c')]=_0x378f05[_0xa125('0x2c')][_0xa125('0x2e')]?_0x378f05[_0xa125('0x2c')]:_0x377fc3['model'];_0x378f05=_[_0xa125('0x2f')]({},_0x378f05,_0x1d1d8a[_0xa125('0x30')]);return utilLicense[_0xa125('0x31')](_0x378f05)[_0xa125('0x24')](respondWithResult(_0x2197cd,null))[_0xa125('0x32')](handleError(_0x2197cd,null));};exports[_0xa125('0x22')]=function(_0x24bce9,_0x3703f8){if(_0x24bce9['body']['id']){delete _0x24bce9[_0xa125('0x33')]['id'];}return db[_0xa125('0x28')][_0xa125('0x34')]({'where':{'id':_0x24bce9[_0xa125('0x35')]['id']}})[_0xa125('0x24')](handleEntityNotFound(_0x3703f8,null))[_0xa125('0x24')](function(_0x5a1763){var _0x2c1433=_0x5a1763[_0xa125('0x36')]({'plain':!![]});return utilLicense[_0xa125('0x37')](_0x2c1433,_0x24bce9[_0xa125('0x33')][_0xa125('0x38')]);})['then'](function(_0x45bf80){if(!_0x45bf80[_0xa125('0x39')]){return saveUpdates(_0x24bce9[_0xa125('0x33')],null);}return _0x45bf80;})[_0xa125('0x24')](respondWithResult(_0x3703f8,null))[_0xa125('0x32')](handleError(_0x3703f8,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index a068870..fc652f7 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 _0xeb3a=['exports','define','license','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./license.attributes'];(function(_0x2f227c,_0x360c3a){var _0x5032bc=function(_0x824bb){while(--_0x824bb){_0x2f227c['push'](_0x2f227c['shift']());}};_0x5032bc(++_0x360c3a);}(_0xeb3a,0x12f));var _0xaeb3=function(_0x2a0cef,_0x30cd29){_0x2a0cef=_0x2a0cef-0x0;var _0x325cb4=_0xeb3a[_0x2a0cef];return _0x325cb4;};'use strict';var _=require(_0xaeb3('0x0'));var util=require(_0xaeb3('0x1'));var logger=require(_0xaeb3('0x2'))(_0xaeb3('0x3'));var moment=require(_0xaeb3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaeb3('0x5'));var rimraf=require(_0xaeb3('0x6'));var config=require(_0xaeb3('0x7'));var attributes=require(_0xaeb3('0x8'));module[_0xaeb3('0x9')]=function(_0x45d14c,_0x1fdc7c){return _0x45d14c[_0xaeb3('0xa')]('License',attributes,{'tableName':_0xaeb3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf567=['../../config/logger','api','moment','bluebird','path','rimraf','define','License','lodash','util'];(function(_0x581011,_0x1c9c2c){var _0x1aa620=function(_0x34c64d){while(--_0x34c64d){_0x581011['push'](_0x581011['shift']());}};_0x1aa620(++_0x1c9c2c);}(_0xf567,0xbc));var _0x7f56=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf567[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var logger=require(_0x7f56('0x2'))(_0x7f56('0x3'));var moment=require(_0x7f56('0x4'));var BPromise=require(_0x7f56('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f56('0x6'));var rimraf=require(_0x7f56('0x7'));var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x5e58d3,_0x4b86fe){return _0x5e58d3[_0x7f56('0x8')](_0x7f56('0x9'),attributes,{'tableName':'license','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 3730cf3..7a5ee72 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 _0xaaa2=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','License,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird'];(function(_0x33091c,_0x282a36){var _0xf4197a=function(_0x1160dd){while(--_0x1160dd){_0x33091c['push'](_0x33091c['shift']());}};_0xf4197a(++_0x282a36);}(_0xaaa2,0xac));var _0x2aaa=function(_0x315efd,_0x253fef){_0x315efd=_0x315efd-0x0;var _0x581164=_0xaaa2[_0x315efd];return _0x581164;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var moment=require(_0x2aaa('0x2'));var BPromise=require(_0x2aaa('0x3'));var rs=require(_0x2aaa('0x4'));var fs=require('fs');var Redis=require(_0x2aaa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2aaa('0x6'));var logger=require('../../config/logger')(_0x2aaa('0x7'));var config=require(_0x2aaa('0x8'));var jayson=require(_0x2aaa('0x9'));var client=jayson[_0x2aaa('0xa')][_0x2aaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106af9,_0x4f51e6,_0x2f16d7){return new BPromise(function(_0x514c32,_0x505fe8){return client[_0x2aaa('0xc')](_0x106af9,_0x2f16d7)['then'](function(_0x1ad6e9){logger['info']('License,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));logger[_0x2aaa('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'),JSON[_0x2aaa('0xf')](_0x1ad6e9));if(_0x1ad6e9[_0x2aaa('0x10')]){if(_0x1ad6e9['error'][_0x2aaa('0x11')]===0x1f4){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x505fe8(_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);}logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x514c32(_0x1ad6e9[_0x2aaa('0x10')]['message']);}else{logger[_0x2aaa('0x14')]('License,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));_0x514c32(_0x1ad6e9[_0x2aaa('0x15')]['message']);}})['catch'](function(_0x50a767){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x50a767);_0x505fe8(_0x50a767);});});} \ No newline at end of file +var _0xec56=['http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xec56,0x1bd));var _0x6ec5=function(_0xb71fec,_0x27b9ff){_0xb71fec=_0xb71fec-0x0;var _0x6c3c2c=_0xec56[_0xb71fec];return _0x6c3c2c;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ec5('0x1'));var rs=require(_0x6ec5('0x2'));var fs=require('fs');var Redis=require(_0x6ec5('0x3'));var db=require(_0x6ec5('0x4'))['db'];var utils=require(_0x6ec5('0x5'));var logger=require(_0x6ec5('0x6'))(_0x6ec5('0x7'));var config=require(_0x6ec5('0x8'));var jayson=require(_0x6ec5('0x9'));var client=jayson[_0x6ec5('0xa')][_0x6ec5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bb683,_0x35be4e,_0x1f59cd){return new BPromise(function(_0x3dd891,_0x225d2f){return client[_0x6ec5('0xc')](_0x3bb683,_0x1f59cd)[_0x6ec5('0xd')](function(_0x3ff17c){logger['info'](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));logger[_0x6ec5('0x10')](_0x6ec5('0x11'),_0x35be4e,_0x6ec5('0xf'),JSON[_0x6ec5('0x12')](_0x3ff17c));if(_0x3ff17c[_0x6ec5('0x13')]){if(_0x3ff17c['error'][_0x6ec5('0x14')]===0x1f4){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);return _0x225d2f(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}logger[_0x6ec5('0x13')]('License,\x20%s,\x20%s',_0x35be4e,_0x3ff17c[_0x6ec5('0x13')]['message']);return _0x3dd891(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}else{logger[_0x6ec5('0x16')](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));_0x3dd891(_0x3ff17c['result'][_0x6ec5('0x15')]);}})[_0x6ec5('0x17')](function(_0x125ae6){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x125ae6);_0x225d2f(_0x125ae6);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 081a36d..66b7386 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 _0xaecb=['verifySmtp','getAgents','post','/:id/canned_answers','addAnswer','create','addImap','addSmtp','addInteraction','/:id/send','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeImap','removeSmtp','removeAgents','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages'];(function(_0x3c25dc,_0x3b07f7){var _0x25810c=function(_0x32457c){while(--_0x32457c){_0x3c25dc['push'](_0x3c25dc['shift']());}};_0x25810c(++_0x3b07f7);}(_0xaecb,0x15e));var _0xbaec=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xaecb[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xbaec('0x0'));var util=require('util');var path=require(_0xbaec('0x1'));var timeout=require(_0xbaec('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbaec('0x3'));var auth=require(_0xbaec('0x4'));var interaction=require(_0xbaec('0x5'));var config=require(_0xbaec('0x6'));var controller=require(_0xbaec('0x7'));router[_0xbaec('0x8')]('/',auth[_0xbaec('0x9')](),controller[_0xbaec('0xa')]);router[_0xbaec('0x8')](_0xbaec('0xb'),auth[_0xbaec('0x9')](),controller[_0xbaec('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbaec('0xd')]);router[_0xbaec('0x8')](_0xbaec('0xe'),auth[_0xbaec('0x9')](),controller[_0xbaec('0xf')]);router[_0xbaec('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xbaec('0x10')]);router[_0xbaec('0x8')](_0xbaec('0x11'),auth['isAuthenticated'](),controller['getImap']);router[_0xbaec('0x8')](_0xbaec('0x12'),auth['isAuthenticated'](),controller[_0xbaec('0x13')]);router[_0xbaec('0x8')](_0xbaec('0x14'),auth[_0xbaec('0x9')](),controller[_0xbaec('0x15')]);router[_0xbaec('0x8')](_0xbaec('0x16'),auth[_0xbaec('0x9')](),controller[_0xbaec('0x17')]);router['get'](_0xbaec('0x18'),auth[_0xbaec('0x9')](),controller[_0xbaec('0x19')]);router[_0xbaec('0x8')]('/:id/verify',auth[_0xbaec('0x9')](),controller[_0xbaec('0x1a')]);router['get']('/:id/users',auth[_0xbaec('0x9')](),controller[_0xbaec('0x1b')]);router['post'](_0xbaec('0xe'),auth[_0xbaec('0x9')](),controller['addDisposition']);router[_0xbaec('0x1c')](_0xbaec('0x1d'),auth[_0xbaec('0x9')](),controller[_0xbaec('0x1e')]);router['post']('/',auth[_0xbaec('0x9')](),controller[_0xbaec('0x1f')]);router[_0xbaec('0x1c')]('/:id/in_servers',auth[_0xbaec('0x9')](),controller[_0xbaec('0x20')]);router[_0xbaec('0x1c')]('/:id/out_servers',auth[_0xbaec('0x9')](),controller[_0xbaec('0x21')]);router[_0xbaec('0x1c')](_0xbaec('0x14'),auth[_0xbaec('0x9')](),controller[_0xbaec('0x22')]);router['post'](_0xbaec('0x16'),auth[_0xbaec('0x9')](),controller['addApplications']);router['post'](_0xbaec('0x23'),auth['isAuthenticated'](),controller['send']);router[_0xbaec('0x1c')](_0xbaec('0x24'),auth['isAuthenticated'](),controller[_0xbaec('0x25')]);router[_0xbaec('0x26')](_0xbaec('0x27'),auth[_0xbaec('0x9')](),controller[_0xbaec('0x28')]);router[_0xbaec('0x29')](_0xbaec('0xe'),auth['isAuthenticated'](),controller[_0xbaec('0x2a')]);router[_0xbaec('0x29')]('/:id/canned_answers',auth[_0xbaec('0x9')](),controller['removeAnswers']);router[_0xbaec('0x29')](_0xbaec('0x11'),auth[_0xbaec('0x9')](),controller[_0xbaec('0x2b')]);router[_0xbaec('0x29')](_0xbaec('0x12'),auth[_0xbaec('0x9')](),controller[_0xbaec('0x2c')]);router[_0xbaec('0x29')](_0xbaec('0x27'),auth['isAuthenticated'](),controller['destroy']);router[_0xbaec('0x29')]('/:id/users',auth[_0xbaec('0x9')](),controller[_0xbaec('0x2d')]);module[_0xbaec('0x2e')]=router; \ No newline at end of file +var _0x00f3=['verifySmtp','/:id/users','getAgents','post','addDisposition','create','/:id/in_servers','addImap','addSmtp','addInteraction','addApplications','/:id/send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','connect-timeout','Router','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','/:id/messages','getMessages'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x00f3,0x1cc));var _0x300f=function(_0x40b676,_0x395f00){_0x40b676=_0x40b676-0x0;var _0x2ef962=_0x00f3[_0x40b676];return _0x2ef962;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x300f('0x0'));var express=require('express');var router=express[_0x300f('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x300f('0x2'));var controller=require(_0x300f('0x3'));router[_0x300f('0x4')]('/',auth[_0x300f('0x5')](),controller[_0x300f('0x6')]);router[_0x300f('0x4')](_0x300f('0x7'),auth[_0x300f('0x5')](),controller[_0x300f('0x8')]);router[_0x300f('0x4')](_0x300f('0x9'),auth[_0x300f('0x5')](),controller[_0x300f('0xa')]);router[_0x300f('0x4')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x300f('0x4')](_0x300f('0xb'),auth[_0x300f('0x5')](),controller[_0x300f('0xc')]);router[_0x300f('0x4')]('/:id/in_servers',auth[_0x300f('0x5')](),controller[_0x300f('0xd')]);router['get'](_0x300f('0xe'),auth['isAuthenticated'](),controller[_0x300f('0xf')]);router[_0x300f('0x4')](_0x300f('0x10'),auth[_0x300f('0x5')](),controller['getInteractions']);router[_0x300f('0x4')](_0x300f('0x11'),auth[_0x300f('0x5')](),controller['getApplications']);router[_0x300f('0x4')](_0x300f('0x12'),auth[_0x300f('0x5')](),controller[_0x300f('0x13')]);router[_0x300f('0x4')]('/:id/verify',auth[_0x300f('0x5')](),controller[_0x300f('0x14')]);router[_0x300f('0x4')](_0x300f('0x15'),auth['isAuthenticated'](),controller[_0x300f('0x16')]);router[_0x300f('0x17')]('/:id/dispositions',auth[_0x300f('0x5')](),controller[_0x300f('0x18')]);router[_0x300f('0x17')]('/:id/canned_answers',auth[_0x300f('0x5')](),controller['addAnswer']);router[_0x300f('0x17')]('/',auth['isAuthenticated'](),controller[_0x300f('0x19')]);router[_0x300f('0x17')](_0x300f('0x1a'),auth[_0x300f('0x5')](),controller[_0x300f('0x1b')]);router[_0x300f('0x17')](_0x300f('0xe'),auth[_0x300f('0x5')](),controller[_0x300f('0x1c')]);router['post']('/:id/interactions',auth[_0x300f('0x5')](),controller[_0x300f('0x1d')]);router[_0x300f('0x17')](_0x300f('0x11'),auth[_0x300f('0x5')](),controller[_0x300f('0x1e')]);router[_0x300f('0x17')](_0x300f('0x1f'),auth['isAuthenticated'](),controller['send']);router[_0x300f('0x17')](_0x300f('0x15'),auth[_0x300f('0x5')](),controller[_0x300f('0x20')]);router[_0x300f('0x21')](_0x300f('0x9'),auth[_0x300f('0x5')](),controller['update']);router[_0x300f('0x22')]('/:id/dispositions',auth[_0x300f('0x5')](),controller[_0x300f('0x23')]);router[_0x300f('0x22')](_0x300f('0xb'),auth['isAuthenticated'](),controller[_0x300f('0x24')]);router['delete'](_0x300f('0x1a'),auth['isAuthenticated'](),controller[_0x300f('0x25')]);router[_0x300f('0x22')](_0x300f('0xe'),auth[_0x300f('0x5')](),controller['removeSmtp']);router['delete'](_0x300f('0x9'),auth[_0x300f('0x5')](),controller[_0x300f('0x26')]);router[_0x300f('0x22')](_0x300f('0x15'),auth[_0x300f('0x5')](),controller[_0x300f('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 68cddc9..c5f2249 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 _0x1a40=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER'];(function(_0x52252d,_0x2bf42c){var _0x2ddef6=function(_0x52e454){while(--_0x52e454){_0x52252d['push'](_0x52252d['shift']());}};_0x2ddef6(++_0x2bf42c);}(_0x1a40,0x12c));var _0x01a4=function(_0x212c4e,_0x478f13){_0x212c4e=_0x212c4e-0x0;var _0xf0fa12=_0x1a40[_0x212c4e];return _0xf0fa12;};'use strict';var Sequelize=require('sequelize');module[_0x01a4('0x0')]={'description':{'type':Sequelize[_0x01a4('0x1')]},'name':{'type':Sequelize[_0x01a4('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x01a4('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x01a4('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x01a4('0x3')]},'markAsUnread':{'type':Sequelize[_0x01a4('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x01a4('0x1')],'allowNull':![],'defaultValue':_0x01a4('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x01a4('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x01a4('0x3')],'defaultValue':function(){return _0x01a4('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x01a4('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x01a4('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x01a4('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x01a4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x01a4('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4a40bc){if(!_0x4a40bc)this['setDataValue'](_0x01a4('0x8'),null);this[_0x01a4('0x9')](_0x01a4('0xa'),_0x4a40bc);}}}; \ No newline at end of file +var _0x7036=['BOOLEAN','INTEGER','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING'];(function(_0x22fb88,_0x465373){var _0xf9dc56=function(_0x293360){while(--_0x293360){_0x22fb88['push'](_0x22fb88['shift']());}};_0xf9dc56(++_0x465373);}(_0x7036,0x6c));var _0x6703=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0x7036[_0x3ad7ad];return _0x225a60;};'use strict';var Sequelize=require('sequelize');module[_0x6703('0x0')]={'description':{'type':Sequelize[_0x6703('0x1')]},'name':{'type':Sequelize[_0x6703('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x6703('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x6703('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x6703('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x6703('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x6703('0x3')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6703('0x4')],'defaultValue':function(){return _0x6703('0x5');}},'notificationSound':{'type':Sequelize[_0x6703('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6703('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6703('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6703('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6703('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6703('0x3')],'allowNull':!![],'defaultValue':null,'comment':_0x6703('0x6')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6703('0x7'),'set':function(_0x4dfd5e){if(!_0x4dfd5e)this[_0x6703('0x8')](_0x6703('0x9'),null);this[_0x6703('0x8')](_0x6703('0xa'),_0x4dfd5e);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 19d8944..282f5a6 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 _0x7a54=['Smtp','pass','host','port','service','cpassword','get','UserProfileSection','getImap','addImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','MailApplication','destroy','bulkCreate','priority','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','send','CmList','List','Contacts','DESC','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','authentication','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','html-to-text','juice','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','Content-Range','reject','save','update','MailAccounts','UserProfileResource','then','sendStatus','stack','name','index','Imap','MailServerOut','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','includeAll','include','MailAccount','findAll','show','MailServerIn','options','body','find','params','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','length','hasOwnProperty','order','rows','removeDispositions','ids','CannedAnswer','create','getAnswers','removeAnswers','email','isNil','active','description','cservice','cauthentication','user','password'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x7a54,0x106));var _0x47a5=function(_0x1a2e40,_0x46db25){_0x1a2e40=_0x1a2e40-0x0;var _0x554392=_0x7a54[_0x1a2e40];return _0x554392;};'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 htmlToText=require(_0x47a5('0xe'));var juice=require(_0x47a5('0xf'));var Redis=require('ioredis');var authService=require(_0x47a5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47a5('0x11'));var logger=require(_0x47a5('0x12'))(_0x47a5('0x13'));var utils=require(_0x47a5('0x14'));var config=require(_0x47a5('0x15'));var licenseUtil=require(_0x47a5('0x16'));var db=require(_0x47a5('0x17'))['db'];config['redis']=_[_0x47a5('0x18')](config[_0x47a5('0x19')],{'host':_0x47a5('0x1a'),'port':0x18eb});var socket=require(_0x47a5('0x1b'))(new Redis(config[_0x47a5('0x19')]));require(_0x47a5('0x1c'))[_0x47a5('0x1d')](socket);var jayson=require(_0x47a5('0x1e'));var client=jayson['client'][_0x47a5('0x1f')]({'port':0x232b});function respondWithRpcPromise(_0x11faf5,_0x3b001e,_0x2a2cbb,_0x1ef44c){return new BPromise(function(_0x574af6,_0x549de3){var _0x138bc0=_0x1ef44c||client;return _0x138bc0['request'](_0x11faf5,_0x2a2cbb)['then'](function(_0x423a81){logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x3b001e,_0x47a5('0x22'));logger[_0x47a5('0x23')](_0x47a5('0x24'),_0x3b001e,_0x47a5('0x22'),JSON[_0x47a5('0x25')](_0x423a81));if(_0x423a81[_0x47a5('0x26')]){if(_0x423a81['error'][_0x47a5('0x27')]===0x1f4){logger[_0x47a5('0x26')]('MailAccount,\x20%s,\x20%s',_0x3b001e,_0x423a81[_0x47a5('0x26')][_0x47a5('0x28')]);return _0x549de3(_0x423a81[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x21'),_0x3b001e,_0x423a81[_0x47a5('0x26')][_0x47a5('0x28')]);return _0x574af6(_0x423a81['error'][_0x47a5('0x28')]);}else{logger[_0x47a5('0x20')]('MailAccount,\x20%s,\x20%s',_0x3b001e,_0x47a5('0x22'));_0x574af6(_0x423a81[_0x47a5('0x29')][_0x47a5('0x28')]);}})[_0x47a5('0x2a')](function(_0x3abd6a){logger['error']('MailAccount,\x20%s,\x20%s',_0x3b001e,_0x3abd6a);_0x549de3(_0x3abd6a);});});}function respondWithStatusCode(_0x136745,_0x5686db){_0x5686db=_0x5686db||0xcc;return function(_0x1ea9c8){if(_0x1ea9c8){return _0x136745['sendStatus'](_0x5686db);}return _0x136745[_0x47a5('0x2b')](_0x5686db)[_0x47a5('0x2c')]();};}function respondWithResult(_0x36ad34,_0x1dac65){_0x1dac65=_0x1dac65||0xc8;return function(_0x21f296){if(_0x21f296){return _0x36ad34[_0x47a5('0x2b')](_0x1dac65)[_0x47a5('0x2d')](_0x21f296);}};}function respondWithFilteredResult(_0x136b14,_0x16631f){return function(_0x361bfa){if(_0x361bfa){var _0x1127f8=_0x361bfa[_0x47a5('0x2e')],_0x11a4fa=_0x16631f['offset'],_0x3ad507=_0x16631f[_0x47a5('0x2f')]+_0x16631f[_0x47a5('0x30')],_0x528582;if(_0x3ad507>=_0x1127f8){_0x3ad507=_0x1127f8;_0x528582=0xc8;}else{_0x528582=0xce;}_0x136b14[_0x47a5('0x2b')](_0x528582);return _0x136b14['set'](_0x47a5('0x31'),_0x11a4fa+'-'+_0x3ad507+'/'+_0x1127f8)[_0x47a5('0x2d')](_0x361bfa);}return null;};}function patchUpdates(_0x39b50b){return function(_0x1f1c68){try{jsonpatch['apply'](_0x1f1c68,_0x39b50b,!![]);}catch(_0x50d875){return BPromise[_0x47a5('0x32')](_0x50d875);}return _0x1f1c68[_0x47a5('0x33')]();};}function saveUpdates(_0x5bd7eb,_0x4e1006){return function(_0x836303){if(_0x836303){return _0x836303[_0x47a5('0x34')](_0x5bd7eb)['then'](function(_0x42f70c){return _0x42f70c;});}return null;};}function removeEntity(_0x53119b,_0x122ed6){return function(_0xd972c){if(_0xd972c){return _0xd972c['destroy']()['then'](function(){var _0x274e34=_0xd972c['get']({'plain':!![]});var _0x403028=_0x47a5('0x35');return db[_0x47a5('0x36')]['destroy']({'where':{'type':_0x403028,'resourceId':_0x274e34['id']}})[_0x47a5('0x37')](function(){return _0xd972c;});})['then'](function(){_0x53119b['status'](0xcc)[_0x47a5('0x2c')]();});}};}function handleEntityNotFound(_0x5a8a7c,_0x25cce0){return function(_0x5ef577){if(!_0x5ef577){_0x5a8a7c[_0x47a5('0x38')](0x194);}return _0x5ef577;};}function handleError(_0x3534cb,_0x38c8d4){_0x38c8d4=_0x38c8d4||0x1f4;return function(_0x199698){logger[_0x47a5('0x26')](_0x199698[_0x47a5('0x39')]);if(_0x199698[_0x47a5('0x3a')]){delete _0x199698[_0x47a5('0x3a')];}_0x3534cb[_0x47a5('0x2b')](_0x38c8d4)['send'](_0x199698);};}exports[_0x47a5('0x3b')]=function(_0x10f136,_0x511c06){var _0x2c50d6={'include':[{'model':db['MailServerIn'],'as':_0x47a5('0x3c')},{'model':db[_0x47a5('0x3d')],'as':'Smtp'},{'model':db[_0x47a5('0x3e')],'as':_0x47a5('0x3f')}]},_0x2bf53d={},_0x1d4348={'count':0x0,'rows':[]};var _0x54ae35=_['map'](db['MailAccount'][_0x47a5('0x40')],function(_0x5c569e){return{'name':_0x5c569e[_0x47a5('0x41')],'type':_0x5c569e[_0x47a5('0x42')][_0x47a5('0x43')]};});_0x2bf53d[_0x47a5('0x44')]=_[_0x47a5('0x45')](_0x54ae35,_0x47a5('0x3a'));_0x2bf53d[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0x10f136[_0x47a5('0x46')]);_0x2bf53d[_0x47a5('0x48')]=_[_0x47a5('0x49')](_0x2bf53d[_0x47a5('0x44')],_0x2bf53d[_0x47a5('0x46')]);_0x2c50d6['attributes']=_[_0x47a5('0x49')](_0x2bf53d[_0x47a5('0x44')],qs[_0x47a5('0x4a')](_0x10f136[_0x47a5('0x46')]['fields']));_0x2c50d6[_0x47a5('0x4b')]=_0x2c50d6['attributes']['length']?_0x2c50d6['attributes']:_0x2bf53d['model'];if(!_0x10f136[_0x47a5('0x46')]['hasOwnProperty'](_0x47a5('0x4c'))){_0x2c50d6[_0x47a5('0x30')]=qs[_0x47a5('0x30')](_0x10f136['query'][_0x47a5('0x30')]);_0x2c50d6[_0x47a5('0x2f')]=qs['offset'](_0x10f136['query'][_0x47a5('0x2f')]);}_0x2c50d6['order']=qs[_0x47a5('0x4d')](_0x10f136[_0x47a5('0x46')][_0x47a5('0x4d')]);_0x2c50d6[_0x47a5('0x4e')]=qs[_0x47a5('0x48')](_[_0x47a5('0x4f')](_0x10f136[_0x47a5('0x46')],_0x2bf53d[_0x47a5('0x48')]),_0x54ae35);if(_0x10f136[_0x47a5('0x46')][_0x47a5('0x50')]){_0x2c50d6[_0x47a5('0x4e')]=_[_0x47a5('0x51')](_0x2c50d6[_0x47a5('0x4e')],{'$or':_[_0x47a5('0x45')](_0x54ae35,function(_0x4e5e7){if(_0x4e5e7[_0x47a5('0x42')]!=='VIRTUAL'){var _0x2d38de={};_0x2d38de[_0x4e5e7[_0x47a5('0x3a')]]={'$like':'%'+_0x10f136['query']['filter']+'%'};return _0x2d38de;}})});}_0x2c50d6=_[_0x47a5('0x51')]({},_0x2c50d6,_0x10f136['options']);var _0x13750d={'where':_0x2c50d6[_0x47a5('0x4e')]};return db['MailAccount']['count'](_0x13750d)[_0x47a5('0x37')](function(_0x52d409){_0x1d4348[_0x47a5('0x2e')]=_0x52d409;if(_0x10f136[_0x47a5('0x46')][_0x47a5('0x52')]){_0x2c50d6[_0x47a5('0x53')]=[{'all':!![]}];}return db[_0x47a5('0x54')][_0x47a5('0x55')](_0x2c50d6);})[_0x47a5('0x37')](function(_0x53e994){_0x1d4348['rows']=_0x53e994;return _0x1d4348;})[_0x47a5('0x37')](respondWithFilteredResult(_0x511c06,_0x2c50d6))[_0x47a5('0x2a')](handleError(_0x511c06,null));};exports[_0x47a5('0x56')]=function(_0x9ea93e,_0x2c7020){var _0x2c0c86={'raw':![],'where':{'id':_0x9ea93e['params']['id']},'include':[{'model':db[_0x47a5('0x57')],'as':_0x47a5('0x3c')},{'model':db[_0x47a5('0x3d')],'as':'Smtp'},{'model':db[_0x47a5('0x3e')],'as':'mandatoryDispositionPause'}]},_0x249de5={};_0x249de5[_0x47a5('0x44')]=_[_0x47a5('0x47')](db[_0x47a5('0x54')][_0x47a5('0x40')]);_0x249de5['query']=_[_0x47a5('0x47')](_0x9ea93e[_0x47a5('0x46')]);_0x249de5[_0x47a5('0x48')]=_[_0x47a5('0x49')](_0x249de5[_0x47a5('0x44')],_0x249de5[_0x47a5('0x46')]);_0x2c0c86[_0x47a5('0x4b')]=_['intersection'](_0x249de5[_0x47a5('0x44')],qs[_0x47a5('0x4a')](_0x9ea93e[_0x47a5('0x46')][_0x47a5('0x4a')]));_0x2c0c86[_0x47a5('0x4b')]=_0x2c0c86[_0x47a5('0x4b')]['length']?_0x2c0c86[_0x47a5('0x4b')]:_0x249de5[_0x47a5('0x44')];if(_0x9ea93e[_0x47a5('0x46')]['includeAll']){_0x2c0c86[_0x47a5('0x53')]=[{'all':!![]}];}_0x2c0c86=_[_0x47a5('0x51')]({},_0x2c0c86,_0x9ea93e[_0x47a5('0x58')]);return db['MailAccount']['find'](_0x2c0c86)[_0x47a5('0x37')](handleEntityNotFound(_0x2c7020,null))[_0x47a5('0x37')](respondWithResult(_0x2c7020,null))['catch'](handleError(_0x2c7020,null));};exports['update']=function(_0x6d6b2b,_0x4d6a82){if(_0x6d6b2b[_0x47a5('0x59')]['id']){delete _0x6d6b2b['body']['id'];}return db['MailAccount'][_0x47a5('0x5a')]({'where':{'id':_0x6d6b2b[_0x47a5('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x47a5('0x3c')},{'model':db[_0x47a5('0x3d')],'as':'Smtp'},{'model':db['Pause'],'as':_0x47a5('0x3f')}]})[_0x47a5('0x37')](handleEntityNotFound(_0x4d6a82,null))[_0x47a5('0x37')](saveUpdates(_0x6d6b2b[_0x47a5('0x59')],null))['then'](function(_0x199621){if(_0x199621&&_0x6d6b2b[_0x47a5('0x59')][_0x47a5('0x3c')]){return db['MailServerIn'][_0x47a5('0x34')](_0x6d6b2b['body'][_0x47a5('0x3c')],{'where':{'MailAccountId':_0x199621['id']}})[_0x47a5('0x37')](function(){return _0x199621;});}return _0x199621;})[_0x47a5('0x37')](function(_0x1c485b){if(_0x1c485b&&_0x6d6b2b[_0x47a5('0x59')]['Smtp']){return db[_0x47a5('0x3d')]['update'](_0x6d6b2b['body']['Smtp'],{'where':{'MailAccountId':_0x1c485b['id']}})['then'](function(){return _0x1c485b;});}return _0x1c485b;})[_0x47a5('0x37')](respondWithResult(_0x4d6a82,null))[_0x47a5('0x2a')](handleError(_0x4d6a82,null));};exports[_0x47a5('0x5c')]=function(_0x52e3ee,_0x4d3db1){return db[_0x47a5('0x54')][_0x47a5('0x5c')]()[_0x47a5('0x37')](respondWithResult(_0x4d3db1,null))[_0x47a5('0x2a')](handleError(_0x4d3db1,null));};exports[_0x47a5('0x5d')]=function(_0x4b5d0c,_0x3474b7,_0x519e9e){if(_0x4b5d0c[_0x47a5('0x59')]['id']){delete _0x4b5d0c[_0x47a5('0x59')]['id'];}return db['MailAccount'][_0x47a5('0x5a')]({'where':{'id':_0x4b5d0c[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x3474b7,null))[_0x47a5('0x37')](function(_0x2d6494){if(_0x2d6494){_0x4b5d0c[_0x47a5('0x59')][_0x47a5('0x5e')]=_0x2d6494['id'];return db[_0x47a5('0x5f')]['create'](_0x4b5d0c[_0x47a5('0x59')]);}})[_0x47a5('0x37')](respondWithResult(_0x3474b7,null))[_0x47a5('0x2a')](handleError(_0x3474b7,null));};exports[_0x47a5('0x60')]=function(_0x396cb0,_0x4bbe14,_0xbec033){var _0xdfcecc={'raw':![],'where':{}};var _0x1224bc={};var _0x144aaa={'count':0x0,'rows':[]};return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x396cb0[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x4bbe14,null))[_0x47a5('0x37')](function(_0x44cb90){if(_0x44cb90){_0x1224bc[_0x47a5('0x44')]=_[_0x47a5('0x47')](db[_0x47a5('0x5f')][_0x47a5('0x40')]);_0x1224bc[_0x47a5('0x46')]=_['keys'](_0x396cb0[_0x47a5('0x46')]);_0x1224bc[_0x47a5('0x48')]=_[_0x47a5('0x49')](_0x1224bc['model'],_0x1224bc[_0x47a5('0x46')]);_0xdfcecc[_0x47a5('0x4b')]=_[_0x47a5('0x49')](_0x1224bc[_0x47a5('0x44')],qs['fields'](_0x396cb0[_0x47a5('0x46')]['fields']));_0xdfcecc[_0x47a5('0x4b')]=_0xdfcecc['attributes'][_0x47a5('0x62')]?_0xdfcecc['attributes']:_0x1224bc[_0x47a5('0x44')];if(!_0x396cb0[_0x47a5('0x46')][_0x47a5('0x63')]('nolimit')){_0xdfcecc['limit']=qs['limit'](_0x396cb0[_0x47a5('0x46')][_0x47a5('0x30')]);_0xdfcecc[_0x47a5('0x2f')]=qs[_0x47a5('0x2f')](_0x396cb0['query'][_0x47a5('0x2f')]);}_0xdfcecc[_0x47a5('0x64')]=qs[_0x47a5('0x4d')](_0x396cb0[_0x47a5('0x46')][_0x47a5('0x4d')]);_0xdfcecc[_0x47a5('0x4e')]=qs[_0x47a5('0x48')](_[_0x47a5('0x4f')](_0x396cb0[_0x47a5('0x46')],_0x1224bc[_0x47a5('0x48')]));_0xdfcecc[_0x47a5('0x4e')][_0x47a5('0x5e')]=_0x44cb90['id'];if(_0x396cb0['query'][_0x47a5('0x50')]){_0xdfcecc['where']=_[_0x47a5('0x51')](_0xdfcecc[_0x47a5('0x4e')],{'$or':_[_0x47a5('0x45')](_0xdfcecc[_0x47a5('0x4b')],function(_0x40e584){var _0xa9c853={};_0xa9c853[_0x40e584]={'$like':'%'+_0x396cb0[_0x47a5('0x46')][_0x47a5('0x50')]+'%'};return _0xa9c853;})});}_0xdfcecc=_[_0x47a5('0x51')]({},_0xdfcecc,_0x396cb0[_0x47a5('0x58')]);return db[_0x47a5('0x5f')][_0x47a5('0x2e')]({'where':_0xdfcecc[_0x47a5('0x4e')]})[_0x47a5('0x37')](function(_0x441d64){_0x144aaa['count']=_0x441d64;if(_0x396cb0['query']['includeAll']){_0xdfcecc['include']=[{'all':!![]}];}return db[_0x47a5('0x5f')][_0x47a5('0x55')](_0xdfcecc);})['then'](function(_0x732e00){_0x144aaa[_0x47a5('0x65')]=_0x732e00;return _0x144aaa;});}})[_0x47a5('0x37')](respondWithFilteredResult(_0x4bbe14,_0xdfcecc))[_0x47a5('0x2a')](handleError(_0x4bbe14,null));};exports[_0x47a5('0x66')]=function(_0x930d25,_0x218dfa,_0x1c7302){return db[_0x47a5('0x54')][_0x47a5('0x5a')]({'where':{'id':_0x930d25[_0x47a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x218dfa,null))[_0x47a5('0x37')](function(_0x1fbd42){if(_0x1fbd42){return _0x1fbd42[_0x47a5('0x66')](_0x930d25['query'][_0x47a5('0x67')]);}})[_0x47a5('0x37')](respondWithStatusCode(_0x218dfa,null))[_0x47a5('0x2a')](handleError(_0x218dfa,null));};exports['addAnswer']=function(_0x19dc8c,_0x5205ba,_0x49d93d){if(_0x19dc8c[_0x47a5('0x59')]['id']){delete _0x19dc8c[_0x47a5('0x59')]['id'];}return db[_0x47a5('0x54')][_0x47a5('0x5a')]({'where':{'id':_0x19dc8c[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x5205ba,null))['then'](function(_0x592322){if(_0x592322){_0x19dc8c[_0x47a5('0x59')]['MailAccountId']=_0x592322['id'];return db[_0x47a5('0x68')][_0x47a5('0x69')](_0x19dc8c[_0x47a5('0x59')]);}})[_0x47a5('0x37')](respondWithResult(_0x5205ba,null))['catch'](handleError(_0x5205ba,null));};exports[_0x47a5('0x6a')]=function(_0x550bde,_0x5f3a04,_0x139c79){var _0x391f8e={'raw':![],'where':{}};var _0x5b91f7={};var _0x1926bd={'count':0x0,'rows':[]};return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x550bde['params']['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x5f3a04,null))['then'](function(_0x2307da){if(_0x2307da){_0x5b91f7[_0x47a5('0x44')]=_[_0x47a5('0x47')](db['CannedAnswer'][_0x47a5('0x40')]);_0x5b91f7[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0x550bde['query']);_0x5b91f7[_0x47a5('0x48')]=_['intersection'](_0x5b91f7[_0x47a5('0x44')],_0x5b91f7['query']);_0x391f8e[_0x47a5('0x4b')]=_[_0x47a5('0x49')](_0x5b91f7[_0x47a5('0x44')],qs[_0x47a5('0x4a')](_0x550bde['query'][_0x47a5('0x4a')]));_0x391f8e[_0x47a5('0x4b')]=_0x391f8e[_0x47a5('0x4b')][_0x47a5('0x62')]?_0x391f8e[_0x47a5('0x4b')]:_0x5b91f7['model'];if(!_0x550bde['query'][_0x47a5('0x63')]('nolimit')){_0x391f8e[_0x47a5('0x30')]=qs[_0x47a5('0x30')](_0x550bde[_0x47a5('0x46')]['limit']);_0x391f8e[_0x47a5('0x2f')]=qs[_0x47a5('0x2f')](_0x550bde['query'][_0x47a5('0x2f')]);}_0x391f8e[_0x47a5('0x64')]=qs[_0x47a5('0x4d')](_0x550bde[_0x47a5('0x46')]['sort']);_0x391f8e['where']=qs[_0x47a5('0x48')](_[_0x47a5('0x4f')](_0x550bde['query'],_0x5b91f7[_0x47a5('0x48')]));_0x391f8e[_0x47a5('0x4e')]['MailAccountId']=_0x2307da['id'];if(_0x550bde[_0x47a5('0x46')][_0x47a5('0x50')]){_0x391f8e[_0x47a5('0x4e')]=_['merge'](_0x391f8e[_0x47a5('0x4e')],{'$or':_['map'](_0x391f8e[_0x47a5('0x4b')],function(_0x5e2946){var _0x243c8b={};_0x243c8b[_0x5e2946]={'$like':'%'+_0x550bde[_0x47a5('0x46')]['filter']+'%'};return _0x243c8b;})});}_0x391f8e=_[_0x47a5('0x51')]({},_0x391f8e,_0x550bde['options']);return db[_0x47a5('0x68')][_0x47a5('0x2e')]({'where':_0x391f8e[_0x47a5('0x4e')]})[_0x47a5('0x37')](function(_0x49b76a){_0x1926bd[_0x47a5('0x2e')]=_0x49b76a;if(_0x550bde['query']['includeAll']){_0x391f8e[_0x47a5('0x53')]=[{'all':!![]}];}return db[_0x47a5('0x68')][_0x47a5('0x55')](_0x391f8e);})[_0x47a5('0x37')](function(_0x380c8b){_0x1926bd['rows']=_0x380c8b;return _0x1926bd;});}})[_0x47a5('0x37')](respondWithFilteredResult(_0x5f3a04,_0x391f8e))[_0x47a5('0x2a')](handleError(_0x5f3a04,null));};exports[_0x47a5('0x6b')]=function(_0x11b68b,_0x50b98e,_0x240db9){return db['MailAccount'][_0x47a5('0x5a')]({'where':{'id':_0x11b68b[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x50b98e,null))[_0x47a5('0x37')](function(_0x29a1cf){if(_0x29a1cf){return _0x29a1cf[_0x47a5('0x6b')](_0x11b68b[_0x47a5('0x46')][_0x47a5('0x67')]);}})[_0x47a5('0x37')](respondWithStatusCode(_0x50b98e,null))['catch'](handleError(_0x50b98e,null));};exports[_0x47a5('0x69')]=function(_0x18f8b2,_0x59266f){var _0x2fd46f={'name':_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x3a')],'key':_0x18f8b2['body']['key'],'email':_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x6c')],'ListId':_0x18f8b2['body']['ListId'],'active':!_[_0x47a5('0x6d')](_0x18f8b2[_0x47a5('0x59')]['active'])?_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x6e')]:!![],'description':_0x18f8b2['body'][_0x47a5('0x6f')]||null,'Imap':{},'Smtp':{}};if(_[_0x47a5('0x6d')](_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x70')])){if(_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x71')]){_0x2fd46f['Imap']['user']=_0x2fd46f['Smtp'][_0x47a5('0x72')]=_0x18f8b2[_0x47a5('0x59')]['cuser'];_0x2fd46f[_0x47a5('0x3c')][_0x47a5('0x73')]=_0x2fd46f[_0x47a5('0x74')][_0x47a5('0x75')]=_0x18f8b2[_0x47a5('0x59')]['cpassword'];}else{_0x2fd46f[_0x47a5('0x3c')]['authentication']=_0x2fd46f['Smtp']['authentication']=![];}_0x2fd46f[_0x47a5('0x3c')]['host']=_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x3c')][_0x47a5('0x76')];_0x2fd46f['Imap'][_0x47a5('0x77')]=_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x3c')][_0x47a5('0x77')];_0x2fd46f[_0x47a5('0x74')]['host']=_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x74')]['host'];_0x2fd46f[_0x47a5('0x74')][_0x47a5('0x77')]=_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x74')][_0x47a5('0x77')];}else{_0x2fd46f[_0x47a5('0x3c')]['service']=_0x2fd46f[_0x47a5('0x74')][_0x47a5('0x78')]=_0x18f8b2['body'][_0x47a5('0x70')];_0x2fd46f[_0x47a5('0x3c')][_0x47a5('0x72')]=_0x2fd46f[_0x47a5('0x74')]['user']=_0x18f8b2['body']['cuser'];_0x2fd46f['Imap'][_0x47a5('0x73')]=_0x2fd46f[_0x47a5('0x74')][_0x47a5('0x75')]=_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x79')];}return db[_0x47a5('0x54')][_0x47a5('0x69')](_0x2fd46f,{'include':[{'model':db[_0x47a5('0x3d')],'as':'Smtp'},{'model':db[_0x47a5('0x57')],'as':_0x47a5('0x3c')}]})[_0x47a5('0x37')](function(_0x399528){var _0x47be87=_0x18f8b2['user'][_0x47a5('0x7a')]({'plain':!![]});if(!_0x47be87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47be87['role']===_0x47a5('0x72')){var _0x3f0a15=_0x399528['get']({'plain':!![]});return db[_0x47a5('0x7b')][_0x47a5('0x5a')]({'where':{'name':_0x47a5('0x35'),'userProfileId':_0x47be87['userProfileId']},'raw':!![]})[_0x47a5('0x37')](function(_0xee23c7){if(_0xee23c7&&_0xee23c7['autoAssociation']===0x0){return db[_0x47a5('0x36')][_0x47a5('0x69')]({'name':_0x3f0a15[_0x47a5('0x3a')],'resourceId':_0x3f0a15['id'],'type':_0xee23c7[_0x47a5('0x3a')],'sectionId':_0xee23c7['id']},{})[_0x47a5('0x37')](function(){return _0x399528;});}else{return _0x399528;}})[_0x47a5('0x2a')](function(_0x482c87){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x482c87);throw _0x482c87;});}return _0x399528;})[_0x47a5('0x37')](respondWithResult(_0x59266f,0xc9))[_0x47a5('0x2a')](handleError(_0x59266f,null));};exports[_0x47a5('0x7c')]=function(_0x25f188,_0x522972,_0x3d93ad){return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x25f188[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x522972,null))[_0x47a5('0x37')](function(_0x31b8b1){if(_0x31b8b1){return _0x31b8b1[_0x47a5('0x7c')]();}return null;})[_0x47a5('0x37')](respondWithResult(_0x522972,null))[_0x47a5('0x2a')](handleError(_0x522972,null));};exports[_0x47a5('0x7d')]=function(_0x301031,_0x52a2be,_0x4218fd){if(_0x301031[_0x47a5('0x59')]['id']){delete _0x301031['body']['id'];}return db[_0x47a5('0x54')][_0x47a5('0x5a')]({'where':{'id':_0x301031[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x52a2be,null))[_0x47a5('0x37')](function(_0x58fac0){if(_0x58fac0){_0x301031[_0x47a5('0x59')][_0x47a5('0x5e')]=_0x58fac0['id'];return db[_0x47a5('0x57')][_0x47a5('0x69')](_0x301031[_0x47a5('0x59')]);}})[_0x47a5('0x37')](respondWithResult(_0x52a2be,null))[_0x47a5('0x2a')](handleError(_0x52a2be,null));};exports['removeImap']=function(_0x596562,_0xa3d578,_0x580ce8){return db[_0x47a5('0x54')]['findOne']({'where':{'id':_0x596562[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0xa3d578,null))[_0x47a5('0x37')](function(_0x2bc7ae){if(_0x2bc7ae){return _0x2bc7ae['setImap'](null);}return null;})[_0x47a5('0x37')](respondWithStatusCode(_0xa3d578,null))[_0x47a5('0x2a')](handleError(_0xa3d578,null));};exports[_0x47a5('0x7e')]=function(_0x5a150a,_0x581759,_0x30375f){return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x5a150a[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x581759,null))[_0x47a5('0x37')](function(_0x1c0323){if(_0x1c0323){return _0x1c0323[_0x47a5('0x7e')]();}return null;})['then'](respondWithResult(_0x581759,null))[_0x47a5('0x2a')](handleError(_0x581759,null));};exports['addSmtp']=function(_0x346322,_0xc3b5e1,_0x5b0b0b){if(_0x346322['body']['id']){delete _0x346322[_0x47a5('0x59')]['id'];}return db[_0x47a5('0x54')]['find']({'where':{'id':_0x346322[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0xc3b5e1,null))[_0x47a5('0x37')](function(_0x44567e){if(_0x44567e){_0x346322['body'][_0x47a5('0x5e')]=_0x44567e['id'];return db['MailServerOut']['create'](_0x346322['body']);}})[_0x47a5('0x37')](respondWithResult(_0xc3b5e1,null))['catch'](handleError(_0xc3b5e1,null));};exports[_0x47a5('0x7f')]=function(_0x156d51,_0x401139,_0x2005d5){return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x156d51[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x401139,null))[_0x47a5('0x37')](function(_0x2200f9){if(_0x2200f9){return _0x2200f9[_0x47a5('0x80')](null);}return null;})[_0x47a5('0x37')](respondWithStatusCode(_0x401139,null))[_0x47a5('0x2a')](handleError(_0x401139,null));};exports[_0x47a5('0x81')]=function(_0xff64fb,_0x5e17cb,_0xdd95c8){return db[_0x47a5('0x82')][_0x47a5('0x5a')]({'where':{'id':_0xff64fb[_0x47a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5e17cb,null))[_0x47a5('0x37')](function(_0x49998b){if(_0x49998b){return _0x49998b[_0x47a5('0x81')](_0xff64fb['body'][_0x47a5('0x67')],_[_0x47a5('0x83')](_0xff64fb[_0x47a5('0x59')],['ids','id'])||{});}})[_0x47a5('0x37')](respondWithResult(_0x5e17cb,null))[_0x47a5('0x2a')](handleError(_0x5e17cb,null));};exports[_0x47a5('0x84')]=function(_0x4ac804,_0x52798d,_0x20f320){var _0x1a5e07={'raw':![],'where':{}};var _0x31c88c={};var _0x4594df={'count':0x0,'rows':[]};return db[_0x47a5('0x54')]['findOne']({'where':{'id':_0x4ac804[_0x47a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x52798d,null))[_0x47a5('0x37')](function(_0xdeaf4e){if(_0xdeaf4e){_0x31c88c[_0x47a5('0x44')]=_[_0x47a5('0x47')](db['MailInteraction']['rawAttributes']);_0x31c88c[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0x4ac804[_0x47a5('0x46')]);_0x31c88c[_0x47a5('0x48')]=_[_0x47a5('0x49')](_0x31c88c[_0x47a5('0x44')],_0x31c88c[_0x47a5('0x46')]);_0x1a5e07[_0x47a5('0x4b')]=_[_0x47a5('0x49')](_0x31c88c['model'],qs['fields'](_0x4ac804[_0x47a5('0x46')]['fields']));_0x1a5e07[_0x47a5('0x4b')]=_0x1a5e07[_0x47a5('0x4b')][_0x47a5('0x62')]?_0x1a5e07['attributes']:_0x31c88c[_0x47a5('0x44')];if(!_0x4ac804[_0x47a5('0x46')]['hasOwnProperty'](_0x47a5('0x4c'))){_0x1a5e07['limit']=qs[_0x47a5('0x30')](_0x4ac804[_0x47a5('0x46')][_0x47a5('0x30')]);_0x1a5e07['offset']=qs['offset'](_0x4ac804['query']['offset']);}_0x1a5e07['order']=qs[_0x47a5('0x4d')](_0x4ac804['query'][_0x47a5('0x4d')]);_0x1a5e07[_0x47a5('0x4e')]=qs['filters'](_['pick'](_0x4ac804['query'],_0x31c88c[_0x47a5('0x48')]));_0x1a5e07['where']['MailAccountId']=_0xdeaf4e['id'];if(_0x4ac804['query'][_0x47a5('0x50')]){_0x1a5e07[_0x47a5('0x4e')]=_[_0x47a5('0x51')](_0x1a5e07[_0x47a5('0x4e')],{'$or':_['map'](_0x1a5e07[_0x47a5('0x4b')],function(_0x559943){var _0x2b6f9e={};_0x2b6f9e[_0x559943]={'$like':'%'+_0x4ac804['query'][_0x47a5('0x50')]+'%'};return _0x2b6f9e;})});}_0x1a5e07=_[_0x47a5('0x51')]({},_0x1a5e07,_0x4ac804[_0x47a5('0x58')]);return db['MailInteraction'][_0x47a5('0x2e')]({'where':_0x1a5e07[_0x47a5('0x4e')]})[_0x47a5('0x37')](function(_0x31100e){_0x4594df['count']=_0x31100e;if(_0x4ac804[_0x47a5('0x46')][_0x47a5('0x52')]){_0x1a5e07[_0x47a5('0x53')]=[{'model':db[_0x47a5('0x85')],'as':_0x47a5('0x86'),'required':![]},{'model':db[_0x47a5('0x87')],'as':'Owner','attributes':[_0x47a5('0x3a'),_0x47a5('0x88'),_0x47a5('0x89')],'required':![]},{'model':db[_0x47a5('0x8a')],'as':_0x47a5('0x8b'),'attributes':['id',_0x47a5('0x3a'),_0x47a5('0x8c')],'where':_0x4ac804[_0x47a5('0x46')][_0x47a5('0x8d')]?{'id':_0x4ac804[_0x47a5('0x46')][_0x47a5('0x8d')]}:undefined,'required':_0x4ac804[_0x47a5('0x46')][_0x47a5('0x8d')]?!![]:![]}];}return db[_0x47a5('0x82')][_0x47a5('0x55')](_0x1a5e07);})[_0x47a5('0x37')](function(_0x40505e){_0x4594df['rows']=_0x40505e;return _0x4594df;});}})[_0x47a5('0x37')](respondWithFilteredResult(_0x52798d,_0x1a5e07))['catch'](handleError(_0x52798d,null));};exports['addApplications']=function(_0x1542b9,_0x154365,_0x36f910){return db['MailAccount'][_0x47a5('0x61')]({'where':{'id':_0x1542b9[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x154365,null))[_0x47a5('0x37')](function(_0x30e5fb){if(_0x30e5fb){return db[_0x47a5('0x8e')][_0x47a5('0x8f')](function(_0x46cb3a){return db[_0x47a5('0x90')][_0x47a5('0x91')]({'where':{'MailAccountId':_0x1542b9[_0x47a5('0x5b')]['id']},'transaction':_0x46cb3a})[_0x47a5('0x37')](function(_0x203bc9){var _0x4d7fd4=_['map'](_0x1542b9[_0x47a5('0x59')],function(_0x5e7d56){_0x5e7d56[_0x47a5('0x5e')]=_0x1542b9[_0x47a5('0x5b')]['id'];return _0x5e7d56;});return db[_0x47a5('0x90')][_0x47a5('0x92')](_0x4d7fd4,{'transaction':_0x46cb3a});});})[_0x47a5('0x37')](function(){return db[_0x47a5('0x90')]['findAndCountAll']({'where':{'MailAccountId':_0x1542b9[_0x47a5('0x5b')]['id']},'order':_0x47a5('0x93')});});}})[_0x47a5('0x37')](respondWithResult(_0x154365,null))['catch'](handleError(_0x154365,null));};exports[_0x47a5('0x94')]=function(_0x439f60,_0x3ecc41,_0x3e4148){var _0x4c46ea={};var _0x23e649={};var _0x35e20f;var _0x46615a;return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x439f60[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x3ecc41,null))[_0x47a5('0x37')](function(_0x2ac386){if(_0x2ac386){_0x35e20f=_0x2ac386;_0x23e649[_0x47a5('0x44')]=_[_0x47a5('0x47')](db[_0x47a5('0x90')][_0x47a5('0x40')]);_0x23e649[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0x439f60[_0x47a5('0x46')]);_0x23e649[_0x47a5('0x48')]=_['intersection'](_0x23e649[_0x47a5('0x44')],_0x23e649['query']);_0x4c46ea[_0x47a5('0x4b')]=_[_0x47a5('0x49')](_0x23e649[_0x47a5('0x44')],qs[_0x47a5('0x4a')](_0x439f60[_0x47a5('0x46')][_0x47a5('0x4a')]));_0x4c46ea[_0x47a5('0x4b')]=_0x4c46ea[_0x47a5('0x4b')]['length']?_0x4c46ea[_0x47a5('0x4b')]:_0x23e649[_0x47a5('0x44')];_0x4c46ea[_0x47a5('0x64')]=qs['sort'](_0x439f60[_0x47a5('0x46')][_0x47a5('0x4d')]);_0x4c46ea[_0x47a5('0x4e')]=qs[_0x47a5('0x48')](_['pick'](_0x439f60[_0x47a5('0x46')],_0x23e649[_0x47a5('0x48')]));if(_0x439f60[_0x47a5('0x46')][_0x47a5('0x50')]){_0x4c46ea['where']=_[_0x47a5('0x51')](_0x4c46ea['where'],{'$or':_['map'](_0x4c46ea[_0x47a5('0x4b')],function(_0x1efae8){var _0x407fd2={};_0x407fd2[_0x1efae8]={'$like':'%'+_0x439f60[_0x47a5('0x46')]['filter']+'%'};return _0x407fd2;})});}_0x4c46ea=_[_0x47a5('0x51')]({},_0x4c46ea,_0x439f60[_0x47a5('0x58')]);return _0x35e20f[_0x47a5('0x94')](_0x4c46ea);}})[_0x47a5('0x37')](function(_0xf470f5){if(_0xf470f5){_0x46615a=_0xf470f5[_0x47a5('0x62')];if(!_0x439f60['query'][_0x47a5('0x63')](_0x47a5('0x4c'))){_0x4c46ea[_0x47a5('0x30')]=qs[_0x47a5('0x30')](_0x439f60[_0x47a5('0x46')]['limit']);_0x4c46ea[_0x47a5('0x2f')]=qs['offset'](_0x439f60[_0x47a5('0x46')]['offset']);}return _0x35e20f[_0x47a5('0x94')](_0x4c46ea);}})['then'](function(_0x56a3c4){if(_0x56a3c4){return _0x56a3c4?{'count':_0x46615a,'rows':_0x56a3c4}:null;}})[_0x47a5('0x37')](respondWithResult(_0x3ecc41,null))[_0x47a5('0x2a')](handleError(_0x3ecc41,null));};exports['getMessages']=function(_0xa07bc6,_0x2d7e13,_0x530542){var _0x3a09e6={'raw':!![],'where':{}};var _0x112e1e={};var _0x36871e={'count':0x0,'rows':[]};return db['MailAccount'][_0x47a5('0x61')]({'where':{'id':_0xa07bc6[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x2d7e13,null))[_0x47a5('0x37')](function(_0x37721c){if(_0x37721c){_0x112e1e['model']=_['keys'](db[_0x47a5('0x95')]['rawAttributes']);_0x112e1e[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0xa07bc6['query']);_0x112e1e['filters']=_[_0x47a5('0x49')](_0x112e1e['model'],_0x112e1e[_0x47a5('0x46')]);_0x3a09e6[_0x47a5('0x4b')]=_[_0x47a5('0x49')](_0x112e1e[_0x47a5('0x44')],qs[_0x47a5('0x4a')](_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x4a')]));_0x3a09e6['attributes']=_0x3a09e6[_0x47a5('0x4b')]['length']?_0x3a09e6[_0x47a5('0x4b')]:_0x112e1e[_0x47a5('0x44')];if(!_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x63')](_0x47a5('0x4c'))){_0x3a09e6[_0x47a5('0x30')]=qs[_0x47a5('0x30')](_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x30')]);_0x3a09e6[_0x47a5('0x2f')]=qs[_0x47a5('0x2f')](_0xa07bc6[_0x47a5('0x46')]['offset']);}_0x3a09e6[_0x47a5('0x64')]=qs[_0x47a5('0x4d')](_0xa07bc6[_0x47a5('0x46')]['sort']);_0x3a09e6[_0x47a5('0x4e')]=qs[_0x47a5('0x48')](_[_0x47a5('0x4f')](_0xa07bc6[_0x47a5('0x46')],_0x112e1e[_0x47a5('0x48')]));_0x3a09e6[_0x47a5('0x4e')]['MailAccountId']=_0x37721c['id'];if(_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x50')]){_0x3a09e6[_0x47a5('0x4e')]=_[_0x47a5('0x51')](_0x3a09e6[_0x47a5('0x4e')],{'$or':_[_0x47a5('0x45')](_0x3a09e6[_0x47a5('0x4b')],function(_0x188bdf){var _0x355c4b={};_0x355c4b[_0x188bdf]={'$like':'%'+_0xa07bc6[_0x47a5('0x46')]['filter']+'%'};return _0x355c4b;})});}if(_0xa07bc6['query'][_0x47a5('0x96')]){var _0x144524=_0xa07bc6[_0x47a5('0x46')]['$gte'][_0x47a5('0x97')](',');var _0x50b7fc={};_0x50b7fc[_0x144524[0x0]]={'$gte':moment(_0x144524[0x1])['format'](_0x47a5('0x98'))};_0x3a09e6[_0x47a5('0x4e')]=_[_0x47a5('0x51')](_0x3a09e6[_0x47a5('0x4e')],_0x50b7fc);}_0x3a09e6=_['merge']({},_0x3a09e6,_0xa07bc6[_0x47a5('0x58')]);return db[_0x47a5('0x95')]['count']({'where':_0x3a09e6['where']})['then'](function(_0x28a52a){_0x36871e[_0x47a5('0x2e')]=_0x28a52a;if(_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x52')]){_0x3a09e6[_0x47a5('0x53')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x3a09e6);})[_0x47a5('0x37')](function(_0x1b0fd4){if(_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x99')]==='true'){for(var _0x873e26=0x0;_0x873e26<_0x1b0fd4[_0x47a5('0x62')];_0x873e26++){_0x1b0fd4[_0x873e26][_0x47a5('0x59')]=juice(_0x1b0fd4[_0x873e26][_0x47a5('0x59')]);}}_0x36871e['rows']=_0x1b0fd4;return _0x36871e;});}})['then'](respondWithFilteredResult(_0x2d7e13,_0x3a09e6))['catch'](handleError(_0x2d7e13,null));};exports[_0x47a5('0x9a')]=function(_0x15ddfc,_0x156ceb,_0x3c6142){var _0x242006,_0x1441c3={},_0x3bcdbc;if(_0x15ddfc[_0x47a5('0x59')]['to']){_0x3bcdbc=_0x15ddfc[_0x47a5('0x59')]['to']['split'](',')[0x0];}return db[_0x47a5('0x54')][_0x47a5('0x5a')]({'where':{'id':_0x15ddfc['params']['id']},'include':[{'model':db[_0x47a5('0x9b')],'as':_0x47a5('0x9c'),'include':[{'model':db[_0x47a5('0x85')],'as':_0x47a5('0x9d'),'where':{'email':_0x3bcdbc},'limit':0x1,'order':[['updatedAt',_0x47a5('0x9e')]]}]},{'model':db[_0x47a5('0x3d')],'as':_0x47a5('0x74'),'raw':!![]}]})['then'](handleEntityNotFound(_0x156ceb,null))['then'](function(_0x27a666){if(_0x27a666){_0x242006=_0x27a666;if(_0x27a666['Smtp']){if(_[_0x47a5('0x6d')](_0x15ddfc['body'][_0x47a5('0x9f')])){_0x15ddfc[_0x47a5('0x59')][_0x47a5('0x9f')]=util[_0x47a5('0xa0')](_0x47a5('0xa1'),_0x27a666['name'],_0x27a666['email']||_0x27a666[_0x47a5('0x74')][_0x47a5('0x72')]);}if(_0x15ddfc[_0x47a5('0x59')][_0x47a5('0xa2')]&&_0x15ddfc['body']['attachments'][_0x47a5('0x62')]){for(var _0x4c9f4f=0x0;_0x4c9f4f<_0x15ddfc[_0x47a5('0x59')]['attachments'][_0x47a5('0x62')];_0x4c9f4f+=0x1){_0x15ddfc['body'][_0x47a5('0xa2')][_0x4c9f4f]={'filename':_0x15ddfc[_0x47a5('0x59')][_0x47a5('0xa2')][_0x4c9f4f][_0x47a5('0x3a')],'path':path[_0x47a5('0xa3')](config[_0x47a5('0xa4')],_0x47a5('0xa5'),_0x15ddfc[_0x47a5('0x59')]['attachments'][_0x4c9f4f][_0x47a5('0xa6')])};}}var _0x4394f0={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x27a666[_0x47a5('0x74')][_0x47a5('0x78')])){if(_0x27a666['Smtp']['authentication']){_0x4394f0[_0x47a5('0xa7')]={'user':_0x27a666['Smtp'][_0x47a5('0x72')],'pass':_0x27a666[_0x47a5('0x74')][_0x47a5('0x75')]};}_0x4394f0['host']=_0x27a666[_0x47a5('0x74')][_0x47a5('0x76')];_0x4394f0[_0x47a5('0x77')]=_0x27a666[_0x47a5('0x74')][_0x47a5('0x77')];_0x4394f0[_0x47a5('0xa8')]=_0x27a666[_0x47a5('0x74')]['secure'];}else{_0x4394f0[_0x47a5('0x78')]=_0x27a666[_0x47a5('0x74')][_0x47a5('0x78')];_0x4394f0[_0x47a5('0xa7')]={'user':_0x27a666[_0x47a5('0x74')][_0x47a5('0x72')],'pass':_0x27a666[_0x47a5('0x74')]['pass']};}return respondWithRpcPromise('SendMail',_0x47a5('0xa9'),{'account':_0x4394f0,'message':_0x15ddfc[_0x47a5('0x59')]});}else{throw new Error(_0x47a5('0xaa'));}}})['then'](function(_0x5d2a10){if(_0x5d2a10){_0x1441c3=_0x5d2a10;if(_0x242006[_0x47a5('0x9c')]){if(_0x242006[_0x47a5('0x9c')][_0x47a5('0x9d')][_0x47a5('0x62')]){return _0x242006[_0x47a5('0x9c')][_0x47a5('0x9d')][0x0];}else{return db[_0x47a5('0x85')]['create'](_[_0x47a5('0x18')](_0x15ddfc[_0x47a5('0x59')],{'firstName':_0x15ddfc[_0x47a5('0x59')]['to'],'email':_0x15ddfc['body']['to'],'phone':_0x15ddfc[_0x47a5('0x59')]['to'],'ListId':_0x242006[_0x47a5('0xab')]}));}}else{throw new Error(_0x47a5('0xaa'));}}})[_0x47a5('0x37')](function(_0x38aab1){if(_0x38aab1){var _0x20eff3={'UserId':_0x15ddfc[_0x47a5('0x72')]['id'],'ContactId':_0x38aab1['id'],'MailAccountId':_0x242006['id'],'inReplyTo':_0x1441c3[_0x47a5('0xac')],'to':_0x15ddfc[_0x47a5('0x59')][_0x47a5('0x9f')],'cc':_0x15ddfc[_0x47a5('0x59')]['cc'],'subject':_0x15ddfc[_0x47a5('0x59')][_0x47a5('0xad')],'attach':_0x15ddfc['body'][_0x47a5('0xae')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x47a5('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x47a5('0xaf'),'Messages':[_[_0x47a5('0x51')](_0x15ddfc[_0x47a5('0x59')],{'messageId':_0x1441c3['messageId'],'sentAt':moment()[_0x47a5('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x242006['id'],'UserId':_0x15ddfc[_0x47a5('0x72')]['id'],'ContactId':_0x38aab1['id']})]};if(_0x15ddfc[_0x47a5('0x59')][_0x47a5('0xb0')]){_0x20eff3=_[_0x47a5('0x51')](_0x20eff3,_0x15ddfc['body'][_0x47a5('0xb0')]);}return db['MailInteraction']['create'](_0x20eff3,{'include':[{'model':db[_0x47a5('0x95')],'as':_0x47a5('0xb1')}]});}})[_0x47a5('0x37')](respondWithResult(_0x156ceb,null))[_0x47a5('0x2a')](handleError(_0x156ceb,null));};exports[_0x47a5('0xb2')]=function(_0x11ae07,_0x10a789,_0x33ac8b){return db[_0x47a5('0x54')]['find']({'where':{'id':_0x11ae07['params']['id']},'include':[{'model':db[_0x47a5('0x3d')],'as':_0x47a5('0x74'),'raw':!![]}]})[_0x47a5('0x37')](handleEntityNotFound(_0x10a789,null))[_0x47a5('0x37')](function(_0x616b88){if(_0x616b88&&_0x616b88['Smtp']){var _0x3cfa62={'id':_0x616b88['id'],'tls':{'rejectUnauthorized':![]}};if(_0x616b88[_0x47a5('0x74')][_0x47a5('0x78')]){_0x3cfa62['service']=_0x616b88['Smtp'][_0x47a5('0x78')];}else{_0x3cfa62[_0x47a5('0x76')]=_0x616b88['Smtp'][_0x47a5('0x76')];_0x3cfa62[_0x47a5('0x77')]=_0x616b88[_0x47a5('0x74')]['port'];_0x3cfa62[_0x47a5('0xa8')]=_0x616b88[_0x47a5('0x74')][_0x47a5('0xa8')];}if(_0x616b88[_0x47a5('0x74')][_0x47a5('0xb3')]){_0x3cfa62['auth']={'user':_0x616b88[_0x47a5('0x74')][_0x47a5('0x72')],'pass':_0x616b88[_0x47a5('0x74')][_0x47a5('0x75')]};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x3cfa62});}})[_0x47a5('0x37')](respondWithResult(_0x10a789,null))['catch'](handleError(_0x10a789,null));};exports[_0x47a5('0x91')]=function(_0xe66584,_0x17a4c2){return db[_0x47a5('0x54')][_0x47a5('0x5a')]({'where':{'id':_0xe66584[_0x47a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x17a4c2,null))[_0x47a5('0x37')](function(_0x4035c6){if(_0x4035c6&&_0x4035c6[_0x47a5('0x78')]){throw new db['Sequelize']['ValidationError'](_0x47a5('0xb4'));}return _0x4035c6;})['then'](removeEntity(_0x17a4c2,null))[_0x47a5('0x2a')](handleError(_0x17a4c2,null));};exports[_0x47a5('0xb5')]=function(_0x3641f8,_0x22390f,_0x184d43){return db['MailAccount']['find']({'where':{'id':_0x3641f8[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x22390f,null))[_0x47a5('0x37')](function(_0x9fdee1){if(_0x9fdee1){return _0x9fdee1[_0x47a5('0xb5')](_0x3641f8['body'][_0x47a5('0x67')],_[_0x47a5('0x83')](_0x3641f8[_0x47a5('0x59')],[_0x47a5('0x67'),'id'])||{})[_0x47a5('0xb6')](function(_0x4df71d){for(var _0x28a5f3=0x0;_0x28a5f3<_0x3641f8[_0x47a5('0x59')][_0x47a5('0x67')][_0x47a5('0x62')];_0x28a5f3+=0x1){socket[_0x47a5('0xb7')](_0x47a5('0xb8'),{'UserId':_0x3641f8[_0x47a5('0x59')][_0x47a5('0x67')][_0x28a5f3],'MailAccountId':_0x3641f8[_0x47a5('0x5b')]['id']});}return _0x4df71d;});}})[_0x47a5('0x37')](respondWithResult(_0x22390f,null))[_0x47a5('0x2a')](handleError(_0x22390f,null));};exports['removeAgents']=function(_0x39786a,_0x1ccb2e,_0x19f0da){return db[_0x47a5('0x54')]['find']({'where':{'id':_0x39786a['params']['id']}})['then'](handleEntityNotFound(_0x1ccb2e,null))[_0x47a5('0x37')](function(_0x52e921){if(_0x52e921){return _0x52e921[_0x47a5('0xb9')](_0x39786a[_0x47a5('0x46')]['ids'])[_0x47a5('0x37')](function(){if(_[_0x47a5('0xba')](_0x39786a[_0x47a5('0x46')]['ids'])){for(var _0x457398=0x0;_0x457398<_0x39786a['query'][_0x47a5('0x67')][_0x47a5('0x62')];_0x457398+=0x1){socket[_0x47a5('0xb7')](_0x47a5('0xbb'),{'UserId':Number(_0x39786a[_0x47a5('0x46')][_0x47a5('0x67')][_0x457398]),'MailAccountId':Number(_0x39786a['params']['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x39786a[_0x47a5('0x46')][_0x47a5('0x67')]),'MailAccountId':Number(_0x39786a[_0x47a5('0x5b')]['id'])});}});}})[_0x47a5('0x37')](respondWithStatusCode(_0x1ccb2e,null))[_0x47a5('0x2a')](handleError(_0x1ccb2e,null));};exports[_0x47a5('0xbc')]=function(_0x338c9d,_0x138b92,_0x232c36){var _0x25954e={};var _0x277061={};var _0x3917e0;var _0x1c7695;return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x338c9d[_0x47a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x138b92,null))[_0x47a5('0x37')](function(_0x46b82a){if(_0x46b82a){_0x3917e0=_0x46b82a;_0x277061[_0x47a5('0x44')]=_[_0x47a5('0x47')](db[_0x47a5('0x87')][_0x47a5('0x40')]);_0x277061[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0x338c9d['query']);_0x277061[_0x47a5('0x48')]=_['intersection'](_0x277061[_0x47a5('0x44')],_0x277061[_0x47a5('0x46')]);_0x25954e['attributes']=_[_0x47a5('0x49')](_0x277061['model'],qs[_0x47a5('0x4a')](_0x338c9d[_0x47a5('0x46')][_0x47a5('0x4a')]));_0x25954e[_0x47a5('0x4b')]=_0x25954e[_0x47a5('0x4b')]['length']?_0x25954e[_0x47a5('0x4b')]:_0x277061[_0x47a5('0x44')];_0x25954e[_0x47a5('0x64')]=qs['sort'](_0x338c9d['query'][_0x47a5('0x4d')]);_0x25954e[_0x47a5('0x4e')]=qs[_0x47a5('0x48')](_['pick'](_0x338c9d[_0x47a5('0x46')],_0x277061[_0x47a5('0x48')]));if(_0x338c9d[_0x47a5('0x46')]['filter']){_0x25954e[_0x47a5('0x4e')]=_[_0x47a5('0x51')](_0x25954e[_0x47a5('0x4e')],{'$or':_[_0x47a5('0x45')](_0x25954e['attributes'],function(_0x1a1be9){var _0x5d6808={};_0x5d6808[_0x1a1be9]={'$like':'%'+_0x338c9d[_0x47a5('0x46')][_0x47a5('0x50')]+'%'};return _0x5d6808;})});}_0x25954e=_[_0x47a5('0x51')]({},_0x25954e,_0x338c9d[_0x47a5('0x58')]);return _0x3917e0['getAgents'](_0x25954e);}})[_0x47a5('0x37')](function(_0x147d77){if(_0x147d77){_0x1c7695=_0x147d77[_0x47a5('0x62')];if(!_0x338c9d[_0x47a5('0x46')][_0x47a5('0x63')]('nolimit')){_0x25954e[_0x47a5('0x30')]=qs[_0x47a5('0x30')](_0x338c9d[_0x47a5('0x46')][_0x47a5('0x30')]);_0x25954e[_0x47a5('0x2f')]=qs[_0x47a5('0x2f')](_0x338c9d['query'][_0x47a5('0x2f')]);}return _0x3917e0[_0x47a5('0xbc')](_0x25954e);}})['then'](function(_0x556e8e){if(_0x556e8e){return _0x556e8e?{'count':_0x1c7695,'rows':_0x556e8e}:null;}})[_0x47a5('0x37')](respondWithResult(_0x138b92,null))[_0x47a5('0x2a')](handleError(_0x138b92,null));}; \ No newline at end of file +var _0x7a54=['Smtp','pass','host','port','service','cpassword','get','UserProfileSection','getImap','addImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','MailApplication','destroy','bulkCreate','priority','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','send','CmList','List','Contacts','DESC','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','authentication','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','html-to-text','juice','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','Content-Range','reject','save','update','MailAccounts','UserProfileResource','then','sendStatus','stack','name','index','Imap','MailServerOut','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','includeAll','include','MailAccount','findAll','show','MailServerIn','options','body','find','params','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','length','hasOwnProperty','order','rows','removeDispositions','ids','CannedAnswer','create','getAnswers','removeAnswers','email','isNil','active','description','cservice','cauthentication','user','password'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x7a54,0x106));var _0x47a5=function(_0x51a52c,_0x3b0a2a){_0x51a52c=_0x51a52c-0x0;var _0x1d0602=_0x7a54[_0x51a52c];return _0x1d0602;};'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 htmlToText=require(_0x47a5('0xe'));var juice=require(_0x47a5('0xf'));var Redis=require('ioredis');var authService=require(_0x47a5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47a5('0x11'));var logger=require(_0x47a5('0x12'))(_0x47a5('0x13'));var utils=require(_0x47a5('0x14'));var config=require(_0x47a5('0x15'));var licenseUtil=require(_0x47a5('0x16'));var db=require(_0x47a5('0x17'))['db'];config['redis']=_[_0x47a5('0x18')](config[_0x47a5('0x19')],{'host':_0x47a5('0x1a'),'port':0x18eb});var socket=require(_0x47a5('0x1b'))(new Redis(config[_0x47a5('0x19')]));require(_0x47a5('0x1c'))[_0x47a5('0x1d')](socket);var jayson=require(_0x47a5('0x1e'));var client=jayson['client'][_0x47a5('0x1f')]({'port':0x232b});function respondWithRpcPromise(_0x11faf5,_0x3b001e,_0x2a2cbb,_0x1ef44c){return new BPromise(function(_0x574af6,_0x549de3){var _0x138bc0=_0x1ef44c||client;return _0x138bc0['request'](_0x11faf5,_0x2a2cbb)['then'](function(_0x423a81){logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x3b001e,_0x47a5('0x22'));logger[_0x47a5('0x23')](_0x47a5('0x24'),_0x3b001e,_0x47a5('0x22'),JSON[_0x47a5('0x25')](_0x423a81));if(_0x423a81[_0x47a5('0x26')]){if(_0x423a81['error'][_0x47a5('0x27')]===0x1f4){logger[_0x47a5('0x26')]('MailAccount,\x20%s,\x20%s',_0x3b001e,_0x423a81[_0x47a5('0x26')][_0x47a5('0x28')]);return _0x549de3(_0x423a81[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x21'),_0x3b001e,_0x423a81[_0x47a5('0x26')][_0x47a5('0x28')]);return _0x574af6(_0x423a81['error'][_0x47a5('0x28')]);}else{logger[_0x47a5('0x20')]('MailAccount,\x20%s,\x20%s',_0x3b001e,_0x47a5('0x22'));_0x574af6(_0x423a81[_0x47a5('0x29')][_0x47a5('0x28')]);}})[_0x47a5('0x2a')](function(_0x3abd6a){logger['error']('MailAccount,\x20%s,\x20%s',_0x3b001e,_0x3abd6a);_0x549de3(_0x3abd6a);});});}function respondWithStatusCode(_0x136745,_0x5686db){_0x5686db=_0x5686db||0xcc;return function(_0x1ea9c8){if(_0x1ea9c8){return _0x136745['sendStatus'](_0x5686db);}return _0x136745[_0x47a5('0x2b')](_0x5686db)[_0x47a5('0x2c')]();};}function respondWithResult(_0x36ad34,_0x1dac65){_0x1dac65=_0x1dac65||0xc8;return function(_0x21f296){if(_0x21f296){return _0x36ad34[_0x47a5('0x2b')](_0x1dac65)[_0x47a5('0x2d')](_0x21f296);}};}function respondWithFilteredResult(_0x136b14,_0x16631f){return function(_0x361bfa){if(_0x361bfa){var _0x1127f8=_0x361bfa[_0x47a5('0x2e')],_0x11a4fa=_0x16631f['offset'],_0x3ad507=_0x16631f[_0x47a5('0x2f')]+_0x16631f[_0x47a5('0x30')],_0x528582;if(_0x3ad507>=_0x1127f8){_0x3ad507=_0x1127f8;_0x528582=0xc8;}else{_0x528582=0xce;}_0x136b14[_0x47a5('0x2b')](_0x528582);return _0x136b14['set'](_0x47a5('0x31'),_0x11a4fa+'-'+_0x3ad507+'/'+_0x1127f8)[_0x47a5('0x2d')](_0x361bfa);}return null;};}function patchUpdates(_0x39b50b){return function(_0x1f1c68){try{jsonpatch['apply'](_0x1f1c68,_0x39b50b,!![]);}catch(_0x50d875){return BPromise[_0x47a5('0x32')](_0x50d875);}return _0x1f1c68[_0x47a5('0x33')]();};}function saveUpdates(_0x5bd7eb,_0x4e1006){return function(_0x836303){if(_0x836303){return _0x836303[_0x47a5('0x34')](_0x5bd7eb)['then'](function(_0x42f70c){return _0x42f70c;});}return null;};}function removeEntity(_0x53119b,_0x122ed6){return function(_0xd972c){if(_0xd972c){return _0xd972c['destroy']()['then'](function(){var _0x274e34=_0xd972c['get']({'plain':!![]});var _0x403028=_0x47a5('0x35');return db[_0x47a5('0x36')]['destroy']({'where':{'type':_0x403028,'resourceId':_0x274e34['id']}})[_0x47a5('0x37')](function(){return _0xd972c;});})['then'](function(){_0x53119b['status'](0xcc)[_0x47a5('0x2c')]();});}};}function handleEntityNotFound(_0x5a8a7c,_0x25cce0){return function(_0x5ef577){if(!_0x5ef577){_0x5a8a7c[_0x47a5('0x38')](0x194);}return _0x5ef577;};}function handleError(_0x3534cb,_0x38c8d4){_0x38c8d4=_0x38c8d4||0x1f4;return function(_0x199698){logger[_0x47a5('0x26')](_0x199698[_0x47a5('0x39')]);if(_0x199698[_0x47a5('0x3a')]){delete _0x199698[_0x47a5('0x3a')];}_0x3534cb[_0x47a5('0x2b')](_0x38c8d4)['send'](_0x199698);};}exports[_0x47a5('0x3b')]=function(_0x10f136,_0x511c06){var _0x2c50d6={'include':[{'model':db['MailServerIn'],'as':_0x47a5('0x3c')},{'model':db[_0x47a5('0x3d')],'as':'Smtp'},{'model':db[_0x47a5('0x3e')],'as':_0x47a5('0x3f')}]},_0x2bf53d={},_0x1d4348={'count':0x0,'rows':[]};var _0x54ae35=_['map'](db['MailAccount'][_0x47a5('0x40')],function(_0x5c569e){return{'name':_0x5c569e[_0x47a5('0x41')],'type':_0x5c569e[_0x47a5('0x42')][_0x47a5('0x43')]};});_0x2bf53d[_0x47a5('0x44')]=_[_0x47a5('0x45')](_0x54ae35,_0x47a5('0x3a'));_0x2bf53d[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0x10f136[_0x47a5('0x46')]);_0x2bf53d[_0x47a5('0x48')]=_[_0x47a5('0x49')](_0x2bf53d[_0x47a5('0x44')],_0x2bf53d[_0x47a5('0x46')]);_0x2c50d6['attributes']=_[_0x47a5('0x49')](_0x2bf53d[_0x47a5('0x44')],qs[_0x47a5('0x4a')](_0x10f136[_0x47a5('0x46')]['fields']));_0x2c50d6[_0x47a5('0x4b')]=_0x2c50d6['attributes']['length']?_0x2c50d6['attributes']:_0x2bf53d['model'];if(!_0x10f136[_0x47a5('0x46')]['hasOwnProperty'](_0x47a5('0x4c'))){_0x2c50d6[_0x47a5('0x30')]=qs[_0x47a5('0x30')](_0x10f136['query'][_0x47a5('0x30')]);_0x2c50d6[_0x47a5('0x2f')]=qs['offset'](_0x10f136['query'][_0x47a5('0x2f')]);}_0x2c50d6['order']=qs[_0x47a5('0x4d')](_0x10f136[_0x47a5('0x46')][_0x47a5('0x4d')]);_0x2c50d6[_0x47a5('0x4e')]=qs[_0x47a5('0x48')](_[_0x47a5('0x4f')](_0x10f136[_0x47a5('0x46')],_0x2bf53d[_0x47a5('0x48')]),_0x54ae35);if(_0x10f136[_0x47a5('0x46')][_0x47a5('0x50')]){_0x2c50d6[_0x47a5('0x4e')]=_[_0x47a5('0x51')](_0x2c50d6[_0x47a5('0x4e')],{'$or':_[_0x47a5('0x45')](_0x54ae35,function(_0x4e5e7){if(_0x4e5e7[_0x47a5('0x42')]!=='VIRTUAL'){var _0x2d38de={};_0x2d38de[_0x4e5e7[_0x47a5('0x3a')]]={'$like':'%'+_0x10f136['query']['filter']+'%'};return _0x2d38de;}})});}_0x2c50d6=_[_0x47a5('0x51')]({},_0x2c50d6,_0x10f136['options']);var _0x13750d={'where':_0x2c50d6[_0x47a5('0x4e')]};return db['MailAccount']['count'](_0x13750d)[_0x47a5('0x37')](function(_0x52d409){_0x1d4348[_0x47a5('0x2e')]=_0x52d409;if(_0x10f136[_0x47a5('0x46')][_0x47a5('0x52')]){_0x2c50d6[_0x47a5('0x53')]=[{'all':!![]}];}return db[_0x47a5('0x54')][_0x47a5('0x55')](_0x2c50d6);})[_0x47a5('0x37')](function(_0x53e994){_0x1d4348['rows']=_0x53e994;return _0x1d4348;})[_0x47a5('0x37')](respondWithFilteredResult(_0x511c06,_0x2c50d6))[_0x47a5('0x2a')](handleError(_0x511c06,null));};exports[_0x47a5('0x56')]=function(_0x9ea93e,_0x2c7020){var _0x2c0c86={'raw':![],'where':{'id':_0x9ea93e['params']['id']},'include':[{'model':db[_0x47a5('0x57')],'as':_0x47a5('0x3c')},{'model':db[_0x47a5('0x3d')],'as':'Smtp'},{'model':db[_0x47a5('0x3e')],'as':'mandatoryDispositionPause'}]},_0x249de5={};_0x249de5[_0x47a5('0x44')]=_[_0x47a5('0x47')](db[_0x47a5('0x54')][_0x47a5('0x40')]);_0x249de5['query']=_[_0x47a5('0x47')](_0x9ea93e[_0x47a5('0x46')]);_0x249de5[_0x47a5('0x48')]=_[_0x47a5('0x49')](_0x249de5[_0x47a5('0x44')],_0x249de5[_0x47a5('0x46')]);_0x2c0c86[_0x47a5('0x4b')]=_['intersection'](_0x249de5[_0x47a5('0x44')],qs[_0x47a5('0x4a')](_0x9ea93e[_0x47a5('0x46')][_0x47a5('0x4a')]));_0x2c0c86[_0x47a5('0x4b')]=_0x2c0c86[_0x47a5('0x4b')]['length']?_0x2c0c86[_0x47a5('0x4b')]:_0x249de5[_0x47a5('0x44')];if(_0x9ea93e[_0x47a5('0x46')]['includeAll']){_0x2c0c86[_0x47a5('0x53')]=[{'all':!![]}];}_0x2c0c86=_[_0x47a5('0x51')]({},_0x2c0c86,_0x9ea93e[_0x47a5('0x58')]);return db['MailAccount']['find'](_0x2c0c86)[_0x47a5('0x37')](handleEntityNotFound(_0x2c7020,null))[_0x47a5('0x37')](respondWithResult(_0x2c7020,null))['catch'](handleError(_0x2c7020,null));};exports['update']=function(_0x6d6b2b,_0x4d6a82){if(_0x6d6b2b[_0x47a5('0x59')]['id']){delete _0x6d6b2b['body']['id'];}return db['MailAccount'][_0x47a5('0x5a')]({'where':{'id':_0x6d6b2b[_0x47a5('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x47a5('0x3c')},{'model':db[_0x47a5('0x3d')],'as':'Smtp'},{'model':db['Pause'],'as':_0x47a5('0x3f')}]})[_0x47a5('0x37')](handleEntityNotFound(_0x4d6a82,null))[_0x47a5('0x37')](saveUpdates(_0x6d6b2b[_0x47a5('0x59')],null))['then'](function(_0x199621){if(_0x199621&&_0x6d6b2b[_0x47a5('0x59')][_0x47a5('0x3c')]){return db['MailServerIn'][_0x47a5('0x34')](_0x6d6b2b['body'][_0x47a5('0x3c')],{'where':{'MailAccountId':_0x199621['id']}})[_0x47a5('0x37')](function(){return _0x199621;});}return _0x199621;})[_0x47a5('0x37')](function(_0x1c485b){if(_0x1c485b&&_0x6d6b2b[_0x47a5('0x59')]['Smtp']){return db[_0x47a5('0x3d')]['update'](_0x6d6b2b['body']['Smtp'],{'where':{'MailAccountId':_0x1c485b['id']}})['then'](function(){return _0x1c485b;});}return _0x1c485b;})[_0x47a5('0x37')](respondWithResult(_0x4d6a82,null))[_0x47a5('0x2a')](handleError(_0x4d6a82,null));};exports[_0x47a5('0x5c')]=function(_0x52e3ee,_0x4d3db1){return db[_0x47a5('0x54')][_0x47a5('0x5c')]()[_0x47a5('0x37')](respondWithResult(_0x4d3db1,null))[_0x47a5('0x2a')](handleError(_0x4d3db1,null));};exports[_0x47a5('0x5d')]=function(_0x4b5d0c,_0x3474b7,_0x519e9e){if(_0x4b5d0c[_0x47a5('0x59')]['id']){delete _0x4b5d0c[_0x47a5('0x59')]['id'];}return db['MailAccount'][_0x47a5('0x5a')]({'where':{'id':_0x4b5d0c[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x3474b7,null))[_0x47a5('0x37')](function(_0x2d6494){if(_0x2d6494){_0x4b5d0c[_0x47a5('0x59')][_0x47a5('0x5e')]=_0x2d6494['id'];return db[_0x47a5('0x5f')]['create'](_0x4b5d0c[_0x47a5('0x59')]);}})[_0x47a5('0x37')](respondWithResult(_0x3474b7,null))[_0x47a5('0x2a')](handleError(_0x3474b7,null));};exports[_0x47a5('0x60')]=function(_0x396cb0,_0x4bbe14,_0xbec033){var _0xdfcecc={'raw':![],'where':{}};var _0x1224bc={};var _0x144aaa={'count':0x0,'rows':[]};return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x396cb0[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x4bbe14,null))[_0x47a5('0x37')](function(_0x44cb90){if(_0x44cb90){_0x1224bc[_0x47a5('0x44')]=_[_0x47a5('0x47')](db[_0x47a5('0x5f')][_0x47a5('0x40')]);_0x1224bc[_0x47a5('0x46')]=_['keys'](_0x396cb0[_0x47a5('0x46')]);_0x1224bc[_0x47a5('0x48')]=_[_0x47a5('0x49')](_0x1224bc['model'],_0x1224bc[_0x47a5('0x46')]);_0xdfcecc[_0x47a5('0x4b')]=_[_0x47a5('0x49')](_0x1224bc[_0x47a5('0x44')],qs['fields'](_0x396cb0[_0x47a5('0x46')]['fields']));_0xdfcecc[_0x47a5('0x4b')]=_0xdfcecc['attributes'][_0x47a5('0x62')]?_0xdfcecc['attributes']:_0x1224bc[_0x47a5('0x44')];if(!_0x396cb0[_0x47a5('0x46')][_0x47a5('0x63')]('nolimit')){_0xdfcecc['limit']=qs['limit'](_0x396cb0[_0x47a5('0x46')][_0x47a5('0x30')]);_0xdfcecc[_0x47a5('0x2f')]=qs[_0x47a5('0x2f')](_0x396cb0['query'][_0x47a5('0x2f')]);}_0xdfcecc[_0x47a5('0x64')]=qs[_0x47a5('0x4d')](_0x396cb0[_0x47a5('0x46')][_0x47a5('0x4d')]);_0xdfcecc[_0x47a5('0x4e')]=qs[_0x47a5('0x48')](_[_0x47a5('0x4f')](_0x396cb0[_0x47a5('0x46')],_0x1224bc[_0x47a5('0x48')]));_0xdfcecc[_0x47a5('0x4e')][_0x47a5('0x5e')]=_0x44cb90['id'];if(_0x396cb0['query'][_0x47a5('0x50')]){_0xdfcecc['where']=_[_0x47a5('0x51')](_0xdfcecc[_0x47a5('0x4e')],{'$or':_[_0x47a5('0x45')](_0xdfcecc[_0x47a5('0x4b')],function(_0x40e584){var _0xa9c853={};_0xa9c853[_0x40e584]={'$like':'%'+_0x396cb0[_0x47a5('0x46')][_0x47a5('0x50')]+'%'};return _0xa9c853;})});}_0xdfcecc=_[_0x47a5('0x51')]({},_0xdfcecc,_0x396cb0[_0x47a5('0x58')]);return db[_0x47a5('0x5f')][_0x47a5('0x2e')]({'where':_0xdfcecc[_0x47a5('0x4e')]})[_0x47a5('0x37')](function(_0x441d64){_0x144aaa['count']=_0x441d64;if(_0x396cb0['query']['includeAll']){_0xdfcecc['include']=[{'all':!![]}];}return db[_0x47a5('0x5f')][_0x47a5('0x55')](_0xdfcecc);})['then'](function(_0x732e00){_0x144aaa[_0x47a5('0x65')]=_0x732e00;return _0x144aaa;});}})[_0x47a5('0x37')](respondWithFilteredResult(_0x4bbe14,_0xdfcecc))[_0x47a5('0x2a')](handleError(_0x4bbe14,null));};exports[_0x47a5('0x66')]=function(_0x930d25,_0x218dfa,_0x1c7302){return db[_0x47a5('0x54')][_0x47a5('0x5a')]({'where':{'id':_0x930d25[_0x47a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x218dfa,null))[_0x47a5('0x37')](function(_0x1fbd42){if(_0x1fbd42){return _0x1fbd42[_0x47a5('0x66')](_0x930d25['query'][_0x47a5('0x67')]);}})[_0x47a5('0x37')](respondWithStatusCode(_0x218dfa,null))[_0x47a5('0x2a')](handleError(_0x218dfa,null));};exports['addAnswer']=function(_0x19dc8c,_0x5205ba,_0x49d93d){if(_0x19dc8c[_0x47a5('0x59')]['id']){delete _0x19dc8c[_0x47a5('0x59')]['id'];}return db[_0x47a5('0x54')][_0x47a5('0x5a')]({'where':{'id':_0x19dc8c[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x5205ba,null))['then'](function(_0x592322){if(_0x592322){_0x19dc8c[_0x47a5('0x59')]['MailAccountId']=_0x592322['id'];return db[_0x47a5('0x68')][_0x47a5('0x69')](_0x19dc8c[_0x47a5('0x59')]);}})[_0x47a5('0x37')](respondWithResult(_0x5205ba,null))['catch'](handleError(_0x5205ba,null));};exports[_0x47a5('0x6a')]=function(_0x550bde,_0x5f3a04,_0x139c79){var _0x391f8e={'raw':![],'where':{}};var _0x5b91f7={};var _0x1926bd={'count':0x0,'rows':[]};return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x550bde['params']['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x5f3a04,null))['then'](function(_0x2307da){if(_0x2307da){_0x5b91f7[_0x47a5('0x44')]=_[_0x47a5('0x47')](db['CannedAnswer'][_0x47a5('0x40')]);_0x5b91f7[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0x550bde['query']);_0x5b91f7[_0x47a5('0x48')]=_['intersection'](_0x5b91f7[_0x47a5('0x44')],_0x5b91f7['query']);_0x391f8e[_0x47a5('0x4b')]=_[_0x47a5('0x49')](_0x5b91f7[_0x47a5('0x44')],qs[_0x47a5('0x4a')](_0x550bde['query'][_0x47a5('0x4a')]));_0x391f8e[_0x47a5('0x4b')]=_0x391f8e[_0x47a5('0x4b')][_0x47a5('0x62')]?_0x391f8e[_0x47a5('0x4b')]:_0x5b91f7['model'];if(!_0x550bde['query'][_0x47a5('0x63')]('nolimit')){_0x391f8e[_0x47a5('0x30')]=qs[_0x47a5('0x30')](_0x550bde[_0x47a5('0x46')]['limit']);_0x391f8e[_0x47a5('0x2f')]=qs[_0x47a5('0x2f')](_0x550bde['query'][_0x47a5('0x2f')]);}_0x391f8e[_0x47a5('0x64')]=qs[_0x47a5('0x4d')](_0x550bde[_0x47a5('0x46')]['sort']);_0x391f8e['where']=qs[_0x47a5('0x48')](_[_0x47a5('0x4f')](_0x550bde['query'],_0x5b91f7[_0x47a5('0x48')]));_0x391f8e[_0x47a5('0x4e')]['MailAccountId']=_0x2307da['id'];if(_0x550bde[_0x47a5('0x46')][_0x47a5('0x50')]){_0x391f8e[_0x47a5('0x4e')]=_['merge'](_0x391f8e[_0x47a5('0x4e')],{'$or':_['map'](_0x391f8e[_0x47a5('0x4b')],function(_0x5e2946){var _0x243c8b={};_0x243c8b[_0x5e2946]={'$like':'%'+_0x550bde[_0x47a5('0x46')]['filter']+'%'};return _0x243c8b;})});}_0x391f8e=_[_0x47a5('0x51')]({},_0x391f8e,_0x550bde['options']);return db[_0x47a5('0x68')][_0x47a5('0x2e')]({'where':_0x391f8e[_0x47a5('0x4e')]})[_0x47a5('0x37')](function(_0x49b76a){_0x1926bd[_0x47a5('0x2e')]=_0x49b76a;if(_0x550bde['query']['includeAll']){_0x391f8e[_0x47a5('0x53')]=[{'all':!![]}];}return db[_0x47a5('0x68')][_0x47a5('0x55')](_0x391f8e);})[_0x47a5('0x37')](function(_0x380c8b){_0x1926bd['rows']=_0x380c8b;return _0x1926bd;});}})[_0x47a5('0x37')](respondWithFilteredResult(_0x5f3a04,_0x391f8e))[_0x47a5('0x2a')](handleError(_0x5f3a04,null));};exports[_0x47a5('0x6b')]=function(_0x11b68b,_0x50b98e,_0x240db9){return db['MailAccount'][_0x47a5('0x5a')]({'where':{'id':_0x11b68b[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x50b98e,null))[_0x47a5('0x37')](function(_0x29a1cf){if(_0x29a1cf){return _0x29a1cf[_0x47a5('0x6b')](_0x11b68b[_0x47a5('0x46')][_0x47a5('0x67')]);}})[_0x47a5('0x37')](respondWithStatusCode(_0x50b98e,null))['catch'](handleError(_0x50b98e,null));};exports[_0x47a5('0x69')]=function(_0x18f8b2,_0x59266f){var _0x2fd46f={'name':_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x3a')],'key':_0x18f8b2['body']['key'],'email':_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x6c')],'ListId':_0x18f8b2['body']['ListId'],'active':!_[_0x47a5('0x6d')](_0x18f8b2[_0x47a5('0x59')]['active'])?_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x6e')]:!![],'description':_0x18f8b2['body'][_0x47a5('0x6f')]||null,'Imap':{},'Smtp':{}};if(_[_0x47a5('0x6d')](_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x70')])){if(_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x71')]){_0x2fd46f['Imap']['user']=_0x2fd46f['Smtp'][_0x47a5('0x72')]=_0x18f8b2[_0x47a5('0x59')]['cuser'];_0x2fd46f[_0x47a5('0x3c')][_0x47a5('0x73')]=_0x2fd46f[_0x47a5('0x74')][_0x47a5('0x75')]=_0x18f8b2[_0x47a5('0x59')]['cpassword'];}else{_0x2fd46f[_0x47a5('0x3c')]['authentication']=_0x2fd46f['Smtp']['authentication']=![];}_0x2fd46f[_0x47a5('0x3c')]['host']=_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x3c')][_0x47a5('0x76')];_0x2fd46f['Imap'][_0x47a5('0x77')]=_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x3c')][_0x47a5('0x77')];_0x2fd46f[_0x47a5('0x74')]['host']=_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x74')]['host'];_0x2fd46f[_0x47a5('0x74')][_0x47a5('0x77')]=_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x74')][_0x47a5('0x77')];}else{_0x2fd46f[_0x47a5('0x3c')]['service']=_0x2fd46f[_0x47a5('0x74')][_0x47a5('0x78')]=_0x18f8b2['body'][_0x47a5('0x70')];_0x2fd46f[_0x47a5('0x3c')][_0x47a5('0x72')]=_0x2fd46f[_0x47a5('0x74')]['user']=_0x18f8b2['body']['cuser'];_0x2fd46f['Imap'][_0x47a5('0x73')]=_0x2fd46f[_0x47a5('0x74')][_0x47a5('0x75')]=_0x18f8b2[_0x47a5('0x59')][_0x47a5('0x79')];}return db[_0x47a5('0x54')][_0x47a5('0x69')](_0x2fd46f,{'include':[{'model':db[_0x47a5('0x3d')],'as':'Smtp'},{'model':db[_0x47a5('0x57')],'as':_0x47a5('0x3c')}]})[_0x47a5('0x37')](function(_0x399528){var _0x47be87=_0x18f8b2['user'][_0x47a5('0x7a')]({'plain':!![]});if(!_0x47be87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47be87['role']===_0x47a5('0x72')){var _0x3f0a15=_0x399528['get']({'plain':!![]});return db[_0x47a5('0x7b')][_0x47a5('0x5a')]({'where':{'name':_0x47a5('0x35'),'userProfileId':_0x47be87['userProfileId']},'raw':!![]})[_0x47a5('0x37')](function(_0xee23c7){if(_0xee23c7&&_0xee23c7['autoAssociation']===0x0){return db[_0x47a5('0x36')][_0x47a5('0x69')]({'name':_0x3f0a15[_0x47a5('0x3a')],'resourceId':_0x3f0a15['id'],'type':_0xee23c7[_0x47a5('0x3a')],'sectionId':_0xee23c7['id']},{})[_0x47a5('0x37')](function(){return _0x399528;});}else{return _0x399528;}})[_0x47a5('0x2a')](function(_0x482c87){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x482c87);throw _0x482c87;});}return _0x399528;})[_0x47a5('0x37')](respondWithResult(_0x59266f,0xc9))[_0x47a5('0x2a')](handleError(_0x59266f,null));};exports[_0x47a5('0x7c')]=function(_0x25f188,_0x522972,_0x3d93ad){return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x25f188[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x522972,null))[_0x47a5('0x37')](function(_0x31b8b1){if(_0x31b8b1){return _0x31b8b1[_0x47a5('0x7c')]();}return null;})[_0x47a5('0x37')](respondWithResult(_0x522972,null))[_0x47a5('0x2a')](handleError(_0x522972,null));};exports[_0x47a5('0x7d')]=function(_0x301031,_0x52a2be,_0x4218fd){if(_0x301031[_0x47a5('0x59')]['id']){delete _0x301031['body']['id'];}return db[_0x47a5('0x54')][_0x47a5('0x5a')]({'where':{'id':_0x301031[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x52a2be,null))[_0x47a5('0x37')](function(_0x58fac0){if(_0x58fac0){_0x301031[_0x47a5('0x59')][_0x47a5('0x5e')]=_0x58fac0['id'];return db[_0x47a5('0x57')][_0x47a5('0x69')](_0x301031[_0x47a5('0x59')]);}})[_0x47a5('0x37')](respondWithResult(_0x52a2be,null))[_0x47a5('0x2a')](handleError(_0x52a2be,null));};exports['removeImap']=function(_0x596562,_0xa3d578,_0x580ce8){return db[_0x47a5('0x54')]['findOne']({'where':{'id':_0x596562[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0xa3d578,null))[_0x47a5('0x37')](function(_0x2bc7ae){if(_0x2bc7ae){return _0x2bc7ae['setImap'](null);}return null;})[_0x47a5('0x37')](respondWithStatusCode(_0xa3d578,null))[_0x47a5('0x2a')](handleError(_0xa3d578,null));};exports[_0x47a5('0x7e')]=function(_0x5a150a,_0x581759,_0x30375f){return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x5a150a[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x581759,null))[_0x47a5('0x37')](function(_0x1c0323){if(_0x1c0323){return _0x1c0323[_0x47a5('0x7e')]();}return null;})['then'](respondWithResult(_0x581759,null))[_0x47a5('0x2a')](handleError(_0x581759,null));};exports['addSmtp']=function(_0x346322,_0xc3b5e1,_0x5b0b0b){if(_0x346322['body']['id']){delete _0x346322[_0x47a5('0x59')]['id'];}return db[_0x47a5('0x54')]['find']({'where':{'id':_0x346322[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0xc3b5e1,null))[_0x47a5('0x37')](function(_0x44567e){if(_0x44567e){_0x346322['body'][_0x47a5('0x5e')]=_0x44567e['id'];return db['MailServerOut']['create'](_0x346322['body']);}})[_0x47a5('0x37')](respondWithResult(_0xc3b5e1,null))['catch'](handleError(_0xc3b5e1,null));};exports[_0x47a5('0x7f')]=function(_0x156d51,_0x401139,_0x2005d5){return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x156d51[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x401139,null))[_0x47a5('0x37')](function(_0x2200f9){if(_0x2200f9){return _0x2200f9[_0x47a5('0x80')](null);}return null;})[_0x47a5('0x37')](respondWithStatusCode(_0x401139,null))[_0x47a5('0x2a')](handleError(_0x401139,null));};exports[_0x47a5('0x81')]=function(_0xff64fb,_0x5e17cb,_0xdd95c8){return db[_0x47a5('0x82')][_0x47a5('0x5a')]({'where':{'id':_0xff64fb[_0x47a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5e17cb,null))[_0x47a5('0x37')](function(_0x49998b){if(_0x49998b){return _0x49998b[_0x47a5('0x81')](_0xff64fb['body'][_0x47a5('0x67')],_[_0x47a5('0x83')](_0xff64fb[_0x47a5('0x59')],['ids','id'])||{});}})[_0x47a5('0x37')](respondWithResult(_0x5e17cb,null))[_0x47a5('0x2a')](handleError(_0x5e17cb,null));};exports[_0x47a5('0x84')]=function(_0x4ac804,_0x52798d,_0x20f320){var _0x1a5e07={'raw':![],'where':{}};var _0x31c88c={};var _0x4594df={'count':0x0,'rows':[]};return db[_0x47a5('0x54')]['findOne']({'where':{'id':_0x4ac804[_0x47a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x52798d,null))[_0x47a5('0x37')](function(_0xdeaf4e){if(_0xdeaf4e){_0x31c88c[_0x47a5('0x44')]=_[_0x47a5('0x47')](db['MailInteraction']['rawAttributes']);_0x31c88c[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0x4ac804[_0x47a5('0x46')]);_0x31c88c[_0x47a5('0x48')]=_[_0x47a5('0x49')](_0x31c88c[_0x47a5('0x44')],_0x31c88c[_0x47a5('0x46')]);_0x1a5e07[_0x47a5('0x4b')]=_[_0x47a5('0x49')](_0x31c88c['model'],qs['fields'](_0x4ac804[_0x47a5('0x46')]['fields']));_0x1a5e07[_0x47a5('0x4b')]=_0x1a5e07[_0x47a5('0x4b')][_0x47a5('0x62')]?_0x1a5e07['attributes']:_0x31c88c[_0x47a5('0x44')];if(!_0x4ac804[_0x47a5('0x46')]['hasOwnProperty'](_0x47a5('0x4c'))){_0x1a5e07['limit']=qs[_0x47a5('0x30')](_0x4ac804[_0x47a5('0x46')][_0x47a5('0x30')]);_0x1a5e07['offset']=qs['offset'](_0x4ac804['query']['offset']);}_0x1a5e07['order']=qs[_0x47a5('0x4d')](_0x4ac804['query'][_0x47a5('0x4d')]);_0x1a5e07[_0x47a5('0x4e')]=qs['filters'](_['pick'](_0x4ac804['query'],_0x31c88c[_0x47a5('0x48')]));_0x1a5e07['where']['MailAccountId']=_0xdeaf4e['id'];if(_0x4ac804['query'][_0x47a5('0x50')]){_0x1a5e07[_0x47a5('0x4e')]=_[_0x47a5('0x51')](_0x1a5e07[_0x47a5('0x4e')],{'$or':_['map'](_0x1a5e07[_0x47a5('0x4b')],function(_0x559943){var _0x2b6f9e={};_0x2b6f9e[_0x559943]={'$like':'%'+_0x4ac804['query'][_0x47a5('0x50')]+'%'};return _0x2b6f9e;})});}_0x1a5e07=_[_0x47a5('0x51')]({},_0x1a5e07,_0x4ac804[_0x47a5('0x58')]);return db['MailInteraction'][_0x47a5('0x2e')]({'where':_0x1a5e07[_0x47a5('0x4e')]})[_0x47a5('0x37')](function(_0x31100e){_0x4594df['count']=_0x31100e;if(_0x4ac804[_0x47a5('0x46')][_0x47a5('0x52')]){_0x1a5e07[_0x47a5('0x53')]=[{'model':db[_0x47a5('0x85')],'as':_0x47a5('0x86'),'required':![]},{'model':db[_0x47a5('0x87')],'as':'Owner','attributes':[_0x47a5('0x3a'),_0x47a5('0x88'),_0x47a5('0x89')],'required':![]},{'model':db[_0x47a5('0x8a')],'as':_0x47a5('0x8b'),'attributes':['id',_0x47a5('0x3a'),_0x47a5('0x8c')],'where':_0x4ac804[_0x47a5('0x46')][_0x47a5('0x8d')]?{'id':_0x4ac804[_0x47a5('0x46')][_0x47a5('0x8d')]}:undefined,'required':_0x4ac804[_0x47a5('0x46')][_0x47a5('0x8d')]?!![]:![]}];}return db[_0x47a5('0x82')][_0x47a5('0x55')](_0x1a5e07);})[_0x47a5('0x37')](function(_0x40505e){_0x4594df['rows']=_0x40505e;return _0x4594df;});}})[_0x47a5('0x37')](respondWithFilteredResult(_0x52798d,_0x1a5e07))['catch'](handleError(_0x52798d,null));};exports['addApplications']=function(_0x1542b9,_0x154365,_0x36f910){return db['MailAccount'][_0x47a5('0x61')]({'where':{'id':_0x1542b9[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x154365,null))[_0x47a5('0x37')](function(_0x30e5fb){if(_0x30e5fb){return db[_0x47a5('0x8e')][_0x47a5('0x8f')](function(_0x46cb3a){return db[_0x47a5('0x90')][_0x47a5('0x91')]({'where':{'MailAccountId':_0x1542b9[_0x47a5('0x5b')]['id']},'transaction':_0x46cb3a})[_0x47a5('0x37')](function(_0x203bc9){var _0x4d7fd4=_['map'](_0x1542b9[_0x47a5('0x59')],function(_0x5e7d56){_0x5e7d56[_0x47a5('0x5e')]=_0x1542b9[_0x47a5('0x5b')]['id'];return _0x5e7d56;});return db[_0x47a5('0x90')][_0x47a5('0x92')](_0x4d7fd4,{'transaction':_0x46cb3a});});})[_0x47a5('0x37')](function(){return db[_0x47a5('0x90')]['findAndCountAll']({'where':{'MailAccountId':_0x1542b9[_0x47a5('0x5b')]['id']},'order':_0x47a5('0x93')});});}})[_0x47a5('0x37')](respondWithResult(_0x154365,null))['catch'](handleError(_0x154365,null));};exports[_0x47a5('0x94')]=function(_0x439f60,_0x3ecc41,_0x3e4148){var _0x4c46ea={};var _0x23e649={};var _0x35e20f;var _0x46615a;return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x439f60[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x3ecc41,null))[_0x47a5('0x37')](function(_0x2ac386){if(_0x2ac386){_0x35e20f=_0x2ac386;_0x23e649[_0x47a5('0x44')]=_[_0x47a5('0x47')](db[_0x47a5('0x90')][_0x47a5('0x40')]);_0x23e649[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0x439f60[_0x47a5('0x46')]);_0x23e649[_0x47a5('0x48')]=_['intersection'](_0x23e649[_0x47a5('0x44')],_0x23e649['query']);_0x4c46ea[_0x47a5('0x4b')]=_[_0x47a5('0x49')](_0x23e649[_0x47a5('0x44')],qs[_0x47a5('0x4a')](_0x439f60[_0x47a5('0x46')][_0x47a5('0x4a')]));_0x4c46ea[_0x47a5('0x4b')]=_0x4c46ea[_0x47a5('0x4b')]['length']?_0x4c46ea[_0x47a5('0x4b')]:_0x23e649[_0x47a5('0x44')];_0x4c46ea[_0x47a5('0x64')]=qs['sort'](_0x439f60[_0x47a5('0x46')][_0x47a5('0x4d')]);_0x4c46ea[_0x47a5('0x4e')]=qs[_0x47a5('0x48')](_['pick'](_0x439f60[_0x47a5('0x46')],_0x23e649[_0x47a5('0x48')]));if(_0x439f60[_0x47a5('0x46')][_0x47a5('0x50')]){_0x4c46ea['where']=_[_0x47a5('0x51')](_0x4c46ea['where'],{'$or':_['map'](_0x4c46ea[_0x47a5('0x4b')],function(_0x1efae8){var _0x407fd2={};_0x407fd2[_0x1efae8]={'$like':'%'+_0x439f60[_0x47a5('0x46')]['filter']+'%'};return _0x407fd2;})});}_0x4c46ea=_[_0x47a5('0x51')]({},_0x4c46ea,_0x439f60[_0x47a5('0x58')]);return _0x35e20f[_0x47a5('0x94')](_0x4c46ea);}})[_0x47a5('0x37')](function(_0xf470f5){if(_0xf470f5){_0x46615a=_0xf470f5[_0x47a5('0x62')];if(!_0x439f60['query'][_0x47a5('0x63')](_0x47a5('0x4c'))){_0x4c46ea[_0x47a5('0x30')]=qs[_0x47a5('0x30')](_0x439f60[_0x47a5('0x46')]['limit']);_0x4c46ea[_0x47a5('0x2f')]=qs['offset'](_0x439f60[_0x47a5('0x46')]['offset']);}return _0x35e20f[_0x47a5('0x94')](_0x4c46ea);}})['then'](function(_0x56a3c4){if(_0x56a3c4){return _0x56a3c4?{'count':_0x46615a,'rows':_0x56a3c4}:null;}})[_0x47a5('0x37')](respondWithResult(_0x3ecc41,null))[_0x47a5('0x2a')](handleError(_0x3ecc41,null));};exports['getMessages']=function(_0xa07bc6,_0x2d7e13,_0x530542){var _0x3a09e6={'raw':!![],'where':{}};var _0x112e1e={};var _0x36871e={'count':0x0,'rows':[]};return db['MailAccount'][_0x47a5('0x61')]({'where':{'id':_0xa07bc6[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x2d7e13,null))[_0x47a5('0x37')](function(_0x37721c){if(_0x37721c){_0x112e1e['model']=_['keys'](db[_0x47a5('0x95')]['rawAttributes']);_0x112e1e[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0xa07bc6['query']);_0x112e1e['filters']=_[_0x47a5('0x49')](_0x112e1e['model'],_0x112e1e[_0x47a5('0x46')]);_0x3a09e6[_0x47a5('0x4b')]=_[_0x47a5('0x49')](_0x112e1e[_0x47a5('0x44')],qs[_0x47a5('0x4a')](_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x4a')]));_0x3a09e6['attributes']=_0x3a09e6[_0x47a5('0x4b')]['length']?_0x3a09e6[_0x47a5('0x4b')]:_0x112e1e[_0x47a5('0x44')];if(!_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x63')](_0x47a5('0x4c'))){_0x3a09e6[_0x47a5('0x30')]=qs[_0x47a5('0x30')](_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x30')]);_0x3a09e6[_0x47a5('0x2f')]=qs[_0x47a5('0x2f')](_0xa07bc6[_0x47a5('0x46')]['offset']);}_0x3a09e6[_0x47a5('0x64')]=qs[_0x47a5('0x4d')](_0xa07bc6[_0x47a5('0x46')]['sort']);_0x3a09e6[_0x47a5('0x4e')]=qs[_0x47a5('0x48')](_[_0x47a5('0x4f')](_0xa07bc6[_0x47a5('0x46')],_0x112e1e[_0x47a5('0x48')]));_0x3a09e6[_0x47a5('0x4e')]['MailAccountId']=_0x37721c['id'];if(_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x50')]){_0x3a09e6[_0x47a5('0x4e')]=_[_0x47a5('0x51')](_0x3a09e6[_0x47a5('0x4e')],{'$or':_[_0x47a5('0x45')](_0x3a09e6[_0x47a5('0x4b')],function(_0x188bdf){var _0x355c4b={};_0x355c4b[_0x188bdf]={'$like':'%'+_0xa07bc6[_0x47a5('0x46')]['filter']+'%'};return _0x355c4b;})});}if(_0xa07bc6['query'][_0x47a5('0x96')]){var _0x144524=_0xa07bc6[_0x47a5('0x46')]['$gte'][_0x47a5('0x97')](',');var _0x50b7fc={};_0x50b7fc[_0x144524[0x0]]={'$gte':moment(_0x144524[0x1])['format'](_0x47a5('0x98'))};_0x3a09e6[_0x47a5('0x4e')]=_[_0x47a5('0x51')](_0x3a09e6[_0x47a5('0x4e')],_0x50b7fc);}_0x3a09e6=_['merge']({},_0x3a09e6,_0xa07bc6[_0x47a5('0x58')]);return db[_0x47a5('0x95')]['count']({'where':_0x3a09e6['where']})['then'](function(_0x28a52a){_0x36871e[_0x47a5('0x2e')]=_0x28a52a;if(_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x52')]){_0x3a09e6[_0x47a5('0x53')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x3a09e6);})[_0x47a5('0x37')](function(_0x1b0fd4){if(_0xa07bc6[_0x47a5('0x46')][_0x47a5('0x99')]==='true'){for(var _0x873e26=0x0;_0x873e26<_0x1b0fd4[_0x47a5('0x62')];_0x873e26++){_0x1b0fd4[_0x873e26][_0x47a5('0x59')]=juice(_0x1b0fd4[_0x873e26][_0x47a5('0x59')]);}}_0x36871e['rows']=_0x1b0fd4;return _0x36871e;});}})['then'](respondWithFilteredResult(_0x2d7e13,_0x3a09e6))['catch'](handleError(_0x2d7e13,null));};exports[_0x47a5('0x9a')]=function(_0x15ddfc,_0x156ceb,_0x3c6142){var _0x242006,_0x1441c3={},_0x3bcdbc;if(_0x15ddfc[_0x47a5('0x59')]['to']){_0x3bcdbc=_0x15ddfc[_0x47a5('0x59')]['to']['split'](',')[0x0];}return db[_0x47a5('0x54')][_0x47a5('0x5a')]({'where':{'id':_0x15ddfc['params']['id']},'include':[{'model':db[_0x47a5('0x9b')],'as':_0x47a5('0x9c'),'include':[{'model':db[_0x47a5('0x85')],'as':_0x47a5('0x9d'),'where':{'email':_0x3bcdbc},'limit':0x1,'order':[['updatedAt',_0x47a5('0x9e')]]}]},{'model':db[_0x47a5('0x3d')],'as':_0x47a5('0x74'),'raw':!![]}]})['then'](handleEntityNotFound(_0x156ceb,null))['then'](function(_0x27a666){if(_0x27a666){_0x242006=_0x27a666;if(_0x27a666['Smtp']){if(_[_0x47a5('0x6d')](_0x15ddfc['body'][_0x47a5('0x9f')])){_0x15ddfc[_0x47a5('0x59')][_0x47a5('0x9f')]=util[_0x47a5('0xa0')](_0x47a5('0xa1'),_0x27a666['name'],_0x27a666['email']||_0x27a666[_0x47a5('0x74')][_0x47a5('0x72')]);}if(_0x15ddfc[_0x47a5('0x59')][_0x47a5('0xa2')]&&_0x15ddfc['body']['attachments'][_0x47a5('0x62')]){for(var _0x4c9f4f=0x0;_0x4c9f4f<_0x15ddfc[_0x47a5('0x59')]['attachments'][_0x47a5('0x62')];_0x4c9f4f+=0x1){_0x15ddfc['body'][_0x47a5('0xa2')][_0x4c9f4f]={'filename':_0x15ddfc[_0x47a5('0x59')][_0x47a5('0xa2')][_0x4c9f4f][_0x47a5('0x3a')],'path':path[_0x47a5('0xa3')](config[_0x47a5('0xa4')],_0x47a5('0xa5'),_0x15ddfc[_0x47a5('0x59')]['attachments'][_0x4c9f4f][_0x47a5('0xa6')])};}}var _0x4394f0={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x27a666[_0x47a5('0x74')][_0x47a5('0x78')])){if(_0x27a666['Smtp']['authentication']){_0x4394f0[_0x47a5('0xa7')]={'user':_0x27a666['Smtp'][_0x47a5('0x72')],'pass':_0x27a666[_0x47a5('0x74')][_0x47a5('0x75')]};}_0x4394f0['host']=_0x27a666[_0x47a5('0x74')][_0x47a5('0x76')];_0x4394f0[_0x47a5('0x77')]=_0x27a666[_0x47a5('0x74')][_0x47a5('0x77')];_0x4394f0[_0x47a5('0xa8')]=_0x27a666[_0x47a5('0x74')]['secure'];}else{_0x4394f0[_0x47a5('0x78')]=_0x27a666[_0x47a5('0x74')][_0x47a5('0x78')];_0x4394f0[_0x47a5('0xa7')]={'user':_0x27a666[_0x47a5('0x74')][_0x47a5('0x72')],'pass':_0x27a666[_0x47a5('0x74')]['pass']};}return respondWithRpcPromise('SendMail',_0x47a5('0xa9'),{'account':_0x4394f0,'message':_0x15ddfc[_0x47a5('0x59')]});}else{throw new Error(_0x47a5('0xaa'));}}})['then'](function(_0x5d2a10){if(_0x5d2a10){_0x1441c3=_0x5d2a10;if(_0x242006[_0x47a5('0x9c')]){if(_0x242006[_0x47a5('0x9c')][_0x47a5('0x9d')][_0x47a5('0x62')]){return _0x242006[_0x47a5('0x9c')][_0x47a5('0x9d')][0x0];}else{return db[_0x47a5('0x85')]['create'](_[_0x47a5('0x18')](_0x15ddfc[_0x47a5('0x59')],{'firstName':_0x15ddfc[_0x47a5('0x59')]['to'],'email':_0x15ddfc['body']['to'],'phone':_0x15ddfc[_0x47a5('0x59')]['to'],'ListId':_0x242006[_0x47a5('0xab')]}));}}else{throw new Error(_0x47a5('0xaa'));}}})[_0x47a5('0x37')](function(_0x38aab1){if(_0x38aab1){var _0x20eff3={'UserId':_0x15ddfc[_0x47a5('0x72')]['id'],'ContactId':_0x38aab1['id'],'MailAccountId':_0x242006['id'],'inReplyTo':_0x1441c3[_0x47a5('0xac')],'to':_0x15ddfc[_0x47a5('0x59')][_0x47a5('0x9f')],'cc':_0x15ddfc[_0x47a5('0x59')]['cc'],'subject':_0x15ddfc[_0x47a5('0x59')][_0x47a5('0xad')],'attach':_0x15ddfc['body'][_0x47a5('0xae')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x47a5('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x47a5('0xaf'),'Messages':[_[_0x47a5('0x51')](_0x15ddfc[_0x47a5('0x59')],{'messageId':_0x1441c3['messageId'],'sentAt':moment()[_0x47a5('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x242006['id'],'UserId':_0x15ddfc[_0x47a5('0x72')]['id'],'ContactId':_0x38aab1['id']})]};if(_0x15ddfc[_0x47a5('0x59')][_0x47a5('0xb0')]){_0x20eff3=_[_0x47a5('0x51')](_0x20eff3,_0x15ddfc['body'][_0x47a5('0xb0')]);}return db['MailInteraction']['create'](_0x20eff3,{'include':[{'model':db[_0x47a5('0x95')],'as':_0x47a5('0xb1')}]});}})[_0x47a5('0x37')](respondWithResult(_0x156ceb,null))[_0x47a5('0x2a')](handleError(_0x156ceb,null));};exports[_0x47a5('0xb2')]=function(_0x11ae07,_0x10a789,_0x33ac8b){return db[_0x47a5('0x54')]['find']({'where':{'id':_0x11ae07['params']['id']},'include':[{'model':db[_0x47a5('0x3d')],'as':_0x47a5('0x74'),'raw':!![]}]})[_0x47a5('0x37')](handleEntityNotFound(_0x10a789,null))[_0x47a5('0x37')](function(_0x616b88){if(_0x616b88&&_0x616b88['Smtp']){var _0x3cfa62={'id':_0x616b88['id'],'tls':{'rejectUnauthorized':![]}};if(_0x616b88[_0x47a5('0x74')][_0x47a5('0x78')]){_0x3cfa62['service']=_0x616b88['Smtp'][_0x47a5('0x78')];}else{_0x3cfa62[_0x47a5('0x76')]=_0x616b88['Smtp'][_0x47a5('0x76')];_0x3cfa62[_0x47a5('0x77')]=_0x616b88[_0x47a5('0x74')]['port'];_0x3cfa62[_0x47a5('0xa8')]=_0x616b88[_0x47a5('0x74')][_0x47a5('0xa8')];}if(_0x616b88[_0x47a5('0x74')][_0x47a5('0xb3')]){_0x3cfa62['auth']={'user':_0x616b88[_0x47a5('0x74')][_0x47a5('0x72')],'pass':_0x616b88[_0x47a5('0x74')][_0x47a5('0x75')]};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x3cfa62});}})[_0x47a5('0x37')](respondWithResult(_0x10a789,null))['catch'](handleError(_0x10a789,null));};exports[_0x47a5('0x91')]=function(_0xe66584,_0x17a4c2){return db[_0x47a5('0x54')][_0x47a5('0x5a')]({'where':{'id':_0xe66584[_0x47a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x17a4c2,null))[_0x47a5('0x37')](function(_0x4035c6){if(_0x4035c6&&_0x4035c6[_0x47a5('0x78')]){throw new db['Sequelize']['ValidationError'](_0x47a5('0xb4'));}return _0x4035c6;})['then'](removeEntity(_0x17a4c2,null))[_0x47a5('0x2a')](handleError(_0x17a4c2,null));};exports[_0x47a5('0xb5')]=function(_0x3641f8,_0x22390f,_0x184d43){return db['MailAccount']['find']({'where':{'id':_0x3641f8[_0x47a5('0x5b')]['id']}})[_0x47a5('0x37')](handleEntityNotFound(_0x22390f,null))[_0x47a5('0x37')](function(_0x9fdee1){if(_0x9fdee1){return _0x9fdee1[_0x47a5('0xb5')](_0x3641f8['body'][_0x47a5('0x67')],_[_0x47a5('0x83')](_0x3641f8[_0x47a5('0x59')],[_0x47a5('0x67'),'id'])||{})[_0x47a5('0xb6')](function(_0x4df71d){for(var _0x28a5f3=0x0;_0x28a5f3<_0x3641f8[_0x47a5('0x59')][_0x47a5('0x67')][_0x47a5('0x62')];_0x28a5f3+=0x1){socket[_0x47a5('0xb7')](_0x47a5('0xb8'),{'UserId':_0x3641f8[_0x47a5('0x59')][_0x47a5('0x67')][_0x28a5f3],'MailAccountId':_0x3641f8[_0x47a5('0x5b')]['id']});}return _0x4df71d;});}})[_0x47a5('0x37')](respondWithResult(_0x22390f,null))[_0x47a5('0x2a')](handleError(_0x22390f,null));};exports['removeAgents']=function(_0x39786a,_0x1ccb2e,_0x19f0da){return db[_0x47a5('0x54')]['find']({'where':{'id':_0x39786a['params']['id']}})['then'](handleEntityNotFound(_0x1ccb2e,null))[_0x47a5('0x37')](function(_0x52e921){if(_0x52e921){return _0x52e921[_0x47a5('0xb9')](_0x39786a[_0x47a5('0x46')]['ids'])[_0x47a5('0x37')](function(){if(_[_0x47a5('0xba')](_0x39786a[_0x47a5('0x46')]['ids'])){for(var _0x457398=0x0;_0x457398<_0x39786a['query'][_0x47a5('0x67')][_0x47a5('0x62')];_0x457398+=0x1){socket[_0x47a5('0xb7')](_0x47a5('0xbb'),{'UserId':Number(_0x39786a[_0x47a5('0x46')][_0x47a5('0x67')][_0x457398]),'MailAccountId':Number(_0x39786a['params']['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x39786a[_0x47a5('0x46')][_0x47a5('0x67')]),'MailAccountId':Number(_0x39786a[_0x47a5('0x5b')]['id'])});}});}})[_0x47a5('0x37')](respondWithStatusCode(_0x1ccb2e,null))[_0x47a5('0x2a')](handleError(_0x1ccb2e,null));};exports[_0x47a5('0xbc')]=function(_0x338c9d,_0x138b92,_0x232c36){var _0x25954e={};var _0x277061={};var _0x3917e0;var _0x1c7695;return db[_0x47a5('0x54')][_0x47a5('0x61')]({'where':{'id':_0x338c9d[_0x47a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x138b92,null))[_0x47a5('0x37')](function(_0x46b82a){if(_0x46b82a){_0x3917e0=_0x46b82a;_0x277061[_0x47a5('0x44')]=_[_0x47a5('0x47')](db[_0x47a5('0x87')][_0x47a5('0x40')]);_0x277061[_0x47a5('0x46')]=_[_0x47a5('0x47')](_0x338c9d['query']);_0x277061[_0x47a5('0x48')]=_['intersection'](_0x277061[_0x47a5('0x44')],_0x277061[_0x47a5('0x46')]);_0x25954e['attributes']=_[_0x47a5('0x49')](_0x277061['model'],qs[_0x47a5('0x4a')](_0x338c9d[_0x47a5('0x46')][_0x47a5('0x4a')]));_0x25954e[_0x47a5('0x4b')]=_0x25954e[_0x47a5('0x4b')]['length']?_0x25954e[_0x47a5('0x4b')]:_0x277061[_0x47a5('0x44')];_0x25954e[_0x47a5('0x64')]=qs['sort'](_0x338c9d['query'][_0x47a5('0x4d')]);_0x25954e[_0x47a5('0x4e')]=qs[_0x47a5('0x48')](_['pick'](_0x338c9d[_0x47a5('0x46')],_0x277061[_0x47a5('0x48')]));if(_0x338c9d[_0x47a5('0x46')]['filter']){_0x25954e[_0x47a5('0x4e')]=_[_0x47a5('0x51')](_0x25954e[_0x47a5('0x4e')],{'$or':_[_0x47a5('0x45')](_0x25954e['attributes'],function(_0x1a1be9){var _0x5d6808={};_0x5d6808[_0x1a1be9]={'$like':'%'+_0x338c9d[_0x47a5('0x46')][_0x47a5('0x50')]+'%'};return _0x5d6808;})});}_0x25954e=_[_0x47a5('0x51')]({},_0x25954e,_0x338c9d[_0x47a5('0x58')]);return _0x3917e0['getAgents'](_0x25954e);}})[_0x47a5('0x37')](function(_0x147d77){if(_0x147d77){_0x1c7695=_0x147d77[_0x47a5('0x62')];if(!_0x338c9d[_0x47a5('0x46')][_0x47a5('0x63')]('nolimit')){_0x25954e[_0x47a5('0x30')]=qs[_0x47a5('0x30')](_0x338c9d[_0x47a5('0x46')][_0x47a5('0x30')]);_0x25954e[_0x47a5('0x2f')]=qs[_0x47a5('0x2f')](_0x338c9d['query'][_0x47a5('0x2f')]);}return _0x3917e0[_0x47a5('0xbc')](_0x25954e);}})['then'](function(_0x556e8e){if(_0x556e8e){return _0x556e8e?{'count':_0x1c7695,'rows':_0x556e8e}:null;}})[_0x47a5('0x37')](respondWithResult(_0x138b92,null))[_0x47a5('0x2a')](handleError(_0x138b92,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 7e6c596..3a55bde 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 _0x5f83=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x102f4c,_0x58899b){var _0x5942e2=function(_0x2acb45){while(--_0x2acb45){_0x102f4c['push'](_0x102f4c['shift']());}};_0x5942e2(++_0x58899b);}(_0x5f83,0x8f));var _0x35f8=function(_0x4fcc08,_0x502069){_0x4fcc08=_0x4fcc08-0x0;var _0x3c32ab=_0x5f83[_0x4fcc08];return _0x3c32ab;};'use strict';var EventEmitter=require(_0x35f8('0x0'));var MailAccount=require(_0x35f8('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x35f8('0x2')](0x0);var events={'afterCreate':_0x35f8('0x3'),'afterUpdate':_0x35f8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1943e2){return function(_0x1d2ecf,_0x452604,_0x5296da){MailAccountEvents[_0x35f8('0x5')](_0x1943e2+':'+_0x1d2ecf['id'],_0x1d2ecf);MailAccountEvents['emit'](_0x1943e2,_0x1d2ecf);_0x5296da(null);};}for(var e in events){if(events[_0x35f8('0x6')](e)){var event=events[e];MailAccount[_0x35f8('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x17c9=['events','../../mysqldb','MailAccount','setMaxListeners','save','emit','hasOwnProperty','exports'];(function(_0x9618c0,_0x4aa509){var _0x2acfcc=function(_0x2f9d14){while(--_0x2f9d14){_0x9618c0['push'](_0x9618c0['shift']());}};_0x2acfcc(++_0x4aa509);}(_0x17c9,0xc0));var _0x917c=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x17c9[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0x917c('0x0'));var MailAccount=require(_0x917c('0x1'))['db'][_0x917c('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x917c('0x3')](0x0);var events={'afterCreate':_0x917c('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5b6079){return function(_0x4f9e6b,_0x32446b,_0x472bd9){MailAccountEvents['emit'](_0x5b6079+':'+_0x4f9e6b['id'],_0x4f9e6b);MailAccountEvents[_0x917c('0x5')](_0x5b6079,_0x4f9e6b);_0x472bd9(null);};}for(var e in events){if(events[_0x917c('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x917c('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index d30f330..5e36d88 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 _0x9435=['exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailAccount.attributes'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x9435,0x93));var _0x5943=function(_0x2bcfcf,_0x43e5b3){_0x2bcfcf=_0x2bcfcf-0x0;var _0x1eabfb=_0x9435[_0x2bcfcf];return _0x1eabfb;};'use strict';var _=require(_0x5943('0x0'));var util=require(_0x5943('0x1'));var logger=require(_0x5943('0x2'))(_0x5943('0x3'));var moment=require('moment');var BPromise=require(_0x5943('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5943('0x5'));var rimraf=require(_0x5943('0x6'));var config=require(_0x5943('0x7'));var attributes=require(_0x5943('0x8'));module[_0x5943('0x9')]=function(_0x42f32e,_0x114c6c){return _0x42f32e[_0x5943('0xa')](_0x5943('0xb'),attributes,{'tableName':_0x5943('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65aa=['bluebird','request-promise','rimraf','../../config/environment','./mailAccount.attributes','exports','MailAccount','../../config/logger','moment'];(function(_0x315756,_0x335548){var _0x905fc2=function(_0x2fd6a4){while(--_0x2fd6a4){_0x315756['push'](_0x315756['shift']());}};_0x905fc2(++_0x335548);}(_0x65aa,0x142));var _0xa65a=function(_0x115258,_0x34ed11){_0x115258=_0x115258-0x0;var _0x23b6a4=_0x65aa[_0x115258];return _0x23b6a4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa65a('0x0'))('api');var moment=require(_0xa65a('0x1'));var BPromise=require(_0xa65a('0x2'));var rp=require(_0xa65a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa65a('0x4'));var config=require(_0xa65a('0x5'));var attributes=require(_0xa65a('0x6'));module[_0xa65a('0x7')]=function(_0xae21e9,_0x2b387d){return _0xae21e9['define'](_0xa65a('0x8'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index b6708f6..7888532 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 _0xcfb6=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailAccount','options','where','attributes','limit','include','map','model','GetMailAccount','debug','ShowMailAccount','find','raw','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','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','CmList','Contacts','updatedAt','DESC','Applications','get','account','omit','List','applications','asc','length','close','autoclose','*,*,*,*','create','contact','generate','messageId','subject','attach','format','MailMessage','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird'];(function(_0x5669e4,_0x3c309a){var _0xafeea3=function(_0x2d39d1){while(--_0x2d39d1){_0x5669e4['push'](_0x5669e4['shift']());}};_0xafeea3(++_0x3c309a);}(_0xcfb6,0x198));var _0x6cfb=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0xcfb6[_0x2c1114];return _0x2b877c;};'use strict';var _=require(_0x6cfb('0x0'));var util=require(_0x6cfb('0x1'));var moment=require(_0x6cfb('0x2'));var BPromise=require(_0x6cfb('0x3'));var rs=require(_0x6cfb('0x4'));var fs=require('fs');var Redis=require(_0x6cfb('0x5'));var db=require(_0x6cfb('0x6'))['db'];var utils=require(_0x6cfb('0x7'));var logger=require('../../config/logger')(_0x6cfb('0x8'));var config=require(_0x6cfb('0x9'));var jayson=require(_0x6cfb('0xa'));var client=jayson['client']['http']({'port':0x232c});config[_0x6cfb('0xb')]=_['defaults'](config['redis'],{'host':_0x6cfb('0xc'),'port':0x18eb});var socket=require(_0x6cfb('0xd'))(new Redis(config[_0x6cfb('0xb')]));require(_0x6cfb('0xe'))[_0x6cfb('0xf')](socket);function respondWithRpcPromise(_0x3af316,_0x2d4a2e,_0x1d84eb){return new BPromise(function(_0xec71b5,_0x580056){return client[_0x6cfb('0x10')](_0x3af316,_0x1d84eb)[_0x6cfb('0x11')](function(_0x5327cc){logger[_0x6cfb('0x12')](_0x6cfb('0x13'),_0x2d4a2e,_0x6cfb('0x14'));logger['debug'](_0x6cfb('0x15'),_0x2d4a2e,_0x6cfb('0x14'),JSON[_0x6cfb('0x16')](_0x5327cc));if(_0x5327cc[_0x6cfb('0x17')]){if(_0x5327cc['error'][_0x6cfb('0x18')]===0x1f4){logger[_0x6cfb('0x17')]('MailAccount,\x20%s,\x20%s',_0x2d4a2e,_0x5327cc['error'][_0x6cfb('0x19')]);return _0x580056(_0x5327cc['error'][_0x6cfb('0x19')]);}logger[_0x6cfb('0x17')](_0x6cfb('0x13'),_0x2d4a2e,_0x5327cc['error']['message']);return _0xec71b5(_0x5327cc['error'][_0x6cfb('0x19')]);}else{logger['info'](_0x6cfb('0x13'),_0x2d4a2e,_0x6cfb('0x14'));_0xec71b5(_0x5327cc['result'][_0x6cfb('0x19')]);}})[_0x6cfb('0x1a')](function(_0x2616b1){logger[_0x6cfb('0x17')](_0x6cfb('0x13'),_0x2d4a2e,_0x2616b1);_0x580056(_0x2616b1);});});}exports['GetMailAccount']=function(_0x3b8cf1){var _0x106719=this;return new Promise(function(_0xd32abf,_0x1e906a){return db[_0x6cfb('0x1b')]['findAll']({'raw':_0x3b8cf1['options']?_0x3b8cf1['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b8cf1['options']?_0x3b8cf1[_0x6cfb('0x1c')][_0x6cfb('0x1d')]||null:null,'attributes':_0x3b8cf1['options']?_0x3b8cf1[_0x6cfb('0x1c')][_0x6cfb('0x1e')]||null:null,'limit':_0x3b8cf1[_0x6cfb('0x1c')]?_0x3b8cf1['options'][_0x6cfb('0x1f')]||null:null,'include':_0x3b8cf1[_0x6cfb('0x1c')]?_0x3b8cf1[_0x6cfb('0x1c')][_0x6cfb('0x20')]?_[_0x6cfb('0x21')](_0x3b8cf1[_0x6cfb('0x1c')][_0x6cfb('0x20')],function(_0x100fe5){return{'model':db[_0x100fe5[_0x6cfb('0x22')]],'as':_0x100fe5['as'],'attributes':_0x100fe5[_0x6cfb('0x1e')],'include':_0x100fe5[_0x6cfb('0x20')]?_['map'](_0x100fe5[_0x6cfb('0x20')],function(_0x567029){return{'model':db[_0x567029[_0x6cfb('0x22')]],'as':_0x567029['as'],'attributes':_0x567029[_0x6cfb('0x1e')],'include':_0x567029[_0x6cfb('0x20')]?_[_0x6cfb('0x21')](_0x567029[_0x6cfb('0x20')],function(_0x478676){return{'model':db[_0x478676['model']],'as':_0x478676['as'],'attributes':_0x478676[_0x6cfb('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1631eb){logger[_0x6cfb('0x12')](_0x6cfb('0x23'),_0x3b8cf1);logger[_0x6cfb('0x24')]('GetMailAccount',_0x3b8cf1,JSON[_0x6cfb('0x16')](_0x1631eb));_0xd32abf(_0x1631eb);})[_0x6cfb('0x1a')](function(_0x4893ed){logger[_0x6cfb('0x17')](_0x6cfb('0x23'),_0x4893ed[_0x6cfb('0x19')],_0x3b8cf1);_0x1e906a(_0x106719[_0x6cfb('0x17')](0x1f4,_0x4893ed[_0x6cfb('0x19')]));});});};exports[_0x6cfb('0x25')]=function(_0x4eaeb3){var _0x39bbfa=this;return new Promise(function(_0x1ffa71,_0x59fef3){return db['MailAccount'][_0x6cfb('0x26')]({'raw':_0x4eaeb3[_0x6cfb('0x1c')]?_0x4eaeb3[_0x6cfb('0x1c')][_0x6cfb('0x27')]===undefined?!![]:![]:!![],'where':_0x4eaeb3[_0x6cfb('0x1c')]?_0x4eaeb3[_0x6cfb('0x1c')][_0x6cfb('0x1d')]||null:null,'attributes':_0x4eaeb3[_0x6cfb('0x1c')]?_0x4eaeb3[_0x6cfb('0x1c')][_0x6cfb('0x1e')]||null:null,'include':_0x4eaeb3[_0x6cfb('0x1c')]?_0x4eaeb3['options'][_0x6cfb('0x20')]?_[_0x6cfb('0x21')](_0x4eaeb3[_0x6cfb('0x1c')][_0x6cfb('0x20')],function(_0x4dfb56){return{'model':db[_0x4dfb56[_0x6cfb('0x22')]],'as':_0x4dfb56['as'],'attributes':_0x4dfb56[_0x6cfb('0x1e')],'include':_0x4dfb56['include']?_[_0x6cfb('0x21')](_0x4dfb56[_0x6cfb('0x20')],function(_0xac396a){return{'model':db[_0xac396a[_0x6cfb('0x22')]],'as':_0xac396a['as'],'attributes':_0xac396a['attributes'],'include':_0xac396a[_0x6cfb('0x20')]?_[_0x6cfb('0x21')](_0xac396a[_0x6cfb('0x20')],function(_0x1f06e1){return{'model':db[_0x1f06e1[_0x6cfb('0x22')]],'as':_0x1f06e1['as'],'attributes':_0x1f06e1['attributes']};}):[]};}):[]};}):[]:[]})[_0x6cfb('0x11')](function(_0x137c02){logger[_0x6cfb('0x12')](_0x6cfb('0x25'),_0x4eaeb3);logger[_0x6cfb('0x24')]('ShowMailAccount',_0x4eaeb3,JSON[_0x6cfb('0x16')](_0x137c02));_0x1ffa71(_0x137c02);})[_0x6cfb('0x1a')](function(_0x121790){logger[_0x6cfb('0x17')]('ShowMailAccount',_0x121790[_0x6cfb('0x19')],_0x4eaeb3);_0x59fef3(_0x39bbfa[_0x6cfb('0x17')](0x1f4,_0x121790[_0x6cfb('0x19')]));});});};exports[_0x6cfb('0x28')]=function(_0x38e21b){var _0x55dcf0=this;return new Promise(function(_0x41639d,_0x56294b){var _0x29c89a={'body':_0x38e21b[_0x6cfb('0x29')],'channel':_0x6cfb('0x2a')};var _0x48472a=_[_0x6cfb('0x2b')](_[_0x6cfb('0x2c')](db[_0x6cfb('0x2d')][_0x6cfb('0x2e')]),[_0x6cfb('0x2f'),'updatedAt',_0x6cfb('0x30'),'ListId']);var _0xd7e86c=![];if(_0x38e21b[_0x6cfb('0x29')]['id']){delete _0x38e21b[_0x6cfb('0x29')]['id'];}if(_[_0x6cfb('0x31')](_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x32')])){return _0x56294b(_0x55dcf0[_0x6cfb('0x17')](0x1f4,_0x6cfb('0x33')));}if(_[_0x6cfb('0x31')](_0x38e21b['body'][_0x6cfb('0x29')])||_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x29')]===''){return _0x56294b(_0x55dcf0[_0x6cfb('0x17')](0x1f4,_0x6cfb('0x34')));}if(_[_0x6cfb('0x31')](_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x35')])){return _0x56294b(_0x55dcf0[_0x6cfb('0x17')](0x1f4,_0x6cfb('0x36')+_0x48472a));}if(!_[_0x6cfb('0x37')](_0x48472a,_0x38e21b['body'][_0x6cfb('0x35')])){return _0x56294b(_0x55dcf0[_0x6cfb('0x17')](0x1f4,_0x6cfb('0x38')+_0x48472a));}var _0x3ce0d4={};_0x3ce0d4[_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x35')]]=_0x38e21b[_0x6cfb('0x29')]['from'];return db[_0x6cfb('0x1b')][_0x6cfb('0x26')]({'where':{'id':_0x38e21b['account']['id']},'include':[{'model':db[_0x6cfb('0x39')],'as':'List','include':[{'model':db[_0x6cfb('0x2d')],'as':_0x6cfb('0x3a'),'where':_0x3ce0d4,'limit':0x1,'order':[[_0x6cfb('0x3b'),_0x6cfb('0x3c')]]}]},{'model':db['MailApplication'],'as':_0x6cfb('0x3d')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x6cfb('0x11')](function(_0x3a65bd){if(_0x3a65bd&&_0x3a65bd['List']){var _0x1f0d46=_0x3a65bd[_0x6cfb('0x3e')]({'plain':!![]});_0x29c89a[_0x6cfb('0x3f')]=_[_0x6cfb('0x40')](_0x1f0d46,[_0x6cfb('0x3d'),_0x6cfb('0x41')]);_0x29c89a[_0x6cfb('0x42')]=_0x1f0d46[_0x6cfb('0x3d')];_0x29c89a['list']=_0x1f0d46['List'];_0x29c89a[_0x6cfb('0x42')]=_['orderBy'](_0x29c89a['applications'],['priority'],[_0x6cfb('0x43')]);if(_0x29c89a[_0x6cfb('0x3f')]&&_0x29c89a['account']['autoclose']){_0x29c89a[_0x6cfb('0x42')]['push']({'id':0x0,'priority':_0x29c89a['applications'][_0x6cfb('0x44')]+0x1,'app':_0x6cfb('0x45'),'appdata':_0x6cfb('0x46'),'interval':_0x6cfb('0x47')});}if(_0x29c89a[_0x6cfb('0x3f')][_0x6cfb('0x3d')]){delete _0x29c89a[_0x6cfb('0x3f')]['Applications'];}if(_0x29c89a[_0x6cfb('0x3f')][_0x6cfb('0x41')]){delete _0x29c89a[_0x6cfb('0x3f')][_0x6cfb('0x41')];}if(_0x1f0d46[_0x6cfb('0x41')]['Contacts'][_0x6cfb('0x44')]){return _0x1f0d46[_0x6cfb('0x41')][_0x6cfb('0x3a')][0x0];}var _0x5b0b5e=_['defaults'](_0x38e21b['body'],{'firstName':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x32')],'ListId':_0x1f0d46['ListId']});_0x5b0b5e[_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x35')]]=_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x32')];return db[_0x6cfb('0x2d')][_0x6cfb('0x48')](_0x5b0b5e);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0xb10f38){_0x29c89a[_0x6cfb('0x49')]=_0xb10f38;if(_0xb10f38){if(!_0x38e21b['body'][_0x6cfb('0x19')]['messageId']){_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')]['messageId']=rs[_0x6cfb('0x4a')]()+'\x20'+_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')][_0x6cfb('0x32')];}var _0x2ffb0c={'ContactId':_0xb10f38['id'],'MailAccountId':_0x38e21b[_0x6cfb('0x3f')]['id'],'inReplyTo':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')][_0x6cfb('0x4b')],'to':_0x38e21b[_0x6cfb('0x29')]['message'][_0x6cfb('0x32')],'cc':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')]['cc'],'subject':_0x38e21b['body'][_0x6cfb('0x19')][_0x6cfb('0x4c')],'attach':_0x38e21b[_0x6cfb('0x29')]['message'][_0x6cfb('0x4d')],'lastMsgAt':moment()[_0x6cfb('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0x6cfb('0x26')]({'where':{'closed':![],'MailAccountId':_0x38e21b[_0x6cfb('0x3f')]['id']},'include':[{'model':db[_0x6cfb('0x4f')],'as':_0x6cfb('0x50'),'attributes':[_0x6cfb('0x4b')],'where':{'messageId':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')][_0x6cfb('0x51')]}}]})[_0x6cfb('0x11')](function(_0x57a283){if(_0x57a283){return[_0x57a283,![]];}return db[_0x6cfb('0x52')][_0x6cfb('0x48')](_0x2ffb0c)[_0x6cfb('0x11')](function(_0x1c6809){return[_0x1c6809,!![]];});});}else{throw new Error(_0x6cfb('0x53'));}})['spread'](function(_0x6dfc8d,_0x4a1145){if(_0x6dfc8d){_0xd7e86c=_0x4a1145;if(!_0x4a1145){return _0x6dfc8d[_0x6cfb('0x54')]({'inReplyTo':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')][_0x6cfb('0x4b')],'to':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')]['from'],'cc':_0x38e21b['body'][_0x6cfb('0x19')]['cc'],'subject':_0x38e21b[_0x6cfb('0x29')]['message']['subject'],'attach':_0x6dfc8d[_0x6cfb('0x4d')]?_0x6dfc8d[_0x6cfb('0x4d')]:_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')][_0x6cfb('0x4d')],'substatus':null,'substatusAt':moment()[_0x6cfb('0x4e')](_0x6cfb('0x55')),'lastMsgAt':moment()[_0x6cfb('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x6dfc8d;}}})[_0x6cfb('0x11')](function(_0xc046cd){_0x29c89a[_0x6cfb('0x56')]=_0xc046cd[_0x6cfb('0x3e')]({'plain':!![]});_0x29c89a[_0x6cfb('0x56')][_0x6cfb('0x57')]=_0xd7e86c;return db['MailMessage'][_0x6cfb('0x48')]({'body':_0x38e21b['body'][_0x6cfb('0x29')],'MailAccountId':_0x38e21b[_0x6cfb('0x3f')]['id'],'MailInteractionId':_0xc046cd['id'],'direction':'in','ContactId':_0x29c89a['contact']['id'],'messageId':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')]['messageId'],'from':_0x38e21b['body']['message'][_0x6cfb('0x32')],'to':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')]['to'],'cc':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')]['cc'],'subject':_0x38e21b[_0x6cfb('0x29')]['message'][_0x6cfb('0x4c')],'attach':_0x38e21b[_0x6cfb('0x29')]['message']['attach'],'Attachments':_0x38e21b['body']['message'][_0x6cfb('0x58')],'originTo':_0x38e21b['body'][_0x6cfb('0x19')][_0x6cfb('0x59')],'originCc':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')][_0x6cfb('0x5a')],'bcc':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')][_0x6cfb('0x5b')],'ChatWebsiteId':_0x38e21b[_0x6cfb('0x29')]['message'][_0x6cfb('0x5c')]||null,'originChannel':_0x38e21b[_0x6cfb('0x29')]['message'][_0x6cfb('0x5d')]||_0x6cfb('0x5e'),'ChatOfflineMessageId':_0x38e21b[_0x6cfb('0x29')][_0x6cfb('0x19')][_0x6cfb('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0x6cfb('0x60')}]});})['then'](function(_0x2b5e6f){_0x29c89a[_0x6cfb('0x19')]=_0x2b5e6f;if(_0x29c89a[_0x6cfb('0x56')]['UserId']){return db['User'][_0x6cfb('0x26')]({'attributes':['id',_0x6cfb('0x61')],'where':{'id':_0x29c89a[_0x6cfb('0x56')]['UserId']}})[_0x6cfb('0x11')](function(_0x2528c0){if(_0x2528c0){_0x29c89a[_0x6cfb('0x42')][_0x6cfb('0x62')]({'id':0x0,'priority':0x0,'app':_0x6cfb('0x63'),'appdata':_0x2528c0[_0x6cfb('0x61')]+','+(_0x29c89a[_0x6cfb('0x3f')][_0x6cfb('0x64')]||0xa),'interval':_0x6cfb('0x47')});}return respondWithRpcPromise(_0x6cfb('0x65'),_0x6cfb('0x66'),_0x29c89a);});}return respondWithRpcPromise(_0x6cfb('0x65'),_0x6cfb('0x66'),_0x29c89a);})['then'](function(_0x3dea0c){_0x41639d(_0x3dea0c);})[_0x6cfb('0x1a')](function(_0x21f97b){_0x56294b(_0x55dcf0[_0x6cfb('0x17')](0x1f4,_0x21f97b[_0x6cfb('0x19')]));});});}; \ No newline at end of file +var _0x7e60=['body','mail','difference','keys','CmContact','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','List','Contacts','Applications','MailServerOut','get','omit','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','messageId','format','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','created','subject','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','where','attributes','limit','include','map','model','GetMailAccount','MailAccount','find','ShowMailAccount','debug','NotifyMailAccount'];(function(_0x353e11,_0x37b28f){var _0x23a0c7=function(_0x79b0c6){while(--_0x79b0c6){_0x353e11['push'](_0x353e11['shift']());}};_0x23a0c7(++_0x37b28f);}(_0x7e60,0xa5));var _0x07e6=function(_0x46d764,_0x2add59){_0x46d764=_0x46d764-0x0;var _0x1e325d=_0x7e60[_0x46d764];return _0x1e325d;};'use strict';var _=require(_0x07e6('0x0'));var util=require(_0x07e6('0x1'));var moment=require('moment');var BPromise=require(_0x07e6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07e6('0x3'))['db'];var utils=require(_0x07e6('0x4'));var logger=require(_0x07e6('0x5'))(_0x07e6('0x6'));var config=require(_0x07e6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x07e6('0x8')][_0x07e6('0x9')]({'port':0x232c});config['redis']=_[_0x07e6('0xa')](config['redis'],{'host':_0x07e6('0xb'),'port':0x18eb});var socket=require(_0x07e6('0xc'))(new Redis(config[_0x07e6('0xd')]));require(_0x07e6('0xe'))[_0x07e6('0xf')](socket);function respondWithRpcPromise(_0x2ea711,_0x3f5c1f,_0x5be93b){return new BPromise(function(_0x25bdf4,_0x348c8f){return client[_0x07e6('0x10')](_0x2ea711,_0x5be93b)[_0x07e6('0x11')](function(_0x4c052a){logger[_0x07e6('0x12')](_0x07e6('0x13'),_0x3f5c1f,_0x07e6('0x14'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x3f5c1f,_0x07e6('0x14'),JSON[_0x07e6('0x15')](_0x4c052a));if(_0x4c052a[_0x07e6('0x16')]){if(_0x4c052a['error'][_0x07e6('0x17')]===0x1f4){logger[_0x07e6('0x16')](_0x07e6('0x13'),_0x3f5c1f,_0x4c052a[_0x07e6('0x16')][_0x07e6('0x18')]);return _0x348c8f(_0x4c052a[_0x07e6('0x16')][_0x07e6('0x18')]);}logger[_0x07e6('0x16')]('MailAccount,\x20%s,\x20%s',_0x3f5c1f,_0x4c052a['error']['message']);return _0x25bdf4(_0x4c052a[_0x07e6('0x16')][_0x07e6('0x18')]);}else{logger[_0x07e6('0x12')](_0x07e6('0x13'),_0x3f5c1f,_0x07e6('0x14'));_0x25bdf4(_0x4c052a[_0x07e6('0x19')][_0x07e6('0x18')]);}})[_0x07e6('0x1a')](function(_0x3537e0){logger[_0x07e6('0x16')](_0x07e6('0x13'),_0x3f5c1f,_0x3537e0);_0x348c8f(_0x3537e0);});});}exports['GetMailAccount']=function(_0x5357fe){var _0x51e716=this;return new Promise(function(_0x27ec22,_0xb1885a){return db['MailAccount'][_0x07e6('0x1b')]({'raw':_0x5357fe[_0x07e6('0x1c')]?_0x5357fe[_0x07e6('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5357fe[_0x07e6('0x1c')]?_0x5357fe[_0x07e6('0x1c')][_0x07e6('0x1d')]||null:null,'attributes':_0x5357fe[_0x07e6('0x1c')]?_0x5357fe[_0x07e6('0x1c')][_0x07e6('0x1e')]||null:null,'limit':_0x5357fe[_0x07e6('0x1c')]?_0x5357fe['options'][_0x07e6('0x1f')]||null:null,'include':_0x5357fe['options']?_0x5357fe[_0x07e6('0x1c')][_0x07e6('0x20')]?_[_0x07e6('0x21')](_0x5357fe[_0x07e6('0x1c')][_0x07e6('0x20')],function(_0x4d4c57){return{'model':db[_0x4d4c57[_0x07e6('0x22')]],'as':_0x4d4c57['as'],'attributes':_0x4d4c57[_0x07e6('0x1e')],'include':_0x4d4c57[_0x07e6('0x20')]?_['map'](_0x4d4c57[_0x07e6('0x20')],function(_0x44e06f){return{'model':db[_0x44e06f['model']],'as':_0x44e06f['as'],'attributes':_0x44e06f['attributes'],'include':_0x44e06f[_0x07e6('0x20')]?_[_0x07e6('0x21')](_0x44e06f['include'],function(_0x1e0033){return{'model':db[_0x1e0033[_0x07e6('0x22')]],'as':_0x1e0033['as'],'attributes':_0x1e0033[_0x07e6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x07e6('0x11')](function(_0xdf8324){logger['info'](_0x07e6('0x23'),_0x5357fe);logger['debug'](_0x07e6('0x23'),_0x5357fe,JSON[_0x07e6('0x15')](_0xdf8324));_0x27ec22(_0xdf8324);})[_0x07e6('0x1a')](function(_0x19dfdb){logger[_0x07e6('0x16')](_0x07e6('0x23'),_0x19dfdb[_0x07e6('0x18')],_0x5357fe);_0xb1885a(_0x51e716[_0x07e6('0x16')](0x1f4,_0x19dfdb[_0x07e6('0x18')]));});});};exports['ShowMailAccount']=function(_0x4e35e0){var _0x14eb1b=this;return new Promise(function(_0x28e104,_0x1f811d){return db[_0x07e6('0x24')][_0x07e6('0x25')]({'raw':_0x4e35e0[_0x07e6('0x1c')]?_0x4e35e0[_0x07e6('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4e35e0[_0x07e6('0x1c')]?_0x4e35e0['options'][_0x07e6('0x1d')]||null:null,'attributes':_0x4e35e0['options']?_0x4e35e0['options'][_0x07e6('0x1e')]||null:null,'include':_0x4e35e0[_0x07e6('0x1c')]?_0x4e35e0[_0x07e6('0x1c')][_0x07e6('0x20')]?_[_0x07e6('0x21')](_0x4e35e0[_0x07e6('0x1c')][_0x07e6('0x20')],function(_0x40edd0){return{'model':db[_0x40edd0['model']],'as':_0x40edd0['as'],'attributes':_0x40edd0[_0x07e6('0x1e')],'include':_0x40edd0['include']?_[_0x07e6('0x21')](_0x40edd0['include'],function(_0x261f97){return{'model':db[_0x261f97[_0x07e6('0x22')]],'as':_0x261f97['as'],'attributes':_0x261f97[_0x07e6('0x1e')],'include':_0x261f97[_0x07e6('0x20')]?_['map'](_0x261f97['include'],function(_0x53deb8){return{'model':db[_0x53deb8[_0x07e6('0x22')]],'as':_0x53deb8['as'],'attributes':_0x53deb8['attributes']};}):[]};}):[]};}):[]:[]})[_0x07e6('0x11')](function(_0x45de10){logger[_0x07e6('0x12')](_0x07e6('0x26'),_0x4e35e0);logger[_0x07e6('0x27')]('ShowMailAccount',_0x4e35e0,JSON['stringify'](_0x45de10));_0x28e104(_0x45de10);})[_0x07e6('0x1a')](function(_0x41afb7){logger[_0x07e6('0x16')](_0x07e6('0x26'),_0x41afb7[_0x07e6('0x18')],_0x4e35e0);_0x1f811d(_0x14eb1b[_0x07e6('0x16')](0x1f4,_0x41afb7[_0x07e6('0x18')]));});});};exports[_0x07e6('0x28')]=function(_0x534b29){var _0x14bac2=this;return new Promise(function(_0x5740a0,_0x42198d){var _0x392aa4={'body':_0x534b29[_0x07e6('0x29')],'channel':_0x07e6('0x2a')};var _0x4f45a7=_[_0x07e6('0x2b')](_[_0x07e6('0x2c')](db[_0x07e6('0x2d')]['rawAttributes']),['createdAt',_0x07e6('0x2e'),_0x07e6('0x2f'),_0x07e6('0x30')]);var _0x3054a2=![];if(_0x534b29[_0x07e6('0x29')]['id']){delete _0x534b29[_0x07e6('0x29')]['id'];}if(_[_0x07e6('0x31')](_0x534b29[_0x07e6('0x29')]['from'])){return _0x42198d(_0x14bac2[_0x07e6('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x534b29[_0x07e6('0x29')][_0x07e6('0x29')])||_0x534b29[_0x07e6('0x29')][_0x07e6('0x29')]===''){return _0x42198d(_0x14bac2[_0x07e6('0x16')](0x1f4,_0x07e6('0x32')));}if(_[_0x07e6('0x31')](_0x534b29[_0x07e6('0x29')]['mapKey'])){return _0x42198d(_0x14bac2[_0x07e6('0x16')](0x1f4,_0x07e6('0x33')+_0x4f45a7));}if(!_['includes'](_0x4f45a7,_0x534b29[_0x07e6('0x29')][_0x07e6('0x34')])){return _0x42198d(_0x14bac2[_0x07e6('0x16')](0x1f4,_0x07e6('0x35')+_0x4f45a7));}var _0x2e2c06={};_0x2e2c06[_0x534b29['body'][_0x07e6('0x34')]]=_0x534b29[_0x07e6('0x29')][_0x07e6('0x36')];return db[_0x07e6('0x24')][_0x07e6('0x25')]({'where':{'id':_0x534b29[_0x07e6('0x37')]['id']},'include':[{'model':db[_0x07e6('0x38')],'as':_0x07e6('0x39'),'include':[{'model':db['CmContact'],'as':_0x07e6('0x3a'),'where':_0x2e2c06,'limit':0x1,'order':[[_0x07e6('0x2e'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x07e6('0x3b')},{'model':db[_0x07e6('0x3c')],'as':'Smtp'}]})[_0x07e6('0x11')](function(_0xf3b0e3){if(_0xf3b0e3&&_0xf3b0e3[_0x07e6('0x39')]){var _0x418cfd=_0xf3b0e3[_0x07e6('0x3d')]({'plain':!![]});_0x392aa4[_0x07e6('0x37')]=_[_0x07e6('0x3e')](_0x418cfd,[_0x07e6('0x3b'),_0x07e6('0x39')]);_0x392aa4[_0x07e6('0x3f')]=_0x418cfd[_0x07e6('0x3b')];_0x392aa4['list']=_0x418cfd[_0x07e6('0x39')];_0x392aa4['applications']=_[_0x07e6('0x40')](_0x392aa4[_0x07e6('0x3f')],[_0x07e6('0x41')],[_0x07e6('0x42')]);if(_0x392aa4[_0x07e6('0x37')]&&_0x392aa4[_0x07e6('0x37')][_0x07e6('0x43')]){_0x392aa4[_0x07e6('0x3f')][_0x07e6('0x44')]({'id':0x0,'priority':_0x392aa4['applications'][_0x07e6('0x45')]+0x1,'app':_0x07e6('0x46'),'appdata':'autoclose','interval':_0x07e6('0x47')});}if(_0x392aa4[_0x07e6('0x37')][_0x07e6('0x3b')]){delete _0x392aa4[_0x07e6('0x37')][_0x07e6('0x3b')];}if(_0x392aa4[_0x07e6('0x37')][_0x07e6('0x39')]){delete _0x392aa4[_0x07e6('0x37')][_0x07e6('0x39')];}if(_0x418cfd[_0x07e6('0x39')][_0x07e6('0x3a')]['length']){return _0x418cfd[_0x07e6('0x39')]['Contacts'][0x0];}var _0x5515f7=_[_0x07e6('0xa')](_0x534b29[_0x07e6('0x29')],{'firstName':_0x534b29[_0x07e6('0x29')][_0x07e6('0x36')],'ListId':_0x418cfd[_0x07e6('0x30')]});_0x5515f7[_0x534b29['body'][_0x07e6('0x34')]]=_0x534b29['body'][_0x07e6('0x36')];return db[_0x07e6('0x2d')][_0x07e6('0x48')](_0x5515f7);}else{throw new Error(_0x07e6('0x49'));}})[_0x07e6('0x11')](function(_0x278b00){_0x392aa4['contact']=_0x278b00;if(_0x278b00){if(!_0x534b29['body'][_0x07e6('0x18')]['messageId']){_0x534b29[_0x07e6('0x29')]['message'][_0x07e6('0x4a')]=rs['generate']()+'\x20'+_0x534b29[_0x07e6('0x29')]['message'][_0x07e6('0x36')];}var _0x1f0e66={'ContactId':_0x278b00['id'],'MailAccountId':_0x534b29[_0x07e6('0x37')]['id'],'inReplyTo':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')][_0x07e6('0x4a')],'to':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')][_0x07e6('0x36')],'cc':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')]['cc'],'subject':_0x534b29['body']['message']['subject'],'attach':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')]['attach'],'lastMsgAt':moment()[_0x07e6('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x07e6('0x4c')][_0x07e6('0x25')]({'where':{'closed':![],'MailAccountId':_0x534b29[_0x07e6('0x37')]['id']},'include':[{'model':db[_0x07e6('0x4d')],'as':'Messages','attributes':[_0x07e6('0x4a')],'where':{'messageId':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')][_0x07e6('0x4e')]}}]})['then'](function(_0x47eef8){if(_0x47eef8){return[_0x47eef8,![]];}return db['MailInteraction'][_0x07e6('0x48')](_0x1f0e66)[_0x07e6('0x11')](function(_0x294beb){return[_0x294beb,!![]];});});}else{throw new Error(_0x07e6('0x4f'));}})[_0x07e6('0x50')](function(_0x50e955,_0x141bde){if(_0x50e955){_0x3054a2=_0x141bde;if(!_0x141bde){return _0x50e955[_0x07e6('0x51')]({'inReplyTo':_0x534b29['body'][_0x07e6('0x18')][_0x07e6('0x4a')],'to':_0x534b29['body'][_0x07e6('0x18')][_0x07e6('0x36')],'cc':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')]['cc'],'subject':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')]['subject'],'attach':_0x50e955['attach']?_0x50e955[_0x07e6('0x52')]:_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')][_0x07e6('0x52')],'substatus':null,'substatusAt':moment()[_0x07e6('0x4b')](_0x07e6('0x53')),'lastMsgAt':moment()[_0x07e6('0x4b')](_0x07e6('0x53')),'lastMsgDirection':'in'});}else{return _0x50e955;}}})[_0x07e6('0x11')](function(_0x1a0e4a){_0x392aa4[_0x07e6('0x54')]=_0x1a0e4a[_0x07e6('0x3d')]({'plain':!![]});_0x392aa4[_0x07e6('0x54')][_0x07e6('0x55')]=_0x3054a2;return db[_0x07e6('0x4d')][_0x07e6('0x48')]({'body':_0x534b29[_0x07e6('0x29')][_0x07e6('0x29')],'MailAccountId':_0x534b29[_0x07e6('0x37')]['id'],'MailInteractionId':_0x1a0e4a['id'],'direction':'in','ContactId':_0x392aa4['contact']['id'],'messageId':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')][_0x07e6('0x4a')],'from':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')]['from'],'to':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')]['to'],'cc':_0x534b29[_0x07e6('0x29')]['message']['cc'],'subject':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')][_0x07e6('0x56')],'attach':_0x534b29['body']['message'][_0x07e6('0x52')],'Attachments':_0x534b29[_0x07e6('0x29')]['message'][_0x07e6('0x57')],'originTo':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')][_0x07e6('0x58')],'originCc':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')][_0x07e6('0x59')],'bcc':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')][_0x07e6('0x5a')],'ChatWebsiteId':_0x534b29['body']['message'][_0x07e6('0x5b')]||null,'originChannel':_0x534b29[_0x07e6('0x29')][_0x07e6('0x18')][_0x07e6('0x5c')]||_0x07e6('0x5d'),'ChatOfflineMessageId':_0x534b29[_0x07e6('0x29')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x07e6('0x5e')],'as':_0x07e6('0x5f')}]});})[_0x07e6('0x11')](function(_0x29d7b5){_0x392aa4['message']=_0x29d7b5;if(_0x392aa4[_0x07e6('0x54')][_0x07e6('0x60')]){return db[_0x07e6('0x61')][_0x07e6('0x25')]({'attributes':['id',_0x07e6('0x62')],'where':{'id':_0x392aa4[_0x07e6('0x54')][_0x07e6('0x60')]}})[_0x07e6('0x11')](function(_0x5f7b36){if(_0x5f7b36){_0x392aa4[_0x07e6('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x07e6('0x63'),'appdata':_0x5f7b36[_0x07e6('0x62')]+','+(_0x392aa4[_0x07e6('0x37')][_0x07e6('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x07e6('0x65'),_0x07e6('0x66'),_0x392aa4);});}return respondWithRpcPromise(_0x07e6('0x65'),'startRouting',_0x392aa4);})[_0x07e6('0x11')](function(_0x194e60){_0x5740a0(_0x194e60);})[_0x07e6('0x1a')](function(_0x57ebed){_0x42198d(_0x14bac2[_0x07e6('0x16')](0x1f4,_0x57ebed[_0x07e6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 0001255..bb6f377 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 _0x46cb=['removeListener','register','length','mailAccount:','update','emit'];(function(_0x562c98,_0x56eb27){var _0x38c741=function(_0x82a833){while(--_0x82a833){_0x562c98['push'](_0x562c98['shift']());}};_0x38c741(++_0x56eb27);}(_0x46cb,0xd6));var _0xb46c=function(_0x57abf7,_0x11bb02){_0x57abf7=_0x57abf7-0x0;var _0x1c7779=_0x46cb[_0x57abf7];return _0x1c7779;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save','remove',_0xb46c('0x0')];function createListener(_0x2a55a0,_0x4395ee){return function(_0x33aaa0){_0x4395ee[_0xb46c('0x1')](_0x2a55a0,_0x33aaa0);};}function removeListener(_0x2aab0a,_0x2a6e97){return function(){MailAccountEvents[_0xb46c('0x2')](_0x2aab0a,_0x2a6e97);};}exports[_0xb46c('0x3')]=function(_0xf4f306){for(var _0x2e3704=0x0,_0x4603b8=events[_0xb46c('0x4')];_0x2e3704<_0x4603b8;_0x2e3704++){var _0x2771fe=events[_0x2e3704];var _0x5dfe97=createListener(_0xb46c('0x5')+_0x2771fe,_0xf4f306);MailAccountEvents['on'](_0x2771fe,_0x5dfe97);}}; \ No newline at end of file +var _0xabce=['mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x3d2a37,_0x1655a8){var _0x56d50f=function(_0x2d6da0){while(--_0x2d6da0){_0x3d2a37['push'](_0x3d2a37['shift']());}};_0x56d50f(++_0x1655a8);}(_0xabce,0x103));var _0xeabc=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xabce[_0x56482c];return _0x5aae7a;};'use strict';var MailAccountEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){MailAccountEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);MailAccountEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index da608f0..85597b6 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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x242f87,_0xf1799d){var _0x3dee4e=function(_0x171777){while(--_0x171777){_0x242f87['push'](_0x242f87['shift']());}};_0x3dee4e(++_0xf1799d);}(_0xadb5,0xad));var _0x5adb=function(_0x1f8351,_0x3a52e0){_0x1f8351=_0x1f8351-0x0;var _0x4d80b8=_0xadb5[_0x1f8351];return _0x4d80b8;};'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('./mailApplication.controller');router[_0x5adb('0x7')](_0x5adb('0x8'),auth[_0x5adb('0x9')](),controller[_0x5adb('0xa')]);router[_0x5adb('0xb')](_0x5adb('0x8'),auth[_0x5adb('0x9')](),controller[_0x5adb('0xc')]);router[_0x5adb('0xd')](_0x5adb('0x8'),auth[_0x5adb('0x9')](),controller[_0x5adb('0xe')]);module[_0x5adb('0xf')]=router; \ No newline at end of file +var _0x326f=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','show','put','isAuthenticated','destroy'];(function(_0x2ef397,_0x41feb0){var _0x7d1ce=function(_0x49e1ac){while(--_0x49e1ac){_0x2ef397['push'](_0x2ef397['shift']());}};_0x7d1ce(++_0x41feb0);}(_0x326f,0xd1));var _0xf326=function(_0x476640,_0x5760ff){_0x476640=_0x476640-0x0;var _0x1860c6=_0x326f[_0x476640];return _0x1860c6;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller['update']);router['delete']('/:id',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);module[_0xf326('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index e478bab..20078dc 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 _0xc5df=['*,*,*,*','sequelize','INTEGER','noop','TEXT','STRING'];(function(_0x243c5c,_0x3dd30c){var _0x486e0f=function(_0x5bbc2a){while(--_0x5bbc2a){_0x243c5c['push'](_0x243c5c['shift']());}};_0x486e0f(++_0x3dd30c);}(_0xc5df,0xaf));var _0xfc5d=function(_0x385699,_0x2ce8dc){_0x385699=_0x385699-0x0;var _0x376abe=_0xc5df[_0x385699];return _0x376abe;};'use strict';var Sequelize=require(_0xfc5d('0x0'));module['exports']={'priority':{'type':Sequelize[_0xfc5d('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfc5d('0x2')},'appdata':{'type':Sequelize[_0xfc5d('0x3')]()},'description':{'type':Sequelize[_0xfc5d('0x4')]},'interval':{'type':Sequelize[_0xfc5d('0x4')],'defaultValue':_0xfc5d('0x5')}}; \ No newline at end of file +var _0x31fa=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x2f0ed2,_0x6feb59){var _0x47ffff=function(_0x4ad88b){while(--_0x4ad88b){_0x2f0ed2['push'](_0x2f0ed2['shift']());}};_0x47ffff(++_0x6feb59);}(_0x31fa,0x1c0));var _0xa31f=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x31fa[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xa31f('0x0'));module[_0xa31f('0x1')]={'priority':{'type':Sequelize[_0xa31f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa31f('0x3')],'allowNull':![],'defaultValue':_0xa31f('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa31f('0x3')]},'interval':{'type':Sequelize[_0xa31f('0x3')],'defaultValue':_0xa31f('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index d66607d..f14fa9c 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 _0x463f=['../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','params','keys','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','merge','options','MailApplication','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x586cd6,_0x3efec9){var _0x3a9533=function(_0x2b2796){while(--_0x2b2796){_0x586cd6['push'](_0x586cd6['shift']());}};_0x3a9533(++_0x3efec9);}(_0x463f,0x65));var _0xf463=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x463f[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xf463('0x0'));var rimraf=require(_0xf463('0x1'));var zipdir=require(_0xf463('0x2'));var jsonpatch=require(_0xf463('0x3'));var rp=require(_0xf463('0x4'));var moment=require(_0xf463('0x5'));var BPromise=require(_0xf463('0x6'));var Mustache=require('mustache');var util=require(_0xf463('0x7'));var path=require(_0xf463('0x8'));var sox=require(_0xf463('0x9'));var csv=require(_0xf463('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf463('0xb'));var _=require(_0xf463('0xc'));var squel=require(_0xf463('0xd'));var crypto=require('crypto');var jsforce=require(_0xf463('0xe'));var deskjs=require(_0xf463('0xf'));var toCsv=require(_0xf463('0xa'));var querystring=require(_0xf463('0x10'));var Papa=require('papaparse');var Redis=require(_0xf463('0x11'));var authService=require(_0xf463('0x12'));var qs=require(_0xf463('0x13'));var as=require(_0xf463('0x14'));var hardwareService=require(_0xf463('0x15'));var logger=require(_0xf463('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf463('0x17'));var licenseUtil=require(_0xf463('0x18'));var db=require(_0xf463('0x19'))['db'];function respondWithStatusCode(_0x411940,_0x422043){_0x422043=_0x422043||0xcc;return function(_0x5a334e){if(_0x5a334e){return _0x411940[_0xf463('0x1a')](_0x422043);}return _0x411940[_0xf463('0x1b')](_0x422043)[_0xf463('0x1c')]();};}function respondWithResult(_0x1a7c7a,_0x24e4be){_0x24e4be=_0x24e4be||0xc8;return function(_0x1b80a5){if(_0x1b80a5){return _0x1a7c7a[_0xf463('0x1b')](_0x24e4be)[_0xf463('0x1d')](_0x1b80a5);}};}function respondWithFilteredResult(_0xb6d1fa,_0x1a4048){return function(_0x4744e2){if(_0x4744e2){var _0xa7e8b8=_0x4744e2[_0xf463('0x1e')],_0x54be92=_0x1a4048['offset'],_0x41811e=_0x1a4048[_0xf463('0x1f')]+_0x1a4048['limit'],_0x149dc5;if(_0x41811e>=_0xa7e8b8){_0x41811e=_0xa7e8b8;_0x149dc5=0xc8;}else{_0x149dc5=0xce;}_0xb6d1fa[_0xf463('0x1b')](_0x149dc5);return _0xb6d1fa[_0xf463('0x20')](_0xf463('0x21'),_0x54be92+'-'+_0x41811e+'/'+_0xa7e8b8)['json'](_0x4744e2);}return null;};}function patchUpdates(_0x30d4bb){return function(_0x1be1d7){try{jsonpatch[_0xf463('0x22')](_0x1be1d7,_0x30d4bb,!![]);}catch(_0x1c1a33){return BPromise['reject'](_0x1c1a33);}return _0x1be1d7[_0xf463('0x23')]();};}function saveUpdates(_0x41f3ed,_0x22f624){return function(_0x18b539){if(_0x18b539){return _0x18b539[_0xf463('0x24')](_0x41f3ed)[_0xf463('0x25')](function(_0x137c5a){return _0x137c5a;});}return null;};}function removeEntity(_0x36d600,_0x4cef85){return function(_0x2f52fe){if(_0x2f52fe){return _0x2f52fe[_0xf463('0x26')]()[_0xf463('0x25')](function(){_0x36d600['status'](0xcc)[_0xf463('0x1c')]();});}};}function handleEntityNotFound(_0x250be3,_0x28a42d){return function(_0x1e2405){if(!_0x1e2405){_0x250be3[_0xf463('0x1a')](0x194);}return _0x1e2405;};}function handleError(_0x306f26,_0x146c6c){_0x146c6c=_0x146c6c||0x1f4;return function(_0x1fa8da){logger[_0xf463('0x27')](_0x1fa8da[_0xf463('0x28')]);if(_0x1fa8da[_0xf463('0x29')]){delete _0x1fa8da[_0xf463('0x29')];}_0x306f26['status'](_0x146c6c)[_0xf463('0x2a')](_0x1fa8da);};}exports[_0xf463('0x2b')]=function(_0x2f4cd0,_0x3d2112){var _0x4a1b1b={'raw':!![],'where':{'id':_0x2f4cd0[_0xf463('0x2c')]['id']}},_0x3776bc={};_0x3776bc['model']=_[_0xf463('0x2d')](db['MailApplication'][_0xf463('0x2e')]);_0x3776bc[_0xf463('0x2f')]=_['keys'](_0x2f4cd0[_0xf463('0x2f')]);_0x3776bc[_0xf463('0x30')]=_['intersection'](_0x3776bc['model'],_0x3776bc[_0xf463('0x2f')]);_0x4a1b1b['attributes']=_[_0xf463('0x31')](_0x3776bc[_0xf463('0x32')],qs['fields'](_0x2f4cd0[_0xf463('0x2f')][_0xf463('0x33')]));_0x4a1b1b[_0xf463('0x34')]=_0x4a1b1b[_0xf463('0x34')]['length']?_0x4a1b1b[_0xf463('0x34')]:_0x3776bc[_0xf463('0x32')];if(_0x2f4cd0[_0xf463('0x2f')][_0xf463('0x35')]){_0x4a1b1b[_0xf463('0x36')]=[{'all':!![]}];}_0x4a1b1b=_[_0xf463('0x37')]({},_0x4a1b1b,_0x2f4cd0[_0xf463('0x38')]);return db[_0xf463('0x39')]['find'](_0x4a1b1b)[_0xf463('0x25')](handleEntityNotFound(_0x3d2112,null))[_0xf463('0x25')](respondWithResult(_0x3d2112,null))[_0xf463('0x3a')](handleError(_0x3d2112,null));};exports[_0xf463('0x24')]=function(_0x757784,_0x334a38){if(_0x757784[_0xf463('0x3b')]['id']){delete _0x757784[_0xf463('0x3b')]['id'];}return db[_0xf463('0x39')]['find']({'where':{'id':_0x757784['params']['id']}})[_0xf463('0x25')](handleEntityNotFound(_0x334a38,null))[_0xf463('0x25')](saveUpdates(_0x757784['body'],null))[_0xf463('0x25')](respondWithResult(_0x334a38,null))[_0xf463('0x3a')](handleError(_0x334a38,null));};exports[_0xf463('0x26')]=function(_0xc882b8,_0x4b857c){return db[_0xf463('0x39')][_0xf463('0x3c')]({'where':{'id':_0xc882b8[_0xf463('0x2c')]['id']}})[_0xf463('0x25')](handleEntityNotFound(_0x4b857c,null))[_0xf463('0x25')](removeEntity(_0x4b857c,null))['catch'](handleError(_0x4b857c,null));}; \ No newline at end of file +var _0x7f30=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','then','error','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','options','MailApplication','catch','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7f30,0x9f));var _0x07f3=function(_0x3c7318,_0x1dc9fe){_0x3c7318=_0x3c7318-0x0;var _0x11777d=_0x7f30[_0x3c7318];return _0x11777d;};'use strict';var emlformat=require(_0x07f3('0x0'));var rimraf=require(_0x07f3('0x1'));var zipdir=require(_0x07f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07f3('0x3'));var moment=require(_0x07f3('0x4'));var BPromise=require(_0x07f3('0x5'));var Mustache=require(_0x07f3('0x6'));var util=require(_0x07f3('0x7'));var path=require(_0x07f3('0x8'));var sox=require('sox');var csv=require(_0x07f3('0x9'));var ejs=require(_0x07f3('0xa'));var fs=require('fs');var fs_extra=require(_0x07f3('0xb'));var _=require('lodash');var squel=require(_0x07f3('0xc'));var crypto=require(_0x07f3('0xd'));var jsforce=require(_0x07f3('0xe'));var deskjs=require(_0x07f3('0xf'));var toCsv=require(_0x07f3('0x9'));var querystring=require(_0x07f3('0x10'));var Papa=require(_0x07f3('0x11'));var Redis=require(_0x07f3('0x12'));var authService=require(_0x07f3('0x13'));var qs=require(_0x07f3('0x14'));var as=require(_0x07f3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x07f3('0x16'))('api');var utils=require(_0x07f3('0x17'));var config=require(_0x07f3('0x18'));var licenseUtil=require(_0x07f3('0x19'));var db=require(_0x07f3('0x1a'))['db'];function respondWithStatusCode(_0x3ca697,_0x2a2032){_0x2a2032=_0x2a2032||0xcc;return function(_0x16bc35){if(_0x16bc35){return _0x3ca697[_0x07f3('0x1b')](_0x2a2032);}return _0x3ca697[_0x07f3('0x1c')](_0x2a2032)[_0x07f3('0x1d')]();};}function respondWithResult(_0x33a722,_0x54bfb){_0x54bfb=_0x54bfb||0xc8;return function(_0x496eea){if(_0x496eea){return _0x33a722['status'](_0x54bfb)[_0x07f3('0x1e')](_0x496eea);}};}function respondWithFilteredResult(_0x44bd13,_0x1b53f1){return function(_0x4c7116){if(_0x4c7116){var _0x4b21e9=_0x4c7116[_0x07f3('0x1f')],_0x2d0ef3=_0x1b53f1[_0x07f3('0x20')],_0x40bcb5=_0x1b53f1[_0x07f3('0x20')]+_0x1b53f1[_0x07f3('0x21')],_0x34cf31;if(_0x40bcb5>=_0x4b21e9){_0x40bcb5=_0x4b21e9;_0x34cf31=0xc8;}else{_0x34cf31=0xce;}_0x44bd13[_0x07f3('0x1c')](_0x34cf31);return _0x44bd13[_0x07f3('0x22')](_0x07f3('0x23'),_0x2d0ef3+'-'+_0x40bcb5+'/'+_0x4b21e9)['json'](_0x4c7116);}return null;};}function patchUpdates(_0x2ee761){return function(_0xc2140e){try{jsonpatch[_0x07f3('0x24')](_0xc2140e,_0x2ee761,!![]);}catch(_0x4683b8){return BPromise['reject'](_0x4683b8);}return _0xc2140e['save']();};}function saveUpdates(_0x321ff6,_0x4d6cc3){return function(_0x35c9d4){if(_0x35c9d4){return _0x35c9d4[_0x07f3('0x25')](_0x321ff6)['then'](function(_0x4c8d53){return _0x4c8d53;});}return null;};}function removeEntity(_0x39ccf9,_0xf00b0a){return function(_0x51804f){if(_0x51804f){return _0x51804f[_0x07f3('0x26')]()[_0x07f3('0x27')](function(){_0x39ccf9[_0x07f3('0x1c')](0xcc)[_0x07f3('0x1d')]();});}};}function handleEntityNotFound(_0x431788,_0x986d5){return function(_0x3d8e4c){if(!_0x3d8e4c){_0x431788[_0x07f3('0x1b')](0x194);}return _0x3d8e4c;};}function handleError(_0x12c0e8,_0x4c8789){_0x4c8789=_0x4c8789||0x1f4;return function(_0x47182){logger[_0x07f3('0x28')](_0x47182['stack']);if(_0x47182[_0x07f3('0x29')]){delete _0x47182[_0x07f3('0x29')];}_0x12c0e8['status'](_0x4c8789)[_0x07f3('0x2a')](_0x47182);};}exports[_0x07f3('0x2b')]=function(_0x18e0cc,_0x5dd6cd){var _0x2236c4={'raw':!![],'where':{'id':_0x18e0cc[_0x07f3('0x2c')]['id']}},_0x3f7f1b={};_0x3f7f1b[_0x07f3('0x2d')]=_[_0x07f3('0x2e')](db['MailApplication'][_0x07f3('0x2f')]);_0x3f7f1b[_0x07f3('0x30')]=_[_0x07f3('0x2e')](_0x18e0cc[_0x07f3('0x30')]);_0x3f7f1b[_0x07f3('0x31')]=_[_0x07f3('0x32')](_0x3f7f1b[_0x07f3('0x2d')],_0x3f7f1b[_0x07f3('0x30')]);_0x2236c4['attributes']=_[_0x07f3('0x32')](_0x3f7f1b[_0x07f3('0x2d')],qs[_0x07f3('0x33')](_0x18e0cc['query'][_0x07f3('0x33')]));_0x2236c4[_0x07f3('0x34')]=_0x2236c4['attributes'][_0x07f3('0x35')]?_0x2236c4[_0x07f3('0x34')]:_0x3f7f1b[_0x07f3('0x2d')];if(_0x18e0cc[_0x07f3('0x30')][_0x07f3('0x36')]){_0x2236c4[_0x07f3('0x37')]=[{'all':!![]}];}_0x2236c4=_['merge']({},_0x2236c4,_0x18e0cc[_0x07f3('0x38')]);return db[_0x07f3('0x39')]['find'](_0x2236c4)[_0x07f3('0x27')](handleEntityNotFound(_0x5dd6cd,null))[_0x07f3('0x27')](respondWithResult(_0x5dd6cd,null))[_0x07f3('0x3a')](handleError(_0x5dd6cd,null));};exports['update']=function(_0x56ef57,_0x40de0b){if(_0x56ef57[_0x07f3('0x3b')]['id']){delete _0x56ef57[_0x07f3('0x3b')]['id'];}return db[_0x07f3('0x39')][_0x07f3('0x3c')]({'where':{'id':_0x56ef57[_0x07f3('0x2c')]['id']}})[_0x07f3('0x27')](handleEntityNotFound(_0x40de0b,null))['then'](saveUpdates(_0x56ef57[_0x07f3('0x3b')],null))[_0x07f3('0x27')](respondWithResult(_0x40de0b,null))['catch'](handleError(_0x40de0b,null));};exports[_0x07f3('0x26')]=function(_0x486ec7,_0x258cf8){return db[_0x07f3('0x39')][_0x07f3('0x3c')]({'where':{'id':_0x486ec7[_0x07f3('0x2c')]['id']}})[_0x07f3('0x27')](handleEntityNotFound(_0x258cf8,null))[_0x07f3('0x27')](removeEntity(_0x258cf8,null))['catch'](handleError(_0x258cf8,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 2bbce81..3878706 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 _0x6dc0=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1a79d1,_0x1b1f0c){var _0x461f84=function(_0x1f52b8){while(--_0x1f52b8){_0x1a79d1['push'](_0x1a79d1['shift']());}};_0x461f84(++_0x1b1f0c);}(_0x6dc0,0xb6));var _0x06dc=function(_0x2c4a6b,_0x29a928){_0x2c4a6b=_0x2c4a6b-0x0;var _0xe67f09=_0x6dc0[_0x2c4a6b];return _0xe67f09;};'use strict';var _=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var logger=require(_0x06dc('0x2'))('api');var moment=require(_0x06dc('0x3'));var BPromise=require(_0x06dc('0x4'));var rp=require(_0x06dc('0x5'));var fs=require('fs');var path=require(_0x06dc('0x6'));var rimraf=require('rimraf');var config=require(_0x06dc('0x7'));var attributes=require(_0x06dc('0x8'));module['exports']=function(_0x2454b0,_0x491195){return _0x2454b0[_0x06dc('0x9')](_0x06dc('0xa'),attributes,{'tableName':_0x06dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x06dc('0xc'),'collate':_0x06dc('0xd')});}; \ No newline at end of file +var _0x7d8a=['request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1ee351,_0x54261b){var _0x245aaf=function(_0x3e4b65){while(--_0x3e4b65){_0x1ee351['push'](_0x1ee351['shift']());}};_0x245aaf(++_0x54261b);}(_0x7d8a,0x1ca));var _0xa7d8=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x7d8a[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xa7d8('0x0'));var util=require(_0xa7d8('0x1'));var logger=require(_0xa7d8('0x2'))(_0xa7d8('0x3'));var moment=require(_0xa7d8('0x4'));var BPromise=require(_0xa7d8('0x5'));var rp=require(_0xa7d8('0x6'));var fs=require('fs');var path=require(_0xa7d8('0x7'));var rimraf=require(_0xa7d8('0x8'));var config=require(_0xa7d8('0x9'));var attributes=require(_0xa7d8('0xa'));module[_0xa7d8('0xb')]=function(_0x3f35c9,_0x44660b){return _0x3f35c9['define'](_0xa7d8('0xc'),attributes,{'tableName':_0xa7d8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa7d8('0xe'),'collate':_0xa7d8('0xf')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 0d00175..341266b 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 _0x66b3=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateMailApplication','update','options','raw','where','attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x66b3,0x138));var _0x366b=function(_0x4eba0a,_0x2973a5){_0x4eba0a=_0x4eba0a-0x0;var _0x34d2ea=_0x66b3[_0x4eba0a];return _0x34d2ea;};'use strict';var _=require(_0x366b('0x0'));var util=require(_0x366b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x366b('0x2'));var fs=require('fs');var Redis=require(_0x366b('0x3'));var db=require(_0x366b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x366b('0x5'))(_0x366b('0x6'));var config=require('../../config/environment');var jayson=require(_0x366b('0x7'));var client=jayson[_0x366b('0x8')][_0x366b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdf95a6,_0x4e9426,_0x44064a){return new BPromise(function(_0x3315c4,_0x1dd2e3){return client['request'](_0xdf95a6,_0x44064a)['then'](function(_0x119c1e){logger['info'](_0x366b('0xa'),_0x4e9426,_0x366b('0xb'));logger[_0x366b('0xc')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x4e9426,_0x366b('0xb'),JSON[_0x366b('0xd')](_0x119c1e));if(_0x119c1e['error']){if(_0x119c1e[_0x366b('0xe')][_0x366b('0xf')]===0x1f4){logger[_0x366b('0xe')](_0x366b('0xa'),_0x4e9426,_0x119c1e[_0x366b('0xe')][_0x366b('0x10')]);return _0x1dd2e3(_0x119c1e[_0x366b('0xe')][_0x366b('0x10')]);}logger['error'](_0x366b('0xa'),_0x4e9426,_0x119c1e[_0x366b('0xe')]['message']);return _0x3315c4(_0x119c1e[_0x366b('0xe')][_0x366b('0x10')]);}else{logger[_0x366b('0x11')](_0x366b('0xa'),_0x4e9426,_0x366b('0xb'));_0x3315c4(_0x119c1e[_0x366b('0x12')][_0x366b('0x10')]);}})[_0x366b('0x13')](function(_0x415d62){logger[_0x366b('0xe')](_0x366b('0xa'),_0x4e9426,_0x415d62);_0x1dd2e3(_0x415d62);});});}exports[_0x366b('0x14')]=function(_0x2dc0cd){var _0x1fdcae=this;return new Promise(function(_0x2a6cbe,_0x2aa5b5){return db['MailApplication'][_0x366b('0x15')](_0x2dc0cd['body'],{'raw':_0x2dc0cd['options']?_0x2dc0cd[_0x366b('0x16')][_0x366b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dc0cd[_0x366b('0x16')]?_0x2dc0cd['options'][_0x366b('0x18')]||null:null,'attributes':_0x2dc0cd[_0x366b('0x16')]?_0x2dc0cd[_0x366b('0x16')][_0x366b('0x19')]||null:null,'limit':_0x2dc0cd['options']?_0x2dc0cd[_0x366b('0x16')]['limit']||null:null})['then'](function(_0x1e0481){logger[_0x366b('0x11')](_0x366b('0x14'),_0x2dc0cd);logger[_0x366b('0xc')]('UpdateMailApplication',_0x2dc0cd,JSON[_0x366b('0xd')](_0x1e0481));_0x2a6cbe(_0x1e0481);})['catch'](function(_0x6326d6){logger[_0x366b('0xe')](_0x366b('0x14'),_0x6326d6[_0x366b('0x10')],_0x2dc0cd);_0x2aa5b5(_0x1fdcae[_0x366b('0xe')](0x1f4,_0x6326d6['message']));});});}; \ No newline at end of file +var _0xf604=['../../config/environment','client','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','error','message','result','UpdateMailApplication','MailApplication','update','body','options','attributes','limit','then','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf604,0xc8));var _0x4f60=function(_0x1097ab,_0x37fce2){_0x1097ab=_0x1097ab-0x0;var _0x416667=_0xf604[_0x1097ab];return _0x416667;};'use strict';var _=require(_0x4f60('0x0'));var util=require(_0x4f60('0x1'));var moment=require(_0x4f60('0x2'));var BPromise=require(_0x4f60('0x3'));var rs=require(_0x4f60('0x4'));var fs=require('fs');var Redis=require(_0x4f60('0x5'));var db=require(_0x4f60('0x6'))['db'];var utils=require(_0x4f60('0x7'));var logger=require(_0x4f60('0x8'))(_0x4f60('0x9'));var config=require(_0x4f60('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4f60('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42be1c,_0x525dc1,_0x41fdb7){return new BPromise(function(_0xd92fb,_0x2efdf8){return client[_0x4f60('0xc')](_0x42be1c,_0x41fdb7)['then'](function(_0x2b803c){logger[_0x4f60('0xd')](_0x4f60('0xe'),_0x525dc1,_0x4f60('0xf'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x525dc1,_0x4f60('0xf'),JSON['stringify'](_0x2b803c));if(_0x2b803c[_0x4f60('0x10')]){if(_0x2b803c[_0x4f60('0x10')]['code']===0x1f4){logger['error'](_0x4f60('0xe'),_0x525dc1,_0x2b803c[_0x4f60('0x10')][_0x4f60('0x11')]);return _0x2efdf8(_0x2b803c[_0x4f60('0x10')][_0x4f60('0x11')]);}logger['error'](_0x4f60('0xe'),_0x525dc1,_0x2b803c['error'][_0x4f60('0x11')]);return _0xd92fb(_0x2b803c[_0x4f60('0x10')][_0x4f60('0x11')]);}else{logger[_0x4f60('0xd')](_0x4f60('0xe'),_0x525dc1,_0x4f60('0xf'));_0xd92fb(_0x2b803c[_0x4f60('0x12')][_0x4f60('0x11')]);}})['catch'](function(_0x4c084c){logger[_0x4f60('0x10')](_0x4f60('0xe'),_0x525dc1,_0x4c084c);_0x2efdf8(_0x4c084c);});});}exports[_0x4f60('0x13')]=function(_0x59a6df){var _0x1b1ed1=this;return new Promise(function(_0x18421b,_0x3c8e6f){return db[_0x4f60('0x14')][_0x4f60('0x15')](_0x59a6df[_0x4f60('0x16')],{'raw':_0x59a6df['options']?_0x59a6df['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59a6df[_0x4f60('0x17')]?_0x59a6df['options']['where']||null:null,'attributes':_0x59a6df[_0x4f60('0x17')]?_0x59a6df[_0x4f60('0x17')][_0x4f60('0x18')]||null:null,'limit':_0x59a6df[_0x4f60('0x17')]?_0x59a6df[_0x4f60('0x17')][_0x4f60('0x19')]||null:null})[_0x4f60('0x1a')](function(_0xc1134){logger['info'](_0x4f60('0x13'),_0x59a6df);logger[_0x4f60('0x1b')]('UpdateMailApplication',_0x59a6df,JSON[_0x4f60('0x1c')](_0xc1134));_0x18421b(_0xc1134);})[_0x4f60('0x1d')](function(_0x317dfe){logger['error'](_0x4f60('0x13'),_0x317dfe[_0x4f60('0x11')],_0x59a6df);_0x3c8e6f(_0x1b1ed1[_0x4f60('0x10')](0x1f4,_0x317dfe['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index defd24d..36ebc1e 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 _0x950c=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','put','update','delete','mailinteraction:destroy','destroy','removeTags','exports','multer','util'];(function(_0x149f32,_0x4273f7){var _0x11f475=function(_0x18eeef){while(--_0x18eeef){_0x149f32['push'](_0x149f32['shift']());}};_0x11f475(++_0x4273f7);}(_0x950c,0xc4));var _0xc950=function(_0x4a032d,_0xd97205){_0x4a032d=_0x4a032d-0x0;var _0xf2798b=_0x950c[_0x4a032d];return _0xf2798b;};'use strict';var multer=require(_0xc950('0x0'));var util=require(_0xc950('0x1'));var path=require(_0xc950('0x2'));var timeout=require(_0xc950('0x3'));var express=require(_0xc950('0x4'));var router=express['Router']();var fs_extra=require(_0xc950('0x5'));var auth=require(_0xc950('0x6'));var interaction=require(_0xc950('0x7'));var config=require(_0xc950('0x8'));var controller=require(_0xc950('0x9'));router['get']('/',auth[_0xc950('0xa')](),controller[_0xc950('0xb')]);router[_0xc950('0xc')](_0xc950('0xd'),auth[_0xc950('0xa')](),controller['describe']);router[_0xc950('0xc')](_0xc950('0xe'),auth[_0xc950('0xa')](),controller[_0xc950('0xf')]);router[_0xc950('0xc')](_0xc950('0x10'),auth[_0xc950('0xa')](),controller[_0xc950('0x11')]);router[_0xc950('0xc')](_0xc950('0x12'),auth[_0xc950('0xa')](),controller[_0xc950('0x13')]);router[_0xc950('0x14')]('/',auth['isAuthenticated'](),controller[_0xc950('0x15')]);router[_0xc950('0x14')](_0xc950('0x10'),auth[_0xc950('0xa')](),controller['addMessage']);router['post'](_0xc950('0x16'),auth[_0xc950('0xa')](),interaction[_0xc950('0x17')](_0xc950('0x18'),_0xc950('0x19')),controller['addTags']);router[_0xc950('0x1a')]('/:id',auth[_0xc950('0xa')](),interaction[_0xc950('0x17')](_0xc950('0x18'),'mailinteraction:update'),controller[_0xc950('0x1b')]);router[_0xc950('0x1c')](_0xc950('0xe'),auth['isAuthenticated'](),interaction[_0xc950('0x17')](_0xc950('0x18'),_0xc950('0x1d')),controller[_0xc950('0x1e')]);router['delete'](_0xc950('0x16'),auth[_0xc950('0xa')](),controller[_0xc950('0x1f')]);module[_0xc950('0x20')]=router; \ No newline at end of file +var _0x847e=['mailinteraction:update','update','delete','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked'];(function(_0x22fcb0,_0x2f6d03){var _0x530380=function(_0xf465b2){while(--_0xf465b2){_0x22fcb0['push'](_0x22fcb0['shift']());}};_0x530380(++_0x2f6d03);}(_0x847e,0x14f));var _0xe847=function(_0x46ccca,_0x5def23){_0x46ccca=_0x46ccca-0x0;var _0x571410=_0x847e[_0x46ccca];return _0x571410;};'use strict';var multer=require('multer');var util=require(_0xe847('0x0'));var path=require(_0xe847('0x1'));var timeout=require('connect-timeout');var express=require(_0xe847('0x2'));var router=express[_0xe847('0x3')]();var fs_extra=require(_0xe847('0x4'));var auth=require(_0xe847('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe847('0x6'));router[_0xe847('0x7')]('/',auth[_0xe847('0x8')](),controller[_0xe847('0x9')]);router[_0xe847('0x7')](_0xe847('0xa'),auth[_0xe847('0x8')](),controller[_0xe847('0xb')]);router[_0xe847('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe847('0xc')]);router[_0xe847('0x7')](_0xe847('0xd'),auth[_0xe847('0x8')](),controller[_0xe847('0xe')]);router[_0xe847('0x7')](_0xe847('0xf'),auth['isAuthenticated'](),controller[_0xe847('0x10')]);router['post']('/',auth[_0xe847('0x8')](),controller['create']);router[_0xe847('0x11')](_0xe847('0xd'),auth['isAuthenticated'](),controller[_0xe847('0x12')]);router[_0xe847('0x11')](_0xe847('0x13'),auth[_0xe847('0x8')](),interaction['tracked'](_0xe847('0x14'),_0xe847('0x15')),controller[_0xe847('0x16')]);router[_0xe847('0x17')]('/:id',auth[_0xe847('0x8')](),interaction[_0xe847('0x18')](_0xe847('0x14'),_0xe847('0x19')),controller[_0xe847('0x1a')]);router[_0xe847('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0xe847('0x18')](_0xe847('0x14'),'mailinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0xe847('0x8')](),controller[_0xe847('0x1c')]);module[_0xe847('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index b91a4b4..6a36879 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 _0xc6a2=['DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','BOOLEAN'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xc6a2,0x69));var _0x2c6a=function(_0x5cfdc2,_0x5030fc){_0x5cfdc2=_0x5cfdc2-0x0;var _0x496158=_0xc6a2[_0x5cfdc2];return _0x496158;};'use strict';var Sequelize=require(_0x2c6a('0x0'));var iconv=require(_0x2c6a('0x1'));module['exports']={'closed':{'type':Sequelize[_0x2c6a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2c6a('0x3')]},'disposition':{'type':Sequelize[_0x2c6a('0x4')]},'secondDisposition':{'type':Sequelize[_0x2c6a('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2c6a('0x4')]},'note':{'type':Sequelize[_0x2c6a('0x4')]},'inReplyTo':{'type':Sequelize[_0x2c6a('0x4')](0x1fe)},'to':{'type':Sequelize[_0x2c6a('0x4')]},'cc':{'type':Sequelize[_0x2c6a('0x5')](_0x2c6a('0x6'))},'subject':{'type':Sequelize[_0x2c6a('0x5')]()},'attach':{'type':Sequelize[_0x2c6a('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x2c6a('0x3')]},'substatus':{'type':Sequelize[_0x2c6a('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x2c6a('0x7')]('in',_0x2c6a('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2c6a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2c6a('0x7')]('in',_0x2c6a('0x8')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x720f=['DATE','STRING','TEXT','long','out','sequelize'];(function(_0x5dfd80,_0x1f30ac){var _0x45247d=function(_0x58f8f0){while(--_0x58f8f0){_0x5dfd80['push'](_0x5dfd80['shift']());}};_0x45247d(++_0x1f30ac);}(_0x720f,0x185));var _0xf720=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0x720f[_0x1ac120];return _0x19b703;};'use strict';var Sequelize=require(_0xf720('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf720('0x1')]},'disposition':{'type':Sequelize[_0xf720('0x2')]},'secondDisposition':{'type':Sequelize[_0xf720('0x2')]},'thirdDisposition':{'type':Sequelize[_0xf720('0x2')]},'note':{'type':Sequelize[_0xf720('0x2')]},'inReplyTo':{'type':Sequelize[_0xf720('0x2')](0x1fe)},'to':{'type':Sequelize[_0xf720('0x2')]},'cc':{'type':Sequelize[_0xf720('0x3')](_0xf720('0x4'))},'subject':{'type':Sequelize[_0xf720('0x3')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf720('0x1')]},'substatus':{'type':Sequelize[_0xf720('0x2')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf720('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf720('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf720('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index fe57f57..f9c2454 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 _0x3edb=['isNumeric','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','role','i.MailAccountId\x20IS\x20NULL','user','agent','sequelize','toString','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','push','all','rows','show','params','keys','include','options','create','body','describe','addMessage','MailMessage','ids','getMessages','hasOwnProperty','MailInteractionId','merge','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','inlineCss','true','addTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','join','root','server','files','transcript-%d-%s.zip','attachments','Attachment','Attachments','bcc','subject','Messages','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','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','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','count','Content-Range','apply','reject','save','update','destroy','error','name','send','Users','map','TagIds','Tags','split','forEach','findOne','out','plainBody','then','lastMsgText','trimStart','catch','MailInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','offset','order','sort','where','pick','field','color','from','tools_tags','select','u.fullname','ui.MailInteractionId','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','value','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0x3edb,0x15d));var _0xb3ed=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x3edb[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0xb3ed('0x0'));var rimraf=require(_0xb3ed('0x1'));var zipdir=require(_0xb3ed('0x2'));var jsonpatch=require(_0xb3ed('0x3'));var rp=require('request-promise');var moment=require(_0xb3ed('0x4'));var BPromise=require(_0xb3ed('0x5'));var Mustache=require(_0xb3ed('0x6'));var util=require(_0xb3ed('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb3ed('0x8'));var fs=require('fs');var fs_extra=require(_0xb3ed('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb3ed('0xa'));var jsforce=require(_0xb3ed('0xb'));var deskjs=require(_0xb3ed('0xc'));var toCsv=require(_0xb3ed('0xd'));var querystring=require(_0xb3ed('0xe'));var Papa=require(_0xb3ed('0xf'));var htmlToText=require('html-to-text');var juice=require('juice');var Redis=require(_0xb3ed('0x10'));var authService=require(_0xb3ed('0x11'));var qs=require(_0xb3ed('0x12'));var as=require(_0xb3ed('0x13'));var hardwareService=require(_0xb3ed('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb3ed('0x15'));var config=require(_0xb3ed('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb3ed('0x17')]=_[_0xb3ed('0x18')](config[_0xb3ed('0x17')],{'host':_0xb3ed('0x19'),'port':0x18eb});var socket=require(_0xb3ed('0x1a'))(new Redis(config['redis']));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x25aac0,_0x38ef1b){_0x38ef1b=_0x38ef1b||0xcc;return function(_0xb311d3){if(_0xb311d3){return _0x25aac0[_0xb3ed('0x1b')](_0x38ef1b);}return _0x25aac0['status'](_0x38ef1b)[_0xb3ed('0x1c')]();};}function respondWithResult(_0x531ee4,_0x274b9a){_0x274b9a=_0x274b9a||0xc8;return function(_0x69d01d){if(_0x69d01d){return _0x531ee4[_0xb3ed('0x1d')](_0x274b9a)[_0xb3ed('0x1e')](_0x69d01d);}};}function respondWithFilteredResult(_0x8134e6,_0x41ff57){return function(_0x339f9e){if(_0x339f9e){var _0x376248=_0x339f9e[_0xb3ed('0x1f')],_0x2bdd89=_0x41ff57['offset'],_0x376cf7=_0x41ff57['offset']+_0x41ff57['limit'],_0x2871fb;if(_0x376cf7>=_0x376248){_0x376cf7=_0x376248;_0x2871fb=0xc8;}else{_0x2871fb=0xce;}_0x8134e6[_0xb3ed('0x1d')](_0x2871fb);return _0x8134e6['set'](_0xb3ed('0x20'),_0x2bdd89+'-'+_0x376cf7+'/'+_0x376248)[_0xb3ed('0x1e')](_0x339f9e);}return null;};}function patchUpdates(_0x328498){return function(_0x5aa24e){try{jsonpatch[_0xb3ed('0x21')](_0x5aa24e,_0x328498,!![]);}catch(_0x941116){return BPromise[_0xb3ed('0x22')](_0x941116);}return _0x5aa24e[_0xb3ed('0x23')]();};}function saveUpdates(_0x274f9a,_0xbe3dc8){return function(_0x313b99){if(_0x313b99){return _0x313b99[_0xb3ed('0x24')](_0x274f9a)['then'](function(_0x217096){return _0x217096;});}return null;};}function removeEntity(_0x1cd1c2,_0x2f838e){return function(_0x596c6b){if(_0x596c6b){return _0x596c6b[_0xb3ed('0x25')]()['then'](function(){_0x1cd1c2[_0xb3ed('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f62cb,_0x3566ca){return function(_0x518ff5){if(!_0x518ff5){_0x3f62cb[_0xb3ed('0x1b')](0x194);}return _0x518ff5;};}function handleError(_0x5a85a7,_0x2e440c){_0x2e440c=_0x2e440c||0x1f4;return function(_0x29acd5){logger[_0xb3ed('0x26')](_0x29acd5['stack']);if(_0x29acd5[_0xb3ed('0x27')]){delete _0x29acd5[_0xb3ed('0x27')];}_0x5a85a7['status'](_0x2e440c)[_0xb3ed('0x28')](_0x29acd5);};}function getInteractionUsers(_0x3c54b6,_0x141df5){return new BPromise(function(_0x268dab,_0x32da11){try{if(_0x141df5[_0x3c54b6['id']]){_0x3c54b6[_0xb3ed('0x29')]=_[_0xb3ed('0x2a')](_0x141df5[_0x3c54b6['id']],function(_0x595a63){return{'id':_0x595a63['id'],'fullname':_0x595a63['fullname']};});}}catch(_0xd4b982){_0x32da11(_0xd4b982);}_0x268dab(_0x3c54b6);});}function getInteractionTags(_0x99c0a1,_0x32b69a){return new BPromise(function(_0x5db953,_0x833945){try{if(_0x99c0a1[_0xb3ed('0x2b')]){_0x99c0a1[_0xb3ed('0x2c')]=[];_0x99c0a1[_0xb3ed('0x2b')][_0xb3ed('0x2d')](',')[_0xb3ed('0x2e')](function(_0x311396){_0x99c0a1[_0xb3ed('0x2c')]['push'](_0x32b69a[_0x311396]);});}delete _0x99c0a1[_0xb3ed('0x2b')];}catch(_0x230fa8){_0x833945(_0x230fa8);}_0x5db953(_0x99c0a1);});}function getLastMessageText(_0x16b84d){return new BPromise(function(_0x5e4325,_0x3cea59){return db['MailMessage'][_0xb3ed('0x2f')]({'where':{'$and':[{'MailInteractionId':_0x16b84d['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb3ed('0x30')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xb3ed('0x31')],'order':'-id','raw':!![]})[_0xb3ed('0x32')](function(_0x1663bc){if(_0x1663bc&&_0x1663bc[_0xb3ed('0x31')]){_0x16b84d[_0xb3ed('0x33')]=_[_0xb3ed('0x34')](_0x1663bc[_0xb3ed('0x31')]);}_0x5e4325(_0x16b84d);})[_0xb3ed('0x35')](function(_0x1442ae){_0x3cea59(_0x1442ae);});});}function updateMailInteraction(_0x41106f,_0x1fca20,_0x51cbbc,_0x2020ef){return new BPromise(function(_0x43692c,_0x2bf5f8){return getInteractionUsers(_0x41106f,_0x51cbbc)[_0xb3ed('0x32')](function(_0x5d4a05){return getInteractionTags(_0x5d4a05,_0x1fca20);})['then'](function(_0x1844c6){if(_0x2020ef){_0x43692c(getLastMessageText(_0x1844c6));}else{_0x43692c(_0x1844c6);}})[_0xb3ed('0x35')](function(_0x5293f2){_0x2bf5f8(_0x5293f2);});});}exports['index']=function(_0x31a924,_0x2f06c0){var _0x50a509={},_0x305e1f={},_0x3b2d61={'count':0x0,'rows':[]};var _0x1c96b1=_[_0xb3ed('0x2a')](db[_0xb3ed('0x36')][_0xb3ed('0x37')],function(_0x10959e){return{'name':_0x10959e[_0xb3ed('0x38')],'type':_0x10959e[_0xb3ed('0x39')][_0xb3ed('0x3a')]};});_0x305e1f[_0xb3ed('0x3b')]=_[_0xb3ed('0x2a')](_0x1c96b1,_0xb3ed('0x27'));_0x305e1f[_0xb3ed('0x3c')]=_['keys'](_0x31a924[_0xb3ed('0x3c')]);_0x305e1f[_0xb3ed('0x3d')]=_[_0xb3ed('0x3e')](_0x305e1f['model'],_0x305e1f[_0xb3ed('0x3c')]);_0x50a509['attributes']=_[_0xb3ed('0x3e')](_0x305e1f[_0xb3ed('0x3b')],qs[_0xb3ed('0x3f')](_0x31a924['query'][_0xb3ed('0x3f')]));_0x50a509[_0xb3ed('0x40')]=_0x50a509[_0xb3ed('0x40')][_0xb3ed('0x41')]?_0x50a509[_0xb3ed('0x40')]:_0x305e1f[_0xb3ed('0x3b')];if(!_0x31a924[_0xb3ed('0x3c')]['hasOwnProperty'](_0xb3ed('0x42'))){_0x50a509[_0xb3ed('0x43')]=qs[_0xb3ed('0x43')](_0x31a924[_0xb3ed('0x3c')][_0xb3ed('0x43')]);_0x50a509[_0xb3ed('0x44')]=qs[_0xb3ed('0x44')](_0x31a924[_0xb3ed('0x3c')][_0xb3ed('0x44')]);}_0x50a509[_0xb3ed('0x45')]=qs[_0xb3ed('0x46')](_0x31a924[_0xb3ed('0x3c')]['sort']);_0x50a509[_0xb3ed('0x47')]=qs['filters'](_[_0xb3ed('0x48')](_0x31a924['query'],_0x305e1f['filters']),_0x1c96b1);var _0xcf646e=[];var _0x2a55bf=squel['select']()['field']('id')[_0xb3ed('0x49')]('name')[_0xb3ed('0x49')](_0xb3ed('0x4a'))[_0xb3ed('0x4b')](_0xb3ed('0x4c'));var _0x903f4d=squel[_0xb3ed('0x4d')]()['field']('u.id')[_0xb3ed('0x49')](_0xb3ed('0x4e'))[_0xb3ed('0x49')](_0xb3ed('0x4f'))[_0xb3ed('0x4b')]('user_has_mail_interactions','ui')['left_join'](_0xb3ed('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x1e0fdd=squel['select']()[_0xb3ed('0x4b')](_0xb3ed('0x51'),'i')['left_join'](_0xb3ed('0x52'),'c',_0xb3ed('0x53'))['left_join'](_0xb3ed('0x50'),'o','o.id\x20=\x20i.UserId')[_0xb3ed('0x54')](_0xb3ed('0x55'),'a',_0xb3ed('0x56'))[_0xb3ed('0x54')](_0xb3ed('0x57'),'me',_0xb3ed('0x58'))['left_join'](_0xb3ed('0x59'),'it',_0xb3ed('0x5a'))['left_join']('tools_tags','t',_0xb3ed('0x5b'));var _0x2a560e=squel[_0xb3ed('0x5c')]();var _0x28fc79=[];var _0x543e4c=squel[_0xb3ed('0x5c')]();var _0x5a5c33;if(_0x31a924[_0xb3ed('0x3c')]['search']){_0x5a5c33=as[_0xb3ed('0x5d')](_0x31a924[_0xb3ed('0x3c')][_0xb3ed('0x5e')]);var _0x19d436=_0x5a5c33[_0xb3ed('0x5f')];for(var _0x25a84b=0x0;_0x25a84b<_0x5a5c33['conditions']['length'];_0x25a84b++){var _0xe26486=_0x5a5c33[_0xb3ed('0x60')][_0x25a84b];var _0x437ba9='i';var _0x337fdf=_['find'](_0x1c96b1,['name',_0xe26486[_0xb3ed('0x49')]]);if(!_0x337fdf){switch(_0xe26486[_0xb3ed('0x49')]){case'unreadMessages':if(_0xe26486[_0xb3ed('0x61')]==0x1){_0x1e0fdd['having']('`'+_0xe26486['field']+'`\x20=\x200');}else{_0x1e0fdd[_0xb3ed('0x62')]('`'+_0xe26486[_0xb3ed('0x49')]+_0xb3ed('0x63'));}break;case'Contact':if(_0xe26486[_0xb3ed('0x64')]===_0xb3ed('0x65')){if(_0xe26486[_0xb3ed('0x61')]['split']('\x20')[_0xb3ed('0x41')]>0x1){_0x2a560e[_0x19d436](_0xb3ed('0x66'),qs[_0xb3ed('0x67')](_0xe26486['value']),null);}else{var _0x52adb7='%'+_0xe26486[_0xb3ed('0x61')]+'%';_0x2a560e[_0x19d436](_0xb3ed('0x68'),_0x52adb7,_0x52adb7,_0x52adb7);}}else{_0x337fdf=_[_0xb3ed('0x69')](_0x1c96b1,[_0xb3ed('0x27'),_0xb3ed('0x6a')]);_0xe26486[_0xb3ed('0x49')]=_0xb3ed('0x6a');_0x204548=as[_0xb3ed('0x6b')](_0x437ba9,_0x337fdf[_0xb3ed('0x39')],_0xe26486);_0x2a560e[_0x19d436](_0x204548[_0xb3ed('0x6c')],_0x204548[_0xb3ed('0x61')]['start'],_0x204548[_0xb3ed('0x61')]['end']);}break;case'Tag':var _0x323cad=_0xe26486[_0xb3ed('0x61')][_0xb3ed('0x2d')](',')[_0xb3ed('0x2a')](function(_0x3fca5a){return Number(_0x3fca5a);});_0x323cad['forEach'](function(_0x4b23e9){_0x543e4c['or'](_0xb3ed('0x6d'),'%,'+_0x4b23e9+',%');});_0x28fc79=_[_0xb3ed('0x6e')](_0x28fc79,_0x323cad);break;case _0xb3ed('0x6f'):if(_0xe26486[_0xb3ed('0x64')]==='$substring'){_0x2a560e[_0x19d436](_0xb3ed('0x70'),'%'+_0xe26486['value']+'%',null);}else{_0x337fdf=_[_0xb3ed('0x69')](_0x1c96b1,[_0xb3ed('0x27'),'UserId']);_0xe26486[_0xb3ed('0x49')]='UserId';_0x204548=as[_0xb3ed('0x6b')](_0x437ba9,_0x337fdf['type'],_0xe26486);_0x2a560e[_0x19d436](_0x204548[_0xb3ed('0x6c')],_0x204548[_0xb3ed('0x61')]['start'],_0x204548[_0xb3ed('0x61')]['end']);}break;case'plainBody':_0x204548=as[_0xb3ed('0x6b')]('me',null,_0xe26486);_0x2a560e[_0x19d436](_0x204548[_0xb3ed('0x6c')],_0x204548['value'][_0xb3ed('0x71')],_0x204548[_0xb3ed('0x61')]['end']);break;}}else{var _0x204548=as[_0xb3ed('0x6b')](_0x437ba9,_0x337fdf[_0xb3ed('0x39')],_0xe26486);_0x2a560e[_0x19d436](_0x204548[_0xb3ed('0x6c')],_0x204548['value'][_0xb3ed('0x71')],_0x204548[_0xb3ed('0x61')]['end']);}}}else{var _0xae5f89=_(_0x31a924[_0xb3ed('0x3c')])['keys']()[_0xb3ed('0x2a')](function(_0x3b82cc){return _[_0xb3ed('0x72')](_0x1c96b1,[_0xb3ed('0x27'),_0x3b82cc])?_0x3b82cc:undefined;})[_0xb3ed('0x73')]()[_0xb3ed('0x61')]();if(!_['isEmpty'](_0xae5f89)){_0xae5f89['forEach'](function(_0x2f63c5){if(_0x2f63c5===_0xb3ed('0x74')){_0x1e0fdd[_0xb3ed('0x47')](_0xb3ed('0x75'),[][_0xb3ed('0x76')](_0x31a924['query'][_0x2f63c5]));}else if(_0x2f63c5===_0xb3ed('0x77')){var _0x33ea8a=JSON[_0xb3ed('0x78')](_0x31a924[_0xb3ed('0x3c')][_0x2f63c5])[_0xb3ed('0x79')];var _0x4dc986=JSON[_0xb3ed('0x78')](_0x31a924[_0xb3ed('0x3c')][_0x2f63c5])[_0xb3ed('0x7a')];_0x1e0fdd[_0xb3ed('0x47')](_0xb3ed('0x7b'),_0x33ea8a,_0x4dc986);}else{if(_0x31a924[_0xb3ed('0x3c')][_0x2f63c5]==='null'){_0x1e0fdd[_0xb3ed('0x47')]('i.'+_0x2f63c5+'\x20IS\x20NULL');}else{_0x1e0fdd[_0xb3ed('0x47')]('i.'+_0x2f63c5+_0xb3ed('0x7c'),_0x31a924['query'][_0x2f63c5]);}}});}if(_0x31a924['query'][_0xb3ed('0x7d')]){if(_0x31a924[_0xb3ed('0x3c')]['read']==0x1){_0x1e0fdd[_0xb3ed('0x62')](_0xb3ed('0x7e'));}else{_0x1e0fdd[_0xb3ed('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x31a924[_0xb3ed('0x3c')][_0xb3ed('0x7f')]){_0x28fc79=_[_0xb3ed('0x80')](_0x31a924[_0xb3ed('0x3c')][_0xb3ed('0x7f')])?_0x31a924[_0xb3ed('0x3c')][_0xb3ed('0x7f')]:new Array(_0x31a924[_0xb3ed('0x3c')][_0xb3ed('0x7f')]);_0x28fc79[_0xb3ed('0x2e')](function(_0x52f48d){_0x543e4c['or'](_0xb3ed('0x6d'),'%,'+_0x52f48d+',%');});}if(_0x31a924[_0xb3ed('0x3c')][_0xb3ed('0x81')]){var _0x57ba15=_0x31a924['query']['filter'][_0xb3ed('0x82')]('\x5c','\x5c\x5c')[_0xb3ed('0x82')](/'/g,'\x27\x27');if(qs[_0xb3ed('0x83')](_0x57ba15)){_0x2a560e['or']('i.id\x20LIKE\x20?',_0x57ba15+'%');}else if(qs[_0xb3ed('0x84')](_0x57ba15)){_0x2a560e['or'](_0xb3ed('0x85'),_0x57ba15+'%');}else{_0x2a560e['or'](_0xb3ed('0x86'),qs[_0xb3ed('0x67')](_0x57ba15))['or'](_0xb3ed('0x87'),qs['getFullTextValue'](_0x57ba15));}}}_0x1e0fdd[_0xb3ed('0x47')](_0x2a560e);_0x1e0fdd[_0xb3ed('0x88')]('i.id');var _0x4b333a={'type':db[_0xb3ed('0x89')]['QueryTypes'][_0xb3ed('0x8a')],'raw':!![]};var _0x3266eb=_0x1e0fdd[_0xb3ed('0x8b')]();_0x3266eb[_0xb3ed('0x49')](_0xb3ed('0x8c'));_0x3266eb[_0xb3ed('0x49')](_0xb3ed('0x8d'),'unreadMessages');if(_0x50a509[_0xb3ed('0x45')]){_0x50a509[_0xb3ed('0x45')][_0xb3ed('0x2e')](function(_0xd485a6){var _0x2420af=_0xd485a6[0x0]===_0xb3ed('0x8e')?_0xd485a6[0x0]:'i.'+_0xd485a6[0x0];_0x1e0fdd['order'](_0x2420af,_0xd485a6[0x1]===_0xb3ed('0x8f')?![]:!![]);});}if(!_[_0xb3ed('0x90')](_0x28fc79)){_0x1e0fdd[_0xb3ed('0x62')](_0x543e4c);_0x3266eb[_0xb3ed('0x47')](_0xb3ed('0x91'),_0x28fc79);}BPromise[_0xb3ed('0x92')]()[_0xb3ed('0x32')](function(){if(!_0x5a5c33){if(_0x31a924[_0xb3ed('0x3c')][_0xb3ed('0x74')])return;_0x3266eb['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x1e0fdd[_0xb3ed('0x47')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x31a924['user'][_0xb3ed('0x93')]!=='agent')return;return _0x31a924['user']['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xb3ed('0x32')](function(_0x5e727a){if(_['isEmpty'](_0x5e727a)){_0x3266eb[_0xb3ed('0x47')](_0xb3ed('0x94'));_0x1e0fdd['where'](_0xb3ed('0x94'));}else{_0x3266eb[_0xb3ed('0x47')](_0xb3ed('0x75'),_['map'](_0x5e727a,'id'));_0x1e0fdd[_0xb3ed('0x47')](_0xb3ed('0x75'),_[_0xb3ed('0x2a')](_0x5e727a,'id'));}});})[_0xb3ed('0x32')](function(){if(_0x31a924[_0xb3ed('0x95')][_0xb3ed('0x93')]===_0xb3ed('0x96')&&!_0x5a5c33&&!_0x31a924[_0xb3ed('0x3c')]['MailAccountId'])return[];return db[_0xb3ed('0x97')]['query'](_0x3266eb[_0xb3ed('0x98')](),_0x4b333a);})['then'](function(_0xe2551b){_0x3b2d61[_0xb3ed('0x1f')]=_0xe2551b['length'];if(_0x3b2d61[_0xb3ed('0x1f')]===0x0)return[];return db[_0xb3ed('0x97')]['query'](_0x2a55bf[_0xb3ed('0x98')](),_0x4b333a)[_0xb3ed('0x32')](function(_0x413a03){_0xcf646e=_['keyBy'](_0x413a03,'id');_0x4b333a=_['merge'](_0x4b333a,{'model':db[_0xb3ed('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31a924['query'][_0xb3ed('0x3f')]){_0x50a509[_0xb3ed('0x40')][_0xb3ed('0x2e')](function(_0x863f2f){_0x1e0fdd[_0xb3ed('0x49')]('i.'+_0x863f2f);});}else{_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0x8d'),'unreadMessages');_0x1e0fdd['field'](_0xb3ed('0x99'),'Account.key');_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0x9a'),_0xb3ed('0x9b'));_0x1e0fdd[_0xb3ed('0x49')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xb3ed('0x8e'));_0x1e0fdd['field'](_0xb3ed('0x8c'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0x9c'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0x9d'));_0x1e0fdd['field']('i.closed');_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0x9e'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0x9f'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xa0'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xa1'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xa2'));_0x1e0fdd[_0xb3ed('0x49')]('i.disposition');_0x1e0fdd[_0xb3ed('0x49')]('i.secondDisposition');_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xa3'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xa4'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xa5'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xa6'));_0x1e0fdd[_0xb3ed('0x49')]('i.MailAccountId');_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xa7'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xa8'),_0xb3ed('0xa9'));_0x1e0fdd[_0xb3ed('0x49')]('c.lastName',_0xb3ed('0xaa'));_0x1e0fdd['field'](_0xb3ed('0xab'),'Contact.email');_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xac'),_0xb3ed('0xad'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xae'),_0xb3ed('0xaf'));_0x1e0fdd[_0xb3ed('0x49')]('c.fax',_0xb3ed('0xb0'));_0x1e0fdd[_0xb3ed('0x49')](_0xb3ed('0xb1'),_0xb3ed('0xb2'));_0x1e0fdd['field'](_0xb3ed('0xb3'),_0xb3ed('0xb4'));_0x1e0fdd['field'](_0xb3ed('0xb5'),_0xb3ed('0x2b'));}if(_0x50a509[_0xb3ed('0x43')])_0x1e0fdd[_0xb3ed('0x43')](_0x50a509['limit']);if(_0x50a509['offset'])_0x1e0fdd['offset'](_0x50a509[_0xb3ed('0x44')]);return db['sequelize'][_0xb3ed('0x3c')](_0x1e0fdd['toString'](),_0x4b333a);})['then'](function(_0x266295){_0x903f4d[_0xb3ed('0x47')](_0xb3ed('0xb6'),_[_0xb3ed('0x2a')](_0x266295,'id'));return db['sequelize'][_0xb3ed('0x3c')](_0x903f4d[_0xb3ed('0x98')](),_0x4b333a)[_0xb3ed('0x32')](function(_0xc5b8ea){var _0x44c66f=_[_0xb3ed('0xb7')](_0xc5b8ea,'MailInteractionId');var _0x3b9ce7=[];return db[_0xb3ed('0xb8')][_0xb3ed('0x2f')]({'attributes':[_0xb3ed('0xb9')],'raw':!![]})[_0xb3ed('0x32')](function(_0x3746ab){var _0xc4b611=_0x3746ab[_0xb3ed('0xb9')];_0x266295[_0xb3ed('0x2e')](function(_0xa4fd93){_0x3b9ce7[_0xb3ed('0xba')](updateMailInteraction(_0xa4fd93,_0xcf646e,_0x44c66f,_0xc4b611));});return BPromise[_0xb3ed('0xbb')](_0x3b9ce7);});});});})[_0xb3ed('0x32')](function(_0x49de50){_0x3b2d61[_0xb3ed('0xbc')]=_0x49de50;return _0x3b2d61;})[_0xb3ed('0x32')](respondWithFilteredResult(_0x2f06c0,_0x50a509))[_0xb3ed('0x35')](handleError(_0x2f06c0,null));};exports[_0xb3ed('0xbd')]=function(_0x3ea2cd,_0x5d56b7){var _0x14bbb4={'raw':![],'where':{'id':_0x3ea2cd[_0xb3ed('0xbe')]['id']}},_0x405aef={};_0x405aef['model']=_[_0xb3ed('0xbf')](db[_0xb3ed('0x36')][_0xb3ed('0x37')]);_0x405aef[_0xb3ed('0x3c')]=_['keys'](_0x3ea2cd[_0xb3ed('0x3c')]);_0x405aef['filters']=_[_0xb3ed('0x3e')](_0x405aef[_0xb3ed('0x3b')],_0x405aef[_0xb3ed('0x3c')]);_0x14bbb4[_0xb3ed('0x40')]=_[_0xb3ed('0x3e')](_0x405aef[_0xb3ed('0x3b')],qs[_0xb3ed('0x3f')](_0x3ea2cd[_0xb3ed('0x3c')][_0xb3ed('0x3f')]));_0x14bbb4[_0xb3ed('0x40')]=_0x14bbb4[_0xb3ed('0x40')]['length']?_0x14bbb4[_0xb3ed('0x40')]:_0x405aef[_0xb3ed('0x3b')];if(_0x3ea2cd[_0xb3ed('0x3c')]['includeAll']){_0x14bbb4[_0xb3ed('0xc0')]=[{'all':!![]}];}_0x14bbb4=_['merge']({},_0x14bbb4,_0x3ea2cd[_0xb3ed('0xc1')]);return db[_0xb3ed('0x36')]['find'](_0x14bbb4)[_0xb3ed('0x32')](handleEntityNotFound(_0x5d56b7,null))[_0xb3ed('0x32')](respondWithResult(_0x5d56b7,null))[_0xb3ed('0x35')](handleError(_0x5d56b7,null));};exports[_0xb3ed('0xc2')]=function(_0x591c25,_0x563219){return db[_0xb3ed('0x36')]['create'](_0x591c25['body'],{})[_0xb3ed('0x32')](respondWithResult(_0x563219,0xc9))[_0xb3ed('0x35')](handleError(_0x563219,null));};exports['update']=function(_0x4ff0eb,_0x53fade){if(_0x4ff0eb[_0xb3ed('0xc3')]['id']){delete _0x4ff0eb[_0xb3ed('0xc3')]['id'];}return db[_0xb3ed('0x36')][_0xb3ed('0x69')]({'where':{'id':_0x4ff0eb[_0xb3ed('0xbe')]['id']}})[_0xb3ed('0x32')](handleEntityNotFound(_0x53fade,null))[_0xb3ed('0x32')](saveUpdates(_0x4ff0eb[_0xb3ed('0xc3')],null))[_0xb3ed('0x32')](respondWithResult(_0x53fade,null))[_0xb3ed('0x35')](handleError(_0x53fade,null));};exports[_0xb3ed('0x25')]=function(_0x34d859,_0x51f1be){return db['MailInteraction'][_0xb3ed('0x69')]({'where':{'id':_0x34d859[_0xb3ed('0xbe')]['id']}})['then'](handleEntityNotFound(_0x51f1be,null))[_0xb3ed('0x32')](removeEntity(_0x51f1be,null))[_0xb3ed('0x35')](handleError(_0x51f1be,null));};exports[_0xb3ed('0xc4')]=function(_0xfd149,_0x24b1cc){return db[_0xb3ed('0x36')][_0xb3ed('0xc4')]()['then'](respondWithResult(_0x24b1cc,null))['catch'](handleError(_0x24b1cc,null));};exports[_0xb3ed('0xc5')]=function(_0x5ad979,_0x14cdff,_0xad5754){return db[_0xb3ed('0xc6')][_0xb3ed('0x69')]({'where':{'id':_0x5ad979['params']['id']}})[_0xb3ed('0x32')](handleEntityNotFound(_0x14cdff,null))[_0xb3ed('0x32')](function(_0x27ef27){if(_0x27ef27){return _0x27ef27['addMessage'](_0x5ad979[_0xb3ed('0xc3')][_0xb3ed('0xc7')],_['omit'](_0x5ad979[_0xb3ed('0xc3')],[_0xb3ed('0xc7'),'id'])||{});}})[_0xb3ed('0x32')](respondWithResult(_0x14cdff,null))[_0xb3ed('0x35')](handleError(_0x14cdff,null));};exports[_0xb3ed('0xc8')]=function(_0x5ad9ec,_0x45b090,_0x2e4d3a){var _0x59a573={'raw':![],'where':{}};var _0x3cd65b={};var _0x384158={'count':0x0,'rows':[]};return db[_0xb3ed('0x36')][_0xb3ed('0x2f')]({'where':{'id':_0x5ad9ec[_0xb3ed('0xbe')]['id']}})[_0xb3ed('0x32')](handleEntityNotFound(_0x45b090,null))[_0xb3ed('0x32')](function(_0xf6d94d){if(_0xf6d94d){_0x3cd65b[_0xb3ed('0x3b')]=_[_0xb3ed('0xbf')](db[_0xb3ed('0xc6')][_0xb3ed('0x37')]);_0x3cd65b['query']=_[_0xb3ed('0xbf')](_0x5ad9ec[_0xb3ed('0x3c')]);_0x3cd65b[_0xb3ed('0x3d')]=_[_0xb3ed('0x3e')](_0x3cd65b[_0xb3ed('0x3b')],_0x3cd65b[_0xb3ed('0x3c')]);_0x59a573['attributes']=_[_0xb3ed('0x3e')](_0x3cd65b[_0xb3ed('0x3b')],qs[_0xb3ed('0x3f')](_0x5ad9ec[_0xb3ed('0x3c')][_0xb3ed('0x3f')]));_0x59a573[_0xb3ed('0x40')]=_0x59a573[_0xb3ed('0x40')][_0xb3ed('0x41')]?_0x59a573[_0xb3ed('0x40')]:_0x3cd65b[_0xb3ed('0x3b')];if(!_0x5ad9ec[_0xb3ed('0x3c')][_0xb3ed('0xc9')](_0xb3ed('0x42'))){_0x59a573[_0xb3ed('0x43')]=qs[_0xb3ed('0x43')](_0x5ad9ec[_0xb3ed('0x3c')]['limit']);_0x59a573[_0xb3ed('0x44')]=qs['offset'](_0x5ad9ec[_0xb3ed('0x3c')][_0xb3ed('0x44')]);}_0x59a573[_0xb3ed('0x45')]=qs[_0xb3ed('0x46')](_0x5ad9ec[_0xb3ed('0x3c')][_0xb3ed('0x46')]);_0x59a573[_0xb3ed('0x47')]=qs[_0xb3ed('0x3d')](_[_0xb3ed('0x48')](_0x5ad9ec[_0xb3ed('0x3c')],_0x3cd65b[_0xb3ed('0x3d')]));_0x59a573[_0xb3ed('0x47')][_0xb3ed('0xca')]=_0xf6d94d['id'];if(_0x5ad9ec[_0xb3ed('0x3c')][_0xb3ed('0x81')]){_0x59a573[_0xb3ed('0x47')]=_[_0xb3ed('0xcb')](_0x59a573[_0xb3ed('0x47')],{'$or':_['map'](_0x59a573[_0xb3ed('0x40')],function(_0x43259c){var _0x7b060a={};_0x7b060a[_0x43259c]={'$like':'%'+_0x5ad9ec[_0xb3ed('0x3c')][_0xb3ed('0x81')]+'%'};return _0x7b060a;})});}if(_0x5ad9ec[_0xb3ed('0x3c')]['$gte']){var _0xc94f59=_0x5ad9ec[_0xb3ed('0x3c')][_0xb3ed('0x79')]['split'](',');var _0x332961={};_0x332961[_0xc94f59[0x0]]={'$gte':moment(_0xc94f59[0x1])[_0xb3ed('0xcc')](_0xb3ed('0xcd'))};_0x59a573[_0xb3ed('0x47')]=_[_0xb3ed('0xcb')](_0x59a573[_0xb3ed('0x47')],_0x332961);}_0x59a573=_[_0xb3ed('0xcb')]({},_0x59a573,_0x5ad9ec[_0xb3ed('0xc1')]);return db[_0xb3ed('0xc6')][_0xb3ed('0x1f')]({'where':_0x59a573[_0xb3ed('0x47')]})[_0xb3ed('0x32')](function(_0x5839e9){_0x384158[_0xb3ed('0x1f')]=_0x5839e9;if(_0x5ad9ec[_0xb3ed('0x3c')][_0xb3ed('0xce')]){_0x59a573[_0xb3ed('0xc0')]=[{'all':!![]}];}return db[_0xb3ed('0xc6')][_0xb3ed('0xcf')](_0x59a573);})[_0xb3ed('0x32')](function(_0x31f297){if(_0x5ad9ec[_0xb3ed('0x3c')][_0xb3ed('0xd0')]===_0xb3ed('0xd1')){for(var _0x26e801=0x0;_0x26e801<_0x31f297[_0xb3ed('0x41')];_0x26e801++){_0x31f297[_0x26e801][_0xb3ed('0xc3')]=juice(_0x31f297[_0x26e801][_0xb3ed('0xc3')]);}}_0x384158['rows']=_0x31f297;return _0x384158;});}})['then'](respondWithFilteredResult(_0x45b090,_0x59a573))[_0xb3ed('0x35')](handleError(_0x45b090,null));};exports[_0xb3ed('0xd2')]=function(_0x578c95,_0x19ba07,_0x32ccac){return db[_0xb3ed('0x36')]['find']({'where':{'id':_0x578c95[_0xb3ed('0xbe')]['id']}})[_0xb3ed('0x32')](handleEntityNotFound(_0x19ba07,null))['then'](function(_0x36b04b){if(_0x36b04b){return _0x36b04b['setTags'](_0x578c95[_0xb3ed('0xc3')][_0xb3ed('0xc7')],_['omit'](_0x578c95[_0xb3ed('0xc3')],[_0xb3ed('0xc7'),'id'])||{})[_0xb3ed('0xd3')](function(){return db[_0xb3ed('0xd4')][_0xb3ed('0xcf')]({'attributes':['id',_0xb3ed('0x27'),_0xb3ed('0x4a')],'where':{'id':_0x578c95['body'][_0xb3ed('0xc7')]}});})['then'](function(_0x28c6d5){socket[_0xb3ed('0xd5')](_0xb3ed('0xd6'),{'id':Number(_0x578c95['params']['id']),'tags':_0x28c6d5||[]});return{'id':Number(_0x578c95[_0xb3ed('0xbe')]['id']),'tags':_0x28c6d5||[]};});}})[_0xb3ed('0x32')](respondWithResult(_0x19ba07,null))[_0xb3ed('0x35')](handleError(_0x19ba07,null));};exports[_0xb3ed('0xd7')]=function(_0x5ac29b,_0x2645cd,_0x2d60a9){return db[_0xb3ed('0x36')][_0xb3ed('0x69')]({'where':{'id':_0x5ac29b[_0xb3ed('0xbe')]['id']}})[_0xb3ed('0x32')](handleEntityNotFound(_0x2645cd,null))[_0xb3ed('0x32')](function(_0x3896d6){if(_0x3896d6){return _0x3896d6[_0xb3ed('0xd7')](_0x5ac29b[_0xb3ed('0x3c')]['ids']);}})[_0xb3ed('0x32')](respondWithStatusCode(_0x2645cd,null))['catch'](handleError(_0x2645cd,null));};exports[_0xb3ed('0xd8')]=function(_0x556dea,_0x1683bf){var _0x5dac81=moment()['unix']()['toString']();var _0x40e446=path[_0xb3ed('0xd9')](config[_0xb3ed('0xda')],_0xb3ed('0xdb'),_0xb3ed('0xdc'),'tmp');var _0x3f9f0b=path['join'](config[_0xb3ed('0xda')],_0xb3ed('0xdb'),_0xb3ed('0xdc'),'attachments');var _0x47dadf=path['join'](_0x40e446,_0x5dac81);var _0x4d2aee=util['format'](_0xb3ed('0xdd'),_0x556dea[_0xb3ed('0xbe')]['id'],_0x5dac81);var _0x23cef7=path[_0xb3ed('0xd9')](_0x40e446,_0x4d2aee);var _0x114850=[];if(_0x556dea[_0xb3ed('0x3c')][_0xb3ed('0xde')]){_0x114850[_0xb3ed('0xba')]({'model':db[_0xb3ed('0xdf')],'as':_0xb3ed('0xe0'),'raw':!![]});}var _0x584b77=[{'model':db[_0xb3ed('0xc6')],'as':'Messages','attributes':['id',_0xb3ed('0xc3'),_0xb3ed('0x4b'),'to','cc',_0xb3ed('0xe1'),_0xb3ed('0xe2'),_0xb3ed('0x77')],'where':{'secret':![]},'order':qs[_0xb3ed('0x46')]('id'),'include':_0x114850}];return db[_0xb3ed('0x36')][_0xb3ed('0x69')]({'where':{'id':_0x556dea['params']['id']},'include':_0x584b77})['then'](handleEntityNotFound(_0x1683bf,null))[_0xb3ed('0x32')](function(_0x3203d5){if(_0x3203d5&&_0x3203d5[_0xb3ed('0xe3')]){var _0x3c0378=_0x3203d5['get']({'plain':!![]});fs['mkdirSync'](_0x47dadf);return BPromise[_0xb3ed('0xe4')](_0x3c0378['Messages'],function(_0x4f7898,_0x1e65be){var _0x59a183={'from':_0x4f7898[_0xb3ed('0x4b')],'to':_0x4f7898['to'],'subject':_0x4f7898['subject'],'html':_0x4f7898[_0xb3ed('0xc3')],'headers':{'Date':moment(_0x4f7898[_0xb3ed('0x77')])['format'](_0xb3ed('0xe5'))},'attachments':[]};if(_0x4f7898['cc']){_0x59a183[_0xb3ed('0xe6')]['Cc']=_0x4f7898['cc'];}if(_0x4f7898[_0xb3ed('0xe1')]){_0x59a183[_0xb3ed('0xe6')][_0xb3ed('0xe7')]=_0x4f7898[_0xb3ed('0xe1')];}return new BPromise(function(_0x58367f,_0x35ca10){if(_0x4f7898[_0xb3ed('0xe0')]){for(var _0x4759eb=0x0;_0x4759eb<_0x4f7898[_0xb3ed('0xe0')][_0xb3ed('0x41')];_0x4759eb++){var _0x2f50f5=_0x4f7898['Attachments'][_0x4759eb];var _0x284af3=path[_0xb3ed('0xd9')](_0x3f9f0b,_0x2f50f5[_0xb3ed('0xe8')]);if(fs[_0xb3ed('0xe9')](_0x284af3)){_0x59a183['attachments']['push']({'name':_0x2f50f5['name'],'contentType':_0x2f50f5[_0xb3ed('0x39')],'data':fs[_0xb3ed('0xea')](_0x284af3)});}}}emlformat[_0xb3ed('0xeb')](_0x59a183,function(_0x443ca8,_0x3709f2){if(_0x443ca8)return _0x35ca10(_0x443ca8);fs[_0xb3ed('0xec')](path[_0xb3ed('0xd9')](_0x47dadf,util['format'](_0xb3ed('0xed'),_0x1e65be)),_0x3709f2);return _0x58367f(_0x3709f2);});});})[_0xb3ed('0x32')](function(){return new BPromise(function(_0x4c73e6,_0x2a9b22){zipdir(_0x47dadf,{'saveTo':_0x23cef7},function(_0x5da326,_0x3a2487){if(_0x5da326)return _0x2a9b22(_0x5da326);return _0x4c73e6(_0x3a2487);});})['then'](function(){return new BPromise(function(_0x154023,_0x15dcdb){rimraf(_0x47dadf,function(_0x32e3b9){if(_0x32e3b9)_0x15dcdb(_0x32e3b9);return _0x154023();});});})['then'](function(){return _0x1683bf['download'](_0x23cef7,_0x4d2aee,function(_0x6bd00a){if(_0x6bd00a){console['log'](_0xb3ed('0xee'),_0x6bd00a);}else{fs[_0xb3ed('0xef')](_0x23cef7);}});});});}else{return _0x1683bf[_0xb3ed('0x1b')](0xc8);}})[_0xb3ed('0x35')](handleError(_0x1683bf,null));}; \ No newline at end of file +var _0x901a=['i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.closed','i.attach','i.lastMsgDirection','i.subject','i.substatus','i.to','i.ContactId','i.MailAccountId','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','MailInteractionId','Setting','enableEmailPreview','all','show','params','include','create','body','addMessage','ids','omit','getMessages','hasOwnProperty','sort','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','headers','Bcc','existsSync','readFileSync','writeFileSync','message%d.eml','err','unlinkSync','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','html-to-text','juice','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','localhost','socket.io-emitter','redis','./mailInteraction.socket','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','error','name','map','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','select','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','mail_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','MailAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','isEmail','c.email\x20LIKE\x20?','getFullTextValue','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve'];(function(_0x4edc53,_0x861490){var _0x4b380a=function(_0x29a0e1){while(--_0x29a0e1){_0x4edc53['push'](_0x4edc53['shift']());}};_0x4b380a(++_0x861490);}(_0x901a,0x13c));var _0xa901=function(_0x15bb52,_0x32361d){_0x15bb52=_0x15bb52-0x0;var _0x1e926f=_0x901a[_0x15bb52];return _0x1e926f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa901('0x0'));var Mustache=require(_0xa901('0x1'));var util=require('util');var path=require(_0xa901('0x2'));var sox=require(_0xa901('0x3'));var csv=require('to-csv');var ejs=require(_0xa901('0x4'));var fs=require('fs');var fs_extra=require(_0xa901('0x5'));var _=require(_0xa901('0x6'));var squel=require('squel');var crypto=require(_0xa901('0x7'));var jsforce=require(_0xa901('0x8'));var deskjs=require(_0xa901('0x9'));var toCsv=require(_0xa901('0xa'));var querystring=require(_0xa901('0xb'));var Papa=require('papaparse');var htmlToText=require(_0xa901('0xc'));var juice=require(_0xa901('0xd'));var Redis=require(_0xa901('0xe'));var authService=require(_0xa901('0xf'));var qs=require(_0xa901('0x10'));var as=require(_0xa901('0x11'));var hardwareService=require(_0xa901('0x12'));var logger=require(_0xa901('0x13'))(_0xa901('0x14'));var utils=require(_0xa901('0x15'));var config=require(_0xa901('0x16'));var licenseUtil=require(_0xa901('0x17'));var db=require(_0xa901('0x18'))['db'];config['redis']=_[_0xa901('0x19')](config['redis'],{'host':_0xa901('0x1a'),'port':0x18eb});var socket=require(_0xa901('0x1b'))(new Redis(config[_0xa901('0x1c')]));require(_0xa901('0x1d'))['register'](socket);function respondWithStatusCode(_0x280a6b,_0x15ad2c){_0x15ad2c=_0x15ad2c||0xcc;return function(_0xfb40ee){if(_0xfb40ee){return _0x280a6b[_0xa901('0x1e')](_0x15ad2c);}return _0x280a6b[_0xa901('0x1f')](_0x15ad2c)[_0xa901('0x20')]();};}function respondWithResult(_0x5ad74,_0x4d219a){_0x4d219a=_0x4d219a||0xc8;return function(_0xd14957){if(_0xd14957){return _0x5ad74[_0xa901('0x1f')](_0x4d219a)[_0xa901('0x21')](_0xd14957);}};}function respondWithFilteredResult(_0x29e0b6,_0x5ae543){return function(_0x1b6b94){if(_0x1b6b94){var _0x5cee64=_0x1b6b94[_0xa901('0x22')],_0x18eb3a=_0x5ae543[_0xa901('0x23')],_0x2548e1=_0x5ae543[_0xa901('0x23')]+_0x5ae543[_0xa901('0x24')],_0x378ed1;if(_0x2548e1>=_0x5cee64){_0x2548e1=_0x5cee64;_0x378ed1=0xc8;}else{_0x378ed1=0xce;}_0x29e0b6['status'](_0x378ed1);return _0x29e0b6[_0xa901('0x25')]('Content-Range',_0x18eb3a+'-'+_0x2548e1+'/'+_0x5cee64)[_0xa901('0x21')](_0x1b6b94);}return null;};}function patchUpdates(_0x44de4b){return function(_0x87af36){try{jsonpatch['apply'](_0x87af36,_0x44de4b,!![]);}catch(_0xd48df4){return BPromise[_0xa901('0x26')](_0xd48df4);}return _0x87af36[_0xa901('0x27')]();};}function saveUpdates(_0x28642b,_0x29c497){return function(_0x1e5212){if(_0x1e5212){return _0x1e5212[_0xa901('0x28')](_0x28642b)[_0xa901('0x29')](function(_0x34770f){return _0x34770f;});}return null;};}function removeEntity(_0x11cfa4,_0x19c56b){return function(_0x32528b){if(_0x32528b){return _0x32528b[_0xa901('0x2a')]()[_0xa901('0x29')](function(){_0x11cfa4[_0xa901('0x1f')](0xcc)[_0xa901('0x20')]();});}};}function handleEntityNotFound(_0x30af46,_0x48781a){return function(_0x1d3ad2){if(!_0x1d3ad2){_0x30af46['sendStatus'](0x194);}return _0x1d3ad2;};}function handleError(_0x461419,_0x52670b){_0x52670b=_0x52670b||0x1f4;return function(_0x43b4a8){logger[_0xa901('0x2b')](_0x43b4a8['stack']);if(_0x43b4a8[_0xa901('0x2c')]){delete _0x43b4a8[_0xa901('0x2c')];}_0x461419[_0xa901('0x1f')](_0x52670b)['send'](_0x43b4a8);};}function getInteractionUsers(_0x490e86,_0x5bf761){return new BPromise(function(_0x3972bc,_0x34a427){try{if(_0x5bf761[_0x490e86['id']]){_0x490e86['Users']=_[_0xa901('0x2d')](_0x5bf761[_0x490e86['id']],function(_0x19586f){return{'id':_0x19586f['id'],'fullname':_0x19586f['fullname']};});}}catch(_0x38c59e){_0x34a427(_0x38c59e);}_0x3972bc(_0x490e86);});}function getInteractionTags(_0x3f51f5,_0x2f8678){return new BPromise(function(_0xe61f19,_0x7b59a9){try{if(_0x3f51f5[_0xa901('0x2e')]){_0x3f51f5[_0xa901('0x2f')]=[];_0x3f51f5[_0xa901('0x2e')][_0xa901('0x30')](',')[_0xa901('0x31')](function(_0x356926){_0x3f51f5[_0xa901('0x2f')][_0xa901('0x32')](_0x2f8678[_0x356926]);});}delete _0x3f51f5[_0xa901('0x2e')];}catch(_0x17834e){_0x7b59a9(_0x17834e);}_0xe61f19(_0x3f51f5);});}function getLastMessageText(_0xcc50c8){return new BPromise(function(_0x283ec7,_0x16e9bb){return db[_0xa901('0x33')][_0xa901('0x34')]({'where':{'$and':[{'MailInteractionId':_0xcc50c8['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xa901('0x35')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xa901('0x36')],'order':'-id','raw':!![]})[_0xa901('0x29')](function(_0x586cca){if(_0x586cca&&_0x586cca[_0xa901('0x36')]){_0xcc50c8[_0xa901('0x37')]=_[_0xa901('0x38')](_0x586cca[_0xa901('0x36')]);}_0x283ec7(_0xcc50c8);})['catch'](function(_0x15e6a5){_0x16e9bb(_0x15e6a5);});});}function updateMailInteraction(_0x57cebe,_0x247f33,_0x4c8bea,_0xf92d9c){return new BPromise(function(_0x3dc5a1,_0x3ec94b){return getInteractionUsers(_0x57cebe,_0x4c8bea)[_0xa901('0x29')](function(_0x5acd24){return getInteractionTags(_0x5acd24,_0x247f33);})[_0xa901('0x29')](function(_0x1ee64f){if(_0xf92d9c){_0x3dc5a1(getLastMessageText(_0x1ee64f));}else{_0x3dc5a1(_0x1ee64f);}})[_0xa901('0x39')](function(_0x3f9e57){_0x3ec94b(_0x3f9e57);});});}exports[_0xa901('0x3a')]=function(_0x290c7b,_0x4fd857){var _0x14c381={},_0xdcf4c6={},_0x1b8430={'count':0x0,'rows':[]};var _0x30880a=_[_0xa901('0x2d')](db[_0xa901('0x3b')][_0xa901('0x3c')],function(_0xfaebac){return{'name':_0xfaebac['fieldName'],'type':_0xfaebac[_0xa901('0x3d')][_0xa901('0x3e')]};});_0xdcf4c6[_0xa901('0x3f')]=_[_0xa901('0x2d')](_0x30880a,_0xa901('0x2c'));_0xdcf4c6[_0xa901('0x40')]=_[_0xa901('0x41')](_0x290c7b[_0xa901('0x40')]);_0xdcf4c6[_0xa901('0x42')]=_[_0xa901('0x43')](_0xdcf4c6[_0xa901('0x3f')],_0xdcf4c6[_0xa901('0x40')]);_0x14c381[_0xa901('0x44')]=_['intersection'](_0xdcf4c6[_0xa901('0x3f')],qs[_0xa901('0x45')](_0x290c7b['query']['fields']));_0x14c381[_0xa901('0x44')]=_0x14c381['attributes'][_0xa901('0x46')]?_0x14c381[_0xa901('0x44')]:_0xdcf4c6[_0xa901('0x3f')];if(!_0x290c7b[_0xa901('0x40')]['hasOwnProperty'](_0xa901('0x47'))){_0x14c381[_0xa901('0x24')]=qs[_0xa901('0x24')](_0x290c7b[_0xa901('0x40')]['limit']);_0x14c381[_0xa901('0x23')]=qs[_0xa901('0x23')](_0x290c7b['query'][_0xa901('0x23')]);}_0x14c381[_0xa901('0x48')]=qs['sort'](_0x290c7b[_0xa901('0x40')]['sort']);_0x14c381[_0xa901('0x49')]=qs[_0xa901('0x42')](_[_0xa901('0x4a')](_0x290c7b[_0xa901('0x40')],_0xdcf4c6[_0xa901('0x42')]),_0x30880a);var _0x51f412=[];var _0x41c4d3=squel[_0xa901('0x4b')]()[_0xa901('0x4c')]('id')[_0xa901('0x4c')](_0xa901('0x2c'))[_0xa901('0x4c')](_0xa901('0x4d'))['from'](_0xa901('0x4e'));var _0x53d6cf=squel[_0xa901('0x4b')]()['field'](_0xa901('0x4f'))['field']('u.fullname')[_0xa901('0x4c')](_0xa901('0x50'))[_0xa901('0x51')](_0xa901('0x52'),'ui')[_0xa901('0x53')](_0xa901('0x54'),'u','u.id\x20=\x20ui.UserId');var _0x58f5f9=squel['select']()[_0xa901('0x51')](_0xa901('0x55'),'i')[_0xa901('0x53')](_0xa901('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xa901('0x54'),'o',_0xa901('0x57'))[_0xa901('0x53')]('mail_accounts','a',_0xa901('0x58'))['left_join']('mail_messages','me',_0xa901('0x59'))[_0xa901('0x53')](_0xa901('0x5a'),'it',_0xa901('0x5b'))[_0xa901('0x53')](_0xa901('0x4e'),'t',_0xa901('0x5c'));var _0x306d62=squel[_0xa901('0x5d')]();var _0x3dc543=[];var _0x36843e=squel[_0xa901('0x5d')]();var _0x1cdd53;if(_0x290c7b[_0xa901('0x40')][_0xa901('0x5e')]){_0x1cdd53=as[_0xa901('0x5f')](_0x290c7b[_0xa901('0x40')]['search']);var _0x5d914e=_0x1cdd53['sqlOperator'];for(var _0x22b1a9=0x0;_0x22b1a9<_0x1cdd53[_0xa901('0x60')][_0xa901('0x46')];_0x22b1a9++){var _0x92800b=_0x1cdd53[_0xa901('0x60')][_0x22b1a9];var _0x45c00d='i';var _0x3c48d7=_[_0xa901('0x61')](_0x30880a,[_0xa901('0x2c'),_0x92800b[_0xa901('0x4c')]]);if(!_0x3c48d7){switch(_0x92800b['field']){case _0xa901('0x62'):if(_0x92800b[_0xa901('0x63')]==0x1){_0x58f5f9[_0xa901('0x64')]('`'+_0x92800b[_0xa901('0x4c')]+_0xa901('0x65'));}else{_0x58f5f9[_0xa901('0x64')]('`'+_0x92800b[_0xa901('0x4c')]+_0xa901('0x66'));}break;case'Contact':if(_0x92800b[_0xa901('0x67')]===_0xa901('0x68')){if(_0x92800b['value'][_0xa901('0x30')]('\x20')[_0xa901('0x46')]>0x1){_0x306d62[_0x5d914e](_0xa901('0x69'),qs['getFullTextValue'](_0x92800b[_0xa901('0x63')]),null);}else{var _0x5b58d8='%'+_0x92800b['value']+'%';_0x306d62[_0x5d914e](_0xa901('0x6a'),_0x5b58d8,_0x5b58d8,_0x5b58d8);}}else{_0x3c48d7=_['find'](_0x30880a,[_0xa901('0x2c'),_0xa901('0x6b')]);_0x92800b[_0xa901('0x4c')]=_0xa901('0x6b');_0x4c9f2f=as[_0xa901('0x6c')](_0x45c00d,_0x3c48d7['type'],_0x92800b);_0x306d62[_0x5d914e](_0x4c9f2f[_0xa901('0x6d')],_0x4c9f2f['value']['start'],_0x4c9f2f[_0xa901('0x63')][_0xa901('0x20')]);}break;case _0xa901('0x6e'):var _0x3e2a87=_0x92800b[_0xa901('0x63')][_0xa901('0x30')](',')[_0xa901('0x2d')](function(_0x36e3c5){return Number(_0x36e3c5);});_0x3e2a87[_0xa901('0x31')](function(_0x4c948f){_0x36843e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4c948f+',%');});_0x3dc543=_[_0xa901('0x6f')](_0x3dc543,_0x3e2a87);break;case _0xa901('0x70'):if(_0x92800b[_0xa901('0x67')]===_0xa901('0x68')){_0x306d62[_0x5d914e](_0xa901('0x71'),'%'+_0x92800b[_0xa901('0x63')]+'%',null);}else{_0x3c48d7=_[_0xa901('0x61')](_0x30880a,[_0xa901('0x2c'),_0xa901('0x72')]);_0x92800b[_0xa901('0x4c')]=_0xa901('0x72');_0x4c9f2f=as[_0xa901('0x6c')](_0x45c00d,_0x3c48d7['type'],_0x92800b);_0x306d62[_0x5d914e](_0x4c9f2f['text'],_0x4c9f2f[_0xa901('0x63')][_0xa901('0x73')],_0x4c9f2f['value'][_0xa901('0x20')]);}break;case _0xa901('0x36'):_0x4c9f2f=as[_0xa901('0x6c')]('me',null,_0x92800b);_0x306d62[_0x5d914e](_0x4c9f2f['text'],_0x4c9f2f[_0xa901('0x63')][_0xa901('0x73')],_0x4c9f2f['value'][_0xa901('0x20')]);break;}}else{var _0x4c9f2f=as[_0xa901('0x6c')](_0x45c00d,_0x3c48d7[_0xa901('0x3d')],_0x92800b);_0x306d62[_0x5d914e](_0x4c9f2f[_0xa901('0x6d')],_0x4c9f2f['value']['start'],_0x4c9f2f[_0xa901('0x63')][_0xa901('0x20')]);}}}else{var _0x1b9f66=_(_0x290c7b['query'])[_0xa901('0x41')]()[_0xa901('0x2d')](function(_0x574c8c){return _['some'](_0x30880a,[_0xa901('0x2c'),_0x574c8c])?_0x574c8c:undefined;})[_0xa901('0x74')]()[_0xa901('0x63')]();if(!_['isEmpty'](_0x1b9f66)){_0x1b9f66[_0xa901('0x31')](function(_0x23e0cd){if(_0x23e0cd===_0xa901('0x75')){_0x58f5f9[_0xa901('0x49')]('i.MailAccountId\x20IN\x20?',[]['concat'](_0x290c7b['query'][_0x23e0cd]));}else if(_0x23e0cd===_0xa901('0x76')){var _0x1a0118=JSON[_0xa901('0x77')](_0x290c7b[_0xa901('0x40')][_0x23e0cd])[_0xa901('0x78')];var _0x1cf2f5=JSON[_0xa901('0x77')](_0x290c7b[_0xa901('0x40')][_0x23e0cd])[_0xa901('0x79')];_0x58f5f9[_0xa901('0x49')](_0xa901('0x7a'),_0x1a0118,_0x1cf2f5);}else{if(_0x290c7b[_0xa901('0x40')][_0x23e0cd]===_0xa901('0x7b')){_0x58f5f9[_0xa901('0x49')]('i.'+_0x23e0cd+'\x20IS\x20NULL');}else{_0x58f5f9[_0xa901('0x49')]('i.'+_0x23e0cd+_0xa901('0x7c'),_0x290c7b[_0xa901('0x40')][_0x23e0cd]);}}});}if(_0x290c7b['query'][_0xa901('0x7d')]){if(_0x290c7b[_0xa901('0x40')][_0xa901('0x7d')]==0x1){_0x58f5f9[_0xa901('0x64')](_0xa901('0x7e'));}else{_0x58f5f9[_0xa901('0x64')](_0xa901('0x7f'));}}if(_0x290c7b[_0xa901('0x40')][_0xa901('0x80')]){_0x3dc543=_['isArray'](_0x290c7b['query'][_0xa901('0x80')])?_0x290c7b['query'][_0xa901('0x80')]:new Array(_0x290c7b[_0xa901('0x40')]['tag']);_0x3dc543[_0xa901('0x31')](function(_0xb6792d){_0x36843e['or'](_0xa901('0x81'),'%,'+_0xb6792d+',%');});}if(_0x290c7b[_0xa901('0x40')][_0xa901('0x82')]){var _0x16eb64=_0x290c7b[_0xa901('0x40')]['filter'][_0xa901('0x83')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xa901('0x84')](_0x16eb64)){_0x306d62['or']('i.id\x20LIKE\x20?',_0x16eb64+'%');}else if(qs[_0xa901('0x85')](_0x16eb64)){_0x306d62['or'](_0xa901('0x86'),_0x16eb64+'%');}else{_0x306d62['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x16eb64))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa901('0x87')](_0x16eb64));}}}_0x58f5f9['where'](_0x306d62);_0x58f5f9['group'](_0xa901('0x88'));var _0xbb80e5={'type':db[_0xa901('0x89')]['QueryTypes'][_0xa901('0x8a')],'raw':!![]};var _0x3f4758=_0x58f5f9[_0xa901('0x8b')]();_0x3f4758[_0xa901('0x4c')](_0xa901('0x88'));_0x3f4758[_0xa901('0x4c')](_0xa901('0x8c'),_0xa901('0x62'));if(_0x14c381[_0xa901('0x48')]){_0x14c381[_0xa901('0x48')][_0xa901('0x31')](function(_0x2ef0ee){var _0x2c00a2=_0x2ef0ee[0x0]===_0xa901('0x8d')?_0x2ef0ee[0x0]:'i.'+_0x2ef0ee[0x0];_0x58f5f9[_0xa901('0x48')](_0x2c00a2,_0x2ef0ee[0x1]===_0xa901('0x8e')?![]:!![]);});}if(!_[_0xa901('0x8f')](_0x3dc543)){_0x58f5f9['having'](_0x36843e);_0x3f4758[_0xa901('0x49')](_0xa901('0x90'),_0x3dc543);}BPromise[_0xa901('0x91')]()[_0xa901('0x29')](function(){if(!_0x1cdd53){if(_0x290c7b[_0xa901('0x40')][_0xa901('0x75')])return;_0x3f4758[_0xa901('0x49')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x58f5f9[_0xa901('0x49')](_0xa901('0x92'));return;}if(_0x290c7b[_0xa901('0x93')][_0xa901('0x94')]!==_0xa901('0x95'))return;return _0x290c7b[_0xa901('0x93')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xa901('0x29')](function(_0x35db1f){if(_['isEmpty'](_0x35db1f)){_0x3f4758['where'](_0xa901('0x96'));_0x58f5f9['where'](_0xa901('0x96'));}else{_0x3f4758[_0xa901('0x49')]('i.MailAccountId\x20IN\x20?',_[_0xa901('0x2d')](_0x35db1f,'id'));_0x58f5f9[_0xa901('0x49')]('i.MailAccountId\x20IN\x20?',_[_0xa901('0x2d')](_0x35db1f,'id'));}});})[_0xa901('0x29')](function(){if(_0x290c7b[_0xa901('0x93')]['role']===_0xa901('0x95')&&!_0x1cdd53&&!_0x290c7b[_0xa901('0x40')][_0xa901('0x75')])return[];return db[_0xa901('0x97')]['query'](_0x3f4758['toString'](),_0xbb80e5);})['then'](function(_0x15680d){_0x1b8430['count']=_0x15680d[_0xa901('0x46')];if(_0x1b8430['count']===0x0)return[];return db[_0xa901('0x97')][_0xa901('0x40')](_0x41c4d3[_0xa901('0x98')](),_0xbb80e5)[_0xa901('0x29')](function(_0x3a39dc){_0x51f412=_['keyBy'](_0x3a39dc,'id');_0xbb80e5=_[_0xa901('0x99')](_0xbb80e5,{'model':db[_0xa901('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x290c7b[_0xa901('0x40')]['fields']){_0x14c381[_0xa901('0x44')][_0xa901('0x31')](function(_0x5b70e9){_0x58f5f9[_0xa901('0x4c')]('i.'+_0x5b70e9);});}else{_0x58f5f9[_0xa901('0x4c')](_0xa901('0x8c'),_0xa901('0x62'));_0x58f5f9[_0xa901('0x4c')](_0xa901('0x9a'),'Account.key');_0x58f5f9[_0xa901('0x4c')](_0xa901('0x9b'),_0xa901('0x9c'));_0x58f5f9[_0xa901('0x4c')](_0xa901('0x9d'),_0xa901('0x8d'));_0x58f5f9[_0xa901('0x4c')]('i.id');_0x58f5f9[_0xa901('0x4c')](_0xa901('0x9e'));_0x58f5f9[_0xa901('0x4c')]('i.updatedAt');_0x58f5f9[_0xa901('0x4c')](_0xa901('0x9f'));_0x58f5f9[_0xa901('0x4c')]('i.closedAt');_0x58f5f9[_0xa901('0x4c')](_0xa901('0xa0'));_0x58f5f9[_0xa901('0x4c')]('i.lastMsgAt');_0x58f5f9['field'](_0xa901('0xa1'));_0x58f5f9[_0xa901('0x4c')](_0xa901('0xa2'));_0x58f5f9[_0xa901('0x4c')]('i.disposition');_0x58f5f9['field']('i.secondDisposition');_0x58f5f9[_0xa901('0x4c')]('i.thirdDisposition');_0x58f5f9[_0xa901('0x4c')](_0xa901('0xa3'));_0x58f5f9['field'](_0xa901('0xa4'));_0x58f5f9[_0xa901('0x4c')](_0xa901('0xa5'));_0x58f5f9[_0xa901('0x4c')](_0xa901('0xa6'));_0x58f5f9[_0xa901('0x4c')]('i.UserId');_0x58f5f9[_0xa901('0x4c')](_0xa901('0xa7'),_0xa901('0xa8'));_0x58f5f9[_0xa901('0x4c')](_0xa901('0xa9'),'Contact.lastName');_0x58f5f9[_0xa901('0x4c')](_0xa901('0xaa'),'Contact.email');_0x58f5f9[_0xa901('0x4c')](_0xa901('0xab'),_0xa901('0xac'));_0x58f5f9['field'](_0xa901('0xad'),_0xa901('0xae'));_0x58f5f9['field'](_0xa901('0xaf'),_0xa901('0xb0'));_0x58f5f9[_0xa901('0x4c')](_0xa901('0xb1'),_0xa901('0xb2'));_0x58f5f9['field'](_0xa901('0xb3'),_0xa901('0xb4'));_0x58f5f9[_0xa901('0x4c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa901('0x2e'));}if(_0x14c381[_0xa901('0x24')])_0x58f5f9[_0xa901('0x24')](_0x14c381['limit']);if(_0x14c381['offset'])_0x58f5f9[_0xa901('0x23')](_0x14c381[_0xa901('0x23')]);return db[_0xa901('0x97')][_0xa901('0x40')](_0x58f5f9[_0xa901('0x98')](),_0xbb80e5);})['then'](function(_0xd99e91){_0x53d6cf[_0xa901('0x49')]('ui.MailInteractionId\x20IN\x20?',_[_0xa901('0x2d')](_0xd99e91,'id'));return db['sequelize'][_0xa901('0x40')](_0x53d6cf[_0xa901('0x98')](),_0xbb80e5)[_0xa901('0x29')](function(_0x54f358){var _0x46aed3=_['groupBy'](_0x54f358,_0xa901('0xb5'));var _0x598a35=[];return db[_0xa901('0xb6')][_0xa901('0x34')]({'attributes':[_0xa901('0xb7')],'raw':!![]})[_0xa901('0x29')](function(_0x366da5){var _0x4045f0=_0x366da5['enableEmailPreview'];_0xd99e91[_0xa901('0x31')](function(_0x182248){_0x598a35[_0xa901('0x32')](updateMailInteraction(_0x182248,_0x51f412,_0x46aed3,_0x4045f0));});return BPromise[_0xa901('0xb8')](_0x598a35);});});});})[_0xa901('0x29')](function(_0x73f1d6){_0x1b8430['rows']=_0x73f1d6;return _0x1b8430;})[_0xa901('0x29')](respondWithFilteredResult(_0x4fd857,_0x14c381))['catch'](handleError(_0x4fd857,null));};exports[_0xa901('0xb9')]=function(_0x5a91eb,_0x617a1b){var _0xd731ae={'raw':![],'where':{'id':_0x5a91eb[_0xa901('0xba')]['id']}},_0x30e271={};_0x30e271['model']=_[_0xa901('0x41')](db[_0xa901('0x3b')][_0xa901('0x3c')]);_0x30e271[_0xa901('0x40')]=_['keys'](_0x5a91eb[_0xa901('0x40')]);_0x30e271[_0xa901('0x42')]=_[_0xa901('0x43')](_0x30e271[_0xa901('0x3f')],_0x30e271[_0xa901('0x40')]);_0xd731ae[_0xa901('0x44')]=_['intersection'](_0x30e271[_0xa901('0x3f')],qs[_0xa901('0x45')](_0x5a91eb['query']['fields']));_0xd731ae[_0xa901('0x44')]=_0xd731ae['attributes'][_0xa901('0x46')]?_0xd731ae[_0xa901('0x44')]:_0x30e271[_0xa901('0x3f')];if(_0x5a91eb[_0xa901('0x40')]['includeAll']){_0xd731ae[_0xa901('0xbb')]=[{'all':!![]}];}_0xd731ae=_['merge']({},_0xd731ae,_0x5a91eb['options']);return db[_0xa901('0x3b')][_0xa901('0x61')](_0xd731ae)['then'](handleEntityNotFound(_0x617a1b,null))[_0xa901('0x29')](respondWithResult(_0x617a1b,null))[_0xa901('0x39')](handleError(_0x617a1b,null));};exports[_0xa901('0xbc')]=function(_0x5cd22b,_0x383b1d){return db['MailInteraction'][_0xa901('0xbc')](_0x5cd22b[_0xa901('0xbd')],{})[_0xa901('0x29')](respondWithResult(_0x383b1d,0xc9))[_0xa901('0x39')](handleError(_0x383b1d,null));};exports['update']=function(_0x4fa5a0,_0x3e126e){if(_0x4fa5a0[_0xa901('0xbd')]['id']){delete _0x4fa5a0['body']['id'];}return db[_0xa901('0x3b')]['find']({'where':{'id':_0x4fa5a0['params']['id']}})[_0xa901('0x29')](handleEntityNotFound(_0x3e126e,null))['then'](saveUpdates(_0x4fa5a0['body'],null))[_0xa901('0x29')](respondWithResult(_0x3e126e,null))[_0xa901('0x39')](handleError(_0x3e126e,null));};exports[_0xa901('0x2a')]=function(_0x1c661e,_0x1d9dc0){return db[_0xa901('0x3b')]['find']({'where':{'id':_0x1c661e[_0xa901('0xba')]['id']}})['then'](handleEntityNotFound(_0x1d9dc0,null))[_0xa901('0x29')](removeEntity(_0x1d9dc0,null))[_0xa901('0x39')](handleError(_0x1d9dc0,null));};exports['describe']=function(_0x480c5f,_0x118dd7){return db[_0xa901('0x3b')]['describe']()[_0xa901('0x29')](respondWithResult(_0x118dd7,null))[_0xa901('0x39')](handleError(_0x118dd7,null));};exports[_0xa901('0xbe')]=function(_0x36b694,_0x45cc45,_0x3d3c55){return db[_0xa901('0x33')][_0xa901('0x61')]({'where':{'id':_0x36b694[_0xa901('0xba')]['id']}})['then'](handleEntityNotFound(_0x45cc45,null))[_0xa901('0x29')](function(_0x40c5e5){if(_0x40c5e5){return _0x40c5e5['addMessage'](_0x36b694['body'][_0xa901('0xbf')],_[_0xa901('0xc0')](_0x36b694['body'],[_0xa901('0xbf'),'id'])||{});}})[_0xa901('0x29')](respondWithResult(_0x45cc45,null))[_0xa901('0x39')](handleError(_0x45cc45,null));};exports[_0xa901('0xc1')]=function(_0x4ea16d,_0x1c41c5,_0x29101d){var _0x324ed5={'raw':![],'where':{}};var _0x403110={};var _0x69fb1f={'count':0x0,'rows':[]};return db[_0xa901('0x3b')]['findOne']({'where':{'id':_0x4ea16d[_0xa901('0xba')]['id']}})['then'](handleEntityNotFound(_0x1c41c5,null))[_0xa901('0x29')](function(_0x383998){if(_0x383998){_0x403110[_0xa901('0x3f')]=_[_0xa901('0x41')](db[_0xa901('0x33')][_0xa901('0x3c')]);_0x403110['query']=_[_0xa901('0x41')](_0x4ea16d['query']);_0x403110['filters']=_[_0xa901('0x43')](_0x403110[_0xa901('0x3f')],_0x403110[_0xa901('0x40')]);_0x324ed5[_0xa901('0x44')]=_[_0xa901('0x43')](_0x403110['model'],qs[_0xa901('0x45')](_0x4ea16d[_0xa901('0x40')][_0xa901('0x45')]));_0x324ed5[_0xa901('0x44')]=_0x324ed5[_0xa901('0x44')][_0xa901('0x46')]?_0x324ed5[_0xa901('0x44')]:_0x403110['model'];if(!_0x4ea16d[_0xa901('0x40')][_0xa901('0xc2')](_0xa901('0x47'))){_0x324ed5[_0xa901('0x24')]=qs['limit'](_0x4ea16d[_0xa901('0x40')]['limit']);_0x324ed5[_0xa901('0x23')]=qs['offset'](_0x4ea16d['query'][_0xa901('0x23')]);}_0x324ed5['order']=qs[_0xa901('0xc3')](_0x4ea16d[_0xa901('0x40')]['sort']);_0x324ed5['where']=qs[_0xa901('0x42')](_['pick'](_0x4ea16d[_0xa901('0x40')],_0x403110['filters']));_0x324ed5['where'][_0xa901('0xb5')]=_0x383998['id'];if(_0x4ea16d['query'][_0xa901('0x82')]){_0x324ed5[_0xa901('0x49')]=_[_0xa901('0x99')](_0x324ed5[_0xa901('0x49')],{'$or':_[_0xa901('0x2d')](_0x324ed5[_0xa901('0x44')],function(_0x3950dc){var _0x92519f={};_0x92519f[_0x3950dc]={'$like':'%'+_0x4ea16d[_0xa901('0x40')][_0xa901('0x82')]+'%'};return _0x92519f;})});}if(_0x4ea16d[_0xa901('0x40')][_0xa901('0x78')]){var _0x1a7b44=_0x4ea16d[_0xa901('0x40')]['$gte'][_0xa901('0x30')](',');var _0x498309={};_0x498309[_0x1a7b44[0x0]]={'$gte':moment(_0x1a7b44[0x1])[_0xa901('0xc4')](_0xa901('0xc5'))};_0x324ed5[_0xa901('0x49')]=_[_0xa901('0x99')](_0x324ed5[_0xa901('0x49')],_0x498309);}_0x324ed5=_['merge']({},_0x324ed5,_0x4ea16d[_0xa901('0xc6')]);return db[_0xa901('0x33')][_0xa901('0x22')]({'where':_0x324ed5[_0xa901('0x49')]})[_0xa901('0x29')](function(_0x7a4813){_0x69fb1f[_0xa901('0x22')]=_0x7a4813;if(_0x4ea16d[_0xa901('0x40')][_0xa901('0xc7')]){_0x324ed5[_0xa901('0xbb')]=[{'all':!![]}];}return db[_0xa901('0x33')][_0xa901('0xc8')](_0x324ed5);})['then'](function(_0x2055f4){if(_0x4ea16d[_0xa901('0x40')]['inlineCss']==='true'){for(var _0x474b26=0x0;_0x474b26<_0x2055f4['length'];_0x474b26++){_0x2055f4[_0x474b26][_0xa901('0xbd')]=juice(_0x2055f4[_0x474b26][_0xa901('0xbd')]);}}_0x69fb1f['rows']=_0x2055f4;return _0x69fb1f;});}})['then'](respondWithFilteredResult(_0x1c41c5,_0x324ed5))[_0xa901('0x39')](handleError(_0x1c41c5,null));};exports[_0xa901('0xc9')]=function(_0x19b657,_0x243528,_0x2698d3){return db[_0xa901('0x3b')]['find']({'where':{'id':_0x19b657[_0xa901('0xba')]['id']}})[_0xa901('0x29')](handleEntityNotFound(_0x243528,null))[_0xa901('0x29')](function(_0x58841e){if(_0x58841e){return _0x58841e['setTags'](_0x19b657[_0xa901('0xbd')][_0xa901('0xbf')],_[_0xa901('0xc0')](_0x19b657[_0xa901('0xbd')],[_0xa901('0xbf'),'id'])||{})[_0xa901('0xca')](function(){return db[_0xa901('0x6e')][_0xa901('0xc8')]({'attributes':['id',_0xa901('0x2c'),'color'],'where':{'id':_0x19b657[_0xa901('0xbd')][_0xa901('0xbf')]}});})['then'](function(_0x2d9cc3){socket[_0xa901('0xcb')](_0xa901('0xcc'),{'id':Number(_0x19b657[_0xa901('0xba')]['id']),'tags':_0x2d9cc3||[]});return{'id':Number(_0x19b657[_0xa901('0xba')]['id']),'tags':_0x2d9cc3||[]};});}})[_0xa901('0x29')](respondWithResult(_0x243528,null))[_0xa901('0x39')](handleError(_0x243528,null));};exports[_0xa901('0xcd')]=function(_0xb9a257,_0x2882c1,_0x242e6d){return db['MailInteraction'][_0xa901('0x61')]({'where':{'id':_0xb9a257[_0xa901('0xba')]['id']}})[_0xa901('0x29')](handleEntityNotFound(_0x2882c1,null))[_0xa901('0x29')](function(_0x35ae80){if(_0x35ae80){return _0x35ae80[_0xa901('0xcd')](_0xb9a257['query'][_0xa901('0xbf')]);}})[_0xa901('0x29')](respondWithStatusCode(_0x2882c1,null))[_0xa901('0x39')](handleError(_0x2882c1,null));};exports[_0xa901('0xce')]=function(_0x43e471,_0x19cce7){var _0x1fe089=moment()[_0xa901('0xcf')]()[_0xa901('0x98')]();var _0x483671=path[_0xa901('0xd0')](config[_0xa901('0xd1')],_0xa901('0xd2'),_0xa901('0xd3'),_0xa901('0xd4'));var _0x4d2754=path['join'](config[_0xa901('0xd1')],_0xa901('0xd2'),_0xa901('0xd3'),_0xa901('0xd5'));var _0x2e3418=path['join'](_0x483671,_0x1fe089);var _0x2f8551=util['format'](_0xa901('0xd6'),_0x43e471['params']['id'],_0x1fe089);var _0x552b46=path[_0xa901('0xd0')](_0x483671,_0x2f8551);var _0x42a800=[];if(_0x43e471[_0xa901('0x40')][_0xa901('0xd5')]){_0x42a800[_0xa901('0x32')]({'model':db[_0xa901('0xd7')],'as':_0xa901('0xd8'),'raw':!![]});}var _0x5ea7a4=[{'model':db[_0xa901('0x33')],'as':_0xa901('0xd9'),'attributes':['id','body',_0xa901('0x51'),'to','cc',_0xa901('0xda'),_0xa901('0xdb'),_0xa901('0x76')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x42a800}];return db['MailInteraction']['find']({'where':{'id':_0x43e471['params']['id']},'include':_0x5ea7a4})[_0xa901('0x29')](handleEntityNotFound(_0x19cce7,null))[_0xa901('0x29')](function(_0x304033){if(_0x304033&&_0x304033[_0xa901('0xd9')]){var _0x174f5f=_0x304033[_0xa901('0xdc')]({'plain':!![]});fs[_0xa901('0xdd')](_0x2e3418);return BPromise[_0xa901('0xde')](_0x174f5f[_0xa901('0xd9')],function(_0x45d0fd,_0x34c324){var _0x64e96={'from':_0x45d0fd[_0xa901('0x51')],'to':_0x45d0fd['to'],'subject':_0x45d0fd[_0xa901('0xdb')],'html':_0x45d0fd['body'],'headers':{'Date':moment(_0x45d0fd[_0xa901('0x76')])[_0xa901('0xc4')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x45d0fd['cc']){_0x64e96[_0xa901('0xdf')]['Cc']=_0x45d0fd['cc'];}if(_0x45d0fd[_0xa901('0xda')]){_0x64e96['headers'][_0xa901('0xe0')]=_0x45d0fd['bcc'];}return new BPromise(function(_0x433986,_0x36ef58){if(_0x45d0fd[_0xa901('0xd8')]){for(var _0x570b55=0x0;_0x570b55<_0x45d0fd[_0xa901('0xd8')][_0xa901('0x46')];_0x570b55++){var _0x364741=_0x45d0fd['Attachments'][_0x570b55];var _0x182dfa=path['join'](_0x4d2754,_0x364741['basename']);if(fs[_0xa901('0xe1')](_0x182dfa)){_0x64e96[_0xa901('0xd5')][_0xa901('0x32')]({'name':_0x364741[_0xa901('0x2c')],'contentType':_0x364741[_0xa901('0x3d')],'data':fs[_0xa901('0xe2')](_0x182dfa)});}}}emlformat['build'](_0x64e96,function(_0x51bb1a,_0x33634d){if(_0x51bb1a)return _0x36ef58(_0x51bb1a);fs[_0xa901('0xe3')](path[_0xa901('0xd0')](_0x2e3418,util[_0xa901('0xc4')](_0xa901('0xe4'),_0x34c324)),_0x33634d);return _0x433986(_0x33634d);});});})[_0xa901('0x29')](function(){return new BPromise(function(_0x1abe8b,_0x52c7fd){zipdir(_0x2e3418,{'saveTo':_0x552b46},function(_0x5ab416,_0x3d037d){if(_0x5ab416)return _0x52c7fd(_0x5ab416);return _0x1abe8b(_0x3d037d);});})[_0xa901('0x29')](function(){return new BPromise(function(_0x46f819,_0x7b0b77){rimraf(_0x2e3418,function(_0xbbe4b0){if(_0xbbe4b0)_0x7b0b77(_0xbbe4b0);return _0x46f819();});});})['then'](function(){return _0x19cce7[_0xa901('0xce')](_0x552b46,_0x2f8551,function(_0x37b9b6){if(_0x37b9b6){console['log'](_0xa901('0xe5'),_0x37b9b6);}else{fs[_0xa901('0xe6')](_0x552b46);}});});});}else{return _0x19cce7[_0xa901('0x1e')](0xc8);}})[_0xa901('0x39')](handleError(_0x19cce7,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index ae847ca..4c84b5e 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 _0x88eb=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0x88eb,0xfd));var _0xb88e=function(_0x24c5ce,_0x68b3f3){_0x24c5ce=_0x24c5ce-0x0;var _0x3a258a=_0x88eb[_0x24c5ce];return _0x3a258a;};'use strict';var EventEmitter=require(_0xb88e('0x0'));var MailInteraction=require(_0xb88e('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0xb88e('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xb88e('0x3')](0x0);var events={'afterCreate':_0xb88e('0x4'),'afterUpdate':_0xb88e('0x5'),'afterDestroy':_0xb88e('0x6')};function emitEvent(_0x21af75){return function(_0x234943,_0x42a2dd,_0x1ae3d6){_0x234943[_0xb88e('0x7')]({'attributes':['id'],'raw':!![]})[_0xb88e('0x8')](function(_0x594325){_0x234943[_0xb88e('0x9')](_0xb88e('0xa'),_0x594325[_0xb88e('0xb')](function(_0x6bb8e3){return{'id':_0x6bb8e3['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x234943['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb88e('0x8')](function(_0x3cdf30){_0x234943[_0xb88e('0x9')](_0xb88e('0xc'),_0x3cdf30['length']);MailInteractionEvents[_0xb88e('0xd')](_0x21af75+':'+_0x234943['id'],_0x234943);MailInteractionEvents[_0xb88e('0xd')](_0x21af75,_0x234943);_0x1ae3d6(null);})['catch'](_0x1ae3d6(null));};}for(var e in events){if(events[_0xb88e('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xb88e('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0xb407=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x3a73bc,_0x550aef){var _0x32891b=function(_0x20b4cb){while(--_0x20b4cb){_0x3a73bc['push'](_0x3a73bc['shift']());}};_0x32891b(++_0x550aef);}(_0xb407,0x1b4));var _0x7b40=function(_0x53291d,_0x5cec19){_0x53291d=_0x53291d-0x0;var _0x1008ae=_0xb407[_0x53291d];return _0x1008ae;};'use strict';var EventEmitter=require(_0x7b40('0x0'));var MailInteraction=require(_0x7b40('0x1'))['db'][_0x7b40('0x2')];var MailMessage=require(_0x7b40('0x1'))['db'][_0x7b40('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7b40('0x4')};function emitEvent(_0x568d5d){return function(_0x25bc63,_0x4f6bc2,_0x4bf9b4){_0x25bc63[_0x7b40('0x5')]({'attributes':['id'],'raw':!![]})[_0x7b40('0x6')](function(_0x3a20f9){_0x25bc63[_0x7b40('0x7')](_0x7b40('0x8'),_0x3a20f9[_0x7b40('0x9')](function(_0x499596){return{'id':_0x499596['id']};}));return MailMessage[_0x7b40('0xa')]({'where':{'MailInteractionId':_0x25bc63['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3bf2f0){_0x25bc63[_0x7b40('0x7')](_0x7b40('0xb'),_0x3bf2f0[_0x7b40('0xc')]);MailInteractionEvents[_0x7b40('0xd')](_0x568d5d+':'+_0x25bc63['id'],_0x25bc63);MailInteractionEvents[_0x7b40('0xd')](_0x568d5d,_0x25bc63);_0x4bf9b4(null);})[_0x7b40('0xe')](_0x4bf9b4(null));};}for(var e in events){if(events[_0x7b40('0xf')](e)){var event=events[e];MailInteraction[_0x7b40('0x10')](e,emitEvent(event));}}module[_0x7b40('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index f104507..d03eb30 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 _0xe773=['get','MailMessage','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatus','changed'];(function(_0x1f98cf,_0xbbb6c6){var _0x36ecc9=function(_0x5964b6){while(--_0x5964b6){_0x1f98cf['push'](_0x1f98cf['shift']());}};_0x36ecc9(++_0xbbb6c6);}(_0xe773,0x19a));var _0x3e77=function(_0x3e25cb,_0x219c8b){_0x3e25cb=_0x3e25cb-0x0;var _0xee462e=_0xe773[_0x3e25cb];return _0xee462e;};'use strict';var _=require('lodash');var util=require(_0x3e77('0x0'));var logger=require(_0x3e77('0x1'))(_0x3e77('0x2'));var moment=require('moment');var BPromise=require(_0x3e77('0x3'));var rp=require(_0x3e77('0x4'));var fs=require('fs');var path=require(_0x3e77('0x5'));var rimraf=require(_0x3e77('0x6'));var config=require(_0x3e77('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x3e77('0x8')]=function(_0x33cc7c,_0x1fc36e){return _0x33cc7c[_0x3e77('0x9')](_0x3e77('0xa'),attributes,{'tableName':_0x3e77('0xb'),'paranoid':![],'indexes':[{'name':_0x3e77('0xc'),'fields':[_0x3e77('0xd'),'to'],'type':_0x3e77('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1fb6f3,_0x272f48,_0x545e68){if(_0x1fb6f3['substatus']){_0x1fb6f3[_0x3e77('0xf')]=moment()[_0x3e77('0x10')](_0x3e77('0x11'));}if(_0x1fb6f3[_0x3e77('0x12')]){_0x1fb6f3[_0x3e77('0x13')]=moment()['format'](_0x3e77('0x11'));}_0x545e68(null,_0x272f48);},'beforeUpdate':function(_0x58a079,_0x577b9f,_0x1aa8a5){if(_0x58a079['changed']('substatus')){_0x58a079[_0x3e77('0xf')]=_0x58a079[_0x3e77('0x14')]?moment()[_0x3e77('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x58a079[_0x3e77('0x15')]('closed')){_0x58a079[_0x3e77('0x13')]=moment()[_0x3e77('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x58a079[_0x3e77('0x14')]=null;_0x58a079[_0x3e77('0xf')]=null;}_0x1aa8a5(null,_0x58a079);},'afterUpdate':function(_0x39ec03,_0xe3a3e,_0x1ce57d){var _0x2c42e7=_0x33cc7c['models'];var _0x1c2260=_0x39ec03[_0x3e77('0x16')]({'plain':!![]});if(_0x1c2260[_0x3e77('0x12')]){return _0x2c42e7[_0x3e77('0x17')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x1c2260['id']}})['then'](function(){_0x1ce57d();})[_0x3e77('0x18')](function(_0x4a68be){_0x1ce57d(_0x4a68be);});}else{_0x1ce57d();}}},'charset':_0x3e77('0x19'),'collate':_0x3e77('0x1a')});}; \ No newline at end of file +var _0x61be=['substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed','models','MailMessage','update','catch','utf8mb4','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','FULLTEXT','substatus'];(function(_0x166cc7,_0x486d0c){var _0x196799=function(_0x598af5){while(--_0x598af5){_0x166cc7['push'](_0x166cc7['shift']());}};_0x196799(++_0x486d0c);}(_0x61be,0x1d7));var _0xe61b=function(_0x3a1d35,_0xb3ce46){_0x3a1d35=_0x3a1d35-0x0;var _0x4a585c=_0x61be[_0x3a1d35];return _0x4a585c;};'use strict';var _=require(_0xe61b('0x0'));var util=require(_0xe61b('0x1'));var logger=require(_0xe61b('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe61b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe61b('0x4'));var config=require(_0xe61b('0x5'));var attributes=require(_0xe61b('0x6'));module[_0xe61b('0x7')]=function(_0x5850c7,_0x4d218f){return _0x5850c7[_0xe61b('0x8')]('MailInteraction',attributes,{'tableName':_0xe61b('0x9'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0xe61b('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1dd61f,_0x23b7c1,_0x26314f){if(_0x1dd61f[_0xe61b('0xb')]){_0x1dd61f[_0xe61b('0xc')]=moment()[_0xe61b('0xd')](_0xe61b('0xe'));}if(_0x1dd61f['closed']){_0x1dd61f[_0xe61b('0xf')]=moment()[_0xe61b('0xd')](_0xe61b('0xe'));}_0x26314f(null,_0x23b7c1);},'beforeUpdate':function(_0x34dad9,_0x41dc2b,_0xc140c7){if(_0x34dad9[_0xe61b('0x10')]('substatus')){_0x34dad9['substatusAt']=_0x34dad9[_0xe61b('0xb')]?moment()[_0xe61b('0xd')](_0xe61b('0xe')):null;}if(_0x34dad9['changed'](_0xe61b('0x11'))){_0x34dad9[_0xe61b('0xf')]=moment()[_0xe61b('0xd')](_0xe61b('0xe'));_0x34dad9['substatus']=null;_0x34dad9[_0xe61b('0xc')]=null;}_0xc140c7(null,_0x34dad9);},'afterUpdate':function(_0xde5e28,_0x3a4a69,_0x16be3c){var _0x3123de=_0x5850c7[_0xe61b('0x12')];var _0x4cd42b=_0xde5e28['get']({'plain':!![]});if(_0x4cd42b[_0xe61b('0x11')]){return _0x3123de[_0xe61b('0x13')][_0xe61b('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x4cd42b['id']}})['then'](function(){_0x16be3c();})[_0xe61b('0x15')](function(_0x158bfa){_0x16be3c(_0x158bfa);});}else{_0x16be3c();}}},'charset':_0xe61b('0x16'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 3873d15..861b941 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 _0x09dd=['request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','options','raw','where','attributes','limit','UpdateMailInteraction','debug','AddTagsToMailInteraction','find','addTags','omit','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','register','request','then','info','MailInteraction,\x20%s,\x20%s'];(function(_0x3ec0f3,_0xda8dd){var _0x993a12=function(_0x11175d){while(--_0x11175d){_0x3ec0f3['push'](_0x3ec0f3['shift']());}};_0x993a12(++_0xda8dd);}(_0x09dd,0xb7));var _0xd09d=function(_0x5b2d38,_0x3c461a){_0x5b2d38=_0x5b2d38-0x0;var _0x2f7806=_0x09dd[_0x5b2d38];return _0x2f7806;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var moment=require(_0xd09d('0x2'));var BPromise=require(_0xd09d('0x3'));var rs=require(_0xd09d('0x4'));var fs=require('fs');var Redis=require(_0xd09d('0x5'));var db=require(_0xd09d('0x6'))['db'];var utils=require(_0xd09d('0x7'));var logger=require(_0xd09d('0x8'))('rpc');var config=require(_0xd09d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd09d('0xa')]['http']({'port':0x232a});config[_0xd09d('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd09d('0xb')]));require('./mailInteraction.socket')[_0xd09d('0xc')](socket);function respondWithRpcPromise(_0x2566ce,_0x50692e,_0x5f1a89){return new BPromise(function(_0x5f1205,_0x477658){return client[_0xd09d('0xd')](_0x2566ce,_0x5f1a89)[_0xd09d('0xe')](function(_0x755ea1){logger[_0xd09d('0xf')](_0xd09d('0x10'),_0x50692e,_0xd09d('0x11'));logger['debug'](_0xd09d('0x12'),_0x50692e,_0xd09d('0x11'),JSON[_0xd09d('0x13')](_0x755ea1));if(_0x755ea1[_0xd09d('0x14')]){if(_0x755ea1[_0xd09d('0x14')]['code']===0x1f4){logger[_0xd09d('0x14')](_0xd09d('0x10'),_0x50692e,_0x755ea1[_0xd09d('0x14')][_0xd09d('0x15')]);return _0x477658(_0x755ea1[_0xd09d('0x14')]['message']);}logger[_0xd09d('0x14')](_0xd09d('0x10'),_0x50692e,_0x755ea1['error'][_0xd09d('0x15')]);return _0x5f1205(_0x755ea1[_0xd09d('0x14')][_0xd09d('0x15')]);}else{logger[_0xd09d('0xf')](_0xd09d('0x10'),_0x50692e,_0xd09d('0x11'));_0x5f1205(_0x755ea1[_0xd09d('0x16')][_0xd09d('0x15')]);}})[_0xd09d('0x17')](function(_0x175920){logger['error'](_0xd09d('0x10'),_0x50692e,_0x175920);_0x477658(_0x175920);});});}exports['UpdateMailInteraction']=function(_0x700b25){var _0x243f9b=this;return new Promise(function(_0x43018b,_0xb92975){return db['MailInteraction'][_0xd09d('0x18')](_0x700b25['body'],{'raw':_0x700b25['options']?_0x700b25[_0xd09d('0x19')][_0xd09d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x700b25['options']?_0x700b25[_0xd09d('0x19')][_0xd09d('0x1b')]||null:null,'attributes':_0x700b25[_0xd09d('0x19')]?_0x700b25[_0xd09d('0x19')][_0xd09d('0x1c')]||null:null,'limit':_0x700b25[_0xd09d('0x19')]?_0x700b25[_0xd09d('0x19')][_0xd09d('0x1d')]||null:null})[_0xd09d('0xe')](function(_0x12997c){logger[_0xd09d('0xf')](_0xd09d('0x1e'),_0x700b25);logger[_0xd09d('0x1f')](_0xd09d('0x1e'),_0x700b25,JSON[_0xd09d('0x13')](_0x12997c));_0x43018b(_0x12997c);})['catch'](function(_0x5db559){logger['error']('UpdateMailInteraction',_0x5db559[_0xd09d('0x15')],_0x700b25);_0xb92975(_0x243f9b[_0xd09d('0x14')](0x1f4,_0x5db559[_0xd09d('0x15')]));});});};exports[_0xd09d('0x20')]=function(_0x50b800){return new Promise(function(_0x3ac9ab,_0xdb4063){return db['MailInteraction'][_0xd09d('0x21')]({'where':_0x50b800['options']?_0x50b800[_0xd09d('0x19')][_0xd09d('0x1b')]||null:null})['then'](function(_0x6a5562){if(_0x6a5562){return _0x6a5562[_0xd09d('0x22')](_0x50b800['body']['ids'],_[_0xd09d('0x23')](_0x50b800[_0xd09d('0x24')],[_0xd09d('0x25'),'id'])||{});}})[_0xd09d('0x26')](function(_0x39754c){logger[_0xd09d('0xf')](_0xd09d('0x27'),_0x50b800);logger[_0xd09d('0x1f')](_0xd09d('0x27'),_0x50b800,JSON[_0xd09d('0x13')](_0x39754c));_0x3ac9ab(_0x39754c);})[_0xd09d('0x17')](function(_0x2bba85){logger['error'](_0xd09d('0x27'),_0x2bba85[_0xd09d('0x15')],_0x50b800);_0xdb4063(_this[_0xd09d('0x14')](0x1f4,_0x2bba85[_0xd09d('0x15')]));});});}; \ No newline at end of file +var _0xc17f=['ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','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','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags'];(function(_0xc85556,_0xb3434a){var _0x3aeccd=function(_0x4f7a2e){while(--_0x4f7a2e){_0xc85556['push'](_0xc85556['shift']());}};_0x3aeccd(++_0xb3434a);}(_0xc17f,0xb8));var _0xfc17=function(_0x47ffb2,_0xe3232e){_0x47ffb2=_0x47ffb2-0x0;var _0x1415b5=_0xc17f[_0x47ffb2];return _0x1415b5;};'use strict';var _=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var moment=require(_0xfc17('0x2'));var BPromise=require(_0xfc17('0x3'));var rs=require(_0xfc17('0x4'));var fs=require('fs');var Redis=require(_0xfc17('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc17('0x6'));var logger=require(_0xfc17('0x7'))(_0xfc17('0x8'));var config=require(_0xfc17('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfc17('0xa')][_0xfc17('0xb')]({'port':0x232a});config[_0xfc17('0xc')]=_[_0xfc17('0xd')](config[_0xfc17('0xc')],{'host':_0xfc17('0xe'),'port':0x18eb});var socket=require(_0xfc17('0xf'))(new Redis(config[_0xfc17('0xc')]));require('./mailInteraction.socket')[_0xfc17('0x10')](socket);function respondWithRpcPromise(_0x1d43ee,_0x343eff,_0x2e722){return new BPromise(function(_0x54f09e,_0x5e0e44){return client[_0xfc17('0x11')](_0x1d43ee,_0x2e722)[_0xfc17('0x12')](function(_0x2924e9){logger[_0xfc17('0x13')](_0xfc17('0x14'),_0x343eff,_0xfc17('0x15'));logger[_0xfc17('0x16')](_0xfc17('0x17'),_0x343eff,_0xfc17('0x15'),JSON[_0xfc17('0x18')](_0x2924e9));if(_0x2924e9['error']){if(_0x2924e9[_0xfc17('0x19')][_0xfc17('0x1a')]===0x1f4){logger[_0xfc17('0x19')]('MailInteraction,\x20%s,\x20%s',_0x343eff,_0x2924e9[_0xfc17('0x19')][_0xfc17('0x1b')]);return _0x5e0e44(_0x2924e9[_0xfc17('0x19')][_0xfc17('0x1b')]);}logger[_0xfc17('0x19')](_0xfc17('0x14'),_0x343eff,_0x2924e9[_0xfc17('0x19')][_0xfc17('0x1b')]);return _0x54f09e(_0x2924e9[_0xfc17('0x19')][_0xfc17('0x1b')]);}else{logger[_0xfc17('0x13')](_0xfc17('0x14'),_0x343eff,_0xfc17('0x15'));_0x54f09e(_0x2924e9['result']['message']);}})[_0xfc17('0x1c')](function(_0x57034){logger[_0xfc17('0x19')](_0xfc17('0x14'),_0x343eff,_0x57034);_0x5e0e44(_0x57034);});});}exports[_0xfc17('0x1d')]=function(_0x12ec9b){var _0x36bdcc=this;return new Promise(function(_0x1325ae,_0x48edb4){return db[_0xfc17('0x1e')][_0xfc17('0x1f')](_0x12ec9b[_0xfc17('0x20')],{'raw':_0x12ec9b[_0xfc17('0x21')]?_0x12ec9b[_0xfc17('0x21')][_0xfc17('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12ec9b[_0xfc17('0x21')]?_0x12ec9b[_0xfc17('0x21')][_0xfc17('0x23')]||null:null,'attributes':_0x12ec9b[_0xfc17('0x21')]?_0x12ec9b['options'][_0xfc17('0x24')]||null:null,'limit':_0x12ec9b[_0xfc17('0x21')]?_0x12ec9b[_0xfc17('0x21')][_0xfc17('0x25')]||null:null})[_0xfc17('0x12')](function(_0x1dfe66){logger['info'](_0xfc17('0x1d'),_0x12ec9b);logger[_0xfc17('0x16')]('UpdateMailInteraction',_0x12ec9b,JSON[_0xfc17('0x18')](_0x1dfe66));_0x1325ae(_0x1dfe66);})[_0xfc17('0x1c')](function(_0x4b1038){logger['error'](_0xfc17('0x1d'),_0x4b1038[_0xfc17('0x1b')],_0x12ec9b);_0x48edb4(_0x36bdcc['error'](0x1f4,_0x4b1038[_0xfc17('0x1b')]));});});};exports[_0xfc17('0x26')]=function(_0x538a5c){return new Promise(function(_0x38fdea,_0x388a17){return db['MailInteraction'][_0xfc17('0x27')]({'where':_0x538a5c[_0xfc17('0x21')]?_0x538a5c['options']['where']||null:null})[_0xfc17('0x12')](function(_0x39dbf9){if(_0x39dbf9){return _0x39dbf9[_0xfc17('0x28')](_0x538a5c[_0xfc17('0x20')][_0xfc17('0x29')],_[_0xfc17('0x2a')](_0x538a5c[_0xfc17('0x20')],[_0xfc17('0x29'),'id'])||{});}})[_0xfc17('0x2b')](function(_0x4d6dc9){logger[_0xfc17('0x13')](_0xfc17('0x2c'),_0x538a5c);logger[_0xfc17('0x16')]('AddTags',_0x538a5c,JSON[_0xfc17('0x18')](_0x4d6dc9));_0x38fdea(_0x4d6dc9);})['catch'](function(_0x431938){logger[_0xfc17('0x19')](_0xfc17('0x2c'),_0x431938[_0xfc17('0x1b')],_0x538a5c);_0x388a17(_this['error'](0x1f4,_0x431938[_0xfc17('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 9ba6f24..6018288 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 _0x4dd1=['remove','update','removeListener','length','./mailInteraction.events','save'];(function(_0x2acfa4,_0x42e878){var _0x5a0441=function(_0x218744){while(--_0x218744){_0x2acfa4['push'](_0x2acfa4['shift']());}};_0x5a0441(++_0x42e878);}(_0x4dd1,0xe2));var _0x14dd=function(_0x449568,_0x53ef52){_0x449568=_0x449568-0x0;var _0x1b5b81=_0x4dd1[_0x449568];return _0x1b5b81;};'use strict';var MailInteractionEvents=require(_0x14dd('0x0'));var events=[_0x14dd('0x1'),_0x14dd('0x2'),_0x14dd('0x3')];function createListener(_0x252af9,_0x4e2f0f){return function(_0x4a2787){_0x4e2f0f['emit'](_0x252af9,_0x4a2787);};}function removeListener(_0x5de8f8,_0x52af04){return function(){MailInteractionEvents[_0x14dd('0x4')](_0x5de8f8,_0x52af04);};}exports['register']=function(_0x4250ab){for(var _0xc6486=0x0,_0x39ea17=events[_0x14dd('0x5')];_0xc6486<_0x39ea17;_0xc6486++){var _0x313b50=events[_0xc6486];var _0x33df8c=createListener('mailInteraction:'+_0x313b50,_0x4250ab);MailInteractionEvents['on'](_0x313b50,_0x33df8c);}}; \ No newline at end of file +var _0x9faf=['emit','removeListener','register','./mailInteraction.events','save','remove'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0x9faf,0x123));var _0xf9fa=function(_0x39c072,_0x48c84d){_0x39c072=_0x39c072-0x0;var _0x3ca011=_0x9faf[_0x39c072];return _0x3ca011;};'use strict';var MailInteractionEvents=require(_0xf9fa('0x0'));var events=[_0xf9fa('0x1'),_0xf9fa('0x2'),'update'];function createListener(_0x9916f2,_0x131562){return function(_0xbcd994){_0x131562[_0xf9fa('0x3')](_0x9916f2,_0xbcd994);};}function removeListener(_0x238961,_0x27c64c){return function(){MailInteractionEvents[_0xf9fa('0x4')](_0x238961,_0x27c64c);};}exports[_0xf9fa('0x5')]=function(_0x35ed1f){for(var _0x546a85=0x0,_0x1aa612=events['length'];_0x546a85<_0x1aa612;_0x546a85++){var _0x305456=events[_0x546a85];var _0x358a11=createListener('mailInteraction:'+_0x305456,_0x35ed1f);MailInteractionEvents['on'](_0x305456,_0x358a11);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 7642c24..1bcefba 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 _0xb7ba=['index','/describe','describe','/:id','show','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated'];(function(_0x9325a1,_0x387023){var _0x205e5f=function(_0x5653d8){while(--_0x5653d8){_0x9325a1['push'](_0x9325a1['shift']());}};_0x205e5f(++_0x387023);}(_0xb7ba,0x1b5));var _0xab7b=function(_0x4892b5,_0x92937){_0x4892b5=_0x4892b5-0x0;var _0x109cb4=_0xb7ba[_0x4892b5];return _0x109cb4;};'use strict';var multer=require(_0xab7b('0x0'));var util=require(_0xab7b('0x1'));var path=require(_0xab7b('0x2'));var timeout=require(_0xab7b('0x3'));var express=require('express');var router=express[_0xab7b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xab7b('0x5'));var interaction=require(_0xab7b('0x6'));var config=require(_0xab7b('0x7'));var controller=require(_0xab7b('0x8'));router[_0xab7b('0x9')]('/',auth[_0xab7b('0xa')](),controller[_0xab7b('0xb')]);router['get'](_0xab7b('0xc'),auth[_0xab7b('0xa')](),controller[_0xab7b('0xd')]);router[_0xab7b('0x9')](_0xab7b('0xe'),auth['isAuthenticated'](),controller[_0xab7b('0xf')]);router[_0xab7b('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xab7b('0x10')]);router[_0xab7b('0x11')]('/',auth[_0xab7b('0xa')](),interaction[_0xab7b('0x12')](_0xab7b('0x13'),_0xab7b('0x14')),controller[_0xab7b('0x15')]);router[_0xab7b('0x16')](_0xab7b('0xe'),auth[_0xab7b('0xa')](),controller[_0xab7b('0x17')]);router[_0xab7b('0x16')](_0xab7b('0x18'),auth[_0xab7b('0xa')](),controller[_0xab7b('0x19')]);router[_0xab7b('0x16')](_0xab7b('0x1a'),auth[_0xab7b('0xa')](),controller[_0xab7b('0x1b')]);router['delete']('/:id',auth[_0xab7b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcaed=['describe','/:id','/:id/download','download','tracked','mail','mailmessage:create','put','/:id/reject','reject','delete','exports','path','express','Router','fs-extra','../../components/auth/service','get','index','isAuthenticated'];(function(_0x251deb,_0x1ce160){var _0x5a4eaf=function(_0x484c2e){while(--_0x484c2e){_0x251deb['push'](_0x251deb['shift']());}};_0x5a4eaf(++_0x1ce160);}(_0xcaed,0x110));var _0xdcae=function(_0x259592,_0x580c80){_0x259592=_0x259592-0x0;var _0x16dde7=_0xcaed[_0x259592];return _0x16dde7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdcae('0x0'));var timeout=require('connect-timeout');var express=require(_0xdcae('0x1'));var router=express[_0xdcae('0x2')]();var fs_extra=require(_0xdcae('0x3'));var auth=require(_0xdcae('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xdcae('0x5')]('/',auth['isAuthenticated'](),controller[_0xdcae('0x6')]);router[_0xdcae('0x5')]('/describe',auth[_0xdcae('0x7')](),controller[_0xdcae('0x8')]);router[_0xdcae('0x5')](_0xdcae('0x9'),auth[_0xdcae('0x7')](),controller['show']);router[_0xdcae('0x5')](_0xdcae('0xa'),auth[_0xdcae('0x7')](),controller[_0xdcae('0xb')]);router['post']('/',auth[_0xdcae('0x7')](),interaction[_0xdcae('0xc')](_0xdcae('0xd'),_0xdcae('0xe')),controller['create']);router[_0xdcae('0xf')](_0xdcae('0x9'),auth[_0xdcae('0x7')](),controller['update']);router[_0xdcae('0xf')]('/:id/accept',auth[_0xdcae('0x7')](),controller['accept']);router[_0xdcae('0xf')](_0xdcae('0x10'),auth[_0xdcae('0x7')](),controller[_0xdcae('0x11')]);router[_0xdcae('0x12')]('/:id',auth[_0xdcae('0x7')](),controller['destroy']);module[_0xdcae('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index a910ec5..24ce9ab 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 _0xa615=['Chat','lodash','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','Email'];(function(_0x3b30f1,_0x143f09){var _0x3906e7=function(_0x39513c){while(--_0x39513c){_0x3b30f1['push'](_0x3b30f1['shift']());}};_0x3906e7(++_0x143f09);}(_0xa615,0x105));var _0x5a61=function(_0xb65674,_0x222296){_0xb65674=_0xb65674-0x0;var _0x3aaaf6=_0xa615[_0xb65674];return _0x3aaaf6;};'use strict';var Sequelize=require('sequelize');var _=require(_0x5a61('0x0'));module[_0x5a61('0x1')]={'body':{'type':Sequelize[_0x5a61('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5a61('0x2')](_0x5a61('0x3'))},'read':{'type':Sequelize[_0x5a61('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5a61('0x5')]('in',_0x5a61('0x6')),'defaultValue':_0x5a61('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5a61('0x7')](0x1fe)},'from':{'type':Sequelize[_0x5a61('0x7')]},'to':{'type':Sequelize[_0x5a61('0x2')](_0x5a61('0x8'))},'cc':{'type':Sequelize[_0x5a61('0x2')](_0x5a61('0x8'))},'bcc':{'type':Sequelize[_0x5a61('0x2')](_0x5a61('0x8'))},'subject':{'type':Sequelize[_0x5a61('0x2')]},'sentAt':{'type':Sequelize[_0x5a61('0x9')]},'attach':{'type':Sequelize[_0x5a61('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x5a61('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x5a61('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x5a61('0x8'))},'originCc':{'type':Sequelize[_0x5a61('0x2')](_0x5a61('0x8'))},'originChannel':{'type':Sequelize[_0x5a61('0x5')](_0x5a61('0xb'),_0x5a61('0xc')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xb612=['BOOLEAN','ENUM','out','STRING','DATE','Email','Chat','lodash','exports','TEXT','long','medium'];(function(_0x297b8b,_0x10031d){var _0x4566e9=function(_0x45062b){while(--_0x45062b){_0x297b8b['push'](_0x297b8b['shift']());}};_0x4566e9(++_0x10031d);}(_0xb612,0x13f));var _0x2b61=function(_0x256575,_0x4246f6){_0x256575=_0x256575-0x0;var _0x20f83b=_0xb612[_0x256575];return _0x20f83b;};'use strict';var Sequelize=require('sequelize');var _=require(_0x2b61('0x0'));module[_0x2b61('0x1')]={'body':{'type':Sequelize[_0x2b61('0x2')](_0x2b61('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2b61('0x2')](_0x2b61('0x4'))},'read':{'type':Sequelize[_0x2b61('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2b61('0x6')]('in',_0x2b61('0x7')),'defaultValue':_0x2b61('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x2b61('0x8')]},'to':{'type':Sequelize['TEXT'](_0x2b61('0x3'))},'cc':{'type':Sequelize[_0x2b61('0x2')](_0x2b61('0x3'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x2b61('0x2')]},'sentAt':{'type':Sequelize[_0x2b61('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2b61('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x2b61('0x2')](_0x2b61('0x3'))},'originChannel':{'type':Sequelize[_0x2b61('0x6')](_0x2b61('0xa'),_0x2b61('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 2544368..fe21364 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 _0xe721=['limit','Content-Range','apply','reject','save','then','status','stack','name','send','index','MailMessage','rawAttributes','key','map','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','keys','find','update','params','destroy','describe','direction','out','secret','body','split','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','authentication','auth','user','pass','attachments','join','root','basename','create','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','mail-interactions','accept','mail','read','readAt','UserId','agent','Contact','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','rejectmessage','download','unix','server','tmp','files','from','bcc','subject','Attachment','Attachments','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','writeFileSync','log','err','unlinkSync','eml-format','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','json','count','offset'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xe721,0x1cf));var _0x1e72=function(_0x2521f2,_0x1346fa){_0x2521f2=_0x2521f2-0x0;var _0x106409=_0xe721[_0x2521f2];return _0x106409;};'use strict';var emlformat=require(_0x1e72('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1e72('0x1'));var rp=require('request-promise');var moment=require(_0x1e72('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1e72('0x3'));var util=require('util');var path=require('path');var sox=require(_0x1e72('0x4'));var csv=require(_0x1e72('0x5'));var ejs=require(_0x1e72('0x6'));var fs=require('fs');var fs_extra=require(_0x1e72('0x7'));var _=require(_0x1e72('0x8'));var squel=require(_0x1e72('0x9'));var crypto=require(_0x1e72('0xa'));var jsforce=require(_0x1e72('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1e72('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1e72('0xc'));var authService=require(_0x1e72('0xd'));var qs=require(_0x1e72('0xe'));var as=require(_0x1e72('0xf'));var hardwareService=require(_0x1e72('0x10'));var logger=require('../../config/logger')(_0x1e72('0x11'));var utils=require(_0x1e72('0x12'));var config=require(_0x1e72('0x13'));var licenseUtil=require(_0x1e72('0x14'));var db=require(_0x1e72('0x15'))['db'];config['redis']=_['defaults'](config[_0x1e72('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x1e72('0x17'))(new Redis(config['redis']));require(_0x1e72('0x18'))[_0x1e72('0x19')](socket);var jayson=require(_0x1e72('0x1a'));var client=jayson['client'][_0x1e72('0x1b')]({'port':0x232c});var client9003=jayson['client'][_0x1e72('0x1b')]({'port':0x232b});var client9002=jayson[_0x1e72('0x1c')][_0x1e72('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x18d177,_0x496f76,_0xe4c6a5,_0x1fc4ac){return new BPromise(function(_0x1c355d,_0x531fe4){var _0x1ab5f8=_0x1fc4ac||client;return _0x1ab5f8[_0x1e72('0x1d')](_0x18d177,_0xe4c6a5)['then'](function(_0x34c4cf){logger[_0x1e72('0x1e')](_0x1e72('0x1f'),_0x496f76,_0x1e72('0x20'));logger['debug'](_0x1e72('0x21'),_0x496f76,_0x1e72('0x20'),JSON[_0x1e72('0x22')](_0x34c4cf));if(_0x34c4cf[_0x1e72('0x23')]){if(_0x34c4cf[_0x1e72('0x23')]['code']===0x1f4){logger[_0x1e72('0x23')]('MailMessage,\x20%s,\x20%s',_0x496f76,_0x34c4cf[_0x1e72('0x23')][_0x1e72('0x24')]);return _0x531fe4(_0x34c4cf[_0x1e72('0x23')][_0x1e72('0x24')]);}logger['error'](_0x1e72('0x1f'),_0x496f76,_0x34c4cf[_0x1e72('0x23')][_0x1e72('0x24')]);return _0x1c355d(_0x34c4cf[_0x1e72('0x23')]['message']);}else{logger[_0x1e72('0x1e')](_0x1e72('0x1f'),_0x496f76,_0x1e72('0x20'));_0x1c355d(_0x34c4cf[_0x1e72('0x25')][_0x1e72('0x24')]);}})[_0x1e72('0x26')](function(_0x212b9f){logger['error'](_0x1e72('0x1f'),_0x496f76,_0x212b9f);_0x531fe4(_0x212b9f);});});}function respondWithStatusCode(_0x429eea,_0x17299b){_0x17299b=_0x17299b||0xcc;return function(_0x13b97a){if(_0x13b97a){return _0x429eea[_0x1e72('0x27')](_0x17299b);}return _0x429eea['status'](_0x17299b)[_0x1e72('0x28')]();};}function respondWithResult(_0x220a21,_0x35078c){_0x35078c=_0x35078c||0xc8;return function(_0xceb647){if(_0xceb647){return _0x220a21['status'](_0x35078c)[_0x1e72('0x29')](_0xceb647);}};}function respondWithFilteredResult(_0x5d8ddf,_0x411885){return function(_0x1c36bf){if(_0x1c36bf){var _0xa29ae2=_0x1c36bf[_0x1e72('0x2a')],_0x214aab=_0x411885[_0x1e72('0x2b')],_0x1bb0d2=_0x411885[_0x1e72('0x2b')]+_0x411885[_0x1e72('0x2c')],_0x196572;if(_0x1bb0d2>=_0xa29ae2){_0x1bb0d2=_0xa29ae2;_0x196572=0xc8;}else{_0x196572=0xce;}_0x5d8ddf['status'](_0x196572);return _0x5d8ddf['set'](_0x1e72('0x2d'),_0x214aab+'-'+_0x1bb0d2+'/'+_0xa29ae2)['json'](_0x1c36bf);}return null;};}function patchUpdates(_0x58b1fb){return function(_0x4b7afb){try{jsonpatch[_0x1e72('0x2e')](_0x4b7afb,_0x58b1fb,!![]);}catch(_0x17616a){return BPromise[_0x1e72('0x2f')](_0x17616a);}return _0x4b7afb[_0x1e72('0x30')]();};}function saveUpdates(_0x803e60,_0xedbf94){return function(_0xdfd81c){if(_0xdfd81c){return _0xdfd81c['update'](_0x803e60)[_0x1e72('0x31')](function(_0xd783f){return _0xd783f;});}return null;};}function removeEntity(_0x2fadc4,_0x4cb032){return function(_0x1f87e6){if(_0x1f87e6){return _0x1f87e6['destroy']()[_0x1e72('0x31')](function(){_0x2fadc4[_0x1e72('0x32')](0xcc)[_0x1e72('0x28')]();});}};}function handleEntityNotFound(_0x5294f1,_0x4134fe){return function(_0x5813d6){if(!_0x5813d6){_0x5294f1['sendStatus'](0x194);}return _0x5813d6;};}function handleError(_0x50daaa,_0x39e1fe){_0x39e1fe=_0x39e1fe||0x1f4;return function(_0x5025b2){logger[_0x1e72('0x23')](_0x5025b2[_0x1e72('0x33')]);if(_0x5025b2['name']){delete _0x5025b2[_0x1e72('0x34')];}_0x50daaa[_0x1e72('0x32')](_0x39e1fe)[_0x1e72('0x35')](_0x5025b2);};}exports[_0x1e72('0x36')]=function(_0x38d00f,_0x3c0c1f){var _0x1f9300={},_0x20497b={},_0x21b8bd={'count':0x0,'rows':[]};var _0x243ef1=_['map'](db[_0x1e72('0x37')][_0x1e72('0x38')],function(_0x454e51){return{'name':_0x454e51['fieldName'],'type':_0x454e51['type'][_0x1e72('0x39')]};});_0x20497b['model']=_[_0x1e72('0x3a')](_0x243ef1,_0x1e72('0x34'));_0x20497b['query']=_['keys'](_0x38d00f['query']);_0x20497b['filters']=_['intersection'](_0x20497b[_0x1e72('0x3b')],_0x20497b[_0x1e72('0x3c')]);_0x1f9300[_0x1e72('0x3d')]=_[_0x1e72('0x3e')](_0x20497b[_0x1e72('0x3b')],qs[_0x1e72('0x3f')](_0x38d00f['query'][_0x1e72('0x3f')]));_0x1f9300['attributes']=_0x1f9300[_0x1e72('0x3d')][_0x1e72('0x40')]?_0x1f9300['attributes']:_0x20497b[_0x1e72('0x3b')];if(!_0x38d00f['query'][_0x1e72('0x41')](_0x1e72('0x42'))){_0x1f9300[_0x1e72('0x2c')]=qs[_0x1e72('0x2c')](_0x38d00f[_0x1e72('0x3c')][_0x1e72('0x2c')]);_0x1f9300[_0x1e72('0x2b')]=qs[_0x1e72('0x2b')](_0x38d00f[_0x1e72('0x3c')]['offset']);}_0x1f9300[_0x1e72('0x43')]=qs['sort'](_0x38d00f[_0x1e72('0x3c')][_0x1e72('0x44')]);_0x1f9300[_0x1e72('0x45')]=qs[_0x1e72('0x46')](_[_0x1e72('0x47')](_0x38d00f[_0x1e72('0x3c')],_0x20497b[_0x1e72('0x46')]),_0x243ef1);if(_0x38d00f[_0x1e72('0x3c')][_0x1e72('0x48')]){_0x1f9300[_0x1e72('0x45')]=_['merge'](_0x1f9300[_0x1e72('0x45')],{'$or':_[_0x1e72('0x3a')](_0x243ef1,function(_0x404249){if(_0x404249[_0x1e72('0x49')]!==_0x1e72('0x4a')){var _0x5529a4={};_0x5529a4[_0x404249[_0x1e72('0x34')]]={'$like':'%'+_0x38d00f[_0x1e72('0x3c')][_0x1e72('0x48')]+'%'};return _0x5529a4;}})});}_0x1f9300=_[_0x1e72('0x4b')]({},_0x1f9300,_0x38d00f[_0x1e72('0x4c')]);var _0x89609a={'where':_0x1f9300[_0x1e72('0x45')]};return db[_0x1e72('0x37')][_0x1e72('0x2a')](_0x89609a)['then'](function(_0x1f0124){_0x21b8bd[_0x1e72('0x2a')]=_0x1f0124;if(_0x38d00f['query'][_0x1e72('0x4d')]){_0x1f9300[_0x1e72('0x4e')]=[{'all':!![]}];}return db['MailMessage'][_0x1e72('0x4f')](_0x1f9300);})[_0x1e72('0x31')](function(_0x482b31){_0x21b8bd[_0x1e72('0x50')]=_0x482b31;return _0x21b8bd;})[_0x1e72('0x31')](respondWithFilteredResult(_0x3c0c1f,_0x1f9300))['catch'](handleError(_0x3c0c1f,null));};exports['show']=function(_0x225832,_0x2ada05){var _0x1f4053={'raw':!![],'where':{'id':_0x225832['params']['id']}},_0x329d01={};_0x329d01[_0x1e72('0x3b')]=_[_0x1e72('0x51')](db[_0x1e72('0x37')]['rawAttributes']);_0x329d01[_0x1e72('0x3c')]=_[_0x1e72('0x51')](_0x225832[_0x1e72('0x3c')]);_0x329d01[_0x1e72('0x46')]=_['intersection'](_0x329d01[_0x1e72('0x3b')],_0x329d01[_0x1e72('0x3c')]);_0x1f4053[_0x1e72('0x3d')]=_[_0x1e72('0x3e')](_0x329d01['model'],qs[_0x1e72('0x3f')](_0x225832['query']['fields']));_0x1f4053[_0x1e72('0x3d')]=_0x1f4053['attributes'][_0x1e72('0x40')]?_0x1f4053[_0x1e72('0x3d')]:_0x329d01['model'];if(_0x225832[_0x1e72('0x3c')]['includeAll']){_0x1f4053[_0x1e72('0x4e')]=[{'all':!![]}];}_0x1f4053=_[_0x1e72('0x4b')]({},_0x1f4053,_0x225832[_0x1e72('0x4c')]);return db[_0x1e72('0x37')][_0x1e72('0x52')](_0x1f4053)['then'](handleEntityNotFound(_0x2ada05,null))[_0x1e72('0x31')](respondWithResult(_0x2ada05,null))[_0x1e72('0x26')](handleError(_0x2ada05,null));};exports[_0x1e72('0x53')]=function(_0x57d29e,_0xcba62a){if(_0x57d29e['body']['id']){delete _0x57d29e['body']['id'];}return db['MailMessage'][_0x1e72('0x52')]({'where':{'id':_0x57d29e[_0x1e72('0x54')]['id']}})[_0x1e72('0x31')](handleEntityNotFound(_0xcba62a,null))[_0x1e72('0x31')](saveUpdates(_0x57d29e['body'],null))['then'](respondWithResult(_0xcba62a,null))[_0x1e72('0x26')](handleError(_0xcba62a,null));};exports[_0x1e72('0x55')]=function(_0x68cab8,_0x13678c){return db[_0x1e72('0x37')][_0x1e72('0x52')]({'where':{'id':_0x68cab8[_0x1e72('0x54')]['id']}})['then'](handleEntityNotFound(_0x13678c,null))[_0x1e72('0x31')](removeEntity(_0x13678c,null))['catch'](handleError(_0x13678c,null));};exports[_0x1e72('0x56')]=function(_0x493c1c,_0x230a7c){return db['MailMessage'][_0x1e72('0x56')]()['then'](respondWithResult(_0x230a7c,null))['catch'](handleError(_0x230a7c,null));};exports['create']=function(_0x42b903,_0x3c2320){return db[_0x1e72('0x37')]['create'](_0x42b903['body'])[_0x1e72('0x31')](function(_0x19fb70){if(_0x19fb70){if(_0x19fb70[_0x1e72('0x57')]===_0x1e72('0x58')&&!_0x19fb70[_0x1e72('0x59')]){var _0x360218,_0x1ddec4,_0x5cdd83;if(_0x42b903[_0x1e72('0x5a')]['to']){_0x1ddec4=_0x42b903[_0x1e72('0x5a')]['to'][_0x1e72('0x5b')](',')[0x0];}return db['MailAccount'][_0x1e72('0x5c')]({'where':{'id':_0x19fb70[_0x1e72('0x5d')]},'include':[{'model':db[_0x1e72('0x5e')],'as':_0x1e72('0x5f'),'include':[{'model':db[_0x1e72('0x60')],'as':_0x1e72('0x61'),'where':{'email':_0x1ddec4},'limit':0x1,'order':[[_0x1e72('0x62'),_0x1e72('0x63')]]}]},{'model':db[_0x1e72('0x64')],'as':_0x1e72('0x65'),'raw':!![]}]})[_0x1e72('0x31')](function(_0x2ed1b1){_0x360218=_0x2ed1b1;if(_0x360218&&_0x360218[_0x1e72('0x65')]){var _0xa060fb={'tls':{'rejectUnauthorized':![]}};if(_[_0x1e72('0x66')](_0x360218[_0x1e72('0x65')][_0x1e72('0x67')])){_0xa060fb[_0x1e72('0x68')]=_0x360218[_0x1e72('0x65')][_0x1e72('0x68')];_0xa060fb[_0x1e72('0x69')]=_0x360218[_0x1e72('0x65')][_0x1e72('0x69')];_0xa060fb['secure']=_0x360218[_0x1e72('0x65')]['secure'];if(_0x360218[_0x1e72('0x65')][_0x1e72('0x6a')]){_0xa060fb[_0x1e72('0x6b')]={'user':_0x360218[_0x1e72('0x65')][_0x1e72('0x6c')],'pass':_0x360218[_0x1e72('0x65')][_0x1e72('0x6d')]};}}else{_0xa060fb[_0x1e72('0x67')]=_0x360218[_0x1e72('0x65')]['service'];_0xa060fb[_0x1e72('0x6b')]={'user':_0x360218[_0x1e72('0x65')]['user'],'pass':_0x360218['Smtp'][_0x1e72('0x6d')]};_0xa060fb['secure']=_0x360218[_0x1e72('0x65')]['secure'];}if(_0x42b903[_0x1e72('0x5a')]['attachments']&&_0x42b903[_0x1e72('0x5a')][_0x1e72('0x6e')][_0x1e72('0x40')]){for(var _0x1dd3c4=0x0;_0x1dd3c4<_0x42b903['body'][_0x1e72('0x6e')][_0x1e72('0x40')];_0x1dd3c4+=0x1){_0x42b903['body'][_0x1e72('0x6e')][_0x1dd3c4]={'filename':_0x42b903[_0x1e72('0x5a')][_0x1e72('0x6e')][_0x1dd3c4]['name'],'path':path[_0x1e72('0x6f')](config[_0x1e72('0x70')],'server/files/attachments',_0x42b903['body'][_0x1e72('0x6e')][_0x1dd3c4][_0x1e72('0x71')])};}}_0x5cdd83={'account':_0xa060fb,'message':_0x42b903[_0x1e72('0x5a')]};return;}})['then'](function(){if(_0x360218['List']){if(_0x360218[_0x1e72('0x5f')][_0x1e72('0x61')][_0x1e72('0x40')]){return _0x360218[_0x1e72('0x5f')]['Contacts'][0x0];}else{return db[_0x1e72('0x60')][_0x1e72('0x72')](_['defaults'](_0x42b903['body'],{'firstName':_0x42b903[_0x1e72('0x5a')]['to'],'email':_0x42b903[_0x1e72('0x5a')]['to'],'phone':_0x42b903['body']['to'],'ListId':_0x360218[_0x1e72('0x73')]}));}}else{throw new Error(_0x1e72('0x74'));}})[_0x1e72('0x31')](function(){if(_0x5cdd83){return respondWithRpcPromise('SendMail',_0x1e72('0x75'),_0x5cdd83,client9003)['then'](function(_0x21da9c){return _0x19fb70[_0x1e72('0x53')]({'read':!![],'messageId':_0x21da9c[_0x1e72('0x76')],'sentAt':moment()[_0x1e72('0x77')](_0x1e72('0x78'))});})[_0x1e72('0x26')](function(_0x42ea59){logger[_0x1e72('0x23')]('%s',JSON[_0x1e72('0x22')](_0x42ea59));return _0x19fb70;});}return _0x19fb70;});}return _0x19fb70;}})[_0x1e72('0x31')](respondWithResult(_0x3c2320,0xc9))['catch'](handleError(_0x3c2320,null));};var interaction_log=require(_0x1e72('0x79'))(_0x1e72('0x7a'));exports[_0x1e72('0x7b')]=function(_0x52610a,_0x53b9f2,_0x285c46){var _0x197c8a={'agent':{},'channel':_0x1e72('0x7c')};if(_0x52610a[_0x1e72('0x5a')]['id']){delete _0x52610a[_0x1e72('0x5a')]['id'];}_0x52610a[_0x1e72('0x5a')][_0x1e72('0x7d')]=!![];_0x52610a[_0x1e72('0x5a')][_0x1e72('0x7e')]=moment()[_0x1e72('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x52610a[_0x1e72('0x5a')][_0x1e72('0x7f')]=_0x52610a[_0x1e72('0x5a')][_0x1e72('0x7f')]||_0x52610a['user']['id'];_0x197c8a[_0x1e72('0x80')]['id']=_0x52610a[_0x1e72('0x5a')]['UserId'];return db[_0x1e72('0x37')][_0x1e72('0x52')]({'where':{'id':_0x52610a[_0x1e72('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x1e72('0x60')],'as':_0x1e72('0x81')}]})[_0x1e72('0x31')](handleEntityNotFound(_0x53b9f2,null))['then'](saveUpdates(_0x52610a[_0x1e72('0x5a')],null))[_0x1e72('0x31')](function(_0x14cc8e){if(_0x14cc8e){_0x197c8a[_0x1e72('0x24')]=_0x14cc8e[_0x1e72('0x82')]({'plain':!![]});return db[_0x1e72('0x83')]['find']({'where':{'id':_0x14cc8e[_0x1e72('0x84')]}});}return null;})[_0x1e72('0x31')](handleEntityNotFound(_0x53b9f2,null))[_0x1e72('0x31')](function(_0x2c1772){if(_0x2c1772){return _0x2c1772[_0x1e72('0x53')]({'UserId':_0x52610a[_0x1e72('0x5a')][_0x1e72('0x7f')],'read1stAt':_[_0x1e72('0x66')](_0x2c1772[_0x1e72('0x85')])?moment()['format'](_0x1e72('0x78')):undefined});}return null;})[_0x1e72('0x31')](function(_0x4aa446){if(_0x4aa446){_0x197c8a['interaction']=_0x4aa446['get']({'plain':!![]});interaction_log[_0x1e72('0x1e')](_0x1e72('0x86'),_0x52610a[_0x1e72('0x6c')]['id'],_0x52610a[_0x1e72('0x6c')][_0x1e72('0x34')],_0x52610a[_0x1e72('0x6c')][_0x1e72('0x87')],_0x197c8a[_0x1e72('0x88')]['id'],_0x52610a[_0x1e72('0x5a')]?JSON['stringify'](_0x52610a[_0x1e72('0x5a')]):_0x1e72('0x89'));return respondWithRpcPromise(_0x1e72('0x8a'),_0x1e72('0x8b'),_0x197c8a);}return null;})[_0x1e72('0x31')](function(_0x48f49b){if(_0x48f49b){if(_0x52610a[_0x1e72('0x5a')]['manual']){_0x197c8a[_0x1e72('0x24')]['interface']=util[_0x1e72('0x77')](_0x1e72('0x8c'),_0x52610a[_0x1e72('0x6c')][_0x1e72('0x34')]);_0x197c8a[_0x1e72('0x24')][_0x1e72('0x8d')]=_0x197c8a[_0x1e72('0x8d')];_0x197c8a[_0x1e72('0x24')][_0x1e72('0x8e')]='accept';return respondWithRpcPromise('EventManager',_0x1e72('0x8f'),{'event':_0x1e72('0x90'),'message':_0x197c8a[_0x1e72('0x24')]},client9002)[_0x1e72('0x31')](function(){return _0x197c8a;});}return _0x197c8a;}return null;})[_0x1e72('0x31')](respondWithResult(_0x53b9f2,null))['catch'](handleError(_0x53b9f2,null));};var interaction_log=require(_0x1e72('0x79'))('mail-interactions');exports[_0x1e72('0x2f')]=function(_0x498492,_0xbc7eb7,_0x16c9e7){var _0x58e4e0={'agent':{},'channel':'mail'};if(_0x498492[_0x1e72('0x5a')]['id']){delete _0x498492['body']['id'];}_0x498492[_0x1e72('0x5a')][_0x1e72('0x7f')]=_0x498492['body'][_0x1e72('0x7f')]||_0x498492['user']['id'];_0x58e4e0['agent']['id']=_0x498492[_0x1e72('0x5a')]['UserId'];return db[_0x1e72('0x37')]['find']({'where':{'id':_0x498492[_0x1e72('0x54')]['id'],'UserId':null}})[_0x1e72('0x31')](handleEntityNotFound(_0xbc7eb7,null))['then'](function(_0x3cea0c){if(_0x3cea0c){_0x58e4e0[_0x1e72('0x24')]=_0x3cea0c[_0x1e72('0x82')]({'plain':!![]});return db[_0x1e72('0x83')][_0x1e72('0x52')]({'where':{'id':_0x3cea0c[_0x1e72('0x84')]}});}return null;})[_0x1e72('0x31')](handleEntityNotFound(_0xbc7eb7,null))[_0x1e72('0x31')](function(_0xf2fbbb){if(_0xf2fbbb){_0x58e4e0[_0x1e72('0x88')]=_0xf2fbbb[_0x1e72('0x82')]({'plain':!![]});interaction_log[_0x1e72('0x1e')](_0x1e72('0x91'),_0x498492[_0x1e72('0x6c')]['id'],_0x498492[_0x1e72('0x6c')][_0x1e72('0x34')],_0x498492[_0x1e72('0x6c')]['role'],_0x58e4e0[_0x1e72('0x88')]['id'],_0x498492[_0x1e72('0x5a')]?JSON[_0x1e72('0x22')](_0x498492[_0x1e72('0x5a')]):_0x1e72('0x89'));return respondWithRpcPromise('RejectMessage',_0x1e72('0x92'),_0x58e4e0);}return null;})[_0x1e72('0x31')](function(_0xfd523b){if(_0xfd523b){_0xfd523b[_0x1e72('0x24')][_0x1e72('0x93')]=util[_0x1e72('0x77')]('SIP/%s',_0x498492['user']['name']);_0xfd523b[_0x1e72('0x24')][_0x1e72('0x8d')]=_0x58e4e0[_0x1e72('0x8d')];_0xfd523b[_0x1e72('0x24')][_0x1e72('0x8e')]=_0x1e72('0x2f');respondWithRpcPromise(_0x1e72('0x8f'),_0x1e72('0x8f'),{'event':_0x1e72('0x94'),'message':_0xfd523b[_0x1e72('0x24')]},client9002);return _0x58e4e0;}return null;})[_0x1e72('0x31')](respondWithResult(_0xbc7eb7,null))[_0x1e72('0x26')](handleError(_0xbc7eb7,null));};exports[_0x1e72('0x95')]=function(_0x9f49f,_0x594223){var _0xca314f=moment()[_0x1e72('0x96')]()['toString']();var _0x31caa1=path['join'](config['root'],_0x1e72('0x97'),'files',_0x1e72('0x98'));var _0x29f948=path[_0x1e72('0x6f')](config['root'],'server',_0x1e72('0x99'),'attachments');var _0x545cdb=util[_0x1e72('0x77')]('message-%s.eml',_0xca314f);return db[_0x1e72('0x37')]['find']({'where':{'id':_0x9f49f[_0x1e72('0x54')]['id']},'attributes':['id','body',_0x1e72('0x9a'),'to','cc',_0x1e72('0x9b'),_0x1e72('0x9c'),'createdAt'],'include':_0x9f49f[_0x1e72('0x3c')]['attachments']?[{'model':db[_0x1e72('0x9d')],'as':_0x1e72('0x9e')}]:undefined})[_0x1e72('0x31')](handleEntityNotFound(_0x594223,null))['then'](function(_0xbff7d3){if(_0xbff7d3){var _0x4d39ee=_0xbff7d3;var _0x51192b={'from':_0x4d39ee[_0x1e72('0x9a')],'to':_0x4d39ee['to'],'subject':_0x4d39ee[_0x1e72('0x9c')],'html':_0x4d39ee[_0x1e72('0x5a')],'headers':{'Date':moment(_0x4d39ee[_0x1e72('0x9f')])[_0x1e72('0x77')](_0x1e72('0xa0'))},'attachments':[]};if(_0xbff7d3['cc']){_0x51192b[_0x1e72('0xa1')]['Cc']=_0xbff7d3['cc'];}if(_0xbff7d3[_0x1e72('0x9b')]){_0x51192b[_0x1e72('0xa1')][_0x1e72('0xa2')]=_0xbff7d3['bcc'];}return new BPromise(function(_0x5bced0,_0x3a8ef0){if(_0xbff7d3[_0x1e72('0x9e')]){for(var _0x493e43=0x0;_0x493e43<_0xbff7d3[_0x1e72('0x9e')][_0x1e72('0x40')];_0x493e43++){var _0x4c6731=_0xbff7d3[_0x1e72('0x9e')][_0x493e43];var _0x33d4da=path['join'](_0x29f948,_0x4c6731[_0x1e72('0x71')]);if(fs[_0x1e72('0xa3')](_0x33d4da)){_0x51192b[_0x1e72('0x6e')]['push']({'name':_0x4c6731[_0x1e72('0x34')],'contentType':_0x4c6731['type'],'data':fs[_0x1e72('0xa4')](_0x33d4da)});}}}emlformat['build'](_0x51192b,function(_0xb46313,_0x534a9a){if(_0xb46313)return _0x3a8ef0(_0xb46313);fs[_0x1e72('0xa5')](path[_0x1e72('0x6f')](_0x31caa1,_0x545cdb),_0x534a9a);return _0x5bced0(_0x534a9a);});});}})[_0x1e72('0x31')](function(_0x11df58){if(_0x11df58){return _0x594223[_0x1e72('0x95')](path['join'](_0x31caa1,_0x545cdb),_0x545cdb,function(_0x497ef2){if(_0x497ef2){console[_0x1e72('0xa6')](_0x1e72('0xa7'),_0x497ef2);}else{fs[_0x1e72('0xa8')](path[_0x1e72('0x6f')](_0x31caa1,_0x545cdb));}});}})[_0x1e72('0x26')](handleError(_0x594223,null));}; \ No newline at end of file +var _0xa72a=['find','describe','create','direction','out','secret','MailAccount','findOne','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','user','pass','auth','attachments','join','root','server/files/attachments','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','readAt','UserId','Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','channel','event','acceptmessage','../../config/logger','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','EventManager','rejectmessage','download','unix','toString','server','files','message-%s.eml','bcc','subject','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','readFileSync','build','writeFileSync','log','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','MailMessage,\x20%s,\x20%s','message','sendStatus','status','end','count','offset','set','json','apply','reject','save','update','destroy','then','stack','name','send','MailMessage','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','body','catch'];(function(_0x48adea,_0x1c5d36){var _0x3343da=function(_0x211b9e){while(--_0x211b9e){_0x48adea['push'](_0x48adea['shift']());}};_0x3343da(++_0x1c5d36);}(_0xa72a,0xfd));var _0xaa72=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0xa72a[_0x4bcf38];return _0x4a89be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa72('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaa72('0x1'));var moment=require(_0xaa72('0x2'));var BPromise=require(_0xaa72('0x3'));var Mustache=require(_0xaa72('0x4'));var util=require(_0xaa72('0x5'));var path=require('path');var sox=require(_0xaa72('0x6'));var csv=require(_0xaa72('0x7'));var ejs=require(_0xaa72('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaa72('0x7'));var querystring=require(_0xaa72('0x9'));var Papa=require(_0xaa72('0xa'));var Redis=require(_0xaa72('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa72('0xc'));var hardwareService=require(_0xaa72('0xd'));var logger=require('../../config/logger')(_0xaa72('0xe'));var utils=require(_0xaa72('0xf'));var config=require(_0xaa72('0x10'));var licenseUtil=require(_0xaa72('0x11'));var db=require(_0xaa72('0x12'))['db'];config[_0xaa72('0x13')]=_[_0xaa72('0x14')](config[_0xaa72('0x13')],{'host':_0xaa72('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa72('0x13')]));require(_0xaa72('0x16'))[_0xaa72('0x17')](socket);var jayson=require(_0xaa72('0x18'));var client=jayson[_0xaa72('0x19')][_0xaa72('0x1a')]({'port':0x232c});var client9003=jayson[_0xaa72('0x19')][_0xaa72('0x1a')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x489bbd,_0x2f5d15,_0x257526,_0x3fa303){return new BPromise(function(_0x5e0ec8,_0x1ee328){var _0x5b413b=_0x3fa303||client;return _0x5b413b[_0xaa72('0x1b')](_0x489bbd,_0x257526)['then'](function(_0x12f586){logger[_0xaa72('0x1c')]('MailMessage,\x20%s,\x20%s',_0x2f5d15,_0xaa72('0x1d'));logger[_0xaa72('0x1e')](_0xaa72('0x1f'),_0x2f5d15,_0xaa72('0x1d'),JSON[_0xaa72('0x20')](_0x12f586));if(_0x12f586['error']){if(_0x12f586['error'][_0xaa72('0x21')]===0x1f4){logger[_0xaa72('0x22')](_0xaa72('0x23'),_0x2f5d15,_0x12f586[_0xaa72('0x22')][_0xaa72('0x24')]);return _0x1ee328(_0x12f586[_0xaa72('0x22')][_0xaa72('0x24')]);}logger['error'](_0xaa72('0x23'),_0x2f5d15,_0x12f586[_0xaa72('0x22')]['message']);return _0x5e0ec8(_0x12f586[_0xaa72('0x22')]['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x2f5d15,_0xaa72('0x1d'));_0x5e0ec8(_0x12f586['result']['message']);}})['catch'](function(_0xf00523){logger[_0xaa72('0x22')](_0xaa72('0x23'),_0x2f5d15,_0xf00523);_0x1ee328(_0xf00523);});});}function respondWithStatusCode(_0x856080,_0xb2be36){_0xb2be36=_0xb2be36||0xcc;return function(_0x471f07){if(_0x471f07){return _0x856080[_0xaa72('0x25')](_0xb2be36);}return _0x856080[_0xaa72('0x26')](_0xb2be36)[_0xaa72('0x27')]();};}function respondWithResult(_0x1664c6,_0x1cfc8d){_0x1cfc8d=_0x1cfc8d||0xc8;return function(_0x1126f9){if(_0x1126f9){return _0x1664c6['status'](_0x1cfc8d)['json'](_0x1126f9);}};}function respondWithFilteredResult(_0x4df156,_0x326d9f){return function(_0x454882){if(_0x454882){var _0x5da9d6=_0x454882[_0xaa72('0x28')],_0x20786b=_0x326d9f['offset'],_0x5c1ad5=_0x326d9f[_0xaa72('0x29')]+_0x326d9f['limit'],_0x19057e;if(_0x5c1ad5>=_0x5da9d6){_0x5c1ad5=_0x5da9d6;_0x19057e=0xc8;}else{_0x19057e=0xce;}_0x4df156[_0xaa72('0x26')](_0x19057e);return _0x4df156[_0xaa72('0x2a')]('Content-Range',_0x20786b+'-'+_0x5c1ad5+'/'+_0x5da9d6)[_0xaa72('0x2b')](_0x454882);}return null;};}function patchUpdates(_0x170a47){return function(_0xe4d317){try{jsonpatch[_0xaa72('0x2c')](_0xe4d317,_0x170a47,!![]);}catch(_0x58e1ab){return BPromise[_0xaa72('0x2d')](_0x58e1ab);}return _0xe4d317[_0xaa72('0x2e')]();};}function saveUpdates(_0x261ccc,_0x28fdb5){return function(_0x146f9b){if(_0x146f9b){return _0x146f9b[_0xaa72('0x2f')](_0x261ccc)['then'](function(_0x49f109){return _0x49f109;});}return null;};}function removeEntity(_0x335cad,_0x2367ef){return function(_0x4bd30f){if(_0x4bd30f){return _0x4bd30f[_0xaa72('0x30')]()[_0xaa72('0x31')](function(){_0x335cad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc06c37,_0x25ad25){return function(_0x3a0c6e){if(!_0x3a0c6e){_0xc06c37[_0xaa72('0x25')](0x194);}return _0x3a0c6e;};}function handleError(_0x384195,_0x551b9e){_0x551b9e=_0x551b9e||0x1f4;return function(_0x119709){logger['error'](_0x119709[_0xaa72('0x32')]);if(_0x119709[_0xaa72('0x33')]){delete _0x119709[_0xaa72('0x33')];}_0x384195[_0xaa72('0x26')](_0x551b9e)[_0xaa72('0x34')](_0x119709);};}exports['index']=function(_0x777282,_0x2b1356){var _0x26547c={},_0x6959b7={},_0x1407e5={'count':0x0,'rows':[]};var _0x489a48=_['map'](db[_0xaa72('0x35')]['rawAttributes'],function(_0x4826a3){return{'name':_0x4826a3[_0xaa72('0x36')],'type':_0x4826a3[_0xaa72('0x37')][_0xaa72('0x38')]};});_0x6959b7[_0xaa72('0x39')]=_[_0xaa72('0x3a')](_0x489a48,_0xaa72('0x33'));_0x6959b7[_0xaa72('0x3b')]=_[_0xaa72('0x3c')](_0x777282[_0xaa72('0x3b')]);_0x6959b7['filters']=_[_0xaa72('0x3d')](_0x6959b7[_0xaa72('0x39')],_0x6959b7['query']);_0x26547c[_0xaa72('0x3e')]=_['intersection'](_0x6959b7[_0xaa72('0x39')],qs['fields'](_0x777282['query'][_0xaa72('0x3f')]));_0x26547c[_0xaa72('0x3e')]=_0x26547c[_0xaa72('0x3e')][_0xaa72('0x40')]?_0x26547c[_0xaa72('0x3e')]:_0x6959b7['model'];if(!_0x777282[_0xaa72('0x3b')][_0xaa72('0x41')](_0xaa72('0x42'))){_0x26547c[_0xaa72('0x43')]=qs[_0xaa72('0x43')](_0x777282['query'][_0xaa72('0x43')]);_0x26547c[_0xaa72('0x29')]=qs[_0xaa72('0x29')](_0x777282['query'][_0xaa72('0x29')]);}_0x26547c[_0xaa72('0x44')]=qs[_0xaa72('0x45')](_0x777282[_0xaa72('0x3b')][_0xaa72('0x45')]);_0x26547c['where']=qs[_0xaa72('0x46')](_[_0xaa72('0x47')](_0x777282[_0xaa72('0x3b')],_0x6959b7['filters']),_0x489a48);if(_0x777282['query'][_0xaa72('0x48')]){_0x26547c[_0xaa72('0x49')]=_[_0xaa72('0x4a')](_0x26547c['where'],{'$or':_[_0xaa72('0x3a')](_0x489a48,function(_0x24b3dd){if(_0x24b3dd['type']!=='VIRTUAL'){var _0x127793={};_0x127793[_0x24b3dd['name']]={'$like':'%'+_0x777282['query']['filter']+'%'};return _0x127793;}})});}_0x26547c=_[_0xaa72('0x4a')]({},_0x26547c,_0x777282[_0xaa72('0x4b')]);var _0xea7483={'where':_0x26547c[_0xaa72('0x49')]};return db['MailMessage'][_0xaa72('0x28')](_0xea7483)[_0xaa72('0x31')](function(_0xa195c7){_0x1407e5[_0xaa72('0x28')]=_0xa195c7;if(_0x777282['query'][_0xaa72('0x4c')]){_0x26547c[_0xaa72('0x4d')]=[{'all':!![]}];}return db[_0xaa72('0x35')][_0xaa72('0x4e')](_0x26547c);})[_0xaa72('0x31')](function(_0x156151){_0x1407e5[_0xaa72('0x4f')]=_0x156151;return _0x1407e5;})[_0xaa72('0x31')](respondWithFilteredResult(_0x2b1356,_0x26547c))['catch'](handleError(_0x2b1356,null));};exports[_0xaa72('0x50')]=function(_0x1edb71,_0x2f4edf){var _0x3ea55c={'raw':!![],'where':{'id':_0x1edb71[_0xaa72('0x51')]['id']}},_0x5d9736={};_0x5d9736['model']=_[_0xaa72('0x3c')](db[_0xaa72('0x35')][_0xaa72('0x52')]);_0x5d9736[_0xaa72('0x3b')]=_[_0xaa72('0x3c')](_0x1edb71[_0xaa72('0x3b')]);_0x5d9736['filters']=_[_0xaa72('0x3d')](_0x5d9736['model'],_0x5d9736[_0xaa72('0x3b')]);_0x3ea55c[_0xaa72('0x3e')]=_[_0xaa72('0x3d')](_0x5d9736[_0xaa72('0x39')],qs['fields'](_0x1edb71[_0xaa72('0x3b')][_0xaa72('0x3f')]));_0x3ea55c[_0xaa72('0x3e')]=_0x3ea55c[_0xaa72('0x3e')][_0xaa72('0x40')]?_0x3ea55c[_0xaa72('0x3e')]:_0x5d9736[_0xaa72('0x39')];if(_0x1edb71[_0xaa72('0x3b')]['includeAll']){_0x3ea55c[_0xaa72('0x4d')]=[{'all':!![]}];}_0x3ea55c=_[_0xaa72('0x4a')]({},_0x3ea55c,_0x1edb71[_0xaa72('0x4b')]);return db['MailMessage']['find'](_0x3ea55c)[_0xaa72('0x31')](handleEntityNotFound(_0x2f4edf,null))[_0xaa72('0x31')](respondWithResult(_0x2f4edf,null))['catch'](handleError(_0x2f4edf,null));};exports['update']=function(_0x30ffac,_0x5049c3){if(_0x30ffac['body']['id']){delete _0x30ffac[_0xaa72('0x53')]['id'];}return db[_0xaa72('0x35')]['find']({'where':{'id':_0x30ffac['params']['id']}})['then'](handleEntityNotFound(_0x5049c3,null))[_0xaa72('0x31')](saveUpdates(_0x30ffac[_0xaa72('0x53')],null))['then'](respondWithResult(_0x5049c3,null))[_0xaa72('0x54')](handleError(_0x5049c3,null));};exports[_0xaa72('0x30')]=function(_0x1e3987,_0x499be8){return db['MailMessage'][_0xaa72('0x55')]({'where':{'id':_0x1e3987['params']['id']}})[_0xaa72('0x31')](handleEntityNotFound(_0x499be8,null))['then'](removeEntity(_0x499be8,null))[_0xaa72('0x54')](handleError(_0x499be8,null));};exports[_0xaa72('0x56')]=function(_0x55f121,_0x5a898d){return db['MailMessage'][_0xaa72('0x56')]()[_0xaa72('0x31')](respondWithResult(_0x5a898d,null))['catch'](handleError(_0x5a898d,null));};exports[_0xaa72('0x57')]=function(_0x26bdb8,_0x1ed344){return db[_0xaa72('0x35')][_0xaa72('0x57')](_0x26bdb8[_0xaa72('0x53')])[_0xaa72('0x31')](function(_0x2377b6){if(_0x2377b6){if(_0x2377b6[_0xaa72('0x58')]===_0xaa72('0x59')&&!_0x2377b6[_0xaa72('0x5a')]){var _0x39330d,_0x3ac655,_0x5bc057;if(_0x26bdb8[_0xaa72('0x53')]['to']){_0x3ac655=_0x26bdb8[_0xaa72('0x53')]['to']['split'](',')[0x0];}return db[_0xaa72('0x5b')][_0xaa72('0x5c')]({'where':{'id':_0x2377b6['MailAccountId']},'include':[{'model':db[_0xaa72('0x5d')],'as':_0xaa72('0x5e'),'include':[{'model':db[_0xaa72('0x5f')],'as':_0xaa72('0x60'),'where':{'email':_0x3ac655},'limit':0x1,'order':[[_0xaa72('0x61'),_0xaa72('0x62')]]}]},{'model':db[_0xaa72('0x63')],'as':_0xaa72('0x64'),'raw':!![]}]})[_0xaa72('0x31')](function(_0x1de7f5){_0x39330d=_0x1de7f5;if(_0x39330d&&_0x39330d[_0xaa72('0x64')]){var _0x29ace2={'tls':{'rejectUnauthorized':![]}};if(_[_0xaa72('0x65')](_0x39330d[_0xaa72('0x64')][_0xaa72('0x66')])){_0x29ace2[_0xaa72('0x67')]=_0x39330d[_0xaa72('0x64')][_0xaa72('0x67')];_0x29ace2[_0xaa72('0x68')]=_0x39330d[_0xaa72('0x64')]['port'];_0x29ace2[_0xaa72('0x69')]=_0x39330d['Smtp'][_0xaa72('0x69')];if(_0x39330d[_0xaa72('0x64')][_0xaa72('0x6a')]){_0x29ace2['auth']={'user':_0x39330d[_0xaa72('0x64')][_0xaa72('0x6b')],'pass':_0x39330d[_0xaa72('0x64')][_0xaa72('0x6c')]};}}else{_0x29ace2[_0xaa72('0x66')]=_0x39330d[_0xaa72('0x64')][_0xaa72('0x66')];_0x29ace2[_0xaa72('0x6d')]={'user':_0x39330d[_0xaa72('0x64')][_0xaa72('0x6b')],'pass':_0x39330d[_0xaa72('0x64')]['pass']};_0x29ace2[_0xaa72('0x69')]=_0x39330d['Smtp'][_0xaa72('0x69')];}if(_0x26bdb8[_0xaa72('0x53')][_0xaa72('0x6e')]&&_0x26bdb8[_0xaa72('0x53')]['attachments']['length']){for(var _0x221545=0x0;_0x221545<_0x26bdb8[_0xaa72('0x53')][_0xaa72('0x6e')][_0xaa72('0x40')];_0x221545+=0x1){_0x26bdb8[_0xaa72('0x53')][_0xaa72('0x6e')][_0x221545]={'filename':_0x26bdb8[_0xaa72('0x53')][_0xaa72('0x6e')][_0x221545][_0xaa72('0x33')],'path':path[_0xaa72('0x6f')](config[_0xaa72('0x70')],_0xaa72('0x71'),_0x26bdb8[_0xaa72('0x53')][_0xaa72('0x6e')][_0x221545]['basename'])};}}_0x5bc057={'account':_0x29ace2,'message':_0x26bdb8[_0xaa72('0x53')]};return;}})[_0xaa72('0x31')](function(){if(_0x39330d[_0xaa72('0x5e')]){if(_0x39330d['List'][_0xaa72('0x60')][_0xaa72('0x40')]){return _0x39330d['List'][_0xaa72('0x60')][0x0];}else{return db[_0xaa72('0x5f')][_0xaa72('0x57')](_[_0xaa72('0x14')](_0x26bdb8['body'],{'firstName':_0x26bdb8[_0xaa72('0x53')]['to'],'email':_0x26bdb8['body']['to'],'phone':_0x26bdb8[_0xaa72('0x53')]['to'],'ListId':_0x39330d[_0xaa72('0x72')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xaa72('0x31')](function(){if(_0x5bc057){return respondWithRpcPromise(_0xaa72('0x73'),_0xaa72('0x74'),_0x5bc057,client9003)[_0xaa72('0x31')](function(_0x17ee4f){return _0x2377b6['update']({'read':!![],'messageId':_0x17ee4f[_0xaa72('0x75')],'sentAt':moment()[_0xaa72('0x76')](_0xaa72('0x77'))});})[_0xaa72('0x54')](function(_0x1e4adb){logger['error']('%s',JSON['stringify'](_0x1e4adb));return _0x2377b6;});}return _0x2377b6;});}return _0x2377b6;}})[_0xaa72('0x31')](respondWithResult(_0x1ed344,0xc9))[_0xaa72('0x54')](handleError(_0x1ed344,null));};var interaction_log=require('../../config/logger')(_0xaa72('0x78'));exports[_0xaa72('0x79')]=function(_0x3f0cbe,_0x534dd5,_0x4edcad){var _0xde8ccb={'agent':{},'channel':_0xaa72('0x7a')};if(_0x3f0cbe[_0xaa72('0x53')]['id']){delete _0x3f0cbe['body']['id'];}_0x3f0cbe['body']['read']=!![];_0x3f0cbe['body'][_0xaa72('0x7b')]=moment()[_0xaa72('0x76')]('YYYY-MM-DD\x20HH:mm:ss');_0x3f0cbe[_0xaa72('0x53')]['UserId']=_0x3f0cbe['body'][_0xaa72('0x7c')]||_0x3f0cbe[_0xaa72('0x6b')]['id'];_0xde8ccb['agent']['id']=_0x3f0cbe[_0xaa72('0x53')]['UserId'];return db[_0xaa72('0x35')][_0xaa72('0x55')]({'where':{'id':_0x3f0cbe[_0xaa72('0x51')]['id'],'UserId':null},'include':[{'model':db[_0xaa72('0x5f')],'as':_0xaa72('0x7d')}]})[_0xaa72('0x31')](handleEntityNotFound(_0x534dd5,null))[_0xaa72('0x31')](saveUpdates(_0x3f0cbe[_0xaa72('0x53')],null))[_0xaa72('0x31')](function(_0x36467e){if(_0x36467e){_0xde8ccb[_0xaa72('0x24')]=_0x36467e[_0xaa72('0x7e')]({'plain':!![]});return db[_0xaa72('0x7f')][_0xaa72('0x55')]({'where':{'id':_0x36467e[_0xaa72('0x80')]}});}return null;})[_0xaa72('0x31')](handleEntityNotFound(_0x534dd5,null))[_0xaa72('0x31')](function(_0x1cfda2){if(_0x1cfda2){return _0x1cfda2[_0xaa72('0x2f')]({'UserId':_0x3f0cbe[_0xaa72('0x53')][_0xaa72('0x7c')],'read1stAt':_[_0xaa72('0x65')](_0x1cfda2[_0xaa72('0x81')])?moment()[_0xaa72('0x76')](_0xaa72('0x77')):undefined});}return null;})[_0xaa72('0x31')](function(_0xcfff11){if(_0xcfff11){_0xde8ccb[_0xaa72('0x82')]=_0xcfff11['get']({'plain':!![]});interaction_log[_0xaa72('0x1c')](_0xaa72('0x83'),_0x3f0cbe[_0xaa72('0x6b')]['id'],_0x3f0cbe[_0xaa72('0x6b')][_0xaa72('0x33')],_0x3f0cbe[_0xaa72('0x6b')][_0xaa72('0x84')],_0xde8ccb[_0xaa72('0x82')]['id'],_0x3f0cbe['body']?JSON['stringify'](_0x3f0cbe[_0xaa72('0x53')]):_0xaa72('0x85'));return respondWithRpcPromise(_0xaa72('0x86'),'acceptMessage',_0xde8ccb);}return null;})[_0xaa72('0x31')](function(_0x57b582){if(_0x57b582){if(_0x3f0cbe[_0xaa72('0x53')][_0xaa72('0x87')]){_0xde8ccb[_0xaa72('0x24')][_0xaa72('0x88')]=util[_0xaa72('0x76')]('SIP/%s',_0x3f0cbe[_0xaa72('0x6b')]['name']);_0xde8ccb[_0xaa72('0x24')][_0xaa72('0x89')]=_0xde8ccb[_0xaa72('0x89')];_0xde8ccb[_0xaa72('0x24')][_0xaa72('0x8a')]=_0xaa72('0x79');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xaa72('0x8b'),'message':_0xde8ccb[_0xaa72('0x24')]},client9002)[_0xaa72('0x31')](function(){return _0xde8ccb;});}return _0xde8ccb;}return null;})[_0xaa72('0x31')](respondWithResult(_0x534dd5,null))[_0xaa72('0x54')](handleError(_0x534dd5,null));};var interaction_log=require(_0xaa72('0x8c'))(_0xaa72('0x78'));exports[_0xaa72('0x2d')]=function(_0x43bb37,_0x67a720,_0x4f9d03){var _0x17dbd1={'agent':{},'channel':'mail'};if(_0x43bb37[_0xaa72('0x53')]['id']){delete _0x43bb37[_0xaa72('0x53')]['id'];}_0x43bb37[_0xaa72('0x53')][_0xaa72('0x7c')]=_0x43bb37['body']['UserId']||_0x43bb37[_0xaa72('0x6b')]['id'];_0x17dbd1['agent']['id']=_0x43bb37[_0xaa72('0x53')][_0xaa72('0x7c')];return db[_0xaa72('0x35')][_0xaa72('0x55')]({'where':{'id':_0x43bb37['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x67a720,null))['then'](function(_0x1a8cb8){if(_0x1a8cb8){_0x17dbd1[_0xaa72('0x24')]=_0x1a8cb8['get']({'plain':!![]});return db['MailInteraction'][_0xaa72('0x55')]({'where':{'id':_0x1a8cb8[_0xaa72('0x80')]}});}return null;})[_0xaa72('0x31')](handleEntityNotFound(_0x67a720,null))[_0xaa72('0x31')](function(_0xed9488){if(_0xed9488){_0x17dbd1[_0xaa72('0x82')]=_0xed9488[_0xaa72('0x7e')]({'plain':!![]});interaction_log[_0xaa72('0x1c')](_0xaa72('0x8d'),_0x43bb37[_0xaa72('0x6b')]['id'],_0x43bb37[_0xaa72('0x6b')][_0xaa72('0x33')],_0x43bb37['user'][_0xaa72('0x84')],_0x17dbd1[_0xaa72('0x82')]['id'],_0x43bb37[_0xaa72('0x53')]?JSON[_0xaa72('0x20')](_0x43bb37[_0xaa72('0x53')]):_0xaa72('0x85'));return respondWithRpcPromise(_0xaa72('0x8e'),_0xaa72('0x8f'),_0x17dbd1);}return null;})[_0xaa72('0x31')](function(_0x4d1e73){if(_0x4d1e73){_0x4d1e73[_0xaa72('0x24')][_0xaa72('0x88')]=util[_0xaa72('0x76')](_0xaa72('0x90'),_0x43bb37[_0xaa72('0x6b')][_0xaa72('0x33')]);_0x4d1e73[_0xaa72('0x24')][_0xaa72('0x89')]=_0x17dbd1[_0xaa72('0x89')];_0x4d1e73[_0xaa72('0x24')][_0xaa72('0x8a')]=_0xaa72('0x2d');respondWithRpcPromise(_0xaa72('0x91'),_0xaa72('0x91'),{'event':_0xaa72('0x92'),'message':_0x4d1e73[_0xaa72('0x24')]},client9002);return _0x17dbd1;}return null;})[_0xaa72('0x31')](respondWithResult(_0x67a720,null))[_0xaa72('0x54')](handleError(_0x67a720,null));};exports[_0xaa72('0x93')]=function(_0x486c7e,_0x5acee7){var _0x49c739=moment()[_0xaa72('0x94')]()[_0xaa72('0x95')]();var _0x32dbca=path[_0xaa72('0x6f')](config[_0xaa72('0x70')],_0xaa72('0x96'),_0xaa72('0x97'),'tmp');var _0x48acce=path[_0xaa72('0x6f')](config[_0xaa72('0x70')],'server',_0xaa72('0x97'),_0xaa72('0x6e'));var _0x5029c8=util[_0xaa72('0x76')](_0xaa72('0x98'),_0x49c739);return db[_0xaa72('0x35')][_0xaa72('0x55')]({'where':{'id':_0x486c7e[_0xaa72('0x51')]['id']},'attributes':['id','body','from','to','cc',_0xaa72('0x99'),_0xaa72('0x9a'),'createdAt'],'include':_0x486c7e['query'][_0xaa72('0x6e')]?[{'model':db[_0xaa72('0x9b')],'as':_0xaa72('0x9c')}]:undefined})[_0xaa72('0x31')](handleEntityNotFound(_0x5acee7,null))['then'](function(_0x16326d){if(_0x16326d){var _0x17ea87=_0x16326d;var _0x2bf4b2={'from':_0x17ea87['from'],'to':_0x17ea87['to'],'subject':_0x17ea87['subject'],'html':_0x17ea87[_0xaa72('0x53')],'headers':{'Date':moment(_0x17ea87['createdAt'])[_0xaa72('0x76')](_0xaa72('0x9d'))},'attachments':[]};if(_0x16326d['cc']){_0x2bf4b2[_0xaa72('0x9e')]['Cc']=_0x16326d['cc'];}if(_0x16326d[_0xaa72('0x99')]){_0x2bf4b2['headers'][_0xaa72('0x9f')]=_0x16326d[_0xaa72('0x99')];}return new BPromise(function(_0x3a32aa,_0x353ee5){if(_0x16326d[_0xaa72('0x9c')]){for(var _0x41685b=0x0;_0x41685b<_0x16326d[_0xaa72('0x9c')][_0xaa72('0x40')];_0x41685b++){var _0x54a663=_0x16326d[_0xaa72('0x9c')][_0x41685b];var _0x361c97=path[_0xaa72('0x6f')](_0x48acce,_0x54a663[_0xaa72('0xa0')]);if(fs[_0xaa72('0xa1')](_0x361c97)){_0x2bf4b2['attachments'][_0xaa72('0xa2')]({'name':_0x54a663[_0xaa72('0x33')],'contentType':_0x54a663[_0xaa72('0x37')],'data':fs[_0xaa72('0xa3')](_0x361c97)});}}}emlformat[_0xaa72('0xa4')](_0x2bf4b2,function(_0x219cb8,_0x241884){if(_0x219cb8)return _0x353ee5(_0x219cb8);fs[_0xaa72('0xa5')](path[_0xaa72('0x6f')](_0x32dbca,_0x5029c8),_0x241884);return _0x3a32aa(_0x241884);});});}})[_0xaa72('0x31')](function(_0x26dedc){if(_0x26dedc){return _0x5acee7['download'](path[_0xaa72('0x6f')](_0x32dbca,_0x5029c8),_0x5029c8,function(_0x1f8e0e){if(_0x1f8e0e){console[_0xaa72('0xa6')](_0xaa72('0xa7'),_0x1f8e0e);}else{fs[_0xaa72('0xa8')](path[_0xaa72('0x6f')](_0x32dbca,_0x5029c8));}});}})[_0xaa72('0x54')](handleError(_0x5acee7,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 4b17c2f..cad57eb 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 _0xdd9d=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x4368c4,_0x50351a){var _0x1c0d6c=function(_0x262c6f){while(--_0x262c6f){_0x4368c4['push'](_0x4368c4['shift']());}};_0x1c0d6c(++_0x50351a);}(_0xdd9d,0x9d));var _0xddd9=function(_0x185d4c,_0x207603){_0x185d4c=_0x185d4c-0x0;var _0x293f37=_0xdd9d[_0x185d4c];return _0x293f37;};'use strict';var EventEmitter=require(_0xddd9('0x0'));var MailMessage=require(_0xddd9('0x1'))['db'][_0xddd9('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xddd9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4a40f8){return function(_0x313994,_0x5412b3,_0x20ff64){MailMessageEvents[_0xddd9('0x4')](_0x4a40f8+':'+_0x313994['id'],_0x313994);MailMessageEvents[_0xddd9('0x4')](_0x4a40f8,_0x313994);_0x20ff64(null);};}for(var e in events){if(events[_0xddd9('0x5')](e)){var event=events[e];MailMessage[_0xddd9('0x6')](e,emitEvent(event));}}module[_0xddd9('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x1c5e=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x1c5e,0x199));var _0xe1c5=function(_0x188945,_0x2aafa5){_0x188945=_0x188945-0x0;var _0x4959c2=_0x1c5e[_0x188945];return _0x4959c2;};'use strict';var EventEmitter=require(_0xe1c5('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe1c5('0x1')](0x0);var events={'afterCreate':_0xe1c5('0x2'),'afterUpdate':_0xe1c5('0x3'),'afterDestroy':_0xe1c5('0x4')};function emitEvent(_0x30548d){return function(_0x5223e1,_0x1c3a62,_0x48b2a6){MailMessageEvents[_0xe1c5('0x5')](_0x30548d+':'+_0x5223e1['id'],_0x5223e1);MailMessageEvents[_0xe1c5('0x5')](_0x30548d,_0x5223e1);_0x48b2a6(null);};}for(var e in events){if(events[_0xe1c5('0x6')](e)){var event=events[e];MailMessage[_0xe1c5('0x7')](e,emitEvent(event));}}module[_0xe1c5('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 1510b67..c43bb24 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 _0x5eb3=['plainBody','subject','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','MailInteractionId','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages'];(function(_0x363618,_0x5ebf3a){var _0x496dee=function(_0x3b312a){while(--_0x3b312a){_0x363618['push'](_0x363618['shift']());}};_0x496dee(++_0x5ebf3a);}(_0x5eb3,0xd0));var _0x35eb=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0x5eb3[_0x34ad72];return _0x5c9aa8;};'use strict';var _=require(_0x35eb('0x0'));var util=require(_0x35eb('0x1'));var logger=require(_0x35eb('0x2'))(_0x35eb('0x3'));var moment=require(_0x35eb('0x4'));var BPromise=require(_0x35eb('0x5'));var rp=require(_0x35eb('0x6'));var htmlToText=require(_0x35eb('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0x35eb('0x8'));var config=require(_0x35eb('0x9'));var attributes=require(_0x35eb('0xa'));module[_0x35eb('0xb')]=function(_0x2a8d75,_0x45a283){return _0x2a8d75[_0x35eb('0xc')](_0x35eb('0xd'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x35eb('0xe'),'fields':[_0x35eb('0xe')]},{'name':_0x35eb('0xf'),'fields':[_0x35eb('0x10'),_0x35eb('0x11')],'type':_0x35eb('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17d485,_0x11587f,_0x42bb21){if(_0x17d485['body']){_0x17d485[_0x35eb('0x10')]=htmlToText['fromString'](_0x17d485['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x42bb21(null,_0x11587f);},'afterCreate':function(_0x2267b4,_0xc51210,_0x234265){var _0x11ea04=_0x2a8d75[_0x35eb('0x13')];var _0x1d927a=_0x2267b4[_0x35eb('0x14')]({'plain':!![]});if(_0x1d927a[_0x35eb('0x15')][_0x35eb('0x16')]()==='in'||_0x1d927a[_0x35eb('0x15')][_0x35eb('0x16')]()===_0x35eb('0x17')&&!_0x1d927a[_0x35eb('0x18')]&&!_[_0x35eb('0x19')](_0x1d927a[_0x35eb('0x1a')])){_0x11ea04['MailInteraction'][_0x35eb('0x1b')]({'where':{'id':_0x1d927a[_0x35eb('0x1c')]}})['then'](function(_0x18d470){if(_0x18d470){_0x18d470['update']({'lastMsgAt':_0x1d927a['createdAt'],'lastMsgDirection':_0x1d927a[_0x35eb('0x15')][_0x35eb('0x16')]()});}})[_0x35eb('0x1d')](function(_0x247e2e){console[_0x35eb('0x1e')](_0x247e2e);});}_0x234265();}},'charset':_0x35eb('0x1f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5a21=['html-to-text','path','../../config/environment','./mailMessage.attributes','define','mail_messages','messageId','plainBody','subject','FULLTEXT','body','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise'];(function(_0x1ba7b9,_0x537356){var _0x153e5e=function(_0x2769f2){while(--_0x2769f2){_0x1ba7b9['push'](_0x1ba7b9['shift']());}};_0x153e5e(++_0x537356);}(_0x5a21,0xcd));var _0x15a2=function(_0xbf07b8,_0x4fc2c6){_0xbf07b8=_0xbf07b8-0x0;var _0x17aef8=_0x5a21[_0xbf07b8];return _0x17aef8;};'use strict';var _=require(_0x15a2('0x0'));var util=require(_0x15a2('0x1'));var logger=require(_0x15a2('0x2'))(_0x15a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x15a2('0x4'));var htmlToText=require(_0x15a2('0x5'));var fs=require('fs');var path=require(_0x15a2('0x6'));var rimraf=require('rimraf');var config=require(_0x15a2('0x7'));var attributes=require(_0x15a2('0x8'));module['exports']=function(_0xcf83ba,_0x34570a){return _0xcf83ba[_0x15a2('0x9')]('MailMessage',attributes,{'tableName':_0x15a2('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x15a2('0xb')]},{'name':'fti_mail_messages','fields':[_0x15a2('0xc'),_0x15a2('0xd')],'type':_0x15a2('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2bd358,_0x40c6cf,_0x3ca03b){if(_0x2bd358[_0x15a2('0xf')]){_0x2bd358[_0x15a2('0xc')]=htmlToText['fromString'](_0x2bd358['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3ca03b(null,_0x40c6cf);},'afterCreate':function(_0x33c81c,_0x2daf39,_0x6596da){var _0x3aee2b=_0xcf83ba['models'];var _0xed5547=_0x33c81c['get']({'plain':!![]});if(_0xed5547['direction']['toLowerCase']()==='in'||_0xed5547[_0x15a2('0x10')][_0x15a2('0x11')]()===_0x15a2('0x12')&&!_0xed5547[_0x15a2('0x13')]&&!_[_0x15a2('0x14')](_0xed5547[_0x15a2('0x15')])){_0x3aee2b[_0x15a2('0x16')][_0x15a2('0x17')]({'where':{'id':_0xed5547[_0x15a2('0x18')]}})[_0x15a2('0x19')](function(_0x4d528d){if(_0x4d528d){_0x4d528d['update']({'lastMsgAt':_0xed5547[_0x15a2('0x1a')],'lastMsgDirection':_0xed5547['direction']['toLowerCase']()});}})[_0x15a2('0x1b')](function(_0x105ec5){console['error'](_0x105ec5);});}_0x6596da();}},'charset':_0x15a2('0x1c'),'collate':_0x15a2('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 07db954..d1b98bc 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 _0x0773=['register','request','info','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailMessage.socket'];(function(_0xfdce49,_0x108d3e){var _0x1e93bb=function(_0x455c5d){while(--_0x455c5d){_0xfdce49['push'](_0xfdce49['shift']());}};_0x1e93bb(++_0x108d3e);}(_0x0773,0x1da));var _0x3077=function(_0x3d7bbd,_0x2b2f29){_0x3d7bbd=_0x3d7bbd-0x0;var _0x5c1c28=_0x0773[_0x3d7bbd];return _0x5c1c28;};'use strict';var _=require(_0x3077('0x0'));var util=require(_0x3077('0x1'));var moment=require(_0x3077('0x2'));var BPromise=require(_0x3077('0x3'));var rs=require(_0x3077('0x4'));var fs=require('fs');var Redis=require(_0x3077('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3077('0x6'));var logger=require(_0x3077('0x7'))(_0x3077('0x8'));var config=require(_0x3077('0x9'));var jayson=require(_0x3077('0xa'));var client=jayson[_0x3077('0xb')]['http']({'port':0x232a});config[_0x3077('0xc')]=_['defaults'](config[_0x3077('0xc')],{'host':_0x3077('0xd'),'port':0x18eb});var socket=require(_0x3077('0xe'))(new Redis(config['redis']));require(_0x3077('0xf'))[_0x3077('0x10')](socket);function respondWithRpcPromise(_0x2ce3d4,_0x58ad6e,_0x2916c9){return new BPromise(function(_0x1e4f8a,_0x134fdf){return client[_0x3077('0x11')](_0x2ce3d4,_0x2916c9)['then'](function(_0x335b53){logger[_0x3077('0x12')]('MailMessage,\x20%s,\x20%s',_0x58ad6e,'request\x20sent');logger['debug'](_0x3077('0x13'),_0x58ad6e,_0x3077('0x14'),JSON['stringify'](_0x335b53));if(_0x335b53[_0x3077('0x15')]){if(_0x335b53['error'][_0x3077('0x16')]===0x1f4){logger['error'](_0x3077('0x17'),_0x58ad6e,_0x335b53[_0x3077('0x15')][_0x3077('0x18')]);return _0x134fdf(_0x335b53[_0x3077('0x15')][_0x3077('0x18')]);}logger[_0x3077('0x15')](_0x3077('0x17'),_0x58ad6e,_0x335b53[_0x3077('0x15')][_0x3077('0x18')]);return _0x1e4f8a(_0x335b53[_0x3077('0x15')][_0x3077('0x18')]);}else{logger[_0x3077('0x12')]('MailMessage,\x20%s,\x20%s',_0x58ad6e,'request\x20sent');_0x1e4f8a(_0x335b53[_0x3077('0x19')][_0x3077('0x18')]);}})[_0x3077('0x1a')](function(_0xfd10e){logger[_0x3077('0x15')](_0x3077('0x17'),_0x58ad6e,_0xfd10e);_0x134fdf(_0xfd10e);});});}exports[_0x3077('0x1b')]=function(_0xcd167){var _0x4338aa=this;return new Promise(function(_0x27643f,_0x5a625c){return db[_0x3077('0x1c')][_0x3077('0x1d')](_0xcd167[_0x3077('0x1e')],{'raw':_0xcd167[_0x3077('0x1f')]?_0xcd167[_0x3077('0x1f')][_0x3077('0x20')]===undefined?!![]:![]:!![]})[_0x3077('0x21')](function(_0x34d285){logger[_0x3077('0x12')]('CreateMailMessage',_0xcd167);logger['debug'](_0x3077('0x1b'),_0xcd167,JSON[_0x3077('0x22')](_0x34d285));_0x27643f(_0x34d285);})[_0x3077('0x1a')](function(_0x58f9f9){logger[_0x3077('0x15')](_0x3077('0x1b'),_0x58f9f9[_0x3077('0x18')],_0xcd167);_0x5a625c(_0x4338aa[_0x3077('0x15')](0x1f4,_0x58f9f9[_0x3077('0x18')]));});});}; \ No newline at end of file +var _0x20ef=['message','result','CreateMailMessage','MailMessage','body','options','raw','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3916ca,_0x55c711){var _0x15d121=function(_0x56bd38){while(--_0x56bd38){_0x3916ca['push'](_0x3916ca['shift']());}};_0x15d121(++_0x55c711);}(_0x20ef,0x9e));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf20e('0x0'));var moment=require(_0xf20e('0x1'));var BPromise=require('bluebird');var rs=require(_0xf20e('0x2'));var fs=require('fs');var Redis=require(_0xf20e('0x3'));var db=require(_0xf20e('0x4'))['db'];var utils=require(_0xf20e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf20e('0x6'));var jayson=require(_0xf20e('0x7'));var client=jayson[_0xf20e('0x8')][_0xf20e('0x9')]({'port':0x232a});config[_0xf20e('0xa')]=_['defaults'](config[_0xf20e('0xa')],{'host':_0xf20e('0xb'),'port':0x18eb});var socket=require(_0xf20e('0xc'))(new Redis(config[_0xf20e('0xa')]));require(_0xf20e('0xd'))[_0xf20e('0xe')](socket);function respondWithRpcPromise(_0x1771fc,_0x19879c,_0x5959cd){return new BPromise(function(_0x42bc9d,_0x454b31){return client['request'](_0x1771fc,_0x5959cd)['then'](function(_0xa75de2){logger[_0xf20e('0xf')](_0xf20e('0x10'),_0x19879c,'request\x20sent');logger[_0xf20e('0x11')](_0xf20e('0x12'),_0x19879c,_0xf20e('0x13'),JSON[_0xf20e('0x14')](_0xa75de2));if(_0xa75de2['error']){if(_0xa75de2[_0xf20e('0x15')]['code']===0x1f4){logger[_0xf20e('0x15')]('MailMessage,\x20%s,\x20%s',_0x19879c,_0xa75de2[_0xf20e('0x15')][_0xf20e('0x16')]);return _0x454b31(_0xa75de2[_0xf20e('0x15')][_0xf20e('0x16')]);}logger[_0xf20e('0x15')]('MailMessage,\x20%s,\x20%s',_0x19879c,_0xa75de2[_0xf20e('0x15')][_0xf20e('0x16')]);return _0x42bc9d(_0xa75de2['error']['message']);}else{logger[_0xf20e('0xf')](_0xf20e('0x10'),_0x19879c,'request\x20sent');_0x42bc9d(_0xa75de2[_0xf20e('0x17')]['message']);}})['catch'](function(_0x5e2b75){logger['error'](_0xf20e('0x10'),_0x19879c,_0x5e2b75);_0x454b31(_0x5e2b75);});});}exports[_0xf20e('0x18')]=function(_0x2941cf){var _0x47d65c=this;return new Promise(function(_0x29358c,_0x3f39a0){return db[_0xf20e('0x19')]['create'](_0x2941cf[_0xf20e('0x1a')],{'raw':_0x2941cf[_0xf20e('0x1b')]?_0x2941cf['options'][_0xf20e('0x1c')]===undefined?!![]:![]:!![]})[_0xf20e('0x1d')](function(_0x48b8cc){logger[_0xf20e('0xf')]('CreateMailMessage',_0x2941cf);logger[_0xf20e('0x11')](_0xf20e('0x18'),_0x2941cf,JSON[_0xf20e('0x14')](_0x48b8cc));_0x29358c(_0x48b8cc);})['catch'](function(_0x2cdb84){logger[_0xf20e('0x15')]('CreateMailMessage',_0x2cdb84[_0xf20e('0x16')],_0x2941cf);_0x3f39a0(_0x47d65c['error'](0x1f4,_0x2cdb84[_0xf20e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 6ac7477..47a4f51 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 _0xa292=['update','emit','removeListener','register','length','mailMessage:','./mailMessage.events','remove'];(function(_0x493817,_0x15e98e){var _0x5b4944=function(_0x21e930){while(--_0x21e930){_0x493817['push'](_0x493817['shift']());}};_0x5b4944(++_0x15e98e);}(_0xa292,0x9e));var _0x2a29=function(_0x152330,_0x2c86d1){_0x152330=_0x152330-0x0;var _0xc44ae3=_0xa292[_0x152330];return _0xc44ae3;};'use strict';var MailMessageEvents=require(_0x2a29('0x0'));var events=['save',_0x2a29('0x1'),_0x2a29('0x2')];function createListener(_0x3f6862,_0xb6b4d4){return function(_0xc84337){_0xb6b4d4[_0x2a29('0x3')](_0x3f6862,_0xc84337);};}function removeListener(_0xe96b4,_0x48bdc8){return function(){MailMessageEvents[_0x2a29('0x4')](_0xe96b4,_0x48bdc8);};}exports[_0x2a29('0x5')]=function(_0x5abc1c){for(var _0x547b6c=0x0,_0x3cc261=events[_0x2a29('0x6')];_0x547b6c<_0x3cc261;_0x547b6c++){var _0x32e100=events[_0x547b6c];var _0x3a3e2e=createListener(_0x2a29('0x7')+_0x32e100,_0x5abc1c);MailMessageEvents['on'](_0x32e100,_0x3a3e2e);}}; \ No newline at end of file +var _0xb05d=['remove','update','emit','removeListener','register','./mailMessage.events'];(function(_0x1c9c4f,_0x26201a){var _0xc9d9ba=function(_0x31b2e8){while(--_0x31b2e8){_0x1c9c4f['push'](_0x1c9c4f['shift']());}};_0xc9d9ba(++_0x26201a);}(_0xb05d,0x1d9));var _0xdb05=function(_0x3d73ba,_0x356e23){_0x3d73ba=_0x3d73ba-0x0;var _0x47e406=_0xb05d[_0x3d73ba];return _0x47e406;};'use strict';var MailMessageEvents=require(_0xdb05('0x0'));var events=['save',_0xdb05('0x1'),_0xdb05('0x2')];function createListener(_0x4a01e0,_0x216434){return function(_0x2f849d){_0x216434[_0xdb05('0x3')](_0x4a01e0,_0x2f849d);};}function removeListener(_0xc8df08,_0x43bc54){return function(){MailMessageEvents[_0xdb05('0x4')](_0xc8df08,_0x43bc54);};}exports[_0xdb05('0x5')]=function(_0x55db08){for(var _0x59a0bf=0x0,_0x116a84=events['length'];_0x59a0bf<_0x116a84;_0x59a0bf++){var _0x23ef24=events[_0x59a0bf];var _0x5e32cf=createListener('mailMessage:'+_0x23ef24,_0x55db08);MailMessageEvents['on'](_0x23ef24,_0x5e32cf);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 85d8293..4beda0d 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 _0xb010=['/:id/teams','addTeams','addAgents','put','update','delete','destroy','/:id/users','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getTeams','post','create'];(function(_0x2d2d37,_0x5778a6){var _0x55bbce=function(_0x319445){while(--_0x319445){_0x2d2d37['push'](_0x2d2d37['shift']());}};_0x55bbce(++_0x5778a6);}(_0xb010,0x19e));var _0x0b01=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb010[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x0b01('0x0'));var util=require(_0x0b01('0x1'));var path=require(_0x0b01('0x2'));var timeout=require(_0x0b01('0x3'));var express=require('express');var router=express[_0x0b01('0x4')]();var fs_extra=require(_0x0b01('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0b01('0x6'));var config=require(_0x0b01('0x7'));var controller=require('./mailQueue.controller');router[_0x0b01('0x8')]('/',auth[_0x0b01('0x9')](),controller['index']);router[_0x0b01('0x8')](_0x0b01('0xa'),auth[_0x0b01('0x9')](),controller[_0x0b01('0xb')]);router[_0x0b01('0x8')](_0x0b01('0xc'),auth[_0x0b01('0x9')](),controller[_0x0b01('0xd')]);router[_0x0b01('0x8')](_0x0b01('0xe'),auth[_0x0b01('0x9')](),controller['getMembers']);router[_0x0b01('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x0b01('0xf')]);router['get']('/:id/users',auth[_0x0b01('0x9')](),controller['getAgents']);router[_0x0b01('0x10')]('/',auth[_0x0b01('0x9')](),controller[_0x0b01('0x11')]);router[_0x0b01('0x10')](_0x0b01('0x12'),auth[_0x0b01('0x9')](),controller[_0x0b01('0x13')]);router[_0x0b01('0x10')]('/:id/users',auth[_0x0b01('0x9')](),controller[_0x0b01('0x14')]);router[_0x0b01('0x15')](_0x0b01('0xc'),auth[_0x0b01('0x9')](),controller[_0x0b01('0x16')]);router[_0x0b01('0x17')](_0x0b01('0xc'),auth['isAuthenticated'](),controller[_0x0b01('0x18')]);router[_0x0b01('0x17')](_0x0b01('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x0b01('0x17')](_0x0b01('0x19'),auth[_0x0b01('0x9')](),controller['removeAgents']);module[_0x0b01('0x1a')]=router; \ No newline at end of file +var _0xd318=['/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','update','destroy','removeTeams','delete','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index'];(function(_0x5501a1,_0x4729e7){var _0x546089=function(_0x4a6d96){while(--_0x4a6d96){_0x5501a1['push'](_0x5501a1['shift']());}};_0x546089(++_0x4729e7);}(_0xd318,0xaf));var _0x8d31=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd318[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x8d31('0x0'));var path=require(_0x8d31('0x1'));var timeout=require(_0x8d31('0x2'));var express=require('express');var router=express[_0x8d31('0x3')]();var fs_extra=require(_0x8d31('0x4'));var auth=require(_0x8d31('0x5'));var interaction=require(_0x8d31('0x6'));var config=require('../../config/environment');var controller=require(_0x8d31('0x7'));router[_0x8d31('0x8')]('/',auth[_0x8d31('0x9')](),controller[_0x8d31('0xa')]);router[_0x8d31('0x8')](_0x8d31('0xb'),auth[_0x8d31('0x9')](),controller[_0x8d31('0xc')]);router['get'](_0x8d31('0xd'),auth[_0x8d31('0x9')](),controller[_0x8d31('0xe')]);router[_0x8d31('0x8')](_0x8d31('0xf'),auth[_0x8d31('0x9')](),controller[_0x8d31('0x10')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x8d31('0x11')]);router[_0x8d31('0x8')](_0x8d31('0x12'),auth['isAuthenticated'](),controller[_0x8d31('0x13')]);router[_0x8d31('0x14')]('/',auth[_0x8d31('0x9')](),controller[_0x8d31('0x15')]);router[_0x8d31('0x14')](_0x8d31('0x16'),auth['isAuthenticated'](),controller[_0x8d31('0x17')]);router[_0x8d31('0x14')]('/:id/users',auth[_0x8d31('0x9')](),controller['addAgents']);router[_0x8d31('0x18')](_0x8d31('0xd'),auth[_0x8d31('0x9')](),controller[_0x8d31('0x19')]);router['delete'](_0x8d31('0xd'),auth['isAuthenticated'](),controller[_0x8d31('0x1a')]);router['delete'](_0x8d31('0x16'),auth[_0x8d31('0x9')](),controller[_0x8d31('0x1b')]);router[_0x8d31('0x1c')](_0x8d31('0x12'),auth[_0x8d31('0x9')](),controller[_0x8d31('0x1d')]);module[_0x8d31('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index c511ede..20ca8d7 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 _0x9303=['sequelize','name','INTEGER','beepall','roundrobin'];(function(_0x25141b,_0x1d9fc2){var _0x13df65=function(_0x18d2a7){while(--_0x18d2a7){_0x25141b['push'](_0x25141b['shift']());}};_0x13df65(++_0x1d9fc2);}(_0x9303,0xd7));var _0x3930=function(_0xb40c4f,_0x5231f2){_0xb40c4f=_0xb40c4f-0x0;var _0x1d5f81=_0x9303[_0xb40c4f];return _0x1d5f81;};'use strict';var Sequelize=require(_0x3930('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3930('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3930('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x3930('0x3'),_0x3930('0x4'))}}; \ No newline at end of file +var _0xedca=['STRING','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x485602,_0x366cce){var _0xe0a521=function(_0x2ae4cd){while(--_0x2ae4cd){_0x485602['push'](_0x485602['shift']());}};_0xe0a521(++_0x366cce);}(_0xedca,0xc9));var _0xaedc=function(_0x6ab57c,_0x431730){_0x6ab57c=_0x6ab57c-0x0;var _0x23caa6=_0xedca[_0x6ab57c];return _0x23caa6;};'use strict';var Sequelize=require(_0xaedc('0x0'));module[_0xaedc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xaedc('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaedc('0x3')](_0xaedc('0x4'),_0xaedc('0x5'),_0xaedc('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 284e0b6..f13a27d 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 _0x3322=['Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','map','MailQueue','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','keys','nolimit','MailQueueId','UserMailQueue','User','findAndCountAll','agent','updatedAt','format','%s/%s','SIP','mailPause','createdAt','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','userMailQueue:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','union','value','removeTeams','ids','isEmpty','removeAgents','addAgents','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','status','end','json','offset','limit'];(function(_0x311496,_0x4bc87f){var _0x5a08e4=function(_0x10d2fa){while(--_0x10d2fa){_0x311496['push'](_0x311496['shift']());}};_0x5a08e4(++_0x4bc87f);}(_0x3322,0x6d));var _0x2332=function(_0xb37079,_0x292ff0){_0xb37079=_0xb37079-0x0;var _0x18f2ff=_0x3322[_0xb37079];return _0x18f2ff;};'use strict';var emlformat=require(_0x2332('0x0'));var rimraf=require(_0x2332('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2332('0x2'));var rp=require(_0x2332('0x3'));var moment=require(_0x2332('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2332('0x5'));var util=require(_0x2332('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2332('0x7'));var fs=require('fs');var fs_extra=require(_0x2332('0x8'));var _=require('lodash');var squel=require(_0x2332('0x9'));var crypto=require(_0x2332('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2332('0xb'));var querystring=require(_0x2332('0xc'));var Papa=require(_0x2332('0xd'));var Redis=require('ioredis');var authService=require(_0x2332('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2332('0xf'));var hardwareService=require(_0x2332('0x10'));var logger=require('../../config/logger')(_0x2332('0x11'));var utils=require(_0x2332('0x12'));var config=require(_0x2332('0x13'));var licenseUtil=require(_0x2332('0x14'));var db=require(_0x2332('0x15'))['db'];config[_0x2332('0x16')]=_[_0x2332('0x17')](config[_0x2332('0x16')],{'host':_0x2332('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2332('0x16')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x3b532d,_0x11b65b){_0x11b65b=_0x11b65b||0xcc;return function(_0x4eacd7){if(_0x4eacd7){return _0x3b532d['sendStatus'](_0x11b65b);}return _0x3b532d[_0x2332('0x19')](_0x11b65b)[_0x2332('0x1a')]();};}function respondWithResult(_0xd95610,_0x24613c){_0x24613c=_0x24613c||0xc8;return function(_0x285e71){if(_0x285e71){return _0xd95610[_0x2332('0x19')](_0x24613c)[_0x2332('0x1b')](_0x285e71);}};}function respondWithFilteredResult(_0x128f1e,_0x28757d){return function(_0x263347){if(_0x263347){var _0x10b086=_0x263347['count'],_0x365682=_0x28757d[_0x2332('0x1c')],_0x213801=_0x28757d[_0x2332('0x1c')]+_0x28757d[_0x2332('0x1d')],_0x3133cd;if(_0x213801>=_0x10b086){_0x213801=_0x10b086;_0x3133cd=0xc8;}else{_0x3133cd=0xce;}_0x128f1e[_0x2332('0x19')](_0x3133cd);return _0x128f1e['set'](_0x2332('0x1e'),_0x365682+'-'+_0x213801+'/'+_0x10b086)[_0x2332('0x1b')](_0x263347);}return null;};}function patchUpdates(_0x19978c){return function(_0x1321eb){try{jsonpatch[_0x2332('0x1f')](_0x1321eb,_0x19978c,!![]);}catch(_0x43422c){return BPromise[_0x2332('0x20')](_0x43422c);}return _0x1321eb[_0x2332('0x21')]();};}function saveUpdates(_0x1181ab,_0x4f5881){return function(_0x1c7bfe){if(_0x1c7bfe){return _0x1c7bfe[_0x2332('0x22')](_0x1181ab)[_0x2332('0x23')](function(_0x3bce16){return _0x3bce16;});}return null;};}function removeEntity(_0x53cd15,_0x2929d7){return function(_0x5bbf50){if(_0x5bbf50){return _0x5bbf50[_0x2332('0x24')]()['then'](function(){var _0x16157b=_0x5bbf50[_0x2332('0x25')]({'plain':!![]});var _0x384b2a='MailQueues';return db[_0x2332('0x26')][_0x2332('0x24')]({'where':{'type':_0x384b2a,'resourceId':_0x16157b['id']}})['then'](function(){return _0x5bbf50;});})['then'](function(){_0x53cd15[_0x2332('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48fe65,_0x1d9e8a){return function(_0x3df893){if(!_0x3df893){_0x48fe65[_0x2332('0x27')](0x194);}return _0x3df893;};}function handleError(_0x1a9b08,_0xe3a54c){_0xe3a54c=_0xe3a54c||0x1f4;return function(_0x28afec){logger[_0x2332('0x28')](_0x28afec[_0x2332('0x29')]);if(_0x28afec[_0x2332('0x2a')]){delete _0x28afec['name'];}_0x1a9b08[_0x2332('0x19')](_0xe3a54c)[_0x2332('0x2b')](_0x28afec);};}exports['index']=function(_0x4e3f3f,_0x48f3ea){var _0x5705e6={},_0x19b5a2={},_0x5f1c9c={'count':0x0,'rows':[]};var _0x21a386=_[_0x2332('0x2c')](db[_0x2332('0x2d')][_0x2332('0x2e')],function(_0x21ab96){return{'name':_0x21ab96[_0x2332('0x2f')],'type':_0x21ab96[_0x2332('0x30')]['key']};});_0x19b5a2[_0x2332('0x31')]=_['map'](_0x21a386,_0x2332('0x2a'));_0x19b5a2[_0x2332('0x32')]=_['keys'](_0x4e3f3f[_0x2332('0x32')]);_0x19b5a2[_0x2332('0x33')]=_['intersection'](_0x19b5a2[_0x2332('0x31')],_0x19b5a2[_0x2332('0x32')]);_0x5705e6[_0x2332('0x34')]=_[_0x2332('0x35')](_0x19b5a2[_0x2332('0x31')],qs['fields'](_0x4e3f3f[_0x2332('0x32')][_0x2332('0x36')]));_0x5705e6[_0x2332('0x34')]=_0x5705e6[_0x2332('0x34')][_0x2332('0x37')]?_0x5705e6[_0x2332('0x34')]:_0x19b5a2['model'];if(!_0x4e3f3f[_0x2332('0x32')][_0x2332('0x38')]('nolimit')){_0x5705e6[_0x2332('0x1d')]=qs['limit'](_0x4e3f3f[_0x2332('0x32')]['limit']);_0x5705e6[_0x2332('0x1c')]=qs['offset'](_0x4e3f3f[_0x2332('0x32')][_0x2332('0x1c')]);}_0x5705e6[_0x2332('0x39')]=qs[_0x2332('0x3a')](_0x4e3f3f[_0x2332('0x32')]['sort']);_0x5705e6[_0x2332('0x3b')]=qs[_0x2332('0x33')](_[_0x2332('0x3c')](_0x4e3f3f['query'],_0x19b5a2['filters']),_0x21a386);if(_0x4e3f3f['query'][_0x2332('0x3d')]){_0x5705e6[_0x2332('0x3b')]=_[_0x2332('0x3e')](_0x5705e6[_0x2332('0x3b')],{'$or':_[_0x2332('0x2c')](_0x21a386,function(_0x3184a4){if(_0x3184a4[_0x2332('0x30')]!==_0x2332('0x3f')){var _0x48ee9e={};_0x48ee9e[_0x3184a4['name']]={'$like':'%'+_0x4e3f3f[_0x2332('0x32')][_0x2332('0x3d')]+'%'};return _0x48ee9e;}})});}_0x5705e6=_[_0x2332('0x3e')]({},_0x5705e6,_0x4e3f3f[_0x2332('0x40')]);var _0x21c2c0={'where':_0x5705e6['where']};return db['MailQueue'][_0x2332('0x41')](_0x21c2c0)[_0x2332('0x23')](function(_0xa88841){_0x5f1c9c[_0x2332('0x41')]=_0xa88841;if(_0x4e3f3f['query'][_0x2332('0x42')]){_0x5705e6[_0x2332('0x43')]=[{'all':!![]}];}return db[_0x2332('0x2d')][_0x2332('0x44')](_0x5705e6);})[_0x2332('0x23')](function(_0x2e75cb){_0x5f1c9c[_0x2332('0x45')]=_0x2e75cb;return _0x5f1c9c;})['then'](respondWithFilteredResult(_0x48f3ea,_0x5705e6))[_0x2332('0x46')](handleError(_0x48f3ea,null));};exports[_0x2332('0x47')]=function(_0x215cc6,_0x10f181){var _0x1eb4fc={'raw':!![],'where':{'id':_0x215cc6[_0x2332('0x48')]['id']}},_0x2167ce={};_0x2167ce[_0x2332('0x31')]=_['keys'](db[_0x2332('0x2d')][_0x2332('0x2e')]);_0x2167ce[_0x2332('0x32')]=_['keys'](_0x215cc6['query']);_0x2167ce[_0x2332('0x33')]=_[_0x2332('0x35')](_0x2167ce['model'],_0x2167ce[_0x2332('0x32')]);_0x1eb4fc[_0x2332('0x34')]=_[_0x2332('0x35')](_0x2167ce[_0x2332('0x31')],qs[_0x2332('0x36')](_0x215cc6[_0x2332('0x32')][_0x2332('0x36')]));_0x1eb4fc[_0x2332('0x34')]=_0x1eb4fc[_0x2332('0x34')]['length']?_0x1eb4fc[_0x2332('0x34')]:_0x2167ce[_0x2332('0x31')];if(_0x215cc6[_0x2332('0x32')]['includeAll']){_0x1eb4fc[_0x2332('0x43')]=[{'all':!![]}];}_0x1eb4fc=_[_0x2332('0x3e')]({},_0x1eb4fc,_0x215cc6['options']);return db[_0x2332('0x2d')][_0x2332('0x49')](_0x1eb4fc)['then'](handleEntityNotFound(_0x10f181,null))[_0x2332('0x23')](respondWithResult(_0x10f181,null))['catch'](handleError(_0x10f181,null));};exports[_0x2332('0x4a')]=function(_0x3d52d0,_0x489b7a){return db[_0x2332('0x2d')][_0x2332('0x4a')](_0x3d52d0['body'],{})['then'](function(_0x5f3c44){var _0x1f6107=_0x3d52d0['user'][_0x2332('0x25')]({'plain':!![]});if(!_0x1f6107)throw new Error(_0x2332('0x4b'));if(_0x1f6107[_0x2332('0x4c')]===_0x2332('0x4d')){var _0x6366bb=_0x5f3c44[_0x2332('0x25')]({'plain':!![]});var _0xfb5e05=_0x2332('0x4e');return db[_0x2332('0x4f')][_0x2332('0x49')]({'where':{'name':_0xfb5e05,'userProfileId':_0x1f6107[_0x2332('0x50')]},'raw':!![]})['then'](function(_0x45c973){if(_0x45c973&&_0x45c973[_0x2332('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x6366bb[_0x2332('0x2a')],'resourceId':_0x6366bb['id'],'type':_0x45c973['name'],'sectionId':_0x45c973['id']},{})['then'](function(){return _0x5f3c44;});}else{return _0x5f3c44;}})[_0x2332('0x46')](function(_0x5a744f){logger[_0x2332('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a744f);throw _0x5a744f;});}return _0x5f3c44;})[_0x2332('0x23')](respondWithResult(_0x489b7a,0xc9))[_0x2332('0x46')](handleError(_0x489b7a,null));};exports['update']=function(_0x1a957f,_0x4b888d){if(_0x1a957f[_0x2332('0x52')]['id']){delete _0x1a957f[_0x2332('0x52')]['id'];}return db[_0x2332('0x2d')]['find']({'where':{'id':_0x1a957f[_0x2332('0x48')]['id']}})[_0x2332('0x23')](handleEntityNotFound(_0x4b888d,null))[_0x2332('0x23')](saveUpdates(_0x1a957f[_0x2332('0x52')],null))[_0x2332('0x23')](respondWithResult(_0x4b888d,null))[_0x2332('0x46')](handleError(_0x4b888d,null));};exports['destroy']=function(_0x27a1d8,_0x33f3d3){return db[_0x2332('0x2d')][_0x2332('0x49')]({'where':{'id':_0x27a1d8[_0x2332('0x48')]['id']}})['then'](handleEntityNotFound(_0x33f3d3,null))[_0x2332('0x23')](removeEntity(_0x33f3d3,null))[_0x2332('0x46')](handleError(_0x33f3d3,null));};exports[_0x2332('0x53')]=function(_0xfa1218,_0x479bd6){return db['MailQueue']['describe']()['then'](respondWithResult(_0x479bd6,null))['catch'](handleError(_0x479bd6,null));};exports[_0x2332('0x54')]=function(_0x31fd9e,_0x29520a,_0x4adfaa){var _0x3b0732={'raw':!![],'where':{}},_0x4266dd={},_0x410986;return db['MailQueue'][_0x2332('0x55')]({'where':{'id':_0x31fd9e[_0x2332('0x48')]['id']}})[_0x2332('0x23')](handleEntityNotFound(_0x29520a,null))[_0x2332('0x23')](function(_0x2cecf4){if(_0x2cecf4){_0x410986=_0x2cecf4[_0x2332('0x25')]({'plain':!![]});_0x4266dd['model']=_[_0x2332('0x56')](db['UserMailQueue'][_0x2332('0x2e')]);_0x4266dd['query']=_[_0x2332('0x56')](_0x31fd9e['query']);_0x4266dd[_0x2332('0x33')]=_['intersection'](_0x4266dd[_0x2332('0x31')],_0x4266dd['query']);_0x3b0732[_0x2332('0x34')]=_[_0x2332('0x35')](_0x4266dd[_0x2332('0x31')],qs[_0x2332('0x36')](_0x31fd9e[_0x2332('0x32')][_0x2332('0x36')]));_0x3b0732[_0x2332('0x34')]=_0x3b0732['attributes'][_0x2332('0x37')]?_0x3b0732[_0x2332('0x34')]:_0x4266dd[_0x2332('0x31')];if(!_0x31fd9e[_0x2332('0x32')][_0x2332('0x38')](_0x2332('0x57'))){_0x3b0732[_0x2332('0x1d')]=qs[_0x2332('0x1d')](_0x31fd9e[_0x2332('0x32')]['limit']);_0x3b0732['offset']=qs[_0x2332('0x1c')](_0x31fd9e[_0x2332('0x32')][_0x2332('0x1c')]);}_0x3b0732[_0x2332('0x39')]=qs['sort'](_0x31fd9e['query'][_0x2332('0x3a')]);_0x3b0732[_0x2332('0x3b')]=qs['filters'](_[_0x2332('0x3c')](_0x31fd9e[_0x2332('0x32')],_0x4266dd['filters']));_0x3b0732['where'][_0x2332('0x58')]=_0x2cecf4['id'];if(_0x31fd9e[_0x2332('0x32')][_0x2332('0x3d')]){_0x3b0732[_0x2332('0x3b')]=_[_0x2332('0x3e')](_0x3b0732['where'],{'$or':_['map'](_0x3b0732[_0x2332('0x34')],function(_0x4f2f0d){var _0x33cf53={};_0x33cf53[_0x4f2f0d]={'$like':'%'+_0x31fd9e['query'][_0x2332('0x3d')]+'%'};return _0x33cf53;})});}_0x3b0732=_['merge']({},_0x3b0732,_0x31fd9e[_0x2332('0x40')]);return db[_0x2332('0x59')][_0x2332('0x44')](_0x3b0732);}})[_0x2332('0x23')](function(_0x3e5e85){if(_0x3e5e85){return db[_0x2332('0x5a')][_0x2332('0x5b')]({'where':{'id':_[_0x2332('0x2c')](_0x3e5e85,'UserId'),'role':_0x2332('0x5c')},'attributes':['id',_0x2332('0x2a'),'mailPause',_0x2332('0x5d'),'createdAt']});}})[_0x2332('0x23')](function(_0x4af233){if(_0x4af233){return{'count':_0x4af233['count'],'rows':_['map'](_0x4af233[_0x2332('0x45')],function(_0x50a44b){return{'membername':_0x50a44b['name'],'UserId':_0x50a44b['id'],'queue_name':_0x410986[_0x2332('0x2a')],'MailQueueId':_0x410986['id'],'interface':util[_0x2332('0x5e')](_0x2332('0x5f'),_0x2332('0x60'),_0x50a44b[_0x2332('0x2a')]),'penalty':0x0,'paused':_0x50a44b[_0x2332('0x61')],'createdAt':_0x50a44b[_0x2332('0x62')],'updatedAt':_0x50a44b[_0x2332('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2332('0x23')](respondWithFilteredResult(_0x29520a,_0x3b0732))['catch'](handleError(_0x29520a,null));};exports[_0x2332('0x63')]=function(_0x56826c,_0x49fe67,_0x41ed25){var _0x54f895={};var _0x9ff086={};var _0x376f99;var _0x113b2;return db['MailQueue']['findOne']({'where':{'id':_0x56826c[_0x2332('0x48')]['id']}})[_0x2332('0x23')](handleEntityNotFound(_0x49fe67,null))[_0x2332('0x23')](function(_0x1d4163){if(_0x1d4163){_0x376f99=_0x1d4163;_0x9ff086[_0x2332('0x31')]=_[_0x2332('0x56')](db[_0x2332('0x64')][_0x2332('0x2e')]);_0x9ff086['query']=_['keys'](_0x56826c[_0x2332('0x32')]);_0x9ff086[_0x2332('0x33')]=_[_0x2332('0x35')](_0x9ff086[_0x2332('0x31')],_0x9ff086[_0x2332('0x32')]);_0x54f895[_0x2332('0x34')]=_['intersection'](_0x9ff086[_0x2332('0x31')],qs[_0x2332('0x36')](_0x56826c[_0x2332('0x32')][_0x2332('0x36')]));_0x54f895[_0x2332('0x34')]=_0x54f895[_0x2332('0x34')][_0x2332('0x37')]?_0x54f895[_0x2332('0x34')]:_0x9ff086[_0x2332('0x31')];_0x54f895[_0x2332('0x39')]=qs['sort'](_0x56826c[_0x2332('0x32')]['sort']);_0x54f895['where']=qs['filters'](_[_0x2332('0x3c')](_0x56826c[_0x2332('0x32')],_0x9ff086[_0x2332('0x33')]));if(_0x56826c[_0x2332('0x32')][_0x2332('0x3d')]){_0x54f895[_0x2332('0x3b')]=_[_0x2332('0x3e')](_0x54f895[_0x2332('0x3b')],{'$or':_[_0x2332('0x2c')](_0x54f895[_0x2332('0x34')],function(_0x49998c){var _0x26694c={};_0x26694c[_0x49998c]={'$like':'%'+_0x56826c[_0x2332('0x32')][_0x2332('0x3d')]+'%'};return _0x26694c;})});}_0x54f895=_[_0x2332('0x3e')]({},_0x54f895,_0x56826c['options']);return _0x376f99[_0x2332('0x63')](_0x54f895);}})[_0x2332('0x23')](function(_0x5f327d){if(_0x5f327d){_0x113b2=_0x5f327d[_0x2332('0x37')];if(!_0x56826c[_0x2332('0x32')][_0x2332('0x38')]('nolimit')){_0x54f895[_0x2332('0x1d')]=qs[_0x2332('0x1d')](_0x56826c[_0x2332('0x32')]['limit']);_0x54f895['offset']=qs[_0x2332('0x1c')](_0x56826c['query'][_0x2332('0x1c')]);}return _0x376f99[_0x2332('0x63')](_0x54f895);}})[_0x2332('0x23')](function(_0x43cb03){if(_0x43cb03){return _0x43cb03?{'count':_0x113b2,'rows':_0x43cb03}:null;}})['then'](respondWithResult(_0x49fe67,null))[_0x2332('0x46')](handleError(_0x49fe67,null));};exports['addTeams']=function(_0x59f2ec,_0x288c98,_0x8f6b78){var _0x4469a0=_0x59f2ec[_0x2332('0x52')]['ids'];return db[_0x2332('0x64')][_0x2332('0x44')]({'where':{'id':_0x4469a0},'attributes':['id'],'include':[{'model':db[_0x2332('0x5a')],'as':_0x2332('0x65'),'attributes':['id',_0x2332('0x2a'),_0x2332('0x66'),_0x2332('0x67'),_0x2332('0x68')],'raw':!![]}]})[_0x2332('0x23')](function(_0x453135){if(_0x453135){var _0xb7fca1=_[_0x2332('0x69')](_0x453135,function(_0x1f301a){var _0x15fa85=_0x1f301a['get']({'plain':!![]});return _0x15fa85[_0x2332('0x65')];});return db['MailQueue']['find']({'where':{'id':_0x59f2ec['params']['id']}})[_0x2332('0x23')](function(_0x7a7c2a){return db[_0x2332('0x6a')][_0x2332('0x6b')](function(_0x189744){return _0x7a7c2a[_0x2332('0x6c')](_0x4469a0,{'transaction':_0x189744})[_0x2332('0x23')](function(){return BPromise[_0x2332('0x6d')](_0xb7fca1,function(_0x42d2e4){return db[_0x2332('0x59')]['findOrCreate']({'where':{'UserId':_0x42d2e4['id'],'MailQueueId':_0x59f2ec[_0x2332('0x48')]['id']},'transaction':_0x189744});});})[_0x2332('0x23')](function(){_0xb7fca1[_0x2332('0x6e')](function(_0x32df42){socket[_0x2332('0x6f')](_0x2332('0x70'),{'UserId':_0x32df42['id'],'MailQueueId':_0x7a7c2a['id']});});});});});}})['then'](respondWithStatusCode(_0x288c98,null))['catch'](handleError(_0x288c98,null));};exports['removeTeams']=function(_0x1f4cc2,_0x5e56fe,_0x47cb7b){return db[_0x2332('0x64')][_0x2332('0x44')]({'where':{'id':_0x1f4cc2[_0x2332('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2332('0x5a')],'as':_0x2332('0x65'),'attributes':['id'],'raw':!![]}]})[_0x2332('0x23')](handleEntityNotFound(_0x5e56fe,null))[_0x2332('0x23')](function(_0x3a686a){var _0x4c1241=_[_0x2332('0x2c')](_0x3a686a,'id');var _0x10e4d2=[];var _0x496ce2=[];var _0x47176c=squel[_0x2332('0x71')]();_0x47176c[_0x2332('0x72')](_0x2332('0x73'))[_0x2332('0x74')]('team_has_mail_queues','tq')[_0x2332('0x75')](_0x2332('0x76'),'ut',_0x2332('0x77'))[_0x2332('0x3b')](_0x2332('0x78'),_0x1f4cc2['params']['id']);for(var _0x246f71=0x0;_0x246f71<_0x3a686a[_0x2332('0x37')];_0x246f71+=0x1){let _0x3d33e9=_0x3a686a[_0x246f71];for(var _0x3b2e9a=0x0;_0x3b2e9a<_0x3d33e9['Agents'][_0x2332('0x37')];_0x3b2e9a+=0x1){let _0x9cb0aa=_0x3d33e9['Agents'][_0x3b2e9a];var _0x1bb714=_0x47176c[_0x2332('0x79')]();_0x1bb714['where'](_0x2332('0x7a'),_0x9cb0aa['id']);_0x496ce2[_0x2332('0x7b')](db[_0x2332('0x6a')][_0x2332('0x32')](_0x1bb714['toString'](),{'type':db['sequelize'][_0x2332('0x7c')][_0x2332('0x7d')]})[_0x2332('0x23')](function(_0x4a3144){if(_0x4a3144[_0x2332('0x37')]===0x1){return _0x9cb0aa['id'];}else{var _0x30aeed=_['every'](_[_0x2332('0x2c')](_0x4a3144,_0x2332('0x7e')),function(_0x9e57a4){return _[_0x2332('0x7f')](_0x4c1241,_0x9e57a4);});if(_0x30aeed){return _0x9cb0aa['id'];}}}));}}return BPromise[_0x2332('0x80')](_0x496ce2)['then'](function(_0x56b5c7){_0x10e4d2=_(_0x10e4d2)[_0x2332('0x81')](_0x56b5c7)['compact']()[_0x2332('0x82')]();return db[_0x2332('0x2d')][_0x2332('0x49')]({'where':{'id':_0x1f4cc2['params']['id']}})[_0x2332('0x23')](function(_0x5644fe){return db[_0x2332('0x6a')][_0x2332('0x6b')](function(_0x382a1d){return _0x5644fe[_0x2332('0x83')](_0x1f4cc2[_0x2332('0x32')][_0x2332('0x84')],{'transaction':_0x382a1d})[_0x2332('0x23')](function(){if(!_[_0x2332('0x85')](_0x10e4d2)){return _0x5644fe[_0x2332('0x86')](_0x10e4d2,{'transaction':_0x382a1d});}})['then'](function(){_0x10e4d2[_0x2332('0x6e')](function(_0x3eaa50){socket[_0x2332('0x6f')]('userMailQueue:remove',{'UserId':_0x3eaa50,'MailQueueId':_0x5644fe['id']});});});});});});})[_0x2332('0x23')](respondWithStatusCode(_0x5e56fe,null))[_0x2332('0x46')](handleError(_0x5e56fe,null));};exports[_0x2332('0x87')]=function(_0x3e3e7b,_0x5a57fd,_0x48940a){return db[_0x2332('0x2d')][_0x2332('0x49')]({'where':{'id':_0x3e3e7b[_0x2332('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a57fd,null))[_0x2332('0x23')](function(_0x218f08){if(_0x218f08){return _0x218f08['addAgents'](_0x3e3e7b[_0x2332('0x52')][_0x2332('0x84')],_['omit'](_0x3e3e7b[_0x2332('0x52')],['ids','id'])||{})['spread'](function(_0x35b2e3){for(var _0xd80fc1=0x0;_0xd80fc1<_0x3e3e7b[_0x2332('0x52')]['ids'][_0x2332('0x37')];_0xd80fc1+=0x1){socket[_0x2332('0x6f')]('userMailQueue:save',{'UserId':_0x3e3e7b[_0x2332('0x52')]['ids'][_0xd80fc1],'MailQueueId':_0x3e3e7b[_0x2332('0x48')]['id']});}return _0x35b2e3;});}})[_0x2332('0x23')](respondWithResult(_0x5a57fd,null))[_0x2332('0x46')](handleError(_0x5a57fd,null));};exports[_0x2332('0x86')]=function(_0x97e40e,_0x529c48,_0xb58f0e){return db[_0x2332('0x2d')]['find']({'where':{'id':_0x97e40e['params']['id']}})[_0x2332('0x23')](handleEntityNotFound(_0x529c48,null))[_0x2332('0x23')](function(_0x1fc159){if(_0x1fc159){return _0x1fc159[_0x2332('0x86')](_0x97e40e['query'][_0x2332('0x84')])[_0x2332('0x23')](function(){if(_[_0x2332('0x88')](_0x97e40e['query']['ids'])){for(var _0x1d8beb=0x0;_0x1d8beb<_0x97e40e[_0x2332('0x32')][_0x2332('0x84')]['length'];_0x1d8beb+=0x1){socket[_0x2332('0x6f')](_0x2332('0x89'),{'UserId':Number(_0x97e40e[_0x2332('0x32')][_0x2332('0x84')][_0x1d8beb]),'MailQueueId':Number(_0x97e40e[_0x2332('0x48')]['id'])});}}else{socket[_0x2332('0x6f')]('userMailQueue:remove',{'UserId':Number(_0x97e40e[_0x2332('0x32')][_0x2332('0x84')]),'MailQueueId':Number(_0x97e40e['params']['id'])});}});}})[_0x2332('0x23')](respondWithStatusCode(_0x529c48,null))[_0x2332('0x46')](handleError(_0x529c48,null));};exports['getAgents']=function(_0x26bdd8,_0x5f3719,_0xd66742){var _0x29d4a8={};var _0x14cca9={};var _0x4b8fe6;var _0x39d267;return db[_0x2332('0x2d')][_0x2332('0x55')]({'where':{'id':_0x26bdd8[_0x2332('0x48')]['id']}})[_0x2332('0x23')](handleEntityNotFound(_0x5f3719,null))[_0x2332('0x23')](function(_0x5c21ed){if(_0x5c21ed){_0x4b8fe6=_0x5c21ed;_0x14cca9[_0x2332('0x31')]=_[_0x2332('0x56')](db[_0x2332('0x5a')][_0x2332('0x2e')]);_0x14cca9[_0x2332('0x32')]=_[_0x2332('0x56')](_0x26bdd8[_0x2332('0x32')]);_0x14cca9[_0x2332('0x33')]=_['intersection'](_0x14cca9[_0x2332('0x31')],_0x14cca9[_0x2332('0x32')]);_0x29d4a8[_0x2332('0x34')]=_[_0x2332('0x35')](_0x14cca9['model'],qs['fields'](_0x26bdd8[_0x2332('0x32')][_0x2332('0x36')]));_0x29d4a8[_0x2332('0x34')]=_0x29d4a8[_0x2332('0x34')][_0x2332('0x37')]?_0x29d4a8[_0x2332('0x34')]:_0x14cca9[_0x2332('0x31')];_0x29d4a8[_0x2332('0x39')]=qs[_0x2332('0x3a')](_0x26bdd8['query']['sort']);_0x29d4a8[_0x2332('0x3b')]=qs[_0x2332('0x33')](_[_0x2332('0x3c')](_0x26bdd8[_0x2332('0x32')],_0x14cca9['filters']));if(_0x26bdd8['query'][_0x2332('0x3d')]){_0x29d4a8[_0x2332('0x3b')]=_[_0x2332('0x3e')](_0x29d4a8[_0x2332('0x3b')],{'$or':_['map'](_0x29d4a8[_0x2332('0x34')],function(_0xa179b3){var _0x4bc354={};_0x4bc354[_0xa179b3]={'$like':'%'+_0x26bdd8[_0x2332('0x32')][_0x2332('0x3d')]+'%'};return _0x4bc354;})});}_0x29d4a8=_[_0x2332('0x3e')]({},_0x29d4a8,_0x26bdd8[_0x2332('0x40')]);return _0x4b8fe6[_0x2332('0x8a')](_0x29d4a8);}})[_0x2332('0x23')](function(_0x3c3d5c){if(_0x3c3d5c){_0x39d267=_0x3c3d5c[_0x2332('0x37')];if(!_0x26bdd8[_0x2332('0x32')]['hasOwnProperty'](_0x2332('0x57'))){_0x29d4a8[_0x2332('0x1d')]=qs[_0x2332('0x1d')](_0x26bdd8[_0x2332('0x32')][_0x2332('0x1d')]);_0x29d4a8[_0x2332('0x1c')]=qs[_0x2332('0x1c')](_0x26bdd8[_0x2332('0x32')][_0x2332('0x1c')]);}return _0x4b8fe6[_0x2332('0x8a')](_0x29d4a8);}})[_0x2332('0x23')](function(_0x472450){if(_0x472450){return _0x472450?{'count':_0x39d267,'rows':_0x472450}:null;}})['then'](respondWithResult(_0x5f3719,null))['catch'](handleError(_0x5f3719,null));}; \ No newline at end of file +var _0xa9d7=['interface','flatMap','Agents','transaction','forEach','emit','userMailQueue:save','removeTeams','field','tq.TeamId','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','reject','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','map','MailQueue','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','body','describe','getMembers','UserMailQueue','hasOwnProperty','nolimit','order','User','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause'];(function(_0x3806b1,_0x425a11){var _0x2a0da2=function(_0x4833f3){while(--_0x4833f3){_0x3806b1['push'](_0x3806b1['shift']());}};_0x2a0da2(++_0x425a11);}(_0xa9d7,0x134));var _0x7a9d=function(_0x1e23f5,_0x5d4743){_0x1e23f5=_0x1e23f5-0x0;var _0xb815c5=_0xa9d7[_0x1e23f5];return _0xb815c5;};'use strict';var emlformat=require(_0x7a9d('0x0'));var rimraf=require(_0x7a9d('0x1'));var zipdir=require(_0x7a9d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a9d('0x3'));var moment=require(_0x7a9d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7a9d('0x5'));var path=require(_0x7a9d('0x6'));var sox=require(_0x7a9d('0x7'));var csv=require(_0x7a9d('0x8'));var ejs=require(_0x7a9d('0x9'));var fs=require('fs');var fs_extra=require(_0x7a9d('0xa'));var _=require(_0x7a9d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7a9d('0xc'));var deskjs=require(_0x7a9d('0xd'));var toCsv=require(_0x7a9d('0x8'));var querystring=require(_0x7a9d('0xe'));var Papa=require(_0x7a9d('0xf'));var Redis=require(_0x7a9d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7a9d('0x11'));var as=require(_0x7a9d('0x12'));var hardwareService=require(_0x7a9d('0x13'));var logger=require(_0x7a9d('0x14'))(_0x7a9d('0x15'));var utils=require(_0x7a9d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7a9d('0x17'))['db'];config[_0x7a9d('0x18')]=_['defaults'](config['redis'],{'host':_0x7a9d('0x19'),'port':0x18eb});var socket=require(_0x7a9d('0x1a'))(new Redis(config[_0x7a9d('0x18')]));require(_0x7a9d('0x1b'))[_0x7a9d('0x1c')](socket);function respondWithStatusCode(_0x2d7101,_0x5d7b92){_0x5d7b92=_0x5d7b92||0xcc;return function(_0x2a69fc){if(_0x2a69fc){return _0x2d7101[_0x7a9d('0x1d')](_0x5d7b92);}return _0x2d7101['status'](_0x5d7b92)[_0x7a9d('0x1e')]();};}function respondWithResult(_0x51a578,_0x3b0172){_0x3b0172=_0x3b0172||0xc8;return function(_0x36e4a4){if(_0x36e4a4){return _0x51a578[_0x7a9d('0x1f')](_0x3b0172)['json'](_0x36e4a4);}};}function respondWithFilteredResult(_0x260123,_0x46b60a){return function(_0x4e4992){if(_0x4e4992){var _0x3dde5e=_0x4e4992[_0x7a9d('0x20')],_0x1897b8=_0x46b60a[_0x7a9d('0x21')],_0x51a0c1=_0x46b60a[_0x7a9d('0x21')]+_0x46b60a[_0x7a9d('0x22')],_0x42ff12;if(_0x51a0c1>=_0x3dde5e){_0x51a0c1=_0x3dde5e;_0x42ff12=0xc8;}else{_0x42ff12=0xce;}_0x260123[_0x7a9d('0x1f')](_0x42ff12);return _0x260123['set'](_0x7a9d('0x23'),_0x1897b8+'-'+_0x51a0c1+'/'+_0x3dde5e)[_0x7a9d('0x24')](_0x4e4992);}return null;};}function patchUpdates(_0x392cbd){return function(_0x242279){try{jsonpatch[_0x7a9d('0x25')](_0x242279,_0x392cbd,!![]);}catch(_0x80fb64){return BPromise[_0x7a9d('0x26')](_0x80fb64);}return _0x242279['save']();};}function saveUpdates(_0x524998,_0x3ffbb6){return function(_0x1eb1df){if(_0x1eb1df){return _0x1eb1df[_0x7a9d('0x27')](_0x524998)[_0x7a9d('0x28')](function(_0x479fdf){return _0x479fdf;});}return null;};}function removeEntity(_0x5234fa,_0xe859c0){return function(_0x1a1aa7){if(_0x1a1aa7){return _0x1a1aa7[_0x7a9d('0x29')]()[_0x7a9d('0x28')](function(){var _0x5254f9=_0x1a1aa7['get']({'plain':!![]});var _0x3f7b20=_0x7a9d('0x2a');return db[_0x7a9d('0x2b')][_0x7a9d('0x29')]({'where':{'type':_0x3f7b20,'resourceId':_0x5254f9['id']}})[_0x7a9d('0x28')](function(){return _0x1a1aa7;});})[_0x7a9d('0x28')](function(){_0x5234fa['status'](0xcc)[_0x7a9d('0x1e')]();});}};}function handleEntityNotFound(_0x891e0c,_0xcf8b08){return function(_0x25f2df){if(!_0x25f2df){_0x891e0c[_0x7a9d('0x1d')](0x194);}return _0x25f2df;};}function handleError(_0x4d5995,_0x377de1){_0x377de1=_0x377de1||0x1f4;return function(_0x11f473){logger[_0x7a9d('0x2c')](_0x11f473[_0x7a9d('0x2d')]);if(_0x11f473['name']){delete _0x11f473[_0x7a9d('0x2e')];}_0x4d5995[_0x7a9d('0x1f')](_0x377de1)['send'](_0x11f473);};}exports['index']=function(_0x51843e,_0x2591a3){var _0x2a084f={},_0x4d05e3={},_0x1839a8={'count':0x0,'rows':[]};var _0x512c06=_[_0x7a9d('0x2f')](db[_0x7a9d('0x30')]['rawAttributes'],function(_0x41e536){return{'name':_0x41e536[_0x7a9d('0x31')],'type':_0x41e536[_0x7a9d('0x32')][_0x7a9d('0x33')]};});_0x4d05e3[_0x7a9d('0x34')]=_['map'](_0x512c06,_0x7a9d('0x2e'));_0x4d05e3[_0x7a9d('0x35')]=_['keys'](_0x51843e[_0x7a9d('0x35')]);_0x4d05e3[_0x7a9d('0x36')]=_['intersection'](_0x4d05e3[_0x7a9d('0x34')],_0x4d05e3[_0x7a9d('0x35')]);_0x2a084f[_0x7a9d('0x37')]=_[_0x7a9d('0x38')](_0x4d05e3[_0x7a9d('0x34')],qs[_0x7a9d('0x39')](_0x51843e[_0x7a9d('0x35')][_0x7a9d('0x39')]));_0x2a084f[_0x7a9d('0x37')]=_0x2a084f[_0x7a9d('0x37')][_0x7a9d('0x3a')]?_0x2a084f['attributes']:_0x4d05e3[_0x7a9d('0x34')];if(!_0x51843e['query']['hasOwnProperty']('nolimit')){_0x2a084f[_0x7a9d('0x22')]=qs[_0x7a9d('0x22')](_0x51843e[_0x7a9d('0x35')][_0x7a9d('0x22')]);_0x2a084f[_0x7a9d('0x21')]=qs[_0x7a9d('0x21')](_0x51843e[_0x7a9d('0x35')][_0x7a9d('0x21')]);}_0x2a084f['order']=qs[_0x7a9d('0x3b')](_0x51843e[_0x7a9d('0x35')][_0x7a9d('0x3b')]);_0x2a084f['where']=qs[_0x7a9d('0x36')](_[_0x7a9d('0x3c')](_0x51843e[_0x7a9d('0x35')],_0x4d05e3[_0x7a9d('0x36')]),_0x512c06);if(_0x51843e[_0x7a9d('0x35')][_0x7a9d('0x3d')]){_0x2a084f[_0x7a9d('0x3e')]=_[_0x7a9d('0x3f')](_0x2a084f[_0x7a9d('0x3e')],{'$or':_['map'](_0x512c06,function(_0x3c559c){if(_0x3c559c['type']!==_0x7a9d('0x40')){var _0x560da6={};_0x560da6[_0x3c559c['name']]={'$like':'%'+_0x51843e[_0x7a9d('0x35')][_0x7a9d('0x3d')]+'%'};return _0x560da6;}})});}_0x2a084f=_[_0x7a9d('0x3f')]({},_0x2a084f,_0x51843e[_0x7a9d('0x41')]);var _0x54f0fb={'where':_0x2a084f[_0x7a9d('0x3e')]};return db[_0x7a9d('0x30')][_0x7a9d('0x20')](_0x54f0fb)['then'](function(_0xd0d934){_0x1839a8[_0x7a9d('0x20')]=_0xd0d934;if(_0x51843e[_0x7a9d('0x35')][_0x7a9d('0x42')]){_0x2a084f[_0x7a9d('0x43')]=[{'all':!![]}];}return db[_0x7a9d('0x30')][_0x7a9d('0x44')](_0x2a084f);})[_0x7a9d('0x28')](function(_0x3c84ee){_0x1839a8[_0x7a9d('0x45')]=_0x3c84ee;return _0x1839a8;})[_0x7a9d('0x28')](respondWithFilteredResult(_0x2591a3,_0x2a084f))[_0x7a9d('0x46')](handleError(_0x2591a3,null));};exports[_0x7a9d('0x47')]=function(_0x1cdaf0,_0x53c593){var _0x278889={'raw':!![],'where':{'id':_0x1cdaf0[_0x7a9d('0x48')]['id']}},_0xf65e0e={};_0xf65e0e[_0x7a9d('0x34')]=_['keys'](db['MailQueue'][_0x7a9d('0x49')]);_0xf65e0e[_0x7a9d('0x35')]=_[_0x7a9d('0x4a')](_0x1cdaf0['query']);_0xf65e0e[_0x7a9d('0x36')]=_[_0x7a9d('0x38')](_0xf65e0e[_0x7a9d('0x34')],_0xf65e0e[_0x7a9d('0x35')]);_0x278889[_0x7a9d('0x37')]=_[_0x7a9d('0x38')](_0xf65e0e[_0x7a9d('0x34')],qs[_0x7a9d('0x39')](_0x1cdaf0['query'][_0x7a9d('0x39')]));_0x278889['attributes']=_0x278889[_0x7a9d('0x37')]['length']?_0x278889[_0x7a9d('0x37')]:_0xf65e0e['model'];if(_0x1cdaf0[_0x7a9d('0x35')][_0x7a9d('0x42')]){_0x278889[_0x7a9d('0x43')]=[{'all':!![]}];}_0x278889=_[_0x7a9d('0x3f')]({},_0x278889,_0x1cdaf0[_0x7a9d('0x41')]);return db['MailQueue']['find'](_0x278889)[_0x7a9d('0x28')](handleEntityNotFound(_0x53c593,null))[_0x7a9d('0x28')](respondWithResult(_0x53c593,null))[_0x7a9d('0x46')](handleError(_0x53c593,null));};exports[_0x7a9d('0x4b')]=function(_0x50c6e0,_0x3f1745){return db[_0x7a9d('0x30')]['create'](_0x50c6e0['body'],{})[_0x7a9d('0x28')](function(_0x4d62a0){var _0x1a91a1=_0x50c6e0[_0x7a9d('0x4c')][_0x7a9d('0x4d')]({'plain':!![]});if(!_0x1a91a1)throw new Error(_0x7a9d('0x4e'));if(_0x1a91a1[_0x7a9d('0x4f')]==='user'){var _0x251297=_0x4d62a0['get']({'plain':!![]});var _0x344049='MailQueues';return db['UserProfileSection'][_0x7a9d('0x50')]({'where':{'name':_0x344049,'userProfileId':_0x1a91a1['userProfileId']},'raw':!![]})[_0x7a9d('0x28')](function(_0x15d26f){if(_0x15d26f&&_0x15d26f[_0x7a9d('0x51')]===0x0){return db[_0x7a9d('0x2b')][_0x7a9d('0x4b')]({'name':_0x251297['name'],'resourceId':_0x251297['id'],'type':_0x15d26f['name'],'sectionId':_0x15d26f['id']},{})['then'](function(){return _0x4d62a0;});}else{return _0x4d62a0;}})[_0x7a9d('0x46')](function(_0x213354){logger[_0x7a9d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x213354);throw _0x213354;});}return _0x4d62a0;})[_0x7a9d('0x28')](respondWithResult(_0x3f1745,0xc9))['catch'](handleError(_0x3f1745,null));};exports[_0x7a9d('0x27')]=function(_0x2e1ab1,_0x1d5000){if(_0x2e1ab1['body']['id']){delete _0x2e1ab1[_0x7a9d('0x52')]['id'];}return db[_0x7a9d('0x30')][_0x7a9d('0x50')]({'where':{'id':_0x2e1ab1['params']['id']}})[_0x7a9d('0x28')](handleEntityNotFound(_0x1d5000,null))[_0x7a9d('0x28')](saveUpdates(_0x2e1ab1[_0x7a9d('0x52')],null))[_0x7a9d('0x28')](respondWithResult(_0x1d5000,null))[_0x7a9d('0x46')](handleError(_0x1d5000,null));};exports[_0x7a9d('0x29')]=function(_0x544c77,_0x379205){return db[_0x7a9d('0x30')]['find']({'where':{'id':_0x544c77[_0x7a9d('0x48')]['id']}})[_0x7a9d('0x28')](handleEntityNotFound(_0x379205,null))[_0x7a9d('0x28')](removeEntity(_0x379205,null))[_0x7a9d('0x46')](handleError(_0x379205,null));};exports['describe']=function(_0x59b3e2,_0x13a534){return db[_0x7a9d('0x30')][_0x7a9d('0x53')]()[_0x7a9d('0x28')](respondWithResult(_0x13a534,null))[_0x7a9d('0x46')](handleError(_0x13a534,null));};exports[_0x7a9d('0x54')]=function(_0x2aa8d2,_0x9e4717,_0x35bde6){var _0x41f07e={'raw':!![],'where':{}},_0x26f48f={},_0x53b92a;return db[_0x7a9d('0x30')]['findOne']({'where':{'id':_0x2aa8d2[_0x7a9d('0x48')]['id']}})[_0x7a9d('0x28')](handleEntityNotFound(_0x9e4717,null))[_0x7a9d('0x28')](function(_0x34fb23){if(_0x34fb23){_0x53b92a=_0x34fb23['get']({'plain':!![]});_0x26f48f[_0x7a9d('0x34')]=_[_0x7a9d('0x4a')](db[_0x7a9d('0x55')][_0x7a9d('0x49')]);_0x26f48f['query']=_['keys'](_0x2aa8d2['query']);_0x26f48f[_0x7a9d('0x36')]=_[_0x7a9d('0x38')](_0x26f48f['model'],_0x26f48f['query']);_0x41f07e[_0x7a9d('0x37')]=_[_0x7a9d('0x38')](_0x26f48f['model'],qs['fields'](_0x2aa8d2[_0x7a9d('0x35')][_0x7a9d('0x39')]));_0x41f07e[_0x7a9d('0x37')]=_0x41f07e[_0x7a9d('0x37')]['length']?_0x41f07e[_0x7a9d('0x37')]:_0x26f48f[_0x7a9d('0x34')];if(!_0x2aa8d2[_0x7a9d('0x35')][_0x7a9d('0x56')](_0x7a9d('0x57'))){_0x41f07e[_0x7a9d('0x22')]=qs[_0x7a9d('0x22')](_0x2aa8d2[_0x7a9d('0x35')][_0x7a9d('0x22')]);_0x41f07e[_0x7a9d('0x21')]=qs[_0x7a9d('0x21')](_0x2aa8d2[_0x7a9d('0x35')][_0x7a9d('0x21')]);}_0x41f07e[_0x7a9d('0x58')]=qs[_0x7a9d('0x3b')](_0x2aa8d2[_0x7a9d('0x35')][_0x7a9d('0x3b')]);_0x41f07e[_0x7a9d('0x3e')]=qs[_0x7a9d('0x36')](_[_0x7a9d('0x3c')](_0x2aa8d2[_0x7a9d('0x35')],_0x26f48f[_0x7a9d('0x36')]));_0x41f07e[_0x7a9d('0x3e')]['MailQueueId']=_0x34fb23['id'];if(_0x2aa8d2[_0x7a9d('0x35')][_0x7a9d('0x3d')]){_0x41f07e[_0x7a9d('0x3e')]=_[_0x7a9d('0x3f')](_0x41f07e[_0x7a9d('0x3e')],{'$or':_[_0x7a9d('0x2f')](_0x41f07e[_0x7a9d('0x37')],function(_0x50b096){var _0x23ec8b={};_0x23ec8b[_0x50b096]={'$like':'%'+_0x2aa8d2['query']['filter']+'%'};return _0x23ec8b;})});}_0x41f07e=_['merge']({},_0x41f07e,_0x2aa8d2[_0x7a9d('0x41')]);return db[_0x7a9d('0x55')][_0x7a9d('0x44')](_0x41f07e);}})[_0x7a9d('0x28')](function(_0x563dc9){if(_0x563dc9){return db[_0x7a9d('0x59')]['findAndCountAll']({'where':{'id':_[_0x7a9d('0x2f')](_0x563dc9,'UserId'),'role':_0x7a9d('0x5a')},'attributes':['id',_0x7a9d('0x2e'),_0x7a9d('0x5b'),_0x7a9d('0x5c'),_0x7a9d('0x5d')]});}})[_0x7a9d('0x28')](function(_0x231413){if(_0x231413){return{'count':_0x231413['count'],'rows':_[_0x7a9d('0x2f')](_0x231413[_0x7a9d('0x45')],function(_0x4b180b){return{'membername':_0x4b180b[_0x7a9d('0x2e')],'UserId':_0x4b180b['id'],'queue_name':_0x53b92a[_0x7a9d('0x2e')],'MailQueueId':_0x53b92a['id'],'interface':util[_0x7a9d('0x5e')](_0x7a9d('0x5f'),_0x7a9d('0x60'),_0x4b180b[_0x7a9d('0x2e')]),'penalty':0x0,'paused':_0x4b180b[_0x7a9d('0x5b')],'createdAt':_0x4b180b[_0x7a9d('0x5d')],'updatedAt':_0x4b180b[_0x7a9d('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7a9d('0x28')](respondWithFilteredResult(_0x9e4717,_0x41f07e))[_0x7a9d('0x46')](handleError(_0x9e4717,null));};exports[_0x7a9d('0x61')]=function(_0x2ab0a4,_0x6b02b5,_0x4c5c26){var _0x20ce34={};var _0x2c9627={};var _0x316b12;var _0x20d238;return db[_0x7a9d('0x30')]['findOne']({'where':{'id':_0x2ab0a4[_0x7a9d('0x48')]['id']}})[_0x7a9d('0x28')](handleEntityNotFound(_0x6b02b5,null))[_0x7a9d('0x28')](function(_0x276b45){if(_0x276b45){_0x316b12=_0x276b45;_0x2c9627[_0x7a9d('0x34')]=_[_0x7a9d('0x4a')](db[_0x7a9d('0x62')][_0x7a9d('0x49')]);_0x2c9627[_0x7a9d('0x35')]=_[_0x7a9d('0x4a')](_0x2ab0a4[_0x7a9d('0x35')]);_0x2c9627[_0x7a9d('0x36')]=_[_0x7a9d('0x38')](_0x2c9627[_0x7a9d('0x34')],_0x2c9627[_0x7a9d('0x35')]);_0x20ce34['attributes']=_[_0x7a9d('0x38')](_0x2c9627[_0x7a9d('0x34')],qs[_0x7a9d('0x39')](_0x2ab0a4['query'][_0x7a9d('0x39')]));_0x20ce34[_0x7a9d('0x37')]=_0x20ce34[_0x7a9d('0x37')]['length']?_0x20ce34[_0x7a9d('0x37')]:_0x2c9627[_0x7a9d('0x34')];_0x20ce34['order']=qs[_0x7a9d('0x3b')](_0x2ab0a4['query'][_0x7a9d('0x3b')]);_0x20ce34[_0x7a9d('0x3e')]=qs[_0x7a9d('0x36')](_[_0x7a9d('0x3c')](_0x2ab0a4[_0x7a9d('0x35')],_0x2c9627[_0x7a9d('0x36')]));if(_0x2ab0a4[_0x7a9d('0x35')]['filter']){_0x20ce34[_0x7a9d('0x3e')]=_[_0x7a9d('0x3f')](_0x20ce34[_0x7a9d('0x3e')],{'$or':_[_0x7a9d('0x2f')](_0x20ce34[_0x7a9d('0x37')],function(_0x48d087){var _0x473fa7={};_0x473fa7[_0x48d087]={'$like':'%'+_0x2ab0a4[_0x7a9d('0x35')][_0x7a9d('0x3d')]+'%'};return _0x473fa7;})});}_0x20ce34=_['merge']({},_0x20ce34,_0x2ab0a4['options']);return _0x316b12[_0x7a9d('0x61')](_0x20ce34);}})['then'](function(_0x46538c){if(_0x46538c){_0x20d238=_0x46538c[_0x7a9d('0x3a')];if(!_0x2ab0a4[_0x7a9d('0x35')][_0x7a9d('0x56')](_0x7a9d('0x57'))){_0x20ce34[_0x7a9d('0x22')]=qs[_0x7a9d('0x22')](_0x2ab0a4[_0x7a9d('0x35')][_0x7a9d('0x22')]);_0x20ce34[_0x7a9d('0x21')]=qs[_0x7a9d('0x21')](_0x2ab0a4['query'][_0x7a9d('0x21')]);}return _0x316b12[_0x7a9d('0x61')](_0x20ce34);}})['then'](function(_0x3d35b7){if(_0x3d35b7){return _0x3d35b7?{'count':_0x20d238,'rows':_0x3d35b7}:null;}})[_0x7a9d('0x28')](respondWithResult(_0x6b02b5,null))[_0x7a9d('0x46')](handleError(_0x6b02b5,null));};exports[_0x7a9d('0x63')]=function(_0x3f59d1,_0x2abea6,_0x1d27d1){var _0x5494ff=_0x3f59d1[_0x7a9d('0x52')][_0x7a9d('0x64')];return db[_0x7a9d('0x62')][_0x7a9d('0x44')]({'where':{'id':_0x5494ff},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x7a9d('0x2e'),_0x7a9d('0x65'),_0x7a9d('0x66'),_0x7a9d('0x67')],'raw':!![]}]})[_0x7a9d('0x28')](function(_0x219631){if(_0x219631){var _0x359a40=_[_0x7a9d('0x68')](_0x219631,function(_0x3632a6){var _0x4c59be=_0x3632a6[_0x7a9d('0x4d')]({'plain':!![]});return _0x4c59be[_0x7a9d('0x69')];});return db[_0x7a9d('0x30')][_0x7a9d('0x50')]({'where':{'id':_0x3f59d1[_0x7a9d('0x48')]['id']}})[_0x7a9d('0x28')](function(_0x4daa6e){return db['sequelize'][_0x7a9d('0x6a')](function(_0x30a9ec){return _0x4daa6e[_0x7a9d('0x63')](_0x5494ff,{'transaction':_0x30a9ec})['then'](function(){return BPromise['each'](_0x359a40,function(_0x5509cf){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x5509cf['id'],'MailQueueId':_0x3f59d1[_0x7a9d('0x48')]['id']},'transaction':_0x30a9ec});});})[_0x7a9d('0x28')](function(){_0x359a40[_0x7a9d('0x6b')](function(_0x1ec99c){socket[_0x7a9d('0x6c')](_0x7a9d('0x6d'),{'UserId':_0x1ec99c['id'],'MailQueueId':_0x4daa6e['id']});});});});});}})[_0x7a9d('0x28')](respondWithStatusCode(_0x2abea6,null))['catch'](handleError(_0x2abea6,null));};exports[_0x7a9d('0x6e')]=function(_0xf8663e,_0x561d22,_0x208c3a){return db['Team'][_0x7a9d('0x44')]({'where':{'id':_0xf8663e[_0x7a9d('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7a9d('0x59')],'as':_0x7a9d('0x69'),'attributes':['id'],'raw':!![]}]})[_0x7a9d('0x28')](handleEntityNotFound(_0x561d22,null))[_0x7a9d('0x28')](function(_0x49082c){var _0x478b9f=_[_0x7a9d('0x2f')](_0x49082c,'id');var _0x7cbb6f=[];var _0x1b95c2=[];var _0x3be6e2=squel['select']();_0x3be6e2[_0x7a9d('0x6f')](_0x7a9d('0x70'))['from'](_0x7a9d('0x71'),'tq')['join'](_0x7a9d('0x72'),'ut',_0x7a9d('0x73'))[_0x7a9d('0x3e')](_0x7a9d('0x74'),_0xf8663e[_0x7a9d('0x48')]['id']);for(var _0x33005f=0x0;_0x33005f<_0x49082c[_0x7a9d('0x3a')];_0x33005f+=0x1){let _0x110537=_0x49082c[_0x33005f];for(var _0x1c3986=0x0;_0x1c3986<_0x110537['Agents'][_0x7a9d('0x3a')];_0x1c3986+=0x1){let _0x2c7861=_0x110537['Agents'][_0x1c3986];var _0x2f96dc=_0x3be6e2[_0x7a9d('0x75')]();_0x2f96dc[_0x7a9d('0x3e')](_0x7a9d('0x76'),_0x2c7861['id']);_0x1b95c2[_0x7a9d('0x77')](db['sequelize']['query'](_0x2f96dc[_0x7a9d('0x78')](),{'type':db[_0x7a9d('0x79')][_0x7a9d('0x7a')][_0x7a9d('0x7b')]})[_0x7a9d('0x28')](function(_0x47e0b5){if(_0x47e0b5[_0x7a9d('0x3a')]===0x1){return _0x2c7861['id'];}else{var _0x5e4801=_[_0x7a9d('0x7c')](_[_0x7a9d('0x2f')](_0x47e0b5,'TeamId'),function(_0x32665f){return _[_0x7a9d('0x7d')](_0x478b9f,_0x32665f);});if(_0x5e4801){return _0x2c7861['id'];}}}));}}return BPromise[_0x7a9d('0x7e')](_0x1b95c2)[_0x7a9d('0x28')](function(_0x4abfd9){_0x7cbb6f=_(_0x7cbb6f)[_0x7a9d('0x7f')](_0x4abfd9)[_0x7a9d('0x80')]()[_0x7a9d('0x81')]();return db[_0x7a9d('0x30')][_0x7a9d('0x50')]({'where':{'id':_0xf8663e['params']['id']}})[_0x7a9d('0x28')](function(_0x454ede){return db[_0x7a9d('0x79')]['transaction'](function(_0x5be8d0){return _0x454ede[_0x7a9d('0x6e')](_0xf8663e[_0x7a9d('0x35')][_0x7a9d('0x64')],{'transaction':_0x5be8d0})['then'](function(){if(!_[_0x7a9d('0x82')](_0x7cbb6f)){return _0x454ede[_0x7a9d('0x83')](_0x7cbb6f,{'transaction':_0x5be8d0});}})[_0x7a9d('0x28')](function(){_0x7cbb6f[_0x7a9d('0x6b')](function(_0x4c6a9d){socket[_0x7a9d('0x6c')]('userMailQueue:remove',{'UserId':_0x4c6a9d,'MailQueueId':_0x454ede['id']});});});});});});})['then'](respondWithStatusCode(_0x561d22,null))['catch'](handleError(_0x561d22,null));};exports[_0x7a9d('0x84')]=function(_0x2bf3cb,_0x38e9e8,_0x30bced){return db[_0x7a9d('0x30')][_0x7a9d('0x50')]({'where':{'id':_0x2bf3cb[_0x7a9d('0x48')]['id']}})[_0x7a9d('0x28')](handleEntityNotFound(_0x38e9e8,null))[_0x7a9d('0x28')](function(_0x5dd86a){if(_0x5dd86a){return _0x5dd86a[_0x7a9d('0x84')](_0x2bf3cb['body'][_0x7a9d('0x64')],_['omit'](_0x2bf3cb[_0x7a9d('0x52')],[_0x7a9d('0x64'),'id'])||{})[_0x7a9d('0x85')](function(_0x2415d3){for(var _0x557df9=0x0;_0x557df9<_0x2bf3cb[_0x7a9d('0x52')]['ids'][_0x7a9d('0x3a')];_0x557df9+=0x1){socket[_0x7a9d('0x6c')]('userMailQueue:save',{'UserId':_0x2bf3cb['body']['ids'][_0x557df9],'MailQueueId':_0x2bf3cb[_0x7a9d('0x48')]['id']});}return _0x2415d3;});}})[_0x7a9d('0x28')](respondWithResult(_0x38e9e8,null))[_0x7a9d('0x46')](handleError(_0x38e9e8,null));};exports['removeAgents']=function(_0x560aa5,_0x44e2f8,_0x34a435){return db['MailQueue'][_0x7a9d('0x50')]({'where':{'id':_0x560aa5[_0x7a9d('0x48')]['id']}})['then'](handleEntityNotFound(_0x44e2f8,null))[_0x7a9d('0x28')](function(_0x5ef43a){if(_0x5ef43a){return _0x5ef43a[_0x7a9d('0x83')](_0x560aa5[_0x7a9d('0x35')][_0x7a9d('0x64')])[_0x7a9d('0x28')](function(){if(_[_0x7a9d('0x86')](_0x560aa5[_0x7a9d('0x35')]['ids'])){for(var _0x4467ca=0x0;_0x4467ca<_0x560aa5[_0x7a9d('0x35')][_0x7a9d('0x64')][_0x7a9d('0x3a')];_0x4467ca+=0x1){socket[_0x7a9d('0x6c')](_0x7a9d('0x87'),{'UserId':Number(_0x560aa5[_0x7a9d('0x35')][_0x7a9d('0x64')][_0x4467ca]),'MailQueueId':Number(_0x560aa5['params']['id'])});}}else{socket['emit'](_0x7a9d('0x87'),{'UserId':Number(_0x560aa5[_0x7a9d('0x35')][_0x7a9d('0x64')]),'MailQueueId':Number(_0x560aa5[_0x7a9d('0x48')]['id'])});}});}})[_0x7a9d('0x28')](respondWithStatusCode(_0x44e2f8,null))['catch'](handleError(_0x44e2f8,null));};exports['getAgents']=function(_0x28cefa,_0x274437,_0x273395){var _0x1dcdc6={};var _0x3430fc={};var _0x1a6646;var _0x5c9fe2;return db[_0x7a9d('0x30')]['findOne']({'where':{'id':_0x28cefa[_0x7a9d('0x48')]['id']}})['then'](handleEntityNotFound(_0x274437,null))[_0x7a9d('0x28')](function(_0x59f430){if(_0x59f430){_0x1a6646=_0x59f430;_0x3430fc[_0x7a9d('0x34')]=_[_0x7a9d('0x4a')](db['User'][_0x7a9d('0x49')]);_0x3430fc[_0x7a9d('0x35')]=_['keys'](_0x28cefa[_0x7a9d('0x35')]);_0x3430fc[_0x7a9d('0x36')]=_['intersection'](_0x3430fc[_0x7a9d('0x34')],_0x3430fc[_0x7a9d('0x35')]);_0x1dcdc6[_0x7a9d('0x37')]=_['intersection'](_0x3430fc['model'],qs[_0x7a9d('0x39')](_0x28cefa[_0x7a9d('0x35')][_0x7a9d('0x39')]));_0x1dcdc6[_0x7a9d('0x37')]=_0x1dcdc6[_0x7a9d('0x37')][_0x7a9d('0x3a')]?_0x1dcdc6[_0x7a9d('0x37')]:_0x3430fc['model'];_0x1dcdc6['order']=qs[_0x7a9d('0x3b')](_0x28cefa[_0x7a9d('0x35')]['sort']);_0x1dcdc6[_0x7a9d('0x3e')]=qs[_0x7a9d('0x36')](_['pick'](_0x28cefa['query'],_0x3430fc[_0x7a9d('0x36')]));if(_0x28cefa['query'][_0x7a9d('0x3d')]){_0x1dcdc6[_0x7a9d('0x3e')]=_['merge'](_0x1dcdc6['where'],{'$or':_[_0x7a9d('0x2f')](_0x1dcdc6[_0x7a9d('0x37')],function(_0x226793){var _0x2457cf={};_0x2457cf[_0x226793]={'$like':'%'+_0x28cefa[_0x7a9d('0x35')]['filter']+'%'};return _0x2457cf;})});}_0x1dcdc6=_['merge']({},_0x1dcdc6,_0x28cefa[_0x7a9d('0x41')]);return _0x1a6646[_0x7a9d('0x88')](_0x1dcdc6);}})[_0x7a9d('0x28')](function(_0x26b2ca){if(_0x26b2ca){_0x5c9fe2=_0x26b2ca[_0x7a9d('0x3a')];if(!_0x28cefa[_0x7a9d('0x35')][_0x7a9d('0x56')](_0x7a9d('0x57'))){_0x1dcdc6[_0x7a9d('0x22')]=qs[_0x7a9d('0x22')](_0x28cefa[_0x7a9d('0x35')]['limit']);_0x1dcdc6['offset']=qs['offset'](_0x28cefa['query'][_0x7a9d('0x21')]);}return _0x1a6646['getAgents'](_0x1dcdc6);}})[_0x7a9d('0x28')](function(_0x46fd61){if(_0x46fd61){return _0x46fd61?{'count':_0x5c9fe2,'rows':_0x46fd61}:null;}})[_0x7a9d('0x28')](respondWithResult(_0x274437,null))[_0x7a9d('0x46')](handleError(_0x274437,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index c245d12..e9de08b 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 _0x070a=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x4af17c,_0x1a798b){var _0x180765=function(_0x2785d2){while(--_0x2785d2){_0x4af17c['push'](_0x4af17c['shift']());}};_0x180765(++_0x1a798b);}(_0x070a,0x8b));var _0xa070=function(_0x5ab3f7,_0x3403d7){_0x5ab3f7=_0x5ab3f7-0x0;var _0x131219=_0x070a[_0x5ab3f7];return _0x131219;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xa070('0x0'))['db'][_0xa070('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa070('0x2')](0x0);var events={'afterCreate':_0xa070('0x3'),'afterUpdate':_0xa070('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45bd4e){return function(_0x3e711e,_0x1c2bbd,_0x963a89){MailQueueEvents[_0xa070('0x5')](_0x45bd4e+':'+_0x3e711e['id'],_0x3e711e);MailQueueEvents[_0xa070('0x5')](_0x45bd4e,_0x3e711e);_0x963a89(null);};}for(var e in events){if(events[_0xa070('0x6')](e)){var event=events[e];MailQueue[_0xa070('0x7')](e,emitEvent(event));}}module[_0xa070('0x8')]=MailQueueEvents; \ No newline at end of file +var _0xd7cb=['events','../../mysqldb','MailQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4797fa,_0x3fe610){var _0x502b5b=function(_0x3efffc){while(--_0x3efffc){_0x4797fa['push'](_0x4797fa['shift']());}};_0x502b5b(++_0x3fe610);}(_0xd7cb,0x172));var _0xbd7c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd7cb[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xbd7c('0x0'));var MailQueue=require(_0xbd7c('0x1'))['db'][_0xbd7c('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xbd7c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd7c('0x4'),'afterDestroy':_0xbd7c('0x5')};function emitEvent(_0x523f0e){return function(_0xcd165,_0x222cbe,_0x5603a1){MailQueueEvents[_0xbd7c('0x6')](_0x523f0e+':'+_0xcd165['id'],_0xcd165);MailQueueEvents[_0xbd7c('0x6')](_0x523f0e,_0xcd165);_0x5603a1(null);};}for(var e in events){if(events[_0xbd7c('0x7')](e)){var event=events[e];MailQueue[_0xbd7c('0x8')](e,emitEvent(event));}}module[_0xbd7c('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 5ed917d..2550311 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 _0x3dff=['define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x794d77,_0x18fb9a){var _0xe43f95=function(_0x4572dd){while(--_0x4572dd){_0x794d77['push'](_0x794d77['shift']());}};_0xe43f95(++_0x18fb9a);}(_0x3dff,0x19b));var _0xf3df=function(_0x129b99,_0x254188){_0x129b99=_0x129b99-0x0;var _0x51d0f7=_0x3dff[_0x129b99];return _0x51d0f7;};'use strict';var _=require(_0xf3df('0x0'));var util=require(_0xf3df('0x1'));var logger=require(_0xf3df('0x2'))(_0xf3df('0x3'));var moment=require(_0xf3df('0x4'));var BPromise=require(_0xf3df('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf3df('0x6'));var config=require(_0xf3df('0x7'));var attributes=require(_0xf3df('0x8'));module['exports']=function(_0x11b4ed,_0x3f8d90){return _0x11b4ed[_0xf3df('0x9')](_0xf3df('0xa'),attributes,{'tableName':_0xf3df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd5=['./mailQueue.attributes','exports','MailQueue','mail_queues','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x16b8bb,_0x276e90){var _0x552825=function(_0xc05c61){while(--_0xc05c61){_0x16b8bb['push'](_0x16b8bb['shift']());}};_0x552825(++_0x276e90);}(_0xcdd5,0x1dd));var _0x5cdd=function(_0x3e78ef,_0x23a62e){_0x3e78ef=_0x3e78ef-0x0;var _0x946a00=_0xcdd5[_0x3e78ef];return _0x946a00;};'use strict';var _=require('lodash');var util=require(_0x5cdd('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5cdd('0x1'));var BPromise=require(_0x5cdd('0x2'));var rp=require(_0x5cdd('0x3'));var fs=require('fs');var path=require(_0x5cdd('0x4'));var rimraf=require(_0x5cdd('0x5'));var config=require(_0x5cdd('0x6'));var attributes=require(_0x5cdd('0x7'));module[_0x5cdd('0x8')]=function(_0x55e3ac,_0x37d178){return _0x55e3ac['define'](_0x5cdd('0x9'),attributes,{'tableName':_0x5cdd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 7b8f185..08c7df4 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 _0x5f99=['include','find','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','redis','localhost','./mailQueue.socket','register','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailQueue,\x20%s,\x20%s','result','catch','GetMailQueue','MailQueue','findAll','raw','options','where','attributes','map','model'];(function(_0x3aa131,_0x4463ec){var _0x3999d4=function(_0x4a73ce){while(--_0x4a73ce){_0x3aa131['push'](_0x3aa131['shift']());}};_0x3999d4(++_0x4463ec);}(_0x5f99,0x1a5));var _0x95f9=function(_0x58018d,_0x3880a7){_0x58018d=_0x58018d-0x0;var _0x4687d3=_0x5f99[_0x58018d];return _0x4687d3;};'use strict';var _=require(_0x95f9('0x0'));var util=require(_0x95f9('0x1'));var moment=require(_0x95f9('0x2'));var BPromise=require(_0x95f9('0x3'));var rs=require(_0x95f9('0x4'));var fs=require('fs');var Redis=require(_0x95f9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x95f9('0x6'));var logger=require(_0x95f9('0x7'))(_0x95f9('0x8'));var config=require('../../config/environment');var jayson=require(_0x95f9('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x95f9('0xa')]=_['defaults'](config[_0x95f9('0xa')],{'host':_0x95f9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x95f9('0xa')]));require(_0x95f9('0xc'))[_0x95f9('0xd')](socket);function respondWithRpcPromise(_0x317195,_0x30e1a3,_0x17d728){return new BPromise(function(_0x43d69c,_0x205473){return client['request'](_0x317195,_0x17d728)[_0x95f9('0xe')](function(_0x6e316d){logger[_0x95f9('0xf')]('MailQueue,\x20%s,\x20%s',_0x30e1a3,_0x95f9('0x10'));logger[_0x95f9('0x11')](_0x95f9('0x12'),_0x30e1a3,_0x95f9('0x10'),JSON[_0x95f9('0x13')](_0x6e316d));if(_0x6e316d[_0x95f9('0x14')]){if(_0x6e316d[_0x95f9('0x14')][_0x95f9('0x15')]===0x1f4){logger[_0x95f9('0x14')]('MailQueue,\x20%s,\x20%s',_0x30e1a3,_0x6e316d['error'][_0x95f9('0x16')]);return _0x205473(_0x6e316d['error'][_0x95f9('0x16')]);}logger[_0x95f9('0x14')](_0x95f9('0x17'),_0x30e1a3,_0x6e316d[_0x95f9('0x14')][_0x95f9('0x16')]);return _0x43d69c(_0x6e316d[_0x95f9('0x14')]['message']);}else{logger['info'](_0x95f9('0x17'),_0x30e1a3,'request\x20sent');_0x43d69c(_0x6e316d[_0x95f9('0x18')]['message']);}})[_0x95f9('0x19')](function(_0x5a1170){logger['error'](_0x95f9('0x17'),_0x30e1a3,_0x5a1170);_0x205473(_0x5a1170);});});}exports[_0x95f9('0x1a')]=function(_0x48c39d){var _0x7c22c0=this;return new Promise(function(_0x2e8633,_0x2d024d){return db[_0x95f9('0x1b')][_0x95f9('0x1c')]({'raw':_0x48c39d['options']?_0x48c39d['options'][_0x95f9('0x1d')]===undefined?!![]:![]:!![],'where':_0x48c39d[_0x95f9('0x1e')]?_0x48c39d[_0x95f9('0x1e')][_0x95f9('0x1f')]||null:null,'attributes':_0x48c39d[_0x95f9('0x1e')]?_0x48c39d['options'][_0x95f9('0x20')]||null:null,'limit':_0x48c39d[_0x95f9('0x1e')]?_0x48c39d[_0x95f9('0x1e')]['limit']||null:null,'include':_0x48c39d[_0x95f9('0x1e')]?_0x48c39d[_0x95f9('0x1e')]['include']?_[_0x95f9('0x21')](_0x48c39d[_0x95f9('0x1e')]['include'],function(_0x1bf3d5){return{'model':db[_0x1bf3d5[_0x95f9('0x22')]],'as':_0x1bf3d5['as'],'attributes':_0x1bf3d5['attributes'],'include':_0x1bf3d5[_0x95f9('0x23')]?_[_0x95f9('0x21')](_0x1bf3d5[_0x95f9('0x23')],function(_0x374058){return{'model':db[_0x374058[_0x95f9('0x22')]],'as':_0x374058['as'],'attributes':_0x374058['attributes'],'include':_0x374058['include']?_['map'](_0x374058['include'],function(_0x462506){return{'model':db[_0x462506[_0x95f9('0x22')]],'as':_0x462506['as'],'attributes':_0x462506[_0x95f9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x95f9('0xe')](function(_0x2d4911){logger[_0x95f9('0xf')](_0x95f9('0x1a'),_0x48c39d);logger[_0x95f9('0x11')]('GetMailQueue',_0x48c39d,JSON[_0x95f9('0x13')](_0x2d4911));_0x2e8633(_0x2d4911);})[_0x95f9('0x19')](function(_0x513369){logger['error'](_0x95f9('0x1a'),_0x513369[_0x95f9('0x16')],_0x48c39d);_0x2d024d(_0x7c22c0['error'](0x1f4,_0x513369[_0x95f9('0x16')]));});});};exports['ShowMailQueue']=function(_0x20c60a){var _0x53b55c=this;return new Promise(function(_0x8802c4,_0x59f1ac){return db[_0x95f9('0x1b')][_0x95f9('0x24')]({'raw':_0x20c60a[_0x95f9('0x1e')]?_0x20c60a[_0x95f9('0x1e')][_0x95f9('0x1d')]===undefined?!![]:![]:!![],'where':_0x20c60a[_0x95f9('0x1e')]?_0x20c60a[_0x95f9('0x1e')]['where']||null:null,'attributes':_0x20c60a[_0x95f9('0x1e')]?_0x20c60a[_0x95f9('0x1e')]['attributes']||null:null,'include':_0x20c60a['options']?_0x20c60a[_0x95f9('0x1e')][_0x95f9('0x23')]?_['map'](_0x20c60a[_0x95f9('0x1e')][_0x95f9('0x23')],function(_0x5c3fea){return{'model':db[_0x5c3fea[_0x95f9('0x22')]],'as':_0x5c3fea['as'],'attributes':_0x5c3fea['attributes'],'include':_0x5c3fea[_0x95f9('0x23')]?_['map'](_0x5c3fea['include'],function(_0x3640d5){return{'model':db[_0x3640d5['model']],'as':_0x3640d5['as'],'attributes':_0x3640d5['attributes'],'include':_0x3640d5[_0x95f9('0x23')]?_['map'](_0x3640d5['include'],function(_0x416afb){return{'model':db[_0x416afb[_0x95f9('0x22')]],'as':_0x416afb['as'],'attributes':_0x416afb[_0x95f9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x95f9('0xe')](function(_0x56e987){logger[_0x95f9('0xf')](_0x95f9('0x25'),_0x20c60a);logger[_0x95f9('0x11')](_0x95f9('0x25'),_0x20c60a,JSON['stringify'](_0x56e987));_0x8802c4(_0x56e987);})['catch'](function(_0x500f2e){logger[_0x95f9('0x14')](_0x95f9('0x25'),_0x500f2e[_0x95f9('0x16')],_0x20c60a);_0x59f1ac(_0x53b55c[_0x95f9('0x14')](0x1f4,_0x500f2e[_0x95f9('0x16')]));});});}; \ No newline at end of file +var _0xd352=['findAll','options','raw','where','attributes','include','model','map','then','GetMailQueue','ShowMailQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailQueue'];(function(_0x10b12a,_0x1000c1){var _0x522a92=function(_0x159485){while(--_0x159485){_0x10b12a['push'](_0x10b12a['shift']());}};_0x522a92(++_0x1000c1);}(_0xd352,0x13c));var _0x2d35=function(_0x484ffe,_0x23a14b){_0x484ffe=_0x484ffe-0x0;var _0xc4c541=_0xd352[_0x484ffe];return _0xc4c541;};'use strict';var _=require(_0x2d35('0x0'));var util=require(_0x2d35('0x1'));var moment=require(_0x2d35('0x2'));var BPromise=require(_0x2d35('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d35('0x4'));var db=require(_0x2d35('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d35('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2d35('0x7'));var client=jayson['client'][_0x2d35('0x8')]({'port':0x232a});config[_0x2d35('0x9')]=_[_0x2d35('0xa')](config[_0x2d35('0x9')],{'host':_0x2d35('0xb'),'port':0x18eb});var socket=require(_0x2d35('0xc'))(new Redis(config[_0x2d35('0x9')]));require('./mailQueue.socket')[_0x2d35('0xd')](socket);function respondWithRpcPromise(_0x3a460b,_0x4f5cc3,_0xe41aab){return new BPromise(function(_0x436168,_0x278422){return client['request'](_0x3a460b,_0xe41aab)['then'](function(_0x2345d8){logger[_0x2d35('0xe')](_0x2d35('0xf'),_0x4f5cc3,_0x2d35('0x10'));logger[_0x2d35('0x11')](_0x2d35('0x12'),_0x4f5cc3,'request\x20sent',JSON[_0x2d35('0x13')](_0x2345d8));if(_0x2345d8[_0x2d35('0x14')]){if(_0x2345d8['error'][_0x2d35('0x15')]===0x1f4){logger[_0x2d35('0x14')](_0x2d35('0xf'),_0x4f5cc3,_0x2345d8['error']['message']);return _0x278422(_0x2345d8[_0x2d35('0x14')][_0x2d35('0x16')]);}logger[_0x2d35('0x14')](_0x2d35('0xf'),_0x4f5cc3,_0x2345d8[_0x2d35('0x14')][_0x2d35('0x16')]);return _0x436168(_0x2345d8[_0x2d35('0x14')][_0x2d35('0x16')]);}else{logger[_0x2d35('0xe')](_0x2d35('0xf'),_0x4f5cc3,'request\x20sent');_0x436168(_0x2345d8[_0x2d35('0x17')][_0x2d35('0x16')]);}})[_0x2d35('0x18')](function(_0x15c39c){logger['error'](_0x2d35('0xf'),_0x4f5cc3,_0x15c39c);_0x278422(_0x15c39c);});});}exports['GetMailQueue']=function(_0xd09289){var _0x56b9bd=this;return new Promise(function(_0x534a1b,_0x29ac46){return db[_0x2d35('0x19')][_0x2d35('0x1a')]({'raw':_0xd09289[_0x2d35('0x1b')]?_0xd09289['options'][_0x2d35('0x1c')]===undefined?!![]:![]:!![],'where':_0xd09289[_0x2d35('0x1b')]?_0xd09289[_0x2d35('0x1b')][_0x2d35('0x1d')]||null:null,'attributes':_0xd09289[_0x2d35('0x1b')]?_0xd09289[_0x2d35('0x1b')][_0x2d35('0x1e')]||null:null,'limit':_0xd09289[_0x2d35('0x1b')]?_0xd09289['options']['limit']||null:null,'include':_0xd09289[_0x2d35('0x1b')]?_0xd09289[_0x2d35('0x1b')][_0x2d35('0x1f')]?_['map'](_0xd09289[_0x2d35('0x1b')][_0x2d35('0x1f')],function(_0x18a08b){return{'model':db[_0x18a08b[_0x2d35('0x20')]],'as':_0x18a08b['as'],'attributes':_0x18a08b[_0x2d35('0x1e')],'include':_0x18a08b['include']?_[_0x2d35('0x21')](_0x18a08b[_0x2d35('0x1f')],function(_0x2d9d25){return{'model':db[_0x2d9d25['model']],'as':_0x2d9d25['as'],'attributes':_0x2d9d25[_0x2d35('0x1e')],'include':_0x2d9d25['include']?_[_0x2d35('0x21')](_0x2d9d25['include'],function(_0x82464c){return{'model':db[_0x82464c[_0x2d35('0x20')]],'as':_0x82464c['as'],'attributes':_0x82464c[_0x2d35('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2d35('0x22')](function(_0x407631){logger[_0x2d35('0xe')]('GetMailQueue',_0xd09289);logger[_0x2d35('0x11')](_0x2d35('0x23'),_0xd09289,JSON['stringify'](_0x407631));_0x534a1b(_0x407631);})[_0x2d35('0x18')](function(_0x8365aa){logger[_0x2d35('0x14')](_0x2d35('0x23'),_0x8365aa['message'],_0xd09289);_0x29ac46(_0x56b9bd[_0x2d35('0x14')](0x1f4,_0x8365aa[_0x2d35('0x16')]));});});};exports[_0x2d35('0x24')]=function(_0x4eb79b){var _0x509460=this;return new Promise(function(_0x47d43a,_0x302b1c){return db[_0x2d35('0x19')][_0x2d35('0x25')]({'raw':_0x4eb79b[_0x2d35('0x1b')]?_0x4eb79b[_0x2d35('0x1b')][_0x2d35('0x1c')]===undefined?!![]:![]:!![],'where':_0x4eb79b['options']?_0x4eb79b[_0x2d35('0x1b')]['where']||null:null,'attributes':_0x4eb79b[_0x2d35('0x1b')]?_0x4eb79b[_0x2d35('0x1b')][_0x2d35('0x1e')]||null:null,'include':_0x4eb79b[_0x2d35('0x1b')]?_0x4eb79b[_0x2d35('0x1b')][_0x2d35('0x1f')]?_[_0x2d35('0x21')](_0x4eb79b[_0x2d35('0x1b')]['include'],function(_0xee780f){return{'model':db[_0xee780f[_0x2d35('0x20')]],'as':_0xee780f['as'],'attributes':_0xee780f['attributes'],'include':_0xee780f['include']?_[_0x2d35('0x21')](_0xee780f[_0x2d35('0x1f')],function(_0x35e894){return{'model':db[_0x35e894[_0x2d35('0x20')]],'as':_0x35e894['as'],'attributes':_0x35e894['attributes'],'include':_0x35e894[_0x2d35('0x1f')]?_['map'](_0x35e894[_0x2d35('0x1f')],function(_0x4707de){return{'model':db[_0x4707de[_0x2d35('0x20')]],'as':_0x4707de['as'],'attributes':_0x4707de[_0x2d35('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2d35('0x22')](function(_0x22d0a6){logger['info'](_0x2d35('0x24'),_0x4eb79b);logger[_0x2d35('0x11')](_0x2d35('0x24'),_0x4eb79b,JSON[_0x2d35('0x13')](_0x22d0a6));_0x47d43a(_0x22d0a6);})[_0x2d35('0x18')](function(_0x2fde1a){logger[_0x2d35('0x14')]('ShowMailQueue',_0x2fde1a[_0x2d35('0x16')],_0x4eb79b);_0x302b1c(_0x509460[_0x2d35('0x14')](0x1f4,_0x2fde1a[_0x2d35('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index e099905..afd3075 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 _0xec63=['emit','removeListener','register','length','mailQueue:','./mailQueue.events','remove','update'];(function(_0x5ec924,_0x1fde7b){var _0xbb930e=function(_0x16cb8f){while(--_0x16cb8f){_0x5ec924['push'](_0x5ec924['shift']());}};_0xbb930e(++_0x1fde7b);}(_0xec63,0x11d));var _0x3ec6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec63[_0x20a584];return _0x4b41a8;};'use strict';var MailQueueEvents=require(_0x3ec6('0x0'));var events=['save',_0x3ec6('0x1'),_0x3ec6('0x2')];function createListener(_0x28a3ec,_0x480754){return function(_0x196ae3){_0x480754[_0x3ec6('0x3')](_0x28a3ec,_0x196ae3);};}function removeListener(_0x36b5bc,_0x4f337d){return function(){MailQueueEvents[_0x3ec6('0x4')](_0x36b5bc,_0x4f337d);};}exports[_0x3ec6('0x5')]=function(_0x264edc){for(var _0x7f20e4=0x0,_0x552588=events[_0x3ec6('0x6')];_0x7f20e4<_0x552588;_0x7f20e4++){var _0x200dfb=events[_0x7f20e4];var _0x249fc0=createListener(_0x3ec6('0x7')+_0x200dfb,_0x264edc);MailQueueEvents['on'](_0x200dfb,_0x249fc0);}}; \ No newline at end of file +var _0x7032=['removeListener','register','length','mailQueue:','./mailQueue.events','remove','update','emit'];(function(_0x1406ae,_0x292395){var _0x23a076=function(_0x5e147a){while(--_0x5e147a){_0x1406ae['push'](_0x1406ae['shift']());}};_0x23a076(++_0x292395);}(_0x7032,0x154));var _0x2703=function(_0x293a6b,_0x3b9ede){_0x293a6b=_0x293a6b-0x0;var _0x2d371c=_0x7032[_0x293a6b];return _0x2d371c;};'use strict';var MailQueueEvents=require(_0x2703('0x0'));var events=['save',_0x2703('0x1'),_0x2703('0x2')];function createListener(_0x260afd,_0x4b91a7){return function(_0x2af25d){_0x4b91a7[_0x2703('0x3')](_0x260afd,_0x2af25d);};}function removeListener(_0x1f6fa3,_0x5a898f){return function(){MailQueueEvents[_0x2703('0x4')](_0x1f6fa3,_0x5a898f);};}exports[_0x2703('0x5')]=function(_0x264786){for(var _0x20d353=0x0,_0xfb1cd8=events[_0x2703('0x6')];_0x20d353<_0xfb1cd8;_0x20d353++){var _0xd268e9=events[_0x20d353];var _0x39af52=createListener(_0x2703('0x7')+_0xd268e9,_0x264786);MailQueueEvents['on'](_0xd268e9,_0x39af52);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index b50dde2..208a6f4 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 _0x0834=['connect-timeout','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','path'];(function(_0x38f01c,_0xaac2f3){var _0x20813e=function(_0x355e80){while(--_0x355e80){_0x38f01c['push'](_0x38f01c['shift']());}};_0x20813e(++_0xaac2f3);}(_0x0834,0x18e));var _0x4083=function(_0x1df8f7,_0x2b9a85){_0x1df8f7=_0x1df8f7-0x0;var _0x497e8a=_0x0834[_0x1df8f7];return _0x497e8a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4083('0x0'));var timeout=require(_0x4083('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4083('0x2'));var interaction=require(_0x4083('0x3'));var config=require('../../config/environment');var controller=require(_0x4083('0x4'));router[_0x4083('0x5')]('/',auth['isAuthenticated'](),controller[_0x4083('0x6')]);router['get'](_0x4083('0x7'),auth[_0x4083('0x8')](),controller[_0x4083('0x9')]);router[_0x4083('0x5')](_0x4083('0xa'),auth[_0x4083('0x8')](),controller[_0x4083('0xb')]);router[_0x4083('0xc')]('/',auth[_0x4083('0x8')](),controller[_0x4083('0xd')]);router[_0x4083('0xe')](_0x4083('0xa'),auth[_0x4083('0x8')](),controller[_0x4083('0xf')]);router[_0x4083('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4083('0x11')]);module[_0x4083('0x12')]=router; \ No newline at end of file +var _0x6a24=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','describe','/:id','show','create','put','update','delete','exports'];(function(_0x53e8b1,_0x50150d){var _0x20f85e=function(_0x3f30e2){while(--_0x3f30e2){_0x53e8b1['push'](_0x53e8b1['shift']());}};_0x20f85e(++_0x50150d);}(_0x6a24,0xd1));var _0x46a2=function(_0x4edade,_0x286ad2){_0x4edade=_0x4edade-0x0;var _0x45ec07=_0x6a24[_0x4edade];return _0x45ec07;};'use strict';var multer=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var path=require('path');var timeout=require(_0x46a2('0x2'));var express=require(_0x46a2('0x3'));var router=express[_0x46a2('0x4')]();var fs_extra=require(_0x46a2('0x5'));var auth=require(_0x46a2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x46a2('0x7'));var controller=require(_0x46a2('0x8'));router['get']('/',auth[_0x46a2('0x9')](),controller[_0x46a2('0xa')]);router['get']('/describe',auth[_0x46a2('0x9')](),controller[_0x46a2('0xb')]);router['get'](_0x46a2('0xc'),auth['isAuthenticated'](),controller[_0x46a2('0xd')]);router['post']('/',auth[_0x46a2('0x9')](),controller[_0x46a2('0xe')]);router[_0x46a2('0xf')](_0x46a2('0xc'),auth[_0x46a2('0x9')](),controller[_0x46a2('0x10')]);router[_0x46a2('0x11')](_0x46a2('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x46a2('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 48d4751..fa08e4c 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 _0x3769=['STRING','DATE','sequelize'];(function(_0x15fc7a,_0xd21741){var _0x3aa9f4=function(_0x313108){while(--_0x313108){_0x15fc7a['push'](_0x15fc7a['shift']());}};_0x3aa9f4(++_0xd21741);}(_0x3769,0x104));var _0x9376=function(_0x4f8163,_0x19356f){_0x4f8163=_0x4f8163-0x0;var _0x1b673e=_0x3769[_0x4f8163];return _0x1b673e;};'use strict';var moment=require('moment');var Sequelize=require(_0x9376('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9376('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x9376('0x1')]},'joinAt':{'type':Sequelize[_0x9376('0x2')]},'leaveAt':{'type':Sequelize[_0x9376('0x2')]},'acceptAt':{'type':Sequelize[_0x9376('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2c44=['sequelize','exports','STRING','DATE','moment'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0x2c44,0xc7));var _0x42c4=function(_0x5a5aa0,_0x2c88d0){_0x5a5aa0=_0x5a5aa0-0x0;var _0x5007bd=_0x2c44[_0x5a5aa0];return _0x5007bd;};'use strict';var moment=require(_0x42c4('0x0'));var Sequelize=require(_0x42c4('0x1'));module[_0x42c4('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x42c4('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x42c4('0x4')]},'acceptAt':{'type':Sequelize[_0x42c4('0x4')]},'exitAt':{'type':Sequelize[_0x42c4('0x4')]},'reason':{'type':Sequelize[_0x42c4('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index de4298a..a79a7b6 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 _0x4bfe=['Content-Range','apply','update','destroy','then','sendStatus','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','count','offset','limit','set'];(function(_0x1609fc,_0x35fd25){var _0x394ff2=function(_0x2fa291){while(--_0x2fa291){_0x1609fc['push'](_0x1609fc['shift']());}};_0x394ff2(++_0x35fd25);}(_0x4bfe,0x1d3));var _0xe4bf=function(_0x248e23,_0x2fac24){_0x248e23=_0x248e23-0x0;var _0x2e5fb9=_0x4bfe[_0x248e23];return _0x2e5fb9;};'use strict';var emlformat=require(_0xe4bf('0x0'));var rimraf=require(_0xe4bf('0x1'));var zipdir=require(_0xe4bf('0x2'));var jsonpatch=require(_0xe4bf('0x3'));var rp=require(_0xe4bf('0x4'));var moment=require('moment');var BPromise=require(_0xe4bf('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe4bf('0x6'));var sox=require(_0xe4bf('0x7'));var csv=require(_0xe4bf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4bf('0x9'));var squel=require(_0xe4bf('0xa'));var crypto=require(_0xe4bf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe4bf('0x8'));var querystring=require(_0xe4bf('0xc'));var Papa=require(_0xe4bf('0xd'));var Redis=require(_0xe4bf('0xe'));var authService=require(_0xe4bf('0xf'));var qs=require(_0xe4bf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4bf('0x11'));var logger=require(_0xe4bf('0x12'))(_0xe4bf('0x13'));var utils=require('../../config/utils');var config=require(_0xe4bf('0x14'));var licenseUtil=require(_0xe4bf('0x15'));var db=require(_0xe4bf('0x16'))['db'];function respondWithStatusCode(_0x2f8cc9,_0x52978b){_0x52978b=_0x52978b||0xcc;return function(_0x56ce45){if(_0x56ce45){return _0x2f8cc9['sendStatus'](_0x52978b);}return _0x2f8cc9['status'](_0x52978b)[_0xe4bf('0x17')]();};}function respondWithResult(_0x3bbff9,_0x16d911){_0x16d911=_0x16d911||0xc8;return function(_0x4e0a5a){if(_0x4e0a5a){return _0x3bbff9[_0xe4bf('0x18')](_0x16d911)[_0xe4bf('0x19')](_0x4e0a5a);}};}function respondWithFilteredResult(_0x28f602,_0x3e432e){return function(_0x3d526b){if(_0x3d526b){var _0x4a3dd2=_0x3d526b[_0xe4bf('0x1a')],_0x570d7a=_0x3e432e[_0xe4bf('0x1b')],_0x19cf27=_0x3e432e[_0xe4bf('0x1b')]+_0x3e432e[_0xe4bf('0x1c')],_0x56f741;if(_0x19cf27>=_0x4a3dd2){_0x19cf27=_0x4a3dd2;_0x56f741=0xc8;}else{_0x56f741=0xce;}_0x28f602[_0xe4bf('0x18')](_0x56f741);return _0x28f602[_0xe4bf('0x1d')](_0xe4bf('0x1e'),_0x570d7a+'-'+_0x19cf27+'/'+_0x4a3dd2)[_0xe4bf('0x19')](_0x3d526b);}return null;};}function patchUpdates(_0xbfab72){return function(_0x3a8def){try{jsonpatch[_0xe4bf('0x1f')](_0x3a8def,_0xbfab72,!![]);}catch(_0x2948b8){return BPromise['reject'](_0x2948b8);}return _0x3a8def['save']();};}function saveUpdates(_0x159747,_0x398d09){return function(_0x531de2){if(_0x531de2){return _0x531de2[_0xe4bf('0x20')](_0x159747)['then'](function(_0x5bc4d0){return _0x5bc4d0;});}return null;};}function removeEntity(_0x3accfc,_0x1d8c18){return function(_0x537ff6){if(_0x537ff6){return _0x537ff6[_0xe4bf('0x21')]()[_0xe4bf('0x22')](function(){_0x3accfc[_0xe4bf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c3cf3,_0x2295c7){return function(_0x130a21){if(!_0x130a21){_0x2c3cf3[_0xe4bf('0x23')](0x194);}return _0x130a21;};}function handleError(_0x3cfb60,_0x5baf83){_0x5baf83=_0x5baf83||0x1f4;return function(_0x124723){logger['error'](_0x124723[_0xe4bf('0x24')]);if(_0x124723[_0xe4bf('0x25')]){delete _0x124723[_0xe4bf('0x25')];}_0x3cfb60['status'](_0x5baf83)[_0xe4bf('0x26')](_0x124723);};}exports[_0xe4bf('0x27')]=function(_0x27021d,_0x54b6b6){var _0x34f5dd={},_0x30646b={},_0x5c77b8={'count':0x0,'rows':[]};var _0xd01887=_['map'](db[_0xe4bf('0x28')][_0xe4bf('0x29')],function(_0x530e5){return{'name':_0x530e5[_0xe4bf('0x2a')],'type':_0x530e5[_0xe4bf('0x2b')]['key']};});_0x30646b[_0xe4bf('0x2c')]=_[_0xe4bf('0x2d')](_0xd01887,'name');_0x30646b[_0xe4bf('0x2e')]=_['keys'](_0x27021d[_0xe4bf('0x2e')]);_0x30646b[_0xe4bf('0x2f')]=_['intersection'](_0x30646b[_0xe4bf('0x2c')],_0x30646b[_0xe4bf('0x2e')]);_0x34f5dd[_0xe4bf('0x30')]=_[_0xe4bf('0x31')](_0x30646b[_0xe4bf('0x2c')],qs[_0xe4bf('0x32')](_0x27021d[_0xe4bf('0x2e')][_0xe4bf('0x32')]));_0x34f5dd[_0xe4bf('0x30')]=_0x34f5dd[_0xe4bf('0x30')][_0xe4bf('0x33')]?_0x34f5dd[_0xe4bf('0x30')]:_0x30646b[_0xe4bf('0x2c')];if(!_0x27021d[_0xe4bf('0x2e')][_0xe4bf('0x34')]('nolimit')){_0x34f5dd[_0xe4bf('0x1c')]=qs[_0xe4bf('0x1c')](_0x27021d[_0xe4bf('0x2e')]['limit']);_0x34f5dd['offset']=qs[_0xe4bf('0x1b')](_0x27021d[_0xe4bf('0x2e')][_0xe4bf('0x1b')]);}_0x34f5dd[_0xe4bf('0x35')]=qs[_0xe4bf('0x36')](_0x27021d['query'][_0xe4bf('0x36')]);_0x34f5dd['where']=qs[_0xe4bf('0x2f')](_['pick'](_0x27021d['query'],_0x30646b['filters']),_0xd01887);if(_0x27021d['query'][_0xe4bf('0x37')]){_0x34f5dd[_0xe4bf('0x38')]=_[_0xe4bf('0x39')](_0x34f5dd['where'],{'$or':_[_0xe4bf('0x2d')](_0xd01887,function(_0xa074b3){if(_0xa074b3[_0xe4bf('0x2b')]!==_0xe4bf('0x3a')){var _0x2fcb14={};_0x2fcb14[_0xa074b3[_0xe4bf('0x25')]]={'$like':'%'+_0x27021d['query'][_0xe4bf('0x37')]+'%'};return _0x2fcb14;}})});}_0x34f5dd=_[_0xe4bf('0x39')]({},_0x34f5dd,_0x27021d[_0xe4bf('0x3b')]);var _0x4c835d={'where':_0x34f5dd[_0xe4bf('0x38')]};return db[_0xe4bf('0x28')][_0xe4bf('0x1a')](_0x4c835d)[_0xe4bf('0x22')](function(_0x2d1d64){_0x5c77b8['count']=_0x2d1d64;if(_0x27021d[_0xe4bf('0x2e')][_0xe4bf('0x3c')]){_0x34f5dd[_0xe4bf('0x3d')]=[{'all':!![]}];}return db[_0xe4bf('0x28')][_0xe4bf('0x3e')](_0x34f5dd);})[_0xe4bf('0x22')](function(_0x5845fb){_0x5c77b8[_0xe4bf('0x3f')]=_0x5845fb;return _0x5c77b8;})[_0xe4bf('0x22')](respondWithFilteredResult(_0x54b6b6,_0x34f5dd))[_0xe4bf('0x40')](handleError(_0x54b6b6,null));};exports[_0xe4bf('0x41')]=function(_0x1450b0,_0x32e83f){var _0x856b3b={'raw':!![],'where':{'id':_0x1450b0['params']['id']}},_0x8e4bb6={};_0x8e4bb6[_0xe4bf('0x2c')]=_[_0xe4bf('0x42')](db[_0xe4bf('0x28')]['rawAttributes']);_0x8e4bb6[_0xe4bf('0x2e')]=_[_0xe4bf('0x42')](_0x1450b0['query']);_0x8e4bb6[_0xe4bf('0x2f')]=_[_0xe4bf('0x31')](_0x8e4bb6[_0xe4bf('0x2c')],_0x8e4bb6['query']);_0x856b3b[_0xe4bf('0x30')]=_[_0xe4bf('0x31')](_0x8e4bb6[_0xe4bf('0x2c')],qs[_0xe4bf('0x32')](_0x1450b0[_0xe4bf('0x2e')][_0xe4bf('0x32')]));_0x856b3b[_0xe4bf('0x30')]=_0x856b3b[_0xe4bf('0x30')][_0xe4bf('0x33')]?_0x856b3b['attributes']:_0x8e4bb6['model'];if(_0x1450b0['query']['includeAll']){_0x856b3b['include']=[{'all':!![]}];}_0x856b3b=_['merge']({},_0x856b3b,_0x1450b0[_0xe4bf('0x3b')]);return db[_0xe4bf('0x28')][_0xe4bf('0x43')](_0x856b3b)[_0xe4bf('0x22')](handleEntityNotFound(_0x32e83f,null))['then'](respondWithResult(_0x32e83f,null))[_0xe4bf('0x40')](handleError(_0x32e83f,null));};exports[_0xe4bf('0x44')]=function(_0x2cccd4,_0x414089){return db[_0xe4bf('0x28')][_0xe4bf('0x44')](_0x2cccd4[_0xe4bf('0x45')],{})['then'](respondWithResult(_0x414089,0xc9))[_0xe4bf('0x40')](handleError(_0x414089,null));};exports[_0xe4bf('0x20')]=function(_0x887324,_0x76a0c){if(_0x887324[_0xe4bf('0x45')]['id']){delete _0x887324[_0xe4bf('0x45')]['id'];}return db[_0xe4bf('0x28')]['find']({'where':{'id':_0x887324['params']['id']}})[_0xe4bf('0x22')](handleEntityNotFound(_0x76a0c,null))[_0xe4bf('0x22')](saveUpdates(_0x887324[_0xe4bf('0x45')],null))[_0xe4bf('0x22')](respondWithResult(_0x76a0c,null))['catch'](handleError(_0x76a0c,null));};exports[_0xe4bf('0x21')]=function(_0x483118,_0xa2344d){return db['MailQueueReport']['find']({'where':{'id':_0x483118[_0xe4bf('0x46')]['id']}})[_0xe4bf('0x22')](handleEntityNotFound(_0xa2344d,null))['then'](removeEntity(_0xa2344d,null))[_0xe4bf('0x40')](handleError(_0xa2344d,null));};exports['describe']=function(_0x48b472,_0x472041){return db[_0xe4bf('0x28')]['describe']()[_0xe4bf('0x22')](respondWithResult(_0x472041,null))[_0xe4bf('0x40')](handleError(_0x472041,null));}; \ No newline at end of file +var _0x7b9f=['options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','MailQueueReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge'];(function(_0x3afe73,_0x556877){var _0x51c279=function(_0x162c3d){while(--_0x162c3d){_0x3afe73['push'](_0x3afe73['shift']());}};_0x51c279(++_0x556877);}(_0x7b9f,0xa2));var _0xf7b9=function(_0x45387d,_0x4f1519){_0x45387d=_0x45387d-0x0;var _0x4d1a0f=_0x7b9f[_0x45387d];return _0x4d1a0f;};'use strict';var emlformat=require(_0xf7b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7b9('0x1'));var jsonpatch=require(_0xf7b9('0x2'));var rp=require(_0xf7b9('0x3'));var moment=require(_0xf7b9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf7b9('0x5'));var path=require(_0xf7b9('0x6'));var sox=require(_0xf7b9('0x7'));var csv=require(_0xf7b9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7b9('0x9'));var squel=require(_0xf7b9('0xa'));var crypto=require(_0xf7b9('0xb'));var jsforce=require(_0xf7b9('0xc'));var deskjs=require(_0xf7b9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf7b9('0xe'));var Papa=require(_0xf7b9('0xf'));var Redis=require('ioredis');var authService=require(_0xf7b9('0x10'));var qs=require(_0xf7b9('0x11'));var as=require(_0xf7b9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7b9('0x13'))(_0xf7b9('0x14'));var utils=require(_0xf7b9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf7b9('0x16'));var db=require(_0xf7b9('0x17'))['db'];function respondWithStatusCode(_0x492908,_0x1004ba){_0x1004ba=_0x1004ba||0xcc;return function(_0x30babc){if(_0x30babc){return _0x492908[_0xf7b9('0x18')](_0x1004ba);}return _0x492908[_0xf7b9('0x19')](_0x1004ba)[_0xf7b9('0x1a')]();};}function respondWithResult(_0x193549,_0x4fd6bf){_0x4fd6bf=_0x4fd6bf||0xc8;return function(_0x4e5d9e){if(_0x4e5d9e){return _0x193549['status'](_0x4fd6bf)['json'](_0x4e5d9e);}};}function respondWithFilteredResult(_0x766815,_0x8c034e){return function(_0xcc0ec7){if(_0xcc0ec7){var _0x40b438=_0xcc0ec7[_0xf7b9('0x1b')],_0x809fb2=_0x8c034e[_0xf7b9('0x1c')],_0x621656=_0x8c034e[_0xf7b9('0x1c')]+_0x8c034e[_0xf7b9('0x1d')],_0x10ed4e;if(_0x621656>=_0x40b438){_0x621656=_0x40b438;_0x10ed4e=0xc8;}else{_0x10ed4e=0xce;}_0x766815['status'](_0x10ed4e);return _0x766815[_0xf7b9('0x1e')](_0xf7b9('0x1f'),_0x809fb2+'-'+_0x621656+'/'+_0x40b438)[_0xf7b9('0x20')](_0xcc0ec7);}return null;};}function patchUpdates(_0x5e13cf){return function(_0x42c77b){try{jsonpatch[_0xf7b9('0x21')](_0x42c77b,_0x5e13cf,!![]);}catch(_0x9865cd){return BPromise[_0xf7b9('0x22')](_0x9865cd);}return _0x42c77b[_0xf7b9('0x23')]();};}function saveUpdates(_0x4d48cb,_0x8ef1de){return function(_0x9a4df6){if(_0x9a4df6){return _0x9a4df6['update'](_0x4d48cb)[_0xf7b9('0x24')](function(_0x58189a){return _0x58189a;});}return null;};}function removeEntity(_0x8baa40,_0xbd2c4f){return function(_0x14a05f){if(_0x14a05f){return _0x14a05f[_0xf7b9('0x25')]()[_0xf7b9('0x24')](function(){_0x8baa40['status'](0xcc)[_0xf7b9('0x1a')]();});}};}function handleEntityNotFound(_0x4b4c61,_0x22a7e8){return function(_0x5048bd){if(!_0x5048bd){_0x4b4c61[_0xf7b9('0x18')](0x194);}return _0x5048bd;};}function handleError(_0x5e660d,_0x21b007){_0x21b007=_0x21b007||0x1f4;return function(_0x529c9d){logger['error'](_0x529c9d[_0xf7b9('0x26')]);if(_0x529c9d['name']){delete _0x529c9d[_0xf7b9('0x27')];}_0x5e660d['status'](_0x21b007)[_0xf7b9('0x28')](_0x529c9d);};}exports[_0xf7b9('0x29')]=function(_0x28ba8a,_0x40097b){var _0x340d17={},_0x88407={},_0x4f300e={'count':0x0,'rows':[]};var _0x5406f3=_['map'](db[_0xf7b9('0x2a')][_0xf7b9('0x2b')],function(_0x26a59a){return{'name':_0x26a59a['fieldName'],'type':_0x26a59a[_0xf7b9('0x2c')][_0xf7b9('0x2d')]};});_0x88407[_0xf7b9('0x2e')]=_['map'](_0x5406f3,_0xf7b9('0x27'));_0x88407['query']=_[_0xf7b9('0x2f')](_0x28ba8a[_0xf7b9('0x30')]);_0x88407[_0xf7b9('0x31')]=_[_0xf7b9('0x32')](_0x88407[_0xf7b9('0x2e')],_0x88407[_0xf7b9('0x30')]);_0x340d17[_0xf7b9('0x33')]=_[_0xf7b9('0x32')](_0x88407[_0xf7b9('0x2e')],qs[_0xf7b9('0x34')](_0x28ba8a[_0xf7b9('0x30')][_0xf7b9('0x34')]));_0x340d17['attributes']=_0x340d17['attributes'][_0xf7b9('0x35')]?_0x340d17[_0xf7b9('0x33')]:_0x88407[_0xf7b9('0x2e')];if(!_0x28ba8a['query'][_0xf7b9('0x36')](_0xf7b9('0x37'))){_0x340d17[_0xf7b9('0x1d')]=qs[_0xf7b9('0x1d')](_0x28ba8a['query'][_0xf7b9('0x1d')]);_0x340d17['offset']=qs[_0xf7b9('0x1c')](_0x28ba8a['query']['offset']);}_0x340d17[_0xf7b9('0x38')]=qs[_0xf7b9('0x39')](_0x28ba8a['query'][_0xf7b9('0x39')]);_0x340d17[_0xf7b9('0x3a')]=qs[_0xf7b9('0x31')](_[_0xf7b9('0x3b')](_0x28ba8a[_0xf7b9('0x30')],_0x88407['filters']),_0x5406f3);if(_0x28ba8a[_0xf7b9('0x30')][_0xf7b9('0x3c')]){_0x340d17[_0xf7b9('0x3a')]=_['merge'](_0x340d17[_0xf7b9('0x3a')],{'$or':_[_0xf7b9('0x3d')](_0x5406f3,function(_0x31adea){if(_0x31adea[_0xf7b9('0x2c')]!=='VIRTUAL'){var _0x1dd908={};_0x1dd908[_0x31adea[_0xf7b9('0x27')]]={'$like':'%'+_0x28ba8a[_0xf7b9('0x30')]['filter']+'%'};return _0x1dd908;}})});}_0x340d17=_[_0xf7b9('0x3e')]({},_0x340d17,_0x28ba8a[_0xf7b9('0x3f')]);var _0xf31d79={'where':_0x340d17['where']};return db[_0xf7b9('0x2a')][_0xf7b9('0x1b')](_0xf31d79)[_0xf7b9('0x24')](function(_0x480f2e){_0x4f300e[_0xf7b9('0x1b')]=_0x480f2e;if(_0x28ba8a[_0xf7b9('0x30')][_0xf7b9('0x40')]){_0x340d17[_0xf7b9('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0xf7b9('0x42')](_0x340d17);})[_0xf7b9('0x24')](function(_0x440487){_0x4f300e[_0xf7b9('0x43')]=_0x440487;return _0x4f300e;})[_0xf7b9('0x24')](respondWithFilteredResult(_0x40097b,_0x340d17))['catch'](handleError(_0x40097b,null));};exports[_0xf7b9('0x44')]=function(_0x44da95,_0x52c61c){var _0x436aea={'raw':!![],'where':{'id':_0x44da95['params']['id']}},_0x35c9db={};_0x35c9db[_0xf7b9('0x2e')]=_[_0xf7b9('0x2f')](db[_0xf7b9('0x2a')][_0xf7b9('0x2b')]);_0x35c9db['query']=_[_0xf7b9('0x2f')](_0x44da95['query']);_0x35c9db[_0xf7b9('0x31')]=_[_0xf7b9('0x32')](_0x35c9db[_0xf7b9('0x2e')],_0x35c9db['query']);_0x436aea['attributes']=_['intersection'](_0x35c9db[_0xf7b9('0x2e')],qs['fields'](_0x44da95[_0xf7b9('0x30')][_0xf7b9('0x34')]));_0x436aea[_0xf7b9('0x33')]=_0x436aea[_0xf7b9('0x33')]['length']?_0x436aea[_0xf7b9('0x33')]:_0x35c9db[_0xf7b9('0x2e')];if(_0x44da95['query']['includeAll']){_0x436aea[_0xf7b9('0x41')]=[{'all':!![]}];}_0x436aea=_['merge']({},_0x436aea,_0x44da95['options']);return db['MailQueueReport'][_0xf7b9('0x45')](_0x436aea)[_0xf7b9('0x24')](handleEntityNotFound(_0x52c61c,null))[_0xf7b9('0x24')](respondWithResult(_0x52c61c,null))[_0xf7b9('0x46')](handleError(_0x52c61c,null));};exports[_0xf7b9('0x47')]=function(_0x4b2e5a,_0x99c3a5){return db[_0xf7b9('0x2a')][_0xf7b9('0x47')](_0x4b2e5a[_0xf7b9('0x48')],{})['then'](respondWithResult(_0x99c3a5,0xc9))[_0xf7b9('0x46')](handleError(_0x99c3a5,null));};exports['update']=function(_0x2dae9a,_0x1e7144){if(_0x2dae9a[_0xf7b9('0x48')]['id']){delete _0x2dae9a['body']['id'];}return db[_0xf7b9('0x2a')][_0xf7b9('0x45')]({'where':{'id':_0x2dae9a[_0xf7b9('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e7144,null))[_0xf7b9('0x24')](saveUpdates(_0x2dae9a[_0xf7b9('0x48')],null))['then'](respondWithResult(_0x1e7144,null))['catch'](handleError(_0x1e7144,null));};exports['destroy']=function(_0x86fb31,_0x1e1880){return db[_0xf7b9('0x2a')][_0xf7b9('0x45')]({'where':{'id':_0x86fb31[_0xf7b9('0x49')]['id']}})[_0xf7b9('0x24')](handleEntityNotFound(_0x1e1880,null))[_0xf7b9('0x24')](removeEntity(_0x1e1880,null))[_0xf7b9('0x46')](handleError(_0x1e1880,null));};exports[_0xf7b9('0x4a')]=function(_0x5430a4,_0x2aaefc){return db[_0xf7b9('0x2a')][_0xf7b9('0x4a')]()['then'](respondWithResult(_0x2aaefc,null))[_0xf7b9('0x46')](handleError(_0x2aaefc,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 4202f6f..9096300 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 _0xa07d=['define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x1137ec,_0x35f8a6){var _0x1b5f91=function(_0x188df6){while(--_0x188df6){_0x1137ec['push'](_0x1137ec['shift']());}};_0x1b5f91(++_0x35f8a6);}(_0xa07d,0x163));var _0xda07=function(_0xbf3f74,_0x1ae4bf){_0xbf3f74=_0xbf3f74-0x0;var _0xd26ead=_0xa07d[_0xbf3f74];return _0xd26ead;};'use strict';var _=require('lodash');var util=require(_0xda07('0x0'));var logger=require(_0xda07('0x1'))(_0xda07('0x2'));var moment=require('moment');var BPromise=require(_0xda07('0x3'));var rp=require(_0xda07('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda07('0x5'));var config=require(_0xda07('0x6'));var attributes=require(_0xda07('0x7'));module[_0xda07('0x8')]=function(_0x196fd9,_0x1e0a1c){return _0x196fd9[_0xda07('0x9')](_0xda07('0xa'),attributes,{'tableName':_0xda07('0xb'),'paranoid':![],'indexes':[{'name':_0xda07('0xc'),'fields':[_0xda07('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x45d4=['lodash','../../config/logger','moment','path','../../config/environment','./mailQueueReport.attributes','MailQueueReport','uniqueid'];(function(_0x504949,_0x386585){var _0x3358c6=function(_0x4634a7){while(--_0x4634a7){_0x504949['push'](_0x504949['shift']());}};_0x3358c6(++_0x386585);}(_0x45d4,0x170));var _0x445d=function(_0xd839e7,_0x4209e9){_0xd839e7=_0xd839e7-0x0;var _0xc3cf23=_0x45d4[_0xd839e7];return _0xc3cf23;};'use strict';var _=require(_0x445d('0x0'));var util=require('util');var logger=require(_0x445d('0x1'))('api');var moment=require(_0x445d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x445d('0x3'));var rimraf=require('rimraf');var config=require(_0x445d('0x4'));var attributes=require(_0x445d('0x5'));module['exports']=function(_0x489368,_0xa1ea57){return _0x489368['define'](_0x445d('0x6'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x445d('0x7'),'fields':[_0x445d('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 4d53a4f..a3d794a 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 _0xf48e=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','then','update','where','attributes','UpdateMailQueueReport'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0xf48e,0xa0));var _0xef48=function(_0x3b51bc,_0x544f75){_0x3b51bc=_0x3b51bc-0x0;var _0x1ea1a8=_0xf48e[_0x3b51bc];return _0x1ea1a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xef48('0x0'));var BPromise=require(_0xef48('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef48('0x2'));var db=require(_0xef48('0x3'))['db'];var utils=require(_0xef48('0x4'));var logger=require(_0xef48('0x5'))(_0xef48('0x6'));var config=require(_0xef48('0x7'));var jayson=require(_0xef48('0x8'));var client=jayson['client'][_0xef48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24533c,_0x2b1f0f,_0x3a94a5){return new BPromise(function(_0x138b87,_0x1c8c46){return client[_0xef48('0xa')](_0x24533c,_0x3a94a5)['then'](function(_0x1a0104){logger[_0xef48('0xb')](_0xef48('0xc'),_0x2b1f0f,_0xef48('0xd'));logger[_0xef48('0xe')](_0xef48('0xf'),_0x2b1f0f,_0xef48('0xd'),JSON[_0xef48('0x10')](_0x1a0104));if(_0x1a0104[_0xef48('0x11')]){if(_0x1a0104[_0xef48('0x11')][_0xef48('0x12')]===0x1f4){logger[_0xef48('0x11')](_0xef48('0xc'),_0x2b1f0f,_0x1a0104['error']['message']);return _0x1c8c46(_0x1a0104[_0xef48('0x11')]['message']);}logger[_0xef48('0x11')](_0xef48('0xc'),_0x2b1f0f,_0x1a0104[_0xef48('0x11')][_0xef48('0x13')]);return _0x138b87(_0x1a0104[_0xef48('0x11')]['message']);}else{logger[_0xef48('0xb')](_0xef48('0xc'),_0x2b1f0f,_0xef48('0xd'));_0x138b87(_0x1a0104['result'][_0xef48('0x13')]);}})[_0xef48('0x14')](function(_0x26f030){logger[_0xef48('0x11')](_0xef48('0xc'),_0x2b1f0f,_0x26f030);_0x1c8c46(_0x26f030);});});}exports[_0xef48('0x15')]=function(_0x458455){var _0x2dd2e4=this;return new Promise(function(_0x5623db,_0x5a0bb){return db[_0xef48('0x16')][_0xef48('0x17')](_0x458455[_0xef48('0x18')],{'raw':_0x458455[_0xef48('0x19')]?_0x458455[_0xef48('0x19')][_0xef48('0x1a')]===undefined?!![]:![]:!![]})[_0xef48('0x1b')](function(_0x335681){logger[_0xef48('0xb')](_0xef48('0x15'),_0x458455);logger['debug'](_0xef48('0x15'),_0x458455,JSON[_0xef48('0x10')](_0x335681));_0x5623db(_0x335681);})[_0xef48('0x14')](function(_0xec95af){logger[_0xef48('0x11')](_0xef48('0x15'),_0xec95af[_0xef48('0x13')],_0x458455);_0x5a0bb(_0x2dd2e4[_0xef48('0x11')](0x1f4,_0xec95af[_0xef48('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x1ef566){var _0x1ae32b=this;return new Promise(function(_0x1dd677,_0x5abd41){return db[_0xef48('0x16')][_0xef48('0x1c')](_0x1ef566[_0xef48('0x18')],{'raw':_0x1ef566[_0xef48('0x19')]?_0x1ef566[_0xef48('0x19')][_0xef48('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ef566[_0xef48('0x19')]?_0x1ef566[_0xef48('0x19')][_0xef48('0x1d')]||null:null,'attributes':_0x1ef566[_0xef48('0x19')]?_0x1ef566['options'][_0xef48('0x1e')]||null:null,'limit':_0x1ef566[_0xef48('0x19')]?_0x1ef566[_0xef48('0x19')]['limit']||null:null})[_0xef48('0x1b')](function(_0x205c50){logger[_0xef48('0xb')](_0xef48('0x1f'),_0x1ef566);logger[_0xef48('0xe')](_0xef48('0x1f'),_0x1ef566,JSON[_0xef48('0x10')](_0x205c50));_0x1dd677(_0x205c50);})[_0xef48('0x14')](function(_0x288dc5){logger['error'](_0xef48('0x1f'),_0x288dc5[_0xef48('0x13')],_0x1ef566);_0x5abd41(_0x1ae32b[_0xef48('0x11')](0x1f4,_0x288dc5[_0xef48('0x13')]));});});}; \ No newline at end of file +var _0xa7be=['update','where','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport'];(function(_0x5f4e11,_0x3c9722){var _0x38f134=function(_0x2fc369){while(--_0x2fc369){_0x5f4e11['push'](_0x5f4e11['shift']());}};_0x38f134(++_0x3c9722);}(_0xa7be,0xbc));var _0xea7b=function(_0x5dbc66,_0x14a5c5){_0x5dbc66=_0x5dbc66-0x0;var _0x205c01=_0xa7be[_0x5dbc66];return _0x205c01;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea7b('0x0'));var BPromise=require('bluebird');var rs=require(_0xea7b('0x1'));var fs=require('fs');var Redis=require(_0xea7b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xea7b('0x3'));var logger=require(_0xea7b('0x4'))(_0xea7b('0x5'));var config=require(_0xea7b('0x6'));var jayson=require(_0xea7b('0x7'));var client=jayson[_0xea7b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x136c0a,_0x3bb896,_0x3e9f55){return new BPromise(function(_0x1901c7,_0x1c3539){return client[_0xea7b('0x9')](_0x136c0a,_0x3e9f55)[_0xea7b('0xa')](function(_0x55cdd2){logger[_0xea7b('0xb')](_0xea7b('0xc'),_0x3bb896,_0xea7b('0xd'));logger[_0xea7b('0xe')](_0xea7b('0xf'),_0x3bb896,_0xea7b('0xd'),JSON[_0xea7b('0x10')](_0x55cdd2));if(_0x55cdd2[_0xea7b('0x11')]){if(_0x55cdd2['error'][_0xea7b('0x12')]===0x1f4){logger[_0xea7b('0x11')]('MailQueueReport,\x20%s,\x20%s',_0x3bb896,_0x55cdd2[_0xea7b('0x11')][_0xea7b('0x13')]);return _0x1c3539(_0x55cdd2[_0xea7b('0x11')][_0xea7b('0x13')]);}logger[_0xea7b('0x11')](_0xea7b('0xc'),_0x3bb896,_0x55cdd2['error'][_0xea7b('0x13')]);return _0x1901c7(_0x55cdd2[_0xea7b('0x11')][_0xea7b('0x13')]);}else{logger[_0xea7b('0xb')](_0xea7b('0xc'),_0x3bb896,_0xea7b('0xd'));_0x1901c7(_0x55cdd2[_0xea7b('0x14')][_0xea7b('0x13')]);}})[_0xea7b('0x15')](function(_0x28899f){logger[_0xea7b('0x11')](_0xea7b('0xc'),_0x3bb896,_0x28899f);_0x1c3539(_0x28899f);});});}exports[_0xea7b('0x16')]=function(_0x2da586){var _0x52f15f=this;return new Promise(function(_0x5388a6,_0x2dcfd3){return db[_0xea7b('0x17')][_0xea7b('0x18')](_0x2da586[_0xea7b('0x19')],{'raw':_0x2da586['options']?_0x2da586[_0xea7b('0x1a')][_0xea7b('0x1b')]===undefined?!![]:![]:!![]})[_0xea7b('0xa')](function(_0x11608f){logger[_0xea7b('0xb')](_0xea7b('0x16'),_0x2da586);logger[_0xea7b('0xe')](_0xea7b('0x16'),_0x2da586,JSON['stringify'](_0x11608f));_0x5388a6(_0x11608f);})[_0xea7b('0x15')](function(_0x5e7694){logger['error'](_0xea7b('0x16'),_0x5e7694[_0xea7b('0x13')],_0x2da586);_0x2dcfd3(_0x52f15f['error'](0x1f4,_0x5e7694[_0xea7b('0x13')]));});});};exports[_0xea7b('0x1c')]=function(_0x1ca15e){var _0x56f42b=this;return new Promise(function(_0xcc642e,_0x2cb380){return db[_0xea7b('0x17')][_0xea7b('0x1d')](_0x1ca15e[_0xea7b('0x19')],{'raw':_0x1ca15e[_0xea7b('0x1a')]?_0x1ca15e['options'][_0xea7b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ca15e[_0xea7b('0x1a')]?_0x1ca15e[_0xea7b('0x1a')][_0xea7b('0x1e')]||null:null,'attributes':_0x1ca15e[_0xea7b('0x1a')]?_0x1ca15e['options']['attributes']||null:null,'limit':_0x1ca15e[_0xea7b('0x1a')]?_0x1ca15e[_0xea7b('0x1a')]['limit']||null:null})[_0xea7b('0xa')](function(_0x4ab398){logger[_0xea7b('0xb')](_0xea7b('0x1c'),_0x1ca15e);logger[_0xea7b('0xe')](_0xea7b('0x1c'),_0x1ca15e,JSON['stringify'](_0x4ab398));_0xcc642e(_0x4ab398);})[_0xea7b('0x15')](function(_0x142fe2){logger['error']('UpdateMailQueueReport',_0x142fe2['message'],_0x1ca15e);_0x2cb380(_0x56f42b[_0xea7b('0x11')](0x1f4,_0x142fe2[_0xea7b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 04099f9..6e5ee27 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 _0x1572=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x307a94,_0x2afd10){var _0x4f4733=function(_0x426370){while(--_0x426370){_0x307a94['push'](_0x307a94['shift']());}};_0x4f4733(++_0x2afd10);}(_0x1572,0xf5));var _0x2157=function(_0x1eefb5,_0x12e6e4){_0x1eefb5=_0x1eefb5-0x0;var _0x390978=_0x1572[_0x1eefb5];return _0x390978;};'use strict';var multer=require(_0x2157('0x0'));var util=require(_0x2157('0x1'));var path=require(_0x2157('0x2'));var timeout=require(_0x2157('0x3'));var express=require(_0x2157('0x4'));var router=express[_0x2157('0x5')]();var fs_extra=require(_0x2157('0x6'));var auth=require(_0x2157('0x7'));var interaction=require(_0x2157('0x8'));var config=require(_0x2157('0x9'));module[_0x2157('0xa')]=router; \ No newline at end of file +var _0x4227=['fs-extra','../../components/auth/service','../../config/environment','exports','multer','connect-timeout','Router'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0x4227,0x89));var _0x7422=function(_0x976f05,_0x4134d0){_0x976f05=_0x976f05-0x0;var _0x339327=_0x4227[_0x976f05];return _0x339327;};'use strict';var multer=require(_0x7422('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7422('0x1'));var express=require('express');var router=express[_0x7422('0x2')]();var fs_extra=require(_0x7422('0x3'));var auth=require(_0x7422('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7422('0x5'));module[_0x7422('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 9600054..f691e1c 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 _0x002e=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x516217,_0x38363e){var _0x53e5a0=function(_0xc200cf){while(--_0xc200cf){_0x516217['push'](_0x516217['shift']());}};_0x53e5a0(++_0x38363e);}(_0x002e,0x171));var _0xe002=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0x002e[_0xe0b81f];return _0x290e5e;};'use strict';var Sequelize=require(_0xe002('0x0'));module[_0xe002('0x1')]={'description':{'type':Sequelize[_0xe002('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xe002('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xe002('0x2')]},'password':{'type':Sequelize[_0xe002('0x2')]},'port':{'type':Sequelize[_0xe002('0x4')]},'tls':{'type':Sequelize[_0xe002('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xe002('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xe002('0x2')]}}; \ No newline at end of file +var _0x507b=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x4f7534,_0x1af259){var _0x42aafc=function(_0x10591f){while(--_0x10591f){_0x4f7534['push'](_0x4f7534['shift']());}};_0x42aafc(++_0x1af259);}(_0x507b,0xce));var _0xb507=function(_0x28d0f7,_0x579973){_0x28d0f7=_0x28d0f7-0x0;var _0x45d26b=_0x507b[_0x28d0f7];return _0x45d26b;};'use strict';var Sequelize=require(_0xb507('0x0'));module[_0xb507('0x1')]={'description':{'type':Sequelize[_0xb507('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xb507('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xb507('0x2')]},'password':{'type':Sequelize[_0xb507('0x2')]},'port':{'type':Sequelize[_0xb507('0x4')]},'tls':{'type':Sequelize[_0xb507('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb507('0x2')],'defaultValue':_0xb507('0x5')},'connTimeout':{'type':Sequelize[_0xb507('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xb507('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index fcccc44..30ef1b2 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 _0x15b8=['moment','bluebird','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','util','../../config/logger','api'];(function(_0x168346,_0x451e91){var _0x411b9e=function(_0x4e96a1){while(--_0x4e96a1){_0x168346['push'](_0x168346['shift']());}};_0x411b9e(++_0x451e91);}(_0x15b8,0xcd));var _0x815b=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x15b8[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require(_0x815b('0x0'));var logger=require(_0x815b('0x1'))(_0x815b('0x2'));var moment=require(_0x815b('0x3'));var BPromise=require(_0x815b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x815b('0x5'));var rimraf=require(_0x815b('0x6'));var config=require(_0x815b('0x7'));var attributes=require(_0x815b('0x8'));module[_0x815b('0x9')]=function(_0x37a503,_0x581869){return _0x37a503[_0x815b('0xa')](_0x815b('0xb'),attributes,{'tableName':_0x815b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7da=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','./mailServerIn.attributes','exports','define','MailServerIn'];(function(_0x9f59a0,_0x5599a8){var _0xe2ee6=function(_0x5e87b7){while(--_0x5e87b7){_0x9f59a0['push'](_0x9f59a0['shift']());}};_0xe2ee6(++_0x5599a8);}(_0xc7da,0xf2));var _0xac7d=function(_0x3c7e22,_0x4e7882){_0x3c7e22=_0x3c7e22-0x0;var _0x218461=_0xc7da[_0x3c7e22];return _0x218461;};'use strict';var _=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var logger=require(_0xac7d('0x2'))('api');var moment=require(_0xac7d('0x3'));var BPromise=require(_0xac7d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac7d('0x5'));var rimraf=require(_0xac7d('0x6'));var config=require('../../config/environment');var attributes=require(_0xac7d('0x7'));module[_0xac7d('0x8')]=function(_0x263268,_0x2265e7){return _0x263268[_0xac7d('0x9')](_0xac7d('0xa'),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 6117371..f89dc77 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 _0x2387=['client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','GetMailServerIn','findAll','options','raw','limit','include','map','model','attributes','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x2387,0x9a));var _0x7238=function(_0x59939a,_0x1f71be){_0x59939a=_0x59939a-0x0;var _0x4f46bd=_0x2387[_0x59939a];return _0x4f46bd;};'use strict';var _=require(_0x7238('0x0'));var util=require('util');var moment=require(_0x7238('0x1'));var BPromise=require(_0x7238('0x2'));var rs=require(_0x7238('0x3'));var fs=require('fs');var Redis=require(_0x7238('0x4'));var db=require(_0x7238('0x5'))['db'];var utils=require(_0x7238('0x6'));var logger=require(_0x7238('0x7'))(_0x7238('0x8'));var config=require(_0x7238('0x9'));var jayson=require(_0x7238('0xa'));var client=jayson[_0x7238('0xb')][_0x7238('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c85e4,_0x5463f1,_0x3f4458){return new BPromise(function(_0x5508fc,_0xeda27e){return client[_0x7238('0xd')](_0x3c85e4,_0x3f4458)[_0x7238('0xe')](function(_0x4a80c7){logger['info'](_0x7238('0xf'),_0x5463f1,_0x7238('0x10'));logger[_0x7238('0x11')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x5463f1,_0x7238('0x10'),JSON['stringify'](_0x4a80c7));if(_0x4a80c7[_0x7238('0x12')]){if(_0x4a80c7[_0x7238('0x12')][_0x7238('0x13')]===0x1f4){logger['error'](_0x7238('0xf'),_0x5463f1,_0x4a80c7['error'][_0x7238('0x14')]);return _0xeda27e(_0x4a80c7[_0x7238('0x12')][_0x7238('0x14')]);}logger[_0x7238('0x12')](_0x7238('0xf'),_0x5463f1,_0x4a80c7['error'][_0x7238('0x14')]);return _0x5508fc(_0x4a80c7[_0x7238('0x12')][_0x7238('0x14')]);}else{logger[_0x7238('0x15')]('MailServerIn,\x20%s,\x20%s',_0x5463f1,_0x7238('0x10'));_0x5508fc(_0x4a80c7['result']['message']);}})[_0x7238('0x16')](function(_0x4fcdb3){logger['error'](_0x7238('0xf'),_0x5463f1,_0x4fcdb3);_0xeda27e(_0x4fcdb3);});});}exports[_0x7238('0x17')]=function(_0x3c9a31){var _0x499c78=this;return new Promise(function(_0x1419eb,_0x1cfa50){return db['MailServerIn'][_0x7238('0x18')]({'raw':_0x3c9a31['options']?_0x3c9a31[_0x7238('0x19')][_0x7238('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c9a31['options']?_0x3c9a31[_0x7238('0x19')]['where']||null:null,'attributes':_0x3c9a31[_0x7238('0x19')]?_0x3c9a31[_0x7238('0x19')]['attributes']||null:null,'limit':_0x3c9a31[_0x7238('0x19')]?_0x3c9a31[_0x7238('0x19')][_0x7238('0x1b')]||null:null,'include':_0x3c9a31['options']?_0x3c9a31[_0x7238('0x19')][_0x7238('0x1c')]?_[_0x7238('0x1d')](_0x3c9a31['options'][_0x7238('0x1c')],function(_0x405357){return{'model':db[_0x405357[_0x7238('0x1e')]],'as':_0x405357['as'],'attributes':_0x405357[_0x7238('0x1f')],'include':_0x405357['include']?_[_0x7238('0x1d')](_0x405357[_0x7238('0x1c')],function(_0x25b4d8){return{'model':db[_0x25b4d8[_0x7238('0x1e')]],'as':_0x25b4d8['as'],'attributes':_0x25b4d8[_0x7238('0x1f')],'include':_0x25b4d8[_0x7238('0x1c')]?_[_0x7238('0x1d')](_0x25b4d8[_0x7238('0x1c')],function(_0x3323e3){return{'model':db[_0x3323e3['model']],'as':_0x3323e3['as'],'attributes':_0x3323e3[_0x7238('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7238('0xe')](function(_0x4f4323){logger[_0x7238('0x15')](_0x7238('0x17'),_0x3c9a31);logger[_0x7238('0x11')](_0x7238('0x17'),_0x3c9a31,JSON[_0x7238('0x20')](_0x4f4323));_0x1419eb(_0x4f4323);})[_0x7238('0x16')](function(_0x28c8be){logger[_0x7238('0x12')](_0x7238('0x17'),_0x28c8be['message'],_0x3c9a31);_0x1cfa50(_0x499c78[_0x7238('0x12')](0x1f4,_0x28c8be[_0x7238('0x14')]));});});}; \ No newline at end of file +var _0x3c3d=['options','raw','where','attributes','limit','include','model','map','debug','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','MailServerIn,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetMailServerIn','findAll'];(function(_0x23c69c,_0x21a72a){var _0x2271b0=function(_0x3e517f){while(--_0x3e517f){_0x23c69c['push'](_0x23c69c['shift']());}};_0x2271b0(++_0x21a72a);}(_0x3c3d,0x133));var _0xd3c3=function(_0x3d3afe,_0x26df42){_0x3d3afe=_0x3d3afe-0x0;var _0x213370=_0x3c3d[_0x3d3afe];return _0x213370;};'use strict';var _=require(_0xd3c3('0x0'));var util=require(_0xd3c3('0x1'));var moment=require(_0xd3c3('0x2'));var BPromise=require('bluebird');var rs=require(_0xd3c3('0x3'));var fs=require('fs');var Redis=require(_0xd3c3('0x4'));var db=require(_0xd3c3('0x5'))['db'];var utils=require(_0xd3c3('0x6'));var logger=require(_0xd3c3('0x7'))('rpc');var config=require(_0xd3c3('0x8'));var jayson=require(_0xd3c3('0x9'));var client=jayson[_0xd3c3('0xa')][_0xd3c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8e0f9d,_0xb18649,_0x500696){return new BPromise(function(_0xc3825d,_0x3903e4){return client['request'](_0x8e0f9d,_0x500696)[_0xd3c3('0xc')](function(_0x2d4850){logger['info'](_0xd3c3('0xd'),_0xb18649,_0xd3c3('0xe'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0xb18649,'request\x20sent',JSON['stringify'](_0x2d4850));if(_0x2d4850['error']){if(_0x2d4850[_0xd3c3('0xf')][_0xd3c3('0x10')]===0x1f4){logger['error'](_0xd3c3('0xd'),_0xb18649,_0x2d4850[_0xd3c3('0xf')][_0xd3c3('0x11')]);return _0x3903e4(_0x2d4850[_0xd3c3('0xf')][_0xd3c3('0x11')]);}logger['error'](_0xd3c3('0xd'),_0xb18649,_0x2d4850[_0xd3c3('0xf')]['message']);return _0xc3825d(_0x2d4850[_0xd3c3('0xf')][_0xd3c3('0x11')]);}else{logger[_0xd3c3('0x12')](_0xd3c3('0xd'),_0xb18649,_0xd3c3('0xe'));_0xc3825d(_0x2d4850[_0xd3c3('0x13')]['message']);}})[_0xd3c3('0x14')](function(_0x4aeb3f){logger['error'](_0xd3c3('0xd'),_0xb18649,_0x4aeb3f);_0x3903e4(_0x4aeb3f);});});}exports[_0xd3c3('0x15')]=function(_0x50afb7){var _0x4ae3bd=this;return new Promise(function(_0x55e454,_0x407d98){return db['MailServerIn'][_0xd3c3('0x16')]({'raw':_0x50afb7[_0xd3c3('0x17')]?_0x50afb7[_0xd3c3('0x17')][_0xd3c3('0x18')]===undefined?!![]:![]:!![],'where':_0x50afb7['options']?_0x50afb7[_0xd3c3('0x17')][_0xd3c3('0x19')]||null:null,'attributes':_0x50afb7[_0xd3c3('0x17')]?_0x50afb7['options'][_0xd3c3('0x1a')]||null:null,'limit':_0x50afb7['options']?_0x50afb7[_0xd3c3('0x17')][_0xd3c3('0x1b')]||null:null,'include':_0x50afb7['options']?_0x50afb7[_0xd3c3('0x17')]['include']?_['map'](_0x50afb7[_0xd3c3('0x17')][_0xd3c3('0x1c')],function(_0x14aa81){return{'model':db[_0x14aa81[_0xd3c3('0x1d')]],'as':_0x14aa81['as'],'attributes':_0x14aa81[_0xd3c3('0x1a')],'include':_0x14aa81['include']?_[_0xd3c3('0x1e')](_0x14aa81[_0xd3c3('0x1c')],function(_0x42dc64){return{'model':db[_0x42dc64[_0xd3c3('0x1d')]],'as':_0x42dc64['as'],'attributes':_0x42dc64[_0xd3c3('0x1a')],'include':_0x42dc64['include']?_[_0xd3c3('0x1e')](_0x42dc64[_0xd3c3('0x1c')],function(_0x138492){return{'model':db[_0x138492[_0xd3c3('0x1d')]],'as':_0x138492['as'],'attributes':_0x138492[_0xd3c3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd3c3('0xc')](function(_0x1d961c){logger[_0xd3c3('0x12')]('GetMailServerIn',_0x50afb7);logger[_0xd3c3('0x1f')](_0xd3c3('0x15'),_0x50afb7,JSON[_0xd3c3('0x20')](_0x1d961c));_0x55e454(_0x1d961c);})[_0xd3c3('0x14')](function(_0x3e17bf){logger[_0xd3c3('0xf')]('GetMailServerIn',_0x3e17bf[_0xd3c3('0x11')],_0x50afb7);_0x407d98(_0x4ae3bd[_0xd3c3('0xf')](0x1f4,_0x3e17bf[_0xd3c3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 62ac621..b010ad9 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 _0x5636=['post','create','put','update','delete','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1e8701,_0x3484fb){var _0x14bbcd=function(_0x22505f){while(--_0x22505f){_0x1e8701['push'](_0x1e8701['shift']());}};_0x14bbcd(++_0x3484fb);}(_0x5636,0x102));var _0x6563=function(_0x1e7fd4,_0x556249){_0x1e7fd4=_0x1e7fd4-0x0;var _0x3d2bac=_0x5636[_0x1e7fd4];return _0x3d2bac;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6563('0x2')]();var fs_extra=require(_0x6563('0x3'));var auth=require(_0x6563('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6563('0x5'));var controller=require(_0x6563('0x6'));router[_0x6563('0x7')]('/',auth[_0x6563('0x8')](),controller[_0x6563('0x9')]);router[_0x6563('0x7')](_0x6563('0xa'),auth[_0x6563('0x8')](),controller[_0x6563('0xb')]);router[_0x6563('0xc')]('/',auth[_0x6563('0x8')](),controller[_0x6563('0xd')]);router[_0x6563('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6563('0xf')]);router[_0x6563('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6563('0x11')]=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show'];(function(_0x38de8e,_0x26778b){var _0xdba198=function(_0x169f31){while(--_0x169f31){_0x38de8e['push'](_0x38de8e['shift']());}};_0xdba198(++_0x26778b);}(_0xedd9,0xfc));var _0x9edd=function(_0x469e05,_0x35a1d5){_0x469e05=_0x469e05-0x0;var _0x582aec=_0xedd9[_0x469e05];return _0x582aec;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 2efbce5..993a380 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 _0xbe3b=['BOOLEAN','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x531607,_0x73fa88){_0x531607=_0x531607-0x0;var _0x1b1fbb=_0xbe3b[_0x531607];return _0x1b1fbb;};'use strict';var Sequelize=require('sequelize');module[_0xbbe3('0x0')]={'description':{'type':Sequelize[_0xbbe3('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xbbe3('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xbbe3('0x2')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xc373=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x48d96a,_0x49256c){var _0x3cc5b0=function(_0x559ab6){while(--_0x559ab6){_0x48d96a['push'](_0x48d96a['shift']());}};_0x3cc5b0(++_0x49256c);}(_0xc373,0x1c7));var _0x3c37=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0xc373[_0x578275];return _0xf78041;};'use strict';var Sequelize=require('sequelize');module[_0x3c37('0x0')]={'description':{'type':Sequelize[_0x3c37('0x1')]},'host':{'type':Sequelize[_0x3c37('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3c37('0x2')]},'secure':{'type':Sequelize[_0x3c37('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x3c37('0x1')]},'authentication':{'type':Sequelize[_0x3c37('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 11d4f2f..3b2b331 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 _0xc4c2=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','path','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'];(function(_0x7033ad,_0x4f191a){var _0x4117fb=function(_0x537976){while(--_0x537976){_0x7033ad['push'](_0x7033ad['shift']());}};_0x4117fb(++_0x4f191a);}(_0xc4c2,0x155));var _0x2c4c=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xc4c2[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0x2c4c('0x0'));var rimraf=require(_0x2c4c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c4c('0x2'));var rp=require(_0x2c4c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2c4c('0x4'));var sox=require(_0x2c4c('0x5'));var csv=require(_0x2c4c('0x6'));var ejs=require(_0x2c4c('0x7'));var fs=require('fs');var fs_extra=require(_0x2c4c('0x8'));var _=require(_0x2c4c('0x9'));var squel=require(_0x2c4c('0xa'));var crypto=require(_0x2c4c('0xb'));var jsforce=require(_0x2c4c('0xc'));var deskjs=require(_0x2c4c('0xd'));var toCsv=require(_0x2c4c('0x6'));var querystring=require('querystring');var Papa=require(_0x2c4c('0xe'));var Redis=require('ioredis');var authService=require(_0x2c4c('0xf'));var qs=require(_0x2c4c('0x10'));var as=require(_0x2c4c('0x11'));var hardwareService=require(_0x2c4c('0x12'));var logger=require('../../config/logger')(_0x2c4c('0x13'));var utils=require('../../config/utils');var config=require(_0x2c4c('0x14'));var licenseUtil=require(_0x2c4c('0x15'));var db=require(_0x2c4c('0x16'))['db'];function respondWithStatusCode(_0x3fe0ea,_0x56bce7){_0x56bce7=_0x56bce7||0xcc;return function(_0x3374b1){if(_0x3374b1){return _0x3fe0ea[_0x2c4c('0x17')](_0x56bce7);}return _0x3fe0ea[_0x2c4c('0x18')](_0x56bce7)[_0x2c4c('0x19')]();};}function respondWithResult(_0x596e6a,_0x1aaf1e){_0x1aaf1e=_0x1aaf1e||0xc8;return function(_0x4a1568){if(_0x4a1568){return _0x596e6a['status'](_0x1aaf1e)[_0x2c4c('0x1a')](_0x4a1568);}};}function respondWithFilteredResult(_0x15d252,_0x35384c){return function(_0x2588e5){if(_0x2588e5){var _0xbbd57d=_0x2588e5[_0x2c4c('0x1b')],_0x46f8d6=_0x35384c[_0x2c4c('0x1c')],_0x34b9b2=_0x35384c['offset']+_0x35384c[_0x2c4c('0x1d')],_0x431f32;if(_0x34b9b2>=_0xbbd57d){_0x34b9b2=_0xbbd57d;_0x431f32=0xc8;}else{_0x431f32=0xce;}_0x15d252[_0x2c4c('0x18')](_0x431f32);return _0x15d252[_0x2c4c('0x1e')](_0x2c4c('0x1f'),_0x46f8d6+'-'+_0x34b9b2+'/'+_0xbbd57d)[_0x2c4c('0x1a')](_0x2588e5);}return null;};}function patchUpdates(_0x301d19){return function(_0x1c58fb){try{jsonpatch['apply'](_0x1c58fb,_0x301d19,!![]);}catch(_0x56c9de){return BPromise[_0x2c4c('0x20')](_0x56c9de);}return _0x1c58fb['save']();};}function saveUpdates(_0x24f993,_0x5e37b2){return function(_0x5c6eae){if(_0x5c6eae){return _0x5c6eae[_0x2c4c('0x21')](_0x24f993)[_0x2c4c('0x22')](function(_0x4c1e53){return _0x4c1e53;});}return null;};}function removeEntity(_0x49cf97,_0x55c507){return function(_0xb4dde7){if(_0xb4dde7){return _0xb4dde7['destroy']()[_0x2c4c('0x22')](function(){_0x49cf97[_0x2c4c('0x18')](0xcc)[_0x2c4c('0x19')]();});}};}function handleEntityNotFound(_0x5d8a6a,_0x27b639){return function(_0x38c7eb){if(!_0x38c7eb){_0x5d8a6a[_0x2c4c('0x17')](0x194);}return _0x38c7eb;};}function handleError(_0x217bcd,_0x46cb19){_0x46cb19=_0x46cb19||0x1f4;return function(_0x5a592e){logger['error'](_0x5a592e[_0x2c4c('0x23')]);if(_0x5a592e[_0x2c4c('0x24')]){delete _0x5a592e['name'];}_0x217bcd['status'](_0x46cb19)[_0x2c4c('0x25')](_0x5a592e);};}exports[_0x2c4c('0x26')]=function(_0x590039,_0x4e1de7){var _0x1c6645={},_0x3ce633={},_0x259925={'count':0x0,'rows':[]};var _0x20f6b8=_[_0x2c4c('0x27')](db[_0x2c4c('0x28')][_0x2c4c('0x29')],function(_0x50005c){return{'name':_0x50005c[_0x2c4c('0x2a')],'type':_0x50005c[_0x2c4c('0x2b')]['key']};});_0x3ce633[_0x2c4c('0x2c')]=_['map'](_0x20f6b8,_0x2c4c('0x24'));_0x3ce633[_0x2c4c('0x2d')]=_[_0x2c4c('0x2e')](_0x590039[_0x2c4c('0x2d')]);_0x3ce633[_0x2c4c('0x2f')]=_[_0x2c4c('0x30')](_0x3ce633[_0x2c4c('0x2c')],_0x3ce633[_0x2c4c('0x2d')]);_0x1c6645['attributes']=_[_0x2c4c('0x30')](_0x3ce633[_0x2c4c('0x2c')],qs[_0x2c4c('0x31')](_0x590039[_0x2c4c('0x2d')]['fields']));_0x1c6645[_0x2c4c('0x32')]=_0x1c6645['attributes'][_0x2c4c('0x33')]?_0x1c6645[_0x2c4c('0x32')]:_0x3ce633[_0x2c4c('0x2c')];if(!_0x590039[_0x2c4c('0x2d')][_0x2c4c('0x34')](_0x2c4c('0x35'))){_0x1c6645[_0x2c4c('0x1d')]=qs['limit'](_0x590039[_0x2c4c('0x2d')][_0x2c4c('0x1d')]);_0x1c6645[_0x2c4c('0x1c')]=qs[_0x2c4c('0x1c')](_0x590039['query']['offset']);}_0x1c6645[_0x2c4c('0x36')]=qs['sort'](_0x590039[_0x2c4c('0x2d')][_0x2c4c('0x37')]);_0x1c6645[_0x2c4c('0x38')]=qs[_0x2c4c('0x2f')](_[_0x2c4c('0x39')](_0x590039[_0x2c4c('0x2d')],_0x3ce633[_0x2c4c('0x2f')]),_0x20f6b8);if(_0x590039[_0x2c4c('0x2d')][_0x2c4c('0x3a')]){_0x1c6645['where']=_[_0x2c4c('0x3b')](_0x1c6645[_0x2c4c('0x38')],{'$or':_['map'](_0x20f6b8,function(_0x2189f0){if(_0x2189f0[_0x2c4c('0x2b')]!==_0x2c4c('0x3c')){var _0x48d462={};_0x48d462[_0x2189f0[_0x2c4c('0x24')]]={'$like':'%'+_0x590039[_0x2c4c('0x2d')][_0x2c4c('0x3a')]+'%'};return _0x48d462;}})});}_0x1c6645=_[_0x2c4c('0x3b')]({},_0x1c6645,_0x590039['options']);var _0x255a0d={'where':_0x1c6645[_0x2c4c('0x38')]};return db['MailServerOut'][_0x2c4c('0x1b')](_0x255a0d)[_0x2c4c('0x22')](function(_0xd3a5a6){_0x259925[_0x2c4c('0x1b')]=_0xd3a5a6;if(_0x590039[_0x2c4c('0x2d')][_0x2c4c('0x3d')]){_0x1c6645[_0x2c4c('0x3e')]=[{'all':!![]}];}return db[_0x2c4c('0x28')][_0x2c4c('0x3f')](_0x1c6645);})[_0x2c4c('0x22')](function(_0x76fb85){_0x259925['rows']=_0x76fb85;return _0x259925;})[_0x2c4c('0x22')](respondWithFilteredResult(_0x4e1de7,_0x1c6645))['catch'](handleError(_0x4e1de7,null));};exports[_0x2c4c('0x40')]=function(_0x528120,_0x33ae5c){var _0x350ef3={'raw':!![],'where':{'id':_0x528120[_0x2c4c('0x41')]['id']}},_0x110a07={};_0x110a07['model']=_[_0x2c4c('0x2e')](db[_0x2c4c('0x28')][_0x2c4c('0x29')]);_0x110a07[_0x2c4c('0x2d')]=_[_0x2c4c('0x2e')](_0x528120['query']);_0x110a07[_0x2c4c('0x2f')]=_['intersection'](_0x110a07[_0x2c4c('0x2c')],_0x110a07['query']);_0x350ef3[_0x2c4c('0x32')]=_[_0x2c4c('0x30')](_0x110a07['model'],qs[_0x2c4c('0x31')](_0x528120[_0x2c4c('0x2d')][_0x2c4c('0x31')]));_0x350ef3[_0x2c4c('0x32')]=_0x350ef3[_0x2c4c('0x32')]['length']?_0x350ef3['attributes']:_0x110a07[_0x2c4c('0x2c')];if(_0x528120['query'][_0x2c4c('0x3d')]){_0x350ef3[_0x2c4c('0x3e')]=[{'all':!![]}];}_0x350ef3=_[_0x2c4c('0x3b')]({},_0x350ef3,_0x528120[_0x2c4c('0x42')]);return db['MailServerOut'][_0x2c4c('0x43')](_0x350ef3)[_0x2c4c('0x22')](handleEntityNotFound(_0x33ae5c,null))[_0x2c4c('0x22')](respondWithResult(_0x33ae5c,null))[_0x2c4c('0x44')](handleError(_0x33ae5c,null));};exports[_0x2c4c('0x45')]=function(_0x2108bf,_0x5321c3){return db[_0x2c4c('0x28')][_0x2c4c('0x45')](_0x2108bf['body'],{})[_0x2c4c('0x22')](respondWithResult(_0x5321c3,0xc9))['catch'](handleError(_0x5321c3,null));};exports['update']=function(_0xf56dab,_0x659658){if(_0xf56dab['body']['id']){delete _0xf56dab[_0x2c4c('0x46')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0xf56dab['params']['id']}})[_0x2c4c('0x22')](handleEntityNotFound(_0x659658,null))['then'](saveUpdates(_0xf56dab['body'],null))[_0x2c4c('0x22')](respondWithResult(_0x659658,null))[_0x2c4c('0x44')](handleError(_0x659658,null));};exports[_0x2c4c('0x47')]=function(_0x114cea,_0x21bb58){return db['MailServerOut'][_0x2c4c('0x43')]({'where':{'id':_0x114cea[_0x2c4c('0x41')]['id']}})[_0x2c4c('0x22')](handleEntityNotFound(_0x21bb58,null))[_0x2c4c('0x22')](removeEntity(_0x21bb58,null))[_0x2c4c('0x44')](handleError(_0x21bb58,null));}; \ No newline at end of file +var _0x8f3b=['find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','MailServerOut','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params'];(function(_0x59e8b3,_0x2f27da){var _0x3b6260=function(_0x4862f9){while(--_0x4862f9){_0x59e8b3['push'](_0x59e8b3['shift']());}};_0x3b6260(++_0x2f27da);}(_0x8f3b,0x95));var _0xb8f3=function(_0x15de6b,_0x3bcdb2){_0x15de6b=_0x15de6b-0x0;var _0x37915a=_0x8f3b[_0x15de6b];return _0x37915a;};'use strict';var emlformat=require(_0xb8f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb8f3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8f3('0x2'));var moment=require(_0xb8f3('0x3'));var BPromise=require(_0xb8f3('0x4'));var Mustache=require(_0xb8f3('0x5'));var util=require(_0xb8f3('0x6'));var path=require(_0xb8f3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb8f3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8f3('0x9'));var squel=require(_0xb8f3('0xa'));var crypto=require(_0xb8f3('0xb'));var jsforce=require(_0xb8f3('0xc'));var deskjs=require(_0xb8f3('0xd'));var toCsv=require(_0xb8f3('0xe'));var querystring=require(_0xb8f3('0xf'));var Papa=require('papaparse');var Redis=require(_0xb8f3('0x10'));var authService=require(_0xb8f3('0x11'));var qs=require(_0xb8f3('0x12'));var as=require(_0xb8f3('0x13'));var hardwareService=require(_0xb8f3('0x14'));var logger=require('../../config/logger')(_0xb8f3('0x15'));var utils=require(_0xb8f3('0x16'));var config=require(_0xb8f3('0x17'));var licenseUtil=require(_0xb8f3('0x18'));var db=require(_0xb8f3('0x19'))['db'];function respondWithStatusCode(_0x1537cb,_0x5e525a){_0x5e525a=_0x5e525a||0xcc;return function(_0x2944bc){if(_0x2944bc){return _0x1537cb[_0xb8f3('0x1a')](_0x5e525a);}return _0x1537cb[_0xb8f3('0x1b')](_0x5e525a)[_0xb8f3('0x1c')]();};}function respondWithResult(_0x11fd6a,_0x1f991c){_0x1f991c=_0x1f991c||0xc8;return function(_0x1f48ee){if(_0x1f48ee){return _0x11fd6a[_0xb8f3('0x1b')](_0x1f991c)[_0xb8f3('0x1d')](_0x1f48ee);}};}function respondWithFilteredResult(_0x37882e,_0x5b49af){return function(_0x595789){if(_0x595789){var _0x2510ce=_0x595789[_0xb8f3('0x1e')],_0x3a1a00=_0x5b49af[_0xb8f3('0x1f')],_0x38f756=_0x5b49af['offset']+_0x5b49af[_0xb8f3('0x20')],_0x539198;if(_0x38f756>=_0x2510ce){_0x38f756=_0x2510ce;_0x539198=0xc8;}else{_0x539198=0xce;}_0x37882e[_0xb8f3('0x1b')](_0x539198);return _0x37882e[_0xb8f3('0x21')](_0xb8f3('0x22'),_0x3a1a00+'-'+_0x38f756+'/'+_0x2510ce)[_0xb8f3('0x1d')](_0x595789);}return null;};}function patchUpdates(_0x31e4e9){return function(_0x23d474){try{jsonpatch[_0xb8f3('0x23')](_0x23d474,_0x31e4e9,!![]);}catch(_0x2e0954){return BPromise[_0xb8f3('0x24')](_0x2e0954);}return _0x23d474[_0xb8f3('0x25')]();};}function saveUpdates(_0x363e0f,_0x28e440){return function(_0x17e28d){if(_0x17e28d){return _0x17e28d[_0xb8f3('0x26')](_0x363e0f)['then'](function(_0x3e73d3){return _0x3e73d3;});}return null;};}function removeEntity(_0x22dae5,_0x547928){return function(_0x5acef8){if(_0x5acef8){return _0x5acef8[_0xb8f3('0x27')]()[_0xb8f3('0x28')](function(){_0x22dae5[_0xb8f3('0x1b')](0xcc)[_0xb8f3('0x1c')]();});}};}function handleEntityNotFound(_0x4fa5d1,_0x1ef694){return function(_0x26b88c){if(!_0x26b88c){_0x4fa5d1[_0xb8f3('0x1a')](0x194);}return _0x26b88c;};}function handleError(_0x30a08a,_0x106802){_0x106802=_0x106802||0x1f4;return function(_0x281880){logger['error'](_0x281880[_0xb8f3('0x29')]);if(_0x281880[_0xb8f3('0x2a')]){delete _0x281880[_0xb8f3('0x2a')];}_0x30a08a['status'](_0x106802)['send'](_0x281880);};}exports[_0xb8f3('0x2b')]=function(_0x2a6925,_0x2e53dd){var _0x5990f4={},_0x2377a2={},_0x2466b1={'count':0x0,'rows':[]};var _0xf32249=_['map'](db[_0xb8f3('0x2c')]['rawAttributes'],function(_0x2630c0){return{'name':_0x2630c0[_0xb8f3('0x2d')],'type':_0x2630c0[_0xb8f3('0x2e')]['key']};});_0x2377a2[_0xb8f3('0x2f')]=_[_0xb8f3('0x30')](_0xf32249,_0xb8f3('0x2a'));_0x2377a2[_0xb8f3('0x31')]=_[_0xb8f3('0x32')](_0x2a6925[_0xb8f3('0x31')]);_0x2377a2[_0xb8f3('0x33')]=_['intersection'](_0x2377a2[_0xb8f3('0x2f')],_0x2377a2[_0xb8f3('0x31')]);_0x5990f4[_0xb8f3('0x34')]=_[_0xb8f3('0x35')](_0x2377a2[_0xb8f3('0x2f')],qs['fields'](_0x2a6925[_0xb8f3('0x31')][_0xb8f3('0x36')]));_0x5990f4[_0xb8f3('0x34')]=_0x5990f4[_0xb8f3('0x34')][_0xb8f3('0x37')]?_0x5990f4[_0xb8f3('0x34')]:_0x2377a2['model'];if(!_0x2a6925[_0xb8f3('0x31')][_0xb8f3('0x38')]('nolimit')){_0x5990f4[_0xb8f3('0x20')]=qs[_0xb8f3('0x20')](_0x2a6925[_0xb8f3('0x31')][_0xb8f3('0x20')]);_0x5990f4[_0xb8f3('0x1f')]=qs['offset'](_0x2a6925['query'][_0xb8f3('0x1f')]);}_0x5990f4['order']=qs[_0xb8f3('0x39')](_0x2a6925[_0xb8f3('0x31')]['sort']);_0x5990f4[_0xb8f3('0x3a')]=qs[_0xb8f3('0x33')](_[_0xb8f3('0x3b')](_0x2a6925[_0xb8f3('0x31')],_0x2377a2['filters']),_0xf32249);if(_0x2a6925[_0xb8f3('0x31')][_0xb8f3('0x3c')]){_0x5990f4[_0xb8f3('0x3a')]=_[_0xb8f3('0x3d')](_0x5990f4[_0xb8f3('0x3a')],{'$or':_[_0xb8f3('0x30')](_0xf32249,function(_0x4c61f5){if(_0x4c61f5[_0xb8f3('0x2e')]!==_0xb8f3('0x3e')){var _0x152bba={};_0x152bba[_0x4c61f5[_0xb8f3('0x2a')]]={'$like':'%'+_0x2a6925[_0xb8f3('0x31')][_0xb8f3('0x3c')]+'%'};return _0x152bba;}})});}_0x5990f4=_[_0xb8f3('0x3d')]({},_0x5990f4,_0x2a6925[_0xb8f3('0x3f')]);var _0x57d4aa={'where':_0x5990f4[_0xb8f3('0x3a')]};return db[_0xb8f3('0x2c')][_0xb8f3('0x1e')](_0x57d4aa)[_0xb8f3('0x28')](function(_0x3d4b7e){_0x2466b1[_0xb8f3('0x1e')]=_0x3d4b7e;if(_0x2a6925[_0xb8f3('0x31')][_0xb8f3('0x40')]){_0x5990f4[_0xb8f3('0x41')]=[{'all':!![]}];}return db[_0xb8f3('0x2c')][_0xb8f3('0x42')](_0x5990f4);})[_0xb8f3('0x28')](function(_0x2743f8){_0x2466b1['rows']=_0x2743f8;return _0x2466b1;})[_0xb8f3('0x28')](respondWithFilteredResult(_0x2e53dd,_0x5990f4))[_0xb8f3('0x43')](handleError(_0x2e53dd,null));};exports[_0xb8f3('0x44')]=function(_0x342ab8,_0xb0d91a){var _0x3ea583={'raw':!![],'where':{'id':_0x342ab8[_0xb8f3('0x45')]['id']}},_0x3e285a={};_0x3e285a[_0xb8f3('0x2f')]=_[_0xb8f3('0x32')](db[_0xb8f3('0x2c')]['rawAttributes']);_0x3e285a['query']=_[_0xb8f3('0x32')](_0x342ab8[_0xb8f3('0x31')]);_0x3e285a[_0xb8f3('0x33')]=_[_0xb8f3('0x35')](_0x3e285a[_0xb8f3('0x2f')],_0x3e285a['query']);_0x3ea583[_0xb8f3('0x34')]=_[_0xb8f3('0x35')](_0x3e285a[_0xb8f3('0x2f')],qs[_0xb8f3('0x36')](_0x342ab8[_0xb8f3('0x31')][_0xb8f3('0x36')]));_0x3ea583[_0xb8f3('0x34')]=_0x3ea583[_0xb8f3('0x34')][_0xb8f3('0x37')]?_0x3ea583[_0xb8f3('0x34')]:_0x3e285a[_0xb8f3('0x2f')];if(_0x342ab8[_0xb8f3('0x31')][_0xb8f3('0x40')]){_0x3ea583[_0xb8f3('0x41')]=[{'all':!![]}];}_0x3ea583=_[_0xb8f3('0x3d')]({},_0x3ea583,_0x342ab8[_0xb8f3('0x3f')]);return db[_0xb8f3('0x2c')][_0xb8f3('0x46')](_0x3ea583)[_0xb8f3('0x28')](handleEntityNotFound(_0xb0d91a,null))[_0xb8f3('0x28')](respondWithResult(_0xb0d91a,null))[_0xb8f3('0x43')](handleError(_0xb0d91a,null));};exports[_0xb8f3('0x47')]=function(_0x477798,_0x243bbb){return db['MailServerOut'][_0xb8f3('0x47')](_0x477798[_0xb8f3('0x48')],{})[_0xb8f3('0x28')](respondWithResult(_0x243bbb,0xc9))[_0xb8f3('0x43')](handleError(_0x243bbb,null));};exports[_0xb8f3('0x26')]=function(_0x33fe86,_0x2720d0){if(_0x33fe86[_0xb8f3('0x48')]['id']){delete _0x33fe86[_0xb8f3('0x48')]['id'];}return db[_0xb8f3('0x2c')][_0xb8f3('0x46')]({'where':{'id':_0x33fe86[_0xb8f3('0x45')]['id']}})[_0xb8f3('0x28')](handleEntityNotFound(_0x2720d0,null))[_0xb8f3('0x28')](saveUpdates(_0x33fe86[_0xb8f3('0x48')],null))[_0xb8f3('0x28')](respondWithResult(_0x2720d0,null))[_0xb8f3('0x43')](handleError(_0x2720d0,null));};exports[_0xb8f3('0x27')]=function(_0x541094,_0x2d2d4c){return db[_0xb8f3('0x2c')][_0xb8f3('0x46')]({'where':{'id':_0x541094[_0xb8f3('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d2d4c,null))[_0xb8f3('0x28')](removeEntity(_0x2d2d4c,null))[_0xb8f3('0x43')](handleError(_0x2d2d4c,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 6c05fd3..ae2bc07 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 _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','mail_servers_out','lodash'];(function(_0x3c620f,_0x4f6ac7){var _0xc438e4=function(_0x13923c){while(--_0x13923c){_0x3c620f['push'](_0x3c620f['shift']());}};_0xc438e4(++_0x4f6ac7);}(_0xabce,0x103));var _0xeabc=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xabce[_0xea8947];return _0x2455e9;};'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('./mailServerOut.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('MailServerOut',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ef6=['exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0x8ef6,0xf2));var _0x68ef=function(_0x31b337,_0x3d98a3){_0x31b337=_0x31b337-0x0;var _0x1586b4=_0x8ef6[_0x31b337];return _0x1586b4;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'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 d07bb24..10837d2 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 _0x1a08=['../../config/logger','rpc','../../config/environment','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x30e604,_0x3199ae){var _0xf3dbc4=function(_0xcf47f4){while(--_0xcf47f4){_0x30e604['push'](_0x30e604['shift']());}};_0xf3dbc4(++_0x3199ae);}(_0x1a08,0x69));var _0x81a0=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x1a08[_0x240261];return _0x45c332;};'use strict';var _=require('lodash');var util=require(_0x81a0('0x0'));var moment=require('moment');var BPromise=require(_0x81a0('0x1'));var rs=require(_0x81a0('0x2'));var fs=require('fs');var Redis=require(_0x81a0('0x3'));var db=require(_0x81a0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x81a0('0x5'))(_0x81a0('0x6'));var config=require(_0x81a0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x81a0('0x8')][_0x81a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13190b,_0x39f3da,_0x39cff4){return new BPromise(function(_0x5a0536,_0x99a5d){return client[_0x81a0('0xa')](_0x13190b,_0x39cff4)['then'](function(_0x4c99ee){logger[_0x81a0('0xb')](_0x81a0('0xc'),_0x39f3da,'request\x20sent');logger[_0x81a0('0xd')](_0x81a0('0xe'),_0x39f3da,_0x81a0('0xf'),JSON[_0x81a0('0x10')](_0x4c99ee));if(_0x4c99ee[_0x81a0('0x11')]){if(_0x4c99ee[_0x81a0('0x11')][_0x81a0('0x12')]===0x1f4){logger[_0x81a0('0x11')](_0x81a0('0xc'),_0x39f3da,_0x4c99ee[_0x81a0('0x11')][_0x81a0('0x13')]);return _0x99a5d(_0x4c99ee['error'][_0x81a0('0x13')]);}logger[_0x81a0('0x11')](_0x81a0('0xc'),_0x39f3da,_0x4c99ee[_0x81a0('0x11')][_0x81a0('0x13')]);return _0x5a0536(_0x4c99ee['error'][_0x81a0('0x13')]);}else{logger['info']('MailServerOut,\x20%s,\x20%s',_0x39f3da,'request\x20sent');_0x5a0536(_0x4c99ee[_0x81a0('0x14')][_0x81a0('0x13')]);}})[_0x81a0('0x15')](function(_0x3d5822){logger['error'](_0x81a0('0xc'),_0x39f3da,_0x3d5822);_0x99a5d(_0x3d5822);});});} \ No newline at end of file +var _0x001c=['client','then','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x001c,0x1ad));var _0xc001=function(_0x778e0a,_0x29bef9){_0x778e0a=_0x778e0a-0x0;var _0x1fa753=_0x001c[_0x778e0a];return _0x1fa753;};'use strict';var _=require(_0xc001('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc001('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc001('0x2'));var db=require(_0xc001('0x3'))['db'];var utils=require(_0xc001('0x4'));var logger=require(_0xc001('0x5'))('rpc');var config=require(_0xc001('0x6'));var jayson=require(_0xc001('0x7'));var client=jayson[_0xc001('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ea77c,_0x2782a6,_0x235aff){return new BPromise(function(_0x33f4c6,_0x3475d1){return client['request'](_0x3ea77c,_0x235aff)[_0xc001('0x9')](function(_0x1c217d){logger['info'](_0xc001('0xa'),_0x2782a6,_0xc001('0xb'));logger['debug'](_0xc001('0xc'),_0x2782a6,_0xc001('0xb'),JSON[_0xc001('0xd')](_0x1c217d));if(_0x1c217d['error']){if(_0x1c217d[_0xc001('0xe')][_0xc001('0xf')]===0x1f4){logger['error'](_0xc001('0xa'),_0x2782a6,_0x1c217d['error'][_0xc001('0x10')]);return _0x3475d1(_0x1c217d[_0xc001('0xe')][_0xc001('0x10')]);}logger['error'](_0xc001('0xa'),_0x2782a6,_0x1c217d['error']['message']);return _0x33f4c6(_0x1c217d[_0xc001('0xe')][_0xc001('0x10')]);}else{logger[_0xc001('0x11')](_0xc001('0xa'),_0x2782a6,_0xc001('0xb'));_0x33f4c6(_0x1c217d[_0xc001('0x12')]['message']);}})['catch'](function(_0x4df501){logger[_0xc001('0xe')](_0xc001('0xa'),_0x2782a6,_0x4df501);_0x3475d1(_0x4df501);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 7ca02fd..14c83f2 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 _0xdc15=['fs-extra','./mailSubstatus.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x346422,_0x5efef6){var _0x6b01ee=function(_0x1f4473){while(--_0x1f4473){_0x346422['push'](_0x346422['shift']());}};_0x6b01ee(++_0x5efef6);}(_0xdc15,0x1f3));var _0x5dc1=function(_0x75ce5b,_0x3b582f){_0x75ce5b=_0x75ce5b-0x0;var _0x22195e=_0xdc15[_0x75ce5b];return _0x22195e;};'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('0x8')](_0x5dc1('0xc'),auth[_0x5dc1('0xa')](),controller[_0x5dc1('0xd')]);router[_0x5dc1('0xe')]('/',auth[_0x5dc1('0xa')](),controller['create']);router['put'](_0x5dc1('0xc'),auth[_0x5dc1('0xa')](),controller['update']);router[_0x5dc1('0xf')](_0x5dc1('0xc'),auth[_0x5dc1('0xa')](),controller[_0x5dc1('0x10')]);module[_0x5dc1('0x11')]=router; \ No newline at end of file +var _0x3c32=['./mailSubstatus.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4a647f,_0x42843b){var _0x1c5d9a=function(_0x4c1ad3){while(--_0x4c1ad3){_0x4a647f['push'](_0x4a647f['shift']());}};_0x1c5d9a(++_0x42843b);}(_0x3c32,0x161));var _0x23c3=function(_0x286643,_0x58f863){_0x286643=_0x286643-0x0;var _0x59e0ef=_0x3c32[_0x286643];return _0x59e0ef;};'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')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x23c3('0x8')](_0x23c3('0xb'),auth[_0x23c3('0x9')](),controller[_0x23c3('0xc')]);router[_0x23c3('0xd')]('/',auth[_0x23c3('0x9')](),controller[_0x23c3('0xe')]);router[_0x23c3('0xf')](_0x23c3('0xb'),auth[_0x23c3('0x9')](),controller[_0x23c3('0x10')]);router[_0x23c3('0x11')](_0x23c3('0xb'),auth[_0x23c3('0x9')](),controller[_0x23c3('0x12')]);module[_0x23c3('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 70a8bfb..74e0cf2 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 _0x5f66=['name','STRING','exports'];(function(_0x3db2e8,_0x49c09b){var _0xf05958=function(_0x291f99){while(--_0x291f99){_0x3db2e8['push'](_0x3db2e8['shift']());}};_0xf05958(++_0x49c09b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x65f6('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x65f6('0x2')]}}; \ No newline at end of file +var _0xb7f0=['exports','STRING','name','sequelize'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x3b0b34,_0xe6a14f){_0x3b0b34=_0x3b0b34-0x0;var _0x5f5496=_0xb7f0[_0x3b0b34];return _0x5f5496;};'use strict';var Sequelize=require(_0x0b7f('0x0'));module[_0x0b7f('0x1')]={'name':{'type':Sequelize[_0x0b7f('0x2')],'unique':_0x0b7f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index c93f966..67385d9 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 _0xaf7b=['describe','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','json','reject','save','then','end','error','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','MailSubstatus','count','includeAll','include','findAll','catch','show','params','options','create','body','update','find'];(function(_0x4cb5a8,_0x3a517a){var _0x447cdd=function(_0x191531){while(--_0x191531){_0x4cb5a8['push'](_0x4cb5a8['shift']());}};_0x447cdd(++_0x3a517a);}(_0xaf7b,0x101));var _0xbaf7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaf7b[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbaf7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbaf7('0x1'));var BPromise=require(_0xbaf7('0x2'));var Mustache=require(_0xbaf7('0x3'));var util=require('util');var path=require(_0xbaf7('0x4'));var sox=require(_0xbaf7('0x5'));var csv=require(_0xbaf7('0x6'));var ejs=require(_0xbaf7('0x7'));var fs=require('fs');var fs_extra=require(_0xbaf7('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbaf7('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xbaf7('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbaf7('0xa'));var qs=require(_0xbaf7('0xb'));var as=require(_0xbaf7('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbaf7('0xd'))(_0xbaf7('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbaf7('0xf'));var db=require(_0xbaf7('0x10'))['db'];function respondWithStatusCode(_0x1d264e,_0x437a0e){_0x437a0e=_0x437a0e||0xcc;return function(_0x149ae3){if(_0x149ae3){return _0x1d264e[_0xbaf7('0x11')](_0x437a0e);}return _0x1d264e[_0xbaf7('0x12')](_0x437a0e)['end']();};}function respondWithResult(_0x55417c,_0x15be89){_0x15be89=_0x15be89||0xc8;return function(_0x89d295){if(_0x89d295){return _0x55417c[_0xbaf7('0x12')](_0x15be89)['json'](_0x89d295);}};}function respondWithFilteredResult(_0x46b2a3,_0x30592f){return function(_0x28c2e6){if(_0x28c2e6){var _0x4ee2bd=_0x28c2e6['count'],_0x28b3bb=_0x30592f['offset'],_0x36b89f=_0x30592f[_0xbaf7('0x13')]+_0x30592f[_0xbaf7('0x14')],_0x4293e6;if(_0x36b89f>=_0x4ee2bd){_0x36b89f=_0x4ee2bd;_0x4293e6=0xc8;}else{_0x4293e6=0xce;}_0x46b2a3[_0xbaf7('0x12')](_0x4293e6);return _0x46b2a3['set']('Content-Range',_0x28b3bb+'-'+_0x36b89f+'/'+_0x4ee2bd)[_0xbaf7('0x15')](_0x28c2e6);}return null;};}function patchUpdates(_0x437d22){return function(_0x5259fd){try{jsonpatch['apply'](_0x5259fd,_0x437d22,!![]);}catch(_0x4b1aff){return BPromise[_0xbaf7('0x16')](_0x4b1aff);}return _0x5259fd[_0xbaf7('0x17')]();};}function saveUpdates(_0x5a179b,_0x103c21){return function(_0x4ed4dc){if(_0x4ed4dc){return _0x4ed4dc['update'](_0x5a179b)[_0xbaf7('0x18')](function(_0x2670d3){return _0x2670d3;});}return null;};}function removeEntity(_0x4477de,_0x1edf93){return function(_0x5167ce){if(_0x5167ce){return _0x5167ce['destroy']()['then'](function(){_0x4477de[_0xbaf7('0x12')](0xcc)[_0xbaf7('0x19')]();});}};}function handleEntityNotFound(_0x13d57b,_0x40f6f2){return function(_0x73e72a){if(!_0x73e72a){_0x13d57b['sendStatus'](0x194);}return _0x73e72a;};}function handleError(_0x571583,_0x3ebeaf){_0x3ebeaf=_0x3ebeaf||0x1f4;return function(_0x262f2a){logger[_0xbaf7('0x1a')](_0x262f2a['stack']);if(_0x262f2a[_0xbaf7('0x1b')]){delete _0x262f2a[_0xbaf7('0x1b')];}_0x571583[_0xbaf7('0x12')](_0x3ebeaf)[_0xbaf7('0x1c')](_0x262f2a);};}exports[_0xbaf7('0x1d')]=function(_0x59e8d8,_0x3c78f2){var _0x59fdea={},_0xe811fb={},_0x567666={'count':0x0,'rows':[]};var _0x35e980=_[_0xbaf7('0x1e')](db['MailSubstatus'][_0xbaf7('0x1f')],function(_0x2efed9){return{'name':_0x2efed9[_0xbaf7('0x20')],'type':_0x2efed9['type'][_0xbaf7('0x21')]};});_0xe811fb['model']=_[_0xbaf7('0x1e')](_0x35e980,_0xbaf7('0x1b'));_0xe811fb[_0xbaf7('0x22')]=_[_0xbaf7('0x23')](_0x59e8d8[_0xbaf7('0x22')]);_0xe811fb[_0xbaf7('0x24')]=_[_0xbaf7('0x25')](_0xe811fb[_0xbaf7('0x26')],_0xe811fb[_0xbaf7('0x22')]);_0x59fdea[_0xbaf7('0x27')]=_['intersection'](_0xe811fb['model'],qs[_0xbaf7('0x28')](_0x59e8d8[_0xbaf7('0x22')][_0xbaf7('0x28')]));_0x59fdea['attributes']=_0x59fdea[_0xbaf7('0x27')][_0xbaf7('0x29')]?_0x59fdea['attributes']:_0xe811fb['model'];if(!_0x59e8d8[_0xbaf7('0x22')][_0xbaf7('0x2a')](_0xbaf7('0x2b'))){_0x59fdea[_0xbaf7('0x14')]=qs[_0xbaf7('0x14')](_0x59e8d8[_0xbaf7('0x22')][_0xbaf7('0x14')]);_0x59fdea[_0xbaf7('0x13')]=qs['offset'](_0x59e8d8[_0xbaf7('0x22')][_0xbaf7('0x13')]);}_0x59fdea[_0xbaf7('0x2c')]=qs[_0xbaf7('0x2d')](_0x59e8d8[_0xbaf7('0x22')]['sort']);_0x59fdea[_0xbaf7('0x2e')]=qs[_0xbaf7('0x24')](_[_0xbaf7('0x2f')](_0x59e8d8[_0xbaf7('0x22')],_0xe811fb[_0xbaf7('0x24')]),_0x35e980);if(_0x59e8d8[_0xbaf7('0x22')]['filter']){_0x59fdea['where']=_[_0xbaf7('0x30')](_0x59fdea[_0xbaf7('0x2e')],{'$or':_['map'](_0x35e980,function(_0x4b0cb3){if(_0x4b0cb3['type']!=='VIRTUAL'){var _0x3f83bb={};_0x3f83bb[_0x4b0cb3[_0xbaf7('0x1b')]]={'$like':'%'+_0x59e8d8[_0xbaf7('0x22')][_0xbaf7('0x31')]+'%'};return _0x3f83bb;}})});}_0x59fdea=_[_0xbaf7('0x30')]({},_0x59fdea,_0x59e8d8['options']);var _0x3f3091={'where':_0x59fdea[_0xbaf7('0x2e')]};return db[_0xbaf7('0x32')][_0xbaf7('0x33')](_0x3f3091)['then'](function(_0x575cc6){_0x567666[_0xbaf7('0x33')]=_0x575cc6;if(_0x59e8d8[_0xbaf7('0x22')][_0xbaf7('0x34')]){_0x59fdea[_0xbaf7('0x35')]=[{'all':!![]}];}return db['MailSubstatus'][_0xbaf7('0x36')](_0x59fdea);})[_0xbaf7('0x18')](function(_0x1cb6e4){_0x567666['rows']=_0x1cb6e4;return _0x567666;})[_0xbaf7('0x18')](respondWithFilteredResult(_0x3c78f2,_0x59fdea))[_0xbaf7('0x37')](handleError(_0x3c78f2,null));};exports[_0xbaf7('0x38')]=function(_0x368e24,_0x3dbff1){var _0x3b1b80={'raw':!![],'where':{'id':_0x368e24[_0xbaf7('0x39')]['id']}},_0x5d0934={};_0x5d0934['model']=_[_0xbaf7('0x23')](db[_0xbaf7('0x32')]['rawAttributes']);_0x5d0934[_0xbaf7('0x22')]=_['keys'](_0x368e24['query']);_0x5d0934[_0xbaf7('0x24')]=_['intersection'](_0x5d0934[_0xbaf7('0x26')],_0x5d0934['query']);_0x3b1b80[_0xbaf7('0x27')]=_[_0xbaf7('0x25')](_0x5d0934[_0xbaf7('0x26')],qs[_0xbaf7('0x28')](_0x368e24['query'][_0xbaf7('0x28')]));_0x3b1b80[_0xbaf7('0x27')]=_0x3b1b80[_0xbaf7('0x27')][_0xbaf7('0x29')]?_0x3b1b80[_0xbaf7('0x27')]:_0x5d0934['model'];if(_0x368e24[_0xbaf7('0x22')][_0xbaf7('0x34')]){_0x3b1b80[_0xbaf7('0x35')]=[{'all':!![]}];}_0x3b1b80=_[_0xbaf7('0x30')]({},_0x3b1b80,_0x368e24[_0xbaf7('0x3a')]);return db[_0xbaf7('0x32')]['find'](_0x3b1b80)[_0xbaf7('0x18')](handleEntityNotFound(_0x3dbff1,null))[_0xbaf7('0x18')](respondWithResult(_0x3dbff1,null))[_0xbaf7('0x37')](handleError(_0x3dbff1,null));};exports['create']=function(_0x56d226,_0x35be5a){return db['MailSubstatus'][_0xbaf7('0x3b')](_0x56d226[_0xbaf7('0x3c')],{})[_0xbaf7('0x18')](respondWithResult(_0x35be5a,0xc9))[_0xbaf7('0x37')](handleError(_0x35be5a,null));};exports[_0xbaf7('0x3d')]=function(_0x29704c,_0x15cbfe){if(_0x29704c[_0xbaf7('0x3c')]['id']){delete _0x29704c[_0xbaf7('0x3c')]['id'];}return db[_0xbaf7('0x32')][_0xbaf7('0x3e')]({'where':{'id':_0x29704c['params']['id']}})[_0xbaf7('0x18')](handleEntityNotFound(_0x15cbfe,null))[_0xbaf7('0x18')](saveUpdates(_0x29704c[_0xbaf7('0x3c')],null))[_0xbaf7('0x18')](respondWithResult(_0x15cbfe,null))[_0xbaf7('0x37')](handleError(_0x15cbfe,null));};exports['destroy']=function(_0x984b7e,_0x3525e7){return db[_0xbaf7('0x32')]['find']({'where':{'id':_0x984b7e['params']['id']}})['then'](handleEntityNotFound(_0x3525e7,null))[_0xbaf7('0x18')](removeEntity(_0x3525e7,null))[_0xbaf7('0x37')](handleError(_0x3525e7,null));};exports[_0xbaf7('0x3f')]=function(_0x5abd9f,_0x31377f){return db[_0xbaf7('0x32')][_0xbaf7('0x3f')]()[_0xbaf7('0x18')](respondWithResult(_0x31377f,null))[_0xbaf7('0x37')](handleError(_0x31377f,null));}; \ No newline at end of file +var _0x5ac2=['apply','reject','save','update','then','destroy','error','name','send','index','map','MailSubstatus','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','fields','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','lodash','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','end','status','json','count','offset','limit','set','Content-Range'];(function(_0xef376e,_0x1fd438){var _0x58ff1f=function(_0x15e662){while(--_0x15e662){_0xef376e['push'](_0xef376e['shift']());}};_0x58ff1f(++_0x1fd438);}(_0x5ac2,0xbc));var _0x25ac=function(_0x4a8f3d,_0x696385){_0x4a8f3d=_0x4a8f3d-0x0;var _0x54fe57=_0x5ac2[_0x4a8f3d];return _0x54fe57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25ac('0x0'));var zipdir=require(_0x25ac('0x1'));var jsonpatch=require(_0x25ac('0x2'));var rp=require('request-promise');var moment=require(_0x25ac('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x25ac('0x4'));var util=require(_0x25ac('0x5'));var path=require(_0x25ac('0x6'));var sox=require(_0x25ac('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25ac('0x8'));var squel=require(_0x25ac('0x9'));var crypto=require(_0x25ac('0xa'));var jsforce=require(_0x25ac('0xb'));var deskjs=require(_0x25ac('0xc'));var toCsv=require(_0x25ac('0xd'));var querystring=require('querystring');var Papa=require(_0x25ac('0xe'));var Redis=require(_0x25ac('0xf'));var authService=require(_0x25ac('0x10'));var qs=require(_0x25ac('0x11'));var as=require(_0x25ac('0x12'));var hardwareService=require(_0x25ac('0x13'));var logger=require(_0x25ac('0x14'))('api');var utils=require(_0x25ac('0x15'));var config=require(_0x25ac('0x16'));var licenseUtil=require(_0x25ac('0x17'));var db=require(_0x25ac('0x18'))['db'];function respondWithStatusCode(_0x42cab5,_0x568fd2){_0x568fd2=_0x568fd2||0xcc;return function(_0x26f422){if(_0x26f422){return _0x42cab5[_0x25ac('0x19')](_0x568fd2);}return _0x42cab5['status'](_0x568fd2)[_0x25ac('0x1a')]();};}function respondWithResult(_0x48d9f0,_0x275f35){_0x275f35=_0x275f35||0xc8;return function(_0x29b192){if(_0x29b192){return _0x48d9f0[_0x25ac('0x1b')](_0x275f35)[_0x25ac('0x1c')](_0x29b192);}};}function respondWithFilteredResult(_0x13372e,_0x453e7c){return function(_0x5b2b4b){if(_0x5b2b4b){var _0x2b08ee=_0x5b2b4b[_0x25ac('0x1d')],_0x37cb92=_0x453e7c['offset'],_0x4cca4b=_0x453e7c[_0x25ac('0x1e')]+_0x453e7c[_0x25ac('0x1f')],_0x49c17c;if(_0x4cca4b>=_0x2b08ee){_0x4cca4b=_0x2b08ee;_0x49c17c=0xc8;}else{_0x49c17c=0xce;}_0x13372e[_0x25ac('0x1b')](_0x49c17c);return _0x13372e[_0x25ac('0x20')](_0x25ac('0x21'),_0x37cb92+'-'+_0x4cca4b+'/'+_0x2b08ee)[_0x25ac('0x1c')](_0x5b2b4b);}return null;};}function patchUpdates(_0x924166){return function(_0x566c01){try{jsonpatch[_0x25ac('0x22')](_0x566c01,_0x924166,!![]);}catch(_0x454de3){return BPromise[_0x25ac('0x23')](_0x454de3);}return _0x566c01[_0x25ac('0x24')]();};}function saveUpdates(_0x4b8e45,_0x13626a){return function(_0x194390){if(_0x194390){return _0x194390[_0x25ac('0x25')](_0x4b8e45)[_0x25ac('0x26')](function(_0x51d19a){return _0x51d19a;});}return null;};}function removeEntity(_0x2de9a5,_0x230d1b){return function(_0x107c10){if(_0x107c10){return _0x107c10[_0x25ac('0x27')]()[_0x25ac('0x26')](function(){_0x2de9a5[_0x25ac('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a9e98,_0xc33a4e){return function(_0x2098a0){if(!_0x2098a0){_0x2a9e98['sendStatus'](0x194);}return _0x2098a0;};}function handleError(_0x146931,_0x2fa264){_0x2fa264=_0x2fa264||0x1f4;return function(_0x18a9e5){logger[_0x25ac('0x28')](_0x18a9e5['stack']);if(_0x18a9e5['name']){delete _0x18a9e5[_0x25ac('0x29')];}_0x146931[_0x25ac('0x1b')](_0x2fa264)[_0x25ac('0x2a')](_0x18a9e5);};}exports[_0x25ac('0x2b')]=function(_0x2dbcfa,_0x446b7a){var _0x460c6e={},_0x494ecf={},_0x157f00={'count':0x0,'rows':[]};var _0x426047=_[_0x25ac('0x2c')](db[_0x25ac('0x2d')][_0x25ac('0x2e')],function(_0x185335){return{'name':_0x185335['fieldName'],'type':_0x185335[_0x25ac('0x2f')][_0x25ac('0x30')]};});_0x494ecf[_0x25ac('0x31')]=_[_0x25ac('0x2c')](_0x426047,_0x25ac('0x29'));_0x494ecf[_0x25ac('0x32')]=_[_0x25ac('0x33')](_0x2dbcfa[_0x25ac('0x32')]);_0x494ecf[_0x25ac('0x34')]=_[_0x25ac('0x35')](_0x494ecf[_0x25ac('0x31')],_0x494ecf[_0x25ac('0x32')]);_0x460c6e[_0x25ac('0x36')]=_['intersection'](_0x494ecf[_0x25ac('0x31')],qs['fields'](_0x2dbcfa['query']['fields']));_0x460c6e['attributes']=_0x460c6e['attributes']['length']?_0x460c6e[_0x25ac('0x36')]:_0x494ecf['model'];if(!_0x2dbcfa['query']['hasOwnProperty']('nolimit')){_0x460c6e[_0x25ac('0x1f')]=qs[_0x25ac('0x1f')](_0x2dbcfa[_0x25ac('0x32')][_0x25ac('0x1f')]);_0x460c6e['offset']=qs['offset'](_0x2dbcfa['query']['offset']);}_0x460c6e[_0x25ac('0x37')]=qs[_0x25ac('0x38')](_0x2dbcfa['query']['sort']);_0x460c6e[_0x25ac('0x39')]=qs[_0x25ac('0x34')](_[_0x25ac('0x3a')](_0x2dbcfa[_0x25ac('0x32')],_0x494ecf[_0x25ac('0x34')]),_0x426047);if(_0x2dbcfa[_0x25ac('0x32')][_0x25ac('0x3b')]){_0x460c6e[_0x25ac('0x39')]=_['merge'](_0x460c6e[_0x25ac('0x39')],{'$or':_[_0x25ac('0x2c')](_0x426047,function(_0x2d9d21){if(_0x2d9d21[_0x25ac('0x2f')]!==_0x25ac('0x3c')){var _0x5639b0={};_0x5639b0[_0x2d9d21[_0x25ac('0x29')]]={'$like':'%'+_0x2dbcfa['query']['filter']+'%'};return _0x5639b0;}})});}_0x460c6e=_[_0x25ac('0x3d')]({},_0x460c6e,_0x2dbcfa[_0x25ac('0x3e')]);var _0x2908c7={'where':_0x460c6e[_0x25ac('0x39')]};return db['MailSubstatus'][_0x25ac('0x1d')](_0x2908c7)[_0x25ac('0x26')](function(_0x566ab0){_0x157f00[_0x25ac('0x1d')]=_0x566ab0;if(_0x2dbcfa['query']['includeAll']){_0x460c6e[_0x25ac('0x3f')]=[{'all':!![]}];}return db[_0x25ac('0x2d')][_0x25ac('0x40')](_0x460c6e);})[_0x25ac('0x26')](function(_0xb0be71){_0x157f00[_0x25ac('0x41')]=_0xb0be71;return _0x157f00;})[_0x25ac('0x26')](respondWithFilteredResult(_0x446b7a,_0x460c6e))[_0x25ac('0x42')](handleError(_0x446b7a,null));};exports[_0x25ac('0x43')]=function(_0x3bc4b1,_0x3dec6c){var _0x604c1f={'raw':!![],'where':{'id':_0x3bc4b1[_0x25ac('0x44')]['id']}},_0xb4698a={};_0xb4698a[_0x25ac('0x31')]=_['keys'](db[_0x25ac('0x2d')][_0x25ac('0x2e')]);_0xb4698a[_0x25ac('0x32')]=_[_0x25ac('0x33')](_0x3bc4b1[_0x25ac('0x32')]);_0xb4698a[_0x25ac('0x34')]=_['intersection'](_0xb4698a[_0x25ac('0x31')],_0xb4698a[_0x25ac('0x32')]);_0x604c1f['attributes']=_[_0x25ac('0x35')](_0xb4698a['model'],qs[_0x25ac('0x45')](_0x3bc4b1[_0x25ac('0x32')][_0x25ac('0x45')]));_0x604c1f[_0x25ac('0x36')]=_0x604c1f['attributes']['length']?_0x604c1f[_0x25ac('0x36')]:_0xb4698a[_0x25ac('0x31')];if(_0x3bc4b1[_0x25ac('0x32')]['includeAll']){_0x604c1f[_0x25ac('0x3f')]=[{'all':!![]}];}_0x604c1f=_['merge']({},_0x604c1f,_0x3bc4b1[_0x25ac('0x3e')]);return db[_0x25ac('0x2d')][_0x25ac('0x46')](_0x604c1f)[_0x25ac('0x26')](handleEntityNotFound(_0x3dec6c,null))[_0x25ac('0x26')](respondWithResult(_0x3dec6c,null))[_0x25ac('0x42')](handleError(_0x3dec6c,null));};exports['create']=function(_0x3f35cd,_0x3ae8e8){return db['MailSubstatus'][_0x25ac('0x47')](_0x3f35cd[_0x25ac('0x48')],{})[_0x25ac('0x26')](respondWithResult(_0x3ae8e8,0xc9))[_0x25ac('0x42')](handleError(_0x3ae8e8,null));};exports['update']=function(_0x11b41d,_0x4ea188){if(_0x11b41d['body']['id']){delete _0x11b41d[_0x25ac('0x48')]['id'];}return db[_0x25ac('0x2d')][_0x25ac('0x46')]({'where':{'id':_0x11b41d[_0x25ac('0x44')]['id']}})[_0x25ac('0x26')](handleEntityNotFound(_0x4ea188,null))[_0x25ac('0x26')](saveUpdates(_0x11b41d[_0x25ac('0x48')],null))[_0x25ac('0x26')](respondWithResult(_0x4ea188,null))[_0x25ac('0x42')](handleError(_0x4ea188,null));};exports[_0x25ac('0x27')]=function(_0x148ffa,_0x49b160){return db[_0x25ac('0x2d')][_0x25ac('0x46')]({'where':{'id':_0x148ffa[_0x25ac('0x44')]['id']}})[_0x25ac('0x26')](handleEntityNotFound(_0x49b160,null))[_0x25ac('0x26')](removeEntity(_0x49b160,null))[_0x25ac('0x42')](handleError(_0x49b160,null));};exports[_0x25ac('0x49')]=function(_0x5c2ede,_0x180dee){return db[_0x25ac('0x2d')][_0x25ac('0x49')]()['then'](respondWithResult(_0x180dee,null))[_0x25ac('0x42')](handleError(_0x180dee,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 73ea771..18d1d54 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 _0x97db=['path','rimraf','exports','MailSubstatus','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x97db,0x1b4));var _0xb97d=function(_0x59344d,_0x52a2dd){_0x59344d=_0x59344d-0x0;var _0x22f223=_0x97db[_0x59344d];return _0x22f223;};'use strict';var _=require(_0xb97d('0x0'));var util=require(_0xb97d('0x1'));var logger=require(_0xb97d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb97d('0x3'));var rp=require(_0xb97d('0x4'));var fs=require('fs');var path=require(_0xb97d('0x5'));var rimraf=require(_0xb97d('0x6'));var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module[_0xb97d('0x7')]=function(_0x1f59dd,_0x4a5902){return _0x1f59dd['define'](_0xb97d('0x8'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0120=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','lodash'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0x0120,0x6f));var _0x0012=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x0120[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));module[_0x0012('0xb')]=function(_0x4eaa5b,_0x4b396c){return _0x4eaa5b['define'](_0x0012('0xc'),attributes,{'tableName':_0x0012('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 5cb22d8..14d1f08 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 _0xf109=['util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x5d32a6,_0x64ceb0){var _0x2621e8=function(_0xb04de8){while(--_0xb04de8){_0x5d32a6['push'](_0x5d32a6['shift']());}};_0x2621e8(++_0x64ceb0);}(_0xf109,0xce));var _0x9f10=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xf109[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var moment=require(_0x9f10('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f10('0x3'))['db'];var utils=require(_0x9f10('0x4'));var logger=require(_0x9f10('0x5'))(_0x9f10('0x6'));var config=require(_0x9f10('0x7'));var jayson=require(_0x9f10('0x8'));var client=jayson[_0x9f10('0x9')][_0x9f10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227a29,_0x2a877e,_0x3fd82f){return new BPromise(function(_0x5c8719,_0x42a8cd){return client[_0x9f10('0xb')](_0x227a29,_0x3fd82f)[_0x9f10('0xc')](function(_0x1bde2e){logger[_0x9f10('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x2a877e,_0x9f10('0xe'));logger[_0x9f10('0xf')](_0x9f10('0x10'),_0x2a877e,'request\x20sent',JSON['stringify'](_0x1bde2e));if(_0x1bde2e[_0x9f10('0x11')]){if(_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x12')]===0x1f4){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x42a8cd(_0x1bde2e['error'][_0x9f10('0x14')]);}logger[_0x9f10('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x5c8719(_0x1bde2e['error']['message']);}else{logger[_0x9f10('0xd')](_0x9f10('0x13'),_0x2a877e,'request\x20sent');_0x5c8719(_0x1bde2e[_0x9f10('0x15')]['message']);}})[_0x9f10('0x16')](function(_0x1f68d8){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1f68d8);_0x42a8cd(_0x1f68d8);});});} \ No newline at end of file +var _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result'];(function(_0xd43aed,_0x556f54){var _0x4aa694=function(_0x56817d){while(--_0x56817d){_0xd43aed['push'](_0xd43aed['shift']());}};_0x4aa694(++_0x556f54);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1e1020,_0xd64a27){_0x1e1020=_0x1e1020-0x0;var _0x464719=_0xf3cd[_0x1e1020];return _0x464719;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 51dc997..af382df 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 _0x847d=['/describe','describe','/:id','show','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x44307b,_0x509d25){var _0x4e9ef6=function(_0x306f15){while(--_0x306f15){_0x44307b['push'](_0x44307b['shift']());}};_0x4e9ef6(++_0x509d25);}(_0x847d,0x14a));var _0xd847=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0x847d[_0x4f0e62];return _0x117ab8;};'use strict';var multer=require('multer');var util=require(_0xd847('0x0'));var path=require(_0xd847('0x1'));var timeout=require(_0xd847('0x2'));var express=require('express');var router=express[_0xd847('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd847('0x4'));var interaction=require(_0xd847('0x5'));var config=require('../../config/environment');var controller=require(_0xd847('0x6'));router[_0xd847('0x7')]('/',auth[_0xd847('0x8')](),controller[_0xd847('0x9')]);router['get'](_0xd847('0xa'),auth[_0xd847('0x8')](),controller[_0xd847('0xb')]);router[_0xd847('0x7')](_0xd847('0xc'),auth[_0xd847('0x8')](),controller[_0xd847('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd847('0xc'),auth[_0xd847('0x8')](),controller[_0xd847('0xe')]);router['delete']('/:id',auth[_0xd847('0x8')](),controller[_0xd847('0xf')]);module[_0xd847('0x10')]=router; \ No newline at end of file +var _0x2dae=['show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2dae,0xc3));var _0xe2da=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x2dae[_0x28611e];return _0x530f69;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xd')]);router[_0xe2da('0x9')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xf')]);router['post']('/',auth[_0xe2da('0xc')](),controller[_0xe2da('0x10')]);router[_0xe2da('0x11')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0x12')]);router[_0xe2da('0x13')](_0xe2da('0xe'),auth['isAuthenticated'](),controller[_0xe2da('0x14')]);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 f6c45d6..3725d45 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 _0x4b1b=['account','agent','queue','DATE','moment','sequelize','STRING','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b1b,0x16c));var _0xb4b1=function(_0x4f0fe7,_0x2f9ccf){_0x4f0fe7=_0x4f0fe7-0x0;var _0x3fa542=_0x4b1b[_0x4f0fe7];return _0x3fa542;};'use strict';var moment=require(_0xb4b1('0x0'));var Sequelize=require(_0xb4b1('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xb4b1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb4b1('0x3')](_0xb4b1('0x4'),_0xb4b1('0x5'),_0xb4b1('0x6')),'allowNull':![],'defaultValue':_0xb4b1('0x6')},'transferredAt':{'type':Sequelize[_0xb4b1('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x43df=['account','agent','NOW','moment','sequelize','STRING','ENUM'];(function(_0xae405e,_0x5b05d8){var _0x31ac9d=function(_0x366e04){while(--_0x366e04){_0xae405e['push'](_0xae405e['shift']());}};_0x31ac9d(++_0x5b05d8);}(_0x43df,0x1b5));var _0xf43d=function(_0x18a794,_0x335c63){_0x18a794=_0x18a794-0x0;var _0x4fadaa=_0x43df[_0x18a794];return _0x4fadaa;};'use strict';var moment=require(_0xf43d('0x0'));var Sequelize=require(_0xf43d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xf43d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf43d('0x3')](_0xf43d('0x4'),_0xf43d('0x5'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xf43d('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 066deca..31210c2 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 _0x842c=['reject','save','update','then','sendStatus','error','name','send','index','map','MailTransferReport','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x48869e,_0x1ba424){var _0x1aec29=function(_0x1a5142){while(--_0x1a5142){_0x48869e['push'](_0x48869e['shift']());}};_0x1aec29(++_0x1ba424);}(_0x842c,0x1de));var _0xc842=function(_0x12c25e,_0x4f8b03){_0x12c25e=_0x12c25e-0x0;var _0x315610=_0x842c[_0x12c25e];return _0x315610;};'use strict';var emlformat=require(_0xc842('0x0'));var rimraf=require(_0xc842('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc842('0x2'));var rp=require(_0xc842('0x3'));var moment=require(_0xc842('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc842('0x5'));var util=require(_0xc842('0x6'));var path=require(_0xc842('0x7'));var sox=require(_0xc842('0x8'));var csv=require('to-csv');var ejs=require(_0xc842('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc842('0xa'));var squel=require(_0xc842('0xb'));var crypto=require(_0xc842('0xc'));var jsforce=require(_0xc842('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc842('0xe'));var Papa=require('papaparse');var Redis=require(_0xc842('0xf'));var authService=require(_0xc842('0x10'));var qs=require(_0xc842('0x11'));var as=require(_0xc842('0x12'));var hardwareService=require(_0xc842('0x13'));var logger=require(_0xc842('0x14'))(_0xc842('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc842('0x16'));var db=require(_0xc842('0x17'))['db'];function respondWithStatusCode(_0x433c67,_0x1e38cf){_0x1e38cf=_0x1e38cf||0xcc;return function(_0x5a4d36){if(_0x5a4d36){return _0x433c67['sendStatus'](_0x1e38cf);}return _0x433c67[_0xc842('0x18')](_0x1e38cf)[_0xc842('0x19')]();};}function respondWithResult(_0xe37320,_0x5d2ac0){_0x5d2ac0=_0x5d2ac0||0xc8;return function(_0x5ee995){if(_0x5ee995){return _0xe37320[_0xc842('0x18')](_0x5d2ac0)[_0xc842('0x1a')](_0x5ee995);}};}function respondWithFilteredResult(_0x5813e8,_0x882115){return function(_0xb6207b){if(_0xb6207b){var _0x1f8675=_0xb6207b[_0xc842('0x1b')],_0xe9938a=_0x882115[_0xc842('0x1c')],_0x7cfca5=_0x882115[_0xc842('0x1c')]+_0x882115[_0xc842('0x1d')],_0x376c45;if(_0x7cfca5>=_0x1f8675){_0x7cfca5=_0x1f8675;_0x376c45=0xc8;}else{_0x376c45=0xce;}_0x5813e8['status'](_0x376c45);return _0x5813e8[_0xc842('0x1e')](_0xc842('0x1f'),_0xe9938a+'-'+_0x7cfca5+'/'+_0x1f8675)[_0xc842('0x1a')](_0xb6207b);}return null;};}function patchUpdates(_0xa0628e){return function(_0x828f25){try{jsonpatch[_0xc842('0x20')](_0x828f25,_0xa0628e,!![]);}catch(_0x4434ba){return BPromise[_0xc842('0x21')](_0x4434ba);}return _0x828f25[_0xc842('0x22')]();};}function saveUpdates(_0x47d10e,_0x204bb3){return function(_0x544f33){if(_0x544f33){return _0x544f33[_0xc842('0x23')](_0x47d10e)[_0xc842('0x24')](function(_0x27c195){return _0x27c195;});}return null;};}function removeEntity(_0x5db095,_0x3768ea){return function(_0x284a5b){if(_0x284a5b){return _0x284a5b['destroy']()[_0xc842('0x24')](function(){_0x5db095[_0xc842('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bc4e5,_0x188d01){return function(_0x122138){if(!_0x122138){_0x5bc4e5[_0xc842('0x25')](0x194);}return _0x122138;};}function handleError(_0x4b811b,_0x5eeb9f){_0x5eeb9f=_0x5eeb9f||0x1f4;return function(_0x43a43b){logger[_0xc842('0x26')](_0x43a43b['stack']);if(_0x43a43b[_0xc842('0x27')]){delete _0x43a43b['name'];}_0x4b811b[_0xc842('0x18')](_0x5eeb9f)[_0xc842('0x28')](_0x43a43b);};}exports[_0xc842('0x29')]=function(_0x3c6123,_0x45fa3c){var _0x37a78e={},_0x37ae80={},_0x16722b={'count':0x0,'rows':[]};var _0x4cd1d7=_[_0xc842('0x2a')](db[_0xc842('0x2b')]['rawAttributes'],function(_0x1d70fc){return{'name':_0x1d70fc[_0xc842('0x2c')],'type':_0x1d70fc['type'][_0xc842('0x2d')]};});_0x37ae80[_0xc842('0x2e')]=_[_0xc842('0x2a')](_0x4cd1d7,_0xc842('0x27'));_0x37ae80['query']=_[_0xc842('0x2f')](_0x3c6123[_0xc842('0x30')]);_0x37ae80[_0xc842('0x31')]=_[_0xc842('0x32')](_0x37ae80[_0xc842('0x2e')],_0x37ae80[_0xc842('0x30')]);_0x37a78e[_0xc842('0x33')]=_[_0xc842('0x32')](_0x37ae80[_0xc842('0x2e')],qs[_0xc842('0x34')](_0x3c6123['query'][_0xc842('0x34')]));_0x37a78e[_0xc842('0x33')]=_0x37a78e[_0xc842('0x33')][_0xc842('0x35')]?_0x37a78e['attributes']:_0x37ae80[_0xc842('0x2e')];if(!_0x3c6123[_0xc842('0x30')][_0xc842('0x36')](_0xc842('0x37'))){_0x37a78e['limit']=qs['limit'](_0x3c6123[_0xc842('0x30')][_0xc842('0x1d')]);_0x37a78e[_0xc842('0x1c')]=qs['offset'](_0x3c6123[_0xc842('0x30')]['offset']);}_0x37a78e['order']=qs[_0xc842('0x38')](_0x3c6123[_0xc842('0x30')]['sort']);_0x37a78e[_0xc842('0x39')]=qs[_0xc842('0x31')](_[_0xc842('0x3a')](_0x3c6123['query'],_0x37ae80[_0xc842('0x31')]),_0x4cd1d7);if(_0x3c6123['query'][_0xc842('0x3b')]){_0x37a78e[_0xc842('0x39')]=_[_0xc842('0x3c')](_0x37a78e['where'],{'$or':_[_0xc842('0x2a')](_0x4cd1d7,function(_0x2d6a89){if(_0x2d6a89[_0xc842('0x3d')]!==_0xc842('0x3e')){var _0x332855={};_0x332855[_0x2d6a89[_0xc842('0x27')]]={'$like':'%'+_0x3c6123[_0xc842('0x30')]['filter']+'%'};return _0x332855;}})});}_0x37a78e=_[_0xc842('0x3c')]({},_0x37a78e,_0x3c6123[_0xc842('0x3f')]);var _0x56acae={'where':_0x37a78e[_0xc842('0x39')]};return db['MailTransferReport'][_0xc842('0x1b')](_0x56acae)[_0xc842('0x24')](function(_0x2f0151){_0x16722b[_0xc842('0x1b')]=_0x2f0151;if(_0x3c6123[_0xc842('0x30')]['includeAll']){_0x37a78e[_0xc842('0x40')]=[{'all':!![]}];}return db[_0xc842('0x2b')]['findAll'](_0x37a78e);})[_0xc842('0x24')](function(_0x573332){_0x16722b[_0xc842('0x41')]=_0x573332;return _0x16722b;})[_0xc842('0x24')](respondWithFilteredResult(_0x45fa3c,_0x37a78e))[_0xc842('0x42')](handleError(_0x45fa3c,null));};exports['show']=function(_0x39acc9,_0x44d40c){var _0x2b07a4={'raw':!![],'where':{'id':_0x39acc9['params']['id']}},_0xa37c09={};_0xa37c09[_0xc842('0x2e')]=_[_0xc842('0x2f')](db[_0xc842('0x2b')][_0xc842('0x43')]);_0xa37c09['query']=_[_0xc842('0x2f')](_0x39acc9[_0xc842('0x30')]);_0xa37c09[_0xc842('0x31')]=_[_0xc842('0x32')](_0xa37c09['model'],_0xa37c09[_0xc842('0x30')]);_0x2b07a4['attributes']=_[_0xc842('0x32')](_0xa37c09[_0xc842('0x2e')],qs['fields'](_0x39acc9[_0xc842('0x30')][_0xc842('0x34')]));_0x2b07a4['attributes']=_0x2b07a4[_0xc842('0x33')]['length']?_0x2b07a4['attributes']:_0xa37c09['model'];if(_0x39acc9[_0xc842('0x30')][_0xc842('0x44')]){_0x2b07a4[_0xc842('0x40')]=[{'all':!![]}];}_0x2b07a4=_[_0xc842('0x3c')]({},_0x2b07a4,_0x39acc9['options']);return db['MailTransferReport'][_0xc842('0x45')](_0x2b07a4)[_0xc842('0x24')](handleEntityNotFound(_0x44d40c,null))[_0xc842('0x24')](respondWithResult(_0x44d40c,null))['catch'](handleError(_0x44d40c,null));};exports['create']=function(_0x4ca748,_0xfa2fe3){return db[_0xc842('0x2b')][_0xc842('0x46')](_0x4ca748['body'],{})[_0xc842('0x24')](respondWithResult(_0xfa2fe3,0xc9))[_0xc842('0x42')](handleError(_0xfa2fe3,null));};exports[_0xc842('0x23')]=function(_0x25e26a,_0xa27f29){if(_0x25e26a[_0xc842('0x47')]['id']){delete _0x25e26a[_0xc842('0x47')]['id'];}return db[_0xc842('0x2b')]['find']({'where':{'id':_0x25e26a['params']['id']}})[_0xc842('0x24')](handleEntityNotFound(_0xa27f29,null))['then'](saveUpdates(_0x25e26a['body'],null))[_0xc842('0x24')](respondWithResult(_0xa27f29,null))[_0xc842('0x42')](handleError(_0xa27f29,null));};exports['destroy']=function(_0xe2bca7,_0x3aea66){return db[_0xc842('0x2b')][_0xc842('0x45')]({'where':{'id':_0xe2bca7['params']['id']}})[_0xc842('0x24')](handleEntityNotFound(_0x3aea66,null))['then'](removeEntity(_0x3aea66,null))['catch'](handleError(_0x3aea66,null));};exports[_0xc842('0x48')]=function(_0x149167,_0xe7b873){return db[_0xc842('0x2b')][_0xc842('0x48')]()['then'](respondWithResult(_0xe7b873,null))[_0xc842('0x42')](handleError(_0xe7b873,null));}; \ No newline at end of file +var _0xaee6=['options','count','includeAll','include','findAll','rows','catch','show','keys','merge','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','set','apply','reject','save','then','destroy','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','type','filter'];(function(_0x12a201,_0x30aaba){var _0x52a4d2=function(_0x5ca28d){while(--_0x5ca28d){_0x12a201['push'](_0x12a201['shift']());}};_0x52a4d2(++_0x30aaba);}(_0xaee6,0x187));var _0x6aee=function(_0x37e884,_0x3dca89){_0x37e884=_0x37e884-0x0;var _0x3630cb=_0xaee6[_0x37e884];return _0x3630cb;};'use strict';var emlformat=require(_0x6aee('0x0'));var rimraf=require(_0x6aee('0x1'));var zipdir=require(_0x6aee('0x2'));var jsonpatch=require(_0x6aee('0x3'));var rp=require(_0x6aee('0x4'));var moment=require(_0x6aee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6aee('0x6'));var util=require(_0x6aee('0x7'));var path=require(_0x6aee('0x8'));var sox=require('sox');var csv=require(_0x6aee('0x9'));var ejs=require(_0x6aee('0xa'));var fs=require('fs');var fs_extra=require(_0x6aee('0xb'));var _=require(_0x6aee('0xc'));var squel=require(_0x6aee('0xd'));var crypto=require(_0x6aee('0xe'));var jsforce=require(_0x6aee('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6aee('0x10'));var Papa=require('papaparse');var Redis=require(_0x6aee('0x11'));var authService=require(_0x6aee('0x12'));var qs=require(_0x6aee('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6aee('0x14'));var logger=require(_0x6aee('0x15'))(_0x6aee('0x16'));var utils=require(_0x6aee('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6aee('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b4551,_0x46e458){_0x46e458=_0x46e458||0xcc;return function(_0x25eddf){if(_0x25eddf){return _0x5b4551[_0x6aee('0x19')](_0x46e458);}return _0x5b4551[_0x6aee('0x1a')](_0x46e458)['end']();};}function respondWithResult(_0x2d13f5,_0x238b4d){_0x238b4d=_0x238b4d||0xc8;return function(_0x5a7fc5){if(_0x5a7fc5){return _0x2d13f5['status'](_0x238b4d)[_0x6aee('0x1b')](_0x5a7fc5);}};}function respondWithFilteredResult(_0x10a0c8,_0x658ef){return function(_0x18b259){if(_0x18b259){var _0x16cc61=_0x18b259['count'],_0x257c0b=_0x658ef[_0x6aee('0x1c')],_0x1c0235=_0x658ef[_0x6aee('0x1c')]+_0x658ef['limit'],_0x2d84c0;if(_0x1c0235>=_0x16cc61){_0x1c0235=_0x16cc61;_0x2d84c0=0xc8;}else{_0x2d84c0=0xce;}_0x10a0c8[_0x6aee('0x1a')](_0x2d84c0);return _0x10a0c8[_0x6aee('0x1d')]('Content-Range',_0x257c0b+'-'+_0x1c0235+'/'+_0x16cc61)[_0x6aee('0x1b')](_0x18b259);}return null;};}function patchUpdates(_0x138d83){return function(_0x39a9c1){try{jsonpatch[_0x6aee('0x1e')](_0x39a9c1,_0x138d83,!![]);}catch(_0x340eae){return BPromise[_0x6aee('0x1f')](_0x340eae);}return _0x39a9c1[_0x6aee('0x20')]();};}function saveUpdates(_0x5969b2,_0x25c43f){return function(_0x5e73e2){if(_0x5e73e2){return _0x5e73e2['update'](_0x5969b2)[_0x6aee('0x21')](function(_0x3413df){return _0x3413df;});}return null;};}function removeEntity(_0x409295,_0x4619b1){return function(_0x2f9a08){if(_0x2f9a08){return _0x2f9a08[_0x6aee('0x22')]()[_0x6aee('0x21')](function(){_0x409295[_0x6aee('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc1b66c,_0x511ea6){return function(_0x4e0504){if(!_0x4e0504){_0xc1b66c[_0x6aee('0x19')](0x194);}return _0x4e0504;};}function handleError(_0x30f4cd,_0x5ea8da){_0x5ea8da=_0x5ea8da||0x1f4;return function(_0x3445b1){logger[_0x6aee('0x23')](_0x3445b1['stack']);if(_0x3445b1[_0x6aee('0x24')]){delete _0x3445b1[_0x6aee('0x24')];}_0x30f4cd[_0x6aee('0x1a')](_0x5ea8da)[_0x6aee('0x25')](_0x3445b1);};}exports[_0x6aee('0x26')]=function(_0x321c55,_0x411149){var _0x34f448={},_0x34034a={},_0x1916b7={'count':0x0,'rows':[]};var _0x9418f0=_[_0x6aee('0x27')](db[_0x6aee('0x28')][_0x6aee('0x29')],function(_0x15e0db){return{'name':_0x15e0db[_0x6aee('0x2a')],'type':_0x15e0db['type']['key']};});_0x34034a[_0x6aee('0x2b')]=_[_0x6aee('0x27')](_0x9418f0,_0x6aee('0x24'));_0x34034a[_0x6aee('0x2c')]=_['keys'](_0x321c55[_0x6aee('0x2c')]);_0x34034a['filters']=_[_0x6aee('0x2d')](_0x34034a[_0x6aee('0x2b')],_0x34034a[_0x6aee('0x2c')]);_0x34f448[_0x6aee('0x2e')]=_[_0x6aee('0x2d')](_0x34034a[_0x6aee('0x2b')],qs[_0x6aee('0x2f')](_0x321c55[_0x6aee('0x2c')][_0x6aee('0x2f')]));_0x34f448[_0x6aee('0x2e')]=_0x34f448[_0x6aee('0x2e')][_0x6aee('0x30')]?_0x34f448[_0x6aee('0x2e')]:_0x34034a['model'];if(!_0x321c55[_0x6aee('0x2c')][_0x6aee('0x31')](_0x6aee('0x32'))){_0x34f448[_0x6aee('0x33')]=qs[_0x6aee('0x33')](_0x321c55[_0x6aee('0x2c')][_0x6aee('0x33')]);_0x34f448[_0x6aee('0x1c')]=qs['offset'](_0x321c55[_0x6aee('0x2c')][_0x6aee('0x1c')]);}_0x34f448[_0x6aee('0x34')]=qs[_0x6aee('0x35')](_0x321c55[_0x6aee('0x2c')][_0x6aee('0x35')]);_0x34f448[_0x6aee('0x36')]=qs[_0x6aee('0x37')](_[_0x6aee('0x38')](_0x321c55[_0x6aee('0x2c')],_0x34034a[_0x6aee('0x37')]),_0x9418f0);if(_0x321c55['query']['filter']){_0x34f448[_0x6aee('0x36')]=_['merge'](_0x34f448['where'],{'$or':_[_0x6aee('0x27')](_0x9418f0,function(_0x37b2cd){if(_0x37b2cd[_0x6aee('0x39')]!=='VIRTUAL'){var _0x18c6df={};_0x18c6df[_0x37b2cd[_0x6aee('0x24')]]={'$like':'%'+_0x321c55[_0x6aee('0x2c')][_0x6aee('0x3a')]+'%'};return _0x18c6df;}})});}_0x34f448=_['merge']({},_0x34f448,_0x321c55[_0x6aee('0x3b')]);var _0x3b8fda={'where':_0x34f448[_0x6aee('0x36')]};return db[_0x6aee('0x28')][_0x6aee('0x3c')](_0x3b8fda)['then'](function(_0xb1e9d0){_0x1916b7[_0x6aee('0x3c')]=_0xb1e9d0;if(_0x321c55[_0x6aee('0x2c')][_0x6aee('0x3d')]){_0x34f448[_0x6aee('0x3e')]=[{'all':!![]}];}return db['MailTransferReport'][_0x6aee('0x3f')](_0x34f448);})['then'](function(_0x3eebe4){_0x1916b7[_0x6aee('0x40')]=_0x3eebe4;return _0x1916b7;})[_0x6aee('0x21')](respondWithFilteredResult(_0x411149,_0x34f448))[_0x6aee('0x41')](handleError(_0x411149,null));};exports[_0x6aee('0x42')]=function(_0x1b1898,_0x5ba53b){var _0x58b3a2={'raw':!![],'where':{'id':_0x1b1898['params']['id']}},_0x4642f7={};_0x4642f7[_0x6aee('0x2b')]=_[_0x6aee('0x43')](db[_0x6aee('0x28')][_0x6aee('0x29')]);_0x4642f7['query']=_[_0x6aee('0x43')](_0x1b1898['query']);_0x4642f7[_0x6aee('0x37')]=_['intersection'](_0x4642f7[_0x6aee('0x2b')],_0x4642f7[_0x6aee('0x2c')]);_0x58b3a2[_0x6aee('0x2e')]=_[_0x6aee('0x2d')](_0x4642f7[_0x6aee('0x2b')],qs[_0x6aee('0x2f')](_0x1b1898[_0x6aee('0x2c')][_0x6aee('0x2f')]));_0x58b3a2['attributes']=_0x58b3a2[_0x6aee('0x2e')][_0x6aee('0x30')]?_0x58b3a2['attributes']:_0x4642f7['model'];if(_0x1b1898[_0x6aee('0x2c')][_0x6aee('0x3d')]){_0x58b3a2['include']=[{'all':!![]}];}_0x58b3a2=_[_0x6aee('0x44')]({},_0x58b3a2,_0x1b1898['options']);return db[_0x6aee('0x28')][_0x6aee('0x45')](_0x58b3a2)[_0x6aee('0x21')](handleEntityNotFound(_0x5ba53b,null))[_0x6aee('0x21')](respondWithResult(_0x5ba53b,null))['catch'](handleError(_0x5ba53b,null));};exports['create']=function(_0x11f9e6,_0x320581){return db[_0x6aee('0x28')][_0x6aee('0x46')](_0x11f9e6['body'],{})[_0x6aee('0x21')](respondWithResult(_0x320581,0xc9))['catch'](handleError(_0x320581,null));};exports[_0x6aee('0x47')]=function(_0x3b0392,_0x454f72){if(_0x3b0392[_0x6aee('0x48')]['id']){delete _0x3b0392['body']['id'];}return db[_0x6aee('0x28')][_0x6aee('0x45')]({'where':{'id':_0x3b0392[_0x6aee('0x49')]['id']}})[_0x6aee('0x21')](handleEntityNotFound(_0x454f72,null))[_0x6aee('0x21')](saveUpdates(_0x3b0392[_0x6aee('0x48')],null))[_0x6aee('0x21')](respondWithResult(_0x454f72,null))[_0x6aee('0x41')](handleError(_0x454f72,null));};exports['destroy']=function(_0x23e252,_0x3a3dcf){return db['MailTransferReport'][_0x6aee('0x45')]({'where':{'id':_0x23e252[_0x6aee('0x49')]['id']}})[_0x6aee('0x21')](handleEntityNotFound(_0x3a3dcf,null))[_0x6aee('0x21')](removeEntity(_0x3a3dcf,null))['catch'](handleError(_0x3a3dcf,null));};exports['describe']=function(_0x8bc744,_0x3da6ea){return db[_0x6aee('0x28')][_0x6aee('0x4a')]()['then'](respondWithResult(_0x3da6ea,null))[_0x6aee('0x41')](handleError(_0x3da6ea,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 958e54b..b433d11 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 _0xe06c=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','uniqueid'];(function(_0x2f2a6f,_0xe63e10){var _0x14441d=function(_0x3ab031){while(--_0x3ab031){_0x2f2a6f['push'](_0x2f2a6f['shift']());}};_0x14441d(++_0xe63e10);}(_0xe06c,0x1a7));var _0xce06=function(_0x24c621,_0x32480c){_0x24c621=_0x24c621-0x0;var _0x4046ff=_0xe06c[_0x24c621];return _0x4046ff;};'use strict';var _=require('lodash');var util=require(_0xce06('0x0'));var logger=require('../../config/logger')(_0xce06('0x1'));var moment=require(_0xce06('0x2'));var BPromise=require(_0xce06('0x3'));var rp=require(_0xce06('0x4'));var fs=require('fs');var path=require(_0xce06('0x5'));var rimraf=require(_0xce06('0x6'));var config=require(_0xce06('0x7'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x48781e,_0x557ef3){return _0x48781e['define']('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xce06('0x8'),'fields':[_0xce06('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1dc4=['util','moment','bluebird','request-promise','path','rimraf','exports','define','MailTransferReport','uniqueid'];(function(_0x3a9787,_0x137dfb){var _0x5adb56=function(_0x312c02){while(--_0x312c02){_0x3a9787['push'](_0x3a9787['shift']());}};_0x5adb56(++_0x137dfb);}(_0x1dc4,0x8c));var _0x41dc=function(_0x445b96,_0x7799a5){_0x445b96=_0x445b96-0x0;var _0x2d6609=_0x1dc4[_0x445b96];return _0x2d6609;};'use strict';var _=require('lodash');var util=require(_0x41dc('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x41dc('0x1'));var BPromise=require(_0x41dc('0x2'));var rp=require(_0x41dc('0x3'));var fs=require('fs');var path=require(_0x41dc('0x4'));var rimraf=require(_0x41dc('0x5'));var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module[_0x41dc('0x6')]=function(_0x4a4afa,_0xabbc93){return _0x4a4afa[_0x41dc('0x7')](_0x41dc('0x8'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x41dc('0x9'),'fields':[_0x41dc('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 47502c6..4e40f76 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 _0x07f3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x2f10e4,_0x2424ee){var _0x16ae69=function(_0xe8b3d3){while(--_0xe8b3d3){_0x2f10e4['push'](_0x2f10e4['shift']());}};_0x16ae69(++_0x2424ee);}(_0x07f3,0xbd));var _0x307f=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x07f3[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x307f('0x0'));var util=require(_0x307f('0x1'));var moment=require(_0x307f('0x2'));var BPromise=require(_0x307f('0x3'));var rs=require(_0x307f('0x4'));var fs=require('fs');var Redis=require(_0x307f('0x5'));var db=require(_0x307f('0x6'))['db'];var utils=require(_0x307f('0x7'));var logger=require('../../config/logger')(_0x307f('0x8'));var config=require(_0x307f('0x9'));var jayson=require(_0x307f('0xa'));var client=jayson[_0x307f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b08ad,_0x44766a,_0x48c80a){return new BPromise(function(_0x5becdd,_0x2e07b0){return client[_0x307f('0xc')](_0x3b08ad,_0x48c80a)[_0x307f('0xd')](function(_0x4514aa){logger[_0x307f('0xe')](_0x307f('0xf'),_0x44766a,_0x307f('0x10'));logger[_0x307f('0x11')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x44766a,_0x307f('0x10'),JSON[_0x307f('0x12')](_0x4514aa));if(_0x4514aa[_0x307f('0x13')]){if(_0x4514aa[_0x307f('0x13')][_0x307f('0x14')]===0x1f4){logger[_0x307f('0x13')](_0x307f('0xf'),_0x44766a,_0x4514aa[_0x307f('0x13')]['message']);return _0x2e07b0(_0x4514aa[_0x307f('0x13')][_0x307f('0x15')]);}logger['error'](_0x307f('0xf'),_0x44766a,_0x4514aa[_0x307f('0x13')][_0x307f('0x15')]);return _0x5becdd(_0x4514aa[_0x307f('0x13')][_0x307f('0x15')]);}else{logger[_0x307f('0xe')](_0x307f('0xf'),_0x44766a,_0x307f('0x10'));_0x5becdd(_0x4514aa[_0x307f('0x16')][_0x307f('0x15')]);}})[_0x307f('0x17')](function(_0x1470a3){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x44766a,_0x1470a3);_0x2e07b0(_0x1470a3);});});} \ No newline at end of file +var _0x8735=['moment','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8735,0x1b6));var _0x5873=function(_0x2f5891,_0x2bf525){_0x2f5891=_0x2f5891-0x0;var _0x3b1459=_0x8735[_0x2f5891];return _0x3b1459;};'use strict';var _=require(_0x5873('0x0'));var util=require(_0x5873('0x1'));var moment=require(_0x5873('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5873('0x3'))(_0x5873('0x4'));var config=require(_0x5873('0x5'));var jayson=require(_0x5873('0x6'));var client=jayson[_0x5873('0x7')][_0x5873('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9c97c,_0x2d9a12,_0x2e0961){return new BPromise(function(_0x5b5695,_0x424a58){return client[_0x5873('0x9')](_0x9c97c,_0x2e0961)['then'](function(_0x3a9649){logger[_0x5873('0xa')](_0x5873('0xb'),_0x2d9a12,'request\x20sent');logger[_0x5873('0xc')](_0x5873('0xd'),_0x2d9a12,'request\x20sent',JSON[_0x5873('0xe')](_0x3a9649));if(_0x3a9649[_0x5873('0xf')]){if(_0x3a9649[_0x5873('0xf')][_0x5873('0x10')]===0x1f4){logger[_0x5873('0xf')](_0x5873('0xb'),_0x2d9a12,_0x3a9649['error'][_0x5873('0x11')]);return _0x424a58(_0x3a9649[_0x5873('0xf')][_0x5873('0x11')]);}logger[_0x5873('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x2d9a12,_0x3a9649[_0x5873('0xf')]['message']);return _0x5b5695(_0x3a9649['error'][_0x5873('0x11')]);}else{logger[_0x5873('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x2d9a12,_0x5873('0x12'));_0x5b5695(_0x3a9649['result'][_0x5873('0x11')]);}})[_0x5873('0x13')](function(_0x957436){logger[_0x5873('0xf')](_0x5873('0xb'),_0x2d9a12,_0x957436);_0x424a58(_0x957436);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 837f322..38b01c5 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 _0x1f2b=['util','path','Router','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete','destroy','exports','multer'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x1f2b,0x76));var _0xb1f2=function(_0xa3be34,_0x2e4d1c){_0xa3be34=_0xa3be34-0x0;var _0x1a3b05=_0x1f2b[_0xa3be34];return _0x1a3b05;};'use strict';var multer=require(_0xb1f2('0x0'));var util=require(_0xb1f2('0x1'));var path=require(_0xb1f2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1f2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb1f2('0x4'));var config=require('../../config/environment');var controller=require(_0xb1f2('0x5'));router[_0xb1f2('0x6')]('/',auth[_0xb1f2('0x7')](),controller[_0xb1f2('0x8')]);router[_0xb1f2('0x6')]('/describe',auth[_0xb1f2('0x7')](),controller[_0xb1f2('0x9')]);router['get'](_0xb1f2('0xa'),auth['isAuthenticated'](),controller[_0xb1f2('0xb')]);router[_0xb1f2('0xc')]('/',auth[_0xb1f2('0x7')](),controller['create']);router[_0xb1f2('0xd')](_0xb1f2('0xa'),auth[_0xb1f2('0x7')](),controller['update']);router[_0xb1f2('0xe')]('/:id',auth[_0xb1f2('0x7')](),controller[_0xb1f2('0xf')]);module[_0xb1f2('0x10')]=router; \ No newline at end of file +var _0xcceb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x38a3c1,_0x3c4b20){var _0x58721e=function(_0x5cd5ac){while(--_0x5cd5ac){_0x38a3c1['push'](_0x38a3c1['shift']());}};_0x58721e(++_0x3c4b20);}(_0xcceb,0x144));var _0xbcce=function(_0x3f146c,_0x42e0dc){_0x3f146c=_0x3f146c-0x0;var _0x407f72=_0xcceb[_0x3f146c];return _0x407f72;};'use strict';var multer=require(_0xbcce('0x0'));var util=require(_0xbcce('0x1'));var path=require(_0xbcce('0x2'));var timeout=require(_0xbcce('0x3'));var express=require(_0xbcce('0x4'));var router=express[_0xbcce('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbcce('0x6'));var interaction=require(_0xbcce('0x7'));var config=require(_0xbcce('0x8'));var controller=require(_0xbcce('0x9'));router[_0xbcce('0xa')]('/',auth[_0xbcce('0xb')](),controller[_0xbcce('0xc')]);router[_0xbcce('0xa')](_0xbcce('0xd'),auth[_0xbcce('0xb')](),controller[_0xbcce('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbcce('0xf')]);router[_0xbcce('0x10')]('/',auth[_0xbcce('0xb')](),controller[_0xbcce('0x11')]);router[_0xbcce('0x12')](_0xbcce('0x13'),auth[_0xbcce('0xb')](),controller['update']);router['delete'](_0xbcce('0x13'),auth['isAuthenticated'](),controller[_0xbcce('0x14')]);module[_0xbcce('0x15')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index f56075c..cb2cae2 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 _0xa652=['STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports'];(function(_0x1a268f,_0x2f4759){var _0x63fe77=function(_0x525a3e){while(--_0x525a3e){_0x1a268f['push'](_0x1a268f['shift']());}};_0x63fe77(++_0x2f4759);}(_0xa652,0x1d9));var _0x2a65=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa652[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x2a65('0x0'));var moment=require(_0x2a65('0x1'));module[_0x2a65('0x2')]={'channel':{'type':Sequelize[_0x2a65('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x2a65('0x3')]},'type':{'type':Sequelize[_0x2a65('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x2a65('0x4')},'duration':{'type':Sequelize[_0x2a65('0x5')]},'enterAt':{'type':Sequelize[_0x2a65('0x6')]},'exitAt':{'type':Sequelize[_0x2a65('0x6')],'set':function(_0xcc616f){var _0x18eaa0=moment(_0xcc616f);var _0x5d9ffa=moment(this[_0x2a65('0x7')](_0x2a65('0x8')));var _0x33a239=_0x18eaa0[_0x2a65('0x9')](_0x5d9ffa,'seconds');this[_0x2a65('0xa')](_0x2a65('0xb'),_0xcc616f);this[_0x2a65('0xa')](_0x2a65('0xc'),_0x33a239||null);}},'data1':{'type':Sequelize[_0x2a65('0x3')],'comment':_0x2a65('0xd')},'data2':{'type':Sequelize[_0x2a65('0x3')],'comment':_0x2a65('0xe')},'data3':{'type':Sequelize[_0x2a65('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x2a65('0x3')],'comment':_0x2a65('0xf')},'data5':{'type':Sequelize[_0x2a65('0x3')],'comment':_0x2a65('0x10')},'role':{'type':Sequelize[_0x2a65('0x3')]},'internal':{'type':Sequelize[_0x2a65('0x5')]},'uniqueid':{'type':Sequelize[_0x2a65('0x3')]}}; \ No newline at end of file +var _0x8fe8=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','diff','setDataValue','exitAt','duration','talk:[start]'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8fe8,0xab));var _0x88fe=function(_0xe566b,_0x535a79){_0xe566b=_0xe566b-0x0;var _0x12772e=_0x8fe8[_0xe566b];return _0x12772e;};'use strict';var Sequelize=require(_0x88fe('0x0'));var moment=require(_0x88fe('0x1'));module['exports']={'channel':{'type':Sequelize[_0x88fe('0x2')]},'membername':{'type':Sequelize[_0x88fe('0x2')]},'interface':{'type':Sequelize[_0x88fe('0x2')]},'type':{'type':Sequelize[_0x88fe('0x2')],'defaultValue':_0x88fe('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x88fe('0x4')],'set':function(_0x63d6a9){var _0x535957=moment(_0x63d6a9);var _0x1fe6c2=moment(this[_0x88fe('0x5')]('enterAt'));var _0x3cbe32=_0x535957[_0x88fe('0x6')](_0x1fe6c2,'seconds');this[_0x88fe('0x7')](_0x88fe('0x8'),_0x63d6a9);this['setDataValue'](_0x88fe('0x9'),_0x3cbe32||null);}},'data1':{'type':Sequelize[_0x88fe('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x88fe('0x2')],'comment':_0x88fe('0xa')},'data3':{'type':Sequelize[_0x88fe('0x2')],'comment':_0x88fe('0xb')},'data4':{'type':Sequelize[_0x88fe('0x2')],'comment':_0x88fe('0xc')},'data5':{'type':Sequelize['STRING'],'comment':_0x88fe('0xd')},'role':{'type':Sequelize[_0x88fe('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x88fe('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index f7672bc..3bfcb6e 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 _0x92f2=['mustache','path','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','map','MemberReport','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','rawAttributes','intersection','include','options','find','create','body','params','describe','eml-format','rimraf','request-promise','moment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x92f2,0x1b2));var _0x292f=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x92f2[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x292f('0x0'));var rimraf=require(_0x292f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x292f('0x2'));var moment=require(_0x292f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x292f('0x4'));var util=require('util');var path=require(_0x292f('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x292f('0x6'));var fs=require('fs');var fs_extra=require(_0x292f('0x7'));var _=require(_0x292f('0x8'));var squel=require(_0x292f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x292f('0xa'));var querystring=require(_0x292f('0xb'));var Papa=require(_0x292f('0xc'));var Redis=require(_0x292f('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x292f('0xe'));var as=require(_0x292f('0xf'));var hardwareService=require(_0x292f('0x10'));var logger=require(_0x292f('0x11'))('api');var utils=require(_0x292f('0x12'));var config=require(_0x292f('0x13'));var licenseUtil=require(_0x292f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e833b,_0x55590d){_0x55590d=_0x55590d||0xcc;return function(_0x23345a){if(_0x23345a){return _0x2e833b[_0x292f('0x15')](_0x55590d);}return _0x2e833b[_0x292f('0x16')](_0x55590d)['end']();};}function respondWithResult(_0x3a12eb,_0x171879){_0x171879=_0x171879||0xc8;return function(_0x500614){if(_0x500614){return _0x3a12eb[_0x292f('0x16')](_0x171879)[_0x292f('0x17')](_0x500614);}};}function respondWithFilteredResult(_0x12db79,_0x396ced){return function(_0x42bfe7){if(_0x42bfe7){var _0x18e7fe=_0x42bfe7[_0x292f('0x18')],_0x254a50=_0x396ced[_0x292f('0x19')],_0x3e0fae=_0x396ced['offset']+_0x396ced[_0x292f('0x1a')],_0x4d7040;if(_0x3e0fae>=_0x18e7fe){_0x3e0fae=_0x18e7fe;_0x4d7040=0xc8;}else{_0x4d7040=0xce;}_0x12db79['status'](_0x4d7040);return _0x12db79[_0x292f('0x1b')](_0x292f('0x1c'),_0x254a50+'-'+_0x3e0fae+'/'+_0x18e7fe)[_0x292f('0x17')](_0x42bfe7);}return null;};}function patchUpdates(_0x927067){return function(_0x221be7){try{jsonpatch['apply'](_0x221be7,_0x927067,!![]);}catch(_0x3f24b1){return BPromise[_0x292f('0x1d')](_0x3f24b1);}return _0x221be7[_0x292f('0x1e')]();};}function saveUpdates(_0xcdd95d,_0x4442b){return function(_0x48d4c1){if(_0x48d4c1){return _0x48d4c1[_0x292f('0x1f')](_0xcdd95d)[_0x292f('0x20')](function(_0x568217){return _0x568217;});}return null;};}function removeEntity(_0x14f22b,_0x1c8abe){return function(_0x1b114a){if(_0x1b114a){return _0x1b114a[_0x292f('0x21')]()[_0x292f('0x20')](function(){_0x14f22b['status'](0xcc)[_0x292f('0x22')]();});}};}function handleEntityNotFound(_0x48b6c2,_0x586876){return function(_0x11555b){if(!_0x11555b){_0x48b6c2[_0x292f('0x15')](0x194);}return _0x11555b;};}function handleError(_0xff66d7,_0x493f76){_0x493f76=_0x493f76||0x1f4;return function(_0x228292){logger[_0x292f('0x23')](_0x228292[_0x292f('0x24')]);if(_0x228292['name']){delete _0x228292[_0x292f('0x25')];}_0xff66d7[_0x292f('0x16')](_0x493f76)[_0x292f('0x26')](_0x228292);};}exports['index']=function(_0xa30fee,_0x35d297){var _0xc6f2bc={},_0x22284e={},_0x3b51dc={'count':0x0,'rows':[]};var _0x25020a=_[_0x292f('0x27')](db[_0x292f('0x28')]['rawAttributes'],function(_0x33d1a9){return{'name':_0x33d1a9[_0x292f('0x29')],'type':_0x33d1a9[_0x292f('0x2a')][_0x292f('0x2b')]};});_0x22284e[_0x292f('0x2c')]=_[_0x292f('0x27')](_0x25020a,'name');_0x22284e[_0x292f('0x2d')]=_[_0x292f('0x2e')](_0xa30fee[_0x292f('0x2d')]);_0x22284e[_0x292f('0x2f')]=_['intersection'](_0x22284e[_0x292f('0x2c')],_0x22284e[_0x292f('0x2d')]);_0xc6f2bc['attributes']=_['intersection'](_0x22284e[_0x292f('0x2c')],qs[_0x292f('0x30')](_0xa30fee[_0x292f('0x2d')][_0x292f('0x30')]));_0xc6f2bc[_0x292f('0x31')]=_0xc6f2bc[_0x292f('0x31')][_0x292f('0x32')]?_0xc6f2bc[_0x292f('0x31')]:_0x22284e[_0x292f('0x2c')];if(!_0xa30fee[_0x292f('0x2d')][_0x292f('0x33')](_0x292f('0x34'))){_0xc6f2bc['limit']=qs[_0x292f('0x1a')](_0xa30fee[_0x292f('0x2d')][_0x292f('0x1a')]);_0xc6f2bc[_0x292f('0x19')]=qs[_0x292f('0x19')](_0xa30fee[_0x292f('0x2d')][_0x292f('0x19')]);}_0xc6f2bc[_0x292f('0x35')]=qs[_0x292f('0x36')](_0xa30fee[_0x292f('0x2d')][_0x292f('0x36')]);_0xc6f2bc[_0x292f('0x37')]=qs['filters'](_[_0x292f('0x38')](_0xa30fee[_0x292f('0x2d')],_0x22284e[_0x292f('0x2f')]),_0x25020a);if(_0xa30fee[_0x292f('0x2d')][_0x292f('0x39')]){_0xc6f2bc[_0x292f('0x37')]=_[_0x292f('0x3a')](_0xc6f2bc[_0x292f('0x37')],{'$or':_['map'](_0x25020a,function(_0x3dae73){if(_0x3dae73['type']!==_0x292f('0x3b')){var _0x3c9aca={};_0x3c9aca[_0x3dae73[_0x292f('0x25')]]={'$like':'%'+_0xa30fee[_0x292f('0x2d')][_0x292f('0x39')]+'%'};return _0x3c9aca;}})});}_0xc6f2bc=_[_0x292f('0x3a')]({},_0xc6f2bc,_0xa30fee['options']);var _0x530c9d={'where':_0xc6f2bc[_0x292f('0x37')]};return db['MemberReport'][_0x292f('0x18')](_0x530c9d)[_0x292f('0x20')](function(_0x231ee0){_0x3b51dc['count']=_0x231ee0;if(_0xa30fee[_0x292f('0x2d')]['includeAll']){_0xc6f2bc['include']=[{'all':!![]}];}return db[_0x292f('0x28')][_0x292f('0x3c')](_0xc6f2bc);})[_0x292f('0x20')](function(_0x4efc8c){_0x3b51dc[_0x292f('0x3d')]=_0x4efc8c;return _0x3b51dc;})[_0x292f('0x20')](respondWithFilteredResult(_0x35d297,_0xc6f2bc))[_0x292f('0x3e')](handleError(_0x35d297,null));};exports[_0x292f('0x3f')]=function(_0x3c4cfc,_0x1c03fe){var _0x1f1aaf={'raw':!![],'where':{'id':_0x3c4cfc['params']['id']}},_0x26166f={};_0x26166f[_0x292f('0x2c')]=_['keys'](db[_0x292f('0x28')][_0x292f('0x40')]);_0x26166f[_0x292f('0x2d')]=_[_0x292f('0x2e')](_0x3c4cfc[_0x292f('0x2d')]);_0x26166f[_0x292f('0x2f')]=_[_0x292f('0x41')](_0x26166f['model'],_0x26166f[_0x292f('0x2d')]);_0x1f1aaf[_0x292f('0x31')]=_[_0x292f('0x41')](_0x26166f[_0x292f('0x2c')],qs[_0x292f('0x30')](_0x3c4cfc[_0x292f('0x2d')][_0x292f('0x30')]));_0x1f1aaf[_0x292f('0x31')]=_0x1f1aaf['attributes'][_0x292f('0x32')]?_0x1f1aaf[_0x292f('0x31')]:_0x26166f['model'];if(_0x3c4cfc['query']['includeAll']){_0x1f1aaf[_0x292f('0x42')]=[{'all':!![]}];}_0x1f1aaf=_[_0x292f('0x3a')]({},_0x1f1aaf,_0x3c4cfc[_0x292f('0x43')]);return db[_0x292f('0x28')][_0x292f('0x44')](_0x1f1aaf)[_0x292f('0x20')](handleEntityNotFound(_0x1c03fe,null))['then'](respondWithResult(_0x1c03fe,null))[_0x292f('0x3e')](handleError(_0x1c03fe,null));};exports[_0x292f('0x45')]=function(_0xb907cf,_0x4c49dd){return db[_0x292f('0x28')]['create'](_0xb907cf[_0x292f('0x46')],{})[_0x292f('0x20')](respondWithResult(_0x4c49dd,0xc9))['catch'](handleError(_0x4c49dd,null));};exports[_0x292f('0x1f')]=function(_0x5b23b3,_0x4c08c2){if(_0x5b23b3['body']['id']){delete _0x5b23b3[_0x292f('0x46')]['id'];}return db[_0x292f('0x28')][_0x292f('0x44')]({'where':{'id':_0x5b23b3[_0x292f('0x47')]['id']}})['then'](handleEntityNotFound(_0x4c08c2,null))['then'](saveUpdates(_0x5b23b3[_0x292f('0x46')],null))[_0x292f('0x20')](respondWithResult(_0x4c08c2,null))[_0x292f('0x3e')](handleError(_0x4c08c2,null));};exports[_0x292f('0x21')]=function(_0x3194aa,_0x434332){return db[_0x292f('0x28')]['find']({'where':{'id':_0x3194aa['params']['id']}})[_0x292f('0x20')](handleEntityNotFound(_0x434332,null))[_0x292f('0x20')](removeEntity(_0x434332,null))['catch'](handleError(_0x434332,null));};exports['describe']=function(_0x65a0e4,_0x363081){return db[_0x292f('0x28')][_0x292f('0x48')]()['then'](respondWithResult(_0x363081,null))[_0x292f('0x3e')](handleError(_0x363081,null));}; \ No newline at end of file +var _0xf3c1=['../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','MemberReport','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','keys','fields','options','create','body','update','find','params','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf3c1,0x120));var _0x1f3c=function(_0x2beb70,_0x264e7a){_0x2beb70=_0x2beb70-0x0;var _0x4975b9=_0xf3c1[_0x2beb70];return _0x4975b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f3c('0x0'));var zipdir=require(_0x1f3c('0x1'));var jsonpatch=require(_0x1f3c('0x2'));var rp=require('request-promise');var moment=require(_0x1f3c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1f3c('0x4'));var util=require(_0x1f3c('0x5'));var path=require(_0x1f3c('0x6'));var sox=require(_0x1f3c('0x7'));var csv=require(_0x1f3c('0x8'));var ejs=require(_0x1f3c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f3c('0xa'));var squel=require('squel');var crypto=require(_0x1f3c('0xb'));var jsforce=require(_0x1f3c('0xc'));var deskjs=require(_0x1f3c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1f3c('0xe'));var Papa=require(_0x1f3c('0xf'));var Redis=require(_0x1f3c('0x10'));var authService=require(_0x1f3c('0x11'));var qs=require(_0x1f3c('0x12'));var as=require(_0x1f3c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f3c('0x14'))(_0x1f3c('0x15'));var utils=require(_0x1f3c('0x16'));var config=require(_0x1f3c('0x17'));var licenseUtil=require(_0x1f3c('0x18'));var db=require(_0x1f3c('0x19'))['db'];function respondWithStatusCode(_0x4923b2,_0x29c457){_0x29c457=_0x29c457||0xcc;return function(_0x34a3f8){if(_0x34a3f8){return _0x4923b2['sendStatus'](_0x29c457);}return _0x4923b2[_0x1f3c('0x1a')](_0x29c457)[_0x1f3c('0x1b')]();};}function respondWithResult(_0x41e9f6,_0x40849b){_0x40849b=_0x40849b||0xc8;return function(_0x2cfbfd){if(_0x2cfbfd){return _0x41e9f6['status'](_0x40849b)[_0x1f3c('0x1c')](_0x2cfbfd);}};}function respondWithFilteredResult(_0x3c6a7f,_0x304d19){return function(_0x163c08){if(_0x163c08){var _0x37929a=_0x163c08[_0x1f3c('0x1d')],_0x9bc13=_0x304d19[_0x1f3c('0x1e')],_0x478a98=_0x304d19['offset']+_0x304d19[_0x1f3c('0x1f')],_0x5c963d;if(_0x478a98>=_0x37929a){_0x478a98=_0x37929a;_0x5c963d=0xc8;}else{_0x5c963d=0xce;}_0x3c6a7f[_0x1f3c('0x1a')](_0x5c963d);return _0x3c6a7f[_0x1f3c('0x20')]('Content-Range',_0x9bc13+'-'+_0x478a98+'/'+_0x37929a)['json'](_0x163c08);}return null;};}function patchUpdates(_0x4416c5){return function(_0x4c13b4){try{jsonpatch[_0x1f3c('0x21')](_0x4c13b4,_0x4416c5,!![]);}catch(_0x245a84){return BPromise[_0x1f3c('0x22')](_0x245a84);}return _0x4c13b4[_0x1f3c('0x23')]();};}function saveUpdates(_0x485e44,_0x1efc69){return function(_0x395d78){if(_0x395d78){return _0x395d78['update'](_0x485e44)[_0x1f3c('0x24')](function(_0x563418){return _0x563418;});}return null;};}function removeEntity(_0x1b7fbe,_0x26ada6){return function(_0x4f73d3){if(_0x4f73d3){return _0x4f73d3[_0x1f3c('0x25')]()[_0x1f3c('0x24')](function(){_0x1b7fbe[_0x1f3c('0x1a')](0xcc)[_0x1f3c('0x1b')]();});}};}function handleEntityNotFound(_0xae6424,_0x543ee7){return function(_0x1c7b34){if(!_0x1c7b34){_0xae6424[_0x1f3c('0x26')](0x194);}return _0x1c7b34;};}function handleError(_0x2ba72d,_0x108c5f){_0x108c5f=_0x108c5f||0x1f4;return function(_0x17696c){logger[_0x1f3c('0x27')](_0x17696c[_0x1f3c('0x28')]);if(_0x17696c[_0x1f3c('0x29')]){delete _0x17696c[_0x1f3c('0x29')];}_0x2ba72d[_0x1f3c('0x1a')](_0x108c5f)['send'](_0x17696c);};}exports[_0x1f3c('0x2a')]=function(_0x98801b,_0x1a83cc){var _0x146be8={},_0x2b802e={},_0x8e4401={'count':0x0,'rows':[]};var _0x4f3cc8=_[_0x1f3c('0x2b')](db[_0x1f3c('0x2c')][_0x1f3c('0x2d')],function(_0x3a0807){return{'name':_0x3a0807[_0x1f3c('0x2e')],'type':_0x3a0807['type'][_0x1f3c('0x2f')]};});_0x2b802e[_0x1f3c('0x30')]=_['map'](_0x4f3cc8,_0x1f3c('0x29'));_0x2b802e[_0x1f3c('0x31')]=_['keys'](_0x98801b['query']);_0x2b802e[_0x1f3c('0x32')]=_['intersection'](_0x2b802e[_0x1f3c('0x30')],_0x2b802e[_0x1f3c('0x31')]);_0x146be8[_0x1f3c('0x33')]=_[_0x1f3c('0x34')](_0x2b802e[_0x1f3c('0x30')],qs['fields'](_0x98801b['query']['fields']));_0x146be8[_0x1f3c('0x33')]=_0x146be8[_0x1f3c('0x33')][_0x1f3c('0x35')]?_0x146be8[_0x1f3c('0x33')]:_0x2b802e[_0x1f3c('0x30')];if(!_0x98801b[_0x1f3c('0x31')][_0x1f3c('0x36')](_0x1f3c('0x37'))){_0x146be8[_0x1f3c('0x1f')]=qs[_0x1f3c('0x1f')](_0x98801b[_0x1f3c('0x31')][_0x1f3c('0x1f')]);_0x146be8[_0x1f3c('0x1e')]=qs['offset'](_0x98801b['query']['offset']);}_0x146be8[_0x1f3c('0x38')]=qs[_0x1f3c('0x39')](_0x98801b[_0x1f3c('0x31')]['sort']);_0x146be8['where']=qs[_0x1f3c('0x32')](_[_0x1f3c('0x3a')](_0x98801b[_0x1f3c('0x31')],_0x2b802e[_0x1f3c('0x32')]),_0x4f3cc8);if(_0x98801b[_0x1f3c('0x31')][_0x1f3c('0x3b')]){_0x146be8[_0x1f3c('0x3c')]=_[_0x1f3c('0x3d')](_0x146be8['where'],{'$or':_[_0x1f3c('0x2b')](_0x4f3cc8,function(_0xdeba71){if(_0xdeba71[_0x1f3c('0x3e')]!==_0x1f3c('0x3f')){var _0xd57df4={};_0xd57df4[_0xdeba71['name']]={'$like':'%'+_0x98801b[_0x1f3c('0x31')]['filter']+'%'};return _0xd57df4;}})});}_0x146be8=_[_0x1f3c('0x3d')]({},_0x146be8,_0x98801b['options']);var _0x4671c8={'where':_0x146be8['where']};return db[_0x1f3c('0x2c')][_0x1f3c('0x1d')](_0x4671c8)[_0x1f3c('0x24')](function(_0x2ced77){_0x8e4401[_0x1f3c('0x1d')]=_0x2ced77;if(_0x98801b[_0x1f3c('0x31')][_0x1f3c('0x40')]){_0x146be8[_0x1f3c('0x41')]=[{'all':!![]}];}return db[_0x1f3c('0x2c')][_0x1f3c('0x42')](_0x146be8);})[_0x1f3c('0x24')](function(_0x48fcad){_0x8e4401['rows']=_0x48fcad;return _0x8e4401;})['then'](respondWithFilteredResult(_0x1a83cc,_0x146be8))[_0x1f3c('0x43')](handleError(_0x1a83cc,null));};exports[_0x1f3c('0x44')]=function(_0x17b60c,_0x5a11a1){var _0x2d77c4={'raw':!![],'where':{'id':_0x17b60c['params']['id']}},_0x1dcc63={};_0x1dcc63[_0x1f3c('0x30')]=_[_0x1f3c('0x45')](db[_0x1f3c('0x2c')][_0x1f3c('0x2d')]);_0x1dcc63[_0x1f3c('0x31')]=_[_0x1f3c('0x45')](_0x17b60c[_0x1f3c('0x31')]);_0x1dcc63[_0x1f3c('0x32')]=_[_0x1f3c('0x34')](_0x1dcc63[_0x1f3c('0x30')],_0x1dcc63[_0x1f3c('0x31')]);_0x2d77c4['attributes']=_[_0x1f3c('0x34')](_0x1dcc63[_0x1f3c('0x30')],qs[_0x1f3c('0x46')](_0x17b60c[_0x1f3c('0x31')][_0x1f3c('0x46')]));_0x2d77c4[_0x1f3c('0x33')]=_0x2d77c4['attributes'][_0x1f3c('0x35')]?_0x2d77c4['attributes']:_0x1dcc63[_0x1f3c('0x30')];if(_0x17b60c[_0x1f3c('0x31')][_0x1f3c('0x40')]){_0x2d77c4[_0x1f3c('0x41')]=[{'all':!![]}];}_0x2d77c4=_['merge']({},_0x2d77c4,_0x17b60c[_0x1f3c('0x47')]);return db[_0x1f3c('0x2c')]['find'](_0x2d77c4)[_0x1f3c('0x24')](handleEntityNotFound(_0x5a11a1,null))[_0x1f3c('0x24')](respondWithResult(_0x5a11a1,null))['catch'](handleError(_0x5a11a1,null));};exports[_0x1f3c('0x48')]=function(_0x2be8d0,_0x2c4ecf){return db[_0x1f3c('0x2c')][_0x1f3c('0x48')](_0x2be8d0[_0x1f3c('0x49')],{})[_0x1f3c('0x24')](respondWithResult(_0x2c4ecf,0xc9))[_0x1f3c('0x43')](handleError(_0x2c4ecf,null));};exports[_0x1f3c('0x4a')]=function(_0x29aedb,_0x4aa24a){if(_0x29aedb[_0x1f3c('0x49')]['id']){delete _0x29aedb['body']['id'];}return db['MemberReport'][_0x1f3c('0x4b')]({'where':{'id':_0x29aedb[_0x1f3c('0x4c')]['id']}})[_0x1f3c('0x24')](handleEntityNotFound(_0x4aa24a,null))[_0x1f3c('0x24')](saveUpdates(_0x29aedb[_0x1f3c('0x49')],null))['then'](respondWithResult(_0x4aa24a,null))[_0x1f3c('0x43')](handleError(_0x4aa24a,null));};exports['destroy']=function(_0x367a38,_0x554d06){return db[_0x1f3c('0x2c')][_0x1f3c('0x4b')]({'where':{'id':_0x367a38[_0x1f3c('0x4c')]['id']}})[_0x1f3c('0x24')](handleEntityNotFound(_0x554d06,null))['then'](removeEntity(_0x554d06,null))[_0x1f3c('0x43')](handleError(_0x554d06,null));};exports[_0x1f3c('0x4d')]=function(_0x3ef9c1,_0x1dcacf){return db[_0x1f3c('0x2c')][_0x1f3c('0x4d')]()[_0x1f3c('0x24')](respondWithResult(_0x1dcacf,null))['catch'](handleError(_0x1dcacf,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 179af7d..3a5df04 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 _0x1b61=['membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface'];(function(_0x521b56,_0x11b96f){var _0x4110bd=function(_0x741d4a){while(--_0x741d4a){_0x521b56['push'](_0x521b56['shift']());}};_0x4110bd(++_0x11b96f);}(_0x1b61,0x110));var _0x11b6=function(_0x139931,_0x361291){_0x139931=_0x139931-0x0;var _0x37c623=_0x1b61[_0x139931];return _0x37c623;};'use strict';var _=require(_0x11b6('0x0'));var util=require(_0x11b6('0x1'));var logger=require(_0x11b6('0x2'))(_0x11b6('0x3'));var moment=require(_0x11b6('0x4'));var BPromise=require(_0x11b6('0x5'));var rp=require(_0x11b6('0x6'));var fs=require('fs');var path=require(_0x11b6('0x7'));var rimraf=require(_0x11b6('0x8'));var config=require(_0x11b6('0x9'));var attributes=require(_0x11b6('0xa'));module[_0x11b6('0xb')]=function(_0x2ccadf,_0x59eb03){return _0x2ccadf[_0x11b6('0xc')](_0x11b6('0xd'),attributes,{'tableName':_0x11b6('0xe'),'paranoid':![],'indexes':[{'name':_0x11b6('0xf'),'fields':[_0x11b6('0x10'),_0x11b6('0x11')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7275=['./memberReport.attributes','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x2a56bf,_0x200235){var _0x4713f0=function(_0x3e70c1){while(--_0x3e70c1){_0x2a56bf['push'](_0x2a56bf['shift']());}};_0x4713f0(++_0x200235);}(_0x7275,0x148));var _0x5727=function(_0x1e2c67,_0x20db26){_0x1e2c67=_0x1e2c67-0x0;var _0x142720=_0x7275[_0x1e2c67];return _0x142720;};'use strict';var _=require(_0x5727('0x0'));var util=require(_0x5727('0x1'));var logger=require(_0x5727('0x2'))(_0x5727('0x3'));var moment=require(_0x5727('0x4'));var BPromise=require(_0x5727('0x5'));var rp=require(_0x5727('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5727('0x7'));var attributes=require(_0x5727('0x8'));module['exports']=function(_0x2091c8,_0x59bb93){return _0x2091c8['define'](_0x5727('0x9'),attributes,{'tableName':_0x5727('0xa'),'paranoid':![],'indexes':[{'name':_0x5727('0xb'),'fields':[_0x5727('0xc'),_0x5727('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 6c89385..d10bacf 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 _0x6585=['where','attributes','limit','include','map','model','info','debug','CreateMemberReport','create','body','raw','stringify','UpdateMemberReport','lodash','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x6585,0xe6));var _0x5658=function(_0x493030,_0x29ec7e){_0x493030=_0x493030-0x0;var _0x56f5e4=_0x6585[_0x493030];return _0x56f5e4;};'use strict';var _=require(_0x5658('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5658('0x1'));var rs=require(_0x5658('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5658('0x3'));var logger=require('../../config/logger')(_0x5658('0x4'));var config=require(_0x5658('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5658('0x6')][_0x5658('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52eb25,_0x4c240d,_0x23cdb9){return new BPromise(function(_0xaf948c,_0x17bb94){return client[_0x5658('0x8')](_0x52eb25,_0x23cdb9)[_0x5658('0x9')](function(_0x515585){logger['info'](_0x5658('0xa'),_0x4c240d,_0x5658('0xb'));logger['debug'](_0x5658('0xc'),_0x4c240d,'request\x20sent',JSON['stringify'](_0x515585));if(_0x515585[_0x5658('0xd')]){if(_0x515585[_0x5658('0xd')][_0x5658('0xe')]===0x1f4){logger[_0x5658('0xd')](_0x5658('0xa'),_0x4c240d,_0x515585[_0x5658('0xd')][_0x5658('0xf')]);return _0x17bb94(_0x515585[_0x5658('0xd')][_0x5658('0xf')]);}logger[_0x5658('0xd')](_0x5658('0xa'),_0x4c240d,_0x515585[_0x5658('0xd')][_0x5658('0xf')]);return _0xaf948c(_0x515585[_0x5658('0xd')]['message']);}else{logger['info'](_0x5658('0xa'),_0x4c240d,'request\x20sent');_0xaf948c(_0x515585[_0x5658('0x10')][_0x5658('0xf')]);}})[_0x5658('0x11')](function(_0x292a8a){logger[_0x5658('0xd')](_0x5658('0xa'),_0x4c240d,_0x292a8a);_0x17bb94(_0x292a8a);});});}exports[_0x5658('0x12')]=function(_0x5e9b38){var _0x5220cc=this;return new Promise(function(_0x4c5291,_0xd7fce4){return db[_0x5658('0x13')][_0x5658('0x14')]({'raw':_0x5e9b38[_0x5658('0x15')]?_0x5e9b38[_0x5658('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5e9b38['options']?_0x5e9b38[_0x5658('0x15')][_0x5658('0x16')]||null:null,'attributes':_0x5e9b38[_0x5658('0x15')]?_0x5e9b38[_0x5658('0x15')][_0x5658('0x17')]||null:null,'limit':_0x5e9b38[_0x5658('0x15')]?_0x5e9b38[_0x5658('0x15')][_0x5658('0x18')]||null:null,'include':_0x5e9b38[_0x5658('0x15')]?_0x5e9b38[_0x5658('0x15')][_0x5658('0x19')]?_[_0x5658('0x1a')](_0x5e9b38['options'][_0x5658('0x19')],function(_0x52b1f2){return{'model':db[_0x52b1f2[_0x5658('0x1b')]],'as':_0x52b1f2['as'],'attributes':_0x52b1f2[_0x5658('0x17')],'include':_0x52b1f2[_0x5658('0x19')]?_['map'](_0x52b1f2[_0x5658('0x19')],function(_0x411f0f){return{'model':db[_0x411f0f[_0x5658('0x1b')]],'as':_0x411f0f['as'],'attributes':_0x411f0f[_0x5658('0x17')],'include':_0x411f0f[_0x5658('0x19')]?_[_0x5658('0x1a')](_0x411f0f['include'],function(_0x381d53){return{'model':db[_0x381d53['model']],'as':_0x381d53['as'],'attributes':_0x381d53[_0x5658('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e067b){logger[_0x5658('0x1c')]('GetMemberReport',_0x5e9b38);logger[_0x5658('0x1d')](_0x5658('0x12'),_0x5e9b38,JSON['stringify'](_0x4e067b));_0x4c5291(_0x4e067b);})[_0x5658('0x11')](function(_0xbc3a9){logger[_0x5658('0xd')](_0x5658('0x12'),_0xbc3a9['message'],_0x5e9b38);_0xd7fce4(_0x5220cc['error'](0x1f4,_0xbc3a9['message']));});});};exports[_0x5658('0x1e')]=function(_0x1000dc){var _0x74e171=this;return new Promise(function(_0xbf606a,_0x735560){return db['MemberReport'][_0x5658('0x1f')](_0x1000dc[_0x5658('0x20')],{'raw':_0x1000dc[_0x5658('0x15')]?_0x1000dc[_0x5658('0x15')][_0x5658('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0xd011e1){logger[_0x5658('0x1c')](_0x5658('0x1e'),_0x1000dc);logger[_0x5658('0x1d')](_0x5658('0x1e'),_0x1000dc,JSON[_0x5658('0x22')](_0xd011e1));_0xbf606a(_0xd011e1);})[_0x5658('0x11')](function(_0x1d7897){logger[_0x5658('0xd')](_0x5658('0x1e'),_0x1d7897[_0x5658('0xf')],_0x1000dc);_0x735560(_0x74e171[_0x5658('0xd')](0x1f4,_0x1d7897['message']));});});};exports[_0x5658('0x23')]=function(_0x2267cb){var _0xdc71ca=this;return new Promise(function(_0x292009,_0x363057){return db[_0x5658('0x13')]['update'](_0x2267cb[_0x5658('0x20')],{'raw':_0x2267cb[_0x5658('0x15')]?_0x2267cb[_0x5658('0x15')][_0x5658('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2267cb[_0x5658('0x15')]?_0x2267cb[_0x5658('0x15')][_0x5658('0x16')]||null:null,'attributes':_0x2267cb[_0x5658('0x15')]?_0x2267cb[_0x5658('0x15')]['attributes']||null:null,'limit':_0x2267cb['options']?_0x2267cb[_0x5658('0x15')][_0x5658('0x18')]||null:null})['then'](function(_0x4de042){logger[_0x5658('0x1c')](_0x5658('0x23'),_0x2267cb);logger[_0x5658('0x1d')](_0x5658('0x23'),_0x2267cb,JSON[_0x5658('0x22')](_0x4de042));_0x292009(_0x4de042);})[_0x5658('0x11')](function(_0x55bd12){logger[_0x5658('0xd')]('UpdateMemberReport',_0x55bd12[_0x5658('0xf')],_0x2267cb);_0x363057(_0xdc71ca[_0x5658('0xd')](0x1f4,_0x55bd12[_0x5658('0xf')]));});});}; \ No newline at end of file +var _0x44e4=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','include','model','map','then','CreateMemberReport','body','UpdateMemberReport','limit','lodash','util','moment','../../mysqldb'];(function(_0x747d21,_0x5666c2){var _0x32a0da=function(_0x304ab8){while(--_0x304ab8){_0x747d21['push'](_0x747d21['shift']());}};_0x32a0da(++_0x5666c2);}(_0x44e4,0x140));var _0x444e=function(_0x4bcfa6,_0x1c7e43){_0x4bcfa6=_0x4bcfa6-0x0;var _0x1c0165=_0x44e4[_0x4bcfa6];return _0x1c0165;};'use strict';var _=require(_0x444e('0x0'));var util=require(_0x444e('0x1'));var moment=require(_0x444e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x444e('0x3'))['db'];var utils=require(_0x444e('0x4'));var logger=require(_0x444e('0x5'))(_0x444e('0x6'));var config=require(_0x444e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x444e('0x8')][_0x444e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb97c4f,_0x18bd15,_0x133699){return new BPromise(function(_0x5e7115,_0x48c020){return client[_0x444e('0xa')](_0xb97c4f,_0x133699)['then'](function(_0x2078b3){logger[_0x444e('0xb')](_0x444e('0xc'),_0x18bd15,_0x444e('0xd'));logger[_0x444e('0xe')](_0x444e('0xf'),_0x18bd15,_0x444e('0xd'),JSON[_0x444e('0x10')](_0x2078b3));if(_0x2078b3['error']){if(_0x2078b3[_0x444e('0x11')][_0x444e('0x12')]===0x1f4){logger[_0x444e('0x11')](_0x444e('0xc'),_0x18bd15,_0x2078b3[_0x444e('0x11')][_0x444e('0x13')]);return _0x48c020(_0x2078b3[_0x444e('0x11')]['message']);}logger[_0x444e('0x11')]('MemberReport,\x20%s,\x20%s',_0x18bd15,_0x2078b3[_0x444e('0x11')][_0x444e('0x13')]);return _0x5e7115(_0x2078b3['error'][_0x444e('0x13')]);}else{logger[_0x444e('0xb')]('MemberReport,\x20%s,\x20%s',_0x18bd15,_0x444e('0xd'));_0x5e7115(_0x2078b3[_0x444e('0x14')][_0x444e('0x13')]);}})[_0x444e('0x15')](function(_0x3ea37d){logger[_0x444e('0x11')](_0x444e('0xc'),_0x18bd15,_0x3ea37d);_0x48c020(_0x3ea37d);});});}exports[_0x444e('0x16')]=function(_0x3313dc){var _0x11809a=this;return new Promise(function(_0x5a2531,_0x33806a){return db[_0x444e('0x17')]['findAll']({'raw':_0x3313dc[_0x444e('0x18')]?_0x3313dc[_0x444e('0x18')][_0x444e('0x19')]===undefined?!![]:![]:!![],'where':_0x3313dc[_0x444e('0x18')]?_0x3313dc[_0x444e('0x18')][_0x444e('0x1a')]||null:null,'attributes':_0x3313dc[_0x444e('0x18')]?_0x3313dc[_0x444e('0x18')][_0x444e('0x1b')]||null:null,'limit':_0x3313dc[_0x444e('0x18')]?_0x3313dc['options']['limit']||null:null,'include':_0x3313dc['options']?_0x3313dc[_0x444e('0x18')][_0x444e('0x1c')]?_['map'](_0x3313dc[_0x444e('0x18')][_0x444e('0x1c')],function(_0x377d22){return{'model':db[_0x377d22[_0x444e('0x1d')]],'as':_0x377d22['as'],'attributes':_0x377d22[_0x444e('0x1b')],'include':_0x377d22[_0x444e('0x1c')]?_[_0x444e('0x1e')](_0x377d22['include'],function(_0x255fca){return{'model':db[_0x255fca[_0x444e('0x1d')]],'as':_0x255fca['as'],'attributes':_0x255fca['attributes'],'include':_0x255fca[_0x444e('0x1c')]?_['map'](_0x255fca[_0x444e('0x1c')],function(_0xed5d48){return{'model':db[_0xed5d48['model']],'as':_0xed5d48['as'],'attributes':_0xed5d48[_0x444e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x444e('0x1f')](function(_0x5b941d){logger[_0x444e('0xb')](_0x444e('0x16'),_0x3313dc);logger['debug'](_0x444e('0x16'),_0x3313dc,JSON[_0x444e('0x10')](_0x5b941d));_0x5a2531(_0x5b941d);})[_0x444e('0x15')](function(_0x5d4867){logger[_0x444e('0x11')]('GetMemberReport',_0x5d4867[_0x444e('0x13')],_0x3313dc);_0x33806a(_0x11809a[_0x444e('0x11')](0x1f4,_0x5d4867['message']));});});};exports[_0x444e('0x20')]=function(_0x14e118){var _0x500881=this;return new Promise(function(_0x1ca44e,_0x35c308){return db['MemberReport']['create'](_0x14e118[_0x444e('0x21')],{'raw':_0x14e118[_0x444e('0x18')]?_0x14e118[_0x444e('0x18')][_0x444e('0x19')]===undefined?!![]:![]:!![]})[_0x444e('0x1f')](function(_0x109745){logger[_0x444e('0xb')]('CreateMemberReport',_0x14e118);logger[_0x444e('0xe')]('CreateMemberReport',_0x14e118,JSON[_0x444e('0x10')](_0x109745));_0x1ca44e(_0x109745);})['catch'](function(_0x22d799){logger[_0x444e('0x11')]('CreateMemberReport',_0x22d799['message'],_0x14e118);_0x35c308(_0x500881[_0x444e('0x11')](0x1f4,_0x22d799[_0x444e('0x13')]));});});};exports[_0x444e('0x22')]=function(_0x2eb523){var _0x40c583=this;return new Promise(function(_0x119dc,_0xededf9){return db[_0x444e('0x17')]['update'](_0x2eb523['body'],{'raw':_0x2eb523[_0x444e('0x18')]?_0x2eb523[_0x444e('0x18')][_0x444e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2eb523[_0x444e('0x18')]?_0x2eb523[_0x444e('0x18')][_0x444e('0x1a')]||null:null,'attributes':_0x2eb523[_0x444e('0x18')]?_0x2eb523[_0x444e('0x18')][_0x444e('0x1b')]||null:null,'limit':_0x2eb523[_0x444e('0x18')]?_0x2eb523['options'][_0x444e('0x23')]||null:null})[_0x444e('0x1f')](function(_0x1d0827){logger[_0x444e('0xb')]('UpdateMemberReport',_0x2eb523);logger[_0x444e('0xe')](_0x444e('0x22'),_0x2eb523,JSON[_0x444e('0x10')](_0x1d0827));_0x119dc(_0x1d0827);})[_0x444e('0x15')](function(_0x3c82b8){logger['error'](_0x444e('0x22'),_0x3c82b8[_0x444e('0x13')],_0x2eb523);_0xededf9(_0x40c583[_0x444e('0x11')](0x1f4,_0x3c82b8[_0x444e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 34d7aaa..5009603 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 _0x04de=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','multer'];(function(_0x23884b,_0x50c307){var _0x28113b=function(_0xce3fea){while(--_0xce3fea){_0x23884b['push'](_0x23884b['shift']());}};_0x28113b(++_0x50c307);}(_0x04de,0x107));var _0xe04d=function(_0x4d6601,_0x37ffac){_0x4d6601=_0x4d6601-0x0;var _0x3e41a0=_0x04de[_0x4d6601];return _0x3e41a0;};'use strict';var multer=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var path=require(_0xe04d('0x2'));var timeout=require(_0xe04d('0x3'));var express=require(_0xe04d('0x4'));var router=express[_0xe04d('0x5')]();var fs_extra=require(_0xe04d('0x6'));var auth=require(_0xe04d('0x7'));var interaction=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var controller=require(_0xe04d('0xa'));router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0x3937=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index'];(function(_0x21e0a9,_0x5edd42){var _0x2a12f5=function(_0x3c53a4){while(--_0x3c53a4){_0x21e0a9['push'](_0x21e0a9['shift']());}};_0x2a12f5(++_0x5edd42);}(_0x3937,0xbf));var _0x7393=function(_0x157d38,_0x1d0f9c){_0x157d38=_0x157d38-0x0;var _0x130615=_0x3937[_0x157d38];return _0x130615;};'use strict';var multer=require(_0x7393('0x0'));var util=require('util');var path=require(_0x7393('0x1'));var timeout=require(_0x7393('0x2'));var express=require('express');var router=express[_0x7393('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7393('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7393('0x5'));var controller=require(_0x7393('0x6'));router[_0x7393('0x7')]('/',controller[_0x7393('0x8')]);module[_0x7393('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index b13d7e5..cf10ad1 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 _0x6775=['version','sequelize','exports','STRING'];(function(_0x172153,_0xa788dc){var _0x3bede0=function(_0x3028e6){while(--_0x3028e6){_0x172153['push'](_0x172153['shift']());}};_0x3bede0(++_0xa788dc);}(_0x6775,0x139));var _0x5677=function(_0x5cd60b,_0x32f25e){_0x5cd60b=_0x5cd60b-0x0;var _0x17342d=_0x6775[_0x5cd60b];return _0x17342d;};'use strict';var Sequelize=require(_0x5677('0x0'));module[_0x5677('0x1')]={'version':{'type':Sequelize[_0x5677('0x2')],'unique':_0x5677('0x3')}}; \ No newline at end of file +var _0x38a2=['exports','STRING','version','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x38a2,0xa3));var _0x238a=function(_0x12fcf0,_0x5bd0c9){_0x12fcf0=_0x12fcf0-0x0;var _0x15226e=_0x38a2[_0x12fcf0];return _0x15226e;};'use strict';var Sequelize=require(_0x238a('0x0'));module[_0x238a('0x1')]={'version':{'type':Sequelize[_0x238a('0x2')],'unique':_0x238a('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 41913eb..436b12d 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 _0xb4f8=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','count','offset','limit','json','apply','update','then','error','stack','name','send','index','Migration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4f8,0x6e));var _0x8b4f=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0xb4f8[_0x3f4891];return _0x54f2d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b4f('0x0'));var zipdir=require(_0x8b4f('0x1'));var jsonpatch=require(_0x8b4f('0x2'));var rp=require(_0x8b4f('0x3'));var moment=require(_0x8b4f('0x4'));var BPromise=require(_0x8b4f('0x5'));var Mustache=require(_0x8b4f('0x6'));var util=require(_0x8b4f('0x7'));var path=require(_0x8b4f('0x8'));var sox=require(_0x8b4f('0x9'));var csv=require(_0x8b4f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b4f('0xb'));var _=require(_0x8b4f('0xc'));var squel=require(_0x8b4f('0xd'));var crypto=require('crypto');var jsforce=require(_0x8b4f('0xe'));var deskjs=require(_0x8b4f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8b4f('0x10'));var Papa=require(_0x8b4f('0x11'));var Redis=require(_0x8b4f('0x12'));var authService=require(_0x8b4f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8b4f('0x14'));var hardwareService=require(_0x8b4f('0x15'));var logger=require(_0x8b4f('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8b4f('0x17'))['db'];function respondWithStatusCode(_0x402d05,_0x9e6ea7){_0x9e6ea7=_0x9e6ea7||0xcc;return function(_0x3a8027){if(_0x3a8027){return _0x402d05[_0x8b4f('0x18')](_0x9e6ea7);}return _0x402d05[_0x8b4f('0x19')](_0x9e6ea7)[_0x8b4f('0x1a')]();};}function respondWithResult(_0x1e0412,_0x19f81f){_0x19f81f=_0x19f81f||0xc8;return function(_0x20adf3){if(_0x20adf3){return _0x1e0412['status'](_0x19f81f)['json'](_0x20adf3);}};}function respondWithFilteredResult(_0x47e25e,_0x1154c4){return function(_0x121d6b){if(_0x121d6b){var _0x3b105b=_0x121d6b[_0x8b4f('0x1b')],_0x46da40=_0x1154c4['offset'],_0x59a823=_0x1154c4[_0x8b4f('0x1c')]+_0x1154c4[_0x8b4f('0x1d')],_0x1d5980;if(_0x59a823>=_0x3b105b){_0x59a823=_0x3b105b;_0x1d5980=0xc8;}else{_0x1d5980=0xce;}_0x47e25e['status'](_0x1d5980);return _0x47e25e['set']('Content-Range',_0x46da40+'-'+_0x59a823+'/'+_0x3b105b)[_0x8b4f('0x1e')](_0x121d6b);}return null;};}function patchUpdates(_0x11da21){return function(_0x5b9216){try{jsonpatch[_0x8b4f('0x1f')](_0x5b9216,_0x11da21,!![]);}catch(_0x38f31b){return BPromise['reject'](_0x38f31b);}return _0x5b9216['save']();};}function saveUpdates(_0x47ae69,_0x531423){return function(_0x35235a){if(_0x35235a){return _0x35235a[_0x8b4f('0x20')](_0x47ae69)[_0x8b4f('0x21')](function(_0x5cd053){return _0x5cd053;});}return null;};}function removeEntity(_0x27bd2d,_0x59b130){return function(_0x147e99){if(_0x147e99){return _0x147e99['destroy']()[_0x8b4f('0x21')](function(){_0x27bd2d[_0x8b4f('0x19')](0xcc)[_0x8b4f('0x1a')]();});}};}function handleEntityNotFound(_0x2161e9,_0x519f68){return function(_0x430084){if(!_0x430084){_0x2161e9[_0x8b4f('0x18')](0x194);}return _0x430084;};}function handleError(_0x2ac81a,_0x28900a){_0x28900a=_0x28900a||0x1f4;return function(_0xec14aa){logger[_0x8b4f('0x22')](_0xec14aa[_0x8b4f('0x23')]);if(_0xec14aa[_0x8b4f('0x24')]){delete _0xec14aa[_0x8b4f('0x24')];}_0x2ac81a[_0x8b4f('0x19')](_0x28900a)[_0x8b4f('0x25')](_0xec14aa);};}exports[_0x8b4f('0x26')]=function(_0x55e03b,_0x52a506){var _0x596f76={},_0xee17a5={},_0x254d93={'count':0x0,'rows':[]};var _0x56574e=_['map'](db[_0x8b4f('0x27')][_0x8b4f('0x28')],function(_0x150b49){return{'name':_0x150b49[_0x8b4f('0x29')],'type':_0x150b49[_0x8b4f('0x2a')][_0x8b4f('0x2b')]};});_0xee17a5[_0x8b4f('0x2c')]=_['map'](_0x56574e,_0x8b4f('0x24'));_0xee17a5[_0x8b4f('0x2d')]=_[_0x8b4f('0x2e')](_0x55e03b[_0x8b4f('0x2d')]);_0xee17a5[_0x8b4f('0x2f')]=_[_0x8b4f('0x30')](_0xee17a5[_0x8b4f('0x2c')],_0xee17a5[_0x8b4f('0x2d')]);_0x596f76[_0x8b4f('0x31')]=_[_0x8b4f('0x30')](_0xee17a5[_0x8b4f('0x2c')],qs['fields'](_0x55e03b[_0x8b4f('0x2d')][_0x8b4f('0x32')]));_0x596f76[_0x8b4f('0x31')]=_0x596f76[_0x8b4f('0x31')][_0x8b4f('0x33')]?_0x596f76[_0x8b4f('0x31')]:_0xee17a5[_0x8b4f('0x2c')];if(!_0x55e03b['query'][_0x8b4f('0x34')]('nolimit')){_0x596f76['limit']=qs[_0x8b4f('0x1d')](_0x55e03b['query'][_0x8b4f('0x1d')]);_0x596f76[_0x8b4f('0x1c')]=qs[_0x8b4f('0x1c')](_0x55e03b[_0x8b4f('0x2d')][_0x8b4f('0x1c')]);}_0x596f76[_0x8b4f('0x35')]=qs[_0x8b4f('0x36')](_0x55e03b['query'][_0x8b4f('0x36')]);_0x596f76[_0x8b4f('0x37')]=qs[_0x8b4f('0x2f')](_[_0x8b4f('0x38')](_0x55e03b['query'],_0xee17a5[_0x8b4f('0x2f')]),_0x56574e);if(_0x55e03b[_0x8b4f('0x2d')][_0x8b4f('0x39')]){_0x596f76[_0x8b4f('0x37')]=_[_0x8b4f('0x3a')](_0x596f76['where'],{'$or':_['map'](_0x56574e,function(_0x9f2d71){if(_0x9f2d71[_0x8b4f('0x2a')]!==_0x8b4f('0x3b')){var _0x283bcc={};_0x283bcc[_0x9f2d71[_0x8b4f('0x24')]]={'$like':'%'+_0x55e03b[_0x8b4f('0x2d')][_0x8b4f('0x39')]+'%'};return _0x283bcc;}})});}_0x596f76=_[_0x8b4f('0x3a')]({},_0x596f76,_0x55e03b[_0x8b4f('0x3c')]);var _0x21a16b={'where':_0x596f76[_0x8b4f('0x37')]};return db[_0x8b4f('0x27')][_0x8b4f('0x1b')](_0x21a16b)[_0x8b4f('0x21')](function(_0x2e5b09){_0x254d93['count']=_0x2e5b09;if(_0x55e03b[_0x8b4f('0x2d')][_0x8b4f('0x3d')]){_0x596f76[_0x8b4f('0x3e')]=[{'all':!![]}];}return db[_0x8b4f('0x27')][_0x8b4f('0x3f')](_0x596f76);})[_0x8b4f('0x21')](function(_0x260d98){_0x254d93['rows']=_0x260d98;return _0x254d93;})['then'](respondWithFilteredResult(_0x52a506,_0x596f76))['catch'](handleError(_0x52a506,null));}; \ No newline at end of file +var _0x483a=['sox','to-csv','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','Migration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x483a,0xbb));var _0xa483=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x483a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa483('0x0'));var rimraf=require(_0xa483('0x1'));var zipdir=require(_0xa483('0x2'));var jsonpatch=require(_0xa483('0x3'));var rp=require(_0xa483('0x4'));var moment=require('moment');var BPromise=require(_0xa483('0x5'));var Mustache=require(_0xa483('0x6'));var util=require('util');var path=require(_0xa483('0x7'));var sox=require(_0xa483('0x8'));var csv=require(_0xa483('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa483('0xa'));var _=require(_0xa483('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa483('0x9'));var querystring=require('querystring');var Papa=require(_0xa483('0xc'));var Redis=require(_0xa483('0xd'));var authService=require(_0xa483('0xe'));var qs=require(_0xa483('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa483('0x10'));var logger=require(_0xa483('0x11'))(_0xa483('0x12'));var utils=require(_0xa483('0x13'));var config=require(_0xa483('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa483('0x15'))['db'];function respondWithStatusCode(_0x1a2c18,_0x375d85){_0x375d85=_0x375d85||0xcc;return function(_0x20b365){if(_0x20b365){return _0x1a2c18['sendStatus'](_0x375d85);}return _0x1a2c18[_0xa483('0x16')](_0x375d85)[_0xa483('0x17')]();};}function respondWithResult(_0x223330,_0x266b89){_0x266b89=_0x266b89||0xc8;return function(_0x332971){if(_0x332971){return _0x223330[_0xa483('0x16')](_0x266b89)[_0xa483('0x18')](_0x332971);}};}function respondWithFilteredResult(_0xdbc24f,_0x2dac01){return function(_0x99318){if(_0x99318){var _0x3b7c98=_0x99318['count'],_0x22262e=_0x2dac01[_0xa483('0x19')],_0x3905e2=_0x2dac01[_0xa483('0x19')]+_0x2dac01[_0xa483('0x1a')],_0x3e3b42;if(_0x3905e2>=_0x3b7c98){_0x3905e2=_0x3b7c98;_0x3e3b42=0xc8;}else{_0x3e3b42=0xce;}_0xdbc24f[_0xa483('0x16')](_0x3e3b42);return _0xdbc24f[_0xa483('0x1b')]('Content-Range',_0x22262e+'-'+_0x3905e2+'/'+_0x3b7c98)['json'](_0x99318);}return null;};}function patchUpdates(_0x326cbf){return function(_0x1d4dd8){try{jsonpatch[_0xa483('0x1c')](_0x1d4dd8,_0x326cbf,!![]);}catch(_0x4e3a3f){return BPromise['reject'](_0x4e3a3f);}return _0x1d4dd8[_0xa483('0x1d')]();};}function saveUpdates(_0x655cc3,_0x17280a){return function(_0xd16999){if(_0xd16999){return _0xd16999[_0xa483('0x1e')](_0x655cc3)[_0xa483('0x1f')](function(_0x3fb760){return _0x3fb760;});}return null;};}function removeEntity(_0x70b1b0,_0x4bce92){return function(_0x451c2e){if(_0x451c2e){return _0x451c2e[_0xa483('0x20')]()[_0xa483('0x1f')](function(){_0x70b1b0[_0xa483('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x848aa7,_0x1b2b44){return function(_0x417b17){if(!_0x417b17){_0x848aa7[_0xa483('0x21')](0x194);}return _0x417b17;};}function handleError(_0x4ea0d9,_0x5a3fe8){_0x5a3fe8=_0x5a3fe8||0x1f4;return function(_0x5217cc){logger[_0xa483('0x22')](_0x5217cc[_0xa483('0x23')]);if(_0x5217cc[_0xa483('0x24')]){delete _0x5217cc[_0xa483('0x24')];}_0x4ea0d9[_0xa483('0x16')](_0x5a3fe8)['send'](_0x5217cc);};}exports[_0xa483('0x25')]=function(_0x16c0bd,_0xf457d4){var _0x5db897={},_0x639dbf={},_0x5a2485={'count':0x0,'rows':[]};var _0x807e14=_[_0xa483('0x26')](db[_0xa483('0x27')]['rawAttributes'],function(_0x4913fc){return{'name':_0x4913fc[_0xa483('0x28')],'type':_0x4913fc[_0xa483('0x29')][_0xa483('0x2a')]};});_0x639dbf[_0xa483('0x2b')]=_[_0xa483('0x26')](_0x807e14,_0xa483('0x24'));_0x639dbf[_0xa483('0x2c')]=_[_0xa483('0x2d')](_0x16c0bd['query']);_0x639dbf[_0xa483('0x2e')]=_['intersection'](_0x639dbf[_0xa483('0x2b')],_0x639dbf[_0xa483('0x2c')]);_0x5db897['attributes']=_[_0xa483('0x2f')](_0x639dbf['model'],qs[_0xa483('0x30')](_0x16c0bd[_0xa483('0x2c')][_0xa483('0x30')]));_0x5db897[_0xa483('0x31')]=_0x5db897['attributes'][_0xa483('0x32')]?_0x5db897[_0xa483('0x31')]:_0x639dbf[_0xa483('0x2b')];if(!_0x16c0bd[_0xa483('0x2c')][_0xa483('0x33')](_0xa483('0x34'))){_0x5db897[_0xa483('0x1a')]=qs['limit'](_0x16c0bd[_0xa483('0x2c')]['limit']);_0x5db897['offset']=qs[_0xa483('0x19')](_0x16c0bd[_0xa483('0x2c')]['offset']);}_0x5db897['order']=qs[_0xa483('0x35')](_0x16c0bd[_0xa483('0x2c')][_0xa483('0x35')]);_0x5db897['where']=qs[_0xa483('0x2e')](_[_0xa483('0x36')](_0x16c0bd[_0xa483('0x2c')],_0x639dbf[_0xa483('0x2e')]),_0x807e14);if(_0x16c0bd['query'][_0xa483('0x37')]){_0x5db897['where']=_['merge'](_0x5db897[_0xa483('0x38')],{'$or':_[_0xa483('0x26')](_0x807e14,function(_0x2e1e41){if(_0x2e1e41[_0xa483('0x29')]!==_0xa483('0x39')){var _0x1ebfb5={};_0x1ebfb5[_0x2e1e41[_0xa483('0x24')]]={'$like':'%'+_0x16c0bd[_0xa483('0x2c')]['filter']+'%'};return _0x1ebfb5;}})});}_0x5db897=_[_0xa483('0x3a')]({},_0x5db897,_0x16c0bd['options']);var _0x4016a8={'where':_0x5db897[_0xa483('0x38')]};return db[_0xa483('0x27')][_0xa483('0x3b')](_0x4016a8)[_0xa483('0x1f')](function(_0x58e6ed){_0x5a2485['count']=_0x58e6ed;if(_0x16c0bd['query'][_0xa483('0x3c')]){_0x5db897[_0xa483('0x3d')]=[{'all':!![]}];}return db[_0xa483('0x27')][_0xa483('0x3e')](_0x5db897);})[_0xa483('0x1f')](function(_0x5a6486){_0x5a2485[_0xa483('0x3f')]=_0x5a6486;return _0x5a2485;})[_0xa483('0x1f')](respondWithFilteredResult(_0xf457d4,_0x5db897))[_0xa483('0x40')](handleError(_0xf457d4,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f30bab1..b3c8faa 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 _0x0b00=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations'];(function(_0x37026f,_0x2df88f){var _0x40cb74=function(_0x5276ac){while(--_0x5276ac){_0x37026f['push'](_0x37026f['shift']());}};_0x40cb74(++_0x2df88f);}(_0x0b00,0xa5));var _0x00b0=function(_0x1b41e7,_0x40c596){_0x1b41e7=_0x1b41e7-0x0;var _0x40ca8e=_0x0b00[_0x1b41e7];return _0x40ca8e;};'use strict';var _=require(_0x00b0('0x0'));var util=require(_0x00b0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x00b0('0x2'));var BPromise=require(_0x00b0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x00b0('0x4'));var rimraf=require(_0x00b0('0x5'));var config=require(_0x00b0('0x6'));var attributes=require(_0x00b0('0x7'));module[_0x00b0('0x8')]=function(_0x2f032a,_0xb7b60){return _0x2f032a['define'](_0x00b0('0x9'),attributes,{'tableName':_0x00b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa31b=['./migration.attributes','exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa31b,0x1f1));var _0xba31=function(_0x185ed2,_0xb1564a){_0x185ed2=_0x185ed2-0x0;var _0x11d850=_0xa31b[_0x185ed2];return _0x11d850;};'use strict';var _=require(_0xba31('0x0'));var util=require('util');var logger=require(_0xba31('0x1'))(_0xba31('0x2'));var moment=require(_0xba31('0x3'));var BPromise=require(_0xba31('0x4'));var rp=require(_0xba31('0x5'));var fs=require('fs');var path=require(_0xba31('0x6'));var rimraf=require(_0xba31('0x7'));var config=require(_0xba31('0x8'));var attributes=require(_0xba31('0x9'));module[_0xba31('0xa')]=function(_0x52f14f,_0x944ddd){return _0x52f14f['define']('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 4425df8..f66cfe4 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 _0x05e3=['result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x571c58,_0x57bc35){var _0x31f64f=function(_0xf4d5b){while(--_0xf4d5b){_0x571c58['push'](_0x571c58['shift']());}};_0x31f64f(++_0x57bc35);}(_0x05e3,0x86));var _0x305e=function(_0x15029f,_0x58be73){_0x15029f=_0x15029f-0x0;var _0x36688c=_0x05e3[_0x15029f];return _0x36688c;};'use strict';var _=require(_0x305e('0x0'));var util=require(_0x305e('0x1'));var moment=require(_0x305e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x305e('0x3'));var db=require(_0x305e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x305e('0x5'))(_0x305e('0x6'));var config=require('../../config/environment');var jayson=require(_0x305e('0x7'));var client=jayson[_0x305e('0x8')][_0x305e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x143428,_0x72ac4b,_0x22b00b){return new BPromise(function(_0x86ade0,_0x952a5e){return client['request'](_0x143428,_0x22b00b)[_0x305e('0xa')](function(_0x4a66fd){logger[_0x305e('0xb')](_0x305e('0xc'),_0x72ac4b,'request\x20sent');logger[_0x305e('0xd')](_0x305e('0xe'),_0x72ac4b,_0x305e('0xf'),JSON[_0x305e('0x10')](_0x4a66fd));if(_0x4a66fd[_0x305e('0x11')]){if(_0x4a66fd[_0x305e('0x11')][_0x305e('0x12')]===0x1f4){logger[_0x305e('0x11')](_0x305e('0xc'),_0x72ac4b,_0x4a66fd[_0x305e('0x11')][_0x305e('0x13')]);return _0x952a5e(_0x4a66fd[_0x305e('0x11')]['message']);}logger[_0x305e('0x11')](_0x305e('0xc'),_0x72ac4b,_0x4a66fd['error'][_0x305e('0x13')]);return _0x86ade0(_0x4a66fd[_0x305e('0x11')][_0x305e('0x13')]);}else{logger[_0x305e('0xb')](_0x305e('0xc'),_0x72ac4b,_0x305e('0xf'));_0x86ade0(_0x4a66fd[_0x305e('0x14')]['message']);}})[_0x305e('0x15')](function(_0x455e78){logger['error'](_0x305e('0xc'),_0x72ac4b,_0x455e78);_0x952a5e(_0x455e78);});});} \ No newline at end of file +var _0xe630=['message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xe630,0xb5));var _0x0e63=function(_0x319cd8,_0x1fc6e4){_0x319cd8=_0x319cd8-0x0;var _0x5b2306=_0xe630[_0x319cd8];return _0x5b2306;};'use strict';var _=require(_0x0e63('0x0'));var util=require('util');var moment=require(_0x0e63('0x1'));var BPromise=require('bluebird');var rs=require(_0x0e63('0x2'));var fs=require('fs');var Redis=require(_0x0e63('0x3'));var db=require(_0x0e63('0x4'))['db'];var utils=require(_0x0e63('0x5'));var logger=require(_0x0e63('0x6'))('rpc');var config=require(_0x0e63('0x7'));var jayson=require(_0x0e63('0x8'));var client=jayson[_0x0e63('0x9')][_0x0e63('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfa25c8,_0x3cd6f0,_0x4480d2){return new BPromise(function(_0x402b99,_0x1eca26){return client[_0x0e63('0xb')](_0xfa25c8,_0x4480d2)['then'](function(_0xab7d1){logger[_0x0e63('0xc')](_0x0e63('0xd'),_0x3cd6f0,_0x0e63('0xe'));logger['debug'](_0x0e63('0xf'),_0x3cd6f0,_0x0e63('0xe'),JSON[_0x0e63('0x10')](_0xab7d1));if(_0xab7d1[_0x0e63('0x11')]){if(_0xab7d1[_0x0e63('0x11')][_0x0e63('0x12')]===0x1f4){logger['error'](_0x0e63('0xd'),_0x3cd6f0,_0xab7d1[_0x0e63('0x11')][_0x0e63('0x13')]);return _0x1eca26(_0xab7d1[_0x0e63('0x11')][_0x0e63('0x13')]);}logger[_0x0e63('0x11')](_0x0e63('0xd'),_0x3cd6f0,_0xab7d1[_0x0e63('0x11')][_0x0e63('0x13')]);return _0x402b99(_0xab7d1['error'][_0x0e63('0x13')]);}else{logger['info'](_0x0e63('0xd'),_0x3cd6f0,_0x0e63('0xe'));_0x402b99(_0xab7d1['result'][_0x0e63('0x13')]);}})['catch'](function(_0x43f383){logger[_0x0e63('0x11')]('Migration,\x20%s,\x20%s',_0x3cd6f0,_0x43f383);_0x1eca26(_0x43f383);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index cc048fb..9084bfb 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 _0xc212=['./network.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xb07424,_0x3093b0){var _0x45e1a2=function(_0x24d531){while(--_0x24d531){_0xb07424['push'](_0xb07424['shift']());}};_0x45e1a2(++_0x3093b0);}(_0xc212,0x90));var _0x2c21=function(_0x36c042,_0xd9de02){_0x36c042=_0x36c042-0x0;var _0x38fd28=_0xc212[_0x36c042];return _0x38fd28;};'use strict';var multer=require(_0x2c21('0x0'));var util=require(_0x2c21('0x1'));var path=require('path');var timeout=require(_0x2c21('0x2'));var express=require(_0x2c21('0x3'));var router=express[_0x2c21('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2c21('0x5'));var interaction=require(_0x2c21('0x6'));var config=require(_0x2c21('0x7'));var controller=require(_0x2c21('0x8'));router[_0x2c21('0x9')]('/',auth[_0x2c21('0xa')](),controller[_0x2c21('0xb')]);router[_0x2c21('0x9')](_0x2c21('0xc'),auth[_0x2c21('0xa')](),controller[_0x2c21('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2c21('0xe')](_0x2c21('0xc'),auth[_0x2c21('0xa')](),controller[_0x2c21('0xf')]);router[_0x2c21('0x10')](_0x2c21('0xc'),auth['isAuthenticated'](),controller[_0x2c21('0x11')]);module[_0x2c21('0x12')]=router; \ No newline at end of file +var _0xc443=['../../components/interaction/service','../../config/environment','./network.controller','index','get','/:id','isAuthenticated','create','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x2db817,_0x12a72b){var _0x52e456=function(_0x414cd8){while(--_0x414cd8){_0x2db817['push'](_0x2db817['shift']());}};_0x52e456(++_0x12a72b);}(_0xc443,0x16a));var _0x3c44=function(_0x5becbc,_0x301bab){_0x5becbc=_0x5becbc-0x0;var _0x400201=_0xc443[_0x5becbc];return _0x400201;};'use strict';var multer=require(_0x3c44('0x0'));var util=require(_0x3c44('0x1'));var path=require(_0x3c44('0x2'));var timeout=require('connect-timeout');var express=require(_0x3c44('0x3'));var router=express[_0x3c44('0x4')]();var fs_extra=require(_0x3c44('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3c44('0x6'));var config=require(_0x3c44('0x7'));var controller=require(_0x3c44('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3c44('0x9')]);router[_0x3c44('0xa')](_0x3c44('0xb'),auth[_0x3c44('0xc')](),controller['show']);router['post']('/',auth[_0x3c44('0xc')](),controller[_0x3c44('0xd')]);router['put'](_0x3c44('0xb'),auth[_0x3c44('0xc')](),controller['update']);router[_0x3c44('0xe')](_0x3c44('0xb'),auth['isAuthenticated'](),controller[_0x3c44('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 72217a3..4a26c25 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 _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x1346fe,_0x1bf97b){var _0x3def5e=function(_0x185376){while(--_0x185376){_0x1346fe['push'](_0x1346fe['shift']());}};_0x3def5e(++_0x1bf97b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x16ee2a,_0x1dfb7f){var _0x3f3d30=function(_0xe2dd6d){while(--_0xe2dd6d){_0x16ee2a['push'](_0x16ee2a['shift']());}};_0x3f3d30(++_0x1dfb7f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 2512a2e..96acb86 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 _0x9c16=['map','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','Network','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','create','transaction','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','server/files/templates/network.ejs','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','index'];(function(_0x5437ae,_0x3de18e){var _0x44a1ad=function(_0x4c9175){while(--_0x4c9175){_0x5437ae['push'](_0x5437ae['shift']());}};_0x44a1ad(++_0x3de18e);}(_0x9c16,0x163));var _0x69c1=function(_0x12afed,_0x83cd2b){_0x12afed=_0x12afed-0x0;var _0x5f5ce7=_0x9c16[_0x12afed];return _0x5f5ce7;};'use strict';var emlformat=require(_0x69c1('0x0'));var rimraf=require(_0x69c1('0x1'));var zipdir=require(_0x69c1('0x2'));var jsonpatch=require(_0x69c1('0x3'));var rp=require(_0x69c1('0x4'));var moment=require(_0x69c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x69c1('0x6'));var util=require(_0x69c1('0x7'));var path=require('path');var sox=require(_0x69c1('0x8'));var csv=require(_0x69c1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x69c1('0xa'));var _=require('lodash');var squel=require(_0x69c1('0xb'));var crypto=require('crypto');var jsforce=require(_0x69c1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x69c1('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x69c1('0xd'));var authService=require(_0x69c1('0xe'));var qs=require(_0x69c1('0xf'));var as=require(_0x69c1('0x10'));var hardwareService=require(_0x69c1('0x11'));var logger=require('../../config/logger')(_0x69c1('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x69c1('0x13'))['db'];var jayson=require(_0x69c1('0x14'));var client=jayson['client'][_0x69c1('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x27408a,_0x236087,_0x552b52,_0x1e77f7){return new BPromise(function(_0x119af0,_0x55f753){var _0x45c5d0=_0x1e77f7||client;return _0x45c5d0[_0x69c1('0x16')](_0x27408a,_0x552b52)[_0x69c1('0x17')](function(_0x23edba){logger['info'](_0x69c1('0x18'),_0x236087,_0x69c1('0x19'));logger[_0x69c1('0x1a')]('Network,\x20%s,\x20%s,\x20%s',_0x236087,_0x69c1('0x19'),JSON['stringify'](_0x23edba));if(_0x23edba[_0x69c1('0x1b')]){if(_0x23edba[_0x69c1('0x1b')][_0x69c1('0x1c')]===0x1f4){logger['error'](_0x69c1('0x18'),_0x236087,_0x23edba[_0x69c1('0x1b')][_0x69c1('0x1d')]);return _0x55f753(_0x23edba[_0x69c1('0x1b')][_0x69c1('0x1d')]);}logger[_0x69c1('0x1b')](_0x69c1('0x18'),_0x236087,_0x23edba[_0x69c1('0x1b')][_0x69c1('0x1d')]);return _0x119af0(_0x23edba['error'][_0x69c1('0x1d')]);}else{logger[_0x69c1('0x1e')](_0x69c1('0x18'),_0x236087,_0x69c1('0x19'));_0x119af0(_0x23edba['result'][_0x69c1('0x1d')]);}})[_0x69c1('0x1f')](function(_0x388e38){logger[_0x69c1('0x1b')](_0x69c1('0x18'),_0x236087,_0x388e38);_0x55f753(_0x388e38);});});}function respondWithStatusCode(_0x30b758,_0x570e76){_0x570e76=_0x570e76||0xcc;return function(_0x130ef4){if(_0x130ef4){return _0x30b758['sendStatus'](_0x570e76);}return _0x30b758[_0x69c1('0x20')](_0x570e76)['end']();};}function respondWithResult(_0x4bf5c9,_0x42e532){_0x42e532=_0x42e532||0xc8;return function(_0x3f45f6){if(_0x3f45f6){return _0x4bf5c9[_0x69c1('0x20')](_0x42e532)[_0x69c1('0x21')](_0x3f45f6);}};}function respondWithFilteredResult(_0x5e49ca,_0x2556e4){return function(_0x59d82b){if(_0x59d82b){var _0x1d12c2=_0x59d82b[_0x69c1('0x22')],_0x4d3f76=_0x2556e4[_0x69c1('0x23')],_0x22bc06=_0x2556e4[_0x69c1('0x23')]+_0x2556e4[_0x69c1('0x24')],_0x38c2d8;if(_0x22bc06>=_0x1d12c2){_0x22bc06=_0x1d12c2;_0x38c2d8=0xc8;}else{_0x38c2d8=0xce;}_0x5e49ca[_0x69c1('0x20')](_0x38c2d8);return _0x5e49ca[_0x69c1('0x25')](_0x69c1('0x26'),_0x4d3f76+'-'+_0x22bc06+'/'+_0x1d12c2)[_0x69c1('0x21')](_0x59d82b);}return null;};}function patchUpdates(_0x4bf631){return function(_0x7a1c85){try{jsonpatch['apply'](_0x7a1c85,_0x4bf631,!![]);}catch(_0x108043){return BPromise[_0x69c1('0x27')](_0x108043);}return _0x7a1c85[_0x69c1('0x28')]();};}function saveUpdates(_0x2f3549,_0x3b9c85){return function(_0x1d8055){if(_0x1d8055){return _0x1d8055[_0x69c1('0x29')](_0x2f3549)[_0x69c1('0x17')](function(_0x2d9fa7){return _0x2d9fa7;});}return null;};}function removeEntity(_0xf71f49,_0x31b33c){return function(_0x394b78){if(_0x394b78){return _0x394b78[_0x69c1('0x2a')]()[_0x69c1('0x17')](function(){_0xf71f49[_0x69c1('0x20')](0xcc)[_0x69c1('0x2b')]();});}};}function handleEntityNotFound(_0x5b5ba1,_0x269469){return function(_0x1f8cc3){if(!_0x1f8cc3){_0x5b5ba1[_0x69c1('0x2c')](0x194);}return _0x1f8cc3;};}function handleError(_0x2b0797,_0x5358d1){_0x5358d1=_0x5358d1||0x1f4;return function(_0x373ca5){logger[_0x69c1('0x1b')](_0x373ca5[_0x69c1('0x2d')]);if(_0x373ca5[_0x69c1('0x2e')]){delete _0x373ca5[_0x69c1('0x2e')];}_0x2b0797['status'](_0x5358d1)[_0x69c1('0x2f')](_0x373ca5);};}exports[_0x69c1('0x30')]=function(_0xdd9fd9,_0x2fc721){var _0x22efcd={},_0x721cf4={},_0x97474e={'count':0x0,'rows':[]};var _0x3b9a5f=_[_0x69c1('0x31')](db['Network']['rawAttributes'],function(_0x491e84){return{'name':_0x491e84[_0x69c1('0x32')],'type':_0x491e84['type'][_0x69c1('0x33')]};});_0x721cf4[_0x69c1('0x34')]=_[_0x69c1('0x31')](_0x3b9a5f,'name');_0x721cf4['query']=_['keys'](_0xdd9fd9[_0x69c1('0x35')]);_0x721cf4[_0x69c1('0x36')]=_['intersection'](_0x721cf4[_0x69c1('0x34')],_0x721cf4[_0x69c1('0x35')]);_0x22efcd[_0x69c1('0x37')]=_[_0x69c1('0x38')](_0x721cf4['model'],qs[_0x69c1('0x39')](_0xdd9fd9[_0x69c1('0x35')][_0x69c1('0x39')]));_0x22efcd[_0x69c1('0x37')]=_0x22efcd['attributes'][_0x69c1('0x3a')]?_0x22efcd[_0x69c1('0x37')]:_0x721cf4[_0x69c1('0x34')];if(!_0xdd9fd9['query'][_0x69c1('0x3b')]('nolimit')){_0x22efcd[_0x69c1('0x24')]=qs[_0x69c1('0x24')](_0xdd9fd9[_0x69c1('0x35')][_0x69c1('0x24')]);_0x22efcd[_0x69c1('0x23')]=qs[_0x69c1('0x23')](_0xdd9fd9[_0x69c1('0x35')][_0x69c1('0x23')]);}_0x22efcd[_0x69c1('0x3c')]=qs[_0x69c1('0x3d')](_0xdd9fd9['query'][_0x69c1('0x3d')]);_0x22efcd[_0x69c1('0x3e')]=qs['filters'](_['pick'](_0xdd9fd9[_0x69c1('0x35')],_0x721cf4[_0x69c1('0x36')]),_0x3b9a5f);if(_0xdd9fd9[_0x69c1('0x35')][_0x69c1('0x3f')]){_0x22efcd[_0x69c1('0x3e')]=_[_0x69c1('0x40')](_0x22efcd['where'],{'$or':_['map'](_0x3b9a5f,function(_0x126762){if(_0x126762[_0x69c1('0x41')]!==_0x69c1('0x42')){var _0x968aa8={};_0x968aa8[_0x126762[_0x69c1('0x2e')]]={'$like':'%'+_0xdd9fd9[_0x69c1('0x35')][_0x69c1('0x3f')]+'%'};return _0x968aa8;}})});}_0x22efcd=_['merge']({},_0x22efcd,_0xdd9fd9[_0x69c1('0x43')]);var _0x3adc90={'where':_0x22efcd[_0x69c1('0x3e')]};return db[_0x69c1('0x44')][_0x69c1('0x22')](_0x3adc90)[_0x69c1('0x17')](function(_0x437c7f){_0x97474e[_0x69c1('0x22')]=_0x437c7f;if(_0xdd9fd9[_0x69c1('0x35')][_0x69c1('0x45')]){_0x22efcd['include']=[{'all':!![]}];}return db[_0x69c1('0x44')][_0x69c1('0x46')](_0x22efcd);})['then'](function(_0x413a7a){_0x97474e[_0x69c1('0x47')]=_0x413a7a;return _0x97474e;})[_0x69c1('0x17')](respondWithFilteredResult(_0x2fc721,_0x22efcd))[_0x69c1('0x1f')](handleError(_0x2fc721,null));};exports[_0x69c1('0x48')]=function(_0x5350d9,_0x9efc0e){var _0x43fe67={'raw':!![],'where':{'id':_0x5350d9[_0x69c1('0x49')]['id']}},_0x269715={};_0x269715[_0x69c1('0x34')]=_[_0x69c1('0x4a')](db[_0x69c1('0x44')][_0x69c1('0x4b')]);_0x269715[_0x69c1('0x35')]=_['keys'](_0x5350d9[_0x69c1('0x35')]);_0x269715[_0x69c1('0x36')]=_[_0x69c1('0x38')](_0x269715[_0x69c1('0x34')],_0x269715[_0x69c1('0x35')]);_0x43fe67[_0x69c1('0x37')]=_[_0x69c1('0x38')](_0x269715['model'],qs[_0x69c1('0x39')](_0x5350d9[_0x69c1('0x35')]['fields']));_0x43fe67[_0x69c1('0x37')]=_0x43fe67[_0x69c1('0x37')][_0x69c1('0x3a')]?_0x43fe67[_0x69c1('0x37')]:_0x269715['model'];if(_0x5350d9[_0x69c1('0x35')][_0x69c1('0x45')]){_0x43fe67[_0x69c1('0x4c')]=[{'all':!![]}];}_0x43fe67=_[_0x69c1('0x40')]({},_0x43fe67,_0x5350d9['options']);return db[_0x69c1('0x44')][_0x69c1('0x4d')](_0x43fe67)['then'](handleEntityNotFound(_0x9efc0e,null))[_0x69c1('0x17')](respondWithResult(_0x9efc0e,null))[_0x69c1('0x1f')](handleError(_0x9efc0e,null));};exports[_0x69c1('0x4e')]=function(_0x5d3194,_0x3b6b21,_0x1eb6ff){var _0x2709c3;return db['sequelize'][_0x69c1('0x4f')](function(_0x596f6c){return db[_0x69c1('0x44')][_0x69c1('0x4e')](_0x5d3194[_0x69c1('0x50')],{'raw':!![]})[_0x69c1('0x17')](function(_0x137f87){_0x2709c3=_0x137f87;return db['Network'][_0x69c1('0x46')]({'where':{'type':_0x5d3194[_0x69c1('0x50')]['type']},'raw':!![]});})[_0x69c1('0x17')](function(_0x28fb13){if(_0x2709c3['type']['toUpperCase']()==_0x69c1('0x51')){var _0x4ed221=fs[_0x69c1('0x52')](path[_0x69c1('0x53')](config[_0x69c1('0x54')],_0x69c1('0x55')),_0x69c1('0x56'));var _0x4bcdf0=ejs[_0x69c1('0x57')](_0x4ed221,{'networks':_0x28fb13||[]});fs[_0x69c1('0x58')](_0x69c1('0x59'),_0x4bcdf0);return respondWithRpcPromise(_0x69c1('0x5a'),'create',{'module':_0x69c1('0x5b')});}else if(_0x2709c3['type'][_0x69c1('0x5c')]()==_0x69c1('0x5d')){var _0x42b60b=fs['readFileSync'](path['join'](config[_0x69c1('0x54')],_0x69c1('0x5e')),_0x69c1('0x56'));var _0xb4091c=ejs[_0x69c1('0x57')](_0x42b60b,{'networks':_0x28fb13||[]});fs[_0x69c1('0x58')](_0x69c1('0x5f'),_0xb4091c);return respondWithRpcPromise(_0x69c1('0x5a'),'create',{'module':'res_stun_monitor.so'});}else{var _0x5dc5bd=fs[_0x69c1('0x52')](path['join'](config['root'],'server/files/templates/network.ejs'),_0x69c1('0x56'));var _0x20691f=ejs[_0x69c1('0x57')](_0x5dc5bd,{'networks':_0x28fb13||[]});fs[_0x69c1('0x58')](util['format'](_0x69c1('0x60'),_0x5d3194[_0x69c1('0x50')][_0x69c1('0x41')][_0x69c1('0x61')]()),_0x20691f);return respondWithRpcPromise(_0x69c1('0x5a'),_0x69c1('0x4e'),{'module':_0x69c1('0x62')});}return null;})[_0x69c1('0x17')](function(){return _0x2709c3;});})[_0x69c1('0x17')](respondWithResult(_0x3b6b21,0xc9))[_0x69c1('0x1f')](handleError(_0x3b6b21,null));};exports[_0x69c1('0x29')]=function(_0x2def21,_0x14e8f2,_0x748de0){var _0xf3e253;return db['sequelize'][_0x69c1('0x4f')](function(_0xef9e61){return db[_0x69c1('0x44')]['find']({'where':{'id':_0x2def21['params']['id']}})[_0x69c1('0x17')](handleEntityNotFound(_0x14e8f2,null))['then'](saveUpdates(_0x2def21[_0x69c1('0x50')],null))[_0x69c1('0x17')](function(_0x349c66){if(_0x349c66){_0xf3e253=_0x349c66;return db[_0x69c1('0x44')][_0x69c1('0x46')]({'where':{'type':_0xf3e253[_0x69c1('0x41')]},'raw':!![]});}return null;})[_0x69c1('0x17')](function(_0x302670){if(_0xf3e253[_0x69c1('0x41')][_0x69c1('0x5c')]()==_0x69c1('0x51')){var _0x18ef00=fs[_0x69c1('0x52')](path[_0x69c1('0x53')](config[_0x69c1('0x54')],_0x69c1('0x55')),'utf8');var _0x25ce8e=ejs[_0x69c1('0x57')](_0x18ef00,{'networks':_0x302670||[]});fs[_0x69c1('0x58')]('/etc/asterisk/stun_xcally.conf',_0x25ce8e);return respondWithRpcPromise(_0x69c1('0x5a'),_0x69c1('0x29'),{'module':_0x69c1('0x5b')});}else if(_0xf3e253[_0x69c1('0x41')][_0x69c1('0x5c')]()==_0x69c1('0x5d')){var _0x1fb9f6=fs[_0x69c1('0x52')](path[_0x69c1('0x53')](config['root'],_0x69c1('0x5e')),_0x69c1('0x56'));var _0x29c8b8=ejs[_0x69c1('0x57')](_0x1fb9f6,{'networks':_0x302670||[]});fs[_0x69c1('0x58')](_0x69c1('0x5f'),_0x29c8b8);return respondWithRpcPromise('Reload',_0x69c1('0x29'),{'module':_0x69c1('0x5b')});}else{var _0x2e0b12=fs[_0x69c1('0x52')](path['join'](config[_0x69c1('0x54')],_0x69c1('0x63')),'utf8');var _0xe27e19=ejs[_0x69c1('0x57')](_0x2e0b12,{'networks':_0x302670||[]});fs[_0x69c1('0x58')](util[_0x69c1('0x64')](_0x69c1('0x60'),_0x2def21[_0x69c1('0x50')]['type'][_0x69c1('0x61')]()),_0xe27e19);return respondWithRpcPromise(_0x69c1('0x5a'),_0x69c1('0x29'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2d33dd){if(_0x2d33dd){return _0xf3e253;}return null;});})[_0x69c1('0x17')](respondWithResult(_0x14e8f2,null))[_0x69c1('0x1f')](handleError(_0x14e8f2,null));};exports[_0x69c1('0x2a')]=function(_0x3c42e2,_0x1550a4,_0x512a87){var _0x29ea02;return db[_0x69c1('0x44')][_0x69c1('0x4d')]({'where':{'id':_0x3c42e2[_0x69c1('0x49')]['id']}})[_0x69c1('0x17')](function(_0x904443){_0x29ea02=_0x904443;return _0x904443;})['then'](handleEntityNotFound(_0x1550a4,null))[_0x69c1('0x17')](removeEntity(_0x1550a4,null))[_0x69c1('0x17')](function(){if(_0x29ea02){return db[_0x69c1('0x44')][_0x69c1('0x46')]({'where':{'type':_0x29ea02['type']},'raw':!![]});}})[_0x69c1('0x17')](function(_0xcd4500){if(_0x29ea02[_0x69c1('0x41')]['toUpperCase']()=='STUN'){var _0x24d42d=fs['readFileSync'](path[_0x69c1('0x53')](config[_0x69c1('0x54')],_0x69c1('0x55')),_0x69c1('0x56'));var _0x269a1b=ejs[_0x69c1('0x57')](_0x24d42d,{'networks':_0xcd4500||[]});fs[_0x69c1('0x58')]('/etc/asterisk/stun_xcally.conf',_0x269a1b);return respondWithRpcPromise('Reload',_0x69c1('0x2a'),{'module':_0x69c1('0x5b')});}else if(_0x29ea02['type'][_0x69c1('0x5c')]()==_0x69c1('0x5d')){var _0x4ac9b2=fs[_0x69c1('0x52')](path[_0x69c1('0x53')](config['root'],_0x69c1('0x5e')),_0x69c1('0x56'));var _0x230949=ejs['render'](_0x4ac9b2,{'networks':_0xcd4500||[]});fs['writeFileSync'](_0x69c1('0x5f'),_0x230949);return respondWithRpcPromise('Reload',_0x69c1('0x2a'),{'module':_0x69c1('0x5b')});}else{var _0x1d70a2=fs[_0x69c1('0x52')](path[_0x69c1('0x53')](config[_0x69c1('0x54')],_0x69c1('0x63')),'utf8');var _0x4d62c2=ejs[_0x69c1('0x57')](_0x1d70a2,{'networks':_0xcd4500||[]});fs[_0x69c1('0x58')](util[_0x69c1('0x64')](_0x69c1('0x60'),_0x3c42e2[_0x69c1('0x50')][_0x69c1('0x41')]['toLowerCase']()),_0x4d62c2);return respondWithRpcPromise(_0x69c1('0x5a'),_0x69c1('0x2a'),{'module':_0x69c1('0x62')});}return null;})[_0x69c1('0x1f')](handleError(_0x1550a4,null));}; \ No newline at end of file +var _0x289b=['Network','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','catch','params','length','include','find','create','sequelize','toUpperCase','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','readFileSync','server/files/templates/turn_multiple.ejs','render','Reload','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','transaction','body','STUN','res_stun_monitor.so','TURN','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','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/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','sendStatus','stack','name','send','index','map'];(function(_0x56989c,_0x6781f0){var _0x22ab27=function(_0x390034){while(--_0x390034){_0x56989c['push'](_0x56989c['shift']());}};_0x22ab27(++_0x6781f0);}(_0x289b,0x114));var _0xb289=function(_0x4ea728,_0x3ba8a8){_0x4ea728=_0x4ea728-0x0;var _0x290764=_0x289b[_0x4ea728];return _0x290764;};'use strict';var emlformat=require(_0xb289('0x0'));var rimraf=require(_0xb289('0x1'));var zipdir=require(_0xb289('0x2'));var jsonpatch=require(_0xb289('0x3'));var rp=require(_0xb289('0x4'));var moment=require(_0xb289('0x5'));var BPromise=require(_0xb289('0x6'));var Mustache=require(_0xb289('0x7'));var util=require(_0xb289('0x8'));var path=require(_0xb289('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb289('0xa'));var fs=require('fs');var fs_extra=require(_0xb289('0xb'));var _=require(_0xb289('0xc'));var squel=require(_0xb289('0xd'));var crypto=require('crypto');var jsforce=require(_0xb289('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb289('0xf'));var querystring=require(_0xb289('0x10'));var Papa=require(_0xb289('0x11'));var Redis=require(_0xb289('0x12'));var authService=require(_0xb289('0x13'));var qs=require(_0xb289('0x14'));var as=require(_0xb289('0x15'));var hardwareService=require(_0xb289('0x16'));var logger=require(_0xb289('0x17'))(_0xb289('0x18'));var utils=require(_0xb289('0x19'));var config=require(_0xb289('0x1a'));var licenseUtil=require(_0xb289('0x1b'));var db=require(_0xb289('0x1c'))['db'];var jayson=require(_0xb289('0x1d'));var client=jayson[_0xb289('0x1e')][_0xb289('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3c30a9,_0xfec075,_0x500421,_0x3451b8){return new BPromise(function(_0x3d837c,_0x561b17){var _0x30d5c4=_0x3451b8||client;return _0x30d5c4[_0xb289('0x20')](_0x3c30a9,_0x500421)[_0xb289('0x21')](function(_0x1803a6){logger[_0xb289('0x22')]('Network,\x20%s,\x20%s',_0xfec075,_0xb289('0x23'));logger['debug'](_0xb289('0x24'),_0xfec075,'request\x20sent',JSON[_0xb289('0x25')](_0x1803a6));if(_0x1803a6['error']){if(_0x1803a6[_0xb289('0x26')][_0xb289('0x27')]===0x1f4){logger[_0xb289('0x26')](_0xb289('0x28'),_0xfec075,_0x1803a6[_0xb289('0x26')][_0xb289('0x29')]);return _0x561b17(_0x1803a6[_0xb289('0x26')][_0xb289('0x29')]);}logger[_0xb289('0x26')]('Network,\x20%s,\x20%s',_0xfec075,_0x1803a6['error'][_0xb289('0x29')]);return _0x3d837c(_0x1803a6['error']['message']);}else{logger[_0xb289('0x22')](_0xb289('0x28'),_0xfec075,_0xb289('0x23'));_0x3d837c(_0x1803a6[_0xb289('0x2a')][_0xb289('0x29')]);}})['catch'](function(_0x1eb23c){logger[_0xb289('0x26')](_0xb289('0x28'),_0xfec075,_0x1eb23c);_0x561b17(_0x1eb23c);});});}function respondWithStatusCode(_0x2913b2,_0x484300){_0x484300=_0x484300||0xcc;return function(_0x5100a0){if(_0x5100a0){return _0x2913b2['sendStatus'](_0x484300);}return _0x2913b2[_0xb289('0x2b')](_0x484300)[_0xb289('0x2c')]();};}function respondWithResult(_0x50ec5a,_0x3af8fe){_0x3af8fe=_0x3af8fe||0xc8;return function(_0x4559cc){if(_0x4559cc){return _0x50ec5a[_0xb289('0x2b')](_0x3af8fe)[_0xb289('0x2d')](_0x4559cc);}};}function respondWithFilteredResult(_0x495407,_0x3a5676){return function(_0x5750fd){if(_0x5750fd){var _0x5ef1c9=_0x5750fd[_0xb289('0x2e')],_0x556a5f=_0x3a5676['offset'],_0x8647d1=_0x3a5676[_0xb289('0x2f')]+_0x3a5676[_0xb289('0x30')],_0x3d4ed3;if(_0x8647d1>=_0x5ef1c9){_0x8647d1=_0x5ef1c9;_0x3d4ed3=0xc8;}else{_0x3d4ed3=0xce;}_0x495407[_0xb289('0x2b')](_0x3d4ed3);return _0x495407[_0xb289('0x31')](_0xb289('0x32'),_0x556a5f+'-'+_0x8647d1+'/'+_0x5ef1c9)[_0xb289('0x2d')](_0x5750fd);}return null;};}function patchUpdates(_0x591659){return function(_0x2af2d8){try{jsonpatch[_0xb289('0x33')](_0x2af2d8,_0x591659,!![]);}catch(_0x4b5aff){return BPromise['reject'](_0x4b5aff);}return _0x2af2d8[_0xb289('0x34')]();};}function saveUpdates(_0x4dc822,_0x423391){return function(_0x4720dd){if(_0x4720dd){return _0x4720dd[_0xb289('0x35')](_0x4dc822)[_0xb289('0x21')](function(_0x1adc21){return _0x1adc21;});}return null;};}function removeEntity(_0xfff3ec,_0xbe66b9){return function(_0x6fb961){if(_0x6fb961){return _0x6fb961['destroy']()[_0xb289('0x21')](function(){_0xfff3ec[_0xb289('0x2b')](0xcc)[_0xb289('0x2c')]();});}};}function handleEntityNotFound(_0x943eac,_0x357b33){return function(_0x162482){if(!_0x162482){_0x943eac[_0xb289('0x36')](0x194);}return _0x162482;};}function handleError(_0x47aa08,_0x4fd8ba){_0x4fd8ba=_0x4fd8ba||0x1f4;return function(_0x5bad90){logger[_0xb289('0x26')](_0x5bad90[_0xb289('0x37')]);if(_0x5bad90[_0xb289('0x38')]){delete _0x5bad90[_0xb289('0x38')];}_0x47aa08[_0xb289('0x2b')](_0x4fd8ba)[_0xb289('0x39')](_0x5bad90);};}exports[_0xb289('0x3a')]=function(_0x5c50b4,_0x177730){var _0x40f3bf={},_0x1dbd91={},_0x17ec5a={'count':0x0,'rows':[]};var _0x4b8bc3=_[_0xb289('0x3b')](db[_0xb289('0x3c')][_0xb289('0x3d')],function(_0x1f0304){return{'name':_0x1f0304[_0xb289('0x3e')],'type':_0x1f0304[_0xb289('0x3f')][_0xb289('0x40')]};});_0x1dbd91[_0xb289('0x41')]=_[_0xb289('0x3b')](_0x4b8bc3,'name');_0x1dbd91[_0xb289('0x42')]=_[_0xb289('0x43')](_0x5c50b4['query']);_0x1dbd91[_0xb289('0x44')]=_['intersection'](_0x1dbd91[_0xb289('0x41')],_0x1dbd91[_0xb289('0x42')]);_0x40f3bf[_0xb289('0x45')]=_['intersection'](_0x1dbd91[_0xb289('0x41')],qs[_0xb289('0x46')](_0x5c50b4[_0xb289('0x42')]['fields']));_0x40f3bf[_0xb289('0x45')]=_0x40f3bf[_0xb289('0x45')]['length']?_0x40f3bf[_0xb289('0x45')]:_0x1dbd91['model'];if(!_0x5c50b4[_0xb289('0x42')][_0xb289('0x47')]('nolimit')){_0x40f3bf[_0xb289('0x30')]=qs['limit'](_0x5c50b4[_0xb289('0x42')]['limit']);_0x40f3bf['offset']=qs['offset'](_0x5c50b4['query'][_0xb289('0x2f')]);}_0x40f3bf[_0xb289('0x48')]=qs[_0xb289('0x49')](_0x5c50b4[_0xb289('0x42')][_0xb289('0x49')]);_0x40f3bf['where']=qs[_0xb289('0x44')](_[_0xb289('0x4a')](_0x5c50b4['query'],_0x1dbd91['filters']),_0x4b8bc3);if(_0x5c50b4[_0xb289('0x42')][_0xb289('0x4b')]){_0x40f3bf['where']=_['merge'](_0x40f3bf[_0xb289('0x4c')],{'$or':_[_0xb289('0x3b')](_0x4b8bc3,function(_0x76cdf9){if(_0x76cdf9['type']!==_0xb289('0x4d')){var _0x3b6801={};_0x3b6801[_0x76cdf9[_0xb289('0x38')]]={'$like':'%'+_0x5c50b4[_0xb289('0x42')][_0xb289('0x4b')]+'%'};return _0x3b6801;}})});}_0x40f3bf=_[_0xb289('0x4e')]({},_0x40f3bf,_0x5c50b4[_0xb289('0x4f')]);var _0xc80892={'where':_0x40f3bf[_0xb289('0x4c')]};return db[_0xb289('0x3c')][_0xb289('0x2e')](_0xc80892)[_0xb289('0x21')](function(_0x47a996){_0x17ec5a[_0xb289('0x2e')]=_0x47a996;if(_0x5c50b4[_0xb289('0x42')][_0xb289('0x50')]){_0x40f3bf['include']=[{'all':!![]}];}return db[_0xb289('0x3c')][_0xb289('0x51')](_0x40f3bf);})[_0xb289('0x21')](function(_0x46f382){_0x17ec5a['rows']=_0x46f382;return _0x17ec5a;})['then'](respondWithFilteredResult(_0x177730,_0x40f3bf))[_0xb289('0x52')](handleError(_0x177730,null));};exports['show']=function(_0x52f6f4,_0x2cc2da){var _0x200261={'raw':!![],'where':{'id':_0x52f6f4[_0xb289('0x53')]['id']}},_0x379950={};_0x379950[_0xb289('0x41')]=_[_0xb289('0x43')](db['Network'][_0xb289('0x3d')]);_0x379950[_0xb289('0x42')]=_[_0xb289('0x43')](_0x52f6f4['query']);_0x379950['filters']=_['intersection'](_0x379950[_0xb289('0x41')],_0x379950[_0xb289('0x42')]);_0x200261[_0xb289('0x45')]=_['intersection'](_0x379950[_0xb289('0x41')],qs[_0xb289('0x46')](_0x52f6f4[_0xb289('0x42')][_0xb289('0x46')]));_0x200261['attributes']=_0x200261['attributes'][_0xb289('0x54')]?_0x200261['attributes']:_0x379950[_0xb289('0x41')];if(_0x52f6f4[_0xb289('0x42')][_0xb289('0x50')]){_0x200261[_0xb289('0x55')]=[{'all':!![]}];}_0x200261=_[_0xb289('0x4e')]({},_0x200261,_0x52f6f4[_0xb289('0x4f')]);return db['Network'][_0xb289('0x56')](_0x200261)[_0xb289('0x21')](handleEntityNotFound(_0x2cc2da,null))[_0xb289('0x21')](respondWithResult(_0x2cc2da,null))[_0xb289('0x52')](handleError(_0x2cc2da,null));};exports[_0xb289('0x57')]=function(_0x17a239,_0x2f8382,_0x252e26){var _0x363bdd;return db[_0xb289('0x58')]['transaction'](function(_0x2ec0f5){return db[_0xb289('0x3c')][_0xb289('0x57')](_0x17a239['body'],{'raw':!![]})[_0xb289('0x21')](function(_0x5bc0ac){_0x363bdd=_0x5bc0ac;return db[_0xb289('0x3c')][_0xb289('0x51')]({'where':{'type':_0x17a239['body']['type']},'raw':!![]});})[_0xb289('0x21')](function(_0x458b8f){if(_0x363bdd[_0xb289('0x3f')][_0xb289('0x59')]()=='STUN'){var _0x82d83b=fs['readFileSync'](path[_0xb289('0x5a')](config[_0xb289('0x5b')],_0xb289('0x5c')),_0xb289('0x5d'));var _0x554bb7=ejs['render'](_0x82d83b,{'networks':_0x458b8f||[]});fs[_0xb289('0x5e')](_0xb289('0x5f'),_0x554bb7);return respondWithRpcPromise('Reload',_0xb289('0x57'),{'module':'res_stun_monitor.so'});}else if(_0x363bdd[_0xb289('0x3f')][_0xb289('0x59')]()=='TURN'){var _0x25b788=fs[_0xb289('0x60')](path[_0xb289('0x5a')](config[_0xb289('0x5b')],_0xb289('0x61')),_0xb289('0x5d'));var _0x915747=ejs[_0xb289('0x62')](_0x25b788,{'networks':_0x458b8f||[]});fs[_0xb289('0x5e')]('/etc/asterisk/turn_xcally.conf',_0x915747);return respondWithRpcPromise(_0xb289('0x63'),_0xb289('0x57'),{'module':'res_stun_monitor.so'});}else{var _0x43f1fa=fs[_0xb289('0x60')](path[_0xb289('0x5a')](config['root'],'server/files/templates/network.ejs'),_0xb289('0x5d'));var _0x175760=ejs[_0xb289('0x62')](_0x43f1fa,{'networks':_0x458b8f||[]});fs[_0xb289('0x5e')](util[_0xb289('0x64')](_0xb289('0x65'),_0x17a239['body'][_0xb289('0x3f')][_0xb289('0x66')]()),_0x175760);return respondWithRpcPromise('Reload',_0xb289('0x57'),{'module':_0xb289('0x67')});}return null;})[_0xb289('0x21')](function(){return _0x363bdd;});})[_0xb289('0x21')](respondWithResult(_0x2f8382,0xc9))[_0xb289('0x52')](handleError(_0x2f8382,null));};exports[_0xb289('0x35')]=function(_0x1589bc,_0x2cd1ee,_0x3902d0){var _0x59e2af;return db['sequelize'][_0xb289('0x68')](function(_0x36ac2c){return db['Network'][_0xb289('0x56')]({'where':{'id':_0x1589bc[_0xb289('0x53')]['id']}})[_0xb289('0x21')](handleEntityNotFound(_0x2cd1ee,null))['then'](saveUpdates(_0x1589bc[_0xb289('0x69')],null))[_0xb289('0x21')](function(_0x5d2917){if(_0x5d2917){_0x59e2af=_0x5d2917;return db[_0xb289('0x3c')][_0xb289('0x51')]({'where':{'type':_0x59e2af['type']},'raw':!![]});}return null;})[_0xb289('0x21')](function(_0x22df1c){if(_0x59e2af[_0xb289('0x3f')]['toUpperCase']()==_0xb289('0x6a')){var _0x5dbc8e=fs[_0xb289('0x60')](path[_0xb289('0x5a')](config[_0xb289('0x5b')],_0xb289('0x5c')),_0xb289('0x5d'));var _0x534f0d=ejs['render'](_0x5dbc8e,{'networks':_0x22df1c||[]});fs[_0xb289('0x5e')](_0xb289('0x5f'),_0x534f0d);return respondWithRpcPromise(_0xb289('0x63'),_0xb289('0x35'),{'module':_0xb289('0x6b')});}else if(_0x59e2af[_0xb289('0x3f')]['toUpperCase']()==_0xb289('0x6c')){var _0x3030d2=fs[_0xb289('0x60')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0xb289('0x5d'));var _0x5bb87c=ejs['render'](_0x3030d2,{'networks':_0x22df1c||[]});fs[_0xb289('0x5e')](_0xb289('0x6d'),_0x5bb87c);return respondWithRpcPromise(_0xb289('0x63'),_0xb289('0x35'),{'module':'res_stun_monitor.so'});}else{var _0x26fd88=fs['readFileSync'](path[_0xb289('0x5a')](config[_0xb289('0x5b')],_0xb289('0x6e')),_0xb289('0x5d'));var _0x422c0a=ejs[_0xb289('0x62')](_0x26fd88,{'networks':_0x22df1c||[]});fs[_0xb289('0x5e')](util[_0xb289('0x64')](_0xb289('0x65'),_0x1589bc[_0xb289('0x69')][_0xb289('0x3f')][_0xb289('0x66')]()),_0x422c0a);return respondWithRpcPromise(_0xb289('0x63'),_0xb289('0x35'),{'module':_0xb289('0x67')});}return null;})['then'](function(_0x7eb94e){if(_0x7eb94e){return _0x59e2af;}return null;});})[_0xb289('0x21')](respondWithResult(_0x2cd1ee,null))[_0xb289('0x52')](handleError(_0x2cd1ee,null));};exports['destroy']=function(_0x59059d,_0x3b2fd5,_0x268ff0){var _0x169e1f;return db[_0xb289('0x3c')][_0xb289('0x56')]({'where':{'id':_0x59059d[_0xb289('0x53')]['id']}})[_0xb289('0x21')](function(_0x5a1118){_0x169e1f=_0x5a1118;return _0x5a1118;})[_0xb289('0x21')](handleEntityNotFound(_0x3b2fd5,null))[_0xb289('0x21')](removeEntity(_0x3b2fd5,null))[_0xb289('0x21')](function(){if(_0x169e1f){return db[_0xb289('0x3c')]['findAll']({'where':{'type':_0x169e1f[_0xb289('0x3f')]},'raw':!![]});}})['then'](function(_0xa06643){if(_0x169e1f[_0xb289('0x3f')]['toUpperCase']()==_0xb289('0x6a')){var _0x778fd8=fs['readFileSync'](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0xb289('0x5d'));var _0x5d5448=ejs['render'](_0x778fd8,{'networks':_0xa06643||[]});fs[_0xb289('0x5e')](_0xb289('0x5f'),_0x5d5448);return respondWithRpcPromise('Reload',_0xb289('0x6f'),{'module':'res_stun_monitor.so'});}else if(_0x169e1f[_0xb289('0x3f')]['toUpperCase']()==_0xb289('0x6c')){var _0x4e547f=fs[_0xb289('0x60')](path[_0xb289('0x5a')](config[_0xb289('0x5b')],_0xb289('0x61')),'utf8');var _0x31fd05=ejs[_0xb289('0x62')](_0x4e547f,{'networks':_0xa06643||[]});fs[_0xb289('0x5e')](_0xb289('0x6d'),_0x31fd05);return respondWithRpcPromise(_0xb289('0x63'),_0xb289('0x6f'),{'module':_0xb289('0x6b')});}else{var _0x565787=fs['readFileSync'](path[_0xb289('0x5a')](config[_0xb289('0x5b')],_0xb289('0x6e')),'utf8');var _0x56e7ca=ejs['render'](_0x565787,{'networks':_0xa06643||[]});fs[_0xb289('0x5e')](util[_0xb289('0x64')](_0xb289('0x65'),_0x59059d[_0xb289('0x69')][_0xb289('0x3f')][_0xb289('0x66')]()),_0x56e7ca);return respondWithRpcPromise(_0xb289('0x63'),_0xb289('0x6f'),{'module':_0xb289('0x67')});}return null;})[_0xb289('0x52')](handleError(_0x3b2fd5,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f9632a7..7d7fee4 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 _0xc701=['network','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./network.attributes','define'];(function(_0x304c47,_0x4e0e20){var _0x2dbd2c=function(_0x4f7049){while(--_0x4f7049){_0x304c47['push'](_0x304c47['shift']());}};_0x2dbd2c(++_0x4e0e20);}(_0xc701,0xab));var _0x1c70=function(_0x1cb73e,_0xce62f4){_0x1cb73e=_0x1cb73e-0x0;var _0x5c1e4c=_0xc701[_0x1cb73e];return _0x5c1e4c;};'use strict';var _=require(_0x1c70('0x0'));var util=require(_0x1c70('0x1'));var logger=require(_0x1c70('0x2'))('api');var moment=require(_0x1c70('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c70('0x4'));var rimraf=require(_0x1c70('0x5'));var config=require(_0x1c70('0x6'));var attributes=require(_0x1c70('0x7'));module['exports']=function(_0x474355,_0xa3c1cf){return _0x474355[_0x1c70('0x8')]('Network',attributes,{'tableName':_0x1c70('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f22=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','Network','network','lodash'];(function(_0x176397,_0x5c4aaf){var _0x1bca5a=function(_0x2fc0dd){while(--_0x2fc0dd){_0x176397['push'](_0x176397['shift']());}};_0x1bca5a(++_0x5c4aaf);}(_0x2f22,0xb5));var _0x22f2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2f22[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x22f2('0x0'));var util=require(_0x22f2('0x1'));var logger=require(_0x22f2('0x2'))(_0x22f2('0x3'));var moment=require(_0x22f2('0x4'));var BPromise=require(_0x22f2('0x5'));var rp=require(_0x22f2('0x6'));var fs=require('fs');var path=require(_0x22f2('0x7'));var rimraf=require(_0x22f2('0x8'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0x22f2('0x9')]=function(_0x52560c,_0x33cf58){return _0x52560c[_0x22f2('0xa')](_0x22f2('0xb'),attributes,{'tableName':_0x22f2('0xc'),'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 4d04ad7..b33f859 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 _0x5fe4=['request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x58d719,_0x44d73d){var _0x206009=function(_0xe4116f){while(--_0xe4116f){_0x58d719['push'](_0x58d719['shift']());}};_0x206009(++_0x44d73d);}(_0x5fe4,0x80));var _0x45fe=function(_0x5618ac,_0x31705b){_0x5618ac=_0x5618ac-0x0;var _0x969bd3=_0x5fe4[_0x5618ac];return _0x969bd3;};'use strict';var _=require(_0x45fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x45fe('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45fe('0x2'));var db=require(_0x45fe('0x3'))['db'];var utils=require(_0x45fe('0x4'));var logger=require(_0x45fe('0x5'))(_0x45fe('0x6'));var config=require(_0x45fe('0x7'));var jayson=require(_0x45fe('0x8'));var client=jayson['client'][_0x45fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cf8dc,_0x1e314d,_0x331e20){return new BPromise(function(_0x8afb28,_0x1f2d6b){return client[_0x45fe('0xa')](_0x2cf8dc,_0x331e20)[_0x45fe('0xb')](function(_0xb41ca8){logger['info'](_0x45fe('0xc'),_0x1e314d,_0x45fe('0xd'));logger[_0x45fe('0xe')](_0x45fe('0xf'),_0x1e314d,_0x45fe('0xd'),JSON[_0x45fe('0x10')](_0xb41ca8));if(_0xb41ca8[_0x45fe('0x11')]){if(_0xb41ca8[_0x45fe('0x11')][_0x45fe('0x12')]===0x1f4){logger['error'](_0x45fe('0xc'),_0x1e314d,_0xb41ca8[_0x45fe('0x11')][_0x45fe('0x13')]);return _0x1f2d6b(_0xb41ca8[_0x45fe('0x11')][_0x45fe('0x13')]);}logger[_0x45fe('0x11')]('Network,\x20%s,\x20%s',_0x1e314d,_0xb41ca8[_0x45fe('0x11')]['message']);return _0x8afb28(_0xb41ca8['error']['message']);}else{logger[_0x45fe('0x14')]('Network,\x20%s,\x20%s',_0x1e314d,_0x45fe('0xd'));_0x8afb28(_0xb41ca8[_0x45fe('0x15')][_0x45fe('0x13')]);}})[_0x45fe('0x16')](function(_0x472c6d){logger[_0x45fe('0x11')](_0x45fe('0xc'),_0x1e314d,_0x472c6d);_0x1f2d6b(_0x472c6d);});});} \ No newline at end of file +var _0xf526=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','stringify','error','Network,\x20%s,\x20%s','message','result'];(function(_0x22327e,_0x19a584){var _0x35df53=function(_0x215495){while(--_0x215495){_0x22327e['push'](_0x22327e['shift']());}};_0x35df53(++_0x19a584);}(_0xf526,0x190));var _0x6f52=function(_0x3ca81a,_0x45dbec){_0x3ca81a=_0x3ca81a-0x0;var _0x45a6d3=_0xf526[_0x3ca81a];return _0x45a6d3;};'use strict';var _=require('lodash');var util=require(_0x6f52('0x0'));var moment=require(_0x6f52('0x1'));var BPromise=require(_0x6f52('0x2'));var rs=require(_0x6f52('0x3'));var fs=require('fs');var Redis=require(_0x6f52('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f52('0x5'));var logger=require('../../config/logger')(_0x6f52('0x6'));var config=require(_0x6f52('0x7'));var jayson=require(_0x6f52('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x395e64,_0x4c2067,_0x974254){return new BPromise(function(_0xf9ec25,_0x348261){return client[_0x6f52('0x9')](_0x395e64,_0x974254)[_0x6f52('0xa')](function(_0x148ab2){logger[_0x6f52('0xb')]('Network,\x20%s,\x20%s',_0x4c2067,_0x6f52('0xc'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x4c2067,'request\x20sent',JSON[_0x6f52('0xd')](_0x148ab2));if(_0x148ab2[_0x6f52('0xe')]){if(_0x148ab2['error']['code']===0x1f4){logger[_0x6f52('0xe')](_0x6f52('0xf'),_0x4c2067,_0x148ab2[_0x6f52('0xe')]['message']);return _0x348261(_0x148ab2[_0x6f52('0xe')][_0x6f52('0x10')]);}logger[_0x6f52('0xe')](_0x6f52('0xf'),_0x4c2067,_0x148ab2[_0x6f52('0xe')][_0x6f52('0x10')]);return _0xf9ec25(_0x148ab2[_0x6f52('0xe')]['message']);}else{logger['info'](_0x6f52('0xf'),_0x4c2067,_0x6f52('0xc'));_0xf9ec25(_0x148ab2[_0x6f52('0x11')]['message']);}})[_0x6f52('0x12')](function(_0x44751d){logger[_0x6f52('0xe')](_0x6f52('0xf'),_0x4c2067,_0x44751d);_0x348261(_0x44751d);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index e822164..acd30e2 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 _0xe14b=['/:id/notify','notify','addApplications','/:id/send','send','put','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addAnswer'];(function(_0x482916,_0x10e7a6){var _0x31c0db=function(_0x19b399){while(--_0x19b399){_0x482916['push'](_0x482916['shift']());}};_0x31c0db(++_0x10e7a6);}(_0xe14b,0x93));var _0xbe14=function(_0x51438a,_0x1b697f){_0x51438a=_0x51438a-0x0;var _0x2929a0=_0xe14b[_0x51438a];return _0x2929a0;};'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['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller['addDisposition']);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router[_0xbe14('0x15')](_0xbe14('0x17'),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x19')]);router[_0xbe14('0x15')](_0xbe14('0x12'),auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x15')](_0xbe14('0x1a'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router[_0xbe14('0x1c')]('/:id',auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x1d')]('/:id',auth[_0xbe14('0x7')](),controller['destroy']);router[_0xbe14('0x1d')](_0xbe14('0xb'),auth['isAuthenticated'](),controller[_0xbe14('0x1e')]);router['delete'](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0x1f')]);router[_0xbe14('0x1d')](_0xbe14('0x12'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x20')]);module[_0xbe14('0x21')]=router; \ No newline at end of file +var _0x8ef6=['get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','post','create','addDisposition','/:id/notify','notify','addApplications','addAgents','send','update','destroy','delete','removeDispositions','removeAnswers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller'];(function(_0x21b397,_0x85760f){var _0x57918e=function(_0x381552){while(--_0x381552){_0x21b397['push'](_0x21b397['shift']());}};_0x57918e(++_0x85760f);}(_0x8ef6,0xf2));var _0x68ef=function(_0x122684,_0x2025e6){_0x122684=_0x122684-0x0;var _0x4cfdb3=_0x8ef6[_0x122684];return _0x4cfdb3;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),auth[_0x68ef('0xc')](),controller['getAgents']);router[_0x68ef('0x17')]('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x18')]);router['post'](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router[_0x68ef('0x17')]('/:id/canned_answers',auth[_0x68ef('0xc')](),controller['addAnswer']);router['post'](_0x68ef('0x1a'),controller[_0x68ef('0x1b')]);router['post']('/:id/applications',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1c')]);router[_0x68ef('0x17')]('/:id/users',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router[_0x68ef('0x17')]('/:id/send',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1e')]);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x1f')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x68ef('0x20')]);router[_0x68ef('0x21')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x22')]);router[_0x68ef('0x21')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x21')]('/:id/users',auth[_0x68ef('0xc')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 2e0f668..fbdb8b3 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 _0x8f99=['STRING','name','generate','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x35488b,_0x21f49e){var _0x346af5=function(_0x5ee26d){while(--_0x5ee26d){_0x35488b['push'](_0x35488b['shift']());}};_0x346af5(++_0x21f49e);}(_0x8f99,0x106));var _0x98f9=function(_0x58ef5a,_0xd9b4a6){_0x58ef5a=_0x58ef5a-0x0;var _0x22769a=_0x8f99[_0x58ef5a];return _0x22769a;};'use strict';var Sequelize=require(_0x98f9('0x0'));var rs=require(_0x98f9('0x1'));module['exports']={'name':{'type':Sequelize[_0x98f9('0x2')],'unique':_0x98f9('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x98f9('0x2')]},'token':{'type':Sequelize[_0x98f9('0x2')],'defaultValue':function(){return rs[_0x98f9('0x4')]();}},'replyUri':{'type':Sequelize[_0x98f9('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x98f9('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x98f9('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x98f9('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x98f9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x98f9('0x2')]},'queueTransfer':{'type':Sequelize[_0x98f9('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x98f9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x98f9('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x98f9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x98f9('0x6')],'defaultValue':![],'comment':_0x98f9('0x8'),'set':function(_0x222732){if(!_0x222732)this[_0x98f9('0x9')]('mandatoryDispositionPauseId',null);this[_0x98f9('0x9')](_0x98f9('0xa'),_0x222732);}}}; \ No newline at end of file +var _0x5533=['exports','STRING','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0x3bc158,_0x436e3a){var _0x977671=function(_0xa675fa){while(--_0xa675fa){_0x3bc158['push'](_0x3bc158['shift']());}};_0x977671(++_0x436e3a);}(_0x5533,0x1ae));var _0x3553=function(_0x5d7f7d,_0x4ce84f){_0x5d7f7d=_0x5d7f7d-0x0;var _0x1e7332=_0x5533[_0x5d7f7d];return _0x1e7332;};'use strict';var Sequelize=require(_0x3553('0x0'));var rs=require(_0x3553('0x1'));module[_0x3553('0x2')]={'name':{'type':Sequelize[_0x3553('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x3553('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x3553('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x3553('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3553('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3553('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x3553('0x3')]},'queueTransfer':{'type':Sequelize[_0x3553('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3553('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3553('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3553('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x3553('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x3553('0x5')],'defaultValue':![],'comment':_0x3553('0x8'),'set':function(_0x286461){if(!_0x286461)this[_0x3553('0x9')](_0x3553('0xa'),null);this['setDataValue'](_0x3553('0xb'),_0x286461);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 0cfb290..89f4dc9 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 _0x754c=['request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','destroy','get','OpenchannelAccounts','stack','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','mandatoryDispositionPause','intersection','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','findAll','ids','addAnswer','getAnswers','CannedAnswer','openchannel','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','List','CmContact','contact','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','waitForTheAssignedAgent','Start','startRouting','EventManager','notify','addApplications','sequelize','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','defaults','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','fs-extra','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','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x33be73,_0x59d750){var _0x2d1f91=function(_0x24f2e5){while(--_0x24f2e5){_0x33be73['push'](_0x33be73['shift']());}};_0x2d1f91(++_0x59d750);}(_0x754c,0x158));var _0xc754=function(_0x29a7ba,_0x32b384){_0x29a7ba=_0x29a7ba-0x0;var _0x306298=_0x754c[_0x29a7ba];return _0x306298;};'use strict';var emlformat=require(_0xc754('0x0'));var rimraf=require(_0xc754('0x1'));var zipdir=require(_0xc754('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc754('0x3'));var moment=require(_0xc754('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc754('0x5'));var util=require(_0xc754('0x6'));var path=require(_0xc754('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc754('0x8'));var fs=require('fs');var fs_extra=require(_0xc754('0x9'));var _=require(_0xc754('0xa'));var squel=require(_0xc754('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc754('0xc'));var toCsv=require(_0xc754('0xd'));var querystring=require(_0xc754('0xe'));var Papa=require(_0xc754('0xf'));var Redis=require(_0xc754('0x10'));var authService=require(_0xc754('0x11'));var qs=require(_0xc754('0x12'));var as=require(_0xc754('0x13'));var hardwareService=require(_0xc754('0x14'));var logger=require(_0xc754('0x15'))(_0xc754('0x16'));var utils=require(_0xc754('0x17'));var config=require(_0xc754('0x18'));var licenseUtil=require(_0xc754('0x19'));var db=require('../../mysqldb')['db'];config[_0xc754('0x1a')]=_['defaults'](config[_0xc754('0x1a')],{'host':_0xc754('0x1b'),'port':0x18eb});var socket=require(_0xc754('0x1c'))(new Redis(config[_0xc754('0x1a')]));require(_0xc754('0x1d'))['register'](socket);var jayson=require(_0xc754('0x1e'));var client=jayson[_0xc754('0x1f')][_0xc754('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5429c1,_0x303ed,_0xbc3131,_0x127386){return new BPromise(function(_0x5e3e95,_0x1c8ee6){var _0x21a36e=_0x127386||client;return _0x21a36e['request'](_0x5429c1,_0xbc3131)[_0xc754('0x21')](function(_0x48a696){logger[_0xc754('0x22')](_0xc754('0x23'),_0x303ed,_0xc754('0x24'));logger[_0xc754('0x25')](_0xc754('0x26'),_0x303ed,_0xc754('0x24'),JSON[_0xc754('0x27')](_0x48a696));if(_0x48a696['error']){if(_0x48a696[_0xc754('0x28')][_0xc754('0x29')]===0x1f4){logger[_0xc754('0x28')](_0xc754('0x23'),_0x303ed,_0x48a696[_0xc754('0x28')][_0xc754('0x2a')]);return _0x1c8ee6(_0x48a696['error'][_0xc754('0x2a')]);}logger[_0xc754('0x28')](_0xc754('0x23'),_0x303ed,_0x48a696[_0xc754('0x28')]['message']);return _0x5e3e95(_0x48a696[_0xc754('0x28')]['message']);}else{logger['info'](_0xc754('0x23'),_0x303ed,_0xc754('0x24'));_0x5e3e95(_0x48a696[_0xc754('0x2b')]['message']);}})[_0xc754('0x2c')](function(_0x2d1207){logger[_0xc754('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x303ed,_0x2d1207);_0x1c8ee6(_0x2d1207);});});}function respondWithStatusCode(_0x374e44,_0x21f466){_0x21f466=_0x21f466||0xcc;return function(_0x1e1f6e){if(_0x1e1f6e){return _0x374e44[_0xc754('0x2d')](_0x21f466);}return _0x374e44[_0xc754('0x2e')](_0x21f466)[_0xc754('0x2f')]();};}function respondWithResult(_0x367b9b,_0xca87d4){_0xca87d4=_0xca87d4||0xc8;return function(_0x37c948){if(_0x37c948){return _0x367b9b[_0xc754('0x2e')](_0xca87d4)[_0xc754('0x30')](_0x37c948);}};}function respondWithFilteredResult(_0x85ff0b,_0xaea8d7){return function(_0x531b41){if(_0x531b41){var _0xe3d4a9=_0x531b41[_0xc754('0x31')],_0x2697a4=_0xaea8d7[_0xc754('0x32')],_0x5cc16e=_0xaea8d7[_0xc754('0x32')]+_0xaea8d7[_0xc754('0x33')],_0x33351c;if(_0x5cc16e>=_0xe3d4a9){_0x5cc16e=_0xe3d4a9;_0x33351c=0xc8;}else{_0x33351c=0xce;}_0x85ff0b[_0xc754('0x2e')](_0x33351c);return _0x85ff0b[_0xc754('0x34')](_0xc754('0x35'),_0x2697a4+'-'+_0x5cc16e+'/'+_0xe3d4a9)[_0xc754('0x30')](_0x531b41);}return null;};}function patchUpdates(_0x27eeca){return function(_0x3d0814){try{jsonpatch[_0xc754('0x36')](_0x3d0814,_0x27eeca,!![]);}catch(_0x4cd388){return BPromise[_0xc754('0x37')](_0x4cd388);}return _0x3d0814['save']();};}function saveUpdates(_0x101b6b,_0x4d21e3){return function(_0x15cfcd){if(_0x15cfcd){return _0x15cfcd['update'](_0x101b6b)[_0xc754('0x21')](function(_0x3ec7aa){return _0x3ec7aa;});}return null;};}function removeEntity(_0x4841b5,_0x14e178){return function(_0x4d0f58){if(_0x4d0f58){return _0x4d0f58[_0xc754('0x38')]()[_0xc754('0x21')](function(){var _0x54ba72=_0x4d0f58[_0xc754('0x39')]({'plain':!![]});var _0x39562f=_0xc754('0x3a');return db['UserProfileResource'][_0xc754('0x38')]({'where':{'type':_0x39562f,'resourceId':_0x54ba72['id']}})[_0xc754('0x21')](function(){return _0x4d0f58;});})[_0xc754('0x21')](function(){_0x4841b5[_0xc754('0x2e')](0xcc)[_0xc754('0x2f')]();});}};}function handleEntityNotFound(_0x1d7da8,_0x38d486){return function(_0x2dd652){if(!_0x2dd652){_0x1d7da8['sendStatus'](0x194);}return _0x2dd652;};}function handleError(_0x59bfef,_0x547865){_0x547865=_0x547865||0x1f4;return function(_0x462e26){logger['error'](_0x462e26[_0xc754('0x3b')]);if(_0x462e26[_0xc754('0x3c')]){delete _0x462e26['name'];}_0x59bfef[_0xc754('0x2e')](_0x547865)[_0xc754('0x3d')](_0x462e26);};}exports[_0xc754('0x3e')]=function(_0x2d905c,_0x83019a){var _0x4e52b9={'include':[{'model':db[_0xc754('0x3f')],'as':'mandatoryDispositionPause'}]},_0x5e1256={},_0x550281={'count':0x0,'rows':[]};var _0x133315=_[_0xc754('0x40')](db[_0xc754('0x41')][_0xc754('0x42')],function(_0x2139d3){return{'name':_0x2139d3[_0xc754('0x43')],'type':_0x2139d3[_0xc754('0x44')][_0xc754('0x45')]};});_0x5e1256['model']=_['map'](_0x133315,_0xc754('0x3c'));_0x5e1256[_0xc754('0x46')]=_[_0xc754('0x47')](_0x2d905c[_0xc754('0x46')]);_0x5e1256[_0xc754('0x48')]=_['intersection'](_0x5e1256[_0xc754('0x49')],_0x5e1256['query']);_0x4e52b9[_0xc754('0x4a')]=_['intersection'](_0x5e1256[_0xc754('0x49')],qs[_0xc754('0x4b')](_0x2d905c[_0xc754('0x46')][_0xc754('0x4b')]));_0x4e52b9['attributes']=_0x4e52b9[_0xc754('0x4a')][_0xc754('0x4c')]?_0x4e52b9[_0xc754('0x4a')]:_0x5e1256[_0xc754('0x49')];if(!_0x2d905c[_0xc754('0x46')][_0xc754('0x4d')](_0xc754('0x4e'))){_0x4e52b9['limit']=qs[_0xc754('0x33')](_0x2d905c['query']['limit']);_0x4e52b9[_0xc754('0x32')]=qs['offset'](_0x2d905c[_0xc754('0x46')][_0xc754('0x32')]);}_0x4e52b9[_0xc754('0x4f')]=qs['sort'](_0x2d905c[_0xc754('0x46')][_0xc754('0x50')]);_0x4e52b9[_0xc754('0x51')]=qs[_0xc754('0x48')](_[_0xc754('0x52')](_0x2d905c[_0xc754('0x46')],_0x5e1256[_0xc754('0x48')]),_0x133315);if(_0x2d905c[_0xc754('0x46')]['filter']){_0x4e52b9[_0xc754('0x51')]=_[_0xc754('0x53')](_0x4e52b9['where'],{'$or':_['map'](_0x133315,function(_0x23ff67){if(_0x23ff67['type']!==_0xc754('0x54')){var _0x382def={};_0x382def[_0x23ff67[_0xc754('0x3c')]]={'$like':'%'+_0x2d905c[_0xc754('0x46')][_0xc754('0x55')]+'%'};return _0x382def;}})});}_0x4e52b9=_[_0xc754('0x53')]({},_0x4e52b9,_0x2d905c[_0xc754('0x56')]);var _0x338fe9={'where':_0x4e52b9[_0xc754('0x51')]};return db['OpenchannelAccount'][_0xc754('0x31')](_0x338fe9)[_0xc754('0x21')](function(_0x33ef31){_0x550281[_0xc754('0x31')]=_0x33ef31;if(_0x2d905c[_0xc754('0x46')][_0xc754('0x57')]){_0x4e52b9[_0xc754('0x58')]=[{'all':!![]}];}return db[_0xc754('0x41')]['findAll'](_0x4e52b9);})[_0xc754('0x21')](function(_0x5ac13d){_0x550281[_0xc754('0x59')]=_0x5ac13d;return _0x550281;})['then'](respondWithFilteredResult(_0x83019a,_0x4e52b9))[_0xc754('0x2c')](handleError(_0x83019a,null));};exports[_0xc754('0x5a')]=function(_0x1b596f,_0x18a919){var _0x2b00b9={'raw':![],'where':{'id':_0x1b596f[_0xc754('0x5b')]['id']},'include':[{'model':db[_0xc754('0x3f')],'as':_0xc754('0x5c')}]},_0xb298ef={};_0xb298ef['model']=_[_0xc754('0x47')](db['OpenchannelAccount'][_0xc754('0x42')]);_0xb298ef[_0xc754('0x46')]=_[_0xc754('0x47')](_0x1b596f[_0xc754('0x46')]);_0xb298ef['filters']=_['intersection'](_0xb298ef[_0xc754('0x49')],_0xb298ef['query']);_0x2b00b9['attributes']=_[_0xc754('0x5d')](_0xb298ef[_0xc754('0x49')],qs[_0xc754('0x4b')](_0x1b596f[_0xc754('0x46')][_0xc754('0x4b')]));_0x2b00b9[_0xc754('0x4a')]=_0x2b00b9[_0xc754('0x4a')][_0xc754('0x4c')]?_0x2b00b9['attributes']:_0xb298ef[_0xc754('0x49')];if(_0x1b596f[_0xc754('0x46')][_0xc754('0x57')]){_0x2b00b9[_0xc754('0x58')]=[{'all':!![]}];}_0x2b00b9=_['merge']({},_0x2b00b9,_0x1b596f[_0xc754('0x56')]);return db[_0xc754('0x41')][_0xc754('0x5e')](_0x2b00b9)[_0xc754('0x21')](handleEntityNotFound(_0x18a919,null))[_0xc754('0x21')](respondWithResult(_0x18a919,null))[_0xc754('0x2c')](handleError(_0x18a919,null));};exports[_0xc754('0x5f')]=function(_0x17d6c4,_0x583849){return db['OpenchannelAccount'][_0xc754('0x5f')](_0x17d6c4[_0xc754('0x60')],{})[_0xc754('0x21')](function(_0x202bf6){var _0x5c41e0=_0x17d6c4[_0xc754('0x61')][_0xc754('0x39')]({'plain':!![]});if(!_0x5c41e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c41e0[_0xc754('0x62')]===_0xc754('0x61')){var _0x16f2a6=_0x202bf6[_0xc754('0x39')]({'plain':!![]});var _0x4db22c=_0xc754('0x3a');return db[_0xc754('0x63')][_0xc754('0x5e')]({'where':{'name':_0x4db22c,'userProfileId':_0x5c41e0[_0xc754('0x64')]},'raw':!![]})['then'](function(_0x1b270b){if(_0x1b270b&&_0x1b270b[_0xc754('0x65')]===0x0){return db[_0xc754('0x66')][_0xc754('0x5f')]({'name':_0x16f2a6['name'],'resourceId':_0x16f2a6['id'],'type':_0x1b270b[_0xc754('0x3c')],'sectionId':_0x1b270b['id']},{})['then'](function(){return _0x202bf6;});}else{return _0x202bf6;}})['catch'](function(_0x20f07a){logger[_0xc754('0x28')](_0xc754('0x67'),_0x20f07a);throw _0x20f07a;});}return _0x202bf6;})['then'](respondWithResult(_0x583849,0xc9))['catch'](handleError(_0x583849,null));};exports[_0xc754('0x68')]=function(_0x357cf7,_0x16d56a){if(_0x357cf7[_0xc754('0x60')]['id']){delete _0x357cf7[_0xc754('0x60')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x357cf7['params']['id']},'include':[{'model':db[_0xc754('0x3f')],'as':_0xc754('0x5c')}]})[_0xc754('0x21')](handleEntityNotFound(_0x16d56a,null))[_0xc754('0x21')](saveUpdates(_0x357cf7[_0xc754('0x60')],null))[_0xc754('0x21')](respondWithResult(_0x16d56a,null))['catch'](handleError(_0x16d56a,null));};exports[_0xc754('0x38')]=function(_0x2e6d93,_0x1cbd75){return db[_0xc754('0x41')]['find']({'where':{'id':_0x2e6d93['params']['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x1cbd75,null))['then'](removeEntity(_0x1cbd75,null))['catch'](handleError(_0x1cbd75,null));};exports[_0xc754('0x69')]=function(_0x348079,_0x20709f){return db['OpenchannelAccount'][_0xc754('0x69')]()[_0xc754('0x21')](respondWithResult(_0x20709f,null))['catch'](handleError(_0x20709f,null));};exports['addDisposition']=function(_0x1b9ce4,_0x73d693,_0x474997){if(_0x1b9ce4[_0xc754('0x60')]['id']){delete _0x1b9ce4[_0xc754('0x60')]['id'];}return db[_0xc754('0x41')][_0xc754('0x5e')]({'where':{'id':_0x1b9ce4[_0xc754('0x5b')]['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x73d693,null))[_0xc754('0x21')](function(_0x378714){if(_0x378714){_0x1b9ce4[_0xc754('0x60')][_0xc754('0x6a')]=_0x378714['id'];return db[_0xc754('0x6b')]['create'](_0x1b9ce4[_0xc754('0x60')]);}})[_0xc754('0x21')](respondWithResult(_0x73d693,null))[_0xc754('0x2c')](handleError(_0x73d693,null));};exports[_0xc754('0x6c')]=function(_0x4fe528,_0x17e0fe,_0x3a2f27){var _0xcda07={'raw':![],'where':{}};var _0xa4fc22={};var _0x407b55={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xc754('0x6d')]({'where':{'id':_0x4fe528[_0xc754('0x5b')]['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x17e0fe,null))[_0xc754('0x21')](function(_0x28b9a3){if(_0x28b9a3){_0xa4fc22['model']=_[_0xc754('0x47')](db['Disposition'][_0xc754('0x42')]);_0xa4fc22[_0xc754('0x46')]=_[_0xc754('0x47')](_0x4fe528['query']);_0xa4fc22['filters']=_[_0xc754('0x5d')](_0xa4fc22['model'],_0xa4fc22['query']);_0xcda07[_0xc754('0x4a')]=_[_0xc754('0x5d')](_0xa4fc22[_0xc754('0x49')],qs[_0xc754('0x4b')](_0x4fe528[_0xc754('0x46')][_0xc754('0x4b')]));_0xcda07[_0xc754('0x4a')]=_0xcda07[_0xc754('0x4a')][_0xc754('0x4c')]?_0xcda07[_0xc754('0x4a')]:_0xa4fc22['model'];if(!_0x4fe528['query']['hasOwnProperty'](_0xc754('0x4e'))){_0xcda07['limit']=qs[_0xc754('0x33')](_0x4fe528[_0xc754('0x46')][_0xc754('0x33')]);_0xcda07[_0xc754('0x32')]=qs['offset'](_0x4fe528[_0xc754('0x46')][_0xc754('0x32')]);}_0xcda07[_0xc754('0x4f')]=qs[_0xc754('0x50')](_0x4fe528[_0xc754('0x46')]['sort']);_0xcda07[_0xc754('0x51')]=qs[_0xc754('0x48')](_['pick'](_0x4fe528[_0xc754('0x46')],_0xa4fc22[_0xc754('0x48')]));_0xcda07['where'][_0xc754('0x6a')]=_0x28b9a3['id'];if(_0x4fe528[_0xc754('0x46')][_0xc754('0x55')]){_0xcda07[_0xc754('0x51')]=_[_0xc754('0x53')](_0xcda07['where'],{'$or':_[_0xc754('0x40')](_0xcda07[_0xc754('0x4a')],function(_0x1602d3){var _0x420bb6={};_0x420bb6[_0x1602d3]={'$like':'%'+_0x4fe528[_0xc754('0x46')][_0xc754('0x55')]+'%'};return _0x420bb6;})});}_0xcda07=_[_0xc754('0x53')]({},_0xcda07,_0x4fe528[_0xc754('0x56')]);return db[_0xc754('0x6b')]['count']({'where':_0xcda07[_0xc754('0x51')]})[_0xc754('0x21')](function(_0x4dca54){_0x407b55[_0xc754('0x31')]=_0x4dca54;if(_0x4fe528['query']['includeAll']){_0xcda07['include']=[{'all':!![]}];}return db[_0xc754('0x6b')][_0xc754('0x6e')](_0xcda07);})[_0xc754('0x21')](function(_0x403a6f){_0x407b55['rows']=_0x403a6f;return _0x407b55;});}})[_0xc754('0x21')](respondWithFilteredResult(_0x17e0fe,_0xcda07))[_0xc754('0x2c')](handleError(_0x17e0fe,null));};exports['removeDispositions']=function(_0x2668ba,_0x242287,_0x390e8d){return db[_0xc754('0x41')]['find']({'where':{'id':_0x2668ba[_0xc754('0x5b')]['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x242287,null))[_0xc754('0x21')](function(_0xce95db){if(_0xce95db){return _0xce95db['removeDispositions'](_0x2668ba[_0xc754('0x46')][_0xc754('0x6f')]);}})['then'](respondWithStatusCode(_0x242287,null))[_0xc754('0x2c')](handleError(_0x242287,null));};exports[_0xc754('0x70')]=function(_0x4da8af,_0x3cd8c7,_0x7cf8e){if(_0x4da8af[_0xc754('0x60')]['id']){delete _0x4da8af[_0xc754('0x60')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x4da8af['params']['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x3cd8c7,null))[_0xc754('0x21')](function(_0x1f16de){if(_0x1f16de){_0x4da8af[_0xc754('0x60')][_0xc754('0x6a')]=_0x1f16de['id'];return db['CannedAnswer']['create'](_0x4da8af[_0xc754('0x60')]);}})['then'](respondWithResult(_0x3cd8c7,null))['catch'](handleError(_0x3cd8c7,null));};exports[_0xc754('0x71')]=function(_0x506e3c,_0x1823ec,_0x3a2a4e){var _0x2d3aa7={'raw':![],'where':{}};var _0xa10b61={};var _0x41281e={'count':0x0,'rows':[]};return db[_0xc754('0x41')][_0xc754('0x6d')]({'where':{'id':_0x506e3c['params']['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x1823ec,null))['then'](function(_0x1aba5e){if(_0x1aba5e){_0xa10b61['model']=_['keys'](db['CannedAnswer'][_0xc754('0x42')]);_0xa10b61['query']=_[_0xc754('0x47')](_0x506e3c[_0xc754('0x46')]);_0xa10b61[_0xc754('0x48')]=_[_0xc754('0x5d')](_0xa10b61[_0xc754('0x49')],_0xa10b61[_0xc754('0x46')]);_0x2d3aa7[_0xc754('0x4a')]=_[_0xc754('0x5d')](_0xa10b61[_0xc754('0x49')],qs['fields'](_0x506e3c[_0xc754('0x46')][_0xc754('0x4b')]));_0x2d3aa7['attributes']=_0x2d3aa7[_0xc754('0x4a')][_0xc754('0x4c')]?_0x2d3aa7['attributes']:_0xa10b61[_0xc754('0x49')];if(!_0x506e3c[_0xc754('0x46')][_0xc754('0x4d')]('nolimit')){_0x2d3aa7[_0xc754('0x33')]=qs[_0xc754('0x33')](_0x506e3c['query']['limit']);_0x2d3aa7[_0xc754('0x32')]=qs['offset'](_0x506e3c['query'][_0xc754('0x32')]);}_0x2d3aa7[_0xc754('0x4f')]=qs[_0xc754('0x50')](_0x506e3c['query'][_0xc754('0x50')]);_0x2d3aa7['where']=qs[_0xc754('0x48')](_['pick'](_0x506e3c[_0xc754('0x46')],_0xa10b61[_0xc754('0x48')]));_0x2d3aa7[_0xc754('0x51')][_0xc754('0x6a')]=_0x1aba5e['id'];if(_0x506e3c[_0xc754('0x46')]['filter']){_0x2d3aa7[_0xc754('0x51')]=_[_0xc754('0x53')](_0x2d3aa7['where'],{'$or':_['map'](_0x2d3aa7[_0xc754('0x4a')],function(_0x4fb8fa){var _0x1ae0cd={};_0x1ae0cd[_0x4fb8fa]={'$like':'%'+_0x506e3c[_0xc754('0x46')][_0xc754('0x55')]+'%'};return _0x1ae0cd;})});}_0x2d3aa7=_[_0xc754('0x53')]({},_0x2d3aa7,_0x506e3c['options']);return db['CannedAnswer'][_0xc754('0x31')]({'where':_0x2d3aa7[_0xc754('0x51')]})['then'](function(_0x2befd3){_0x41281e[_0xc754('0x31')]=_0x2befd3;if(_0x506e3c[_0xc754('0x46')][_0xc754('0x57')]){_0x2d3aa7[_0xc754('0x58')]=[{'all':!![]}];}return db[_0xc754('0x72')][_0xc754('0x6e')](_0x2d3aa7);})[_0xc754('0x21')](function(_0x5aaf0f){_0x41281e[_0xc754('0x59')]=_0x5aaf0f;return _0x41281e;});}})[_0xc754('0x21')](respondWithFilteredResult(_0x1823ec,_0x2d3aa7))[_0xc754('0x2c')](handleError(_0x1823ec,null));};exports['removeAnswers']=function(_0x9f63cd,_0x18d158,_0x248c26){return db[_0xc754('0x41')]['find']({'where':{'id':_0x9f63cd[_0xc754('0x5b')]['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x18d158,null))[_0xc754('0x21')](function(_0x4890c5){if(_0x4890c5){return _0x4890c5['removeAnswers'](_0x9f63cd[_0xc754('0x46')]['ids']);}})[_0xc754('0x21')](respondWithStatusCode(_0x18d158,null))[_0xc754('0x2c')](handleError(_0x18d158,null));};exports['notify']=function(_0x46f17b,_0x49f631,_0x2633ab){var _0x1d168c={'body':_0x46f17b[_0xc754('0x60')],'channel':_0xc754('0x73')};var _0x2bd2df=[];var _0xc7f523=[];var _0x3d9c76={};var _0x16e72c=![];return db['CmContact']['describe']()[_0xc754('0x21')](function(_0x176b2e){if(!_0x176b2e){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x2bd2df=_[_0xc754('0x74')](_[_0xc754('0x47')](_0x176b2e),[_0xc754('0x75'),_0xc754('0x76')]);_0xc7f523=_[_0xc754('0x74')](_['keys'](_0x176b2e),[_0xc754('0x75'),_0xc754('0x76'),_0xc754('0x77'),_0xc754('0x78')]);if(_0x46f17b['body']['id']){delete _0x46f17b[_0xc754('0x60')]['id'];}if(_[_0xc754('0x79')](_0x46f17b[_0xc754('0x60')][_0xc754('0x7a')])){throw new db[(_0xc754('0x7b'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x46f17b[_0xc754('0x60')][_0xc754('0x60')])||_0x46f17b[_0xc754('0x60')][_0xc754('0x60')]===''){throw new db[(_0xc754('0x7b'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc754('0x79')](_0x46f17b[_0xc754('0x60')][_0xc754('0x7c')])){throw new db[(_0xc754('0x7b'))][(_0xc754('0x7d'))](_0xc754('0x7e')+_0xc7f523);}if(!_['includes'](_0xc7f523,_0x46f17b[_0xc754('0x60')][_0xc754('0x7c')])){throw new db['Sequelize'][(_0xc754('0x7d'))](_0xc754('0x7f')+_0xc7f523);}_0x3d9c76[_0x46f17b[_0xc754('0x60')][_0xc754('0x7c')]]=_0x46f17b[_0xc754('0x60')][_0xc754('0x7a')];})[_0xc754('0x21')](function(){return db[_0xc754('0x41')]['find']({'where':{'id':_0x46f17b[_0xc754('0x5b')]['id']},'include':[{'model':db[_0xc754('0x80')],'as':'List','include':[{'model':db['CmContact'],'as':_0xc754('0x81'),'where':_0x3d9c76,'limit':0x1,'order':[['updatedAt',_0xc754('0x82')]]}]},{'model':db[_0xc754('0x83')],'as':_0xc754('0x84')}]});})[_0xc754('0x21')](handleEntityNotFound(_0x49f631,null))[_0xc754('0x21')](function(_0x644532){if(_0x644532&&_0x644532['List']){_0x1d168c[_0xc754('0x85')]=_0x644532;_0x1d168c['applications']=_0x644532[_0xc754('0x84')];_0x1d168c[_0xc754('0x86')]=_0x644532['List'];_0x1d168c[_0xc754('0x87')]=_[_0xc754('0x88')](_0x1d168c['applications'],['priority'],['asc']);if(_0x1d168c[_0xc754('0x85')][_0xc754('0x84')]){delete _0x1d168c[_0xc754('0x85')][_0xc754('0x84')];}if(_0x1d168c[_0xc754('0x85')][_0xc754('0x89')]&&_0x1d168c[_0xc754('0x85')]['List'][_0xc754('0x81')][_0xc754('0x4c')]){return _0x1d168c[_0xc754('0x85')][_0xc754('0x89')][_0xc754('0x81')][0x0];}var _0x3da1f5=_['defaults'](_0x46f17b[_0xc754('0x60')],{'firstName':_0x46f17b[_0xc754('0x60')][_0xc754('0x7a')],'ListId':_0x644532[_0xc754('0x78')]});_0x3da1f5[_0x46f17b[_0xc754('0x60')][_0xc754('0x7c')]]=_0x46f17b['body'][_0xc754('0x7a')];return db[_0xc754('0x8a')][_0xc754('0x5f')](_0x3da1f5,{'fields':_0x2bd2df,'raw':!![]});}})['then'](handleEntityNotFound(_0x49f631,null))[_0xc754('0x21')](function(_0x19ff09){_0x1d168c[_0xc754('0x8b')]=_0x19ff09;if(_0x19ff09){var _0x3da886={'ContactId':_0x19ff09['id'],'OpenchannelAccountId':_0x46f17b[_0xc754('0x5b')]['id'],'from':(_0x19ff09['firstName']||'')+'\x20'+(_0x19ff09[_0xc754('0x8c')]||'')};var _0x4c8e27={'OpenchannelAccountId':_0x46f17b[_0xc754('0x5b')]['id'],'closed':![]};if(_0x46f17b['body'][_0xc754('0x8d')]){_0x4c8e27[_0xc754('0x8d')]=_0x46f17b[_0xc754('0x60')][_0xc754('0x8d')];return db['OpenchannelInteraction'][_0xc754('0x5e')]({'where':_0x4c8e27})['then'](function(_0x52f662){if(_0x52f662){return[_0x52f662,![]];}_0x3da886[_0xc754('0x8d')]=_0x46f17b['body']['threadId'];_0x3da886[_0xc754('0x8e')]=_0x46f17b['body'][_0xc754('0x8e')];return db[_0xc754('0x8f')][_0xc754('0x5f')](_0x3da886)['then'](function(_0x535a3b){return[_0x535a3b,!![]];});});}else{_0x4c8e27[_0xc754('0x8d')]=null;}_0x4c8e27[_0xc754('0x90')]=_0x19ff09['id'];return db['OpenchannelInteraction'][_0xc754('0x5e')]({'where':_0x4c8e27})[_0xc754('0x21')](function(_0x45bee2){if(_0x45bee2){return[_0x45bee2,![]];}return db['OpenchannelInteraction']['create'](_0x3da886)[_0xc754('0x21')](function(_0x8b5d85){return[_0x8b5d85,!![]];});});}})[_0xc754('0x91')](function(_0x1db414,_0x4b99ba){if(_0x1db414){_0x16e72c=_0x4b99ba;if(!_0x4b99ba){var _0x5b71d3={'from':(_0x1d168c[_0xc754('0x8b')][_0xc754('0x92')]||'')+'\x20'+(_0x1d168c[_0xc754('0x8b')][_0xc754('0x8c')]||'')};if(_0x46f17b['body'][_0xc754('0x8d')]&&_0x46f17b[_0xc754('0x60')][_0xc754('0x93')]&&_0x46f17b['body'][_0xc754('0x8d')]!=_0x46f17b['body'][_0xc754('0x93')]){_0x5b71d3[_0xc754('0x8d')]=_0x46f17b[_0xc754('0x60')][_0xc754('0x93')];}return _0x1db414['update'](_0x5b71d3);}else{return _0x1db414;}}})[_0xc754('0x21')](function(_0xd55ff2){_0x1d168c[_0xc754('0x94')]=_0xd55ff2[_0xc754('0x39')]({'plain':!![]});_0x1d168c[_0xc754('0x94')]['created']=_0x16e72c;if(_0x1d168c[_0xc754('0x94')][_0xc754('0x95')]){if(_0x1d168c[_0xc754('0x85')][_0xc754('0x96')]){_0x1d168c['applications'][_0xc754('0x97')]({'id':0x0,'priority':_0x1d168c['applications'][_0xc754('0x4c')]+0x1,'app':_0xc754('0x98'),'appdata':_0xc754('0x99'),'interval':_0xc754('0x9a')});}}return db[_0xc754('0x9b')]['create']({'body':_0x46f17b[_0xc754('0x60')][_0xc754('0x60')],'OpenchannelAccountId':_0x46f17b['params']['id'],'OpenchannelInteractionId':_0xd55ff2['id'],'direction':'in','ContactId':_0x1d168c[_0xc754('0x8b')]['id'],'AttachmentId':_0x46f17b['body']['AttachmentId']});})[_0xc754('0x21')](function(_0x847ee3){_0x1d168c['message']=_0x847ee3;if(_0x1d168c['interaction'][_0xc754('0x9c')]){return db[_0xc754('0x9d')][_0xc754('0x5e')]({'attributes':['id',_0xc754('0x3c')],'where':{'id':_0x1d168c[_0xc754('0x94')]['UserId']}})[_0xc754('0x21')](function(_0x2c34b9){if(_0x2c34b9){_0x1d168c['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2c34b9[_0xc754('0x3c')]+','+(_0x1d168c[_0xc754('0x85')][_0xc754('0x9e')]||0xa),'interval':_0xc754('0x9a')});_0x1d168c['forcedOwnership']=![];}return respondWithRpcPromise(_0xc754('0x9f'),_0xc754('0xa0'),_0x1d168c);});}return respondWithRpcPromise(_0xc754('0x9f'),_0xc754('0xa0'),_0x1d168c);})['then'](function(_0x501e83){respondWithRpcPromise(_0xc754('0xa1'),'EventManager',{'event':_0xc754('0xa2'),'message':_0x501e83},client9002);return _0x501e83;})[_0xc754('0x21')](respondWithResult(_0x49f631,null))[_0xc754('0x2c')](handleError(_0x49f631,null));};exports[_0xc754('0xa3')]=function(_0x10f44d,_0x1e254f,_0x23bab0){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x10f44d[_0xc754('0x5b')]['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x1e254f,null))['then'](function(_0x89161f){if(_0x89161f){return db[_0xc754('0xa4')]['transaction'](function(_0x3c6c3c){return db[_0xc754('0x83')][_0xc754('0x38')]({'where':{'OpenchannelAccountId':_0x10f44d[_0xc754('0x5b')]['id']},'transaction':_0x3c6c3c})[_0xc754('0x21')](function(_0x76b3ae){var _0x45af54=_[_0xc754('0x40')](_0x10f44d[_0xc754('0x60')],function(_0x1bc868){_0x1bc868['OpenchannelAccountId']=_0x10f44d[_0xc754('0x5b')]['id'];return _0x1bc868;});return db[_0xc754('0x83')][_0xc754('0xa5')](_0x45af54,{'transaction':_0x3c6c3c});});})[_0xc754('0x21')](function(){return db[_0xc754('0x83')][_0xc754('0xa6')]({'where':{'OpenchannelAccountId':_0x10f44d['params']['id']},'order':_0xc754('0xa7')});});}})[_0xc754('0x21')](respondWithResult(_0x1e254f,null))[_0xc754('0x2c')](handleError(_0x1e254f,null));};exports[_0xc754('0xa8')]=function(_0x24736d,_0x1cf0bf,_0x5a2b38){var _0x27eb53={};var _0x19860f={};var _0x3c9538;var _0x21aaec;return db['OpenchannelAccount'][_0xc754('0x6d')]({'where':{'id':_0x24736d['params']['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x1cf0bf,null))['then'](function(_0x4d6714){if(_0x4d6714){_0x3c9538=_0x4d6714;_0x19860f[_0xc754('0x49')]=_['keys'](db[_0xc754('0x83')][_0xc754('0x42')]);_0x19860f['query']=_[_0xc754('0x47')](_0x24736d[_0xc754('0x46')]);_0x19860f['filters']=_['intersection'](_0x19860f[_0xc754('0x49')],_0x19860f[_0xc754('0x46')]);_0x27eb53[_0xc754('0x4a')]=_['intersection'](_0x19860f['model'],qs[_0xc754('0x4b')](_0x24736d[_0xc754('0x46')][_0xc754('0x4b')]));_0x27eb53[_0xc754('0x4a')]=_0x27eb53['attributes'][_0xc754('0x4c')]?_0x27eb53[_0xc754('0x4a')]:_0x19860f['model'];_0x27eb53['order']=qs[_0xc754('0x50')](_0x24736d[_0xc754('0x46')][_0xc754('0x50')]);_0x27eb53[_0xc754('0x51')]=qs[_0xc754('0x48')](_[_0xc754('0x52')](_0x24736d['query'],_0x19860f[_0xc754('0x48')]));if(_0x24736d[_0xc754('0x46')]['filter']){_0x27eb53['where']=_['merge'](_0x27eb53[_0xc754('0x51')],{'$or':_[_0xc754('0x40')](_0x27eb53[_0xc754('0x4a')],function(_0x5e75c4){var _0x5608f2={};_0x5608f2[_0x5e75c4]={'$like':'%'+_0x24736d[_0xc754('0x46')][_0xc754('0x55')]+'%'};return _0x5608f2;})});}_0x27eb53=_['merge']({},_0x27eb53,_0x24736d['options']);return _0x3c9538[_0xc754('0xa8')](_0x27eb53);}})[_0xc754('0x21')](function(_0x140dfe){if(_0x140dfe){_0x21aaec=_0x140dfe['length'];if(!_0x24736d[_0xc754('0x46')][_0xc754('0x4d')](_0xc754('0x4e'))){_0x27eb53[_0xc754('0x33')]=qs[_0xc754('0x33')](_0x24736d[_0xc754('0x46')][_0xc754('0x33')]);_0x27eb53[_0xc754('0x32')]=qs[_0xc754('0x32')](_0x24736d[_0xc754('0x46')]['offset']);}return _0x3c9538['getApplications'](_0x27eb53);}})[_0xc754('0x21')](function(_0x12ecd6){if(_0x12ecd6){return _0x12ecd6?{'count':_0x21aaec,'rows':_0x12ecd6}:null;}})[_0xc754('0x21')](respondWithResult(_0x1cf0bf,null))['catch'](handleError(_0x1cf0bf,null));};exports[_0xc754('0xa9')]=function(_0x4d094d,_0x5463be,_0x214832){var _0x44971c={'raw':![],'where':{}};var _0xcab396={};var _0x1e1b6e={'count':0x0,'rows':[]};return db[_0xc754('0x41')][_0xc754('0x6d')]({'where':{'id':_0x4d094d[_0xc754('0x5b')]['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x5463be,null))['then'](function(_0x123dc5){if(_0x123dc5){_0xcab396[_0xc754('0x49')]=_[_0xc754('0x47')](db['OpenchannelInteraction']['rawAttributes']);_0xcab396[_0xc754('0x46')]=_[_0xc754('0x47')](_0x4d094d[_0xc754('0x46')]);_0xcab396[_0xc754('0x48')]=_[_0xc754('0x5d')](_0xcab396[_0xc754('0x49')],_0xcab396['query']);_0x44971c[_0xc754('0x4a')]=_[_0xc754('0x5d')](_0xcab396[_0xc754('0x49')],qs[_0xc754('0x4b')](_0x4d094d[_0xc754('0x46')][_0xc754('0x4b')]));_0x44971c[_0xc754('0x4a')]=_0x44971c[_0xc754('0x4a')][_0xc754('0x4c')]?_0x44971c[_0xc754('0x4a')]:_0xcab396[_0xc754('0x49')];if(!_0x4d094d[_0xc754('0x46')][_0xc754('0x4d')](_0xc754('0x4e'))){_0x44971c[_0xc754('0x33')]=qs[_0xc754('0x33')](_0x4d094d['query'][_0xc754('0x33')]);_0x44971c['offset']=qs[_0xc754('0x32')](_0x4d094d[_0xc754('0x46')][_0xc754('0x32')]);}_0x44971c[_0xc754('0x4f')]=qs[_0xc754('0x50')](_0x4d094d[_0xc754('0x46')]['sort']);_0x44971c[_0xc754('0x51')]=qs[_0xc754('0x48')](_[_0xc754('0x52')](_0x4d094d[_0xc754('0x46')],_0xcab396[_0xc754('0x48')]));_0x44971c['where'][_0xc754('0x6a')]=_0x123dc5['id'];if(_0x4d094d[_0xc754('0x46')][_0xc754('0x55')]){_0x44971c[_0xc754('0x51')]=_[_0xc754('0x53')](_0x44971c[_0xc754('0x51')],{'$or':_[_0xc754('0x40')](_0x44971c[_0xc754('0x4a')],function(_0x70291d){var _0x200554={};_0x200554[_0x70291d]={'$like':'%'+_0x4d094d[_0xc754('0x46')][_0xc754('0x55')]+'%'};return _0x200554;})});}_0x44971c=_[_0xc754('0x53')]({},_0x44971c,_0x4d094d[_0xc754('0x56')]);return db[_0xc754('0x8f')]['count']({'where':_0x44971c[_0xc754('0x51')]})[_0xc754('0x21')](function(_0x32172c){_0x1e1b6e[_0xc754('0x31')]=_0x32172c;if(_0x4d094d[_0xc754('0x46')][_0xc754('0x57')]){_0x44971c['include']=[{'model':db[_0xc754('0x8a')],'as':_0xc754('0xaa'),'required':![]},{'model':db[_0xc754('0x9d')],'as':_0xc754('0xab'),'attributes':[_0xc754('0x3c'),_0xc754('0xac'),_0xc754('0xad')],'required':![]},{'model':db['Tag'],'as':_0xc754('0xae'),'attributes':['id',_0xc754('0x3c'),_0xc754('0xaf')],'where':_0x4d094d[_0xc754('0x46')][_0xc754('0xb0')]?{'id':_0x4d094d[_0xc754('0x46')][_0xc754('0xb0')]}:undefined,'required':_0x4d094d['query'][_0xc754('0xb0')]?!![]:![]}];}return db[_0xc754('0x8f')][_0xc754('0x6e')](_0x44971c);})[_0xc754('0x21')](function(_0x2292a3){_0x1e1b6e[_0xc754('0x59')]=_0x2292a3;return _0x1e1b6e;});}})['then'](respondWithFilteredResult(_0x5463be,_0x44971c))['catch'](handleError(_0x5463be,null));};exports[_0xc754('0xb1')]=function(_0x3a0268,_0x5050a5,_0x547172){return db[_0xc754('0x41')][_0xc754('0x5e')]({'where':{'id':_0x3a0268[_0xc754('0x5b')]['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x5050a5,null))[_0xc754('0x21')](function(_0x12c0e1){if(_0x12c0e1){return _0x12c0e1[_0xc754('0xb1')](_0x3a0268['body']['ids'],_[_0xc754('0xb2')](_0x3a0268[_0xc754('0x60')],[_0xc754('0x6f'),'id'])||{})[_0xc754('0x91')](function(_0x39069b){for(var _0x14c7eb=0x0;_0x14c7eb<_0x3a0268[_0xc754('0x60')][_0xc754('0x6f')][_0xc754('0x4c')];_0x14c7eb+=0x1){socket[_0xc754('0xb3')](_0xc754('0xb4'),{'UserId':_0x3a0268[_0xc754('0x60')][_0xc754('0x6f')][_0x14c7eb],'OpenchannelAccountId':_0x3a0268[_0xc754('0x5b')]['id']});}return _0x39069b;});}})[_0xc754('0x21')](respondWithResult(_0x5050a5,null))[_0xc754('0x2c')](handleError(_0x5050a5,null));};exports[_0xc754('0xb5')]=function(_0x477cd7,_0xe7e7f2,_0x1af76e){return db[_0xc754('0x41')][_0xc754('0x5e')]({'where':{'id':_0x477cd7[_0xc754('0x5b')]['id']}})['then'](handleEntityNotFound(_0xe7e7f2,null))[_0xc754('0x21')](function(_0x18ffd9){if(_0x18ffd9){return _0x18ffd9[_0xc754('0xb5')](_0x477cd7[_0xc754('0x46')]['ids'])['then'](function(){if(_[_0xc754('0xb6')](_0x477cd7[_0xc754('0x46')][_0xc754('0x6f')])){for(var _0x12edfa=0x0;_0x12edfa<_0x477cd7[_0xc754('0x46')][_0xc754('0x6f')]['length'];_0x12edfa+=0x1){socket[_0xc754('0xb3')](_0xc754('0xb7'),{'UserId':Number(_0x477cd7[_0xc754('0x46')][_0xc754('0x6f')][_0x12edfa]),'OpenchannelAccountId':Number(_0x477cd7[_0xc754('0x5b')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x477cd7[_0xc754('0x46')]['ids']),'OpenchannelAccountId':Number(_0x477cd7['params']['id'])});}});}})['then'](respondWithStatusCode(_0xe7e7f2,null))[_0xc754('0x2c')](handleError(_0xe7e7f2,null));};exports[_0xc754('0xb8')]=function(_0x2dca68,_0x2c5fe1,_0x4cd059){var _0x318202={};var _0x353aa3={};var _0x2e8ba8;var _0x1d3d5c;return db[_0xc754('0x41')]['findOne']({'where':{'id':_0x2dca68['params']['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x2c5fe1,null))[_0xc754('0x21')](function(_0x467eba){if(_0x467eba){_0x2e8ba8=_0x467eba;_0x353aa3[_0xc754('0x49')]=_[_0xc754('0x47')](db[_0xc754('0x9d')][_0xc754('0x42')]);_0x353aa3[_0xc754('0x46')]=_['keys'](_0x2dca68[_0xc754('0x46')]);_0x353aa3[_0xc754('0x48')]=_['intersection'](_0x353aa3['model'],_0x353aa3[_0xc754('0x46')]);_0x318202[_0xc754('0x4a')]=_[_0xc754('0x5d')](_0x353aa3[_0xc754('0x49')],qs['fields'](_0x2dca68[_0xc754('0x46')][_0xc754('0x4b')]));_0x318202['attributes']=_0x318202[_0xc754('0x4a')][_0xc754('0x4c')]?_0x318202[_0xc754('0x4a')]:_0x353aa3[_0xc754('0x49')];_0x318202['order']=qs[_0xc754('0x50')](_0x2dca68[_0xc754('0x46')][_0xc754('0x50')]);_0x318202[_0xc754('0x51')]=qs[_0xc754('0x48')](_['pick'](_0x2dca68['query'],_0x353aa3[_0xc754('0x48')]));if(_0x2dca68[_0xc754('0x46')][_0xc754('0x55')]){_0x318202[_0xc754('0x51')]=_[_0xc754('0x53')](_0x318202[_0xc754('0x51')],{'$or':_[_0xc754('0x40')](_0x318202[_0xc754('0x4a')],function(_0xba902c){var _0x27877e={};_0x27877e[_0xba902c]={'$like':'%'+_0x2dca68[_0xc754('0x46')]['filter']+'%'};return _0x27877e;})});}_0x318202=_['merge']({},_0x318202,_0x2dca68[_0xc754('0x56')]);return _0x2e8ba8['getAgents'](_0x318202);}})[_0xc754('0x21')](function(_0x7b0e94){if(_0x7b0e94){_0x1d3d5c=_0x7b0e94[_0xc754('0x4c')];if(!_0x2dca68[_0xc754('0x46')][_0xc754('0x4d')](_0xc754('0x4e'))){_0x318202[_0xc754('0x33')]=qs['limit'](_0x2dca68[_0xc754('0x46')][_0xc754('0x33')]);_0x318202[_0xc754('0x32')]=qs[_0xc754('0x32')](_0x2dca68[_0xc754('0x46')][_0xc754('0x32')]);}return _0x2e8ba8[_0xc754('0xb8')](_0x318202);}})['then'](function(_0x1d72b5){if(_0x1d72b5){return _0x1d72b5?{'count':_0x1d3d5c,'rows':_0x1d72b5}:null;}})[_0xc754('0x21')](respondWithResult(_0x2c5fe1,null))[_0xc754('0x2c')](handleError(_0x2c5fe1,null));};exports[_0xc754('0x3d')]=function(_0x4a09de,_0x56ae17,_0x512098){var _0xaf1c40,_0x1d048c,_0x5aa2ee;if(_['isNil'](_0x4a09de[_0xc754('0x60')][_0xc754('0x60')])||_0x4a09de[_0xc754('0x60')][_0xc754('0x60')]===''){throw new db[(_0xc754('0x7b'))]['ValidationError'](_0xc754('0xb9'));}if(_[_0xc754('0x79')](_0x4a09de['body']['to'])){}_0xaf1c40=_0x4a09de[_0xc754('0x60')]['to'];return db[_0xc754('0x41')][_0xc754('0x6d')]({'where':{'id':_0x4a09de[_0xc754('0x5b')]['id']}})[_0xc754('0x21')](handleEntityNotFound(_0x56ae17,null))['then'](function(_0x42544c){if(_0x42544c){return db['OpenchannelAccount'][_0xc754('0x5e')]({'where':{'id':_0x42544c['id']},'include':[{'model':db[_0xc754('0x80')],'as':_0xc754('0x89'),'include':[{'model':db[_0xc754('0x8a')],'as':_0xc754('0x81'),'where':{[_0x42544c[_0xc754('0x7c')]]:_0xaf1c40},'limit':0x1,'order':[[_0xc754('0x76'),'DESC']]}]}]})[_0xc754('0x21')](handleEntityNotFound(_0x56ae17,null))[_0xc754('0x21')](function(_0x3e3a53){if(_0x3e3a53&&_0x3e3a53['List']){_0x1d048c=_0x3e3a53[_0xc754('0x39')]({'plain':!![]});if(_0x1d048c[_0xc754('0x89')]&&_0x1d048c[_0xc754('0x89')]['Contacts'][_0xc754('0x4c')]){return _0x1d048c[_0xc754('0x89')][_0xc754('0x81')][0x0];}return db[_0xc754('0x8a')][_0xc754('0x5f')](_[_0xc754('0xba')](_0x4a09de[_0xc754('0x60')],{'firstName':_0xaf1c40,[_0x3e3a53[_0xc754('0x7c')]]:_0xaf1c40,'phone':_0xaf1c40,'ListId':_0x1d048c[_0xc754('0x78')]}));}})[_0xc754('0x21')](handleEntityNotFound(_0x56ae17,null))[_0xc754('0x21')](function(_0x5b8f6f){if(_0x5b8f6f){_0x5aa2ee=_0x5b8f6f;return db['OpenchannelInteraction'][_0xc754('0x5e')]({'where':{'ContactId':_0x5aa2ee['id'],'closed':![],'OpenchannelAccountId':_0x1d048c['id']}})[_0xc754('0x21')](function(_0x508615){if(_0x508615){return[_0x508615,![]];}return db[_0xc754('0x8f')][_0xc754('0x5f')]({'UserId':_0x4a09de['user']['id'],'ContactId':_0x5aa2ee['id'],'OpenchannelAccountId':_0x1d048c['id'],'lastMsgDirection':_0xc754('0xbb'),'Messages':[_[_0xc754('0x53')](_0x4a09de['body'],{'read':![],'body':_0x4a09de['body']['body'],'OpenchannelAccountId':_0x1d048c['id'],'UserId':_0x4a09de[_0xc754('0x61')]['id'],'ContactId':_0x5aa2ee['id']})]},{'include':[{'model':db[_0xc754('0x9b')],'as':_0xc754('0xbc')}]})[_0xc754('0x21')](function(_0x3ee15c){return[_0x3ee15c,!![]];});});}})[_0xc754('0x91')](function(_0x563869,_0x1d72ab){if(_0x1d72ab){return _0x563869;}return db['OpenchannelMessage'][_0xc754('0x5f')](_[_0xc754('0x53')](_0x4a09de[_0xc754('0x60')],{'read':![],'body':_0x4a09de[_0xc754('0x60')][_0xc754('0x60')],'OpenchannelAccountId':_0x1d048c['id'],'OpenchannelInteractionId':_0x563869['id'],'UserId':_0x4a09de[_0xc754('0x61')]['id'],'ContactId':_0x5aa2ee['id']}))[_0xc754('0x21')](function(_0x2f8758){_0x563869[_0xc754('0xbd')][_0xc754('0xbc')]=[];_0x563869[_0xc754('0xbd')][_0xc754('0xbc')][_0xc754('0x97')](_0x2f8758[_0xc754('0xbd')]);return _0x563869;});});}})[_0xc754('0x21')](respondWithResult(_0x56ae17,null))[_0xc754('0x2c')](handleError(_0x56ae17,null));}; \ No newline at end of file +var _0x793d=['ValidationError','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','List','CmContact','Contacts','DESC','Applications','account','list','applications','priority','asc','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','Messages','dataValues','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','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','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelAccount','findAll','rows','params','rawAttributes','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from'];(function(_0x4fe9f4,_0x3163f9){var _0x382fc1=function(_0xf9bb84){while(--_0xf9bb84){_0x4fe9f4['push'](_0x4fe9f4['shift']());}};_0x382fc1(++_0x3163f9);}(_0x793d,0x106));var _0xd793=function(_0xb03f0f,_0x95a350){_0xb03f0f=_0xb03f0f-0x0;var _0x27df7f=_0x793d[_0xb03f0f];return _0x27df7f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd793('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd793('0x1'));var rp=require(_0xd793('0x2'));var moment=require('moment');var BPromise=require(_0xd793('0x3'));var Mustache=require(_0xd793('0x4'));var util=require(_0xd793('0x5'));var path=require(_0xd793('0x6'));var sox=require(_0xd793('0x7'));var csv=require(_0xd793('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd793('0x9'));var _=require(_0xd793('0xa'));var squel=require(_0xd793('0xb'));var crypto=require(_0xd793('0xc'));var jsforce=require(_0xd793('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd793('0x8'));var querystring=require(_0xd793('0xe'));var Papa=require(_0xd793('0xf'));var Redis=require(_0xd793('0x10'));var authService=require(_0xd793('0x11'));var qs=require(_0xd793('0x12'));var as=require(_0xd793('0x13'));var hardwareService=require(_0xd793('0x14'));var logger=require('../../config/logger')(_0xd793('0x15'));var utils=require(_0xd793('0x16'));var config=require(_0xd793('0x17'));var licenseUtil=require(_0xd793('0x18'));var db=require(_0xd793('0x19'))['db'];config[_0xd793('0x1a')]=_[_0xd793('0x1b')](config[_0xd793('0x1a')],{'host':_0xd793('0x1c'),'port':0x18eb});var socket=require(_0xd793('0x1d'))(new Redis(config[_0xd793('0x1a')]));require(_0xd793('0x1e'))[_0xd793('0x1f')](socket);var jayson=require(_0xd793('0x20'));var client=jayson[_0xd793('0x21')]['http']({'port':0x232c});var client9002=jayson[_0xd793('0x21')][_0xd793('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1a4a82,_0x3387f1,_0x165c5e,_0x3f001a){return new BPromise(function(_0x3fae7c,_0x441455){var _0x192909=_0x3f001a||client;return _0x192909[_0xd793('0x23')](_0x1a4a82,_0x165c5e)[_0xd793('0x24')](function(_0x32ba5e){logger['info'](_0xd793('0x25'),_0x3387f1,_0xd793('0x26'));logger[_0xd793('0x27')](_0xd793('0x28'),_0x3387f1,'request\x20sent',JSON[_0xd793('0x29')](_0x32ba5e));if(_0x32ba5e[_0xd793('0x2a')]){if(_0x32ba5e['error'][_0xd793('0x2b')]===0x1f4){logger[_0xd793('0x2a')](_0xd793('0x25'),_0x3387f1,_0x32ba5e[_0xd793('0x2a')]['message']);return _0x441455(_0x32ba5e[_0xd793('0x2a')]['message']);}logger[_0xd793('0x2a')](_0xd793('0x25'),_0x3387f1,_0x32ba5e[_0xd793('0x2a')][_0xd793('0x2c')]);return _0x3fae7c(_0x32ba5e['error']['message']);}else{logger[_0xd793('0x2d')](_0xd793('0x25'),_0x3387f1,_0xd793('0x26'));_0x3fae7c(_0x32ba5e[_0xd793('0x2e')][_0xd793('0x2c')]);}})[_0xd793('0x2f')](function(_0x2afd4d){logger[_0xd793('0x2a')](_0xd793('0x25'),_0x3387f1,_0x2afd4d);_0x441455(_0x2afd4d);});});}function respondWithStatusCode(_0x198f86,_0x4af623){_0x4af623=_0x4af623||0xcc;return function(_0x2682c8){if(_0x2682c8){return _0x198f86[_0xd793('0x30')](_0x4af623);}return _0x198f86[_0xd793('0x31')](_0x4af623)['end']();};}function respondWithResult(_0x381fef,_0x28a3d2){_0x28a3d2=_0x28a3d2||0xc8;return function(_0x1fc65c){if(_0x1fc65c){return _0x381fef[_0xd793('0x31')](_0x28a3d2)[_0xd793('0x32')](_0x1fc65c);}};}function respondWithFilteredResult(_0x18164f,_0x4774c8){return function(_0x5cc0da){if(_0x5cc0da){var _0x2ff9c2=_0x5cc0da[_0xd793('0x33')],_0x4f77fb=_0x4774c8[_0xd793('0x34')],_0x2bb8ea=_0x4774c8['offset']+_0x4774c8[_0xd793('0x35')],_0x55ac8f;if(_0x2bb8ea>=_0x2ff9c2){_0x2bb8ea=_0x2ff9c2;_0x55ac8f=0xc8;}else{_0x55ac8f=0xce;}_0x18164f['status'](_0x55ac8f);return _0x18164f[_0xd793('0x36')](_0xd793('0x37'),_0x4f77fb+'-'+_0x2bb8ea+'/'+_0x2ff9c2)['json'](_0x5cc0da);}return null;};}function patchUpdates(_0x25ea9b){return function(_0xf93f44){try{jsonpatch[_0xd793('0x38')](_0xf93f44,_0x25ea9b,!![]);}catch(_0x12b90b){return BPromise[_0xd793('0x39')](_0x12b90b);}return _0xf93f44[_0xd793('0x3a')]();};}function saveUpdates(_0x472739,_0x4bb4b6){return function(_0x54e2d6){if(_0x54e2d6){return _0x54e2d6['update'](_0x472739)[_0xd793('0x24')](function(_0x38c0f3){return _0x38c0f3;});}return null;};}function removeEntity(_0x5ec8a7,_0x527e58){return function(_0x3ecbe8){if(_0x3ecbe8){return _0x3ecbe8[_0xd793('0x3b')]()[_0xd793('0x24')](function(){var _0x3e8461=_0x3ecbe8[_0xd793('0x3c')]({'plain':!![]});var _0x293aca=_0xd793('0x3d');return db[_0xd793('0x3e')][_0xd793('0x3b')]({'where':{'type':_0x293aca,'resourceId':_0x3e8461['id']}})[_0xd793('0x24')](function(){return _0x3ecbe8;});})[_0xd793('0x24')](function(){_0x5ec8a7[_0xd793('0x31')](0xcc)[_0xd793('0x3f')]();});}};}function handleEntityNotFound(_0x448fe5,_0x20f962){return function(_0x4ae758){if(!_0x4ae758){_0x448fe5[_0xd793('0x30')](0x194);}return _0x4ae758;};}function handleError(_0x29666a,_0x5bd0df){_0x5bd0df=_0x5bd0df||0x1f4;return function(_0x3ceab6){logger[_0xd793('0x2a')](_0x3ceab6[_0xd793('0x40')]);if(_0x3ceab6[_0xd793('0x41')]){delete _0x3ceab6[_0xd793('0x41')];}_0x29666a['status'](_0x5bd0df)[_0xd793('0x42')](_0x3ceab6);};}exports[_0xd793('0x43')]=function(_0x20a95a,_0x41a9b3){var _0x430303={'include':[{'model':db[_0xd793('0x44')],'as':_0xd793('0x45')}]},_0x1eacf0={},_0x59d6a8={'count':0x0,'rows':[]};var _0xebcdf1=_[_0xd793('0x46')](db['OpenchannelAccount']['rawAttributes'],function(_0xaf57df){return{'name':_0xaf57df[_0xd793('0x47')],'type':_0xaf57df[_0xd793('0x48')][_0xd793('0x49')]};});_0x1eacf0['model']=_[_0xd793('0x46')](_0xebcdf1,'name');_0x1eacf0[_0xd793('0x4a')]=_[_0xd793('0x4b')](_0x20a95a[_0xd793('0x4a')]);_0x1eacf0[_0xd793('0x4c')]=_[_0xd793('0x4d')](_0x1eacf0[_0xd793('0x4e')],_0x1eacf0['query']);_0x430303[_0xd793('0x4f')]=_[_0xd793('0x4d')](_0x1eacf0[_0xd793('0x4e')],qs[_0xd793('0x50')](_0x20a95a[_0xd793('0x4a')][_0xd793('0x50')]));_0x430303['attributes']=_0x430303[_0xd793('0x4f')][_0xd793('0x51')]?_0x430303[_0xd793('0x4f')]:_0x1eacf0['model'];if(!_0x20a95a[_0xd793('0x4a')][_0xd793('0x52')](_0xd793('0x53'))){_0x430303[_0xd793('0x35')]=qs[_0xd793('0x35')](_0x20a95a['query'][_0xd793('0x35')]);_0x430303[_0xd793('0x34')]=qs['offset'](_0x20a95a[_0xd793('0x4a')][_0xd793('0x34')]);}_0x430303[_0xd793('0x54')]=qs[_0xd793('0x55')](_0x20a95a[_0xd793('0x4a')][_0xd793('0x55')]);_0x430303[_0xd793('0x56')]=qs[_0xd793('0x4c')](_[_0xd793('0x57')](_0x20a95a['query'],_0x1eacf0[_0xd793('0x4c')]),_0xebcdf1);if(_0x20a95a[_0xd793('0x4a')][_0xd793('0x58')]){_0x430303[_0xd793('0x56')]=_[_0xd793('0x59')](_0x430303[_0xd793('0x56')],{'$or':_[_0xd793('0x46')](_0xebcdf1,function(_0x178f5f){if(_0x178f5f[_0xd793('0x48')]!==_0xd793('0x5a')){var _0x4b18c7={};_0x4b18c7[_0x178f5f[_0xd793('0x41')]]={'$like':'%'+_0x20a95a[_0xd793('0x4a')][_0xd793('0x58')]+'%'};return _0x4b18c7;}})});}_0x430303=_['merge']({},_0x430303,_0x20a95a[_0xd793('0x5b')]);var _0x11a433={'where':_0x430303[_0xd793('0x56')]};return db['OpenchannelAccount'][_0xd793('0x33')](_0x11a433)[_0xd793('0x24')](function(_0x56b281){_0x59d6a8['count']=_0x56b281;if(_0x20a95a[_0xd793('0x4a')]['includeAll']){_0x430303['include']=[{'all':!![]}];}return db[_0xd793('0x5c')][_0xd793('0x5d')](_0x430303);})['then'](function(_0x8ccdc0){_0x59d6a8[_0xd793('0x5e')]=_0x8ccdc0;return _0x59d6a8;})[_0xd793('0x24')](respondWithFilteredResult(_0x41a9b3,_0x430303))[_0xd793('0x2f')](handleError(_0x41a9b3,null));};exports['show']=function(_0x1fca56,_0x387e8a){var _0x1e76b8={'raw':![],'where':{'id':_0x1fca56[_0xd793('0x5f')]['id']},'include':[{'model':db[_0xd793('0x44')],'as':_0xd793('0x45')}]},_0x455e22={};_0x455e22[_0xd793('0x4e')]=_[_0xd793('0x4b')](db[_0xd793('0x5c')][_0xd793('0x60')]);_0x455e22['query']=_[_0xd793('0x4b')](_0x1fca56[_0xd793('0x4a')]);_0x455e22[_0xd793('0x4c')]=_[_0xd793('0x4d')](_0x455e22[_0xd793('0x4e')],_0x455e22[_0xd793('0x4a')]);_0x1e76b8[_0xd793('0x4f')]=_[_0xd793('0x4d')](_0x455e22[_0xd793('0x4e')],qs[_0xd793('0x50')](_0x1fca56['query'][_0xd793('0x50')]));_0x1e76b8[_0xd793('0x4f')]=_0x1e76b8[_0xd793('0x4f')]['length']?_0x1e76b8[_0xd793('0x4f')]:_0x455e22[_0xd793('0x4e')];if(_0x1fca56['query'][_0xd793('0x61')]){_0x1e76b8[_0xd793('0x62')]=[{'all':!![]}];}_0x1e76b8=_[_0xd793('0x59')]({},_0x1e76b8,_0x1fca56['options']);return db[_0xd793('0x5c')][_0xd793('0x63')](_0x1e76b8)['then'](handleEntityNotFound(_0x387e8a,null))[_0xd793('0x24')](respondWithResult(_0x387e8a,null))[_0xd793('0x2f')](handleError(_0x387e8a,null));};exports[_0xd793('0x64')]=function(_0x52db52,_0x42f8aa){return db['OpenchannelAccount'][_0xd793('0x64')](_0x52db52['body'],{})['then'](function(_0x430d96){var _0xeab51=_0x52db52[_0xd793('0x65')]['get']({'plain':!![]});if(!_0xeab51)throw new Error(_0xd793('0x66'));if(_0xeab51[_0xd793('0x67')]===_0xd793('0x65')){var _0xd6565c=_0x430d96[_0xd793('0x3c')]({'plain':!![]});var _0x1eb88b=_0xd793('0x3d');return db[_0xd793('0x68')]['find']({'where':{'name':_0x1eb88b,'userProfileId':_0xeab51[_0xd793('0x69')]},'raw':!![]})[_0xd793('0x24')](function(_0x1936d8){if(_0x1936d8&&_0x1936d8[_0xd793('0x6a')]===0x0){return db[_0xd793('0x3e')][_0xd793('0x64')]({'name':_0xd6565c[_0xd793('0x41')],'resourceId':_0xd6565c['id'],'type':_0x1936d8[_0xd793('0x41')],'sectionId':_0x1936d8['id']},{})[_0xd793('0x24')](function(){return _0x430d96;});}else{return _0x430d96;}})[_0xd793('0x2f')](function(_0x3a3eff){logger[_0xd793('0x2a')](_0xd793('0x6b'),_0x3a3eff);throw _0x3a3eff;});}return _0x430d96;})[_0xd793('0x24')](respondWithResult(_0x42f8aa,0xc9))[_0xd793('0x2f')](handleError(_0x42f8aa,null));};exports[_0xd793('0x6c')]=function(_0x573fc6,_0x3950d6){if(_0x573fc6['body']['id']){delete _0x573fc6[_0xd793('0x6d')]['id'];}return db[_0xd793('0x5c')][_0xd793('0x63')]({'where':{'id':_0x573fc6[_0xd793('0x5f')]['id']},'include':[{'model':db[_0xd793('0x44')],'as':_0xd793('0x45')}]})[_0xd793('0x24')](handleEntityNotFound(_0x3950d6,null))['then'](saveUpdates(_0x573fc6[_0xd793('0x6d')],null))[_0xd793('0x24')](respondWithResult(_0x3950d6,null))[_0xd793('0x2f')](handleError(_0x3950d6,null));};exports[_0xd793('0x3b')]=function(_0x5e94bd,_0x2b871f){return db['OpenchannelAccount'][_0xd793('0x63')]({'where':{'id':_0x5e94bd[_0xd793('0x5f')]['id']}})[_0xd793('0x24')](handleEntityNotFound(_0x2b871f,null))[_0xd793('0x24')](removeEntity(_0x2b871f,null))[_0xd793('0x2f')](handleError(_0x2b871f,null));};exports['describe']=function(_0x27158b,_0x278c8e){return db['OpenchannelAccount'][_0xd793('0x6e')]()[_0xd793('0x24')](respondWithResult(_0x278c8e,null))['catch'](handleError(_0x278c8e,null));};exports[_0xd793('0x6f')]=function(_0x41e110,_0x34b397,_0x2cfa08){if(_0x41e110[_0xd793('0x6d')]['id']){delete _0x41e110['body']['id'];}return db[_0xd793('0x5c')]['find']({'where':{'id':_0x41e110[_0xd793('0x5f')]['id']}})[_0xd793('0x24')](handleEntityNotFound(_0x34b397,null))[_0xd793('0x24')](function(_0x4e83db){if(_0x4e83db){_0x41e110[_0xd793('0x6d')][_0xd793('0x70')]=_0x4e83db['id'];return db[_0xd793('0x71')]['create'](_0x41e110['body']);}})[_0xd793('0x24')](respondWithResult(_0x34b397,null))[_0xd793('0x2f')](handleError(_0x34b397,null));};exports[_0xd793('0x72')]=function(_0x5b3bd1,_0x51b34b,_0x2c75d3){var _0x4c1c04={'raw':![],'where':{}};var _0x48bfd1={};var _0x2efe43={'count':0x0,'rows':[]};return db[_0xd793('0x5c')][_0xd793('0x73')]({'where':{'id':_0x5b3bd1[_0xd793('0x5f')]['id']}})[_0xd793('0x24')](handleEntityNotFound(_0x51b34b,null))['then'](function(_0x3e8364){if(_0x3e8364){_0x48bfd1[_0xd793('0x4e')]=_[_0xd793('0x4b')](db[_0xd793('0x71')][_0xd793('0x60')]);_0x48bfd1[_0xd793('0x4a')]=_[_0xd793('0x4b')](_0x5b3bd1[_0xd793('0x4a')]);_0x48bfd1[_0xd793('0x4c')]=_['intersection'](_0x48bfd1[_0xd793('0x4e')],_0x48bfd1[_0xd793('0x4a')]);_0x4c1c04[_0xd793('0x4f')]=_['intersection'](_0x48bfd1[_0xd793('0x4e')],qs[_0xd793('0x50')](_0x5b3bd1[_0xd793('0x4a')][_0xd793('0x50')]));_0x4c1c04[_0xd793('0x4f')]=_0x4c1c04[_0xd793('0x4f')]['length']?_0x4c1c04[_0xd793('0x4f')]:_0x48bfd1[_0xd793('0x4e')];if(!_0x5b3bd1['query'][_0xd793('0x52')](_0xd793('0x53'))){_0x4c1c04['limit']=qs[_0xd793('0x35')](_0x5b3bd1[_0xd793('0x4a')][_0xd793('0x35')]);_0x4c1c04[_0xd793('0x34')]=qs[_0xd793('0x34')](_0x5b3bd1['query'][_0xd793('0x34')]);}_0x4c1c04[_0xd793('0x54')]=qs['sort'](_0x5b3bd1[_0xd793('0x4a')][_0xd793('0x55')]);_0x4c1c04[_0xd793('0x56')]=qs[_0xd793('0x4c')](_['pick'](_0x5b3bd1[_0xd793('0x4a')],_0x48bfd1['filters']));_0x4c1c04[_0xd793('0x56')][_0xd793('0x70')]=_0x3e8364['id'];if(_0x5b3bd1[_0xd793('0x4a')][_0xd793('0x58')]){_0x4c1c04['where']=_['merge'](_0x4c1c04[_0xd793('0x56')],{'$or':_[_0xd793('0x46')](_0x4c1c04['attributes'],function(_0x2402f3){var _0x20afe3={};_0x20afe3[_0x2402f3]={'$like':'%'+_0x5b3bd1[_0xd793('0x4a')][_0xd793('0x58')]+'%'};return _0x20afe3;})});}_0x4c1c04=_['merge']({},_0x4c1c04,_0x5b3bd1['options']);return db[_0xd793('0x71')][_0xd793('0x33')]({'where':_0x4c1c04['where']})['then'](function(_0x1e2770){_0x2efe43[_0xd793('0x33')]=_0x1e2770;if(_0x5b3bd1[_0xd793('0x4a')]['includeAll']){_0x4c1c04[_0xd793('0x62')]=[{'all':!![]}];}return db[_0xd793('0x71')]['findAll'](_0x4c1c04);})['then'](function(_0xe8b31b){_0x2efe43[_0xd793('0x5e')]=_0xe8b31b;return _0x2efe43;});}})[_0xd793('0x24')](respondWithFilteredResult(_0x51b34b,_0x4c1c04))[_0xd793('0x2f')](handleError(_0x51b34b,null));};exports[_0xd793('0x74')]=function(_0x17fa83,_0x148f03,_0x2a4c29){return db[_0xd793('0x5c')]['find']({'where':{'id':_0x17fa83[_0xd793('0x5f')]['id']}})['then'](handleEntityNotFound(_0x148f03,null))[_0xd793('0x24')](function(_0x40e41c){if(_0x40e41c){return _0x40e41c[_0xd793('0x74')](_0x17fa83['query'][_0xd793('0x75')]);}})['then'](respondWithStatusCode(_0x148f03,null))[_0xd793('0x2f')](handleError(_0x148f03,null));};exports['addAnswer']=function(_0x46bb4d,_0x4bef36,_0x4db185){if(_0x46bb4d['body']['id']){delete _0x46bb4d[_0xd793('0x6d')]['id'];}return db['OpenchannelAccount'][_0xd793('0x63')]({'where':{'id':_0x46bb4d['params']['id']}})[_0xd793('0x24')](handleEntityNotFound(_0x4bef36,null))[_0xd793('0x24')](function(_0xc3cd69){if(_0xc3cd69){_0x46bb4d[_0xd793('0x6d')]['OpenchannelAccountId']=_0xc3cd69['id'];return db[_0xd793('0x76')][_0xd793('0x64')](_0x46bb4d[_0xd793('0x6d')]);}})[_0xd793('0x24')](respondWithResult(_0x4bef36,null))[_0xd793('0x2f')](handleError(_0x4bef36,null));};exports[_0xd793('0x77')]=function(_0x15a3af,_0x1cd5f3,_0x5d984a){var _0x31f209={'raw':![],'where':{}};var _0x5425b8={};var _0x5b4cd5={'count':0x0,'rows':[]};return db[_0xd793('0x5c')][_0xd793('0x73')]({'where':{'id':_0x15a3af['params']['id']}})[_0xd793('0x24')](handleEntityNotFound(_0x1cd5f3,null))[_0xd793('0x24')](function(_0x539c02){if(_0x539c02){_0x5425b8[_0xd793('0x4e')]=_['keys'](db[_0xd793('0x76')]['rawAttributes']);_0x5425b8[_0xd793('0x4a')]=_['keys'](_0x15a3af['query']);_0x5425b8[_0xd793('0x4c')]=_[_0xd793('0x4d')](_0x5425b8[_0xd793('0x4e')],_0x5425b8[_0xd793('0x4a')]);_0x31f209[_0xd793('0x4f')]=_['intersection'](_0x5425b8[_0xd793('0x4e')],qs['fields'](_0x15a3af[_0xd793('0x4a')]['fields']));_0x31f209[_0xd793('0x4f')]=_0x31f209['attributes'][_0xd793('0x51')]?_0x31f209[_0xd793('0x4f')]:_0x5425b8[_0xd793('0x4e')];if(!_0x15a3af[_0xd793('0x4a')][_0xd793('0x52')](_0xd793('0x53'))){_0x31f209['limit']=qs[_0xd793('0x35')](_0x15a3af[_0xd793('0x4a')]['limit']);_0x31f209['offset']=qs[_0xd793('0x34')](_0x15a3af[_0xd793('0x4a')][_0xd793('0x34')]);}_0x31f209[_0xd793('0x54')]=qs[_0xd793('0x55')](_0x15a3af[_0xd793('0x4a')][_0xd793('0x55')]);_0x31f209[_0xd793('0x56')]=qs[_0xd793('0x4c')](_[_0xd793('0x57')](_0x15a3af[_0xd793('0x4a')],_0x5425b8[_0xd793('0x4c')]));_0x31f209[_0xd793('0x56')]['OpenchannelAccountId']=_0x539c02['id'];if(_0x15a3af[_0xd793('0x4a')][_0xd793('0x58')]){_0x31f209['where']=_['merge'](_0x31f209['where'],{'$or':_[_0xd793('0x46')](_0x31f209[_0xd793('0x4f')],function(_0x4e0351){var _0x5b937d={};_0x5b937d[_0x4e0351]={'$like':'%'+_0x15a3af[_0xd793('0x4a')][_0xd793('0x58')]+'%'};return _0x5b937d;})});}_0x31f209=_[_0xd793('0x59')]({},_0x31f209,_0x15a3af[_0xd793('0x5b')]);return db[_0xd793('0x76')][_0xd793('0x33')]({'where':_0x31f209[_0xd793('0x56')]})['then'](function(_0x1855e8){_0x5b4cd5[_0xd793('0x33')]=_0x1855e8;if(_0x15a3af['query'][_0xd793('0x61')]){_0x31f209[_0xd793('0x62')]=[{'all':!![]}];}return db[_0xd793('0x76')]['findAll'](_0x31f209);})['then'](function(_0x545284){_0x5b4cd5[_0xd793('0x5e')]=_0x545284;return _0x5b4cd5;});}})[_0xd793('0x24')](respondWithFilteredResult(_0x1cd5f3,_0x31f209))[_0xd793('0x2f')](handleError(_0x1cd5f3,null));};exports['removeAnswers']=function(_0x151ed0,_0x5caf24,_0x4566bc){return db[_0xd793('0x5c')][_0xd793('0x63')]({'where':{'id':_0x151ed0['params']['id']}})[_0xd793('0x24')](handleEntityNotFound(_0x5caf24,null))[_0xd793('0x24')](function(_0x82ab54){if(_0x82ab54){return _0x82ab54[_0xd793('0x78')](_0x151ed0[_0xd793('0x4a')][_0xd793('0x75')]);}})['then'](respondWithStatusCode(_0x5caf24,null))['catch'](handleError(_0x5caf24,null));};exports[_0xd793('0x79')]=function(_0x205502,_0x19ec78,_0x56a98d){var _0x3211f7={'body':_0x205502[_0xd793('0x6d')],'channel':'openchannel'};var _0x363c22=[];var _0x39c8c6=[];var _0x33493b={};var _0x1e81ff=![];return db['CmContact'][_0xd793('0x6e')]()[_0xd793('0x24')](function(_0x3f316c){if(!_0x3f316c){throw new db[(_0xd793('0x7a'))]['ValidationError'](_0xd793('0x7b'));}_0x363c22=_[_0xd793('0x7c')](_[_0xd793('0x4b')](_0x3f316c),['createdAt','updatedAt']);_0x39c8c6=_[_0xd793('0x7c')](_[_0xd793('0x4b')](_0x3f316c),[_0xd793('0x7d'),_0xd793('0x7e'),_0xd793('0x7f'),_0xd793('0x80')]);if(_0x205502['body']['id']){delete _0x205502[_0xd793('0x6d')]['id'];}if(_['isNil'](_0x205502[_0xd793('0x6d')][_0xd793('0x81')])){throw new db[(_0xd793('0x7a'))][(_0xd793('0x82'))]('from\x20is\x20mandatory');}if(_[_0xd793('0x83')](_0x205502[_0xd793('0x6d')][_0xd793('0x6d')])||_0x205502[_0xd793('0x6d')][_0xd793('0x6d')]===''){throw new db['Sequelize'][(_0xd793('0x82'))](_0xd793('0x84'));}if(_[_0xd793('0x83')](_0x205502[_0xd793('0x6d')][_0xd793('0x85')])){throw new db[(_0xd793('0x7a'))]['ValidationError'](_0xd793('0x86')+_0x39c8c6);}if(!_[_0xd793('0x87')](_0x39c8c6,_0x205502[_0xd793('0x6d')]['mapKey'])){throw new db[(_0xd793('0x7a'))][(_0xd793('0x82'))](_0xd793('0x88')+_0x39c8c6);}_0x33493b[_0x205502[_0xd793('0x6d')]['mapKey']]=_0x205502[_0xd793('0x6d')][_0xd793('0x81')];})[_0xd793('0x24')](function(){return db[_0xd793('0x5c')][_0xd793('0x63')]({'where':{'id':_0x205502['params']['id']},'include':[{'model':db['CmList'],'as':_0xd793('0x89'),'include':[{'model':db[_0xd793('0x8a')],'as':_0xd793('0x8b'),'where':_0x33493b,'limit':0x1,'order':[[_0xd793('0x7e'),_0xd793('0x8c')]]}]},{'model':db['OpenchannelApplication'],'as':_0xd793('0x8d')}]});})[_0xd793('0x24')](handleEntityNotFound(_0x19ec78,null))[_0xd793('0x24')](function(_0x24255f){if(_0x24255f&&_0x24255f[_0xd793('0x89')]){_0x3211f7[_0xd793('0x8e')]=_0x24255f;_0x3211f7['applications']=_0x24255f[_0xd793('0x8d')];_0x3211f7[_0xd793('0x8f')]=_0x24255f[_0xd793('0x89')];_0x3211f7[_0xd793('0x90')]=_['orderBy'](_0x3211f7[_0xd793('0x90')],[_0xd793('0x91')],[_0xd793('0x92')]);if(_0x3211f7[_0xd793('0x8e')][_0xd793('0x8d')]){delete _0x3211f7['account']['Applications'];}if(_0x3211f7[_0xd793('0x8e')][_0xd793('0x89')]&&_0x3211f7['account'][_0xd793('0x89')][_0xd793('0x8b')]['length']){return _0x3211f7[_0xd793('0x8e')][_0xd793('0x89')][_0xd793('0x8b')][0x0];}var _0x506073=_['defaults'](_0x205502[_0xd793('0x6d')],{'firstName':_0x205502[_0xd793('0x6d')][_0xd793('0x81')],'ListId':_0x24255f[_0xd793('0x80')]});_0x506073[_0x205502[_0xd793('0x6d')][_0xd793('0x85')]]=_0x205502[_0xd793('0x6d')][_0xd793('0x81')];return db['CmContact'][_0xd793('0x64')](_0x506073,{'fields':_0x363c22,'raw':!![]});}})[_0xd793('0x24')](handleEntityNotFound(_0x19ec78,null))[_0xd793('0x24')](function(_0x3c2daf){_0x3211f7['contact']=_0x3c2daf;if(_0x3c2daf){var _0x54a8bd={'ContactId':_0x3c2daf['id'],'OpenchannelAccountId':_0x205502['params']['id'],'from':(_0x3c2daf[_0xd793('0x93')]||'')+'\x20'+(_0x3c2daf[_0xd793('0x94')]||'')};var _0x1408b8={'OpenchannelAccountId':_0x205502[_0xd793('0x5f')]['id'],'closed':![]};if(_0x205502[_0xd793('0x6d')][_0xd793('0x95')]){_0x1408b8[_0xd793('0x95')]=_0x205502[_0xd793('0x6d')][_0xd793('0x95')];return db['OpenchannelInteraction'][_0xd793('0x63')]({'where':_0x1408b8})[_0xd793('0x24')](function(_0x2db3c4){if(_0x2db3c4){return[_0x2db3c4,![]];}_0x54a8bd[_0xd793('0x95')]=_0x205502[_0xd793('0x6d')][_0xd793('0x95')];_0x54a8bd[_0xd793('0x96')]=_0x205502[_0xd793('0x6d')]['externalUrl'];return db[_0xd793('0x97')][_0xd793('0x64')](_0x54a8bd)[_0xd793('0x24')](function(_0x8d317a){return[_0x8d317a,!![]];});});}else{_0x1408b8[_0xd793('0x95')]=null;}_0x1408b8[_0xd793('0x98')]=_0x3c2daf['id'];return db['OpenchannelInteraction'][_0xd793('0x63')]({'where':_0x1408b8})[_0xd793('0x24')](function(_0x5963de){if(_0x5963de){return[_0x5963de,![]];}return db[_0xd793('0x97')][_0xd793('0x64')](_0x54a8bd)[_0xd793('0x24')](function(_0x5528a8){return[_0x5528a8,!![]];});});}})[_0xd793('0x99')](function(_0x5f1a41,_0x38eb01){if(_0x5f1a41){_0x1e81ff=_0x38eb01;if(!_0x38eb01){var _0x3aa0ff={'from':(_0x3211f7[_0xd793('0x9a')][_0xd793('0x93')]||'')+'\x20'+(_0x3211f7[_0xd793('0x9a')][_0xd793('0x94')]||'')};if(_0x205502[_0xd793('0x6d')][_0xd793('0x95')]&&_0x205502['body']['messageId']&&_0x205502[_0xd793('0x6d')][_0xd793('0x95')]!=_0x205502[_0xd793('0x6d')]['messageId']){_0x3aa0ff['threadId']=_0x205502['body']['messageId'];}return _0x5f1a41[_0xd793('0x6c')](_0x3aa0ff);}else{return _0x5f1a41;}}})['then'](function(_0x1affb9){_0x3211f7[_0xd793('0x9b')]=_0x1affb9[_0xd793('0x3c')]({'plain':!![]});_0x3211f7[_0xd793('0x9b')][_0xd793('0x9c')]=_0x1e81ff;if(_0x3211f7['interaction'][_0xd793('0x9c')]){if(_0x3211f7['account'][_0xd793('0x9d')]){_0x3211f7[_0xd793('0x90')][_0xd793('0x9e')]({'id':0x0,'priority':_0x3211f7[_0xd793('0x90')][_0xd793('0x51')]+0x1,'app':_0xd793('0x9f'),'appdata':'unmanaged','interval':_0xd793('0xa0')});}}return db[_0xd793('0xa1')][_0xd793('0x64')]({'body':_0x205502[_0xd793('0x6d')][_0xd793('0x6d')],'OpenchannelAccountId':_0x205502['params']['id'],'OpenchannelInteractionId':_0x1affb9['id'],'direction':'in','ContactId':_0x3211f7[_0xd793('0x9a')]['id'],'AttachmentId':_0x205502['body'][_0xd793('0xa2')]});})[_0xd793('0x24')](function(_0x2b8ea6){_0x3211f7[_0xd793('0x2c')]=_0x2b8ea6;if(_0x3211f7[_0xd793('0x9b')][_0xd793('0xa3')]){return db[_0xd793('0xa4')][_0xd793('0x63')]({'attributes':['id',_0xd793('0x41')],'where':{'id':_0x3211f7[_0xd793('0x9b')]['UserId']}})[_0xd793('0x24')](function(_0x2d7948){if(_0x2d7948){_0x3211f7[_0xd793('0x90')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2d7948[_0xd793('0x41')]+','+(_0x3211f7[_0xd793('0x8e')][_0xd793('0xa5')]||0xa),'interval':_0xd793('0xa0')});_0x3211f7[_0xd793('0xa6')]=![];}return respondWithRpcPromise(_0xd793('0xa7'),_0xd793('0xa8'),_0x3211f7);});}return respondWithRpcPromise(_0xd793('0xa7'),_0xd793('0xa8'),_0x3211f7);})[_0xd793('0x24')](function(_0x35e794){respondWithRpcPromise(_0xd793('0xa9'),_0xd793('0xa9'),{'event':_0xd793('0x79'),'message':_0x35e794},client9002);return _0x35e794;})['then'](respondWithResult(_0x19ec78,null))[_0xd793('0x2f')](handleError(_0x19ec78,null));};exports[_0xd793('0xaa')]=function(_0x269bf1,_0x3d87db,_0x3902d3){return db[_0xd793('0x5c')]['findOne']({'where':{'id':_0x269bf1[_0xd793('0x5f')]['id']}})[_0xd793('0x24')](handleEntityNotFound(_0x3d87db,null))['then'](function(_0x4fe3d5){if(_0x4fe3d5){return db[_0xd793('0xab')][_0xd793('0xac')](function(_0x15de69){return db[_0xd793('0xad')][_0xd793('0x3b')]({'where':{'OpenchannelAccountId':_0x269bf1[_0xd793('0x5f')]['id']},'transaction':_0x15de69})['then'](function(_0x25c6e1){var _0x197871=_['map'](_0x269bf1[_0xd793('0x6d')],function(_0x59453d){_0x59453d[_0xd793('0x70')]=_0x269bf1[_0xd793('0x5f')]['id'];return _0x59453d;});return db['OpenchannelApplication'][_0xd793('0xae')](_0x197871,{'transaction':_0x15de69});});})[_0xd793('0x24')](function(){return db[_0xd793('0xad')][_0xd793('0xaf')]({'where':{'OpenchannelAccountId':_0x269bf1[_0xd793('0x5f')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x3d87db,null))[_0xd793('0x2f')](handleError(_0x3d87db,null));};exports[_0xd793('0xb0')]=function(_0x27166a,_0x3432e6,_0x4282e1){var _0xec87d7={};var _0x1fdb56={};var _0x390116;var _0xea5fa3;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x27166a[_0xd793('0x5f')]['id']}})[_0xd793('0x24')](handleEntityNotFound(_0x3432e6,null))[_0xd793('0x24')](function(_0x8b96b1){if(_0x8b96b1){_0x390116=_0x8b96b1;_0x1fdb56[_0xd793('0x4e')]=_['keys'](db[_0xd793('0xad')][_0xd793('0x60')]);_0x1fdb56[_0xd793('0x4a')]=_[_0xd793('0x4b')](_0x27166a['query']);_0x1fdb56[_0xd793('0x4c')]=_[_0xd793('0x4d')](_0x1fdb56['model'],_0x1fdb56[_0xd793('0x4a')]);_0xec87d7['attributes']=_[_0xd793('0x4d')](_0x1fdb56[_0xd793('0x4e')],qs[_0xd793('0x50')](_0x27166a[_0xd793('0x4a')]['fields']));_0xec87d7[_0xd793('0x4f')]=_0xec87d7[_0xd793('0x4f')][_0xd793('0x51')]?_0xec87d7[_0xd793('0x4f')]:_0x1fdb56[_0xd793('0x4e')];_0xec87d7[_0xd793('0x54')]=qs[_0xd793('0x55')](_0x27166a[_0xd793('0x4a')][_0xd793('0x55')]);_0xec87d7['where']=qs[_0xd793('0x4c')](_[_0xd793('0x57')](_0x27166a[_0xd793('0x4a')],_0x1fdb56[_0xd793('0x4c')]));if(_0x27166a[_0xd793('0x4a')]['filter']){_0xec87d7['where']=_[_0xd793('0x59')](_0xec87d7[_0xd793('0x56')],{'$or':_[_0xd793('0x46')](_0xec87d7[_0xd793('0x4f')],function(_0x55e24f){var _0x11645a={};_0x11645a[_0x55e24f]={'$like':'%'+_0x27166a[_0xd793('0x4a')][_0xd793('0x58')]+'%'};return _0x11645a;})});}_0xec87d7=_[_0xd793('0x59')]({},_0xec87d7,_0x27166a[_0xd793('0x5b')]);return _0x390116['getApplications'](_0xec87d7);}})[_0xd793('0x24')](function(_0x891da7){if(_0x891da7){_0xea5fa3=_0x891da7['length'];if(!_0x27166a[_0xd793('0x4a')][_0xd793('0x52')](_0xd793('0x53'))){_0xec87d7[_0xd793('0x35')]=qs[_0xd793('0x35')](_0x27166a[_0xd793('0x4a')][_0xd793('0x35')]);_0xec87d7[_0xd793('0x34')]=qs[_0xd793('0x34')](_0x27166a['query'][_0xd793('0x34')]);}return _0x390116['getApplications'](_0xec87d7);}})['then'](function(_0x411276){if(_0x411276){return _0x411276?{'count':_0xea5fa3,'rows':_0x411276}:null;}})[_0xd793('0x24')](respondWithResult(_0x3432e6,null))[_0xd793('0x2f')](handleError(_0x3432e6,null));};exports[_0xd793('0xb1')]=function(_0x5984ce,_0x114d82,_0x7b56bc){var _0xb3337a={'raw':![],'where':{}};var _0x1db24a={};var _0x39a1fc={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x5984ce[_0xd793('0x5f')]['id']}})[_0xd793('0x24')](handleEntityNotFound(_0x114d82,null))[_0xd793('0x24')](function(_0x101084){if(_0x101084){_0x1db24a[_0xd793('0x4e')]=_[_0xd793('0x4b')](db[_0xd793('0x97')][_0xd793('0x60')]);_0x1db24a[_0xd793('0x4a')]=_[_0xd793('0x4b')](_0x5984ce[_0xd793('0x4a')]);_0x1db24a[_0xd793('0x4c')]=_[_0xd793('0x4d')](_0x1db24a[_0xd793('0x4e')],_0x1db24a[_0xd793('0x4a')]);_0xb3337a['attributes']=_[_0xd793('0x4d')](_0x1db24a['model'],qs[_0xd793('0x50')](_0x5984ce[_0xd793('0x4a')][_0xd793('0x50')]));_0xb3337a[_0xd793('0x4f')]=_0xb3337a['attributes'][_0xd793('0x51')]?_0xb3337a[_0xd793('0x4f')]:_0x1db24a[_0xd793('0x4e')];if(!_0x5984ce['query'][_0xd793('0x52')](_0xd793('0x53'))){_0xb3337a[_0xd793('0x35')]=qs['limit'](_0x5984ce[_0xd793('0x4a')]['limit']);_0xb3337a[_0xd793('0x34')]=qs[_0xd793('0x34')](_0x5984ce['query'][_0xd793('0x34')]);}_0xb3337a['order']=qs[_0xd793('0x55')](_0x5984ce[_0xd793('0x4a')][_0xd793('0x55')]);_0xb3337a[_0xd793('0x56')]=qs[_0xd793('0x4c')](_['pick'](_0x5984ce[_0xd793('0x4a')],_0x1db24a[_0xd793('0x4c')]));_0xb3337a[_0xd793('0x56')][_0xd793('0x70')]=_0x101084['id'];if(_0x5984ce['query'][_0xd793('0x58')]){_0xb3337a[_0xd793('0x56')]=_[_0xd793('0x59')](_0xb3337a[_0xd793('0x56')],{'$or':_[_0xd793('0x46')](_0xb3337a[_0xd793('0x4f')],function(_0x289eb7){var _0x2d74fc={};_0x2d74fc[_0x289eb7]={'$like':'%'+_0x5984ce['query']['filter']+'%'};return _0x2d74fc;})});}_0xb3337a=_[_0xd793('0x59')]({},_0xb3337a,_0x5984ce[_0xd793('0x5b')]);return db['OpenchannelInteraction'][_0xd793('0x33')]({'where':_0xb3337a[_0xd793('0x56')]})['then'](function(_0x5ba5a1){_0x39a1fc['count']=_0x5ba5a1;if(_0x5984ce['query'][_0xd793('0x61')]){_0xb3337a[_0xd793('0x62')]=[{'model':db[_0xd793('0x8a')],'as':_0xd793('0xb2'),'required':![]},{'model':db[_0xd793('0xa4')],'as':_0xd793('0xb3'),'attributes':[_0xd793('0x41'),_0xd793('0xb4'),_0xd793('0xb5')],'required':![]},{'model':db[_0xd793('0xb6')],'as':_0xd793('0xb7'),'attributes':['id',_0xd793('0x41'),_0xd793('0xb8')],'where':_0x5984ce['query'][_0xd793('0xb9')]?{'id':_0x5984ce[_0xd793('0x4a')][_0xd793('0xb9')]}:undefined,'required':_0x5984ce[_0xd793('0x4a')]['tag']?!![]:![]}];}return db[_0xd793('0x97')][_0xd793('0x5d')](_0xb3337a);})[_0xd793('0x24')](function(_0x42f37a){_0x39a1fc[_0xd793('0x5e')]=_0x42f37a;return _0x39a1fc;});}})[_0xd793('0x24')](respondWithFilteredResult(_0x114d82,_0xb3337a))[_0xd793('0x2f')](handleError(_0x114d82,null));};exports[_0xd793('0xba')]=function(_0x467fb7,_0x300349,_0x42fe62){return db[_0xd793('0x5c')][_0xd793('0x63')]({'where':{'id':_0x467fb7[_0xd793('0x5f')]['id']}})['then'](handleEntityNotFound(_0x300349,null))['then'](function(_0x28d5f6){if(_0x28d5f6){return _0x28d5f6['addAgents'](_0x467fb7['body']['ids'],_[_0xd793('0xbb')](_0x467fb7['body'],[_0xd793('0x75'),'id'])||{})[_0xd793('0x99')](function(_0x1490d9){for(var _0x16d62d=0x0;_0x16d62d<_0x467fb7[_0xd793('0x6d')][_0xd793('0x75')][_0xd793('0x51')];_0x16d62d+=0x1){socket[_0xd793('0xbc')](_0xd793('0xbd'),{'UserId':_0x467fb7[_0xd793('0x6d')][_0xd793('0x75')][_0x16d62d],'OpenchannelAccountId':_0x467fb7[_0xd793('0x5f')]['id']});}return _0x1490d9;});}})[_0xd793('0x24')](respondWithResult(_0x300349,null))['catch'](handleError(_0x300349,null));};exports[_0xd793('0xbe')]=function(_0x17fe4b,_0x459ca4,_0x548b1c){return db[_0xd793('0x5c')][_0xd793('0x63')]({'where':{'id':_0x17fe4b[_0xd793('0x5f')]['id']}})[_0xd793('0x24')](handleEntityNotFound(_0x459ca4,null))['then'](function(_0x11c78f){if(_0x11c78f){return _0x11c78f[_0xd793('0xbe')](_0x17fe4b['query'][_0xd793('0x75')])[_0xd793('0x24')](function(){if(_[_0xd793('0xbf')](_0x17fe4b['query'][_0xd793('0x75')])){for(var _0x2b52ec=0x0;_0x2b52ec<_0x17fe4b[_0xd793('0x4a')][_0xd793('0x75')][_0xd793('0x51')];_0x2b52ec+=0x1){socket[_0xd793('0xbc')](_0xd793('0xc0'),{'UserId':Number(_0x17fe4b[_0xd793('0x4a')][_0xd793('0x75')][_0x2b52ec]),'OpenchannelAccountId':Number(_0x17fe4b['params']['id'])});}}else{socket[_0xd793('0xbc')]('userOpenchannelAccount:remove',{'UserId':Number(_0x17fe4b['query'][_0xd793('0x75')]),'OpenchannelAccountId':Number(_0x17fe4b[_0xd793('0x5f')]['id'])});}});}})[_0xd793('0x24')](respondWithStatusCode(_0x459ca4,null))[_0xd793('0x2f')](handleError(_0x459ca4,null));};exports[_0xd793('0xc1')]=function(_0x5003da,_0x4de971,_0x258974){var _0x130f30={};var _0x11389b={};var _0x21bdc7;var _0x4b8393;return db[_0xd793('0x5c')]['findOne']({'where':{'id':_0x5003da[_0xd793('0x5f')]['id']}})[_0xd793('0x24')](handleEntityNotFound(_0x4de971,null))[_0xd793('0x24')](function(_0x12cb6b){if(_0x12cb6b){_0x21bdc7=_0x12cb6b;_0x11389b[_0xd793('0x4e')]=_['keys'](db[_0xd793('0xa4')][_0xd793('0x60')]);_0x11389b['query']=_[_0xd793('0x4b')](_0x5003da[_0xd793('0x4a')]);_0x11389b['filters']=_[_0xd793('0x4d')](_0x11389b[_0xd793('0x4e')],_0x11389b[_0xd793('0x4a')]);_0x130f30[_0xd793('0x4f')]=_[_0xd793('0x4d')](_0x11389b[_0xd793('0x4e')],qs[_0xd793('0x50')](_0x5003da[_0xd793('0x4a')][_0xd793('0x50')]));_0x130f30['attributes']=_0x130f30[_0xd793('0x4f')][_0xd793('0x51')]?_0x130f30[_0xd793('0x4f')]:_0x11389b[_0xd793('0x4e')];_0x130f30[_0xd793('0x54')]=qs[_0xd793('0x55')](_0x5003da[_0xd793('0x4a')][_0xd793('0x55')]);_0x130f30[_0xd793('0x56')]=qs[_0xd793('0x4c')](_[_0xd793('0x57')](_0x5003da[_0xd793('0x4a')],_0x11389b[_0xd793('0x4c')]));if(_0x5003da[_0xd793('0x4a')][_0xd793('0x58')]){_0x130f30[_0xd793('0x56')]=_['merge'](_0x130f30[_0xd793('0x56')],{'$or':_[_0xd793('0x46')](_0x130f30[_0xd793('0x4f')],function(_0x43bafc){var _0x486a5c={};_0x486a5c[_0x43bafc]={'$like':'%'+_0x5003da['query'][_0xd793('0x58')]+'%'};return _0x486a5c;})});}_0x130f30=_[_0xd793('0x59')]({},_0x130f30,_0x5003da[_0xd793('0x5b')]);return _0x21bdc7['getAgents'](_0x130f30);}})['then'](function(_0x2ea849){if(_0x2ea849){_0x4b8393=_0x2ea849[_0xd793('0x51')];if(!_0x5003da['query'][_0xd793('0x52')]('nolimit')){_0x130f30['limit']=qs[_0xd793('0x35')](_0x5003da[_0xd793('0x4a')][_0xd793('0x35')]);_0x130f30[_0xd793('0x34')]=qs['offset'](_0x5003da['query'][_0xd793('0x34')]);}return _0x21bdc7[_0xd793('0xc1')](_0x130f30);}})[_0xd793('0x24')](function(_0x1acaa9){if(_0x1acaa9){return _0x1acaa9?{'count':_0x4b8393,'rows':_0x1acaa9}:null;}})[_0xd793('0x24')](respondWithResult(_0x4de971,null))[_0xd793('0x2f')](handleError(_0x4de971,null));};exports['send']=function(_0x31290f,_0x26c53c,_0x344128){var _0x36b58f,_0x277ee4,_0x3b9805;if(_[_0xd793('0x83')](_0x31290f[_0xd793('0x6d')][_0xd793('0x6d')])||_0x31290f[_0xd793('0x6d')][_0xd793('0x6d')]===''){throw new db['Sequelize']['ValidationError'](_0xd793('0x84'));}if(_['isNil'](_0x31290f[_0xd793('0x6d')]['to'])){}_0x36b58f=_0x31290f[_0xd793('0x6d')]['to'];return db[_0xd793('0x5c')][_0xd793('0x73')]({'where':{'id':_0x31290f[_0xd793('0x5f')]['id']}})['then'](handleEntityNotFound(_0x26c53c,null))['then'](function(_0x551d69){if(_0x551d69){return db[_0xd793('0x5c')][_0xd793('0x63')]({'where':{'id':_0x551d69['id']},'include':[{'model':db['CmList'],'as':_0xd793('0x89'),'include':[{'model':db['CmContact'],'as':_0xd793('0x8b'),'where':{[_0x551d69[_0xd793('0x85')]]:_0x36b58f},'limit':0x1,'order':[['updatedAt',_0xd793('0x8c')]]}]}]})[_0xd793('0x24')](handleEntityNotFound(_0x26c53c,null))[_0xd793('0x24')](function(_0x450dbf){if(_0x450dbf&&_0x450dbf[_0xd793('0x89')]){_0x277ee4=_0x450dbf[_0xd793('0x3c')]({'plain':!![]});if(_0x277ee4[_0xd793('0x89')]&&_0x277ee4[_0xd793('0x89')][_0xd793('0x8b')][_0xd793('0x51')]){return _0x277ee4[_0xd793('0x89')][_0xd793('0x8b')][0x0];}return db[_0xd793('0x8a')]['create'](_[_0xd793('0x1b')](_0x31290f['body'],{'firstName':_0x36b58f,[_0x450dbf[_0xd793('0x85')]]:_0x36b58f,'phone':_0x36b58f,'ListId':_0x277ee4['ListId']}));}})[_0xd793('0x24')](handleEntityNotFound(_0x26c53c,null))[_0xd793('0x24')](function(_0x432b09){if(_0x432b09){_0x3b9805=_0x432b09;return db['OpenchannelInteraction'][_0xd793('0x63')]({'where':{'ContactId':_0x3b9805['id'],'closed':![],'OpenchannelAccountId':_0x277ee4['id']}})[_0xd793('0x24')](function(_0x2c3bdb){if(_0x2c3bdb){return[_0x2c3bdb,![]];}return db[_0xd793('0x97')][_0xd793('0x64')]({'UserId':_0x31290f['user']['id'],'ContactId':_0x3b9805['id'],'OpenchannelAccountId':_0x277ee4['id'],'lastMsgDirection':'out','Messages':[_[_0xd793('0x59')](_0x31290f['body'],{'read':![],'body':_0x31290f[_0xd793('0x6d')]['body'],'OpenchannelAccountId':_0x277ee4['id'],'UserId':_0x31290f[_0xd793('0x65')]['id'],'ContactId':_0x3b9805['id']})]},{'include':[{'model':db[_0xd793('0xa1')],'as':_0xd793('0xc2')}]})[_0xd793('0x24')](function(_0xdb74d2){return[_0xdb74d2,!![]];});});}})[_0xd793('0x99')](function(_0x440c5d,_0x315cd5){if(_0x315cd5){return _0x440c5d;}return db[_0xd793('0xa1')][_0xd793('0x64')](_[_0xd793('0x59')](_0x31290f['body'],{'read':![],'body':_0x31290f[_0xd793('0x6d')][_0xd793('0x6d')],'OpenchannelAccountId':_0x277ee4['id'],'OpenchannelInteractionId':_0x440c5d['id'],'UserId':_0x31290f[_0xd793('0x65')]['id'],'ContactId':_0x3b9805['id']}))['then'](function(_0x4b502e){_0x440c5d[_0xd793('0xc3')]['Messages']=[];_0x440c5d[_0xd793('0xc3')]['Messages']['push'](_0x4b502e[_0xd793('0xc3')]);return _0x440c5d;});});}})[_0xd793('0x24')](respondWithResult(_0x26c53c,null))['catch'](handleError(_0x26c53c,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 1d8bcc0..948d7b5 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 _0x6d70=['save','update','remove','emit','hasOwnProperty','exports','OpenchannelAccount','setMaxListeners'];(function(_0x5c86f4,_0x471488){var _0x129e8f=function(_0x2713ad){while(--_0x2713ad){_0x5c86f4['push'](_0x5c86f4['shift']());}};_0x129e8f(++_0x471488);}(_0x6d70,0x66));var _0x06d7=function(_0x194acc,_0x16a88a){_0x194acc=_0x194acc-0x0;var _0x2b7aab=_0x6d70[_0x194acc];return _0x2b7aab;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x06d7('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x06d7('0x1')](0x0);var events={'afterCreate':_0x06d7('0x2'),'afterUpdate':_0x06d7('0x3'),'afterDestroy':_0x06d7('0x4')};function emitEvent(_0xe822f3){return function(_0x455b6e,_0x44860b,_0xd33ee1){OpenchannelAccountEvents[_0x06d7('0x5')](_0xe822f3+':'+_0x455b6e['id'],_0x455b6e);OpenchannelAccountEvents[_0x06d7('0x5')](_0xe822f3,_0x455b6e);_0xd33ee1(null);};}for(var e in events){if(events[_0x06d7('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x06d7('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xe49d=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','emit','exports','events'];(function(_0x21d2b1,_0x523bde){var _0x12c151=function(_0x4d22c5){while(--_0x4d22c5){_0x21d2b1['push'](_0x21d2b1['shift']());}};_0x12c151(++_0x523bde);}(_0xe49d,0x148));var _0xde49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe49d[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xde49('0x0'));var OpenchannelAccount=require(_0xde49('0x1'))['db'][_0xde49('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xde49('0x3')](0x0);var events={'afterCreate':_0xde49('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4b80b4){return function(_0x34418e,_0x1a965c,_0x1e8f8a){OpenchannelAccountEvents[_0xde49('0x5')](_0x4b80b4+':'+_0x34418e['id'],_0x34418e);OpenchannelAccountEvents['emit'](_0x4b80b4,_0x34418e);_0x1e8f8a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xde49('0x6')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 03e04e5..753ccd2 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 _0xf6c6=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelAccount','openchannel_accounts','util'];(function(_0x41ddf4,_0x1a9fd8){var _0x451c18=function(_0x213430){while(--_0x213430){_0x41ddf4['push'](_0x41ddf4['shift']());}};_0x451c18(++_0x1a9fd8);}(_0xf6c6,0x154));var _0x6f6c=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xf6c6[_0x56916d];return _0x2b7f1f;};'use strict';var _=require('lodash');var util=require(_0x6f6c('0x0'));var logger=require('../../config/logger')(_0x6f6c('0x1'));var moment=require(_0x6f6c('0x2'));var BPromise=require(_0x6f6c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f6c('0x4'));var rimraf=require(_0x6f6c('0x5'));var config=require(_0x6f6c('0x6'));var attributes=require('./openchannelAccount.attributes');module[_0x6f6c('0x7')]=function(_0x475482,_0x2b259e){return _0x475482[_0x6f6c('0x8')](_0x6f6c('0x9'),attributes,{'tableName':_0x6f6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54da=['path','rimraf','../../config/environment','./openchannelAccount.attributes','define','lodash','../../config/logger','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x54da,0x9d));var _0xa54d=function(_0xa43082,_0x24156b){_0xa43082=_0xa43082-0x0;var _0x64a0c6=_0x54da[_0xa43082];return _0x64a0c6;};'use strict';var _=require(_0xa54d('0x0'));var util=require('util');var logger=require(_0xa54d('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa54d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa54d('0x3'));var rimraf=require(_0xa54d('0x4'));var config=require(_0xa54d('0x5'));var attributes=require(_0xa54d('0x6'));module['exports']=function(_0x57f10a,_0x63ca18){return _0x57f10a[_0xa54d('0x7')]('OpenchannelAccount',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 1295dcd..cd546d2 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 _0x9fd8=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result'];(function(_0x2a44ce,_0x476283){var _0x37b680=function(_0x5b9cd8){while(--_0x5b9cd8){_0x2a44ce['push'](_0x2a44ce['shift']());}};_0x37b680(++_0x476283);}(_0x9fd8,0x1b4));var _0x89fd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9fd8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x89fd('0x0'));var util=require(_0x89fd('0x1'));var moment=require(_0x89fd('0x2'));var BPromise=require(_0x89fd('0x3'));var rs=require(_0x89fd('0x4'));var fs=require('fs');var Redis=require(_0x89fd('0x5'));var db=require(_0x89fd('0x6'))['db'];var utils=require(_0x89fd('0x7'));var logger=require(_0x89fd('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x89fd('0x9'));var client=jayson['client'][_0x89fd('0xa')]({'port':0x232a});config[_0x89fd('0xb')]=_[_0x89fd('0xc')](config['redis'],{'host':_0x89fd('0xd'),'port':0x18eb});var socket=require(_0x89fd('0xe'))(new Redis(config['redis']));require(_0x89fd('0xf'))[_0x89fd('0x10')](socket);function respondWithRpcPromise(_0x5ab7ca,_0x57b395,_0x2ae6f3){return new BPromise(function(_0x31c92c,_0x7c16c0){return client[_0x89fd('0x11')](_0x5ab7ca,_0x2ae6f3)[_0x89fd('0x12')](function(_0x65a4b0){logger[_0x89fd('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x57b395,_0x89fd('0x14'));logger[_0x89fd('0x15')](_0x89fd('0x16'),_0x57b395,_0x89fd('0x14'),JSON[_0x89fd('0x17')](_0x65a4b0));if(_0x65a4b0[_0x89fd('0x18')]){if(_0x65a4b0['error']['code']===0x1f4){logger['error'](_0x89fd('0x19'),_0x57b395,_0x65a4b0['error'][_0x89fd('0x1a')]);return _0x7c16c0(_0x65a4b0['error'][_0x89fd('0x1a')]);}logger[_0x89fd('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x57b395,_0x65a4b0[_0x89fd('0x18')]['message']);return _0x31c92c(_0x65a4b0[_0x89fd('0x18')][_0x89fd('0x1a')]);}else{logger['info'](_0x89fd('0x19'),_0x57b395,_0x89fd('0x14'));_0x31c92c(_0x65a4b0[_0x89fd('0x1b')][_0x89fd('0x1a')]);}})[_0x89fd('0x1c')](function(_0x804267){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x57b395,_0x804267);_0x7c16c0(_0x804267);});});} \ No newline at end of file +var _0x90f0=['redis','register','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x90f0,0xfe));var _0x090f=function(_0x218f78,_0xa37e62){_0x218f78=_0x218f78-0x0;var _0xc7da1b=_0x90f0[_0x218f78];return _0xc7da1b;};'use strict';var _=require(_0x090f('0x0'));var util=require(_0x090f('0x1'));var moment=require(_0x090f('0x2'));var BPromise=require(_0x090f('0x3'));var rs=require(_0x090f('0x4'));var fs=require('fs');var Redis=require(_0x090f('0x5'));var db=require(_0x090f('0x6'))['db'];var utils=require(_0x090f('0x7'));var logger=require(_0x090f('0x8'))(_0x090f('0x9'));var config=require(_0x090f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x090f('0xb')][_0x090f('0xc')]({'port':0x232a});config['redis']=_[_0x090f('0xd')](config['redis'],{'host':_0x090f('0xe'),'port':0x18eb});var socket=require(_0x090f('0xf'))(new Redis(config[_0x090f('0x10')]));require('./openchannelAccount.socket')[_0x090f('0x11')](socket);function respondWithRpcPromise(_0x208032,_0x5dd9dd,_0x431711){return new BPromise(function(_0xe84aa0,_0x162f92){return client['request'](_0x208032,_0x431711)['then'](function(_0x4a30a0){logger[_0x090f('0x12')](_0x090f('0x13'),_0x5dd9dd,_0x090f('0x14'));logger[_0x090f('0x15')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5dd9dd,'request\x20sent',JSON[_0x090f('0x16')](_0x4a30a0));if(_0x4a30a0['error']){if(_0x4a30a0[_0x090f('0x17')]['code']===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5dd9dd,_0x4a30a0[_0x090f('0x17')][_0x090f('0x18')]);return _0x162f92(_0x4a30a0[_0x090f('0x17')][_0x090f('0x18')]);}logger[_0x090f('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x5dd9dd,_0x4a30a0[_0x090f('0x17')]['message']);return _0xe84aa0(_0x4a30a0[_0x090f('0x17')][_0x090f('0x18')]);}else{logger[_0x090f('0x12')](_0x090f('0x13'),_0x5dd9dd,_0x090f('0x14'));_0xe84aa0(_0x4a30a0[_0x090f('0x19')]['message']);}})[_0x090f('0x1a')](function(_0x266528){logger[_0x090f('0x17')](_0x090f('0x13'),_0x5dd9dd,_0x266528);_0x162f92(_0x266528);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index c6e8ad1..a97b2d5 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 _0xb547=['save','remove','register','openchannelAccount:'];(function(_0x20343a,_0x40738f){var _0x43157c=function(_0x356625){while(--_0x356625){_0x20343a['push'](_0x20343a['shift']());}};_0x43157c(++_0x40738f);}(_0xb547,0x74));var _0x7b54=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0xb547[_0x47242d];return _0x30273a;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x7b54('0x0'),_0x7b54('0x1'),'update'];function createListener(_0x475e42,_0x3b6816){return function(_0x40a3d4){_0x3b6816['emit'](_0x475e42,_0x40a3d4);};}function removeListener(_0x33addb,_0xef84fd){return function(){OpenchannelAccountEvents['removeListener'](_0x33addb,_0xef84fd);};}exports[_0x7b54('0x2')]=function(_0x41b960){for(var _0xbe0c7c=0x0,_0x56f4e0=events['length'];_0xbe0c7c<_0x56f4e0;_0xbe0c7c++){var _0x17c1ae=events[_0xbe0c7c];var _0x53c252=createListener(_0x7b54('0x3')+_0x17c1ae,_0x41b960);OpenchannelAccountEvents['on'](_0x17c1ae,_0x53c252);}}; \ No newline at end of file +var _0x71df=['save','update','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x23b874,_0x218b1c){var _0x38a87c=function(_0x13b74f){while(--_0x13b74f){_0x23b874['push'](_0x23b874['shift']());}};_0x38a87c(++_0x218b1c);}(_0x71df,0x18f));var _0xf71d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71df[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelAccountEvents=require(_0xf71d('0x0'));var events=[_0xf71d('0x1'),'remove',_0xf71d('0x2')];function createListener(_0x5adc47,_0x391447){return function(_0x36e311){_0x391447[_0xf71d('0x3')](_0x5adc47,_0x36e311);};}function removeListener(_0x598aa2,_0x465be4){return function(){OpenchannelAccountEvents[_0xf71d('0x4')](_0x598aa2,_0x465be4);};}exports[_0xf71d('0x5')]=function(_0x425883){for(var _0xf9b4c1=0x0,_0x15f774=events[_0xf71d('0x6')];_0xf9b4c1<_0x15f774;_0xf9b4c1++){var _0x228421=events[_0xf9b4c1];var _0x272ad2=createListener(_0xf71d('0x7')+_0x228421,_0x425883);OpenchannelAccountEvents['on'](_0x228421,_0x272ad2);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index ccc73ca..80dc972 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 _0x3ff2=['post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','index','show'];(function(_0x536425,_0x57c4c5){var _0x6a868e=function(_0x5bd26e){while(--_0x5bd26e){_0x536425['push'](_0x536425['shift']());}};_0x6a868e(++_0x57c4c5);}(_0x3ff2,0x183));var _0x23ff=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3ff2[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x23ff('0x0'));var util=require(_0x23ff('0x1'));var path=require(_0x23ff('0x2'));var timeout=require(_0x23ff('0x3'));var express=require(_0x23ff('0x4'));var router=express['Router']();var fs_extra=require(_0x23ff('0x5'));var auth=require(_0x23ff('0x6'));var interaction=require(_0x23ff('0x7'));var config=require(_0x23ff('0x8'));var controller=require(_0x23ff('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x23ff('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x23ff('0xb')]);router[_0x23ff('0xc')]('/',auth[_0x23ff('0xd')](),controller[_0x23ff('0xe')]);router[_0x23ff('0xf')](_0x23ff('0x10'),auth['isAuthenticated'](),controller[_0x23ff('0x11')]);router[_0x23ff('0x12')]('/:id',auth[_0x23ff('0xd')](),controller[_0x23ff('0x13')]);module[_0x23ff('0x14')]=router; \ No newline at end of file +var _0xb427=['Router','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','exports','util','express'];(function(_0x390d49,_0x1af9dd){var _0x533cea=function(_0x33458b){while(--_0x33458b){_0x390d49['push'](_0x390d49['shift']());}};_0x533cea(++_0x1af9dd);}(_0xb427,0x98));var _0x7b42=function(_0xc5eaba,_0x5321d5){_0xc5eaba=_0xc5eaba-0x0;var _0x1a4cba=_0xb427[_0xc5eaba];return _0x1a4cba;};'use strict';var multer=require('multer');var util=require(_0x7b42('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7b42('0x1'));var router=express[_0x7b42('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7b42('0x3'));var controller=require(_0x7b42('0x4'));router[_0x7b42('0x5')]('/',auth[_0x7b42('0x6')](),controller[_0x7b42('0x7')]);router['get'](_0x7b42('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x7b42('0x9')]('/',auth[_0x7b42('0x6')](),controller[_0x7b42('0xa')]);router[_0x7b42('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x7b42('0x8'),auth[_0x7b42('0x6')](),controller[_0x7b42('0xc')]);module[_0x7b42('0xd')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 580be89..4a42c6c 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 _0xaeca=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0xaeca,0x1da));var _0xaaec=function(_0x3f7830,_0x2ef515){_0x3f7830=_0x3f7830-0x0;var _0x392bcf=_0xaeca[_0x3f7830];return _0x392bcf;};'use strict';var Sequelize=require('sequelize');module[_0xaaec('0x0')]={'priority':{'type':Sequelize[_0xaaec('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xaaec('0x2')],'allowNull':![],'defaultValue':_0xaaec('0x3')},'appdata':{'type':Sequelize[_0xaaec('0x4')]()},'description':{'type':Sequelize[_0xaaec('0x2')]},'interval':{'type':Sequelize[_0xaaec('0x2')],'defaultValue':_0xaaec('0x5')}}; \ No newline at end of file +var _0x2b14=['STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x8ed70,_0x196cd3){var _0x2b84e9=function(_0x3d15b6){while(--_0x3d15b6){_0x8ed70['push'](_0x8ed70['shift']());}};_0x2b84e9(++_0x196cd3);}(_0x2b14,0xa3));var _0x42b1=function(_0x376f34,_0x439bce){_0x376f34=_0x376f34-0x0;var _0xe06510=_0x2b14[_0x376f34];return _0xe06510;};'use strict';var Sequelize=require(_0x42b1('0x0'));module[_0x42b1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x42b1('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x42b1('0x3')]()},'description':{'type':Sequelize[_0x42b1('0x2')]},'interval':{'type':Sequelize[_0x42b1('0x2')],'defaultValue':_0x42b1('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index ec7624f..9336fcb 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 _0x4c18=['request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir'];(function(_0xb677de,_0x120a0b){var _0x4e6f03=function(_0x34b2a8){while(--_0x34b2a8){_0xb677de['push'](_0xb677de['shift']());}};_0x4e6f03(++_0x120a0b);}(_0x4c18,0xe4));var _0x84c1=function(_0x431b80,_0x34c73a){_0x431b80=_0x431b80-0x0;var _0x39f78f=_0x4c18[_0x431b80];return _0x39f78f;};'use strict';var emlformat=require(_0x84c1('0x0'));var rimraf=require(_0x84c1('0x1'));var zipdir=require(_0x84c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x84c1('0x3'));var moment=require(_0x84c1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x84c1('0x5'));var util=require(_0x84c1('0x6'));var path=require(_0x84c1('0x7'));var sox=require(_0x84c1('0x8'));var csv=require(_0x84c1('0x9'));var ejs=require(_0x84c1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84c1('0xb'));var squel=require(_0x84c1('0xc'));var crypto=require(_0x84c1('0xd'));var jsforce=require(_0x84c1('0xe'));var deskjs=require(_0x84c1('0xf'));var toCsv=require(_0x84c1('0x9'));var querystring=require(_0x84c1('0x10'));var Papa=require(_0x84c1('0x11'));var Redis=require(_0x84c1('0x12'));var authService=require(_0x84c1('0x13'));var qs=require(_0x84c1('0x14'));var as=require(_0x84c1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x84c1('0x16'));var utils=require(_0x84c1('0x17'));var config=require(_0x84c1('0x18'));var licenseUtil=require(_0x84c1('0x19'));var db=require(_0x84c1('0x1a'))['db'];function respondWithStatusCode(_0x4ce45c,_0x47d525){_0x47d525=_0x47d525||0xcc;return function(_0x4ab8c9){if(_0x4ab8c9){return _0x4ce45c[_0x84c1('0x1b')](_0x47d525);}return _0x4ce45c[_0x84c1('0x1c')](_0x47d525)[_0x84c1('0x1d')]();};}function respondWithResult(_0x51b359,_0x1ed878){_0x1ed878=_0x1ed878||0xc8;return function(_0x49cd44){if(_0x49cd44){return _0x51b359[_0x84c1('0x1c')](_0x1ed878)[_0x84c1('0x1e')](_0x49cd44);}};}function respondWithFilteredResult(_0x50ff37,_0x455d9d){return function(_0x4eb9f9){if(_0x4eb9f9){var _0x10ecbb=_0x4eb9f9[_0x84c1('0x1f')],_0x2c5b7d=_0x455d9d[_0x84c1('0x20')],_0x3237d4=_0x455d9d[_0x84c1('0x20')]+_0x455d9d[_0x84c1('0x21')],_0x5f05f0;if(_0x3237d4>=_0x10ecbb){_0x3237d4=_0x10ecbb;_0x5f05f0=0xc8;}else{_0x5f05f0=0xce;}_0x50ff37['status'](_0x5f05f0);return _0x50ff37['set']('Content-Range',_0x2c5b7d+'-'+_0x3237d4+'/'+_0x10ecbb)[_0x84c1('0x1e')](_0x4eb9f9);}return null;};}function patchUpdates(_0x358ba9){return function(_0x454544){try{jsonpatch[_0x84c1('0x22')](_0x454544,_0x358ba9,!![]);}catch(_0x5d13fa){return BPromise[_0x84c1('0x23')](_0x5d13fa);}return _0x454544[_0x84c1('0x24')]();};}function saveUpdates(_0x418154,_0x5868cc){return function(_0xcd773f){if(_0xcd773f){return _0xcd773f[_0x84c1('0x25')](_0x418154)[_0x84c1('0x26')](function(_0x20b62a){return _0x20b62a;});}return null;};}function removeEntity(_0x147087,_0x3e12d2){return function(_0x295ea6){if(_0x295ea6){return _0x295ea6[_0x84c1('0x27')]()['then'](function(){_0x147087[_0x84c1('0x1c')](0xcc)[_0x84c1('0x1d')]();});}};}function handleEntityNotFound(_0x102363,_0x420938){return function(_0x4f2ee6){if(!_0x4f2ee6){_0x102363[_0x84c1('0x1b')](0x194);}return _0x4f2ee6;};}function handleError(_0x3b9d8a,_0xf8a503){_0xf8a503=_0xf8a503||0x1f4;return function(_0x342c51){logger[_0x84c1('0x28')](_0x342c51[_0x84c1('0x29')]);if(_0x342c51[_0x84c1('0x2a')]){delete _0x342c51[_0x84c1('0x2a')];}_0x3b9d8a[_0x84c1('0x1c')](_0xf8a503)[_0x84c1('0x2b')](_0x342c51);};}exports[_0x84c1('0x2c')]=function(_0x246dad,_0x1313fc){var _0x1026b9={},_0x11477f={},_0x8eeb63={'count':0x0,'rows':[]};var _0x367aae=_[_0x84c1('0x2d')](db[_0x84c1('0x2e')][_0x84c1('0x2f')],function(_0x480691){return{'name':_0x480691['fieldName'],'type':_0x480691[_0x84c1('0x30')]['key']};});_0x11477f['model']=_[_0x84c1('0x2d')](_0x367aae,_0x84c1('0x2a'));_0x11477f[_0x84c1('0x31')]=_[_0x84c1('0x32')](_0x246dad[_0x84c1('0x31')]);_0x11477f[_0x84c1('0x33')]=_[_0x84c1('0x34')](_0x11477f[_0x84c1('0x35')],_0x11477f[_0x84c1('0x31')]);_0x1026b9[_0x84c1('0x36')]=_[_0x84c1('0x34')](_0x11477f[_0x84c1('0x35')],qs[_0x84c1('0x37')](_0x246dad[_0x84c1('0x31')]['fields']));_0x1026b9[_0x84c1('0x36')]=_0x1026b9[_0x84c1('0x36')][_0x84c1('0x38')]?_0x1026b9[_0x84c1('0x36')]:_0x11477f[_0x84c1('0x35')];if(!_0x246dad['query'][_0x84c1('0x39')](_0x84c1('0x3a'))){_0x1026b9['limit']=qs[_0x84c1('0x21')](_0x246dad['query'][_0x84c1('0x21')]);_0x1026b9['offset']=qs[_0x84c1('0x20')](_0x246dad[_0x84c1('0x31')][_0x84c1('0x20')]);}_0x1026b9[_0x84c1('0x3b')]=qs[_0x84c1('0x3c')](_0x246dad[_0x84c1('0x31')][_0x84c1('0x3c')]);_0x1026b9[_0x84c1('0x3d')]=qs['filters'](_[_0x84c1('0x3e')](_0x246dad[_0x84c1('0x31')],_0x11477f['filters']),_0x367aae);if(_0x246dad[_0x84c1('0x31')][_0x84c1('0x3f')]){_0x1026b9[_0x84c1('0x3d')]=_[_0x84c1('0x40')](_0x1026b9[_0x84c1('0x3d')],{'$or':_[_0x84c1('0x2d')](_0x367aae,function(_0x46f544){if(_0x46f544[_0x84c1('0x30')]!==_0x84c1('0x41')){var _0x2c36f2={};_0x2c36f2[_0x46f544[_0x84c1('0x2a')]]={'$like':'%'+_0x246dad['query']['filter']+'%'};return _0x2c36f2;}})});}_0x1026b9=_[_0x84c1('0x40')]({},_0x1026b9,_0x246dad['options']);var _0x835ab2={'where':_0x1026b9[_0x84c1('0x3d')]};return db[_0x84c1('0x2e')]['count'](_0x835ab2)[_0x84c1('0x26')](function(_0x1ea4f6){_0x8eeb63[_0x84c1('0x1f')]=_0x1ea4f6;if(_0x246dad[_0x84c1('0x31')][_0x84c1('0x42')]){_0x1026b9[_0x84c1('0x43')]=[{'all':!![]}];}return db[_0x84c1('0x2e')][_0x84c1('0x44')](_0x1026b9);})[_0x84c1('0x26')](function(_0x2bb0b1){_0x8eeb63[_0x84c1('0x45')]=_0x2bb0b1;return _0x8eeb63;})[_0x84c1('0x26')](respondWithFilteredResult(_0x1313fc,_0x1026b9))[_0x84c1('0x46')](handleError(_0x1313fc,null));};exports[_0x84c1('0x47')]=function(_0x51fd1d,_0x3e888b){var _0x2b9cbb={'raw':!![],'where':{'id':_0x51fd1d['params']['id']}},_0x3ad016={};_0x3ad016[_0x84c1('0x35')]=_[_0x84c1('0x32')](db[_0x84c1('0x2e')]['rawAttributes']);_0x3ad016[_0x84c1('0x31')]=_[_0x84c1('0x32')](_0x51fd1d['query']);_0x3ad016[_0x84c1('0x33')]=_[_0x84c1('0x34')](_0x3ad016[_0x84c1('0x35')],_0x3ad016[_0x84c1('0x31')]);_0x2b9cbb['attributes']=_[_0x84c1('0x34')](_0x3ad016[_0x84c1('0x35')],qs['fields'](_0x51fd1d[_0x84c1('0x31')][_0x84c1('0x37')]));_0x2b9cbb[_0x84c1('0x36')]=_0x2b9cbb[_0x84c1('0x36')][_0x84c1('0x38')]?_0x2b9cbb['attributes']:_0x3ad016[_0x84c1('0x35')];if(_0x51fd1d[_0x84c1('0x31')][_0x84c1('0x42')]){_0x2b9cbb[_0x84c1('0x43')]=[{'all':!![]}];}_0x2b9cbb=_[_0x84c1('0x40')]({},_0x2b9cbb,_0x51fd1d[_0x84c1('0x48')]);return db[_0x84c1('0x2e')][_0x84c1('0x49')](_0x2b9cbb)[_0x84c1('0x26')](handleEntityNotFound(_0x3e888b,null))[_0x84c1('0x26')](respondWithResult(_0x3e888b,null))[_0x84c1('0x46')](handleError(_0x3e888b,null));};exports[_0x84c1('0x4a')]=function(_0x52c188,_0x51965b){return db[_0x84c1('0x2e')][_0x84c1('0x4a')](_0x52c188[_0x84c1('0x4b')],{})['then'](respondWithResult(_0x51965b,0xc9))[_0x84c1('0x46')](handleError(_0x51965b,null));};exports[_0x84c1('0x25')]=function(_0x1f35b0,_0xc63bca){if(_0x1f35b0[_0x84c1('0x4b')]['id']){delete _0x1f35b0[_0x84c1('0x4b')]['id'];}return db[_0x84c1('0x2e')][_0x84c1('0x49')]({'where':{'id':_0x1f35b0['params']['id']}})['then'](handleEntityNotFound(_0xc63bca,null))[_0x84c1('0x26')](saveUpdates(_0x1f35b0[_0x84c1('0x4b')],null))[_0x84c1('0x26')](respondWithResult(_0xc63bca,null))[_0x84c1('0x46')](handleError(_0xc63bca,null));};exports[_0x84c1('0x27')]=function(_0x3ff165,_0xe01777){return db[_0x84c1('0x2e')][_0x84c1('0x49')]({'where':{'id':_0x3ff165[_0x84c1('0x4c')]['id']}})['then'](handleEntityNotFound(_0xe01777,null))[_0x84c1('0x26')](removeEntity(_0xe01777,null))['catch'](handleError(_0xe01777,null));}; \ No newline at end of file +var _0xa16e=['hasOwnProperty','limit','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','map','OpenchannelApplication','fieldName','model','query','keys','attributes','intersection','fields','length'];(function(_0x157eb6,_0x1e45c7){var _0xfadf97=function(_0x5322d5){while(--_0x5322d5){_0x157eb6['push'](_0x157eb6['shift']());}};_0xfadf97(++_0x1e45c7);}(_0xa16e,0x142));var _0xea16=function(_0x52ebbc,_0x349571){_0x52ebbc=_0x52ebbc-0x0;var _0x52bf02=_0xa16e[_0x52ebbc];return _0x52bf02;};'use strict';var emlformat=require(_0xea16('0x0'));var rimraf=require(_0xea16('0x1'));var zipdir=require(_0xea16('0x2'));var jsonpatch=require(_0xea16('0x3'));var rp=require('request-promise');var moment=require(_0xea16('0x4'));var BPromise=require(_0xea16('0x5'));var Mustache=require('mustache');var util=require(_0xea16('0x6'));var path=require(_0xea16('0x7'));var sox=require(_0xea16('0x8'));var csv=require(_0xea16('0x9'));var ejs=require(_0xea16('0xa'));var fs=require('fs');var fs_extra=require(_0xea16('0xb'));var _=require('lodash');var squel=require(_0xea16('0xc'));var crypto=require(_0xea16('0xd'));var jsforce=require(_0xea16('0xe'));var deskjs=require(_0xea16('0xf'));var toCsv=require('to-csv');var querystring=require(_0xea16('0x10'));var Papa=require(_0xea16('0x11'));var Redis=require(_0xea16('0x12'));var authService=require(_0xea16('0x13'));var qs=require(_0xea16('0x14'));var as=require(_0xea16('0x15'));var hardwareService=require(_0xea16('0x16'));var logger=require('../../config/logger')(_0xea16('0x17'));var utils=require('../../config/utils');var config=require(_0xea16('0x18'));var licenseUtil=require(_0xea16('0x19'));var db=require(_0xea16('0x1a'))['db'];function respondWithStatusCode(_0x5903f2,_0x4ccc31){_0x4ccc31=_0x4ccc31||0xcc;return function(_0x4f938b){if(_0x4f938b){return _0x5903f2[_0xea16('0x1b')](_0x4ccc31);}return _0x5903f2[_0xea16('0x1c')](_0x4ccc31)[_0xea16('0x1d')]();};}function respondWithResult(_0x867eb9,_0x416e72){_0x416e72=_0x416e72||0xc8;return function(_0x5a0562){if(_0x5a0562){return _0x867eb9[_0xea16('0x1c')](_0x416e72)['json'](_0x5a0562);}};}function respondWithFilteredResult(_0x14f607,_0x130771){return function(_0xa74647){if(_0xa74647){var _0x202d7d=_0xa74647[_0xea16('0x1e')],_0x4f9a41=_0x130771[_0xea16('0x1f')],_0x5bab01=_0x130771[_0xea16('0x1f')]+_0x130771['limit'],_0x1f87ca;if(_0x5bab01>=_0x202d7d){_0x5bab01=_0x202d7d;_0x1f87ca=0xc8;}else{_0x1f87ca=0xce;}_0x14f607['status'](_0x1f87ca);return _0x14f607[_0xea16('0x20')](_0xea16('0x21'),_0x4f9a41+'-'+_0x5bab01+'/'+_0x202d7d)[_0xea16('0x22')](_0xa74647);}return null;};}function patchUpdates(_0x5b5bb1){return function(_0x1ab4ba){try{jsonpatch[_0xea16('0x23')](_0x1ab4ba,_0x5b5bb1,!![]);}catch(_0x1dddc0){return BPromise['reject'](_0x1dddc0);}return _0x1ab4ba[_0xea16('0x24')]();};}function saveUpdates(_0x22dede,_0x170896){return function(_0x188c6d){if(_0x188c6d){return _0x188c6d[_0xea16('0x25')](_0x22dede)[_0xea16('0x26')](function(_0x17bb6c){return _0x17bb6c;});}return null;};}function removeEntity(_0x241420,_0x2037f2){return function(_0x59610e){if(_0x59610e){return _0x59610e[_0xea16('0x27')]()[_0xea16('0x26')](function(){_0x241420[_0xea16('0x1c')](0xcc)[_0xea16('0x1d')]();});}};}function handleEntityNotFound(_0x5bc237,_0x518054){return function(_0x1f5103){if(!_0x1f5103){_0x5bc237[_0xea16('0x1b')](0x194);}return _0x1f5103;};}function handleError(_0x54513c,_0x43bccc){_0x43bccc=_0x43bccc||0x1f4;return function(_0x1a3651){logger['error'](_0x1a3651[_0xea16('0x28')]);if(_0x1a3651[_0xea16('0x29')]){delete _0x1a3651['name'];}_0x54513c[_0xea16('0x1c')](_0x43bccc)[_0xea16('0x2a')](_0x1a3651);};}exports['index']=function(_0x3ecc75,_0x4169e6){var _0x187900={},_0x4a2c02={},_0x30164b={'count':0x0,'rows':[]};var _0x2fadb3=_[_0xea16('0x2b')](db[_0xea16('0x2c')]['rawAttributes'],function(_0x14cae2){return{'name':_0x14cae2[_0xea16('0x2d')],'type':_0x14cae2['type']['key']};});_0x4a2c02[_0xea16('0x2e')]=_['map'](_0x2fadb3,_0xea16('0x29'));_0x4a2c02[_0xea16('0x2f')]=_[_0xea16('0x30')](_0x3ecc75[_0xea16('0x2f')]);_0x4a2c02['filters']=_['intersection'](_0x4a2c02['model'],_0x4a2c02[_0xea16('0x2f')]);_0x187900[_0xea16('0x31')]=_[_0xea16('0x32')](_0x4a2c02[_0xea16('0x2e')],qs[_0xea16('0x33')](_0x3ecc75[_0xea16('0x2f')][_0xea16('0x33')]));_0x187900[_0xea16('0x31')]=_0x187900[_0xea16('0x31')][_0xea16('0x34')]?_0x187900[_0xea16('0x31')]:_0x4a2c02[_0xea16('0x2e')];if(!_0x3ecc75[_0xea16('0x2f')][_0xea16('0x35')]('nolimit')){_0x187900[_0xea16('0x36')]=qs[_0xea16('0x36')](_0x3ecc75['query'][_0xea16('0x36')]);_0x187900[_0xea16('0x1f')]=qs[_0xea16('0x1f')](_0x3ecc75[_0xea16('0x2f')][_0xea16('0x1f')]);}_0x187900[_0xea16('0x37')]=qs[_0xea16('0x38')](_0x3ecc75[_0xea16('0x2f')][_0xea16('0x38')]);_0x187900['where']=qs[_0xea16('0x39')](_[_0xea16('0x3a')](_0x3ecc75['query'],_0x4a2c02[_0xea16('0x39')]),_0x2fadb3);if(_0x3ecc75[_0xea16('0x2f')][_0xea16('0x3b')]){_0x187900['where']=_[_0xea16('0x3c')](_0x187900[_0xea16('0x3d')],{'$or':_['map'](_0x2fadb3,function(_0x230f6c){if(_0x230f6c[_0xea16('0x3e')]!==_0xea16('0x3f')){var _0xe4dabf={};_0xe4dabf[_0x230f6c[_0xea16('0x29')]]={'$like':'%'+_0x3ecc75[_0xea16('0x2f')]['filter']+'%'};return _0xe4dabf;}})});}_0x187900=_[_0xea16('0x3c')]({},_0x187900,_0x3ecc75['options']);var _0x1eaff9={'where':_0x187900[_0xea16('0x3d')]};return db['OpenchannelApplication'][_0xea16('0x1e')](_0x1eaff9)[_0xea16('0x26')](function(_0x248601){_0x30164b[_0xea16('0x1e')]=_0x248601;if(_0x3ecc75['query'][_0xea16('0x40')]){_0x187900[_0xea16('0x41')]=[{'all':!![]}];}return db[_0xea16('0x2c')]['findAll'](_0x187900);})['then'](function(_0x34c81c){_0x30164b[_0xea16('0x42')]=_0x34c81c;return _0x30164b;})[_0xea16('0x26')](respondWithFilteredResult(_0x4169e6,_0x187900))[_0xea16('0x43')](handleError(_0x4169e6,null));};exports[_0xea16('0x44')]=function(_0x56817b,_0x2cf074){var _0x28b9e6={'raw':!![],'where':{'id':_0x56817b[_0xea16('0x45')]['id']}},_0x231152={};_0x231152['model']=_[_0xea16('0x30')](db[_0xea16('0x2c')][_0xea16('0x46')]);_0x231152[_0xea16('0x2f')]=_[_0xea16('0x30')](_0x56817b[_0xea16('0x2f')]);_0x231152[_0xea16('0x39')]=_[_0xea16('0x32')](_0x231152[_0xea16('0x2e')],_0x231152[_0xea16('0x2f')]);_0x28b9e6[_0xea16('0x31')]=_['intersection'](_0x231152['model'],qs[_0xea16('0x33')](_0x56817b[_0xea16('0x2f')][_0xea16('0x33')]));_0x28b9e6['attributes']=_0x28b9e6[_0xea16('0x31')][_0xea16('0x34')]?_0x28b9e6[_0xea16('0x31')]:_0x231152['model'];if(_0x56817b[_0xea16('0x2f')][_0xea16('0x40')]){_0x28b9e6[_0xea16('0x41')]=[{'all':!![]}];}_0x28b9e6=_[_0xea16('0x3c')]({},_0x28b9e6,_0x56817b[_0xea16('0x47')]);return db[_0xea16('0x2c')][_0xea16('0x48')](_0x28b9e6)['then'](handleEntityNotFound(_0x2cf074,null))['then'](respondWithResult(_0x2cf074,null))[_0xea16('0x43')](handleError(_0x2cf074,null));};exports[_0xea16('0x49')]=function(_0x2e3e0a,_0xd66c6){return db[_0xea16('0x2c')][_0xea16('0x49')](_0x2e3e0a[_0xea16('0x4a')],{})[_0xea16('0x26')](respondWithResult(_0xd66c6,0xc9))[_0xea16('0x43')](handleError(_0xd66c6,null));};exports[_0xea16('0x25')]=function(_0x29a9d9,_0x3e5d92){if(_0x29a9d9[_0xea16('0x4a')]['id']){delete _0x29a9d9['body']['id'];}return db[_0xea16('0x2c')]['find']({'where':{'id':_0x29a9d9[_0xea16('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e5d92,null))[_0xea16('0x26')](saveUpdates(_0x29a9d9[_0xea16('0x4a')],null))[_0xea16('0x26')](respondWithResult(_0x3e5d92,null))[_0xea16('0x43')](handleError(_0x3e5d92,null));};exports[_0xea16('0x27')]=function(_0xe5555e,_0x4f4010){return db[_0xea16('0x2c')][_0xea16('0x48')]({'where':{'id':_0xe5555e[_0xea16('0x45')]['id']}})[_0xea16('0x26')](handleEntityNotFound(_0x4f4010,null))['then'](removeEntity(_0x4f4010,null))[_0xea16('0x43')](handleError(_0x4f4010,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index fbd4262..dd9e769 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 _0xc2f9=['bluebird','rimraf','../../config/environment','./openchannelApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment'];(function(_0x2995c2,_0x18acb4){var _0x19939a=function(_0xa38a58){while(--_0xa38a58){_0x2995c2['push'](_0x2995c2['shift']());}};_0x19939a(++_0x18acb4);}(_0xc2f9,0xe3));var _0x9c2f=function(_0x2f62e7,_0x457548){_0x2f62e7=_0x2f62e7-0x0;var _0x3170dc=_0xc2f9[_0x2f62e7];return _0x3170dc;};'use strict';var _=require(_0x9c2f('0x0'));var util=require('util');var logger=require(_0x9c2f('0x1'))('api');var moment=require(_0x9c2f('0x2'));var BPromise=require(_0x9c2f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c2f('0x4'));var config=require(_0x9c2f('0x5'));var attributes=require(_0x9c2f('0x6'));module[_0x9c2f('0x7')]=function(_0x4b1a68,_0x29cf25){return _0x4b1a68['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9c2f('0x8'),'collate':_0x9c2f('0x9')});}; \ No newline at end of file +var _0x1d38=['lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1cf3dd,_0x525769){var _0x5af8a7=function(_0x512564){while(--_0x512564){_0x1cf3dd['push'](_0x1cf3dd['shift']());}};_0x5af8a7(++_0x525769);}(_0x1d38,0x18c));var _0x81d3=function(_0xf9d2a3,_0x2cdc6a){_0xf9d2a3=_0xf9d2a3-0x0;var _0x5464a4=_0x1d38[_0xf9d2a3];return _0x5464a4;};'use strict';var _=require(_0x81d3('0x0'));var util=require('util');var logger=require(_0x81d3('0x1'))(_0x81d3('0x2'));var moment=require(_0x81d3('0x3'));var BPromise=require(_0x81d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x81d3('0x5'));var config=require(_0x81d3('0x6'));var attributes=require(_0x81d3('0x7'));module['exports']=function(_0x515f0d,_0x3bbd15){return _0x515f0d[_0x81d3('0x8')](_0x81d3('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x81d3('0xa'),'collate':_0x81d3('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 5450af7..4d763f0 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 _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x45cde2,_0x23a9ea){var _0x55be03=function(_0x2a9a5b){while(--_0x2a9a5b){_0x45cde2['push'](_0x45cde2['shift']());}};_0x55be03(++_0x23a9ea);}(_0xb10b,0x12a));var _0xbb10=function(_0x3f146c,_0x42e0dc){_0x3f146c=_0x3f146c-0x0;var _0x407f72=_0xb10b[_0x3f146c];return _0x407f72;};'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?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x149478,_0x380771){var _0x2bcd4d=function(_0x3fa152){while(--_0x3fa152){_0x149478['push'](_0x149478['shift']());}};_0x2bcd4d(++_0x380771);}(_0xb10b,0x12a));var _0xbb10=function(_0x22c50e,_0x4ea131){_0x22c50e=_0x22c50e-0x0;var _0x500f85=_0xb10b[_0x22c50e];return _0x500f85;};'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?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 175ee9b..1d78a6a 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 _0xa9e0=['tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','show','/:id/messages','isAuthenticated','getMessages','create','post','addMessage','/:id/tags'];(function(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xf')]);router[_0x0a9e('0x10')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['post'](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0x13')](_0x0a9e('0x14'),_0x0a9e('0x15')),controller[_0x0a9e('0x16')]);router['put'](_0x0a9e('0x17'),auth['isAuthenticated'](),interaction[_0x0a9e('0x13')]('openchannel',_0x0a9e('0x18')),controller[_0x0a9e('0x19')]);router['delete'](_0x0a9e('0x17'),auth['isAuthenticated'](),interaction[_0x0a9e('0x13')](_0x0a9e('0x14'),_0x0a9e('0x1a')),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x1c')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);module[_0x0a9e('0x1e')]=router; \ No newline at end of file +var _0xa9e0=['tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','show','/:id/messages','isAuthenticated','getMessages','create','post','addMessage','/:id/tags'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_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['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/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xf')]);router[_0x0a9e('0x10')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['post'](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0x13')](_0x0a9e('0x14'),_0x0a9e('0x15')),controller[_0x0a9e('0x16')]);router['put'](_0x0a9e('0x17'),auth['isAuthenticated'](),interaction[_0x0a9e('0x13')]('openchannel',_0x0a9e('0x18')),controller[_0x0a9e('0x19')]);router['delete'](_0x0a9e('0x17'),auth['isAuthenticated'](),interaction[_0x0a9e('0x13')](_0x0a9e('0x14'),_0x0a9e('0x1a')),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x1c')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);module[_0x0a9e('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 781129a..d59c804 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 _0xb9a7=['STRING','DATE','ENUM','out','exports'];(function(_0x4ffffb,_0x52745e){var _0x55f45c=function(_0x30c980){while(--_0x30c980){_0x4ffffb['push'](_0x4ffffb['shift']());}};_0x55f45c(++_0x52745e);}(_0xb9a7,0x112));var _0x7b9a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xb9a7[_0x209941];return _0x1e8729;};'use strict';var Sequelize=require('sequelize');module[_0x7b9a('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7b9a('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7b9a('0x1')]},'read1stAt':{'type':Sequelize[_0x7b9a('0x2')]},'threadId':{'type':Sequelize[_0x7b9a('0x1')]},'externalUrl':{'type':Sequelize[_0x7b9a('0x1')]},'lastMsgAt':{'type':Sequelize[_0x7b9a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7b9a('0x3')]('in',_0x7b9a('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7b9a('0x1')]}}; \ No newline at end of file +var _0xe1fb=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x570b34,_0x537c5c){var _0x325f61=function(_0x3dfca6){while(--_0x3dfca6){_0x570b34['push'](_0x570b34['shift']());}};_0x325f61(++_0x537c5c);}(_0xe1fb,0xe1));var _0xbe1f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe1fb[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xbe1f('0x0'));module['exports']={'closed':{'type':Sequelize[_0xbe1f('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbe1f('0x2')]},'disposition':{'type':Sequelize[_0xbe1f('0x3')]},'secondDisposition':{'type':Sequelize[_0xbe1f('0x3')]},'thirdDisposition':{'type':Sequelize[_0xbe1f('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xbe1f('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xbe1f('0x3')]},'lastMsgAt':{'type':Sequelize[_0xbe1f('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xbe1f('0x4')]('in',_0xbe1f('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbe1f('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 2547c14..97de560 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 _0x1740=['operator','$substring','split','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','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','find','UserId','body','keys','some','isEmpty','OpenchannelAccountId','concat','createdAt','parse','$lte','where','null','\x20IS\x20NULL','read','having','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','show','params','includeAll','options','create','describe','addMessage','OpenchannelMessage','ids','findOne','$gte','format','include','addTags','omit','spread','findAll','emit','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','fullname','lastName','Attachment','Messages','secret','Account','mkdirSync','Openchannel','Owner','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','System','firstName','renderFile','downloadInteraction.html','transcript-','.pdf','log','err','unlinkSync','eml-format','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','map','TagIds','forEach','Tags','catch','index','OpenchannelInteraction','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','filters','pick','select','field','color','from','tools_tags','u.id','left_join','users','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','parseSearch','search','conditions','length','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact'];(function(_0xe2e7ab,_0x79b4a8){var _0x1cab73=function(_0x3c1963){while(--_0x3c1963){_0xe2e7ab['push'](_0xe2e7ab['shift']());}};_0x1cab73(++_0x79b4a8);}(_0x1740,0x8b));var _0x0174=function(_0x557975,_0x26c055){_0x557975=_0x557975-0x0;var _0xe6897b=_0x1740[_0x557975];return _0xe6897b;};'use strict';var emlformat=require(_0x0174('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0174('0x1'));var rp=require('request-promise');var moment=require(_0x0174('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0174('0x3'));var util=require('util');var path=require(_0x0174('0x4'));var sox=require('sox');var csv=require(_0x0174('0x5'));var ejs=require(_0x0174('0x6'));var fs=require('fs');var fs_extra=require(_0x0174('0x7'));var _=require(_0x0174('0x8'));var squel=require(_0x0174('0x9'));var crypto=require(_0x0174('0xa'));var jsforce=require(_0x0174('0xb'));var deskjs=require(_0x0174('0xc'));var toCsv=require(_0x0174('0x5'));var querystring=require(_0x0174('0xd'));var Papa=require(_0x0174('0xe'));var Redis=require(_0x0174('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0174('0x10'));var pdf=require(_0x0174('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0174('0x12'))(_0x0174('0x13'));var utils=require(_0x0174('0x14'));var config=require(_0x0174('0x15'));var licenseUtil=require(_0x0174('0x16'));var db=require(_0x0174('0x17'))['db'];config[_0x0174('0x18')]=_[_0x0174('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0174('0x1a'))(new Redis(config[_0x0174('0x18')]));require(_0x0174('0x1b'))[_0x0174('0x1c')](socket);function respondWithStatusCode(_0x243149,_0x177171){_0x177171=_0x177171||0xcc;return function(_0xefc542){if(_0xefc542){return _0x243149['sendStatus'](_0x177171);}return _0x243149[_0x0174('0x1d')](_0x177171)[_0x0174('0x1e')]();};}function respondWithResult(_0x18752c,_0x4aa021){_0x4aa021=_0x4aa021||0xc8;return function(_0x57877c){if(_0x57877c){return _0x18752c[_0x0174('0x1d')](_0x4aa021)[_0x0174('0x1f')](_0x57877c);}};}function respondWithFilteredResult(_0x2526d8,_0x23817c){return function(_0x84af1a){if(_0x84af1a){var _0x2243c9=_0x84af1a[_0x0174('0x20')],_0x1b7767=_0x23817c['offset'],_0x114d0c=_0x23817c[_0x0174('0x21')]+_0x23817c['limit'],_0x445e1c;if(_0x114d0c>=_0x2243c9){_0x114d0c=_0x2243c9;_0x445e1c=0xc8;}else{_0x445e1c=0xce;}_0x2526d8[_0x0174('0x1d')](_0x445e1c);return _0x2526d8[_0x0174('0x22')](_0x0174('0x23'),_0x1b7767+'-'+_0x114d0c+'/'+_0x2243c9)[_0x0174('0x1f')](_0x84af1a);}return null;};}function patchUpdates(_0x3b947d){return function(_0xadf7e2){try{jsonpatch['apply'](_0xadf7e2,_0x3b947d,!![]);}catch(_0x4f87a1){return BPromise[_0x0174('0x24')](_0x4f87a1);}return _0xadf7e2[_0x0174('0x25')]();};}function saveUpdates(_0x2d57df,_0x4054d9){return function(_0x35e395){if(_0x35e395){return _0x35e395[_0x0174('0x26')](_0x2d57df)[_0x0174('0x27')](function(_0x58a52a){return _0x58a52a;});}return null;};}function removeEntity(_0x34c785,_0xefae11){return function(_0x5658b3){if(_0x5658b3){return _0x5658b3[_0x0174('0x28')]()['then'](function(){_0x34c785[_0x0174('0x1d')](0xcc)[_0x0174('0x1e')]();});}};}function handleEntityNotFound(_0x7ab2ac,_0x1259df){return function(_0x2a9d79){if(!_0x2a9d79){_0x7ab2ac[_0x0174('0x29')](0x194);}return _0x2a9d79;};}function handleError(_0x1e9448,_0x15b991){_0x15b991=_0x15b991||0x1f4;return function(_0x4d7e27){logger['error'](_0x4d7e27[_0x0174('0x2a')]);if(_0x4d7e27[_0x0174('0x2b')]){delete _0x4d7e27[_0x0174('0x2b')];}_0x1e9448[_0x0174('0x1d')](_0x15b991)[_0x0174('0x2c')](_0x4d7e27);};}function getInteractionUsers(_0x46be45,_0x3c15dc){return new BPromise(function(_0xb2924b,_0x19e7a0){try{if(_0x3c15dc[_0x46be45['id']]){_0x46be45['Users']=_[_0x0174('0x2d')](_0x3c15dc[_0x46be45['id']],function(_0xe95631){return{'id':_0xe95631['id'],'fullname':_0xe95631['fullname']};});}}catch(_0x37c413){_0x19e7a0(_0x37c413);}_0xb2924b(_0x46be45);});}function getInteractionTags(_0x5e21a8,_0x5cae2a){return new BPromise(function(_0x2dca12,_0x4ed830){try{if(_0x5e21a8[_0x0174('0x2e')]){_0x5e21a8['Tags']=[];_0x5e21a8['TagIds']['split'](',')[_0x0174('0x2f')](function(_0x5277ad){_0x5e21a8[_0x0174('0x30')]['push'](_0x5cae2a[_0x5277ad]);});}delete _0x5e21a8[_0x0174('0x2e')];}catch(_0x51ead8){_0x4ed830(_0x51ead8);}_0x2dca12(_0x5e21a8);});}function updateOpenchannelInteraction(_0x5bf61f,_0x171f21,_0x409da6){return new BPromise(function(_0x497829,_0x8a9bc1){return getInteractionUsers(_0x5bf61f,_0x409da6)['then'](function(_0x598c28){return getInteractionTags(_0x598c28,_0x171f21);})[_0x0174('0x27')](function(_0x1b5771){_0x497829(_0x1b5771);})[_0x0174('0x31')](function(_0x1a2263){_0x8a9bc1(_0x1a2263);});});}exports[_0x0174('0x32')]=function(_0x395fff,_0x99ad75){var _0x1c1d48={},_0x125de7={},_0x3dbf00={'count':0x0,'rows':[]};var _0x1de113=_[_0x0174('0x2d')](db[_0x0174('0x33')][_0x0174('0x34')],function(_0x1d934a){return{'name':_0x1d934a[_0x0174('0x35')],'type':_0x1d934a['type'][_0x0174('0x36')]};});_0x125de7[_0x0174('0x37')]=_[_0x0174('0x2d')](_0x1de113,_0x0174('0x2b'));_0x125de7[_0x0174('0x38')]=_['keys'](_0x395fff['query']);_0x125de7['filters']=_[_0x0174('0x39')](_0x125de7[_0x0174('0x37')],_0x125de7[_0x0174('0x38')]);_0x1c1d48['attributes']=_[_0x0174('0x39')](_0x125de7[_0x0174('0x37')],qs[_0x0174('0x3a')](_0x395fff['query'][_0x0174('0x3a')]));_0x1c1d48[_0x0174('0x3b')]=_0x1c1d48['attributes']['length']?_0x1c1d48[_0x0174('0x3b')]:_0x125de7[_0x0174('0x37')];if(!_0x395fff['query'][_0x0174('0x3c')](_0x0174('0x3d'))){_0x1c1d48[_0x0174('0x3e')]=qs[_0x0174('0x3e')](_0x395fff[_0x0174('0x38')][_0x0174('0x3e')]);_0x1c1d48['offset']=qs[_0x0174('0x21')](_0x395fff[_0x0174('0x38')][_0x0174('0x21')]);}_0x1c1d48[_0x0174('0x3f')]=qs[_0x0174('0x40')](_0x395fff[_0x0174('0x38')][_0x0174('0x40')]);_0x1c1d48['where']=qs[_0x0174('0x41')](_[_0x0174('0x42')](_0x395fff[_0x0174('0x38')],_0x125de7[_0x0174('0x41')]),_0x1de113);var _0x1c65a3=[];var _0x47d59e=squel[_0x0174('0x43')]()[_0x0174('0x44')]('id')[_0x0174('0x44')](_0x0174('0x2b'))[_0x0174('0x44')](_0x0174('0x45'))[_0x0174('0x46')](_0x0174('0x47'));var _0x433514=squel[_0x0174('0x43')]()['field'](_0x0174('0x48'))[_0x0174('0x44')]('u.fullname')[_0x0174('0x44')]('ui.OpenchannelInteractionId')[_0x0174('0x46')]('user_has_openchannel_interactions','ui')[_0x0174('0x49')](_0x0174('0x4a'),'u','u.id\x20=\x20ui.UserId');var _0x41acee=squel[_0x0174('0x43')]()[_0x0174('0x46')](_0x0174('0x4b'),'i')['left_join']('cm_contacts','c',_0x0174('0x4c'))['left_join'](_0x0174('0x4a'),'o',_0x0174('0x4d'))[_0x0174('0x49')](_0x0174('0x4e'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x0174('0x49')](_0x0174('0x4f'),'me',_0x0174('0x50'))[_0x0174('0x49')](_0x0174('0x51'),'it',_0x0174('0x52'))['left_join'](_0x0174('0x47'),'t','t.id\x20=\x20it.TagId');var _0x2b90fb=squel[_0x0174('0x53')]();var _0x4a70c8=[];var _0x1cce3c=squel[_0x0174('0x53')]();var _0x38706c;if(_0x395fff[_0x0174('0x38')]['search']){_0x38706c=as[_0x0174('0x54')](_0x395fff[_0x0174('0x38')][_0x0174('0x55')]);var _0x13aa21=_0x38706c['sqlOperator'];for(var _0x3ccd11=0x0;_0x3ccd11<_0x38706c[_0x0174('0x56')][_0x0174('0x57')];_0x3ccd11++){var _0x51d692=_0x38706c[_0x0174('0x56')][_0x3ccd11];var _0x449f91='i';var _0x2814cf=_['find'](_0x1de113,[_0x0174('0x2b'),_0x51d692['field']]);if(!_0x2814cf){switch(_0x51d692[_0x0174('0x44')]){case _0x0174('0x58'):if(_0x51d692[_0x0174('0x59')]==0x1){_0x41acee['having']('`'+_0x51d692[_0x0174('0x44')]+_0x0174('0x5a'));}else{_0x41acee['having']('`'+_0x51d692['field']+_0x0174('0x5b'));}break;case _0x0174('0x5c'):if(_0x51d692[_0x0174('0x5d')]===_0x0174('0x5e')){if(_0x51d692[_0x0174('0x59')][_0x0174('0x5f')]('\x20')[_0x0174('0x57')]>0x1){_0x2b90fb[_0x13aa21](_0x0174('0x60'),qs['getFullTextValue'](_0x51d692['value']),null);}else{var _0x1b7d1e='%'+_0x51d692[_0x0174('0x59')]+'%';_0x2b90fb[_0x13aa21](_0x0174('0x61'),_0x1b7d1e,_0x1b7d1e,_0x1b7d1e);}}else{_0x2814cf=_['find'](_0x1de113,[_0x0174('0x2b'),_0x0174('0x62')]);_0x51d692[_0x0174('0x44')]=_0x0174('0x62');_0x266b80=as[_0x0174('0x63')](_0x449f91,_0x2814cf[_0x0174('0x64')],_0x51d692);_0x2b90fb[_0x13aa21](_0x266b80[_0x0174('0x65')],_0x266b80[_0x0174('0x59')][_0x0174('0x66')],_0x266b80[_0x0174('0x59')][_0x0174('0x1e')]);}break;case _0x0174('0x67'):var _0x552519=_0x51d692[_0x0174('0x59')][_0x0174('0x5f')](',')[_0x0174('0x2d')](function(_0x217425){return Number(_0x217425);});_0x552519[_0x0174('0x2f')](function(_0x4fea05){_0x1cce3c['or'](_0x0174('0x68'),'%,'+_0x4fea05+',%');});_0x4a70c8=_['union'](_0x4a70c8,_0x552519);break;case _0x0174('0x69'):if(_0x51d692['operator']===_0x0174('0x5e')){_0x2b90fb[_0x13aa21]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x51d692[_0x0174('0x59')]+'%',null);}else{_0x2814cf=_[_0x0174('0x6a')](_0x1de113,[_0x0174('0x2b'),'UserId']);_0x51d692[_0x0174('0x44')]=_0x0174('0x6b');_0x266b80=as['buildExpression'](_0x449f91,_0x2814cf[_0x0174('0x64')],_0x51d692);_0x2b90fb[_0x13aa21](_0x266b80[_0x0174('0x65')],_0x266b80[_0x0174('0x59')][_0x0174('0x66')],_0x266b80['value']['end']);}break;case _0x0174('0x6c'):_0x266b80=as['buildExpression']('me',null,_0x51d692);_0x2b90fb[_0x13aa21](_0x266b80[_0x0174('0x65')],_0x266b80[_0x0174('0x59')][_0x0174('0x66')],_0x266b80[_0x0174('0x59')][_0x0174('0x1e')]);break;}}else{var _0x266b80=as['buildExpression'](_0x449f91,_0x2814cf[_0x0174('0x64')],_0x51d692);_0x2b90fb[_0x13aa21](_0x266b80[_0x0174('0x65')],_0x266b80[_0x0174('0x59')][_0x0174('0x66')],_0x266b80[_0x0174('0x59')][_0x0174('0x1e')]);}}}else{var _0x483f6e=_(_0x395fff[_0x0174('0x38')])[_0x0174('0x6d')]()[_0x0174('0x2d')](function(_0x1969fc){return _[_0x0174('0x6e')](_0x1de113,[_0x0174('0x2b'),_0x1969fc])?_0x1969fc:undefined;})['compact']()[_0x0174('0x59')]();if(!_[_0x0174('0x6f')](_0x483f6e)){_0x483f6e[_0x0174('0x2f')](function(_0x1e0b02){if(_0x1e0b02===_0x0174('0x70')){_0x41acee['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0x0174('0x71')](_0x395fff[_0x0174('0x38')][_0x1e0b02]));}else if(_0x1e0b02===_0x0174('0x72')){var _0x22c2a0=JSON[_0x0174('0x73')](_0x395fff[_0x0174('0x38')][_0x1e0b02])['$gte'];var _0xb0fccb=JSON[_0x0174('0x73')](_0x395fff['query'][_0x1e0b02])[_0x0174('0x74')];_0x41acee[_0x0174('0x75')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x22c2a0,_0xb0fccb);}else{if(_0x395fff['query'][_0x1e0b02]===_0x0174('0x76')){_0x41acee[_0x0174('0x75')]('i.'+_0x1e0b02+_0x0174('0x77'));}else{_0x41acee[_0x0174('0x75')]('i.'+_0x1e0b02+'\x20=\x20?',_0x395fff[_0x0174('0x38')][_0x1e0b02]);}}});}if(_0x395fff[_0x0174('0x38')][_0x0174('0x78')]){if(_0x395fff[_0x0174('0x38')]['read']==0x1){_0x41acee[_0x0174('0x79')](_0x0174('0x7a'));}else{_0x41acee[_0x0174('0x79')]('`unreadMessages`\x20>\x200');}}if(_0x395fff[_0x0174('0x38')][_0x0174('0x7b')]){_0x4a70c8=_['isArray'](_0x395fff['query']['tag'])?_0x395fff[_0x0174('0x38')][_0x0174('0x7b')]:new Array(_0x395fff[_0x0174('0x38')][_0x0174('0x7b')]);_0x4a70c8[_0x0174('0x2f')](function(_0x39c5e1){_0x1cce3c['or'](_0x0174('0x68'),'%,'+_0x39c5e1+',%');});}if(_0x395fff[_0x0174('0x38')][_0x0174('0x7c')]){var _0x3f67b3=_0x395fff[_0x0174('0x38')][_0x0174('0x7c')][_0x0174('0x7d')]('\x5c','\x5c\x5c')[_0x0174('0x7d')](/'/g,'\x27\x27');if(qs[_0x0174('0x7e')](_0x3f67b3)){_0x2b90fb['or'](_0x0174('0x7f'),_0x3f67b3+'%');}else{_0x2b90fb['or'](_0x0174('0x80'),qs[_0x0174('0x81')](_0x3f67b3))['or'](_0x0174('0x82'),_0x3f67b3+'%')['or'](_0x0174('0x83'),_0x3f67b3+'%');}}}_0x41acee['where'](_0x2b90fb);_0x41acee[_0x0174('0x84')](_0x0174('0x85'));var _0x3d09c8={'type':db[_0x0174('0x86')]['QueryTypes'][_0x0174('0x87')],'raw':!![]};var _0x4dcea5=_0x41acee[_0x0174('0x88')]();_0x4dcea5[_0x0174('0x44')](_0x0174('0x85'));_0x4dcea5[_0x0174('0x44')](_0x0174('0x89'),_0x0174('0x58'));if(_0x1c1d48['order']){_0x1c1d48[_0x0174('0x3f')][_0x0174('0x2f')](function(_0x4f7329){var _0x1a9622=_0x4f7329[0x0]===_0x0174('0x8a')?_0x4f7329[0x0]:'i.'+_0x4f7329[0x0];_0x41acee[_0x0174('0x3f')](_0x1a9622,_0x4f7329[0x1]===_0x0174('0x8b')?![]:!![]);});}if(!_[_0x0174('0x6f')](_0x4a70c8)){_0x41acee[_0x0174('0x79')](_0x1cce3c);_0x4dcea5[_0x0174('0x75')]('t.id\x20IN\x20?',_0x4a70c8);}BPromise[_0x0174('0x8c')]()[_0x0174('0x27')](function(){if(!_0x38706c){if(_0x395fff[_0x0174('0x38')][_0x0174('0x70')])return;_0x4dcea5[_0x0174('0x75')](_0x0174('0x8d'));_0x41acee[_0x0174('0x75')](_0x0174('0x8d'));return;}if(_0x395fff[_0x0174('0x8e')][_0x0174('0x8f')]!==_0x0174('0x90'))return;return _0x395fff[_0x0174('0x8e')][_0x0174('0x91')]({'attributes':['id'],'raw':!![]})[_0x0174('0x27')](function(_0x3fbc97){if(_[_0x0174('0x6f')](_0x3fbc97)){_0x4dcea5['where'](_0x0174('0x92'));_0x41acee[_0x0174('0x75')](_0x0174('0x92'));}else{_0x4dcea5['where'](_0x0174('0x93'),_[_0x0174('0x2d')](_0x3fbc97,'id'));_0x41acee[_0x0174('0x75')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x0174('0x2d')](_0x3fbc97,'id'));}});})[_0x0174('0x27')](function(){if(_0x395fff[_0x0174('0x8e')]['role']===_0x0174('0x90')&&!_0x38706c&&!_0x395fff[_0x0174('0x38')]['OpenchannelAccountId'])return[];return db[_0x0174('0x94')][_0x0174('0x38')](_0x4dcea5[_0x0174('0x95')](),_0x3d09c8);})[_0x0174('0x27')](function(_0x1176dd){_0x3dbf00[_0x0174('0x20')]=_0x1176dd[_0x0174('0x57')];if(_0x3dbf00['count']===0x0)return[];return db['sequelize'][_0x0174('0x38')](_0x47d59e[_0x0174('0x95')](),_0x3d09c8)['then'](function(_0x4fe81d){_0x1c65a3=_[_0x0174('0x96')](_0x4fe81d,'id');_0x3d09c8=_[_0x0174('0x97')](_0x3d09c8,{'model':db[_0x0174('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x395fff[_0x0174('0x38')][_0x0174('0x3a')]){_0x1c1d48[_0x0174('0x3b')]['forEach'](function(_0x8b3bd){_0x41acee[_0x0174('0x44')]('i.'+_0x8b3bd);});}else{_0x41acee[_0x0174('0x44')](_0x0174('0x89'),_0x0174('0x58'));_0x41acee[_0x0174('0x44')](_0x0174('0x98'),'Account.key');_0x41acee['field'](_0x0174('0x99'),_0x0174('0x9a'));_0x41acee[_0x0174('0x44')]('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',_0x0174('0x8a'));_0x41acee[_0x0174('0x44')]('i.*');_0x41acee[_0x0174('0x44')](_0x0174('0x9b'),'Contact.firstName');_0x41acee[_0x0174('0x44')]('c.lastName','Contact.lastName');_0x41acee['field'](_0x0174('0x9c'),_0x0174('0x9d'));_0x41acee[_0x0174('0x44')]('c.phone',_0x0174('0x9e'));_0x41acee[_0x0174('0x44')](_0x0174('0x9f'),_0x0174('0xa0'));_0x41acee[_0x0174('0x44')](_0x0174('0xa1'),_0x0174('0xa2'));_0x41acee['field']('o.fullname',_0x0174('0xa3'));_0x41acee[_0x0174('0x44')](_0x0174('0xa4'),_0x0174('0xa5'));_0x41acee[_0x0174('0x44')](_0x0174('0xa6'),_0x0174('0x2e'));}if(_0x1c1d48['limit'])_0x41acee['limit'](_0x1c1d48[_0x0174('0x3e')]);if(_0x1c1d48[_0x0174('0x21')])_0x41acee['offset'](_0x1c1d48[_0x0174('0x21')]);return db[_0x0174('0x94')]['query'](_0x41acee[_0x0174('0x95')](),_0x3d09c8);})[_0x0174('0x27')](function(_0x447acc){_0x433514[_0x0174('0x75')](_0x0174('0xa7'),_[_0x0174('0x2d')](_0x447acc,'id'));return db[_0x0174('0x94')][_0x0174('0x38')](_0x433514[_0x0174('0x95')](),_0x3d09c8)['then'](function(_0x222563){var _0x4c0517=_[_0x0174('0xa8')](_0x222563,_0x0174('0xa9'));var _0x24f3d2=[];_0x447acc['forEach'](function(_0x3fd471){_0x24f3d2[_0x0174('0xaa')](updateOpenchannelInteraction(_0x3fd471,_0x1c65a3,_0x4c0517));});return BPromise[_0x0174('0xab')](_0x24f3d2);});});})[_0x0174('0x27')](function(_0x5b5f6a){_0x3dbf00[_0x0174('0xac')]=_0x5b5f6a;return _0x3dbf00;})['then'](respondWithFilteredResult(_0x99ad75,_0x1c1d48))['catch'](handleError(_0x99ad75,null));};exports[_0x0174('0xad')]=function(_0x28d69c,_0x339867){var _0xefcf10={};if(_0x28d69c['query'][_0x0174('0x64')]&&_0x28d69c['query'][_0x0174('0x64')]==='from'){_0xefcf10[_0x0174('0x46')]=_0x28d69c['params']['id'];}else{_0xefcf10['id']=_0x28d69c[_0x0174('0xae')]['id'];}var _0x38d9f1={'raw':![],'where':_0xefcf10},_0x20e9e8={};_0x20e9e8[_0x0174('0x37')]=_[_0x0174('0x6d')](db[_0x0174('0x33')][_0x0174('0x34')]);_0x20e9e8[_0x0174('0x38')]=_[_0x0174('0x6d')](_0x28d69c[_0x0174('0x38')]);_0x20e9e8[_0x0174('0x41')]=_[_0x0174('0x39')](_0x20e9e8[_0x0174('0x37')],_0x20e9e8[_0x0174('0x38')]);_0x38d9f1['attributes']=_['intersection'](_0x20e9e8[_0x0174('0x37')],qs['fields'](_0x28d69c[_0x0174('0x38')]['fields']));_0x38d9f1['attributes']=_0x38d9f1[_0x0174('0x3b')][_0x0174('0x57')]?_0x38d9f1[_0x0174('0x3b')]:_0x20e9e8['model'];if(_0x28d69c[_0x0174('0x38')][_0x0174('0xaf')]){_0x38d9f1['include']=[{'all':!![]}];}_0x38d9f1=_[_0x0174('0x97')]({},_0x38d9f1,_0x28d69c[_0x0174('0xb0')]);return db[_0x0174('0x33')][_0x0174('0x6a')](_0x38d9f1)[_0x0174('0x27')](handleEntityNotFound(_0x339867,null))[_0x0174('0x27')](respondWithResult(_0x339867,null))[_0x0174('0x31')](handleError(_0x339867,null));};exports[_0x0174('0xb1')]=function(_0x3821c0,_0x2b328b){return db[_0x0174('0x33')]['create'](_0x3821c0['body'],{})['then'](respondWithResult(_0x2b328b,0xc9))[_0x0174('0x31')](handleError(_0x2b328b,null));};exports['update']=function(_0x1822d7,_0x5b6d50){if(_0x1822d7[_0x0174('0x6c')]['id']){delete _0x1822d7[_0x0174('0x6c')]['id'];}return db[_0x0174('0x33')][_0x0174('0x6a')]({'where':{'id':_0x1822d7[_0x0174('0xae')]['id']}})[_0x0174('0x27')](handleEntityNotFound(_0x5b6d50,null))[_0x0174('0x27')](saveUpdates(_0x1822d7[_0x0174('0x6c')],null))[_0x0174('0x27')](respondWithResult(_0x5b6d50,null))['catch'](handleError(_0x5b6d50,null));};exports['destroy']=function(_0x12ebf1,_0x4523a3){return db[_0x0174('0x33')][_0x0174('0x6a')]({'where':{'id':_0x12ebf1[_0x0174('0xae')]['id']}})[_0x0174('0x27')](handleEntityNotFound(_0x4523a3,null))[_0x0174('0x27')](removeEntity(_0x4523a3,null))[_0x0174('0x31')](handleError(_0x4523a3,null));};exports[_0x0174('0xb2')]=function(_0x70b735,_0x205df0){return db[_0x0174('0x33')][_0x0174('0xb2')]()['then'](respondWithResult(_0x205df0,null))[_0x0174('0x31')](handleError(_0x205df0,null));};exports[_0x0174('0xb3')]=function(_0x5a7b9e,_0x53a5ce,_0x5852e6){return db[_0x0174('0xb4')]['find']({'where':{'id':_0x5a7b9e['params']['id']}})[_0x0174('0x27')](handleEntityNotFound(_0x53a5ce,null))[_0x0174('0x27')](function(_0x5d3c7d){if(_0x5d3c7d){return _0x5d3c7d['addMessage'](_0x5a7b9e[_0x0174('0x6c')][_0x0174('0xb5')],_['omit'](_0x5a7b9e[_0x0174('0x6c')],[_0x0174('0xb5'),'id'])||{});}})[_0x0174('0x27')](respondWithResult(_0x53a5ce,null))['catch'](handleError(_0x53a5ce,null));};exports['getMessages']=function(_0x5bf8b6,_0x3dec5f,_0x54561a){var _0x583f1d={'raw':![],'where':{}};var _0x444a1c={};var _0x23ce85={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x0174('0xb6')]({'where':{'id':_0x5bf8b6[_0x0174('0xae')]['id']}})['then'](handleEntityNotFound(_0x3dec5f,null))[_0x0174('0x27')](function(_0x4dcfec){if(_0x4dcfec){_0x444a1c[_0x0174('0x37')]=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x444a1c[_0x0174('0x38')]=_[_0x0174('0x6d')](_0x5bf8b6['query']);_0x444a1c[_0x0174('0x41')]=_['intersection'](_0x444a1c[_0x0174('0x37')],_0x444a1c[_0x0174('0x38')]);_0x583f1d[_0x0174('0x3b')]=_[_0x0174('0x39')](_0x444a1c[_0x0174('0x37')],qs[_0x0174('0x3a')](_0x5bf8b6['query'][_0x0174('0x3a')]));_0x583f1d[_0x0174('0x3b')]=_0x583f1d[_0x0174('0x3b')][_0x0174('0x57')]?_0x583f1d[_0x0174('0x3b')]:_0x444a1c[_0x0174('0x37')];if(!_0x5bf8b6[_0x0174('0x38')]['hasOwnProperty']('nolimit')){_0x583f1d['limit']=qs[_0x0174('0x3e')](_0x5bf8b6[_0x0174('0x38')]['limit']);_0x583f1d[_0x0174('0x21')]=qs[_0x0174('0x21')](_0x5bf8b6[_0x0174('0x38')][_0x0174('0x21')]);}_0x583f1d[_0x0174('0x3f')]=qs[_0x0174('0x40')](_0x5bf8b6['query'][_0x0174('0x40')]);_0x583f1d[_0x0174('0x75')]=qs['filters'](_[_0x0174('0x42')](_0x5bf8b6[_0x0174('0x38')],_0x444a1c['filters']));_0x583f1d[_0x0174('0x75')][_0x0174('0xa9')]=_0x4dcfec['id'];if(_0x5bf8b6[_0x0174('0x38')][_0x0174('0x7c')]){_0x583f1d[_0x0174('0x75')]=_[_0x0174('0x97')](_0x583f1d[_0x0174('0x75')],{'$or':_[_0x0174('0x2d')](_0x583f1d[_0x0174('0x3b')],function(_0x3f1c42){var _0x370bd6={};_0x370bd6[_0x3f1c42]={'$like':'%'+_0x5bf8b6[_0x0174('0x38')][_0x0174('0x7c')]+'%'};return _0x370bd6;})});}if(_0x5bf8b6[_0x0174('0x38')][_0x0174('0xb7')]){var _0x281641=_0x5bf8b6[_0x0174('0x38')][_0x0174('0xb7')]['split'](',');var _0xe6f70f={};_0xe6f70f[_0x281641[0x0]]={'$gte':moment(_0x281641[0x1])[_0x0174('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x583f1d[_0x0174('0x75')]=_[_0x0174('0x97')](_0x583f1d['where'],_0xe6f70f);}_0x583f1d=_[_0x0174('0x97')]({},_0x583f1d,_0x5bf8b6[_0x0174('0xb0')]);return db[_0x0174('0xb4')]['count']({'where':_0x583f1d[_0x0174('0x75')]})['then'](function(_0x378170){_0x23ce85[_0x0174('0x20')]=_0x378170;if(_0x5bf8b6[_0x0174('0x38')]['includeAll']){_0x583f1d[_0x0174('0xb9')]=[{'all':!![]}];}return db[_0x0174('0xb4')]['findAll'](_0x583f1d);})[_0x0174('0x27')](function(_0x44c290){_0x23ce85[_0x0174('0xac')]=_0x44c290;return _0x23ce85;});}})[_0x0174('0x27')](respondWithFilteredResult(_0x3dec5f,_0x583f1d))['catch'](handleError(_0x3dec5f,null));};exports[_0x0174('0xba')]=function(_0x322a33,_0x22eadf,_0x5ed84d){return db[_0x0174('0x33')][_0x0174('0x6a')]({'where':{'id':_0x322a33[_0x0174('0xae')]['id']}})[_0x0174('0x27')](handleEntityNotFound(_0x22eadf,null))[_0x0174('0x27')](function(_0x55031c){if(_0x55031c){return _0x55031c['setTags'](_0x322a33[_0x0174('0x6c')][_0x0174('0xb5')],_[_0x0174('0xbb')](_0x322a33[_0x0174('0x6c')],[_0x0174('0xb5'),'id'])||{})[_0x0174('0xbc')](function(){return db[_0x0174('0x67')][_0x0174('0xbd')]({'attributes':['id',_0x0174('0x2b'),_0x0174('0x45')],'where':{'id':_0x322a33['body'][_0x0174('0xb5')]}});})['then'](function(_0x74c18f){socket[_0x0174('0xbe')]('openchannelInteractionTags:save',{'id':Number(_0x322a33[_0x0174('0xae')]['id']),'tags':_0x74c18f||[]});return{'id':Number(_0x322a33[_0x0174('0xae')]['id']),'tags':_0x74c18f||[]};});}})[_0x0174('0x27')](respondWithResult(_0x22eadf,null))[_0x0174('0x31')](handleError(_0x22eadf,null));};exports[_0x0174('0xbf')]=function(_0x438221,_0x585f2f,_0x54c8c0){return db['OpenchannelInteraction'][_0x0174('0x6a')]({'where':{'id':_0x438221[_0x0174('0xae')]['id']}})[_0x0174('0x27')](handleEntityNotFound(_0x585f2f,null))[_0x0174('0x27')](function(_0x52aa2c){if(_0x52aa2c){return _0x52aa2c[_0x0174('0xbf')](_0x438221[_0x0174('0x38')]['ids']);}})[_0x0174('0x27')](respondWithStatusCode(_0x585f2f,null))['catch'](handleError(_0x585f2f,null));};exports[_0x0174('0xc0')]=function(_0x3e4c70,_0x31014b){var _0x47f200=moment()[_0x0174('0xc1')]()[_0x0174('0x95')]();var _0x57df46=path['join'](config[_0x0174('0xc2')],_0x0174('0xc3'),_0x0174('0xc4'),_0x0174('0xc5'));var _0x4a4a5b=path[_0x0174('0xc6')](config['root'],_0x0174('0xc3'),_0x0174('0xc4'),_0x0174('0xc7'));var _0x2dd060=path[_0x0174('0xc6')](_0x57df46,_0x47f200);var _0x3b348d=util['format'](_0x0174('0xc8'),_0x3e4c70[_0x0174('0xae')]['id'],_0x47f200);var _0x587653=path[_0x0174('0xc6')](_0x57df46,_0x3b348d);var _0x102ad7=[];_0x102ad7[_0x0174('0xaa')]({'model':db['User'],'as':_0x0174('0x69'),'attributes':['id',_0x0174('0xc9')],'raw':!![]});_0x102ad7['push']({'model':db['CmContact'],'as':_0x0174('0x5c'),'attributes':['id','firstName',_0x0174('0xca')],'raw':!![]});if(_0x3e4c70[_0x0174('0x38')][_0x0174('0xc7')]){_0x102ad7[_0x0174('0xaa')]({'model':db['Attachment'],'as':_0x0174('0xcb'),'raw':!![]});}var _0x4d6c7f=[{'model':db['OpenchannelMessage'],'as':_0x0174('0xcc'),'attributes':['id',_0x0174('0x6c'),'createdAt','direction',_0x0174('0xcd'),_0x0174('0x78')],'include':_0x102ad7}];_0x4d6c7f[_0x0174('0xaa')]({'model':db['OpenchannelAccount'],'as':_0x0174('0xce'),'attributes':['id',_0x0174('0x2b')]});_0x4d6c7f['push']({'model':db[_0x0174('0x69')],'as':'Owner','attributes':['id',_0x0174('0xc9')]});return db[_0x0174('0x33')][_0x0174('0x6a')]({'where':{'id':_0x3e4c70[_0x0174('0xae')]['id']},'include':_0x4d6c7f})[_0x0174('0x27')](handleEntityNotFound(_0x31014b,null))['then'](function(_0x240145){if(_0x240145){var _0x4a10d2=_0x240145['get']({'plain':!![]});fs[_0x0174('0xcf')](_0x2dd060);var _0x3b826f={'channel':_0x0174('0xd0'),'account':_0x4a10d2['Account'][_0x0174('0x2b')],'agent':_0x4a10d2[_0x0174('0xd1')]?_0x4a10d2['Owner'][_0x0174('0xc9')]:'N.A.','createdAt':moment(_0x4a10d2['createdAt'])[_0x0174('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x4a10d2[_0x0174('0xd2')]?moment(_0x4a10d2[_0x0174('0xd3')])[_0x0174('0xb8')](_0x0174('0xd4'))[_0x0174('0x95')]():'','disposition':_0x4a10d2['disposition'],'visibility':_0x4a10d2[_0x0174('0xd5')]?_0x0174('0xd6'):_0x0174('0xd7'),'messages':_(_0x4a10d2[_0x0174('0xcc')])['filter']({'secret':![]})[_0x0174('0x2d')](function(_0x4198ea){if(_0x4198ea[_0x0174('0xcb')]){var _0x4c224a=path[_0x0174('0xc6')](_0x4a4a5b,_0x4198ea['Attachment']['basename']);if(fs[_0x0174('0xd8')](_0x4c224a)){fs[_0x0174('0xd9')](_0x4c224a)[_0x0174('0xda')](fs[_0x0174('0xdb')](path[_0x0174('0xc6')](_0x2dd060,_0x4198ea[_0x0174('0xcb')][_0x0174('0xdc')])));}}return{'date':moment(_0x4198ea[_0x0174('0x72')])[_0x0174('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0174('0x95')](),'sender':_0x4198ea[_0x0174('0xdd')]===_0x0174('0xde')?_0x4198ea[_0x0174('0x69')]?_0x4198ea[_0x0174('0x69')][_0x0174('0xc9')]:_0x0174('0xdf'):_0x4198ea[_0x0174('0x5c')][_0x0174('0xe0')]+(_0x4198ea[_0x0174('0x5c')][_0x0174('0xca')]?'\x20'+_0x4198ea[_0x0174('0x5c')][_0x0174('0xca')]:''),'body':_0x4198ea[_0x0174('0xcb')]?_0x4198ea[_0x0174('0xcb')][_0x0174('0xdc')]:_0x4198ea[_0x0174('0x6c')],'direction':_0x4198ea[_0x0174('0xdd')]==='out'?'A':'C','secret':_0x4198ea[_0x0174('0xcd')],'read':_0x4198ea[_0x0174('0x78')],'attachment':_0x4198ea[_0x0174('0xcb')]};})[_0x0174('0x59')]()};return ejs[_0x0174('0xe1')](path[_0x0174('0xc6')](config['root'],_0x0174('0xc3'),'views',_0x0174('0xe2')),{'interaction':_0x3b826f})[_0x0174('0x27')](function(_0x2f6970){var _0xfb9d15=path['join'](_0x2dd060,_0x0174('0xe3')+_0x4a10d2['id']+'-'+_0x47f200+_0x0174('0xe4'));var _0x2990dd={'path':_0xfb9d15,'channel':_0x0174('0xd0'),'interactionId':_0x4a10d2['id']};return pdf['createPdfFromHTML'](_0x2f6970,_0x2990dd);})[_0x0174('0x27')](function(){return new BPromise(function(_0x36fce1,_0x555d73){zipdir(_0x2dd060,{'saveTo':_0x587653},function(_0x4f6a9f,_0x1835aa){if(_0x4f6a9f)return _0x555d73(_0x4f6a9f);return _0x36fce1(_0x1835aa);});})[_0x0174('0x27')](function(){return new BPromise(function(_0x3ccb5a,_0x1eb952){rimraf(_0x2dd060,function(_0x3e0621){if(_0x3e0621)_0x1eb952(_0x3e0621);return _0x3ccb5a();});});})[_0x0174('0x27')](function(){return _0x31014b[_0x0174('0xc0')](_0x587653,_0x3b348d,function(_0x11a11a){if(_0x11a11a){console[_0x0174('0xe5')](_0x0174('0xe6'),_0x11a11a);}else{fs[_0x0174('0xe7')](_0x587653);}});});});}else{return _0x31014b[_0x0174('0x29')](0xc8);}})[_0x0174('0x31')](handleError(_0x31014b,null));}; \ No newline at end of file +var _0x57fa=['CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','unreadMessages','order','contactName','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','rows','show','params','includeAll','options','OpenchannelInteraction','find','create','describe','OpenchannelMessage','addMessage','ids','findOne','format','include','findAll','setTags','spread','emit','removeTags','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','firstName','Attachment','Messages','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','Private','basename','createWriteStream','out','System','lastName','secret','renderFile','downloadInteraction.html','.pdf','createPdfFromHTML','download','err','unlinkSync','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','Users','map','TagIds','split','forEach','Tags','push','catch','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','from','user_has_openchannel_interactions','left_join','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag'];(function(_0x302325,_0x51c70c){var _0x3d0e32=function(_0x5deadb){while(--_0x5deadb){_0x302325['push'](_0x302325['shift']());}};_0x3d0e32(++_0x51c70c);}(_0x57fa,0x7e));var _0xa57f=function(_0x1f8be5,_0x5ab1f8){_0x1f8be5=_0x1f8be5-0x0;var _0x214b89=_0x57fa[_0x1f8be5];return _0x214b89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa57f('0x1'));var rp=require(_0xa57f('0x2'));var moment=require(_0xa57f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa57f('0x4'));var path=require(_0xa57f('0x5'));var sox=require(_0xa57f('0x6'));var csv=require(_0xa57f('0x7'));var ejs=require(_0xa57f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa57f('0x9'));var squel=require('squel');var crypto=require(_0xa57f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa57f('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa57f('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xa57f('0xc'));var as=require(_0xa57f('0xd'));var pdf=require(_0xa57f('0xe'));var hardwareService=require(_0xa57f('0xf'));var logger=require(_0xa57f('0x10'))(_0xa57f('0x11'));var utils=require(_0xa57f('0x12'));var config=require(_0xa57f('0x13'));var licenseUtil=require(_0xa57f('0x14'));var db=require(_0xa57f('0x15'))['db'];config[_0xa57f('0x16')]=_['defaults'](config['redis'],{'host':_0xa57f('0x17'),'port':0x18eb});var socket=require(_0xa57f('0x18'))(new Redis(config[_0xa57f('0x16')]));require(_0xa57f('0x19'))['register'](socket);function respondWithStatusCode(_0x5aa3ba,_0x2bc355){_0x2bc355=_0x2bc355||0xcc;return function(_0x12adb4){if(_0x12adb4){return _0x5aa3ba[_0xa57f('0x1a')](_0x2bc355);}return _0x5aa3ba[_0xa57f('0x1b')](_0x2bc355)[_0xa57f('0x1c')]();};}function respondWithResult(_0x325c61,_0x596368){_0x596368=_0x596368||0xc8;return function(_0x21b878){if(_0x21b878){return _0x325c61['status'](_0x596368)[_0xa57f('0x1d')](_0x21b878);}};}function respondWithFilteredResult(_0x476836,_0x4f91c2){return function(_0x387300){if(_0x387300){var _0x1b3785=_0x387300[_0xa57f('0x1e')],_0x358c44=_0x4f91c2[_0xa57f('0x1f')],_0x12f3c5=_0x4f91c2['offset']+_0x4f91c2[_0xa57f('0x20')],_0x25cb47;if(_0x12f3c5>=_0x1b3785){_0x12f3c5=_0x1b3785;_0x25cb47=0xc8;}else{_0x25cb47=0xce;}_0x476836[_0xa57f('0x1b')](_0x25cb47);return _0x476836[_0xa57f('0x21')](_0xa57f('0x22'),_0x358c44+'-'+_0x12f3c5+'/'+_0x1b3785)['json'](_0x387300);}return null;};}function patchUpdates(_0x3864fa){return function(_0x27ef4a){try{jsonpatch[_0xa57f('0x23')](_0x27ef4a,_0x3864fa,!![]);}catch(_0x2c5c2b){return BPromise[_0xa57f('0x24')](_0x2c5c2b);}return _0x27ef4a[_0xa57f('0x25')]();};}function saveUpdates(_0x38f16d,_0x2ecce3){return function(_0x2bf2fc){if(_0x2bf2fc){return _0x2bf2fc[_0xa57f('0x26')](_0x38f16d)[_0xa57f('0x27')](function(_0xdc8e85){return _0xdc8e85;});}return null;};}function removeEntity(_0x791e9d,_0x97a368){return function(_0xe812a8){if(_0xe812a8){return _0xe812a8[_0xa57f('0x28')]()['then'](function(){_0x791e9d[_0xa57f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39ac7e,_0x20e985){return function(_0xace267){if(!_0xace267){_0x39ac7e['sendStatus'](0x194);}return _0xace267;};}function handleError(_0x1f3915,_0x13dcfd){_0x13dcfd=_0x13dcfd||0x1f4;return function(_0x309efd){logger[_0xa57f('0x29')](_0x309efd['stack']);if(_0x309efd[_0xa57f('0x2a')]){delete _0x309efd[_0xa57f('0x2a')];}_0x1f3915[_0xa57f('0x1b')](_0x13dcfd)[_0xa57f('0x2b')](_0x309efd);};}function getInteractionUsers(_0x55c557,_0x17130d){return new BPromise(function(_0x2a6b09,_0xbb6e3){try{if(_0x17130d[_0x55c557['id']]){_0x55c557[_0xa57f('0x2c')]=_[_0xa57f('0x2d')](_0x17130d[_0x55c557['id']],function(_0x3ff560){return{'id':_0x3ff560['id'],'fullname':_0x3ff560['fullname']};});}}catch(_0x3c5cfc){_0xbb6e3(_0x3c5cfc);}_0x2a6b09(_0x55c557);});}function getInteractionTags(_0x1ebb29,_0x515e2f){return new BPromise(function(_0x39a5fe,_0x147cf5){try{if(_0x1ebb29[_0xa57f('0x2e')]){_0x1ebb29['Tags']=[];_0x1ebb29[_0xa57f('0x2e')][_0xa57f('0x2f')](',')[_0xa57f('0x30')](function(_0x518d1d){_0x1ebb29[_0xa57f('0x31')][_0xa57f('0x32')](_0x515e2f[_0x518d1d]);});}delete _0x1ebb29[_0xa57f('0x2e')];}catch(_0x534d39){_0x147cf5(_0x534d39);}_0x39a5fe(_0x1ebb29);});}function updateOpenchannelInteraction(_0x36f9fd,_0x1c29c4,_0x447597){return new BPromise(function(_0x564ade,_0x379774){return getInteractionUsers(_0x36f9fd,_0x447597)[_0xa57f('0x27')](function(_0x33d867){return getInteractionTags(_0x33d867,_0x1c29c4);})[_0xa57f('0x27')](function(_0x32accf){_0x564ade(_0x32accf);})[_0xa57f('0x33')](function(_0x36d702){_0x379774(_0x36d702);});});}exports[_0xa57f('0x34')]=function(_0x598f2f,_0xd36e78){var _0x4ab8ec={},_0x554b76={},_0x3e7413={'count':0x0,'rows':[]};var _0x222a90=_['map'](db['OpenchannelInteraction'][_0xa57f('0x35')],function(_0x4e3357){return{'name':_0x4e3357[_0xa57f('0x36')],'type':_0x4e3357['type'][_0xa57f('0x37')]};});_0x554b76[_0xa57f('0x38')]=_[_0xa57f('0x2d')](_0x222a90,_0xa57f('0x2a'));_0x554b76[_0xa57f('0x39')]=_[_0xa57f('0x3a')](_0x598f2f['query']);_0x554b76[_0xa57f('0x3b')]=_['intersection'](_0x554b76[_0xa57f('0x38')],_0x554b76[_0xa57f('0x39')]);_0x4ab8ec['attributes']=_[_0xa57f('0x3c')](_0x554b76[_0xa57f('0x38')],qs[_0xa57f('0x3d')](_0x598f2f['query'][_0xa57f('0x3d')]));_0x4ab8ec[_0xa57f('0x3e')]=_0x4ab8ec[_0xa57f('0x3e')][_0xa57f('0x3f')]?_0x4ab8ec[_0xa57f('0x3e')]:_0x554b76['model'];if(!_0x598f2f['query']['hasOwnProperty'](_0xa57f('0x40'))){_0x4ab8ec[_0xa57f('0x20')]=qs[_0xa57f('0x20')](_0x598f2f[_0xa57f('0x39')][_0xa57f('0x20')]);_0x4ab8ec[_0xa57f('0x1f')]=qs[_0xa57f('0x1f')](_0x598f2f['query'][_0xa57f('0x1f')]);}_0x4ab8ec['order']=qs['sort'](_0x598f2f[_0xa57f('0x39')][_0xa57f('0x41')]);_0x4ab8ec[_0xa57f('0x42')]=qs[_0xa57f('0x3b')](_[_0xa57f('0x43')](_0x598f2f[_0xa57f('0x39')],_0x554b76[_0xa57f('0x3b')]),_0x222a90);var _0x1a9fbf=[];var _0x5e330f=squel[_0xa57f('0x44')]()[_0xa57f('0x45')]('id')[_0xa57f('0x45')](_0xa57f('0x2a'))[_0xa57f('0x45')](_0xa57f('0x46'))['from'](_0xa57f('0x47'));var _0xdb0e37=squel[_0xa57f('0x44')]()[_0xa57f('0x45')](_0xa57f('0x48'))[_0xa57f('0x45')](_0xa57f('0x49'))['field']('ui.OpenchannelInteractionId')[_0xa57f('0x4a')](_0xa57f('0x4b'),'ui')[_0xa57f('0x4c')]('users','u','u.id\x20=\x20ui.UserId');var _0xc66630=squel['select']()[_0xa57f('0x4a')](_0xa57f('0x4d'),'i')[_0xa57f('0x4c')](_0xa57f('0x4e'),'c',_0xa57f('0x4f'))['left_join'](_0xa57f('0x50'),'o','o.id\x20=\x20i.UserId')[_0xa57f('0x4c')](_0xa57f('0x51'),'a',_0xa57f('0x52'))['left_join'](_0xa57f('0x53'),'me','me.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xa57f('0x54'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xa57f('0x47'),'t',_0xa57f('0x55'));var _0x567b3a=squel[_0xa57f('0x56')]();var _0x148a65=[];var _0x40b85c=squel[_0xa57f('0x56')]();var _0x2ef9a7;if(_0x598f2f[_0xa57f('0x39')][_0xa57f('0x57')]){_0x2ef9a7=as[_0xa57f('0x58')](_0x598f2f[_0xa57f('0x39')][_0xa57f('0x57')]);var _0x487461=_0x2ef9a7['sqlOperator'];for(var _0x72aef0=0x0;_0x72aef0<_0x2ef9a7['conditions'][_0xa57f('0x3f')];_0x72aef0++){var _0x5f417f=_0x2ef9a7[_0xa57f('0x59')][_0x72aef0];var _0x516a7f='i';var _0x48be87=_['find'](_0x222a90,['name',_0x5f417f[_0xa57f('0x45')]]);if(!_0x48be87){switch(_0x5f417f[_0xa57f('0x45')]){case'unreadMessages':if(_0x5f417f[_0xa57f('0x5a')]==0x1){_0xc66630[_0xa57f('0x5b')]('`'+_0x5f417f[_0xa57f('0x45')]+_0xa57f('0x5c'));}else{_0xc66630[_0xa57f('0x5b')]('`'+_0x5f417f[_0xa57f('0x45')]+_0xa57f('0x5d'));}break;case _0xa57f('0x5e'):if(_0x5f417f[_0xa57f('0x5f')]===_0xa57f('0x60')){if(_0x5f417f['value']['split']('\x20')[_0xa57f('0x3f')]>0x1){_0x567b3a[_0x487461](_0xa57f('0x61'),qs['getFullTextValue'](_0x5f417f[_0xa57f('0x5a')]),null);}else{var _0x329918='%'+_0x5f417f[_0xa57f('0x5a')]+'%';_0x567b3a[_0x487461](_0xa57f('0x62'),_0x329918,_0x329918,_0x329918);}}else{_0x48be87=_['find'](_0x222a90,['name','ContactId']);_0x5f417f[_0xa57f('0x45')]=_0xa57f('0x63');_0x4cebd8=as[_0xa57f('0x64')](_0x516a7f,_0x48be87[_0xa57f('0x65')],_0x5f417f);_0x567b3a[_0x487461](_0x4cebd8[_0xa57f('0x66')],_0x4cebd8[_0xa57f('0x5a')][_0xa57f('0x67')],_0x4cebd8[_0xa57f('0x5a')][_0xa57f('0x1c')]);}break;case _0xa57f('0x68'):var _0xca5c0e=_0x5f417f['value']['split'](',')[_0xa57f('0x2d')](function(_0x1c14ca){return Number(_0x1c14ca);});_0xca5c0e['forEach'](function(_0x1160e9){_0x40b85c['or'](_0xa57f('0x69'),'%,'+_0x1160e9+',%');});_0x148a65=_[_0xa57f('0x6a')](_0x148a65,_0xca5c0e);break;case _0xa57f('0x6b'):if(_0x5f417f[_0xa57f('0x5f')]===_0xa57f('0x60')){_0x567b3a[_0x487461](_0xa57f('0x6c'),'%'+_0x5f417f[_0xa57f('0x5a')]+'%',null);}else{_0x48be87=_['find'](_0x222a90,['name','UserId']);_0x5f417f[_0xa57f('0x45')]=_0xa57f('0x6d');_0x4cebd8=as[_0xa57f('0x64')](_0x516a7f,_0x48be87[_0xa57f('0x65')],_0x5f417f);_0x567b3a[_0x487461](_0x4cebd8['text'],_0x4cebd8[_0xa57f('0x5a')][_0xa57f('0x67')],_0x4cebd8[_0xa57f('0x5a')][_0xa57f('0x1c')]);}break;case _0xa57f('0x6e'):_0x4cebd8=as['buildExpression']('me',null,_0x5f417f);_0x567b3a[_0x487461](_0x4cebd8[_0xa57f('0x66')],_0x4cebd8[_0xa57f('0x5a')][_0xa57f('0x67')],_0x4cebd8[_0xa57f('0x5a')][_0xa57f('0x1c')]);break;}}else{var _0x4cebd8=as[_0xa57f('0x64')](_0x516a7f,_0x48be87[_0xa57f('0x65')],_0x5f417f);_0x567b3a[_0x487461](_0x4cebd8['text'],_0x4cebd8[_0xa57f('0x5a')][_0xa57f('0x67')],_0x4cebd8[_0xa57f('0x5a')][_0xa57f('0x1c')]);}}}else{var _0xe65385=_(_0x598f2f[_0xa57f('0x39')])[_0xa57f('0x3a')]()['map'](function(_0x1be04a){return _[_0xa57f('0x6f')](_0x222a90,[_0xa57f('0x2a'),_0x1be04a])?_0x1be04a:undefined;})[_0xa57f('0x70')]()['value']();if(!_[_0xa57f('0x71')](_0xe65385)){_0xe65385['forEach'](function(_0x59ab38){if(_0x59ab38==='OpenchannelAccountId'){_0xc66630[_0xa57f('0x42')](_0xa57f('0x72'),[][_0xa57f('0x73')](_0x598f2f[_0xa57f('0x39')][_0x59ab38]));}else if(_0x59ab38===_0xa57f('0x74')){var _0x523578=JSON[_0xa57f('0x75')](_0x598f2f['query'][_0x59ab38])[_0xa57f('0x76')];var _0x43b48c=JSON['parse'](_0x598f2f[_0xa57f('0x39')][_0x59ab38])[_0xa57f('0x77')];_0xc66630[_0xa57f('0x42')](_0xa57f('0x78'),_0x523578,_0x43b48c);}else{if(_0x598f2f[_0xa57f('0x39')][_0x59ab38]==='null'){_0xc66630[_0xa57f('0x42')]('i.'+_0x59ab38+'\x20IS\x20NULL');}else{_0xc66630['where']('i.'+_0x59ab38+_0xa57f('0x79'),_0x598f2f['query'][_0x59ab38]);}}});}if(_0x598f2f[_0xa57f('0x39')][_0xa57f('0x7a')]){if(_0x598f2f[_0xa57f('0x39')][_0xa57f('0x7a')]==0x1){_0xc66630[_0xa57f('0x5b')](_0xa57f('0x7b'));}else{_0xc66630['having'](_0xa57f('0x7c'));}}if(_0x598f2f[_0xa57f('0x39')]['tag']){_0x148a65=_[_0xa57f('0x7d')](_0x598f2f[_0xa57f('0x39')][_0xa57f('0x7e')])?_0x598f2f[_0xa57f('0x39')][_0xa57f('0x7e')]:new Array(_0x598f2f[_0xa57f('0x39')][_0xa57f('0x7e')]);_0x148a65[_0xa57f('0x30')](function(_0x2a30c2){_0x40b85c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a30c2+',%');});}if(_0x598f2f[_0xa57f('0x39')][_0xa57f('0x7f')]){var _0x2931df=_0x598f2f['query']['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2931df)){_0x567b3a['or']('i.id\x20LIKE\x20?',_0x2931df+'%');}else{_0x567b3a['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa57f('0x80')](_0x2931df))['or'](_0xa57f('0x81'),_0x2931df+'%')['or'](_0xa57f('0x82'),_0x2931df+'%');}}}_0xc66630[_0xa57f('0x42')](_0x567b3a);_0xc66630[_0xa57f('0x83')]('i.id');var _0x8cf8a8={'type':db['Sequelize'][_0xa57f('0x84')][_0xa57f('0x85')],'raw':!![]};var _0x4735e8=_0xc66630[_0xa57f('0x86')]();_0x4735e8[_0xa57f('0x45')](_0xa57f('0x87'));_0x4735e8[_0xa57f('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa57f('0x88'));if(_0x4ab8ec['order']){_0x4ab8ec[_0xa57f('0x89')][_0xa57f('0x30')](function(_0x109a8b){var _0x257240=_0x109a8b[0x0]===_0xa57f('0x8a')?_0x109a8b[0x0]:'i.'+_0x109a8b[0x0];_0xc66630[_0xa57f('0x89')](_0x257240,_0x109a8b[0x1]==='DESC'?![]:!![]);});}if(!_[_0xa57f('0x71')](_0x148a65)){_0xc66630['having'](_0x40b85c);_0x4735e8[_0xa57f('0x42')](_0xa57f('0x8b'),_0x148a65);}BPromise[_0xa57f('0x8c')]()['then'](function(){if(!_0x2ef9a7){if(_0x598f2f[_0xa57f('0x39')][_0xa57f('0x8d')])return;_0x4735e8['where'](_0xa57f('0x8e'));_0xc66630[_0xa57f('0x42')](_0xa57f('0x8e'));return;}if(_0x598f2f[_0xa57f('0x8f')][_0xa57f('0x90')]!=='agent')return;return _0x598f2f['user'][_0xa57f('0x91')]({'attributes':['id'],'raw':!![]})['then'](function(_0x866f08){if(_['isEmpty'](_0x866f08)){_0x4735e8[_0xa57f('0x42')](_0xa57f('0x92'));_0xc66630[_0xa57f('0x42')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x4735e8[_0xa57f('0x42')](_0xa57f('0x72'),_[_0xa57f('0x2d')](_0x866f08,'id'));_0xc66630[_0xa57f('0x42')](_0xa57f('0x72'),_['map'](_0x866f08,'id'));}});})[_0xa57f('0x27')](function(){if(_0x598f2f[_0xa57f('0x8f')]['role']==='agent'&&!_0x2ef9a7&&!_0x598f2f[_0xa57f('0x39')]['OpenchannelAccountId'])return[];return db['sequelize'][_0xa57f('0x39')](_0x4735e8[_0xa57f('0x93')](),_0x8cf8a8);})[_0xa57f('0x27')](function(_0x5d33d4){_0x3e7413[_0xa57f('0x1e')]=_0x5d33d4['length'];if(_0x3e7413[_0xa57f('0x1e')]===0x0)return[];return db['sequelize']['query'](_0x5e330f[_0xa57f('0x93')](),_0x8cf8a8)['then'](function(_0x3b212a){_0x1a9fbf=_['keyBy'](_0x3b212a,'id');_0x8cf8a8=_[_0xa57f('0x94')](_0x8cf8a8,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x598f2f[_0xa57f('0x39')][_0xa57f('0x3d')]){_0x4ab8ec['attributes'][_0xa57f('0x30')](function(_0x111458){_0xc66630[_0xa57f('0x45')]('i.'+_0x111458);});}else{_0xc66630['field'](_0xa57f('0x95'),_0xa57f('0x88'));_0xc66630[_0xa57f('0x45')](_0xa57f('0x96'),_0xa57f('0x97'));_0xc66630['field'](_0xa57f('0x98'),_0xa57f('0x99'));_0xc66630['field'](_0xa57f('0x9a'),_0xa57f('0x8a'));_0xc66630['field'](_0xa57f('0x9b'));_0xc66630[_0xa57f('0x45')](_0xa57f('0x9c'),_0xa57f('0x9d'));_0xc66630[_0xa57f('0x45')](_0xa57f('0x9e'),_0xa57f('0x9f'));_0xc66630[_0xa57f('0x45')](_0xa57f('0xa0'),_0xa57f('0xa1'));_0xc66630[_0xa57f('0x45')](_0xa57f('0xa2'),'Contact.phone');_0xc66630[_0xa57f('0x45')](_0xa57f('0xa3'),_0xa57f('0xa4'));_0xc66630[_0xa57f('0x45')]('c.fax',_0xa57f('0xa5'));_0xc66630[_0xa57f('0x45')]('o.fullname',_0xa57f('0xa6'));_0xc66630['field']('o.internal',_0xa57f('0xa7'));_0xc66630['field'](_0xa57f('0xa8'),_0xa57f('0x2e'));}if(_0x4ab8ec[_0xa57f('0x20')])_0xc66630[_0xa57f('0x20')](_0x4ab8ec['limit']);if(_0x4ab8ec['offset'])_0xc66630[_0xa57f('0x1f')](_0x4ab8ec[_0xa57f('0x1f')]);return db[_0xa57f('0xa9')][_0xa57f('0x39')](_0xc66630[_0xa57f('0x93')](),_0x8cf8a8);})[_0xa57f('0x27')](function(_0x2abd2f){_0xdb0e37[_0xa57f('0x42')](_0xa57f('0xaa'),_[_0xa57f('0x2d')](_0x2abd2f,'id'));return db[_0xa57f('0xa9')][_0xa57f('0x39')](_0xdb0e37['toString'](),_0x8cf8a8)[_0xa57f('0x27')](function(_0x2cd721){var _0x9c9a64=_['groupBy'](_0x2cd721,_0xa57f('0xab'));var _0x4dfa9b=[];_0x2abd2f['forEach'](function(_0xd9d77){_0x4dfa9b['push'](updateOpenchannelInteraction(_0xd9d77,_0x1a9fbf,_0x9c9a64));});return BPromise['all'](_0x4dfa9b);});});})[_0xa57f('0x27')](function(_0x36d99b){_0x3e7413[_0xa57f('0xac')]=_0x36d99b;return _0x3e7413;})[_0xa57f('0x27')](respondWithFilteredResult(_0xd36e78,_0x4ab8ec))['catch'](handleError(_0xd36e78,null));};exports[_0xa57f('0xad')]=function(_0x3b1172,_0x3dac3b){var _0x1ad641={};if(_0x3b1172[_0xa57f('0x39')][_0xa57f('0x65')]&&_0x3b1172[_0xa57f('0x39')]['type']===_0xa57f('0x4a')){_0x1ad641[_0xa57f('0x4a')]=_0x3b1172[_0xa57f('0xae')]['id'];}else{_0x1ad641['id']=_0x3b1172[_0xa57f('0xae')]['id'];}var _0x519156={'raw':![],'where':_0x1ad641},_0x18f92b={};_0x18f92b[_0xa57f('0x38')]=_[_0xa57f('0x3a')](db['OpenchannelInteraction'][_0xa57f('0x35')]);_0x18f92b['query']=_[_0xa57f('0x3a')](_0x3b1172['query']);_0x18f92b[_0xa57f('0x3b')]=_[_0xa57f('0x3c')](_0x18f92b['model'],_0x18f92b[_0xa57f('0x39')]);_0x519156['attributes']=_[_0xa57f('0x3c')](_0x18f92b[_0xa57f('0x38')],qs['fields'](_0x3b1172[_0xa57f('0x39')][_0xa57f('0x3d')]));_0x519156['attributes']=_0x519156['attributes'][_0xa57f('0x3f')]?_0x519156[_0xa57f('0x3e')]:_0x18f92b[_0xa57f('0x38')];if(_0x3b1172[_0xa57f('0x39')][_0xa57f('0xaf')]){_0x519156['include']=[{'all':!![]}];}_0x519156=_[_0xa57f('0x94')]({},_0x519156,_0x3b1172[_0xa57f('0xb0')]);return db[_0xa57f('0xb1')][_0xa57f('0xb2')](_0x519156)[_0xa57f('0x27')](handleEntityNotFound(_0x3dac3b,null))['then'](respondWithResult(_0x3dac3b,null))[_0xa57f('0x33')](handleError(_0x3dac3b,null));};exports[_0xa57f('0xb3')]=function(_0x28e139,_0x118559){return db[_0xa57f('0xb1')][_0xa57f('0xb3')](_0x28e139['body'],{})[_0xa57f('0x27')](respondWithResult(_0x118559,0xc9))['catch'](handleError(_0x118559,null));};exports['update']=function(_0x5f2338,_0x10be6c){if(_0x5f2338[_0xa57f('0x6e')]['id']){delete _0x5f2338[_0xa57f('0x6e')]['id'];}return db[_0xa57f('0xb1')][_0xa57f('0xb2')]({'where':{'id':_0x5f2338[_0xa57f('0xae')]['id']}})[_0xa57f('0x27')](handleEntityNotFound(_0x10be6c,null))['then'](saveUpdates(_0x5f2338[_0xa57f('0x6e')],null))[_0xa57f('0x27')](respondWithResult(_0x10be6c,null))['catch'](handleError(_0x10be6c,null));};exports['destroy']=function(_0x49b0ce,_0x4b6ccd){return db[_0xa57f('0xb1')][_0xa57f('0xb2')]({'where':{'id':_0x49b0ce[_0xa57f('0xae')]['id']}})[_0xa57f('0x27')](handleEntityNotFound(_0x4b6ccd,null))['then'](removeEntity(_0x4b6ccd,null))['catch'](handleError(_0x4b6ccd,null));};exports[_0xa57f('0xb4')]=function(_0x2faed5,_0x7184cf){return db[_0xa57f('0xb1')][_0xa57f('0xb4')]()['then'](respondWithResult(_0x7184cf,null))[_0xa57f('0x33')](handleError(_0x7184cf,null));};exports['addMessage']=function(_0x39a3fd,_0x4d6d55,_0x71ec35){return db[_0xa57f('0xb5')]['find']({'where':{'id':_0x39a3fd[_0xa57f('0xae')]['id']}})[_0xa57f('0x27')](handleEntityNotFound(_0x4d6d55,null))['then'](function(_0xfc3fc6){if(_0xfc3fc6){return _0xfc3fc6[_0xa57f('0xb6')](_0x39a3fd['body']['ids'],_['omit'](_0x39a3fd['body'],[_0xa57f('0xb7'),'id'])||{});}})[_0xa57f('0x27')](respondWithResult(_0x4d6d55,null))[_0xa57f('0x33')](handleError(_0x4d6d55,null));};exports['getMessages']=function(_0x37ac96,_0x58e542,_0x312012){var _0x5282fa={'raw':![],'where':{}};var _0xb17ed={};var _0x122cc4={'count':0x0,'rows':[]};return db[_0xa57f('0xb1')][_0xa57f('0xb8')]({'where':{'id':_0x37ac96['params']['id']}})[_0xa57f('0x27')](handleEntityNotFound(_0x58e542,null))['then'](function(_0x4785a0){if(_0x4785a0){_0xb17ed[_0xa57f('0x38')]=_[_0xa57f('0x3a')](db[_0xa57f('0xb5')][_0xa57f('0x35')]);_0xb17ed[_0xa57f('0x39')]=_[_0xa57f('0x3a')](_0x37ac96[_0xa57f('0x39')]);_0xb17ed[_0xa57f('0x3b')]=_[_0xa57f('0x3c')](_0xb17ed[_0xa57f('0x38')],_0xb17ed['query']);_0x5282fa[_0xa57f('0x3e')]=_[_0xa57f('0x3c')](_0xb17ed[_0xa57f('0x38')],qs[_0xa57f('0x3d')](_0x37ac96[_0xa57f('0x39')][_0xa57f('0x3d')]));_0x5282fa['attributes']=_0x5282fa['attributes']['length']?_0x5282fa[_0xa57f('0x3e')]:_0xb17ed[_0xa57f('0x38')];if(!_0x37ac96[_0xa57f('0x39')]['hasOwnProperty'](_0xa57f('0x40'))){_0x5282fa[_0xa57f('0x20')]=qs[_0xa57f('0x20')](_0x37ac96['query'][_0xa57f('0x20')]);_0x5282fa[_0xa57f('0x1f')]=qs[_0xa57f('0x1f')](_0x37ac96[_0xa57f('0x39')]['offset']);}_0x5282fa['order']=qs[_0xa57f('0x41')](_0x37ac96[_0xa57f('0x39')][_0xa57f('0x41')]);_0x5282fa[_0xa57f('0x42')]=qs[_0xa57f('0x3b')](_[_0xa57f('0x43')](_0x37ac96[_0xa57f('0x39')],_0xb17ed[_0xa57f('0x3b')]));_0x5282fa[_0xa57f('0x42')][_0xa57f('0xab')]=_0x4785a0['id'];if(_0x37ac96[_0xa57f('0x39')]['filter']){_0x5282fa['where']=_[_0xa57f('0x94')](_0x5282fa[_0xa57f('0x42')],{'$or':_[_0xa57f('0x2d')](_0x5282fa[_0xa57f('0x3e')],function(_0x351f60){var _0x9bacb8={};_0x9bacb8[_0x351f60]={'$like':'%'+_0x37ac96[_0xa57f('0x39')][_0xa57f('0x7f')]+'%'};return _0x9bacb8;})});}if(_0x37ac96[_0xa57f('0x39')]['$gte']){var _0x28acce=_0x37ac96['query'][_0xa57f('0x76')][_0xa57f('0x2f')](',');var _0x174851={};_0x174851[_0x28acce[0x0]]={'$gte':moment(_0x28acce[0x1])[_0xa57f('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5282fa[_0xa57f('0x42')]=_[_0xa57f('0x94')](_0x5282fa[_0xa57f('0x42')],_0x174851);}_0x5282fa=_['merge']({},_0x5282fa,_0x37ac96[_0xa57f('0xb0')]);return db['OpenchannelMessage']['count']({'where':_0x5282fa[_0xa57f('0x42')]})[_0xa57f('0x27')](function(_0x2ea86e){_0x122cc4[_0xa57f('0x1e')]=_0x2ea86e;if(_0x37ac96['query'][_0xa57f('0xaf')]){_0x5282fa[_0xa57f('0xba')]=[{'all':!![]}];}return db[_0xa57f('0xb5')][_0xa57f('0xbb')](_0x5282fa);})[_0xa57f('0x27')](function(_0x32386c){_0x122cc4['rows']=_0x32386c;return _0x122cc4;});}})[_0xa57f('0x27')](respondWithFilteredResult(_0x58e542,_0x5282fa))[_0xa57f('0x33')](handleError(_0x58e542,null));};exports['addTags']=function(_0x1c3dad,_0x22a372,_0x2f2672){return db[_0xa57f('0xb1')][_0xa57f('0xb2')]({'where':{'id':_0x1c3dad[_0xa57f('0xae')]['id']}})['then'](handleEntityNotFound(_0x22a372,null))['then'](function(_0x57c882){if(_0x57c882){return _0x57c882[_0xa57f('0xbc')](_0x1c3dad[_0xa57f('0x6e')][_0xa57f('0xb7')],_['omit'](_0x1c3dad['body'],['ids','id'])||{})[_0xa57f('0xbd')](function(){return db['Tag']['findAll']({'attributes':['id',_0xa57f('0x2a'),'color'],'where':{'id':_0x1c3dad[_0xa57f('0x6e')][_0xa57f('0xb7')]}});})[_0xa57f('0x27')](function(_0x1ce3fc){socket[_0xa57f('0xbe')]('openchannelInteractionTags:save',{'id':Number(_0x1c3dad['params']['id']),'tags':_0x1ce3fc||[]});return{'id':Number(_0x1c3dad['params']['id']),'tags':_0x1ce3fc||[]};});}})[_0xa57f('0x27')](respondWithResult(_0x22a372,null))[_0xa57f('0x33')](handleError(_0x22a372,null));};exports[_0xa57f('0xbf')]=function(_0x5e78d1,_0x3d502c,_0x250746){return db[_0xa57f('0xb1')][_0xa57f('0xb2')]({'where':{'id':_0x5e78d1[_0xa57f('0xae')]['id']}})[_0xa57f('0x27')](handleEntityNotFound(_0x3d502c,null))[_0xa57f('0x27')](function(_0x2248ce){if(_0x2248ce){return _0x2248ce[_0xa57f('0xbf')](_0x5e78d1['query']['ids']);}})['then'](respondWithStatusCode(_0x3d502c,null))['catch'](handleError(_0x3d502c,null));};exports['download']=function(_0x536900,_0x3165fc){var _0x10cb19=moment()['unix']()['toString']();var _0x3a0a92=path[_0xa57f('0xc0')](config[_0xa57f('0xc1')],_0xa57f('0xc2'),_0xa57f('0xc3'),_0xa57f('0xc4'));var _0x1deac5=path[_0xa57f('0xc0')](config[_0xa57f('0xc1')],_0xa57f('0xc2'),_0xa57f('0xc3'),_0xa57f('0xc5'));var _0x579077=path['join'](_0x3a0a92,_0x10cb19);var _0x23b46b=util[_0xa57f('0xb9')](_0xa57f('0xc6'),_0x536900[_0xa57f('0xae')]['id'],_0x10cb19);var _0x55b2a2=path[_0xa57f('0xc0')](_0x3a0a92,_0x23b46b);var _0x59a648=[];_0x59a648[_0xa57f('0x32')]({'model':db[_0xa57f('0x6b')],'as':_0xa57f('0x6b'),'attributes':['id',_0xa57f('0xc7')],'raw':!![]});_0x59a648[_0xa57f('0x32')]({'model':db['CmContact'],'as':_0xa57f('0x5e'),'attributes':['id',_0xa57f('0xc8'),'lastName'],'raw':!![]});if(_0x536900['query']['attachments']){_0x59a648[_0xa57f('0x32')]({'model':db[_0xa57f('0xc9')],'as':'Attachment','raw':!![]});}var _0x42294d=[{'model':db[_0xa57f('0xb5')],'as':_0xa57f('0xca'),'attributes':['id',_0xa57f('0x6e'),'createdAt',_0xa57f('0xcb'),'secret',_0xa57f('0x7a')],'include':_0x59a648}];_0x42294d['push']({'model':db[_0xa57f('0xcc')],'as':_0xa57f('0xcd'),'attributes':['id',_0xa57f('0x2a')]});_0x42294d[_0xa57f('0x32')]({'model':db[_0xa57f('0x6b')],'as':_0xa57f('0xce'),'attributes':['id',_0xa57f('0xc7')]});return db[_0xa57f('0xb1')]['find']({'where':{'id':_0x536900['params']['id']},'include':_0x42294d})[_0xa57f('0x27')](handleEntityNotFound(_0x3165fc,null))[_0xa57f('0x27')](function(_0x5ef292){if(_0x5ef292){var _0x5859d7=_0x5ef292[_0xa57f('0xcf')]({'plain':!![]});fs[_0xa57f('0xd0')](_0x579077);var _0x1f7f02={'channel':_0xa57f('0xd1'),'account':_0x5859d7[_0xa57f('0xcd')][_0xa57f('0x2a')],'agent':_0x5859d7[_0xa57f('0xce')]?_0x5859d7[_0xa57f('0xce')][_0xa57f('0xc7')]:_0xa57f('0xd2'),'createdAt':moment(_0x5859d7[_0xa57f('0x74')])[_0xa57f('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa57f('0x93')](),'closedAt':_0x5859d7[_0xa57f('0xd3')]?moment(_0x5859d7[_0xa57f('0xd4')])[_0xa57f('0xb9')](_0xa57f('0xd5'))[_0xa57f('0x93')]():'','disposition':_0x5859d7[_0xa57f('0xd6')],'visibility':_0x5859d7[_0xa57f('0xd7')]?_0xa57f('0xd8'):_0xa57f('0xd9'),'messages':_(_0x5859d7[_0xa57f('0xca')])[_0xa57f('0x7f')]({'secret':![]})[_0xa57f('0x2d')](function(_0x30ed2d){if(_0x30ed2d[_0xa57f('0xc9')]){var _0x17e255=path[_0xa57f('0xc0')](_0x1deac5,_0x30ed2d['Attachment'][_0xa57f('0xda')]);if(fs['existsSync'](_0x17e255)){fs['createReadStream'](_0x17e255)['pipe'](fs[_0xa57f('0xdb')](path[_0xa57f('0xc0')](_0x579077,_0x30ed2d[_0xa57f('0xc9')][_0xa57f('0xda')])));}}return{'date':moment(_0x30ed2d['createdAt'])['format'](_0xa57f('0xd5'))['toString'](),'sender':_0x30ed2d[_0xa57f('0xcb')]===_0xa57f('0xdc')?_0x30ed2d['User']?_0x30ed2d[_0xa57f('0x6b')][_0xa57f('0xc7')]:_0xa57f('0xdd'):_0x30ed2d[_0xa57f('0x5e')][_0xa57f('0xc8')]+(_0x30ed2d[_0xa57f('0x5e')][_0xa57f('0xde')]?'\x20'+_0x30ed2d[_0xa57f('0x5e')][_0xa57f('0xde')]:''),'body':_0x30ed2d['Attachment']?_0x30ed2d[_0xa57f('0xc9')][_0xa57f('0xda')]:_0x30ed2d['body'],'direction':_0x30ed2d[_0xa57f('0xcb')]===_0xa57f('0xdc')?'A':'C','secret':_0x30ed2d[_0xa57f('0xdf')],'read':_0x30ed2d[_0xa57f('0x7a')],'attachment':_0x30ed2d['Attachment']};})['value']()};return ejs[_0xa57f('0xe0')](path[_0xa57f('0xc0')](config[_0xa57f('0xc1')],_0xa57f('0xc2'),'views',_0xa57f('0xe1')),{'interaction':_0x1f7f02})[_0xa57f('0x27')](function(_0x61648){var _0x184068=path[_0xa57f('0xc0')](_0x579077,'transcript-'+_0x5859d7['id']+'-'+_0x10cb19+_0xa57f('0xe2'));var _0x175bbf={'path':_0x184068,'channel':_0xa57f('0xd1'),'interactionId':_0x5859d7['id']};return pdf[_0xa57f('0xe3')](_0x61648,_0x175bbf);})['then'](function(){return new BPromise(function(_0xf664b7,_0x354dd1){zipdir(_0x579077,{'saveTo':_0x55b2a2},function(_0x3ac5f7,_0x14d645){if(_0x3ac5f7)return _0x354dd1(_0x3ac5f7);return _0xf664b7(_0x14d645);});})['then'](function(){return new BPromise(function(_0x1c7474,_0x410ad8){rimraf(_0x579077,function(_0x1d48b5){if(_0x1d48b5)_0x410ad8(_0x1d48b5);return _0x1c7474();});});})['then'](function(){return _0x3165fc[_0xa57f('0xe4')](_0x55b2a2,_0x23b46b,function(_0x5a6445){if(_0x5a6445){console['log'](_0xa57f('0xe5'),_0x5a6445);}else{fs[_0xa57f('0xe6')](_0x55b2a2);}});});});}else{return _0x3165fc[_0xa57f('0x1a')](0xc8);}})[_0xa57f('0x33')](handleError(_0x3165fc,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index f8dad60..34b0379 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 _0x4d1e=['OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','events','../../mysqldb'];(function(_0x4e0dce,_0x584875){var _0x154ed6=function(_0x2c2168){while(--_0x2c2168){_0x4e0dce['push'](_0x4e0dce['shift']());}};_0x154ed6(++_0x584875);}(_0x4d1e,0x1da));var _0xe4d1=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x4d1e[_0x5d7227];return _0x15ac55;};'use strict';var EventEmitter=require(_0xe4d1('0x0'));var OpenchannelInteraction=require(_0xe4d1('0x1'))['db'][_0xe4d1('0x2')];var OpenchannelMessage=require(_0xe4d1('0x1'))['db'][_0xe4d1('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe4d1('0x4')](0x0);var events={'afterCreate':_0xe4d1('0x5'),'afterUpdate':_0xe4d1('0x6'),'afterDestroy':_0xe4d1('0x7')};function emitEvent(_0x5abbf9){return function(_0x4e5c48,_0x53afe5,_0x1dbc12){_0x4e5c48[_0xe4d1('0x8')]({'attributes':['id'],'raw':!![]})[_0xe4d1('0x9')](function(_0x17c6c3){_0x4e5c48[_0xe4d1('0xa')](_0xe4d1('0xb'),_0x17c6c3[_0xe4d1('0xc')](function(_0x1cb94b){return{'id':_0x1cb94b['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x4e5c48['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe4d1('0x9')](function(_0x4e8e79){_0x4e5c48[_0xe4d1('0xa')]('unreadMessages',_0x4e8e79[_0xe4d1('0xd')]);OpenchannelInteractionEvents[_0xe4d1('0xe')](_0x5abbf9+':'+_0x4e5c48['id'],_0x4e5c48);OpenchannelInteractionEvents[_0xe4d1('0xe')](_0x5abbf9,_0x4e5c48);_0x1dbc12(null);})[_0xe4d1('0xf')](_0x1dbc12(null));};}for(var e in events){if(events[_0xe4d1('0x10')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x47be=['findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','Users','map'];(function(_0x248663,_0x43d37e){var _0x5942c1=function(_0x284ade){while(--_0x284ade){_0x248663['push'](_0x248663['shift']());}};_0x5942c1(++_0x43d37e);}(_0x47be,0x112));var _0xe47b=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x47be[_0x3c2166];return _0x30ccc3;};'use strict';var EventEmitter=require(_0xe47b('0x0'));var OpenchannelInteraction=require(_0xe47b('0x1'))['db'][_0xe47b('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xe47b('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe47b('0x4')](0x0);var events={'afterCreate':_0xe47b('0x5'),'afterUpdate':_0xe47b('0x6'),'afterDestroy':_0xe47b('0x7')};function emitEvent(_0x2d1484){return function(_0x173263,_0xf6b51c,_0x242bb2){_0x173263[_0xe47b('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4251b4){_0x173263['setDataValue'](_0xe47b('0x9'),_0x4251b4[_0xe47b('0xa')](function(_0x4a9123){return{'id':_0x4a9123['id']};}));return OpenchannelMessage[_0xe47b('0xb')]({'where':{'OpenchannelInteractionId':_0x173263['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x39cd05){_0x173263[_0xe47b('0xc')](_0xe47b('0xd'),_0x39cd05[_0xe47b('0xe')]);OpenchannelInteractionEvents[_0xe47b('0xf')](_0x2d1484+':'+_0x173263['id'],_0x173263);OpenchannelInteractionEvents['emit'](_0x2d1484,_0x173263);_0x242bb2(null);})[_0xe47b('0x10')](_0x242bb2(null));};}for(var e in events){if(events[_0xe47b('0x11')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xe47b('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 1f64262..f7597be 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 _0xe015=['changed','closed','format','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','openchannel_interactions'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0xe015,0x13b));var _0x5e01=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe015[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var logger=require(_0x5e01('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5e01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e01('0x4'));var rimraf=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var attributes=require(_0x5e01('0x7'));module['exports']=function(_0x1814cb,_0x3d2da2){return _0x1814cb['define']('OpenchannelInteraction',attributes,{'tableName':_0x5e01('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3aeaef,_0x1420c2,_0x40d31f){if(_0x3aeaef[_0x5e01('0x9')](_0x5e01('0xa'))){_0x3aeaef['closedAt']=moment()[_0x5e01('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x40d31f(null,_0x3aeaef);}}});}; \ No newline at end of file +var _0xc492=['../../config/environment','exports','define','openchannel_interactions','changed','closedAt','lodash','util','../../config/logger','bluebird','rimraf'];(function(_0x35e00a,_0x4f48d4){var _0x3594d5=function(_0x59295f){while(--_0x59295f){_0x35e00a['push'](_0x35e00a['shift']());}};_0x3594d5(++_0x4f48d4);}(_0xc492,0xd7));var _0x2c49=function(_0x47c8e9,_0xb12eb){_0x47c8e9=_0x47c8e9-0x0;var _0x442286=_0xc492[_0x47c8e9];return _0x442286;};'use strict';var _=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var logger=require(_0x2c49('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2c49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c49('0x4'));var config=require(_0x2c49('0x5'));var attributes=require('./openchannelInteraction.attributes');module[_0x2c49('0x6')]=function(_0x499c4e,_0x3ad911){return _0x499c4e[_0x2c49('0x7')]('OpenchannelInteraction',attributes,{'tableName':_0x2c49('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17f596,_0x26f8c1,_0x42b3bb){if(_0x17f596[_0x2c49('0x9')]('closed')){_0x17f596[_0x2c49('0xa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x42b3bb(null,_0x17f596);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 301d0dc..dd9f766 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 _0xd427=['client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','stringify','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2c6e7f,_0x18e56f){var _0x5ba18a=function(_0x17ed6a){while(--_0x17ed6a){_0x2c6e7f['push'](_0x2c6e7f['shift']());}};_0x5ba18a(++_0x18e56f);}(_0xd427,0x1bb));var _0x7d42=function(_0x3b20a2,_0x134a02){_0x3b20a2=_0x3b20a2-0x0;var _0x12ea58=_0xd427[_0x3b20a2];return _0x12ea58;};'use strict';var _=require(_0x7d42('0x0'));var util=require(_0x7d42('0x1'));var moment=require(_0x7d42('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d42('0x3'));var fs=require('fs');var Redis=require(_0x7d42('0x4'));var db=require(_0x7d42('0x5'))['db'];var utils=require(_0x7d42('0x6'));var logger=require(_0x7d42('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7d42('0x8')][_0x7d42('0x9')]({'port':0x232a});config[_0x7d42('0xa')]=_[_0x7d42('0xb')](config[_0x7d42('0xa')],{'host':_0x7d42('0xc'),'port':0x18eb});var socket=require(_0x7d42('0xd'))(new Redis(config[_0x7d42('0xa')]));require(_0x7d42('0xe'))[_0x7d42('0xf')](socket);function respondWithRpcPromise(_0x5bf7c1,_0x62d302,_0x4a697e){return new BPromise(function(_0x40fe44,_0x37f389){return client[_0x7d42('0x10')](_0x5bf7c1,_0x4a697e)[_0x7d42('0x11')](function(_0x54b4d5){logger[_0x7d42('0x12')](_0x7d42('0x13'),_0x62d302,'request\x20sent');logger[_0x7d42('0x14')](_0x7d42('0x15'),_0x62d302,_0x7d42('0x16'),JSON['stringify'](_0x54b4d5));if(_0x54b4d5[_0x7d42('0x17')]){if(_0x54b4d5['error'][_0x7d42('0x18')]===0x1f4){logger[_0x7d42('0x17')](_0x7d42('0x13'),_0x62d302,_0x54b4d5[_0x7d42('0x17')][_0x7d42('0x19')]);return _0x37f389(_0x54b4d5[_0x7d42('0x17')][_0x7d42('0x19')]);}logger[_0x7d42('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x62d302,_0x54b4d5[_0x7d42('0x17')][_0x7d42('0x19')]);return _0x40fe44(_0x54b4d5[_0x7d42('0x17')]['message']);}else{logger['info'](_0x7d42('0x13'),_0x62d302,'request\x20sent');_0x40fe44(_0x54b4d5[_0x7d42('0x1a')][_0x7d42('0x19')]);}})[_0x7d42('0x1b')](function(_0x161243){logger['error'](_0x7d42('0x13'),_0x62d302,_0x161243);_0x37f389(_0x161243);});});}exports[_0x7d42('0x1c')]=function(_0x1fb5c5){var _0xe1615a=this;return new Promise(function(_0x1c0205,_0x36de14){return db[_0x7d42('0x1d')][_0x7d42('0x1e')](_0x1fb5c5[_0x7d42('0x1f')],{'raw':_0x1fb5c5[_0x7d42('0x20')]?_0x1fb5c5['options'][_0x7d42('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fb5c5[_0x7d42('0x20')]?_0x1fb5c5[_0x7d42('0x20')]['where']||null:null,'attributes':_0x1fb5c5[_0x7d42('0x20')]?_0x1fb5c5['options']['attributes']||null:null,'limit':_0x1fb5c5[_0x7d42('0x20')]?_0x1fb5c5[_0x7d42('0x20')]['limit']||null:null})[_0x7d42('0x11')](function(_0xbf634b){logger[_0x7d42('0x12')](_0x7d42('0x1c'),_0x1fb5c5);logger[_0x7d42('0x14')](_0x7d42('0x1c'),_0x1fb5c5,JSON[_0x7d42('0x22')](_0xbf634b));_0x1c0205(_0xbf634b);})[_0x7d42('0x1b')](function(_0xa64221){logger[_0x7d42('0x17')](_0x7d42('0x1c'),_0xa64221[_0x7d42('0x19')],_0x1fb5c5);_0x36de14(_0xe1615a[_0x7d42('0x17')](0x1f4,_0xa64221[_0x7d42('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x3d6487){return new Promise(function(_0x499450,_0x240fcd){return db[_0x7d42('0x1d')]['find']({'where':_0x3d6487[_0x7d42('0x20')]?_0x3d6487[_0x7d42('0x20')][_0x7d42('0x23')]||null:null})[_0x7d42('0x11')](function(_0x102075){if(_0x102075){return _0x102075[_0x7d42('0x24')](_0x3d6487[_0x7d42('0x1f')][_0x7d42('0x25')],_[_0x7d42('0x26')](_0x3d6487[_0x7d42('0x1f')],[_0x7d42('0x25'),'id'])||{});}})[_0x7d42('0x27')](function(_0x2b9868){logger[_0x7d42('0x12')](_0x7d42('0x28'),_0x3d6487);logger['debug'](_0x7d42('0x28'),_0x3d6487,JSON[_0x7d42('0x22')](_0x2b9868));_0x499450(_0x2b9868);})[_0x7d42('0x1b')](function(_0x4b73ed){logger[_0x7d42('0x17')](_0x7d42('0x28'),_0x4b73ed[_0x7d42('0x19')],_0x3d6487);_0x240fcd(_this['error'](0x1f4,_0x4b73ed[_0x7d42('0x19')]));});});}; \ No newline at end of file +var _0xf6d6=['limit','UpdateOpenchannelInteraction','catch','AddTagsToOpenchannelInteraction','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelInteraction','update','body','options','where','attributes'];(function(_0x30818e,_0x537701){var _0x4d6a94=function(_0x285fff){while(--_0x285fff){_0x30818e['push'](_0x30818e['shift']());}};_0x4d6a94(++_0x537701);}(_0xf6d6,0xac));var _0x6f6d=function(_0x3a9698,_0x4c2199){_0x3a9698=_0x3a9698-0x0;var _0x595b2b=_0xf6d6[_0x3a9698];return _0x595b2b;};'use strict';var _=require(_0x6f6d('0x0'));var util=require(_0x6f6d('0x1'));var moment=require(_0x6f6d('0x2'));var BPromise=require(_0x6f6d('0x3'));var rs=require(_0x6f6d('0x4'));var fs=require('fs');var Redis=require(_0x6f6d('0x5'));var db=require(_0x6f6d('0x6'))['db'];var utils=require(_0x6f6d('0x7'));var logger=require(_0x6f6d('0x8'))(_0x6f6d('0x9'));var config=require(_0x6f6d('0xa'));var jayson=require(_0x6f6d('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x6f6d('0xc')]=_[_0x6f6d('0xd')](config['redis'],{'host':_0x6f6d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f6d('0xc')]));require(_0x6f6d('0xf'))[_0x6f6d('0x10')](socket);function respondWithRpcPromise(_0x422e01,_0x3a5717,_0x12c296){return new BPromise(function(_0x2e728d,_0x434892){return client['request'](_0x422e01,_0x12c296)[_0x6f6d('0x11')](function(_0x171301){logger[_0x6f6d('0x12')](_0x6f6d('0x13'),_0x3a5717,'request\x20sent');logger[_0x6f6d('0x14')](_0x6f6d('0x15'),_0x3a5717,_0x6f6d('0x16'),JSON[_0x6f6d('0x17')](_0x171301));if(_0x171301[_0x6f6d('0x18')]){if(_0x171301[_0x6f6d('0x18')][_0x6f6d('0x19')]===0x1f4){logger['error'](_0x6f6d('0x13'),_0x3a5717,_0x171301[_0x6f6d('0x18')][_0x6f6d('0x1a')]);return _0x434892(_0x171301[_0x6f6d('0x18')][_0x6f6d('0x1a')]);}logger[_0x6f6d('0x18')](_0x6f6d('0x13'),_0x3a5717,_0x171301[_0x6f6d('0x18')]['message']);return _0x2e728d(_0x171301[_0x6f6d('0x18')][_0x6f6d('0x1a')]);}else{logger[_0x6f6d('0x12')](_0x6f6d('0x13'),_0x3a5717,_0x6f6d('0x16'));_0x2e728d(_0x171301['result'][_0x6f6d('0x1a')]);}})['catch'](function(_0x1b398b){logger[_0x6f6d('0x18')](_0x6f6d('0x13'),_0x3a5717,_0x1b398b);_0x434892(_0x1b398b);});});}exports['UpdateOpenchannelInteraction']=function(_0x24f0a7){var _0x44a930=this;return new Promise(function(_0x2eef5a,_0x1516ab){return db[_0x6f6d('0x1b')][_0x6f6d('0x1c')](_0x24f0a7[_0x6f6d('0x1d')],{'raw':_0x24f0a7[_0x6f6d('0x1e')]?_0x24f0a7[_0x6f6d('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24f0a7[_0x6f6d('0x1e')]?_0x24f0a7['options'][_0x6f6d('0x1f')]||null:null,'attributes':_0x24f0a7['options']?_0x24f0a7[_0x6f6d('0x1e')][_0x6f6d('0x20')]||null:null,'limit':_0x24f0a7['options']?_0x24f0a7[_0x6f6d('0x1e')][_0x6f6d('0x21')]||null:null})['then'](function(_0x44d618){logger[_0x6f6d('0x12')](_0x6f6d('0x22'),_0x24f0a7);logger['debug'](_0x6f6d('0x22'),_0x24f0a7,JSON['stringify'](_0x44d618));_0x2eef5a(_0x44d618);})[_0x6f6d('0x23')](function(_0x18e418){logger[_0x6f6d('0x18')](_0x6f6d('0x22'),_0x18e418[_0x6f6d('0x1a')],_0x24f0a7);_0x1516ab(_0x44a930[_0x6f6d('0x18')](0x1f4,_0x18e418[_0x6f6d('0x1a')]));});});};exports[_0x6f6d('0x24')]=function(_0x9e4038){return new Promise(function(_0x551806,_0x2188f3){return db['OpenchannelInteraction']['find']({'where':_0x9e4038[_0x6f6d('0x1e')]?_0x9e4038[_0x6f6d('0x1e')][_0x6f6d('0x1f')]||null:null})[_0x6f6d('0x11')](function(_0x589676){if(_0x589676){return _0x589676[_0x6f6d('0x25')](_0x9e4038['body']['ids'],_[_0x6f6d('0x26')](_0x9e4038['body'],[_0x6f6d('0x27'),'id'])||{});}})['spread'](function(_0x494df6){logger[_0x6f6d('0x12')](_0x6f6d('0x28'),_0x9e4038);logger[_0x6f6d('0x14')]('AddTags',_0x9e4038,JSON[_0x6f6d('0x17')](_0x494df6));_0x551806(_0x494df6);})[_0x6f6d('0x23')](function(_0x3e09ba){logger['error'](_0x6f6d('0x28'),_0x3e09ba[_0x6f6d('0x1a')],_0x9e4038);_0x2188f3(_this[_0x6f6d('0x18')](0x1f4,_0x3e09ba['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 578756a..9d80370 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 _0x5243=['register','length','save','removeListener'];(function(_0x3a7954,_0x1fdc60){var _0xdc0a6e=function(_0x40eb2f){while(--_0x40eb2f){_0x3a7954['push'](_0x3a7954['shift']());}};_0xdc0a6e(++_0x1fdc60);}(_0x5243,0x14a));var _0x3524=function(_0x118342,_0x3699fe){_0x118342=_0x118342-0x0;var _0x321052=_0x5243[_0x118342];return _0x321052;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x3524('0x0'),'remove','update'];function createListener(_0x29d65a,_0x5c7f38){return function(_0x434670){_0x5c7f38['emit'](_0x29d65a,_0x434670);};}function removeListener(_0x4620be,_0xa2d9a9){return function(){OpenchannelInteractionEvents[_0x3524('0x1')](_0x4620be,_0xa2d9a9);};}exports[_0x3524('0x2')]=function(_0x2ff1a3){for(var _0x2b156d=0x0,_0x32b2a2=events[_0x3524('0x3')];_0x2b156d<_0x32b2a2;_0x2b156d++){var _0x5c9739=events[_0x2b156d];var _0x107266=createListener('openchannelInteraction:'+_0x5c9739,_0x2ff1a3);OpenchannelInteractionEvents['on'](_0x5c9739,_0x107266);}}; \ No newline at end of file +var _0xb6f5=['./openchannelInteraction.events','remove','update','emit','removeListener','length','openchannelInteraction:'];(function(_0xbeb8b6,_0xbbaf79){var _0x566c93=function(_0xd4e3ee){while(--_0xd4e3ee){_0xbeb8b6['push'](_0xbeb8b6['shift']());}};_0x566c93(++_0xbbaf79);}(_0xb6f5,0x13b));var _0x5b6f=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0xb6f5[_0x3474ac];return _0x5345ec;};'use strict';var OpenchannelInteractionEvents=require(_0x5b6f('0x0'));var events=['save',_0x5b6f('0x1'),_0x5b6f('0x2')];function createListener(_0x455530,_0x197c46){return function(_0x4dd106){_0x197c46[_0x5b6f('0x3')](_0x455530,_0x4dd106);};}function removeListener(_0x17d9d3,_0xd3f22e){return function(){OpenchannelInteractionEvents[_0x5b6f('0x4')](_0x17d9d3,_0xd3f22e);};}exports['register']=function(_0x19aa4d){for(var _0x38cfd3=0x0,_0x76be3e=events[_0x5b6f('0x5')];_0x38cfd3<_0x76be3e;_0x38cfd3++){var _0x23ded7=events[_0x38cfd3];var _0x3a1e57=createListener(_0x5b6f('0x6')+_0x23ded7,_0x19aa4d);OpenchannelInteractionEvents['on'](_0x23ded7,_0x3a1e57);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 2796631..ee8b3e7 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 _0x0a4b=['openchannel','openchannelmessage:create','create','update','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked'];(function(_0x4152ba,_0xb46373){var _0x1bf8b4=function(_0x5beb82){while(--_0x5beb82){_0x4152ba['push'](_0x4152ba['shift']());}};_0x1bf8b4(++_0xb46373);}(_0x0a4b,0x193));var _0xb0a4=function(_0x492958,_0xf868f7){_0x492958=_0x492958-0x0;var _0x20aba4=_0x0a4b[_0x492958];return _0x20aba4;};'use strict';var multer=require(_0xb0a4('0x0'));var util=require(_0xb0a4('0x1'));var path=require(_0xb0a4('0x2'));var timeout=require(_0xb0a4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb0a4('0x4'));var auth=require(_0xb0a4('0x5'));var interaction=require(_0xb0a4('0x6'));var config=require(_0xb0a4('0x7'));var controller=require(_0xb0a4('0x8'));router[_0xb0a4('0x9')]('/',auth[_0xb0a4('0xa')](),controller[_0xb0a4('0xb')]);router[_0xb0a4('0x9')](_0xb0a4('0xc'),auth['isAuthenticated'](),controller[_0xb0a4('0xd')]);router[_0xb0a4('0x9')](_0xb0a4('0xe'),auth[_0xb0a4('0xa')](),controller['show']);router[_0xb0a4('0xf')]('/',auth['isAuthenticated'](),interaction[_0xb0a4('0x10')](_0xb0a4('0x11'),_0xb0a4('0x12')),controller[_0xb0a4('0x13')]);router['put'](_0xb0a4('0xe'),auth[_0xb0a4('0xa')](),controller[_0xb0a4('0x14')]);router[_0xb0a4('0x15')](_0xb0a4('0x16'),auth['isAuthenticated'](),controller['accept']);router['put'](_0xb0a4('0x17'),auth['isAuthenticated'](),controller[_0xb0a4('0x18')]);router[_0xb0a4('0x19')](_0xb0a4('0xe'),auth[_0xb0a4('0xa')](),controller[_0xb0a4('0x1a')]);module[_0xb0a4('0x1b')]=router; \ No newline at end of file +var _0x3535=['accept','/:id/reject','reject','delete','destroy','exports','util','path','express','Router','fs-extra','./openchannelMessage.controller','get','isAuthenticated','index','/:id','show','tracked','openchannel','create','put','update','/:id/accept'];(function(_0xc1a760,_0x52c58d){var _0x43d11e=function(_0x2a01f0){while(--_0x2a01f0){_0xc1a760['push'](_0xc1a760['shift']());}};_0x43d11e(++_0x52c58d);}(_0x3535,0xa7));var _0x5353=function(_0x4e3b00,_0x480eb9){_0x4e3b00=_0x4e3b00-0x0;var _0x1f7d28=_0x3535[_0x4e3b00];return _0x1f7d28;};'use strict';var multer=require('multer');var util=require(_0x5353('0x0'));var path=require(_0x5353('0x1'));var timeout=require('connect-timeout');var express=require(_0x5353('0x2'));var router=express[_0x5353('0x3')]();var fs_extra=require(_0x5353('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5353('0x5'));router[_0x5353('0x6')]('/',auth[_0x5353('0x7')](),controller[_0x5353('0x8')]);router[_0x5353('0x6')]('/describe',auth[_0x5353('0x7')](),controller['describe']);router['get'](_0x5353('0x9'),auth[_0x5353('0x7')](),controller[_0x5353('0xa')]);router['post']('/',auth[_0x5353('0x7')](),interaction[_0x5353('0xb')](_0x5353('0xc'),'openchannelmessage:create'),controller[_0x5353('0xd')]);router[_0x5353('0xe')](_0x5353('0x9'),auth['isAuthenticated'](),controller[_0x5353('0xf')]);router[_0x5353('0xe')](_0x5353('0x10'),auth['isAuthenticated'](),controller[_0x5353('0x11')]);router[_0x5353('0xe')](_0x5353('0x12'),auth[_0x5353('0x7')](),controller[_0x5353('0x13')]);router[_0x5353('0x14')](_0x5353('0x9'),auth[_0x5353('0x7')](),controller[_0x5353('0x15')]);module[_0x5353('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 282b486..ad31a8a 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 _0x0736=['out','DATE','STRING','TEXT','sequelize','medium','BOOLEAN'];(function(_0x12dc94,_0x2a43c6){var _0x49a414=function(_0x14708a){while(--_0x14708a){_0x12dc94['push'](_0x12dc94['shift']());}};_0x49a414(++_0x2a43c6);}(_0x0736,0x154));var _0x6073=function(_0xc1f1a2,_0x1c2d0c){_0xc1f1a2=_0xc1f1a2-0x0;var _0x56e4d0=_0x0736[_0xc1f1a2];return _0x56e4d0;};'use strict';var Sequelize=require(_0x6073('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x6073('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x6073('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6073('0x3')),'defaultValue':_0x6073('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x6073('0x4')]},'providerName':{'type':Sequelize[_0x6073('0x5')]},'providerResponse':{'type':Sequelize[_0x6073('0x6')]}}; \ No newline at end of file +var _0x0dbd=['sequelize','exports','medium','BOOLEAN','out','TEXT'];(function(_0x1877f6,_0x36065d){var _0xc063c5=function(_0x16970c){while(--_0x16970c){_0x1877f6['push'](_0x1877f6['shift']());}};_0xc063c5(++_0x36065d);}(_0x0dbd,0xc0));var _0xd0db=function(_0x59319e,_0x65c198){_0x59319e=_0x59319e-0x0;var _0x12acee=_0x0dbd[_0x59319e];return _0x12acee;};'use strict';var Sequelize=require(_0xd0db('0x0'));module[_0xd0db('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd0db('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd0db('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd0db('0x4')),'defaultValue':_0xd0db('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd0db('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index de6a221..71fd3ce 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 _0x2ae4=['openchannel','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SIP/%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','OpenchannelMessage','includeAll','include','findAll','show','params','rawAttributes','create','body','find','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','OpenchannelInteractionId','isNil','read1stAt','get','user','interaction','acceptMessage','manual','interface','channel','event','EventManager','openchannel-interactions'];(function(_0x50f42c,_0x5528aa){var _0xc1e318=function(_0x488043){while(--_0x488043){_0x50f42c['push'](_0x50f42c['shift']());}};_0xc1e318(++_0x5528aa);}(_0x2ae4,0x16c));var _0x42ae=function(_0x482d2e,_0x25cf19){_0x482d2e=_0x482d2e-0x0;var _0x2b8d2e=_0x2ae4[_0x482d2e];return _0x2b8d2e;};'use strict';var emlformat=require(_0x42ae('0x0'));var rimraf=require(_0x42ae('0x1'));var zipdir=require(_0x42ae('0x2'));var jsonpatch=require(_0x42ae('0x3'));var rp=require(_0x42ae('0x4'));var moment=require(_0x42ae('0x5'));var BPromise=require(_0x42ae('0x6'));var Mustache=require('mustache');var util=require(_0x42ae('0x7'));var path=require(_0x42ae('0x8'));var sox=require(_0x42ae('0x9'));var csv=require('to-csv');var ejs=require(_0x42ae('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42ae('0xb'));var squel=require(_0x42ae('0xc'));var crypto=require(_0x42ae('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x42ae('0xe'));var querystring=require(_0x42ae('0xf'));var Papa=require(_0x42ae('0x10'));var Redis=require('ioredis');var authService=require(_0x42ae('0x11'));var qs=require(_0x42ae('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x42ae('0x13'));var logger=require(_0x42ae('0x14'))(_0x42ae('0x15'));var utils=require(_0x42ae('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x42ae('0x17'));var db=require(_0x42ae('0x18'))['db'];config[_0x42ae('0x19')]=_['defaults'](config['redis'],{'host':_0x42ae('0x1a'),'port':0x18eb});var socket=require(_0x42ae('0x1b'))(new Redis(config[_0x42ae('0x19')]));require(_0x42ae('0x1c'))['register'](socket);var jayson=require(_0x42ae('0x1d'));var client=jayson[_0x42ae('0x1e')][_0x42ae('0x1f')]({'port':0x232c});var client9002=jayson[_0x42ae('0x1e')][_0x42ae('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4e7181,_0x50735c,_0x229383,_0xd52147){return new BPromise(function(_0xcdb2a1,_0x17025e){var _0x3c629f=_0xd52147||client;return _0x3c629f['request'](_0x4e7181,_0x229383)[_0x42ae('0x20')](function(_0x2f9f90){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x50735c,_0x42ae('0x21'));logger[_0x42ae('0x22')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x50735c,_0x42ae('0x21'),JSON[_0x42ae('0x23')](_0x2f9f90));if(_0x2f9f90[_0x42ae('0x24')]){if(_0x2f9f90[_0x42ae('0x24')][_0x42ae('0x25')]===0x1f4){logger[_0x42ae('0x24')](_0x42ae('0x26'),_0x50735c,_0x2f9f90['error'][_0x42ae('0x27')]);return _0x17025e(_0x2f9f90[_0x42ae('0x24')][_0x42ae('0x27')]);}logger[_0x42ae('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x50735c,_0x2f9f90[_0x42ae('0x24')]['message']);return _0xcdb2a1(_0x2f9f90['error'][_0x42ae('0x27')]);}else{logger[_0x42ae('0x28')](_0x42ae('0x26'),_0x50735c,'request\x20sent');_0xcdb2a1(_0x2f9f90[_0x42ae('0x29')]['message']);}})[_0x42ae('0x2a')](function(_0x6e4a71){logger[_0x42ae('0x24')](_0x42ae('0x26'),_0x50735c,_0x6e4a71);_0x17025e(_0x6e4a71);});});}function respondWithStatusCode(_0xf97c9f,_0x34256b){_0x34256b=_0x34256b||0xcc;return function(_0x2dd25c){if(_0x2dd25c){return _0xf97c9f[_0x42ae('0x2b')](_0x34256b);}return _0xf97c9f[_0x42ae('0x2c')](_0x34256b)[_0x42ae('0x2d')]();};}function respondWithResult(_0x298b6c,_0x196631){_0x196631=_0x196631||0xc8;return function(_0x47750c){if(_0x47750c){return _0x298b6c['status'](_0x196631)[_0x42ae('0x2e')](_0x47750c);}};}function respondWithFilteredResult(_0x1c45d6,_0x26b0da){return function(_0x5bd07f){if(_0x5bd07f){var _0x3c3993=_0x5bd07f[_0x42ae('0x2f')],_0x44731a=_0x26b0da[_0x42ae('0x30')],_0x3d0ccc=_0x26b0da[_0x42ae('0x30')]+_0x26b0da[_0x42ae('0x31')],_0xe207ae;if(_0x3d0ccc>=_0x3c3993){_0x3d0ccc=_0x3c3993;_0xe207ae=0xc8;}else{_0xe207ae=0xce;}_0x1c45d6[_0x42ae('0x2c')](_0xe207ae);return _0x1c45d6[_0x42ae('0x32')](_0x42ae('0x33'),_0x44731a+'-'+_0x3d0ccc+'/'+_0x3c3993)[_0x42ae('0x2e')](_0x5bd07f);}return null;};}function patchUpdates(_0x34d51b){return function(_0x4b863b){try{jsonpatch[_0x42ae('0x34')](_0x4b863b,_0x34d51b,!![]);}catch(_0x213143){return BPromise[_0x42ae('0x35')](_0x213143);}return _0x4b863b[_0x42ae('0x36')]();};}function saveUpdates(_0x350995,_0x24b8b7){return function(_0x4f1dbf){if(_0x4f1dbf){return _0x4f1dbf[_0x42ae('0x37')](_0x350995)[_0x42ae('0x20')](function(_0x43edb5){return _0x43edb5;});}return null;};}function removeEntity(_0x3cc2f4,_0x2301a7){return function(_0x286160){if(_0x286160){return _0x286160[_0x42ae('0x38')]()[_0x42ae('0x20')](function(){_0x3cc2f4[_0x42ae('0x2c')](0xcc)[_0x42ae('0x2d')]();});}};}function handleEntityNotFound(_0x299489,_0x155d6a){return function(_0x408076){if(!_0x408076){_0x299489[_0x42ae('0x2b')](0x194);}return _0x408076;};}function handleError(_0x6c448b,_0xc15aaf){_0xc15aaf=_0xc15aaf||0x1f4;return function(_0xeffd02){logger[_0x42ae('0x24')](_0xeffd02[_0x42ae('0x39')]);if(_0xeffd02[_0x42ae('0x3a')]){delete _0xeffd02[_0x42ae('0x3a')];}_0x6c448b[_0x42ae('0x2c')](_0xc15aaf)['send'](_0xeffd02);};}exports[_0x42ae('0x3b')]=function(_0x25dd3a,_0x36b035){var _0x5b9e5a={},_0x9266b={},_0x1cffa8={'count':0x0,'rows':[]};var _0x11d090=_[_0x42ae('0x3c')](db['OpenchannelMessage']['rawAttributes'],function(_0x46c7ce){return{'name':_0x46c7ce[_0x42ae('0x3d')],'type':_0x46c7ce['type'][_0x42ae('0x3e')]};});_0x9266b[_0x42ae('0x3f')]=_['map'](_0x11d090,_0x42ae('0x3a'));_0x9266b[_0x42ae('0x40')]=_[_0x42ae('0x41')](_0x25dd3a[_0x42ae('0x40')]);_0x9266b[_0x42ae('0x42')]=_[_0x42ae('0x43')](_0x9266b[_0x42ae('0x3f')],_0x9266b['query']);_0x5b9e5a[_0x42ae('0x44')]=_[_0x42ae('0x43')](_0x9266b['model'],qs[_0x42ae('0x45')](_0x25dd3a['query']['fields']));_0x5b9e5a[_0x42ae('0x44')]=_0x5b9e5a[_0x42ae('0x44')][_0x42ae('0x46')]?_0x5b9e5a[_0x42ae('0x44')]:_0x9266b[_0x42ae('0x3f')];if(!_0x25dd3a['query'][_0x42ae('0x47')]('nolimit')){_0x5b9e5a[_0x42ae('0x31')]=qs[_0x42ae('0x31')](_0x25dd3a['query']['limit']);_0x5b9e5a[_0x42ae('0x30')]=qs[_0x42ae('0x30')](_0x25dd3a[_0x42ae('0x40')][_0x42ae('0x30')]);}_0x5b9e5a[_0x42ae('0x48')]=qs['sort'](_0x25dd3a['query'][_0x42ae('0x49')]);_0x5b9e5a[_0x42ae('0x4a')]=qs[_0x42ae('0x42')](_[_0x42ae('0x4b')](_0x25dd3a['query'],_0x9266b[_0x42ae('0x42')]),_0x11d090);if(_0x25dd3a[_0x42ae('0x40')][_0x42ae('0x4c')]){_0x5b9e5a['where']=_[_0x42ae('0x4d')](_0x5b9e5a['where'],{'$or':_[_0x42ae('0x3c')](_0x11d090,function(_0xa072c3){if(_0xa072c3[_0x42ae('0x4e')]!==_0x42ae('0x4f')){var _0x30b74a={};_0x30b74a[_0xa072c3['name']]={'$like':'%'+_0x25dd3a[_0x42ae('0x40')][_0x42ae('0x4c')]+'%'};return _0x30b74a;}})});}_0x5b9e5a=_[_0x42ae('0x4d')]({},_0x5b9e5a,_0x25dd3a[_0x42ae('0x50')]);var _0x45351e={'where':_0x5b9e5a[_0x42ae('0x4a')]};return db[_0x42ae('0x51')][_0x42ae('0x2f')](_0x45351e)[_0x42ae('0x20')](function(_0x4ec592){_0x1cffa8[_0x42ae('0x2f')]=_0x4ec592;if(_0x25dd3a[_0x42ae('0x40')][_0x42ae('0x52')]){_0x5b9e5a[_0x42ae('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x42ae('0x54')](_0x5b9e5a);})[_0x42ae('0x20')](function(_0x92ec79){_0x1cffa8['rows']=_0x92ec79;return _0x1cffa8;})['then'](respondWithFilteredResult(_0x36b035,_0x5b9e5a))['catch'](handleError(_0x36b035,null));};exports[_0x42ae('0x55')]=function(_0x2b1445,_0x31dec9){var _0x37afd4={'raw':!![],'where':{'id':_0x2b1445[_0x42ae('0x56')]['id']}},_0xc1c2fc={};_0xc1c2fc[_0x42ae('0x3f')]=_['keys'](db[_0x42ae('0x51')][_0x42ae('0x57')]);_0xc1c2fc[_0x42ae('0x40')]=_[_0x42ae('0x41')](_0x2b1445[_0x42ae('0x40')]);_0xc1c2fc[_0x42ae('0x42')]=_[_0x42ae('0x43')](_0xc1c2fc[_0x42ae('0x3f')],_0xc1c2fc[_0x42ae('0x40')]);_0x37afd4['attributes']=_[_0x42ae('0x43')](_0xc1c2fc[_0x42ae('0x3f')],qs[_0x42ae('0x45')](_0x2b1445[_0x42ae('0x40')][_0x42ae('0x45')]));_0x37afd4[_0x42ae('0x44')]=_0x37afd4[_0x42ae('0x44')][_0x42ae('0x46')]?_0x37afd4[_0x42ae('0x44')]:_0xc1c2fc[_0x42ae('0x3f')];if(_0x2b1445[_0x42ae('0x40')][_0x42ae('0x52')]){_0x37afd4[_0x42ae('0x53')]=[{'all':!![]}];}_0x37afd4=_[_0x42ae('0x4d')]({},_0x37afd4,_0x2b1445['options']);return db['OpenchannelMessage']['find'](_0x37afd4)['then'](handleEntityNotFound(_0x31dec9,null))[_0x42ae('0x20')](respondWithResult(_0x31dec9,null))['catch'](handleError(_0x31dec9,null));};exports[_0x42ae('0x58')]=function(_0xbe1f55,_0x37807a){return db[_0x42ae('0x51')][_0x42ae('0x58')](_0xbe1f55['body'],{})[_0x42ae('0x20')](respondWithResult(_0x37807a,0xc9))[_0x42ae('0x2a')](handleError(_0x37807a,null));};exports['update']=function(_0x4c6347,_0x473dd2){if(_0x4c6347['body']['id']){delete _0x4c6347[_0x42ae('0x59')]['id'];}return db[_0x42ae('0x51')][_0x42ae('0x5a')]({'where':{'id':_0x4c6347[_0x42ae('0x56')]['id']}})['then'](handleEntityNotFound(_0x473dd2,null))['then'](saveUpdates(_0x4c6347['body'],null))[_0x42ae('0x20')](respondWithResult(_0x473dd2,null))['catch'](handleError(_0x473dd2,null));};exports[_0x42ae('0x38')]=function(_0x9a180c,_0x18b18c){return db[_0x42ae('0x51')][_0x42ae('0x5a')]({'where':{'id':_0x9a180c[_0x42ae('0x56')]['id']}})[_0x42ae('0x20')](handleEntityNotFound(_0x18b18c,null))['then'](removeEntity(_0x18b18c,null))[_0x42ae('0x2a')](handleError(_0x18b18c,null));};exports[_0x42ae('0x5b')]=function(_0xf2d160,_0x35e139){return db[_0x42ae('0x51')]['describe']()[_0x42ae('0x20')](respondWithResult(_0x35e139,null))[_0x42ae('0x2a')](handleError(_0x35e139,null));};var interaction_log=require(_0x42ae('0x14'))('openchannel-interactions');exports[_0x42ae('0x5c')]=function(_0x25aa51,_0x1af5ee,_0x239e45){var _0x2d5de0={'agent':{},'channel':'openchannel'};if(_0x25aa51[_0x42ae('0x59')]['id']){delete _0x25aa51['body']['id'];}_0x25aa51[_0x42ae('0x59')]['read']=!![];_0x25aa51['body'][_0x42ae('0x5d')]=moment()[_0x42ae('0x5e')](_0x42ae('0x5f'));_0x25aa51[_0x42ae('0x59')][_0x42ae('0x60')]=_0x25aa51[_0x42ae('0x59')]['UserId']||_0x25aa51['user']['id'];_0x2d5de0['agent']['id']=_0x25aa51[_0x42ae('0x59')]['UserId'];return db[_0x42ae('0x51')]['find']({'where':{'id':_0x25aa51[_0x42ae('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x42ae('0x61')],'as':_0x42ae('0x62')}]})['then'](handleEntityNotFound(_0x1af5ee,null))[_0x42ae('0x20')](saveUpdates(_0x25aa51[_0x42ae('0x59')],null))[_0x42ae('0x20')](function(_0x493482){if(_0x493482){_0x2d5de0['message']=_0x493482['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x42ae('0x5a')]({'where':{'id':_0x493482[_0x42ae('0x63')]}});}return null;})[_0x42ae('0x20')](handleEntityNotFound(_0x1af5ee,null))[_0x42ae('0x20')](function(_0x3992b2){if(_0x3992b2){return _0x3992b2[_0x42ae('0x37')]({'UserId':_0x25aa51[_0x42ae('0x59')][_0x42ae('0x60')],'read1stAt':_[_0x42ae('0x64')](_0x3992b2[_0x42ae('0x65')])?moment()[_0x42ae('0x5e')](_0x42ae('0x5f')):undefined});}return null;})[_0x42ae('0x20')](function(_0x3cb255){if(_0x3cb255){_0x2d5de0['interaction']=_0x3cb255[_0x42ae('0x66')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x25aa51[_0x42ae('0x67')]['id'],_0x25aa51['user'][_0x42ae('0x3a')],_0x25aa51[_0x42ae('0x67')]['role'],_0x2d5de0[_0x42ae('0x68')]['id'],_0x25aa51[_0x42ae('0x59')]?JSON[_0x42ae('0x23')](_0x25aa51['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x42ae('0x69'),_0x2d5de0);}return null;})[_0x42ae('0x20')](function(_0x4d6adf){if(_0x4d6adf){if(_0x25aa51[_0x42ae('0x59')][_0x42ae('0x6a')]){_0x2d5de0[_0x42ae('0x27')][_0x42ae('0x6b')]=util[_0x42ae('0x5e')]('SIP/%s',_0x25aa51[_0x42ae('0x67')]['name']);_0x2d5de0[_0x42ae('0x27')][_0x42ae('0x6c')]=_0x2d5de0[_0x42ae('0x6c')];_0x2d5de0[_0x42ae('0x27')][_0x42ae('0x6d')]=_0x42ae('0x5c');return respondWithRpcPromise(_0x42ae('0x6e'),_0x42ae('0x6e'),{'event':'acceptmessage','message':_0x2d5de0['message']},client9002)[_0x42ae('0x20')](function(){return _0x2d5de0;});}return _0x2d5de0;}return null;})[_0x42ae('0x20')](respondWithResult(_0x1af5ee,null))['catch'](handleError(_0x1af5ee,null));};var interaction_log=require('../../config/logger')(_0x42ae('0x6f'));exports[_0x42ae('0x35')]=function(_0x32dd22,_0x3b51d6,_0x58eadc){var _0x42a695={'agent':{},'channel':_0x42ae('0x70')};if(_0x32dd22['body']['id']){delete _0x32dd22['body']['id'];}_0x32dd22[_0x42ae('0x59')][_0x42ae('0x60')]=_0x32dd22[_0x42ae('0x59')][_0x42ae('0x60')]||_0x32dd22[_0x42ae('0x67')]['id'];_0x42a695[_0x42ae('0x71')]['id']=_0x32dd22[_0x42ae('0x59')][_0x42ae('0x60')];return db[_0x42ae('0x51')][_0x42ae('0x5a')]({'where':{'id':_0x32dd22[_0x42ae('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b51d6,null))['then'](function(_0x16f43b){if(_0x16f43b){_0x42a695[_0x42ae('0x27')]=_0x16f43b[_0x42ae('0x66')]({'plain':!![]});return db['OpenchannelInteraction'][_0x42ae('0x5a')]({'where':{'id':_0x16f43b[_0x42ae('0x63')]}});}return null;})[_0x42ae('0x20')](handleEntityNotFound(_0x3b51d6,null))[_0x42ae('0x20')](function(_0x141096){if(_0x141096){_0x42a695[_0x42ae('0x68')]=_0x141096[_0x42ae('0x66')]({'plain':!![]});interaction_log[_0x42ae('0x28')](_0x42ae('0x72'),_0x32dd22[_0x42ae('0x67')]['id'],_0x32dd22['user'][_0x42ae('0x3a')],_0x32dd22[_0x42ae('0x67')]['role'],_0x42a695[_0x42ae('0x68')]['id'],_0x32dd22[_0x42ae('0x59')]?JSON[_0x42ae('0x23')](_0x32dd22[_0x42ae('0x59')]):_0x42ae('0x73'));return respondWithRpcPromise(_0x42ae('0x74'),_0x42ae('0x75'),_0x42a695);}return null;})[_0x42ae('0x20')](function(_0x4db009){if(_0x4db009){_0x4db009[_0x42ae('0x27')][_0x42ae('0x6b')]=util['format'](_0x42ae('0x76'),_0x32dd22[_0x42ae('0x67')][_0x42ae('0x3a')]);_0x4db009[_0x42ae('0x27')][_0x42ae('0x6c')]=_0x42a695['channel'];_0x4db009[_0x42ae('0x27')][_0x42ae('0x6d')]=_0x42ae('0x35');respondWithRpcPromise(_0x42ae('0x6e'),_0x42ae('0x6e'),{'event':'rejectmessage','message':_0x4db009['message']},client9002);return _0x42a695;}return null;})[_0x42ae('0x20')](respondWithResult(_0x3b51d6,null))[_0x42ae('0x2a')](handleError(_0x3b51d6,null));}; \ No newline at end of file +var _0x0732=['[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SIP/%s','rejectmessage','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','http','client','request','info','debug','request\x20sent','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','send','index','map','OpenchannelMessage','rawAttributes','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','params','include','find','body','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','agent','CmContact','get','OpenchannelInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','interface','channel','event','EventManager','acceptmessage'];(function(_0x864f3c,_0x5f5898){var _0x1ef579=function(_0x45a3ab){while(--_0x45a3ab){_0x864f3c['push'](_0x864f3c['shift']());}};_0x1ef579(++_0x5f5898);}(_0x0732,0x169));var _0x2073=function(_0x66f0fa,_0x49b3bf){_0x66f0fa=_0x66f0fa-0x0;var _0x5c4649=_0x0732[_0x66f0fa];return _0x5c4649;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2073('0x0'));var zipdir=require(_0x2073('0x1'));var jsonpatch=require(_0x2073('0x2'));var rp=require('request-promise');var moment=require(_0x2073('0x3'));var BPromise=require(_0x2073('0x4'));var Mustache=require(_0x2073('0x5'));var util=require(_0x2073('0x6'));var path=require(_0x2073('0x7'));var sox=require(_0x2073('0x8'));var csv=require('to-csv');var ejs=require(_0x2073('0x9'));var fs=require('fs');var fs_extra=require(_0x2073('0xa'));var _=require(_0x2073('0xb'));var squel=require(_0x2073('0xc'));var crypto=require(_0x2073('0xd'));var jsforce=require(_0x2073('0xe'));var deskjs=require(_0x2073('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2073('0x10'));var Redis=require(_0x2073('0x11'));var authService=require(_0x2073('0x12'));var qs=require(_0x2073('0x13'));var as=require(_0x2073('0x14'));var hardwareService=require(_0x2073('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x2073('0x16'));var config=require(_0x2073('0x17'));var licenseUtil=require(_0x2073('0x18'));var db=require(_0x2073('0x19'))['db'];config[_0x2073('0x1a')]=_[_0x2073('0x1b')](config[_0x2073('0x1a')],{'host':_0x2073('0x1c'),'port':0x18eb});var socket=require(_0x2073('0x1d'))(new Redis(config[_0x2073('0x1a')]));require(_0x2073('0x1e'))[_0x2073('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x2073('0x20')]({'port':0x232c});var client9002=jayson[_0x2073('0x21')][_0x2073('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x20d8c9,_0x95a34d,_0x4e953e,_0x4e3b63){return new BPromise(function(_0x7d9b81,_0x3413ae){var _0x14d3c9=_0x4e3b63||client;return _0x14d3c9[_0x2073('0x22')](_0x20d8c9,_0x4e953e)['then'](function(_0x5709e2){logger[_0x2073('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x95a34d,'request\x20sent');logger[_0x2073('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x95a34d,_0x2073('0x25'),JSON[_0x2073('0x26')](_0x5709e2));if(_0x5709e2['error']){if(_0x5709e2[_0x2073('0x27')][_0x2073('0x28')]===0x1f4){logger[_0x2073('0x27')](_0x2073('0x29'),_0x95a34d,_0x5709e2[_0x2073('0x27')][_0x2073('0x2a')]);return _0x3413ae(_0x5709e2[_0x2073('0x27')][_0x2073('0x2a')]);}logger['error'](_0x2073('0x29'),_0x95a34d,_0x5709e2['error'][_0x2073('0x2a')]);return _0x7d9b81(_0x5709e2[_0x2073('0x27')][_0x2073('0x2a')]);}else{logger[_0x2073('0x23')](_0x2073('0x29'),_0x95a34d,_0x2073('0x25'));_0x7d9b81(_0x5709e2['result']['message']);}})[_0x2073('0x2b')](function(_0x42ad33){logger[_0x2073('0x27')](_0x2073('0x29'),_0x95a34d,_0x42ad33);_0x3413ae(_0x42ad33);});});}function respondWithStatusCode(_0x229189,_0x33de88){_0x33de88=_0x33de88||0xcc;return function(_0x521fb9){if(_0x521fb9){return _0x229189[_0x2073('0x2c')](_0x33de88);}return _0x229189[_0x2073('0x2d')](_0x33de88)[_0x2073('0x2e')]();};}function respondWithResult(_0x288599,_0x10980e){_0x10980e=_0x10980e||0xc8;return function(_0x5b1c03){if(_0x5b1c03){return _0x288599[_0x2073('0x2d')](_0x10980e)[_0x2073('0x2f')](_0x5b1c03);}};}function respondWithFilteredResult(_0x59bf2d,_0x26609b){return function(_0x3f8695){if(_0x3f8695){var _0xa79e74=_0x3f8695[_0x2073('0x30')],_0x145797=_0x26609b[_0x2073('0x31')],_0x4b00e8=_0x26609b[_0x2073('0x31')]+_0x26609b[_0x2073('0x32')],_0x5684e8;if(_0x4b00e8>=_0xa79e74){_0x4b00e8=_0xa79e74;_0x5684e8=0xc8;}else{_0x5684e8=0xce;}_0x59bf2d[_0x2073('0x2d')](_0x5684e8);return _0x59bf2d['set'](_0x2073('0x33'),_0x145797+'-'+_0x4b00e8+'/'+_0xa79e74)['json'](_0x3f8695);}return null;};}function patchUpdates(_0x1a9ffa){return function(_0x44e6c5){try{jsonpatch[_0x2073('0x34')](_0x44e6c5,_0x1a9ffa,!![]);}catch(_0x4ff0ba){return BPromise[_0x2073('0x35')](_0x4ff0ba);}return _0x44e6c5[_0x2073('0x36')]();};}function saveUpdates(_0x3e4006,_0x32e747){return function(_0x4b6d7a){if(_0x4b6d7a){return _0x4b6d7a[_0x2073('0x37')](_0x3e4006)[_0x2073('0x38')](function(_0x5a43ad){return _0x5a43ad;});}return null;};}function removeEntity(_0x579bbd,_0x16c379){return function(_0x514353){if(_0x514353){return _0x514353[_0x2073('0x39')]()[_0x2073('0x38')](function(){_0x579bbd['status'](0xcc)[_0x2073('0x2e')]();});}};}function handleEntityNotFound(_0x5ebc32,_0x40f867){return function(_0xe7cdd6){if(!_0xe7cdd6){_0x5ebc32[_0x2073('0x2c')](0x194);}return _0xe7cdd6;};}function handleError(_0x110b0f,_0x357098){_0x357098=_0x357098||0x1f4;return function(_0x4369ae){logger[_0x2073('0x27')](_0x4369ae['stack']);if(_0x4369ae['name']){delete _0x4369ae['name'];}_0x110b0f[_0x2073('0x2d')](_0x357098)[_0x2073('0x3a')](_0x4369ae);};}exports[_0x2073('0x3b')]=function(_0xf8f46b,_0x34d039){var _0x13de63={},_0x9dd9da={},_0x374f17={'count':0x0,'rows':[]};var _0x21acc2=_[_0x2073('0x3c')](db[_0x2073('0x3d')][_0x2073('0x3e')],function(_0x7358a8){return{'name':_0x7358a8['fieldName'],'type':_0x7358a8['type'][_0x2073('0x3f')]};});_0x9dd9da[_0x2073('0x40')]=_[_0x2073('0x3c')](_0x21acc2,_0x2073('0x41'));_0x9dd9da['query']=_[_0x2073('0x42')](_0xf8f46b[_0x2073('0x43')]);_0x9dd9da[_0x2073('0x44')]=_[_0x2073('0x45')](_0x9dd9da[_0x2073('0x40')],_0x9dd9da[_0x2073('0x43')]);_0x13de63[_0x2073('0x46')]=_['intersection'](_0x9dd9da[_0x2073('0x40')],qs[_0x2073('0x47')](_0xf8f46b[_0x2073('0x43')]['fields']));_0x13de63[_0x2073('0x46')]=_0x13de63[_0x2073('0x46')][_0x2073('0x48')]?_0x13de63[_0x2073('0x46')]:_0x9dd9da[_0x2073('0x40')];if(!_0xf8f46b['query'][_0x2073('0x49')]('nolimit')){_0x13de63[_0x2073('0x32')]=qs[_0x2073('0x32')](_0xf8f46b[_0x2073('0x43')][_0x2073('0x32')]);_0x13de63['offset']=qs[_0x2073('0x31')](_0xf8f46b[_0x2073('0x43')][_0x2073('0x31')]);}_0x13de63['order']=qs[_0x2073('0x4a')](_0xf8f46b[_0x2073('0x43')][_0x2073('0x4a')]);_0x13de63['where']=qs[_0x2073('0x44')](_[_0x2073('0x4b')](_0xf8f46b[_0x2073('0x43')],_0x9dd9da[_0x2073('0x44')]),_0x21acc2);if(_0xf8f46b[_0x2073('0x43')][_0x2073('0x4c')]){_0x13de63[_0x2073('0x4d')]=_['merge'](_0x13de63[_0x2073('0x4d')],{'$or':_[_0x2073('0x3c')](_0x21acc2,function(_0x3004e6){if(_0x3004e6['type']!==_0x2073('0x4e')){var _0x11e5a0={};_0x11e5a0[_0x3004e6[_0x2073('0x41')]]={'$like':'%'+_0xf8f46b['query'][_0x2073('0x4c')]+'%'};return _0x11e5a0;}})});}_0x13de63=_[_0x2073('0x4f')]({},_0x13de63,_0xf8f46b[_0x2073('0x50')]);var _0xe49045={'where':_0x13de63[_0x2073('0x4d')]};return db[_0x2073('0x3d')][_0x2073('0x30')](_0xe49045)[_0x2073('0x38')](function(_0x1ce633){_0x374f17[_0x2073('0x30')]=_0x1ce633;if(_0xf8f46b[_0x2073('0x43')][_0x2073('0x51')]){_0x13de63['include']=[{'all':!![]}];}return db[_0x2073('0x3d')][_0x2073('0x52')](_0x13de63);})[_0x2073('0x38')](function(_0x124d9b){_0x374f17[_0x2073('0x53')]=_0x124d9b;return _0x374f17;})['then'](respondWithFilteredResult(_0x34d039,_0x13de63))['catch'](handleError(_0x34d039,null));};exports['show']=function(_0x21a79b,_0x4a4d15){var _0x49eb9a={'raw':!![],'where':{'id':_0x21a79b[_0x2073('0x54')]['id']}},_0xfceaa3={};_0xfceaa3['model']=_[_0x2073('0x42')](db[_0x2073('0x3d')][_0x2073('0x3e')]);_0xfceaa3[_0x2073('0x43')]=_[_0x2073('0x42')](_0x21a79b['query']);_0xfceaa3[_0x2073('0x44')]=_['intersection'](_0xfceaa3[_0x2073('0x40')],_0xfceaa3['query']);_0x49eb9a['attributes']=_[_0x2073('0x45')](_0xfceaa3[_0x2073('0x40')],qs[_0x2073('0x47')](_0x21a79b['query']['fields']));_0x49eb9a[_0x2073('0x46')]=_0x49eb9a[_0x2073('0x46')]['length']?_0x49eb9a[_0x2073('0x46')]:_0xfceaa3[_0x2073('0x40')];if(_0x21a79b[_0x2073('0x43')][_0x2073('0x51')]){_0x49eb9a[_0x2073('0x55')]=[{'all':!![]}];}_0x49eb9a=_['merge']({},_0x49eb9a,_0x21a79b[_0x2073('0x50')]);return db[_0x2073('0x3d')][_0x2073('0x56')](_0x49eb9a)['then'](handleEntityNotFound(_0x4a4d15,null))['then'](respondWithResult(_0x4a4d15,null))[_0x2073('0x2b')](handleError(_0x4a4d15,null));};exports['create']=function(_0x23bfc7,_0x566a0d){return db[_0x2073('0x3d')]['create'](_0x23bfc7[_0x2073('0x57')],{})[_0x2073('0x38')](respondWithResult(_0x566a0d,0xc9))['catch'](handleError(_0x566a0d,null));};exports[_0x2073('0x37')]=function(_0x16cc8e,_0xe9e67b){if(_0x16cc8e[_0x2073('0x57')]['id']){delete _0x16cc8e[_0x2073('0x57')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x16cc8e['params']['id']}})['then'](handleEntityNotFound(_0xe9e67b,null))['then'](saveUpdates(_0x16cc8e[_0x2073('0x57')],null))['then'](respondWithResult(_0xe9e67b,null))[_0x2073('0x2b')](handleError(_0xe9e67b,null));};exports['destroy']=function(_0x3f27ca,_0x4ef943){return db['OpenchannelMessage'][_0x2073('0x56')]({'where':{'id':_0x3f27ca[_0x2073('0x54')]['id']}})[_0x2073('0x38')](handleEntityNotFound(_0x4ef943,null))['then'](removeEntity(_0x4ef943,null))[_0x2073('0x2b')](handleError(_0x4ef943,null));};exports['describe']=function(_0x33e42d,_0x1796c7){return db[_0x2073('0x3d')][_0x2073('0x58')]()[_0x2073('0x38')](respondWithResult(_0x1796c7,null))['catch'](handleError(_0x1796c7,null));};var interaction_log=require(_0x2073('0x59'))(_0x2073('0x5a'));exports[_0x2073('0x5b')]=function(_0x470420,_0x51ca44,_0x3bf314){var _0x3c1b85={'agent':{},'channel':_0x2073('0x5c')};if(_0x470420['body']['id']){delete _0x470420[_0x2073('0x57')]['id'];}_0x470420[_0x2073('0x57')][_0x2073('0x5d')]=!![];_0x470420[_0x2073('0x57')][_0x2073('0x5e')]=moment()[_0x2073('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x470420['body']['UserId']=_0x470420[_0x2073('0x57')][_0x2073('0x60')]||_0x470420['user']['id'];_0x3c1b85[_0x2073('0x61')]['id']=_0x470420[_0x2073('0x57')][_0x2073('0x60')];return db[_0x2073('0x3d')][_0x2073('0x56')]({'where':{'id':_0x470420[_0x2073('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x2073('0x62')],'as':'Contact'}]})[_0x2073('0x38')](handleEntityNotFound(_0x51ca44,null))['then'](saveUpdates(_0x470420[_0x2073('0x57')],null))['then'](function(_0x3a522e){if(_0x3a522e){_0x3c1b85[_0x2073('0x2a')]=_0x3a522e[_0x2073('0x63')]({'plain':!![]});return db[_0x2073('0x64')][_0x2073('0x56')]({'where':{'id':_0x3a522e['OpenchannelInteractionId']}});}return null;})[_0x2073('0x38')](handleEntityNotFound(_0x51ca44,null))['then'](function(_0xd48ac6){if(_0xd48ac6){return _0xd48ac6[_0x2073('0x37')]({'UserId':_0x470420['body'][_0x2073('0x60')],'read1stAt':_[_0x2073('0x65')](_0xd48ac6['read1stAt'])?moment()[_0x2073('0x5f')](_0x2073('0x66')):undefined});}return null;})[_0x2073('0x38')](function(_0x446a9b){if(_0x446a9b){_0x3c1b85[_0x2073('0x67')]=_0x446a9b[_0x2073('0x63')]({'plain':!![]});interaction_log['info'](_0x2073('0x68'),_0x470420[_0x2073('0x69')]['id'],_0x470420[_0x2073('0x69')][_0x2073('0x41')],_0x470420[_0x2073('0x69')][_0x2073('0x6a')],_0x3c1b85[_0x2073('0x67')]['id'],_0x470420[_0x2073('0x57')]?JSON[_0x2073('0x26')](_0x470420[_0x2073('0x57')]):_0x2073('0x6b'));return respondWithRpcPromise(_0x2073('0x6c'),_0x2073('0x6d'),_0x3c1b85);}return null;})[_0x2073('0x38')](function(_0x2e9e90){if(_0x2e9e90){if(_0x470420[_0x2073('0x57')]['manual']){_0x3c1b85[_0x2073('0x2a')][_0x2073('0x6e')]=util[_0x2073('0x5f')]('SIP/%s',_0x470420[_0x2073('0x69')][_0x2073('0x41')]);_0x3c1b85['message'][_0x2073('0x6f')]=_0x3c1b85['channel'];_0x3c1b85[_0x2073('0x2a')][_0x2073('0x70')]=_0x2073('0x5b');return respondWithRpcPromise(_0x2073('0x71'),_0x2073('0x71'),{'event':_0x2073('0x72'),'message':_0x3c1b85[_0x2073('0x2a')]},client9002)['then'](function(){return _0x3c1b85;});}return _0x3c1b85;}return null;})['then'](respondWithResult(_0x51ca44,null))[_0x2073('0x2b')](handleError(_0x51ca44,null));};var interaction_log=require(_0x2073('0x59'))(_0x2073('0x5a'));exports[_0x2073('0x35')]=function(_0x1c1a5c,_0x148529,_0x105d15){var _0x361ed3={'agent':{},'channel':_0x2073('0x5c')};if(_0x1c1a5c[_0x2073('0x57')]['id']){delete _0x1c1a5c['body']['id'];}_0x1c1a5c[_0x2073('0x57')]['UserId']=_0x1c1a5c[_0x2073('0x57')][_0x2073('0x60')]||_0x1c1a5c[_0x2073('0x69')]['id'];_0x361ed3[_0x2073('0x61')]['id']=_0x1c1a5c['body'][_0x2073('0x60')];return db['OpenchannelMessage'][_0x2073('0x56')]({'where':{'id':_0x1c1a5c['params']['id'],'UserId':null}})[_0x2073('0x38')](handleEntityNotFound(_0x148529,null))[_0x2073('0x38')](function(_0x444a18){if(_0x444a18){_0x361ed3[_0x2073('0x2a')]=_0x444a18['get']({'plain':!![]});return db[_0x2073('0x64')]['find']({'where':{'id':_0x444a18['OpenchannelInteractionId']}});}return null;})[_0x2073('0x38')](handleEntityNotFound(_0x148529,null))[_0x2073('0x38')](function(_0x308a28){if(_0x308a28){_0x361ed3['interaction']=_0x308a28['get']({'plain':!![]});interaction_log['info'](_0x2073('0x73'),_0x1c1a5c['user']['id'],_0x1c1a5c[_0x2073('0x69')][_0x2073('0x41')],_0x1c1a5c[_0x2073('0x69')][_0x2073('0x6a')],_0x361ed3[_0x2073('0x67')]['id'],_0x1c1a5c['body']?JSON[_0x2073('0x26')](_0x1c1a5c[_0x2073('0x57')]):_0x2073('0x6b'));return respondWithRpcPromise(_0x2073('0x74'),'rejectMessage',_0x361ed3);}return null;})[_0x2073('0x38')](function(_0x1749cc){if(_0x1749cc){_0x1749cc[_0x2073('0x2a')][_0x2073('0x6e')]=util[_0x2073('0x5f')](_0x2073('0x75'),_0x1c1a5c[_0x2073('0x69')][_0x2073('0x41')]);_0x1749cc[_0x2073('0x2a')][_0x2073('0x6f')]=_0x361ed3[_0x2073('0x6f')];_0x1749cc[_0x2073('0x2a')][_0x2073('0x70')]=_0x2073('0x35');respondWithRpcPromise('EventManager',_0x2073('0x71'),{'event':_0x2073('0x76'),'message':_0x1749cc[_0x2073('0x2a')]},client9002);return _0x361ed3;}return null;})[_0x2073('0x38')](respondWithResult(_0x148529,null))[_0x2073('0x2b')](handleError(_0x148529,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 90083ce..dc2083a 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 _0x91b9=['hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x4a4fc7,_0x3e77d7){var _0x2b4adf=function(_0x3ca62f){while(--_0x3ca62f){_0x4a4fc7['push'](_0x4a4fc7['shift']());}};_0x2b4adf(++_0x3e77d7);}(_0x91b9,0x1ba));var _0x991b=function(_0x50d05d,_0x25d8e0){_0x50d05d=_0x50d05d-0x0;var _0x350c93=_0x91b9[_0x50d05d];return _0x350c93;};'use strict';var EventEmitter=require(_0x991b('0x0'));var OpenchannelMessage=require(_0x991b('0x1'))['db'][_0x991b('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x991b('0x3')](0x0);var events={'afterCreate':_0x991b('0x4'),'afterUpdate':_0x991b('0x5'),'afterDestroy':_0x991b('0x6')};function emitEvent(_0x463f3b){return function(_0x456209,_0x37f0d9,_0x49fa09){OpenchannelMessageEvents[_0x991b('0x7')](_0x463f3b+':'+_0x456209['id'],_0x456209);OpenchannelMessageEvents[_0x991b('0x7')](_0x463f3b,_0x456209);_0x49fa09(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x991b('0x8')](e,emitEvent(event));}}module[_0x991b('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x7b70=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x6d10aa,_0x306c45){var _0x5e2494=function(_0x231b07){while(--_0x231b07){_0x6d10aa['push'](_0x6d10aa['shift']());}};_0x5e2494(++_0x306c45);}(_0x7b70,0x1da));var _0x07b7=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x7b70[_0x1203f];return _0x365f0a;};'use strict';var EventEmitter=require(_0x07b7('0x0'));var OpenchannelMessage=require(_0x07b7('0x1'))['db'][_0x07b7('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x07b7('0x3')](0x0);var events={'afterCreate':_0x07b7('0x4'),'afterUpdate':_0x07b7('0x5'),'afterDestroy':_0x07b7('0x6')};function emitEvent(_0x3373de){return function(_0x3a1265,_0x1fd15d,_0x558ce0){OpenchannelMessageEvents[_0x07b7('0x7')](_0x3373de+':'+_0x3a1265['id'],_0x3a1265);OpenchannelMessageEvents[_0x07b7('0x7')](_0x3373de,_0x3a1265);_0x558ce0(null);};}for(var e in events){if(events[_0x07b7('0x8')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x07b7('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 6ea25ae..3c89ab1 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 _0x9cc3=['OpenchannelInteraction','Interactions','Contact','keys','replyUri','info','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','POST','method','body','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','findOne','OpenchannelInteractionId','then','update','catch','error','secret','CmContact','describe','find','OpenchannelAccountId'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0x9cc3,0x13b));var _0x39cc=function(_0x53842a,_0x4bf4a4){_0x53842a=_0x53842a-0x0;var _0x20f054=_0x9cc3[_0x53842a];return _0x20f054;};'use strict';var _=require(_0x39cc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x39cc('0x1'));var moment=require('moment');var BPromise=require(_0x39cc('0x2'));var rp=require(_0x39cc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39cc('0x4'));var config=require(_0x39cc('0x5'));var attributes=require(_0x39cc('0x6'));module[_0x39cc('0x7')]=function(_0x4f38c9,_0x31e9c4){return _0x4f38c9['define']('OpenchannelMessage',attributes,{'tableName':_0x39cc('0x8'),'paranoid':![],'indexes':[{'name':_0x39cc('0x9'),'fields':['body'],'type':_0x39cc('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c2024,_0x1e8feb,_0x1effc0){var _0x2c5813=_0x4f38c9[_0x39cc('0xb')];var _0x3d73de=_0x5c2024[_0x39cc('0xc')]({'plain':!![]});if(_0x3d73de[_0x39cc('0xd')][_0x39cc('0xe')]()==='in'||_0x3d73de[_0x39cc('0xd')]['toLowerCase']()===_0x39cc('0xf')&&!_0x3d73de['secret']&&!_[_0x39cc('0x10')](_0x3d73de['UserId'])){_0x2c5813['OpenchannelInteraction'][_0x39cc('0x11')]({'where':{'id':_0x3d73de[_0x39cc('0x12')]}})[_0x39cc('0x13')](function(_0x3f7d17){if(_0x3f7d17){_0x3f7d17[_0x39cc('0x14')]({'lastMsgAt':_0x3d73de['createdAt'],'lastMsgDirection':_0x3d73de[_0x39cc('0xd')][_0x39cc('0xe')]()});}})[_0x39cc('0x15')](function(_0x48c35e){console[_0x39cc('0x16')](_0x48c35e);});}if(_0x3d73de['direction']===_0x39cc('0xf')&&!_0x3d73de[_0x39cc('0x17')]){var _0x183b64;_0x2c5813[_0x39cc('0x18')][_0x39cc('0x19')]()[_0x39cc('0x13')](function(_0x236708){return _0x2c5813['OpenchannelAccount'][_0x39cc('0x1a')]({'where':{'id':_0x3d73de[_0x39cc('0x1b')]},'include':[{'model':_0x2c5813[_0x39cc('0x1c')],'as':_0x39cc('0x1d'),'where':{'id':_0x3d73de[_0x39cc('0x12')]},'limit':0x1,'include':[{'model':_0x2c5813[_0x39cc('0x18')],'as':_0x39cc('0x1e'),'attributes':_[_0x39cc('0x1f')](_0x236708)}]}]});})['then'](function(_0x2f235a){_0x183b64=_0x2f235a[_0x39cc('0xc')]({'plain':!![]});if(_0x183b64&&_0x183b64[_0x39cc('0x20')]){logger[_0x39cc('0x21')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x39cc('0x22')](_0x39cc('0x23'),_0x3d73de['id'],_0x183b64['replyUri']));if(_0x183b64['Interactions']&&_0x183b64[_0x39cc('0x1d')][_0x39cc('0x24')]){_0x3d73de[_0x39cc('0x25')]=_['omit'](_0x183b64['Interactions'][0x0],_0x39cc('0x1e'));_0x3d73de[_0x39cc('0x1e')]=_0x183b64[_0x39cc('0x1d')][0x0][_0x39cc('0x1e')];}var _0x1e8feb={'method':_0x39cc('0x26'),'uri':encodeURI(_0x183b64[_0x39cc('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1e8feb[_0x39cc('0x27')]){case'GET':_0x1e8feb['qs']=_0x3d73de;break;case'POST':_0x1e8feb[_0x39cc('0x28')]=_0x3d73de;break;}return rp(_0x1e8feb)['then'](function(_0x1564fc){logger['info'](_0x39cc('0x29'),_0x39cc('0x2a'),util['format'](_0x39cc('0x2b'),_0x3d73de['id'],_0x183b64['replyUri']));if(_0x1564fc['body']['threadId']&&_0x1564fc[_0x39cc('0x28')][_0x39cc('0x2c')]!=_0x3d73de[_0x39cc('0x25')][_0x39cc('0x2c')]){return _0x2c5813[_0x39cc('0x1c')][_0x39cc('0x14')]({'threadId':_0x1564fc[_0x39cc('0x28')][_0x39cc('0x2c')]},{'logging':!![],'where':{'id':_0x3d73de[_0x39cc('0x25')]['id']}});}else{return;}})[_0x39cc('0x13')](function(){return _0x5c2024['update']({'read':!![]});})[_0x39cc('0x15')](function(_0x204a68){logger[_0x39cc('0x16')](_0x39cc('0x29'),_0x39cc('0x2a'),util[_0x39cc('0x2d')](_0x204a68,{'showHidden':![],'depth':null}));_0x1effc0();});}else{_0x1effc0();}})[_0x39cc('0x2e')](function(){_0x1effc0();});}else{_0x1effc0();}}},'charset':_0x39cc('0x2f'),'collate':_0x39cc('0x30')});}; \ No newline at end of file +var _0xaa28=['catch','secret','CmContact','OpenchannelAccount','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','out','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','direction','toLowerCase'];(function(_0x322b6f,_0x589fe0){var _0x272373=function(_0x5ced1c){while(--_0x5ced1c){_0x322b6f['push'](_0x322b6f['shift']());}};_0x272373(++_0x589fe0);}(_0xaa28,0x1ee));var _0x8aa2=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0xaa28[_0x5dc03e];return _0x466a07;};'use strict';var _=require(_0x8aa2('0x0'));var util=require(_0x8aa2('0x1'));var logger=require(_0x8aa2('0x2'))('api');var moment=require(_0x8aa2('0x3'));var BPromise=require(_0x8aa2('0x4'));var rp=require(_0x8aa2('0x5'));var fs=require('fs');var path=require(_0x8aa2('0x6'));var rimraf=require('rimraf');var config=require(_0x8aa2('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x8aa2('0x8')]=function(_0x458459,_0xa760a5){return _0x458459[_0x8aa2('0x9')](_0x8aa2('0xa'),attributes,{'tableName':_0x8aa2('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x8aa2('0xc')],'type':_0x8aa2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1779b1,_0x2fa9bf,_0x51aa90){var _0x2a1ff6=_0x458459[_0x8aa2('0xe')];var _0x4f6fa1=_0x1779b1[_0x8aa2('0xf')]({'plain':!![]});if(_0x4f6fa1['direction']['toLowerCase']()==='in'||_0x4f6fa1['direction']['toLowerCase']()===_0x8aa2('0x10')&&!_0x4f6fa1['secret']&&!_[_0x8aa2('0x11')](_0x4f6fa1[_0x8aa2('0x12')])){_0x2a1ff6[_0x8aa2('0x13')][_0x8aa2('0x14')]({'where':{'id':_0x4f6fa1[_0x8aa2('0x15')]}})[_0x8aa2('0x16')](function(_0xf1a677){if(_0xf1a677){_0xf1a677[_0x8aa2('0x17')]({'lastMsgAt':_0x4f6fa1['createdAt'],'lastMsgDirection':_0x4f6fa1[_0x8aa2('0x18')][_0x8aa2('0x19')]()});}})[_0x8aa2('0x1a')](function(_0x2e3bb8){console['error'](_0x2e3bb8);});}if(_0x4f6fa1[_0x8aa2('0x18')]===_0x8aa2('0x10')&&!_0x4f6fa1[_0x8aa2('0x1b')]){var _0xea7ea7;_0x2a1ff6[_0x8aa2('0x1c')]['describe']()[_0x8aa2('0x16')](function(_0x6fa085){return _0x2a1ff6[_0x8aa2('0x1d')]['find']({'where':{'id':_0x4f6fa1[_0x8aa2('0x1e')]},'include':[{'model':_0x2a1ff6[_0x8aa2('0x13')],'as':_0x8aa2('0x1f'),'where':{'id':_0x4f6fa1['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x2a1ff6[_0x8aa2('0x1c')],'as':_0x8aa2('0x20'),'attributes':_[_0x8aa2('0x21')](_0x6fa085)}]}]});})[_0x8aa2('0x16')](function(_0x1b0d8f){_0xea7ea7=_0x1b0d8f[_0x8aa2('0xf')]({'plain':!![]});if(_0xea7ea7&&_0xea7ea7[_0x8aa2('0x22')]){logger[_0x8aa2('0x23')](_0x8aa2('0x24'),_0x8aa2('0x25'),util['format'](_0x8aa2('0x26'),_0x4f6fa1['id'],_0xea7ea7[_0x8aa2('0x22')]));if(_0xea7ea7['Interactions']&&_0xea7ea7[_0x8aa2('0x1f')][_0x8aa2('0x27')]){_0x4f6fa1['Interaction']=_[_0x8aa2('0x28')](_0xea7ea7['Interactions'][0x0],_0x8aa2('0x20'));_0x4f6fa1[_0x8aa2('0x20')]=_0xea7ea7['Interactions'][0x0][_0x8aa2('0x20')];}var _0x2fa9bf={'method':_0x8aa2('0x29'),'uri':encodeURI(_0xea7ea7['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2fa9bf[_0x8aa2('0x2a')]){case _0x8aa2('0x2b'):_0x2fa9bf['qs']=_0x4f6fa1;break;case _0x8aa2('0x29'):_0x2fa9bf[_0x8aa2('0xc')]=_0x4f6fa1;break;}return rp(_0x2fa9bf)[_0x8aa2('0x16')](function(_0x579e2c){logger[_0x8aa2('0x23')](_0x8aa2('0x24'),'afterCreate',util['format'](_0x8aa2('0x2c'),_0x4f6fa1['id'],_0xea7ea7[_0x8aa2('0x22')]));if(_0x579e2c['body'][_0x8aa2('0x2d')]&&_0x579e2c['body'][_0x8aa2('0x2d')]!=_0x4f6fa1['Interaction']['threadId']){return _0x2a1ff6[_0x8aa2('0x13')][_0x8aa2('0x17')]({'threadId':_0x579e2c[_0x8aa2('0xc')][_0x8aa2('0x2d')]},{'logging':!![],'where':{'id':_0x4f6fa1[_0x8aa2('0x2e')]['id']}});}else{return;}})['then'](function(){return _0x1779b1[_0x8aa2('0x17')]({'read':!![]});})[_0x8aa2('0x1a')](function(_0x90c4dd){logger[_0x8aa2('0x2f')]('OpenchannelMessage,\x20%s,\x20%s',_0x8aa2('0x25'),util[_0x8aa2('0x30')](_0x90c4dd,{'showHidden':![],'depth':null}));_0x51aa90();});}else{_0x51aa90();}})[_0x8aa2('0x31')](function(){_0x51aa90();});}else{_0x51aa90();}}},'charset':_0x8aa2('0x32'),'collate':_0x8aa2('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 589cc0b..341bb39 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 _0xd8b0=['util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','./openchannelMessage.socket','register','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','options','lodash'];(function(_0x3799f0,_0x36cce6){var _0x2188d9=function(_0x4ed31b){while(--_0x4ed31b){_0x3799f0['push'](_0x3799f0['shift']());}};_0x2188d9(++_0x36cce6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});config[_0x0d8b('0x9')]=_['defaults'](config[_0x0d8b('0x9')],{'host':_0x0d8b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d8b('0x9')]));require(_0x0d8b('0xb'))[_0x0d8b('0xc')](socket);function respondWithRpcPromise(_0x1f4800,_0x28ff7f,_0x1cac62){return new BPromise(function(_0x2c5e9e,_0x28f87c){return client['request'](_0x1f4800,_0x1cac62)[_0x0d8b('0xd')](function(_0x4e0269){logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x28ff7f,_0x0d8b('0x10'));logger[_0x0d8b('0x11')](_0x0d8b('0x12'),_0x28ff7f,_0x0d8b('0x10'),JSON[_0x0d8b('0x13')](_0x4e0269));if(_0x4e0269[_0x0d8b('0x14')]){if(_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x15')]===0x1f4){logger[_0x0d8b('0x14')](_0x0d8b('0xf'),_0x28ff7f,_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x16')]);return _0x28f87c(_0x4e0269['error'][_0x0d8b('0x16')]);}logger[_0x0d8b('0x14')](_0x0d8b('0xf'),_0x28ff7f,_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x16')]);return _0x2c5e9e(_0x4e0269['error'][_0x0d8b('0x16')]);}else{logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x28ff7f,_0x0d8b('0x10'));_0x2c5e9e(_0x4e0269[_0x0d8b('0x17')][_0x0d8b('0x16')]);}})[_0x0d8b('0x18')](function(_0xa3612a){logger['error'](_0x0d8b('0xf'),_0x28ff7f,_0xa3612a);_0x28f87c(_0xa3612a);});});}exports[_0x0d8b('0x19')]=function(_0x196c0a){var _0x143372=this;return new Promise(function(_0x24e8ed,_0x5b709c){return db[_0x0d8b('0x1a')][_0x0d8b('0x1b')](_0x196c0a['body'],{'raw':_0x196c0a['options']?_0x196c0a[_0x0d8b('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5527d8){logger[_0x0d8b('0xe')](_0x0d8b('0x19'),_0x196c0a);logger[_0x0d8b('0x11')](_0x0d8b('0x19'),_0x196c0a,JSON[_0x0d8b('0x13')](_0x5527d8));_0x24e8ed(_0x5527d8);})[_0x0d8b('0x18')](function(_0x30980c){logger[_0x0d8b('0x14')](_0x0d8b('0x19'),_0x30980c['message'],_0x196c0a);_0x5b709c(_0x143372[_0x0d8b('0x14')](0x1f4,_0x30980c[_0x0d8b('0x16')]));});});}; \ No newline at end of file +var _0xb10b=['options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body'];(function(_0xf15a33,_0xb58e5e){var _0xfa14ac=function(_0x38bcf7){while(--_0x38bcf7){_0xf15a33['push'](_0xf15a33['shift']());}};_0xfa14ac(++_0xb58e5e);}(_0xb10b,0x12a));var _0xbb10=function(_0x2c8d85,_0x590fef){_0x2c8d85=_0x2c8d85-0x0;var _0x277ef4=_0xb10b[_0x2c8d85];return _0x277ef4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('OpenchannelMessage,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['create'](_0x19f48d[_0xbb10('0x1f')],{'raw':_0x19f48d[_0xbb10('0x20')]?_0x19f48d['options']['raw']===undefined?!![]:![]:!![]})[_0xbb10('0x11')](function(_0x311abe){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger[_0xbb10('0x14')](_0xbb10('0x1d'),_0x19f48d,JSON[_0xbb10('0x16')](_0x311abe));_0x109908(_0x311abe);})[_0xbb10('0x1c')](function(_0x7f2377){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x7f2377[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x7f2377['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 81c0c35..396dcde 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 _0xd8b0=['save','emit','./openchannelMessage.events'];(function(_0x4493eb,_0x15a954){var _0x55e76c=function(_0x81710b){while(--_0x81710b){_0x4493eb['push'](_0x4493eb['shift']());}};_0x55e76c(++_0x15a954);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var OpenchannelMessageEvents=require(_0x0d8b('0x0'));var events=[_0x0d8b('0x1'),'remove','update'];function createListener(_0x4b72b0,_0x3ff8df){return function(_0x5b9b89){_0x3ff8df[_0x0d8b('0x2')](_0x4b72b0,_0x5b9b89);};}function removeListener(_0x364286,_0x8196ed){return function(){OpenchannelMessageEvents['removeListener'](_0x364286,_0x8196ed);};}exports['register']=function(_0x3f8b6f){for(var _0x227c63=0x0,_0x39f43a=events['length'];_0x227c63<_0x39f43a;_0x227c63++){var _0x413284=events[_0x227c63];var _0x284169=createListener('openchannelMessage:'+_0x413284,_0x3f8b6f);OpenchannelMessageEvents['on'](_0x413284,_0x284169);}}; \ No newline at end of file +var _0xbdb7=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x41f0fb,_0x155b08){_0x41f0fb=_0x41f0fb-0x0;var _0x494a7f=_0xbdb7[_0x41f0fb];return _0x494a7f;};'use strict';var OpenchannelMessageEvents=require(_0x7bdb('0x0'));var events=[_0x7bdb('0x1'),_0x7bdb('0x2'),_0x7bdb('0x3')];function createListener(_0x23c326,_0x433850){return function(_0x4496ac){_0x433850[_0x7bdb('0x4')](_0x23c326,_0x4496ac);};}function removeListener(_0x46c068,_0x47aec5){return function(){OpenchannelMessageEvents[_0x7bdb('0x5')](_0x46c068,_0x47aec5);};}exports['register']=function(_0x4b5fff){for(var _0xffdc86=0x0,_0x1e23a3=events['length'];_0xffdc86<_0x1e23a3;_0xffdc86++){var _0x513cba=events[_0xffdc86];var _0x468041=createListener(_0x7bdb('0x6')+_0x513cba,_0x4b5fff);OpenchannelMessageEvents['on'](_0x513cba,_0x468041);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 5728ea7..c5311d9 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 _0xa9e0=['post','create','/:id/teams','addTeams','put','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','show','/:id/members','isAuthenticated','getMembers','/:id/users','getAgents'];(function(_0x1c76e1,_0x3aaf3c){var _0x11fe49=function(_0x4e5a7b){while(--_0x4e5a7b){_0x1c76e1['push'](_0x1c76e1['shift']());}};_0x11fe49(++_0x3aaf3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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/teams',auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['post'](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x11')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller['addAgents']);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0xd')](),controller['update']);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth['isAuthenticated'](),controller[_0x0a9e('0x18')]);router['delete'](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);module[_0x0a9e('0x1b')]=router; \ No newline at end of file +var _0xa9e0=['post','create','/:id/teams','addTeams','put','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','show','/:id/members','isAuthenticated','getMembers','/:id/users','getAgents'];(function(_0x151732,_0x82b764){var _0x1cda86=function(_0x2f8406){while(--_0x2f8406){_0x151732['push'](_0x151732['shift']());}};_0x1cda86(++_0x82b764);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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/teams',auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['post'](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x11')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller['addAgents']);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0xd')](),controller['update']);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth['isAuthenticated'](),controller[_0x0a9e('0x18')]);router['delete'](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);module[_0x0a9e('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 813c515..ad72efa 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 _0xb44f=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xb44f,0x165));var _0xfb44=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb44f[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xfb44('0x0'));module[_0xfb44('0x1')]={'name':{'type':Sequelize[_0xfb44('0x2')],'unique':_0xfb44('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfb44('0x2')]},'timeout':{'type':Sequelize[_0xfb44('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb44('0x5')](_0xfb44('0x6'),_0xfb44('0x7'),_0xfb44('0x8'))}}; \ No newline at end of file +var _0x69a0=['beepall','sequelize','STRING','INTEGER','ENUM','rrmemory'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x69a0,0x181));var _0x069a=function(_0x420c5b,_0x40257a){_0x420c5b=_0x420c5b-0x0;var _0x5d864c=_0x69a0[_0x420c5b];return _0x5d864c;};'use strict';var Sequelize=require(_0x069a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x069a('0x1')]},'timeout':{'type':Sequelize[_0x069a('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x069a('0x3')](_0x069a('0x4'),_0x069a('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 8ca32e7..591d5e6 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 _0x6743=['find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','options','User','agent','openchannelPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','isEmpty','addAgents','omit','spread','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','OpenchannelQueue','includeAll','findAll','catch','params','rawAttributes','keys','include','create','body','user','role','UserProfileSection'];(function(_0x3a833e,_0x5a1878){var _0xdff445=function(_0x1715a3){while(--_0x1715a3){_0x3a833e['push'](_0x3a833e['shift']());}};_0xdff445(++_0x5a1878);}(_0x6743,0xd0));var _0x3674=function(_0xbc25e1,_0x27007d){_0xbc25e1=_0xbc25e1-0x0;var _0xaf0a85=_0x6743[_0xbc25e1];return _0xaf0a85;};'use strict';var emlformat=require(_0x3674('0x0'));var rimraf=require(_0x3674('0x1'));var zipdir=require(_0x3674('0x2'));var jsonpatch=require(_0x3674('0x3'));var rp=require(_0x3674('0x4'));var moment=require(_0x3674('0x5'));var BPromise=require(_0x3674('0x6'));var Mustache=require(_0x3674('0x7'));var util=require(_0x3674('0x8'));var path=require('path');var sox=require(_0x3674('0x9'));var csv=require(_0x3674('0xa'));var ejs=require(_0x3674('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3674('0xc'));var squel=require(_0x3674('0xd'));var crypto=require(_0x3674('0xe'));var jsforce=require(_0x3674('0xf'));var deskjs=require(_0x3674('0x10'));var toCsv=require(_0x3674('0xa'));var querystring=require(_0x3674('0x11'));var Papa=require(_0x3674('0x12'));var Redis=require('ioredis');var authService=require(_0x3674('0x13'));var qs=require(_0x3674('0x14'));var as=require(_0x3674('0x15'));var hardwareService=require(_0x3674('0x16'));var logger=require(_0x3674('0x17'))(_0x3674('0x18'));var utils=require(_0x3674('0x19'));var config=require(_0x3674('0x1a'));var licenseUtil=require(_0x3674('0x1b'));var db=require(_0x3674('0x1c'))['db'];config[_0x3674('0x1d')]=_[_0x3674('0x1e')](config[_0x3674('0x1d')],{'host':_0x3674('0x1f'),'port':0x18eb});var socket=require(_0x3674('0x20'))(new Redis(config[_0x3674('0x1d')]));require('./openchannelQueue.socket')[_0x3674('0x21')](socket);function respondWithStatusCode(_0x20f1ce,_0x35461b){_0x35461b=_0x35461b||0xcc;return function(_0x39bfa0){if(_0x39bfa0){return _0x20f1ce[_0x3674('0x22')](_0x35461b);}return _0x20f1ce[_0x3674('0x23')](_0x35461b)[_0x3674('0x24')]();};}function respondWithResult(_0x106e1a,_0x1a33be){_0x1a33be=_0x1a33be||0xc8;return function(_0x502a96){if(_0x502a96){return _0x106e1a[_0x3674('0x23')](_0x1a33be)['json'](_0x502a96);}};}function respondWithFilteredResult(_0x5a4b6b,_0x2f838d){return function(_0x633a88){if(_0x633a88){var _0x1927b7=_0x633a88[_0x3674('0x25')],_0x58fe59=_0x2f838d[_0x3674('0x26')],_0x37bcaa=_0x2f838d['offset']+_0x2f838d['limit'],_0x214217;if(_0x37bcaa>=_0x1927b7){_0x37bcaa=_0x1927b7;_0x214217=0xc8;}else{_0x214217=0xce;}_0x5a4b6b[_0x3674('0x23')](_0x214217);return _0x5a4b6b[_0x3674('0x27')](_0x3674('0x28'),_0x58fe59+'-'+_0x37bcaa+'/'+_0x1927b7)[_0x3674('0x29')](_0x633a88);}return null;};}function patchUpdates(_0xe5ca90){return function(_0xbb7294){try{jsonpatch[_0x3674('0x2a')](_0xbb7294,_0xe5ca90,!![]);}catch(_0x376174){return BPromise[_0x3674('0x2b')](_0x376174);}return _0xbb7294[_0x3674('0x2c')]();};}function saveUpdates(_0x9d04e9,_0xec7d40){return function(_0x89f0e){if(_0x89f0e){return _0x89f0e['update'](_0x9d04e9)['then'](function(_0xffbdd3){return _0xffbdd3;});}return null;};}function removeEntity(_0x17b3c6,_0x2f1da1){return function(_0x2b63b4){if(_0x2b63b4){return _0x2b63b4[_0x3674('0x2d')]()[_0x3674('0x2e')](function(){var _0x22e977=_0x2b63b4[_0x3674('0x2f')]({'plain':!![]});var _0x1ae72d=_0x3674('0x30');return db[_0x3674('0x31')]['destroy']({'where':{'type':_0x1ae72d,'resourceId':_0x22e977['id']}})[_0x3674('0x2e')](function(){return _0x2b63b4;});})[_0x3674('0x2e')](function(){_0x17b3c6[_0x3674('0x23')](0xcc)[_0x3674('0x24')]();});}};}function handleEntityNotFound(_0x12d889,_0x3360c4){return function(_0x518520){if(!_0x518520){_0x12d889[_0x3674('0x22')](0x194);}return _0x518520;};}function handleError(_0x1351b2,_0x544972){_0x544972=_0x544972||0x1f4;return function(_0x5c0860){logger[_0x3674('0x32')](_0x5c0860[_0x3674('0x33')]);if(_0x5c0860[_0x3674('0x34')]){delete _0x5c0860[_0x3674('0x34')];}_0x1351b2[_0x3674('0x23')](_0x544972)[_0x3674('0x35')](_0x5c0860);};}exports[_0x3674('0x36')]=function(_0x39e8e6,_0x466ca2){var _0x152b85={},_0x4a38e8={},_0x565bf8={'count':0x0,'rows':[]};var _0x345c45=_[_0x3674('0x37')](db['OpenchannelQueue']['rawAttributes'],function(_0x1b9ff0){return{'name':_0x1b9ff0['fieldName'],'type':_0x1b9ff0['type'][_0x3674('0x38')]};});_0x4a38e8[_0x3674('0x39')]=_[_0x3674('0x37')](_0x345c45,_0x3674('0x34'));_0x4a38e8['query']=_['keys'](_0x39e8e6[_0x3674('0x3a')]);_0x4a38e8[_0x3674('0x3b')]=_[_0x3674('0x3c')](_0x4a38e8[_0x3674('0x39')],_0x4a38e8['query']);_0x152b85['attributes']=_[_0x3674('0x3c')](_0x4a38e8['model'],qs[_0x3674('0x3d')](_0x39e8e6[_0x3674('0x3a')][_0x3674('0x3d')]));_0x152b85[_0x3674('0x3e')]=_0x152b85[_0x3674('0x3e')][_0x3674('0x3f')]?_0x152b85['attributes']:_0x4a38e8[_0x3674('0x39')];if(!_0x39e8e6['query']['hasOwnProperty'](_0x3674('0x40'))){_0x152b85[_0x3674('0x41')]=qs[_0x3674('0x41')](_0x39e8e6['query'][_0x3674('0x41')]);_0x152b85['offset']=qs['offset'](_0x39e8e6['query'][_0x3674('0x26')]);}_0x152b85[_0x3674('0x42')]=qs['sort'](_0x39e8e6['query'][_0x3674('0x43')]);_0x152b85[_0x3674('0x44')]=qs[_0x3674('0x3b')](_[_0x3674('0x45')](_0x39e8e6['query'],_0x4a38e8['filters']),_0x345c45);if(_0x39e8e6[_0x3674('0x3a')][_0x3674('0x46')]){_0x152b85['where']=_[_0x3674('0x47')](_0x152b85['where'],{'$or':_[_0x3674('0x37')](_0x345c45,function(_0x75e7c4){if(_0x75e7c4['type']!==_0x3674('0x48')){var _0x20493a={};_0x20493a[_0x75e7c4[_0x3674('0x34')]]={'$like':'%'+_0x39e8e6['query']['filter']+'%'};return _0x20493a;}})});}_0x152b85=_['merge']({},_0x152b85,_0x39e8e6['options']);var _0x1fa6f6={'where':_0x152b85[_0x3674('0x44')]};return db[_0x3674('0x49')][_0x3674('0x25')](_0x1fa6f6)[_0x3674('0x2e')](function(_0x46b99e){_0x565bf8[_0x3674('0x25')]=_0x46b99e;if(_0x39e8e6['query'][_0x3674('0x4a')]){_0x152b85['include']=[{'all':!![]}];}return db[_0x3674('0x49')][_0x3674('0x4b')](_0x152b85);})[_0x3674('0x2e')](function(_0x15fbd6){_0x565bf8['rows']=_0x15fbd6;return _0x565bf8;})[_0x3674('0x2e')](respondWithFilteredResult(_0x466ca2,_0x152b85))[_0x3674('0x4c')](handleError(_0x466ca2,null));};exports['show']=function(_0x27d855,_0x25278f){var _0x3dd642={'raw':!![],'where':{'id':_0x27d855[_0x3674('0x4d')]['id']}},_0x4a41f2={};_0x4a41f2[_0x3674('0x39')]=_['keys'](db[_0x3674('0x49')][_0x3674('0x4e')]);_0x4a41f2[_0x3674('0x3a')]=_[_0x3674('0x4f')](_0x27d855[_0x3674('0x3a')]);_0x4a41f2[_0x3674('0x3b')]=_['intersection'](_0x4a41f2[_0x3674('0x39')],_0x4a41f2[_0x3674('0x3a')]);_0x3dd642[_0x3674('0x3e')]=_[_0x3674('0x3c')](_0x4a41f2['model'],qs[_0x3674('0x3d')](_0x27d855[_0x3674('0x3a')]['fields']));_0x3dd642[_0x3674('0x3e')]=_0x3dd642[_0x3674('0x3e')][_0x3674('0x3f')]?_0x3dd642[_0x3674('0x3e')]:_0x4a41f2[_0x3674('0x39')];if(_0x27d855[_0x3674('0x3a')]['includeAll']){_0x3dd642[_0x3674('0x50')]=[{'all':!![]}];}_0x3dd642=_[_0x3674('0x47')]({},_0x3dd642,_0x27d855['options']);return db[_0x3674('0x49')]['find'](_0x3dd642)[_0x3674('0x2e')](handleEntityNotFound(_0x25278f,null))[_0x3674('0x2e')](respondWithResult(_0x25278f,null))[_0x3674('0x4c')](handleError(_0x25278f,null));};exports[_0x3674('0x51')]=function(_0x5f0cce,_0x221007){return db[_0x3674('0x49')][_0x3674('0x51')](_0x5f0cce[_0x3674('0x52')],{})[_0x3674('0x2e')](function(_0x31ce33){var _0x100ce9=_0x5f0cce[_0x3674('0x53')][_0x3674('0x2f')]({'plain':!![]});if(!_0x100ce9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x100ce9[_0x3674('0x54')]==='user'){var _0x2c74de=_0x31ce33[_0x3674('0x2f')]({'plain':!![]});var _0x1bb22b='OpenchannelQueues';return db[_0x3674('0x55')][_0x3674('0x56')]({'where':{'name':_0x1bb22b,'userProfileId':_0x100ce9[_0x3674('0x57')]},'raw':!![]})[_0x3674('0x2e')](function(_0x4a4fb9){if(_0x4a4fb9&&_0x4a4fb9[_0x3674('0x58')]===0x0){return db['UserProfileResource'][_0x3674('0x51')]({'name':_0x2c74de['name'],'resourceId':_0x2c74de['id'],'type':_0x4a4fb9[_0x3674('0x34')],'sectionId':_0x4a4fb9['id']},{})[_0x3674('0x2e')](function(){return _0x31ce33;});}else{return _0x31ce33;}})[_0x3674('0x4c')](function(_0x8321d9){logger[_0x3674('0x32')](_0x3674('0x59'),_0x8321d9);throw _0x8321d9;});}return _0x31ce33;})[_0x3674('0x2e')](respondWithResult(_0x221007,0xc9))[_0x3674('0x4c')](handleError(_0x221007,null));};exports[_0x3674('0x5a')]=function(_0x67d61f,_0x47aabf){if(_0x67d61f[_0x3674('0x52')]['id']){delete _0x67d61f[_0x3674('0x52')]['id'];}return db['OpenchannelQueue'][_0x3674('0x56')]({'where':{'id':_0x67d61f[_0x3674('0x4d')]['id']}})[_0x3674('0x2e')](handleEntityNotFound(_0x47aabf,null))[_0x3674('0x2e')](saveUpdates(_0x67d61f[_0x3674('0x52')],null))[_0x3674('0x2e')](respondWithResult(_0x47aabf,null))[_0x3674('0x4c')](handleError(_0x47aabf,null));};exports[_0x3674('0x2d')]=function(_0x4604e6,_0xe0a0dc){return db[_0x3674('0x49')][_0x3674('0x56')]({'where':{'id':_0x4604e6[_0x3674('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe0a0dc,null))[_0x3674('0x2e')](removeEntity(_0xe0a0dc,null))[_0x3674('0x4c')](handleError(_0xe0a0dc,null));};exports[_0x3674('0x5b')]=function(_0x324d7d,_0x489708){return db[_0x3674('0x49')]['describe']()[_0x3674('0x2e')](respondWithResult(_0x489708,null))[_0x3674('0x4c')](handleError(_0x489708,null));};exports[_0x3674('0x5c')]=function(_0x4786d2,_0x4e7704,_0x31f1a0){var _0x5d79bd={'raw':!![],'where':{}},_0x4dd376={},_0x5c8127;return db['OpenchannelQueue'][_0x3674('0x5d')]({'where':{'id':_0x4786d2[_0x3674('0x4d')]['id']}})[_0x3674('0x2e')](handleEntityNotFound(_0x4e7704,null))['then'](function(_0xb38ce2){if(_0xb38ce2){_0x5c8127=_0xb38ce2[_0x3674('0x2f')]({'plain':!![]});_0x4dd376[_0x3674('0x39')]=_[_0x3674('0x4f')](db[_0x3674('0x5e')][_0x3674('0x4e')]);_0x4dd376['query']=_['keys'](_0x4786d2[_0x3674('0x3a')]);_0x4dd376[_0x3674('0x3b')]=_[_0x3674('0x3c')](_0x4dd376[_0x3674('0x39')],_0x4dd376[_0x3674('0x3a')]);_0x5d79bd[_0x3674('0x3e')]=_[_0x3674('0x3c')](_0x4dd376[_0x3674('0x39')],qs[_0x3674('0x3d')](_0x4786d2['query'][_0x3674('0x3d')]));_0x5d79bd[_0x3674('0x3e')]=_0x5d79bd[_0x3674('0x3e')][_0x3674('0x3f')]?_0x5d79bd[_0x3674('0x3e')]:_0x4dd376[_0x3674('0x39')];if(!_0x4786d2[_0x3674('0x3a')][_0x3674('0x5f')](_0x3674('0x40'))){_0x5d79bd[_0x3674('0x41')]=qs[_0x3674('0x41')](_0x4786d2[_0x3674('0x3a')][_0x3674('0x41')]);_0x5d79bd[_0x3674('0x26')]=qs['offset'](_0x4786d2['query'][_0x3674('0x26')]);}_0x5d79bd['order']=qs[_0x3674('0x43')](_0x4786d2[_0x3674('0x3a')][_0x3674('0x43')]);_0x5d79bd[_0x3674('0x44')]=qs['filters'](_[_0x3674('0x45')](_0x4786d2['query'],_0x4dd376[_0x3674('0x3b')]));_0x5d79bd[_0x3674('0x44')]['OpenchannelQueueId']=_0xb38ce2['id'];if(_0x4786d2[_0x3674('0x3a')][_0x3674('0x46')]){_0x5d79bd[_0x3674('0x44')]=_[_0x3674('0x47')](_0x5d79bd['where'],{'$or':_['map'](_0x5d79bd[_0x3674('0x3e')],function(_0x5dba79){var _0x316655={};_0x316655[_0x5dba79]={'$like':'%'+_0x4786d2[_0x3674('0x3a')][_0x3674('0x46')]+'%'};return _0x316655;})});}_0x5d79bd=_[_0x3674('0x47')]({},_0x5d79bd,_0x4786d2[_0x3674('0x60')]);return db[_0x3674('0x5e')]['findAll'](_0x5d79bd);}})[_0x3674('0x2e')](function(_0x3082b5){if(_0x3082b5){return db[_0x3674('0x61')]['findAndCountAll']({'where':{'id':_[_0x3674('0x37')](_0x3082b5,'UserId'),'role':_0x3674('0x62')},'attributes':['id','name',_0x3674('0x63'),_0x3674('0x64'),_0x3674('0x65')]});}})[_0x3674('0x2e')](function(_0x378e6f){if(_0x378e6f){return{'count':_0x378e6f[_0x3674('0x25')],'rows':_[_0x3674('0x37')](_0x378e6f[_0x3674('0x66')],function(_0xaffbf6){return{'membername':_0xaffbf6[_0x3674('0x34')],'UserId':_0xaffbf6['id'],'queue_name':_0x5c8127[_0x3674('0x34')],'OpenchannelQueueId':_0x5c8127['id'],'interface':util[_0x3674('0x67')](_0x3674('0x68'),_0x3674('0x69'),_0xaffbf6['name']),'penalty':0x0,'paused':_0xaffbf6[_0x3674('0x63')],'createdAt':_0xaffbf6[_0x3674('0x65')],'updatedAt':_0xaffbf6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3674('0x2e')](respondWithFilteredResult(_0x4e7704,_0x5d79bd))[_0x3674('0x4c')](handleError(_0x4e7704,null));};exports[_0x3674('0x6a')]=function(_0x952596,_0x4fa151,_0x210147){var _0x580015={};var _0x217948={};var _0x3d829c;var _0x5ff343;return db[_0x3674('0x49')][_0x3674('0x5d')]({'where':{'id':_0x952596[_0x3674('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4fa151,null))[_0x3674('0x2e')](function(_0x451f98){if(_0x451f98){_0x3d829c=_0x451f98;_0x217948[_0x3674('0x39')]=_[_0x3674('0x4f')](db[_0x3674('0x6b')][_0x3674('0x4e')]);_0x217948[_0x3674('0x3a')]=_[_0x3674('0x4f')](_0x952596[_0x3674('0x3a')]);_0x217948['filters']=_[_0x3674('0x3c')](_0x217948['model'],_0x217948[_0x3674('0x3a')]);_0x580015[_0x3674('0x3e')]=_[_0x3674('0x3c')](_0x217948[_0x3674('0x39')],qs[_0x3674('0x3d')](_0x952596[_0x3674('0x3a')][_0x3674('0x3d')]));_0x580015[_0x3674('0x3e')]=_0x580015['attributes'][_0x3674('0x3f')]?_0x580015[_0x3674('0x3e')]:_0x217948['model'];_0x580015[_0x3674('0x42')]=qs[_0x3674('0x43')](_0x952596[_0x3674('0x3a')]['sort']);_0x580015['where']=qs[_0x3674('0x3b')](_[_0x3674('0x45')](_0x952596['query'],_0x217948[_0x3674('0x3b')]));if(_0x952596[_0x3674('0x3a')][_0x3674('0x46')]){_0x580015[_0x3674('0x44')]=_[_0x3674('0x47')](_0x580015[_0x3674('0x44')],{'$or':_[_0x3674('0x37')](_0x580015[_0x3674('0x3e')],function(_0x577854){var _0x3fa133={};_0x3fa133[_0x577854]={'$like':'%'+_0x952596['query']['filter']+'%'};return _0x3fa133;})});}_0x580015=_['merge']({},_0x580015,_0x952596['options']);return _0x3d829c[_0x3674('0x6a')](_0x580015);}})[_0x3674('0x2e')](function(_0x3f1e0b){if(_0x3f1e0b){_0x5ff343=_0x3f1e0b[_0x3674('0x3f')];if(!_0x952596[_0x3674('0x3a')]['hasOwnProperty'](_0x3674('0x40'))){_0x580015['limit']=qs['limit'](_0x952596[_0x3674('0x3a')][_0x3674('0x41')]);_0x580015[_0x3674('0x26')]=qs['offset'](_0x952596[_0x3674('0x3a')][_0x3674('0x26')]);}return _0x3d829c[_0x3674('0x6a')](_0x580015);}})[_0x3674('0x2e')](function(_0xb42787){if(_0xb42787){return _0xb42787?{'count':_0x5ff343,'rows':_0xb42787}:null;}})[_0x3674('0x2e')](respondWithResult(_0x4fa151,null))[_0x3674('0x4c')](handleError(_0x4fa151,null));};exports['addTeams']=function(_0x186492,_0x230b40,_0x4828db){var _0xe5a002=_0x186492[_0x3674('0x52')][_0x3674('0x6c')];return db['Team']['findAll']({'where':{'id':_0xe5a002},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3674('0x6d'),'attributes':['id','name',_0x3674('0x6e'),_0x3674('0x6f'),_0x3674('0x70')],'raw':!![]}]})[_0x3674('0x2e')](function(_0x2ef342){if(_0x2ef342){var _0x3d9a9a=_['flatMap'](_0x2ef342,function(_0x141dd9){var _0x2e059f=_0x141dd9[_0x3674('0x2f')]({'plain':!![]});return _0x2e059f[_0x3674('0x6d')];});return db['OpenchannelQueue'][_0x3674('0x56')]({'where':{'id':_0x186492[_0x3674('0x4d')]['id']}})[_0x3674('0x2e')](function(_0x540907){return db[_0x3674('0x71')][_0x3674('0x72')](function(_0x285d57){return _0x540907[_0x3674('0x73')](_0xe5a002,{'transaction':_0x285d57})[_0x3674('0x2e')](function(){return BPromise[_0x3674('0x74')](_0x3d9a9a,function(_0x3e5bae){return db[_0x3674('0x5e')][_0x3674('0x75')]({'where':{'UserId':_0x3e5bae['id'],'OpenchannelQueueId':_0x186492[_0x3674('0x4d')]['id']},'transaction':_0x285d57});});})[_0x3674('0x2e')](function(){_0x3d9a9a[_0x3674('0x76')](function(_0x22a4d1){socket[_0x3674('0x77')](_0x3674('0x78'),{'UserId':_0x22a4d1['id'],'OpenchannelQueueId':_0x540907['id']});});});});});}})[_0x3674('0x2e')](respondWithStatusCode(_0x230b40,null))[_0x3674('0x4c')](handleError(_0x230b40,null));};exports[_0x3674('0x79')]=function(_0x3d447c,_0xccd89e,_0x1a5797){return db['Team']['findAll']({'where':{'id':_0x3d447c[_0x3674('0x3a')][_0x3674('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x3674('0x61')],'as':_0x3674('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x3674('0x2e')](handleEntityNotFound(_0xccd89e,null))[_0x3674('0x2e')](function(_0x598242){var _0x19aeb8=_['map'](_0x598242,'id');var _0x5f0af3=[];var _0x34ef29=[];var _0x33762f=squel['select']();_0x33762f[_0x3674('0x7a')](_0x3674('0x7b'))[_0x3674('0x7c')](_0x3674('0x7d'),'tq')[_0x3674('0x7e')](_0x3674('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x3674('0x80'),_0x3d447c[_0x3674('0x4d')]['id']);for(var _0x39acf0=0x0;_0x39acf0<_0x598242[_0x3674('0x3f')];_0x39acf0+=0x1){let _0x4a3052=_0x598242[_0x39acf0];for(var _0x23796a=0x0;_0x23796a<_0x4a3052[_0x3674('0x6d')]['length'];_0x23796a+=0x1){let _0xd4893e=_0x4a3052[_0x3674('0x6d')][_0x23796a];var _0x2d82cb=_0x33762f['clone']();_0x2d82cb[_0x3674('0x44')](_0x3674('0x81'),_0xd4893e['id']);_0x34ef29[_0x3674('0x82')](db[_0x3674('0x71')][_0x3674('0x3a')](_0x2d82cb[_0x3674('0x83')](),{'type':db[_0x3674('0x71')][_0x3674('0x84')][_0x3674('0x85')]})[_0x3674('0x2e')](function(_0x35eecf){if(_0x35eecf[_0x3674('0x3f')]===0x1){return _0xd4893e['id'];}else{var _0x432afb=_[_0x3674('0x86')](_[_0x3674('0x37')](_0x35eecf,_0x3674('0x87')),function(_0x274b45){return _[_0x3674('0x88')](_0x19aeb8,_0x274b45);});if(_0x432afb){return _0xd4893e['id'];}}}));}}return BPromise[_0x3674('0x89')](_0x34ef29)[_0x3674('0x2e')](function(_0xcd4f8c){_0x5f0af3=_(_0x5f0af3)[_0x3674('0x8a')](_0xcd4f8c)['compact']()['value']();return db['OpenchannelQueue'][_0x3674('0x56')]({'where':{'id':_0x3d447c[_0x3674('0x4d')]['id']}})[_0x3674('0x2e')](function(_0x45cd97){return db['sequelize'][_0x3674('0x72')](function(_0x49e69b){return _0x45cd97[_0x3674('0x79')](_0x3d447c[_0x3674('0x3a')]['ids'],{'transaction':_0x49e69b})[_0x3674('0x2e')](function(){if(!_[_0x3674('0x8b')](_0x5f0af3)){return _0x45cd97['removeAgents'](_0x5f0af3,{'transaction':_0x49e69b});}})[_0x3674('0x2e')](function(){_0x5f0af3[_0x3674('0x76')](function(_0x4bebd8){socket[_0x3674('0x77')]('userOpenchannelQueue:remove',{'UserId':_0x4bebd8,'OpenchannelQueueId':_0x45cd97['id']});});});});});});})[_0x3674('0x2e')](respondWithStatusCode(_0xccd89e,null))['catch'](handleError(_0xccd89e,null));};exports[_0x3674('0x8c')]=function(_0x2a7b25,_0x1cf1da,_0x2a544a){return db['OpenchannelQueue']['find']({'where':{'id':_0x2a7b25['params']['id']}})[_0x3674('0x2e')](handleEntityNotFound(_0x1cf1da,null))[_0x3674('0x2e')](function(_0x802278){if(_0x802278){return _0x802278['addAgents'](_0x2a7b25[_0x3674('0x52')][_0x3674('0x6c')],_[_0x3674('0x8d')](_0x2a7b25[_0x3674('0x52')],[_0x3674('0x6c'),'id'])||{})[_0x3674('0x8e')](function(_0x384baa){for(var _0xcc19e9=0x0;_0xcc19e9<_0x2a7b25[_0x3674('0x52')][_0x3674('0x6c')][_0x3674('0x3f')];_0xcc19e9+=0x1){socket[_0x3674('0x77')]('userOpenchannelQueue:save',{'UserId':_0x2a7b25[_0x3674('0x52')]['ids'][_0xcc19e9],'OpenchannelQueueId':_0x2a7b25[_0x3674('0x4d')]['id']});}return _0x384baa;});}})[_0x3674('0x2e')](respondWithResult(_0x1cf1da,null))[_0x3674('0x4c')](handleError(_0x1cf1da,null));};exports[_0x3674('0x8f')]=function(_0x39d060,_0x57a3b0,_0x3293b6){return db[_0x3674('0x49')][_0x3674('0x56')]({'where':{'id':_0x39d060[_0x3674('0x4d')]['id']}})[_0x3674('0x2e')](handleEntityNotFound(_0x57a3b0,null))[_0x3674('0x2e')](function(_0x348557){if(_0x348557){return _0x348557[_0x3674('0x8f')](_0x39d060[_0x3674('0x3a')][_0x3674('0x6c')])[_0x3674('0x2e')](function(){if(_[_0x3674('0x90')](_0x39d060[_0x3674('0x3a')][_0x3674('0x6c')])){for(var _0x153f58=0x0;_0x153f58<_0x39d060['query'][_0x3674('0x6c')][_0x3674('0x3f')];_0x153f58+=0x1){socket[_0x3674('0x77')](_0x3674('0x91'),{'UserId':Number(_0x39d060[_0x3674('0x3a')][_0x3674('0x6c')][_0x153f58]),'OpenchannelQueueId':Number(_0x39d060[_0x3674('0x4d')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x39d060[_0x3674('0x3a')][_0x3674('0x6c')]),'OpenchannelQueueId':Number(_0x39d060[_0x3674('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x57a3b0,null))[_0x3674('0x4c')](handleError(_0x57a3b0,null));};exports['getAgents']=function(_0xb40f5c,_0x3b221f,_0x308a21){var _0x5d04a2={};var _0x42adb4={};var _0x18407e;var _0x5deba9;return db['OpenchannelQueue']['findOne']({'where':{'id':_0xb40f5c['params']['id']}})[_0x3674('0x2e')](handleEntityNotFound(_0x3b221f,null))[_0x3674('0x2e')](function(_0x2ec16d){if(_0x2ec16d){_0x18407e=_0x2ec16d;_0x42adb4['model']=_[_0x3674('0x4f')](db[_0x3674('0x61')]['rawAttributes']);_0x42adb4[_0x3674('0x3a')]=_[_0x3674('0x4f')](_0xb40f5c[_0x3674('0x3a')]);_0x42adb4[_0x3674('0x3b')]=_[_0x3674('0x3c')](_0x42adb4['model'],_0x42adb4['query']);_0x5d04a2[_0x3674('0x3e')]=_['intersection'](_0x42adb4[_0x3674('0x39')],qs['fields'](_0xb40f5c[_0x3674('0x3a')][_0x3674('0x3d')]));_0x5d04a2[_0x3674('0x3e')]=_0x5d04a2['attributes']['length']?_0x5d04a2['attributes']:_0x42adb4[_0x3674('0x39')];_0x5d04a2[_0x3674('0x42')]=qs['sort'](_0xb40f5c[_0x3674('0x3a')][_0x3674('0x43')]);_0x5d04a2[_0x3674('0x44')]=qs[_0x3674('0x3b')](_[_0x3674('0x45')](_0xb40f5c[_0x3674('0x3a')],_0x42adb4[_0x3674('0x3b')]));if(_0xb40f5c[_0x3674('0x3a')][_0x3674('0x46')]){_0x5d04a2[_0x3674('0x44')]=_['merge'](_0x5d04a2['where'],{'$or':_['map'](_0x5d04a2[_0x3674('0x3e')],function(_0x568fe9){var _0x39c762={};_0x39c762[_0x568fe9]={'$like':'%'+_0xb40f5c[_0x3674('0x3a')]['filter']+'%'};return _0x39c762;})});}_0x5d04a2=_[_0x3674('0x47')]({},_0x5d04a2,_0xb40f5c[_0x3674('0x60')]);return _0x18407e[_0x3674('0x92')](_0x5d04a2);}})[_0x3674('0x2e')](function(_0x405611){if(_0x405611){_0x5deba9=_0x405611[_0x3674('0x3f')];if(!_0xb40f5c[_0x3674('0x3a')][_0x3674('0x5f')](_0x3674('0x40'))){_0x5d04a2['limit']=qs[_0x3674('0x41')](_0xb40f5c[_0x3674('0x3a')][_0x3674('0x41')]);_0x5d04a2['offset']=qs[_0x3674('0x26')](_0xb40f5c['query']['offset']);}return _0x18407e[_0x3674('0x92')](_0x5d04a2);}})['then'](function(_0x58ae06){if(_0x58ae06){return _0x58ae06?{'count':_0x5deba9,'rows':_0x58ae06}:null;}})[_0x3674('0x2e')](respondWithResult(_0x3b221f,null))[_0x3674('0x4c')](handleError(_0x3b221f,null));}; \ No newline at end of file +var _0x151b=['include','findAll','rows','catch','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','getMembers','findOne','UserOpenchannelQueue','pick','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','sequelize','transaction','each','removeTeams','tq.TeamId','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','removeAgents','forEach','addAgents','ids','omit','emit','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','count','offset','set','json','apply','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','error','stack','name','send','OpenchannelQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','map','type','VIRTUAL','options','includeAll'];(function(_0x214129,_0x1bcd7d){var _0xf7ae2b=function(_0x53b0c8){while(--_0x53b0c8){_0x214129['push'](_0x214129['shift']());}};_0xf7ae2b(++_0x1bcd7d);}(_0x151b,0x149));var _0xb151=function(_0x3b7e5e,_0x4a3bf8){_0x3b7e5e=_0x3b7e5e-0x0;var _0x3edbb8=_0x151b[_0x3b7e5e];return _0x3edbb8;};'use strict';var emlformat=require(_0xb151('0x0'));var rimraf=require(_0xb151('0x1'));var zipdir=require(_0xb151('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb151('0x3'));var moment=require(_0xb151('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb151('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb151('0x6'));var csv=require(_0xb151('0x7'));var ejs=require(_0xb151('0x8'));var fs=require('fs');var fs_extra=require(_0xb151('0x9'));var _=require(_0xb151('0xa'));var squel=require(_0xb151('0xb'));var crypto=require(_0xb151('0xc'));var jsforce=require(_0xb151('0xd'));var deskjs=require(_0xb151('0xe'));var toCsv=require(_0xb151('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb151('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb151('0x10'));var as=require(_0xb151('0x11'));var hardwareService=require(_0xb151('0x12'));var logger=require('../../config/logger')(_0xb151('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb151('0x14'));var db=require(_0xb151('0x15'))['db'];config['redis']=_['defaults'](config[_0xb151('0x16')],{'host':_0xb151('0x17'),'port':0x18eb});var socket=require(_0xb151('0x18'))(new Redis(config[_0xb151('0x16')]));require(_0xb151('0x19'))[_0xb151('0x1a')](socket);function respondWithStatusCode(_0x2df155,_0x274c4e){_0x274c4e=_0x274c4e||0xcc;return function(_0x2595d9){if(_0x2595d9){return _0x2df155[_0xb151('0x1b')](_0x274c4e);}return _0x2df155[_0xb151('0x1c')](_0x274c4e)['end']();};}function respondWithResult(_0x553e08,_0x1a1313){_0x1a1313=_0x1a1313||0xc8;return function(_0x512f85){if(_0x512f85){return _0x553e08[_0xb151('0x1c')](_0x1a1313)['json'](_0x512f85);}};}function respondWithFilteredResult(_0x2166b7,_0x257edd){return function(_0x165874){if(_0x165874){var _0x22912e=_0x165874[_0xb151('0x1d')],_0x333579=_0x257edd[_0xb151('0x1e')],_0x418be4=_0x257edd[_0xb151('0x1e')]+_0x257edd['limit'],_0x2d5b4b;if(_0x418be4>=_0x22912e){_0x418be4=_0x22912e;_0x2d5b4b=0xc8;}else{_0x2d5b4b=0xce;}_0x2166b7[_0xb151('0x1c')](_0x2d5b4b);return _0x2166b7[_0xb151('0x1f')]('Content-Range',_0x333579+'-'+_0x418be4+'/'+_0x22912e)[_0xb151('0x20')](_0x165874);}return null;};}function patchUpdates(_0x27112a){return function(_0x333f80){try{jsonpatch[_0xb151('0x21')](_0x333f80,_0x27112a,!![]);}catch(_0x3ca434){return BPromise['reject'](_0x3ca434);}return _0x333f80[_0xb151('0x22')]();};}function saveUpdates(_0x1bc9cd,_0x38358f){return function(_0x365903){if(_0x365903){return _0x365903[_0xb151('0x23')](_0x1bc9cd)[_0xb151('0x24')](function(_0x3ce2e6){return _0x3ce2e6;});}return null;};}function removeEntity(_0x55d9ee,_0x53ea56){return function(_0x101bf5){if(_0x101bf5){return _0x101bf5[_0xb151('0x25')]()[_0xb151('0x24')](function(){var _0x195b50=_0x101bf5[_0xb151('0x26')]({'plain':!![]});var _0x1ab34f=_0xb151('0x27');return db[_0xb151('0x28')][_0xb151('0x25')]({'where':{'type':_0x1ab34f,'resourceId':_0x195b50['id']}})[_0xb151('0x24')](function(){return _0x101bf5;});})[_0xb151('0x24')](function(){_0x55d9ee[_0xb151('0x1c')](0xcc)[_0xb151('0x29')]();});}};}function handleEntityNotFound(_0x5f21c7,_0x1ca996){return function(_0x13c032){if(!_0x13c032){_0x5f21c7[_0xb151('0x1b')](0x194);}return _0x13c032;};}function handleError(_0x4feb14,_0x1cad02){_0x1cad02=_0x1cad02||0x1f4;return function(_0x5abe78){logger[_0xb151('0x2a')](_0x5abe78[_0xb151('0x2b')]);if(_0x5abe78[_0xb151('0x2c')]){delete _0x5abe78[_0xb151('0x2c')];}_0x4feb14[_0xb151('0x1c')](_0x1cad02)[_0xb151('0x2d')](_0x5abe78);};}exports['index']=function(_0x24a408,_0x576b3d){var _0x2ba557={},_0x5d3d57={},_0x13b8c7={'count':0x0,'rows':[]};var _0x3c5c52=_['map'](db[_0xb151('0x2e')][_0xb151('0x2f')],function(_0x123aa4){return{'name':_0x123aa4['fieldName'],'type':_0x123aa4['type'][_0xb151('0x30')]};});_0x5d3d57[_0xb151('0x31')]=_['map'](_0x3c5c52,_0xb151('0x2c'));_0x5d3d57[_0xb151('0x32')]=_[_0xb151('0x33')](_0x24a408['query']);_0x5d3d57[_0xb151('0x34')]=_[_0xb151('0x35')](_0x5d3d57[_0xb151('0x31')],_0x5d3d57[_0xb151('0x32')]);_0x2ba557[_0xb151('0x36')]=_['intersection'](_0x5d3d57[_0xb151('0x31')],qs[_0xb151('0x37')](_0x24a408[_0xb151('0x32')][_0xb151('0x37')]));_0x2ba557[_0xb151('0x36')]=_0x2ba557['attributes'][_0xb151('0x38')]?_0x2ba557[_0xb151('0x36')]:_0x5d3d57[_0xb151('0x31')];if(!_0x24a408['query'][_0xb151('0x39')](_0xb151('0x3a'))){_0x2ba557[_0xb151('0x3b')]=qs[_0xb151('0x3b')](_0x24a408[_0xb151('0x32')]['limit']);_0x2ba557[_0xb151('0x1e')]=qs['offset'](_0x24a408[_0xb151('0x32')][_0xb151('0x1e')]);}_0x2ba557[_0xb151('0x3c')]=qs[_0xb151('0x3d')](_0x24a408[_0xb151('0x32')][_0xb151('0x3d')]);_0x2ba557['where']=qs['filters'](_['pick'](_0x24a408[_0xb151('0x32')],_0x5d3d57[_0xb151('0x34')]),_0x3c5c52);if(_0x24a408['query'][_0xb151('0x3e')]){_0x2ba557[_0xb151('0x3f')]=_[_0xb151('0x40')](_0x2ba557['where'],{'$or':_[_0xb151('0x41')](_0x3c5c52,function(_0x24c129){if(_0x24c129[_0xb151('0x42')]!==_0xb151('0x43')){var _0x17b4c4={};_0x17b4c4[_0x24c129[_0xb151('0x2c')]]={'$like':'%'+_0x24a408[_0xb151('0x32')]['filter']+'%'};return _0x17b4c4;}})});}_0x2ba557=_[_0xb151('0x40')]({},_0x2ba557,_0x24a408[_0xb151('0x44')]);var _0x339fac={'where':_0x2ba557[_0xb151('0x3f')]};return db[_0xb151('0x2e')][_0xb151('0x1d')](_0x339fac)['then'](function(_0x1f7b3a){_0x13b8c7['count']=_0x1f7b3a;if(_0x24a408[_0xb151('0x32')][_0xb151('0x45')]){_0x2ba557[_0xb151('0x46')]=[{'all':!![]}];}return db[_0xb151('0x2e')][_0xb151('0x47')](_0x2ba557);})[_0xb151('0x24')](function(_0x2f7d1f){_0x13b8c7[_0xb151('0x48')]=_0x2f7d1f;return _0x13b8c7;})[_0xb151('0x24')](respondWithFilteredResult(_0x576b3d,_0x2ba557))[_0xb151('0x49')](handleError(_0x576b3d,null));};exports['show']=function(_0x33b54c,_0x13e7de){var _0x220202={'raw':!![],'where':{'id':_0x33b54c[_0xb151('0x4a')]['id']}},_0x3a17a1={};_0x3a17a1[_0xb151('0x31')]=_[_0xb151('0x33')](db[_0xb151('0x2e')][_0xb151('0x2f')]);_0x3a17a1['query']=_[_0xb151('0x33')](_0x33b54c[_0xb151('0x32')]);_0x3a17a1[_0xb151('0x34')]=_[_0xb151('0x35')](_0x3a17a1[_0xb151('0x31')],_0x3a17a1['query']);_0x220202[_0xb151('0x36')]=_['intersection'](_0x3a17a1['model'],qs[_0xb151('0x37')](_0x33b54c[_0xb151('0x32')][_0xb151('0x37')]));_0x220202['attributes']=_0x220202[_0xb151('0x36')]['length']?_0x220202['attributes']:_0x3a17a1[_0xb151('0x31')];if(_0x33b54c[_0xb151('0x32')][_0xb151('0x45')]){_0x220202[_0xb151('0x46')]=[{'all':!![]}];}_0x220202=_['merge']({},_0x220202,_0x33b54c['options']);return db[_0xb151('0x2e')]['find'](_0x220202)[_0xb151('0x24')](handleEntityNotFound(_0x13e7de,null))[_0xb151('0x24')](respondWithResult(_0x13e7de,null))[_0xb151('0x49')](handleError(_0x13e7de,null));};exports[_0xb151('0x4b')]=function(_0x3fc66c,_0x5429d2){return db[_0xb151('0x2e')][_0xb151('0x4b')](_0x3fc66c['body'],{})[_0xb151('0x24')](function(_0x519b89){var _0x1e97ac=_0x3fc66c['user'][_0xb151('0x26')]({'plain':!![]});if(!_0x1e97ac)throw new Error(_0xb151('0x4c'));if(_0x1e97ac[_0xb151('0x4d')]===_0xb151('0x4e')){var _0x7b3f83=_0x519b89[_0xb151('0x26')]({'plain':!![]});var _0x17b470=_0xb151('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x17b470,'userProfileId':_0x1e97ac[_0xb151('0x4f')]},'raw':!![]})[_0xb151('0x24')](function(_0x1363eb){if(_0x1363eb&&_0x1363eb['autoAssociation']===0x0){return db[_0xb151('0x28')][_0xb151('0x4b')]({'name':_0x7b3f83[_0xb151('0x2c')],'resourceId':_0x7b3f83['id'],'type':_0x1363eb[_0xb151('0x2c')],'sectionId':_0x1363eb['id']},{})['then'](function(){return _0x519b89;});}else{return _0x519b89;}})['catch'](function(_0x5c98df){logger[_0xb151('0x2a')](_0xb151('0x50'),_0x5c98df);throw _0x5c98df;});}return _0x519b89;})[_0xb151('0x24')](respondWithResult(_0x5429d2,0xc9))['catch'](handleError(_0x5429d2,null));};exports[_0xb151('0x23')]=function(_0x32789b,_0xedf2fb){if(_0x32789b[_0xb151('0x51')]['id']){delete _0x32789b[_0xb151('0x51')]['id'];}return db[_0xb151('0x2e')]['find']({'where':{'id':_0x32789b[_0xb151('0x4a')]['id']}})[_0xb151('0x24')](handleEntityNotFound(_0xedf2fb,null))[_0xb151('0x24')](saveUpdates(_0x32789b[_0xb151('0x51')],null))[_0xb151('0x24')](respondWithResult(_0xedf2fb,null))['catch'](handleError(_0xedf2fb,null));};exports[_0xb151('0x25')]=function(_0x5c4b38,_0x4bfef1){return db[_0xb151('0x2e')][_0xb151('0x52')]({'where':{'id':_0x5c4b38[_0xb151('0x4a')]['id']}})[_0xb151('0x24')](handleEntityNotFound(_0x4bfef1,null))[_0xb151('0x24')](removeEntity(_0x4bfef1,null))[_0xb151('0x49')](handleError(_0x4bfef1,null));};exports[_0xb151('0x53')]=function(_0xf5209d,_0x4e25b8){return db['OpenchannelQueue']['describe']()[_0xb151('0x24')](respondWithResult(_0x4e25b8,null))['catch'](handleError(_0x4e25b8,null));};exports[_0xb151('0x54')]=function(_0x3ad285,_0x22d74d,_0x4863eb){var _0x508091={'raw':!![],'where':{}},_0x34e1d3={},_0x4e81ef;return db[_0xb151('0x2e')][_0xb151('0x55')]({'where':{'id':_0x3ad285[_0xb151('0x4a')]['id']}})[_0xb151('0x24')](handleEntityNotFound(_0x22d74d,null))[_0xb151('0x24')](function(_0x863d50){if(_0x863d50){_0x4e81ef=_0x863d50[_0xb151('0x26')]({'plain':!![]});_0x34e1d3[_0xb151('0x31')]=_[_0xb151('0x33')](db[_0xb151('0x56')][_0xb151('0x2f')]);_0x34e1d3[_0xb151('0x32')]=_[_0xb151('0x33')](_0x3ad285['query']);_0x34e1d3[_0xb151('0x34')]=_['intersection'](_0x34e1d3[_0xb151('0x31')],_0x34e1d3[_0xb151('0x32')]);_0x508091[_0xb151('0x36')]=_[_0xb151('0x35')](_0x34e1d3[_0xb151('0x31')],qs[_0xb151('0x37')](_0x3ad285[_0xb151('0x32')][_0xb151('0x37')]));_0x508091[_0xb151('0x36')]=_0x508091[_0xb151('0x36')]['length']?_0x508091[_0xb151('0x36')]:_0x34e1d3[_0xb151('0x31')];if(!_0x3ad285['query']['hasOwnProperty'](_0xb151('0x3a'))){_0x508091[_0xb151('0x3b')]=qs[_0xb151('0x3b')](_0x3ad285['query'][_0xb151('0x3b')]);_0x508091[_0xb151('0x1e')]=qs[_0xb151('0x1e')](_0x3ad285['query']['offset']);}_0x508091[_0xb151('0x3c')]=qs[_0xb151('0x3d')](_0x3ad285['query'][_0xb151('0x3d')]);_0x508091[_0xb151('0x3f')]=qs[_0xb151('0x34')](_[_0xb151('0x57')](_0x3ad285['query'],_0x34e1d3[_0xb151('0x34')]));_0x508091[_0xb151('0x3f')][_0xb151('0x58')]=_0x863d50['id'];if(_0x3ad285[_0xb151('0x32')][_0xb151('0x3e')]){_0x508091[_0xb151('0x3f')]=_[_0xb151('0x40')](_0x508091[_0xb151('0x3f')],{'$or':_['map'](_0x508091[_0xb151('0x36')],function(_0x36c89b){var _0x446590={};_0x446590[_0x36c89b]={'$like':'%'+_0x3ad285[_0xb151('0x32')][_0xb151('0x3e')]+'%'};return _0x446590;})});}_0x508091=_['merge']({},_0x508091,_0x3ad285[_0xb151('0x44')]);return db['UserOpenchannelQueue'][_0xb151('0x47')](_0x508091);}})[_0xb151('0x24')](function(_0xc583b6){if(_0xc583b6){return db[_0xb151('0x59')][_0xb151('0x5a')]({'where':{'id':_[_0xb151('0x41')](_0xc583b6,'UserId'),'role':_0xb151('0x5b')},'attributes':['id',_0xb151('0x2c'),_0xb151('0x5c'),_0xb151('0x5d'),_0xb151('0x5e')]});}})[_0xb151('0x24')](function(_0x502a11){if(_0x502a11){return{'count':_0x502a11[_0xb151('0x1d')],'rows':_[_0xb151('0x41')](_0x502a11[_0xb151('0x48')],function(_0xe88254){return{'membername':_0xe88254['name'],'UserId':_0xe88254['id'],'queue_name':_0x4e81ef[_0xb151('0x2c')],'OpenchannelQueueId':_0x4e81ef['id'],'interface':util[_0xb151('0x5f')](_0xb151('0x60'),_0xb151('0x61'),_0xe88254['name']),'penalty':0x0,'paused':_0xe88254[_0xb151('0x5c')],'createdAt':_0xe88254[_0xb151('0x5e')],'updatedAt':_0xe88254[_0xb151('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb151('0x24')](respondWithFilteredResult(_0x22d74d,_0x508091))[_0xb151('0x49')](handleError(_0x22d74d,null));};exports[_0xb151('0x62')]=function(_0x17a1b3,_0xedb4f2,_0x3d1fdc){var _0x53b466={};var _0x55b531={};var _0x5c720a;var _0x112b14;return db[_0xb151('0x2e')]['findOne']({'where':{'id':_0x17a1b3['params']['id']}})[_0xb151('0x24')](handleEntityNotFound(_0xedb4f2,null))[_0xb151('0x24')](function(_0x7dc58f){if(_0x7dc58f){_0x5c720a=_0x7dc58f;_0x55b531[_0xb151('0x31')]=_[_0xb151('0x33')](db[_0xb151('0x63')]['rawAttributes']);_0x55b531[_0xb151('0x32')]=_[_0xb151('0x33')](_0x17a1b3[_0xb151('0x32')]);_0x55b531[_0xb151('0x34')]=_[_0xb151('0x35')](_0x55b531[_0xb151('0x31')],_0x55b531['query']);_0x53b466[_0xb151('0x36')]=_['intersection'](_0x55b531['model'],qs[_0xb151('0x37')](_0x17a1b3['query'][_0xb151('0x37')]));_0x53b466['attributes']=_0x53b466[_0xb151('0x36')][_0xb151('0x38')]?_0x53b466['attributes']:_0x55b531[_0xb151('0x31')];_0x53b466[_0xb151('0x3c')]=qs[_0xb151('0x3d')](_0x17a1b3[_0xb151('0x32')][_0xb151('0x3d')]);_0x53b466[_0xb151('0x3f')]=qs[_0xb151('0x34')](_[_0xb151('0x57')](_0x17a1b3['query'],_0x55b531[_0xb151('0x34')]));if(_0x17a1b3[_0xb151('0x32')][_0xb151('0x3e')]){_0x53b466[_0xb151('0x3f')]=_[_0xb151('0x40')](_0x53b466['where'],{'$or':_[_0xb151('0x41')](_0x53b466[_0xb151('0x36')],function(_0x1ee491){var _0x4c978a={};_0x4c978a[_0x1ee491]={'$like':'%'+_0x17a1b3[_0xb151('0x32')][_0xb151('0x3e')]+'%'};return _0x4c978a;})});}_0x53b466=_[_0xb151('0x40')]({},_0x53b466,_0x17a1b3['options']);return _0x5c720a[_0xb151('0x62')](_0x53b466);}})[_0xb151('0x24')](function(_0x17a532){if(_0x17a532){_0x112b14=_0x17a532[_0xb151('0x38')];if(!_0x17a1b3[_0xb151('0x32')][_0xb151('0x39')](_0xb151('0x3a'))){_0x53b466[_0xb151('0x3b')]=qs[_0xb151('0x3b')](_0x17a1b3[_0xb151('0x32')][_0xb151('0x3b')]);_0x53b466['offset']=qs['offset'](_0x17a1b3[_0xb151('0x32')][_0xb151('0x1e')]);}return _0x5c720a[_0xb151('0x62')](_0x53b466);}})['then'](function(_0xea6ef7){if(_0xea6ef7){return _0xea6ef7?{'count':_0x112b14,'rows':_0xea6ef7}:null;}})[_0xb151('0x24')](respondWithResult(_0xedb4f2,null))['catch'](handleError(_0xedb4f2,null));};exports[_0xb151('0x64')]=function(_0x15e488,_0xd5ec8e,_0x17afb6){var _0x3f0645=_0x15e488[_0xb151('0x51')]['ids'];return db[_0xb151('0x63')][_0xb151('0x47')]({'where':{'id':_0x3f0645},'attributes':['id'],'include':[{'model':db[_0xb151('0x59')],'as':_0xb151('0x65'),'attributes':['id',_0xb151('0x2c'),_0xb151('0x66'),_0xb151('0x67'),'interface'],'raw':!![]}]})[_0xb151('0x24')](function(_0x3e2dac){if(_0x3e2dac){var _0x1a27c1=_['flatMap'](_0x3e2dac,function(_0x710329){var _0x593abe=_0x710329[_0xb151('0x26')]({'plain':!![]});return _0x593abe[_0xb151('0x65')];});return db['OpenchannelQueue'][_0xb151('0x52')]({'where':{'id':_0x15e488[_0xb151('0x4a')]['id']}})['then'](function(_0x1d97a3){return db[_0xb151('0x68')][_0xb151('0x69')](function(_0x3e84e3){return _0x1d97a3[_0xb151('0x64')](_0x3f0645,{'transaction':_0x3e84e3})[_0xb151('0x24')](function(){return BPromise[_0xb151('0x6a')](_0x1a27c1,function(_0x23089e){return db[_0xb151('0x56')]['findOrCreate']({'where':{'UserId':_0x23089e['id'],'OpenchannelQueueId':_0x15e488['params']['id']},'transaction':_0x3e84e3});});})[_0xb151('0x24')](function(){_0x1a27c1['forEach'](function(_0x655aa4){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x655aa4['id'],'OpenchannelQueueId':_0x1d97a3['id']});});});});});}})['then'](respondWithStatusCode(_0xd5ec8e,null))['catch'](handleError(_0xd5ec8e,null));};exports[_0xb151('0x6b')]=function(_0x45fb23,_0x4afe18,_0xed1b02){return db[_0xb151('0x63')]['findAll']({'where':{'id':_0x45fb23[_0xb151('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb151('0x59')],'as':_0xb151('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4afe18,null))[_0xb151('0x24')](function(_0x2e6336){var _0x17abc0=_[_0xb151('0x41')](_0x2e6336,'id');var _0x3ee400=[];var _0x4fd712=[];var _0x2f6bc5=squel['select']();_0x2f6bc5['field'](_0xb151('0x6c'))[_0xb151('0x6d')]('team_has_openchannel_queues','tq')[_0xb151('0x6e')](_0xb151('0x6f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb151('0x3f')]('OpenchannelQueueId\x20=\x20?',_0x45fb23[_0xb151('0x4a')]['id']);for(var _0x294c0e=0x0;_0x294c0e<_0x2e6336[_0xb151('0x38')];_0x294c0e+=0x1){let _0xa7d23d=_0x2e6336[_0x294c0e];for(var _0x2fb390=0x0;_0x2fb390<_0xa7d23d[_0xb151('0x65')][_0xb151('0x38')];_0x2fb390+=0x1){let _0x2f0294=_0xa7d23d[_0xb151('0x65')][_0x2fb390];var _0x27d742=_0x2f6bc5[_0xb151('0x70')]();_0x27d742[_0xb151('0x3f')](_0xb151('0x71'),_0x2f0294['id']);_0x4fd712[_0xb151('0x72')](db[_0xb151('0x68')]['query'](_0x27d742[_0xb151('0x73')](),{'type':db[_0xb151('0x68')][_0xb151('0x74')][_0xb151('0x75')]})[_0xb151('0x24')](function(_0x59ae04){if(_0x59ae04['length']===0x1){return _0x2f0294['id'];}else{var _0x4d47bd=_[_0xb151('0x76')](_['map'](_0x59ae04,'TeamId'),function(_0x48e116){return _[_0xb151('0x77')](_0x17abc0,_0x48e116);});if(_0x4d47bd){return _0x2f0294['id'];}}}));}}return BPromise['all'](_0x4fd712)[_0xb151('0x24')](function(_0xf38617){_0x3ee400=_(_0x3ee400)[_0xb151('0x78')](_0xf38617)[_0xb151('0x79')]()[_0xb151('0x7a')]();return db[_0xb151('0x2e')][_0xb151('0x52')]({'where':{'id':_0x45fb23[_0xb151('0x4a')]['id']}})[_0xb151('0x24')](function(_0x396679){return db[_0xb151('0x68')][_0xb151('0x69')](function(_0x481118){return _0x396679['removeTeams'](_0x45fb23[_0xb151('0x32')]['ids'],{'transaction':_0x481118})['then'](function(){if(!_[_0xb151('0x7b')](_0x3ee400)){return _0x396679[_0xb151('0x7c')](_0x3ee400,{'transaction':_0x481118});}})['then'](function(){_0x3ee400[_0xb151('0x7d')](function(_0x2b5774){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x2b5774,'OpenchannelQueueId':_0x396679['id']});});});});});});})[_0xb151('0x24')](respondWithStatusCode(_0x4afe18,null))[_0xb151('0x49')](handleError(_0x4afe18,null));};exports[_0xb151('0x7e')]=function(_0x1f5207,_0x556cab,_0x19279f){return db[_0xb151('0x2e')][_0xb151('0x52')]({'where':{'id':_0x1f5207['params']['id']}})[_0xb151('0x24')](handleEntityNotFound(_0x556cab,null))[_0xb151('0x24')](function(_0x1a6a7b){if(_0x1a6a7b){return _0x1a6a7b[_0xb151('0x7e')](_0x1f5207['body'][_0xb151('0x7f')],_[_0xb151('0x80')](_0x1f5207['body'],[_0xb151('0x7f'),'id'])||{})['spread'](function(_0x4c0904){for(var _0x516353=0x0;_0x516353<_0x1f5207[_0xb151('0x51')]['ids'][_0xb151('0x38')];_0x516353+=0x1){socket[_0xb151('0x81')]('userOpenchannelQueue:save',{'UserId':_0x1f5207[_0xb151('0x51')][_0xb151('0x7f')][_0x516353],'OpenchannelQueueId':_0x1f5207[_0xb151('0x4a')]['id']});}return _0x4c0904;});}})[_0xb151('0x24')](respondWithResult(_0x556cab,null))['catch'](handleError(_0x556cab,null));};exports[_0xb151('0x7c')]=function(_0x582142,_0x16119d,_0x513ff4){return db[_0xb151('0x2e')][_0xb151('0x52')]({'where':{'id':_0x582142['params']['id']}})[_0xb151('0x24')](handleEntityNotFound(_0x16119d,null))[_0xb151('0x24')](function(_0x2818f6){if(_0x2818f6){return _0x2818f6[_0xb151('0x7c')](_0x582142[_0xb151('0x32')][_0xb151('0x7f')])[_0xb151('0x24')](function(){if(_[_0xb151('0x82')](_0x582142['query']['ids'])){for(var _0x33a03e=0x0;_0x33a03e<_0x582142[_0xb151('0x32')][_0xb151('0x7f')][_0xb151('0x38')];_0x33a03e+=0x1){socket[_0xb151('0x81')]('userOpenchannelQueue:remove',{'UserId':Number(_0x582142[_0xb151('0x32')][_0xb151('0x7f')][_0x33a03e]),'OpenchannelQueueId':Number(_0x582142['params']['id'])});}}else{socket[_0xb151('0x81')](_0xb151('0x83'),{'UserId':Number(_0x582142[_0xb151('0x32')][_0xb151('0x7f')]),'OpenchannelQueueId':Number(_0x582142['params']['id'])});}});}})[_0xb151('0x24')](respondWithStatusCode(_0x16119d,null))[_0xb151('0x49')](handleError(_0x16119d,null));};exports['getAgents']=function(_0x4d95d0,_0x3aa784,_0x38b130){var _0x4929a4={};var _0x3f20b0={};var _0x93236f;var _0x228e8e;return db[_0xb151('0x2e')][_0xb151('0x55')]({'where':{'id':_0x4d95d0[_0xb151('0x4a')]['id']}})[_0xb151('0x24')](handleEntityNotFound(_0x3aa784,null))[_0xb151('0x24')](function(_0xb8aaaa){if(_0xb8aaaa){_0x93236f=_0xb8aaaa;_0x3f20b0[_0xb151('0x31')]=_['keys'](db[_0xb151('0x59')][_0xb151('0x2f')]);_0x3f20b0[_0xb151('0x32')]=_[_0xb151('0x33')](_0x4d95d0[_0xb151('0x32')]);_0x3f20b0['filters']=_[_0xb151('0x35')](_0x3f20b0[_0xb151('0x31')],_0x3f20b0[_0xb151('0x32')]);_0x4929a4['attributes']=_['intersection'](_0x3f20b0[_0xb151('0x31')],qs[_0xb151('0x37')](_0x4d95d0[_0xb151('0x32')][_0xb151('0x37')]));_0x4929a4[_0xb151('0x36')]=_0x4929a4[_0xb151('0x36')][_0xb151('0x38')]?_0x4929a4[_0xb151('0x36')]:_0x3f20b0[_0xb151('0x31')];_0x4929a4['order']=qs[_0xb151('0x3d')](_0x4d95d0['query'][_0xb151('0x3d')]);_0x4929a4[_0xb151('0x3f')]=qs['filters'](_['pick'](_0x4d95d0[_0xb151('0x32')],_0x3f20b0[_0xb151('0x34')]));if(_0x4d95d0[_0xb151('0x32')][_0xb151('0x3e')]){_0x4929a4[_0xb151('0x3f')]=_[_0xb151('0x40')](_0x4929a4[_0xb151('0x3f')],{'$or':_[_0xb151('0x41')](_0x4929a4[_0xb151('0x36')],function(_0x3c1910){var _0x57550d={};_0x57550d[_0x3c1910]={'$like':'%'+_0x4d95d0[_0xb151('0x32')][_0xb151('0x3e')]+'%'};return _0x57550d;})});}_0x4929a4=_['merge']({},_0x4929a4,_0x4d95d0['options']);return _0x93236f[_0xb151('0x84')](_0x4929a4);}})[_0xb151('0x24')](function(_0x9562de){if(_0x9562de){_0x228e8e=_0x9562de[_0xb151('0x38')];if(!_0x4d95d0['query'][_0xb151('0x39')](_0xb151('0x3a'))){_0x4929a4[_0xb151('0x3b')]=qs[_0xb151('0x3b')](_0x4d95d0['query'][_0xb151('0x3b')]);_0x4929a4[_0xb151('0x1e')]=qs[_0xb151('0x1e')](_0x4d95d0[_0xb151('0x32')][_0xb151('0x1e')]);}return _0x93236f['getAgents'](_0x4929a4);}})[_0xb151('0x24')](function(_0x1c47b2){if(_0x1c47b2){return _0x1c47b2?{'count':_0x228e8e,'rows':_0x1c47b2}:null;}})[_0xb151('0x24')](respondWithResult(_0x3aa784,null))[_0xb151('0x49')](handleError(_0x3aa784,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 8d97a53..1170f78 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 _0x44ee=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x37fd3f,_0x44d01e){var _0x4c9572=function(_0x5f0685){while(--_0x5f0685){_0x37fd3f['push'](_0x37fd3f['shift']());}};_0x4c9572(++_0x44d01e);}(_0x44ee,0x124));var _0xe44e=function(_0x909fdb,_0x236562){_0x909fdb=_0x909fdb-0x0;var _0xa0a287=_0x44ee[_0x909fdb];return _0xa0a287;};'use strict';var EventEmitter=require(_0xe44e('0x0'));var OpenchannelQueue=require(_0xe44e('0x1'))['db'][_0xe44e('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xe44e('0x3')](0x0);var events={'afterCreate':_0xe44e('0x4'),'afterUpdate':_0xe44e('0x5'),'afterDestroy':_0xe44e('0x6')};function emitEvent(_0x487b80){return function(_0x13aaca,_0x2b6b26,_0x56167f){OpenchannelQueueEvents[_0xe44e('0x7')](_0x487b80+':'+_0x13aaca['id'],_0x13aaca);OpenchannelQueueEvents[_0xe44e('0x7')](_0x487b80,_0x13aaca);_0x56167f(null);};}for(var e in events){if(events[_0xe44e('0x8')](e)){var event=events[e];OpenchannelQueue[_0xe44e('0x9')](e,emitEvent(event));}}module[_0xe44e('0xa')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x2a58=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x3dff8c,_0x5bf28a){var _0x1199cf=function(_0x5ab948){while(--_0x5ab948){_0x3dff8c['push'](_0x3dff8c['shift']());}};_0x1199cf(++_0x5bf28a);}(_0x2a58,0x1ef));var _0x82a5=function(_0x16ea66,_0x561be6){_0x16ea66=_0x16ea66-0x0;var _0xafd984=_0x2a58[_0x16ea66];return _0xafd984;};'use strict';var EventEmitter=require(_0x82a5('0x0'));var OpenchannelQueue=require(_0x82a5('0x1'))['db'][_0x82a5('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x82a5('0x3')](0x0);var events={'afterCreate':_0x82a5('0x4'),'afterUpdate':_0x82a5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x214d8a){return function(_0x768c5e,_0x50a45d,_0x958198){OpenchannelQueueEvents[_0x82a5('0x6')](_0x214d8a+':'+_0x768c5e['id'],_0x768c5e);OpenchannelQueueEvents[_0x82a5('0x6')](_0x214d8a,_0x768c5e);_0x958198(null);};}for(var e in events){if(events[_0x82a5('0x7')](e)){var event=events[e];OpenchannelQueue[_0x82a5('0x8')](e,emitEvent(event));}}module[_0x82a5('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index f5914f6..43b6a20 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 _0xfa1e=['../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x4b2773,_0x5a12be){var _0x1c4fc2=function(_0x5e9332){while(--_0x5e9332){_0x4b2773['push'](_0x4b2773['shift']());}};_0x1c4fc2(++_0x5a12be);}(_0xfa1e,0x102));var _0xefa1=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0xfa1e[_0x5093e9];return _0x4c9a22;};'use strict';var _=require(_0xefa1('0x0'));var util=require(_0xefa1('0x1'));var logger=require(_0xefa1('0x2'))(_0xefa1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xefa1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefa1('0x5'));var config=require(_0xefa1('0x6'));var attributes=require(_0xefa1('0x7'));module[_0xefa1('0x8')]=function(_0x22315d,_0x599473){return _0x22315d['define'](_0xefa1('0x9'),attributes,{'tableName':_0xefa1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2dd=['../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa2dd,0xea));var _0xda2d=function(_0x18f822,_0x5373e3){_0x18f822=_0x18f822-0x0;var _0x13264b=_0xa2dd[_0x18f822];return _0x13264b;};'use strict';var _=require(_0xda2d('0x0'));var util=require('util');var logger=require(_0xda2d('0x1'))(_0xda2d('0x2'));var moment=require(_0xda2d('0x3'));var BPromise=require(_0xda2d('0x4'));var rp=require(_0xda2d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xda2d('0x6'));var attributes=require(_0xda2d('0x7'));module['exports']=function(_0xaebb41,_0x3632c5){return _0xaebb41[_0xda2d('0x8')]('OpenchannelQueue',attributes,{'tableName':_0xda2d('0x9'),'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 4d01167..eba1a83 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 _0xdbbd=['GetOpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','OpenchannelQueue','find','where','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x5c5e63,_0x581a8c){var _0xc5ae77=function(_0x42d401){while(--_0x42d401){_0x5c5e63['push'](_0x5c5e63['shift']());}};_0xc5ae77(++_0x581a8c);}(_0xdbbd,0x17e));var _0xddbb=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xdbbd[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xddbb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xddbb('0x1'));var fs=require('fs');var Redis=require(_0xddbb('0x2'));var db=require(_0xddbb('0x3'))['db'];var utils=require(_0xddbb('0x4'));var logger=require(_0xddbb('0x5'))(_0xddbb('0x6'));var config=require('../../config/environment');var jayson=require(_0xddbb('0x7'));var client=jayson[_0xddbb('0x8')][_0xddbb('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xddbb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xddbb('0xb'))(new Redis(config[_0xddbb('0xa')]));require(_0xddbb('0xc'))[_0xddbb('0xd')](socket);function respondWithRpcPromise(_0x417fb2,_0x40ecb3,_0x153ef5){return new BPromise(function(_0x491196,_0x3a8353){return client[_0xddbb('0xe')](_0x417fb2,_0x153ef5)[_0xddbb('0xf')](function(_0x5be8a4){logger[_0xddbb('0x10')](_0xddbb('0x11'),_0x40ecb3,_0xddbb('0x12'));logger[_0xddbb('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x40ecb3,_0xddbb('0x12'),JSON[_0xddbb('0x14')](_0x5be8a4));if(_0x5be8a4[_0xddbb('0x15')]){if(_0x5be8a4[_0xddbb('0x15')][_0xddbb('0x16')]===0x1f4){logger[_0xddbb('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x40ecb3,_0x5be8a4[_0xddbb('0x15')]['message']);return _0x3a8353(_0x5be8a4[_0xddbb('0x15')][_0xddbb('0x17')]);}logger[_0xddbb('0x15')](_0xddbb('0x11'),_0x40ecb3,_0x5be8a4[_0xddbb('0x15')][_0xddbb('0x17')]);return _0x491196(_0x5be8a4[_0xddbb('0x15')][_0xddbb('0x17')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x40ecb3,'request\x20sent');_0x491196(_0x5be8a4['result'][_0xddbb('0x17')]);}})[_0xddbb('0x18')](function(_0x3c2fec){logger[_0xddbb('0x15')](_0xddbb('0x11'),_0x40ecb3,_0x3c2fec);_0x3a8353(_0x3c2fec);});});}exports[_0xddbb('0x19')]=function(_0x572a5f){var _0x29e4d7=this;return new Promise(function(_0x3868d1,_0x390ad6){return db['OpenchannelQueue'][_0xddbb('0x1a')]({'raw':_0x572a5f[_0xddbb('0x1b')]?_0x572a5f[_0xddbb('0x1b')][_0xddbb('0x1c')]===undefined?!![]:![]:!![],'where':_0x572a5f[_0xddbb('0x1b')]?_0x572a5f['options']['where']||null:null,'attributes':_0x572a5f[_0xddbb('0x1b')]?_0x572a5f[_0xddbb('0x1b')][_0xddbb('0x1d')]||null:null,'limit':_0x572a5f[_0xddbb('0x1b')]?_0x572a5f[_0xddbb('0x1b')][_0xddbb('0x1e')]||null:null,'include':_0x572a5f[_0xddbb('0x1b')]?_0x572a5f['options'][_0xddbb('0x1f')]?_[_0xddbb('0x20')](_0x572a5f[_0xddbb('0x1b')][_0xddbb('0x1f')],function(_0x2c952c){return{'model':db[_0x2c952c['model']],'as':_0x2c952c['as'],'attributes':_0x2c952c[_0xddbb('0x1d')],'include':_0x2c952c[_0xddbb('0x1f')]?_[_0xddbb('0x20')](_0x2c952c[_0xddbb('0x1f')],function(_0x882ee7){return{'model':db[_0x882ee7[_0xddbb('0x21')]],'as':_0x882ee7['as'],'attributes':_0x882ee7['attributes'],'include':_0x882ee7[_0xddbb('0x1f')]?_[_0xddbb('0x20')](_0x882ee7['include'],function(_0x45cc05){return{'model':db[_0x45cc05[_0xddbb('0x21')]],'as':_0x45cc05['as'],'attributes':_0x45cc05['attributes']};}):[]};}):[]};}):[]:[]})[_0xddbb('0xf')](function(_0x1bc436){logger[_0xddbb('0x10')]('GetOpenchannelQueue',_0x572a5f);logger[_0xddbb('0x13')](_0xddbb('0x19'),_0x572a5f,JSON['stringify'](_0x1bc436));_0x3868d1(_0x1bc436);})[_0xddbb('0x18')](function(_0x172c09){logger[_0xddbb('0x15')](_0xddbb('0x19'),_0x172c09[_0xddbb('0x17')],_0x572a5f);_0x390ad6(_0x29e4d7[_0xddbb('0x15')](0x1f4,_0x172c09[_0xddbb('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x275cf7){var _0x5d1f4f=this;return new Promise(function(_0x281ace,_0x4123bf){return db[_0xddbb('0x22')][_0xddbb('0x23')]({'raw':_0x275cf7[_0xddbb('0x1b')]?_0x275cf7['options'][_0xddbb('0x1c')]===undefined?!![]:![]:!![],'where':_0x275cf7[_0xddbb('0x1b')]?_0x275cf7[_0xddbb('0x1b')][_0xddbb('0x24')]||null:null,'attributes':_0x275cf7[_0xddbb('0x1b')]?_0x275cf7[_0xddbb('0x1b')]['attributes']||null:null,'include':_0x275cf7[_0xddbb('0x1b')]?_0x275cf7[_0xddbb('0x1b')][_0xddbb('0x1f')]?_[_0xddbb('0x20')](_0x275cf7['options'][_0xddbb('0x1f')],function(_0x1dbb5b){return{'model':db[_0x1dbb5b[_0xddbb('0x21')]],'as':_0x1dbb5b['as'],'attributes':_0x1dbb5b[_0xddbb('0x1d')],'include':_0x1dbb5b[_0xddbb('0x1f')]?_[_0xddbb('0x20')](_0x1dbb5b[_0xddbb('0x1f')],function(_0x5ef10b){return{'model':db[_0x5ef10b[_0xddbb('0x21')]],'as':_0x5ef10b['as'],'attributes':_0x5ef10b[_0xddbb('0x1d')],'include':_0x5ef10b[_0xddbb('0x1f')]?_[_0xddbb('0x20')](_0x5ef10b['include'],function(_0x4a1ec7){return{'model':db[_0x4a1ec7[_0xddbb('0x21')]],'as':_0x4a1ec7['as'],'attributes':_0x4a1ec7[_0xddbb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xddbb('0xf')](function(_0x5a5408){logger[_0xddbb('0x10')]('ShowOpenchannelQueue',_0x275cf7);logger['debug']('ShowOpenchannelQueue',_0x275cf7,JSON[_0xddbb('0x14')](_0x5a5408));_0x281ace(_0x5a5408);})['catch'](function(_0x20ce39){logger[_0xddbb('0x15')]('ShowOpenchannelQueue',_0x20ce39[_0xddbb('0x17')],_0x275cf7);_0x4123bf(_0x5d1f4f[_0xddbb('0x15')](0x1f4,_0x20ce39[_0xddbb('0x17')]));});});}; \ No newline at end of file +var _0xb424=['request\x20sent','debug','stringify','error','code','message','GetOpenchannelQueue','OpenchannelQueue','options','raw','attributes','limit','model','include','map','catch','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','info','OpenchannelQueue,\x20%s,\x20%s'];(function(_0xffd697,_0x3b7975){var _0x267da2=function(_0x52d355){while(--_0x52d355){_0xffd697['push'](_0xffd697['shift']());}};_0x267da2(++_0x3b7975);}(_0xb424,0x115));var _0x4b42=function(_0x5a26db,_0x2c5ccd){_0x5a26db=_0x5a26db-0x0;var _0x4619dd=_0xb424[_0x5a26db];return _0x4619dd;};'use strict';var _=require(_0x4b42('0x0'));var util=require(_0x4b42('0x1'));var moment=require(_0x4b42('0x2'));var BPromise=require(_0x4b42('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b42('0x4'))['db'];var utils=require(_0x4b42('0x5'));var logger=require(_0x4b42('0x6'))(_0x4b42('0x7'));var config=require(_0x4b42('0x8'));var jayson=require(_0x4b42('0x9'));var client=jayson[_0x4b42('0xa')][_0x4b42('0xb')]({'port':0x232a});config['redis']=_[_0x4b42('0xc')](config['redis'],{'host':_0x4b42('0xd'),'port':0x18eb});var socket=require(_0x4b42('0xe'))(new Redis(config['redis']));require(_0x4b42('0xf'))[_0x4b42('0x10')](socket);function respondWithRpcPromise(_0x38b517,_0x29c1d6,_0x379f3c){return new BPromise(function(_0x3dd4ac,_0x4d9e10){return client['request'](_0x38b517,_0x379f3c)['then'](function(_0x353db8){logger[_0x4b42('0x11')](_0x4b42('0x12'),_0x29c1d6,_0x4b42('0x13'));logger[_0x4b42('0x14')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x29c1d6,_0x4b42('0x13'),JSON[_0x4b42('0x15')](_0x353db8));if(_0x353db8[_0x4b42('0x16')]){if(_0x353db8[_0x4b42('0x16')][_0x4b42('0x17')]===0x1f4){logger[_0x4b42('0x16')](_0x4b42('0x12'),_0x29c1d6,_0x353db8[_0x4b42('0x16')][_0x4b42('0x18')]);return _0x4d9e10(_0x353db8[_0x4b42('0x16')]['message']);}logger[_0x4b42('0x16')](_0x4b42('0x12'),_0x29c1d6,_0x353db8[_0x4b42('0x16')][_0x4b42('0x18')]);return _0x3dd4ac(_0x353db8[_0x4b42('0x16')][_0x4b42('0x18')]);}else{logger[_0x4b42('0x11')](_0x4b42('0x12'),_0x29c1d6,_0x4b42('0x13'));_0x3dd4ac(_0x353db8['result'][_0x4b42('0x18')]);}})['catch'](function(_0x229fcd){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x29c1d6,_0x229fcd);_0x4d9e10(_0x229fcd);});});}exports[_0x4b42('0x19')]=function(_0x5f3748){var _0x2fba5b=this;return new Promise(function(_0x26114a,_0x4bd981){return db[_0x4b42('0x1a')]['findAll']({'raw':_0x5f3748[_0x4b42('0x1b')]?_0x5f3748['options'][_0x4b42('0x1c')]===undefined?!![]:![]:!![],'where':_0x5f3748[_0x4b42('0x1b')]?_0x5f3748['options']['where']||null:null,'attributes':_0x5f3748['options']?_0x5f3748[_0x4b42('0x1b')][_0x4b42('0x1d')]||null:null,'limit':_0x5f3748['options']?_0x5f3748[_0x4b42('0x1b')][_0x4b42('0x1e')]||null:null,'include':_0x5f3748['options']?_0x5f3748['options']['include']?_['map'](_0x5f3748[_0x4b42('0x1b')]['include'],function(_0x115ee3){return{'model':db[_0x115ee3[_0x4b42('0x1f')]],'as':_0x115ee3['as'],'attributes':_0x115ee3['attributes'],'include':_0x115ee3[_0x4b42('0x20')]?_[_0x4b42('0x21')](_0x115ee3[_0x4b42('0x20')],function(_0x5a83e6){return{'model':db[_0x5a83e6['model']],'as':_0x5a83e6['as'],'attributes':_0x5a83e6['attributes'],'include':_0x5a83e6[_0x4b42('0x20')]?_[_0x4b42('0x21')](_0x5a83e6['include'],function(_0x592f30){return{'model':db[_0x592f30[_0x4b42('0x1f')]],'as':_0x592f30['as'],'attributes':_0x592f30[_0x4b42('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x813dd8){logger[_0x4b42('0x11')](_0x4b42('0x19'),_0x5f3748);logger[_0x4b42('0x14')]('GetOpenchannelQueue',_0x5f3748,JSON[_0x4b42('0x15')](_0x813dd8));_0x26114a(_0x813dd8);})[_0x4b42('0x22')](function(_0x197691){logger[_0x4b42('0x16')](_0x4b42('0x19'),_0x197691[_0x4b42('0x18')],_0x5f3748);_0x4bd981(_0x2fba5b[_0x4b42('0x16')](0x1f4,_0x197691[_0x4b42('0x18')]));});});};exports[_0x4b42('0x23')]=function(_0x298eae){var _0x9b5893=this;return new Promise(function(_0x384755,_0x3099a3){return db[_0x4b42('0x1a')][_0x4b42('0x24')]({'raw':_0x298eae[_0x4b42('0x1b')]?_0x298eae[_0x4b42('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x298eae[_0x4b42('0x1b')]?_0x298eae['options']['where']||null:null,'attributes':_0x298eae[_0x4b42('0x1b')]?_0x298eae[_0x4b42('0x1b')][_0x4b42('0x1d')]||null:null,'include':_0x298eae[_0x4b42('0x1b')]?_0x298eae[_0x4b42('0x1b')][_0x4b42('0x20')]?_[_0x4b42('0x21')](_0x298eae[_0x4b42('0x1b')][_0x4b42('0x20')],function(_0x2a872e){return{'model':db[_0x2a872e[_0x4b42('0x1f')]],'as':_0x2a872e['as'],'attributes':_0x2a872e['attributes'],'include':_0x2a872e[_0x4b42('0x20')]?_[_0x4b42('0x21')](_0x2a872e[_0x4b42('0x20')],function(_0x6ab81e){return{'model':db[_0x6ab81e[_0x4b42('0x1f')]],'as':_0x6ab81e['as'],'attributes':_0x6ab81e[_0x4b42('0x1d')],'include':_0x6ab81e[_0x4b42('0x20')]?_[_0x4b42('0x21')](_0x6ab81e[_0x4b42('0x20')],function(_0x5c7a7b){return{'model':db[_0x5c7a7b[_0x4b42('0x1f')]],'as':_0x5c7a7b['as'],'attributes':_0x5c7a7b[_0x4b42('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56911c){logger[_0x4b42('0x11')](_0x4b42('0x23'),_0x298eae);logger[_0x4b42('0x14')]('ShowOpenchannelQueue',_0x298eae,JSON['stringify'](_0x56911c));_0x384755(_0x56911c);})[_0x4b42('0x22')](function(_0x2908dc){logger['error']('ShowOpenchannelQueue',_0x2908dc[_0x4b42('0x18')],_0x298eae);_0x3099a3(_0x9b5893[_0x4b42('0x16')](0x1f4,_0x2908dc['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 1938226..d4b278a 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 _0x45d0=['removeListener','length','./openchannelQueue.events','save','remove','update','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x45d0,0x18a));var _0x045d=function(_0x54fa45,_0x508e12){_0x54fa45=_0x54fa45-0x0;var _0x5de95a=_0x45d0[_0x54fa45];return _0x5de95a;};'use strict';var OpenchannelQueueEvents=require(_0x045d('0x0'));var events=[_0x045d('0x1'),_0x045d('0x2'),_0x045d('0x3')];function createListener(_0x50b266,_0x2af1f6){return function(_0x26de8d){_0x2af1f6[_0x045d('0x4')](_0x50b266,_0x26de8d);};}function removeListener(_0x29985b,_0x4f9367){return function(){OpenchannelQueueEvents[_0x045d('0x5')](_0x29985b,_0x4f9367);};}exports['register']=function(_0x36104d){for(var _0x40f7f4=0x0,_0x42b270=events[_0x045d('0x6')];_0x40f7f4<_0x42b270;_0x40f7f4++){var _0x41c41f=events[_0x40f7f4];var _0x3deab0=createListener('openchannelQueue:'+_0x41c41f,_0x36104d);OpenchannelQueueEvents['on'](_0x41c41f,_0x3deab0);}}; \ No newline at end of file +var _0x1cb9=['./openchannelQueue.events','remove','update','emit','removeListener','register','length','openchannelQueue:'];(function(_0x3e573a,_0x5c899f){var _0x114143=function(_0x415a42){while(--_0x415a42){_0x3e573a['push'](_0x3e573a['shift']());}};_0x114143(++_0x5c899f);}(_0x1cb9,0x118));var _0x91cb=function(_0x18517b,_0x221240){_0x18517b=_0x18517b-0x0;var _0xc17aff=_0x1cb9[_0x18517b];return _0xc17aff;};'use strict';var OpenchannelQueueEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x510766,_0x30bfe4){return function(_0x586eaf){_0x30bfe4[_0x91cb('0x3')](_0x510766,_0x586eaf);};}function removeListener(_0x1db323,_0x5e73ce){return function(){OpenchannelQueueEvents[_0x91cb('0x4')](_0x1db323,_0x5e73ce);};}exports[_0x91cb('0x5')]=function(_0x57d7ec){for(var _0x382a00=0x0,_0x2b3b78=events[_0x91cb('0x6')];_0x382a00<_0x2b3b78;_0x382a00++){var _0x1a2286=events[_0x382a00];var _0x5ab3b7=createListener(_0x91cb('0x7')+_0x1a2286,_0x57d7ec);OpenchannelQueueEvents['on'](_0x1a2286,_0x5ab3b7);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 10021dc..7e89fca 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 _0xa340=['create','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post'];(function(_0xb344db,_0x366644){var _0xbc04d9=function(_0xdf4e30){while(--_0xdf4e30){_0xb344db['push'](_0xb344db['shift']());}};_0xbc04d9(++_0x366644);}(_0xa340,0x1a2));var _0x0a34=function(_0x1b42d3,_0x373a21){_0x1b42d3=_0x1b42d3-0x0;var _0x409b46=_0xa340[_0x1b42d3];return _0x409b46;};'use strict';var multer=require(_0x0a34('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0a34('0x1'));var express=require(_0x0a34('0x2'));var router=express[_0x0a34('0x3')]();var fs_extra=require(_0x0a34('0x4'));var auth=require(_0x0a34('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a34('0x6'));router[_0x0a34('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a34('0x8')]);router[_0x0a34('0x7')](_0x0a34('0x9'),auth[_0x0a34('0xa')](),controller['describe']);router[_0x0a34('0x7')](_0x0a34('0xb'),auth[_0x0a34('0xa')](),controller[_0x0a34('0xc')]);router[_0x0a34('0xd')]('/',auth['isAuthenticated'](),controller[_0x0a34('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a34('0xf')]);router[_0x0a34('0x10')]('/:id',auth[_0x0a34('0xa')](),controller['destroy']);module[_0x0a34('0x11')]=router; \ No newline at end of file +var _0x9cae=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id','update','delete'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0x9cae,0xc7));var _0xe9ca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9cae[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe9ca('0x0'));var util=require(_0xe9ca('0x1'));var path=require(_0xe9ca('0x2'));var timeout=require(_0xe9ca('0x3'));var express=require(_0xe9ca('0x4'));var router=express[_0xe9ca('0x5')]();var fs_extra=require(_0xe9ca('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe9ca('0x7'));var config=require(_0xe9ca('0x8'));var controller=require(_0xe9ca('0x9'));router[_0xe9ca('0xa')]('/',auth[_0xe9ca('0xb')](),controller[_0xe9ca('0xc')]);router[_0xe9ca('0xa')]('/describe',auth[_0xe9ca('0xb')](),controller[_0xe9ca('0xd')]);router[_0xe9ca('0xa')]('/:id',auth[_0xe9ca('0xb')](),controller[_0xe9ca('0xe')]);router[_0xe9ca('0xf')]('/',auth['isAuthenticated'](),controller[_0xe9ca('0x10')]);router[_0xe9ca('0x11')](_0xe9ca('0x12'),auth[_0xe9ca('0xb')](),controller[_0xe9ca('0x13')]);router[_0xe9ca('0x14')](_0xe9ca('0x12'),auth[_0xe9ca('0xb')](),controller['destroy']);module[_0xe9ca('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 15bee46..0cd3d99 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 _0x87fc=['DATE','moment','sequelize','exports','STRING'];(function(_0x5e9478,_0x19c318){var _0x1ab8cd=function(_0x1ea189){while(--_0x1ea189){_0x5e9478['push'](_0x5e9478['shift']());}};_0x1ab8cd(++_0x19c318);}(_0x87fc,0x1eb));var _0xc87f=function(_0x2447ab,_0x4f5108){_0x2447ab=_0x2447ab-0x0;var _0x28395d=_0x87fc[_0x2447ab];return _0x28395d;};'use strict';var moment=require(_0xc87f('0x0'));var Sequelize=require(_0xc87f('0x1'));module[_0xc87f('0x2')]={'uniqueid':{'type':Sequelize[_0xc87f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc87f('0x3')]},'joinAt':{'type':Sequelize[_0xc87f('0x4')]},'leaveAt':{'type':Sequelize[_0xc87f('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc87f('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4056=['DATE','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4056,0x151));var _0x6405=function(_0x3ce03c,_0x3bffb7){_0x3ce03c=_0x3ce03c-0x0;var _0x5e1cce=_0x4056[_0x3ce03c];return _0x5e1cce;};'use strict';var moment=require('moment');var Sequelize=require(_0x6405('0x0'));module[_0x6405('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6405('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6405('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index fb33711..86203bc 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 _0x69d3=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','OpenchannelQueueReport','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x423f89,_0x2a6a8b){var _0x1355a3=function(_0x11fd0b){while(--_0x11fd0b){_0x423f89['push'](_0x423f89['shift']());}};_0x1355a3(++_0x2a6a8b);}(_0x69d3,0xda));var _0x369d=function(_0x11f337,_0x1d95dc){_0x11f337=_0x11f337-0x0;var _0x5dc17c=_0x69d3[_0x11f337];return _0x5dc17c;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];function respondWithStatusCode(_0xee549e,_0x52c126){_0x52c126=_0x52c126||0xcc;return function(_0x15b417){if(_0x15b417){return _0xee549e[_0x369d('0x17')](_0x52c126);}return _0xee549e[_0x369d('0x18')](_0x52c126)[_0x369d('0x19')]();};}function respondWithResult(_0x121307,_0x539536){_0x539536=_0x539536||0xc8;return function(_0x5cd4c3){if(_0x5cd4c3){return _0x121307['status'](_0x539536)[_0x369d('0x1a')](_0x5cd4c3);}};}function respondWithFilteredResult(_0xa126c1,_0x389c43){return function(_0x5b4f55){if(_0x5b4f55){var _0x2c1a4a=_0x5b4f55[_0x369d('0x1b')],_0x29c1fe=_0x389c43[_0x369d('0x1c')],_0x435c2f=_0x389c43['offset']+_0x389c43['limit'],_0x4e234e;if(_0x435c2f>=_0x2c1a4a){_0x435c2f=_0x2c1a4a;_0x4e234e=0xc8;}else{_0x4e234e=0xce;}_0xa126c1['status'](_0x4e234e);return _0xa126c1[_0x369d('0x1d')](_0x369d('0x1e'),_0x29c1fe+'-'+_0x435c2f+'/'+_0x2c1a4a)[_0x369d('0x1a')](_0x5b4f55);}return null;};}function patchUpdates(_0x4ddcb2){return function(_0x410dbe){try{jsonpatch[_0x369d('0x1f')](_0x410dbe,_0x4ddcb2,!![]);}catch(_0x3a278b){return BPromise[_0x369d('0x20')](_0x3a278b);}return _0x410dbe[_0x369d('0x21')]();};}function saveUpdates(_0x538ca4,_0x5c9fdd){return function(_0x448e6e){if(_0x448e6e){return _0x448e6e[_0x369d('0x22')](_0x538ca4)[_0x369d('0x23')](function(_0x1ea66a){return _0x1ea66a;});}return null;};}function removeEntity(_0x84cc0f,_0x15fbef){return function(_0x1b262a){if(_0x1b262a){return _0x1b262a['destroy']()['then'](function(){_0x84cc0f[_0x369d('0x18')](0xcc)[_0x369d('0x19')]();});}};}function handleEntityNotFound(_0xf7bc3a,_0xcae58){return function(_0x30e7c5){if(!_0x30e7c5){_0xf7bc3a[_0x369d('0x17')](0x194);}return _0x30e7c5;};}function handleError(_0x36cf04,_0x566c96){_0x566c96=_0x566c96||0x1f4;return function(_0x4dfe83){logger[_0x369d('0x24')](_0x4dfe83[_0x369d('0x25')]);if(_0x4dfe83[_0x369d('0x26')]){delete _0x4dfe83[_0x369d('0x26')];}_0x36cf04[_0x369d('0x18')](_0x566c96)[_0x369d('0x27')](_0x4dfe83);};}exports[_0x369d('0x28')]=function(_0x570db4,_0x23656b){var _0xe95742={},_0x357e94={},_0xf952a3={'count':0x0,'rows':[]};var _0x345be5=_[_0x369d('0x29')](db[_0x369d('0x2a')]['rawAttributes'],function(_0x157291){return{'name':_0x157291['fieldName'],'type':_0x157291['type'][_0x369d('0x2b')]};});_0x357e94[_0x369d('0x2c')]=_['map'](_0x345be5,_0x369d('0x26'));_0x357e94['query']=_[_0x369d('0x2d')](_0x570db4[_0x369d('0x2e')]);_0x357e94[_0x369d('0x2f')]=_[_0x369d('0x30')](_0x357e94[_0x369d('0x2c')],_0x357e94[_0x369d('0x2e')]);_0xe95742[_0x369d('0x31')]=_['intersection'](_0x357e94[_0x369d('0x2c')],qs[_0x369d('0x32')](_0x570db4[_0x369d('0x2e')][_0x369d('0x32')]));_0xe95742[_0x369d('0x31')]=_0xe95742[_0x369d('0x31')][_0x369d('0x33')]?_0xe95742[_0x369d('0x31')]:_0x357e94['model'];if(!_0x570db4[_0x369d('0x2e')][_0x369d('0x34')](_0x369d('0x35'))){_0xe95742[_0x369d('0x36')]=qs[_0x369d('0x36')](_0x570db4['query'][_0x369d('0x36')]);_0xe95742[_0x369d('0x1c')]=qs[_0x369d('0x1c')](_0x570db4[_0x369d('0x2e')][_0x369d('0x1c')]);}_0xe95742[_0x369d('0x37')]=qs['sort'](_0x570db4[_0x369d('0x2e')][_0x369d('0x38')]);_0xe95742[_0x369d('0x39')]=qs[_0x369d('0x2f')](_[_0x369d('0x3a')](_0x570db4[_0x369d('0x2e')],_0x357e94[_0x369d('0x2f')]),_0x345be5);if(_0x570db4[_0x369d('0x2e')][_0x369d('0x3b')]){_0xe95742[_0x369d('0x39')]=_[_0x369d('0x3c')](_0xe95742[_0x369d('0x39')],{'$or':_[_0x369d('0x29')](_0x345be5,function(_0x43d734){if(_0x43d734[_0x369d('0x3d')]!==_0x369d('0x3e')){var _0x2ef7ae={};_0x2ef7ae[_0x43d734[_0x369d('0x26')]]={'$like':'%'+_0x570db4[_0x369d('0x2e')][_0x369d('0x3b')]+'%'};return _0x2ef7ae;}})});}_0xe95742=_[_0x369d('0x3c')]({},_0xe95742,_0x570db4[_0x369d('0x3f')]);var _0xb7837f={'where':_0xe95742[_0x369d('0x39')]};return db['OpenchannelQueueReport']['count'](_0xb7837f)[_0x369d('0x23')](function(_0x319e5d){_0xf952a3[_0x369d('0x1b')]=_0x319e5d;if(_0x570db4[_0x369d('0x2e')][_0x369d('0x40')]){_0xe95742[_0x369d('0x41')]=[{'all':!![]}];}return db[_0x369d('0x2a')][_0x369d('0x42')](_0xe95742);})[_0x369d('0x23')](function(_0x488036){_0xf952a3[_0x369d('0x43')]=_0x488036;return _0xf952a3;})[_0x369d('0x23')](respondWithFilteredResult(_0x23656b,_0xe95742))[_0x369d('0x44')](handleError(_0x23656b,null));};exports[_0x369d('0x45')]=function(_0xd88839,_0x25cf4e){var _0x28803c={'raw':!![],'where':{'id':_0xd88839['params']['id']}},_0x1fee60={};_0x1fee60['model']=_[_0x369d('0x2d')](db[_0x369d('0x2a')][_0x369d('0x46')]);_0x1fee60['query']=_['keys'](_0xd88839['query']);_0x1fee60[_0x369d('0x2f')]=_[_0x369d('0x30')](_0x1fee60['model'],_0x1fee60[_0x369d('0x2e')]);_0x28803c[_0x369d('0x31')]=_[_0x369d('0x30')](_0x1fee60[_0x369d('0x2c')],qs['fields'](_0xd88839[_0x369d('0x2e')]['fields']));_0x28803c[_0x369d('0x31')]=_0x28803c['attributes'][_0x369d('0x33')]?_0x28803c[_0x369d('0x31')]:_0x1fee60[_0x369d('0x2c')];if(_0xd88839['query']['includeAll']){_0x28803c[_0x369d('0x41')]=[{'all':!![]}];}_0x28803c=_[_0x369d('0x3c')]({},_0x28803c,_0xd88839[_0x369d('0x3f')]);return db['OpenchannelQueueReport'][_0x369d('0x47')](_0x28803c)[_0x369d('0x23')](handleEntityNotFound(_0x25cf4e,null))[_0x369d('0x23')](respondWithResult(_0x25cf4e,null))[_0x369d('0x44')](handleError(_0x25cf4e,null));};exports[_0x369d('0x48')]=function(_0x2d9b1c,_0x744290){return db[_0x369d('0x2a')][_0x369d('0x48')](_0x2d9b1c['body'],{})[_0x369d('0x23')](respondWithResult(_0x744290,0xc9))[_0x369d('0x44')](handleError(_0x744290,null));};exports[_0x369d('0x22')]=function(_0x257c3d,_0x27e2c7){if(_0x257c3d[_0x369d('0x49')]['id']){delete _0x257c3d['body']['id'];}return db[_0x369d('0x2a')][_0x369d('0x47')]({'where':{'id':_0x257c3d[_0x369d('0x4a')]['id']}})[_0x369d('0x23')](handleEntityNotFound(_0x27e2c7,null))[_0x369d('0x23')](saveUpdates(_0x257c3d[_0x369d('0x49')],null))[_0x369d('0x23')](respondWithResult(_0x27e2c7,null))[_0x369d('0x44')](handleError(_0x27e2c7,null));};exports[_0x369d('0x4b')]=function(_0x3c15cb,_0x12afb2){return db[_0x369d('0x2a')]['find']({'where':{'id':_0x3c15cb[_0x369d('0x4a')]['id']}})[_0x369d('0x23')](handleEntityNotFound(_0x12afb2,null))[_0x369d('0x23')](removeEntity(_0x12afb2,null))[_0x369d('0x44')](handleError(_0x12afb2,null));};exports[_0x369d('0x4c')]=function(_0x4b41e5,_0x2d811b){return db['OpenchannelQueueReport'][_0x369d('0x4c')]()[_0x369d('0x23')](respondWithResult(_0x2d811b,null))[_0x369d('0x44')](handleError(_0x2d811b,null));}; \ No newline at end of file +var _0x1e73=['where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','set','json','reject','save','update','then','destroy','name','OpenchannelQueueReport','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','pick','filter'];(function(_0x3f3871,_0x3f3443){var _0x363795=function(_0x5a9212){while(--_0x5a9212){_0x3f3871['push'](_0x3f3871['shift']());}};_0x363795(++_0x3f3443);}(_0x1e73,0x1e3));var _0x31e7=function(_0x5817e6,_0x44a2d0){_0x5817e6=_0x5817e6-0x0;var _0x51916a=_0x1e73[_0x5817e6];return _0x51916a;};'use strict';var emlformat=require(_0x31e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x31e7('0x1'));var jsonpatch=require(_0x31e7('0x2'));var rp=require(_0x31e7('0x3'));var moment=require(_0x31e7('0x4'));var BPromise=require(_0x31e7('0x5'));var Mustache=require('mustache');var util=require(_0x31e7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x31e7('0x7'));var ejs=require(_0x31e7('0x8'));var fs=require('fs');var fs_extra=require(_0x31e7('0x9'));var _=require(_0x31e7('0xa'));var squel=require(_0x31e7('0xb'));var crypto=require(_0x31e7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x31e7('0xd'));var toCsv=require(_0x31e7('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x31e7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x31e7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x31e7('0x10'))(_0x31e7('0x11'));var utils=require(_0x31e7('0x12'));var config=require(_0x31e7('0x13'));var licenseUtil=require(_0x31e7('0x14'));var db=require(_0x31e7('0x15'))['db'];function respondWithStatusCode(_0x68454a,_0x53ac1a){_0x53ac1a=_0x53ac1a||0xcc;return function(_0x180c43){if(_0x180c43){return _0x68454a[_0x31e7('0x16')](_0x53ac1a);}return _0x68454a[_0x31e7('0x17')](_0x53ac1a)[_0x31e7('0x18')]();};}function respondWithResult(_0x32744c,_0x2851d2){_0x2851d2=_0x2851d2||0xc8;return function(_0x48778b){if(_0x48778b){return _0x32744c[_0x31e7('0x17')](_0x2851d2)['json'](_0x48778b);}};}function respondWithFilteredResult(_0x4ded61,_0x195d74){return function(_0x3d4014){if(_0x3d4014){var _0x6f90d=_0x3d4014[_0x31e7('0x19')],_0x84a34b=_0x195d74[_0x31e7('0x1a')],_0x224816=_0x195d74[_0x31e7('0x1a')]+_0x195d74['limit'],_0x4fe40d;if(_0x224816>=_0x6f90d){_0x224816=_0x6f90d;_0x4fe40d=0xc8;}else{_0x4fe40d=0xce;}_0x4ded61[_0x31e7('0x17')](_0x4fe40d);return _0x4ded61[_0x31e7('0x1b')]('Content-Range',_0x84a34b+'-'+_0x224816+'/'+_0x6f90d)[_0x31e7('0x1c')](_0x3d4014);}return null;};}function patchUpdates(_0xc61f21){return function(_0x501fca){try{jsonpatch['apply'](_0x501fca,_0xc61f21,!![]);}catch(_0x4b9292){return BPromise[_0x31e7('0x1d')](_0x4b9292);}return _0x501fca[_0x31e7('0x1e')]();};}function saveUpdates(_0x43db3a,_0x349011){return function(_0x1423d2){if(_0x1423d2){return _0x1423d2[_0x31e7('0x1f')](_0x43db3a)[_0x31e7('0x20')](function(_0x3fc30c){return _0x3fc30c;});}return null;};}function removeEntity(_0x1a49ba,_0x42b4a6){return function(_0x3c7715){if(_0x3c7715){return _0x3c7715[_0x31e7('0x21')]()[_0x31e7('0x20')](function(){_0x1a49ba['status'](0xcc)[_0x31e7('0x18')]();});}};}function handleEntityNotFound(_0x1d6bfe,_0x26a12d){return function(_0x51ee55){if(!_0x51ee55){_0x1d6bfe[_0x31e7('0x16')](0x194);}return _0x51ee55;};}function handleError(_0x57ccae,_0x1197e4){_0x1197e4=_0x1197e4||0x1f4;return function(_0x634fa4){logger['error'](_0x634fa4['stack']);if(_0x634fa4[_0x31e7('0x22')]){delete _0x634fa4[_0x31e7('0x22')];}_0x57ccae['status'](_0x1197e4)['send'](_0x634fa4);};}exports['index']=function(_0x3f3b39,_0x309cc8){var _0x253e84={},_0x58d28a={},_0x297bf4={'count':0x0,'rows':[]};var _0x574df1=_['map'](db[_0x31e7('0x23')][_0x31e7('0x24')],function(_0x87bc48){return{'name':_0x87bc48['fieldName'],'type':_0x87bc48[_0x31e7('0x25')][_0x31e7('0x26')]};});_0x58d28a[_0x31e7('0x27')]=_[_0x31e7('0x28')](_0x574df1,_0x31e7('0x22'));_0x58d28a[_0x31e7('0x29')]=_[_0x31e7('0x2a')](_0x3f3b39[_0x31e7('0x29')]);_0x58d28a[_0x31e7('0x2b')]=_['intersection'](_0x58d28a['model'],_0x58d28a[_0x31e7('0x29')]);_0x253e84[_0x31e7('0x2c')]=_[_0x31e7('0x2d')](_0x58d28a[_0x31e7('0x27')],qs['fields'](_0x3f3b39['query'][_0x31e7('0x2e')]));_0x253e84[_0x31e7('0x2c')]=_0x253e84[_0x31e7('0x2c')]['length']?_0x253e84['attributes']:_0x58d28a[_0x31e7('0x27')];if(!_0x3f3b39['query'][_0x31e7('0x2f')](_0x31e7('0x30'))){_0x253e84[_0x31e7('0x31')]=qs[_0x31e7('0x31')](_0x3f3b39[_0x31e7('0x29')]['limit']);_0x253e84[_0x31e7('0x1a')]=qs[_0x31e7('0x1a')](_0x3f3b39[_0x31e7('0x29')][_0x31e7('0x1a')]);}_0x253e84['order']=qs[_0x31e7('0x32')](_0x3f3b39[_0x31e7('0x29')][_0x31e7('0x32')]);_0x253e84['where']=qs[_0x31e7('0x2b')](_[_0x31e7('0x33')](_0x3f3b39['query'],_0x58d28a[_0x31e7('0x2b')]),_0x574df1);if(_0x3f3b39[_0x31e7('0x29')][_0x31e7('0x34')]){_0x253e84[_0x31e7('0x35')]=_[_0x31e7('0x36')](_0x253e84[_0x31e7('0x35')],{'$or':_[_0x31e7('0x28')](_0x574df1,function(_0x1e673d){if(_0x1e673d[_0x31e7('0x25')]!==_0x31e7('0x37')){var _0x435706={};_0x435706[_0x1e673d['name']]={'$like':'%'+_0x3f3b39[_0x31e7('0x29')][_0x31e7('0x34')]+'%'};return _0x435706;}})});}_0x253e84=_[_0x31e7('0x36')]({},_0x253e84,_0x3f3b39[_0x31e7('0x38')]);var _0x3aa0c5={'where':_0x253e84[_0x31e7('0x35')]};return db['OpenchannelQueueReport'][_0x31e7('0x19')](_0x3aa0c5)[_0x31e7('0x20')](function(_0x473320){_0x297bf4[_0x31e7('0x19')]=_0x473320;if(_0x3f3b39[_0x31e7('0x29')][_0x31e7('0x39')]){_0x253e84[_0x31e7('0x3a')]=[{'all':!![]}];}return db[_0x31e7('0x23')][_0x31e7('0x3b')](_0x253e84);})[_0x31e7('0x20')](function(_0x313aa4){_0x297bf4[_0x31e7('0x3c')]=_0x313aa4;return _0x297bf4;})['then'](respondWithFilteredResult(_0x309cc8,_0x253e84))[_0x31e7('0x3d')](handleError(_0x309cc8,null));};exports['show']=function(_0x14a266,_0x5ec1dc){var _0x437a1f={'raw':!![],'where':{'id':_0x14a266['params']['id']}},_0x4a8330={};_0x4a8330[_0x31e7('0x27')]=_[_0x31e7('0x2a')](db['OpenchannelQueueReport'][_0x31e7('0x24')]);_0x4a8330[_0x31e7('0x29')]=_[_0x31e7('0x2a')](_0x14a266[_0x31e7('0x29')]);_0x4a8330[_0x31e7('0x2b')]=_[_0x31e7('0x2d')](_0x4a8330[_0x31e7('0x27')],_0x4a8330[_0x31e7('0x29')]);_0x437a1f[_0x31e7('0x2c')]=_[_0x31e7('0x2d')](_0x4a8330[_0x31e7('0x27')],qs[_0x31e7('0x2e')](_0x14a266[_0x31e7('0x29')][_0x31e7('0x2e')]));_0x437a1f[_0x31e7('0x2c')]=_0x437a1f['attributes'][_0x31e7('0x3e')]?_0x437a1f[_0x31e7('0x2c')]:_0x4a8330[_0x31e7('0x27')];if(_0x14a266[_0x31e7('0x29')][_0x31e7('0x39')]){_0x437a1f[_0x31e7('0x3a')]=[{'all':!![]}];}_0x437a1f=_[_0x31e7('0x36')]({},_0x437a1f,_0x14a266[_0x31e7('0x38')]);return db[_0x31e7('0x23')]['find'](_0x437a1f)[_0x31e7('0x20')](handleEntityNotFound(_0x5ec1dc,null))['then'](respondWithResult(_0x5ec1dc,null))[_0x31e7('0x3d')](handleError(_0x5ec1dc,null));};exports['create']=function(_0x24a2c3,_0x54011d){return db[_0x31e7('0x23')][_0x31e7('0x3f')](_0x24a2c3[_0x31e7('0x40')],{})[_0x31e7('0x20')](respondWithResult(_0x54011d,0xc9))[_0x31e7('0x3d')](handleError(_0x54011d,null));};exports[_0x31e7('0x1f')]=function(_0x5e40f3,_0x4fd3a0){if(_0x5e40f3[_0x31e7('0x40')]['id']){delete _0x5e40f3['body']['id'];}return db[_0x31e7('0x23')]['find']({'where':{'id':_0x5e40f3['params']['id']}})['then'](handleEntityNotFound(_0x4fd3a0,null))[_0x31e7('0x20')](saveUpdates(_0x5e40f3[_0x31e7('0x40')],null))['then'](respondWithResult(_0x4fd3a0,null))[_0x31e7('0x3d')](handleError(_0x4fd3a0,null));};exports['destroy']=function(_0x59a152,_0x24aef3){return db[_0x31e7('0x23')][_0x31e7('0x41')]({'where':{'id':_0x59a152['params']['id']}})[_0x31e7('0x20')](handleEntityNotFound(_0x24aef3,null))[_0x31e7('0x20')](removeEntity(_0x24aef3,null))['catch'](handleError(_0x24aef3,null));};exports[_0x31e7('0x42')]=function(_0x3d671e,_0x1e35f5){return db['OpenchannelQueueReport'][_0x31e7('0x42')]()[_0x31e7('0x20')](respondWithResult(_0x1e35f5,null))[_0x31e7('0x3d')](handleError(_0x1e35f5,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index c54191c..c894c52 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 _0x3870=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','report_openchannel_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3870,0x15b));var _0x0387=function(_0x33dc51,_0x1d6b24){_0x33dc51=_0x33dc51-0x0;var _0x5bbd34=_0x3870[_0x33dc51];return _0x5bbd34;};'use strict';var _=require(_0x0387('0x0'));var util=require(_0x0387('0x1'));var logger=require(_0x0387('0x2'))(_0x0387('0x3'));var moment=require(_0x0387('0x4'));var BPromise=require(_0x0387('0x5'));var rp=require(_0x0387('0x6'));var fs=require('fs');var path=require(_0x0387('0x7'));var rimraf=require(_0x0387('0x8'));var config=require(_0x0387('0x9'));var attributes=require(_0x0387('0xa'));module[_0x0387('0xb')]=function(_0x2e1bf7,_0x363c4e){return _0x2e1bf7['define']('OpenchannelQueueReport',attributes,{'tableName':_0x0387('0xc'),'paranoid':![],'indexes':[{'name':_0x0387('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x56e6=['bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1014d7,_0x3d98ff){var _0x8d83ee=function(_0x3e010c){while(--_0x3e010c){_0x1014d7['push'](_0x1014d7['shift']());}};_0x8d83ee(++_0x3d98ff);}(_0x56e6,0x6b));var _0x656e=function(_0x289926,_0x5778ae){_0x289926=_0x289926-0x0;var _0x393d34=_0x56e6[_0x289926];return _0x393d34;};'use strict';var _=require(_0x656e('0x0'));var util=require(_0x656e('0x1'));var logger=require(_0x656e('0x2'))(_0x656e('0x3'));var moment=require(_0x656e('0x4'));var BPromise=require(_0x656e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x656e('0x6'));var rimraf=require(_0x656e('0x7'));var config=require(_0x656e('0x8'));var attributes=require(_0x656e('0x9'));module[_0x656e('0xa')]=function(_0x3fef98,_0x81c232){return _0x3fef98['define'](_0x656e('0xb'),attributes,{'tableName':_0x656e('0xc'),'paranoid':![],'indexes':[{'name':_0x656e('0xd'),'fields':[_0x656e('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 e203b07..60bb2ab 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 _0x2072=['OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','debug','UpdateOpenchannelQueueReport','update','where','attributes','limit','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0xb36843,_0x57c1f4){var _0x227b83=function(_0x3bce6f){while(--_0x3bce6f){_0xb36843['push'](_0xb36843['shift']());}};_0x227b83(++_0x57c1f4);}(_0x2072,0xda));var _0x2207=function(_0x3cdc03,_0x30bb6b){_0x3cdc03=_0x3cdc03-0x0;var _0x3504f2=_0x2072[_0x3cdc03];return _0x3504f2;};'use strict';var _=require('lodash');var util=require(_0x2207('0x0'));var moment=require(_0x2207('0x1'));var BPromise=require('bluebird');var rs=require(_0x2207('0x2'));var fs=require('fs');var Redis=require(_0x2207('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2207('0x4'));var logger=require(_0x2207('0x5'))(_0x2207('0x6'));var config=require(_0x2207('0x7'));var jayson=require(_0x2207('0x8'));var client=jayson['client'][_0x2207('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f00bf,_0xe7d3f5,_0x780174){return new BPromise(function(_0x3b999a,_0x3597ca){return client[_0x2207('0xa')](_0x1f00bf,_0x780174)[_0x2207('0xb')](function(_0x3e46a7){logger[_0x2207('0xc')](_0x2207('0xd'),_0xe7d3f5,_0x2207('0xe'));logger['debug'](_0x2207('0xf'),_0xe7d3f5,_0x2207('0xe'),JSON[_0x2207('0x10')](_0x3e46a7));if(_0x3e46a7[_0x2207('0x11')]){if(_0x3e46a7[_0x2207('0x11')]['code']===0x1f4){logger[_0x2207('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe7d3f5,_0x3e46a7[_0x2207('0x11')][_0x2207('0x12')]);return _0x3597ca(_0x3e46a7[_0x2207('0x11')][_0x2207('0x12')]);}logger[_0x2207('0x11')](_0x2207('0xd'),_0xe7d3f5,_0x3e46a7[_0x2207('0x11')][_0x2207('0x12')]);return _0x3b999a(_0x3e46a7['error'][_0x2207('0x12')]);}else{logger[_0x2207('0xc')](_0x2207('0xd'),_0xe7d3f5,_0x2207('0xe'));_0x3b999a(_0x3e46a7[_0x2207('0x13')][_0x2207('0x12')]);}})[_0x2207('0x14')](function(_0x738dc2){logger['error'](_0x2207('0xd'),_0xe7d3f5,_0x738dc2);_0x3597ca(_0x738dc2);});});}exports[_0x2207('0x15')]=function(_0x255891){var _0x2c1838=this;return new Promise(function(_0x91ceb4,_0x37b0d2){return db[_0x2207('0x16')][_0x2207('0x17')](_0x255891[_0x2207('0x18')],{'raw':_0x255891[_0x2207('0x19')]?_0x255891[_0x2207('0x19')][_0x2207('0x1a')]===undefined?!![]:![]:!![]})[_0x2207('0xb')](function(_0x34b591){logger[_0x2207('0xc')](_0x2207('0x15'),_0x255891);logger[_0x2207('0x1b')]('CreateOpenchannelQueueReport',_0x255891,JSON['stringify'](_0x34b591));_0x91ceb4(_0x34b591);})['catch'](function(_0x3b3c7){logger[_0x2207('0x11')](_0x2207('0x15'),_0x3b3c7[_0x2207('0x12')],_0x255891);_0x37b0d2(_0x2c1838[_0x2207('0x11')](0x1f4,_0x3b3c7[_0x2207('0x12')]));});});};exports[_0x2207('0x1c')]=function(_0x13291e){var _0x57f523=this;return new Promise(function(_0x27e0ba,_0x16993a){return db[_0x2207('0x16')][_0x2207('0x1d')](_0x13291e['body'],{'raw':_0x13291e['options']?_0x13291e[_0x2207('0x19')][_0x2207('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13291e[_0x2207('0x19')]?_0x13291e['options'][_0x2207('0x1e')]||null:null,'attributes':_0x13291e[_0x2207('0x19')]?_0x13291e['options'][_0x2207('0x1f')]||null:null,'limit':_0x13291e[_0x2207('0x19')]?_0x13291e['options'][_0x2207('0x20')]||null:null})[_0x2207('0xb')](function(_0x5c1c56){logger[_0x2207('0xc')]('UpdateOpenchannelQueueReport',_0x13291e);logger[_0x2207('0x1b')](_0x2207('0x1c'),_0x13291e,JSON[_0x2207('0x10')](_0x5c1c56));_0x27e0ba(_0x5c1c56);})[_0x2207('0x14')](function(_0x3dd088){logger[_0x2207('0x11')]('UpdateOpenchannelQueueReport',_0x3dd088[_0x2207('0x12')],_0x13291e);_0x16993a(_0x57f523[_0x2207('0x11')](0x1f4,_0x3dd088['message']));});});}; \ No newline at end of file +var _0xc722=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','OpenchannelQueueReport','body','options','CreateOpenchannelQueueReport','stringify','update','raw','where','attributes','UpdateOpenchannelQueueReport','lodash','util','moment','randomstring'];(function(_0x2e3107,_0x25f970){var _0x833d69=function(_0x420e78){while(--_0x420e78){_0x2e3107['push'](_0x2e3107['shift']());}};_0x833d69(++_0x25f970);}(_0xc722,0xea));var _0x2c72=function(_0x10e9b1,_0x43cd2f){_0x10e9b1=_0x10e9b1-0x0;var _0x3f0422=_0xc722[_0x10e9b1];return _0x3f0422;};'use strict';var _=require(_0x2c72('0x0'));var util=require(_0x2c72('0x1'));var moment=require(_0x2c72('0x2'));var BPromise=require('bluebird');var rs=require(_0x2c72('0x3'));var fs=require('fs');var Redis=require(_0x2c72('0x4'));var db=require(_0x2c72('0x5'))['db'];var utils=require(_0x2c72('0x6'));var logger=require(_0x2c72('0x7'))('rpc');var config=require(_0x2c72('0x8'));var jayson=require(_0x2c72('0x9'));var client=jayson[_0x2c72('0xa')][_0x2c72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4efd42,_0x154cf8,_0x525b6f){return new BPromise(function(_0x2c7eab,_0x493849){return client[_0x2c72('0xc')](_0x4efd42,_0x525b6f)[_0x2c72('0xd')](function(_0x57e84e){logger[_0x2c72('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x154cf8,_0x2c72('0xf'));logger[_0x2c72('0x10')](_0x2c72('0x11'),_0x154cf8,_0x2c72('0xf'),JSON['stringify'](_0x57e84e));if(_0x57e84e['error']){if(_0x57e84e[_0x2c72('0x12')][_0x2c72('0x13')]===0x1f4){logger[_0x2c72('0x12')](_0x2c72('0x14'),_0x154cf8,_0x57e84e[_0x2c72('0x12')][_0x2c72('0x15')]);return _0x493849(_0x57e84e[_0x2c72('0x12')]['message']);}logger[_0x2c72('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x154cf8,_0x57e84e[_0x2c72('0x12')][_0x2c72('0x15')]);return _0x2c7eab(_0x57e84e[_0x2c72('0x12')][_0x2c72('0x15')]);}else{logger[_0x2c72('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x154cf8,_0x2c72('0xf'));_0x2c7eab(_0x57e84e[_0x2c72('0x16')][_0x2c72('0x15')]);}})[_0x2c72('0x17')](function(_0x10e13d){logger[_0x2c72('0x12')](_0x2c72('0x14'),_0x154cf8,_0x10e13d);_0x493849(_0x10e13d);});});}exports['CreateOpenchannelQueueReport']=function(_0x51a327){var _0x5f3edc=this;return new Promise(function(_0x58f58c,_0x4325d0){return db[_0x2c72('0x18')]['create'](_0x51a327[_0x2c72('0x19')],{'raw':_0x51a327[_0x2c72('0x1a')]?_0x51a327[_0x2c72('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x2c72('0xd')](function(_0x4fc870){logger['info'](_0x2c72('0x1b'),_0x51a327);logger[_0x2c72('0x10')](_0x2c72('0x1b'),_0x51a327,JSON[_0x2c72('0x1c')](_0x4fc870));_0x58f58c(_0x4fc870);})[_0x2c72('0x17')](function(_0x95ba10){logger['error']('CreateOpenchannelQueueReport',_0x95ba10[_0x2c72('0x15')],_0x51a327);_0x4325d0(_0x5f3edc[_0x2c72('0x12')](0x1f4,_0x95ba10[_0x2c72('0x15')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x33665e){var _0x5ea18c=this;return new Promise(function(_0x220ce0,_0x31ae26){return db[_0x2c72('0x18')][_0x2c72('0x1d')](_0x33665e[_0x2c72('0x19')],{'raw':_0x33665e[_0x2c72('0x1a')]?_0x33665e[_0x2c72('0x1a')][_0x2c72('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33665e['options']?_0x33665e['options'][_0x2c72('0x1f')]||null:null,'attributes':_0x33665e[_0x2c72('0x1a')]?_0x33665e[_0x2c72('0x1a')][_0x2c72('0x20')]||null:null,'limit':_0x33665e[_0x2c72('0x1a')]?_0x33665e[_0x2c72('0x1a')]['limit']||null:null})[_0x2c72('0xd')](function(_0x5e6b84){logger[_0x2c72('0xe')](_0x2c72('0x21'),_0x33665e);logger['debug']('UpdateOpenchannelQueueReport',_0x33665e,JSON[_0x2c72('0x1c')](_0x5e6b84));_0x220ce0(_0x5e6b84);})[_0x2c72('0x17')](function(_0x335c1e){logger[_0x2c72('0x12')](_0x2c72('0x21'),_0x335c1e[_0x2c72('0x15')],_0x33665e);_0x31ae26(_0x5ea18c[_0x2c72('0x12')](0x1f4,_0x335c1e['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 3580cbb..5dc0b53 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 _0x8fd1=['../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create','put','delete','multer','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x46e4de,_0x1c5426){var _0x2ef916=function(_0x31c136){while(--_0x31c136){_0x46e4de['push'](_0x46e4de['shift']());}};_0x2ef916(++_0x1c5426);}(_0x8fd1,0x136));var _0x18fd=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0x8fd1[_0x13e300];return _0x5a3eea;};'use strict';var multer=require(_0x18fd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x18fd('0x1'));var express=require('express');var router=express[_0x18fd('0x2')]();var fs_extra=require(_0x18fd('0x3'));var auth=require(_0x18fd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x18fd('0x5'));var controller=require(_0x18fd('0x6'));router[_0x18fd('0x7')]('/',auth[_0x18fd('0x8')](),controller['index']);router[_0x18fd('0x7')](_0x18fd('0x9'),auth[_0x18fd('0x8')](),controller['describe']);router[_0x18fd('0x7')](_0x18fd('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x18fd('0xb')]('/',auth[_0x18fd('0x8')](),controller[_0x18fd('0xc')]);router[_0x18fd('0xd')]('/:id',auth[_0x18fd('0x8')](),controller['update']);router[_0x18fd('0xe')](_0x18fd('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb111=['../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x46c6b7,_0x48f8bb){var _0x561506=function(_0x46450a){while(--_0x46450a){_0x46c6b7['push'](_0x46c6b7['shift']());}};_0x561506(++_0x48f8bb);}(_0xb111,0x1b4));var _0x1b11=function(_0x28b72e,_0x1862be){_0x28b72e=_0x28b72e-0x0;var _0x2bb662=_0xb111[_0x28b72e];return _0x2bb662;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1b11('0x0'));var timeout=require(_0x1b11('0x1'));var express=require(_0x1b11('0x2'));var router=express[_0x1b11('0x3')]();var fs_extra=require(_0x1b11('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b11('0x5'));var controller=require(_0x1b11('0x6'));router[_0x1b11('0x7')]('/',auth[_0x1b11('0x8')](),controller[_0x1b11('0x9')]);router[_0x1b11('0x7')](_0x1b11('0xa'),auth[_0x1b11('0x8')](),controller[_0x1b11('0xb')]);router[_0x1b11('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1b11('0xc')]);router[_0x1b11('0xd')]('/',auth[_0x1b11('0x8')](),controller[_0x1b11('0xe')]);router[_0x1b11('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x1b11('0x10')]);router[_0x1b11('0x11')](_0x1b11('0x12'),auth['isAuthenticated'](),controller[_0x1b11('0x13')]);module[_0x1b11('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index a924f86..fafe271 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 _0x3eb9=['exports','STRING','ENUM','account','agent','queue','NOW','moment','sequelize'];(function(_0x47408e,_0xd2e315){var _0x5ad337=function(_0x3312f2){while(--_0x3312f2){_0x47408e['push'](_0x47408e['shift']());}};_0x5ad337(++_0xd2e315);}(_0x3eb9,0xe8));var _0x93eb=function(_0x4a6156,_0x2b8ce6){_0x4a6156=_0x4a6156-0x0;var _0x12c1f6=_0x3eb9[_0x4a6156];return _0x12c1f6;};'use strict';var moment=require(_0x93eb('0x0'));var Sequelize=require(_0x93eb('0x1'));module[_0x93eb('0x2')]={'uniqueid':{'type':Sequelize[_0x93eb('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x93eb('0x4')](_0x93eb('0x5'),_0x93eb('0x6'),_0x93eb('0x7')),'allowNull':![],'defaultValue':_0x93eb('0x7')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x93eb('0x8')]}}; \ No newline at end of file +var _0xe5e1=['NOW','moment','exports','STRING','ENUM','account','queue','DATE'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0xe5e1,0xd1));var _0x1e5e=function(_0x5ccb9c,_0x5673f4){_0x5ccb9c=_0x5ccb9c-0x0;var _0x237676=_0xe5e1[_0x5ccb9c];return _0x237676;};'use strict';var moment=require(_0x1e5e('0x0'));var Sequelize=require('sequelize');module[_0x1e5e('0x1')]={'uniqueid':{'type':Sequelize[_0x1e5e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1e5e('0x3')](_0x1e5e('0x4'),'agent',_0x1e5e('0x5')),'allowNull':![],'defaultValue':_0x1e5e('0x5')},'transferredAt':{'type':Sequelize[_0x1e5e('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x1e5e('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index e4b2d5f..8be8b53 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 _0xac4f=['body','describe','eml-format','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','reject','update','then','destroy','error','name','send','index','map','rawAttributes','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','findAll','rows','catch','show','params','find','create'];(function(_0x4c7f8e,_0x202031){var _0x40f410=function(_0x39faa9){while(--_0x39faa9){_0x4c7f8e['push'](_0x4c7f8e['shift']());}};_0x40f410(++_0x202031);}(_0xac4f,0x122));var _0xfac4=function(_0x47a802,_0x424bf1){_0x47a802=_0x47a802-0x0;var _0xb3badc=_0xac4f[_0x47a802];return _0xb3badc;};'use strict';var emlformat=require(_0xfac4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfac4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfac4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfac4('0x3'));var util=require(_0xfac4('0x4'));var path=require('path');var sox=require(_0xfac4('0x5'));var csv=require(_0xfac4('0x6'));var ejs=require(_0xfac4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfac4('0x8'));var squel=require(_0xfac4('0x9'));var crypto=require(_0xfac4('0xa'));var jsforce=require(_0xfac4('0xb'));var deskjs=require(_0xfac4('0xc'));var toCsv=require(_0xfac4('0x6'));var querystring=require('querystring');var Papa=require(_0xfac4('0xd'));var Redis=require(_0xfac4('0xe'));var authService=require(_0xfac4('0xf'));var qs=require(_0xfac4('0x10'));var as=require(_0xfac4('0x11'));var hardwareService=require(_0xfac4('0x12'));var logger=require(_0xfac4('0x13'))(_0xfac4('0x14'));var utils=require(_0xfac4('0x15'));var config=require(_0xfac4('0x16'));var licenseUtil=require(_0xfac4('0x17'));var db=require(_0xfac4('0x18'))['db'];function respondWithStatusCode(_0x5e374a,_0x2f9c87){_0x2f9c87=_0x2f9c87||0xcc;return function(_0x5bcc16){if(_0x5bcc16){return _0x5e374a[_0xfac4('0x19')](_0x2f9c87);}return _0x5e374a[_0xfac4('0x1a')](_0x2f9c87)[_0xfac4('0x1b')]();};}function respondWithResult(_0x4599cc,_0x114653){_0x114653=_0x114653||0xc8;return function(_0xcde790){if(_0xcde790){return _0x4599cc[_0xfac4('0x1a')](_0x114653)[_0xfac4('0x1c')](_0xcde790);}};}function respondWithFilteredResult(_0x48a42b,_0x3d529f){return function(_0x40fe62){if(_0x40fe62){var _0x3be3c1=_0x40fe62[_0xfac4('0x1d')],_0xcf7e40=_0x3d529f[_0xfac4('0x1e')],_0x2c8c6f=_0x3d529f[_0xfac4('0x1e')]+_0x3d529f['limit'],_0x3ce345;if(_0x2c8c6f>=_0x3be3c1){_0x2c8c6f=_0x3be3c1;_0x3ce345=0xc8;}else{_0x3ce345=0xce;}_0x48a42b['status'](_0x3ce345);return _0x48a42b['set'](_0xfac4('0x1f'),_0xcf7e40+'-'+_0x2c8c6f+'/'+_0x3be3c1)[_0xfac4('0x1c')](_0x40fe62);}return null;};}function patchUpdates(_0x4aec9e){return function(_0x5d75c2){try{jsonpatch['apply'](_0x5d75c2,_0x4aec9e,!![]);}catch(_0x15fcc7){return BPromise[_0xfac4('0x20')](_0x15fcc7);}return _0x5d75c2['save']();};}function saveUpdates(_0x227f7e,_0xb69d66){return function(_0x347499){if(_0x347499){return _0x347499[_0xfac4('0x21')](_0x227f7e)[_0xfac4('0x22')](function(_0x3392d7){return _0x3392d7;});}return null;};}function removeEntity(_0x41ac63,_0x6b08a2){return function(_0x238895){if(_0x238895){return _0x238895[_0xfac4('0x23')]()[_0xfac4('0x22')](function(){_0x41ac63['status'](0xcc)[_0xfac4('0x1b')]();});}};}function handleEntityNotFound(_0x1b09d2,_0x56aab9){return function(_0x410602){if(!_0x410602){_0x1b09d2[_0xfac4('0x19')](0x194);}return _0x410602;};}function handleError(_0x27493f,_0x4e32d4){_0x4e32d4=_0x4e32d4||0x1f4;return function(_0x44d637){logger[_0xfac4('0x24')](_0x44d637['stack']);if(_0x44d637[_0xfac4('0x25')]){delete _0x44d637[_0xfac4('0x25')];}_0x27493f[_0xfac4('0x1a')](_0x4e32d4)[_0xfac4('0x26')](_0x44d637);};}exports[_0xfac4('0x27')]=function(_0x528844,_0x3cb605){var _0x544f82={},_0x299cca={},_0x254dfa={'count':0x0,'rows':[]};var _0x549306=_[_0xfac4('0x28')](db['OpenchannelTransferReport'][_0xfac4('0x29')],function(_0x59c386){return{'name':_0x59c386['fieldName'],'type':_0x59c386[_0xfac4('0x2a')]['key']};});_0x299cca[_0xfac4('0x2b')]=_[_0xfac4('0x28')](_0x549306,'name');_0x299cca['query']=_[_0xfac4('0x2c')](_0x528844['query']);_0x299cca[_0xfac4('0x2d')]=_[_0xfac4('0x2e')](_0x299cca[_0xfac4('0x2b')],_0x299cca[_0xfac4('0x2f')]);_0x544f82[_0xfac4('0x30')]=_[_0xfac4('0x2e')](_0x299cca['model'],qs['fields'](_0x528844[_0xfac4('0x2f')][_0xfac4('0x31')]));_0x544f82[_0xfac4('0x30')]=_0x544f82[_0xfac4('0x30')][_0xfac4('0x32')]?_0x544f82[_0xfac4('0x30')]:_0x299cca[_0xfac4('0x2b')];if(!_0x528844[_0xfac4('0x2f')][_0xfac4('0x33')](_0xfac4('0x34'))){_0x544f82['limit']=qs['limit'](_0x528844[_0xfac4('0x2f')][_0xfac4('0x35')]);_0x544f82[_0xfac4('0x1e')]=qs[_0xfac4('0x1e')](_0x528844[_0xfac4('0x2f')][_0xfac4('0x1e')]);}_0x544f82[_0xfac4('0x36')]=qs[_0xfac4('0x37')](_0x528844[_0xfac4('0x2f')][_0xfac4('0x37')]);_0x544f82[_0xfac4('0x38')]=qs[_0xfac4('0x2d')](_['pick'](_0x528844[_0xfac4('0x2f')],_0x299cca[_0xfac4('0x2d')]),_0x549306);if(_0x528844[_0xfac4('0x2f')][_0xfac4('0x39')]){_0x544f82[_0xfac4('0x38')]=_[_0xfac4('0x3a')](_0x544f82['where'],{'$or':_['map'](_0x549306,function(_0x3dfcfe){if(_0x3dfcfe[_0xfac4('0x2a')]!==_0xfac4('0x3b')){var _0x5b891c={};_0x5b891c[_0x3dfcfe[_0xfac4('0x25')]]={'$like':'%'+_0x528844[_0xfac4('0x2f')][_0xfac4('0x39')]+'%'};return _0x5b891c;}})});}_0x544f82=_[_0xfac4('0x3a')]({},_0x544f82,_0x528844[_0xfac4('0x3c')]);var _0x505cb4={'where':_0x544f82[_0xfac4('0x38')]};return db[_0xfac4('0x3d')][_0xfac4('0x1d')](_0x505cb4)[_0xfac4('0x22')](function(_0x136ef1){_0x254dfa[_0xfac4('0x1d')]=_0x136ef1;if(_0x528844[_0xfac4('0x2f')][_0xfac4('0x3e')]){_0x544f82['include']=[{'all':!![]}];}return db[_0xfac4('0x3d')][_0xfac4('0x3f')](_0x544f82);})[_0xfac4('0x22')](function(_0x2c0207){_0x254dfa[_0xfac4('0x40')]=_0x2c0207;return _0x254dfa;})[_0xfac4('0x22')](respondWithFilteredResult(_0x3cb605,_0x544f82))[_0xfac4('0x41')](handleError(_0x3cb605,null));};exports[_0xfac4('0x42')]=function(_0x1fc9d6,_0x1a9aee){var _0x4127c6={'raw':!![],'where':{'id':_0x1fc9d6[_0xfac4('0x43')]['id']}},_0x27847f={};_0x27847f[_0xfac4('0x2b')]=_[_0xfac4('0x2c')](db['OpenchannelTransferReport']['rawAttributes']);_0x27847f['query']=_[_0xfac4('0x2c')](_0x1fc9d6[_0xfac4('0x2f')]);_0x27847f[_0xfac4('0x2d')]=_[_0xfac4('0x2e')](_0x27847f[_0xfac4('0x2b')],_0x27847f[_0xfac4('0x2f')]);_0x4127c6['attributes']=_['intersection'](_0x27847f['model'],qs[_0xfac4('0x31')](_0x1fc9d6['query'][_0xfac4('0x31')]));_0x4127c6[_0xfac4('0x30')]=_0x4127c6[_0xfac4('0x30')][_0xfac4('0x32')]?_0x4127c6[_0xfac4('0x30')]:_0x27847f[_0xfac4('0x2b')];if(_0x1fc9d6[_0xfac4('0x2f')][_0xfac4('0x3e')]){_0x4127c6['include']=[{'all':!![]}];}_0x4127c6=_[_0xfac4('0x3a')]({},_0x4127c6,_0x1fc9d6[_0xfac4('0x3c')]);return db['OpenchannelTransferReport'][_0xfac4('0x44')](_0x4127c6)['then'](handleEntityNotFound(_0x1a9aee,null))[_0xfac4('0x22')](respondWithResult(_0x1a9aee,null))[_0xfac4('0x41')](handleError(_0x1a9aee,null));};exports[_0xfac4('0x45')]=function(_0x43e9a4,_0x3cfe87){return db[_0xfac4('0x3d')]['create'](_0x43e9a4[_0xfac4('0x46')],{})[_0xfac4('0x22')](respondWithResult(_0x3cfe87,0xc9))[_0xfac4('0x41')](handleError(_0x3cfe87,null));};exports[_0xfac4('0x21')]=function(_0x559cea,_0x274db6){if(_0x559cea[_0xfac4('0x46')]['id']){delete _0x559cea[_0xfac4('0x46')]['id'];}return db['OpenchannelTransferReport'][_0xfac4('0x44')]({'where':{'id':_0x559cea[_0xfac4('0x43')]['id']}})[_0xfac4('0x22')](handleEntityNotFound(_0x274db6,null))[_0xfac4('0x22')](saveUpdates(_0x559cea['body'],null))[_0xfac4('0x22')](respondWithResult(_0x274db6,null))['catch'](handleError(_0x274db6,null));};exports[_0xfac4('0x23')]=function(_0x54d735,_0x224a54){return db[_0xfac4('0x3d')][_0xfac4('0x44')]({'where':{'id':_0x54d735[_0xfac4('0x43')]['id']}})['then'](handleEntityNotFound(_0x224a54,null))[_0xfac4('0x22')](removeEntity(_0x224a54,null))['catch'](handleError(_0x224a54,null));};exports['describe']=function(_0x4e22a0,_0x30dc38){return db[_0xfac4('0x3d')][_0xfac4('0x47')]()[_0xfac4('0x22')](respondWithResult(_0x30dc38,null))[_0xfac4('0x41')](handleError(_0x30dc38,null));}; \ No newline at end of file +var _0x85d8=['json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','OpenchannelTransferReport','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','merge','options','includeAll','include','rows','show','rawAttributes','find','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x123881,_0x2028b6){var _0x1824fa=function(_0x2294dd){while(--_0x2294dd){_0x123881['push'](_0x123881['shift']());}};_0x1824fa(++_0x2028b6);}(_0x85d8,0x1b0));var _0x885d=function(_0x3fc466,_0x520076){_0x3fc466=_0x3fc466-0x0;var _0x437e13=_0x85d8[_0x3fc466];return _0x437e13;};'use strict';var emlformat=require(_0x885d('0x0'));var rimraf=require(_0x885d('0x1'));var zipdir=require(_0x885d('0x2'));var jsonpatch=require(_0x885d('0x3'));var rp=require(_0x885d('0x4'));var moment=require('moment');var BPromise=require(_0x885d('0x5'));var Mustache=require(_0x885d('0x6'));var util=require(_0x885d('0x7'));var path=require(_0x885d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x885d('0x9'));var fs=require('fs');var fs_extra=require(_0x885d('0xa'));var _=require(_0x885d('0xb'));var squel=require(_0x885d('0xc'));var crypto=require(_0x885d('0xd'));var jsforce=require(_0x885d('0xe'));var deskjs=require(_0x885d('0xf'));var toCsv=require(_0x885d('0x10'));var querystring=require(_0x885d('0x11'));var Papa=require(_0x885d('0x12'));var Redis=require(_0x885d('0x13'));var authService=require(_0x885d('0x14'));var qs=require(_0x885d('0x15'));var as=require(_0x885d('0x16'));var hardwareService=require(_0x885d('0x17'));var logger=require(_0x885d('0x18'))(_0x885d('0x19'));var utils=require(_0x885d('0x1a'));var config=require(_0x885d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28b541,_0x127cd8){_0x127cd8=_0x127cd8||0xcc;return function(_0x495a56){if(_0x495a56){return _0x28b541[_0x885d('0x1c')](_0x127cd8);}return _0x28b541[_0x885d('0x1d')](_0x127cd8)['end']();};}function respondWithResult(_0x527a40,_0x466be5){_0x466be5=_0x466be5||0xc8;return function(_0x3a0ab7){if(_0x3a0ab7){return _0x527a40[_0x885d('0x1d')](_0x466be5)[_0x885d('0x1e')](_0x3a0ab7);}};}function respondWithFilteredResult(_0x2ecb5c,_0x1b837f){return function(_0x5d8bcd){if(_0x5d8bcd){var _0x594a29=_0x5d8bcd[_0x885d('0x1f')],_0x3f277c=_0x1b837f[_0x885d('0x20')],_0x147191=_0x1b837f[_0x885d('0x20')]+_0x1b837f[_0x885d('0x21')],_0x19a1d6;if(_0x147191>=_0x594a29){_0x147191=_0x594a29;_0x19a1d6=0xc8;}else{_0x19a1d6=0xce;}_0x2ecb5c[_0x885d('0x1d')](_0x19a1d6);return _0x2ecb5c['set'](_0x885d('0x22'),_0x3f277c+'-'+_0x147191+'/'+_0x594a29)[_0x885d('0x1e')](_0x5d8bcd);}return null;};}function patchUpdates(_0x163615){return function(_0x3cadff){try{jsonpatch[_0x885d('0x23')](_0x3cadff,_0x163615,!![]);}catch(_0x5a72b8){return BPromise[_0x885d('0x24')](_0x5a72b8);}return _0x3cadff[_0x885d('0x25')]();};}function saveUpdates(_0x55738d,_0x175e05){return function(_0x583637){if(_0x583637){return _0x583637[_0x885d('0x26')](_0x55738d)[_0x885d('0x27')](function(_0x22550d){return _0x22550d;});}return null;};}function removeEntity(_0x90589,_0x261c0f){return function(_0x2e76ef){if(_0x2e76ef){return _0x2e76ef[_0x885d('0x28')]()[_0x885d('0x27')](function(){_0x90589['status'](0xcc)[_0x885d('0x29')]();});}};}function handleEntityNotFound(_0x2b7e32,_0x3032ac){return function(_0x4d9f74){if(!_0x4d9f74){_0x2b7e32[_0x885d('0x1c')](0x194);}return _0x4d9f74;};}function handleError(_0x389803,_0x1aa02f){_0x1aa02f=_0x1aa02f||0x1f4;return function(_0x7dc85b){logger[_0x885d('0x2a')](_0x7dc85b[_0x885d('0x2b')]);if(_0x7dc85b[_0x885d('0x2c')]){delete _0x7dc85b[_0x885d('0x2c')];}_0x389803[_0x885d('0x1d')](_0x1aa02f)['send'](_0x7dc85b);};}exports['index']=function(_0x13948c,_0x4cd7fb){var _0x1dda46={},_0x17fde0={},_0x34c415={'count':0x0,'rows':[]};var _0x1f7120=_[_0x885d('0x2d')](db[_0x885d('0x2e')]['rawAttributes'],function(_0x172d26){return{'name':_0x172d26[_0x885d('0x2f')],'type':_0x172d26['type'][_0x885d('0x30')]};});_0x17fde0['model']=_['map'](_0x1f7120,_0x885d('0x2c'));_0x17fde0['query']=_[_0x885d('0x31')](_0x13948c[_0x885d('0x32')]);_0x17fde0[_0x885d('0x33')]=_[_0x885d('0x34')](_0x17fde0[_0x885d('0x35')],_0x17fde0[_0x885d('0x32')]);_0x1dda46['attributes']=_[_0x885d('0x34')](_0x17fde0[_0x885d('0x35')],qs[_0x885d('0x36')](_0x13948c[_0x885d('0x32')][_0x885d('0x36')]));_0x1dda46['attributes']=_0x1dda46[_0x885d('0x37')][_0x885d('0x38')]?_0x1dda46['attributes']:_0x17fde0[_0x885d('0x35')];if(!_0x13948c[_0x885d('0x32')][_0x885d('0x39')](_0x885d('0x3a'))){_0x1dda46[_0x885d('0x21')]=qs[_0x885d('0x21')](_0x13948c[_0x885d('0x32')][_0x885d('0x21')]);_0x1dda46['offset']=qs['offset'](_0x13948c['query']['offset']);}_0x1dda46[_0x885d('0x3b')]=qs[_0x885d('0x3c')](_0x13948c['query'][_0x885d('0x3c')]);_0x1dda46['where']=qs[_0x885d('0x33')](_[_0x885d('0x3d')](_0x13948c[_0x885d('0x32')],_0x17fde0[_0x885d('0x33')]),_0x1f7120);if(_0x13948c[_0x885d('0x32')][_0x885d('0x3e')]){_0x1dda46[_0x885d('0x3f')]=_['merge'](_0x1dda46['where'],{'$or':_[_0x885d('0x2d')](_0x1f7120,function(_0x55c13a){if(_0x55c13a[_0x885d('0x40')]!=='VIRTUAL'){var _0x4cb0ad={};_0x4cb0ad[_0x55c13a[_0x885d('0x2c')]]={'$like':'%'+_0x13948c[_0x885d('0x32')][_0x885d('0x3e')]+'%'};return _0x4cb0ad;}})});}_0x1dda46=_[_0x885d('0x41')]({},_0x1dda46,_0x13948c[_0x885d('0x42')]);var _0x4586ec={'where':_0x1dda46[_0x885d('0x3f')]};return db[_0x885d('0x2e')][_0x885d('0x1f')](_0x4586ec)[_0x885d('0x27')](function(_0x11aebf){_0x34c415[_0x885d('0x1f')]=_0x11aebf;if(_0x13948c[_0x885d('0x32')][_0x885d('0x43')]){_0x1dda46[_0x885d('0x44')]=[{'all':!![]}];}return db[_0x885d('0x2e')]['findAll'](_0x1dda46);})[_0x885d('0x27')](function(_0x2d26c7){_0x34c415[_0x885d('0x45')]=_0x2d26c7;return _0x34c415;})['then'](respondWithFilteredResult(_0x4cd7fb,_0x1dda46))['catch'](handleError(_0x4cd7fb,null));};exports[_0x885d('0x46')]=function(_0xab3875,_0x3a85f8){var _0x20af5d={'raw':!![],'where':{'id':_0xab3875['params']['id']}},_0x2f4e91={};_0x2f4e91[_0x885d('0x35')]=_['keys'](db[_0x885d('0x2e')][_0x885d('0x47')]);_0x2f4e91['query']=_[_0x885d('0x31')](_0xab3875['query']);_0x2f4e91[_0x885d('0x33')]=_[_0x885d('0x34')](_0x2f4e91['model'],_0x2f4e91['query']);_0x20af5d[_0x885d('0x37')]=_[_0x885d('0x34')](_0x2f4e91['model'],qs['fields'](_0xab3875['query'][_0x885d('0x36')]));_0x20af5d[_0x885d('0x37')]=_0x20af5d[_0x885d('0x37')][_0x885d('0x38')]?_0x20af5d['attributes']:_0x2f4e91[_0x885d('0x35')];if(_0xab3875[_0x885d('0x32')][_0x885d('0x43')]){_0x20af5d[_0x885d('0x44')]=[{'all':!![]}];}_0x20af5d=_[_0x885d('0x41')]({},_0x20af5d,_0xab3875[_0x885d('0x42')]);return db[_0x885d('0x2e')][_0x885d('0x48')](_0x20af5d)['then'](handleEntityNotFound(_0x3a85f8,null))[_0x885d('0x27')](respondWithResult(_0x3a85f8,null))[_0x885d('0x49')](handleError(_0x3a85f8,null));};exports['create']=function(_0x13aa42,_0x8c63c8){return db[_0x885d('0x2e')]['create'](_0x13aa42['body'],{})[_0x885d('0x27')](respondWithResult(_0x8c63c8,0xc9))[_0x885d('0x49')](handleError(_0x8c63c8,null));};exports[_0x885d('0x26')]=function(_0x45b183,_0x185d65){if(_0x45b183[_0x885d('0x4a')]['id']){delete _0x45b183[_0x885d('0x4a')]['id'];}return db[_0x885d('0x2e')]['find']({'where':{'id':_0x45b183[_0x885d('0x4b')]['id']}})[_0x885d('0x27')](handleEntityNotFound(_0x185d65,null))[_0x885d('0x27')](saveUpdates(_0x45b183['body'],null))['then'](respondWithResult(_0x185d65,null))[_0x885d('0x49')](handleError(_0x185d65,null));};exports[_0x885d('0x28')]=function(_0x2ea0c0,_0x46eeb0){return db[_0x885d('0x2e')][_0x885d('0x48')]({'where':{'id':_0x2ea0c0[_0x885d('0x4b')]['id']}})[_0x885d('0x27')](handleEntityNotFound(_0x46eeb0,null))[_0x885d('0x27')](removeEntity(_0x46eeb0,null))[_0x885d('0x49')](handleError(_0x46eeb0,null));};exports[_0x885d('0x4c')]=function(_0x4dde74,_0x3754e5){return db[_0x885d('0x2e')][_0x885d('0x4c')]()[_0x885d('0x27')](respondWithResult(_0x3754e5,null))['catch'](handleError(_0x3754e5,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index cc1753d..2646611 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 _0x1ccf=['uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','report_openchannel_transfer'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0x1ccf,0xfe));var _0xf1cc=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x1ccf[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xf1cc('0x0'));var util=require('util');var logger=require(_0xf1cc('0x1'))(_0xf1cc('0x2'));var moment=require('moment');var BPromise=require(_0xf1cc('0x3'));var rp=require(_0xf1cc('0x4'));var fs=require('fs');var path=require(_0xf1cc('0x5'));var rimraf=require(_0xf1cc('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0xf1cc('0x7')]=function(_0x3ad534,_0x1a696f){return _0x3ad534[_0xf1cc('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0xf1cc('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf1cc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x058d=['report_openchannel_transfer','uniqueid','lodash','util','api','bluebird','request-promise','rimraf','./openchannelTransferReport.attributes','define','OpenchannelTransferReport'];(function(_0x15f4a5,_0x300fa0){var _0x37d6f2=function(_0x11d037){while(--_0x11d037){_0x15f4a5['push'](_0x15f4a5['shift']());}};_0x37d6f2(++_0x300fa0);}(_0x058d,0x12b));var _0xd058=function(_0xfdad2,_0xc049d8){_0xfdad2=_0xfdad2-0x0;var _0x12b23d=_0x058d[_0xfdad2];return _0x12b23d;};'use strict';var _=require(_0xd058('0x0'));var util=require(_0xd058('0x1'));var logger=require('../../config/logger')(_0xd058('0x2'));var moment=require('moment');var BPromise=require(_0xd058('0x3'));var rp=require(_0xd058('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd058('0x5'));var config=require('../../config/environment');var attributes=require(_0xd058('0x6'));module['exports']=function(_0x3278ad,_0x447f4d){return _0x3278ad[_0xd058('0x7')](_0xd058('0x8'),attributes,{'tableName':_0xd058('0x9'),'paranoid':![],'indexes':[{'name':_0xd058('0xa'),'fields':[_0xd058('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 20f0c2b..d8005a8 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 _0xb7f0=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0xb7f0,0x1c7));var _0x0b7f=function(_0x349a9e,_0x473cb8){_0x349a9e=_0x349a9e-0x0;var _0x24c207=_0xb7f0[_0x349a9e];return _0x24c207;};'use strict';var _=require(_0x0b7f('0x0'));var util=require(_0x0b7f('0x1'));var moment=require(_0x0b7f('0x2'));var BPromise=require(_0x0b7f('0x3'));var rs=require(_0x0b7f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b7f('0x5'))['db'];var utils=require(_0x0b7f('0x6'));var logger=require(_0x0b7f('0x7'))(_0x0b7f('0x8'));var config=require(_0x0b7f('0x9'));var jayson=require(_0x0b7f('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x40ca13,_0x4913a5,_0x47f10c){return new BPromise(function(_0x5aea3e,_0x2203b9){return client[_0x0b7f('0xb')](_0x40ca13,_0x47f10c)[_0x0b7f('0xc')](function(_0x393680){logger[_0x0b7f('0xd')](_0x0b7f('0xe'),_0x4913a5,_0x0b7f('0xf'));logger[_0x0b7f('0x10')](_0x0b7f('0x11'),_0x4913a5,_0x0b7f('0xf'),JSON[_0x0b7f('0x12')](_0x393680));if(_0x393680['error']){if(_0x393680[_0x0b7f('0x13')][_0x0b7f('0x14')]===0x1f4){logger[_0x0b7f('0x13')](_0x0b7f('0xe'),_0x4913a5,_0x393680[_0x0b7f('0x13')]['message']);return _0x2203b9(_0x393680[_0x0b7f('0x13')][_0x0b7f('0x15')]);}logger[_0x0b7f('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4913a5,_0x393680['error'][_0x0b7f('0x15')]);return _0x5aea3e(_0x393680[_0x0b7f('0x13')]['message']);}else{logger[_0x0b7f('0xd')](_0x0b7f('0xe'),_0x4913a5,_0x0b7f('0xf'));_0x5aea3e(_0x393680[_0x0b7f('0x16')][_0x0b7f('0x15')]);}})['catch'](function(_0x53260a){logger[_0x0b7f('0x13')](_0x0b7f('0xe'),_0x4913a5,_0x53260a);_0x2203b9(_0x53260a);});});} \ No newline at end of file +var _0x4044=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x394fa5,_0xff5089){var _0x2def23=function(_0x3edc53){while(--_0x3edc53){_0x394fa5['push'](_0x394fa5['shift']());}};_0x2def23(++_0xff5089);}(_0x4044,0xcb));var _0x4404=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4044[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x4404('0x0'));var util=require(_0x4404('0x1'));var moment=require(_0x4404('0x2'));var BPromise=require(_0x4404('0x3'));var rs=require(_0x4404('0x4'));var fs=require('fs');var Redis=require(_0x4404('0x5'));var db=require(_0x4404('0x6'))['db'];var utils=require(_0x4404('0x7'));var logger=require(_0x4404('0x8'))(_0x4404('0x9'));var config=require(_0x4404('0xa'));var jayson=require(_0x4404('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x110490,_0x3e6249,_0x50c7de){return new BPromise(function(_0x7cd5a5,_0x322fa1){return client[_0x4404('0xc')](_0x110490,_0x50c7de)[_0x4404('0xd')](function(_0x719466){logger[_0x4404('0xe')](_0x4404('0xf'),_0x3e6249,_0x4404('0x10'));logger[_0x4404('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x3e6249,_0x4404('0x10'),JSON[_0x4404('0x12')](_0x719466));if(_0x719466[_0x4404('0x13')]){if(_0x719466['error'][_0x4404('0x14')]===0x1f4){logger[_0x4404('0x13')](_0x4404('0xf'),_0x3e6249,_0x719466[_0x4404('0x13')][_0x4404('0x15')]);return _0x322fa1(_0x719466[_0x4404('0x13')][_0x4404('0x15')]);}logger[_0x4404('0x13')](_0x4404('0xf'),_0x3e6249,_0x719466[_0x4404('0x13')][_0x4404('0x15')]);return _0x7cd5a5(_0x719466[_0x4404('0x13')][_0x4404('0x15')]);}else{logger[_0x4404('0xe')](_0x4404('0xf'),_0x3e6249,_0x4404('0x10'));_0x7cd5a5(_0x719466['result'][_0x4404('0x15')]);}})[_0x4404('0x16')](function(_0x444d05){logger[_0x4404('0x13')](_0x4404('0xf'),_0x3e6249,_0x444d05);_0x322fa1(_0x444d05);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index a08fcd3..f8d27de 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 _0x3d27=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','post','create','put','update','delete','/:id','destroy'];(function(_0x4045f3,_0x555e1d){var _0x588eb2=function(_0x598014){while(--_0x598014){_0x4045f3['push'](_0x4045f3['shift']());}};_0x588eb2(++_0x555e1d);}(_0x3d27,0x1a0));var _0x73d2=function(_0x59145a,_0x1f60f1){_0x59145a=_0x59145a-0x0;var _0xf04d7=_0x3d27[_0x59145a];return _0xf04d7;};'use strict';var multer=require(_0x73d2('0x0'));var util=require(_0x73d2('0x1'));var path=require('path');var timeout=require(_0x73d2('0x2'));var express=require(_0x73d2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x73d2('0x4'));var interaction=require(_0x73d2('0x5'));var config=require('../../config/environment');var controller=require('./pause.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x73d2('0x6')]('/:id',auth[_0x73d2('0x7')](),controller[_0x73d2('0x8')]);router[_0x73d2('0x9')]('/',auth['isAuthenticated'](),controller[_0x73d2('0xa')]);router[_0x73d2('0xb')]('/:id',auth[_0x73d2('0x7')](),controller[_0x73d2('0xc')]);router[_0x73d2('0xd')](_0x73d2('0xe'),auth[_0x73d2('0x7')](),controller[_0x73d2('0xf')]);module['exports']=router; \ No newline at end of file +var _0xfc18=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','index'];(function(_0x37fb65,_0x5ea982){var _0x594307=function(_0x3b0fd7){while(--_0x3b0fd7){_0x37fb65['push'](_0x37fb65['shift']());}};_0x594307(++_0x5ea982);}(_0xfc18,0x100));var _0x8fc1=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xfc18[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0x8fc1('0x0'));var util=require('util');var path=require(_0x8fc1('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fc1('0x2'));var router=express[_0x8fc1('0x3')]();var fs_extra=require(_0x8fc1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8fc1('0x5'));var config=require(_0x8fc1('0x6'));var controller=require(_0x8fc1('0x7'));router[_0x8fc1('0x8')]('/',auth['isAuthenticated'](),controller[_0x8fc1('0x9')]);router[_0x8fc1('0x8')](_0x8fc1('0xa'),auth['isAuthenticated'](),controller[_0x8fc1('0xb')]);router[_0x8fc1('0xc')]('/',auth[_0x8fc1('0xd')](),controller[_0x8fc1('0xe')]);router[_0x8fc1('0xf')](_0x8fc1('0xa'),auth[_0x8fc1('0xd')](),controller[_0x8fc1('0x10')]);router[_0x8fc1('0x11')](_0x8fc1('0xa'),auth[_0x8fc1('0xd')](),controller[_0x8fc1('0x12')]);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 c13ecde..3fc9e33 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 _0xa1b7=['exports','STRING','name','sequelize'];(function(_0x489fe3,_0x5ebb81){var _0x592190=function(_0x1612a7){while(--_0x1612a7){_0x489fe3['push'](_0x489fe3['shift']());}};_0x592190(++_0x5ebb81);}(_0xa1b7,0x1c3));var _0x7a1b=function(_0x4da769,_0x1b55ee){_0x4da769=_0x4da769-0x0;var _0x390b23=_0xa1b7[_0x4da769];return _0x390b23;};'use strict';var Sequelize=require(_0x7a1b('0x0'));module[_0x7a1b('0x1')]={'name':{'type':Sequelize[_0x7a1b('0x2')],'unique':_0x7a1b('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x38a1=['sequelize','STRING'];(function(_0x176947,_0x591cb4){var _0x5360a4=function(_0x2f5072){while(--_0x2f5072){_0x176947['push'](_0x176947['shift']());}};_0x5360a4(++_0x591cb4);}(_0x38a1,0x86));var _0x138a=function(_0x4db6b9,_0x245168){_0x4db6b9=_0x4db6b9-0x0;var _0x363eda=_0x38a1[_0x4db6b9];return _0x363eda;};'use strict';var Sequelize=require(_0x138a('0x0'));module['exports']={'name':{'type':Sequelize[_0x138a('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x138a('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 804b920..954216e 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 _0x00bb=['show','params','length','options','find','user','UserProfileSection','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','save','update','then','destroy','get','Pauses','UserProfileResource','end','error','stack','name','send','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch'];(function(_0x4ccf7f,_0x161ffd){var _0x1953f0=function(_0xfd2ca6){while(--_0xfd2ca6){_0x4ccf7f['push'](_0x4ccf7f['shift']());}};_0x1953f0(++_0x161ffd);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x00bb[_0x4baae2];return _0x1a2285;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=_0x9b471e[_0xb00b('0x18')],_0x51d136=_0x5da36b[_0xb00b('0x19')],_0x1f9c78=_0x5da36b['offset']+_0x5da36b[_0xb00b('0x1a')],_0x638443;if(_0x1f9c78>=_0x4dcd45){_0x1f9c78=_0x4dcd45;_0x638443=0xc8;}else{_0x638443=0xce;}_0x540b79['status'](_0x638443);return _0x540b79[_0xb00b('0x1b')]('Content-Range',_0x51d136+'-'+_0x1f9c78+'/'+_0x4dcd45)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x5e8d7b){return function(_0xb26ebb){try{jsonpatch[_0xb00b('0x1c')](_0xb26ebb,_0x5e8d7b,!![]);}catch(_0x53ee68){return BPromise['reject'](_0x53ee68);}return _0xb26ebb[_0xb00b('0x1d')]();};}function saveUpdates(_0x4a334b,_0x1344c4){return function(_0x43da66){if(_0x43da66){return _0x43da66[_0xb00b('0x1e')](_0x4a334b)[_0xb00b('0x1f')](function(_0x56c189){return _0x56c189;});}return null;};}function removeEntity(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x20')]()['then'](function(){var _0x231293=_0x25a973[_0xb00b('0x21')]({'plain':!![]});var _0x520444=_0xb00b('0x22');return db[_0xb00b('0x23')]['destroy']({'where':{'type':_0x520444,'resourceId':_0x231293['id']}})[_0xb00b('0x1f')](function(){return _0x25a973;});})[_0xb00b('0x1f')](function(){_0x362ee0[_0xb00b('0x16')](0xcc)[_0xb00b('0x24')]();});}};}function handleEntityNotFound(_0x520e55,_0x50be6c){return function(_0x3785e9){if(!_0x3785e9){_0x520e55['sendStatus'](0x194);}return _0x3785e9;};}function handleError(_0x550587,_0x4a635e){_0x4a635e=_0x4a635e||0x1f4;return function(_0x16ac55){logger[_0xb00b('0x25')](_0x16ac55[_0xb00b('0x26')]);if(_0x16ac55[_0xb00b('0x27')]){delete _0x16ac55[_0xb00b('0x27')];}_0x550587[_0xb00b('0x16')](_0x4a635e)[_0xb00b('0x28')](_0x16ac55);};}exports['index']=function(_0x22c22d,_0x503c9c){var _0x450129={},_0x348165={},_0x5424ca={'count':0x0,'rows':[]};var _0x5b987e=_[_0xb00b('0x29')](db[_0xb00b('0x2a')][_0xb00b('0x2b')],function(_0x183233){return{'name':_0x183233[_0xb00b('0x2c')],'type':_0x183233[_0xb00b('0x2d')][_0xb00b('0x2e')]};});_0x348165[_0xb00b('0x2f')]=_[_0xb00b('0x29')](_0x5b987e,'name');_0x348165[_0xb00b('0x30')]=_[_0xb00b('0x31')](_0x22c22d['query']);_0x348165[_0xb00b('0x32')]=_[_0xb00b('0x33')](_0x348165['model'],_0x348165[_0xb00b('0x30')]);_0x450129['attributes']=_[_0xb00b('0x33')](_0x348165[_0xb00b('0x2f')],qs[_0xb00b('0x34')](_0x22c22d[_0xb00b('0x30')][_0xb00b('0x34')]));_0x450129[_0xb00b('0x35')]=_0x450129[_0xb00b('0x35')]['length']?_0x450129['attributes']:_0x348165['model'];if(!_0x22c22d[_0xb00b('0x30')][_0xb00b('0x36')](_0xb00b('0x37'))){_0x450129[_0xb00b('0x1a')]=qs['limit'](_0x22c22d[_0xb00b('0x30')][_0xb00b('0x1a')]);_0x450129[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x22c22d[_0xb00b('0x30')][_0xb00b('0x19')]);}_0x450129[_0xb00b('0x38')]=qs[_0xb00b('0x39')](_0x22c22d['query']['sort']);_0x450129[_0xb00b('0x3a')]=qs['filters'](_[_0xb00b('0x3b')](_0x22c22d[_0xb00b('0x30')],_0x348165[_0xb00b('0x32')]),_0x5b987e);if(_0x22c22d[_0xb00b('0x30')][_0xb00b('0x3c')]){_0x450129[_0xb00b('0x3a')]=_[_0xb00b('0x3d')](_0x450129['where'],{'$or':_[_0xb00b('0x29')](_0x5b987e,function(_0x25578e){if(_0x25578e[_0xb00b('0x2d')]!==_0xb00b('0x3e')){var _0x2496e2={};_0x2496e2[_0x25578e[_0xb00b('0x27')]]={'$like':'%'+_0x22c22d['query'][_0xb00b('0x3c')]+'%'};return _0x2496e2;}})});}_0x450129=_[_0xb00b('0x3d')]({},_0x450129,_0x22c22d['options']);var _0x17ff34={'where':_0x450129[_0xb00b('0x3a')]};return db[_0xb00b('0x2a')][_0xb00b('0x18')](_0x17ff34)[_0xb00b('0x1f')](function(_0x5636b1){_0x5424ca[_0xb00b('0x18')]=_0x5636b1;if(_0x22c22d[_0xb00b('0x30')][_0xb00b('0x3f')]){_0x450129[_0xb00b('0x40')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x450129);})[_0xb00b('0x1f')](function(_0xf6ae0c){_0x5424ca[_0xb00b('0x41')]=_0xf6ae0c;return _0x5424ca;})[_0xb00b('0x1f')](respondWithFilteredResult(_0x503c9c,_0x450129))[_0xb00b('0x42')](handleError(_0x503c9c,null));};exports[_0xb00b('0x43')]=function(_0x275664,_0x493841){var _0x36200d={'raw':!![],'where':{'id':_0x275664[_0xb00b('0x44')]['id']}},_0x3b72c4={};_0x3b72c4[_0xb00b('0x2f')]=_[_0xb00b('0x31')](db[_0xb00b('0x2a')][_0xb00b('0x2b')]);_0x3b72c4[_0xb00b('0x30')]=_[_0xb00b('0x31')](_0x275664[_0xb00b('0x30')]);_0x3b72c4[_0xb00b('0x32')]=_[_0xb00b('0x33')](_0x3b72c4['model'],_0x3b72c4[_0xb00b('0x30')]);_0x36200d[_0xb00b('0x35')]=_[_0xb00b('0x33')](_0x3b72c4[_0xb00b('0x2f')],qs[_0xb00b('0x34')](_0x275664[_0xb00b('0x30')][_0xb00b('0x34')]));_0x36200d[_0xb00b('0x35')]=_0x36200d[_0xb00b('0x35')][_0xb00b('0x45')]?_0x36200d[_0xb00b('0x35')]:_0x3b72c4[_0xb00b('0x2f')];if(_0x275664['query']['includeAll']){_0x36200d['include']=[{'all':!![]}];}_0x36200d=_[_0xb00b('0x3d')]({},_0x36200d,_0x275664[_0xb00b('0x46')]);return db['Pause'][_0xb00b('0x47')](_0x36200d)[_0xb00b('0x1f')](handleEntityNotFound(_0x493841,null))[_0xb00b('0x1f')](respondWithResult(_0x493841,null))[_0xb00b('0x42')](handleError(_0x493841,null));};exports['create']=function(_0x58e9cb,_0x172729){return db[_0xb00b('0x2a')]['create'](_0x58e9cb['body'],{})[_0xb00b('0x1f')](function(_0x3a205d){var _0x4e0be4=_0x58e9cb[_0xb00b('0x48')]['get']({'plain':!![]});if(!_0x4e0be4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e0be4['role']===_0xb00b('0x48')){var _0x481515=_0x3a205d[_0xb00b('0x21')]({'plain':!![]});var _0x3178aa=_0xb00b('0x22');return db[_0xb00b('0x49')][_0xb00b('0x47')]({'where':{'name':_0x3178aa,'userProfileId':_0x4e0be4[_0xb00b('0x4a')]},'raw':!![]})['then'](function(_0x5bd40c){if(_0x5bd40c&&_0x5bd40c[_0xb00b('0x4b')]===0x0){return db[_0xb00b('0x23')]['create']({'name':_0x481515[_0xb00b('0x27')],'resourceId':_0x481515['id'],'type':_0x5bd40c[_0xb00b('0x27')],'sectionId':_0x5bd40c['id']},{})['then'](function(){return _0x3a205d;});}else{return _0x3a205d;}})[_0xb00b('0x42')](function(_0x10e066){logger[_0xb00b('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10e066);throw _0x10e066;});}return _0x3a205d;})['then'](respondWithResult(_0x172729,0xc9))[_0xb00b('0x42')](handleError(_0x172729,null));};exports[_0xb00b('0x1e')]=function(_0x12737d,_0xde3cc1){if(_0x12737d['body']['id']){delete _0x12737d[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x2a')]['find']({'where':{'id':_0x12737d['params']['id']}})[_0xb00b('0x1f')](handleEntityNotFound(_0xde3cc1,null))['then'](saveUpdates(_0x12737d[_0xb00b('0x4c')],null))[_0xb00b('0x1f')](respondWithResult(_0xde3cc1,null))[_0xb00b('0x42')](handleError(_0xde3cc1,null));};exports[_0xb00b('0x20')]=function(_0x450ce7,_0x2965ca){return db['Pause'][_0xb00b('0x47')]({'where':{'id':_0x450ce7['params']['id']}})[_0xb00b('0x1f')](handleEntityNotFound(_0x2965ca,null))[_0xb00b('0x1f')](removeEntity(_0x2965ca,null))[_0xb00b('0x42')](handleError(_0x2965ca,null));}; \ No newline at end of file +var _0x16d8=['request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','get','Pauses','UserProfileResource','destroy','sendStatus','error','stack','name','map','Pause','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x16d8,0xa3));var _0x816d=function(_0xd814f0,_0x1c6ee1){_0xd814f0=_0xd814f0-0x0;var _0x2cd084=_0x16d8[_0xd814f0];return _0x2cd084;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x816d('0x0'));var zipdir=require(_0x816d('0x1'));var jsonpatch=require(_0x816d('0x2'));var rp=require(_0x816d('0x3'));var moment=require(_0x816d('0x4'));var BPromise=require(_0x816d('0x5'));var Mustache=require(_0x816d('0x6'));var util=require(_0x816d('0x7'));var path=require(_0x816d('0x8'));var sox=require('sox');var csv=require(_0x816d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x816d('0xa'));var _=require(_0x816d('0xb'));var squel=require(_0x816d('0xc'));var crypto=require(_0x816d('0xd'));var jsforce=require(_0x816d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x816d('0x9'));var querystring=require(_0x816d('0xf'));var Papa=require(_0x816d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x816d('0x11'));var hardwareService=require(_0x816d('0x12'));var logger=require(_0x816d('0x13'))(_0x816d('0x14'));var utils=require('../../config/utils');var config=require(_0x816d('0x15'));var licenseUtil=require(_0x816d('0x16'));var db=require(_0x816d('0x17'))['db'];function respondWithStatusCode(_0x58de02,_0x45dfa4){_0x45dfa4=_0x45dfa4||0xcc;return function(_0x10cc6f){if(_0x10cc6f){return _0x58de02['sendStatus'](_0x45dfa4);}return _0x58de02[_0x816d('0x18')](_0x45dfa4)[_0x816d('0x19')]();};}function respondWithResult(_0x58f22b,_0xc9a9c7){_0xc9a9c7=_0xc9a9c7||0xc8;return function(_0x3a50c8){if(_0x3a50c8){return _0x58f22b['status'](_0xc9a9c7)[_0x816d('0x1a')](_0x3a50c8);}};}function respondWithFilteredResult(_0xa2c0f,_0x2f3564){return function(_0x1ac493){if(_0x1ac493){var _0x61942=_0x1ac493[_0x816d('0x1b')],_0x212d20=_0x2f3564['offset'],_0x63847c=_0x2f3564[_0x816d('0x1c')]+_0x2f3564[_0x816d('0x1d')],_0x2a1be1;if(_0x63847c>=_0x61942){_0x63847c=_0x61942;_0x2a1be1=0xc8;}else{_0x2a1be1=0xce;}_0xa2c0f[_0x816d('0x18')](_0x2a1be1);return _0xa2c0f['set'](_0x816d('0x1e'),_0x212d20+'-'+_0x63847c+'/'+_0x61942)[_0x816d('0x1a')](_0x1ac493);}return null;};}function patchUpdates(_0x7176b0){return function(_0x8bea23){try{jsonpatch[_0x816d('0x1f')](_0x8bea23,_0x7176b0,!![]);}catch(_0x46011d){return BPromise['reject'](_0x46011d);}return _0x8bea23[_0x816d('0x20')]();};}function saveUpdates(_0x3187b8,_0x11ff2b){return function(_0x170235){if(_0x170235){return _0x170235[_0x816d('0x21')](_0x3187b8)[_0x816d('0x22')](function(_0x1d7cac){return _0x1d7cac;});}return null;};}function removeEntity(_0x3b57dc,_0x5a15b1){return function(_0x430009){if(_0x430009){return _0x430009['destroy']()[_0x816d('0x22')](function(){var _0x2d4ff2=_0x430009[_0x816d('0x23')]({'plain':!![]});var _0x22ee4c=_0x816d('0x24');return db[_0x816d('0x25')][_0x816d('0x26')]({'where':{'type':_0x22ee4c,'resourceId':_0x2d4ff2['id']}})[_0x816d('0x22')](function(){return _0x430009;});})[_0x816d('0x22')](function(){_0x3b57dc[_0x816d('0x18')](0xcc)[_0x816d('0x19')]();});}};}function handleEntityNotFound(_0xf79dfd,_0x32f944){return function(_0x8bdca7){if(!_0x8bdca7){_0xf79dfd[_0x816d('0x27')](0x194);}return _0x8bdca7;};}function handleError(_0x19e167,_0x2da33b){_0x2da33b=_0x2da33b||0x1f4;return function(_0x579edb){logger[_0x816d('0x28')](_0x579edb[_0x816d('0x29')]);if(_0x579edb[_0x816d('0x2a')]){delete _0x579edb[_0x816d('0x2a')];}_0x19e167[_0x816d('0x18')](_0x2da33b)['send'](_0x579edb);};}exports['index']=function(_0x5f3e4f,_0x45cd32){var _0x431378={},_0x2de6eb={},_0x5a1f24={'count':0x0,'rows':[]};var _0x28db05=_[_0x816d('0x2b')](db[_0x816d('0x2c')][_0x816d('0x2d')],function(_0x548734){return{'name':_0x548734[_0x816d('0x2e')],'type':_0x548734[_0x816d('0x2f')][_0x816d('0x30')]};});_0x2de6eb['model']=_['map'](_0x28db05,'name');_0x2de6eb['query']=_[_0x816d('0x31')](_0x5f3e4f['query']);_0x2de6eb[_0x816d('0x32')]=_[_0x816d('0x33')](_0x2de6eb[_0x816d('0x34')],_0x2de6eb[_0x816d('0x35')]);_0x431378[_0x816d('0x36')]=_['intersection'](_0x2de6eb['model'],qs[_0x816d('0x37')](_0x5f3e4f[_0x816d('0x35')][_0x816d('0x37')]));_0x431378['attributes']=_0x431378[_0x816d('0x36')][_0x816d('0x38')]?_0x431378[_0x816d('0x36')]:_0x2de6eb[_0x816d('0x34')];if(!_0x5f3e4f['query'][_0x816d('0x39')](_0x816d('0x3a'))){_0x431378[_0x816d('0x1d')]=qs[_0x816d('0x1d')](_0x5f3e4f[_0x816d('0x35')]['limit']);_0x431378[_0x816d('0x1c')]=qs[_0x816d('0x1c')](_0x5f3e4f[_0x816d('0x35')][_0x816d('0x1c')]);}_0x431378[_0x816d('0x3b')]=qs[_0x816d('0x3c')](_0x5f3e4f[_0x816d('0x35')]['sort']);_0x431378[_0x816d('0x3d')]=qs[_0x816d('0x32')](_[_0x816d('0x3e')](_0x5f3e4f[_0x816d('0x35')],_0x2de6eb[_0x816d('0x32')]),_0x28db05);if(_0x5f3e4f[_0x816d('0x35')][_0x816d('0x3f')]){_0x431378[_0x816d('0x3d')]=_[_0x816d('0x40')](_0x431378['where'],{'$or':_[_0x816d('0x2b')](_0x28db05,function(_0xb81152){if(_0xb81152[_0x816d('0x2f')]!==_0x816d('0x41')){var _0x51d62f={};_0x51d62f[_0xb81152[_0x816d('0x2a')]]={'$like':'%'+_0x5f3e4f[_0x816d('0x35')][_0x816d('0x3f')]+'%'};return _0x51d62f;}})});}_0x431378=_[_0x816d('0x40')]({},_0x431378,_0x5f3e4f[_0x816d('0x42')]);var _0x1b2787={'where':_0x431378[_0x816d('0x3d')]};return db[_0x816d('0x2c')][_0x816d('0x1b')](_0x1b2787)[_0x816d('0x22')](function(_0x59f168){_0x5a1f24['count']=_0x59f168;if(_0x5f3e4f[_0x816d('0x35')][_0x816d('0x43')]){_0x431378[_0x816d('0x44')]=[{'all':!![]}];}return db[_0x816d('0x2c')][_0x816d('0x45')](_0x431378);})[_0x816d('0x22')](function(_0x162e58){_0x5a1f24[_0x816d('0x46')]=_0x162e58;return _0x5a1f24;})['then'](respondWithFilteredResult(_0x45cd32,_0x431378))['catch'](handleError(_0x45cd32,null));};exports[_0x816d('0x47')]=function(_0x430f04,_0x4261bd){var _0x2ec82b={'raw':!![],'where':{'id':_0x430f04[_0x816d('0x48')]['id']}},_0x21cbbc={};_0x21cbbc[_0x816d('0x34')]=_[_0x816d('0x31')](db[_0x816d('0x2c')][_0x816d('0x2d')]);_0x21cbbc[_0x816d('0x35')]=_[_0x816d('0x31')](_0x430f04[_0x816d('0x35')]);_0x21cbbc[_0x816d('0x32')]=_[_0x816d('0x33')](_0x21cbbc[_0x816d('0x34')],_0x21cbbc[_0x816d('0x35')]);_0x2ec82b[_0x816d('0x36')]=_[_0x816d('0x33')](_0x21cbbc[_0x816d('0x34')],qs[_0x816d('0x37')](_0x430f04[_0x816d('0x35')][_0x816d('0x37')]));_0x2ec82b[_0x816d('0x36')]=_0x2ec82b[_0x816d('0x36')]['length']?_0x2ec82b[_0x816d('0x36')]:_0x21cbbc[_0x816d('0x34')];if(_0x430f04['query']['includeAll']){_0x2ec82b[_0x816d('0x44')]=[{'all':!![]}];}_0x2ec82b=_['merge']({},_0x2ec82b,_0x430f04[_0x816d('0x42')]);return db[_0x816d('0x2c')][_0x816d('0x49')](_0x2ec82b)[_0x816d('0x22')](handleEntityNotFound(_0x4261bd,null))[_0x816d('0x22')](respondWithResult(_0x4261bd,null))[_0x816d('0x4a')](handleError(_0x4261bd,null));};exports['create']=function(_0x557c56,_0x4ba4aa){return db['Pause'][_0x816d('0x4b')](_0x557c56[_0x816d('0x4c')],{})['then'](function(_0x10148d){var _0x5071e3=_0x557c56[_0x816d('0x4d')][_0x816d('0x23')]({'plain':!![]});if(!_0x5071e3)throw new Error(_0x816d('0x4e'));if(_0x5071e3[_0x816d('0x4f')]===_0x816d('0x4d')){var _0x35738c=_0x10148d[_0x816d('0x23')]({'plain':!![]});var _0x409e2b='Pauses';return db['UserProfileSection'][_0x816d('0x49')]({'where':{'name':_0x409e2b,'userProfileId':_0x5071e3[_0x816d('0x50')]},'raw':!![]})[_0x816d('0x22')](function(_0x1cdf0d){if(_0x1cdf0d&&_0x1cdf0d[_0x816d('0x51')]===0x0){return db['UserProfileResource'][_0x816d('0x4b')]({'name':_0x35738c['name'],'resourceId':_0x35738c['id'],'type':_0x1cdf0d[_0x816d('0x2a')],'sectionId':_0x1cdf0d['id']},{})[_0x816d('0x22')](function(){return _0x10148d;});}else{return _0x10148d;}})['catch'](function(_0x5479fb){logger['error'](_0x816d('0x52'),_0x5479fb);throw _0x5479fb;});}return _0x10148d;})[_0x816d('0x22')](respondWithResult(_0x4ba4aa,0xc9))['catch'](handleError(_0x4ba4aa,null));};exports[_0x816d('0x21')]=function(_0x26cf1d,_0x1dda09){if(_0x26cf1d[_0x816d('0x4c')]['id']){delete _0x26cf1d[_0x816d('0x4c')]['id'];}return db[_0x816d('0x2c')][_0x816d('0x49')]({'where':{'id':_0x26cf1d[_0x816d('0x48')]['id']}})[_0x816d('0x22')](handleEntityNotFound(_0x1dda09,null))['then'](saveUpdates(_0x26cf1d[_0x816d('0x4c')],null))[_0x816d('0x22')](respondWithResult(_0x1dda09,null))[_0x816d('0x4a')](handleError(_0x1dda09,null));};exports['destroy']=function(_0x510e2e,_0x104c69){return db[_0x816d('0x2c')][_0x816d('0x49')]({'where':{'id':_0x510e2e[_0x816d('0x48')]['id']}})[_0x816d('0x22')](handleEntityNotFound(_0x104c69,null))[_0x816d('0x22')](removeEntity(_0x104c69,null))[_0x816d('0x4a')](handleError(_0x104c69,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 638c80b..ca2b2aa 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 _0x5a1c=['request-promise','path','rimraf','../../config/environment','exports','Pause','tools_pauses','lodash','util','moment'];(function(_0x2c22e0,_0x1e7292){var _0x4d3ae8=function(_0x109093){while(--_0x109093){_0x2c22e0['push'](_0x2c22e0['shift']());}};_0x4d3ae8(++_0x1e7292);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0xa602fd,_0x52a378){_0xa602fd=_0xa602fd-0x0;var _0xbb0bd0=_0x5a1c[_0xa602fd];return _0xbb0bd0;};'use strict';var _=require(_0xc5a1('0x0'));var util=require(_0xc5a1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc5a1('0x2'));var BPromise=require('bluebird');var rp=require(_0xc5a1('0x3'));var fs=require('fs');var path=require(_0xc5a1('0x4'));var rimraf=require(_0xc5a1('0x5'));var config=require(_0xc5a1('0x6'));var attributes=require('./pause.attributes');module[_0xc5a1('0x7')]=function(_0x3d356e,_0x1ed54a){return _0x3d356e['define'](_0xc5a1('0x8'),attributes,{'tableName':_0xc5a1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75e3=['request-promise','./pause.attributes','Pause','tools_pauses','util','../../config/logger','moment','bluebird'];(function(_0x408e7f,_0x2d8e6a){var _0xa9377d=function(_0x1c0bdd){while(--_0x1c0bdd){_0x408e7f['push'](_0x408e7f['shift']());}};_0xa9377d(++_0x2d8e6a);}(_0x75e3,0x104));var _0x375e=function(_0x2edd97,_0xee7f3d){_0x2edd97=_0x2edd97-0x0;var _0x35d7aa=_0x75e3[_0x2edd97];return _0x35d7aa;};'use strict';var _=require('lodash');var util=require(_0x375e('0x0'));var logger=require(_0x375e('0x1'))('api');var moment=require(_0x375e('0x2'));var BPromise=require(_0x375e('0x3'));var rp=require(_0x375e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x375e('0x5'));module['exports']=function(_0x17e32c,_0x52f876){return _0x17e32c['define'](_0x375e('0x6'),attributes,{'tableName':_0x375e('0x7'),'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 39ef7c9..1748a16 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 _0xaff1=['include','map','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowPause','Pause','find','options','where','attributes','model'];(function(_0x22ffed,_0x1b287a){var _0x2a5e78=function(_0x37059c){while(--_0x37059c){_0x22ffed['push'](_0x22ffed['shift']());}};_0x2a5e78(++_0x1b287a);}(_0xaff1,0x1d3));var _0x1aff=function(_0xfd9051,_0x3371fe){_0xfd9051=_0xfd9051-0x0;var _0x2cac2e=_0xaff1[_0xfd9051];return _0x2cac2e;};'use strict';var _=require('lodash');var util=require(_0x1aff('0x0'));var moment=require('moment');var BPromise=require(_0x1aff('0x1'));var rs=require(_0x1aff('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1aff('0x3'))['db'];var utils=require(_0x1aff('0x4'));var logger=require(_0x1aff('0x5'))(_0x1aff('0x6'));var config=require(_0x1aff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1aff('0x8')][_0x1aff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16574d,_0x4d587b,_0x24cd78){return new BPromise(function(_0xc186af,_0x458e33){return client[_0x1aff('0xa')](_0x16574d,_0x24cd78)[_0x1aff('0xb')](function(_0x15792d){logger[_0x1aff('0xc')](_0x1aff('0xd'),_0x4d587b,_0x1aff('0xe'));logger[_0x1aff('0xf')](_0x1aff('0x10'),_0x4d587b,'request\x20sent',JSON[_0x1aff('0x11')](_0x15792d));if(_0x15792d['error']){if(_0x15792d[_0x1aff('0x12')]['code']===0x1f4){logger[_0x1aff('0x12')](_0x1aff('0xd'),_0x4d587b,_0x15792d[_0x1aff('0x12')][_0x1aff('0x13')]);return _0x458e33(_0x15792d[_0x1aff('0x12')][_0x1aff('0x13')]);}logger[_0x1aff('0x12')](_0x1aff('0xd'),_0x4d587b,_0x15792d[_0x1aff('0x12')][_0x1aff('0x13')]);return _0xc186af(_0x15792d[_0x1aff('0x12')]['message']);}else{logger[_0x1aff('0xc')](_0x1aff('0xd'),_0x4d587b,_0x1aff('0xe'));_0xc186af(_0x15792d[_0x1aff('0x14')][_0x1aff('0x13')]);}})[_0x1aff('0x15')](function(_0x3f03e3){logger[_0x1aff('0x12')](_0x1aff('0xd'),_0x4d587b,_0x3f03e3);_0x458e33(_0x3f03e3);});});}exports[_0x1aff('0x16')]=function(_0x38e33a){var _0x3469fb=this;return new Promise(function(_0x2eee6f,_0x185e6f){return db[_0x1aff('0x17')][_0x1aff('0x18')]({'raw':_0x38e33a[_0x1aff('0x19')]?_0x38e33a['options']['raw']===undefined?!![]:![]:!![],'where':_0x38e33a[_0x1aff('0x19')]?_0x38e33a[_0x1aff('0x19')][_0x1aff('0x1a')]||null:null,'attributes':_0x38e33a['options']?_0x38e33a[_0x1aff('0x19')][_0x1aff('0x1b')]||null:null,'include':_0x38e33a[_0x1aff('0x19')]?_0x38e33a[_0x1aff('0x19')]['include']?_['map'](_0x38e33a[_0x1aff('0x19')]['include'],function(_0x57d6d6){return{'model':db[_0x57d6d6[_0x1aff('0x1c')]],'as':_0x57d6d6['as'],'attributes':_0x57d6d6[_0x1aff('0x1b')],'include':_0x57d6d6['include']?_['map'](_0x57d6d6[_0x1aff('0x1d')],function(_0x5dbe98){return{'model':db[_0x5dbe98[_0x1aff('0x1c')]],'as':_0x5dbe98['as'],'attributes':_0x5dbe98[_0x1aff('0x1b')],'include':_0x5dbe98[_0x1aff('0x1d')]?_[_0x1aff('0x1e')](_0x5dbe98[_0x1aff('0x1d')],function(_0xe3df1e){return{'model':db[_0xe3df1e['model']],'as':_0xe3df1e['as'],'attributes':_0xe3df1e['attributes']};}):[]};}):[]};}):[]:[]})[_0x1aff('0xb')](function(_0x119f11){logger['info'](_0x1aff('0x16'),_0x38e33a);logger['debug'](_0x1aff('0x16'),_0x38e33a,JSON['stringify'](_0x119f11));_0x2eee6f(_0x119f11);})[_0x1aff('0x15')](function(_0xa2a2e8){logger[_0x1aff('0x12')](_0x1aff('0x16'),_0xa2a2e8[_0x1aff('0x13')],_0x38e33a);_0x185e6f(_0x3469fb[_0x1aff('0x12')](0x1f4,_0xa2a2e8[_0x1aff('0x13')]));});});}; \ No newline at end of file +var _0x1cde=['map','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowPause','Pause','find','options','raw','where','include','model','attributes'];(function(_0x39f9ac,_0xc811cd){var _0x1efcf4=function(_0x18dca5){while(--_0x18dca5){_0x39f9ac['push'](_0x39f9ac['shift']());}};_0x1efcf4(++_0xc811cd);}(_0x1cde,0x1f1));var _0xe1cd=function(_0x1d5908,_0x2722ce){_0x1d5908=_0x1d5908-0x0;var _0x150347=_0x1cde[_0x1d5908];return _0x150347;};'use strict';var _=require('lodash');var util=require(_0xe1cd('0x0'));var moment=require(_0xe1cd('0x1'));var BPromise=require(_0xe1cd('0x2'));var rs=require(_0xe1cd('0x3'));var fs=require('fs');var Redis=require(_0xe1cd('0x4'));var db=require(_0xe1cd('0x5'))['db'];var utils=require(_0xe1cd('0x6'));var logger=require('../../config/logger')(_0xe1cd('0x7'));var config=require(_0xe1cd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe1cd('0x9')][_0xe1cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43439f,_0xc332c9,_0x41149e){return new BPromise(function(_0x1b95dd,_0x36127b){return client[_0xe1cd('0xb')](_0x43439f,_0x41149e)[_0xe1cd('0xc')](function(_0x4fc930){logger[_0xe1cd('0xd')](_0xe1cd('0xe'),_0xc332c9,_0xe1cd('0xf'));logger['debug'](_0xe1cd('0x10'),_0xc332c9,'request\x20sent',JSON[_0xe1cd('0x11')](_0x4fc930));if(_0x4fc930[_0xe1cd('0x12')]){if(_0x4fc930[_0xe1cd('0x12')]['code']===0x1f4){logger[_0xe1cd('0x12')](_0xe1cd('0xe'),_0xc332c9,_0x4fc930[_0xe1cd('0x12')][_0xe1cd('0x13')]);return _0x36127b(_0x4fc930['error'][_0xe1cd('0x13')]);}logger[_0xe1cd('0x12')](_0xe1cd('0xe'),_0xc332c9,_0x4fc930[_0xe1cd('0x12')][_0xe1cd('0x13')]);return _0x1b95dd(_0x4fc930[_0xe1cd('0x12')]['message']);}else{logger[_0xe1cd('0xd')]('Pause,\x20%s,\x20%s',_0xc332c9,_0xe1cd('0xf'));_0x1b95dd(_0x4fc930[_0xe1cd('0x14')][_0xe1cd('0x13')]);}})[_0xe1cd('0x15')](function(_0x536509){logger[_0xe1cd('0x12')](_0xe1cd('0xe'),_0xc332c9,_0x536509);_0x36127b(_0x536509);});});}exports[_0xe1cd('0x16')]=function(_0x278b6b){var _0x4bfc3f=this;return new Promise(function(_0x4c55ec,_0x2c9998){return db[_0xe1cd('0x17')][_0xe1cd('0x18')]({'raw':_0x278b6b[_0xe1cd('0x19')]?_0x278b6b['options'][_0xe1cd('0x1a')]===undefined?!![]:![]:!![],'where':_0x278b6b[_0xe1cd('0x19')]?_0x278b6b[_0xe1cd('0x19')][_0xe1cd('0x1b')]||null:null,'attributes':_0x278b6b[_0xe1cd('0x19')]?_0x278b6b[_0xe1cd('0x19')]['attributes']||null:null,'include':_0x278b6b[_0xe1cd('0x19')]?_0x278b6b[_0xe1cd('0x19')]['include']?_['map'](_0x278b6b[_0xe1cd('0x19')][_0xe1cd('0x1c')],function(_0x576308){return{'model':db[_0x576308[_0xe1cd('0x1d')]],'as':_0x576308['as'],'attributes':_0x576308['attributes'],'include':_0x576308[_0xe1cd('0x1c')]?_['map'](_0x576308['include'],function(_0x333877){return{'model':db[_0x333877['model']],'as':_0x333877['as'],'attributes':_0x333877[_0xe1cd('0x1e')],'include':_0x333877[_0xe1cd('0x1c')]?_[_0xe1cd('0x1f')](_0x333877[_0xe1cd('0x1c')],function(_0x4ad3d5){return{'model':db[_0x4ad3d5[_0xe1cd('0x1d')]],'as':_0x4ad3d5['as'],'attributes':_0x4ad3d5[_0xe1cd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe1cd('0xc')](function(_0x48b43f){logger[_0xe1cd('0xd')](_0xe1cd('0x16'),_0x278b6b);logger[_0xe1cd('0x20')](_0xe1cd('0x16'),_0x278b6b,JSON['stringify'](_0x48b43f));_0x4c55ec(_0x48b43f);})['catch'](function(_0xaf0fb){logger[_0xe1cd('0x12')](_0xe1cd('0x16'),_0xaf0fb['message'],_0x278b6b);_0x2c9998(_0x4bfc3f['error'](0x1f4,_0xaf0fb[_0xe1cd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index fb591dd..837a039 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 _0x64e8=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','download','diskStorage','join','originalname','%s-%s%s','basename','extname','post','upload','webhookPost','/:id','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x64e8,0x6f));var _0x864e=function(_0x5265d5,_0x51a837){_0x5265d5=_0x5265d5-0x0;var _0x44899d=_0x64e8[_0x5265d5];return _0x44899d;};'use strict';var multer=require(_0x864e('0x0'));var util=require(_0x864e('0x1'));var path=require(_0x864e('0x2'));var timeout=require(_0x864e('0x3'));var express=require(_0x864e('0x4'));var router=express[_0x864e('0x5')]();var fs_extra=require(_0x864e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x864e('0x7'));var config=require('../../config/environment');var controller=require('./plugin.controller');router[_0x864e('0x8')]('/',auth[_0x864e('0x9')](),controller[_0x864e('0xa')]);router[_0x864e('0x8')](_0x864e('0xb'),controller[_0x864e('0xc')]);router[_0x864e('0x8')]('/:id',auth[_0x864e('0x9')](),controller[_0x864e('0xd')]);router[_0x864e('0x8')](_0x864e('0xe'),auth['isAuthenticated'](),controller[_0x864e('0xf')]);var upload=multer({'storage':multer[_0x864e('0x10')]({'destination':function(_0x50ead4,_0x54c113,_0x3e7beb){_0x3e7beb(null,path[_0x864e('0x11')](config['root'],'server/files/plugins'));},'filename':function(_0x12dd1c,_0x624de3,_0x4080d3){_0x624de3[_0x864e('0x12')]=_0x624de3[_0x864e('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4080d3(null,util['format'](_0x864e('0x13'),path[_0x864e('0x14')](_0x624de3[_0x864e('0x12')],path[_0x864e('0x15')](_0x624de3[_0x864e('0x12')])),Date['now'](),path['extname'](_0x624de3[_0x864e('0x12')])));}})});router[_0x864e('0x16')]('/',upload['single']('file'),controller[_0x864e('0x17')]);router['post'](_0x864e('0xb'),controller[_0x864e('0x18')]);router['put'](_0x864e('0x19'),auth[_0x864e('0x9')](),controller[_0x864e('0x1a')]);router[_0x864e('0x1b')](_0x864e('0x19'),auth[_0x864e('0x9')](),controller['delete']);module[_0x864e('0x1c')]=router; \ No newline at end of file +var _0x42dd=['webhookPost','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/webhook','webhookGet','/:id','show','/:id/download','isAuthenticated','download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','upload'];(function(_0x12c280,_0x51dd07){var _0x3638d3=function(_0x53b273){while(--_0x53b273){_0x12c280['push'](_0x12c280['shift']());}};_0x3638d3(++_0x51dd07);}(_0x42dd,0xbc));var _0xd42d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x42dd[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xd42d('0x0'));var util=require(_0xd42d('0x1'));var path=require(_0xd42d('0x2'));var timeout=require(_0xd42d('0x3'));var express=require(_0xd42d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd42d('0x5'));var interaction=require(_0xd42d('0x6'));var config=require(_0xd42d('0x7'));var controller=require('./plugin.controller');router[_0xd42d('0x8')]('/',auth['isAuthenticated'](),controller[_0xd42d('0x9')]);router['get'](_0xd42d('0xa'),controller[_0xd42d('0xb')]);router[_0xd42d('0x8')](_0xd42d('0xc'),auth['isAuthenticated'](),controller[_0xd42d('0xd')]);router[_0xd42d('0x8')](_0xd42d('0xe'),auth[_0xd42d('0xf')](),controller[_0xd42d('0x10')]);var upload=multer({'storage':multer[_0xd42d('0x11')]({'destination':function(_0x409e0f,_0x426a61,_0x46109c){_0x46109c(null,path[_0xd42d('0x12')](config[_0xd42d('0x13')],_0xd42d('0x14')));},'filename':function(_0x16dad2,_0x5891ed,_0x4dc64c){_0x5891ed[_0xd42d('0x15')]=_0x5891ed['originalname'][_0xd42d('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4dc64c(null,util['format'](_0xd42d('0x17'),path[_0xd42d('0x18')](_0x5891ed[_0xd42d('0x15')],path[_0xd42d('0x19')](_0x5891ed['originalname'])),Date[_0xd42d('0x1a')](),path['extname'](_0x5891ed['originalname'])));}})});router[_0xd42d('0x1b')]('/',upload['single']('file'),controller[_0xd42d('0x1c')]);router['post'](_0xd42d('0xa'),controller[_0xd42d('0x1d')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xd42d('0xc'),auth[_0xd42d('0xf')](),controller[_0xd42d('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3a3122a..7c42daa 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 _0x91bc=['TEXT','BOOLEAN','ENUM','agentOnly','never','always','sequelize','exports','STRING','html','script'];(function(_0x540995,_0x3b1dba){var _0x2f89ba=function(_0x7bee84){while(--_0x7bee84){_0x540995['push'](_0x540995['shift']());}};_0x2f89ba(++_0x3b1dba);}(_0x91bc,0x15b));var _0xc91b=function(_0x2762fc,_0x4d21a6){_0x2762fc=_0x2762fc-0x0;var _0x1ae50b=_0x91bc[_0x2762fc];return _0x1ae50b;};'use strict';var Sequelize=require(_0xc91b('0x0'));module[_0xc91b('0x1')]={'name':{'type':Sequelize[_0xc91b('0x2')]},'type':{'type':Sequelize['ENUM'](_0xc91b('0x3'),_0xc91b('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xc91b('0x5')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xc91b('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xc91b('0x7')]('adminOnly',_0xc91b('0x8'),'always',_0xc91b('0x9')),'defaultValue':_0xc91b('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xc91b('0x2')]},'adminUrl':{'type':Sequelize[_0xc91b('0x2')]},'agentUrl':{'type':Sequelize[_0xc91b('0x2')]},'scriptName':{'type':Sequelize[_0xc91b('0x2')]},'scriptPath':{'type':Sequelize[_0xc91b('0x2')]}}; \ No newline at end of file +var _0xc50d=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','never','exports','STRING','ENUM','html','script','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc50d,0x1aa));var _0xdc50=function(_0x51bb0b,_0x55b8d4){_0x51bb0b=_0x51bb0b-0x0;var _0x87265a=_0xc50d[_0x51bb0b];return _0x87265a;};'use strict';var Sequelize=require('sequelize');module[_0xdc50('0x0')]={'name':{'type':Sequelize[_0xdc50('0x1')]},'type':{'type':Sequelize[_0xdc50('0x2')](_0xdc50('0x3'),_0xdc50('0x4'))},'description':{'type':Sequelize[_0xdc50('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0xdc50('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xdc50('0x2')]('adminOnly','agentOnly','always',_0xdc50('0x7')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xdc50('0x1')]},'adminUrl':{'type':Sequelize[_0xdc50('0x1')]},'agentUrl':{'type':Sequelize[_0xdc50('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 41d970a..13485e3 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 _0x9cc1=['localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','count','limit','apply','save','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','Plugin','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','download','join','root','format','path','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','server/files/plugins','basename','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','userProfileId','role','Zip\x20archive\x20removed','update','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x5747d5,_0x512403){var _0x539504=function(_0x397479){while(--_0x397479){_0x5747d5['push'](_0x5747d5['shift']());}};_0x539504(++_0x512403);}(_0x9cc1,0x1d5));var _0x19cc=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0x9cc1[_0x2a2166];return _0x3bcf50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x19cc('0x0'));var zipdir=require(_0x19cc('0x1'));var jsonpatch=require(_0x19cc('0x2'));var rp=require(_0x19cc('0x3'));var moment=require('moment');var BPromise=require(_0x19cc('0x4'));var Mustache=require(_0x19cc('0x5'));var util=require(_0x19cc('0x6'));var path=require('path');var sox=require(_0x19cc('0x7'));var csv=require(_0x19cc('0x8'));var ejs=require(_0x19cc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x19cc('0xa'));var squel=require(_0x19cc('0xb'));var crypto=require(_0x19cc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x19cc('0xd'));var Papa=require('papaparse');var extract=require(_0x19cc('0xe'));var rimraf=require(_0x19cc('0x0'));var archiver=require(_0x19cc('0xf'));var Redis=require('ioredis');var authService=require(_0x19cc('0x10'));var qs=require(_0x19cc('0x11'));var as=require(_0x19cc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x19cc('0x13'))(_0x19cc('0x14'));var utils=require(_0x19cc('0x15'));var config=require(_0x19cc('0x16'));var licenseUtil=require(_0x19cc('0x17'));var db=require(_0x19cc('0x18'))['db'];config['redis']=_['defaults'](config[_0x19cc('0x19')],{'host':_0x19cc('0x1a'),'port':0x18eb});var socket=require(_0x19cc('0x1b'))(new Redis(config['redis']));require(_0x19cc('0x1c'))[_0x19cc('0x1d')](socket);function respondWithStatusCode(_0x38f894,_0x2e415d){_0x2e415d=_0x2e415d||0xcc;return function(_0x3a7de1){if(_0x3a7de1){return _0x38f894[_0x19cc('0x1e')](_0x2e415d);}return _0x38f894[_0x19cc('0x1f')](_0x2e415d)[_0x19cc('0x20')]();};}function respondWithResult(_0x42d3c1,_0x186695){_0x186695=_0x186695||0xc8;return function(_0x4f0aaa){if(_0x4f0aaa){return _0x42d3c1['status'](_0x186695)[_0x19cc('0x21')](_0x4f0aaa);}};}function respondWithFilteredResult(_0x1dce1b,_0x534f48){return function(_0x252975){if(_0x252975){var _0x12a085=_0x252975[_0x19cc('0x22')],_0x161c63=_0x534f48['offset'],_0x127813=_0x534f48['offset']+_0x534f48[_0x19cc('0x23')],_0x37fbe2;if(_0x127813>=_0x12a085){_0x127813=_0x12a085;_0x37fbe2=0xc8;}else{_0x37fbe2=0xce;}_0x1dce1b['status'](_0x37fbe2);return _0x1dce1b['set']('Content-Range',_0x161c63+'-'+_0x127813+'/'+_0x12a085)[_0x19cc('0x21')](_0x252975);}return null;};}function patchUpdates(_0x172f3d){return function(_0x46e2cd){try{jsonpatch[_0x19cc('0x24')](_0x46e2cd,_0x172f3d,!![]);}catch(_0x4cdb8d){return BPromise['reject'](_0x4cdb8d);}return _0x46e2cd[_0x19cc('0x25')]();};}function saveUpdates(_0x3f64c0,_0x3367c7){return function(_0x30a35d){if(_0x30a35d){return _0x30a35d['update'](_0x3f64c0)[_0x19cc('0x26')](function(_0xfd7817){return _0xfd7817;});}return null;};}function removeEntity(_0x31ec84,_0x331e4c){return function(_0x132e99){if(_0x132e99){return _0x132e99[_0x19cc('0x27')]()[_0x19cc('0x26')](function(){var _0x9edfb8=_0x132e99[_0x19cc('0x28')]({'plain':!![]});var _0x440a38=_0x19cc('0x29');return db[_0x19cc('0x2a')]['destroy']({'where':{'type':_0x440a38,'resourceId':_0x9edfb8['id']}})[_0x19cc('0x26')](function(){return _0x132e99;});})['then'](function(){_0x31ec84[_0x19cc('0x1f')](0xcc)[_0x19cc('0x20')]();});}};}function handleEntityNotFound(_0x599ac3,_0x1cef5b){return function(_0xd89fed){if(!_0xd89fed){_0x599ac3['sendStatus'](0x194);}return _0xd89fed;};}function handleError(_0x231d09,_0x412ff4){_0x412ff4=_0x412ff4||0x1f4;return function(_0x3065d5){logger[_0x19cc('0x2b')](_0x3065d5[_0x19cc('0x2c')]);if(_0x3065d5[_0x19cc('0x2d')]){delete _0x3065d5[_0x19cc('0x2d')];}_0x231d09[_0x19cc('0x1f')](_0x412ff4)[_0x19cc('0x2e')](_0x3065d5);};}exports['index']=function(_0xd0e086,_0x1a4276){var _0x45626d={},_0x747085={},_0x204711={'count':0x0,'rows':[]};var _0x1ff057=_['map'](db[_0x19cc('0x2f')][_0x19cc('0x30')],function(_0x32f916){return{'name':_0x32f916[_0x19cc('0x31')],'type':_0x32f916[_0x19cc('0x32')][_0x19cc('0x33')]};});_0x747085[_0x19cc('0x34')]=_[_0x19cc('0x35')](_0x1ff057,'name');_0x747085['query']=_[_0x19cc('0x36')](_0xd0e086[_0x19cc('0x37')]);_0x747085[_0x19cc('0x38')]=_[_0x19cc('0x39')](_0x747085[_0x19cc('0x34')],_0x747085[_0x19cc('0x37')]);_0x45626d[_0x19cc('0x3a')]=_[_0x19cc('0x39')](_0x747085[_0x19cc('0x34')],qs[_0x19cc('0x3b')](_0xd0e086[_0x19cc('0x37')][_0x19cc('0x3b')]));_0x45626d[_0x19cc('0x3a')]=_0x45626d[_0x19cc('0x3a')][_0x19cc('0x3c')]?_0x45626d[_0x19cc('0x3a')]:_0x747085[_0x19cc('0x34')];if(!_0xd0e086[_0x19cc('0x37')][_0x19cc('0x3d')](_0x19cc('0x3e'))){_0x45626d[_0x19cc('0x23')]=qs[_0x19cc('0x23')](_0xd0e086['query'][_0x19cc('0x23')]);_0x45626d[_0x19cc('0x3f')]=qs[_0x19cc('0x3f')](_0xd0e086[_0x19cc('0x37')][_0x19cc('0x3f')]);}_0x45626d['order']=qs['sort'](_0xd0e086[_0x19cc('0x37')][_0x19cc('0x40')]);_0x45626d[_0x19cc('0x41')]=qs[_0x19cc('0x38')](_[_0x19cc('0x42')](_0xd0e086['query'],_0x747085[_0x19cc('0x38')]),_0x1ff057);if(_0xd0e086['query'][_0x19cc('0x43')]){_0x45626d[_0x19cc('0x41')]=_[_0x19cc('0x44')](_0x45626d[_0x19cc('0x41')],{'$or':_[_0x19cc('0x35')](_0x1ff057,function(_0xf0fcf5){if(_0xf0fcf5[_0x19cc('0x32')]!==_0x19cc('0x45')){var _0x4e7027={};_0x4e7027[_0xf0fcf5[_0x19cc('0x2d')]]={'$like':'%'+_0xd0e086['query']['filter']+'%'};return _0x4e7027;}})});}_0x45626d=_[_0x19cc('0x44')]({},_0x45626d,_0xd0e086[_0x19cc('0x46')]);var _0x1d72ec={'where':_0x45626d[_0x19cc('0x41')]};return db[_0x19cc('0x2f')][_0x19cc('0x22')](_0x1d72ec)[_0x19cc('0x26')](function(_0x2a6d17){_0x204711['count']=_0x2a6d17;if(_0xd0e086[_0x19cc('0x37')][_0x19cc('0x47')]){_0x45626d['include']=[{'all':!![]}];}return db[_0x19cc('0x2f')]['findAll'](_0x45626d);})[_0x19cc('0x26')](function(_0x58618e){_0x204711[_0x19cc('0x48')]=_0x58618e;return _0x204711;})[_0x19cc('0x26')](respondWithFilteredResult(_0x1a4276,_0x45626d))[_0x19cc('0x49')](handleError(_0x1a4276,null));};exports[_0x19cc('0x4a')]=function(_0x25e815,_0x2c3003){var _0x54c5e0={'raw':!![],'where':{'id':_0x25e815[_0x19cc('0x4b')]['id']}},_0x243c36={};_0x243c36['model']=_['keys'](db['Plugin'][_0x19cc('0x30')]);_0x243c36['query']=_[_0x19cc('0x36')](_0x25e815[_0x19cc('0x37')]);_0x243c36['filters']=_[_0x19cc('0x39')](_0x243c36[_0x19cc('0x34')],_0x243c36['query']);_0x54c5e0['attributes']=_[_0x19cc('0x39')](_0x243c36[_0x19cc('0x34')],qs[_0x19cc('0x3b')](_0x25e815[_0x19cc('0x37')][_0x19cc('0x3b')]));_0x54c5e0[_0x19cc('0x3a')]=_0x54c5e0[_0x19cc('0x3a')][_0x19cc('0x3c')]?_0x54c5e0['attributes']:_0x243c36[_0x19cc('0x34')];if(_0x25e815['query'][_0x19cc('0x47')]){_0x54c5e0[_0x19cc('0x4c')]=[{'all':!![]}];}_0x54c5e0=_[_0x19cc('0x44')]({},_0x54c5e0,_0x25e815['options']);return db[_0x19cc('0x2f')][_0x19cc('0x4d')](_0x54c5e0)['then'](handleEntityNotFound(_0x2c3003,null))[_0x19cc('0x26')](respondWithResult(_0x2c3003,null))['catch'](handleError(_0x2c3003,null));};exports[_0x19cc('0x4e')]=function(_0x469363,_0x2a3855,_0x49f1c7){return db[_0x19cc('0x2f')][_0x19cc('0x4d')]({'where':{'id':_0x469363[_0x19cc('0x4b')]['id']},'attributes':[_0x19cc('0x2d'),'path'],'raw':!![]})[_0x19cc('0x26')](handleEntityNotFound(_0x2a3855,null))['then'](function(_0xde5166){if(_0xde5166){var _0x5d4c8f=path[_0x19cc('0x4f')](config[_0x19cc('0x50')],'server/files/plugins',util[_0x19cc('0x51')]('%s.zip',path['basename'](_0xde5166[_0x19cc('0x52')])));var _0x4e09e7=fs['createWriteStream'](_0x5d4c8f);var _0x4aada7=archiver(_0x19cc('0x53'),{'zlib':{'level':0x9}});_0x4aada7['on'](_0x19cc('0x54'),function(_0x5ab2e8){if(_0x5ab2e8[_0x19cc('0x55')]===_0x19cc('0x56')){logger[_0x19cc('0x2b')](_0x5ab2e8);}else{throw new db[(_0x19cc('0x57'))][(_0x19cc('0x58'))](_0x19cc('0x59'));}});_0x4aada7['on'](_0x19cc('0x2b'),function(_0x2143c2){throw new db[(_0x19cc('0x57'))][(_0x19cc('0x58'))](_0x19cc('0x59'));});_0x4aada7[_0x19cc('0x5a')](_0x4e09e7);_0x4aada7['glob'](_0x19cc('0x5b'),{'cwd':path['join'](config[_0x19cc('0x50')],_0x19cc('0x5c'),path['dirname'](_0xde5166[_0x19cc('0x52')])),'ignore':[path['join'](path[_0x19cc('0x5d')](_0xde5166[_0x19cc('0x52')]),'node_modules/**/*'),path['join'](path['basename'](_0xde5166[_0x19cc('0x52')]),_0x19cc('0x5e'))],'nodir':!![]})[_0x19cc('0x5f')]();_0x4e09e7['on']('close',function(){if(!fs[_0x19cc('0x60')](_0x5d4c8f)){throw new db[(_0x19cc('0x57'))][(_0x19cc('0x58'))](_0x19cc('0x61'));}return _0x2a3855['download'](_0x5d4c8f,util[_0x19cc('0x51')](_0x19cc('0x62'),path[_0x19cc('0x5d')](_0xde5166[_0x19cc('0x52')])),function(_0xe86a43){if(_0xe86a43){throw new db[(_0x19cc('0x57'))][(_0x19cc('0x58'))](_0x19cc('0x63'));}fs[_0x19cc('0x64')](_0x5d4c8f);logger[_0x19cc('0x65')](_0x19cc('0x66'));logger[_0x19cc('0x65')]('Temporary\x20file\x20removed');});});}return null;})[_0x19cc('0x49')](handleError(_0x2a3855,null));};exports[_0x19cc('0x67')]=function(_0x3e4a4e,_0x579136,_0xd308ab){var _0x1cb862=path[_0x19cc('0x5d')](_0x3e4a4e['file'][_0x19cc('0x68')],path[_0x19cc('0x69')](_0x3e4a4e[_0x19cc('0x6a')][_0x19cc('0x68')]));var _0x40427d=path[_0x19cc('0x4f')](config['root'],_0x19cc('0x5c'),_0x3e4a4e[_0x19cc('0x6a')][_0x19cc('0x68')]);var _0x36e741=path['join'](config[_0x19cc('0x50')],_0x19cc('0x5c'),_0x1cb862);logger[_0x19cc('0x65')](_0x19cc('0x6b'),_0x40427d);logger[_0x19cc('0x65')](_0x19cc('0x6c'),_0x36e741);try{fs[_0x19cc('0x6d')](_0x40427d,parseInt('0777',0x8));extract(_0x40427d,{'dir':_0x36e741},function(_0x3acc83){if(_0x3acc83){logger['error'](_0x3acc83);handleError(_0x3acc83,!![]);};var _0x646a98=fs[_0x19cc('0x6e')](_0x36e741);if(_0x646a98[_0x19cc('0x3c')]>0x1){removeReferences(_0x40427d,_0x36e741);logger[_0x19cc('0x2b')](_0x19cc('0x6f'));return _0xd308ab(new Error('Invalid\x20plugin\x20structure'));}var _0x5c5018=fs[_0x19cc('0x70')](path[_0x19cc('0x4f')](_0x36e741,_0x646a98[0x0]));if(_0x5c5018[_0x19cc('0x71')]()){removeReferences(_0x40427d,_0x36e741);logger[_0x19cc('0x2b')]('Invalid\x20plugin\x20structure');return _0xd308ab(new Error('Invalid\x20plugin\x20structure'));}if(_0x5c5018[_0x19cc('0x72')]()){var _0x3595eb=fs[_0x19cc('0x6e')](path[_0x19cc('0x4f')](_0x36e741,_0x646a98[0x0]));if(_0x3595eb[_0x19cc('0x3c')]===0x0){removeReferences(_0x40427d,_0x36e741);logger[_0x19cc('0x2b')](_0x19cc('0x6f'));return _0xd308ab(new Error(_0x19cc('0x6f')));}var _0x2d199d=_0x3595eb[_0x19cc('0x73')](function(_0xfae2c9){return _0xfae2c9===_0x19cc('0x74');});if(!_0x2d199d){return _0xd308ab(new Error('Plugin\x20manifest\x20missing'));}var _0x4f3dea=fs[_0x19cc('0x75')](path[_0x19cc('0x4f')](_0x36e741,_0x646a98[0x0],_0x19cc('0x74')));var _0x105097=JSON['parse'](_0x4f3dea);if(_0x19cc('0x76')==typeof _0x105097[_0x19cc('0x2d')]){return _0xd308ab(new Error(_0x19cc('0x77')));}if(_0x19cc('0x76')==typeof _0x105097[_0x19cc('0x32')]){return _0xd308ab(new Error(_0x19cc('0x78')));}if(_0x19cc('0x76')==typeof _0x105097[_0x19cc('0x79')]){return _0xd308ab(new Error(_0x19cc('0x7a')));}if(_0x19cc('0x76')==typeof _0x105097[_0x19cc('0x7b')]){return _0xd308ab(new Error(_0x19cc('0x7c')));}if(_0x105097[_0x19cc('0x32')]===_0x19cc('0x7d')){if(_0x19cc('0x76')==typeof _0x105097[_0x19cc('0x7b')]['views']){return _0xd308ab(new Error(_0x19cc('0x7e')));}if(_0x19cc('0x76')==typeof _0x105097['parameters'][_0x19cc('0x7f')][_0x19cc('0x80')]&&_0x19cc('0x76')==typeof _0x105097[_0x19cc('0x7b')]['views'][_0x19cc('0x81')]){return _0xd308ab(new Error(_0x19cc('0x82')));}}else if(_0x105097['type']===_0x19cc('0x83')){if(_0x19cc('0x76')==typeof _0x105097[_0x19cc('0x7b')][_0x19cc('0x84')]){return _0xd308ab(new Error(_0x19cc('0x85')));}if(_0x19cc('0x76')==typeof _0x105097['parameters'][_0x19cc('0x86')]){return _0xd308ab(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0xd308ab(new Error(_0x19cc('0x87')));}var _0x2a58bb=_0x105097[_0x19cc('0x2d')];var _0x2a669c=_0x105097[_0x19cc('0x88')];var _0x6d5ef8=_0x105097[_0x19cc('0x32')];var _0x2267ea=_0x105097[_0x19cc('0x89')]?_0x105097[_0x19cc('0x89')]:'always';var _0x38a2c1=_0x105097[_0x19cc('0x8a')]?_0x105097['icon']:'icon-apps';var _0xc4b167='';var _0xd2257e='';var _0x105275='';var _0x121108='';var _0x3c60d4=_0x105097[_0x19cc('0x79')];if(_0x6d5ef8==='html'){if('undefined'!=typeof _0x105097['parameters'][_0x19cc('0x7f')][_0x19cc('0x80')]){var _0x32cd2a=_0x105097['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x19cc('0x8b')](_0x32cd2a)){_0xc4b167=path[_0x19cc('0x4f')](_0x19cc('0x8c'),_0x1cb862,_0x646a98[0x0],_0x32cd2a);}else{_0xc4b167=_0x32cd2a;}}else{logger[_0x19cc('0x65')](_0x19cc('0x8d'));}if(_0x19cc('0x76')!=typeof _0x105097[_0x19cc('0x7b')][_0x19cc('0x7f')][_0x19cc('0x81')]){var _0x6103b1=_0x105097['parameters'][_0x19cc('0x7f')][_0x19cc('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x19cc('0x8b')](_0x6103b1)){_0xd2257e=path['join'](_0x19cc('0x8c'),_0x1cb862,_0x646a98[0x0],_0x6103b1);}else{_0xd2257e=_0x6103b1;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x6d5ef8===_0x19cc('0x83')){_0x105275=_0x105097[_0x19cc('0x7b')][_0x19cc('0x84')];_0x121108=_0x105097[_0x19cc('0x7b')][_0x19cc('0x86')];if('undefined'!=typeof _0x105097[_0x19cc('0x7b')][_0x19cc('0x7f')]){if('undefined'!=typeof _0x105097[_0x19cc('0x7b')]['views']['admin']){var _0x32cd2a=_0x105097[_0x19cc('0x7b')]['views'][_0x19cc('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x32cd2a)){_0xc4b167=path['join'](_0x19cc('0x8c'),_0x1cb862,_0x646a98[0x0],_0x32cd2a);}else{_0xc4b167=_0x32cd2a;}}if(_0x19cc('0x76')!=typeof _0x105097[_0x19cc('0x7b')]['views'][_0x19cc('0x81')]){var _0x6103b1=_0x105097[_0x19cc('0x7b')][_0x19cc('0x7f')][_0x19cc('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x19cc('0x8b')](_0x6103b1)){_0xd2257e=path[_0x19cc('0x4f')]('plugins',_0x1cb862,_0x646a98[0x0],_0x6103b1);}else{_0xd2257e=_0x6103b1;}}}}var _0x5aee89={'name':_0x2a58bb,'description':_0x2a669c,'path':path[_0x19cc('0x4f')](_0x1cb862,_0x646a98[0x0]),'type':_0x6d5ef8,'sidebar':_0x2267ea,'icon':_0x38a2c1,'adminUrl':_0xc4b167,'agentUrl':_0xd2257e,'scriptName':_0x105275,'scriptPath':_0x121108,'version':_0x3c60d4};removeReferences(_0x40427d,null);return db[_0x19cc('0x2f')][_0x19cc('0x8e')](_0x5aee89)[_0x19cc('0x26')](function(_0x4e8672){var _0x1c198a={'role':_0x3e4a4e['body']['role'],'userProfileId':_0x3e4a4e['body'][_0x19cc('0x8f')]};if(!_0x1c198a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c198a[_0x19cc('0x90')]==='user'){var _0x22cc8e=_0x4e8672[_0x19cc('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x19cc('0x4d')]({'where':{'name':_0x19cc('0x29'),'userProfileId':_0x1c198a[_0x19cc('0x8f')]},'raw':!![]})[_0x19cc('0x26')](function(_0x629bae){if(_0x629bae&&_0x629bae['autoAssociation']===0x0){return db[_0x19cc('0x2a')]['create']({'name':_0x22cc8e[_0x19cc('0x2d')],'resourceId':_0x22cc8e['id'],'type':_0x629bae[_0x19cc('0x2d')],'sectionId':_0x629bae['id']},{})[_0x19cc('0x26')](function(){return _0x4e8672;});}else{return _0x4e8672;}})[_0x19cc('0x49')](function(_0x23ef0c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23ef0c);throw _0x23ef0c;});}return _0x4e8672;})[_0x19cc('0x26')](respondWithResult(_0x579136,null))[_0x19cc('0x49')](handleError(_0x579136,null));}});}catch(_0x39adc0){_0x579136[_0x19cc('0x1f')](0x1f4)[_0x19cc('0x2e')](_0x39adc0);}};function removeReferences(_0x306b59,_0x11f641){try{if(_0x306b59){fs[_0x19cc('0x64')](_0x306b59);logger[_0x19cc('0x65')](_0x19cc('0x91'));}if(_0x11f641){rimraf(_0x11f641,function(){});logger[_0x19cc('0x65')]('Extracted\x20folder\x20removed');}}catch(_0x5dbce5){logger['error'](_0x5dbce5);}}exports[_0x19cc('0x92')]=function(_0x37e1d6,_0x2d0391,_0x436a4d){return db[_0x19cc('0x2f')][_0x19cc('0x4d')]({'where':{'id':_0x37e1d6[_0x19cc('0x4b')]['id']}})[_0x19cc('0x26')](handleEntityNotFound(_0x2d0391,null))[_0x19cc('0x26')](saveUpdates(_0x37e1d6['body'],null))[_0x19cc('0x26')](respondWithResult(_0x2d0391,null))[_0x19cc('0x49')](handleError(_0x2d0391,null));};exports['delete']=function(_0x54d4b3,_0x2151b3,_0x44f127){return db[_0x19cc('0x2f')][_0x19cc('0x4d')]({'where':{'id':_0x54d4b3[_0x19cc('0x4b')]['id']}})[_0x19cc('0x26')](function(_0x3d3824){if(_0x3d3824){return _0x3d3824[_0x19cc('0x27')]();}})[_0x19cc('0x26')](function(_0x494281){rimraf(path[_0x19cc('0x4f')](config[_0x19cc('0x50')],_0x19cc('0x5c'),path[_0x19cc('0x93')](_0x494281[_0x19cc('0x52')])),function(){});return _0x494281;})[_0x19cc('0x26')](handleEntityNotFound(_0x2151b3,null))[_0x19cc('0x26')](respondWithStatusCode(_0x2151b3,null))[_0x19cc('0x49')](handleError(_0x2151b3,null));};exports[_0x19cc('0x94')]=function(_0x1dba7b,_0x2f812e,_0x160020){return BPromise[_0x19cc('0x95')]()['then'](function(){if(!_0x1dba7b['query']['path']){throw new Error(_0x19cc('0x96'));}if(!_0x1dba7b['query'][_0x19cc('0x97')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2d7923=_0x1dba7b[_0x19cc('0x37')][_0x19cc('0x98')]?_0x1dba7b[_0x19cc('0x37')]['hostname']+':'+_0x1dba7b[_0x19cc('0x37')][_0x19cc('0x97')]:_0x19cc('0x99')+_0x1dba7b[_0x19cc('0x37')][_0x19cc('0x97')];var _0xd3fbb9=_0x1dba7b[_0x19cc('0x37')][_0x19cc('0x21')]?_0x1dba7b[_0x19cc('0x37')][_0x19cc('0x21')]:!![];var _0xffa9e4=_0x1dba7b[_0x19cc('0x37')][_0x19cc('0x9a')]?_0x1dba7b[_0x19cc('0x37')][_0x19cc('0x9a')]:null;var _0x5b7847={'method':_0x1dba7b[_0x19cc('0x9b')],'uri':util[_0x19cc('0x51')](_0x19cc('0x9c'),_0x2d7923,_0x1dba7b[_0x19cc('0x37')][_0x19cc('0x52')]),'json':_0xd3fbb9,'resolveWithFullResponse':!![],'encoding':_0xffa9e4,'qs':_0x1dba7b[_0x19cc('0x37')]};if(_0x1dba7b[_0x19cc('0x9d')]){_0x5b7847[_0x19cc('0x9d')]=_0x1dba7b[_0x19cc('0x9d')];if(_0x5b7847[_0x19cc('0x9d')][_0x19cc('0x9e')]){delete _0x5b7847[_0x19cc('0x9d')]['content-length'];}}if(_0x5b7847['headers'][_0x19cc('0x9f')]){delete _0x5b7847[_0x19cc('0x9d')][_0x19cc('0x9f')];}return rp(_0x5b7847);})[_0x19cc('0x26')](function(_0x17cbf4){if(_0x17cbf4){_0x2f812e[_0x19cc('0xa0')](_0x17cbf4[_0x19cc('0x9d')]);logger[_0x19cc('0x65')](_0x17cbf4['body']);if(_[_0x19cc('0xa1')](_0x1dba7b['query']['path'],_0x19cc('0x4e'))&&_0x17cbf4['statusCode']==0x1f4){return _0x2f812e[_0x19cc('0x1e')](_0x17cbf4[_0x19cc('0xa2')]);}else{return _0x2f812e[_0x19cc('0x1f')](_0x17cbf4['statusCode'])['send'](_0x17cbf4['body']);}}else{return _0x2f812e['sendStatus'](0xc8);}})[_0x19cc('0x49')](handleError(_0x2f812e,null));};exports[_0x19cc('0xa3')]=function(_0x30b969,_0xed191c,_0x5f5c6e){return BPromise['resolve']()[_0x19cc('0x26')](function(){if(!_0x30b969[_0x19cc('0x37')]['path']){throw new Error(_0x19cc('0x96'));}if(!_0x30b969[_0x19cc('0x37')][_0x19cc('0x97')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x28d470=_0x30b969[_0x19cc('0x37')]['hostname']?_0x30b969[_0x19cc('0x37')][_0x19cc('0x98')]+':'+_0x30b969[_0x19cc('0x37')][_0x19cc('0x97')]:_0x19cc('0x99')+_0x30b969[_0x19cc('0x37')][_0x19cc('0x97')];var _0x5e3eb7=_0x30b969['query']['json']?_0x30b969[_0x19cc('0x37')][_0x19cc('0x21')]:!![];var _0xd908ca=_0x30b969[_0x19cc('0x37')][_0x19cc('0x9a')]?_0x30b969[_0x19cc('0x37')][_0x19cc('0x9a')]:null;var _0x4c74f6={'method':_0x30b969[_0x19cc('0x9b')],'uri':util[_0x19cc('0x51')]('%s%s',_0x28d470,_0x30b969[_0x19cc('0x37')][_0x19cc('0x52')]),'json':_0x5e3eb7,'resolveWithFullResponse':!![],'encoding':_0xd908ca,'body':_0x30b969[_0x19cc('0xa4')]};if(_0x30b969[_0x19cc('0x9d')]){_0x4c74f6[_0x19cc('0x9d')]=_0x30b969[_0x19cc('0x9d')];if(_0x4c74f6[_0x19cc('0x9d')][_0x19cc('0x9e')]){delete _0x4c74f6[_0x19cc('0x9d')][_0x19cc('0x9e')];}}if(_0x4c74f6[_0x19cc('0x9d')][_0x19cc('0x9f')]){delete _0x4c74f6[_0x19cc('0x9d')][_0x19cc('0x9f')];}return rp(_0x4c74f6);})['then'](function(_0x2a3877){if(_0x2a3877){_0xed191c['set'](_0x2a3877[_0x19cc('0x9d')]);logger['info'](_0x2a3877[_0x19cc('0xa4')]);return _0xed191c[_0x19cc('0x1f')](_0x2a3877[_0x19cc('0xa2')])['send'](_0x2a3877[_0x19cc('0xa4')]);}else{return _0xed191c[_0x19cc('0x1e')](0xc8);}})[_0x19cc('0x49')](handleError(_0xed191c,null));}; \ No newline at end of file +var _0x1b56=['archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','register','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','get','Plugins','destroy','sendStatus','error','stack','name','send','index','map','Plugin','rawAttributes','type','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','download','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','catch','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','delete','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','format','headers','content-length','content-type','set','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip'];(function(_0x572618,_0x287468){var _0x113a44=function(_0x2d4e17){while(--_0x2d4e17){_0x572618['push'](_0x572618['shift']());}};_0x113a44(++_0x287468);}(_0x1b56,0x93));var _0x61b5=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x1b56[_0x211fef];return _0x5447bf;};'use strict';var emlformat=require(_0x61b5('0x0'));var rimraf=require(_0x61b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x61b5('0x2'));var rp=require(_0x61b5('0x3'));var moment=require(_0x61b5('0x4'));var BPromise=require(_0x61b5('0x5'));var Mustache=require(_0x61b5('0x6'));var util=require('util');var path=require(_0x61b5('0x7'));var sox=require('sox');var csv=require(_0x61b5('0x8'));var ejs=require(_0x61b5('0x9'));var fs=require('fs');var fs_extra=require(_0x61b5('0xa'));var _=require(_0x61b5('0xb'));var squel=require(_0x61b5('0xc'));var crypto=require(_0x61b5('0xd'));var jsforce=require(_0x61b5('0xe'));var deskjs=require(_0x61b5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x61b5('0x10'));var extract=require(_0x61b5('0x11'));var rimraf=require(_0x61b5('0x1'));var archiver=require(_0x61b5('0x12'));var Redis=require(_0x61b5('0x13'));var authService=require(_0x61b5('0x14'));var qs=require(_0x61b5('0x15'));var as=require(_0x61b5('0x16'));var hardwareService=require(_0x61b5('0x17'));var logger=require('../../config/logger')(_0x61b5('0x18'));var utils=require(_0x61b5('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x61b5('0x1a'))['db'];config[_0x61b5('0x1b')]=_[_0x61b5('0x1c')](config[_0x61b5('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x61b5('0x1b')]));require('./plugin.socket')[_0x61b5('0x1d')](socket);function respondWithStatusCode(_0xa350b0,_0x3f7f35){_0x3f7f35=_0x3f7f35||0xcc;return function(_0x3696a7){if(_0x3696a7){return _0xa350b0['sendStatus'](_0x3f7f35);}return _0xa350b0[_0x61b5('0x1e')](_0x3f7f35)[_0x61b5('0x1f')]();};}function respondWithResult(_0x5bf505,_0x1a119b){_0x1a119b=_0x1a119b||0xc8;return function(_0x370c7e){if(_0x370c7e){return _0x5bf505[_0x61b5('0x1e')](_0x1a119b)[_0x61b5('0x20')](_0x370c7e);}};}function respondWithFilteredResult(_0x3c8cac,_0x46f625){return function(_0x42383f){if(_0x42383f){var _0x1536f3=_0x42383f[_0x61b5('0x21')],_0x9c60bd=_0x46f625[_0x61b5('0x22')],_0x54617d=_0x46f625[_0x61b5('0x22')]+_0x46f625[_0x61b5('0x23')],_0x1105e2;if(_0x54617d>=_0x1536f3){_0x54617d=_0x1536f3;_0x1105e2=0xc8;}else{_0x1105e2=0xce;}_0x3c8cac[_0x61b5('0x1e')](_0x1105e2);return _0x3c8cac['set'](_0x61b5('0x24'),_0x9c60bd+'-'+_0x54617d+'/'+_0x1536f3)[_0x61b5('0x20')](_0x42383f);}return null;};}function patchUpdates(_0x301d9b){return function(_0xe7dfdd){try{jsonpatch[_0x61b5('0x25')](_0xe7dfdd,_0x301d9b,!![]);}catch(_0x622af5){return BPromise['reject'](_0x622af5);}return _0xe7dfdd[_0x61b5('0x26')]();};}function saveUpdates(_0x46a47d,_0xb292f4){return function(_0x37cd6b){if(_0x37cd6b){return _0x37cd6b[_0x61b5('0x27')](_0x46a47d)[_0x61b5('0x28')](function(_0x172420){return _0x172420;});}return null;};}function removeEntity(_0x48a488,_0x1e6fd9){return function(_0x2aeca7){if(_0x2aeca7){return _0x2aeca7['destroy']()[_0x61b5('0x28')](function(){var _0x329679=_0x2aeca7[_0x61b5('0x29')]({'plain':!![]});var _0x15262f=_0x61b5('0x2a');return db['UserProfileResource'][_0x61b5('0x2b')]({'where':{'type':_0x15262f,'resourceId':_0x329679['id']}})[_0x61b5('0x28')](function(){return _0x2aeca7;});})[_0x61b5('0x28')](function(){_0x48a488[_0x61b5('0x1e')](0xcc)[_0x61b5('0x1f')]();});}};}function handleEntityNotFound(_0x313805,_0x49569a){return function(_0x3ae595){if(!_0x3ae595){_0x313805[_0x61b5('0x2c')](0x194);}return _0x3ae595;};}function handleError(_0x2adb2d,_0x5ade7d){_0x5ade7d=_0x5ade7d||0x1f4;return function(_0x43f29e){logger[_0x61b5('0x2d')](_0x43f29e[_0x61b5('0x2e')]);if(_0x43f29e[_0x61b5('0x2f')]){delete _0x43f29e['name'];}_0x2adb2d['status'](_0x5ade7d)[_0x61b5('0x30')](_0x43f29e);};}exports[_0x61b5('0x31')]=function(_0x3891e9,_0x553a62){var _0x15bc10={},_0x11f32a={},_0x3c0b09={'count':0x0,'rows':[]};var _0x4ef51a=_[_0x61b5('0x32')](db[_0x61b5('0x33')][_0x61b5('0x34')],function(_0x371640){return{'name':_0x371640['fieldName'],'type':_0x371640[_0x61b5('0x35')]['key']};});_0x11f32a[_0x61b5('0x36')]=_[_0x61b5('0x32')](_0x4ef51a,_0x61b5('0x2f'));_0x11f32a[_0x61b5('0x37')]=_[_0x61b5('0x38')](_0x3891e9['query']);_0x11f32a['filters']=_['intersection'](_0x11f32a['model'],_0x11f32a[_0x61b5('0x37')]);_0x15bc10['attributes']=_[_0x61b5('0x39')](_0x11f32a[_0x61b5('0x36')],qs[_0x61b5('0x3a')](_0x3891e9[_0x61b5('0x37')][_0x61b5('0x3a')]));_0x15bc10['attributes']=_0x15bc10['attributes'][_0x61b5('0x3b')]?_0x15bc10[_0x61b5('0x3c')]:_0x11f32a[_0x61b5('0x36')];if(!_0x3891e9[_0x61b5('0x37')][_0x61b5('0x3d')]('nolimit')){_0x15bc10['limit']=qs[_0x61b5('0x23')](_0x3891e9[_0x61b5('0x37')][_0x61b5('0x23')]);_0x15bc10[_0x61b5('0x22')]=qs[_0x61b5('0x22')](_0x3891e9['query'][_0x61b5('0x22')]);}_0x15bc10['order']=qs[_0x61b5('0x3e')](_0x3891e9[_0x61b5('0x37')][_0x61b5('0x3e')]);_0x15bc10['where']=qs[_0x61b5('0x3f')](_[_0x61b5('0x40')](_0x3891e9[_0x61b5('0x37')],_0x11f32a[_0x61b5('0x3f')]),_0x4ef51a);if(_0x3891e9[_0x61b5('0x37')][_0x61b5('0x41')]){_0x15bc10[_0x61b5('0x42')]=_[_0x61b5('0x43')](_0x15bc10['where'],{'$or':_['map'](_0x4ef51a,function(_0x5d5066){if(_0x5d5066[_0x61b5('0x35')]!=='VIRTUAL'){var _0x4fb600={};_0x4fb600[_0x5d5066['name']]={'$like':'%'+_0x3891e9[_0x61b5('0x37')][_0x61b5('0x41')]+'%'};return _0x4fb600;}})});}_0x15bc10=_[_0x61b5('0x43')]({},_0x15bc10,_0x3891e9[_0x61b5('0x44')]);var _0x1ed37c={'where':_0x15bc10[_0x61b5('0x42')]};return db['Plugin'][_0x61b5('0x21')](_0x1ed37c)[_0x61b5('0x28')](function(_0x1bb81c){_0x3c0b09['count']=_0x1bb81c;if(_0x3891e9[_0x61b5('0x37')][_0x61b5('0x45')]){_0x15bc10[_0x61b5('0x46')]=[{'all':!![]}];}return db[_0x61b5('0x33')][_0x61b5('0x47')](_0x15bc10);})[_0x61b5('0x28')](function(_0x26130b){_0x3c0b09[_0x61b5('0x48')]=_0x26130b;return _0x3c0b09;})['then'](respondWithFilteredResult(_0x553a62,_0x15bc10))['catch'](handleError(_0x553a62,null));};exports[_0x61b5('0x49')]=function(_0x13499c,_0x1ebd32){var _0x3c2f1d={'raw':!![],'where':{'id':_0x13499c[_0x61b5('0x4a')]['id']}},_0x15701b={};_0x15701b['model']=_[_0x61b5('0x38')](db[_0x61b5('0x33')][_0x61b5('0x34')]);_0x15701b[_0x61b5('0x37')]=_[_0x61b5('0x38')](_0x13499c[_0x61b5('0x37')]);_0x15701b[_0x61b5('0x3f')]=_[_0x61b5('0x39')](_0x15701b['model'],_0x15701b['query']);_0x3c2f1d[_0x61b5('0x3c')]=_[_0x61b5('0x39')](_0x15701b[_0x61b5('0x36')],qs['fields'](_0x13499c[_0x61b5('0x37')][_0x61b5('0x3a')]));_0x3c2f1d[_0x61b5('0x3c')]=_0x3c2f1d[_0x61b5('0x3c')][_0x61b5('0x3b')]?_0x3c2f1d[_0x61b5('0x3c')]:_0x15701b[_0x61b5('0x36')];if(_0x13499c[_0x61b5('0x37')]['includeAll']){_0x3c2f1d[_0x61b5('0x46')]=[{'all':!![]}];}_0x3c2f1d=_['merge']({},_0x3c2f1d,_0x13499c[_0x61b5('0x44')]);return db[_0x61b5('0x33')][_0x61b5('0x4b')](_0x3c2f1d)['then'](handleEntityNotFound(_0x1ebd32,null))[_0x61b5('0x28')](respondWithResult(_0x1ebd32,null))['catch'](handleError(_0x1ebd32,null));};exports[_0x61b5('0x4c')]=function(_0x317987,_0x485c68,_0xdff3d0){return db[_0x61b5('0x33')][_0x61b5('0x4b')]({'where':{'id':_0x317987[_0x61b5('0x4a')]['id']},'attributes':[_0x61b5('0x2f'),_0x61b5('0x7')],'raw':!![]})[_0x61b5('0x28')](handleEntityNotFound(_0x485c68,null))[_0x61b5('0x28')](function(_0x3a3309){if(_0x3a3309){var _0x48224f=path[_0x61b5('0x4d')](config[_0x61b5('0x4e')],_0x61b5('0x4f'),util['format'](_0x61b5('0x50'),path[_0x61b5('0x51')](_0x3a3309['path'])));var _0x745073=fs[_0x61b5('0x52')](_0x48224f);var _0x23da6c=archiver(_0x61b5('0x53'),{'zlib':{'level':0x9}});_0x23da6c['on'](_0x61b5('0x54'),function(_0x48ee54){if(_0x48ee54[_0x61b5('0x55')]===_0x61b5('0x56')){logger[_0x61b5('0x2d')](_0x48ee54);}else{throw new db[(_0x61b5('0x57'))][(_0x61b5('0x58'))](_0x61b5('0x59'));}});_0x23da6c['on'](_0x61b5('0x2d'),function(_0x48df35){throw new db[(_0x61b5('0x57'))][(_0x61b5('0x58'))](_0x61b5('0x59'));});_0x23da6c[_0x61b5('0x5a')](_0x745073);_0x23da6c['glob'](_0x61b5('0x5b'),{'cwd':path[_0x61b5('0x4d')](config[_0x61b5('0x4e')],'server/files/plugins',path['dirname'](_0x3a3309[_0x61b5('0x7')])),'ignore':[path['join'](path[_0x61b5('0x51')](_0x3a3309[_0x61b5('0x7')]),'node_modules/**/*'),path['join'](path['basename'](_0x3a3309[_0x61b5('0x7')]),_0x61b5('0x5c'))],'nodir':!![]})['finalize']();_0x745073['on'](_0x61b5('0x5d'),function(){if(!fs[_0x61b5('0x5e')](_0x48224f)){throw new db[(_0x61b5('0x57'))][(_0x61b5('0x58'))](_0x61b5('0x5f'));}return _0x485c68[_0x61b5('0x4c')](_0x48224f,util['format']('%s.zip',path[_0x61b5('0x51')](_0x3a3309['path'])),function(_0x5d69f5){if(_0x5d69f5){throw new db[(_0x61b5('0x57'))]['Error'](_0x61b5('0x60'));}fs['unlinkSync'](_0x48224f);logger[_0x61b5('0x61')](_0x61b5('0x62'));logger['info'](_0x61b5('0x63'));});});}return null;})[_0x61b5('0x64')](handleError(_0x485c68,null));};exports[_0x61b5('0x65')]=function(_0x4403c2,_0x13dd3d,_0x32f087){var _0x4faf1b=path[_0x61b5('0x51')](_0x4403c2[_0x61b5('0x66')][_0x61b5('0x67')],path['extname'](_0x4403c2[_0x61b5('0x66')][_0x61b5('0x67')]));var _0x10c401=path['join'](config[_0x61b5('0x4e')],_0x61b5('0x4f'),_0x4403c2[_0x61b5('0x66')][_0x61b5('0x67')]);var _0x408854=path[_0x61b5('0x4d')](config[_0x61b5('0x4e')],'server/files/plugins',_0x4faf1b);logger[_0x61b5('0x61')]('Plugin\x20upload\x20filepath:\x20%s',_0x10c401);logger[_0x61b5('0x61')](_0x61b5('0x68'),_0x408854);try{fs[_0x61b5('0x69')](_0x10c401,parseInt('0777',0x8));extract(_0x10c401,{'dir':_0x408854},function(_0xbf0fe4){if(_0xbf0fe4){logger[_0x61b5('0x2d')](_0xbf0fe4);handleError(_0xbf0fe4,!![]);};var _0x153df8=fs['readdirSync'](_0x408854);if(_0x153df8[_0x61b5('0x3b')]>0x1){removeReferences(_0x10c401,_0x408854);logger['error']('Invalid\x20plugin\x20structure');return _0x32f087(new Error(_0x61b5('0x6a')));}var _0xcdbb61=fs[_0x61b5('0x6b')](path[_0x61b5('0x4d')](_0x408854,_0x153df8[0x0]));if(_0xcdbb61[_0x61b5('0x6c')]()){removeReferences(_0x10c401,_0x408854);logger[_0x61b5('0x2d')](_0x61b5('0x6a'));return _0x32f087(new Error('Invalid\x20plugin\x20structure'));}if(_0xcdbb61[_0x61b5('0x6d')]()){var _0x3f5827=fs['readdirSync'](path[_0x61b5('0x4d')](_0x408854,_0x153df8[0x0]));if(_0x3f5827[_0x61b5('0x3b')]===0x0){removeReferences(_0x10c401,_0x408854);logger[_0x61b5('0x2d')](_0x61b5('0x6a'));return _0x32f087(new Error(_0x61b5('0x6a')));}var _0x57c024=_0x3f5827[_0x61b5('0x6e')](function(_0x4d0b7c){return _0x4d0b7c===_0x61b5('0x6f');});if(!_0x57c024){return _0x32f087(new Error(_0x61b5('0x70')));}var _0x3af4a6=fs[_0x61b5('0x71')](path[_0x61b5('0x4d')](_0x408854,_0x153df8[0x0],_0x61b5('0x6f')));var _0x174ebc=JSON[_0x61b5('0x72')](_0x3af4a6);if(_0x61b5('0x73')==typeof _0x174ebc[_0x61b5('0x2f')]){return _0x32f087(new Error(_0x61b5('0x74')));}if(_0x61b5('0x73')==typeof _0x174ebc['type']){return _0x32f087(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x61b5('0x73')==typeof _0x174ebc[_0x61b5('0x75')]){return _0x32f087(new Error(_0x61b5('0x76')));}if('undefined'==typeof _0x174ebc[_0x61b5('0x77')]){return _0x32f087(new Error(_0x61b5('0x78')));}if(_0x174ebc[_0x61b5('0x35')]===_0x61b5('0x79')){if(_0x61b5('0x73')==typeof _0x174ebc[_0x61b5('0x77')]['views']){return _0x32f087(new Error(_0x61b5('0x7a')));}if(_0x61b5('0x73')==typeof _0x174ebc[_0x61b5('0x77')][_0x61b5('0x7b')][_0x61b5('0x7c')]&&_0x61b5('0x73')==typeof _0x174ebc['parameters']['views'][_0x61b5('0x7d')]){return _0x32f087(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x174ebc[_0x61b5('0x35')]==='script'){if(_0x61b5('0x73')==typeof _0x174ebc[_0x61b5('0x77')]['scriptName']){return _0x32f087(new Error(_0x61b5('0x7e')));}if(_0x61b5('0x73')==typeof _0x174ebc[_0x61b5('0x77')][_0x61b5('0x7f')]){return _0x32f087(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x32f087(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x5db5d4=_0x174ebc[_0x61b5('0x2f')];var _0x1183dc=_0x174ebc[_0x61b5('0x80')];var _0x18e121=_0x174ebc['type'];var _0x339454=_0x174ebc[_0x61b5('0x81')]?_0x174ebc[_0x61b5('0x81')]:_0x61b5('0x82');var _0x5a97f3=_0x174ebc[_0x61b5('0x83')]?_0x174ebc[_0x61b5('0x83')]:_0x61b5('0x84');var _0x2faccd='';var _0x5c0aee='';var _0x42903f='';var _0x668633='';var _0x3cdc7b=_0x174ebc['version'];if(_0x18e121===_0x61b5('0x79')){if('undefined'!=typeof _0x174ebc['parameters']['views'][_0x61b5('0x7c')]){var _0x9b06a4=_0x174ebc[_0x61b5('0x77')][_0x61b5('0x7b')][_0x61b5('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x61b5('0x85')](_0x9b06a4)){_0x2faccd=path[_0x61b5('0x4d')](_0x61b5('0x86'),_0x4faf1b,_0x153df8[0x0],_0x9b06a4);}else{_0x2faccd=_0x9b06a4;}}else{logger[_0x61b5('0x61')](_0x61b5('0x87'));}if(_0x61b5('0x73')!=typeof _0x174ebc[_0x61b5('0x77')][_0x61b5('0x7b')][_0x61b5('0x7d')]){var _0x15558f=_0x174ebc[_0x61b5('0x77')][_0x61b5('0x7b')][_0x61b5('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x61b5('0x85')](_0x15558f)){_0x5c0aee=path['join'](_0x61b5('0x86'),_0x4faf1b,_0x153df8[0x0],_0x15558f);}else{_0x5c0aee=_0x15558f;}}else{logger[_0x61b5('0x61')](_0x61b5('0x88'));}}else if(_0x18e121===_0x61b5('0x89')){_0x42903f=_0x174ebc[_0x61b5('0x77')][_0x61b5('0x8a')];_0x668633=_0x174ebc[_0x61b5('0x77')][_0x61b5('0x7f')];if(_0x61b5('0x73')!=typeof _0x174ebc[_0x61b5('0x77')][_0x61b5('0x7b')]){if('undefined'!=typeof _0x174ebc[_0x61b5('0x77')]['views']['admin']){var _0x9b06a4=_0x174ebc[_0x61b5('0x77')][_0x61b5('0x7b')][_0x61b5('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x9b06a4)){_0x2faccd=path[_0x61b5('0x4d')](_0x61b5('0x86'),_0x4faf1b,_0x153df8[0x0],_0x9b06a4);}else{_0x2faccd=_0x9b06a4;}}if(_0x61b5('0x73')!=typeof _0x174ebc['parameters'][_0x61b5('0x7b')][_0x61b5('0x7d')]){var _0x15558f=_0x174ebc['parameters']['views'][_0x61b5('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x61b5('0x85')](_0x15558f)){_0x5c0aee=path[_0x61b5('0x4d')](_0x61b5('0x86'),_0x4faf1b,_0x153df8[0x0],_0x15558f);}else{_0x5c0aee=_0x15558f;}}}}var _0x5a9ed2={'name':_0x5db5d4,'description':_0x1183dc,'path':path[_0x61b5('0x4d')](_0x4faf1b,_0x153df8[0x0]),'type':_0x18e121,'sidebar':_0x339454,'icon':_0x5a97f3,'adminUrl':_0x2faccd,'agentUrl':_0x5c0aee,'scriptName':_0x42903f,'scriptPath':_0x668633,'version':_0x3cdc7b};removeReferences(_0x10c401,null);return db[_0x61b5('0x33')][_0x61b5('0x8b')](_0x5a9ed2)[_0x61b5('0x28')](function(_0x125b12){var _0x157353={'role':_0x4403c2[_0x61b5('0x8c')][_0x61b5('0x8d')],'userProfileId':_0x4403c2[_0x61b5('0x8c')]['userProfileId']};if(!_0x157353)throw new Error(_0x61b5('0x8e'));if(_0x157353[_0x61b5('0x8d')]===_0x61b5('0x8f')){var _0x2c057f=_0x125b12[_0x61b5('0x29')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x61b5('0x2a'),'userProfileId':_0x157353['userProfileId']},'raw':!![]})['then'](function(_0x2a97ae){if(_0x2a97ae&&_0x2a97ae['autoAssociation']===0x0){return db[_0x61b5('0x90')][_0x61b5('0x8b')]({'name':_0x2c057f[_0x61b5('0x2f')],'resourceId':_0x2c057f['id'],'type':_0x2a97ae[_0x61b5('0x2f')],'sectionId':_0x2a97ae['id']},{})[_0x61b5('0x28')](function(){return _0x125b12;});}else{return _0x125b12;}})[_0x61b5('0x64')](function(_0x392650){logger[_0x61b5('0x2d')](_0x61b5('0x91'),_0x392650);throw _0x392650;});}return _0x125b12;})[_0x61b5('0x28')](respondWithResult(_0x13dd3d,null))['catch'](handleError(_0x13dd3d,null));}});}catch(_0x743d9){_0x13dd3d[_0x61b5('0x1e')](0x1f4)['send'](_0x743d9);}};function removeReferences(_0x20323d,_0x1b088d){try{if(_0x20323d){fs[_0x61b5('0x92')](_0x20323d);logger['info']('Zip\x20archive\x20removed');}if(_0x1b088d){rimraf(_0x1b088d,function(){});logger[_0x61b5('0x61')]('Extracted\x20folder\x20removed');}}catch(_0x5c5e83){logger[_0x61b5('0x2d')](_0x5c5e83);}}exports[_0x61b5('0x27')]=function(_0x1d85f6,_0x3e5cda,_0x4b9d62){return db[_0x61b5('0x33')][_0x61b5('0x4b')]({'where':{'id':_0x1d85f6[_0x61b5('0x4a')]['id']}})[_0x61b5('0x28')](handleEntityNotFound(_0x3e5cda,null))[_0x61b5('0x28')](saveUpdates(_0x1d85f6[_0x61b5('0x8c')],null))[_0x61b5('0x28')](respondWithResult(_0x3e5cda,null))[_0x61b5('0x64')](handleError(_0x3e5cda,null));};exports[_0x61b5('0x93')]=function(_0xcb2de6,_0x416cdc,_0x39b839){return db['Plugin'][_0x61b5('0x4b')]({'where':{'id':_0xcb2de6[_0x61b5('0x4a')]['id']}})[_0x61b5('0x28')](function(_0x561f64){if(_0x561f64){return _0x561f64[_0x61b5('0x2b')]();}})['then'](function(_0x1b1fa9){rimraf(path[_0x61b5('0x4d')](config[_0x61b5('0x4e')],_0x61b5('0x4f'),path['dirname'](_0x1b1fa9[_0x61b5('0x7')])),function(){});return _0x1b1fa9;})[_0x61b5('0x28')](handleEntityNotFound(_0x416cdc,null))[_0x61b5('0x28')](respondWithStatusCode(_0x416cdc,null))[_0x61b5('0x64')](handleError(_0x416cdc,null));};exports[_0x61b5('0x94')]=function(_0x45a7e3,_0x3ab238,_0x5881b5){return BPromise[_0x61b5('0x95')]()[_0x61b5('0x28')](function(){if(!_0x45a7e3['query'][_0x61b5('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x45a7e3[_0x61b5('0x37')][_0x61b5('0x96')]){throw new Error(_0x61b5('0x97'));}var _0x2f164d=_0x45a7e3[_0x61b5('0x37')][_0x61b5('0x98')]?_0x45a7e3[_0x61b5('0x37')]['hostname']+':'+_0x45a7e3[_0x61b5('0x37')][_0x61b5('0x96')]:_0x61b5('0x99')+_0x45a7e3[_0x61b5('0x37')]['port'];var _0x4ef8a2=_0x45a7e3[_0x61b5('0x37')][_0x61b5('0x20')]?_0x45a7e3[_0x61b5('0x37')]['json']:!![];var _0x16e0bc=_0x45a7e3[_0x61b5('0x37')][_0x61b5('0x9a')]?_0x45a7e3[_0x61b5('0x37')]['encoding']:null;var _0x15d60b={'method':_0x45a7e3[_0x61b5('0x9b')],'uri':util[_0x61b5('0x9c')]('%s%s',_0x2f164d,_0x45a7e3[_0x61b5('0x37')]['path']),'json':_0x4ef8a2,'resolveWithFullResponse':!![],'encoding':_0x16e0bc,'qs':_0x45a7e3[_0x61b5('0x37')]};if(_0x45a7e3['headers']){_0x15d60b['headers']=_0x45a7e3['headers'];if(_0x15d60b[_0x61b5('0x9d')][_0x61b5('0x9e')]){delete _0x15d60b[_0x61b5('0x9d')]['content-length'];}}if(_0x15d60b[_0x61b5('0x9d')][_0x61b5('0x9f')]){delete _0x15d60b['headers'][_0x61b5('0x9f')];}return rp(_0x15d60b);})[_0x61b5('0x28')](function(_0x1cbac6){if(_0x1cbac6){_0x3ab238[_0x61b5('0xa0')](_0x1cbac6[_0x61b5('0x9d')]);logger[_0x61b5('0x61')](_0x1cbac6[_0x61b5('0x8c')]);if(_['endsWith'](_0x45a7e3[_0x61b5('0x37')][_0x61b5('0x7')],_0x61b5('0x4c'))&&_0x1cbac6['statusCode']==0x1f4){return _0x3ab238['sendStatus'](_0x1cbac6['statusCode']);}else{return _0x3ab238[_0x61b5('0x1e')](_0x1cbac6['statusCode'])[_0x61b5('0x30')](_0x1cbac6['body']);}}else{return _0x3ab238[_0x61b5('0x2c')](0xc8);}})[_0x61b5('0x64')](handleError(_0x3ab238,null));};exports[_0x61b5('0xa1')]=function(_0x5f4336,_0x206b00,_0x2c52f2){return BPromise[_0x61b5('0x95')]()['then'](function(){if(!_0x5f4336['query'][_0x61b5('0x7')]){throw new Error(_0x61b5('0xa2'));}if(!_0x5f4336[_0x61b5('0x37')]['port']){throw new Error(_0x61b5('0x97'));}var _0x2fc9be=_0x5f4336[_0x61b5('0x37')]['hostname']?_0x5f4336['query'][_0x61b5('0x98')]+':'+_0x5f4336[_0x61b5('0x37')][_0x61b5('0x96')]:'http://localhost:'+_0x5f4336[_0x61b5('0x37')][_0x61b5('0x96')];var _0x27e547=_0x5f4336['query'][_0x61b5('0x20')]?_0x5f4336[_0x61b5('0x37')][_0x61b5('0x20')]:!![];var _0x4284c9=_0x5f4336[_0x61b5('0x37')]['encoding']?_0x5f4336['query']['encoding']:null;var _0x3d3f0d={'method':_0x5f4336[_0x61b5('0x9b')],'uri':util[_0x61b5('0x9c')](_0x61b5('0xa3'),_0x2fc9be,_0x5f4336[_0x61b5('0x37')]['path']),'json':_0x27e547,'resolveWithFullResponse':!![],'encoding':_0x4284c9,'body':_0x5f4336[_0x61b5('0x8c')]};if(_0x5f4336[_0x61b5('0x9d')]){_0x3d3f0d[_0x61b5('0x9d')]=_0x5f4336[_0x61b5('0x9d')];if(_0x3d3f0d[_0x61b5('0x9d')][_0x61b5('0x9e')]){delete _0x3d3f0d[_0x61b5('0x9d')][_0x61b5('0x9e')];}}if(_0x3d3f0d[_0x61b5('0x9d')]['content-type']){delete _0x3d3f0d['headers'][_0x61b5('0x9f')];}return rp(_0x3d3f0d);})[_0x61b5('0x28')](function(_0x5dfc6f){if(_0x5dfc6f){_0x206b00[_0x61b5('0xa0')](_0x5dfc6f[_0x61b5('0x9d')]);logger[_0x61b5('0x61')](_0x5dfc6f[_0x61b5('0x8c')]);return _0x206b00['status'](_0x5dfc6f[_0x61b5('0xa4')])[_0x61b5('0x30')](_0x5dfc6f['body']);}else{return _0x206b00['sendStatus'](0xc8);}})[_0x61b5('0x64')](handleError(_0x206b00,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 61892ef..83b0197 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 _0x2a07=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x441aa9,_0x40d6a6){var _0x425d6a=function(_0x54b91a){while(--_0x54b91a){_0x441aa9['push'](_0x441aa9['shift']());}};_0x425d6a(++_0x40d6a6);}(_0x2a07,0x74));var _0x72a0=function(_0x2d7ec6,_0x9f52e6){_0x2d7ec6=_0x2d7ec6-0x0;var _0x50c714=_0x2a07[_0x2d7ec6];return _0x50c714;};'use strict';var EventEmitter=require(_0x72a0('0x0'));var Plugin=require(_0x72a0('0x1'))['db'][_0x72a0('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x72a0('0x3')](0x0);var events={'afterCreate':_0x72a0('0x4'),'afterUpdate':'update','afterDestroy':_0x72a0('0x5')};function emitEvent(_0x5f7f29){return function(_0x135982,_0x45b155,_0x431f65){PluginEvents[_0x72a0('0x6')](_0x5f7f29+':'+_0x135982['id'],_0x135982);PluginEvents[_0x72a0('0x6')](_0x5f7f29,_0x135982);_0x431f65(null);};}for(var e in events){if(events[_0x72a0('0x7')](e)){var event=events[e];Plugin[_0x72a0('0x8')](e,emitEvent(event));}}module[_0x72a0('0x9')]=PluginEvents; \ No newline at end of file +var _0x8e3f=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','Plugin','save','update'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0xf8e3('0x0'));var Plugin=require(_0xf8e3('0x1'))['db'][_0xf8e3('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf8e3('0x3'),'afterUpdate':_0xf8e3('0x4'),'afterDestroy':_0xf8e3('0x5')};function emitEvent(_0x598e9c){return function(_0x15d6ea,_0x41bc05,_0x4dab56){PluginEvents[_0xf8e3('0x6')](_0x598e9c+':'+_0x15d6ea['id'],_0x15d6ea);PluginEvents[_0xf8e3('0x6')](_0x598e9c,_0x15d6ea);_0x4dab56(null);};}for(var e in events){if(events[_0xf8e3('0x7')](e)){var event=events[e];Plugin[_0xf8e3('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 033e74b..5d52084 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 _0x9957=['exports','define','Plugin','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./plugin.attributes'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x032e=['exports','define','Plugin','plugins','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./plugin.attributes'];(function(_0x36d8d9,_0x17b58a){var _0x1ac3a2=function(_0x392196){while(--_0x392196){_0x36d8d9['push'](_0x36d8d9['shift']());}};_0x1ac3a2(++_0x17b58a);}(_0x032e,0x124));var _0xe032=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x032e[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var logger=require(_0xe032('0x1'))(_0xe032('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe032('0x3'));var fs=require('fs');var path=require(_0xe032('0x4'));var rimraf=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var attributes=require(_0xe032('0x7'));module[_0xe032('0x8')]=function(_0x2ba8a0,_0x33ad0b){return _0x2ba8a0[_0xe032('0x9')](_0xe032('0xa'),attributes,{'tableName':_0xe032('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 305661b..95f198d 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 _0x3663=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','create','body','options','raw','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1aac79,_0x49166b){var _0x51dd9f=function(_0x49a021){while(--_0x49a021){_0x1aac79['push'](_0x1aac79['shift']());}};_0x51dd9f(++_0x49166b);}(_0x3663,0x1e2));var _0x3366=function(_0xf59389,_0x36dbc2){_0xf59389=_0xf59389-0x0;var _0x5ec992=_0x3663[_0xf59389];return _0x5ec992;};'use strict';var _=require(_0x3366('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3366('0x1'));var rs=require(_0x3366('0x2'));var fs=require('fs');var Redis=require(_0x3366('0x3'));var db=require(_0x3366('0x4'))['db'];var utils=require(_0x3366('0x5'));var logger=require(_0x3366('0x6'))(_0x3366('0x7'));var config=require(_0x3366('0x8'));var jayson=require(_0x3366('0x9'));var client=jayson[_0x3366('0xa')][_0x3366('0xb')]({'port':0x232a});config[_0x3366('0xc')]=_['defaults'](config[_0x3366('0xc')],{'host':_0x3366('0xd'),'port':0x18eb});var socket=require(_0x3366('0xe'))(new Redis(config['redis']));require(_0x3366('0xf'))[_0x3366('0x10')](socket);function respondWithRpcPromise(_0x504a43,_0x9ff109,_0x5605e3){return new BPromise(function(_0x27e853,_0x45fdc9){return client[_0x3366('0x11')](_0x504a43,_0x5605e3)['then'](function(_0x4eab83){logger[_0x3366('0x12')]('Plugin,\x20%s,\x20%s',_0x9ff109,_0x3366('0x13'));logger[_0x3366('0x14')](_0x3366('0x15'),_0x9ff109,_0x3366('0x13'),JSON[_0x3366('0x16')](_0x4eab83));if(_0x4eab83[_0x3366('0x17')]){if(_0x4eab83[_0x3366('0x17')][_0x3366('0x18')]===0x1f4){logger['error'](_0x3366('0x19'),_0x9ff109,_0x4eab83[_0x3366('0x17')][_0x3366('0x1a')]);return _0x45fdc9(_0x4eab83[_0x3366('0x17')][_0x3366('0x1a')]);}logger[_0x3366('0x17')](_0x3366('0x19'),_0x9ff109,_0x4eab83[_0x3366('0x17')][_0x3366('0x1a')]);return _0x27e853(_0x4eab83[_0x3366('0x17')]['message']);}else{logger[_0x3366('0x12')](_0x3366('0x19'),_0x9ff109,'request\x20sent');_0x27e853(_0x4eab83[_0x3366('0x1b')][_0x3366('0x1a')]);}})[_0x3366('0x1c')](function(_0x53b9f1){logger[_0x3366('0x17')](_0x3366('0x19'),_0x9ff109,_0x53b9f1);_0x45fdc9(_0x53b9f1);});});}exports[_0x3366('0x1d')]=function(_0xc2ef02){var _0x670ab0=this;return new Promise(function(_0x53982b,_0x1fa846){return db['Plugin'][_0x3366('0x1e')](_0xc2ef02[_0x3366('0x1f')],{'raw':_0xc2ef02['options']?_0xc2ef02[_0x3366('0x20')][_0x3366('0x21')]===undefined?!![]:![]:!![]})[_0x3366('0x22')](function(_0x5adb0d){logger[_0x3366('0x12')](_0x3366('0x1d'),_0xc2ef02);logger[_0x3366('0x14')](_0x3366('0x1d'),_0xc2ef02,JSON[_0x3366('0x16')](_0x5adb0d));_0x53982b(_0x5adb0d);})[_0x3366('0x1c')](function(_0xdecd45){logger[_0x3366('0x17')](_0x3366('0x1d'),_0xdecd45[_0x3366('0x1a')],_0xc2ef02);_0x1fa846(_0x670ab0[_0x3366('0x17')](0x1f4,_0xdecd45[_0x3366('0x1a')]));});});}; \ No newline at end of file +var _0xf2d9=['rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./plugin.socket','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Plugin','create','body','options','raw','CreatePlugin','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x57207d,_0x1edb04){var _0x35166a=function(_0x57067a){while(--_0x57067a){_0x57207d['push'](_0x57207d['shift']());}};_0x35166a(++_0x1edb04);}(_0xf2d9,0x19c));var _0x9f2d=function(_0x53ae49,_0x32dc41){_0x53ae49=_0x53ae49-0x0;var _0x34a527=_0xf2d9[_0x53ae49];return _0x34a527;};'use strict';var _=require(_0x9f2d('0x0'));var util=require(_0x9f2d('0x1'));var moment=require(_0x9f2d('0x2'));var BPromise=require(_0x9f2d('0x3'));var rs=require(_0x9f2d('0x4'));var fs=require('fs');var Redis=require(_0x9f2d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f2d('0x6'));var logger=require(_0x9f2d('0x7'))(_0x9f2d('0x8'));var config=require(_0x9f2d('0x9'));var jayson=require(_0x9f2d('0xa'));var client=jayson[_0x9f2d('0xb')]['http']({'port':0x232a});config['redis']=_[_0x9f2d('0xc')](config[_0x9f2d('0xd')],{'host':_0x9f2d('0xe'),'port':0x18eb});var socket=require(_0x9f2d('0xf'))(new Redis(config['redis']));require(_0x9f2d('0x10'))['register'](socket);function respondWithRpcPromise(_0x59abf9,_0xf135f,_0x59d406){return new BPromise(function(_0x108e8e,_0x2adbf4){return client['request'](_0x59abf9,_0x59d406)[_0x9f2d('0x11')](function(_0x1e4ab5){logger[_0x9f2d('0x12')](_0x9f2d('0x13'),_0xf135f,_0x9f2d('0x14'));logger['debug'](_0x9f2d('0x15'),_0xf135f,_0x9f2d('0x14'),JSON[_0x9f2d('0x16')](_0x1e4ab5));if(_0x1e4ab5[_0x9f2d('0x17')]){if(_0x1e4ab5[_0x9f2d('0x17')][_0x9f2d('0x18')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0xf135f,_0x1e4ab5[_0x9f2d('0x17')]['message']);return _0x2adbf4(_0x1e4ab5['error'][_0x9f2d('0x19')]);}logger['error'](_0x9f2d('0x13'),_0xf135f,_0x1e4ab5['error'][_0x9f2d('0x19')]);return _0x108e8e(_0x1e4ab5[_0x9f2d('0x17')][_0x9f2d('0x19')]);}else{logger[_0x9f2d('0x12')]('Plugin,\x20%s,\x20%s',_0xf135f,_0x9f2d('0x14'));_0x108e8e(_0x1e4ab5[_0x9f2d('0x1a')][_0x9f2d('0x19')]);}})[_0x9f2d('0x1b')](function(_0x44195a){logger[_0x9f2d('0x17')](_0x9f2d('0x13'),_0xf135f,_0x44195a);_0x2adbf4(_0x44195a);});});}exports['CreatePlugin']=function(_0x3b57ae){var _0x5d8960=this;return new Promise(function(_0x436414,_0xc41a22){return db[_0x9f2d('0x1c')][_0x9f2d('0x1d')](_0x3b57ae[_0x9f2d('0x1e')],{'raw':_0x3b57ae[_0x9f2d('0x1f')]?_0x3b57ae[_0x9f2d('0x1f')][_0x9f2d('0x20')]===undefined?!![]:![]:!![]})[_0x9f2d('0x11')](function(_0x5817cd){logger[_0x9f2d('0x12')](_0x9f2d('0x21'),_0x3b57ae);logger[_0x9f2d('0x22')](_0x9f2d('0x21'),_0x3b57ae,JSON[_0x9f2d('0x16')](_0x5817cd));_0x436414(_0x5817cd);})[_0x9f2d('0x1b')](function(_0x10f968){logger[_0x9f2d('0x17')]('CreatePlugin',_0x10f968[_0x9f2d('0x19')],_0x3b57ae);_0xc41a22(_0x5d8960[_0x9f2d('0x17')](0x1f4,_0x10f968[_0x9f2d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index df66007..b10e1f8 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 _0xf1b0=['plugin:','./plugin.events','save','remove','update','removeListener'];(function(_0x3852e7,_0x10e0e2){var _0x482cd9=function(_0x135543){while(--_0x135543){_0x3852e7['push'](_0x3852e7['shift']());}};_0x482cd9(++_0x10e0e2);}(_0xf1b0,0x151));var _0x0f1b=function(_0x1c9c24,_0x2a517b){_0x1c9c24=_0x1c9c24-0x0;var _0x349c69=_0xf1b0[_0x1c9c24];return _0x349c69;};'use strict';var PluginEvents=require(_0x0f1b('0x0'));var events=[_0x0f1b('0x1'),_0x0f1b('0x2'),_0x0f1b('0x3')];function createListener(_0x4280c3,_0x4193f3){return function(_0x4ac856){_0x4193f3['emit'](_0x4280c3,_0x4ac856);};}function removeListener(_0x37c2a5,_0x209c8d){return function(){PluginEvents[_0x0f1b('0x4')](_0x37c2a5,_0x209c8d);};}exports['register']=function(_0x28dda7){for(var _0x12f389=0x0,_0xe15b0b=events['length'];_0x12f389<_0xe15b0b;_0x12f389++){var _0x1a2b2a=events[_0x12f389];var _0x2afc75=createListener(_0x0f1b('0x5')+_0x1a2b2a,_0x28dda7);PluginEvents['on'](_0x1a2b2a,_0x2afc75);}}; \ No newline at end of file +var _0x6b5f=['save','update','emit','removeListener','plugin:','./plugin.events'];(function(_0x1927dc,_0x235225){var _0x4882dc=function(_0x419205){while(--_0x419205){_0x1927dc['push'](_0x1927dc['shift']());}};_0x4882dc(++_0x235225);}(_0x6b5f,0x119));var _0xf6b5=function(_0x10620d,_0x2d68a3){_0x10620d=_0x10620d-0x0;var _0x27123f=_0x6b5f[_0x10620d];return _0x27123f;};'use strict';var PluginEvents=require(_0xf6b5('0x0'));var events=[_0xf6b5('0x1'),'remove',_0xf6b5('0x2')];function createListener(_0x2192c2,_0x501819){return function(_0x4b6b0c){_0x501819[_0xf6b5('0x3')](_0x2192c2,_0x4b6b0c);};}function removeListener(_0x25d29e,_0x353fd3){return function(){PluginEvents[_0xf6b5('0x4')](_0x25d29e,_0x353fd3);};}exports['register']=function(_0x315de7){for(var _0x1371d4=0x0,_0x3090e4=events['length'];_0x1371d4<_0x3090e4;_0x1371d4++){var _0x44993e=events[_0x1371d4];var _0x4ab297=createListener(_0xf6b5('0x5')+_0x44993e,_0x315de7);PluginEvents['on'](_0x44993e,_0x4ab297);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 54dccd8..bf993b4 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 _0xa55d=['isAuthenticated','/:id','show','post','exports','express','../../components/auth/service','get'];(function(_0x2f9312,_0x2f5416){var _0x54e5e5=function(_0x37ba7e){while(--_0x37ba7e){_0x2f9312['push'](_0x2f9312['shift']());}};_0x54e5e5(++_0x2f5416);}(_0xa55d,0xc5));var _0xda55=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa55d[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0xda55('0x0'));var router=express['Router']();var auth=require(_0xda55('0x1'));var controller=require('./pm2.controller');router[_0xda55('0x2')]('/',auth[_0xda55('0x3')](),controller['index']);router[_0xda55('0x2')](_0xda55('0x4'),auth[_0xda55('0x3')](),controller[_0xda55('0x5')]);router[_0xda55('0x6')]('/',auth[_0xda55('0x3')](),controller['create']);router['put'](_0xda55('0x4'),auth[_0xda55('0x3')](),controller['update']);router['delete'](_0xda55('0x4'),auth[_0xda55('0x3')](),controller['destroy']);module[_0xda55('0x7')]=router; \ No newline at end of file +var _0x5c1d=['index','/:id','show','post','create','put','update','delete','destroy','exports','express','Router','../../components/auth/service','./pm2.controller','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5c1d,0xda));var _0xd5c1=function(_0x27065d,_0x22ac88){_0x27065d=_0x27065d-0x0;var _0x4e09b0=_0x5c1d[_0x27065d];return _0x4e09b0;};'use strict';var express=require(_0xd5c1('0x0'));var router=express[_0xd5c1('0x1')]();var auth=require(_0xd5c1('0x2'));var controller=require(_0xd5c1('0x3'));router[_0xd5c1('0x4')]('/',auth[_0xd5c1('0x5')](),controller[_0xd5c1('0x6')]);router['get'](_0xd5c1('0x7'),auth[_0xd5c1('0x5')](),controller[_0xd5c1('0x8')]);router[_0xd5c1('0x9')]('/',auth[_0xd5c1('0x5')](),controller[_0xd5c1('0xa')]);router[_0xd5c1('0xb')](_0xd5c1('0x7'),auth[_0xd5c1('0x5')](),controller[_0xd5c1('0xc')]);router[_0xd5c1('0xd')](_0xd5c1('0x7'),auth[_0xd5c1('0x5')](),controller[_0xd5c1('0xe')]);module[_0xd5c1('0xf')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 71224b6..562b857 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 _0x6558=['Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','name','info','error','index','list','then','express','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','restart','hasOwnProperty','send'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x6558,0xfa));var _0x8655=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x6558[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x8655('0x0'));var pm2=require(_0x8655('0x1'));var logger=require(_0x8655('0x2'))(_0x8655('0x3'));var path=require(_0x8655('0x4'));var exec=require(_0x8655('0x5'))[_0x8655('0x6')];var BPromise=require(_0x8655('0x7'));function handleEntityNotFound(_0x1f283f,_0x3f0b9a){return function(_0x44bfc2){if(!_0x44bfc2){_0x1f283f[_0x8655('0x8')](0x194);;}return _0x44bfc2;};}function respondWithResult(_0x129fbc,_0x595090){_0x595090=_0x595090||0xc8;return function(_0x46dc1e){if(_0x46dc1e){return _0x129fbc[_0x8655('0x9')](_0x595090)[_0x8655('0xa')](_0x46dc1e);}return null;};}function handleError(_0x508156,_0x3497c4){_0x3497c4=_0x3497c4||0x1f4;return function(_0x41ec83){logger['error'](_0x41ec83['stack']);if(_0x41ec83[_0x8655('0xb')]){delete _0x41ec83[_0x8655('0xb')];}_0x508156[_0x8655('0x9')](_0x3497c4)['send'](_0x41ec83);};}function execChildProcess(){return new BPromise(function(_0x4bc56b,_0x2956df){exec('npm\x20install',function(_0x1cf49e,_0x1bce3,_0x4fdb38){logger[_0x8655('0xc')](_0x1bce3);logger[_0x8655('0xc')](_0x4fdb38);if(_0x1cf49e){logger[_0x8655('0xd')](_0x1cf49e);return _0x2956df(_0x1cf49e);}return _0x4bc56b(_0x1bce3);});});}exports[_0x8655('0xe')]=function(_0x25074c,_0x1de7ff){return pm2[_0x8655('0xf')]()[_0x8655('0x10')](function(_0x1326ec){if(_0x1326ec){var _0x5f5924=_['reject'](_0x1326ec,function(_0x410b31){return _0x410b31[_0x8655('0xb')]===_0x8655('0x11')||_0x410b31['name']==='motion2';});return{'rows':_0x5f5924,'count':_0x5f5924[_0x8655('0x12')]};}return null;})[_0x8655('0x10')](respondWithResult(_0x1de7ff,null))[_0x8655('0x13')](handleError(_0x1de7ff,null));};exports[_0x8655('0x14')]=function(_0x1d2d79,_0x438db1){return pm2[_0x8655('0x15')](_0x1d2d79[_0x8655('0x16')]['id'])['then'](respondWithResult(_0x438db1,null))['then'](handleEntityNotFound(_0x438db1,null))['catch'](handleError(_0x438db1,null));};exports[_0x8655('0x17')]=function(_0x51a2e9,_0x2d38f8){if(_0x51a2e9[_0x8655('0x18')][_0x8655('0xb')]&&_0x51a2e9[_0x8655('0x18')][_0x8655('0x19')]){var _0xf32ff=path[_0x8655('0x1a')](__dirname,_0x8655('0x1b'),_0x51a2e9[_0x8655('0x18')][_0x8655('0x19')]);var _0x2754cc=process[_0x8655('0x1c')]();process[_0x8655('0x1d')](path[_0x8655('0x1e')](_0xf32ff));return execChildProcess()['then'](function(_0x28cb06){process[_0x8655('0x1d')](_0x2754cc);return pm2[_0x8655('0x1f')]({'name':_0x51a2e9[_0x8655('0x18')][_0x8655('0xb')],'script':_0xf32ff});})[_0x8655('0x10')](function(_0x5a5ca9){pm2[_0x8655('0x20')]();return _0x5a5ca9[0x0];})[_0x8655('0x10')](respondWithResult(_0x2d38f8,0xc9))[_0x8655('0x13')](handleError(_0x2d38f8,null));}else{return _0x2d38f8[_0x8655('0x9')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8655('0x21')]=function(_0x2bf70e,_0x2441d3){if(_0x2bf70e[_0x8655('0x18')]['id']){delete _0x2bf70e[_0x8655('0x18')]['id'];}var _0xe0176={'online':_0x8655('0x22'),'stopped':'stop'};if(_0xe0176[_0x8655('0x23')](_0x2bf70e[_0x8655('0x18')][_0x8655('0x9')])){return pm2[_0xe0176[_0x2bf70e[_0x8655('0x18')][_0x8655('0x9')]]](_0x2bf70e['params']['id'])[_0x8655('0x10')](respondWithResult(_0x2441d3,0xc8))[_0x8655('0x13')](handleError(_0x2441d3,null));}else{return _0x2441d3[_0x8655('0x9')](0x1f4)[_0x8655('0x24')]({'message':_0x8655('0x25')});}};exports[_0x8655('0x26')]=function(_0x20b931,_0x5d42e7){if(_0x20b931['body']['id']){delete _0x20b931[_0x8655('0x18')]['id'];}if(_0x20b931['params']['id']){return pm2[_0x8655('0x27')](_0x20b931[_0x8655('0x16')]['id'])[_0x8655('0x10')](function(_0x37b4e2){pm2[_0x8655('0x20')]();return _0x37b4e2[0x0];})[_0x8655('0x10')](respondWithResult(_0x5d42e7,null))['catch'](handleError(_0x5d42e7,null));}else{return _0x5d42e7['status'](0x1f4)['send']({'message':_0x8655('0x28')});}}; \ No newline at end of file +var _0xebb3=['index','then','reject','name','motion2','length','params','catch','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','status','json','error','stack','info'];(function(_0x142ec2,_0x5bb03d){var _0x45ef4e=function(_0x4bc513){while(--_0x4bc513){_0x142ec2['push'](_0x142ec2['shift']());}};_0x45ef4e(++_0x5bb03d);}(_0xebb3,0x104));var _0x3ebb=function(_0x321e66,_0x6dfc01){_0x321e66=_0x321e66-0x0;var _0x3bd8a7=_0xebb3[_0x321e66];return _0x3bd8a7;};'use strict';var _=require(_0x3ebb('0x0'));var pm2=require(_0x3ebb('0x1'));var logger=require(_0x3ebb('0x2'))(_0x3ebb('0x3'));var path=require(_0x3ebb('0x4'));var exec=require(_0x3ebb('0x5'))[_0x3ebb('0x6')];var BPromise=require(_0x3ebb('0x7'));function handleEntityNotFound(_0x334ba3,_0x37df74){return function(_0x326306){if(!_0x326306){_0x334ba3['sendStatus'](0x194);;}return _0x326306;};}function respondWithResult(_0xbf492d,_0x3309c4){_0x3309c4=_0x3309c4||0xc8;return function(_0x4edab4){if(_0x4edab4){return _0xbf492d[_0x3ebb('0x8')](_0x3309c4)[_0x3ebb('0x9')](_0x4edab4);}return null;};}function handleError(_0x2c4db4,_0x515588){_0x515588=_0x515588||0x1f4;return function(_0x14e8ee){logger[_0x3ebb('0xa')](_0x14e8ee[_0x3ebb('0xb')]);if(_0x14e8ee['name']){delete _0x14e8ee['name'];}_0x2c4db4[_0x3ebb('0x8')](_0x515588)['send'](_0x14e8ee);};}function execChildProcess(){return new BPromise(function(_0x5a327d,_0x86e755){exec('npm\x20install',function(_0x2660f9,_0x54d3ad,_0x2dac7b){logger[_0x3ebb('0xc')](_0x54d3ad);logger[_0x3ebb('0xc')](_0x2dac7b);if(_0x2660f9){logger[_0x3ebb('0xa')](_0x2660f9);return _0x86e755(_0x2660f9);}return _0x5a327d(_0x54d3ad);});});}exports[_0x3ebb('0xd')]=function(_0x3d714c,_0x368daa){return pm2['list']()[_0x3ebb('0xe')](function(_0x49bbb5){if(_0x49bbb5){var _0x18103a=_[_0x3ebb('0xf')](_0x49bbb5,function(_0x4ac645){return _0x4ac645[_0x3ebb('0x10')]==='express'||_0x4ac645[_0x3ebb('0x10')]===_0x3ebb('0x11');});return{'rows':_0x18103a,'count':_0x18103a[_0x3ebb('0x12')]};}return null;})[_0x3ebb('0xe')](respondWithResult(_0x368daa,null))['catch'](handleError(_0x368daa,null));};exports['show']=function(_0x5b8b6c,_0x4933c1){return pm2['describe'](_0x5b8b6c[_0x3ebb('0x13')]['id'])[_0x3ebb('0xe')](respondWithResult(_0x4933c1,null))[_0x3ebb('0xe')](handleEntityNotFound(_0x4933c1,null))[_0x3ebb('0x14')](handleError(_0x4933c1,null));};exports[_0x3ebb('0x15')]=function(_0x455b40,_0x5479f1){if(_0x455b40[_0x3ebb('0x16')][_0x3ebb('0x10')]&&_0x455b40[_0x3ebb('0x16')][_0x3ebb('0x17')]){var _0x5a9076=path[_0x3ebb('0x18')](__dirname,_0x3ebb('0x19'),_0x455b40['body'][_0x3ebb('0x17')]);var _0x4fe418=process[_0x3ebb('0x1a')]();process[_0x3ebb('0x1b')](path[_0x3ebb('0x1c')](_0x5a9076));return execChildProcess()[_0x3ebb('0xe')](function(_0x3f0b8c){process[_0x3ebb('0x1b')](_0x4fe418);return pm2[_0x3ebb('0x1d')]({'name':_0x455b40['body']['name'],'script':_0x5a9076});})[_0x3ebb('0xe')](function(_0x11ea0f){pm2[_0x3ebb('0x1e')]();return _0x11ea0f[0x0];})[_0x3ebb('0xe')](respondWithResult(_0x5479f1,0xc9))[_0x3ebb('0x14')](handleError(_0x5479f1,null));}else{return _0x5479f1[_0x3ebb('0x8')](0x1f4)[_0x3ebb('0x1f')]({'message':_0x3ebb('0x20')});}};exports[_0x3ebb('0x21')]=function(_0x336556,_0xe10e6){if(_0x336556[_0x3ebb('0x16')]['id']){delete _0x336556[_0x3ebb('0x16')]['id'];}var _0x5a9d96={'online':'restart','stopped':_0x3ebb('0x22')};if(_0x5a9d96[_0x3ebb('0x23')](_0x336556[_0x3ebb('0x16')]['status'])){return pm2[_0x5a9d96[_0x336556[_0x3ebb('0x16')][_0x3ebb('0x8')]]](_0x336556[_0x3ebb('0x13')]['id'])[_0x3ebb('0xe')](respondWithResult(_0xe10e6,0xc8))[_0x3ebb('0x14')](handleError(_0xe10e6,null));}else{return _0xe10e6[_0x3ebb('0x8')](0x1f4)['send']({'message':_0x3ebb('0x24')});}};exports['destroy']=function(_0x429c32,_0x5e95d5){if(_0x429c32['body']['id']){delete _0x429c32[_0x3ebb('0x16')]['id'];}if(_0x429c32['params']['id']){return pm2[_0x3ebb('0x25')](_0x429c32[_0x3ebb('0x13')]['id'])[_0x3ebb('0xe')](function(_0x383992){pm2[_0x3ebb('0x1e')]();return _0x383992[0x0];})['then'](respondWithResult(_0x5e95d5,null))[_0x3ebb('0x14')](handleError(_0x5e95d5,null));}else{return _0x5e95d5['status'](0x1f4)[_0x3ebb('0x1f')]({'message':_0x3ebb('0x26')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 19c9283..92e6cdd 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 _0x3419=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x460d2c,_0x1456fe){var _0x58693a=function(_0x54d8ca){while(--_0x54d8ca){_0x460d2c['push'](_0x460d2c['shift']());}};_0x58693a(++_0x1456fe);}(_0x3419,0xb3));var _0x9341=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x3419[_0x4b91c4];return _0x25cb80;};'use strict';var multer=require(_0x9341('0x0'));var util=require(_0x9341('0x1'));var path=require(_0x9341('0x2'));var timeout=require(_0x9341('0x3'));var express=require(_0x9341('0x4'));var router=express['Router']();var fs_extra=require(_0x9341('0x5'));var auth=require(_0x9341('0x6'));var interaction=require(_0x9341('0x7'));var config=require(_0x9341('0x8'));module[_0x9341('0x9')]=router; \ No newline at end of file +var _0x282b=['express','../../components/auth/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x1953b5,_0x2da792){var _0x370ccf=function(_0x392328){while(--_0x392328){_0x1953b5['push'](_0x1953b5['shift']());}};_0x370ccf(++_0x2da792);}(_0x282b,0xec));var _0xb282=function(_0x203788,_0x30b293){_0x203788=_0x203788-0x0;var _0x3c598a=_0x282b[_0x203788];return _0x3c598a;};'use strict';var multer=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var path=require(_0xb282('0x2'));var timeout=require(_0xb282('0x3'));var express=require(_0xb282('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb282('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb282('0x6'));module[_0xb282('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 fd21f67..9801685 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 _0x692c=['STRING','DATE','sequelize','INTEGER'];(function(_0x5ef4a0,_0x540e79){var _0x3bf6e0=function(_0x126a98){while(--_0x126a98){_0x5ef4a0['push'](_0x5ef4a0['shift']());}};_0x3bf6e0(++_0x540e79);}(_0x692c,0x12e));var _0xc692=function(_0x1f16c0,_0x2e658c){_0x1f16c0=_0x1f16c0-0x0;var _0x2e16c9=_0x692c[_0x1f16c0];return _0x2e16c9;};'use strict';var Sequelize=require(_0xc692('0x0'));module['exports']={'state':{'type':Sequelize[_0xc692('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc692('0x2')]},'scheduledat':{'type':Sequelize[_0xc692('0x3')]},'uniqueid':{'type':Sequelize[_0xc692('0x2')]},'starttime':{'type':Sequelize[_0xc692('0x3')]},'responsetime':{'type':Sequelize[_0xc692('0x3')]},'ringtime':{'type':Sequelize[_0xc692('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xc692('0x2')]},'membername':{'type':Sequelize[_0xc692('0x2')]}}; \ No newline at end of file +var _0xe305=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x64876f,_0x14c004){var _0x207642=function(_0x14b510){while(--_0x14b510){_0x64876f['push'](_0x64876f['shift']());}};_0x207642(++_0x14c004);}(_0xe305,0xce));var _0x5e30=function(_0x4815e2,_0x2097d0){_0x4815e2=_0x4815e2-0x0;var _0x43c670=_0xe305[_0x4815e2];return _0x43c670;};'use strict';var Sequelize=require(_0x5e30('0x0'));module[_0x5e30('0x1')]={'state':{'type':Sequelize[_0x5e30('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5e30('0x3')]},'scheduledat':{'type':Sequelize[_0x5e30('0x4')]},'uniqueid':{'type':Sequelize[_0x5e30('0x3')]},'starttime':{'type':Sequelize[_0x5e30('0x4')]},'responsetime':{'type':Sequelize[_0x5e30('0x4')]},'ringtime':{'type':Sequelize[_0x5e30('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x5e30('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 3f5d76f..08d5baf 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 _0x361d=['bluebird','path','rimraf','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util','../../config/logger','api','moment'];(function(_0x4e5b39,_0x48ae77){var _0x2e1367=function(_0x5092f3){while(--_0x5092f3){_0x4e5b39['push'](_0x4e5b39['shift']());}};_0x2e1367(++_0x48ae77);}(_0x361d,0xeb));var _0xd361=function(_0x2871f6,_0x180b80){_0x2871f6=_0x2871f6-0x0;var _0x47950b=_0x361d[_0x2871f6];return _0x47950b;};'use strict';var _=require(_0xd361('0x0'));var util=require(_0xd361('0x1'));var logger=require(_0xd361('0x2'))(_0xd361('0x3'));var moment=require(_0xd361('0x4'));var BPromise=require(_0xd361('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd361('0x6'));var rimraf=require(_0xd361('0x7'));var config=require('../../config/environment');var attributes=require(_0xd361('0x8'));module[_0xd361('0x9')]=function(_0x3e0cce,_0x451662){return _0x3e0cce[_0xd361('0xa')]('ReportAgentPreview',attributes,{'tableName':_0xd361('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8821=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','lodash'];(function(_0x56561d,_0x2f8a5a){var _0x276ffa=function(_0x279ef9){while(--_0x279ef9){_0x56561d['push'](_0x56561d['shift']());}};_0x276ffa(++_0x2f8a5a);}(_0x8821,0x1a3));var _0x1882=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x8821[_0x1deee5];return _0x1d6c3a;};'use strict';var _=require(_0x1882('0x0'));var util=require(_0x1882('0x1'));var logger=require(_0x1882('0x2'))(_0x1882('0x3'));var moment=require(_0x1882('0x4'));var BPromise=require('bluebird');var rp=require(_0x1882('0x5'));var fs=require('fs');var path=require(_0x1882('0x6'));var rimraf=require(_0x1882('0x7'));var config=require(_0x1882('0x8'));var attributes=require(_0x1882('0x9'));module[_0x1882('0xa')]=function(_0x38eb9e,_0x1fecfa){return _0x38eb9e['define'](_0x1882('0xb'),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 5e53d24..2392d57 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 _0x69c7=['jayson/promise','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','then','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x69c7,0x1cd));var _0x769c=function(_0x26fa1a,_0x5edeb6){_0x26fa1a=_0x26fa1a-0x0;var _0x4aefda=_0x69c7[_0x26fa1a];return _0x4aefda;};'use strict';var _=require(_0x769c('0x0'));var util=require(_0x769c('0x1'));var moment=require(_0x769c('0x2'));var BPromise=require(_0x769c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x769c('0x4'))['db'];var utils=require(_0x769c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x769c('0x6'));var jayson=require(_0x769c('0x7'));var client=jayson[_0x769c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d8d59,_0x52720e,_0xb21bbb){return new BPromise(function(_0x4eb548,_0xf0107c){return client[_0x769c('0x9')](_0x2d8d59,_0xb21bbb)['then'](function(_0x495b7b){logger[_0x769c('0xa')](_0x769c('0xb'),_0x52720e,_0x769c('0xc'));logger[_0x769c('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x52720e,_0x769c('0xc'),JSON['stringify'](_0x495b7b));if(_0x495b7b[_0x769c('0xe')]){if(_0x495b7b[_0x769c('0xe')][_0x769c('0xf')]===0x1f4){logger[_0x769c('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x52720e,_0x495b7b[_0x769c('0xe')]['message']);return _0xf0107c(_0x495b7b['error'][_0x769c('0x10')]);}logger[_0x769c('0xe')](_0x769c('0xb'),_0x52720e,_0x495b7b[_0x769c('0xe')]['message']);return _0x4eb548(_0x495b7b[_0x769c('0xe')][_0x769c('0x10')]);}else{logger[_0x769c('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x52720e,_0x769c('0xc'));_0x4eb548(_0x495b7b[_0x769c('0x11')]['message']);}})[_0x769c('0x12')](function(_0x17bb1b){logger['error'](_0x769c('0xb'),_0x52720e,_0x17bb1b);_0xf0107c(_0x17bb1b);});});}exports[_0x769c('0x13')]=function(_0x7396e4){var _0x5224f9=this;return new Promise(function(_0x29076a,_0x1bebdf){return db[_0x769c('0x14')][_0x769c('0x15')](_0x7396e4[_0x769c('0x16')],{'raw':_0x7396e4[_0x769c('0x17')]?_0x7396e4[_0x769c('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x769c('0x18')](function(_0x231dc9){logger['info'](_0x769c('0x13'),_0x7396e4);logger['debug'](_0x769c('0x13'),_0x7396e4,JSON[_0x769c('0x19')](_0x231dc9));_0x29076a(_0x231dc9);})[_0x769c('0x12')](function(_0x24dfbf){logger[_0x769c('0xe')]('CreateReportAgentPreview',_0x24dfbf['message'],_0x7396e4);_0x1bebdf(_0x5224f9['error'](0x1f4,_0x24dfbf[_0x769c('0x10')]));});});}; \ No newline at end of file +var _0x724c=['CreateReportAgentPreview','options','raw','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x14110b,_0x3ce4f6){var _0x33d8db=function(_0x55c02f){while(--_0x55c02f){_0x14110b['push'](_0x14110b['shift']());}};_0x33d8db(++_0x3ce4f6);}(_0x724c,0x81));var _0xc724=function(_0x993c4f,_0xf34331){_0x993c4f=_0x993c4f-0x0;var _0x479802=_0x724c[_0x993c4f];return _0x479802;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc724('0x0'));var fs=require('fs');var Redis=require(_0xc724('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xc724('0x2'));var logger=require('../../config/logger')(_0xc724('0x3'));var config=require(_0xc724('0x4'));var jayson=require(_0xc724('0x5'));var client=jayson[_0xc724('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23224b,_0x599dd5,_0x4d186a){return new BPromise(function(_0x55bb66,_0x368b61){return client['request'](_0x23224b,_0x4d186a)[_0xc724('0x7')](function(_0x5a4bc0){logger[_0xc724('0x8')](_0xc724('0x9'),_0x599dd5,_0xc724('0xa'));logger[_0xc724('0xb')](_0xc724('0xc'),_0x599dd5,'request\x20sent',JSON[_0xc724('0xd')](_0x5a4bc0));if(_0x5a4bc0[_0xc724('0xe')]){if(_0x5a4bc0[_0xc724('0xe')][_0xc724('0xf')]===0x1f4){logger[_0xc724('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x599dd5,_0x5a4bc0[_0xc724('0xe')][_0xc724('0x10')]);return _0x368b61(_0x5a4bc0['error'][_0xc724('0x10')]);}logger['error'](_0xc724('0x9'),_0x599dd5,_0x5a4bc0['error'][_0xc724('0x10')]);return _0x55bb66(_0x5a4bc0[_0xc724('0xe')]['message']);}else{logger[_0xc724('0x8')](_0xc724('0x9'),_0x599dd5,_0xc724('0xa'));_0x55bb66(_0x5a4bc0[_0xc724('0x11')][_0xc724('0x10')]);}})['catch'](function(_0xa95bc0){logger['error'](_0xc724('0x9'),_0x599dd5,_0xa95bc0);_0x368b61(_0xa95bc0);});});}exports[_0xc724('0x12')]=function(_0x5236ff){var _0x2488ef=this;return new Promise(function(_0xf0aabc,_0x69fac8){return db['ReportAgentPreview']['create'](_0x5236ff['body'],{'raw':_0x5236ff[_0xc724('0x13')]?_0x5236ff[_0xc724('0x13')][_0xc724('0x14')]===undefined?!![]:![]:!![]})[_0xc724('0x7')](function(_0x14ea7d){logger['info'](_0xc724('0x12'),_0x5236ff);logger[_0xc724('0xb')](_0xc724('0x12'),_0x5236ff,JSON[_0xc724('0xd')](_0x14ea7d));_0xf0aabc(_0x14ea7d);})['catch'](function(_0x4231aa){logger[_0xc724('0xe')](_0xc724('0x12'),_0x4231aa[_0xc724('0x10')],_0x5236ff);_0x69fac8(_0x2488ef['error'](0x1f4,_0x4231aa['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 0fd8a38..0232c4a 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 _0x6f83=['/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','util','express','Router','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts'];(function(_0x112fe4,_0x185fd7){var _0x17cfe3=function(_0x2bd0c2){while(--_0x2bd0c2){_0x112fe4['push'](_0x112fe4['shift']());}};_0x17cfe3(++_0x185fd7);}(_0x6f83,0x154));var _0x36f8=function(_0xf48e2b,_0x86f6a7){_0xf48e2b=_0xf48e2b-0x0;var _0x549b1a=_0x6f83[_0xf48e2b];return _0x549b1a;};'use strict';var multer=require('multer');var util=require(_0x36f8('0x0'));var path=require('path');var express=require(_0x36f8('0x1'));var router=express[_0x36f8('0x2')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x36f8('0x3')](_0x36f8('0x4'),auth['isAuthenticated'](),controller[_0x36f8('0x5')]);router['get'](_0x36f8('0x6'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x8')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x36f8('0x7')](),controller[_0x36f8('0x9')]);router[_0x36f8('0x3')](_0x36f8('0xa'),auth[_0x36f8('0x7')](),controller[_0x36f8('0xb')]);router[_0x36f8('0x3')](_0x36f8('0xc'),auth['isAuthenticated'](),controller[_0x36f8('0xd')]);router[_0x36f8('0x3')]('/mail/queues',auth[_0x36f8('0x7')](),controller[_0x36f8('0xe')]);router[_0x36f8('0x3')]('/mail/accounts',auth[_0x36f8('0x7')](),controller['mailAccounts']);router[_0x36f8('0x3')]('/openchannel/queues',auth[_0x36f8('0x7')](),controller[_0x36f8('0xf')]);router[_0x36f8('0x3')](_0x36f8('0x10'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x11')]);router[_0x36f8('0x3')](_0x36f8('0x12'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x13')]);router[_0x36f8('0x3')](_0x36f8('0x14'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x15')]);router[_0x36f8('0x3')](_0x36f8('0x16'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x17')]);router[_0x36f8('0x3')](_0x36f8('0x18'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x19')]);router[_0x36f8('0x3')](_0x36f8('0x1a'),auth['isAuthenticated'](),controller[_0x36f8('0x1b')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x36f8('0x7')](),controller[_0x36f8('0x1c')]);router[_0x36f8('0x3')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x36f8('0x7')](),controller[_0x36f8('0x1d')]);router['get'](_0x36f8('0x1e'),auth[_0x36f8('0x7')](),controller['showVoiceQueues']);router['put'](_0x36f8('0x1e'),auth[_0x36f8('0x7')](),controller['updateVoiceQueue']);router[_0x36f8('0x3')]('/outbound',auth['isAuthenticated'](),controller[_0x36f8('0x1f')]);router[_0x36f8('0x3')](_0x36f8('0x20'),auth['isAuthenticated'](),controller[_0x36f8('0x21')]);router[_0x36f8('0x3')](_0x36f8('0x22'),auth['isAuthenticated'](),controller[_0x36f8('0x23')]);router[_0x36f8('0x24')](_0x36f8('0x25'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x26')]);router[_0x36f8('0x3')]('/telephones',auth['isAuthenticated'](),controller['telephones']);router[_0x36f8('0x3')](_0x36f8('0x27'),auth['isAuthenticated'](),controller[_0x36f8('0x28')]);router[_0x36f8('0x3')](_0x36f8('0x29'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x2a')]);router[_0x36f8('0x3')](_0x36f8('0x2b'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x2c')]);router[_0x36f8('0x3')](_0x36f8('0x2d'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x2e')]);router[_0x36f8('0x3')](_0x36f8('0x2f'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x30')]);router[_0x36f8('0x3')](_0x36f8('0x31'),auth[_0x36f8('0x7')](),controller['openchannelQueuesWaitingInteractions']);router[_0x36f8('0x3')](_0x36f8('0x32'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x33')]);router[_0x36f8('0x3')]('/sms/queues/waitinginteractions',auth[_0x36f8('0x7')](),controller[_0x36f8('0x34')]);router[_0x36f8('0x3')](_0x36f8('0x35'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x36')]);router[_0x36f8('0x3')](_0x36f8('0x37'),auth['isAuthenticated'](),controller[_0x36f8('0x38')]);router['post'](_0x36f8('0x39'),auth['isAuthenticated'](),controller[_0x36f8('0x3a')](_0x36f8('0x3b')));router['get'](_0x36f8('0x3c'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x3d')]);router[_0x36f8('0x3e')](_0x36f8('0x3f'),auth['isAuthenticated'](),controller[_0x36f8('0x3a')](_0x36f8('0x40')));router['get'](_0x36f8('0x41'),auth[_0x36f8('0x7')](),controller['showChatQueues']);router['post'](_0x36f8('0x42'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x3a')]('fax'));router[_0x36f8('0x3')](_0x36f8('0x43'),auth[_0x36f8('0x7')](),controller['showFaxQueues']);router[_0x36f8('0x3e')](_0x36f8('0x44'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x3a')](_0x36f8('0x45')));router['get']('/openchannel/queues/:id',auth[_0x36f8('0x7')](),controller['showOpenchannelQueues']);router['post']('/sms/queues/:id/notify',auth[_0x36f8('0x7')](),controller[_0x36f8('0x3a')]('sms'));router['post'](_0x36f8('0x46'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x3a')]('whatsapp'));router['get'](_0x36f8('0x47'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x48')]);router[_0x36f8('0x3')](_0x36f8('0x49'),auth[_0x36f8('0x7')](),controller[_0x36f8('0x4a')]);router[_0x36f8('0x3e')]('/agents/:id/notify',auth[_0x36f8('0x7')](),controller[_0x36f8('0x4b')]);module[_0x36f8('0x4c')]=router; \ No newline at end of file +var _0xefaf=['fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','express','../../components/auth/service','./rpc.controller','/voice/channels','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/fax/queues/:id/notify','queueNotify'];(function(_0x4fc6dd,_0x2c505e){var _0x2b1df6=function(_0x55308c){while(--_0x55308c){_0x4fc6dd['push'](_0x4fc6dd['shift']());}};_0x2b1df6(++_0x2c505e);}(_0xefaf,0x14c));var _0xfefa=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0xefaf[_0x23b655];return _0x364b32;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require(_0xfefa('0x0'));var router=express['Router']();var auth=require(_0xfefa('0x1'));var controller=require(_0xfefa('0x2'));router['get'](_0xfefa('0x3'),auth['isAuthenticated'](),controller[_0xfefa('0x4')]);router[_0xfefa('0x5')](_0xfefa('0x6'),auth['isAuthenticated'](),controller[_0xfefa('0x7')]);router[_0xfefa('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xfefa('0x8')](),controller[_0xfefa('0x9')]);router[_0xfefa('0x5')](_0xfefa('0xa'),auth[_0xfefa('0x8')](),controller[_0xfefa('0xb')]);router[_0xfefa('0x5')](_0xfefa('0xc'),auth['isAuthenticated'](),controller['chatQueues']);router[_0xfefa('0x5')](_0xfefa('0xd'),auth['isAuthenticated'](),controller[_0xfefa('0xe')]);router[_0xfefa('0x5')](_0xfefa('0xf'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x10')]);router[_0xfefa('0x5')](_0xfefa('0x11'),auth[_0xfefa('0x8')](),controller['openchannelQueues']);router[_0xfefa('0x5')](_0xfefa('0x12'),auth['isAuthenticated'](),controller[_0xfefa('0x13')]);router[_0xfefa('0x5')](_0xfefa('0x14'),auth['isAuthenticated'](),controller[_0xfefa('0x15')]);router[_0xfefa('0x5')](_0xfefa('0x16'),auth['isAuthenticated'](),controller[_0xfefa('0x17')]);router[_0xfefa('0x5')](_0xfefa('0x18'),auth[_0xfefa('0x8')](),controller['voiceQueuesPreview']);router[_0xfefa('0x5')](_0xfefa('0x19'),auth[_0xfefa('0x8')](),controller['voiceQueuesChannels']);router[_0xfefa('0x5')](_0xfefa('0x1a'),auth['isAuthenticated'](),controller[_0xfefa('0x1b')]);router[_0xfefa('0x5')](_0xfefa('0x1c'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x1d')]);router[_0xfefa('0x5')](_0xfefa('0x1e'),auth[_0xfefa('0x8')](),controller['voiceQueuesChannelRedirect']);router[_0xfefa('0x5')](_0xfefa('0x1f'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x20')]);router[_0xfefa('0x21')](_0xfefa('0x1f'),auth['isAuthenticated'](),controller[_0xfefa('0x22')]);router[_0xfefa('0x5')](_0xfefa('0x23'),auth['isAuthenticated'](),controller['outbound']);router[_0xfefa('0x5')](_0xfefa('0x24'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x25')]);router[_0xfefa('0x5')](_0xfefa('0x26'),auth['isAuthenticated'](),controller[_0xfefa('0x27')]);router['put'](_0xfefa('0x28'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x29')]);router[_0xfefa('0x5')](_0xfefa('0x2a'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x2b')]);router[_0xfefa('0x5')](_0xfefa('0x2c'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x2d')]);router[_0xfefa('0x5')](_0xfefa('0x2e'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x2f')]);router['get'](_0xfefa('0x30'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x31')]);router['get'](_0xfefa('0x32'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x33')]);router[_0xfefa('0x5')](_0xfefa('0x34'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router['get']('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xfefa('0x35')]);router['get'](_0xfefa('0x36'),auth[_0xfefa('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xfefa('0x5')](_0xfefa('0x37'),auth['isAuthenticated'](),controller[_0xfefa('0x38')]);router[_0xfefa('0x5')](_0xfefa('0x39'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x3a')]);router[_0xfefa('0x5')](_0xfefa('0x3b'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0xfefa('0x3c')](_0xfefa('0x3d'),auth[_0xfefa('0x8')](),controller['queueNotify'](_0xfefa('0x3e')));router[_0xfefa('0x5')](_0xfefa('0x3f'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x40')]);router[_0xfefa('0x3c')](_0xfefa('0x41'),auth[_0xfefa('0x8')](),controller['queueNotify']('chat'));router[_0xfefa('0x5')]('/chat/queues/:id',auth[_0xfefa('0x8')](),controller['showChatQueues']);router[_0xfefa('0x3c')](_0xfefa('0x42'),auth['isAuthenticated'](),controller[_0xfefa('0x43')](_0xfefa('0x44')));router[_0xfefa('0x5')](_0xfefa('0x45'),auth[_0xfefa('0x8')](),controller['showFaxQueues']);router[_0xfefa('0x3c')](_0xfefa('0x46'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x43')](_0xfefa('0x47')));router[_0xfefa('0x5')](_0xfefa('0x48'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x49')]);router[_0xfefa('0x3c')](_0xfefa('0x4a'),auth['isAuthenticated'](),controller[_0xfefa('0x43')]('sms'));router['post']('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('whatsapp'));router[_0xfefa('0x5')](_0xfefa('0x4b'),auth[_0xfefa('0x8')](),controller['showSmsQueues']);router[_0xfefa('0x5')](_0xfefa('0x4c'),auth[_0xfefa('0x8')](),controller[_0xfefa('0x4d')]);router[_0xfefa('0x3c')]('/agents/:id/notify',auth[_0xfefa('0x8')](),controller[_0xfefa('0x4e')]);module[_0xfefa('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index cab88ce..08ba9f8 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 _0xf5d4=['code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','then','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','body','user','interaction','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','Message','Interaction','MessageId','InteractionId','From','TransferReport','Start','queue','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','findOne','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','create','agentTransferTimeout','lodash','../../mysqldb','api','client','http','error'];(function(_0x215c73,_0x272244){var _0x3287b2=function(_0x59c9bc){while(--_0x59c9bc){_0x215c73['push'](_0x215c73['shift']());}};_0x3287b2(++_0x272244);}(_0xf5d4,0xf6));var _0x4f5d=function(_0x380fb1,_0x2e22d8){_0x380fb1=_0x380fb1-0x0;var _0x254b86=_0xf5d4[_0x380fb1];return _0x254b86;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x4f5d('0x0'));var util=require('util');var db=require(_0x4f5d('0x1'))['db'];var logger=require('../../config/logger')(_0x4f5d('0x2'));var jayson=require('jayson/promise');var amiClient=jayson[_0x4f5d('0x3')][_0x4f5d('0x4')]({'port':0x232a});var mailClient=jayson[_0x4f5d('0x3')]['http']({'port':0x232b});var routingClient=jayson[_0x4f5d('0x3')][_0x4f5d('0x4')]({'port':0x232c});function respondWithRpcPromise(_0x3dd08d,_0x2383e4,_0x24bdd2){return new BPromise(function(_0x52348b,_0x4d2e10){var _0x15c3e8=_0x24bdd2?_0x24bdd2:amiClient;return _0x15c3e8['request'](_0x3dd08d,_0x2383e4)['then'](function(_0x26bad9){if(_0x26bad9[_0x4f5d('0x5')]){if(_0x26bad9['error'][_0x4f5d('0x6')]===0x1f4){return _0x4d2e10(_0x26bad9[_0x4f5d('0x5')][_0x4f5d('0x7')]);}return _0x52348b(_0x26bad9['error']['message']);}else{_0x52348b(_0x26bad9[_0x4f5d('0x8')]);}})[_0x4f5d('0x9')](function(_0x3e9335){_0x4d2e10(_0x3e9335);});});}function respondWithResult(_0x456e4e,_0x357be2){_0x357be2=_0x357be2||0xc8;return function(_0x4de18e){if(_0x4de18e){return _0x456e4e[_0x4f5d('0xa')](_0x357be2)[_0x4f5d('0xb')](_0x4de18e);}return _0x456e4e[_0x4f5d('0xc')](0x194);};}function handleError(_0x4346a1,_0xeaf246){_0xeaf246=_0xeaf246||0x1f4;return function(_0x774ea){logger[_0x4f5d('0x5')](_0x774ea[_0x4f5d('0xd')]);if(_0x774ea[_0x4f5d('0xe')]){delete _0x774ea[_0x4f5d('0xe')];}_0x4346a1['status'](_0xeaf246)['send'](_0x774ea);};}function findById(_0x4d138e){return function(_0xa542f9){if(!_[_0x4f5d('0xf')](_0x4d138e)&&!_[_0x4f5d('0xf')](_0xa542f9)&&!_[_0x4f5d('0xf')](_0xa542f9[_0x4f5d('0x10')])){return _[_0x4f5d('0x11')](_0xa542f9[_0x4f5d('0x10')],function(_0xdb12f6){return _0xdb12f6['id']==_0x4d138e;});}return null;};}exports[_0x4f5d('0x12')]=function(_0x525968,_0x5519a9){return respondWithRpcPromise(_0x4f5d('0x13'),_0x525968[_0x4f5d('0x14')])['then'](respondWithResult(_0x5519a9,null))['catch'](handleError(_0x5519a9,null));};exports[_0x4f5d('0x15')]=function(_0x34b492,_0x29b885){return respondWithRpcPromise(_0x4f5d('0x16'),_[_0x4f5d('0x17')](_0x34b492['query'],_0x34b492[_0x4f5d('0x18')]))[_0x4f5d('0x19')](respondWithResult(_0x29b885,null))[_0x4f5d('0x9')](handleError(_0x29b885,null));};exports[_0x4f5d('0x1a')]=function(_0x1563b3,_0x27bf88){return respondWithRpcPromise(_0x4f5d('0x1b'),_[_0x4f5d('0x17')](_0x1563b3['query'],_0x1563b3['params']))['then'](respondWithResult(_0x27bf88,null))[_0x4f5d('0x9')](handleError(_0x27bf88,null));};exports[_0x4f5d('0x1c')]=function(_0xd44f7f,_0x3cc263){return respondWithRpcPromise('VoiceQueues',_0xd44f7f[_0x4f5d('0x14')])[_0x4f5d('0x19')](respondWithResult(_0x3cc263,null))['catch'](handleError(_0x3cc263,null));};exports['showVoiceQueues']=function(_0x3a1a28,_0x3e3be){return respondWithRpcPromise(_0x4f5d('0x1d'),_0x3a1a28['query'])[_0x4f5d('0x19')](findById(_0x3a1a28[_0x4f5d('0x18')]['id']))['then'](respondWithResult(_0x3e3be,null))[_0x4f5d('0x9')](handleError(_0x3e3be,null));};exports[_0x4f5d('0x1e')]=function(_0xfa1e07,_0x342a44){return respondWithRpcPromise(_0x4f5d('0x1f'),_[_0x4f5d('0x17')](_0xfa1e07['body'],_0xfa1e07['params']))[_0x4f5d('0x19')](respondWithResult(_0x342a44,null))[_0x4f5d('0x9')](handleError(_0x342a44,null));};exports[_0x4f5d('0x20')]=function(_0x384799,_0x3ce60b){return respondWithRpcPromise(_0x4f5d('0x21'),_[_0x4f5d('0x17')](_0x384799[_0x4f5d('0x14')],_0x384799[_0x4f5d('0x18')]))['then'](respondWithResult(_0x3ce60b,null))[_0x4f5d('0x9')](handleError(_0x3ce60b,null));};exports['voiceQueuesChannels']=function(_0x54eb18,_0x52d9f1){return respondWithRpcPromise(_0x4f5d('0x22'),_0x54eb18[_0x4f5d('0x14')])[_0x4f5d('0x19')](respondWithResult(_0x52d9f1,null))['catch'](handleError(_0x52d9f1,null));};exports[_0x4f5d('0x23')]=function(_0x50e9f1,_0x1419cb){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x4f5d('0x17')](_0x50e9f1['query'],_0x50e9f1['params']))[_0x4f5d('0x19')](respondWithResult(_0x1419cb,null))[_0x4f5d('0x9')](handleError(_0x1419cb,null));};exports['voiceQueuesChannelHangup']=function(_0xf57082,_0x2eed0a){return respondWithRpcPromise(_0x4f5d('0x24'),_[_0x4f5d('0x17')](_0xf57082[_0x4f5d('0x14')],_0xf57082[_0x4f5d('0x18')]))[_0x4f5d('0x19')](respondWithResult(_0x2eed0a,null))[_0x4f5d('0x9')](handleError(_0x2eed0a,null));};exports[_0x4f5d('0x25')]=function(_0x360e04,_0x1fbda8){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0x360e04[_0x4f5d('0x14')],_0x360e04[_0x4f5d('0x18')]))[_0x4f5d('0x19')](respondWithResult(_0x1fbda8,null))[_0x4f5d('0x9')](handleError(_0x1fbda8,null));};exports[_0x4f5d('0x26')]=function(_0x15440a,_0x50a4b8){return respondWithRpcPromise(_0x4f5d('0x27'),_0x15440a[_0x4f5d('0x14')])[_0x4f5d('0x19')](respondWithResult(_0x50a4b8,null))[_0x4f5d('0x9')](handleError(_0x50a4b8,null));};exports[_0x4f5d('0x28')]=function(_0x2ae9b0,_0x58b666){return respondWithRpcPromise('OutboundChannels',_0x2ae9b0[_0x4f5d('0x14')])[_0x4f5d('0x19')](respondWithResult(_0x58b666,null))[_0x4f5d('0x9')](handleError(_0x58b666,null));};exports[_0x4f5d('0x29')]=function(_0x575080,_0xb07a47){var _0x192804;return respondWithRpcPromise(_0x4f5d('0x2a'),_0x575080['query'])[_0x4f5d('0x19')](function(_0x1ec387){_0x192804=_0x1ec387;return respondWithRpcPromise(_0x4f5d('0x2a'),_0x575080[_0x4f5d('0x14')],routingClient);})[_0x4f5d('0x19')](function(_0x54a984){return _['merge']({},_0x54a984,_0x192804);})[_0x4f5d('0x19')](respondWithResult(_0xb07a47,null))[_0x4f5d('0x9')](handleError(_0xb07a47,null));};exports['agentCapacity']=function(_0x69e898,_0x3796d7){if(_0x69e898[_0x4f5d('0x2b')]&&_0x69e898[_0x4f5d('0x2b')]['interaction']&&_0x69e898[_0x4f5d('0x2c')]&&_0x69e898[_0x4f5d('0x2c')][_0x4f5d('0xe')]){for(var _0x1630fb in _0x69e898[_0x4f5d('0x2b')][_0x4f5d('0x2d')]){if(_0x69e898[_0x4f5d('0x2b')][_0x4f5d('0x2d')]['hasOwnProperty'](_0x1630fb)){db[_0x4f5d('0x2e')][_0x4f5d('0x2f')]({'where':{'channel':_0x1630fb,'membername':_0x69e898[_0x4f5d('0x2c')]['name'],'type':_0x4f5d('0x30'),'exitAt':null,'uniqueid':_0x69e898[_0x4f5d('0x2b')][_0x4f5d('0x2d')][_0x1630fb]&&_0x69e898[_0x4f5d('0x2b')]['interaction'][_0x1630fb][_0x4f5d('0x31')]?{'$notIn':_0x69e898['body']['interaction'][_0x1630fb]}:{'$ne':null}}})[_0x4f5d('0x19')](function(_0x581fef){var _0x296598=moment()[_0x4f5d('0x32')](_0x4f5d('0x33'));for(var _0x4f4f59=0x0,_0x2a90bd=_0x581fef[_0x4f5d('0x31')];_0x4f4f59<_0x2a90bd;_0x4f4f59+=0x1){_0x581fef[_0x4f4f59][_0x4f5d('0x34')]({'exitAt':_0x296598});}});for(var _0x95ecd1=0x0;_0x95ecd1<_0x69e898['body'][_0x4f5d('0x2d')][_0x1630fb][_0x4f5d('0x31')];_0x95ecd1+=0x1){db[_0x4f5d('0x2e')][_0x4f5d('0x35')]({'where':{'channel':_0x1630fb,'membername':_0x69e898[_0x4f5d('0x2c')]['name'],'type':_0x4f5d('0x30'),'uniqueid':_0x69e898['body'][_0x4f5d('0x2d')][_0x1630fb][_0x95ecd1],'exitAt':null},'defaults':{'channel':_0x1630fb,'membername':_0x69e898['user'][_0x4f5d('0xe')],'interface':_[_0x4f5d('0xf')](_0x69e898[_0x4f5d('0x2c')]['interface'])?util[_0x4f5d('0x32')](_0x4f5d('0x36'),_0x69e898[_0x4f5d('0x2c')][_0x4f5d('0xe')]):_0x69e898[_0x4f5d('0x2c')][_0x4f5d('0x37')],'type':_0x4f5d('0x30'),'enterAt':moment()['format'](_0x4f5d('0x33')),'role':_0x4f5d('0x38'),'internal':_0x69e898[_0x4f5d('0x2c')][_0x4f5d('0x39')],'uniqueid':_0x69e898[_0x4f5d('0x2b')][_0x4f5d('0x2d')][_0x1630fb][_0x95ecd1]}});}}}}return respondWithRpcPromise(_0x4f5d('0x3a'),{'id':_0x69e898[_0x4f5d('0x18')]['id'],'capacity':_0x69e898[_0x4f5d('0x2b')][_0x4f5d('0x3b')]},routingClient)['then'](respondWithResult(_0x3796d7,null))['catch'](handleError(_0x3796d7,null));};exports[_0x4f5d('0x3c')]=function(_0x10e4eb,_0x5b9959){return respondWithRpcPromise(_0x4f5d('0x3d'),_0x10e4eb[_0x4f5d('0x14')])[_0x4f5d('0x19')](respondWithResult(_0x5b9959,null))[_0x4f5d('0x9')](handleError(_0x5b9959,null));};exports[_0x4f5d('0x3e')]=function(_0x50368e,_0x2110a5){return respondWithRpcPromise('Trunks',_0x50368e[_0x4f5d('0x14')])[_0x4f5d('0x19')](respondWithResult(_0x2110a5,null))['catch'](handleError(_0x2110a5,null));};exports['campaigns']=function(_0x158798,_0x173932){return respondWithRpcPromise(_0x4f5d('0x3f'),_0x158798[_0x4f5d('0x14')])[_0x4f5d('0x19')](respondWithResult(_0x173932,null))[_0x4f5d('0x9')](handleError(_0x173932,null));};exports[_0x4f5d('0x40')]=function(_0x3b4383,_0xbc5adc){return respondWithRpcPromise(_0x4f5d('0x41'),_0x3b4383[_0x4f5d('0x14')],routingClient)[_0x4f5d('0x19')](respondWithResult(_0xbc5adc,null))[_0x4f5d('0x9')](handleError(_0xbc5adc,null));};exports[_0x4f5d('0x42')]=function(_0x257f76,_0x22ad24){return respondWithRpcPromise(_0x4f5d('0x41'),_0x257f76['query'],routingClient)[_0x4f5d('0x19')](findById(_0x257f76[_0x4f5d('0x18')]['id']))[_0x4f5d('0x19')](respondWithResult(_0x22ad24,null))[_0x4f5d('0x9')](handleError(_0x22ad24,null));};exports[_0x4f5d('0x43')]=function(_0x4a515e,_0x5a3662){return respondWithRpcPromise(_0x4f5d('0x44'),_0x4a515e['query'],routingClient)[_0x4f5d('0x19')](respondWithResult(_0x5a3662,null))[_0x4f5d('0x9')](handleError(_0x5a3662,null));};exports['showMailQueues']=function(_0x2719f1,_0x23491c){return respondWithRpcPromise(_0x4f5d('0x44'),_0x2719f1[_0x4f5d('0x14')],routingClient)[_0x4f5d('0x19')](findById(_0x2719f1['params']['id']))[_0x4f5d('0x19')](respondWithResult(_0x23491c,null))[_0x4f5d('0x9')](handleError(_0x23491c,null));};exports['mailAccounts']=function(_0x35143d,_0x5849ed){return respondWithRpcPromise(_0x4f5d('0x45'),_0x35143d[_0x4f5d('0x14')],mailClient)[_0x4f5d('0x19')](respondWithResult(_0x5849ed,null))[_0x4f5d('0x9')](handleError(_0x5849ed,null));};exports[_0x4f5d('0x46')]=function(_0x1dbc91,_0x3636b1){return respondWithRpcPromise(_0x4f5d('0x47'),_0x1dbc91['query'],routingClient)[_0x4f5d('0x19')](respondWithResult(_0x3636b1,null))[_0x4f5d('0x9')](handleError(_0x3636b1,null));};exports[_0x4f5d('0x48')]=function(_0x38a876,_0x936c81){return respondWithRpcPromise(_0x4f5d('0x47'),_0x38a876[_0x4f5d('0x14')],routingClient)[_0x4f5d('0x19')](findById(_0x38a876[_0x4f5d('0x18')]['id']))['then'](respondWithResult(_0x936c81,null))[_0x4f5d('0x9')](handleError(_0x936c81,null));};exports[_0x4f5d('0x49')]=function(_0x52566a,_0x4d92ae){return respondWithRpcPromise(_0x4f5d('0x4a'),_0x52566a[_0x4f5d('0x14')],routingClient)[_0x4f5d('0x19')](respondWithResult(_0x4d92ae,null))[_0x4f5d('0x9')](handleError(_0x4d92ae,null));};exports[_0x4f5d('0x4b')]=function(_0x4be079,_0x5a9b17){return respondWithRpcPromise(_0x4f5d('0x4a'),_0x4be079[_0x4f5d('0x14')],routingClient)[_0x4f5d('0x19')](findById(_0x4be079[_0x4f5d('0x18')]['id']))[_0x4f5d('0x19')](respondWithResult(_0x5a9b17,null))[_0x4f5d('0x9')](handleError(_0x5a9b17,null));};exports[_0x4f5d('0x4c')]=function(_0x58810e,_0x2f6e65){return respondWithRpcPromise(_0x4f5d('0x4d'),_0x58810e['query'],routingClient)[_0x4f5d('0x19')](respondWithResult(_0x2f6e65,null))[_0x4f5d('0x9')](handleError(_0x2f6e65,null));};exports[_0x4f5d('0x4e')]=function(_0x13bf28,_0x2f68bb){return respondWithRpcPromise(_0x4f5d('0x4d'),_0x13bf28['query'],routingClient)['then'](findById(_0x13bf28[_0x4f5d('0x18')]['id']))[_0x4f5d('0x19')](respondWithResult(_0x2f68bb,null))[_0x4f5d('0x9')](handleError(_0x2f68bb,null));};exports[_0x4f5d('0x4f')]=function(_0x36e168,_0x423165){return respondWithRpcPromise(_0x4f5d('0x50'),_0x36e168[_0x4f5d('0x14')],routingClient)[_0x4f5d('0x19')](respondWithResult(_0x423165,null))[_0x4f5d('0x9')](handleError(_0x423165,null));};exports['showFaxQueues']=function(_0x349c39,_0x1bdc13){return respondWithRpcPromise(_0x4f5d('0x50'),_0x349c39['query'],routingClient)['then'](findById(_0x349c39[_0x4f5d('0x18')]['id']))[_0x4f5d('0x19')](respondWithResult(_0x1bdc13,null))[_0x4f5d('0x9')](handleError(_0x1bdc13,null));};exports[_0x4f5d('0x51')]=function(_0x5350e7,_0x37bda1){return respondWithRpcPromise(_0x4f5d('0x52'),_0x5350e7[_0x4f5d('0x14')])[_0x4f5d('0x19')](respondWithResult(_0x37bda1,null))[_0x4f5d('0x9')](handleError(_0x37bda1,null));};exports[_0x4f5d('0x53')]=function(_0x22f384,_0x593be0){return respondWithRpcPromise(_0x4f5d('0x54'),_0x22f384[_0x4f5d('0x14')],routingClient)[_0x4f5d('0x19')](respondWithResult(_0x593be0,null))[_0x4f5d('0x9')](handleError(_0x593be0,null));};exports['mailQueuesWaitingInteractions']=function(_0x4c48d1,_0x3d43ae){return respondWithRpcPromise(_0x4f5d('0x55'),_0x4c48d1['query'],routingClient)[_0x4f5d('0x19')](respondWithResult(_0x3d43ae,null))['catch'](handleError(_0x3d43ae,null));};exports[_0x4f5d('0x56')]=function(_0x4b5f8d,_0x4f4fa5){return respondWithRpcPromise(_0x4f5d('0x57'),_0x4b5f8d['query'],routingClient)[_0x4f5d('0x19')](respondWithResult(_0x4f4fa5,null))['catch'](handleError(_0x4f4fa5,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x2f0e95,_0x3d914d){return respondWithRpcPromise(_0x4f5d('0x57'),_0x2f0e95[_0x4f5d('0x14')],routingClient)['then'](function(_0x424099){if(_0x2f0e95[_0x4f5d('0x14')][_0x4f5d('0x58')]!==undefined){var _0x4abb38=_(_0x424099[_0x4f5d('0x10')])[_0x4f5d('0x59')]([_0x2f0e95['query'][_0x4f5d('0x58')],_0x2f0e95[_0x4f5d('0x18')]['id']])[_0x4f5d('0x5a')](_0x4f5d('0x5b'))[_0x4f5d('0x5c')]()[_0x4f5d('0x5d')]();return _0x424099[_0x4f5d('0x10')]['filter'](function(_0x122a81){return _0x4abb38[_0x4f5d('0x5e')](_0x122a81['queue_id'])>-0x1;});}else{return _0x424099[_0x4f5d('0x10')]['filter'](function(_0x162c44){return _0x162c44[_0x4f5d('0x5b')]===parseInt(_0x2f0e95['params']['id']);});}})[_0x4f5d('0x19')](respondWithResult(_0x3d914d,null))[_0x4f5d('0x9')](handleError(_0x3d914d,null));};exports[_0x4f5d('0x5f')]=function(_0x3da557,_0x13fff4){return respondWithRpcPromise(_0x4f5d('0x60'),_0x3da557[_0x4f5d('0x14')],routingClient)['then'](respondWithResult(_0x13fff4,null))['catch'](handleError(_0x13fff4,null));};exports[_0x4f5d('0x61')]=function(_0x3809b6,_0xdd75cb){return respondWithRpcPromise(_0x4f5d('0x62'),_0x3809b6['query'],routingClient)[_0x4f5d('0x19')](respondWithResult(_0xdd75cb,null))[_0x4f5d('0x9')](handleError(_0xdd75cb,null));};exports[_0x4f5d('0x63')]=function(_0x5a706e,_0x19409b){return respondWithRpcPromise(_0x4f5d('0x64'),_0x5a706e[_0x4f5d('0x14')],routingClient)[_0x4f5d('0x19')](respondWithResult(_0x19409b,null))['catch'](handleError(_0x19409b,null));};exports[_0x4f5d('0x65')]=function(_0x596afb){return function(_0x563497,_0x4e3a9d){var _0x5460ae,_0x20ab18;var _0x2b7a98=_[_0x4f5d('0x66')](_0x596afb);var _0x3be221=_0x596afb===_0x4f5d('0x67')?'Website':_0x4f5d('0x68');return db[_0x2b7a98+_0x4f5d('0x69')]['findOne']({'raw':!![],'where':{'id':_0x563497[_0x4f5d('0x18')]['id']}})[_0x4f5d('0x19')](function(_0x4203e5){if(_[_0x4f5d('0xf')](_0x4203e5)){throw new Error(_0x2b7a98+'\x20Queue\x20not\x20found');}_0x5460ae=_0x4203e5;return db[_0x2b7a98+_0x4f5d('0x6a')]['findOne']({'where':{'id':_0x563497[_0x4f5d('0x2b')]['messageId']},'include':[{'model':db[_0x2b7a98+'Interaction'],'as':_0x4f5d('0x6b')},{'model':db[_0x2b7a98+_0x3be221],'as':'Account'}]});})[_0x4f5d('0x19')](function(_0x4e4bf3){if(_[_0x4f5d('0xf')](_0x4e4bf3)){throw new Error(_0x2b7a98+'\x20Message\x20not\x20found');}_0x20ab18=_0x4e4bf3;return _0x4e4bf3['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x4f5d('0x19')](function(){var _0xb23cf9={'uniqueid':_0x596afb+'.'+_0x20ab18['id']+'.'+_0x20ab18['Interaction']['id'],'FromUserId':_0x563497[_0x4f5d('0x2c')]['id'],'type':'queue'};_0xb23cf9[_0x2b7a98+_0x4f5d('0x6c')]=_0x20ab18['id'];_0xb23cf9[_0x2b7a98+_0x4f5d('0x6d')]=_0x20ab18['Interaction']['id'];_0xb23cf9[_0x4f5d('0x6e')+_0x2b7a98+_0x3be221+'Id']=_0x20ab18[_0x4f5d('0x68')]['id'];_0xb23cf9['To'+_0x2b7a98+'QueueId']=_0x5460ae['id'];return db[_0x2b7a98+_0x4f5d('0x6f')]['create'](_0xb23cf9);})['then'](function(){return respondWithRpcPromise(_0x4f5d('0x70'),{'channel':_0x596afb,'interaction':_0x20ab18[_0x4f5d('0x6b')],'message':_0x20ab18,'account':_0x20ab18[_0x4f5d('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4f5d('0x71'),'appdata':_0x5460ae['name']+','+(_0x20ab18[_0x4f5d('0x68')]['queueTransferTimeout']||0x12c),'interval':_0x4f5d('0x72')}]},routingClient);})[_0x4f5d('0x19')](respondWithResult(_0x4e3a9d,null))[_0x4f5d('0x9')](handleError(_0x4e3a9d,null));};};exports[_0x4f5d('0x73')]=function(_0x3913d3,_0x6f6e94){var _0x42aa39,_0x3e2d71;if(_[_0x4f5d('0xf')](_0x3913d3[_0x4f5d('0x2b')][_0x4f5d('0x74')])){throw new Error(_0x4f5d('0x75'));}var _0x6ffd3=_0x3913d3[_0x4f5d('0x2b')]['channel'];var _0x2a60b9=_[_0x4f5d('0x66')](_0x6ffd3);var _0x2eac7a=_0x6ffd3===_0x4f5d('0x67')?_0x4f5d('0x76'):'Account';return db[_0x4f5d('0x77')][_0x4f5d('0x78')]({'raw':!![],'where':{'id':_0x3913d3['params']['id'],'role':_0x4f5d('0x38')}})[_0x4f5d('0x19')](function(_0x2ba844){if(_[_0x4f5d('0xf')](_0x2ba844)){throw new Error(_0x4f5d('0x79'));}_0x42aa39=_0x2ba844;return db[_0x2a60b9+_0x4f5d('0x6a')]['findOne']({'where':{'id':_0x3913d3[_0x4f5d('0x2b')][_0x4f5d('0x7a')]},'include':[{'model':db[_0x2a60b9+_0x4f5d('0x6b')],'as':_0x4f5d('0x6b')},{'model':db[_0x2a60b9+_0x2eac7a],'as':_0x4f5d('0x68')}]});})['then'](function(_0x2bd474){if(_[_0x4f5d('0xf')](_0x2bd474)){throw new Error(_0x2a60b9+_0x4f5d('0x7b'));}_0x3e2d71=_0x2bd474;return _0x2bd474['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x4f5d('0x19')](function(){var _0x483237={'uniqueid':_0x6ffd3+'.'+_0x3e2d71['id']+'.'+_0x3e2d71['Interaction']['id'],'FromUserId':_0x3913d3[_0x4f5d('0x2c')]['id'],'type':'queue','ToUserId':_0x42aa39['id']};_0x483237[_0x2a60b9+'MessageId']=_0x3e2d71['id'];_0x483237[_0x2a60b9+'InteractionId']=_0x3e2d71[_0x4f5d('0x6b')]['id'];_0x483237[_0x4f5d('0x6e')+_0x2a60b9+_0x2eac7a+'Id']=_0x3e2d71[_0x4f5d('0x68')]['id'];return db[_0x2a60b9+_0x4f5d('0x6f')][_0x4f5d('0x7c')](_0x483237);})['then'](function(){return respondWithRpcPromise(_0x4f5d('0x70'),{'channel':_0x6ffd3,'interaction':_0x3e2d71[_0x4f5d('0x6b')],'message':_0x3e2d71,'account':_0x3e2d71[_0x4f5d('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4f5d('0x38'),'appdata':_0x42aa39['name']+','+(_0x3e2d71['Account'][_0x4f5d('0x7d')]||0x12c),'interval':_0x4f5d('0x72')}]},routingClient);})[_0x4f5d('0x19')](respondWithResult(_0x6f6e94,null))[_0x4f5d('0x9')](handleError(_0x6f6e94,null));}; \ No newline at end of file +var _0x052c=['queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','findOne','Agent\x20not\x20found','agentTransferTimeout','bluebird','../../mysqldb','../../config/logger','api','client','http','request','error','code','message','result','catch','status','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','then','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','interaction','hasOwnProperty','MemberReport','findAll','user','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','SIP/%s','interface','INTERACTION','agent','Telephones','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','type','map','queue_id','value','indexOf','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','QueueId','TransferReport','create','Start'];(function(_0x4de572,_0x401c9a){var _0x1fea6f=function(_0x8ce172){while(--_0x8ce172){_0x4de572['push'](_0x4de572['shift']());}};_0x1fea6f(++_0x401c9a);}(_0x052c,0x183));var _0xc052=function(_0x28c0ee,_0x66267f){_0x28c0ee=_0x28c0ee-0x0;var _0x1e9a91=_0x052c[_0x28c0ee];return _0x1e9a91;};'use strict';var BPromise=require(_0xc052('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var db=require(_0xc052('0x1'))['db'];var logger=require(_0xc052('0x2'))(_0xc052('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xc052('0x4')][_0xc052('0x5')]({'port':0x232a});var mailClient=jayson['client'][_0xc052('0x5')]({'port':0x232b});var routingClient=jayson[_0xc052('0x4')][_0xc052('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x4266cf,_0x54d657,_0xd670a7){return new BPromise(function(_0x4dddb4,_0x27c777){var _0x5c8783=_0xd670a7?_0xd670a7:amiClient;return _0x5c8783[_0xc052('0x6')](_0x4266cf,_0x54d657)['then'](function(_0x1a9452){if(_0x1a9452[_0xc052('0x7')]){if(_0x1a9452[_0xc052('0x7')][_0xc052('0x8')]===0x1f4){return _0x27c777(_0x1a9452[_0xc052('0x7')][_0xc052('0x9')]);}return _0x4dddb4(_0x1a9452[_0xc052('0x7')][_0xc052('0x9')]);}else{_0x4dddb4(_0x1a9452[_0xc052('0xa')]);}})[_0xc052('0xb')](function(_0x59d7fa){_0x27c777(_0x59d7fa);});});}function respondWithResult(_0x1e8131,_0x3099c8){_0x3099c8=_0x3099c8||0xc8;return function(_0x482593){if(_0x482593){return _0x1e8131[_0xc052('0xc')](_0x3099c8)['json'](_0x482593);}return _0x1e8131['sendStatus'](0x194);};}function handleError(_0x2e32ab,_0x1fba68){_0x1fba68=_0x1fba68||0x1f4;return function(_0x2fcb4b){logger['error'](_0x2fcb4b[_0xc052('0xd')]);if(_0x2fcb4b[_0xc052('0xe')]){delete _0x2fcb4b['name'];}_0x2e32ab[_0xc052('0xc')](_0x1fba68)[_0xc052('0xf')](_0x2fcb4b);};}function findById(_0x582b4e){return function(_0x389e19){if(!_[_0xc052('0x10')](_0x582b4e)&&!_[_0xc052('0x10')](_0x389e19)&&!_[_0xc052('0x10')](_0x389e19[_0xc052('0x11')])){return _[_0xc052('0x12')](_0x389e19[_0xc052('0x11')],function(_0x3f8bb6){return _0x3f8bb6['id']==_0x582b4e;});}return null;};}exports[_0xc052('0x13')]=function(_0x531dc6,_0x35022d){return respondWithRpcPromise(_0xc052('0x14'),_0x531dc6['query'])['then'](respondWithResult(_0x35022d,null))['catch'](handleError(_0x35022d,null));};exports[_0xc052('0x15')]=function(_0x3fb829,_0x847e5a){return respondWithRpcPromise(_0xc052('0x16'),_[_0xc052('0x17')](_0x3fb829[_0xc052('0x18')],_0x3fb829[_0xc052('0x19')]))['then'](respondWithResult(_0x847e5a,null))['catch'](handleError(_0x847e5a,null));};exports[_0xc052('0x1a')]=function(_0x5e9b86,_0x5d3c83){return respondWithRpcPromise(_0xc052('0x1b'),_[_0xc052('0x17')](_0x5e9b86['query'],_0x5e9b86[_0xc052('0x19')]))['then'](respondWithResult(_0x5d3c83,null))['catch'](handleError(_0x5d3c83,null));};exports[_0xc052('0x1c')]=function(_0x4bdbf7,_0x3a4137){return respondWithRpcPromise(_0xc052('0x1d'),_0x4bdbf7[_0xc052('0x18')])['then'](respondWithResult(_0x3a4137,null))['catch'](handleError(_0x3a4137,null));};exports[_0xc052('0x1e')]=function(_0x45b1ec,_0x24dc01){return respondWithRpcPromise(_0xc052('0x1d'),_0x45b1ec[_0xc052('0x18')])['then'](findById(_0x45b1ec['params']['id']))[_0xc052('0x1f')](respondWithResult(_0x24dc01,null))[_0xc052('0xb')](handleError(_0x24dc01,null));};exports[_0xc052('0x20')]=function(_0x26e2dd,_0x2ab976){return respondWithRpcPromise(_0xc052('0x21'),_[_0xc052('0x17')](_0x26e2dd[_0xc052('0x22')],_0x26e2dd[_0xc052('0x19')]))[_0xc052('0x1f')](respondWithResult(_0x2ab976,null))[_0xc052('0xb')](handleError(_0x2ab976,null));};exports[_0xc052('0x23')]=function(_0x45ff80,_0x36181f){return respondWithRpcPromise(_0xc052('0x24'),_['merge'](_0x45ff80['query'],_0x45ff80[_0xc052('0x19')]))['then'](respondWithResult(_0x36181f,null))[_0xc052('0xb')](handleError(_0x36181f,null));};exports['voiceQueuesChannels']=function(_0x1fab5f,_0x5966f4){return respondWithRpcPromise(_0xc052('0x25'),_0x1fab5f['query'])['then'](respondWithResult(_0x5966f4,null))[_0xc052('0xb')](handleError(_0x5966f4,null));};exports[_0xc052('0x26')]=function(_0x1737b3,_0x5bac78){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x1737b3['query'],_0x1737b3[_0xc052('0x19')]))[_0xc052('0x1f')](respondWithResult(_0x5bac78,null))[_0xc052('0xb')](handleError(_0x5bac78,null));};exports['voiceQueuesChannelHangup']=function(_0x3170b7,_0xcc89a5){return respondWithRpcPromise(_0xc052('0x27'),_[_0xc052('0x17')](_0x3170b7['query'],_0x3170b7[_0xc052('0x19')]))[_0xc052('0x1f')](respondWithResult(_0xcc89a5,null))[_0xc052('0xb')](handleError(_0xcc89a5,null));};exports[_0xc052('0x28')]=function(_0x5d30f0,_0x3d7e45){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xc052('0x17')](_0x5d30f0[_0xc052('0x18')],_0x5d30f0[_0xc052('0x19')]))[_0xc052('0x1f')](respondWithResult(_0x3d7e45,null))['catch'](handleError(_0x3d7e45,null));};exports[_0xc052('0x29')]=function(_0x3c42f6,_0x5b6e8c){return respondWithRpcPromise(_0xc052('0x2a'),_0x3c42f6[_0xc052('0x18')])[_0xc052('0x1f')](respondWithResult(_0x5b6e8c,null))[_0xc052('0xb')](handleError(_0x5b6e8c,null));};exports[_0xc052('0x2b')]=function(_0x56b33b,_0x3df31e){return respondWithRpcPromise(_0xc052('0x2c'),_0x56b33b[_0xc052('0x18')])[_0xc052('0x1f')](respondWithResult(_0x3df31e,null))[_0xc052('0xb')](handleError(_0x3df31e,null));};exports[_0xc052('0x2d')]=function(_0x7b88e5,_0x32265d){var _0x3c596f;return respondWithRpcPromise(_0xc052('0x2e'),_0x7b88e5['query'])[_0xc052('0x1f')](function(_0x5e6762){_0x3c596f=_0x5e6762;return respondWithRpcPromise('Agents',_0x7b88e5[_0xc052('0x18')],routingClient);})[_0xc052('0x1f')](function(_0x2c8080){return _['merge']({},_0x2c8080,_0x3c596f);})[_0xc052('0x1f')](respondWithResult(_0x32265d,null))['catch'](handleError(_0x32265d,null));};exports['agentCapacity']=function(_0x57df89,_0x53dfed){if(_0x57df89[_0xc052('0x22')]&&_0x57df89[_0xc052('0x22')]['interaction']&&_0x57df89['user']&&_0x57df89['user']['name']){for(var _0x196c22 in _0x57df89['body'][_0xc052('0x2f')]){if(_0x57df89[_0xc052('0x22')][_0xc052('0x2f')][_0xc052('0x30')](_0x196c22)){db[_0xc052('0x31')][_0xc052('0x32')]({'where':{'channel':_0x196c22,'membername':_0x57df89[_0xc052('0x33')][_0xc052('0xe')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x57df89[_0xc052('0x22')]['interaction'][_0x196c22]&&_0x57df89[_0xc052('0x22')][_0xc052('0x2f')][_0x196c22][_0xc052('0x34')]?{'$notIn':_0x57df89[_0xc052('0x22')][_0xc052('0x2f')][_0x196c22]}:{'$ne':null}}})[_0xc052('0x1f')](function(_0x2e4289){var _0xc5b25=moment()[_0xc052('0x35')](_0xc052('0x36'));for(var _0xdaeccd=0x0,_0x29912b=_0x2e4289[_0xc052('0x34')];_0xdaeccd<_0x29912b;_0xdaeccd+=0x1){_0x2e4289[_0xdaeccd][_0xc052('0x37')]({'exitAt':_0xc5b25});}});for(var _0x2bd9ea=0x0;_0x2bd9ea<_0x57df89[_0xc052('0x22')]['interaction'][_0x196c22][_0xc052('0x34')];_0x2bd9ea+=0x1){db[_0xc052('0x31')][_0xc052('0x38')]({'where':{'channel':_0x196c22,'membername':_0x57df89[_0xc052('0x33')]['name'],'type':'INTERACTION','uniqueid':_0x57df89['body'][_0xc052('0x2f')][_0x196c22][_0x2bd9ea],'exitAt':null},'defaults':{'channel':_0x196c22,'membername':_0x57df89[_0xc052('0x33')][_0xc052('0xe')],'interface':_[_0xc052('0x10')](_0x57df89[_0xc052('0x33')]['interface'])?util[_0xc052('0x35')](_0xc052('0x39'),_0x57df89[_0xc052('0x33')][_0xc052('0xe')]):_0x57df89[_0xc052('0x33')][_0xc052('0x3a')],'type':_0xc052('0x3b'),'enterAt':moment()[_0xc052('0x35')](_0xc052('0x36')),'role':_0xc052('0x3c'),'internal':_0x57df89['user']['internal'],'uniqueid':_0x57df89[_0xc052('0x22')][_0xc052('0x2f')][_0x196c22][_0x2bd9ea]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x57df89[_0xc052('0x19')]['id'],'capacity':_0x57df89[_0xc052('0x22')]['capacity']},routingClient)['then'](respondWithResult(_0x53dfed,null))[_0xc052('0xb')](handleError(_0x53dfed,null));};exports['telephones']=function(_0x5adc8b,_0x247382){return respondWithRpcPromise(_0xc052('0x3d'),_0x5adc8b[_0xc052('0x18')])[_0xc052('0x1f')](respondWithResult(_0x247382,null))[_0xc052('0xb')](handleError(_0x247382,null));};exports['trunks']=function(_0x4583ec,_0x4965cc){return respondWithRpcPromise(_0xc052('0x3e'),_0x4583ec['query'])[_0xc052('0x1f')](respondWithResult(_0x4965cc,null))[_0xc052('0xb')](handleError(_0x4965cc,null));};exports[_0xc052('0x3f')]=function(_0x3c6cdc,_0x596c96){return respondWithRpcPromise('Campaigns',_0x3c6cdc[_0xc052('0x18')])[_0xc052('0x1f')](respondWithResult(_0x596c96,null))[_0xc052('0xb')](handleError(_0x596c96,null));};exports[_0xc052('0x40')]=function(_0x13e775,_0x15ab08){return respondWithRpcPromise(_0xc052('0x41'),_0x13e775[_0xc052('0x18')],routingClient)['then'](respondWithResult(_0x15ab08,null))[_0xc052('0xb')](handleError(_0x15ab08,null));};exports[_0xc052('0x42')]=function(_0x419e3e,_0x1ad314){return respondWithRpcPromise(_0xc052('0x41'),_0x419e3e[_0xc052('0x18')],routingClient)[_0xc052('0x1f')](findById(_0x419e3e[_0xc052('0x19')]['id']))[_0xc052('0x1f')](respondWithResult(_0x1ad314,null))[_0xc052('0xb')](handleError(_0x1ad314,null));};exports[_0xc052('0x43')]=function(_0x4e7ada,_0x179e89){return respondWithRpcPromise(_0xc052('0x44'),_0x4e7ada[_0xc052('0x18')],routingClient)[_0xc052('0x1f')](respondWithResult(_0x179e89,null))[_0xc052('0xb')](handleError(_0x179e89,null));};exports[_0xc052('0x45')]=function(_0x2277f0,_0x3c24a9){return respondWithRpcPromise(_0xc052('0x44'),_0x2277f0[_0xc052('0x18')],routingClient)['then'](findById(_0x2277f0['params']['id']))[_0xc052('0x1f')](respondWithResult(_0x3c24a9,null))[_0xc052('0xb')](handleError(_0x3c24a9,null));};exports['mailAccounts']=function(_0x54ea81,_0x473a31){return respondWithRpcPromise(_0xc052('0x46'),_0x54ea81[_0xc052('0x18')],mailClient)['then'](respondWithResult(_0x473a31,null))['catch'](handleError(_0x473a31,null));};exports['openchannelQueues']=function(_0x44189c,_0x1df057){return respondWithRpcPromise(_0xc052('0x47'),_0x44189c[_0xc052('0x18')],routingClient)[_0xc052('0x1f')](respondWithResult(_0x1df057,null))[_0xc052('0xb')](handleError(_0x1df057,null));};exports[_0xc052('0x48')]=function(_0xe97b6c,_0x562400){return respondWithRpcPromise(_0xc052('0x47'),_0xe97b6c[_0xc052('0x18')],routingClient)[_0xc052('0x1f')](findById(_0xe97b6c[_0xc052('0x19')]['id']))[_0xc052('0x1f')](respondWithResult(_0x562400,null))['catch'](handleError(_0x562400,null));};exports[_0xc052('0x49')]=function(_0x3207c1,_0x579b0d){return respondWithRpcPromise('SmsQueues',_0x3207c1[_0xc052('0x18')],routingClient)['then'](respondWithResult(_0x579b0d,null))[_0xc052('0xb')](handleError(_0x579b0d,null));};exports[_0xc052('0x4a')]=function(_0x2a0bbc,_0x341b24){return respondWithRpcPromise(_0xc052('0x4b'),_0x2a0bbc['query'],routingClient)[_0xc052('0x1f')](findById(_0x2a0bbc['params']['id']))[_0xc052('0x1f')](respondWithResult(_0x341b24,null))[_0xc052('0xb')](handleError(_0x341b24,null));};exports[_0xc052('0x4c')]=function(_0x52dcd9,_0x138a17){return respondWithRpcPromise(_0xc052('0x4d'),_0x52dcd9[_0xc052('0x18')],routingClient)[_0xc052('0x1f')](respondWithResult(_0x138a17,null))['catch'](handleError(_0x138a17,null));};exports[_0xc052('0x4e')]=function(_0x2ab641,_0x3fbe2c){return respondWithRpcPromise(_0xc052('0x4d'),_0x2ab641[_0xc052('0x18')],routingClient)['then'](findById(_0x2ab641['params']['id']))['then'](respondWithResult(_0x3fbe2c,null))[_0xc052('0xb')](handleError(_0x3fbe2c,null));};exports['faxQueues']=function(_0x3dd17c,_0x426443){return respondWithRpcPromise(_0xc052('0x4f'),_0x3dd17c[_0xc052('0x18')],routingClient)['then'](respondWithResult(_0x426443,null))[_0xc052('0xb')](handleError(_0x426443,null));};exports[_0xc052('0x50')]=function(_0x552e06,_0x54a42d){return respondWithRpcPromise(_0xc052('0x4f'),_0x552e06['query'],routingClient)[_0xc052('0x1f')](findById(_0x552e06[_0xc052('0x19')]['id']))[_0xc052('0x1f')](respondWithResult(_0x54a42d,null))['catch'](handleError(_0x54a42d,null));};exports[_0xc052('0x51')]=function(_0x51470a,_0x26f4f4){return respondWithRpcPromise(_0xc052('0x52'),_0x51470a[_0xc052('0x18')])[_0xc052('0x1f')](respondWithResult(_0x26f4f4,null))[_0xc052('0xb')](handleError(_0x26f4f4,null));};exports[_0xc052('0x53')]=function(_0x452cdc,_0x15fd98){return respondWithRpcPromise(_0xc052('0x54'),_0x452cdc[_0xc052('0x18')],routingClient)['then'](respondWithResult(_0x15fd98,null))[_0xc052('0xb')](handleError(_0x15fd98,null));};exports[_0xc052('0x55')]=function(_0x3c3f6f,_0x4bdd5b){return respondWithRpcPromise(_0xc052('0x56'),_0x3c3f6f[_0xc052('0x18')],routingClient)['then'](respondWithResult(_0x4bdd5b,null))[_0xc052('0xb')](handleError(_0x4bdd5b,null));};exports[_0xc052('0x57')]=function(_0x530375,_0x39d42d){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x530375[_0xc052('0x18')],routingClient)[_0xc052('0x1f')](respondWithResult(_0x39d42d,null))[_0xc052('0xb')](handleError(_0x39d42d,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x44e134,_0x1a5dbe){return respondWithRpcPromise(_0xc052('0x58'),_0x44e134[_0xc052('0x18')],routingClient)[_0xc052('0x1f')](function(_0x3fd263){if(_0x44e134[_0xc052('0x18')]['type']!==undefined){var _0xcb5659=_(_0x3fd263[_0xc052('0x11')])[_0xc052('0x59')]([_0x44e134['query'][_0xc052('0x5a')],_0x44e134[_0xc052('0x19')]['id']])[_0xc052('0x5b')](_0xc052('0x5c'))['uniq']()[_0xc052('0x5d')]();return _0x3fd263[_0xc052('0x11')][_0xc052('0x59')](function(_0x4385c4){return _0xcb5659[_0xc052('0x5e')](_0x4385c4[_0xc052('0x5c')])>-0x1;});}else{return _0x3fd263[_0xc052('0x11')][_0xc052('0x59')](function(_0x258f49){return _0x258f49['queue_id']===parseInt(_0x44e134[_0xc052('0x19')]['id']);});}})[_0xc052('0x1f')](respondWithResult(_0x1a5dbe,null))[_0xc052('0xb')](handleError(_0x1a5dbe,null));};exports['smsQueuesWaitingInteractions']=function(_0x47c451,_0x443c5f){return respondWithRpcPromise(_0xc052('0x5f'),_0x47c451[_0xc052('0x18')],routingClient)[_0xc052('0x1f')](respondWithResult(_0x443c5f,null))[_0xc052('0xb')](handleError(_0x443c5f,null));};exports[_0xc052('0x60')]=function(_0x3e8708,_0x1efc0a){return respondWithRpcPromise(_0xc052('0x61'),_0x3e8708['query'],routingClient)[_0xc052('0x1f')](respondWithResult(_0x1efc0a,null))[_0xc052('0xb')](handleError(_0x1efc0a,null));};exports[_0xc052('0x62')]=function(_0x4d144b,_0x3a315a){return respondWithRpcPromise(_0xc052('0x63'),_0x4d144b[_0xc052('0x18')],routingClient)[_0xc052('0x1f')](respondWithResult(_0x3a315a,null))[_0xc052('0xb')](handleError(_0x3a315a,null));};exports[_0xc052('0x64')]=function(_0x2e2817){return function(_0x28c07b,_0x55d5c0){var _0xf5a7c8,_0x16aefa;var _0x1e6ab1=_[_0xc052('0x65')](_0x2e2817);var _0x400bb6=_0x2e2817===_0xc052('0x66')?_0xc052('0x67'):_0xc052('0x68');return db[_0x1e6ab1+_0xc052('0x69')]['findOne']({'raw':!![],'where':{'id':_0x28c07b['params']['id']}})[_0xc052('0x1f')](function(_0x9a4c9c){if(_[_0xc052('0x10')](_0x9a4c9c)){throw new Error(_0x1e6ab1+_0xc052('0x6a'));}_0xf5a7c8=_0x9a4c9c;return db[_0x1e6ab1+_0xc052('0x6b')]['findOne']({'where':{'id':_0x28c07b[_0xc052('0x22')][_0xc052('0x6c')]},'include':[{'model':db[_0x1e6ab1+_0xc052('0x6d')],'as':_0xc052('0x6d')},{'model':db[_0x1e6ab1+_0x400bb6],'as':_0xc052('0x68')}]});})[_0xc052('0x1f')](function(_0x169a81){if(_[_0xc052('0x10')](_0x169a81)){throw new Error(_0x1e6ab1+_0xc052('0x6e'));}_0x16aefa=_0x169a81;return _0x169a81[_0xc052('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xc052('0x1f')](function(){var _0x55b098={'uniqueid':_0x2e2817+'.'+_0x16aefa['id']+'.'+_0x16aefa['Interaction']['id'],'FromUserId':_0x28c07b['user']['id'],'type':_0xc052('0x70')};_0x55b098[_0x1e6ab1+'MessageId']=_0x16aefa['id'];_0x55b098[_0x1e6ab1+'InteractionId']=_0x16aefa[_0xc052('0x6d')]['id'];_0x55b098['From'+_0x1e6ab1+_0x400bb6+'Id']=_0x16aefa['Account']['id'];_0x55b098['To'+_0x1e6ab1+_0xc052('0x71')]=_0xf5a7c8['id'];return db[_0x1e6ab1+_0xc052('0x72')][_0xc052('0x73')](_0x55b098);})[_0xc052('0x1f')](function(){return respondWithRpcPromise(_0xc052('0x74'),{'channel':_0x2e2817,'interaction':_0x16aefa[_0xc052('0x6d')],'message':_0x16aefa,'account':_0x16aefa[_0xc052('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0xf5a7c8[_0xc052('0xe')]+','+(_0x16aefa[_0xc052('0x68')][_0xc052('0x75')]||0x12c),'interval':_0xc052('0x76')}]},routingClient);})[_0xc052('0x1f')](respondWithResult(_0x55d5c0,null))['catch'](handleError(_0x55d5c0,null));};};exports[_0xc052('0x77')]=function(_0x18a2d3,_0x25724a){var _0xda1c79,_0x129b85;if(_[_0xc052('0x10')](_0x18a2d3[_0xc052('0x22')][_0xc052('0x78')])){throw new Error(_0xc052('0x79'));}var _0xa6a6cd=_0x18a2d3[_0xc052('0x22')][_0xc052('0x78')];var _0x5a3def=_[_0xc052('0x65')](_0xa6a6cd);var _0x46e24b=_0xa6a6cd===_0xc052('0x66')?_0xc052('0x67'):_0xc052('0x68');return db[_0xc052('0x7a')][_0xc052('0x7b')]({'raw':!![],'where':{'id':_0x18a2d3['params']['id'],'role':'agent'}})[_0xc052('0x1f')](function(_0x401012){if(_[_0xc052('0x10')](_0x401012)){throw new Error(_0xc052('0x7c'));}_0xda1c79=_0x401012;return db[_0x5a3def+_0xc052('0x6b')][_0xc052('0x7b')]({'where':{'id':_0x18a2d3[_0xc052('0x22')]['messageId']},'include':[{'model':db[_0x5a3def+_0xc052('0x6d')],'as':_0xc052('0x6d')},{'model':db[_0x5a3def+_0x46e24b],'as':_0xc052('0x68')}]});})['then'](function(_0x30b76e){if(_['isNil'](_0x30b76e)){throw new Error(_0x5a3def+'\x20Message\x20not\x20found');}_0x129b85=_0x30b76e;return _0x30b76e[_0xc052('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x52e000={'uniqueid':_0xa6a6cd+'.'+_0x129b85['id']+'.'+_0x129b85['Interaction']['id'],'FromUserId':_0x18a2d3[_0xc052('0x33')]['id'],'type':_0xc052('0x70'),'ToUserId':_0xda1c79['id']};_0x52e000[_0x5a3def+'MessageId']=_0x129b85['id'];_0x52e000[_0x5a3def+'InteractionId']=_0x129b85[_0xc052('0x6d')]['id'];_0x52e000['From'+_0x5a3def+_0x46e24b+'Id']=_0x129b85[_0xc052('0x68')]['id'];return db[_0x5a3def+_0xc052('0x72')][_0xc052('0x73')](_0x52e000);})[_0xc052('0x1f')](function(){return respondWithRpcPromise('Start',{'channel':_0xa6a6cd,'interaction':_0x129b85[_0xc052('0x6d')],'message':_0x129b85,'account':_0x129b85[_0xc052('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xc052('0x3c'),'appdata':_0xda1c79[_0xc052('0xe')]+','+(_0x129b85[_0xc052('0x68')][_0xc052('0x7d')]||0x12c),'interval':_0xc052('0x76')}]},routingClient);})[_0xc052('0x1f')](respondWithResult(_0x25724a,null))[_0xc052('0xb')](handleError(_0x25724a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 4a83bae..ad03f72 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 _0x0c9c=['put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id','show','run','post','create'];(function(_0x318f3d,_0x46f5d0){var _0x16c61f=function(_0x45b36d){while(--_0x45b36d){_0x318f3d['push'](_0x318f3d['shift']());}};_0x16c61f(++_0x46f5d0);}(_0x0c9c,0xdf));var _0xc0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc0c9('0x0'));var util=require(_0xc0c9('0x1'));var path=require(_0xc0c9('0x2'));var timeout=require(_0xc0c9('0x3'));var express=require(_0xc0c9('0x4'));var router=express['Router']();var fs_extra=require(_0xc0c9('0x5'));var auth=require(_0xc0c9('0x6'));var interaction=require(_0xc0c9('0x7'));var config=require('../../config/environment');var controller=require(_0xc0c9('0x8'));router[_0xc0c9('0x9')]('/',auth[_0xc0c9('0xa')](),controller[_0xc0c9('0xb')]);router[_0xc0c9('0x9')](_0xc0c9('0xc'),auth[_0xc0c9('0xa')](),controller[_0xc0c9('0xd')]);router[_0xc0c9('0x9')]('/:id/run',auth[_0xc0c9('0xa')](),controller[_0xc0c9('0xe')]);router[_0xc0c9('0xf')]('/',auth[_0xc0c9('0xa')](),controller[_0xc0c9('0x10')]);router[_0xc0c9('0x11')](_0xc0c9('0xc'),auth[_0xc0c9('0xa')](),controller[_0xc0c9('0x12')]);router['delete']('/:id',auth[_0xc0c9('0xa')](),controller[_0xc0c9('0x13')]);module['exports']=router; \ No newline at end of file +var _0xb404=['index','/:id','isAuthenticated','show','/:id/run','post','create','put','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3a3090,_0x1cd75d){var _0x18f91b=function(_0x5dc793){while(--_0x5dc793){_0x3a3090['push'](_0x3a3090['shift']());}};_0x18f91b(++_0x1cd75d);}(_0xb404,0x139));var _0x4b40=function(_0x23d57f,_0x4b5d1f){_0x23d57f=_0x23d57f-0x0;var _0x2db64f=_0xb404[_0x23d57f];return _0x2db64f;};'use strict';var multer=require(_0x4b40('0x0'));var util=require(_0x4b40('0x1'));var path=require(_0x4b40('0x2'));var timeout=require(_0x4b40('0x3'));var express=require(_0x4b40('0x4'));var router=express[_0x4b40('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4b40('0x6'));var interaction=require(_0x4b40('0x7'));var config=require(_0x4b40('0x8'));var controller=require('./schedule.controller');router[_0x4b40('0x9')]('/',auth['isAuthenticated'](),controller[_0x4b40('0xa')]);router[_0x4b40('0x9')](_0x4b40('0xb'),auth[_0x4b40('0xc')](),controller[_0x4b40('0xd')]);router[_0x4b40('0x9')](_0x4b40('0xe'),auth[_0x4b40('0xc')](),controller['run']);router[_0x4b40('0xf')]('/',auth[_0x4b40('0xc')](),controller[_0x4b40('0x10')]);router[_0x4b40('0x11')](_0x4b40('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4b40('0x12')](_0x4b40('0xb'),auth[_0x4b40('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index a8d73ae..3b96a1d 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 _0xf96b=['pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','days','hours','minutes','csv'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xf96b,0x109));var _0xbf96=function(_0x25a7fd,_0x313b1d){_0x25a7fd=_0x25a7fd-0x0;var _0x1d755f=_0xf96b[_0x25a7fd];return _0x1d755f;};'use strict';var Sequelize=require(_0xbf96('0x0'));module[_0xbf96('0x1')]={'name':{'type':Sequelize[_0xbf96('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbf96('0x2')]},'active':{'type':Sequelize[_0xbf96('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xbf96('0x2')],'allowNull':![],'defaultValue':_0xbf96('0x4')},'startAt':{'type':Sequelize[_0xbf96('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xbf96('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xbf96('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xbf96('0x7')](_0xbf96('0x8'),_0xbf96('0x9'),'months',_0xbf96('0xa'),_0xbf96('0xb'),_0xbf96('0xc'),_0xbf96('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xbf96('0x7')](_0xbf96('0xe'),_0xbf96('0xf'),_0xbf96('0x10')),'allowNull':![],'defaultValue':_0xbf96('0xe')},'type':{'type':Sequelize[_0xbf96('0x7')](_0xbf96('0x11'),_0xbf96('0x12')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xbf96('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xbf96('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xbf96('0x13')]},'sendIfEmpty':{'type':Sequelize[_0xbf96('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe7de=['0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','csv','pdf','xlsx','custom','TEXT','BOOLEAN','sequelize','exports','STRING'];(function(_0x7939ec,_0x5e96b2){var _0x2cc215=function(_0x21a7f8){while(--_0x21a7f8){_0x7939ec['push'](_0x7939ec['shift']());}};_0x2cc215(++_0x5e96b2);}(_0xe7de,0x165));var _0xee7d=function(_0x1542bd,_0x5dd179){_0x1542bd=_0x1542bd-0x0;var _0x42ad1a=_0xe7de[_0x1542bd];return _0x42ad1a;};'use strict';var Sequelize=require(_0xee7d('0x0'));module[_0xee7d('0x1')]={'name':{'type':Sequelize[_0xee7d('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xee7d('0x2')],'allowNull':![],'defaultValue':_0xee7d('0x3')},'startAt':{'type':Sequelize[_0xee7d('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xee7d('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xee7d('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xee7d('0x6')](_0xee7d('0x7'),_0xee7d('0x8'),_0xee7d('0x9'),_0xee7d('0xa'),_0xee7d('0xb'),_0xee7d('0xc'),_0xee7d('0xd')),'allowNull':![],'defaultValue':_0xee7d('0xb')},'output':{'type':Sequelize['ENUM'](_0xee7d('0xe'),_0xee7d('0xf'),_0xee7d('0x10')),'allowNull':![],'defaultValue':_0xee7d('0xe')},'type':{'type':Sequelize[_0xee7d('0x6')](_0xee7d('0x11'),'default'),'allowNull':![],'defaultValue':_0xee7d('0x11')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xee7d('0x2')]},'cc':{'type':Sequelize[_0xee7d('0x12')]},'bcc':{'type':Sequelize[_0xee7d('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xee7d('0x13')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index c25f8c2..cebcb71 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 _0x76dc=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','../../config/schedule','run','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','stack','name','send','Schedule','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields'];(function(_0x15ec4e,_0x40b7e0){var _0xb5e5dd=function(_0x42bdd7){while(--_0x42bdd7){_0x15ec4e['push'](_0x15ec4e['shift']());}};_0xb5e5dd(++_0x40b7e0);}(_0x76dc,0x1a0));var _0xc76d=function(_0x320da1,_0x31e289){_0x320da1=_0x320da1-0x0;var _0x1a9db5=_0x76dc[_0x320da1];return _0x1a9db5;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc76d('0x3'));var moment=require('moment');var BPromise=require(_0xc76d('0x4'));var Mustache=require('mustache');var util=require(_0xc76d('0x5'));var path=require(_0xc76d('0x6'));var sox=require(_0xc76d('0x7'));var csv=require(_0xc76d('0x8'));var ejs=require(_0xc76d('0x9'));var fs=require('fs');var fs_extra=require(_0xc76d('0xa'));var _=require('lodash');var squel=require(_0xc76d('0xb'));var crypto=require('crypto');var jsforce=require(_0xc76d('0xc'));var deskjs=require(_0xc76d('0xd'));var toCsv=require(_0xc76d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc76d('0xe'));var authService=require(_0xc76d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc76d('0x10'));var hardwareService=require(_0xc76d('0x11'));var logger=require(_0xc76d('0x12'))(_0xc76d('0x13'));var utils=require(_0xc76d('0x14'));var config=require(_0xc76d('0x15'));var licenseUtil=require(_0xc76d('0x16'));var db=require(_0xc76d('0x17'))['db'];function respondWithStatusCode(_0x3c03af,_0x95c397){_0x95c397=_0x95c397||0xcc;return function(_0x589ea2){if(_0x589ea2){return _0x3c03af['sendStatus'](_0x95c397);}return _0x3c03af[_0xc76d('0x18')](_0x95c397)['end']();};}function respondWithResult(_0x12321f,_0x5ee526){_0x5ee526=_0x5ee526||0xc8;return function(_0x385da3){if(_0x385da3){return _0x12321f[_0xc76d('0x18')](_0x5ee526)['json'](_0x385da3);}};}function respondWithFilteredResult(_0x5b6212,_0x2abd0a){return function(_0x2f1479){if(_0x2f1479){var _0x1b1bd4=_0x2f1479['count'],_0x1d054a=_0x2abd0a[_0xc76d('0x19')],_0x2248cf=_0x2abd0a[_0xc76d('0x19')]+_0x2abd0a[_0xc76d('0x1a')],_0x412404;if(_0x2248cf>=_0x1b1bd4){_0x2248cf=_0x1b1bd4;_0x412404=0xc8;}else{_0x412404=0xce;}_0x5b6212[_0xc76d('0x18')](_0x412404);return _0x5b6212['set'](_0xc76d('0x1b'),_0x1d054a+'-'+_0x2248cf+'/'+_0x1b1bd4)['json'](_0x2f1479);}return null;};}function patchUpdates(_0x4350b2){return function(_0x326415){try{jsonpatch['apply'](_0x326415,_0x4350b2,!![]);}catch(_0x17a231){return BPromise[_0xc76d('0x1c')](_0x17a231);}return _0x326415[_0xc76d('0x1d')]();};}function saveUpdates(_0x3ab49b,_0x4c502a){return function(_0x5ec342){if(_0x5ec342){return _0x5ec342[_0xc76d('0x1e')](_0x3ab49b)[_0xc76d('0x1f')](function(_0x49eda5){return _0x49eda5;});}return null;};}function removeEntity(_0x2f8195,_0x5dc1d9){return function(_0x148cfd){if(_0x148cfd){return _0x148cfd[_0xc76d('0x20')]()['then'](function(){var _0x56755a=_0x148cfd[_0xc76d('0x21')]({'plain':!![]});var _0x39e16c=_0xc76d('0x22');return db[_0xc76d('0x23')][_0xc76d('0x20')]({'where':{'type':_0x39e16c,'resourceId':_0x56755a['id']}})[_0xc76d('0x1f')](function(){return _0x148cfd;});})[_0xc76d('0x1f')](function(){_0x2f8195[_0xc76d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47e2cb,_0x2fc71d){return function(_0x291adf){if(!_0x291adf){_0x47e2cb[_0xc76d('0x24')](0x194);}return _0x291adf;};}function handleError(_0x352c47,_0x3fe1cc){_0x3fe1cc=_0x3fe1cc||0x1f4;return function(_0x2b850f){logger['error'](_0x2b850f[_0xc76d('0x25')]);if(_0x2b850f['name']){delete _0x2b850f[_0xc76d('0x26')];}_0x352c47['status'](_0x3fe1cc)[_0xc76d('0x27')](_0x2b850f);};}exports['index']=function(_0x9c22d1,_0x3974d2){var _0x5c6c81={},_0x210e21={},_0x16fd25={'count':0x0,'rows':[]};var _0x51aa24=_['map'](db[_0xc76d('0x28')][_0xc76d('0x29')],function(_0x15ea80){return{'name':_0x15ea80[_0xc76d('0x2a')],'type':_0x15ea80[_0xc76d('0x2b')]['key']};});_0x210e21[_0xc76d('0x2c')]=_[_0xc76d('0x2d')](_0x51aa24,_0xc76d('0x26'));_0x210e21[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x9c22d1[_0xc76d('0x2e')]);_0x210e21[_0xc76d('0x30')]=_[_0xc76d('0x31')](_0x210e21[_0xc76d('0x2c')],_0x210e21[_0xc76d('0x2e')]);_0x5c6c81[_0xc76d('0x32')]=_['intersection'](_0x210e21[_0xc76d('0x2c')],qs[_0xc76d('0x33')](_0x9c22d1[_0xc76d('0x2e')][_0xc76d('0x33')]));_0x5c6c81[_0xc76d('0x32')]=_0x5c6c81['attributes'][_0xc76d('0x34')]?_0x5c6c81['attributes']:_0x210e21['model'];if(!_0x9c22d1['query'][_0xc76d('0x35')](_0xc76d('0x36'))){_0x5c6c81[_0xc76d('0x1a')]=qs[_0xc76d('0x1a')](_0x9c22d1['query'][_0xc76d('0x1a')]);_0x5c6c81['offset']=qs[_0xc76d('0x19')](_0x9c22d1[_0xc76d('0x2e')][_0xc76d('0x19')]);}_0x5c6c81[_0xc76d('0x37')]=qs[_0xc76d('0x38')](_0x9c22d1[_0xc76d('0x2e')][_0xc76d('0x38')]);_0x5c6c81[_0xc76d('0x39')]=qs['filters'](_['pick'](_0x9c22d1[_0xc76d('0x2e')],_0x210e21[_0xc76d('0x30')]),_0x51aa24);if(_0x9c22d1['query'][_0xc76d('0x3a')]){_0x5c6c81[_0xc76d('0x39')]=_[_0xc76d('0x3b')](_0x5c6c81['where'],{'$or':_[_0xc76d('0x2d')](_0x51aa24,function(_0x882f17){if(_0x882f17[_0xc76d('0x2b')]!==_0xc76d('0x3c')){var _0x3d6638={};_0x3d6638[_0x882f17['name']]={'$like':'%'+_0x9c22d1[_0xc76d('0x2e')][_0xc76d('0x3a')]+'%'};return _0x3d6638;}})});}_0x5c6c81=_[_0xc76d('0x3b')]({},_0x5c6c81,_0x9c22d1[_0xc76d('0x3d')]);var _0x59ef3c={'where':_0x5c6c81['where']};return db[_0xc76d('0x28')][_0xc76d('0x3e')](_0x59ef3c)[_0xc76d('0x1f')](function(_0x28aa3c){_0x16fd25[_0xc76d('0x3e')]=_0x28aa3c;if(_0x9c22d1[_0xc76d('0x2e')][_0xc76d('0x3f')]){_0x5c6c81['include']=[{'all':!![]}];}return db[_0xc76d('0x28')][_0xc76d('0x40')](_0x5c6c81);})[_0xc76d('0x1f')](function(_0x44b1dc){_0x16fd25[_0xc76d('0x41')]=_0x44b1dc;return _0x16fd25;})[_0xc76d('0x1f')](respondWithFilteredResult(_0x3974d2,_0x5c6c81))[_0xc76d('0x42')](handleError(_0x3974d2,null));};exports['show']=function(_0x2d5abe,_0x1c1d7c){var _0x1ef9e9={'raw':![],'where':{'id':_0x2d5abe[_0xc76d('0x43')]['id']}},_0x43708f={};_0x43708f[_0xc76d('0x2c')]=_[_0xc76d('0x2f')](db[_0xc76d('0x28')][_0xc76d('0x29')]);_0x43708f[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x2d5abe[_0xc76d('0x2e')]);_0x43708f['filters']=_[_0xc76d('0x31')](_0x43708f['model'],_0x43708f[_0xc76d('0x2e')]);_0x1ef9e9[_0xc76d('0x32')]=_[_0xc76d('0x31')](_0x43708f['model'],qs[_0xc76d('0x33')](_0x2d5abe[_0xc76d('0x2e')]['fields']));_0x1ef9e9[_0xc76d('0x32')]=_0x1ef9e9[_0xc76d('0x32')][_0xc76d('0x34')]?_0x1ef9e9[_0xc76d('0x32')]:_0x43708f['model'];if(_0x2d5abe[_0xc76d('0x2e')][_0xc76d('0x3f')]){_0x1ef9e9[_0xc76d('0x44')]=[{'all':!![]}];}_0x1ef9e9=_[_0xc76d('0x3b')]({},_0x1ef9e9,_0x2d5abe[_0xc76d('0x3d')]);return db[_0xc76d('0x28')]['find'](_0x1ef9e9)[_0xc76d('0x1f')](handleEntityNotFound(_0x1c1d7c,null))['then'](respondWithResult(_0x1c1d7c,null))[_0xc76d('0x42')](handleError(_0x1c1d7c,null));};exports[_0xc76d('0x45')]=function(_0x111a79,_0x4f7a53){return db[_0xc76d('0x28')]['create'](_0x111a79[_0xc76d('0x46')],{})[_0xc76d('0x1f')](function(_0x3923cc){var _0x2062d0=_0x111a79[_0xc76d('0x47')][_0xc76d('0x21')]({'plain':!![]});if(!_0x2062d0)throw new Error(_0xc76d('0x48'));if(_0x2062d0['role']===_0xc76d('0x47')){var _0x2b54d3=_0x3923cc[_0xc76d('0x21')]({'plain':!![]});var _0x3c00ad='Scheduler';return db['UserProfileSection']['find']({'where':{'name':_0x3c00ad,'userProfileId':_0x2062d0['userProfileId']},'raw':!![]})[_0xc76d('0x1f')](function(_0x4e8d17){if(_0x4e8d17&&_0x4e8d17['autoAssociation']===0x0){return db[_0xc76d('0x23')][_0xc76d('0x45')]({'name':_0x2b54d3[_0xc76d('0x26')],'resourceId':_0x2b54d3['id'],'type':_0x4e8d17[_0xc76d('0x26')],'sectionId':_0x4e8d17['id']},{})['then'](function(){return _0x3923cc;});}else{return _0x3923cc;}})[_0xc76d('0x42')](function(_0x2e1998){logger[_0xc76d('0x49')](_0xc76d('0x4a'),_0x2e1998);throw _0x2e1998;});}return _0x3923cc;})[_0xc76d('0x1f')](respondWithResult(_0x4f7a53,0xc9))[_0xc76d('0x42')](handleError(_0x4f7a53,null));};exports['update']=function(_0x32dfa4,_0x95e81a){if(_0x32dfa4[_0xc76d('0x46')]['id']){delete _0x32dfa4[_0xc76d('0x46')]['id'];}return db[_0xc76d('0x28')][_0xc76d('0x4b')]({'where':{'id':_0x32dfa4[_0xc76d('0x43')]['id']}})['then'](handleEntityNotFound(_0x95e81a,null))['then'](saveUpdates(_0x32dfa4[_0xc76d('0x46')],null))[_0xc76d('0x1f')](respondWithResult(_0x95e81a,null))[_0xc76d('0x42')](handleError(_0x95e81a,null));};exports[_0xc76d('0x20')]=function(_0x5ac8b3,_0x4ab4fa){return db[_0xc76d('0x28')]['find']({'where':{'id':_0x5ac8b3[_0xc76d('0x43')]['id']}})[_0xc76d('0x1f')](handleEntityNotFound(_0x4ab4fa,null))[_0xc76d('0x1f')](removeEntity(_0x4ab4fa,null))[_0xc76d('0x42')](handleError(_0x4ab4fa,null));};exports['run']=function(_0x4585d0,_0x5b72a2,_0x56164b){var _0x464d9d=require(_0xc76d('0x4c'));return db[_0xc76d('0x28')][_0xc76d('0x4b')]({'where':{'id':_0x4585d0[_0xc76d('0x43')]['id']},'raw':!![]})[_0xc76d('0x1f')](handleEntityNotFound(_0x5b72a2,null))[_0xc76d('0x1f')](function(){_0x464d9d[_0xc76d('0x4d')](_0x4585d0[_0xc76d('0x43')]['id']);})[_0xc76d('0x1f')](respondWithStatusCode(_0x5b72a2,null))['catch'](handleError(_0x5b72a2,null));}; \ No newline at end of file +var _0x3f68=['lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','set','apply','reject','save','update','destroy','then','get','Scheduler','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','Schedule','findAll','rows','catch','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','../../config/schedule','eml-format','rimraf','fast-json-patch','request-promise','mustache','sox','ejs','fs-extra'];(function(_0x3460e3,_0x23d874){var _0x22a450=function(_0x2c1038){while(--_0x2c1038){_0x3460e3['push'](_0x3460e3['shift']());}};_0x22a450(++_0x23d874);}(_0x3f68,0x150));var _0x83f6=function(_0x1e290d,_0x42970d){_0x1e290d=_0x1e290d-0x0;var _0x3f8218=_0x3f68[_0x1e290d];return _0x3f8218;};'use strict';var emlformat=require(_0x83f6('0x0'));var rimraf=require(_0x83f6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83f6('0x2'));var rp=require(_0x83f6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x83f6('0x4'));var util=require('util');var path=require('path');var sox=require(_0x83f6('0x5'));var csv=require('to-csv');var ejs=require(_0x83f6('0x6'));var fs=require('fs');var fs_extra=require(_0x83f6('0x7'));var _=require(_0x83f6('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x83f6('0x9'));var deskjs=require(_0x83f6('0xa'));var toCsv=require(_0x83f6('0xb'));var querystring=require(_0x83f6('0xc'));var Papa=require('papaparse');var Redis=require(_0x83f6('0xd'));var authService=require(_0x83f6('0xe'));var qs=require(_0x83f6('0xf'));var as=require(_0x83f6('0x10'));var hardwareService=require(_0x83f6('0x11'));var logger=require(_0x83f6('0x12'))(_0x83f6('0x13'));var utils=require(_0x83f6('0x14'));var config=require(_0x83f6('0x15'));var licenseUtil=require(_0x83f6('0x16'));var db=require(_0x83f6('0x17'))['db'];function respondWithStatusCode(_0x3ab850,_0x124b69){_0x124b69=_0x124b69||0xcc;return function(_0x3a3b52){if(_0x3a3b52){return _0x3ab850['sendStatus'](_0x124b69);}return _0x3ab850[_0x83f6('0x18')](_0x124b69)[_0x83f6('0x19')]();};}function respondWithResult(_0x528edf,_0x313647){_0x313647=_0x313647||0xc8;return function(_0x423e95){if(_0x423e95){return _0x528edf[_0x83f6('0x18')](_0x313647)[_0x83f6('0x1a')](_0x423e95);}};}function respondWithFilteredResult(_0x568570,_0x3e3efe){return function(_0x24d23b){if(_0x24d23b){var _0x4864b2=_0x24d23b['count'],_0x49ebee=_0x3e3efe[_0x83f6('0x1b')],_0x301295=_0x3e3efe[_0x83f6('0x1b')]+_0x3e3efe['limit'],_0x5416f3;if(_0x301295>=_0x4864b2){_0x301295=_0x4864b2;_0x5416f3=0xc8;}else{_0x5416f3=0xce;}_0x568570['status'](_0x5416f3);return _0x568570[_0x83f6('0x1c')]('Content-Range',_0x49ebee+'-'+_0x301295+'/'+_0x4864b2)[_0x83f6('0x1a')](_0x24d23b);}return null;};}function patchUpdates(_0xa005d){return function(_0x20b902){try{jsonpatch[_0x83f6('0x1d')](_0x20b902,_0xa005d,!![]);}catch(_0x4f77a3){return BPromise[_0x83f6('0x1e')](_0x4f77a3);}return _0x20b902[_0x83f6('0x1f')]();};}function saveUpdates(_0x515795,_0x3803f1){return function(_0x1e2183){if(_0x1e2183){return _0x1e2183[_0x83f6('0x20')](_0x515795)['then'](function(_0x4c7de9){return _0x4c7de9;});}return null;};}function removeEntity(_0x24ace8,_0x2934f1){return function(_0x48e945){if(_0x48e945){return _0x48e945[_0x83f6('0x21')]()[_0x83f6('0x22')](function(){var _0x458aaa=_0x48e945[_0x83f6('0x23')]({'plain':!![]});var _0x1a866f=_0x83f6('0x24');return db[_0x83f6('0x25')][_0x83f6('0x21')]({'where':{'type':_0x1a866f,'resourceId':_0x458aaa['id']}})['then'](function(){return _0x48e945;});})[_0x83f6('0x22')](function(){_0x24ace8[_0x83f6('0x18')](0xcc)[_0x83f6('0x19')]();});}};}function handleEntityNotFound(_0x3affe4,_0x409ccf){return function(_0x3b6088){if(!_0x3b6088){_0x3affe4[_0x83f6('0x26')](0x194);}return _0x3b6088;};}function handleError(_0x42ebce,_0x24c965){_0x24c965=_0x24c965||0x1f4;return function(_0x59c518){logger[_0x83f6('0x27')](_0x59c518['stack']);if(_0x59c518[_0x83f6('0x28')]){delete _0x59c518['name'];}_0x42ebce[_0x83f6('0x18')](_0x24c965)[_0x83f6('0x29')](_0x59c518);};}exports[_0x83f6('0x2a')]=function(_0x205720,_0x5a7e86){var _0x15d9eb={},_0x52a9db={},_0x9523b4={'count':0x0,'rows':[]};var _0x161efd=_[_0x83f6('0x2b')](db['Schedule'][_0x83f6('0x2c')],function(_0xbddfff){return{'name':_0xbddfff[_0x83f6('0x2d')],'type':_0xbddfff['type'][_0x83f6('0x2e')]};});_0x52a9db[_0x83f6('0x2f')]=_[_0x83f6('0x2b')](_0x161efd,_0x83f6('0x28'));_0x52a9db[_0x83f6('0x30')]=_[_0x83f6('0x31')](_0x205720[_0x83f6('0x30')]);_0x52a9db[_0x83f6('0x32')]=_[_0x83f6('0x33')](_0x52a9db['model'],_0x52a9db['query']);_0x15d9eb[_0x83f6('0x34')]=_[_0x83f6('0x33')](_0x52a9db[_0x83f6('0x2f')],qs[_0x83f6('0x35')](_0x205720[_0x83f6('0x30')][_0x83f6('0x35')]));_0x15d9eb[_0x83f6('0x34')]=_0x15d9eb[_0x83f6('0x34')]['length']?_0x15d9eb['attributes']:_0x52a9db[_0x83f6('0x2f')];if(!_0x205720[_0x83f6('0x30')][_0x83f6('0x36')](_0x83f6('0x37'))){_0x15d9eb[_0x83f6('0x38')]=qs[_0x83f6('0x38')](_0x205720[_0x83f6('0x30')][_0x83f6('0x38')]);_0x15d9eb[_0x83f6('0x1b')]=qs[_0x83f6('0x1b')](_0x205720['query'][_0x83f6('0x1b')]);}_0x15d9eb[_0x83f6('0x39')]=qs[_0x83f6('0x3a')](_0x205720[_0x83f6('0x30')][_0x83f6('0x3a')]);_0x15d9eb[_0x83f6('0x3b')]=qs[_0x83f6('0x32')](_[_0x83f6('0x3c')](_0x205720[_0x83f6('0x30')],_0x52a9db[_0x83f6('0x32')]),_0x161efd);if(_0x205720[_0x83f6('0x30')][_0x83f6('0x3d')]){_0x15d9eb[_0x83f6('0x3b')]=_[_0x83f6('0x3e')](_0x15d9eb[_0x83f6('0x3b')],{'$or':_['map'](_0x161efd,function(_0x522f9d){if(_0x522f9d[_0x83f6('0x3f')]!==_0x83f6('0x40')){var _0x297a2a={};_0x297a2a[_0x522f9d[_0x83f6('0x28')]]={'$like':'%'+_0x205720[_0x83f6('0x30')][_0x83f6('0x3d')]+'%'};return _0x297a2a;}})});}_0x15d9eb=_[_0x83f6('0x3e')]({},_0x15d9eb,_0x205720[_0x83f6('0x41')]);var _0x3032b1={'where':_0x15d9eb[_0x83f6('0x3b')]};return db['Schedule']['count'](_0x3032b1)[_0x83f6('0x22')](function(_0x5eb3d3){_0x9523b4[_0x83f6('0x42')]=_0x5eb3d3;if(_0x205720['query']['includeAll']){_0x15d9eb[_0x83f6('0x43')]=[{'all':!![]}];}return db[_0x83f6('0x44')][_0x83f6('0x45')](_0x15d9eb);})[_0x83f6('0x22')](function(_0x2772be){_0x9523b4[_0x83f6('0x46')]=_0x2772be;return _0x9523b4;})['then'](respondWithFilteredResult(_0x5a7e86,_0x15d9eb))[_0x83f6('0x47')](handleError(_0x5a7e86,null));};exports[_0x83f6('0x48')]=function(_0x27b54b,_0x52a68b){var _0x5f0603={'raw':![],'where':{'id':_0x27b54b['params']['id']}},_0x1daab3={};_0x1daab3[_0x83f6('0x2f')]=_[_0x83f6('0x31')](db[_0x83f6('0x44')][_0x83f6('0x2c')]);_0x1daab3[_0x83f6('0x30')]=_['keys'](_0x27b54b[_0x83f6('0x30')]);_0x1daab3['filters']=_[_0x83f6('0x33')](_0x1daab3[_0x83f6('0x2f')],_0x1daab3[_0x83f6('0x30')]);_0x5f0603[_0x83f6('0x34')]=_['intersection'](_0x1daab3['model'],qs[_0x83f6('0x35')](_0x27b54b['query'][_0x83f6('0x35')]));_0x5f0603[_0x83f6('0x34')]=_0x5f0603['attributes'][_0x83f6('0x49')]?_0x5f0603[_0x83f6('0x34')]:_0x1daab3[_0x83f6('0x2f')];if(_0x27b54b[_0x83f6('0x30')]['includeAll']){_0x5f0603['include']=[{'all':!![]}];}_0x5f0603=_[_0x83f6('0x3e')]({},_0x5f0603,_0x27b54b[_0x83f6('0x41')]);return db[_0x83f6('0x44')][_0x83f6('0x4a')](_0x5f0603)[_0x83f6('0x22')](handleEntityNotFound(_0x52a68b,null))[_0x83f6('0x22')](respondWithResult(_0x52a68b,null))[_0x83f6('0x47')](handleError(_0x52a68b,null));};exports[_0x83f6('0x4b')]=function(_0x3968e1,_0x2496b2){return db[_0x83f6('0x44')][_0x83f6('0x4b')](_0x3968e1['body'],{})[_0x83f6('0x22')](function(_0x153026){var _0x4e9331=_0x3968e1[_0x83f6('0x4c')][_0x83f6('0x23')]({'plain':!![]});if(!_0x4e9331)throw new Error(_0x83f6('0x4d'));if(_0x4e9331[_0x83f6('0x4e')]===_0x83f6('0x4c')){var _0x5a0328=_0x153026[_0x83f6('0x23')]({'plain':!![]});var _0x48bbe7=_0x83f6('0x24');return db[_0x83f6('0x4f')][_0x83f6('0x4a')]({'where':{'name':_0x48bbe7,'userProfileId':_0x4e9331['userProfileId']},'raw':!![]})[_0x83f6('0x22')](function(_0x5c3098){if(_0x5c3098&&_0x5c3098[_0x83f6('0x50')]===0x0){return db[_0x83f6('0x25')][_0x83f6('0x4b')]({'name':_0x5a0328[_0x83f6('0x28')],'resourceId':_0x5a0328['id'],'type':_0x5c3098[_0x83f6('0x28')],'sectionId':_0x5c3098['id']},{})[_0x83f6('0x22')](function(){return _0x153026;});}else{return _0x153026;}})[_0x83f6('0x47')](function(_0x11c240){logger[_0x83f6('0x27')](_0x83f6('0x51'),_0x11c240);throw _0x11c240;});}return _0x153026;})['then'](respondWithResult(_0x2496b2,0xc9))[_0x83f6('0x47')](handleError(_0x2496b2,null));};exports[_0x83f6('0x20')]=function(_0x280b80,_0x583dd2){if(_0x280b80[_0x83f6('0x52')]['id']){delete _0x280b80[_0x83f6('0x52')]['id'];}return db[_0x83f6('0x44')][_0x83f6('0x4a')]({'where':{'id':_0x280b80[_0x83f6('0x53')]['id']}})[_0x83f6('0x22')](handleEntityNotFound(_0x583dd2,null))[_0x83f6('0x22')](saveUpdates(_0x280b80['body'],null))[_0x83f6('0x22')](respondWithResult(_0x583dd2,null))[_0x83f6('0x47')](handleError(_0x583dd2,null));};exports[_0x83f6('0x21')]=function(_0x46e422,_0x2d5b90){return db[_0x83f6('0x44')][_0x83f6('0x4a')]({'where':{'id':_0x46e422[_0x83f6('0x53')]['id']}})[_0x83f6('0x22')](handleEntityNotFound(_0x2d5b90,null))['then'](removeEntity(_0x2d5b90,null))['catch'](handleError(_0x2d5b90,null));};exports[_0x83f6('0x54')]=function(_0x4d5798,_0x2bbed0,_0x446ee2){var _0x54e8f4=require(_0x83f6('0x55'));return db[_0x83f6('0x44')][_0x83f6('0x4a')]({'where':{'id':_0x4d5798['params']['id']},'raw':!![]})[_0x83f6('0x22')](handleEntityNotFound(_0x2bbed0,null))[_0x83f6('0x22')](function(){_0x54e8f4['run'](_0x4d5798[_0x83f6('0x53')]['id']);})[_0x83f6('0x22')](respondWithStatusCode(_0x2bbed0,null))['catch'](handleError(_0x2bbed0,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 4bde1b3..50793da 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 _0xb749=['exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./schedule.attributes'];(function(_0x31e9b4,_0x4473f6){var _0x1ada54=function(_0x46f138){while(--_0x46f138){_0x31e9b4['push'](_0x31e9b4['shift']());}};_0x1ada54(++_0x4473f6);}(_0xb749,0x13c));var _0x9b74=function(_0x5d4f70,_0x5e8506){_0x5d4f70=_0x5d4f70-0x0;var _0x39bc3b=_0xb749[_0x5d4f70];return _0x39bc3b;};'use strict';var _=require(_0x9b74('0x0'));var util=require(_0x9b74('0x1'));var logger=require(_0x9b74('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9b74('0x3'));var rp=require(_0x9b74('0x4'));var fs=require('fs');var path=require(_0x9b74('0x5'));var rimraf=require('rimraf');var config=require(_0x9b74('0x6'));var attributes=require(_0x9b74('0x7'));module[_0x9b74('0x8')]=function(_0x489dfe,_0x3130e8){return _0x489dfe[_0x9b74('0x9')](_0x9b74('0xa'),attributes,{'tableName':_0x9b74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca5e=['define','Schedule','tools_schedules','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3edb70,_0x30811c){var _0x20ce09=function(_0x439881){while(--_0x439881){_0x3edb70['push'](_0x3edb70['shift']());}};_0x20ce09(++_0x30811c);}(_0xca5e,0xdb));var _0xeca5=function(_0x592e9e,_0x4550ba){_0x592e9e=_0x592e9e-0x0;var _0x57a92f=_0xca5e[_0x592e9e];return _0x57a92f;};'use strict';var _=require('lodash');var util=require(_0xeca5('0x0'));var logger=require(_0xeca5('0x1'))('api');var moment=require(_0xeca5('0x2'));var BPromise=require(_0xeca5('0x3'));var rp=require(_0xeca5('0x4'));var fs=require('fs');var path=require(_0xeca5('0x5'));var rimraf=require(_0xeca5('0x6'));var config=require(_0xeca5('0x7'));var attributes=require('./schedule.attributes');module[_0xeca5('0x8')]=function(_0x244fd3,_0x1cf8fb){return _0x244fd3[_0xeca5('0x9')](_0xeca5('0xa'),attributes,{'tableName':_0xeca5('0xb'),'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 e36758c..d17ac24 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 _0x35d9=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','Schedule,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring'];(function(_0x2e6de9,_0x5a248e){var _0x3e1d94=function(_0x1d505d){while(--_0x1d505d){_0x2e6de9['push'](_0x2e6de9['shift']());}};_0x3e1d94(++_0x5a248e);}(_0x35d9,0xb9));var _0x935d=function(_0x26ce65,_0x38523f){_0x26ce65=_0x26ce65-0x0;var _0x58a8ad=_0x35d9[_0x26ce65];return _0x58a8ad;};'use strict';var _=require(_0x935d('0x0'));var util=require(_0x935d('0x1'));var moment=require(_0x935d('0x2'));var BPromise=require('bluebird');var rs=require(_0x935d('0x3'));var fs=require('fs');var Redis=require(_0x935d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x935d('0x5'));var logger=require(_0x935d('0x6'))(_0x935d('0x7'));var config=require(_0x935d('0x8'));var jayson=require(_0x935d('0x9'));var client=jayson[_0x935d('0xa')][_0x935d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1aae74,_0x8f170,_0x5acbd1){return new BPromise(function(_0x5acca8,_0x2d947c){return client[_0x935d('0xc')](_0x1aae74,_0x5acbd1)['then'](function(_0x437d21){logger[_0x935d('0xd')]('Schedule,\x20%s,\x20%s',_0x8f170,'request\x20sent');logger[_0x935d('0xe')](_0x935d('0xf'),_0x8f170,_0x935d('0x10'),JSON['stringify'](_0x437d21));if(_0x437d21[_0x935d('0x11')]){if(_0x437d21[_0x935d('0x11')]['code']===0x1f4){logger[_0x935d('0x11')](_0x935d('0x12'),_0x8f170,_0x437d21[_0x935d('0x11')][_0x935d('0x13')]);return _0x2d947c(_0x437d21[_0x935d('0x11')]['message']);}logger[_0x935d('0x11')](_0x935d('0x12'),_0x8f170,_0x437d21[_0x935d('0x11')]['message']);return _0x5acca8(_0x437d21[_0x935d('0x11')]['message']);}else{logger['info'](_0x935d('0x12'),_0x8f170,_0x935d('0x10'));_0x5acca8(_0x437d21['result'][_0x935d('0x13')]);}})[_0x935d('0x14')](function(_0x3ce7a5){logger[_0x935d('0x11')](_0x935d('0x12'),_0x8f170,_0x3ce7a5);_0x2d947c(_0x3ce7a5);});});} \ No newline at end of file +var _0x3e65=['../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2a115e,_0x5995c3){var _0x4fe086=function(_0x264850){while(--_0x264850){_0x2a115e['push'](_0x2a115e['shift']());}};_0x4fe086(++_0x5995c3);}(_0x3e65,0x101));var _0x53e6=function(_0xbe664,_0x49a2f5){_0xbe664=_0xbe664-0x0;var _0x1e309c=_0x3e65[_0xbe664];return _0x1e309c;};'use strict';var _=require(_0x53e6('0x0'));var util=require(_0x53e6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x53e6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53e6('0x3'))['db'];var utils=require(_0x53e6('0x4'));var logger=require(_0x53e6('0x5'))(_0x53e6('0x6'));var config=require(_0x53e6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x53e6('0x8')][_0x53e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a2963,_0x330423,_0x157671){return new BPromise(function(_0x363d80,_0x617b81){return client[_0x53e6('0xa')](_0x2a2963,_0x157671)[_0x53e6('0xb')](function(_0xb43ad7){logger[_0x53e6('0xc')](_0x53e6('0xd'),_0x330423,'request\x20sent');logger[_0x53e6('0xe')](_0x53e6('0xf'),_0x330423,'request\x20sent',JSON[_0x53e6('0x10')](_0xb43ad7));if(_0xb43ad7[_0x53e6('0x11')]){if(_0xb43ad7[_0x53e6('0x11')][_0x53e6('0x12')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x330423,_0xb43ad7[_0x53e6('0x11')]['message']);return _0x617b81(_0xb43ad7[_0x53e6('0x11')][_0x53e6('0x13')]);}logger[_0x53e6('0x11')](_0x53e6('0xd'),_0x330423,_0xb43ad7['error'][_0x53e6('0x13')]);return _0x363d80(_0xb43ad7['error'][_0x53e6('0x13')]);}else{logger[_0x53e6('0xc')](_0x53e6('0xd'),_0x330423,'request\x20sent');_0x363d80(_0xb43ad7[_0x53e6('0x14')][_0x53e6('0x13')]);}})[_0x53e6('0x15')](function(_0x29f9bf){logger[_0x53e6('0x11')](_0x53e6('0xd'),_0x330423,_0x29f9bf);_0x617b81(_0x29f9bf);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 9b5944c..8f4fc29 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 _0x235d=['index','describe','show','/:id/download','isAuthenticated','post','create','put','/:id','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0x235d,0xc8));var _0xd235=function(_0x544808,_0x10e96f){_0x544808=_0x544808-0x0;var _0x2ffdd8=_0x235d[_0x544808];return _0x2ffdd8;};'use strict';var multer=require(_0xd235('0x0'));var util=require(_0xd235('0x1'));var path=require(_0xd235('0x2'));var timeout=require('connect-timeout');var express=require(_0xd235('0x3'));var router=express[_0xd235('0x4')]();var fs_extra=require(_0xd235('0x5'));var auth=require(_0xd235('0x6'));var interaction=require(_0xd235('0x7'));var config=require('../../config/environment');var controller=require(_0xd235('0x8'));router[_0xd235('0x9')]('/',auth['isAuthenticated'](),controller[_0xd235('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd235('0xb')]);router[_0xd235('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd235('0xc')]);router[_0xd235('0x9')](_0xd235('0xd'),auth[_0xd235('0xe')](),controller['download']);router[_0xd235('0xf')]('/',auth[_0xd235('0xe')](),controller[_0xd235('0x10')]);router[_0xd235('0x11')](_0xd235('0x12'),auth[_0xd235('0xe')](),controller['update']);router[_0xd235('0x13')]('/:id',auth[_0xd235('0xe')](),controller['destroy']);module[_0xd235('0x14')]=router; \ No newline at end of file +var _0x729f=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer'];(function(_0x14bd30,_0xbcc5eb){var _0x2b7e7f=function(_0x297953){while(--_0x297953){_0x14bd30['push'](_0x14bd30['shift']());}};_0x2b7e7f(++_0xbcc5eb);}(_0x729f,0xa0));var _0xf729=function(_0x51c52b,_0x147712){_0x51c52b=_0x51c52b-0x0;var _0x581ce3=_0x729f[_0x51c52b];return _0x581ce3;};'use strict';var multer=require(_0xf729('0x0'));var util=require(_0xf729('0x1'));var path=require(_0xf729('0x2'));var timeout=require(_0xf729('0x3'));var express=require(_0xf729('0x4'));var router=express[_0xf729('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf729('0x6'));var interaction=require(_0xf729('0x7'));var config=require(_0xf729('0x8'));var controller=require('./screenRecording.controller');router[_0xf729('0x9')]('/',auth[_0xf729('0xa')](),controller['index']);router[_0xf729('0x9')](_0xf729('0xb'),auth[_0xf729('0xa')](),controller[_0xf729('0xc')]);router[_0xf729('0x9')](_0xf729('0xd'),auth[_0xf729('0xa')](),controller['show']);router[_0xf729('0x9')](_0xf729('0xe'),auth['isAuthenticated'](),controller[_0xf729('0xf')]);router[_0xf729('0x10')]('/',auth['isAuthenticated'](),controller[_0xf729('0x11')]);router[_0xf729('0x12')](_0xf729('0xd'),auth['isAuthenticated'](),controller[_0xf729('0x13')]);router[_0xf729('0x14')]('/:id',auth[_0xf729('0xa')](),controller[_0xf729('0x15')]);module[_0xf729('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 74b045b..02538fc 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 _0x6f47=['updatedAt','moment','path','exports','getDataValue','extname','value','STRING','setDataValue','INTEGER','subtract','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt'];(function(_0x5dc03e,_0x54e60c){var _0x466a07=function(_0x2ce0cd){while(--_0x2ce0cd){_0x5dc03e['push'](_0x5dc03e['shift']());}};_0x466a07(++_0x54e60c);}(_0x6f47,0xc7));var _0x76f4=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x6f47[_0x3ea913];return _0x2b4f28;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var config=require('../../config/environment');module[_0x76f4('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x76f4('0x3')]('value')?path[_0x76f4('0x4')](this[_0x76f4('0x3')](_0x76f4('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x76f4('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x76f4('0x6')],'set':function(_0xfc2405){var _0x2176a7=_0xfc2405['replace'](/\\/g,'/');this[_0x76f4('0x7')](_0x76f4('0x5'),_0x2176a7);}},'rating':{'type':Sequelize[_0x76f4('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x76f4('0x8')],'set':function(_0x101f55){this['setDataValue']('startedAt',moment()[_0x76f4('0x9')](_0x101f55,'ms'));this[_0x76f4('0x7')]('closedAt',moment());this['setDataValue'](_0x76f4('0xa'),_0x101f55);}},'startedAt':{'type':Sequelize[_0x76f4('0xb')],'get':function(){return moment(this[_0x76f4('0x3')](_0x76f4('0xc')))[_0x76f4('0xd')](_0x76f4('0xe'))[_0x76f4('0xf')]();}},'closedAt':{'type':Sequelize[_0x76f4('0xb')],'get':function(){return moment(this[_0x76f4('0x3')]('closedAt'))[_0x76f4('0xd')](_0x76f4('0xe'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x76f4('0x10')))[_0x76f4('0xd')](_0x76f4('0xe'))[_0x76f4('0xf')]();}},'updatedAt':{'type':Sequelize[_0x76f4('0xb')],'get':function(){return moment(this[_0x76f4('0x3')](_0x76f4('0x11')))[_0x76f4('0xd')](_0x76f4('0xe'))[_0x76f4('0xf')]();}}}; \ No newline at end of file +var _0xeec6=['value','extname','STRING','replace','setDataValue','INTEGER','closedAt','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0xeec6,0x1c2));var _0x6eec=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0xeec6[_0x35ef6b];return _0x3ad145;};'use strict';var Sequelize=require(_0x6eec('0x0'));var moment=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var config=require(_0x6eec('0x3'));module['exports']={'format':{'type':Sequelize[_0x6eec('0x4')],'get':function(){return this[_0x6eec('0x5')](_0x6eec('0x6'))?path[_0x6eec('0x7')](this[_0x6eec('0x5')](_0x6eec('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6eec('0x8')]},'value':{'type':Sequelize[_0x6eec('0x8')],'set':function(_0x48064a){var _0x5a5e47=_0x48064a[_0x6eec('0x9')](/\\/g,'/');this[_0x6eec('0xa')](_0x6eec('0x6'),_0x5a5e47);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6eec('0xb')],'set':function(_0x3aca38){this[_0x6eec('0xa')]('startedAt',moment()['subtract'](_0x3aca38,'ms'));this['setDataValue'](_0x6eec('0xc'),moment());this[_0x6eec('0xa')]('duration',_0x3aca38);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6eec('0x5')]('startedAt'))[_0x6eec('0xd')](_0x6eec('0xe'))[_0x6eec('0xf')]();}},'closedAt':{'type':Sequelize[_0x6eec('0x10')],'get':function(){return moment(this[_0x6eec('0x5')]('closedAt'))[_0x6eec('0xd')](_0x6eec('0xe'))[_0x6eec('0xf')]();}},'createdAt':{'type':Sequelize[_0x6eec('0x10')],'get':function(){return moment(this[_0x6eec('0x5')](_0x6eec('0x11')))[_0x6eec('0xd')](_0x6eec('0xe'))[_0x6eec('0xf')]();}},'updatedAt':{'type':Sequelize[_0x6eec('0x10')],'get':function(){return moment(this['getDataValue'](_0x6eec('0x12')))['format'](_0x6eec('0xe'))[_0x6eec('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index b8a6196..1941793 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 _0x9ebf=['update','then','destroy','stack','name','send','index','map','ScreenRecording','rawAttributes','type','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','offset','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','catch','show','params','find','create','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','existsSync','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','ScreenRecording\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','set','json','apply','reject'];(function(_0x11239b,_0xdfd2b0){var _0x1d51c4=function(_0x2bba88){while(--_0x2bba88){_0x11239b['push'](_0x11239b['shift']());}};_0x1d51c4(++_0xdfd2b0);}(_0x9ebf,0x105));var _0xf9eb=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x9ebf[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0xf9eb('0x0'));var rimraf=require(_0xf9eb('0x1'));var zipdir=require(_0xf9eb('0x2'));var jsonpatch=require(_0xf9eb('0x3'));var rp=require('request-promise');var moment=require(_0xf9eb('0x4'));var BPromise=require(_0xf9eb('0x5'));var Mustache=require(_0xf9eb('0x6'));var util=require('util');var path=require(_0xf9eb('0x7'));var sox=require(_0xf9eb('0x8'));var csv=require(_0xf9eb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf9eb('0xa'));var _=require(_0xf9eb('0xb'));var squel=require('squel');var crypto=require(_0xf9eb('0xc'));var jsforce=require(_0xf9eb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf9eb('0x9'));var querystring=require('querystring');var Papa=require(_0xf9eb('0xe'));var Redis=require(_0xf9eb('0xf'));var authService=require(_0xf9eb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf9eb('0x11'));var hardwareService=require(_0xf9eb('0x12'));var logger=require(_0xf9eb('0x13'))(_0xf9eb('0x14'));var utils=require(_0xf9eb('0x15'));var config=require(_0xf9eb('0x16'));var licenseUtil=require(_0xf9eb('0x17'));var db=require(_0xf9eb('0x18'))['db'];function respondWithStatusCode(_0x2ec624,_0x1d75c4){_0x1d75c4=_0x1d75c4||0xcc;return function(_0x26c03a){if(_0x26c03a){return _0x2ec624[_0xf9eb('0x19')](_0x1d75c4);}return _0x2ec624[_0xf9eb('0x1a')](_0x1d75c4)[_0xf9eb('0x1b')]();};}function respondWithResult(_0x3b7e37,_0x1c3f75){_0x1c3f75=_0x1c3f75||0xc8;return function(_0x123215){if(_0x123215){return _0x3b7e37['status'](_0x1c3f75)['json'](_0x123215);}};}function respondWithFilteredResult(_0x271777,_0x3440b0){return function(_0x491990){if(_0x491990){var _0x25cd70=_0x491990['count'],_0x33fa20=_0x3440b0['offset'],_0x470e41=_0x3440b0['offset']+_0x3440b0[_0xf9eb('0x1c')],_0x490292;if(_0x470e41>=_0x25cd70){_0x470e41=_0x25cd70;_0x490292=0xc8;}else{_0x490292=0xce;}_0x271777[_0xf9eb('0x1a')](_0x490292);return _0x271777[_0xf9eb('0x1d')]('Content-Range',_0x33fa20+'-'+_0x470e41+'/'+_0x25cd70)[_0xf9eb('0x1e')](_0x491990);}return null;};}function patchUpdates(_0x43892c){return function(_0x384262){try{jsonpatch[_0xf9eb('0x1f')](_0x384262,_0x43892c,!![]);}catch(_0x5848ad){return BPromise[_0xf9eb('0x20')](_0x5848ad);}return _0x384262['save']();};}function saveUpdates(_0x2c248c,_0x4e760d){return function(_0x534c9b){if(_0x534c9b){return _0x534c9b[_0xf9eb('0x21')](_0x2c248c)[_0xf9eb('0x22')](function(_0x132f87){return _0x132f87;});}return null;};}function removeEntity(_0x18ba96,_0x35a489){return function(_0x3b9e73){if(_0x3b9e73){return _0x3b9e73[_0xf9eb('0x23')]()[_0xf9eb('0x22')](function(){_0x18ba96[_0xf9eb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28ef1b,_0x3a7ef8){return function(_0x28c375){if(!_0x28c375){_0x28ef1b[_0xf9eb('0x19')](0x194);}return _0x28c375;};}function handleError(_0x35c130,_0x58a3c8){_0x58a3c8=_0x58a3c8||0x1f4;return function(_0x495170){logger['error'](_0x495170[_0xf9eb('0x24')]);if(_0x495170[_0xf9eb('0x25')]){delete _0x495170['name'];}_0x35c130['status'](_0x58a3c8)[_0xf9eb('0x26')](_0x495170);};}exports[_0xf9eb('0x27')]=function(_0xd927e7,_0x368136){var _0x12e152={},_0x40269f={},_0x1df9ca={'count':0x0,'rows':[]};var _0x10c612=_[_0xf9eb('0x28')](db[_0xf9eb('0x29')][_0xf9eb('0x2a')],function(_0x234a92){return{'name':_0x234a92['fieldName'],'type':_0x234a92[_0xf9eb('0x2b')]['key']};});_0x40269f['model']=_[_0xf9eb('0x2c')](_['map'](_0x10c612,_0xf9eb('0x25')),[_0xf9eb('0x2d')]);_0x40269f[_0xf9eb('0x2e')]=_[_0xf9eb('0x2f')](_0xd927e7[_0xf9eb('0x2e')]);_0x40269f[_0xf9eb('0x30')]=_[_0xf9eb('0x31')](_0x40269f['model'],_0x40269f[_0xf9eb('0x2e')]);_0x12e152[_0xf9eb('0x32')]=_['intersection'](_0x40269f['model'],qs[_0xf9eb('0x33')](_0xd927e7[_0xf9eb('0x2e')][_0xf9eb('0x33')]));_0x12e152[_0xf9eb('0x32')]=_0x12e152[_0xf9eb('0x32')][_0xf9eb('0x34')]?_0x12e152['attributes']:_0x40269f[_0xf9eb('0x35')];if(!_0xd927e7[_0xf9eb('0x2e')][_0xf9eb('0x36')]('nolimit')){_0x12e152[_0xf9eb('0x1c')]=qs[_0xf9eb('0x1c')](_0xd927e7[_0xf9eb('0x2e')]['limit']);_0x12e152['offset']=qs['offset'](_0xd927e7[_0xf9eb('0x2e')][_0xf9eb('0x37')]);}_0x12e152[_0xf9eb('0x38')]=qs[_0xf9eb('0x39')](_0xd927e7[_0xf9eb('0x2e')][_0xf9eb('0x39')]);_0x12e152[_0xf9eb('0x3a')]=qs[_0xf9eb('0x30')](_[_0xf9eb('0x3b')](_0xd927e7[_0xf9eb('0x2e')],_0x40269f[_0xf9eb('0x30')]),_0x10c612);if(_0xd927e7[_0xf9eb('0x2e')][_0xf9eb('0x3c')]){_0x12e152[_0xf9eb('0x3a')]=_[_0xf9eb('0x3d')](_0x12e152[_0xf9eb('0x3a')],{'$or':_[_0xf9eb('0x28')](_0x10c612,function(_0x4cd351){if(_0x4cd351[_0xf9eb('0x2b')]!=='VIRTUAL'){var _0x514233={};_0x514233[_0x4cd351[_0xf9eb('0x25')]]={'$like':'%'+_0xd927e7['query'][_0xf9eb('0x3c')]+'%'};return _0x514233;}})});}_0x12e152=_['merge']({},_0x12e152,_0xd927e7[_0xf9eb('0x3e')]);var _0x18c50c={'where':_0x12e152['where']};return db['ScreenRecording'][_0xf9eb('0x3f')](_0x18c50c)[_0xf9eb('0x22')](function(_0x303403){_0x1df9ca[_0xf9eb('0x3f')]=_0x303403;if(_0xd927e7[_0xf9eb('0x2e')][_0xf9eb('0x40')]){_0x12e152[_0xf9eb('0x41')]=[{'all':!![]}];}return db[_0xf9eb('0x29')][_0xf9eb('0x42')](_0x12e152);})[_0xf9eb('0x22')](function(_0x19c345){_0x1df9ca['rows']=_0x19c345;return _0x1df9ca;})[_0xf9eb('0x22')](respondWithFilteredResult(_0x368136,_0x12e152))[_0xf9eb('0x43')](handleError(_0x368136,null));};exports[_0xf9eb('0x44')]=function(_0x41c742,_0x4a91f0){var _0x1b38cc={'raw':![],'where':{'id':_0x41c742[_0xf9eb('0x45')]['id']}},_0xb54f88={};_0xb54f88['model']=_[_0xf9eb('0x2f')](db[_0xf9eb('0x29')][_0xf9eb('0x2a')]);_0xb54f88[_0xf9eb('0x2e')]=_[_0xf9eb('0x2f')](_0x41c742[_0xf9eb('0x2e')]);_0xb54f88['filters']=_[_0xf9eb('0x31')](_0xb54f88['model'],_0xb54f88[_0xf9eb('0x2e')]);_0x1b38cc[_0xf9eb('0x32')]=_[_0xf9eb('0x31')](_0xb54f88[_0xf9eb('0x35')],qs[_0xf9eb('0x33')](_0x41c742[_0xf9eb('0x2e')][_0xf9eb('0x33')]));_0x1b38cc[_0xf9eb('0x32')]=_0x1b38cc[_0xf9eb('0x32')][_0xf9eb('0x34')]?_0x1b38cc['attributes']:_0xb54f88[_0xf9eb('0x35')];if(_0x41c742[_0xf9eb('0x2e')]['includeAll']){_0x1b38cc[_0xf9eb('0x41')]=[{'all':!![]}];}_0x1b38cc=_[_0xf9eb('0x3d')]({},_0x1b38cc,_0x41c742[_0xf9eb('0x3e')]);return db[_0xf9eb('0x29')][_0xf9eb('0x46')](_0x1b38cc)['then'](handleEntityNotFound(_0x4a91f0,null))[_0xf9eb('0x22')](respondWithResult(_0x4a91f0,null))[_0xf9eb('0x43')](handleError(_0x4a91f0,null));};exports[_0xf9eb('0x47')]=function(_0x4173ed,_0x8ccf1){return db[_0xf9eb('0x29')][_0xf9eb('0x47')](_0x4173ed['body'],{})['then'](respondWithResult(_0x8ccf1,0xc9))[_0xf9eb('0x43')](handleError(_0x8ccf1,null));};exports[_0xf9eb('0x21')]=function(_0x4a9565,_0x19d9af){if(_0x4a9565[_0xf9eb('0x48')]['id']){delete _0x4a9565[_0xf9eb('0x48')]['id'];}delete _0x4a9565[_0xf9eb('0x48')][_0xf9eb('0x49')];delete _0x4a9565['body'][_0xf9eb('0x4a')];delete _0x4a9565[_0xf9eb('0x48')][_0xf9eb('0x4b')];delete _0x4a9565['body'][_0xf9eb('0x4c')];return db[_0xf9eb('0x29')][_0xf9eb('0x46')]({'where':{'id':_0x4a9565['params']['id']}})[_0xf9eb('0x22')](handleEntityNotFound(_0x19d9af,null))[_0xf9eb('0x22')](saveUpdates(_0x4a9565[_0xf9eb('0x48')],null))['then'](respondWithResult(_0x19d9af,null))[_0xf9eb('0x43')](handleError(_0x19d9af,null));};exports[_0xf9eb('0x4d')]=function(_0x44317d,_0xcab799){return db[_0xf9eb('0x29')][_0xf9eb('0x4d')]()[_0xf9eb('0x22')](respondWithResult(_0xcab799,null))[_0xf9eb('0x43')](handleError(_0xcab799,null));};exports[_0xf9eb('0x4e')]=function(_0x1537b5,_0x102f58,_0x5414d6){var _0x32d761=require(_0xf9eb('0x4f'));var _0x49515c=![];var _0x522d4c={};if(_0x1537b5[_0xf9eb('0x2e')]['type']&&_0x1537b5[_0xf9eb('0x2e')][_0xf9eb('0x2b')]===_0xf9eb('0x50')){_0x522d4c[_0xf9eb('0x50')]=_0x1537b5[_0xf9eb('0x45')]['id'];}else{_0x522d4c['id']=_0x1537b5[_0xf9eb('0x45')]['id'];}return db['ScreenRecording'][_0xf9eb('0x46')]({'where':_0x522d4c,'attributes':['id',_0xf9eb('0x4c')],'raw':!![]})[_0xf9eb('0x22')](handleEntityNotFound(_0x102f58,null))[_0xf9eb('0x22')](function(_0x5b2410){if(_0x5b2410){var _0x2d83be=path[_0xf9eb('0x51')](config[_0xf9eb('0x52')],'server/files/screen_recordings',_0x5b2410['value']);var _0x16836c=util[_0xf9eb('0x2d')]('%s.cypher',_0x2d83be);if(fs[_0xf9eb('0x53')](_0x16836c)){_0x49515c=!![];return _0x32d761[_0xf9eb('0x54')](_0x16836c,_0x2d83be,config[_0xf9eb('0x55')][_0xf9eb('0x56')])[_0xf9eb('0x22')](function(){return _0x5b2410;});}return _0x5b2410;}})['then'](function(_0x12d628){if(_0x12d628){var _0x55e939=path[_0xf9eb('0x51')](config['root'],'server/files/screen_recordings',_0x12d628[_0xf9eb('0x4c')]);if(!fs[_0xf9eb('0x53')](_0x55e939)){throw new db[(_0xf9eb('0x57'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x12d628[_0xf9eb('0x58')]){return _0x102f58[_0xf9eb('0x4e')](_0x55e939,_0x12d628[_0xf9eb('0x58')]+path[_0xf9eb('0x59')](_0x55e939),function(){if(_0x49515c){fs[_0xf9eb('0x5a')](_0x55e939);}});}else{return _0x102f58['download'](_0x55e939,function(_0x32a0e4){if(_0x49515c){fs['unlink'](_0x55e939);}});}}})['catch'](function(_0x5abe7f){if(_0x5abe7f['message']===_0xf9eb('0x5b')){_0x102f58[_0xf9eb('0x1a')](0x194)[_0xf9eb('0x26')]('Not\x20found');}else{return handleError(_0x102f58,null);}});};exports['destroy']=function(_0x430f9c,_0x19ef71){return db[_0xf9eb('0x29')][_0xf9eb('0x46')]({'where':{'id':_0x430f9c[_0xf9eb('0x45')]['id']}})[_0xf9eb('0x22')](function(_0x470922){if(!_0x470922)throw new ReferenceError('Entity\x20not\x20found');return _0x470922;})[_0xf9eb('0x22')](function(_0x19ace3){var _0x4ee7ab=path[_0xf9eb('0x51')](config['root'],'server/files/screen_recordings',_0x19ace3['value']);logger[_0xf9eb('0x5c')](_0xf9eb('0x5d'),_0x4ee7ab);if(!_[_0xf9eb('0x5e')](_0x19ace3[_0xf9eb('0x4c')])&&fs[_0xf9eb('0x53')](_0x4ee7ab)){logger['info']('File:\x20\x22'+_0x4ee7ab+_0xf9eb('0x5f'));fs[_0xf9eb('0x60')](_0x4ee7ab);}_0x4ee7ab=_0x4ee7ab+_0xf9eb('0x61');if(!_[_0xf9eb('0x5e')](_0x19ace3['value'])&&fs[_0xf9eb('0x53')](_0x4ee7ab)){logger[_0xf9eb('0x5c')]('File:\x20\x22'+_0x4ee7ab+_0xf9eb('0x5f'));fs[_0xf9eb('0x60')](_0x4ee7ab);}return _0x19ace3;})['then'](function(_0xb714a7){if(!_0xb714a7)throw new InternalError();return _0xb714a7[_0xf9eb('0x23')]();})[_0xf9eb('0x22')](function(){_0x19ef71[_0xf9eb('0x1a')](0xcc)[_0xf9eb('0x1b')]();})[_0xf9eb('0x43')](handleError(_0x19ef71,null));}; \ No newline at end of file +var _0x0f9f=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','limit','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','differenceBy','format','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','findAll','catch','includeAll','include','ScreenRecording','body','duration','value','find','params','describe','../../components/encryptor','uniqueid','server/files/screen_recordings','%s.cypher','existsSync','secrets','join','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','Entity\x20not\x20found','root','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse'];(function(_0x1ac9f1,_0x2de131){var _0x2924dc=function(_0x3b6c50){while(--_0x3b6c50){_0x1ac9f1['push'](_0x1ac9f1['shift']());}};_0x2924dc(++_0x2de131);}(_0x0f9f,0x180));var _0xf0f9=function(_0x515ef1,_0x476d57){_0x515ef1=_0x515ef1-0x0;var _0x2081a6=_0x0f9f[_0x515ef1];return _0x2081a6;};'use strict';var emlformat=require(_0xf0f9('0x0'));var rimraf=require(_0xf0f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf0f9('0x2'));var moment=require('moment');var BPromise=require(_0xf0f9('0x3'));var Mustache=require(_0xf0f9('0x4'));var util=require(_0xf0f9('0x5'));var path=require(_0xf0f9('0x6'));var sox=require(_0xf0f9('0x7'));var csv=require(_0xf0f9('0x8'));var ejs=require(_0xf0f9('0x9'));var fs=require('fs');var fs_extra=require(_0xf0f9('0xa'));var _=require(_0xf0f9('0xb'));var squel=require(_0xf0f9('0xc'));var crypto=require(_0xf0f9('0xd'));var jsforce=require(_0xf0f9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf0f9('0x8'));var querystring=require('querystring');var Papa=require(_0xf0f9('0xf'));var Redis=require('ioredis');var authService=require(_0xf0f9('0x10'));var qs=require(_0xf0f9('0x11'));var as=require(_0xf0f9('0x12'));var hardwareService=require(_0xf0f9('0x13'));var logger=require(_0xf0f9('0x14'))(_0xf0f9('0x15'));var utils=require(_0xf0f9('0x16'));var config=require(_0xf0f9('0x17'));var licenseUtil=require(_0xf0f9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f8f0d,_0x232e80){_0x232e80=_0x232e80||0xcc;return function(_0x4918c7){if(_0x4918c7){return _0x4f8f0d['sendStatus'](_0x232e80);}return _0x4f8f0d[_0xf0f9('0x19')](_0x232e80)[_0xf0f9('0x1a')]();};}function respondWithResult(_0x5b7861,_0x504868){_0x504868=_0x504868||0xc8;return function(_0x12e38e){if(_0x12e38e){return _0x5b7861[_0xf0f9('0x19')](_0x504868)['json'](_0x12e38e);}};}function respondWithFilteredResult(_0x431d95,_0x353468){return function(_0x32badd){if(_0x32badd){var _0x29d38a=_0x32badd['count'],_0x14c03f=_0x353468[_0xf0f9('0x1b')],_0xd38196=_0x353468[_0xf0f9('0x1b')]+_0x353468[_0xf0f9('0x1c')],_0x5d4119;if(_0xd38196>=_0x29d38a){_0xd38196=_0x29d38a;_0x5d4119=0xc8;}else{_0x5d4119=0xce;}_0x431d95[_0xf0f9('0x19')](_0x5d4119);return _0x431d95['set'](_0xf0f9('0x1d'),_0x14c03f+'-'+_0xd38196+'/'+_0x29d38a)[_0xf0f9('0x1e')](_0x32badd);}return null;};}function patchUpdates(_0x3ccd49){return function(_0x38a166){try{jsonpatch[_0xf0f9('0x1f')](_0x38a166,_0x3ccd49,!![]);}catch(_0x45b6db){return BPromise[_0xf0f9('0x20')](_0x45b6db);}return _0x38a166[_0xf0f9('0x21')]();};}function saveUpdates(_0x5a0ff6,_0x5e2954){return function(_0x5c810e){if(_0x5c810e){return _0x5c810e[_0xf0f9('0x22')](_0x5a0ff6)['then'](function(_0x214bc4){return _0x214bc4;});}return null;};}function removeEntity(_0x1485ce,_0x1baf8d){return function(_0x16b5be){if(_0x16b5be){return _0x16b5be[_0xf0f9('0x23')]()[_0xf0f9('0x24')](function(){_0x1485ce[_0xf0f9('0x19')](0xcc)[_0xf0f9('0x1a')]();});}};}function handleEntityNotFound(_0x3abe4a,_0x3c943d){return function(_0x575fb0){if(!_0x575fb0){_0x3abe4a[_0xf0f9('0x25')](0x194);}return _0x575fb0;};}function handleError(_0x31a980,_0x4026f4){_0x4026f4=_0x4026f4||0x1f4;return function(_0x49f97b){logger[_0xf0f9('0x26')](_0x49f97b['stack']);if(_0x49f97b[_0xf0f9('0x27')]){delete _0x49f97b['name'];}_0x31a980[_0xf0f9('0x19')](_0x4026f4)[_0xf0f9('0x28')](_0x49f97b);};}exports[_0xf0f9('0x29')]=function(_0x56dae9,_0x365813){var _0x5396ca={},_0x2747e5={},_0x28030d={'count':0x0,'rows':[]};var _0x43e693=_[_0xf0f9('0x2a')](db['ScreenRecording'][_0xf0f9('0x2b')],function(_0xdaae){return{'name':_0xdaae['fieldName'],'type':_0xdaae[_0xf0f9('0x2c')][_0xf0f9('0x2d')]};});_0x2747e5[_0xf0f9('0x2e')]=_[_0xf0f9('0x2f')](_[_0xf0f9('0x2a')](_0x43e693,'name'),[_0xf0f9('0x30')]);_0x2747e5['query']=_[_0xf0f9('0x31')](_0x56dae9[_0xf0f9('0x32')]);_0x2747e5['filters']=_[_0xf0f9('0x33')](_0x2747e5[_0xf0f9('0x2e')],_0x2747e5['query']);_0x5396ca[_0xf0f9('0x34')]=_[_0xf0f9('0x33')](_0x2747e5[_0xf0f9('0x2e')],qs[_0xf0f9('0x35')](_0x56dae9[_0xf0f9('0x32')][_0xf0f9('0x35')]));_0x5396ca['attributes']=_0x5396ca[_0xf0f9('0x34')][_0xf0f9('0x36')]?_0x5396ca[_0xf0f9('0x34')]:_0x2747e5[_0xf0f9('0x2e')];if(!_0x56dae9[_0xf0f9('0x32')][_0xf0f9('0x37')](_0xf0f9('0x38'))){_0x5396ca[_0xf0f9('0x1c')]=qs[_0xf0f9('0x1c')](_0x56dae9['query']['limit']);_0x5396ca[_0xf0f9('0x1b')]=qs['offset'](_0x56dae9[_0xf0f9('0x32')][_0xf0f9('0x1b')]);}_0x5396ca[_0xf0f9('0x39')]=qs[_0xf0f9('0x3a')](_0x56dae9[_0xf0f9('0x32')][_0xf0f9('0x3a')]);_0x5396ca[_0xf0f9('0x3b')]=qs['filters'](_[_0xf0f9('0x3c')](_0x56dae9[_0xf0f9('0x32')],_0x2747e5[_0xf0f9('0x3d')]),_0x43e693);if(_0x56dae9[_0xf0f9('0x32')][_0xf0f9('0x3e')]){_0x5396ca[_0xf0f9('0x3b')]=_[_0xf0f9('0x3f')](_0x5396ca[_0xf0f9('0x3b')],{'$or':_[_0xf0f9('0x2a')](_0x43e693,function(_0x6435a0){if(_0x6435a0['type']!==_0xf0f9('0x40')){var _0x118cc9={};_0x118cc9[_0x6435a0[_0xf0f9('0x27')]]={'$like':'%'+_0x56dae9['query'][_0xf0f9('0x3e')]+'%'};return _0x118cc9;}})});}_0x5396ca=_[_0xf0f9('0x3f')]({},_0x5396ca,_0x56dae9[_0xf0f9('0x41')]);var _0x3f5444={'where':_0x5396ca[_0xf0f9('0x3b')]};return db['ScreenRecording'][_0xf0f9('0x42')](_0x3f5444)['then'](function(_0x4cc6ca){_0x28030d[_0xf0f9('0x42')]=_0x4cc6ca;if(_0x56dae9[_0xf0f9('0x32')]['includeAll']){_0x5396ca['include']=[{'all':!![]}];}return db['ScreenRecording'][_0xf0f9('0x43')](_0x5396ca);})[_0xf0f9('0x24')](function(_0x896404){_0x28030d['rows']=_0x896404;return _0x28030d;})[_0xf0f9('0x24')](respondWithFilteredResult(_0x365813,_0x5396ca))[_0xf0f9('0x44')](handleError(_0x365813,null));};exports['show']=function(_0x2abcfa,_0x1a9e72){var _0x35d775={'raw':![],'where':{'id':_0x2abcfa['params']['id']}},_0x25838f={};_0x25838f[_0xf0f9('0x2e')]=_[_0xf0f9('0x31')](db['ScreenRecording'][_0xf0f9('0x2b')]);_0x25838f['query']=_['keys'](_0x2abcfa[_0xf0f9('0x32')]);_0x25838f[_0xf0f9('0x3d')]=_[_0xf0f9('0x33')](_0x25838f[_0xf0f9('0x2e')],_0x25838f[_0xf0f9('0x32')]);_0x35d775[_0xf0f9('0x34')]=_['intersection'](_0x25838f[_0xf0f9('0x2e')],qs[_0xf0f9('0x35')](_0x2abcfa[_0xf0f9('0x32')][_0xf0f9('0x35')]));_0x35d775[_0xf0f9('0x34')]=_0x35d775[_0xf0f9('0x34')][_0xf0f9('0x36')]?_0x35d775['attributes']:_0x25838f['model'];if(_0x2abcfa[_0xf0f9('0x32')][_0xf0f9('0x45')]){_0x35d775[_0xf0f9('0x46')]=[{'all':!![]}];}_0x35d775=_['merge']({},_0x35d775,_0x2abcfa[_0xf0f9('0x41')]);return db['ScreenRecording']['find'](_0x35d775)[_0xf0f9('0x24')](handleEntityNotFound(_0x1a9e72,null))[_0xf0f9('0x24')](respondWithResult(_0x1a9e72,null))[_0xf0f9('0x44')](handleError(_0x1a9e72,null));};exports['create']=function(_0x888868,_0x402a2e){return db[_0xf0f9('0x47')]['create'](_0x888868[_0xf0f9('0x48')],{})[_0xf0f9('0x24')](respondWithResult(_0x402a2e,0xc9))['catch'](handleError(_0x402a2e,null));};exports['update']=function(_0xffeea3,_0xfa23cc){if(_0xffeea3['body']['id']){delete _0xffeea3[_0xf0f9('0x48')]['id'];}delete _0xffeea3['body'][_0xf0f9('0x49')];delete _0xffeea3[_0xf0f9('0x48')]['createdAt'];delete _0xffeea3[_0xf0f9('0x48')]['closedAt'];delete _0xffeea3[_0xf0f9('0x48')][_0xf0f9('0x4a')];return db[_0xf0f9('0x47')][_0xf0f9('0x4b')]({'where':{'id':_0xffeea3[_0xf0f9('0x4c')]['id']}})[_0xf0f9('0x24')](handleEntityNotFound(_0xfa23cc,null))[_0xf0f9('0x24')](saveUpdates(_0xffeea3[_0xf0f9('0x48')],null))[_0xf0f9('0x24')](respondWithResult(_0xfa23cc,null))['catch'](handleError(_0xfa23cc,null));};exports['describe']=function(_0x2e0b73,_0x3f100f){return db[_0xf0f9('0x47')][_0xf0f9('0x4d')]()['then'](respondWithResult(_0x3f100f,null))[_0xf0f9('0x44')](handleError(_0x3f100f,null));};exports['download']=function(_0x103fff,_0x16a72e,_0x1c7689){var _0x475243=require(_0xf0f9('0x4e'));var _0x543959=![];var _0x1a0206={};if(_0x103fff[_0xf0f9('0x32')][_0xf0f9('0x2c')]&&_0x103fff[_0xf0f9('0x32')][_0xf0f9('0x2c')]===_0xf0f9('0x4f')){_0x1a0206['uniqueid']=_0x103fff[_0xf0f9('0x4c')]['id'];}else{_0x1a0206['id']=_0x103fff[_0xf0f9('0x4c')]['id'];}return db[_0xf0f9('0x47')][_0xf0f9('0x4b')]({'where':_0x1a0206,'attributes':['id',_0xf0f9('0x4a')],'raw':!![]})[_0xf0f9('0x24')](handleEntityNotFound(_0x16a72e,null))['then'](function(_0x3fdb9b){if(_0x3fdb9b){var _0x31370e=path['join'](config['root'],_0xf0f9('0x50'),_0x3fdb9b[_0xf0f9('0x4a')]);var _0x31e8e5=util[_0xf0f9('0x30')](_0xf0f9('0x51'),_0x31370e);if(fs[_0xf0f9('0x52')](_0x31e8e5)){_0x543959=!![];return _0x475243['decryptFile'](_0x31e8e5,_0x31370e,config[_0xf0f9('0x53')]['recording'])['then'](function(){return _0x3fdb9b;});}return _0x3fdb9b;}})['then'](function(_0x5e5b1d){if(_0x5e5b1d){var _0x3bfeb1=path[_0xf0f9('0x54')](config['root'],'server/files/screen_recordings',_0x5e5b1d[_0xf0f9('0x4a')]);if(!fs['existsSync'](_0x3bfeb1)){throw new db['Sequelize'][(_0xf0f9('0x55'))](_0xf0f9('0x56'));}if(_0x5e5b1d[_0xf0f9('0x57')]){return _0x16a72e[_0xf0f9('0x58')](_0x3bfeb1,_0x5e5b1d['filename']+path[_0xf0f9('0x59')](_0x3bfeb1),function(){if(_0x543959){fs[_0xf0f9('0x5a')](_0x3bfeb1);}});}else{return _0x16a72e[_0xf0f9('0x58')](_0x3bfeb1,function(_0x17a862){if(_0x543959){fs[_0xf0f9('0x5a')](_0x3bfeb1);}});}}})['catch'](function(_0x14538a){if(_0x14538a[_0xf0f9('0x5b')]===_0xf0f9('0x56')){_0x16a72e[_0xf0f9('0x19')](0x194)['send'](_0xf0f9('0x5c'));}else{return handleError(_0x16a72e,null);}});};exports[_0xf0f9('0x23')]=function(_0x2fb10c,_0x3e1da1){return db[_0xf0f9('0x47')]['find']({'where':{'id':_0x2fb10c[_0xf0f9('0x4c')]['id']}})['then'](function(_0x227b9e){if(!_0x227b9e)throw new ReferenceError(_0xf0f9('0x5d'));return _0x227b9e;})[_0xf0f9('0x24')](function(_0x1cdd78){var _0xa59dbb=path[_0xf0f9('0x54')](config[_0xf0f9('0x5e')],_0xf0f9('0x50'),_0x1cdd78[_0xf0f9('0x4a')]);logger[_0xf0f9('0x5f')](_0xf0f9('0x60'),_0xa59dbb);if(!_['isNil'](_0x1cdd78[_0xf0f9('0x4a')])&&fs[_0xf0f9('0x52')](_0xa59dbb)){logger['info'](_0xf0f9('0x61')+_0xa59dbb+_0xf0f9('0x62'));fs[_0xf0f9('0x63')](_0xa59dbb);}_0xa59dbb=_0xa59dbb+'.cypher';if(!_['isNil'](_0x1cdd78[_0xf0f9('0x4a')])&&fs['existsSync'](_0xa59dbb)){logger[_0xf0f9('0x5f')](_0xf0f9('0x61')+_0xa59dbb+_0xf0f9('0x62'));fs[_0xf0f9('0x63')](_0xa59dbb);}return _0x1cdd78;})[_0xf0f9('0x24')](function(_0x1056ac){if(!_0x1056ac)throw new InternalError();return _0x1056ac[_0xf0f9('0x23')]();})['then'](function(){_0x3e1da1[_0xf0f9('0x19')](0xcc)[_0xf0f9('0x1a')]();})[_0xf0f9('0x44')](handleError(_0x3e1da1,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index fcb57b5..1799f48 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 _0x78f4=['interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x78f4,0x79));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x478f('0x0'));var util=require(_0x478f('0x1'));var logger=require(_0x478f('0x2'))(_0x478f('0x3'));var moment=require(_0x478f('0x4'));var BPromise=require(_0x478f('0x5'));var rp=require(_0x478f('0x6'));var fs=require('fs');var path=require(_0x478f('0x7'));var rimraf=require(_0x478f('0x8'));var config=require(_0x478f('0x9'));var attributes=require(_0x478f('0xa'));module[_0x478f('0xb')]=function(_0x12fe27,_0x49e31f){return _0x12fe27[_0x478f('0xc')](_0x478f('0xd'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x478f('0xe'),'fields':[_0x478f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x95b4=['./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0x95b4,0x6f));var _0x495b=function(_0x1cc734,_0x42bb83){_0x1cc734=_0x1cc734-0x0;var _0x383e14=_0x95b4[_0x1cc734];return _0x383e14;};'use strict';var _=require(_0x495b('0x0'));var util=require(_0x495b('0x1'));var logger=require(_0x495b('0x2'))(_0x495b('0x3'));var moment=require(_0x495b('0x4'));var BPromise=require(_0x495b('0x5'));var rp=require(_0x495b('0x6'));var fs=require('fs');var path=require(_0x495b('0x7'));var rimraf=require('rimraf');var config=require(_0x495b('0x8'));var attributes=require(_0x495b('0x9'));module[_0x495b('0xa')]=function(_0xfa4dd7,_0x32c9d0){return _0xfa4dd7[_0x495b('0xb')](_0x495b('0xc'),attributes,{'tableName':_0x495b('0xd'),'paranoid':![],'indexes':[{'name':_0x495b('0xe'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 46e3f5d..0742721 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 _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\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(_0x30151b,_0x3faff3){var _0x36e34e=function(_0x139940){while(--_0x139940){_0x30151b['push'](_0x30151b['shift']());}};_0x36e34e(++_0x3faff3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\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(_0x37453d,_0x4959ac){var _0x15f64b=function(_0x38ee30){while(--_0x38ee30){_0x37453d['push'](_0x37453d['shift']());}};_0x15f64b(++_0x4959ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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/setting/index.js b/server/api/setting/index.js index dd2e5e5..9c4c6ec 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 _0xa9e0=['addFavicon','put','isAuthenticated','update','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','post','single','addLogo','logologin','extname','file','addLogoLogin','preferred','addPreferred','%s%s','favicon'];(function(_0x36d674,_0x4c99d0){var _0x301a26=function(_0x35c379){while(--_0x35c379){_0x36d674['push'](_0x36d674['shift']());}};_0x301a26(++_0x4c99d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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'),controller['getDate']);router['get'](_0x0a9e('0xb'),controller['show']);router['get'](_0x0a9e('0xc'),controller[_0x0a9e('0xd')]);router[_0x0a9e('0x8')](_0x0a9e('0xe'),controller[_0x0a9e('0xf')]);router[_0x0a9e('0x8')]('/:id/gdpr',controller['gdpr']);router['get']('/:id/preferred',controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),controller[_0x0a9e('0x12')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x69aeb7,_0x5db4b0,_0x4283ce){_0x4283ce(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x44dcfd,_0x4d5611,_0x52a03d){_0x52a03d(null,util[_0x0a9e('0x17')]('%s%s',_0x0a9e('0x18'),path['extname'](_0x4d5611[_0x0a9e('0x19')])));}})});router[_0x0a9e('0x1a')]('/:id/logo',upload[_0x0a9e('0x1b')]('file'),controller[_0x0a9e('0x1c')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x106033,_0x205fd6,_0x31b1ca){_0x31b1ca(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x1314ae,_0x112016,_0x1c696a){_0x1c696a(null,util[_0x0a9e('0x17')]('%s%s',_0x0a9e('0x1d'),path[_0x0a9e('0x1e')](_0x112016['originalname'])));}})});router[_0x0a9e('0x1a')]('/:id/logo_login',upload['single'](_0x0a9e('0x1f')),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x30bae6,_0x4abc77,_0xfb6e48){_0xfb6e48(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x370d86,_0x42ac8f,_0x16b1ca){_0x16b1ca(null,util['format']('%s%s',_0x0a9e('0x21'),path[_0x0a9e('0x1e')](_0x42ac8f[_0x0a9e('0x19')])));}})});router[_0x0a9e('0x1a')]('/:id/preferred',upload[_0x0a9e('0x1b')]('file'),controller[_0x0a9e('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dc186,_0x34dc65,_0x25fba9){_0x25fba9(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x11c3b6,_0x14de77,_0x5a101a){_0x5a101a(null,util[_0x0a9e('0x17')](_0x0a9e('0x23'),_0x0a9e('0x24'),path[_0x0a9e('0x1e')](_0x14de77['originalname'])));}})});router[_0x0a9e('0x1a')](_0x0a9e('0x11'),upload[_0x0a9e('0x1b')](_0x0a9e('0x1f')),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x26')](_0x0a9e('0xb'),auth[_0x0a9e('0x27')](),controller[_0x0a9e('0x28')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['addFavicon','put','isAuthenticated','update','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','post','single','addLogo','logologin','extname','file','addLogoLogin','preferred','addPreferred','%s%s','favicon'];(function(_0x147b8a,_0x2a12c5){var _0xf842f=function(_0x22ee69){while(--_0x22ee69){_0x147b8a['push'](_0x147b8a['shift']());}};_0xf842f(++_0x2a12c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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'),controller['getDate']);router['get'](_0x0a9e('0xb'),controller['show']);router['get'](_0x0a9e('0xc'),controller[_0x0a9e('0xd')]);router[_0x0a9e('0x8')](_0x0a9e('0xe'),controller[_0x0a9e('0xf')]);router[_0x0a9e('0x8')]('/:id/gdpr',controller['gdpr']);router['get']('/:id/preferred',controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),controller[_0x0a9e('0x12')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x69aeb7,_0x5db4b0,_0x4283ce){_0x4283ce(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x44dcfd,_0x4d5611,_0x52a03d){_0x52a03d(null,util[_0x0a9e('0x17')]('%s%s',_0x0a9e('0x18'),path['extname'](_0x4d5611[_0x0a9e('0x19')])));}})});router[_0x0a9e('0x1a')]('/:id/logo',upload[_0x0a9e('0x1b')]('file'),controller[_0x0a9e('0x1c')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x106033,_0x205fd6,_0x31b1ca){_0x31b1ca(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x1314ae,_0x112016,_0x1c696a){_0x1c696a(null,util[_0x0a9e('0x17')]('%s%s',_0x0a9e('0x1d'),path[_0x0a9e('0x1e')](_0x112016['originalname'])));}})});router[_0x0a9e('0x1a')]('/:id/logo_login',upload['single'](_0x0a9e('0x1f')),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer[_0x0a9e('0x13')]({'destination':function(_0x30bae6,_0x4abc77,_0xfb6e48){_0xfb6e48(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x370d86,_0x42ac8f,_0x16b1ca){_0x16b1ca(null,util['format']('%s%s',_0x0a9e('0x21'),path[_0x0a9e('0x1e')](_0x42ac8f[_0x0a9e('0x19')])));}})});router[_0x0a9e('0x1a')]('/:id/preferred',upload[_0x0a9e('0x1b')]('file'),controller[_0x0a9e('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dc186,_0x34dc65,_0x25fba9){_0x25fba9(null,path[_0x0a9e('0x14')](config[_0x0a9e('0x15')],_0x0a9e('0x16')));},'filename':function(_0x11c3b6,_0x14de77,_0x5a101a){_0x5a101a(null,util[_0x0a9e('0x17')](_0x0a9e('0x23'),_0x0a9e('0x24'),path[_0x0a9e('0x1e')](_0x14de77['originalname'])));}})});router[_0x0a9e('0x1a')](_0x0a9e('0x11'),upload[_0x0a9e('0x1b')](_0x0a9e('0x1f')),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x26')](_0x0a9e('0xb'),auth[_0x0a9e('0x27')](),controller[_0x0a9e('0x28')]);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 68da199..9ad3e46 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 _0xebe2=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','INTEGER','min_internal','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x333a02,_0x14f137){var _0x718474=function(_0x205afc){while(--_0x205afc){_0x333a02['push'](_0x333a02['shift']());}};_0x718474(++_0x14f137);}(_0xebe2,0x143));var _0x2ebe=function(_0x366e51,_0x3a0178){_0x366e51=_0x366e51-0x0;var _0x4e23e3=_0xebe2[_0x366e51];return _0x4e23e3;};'use strict';var Sequelize=require('sequelize');module['exports']={'min_internal':{'type':Sequelize[_0x2ebe('0x0')](0xb),'unique':_0x2ebe('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x2ebe('0x0')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x2ebe('0x0')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x2ebe('0x2')],'defaultValue':_0x2ebe('0x3')},'logo':{'type':Sequelize[_0x2ebe('0x2')]},'defaultLogo':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x2ebe('0x2')]},'defaultLoginLogo':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x2ebe('0x2')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x2ebe('0x2')]},'turnaddr':{'type':Sequelize[_0x2ebe('0x2')]},'turnusername':{'type':Sequelize[_0x2ebe('0x2')]},'turnpassword':{'type':Sequelize[_0x2ebe('0x2')]},'pageTitle':{'type':Sequelize[_0x2ebe('0x2')]},'defaultPageTitle':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x2ebe('0x0')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x2ebe('0x5')},'enableEmailPreview':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':![]},'split':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x2ebe('0x0')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x2ebe('0x0')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x2ebe('0x0')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x2ebe('0x2')],'defaultValue':_0x2ebe('0x6')},'chatTimeout':{'type':Sequelize[_0x2ebe('0x0')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x2ebe('0x2')]},'allowedLoginAttempts':{'type':Sequelize[_0x2ebe('0x0')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x2ebe('0x2')]},'defaultFavicon':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x2ebe('0x0')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x2ebe('0x2')]},'sentiment':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x2ebe('0x0')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2ebe('0x2')]},'bucket':{'type':Sequelize[_0x2ebe('0x2')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x2ebe('0x0')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x2ebe('0x0')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x2ebe('0x0')](0x2)[_0x2ebe('0x7')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x2ebe('0x0')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x2ebe('0x0')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x2ebe('0x0')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x2ebe('0x0')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x2ebe('0x0')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x2ebe('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xfc7d=['UNSIGNED','exports','min_internal','INTEGER','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','alternate'];(function(_0x4bd009,_0xb83b0c){var _0x163a27=function(_0xff7816){while(--_0xff7816){_0x4bd009['push'](_0x4bd009['shift']());}};_0x163a27(++_0xb83b0c);}(_0xfc7d,0x1a8));var _0xdfc7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xfc7d[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module[_0xdfc7('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0xdfc7('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xdfc7('0x2')](0xb),'unique':_0xdfc7('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xdfc7('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xdfc7('0x4')},'logo':{'type':Sequelize[_0xdfc7('0x5')]},'defaultLogo':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xdfc7('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xdfc7('0x5')]},'turnaddr':{'type':Sequelize[_0xdfc7('0x5')]},'turnusername':{'type':Sequelize[_0xdfc7('0x5')]},'turnpassword':{'type':Sequelize[_0xdfc7('0x5')]},'pageTitle':{'type':Sequelize[_0xdfc7('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xdfc7('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xdfc7('0x5')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xdfc7('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xdfc7('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xdfc7('0x5')],'defaultValue':_0xdfc7('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xdfc7('0x5')]},'defaultPreferred':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xdfc7('0x5')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xdfc7('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xdfc7('0x5')]},'defaultFavicon':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xdfc7('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xdfc7('0x2')]},'transcribeRegion':{'type':Sequelize[_0xdfc7('0x5')]},'sentiment':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0xdfc7('0x5')]},'language':{'type':Sequelize[_0xdfc7('0x5')]},'bucket':{'type':Sequelize[_0xdfc7('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xdfc7('0x2')](0x2)[_0xdfc7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xdfc7('0x2')](0x2)[_0xdfc7('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0xdfc7('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0xdfc7('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xdfc7('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xdfc7('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xdfc7('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xdfc7('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xdfc7('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 0c84abe..76c2c41 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 _0x2904=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','Setting','include','show','params','includeAll','options','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','find','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default','custom','default_logo.svg','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','Sequelize','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','stack','send','index','map','fieldName','type','key','model','name','query','keys','filters'];(function(_0x34fca6,_0x2dd676){var _0xdf91e6=function(_0x13ee28){while(--_0x13ee28){_0x34fca6['push'](_0x34fca6['shift']());}};_0xdf91e6(++_0x2dd676);}(_0x2904,0x137));var _0x4290=function(_0x9b2368,_0x5e5b07){_0x9b2368=_0x9b2368-0x0;var _0x253104=_0x2904[_0x9b2368];return _0x253104;};'use strict';var emlformat=require(_0x4290('0x0'));var rimraf=require(_0x4290('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4290('0x2'));var rp=require('request-promise');var moment=require(_0x4290('0x3'));var BPromise=require(_0x4290('0x4'));var Mustache=require(_0x4290('0x5'));var util=require(_0x4290('0x6'));var path=require(_0x4290('0x7'));var sox=require('sox');var csv=require(_0x4290('0x8'));var ejs=require(_0x4290('0x9'));var fs=require('fs');var fs_extra=require(_0x4290('0xa'));var _=require('lodash');var squel=require(_0x4290('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4290('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4290('0xd'));var Papa=require(_0x4290('0xe'));var Redis=require('ioredis');var authService=require(_0x4290('0xf'));var qs=require(_0x4290('0x10'));var as=require(_0x4290('0x11'));var hardwareService=require(_0x4290('0x12'));var logger=require(_0x4290('0x13'))(_0x4290('0x14'));var utils=require(_0x4290('0x15'));var config=require(_0x4290('0x16'));var licenseUtil=require(_0x4290('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4290('0x18'));var client=jayson[_0x4290('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18223a,_0x56a496,_0x2137b3,_0x4ceefc){return new BPromise(function(_0x418062,_0x252b4e){var _0x59a02c=_0x4ceefc||client;return _0x59a02c[_0x4290('0x1a')](_0x18223a,_0x2137b3)['then'](function(_0x1c8d95){logger[_0x4290('0x1b')](_0x4290('0x1c'),_0x56a496,'request\x20sent');logger[_0x4290('0x1d')](_0x4290('0x1e'),_0x56a496,'request\x20sent',JSON[_0x4290('0x1f')](_0x1c8d95));if(_0x1c8d95[_0x4290('0x20')]){if(_0x1c8d95[_0x4290('0x20')][_0x4290('0x21')]===0x1f4){logger[_0x4290('0x20')]('Setting,\x20%s,\x20%s',_0x56a496,_0x1c8d95[_0x4290('0x20')]['message']);return _0x252b4e(_0x1c8d95[_0x4290('0x20')][_0x4290('0x22')]);}logger[_0x4290('0x20')]('Setting,\x20%s,\x20%s',_0x56a496,_0x1c8d95[_0x4290('0x20')]['message']);return _0x418062(_0x1c8d95[_0x4290('0x20')]['message']);}else{logger['info'](_0x4290('0x1c'),_0x56a496,_0x4290('0x23'));_0x418062(_0x1c8d95[_0x4290('0x24')][_0x4290('0x22')]);}})[_0x4290('0x25')](function(_0x3b178d){logger['error'](_0x4290('0x1c'),_0x56a496,_0x3b178d);_0x252b4e(_0x3b178d);});});}function respondWithStatusCode(_0x5e912a,_0x14999){_0x14999=_0x14999||0xcc;return function(_0x46d4bd){if(_0x46d4bd){return _0x5e912a[_0x4290('0x26')](_0x14999);}return _0x5e912a[_0x4290('0x27')](_0x14999)['end']();};}function respondWithResult(_0x57525b,_0x14f428){_0x14f428=_0x14f428||0xc8;return function(_0x33738b){if(_0x33738b){return _0x57525b[_0x4290('0x27')](_0x14f428)[_0x4290('0x28')](_0x33738b);}};}function respondWithFilteredResult(_0x1fcbb9,_0x2031a6){return function(_0xdd3947){if(_0xdd3947){var _0x3c4def=_0xdd3947[_0x4290('0x29')],_0x1af4b8=_0x2031a6[_0x4290('0x2a')],_0x4675a9=_0x2031a6['offset']+_0x2031a6[_0x4290('0x2b')],_0x524807;if(_0x4675a9>=_0x3c4def){_0x4675a9=_0x3c4def;_0x524807=0xc8;}else{_0x524807=0xce;}_0x1fcbb9[_0x4290('0x27')](_0x524807);return _0x1fcbb9[_0x4290('0x2c')](_0x4290('0x2d'),_0x1af4b8+'-'+_0x4675a9+'/'+_0x3c4def)['json'](_0xdd3947);}return null;};}function patchUpdates(_0x3fa5e8){return function(_0x660773){try{jsonpatch['apply'](_0x660773,_0x3fa5e8,!![]);}catch(_0x2d73ca){return BPromise[_0x4290('0x2e')](_0x2d73ca);}return _0x660773[_0x4290('0x2f')]();};}function saveUpdates(_0x2e59a6,_0x3569bd){return function(_0xd61b52){if(_0xd61b52){return _0xd61b52[_0x4290('0x30')](_0x2e59a6)[_0x4290('0x31')](function(_0x3eb106){return _0x3eb106;});}return null;};}function removeEntity(_0x21e7b7,_0x5debd4){return function(_0x7ebf46){if(_0x7ebf46){return _0x7ebf46[_0x4290('0x32')]()[_0x4290('0x31')](function(){_0x21e7b7[_0x4290('0x27')](0xcc)[_0x4290('0x33')]();});}};}function handleEntityNotFound(_0x231547,_0x194711){return function(_0x1024fb){if(!_0x1024fb){_0x231547[_0x4290('0x26')](0x194);}return _0x1024fb;};}function handleError(_0xbeccce,_0x4db49f){_0x4db49f=_0x4db49f||0x1f4;return function(_0x4c8ba4){logger[_0x4290('0x20')](_0x4c8ba4[_0x4290('0x34')]);if(_0x4c8ba4['name']){delete _0x4c8ba4['name'];}_0xbeccce[_0x4290('0x27')](_0x4db49f)[_0x4290('0x35')](_0x4c8ba4);};}exports[_0x4290('0x36')]=function(_0x306af4,_0x2c97f5){var _0x50046d={},_0x5e4e91={},_0x159dee={'count':0x0,'rows':[]};var _0x29026a=_[_0x4290('0x37')](db['Setting']['rawAttributes'],function(_0x113eb2){return{'name':_0x113eb2[_0x4290('0x38')],'type':_0x113eb2[_0x4290('0x39')][_0x4290('0x3a')]};});_0x5e4e91[_0x4290('0x3b')]=_[_0x4290('0x37')](_0x29026a,_0x4290('0x3c'));_0x5e4e91[_0x4290('0x3d')]=_[_0x4290('0x3e')](_0x306af4[_0x4290('0x3d')]);_0x5e4e91[_0x4290('0x3f')]=_[_0x4290('0x40')](_0x5e4e91[_0x4290('0x3b')],_0x5e4e91[_0x4290('0x3d')]);_0x50046d['attributes']=_[_0x4290('0x40')](_0x5e4e91[_0x4290('0x3b')],qs[_0x4290('0x41')](_0x306af4['query'][_0x4290('0x41')]));_0x50046d[_0x4290('0x42')]=_0x50046d['attributes'][_0x4290('0x43')]?_0x50046d['attributes']:_0x5e4e91[_0x4290('0x3b')];if(!_0x306af4['query'][_0x4290('0x44')](_0x4290('0x45'))){_0x50046d[_0x4290('0x2b')]=qs['limit'](_0x306af4['query'][_0x4290('0x2b')]);_0x50046d[_0x4290('0x2a')]=qs[_0x4290('0x2a')](_0x306af4[_0x4290('0x3d')][_0x4290('0x2a')]);}_0x50046d[_0x4290('0x46')]=qs['sort'](_0x306af4[_0x4290('0x3d')][_0x4290('0x47')]);_0x50046d[_0x4290('0x48')]=qs[_0x4290('0x3f')](_[_0x4290('0x49')](_0x306af4[_0x4290('0x3d')],_0x5e4e91[_0x4290('0x3f')]),_0x29026a);if(_0x306af4[_0x4290('0x3d')]['filter']){_0x50046d[_0x4290('0x48')]=_[_0x4290('0x4a')](_0x50046d[_0x4290('0x48')],{'$or':_[_0x4290('0x37')](_0x29026a,function(_0x359249){if(_0x359249[_0x4290('0x39')]!==_0x4290('0x4b')){var _0xd4273c={};_0xd4273c[_0x359249['name']]={'$like':'%'+_0x306af4[_0x4290('0x3d')][_0x4290('0x4c')]+'%'};return _0xd4273c;}})});}_0x50046d=_[_0x4290('0x4a')]({},_0x50046d,_0x306af4['options']);var _0x3f54dd={'where':_0x50046d[_0x4290('0x48')]};return db[_0x4290('0x4d')]['count'](_0x3f54dd)[_0x4290('0x31')](function(_0x26e636){_0x159dee[_0x4290('0x29')]=_0x26e636;if(_0x306af4['query']['includeAll']){_0x50046d[_0x4290('0x4e')]=[{'all':!![]}];}return db[_0x4290('0x4d')]['findAll'](_0x50046d);})[_0x4290('0x31')](function(_0x23a4d3){_0x159dee['rows']=_0x23a4d3;return _0x159dee;})[_0x4290('0x31')](respondWithFilteredResult(_0x2c97f5,_0x50046d))[_0x4290('0x25')](handleError(_0x2c97f5,null));};exports[_0x4290('0x4f')]=function(_0x4b5077,_0x13b984){var _0x2795e8={'raw':![],'where':{'id':_0x4b5077[_0x4290('0x50')]['id']}},_0xaa2195={};_0xaa2195[_0x4290('0x3b')]=_[_0x4290('0x3e')](db[_0x4290('0x4d')]['rawAttributes']);_0xaa2195[_0x4290('0x3d')]=_[_0x4290('0x3e')](_0x4b5077[_0x4290('0x3d')]);_0xaa2195[_0x4290('0x3f')]=_['intersection'](_0xaa2195[_0x4290('0x3b')],_0xaa2195[_0x4290('0x3d')]);_0x2795e8[_0x4290('0x42')]=_[_0x4290('0x40')](_0xaa2195[_0x4290('0x3b')],qs[_0x4290('0x41')](_0x4b5077[_0x4290('0x3d')][_0x4290('0x41')]));_0x2795e8[_0x4290('0x42')]=_0x2795e8['attributes']['length']?_0x2795e8['attributes']:_0xaa2195[_0x4290('0x3b')];if(_0x4b5077[_0x4290('0x3d')][_0x4290('0x51')]){_0x2795e8['include']=[{'all':!![]}];}_0x2795e8=_[_0x4290('0x4a')]({},_0x2795e8,_0x4b5077[_0x4290('0x52')]);return db[_0x4290('0x4d')]['find'](_0x2795e8)[_0x4290('0x31')](handleEntityNotFound(_0x13b984,null))['then'](respondWithResult(_0x13b984,null))[_0x4290('0x25')](handleError(_0x13b984,null));};exports[_0x4290('0x30')]=function(_0x4ce61f,_0x179a74){if(_0x4ce61f[_0x4290('0x53')]['id']){delete _0x4ce61f[_0x4290('0x53')]['id'];}return db[_0x4290('0x4d')]['find']({'where':{'id':_0x4ce61f['params']['id']}})[_0x4290('0x31')](handleEntityNotFound(_0x179a74,null))[_0x4290('0x31')](saveUpdates(_0x4ce61f[_0x4290('0x53')],null))[_0x4290('0x31')](respondWithResult(_0x179a74,null))[_0x4290('0x25')](handleError(_0x179a74,null));};exports[_0x4290('0x54')]=function(_0x4b7e50,_0x54fc77,_0x520b13){if(_0x4b7e50[_0x4290('0x55')]&&_0x4b7e50[_0x4290('0x55')][_0x4290('0x56')]){_0x4b7e50[_0x4290('0x53')][_0x4290('0x57')]=_0x4b7e50[_0x4290('0x55')]['filename'];}return db[_0x4290('0x4d')]['find']({'where':{'id':_0x4b7e50[_0x4290('0x50')]['id']}})[_0x4290('0x31')](handleEntityNotFound(_0x54fc77,null))[_0x4290('0x31')](saveUpdates(_0x4b7e50['body'],null))[_0x4290('0x31')](respondWithResult(_0x54fc77,null))['catch'](handleError(_0x54fc77,null));};exports[_0x4290('0x58')]=function(_0x4aab9f,_0x3f1728,_0x30bdf2){if(_0x4aab9f[_0x4290('0x55')]&&_0x4aab9f['file'][_0x4290('0x56')]){_0x4aab9f[_0x4290('0x53')][_0x4290('0x59')]=_0x4aab9f['file']['filename'];}return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0x4aab9f[_0x4290('0x50')]['id']}})[_0x4290('0x31')](handleEntityNotFound(_0x3f1728,null))[_0x4290('0x31')](saveUpdates(_0x4aab9f[_0x4290('0x53')],null))[_0x4290('0x31')](respondWithResult(_0x3f1728,null))[_0x4290('0x25')](handleError(_0x3f1728,null));};var utilLicense=require(_0x4290('0x17'));exports[_0x4290('0x5b')]=function(_0x518842,_0x485156,_0x3b3031){var _0x3b4db6='server/files/images/logos';var _0x3577b9={'custom':![]};return utilLicense[_0x4290('0x5c')]()['then'](function(_0x98abb){if(_0x98abb){_0x3577b9=_0x98abb;}return db['Setting'][_0x4290('0x5a')]({'where':{'id':_0x518842['params']['id']},'attributes':[_0x4290('0x57'),_0x4290('0x59'),_0x4290('0x5d'),_0x4290('0x5e'),_0x4290('0x5f'),_0x4290('0x60'),_0x4290('0x61'),_0x4290('0x62')],'raw':!![]});})['then'](handleEntityNotFound(_0x485156,null))[_0x4290('0x31')](function(_0x376a96){if(_0x376a96){var _0x56f869=_0x376a96[_0x4290('0x57')]&&fs[_0x4290('0x63')](path[_0x4290('0x64')](config['root'],_0x3b4db6,_[_0x4290('0x65')](_0x376a96[_0x4290('0x57')])))?path[_0x4290('0x64')](config[_0x4290('0x66')],_0x3b4db6,_[_0x4290('0x65')](_0x376a96['logo'])):path[_0x4290('0x64')](config[_0x4290('0x66')],_0x3b4db6,_[_0x4290('0x65')]('default_logo.svg'));var _0x35ad4d=_0x4290('0x67')+_['upperFirst']('logo');if(_0x376a96[_0x35ad4d]||!_0x3577b9[_0x4290('0x68')]){_0x56f869=path[_0x4290('0x64')](config[_0x4290('0x66')],_0x3b4db6,_[_0x4290('0x65')](_0x4290('0x69')));}if(!fs['existsSync'](_0x56f869)){throw new db['Sequelize'][(_0x4290('0x6a'))](_[_0x4290('0x6b')](_0x4290('0x57'))+_0x4290('0x6c'));}return _0x485156[_0x4290('0x6d')](_0x56f869);}})['catch'](handleError(_0x485156,null));};var utilLicense=require(_0x4290('0x17'));exports[_0x4290('0x6e')]=function(_0x6edae0,_0x199b3,_0x510d6d){var _0xaadb3a=_0x4290('0x6f');var _0x3d408a={'custom':![]};return utilLicense['getLicense']()[_0x4290('0x31')](function(_0xde0d5b){if(_0xde0d5b){_0x3d408a=_0xde0d5b;}return db['Setting'][_0x4290('0x5a')]({'where':{'id':_0x6edae0[_0x4290('0x50')]['id']},'attributes':[_0x4290('0x57'),_0x4290('0x59'),_0x4290('0x5d'),_0x4290('0x5e'),_0x4290('0x5f'),_0x4290('0x60'),_0x4290('0x61'),'defaultFavicon'],'raw':!![]});})[_0x4290('0x31')](handleEntityNotFound(_0x199b3,null))[_0x4290('0x31')](function(_0x1293ef){if(_0x1293ef){var _0x32cb4b=_0x1293ef['loginLogo']&&fs[_0x4290('0x63')](path[_0x4290('0x64')](config[_0x4290('0x66')],_0xaadb3a,_[_0x4290('0x65')](_0x1293ef[_0x4290('0x59')])))?path[_0x4290('0x64')](config[_0x4290('0x66')],_0xaadb3a,_[_0x4290('0x65')](_0x1293ef[_0x4290('0x59')])):path[_0x4290('0x64')](config[_0x4290('0x66')],_0xaadb3a,_['toLower'](_0x4290('0x70')));var _0x4beeac=_0x4290('0x67')+_[_0x4290('0x6b')](_0x4290('0x59'));if(_0x1293ef[_0x4beeac]||!_0x3d408a['custom']){_0x32cb4b=path[_0x4290('0x64')](config['root'],_0xaadb3a,_[_0x4290('0x65')](_0x4290('0x70')));}if(!fs[_0x4290('0x63')](_0x32cb4b)){throw new db[(_0x4290('0x71'))]['ValidationError'](_[_0x4290('0x6b')](_0x4290('0x59'))+'\x20not\x20found');}return _0x199b3[_0x4290('0x6d')](_0x32cb4b);}})[_0x4290('0x25')](handleError(_0x199b3,null));};exports[_0x4290('0x72')]=function(_0x4e34f6,_0x4abd3f){return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0x4e34f6[_0x4290('0x50')]['id']},'attributes':[_0x4290('0x73')]})['then'](respondWithResult(_0x4abd3f,null))[_0x4290('0x25')](handleError(_0x4abd3f,null));};exports[_0x4290('0x74')]=function(_0x4d00c0,_0xeca53e,_0xd29d06){if(_0x4d00c0[_0x4290('0x55')]&&_0x4d00c0['file'][_0x4290('0x56')]){_0x4d00c0[_0x4290('0x53')][_0x4290('0x5d')]=_0x4d00c0[_0x4290('0x55')][_0x4290('0x56')];}return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0x4d00c0[_0x4290('0x50')]['id']}})[_0x4290('0x31')](handleEntityNotFound(_0xeca53e,null))[_0x4290('0x31')](saveUpdates(_0x4d00c0[_0x4290('0x53')],null))[_0x4290('0x31')](respondWithResult(_0xeca53e,null))[_0x4290('0x25')](handleError(_0xeca53e,null));};var utilLicense=require(_0x4290('0x17'));exports[_0x4290('0x75')]=function(_0xb1d1c2,_0x453dac,_0x296a66){var _0x1e4314=_0x4290('0x6f');var _0x550e04={'custom':![]};return utilLicense[_0x4290('0x5c')]()['then'](function(_0x32a1c2){if(_0x32a1c2){_0x550e04=_0x32a1c2;}return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0xb1d1c2[_0x4290('0x50')]['id']},'attributes':[_0x4290('0x57'),'loginLogo',_0x4290('0x5d'),'favicon',_0x4290('0x5f'),_0x4290('0x60'),_0x4290('0x61'),_0x4290('0x62')],'raw':!![]});})[_0x4290('0x31')](handleEntityNotFound(_0x453dac,null))[_0x4290('0x31')](function(_0x5b96c6){if(_0x5b96c6){var _0x4273ef=_0x5b96c6[_0x4290('0x5d')]&&fs[_0x4290('0x63')](path[_0x4290('0x64')](config[_0x4290('0x66')],_0x1e4314,_[_0x4290('0x65')](_0x5b96c6[_0x4290('0x5d')])))?path[_0x4290('0x64')](config[_0x4290('0x66')],_0x1e4314,_[_0x4290('0x65')](_0x5b96c6['preferred'])):path[_0x4290('0x64')](config[_0x4290('0x66')],_0x1e4314,_[_0x4290('0x65')](_0x4290('0x76')));var _0x221a64='default'+_[_0x4290('0x6b')](_0x4290('0x5d'));if(_0x5b96c6[_0x221a64]||!_0x550e04[_0x4290('0x68')]||!_0x550e04[_0x4290('0x5d')]){_0x4273ef=path[_0x4290('0x64')](config[_0x4290('0x66')],_0x1e4314,_[_0x4290('0x65')]('default_preferred.png'));}if(!fs[_0x4290('0x63')](_0x4273ef)){throw new db['Sequelize'][(_0x4290('0x6a'))](_[_0x4290('0x6b')](_0x4290('0x5d'))+_0x4290('0x6c'));}return _0x453dac[_0x4290('0x6d')](_0x4273ef);}})[_0x4290('0x25')](handleError(_0x453dac,null));};exports[_0x4290('0x77')]=function(_0x3f23ae,_0x4c867d,_0x524dec){if(_0x3f23ae[_0x4290('0x55')]&&_0x3f23ae[_0x4290('0x55')][_0x4290('0x56')]){_0x3f23ae[_0x4290('0x53')][_0x4290('0x5e')]=_0x3f23ae['file'][_0x4290('0x56')];}return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0x3f23ae['params']['id']}})[_0x4290('0x31')](handleEntityNotFound(_0x4c867d,null))[_0x4290('0x31')](saveUpdates(_0x3f23ae[_0x4290('0x53')],null))[_0x4290('0x31')](respondWithResult(_0x4c867d,null))[_0x4290('0x25')](handleError(_0x4c867d,null));};var utilLicense=require(_0x4290('0x17'));exports[_0x4290('0x78')]=function(_0x3dd605,_0x2588ce,_0x4869d7){var _0x25a0d0='server/files/images/logos';var _0x4248e7={'custom':![]};return utilLicense[_0x4290('0x5c')]()[_0x4290('0x31')](function(_0x198b04){if(_0x198b04){_0x4248e7=_0x198b04;}return db[_0x4290('0x4d')][_0x4290('0x5a')]({'where':{'id':_0x3dd605['params']['id']},'attributes':[_0x4290('0x57'),_0x4290('0x59'),_0x4290('0x5d'),_0x4290('0x5e'),'defaultLogo',_0x4290('0x60'),_0x4290('0x61'),_0x4290('0x62')],'raw':!![]});})['then'](handleEntityNotFound(_0x2588ce,null))[_0x4290('0x31')](function(_0x519c78){if(_0x519c78){var _0x1bbd84=_0x519c78[_0x4290('0x5e')]&&fs[_0x4290('0x63')](path[_0x4290('0x64')](config[_0x4290('0x66')],_0x25a0d0,_[_0x4290('0x65')](_0x519c78[_0x4290('0x5e')])))?path['join'](config[_0x4290('0x66')],_0x25a0d0,_[_0x4290('0x65')](_0x519c78[_0x4290('0x5e')])):path[_0x4290('0x64')](config[_0x4290('0x66')],_0x25a0d0,_[_0x4290('0x65')](_0x4290('0x79')));var _0x5da6fb=_0x4290('0x67')+_[_0x4290('0x6b')](_0x4290('0x5e'));if(_0x519c78[_0x5da6fb]||!_0x4248e7[_0x4290('0x68')]){_0x1bbd84=path[_0x4290('0x64')](config[_0x4290('0x66')],_0x25a0d0,_[_0x4290('0x65')](_0x4290('0x79')));}if(!fs['existsSync'](_0x1bbd84)){throw new db[(_0x4290('0x71'))][(_0x4290('0x6a'))](_['upperFirst'](_0x4290('0x5e'))+_0x4290('0x6c'));}return _0x2588ce[_0x4290('0x6d')](_0x1bbd84);}})[_0x4290('0x25')](handleError(_0x2588ce,null));};exports[_0x4290('0x7a')]=function(_0x4f53f5,_0x251cd0){var _0x4924b0={'offset':moment()['utcOffset']()};_0x4924b0[_0x4290('0x7b')]=moment()['utcOffset'](_0x4924b0[_0x4290('0x2a')])['format'](_0x4290('0x7c'));return _0x251cd0[_0x4290('0x27')](0xc8)[_0x4290('0x35')](_0x4924b0);}; \ No newline at end of file +var _0xbf83=['merge','options','Setting','count','includeAll','findAll','show','length','include','find','update','body','file','filename','logo','params','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','root','toLower','join','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','existsSync','custom','default_loginLogo.svg','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','set','apply','reject','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','filter','where','VIRTUAL'];(function(_0x54f222,_0x4a027d){var _0x18c14e=function(_0x5a5431){while(--_0x5a5431){_0x54f222['push'](_0x54f222['shift']());}};_0x18c14e(++_0x4a027d);}(_0xbf83,0x11e));var _0x3bf8=function(_0x255178,_0x1725d5){_0x255178=_0x255178-0x0;var _0x116d92=_0xbf83[_0x255178];return _0x116d92;};'use strict';var emlformat=require(_0x3bf8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bf8('0x1'));var jsonpatch=require(_0x3bf8('0x2'));var rp=require(_0x3bf8('0x3'));var moment=require(_0x3bf8('0x4'));var BPromise=require(_0x3bf8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3bf8('0x6'));var sox=require(_0x3bf8('0x7'));var csv=require(_0x3bf8('0x8'));var ejs=require(_0x3bf8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3bf8('0xa'));var crypto=require(_0x3bf8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3bf8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3bf8('0xd'));var Papa=require(_0x3bf8('0xe'));var Redis=require(_0x3bf8('0xf'));var authService=require(_0x3bf8('0x10'));var qs=require(_0x3bf8('0x11'));var as=require(_0x3bf8('0x12'));var hardwareService=require(_0x3bf8('0x13'));var logger=require('../../config/logger')(_0x3bf8('0x14'));var utils=require(_0x3bf8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3bf8('0x16'));var db=require(_0x3bf8('0x17'))['db'];var jayson=require(_0x3bf8('0x18'));var client=jayson[_0x3bf8('0x19')][_0x3bf8('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x45640d,_0x27b4e1,_0x260445,_0x1b0338){return new BPromise(function(_0xfd8a89,_0x5ada93){var _0x48c6e0=_0x1b0338||client;return _0x48c6e0[_0x3bf8('0x1b')](_0x45640d,_0x260445)[_0x3bf8('0x1c')](function(_0x45607c){logger[_0x3bf8('0x1d')]('Setting,\x20%s,\x20%s',_0x27b4e1,_0x3bf8('0x1e'));logger[_0x3bf8('0x1f')](_0x3bf8('0x20'),_0x27b4e1,_0x3bf8('0x1e'),JSON[_0x3bf8('0x21')](_0x45607c));if(_0x45607c[_0x3bf8('0x22')]){if(_0x45607c[_0x3bf8('0x22')][_0x3bf8('0x23')]===0x1f4){logger[_0x3bf8('0x22')](_0x3bf8('0x24'),_0x27b4e1,_0x45607c[_0x3bf8('0x22')]['message']);return _0x5ada93(_0x45607c[_0x3bf8('0x22')][_0x3bf8('0x25')]);}logger['error'](_0x3bf8('0x24'),_0x27b4e1,_0x45607c['error'][_0x3bf8('0x25')]);return _0xfd8a89(_0x45607c['error'][_0x3bf8('0x25')]);}else{logger[_0x3bf8('0x1d')]('Setting,\x20%s,\x20%s',_0x27b4e1,_0x3bf8('0x1e'));_0xfd8a89(_0x45607c[_0x3bf8('0x26')][_0x3bf8('0x25')]);}})[_0x3bf8('0x27')](function(_0x5169a1){logger[_0x3bf8('0x22')]('Setting,\x20%s,\x20%s',_0x27b4e1,_0x5169a1);_0x5ada93(_0x5169a1);});});}function respondWithStatusCode(_0xee1dc9,_0x583d62){_0x583d62=_0x583d62||0xcc;return function(_0x556b43){if(_0x556b43){return _0xee1dc9[_0x3bf8('0x28')](_0x583d62);}return _0xee1dc9[_0x3bf8('0x29')](_0x583d62)[_0x3bf8('0x2a')]();};}function respondWithResult(_0x29d72c,_0x3245e2){_0x3245e2=_0x3245e2||0xc8;return function(_0x2419cc){if(_0x2419cc){return _0x29d72c[_0x3bf8('0x29')](_0x3245e2)[_0x3bf8('0x2b')](_0x2419cc);}};}function respondWithFilteredResult(_0x190d87,_0xf8072b){return function(_0x143e8a){if(_0x143e8a){var _0x16767b=_0x143e8a['count'],_0x2212e0=_0xf8072b[_0x3bf8('0x2c')],_0x1a549d=_0xf8072b[_0x3bf8('0x2c')]+_0xf8072b['limit'],_0x25442d;if(_0x1a549d>=_0x16767b){_0x1a549d=_0x16767b;_0x25442d=0xc8;}else{_0x25442d=0xce;}_0x190d87[_0x3bf8('0x29')](_0x25442d);return _0x190d87[_0x3bf8('0x2d')]('Content-Range',_0x2212e0+'-'+_0x1a549d+'/'+_0x16767b)['json'](_0x143e8a);}return null;};}function patchUpdates(_0x37d6fd){return function(_0x21906f){try{jsonpatch[_0x3bf8('0x2e')](_0x21906f,_0x37d6fd,!![]);}catch(_0x4ae4b7){return BPromise[_0x3bf8('0x2f')](_0x4ae4b7);}return _0x21906f['save']();};}function saveUpdates(_0xc3586,_0x4cbac0){return function(_0x4d4f13){if(_0x4d4f13){return _0x4d4f13['update'](_0xc3586)['then'](function(_0x247489){return _0x247489;});}return null;};}function removeEntity(_0x52fb4e,_0x26ad39){return function(_0x4cf651){if(_0x4cf651){return _0x4cf651['destroy']()[_0x3bf8('0x1c')](function(){_0x52fb4e[_0x3bf8('0x29')](0xcc)[_0x3bf8('0x2a')]();});}};}function handleEntityNotFound(_0x29875b,_0x48d804){return function(_0x1aac86){if(!_0x1aac86){_0x29875b[_0x3bf8('0x28')](0x194);}return _0x1aac86;};}function handleError(_0x17f10f,_0x4f2ad9){_0x4f2ad9=_0x4f2ad9||0x1f4;return function(_0x5e4279){logger['error'](_0x5e4279['stack']);if(_0x5e4279[_0x3bf8('0x30')]){delete _0x5e4279[_0x3bf8('0x30')];}_0x17f10f[_0x3bf8('0x29')](_0x4f2ad9)['send'](_0x5e4279);};}exports[_0x3bf8('0x31')]=function(_0x243f2b,_0x5729bc){var _0x521b07={},_0x42cb0f={},_0x5d9f6c={'count':0x0,'rows':[]};var _0x156dee=_[_0x3bf8('0x32')](db['Setting'][_0x3bf8('0x33')],function(_0x49762a){return{'name':_0x49762a['fieldName'],'type':_0x49762a[_0x3bf8('0x34')][_0x3bf8('0x35')]};});_0x42cb0f[_0x3bf8('0x36')]=_['map'](_0x156dee,_0x3bf8('0x30'));_0x42cb0f[_0x3bf8('0x37')]=_[_0x3bf8('0x38')](_0x243f2b[_0x3bf8('0x37')]);_0x42cb0f[_0x3bf8('0x39')]=_[_0x3bf8('0x3a')](_0x42cb0f[_0x3bf8('0x36')],_0x42cb0f[_0x3bf8('0x37')]);_0x521b07[_0x3bf8('0x3b')]=_[_0x3bf8('0x3a')](_0x42cb0f[_0x3bf8('0x36')],qs['fields'](_0x243f2b['query'][_0x3bf8('0x3c')]));_0x521b07[_0x3bf8('0x3b')]=_0x521b07['attributes']['length']?_0x521b07[_0x3bf8('0x3b')]:_0x42cb0f[_0x3bf8('0x36')];if(!_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x3d')](_0x3bf8('0x3e'))){_0x521b07[_0x3bf8('0x3f')]=qs[_0x3bf8('0x3f')](_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x3f')]);_0x521b07['offset']=qs[_0x3bf8('0x2c')](_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x2c')]);}_0x521b07['order']=qs[_0x3bf8('0x40')](_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x40')]);_0x521b07['where']=qs[_0x3bf8('0x39')](_['pick'](_0x243f2b[_0x3bf8('0x37')],_0x42cb0f['filters']),_0x156dee);if(_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x41')]){_0x521b07[_0x3bf8('0x42')]=_['merge'](_0x521b07[_0x3bf8('0x42')],{'$or':_[_0x3bf8('0x32')](_0x156dee,function(_0x391ee8){if(_0x391ee8[_0x3bf8('0x34')]!==_0x3bf8('0x43')){var _0x1ea17f={};_0x1ea17f[_0x391ee8[_0x3bf8('0x30')]]={'$like':'%'+_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x41')]+'%'};return _0x1ea17f;}})});}_0x521b07=_[_0x3bf8('0x44')]({},_0x521b07,_0x243f2b[_0x3bf8('0x45')]);var _0x5a9d8c={'where':_0x521b07[_0x3bf8('0x42')]};return db[_0x3bf8('0x46')][_0x3bf8('0x47')](_0x5a9d8c)['then'](function(_0x2ee114){_0x5d9f6c[_0x3bf8('0x47')]=_0x2ee114;if(_0x243f2b[_0x3bf8('0x37')][_0x3bf8('0x48')]){_0x521b07['include']=[{'all':!![]}];}return db[_0x3bf8('0x46')][_0x3bf8('0x49')](_0x521b07);})[_0x3bf8('0x1c')](function(_0x1109d9){_0x5d9f6c['rows']=_0x1109d9;return _0x5d9f6c;})['then'](respondWithFilteredResult(_0x5729bc,_0x521b07))[_0x3bf8('0x27')](handleError(_0x5729bc,null));};exports[_0x3bf8('0x4a')]=function(_0x1ff860,_0x2a3b43){var _0x7e1a8d={'raw':![],'where':{'id':_0x1ff860['params']['id']}},_0x318955={};_0x318955[_0x3bf8('0x36')]=_['keys'](db[_0x3bf8('0x46')][_0x3bf8('0x33')]);_0x318955['query']=_[_0x3bf8('0x38')](_0x1ff860[_0x3bf8('0x37')]);_0x318955[_0x3bf8('0x39')]=_[_0x3bf8('0x3a')](_0x318955[_0x3bf8('0x36')],_0x318955['query']);_0x7e1a8d[_0x3bf8('0x3b')]=_[_0x3bf8('0x3a')](_0x318955[_0x3bf8('0x36')],qs[_0x3bf8('0x3c')](_0x1ff860['query']['fields']));_0x7e1a8d[_0x3bf8('0x3b')]=_0x7e1a8d[_0x3bf8('0x3b')][_0x3bf8('0x4b')]?_0x7e1a8d[_0x3bf8('0x3b')]:_0x318955[_0x3bf8('0x36')];if(_0x1ff860[_0x3bf8('0x37')][_0x3bf8('0x48')]){_0x7e1a8d[_0x3bf8('0x4c')]=[{'all':!![]}];}_0x7e1a8d=_[_0x3bf8('0x44')]({},_0x7e1a8d,_0x1ff860[_0x3bf8('0x45')]);return db[_0x3bf8('0x46')][_0x3bf8('0x4d')](_0x7e1a8d)[_0x3bf8('0x1c')](handleEntityNotFound(_0x2a3b43,null))[_0x3bf8('0x1c')](respondWithResult(_0x2a3b43,null))[_0x3bf8('0x27')](handleError(_0x2a3b43,null));};exports[_0x3bf8('0x4e')]=function(_0x5d5821,_0x119161){if(_0x5d5821[_0x3bf8('0x4f')]['id']){delete _0x5d5821['body']['id'];}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x5d5821['params']['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x119161,null))[_0x3bf8('0x1c')](saveUpdates(_0x5d5821[_0x3bf8('0x4f')],null))['then'](respondWithResult(_0x119161,null))['catch'](handleError(_0x119161,null));};exports['addLogo']=function(_0x36db22,_0x3808c2,_0x6f32da){if(_0x36db22['file']&&_0x36db22[_0x3bf8('0x50')][_0x3bf8('0x51')]){_0x36db22['body'][_0x3bf8('0x52')]=_0x36db22[_0x3bf8('0x50')]['filename'];}return db[_0x3bf8('0x46')]['find']({'where':{'id':_0x36db22[_0x3bf8('0x53')]['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x3808c2,null))[_0x3bf8('0x1c')](saveUpdates(_0x36db22[_0x3bf8('0x4f')],null))[_0x3bf8('0x1c')](respondWithResult(_0x3808c2,null))['catch'](handleError(_0x3808c2,null));};exports[_0x3bf8('0x54')]=function(_0x25d81e,_0x15ad4e,_0xa89ddd){if(_0x25d81e[_0x3bf8('0x50')]&&_0x25d81e[_0x3bf8('0x50')][_0x3bf8('0x51')]){_0x25d81e[_0x3bf8('0x4f')][_0x3bf8('0x55')]=_0x25d81e['file'][_0x3bf8('0x51')];}return db['Setting']['find']({'where':{'id':_0x25d81e['params']['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x15ad4e,null))[_0x3bf8('0x1c')](saveUpdates(_0x25d81e[_0x3bf8('0x4f')],null))[_0x3bf8('0x1c')](respondWithResult(_0x15ad4e,null))[_0x3bf8('0x27')](handleError(_0x15ad4e,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x56')]=function(_0x52836f,_0x551568,_0x2c2ad5){var _0x46aa45=_0x3bf8('0x57');var _0x2191e5={'custom':![]};return utilLicense[_0x3bf8('0x58')]()[_0x3bf8('0x1c')](function(_0x5d193d){if(_0x5d193d){_0x2191e5=_0x5d193d;}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x52836f[_0x3bf8('0x53')]['id']},'attributes':['logo','loginLogo',_0x3bf8('0x59'),_0x3bf8('0x5a'),_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d'),_0x3bf8('0x5e')],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0x551568,null))[_0x3bf8('0x1c')](function(_0x506eb5){if(_0x506eb5){var _0x56ec53=_0x506eb5[_0x3bf8('0x52')]&&fs['existsSync'](path['join'](config[_0x3bf8('0x5f')],_0x46aa45,_[_0x3bf8('0x60')](_0x506eb5[_0x3bf8('0x52')])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x46aa45,_['toLower'](_0x506eb5[_0x3bf8('0x52')])):path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x46aa45,_[_0x3bf8('0x60')](_0x3bf8('0x62')));var _0x1ab992=_0x3bf8('0x63')+_[_0x3bf8('0x64')]('logo');if(_0x506eb5[_0x1ab992]||!_0x2191e5['custom']){_0x56ec53=path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x46aa45,_[_0x3bf8('0x60')]('default_logo.svg'));}if(!fs['existsSync'](_0x56ec53)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')](_0x3bf8('0x52'))+_0x3bf8('0x67'));}return _0x551568[_0x3bf8('0x68')](_0x56ec53);}})[_0x3bf8('0x27')](handleError(_0x551568,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x69')]=function(_0x326c4b,_0x50c36a,_0x1dc37b){var _0x2a6f8d='server/files/images/logos';var _0x3bae3c={'custom':![]};return utilLicense[_0x3bf8('0x58')]()['then'](function(_0x3b10d9){if(_0x3b10d9){_0x3bae3c=_0x3b10d9;}return db[_0x3bf8('0x46')]['find']({'where':{'id':_0x326c4b[_0x3bf8('0x53')]['id']},'attributes':[_0x3bf8('0x52'),'loginLogo',_0x3bf8('0x59'),_0x3bf8('0x5a'),_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d'),_0x3bf8('0x5e')],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0x50c36a,null))[_0x3bf8('0x1c')](function(_0x3aef98){if(_0x3aef98){var _0x4a001e=_0x3aef98[_0x3bf8('0x55')]&&fs[_0x3bf8('0x6a')](path['join'](config[_0x3bf8('0x5f')],_0x2a6f8d,_['toLower'](_0x3aef98['loginLogo'])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x2a6f8d,_['toLower'](_0x3aef98['loginLogo'])):path['join'](config[_0x3bf8('0x5f')],_0x2a6f8d,_[_0x3bf8('0x60')]('default_loginLogo.svg'));var _0x3843b9=_0x3bf8('0x63')+_[_0x3bf8('0x64')](_0x3bf8('0x55'));if(_0x3aef98[_0x3843b9]||!_0x3bae3c[_0x3bf8('0x6b')]){_0x4a001e=path['join'](config[_0x3bf8('0x5f')],_0x2a6f8d,_['toLower'](_0x3bf8('0x6c')));}if(!fs[_0x3bf8('0x6a')](_0x4a001e)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')]('loginLogo')+_0x3bf8('0x67'));}return _0x50c36a[_0x3bf8('0x68')](_0x4a001e);}})[_0x3bf8('0x27')](handleError(_0x50c36a,null));};exports['gdpr']=function(_0x2b3c00,_0x35a30b){return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x2b3c00['params']['id']},'attributes':['securePassword']})[_0x3bf8('0x1c')](respondWithResult(_0x35a30b,null))[_0x3bf8('0x27')](handleError(_0x35a30b,null));};exports['addPreferred']=function(_0x203bc4,_0x4fc93e,_0x415e29){if(_0x203bc4['file']&&_0x203bc4[_0x3bf8('0x50')][_0x3bf8('0x51')]){_0x203bc4[_0x3bf8('0x4f')][_0x3bf8('0x59')]=_0x203bc4['file'][_0x3bf8('0x51')];}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x203bc4[_0x3bf8('0x53')]['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x4fc93e,null))['then'](saveUpdates(_0x203bc4[_0x3bf8('0x4f')],null))[_0x3bf8('0x1c')](respondWithResult(_0x4fc93e,null))['catch'](handleError(_0x4fc93e,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x6d')]=function(_0x31e772,_0xa2a7b0,_0x145251){var _0x1a3a5e=_0x3bf8('0x57');var _0x2474c2={'custom':![]};return utilLicense[_0x3bf8('0x58')]()['then'](function(_0x52e0a7){if(_0x52e0a7){_0x2474c2=_0x52e0a7;}return db[_0x3bf8('0x46')]['find']({'where':{'id':_0x31e772[_0x3bf8('0x53')]['id']},'attributes':['logo',_0x3bf8('0x55'),_0x3bf8('0x59'),_0x3bf8('0x5a'),'defaultLogo',_0x3bf8('0x5c'),_0x3bf8('0x5d'),_0x3bf8('0x5e')],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0xa2a7b0,null))[_0x3bf8('0x1c')](function(_0x3846fb){if(_0x3846fb){var _0x41e05b=_0x3846fb[_0x3bf8('0x59')]&&fs[_0x3bf8('0x6a')](path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x1a3a5e,_[_0x3bf8('0x60')](_0x3846fb[_0x3bf8('0x59')])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x1a3a5e,_['toLower'](_0x3846fb['preferred'])):path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x1a3a5e,_[_0x3bf8('0x60')](_0x3bf8('0x6e')));var _0x3208b6='default'+_['upperFirst'](_0x3bf8('0x59'));if(_0x3846fb[_0x3208b6]||!_0x2474c2[_0x3bf8('0x6b')]||!_0x2474c2['preferred']){_0x41e05b=path['join'](config[_0x3bf8('0x5f')],_0x1a3a5e,_['toLower']('default_preferred.png'));}if(!fs[_0x3bf8('0x6a')](_0x41e05b)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')](_0x3bf8('0x59'))+'\x20not\x20found');}return _0xa2a7b0[_0x3bf8('0x68')](_0x41e05b);}})['catch'](handleError(_0xa2a7b0,null));};exports[_0x3bf8('0x6f')]=function(_0x1163bd,_0x64a29d,_0x5c2143){if(_0x1163bd[_0x3bf8('0x50')]&&_0x1163bd['file'][_0x3bf8('0x51')]){_0x1163bd[_0x3bf8('0x4f')]['favicon']=_0x1163bd['file'][_0x3bf8('0x51')];}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x1163bd[_0x3bf8('0x53')]['id']}})[_0x3bf8('0x1c')](handleEntityNotFound(_0x64a29d,null))[_0x3bf8('0x1c')](saveUpdates(_0x1163bd[_0x3bf8('0x4f')],null))['then'](respondWithResult(_0x64a29d,null))[_0x3bf8('0x27')](handleError(_0x64a29d,null));};var utilLicense=require(_0x3bf8('0x16'));exports[_0x3bf8('0x70')]=function(_0x4d9f5f,_0x306803,_0x402057){var _0x45f1b7=_0x3bf8('0x57');var _0x23a792={'custom':![]};return utilLicense[_0x3bf8('0x58')]()[_0x3bf8('0x1c')](function(_0x1b50d4){if(_0x1b50d4){_0x23a792=_0x1b50d4;}return db[_0x3bf8('0x46')][_0x3bf8('0x4d')]({'where':{'id':_0x4d9f5f[_0x3bf8('0x53')]['id']},'attributes':['logo',_0x3bf8('0x55'),_0x3bf8('0x59'),_0x3bf8('0x5a'),_0x3bf8('0x5b'),_0x3bf8('0x5c'),_0x3bf8('0x5d'),'defaultFavicon'],'raw':!![]});})[_0x3bf8('0x1c')](handleEntityNotFound(_0x306803,null))['then'](function(_0x3ebb4a){if(_0x3ebb4a){var _0x1088d0=_0x3ebb4a[_0x3bf8('0x5a')]&&fs[_0x3bf8('0x6a')](path['join'](config[_0x3bf8('0x5f')],_0x45f1b7,_[_0x3bf8('0x60')](_0x3ebb4a[_0x3bf8('0x5a')])))?path[_0x3bf8('0x61')](config[_0x3bf8('0x5f')],_0x45f1b7,_[_0x3bf8('0x60')](_0x3ebb4a['favicon'])):path['join'](config[_0x3bf8('0x5f')],_0x45f1b7,_[_0x3bf8('0x60')](_0x3bf8('0x71')));var _0x5b1ff4='default'+_[_0x3bf8('0x64')]('favicon');if(_0x3ebb4a[_0x5b1ff4]||!_0x23a792[_0x3bf8('0x6b')]){_0x1088d0=path[_0x3bf8('0x61')](config['root'],_0x45f1b7,_[_0x3bf8('0x60')](_0x3bf8('0x71')));}if(!fs[_0x3bf8('0x6a')](_0x1088d0)){throw new db[(_0x3bf8('0x65'))][(_0x3bf8('0x66'))](_[_0x3bf8('0x64')]('favicon')+_0x3bf8('0x67'));}return _0x306803[_0x3bf8('0x68')](_0x1088d0);}})[_0x3bf8('0x27')](handleError(_0x306803,null));};exports['getDate']=function(_0x1b254f,_0x4b0b15){var _0xf3759f={'offset':moment()[_0x3bf8('0x72')]()};_0xf3759f['now']=moment()[_0x3bf8('0x72')](_0xf3759f[_0x3bf8('0x2c')])[_0x3bf8('0x73')](_0x3bf8('0x74'));return _0x4b0b15[_0x3bf8('0x29')](0xc8)[_0x3bf8('0x75')](_0xf3759f);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index d7303d7..44a8da1 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 _0x87cf=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','define','Setting','lodash','util'];(function(_0x55e879,_0x5c8e2c){var _0x24b72b=function(_0x5eb169){while(--_0x5eb169){_0x55e879['push'](_0x55e879['shift']());}};_0x24b72b(++_0x5c8e2c);}(_0x87cf,0x112));var _0xf87c=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x87cf[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xf87c('0x0'));var util=require(_0xf87c('0x1'));var logger=require(_0xf87c('0x2'))(_0xf87c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf87c('0x4'));var fs=require('fs');var path=require(_0xf87c('0x5'));var rimraf=require(_0xf87c('0x6'));var config=require(_0xf87c('0x7'));var attributes=require(_0xf87c('0x8'));module[_0xf87c('0x9')]=function(_0x4c168b,_0x36ebad){return _0x4c168b[_0xf87c('0xa')](_0xf87c('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc2f=['request-promise','path','rimraf','../../config/environment','exports','settings','lodash','../../config/logger','moment'];(function(_0x2f67c0,_0x235b3b){var _0xaa1b1a=function(_0x2800f9){while(--_0x2800f9){_0x2f67c0['push'](_0x2f67c0['shift']());}};_0xaa1b1a(++_0x235b3b);}(_0xcc2f,0x19b));var _0xfcc2=function(_0x340641,_0x180f27){_0x340641=_0x340641-0x0;var _0x125dad=_0xcc2f[_0x340641];return _0x125dad;};'use strict';var _=require(_0xfcc2('0x0'));var util=require('util');var logger=require(_0xfcc2('0x1'))('api');var moment=require(_0xfcc2('0x2'));var BPromise=require('bluebird');var rp=require(_0xfcc2('0x3'));var fs=require('fs');var path=require(_0xfcc2('0x4'));var rimraf=require(_0xfcc2('0x5'));var config=require(_0xfcc2('0x6'));var attributes=require('./setting.attributes');module[_0xfcc2('0x7')]=function(_0x2baaab,_0x2b8f88){return _0x2baaab['define']('Setting',attributes,{'tableName':_0xfcc2('0x8'),'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 0e16cfc..1c91101 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 _0x69fb=['error','code','message','result','catch','ShowSetting','Setting','options','raw','where','attributes','map','model','include','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x69fb,0x14a));var _0xb69f=function(_0x2459b4,_0x56b89a){_0x2459b4=_0x2459b4-0x0;var _0xf1caab=_0x69fb[_0x2459b4];return _0xf1caab;};'use strict';var _=require(_0xb69f('0x0'));var util=require(_0xb69f('0x1'));var moment=require(_0xb69f('0x2'));var BPromise=require(_0xb69f('0x3'));var rs=require(_0xb69f('0x4'));var fs=require('fs');var Redis=require(_0xb69f('0x5'));var db=require(_0xb69f('0x6'))['db'];var utils=require(_0xb69f('0x7'));var logger=require(_0xb69f('0x8'))(_0xb69f('0x9'));var config=require(_0xb69f('0xa'));var jayson=require(_0xb69f('0xb'));var client=jayson[_0xb69f('0xc')][_0xb69f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4824f4,_0x16d9ea,_0x1ffa38){return new BPromise(function(_0x59425b,_0x52ff34){return client[_0xb69f('0xe')](_0x4824f4,_0x1ffa38)[_0xb69f('0xf')](function(_0x33f57b){logger[_0xb69f('0x10')](_0xb69f('0x11'),_0x16d9ea,_0xb69f('0x12'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x16d9ea,_0xb69f('0x12'),JSON[_0xb69f('0x13')](_0x33f57b));if(_0x33f57b['error']){if(_0x33f57b[_0xb69f('0x14')][_0xb69f('0x15')]===0x1f4){logger[_0xb69f('0x14')]('Setting,\x20%s,\x20%s',_0x16d9ea,_0x33f57b[_0xb69f('0x14')][_0xb69f('0x16')]);return _0x52ff34(_0x33f57b[_0xb69f('0x14')]['message']);}logger[_0xb69f('0x14')](_0xb69f('0x11'),_0x16d9ea,_0x33f57b['error'][_0xb69f('0x16')]);return _0x59425b(_0x33f57b[_0xb69f('0x14')][_0xb69f('0x16')]);}else{logger['info'](_0xb69f('0x11'),_0x16d9ea,'request\x20sent');_0x59425b(_0x33f57b[_0xb69f('0x17')][_0xb69f('0x16')]);}})[_0xb69f('0x18')](function(_0x55fd20){logger[_0xb69f('0x14')](_0xb69f('0x11'),_0x16d9ea,_0x55fd20);_0x52ff34(_0x55fd20);});});}exports[_0xb69f('0x19')]=function(_0x1055ff){var _0x3db65c=this;return new Promise(function(_0x9aa92c,_0x55d024){return db[_0xb69f('0x1a')]['find']({'raw':_0x1055ff[_0xb69f('0x1b')]?_0x1055ff[_0xb69f('0x1b')][_0xb69f('0x1c')]===undefined?!![]:![]:!![],'where':_0x1055ff[_0xb69f('0x1b')]?_0x1055ff[_0xb69f('0x1b')][_0xb69f('0x1d')]||null:null,'attributes':_0x1055ff[_0xb69f('0x1b')]?_0x1055ff[_0xb69f('0x1b')][_0xb69f('0x1e')]||null:null,'include':_0x1055ff[_0xb69f('0x1b')]?_0x1055ff['options']['include']?_[_0xb69f('0x1f')](_0x1055ff[_0xb69f('0x1b')]['include'],function(_0x5c7733){return{'model':db[_0x5c7733[_0xb69f('0x20')]],'as':_0x5c7733['as'],'attributes':_0x5c7733[_0xb69f('0x1e')],'include':_0x5c7733['include']?_[_0xb69f('0x1f')](_0x5c7733[_0xb69f('0x21')],function(_0x27bae9){return{'model':db[_0x27bae9[_0xb69f('0x20')]],'as':_0x27bae9['as'],'attributes':_0x27bae9[_0xb69f('0x1e')],'include':_0x27bae9[_0xb69f('0x21')]?_['map'](_0x27bae9[_0xb69f('0x21')],function(_0x5d692d){return{'model':db[_0x5d692d[_0xb69f('0x20')]],'as':_0x5d692d['as'],'attributes':_0x5d692d[_0xb69f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e9384){logger[_0xb69f('0x10')](_0xb69f('0x19'),_0x1055ff);logger[_0xb69f('0x22')](_0xb69f('0x19'),_0x1055ff,JSON['stringify'](_0x2e9384));_0x9aa92c(_0x2e9384);})['catch'](function(_0x5efa35){logger[_0xb69f('0x14')]('ShowSetting',_0x5efa35[_0xb69f('0x16')],_0x1055ff);_0x55d024(_0x3db65c[_0xb69f('0x14')](0x1f4,_0x5efa35['message']));});});}; \ No newline at end of file +var _0xe913=['error','code','Setting,\x20%s,\x20%s','message','request\x20sent','result','catch','ShowSetting','find','options','raw','attributes','include','map','model','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x39ecbe,_0x5cb689){var _0x53cb1f=function(_0x5447b3){while(--_0x5447b3){_0x39ecbe['push'](_0x39ecbe['shift']());}};_0x53cb1f(++_0x5cb689);}(_0xe913,0x10f));var _0x3e91=function(_0x5f239c,_0x3df65d){_0x5f239c=_0x5f239c-0x0;var _0x34ed33=_0xe913[_0x5f239c];return _0x34ed33;};'use strict';var _=require(_0x3e91('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3e91('0x1'));var rs=require(_0x3e91('0x2'));var fs=require('fs');var Redis=require(_0x3e91('0x3'));var db=require(_0x3e91('0x4'))['db'];var utils=require(_0x3e91('0x5'));var logger=require(_0x3e91('0x6'))(_0x3e91('0x7'));var config=require(_0x3e91('0x8'));var jayson=require(_0x3e91('0x9'));var client=jayson[_0x3e91('0xa')][_0x3e91('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f408a,_0x4ac861,_0x2109b6){return new BPromise(function(_0x492521,_0x181c0c){return client['request'](_0x1f408a,_0x2109b6)[_0x3e91('0xc')](function(_0x476332){logger[_0x3e91('0xd')]('Setting,\x20%s,\x20%s',_0x4ac861,'request\x20sent');logger[_0x3e91('0xe')](_0x3e91('0xf'),_0x4ac861,'request\x20sent',JSON[_0x3e91('0x10')](_0x476332));if(_0x476332['error']){if(_0x476332[_0x3e91('0x11')][_0x3e91('0x12')]===0x1f4){logger[_0x3e91('0x11')](_0x3e91('0x13'),_0x4ac861,_0x476332[_0x3e91('0x11')][_0x3e91('0x14')]);return _0x181c0c(_0x476332[_0x3e91('0x11')][_0x3e91('0x14')]);}logger[_0x3e91('0x11')]('Setting,\x20%s,\x20%s',_0x4ac861,_0x476332['error'][_0x3e91('0x14')]);return _0x492521(_0x476332['error']['message']);}else{logger['info'](_0x3e91('0x13'),_0x4ac861,_0x3e91('0x15'));_0x492521(_0x476332[_0x3e91('0x16')][_0x3e91('0x14')]);}})[_0x3e91('0x17')](function(_0x4f2d9b){logger[_0x3e91('0x11')]('Setting,\x20%s,\x20%s',_0x4ac861,_0x4f2d9b);_0x181c0c(_0x4f2d9b);});});}exports[_0x3e91('0x18')]=function(_0x32e6d1){var _0x5716a7=this;return new Promise(function(_0x43b538,_0x25a0ed){return db['Setting'][_0x3e91('0x19')]({'raw':_0x32e6d1[_0x3e91('0x1a')]?_0x32e6d1[_0x3e91('0x1a')][_0x3e91('0x1b')]===undefined?!![]:![]:!![],'where':_0x32e6d1[_0x3e91('0x1a')]?_0x32e6d1[_0x3e91('0x1a')]['where']||null:null,'attributes':_0x32e6d1[_0x3e91('0x1a')]?_0x32e6d1[_0x3e91('0x1a')][_0x3e91('0x1c')]||null:null,'include':_0x32e6d1[_0x3e91('0x1a')]?_0x32e6d1[_0x3e91('0x1a')][_0x3e91('0x1d')]?_[_0x3e91('0x1e')](_0x32e6d1[_0x3e91('0x1a')][_0x3e91('0x1d')],function(_0x3261fd){return{'model':db[_0x3261fd['model']],'as':_0x3261fd['as'],'attributes':_0x3261fd[_0x3e91('0x1c')],'include':_0x3261fd['include']?_['map'](_0x3261fd[_0x3e91('0x1d')],function(_0x5ba40b){return{'model':db[_0x5ba40b[_0x3e91('0x1f')]],'as':_0x5ba40b['as'],'attributes':_0x5ba40b[_0x3e91('0x1c')],'include':_0x5ba40b[_0x3e91('0x1d')]?_[_0x3e91('0x1e')](_0x5ba40b[_0x3e91('0x1d')],function(_0x3c6443){return{'model':db[_0x3c6443[_0x3e91('0x1f')]],'as':_0x3c6443['as'],'attributes':_0x3c6443['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e91('0xc')](function(_0x12b626){logger[_0x3e91('0xd')](_0x3e91('0x18'),_0x32e6d1);logger['debug']('ShowSetting',_0x32e6d1,JSON[_0x3e91('0x10')](_0x12b626));_0x43b538(_0x12b626);})[_0x3e91('0x17')](function(_0xb6be8c){logger[_0x3e91('0x11')](_0x3e91('0x18'),_0xb6be8c[_0x3e91('0x14')],_0x32e6d1);_0x25a0ed(_0x5716a7[_0x3e91('0x11')](0x1f4,_0xb6be8c[_0x3e91('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index b262d96..1d4bd47 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 _0xc156=['isAuthenticated','get','show','getDispositions','getAnswers','/:id/applications','/:id/status','getAgents','post','create','/:id/dispositions','/:id/canned_answers','/:id/notify','notify','addApplications','/:id/send','send','status','/:id/users','addAgents','put','/:id','update','delete','destroy','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller'];(function(_0x5c7a5b,_0x26b030){var _0x51d365=function(_0x11ef8a){while(--_0x11ef8a){_0x5c7a5b['push'](_0x5c7a5b['shift']());}};_0x51d365(++_0x26b030);}(_0xc156,0xf3));var _0x6c15=function(_0x3d90e3,_0x1ccad2){_0x3d90e3=_0x3d90e3-0x0;var _0x217b11=_0xc156[_0x3d90e3];return _0x217b11;};'use strict';var multer=require(_0x6c15('0x0'));var util=require('util');var path=require(_0x6c15('0x1'));var timeout=require('connect-timeout');var express=require(_0x6c15('0x2'));var router=express[_0x6c15('0x3')]();var fs_extra=require(_0x6c15('0x4'));var auth=require(_0x6c15('0x5'));var interaction=require(_0x6c15('0x6'));var config=require(_0x6c15('0x7'));var controller=require(_0x6c15('0x8'));router['get']('/',auth[_0x6c15('0x9')](),controller['index']);router[_0x6c15('0xa')]('/describe',auth[_0x6c15('0x9')](),controller['describe']);router['get']('/:id',auth[_0x6c15('0x9')](),controller[_0x6c15('0xb')]);router[_0x6c15('0xa')]('/:id/dispositions',auth[_0x6c15('0x9')](),controller[_0x6c15('0xc')]);router[_0x6c15('0xa')]('/:id/canned_answers',auth[_0x6c15('0x9')](),controller[_0x6c15('0xd')]);router[_0x6c15('0xa')](_0x6c15('0xe'),auth[_0x6c15('0x9')](),controller['getApplications']);router[_0x6c15('0xa')]('/:id/interactions',auth[_0x6c15('0x9')](),controller['getInteractions']);router[_0x6c15('0xa')](_0x6c15('0xf'),controller['statusGet']);router[_0x6c15('0xa')]('/:id/users',auth[_0x6c15('0x9')](),controller[_0x6c15('0x10')]);router[_0x6c15('0x11')]('/',auth[_0x6c15('0x9')](),controller[_0x6c15('0x12')]);router[_0x6c15('0x11')](_0x6c15('0x13'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x6c15('0x14'),auth[_0x6c15('0x9')](),controller['addAnswer']);router['post'](_0x6c15('0x15'),controller[_0x6c15('0x16')]);router['post'](_0x6c15('0xe'),auth['isAuthenticated'](),controller[_0x6c15('0x17')]);router[_0x6c15('0x11')](_0x6c15('0x18'),auth['isAuthenticated'](),controller[_0x6c15('0x19')]);router[_0x6c15('0x11')](_0x6c15('0xf'),controller[_0x6c15('0x1a')]);router[_0x6c15('0x11')](_0x6c15('0x1b'),auth[_0x6c15('0x9')](),controller[_0x6c15('0x1c')]);router[_0x6c15('0x1d')](_0x6c15('0x1e'),auth['isAuthenticated'](),controller[_0x6c15('0x1f')]);router[_0x6c15('0x20')](_0x6c15('0x1e'),auth[_0x6c15('0x9')](),controller[_0x6c15('0x21')]);router[_0x6c15('0x20')]('/:id/dispositions',auth[_0x6c15('0x9')](),controller['removeDispositions']);router['delete'](_0x6c15('0x14'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x6c15('0x20')](_0x6c15('0x1b'),auth['isAuthenticated'](),controller[_0x6c15('0x22')]);module[_0x6c15('0x23')]=router; \ No newline at end of file +var _0xae09=['../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','statusGet','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','/:id/applications','addApplications','/:id/send','/:id/status','status','addAgents','put','update','delete','removeDispositions','removeAgents','multer','connect-timeout','express'];(function(_0x158a58,_0x28e8e7){var _0x4935d9=function(_0x1e698c){while(--_0x1e698c){_0x158a58['push'](_0x158a58['shift']());}};_0x4935d9(++_0x28e8e7);}(_0xae09,0x1a1));var _0x9ae0=function(_0x38d6ff,_0x456b39){_0x38d6ff=_0x38d6ff-0x0;var _0x2729db=_0xae09[_0x38d6ff];return _0x2729db;};'use strict';var multer=require(_0x9ae0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9ae0('0x1'));var express=require(_0x9ae0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9ae0('0x3'));var config=require('../../config/environment');var controller=require(_0x9ae0('0x4'));router[_0x9ae0('0x5')]('/',auth[_0x9ae0('0x6')](),controller[_0x9ae0('0x7')]);router[_0x9ae0('0x5')]('/describe',auth[_0x9ae0('0x6')](),controller['describe']);router['get'](_0x9ae0('0x8'),auth[_0x9ae0('0x6')](),controller[_0x9ae0('0x9')]);router[_0x9ae0('0x5')](_0x9ae0('0xa'),auth[_0x9ae0('0x6')](),controller[_0x9ae0('0xb')]);router[_0x9ae0('0x5')](_0x9ae0('0xc'),auth[_0x9ae0('0x6')](),controller[_0x9ae0('0xd')]);router[_0x9ae0('0x5')]('/:id/applications',auth[_0x9ae0('0x6')](),controller[_0x9ae0('0xe')]);router[_0x9ae0('0x5')](_0x9ae0('0xf'),auth['isAuthenticated'](),controller[_0x9ae0('0x10')]);router[_0x9ae0('0x5')]('/:id/status',controller[_0x9ae0('0x11')]);router[_0x9ae0('0x5')](_0x9ae0('0x12'),auth[_0x9ae0('0x6')](),controller['getAgents']);router[_0x9ae0('0x13')]('/',auth[_0x9ae0('0x6')](),controller[_0x9ae0('0x14')]);router[_0x9ae0('0x13')](_0x9ae0('0xa'),auth[_0x9ae0('0x6')](),controller[_0x9ae0('0x15')]);router[_0x9ae0('0x13')]('/:id/canned_answers',auth[_0x9ae0('0x6')](),controller[_0x9ae0('0x16')]);router[_0x9ae0('0x13')](_0x9ae0('0x17'),controller['notify']);router['post'](_0x9ae0('0x18'),auth[_0x9ae0('0x6')](),controller[_0x9ae0('0x19')]);router['post'](_0x9ae0('0x1a'),auth[_0x9ae0('0x6')](),controller['send']);router[_0x9ae0('0x13')](_0x9ae0('0x1b'),controller[_0x9ae0('0x1c')]);router['post']('/:id/users',auth[_0x9ae0('0x6')](),controller[_0x9ae0('0x1d')]);router[_0x9ae0('0x1e')](_0x9ae0('0x8'),auth[_0x9ae0('0x6')](),controller[_0x9ae0('0x1f')]);router['delete']('/:id',auth[_0x9ae0('0x6')](),controller['destroy']);router[_0x9ae0('0x20')]('/:id/dispositions',auth[_0x9ae0('0x6')](),controller[_0x9ae0('0x21')]);router['delete'](_0x9ae0('0xc'),auth[_0x9ae0('0x6')](),controller['removeAnswers']);router['delete'](_0x9ae0('0x12'),auth[_0x9ae0('0x6')](),controller[_0x9ae0('0x22')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 7f50d05..f6010c8 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 _0xf69c=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','ENUM','twilio','skebby','connectel','clicksend','plivo','bandwidth','csc','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x20373e,_0x420d20){var _0x1e40db=function(_0xfea760){while(--_0xfea760){_0x20373e['push'](_0x20373e['shift']());}};_0x1e40db(++_0x420d20);}(_0xf69c,0x1e2));var _0xcf69=function(_0x9b6188,_0x28cb0b){_0x9b6188=_0x9b6188-0x0;var _0x37d16d=_0xf69c[_0x9b6188];return _0x37d16d;};'use strict';var Sequelize=require(_0xcf69('0x0'));var rs=require(_0xcf69('0x1'));module[_0xcf69('0x2')]={'name':{'type':Sequelize[_0xcf69('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xcf69('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xcf69('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xcf69('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xcf69('0x3')]},'type':{'type':Sequelize[_0xcf69('0x4')](_0xcf69('0x5'),_0xcf69('0x6'),_0xcf69('0x7'),_0xcf69('0x8'),_0xcf69('0x9'),'clickatell',_0xcf69('0xa'),_0xcf69('0xb'),'infobip',_0xcf69('0xc'))},'accountSid':{'type':Sequelize[_0xcf69('0x3')]},'authId':{'type':Sequelize[_0xcf69('0x3')]},'authToken':{'type':Sequelize[_0xcf69('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xcf69('0x3')]},'password':{'type':Sequelize[_0xcf69('0x3')]},'apiKey':{'type':Sequelize[_0xcf69('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xcf69('0x3')]},'senderString':{'type':Sequelize[_0xcf69('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xcf69('0x3')]},'notificationTemplate':{'type':Sequelize[_0xcf69('0xd')],'defaultValue':function(){return _0xcf69('0xe');}},'notificationSound':{'type':Sequelize[_0xcf69('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcf69('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcf69('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcf69('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcf69('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcf69('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcf69('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xcf69('0xf')],'defaultValue':![],'comment':_0xcf69('0x11'),'set':function(_0x5e01be){if(!_0x5e01be)this['setDataValue'](_0xcf69('0x12'),null);this['setDataValue'](_0xcf69('0x13'),_0x5e01be);}}}; \ No newline at end of file +var _0x0e3b=['skebby','connectel','clicksend','clickatell','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','mandatoryDispositionPauseId','sequelize','randomstring','exports','name','STRING','generate','twilio'];(function(_0x214a3c,_0x48bd33){var _0x3743dc=function(_0x559994){while(--_0x559994){_0x214a3c['push'](_0x214a3c['shift']());}};_0x3743dc(++_0x48bd33);}(_0x0e3b,0x125));var _0xb0e3=function(_0x37b943,_0x609d18){_0x37b943=_0x37b943-0x0;var _0x54e67a=_0x0e3b[_0x37b943];return _0x54e67a;};'use strict';var Sequelize=require(_0xb0e3('0x0'));var rs=require(_0xb0e3('0x1'));module[_0xb0e3('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xb0e3('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xb0e3('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xb0e3('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb0e3('0x5')]();}},'phone':{'type':Sequelize[_0xb0e3('0x4')]},'type':{'type':Sequelize['ENUM'](_0xb0e3('0x6'),_0xb0e3('0x7'),_0xb0e3('0x8'),_0xb0e3('0x9'),'plivo',_0xb0e3('0xa'),'bandwidth',_0xb0e3('0xb'),_0xb0e3('0xc'),_0xb0e3('0xd'))},'accountSid':{'type':Sequelize[_0xb0e3('0x4')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xb0e3('0xe')]('SI','TI','GP')},'username':{'type':Sequelize[_0xb0e3('0x4')]},'password':{'type':Sequelize[_0xb0e3('0x4')]},'apiKey':{'type':Sequelize[_0xb0e3('0x4')]},'applicationId':{'type':Sequelize[_0xb0e3('0x4')]},'accountId':{'type':Sequelize[_0xb0e3('0x4')]},'senderString':{'type':Sequelize[_0xb0e3('0x4')]},'deliveryReport':{'type':Sequelize[_0xb0e3('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xb0e3('0x4')]},'notificationTemplate':{'type':Sequelize[_0xb0e3('0x10')],'defaultValue':function(){return _0xb0e3('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb0e3('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb0e3('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb0e3('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb0e3('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb0e3('0x12')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb0e3('0xf')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3d20bb){if(!_0x3d20bb)this['setDataValue'](_0xb0e3('0x13'),null);this['setDataValue']('mandatoryDisposition',_0x3d20bb);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 59713a0..542cd07 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 _0xa9e0=['omit','SmsInteraction','spread','interaction','autoclose','close','*,*,*,*','created','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','receiveMessage','entity\x20found','twilio','text/xml','\x0a','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','internal','Tag','tag','findAll','to\x20is\x20mandatory','List','user','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','intelepeer','redif','error_code','results','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','VIRTUAL','merge','includeAll','include','rows','show','params','options','create','role','UserProfileSection','find','userProfileId','autoAssociation','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','sms','SmsApplication','account','applications','orderBy','Applications','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','Text','infobip','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC'];(function(_0x5917b4,_0x2b53ab){var _0x5f50b9=function(_0x47166f){while(--_0x47166f){_0x5917b4['push'](_0x5917b4['shift']());}};_0x5f50b9(++_0x2b53ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return new BPromise(function(_0x519dfd,_0x16033c){var _0x12066b=_0x1985b6||client;return _0x12066b['request'](_0x52a03d,_0x5d0880)[_0x0a9e('0x1d')](function(_0x5a0a06){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x22dccb,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x22dccb,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x5a0a06));if(_0x5a0a06[_0x0a9e('0x24')]){if(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x16033c(_0x5a0a06[_0x0a9e('0x24')]['message']);}logger[_0x0a9e('0x24')]('SmsAccount,\x20%s,\x20%s',_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x519dfd(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x26')]);}else{logger[_0x0a9e('0x1e')]('SmsAccount,\x20%s,\x20%s',_0x22dccb,_0x0a9e('0x20'));_0x519dfd(_0x5a0a06[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x370d86){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x370d86);_0x16033c(_0x370d86);});});}function respondWithStatusCode(_0x5ea472,_0x59181e){_0x59181e=_0x59181e||0xcc;return function(_0x197ec0){if(_0x197ec0){return _0x5ea472[_0x0a9e('0x29')](_0x59181e);}return _0x5ea472[_0x0a9e('0x2a')](_0x59181e)[_0x0a9e('0x2b')]();};}function respondWithResult(_0x526cf3,_0x384319){_0x384319=_0x384319||0xc8;return function(_0x479bc4){if(_0x479bc4){return _0x526cf3[_0x0a9e('0x2a')](_0x384319)['json'](_0x479bc4);}};}function respondWithFilteredResult(_0x1dc186,_0x34dc65){return function(_0x25fba9){if(_0x25fba9){var _0x14433c=_0x25fba9[_0x0a9e('0x2c')],_0x140511=_0x34dc65['offset'],_0x1538a4=_0x34dc65[_0x0a9e('0x2d')]+_0x34dc65[_0x0a9e('0x2e')],_0x11c3b6;if(_0x1538a4>=_0x14433c){_0x1538a4=_0x14433c;_0x11c3b6=0xc8;}else{_0x11c3b6=0xce;}_0x1dc186[_0x0a9e('0x2a')](_0x11c3b6);return _0x1dc186[_0x0a9e('0x2f')]('Content-Range',_0x140511+'-'+_0x1538a4+'/'+_0x14433c)[_0x0a9e('0x30')](_0x25fba9);}return null;};}function patchUpdates(_0x40e7a3){return function(_0x1843b2){try{jsonpatch[_0x0a9e('0x31')](_0x1843b2,_0x40e7a3,!![]);}catch(_0x58b06f){return BPromise[_0x0a9e('0x32')](_0x58b06f);}return _0x1843b2[_0x0a9e('0x33')]();};}function saveUpdates(_0x2e8759,_0x1dbde2){return function(_0x540530){if(_0x540530){return _0x540530[_0x0a9e('0x34')](_0x2e8759)['then'](function(_0x2407f9){return _0x2407f9;});}return null;};}function removeEntity(_0x3ae878,_0x1122db){return function(_0x33bdb7){if(_0x33bdb7){return _0x33bdb7[_0x0a9e('0x35')]()['then'](function(){var _0x66c1d2=_0x33bdb7[_0x0a9e('0x36')]({'plain':!![]});var _0x40cb85=_0x0a9e('0x37');return db[_0x0a9e('0x38')][_0x0a9e('0x35')]({'where':{'type':_0x40cb85,'resourceId':_0x66c1d2['id']}})[_0x0a9e('0x1d')](function(){return _0x33bdb7;});})[_0x0a9e('0x1d')](function(){_0x3ae878['status'](0xcc)[_0x0a9e('0x2b')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x39')]);if(_0x191e91[_0x0a9e('0x3a')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x3b')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={'include':[{'model':db[_0x0a9e('0x3c')],'as':_0x0a9e('0x3d')}]},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x3cae=_['map'](db[_0x0a9e('0x3e')][_0x0a9e('0x3f')],function(_0x289467){return{'name':_0x289467['fieldName'],'type':_0x289467['type'][_0x0a9e('0x40')]};});_0x1ef87a[_0x0a9e('0x41')]=_['map'](_0x3cae,_0x0a9e('0x3a'));_0x1ef87a[_0x0a9e('0x42')]=_[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x42')]);_0x1ef87a['filters']=_['intersection'](_0x1ef87a[_0x0a9e('0x41')],_0x1ef87a[_0x0a9e('0x42')]);_0x381c37['attributes']=_[_0x0a9e('0x44')](_0x1ef87a[_0x0a9e('0x41')],qs[_0x0a9e('0x45')](_0x24936a['query'][_0x0a9e('0x45')]));_0x381c37[_0x0a9e('0x46')]=_0x381c37[_0x0a9e('0x46')][_0x0a9e('0x47')]?_0x381c37[_0x0a9e('0x46')]:_0x1ef87a[_0x0a9e('0x41')];if(!_0x24936a[_0x0a9e('0x42')][_0x0a9e('0x48')](_0x0a9e('0x49'))){_0x381c37[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x24936a[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a['query']['offset']);}_0x381c37[_0x0a9e('0x4a')]=qs[_0x0a9e('0x4b')](_0x24936a[_0x0a9e('0x42')][_0x0a9e('0x4b')]);_0x381c37[_0x0a9e('0x4c')]=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x4e')](_0x24936a[_0x0a9e('0x42')],_0x1ef87a[_0x0a9e('0x4d')]),_0x3cae);if(_0x24936a[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x381c37[_0x0a9e('0x4c')]=_['merge'](_0x381c37[_0x0a9e('0x4c')],{'$or':_[_0x0a9e('0x50')](_0x3cae,function(_0xdd268f){if(_0xdd268f[_0x0a9e('0x51')]!==_0x0a9e('0x52')){var _0xbe9d19={};_0xbe9d19[_0xdd268f[_0x0a9e('0x3a')]]={'$like':'%'+_0x24936a[_0x0a9e('0x42')]['filter']+'%'};return _0xbe9d19;}})});}_0x381c37=_[_0x0a9e('0x53')]({},_0x381c37,_0x24936a['options']);var _0x473dc8={'where':_0x381c37[_0x0a9e('0x4c')]};return db[_0x0a9e('0x3e')]['count'](_0x473dc8)[_0x0a9e('0x1d')](function(_0x7f6eb1){_0x4f41ae[_0x0a9e('0x2c')]=_0x7f6eb1;if(_0x24936a[_0x0a9e('0x42')][_0x0a9e('0x54')]){_0x381c37[_0x0a9e('0x55')]=[{'all':!![]}];}return db[_0x0a9e('0x3e')]['findAll'](_0x381c37);})[_0x0a9e('0x1d')](function(_0x1bde3c){_0x4f41ae[_0x0a9e('0x56')]=_0x1bde3c;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x57')]=function(_0x6054ee,_0x19383e){var _0x34febd={'raw':![],'where':{'id':_0x6054ee[_0x0a9e('0x58')]['id']},'include':[{'model':db[_0x0a9e('0x3c')],'as':'mandatoryDispositionPause'}]},_0x58a5c2={};_0x58a5c2['model']=_['keys'](db[_0x0a9e('0x3e')][_0x0a9e('0x3f')]);_0x58a5c2[_0x0a9e('0x42')]=_[_0x0a9e('0x43')](_0x6054ee[_0x0a9e('0x42')]);_0x58a5c2[_0x0a9e('0x4d')]=_[_0x0a9e('0x44')](_0x58a5c2[_0x0a9e('0x41')],_0x58a5c2['query']);_0x34febd['attributes']=_['intersection'](_0x58a5c2[_0x0a9e('0x41')],qs[_0x0a9e('0x45')](_0x6054ee[_0x0a9e('0x42')]['fields']));_0x34febd[_0x0a9e('0x46')]=_0x34febd[_0x0a9e('0x46')]['length']?_0x34febd['attributes']:_0x58a5c2[_0x0a9e('0x41')];if(_0x6054ee['query'][_0x0a9e('0x54')]){_0x34febd['include']=[{'all':!![]}];}_0x34febd=_[_0x0a9e('0x53')]({},_0x34febd,_0x6054ee[_0x0a9e('0x59')]);return db[_0x0a9e('0x3e')]['find'](_0x34febd)[_0x0a9e('0x1d')](handleEntityNotFound(_0x19383e,null))[_0x0a9e('0x1d')](respondWithResult(_0x19383e,null))['catch'](handleError(_0x19383e,null));};exports['create']=function(_0x128aa6,_0x3aedd0){return db['SmsAccount'][_0x0a9e('0x5a')](_0x128aa6['body'],{})[_0x0a9e('0x1d')](function(_0x523cd2){var _0xe22ccc=_0x128aa6['user']['get']({'plain':!![]});if(!_0xe22ccc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe22ccc[_0x0a9e('0x5b')]==='user'){var _0x2f7092=_0x523cd2[_0x0a9e('0x36')]({'plain':!![]});var _0x3cfd00=_0x0a9e('0x37');return db[_0x0a9e('0x5c')][_0x0a9e('0x5d')]({'where':{'name':_0x3cfd00,'userProfileId':_0xe22ccc[_0x0a9e('0x5e')]},'raw':!![]})[_0x0a9e('0x1d')](function(_0x4e67ab){if(_0x4e67ab&&_0x4e67ab[_0x0a9e('0x5f')]===0x0){return db[_0x0a9e('0x38')][_0x0a9e('0x5a')]({'name':_0x2f7092[_0x0a9e('0x3a')],'resourceId':_0x2f7092['id'],'type':_0x4e67ab[_0x0a9e('0x3a')],'sectionId':_0x4e67ab['id']},{})[_0x0a9e('0x1d')](function(){return _0x523cd2;});}else{return _0x523cd2;}})['catch'](function(_0x956fbe){logger[_0x0a9e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x956fbe);throw _0x956fbe;});}return _0x523cd2;})[_0x0a9e('0x1d')](respondWithResult(_0x3aedd0,0xc9))['catch'](handleError(_0x3aedd0,null));};exports[_0x0a9e('0x34')]=function(_0x5ba1f9,_0x4b3c1a){if(_0x5ba1f9['body']['id']){delete _0x5ba1f9[_0x0a9e('0x60')]['id'];}return db['SmsAccount'][_0x0a9e('0x5d')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x58')]['id']},'include':[{'model':db[_0x0a9e('0x3c')],'as':_0x0a9e('0x3d')}]})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))[_0x0a9e('0x1d')](saveUpdates(_0x5ba1f9['body'],null))[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};exports[_0x0a9e('0x35')]=function(_0x1f07cb,_0x51aaf7){return db['SmsAccount'][_0x0a9e('0x5d')]({'where':{'id':_0x1f07cb[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x51aaf7,null))[_0x0a9e('0x1d')](removeEntity(_0x51aaf7,null))['catch'](handleError(_0x51aaf7,null));};exports[_0x0a9e('0x61')]=function(_0xe05a5a,_0x54327c){return db[_0x0a9e('0x3e')][_0x0a9e('0x61')]()[_0x0a9e('0x1d')](respondWithResult(_0x54327c,null))[_0x0a9e('0x28')](handleError(_0x54327c,null));};exports[_0x0a9e('0x62')]=function(_0x4d4a35,_0x176840,_0x2937e0){if(_0x4d4a35[_0x0a9e('0x60')]['id']){delete _0x4d4a35['body']['id'];}return db[_0x0a9e('0x3e')]['find']({'where':{'id':_0x4d4a35['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x176840,null))[_0x0a9e('0x1d')](function(_0x9375fb){if(_0x9375fb){_0x4d4a35[_0x0a9e('0x60')][_0x0a9e('0x63')]=_0x9375fb['id'];return db[_0x0a9e('0x64')][_0x0a9e('0x5a')](_0x4d4a35[_0x0a9e('0x60')]);}})[_0x0a9e('0x1d')](respondWithResult(_0x176840,null))[_0x0a9e('0x28')](handleError(_0x176840,null));};exports[_0x0a9e('0x65')]=function(_0x19012b,_0x2bbb86,_0x2b8192){var _0x320898={'raw':![],'where':{}};var _0x412a72={};var _0x2a28c0={'count':0x0,'rows':[]};return db[_0x0a9e('0x3e')]['findOne']({'where':{'id':_0x19012b[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x2bbb86,null))[_0x0a9e('0x1d')](function(_0x4edbb0){if(_0x4edbb0){_0x412a72[_0x0a9e('0x41')]=_[_0x0a9e('0x43')](db['Disposition'][_0x0a9e('0x3f')]);_0x412a72[_0x0a9e('0x42')]=_[_0x0a9e('0x43')](_0x19012b[_0x0a9e('0x42')]);_0x412a72[_0x0a9e('0x4d')]=_['intersection'](_0x412a72['model'],_0x412a72['query']);_0x320898[_0x0a9e('0x46')]=_[_0x0a9e('0x44')](_0x412a72[_0x0a9e('0x41')],qs[_0x0a9e('0x45')](_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x45')]));_0x320898[_0x0a9e('0x46')]=_0x320898[_0x0a9e('0x46')]['length']?_0x320898[_0x0a9e('0x46')]:_0x412a72[_0x0a9e('0x41')];if(!_0x19012b[_0x0a9e('0x42')]['hasOwnProperty'](_0x0a9e('0x49'))){_0x320898['limit']=qs[_0x0a9e('0x2e')](_0x19012b[_0x0a9e('0x42')]['limit']);_0x320898[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x2d')]);}_0x320898['order']=qs[_0x0a9e('0x4b')](_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x4b')]);_0x320898[_0x0a9e('0x4c')]=qs['filters'](_[_0x0a9e('0x4e')](_0x19012b[_0x0a9e('0x42')],_0x412a72[_0x0a9e('0x4d')]));_0x320898[_0x0a9e('0x4c')]['SmsAccountId']=_0x4edbb0['id'];if(_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x320898[_0x0a9e('0x4c')]=_[_0x0a9e('0x53')](_0x320898[_0x0a9e('0x4c')],{'$or':_[_0x0a9e('0x50')](_0x320898[_0x0a9e('0x46')],function(_0x3df0e3){var _0x1a7b03={};_0x1a7b03[_0x3df0e3]={'$like':'%'+_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x4f')]+'%'};return _0x1a7b03;})});}_0x320898=_[_0x0a9e('0x53')]({},_0x320898,_0x19012b[_0x0a9e('0x59')]);return db[_0x0a9e('0x64')]['count']({'where':_0x320898[_0x0a9e('0x4c')]})[_0x0a9e('0x1d')](function(_0xc599b3){_0x2a28c0['count']=_0xc599b3;if(_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x54')]){_0x320898[_0x0a9e('0x55')]=[{'all':!![]}];}return db[_0x0a9e('0x64')]['findAll'](_0x320898);})['then'](function(_0x7ebea8){_0x2a28c0[_0x0a9e('0x56')]=_0x7ebea8;return _0x2a28c0;});}})['then'](respondWithFilteredResult(_0x2bbb86,_0x320898))[_0x0a9e('0x28')](handleError(_0x2bbb86,null));};exports['removeDispositions']=function(_0x260f4b,_0x8ebf02,_0x5637a1){return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x260f4b[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x8ebf02,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){return _0x1f42a0[_0x0a9e('0x66')](_0x260f4b['query'][_0x0a9e('0x67')]);}})[_0x0a9e('0x1d')](respondWithStatusCode(_0x8ebf02,null))[_0x0a9e('0x28')](handleError(_0x8ebf02,null));};exports[_0x0a9e('0x68')]=function(_0x492543,_0xf51744,_0xf0db1){if(_0x492543['body']['id']){delete _0x492543[_0x0a9e('0x60')]['id'];}return db['SmsAccount'][_0x0a9e('0x5d')]({'where':{'id':_0x492543[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0xf51744,null))[_0x0a9e('0x1d')](function(_0x5af453){if(_0x5af453){_0x492543['body'][_0x0a9e('0x63')]=_0x5af453['id'];return db[_0x0a9e('0x69')][_0x0a9e('0x5a')](_0x492543['body']);}})[_0x0a9e('0x1d')](respondWithResult(_0xf51744,null))[_0x0a9e('0x28')](handleError(_0xf51744,null));};exports['getAnswers']=function(_0x4e46b2,_0xf0a802,_0x56acca){var _0x5ea541={'raw':![],'where':{}};var _0x4dc6b3={};var _0x81d748={'count':0x0,'rows':[]};return db[_0x0a9e('0x3e')][_0x0a9e('0x6a')]({'where':{'id':_0x4e46b2[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0xf0a802,null))[_0x0a9e('0x1d')](function(_0x5a8854){if(_0x5a8854){_0x4dc6b3[_0x0a9e('0x41')]=_['keys'](db[_0x0a9e('0x69')][_0x0a9e('0x3f')]);_0x4dc6b3[_0x0a9e('0x42')]=_[_0x0a9e('0x43')](_0x4e46b2['query']);_0x4dc6b3[_0x0a9e('0x4d')]=_[_0x0a9e('0x44')](_0x4dc6b3[_0x0a9e('0x41')],_0x4dc6b3['query']);_0x5ea541[_0x0a9e('0x46')]=_[_0x0a9e('0x44')](_0x4dc6b3[_0x0a9e('0x41')],qs[_0x0a9e('0x45')](_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x45')]));_0x5ea541[_0x0a9e('0x46')]=_0x5ea541[_0x0a9e('0x46')]['length']?_0x5ea541[_0x0a9e('0x46')]:_0x4dc6b3[_0x0a9e('0x41')];if(!_0x4e46b2['query'][_0x0a9e('0x48')](_0x0a9e('0x49'))){_0x5ea541[_0x0a9e('0x2e')]=qs['limit'](_0x4e46b2[_0x0a9e('0x42')]['limit']);_0x5ea541[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x2d')]);}_0x5ea541[_0x0a9e('0x4a')]=qs[_0x0a9e('0x4b')](_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x4b')]);_0x5ea541['where']=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x4e')](_0x4e46b2[_0x0a9e('0x42')],_0x4dc6b3[_0x0a9e('0x4d')]));_0x5ea541[_0x0a9e('0x4c')][_0x0a9e('0x63')]=_0x5a8854['id'];if(_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x5ea541[_0x0a9e('0x4c')]=_[_0x0a9e('0x53')](_0x5ea541[_0x0a9e('0x4c')],{'$or':_[_0x0a9e('0x50')](_0x5ea541[_0x0a9e('0x46')],function(_0x4989f9){var _0xc81b64={};_0xc81b64[_0x4989f9]={'$like':'%'+_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x4f')]+'%'};return _0xc81b64;})});}_0x5ea541=_[_0x0a9e('0x53')]({},_0x5ea541,_0x4e46b2[_0x0a9e('0x59')]);return db['CannedAnswer'][_0x0a9e('0x2c')]({'where':_0x5ea541[_0x0a9e('0x4c')]})['then'](function(_0x23b447){_0x81d748['count']=_0x23b447;if(_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x54')]){_0x5ea541[_0x0a9e('0x55')]=[{'all':!![]}];}return db[_0x0a9e('0x69')]['findAll'](_0x5ea541);})[_0x0a9e('0x1d')](function(_0x4cf72d){_0x81d748[_0x0a9e('0x56')]=_0x4cf72d;return _0x81d748;});}})[_0x0a9e('0x1d')](respondWithFilteredResult(_0xf0a802,_0x5ea541))['catch'](handleError(_0xf0a802,null));};exports[_0x0a9e('0x6b')]=function(_0x63c9f7,_0x1dd541,_0x4ab276){return db['SmsAccount'][_0x0a9e('0x5d')]({'where':{'id':_0x63c9f7[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x1dd541,null))[_0x0a9e('0x1d')](function(_0x3f2f40){if(_0x3f2f40){return _0x3f2f40[_0x0a9e('0x6b')](_0x63c9f7[_0x0a9e('0x42')][_0x0a9e('0x67')]);}})[_0x0a9e('0x1d')](respondWithStatusCode(_0x1dd541,null))['catch'](handleError(_0x1dd541,null));};exports[_0x0a9e('0x6c')]=function(_0x517081,_0x287324,_0x2f7791){var _0x34e745={'channel':_0x0a9e('0x6d')};var _0x1b61d5=[];var _0x4e7273=[];var _0x436313={};return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x517081[_0x0a9e('0x58')]['id']},'include':[{'model':db[_0x0a9e('0x6e')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x287324,null))[_0x0a9e('0x1d')](function(_0x583662){_0x34e745[_0x0a9e('0x6f')]=_0x583662;_0x34e745[_0x0a9e('0x70')]=_[_0x0a9e('0x71')](_0x583662[_0x0a9e('0x72')],[_0x0a9e('0x73')],[_0x0a9e('0x74')]);if(_0x34e745['account']['Applications']){delete _0x34e745[_0x0a9e('0x6f')]['Applications'];}return db[_0x0a9e('0x75')]['describe']();})[_0x0a9e('0x1d')](function(_0x564db2){if(!_0x564db2){throw new db['Sequelize'][(_0x0a9e('0x76'))](_0x0a9e('0x77'));}_0x1b61d5=_['difference'](_[_0x0a9e('0x43')](_0x564db2),[_0x0a9e('0x78'),_0x0a9e('0x79')]);_0x4e7273=_[_0x0a9e('0x7a')](_[_0x0a9e('0x43')](_0x564db2),['createdAt','updatedAt',_0x0a9e('0x7b'),_0x0a9e('0x7c')]);_0x34e745[_0x0a9e('0x60')]={'mapKey':_0x0a9e('0x7d')};if(_0x34e745[_0x0a9e('0x6f')]['type']){switch(_0x34e745[_0x0a9e('0x6f')][_0x0a9e('0x51')]){case'twilio':_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x7f')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x80')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x81')]=_0x517081['body'][_0x0a9e('0x82')];break;case _0x0a9e('0x83'):_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')]='+'+_0x517081[_0x0a9e('0x60')]['sender'];_0x34e745['body'][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x84')];break;case _0x0a9e('0x85'):_0x34e745[_0x0a9e('0x60')]['from']=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x7e')];_0x34e745[_0x0a9e('0x60')]['body']=_0x517081[_0x0a9e('0x60')]['message'];break;case _0x0a9e('0x86'):_0x34e745['body'][_0x0a9e('0x7e')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x7e')];_0x34e745['body'][_0x0a9e('0x60')]=_0x517081['body'][_0x0a9e('0x60')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x81')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x87')];break;case _0x0a9e('0x88'):_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x7f')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x89')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x81')]=_0x517081['body']['MessageUUID'];break;case _0x0a9e('0x8a'):_0x34e745['body'][_0x0a9e('0x7e')]='+'+_0x517081[_0x0a9e('0x60')]['results'][0x0][_0x0a9e('0x7e')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')]['results'][0x0][_0x0a9e('0x84')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x81')]=_0x517081[_0x0a9e('0x60')]['results'][0x0][_0x0a9e('0x81')];break;case _0x0a9e('0x8b'):_0x34e745[_0x0a9e('0x60')]['from']=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x8c')];_0x34e745[_0x0a9e('0x60')]['body']=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x8d')][_0x0a9e('0x26')];break;case _0x0a9e('0x8e'):_0x34e745[_0x0a9e('0x60')]['from']=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x8f')];_0x34e745['body'][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x84')];_0x34e745['body']['messageId']=_0x517081['body'][_0x0a9e('0x90')];break;case _0x0a9e('0x91'):_0x34e745['body'][_0x0a9e('0x81')]=_0x517081[_0x0a9e('0x60')][0x0][_0x0a9e('0x26')]['id'];_0x34e745['body'][_0x0a9e('0x7e')]=_0x517081[_0x0a9e('0x60')][0x0][_0x0a9e('0x26')][_0x0a9e('0x7e')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][0x0][_0x0a9e('0x26')][_0x0a9e('0x84')];break;case'intelepeer':_0x34e745[_0x0a9e('0x60')]['from']=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x7e')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x26')];_0x34e745['body'][_0x0a9e('0x81')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x92')];break;}}if(_0x34e745[_0x0a9e('0x60')]['id']){delete _0x34e745['body']['id'];}if(_[_0x0a9e('0x93')](_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')])){throw new db[(_0x0a9e('0x94'))][(_0x0a9e('0x76'))](_0x0a9e('0x95'));}if(_[_0x0a9e('0x93')](_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')])||_0x34e745[_0x0a9e('0x60')]['body']===''){throw new db[(_0x0a9e('0x94'))][(_0x0a9e('0x76'))](_0x0a9e('0x96'));}if(_[_0x0a9e('0x93')](_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x97')])){throw new db[(_0x0a9e('0x94'))][(_0x0a9e('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e7273);}if(!_[_0x0a9e('0x98')](_0x4e7273,_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x97')])){throw new db['Sequelize'][(_0x0a9e('0x76'))](_0x0a9e('0x99')+_0x4e7273);}_0x436313[_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x97')]]=_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')];return db[_0x0a9e('0x9a')][_0x0a9e('0x5d')]({'where':{'id':_0x34e745[_0x0a9e('0x6f')][_0x0a9e('0x7c')]},'include':[{'model':db['CmContact'],'as':_0x0a9e('0x9b'),'where':_0x436313,'limit':0x1,'order':[[_0x0a9e('0x79'),_0x0a9e('0x9c')]]}]});})[_0x0a9e('0x1d')](handleEntityNotFound(_0x287324,null))[_0x0a9e('0x1d')](function(_0x3942fd){if(_0x3942fd){_0x34e745['list']=_[_0x0a9e('0x9d')](_0x3942fd,['Contacts']);if(_0x3942fd['Contacts']['length']){return _0x3942fd[_0x0a9e('0x9b')][0x0];}var _0x3fa3f2=_[_0x0a9e('0x16')](_0x34e745[_0x0a9e('0x60')],{'firstName':_0x34e745['body'][_0x0a9e('0x7e')],'ListId':_0x3942fd['id']});_0x3fa3f2[_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x97')]]=_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')];return db['CmContact']['create'](_0x3fa3f2,{'fields':_0x1b61d5,'raw':!![]});}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x287324,null))[_0x0a9e('0x1d')](function(_0x2a293f){if(_0x2a293f){_0x34e745['contact']=_0x2a293f;var _0x319752={'ContactId':_0x2a293f['id'],'phone':_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')],'SmsAccountId':_0x517081['params']['id']};var _0x8ad1c0={'ContactId':_0x2a293f['id'],'SmsAccountId':_0x517081[_0x0a9e('0x58')]['id'],'closed':![]};return db[_0x0a9e('0x9e')]['find']({'where':_0x8ad1c0})[_0x0a9e('0x1d')](function(_0x336b30){if(_0x336b30){return[_0x336b30,![]];}return db[_0x0a9e('0x9e')]['create'](_0x319752)['then'](function(_0x53ef46){return[_0x53ef46,!![]];});});}})[_0x0a9e('0x9f')](function(_0x1f50db,_0xcbc73c){_0x34e745[_0x0a9e('0xa0')]=_0x1f50db['get']({'plain':!![]});_0x34e745[_0x0a9e('0xa0')]['created']=![];if(_0xcbc73c){if(_0x34e745[_0x0a9e('0x6f')][_0x0a9e('0xa1')]){_0x34e745[_0x0a9e('0x70')]['push']({'id':0x0,'priority':_0x34e745[_0x0a9e('0x70')][_0x0a9e('0x47')]+0x1,'app':_0x0a9e('0xa2'),'appdata':'unmanaged','interval':_0x0a9e('0xa3')});}_0x34e745['interaction'][_0x0a9e('0xa4')]=!![];}return db['SmsMessage'][_0x0a9e('0x5a')]({'phone':_0x34e745['body'][_0x0a9e('0x7e')],'messageId':_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x81')],'body':_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')],'SmsAccountId':_0x517081[_0x0a9e('0x58')]['id'],'SmsInteractionId':_0x1f50db['id'],'direction':'in','ContactId':_0x1f50db[_0x0a9e('0xa5')],'AttachmentId':_0x34e745['body'][_0x0a9e('0xa6')]});})[_0x0a9e('0x1d')](function(_0x567004){_0x34e745[_0x0a9e('0x26')]=_0x567004;if(_0x34e745[_0x0a9e('0xa0')]['UserId']){return db[_0x0a9e('0xa7')][_0x0a9e('0x5d')]({'attributes':['id',_0x0a9e('0x3a')],'where':{'id':_0x34e745['interaction'][_0x0a9e('0xa8')]}})[_0x0a9e('0x1d')](function(_0xdeb5e4){if(_0xdeb5e4){_0x34e745[_0x0a9e('0x70')][_0x0a9e('0xa9')]({'id':0x0,'priority':0x0,'app':_0x0a9e('0xaa'),'appdata':_0xdeb5e4[_0x0a9e('0x3a')]+','+(_0x34e745[_0x0a9e('0x6f')][_0x0a9e('0xab')]||0xa),'interval':_0x0a9e('0xa3')});}return respondWithRpcPromise('Start',_0x0a9e('0xac'),_0x34e745);});}return respondWithRpcPromise('Start',_0x0a9e('0xac'),_0x34e745);})[_0x0a9e('0x1d')](function(_0x5b9c76){if(_0x5b9c76){var _0x315e31=0xc8;var _0x5d577b=_0x0a9e('0xad');logger['info'](_0x0a9e('0x22'),_0x5d577b,_0x315e31,_0x0a9e('0xae'));logger[_0x0a9e('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x5d577b,_0x315e31,_0x0a9e('0xae'),JSON[_0x0a9e('0x23')](_0x5b9c76));if(_0x34e745[_0x0a9e('0x6f')][_0x0a9e('0x51')]===_0x0a9e('0xaf')){return _0x287324[_0x0a9e('0x2a')](_0x315e31)[_0x0a9e('0x2f')]('Content-Type',_0x0a9e('0xb0'))[_0x0a9e('0x3b')](_0x0a9e('0xb1'));}else{return _0x287324[_0x0a9e('0x2a')](_0x315e31)[_0x0a9e('0x30')](_0x5b9c76);}}})[_0x0a9e('0x28')](handleError(_0x287324,null));};exports[_0x0a9e('0xb2')]=function(_0x5d6a48,_0x5c8720,_0x10aa22){return db[_0x0a9e('0x3e')][_0x0a9e('0x6a')]({'where':{'id':_0x5d6a48[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x5c8720,null))[_0x0a9e('0x1d')](function(_0x609711){if(_0x609711){return db['sequelize'][_0x0a9e('0xb3')](function(_0x1d7fc4){return db[_0x0a9e('0x6e')][_0x0a9e('0x35')]({'where':{'SmsAccountId':_0x5d6a48[_0x0a9e('0x58')]['id']},'transaction':_0x1d7fc4})[_0x0a9e('0x1d')](function(_0x16be7e){var _0x54f0b8=_[_0x0a9e('0x50')](_0x5d6a48[_0x0a9e('0x60')],function(_0x231826){_0x231826['SmsAccountId']=_0x5d6a48[_0x0a9e('0x58')]['id'];return _0x231826;});return db[_0x0a9e('0x6e')][_0x0a9e('0xb4')](_0x54f0b8,{'transaction':_0x1d7fc4});});})[_0x0a9e('0x1d')](function(){return db['SmsApplication'][_0x0a9e('0xb5')]({'where':{'SmsAccountId':_0x5d6a48[_0x0a9e('0x58')]['id']},'order':_0x0a9e('0x73')});});}})[_0x0a9e('0x1d')](respondWithResult(_0x5c8720,null))[_0x0a9e('0x28')](handleError(_0x5c8720,null));};exports[_0x0a9e('0xb6')]=function(_0x3e365c,_0x385e5d,_0x4e5dec){var _0x3ede01={};var _0x266aa1={};var _0x25e41f;var _0x397771;return db['SmsAccount']['findOne']({'where':{'id':_0x3e365c[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x385e5d,null))[_0x0a9e('0x1d')](function(_0x596ba3){if(_0x596ba3){_0x25e41f=_0x596ba3;_0x266aa1[_0x0a9e('0x41')]=_[_0x0a9e('0x43')](db['SmsApplication'][_0x0a9e('0x3f')]);_0x266aa1['query']=_[_0x0a9e('0x43')](_0x3e365c['query']);_0x266aa1['filters']=_['intersection'](_0x266aa1[_0x0a9e('0x41')],_0x266aa1[_0x0a9e('0x42')]);_0x3ede01[_0x0a9e('0x46')]=_[_0x0a9e('0x44')](_0x266aa1[_0x0a9e('0x41')],qs[_0x0a9e('0x45')](_0x3e365c['query'][_0x0a9e('0x45')]));_0x3ede01[_0x0a9e('0x46')]=_0x3ede01[_0x0a9e('0x46')][_0x0a9e('0x47')]?_0x3ede01[_0x0a9e('0x46')]:_0x266aa1[_0x0a9e('0x41')];_0x3ede01[_0x0a9e('0x4a')]=qs['sort'](_0x3e365c['query'][_0x0a9e('0x4b')]);_0x3ede01['where']=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x4e')](_0x3e365c[_0x0a9e('0x42')],_0x266aa1[_0x0a9e('0x4d')]));if(_0x3e365c[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x3ede01['where']=_[_0x0a9e('0x53')](_0x3ede01['where'],{'$or':_['map'](_0x3ede01[_0x0a9e('0x46')],function(_0x593f9e){var _0x38dceb={};_0x38dceb[_0x593f9e]={'$like':'%'+_0x3e365c['query']['filter']+'%'};return _0x38dceb;})});}_0x3ede01=_[_0x0a9e('0x53')]({},_0x3ede01,_0x3e365c['options']);return _0x25e41f[_0x0a9e('0xb6')](_0x3ede01);}})[_0x0a9e('0x1d')](function(_0xe1ab0d){if(_0xe1ab0d){_0x397771=_0xe1ab0d['length'];if(!_0x3e365c[_0x0a9e('0x42')][_0x0a9e('0x48')](_0x0a9e('0x49'))){_0x3ede01['limit']=qs['limit'](_0x3e365c[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0x3ede01[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x3e365c[_0x0a9e('0x42')][_0x0a9e('0x2d')]);}return _0x25e41f[_0x0a9e('0xb6')](_0x3ede01);}})[_0x0a9e('0x1d')](function(_0x937b2a){if(_0x937b2a){return _0x937b2a?{'count':_0x397771,'rows':_0x937b2a}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x385e5d,null))['catch'](handleError(_0x385e5d,null));};exports['getInteractions']=function(_0x558171,_0x5975fa,_0x19dcc2){var _0x2ce30f={'raw':![],'where':{}};var _0x2d21c7={};var _0xb0e231={'count':0x0,'rows':[]};return db[_0x0a9e('0x3e')][_0x0a9e('0x6a')]({'where':{'id':_0x558171[_0x0a9e('0x58')]['id']}})['then'](handleEntityNotFound(_0x5975fa,null))['then'](function(_0x2869cc){if(_0x2869cc){_0x2d21c7[_0x0a9e('0x41')]=_['keys'](db[_0x0a9e('0x9e')][_0x0a9e('0x3f')]);_0x2d21c7[_0x0a9e('0x42')]=_[_0x0a9e('0x43')](_0x558171[_0x0a9e('0x42')]);_0x2d21c7[_0x0a9e('0x4d')]=_[_0x0a9e('0x44')](_0x2d21c7[_0x0a9e('0x41')],_0x2d21c7[_0x0a9e('0x42')]);_0x2ce30f[_0x0a9e('0x46')]=_[_0x0a9e('0x44')](_0x2d21c7[_0x0a9e('0x41')],qs['fields'](_0x558171[_0x0a9e('0x42')][_0x0a9e('0x45')]));_0x2ce30f[_0x0a9e('0x46')]=_0x2ce30f[_0x0a9e('0x46')][_0x0a9e('0x47')]?_0x2ce30f[_0x0a9e('0x46')]:_0x2d21c7[_0x0a9e('0x41')];if(!_0x558171[_0x0a9e('0x42')][_0x0a9e('0x48')](_0x0a9e('0x49'))){_0x2ce30f[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x558171['query']['limit']);_0x2ce30f[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x558171[_0x0a9e('0x42')][_0x0a9e('0x2d')]);}_0x2ce30f[_0x0a9e('0x4a')]=qs[_0x0a9e('0x4b')](_0x558171[_0x0a9e('0x42')]['sort']);_0x2ce30f[_0x0a9e('0x4c')]=qs['filters'](_[_0x0a9e('0x4e')](_0x558171[_0x0a9e('0x42')],_0x2d21c7[_0x0a9e('0x4d')]));_0x2ce30f[_0x0a9e('0x4c')][_0x0a9e('0x63')]=_0x2869cc['id'];if(_0x558171[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x2ce30f[_0x0a9e('0x4c')]=_[_0x0a9e('0x53')](_0x2ce30f[_0x0a9e('0x4c')],{'$or':_[_0x0a9e('0x50')](_0x2ce30f[_0x0a9e('0x46')],function(_0x43111e){var _0x3f7cb6={};_0x3f7cb6[_0x43111e]={'$like':'%'+_0x558171[_0x0a9e('0x42')][_0x0a9e('0x4f')]+'%'};return _0x3f7cb6;})});}_0x2ce30f=_['merge']({},_0x2ce30f,_0x558171['options']);return db[_0x0a9e('0x9e')][_0x0a9e('0x2c')]({'where':_0x2ce30f['where']})['then'](function(_0x2cb05c){_0xb0e231[_0x0a9e('0x2c')]=_0x2cb05c;if(_0x558171[_0x0a9e('0x42')]['includeAll']){_0x2ce30f[_0x0a9e('0x55')]=[{'model':db['CmContact'],'as':_0x0a9e('0xb7'),'required':![]},{'model':db['User'],'as':_0x0a9e('0xb8'),'attributes':['name',_0x0a9e('0xb9'),_0x0a9e('0xba')],'required':![]},{'model':db[_0x0a9e('0xbb')],'as':'Tags','attributes':['id',_0x0a9e('0x3a'),'color'],'where':_0x558171['query'][_0x0a9e('0xbc')]?{'id':_0x558171[_0x0a9e('0x42')][_0x0a9e('0xbc')]}:undefined,'required':_0x558171[_0x0a9e('0x42')][_0x0a9e('0xbc')]?!![]:![]}];}return db[_0x0a9e('0x9e')][_0x0a9e('0xbd')](_0x2ce30f);})[_0x0a9e('0x1d')](function(_0x1a3143){_0xb0e231[_0x0a9e('0x56')]=_0x1a3143;return _0xb0e231;});}})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x5975fa,_0x2ce30f))[_0x0a9e('0x28')](handleError(_0x5975fa,null));};exports[_0x0a9e('0x3b')]=function(_0x19487d,_0xdc4b2f,_0x65141c){var _0x310026,_0x643f66,_0x153de1;if(_['isNil'](_0x19487d[_0x0a9e('0x60')][_0x0a9e('0x60')])||_0x19487d[_0x0a9e('0x60')][_0x0a9e('0x60')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0a9e('0x93')](_0x19487d['body']['to'])){throw new db[(_0x0a9e('0x94'))][(_0x0a9e('0x76'))](_0x0a9e('0xbe'));}_0x310026=_0x19487d[_0x0a9e('0x60')]['to'];return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x19487d[_0x0a9e('0x58')]['id']},'include':[{'model':db[_0x0a9e('0x9a')],'as':_0x0a9e('0xbf'),'include':[{'model':db[_0x0a9e('0x75')],'as':'Contacts','where':{'mobile':_0x310026},'limit':0x1,'order':[[_0x0a9e('0x79'),'DESC']]}]}]})[_0x0a9e('0x1d')](handleEntityNotFound(_0xdc4b2f,null))['then'](function(_0xf4de86){if(_0xf4de86&&_0xf4de86[_0x0a9e('0xbf')]){_0x643f66=_0xf4de86[_0x0a9e('0x36')]({'plain':!![]});if(_0x643f66['List']&&_0x643f66[_0x0a9e('0xbf')][_0x0a9e('0x9b')]['length']){return _0x643f66['List'][_0x0a9e('0x9b')][0x0];}return db[_0x0a9e('0x75')][_0x0a9e('0x5a')](_['defaults'](_0x19487d['body'],{'firstName':_0x310026,'mobile':_0x310026,'phone':_0x310026,'ListId':_0x643f66['ListId']}));}})[_0x0a9e('0x1d')](handleEntityNotFound(_0xdc4b2f,null))[_0x0a9e('0x1d')](function(_0x2b7ba9){if(_0x2b7ba9){_0x153de1=_0x2b7ba9;return db[_0x0a9e('0x9e')][_0x0a9e('0x5d')]({'where':{'ContactId':_0x153de1['id'],'closed':![],'SmsAccountId':_0x643f66['id']}})[_0x0a9e('0x1d')](function(_0x183b9b){if(_0x183b9b){return[_0x183b9b,![]];}return db[_0x0a9e('0x9e')][_0x0a9e('0x5a')]({'UserId':_0x19487d[_0x0a9e('0xc0')]['id'],'ContactId':_0x153de1['id'],'SmsAccountId':_0x643f66['id'],'phone':_0x310026,'firstMsgDirection':_0x0a9e('0xc1'),'Messages':[_[_0x0a9e('0x53')](_0x19487d[_0x0a9e('0x60')],{'read':![],'body':_0x19487d[_0x0a9e('0x60')][_0x0a9e('0x60')],'phone':_0x310026,'SmsAccountId':_0x643f66['id'],'UserId':_0x19487d[_0x0a9e('0xc0')]['id'],'ContactId':_0x153de1['id']})]},{'include':[{'model':db[_0x0a9e('0xc2')],'as':_0x0a9e('0xc3')}]})['then'](function(_0xb33e27){return[_0xb33e27,!![]];});});}})[_0x0a9e('0x9f')](function(_0xf40862,_0x163c3f){if(_0x163c3f){return _0xf40862;}return db[_0x0a9e('0xc2')][_0x0a9e('0x5a')](_['merge'](_0x19487d[_0x0a9e('0x60')],{'read':![],'body':_0x19487d[_0x0a9e('0x60')][_0x0a9e('0x60')],'phone':_0x310026,'SmsAccountId':_0x643f66['id'],'SmsInteractionId':_0xf40862['id'],'UserId':_0x19487d[_0x0a9e('0xc0')]['id'],'ContactId':_0x153de1['id']}))[_0x0a9e('0x1d')](function(_0x3a7383){_0xf40862[_0x0a9e('0xc4')][_0x0a9e('0xc3')]=[];_0xf40862[_0x0a9e('0xc4')]['Messages']['push'](_0x3a7383[_0x0a9e('0xc4')]);return _0xf40862;});})[_0x0a9e('0x1d')](respondWithResult(_0xdc4b2f,null))['catch'](handleError(_0xdc4b2f,null));};exports[_0x0a9e('0x2a')]=function(_0x306aa5,_0x4c8d75,_0x1ca7c8){if(_0x306aa5['body']['id']){delete _0x306aa5[_0x0a9e('0x60')]['id'];}var _0x279c19,_0x58c53c,_0x27a41c;return db[_0x0a9e('0x3e')]['find']({'where':{'id':_0x306aa5[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4c8d75,null))['then'](function(_0x3259dc){if(_0x3259dc){_0x27a41c=_0x3259dc;logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0xc5'),_0x3259dc[_0x0a9e('0x51')],util['inspect'](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));switch(_0x3259dc[_0x0a9e('0x51')]){case'skebby':if(_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0xc6')]&&_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x2a')]){_0x58c53c=_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x2a')];return db[_0x0a9e('0xc2')]['find']({'where':{'messageId':_0x306aa5['body']['skebby_dispatch_id']}});}break;case'connectel':if(_0x306aa5['body'][_0x0a9e('0xc7')]&&_0x306aa5[_0x0a9e('0x60')]['statusInt']){_0x58c53c=_0x306aa5['body'][_0x0a9e('0xc8')];return db['SmsMessage'][_0x0a9e('0x5d')]({'where':{'messageId':_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0xc7')]}});}break;case _0x0a9e('0x86'):if(_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x87')]&&_0x306aa5['body'][_0x0a9e('0xc9')]){_0x58c53c=_0x306aa5[_0x0a9e('0x60')]['status_code'];return db[_0x0a9e('0xc2')][_0x0a9e('0x5d')]({'where':{'messageId':_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x87')]}});}break;case _0x0a9e('0x8a'):var _0x2f1cc0=_0x306aa5[_0x0a9e('0x60')]['results'][0x0];if(_0x2f1cc0[_0x0a9e('0x81')]&&_0x2f1cc0['status'][_0x0a9e('0xca')]===_0x0a9e('0xcb')){_0x58c53c=_0x2f1cc0['status'][_0x0a9e('0xca')];return db[_0x0a9e('0xc2')]['find']({'where':{'messageId':_0x2f1cc0[_0x0a9e('0x81')]}});}break;case'clickatell':if(_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x81')]&&_0x306aa5['body'][_0x0a9e('0x2a')]){_0x58c53c=_0x306aa5['body'][_0x0a9e('0x2a')];return db[_0x0a9e('0xc2')][_0x0a9e('0x5d')]({'where':{'messageId':_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x81')]}});}break;case _0x0a9e('0x91'):if(_0x306aa5[_0x0a9e('0x60')][0x0]['message']['id']){_0x58c53c=_0x306aa5[_0x0a9e('0x60')][0x0][_0x0a9e('0x51')];return db[_0x0a9e('0xc2')][_0x0a9e('0x5d')]({'where':{'messageId':_0x306aa5[_0x0a9e('0x60')][0x0]['message']['id']}});}break;case _0x0a9e('0xcc'):if(_0x306aa5['body']['redif']&&_0x306aa5[_0x0a9e('0x60')]['status']){_0x58c53c=_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x2a')];return db['SmsMessage'][_0x0a9e('0x5d')]({'where':{'messageId':_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0xcd')]}});}break;}}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4c8d75,null))[_0x0a9e('0x1d')](function(_0x25eb44){if(_0x25eb44){_0x279c19=_0x25eb44;switch(_0x27a41c[_0x0a9e('0x51')]){case _0x0a9e('0x83'):if(_0x58c53c===_0x0a9e('0xcb')){return _0x279c19['update']({'read':!![]});}else{logger[_0x0a9e('0x24')](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0x83'),util['inspect'](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0a9e('0x85'):if(_0x58c53c==='1'){return _0x279c19[_0x0a9e('0x34')]({'read':!![]});}else{logger['error'](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0x83'),util['inspect'](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0xce')]&&_0x58c53c>=0xc8&&_0x58c53c<=0xce){return _0x279c19[_0x0a9e('0x34')]({'read':!![]});}else{logger[_0x0a9e('0x24')](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0x86'),util['inspect'](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0a9e('0x8a'):var _0x7c4db6=_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0xcf')][0x0];if(_0x7c4db6[_0x0a9e('0x2a')][_0x0a9e('0xca')]===_0x0a9e('0xcb')){return _0x279c19[_0x0a9e('0x34')]({'read':!![]});}else{logger[_0x0a9e('0x24')](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0x8a'),util[_0x0a9e('0xd0')](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0a9e('0x8e'):if(_0x58c53c==_0x0a9e('0xd1')||_0x58c53c==_0x0a9e('0xd2')){return _0x279c19[_0x0a9e('0x34')]({'read':!![]});}else{logger[_0x0a9e('0x24')](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0x8e'),util['inspect'](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0a9e('0x91'):if(_0x58c53c==_0x0a9e('0xd3')){return _0x279c19['update']({'read':!![]});}else{logger[_0x0a9e('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0a9e('0x2a'),_0x0a9e('0x91'),util[_0x0a9e('0xd0')](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0a9e('0xcc'):if(_0x58c53c===_0x0a9e('0xd4')||_0x58c53c===_0x0a9e('0xd5')){return _0x279c19[_0x0a9e('0x34')]({'read':!![]});}else{logger['error'](_0x0a9e('0x22'),_0x0a9e('0x2a'),'intelepeer',util[_0x0a9e('0xd0')](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x279c19;}})[_0x0a9e('0x1d')](respondWithResult(_0x4c8d75,null))['catch'](handleError(_0x4c8d75,null));};exports[_0x0a9e('0xd6')]=function(_0x4b7211,_0x315299,_0x1bf053){var _0x4803ce,_0x443208,_0x31648e;return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x4b7211[_0x0a9e('0x58')]['id']}})['then'](handleEntityNotFound(_0x315299,null))[_0x0a9e('0x1d')](function(_0x3fc431){if(_0x3fc431){_0x31648e=_0x3fc431;logger['debug'](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0xc5'),_0x3fc431['type'],util['inspect'](_0x4b7211[_0x0a9e('0x42')],{'showHidden':![],'depth':null}));switch(_0x3fc431[_0x0a9e('0x51')]){case _0x0a9e('0x8b'):if(_0x4b7211[_0x0a9e('0x42')][_0x0a9e('0xd7')]&&_0x4b7211[_0x0a9e('0x42')][_0x0a9e('0xd8')]){_0x443208=_0x4b7211[_0x0a9e('0x42')]['state'];return db['SmsMessage'][_0x0a9e('0x5d')]({'where':{'messageId':_0x4b7211['query'][_0x0a9e('0xd7')]}});}break;}}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x315299,null))[_0x0a9e('0x1d')](function(_0x413f0f){if(_0x413f0f){_0x4803ce=_0x413f0f;switch(_0x31648e['type']){case _0x0a9e('0x8b'):if(_0x443208==='2'||_0x443208==='6'){return _0x4803ce[_0x0a9e('0x34')]({'read':!![]});}else{logger['error'](_0x0a9e('0x22'),'status',_0x0a9e('0x8b'),util[_0x0a9e('0xd0')](_0x4b7211[_0x0a9e('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x4803ce;}})[_0x0a9e('0x1d')](respondWithResult(_0x315299,null))[_0x0a9e('0x28')](handleError(_0x315299,null));};exports[_0x0a9e('0xd9')]=function(_0x595efc,_0x16d50b,_0x580dd2){return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x595efc[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x16d50b,null))[_0x0a9e('0x1d')](function(_0x393e9c){if(_0x393e9c){return _0x393e9c[_0x0a9e('0xd9')](_0x595efc['body'][_0x0a9e('0x67')],_[_0x0a9e('0x9d')](_0x595efc[_0x0a9e('0x60')],[_0x0a9e('0x67'),'id'])||{})[_0x0a9e('0x9f')](function(_0x534f61){for(var _0x3cd588=0x0;_0x3cd588<_0x595efc[_0x0a9e('0x60')]['ids']['length'];_0x3cd588+=0x1){socket[_0x0a9e('0xda')](_0x0a9e('0xdb'),{'UserId':_0x595efc[_0x0a9e('0x60')][_0x0a9e('0x67')][_0x3cd588],'SmsAccountId':_0x595efc[_0x0a9e('0x58')]['id']});}return _0x534f61;});}})[_0x0a9e('0x1d')](respondWithResult(_0x16d50b,null))['catch'](handleError(_0x16d50b,null));};exports[_0x0a9e('0xdc')]=function(_0x13782b,_0x2a9f6e,_0x4bf3c7){return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x13782b[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x2a9f6e,null))['then'](function(_0x5d4935){if(_0x5d4935){return _0x5d4935[_0x0a9e('0xdc')](_0x13782b[_0x0a9e('0x42')][_0x0a9e('0x67')])[_0x0a9e('0x1d')](function(){if(_[_0x0a9e('0xdd')](_0x13782b[_0x0a9e('0x42')][_0x0a9e('0x67')])){for(var _0x23dd12=0x0;_0x23dd12<_0x13782b['query'][_0x0a9e('0x67')]['length'];_0x23dd12+=0x1){socket[_0x0a9e('0xda')](_0x0a9e('0xde'),{'UserId':Number(_0x13782b[_0x0a9e('0x42')]['ids'][_0x23dd12]),'SmsAccountId':Number(_0x13782b['params']['id'])});}}else{socket[_0x0a9e('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x13782b[_0x0a9e('0x42')]['ids']),'SmsAccountId':Number(_0x13782b['params']['id'])});}});}})[_0x0a9e('0x1d')](respondWithStatusCode(_0x2a9f6e,null))[_0x0a9e('0x28')](handleError(_0x2a9f6e,null));};exports[_0x0a9e('0xdf')]=function(_0x2e6482,_0x1f0776,_0x2ac3dc){var _0x2f64ef={};var _0x36287b={};var _0x106e04;var _0x3b3e30;return db[_0x0a9e('0x3e')][_0x0a9e('0x6a')]({'where':{'id':_0x2e6482[_0x0a9e('0x58')]['id']}})['then'](handleEntityNotFound(_0x1f0776,null))['then'](function(_0x3bde76){if(_0x3bde76){_0x106e04=_0x3bde76;_0x36287b['model']=_[_0x0a9e('0x43')](db[_0x0a9e('0xa7')][_0x0a9e('0x3f')]);_0x36287b['query']=_['keys'](_0x2e6482[_0x0a9e('0x42')]);_0x36287b[_0x0a9e('0x4d')]=_[_0x0a9e('0x44')](_0x36287b[_0x0a9e('0x41')],_0x36287b[_0x0a9e('0x42')]);_0x2f64ef[_0x0a9e('0x46')]=_[_0x0a9e('0x44')](_0x36287b['model'],qs[_0x0a9e('0x45')](_0x2e6482['query'][_0x0a9e('0x45')]));_0x2f64ef[_0x0a9e('0x46')]=_0x2f64ef['attributes'][_0x0a9e('0x47')]?_0x2f64ef[_0x0a9e('0x46')]:_0x36287b[_0x0a9e('0x41')];_0x2f64ef[_0x0a9e('0x4a')]=qs[_0x0a9e('0x4b')](_0x2e6482[_0x0a9e('0x42')]['sort']);_0x2f64ef[_0x0a9e('0x4c')]=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x4e')](_0x2e6482['query'],_0x36287b[_0x0a9e('0x4d')]));if(_0x2e6482[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x2f64ef['where']=_[_0x0a9e('0x53')](_0x2f64ef[_0x0a9e('0x4c')],{'$or':_[_0x0a9e('0x50')](_0x2f64ef[_0x0a9e('0x46')],function(_0x1d39bd){var _0x20a792={};_0x20a792[_0x1d39bd]={'$like':'%'+_0x2e6482['query']['filter']+'%'};return _0x20a792;})});}_0x2f64ef=_[_0x0a9e('0x53')]({},_0x2f64ef,_0x2e6482[_0x0a9e('0x59')]);return _0x106e04['getAgents'](_0x2f64ef);}})[_0x0a9e('0x1d')](function(_0x356370){if(_0x356370){_0x3b3e30=_0x356370[_0x0a9e('0x47')];if(!_0x2e6482[_0x0a9e('0x42')][_0x0a9e('0x48')](_0x0a9e('0x49'))){_0x2f64ef['limit']=qs[_0x0a9e('0x2e')](_0x2e6482[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0x2f64ef['offset']=qs[_0x0a9e('0x2d')](_0x2e6482[_0x0a9e('0x42')][_0x0a9e('0x2d')]);}return _0x106e04[_0x0a9e('0xdf')](_0x2f64ef);}})['then'](function(_0x49bb4f){if(_0x49bb4f){return _0x49bb4f?{'count':_0x3b3e30,'rows':_0x49bb4f}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x1f0776,null))[_0x0a9e('0x28')](handleError(_0x1f0776,null));}; \ No newline at end of file +var _0xa9e0=['omit','SmsInteraction','spread','interaction','autoclose','close','*,*,*,*','created','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','receiveMessage','entity\x20found','twilio','text/xml','\x0a','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','internal','Tag','tag','findAll','to\x20is\x20mandatory','List','user','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','intelepeer','redif','error_code','results','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','VIRTUAL','merge','includeAll','include','rows','show','params','options','create','role','UserProfileSection','find','userProfileId','autoAssociation','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','sms','SmsApplication','account','applications','orderBy','Applications','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','Text','infobip','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC'];(function(_0x1a8e76,_0x35e540){var _0x240358=function(_0x3a7efa){while(--_0x3a7efa){_0x1a8e76['push'](_0x1a8e76['shift']());}};_0x240358(++_0x35e540);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return new BPromise(function(_0x519dfd,_0x16033c){var _0x12066b=_0x1985b6||client;return _0x12066b['request'](_0x52a03d,_0x5d0880)[_0x0a9e('0x1d')](function(_0x5a0a06){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x22dccb,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x22dccb,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x5a0a06));if(_0x5a0a06[_0x0a9e('0x24')]){if(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x16033c(_0x5a0a06[_0x0a9e('0x24')]['message']);}logger[_0x0a9e('0x24')]('SmsAccount,\x20%s,\x20%s',_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x519dfd(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x26')]);}else{logger[_0x0a9e('0x1e')]('SmsAccount,\x20%s,\x20%s',_0x22dccb,_0x0a9e('0x20'));_0x519dfd(_0x5a0a06[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x370d86){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x370d86);_0x16033c(_0x370d86);});});}function respondWithStatusCode(_0x5ea472,_0x59181e){_0x59181e=_0x59181e||0xcc;return function(_0x197ec0){if(_0x197ec0){return _0x5ea472[_0x0a9e('0x29')](_0x59181e);}return _0x5ea472[_0x0a9e('0x2a')](_0x59181e)[_0x0a9e('0x2b')]();};}function respondWithResult(_0x526cf3,_0x384319){_0x384319=_0x384319||0xc8;return function(_0x479bc4){if(_0x479bc4){return _0x526cf3[_0x0a9e('0x2a')](_0x384319)['json'](_0x479bc4);}};}function respondWithFilteredResult(_0x1dc186,_0x34dc65){return function(_0x25fba9){if(_0x25fba9){var _0x14433c=_0x25fba9[_0x0a9e('0x2c')],_0x140511=_0x34dc65['offset'],_0x1538a4=_0x34dc65[_0x0a9e('0x2d')]+_0x34dc65[_0x0a9e('0x2e')],_0x11c3b6;if(_0x1538a4>=_0x14433c){_0x1538a4=_0x14433c;_0x11c3b6=0xc8;}else{_0x11c3b6=0xce;}_0x1dc186[_0x0a9e('0x2a')](_0x11c3b6);return _0x1dc186[_0x0a9e('0x2f')]('Content-Range',_0x140511+'-'+_0x1538a4+'/'+_0x14433c)[_0x0a9e('0x30')](_0x25fba9);}return null;};}function patchUpdates(_0x40e7a3){return function(_0x1843b2){try{jsonpatch[_0x0a9e('0x31')](_0x1843b2,_0x40e7a3,!![]);}catch(_0x58b06f){return BPromise[_0x0a9e('0x32')](_0x58b06f);}return _0x1843b2[_0x0a9e('0x33')]();};}function saveUpdates(_0x2e8759,_0x1dbde2){return function(_0x540530){if(_0x540530){return _0x540530[_0x0a9e('0x34')](_0x2e8759)['then'](function(_0x2407f9){return _0x2407f9;});}return null;};}function removeEntity(_0x3ae878,_0x1122db){return function(_0x33bdb7){if(_0x33bdb7){return _0x33bdb7[_0x0a9e('0x35')]()['then'](function(){var _0x66c1d2=_0x33bdb7[_0x0a9e('0x36')]({'plain':!![]});var _0x40cb85=_0x0a9e('0x37');return db[_0x0a9e('0x38')][_0x0a9e('0x35')]({'where':{'type':_0x40cb85,'resourceId':_0x66c1d2['id']}})[_0x0a9e('0x1d')](function(){return _0x33bdb7;});})[_0x0a9e('0x1d')](function(){_0x3ae878['status'](0xcc)[_0x0a9e('0x2b')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x39')]);if(_0x191e91[_0x0a9e('0x3a')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x3b')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={'include':[{'model':db[_0x0a9e('0x3c')],'as':_0x0a9e('0x3d')}]},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x3cae=_['map'](db[_0x0a9e('0x3e')][_0x0a9e('0x3f')],function(_0x289467){return{'name':_0x289467['fieldName'],'type':_0x289467['type'][_0x0a9e('0x40')]};});_0x1ef87a[_0x0a9e('0x41')]=_['map'](_0x3cae,_0x0a9e('0x3a'));_0x1ef87a[_0x0a9e('0x42')]=_[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x42')]);_0x1ef87a['filters']=_['intersection'](_0x1ef87a[_0x0a9e('0x41')],_0x1ef87a[_0x0a9e('0x42')]);_0x381c37['attributes']=_[_0x0a9e('0x44')](_0x1ef87a[_0x0a9e('0x41')],qs[_0x0a9e('0x45')](_0x24936a['query'][_0x0a9e('0x45')]));_0x381c37[_0x0a9e('0x46')]=_0x381c37[_0x0a9e('0x46')][_0x0a9e('0x47')]?_0x381c37[_0x0a9e('0x46')]:_0x1ef87a[_0x0a9e('0x41')];if(!_0x24936a[_0x0a9e('0x42')][_0x0a9e('0x48')](_0x0a9e('0x49'))){_0x381c37[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x24936a[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a['query']['offset']);}_0x381c37[_0x0a9e('0x4a')]=qs[_0x0a9e('0x4b')](_0x24936a[_0x0a9e('0x42')][_0x0a9e('0x4b')]);_0x381c37[_0x0a9e('0x4c')]=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x4e')](_0x24936a[_0x0a9e('0x42')],_0x1ef87a[_0x0a9e('0x4d')]),_0x3cae);if(_0x24936a[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x381c37[_0x0a9e('0x4c')]=_['merge'](_0x381c37[_0x0a9e('0x4c')],{'$or':_[_0x0a9e('0x50')](_0x3cae,function(_0xdd268f){if(_0xdd268f[_0x0a9e('0x51')]!==_0x0a9e('0x52')){var _0xbe9d19={};_0xbe9d19[_0xdd268f[_0x0a9e('0x3a')]]={'$like':'%'+_0x24936a[_0x0a9e('0x42')]['filter']+'%'};return _0xbe9d19;}})});}_0x381c37=_[_0x0a9e('0x53')]({},_0x381c37,_0x24936a['options']);var _0x473dc8={'where':_0x381c37[_0x0a9e('0x4c')]};return db[_0x0a9e('0x3e')]['count'](_0x473dc8)[_0x0a9e('0x1d')](function(_0x7f6eb1){_0x4f41ae[_0x0a9e('0x2c')]=_0x7f6eb1;if(_0x24936a[_0x0a9e('0x42')][_0x0a9e('0x54')]){_0x381c37[_0x0a9e('0x55')]=[{'all':!![]}];}return db[_0x0a9e('0x3e')]['findAll'](_0x381c37);})[_0x0a9e('0x1d')](function(_0x1bde3c){_0x4f41ae[_0x0a9e('0x56')]=_0x1bde3c;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x57')]=function(_0x6054ee,_0x19383e){var _0x34febd={'raw':![],'where':{'id':_0x6054ee[_0x0a9e('0x58')]['id']},'include':[{'model':db[_0x0a9e('0x3c')],'as':'mandatoryDispositionPause'}]},_0x58a5c2={};_0x58a5c2['model']=_['keys'](db[_0x0a9e('0x3e')][_0x0a9e('0x3f')]);_0x58a5c2[_0x0a9e('0x42')]=_[_0x0a9e('0x43')](_0x6054ee[_0x0a9e('0x42')]);_0x58a5c2[_0x0a9e('0x4d')]=_[_0x0a9e('0x44')](_0x58a5c2[_0x0a9e('0x41')],_0x58a5c2['query']);_0x34febd['attributes']=_['intersection'](_0x58a5c2[_0x0a9e('0x41')],qs[_0x0a9e('0x45')](_0x6054ee[_0x0a9e('0x42')]['fields']));_0x34febd[_0x0a9e('0x46')]=_0x34febd[_0x0a9e('0x46')]['length']?_0x34febd['attributes']:_0x58a5c2[_0x0a9e('0x41')];if(_0x6054ee['query'][_0x0a9e('0x54')]){_0x34febd['include']=[{'all':!![]}];}_0x34febd=_[_0x0a9e('0x53')]({},_0x34febd,_0x6054ee[_0x0a9e('0x59')]);return db[_0x0a9e('0x3e')]['find'](_0x34febd)[_0x0a9e('0x1d')](handleEntityNotFound(_0x19383e,null))[_0x0a9e('0x1d')](respondWithResult(_0x19383e,null))['catch'](handleError(_0x19383e,null));};exports['create']=function(_0x128aa6,_0x3aedd0){return db['SmsAccount'][_0x0a9e('0x5a')](_0x128aa6['body'],{})[_0x0a9e('0x1d')](function(_0x523cd2){var _0xe22ccc=_0x128aa6['user']['get']({'plain':!![]});if(!_0xe22ccc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe22ccc[_0x0a9e('0x5b')]==='user'){var _0x2f7092=_0x523cd2[_0x0a9e('0x36')]({'plain':!![]});var _0x3cfd00=_0x0a9e('0x37');return db[_0x0a9e('0x5c')][_0x0a9e('0x5d')]({'where':{'name':_0x3cfd00,'userProfileId':_0xe22ccc[_0x0a9e('0x5e')]},'raw':!![]})[_0x0a9e('0x1d')](function(_0x4e67ab){if(_0x4e67ab&&_0x4e67ab[_0x0a9e('0x5f')]===0x0){return db[_0x0a9e('0x38')][_0x0a9e('0x5a')]({'name':_0x2f7092[_0x0a9e('0x3a')],'resourceId':_0x2f7092['id'],'type':_0x4e67ab[_0x0a9e('0x3a')],'sectionId':_0x4e67ab['id']},{})[_0x0a9e('0x1d')](function(){return _0x523cd2;});}else{return _0x523cd2;}})['catch'](function(_0x956fbe){logger[_0x0a9e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x956fbe);throw _0x956fbe;});}return _0x523cd2;})[_0x0a9e('0x1d')](respondWithResult(_0x3aedd0,0xc9))['catch'](handleError(_0x3aedd0,null));};exports[_0x0a9e('0x34')]=function(_0x5ba1f9,_0x4b3c1a){if(_0x5ba1f9['body']['id']){delete _0x5ba1f9[_0x0a9e('0x60')]['id'];}return db['SmsAccount'][_0x0a9e('0x5d')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x58')]['id']},'include':[{'model':db[_0x0a9e('0x3c')],'as':_0x0a9e('0x3d')}]})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))[_0x0a9e('0x1d')](saveUpdates(_0x5ba1f9['body'],null))[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};exports[_0x0a9e('0x35')]=function(_0x1f07cb,_0x51aaf7){return db['SmsAccount'][_0x0a9e('0x5d')]({'where':{'id':_0x1f07cb[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x51aaf7,null))[_0x0a9e('0x1d')](removeEntity(_0x51aaf7,null))['catch'](handleError(_0x51aaf7,null));};exports[_0x0a9e('0x61')]=function(_0xe05a5a,_0x54327c){return db[_0x0a9e('0x3e')][_0x0a9e('0x61')]()[_0x0a9e('0x1d')](respondWithResult(_0x54327c,null))[_0x0a9e('0x28')](handleError(_0x54327c,null));};exports[_0x0a9e('0x62')]=function(_0x4d4a35,_0x176840,_0x2937e0){if(_0x4d4a35[_0x0a9e('0x60')]['id']){delete _0x4d4a35['body']['id'];}return db[_0x0a9e('0x3e')]['find']({'where':{'id':_0x4d4a35['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x176840,null))[_0x0a9e('0x1d')](function(_0x9375fb){if(_0x9375fb){_0x4d4a35[_0x0a9e('0x60')][_0x0a9e('0x63')]=_0x9375fb['id'];return db[_0x0a9e('0x64')][_0x0a9e('0x5a')](_0x4d4a35[_0x0a9e('0x60')]);}})[_0x0a9e('0x1d')](respondWithResult(_0x176840,null))[_0x0a9e('0x28')](handleError(_0x176840,null));};exports[_0x0a9e('0x65')]=function(_0x19012b,_0x2bbb86,_0x2b8192){var _0x320898={'raw':![],'where':{}};var _0x412a72={};var _0x2a28c0={'count':0x0,'rows':[]};return db[_0x0a9e('0x3e')]['findOne']({'where':{'id':_0x19012b[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x2bbb86,null))[_0x0a9e('0x1d')](function(_0x4edbb0){if(_0x4edbb0){_0x412a72[_0x0a9e('0x41')]=_[_0x0a9e('0x43')](db['Disposition'][_0x0a9e('0x3f')]);_0x412a72[_0x0a9e('0x42')]=_[_0x0a9e('0x43')](_0x19012b[_0x0a9e('0x42')]);_0x412a72[_0x0a9e('0x4d')]=_['intersection'](_0x412a72['model'],_0x412a72['query']);_0x320898[_0x0a9e('0x46')]=_[_0x0a9e('0x44')](_0x412a72[_0x0a9e('0x41')],qs[_0x0a9e('0x45')](_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x45')]));_0x320898[_0x0a9e('0x46')]=_0x320898[_0x0a9e('0x46')]['length']?_0x320898[_0x0a9e('0x46')]:_0x412a72[_0x0a9e('0x41')];if(!_0x19012b[_0x0a9e('0x42')]['hasOwnProperty'](_0x0a9e('0x49'))){_0x320898['limit']=qs[_0x0a9e('0x2e')](_0x19012b[_0x0a9e('0x42')]['limit']);_0x320898[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x2d')]);}_0x320898['order']=qs[_0x0a9e('0x4b')](_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x4b')]);_0x320898[_0x0a9e('0x4c')]=qs['filters'](_[_0x0a9e('0x4e')](_0x19012b[_0x0a9e('0x42')],_0x412a72[_0x0a9e('0x4d')]));_0x320898[_0x0a9e('0x4c')]['SmsAccountId']=_0x4edbb0['id'];if(_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x320898[_0x0a9e('0x4c')]=_[_0x0a9e('0x53')](_0x320898[_0x0a9e('0x4c')],{'$or':_[_0x0a9e('0x50')](_0x320898[_0x0a9e('0x46')],function(_0x3df0e3){var _0x1a7b03={};_0x1a7b03[_0x3df0e3]={'$like':'%'+_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x4f')]+'%'};return _0x1a7b03;})});}_0x320898=_[_0x0a9e('0x53')]({},_0x320898,_0x19012b[_0x0a9e('0x59')]);return db[_0x0a9e('0x64')]['count']({'where':_0x320898[_0x0a9e('0x4c')]})[_0x0a9e('0x1d')](function(_0xc599b3){_0x2a28c0['count']=_0xc599b3;if(_0x19012b[_0x0a9e('0x42')][_0x0a9e('0x54')]){_0x320898[_0x0a9e('0x55')]=[{'all':!![]}];}return db[_0x0a9e('0x64')]['findAll'](_0x320898);})['then'](function(_0x7ebea8){_0x2a28c0[_0x0a9e('0x56')]=_0x7ebea8;return _0x2a28c0;});}})['then'](respondWithFilteredResult(_0x2bbb86,_0x320898))[_0x0a9e('0x28')](handleError(_0x2bbb86,null));};exports['removeDispositions']=function(_0x260f4b,_0x8ebf02,_0x5637a1){return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x260f4b[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x8ebf02,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){return _0x1f42a0[_0x0a9e('0x66')](_0x260f4b['query'][_0x0a9e('0x67')]);}})[_0x0a9e('0x1d')](respondWithStatusCode(_0x8ebf02,null))[_0x0a9e('0x28')](handleError(_0x8ebf02,null));};exports[_0x0a9e('0x68')]=function(_0x492543,_0xf51744,_0xf0db1){if(_0x492543['body']['id']){delete _0x492543[_0x0a9e('0x60')]['id'];}return db['SmsAccount'][_0x0a9e('0x5d')]({'where':{'id':_0x492543[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0xf51744,null))[_0x0a9e('0x1d')](function(_0x5af453){if(_0x5af453){_0x492543['body'][_0x0a9e('0x63')]=_0x5af453['id'];return db[_0x0a9e('0x69')][_0x0a9e('0x5a')](_0x492543['body']);}})[_0x0a9e('0x1d')](respondWithResult(_0xf51744,null))[_0x0a9e('0x28')](handleError(_0xf51744,null));};exports['getAnswers']=function(_0x4e46b2,_0xf0a802,_0x56acca){var _0x5ea541={'raw':![],'where':{}};var _0x4dc6b3={};var _0x81d748={'count':0x0,'rows':[]};return db[_0x0a9e('0x3e')][_0x0a9e('0x6a')]({'where':{'id':_0x4e46b2[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0xf0a802,null))[_0x0a9e('0x1d')](function(_0x5a8854){if(_0x5a8854){_0x4dc6b3[_0x0a9e('0x41')]=_['keys'](db[_0x0a9e('0x69')][_0x0a9e('0x3f')]);_0x4dc6b3[_0x0a9e('0x42')]=_[_0x0a9e('0x43')](_0x4e46b2['query']);_0x4dc6b3[_0x0a9e('0x4d')]=_[_0x0a9e('0x44')](_0x4dc6b3[_0x0a9e('0x41')],_0x4dc6b3['query']);_0x5ea541[_0x0a9e('0x46')]=_[_0x0a9e('0x44')](_0x4dc6b3[_0x0a9e('0x41')],qs[_0x0a9e('0x45')](_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x45')]));_0x5ea541[_0x0a9e('0x46')]=_0x5ea541[_0x0a9e('0x46')]['length']?_0x5ea541[_0x0a9e('0x46')]:_0x4dc6b3[_0x0a9e('0x41')];if(!_0x4e46b2['query'][_0x0a9e('0x48')](_0x0a9e('0x49'))){_0x5ea541[_0x0a9e('0x2e')]=qs['limit'](_0x4e46b2[_0x0a9e('0x42')]['limit']);_0x5ea541[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x2d')]);}_0x5ea541[_0x0a9e('0x4a')]=qs[_0x0a9e('0x4b')](_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x4b')]);_0x5ea541['where']=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x4e')](_0x4e46b2[_0x0a9e('0x42')],_0x4dc6b3[_0x0a9e('0x4d')]));_0x5ea541[_0x0a9e('0x4c')][_0x0a9e('0x63')]=_0x5a8854['id'];if(_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x5ea541[_0x0a9e('0x4c')]=_[_0x0a9e('0x53')](_0x5ea541[_0x0a9e('0x4c')],{'$or':_[_0x0a9e('0x50')](_0x5ea541[_0x0a9e('0x46')],function(_0x4989f9){var _0xc81b64={};_0xc81b64[_0x4989f9]={'$like':'%'+_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x4f')]+'%'};return _0xc81b64;})});}_0x5ea541=_[_0x0a9e('0x53')]({},_0x5ea541,_0x4e46b2[_0x0a9e('0x59')]);return db['CannedAnswer'][_0x0a9e('0x2c')]({'where':_0x5ea541[_0x0a9e('0x4c')]})['then'](function(_0x23b447){_0x81d748['count']=_0x23b447;if(_0x4e46b2[_0x0a9e('0x42')][_0x0a9e('0x54')]){_0x5ea541[_0x0a9e('0x55')]=[{'all':!![]}];}return db[_0x0a9e('0x69')]['findAll'](_0x5ea541);})[_0x0a9e('0x1d')](function(_0x4cf72d){_0x81d748[_0x0a9e('0x56')]=_0x4cf72d;return _0x81d748;});}})[_0x0a9e('0x1d')](respondWithFilteredResult(_0xf0a802,_0x5ea541))['catch'](handleError(_0xf0a802,null));};exports[_0x0a9e('0x6b')]=function(_0x63c9f7,_0x1dd541,_0x4ab276){return db['SmsAccount'][_0x0a9e('0x5d')]({'where':{'id':_0x63c9f7[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x1dd541,null))[_0x0a9e('0x1d')](function(_0x3f2f40){if(_0x3f2f40){return _0x3f2f40[_0x0a9e('0x6b')](_0x63c9f7[_0x0a9e('0x42')][_0x0a9e('0x67')]);}})[_0x0a9e('0x1d')](respondWithStatusCode(_0x1dd541,null))['catch'](handleError(_0x1dd541,null));};exports[_0x0a9e('0x6c')]=function(_0x517081,_0x287324,_0x2f7791){var _0x34e745={'channel':_0x0a9e('0x6d')};var _0x1b61d5=[];var _0x4e7273=[];var _0x436313={};return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x517081[_0x0a9e('0x58')]['id']},'include':[{'model':db[_0x0a9e('0x6e')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x287324,null))[_0x0a9e('0x1d')](function(_0x583662){_0x34e745[_0x0a9e('0x6f')]=_0x583662;_0x34e745[_0x0a9e('0x70')]=_[_0x0a9e('0x71')](_0x583662[_0x0a9e('0x72')],[_0x0a9e('0x73')],[_0x0a9e('0x74')]);if(_0x34e745['account']['Applications']){delete _0x34e745[_0x0a9e('0x6f')]['Applications'];}return db[_0x0a9e('0x75')]['describe']();})[_0x0a9e('0x1d')](function(_0x564db2){if(!_0x564db2){throw new db['Sequelize'][(_0x0a9e('0x76'))](_0x0a9e('0x77'));}_0x1b61d5=_['difference'](_[_0x0a9e('0x43')](_0x564db2),[_0x0a9e('0x78'),_0x0a9e('0x79')]);_0x4e7273=_[_0x0a9e('0x7a')](_[_0x0a9e('0x43')](_0x564db2),['createdAt','updatedAt',_0x0a9e('0x7b'),_0x0a9e('0x7c')]);_0x34e745[_0x0a9e('0x60')]={'mapKey':_0x0a9e('0x7d')};if(_0x34e745[_0x0a9e('0x6f')]['type']){switch(_0x34e745[_0x0a9e('0x6f')][_0x0a9e('0x51')]){case'twilio':_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x7f')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x80')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x81')]=_0x517081['body'][_0x0a9e('0x82')];break;case _0x0a9e('0x83'):_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')]='+'+_0x517081[_0x0a9e('0x60')]['sender'];_0x34e745['body'][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x84')];break;case _0x0a9e('0x85'):_0x34e745[_0x0a9e('0x60')]['from']=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x7e')];_0x34e745[_0x0a9e('0x60')]['body']=_0x517081[_0x0a9e('0x60')]['message'];break;case _0x0a9e('0x86'):_0x34e745['body'][_0x0a9e('0x7e')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x7e')];_0x34e745['body'][_0x0a9e('0x60')]=_0x517081['body'][_0x0a9e('0x60')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x81')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x87')];break;case _0x0a9e('0x88'):_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x7f')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x89')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x81')]=_0x517081['body']['MessageUUID'];break;case _0x0a9e('0x8a'):_0x34e745['body'][_0x0a9e('0x7e')]='+'+_0x517081[_0x0a9e('0x60')]['results'][0x0][_0x0a9e('0x7e')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')]['results'][0x0][_0x0a9e('0x84')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x81')]=_0x517081[_0x0a9e('0x60')]['results'][0x0][_0x0a9e('0x81')];break;case _0x0a9e('0x8b'):_0x34e745[_0x0a9e('0x60')]['from']=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x8c')];_0x34e745[_0x0a9e('0x60')]['body']=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x8d')][_0x0a9e('0x26')];break;case _0x0a9e('0x8e'):_0x34e745[_0x0a9e('0x60')]['from']=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x8f')];_0x34e745['body'][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x84')];_0x34e745['body']['messageId']=_0x517081['body'][_0x0a9e('0x90')];break;case _0x0a9e('0x91'):_0x34e745['body'][_0x0a9e('0x81')]=_0x517081[_0x0a9e('0x60')][0x0][_0x0a9e('0x26')]['id'];_0x34e745['body'][_0x0a9e('0x7e')]=_0x517081[_0x0a9e('0x60')][0x0][_0x0a9e('0x26')][_0x0a9e('0x7e')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][0x0][_0x0a9e('0x26')][_0x0a9e('0x84')];break;case'intelepeer':_0x34e745[_0x0a9e('0x60')]['from']=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x7e')];_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x26')];_0x34e745['body'][_0x0a9e('0x81')]=_0x517081[_0x0a9e('0x60')][_0x0a9e('0x92')];break;}}if(_0x34e745[_0x0a9e('0x60')]['id']){delete _0x34e745['body']['id'];}if(_[_0x0a9e('0x93')](_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')])){throw new db[(_0x0a9e('0x94'))][(_0x0a9e('0x76'))](_0x0a9e('0x95'));}if(_[_0x0a9e('0x93')](_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')])||_0x34e745[_0x0a9e('0x60')]['body']===''){throw new db[(_0x0a9e('0x94'))][(_0x0a9e('0x76'))](_0x0a9e('0x96'));}if(_[_0x0a9e('0x93')](_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x97')])){throw new db[(_0x0a9e('0x94'))][(_0x0a9e('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e7273);}if(!_[_0x0a9e('0x98')](_0x4e7273,_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x97')])){throw new db['Sequelize'][(_0x0a9e('0x76'))](_0x0a9e('0x99')+_0x4e7273);}_0x436313[_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x97')]]=_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')];return db[_0x0a9e('0x9a')][_0x0a9e('0x5d')]({'where':{'id':_0x34e745[_0x0a9e('0x6f')][_0x0a9e('0x7c')]},'include':[{'model':db['CmContact'],'as':_0x0a9e('0x9b'),'where':_0x436313,'limit':0x1,'order':[[_0x0a9e('0x79'),_0x0a9e('0x9c')]]}]});})[_0x0a9e('0x1d')](handleEntityNotFound(_0x287324,null))[_0x0a9e('0x1d')](function(_0x3942fd){if(_0x3942fd){_0x34e745['list']=_[_0x0a9e('0x9d')](_0x3942fd,['Contacts']);if(_0x3942fd['Contacts']['length']){return _0x3942fd[_0x0a9e('0x9b')][0x0];}var _0x3fa3f2=_[_0x0a9e('0x16')](_0x34e745[_0x0a9e('0x60')],{'firstName':_0x34e745['body'][_0x0a9e('0x7e')],'ListId':_0x3942fd['id']});_0x3fa3f2[_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x97')]]=_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')];return db['CmContact']['create'](_0x3fa3f2,{'fields':_0x1b61d5,'raw':!![]});}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x287324,null))[_0x0a9e('0x1d')](function(_0x2a293f){if(_0x2a293f){_0x34e745['contact']=_0x2a293f;var _0x319752={'ContactId':_0x2a293f['id'],'phone':_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x7e')],'SmsAccountId':_0x517081['params']['id']};var _0x8ad1c0={'ContactId':_0x2a293f['id'],'SmsAccountId':_0x517081[_0x0a9e('0x58')]['id'],'closed':![]};return db[_0x0a9e('0x9e')]['find']({'where':_0x8ad1c0})[_0x0a9e('0x1d')](function(_0x336b30){if(_0x336b30){return[_0x336b30,![]];}return db[_0x0a9e('0x9e')]['create'](_0x319752)['then'](function(_0x53ef46){return[_0x53ef46,!![]];});});}})[_0x0a9e('0x9f')](function(_0x1f50db,_0xcbc73c){_0x34e745[_0x0a9e('0xa0')]=_0x1f50db['get']({'plain':!![]});_0x34e745[_0x0a9e('0xa0')]['created']=![];if(_0xcbc73c){if(_0x34e745[_0x0a9e('0x6f')][_0x0a9e('0xa1')]){_0x34e745[_0x0a9e('0x70')]['push']({'id':0x0,'priority':_0x34e745[_0x0a9e('0x70')][_0x0a9e('0x47')]+0x1,'app':_0x0a9e('0xa2'),'appdata':'unmanaged','interval':_0x0a9e('0xa3')});}_0x34e745['interaction'][_0x0a9e('0xa4')]=!![];}return db['SmsMessage'][_0x0a9e('0x5a')]({'phone':_0x34e745['body'][_0x0a9e('0x7e')],'messageId':_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x81')],'body':_0x34e745[_0x0a9e('0x60')][_0x0a9e('0x60')],'SmsAccountId':_0x517081[_0x0a9e('0x58')]['id'],'SmsInteractionId':_0x1f50db['id'],'direction':'in','ContactId':_0x1f50db[_0x0a9e('0xa5')],'AttachmentId':_0x34e745['body'][_0x0a9e('0xa6')]});})[_0x0a9e('0x1d')](function(_0x567004){_0x34e745[_0x0a9e('0x26')]=_0x567004;if(_0x34e745[_0x0a9e('0xa0')]['UserId']){return db[_0x0a9e('0xa7')][_0x0a9e('0x5d')]({'attributes':['id',_0x0a9e('0x3a')],'where':{'id':_0x34e745['interaction'][_0x0a9e('0xa8')]}})[_0x0a9e('0x1d')](function(_0xdeb5e4){if(_0xdeb5e4){_0x34e745[_0x0a9e('0x70')][_0x0a9e('0xa9')]({'id':0x0,'priority':0x0,'app':_0x0a9e('0xaa'),'appdata':_0xdeb5e4[_0x0a9e('0x3a')]+','+(_0x34e745[_0x0a9e('0x6f')][_0x0a9e('0xab')]||0xa),'interval':_0x0a9e('0xa3')});}return respondWithRpcPromise('Start',_0x0a9e('0xac'),_0x34e745);});}return respondWithRpcPromise('Start',_0x0a9e('0xac'),_0x34e745);})[_0x0a9e('0x1d')](function(_0x5b9c76){if(_0x5b9c76){var _0x315e31=0xc8;var _0x5d577b=_0x0a9e('0xad');logger['info'](_0x0a9e('0x22'),_0x5d577b,_0x315e31,_0x0a9e('0xae'));logger[_0x0a9e('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x5d577b,_0x315e31,_0x0a9e('0xae'),JSON[_0x0a9e('0x23')](_0x5b9c76));if(_0x34e745[_0x0a9e('0x6f')][_0x0a9e('0x51')]===_0x0a9e('0xaf')){return _0x287324[_0x0a9e('0x2a')](_0x315e31)[_0x0a9e('0x2f')]('Content-Type',_0x0a9e('0xb0'))[_0x0a9e('0x3b')](_0x0a9e('0xb1'));}else{return _0x287324[_0x0a9e('0x2a')](_0x315e31)[_0x0a9e('0x30')](_0x5b9c76);}}})[_0x0a9e('0x28')](handleError(_0x287324,null));};exports[_0x0a9e('0xb2')]=function(_0x5d6a48,_0x5c8720,_0x10aa22){return db[_0x0a9e('0x3e')][_0x0a9e('0x6a')]({'where':{'id':_0x5d6a48[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x5c8720,null))[_0x0a9e('0x1d')](function(_0x609711){if(_0x609711){return db['sequelize'][_0x0a9e('0xb3')](function(_0x1d7fc4){return db[_0x0a9e('0x6e')][_0x0a9e('0x35')]({'where':{'SmsAccountId':_0x5d6a48[_0x0a9e('0x58')]['id']},'transaction':_0x1d7fc4})[_0x0a9e('0x1d')](function(_0x16be7e){var _0x54f0b8=_[_0x0a9e('0x50')](_0x5d6a48[_0x0a9e('0x60')],function(_0x231826){_0x231826['SmsAccountId']=_0x5d6a48[_0x0a9e('0x58')]['id'];return _0x231826;});return db[_0x0a9e('0x6e')][_0x0a9e('0xb4')](_0x54f0b8,{'transaction':_0x1d7fc4});});})[_0x0a9e('0x1d')](function(){return db['SmsApplication'][_0x0a9e('0xb5')]({'where':{'SmsAccountId':_0x5d6a48[_0x0a9e('0x58')]['id']},'order':_0x0a9e('0x73')});});}})[_0x0a9e('0x1d')](respondWithResult(_0x5c8720,null))[_0x0a9e('0x28')](handleError(_0x5c8720,null));};exports[_0x0a9e('0xb6')]=function(_0x3e365c,_0x385e5d,_0x4e5dec){var _0x3ede01={};var _0x266aa1={};var _0x25e41f;var _0x397771;return db['SmsAccount']['findOne']({'where':{'id':_0x3e365c[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x385e5d,null))[_0x0a9e('0x1d')](function(_0x596ba3){if(_0x596ba3){_0x25e41f=_0x596ba3;_0x266aa1[_0x0a9e('0x41')]=_[_0x0a9e('0x43')](db['SmsApplication'][_0x0a9e('0x3f')]);_0x266aa1['query']=_[_0x0a9e('0x43')](_0x3e365c['query']);_0x266aa1['filters']=_['intersection'](_0x266aa1[_0x0a9e('0x41')],_0x266aa1[_0x0a9e('0x42')]);_0x3ede01[_0x0a9e('0x46')]=_[_0x0a9e('0x44')](_0x266aa1[_0x0a9e('0x41')],qs[_0x0a9e('0x45')](_0x3e365c['query'][_0x0a9e('0x45')]));_0x3ede01[_0x0a9e('0x46')]=_0x3ede01[_0x0a9e('0x46')][_0x0a9e('0x47')]?_0x3ede01[_0x0a9e('0x46')]:_0x266aa1[_0x0a9e('0x41')];_0x3ede01[_0x0a9e('0x4a')]=qs['sort'](_0x3e365c['query'][_0x0a9e('0x4b')]);_0x3ede01['where']=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x4e')](_0x3e365c[_0x0a9e('0x42')],_0x266aa1[_0x0a9e('0x4d')]));if(_0x3e365c[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x3ede01['where']=_[_0x0a9e('0x53')](_0x3ede01['where'],{'$or':_['map'](_0x3ede01[_0x0a9e('0x46')],function(_0x593f9e){var _0x38dceb={};_0x38dceb[_0x593f9e]={'$like':'%'+_0x3e365c['query']['filter']+'%'};return _0x38dceb;})});}_0x3ede01=_[_0x0a9e('0x53')]({},_0x3ede01,_0x3e365c['options']);return _0x25e41f[_0x0a9e('0xb6')](_0x3ede01);}})[_0x0a9e('0x1d')](function(_0xe1ab0d){if(_0xe1ab0d){_0x397771=_0xe1ab0d['length'];if(!_0x3e365c[_0x0a9e('0x42')][_0x0a9e('0x48')](_0x0a9e('0x49'))){_0x3ede01['limit']=qs['limit'](_0x3e365c[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0x3ede01[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x3e365c[_0x0a9e('0x42')][_0x0a9e('0x2d')]);}return _0x25e41f[_0x0a9e('0xb6')](_0x3ede01);}})[_0x0a9e('0x1d')](function(_0x937b2a){if(_0x937b2a){return _0x937b2a?{'count':_0x397771,'rows':_0x937b2a}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x385e5d,null))['catch'](handleError(_0x385e5d,null));};exports['getInteractions']=function(_0x558171,_0x5975fa,_0x19dcc2){var _0x2ce30f={'raw':![],'where':{}};var _0x2d21c7={};var _0xb0e231={'count':0x0,'rows':[]};return db[_0x0a9e('0x3e')][_0x0a9e('0x6a')]({'where':{'id':_0x558171[_0x0a9e('0x58')]['id']}})['then'](handleEntityNotFound(_0x5975fa,null))['then'](function(_0x2869cc){if(_0x2869cc){_0x2d21c7[_0x0a9e('0x41')]=_['keys'](db[_0x0a9e('0x9e')][_0x0a9e('0x3f')]);_0x2d21c7[_0x0a9e('0x42')]=_[_0x0a9e('0x43')](_0x558171[_0x0a9e('0x42')]);_0x2d21c7[_0x0a9e('0x4d')]=_[_0x0a9e('0x44')](_0x2d21c7[_0x0a9e('0x41')],_0x2d21c7[_0x0a9e('0x42')]);_0x2ce30f[_0x0a9e('0x46')]=_[_0x0a9e('0x44')](_0x2d21c7[_0x0a9e('0x41')],qs['fields'](_0x558171[_0x0a9e('0x42')][_0x0a9e('0x45')]));_0x2ce30f[_0x0a9e('0x46')]=_0x2ce30f[_0x0a9e('0x46')][_0x0a9e('0x47')]?_0x2ce30f[_0x0a9e('0x46')]:_0x2d21c7[_0x0a9e('0x41')];if(!_0x558171[_0x0a9e('0x42')][_0x0a9e('0x48')](_0x0a9e('0x49'))){_0x2ce30f[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x558171['query']['limit']);_0x2ce30f[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x558171[_0x0a9e('0x42')][_0x0a9e('0x2d')]);}_0x2ce30f[_0x0a9e('0x4a')]=qs[_0x0a9e('0x4b')](_0x558171[_0x0a9e('0x42')]['sort']);_0x2ce30f[_0x0a9e('0x4c')]=qs['filters'](_[_0x0a9e('0x4e')](_0x558171[_0x0a9e('0x42')],_0x2d21c7[_0x0a9e('0x4d')]));_0x2ce30f[_0x0a9e('0x4c')][_0x0a9e('0x63')]=_0x2869cc['id'];if(_0x558171[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x2ce30f[_0x0a9e('0x4c')]=_[_0x0a9e('0x53')](_0x2ce30f[_0x0a9e('0x4c')],{'$or':_[_0x0a9e('0x50')](_0x2ce30f[_0x0a9e('0x46')],function(_0x43111e){var _0x3f7cb6={};_0x3f7cb6[_0x43111e]={'$like':'%'+_0x558171[_0x0a9e('0x42')][_0x0a9e('0x4f')]+'%'};return _0x3f7cb6;})});}_0x2ce30f=_['merge']({},_0x2ce30f,_0x558171['options']);return db[_0x0a9e('0x9e')][_0x0a9e('0x2c')]({'where':_0x2ce30f['where']})['then'](function(_0x2cb05c){_0xb0e231[_0x0a9e('0x2c')]=_0x2cb05c;if(_0x558171[_0x0a9e('0x42')]['includeAll']){_0x2ce30f[_0x0a9e('0x55')]=[{'model':db['CmContact'],'as':_0x0a9e('0xb7'),'required':![]},{'model':db['User'],'as':_0x0a9e('0xb8'),'attributes':['name',_0x0a9e('0xb9'),_0x0a9e('0xba')],'required':![]},{'model':db[_0x0a9e('0xbb')],'as':'Tags','attributes':['id',_0x0a9e('0x3a'),'color'],'where':_0x558171['query'][_0x0a9e('0xbc')]?{'id':_0x558171[_0x0a9e('0x42')][_0x0a9e('0xbc')]}:undefined,'required':_0x558171[_0x0a9e('0x42')][_0x0a9e('0xbc')]?!![]:![]}];}return db[_0x0a9e('0x9e')][_0x0a9e('0xbd')](_0x2ce30f);})[_0x0a9e('0x1d')](function(_0x1a3143){_0xb0e231[_0x0a9e('0x56')]=_0x1a3143;return _0xb0e231;});}})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x5975fa,_0x2ce30f))[_0x0a9e('0x28')](handleError(_0x5975fa,null));};exports[_0x0a9e('0x3b')]=function(_0x19487d,_0xdc4b2f,_0x65141c){var _0x310026,_0x643f66,_0x153de1;if(_['isNil'](_0x19487d[_0x0a9e('0x60')][_0x0a9e('0x60')])||_0x19487d[_0x0a9e('0x60')][_0x0a9e('0x60')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0a9e('0x93')](_0x19487d['body']['to'])){throw new db[(_0x0a9e('0x94'))][(_0x0a9e('0x76'))](_0x0a9e('0xbe'));}_0x310026=_0x19487d[_0x0a9e('0x60')]['to'];return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x19487d[_0x0a9e('0x58')]['id']},'include':[{'model':db[_0x0a9e('0x9a')],'as':_0x0a9e('0xbf'),'include':[{'model':db[_0x0a9e('0x75')],'as':'Contacts','where':{'mobile':_0x310026},'limit':0x1,'order':[[_0x0a9e('0x79'),'DESC']]}]}]})[_0x0a9e('0x1d')](handleEntityNotFound(_0xdc4b2f,null))['then'](function(_0xf4de86){if(_0xf4de86&&_0xf4de86[_0x0a9e('0xbf')]){_0x643f66=_0xf4de86[_0x0a9e('0x36')]({'plain':!![]});if(_0x643f66['List']&&_0x643f66[_0x0a9e('0xbf')][_0x0a9e('0x9b')]['length']){return _0x643f66['List'][_0x0a9e('0x9b')][0x0];}return db[_0x0a9e('0x75')][_0x0a9e('0x5a')](_['defaults'](_0x19487d['body'],{'firstName':_0x310026,'mobile':_0x310026,'phone':_0x310026,'ListId':_0x643f66['ListId']}));}})[_0x0a9e('0x1d')](handleEntityNotFound(_0xdc4b2f,null))[_0x0a9e('0x1d')](function(_0x2b7ba9){if(_0x2b7ba9){_0x153de1=_0x2b7ba9;return db[_0x0a9e('0x9e')][_0x0a9e('0x5d')]({'where':{'ContactId':_0x153de1['id'],'closed':![],'SmsAccountId':_0x643f66['id']}})[_0x0a9e('0x1d')](function(_0x183b9b){if(_0x183b9b){return[_0x183b9b,![]];}return db[_0x0a9e('0x9e')][_0x0a9e('0x5a')]({'UserId':_0x19487d[_0x0a9e('0xc0')]['id'],'ContactId':_0x153de1['id'],'SmsAccountId':_0x643f66['id'],'phone':_0x310026,'firstMsgDirection':_0x0a9e('0xc1'),'Messages':[_[_0x0a9e('0x53')](_0x19487d[_0x0a9e('0x60')],{'read':![],'body':_0x19487d[_0x0a9e('0x60')][_0x0a9e('0x60')],'phone':_0x310026,'SmsAccountId':_0x643f66['id'],'UserId':_0x19487d[_0x0a9e('0xc0')]['id'],'ContactId':_0x153de1['id']})]},{'include':[{'model':db[_0x0a9e('0xc2')],'as':_0x0a9e('0xc3')}]})['then'](function(_0xb33e27){return[_0xb33e27,!![]];});});}})[_0x0a9e('0x9f')](function(_0xf40862,_0x163c3f){if(_0x163c3f){return _0xf40862;}return db[_0x0a9e('0xc2')][_0x0a9e('0x5a')](_['merge'](_0x19487d[_0x0a9e('0x60')],{'read':![],'body':_0x19487d[_0x0a9e('0x60')][_0x0a9e('0x60')],'phone':_0x310026,'SmsAccountId':_0x643f66['id'],'SmsInteractionId':_0xf40862['id'],'UserId':_0x19487d[_0x0a9e('0xc0')]['id'],'ContactId':_0x153de1['id']}))[_0x0a9e('0x1d')](function(_0x3a7383){_0xf40862[_0x0a9e('0xc4')][_0x0a9e('0xc3')]=[];_0xf40862[_0x0a9e('0xc4')]['Messages']['push'](_0x3a7383[_0x0a9e('0xc4')]);return _0xf40862;});})[_0x0a9e('0x1d')](respondWithResult(_0xdc4b2f,null))['catch'](handleError(_0xdc4b2f,null));};exports[_0x0a9e('0x2a')]=function(_0x306aa5,_0x4c8d75,_0x1ca7c8){if(_0x306aa5['body']['id']){delete _0x306aa5[_0x0a9e('0x60')]['id'];}var _0x279c19,_0x58c53c,_0x27a41c;return db[_0x0a9e('0x3e')]['find']({'where':{'id':_0x306aa5[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4c8d75,null))['then'](function(_0x3259dc){if(_0x3259dc){_0x27a41c=_0x3259dc;logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0xc5'),_0x3259dc[_0x0a9e('0x51')],util['inspect'](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));switch(_0x3259dc[_0x0a9e('0x51')]){case'skebby':if(_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0xc6')]&&_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x2a')]){_0x58c53c=_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x2a')];return db[_0x0a9e('0xc2')]['find']({'where':{'messageId':_0x306aa5['body']['skebby_dispatch_id']}});}break;case'connectel':if(_0x306aa5['body'][_0x0a9e('0xc7')]&&_0x306aa5[_0x0a9e('0x60')]['statusInt']){_0x58c53c=_0x306aa5['body'][_0x0a9e('0xc8')];return db['SmsMessage'][_0x0a9e('0x5d')]({'where':{'messageId':_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0xc7')]}});}break;case _0x0a9e('0x86'):if(_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x87')]&&_0x306aa5['body'][_0x0a9e('0xc9')]){_0x58c53c=_0x306aa5[_0x0a9e('0x60')]['status_code'];return db[_0x0a9e('0xc2')][_0x0a9e('0x5d')]({'where':{'messageId':_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x87')]}});}break;case _0x0a9e('0x8a'):var _0x2f1cc0=_0x306aa5[_0x0a9e('0x60')]['results'][0x0];if(_0x2f1cc0[_0x0a9e('0x81')]&&_0x2f1cc0['status'][_0x0a9e('0xca')]===_0x0a9e('0xcb')){_0x58c53c=_0x2f1cc0['status'][_0x0a9e('0xca')];return db[_0x0a9e('0xc2')]['find']({'where':{'messageId':_0x2f1cc0[_0x0a9e('0x81')]}});}break;case'clickatell':if(_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x81')]&&_0x306aa5['body'][_0x0a9e('0x2a')]){_0x58c53c=_0x306aa5['body'][_0x0a9e('0x2a')];return db[_0x0a9e('0xc2')][_0x0a9e('0x5d')]({'where':{'messageId':_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x81')]}});}break;case _0x0a9e('0x91'):if(_0x306aa5[_0x0a9e('0x60')][0x0]['message']['id']){_0x58c53c=_0x306aa5[_0x0a9e('0x60')][0x0][_0x0a9e('0x51')];return db[_0x0a9e('0xc2')][_0x0a9e('0x5d')]({'where':{'messageId':_0x306aa5[_0x0a9e('0x60')][0x0]['message']['id']}});}break;case _0x0a9e('0xcc'):if(_0x306aa5['body']['redif']&&_0x306aa5[_0x0a9e('0x60')]['status']){_0x58c53c=_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0x2a')];return db['SmsMessage'][_0x0a9e('0x5d')]({'where':{'messageId':_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0xcd')]}});}break;}}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4c8d75,null))[_0x0a9e('0x1d')](function(_0x25eb44){if(_0x25eb44){_0x279c19=_0x25eb44;switch(_0x27a41c[_0x0a9e('0x51')]){case _0x0a9e('0x83'):if(_0x58c53c===_0x0a9e('0xcb')){return _0x279c19['update']({'read':!![]});}else{logger[_0x0a9e('0x24')](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0x83'),util['inspect'](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0a9e('0x85'):if(_0x58c53c==='1'){return _0x279c19[_0x0a9e('0x34')]({'read':!![]});}else{logger['error'](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0x83'),util['inspect'](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0xce')]&&_0x58c53c>=0xc8&&_0x58c53c<=0xce){return _0x279c19[_0x0a9e('0x34')]({'read':!![]});}else{logger[_0x0a9e('0x24')](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0x86'),util['inspect'](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0a9e('0x8a'):var _0x7c4db6=_0x306aa5[_0x0a9e('0x60')][_0x0a9e('0xcf')][0x0];if(_0x7c4db6[_0x0a9e('0x2a')][_0x0a9e('0xca')]===_0x0a9e('0xcb')){return _0x279c19[_0x0a9e('0x34')]({'read':!![]});}else{logger[_0x0a9e('0x24')](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0x8a'),util[_0x0a9e('0xd0')](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0a9e('0x8e'):if(_0x58c53c==_0x0a9e('0xd1')||_0x58c53c==_0x0a9e('0xd2')){return _0x279c19[_0x0a9e('0x34')]({'read':!![]});}else{logger[_0x0a9e('0x24')](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0x8e'),util['inspect'](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0a9e('0x91'):if(_0x58c53c==_0x0a9e('0xd3')){return _0x279c19['update']({'read':!![]});}else{logger[_0x0a9e('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0a9e('0x2a'),_0x0a9e('0x91'),util[_0x0a9e('0xd0')](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x0a9e('0xcc'):if(_0x58c53c===_0x0a9e('0xd4')||_0x58c53c===_0x0a9e('0xd5')){return _0x279c19[_0x0a9e('0x34')]({'read':!![]});}else{logger['error'](_0x0a9e('0x22'),_0x0a9e('0x2a'),'intelepeer',util[_0x0a9e('0xd0')](_0x306aa5[_0x0a9e('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x279c19;}})[_0x0a9e('0x1d')](respondWithResult(_0x4c8d75,null))['catch'](handleError(_0x4c8d75,null));};exports[_0x0a9e('0xd6')]=function(_0x4b7211,_0x315299,_0x1bf053){var _0x4803ce,_0x443208,_0x31648e;return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x4b7211[_0x0a9e('0x58')]['id']}})['then'](handleEntityNotFound(_0x315299,null))[_0x0a9e('0x1d')](function(_0x3fc431){if(_0x3fc431){_0x31648e=_0x3fc431;logger['debug'](_0x0a9e('0x22'),_0x0a9e('0x2a'),_0x0a9e('0xc5'),_0x3fc431['type'],util['inspect'](_0x4b7211[_0x0a9e('0x42')],{'showHidden':![],'depth':null}));switch(_0x3fc431[_0x0a9e('0x51')]){case _0x0a9e('0x8b'):if(_0x4b7211[_0x0a9e('0x42')][_0x0a9e('0xd7')]&&_0x4b7211[_0x0a9e('0x42')][_0x0a9e('0xd8')]){_0x443208=_0x4b7211[_0x0a9e('0x42')]['state'];return db['SmsMessage'][_0x0a9e('0x5d')]({'where':{'messageId':_0x4b7211['query'][_0x0a9e('0xd7')]}});}break;}}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x315299,null))[_0x0a9e('0x1d')](function(_0x413f0f){if(_0x413f0f){_0x4803ce=_0x413f0f;switch(_0x31648e['type']){case _0x0a9e('0x8b'):if(_0x443208==='2'||_0x443208==='6'){return _0x4803ce[_0x0a9e('0x34')]({'read':!![]});}else{logger['error'](_0x0a9e('0x22'),'status',_0x0a9e('0x8b'),util[_0x0a9e('0xd0')](_0x4b7211[_0x0a9e('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x4803ce;}})[_0x0a9e('0x1d')](respondWithResult(_0x315299,null))[_0x0a9e('0x28')](handleError(_0x315299,null));};exports[_0x0a9e('0xd9')]=function(_0x595efc,_0x16d50b,_0x580dd2){return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x595efc[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x16d50b,null))[_0x0a9e('0x1d')](function(_0x393e9c){if(_0x393e9c){return _0x393e9c[_0x0a9e('0xd9')](_0x595efc['body'][_0x0a9e('0x67')],_[_0x0a9e('0x9d')](_0x595efc[_0x0a9e('0x60')],[_0x0a9e('0x67'),'id'])||{})[_0x0a9e('0x9f')](function(_0x534f61){for(var _0x3cd588=0x0;_0x3cd588<_0x595efc[_0x0a9e('0x60')]['ids']['length'];_0x3cd588+=0x1){socket[_0x0a9e('0xda')](_0x0a9e('0xdb'),{'UserId':_0x595efc[_0x0a9e('0x60')][_0x0a9e('0x67')][_0x3cd588],'SmsAccountId':_0x595efc[_0x0a9e('0x58')]['id']});}return _0x534f61;});}})[_0x0a9e('0x1d')](respondWithResult(_0x16d50b,null))['catch'](handleError(_0x16d50b,null));};exports[_0x0a9e('0xdc')]=function(_0x13782b,_0x2a9f6e,_0x4bf3c7){return db[_0x0a9e('0x3e')][_0x0a9e('0x5d')]({'where':{'id':_0x13782b[_0x0a9e('0x58')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x2a9f6e,null))['then'](function(_0x5d4935){if(_0x5d4935){return _0x5d4935[_0x0a9e('0xdc')](_0x13782b[_0x0a9e('0x42')][_0x0a9e('0x67')])[_0x0a9e('0x1d')](function(){if(_[_0x0a9e('0xdd')](_0x13782b[_0x0a9e('0x42')][_0x0a9e('0x67')])){for(var _0x23dd12=0x0;_0x23dd12<_0x13782b['query'][_0x0a9e('0x67')]['length'];_0x23dd12+=0x1){socket[_0x0a9e('0xda')](_0x0a9e('0xde'),{'UserId':Number(_0x13782b[_0x0a9e('0x42')]['ids'][_0x23dd12]),'SmsAccountId':Number(_0x13782b['params']['id'])});}}else{socket[_0x0a9e('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x13782b[_0x0a9e('0x42')]['ids']),'SmsAccountId':Number(_0x13782b['params']['id'])});}});}})[_0x0a9e('0x1d')](respondWithStatusCode(_0x2a9f6e,null))[_0x0a9e('0x28')](handleError(_0x2a9f6e,null));};exports[_0x0a9e('0xdf')]=function(_0x2e6482,_0x1f0776,_0x2ac3dc){var _0x2f64ef={};var _0x36287b={};var _0x106e04;var _0x3b3e30;return db[_0x0a9e('0x3e')][_0x0a9e('0x6a')]({'where':{'id':_0x2e6482[_0x0a9e('0x58')]['id']}})['then'](handleEntityNotFound(_0x1f0776,null))['then'](function(_0x3bde76){if(_0x3bde76){_0x106e04=_0x3bde76;_0x36287b['model']=_[_0x0a9e('0x43')](db[_0x0a9e('0xa7')][_0x0a9e('0x3f')]);_0x36287b['query']=_['keys'](_0x2e6482[_0x0a9e('0x42')]);_0x36287b[_0x0a9e('0x4d')]=_[_0x0a9e('0x44')](_0x36287b[_0x0a9e('0x41')],_0x36287b[_0x0a9e('0x42')]);_0x2f64ef[_0x0a9e('0x46')]=_[_0x0a9e('0x44')](_0x36287b['model'],qs[_0x0a9e('0x45')](_0x2e6482['query'][_0x0a9e('0x45')]));_0x2f64ef[_0x0a9e('0x46')]=_0x2f64ef['attributes'][_0x0a9e('0x47')]?_0x2f64ef[_0x0a9e('0x46')]:_0x36287b[_0x0a9e('0x41')];_0x2f64ef[_0x0a9e('0x4a')]=qs[_0x0a9e('0x4b')](_0x2e6482[_0x0a9e('0x42')]['sort']);_0x2f64ef[_0x0a9e('0x4c')]=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x4e')](_0x2e6482['query'],_0x36287b[_0x0a9e('0x4d')]));if(_0x2e6482[_0x0a9e('0x42')][_0x0a9e('0x4f')]){_0x2f64ef['where']=_[_0x0a9e('0x53')](_0x2f64ef[_0x0a9e('0x4c')],{'$or':_[_0x0a9e('0x50')](_0x2f64ef[_0x0a9e('0x46')],function(_0x1d39bd){var _0x20a792={};_0x20a792[_0x1d39bd]={'$like':'%'+_0x2e6482['query']['filter']+'%'};return _0x20a792;})});}_0x2f64ef=_[_0x0a9e('0x53')]({},_0x2f64ef,_0x2e6482[_0x0a9e('0x59')]);return _0x106e04['getAgents'](_0x2f64ef);}})[_0x0a9e('0x1d')](function(_0x356370){if(_0x356370){_0x3b3e30=_0x356370[_0x0a9e('0x47')];if(!_0x2e6482[_0x0a9e('0x42')][_0x0a9e('0x48')](_0x0a9e('0x49'))){_0x2f64ef['limit']=qs[_0x0a9e('0x2e')](_0x2e6482[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0x2f64ef['offset']=qs[_0x0a9e('0x2d')](_0x2e6482[_0x0a9e('0x42')][_0x0a9e('0x2d')]);}return _0x106e04[_0x0a9e('0xdf')](_0x2f64ef);}})['then'](function(_0x49bb4f){if(_0x49bb4f){return _0x49bb4f?{'count':_0x3b3e30,'rows':_0x49bb4f}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x1f0776,null))[_0x0a9e('0x28')](handleError(_0x1f0776,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 40e1863..2dc821e 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 _0x3361=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x3361,0xcb));var _0x1336=function(_0x433f8e,_0x1ea762){_0x433f8e=_0x433f8e-0x0;var _0x1eb7d3=_0x3361[_0x433f8e];return _0x1eb7d3;};'use strict';var EventEmitter=require(_0x1336('0x0'));var SmsAccount=require(_0x1336('0x1'))['db'][_0x1336('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1336('0x3')](0x0);var events={'afterCreate':_0x1336('0x4'),'afterUpdate':_0x1336('0x5'),'afterDestroy':_0x1336('0x6')};function emitEvent(_0x8c178e){return function(_0x4ba176,_0x7891bb,_0x38ef5c){SmsAccountEvents[_0x1336('0x7')](_0x8c178e+':'+_0x4ba176['id'],_0x4ba176);SmsAccountEvents[_0x1336('0x7')](_0x8c178e,_0x4ba176);_0x38ef5c(null);};}for(var e in events){if(events[_0x1336('0x8')](e)){var event=events[e];SmsAccount[_0x1336('0x9')](e,emitEvent(event));}}module[_0x1336('0xa')]=SmsAccountEvents; \ No newline at end of file +var _0x1c78=['update','emit','exports','events','SmsAccount','setMaxListeners','save'];(function(_0x94ad78,_0x2833ac){var _0x5336d2=function(_0x2007e2){while(--_0x2007e2){_0x94ad78['push'](_0x94ad78['shift']());}};_0x5336d2(++_0x2833ac);}(_0x1c78,0x14c));var _0x81c7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1c78[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0x81c7('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x81c7('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x81c7('0x2')](0x0);var events={'afterCreate':_0x81c7('0x3'),'afterUpdate':_0x81c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4842cf){return function(_0x217f42,_0x5f3724,_0x18d036){SmsAccountEvents[_0x81c7('0x5')](_0x4842cf+':'+_0x217f42['id'],_0x217f42);SmsAccountEvents['emit'](_0x4842cf,_0x217f42);_0x18d036(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x81c7('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index bf016e2..ffcb777 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 _0x8eb7=['exports','SmsAccount','sms_accounts','lodash','util','api','path','rimraf','./smsAccount.attributes'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x8eb7,0x1f2));var _0x78eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8eb7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x78eb('0x0'));var util=require(_0x78eb('0x1'));var logger=require('../../config/logger')(_0x78eb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x78eb('0x3'));var rimraf=require(_0x78eb('0x4'));var config=require('../../config/environment');var attributes=require(_0x78eb('0x5'));module[_0x78eb('0x6')]=function(_0x23d22e,_0x33c478){return _0x23d22e['define'](_0x78eb('0x7'),attributes,{'tableName':_0x78eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fef=['path','rimraf','../../config/environment','exports','SmsAccount','lodash','../../config/logger','api','moment','request-promise'];(function(_0xf6a808,_0x50fe74){var _0x5db09e=function(_0x39432b){while(--_0x39432b){_0xf6a808['push'](_0xf6a808['shift']());}};_0x5db09e(++_0x50fe74);}(_0x0fef,0x1e5));var _0xf0fe=function(_0x1a127a,_0x42f6e6){_0x1a127a=_0x1a127a-0x0;var _0x2a724b=_0x0fef[_0x1a127a];return _0x2a724b;};'use strict';var _=require(_0xf0fe('0x0'));var util=require('util');var logger=require(_0xf0fe('0x1'))(_0xf0fe('0x2'));var moment=require(_0xf0fe('0x3'));var BPromise=require('bluebird');var rp=require(_0xf0fe('0x4'));var fs=require('fs');var path=require(_0xf0fe('0x5'));var rimraf=require(_0xf0fe('0x6'));var config=require(_0xf0fe('0x7'));var attributes=require('./smsAccount.attributes');module[_0xf0fe('0x8')]=function(_0x53c935,_0x523d82){return _0x53c935['define'](_0xf0fe('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 70e9f53..7f1748d 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 _0xe009=['SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','map','model','attributes','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','debug'];(function(_0x4220fa,_0x249d12){var _0x1af6a0=function(_0x1ac959){while(--_0x1ac959){_0x4220fa['push'](_0x4220fa['shift']());}};_0x1af6a0(++_0x249d12);}(_0xe009,0x7d));var _0x9e00=function(_0x101459,_0x2f7b72){_0x101459=_0x101459-0x0;var _0x52d82d=_0xe009[_0x101459];return _0x52d82d;};'use strict';var _=require('lodash');var util=require(_0x9e00('0x0'));var moment=require(_0x9e00('0x1'));var BPromise=require(_0x9e00('0x2'));var rs=require(_0x9e00('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e00('0x4'))['db'];var utils=require(_0x9e00('0x5'));var logger=require('../../config/logger')(_0x9e00('0x6'));var config=require(_0x9e00('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9e00('0x8')]({'port':0x232a});config[_0x9e00('0x9')]=_[_0x9e00('0xa')](config['redis'],{'host':_0x9e00('0xb'),'port':0x18eb});var socket=require(_0x9e00('0xc'))(new Redis(config[_0x9e00('0x9')]));require(_0x9e00('0xd'))[_0x9e00('0xe')](socket);function respondWithRpcPromise(_0x514ecb,_0x38a81f,_0x183a08){return new BPromise(function(_0x48a295,_0x180202){return client[_0x9e00('0xf')](_0x514ecb,_0x183a08)['then'](function(_0x2a1883){logger[_0x9e00('0x10')](_0x9e00('0x11'),_0x38a81f,'request\x20sent');logger[_0x9e00('0x12')](_0x9e00('0x13'),_0x38a81f,_0x9e00('0x14'),JSON['stringify'](_0x2a1883));if(_0x2a1883[_0x9e00('0x15')]){if(_0x2a1883[_0x9e00('0x15')]['code']===0x1f4){logger[_0x9e00('0x15')](_0x9e00('0x11'),_0x38a81f,_0x2a1883['error'][_0x9e00('0x16')]);return _0x180202(_0x2a1883['error'][_0x9e00('0x16')]);}logger['error'](_0x9e00('0x11'),_0x38a81f,_0x2a1883[_0x9e00('0x15')][_0x9e00('0x16')]);return _0x48a295(_0x2a1883[_0x9e00('0x15')][_0x9e00('0x16')]);}else{logger[_0x9e00('0x10')](_0x9e00('0x11'),_0x38a81f,_0x9e00('0x14'));_0x48a295(_0x2a1883[_0x9e00('0x17')][_0x9e00('0x16')]);}})[_0x9e00('0x18')](function(_0x5306ab){logger[_0x9e00('0x15')](_0x9e00('0x11'),_0x38a81f,_0x5306ab);_0x180202(_0x5306ab);});});}exports[_0x9e00('0x19')]=function(_0x4a10f7){var _0x412648=this;return new Promise(function(_0x49d2e7,_0x1aa0b8){return db[_0x9e00('0x1a')][_0x9e00('0x1b')]({'raw':_0x4a10f7[_0x9e00('0x1c')]?_0x4a10f7[_0x9e00('0x1c')][_0x9e00('0x1d')]===undefined?!![]:![]:!![],'where':_0x4a10f7['options']?_0x4a10f7[_0x9e00('0x1c')][_0x9e00('0x1e')]||null:null,'attributes':_0x4a10f7[_0x9e00('0x1c')]?_0x4a10f7['options']['attributes']||null:null,'include':_0x4a10f7['options']?_0x4a10f7[_0x9e00('0x1c')][_0x9e00('0x1f')]?_[_0x9e00('0x20')](_0x4a10f7[_0x9e00('0x1c')][_0x9e00('0x1f')],function(_0x1b12f0){return{'model':db[_0x1b12f0[_0x9e00('0x21')]],'as':_0x1b12f0['as'],'attributes':_0x1b12f0[_0x9e00('0x22')],'include':_0x1b12f0['include']?_[_0x9e00('0x20')](_0x1b12f0['include'],function(_0x257337){return{'model':db[_0x257337['model']],'as':_0x257337['as'],'attributes':_0x257337[_0x9e00('0x22')],'include':_0x257337[_0x9e00('0x1f')]?_[_0x9e00('0x20')](_0x257337[_0x9e00('0x1f')],function(_0x37ff01){return{'model':db[_0x37ff01[_0x9e00('0x21')]],'as':_0x37ff01['as'],'attributes':_0x37ff01[_0x9e00('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9e00('0x23')](function(_0x2ad001){logger[_0x9e00('0x10')](_0x9e00('0x19'),_0x4a10f7);logger[_0x9e00('0x12')](_0x9e00('0x19'),_0x4a10f7,JSON['stringify'](_0x2ad001));_0x49d2e7(_0x2ad001);})[_0x9e00('0x18')](function(_0x42ece3){logger['error'](_0x9e00('0x19'),_0x42ece3[_0x9e00('0x16')],_0x4a10f7);_0x1aa0b8(_0x412648[_0x9e00('0x15')](0x1f4,_0x42ece3['message']));});});}; \ No newline at end of file +var _0x20d3=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount'];(function(_0x1df956,_0x2944cd){var _0x2eadc7=function(_0x3bfa3b){while(--_0x3bfa3b){_0x1df956['push'](_0x1df956['shift']());}};_0x2eadc7(++_0x2944cd);}(_0x20d3,0x1b1));var _0x320d=function(_0xaa4e61,_0x31a904){_0xaa4e61=_0xaa4e61-0x0;var _0xaa37c5=_0x20d3[_0xaa4e61];return _0xaa37c5;};'use strict';var _=require('lodash');var util=require(_0x320d('0x0'));var moment=require(_0x320d('0x1'));var BPromise=require(_0x320d('0x2'));var rs=require(_0x320d('0x3'));var fs=require('fs');var Redis=require(_0x320d('0x4'));var db=require(_0x320d('0x5'))['db'];var utils=require(_0x320d('0x6'));var logger=require(_0x320d('0x7'))(_0x320d('0x8'));var config=require(_0x320d('0x9'));var jayson=require(_0x320d('0xa'));var client=jayson[_0x320d('0xb')][_0x320d('0xc')]({'port':0x232a});config[_0x320d('0xd')]=_['defaults'](config[_0x320d('0xd')],{'host':_0x320d('0xe'),'port':0x18eb});var socket=require(_0x320d('0xf'))(new Redis(config[_0x320d('0xd')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3846ec,_0x4c65c8,_0x35ef62){return new BPromise(function(_0x491a8f,_0x2ac8ff){return client['request'](_0x3846ec,_0x35ef62)[_0x320d('0x10')](function(_0x347f23){logger[_0x320d('0x11')](_0x320d('0x12'),_0x4c65c8,_0x320d('0x13'));logger[_0x320d('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4c65c8,_0x320d('0x13'),JSON[_0x320d('0x15')](_0x347f23));if(_0x347f23[_0x320d('0x16')]){if(_0x347f23[_0x320d('0x16')]['code']===0x1f4){logger['error'](_0x320d('0x12'),_0x4c65c8,_0x347f23[_0x320d('0x16')]['message']);return _0x2ac8ff(_0x347f23['error'][_0x320d('0x17')]);}logger['error'](_0x320d('0x12'),_0x4c65c8,_0x347f23['error'][_0x320d('0x17')]);return _0x491a8f(_0x347f23['error']['message']);}else{logger[_0x320d('0x11')](_0x320d('0x12'),_0x4c65c8,_0x320d('0x13'));_0x491a8f(_0x347f23[_0x320d('0x18')]['message']);}})['catch'](function(_0x5202b3){logger[_0x320d('0x16')](_0x320d('0x12'),_0x4c65c8,_0x5202b3);_0x2ac8ff(_0x5202b3);});});}exports['ShowSmsAccount']=function(_0x467c49){var _0x13696c=this;return new Promise(function(_0x2b567c,_0x4d14fe){return db[_0x320d('0x19')][_0x320d('0x1a')]({'raw':_0x467c49[_0x320d('0x1b')]?_0x467c49[_0x320d('0x1b')][_0x320d('0x1c')]===undefined?!![]:![]:!![],'where':_0x467c49['options']?_0x467c49[_0x320d('0x1b')][_0x320d('0x1d')]||null:null,'attributes':_0x467c49[_0x320d('0x1b')]?_0x467c49[_0x320d('0x1b')][_0x320d('0x1e')]||null:null,'include':_0x467c49[_0x320d('0x1b')]?_0x467c49[_0x320d('0x1b')][_0x320d('0x1f')]?_[_0x320d('0x20')](_0x467c49[_0x320d('0x1b')]['include'],function(_0x1c2665){return{'model':db[_0x1c2665[_0x320d('0x21')]],'as':_0x1c2665['as'],'attributes':_0x1c2665[_0x320d('0x1e')],'include':_0x1c2665[_0x320d('0x1f')]?_['map'](_0x1c2665[_0x320d('0x1f')],function(_0x4b0705){return{'model':db[_0x4b0705['model']],'as':_0x4b0705['as'],'attributes':_0x4b0705[_0x320d('0x1e')],'include':_0x4b0705[_0x320d('0x1f')]?_[_0x320d('0x20')](_0x4b0705[_0x320d('0x1f')],function(_0xf3e7c8){return{'model':db[_0xf3e7c8[_0x320d('0x21')]],'as':_0xf3e7c8['as'],'attributes':_0xf3e7c8['attributes']};}):[]};}):[]};}):[]:[]})[_0x320d('0x10')](function(_0x30cc96){logger[_0x320d('0x11')](_0x320d('0x22'),_0x467c49);logger[_0x320d('0x14')](_0x320d('0x22'),_0x467c49,JSON[_0x320d('0x15')](_0x30cc96));_0x2b567c(_0x30cc96);})[_0x320d('0x23')](function(_0xfd02ac){logger['error'](_0x320d('0x22'),_0xfd02ac['message'],_0x467c49);_0x4d14fe(_0x13696c[_0x320d('0x16')](0x1f4,_0xfd02ac[_0x320d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 9c8087f..f4dc9a2 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 _0x2a5c=['register','smsAccount:','./smsAccount.events','save','remove','update','emit'];(function(_0x239a32,_0x5801e5){var _0x3eda54=function(_0x29f462){while(--_0x29f462){_0x239a32['push'](_0x239a32['shift']());}};_0x3eda54(++_0x5801e5);}(_0x2a5c,0x1f3));var _0xc2a5=function(_0x3aee88,_0x4de241){_0x3aee88=_0x3aee88-0x0;var _0x49fc7c=_0x2a5c[_0x3aee88];return _0x49fc7c;};'use strict';var SmsAccountEvents=require(_0xc2a5('0x0'));var events=[_0xc2a5('0x1'),_0xc2a5('0x2'),_0xc2a5('0x3')];function createListener(_0x438609,_0x53281f){return function(_0x3de54b){_0x53281f[_0xc2a5('0x4')](_0x438609,_0x3de54b);};}function removeListener(_0x247498,_0x98b693){return function(){SmsAccountEvents['removeListener'](_0x247498,_0x98b693);};}exports[_0xc2a5('0x5')]=function(_0x4b84ea){for(var _0x106832=0x0,_0x350b2d=events['length'];_0x106832<_0x350b2d;_0x106832++){var _0x50de53=events[_0x106832];var _0x3a3cfb=createListener(_0xc2a5('0x6')+_0x50de53,_0x4b84ea);SmsAccountEvents['on'](_0x50de53,_0x3a3cfb);}}; \ No newline at end of file +var _0x0c6b=['removeListener','register','smsAccount:','./smsAccount.events','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c6b,0x1bc));var _0xb0c6=function(_0x4ab0b1,_0x517f28){_0x4ab0b1=_0x4ab0b1-0x0;var _0x5ba852=_0x0c6b[_0x4ab0b1];return _0x5ba852;};'use strict';var SmsAccountEvents=require(_0xb0c6('0x0'));var events=['save',_0xb0c6('0x1'),_0xb0c6('0x2')];function createListener(_0x91fc99,_0x1270f1){return function(_0x92bcd2){_0x1270f1[_0xb0c6('0x3')](_0x91fc99,_0x92bcd2);};}function removeListener(_0x433b9a,_0x36600d){return function(){SmsAccountEvents[_0xb0c6('0x4')](_0x433b9a,_0x36600d);};}exports[_0xb0c6('0x5')]=function(_0xc26f64){for(var _0x56c7c9=0x0,_0x590ef9=events['length'];_0x56c7c9<_0x590ef9;_0x56c7c9++){var _0x4e1245=events[_0x56c7c9];var _0x3f18bd=createListener(_0xb0c6('0x6')+_0x4e1245,_0xc26f64);SmsAccountEvents['on'](_0x4e1245,_0x3f18bd);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 4094d06..2381bc0 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 _0x5878=['isAuthenticated','index','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get'];(function(_0x28b4a0,_0x26fa4b){var _0x58bd7e=function(_0x2cdf5a){while(--_0x2cdf5a){_0x28b4a0['push'](_0x28b4a0['shift']());}};_0x58bd7e(++_0x26fa4b);}(_0x5878,0xbc));var _0x8587=function(_0x1627bd,_0x301b8d){_0x1627bd=_0x1627bd-0x0;var _0x43a3c3=_0x5878[_0x1627bd];return _0x43a3c3;};'use strict';var multer=require(_0x8587('0x0'));var util=require(_0x8587('0x1'));var path=require(_0x8587('0x2'));var timeout=require(_0x8587('0x3'));var express=require(_0x8587('0x4'));var router=express[_0x8587('0x5')]();var fs_extra=require(_0x8587('0x6'));var auth=require(_0x8587('0x7'));var interaction=require(_0x8587('0x8'));var config=require(_0x8587('0x9'));var controller=require(_0x8587('0xa'));router[_0x8587('0xb')]('/',auth[_0x8587('0xc')](),controller[_0x8587('0xd')]);router[_0x8587('0xb')]('/:id',auth[_0x8587('0xc')](),controller['show']);router['post']('/',auth[_0x8587('0xc')](),controller[_0x8587('0xe')]);router[_0x8587('0xf')](_0x8587('0x10'),auth[_0x8587('0xc')](),controller[_0x8587('0x11')]);router[_0x8587('0x12')]('/:id',auth[_0x8587('0xc')](),controller['destroy']);module[_0x8587('0x13')]=router; \ No newline at end of file +var _0xff61=['post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index'];(function(_0xc52364,_0x4076ca){var _0x4171d3=function(_0x5466f3){while(--_0x5466f3){_0xc52364['push'](_0xc52364['shift']());}};_0x4171d3(++_0x4076ca);}(_0xff61,0x182));var _0x1ff6=function(_0x5bb73e,_0x208b1f){_0x5bb73e=_0x5bb73e-0x0;var _0x45a8f3=_0xff61[_0x5bb73e];return _0x45a8f3;};'use strict';var multer=require(_0x1ff6('0x0'));var util=require(_0x1ff6('0x1'));var path=require('path');var timeout=require(_0x1ff6('0x2'));var express=require(_0x1ff6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1ff6('0x4'));var config=require(_0x1ff6('0x5'));var controller=require(_0x1ff6('0x6'));router[_0x1ff6('0x7')]('/',auth[_0x1ff6('0x8')](),controller[_0x1ff6('0x9')]);router[_0x1ff6('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1ff6('0xa')]('/',auth[_0x1ff6('0x8')](),controller[_0x1ff6('0xb')]);router[_0x1ff6('0xc')](_0x1ff6('0xd'),auth[_0x1ff6('0x8')](),controller[_0x1ff6('0xe')]);router[_0x1ff6('0xf')](_0x1ff6('0xd'),auth['isAuthenticated'](),controller[_0x1ff6('0x10')]);module[_0x1ff6('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index acda501..dea4baf 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 _0x2110=['sequelize','exports','STRING','TEXT','*,*,*,*'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2110,0x9b));var _0x0211=function(_0x596828,_0x4a0d72){_0x596828=_0x596828-0x0;var _0x24f8e4=_0x2110[_0x596828];return _0x24f8e4;};'use strict';var Sequelize=require(_0x0211('0x0'));module[_0x0211('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0211('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0211('0x3')]()},'description':{'type':Sequelize[_0x0211('0x2')]},'interval':{'type':Sequelize[_0x0211('0x2')],'defaultValue':_0x0211('0x4')}}; \ No newline at end of file +var _0x68ea=['INTEGER','STRING','TEXT','sequelize'];(function(_0x19fb0d,_0x1525e8){var _0x210140=function(_0x3c5739){while(--_0x3c5739){_0x19fb0d['push'](_0x19fb0d['shift']());}};_0x210140(++_0x1525e8);}(_0x68ea,0x1b7));var _0xa68e=function(_0x4c21ee,_0x217ce3){_0x4c21ee=_0x4c21ee-0x0;var _0x34e9dc=_0x68ea[_0x4c21ee];return _0x34e9dc;};'use strict';var Sequelize=require(_0xa68e('0x0'));module['exports']={'priority':{'type':Sequelize[_0xa68e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa68e('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa68e('0x3')]()},'description':{'type':Sequelize[_0xa68e('0x2')]},'interval':{'type':Sequelize[_0xa68e('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c93f058..7db53c1 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 _0xc163=['include','findAll','rows','show','params','catch','create','body','update','find','destroy','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll'];(function(_0xbe302f,_0x34ee04){var _0x9b7c88=function(_0x427d62){while(--_0x427d62){_0xbe302f['push'](_0xbe302f['shift']());}};_0x9b7c88(++_0x34ee04);}(_0xc163,0xa1));var _0x3c16=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc163[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3c16('0x0'));var rimraf=require(_0x3c16('0x1'));var zipdir=require(_0x3c16('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c16('0x3'));var Mustache=require(_0x3c16('0x4'));var util=require('util');var path=require(_0x3c16('0x5'));var sox=require(_0x3c16('0x6'));var csv=require(_0x3c16('0x7'));var ejs=require(_0x3c16('0x8'));var fs=require('fs');var fs_extra=require(_0x3c16('0x9'));var _=require(_0x3c16('0xa'));var squel=require(_0x3c16('0xb'));var crypto=require(_0x3c16('0xc'));var jsforce=require(_0x3c16('0xd'));var deskjs=require(_0x3c16('0xe'));var toCsv=require(_0x3c16('0x7'));var querystring=require(_0x3c16('0xf'));var Papa=require('papaparse');var Redis=require(_0x3c16('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3c16('0x11'));var as=require(_0x3c16('0x12'));var hardwareService=require(_0x3c16('0x13'));var logger=require('../../config/logger')(_0x3c16('0x14'));var utils=require('../../config/utils');var config=require(_0x3c16('0x15'));var licenseUtil=require(_0x3c16('0x16'));var db=require(_0x3c16('0x17'))['db'];function respondWithStatusCode(_0x2bba7d,_0x4c93d8){_0x4c93d8=_0x4c93d8||0xcc;return function(_0x44a804){if(_0x44a804){return _0x2bba7d['sendStatus'](_0x4c93d8);}return _0x2bba7d[_0x3c16('0x18')](_0x4c93d8)[_0x3c16('0x19')]();};}function respondWithResult(_0x52c8e3,_0x501585){_0x501585=_0x501585||0xc8;return function(_0x46187b){if(_0x46187b){return _0x52c8e3[_0x3c16('0x18')](_0x501585)[_0x3c16('0x1a')](_0x46187b);}};}function respondWithFilteredResult(_0x23e49d,_0xf838e8){return function(_0x14a3d0){if(_0x14a3d0){var _0x3cd6ec=_0x14a3d0[_0x3c16('0x1b')],_0x8cff6=_0xf838e8[_0x3c16('0x1c')],_0x4c32f1=_0xf838e8[_0x3c16('0x1c')]+_0xf838e8['limit'],_0x420c42;if(_0x4c32f1>=_0x3cd6ec){_0x4c32f1=_0x3cd6ec;_0x420c42=0xc8;}else{_0x420c42=0xce;}_0x23e49d[_0x3c16('0x18')](_0x420c42);return _0x23e49d[_0x3c16('0x1d')](_0x3c16('0x1e'),_0x8cff6+'-'+_0x4c32f1+'/'+_0x3cd6ec)[_0x3c16('0x1a')](_0x14a3d0);}return null;};}function patchUpdates(_0x5663a1){return function(_0x2ce22e){try{jsonpatch[_0x3c16('0x1f')](_0x2ce22e,_0x5663a1,!![]);}catch(_0x1018a7){return BPromise[_0x3c16('0x20')](_0x1018a7);}return _0x2ce22e[_0x3c16('0x21')]();};}function saveUpdates(_0x3e0624,_0x5e2242){return function(_0x42b9a0){if(_0x42b9a0){return _0x42b9a0['update'](_0x3e0624)[_0x3c16('0x22')](function(_0x4d59f2){return _0x4d59f2;});}return null;};}function removeEntity(_0x43603b,_0x550480){return function(_0x13611f){if(_0x13611f){return _0x13611f['destroy']()[_0x3c16('0x22')](function(){_0x43603b['status'](0xcc)[_0x3c16('0x19')]();});}};}function handleEntityNotFound(_0x5cb01a,_0x484ff3){return function(_0x404b9a){if(!_0x404b9a){_0x5cb01a[_0x3c16('0x23')](0x194);}return _0x404b9a;};}function handleError(_0x56491f,_0x2541c7){_0x2541c7=_0x2541c7||0x1f4;return function(_0x3edd48){logger[_0x3c16('0x24')](_0x3edd48[_0x3c16('0x25')]);if(_0x3edd48[_0x3c16('0x26')]){delete _0x3edd48[_0x3c16('0x26')];}_0x56491f[_0x3c16('0x18')](_0x2541c7)['send'](_0x3edd48);};}exports[_0x3c16('0x27')]=function(_0x3abc80,_0x24cc26){var _0x395d5f={},_0xa518a9={},_0x245be9={'count':0x0,'rows':[]};var _0x4411a2=_[_0x3c16('0x28')](db[_0x3c16('0x29')][_0x3c16('0x2a')],function(_0xe4b62a){return{'name':_0xe4b62a[_0x3c16('0x2b')],'type':_0xe4b62a[_0x3c16('0x2c')][_0x3c16('0x2d')]};});_0xa518a9[_0x3c16('0x2e')]=_[_0x3c16('0x28')](_0x4411a2,_0x3c16('0x26'));_0xa518a9['query']=_[_0x3c16('0x2f')](_0x3abc80[_0x3c16('0x30')]);_0xa518a9['filters']=_[_0x3c16('0x31')](_0xa518a9['model'],_0xa518a9[_0x3c16('0x30')]);_0x395d5f['attributes']=_[_0x3c16('0x31')](_0xa518a9[_0x3c16('0x2e')],qs['fields'](_0x3abc80[_0x3c16('0x30')][_0x3c16('0x32')]));_0x395d5f['attributes']=_0x395d5f[_0x3c16('0x33')][_0x3c16('0x34')]?_0x395d5f[_0x3c16('0x33')]:_0xa518a9[_0x3c16('0x2e')];if(!_0x3abc80[_0x3c16('0x30')]['hasOwnProperty'](_0x3c16('0x35'))){_0x395d5f['limit']=qs['limit'](_0x3abc80[_0x3c16('0x30')][_0x3c16('0x36')]);_0x395d5f['offset']=qs['offset'](_0x3abc80[_0x3c16('0x30')][_0x3c16('0x1c')]);}_0x395d5f[_0x3c16('0x37')]=qs['sort'](_0x3abc80[_0x3c16('0x30')][_0x3c16('0x38')]);_0x395d5f[_0x3c16('0x39')]=qs[_0x3c16('0x3a')](_[_0x3c16('0x3b')](_0x3abc80[_0x3c16('0x30')],_0xa518a9[_0x3c16('0x3a')]),_0x4411a2);if(_0x3abc80[_0x3c16('0x30')]['filter']){_0x395d5f[_0x3c16('0x39')]=_[_0x3c16('0x3c')](_0x395d5f[_0x3c16('0x39')],{'$or':_[_0x3c16('0x28')](_0x4411a2,function(_0x3dbdac){if(_0x3dbdac[_0x3c16('0x2c')]!==_0x3c16('0x3d')){var _0x29ac27={};_0x29ac27[_0x3dbdac['name']]={'$like':'%'+_0x3abc80[_0x3c16('0x30')]['filter']+'%'};return _0x29ac27;}})});}_0x395d5f=_['merge']({},_0x395d5f,_0x3abc80[_0x3c16('0x3e')]);var _0x51f79f={'where':_0x395d5f[_0x3c16('0x39')]};return db[_0x3c16('0x29')]['count'](_0x51f79f)['then'](function(_0x2632db){_0x245be9[_0x3c16('0x1b')]=_0x2632db;if(_0x3abc80[_0x3c16('0x30')][_0x3c16('0x3f')]){_0x395d5f[_0x3c16('0x40')]=[{'all':!![]}];}return db['SmsApplication'][_0x3c16('0x41')](_0x395d5f);})[_0x3c16('0x22')](function(_0x188a4d){_0x245be9[_0x3c16('0x42')]=_0x188a4d;return _0x245be9;})['then'](respondWithFilteredResult(_0x24cc26,_0x395d5f))['catch'](handleError(_0x24cc26,null));};exports[_0x3c16('0x43')]=function(_0x2c22ed,_0x24564){var _0x46787c={'raw':!![],'where':{'id':_0x2c22ed[_0x3c16('0x44')]['id']}},_0x472560={};_0x472560[_0x3c16('0x2e')]=_['keys'](db[_0x3c16('0x29')][_0x3c16('0x2a')]);_0x472560['query']=_[_0x3c16('0x2f')](_0x2c22ed[_0x3c16('0x30')]);_0x472560[_0x3c16('0x3a')]=_['intersection'](_0x472560[_0x3c16('0x2e')],_0x472560['query']);_0x46787c[_0x3c16('0x33')]=_[_0x3c16('0x31')](_0x472560[_0x3c16('0x2e')],qs['fields'](_0x2c22ed[_0x3c16('0x30')][_0x3c16('0x32')]));_0x46787c[_0x3c16('0x33')]=_0x46787c[_0x3c16('0x33')]['length']?_0x46787c[_0x3c16('0x33')]:_0x472560[_0x3c16('0x2e')];if(_0x2c22ed[_0x3c16('0x30')]['includeAll']){_0x46787c[_0x3c16('0x40')]=[{'all':!![]}];}_0x46787c=_['merge']({},_0x46787c,_0x2c22ed[_0x3c16('0x3e')]);return db['SmsApplication']['find'](_0x46787c)[_0x3c16('0x22')](handleEntityNotFound(_0x24564,null))[_0x3c16('0x22')](respondWithResult(_0x24564,null))[_0x3c16('0x45')](handleError(_0x24564,null));};exports[_0x3c16('0x46')]=function(_0x23ce0c,_0x565f74){return db['SmsApplication']['create'](_0x23ce0c[_0x3c16('0x47')],{})[_0x3c16('0x22')](respondWithResult(_0x565f74,0xc9))['catch'](handleError(_0x565f74,null));};exports[_0x3c16('0x48')]=function(_0x2ca7cc,_0x236e9e){if(_0x2ca7cc[_0x3c16('0x47')]['id']){delete _0x2ca7cc[_0x3c16('0x47')]['id'];}return db[_0x3c16('0x29')][_0x3c16('0x49')]({'where':{'id':_0x2ca7cc[_0x3c16('0x44')]['id']}})[_0x3c16('0x22')](handleEntityNotFound(_0x236e9e,null))['then'](saveUpdates(_0x2ca7cc[_0x3c16('0x47')],null))['then'](respondWithResult(_0x236e9e,null))[_0x3c16('0x45')](handleError(_0x236e9e,null));};exports[_0x3c16('0x4a')]=function(_0x78fabc,_0x3fca49){return db[_0x3c16('0x29')][_0x3c16('0x49')]({'where':{'id':_0x78fabc[_0x3c16('0x44')]['id']}})[_0x3c16('0x22')](handleEntityNotFound(_0x3fca49,null))[_0x3c16('0x22')](removeEntity(_0x3fca49,null))['catch'](handleError(_0x3fca49,null));}; \ No newline at end of file +var _0xaf1b=['sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','show','params','fields','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x491ff4,_0x1c83fd){var _0x223621=function(_0x71f8b3){while(--_0x71f8b3){_0x491ff4['push'](_0x491ff4['shift']());}};_0x223621(++_0x1c83fd);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x2ab9af,_0x4f02dc){_0x2ab9af=_0x2ab9af-0x0;var _0x5bed91=_0xaf1b[_0x2ab9af];return _0x5bed91;};'use strict';var emlformat=require(_0xbaf1('0x0'));var rimraf=require(_0xbaf1('0x1'));var zipdir=require(_0xbaf1('0x2'));var jsonpatch=require(_0xbaf1('0x3'));var rp=require(_0xbaf1('0x4'));var moment=require(_0xbaf1('0x5'));var BPromise=require(_0xbaf1('0x6'));var Mustache=require(_0xbaf1('0x7'));var util=require(_0xbaf1('0x8'));var path=require(_0xbaf1('0x9'));var sox=require(_0xbaf1('0xa'));var csv=require(_0xbaf1('0xb'));var ejs=require(_0xbaf1('0xc'));var fs=require('fs');var fs_extra=require(_0xbaf1('0xd'));var _=require('lodash');var squel=require(_0xbaf1('0xe'));var crypto=require('crypto');var jsforce=require(_0xbaf1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbaf1('0xb'));var querystring=require(_0xbaf1('0x10'));var Papa=require(_0xbaf1('0x11'));var Redis=require('ioredis');var authService=require(_0xbaf1('0x12'));var qs=require(_0xbaf1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbaf1('0x14'));var logger=require('../../config/logger')(_0xbaf1('0x15'));var utils=require(_0xbaf1('0x16'));var config=require(_0xbaf1('0x17'));var licenseUtil=require(_0xbaf1('0x18'));var db=require(_0xbaf1('0x19'))['db'];function respondWithStatusCode(_0x36ec1c,_0x50de02){_0x50de02=_0x50de02||0xcc;return function(_0x493f3f){if(_0x493f3f){return _0x36ec1c[_0xbaf1('0x1a')](_0x50de02);}return _0x36ec1c[_0xbaf1('0x1b')](_0x50de02)[_0xbaf1('0x1c')]();};}function respondWithResult(_0xb6f7d8,_0x1d94da){_0x1d94da=_0x1d94da||0xc8;return function(_0x1097d6){if(_0x1097d6){return _0xb6f7d8[_0xbaf1('0x1b')](_0x1d94da)['json'](_0x1097d6);}};}function respondWithFilteredResult(_0x32981b,_0x173cb6){return function(_0xb9ac72){if(_0xb9ac72){var _0x342c11=_0xb9ac72[_0xbaf1('0x1d')],_0x305c91=_0x173cb6['offset'],_0x25458f=_0x173cb6[_0xbaf1('0x1e')]+_0x173cb6['limit'],_0x199252;if(_0x25458f>=_0x342c11){_0x25458f=_0x342c11;_0x199252=0xc8;}else{_0x199252=0xce;}_0x32981b[_0xbaf1('0x1b')](_0x199252);return _0x32981b[_0xbaf1('0x1f')](_0xbaf1('0x20'),_0x305c91+'-'+_0x25458f+'/'+_0x342c11)[_0xbaf1('0x21')](_0xb9ac72);}return null;};}function patchUpdates(_0x498435){return function(_0x43291c){try{jsonpatch['apply'](_0x43291c,_0x498435,!![]);}catch(_0x2ac412){return BPromise[_0xbaf1('0x22')](_0x2ac412);}return _0x43291c['save']();};}function saveUpdates(_0xd579de,_0x33c524){return function(_0x4f6761){if(_0x4f6761){return _0x4f6761[_0xbaf1('0x23')](_0xd579de)[_0xbaf1('0x24')](function(_0x1111f2){return _0x1111f2;});}return null;};}function removeEntity(_0x5b9f50,_0x487d25){return function(_0x3cb56b){if(_0x3cb56b){return _0x3cb56b[_0xbaf1('0x25')]()[_0xbaf1('0x24')](function(){_0x5b9f50['status'](0xcc)[_0xbaf1('0x1c')]();});}};}function handleEntityNotFound(_0xefc243,_0x40a0fa){return function(_0x5794f9){if(!_0x5794f9){_0xefc243[_0xbaf1('0x1a')](0x194);}return _0x5794f9;};}function handleError(_0x5ef6db,_0x1e7847){_0x1e7847=_0x1e7847||0x1f4;return function(_0x181c9d){logger[_0xbaf1('0x26')](_0x181c9d[_0xbaf1('0x27')]);if(_0x181c9d[_0xbaf1('0x28')]){delete _0x181c9d['name'];}_0x5ef6db['status'](_0x1e7847)[_0xbaf1('0x29')](_0x181c9d);};}exports[_0xbaf1('0x2a')]=function(_0x33abc0,_0x1bba2c){var _0x4f202f={},_0xa313ec={},_0x5959d0={'count':0x0,'rows':[]};var _0x24ca92=_[_0xbaf1('0x2b')](db[_0xbaf1('0x2c')][_0xbaf1('0x2d')],function(_0x2ccd80){return{'name':_0x2ccd80[_0xbaf1('0x2e')],'type':_0x2ccd80[_0xbaf1('0x2f')]['key']};});_0xa313ec[_0xbaf1('0x30')]=_[_0xbaf1('0x2b')](_0x24ca92,_0xbaf1('0x28'));_0xa313ec[_0xbaf1('0x31')]=_[_0xbaf1('0x32')](_0x33abc0[_0xbaf1('0x31')]);_0xa313ec[_0xbaf1('0x33')]=_[_0xbaf1('0x34')](_0xa313ec['model'],_0xa313ec[_0xbaf1('0x31')]);_0x4f202f[_0xbaf1('0x35')]=_[_0xbaf1('0x34')](_0xa313ec[_0xbaf1('0x30')],qs['fields'](_0x33abc0[_0xbaf1('0x31')]['fields']));_0x4f202f[_0xbaf1('0x35')]=_0x4f202f['attributes'][_0xbaf1('0x36')]?_0x4f202f[_0xbaf1('0x35')]:_0xa313ec[_0xbaf1('0x30')];if(!_0x33abc0[_0xbaf1('0x31')]['hasOwnProperty'](_0xbaf1('0x37'))){_0x4f202f[_0xbaf1('0x38')]=qs[_0xbaf1('0x38')](_0x33abc0[_0xbaf1('0x31')][_0xbaf1('0x38')]);_0x4f202f[_0xbaf1('0x1e')]=qs[_0xbaf1('0x1e')](_0x33abc0['query'][_0xbaf1('0x1e')]);}_0x4f202f[_0xbaf1('0x39')]=qs[_0xbaf1('0x3a')](_0x33abc0[_0xbaf1('0x31')][_0xbaf1('0x3a')]);_0x4f202f[_0xbaf1('0x3b')]=qs[_0xbaf1('0x33')](_['pick'](_0x33abc0[_0xbaf1('0x31')],_0xa313ec['filters']),_0x24ca92);if(_0x33abc0[_0xbaf1('0x31')][_0xbaf1('0x3c')]){_0x4f202f[_0xbaf1('0x3b')]=_[_0xbaf1('0x3d')](_0x4f202f[_0xbaf1('0x3b')],{'$or':_[_0xbaf1('0x2b')](_0x24ca92,function(_0x9bf5c0){if(_0x9bf5c0[_0xbaf1('0x2f')]!==_0xbaf1('0x3e')){var _0x5d26a6={};_0x5d26a6[_0x9bf5c0['name']]={'$like':'%'+_0x33abc0['query'][_0xbaf1('0x3c')]+'%'};return _0x5d26a6;}})});}_0x4f202f=_[_0xbaf1('0x3d')]({},_0x4f202f,_0x33abc0['options']);var _0x2adc26={'where':_0x4f202f[_0xbaf1('0x3b')]};return db[_0xbaf1('0x2c')]['count'](_0x2adc26)[_0xbaf1('0x24')](function(_0x17ca34){_0x5959d0[_0xbaf1('0x1d')]=_0x17ca34;if(_0x33abc0['query'][_0xbaf1('0x3f')]){_0x4f202f[_0xbaf1('0x40')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x4f202f);})[_0xbaf1('0x24')](function(_0x4ca174){_0x5959d0['rows']=_0x4ca174;return _0x5959d0;})['then'](respondWithFilteredResult(_0x1bba2c,_0x4f202f))[_0xbaf1('0x41')](handleError(_0x1bba2c,null));};exports[_0xbaf1('0x42')]=function(_0x644721,_0x27c821){var _0x9d38ba={'raw':!![],'where':{'id':_0x644721[_0xbaf1('0x43')]['id']}},_0x394814={};_0x394814[_0xbaf1('0x30')]=_['keys'](db[_0xbaf1('0x2c')][_0xbaf1('0x2d')]);_0x394814[_0xbaf1('0x31')]=_[_0xbaf1('0x32')](_0x644721['query']);_0x394814[_0xbaf1('0x33')]=_['intersection'](_0x394814[_0xbaf1('0x30')],_0x394814[_0xbaf1('0x31')]);_0x9d38ba[_0xbaf1('0x35')]=_['intersection'](_0x394814[_0xbaf1('0x30')],qs[_0xbaf1('0x44')](_0x644721[_0xbaf1('0x31')]['fields']));_0x9d38ba[_0xbaf1('0x35')]=_0x9d38ba['attributes']['length']?_0x9d38ba['attributes']:_0x394814[_0xbaf1('0x30')];if(_0x644721[_0xbaf1('0x31')][_0xbaf1('0x3f')]){_0x9d38ba[_0xbaf1('0x40')]=[{'all':!![]}];}_0x9d38ba=_[_0xbaf1('0x3d')]({},_0x9d38ba,_0x644721[_0xbaf1('0x45')]);return db['SmsApplication'][_0xbaf1('0x46')](_0x9d38ba)[_0xbaf1('0x24')](handleEntityNotFound(_0x27c821,null))[_0xbaf1('0x24')](respondWithResult(_0x27c821,null))[_0xbaf1('0x41')](handleError(_0x27c821,null));};exports[_0xbaf1('0x47')]=function(_0x21cf40,_0x57101c){return db[_0xbaf1('0x2c')]['create'](_0x21cf40['body'],{})[_0xbaf1('0x24')](respondWithResult(_0x57101c,0xc9))[_0xbaf1('0x41')](handleError(_0x57101c,null));};exports[_0xbaf1('0x23')]=function(_0x43a8a1,_0x34e289){if(_0x43a8a1['body']['id']){delete _0x43a8a1[_0xbaf1('0x48')]['id'];}return db['SmsApplication'][_0xbaf1('0x46')]({'where':{'id':_0x43a8a1[_0xbaf1('0x43')]['id']}})[_0xbaf1('0x24')](handleEntityNotFound(_0x34e289,null))[_0xbaf1('0x24')](saveUpdates(_0x43a8a1[_0xbaf1('0x48')],null))[_0xbaf1('0x24')](respondWithResult(_0x34e289,null))[_0xbaf1('0x41')](handleError(_0x34e289,null));};exports[_0xbaf1('0x25')]=function(_0x3a1f4d,_0x245a1d){return db[_0xbaf1('0x2c')][_0xbaf1('0x46')]({'where':{'id':_0x3a1f4d[_0xbaf1('0x43')]['id']}})[_0xbaf1('0x24')](handleEntityNotFound(_0x245a1d,null))[_0xbaf1('0x24')](removeEntity(_0x245a1d,null))[_0xbaf1('0x41')](handleError(_0x245a1d,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 57eb789..5898aa9 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 _0x7db6=['utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsApplication'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x7db6,0xf1));var _0x67db=function(_0xe57a68,_0x21a065){_0xe57a68=_0xe57a68-0x0;var _0x202391=_0x7db6[_0xe57a68];return _0x202391;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x67db('0x0'));var moment=require(_0x67db('0x1'));var BPromise=require(_0x67db('0x2'));var rp=require(_0x67db('0x3'));var fs=require('fs');var path=require(_0x67db('0x4'));var rimraf=require(_0x67db('0x5'));var config=require(_0x67db('0x6'));var attributes=require('./smsApplication.attributes');module['exports']=function(_0x5b7a77,_0x263ab6){return _0x5b7a77[_0x67db('0x7')](_0x67db('0x8'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x67db('0x9')});}; \ No newline at end of file +var _0x6a0b=['SmsApplication','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x270ffc,_0x5c388c){var _0x401e5e=function(_0x3f7bdb){while(--_0x3f7bdb){_0x270ffc['push'](_0x270ffc['shift']());}};_0x401e5e(++_0x5c388c);}(_0x6a0b,0x1db));var _0xb6a0=function(_0x2fd148,_0x2b978c){_0x2fd148=_0x2fd148-0x0;var _0x313244=_0x6a0b[_0x2fd148];return _0x313244;};'use strict';var _=require(_0xb6a0('0x0'));var util=require(_0xb6a0('0x1'));var logger=require('../../config/logger')(_0xb6a0('0x2'));var moment=require(_0xb6a0('0x3'));var BPromise=require(_0xb6a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb6a0('0x5'));var attributes=require(_0xb6a0('0x6'));module[_0xb6a0('0x7')]=function(_0x156238,_0x578846){return _0x156238[_0xb6a0('0x8')](_0xb6a0('0x9'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb6a0('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 669854e..e8f5649 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 _0x046b=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','moment','bluebird'];(function(_0x58e331,_0x3e7165){var _0x16f0dc=function(_0xeea11e){while(--_0xeea11e){_0x58e331['push'](_0x58e331['shift']());}};_0x16f0dc(++_0x3e7165);}(_0x046b,0x147));var _0xb046=function(_0x4aa0c7,_0x5959da){_0x4aa0c7=_0x4aa0c7-0x0;var _0x2ff444=_0x046b[_0x4aa0c7];return _0x2ff444;};'use strict';var _=require('lodash');var util=require(_0xb046('0x0'));var moment=require(_0xb046('0x1'));var BPromise=require(_0xb046('0x2'));var rs=require(_0xb046('0x3'));var fs=require('fs');var Redis=require(_0xb046('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb046('0x5'));var logger=require(_0xb046('0x6'))(_0xb046('0x7'));var config=require(_0xb046('0x8'));var jayson=require(_0xb046('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13203d,_0x1f00c8,_0x190c9a){return new BPromise(function(_0x308e79,_0x3c0678){return client[_0xb046('0xa')](_0x13203d,_0x190c9a)[_0xb046('0xb')](function(_0x170b66){logger['info'](_0xb046('0xc'),_0x1f00c8,'request\x20sent');logger[_0xb046('0xd')](_0xb046('0xe'),_0x1f00c8,_0xb046('0xf'),JSON[_0xb046('0x10')](_0x170b66));if(_0x170b66[_0xb046('0x11')]){if(_0x170b66['error']['code']===0x1f4){logger['error'](_0xb046('0xc'),_0x1f00c8,_0x170b66[_0xb046('0x11')]['message']);return _0x3c0678(_0x170b66[_0xb046('0x11')]['message']);}logger[_0xb046('0x11')](_0xb046('0xc'),_0x1f00c8,_0x170b66['error'][_0xb046('0x12')]);return _0x308e79(_0x170b66[_0xb046('0x11')][_0xb046('0x12')]);}else{logger[_0xb046('0x13')](_0xb046('0xc'),_0x1f00c8,'request\x20sent');_0x308e79(_0x170b66[_0xb046('0x14')][_0xb046('0x12')]);}})[_0xb046('0x15')](function(_0xa3b910){logger[_0xb046('0x11')](_0xb046('0xc'),_0x1f00c8,_0xa3b910);_0x3c0678(_0xa3b910);});});} \ No newline at end of file +var _0x8781=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0x8781,0x1c8));var _0x1878=function(_0x5e33ab,_0x1d797e){_0x5e33ab=_0x5e33ab-0x0;var _0x54887=_0x8781[_0x5e33ab];return _0x54887;};'use strict';var _=require(_0x1878('0x0'));var util=require(_0x1878('0x1'));var moment=require(_0x1878('0x2'));var BPromise=require(_0x1878('0x3'));var rs=require(_0x1878('0x4'));var fs=require('fs');var Redis=require(_0x1878('0x5'));var db=require(_0x1878('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1878('0x7'))(_0x1878('0x8'));var config=require(_0x1878('0x9'));var jayson=require(_0x1878('0xa'));var client=jayson[_0x1878('0xb')][_0x1878('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d2374,_0x3f62d9,_0x393fff){return new BPromise(function(_0x25441c,_0x46cd98){return client[_0x1878('0xd')](_0x4d2374,_0x393fff)[_0x1878('0xe')](function(_0x2756b4){logger[_0x1878('0xf')](_0x1878('0x10'),_0x3f62d9,_0x1878('0x11'));logger[_0x1878('0x12')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x3f62d9,_0x1878('0x11'),JSON[_0x1878('0x13')](_0x2756b4));if(_0x2756b4[_0x1878('0x14')]){if(_0x2756b4[_0x1878('0x14')]['code']===0x1f4){logger['error'](_0x1878('0x10'),_0x3f62d9,_0x2756b4[_0x1878('0x14')][_0x1878('0x15')]);return _0x46cd98(_0x2756b4[_0x1878('0x14')]['message']);}logger['error'](_0x1878('0x10'),_0x3f62d9,_0x2756b4[_0x1878('0x14')]['message']);return _0x25441c(_0x2756b4[_0x1878('0x14')][_0x1878('0x15')]);}else{logger[_0x1878('0xf')]('SmsApplication,\x20%s,\x20%s',_0x3f62d9,'request\x20sent');_0x25441c(_0x2756b4[_0x1878('0x16')][_0x1878('0x15')]);}})[_0x1878('0x17')](function(_0x43b85e){logger[_0x1878('0x14')](_0x1878('0x10'),_0x3f62d9,_0x43b85e);_0x46cd98(_0x43b85e);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index c09febf..3b0e587 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 _0xe1c4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','sms','smsinteraction:addtags','addTags','put','tracked','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path'];(function(_0x42cb1f,_0x52d875){var _0x34926f=function(_0x2d8e99){while(--_0x2d8e99){_0x42cb1f['push'](_0x42cb1f['shift']());}};_0x34926f(++_0x52d875);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x5779be,_0x52d30d){_0x5779be=_0x5779be-0x0;var _0x28e499=_0xe1c4[_0x5779be];return _0x28e499;};'use strict';var multer=require(_0x4e1c('0x0'));var util=require(_0x4e1c('0x1'));var path=require(_0x4e1c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e1c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4e1c('0x4'));var interaction=require(_0x4e1c('0x5'));var config=require(_0x4e1c('0x6'));var controller=require('./smsInteraction.controller');router['get']('/',auth[_0x4e1c('0x7')](),controller[_0x4e1c('0x8')]);router[_0x4e1c('0x9')](_0x4e1c('0xa'),auth[_0x4e1c('0x7')](),controller[_0x4e1c('0xb')]);router[_0x4e1c('0x9')](_0x4e1c('0xc'),auth[_0x4e1c('0x7')](),controller[_0x4e1c('0xd')]);router[_0x4e1c('0x9')](_0x4e1c('0xe'),auth[_0x4e1c('0x7')](),controller['getMessages']);router[_0x4e1c('0x9')](_0x4e1c('0xf'),auth['isAuthenticated'](),controller[_0x4e1c('0x10')]);router[_0x4e1c('0x11')]('/',auth[_0x4e1c('0x7')](),controller[_0x4e1c('0x12')]);router['post'](_0x4e1c('0xe'),auth[_0x4e1c('0x7')](),controller[_0x4e1c('0x13')]);router[_0x4e1c('0x11')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0x4e1c('0x14'),_0x4e1c('0x15')),controller[_0x4e1c('0x16')]);router[_0x4e1c('0x17')]('/:id',auth[_0x4e1c('0x7')](),interaction[_0x4e1c('0x18')](_0x4e1c('0x14'),_0x4e1c('0x19')),controller[_0x4e1c('0x1a')]);router[_0x4e1c('0x1b')]('/:id',auth[_0x4e1c('0x7')](),interaction[_0x4e1c('0x18')](_0x4e1c('0x14'),_0x4e1c('0x1c')),controller[_0x4e1c('0x1d')]);router[_0x4e1c('0x1b')](_0x4e1c('0x1e'),auth['isAuthenticated'](),controller[_0x4e1c('0x1f')]);module[_0x4e1c('0x20')]=router; \ No newline at end of file +var _0xb491=['addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post'];(function(_0x8e2ca2,_0x2d307a){var _0x25eef2=function(_0x4845fe){while(--_0x4845fe){_0x8e2ca2['push'](_0x8e2ca2['shift']());}};_0x25eef2(++_0x2d307a);}(_0xb491,0x18c));var _0x1b49=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0xb491[_0x122e9b];return _0x22c247;};'use strict';var multer=require(_0x1b49('0x0'));var util=require(_0x1b49('0x1'));var path=require(_0x1b49('0x2'));var timeout=require(_0x1b49('0x3'));var express=require(_0x1b49('0x4'));var router=express[_0x1b49('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1b49('0x6'));var interaction=require(_0x1b49('0x7'));var config=require('../../config/environment');var controller=require(_0x1b49('0x8'));router[_0x1b49('0x9')]('/',auth[_0x1b49('0xa')](),controller['index']);router[_0x1b49('0x9')]('/describe',auth[_0x1b49('0xa')](),controller[_0x1b49('0xb')]);router[_0x1b49('0x9')](_0x1b49('0xc'),auth[_0x1b49('0xa')](),controller[_0x1b49('0xd')]);router[_0x1b49('0x9')](_0x1b49('0xe'),auth[_0x1b49('0xa')](),controller[_0x1b49('0xf')]);router[_0x1b49('0x9')](_0x1b49('0x10'),auth[_0x1b49('0xa')](),controller[_0x1b49('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1b49('0x12')]);router[_0x1b49('0x13')](_0x1b49('0xe'),auth[_0x1b49('0xa')](),controller[_0x1b49('0x14')]);router['post'](_0x1b49('0x15'),auth['isAuthenticated'](),interaction[_0x1b49('0x16')](_0x1b49('0x17'),_0x1b49('0x18')),controller[_0x1b49('0x19')]);router['put'](_0x1b49('0xc'),auth[_0x1b49('0xa')](),interaction[_0x1b49('0x16')](_0x1b49('0x17'),_0x1b49('0x1a')),controller[_0x1b49('0x1b')]);router[_0x1b49('0x1c')](_0x1b49('0xc'),auth['isAuthenticated'](),interaction[_0x1b49('0x16')](_0x1b49('0x17'),'smsinteraction:destroy'),controller[_0x1b49('0x1d')]);router[_0x1b49('0x1c')](_0x1b49('0x15'),auth[_0x1b49('0xa')](),controller[_0x1b49('0x1e')]);module[_0x1b49('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 9615d60..44d8d65 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 _0xfda2=['STRING','DATE','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x59d037,_0x284418){var _0x39e79a=function(_0x49ea7c){while(--_0x49ea7c){_0x59d037['push'](_0x59d037['shift']());}};_0x39e79a(++_0x284418);}(_0xfda2,0x84));var _0x2fda=function(_0x403545,_0x1ea4f1){_0x403545=_0x403545-0x0;var _0x1873ca=_0xfda2[_0x403545];return _0x1873ca;};'use strict';var Sequelize=require(_0x2fda('0x0'));var moment=require(_0x2fda('0x1'));module[_0x2fda('0x2')]={'closed':{'type':Sequelize[_0x2fda('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2fda('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2fda('0x4')]},'note':{'type':Sequelize[_0x2fda('0x4')]},'phone':{'type':Sequelize[_0x2fda('0x4')]},'read1stAt':{'type':Sequelize[_0x2fda('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x2fda('0x6')]('in',_0x2fda('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2fda('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x2fda('0x6')]('in',_0x2fda('0x7')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xab03=['out','sequelize','moment','exports','DATE','STRING','ENUM'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xab03,0x17b));var _0x3ab0=function(_0x284ba2,_0x594a49){_0x284ba2=_0x284ba2-0x0;var _0x1c8bc3=_0xab03[_0x284ba2];return _0x1c8bc3;};'use strict';var Sequelize=require(_0x3ab0('0x0'));var moment=require(_0x3ab0('0x1'));module[_0x3ab0('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3ab0('0x3')]},'disposition':{'type':Sequelize[_0x3ab0('0x4')]},'secondDisposition':{'type':Sequelize[_0x3ab0('0x4')]},'thirdDisposition':{'type':Sequelize[_0x3ab0('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x3ab0('0x4')]},'read1stAt':{'type':Sequelize[_0x3ab0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x3ab0('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3ab0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3ab0('0x5')]('in',_0x3ab0('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 90bbf1c..2008ca6 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 _0x9957=['sms_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','count','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','catch','rawAttributes','includeAll','include','create','destroy','params','describe','SmsMessage','addMessage','ids','omit','getMessages','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','spread','findAll','emit','download','unix','files','tmp','join','server','attachments','format','transcript-%d-%s.zip','CmContact','Contact','lastName','Messages','secret','Owner','get','Sms','Account','N.A.','closed','closedAt','disposition','direction','out','System','renderFile','root','views','downloadInteraction.html','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','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','../../components/export/pdf','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','fullname','TagIds','forEach','Tags','push','index','map','SmsInteraction','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','field','color','tools_tags','select','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','from'];(function(_0x1f4c19,_0x8f569f){var _0x393640=function(_0x3d4b8e){while(--_0x3d4b8e){_0x1f4c19['push'](_0x1f4c19['shift']());}};_0x393640(++_0x8f569f);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 pdf=require(_0x7995('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7995('0x17'))(_0x7995('0x18'));var utils=require('../../config/utils');var config=require(_0x7995('0x19'));var licenseUtil=require(_0x7995('0x1a'));var db=require(_0x7995('0x1b'))['db'];config[_0x7995('0x1c')]=_[_0x7995('0x1d')](config[_0x7995('0x1c')],{'host':_0x7995('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7995('0x1f'))[_0x7995('0x20')](socket);function respondWithStatusCode(_0x24b5bb,_0x321ae8){_0x321ae8=_0x321ae8||0xcc;return function(_0x3f1d3e){if(_0x3f1d3e){return _0x24b5bb[_0x7995('0x21')](_0x321ae8);}return _0x24b5bb[_0x7995('0x22')](_0x321ae8)[_0x7995('0x23')]();};}function respondWithResult(_0x5377e5,_0x2eeacc){_0x2eeacc=_0x2eeacc||0xc8;return function(_0x565d97){if(_0x565d97){return _0x5377e5[_0x7995('0x22')](_0x2eeacc)[_0x7995('0x24')](_0x565d97);}};}function respondWithFilteredResult(_0x43d4b8,_0x291317){return function(_0x1e1415){if(_0x1e1415){var _0x37a7d4=_0x1e1415['count'],_0x4faa60=_0x291317['offset'],_0x54c9ae=_0x291317[_0x7995('0x25')]+_0x291317[_0x7995('0x26')],_0x2536c8;if(_0x54c9ae>=_0x37a7d4){_0x54c9ae=_0x37a7d4;_0x2536c8=0xc8;}else{_0x2536c8=0xce;}_0x43d4b8['status'](_0x2536c8);return _0x43d4b8[_0x7995('0x27')]('Content-Range',_0x4faa60+'-'+_0x54c9ae+'/'+_0x37a7d4)['json'](_0x1e1415);}return null;};}function patchUpdates(_0x3e4c54){return function(_0x327b1f){try{jsonpatch[_0x7995('0x28')](_0x327b1f,_0x3e4c54,!![]);}catch(_0x1a8568){return BPromise[_0x7995('0x29')](_0x1a8568);}return _0x327b1f[_0x7995('0x2a')]();};}function saveUpdates(_0x5d40ae,_0x32a09a){return function(_0x46ee4b){if(_0x46ee4b){return _0x46ee4b[_0x7995('0x2b')](_0x5d40ae)[_0x7995('0x2c')](function(_0x563799){return _0x563799;});}return null;};}function removeEntity(_0x13bc35,_0x475351){return function(_0x472195){if(_0x472195){return _0x472195['destroy']()[_0x7995('0x2c')](function(){_0x13bc35[_0x7995('0x22')](0xcc)[_0x7995('0x23')]();});}};}function handleEntityNotFound(_0x268ce7,_0x3a3fcf){return function(_0x2a307e){if(!_0x2a307e){_0x268ce7['sendStatus'](0x194);}return _0x2a307e;};}function handleError(_0x47625f,_0x5911c3){_0x5911c3=_0x5911c3||0x1f4;return function(_0x229742){logger[_0x7995('0x2d')](_0x229742[_0x7995('0x2e')]);if(_0x229742[_0x7995('0x2f')]){delete _0x229742[_0x7995('0x2f')];}_0x47625f['status'](_0x5911c3)[_0x7995('0x30')](_0x229742);};}function getInteractionUsers(_0x514445,_0x456a28){return new BPromise(function(_0x3250e0,_0x4253e5){try{if(_0x456a28[_0x514445['id']]){_0x514445['Users']=_['map'](_0x456a28[_0x514445['id']],function(_0x48e573){return{'id':_0x48e573['id'],'fullname':_0x48e573[_0x7995('0x31')]};});}}catch(_0xe6b0b3){_0x4253e5(_0xe6b0b3);}_0x3250e0(_0x514445);});}function getInteractionTags(_0x327a81,_0x2b874d){return new BPromise(function(_0x2e3493,_0x1ca460){try{if(_0x327a81['TagIds']){_0x327a81['Tags']=[];_0x327a81[_0x7995('0x32')]['split'](',')[_0x7995('0x33')](function(_0x3eb566){_0x327a81[_0x7995('0x34')][_0x7995('0x35')](_0x2b874d[_0x3eb566]);});}delete _0x327a81[_0x7995('0x32')];}catch(_0x510841){_0x1ca460(_0x510841);}_0x2e3493(_0x327a81);});}function updateSmsInteraction(_0x44309d,_0x33e24e,_0x5dd802){return new BPromise(function(_0x48db25,_0x577412){return getInteractionUsers(_0x44309d,_0x5dd802)[_0x7995('0x2c')](function(_0x3acfc3){return getInteractionTags(_0x3acfc3,_0x33e24e);})['then'](function(_0x3e7020){_0x48db25(_0x3e7020);})['catch'](function(_0x37917b){_0x577412(_0x37917b);});});}exports[_0x7995('0x36')]=function(_0x177cb4,_0x5014d2){var _0x52d76d={},_0x36d057={},_0x5e67fe={'count':0x0,'rows':[]};var _0x5d2428=_[_0x7995('0x37')](db[_0x7995('0x38')]['rawAttributes'],function(_0x1baa15){return{'name':_0x1baa15[_0x7995('0x39')],'type':_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]};});_0x36d057[_0x7995('0x3c')]=_['map'](_0x5d2428,_0x7995('0x2f'));_0x36d057[_0x7995('0x3d')]=_[_0x7995('0x3e')](_0x177cb4[_0x7995('0x3d')]);_0x36d057['filters']=_[_0x7995('0x3f')](_0x36d057[_0x7995('0x3c')],_0x36d057[_0x7995('0x3d')]);_0x52d76d[_0x7995('0x40')]=_[_0x7995('0x3f')](_0x36d057[_0x7995('0x3c')],qs['fields'](_0x177cb4[_0x7995('0x3d')][_0x7995('0x41')]));_0x52d76d[_0x7995('0x40')]=_0x52d76d[_0x7995('0x40')][_0x7995('0x42')]?_0x52d76d[_0x7995('0x40')]:_0x36d057[_0x7995('0x3c')];if(!_0x177cb4[_0x7995('0x3d')][_0x7995('0x43')](_0x7995('0x44'))){_0x52d76d[_0x7995('0x26')]=qs[_0x7995('0x26')](_0x177cb4[_0x7995('0x3d')]['limit']);_0x52d76d['offset']=qs[_0x7995('0x25')](_0x177cb4[_0x7995('0x3d')]['offset']);}_0x52d76d['order']=qs[_0x7995('0x45')](_0x177cb4['query']['sort']);_0x52d76d[_0x7995('0x46')]=qs[_0x7995('0x47')](_[_0x7995('0x48')](_0x177cb4['query'],_0x36d057[_0x7995('0x47')]),_0x5d2428);var _0x5e85b9=[];var _0x3993b5=squel['select']()['field']('id')[_0x7995('0x49')](_0x7995('0x2f'))[_0x7995('0x49')](_0x7995('0x4a'))['from'](_0x7995('0x4b'));var _0x40fc68=squel[_0x7995('0x4c')]()[_0x7995('0x49')]('u.id')['field'](_0x7995('0x4d'))['field'](_0x7995('0x4e'))['from'](_0x7995('0x4f'),'ui')['left_join'](_0x7995('0x50'),'u',_0x7995('0x51'));var _0x4d9245=squel[_0x7995('0x4c')]()[_0x7995('0x52')](_0x7995('0x53'),'i')[_0x7995('0x54')]('cm_contacts','c',_0x7995('0x55'))[_0x7995('0x54')](_0x7995('0x50'),'o','o.id\x20=\x20i.UserId')[_0x7995('0x54')](_0x7995('0x56'),'a',_0x7995('0x57'))[_0x7995('0x54')](_0x7995('0x58'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x7995('0x54')](_0x7995('0x59'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x7995('0x54')]('tools_tags','t',_0x7995('0x5a'));var _0x187735=squel[_0x7995('0x5b')]();var _0x30e220=[];var _0xddf537=squel[_0x7995('0x5b')]();var _0x1579b9;if(_0x177cb4['query'][_0x7995('0x5c')]){_0x1579b9=as[_0x7995('0x5d')](_0x177cb4[_0x7995('0x3d')]['search']);var _0x19da63=_0x1579b9[_0x7995('0x5e')];for(var _0x12d4b8=0x0;_0x12d4b8<_0x1579b9['conditions']['length'];_0x12d4b8++){var _0x5a592e=_0x1579b9[_0x7995('0x5f')][_0x12d4b8];var _0x1fd1ca='i';var _0x4cf5db=_[_0x7995('0x60')](_0x5d2428,[_0x7995('0x2f'),_0x5a592e[_0x7995('0x49')]]);if(!_0x4cf5db){switch(_0x5a592e[_0x7995('0x49')]){case _0x7995('0x61'):if(_0x5a592e['value']==0x1){_0x4d9245[_0x7995('0x62')]('`'+_0x5a592e['field']+_0x7995('0x63'));}else{_0x4d9245[_0x7995('0x62')]('`'+_0x5a592e[_0x7995('0x49')]+'`\x20>\x200');}break;case'Contact':if(_0x5a592e['operator']==='$substring'){if(_0x5a592e[_0x7995('0x64')][_0x7995('0x65')]('\x20')[_0x7995('0x42')]>0x1){_0x187735[_0x19da63](_0x7995('0x66'),qs[_0x7995('0x67')](_0x5a592e[_0x7995('0x64')]),null);}else{var _0x1f4270='%'+_0x5a592e[_0x7995('0x64')]+'%';_0x187735[_0x19da63](_0x7995('0x68'),_0x1f4270,_0x1f4270,_0x1f4270);}}else{_0x4cf5db=_[_0x7995('0x60')](_0x5d2428,[_0x7995('0x2f'),_0x7995('0x69')]);_0x5a592e[_0x7995('0x49')]=_0x7995('0x69');_0x47d5d7=as[_0x7995('0x6a')](_0x1fd1ca,_0x4cf5db[_0x7995('0x3a')],_0x5a592e);_0x187735[_0x19da63](_0x47d5d7[_0x7995('0x6b')],_0x47d5d7[_0x7995('0x64')][_0x7995('0x6c')],_0x47d5d7['value'][_0x7995('0x23')]);}break;case _0x7995('0x6d'):var _0x3b8a54=_0x5a592e[_0x7995('0x64')]['split'](',')['map'](function(_0x402fa0){return Number(_0x402fa0);});_0x3b8a54[_0x7995('0x33')](function(_0x5b9467){_0xddf537['or'](_0x7995('0x6e'),'%,'+_0x5b9467+',%');});_0x30e220=_['union'](_0x30e220,_0x3b8a54);break;case _0x7995('0x6f'):if(_0x5a592e[_0x7995('0x70')]===_0x7995('0x71')){_0x187735[_0x19da63](_0x7995('0x72'),'%'+_0x5a592e['value']+'%',null);}else{_0x4cf5db=_['find'](_0x5d2428,[_0x7995('0x2f'),_0x7995('0x73')]);_0x5a592e[_0x7995('0x49')]=_0x7995('0x73');_0x47d5d7=as[_0x7995('0x6a')](_0x1fd1ca,_0x4cf5db[_0x7995('0x3a')],_0x5a592e);_0x187735[_0x19da63](_0x47d5d7[_0x7995('0x6b')],_0x47d5d7[_0x7995('0x64')][_0x7995('0x6c')],_0x47d5d7['value'][_0x7995('0x23')]);}break;case _0x7995('0x74'):_0x47d5d7=as[_0x7995('0x6a')]('me',null,_0x5a592e);_0x187735[_0x19da63](_0x47d5d7[_0x7995('0x6b')],_0x47d5d7['value']['start'],_0x47d5d7[_0x7995('0x64')][_0x7995('0x23')]);break;}}else{var _0x47d5d7=as[_0x7995('0x6a')](_0x1fd1ca,_0x4cf5db[_0x7995('0x3a')],_0x5a592e);_0x187735[_0x19da63](_0x47d5d7[_0x7995('0x6b')],_0x47d5d7[_0x7995('0x64')][_0x7995('0x6c')],_0x47d5d7['value'][_0x7995('0x23')]);}}}else{var _0x564fca=_(_0x177cb4[_0x7995('0x3d')])[_0x7995('0x3e')]()[_0x7995('0x37')](function(_0x25b534){return _[_0x7995('0x75')](_0x5d2428,[_0x7995('0x2f'),_0x25b534])?_0x25b534:undefined;})[_0x7995('0x76')]()[_0x7995('0x64')]();if(!_[_0x7995('0x77')](_0x564fca)){_0x564fca[_0x7995('0x33')](function(_0x2618c4){if(_0x2618c4===_0x7995('0x78')){_0x4d9245['where'](_0x7995('0x79'),[][_0x7995('0x7a')](_0x177cb4[_0x7995('0x3d')][_0x2618c4]));}else if(_0x2618c4===_0x7995('0x7b')){var _0x2c6548=JSON['parse'](_0x177cb4['query'][_0x2618c4])[_0x7995('0x7c')];var _0x87e38d=JSON[_0x7995('0x7d')](_0x177cb4[_0x7995('0x3d')][_0x2618c4])['$lte'];_0x4d9245[_0x7995('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2c6548,_0x87e38d);}else{if(_0x177cb4['query'][_0x2618c4]===_0x7995('0x7e')){_0x4d9245[_0x7995('0x46')]('i.'+_0x2618c4+_0x7995('0x7f'));}else{_0x4d9245[_0x7995('0x46')]('i.'+_0x2618c4+_0x7995('0x80'),_0x177cb4[_0x7995('0x3d')][_0x2618c4]);}}});}if(_0x177cb4[_0x7995('0x3d')][_0x7995('0x81')]){if(_0x177cb4[_0x7995('0x3d')][_0x7995('0x81')]==0x1){_0x4d9245['having'](_0x7995('0x82'));}else{_0x4d9245[_0x7995('0x62')](_0x7995('0x83'));}}if(_0x177cb4['query'][_0x7995('0x84')]){_0x30e220=_[_0x7995('0x85')](_0x177cb4[_0x7995('0x3d')][_0x7995('0x84')])?_0x177cb4[_0x7995('0x3d')][_0x7995('0x84')]:new Array(_0x177cb4[_0x7995('0x3d')][_0x7995('0x84')]);_0x30e220[_0x7995('0x33')](function(_0x1fdff6){_0xddf537['or'](_0x7995('0x6e'),'%,'+_0x1fdff6+',%');});}if(_0x177cb4['query']['filter']){var _0xd07c1c=_0x177cb4[_0x7995('0x3d')][_0x7995('0x86')][_0x7995('0x87')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7995('0x88')](_0xd07c1c)){_0x187735['or'](_0x7995('0x89'),_0xd07c1c+'%')['or']('i.phone\x20LIKE\x20?',_0xd07c1c+'%');}else{_0x187735['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7995('0x67')](_0xd07c1c))['or'](_0x7995('0x8a'),_0xd07c1c+'%');}}}_0x4d9245['where'](_0x187735);_0x4d9245[_0x7995('0x8b')]('i.id');var _0x3758f9={'type':db[_0x7995('0x8c')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1f01c0=_0x4d9245['clone']();_0x1f01c0[_0x7995('0x49')](_0x7995('0x8d'));_0x1f01c0[_0x7995('0x49')](_0x7995('0x8e'),_0x7995('0x61'));if(_0x52d76d[_0x7995('0x8f')]){_0x52d76d[_0x7995('0x8f')][_0x7995('0x33')](function(_0x29e0ee){var _0x117317=_0x29e0ee[0x0]===_0x7995('0x90')?_0x29e0ee[0x0]:'i.'+_0x29e0ee[0x0];_0x4d9245[_0x7995('0x8f')](_0x117317,_0x29e0ee[0x1]===_0x7995('0x91')?![]:!![]);});}if(!_[_0x7995('0x77')](_0x30e220)){_0x4d9245[_0x7995('0x62')](_0xddf537);_0x1f01c0[_0x7995('0x46')](_0x7995('0x92'),_0x30e220);}BPromise[_0x7995('0x93')]()[_0x7995('0x2c')](function(){if(!_0x1579b9){if(_0x177cb4[_0x7995('0x3d')][_0x7995('0x78')])return;_0x1f01c0[_0x7995('0x46')](_0x7995('0x94'));_0x4d9245[_0x7995('0x46')](_0x7995('0x94'));return;}if(_0x177cb4[_0x7995('0x95')][_0x7995('0x96')]!==_0x7995('0x97'))return;return _0x177cb4['user'][_0x7995('0x98')]({'attributes':['id'],'raw':!![]})[_0x7995('0x2c')](function(_0x5683b2){if(_['isEmpty'](_0x5683b2)){_0x1f01c0[_0x7995('0x46')](_0x7995('0x99'));_0x4d9245[_0x7995('0x46')](_0x7995('0x99'));}else{_0x1f01c0[_0x7995('0x46')](_0x7995('0x79'),_['map'](_0x5683b2,'id'));_0x4d9245[_0x7995('0x46')](_0x7995('0x79'),_[_0x7995('0x37')](_0x5683b2,'id'));}});})[_0x7995('0x2c')](function(){if(_0x177cb4[_0x7995('0x95')][_0x7995('0x96')]===_0x7995('0x97')&&!_0x1579b9&&!_0x177cb4[_0x7995('0x3d')]['SmsAccountId'])return[];return db[_0x7995('0x9a')][_0x7995('0x3d')](_0x1f01c0['toString'](),_0x3758f9);})['then'](function(_0xd24c64){_0x5e67fe[_0x7995('0x9b')]=_0xd24c64[_0x7995('0x42')];if(_0x5e67fe[_0x7995('0x9b')]===0x0)return[];return db[_0x7995('0x9a')]['query'](_0x3993b5[_0x7995('0x9c')](),_0x3758f9)[_0x7995('0x2c')](function(_0x528b22){_0x5e85b9=_[_0x7995('0x9d')](_0x528b22,'id');_0x3758f9=_[_0x7995('0x9e')](_0x3758f9,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x177cb4[_0x7995('0x3d')]['fields']){_0x52d76d[_0x7995('0x40')][_0x7995('0x33')](function(_0x3ab421){_0x4d9245[_0x7995('0x49')]('i.'+_0x3ab421);});}else{_0x4d9245[_0x7995('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7995('0x61'));_0x4d9245[_0x7995('0x49')](_0x7995('0x9f'),'Account.key');_0x4d9245[_0x7995('0x49')](_0x7995('0xa0'),_0x7995('0xa1'));_0x4d9245[_0x7995('0x49')]('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',_0x7995('0x90'));_0x4d9245[_0x7995('0x49')](_0x7995('0xa2'));_0x4d9245['field']('c.firstName',_0x7995('0xa3'));_0x4d9245[_0x7995('0x49')]('c.lastName','Contact.lastName');_0x4d9245[_0x7995('0x49')](_0x7995('0xa4'),_0x7995('0xa5'));_0x4d9245[_0x7995('0x49')](_0x7995('0xa6'),'Contact.phone');_0x4d9245['field'](_0x7995('0xa7'),'Contact.mobile');_0x4d9245['field'](_0x7995('0xa8'),_0x7995('0xa9'));_0x4d9245[_0x7995('0x49')]('o.fullname',_0x7995('0xaa'));_0x4d9245[_0x7995('0x49')](_0x7995('0xab'),_0x7995('0xac'));_0x4d9245[_0x7995('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7995('0x32'));}if(_0x52d76d[_0x7995('0x26')])_0x4d9245[_0x7995('0x26')](_0x52d76d[_0x7995('0x26')]);if(_0x52d76d['offset'])_0x4d9245[_0x7995('0x25')](_0x52d76d[_0x7995('0x25')]);return db['sequelize'][_0x7995('0x3d')](_0x4d9245[_0x7995('0x9c')](),_0x3758f9);})['then'](function(_0x135f7a){_0x40fc68['where'](_0x7995('0xad'),_['map'](_0x135f7a,'id'));return db[_0x7995('0x9a')]['query'](_0x40fc68[_0x7995('0x9c')](),_0x3758f9)[_0x7995('0x2c')](function(_0x5bc982){var _0x17d677=_['groupBy'](_0x5bc982,'SmsInteractionId');var _0x7b9e26=[];_0x135f7a[_0x7995('0x33')](function(_0x784492){_0x7b9e26[_0x7995('0x35')](updateSmsInteraction(_0x784492,_0x5e85b9,_0x17d677));});return BPromise['all'](_0x7b9e26);});});})[_0x7995('0x2c')](function(_0x35044a){_0x5e67fe['rows']=_0x35044a;return _0x5e67fe;})['then'](respondWithFilteredResult(_0x5014d2,_0x52d76d))[_0x7995('0xae')](handleError(_0x5014d2,null));};exports['show']=function(_0x395670,_0x1446cc){var _0xfb4479={'raw':![],'where':{'id':_0x395670['params']['id']}},_0x5b42be={};_0x5b42be[_0x7995('0x3c')]=_['keys'](db[_0x7995('0x38')][_0x7995('0xaf')]);_0x5b42be[_0x7995('0x3d')]=_[_0x7995('0x3e')](_0x395670['query']);_0x5b42be['filters']=_['intersection'](_0x5b42be[_0x7995('0x3c')],_0x5b42be[_0x7995('0x3d')]);_0xfb4479[_0x7995('0x40')]=_[_0x7995('0x3f')](_0x5b42be[_0x7995('0x3c')],qs[_0x7995('0x41')](_0x395670['query']['fields']));_0xfb4479[_0x7995('0x40')]=_0xfb4479['attributes']['length']?_0xfb4479[_0x7995('0x40')]:_0x5b42be['model'];if(_0x395670['query'][_0x7995('0xb0')]){_0xfb4479[_0x7995('0xb1')]=[{'all':!![]}];}_0xfb4479=_[_0x7995('0x9e')]({},_0xfb4479,_0x395670['options']);return db[_0x7995('0x38')][_0x7995('0x60')](_0xfb4479)[_0x7995('0x2c')](handleEntityNotFound(_0x1446cc,null))[_0x7995('0x2c')](respondWithResult(_0x1446cc,null))[_0x7995('0xae')](handleError(_0x1446cc,null));};exports[_0x7995('0xb2')]=function(_0x41e3aa,_0x4093c5){return db[_0x7995('0x38')]['create'](_0x41e3aa[_0x7995('0x74')],{})[_0x7995('0x2c')](respondWithResult(_0x4093c5,0xc9))[_0x7995('0xae')](handleError(_0x4093c5,null));};exports[_0x7995('0x2b')]=function(_0x2a01d4,_0x5a4695){if(_0x2a01d4[_0x7995('0x74')]['id']){delete _0x2a01d4[_0x7995('0x74')]['id'];}return db[_0x7995('0x38')]['find']({'where':{'id':_0x2a01d4['params']['id']}})['then'](handleEntityNotFound(_0x5a4695,null))[_0x7995('0x2c')](saveUpdates(_0x2a01d4[_0x7995('0x74')],null))[_0x7995('0x2c')](respondWithResult(_0x5a4695,null))[_0x7995('0xae')](handleError(_0x5a4695,null));};exports[_0x7995('0xb3')]=function(_0x3ad47c,_0x4dd64a){return db[_0x7995('0x38')]['find']({'where':{'id':_0x3ad47c[_0x7995('0xb4')]['id']}})[_0x7995('0x2c')](handleEntityNotFound(_0x4dd64a,null))[_0x7995('0x2c')](removeEntity(_0x4dd64a,null))[_0x7995('0xae')](handleError(_0x4dd64a,null));};exports[_0x7995('0xb5')]=function(_0x24ac44,_0x4f929b){return db[_0x7995('0x38')][_0x7995('0xb5')]()[_0x7995('0x2c')](respondWithResult(_0x4f929b,null))[_0x7995('0xae')](handleError(_0x4f929b,null));};exports['addMessage']=function(_0x14be9f,_0x57f875,_0x422d1f){return db[_0x7995('0xb6')]['find']({'where':{'id':_0x14be9f['params']['id']}})[_0x7995('0x2c')](handleEntityNotFound(_0x57f875,null))[_0x7995('0x2c')](function(_0x41e200){if(_0x41e200){return _0x41e200[_0x7995('0xb7')](_0x14be9f[_0x7995('0x74')][_0x7995('0xb8')],_[_0x7995('0xb9')](_0x14be9f[_0x7995('0x74')],[_0x7995('0xb8'),'id'])||{});}})[_0x7995('0x2c')](respondWithResult(_0x57f875,null))[_0x7995('0xae')](handleError(_0x57f875,null));};exports[_0x7995('0xba')]=function(_0x5eb2d9,_0x5380e6,_0x41b0d5){var _0xd7f2b={'raw':![],'where':{}};var _0x12cc9f={};var _0x1531a9={'count':0x0,'rows':[]};return db[_0x7995('0x38')]['findOne']({'where':{'id':_0x5eb2d9[_0x7995('0xb4')]['id']}})[_0x7995('0x2c')](handleEntityNotFound(_0x5380e6,null))['then'](function(_0x46fc1c){if(_0x46fc1c){_0x12cc9f['model']=_[_0x7995('0x3e')](db[_0x7995('0xb6')][_0x7995('0xaf')]);_0x12cc9f['query']=_[_0x7995('0x3e')](_0x5eb2d9[_0x7995('0x3d')]);_0x12cc9f[_0x7995('0x47')]=_[_0x7995('0x3f')](_0x12cc9f[_0x7995('0x3c')],_0x12cc9f[_0x7995('0x3d')]);_0xd7f2b[_0x7995('0x40')]=_['intersection'](_0x12cc9f['model'],qs['fields'](_0x5eb2d9[_0x7995('0x3d')][_0x7995('0x41')]));_0xd7f2b['attributes']=_0xd7f2b['attributes'][_0x7995('0x42')]?_0xd7f2b[_0x7995('0x40')]:_0x12cc9f['model'];if(!_0x5eb2d9['query']['hasOwnProperty']('nolimit')){_0xd7f2b[_0x7995('0x26')]=qs[_0x7995('0x26')](_0x5eb2d9[_0x7995('0x3d')][_0x7995('0x26')]);_0xd7f2b['offset']=qs[_0x7995('0x25')](_0x5eb2d9[_0x7995('0x3d')]['offset']);}_0xd7f2b[_0x7995('0x8f')]=qs[_0x7995('0x45')](_0x5eb2d9[_0x7995('0x3d')]['sort']);_0xd7f2b[_0x7995('0x46')]=qs[_0x7995('0x47')](_['pick'](_0x5eb2d9[_0x7995('0x3d')],_0x12cc9f[_0x7995('0x47')]));_0xd7f2b[_0x7995('0x46')][_0x7995('0xbb')]=_0x46fc1c['id'];if(_0x5eb2d9[_0x7995('0x3d')][_0x7995('0x86')]){_0xd7f2b[_0x7995('0x46')]=_[_0x7995('0x9e')](_0xd7f2b[_0x7995('0x46')],{'$or':_[_0x7995('0x37')](_0xd7f2b[_0x7995('0x40')],function(_0x428e03){var _0x3f0c3b={};_0x3f0c3b[_0x428e03]={'$like':'%'+_0x5eb2d9['query'][_0x7995('0x86')]+'%'};return _0x3f0c3b;})});}if(_0x5eb2d9[_0x7995('0x3d')][_0x7995('0x7c')]){var _0x3c551f=_0x5eb2d9['query'][_0x7995('0x7c')][_0x7995('0x65')](',');var _0x2bc931={};_0x2bc931[_0x3c551f[0x0]]={'$gte':moment(_0x3c551f[0x1])['format'](_0x7995('0xbc'))};_0xd7f2b[_0x7995('0x46')]=_[_0x7995('0x9e')](_0xd7f2b[_0x7995('0x46')],_0x2bc931);}_0xd7f2b=_[_0x7995('0x9e')]({},_0xd7f2b,_0x5eb2d9[_0x7995('0xbd')]);return db[_0x7995('0xb6')]['count']({'where':_0xd7f2b[_0x7995('0x46')]})['then'](function(_0x101bc6){_0x1531a9[_0x7995('0x9b')]=_0x101bc6;if(_0x5eb2d9[_0x7995('0x3d')]['includeAll']){_0xd7f2b[_0x7995('0xb1')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0xd7f2b);})['then'](function(_0x4b3170){_0x1531a9[_0x7995('0xbe')]=_0x4b3170;return _0x1531a9;});}})[_0x7995('0x2c')](respondWithFilteredResult(_0x5380e6,_0xd7f2b))['catch'](handleError(_0x5380e6,null));};exports[_0x7995('0xbf')]=function(_0x3edba1,_0x50fccd,_0x151893){return db[_0x7995('0x38')][_0x7995('0x60')]({'where':{'id':_0x3edba1[_0x7995('0xb4')]['id']}})[_0x7995('0x2c')](handleEntityNotFound(_0x50fccd,null))['then'](function(_0x38ea3e){if(_0x38ea3e){return _0x38ea3e[_0x7995('0xc0')](_0x3edba1[_0x7995('0x74')][_0x7995('0xb8')],_['omit'](_0x3edba1[_0x7995('0x74')],[_0x7995('0xb8'),'id'])||{})[_0x7995('0xc1')](function(){return db[_0x7995('0x6d')][_0x7995('0xc2')]({'attributes':['id',_0x7995('0x2f'),_0x7995('0x4a')],'where':{'id':_0x3edba1[_0x7995('0x74')][_0x7995('0xb8')]}});})[_0x7995('0x2c')](function(_0x5e08fa){socket[_0x7995('0xc3')]('smsInteractionTags:save',{'id':Number(_0x3edba1[_0x7995('0xb4')]['id']),'tags':_0x5e08fa||[]});return{'id':Number(_0x3edba1[_0x7995('0xb4')]['id']),'tags':_0x5e08fa||[]};});}})[_0x7995('0x2c')](respondWithResult(_0x50fccd,null))['catch'](handleError(_0x50fccd,null));};exports['removeTags']=function(_0x1102a3,_0x28a476,_0x4c7dc8){return db[_0x7995('0x38')]['find']({'where':{'id':_0x1102a3[_0x7995('0xb4')]['id']}})[_0x7995('0x2c')](handleEntityNotFound(_0x28a476,null))[_0x7995('0x2c')](function(_0x4e5667){if(_0x4e5667){return _0x4e5667['removeTags'](_0x1102a3['query'][_0x7995('0xb8')]);}})[_0x7995('0x2c')](respondWithStatusCode(_0x28a476,null))[_0x7995('0xae')](handleError(_0x28a476,null));};exports[_0x7995('0xc4')]=function(_0x5e7f82,_0x99e31d){var _0x382951=moment()[_0x7995('0xc5')]()[_0x7995('0x9c')]();var _0x27222c=path['join'](config['root'],'server',_0x7995('0xc6'),_0x7995('0xc7'));var _0x5972d4=path[_0x7995('0xc8')](config['root'],_0x7995('0xc9'),_0x7995('0xc6'),_0x7995('0xca'));var _0x467913=path['join'](_0x27222c,_0x382951);var _0x3fbafb=util[_0x7995('0xcb')](_0x7995('0xcc'),_0x5e7f82[_0x7995('0xb4')]['id'],_0x382951);var _0x2023a7=path[_0x7995('0xc8')](_0x27222c,_0x3fbafb);var _0x1d200d=[];_0x1d200d[_0x7995('0x35')]({'model':db[_0x7995('0x6f')],'as':_0x7995('0x6f'),'attributes':['id',_0x7995('0x31')],'raw':!![]});_0x1d200d[_0x7995('0x35')]({'model':db[_0x7995('0xcd')],'as':_0x7995('0xce'),'attributes':['id','firstName',_0x7995('0xcf')],'raw':!![]});var _0x58e0c0=[{'model':db[_0x7995('0xb6')],'as':_0x7995('0xd0'),'attributes':['id','body',_0x7995('0x7b'),'direction',_0x7995('0xd1'),_0x7995('0x81')],'include':_0x1d200d}];_0x58e0c0['push']({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0x7995('0x2f')]});_0x58e0c0[_0x7995('0x35')]({'model':db[_0x7995('0x6f')],'as':_0x7995('0xd2'),'attributes':['id','fullname']});return db[_0x7995('0x38')][_0x7995('0x60')]({'where':{'id':_0x5e7f82[_0x7995('0xb4')]['id']},'include':_0x58e0c0})[_0x7995('0x2c')](handleEntityNotFound(_0x99e31d,null))[_0x7995('0x2c')](function(_0x3ab70c){if(_0x3ab70c){var _0x3e8479=_0x3ab70c[_0x7995('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x467913);var _0x2e93a9={'channel':_0x7995('0xd4'),'account':_0x3e8479[_0x7995('0xd5')][_0x7995('0x2f')],'agent':_0x3e8479['Owner']?_0x3e8479[_0x7995('0xd2')][_0x7995('0x31')]:_0x7995('0xd6'),'createdAt':moment(_0x3e8479[_0x7995('0x7b')])[_0x7995('0xcb')](_0x7995('0xbc'))['toString'](),'closedAt':_0x3e8479[_0x7995('0xd7')]?moment(_0x3e8479[_0x7995('0xd8')])[_0x7995('0xcb')](_0x7995('0xbc'))[_0x7995('0x9c')]():'','disposition':_0x3e8479[_0x7995('0xd9')],'messages':_(_0x3e8479[_0x7995('0xd0')])[_0x7995('0x86')]({'secret':![]})[_0x7995('0x37')](function(_0x218a10){return{'date':moment(_0x218a10[_0x7995('0x7b')])[_0x7995('0xcb')](_0x7995('0xbc'))[_0x7995('0x9c')](),'sender':_0x218a10[_0x7995('0xda')]===_0x7995('0xdb')?_0x218a10[_0x7995('0x6f')]?_0x218a10[_0x7995('0x6f')][_0x7995('0x31')]:_0x7995('0xdc'):_0x218a10[_0x7995('0xce')]['firstName']+(_0x218a10['Contact'][_0x7995('0xcf')]?'\x20'+_0x218a10[_0x7995('0xce')]['lastName']:''),'body':_0x218a10[_0x7995('0x74')],'direction':_0x218a10['direction']===_0x7995('0xdb')?'A':'C','secret':_0x218a10['secret'],'read':_0x218a10[_0x7995('0x81')]};})[_0x7995('0x64')]()};return ejs[_0x7995('0xdd')](path[_0x7995('0xc8')](config[_0x7995('0xde')],_0x7995('0xc9'),_0x7995('0xdf'),_0x7995('0xe0')),{'interaction':_0x2e93a9})[_0x7995('0x2c')](function(_0x456cc9){var _0x49e85c=path[_0x7995('0xc8')](_0x467913,_0x7995('0xe1')+_0x3e8479['id']+'-'+_0x382951+_0x7995('0xe2'));var _0x3c83dd={'path':_0x49e85c,'channel':'Sms','interactionId':_0x3e8479['id']};return pdf[_0x7995('0xe3')](_0x456cc9,_0x3c83dd);})[_0x7995('0x2c')](function(){return new BPromise(function(_0x2f5904,_0x955034){zipdir(_0x467913,{'saveTo':_0x2023a7},function(_0x4d19b8,_0x32c550){if(_0x4d19b8)return _0x955034(_0x4d19b8);return _0x2f5904(_0x32c550);});})[_0x7995('0x2c')](function(){return new BPromise(function(_0x31d0e9,_0x2a600e){rimraf(_0x467913,function(_0x21617b){if(_0x21617b)_0x2a600e(_0x21617b);return _0x31d0e9();});});})[_0x7995('0x2c')](function(){return _0x99e31d[_0x7995('0xc4')](_0x2023a7,_0x3fbafb,function(_0x36ad5e){if(_0x36ad5e){console[_0x7995('0xe4')]('err',_0x36ad5e);}else{fs[_0x7995('0xe5')](_0x2023a7);}});});});}else{return _0x99e31d['sendStatus'](0xc8);}})[_0x7995('0xae')](handleError(_0x99e31d,null));}; \ No newline at end of file +var _0x7a54=['server','files','tmp','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','SmsAccount','Sms','Account','Owner','createdAt','closed','disposition','out','System','secret','renderFile','views','downloadInteraction.html','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','forEach','catch','index','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','color','from','tools_tags','select','field','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','start','split','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','keys','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','SmsInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','show','params','intersection','includeAll','include','create','describe','SmsMessage','ids','omit','findOne','SmsInteractionId','merge','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','setTags','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','root'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0x7a54,0x106));var _0x47a5=function(_0x475561,_0x15adee){_0x475561=_0x475561-0x0;var _0x2f2294=_0x7a54[_0x475561];return _0x2f2294;};'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 pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x47a5('0x11'))(_0x47a5('0x12'));var utils=require(_0x47a5('0x13'));var config=require(_0x47a5('0x14'));var licenseUtil=require(_0x47a5('0x15'));var db=require(_0x47a5('0x16'))['db'];config[_0x47a5('0x17')]=_['defaults'](config[_0x47a5('0x17')],{'host':_0x47a5('0x18'),'port':0x18eb});var socket=require(_0x47a5('0x19'))(new Redis(config[_0x47a5('0x17')]));require(_0x47a5('0x1a'))[_0x47a5('0x1b')](socket);function respondWithStatusCode(_0x3c6c46,_0x190faa){_0x190faa=_0x190faa||0xcc;return function(_0x4e99a8){if(_0x4e99a8){return _0x3c6c46[_0x47a5('0x1c')](_0x190faa);}return _0x3c6c46[_0x47a5('0x1d')](_0x190faa)[_0x47a5('0x1e')]();};}function respondWithResult(_0x2a2cbb,_0x1ef44c){_0x1ef44c=_0x1ef44c||0xc8;return function(_0x574af6){if(_0x574af6){return _0x2a2cbb['status'](_0x1ef44c)[_0x47a5('0x1f')](_0x574af6);}};}function respondWithFilteredResult(_0x4b966e,_0x5247fd){return function(_0x423a81){if(_0x423a81){var _0xaf70a6=_0x423a81[_0x47a5('0x20')],_0x2ce454=_0x5247fd[_0x47a5('0x21')],_0x1ef371=_0x5247fd[_0x47a5('0x21')]+_0x5247fd[_0x47a5('0x22')],_0x477b1d;if(_0x1ef371>=_0xaf70a6){_0x1ef371=_0xaf70a6;_0x477b1d=0xc8;}else{_0x477b1d=0xce;}_0x4b966e['status'](_0x477b1d);return _0x4b966e[_0x47a5('0x23')](_0x47a5('0x24'),_0x2ce454+'-'+_0x1ef371+'/'+_0xaf70a6)['json'](_0x423a81);}return null;};}function patchUpdates(_0x2b0360){return function(_0x1f03f7){try{jsonpatch[_0x47a5('0x25')](_0x1f03f7,_0x2b0360,!![]);}catch(_0x4c5910){return BPromise[_0x47a5('0x26')](_0x4c5910);}return _0x1f03f7[_0x47a5('0x27')]();};}function saveUpdates(_0x23db32,_0x7a9f9e){return function(_0x5ef1b1){if(_0x5ef1b1){return _0x5ef1b1[_0x47a5('0x28')](_0x23db32)[_0x47a5('0x29')](function(_0x513981){return _0x513981;});}return null;};}function removeEntity(_0x28747d,_0xc4cd63){return function(_0x4437f1){if(_0x4437f1){return _0x4437f1[_0x47a5('0x2a')]()[_0x47a5('0x29')](function(){_0x28747d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x136745,_0x5686db){return function(_0x1ea9c8){if(!_0x1ea9c8){_0x136745['sendStatus'](0x194);}return _0x1ea9c8;};}function handleError(_0x23cb77,_0x378208){_0x378208=_0x378208||0x1f4;return function(_0x36ad34){logger[_0x47a5('0x2b')](_0x36ad34[_0x47a5('0x2c')]);if(_0x36ad34[_0x47a5('0x2d')]){delete _0x36ad34[_0x47a5('0x2d')];}_0x23cb77[_0x47a5('0x1d')](_0x378208)[_0x47a5('0x2e')](_0x36ad34);};}function getInteractionUsers(_0x361bfa,_0x1127f8){return new BPromise(function(_0x11a4fa,_0x3ad507){try{if(_0x1127f8[_0x361bfa['id']]){_0x361bfa['Users']=_[_0x47a5('0x2f')](_0x1127f8[_0x361bfa['id']],function(_0x51833b){return{'id':_0x51833b['id'],'fullname':_0x51833b[_0x47a5('0x30')]};});}}catch(_0x9ac908){_0x3ad507(_0x9ac908);}_0x11a4fa(_0x361bfa);});}function getInteractionTags(_0x16901f,_0x4d6b57){return new BPromise(function(_0x256650,_0x625952){try{if(_0x16901f[_0x47a5('0x31')]){_0x16901f[_0x47a5('0x32')]=[];_0x16901f['TagIds']['split'](',')[_0x47a5('0x33')](function(_0xfb5ddb){_0x16901f['Tags']['push'](_0x4d6b57[_0xfb5ddb]);});}delete _0x16901f[_0x47a5('0x31')];}catch(_0x51544e){_0x625952(_0x51544e);}_0x256650(_0x16901f);});}function updateSmsInteraction(_0x57bff6,_0x42f70c,_0x53119b){return new BPromise(function(_0x122ed6,_0xd972c){return getInteractionUsers(_0x57bff6,_0x53119b)['then'](function(_0x4843c0){return getInteractionTags(_0x4843c0,_0x42f70c);})[_0x47a5('0x29')](function(_0x5910bb){_0x122ed6(_0x5910bb);})[_0x47a5('0x34')](function(_0x87e4c9){_0xd972c(_0x87e4c9);});});}exports[_0x47a5('0x35')]=function(_0x52749b,_0x18f7e9){var _0x50c086={},_0x53c754={},_0x65542e={'count':0x0,'rows':[]};var _0x5a8a7c=_[_0x47a5('0x2f')](db['SmsInteraction'][_0x47a5('0x36')],function(_0x3534cb){return{'name':_0x3534cb[_0x47a5('0x37')],'type':_0x3534cb[_0x47a5('0x38')][_0x47a5('0x39')]};});_0x53c754[_0x47a5('0x3a')]=_[_0x47a5('0x2f')](_0x5a8a7c,_0x47a5('0x2d'));_0x53c754[_0x47a5('0x3b')]=_['keys'](_0x52749b[_0x47a5('0x3b')]);_0x53c754[_0x47a5('0x3c')]=_['intersection'](_0x53c754[_0x47a5('0x3a')],_0x53c754[_0x47a5('0x3b')]);_0x50c086[_0x47a5('0x3d')]=_['intersection'](_0x53c754[_0x47a5('0x3a')],qs[_0x47a5('0x3e')](_0x52749b['query'][_0x47a5('0x3e')]));_0x50c086[_0x47a5('0x3d')]=_0x50c086['attributes']['length']?_0x50c086['attributes']:_0x53c754[_0x47a5('0x3a')];if(!_0x52749b['query'][_0x47a5('0x3f')](_0x47a5('0x40'))){_0x50c086[_0x47a5('0x22')]=qs[_0x47a5('0x22')](_0x52749b[_0x47a5('0x3b')][_0x47a5('0x22')]);_0x50c086[_0x47a5('0x21')]=qs[_0x47a5('0x21')](_0x52749b[_0x47a5('0x3b')][_0x47a5('0x21')]);}_0x50c086[_0x47a5('0x41')]=qs[_0x47a5('0x42')](_0x52749b[_0x47a5('0x3b')]['sort']);_0x50c086[_0x47a5('0x43')]=qs[_0x47a5('0x3c')](_[_0x47a5('0x44')](_0x52749b[_0x47a5('0x3b')],_0x53c754['filters']),_0x5a8a7c);var _0x7de536=[];var _0x528ef3=squel['select']()['field']('id')['field'](_0x47a5('0x2d'))['field'](_0x47a5('0x45'))[_0x47a5('0x46')](_0x47a5('0x47'));var _0x494526=squel[_0x47a5('0x48')]()[_0x47a5('0x49')]('u.id')['field'](_0x47a5('0x4a'))['field'](_0x47a5('0x4b'))[_0x47a5('0x46')](_0x47a5('0x4c'),'ui')[_0x47a5('0x4d')](_0x47a5('0x4e'),'u',_0x47a5('0x4f'));var _0x434227=squel[_0x47a5('0x48')]()[_0x47a5('0x46')](_0x47a5('0x50'),'i')[_0x47a5('0x4d')](_0x47a5('0x51'),'c',_0x47a5('0x52'))[_0x47a5('0x4d')](_0x47a5('0x4e'),'o',_0x47a5('0x53'))['left_join'](_0x47a5('0x54'),'a',_0x47a5('0x55'))['left_join']('sms_messages','me',_0x47a5('0x56'))['left_join'](_0x47a5('0x57'),'it',_0x47a5('0x58'))['left_join']('tools_tags','t',_0x47a5('0x59'));var _0x52d409=squel[_0x47a5('0x5a')]();var _0x1d1039=[];var _0x3548bc=squel[_0x47a5('0x5a')]();var _0x44fe8a;if(_0x52749b[_0x47a5('0x3b')][_0x47a5('0x5b')]){_0x44fe8a=as['parseSearch'](_0x52749b['query'][_0x47a5('0x5b')]);var _0x411230=_0x44fe8a[_0x47a5('0x5c')];for(var _0x9ea93e=0x0;_0x9ea93e<_0x44fe8a[_0x47a5('0x5d')][_0x47a5('0x5e')];_0x9ea93e++){var _0x249de5=_0x44fe8a['conditions'][_0x9ea93e];var _0x45cca5='i';var _0x1c9a62=_[_0x47a5('0x5f')](_0x5a8a7c,['name',_0x249de5[_0x47a5('0x49')]]);if(!_0x1c9a62){switch(_0x249de5['field']){case _0x47a5('0x60'):if(_0x249de5[_0x47a5('0x61')]==0x1){_0x434227[_0x47a5('0x62')]('`'+_0x249de5[_0x47a5('0x49')]+'`\x20=\x200');}else{_0x434227[_0x47a5('0x62')]('`'+_0x249de5[_0x47a5('0x49')]+_0x47a5('0x63'));}break;case _0x47a5('0x64'):if(_0x249de5[_0x47a5('0x65')]===_0x47a5('0x66')){if(_0x249de5[_0x47a5('0x61')]['split']('\x20')[_0x47a5('0x5e')]>0x1){_0x52d409[_0x411230](_0x47a5('0x67'),qs[_0x47a5('0x68')](_0x249de5[_0x47a5('0x61')]),null);}else{var _0x3329aa='%'+_0x249de5[_0x47a5('0x61')]+'%';_0x52d409[_0x411230]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3329aa,_0x3329aa,_0x3329aa);}}else{_0x1c9a62=_[_0x47a5('0x5f')](_0x5a8a7c,[_0x47a5('0x2d'),_0x47a5('0x69')]);_0x249de5['field']=_0x47a5('0x69');_0x4f8564=as[_0x47a5('0x6a')](_0x45cca5,_0x1c9a62[_0x47a5('0x38')],_0x249de5);_0x52d409[_0x411230](_0x4f8564['text'],_0x4f8564['value'][_0x47a5('0x6b')],_0x4f8564[_0x47a5('0x61')]['end']);}break;case'Tag':var _0x6d6b2b=_0x249de5['value'][_0x47a5('0x6c')](',')['map'](function(_0x482de6){return Number(_0x482de6);});_0x6d6b2b[_0x47a5('0x33')](function(_0x46d2d3){_0x3548bc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46d2d3+',%');});_0x1d1039=_[_0x47a5('0x6d')](_0x1d1039,_0x6d6b2b);break;case _0x47a5('0x6e'):if(_0x249de5['operator']==='$substring'){_0x52d409[_0x411230](_0x47a5('0x6f'),'%'+_0x249de5[_0x47a5('0x61')]+'%',null);}else{_0x1c9a62=_[_0x47a5('0x5f')](_0x5a8a7c,[_0x47a5('0x2d'),'UserId']);_0x249de5[_0x47a5('0x49')]=_0x47a5('0x70');_0x4f8564=as[_0x47a5('0x6a')](_0x45cca5,_0x1c9a62['type'],_0x249de5);_0x52d409[_0x411230](_0x4f8564[_0x47a5('0x71')],_0x4f8564['value'][_0x47a5('0x6b')],_0x4f8564[_0x47a5('0x61')][_0x47a5('0x1e')]);}break;case _0x47a5('0x72'):_0x4f8564=as[_0x47a5('0x6a')]('me',null,_0x249de5);_0x52d409[_0x411230](_0x4f8564['text'],_0x4f8564[_0x47a5('0x61')]['start'],_0x4f8564['value']['end']);break;}}else{var _0x4f8564=as[_0x47a5('0x6a')](_0x45cca5,_0x1c9a62[_0x47a5('0x38')],_0x249de5);_0x52d409[_0x411230](_0x4f8564[_0x47a5('0x71')],_0x4f8564['value']['start'],_0x4f8564[_0x47a5('0x61')][_0x47a5('0x1e')]);}}}else{var _0x45d4b6=_(_0x52749b[_0x47a5('0x3b')])[_0x47a5('0x73')]()['map'](function(_0x3474b7){return _['some'](_0x5a8a7c,[_0x47a5('0x2d'),_0x3474b7])?_0x3474b7:undefined;})[_0x47a5('0x74')]()['value']();if(!_[_0x47a5('0x75')](_0x45d4b6)){_0x45d4b6[_0x47a5('0x33')](function(_0x132854){if(_0x132854===_0x47a5('0x76')){_0x434227[_0x47a5('0x43')](_0x47a5('0x77'),[][_0x47a5('0x78')](_0x52749b[_0x47a5('0x3b')][_0x132854]));}else if(_0x132854==='createdAt'){var _0x2dcc3b=JSON[_0x47a5('0x79')](_0x52749b[_0x47a5('0x3b')][_0x132854])[_0x47a5('0x7a')];var _0x396cb0=JSON['parse'](_0x52749b[_0x47a5('0x3b')][_0x132854])[_0x47a5('0x7b')];_0x434227[_0x47a5('0x43')](_0x47a5('0x7c'),_0x2dcc3b,_0x396cb0);}else{if(_0x52749b[_0x47a5('0x3b')][_0x132854]===_0x47a5('0x7d')){_0x434227[_0x47a5('0x43')]('i.'+_0x132854+_0x47a5('0x7e'));}else{_0x434227[_0x47a5('0x43')]('i.'+_0x132854+_0x47a5('0x7f'),_0x52749b[_0x47a5('0x3b')][_0x132854]);}}});}if(_0x52749b[_0x47a5('0x3b')][_0x47a5('0x80')]){if(_0x52749b[_0x47a5('0x3b')][_0x47a5('0x80')]==0x1){_0x434227['having'](_0x47a5('0x81'));}else{_0x434227[_0x47a5('0x62')](_0x47a5('0x82'));}}if(_0x52749b['query'][_0x47a5('0x83')]){_0x1d1039=_[_0x47a5('0x84')](_0x52749b[_0x47a5('0x3b')][_0x47a5('0x83')])?_0x52749b['query'][_0x47a5('0x83')]:new Array(_0x52749b['query'][_0x47a5('0x83')]);_0x1d1039['forEach'](function(_0x43f649){_0x3548bc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x43f649+',%');});}if(_0x52749b[_0x47a5('0x3b')][_0x47a5('0x85')]){var _0x2578d6=_0x52749b['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x47a5('0x86')](/'/g,'\x27\x27');if(qs[_0x47a5('0x87')](_0x2578d6)){_0x52d409['or'](_0x47a5('0x88'),_0x2578d6+'%')['or'](_0x47a5('0x89'),_0x2578d6+'%');}else{_0x52d409['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x47a5('0x68')](_0x2578d6))['or'](_0x47a5('0x8a'),_0x2578d6+'%');}}}_0x434227[_0x47a5('0x43')](_0x52d409);_0x434227[_0x47a5('0x8b')](_0x47a5('0x8c'));var _0xb9f589={'type':db[_0x47a5('0x8d')][_0x47a5('0x8e')][_0x47a5('0x8f')],'raw':!![]};var _0xc69a68=_0x434227[_0x47a5('0x90')]();_0xc69a68[_0x47a5('0x49')]('i.id');_0xc69a68[_0x47a5('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x47a5('0x60'));if(_0x50c086[_0x47a5('0x41')]){_0x50c086[_0x47a5('0x41')][_0x47a5('0x33')](function(_0x40e584){var _0xa9c853=_0x40e584[0x0]===_0x47a5('0x91')?_0x40e584[0x0]:'i.'+_0x40e584[0x0];_0x434227[_0x47a5('0x41')](_0xa9c853,_0x40e584[0x1]===_0x47a5('0x92')?![]:!![]);});}if(!_[_0x47a5('0x75')](_0x1d1039)){_0x434227[_0x47a5('0x62')](_0x3548bc);_0xc69a68[_0x47a5('0x43')](_0x47a5('0x93'),_0x1d1039);}BPromise[_0x47a5('0x94')]()[_0x47a5('0x29')](function(){if(!_0x44fe8a){if(_0x52749b['query']['SmsAccountId'])return;_0xc69a68['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x434227[_0x47a5('0x43')](_0x47a5('0x95'));return;}if(_0x52749b['user'][_0x47a5('0x96')]!==_0x47a5('0x97'))return;return _0x52749b[_0x47a5('0x98')][_0x47a5('0x99')]({'attributes':['id'],'raw':!![]})[_0x47a5('0x29')](function(_0x930d25){if(_[_0x47a5('0x75')](_0x930d25)){_0xc69a68[_0x47a5('0x43')](_0x47a5('0x9a'));_0x434227[_0x47a5('0x43')](_0x47a5('0x9a'));}else{_0xc69a68['where'](_0x47a5('0x77'),_[_0x47a5('0x2f')](_0x930d25,'id'));_0x434227[_0x47a5('0x43')]('i.SmsAccountId\x20IN\x20?',_[_0x47a5('0x2f')](_0x930d25,'id'));}});})[_0x47a5('0x29')](function(){if(_0x52749b[_0x47a5('0x98')]['role']===_0x47a5('0x97')&&!_0x44fe8a&&!_0x52749b['query']['SmsAccountId'])return[];return db[_0x47a5('0x9b')][_0x47a5('0x3b')](_0xc69a68[_0x47a5('0x9c')](),_0xb9f589);})[_0x47a5('0x29')](function(_0x164d42){_0x65542e[_0x47a5('0x20')]=_0x164d42['length'];if(_0x65542e['count']===0x0)return[];return db[_0x47a5('0x9b')]['query'](_0x528ef3[_0x47a5('0x9c')](),_0xb9f589)[_0x47a5('0x29')](function(_0x175dab){_0x7de536=_[_0x47a5('0x9d')](_0x175dab,'id');_0xb9f589=_['merge'](_0xb9f589,{'model':db[_0x47a5('0x9e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x52749b['query']['fields']){_0x50c086[_0x47a5('0x3d')][_0x47a5('0x33')](function(_0x5b91f7){_0x434227[_0x47a5('0x49')]('i.'+_0x5b91f7);});}else{_0x434227[_0x47a5('0x49')](_0x47a5('0x9f'),'unreadMessages');_0x434227[_0x47a5('0x49')]('a.key',_0x47a5('0xa0'));_0x434227[_0x47a5('0x49')](_0x47a5('0xa1'),'Account.mandatoryDisposition');_0x434227[_0x47a5('0x49')](_0x47a5('0xa2'),_0x47a5('0x91'));_0x434227['field'](_0x47a5('0xa3'));_0x434227['field'](_0x47a5('0xa4'),'Contact.firstName');_0x434227[_0x47a5('0x49')](_0x47a5('0xa5'),_0x47a5('0xa6'));_0x434227[_0x47a5('0x49')]('c.email',_0x47a5('0xa7'));_0x434227[_0x47a5('0x49')](_0x47a5('0xa8'),_0x47a5('0xa9'));_0x434227[_0x47a5('0x49')]('c.mobile','Contact.mobile');_0x434227[_0x47a5('0x49')]('c.fax',_0x47a5('0xaa'));_0x434227[_0x47a5('0x49')](_0x47a5('0xab'),'Owner.fullname');_0x434227[_0x47a5('0x49')](_0x47a5('0xac'),'Owner.internal');_0x434227[_0x47a5('0x49')](_0x47a5('0xad'),_0x47a5('0x31'));}if(_0x50c086[_0x47a5('0x22')])_0x434227['limit'](_0x50c086['limit']);if(_0x50c086[_0x47a5('0x21')])_0x434227[_0x47a5('0x21')](_0x50c086['offset']);return db[_0x47a5('0x9b')][_0x47a5('0x3b')](_0x434227['toString'](),_0xb9f589);})[_0x47a5('0x29')](function(_0x2a02cd){_0x494526[_0x47a5('0x43')]('ui.SmsInteractionId\x20IN\x20?',_[_0x47a5('0x2f')](_0x2a02cd,'id'));return db['sequelize'][_0x47a5('0x3b')](_0x494526['toString'](),_0xb9f589)[_0x47a5('0x29')](function(_0x3c620e){var _0x4995be=_[_0x47a5('0xae')](_0x3c620e,'SmsInteractionId');var _0x1eabef=[];_0x2a02cd[_0x47a5('0x33')](function(_0x37e045){_0x1eabef[_0x47a5('0xaf')](updateSmsInteraction(_0x37e045,_0x7de536,_0x4995be));});return BPromise['all'](_0x1eabef);});});})[_0x47a5('0x29')](function(_0x593426){_0x65542e['rows']=_0x593426;return _0x65542e;})[_0x47a5('0x29')](respondWithFilteredResult(_0x18f7e9,_0x50c086))[_0x47a5('0x34')](handleError(_0x18f7e9,null));};exports[_0x47a5('0xb0')]=function(_0x96fb22,_0x380c8b){var _0x5b1f5e={'raw':![],'where':{'id':_0x96fb22[_0x47a5('0xb1')]['id']}},_0x1522a6={};_0x1522a6[_0x47a5('0x3a')]=_[_0x47a5('0x73')](db['SmsInteraction'][_0x47a5('0x36')]);_0x1522a6['query']=_[_0x47a5('0x73')](_0x96fb22[_0x47a5('0x3b')]);_0x1522a6[_0x47a5('0x3c')]=_[_0x47a5('0xb2')](_0x1522a6[_0x47a5('0x3a')],_0x1522a6[_0x47a5('0x3b')]);_0x5b1f5e[_0x47a5('0x3d')]=_[_0x47a5('0xb2')](_0x1522a6[_0x47a5('0x3a')],qs['fields'](_0x96fb22[_0x47a5('0x3b')][_0x47a5('0x3e')]));_0x5b1f5e['attributes']=_0x5b1f5e[_0x47a5('0x3d')][_0x47a5('0x5e')]?_0x5b1f5e[_0x47a5('0x3d')]:_0x1522a6['model'];if(_0x96fb22['query'][_0x47a5('0xb3')]){_0x5b1f5e[_0x47a5('0xb4')]=[{'all':!![]}];}_0x5b1f5e=_['merge']({},_0x5b1f5e,_0x96fb22['options']);return db[_0x47a5('0x9e')][_0x47a5('0x5f')](_0x5b1f5e)['then'](handleEntityNotFound(_0x380c8b,null))[_0x47a5('0x29')](respondWithResult(_0x380c8b,null))[_0x47a5('0x34')](handleError(_0x380c8b,null));};exports['create']=function(_0x16097e,_0x427310){return db[_0x47a5('0x9e')][_0x47a5('0xb5')](_0x16097e[_0x47a5('0x72')],{})[_0x47a5('0x29')](respondWithResult(_0x427310,0xc9))['catch'](handleError(_0x427310,null));};exports['update']=function(_0x5bd86e,_0x133b7a){if(_0x5bd86e[_0x47a5('0x72')]['id']){delete _0x5bd86e['body']['id'];}return db[_0x47a5('0x9e')][_0x47a5('0x5f')]({'where':{'id':_0x5bd86e[_0x47a5('0xb1')]['id']}})[_0x47a5('0x29')](handleEntityNotFound(_0x133b7a,null))[_0x47a5('0x29')](saveUpdates(_0x5bd86e['body'],null))[_0x47a5('0x29')](respondWithResult(_0x133b7a,null))['catch'](handleError(_0x133b7a,null));};exports['destroy']=function(_0x5db0ed,_0x21cb5f){return db['SmsInteraction'][_0x47a5('0x5f')]({'where':{'id':_0x5db0ed[_0x47a5('0xb1')]['id']}})[_0x47a5('0x29')](handleEntityNotFound(_0x21cb5f,null))['then'](removeEntity(_0x21cb5f,null))[_0x47a5('0x34')](handleError(_0x21cb5f,null));};exports[_0x47a5('0xb6')]=function(_0x35bf37,_0x121750){return db[_0x47a5('0x9e')]['describe']()[_0x47a5('0x29')](respondWithResult(_0x121750,null))[_0x47a5('0x34')](handleError(_0x121750,null));};exports['addMessage']=function(_0x42ba59,_0x419870,_0xafa46f){return db[_0x47a5('0xb7')][_0x47a5('0x5f')]({'where':{'id':_0x42ba59[_0x47a5('0xb1')]['id']}})['then'](handleEntityNotFound(_0x419870,null))[_0x47a5('0x29')](function(_0x2e418d){if(_0x2e418d){return _0x2e418d['addMessage'](_0x42ba59[_0x47a5('0x72')][_0x47a5('0xb8')],_[_0x47a5('0xb9')](_0x42ba59[_0x47a5('0x72')],['ids','id'])||{});}})['then'](respondWithResult(_0x419870,null))['catch'](handleError(_0x419870,null));};exports['getMessages']=function(_0x1946c6,_0x27793e,_0x2c5785){var _0x30def7={'raw':![],'where':{}};var _0x31f896={};var _0x6bc37b={'count':0x0,'rows':[]};return db[_0x47a5('0x9e')][_0x47a5('0xba')]({'where':{'id':_0x1946c6['params']['id']}})[_0x47a5('0x29')](handleEntityNotFound(_0x27793e,null))[_0x47a5('0x29')](function(_0x2eef05){if(_0x2eef05){_0x31f896[_0x47a5('0x3a')]=_['keys'](db['SmsMessage'][_0x47a5('0x36')]);_0x31f896['query']=_['keys'](_0x1946c6[_0x47a5('0x3b')]);_0x31f896[_0x47a5('0x3c')]=_['intersection'](_0x31f896[_0x47a5('0x3a')],_0x31f896[_0x47a5('0x3b')]);_0x30def7[_0x47a5('0x3d')]=_['intersection'](_0x31f896[_0x47a5('0x3a')],qs[_0x47a5('0x3e')](_0x1946c6['query'][_0x47a5('0x3e')]));_0x30def7[_0x47a5('0x3d')]=_0x30def7[_0x47a5('0x3d')][_0x47a5('0x5e')]?_0x30def7[_0x47a5('0x3d')]:_0x31f896[_0x47a5('0x3a')];if(!_0x1946c6['query'][_0x47a5('0x3f')]('nolimit')){_0x30def7[_0x47a5('0x22')]=qs[_0x47a5('0x22')](_0x1946c6[_0x47a5('0x3b')][_0x47a5('0x22')]);_0x30def7['offset']=qs[_0x47a5('0x21')](_0x1946c6[_0x47a5('0x3b')][_0x47a5('0x21')]);}_0x30def7[_0x47a5('0x41')]=qs[_0x47a5('0x42')](_0x1946c6[_0x47a5('0x3b')][_0x47a5('0x42')]);_0x30def7[_0x47a5('0x43')]=qs[_0x47a5('0x3c')](_[_0x47a5('0x44')](_0x1946c6[_0x47a5('0x3b')],_0x31f896[_0x47a5('0x3c')]));_0x30def7['where'][_0x47a5('0xbb')]=_0x2eef05['id'];if(_0x1946c6[_0x47a5('0x3b')]['filter']){_0x30def7[_0x47a5('0x43')]=_[_0x47a5('0xbc')](_0x30def7[_0x47a5('0x43')],{'$or':_[_0x47a5('0x2f')](_0x30def7[_0x47a5('0x3d')],function(_0x58fac0){var _0x2dee0d={};_0x2dee0d[_0x58fac0]={'$like':'%'+_0x1946c6[_0x47a5('0x3b')][_0x47a5('0x85')]+'%'};return _0x2dee0d;})});}if(_0x1946c6[_0x47a5('0x3b')][_0x47a5('0x7a')]){var _0x363077=_0x1946c6[_0x47a5('0x3b')]['$gte']['split'](',');var _0xa3d578={};_0xa3d578[_0x363077[0x0]]={'$gte':moment(_0x363077[0x1])['format'](_0x47a5('0xbd'))};_0x30def7['where']=_[_0x47a5('0xbc')](_0x30def7[_0x47a5('0x43')],_0xa3d578);}_0x30def7=_[_0x47a5('0xbc')]({},_0x30def7,_0x1946c6[_0x47a5('0xbe')]);return db['SmsMessage'][_0x47a5('0x20')]({'where':_0x30def7[_0x47a5('0x43')]})[_0x47a5('0x29')](function(_0x5a150a){_0x6bc37b['count']=_0x5a150a;if(_0x1946c6[_0x47a5('0x3b')][_0x47a5('0xb3')]){_0x30def7[_0x47a5('0xb4')]=[{'all':!![]}];}return db[_0x47a5('0xb7')][_0x47a5('0xbf')](_0x30def7);})[_0x47a5('0x29')](function(_0x1c0323){_0x6bc37b[_0x47a5('0xc0')]=_0x1c0323;return _0x6bc37b;});}})['then'](respondWithFilteredResult(_0x27793e,_0x30def7))[_0x47a5('0x34')](handleError(_0x27793e,null));};exports['addTags']=function(_0x346322,_0xc3b5e1,_0x5b0b0b){return db['SmsInteraction'][_0x47a5('0x5f')]({'where':{'id':_0x346322[_0x47a5('0xb1')]['id']}})['then'](handleEntityNotFound(_0xc3b5e1,null))[_0x47a5('0x29')](function(_0x2b2693){if(_0x2b2693){return _0x2b2693[_0x47a5('0xc1')](_0x346322[_0x47a5('0x72')]['ids'],_[_0x47a5('0xb9')](_0x346322['body'],['ids','id'])||{})['spread'](function(){return db[_0x47a5('0xc2')]['findAll']({'attributes':['id',_0x47a5('0x2d'),_0x47a5('0x45')],'where':{'id':_0x346322[_0x47a5('0x72')][_0x47a5('0xb8')]}});})[_0x47a5('0x29')](function(_0x1dae08){socket[_0x47a5('0xc3')](_0x47a5('0xc4'),{'id':Number(_0x346322[_0x47a5('0xb1')]['id']),'tags':_0x1dae08||[]});return{'id':Number(_0x346322[_0x47a5('0xb1')]['id']),'tags':_0x1dae08||[]};});}})[_0x47a5('0x29')](respondWithResult(_0xc3b5e1,null))[_0x47a5('0x34')](handleError(_0xc3b5e1,null));};exports[_0x47a5('0xc5')]=function(_0x1bfa3b,_0xff64fb,_0x5e17cb){return db[_0x47a5('0x9e')][_0x47a5('0x5f')]({'where':{'id':_0x1bfa3b[_0x47a5('0xb1')]['id']}})[_0x47a5('0x29')](handleEntityNotFound(_0xff64fb,null))['then'](function(_0x367662){if(_0x367662){return _0x367662['removeTags'](_0x1bfa3b[_0x47a5('0x3b')]['ids']);}})[_0x47a5('0x29')](respondWithStatusCode(_0xff64fb,null))[_0x47a5('0x34')](handleError(_0xff64fb,null));};exports[_0x47a5('0xc6')]=function(_0x5c20aa,_0x35f735){var _0x217e04=moment()[_0x47a5('0xc7')]()['toString']();var _0x52798d=path[_0x47a5('0xc8')](config[_0x47a5('0xc9')],_0x47a5('0xca'),_0x47a5('0xcb'),_0x47a5('0xcc'));var _0x579e5c=path[_0x47a5('0xc8')](config['root'],_0x47a5('0xca'),_0x47a5('0xcb'),_0x47a5('0xcd'));var _0x2d6ae7=path['join'](_0x52798d,_0x217e04);var _0x4dc67c=util[_0x47a5('0xce')](_0x47a5('0xcf'),_0x5c20aa[_0x47a5('0xb1')]['id'],_0x217e04);var _0x4339d4=path[_0x47a5('0xc8')](_0x52798d,_0x4dc67c);var _0x36a44c=[];_0x36a44c[_0x47a5('0xaf')]({'model':db[_0x47a5('0x6e')],'as':_0x47a5('0x6e'),'attributes':['id','fullname'],'raw':!![]});_0x36a44c['push']({'model':db[_0x47a5('0xd0')],'as':'Contact','attributes':['id',_0x47a5('0xd1'),_0x47a5('0xd2')],'raw':!![]});var _0x1bae88=[{'model':db['SmsMessage'],'as':_0x47a5('0xd3'),'attributes':['id',_0x47a5('0x72'),'createdAt',_0x47a5('0xd4'),'secret',_0x47a5('0x80')],'include':_0x36a44c}];_0x1bae88[_0x47a5('0xaf')]({'model':db[_0x47a5('0xd5')],'as':'Account','attributes':['id','name']});_0x1bae88['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x47a5('0x30')]});return db['SmsInteraction'][_0x47a5('0x5f')]({'where':{'id':_0x5c20aa[_0x47a5('0xb1')]['id']},'include':_0x1bae88})['then'](handleEntityNotFound(_0x35f735,null))['then'](function(_0x4b3529){if(_0x4b3529){var _0x2a6dca=_0x4b3529['get']({'plain':!![]});fs['mkdirSync'](_0x2d6ae7);var _0x5d17dc={'channel':_0x47a5('0xd6'),'account':_0x2a6dca[_0x47a5('0xd7')][_0x47a5('0x2d')],'agent':_0x2a6dca[_0x47a5('0xd8')]?_0x2a6dca['Owner'][_0x47a5('0x30')]:'N.A.','createdAt':moment(_0x2a6dca[_0x47a5('0xd9')])['format'](_0x47a5('0xbd'))[_0x47a5('0x9c')](),'closedAt':_0x2a6dca[_0x47a5('0xda')]?moment(_0x2a6dca['closedAt'])[_0x47a5('0xce')](_0x47a5('0xbd'))[_0x47a5('0x9c')]():'','disposition':_0x2a6dca[_0x47a5('0xdb')],'messages':_(_0x2a6dca['Messages'])[_0x47a5('0x85')]({'secret':![]})[_0x47a5('0x2f')](function(_0x4eebcd){return{'date':moment(_0x4eebcd[_0x47a5('0xd9')])[_0x47a5('0xce')](_0x47a5('0xbd'))['toString'](),'sender':_0x4eebcd[_0x47a5('0xd4')]===_0x47a5('0xdc')?_0x4eebcd[_0x47a5('0x6e')]?_0x4eebcd[_0x47a5('0x6e')][_0x47a5('0x30')]:_0x47a5('0xdd'):_0x4eebcd[_0x47a5('0x64')][_0x47a5('0xd1')]+(_0x4eebcd[_0x47a5('0x64')][_0x47a5('0xd2')]?'\x20'+_0x4eebcd[_0x47a5('0x64')][_0x47a5('0xd2')]:''),'body':_0x4eebcd[_0x47a5('0x72')],'direction':_0x4eebcd[_0x47a5('0xd4')]===_0x47a5('0xdc')?'A':'C','secret':_0x4eebcd[_0x47a5('0xde')],'read':_0x4eebcd[_0x47a5('0x80')]};})['value']()};return ejs[_0x47a5('0xdf')](path['join'](config['root'],_0x47a5('0xca'),_0x47a5('0xe0'),_0x47a5('0xe1')),{'interaction':_0x5d17dc})['then'](function(_0x1f8e28){var _0xd8381b=path[_0x47a5('0xc8')](_0x2d6ae7,_0x47a5('0xe2')+_0x2a6dca['id']+'-'+_0x217e04+_0x47a5('0xe3'));var _0x28ba38={'path':_0xd8381b,'channel':_0x47a5('0xd6'),'interactionId':_0x2a6dca['id']};return pdf[_0x47a5('0xe4')](_0x1f8e28,_0x28ba38);})[_0x47a5('0x29')](function(){return new BPromise(function(_0x15f273,_0x10952f){zipdir(_0x2d6ae7,{'saveTo':_0x4339d4},function(_0x399026,_0x203bc9){if(_0x399026)return _0x10952f(_0x399026);return _0x15f273(_0x203bc9);});})['then'](function(){return new BPromise(function(_0x4aad5f,_0x2884c9){rimraf(_0x2d6ae7,function(_0x5e7d56){if(_0x5e7d56)_0x2884c9(_0x5e7d56);return _0x4aad5f();});});})[_0x47a5('0x29')](function(){return _0x35f735[_0x47a5('0xc6')](_0x4339d4,_0x4dc67c,function(_0x1f776e){if(_0x1f776e){console[_0x47a5('0xe5')](_0x47a5('0xe6'),_0x1f776e);}else{fs[_0x47a5('0xe7')](_0x4339d4);}});});});}else{return _0x35f735['sendStatus'](0xc8);}})[_0x47a5('0x34')](handleError(_0x35f735,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 10f2276..d27ee12 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 _0xe0c3=['findAll','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x6e2052,_0x10b0f9){var _0x2197f2=function(_0x329893){while(--_0x329893){_0x6e2052['push'](_0x6e2052['shift']());}};_0x2197f2(++_0x10b0f9);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x3e0c('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x3e0c('0x1')];var SmsMessage=require(_0x3e0c('0x2'))['db'][_0x3e0c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3e0c('0x4')](0x0);var events={'afterCreate':_0x3e0c('0x5'),'afterUpdate':_0x3e0c('0x6'),'afterDestroy':_0x3e0c('0x7')};function emitEvent(_0x26c964){return function(_0x1a026f,_0x511cfa,_0x530ebf){_0x1a026f[_0x3e0c('0x8')]({'attributes':['id'],'raw':!![]})[_0x3e0c('0x9')](function(_0x3f6607){_0x1a026f[_0x3e0c('0xa')](_0x3e0c('0xb'),_0x3f6607[_0x3e0c('0xc')](function(_0x1dbe0f){return{'id':_0x1dbe0f['id']};}));return SmsMessage[_0x3e0c('0xd')]({'where':{'SmsInteractionId':_0x1a026f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3e0c('0x9')](function(_0x35d56f){_0x1a026f[_0x3e0c('0xa')]('unreadMessages',_0x35d56f['length']);SmsInteractionEvents[_0x3e0c('0xe')](_0x26c964+':'+_0x1a026f['id'],_0x1a026f);SmsInteractionEvents[_0x3e0c('0xe')](_0x26c964,_0x1a026f);_0x530ebf(null);})[_0x3e0c('0xf')](_0x530ebf(null));};}for(var e in events){if(events[_0x3e0c('0x10')](e)){var event=events[e];SmsInteraction[_0x3e0c('0x11')](e,emitEvent(event));}}module[_0x3e0c('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x5fc3=['SmsMessage','setMaxListeners','save','update','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x274733,_0x1eb5cc){var _0x371fd3=function(_0x5121cf){while(--_0x5121cf){_0x274733['push'](_0x274733['shift']());}};_0x371fd3(++_0x1eb5cc);}(_0x5fc3,0xa8));var _0x35fc=function(_0xa1e3ca,_0x559022){_0xa1e3ca=_0xa1e3ca-0x0;var _0x5005ab=_0x5fc3[_0xa1e3ca];return _0x5005ab;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var SmsInteraction=require(_0x35fc('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x35fc('0x1'))['db'][_0x35fc('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x35fc('0x3')](0x0);var events={'afterCreate':_0x35fc('0x4'),'afterUpdate':_0x35fc('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2d1404){return function(_0x1d5fec,_0x186a06,_0x5b85ad){_0x1d5fec['getUsers']({'attributes':['id'],'raw':!![]})[_0x35fc('0x6')](function(_0x508b32){_0x1d5fec[_0x35fc('0x7')](_0x35fc('0x8'),_0x508b32[_0x35fc('0x9')](function(_0x1e5f90){return{'id':_0x1e5f90['id']};}));return SmsMessage[_0x35fc('0xa')]({'where':{'SmsInteractionId':_0x1d5fec['id'],'direction':'in','read':![]},'raw':!![]});})[_0x35fc('0x6')](function(_0x2051ab){_0x1d5fec['setDataValue'](_0x35fc('0xb'),_0x2051ab[_0x35fc('0xc')]);SmsInteractionEvents['emit'](_0x2d1404+':'+_0x1d5fec['id'],_0x1d5fec);SmsInteractionEvents[_0x35fc('0xd')](_0x2d1404,_0x1d5fec);_0x5b85ad(null);})[_0x35fc('0xe')](_0x5b85ad(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x35fc('0xf')](e,emitEvent(event));}}module[_0x35fc('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 ded04d0..8e2de3f 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 _0x79eb=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4ef11c,_0x387510){var _0x1c3026=function(_0x582d43){while(--_0x582d43){_0x4ef11c['push'](_0x4ef11c['shift']());}};_0x1c3026(++_0x387510);}(_0x79eb,0xa8));var _0xb79e=function(_0x5a24b0,_0x4966a2){_0x5a24b0=_0x5a24b0-0x0;var _0x5151c2=_0x79eb[_0x5a24b0];return _0x5151c2;};'use strict';var _=require('lodash');var util=require(_0xb79e('0x0'));var logger=require(_0xb79e('0x1'))(_0xb79e('0x2'));var moment=require(_0xb79e('0x3'));var BPromise=require(_0xb79e('0x4'));var rp=require(_0xb79e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb79e('0x6'));var config=require(_0xb79e('0x7'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x1d84c,_0x24ccee){return _0x1d84c[_0xb79e('0x8')]('SmsInteraction',attributes,{'tableName':_0xb79e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xccb422,_0xe9bb94,_0xbaa01f){if(_0xccb422[_0xb79e('0xa')]('closed')){_0xccb422[_0xb79e('0xb')]=moment()[_0xb79e('0xc')](_0xb79e('0xd'));}_0xbaa01f(null,_0xccb422);}}});}; \ No newline at end of file +var _0x8554=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8554,0x1c2));var _0x4855=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8554[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x4855('0x0'));var util=require(_0x4855('0x1'));var logger=require(_0x4855('0x2'))(_0x4855('0x3'));var moment=require(_0x4855('0x4'));var BPromise=require(_0x4855('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4855('0x6'));var rimraf=require(_0x4855('0x7'));var config=require(_0x4855('0x8'));var attributes=require(_0x4855('0x9'));module[_0x4855('0xa')]=function(_0x2d4aed,_0x3fa63c){return _0x2d4aed[_0x4855('0xb')]('SmsInteraction',attributes,{'tableName':_0x4855('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x44b011,_0x5d06b9,_0x47787c){if(_0x44b011[_0x4855('0xd')](_0x4855('0xe'))){_0x44b011[_0x4855('0xf')]=moment()[_0x4855('0x10')](_0x4855('0x11'));}_0x47787c(null,_0x44b011);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index d57e564..92d3581 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 _0x8c21=['then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./smsInteraction.socket','request'];(function(_0x4c3a6a,_0x5da174){var _0x41d658=function(_0x209763){while(--_0x209763){_0x4c3a6a['push'](_0x4c3a6a['shift']());}};_0x41d658(++_0x5da174);}(_0x8c21,0x18b));var _0x18c2=function(_0x38b82d,_0x346436){_0x38b82d=_0x38b82d-0x0;var _0x38a684=_0x8c21[_0x38b82d];return _0x38a684;};'use strict';var _=require(_0x18c2('0x0'));var util=require(_0x18c2('0x1'));var moment=require(_0x18c2('0x2'));var BPromise=require(_0x18c2('0x3'));var rs=require(_0x18c2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18c2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x18c2('0x6'))(_0x18c2('0x7'));var config=require('../../config/environment');var jayson=require(_0x18c2('0x8'));var client=jayson['client'][_0x18c2('0x9')]({'port':0x232a});config[_0x18c2('0xa')]=_[_0x18c2('0xb')](config[_0x18c2('0xa')],{'host':_0x18c2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x18c2('0xa')]));require(_0x18c2('0xd'))['register'](socket);function respondWithRpcPromise(_0x2645dc,_0x2e8e03,_0x2f4ac5){return new BPromise(function(_0x3ae9a0,_0xa8ea9c){return client[_0x18c2('0xe')](_0x2645dc,_0x2f4ac5)[_0x18c2('0xf')](function(_0x4778ad){logger[_0x18c2('0x10')](_0x18c2('0x11'),_0x2e8e03,_0x18c2('0x12'));logger[_0x18c2('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x2e8e03,_0x18c2('0x12'),JSON[_0x18c2('0x14')](_0x4778ad));if(_0x4778ad[_0x18c2('0x15')]){if(_0x4778ad['error'][_0x18c2('0x16')]===0x1f4){logger[_0x18c2('0x15')](_0x18c2('0x11'),_0x2e8e03,_0x4778ad[_0x18c2('0x15')][_0x18c2('0x17')]);return _0xa8ea9c(_0x4778ad['error']['message']);}logger[_0x18c2('0x15')](_0x18c2('0x11'),_0x2e8e03,_0x4778ad[_0x18c2('0x15')][_0x18c2('0x17')]);return _0x3ae9a0(_0x4778ad[_0x18c2('0x15')]['message']);}else{logger[_0x18c2('0x10')](_0x18c2('0x11'),_0x2e8e03,_0x18c2('0x12'));_0x3ae9a0(_0x4778ad[_0x18c2('0x18')][_0x18c2('0x17')]);}})[_0x18c2('0x19')](function(_0x3f043c){logger[_0x18c2('0x15')](_0x18c2('0x11'),_0x2e8e03,_0x3f043c);_0xa8ea9c(_0x3f043c);});});}exports[_0x18c2('0x1a')]=function(_0x23f478){var _0x3f0e58=this;return new Promise(function(_0x3e07f5,_0x27db03){return db[_0x18c2('0x1b')][_0x18c2('0x1c')](_0x23f478[_0x18c2('0x1d')],{'raw':_0x23f478[_0x18c2('0x1e')]?_0x23f478[_0x18c2('0x1e')][_0x18c2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23f478[_0x18c2('0x1e')]?_0x23f478[_0x18c2('0x1e')][_0x18c2('0x20')]||null:null,'attributes':_0x23f478[_0x18c2('0x1e')]?_0x23f478['options'][_0x18c2('0x21')]||null:null,'limit':_0x23f478['options']?_0x23f478[_0x18c2('0x1e')]['limit']||null:null})[_0x18c2('0xf')](function(_0x2a1fde){logger[_0x18c2('0x10')](_0x18c2('0x1a'),_0x23f478);logger[_0x18c2('0x13')](_0x18c2('0x1a'),_0x23f478,JSON[_0x18c2('0x14')](_0x2a1fde));_0x3e07f5(_0x2a1fde);})[_0x18c2('0x19')](function(_0x7d434b){logger[_0x18c2('0x15')](_0x18c2('0x1a'),_0x7d434b[_0x18c2('0x17')],_0x23f478);_0x27db03(_0x3f0e58[_0x18c2('0x15')](0x1f4,_0x7d434b[_0x18c2('0x17')]));});});};exports[_0x18c2('0x22')]=function(_0x42ce2f){return new Promise(function(_0x6695c1,_0x4a258b){return db['SmsInteraction'][_0x18c2('0x23')]({'where':_0x42ce2f['options']?_0x42ce2f['options'][_0x18c2('0x20')]||null:null})['then'](function(_0x3f6947){if(_0x3f6947){return _0x3f6947[_0x18c2('0x24')](_0x42ce2f[_0x18c2('0x1d')][_0x18c2('0x25')],_[_0x18c2('0x26')](_0x42ce2f['body'],[_0x18c2('0x25'),'id'])||{});}})[_0x18c2('0x27')](function(_0x5114b3){logger['info']('AddTags',_0x42ce2f);logger[_0x18c2('0x13')](_0x18c2('0x28'),_0x42ce2f,JSON[_0x18c2('0x14')](_0x5114b3));_0x6695c1(_0x5114b3);})[_0x18c2('0x19')](function(_0x56d13c){logger[_0x18c2('0x15')]('AddTags',_0x56d13c[_0x18c2('0x17')],_0x42ce2f);_0x4a258b(_this['error'](0x1f4,_0x56d13c[_0x18c2('0x17')]));});});}; \ No newline at end of file +var _0x9506=['error','code','message','result','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','limit','catch','find','ids','spread','AddTags','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17738e,_0x33bc7a){var _0x416236=function(_0x5224d8){while(--_0x5224d8){_0x17738e['push'](_0x17738e['shift']());}};_0x416236(++_0x33bc7a);}(_0x9506,0xf5));var _0x6950=function(_0x482418,_0x455a71){_0x482418=_0x482418-0x0;var _0x527e16=_0x9506[_0x482418];return _0x527e16;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6950('0x0'));var BPromise=require(_0x6950('0x1'));var rs=require(_0x6950('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6950('0x3'))['db'];var utils=require(_0x6950('0x4'));var logger=require(_0x6950('0x5'))(_0x6950('0x6'));var config=require(_0x6950('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6950('0x8')][_0x6950('0x9')]({'port':0x232a});config['redis']=_[_0x6950('0xa')](config[_0x6950('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6950('0xc'))(new Redis(config[_0x6950('0xb')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x5f2ecb,_0x5204fa,_0x3863cb){return new BPromise(function(_0xfa3415,_0x286656){return client[_0x6950('0xd')](_0x5f2ecb,_0x3863cb)[_0x6950('0xe')](function(_0x43e0cd){logger[_0x6950('0xf')](_0x6950('0x10'),_0x5204fa,_0x6950('0x11'));logger[_0x6950('0x12')](_0x6950('0x13'),_0x5204fa,_0x6950('0x11'),JSON[_0x6950('0x14')](_0x43e0cd));if(_0x43e0cd[_0x6950('0x15')]){if(_0x43e0cd[_0x6950('0x15')][_0x6950('0x16')]===0x1f4){logger[_0x6950('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x5204fa,_0x43e0cd[_0x6950('0x15')][_0x6950('0x17')]);return _0x286656(_0x43e0cd[_0x6950('0x15')][_0x6950('0x17')]);}logger[_0x6950('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x5204fa,_0x43e0cd[_0x6950('0x15')][_0x6950('0x17')]);return _0xfa3415(_0x43e0cd[_0x6950('0x15')][_0x6950('0x17')]);}else{logger[_0x6950('0xf')](_0x6950('0x10'),_0x5204fa,'request\x20sent');_0xfa3415(_0x43e0cd[_0x6950('0x18')]['message']);}})['catch'](function(_0x12b650){logger[_0x6950('0x15')](_0x6950('0x10'),_0x5204fa,_0x12b650);_0x286656(_0x12b650);});});}exports[_0x6950('0x19')]=function(_0x553509){var _0x47b6fb=this;return new Promise(function(_0x42a1a7,_0x4f2bfe){return db[_0x6950('0x1a')][_0x6950('0x1b')](_0x553509[_0x6950('0x1c')],{'raw':_0x553509['options']?_0x553509[_0x6950('0x1d')][_0x6950('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x553509[_0x6950('0x1d')]?_0x553509[_0x6950('0x1d')]['where']||null:null,'attributes':_0x553509['options']?_0x553509['options'][_0x6950('0x1f')]||null:null,'limit':_0x553509[_0x6950('0x1d')]?_0x553509[_0x6950('0x1d')][_0x6950('0x20')]||null:null})['then'](function(_0x244977){logger[_0x6950('0xf')](_0x6950('0x19'),_0x553509);logger[_0x6950('0x12')](_0x6950('0x19'),_0x553509,JSON[_0x6950('0x14')](_0x244977));_0x42a1a7(_0x244977);})[_0x6950('0x21')](function(_0x5004ad){logger[_0x6950('0x15')](_0x6950('0x19'),_0x5004ad[_0x6950('0x17')],_0x553509);_0x4f2bfe(_0x47b6fb['error'](0x1f4,_0x5004ad['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x1405d9){return new Promise(function(_0x1d79d1,_0x523631){return db[_0x6950('0x1a')][_0x6950('0x22')]({'where':_0x1405d9[_0x6950('0x1d')]?_0x1405d9[_0x6950('0x1d')]['where']||null:null})[_0x6950('0xe')](function(_0x14d742){if(_0x14d742){return _0x14d742['addTags'](_0x1405d9['body'][_0x6950('0x23')],_['omit'](_0x1405d9[_0x6950('0x1c')],['ids','id'])||{});}})[_0x6950('0x24')](function(_0x232b96){logger[_0x6950('0xf')](_0x6950('0x25'),_0x1405d9);logger[_0x6950('0x12')](_0x6950('0x25'),_0x1405d9,JSON[_0x6950('0x14')](_0x232b96));_0x1d79d1(_0x232b96);})['catch'](function(_0x1955e7){logger['error'](_0x6950('0x25'),_0x1955e7['message'],_0x1405d9);_0x523631(_this[_0x6950('0x15')](0x1f4,_0x1955e7[_0x6950('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 319dbd8..dbbcfa1 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 _0xb10b=['emit','removeListener','register','smsInteraction:','./smsInteraction.events','remove','update'];(function(_0x5263d2,_0x476862){var _0x2363a0=function(_0x22380d){while(--_0x22380d){_0x5263d2['push'](_0x5263d2['shift']());}};_0x2363a0(++_0x476862);}(_0xb10b,0x12a));var _0xbb10=function(_0xbc86fc,_0x1bb24d){_0xbc86fc=_0xbc86fc-0x0;var _0x549976=_0xb10b[_0xbc86fc];return _0x549976;};'use strict';var SmsInteractionEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){SmsInteractionEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);SmsInteractionEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file +var _0x757a=['save','remove','emit','removeListener','register','smsInteraction:'];(function(_0x4a13d7,_0x1ea6c4){var _0x3a4014=function(_0x16f931){while(--_0x16f931){_0x4a13d7['push'](_0x4a13d7['shift']());}};_0x3a4014(++_0x1ea6c4);}(_0x757a,0xde));var _0xa757=function(_0x5e7b40,_0x177d20){_0x5e7b40=_0x5e7b40-0x0;var _0x8e0859=_0x757a[_0x5e7b40];return _0x8e0859;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa757('0x0'),_0xa757('0x1'),'update'];function createListener(_0x5c03c3,_0x5709ed){return function(_0x32be3b){_0x5709ed[_0xa757('0x2')](_0x5c03c3,_0x32be3b);};}function removeListener(_0x1c2932,_0x453d07){return function(){SmsInteractionEvents[_0xa757('0x3')](_0x1c2932,_0x453d07);};}exports[_0xa757('0x4')]=function(_0x5edca8){for(var _0xae0e7c=0x0,_0x4343b6=events['length'];_0xae0e7c<_0x4343b6;_0xae0e7c++){var _0x2930fa=events[_0xae0e7c];var _0x2f7793=createListener(_0xa757('0x5')+_0x2930fa,_0x5edca8);SmsInteractionEvents['on'](_0x2930fa,_0x2f7793);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 06e1987..21e3393 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 _0xf0b5=['get','isAuthenticated','index','/describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','/:id/reject','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x41bbd7,_0x3041f8){var _0x116b13=function(_0x411319){while(--_0x411319){_0x41bbd7['push'](_0x41bbd7['shift']());}};_0x116b13(++_0x3041f8);}(_0xf0b5,0x19a));var _0x5f0b=function(_0x198e29,_0x3b8474){_0x198e29=_0x198e29-0x0;var _0x10ccb3=_0xf0b5[_0x198e29];return _0x10ccb3;};'use strict';var multer=require('multer');var util=require(_0x5f0b('0x0'));var path=require('path');var timeout=require(_0x5f0b('0x1'));var express=require(_0x5f0b('0x2'));var router=express[_0x5f0b('0x3')]();var fs_extra=require(_0x5f0b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5f0b('0x5'));var controller=require('./smsMessage.controller');router[_0x5f0b('0x6')]('/',auth[_0x5f0b('0x7')](),controller[_0x5f0b('0x8')]);router[_0x5f0b('0x6')](_0x5f0b('0x9'),auth[_0x5f0b('0x7')](),controller['describe']);router[_0x5f0b('0x6')](_0x5f0b('0xa'),auth[_0x5f0b('0x7')](),controller[_0x5f0b('0xb')]);router[_0x5f0b('0xc')]('/',auth[_0x5f0b('0x7')](),interaction[_0x5f0b('0xd')](_0x5f0b('0xe'),_0x5f0b('0xf')),controller[_0x5f0b('0x10')]);router['post'](_0x5f0b('0x11'),controller[_0x5f0b('0x12')]);router[_0x5f0b('0x13')](_0x5f0b('0xa'),auth[_0x5f0b('0x7')](),controller[_0x5f0b('0x14')]);router[_0x5f0b('0x13')](_0x5f0b('0x15'),auth[_0x5f0b('0x7')](),controller['accept']);router[_0x5f0b('0x13')](_0x5f0b('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0x5f0b('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x5f0b('0x18')]);module[_0x5f0b('0x19')]=router; \ No newline at end of file +var _0x49b0=['put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x49b0,0x1ac));var _0x049b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x49b0[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x049b('0x0'));var util=require(_0x049b('0x1'));var path=require(_0x049b('0x2'));var timeout=require('connect-timeout');var express=require(_0x049b('0x3'));var router=express[_0x049b('0x4')]();var fs_extra=require(_0x049b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x049b('0x6'));var controller=require(_0x049b('0x7'));router[_0x049b('0x8')]('/',auth['isAuthenticated'](),controller[_0x049b('0x9')]);router[_0x049b('0x8')](_0x049b('0xa'),auth[_0x049b('0xb')](),controller[_0x049b('0xc')]);router['get'](_0x049b('0xd'),auth[_0x049b('0xb')](),controller[_0x049b('0xe')]);router[_0x049b('0xf')]('/',auth[_0x049b('0xb')](),interaction[_0x049b('0x10')](_0x049b('0x11'),_0x049b('0x12')),controller[_0x049b('0x13')]);router[_0x049b('0xf')](_0x049b('0x14'),controller[_0x049b('0x15')]);router[_0x049b('0x16')](_0x049b('0xd'),auth[_0x049b('0xb')](),controller[_0x049b('0x17')]);router['put'](_0x049b('0x18'),auth[_0x049b('0xb')](),controller[_0x049b('0x19')]);router['put']('/:id/reject',auth[_0x049b('0xb')](),controller[_0x049b('0x1a')]);router[_0x049b('0x1b')](_0x049b('0xd'),auth[_0x049b('0xb')](),controller[_0x049b('0x1c')]);module[_0x049b('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 076bdd3..339a482 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 _0x9088=['out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x22a2df,_0x1eca79){var _0x28704c=function(_0x302757){while(--_0x302757){_0x22a2df['push'](_0x22a2df['shift']());}};_0x28704c(++_0x1eca79);}(_0x9088,0x183));var _0x8908=function(_0xdab269,_0x325db4){_0xdab269=_0xdab269-0x0;var _0x45523c=_0x9088[_0xdab269];return _0x45523c;};'use strict';var Sequelize=require(_0x8908('0x0'));module[_0x8908('0x1')]={'body':{'type':Sequelize[_0x8908('0x2')](_0x8908('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8908('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x8908('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8908('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8908('0x6')]},'readAt':{'type':Sequelize[_0x8908('0x7')]},'secret':{'type':Sequelize[_0x8908('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8908('0x6')]},'providerResponse':{'type':Sequelize[_0x8908('0x2')]}}; \ No newline at end of file +var _0xfe86=['exports','TEXT','medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xfe86,0x194));var _0x6fe8=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0xfe86[_0x457b64];return _0x437111;};'use strict';var Sequelize=require(_0x6fe8('0x0'));module[_0x6fe8('0x1')]={'body':{'type':Sequelize[_0x6fe8('0x2')](_0x6fe8('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6fe8('0x4')]('in',_0x6fe8('0x5')),'defaultValue':_0x6fe8('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6fe8('0x6')](0xbe)},'phone':{'type':Sequelize[_0x6fe8('0x6')]},'readAt':{'type':Sequelize[_0x6fe8('0x7')]},'secret':{'type':Sequelize[_0x6fe8('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6fe8('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 5886bc9..00c3414 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 _0xeea2=['ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','request\x20sent','status','end','json','count','offset','limit','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','params','include','find','create','body','describe','accept','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','Contact','get','SmsInteraction','read1stAt','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','inspect','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','groupName','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x4aaa2f,_0x2a83dd){var _0x30fd9c=function(_0x275eb2){while(--_0x275eb2){_0x4aaa2f['push'](_0x4aaa2f['shift']());}};_0x30fd9c(++_0x2a83dd);}(_0xeea2,0x192));var _0x2eea=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xeea2[_0x12f688];return _0x59c3de;};'use strict';var emlformat=require(_0x2eea('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2eea('0x1'));var moment=require(_0x2eea('0x2'));var BPromise=require(_0x2eea('0x3'));var Mustache=require(_0x2eea('0x4'));var util=require(_0x2eea('0x5'));var path=require(_0x2eea('0x6'));var sox=require(_0x2eea('0x7'));var csv=require(_0x2eea('0x8'));var ejs=require(_0x2eea('0x9'));var fs=require('fs');var fs_extra=require(_0x2eea('0xa'));var _=require(_0x2eea('0xb'));var squel=require(_0x2eea('0xc'));var crypto=require('crypto');var jsforce=require(_0x2eea('0xd'));var deskjs=require(_0x2eea('0xe'));var toCsv=require(_0x2eea('0x8'));var querystring=require(_0x2eea('0xf'));var Papa=require(_0x2eea('0x10'));var Redis=require(_0x2eea('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2eea('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2eea('0x13'));var logger=require(_0x2eea('0x14'))(_0x2eea('0x15'));var utils=require(_0x2eea('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2eea('0x17'));var db=require('../../mysqldb')['db'];config[_0x2eea('0x18')]=_['defaults'](config[_0x2eea('0x18')],{'host':_0x2eea('0x19'),'port':0x18eb});var socket=require(_0x2eea('0x1a'))(new Redis(config[_0x2eea('0x18')]));require(_0x2eea('0x1b'))[_0x2eea('0x1c')](socket);var jayson=require(_0x2eea('0x1d'));var client=jayson[_0x2eea('0x1e')][_0x2eea('0x1f')]({'port':0x232c});var client9002=jayson[_0x2eea('0x1e')][_0x2eea('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xbc439c,_0x2d55d2,_0x1059fc,_0xbb0326){return new BPromise(function(_0x4d9e19,_0x53a280){var _0x208540=_0xbb0326||client;return _0x208540[_0x2eea('0x20')](_0xbc439c,_0x1059fc)[_0x2eea('0x21')](function(_0x2dbfa8){logger[_0x2eea('0x22')]('SmsMessage,\x20%s,\x20%s',_0x2d55d2,'request\x20sent');logger[_0x2eea('0x23')](_0x2eea('0x24'),_0x2d55d2,'request\x20sent',JSON[_0x2eea('0x25')](_0x2dbfa8));if(_0x2dbfa8[_0x2eea('0x26')]){if(_0x2dbfa8[_0x2eea('0x26')][_0x2eea('0x27')]===0x1f4){logger['error'](_0x2eea('0x28'),_0x2d55d2,_0x2dbfa8[_0x2eea('0x26')][_0x2eea('0x29')]);return _0x53a280(_0x2dbfa8[_0x2eea('0x26')][_0x2eea('0x29')]);}logger[_0x2eea('0x26')]('SmsMessage,\x20%s,\x20%s',_0x2d55d2,_0x2dbfa8[_0x2eea('0x26')][_0x2eea('0x29')]);return _0x4d9e19(_0x2dbfa8[_0x2eea('0x26')][_0x2eea('0x29')]);}else{logger['info'](_0x2eea('0x28'),_0x2d55d2,_0x2eea('0x2a'));_0x4d9e19(_0x2dbfa8['result'][_0x2eea('0x29')]);}})['catch'](function(_0x103c23){logger[_0x2eea('0x26')](_0x2eea('0x28'),_0x2d55d2,_0x103c23);_0x53a280(_0x103c23);});});}function respondWithStatusCode(_0x103916,_0xcb453f){_0xcb453f=_0xcb453f||0xcc;return function(_0x77e690){if(_0x77e690){return _0x103916['sendStatus'](_0xcb453f);}return _0x103916[_0x2eea('0x2b')](_0xcb453f)[_0x2eea('0x2c')]();};}function respondWithResult(_0x3e6705,_0x496dde){_0x496dde=_0x496dde||0xc8;return function(_0x593209){if(_0x593209){return _0x3e6705['status'](_0x496dde)[_0x2eea('0x2d')](_0x593209);}};}function respondWithFilteredResult(_0x2f3154,_0x4bf498){return function(_0x330f84){if(_0x330f84){var _0x51b6bf=_0x330f84[_0x2eea('0x2e')],_0x52684e=_0x4bf498[_0x2eea('0x2f')],_0x3e4f30=_0x4bf498[_0x2eea('0x2f')]+_0x4bf498[_0x2eea('0x30')],_0x4b19af;if(_0x3e4f30>=_0x51b6bf){_0x3e4f30=_0x51b6bf;_0x4b19af=0xc8;}else{_0x4b19af=0xce;}_0x2f3154[_0x2eea('0x2b')](_0x4b19af);return _0x2f3154['set'](_0x2eea('0x31'),_0x52684e+'-'+_0x3e4f30+'/'+_0x51b6bf)[_0x2eea('0x2d')](_0x330f84);}return null;};}function patchUpdates(_0x1cf530){return function(_0x3b812c){try{jsonpatch['apply'](_0x3b812c,_0x1cf530,!![]);}catch(_0x53e258){return BPromise[_0x2eea('0x32')](_0x53e258);}return _0x3b812c[_0x2eea('0x33')]();};}function saveUpdates(_0x2b8a1f,_0x527c21){return function(_0x1cb6aa){if(_0x1cb6aa){return _0x1cb6aa[_0x2eea('0x34')](_0x2b8a1f)[_0x2eea('0x21')](function(_0x2d2a1){return _0x2d2a1;});}return null;};}function removeEntity(_0xa80642,_0x3446ac){return function(_0x195146){if(_0x195146){return _0x195146[_0x2eea('0x35')]()[_0x2eea('0x21')](function(){_0xa80642[_0x2eea('0x2b')](0xcc)[_0x2eea('0x2c')]();});}};}function handleEntityNotFound(_0x174e04,_0x30758e){return function(_0x3e813f){if(!_0x3e813f){_0x174e04[_0x2eea('0x36')](0x194);}return _0x3e813f;};}function handleError(_0x2985ce,_0x40e108){_0x40e108=_0x40e108||0x1f4;return function(_0x396bab){logger[_0x2eea('0x26')](_0x396bab[_0x2eea('0x37')]);if(_0x396bab[_0x2eea('0x38')]){delete _0x396bab[_0x2eea('0x38')];}_0x2985ce[_0x2eea('0x2b')](_0x40e108)[_0x2eea('0x39')](_0x396bab);};}exports[_0x2eea('0x3a')]=function(_0xd57fe1,_0x2e0687){var _0x4c0c3a={},_0xa3b33f={},_0x1640db={'count':0x0,'rows':[]};var _0x408489=_[_0x2eea('0x3b')](db[_0x2eea('0x3c')][_0x2eea('0x3d')],function(_0x10b0c6){return{'name':_0x10b0c6[_0x2eea('0x3e')],'type':_0x10b0c6[_0x2eea('0x3f')][_0x2eea('0x40')]};});_0xa3b33f[_0x2eea('0x41')]=_['map'](_0x408489,_0x2eea('0x38'));_0xa3b33f[_0x2eea('0x42')]=_[_0x2eea('0x43')](_0xd57fe1[_0x2eea('0x42')]);_0xa3b33f[_0x2eea('0x44')]=_[_0x2eea('0x45')](_0xa3b33f[_0x2eea('0x41')],_0xa3b33f[_0x2eea('0x42')]);_0x4c0c3a[_0x2eea('0x46')]=_['intersection'](_0xa3b33f['model'],qs[_0x2eea('0x47')](_0xd57fe1['query']['fields']));_0x4c0c3a[_0x2eea('0x46')]=_0x4c0c3a['attributes'][_0x2eea('0x48')]?_0x4c0c3a[_0x2eea('0x46')]:_0xa3b33f[_0x2eea('0x41')];if(!_0xd57fe1[_0x2eea('0x42')][_0x2eea('0x49')]('nolimit')){_0x4c0c3a['limit']=qs[_0x2eea('0x30')](_0xd57fe1['query'][_0x2eea('0x30')]);_0x4c0c3a[_0x2eea('0x2f')]=qs[_0x2eea('0x2f')](_0xd57fe1[_0x2eea('0x42')][_0x2eea('0x2f')]);}_0x4c0c3a[_0x2eea('0x4a')]=qs['sort'](_0xd57fe1[_0x2eea('0x42')]['sort']);_0x4c0c3a[_0x2eea('0x4b')]=qs[_0x2eea('0x44')](_[_0x2eea('0x4c')](_0xd57fe1[_0x2eea('0x42')],_0xa3b33f[_0x2eea('0x44')]),_0x408489);if(_0xd57fe1[_0x2eea('0x42')]['filter']){_0x4c0c3a[_0x2eea('0x4b')]=_[_0x2eea('0x4d')](_0x4c0c3a[_0x2eea('0x4b')],{'$or':_['map'](_0x408489,function(_0x200c4b){if(_0x200c4b['type']!==_0x2eea('0x4e')){var _0x29c789={};_0x29c789[_0x200c4b['name']]={'$like':'%'+_0xd57fe1[_0x2eea('0x42')][_0x2eea('0x4f')]+'%'};return _0x29c789;}})});}_0x4c0c3a=_['merge']({},_0x4c0c3a,_0xd57fe1[_0x2eea('0x50')]);var _0x153978={'where':_0x4c0c3a[_0x2eea('0x4b')]};return db[_0x2eea('0x3c')][_0x2eea('0x2e')](_0x153978)[_0x2eea('0x21')](function(_0x2e23a3){_0x1640db[_0x2eea('0x2e')]=_0x2e23a3;if(_0xd57fe1[_0x2eea('0x42')][_0x2eea('0x51')]){_0x4c0c3a['include']=[{'all':!![]}];}return db['SmsMessage'][_0x2eea('0x52')](_0x4c0c3a);})[_0x2eea('0x21')](function(_0x13292e){_0x1640db['rows']=_0x13292e;return _0x1640db;})[_0x2eea('0x21')](respondWithFilteredResult(_0x2e0687,_0x4c0c3a))[_0x2eea('0x53')](handleError(_0x2e0687,null));};exports['show']=function(_0x55f294,_0x5ad21a){var _0x1223e9={'raw':!![],'where':{'id':_0x55f294[_0x2eea('0x54')]['id']}},_0x5e830b={};_0x5e830b[_0x2eea('0x41')]=_[_0x2eea('0x43')](db['SmsMessage'][_0x2eea('0x3d')]);_0x5e830b[_0x2eea('0x42')]=_[_0x2eea('0x43')](_0x55f294[_0x2eea('0x42')]);_0x5e830b[_0x2eea('0x44')]=_[_0x2eea('0x45')](_0x5e830b['model'],_0x5e830b[_0x2eea('0x42')]);_0x1223e9[_0x2eea('0x46')]=_[_0x2eea('0x45')](_0x5e830b[_0x2eea('0x41')],qs[_0x2eea('0x47')](_0x55f294['query'][_0x2eea('0x47')]));_0x1223e9[_0x2eea('0x46')]=_0x1223e9['attributes'][_0x2eea('0x48')]?_0x1223e9[_0x2eea('0x46')]:_0x5e830b[_0x2eea('0x41')];if(_0x55f294[_0x2eea('0x42')][_0x2eea('0x51')]){_0x1223e9[_0x2eea('0x55')]=[{'all':!![]}];}_0x1223e9=_['merge']({},_0x1223e9,_0x55f294['options']);return db['SmsMessage'][_0x2eea('0x56')](_0x1223e9)[_0x2eea('0x21')](handleEntityNotFound(_0x5ad21a,null))['then'](respondWithResult(_0x5ad21a,null))['catch'](handleError(_0x5ad21a,null));};exports[_0x2eea('0x57')]=function(_0x24f40f,_0x2994a2){return db['SmsMessage'][_0x2eea('0x57')](_0x24f40f[_0x2eea('0x58')],{})[_0x2eea('0x21')](respondWithResult(_0x2994a2,0xc9))[_0x2eea('0x53')](handleError(_0x2994a2,null));};exports['update']=function(_0x29cb9b,_0x624171){if(_0x29cb9b['body']['id']){delete _0x29cb9b[_0x2eea('0x58')]['id'];}return db['SmsMessage'][_0x2eea('0x56')]({'where':{'id':_0x29cb9b['params']['id']}})[_0x2eea('0x21')](handleEntityNotFound(_0x624171,null))[_0x2eea('0x21')](saveUpdates(_0x29cb9b[_0x2eea('0x58')],null))['then'](respondWithResult(_0x624171,null))[_0x2eea('0x53')](handleError(_0x624171,null));};exports[_0x2eea('0x35')]=function(_0x294687,_0x2f5757){return db[_0x2eea('0x3c')][_0x2eea('0x56')]({'where':{'id':_0x294687[_0x2eea('0x54')]['id']}})[_0x2eea('0x21')](handleEntityNotFound(_0x2f5757,null))[_0x2eea('0x21')](removeEntity(_0x2f5757,null))['catch'](handleError(_0x2f5757,null));};exports[_0x2eea('0x59')]=function(_0x4741ae,_0x13036d){return db[_0x2eea('0x3c')][_0x2eea('0x59')]()[_0x2eea('0x21')](respondWithResult(_0x13036d,null))[_0x2eea('0x53')](handleError(_0x13036d,null));};var interaction_log=require(_0x2eea('0x14'))('sms-interactions');exports[_0x2eea('0x5a')]=function(_0x5d17ce,_0x5b2da7,_0x4530b2){var _0x11b68f={'agent':{},'channel':_0x2eea('0x5b')};if(_0x5d17ce['body']['id']){delete _0x5d17ce['body']['id'];}_0x5d17ce['body']['read']=!![];_0x5d17ce['body'][_0x2eea('0x5c')]=moment()['format'](_0x2eea('0x5d'));_0x5d17ce[_0x2eea('0x58')][_0x2eea('0x5e')]=_0x5d17ce[_0x2eea('0x58')]['UserId']||_0x5d17ce[_0x2eea('0x5f')]['id'];_0x11b68f[_0x2eea('0x60')]['id']=_0x5d17ce[_0x2eea('0x58')][_0x2eea('0x5e')];return db[_0x2eea('0x3c')][_0x2eea('0x56')]({'where':{'id':_0x5d17ce[_0x2eea('0x54')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x2eea('0x61')}]})[_0x2eea('0x21')](handleEntityNotFound(_0x5b2da7,null))['then'](saveUpdates(_0x5d17ce[_0x2eea('0x58')],null))[_0x2eea('0x21')](function(_0x28107f){if(_0x28107f){_0x11b68f[_0x2eea('0x29')]=_0x28107f[_0x2eea('0x62')]({'plain':!![]});return db[_0x2eea('0x63')][_0x2eea('0x56')]({'where':{'id':_0x28107f['SmsInteractionId']}});}return null;})[_0x2eea('0x21')](handleEntityNotFound(_0x5b2da7,null))[_0x2eea('0x21')](function(_0x12aeb8){if(_0x12aeb8){return _0x12aeb8[_0x2eea('0x34')]({'UserId':_0x5d17ce[_0x2eea('0x58')][_0x2eea('0x5e')],'read1stAt':_['isNil'](_0x12aeb8[_0x2eea('0x64')])?moment()[_0x2eea('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x2eea('0x21')](function(_0x377602){if(_0x377602){_0x11b68f[_0x2eea('0x66')]=_0x377602[_0x2eea('0x62')]({'plain':!![]});interaction_log[_0x2eea('0x22')](_0x2eea('0x67'),_0x5d17ce['user']['id'],_0x5d17ce[_0x2eea('0x5f')][_0x2eea('0x38')],_0x5d17ce[_0x2eea('0x5f')][_0x2eea('0x68')],_0x11b68f['interaction']['id'],_0x5d17ce[_0x2eea('0x58')]?JSON[_0x2eea('0x25')](_0x5d17ce[_0x2eea('0x58')]):_0x2eea('0x69'));return respondWithRpcPromise(_0x2eea('0x6a'),_0x2eea('0x6b'),_0x11b68f);}return null;})[_0x2eea('0x21')](function(_0x1aafe6){if(_0x1aafe6){if(_0x5d17ce[_0x2eea('0x58')]['manual']){_0x11b68f[_0x2eea('0x29')][_0x2eea('0x6c')]=util[_0x2eea('0x65')](_0x2eea('0x6d'),_0x5d17ce[_0x2eea('0x5f')]['name']);_0x11b68f['message'][_0x2eea('0x6e')]=_0x11b68f['channel'];_0x11b68f[_0x2eea('0x29')][_0x2eea('0x6f')]=_0x2eea('0x5a');return respondWithRpcPromise(_0x2eea('0x70'),'EventManager',{'event':_0x2eea('0x71'),'message':_0x11b68f[_0x2eea('0x29')]},client9002)[_0x2eea('0x21')](function(){return _0x11b68f;});}return _0x11b68f;}return null;})[_0x2eea('0x21')](respondWithResult(_0x5b2da7,null))[_0x2eea('0x53')](handleError(_0x5b2da7,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x2eea('0x32')]=function(_0x22a955,_0x3a8351,_0x365db6){var _0x13be8a={'agent':{},'channel':_0x2eea('0x5b')};if(_0x22a955[_0x2eea('0x58')]['id']){delete _0x22a955['body']['id'];}_0x22a955[_0x2eea('0x58')][_0x2eea('0x5e')]=_0x22a955[_0x2eea('0x58')]['UserId']||_0x22a955[_0x2eea('0x5f')]['id'];_0x13be8a[_0x2eea('0x60')]['id']=_0x22a955[_0x2eea('0x58')]['UserId'];return db[_0x2eea('0x3c')][_0x2eea('0x56')]({'where':{'id':_0x22a955[_0x2eea('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a8351,null))[_0x2eea('0x21')](function(_0x23249f){if(_0x23249f){_0x13be8a['message']=_0x23249f[_0x2eea('0x62')]({'plain':!![]});return db[_0x2eea('0x63')]['find']({'where':{'id':_0x23249f[_0x2eea('0x72')]}});}return null;})['then'](handleEntityNotFound(_0x3a8351,null))['then'](function(_0x4188dc){if(_0x4188dc){_0x13be8a['interaction']=_0x4188dc['get']({'plain':!![]});interaction_log[_0x2eea('0x22')](_0x2eea('0x73'),_0x22a955['user']['id'],_0x22a955[_0x2eea('0x5f')][_0x2eea('0x38')],_0x22a955[_0x2eea('0x5f')][_0x2eea('0x68')],_0x13be8a[_0x2eea('0x66')]['id'],_0x22a955[_0x2eea('0x58')]?JSON[_0x2eea('0x25')](_0x22a955['body']):_0x2eea('0x69'));return respondWithRpcPromise(_0x2eea('0x74'),_0x2eea('0x75'),_0x13be8a);}return null;})['then'](function(_0x5852dd){if(_0x5852dd){_0x5852dd[_0x2eea('0x29')][_0x2eea('0x6c')]=util[_0x2eea('0x65')]('SIP/%s',_0x22a955['user'][_0x2eea('0x38')]);_0x5852dd[_0x2eea('0x29')]['channel']=_0x13be8a['channel'];_0x5852dd['message'][_0x2eea('0x6f')]=_0x2eea('0x32');respondWithRpcPromise(_0x2eea('0x70'),_0x2eea('0x70'),{'event':_0x2eea('0x76'),'message':_0x5852dd['message']},client9002);return _0x13be8a;}return null;})[_0x2eea('0x21')](respondWithResult(_0x3a8351,null))['catch'](handleError(_0x3a8351,null));};exports[_0x2eea('0x2b')]=function(_0x4bbe59,_0x3a3b5b,_0x289a69){if(_0x4bbe59[_0x2eea('0x58')]['id']){delete _0x4bbe59[_0x2eea('0x58')]['id'];}var _0x3dd033;return db[_0x2eea('0x3c')][_0x2eea('0x56')]({'where':{'id':_0x4bbe59['params']['id']}})['then'](handleEntityNotFound(_0x3a3b5b,null))[_0x2eea('0x21')](function(_0x5e8bdc){if(_0x5e8bdc){_0x3dd033=_0x5e8bdc;return db[_0x2eea('0x77')][_0x2eea('0x56')]({'where':{'id':_0x5e8bdc[_0x2eea('0x78')]}});}})[_0x2eea('0x21')](handleEntityNotFound(_0x3a3b5b,null))['then'](function(_0x344b9d){if(_0x344b9d){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2eea('0x2b'),_0x2eea('0x79'),_0x344b9d['type'],util['inspect'](_0x4bbe59[_0x2eea('0x58')],{'showHidden':![],'depth':null}));switch(_0x344b9d[_0x2eea('0x3f')]){case _0x2eea('0x7a'):if(_0x4bbe59[_0x2eea('0x58')][_0x2eea('0x7b')]&&_0x4bbe59['body'][_0x2eea('0x7b')]===_0x3dd033[_0x2eea('0x7c')]){return _0x3dd033[_0x2eea('0x34')]({'read':!![]});}else{logger[_0x2eea('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','twilio',util[_0x2eea('0x7d')](_0x4bbe59[_0x2eea('0x58')],{'showHidden':![],'depth':null}));}break;case _0x2eea('0x7e'):if(_0x4bbe59[_0x2eea('0x58')]['MessageUUID']&&_0x4bbe59['body'][_0x2eea('0x7f')]===_0x3dd033[_0x2eea('0x7c')]&&_[_0x2eea('0x80')]([_0x2eea('0x81'),_0x2eea('0x82')],_0x4bbe59['body']['Status'])>=0x0){return _0x3dd033[_0x2eea('0x34')]({'read':!![]});}else{logger[_0x2eea('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2eea('0x2b'),_0x2eea('0x83'),util['inspect'](_0x4bbe59['body'],{'showHidden':![],'depth':null}));}break;case _0x2eea('0x84'):var _0x436420=_0x4bbe59[_0x2eea('0x58')][_0x2eea('0x85')][0x0];if(_0x436420['status'][_0x2eea('0x86')]===_0x2eea('0x87')){return _0x3dd033[_0x2eea('0x34')]({'read':!![]});}else{logger[_0x2eea('0x26')](_0x2eea('0x88'),_0x2eea('0x2b'),_0x2eea('0x84'),util[_0x2eea('0x7d')](_0x4bbe59[_0x2eea('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x3dd033;}})[_0x2eea('0x21')](respondWithResult(_0x3a3b5b,null))[_0x2eea('0x53')](handleError(_0x3a3b5b,null));}; \ No newline at end of file +var _0x5543=['interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','messageId','plivo','MessageUUID','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','end','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','VIRTUAL','filter','options','include','show','params','includeAll','merge','find','body','describe','sms-interactions','accept','sms','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','SmsInteraction','isNil','read1stAt'];(function(_0x5753f5,_0xb007c6){var _0x278da0=function(_0x579182){while(--_0x579182){_0x5753f5['push'](_0x5753f5['shift']());}};_0x278da0(++_0xb007c6);}(_0x5543,0x1bb));var _0x3554=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x5543[_0x39c734];return _0xb2a2f9;};'use strict';var emlformat=require(_0x3554('0x0'));var rimraf=require(_0x3554('0x1'));var zipdir=require(_0x3554('0x2'));var jsonpatch=require(_0x3554('0x3'));var rp=require(_0x3554('0x4'));var moment=require(_0x3554('0x5'));var BPromise=require(_0x3554('0x6'));var Mustache=require(_0x3554('0x7'));var util=require('util');var path=require(_0x3554('0x8'));var sox=require(_0x3554('0x9'));var csv=require(_0x3554('0xa'));var ejs=require(_0x3554('0xb'));var fs=require('fs');var fs_extra=require(_0x3554('0xc'));var _=require(_0x3554('0xd'));var squel=require(_0x3554('0xe'));var crypto=require(_0x3554('0xf'));var jsforce=require(_0x3554('0x10'));var deskjs=require(_0x3554('0x11'));var toCsv=require(_0x3554('0xa'));var querystring=require(_0x3554('0x12'));var Papa=require(_0x3554('0x13'));var Redis=require(_0x3554('0x14'));var authService=require(_0x3554('0x15'));var qs=require(_0x3554('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3554('0x17'));var logger=require(_0x3554('0x18'))('api');var utils=require(_0x3554('0x19'));var config=require(_0x3554('0x1a'));var licenseUtil=require(_0x3554('0x1b'));var db=require(_0x3554('0x1c'))['db'];config[_0x3554('0x1d')]=_[_0x3554('0x1e')](config[_0x3554('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x3554('0x1f'))(new Redis(config[_0x3554('0x1d')]));require(_0x3554('0x20'))[_0x3554('0x21')](socket);var jayson=require(_0x3554('0x22'));var client=jayson['client'][_0x3554('0x23')]({'port':0x232c});var client9002=jayson['client'][_0x3554('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x29e86f,_0x58904a,_0x6f374e,_0x4494bc){return new BPromise(function(_0x5d38c9,_0x352484){var _0x4af444=_0x4494bc||client;return _0x4af444['request'](_0x29e86f,_0x6f374e)['then'](function(_0x484368){logger[_0x3554('0x24')](_0x3554('0x25'),_0x58904a,_0x3554('0x26'));logger[_0x3554('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x58904a,_0x3554('0x26'),JSON[_0x3554('0x28')](_0x484368));if(_0x484368[_0x3554('0x29')]){if(_0x484368[_0x3554('0x29')][_0x3554('0x2a')]===0x1f4){logger['error'](_0x3554('0x25'),_0x58904a,_0x484368[_0x3554('0x29')][_0x3554('0x2b')]);return _0x352484(_0x484368[_0x3554('0x29')]['message']);}logger[_0x3554('0x29')](_0x3554('0x25'),_0x58904a,_0x484368['error'][_0x3554('0x2b')]);return _0x5d38c9(_0x484368[_0x3554('0x29')][_0x3554('0x2b')]);}else{logger[_0x3554('0x24')](_0x3554('0x25'),_0x58904a,_0x3554('0x26'));_0x5d38c9(_0x484368[_0x3554('0x2c')][_0x3554('0x2b')]);}})[_0x3554('0x2d')](function(_0x5e5589){logger[_0x3554('0x29')]('SmsMessage,\x20%s,\x20%s',_0x58904a,_0x5e5589);_0x352484(_0x5e5589);});});}function respondWithStatusCode(_0x48ee2e,_0x467ea4){_0x467ea4=_0x467ea4||0xcc;return function(_0x1e773f){if(_0x1e773f){return _0x48ee2e[_0x3554('0x2e')](_0x467ea4);}return _0x48ee2e[_0x3554('0x2f')](_0x467ea4)['end']();};}function respondWithResult(_0x19ba14,_0x3087c3){_0x3087c3=_0x3087c3||0xc8;return function(_0x428868){if(_0x428868){return _0x19ba14['status'](_0x3087c3)[_0x3554('0x30')](_0x428868);}};}function respondWithFilteredResult(_0x541e27,_0x21c333){return function(_0x4c3899){if(_0x4c3899){var _0x4afe37=_0x4c3899[_0x3554('0x31')],_0x3cf510=_0x21c333[_0x3554('0x32')],_0x48bb9d=_0x21c333[_0x3554('0x32')]+_0x21c333['limit'],_0x2de0cd;if(_0x48bb9d>=_0x4afe37){_0x48bb9d=_0x4afe37;_0x2de0cd=0xc8;}else{_0x2de0cd=0xce;}_0x541e27[_0x3554('0x2f')](_0x2de0cd);return _0x541e27[_0x3554('0x33')](_0x3554('0x34'),_0x3cf510+'-'+_0x48bb9d+'/'+_0x4afe37)[_0x3554('0x30')](_0x4c3899);}return null;};}function patchUpdates(_0x10e175){return function(_0x59eb80){try{jsonpatch[_0x3554('0x35')](_0x59eb80,_0x10e175,!![]);}catch(_0x47d60e){return BPromise['reject'](_0x47d60e);}return _0x59eb80[_0x3554('0x36')]();};}function saveUpdates(_0x50181b,_0x5551da){return function(_0x5aa2cf){if(_0x5aa2cf){return _0x5aa2cf[_0x3554('0x37')](_0x50181b)[_0x3554('0x38')](function(_0x3fbc78){return _0x3fbc78;});}return null;};}function removeEntity(_0x465dca,_0x5eb431){return function(_0x49778d){if(_0x49778d){return _0x49778d[_0x3554('0x39')]()[_0x3554('0x38')](function(){_0x465dca['status'](0xcc)[_0x3554('0x3a')]();});}};}function handleEntityNotFound(_0xec3a8b,_0x2b9d65){return function(_0xdf8608){if(!_0xdf8608){_0xec3a8b[_0x3554('0x2e')](0x194);}return _0xdf8608;};}function handleError(_0x25c002,_0x2e0ac5){_0x2e0ac5=_0x2e0ac5||0x1f4;return function(_0x16f449){logger[_0x3554('0x29')](_0x16f449['stack']);if(_0x16f449[_0x3554('0x3b')]){delete _0x16f449[_0x3554('0x3b')];}_0x25c002[_0x3554('0x2f')](_0x2e0ac5)[_0x3554('0x3c')](_0x16f449);};}exports[_0x3554('0x3d')]=function(_0x314f15,_0x4d18b0){var _0x16bcca={},_0x336796={},_0x28a7c3={'count':0x0,'rows':[]};var _0x2b5442=_['map'](db[_0x3554('0x3e')][_0x3554('0x3f')],function(_0x2158f1){return{'name':_0x2158f1[_0x3554('0x40')],'type':_0x2158f1[_0x3554('0x41')][_0x3554('0x42')]};});_0x336796[_0x3554('0x43')]=_[_0x3554('0x44')](_0x2b5442,_0x3554('0x3b'));_0x336796['query']=_[_0x3554('0x45')](_0x314f15[_0x3554('0x46')]);_0x336796[_0x3554('0x47')]=_[_0x3554('0x48')](_0x336796[_0x3554('0x43')],_0x336796[_0x3554('0x46')]);_0x16bcca[_0x3554('0x49')]=_[_0x3554('0x48')](_0x336796[_0x3554('0x43')],qs[_0x3554('0x4a')](_0x314f15[_0x3554('0x46')][_0x3554('0x4a')]));_0x16bcca[_0x3554('0x49')]=_0x16bcca[_0x3554('0x49')][_0x3554('0x4b')]?_0x16bcca[_0x3554('0x49')]:_0x336796[_0x3554('0x43')];if(!_0x314f15[_0x3554('0x46')][_0x3554('0x4c')]('nolimit')){_0x16bcca[_0x3554('0x4d')]=qs['limit'](_0x314f15['query'][_0x3554('0x4d')]);_0x16bcca[_0x3554('0x32')]=qs[_0x3554('0x32')](_0x314f15['query'][_0x3554('0x32')]);}_0x16bcca[_0x3554('0x4e')]=qs['sort'](_0x314f15[_0x3554('0x46')][_0x3554('0x4f')]);_0x16bcca[_0x3554('0x50')]=qs[_0x3554('0x47')](_[_0x3554('0x51')](_0x314f15[_0x3554('0x46')],_0x336796[_0x3554('0x47')]),_0x2b5442);if(_0x314f15[_0x3554('0x46')]['filter']){_0x16bcca[_0x3554('0x50')]=_['merge'](_0x16bcca[_0x3554('0x50')],{'$or':_[_0x3554('0x44')](_0x2b5442,function(_0x362806){if(_0x362806[_0x3554('0x41')]!==_0x3554('0x52')){var _0x552971={};_0x552971[_0x362806[_0x3554('0x3b')]]={'$like':'%'+_0x314f15[_0x3554('0x46')][_0x3554('0x53')]+'%'};return _0x552971;}})});}_0x16bcca=_['merge']({},_0x16bcca,_0x314f15[_0x3554('0x54')]);var _0x3660b5={'where':_0x16bcca[_0x3554('0x50')]};return db[_0x3554('0x3e')][_0x3554('0x31')](_0x3660b5)[_0x3554('0x38')](function(_0x1c98ed){_0x28a7c3['count']=_0x1c98ed;if(_0x314f15['query']['includeAll']){_0x16bcca[_0x3554('0x55')]=[{'all':!![]}];}return db[_0x3554('0x3e')]['findAll'](_0x16bcca);})[_0x3554('0x38')](function(_0x79fd27){_0x28a7c3['rows']=_0x79fd27;return _0x28a7c3;})[_0x3554('0x38')](respondWithFilteredResult(_0x4d18b0,_0x16bcca))[_0x3554('0x2d')](handleError(_0x4d18b0,null));};exports[_0x3554('0x56')]=function(_0x344970,_0x585485){var _0x3e737a={'raw':!![],'where':{'id':_0x344970[_0x3554('0x57')]['id']}},_0x3069a3={};_0x3069a3[_0x3554('0x43')]=_[_0x3554('0x45')](db[_0x3554('0x3e')]['rawAttributes']);_0x3069a3[_0x3554('0x46')]=_['keys'](_0x344970['query']);_0x3069a3[_0x3554('0x47')]=_[_0x3554('0x48')](_0x3069a3[_0x3554('0x43')],_0x3069a3[_0x3554('0x46')]);_0x3e737a['attributes']=_[_0x3554('0x48')](_0x3069a3[_0x3554('0x43')],qs[_0x3554('0x4a')](_0x344970[_0x3554('0x46')][_0x3554('0x4a')]));_0x3e737a[_0x3554('0x49')]=_0x3e737a[_0x3554('0x49')][_0x3554('0x4b')]?_0x3e737a['attributes']:_0x3069a3[_0x3554('0x43')];if(_0x344970[_0x3554('0x46')][_0x3554('0x58')]){_0x3e737a[_0x3554('0x55')]=[{'all':!![]}];}_0x3e737a=_[_0x3554('0x59')]({},_0x3e737a,_0x344970[_0x3554('0x54')]);return db[_0x3554('0x3e')][_0x3554('0x5a')](_0x3e737a)[_0x3554('0x38')](handleEntityNotFound(_0x585485,null))[_0x3554('0x38')](respondWithResult(_0x585485,null))[_0x3554('0x2d')](handleError(_0x585485,null));};exports['create']=function(_0x1f9508,_0x1b33d1){return db[_0x3554('0x3e')]['create'](_0x1f9508[_0x3554('0x5b')],{})['then'](respondWithResult(_0x1b33d1,0xc9))[_0x3554('0x2d')](handleError(_0x1b33d1,null));};exports['update']=function(_0x283e50,_0x3e86b0){if(_0x283e50[_0x3554('0x5b')]['id']){delete _0x283e50['body']['id'];}return db[_0x3554('0x3e')]['find']({'where':{'id':_0x283e50[_0x3554('0x57')]['id']}})[_0x3554('0x38')](handleEntityNotFound(_0x3e86b0,null))[_0x3554('0x38')](saveUpdates(_0x283e50[_0x3554('0x5b')],null))[_0x3554('0x38')](respondWithResult(_0x3e86b0,null))[_0x3554('0x2d')](handleError(_0x3e86b0,null));};exports[_0x3554('0x39')]=function(_0x232a07,_0x14b18b){return db[_0x3554('0x3e')][_0x3554('0x5a')]({'where':{'id':_0x232a07['params']['id']}})['then'](handleEntityNotFound(_0x14b18b,null))[_0x3554('0x38')](removeEntity(_0x14b18b,null))[_0x3554('0x2d')](handleError(_0x14b18b,null));};exports[_0x3554('0x5c')]=function(_0x41c58f,_0x3f087f){return db[_0x3554('0x3e')][_0x3554('0x5c')]()[_0x3554('0x38')](respondWithResult(_0x3f087f,null))[_0x3554('0x2d')](handleError(_0x3f087f,null));};var interaction_log=require(_0x3554('0x18'))(_0x3554('0x5d'));exports[_0x3554('0x5e')]=function(_0x309794,_0x14ab72,_0x4256f5){var _0x5488e3={'agent':{},'channel':_0x3554('0x5f')};if(_0x309794[_0x3554('0x5b')]['id']){delete _0x309794[_0x3554('0x5b')]['id'];}_0x309794[_0x3554('0x5b')]['read']=!![];_0x309794[_0x3554('0x5b')]['readAt']=moment()[_0x3554('0x60')](_0x3554('0x61'));_0x309794[_0x3554('0x5b')]['UserId']=_0x309794['body']['UserId']||_0x309794[_0x3554('0x62')]['id'];_0x5488e3[_0x3554('0x63')]['id']=_0x309794[_0x3554('0x5b')][_0x3554('0x64')];return db['SmsMessage'][_0x3554('0x5a')]({'where':{'id':_0x309794[_0x3554('0x57')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x3554('0x38')](handleEntityNotFound(_0x14ab72,null))['then'](saveUpdates(_0x309794['body'],null))[_0x3554('0x38')](function(_0x530e2a){if(_0x530e2a){_0x5488e3[_0x3554('0x2b')]=_0x530e2a[_0x3554('0x65')]({'plain':!![]});return db[_0x3554('0x66')][_0x3554('0x5a')]({'where':{'id':_0x530e2a['SmsInteractionId']}});}return null;})[_0x3554('0x38')](handleEntityNotFound(_0x14ab72,null))[_0x3554('0x38')](function(_0x2e18a1){if(_0x2e18a1){return _0x2e18a1[_0x3554('0x37')]({'UserId':_0x309794[_0x3554('0x5b')][_0x3554('0x64')],'read1stAt':_[_0x3554('0x67')](_0x2e18a1[_0x3554('0x68')])?moment()['format'](_0x3554('0x61')):undefined});}return null;})['then'](function(_0xfd85ae){if(_0xfd85ae){_0x5488e3[_0x3554('0x69')]=_0xfd85ae[_0x3554('0x65')]({'plain':!![]});interaction_log[_0x3554('0x24')](_0x3554('0x6a'),_0x309794[_0x3554('0x62')]['id'],_0x309794[_0x3554('0x62')][_0x3554('0x3b')],_0x309794['user'][_0x3554('0x6b')],_0x5488e3['interaction']['id'],_0x309794[_0x3554('0x5b')]?JSON[_0x3554('0x28')](_0x309794[_0x3554('0x5b')]):_0x3554('0x6c'));return respondWithRpcPromise(_0x3554('0x6d'),_0x3554('0x6e'),_0x5488e3);}return null;})[_0x3554('0x38')](function(_0xbfbbca){if(_0xbfbbca){if(_0x309794[_0x3554('0x5b')][_0x3554('0x6f')]){_0x5488e3[_0x3554('0x2b')][_0x3554('0x70')]=util[_0x3554('0x60')](_0x3554('0x71'),_0x309794[_0x3554('0x62')][_0x3554('0x3b')]);_0x5488e3[_0x3554('0x2b')][_0x3554('0x72')]=_0x5488e3[_0x3554('0x72')];_0x5488e3[_0x3554('0x2b')]['event']=_0x3554('0x5e');return respondWithRpcPromise(_0x3554('0x73'),_0x3554('0x73'),{'event':_0x3554('0x74'),'message':_0x5488e3[_0x3554('0x2b')]},client9002)[_0x3554('0x38')](function(){return _0x5488e3;});}return _0x5488e3;}return null;})[_0x3554('0x38')](respondWithResult(_0x14ab72,null))['catch'](handleError(_0x14ab72,null));};var interaction_log=require('../../config/logger')(_0x3554('0x5d'));exports[_0x3554('0x75')]=function(_0x57c7d1,_0x3cc382,_0x305b25){var _0x40a636={'agent':{},'channel':_0x3554('0x5f')};if(_0x57c7d1[_0x3554('0x5b')]['id']){delete _0x57c7d1[_0x3554('0x5b')]['id'];}_0x57c7d1[_0x3554('0x5b')][_0x3554('0x64')]=_0x57c7d1[_0x3554('0x5b')][_0x3554('0x64')]||_0x57c7d1[_0x3554('0x62')]['id'];_0x40a636[_0x3554('0x63')]['id']=_0x57c7d1[_0x3554('0x5b')][_0x3554('0x64')];return db['SmsMessage'][_0x3554('0x5a')]({'where':{'id':_0x57c7d1[_0x3554('0x57')]['id'],'UserId':null}})[_0x3554('0x38')](handleEntityNotFound(_0x3cc382,null))['then'](function(_0x479b60){if(_0x479b60){_0x40a636[_0x3554('0x2b')]=_0x479b60[_0x3554('0x65')]({'plain':!![]});return db[_0x3554('0x66')][_0x3554('0x5a')]({'where':{'id':_0x479b60['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3cc382,null))['then'](function(_0x28050b){if(_0x28050b){_0x40a636[_0x3554('0x69')]=_0x28050b[_0x3554('0x65')]({'plain':!![]});interaction_log['info'](_0x3554('0x76'),_0x57c7d1['user']['id'],_0x57c7d1[_0x3554('0x62')][_0x3554('0x3b')],_0x57c7d1[_0x3554('0x62')]['role'],_0x40a636[_0x3554('0x69')]['id'],_0x57c7d1['body']?JSON['stringify'](_0x57c7d1[_0x3554('0x5b')]):_0x3554('0x6c'));return respondWithRpcPromise(_0x3554('0x77'),_0x3554('0x78'),_0x40a636);}return null;})[_0x3554('0x38')](function(_0x5d5ff0){if(_0x5d5ff0){_0x5d5ff0[_0x3554('0x2b')]['interface']=util[_0x3554('0x60')](_0x3554('0x71'),_0x57c7d1['user'][_0x3554('0x3b')]);_0x5d5ff0[_0x3554('0x2b')][_0x3554('0x72')]=_0x40a636[_0x3554('0x72')];_0x5d5ff0[_0x3554('0x2b')]['event']=_0x3554('0x75');respondWithRpcPromise(_0x3554('0x73'),'EventManager',{'event':_0x3554('0x79'),'message':_0x5d5ff0['message']},client9002);return _0x40a636;}return null;})['then'](respondWithResult(_0x3cc382,null))['catch'](handleError(_0x3cc382,null));};exports['status']=function(_0x1c58ff,_0xab0950,_0x5813b7){if(_0x1c58ff[_0x3554('0x5b')]['id']){delete _0x1c58ff[_0x3554('0x5b')]['id'];}var _0x211a73;return db[_0x3554('0x3e')][_0x3554('0x5a')]({'where':{'id':_0x1c58ff[_0x3554('0x57')]['id']}})[_0x3554('0x38')](handleEntityNotFound(_0xab0950,null))[_0x3554('0x38')](function(_0x1917a3){if(_0x1917a3){_0x211a73=_0x1917a3;return db['SmsAccount'][_0x3554('0x5a')]({'where':{'id':_0x1917a3[_0x3554('0x7a')]}});}})[_0x3554('0x38')](handleEntityNotFound(_0xab0950,null))[_0x3554('0x38')](function(_0x3e73bc){if(_0x3e73bc){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3554('0x2f'),_0x3554('0x7b'),_0x3e73bc[_0x3554('0x41')],util[_0x3554('0x7c')](_0x1c58ff['body'],{'showHidden':![],'depth':null}));switch(_0x3e73bc[_0x3554('0x41')]){case _0x3554('0x7d'):if(_0x1c58ff[_0x3554('0x5b')]['MessageSid']&&_0x1c58ff['body']['MessageSid']===_0x211a73[_0x3554('0x7e')]){return _0x211a73[_0x3554('0x37')]({'read':!![]});}else{logger[_0x3554('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x3554('0x7d'),util[_0x3554('0x7c')](_0x1c58ff[_0x3554('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x3554('0x7f'):if(_0x1c58ff[_0x3554('0x5b')]['MessageUUID']&&_0x1c58ff[_0x3554('0x5b')][_0x3554('0x80')]===_0x211a73[_0x3554('0x7e')]&&_[_0x3554('0x81')]([_0x3554('0x82'),_0x3554('0x83')],_0x1c58ff[_0x3554('0x5b')]['Status'])>=0x0){return _0x211a73['update']({'read':!![]});}else{logger[_0x3554('0x29')](_0x3554('0x84'),'status',_0x3554('0x85'),util['inspect'](_0x1c58ff['body'],{'showHidden':![],'depth':null}));}break;case _0x3554('0x86'):var _0x29f248=_0x1c58ff[_0x3554('0x5b')]['results'][0x0];if(_0x29f248[_0x3554('0x2f')][_0x3554('0x87')]===_0x3554('0x88')){return _0x211a73[_0x3554('0x37')]({'read':!![]});}else{logger['error'](_0x3554('0x84'),'status',_0x3554('0x86'),util[_0x3554('0x7c')](_0x1c58ff[_0x3554('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x211a73;}})[_0x3554('0x38')](respondWithResult(_0xab0950,null))['catch'](handleError(_0xab0950,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 86291f8..d7e9158 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 _0x90d1=['SmsMessage','setMaxListeners','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x5d04ee,_0x2a38ca){var _0x4a666a=function(_0x1883e4){while(--_0x1883e4){_0x5d04ee['push'](_0x5d04ee['shift']());}};_0x4a666a(++_0x2a38ca);}(_0x90d1,0x84));var _0x190d=function(_0x1408b4,_0x22e866){_0x1408b4=_0x1408b4-0x0;var _0x39276b=_0x90d1[_0x1408b4];return _0x39276b;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x190d('0x0'))['db'][_0x190d('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x190d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x190d('0x3'),'afterDestroy':_0x190d('0x4')};function emitEvent(_0x39182e){return function(_0xad7d33,_0xd0298a,_0x10d0f8){SmsMessageEvents[_0x190d('0x5')](_0x39182e+':'+_0xad7d33['id'],_0xad7d33);SmsMessageEvents[_0x190d('0x5')](_0x39182e,_0xad7d33);_0x10d0f8(null);};}for(var e in events){if(events[_0x190d('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xdcb6=['events','SmsMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x25e0a7,_0x213e9e){var _0x50b2df=function(_0x2ad49a){while(--_0x2ad49a){_0x25e0a7['push'](_0x25e0a7['shift']());}};_0x50b2df(++_0x213e9e);}(_0xdcb6,0x19e));var _0x6dcb=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xdcb6[_0x3d42d8];return _0x27fc41;};'use strict';var EventEmitter=require(_0x6dcb('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x6dcb('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6dcb('0x2')](0x0);var events={'afterCreate':_0x6dcb('0x3'),'afterUpdate':'update','afterDestroy':_0x6dcb('0x4')};function emitEvent(_0x21e4db){return function(_0x57259a,_0x13e7e5,_0x209800){SmsMessageEvents[_0x6dcb('0x5')](_0x21e4db+':'+_0x57259a['id'],_0x57259a);SmsMessageEvents[_0x6dcb('0x5')](_0x21e4db,_0x57259a);_0x209800(null);};}for(var e in events){if(events[_0x6dcb('0x6')](e)){var event=events[e];SmsMessage[_0x6dcb('0x7')](e,emitEvent(event));}}module[_0x6dcb('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index c6e6668..7cb0c0f 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 _0x0dcf=['id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','Basic\x20%s','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','lodash','api','moment','bluebird','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','get','toLowerCase','direction','out','secret','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','token','sid','catch','error','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','queued_count','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','/status?token=','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','csc','crypto','apiKey','login','timestamp','keys','sort','length','createHash','digest','/external/get/send.php?'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0x0dcf,0x1f3));var _0xf0dc=function(_0x1a3690,_0x1adb5a){_0x1a3690=_0x1a3690-0x0;var _0x386b0b=_0x0dcf[_0x1a3690];return _0x386b0b;};'use strict';var _=require(_0xf0dc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf0dc('0x1'));var moment=require(_0xf0dc('0x2'));var BPromise=require(_0xf0dc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf0dc('0x4'));var attributes=require(_0xf0dc('0x5'));module[_0xf0dc('0x6')]=function(_0x2bc63b,_0x198656){return _0x2bc63b[_0xf0dc('0x7')](_0xf0dc('0x8'),attributes,{'tableName':_0xf0dc('0x9'),'paranoid':![],'indexes':[{'name':_0xf0dc('0xa'),'fields':['messageId']},{'name':_0xf0dc('0xb'),'fields':[_0xf0dc('0xc')],'type':_0xf0dc('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3674bb,_0x4e2407,_0x5c10e2){var _0x1a009c=_0x2bc63b['models'];var _0x502f8d=_0x3674bb[_0xf0dc('0xe')]({'plain':!![]});if(_0x502f8d['direction'][_0xf0dc('0xf')]()==='in'||_0x502f8d[_0xf0dc('0x10')]['toLowerCase']()===_0xf0dc('0x11')&&!_0x502f8d[_0xf0dc('0x12')]&&!_['isNil'](_0x502f8d[_0xf0dc('0x13')])){_0x1a009c[_0xf0dc('0x14')][_0xf0dc('0x15')]({'where':{'id':_0x502f8d[_0xf0dc('0x16')]}})[_0xf0dc('0x17')](function(_0xcc7b85){if(_0xcc7b85){_0xcc7b85[_0xf0dc('0x18')]({'lastMsgAt':_0x502f8d[_0xf0dc('0x19')],'lastMsgDirection':_0x502f8d['direction'][_0xf0dc('0xf')]()});}})['catch'](function(_0x19fd6e){console['error'](_0x19fd6e);});}if(_0x502f8d[_0xf0dc('0x10')]===_0xf0dc('0x11')&&!_0x502f8d['secret']){var _0x4798f9;_0x1a009c[_0xf0dc('0x1a')][_0xf0dc('0x1b')]({'where':{'id':_0x502f8d[_0xf0dc('0x1c')]},'raw':!![]})[_0xf0dc('0x17')](function(_0x4dd548){_0x4798f9=_0x4dd548;if(_0x4798f9&&_0x4798f9[_0xf0dc('0x1d')]){switch(_0x4798f9[_0xf0dc('0x1d')]){case _0xf0dc('0x1e'):var _0x50922a=require('twilio');if(_0x4798f9[_0xf0dc('0x1f')]&&_0x4798f9[_0xf0dc('0x20')]&&_0x4798f9[_0xf0dc('0x21')]){var _0x596bb4=new _0x50922a(_0x4798f9[_0xf0dc('0x1f')],_0x4798f9[_0xf0dc('0x20')]);_0x596bb4[_0xf0dc('0x22')][_0xf0dc('0x23')]({'body':_0x502f8d[_0xf0dc('0xc')],'to':_0x502f8d[_0xf0dc('0x21')],'from':_0x4798f9[_0xf0dc('0x21')],'statusCallback':_0x4798f9[_0xf0dc('0x24')]+_0xf0dc('0x25')+_0x502f8d['id']+'/status?token='+_0x4798f9[_0xf0dc('0x26')]})['then'](function(_0x4db3f1){if(_0x4db3f1[_0xf0dc('0x27')]){return _0x3674bb[_0xf0dc('0x18')]({'messageId':_0x4db3f1[_0xf0dc('0x27')]});}})[_0xf0dc('0x28')](function(_0x102276){logger[_0xf0dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0dc('0x2a'),_0xf0dc('0x1e'),util[_0xf0dc('0x2b')](_0x102276,{'showHidden':![],'depth':null}));});}else{logger[_0xf0dc('0x29')](_0xf0dc('0x2c'),_0xf0dc('0x2a'),_0xf0dc('0x1e'),_0xf0dc('0x2d'));}break;case _0xf0dc('0x2e'):var _0x3d2d23='https://api.skebby.it/API/v1.0/REST/';if(_0x4798f9[_0xf0dc('0x2f')]&&_0x4798f9[_0xf0dc('0x30')]){var _0x43673e={'recipient':[_0x502f8d[_0xf0dc('0x21')]],'message':_0x502f8d[_0xf0dc('0xc')],'message_type':_0x4798f9[_0xf0dc('0x31')]};if(_0x4798f9[_0xf0dc('0x31')]&&_0x4798f9[_0xf0dc('0x31')]!=='SI'){_0x43673e[_0xf0dc('0x32')]=_0x4798f9['phone'];}var _0x2aefea={'url':_0x3d2d23+_0xf0dc('0x33')+_0x4798f9[_0xf0dc('0x2f')]+_0xf0dc('0x34')+_0x4798f9[_0xf0dc('0x30')],'method':_0xf0dc('0x35')};rp(_0x2aefea)[_0xf0dc('0x17')](function(_0x5b6061){var _0x159a50=_0x5b6061[_0xf0dc('0x36')](';');var _0x4e98e8={'user_key':_0x159a50[0x0],'session_key':_0x159a50[0x1]};_0x2aefea={'url':_0x3d2d23+_0xf0dc('0x37'),'method':_0xf0dc('0x38'),'headers':{'user_key':_0x4e98e8[_0xf0dc('0x39')],'Session_key':_0x4e98e8[_0xf0dc('0x3a')]},'json':!![],'body':_0x43673e};return rp(_0x2aefea);})['then'](function(_0x51ea73){if(_0x51ea73[_0xf0dc('0x3b')]>=0x1){var _0x208fcd={'messageId':_0x51ea73[_0xf0dc('0x3c')]};if(_0x4798f9[_0xf0dc('0x31')]!=='GP'||!_0x4798f9[_0xf0dc('0x3d')]){_0x208fcd[_0xf0dc('0x3e')]=!![];}return _0x3674bb[_0xf0dc('0x18')](_0x208fcd);}else{return logger[_0xf0dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf0dc('0x2e'),util[_0xf0dc('0x2b')](_0x51ea73,{'showHidden':![],'depth':null}));}})[_0xf0dc('0x28')](function(_0x4d491f){return logger[_0xf0dc('0x29')](_0xf0dc('0x2c'),_0xf0dc('0x2a'),_0xf0dc('0x2e'),util[_0xf0dc('0x2b')](_0x4d491f,{'showHidden':![],'depth':null}));});}else{logger[_0xf0dc('0x29')](_0xf0dc('0x2c'),_0xf0dc('0x2a'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0xf0dc('0x3f'):if(_0x4798f9[_0xf0dc('0x20')]){var _0x2e371c={'recipient':_0x502f8d[_0xf0dc('0x21')],'message':_0x502f8d[_0xf0dc('0xc')],'sender':_0x4798f9[_0xf0dc('0x40')]||_0x4798f9[_0xf0dc('0x21')],'authorization':_0x4798f9[_0xf0dc('0x20')]};var _0x4e2407={'method':_0xf0dc('0x38'),'uri':_0xf0dc('0x41'),'body':_0x2e371c,'json':!![]};rp(_0x4e2407)['then'](function(_0x24d8db){var _0x1fe069={'messageId':_0x24d8db[_0xf0dc('0x42')]};if(!_0x4798f9[_0xf0dc('0x3d')]){_0x1fe069['read']=!![];}return _0x3674bb['update'](_0x1fe069);})[_0xf0dc('0x28')](function(_0x53e158){logger['error'](_0xf0dc('0x2c'),_0xf0dc('0x2a'),_0xf0dc('0x3f'),util[_0xf0dc('0x2b')](_0x53e158,{'showHidden':![],'depth':null}));});}else{logger[_0xf0dc('0x29')](_0xf0dc('0x2c'),_0xf0dc('0x2a'),_0xf0dc('0x3f'),'Missing\x20parameters:\x20authToken');}break;case _0xf0dc('0x43'):if(_0x4798f9[_0xf0dc('0x2f')]&&_0x4798f9[_0xf0dc('0x30')]){var _0x2e371c={'messages':[{'source':_0xf0dc('0x44'),'to':_0x502f8d[_0xf0dc('0x21')],'body':_0x502f8d[_0xf0dc('0xc')],'from':_0x4798f9[_0xf0dc('0x40')]||_0x4798f9['phone']}]};var _0x2ccff8=util[_0xf0dc('0x45')](_0xf0dc('0x46'),_0x4798f9[_0xf0dc('0x2f')],_0x4798f9['password']);var _0x4e2407={'method':'POST','uri':_0xf0dc('0x47'),'body':_0x2e371c,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x2ccff8)['toString'](_0xf0dc('0x48')))},'json':!![]};rp(_0x4e2407)['then'](function(_0x2599cc){if(_0x2599cc[_0xf0dc('0x49')]>=0xc8&&_0x2599cc[_0xf0dc('0x49')]<=0xce){if(_0x2599cc[_0xf0dc('0x4a')]&&_0x2599cc[_0xf0dc('0x4a')][_0xf0dc('0x4b')]>0x0){var _0x25bc07=_['head'](_0x2599cc['data'][_0xf0dc('0x22')]);var _0x2a816d={'messageId':_0x25bc07[_0xf0dc('0x4c')]};if(!_0x4798f9[_0xf0dc('0x3d')]){_0x2a816d[_0xf0dc('0x3e')]=!![];}return _0x3674bb[_0xf0dc('0x18')](_0x2a816d);}else{logger[_0xf0dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0dc('0x2a'),_0xf0dc('0x4d'),util[_0xf0dc('0x2b')](_0x2599cc,{'showHidden':![],'depth':null}));}}else{logger[_0xf0dc('0x29')](_0xf0dc('0x2c'),_0xf0dc('0x2a'),_0xf0dc('0x4d'),util[_0xf0dc('0x2b')](_0x2599cc,{'showHidden':![],'depth':null}));}})[_0xf0dc('0x28')](function(_0x34029e){logger[_0xf0dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0dc('0x2a'),_0xf0dc('0x4d'),util[_0xf0dc('0x2b')](_0x34029e,{'showHidden':![],'depth':null}));});}else{logger[_0xf0dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0dc('0x2a'),_0xf0dc('0x4d'),_0xf0dc('0x4e'));}break;case _0xf0dc('0x4f'):if(_0x4798f9['authId']&&_0x4798f9['authToken']){var _0x2e371c={'dst':_0x502f8d[_0xf0dc('0x21')],'text':_0x502f8d[_0xf0dc('0xc')],'src':_0x4798f9[_0xf0dc('0x40')]||_0x4798f9[_0xf0dc('0x21')],'url':_0x4798f9[_0xf0dc('0x24')]+'/api/sms/messages/'+_0x502f8d['id']+_0xf0dc('0x50')+_0x4798f9[_0xf0dc('0x26')]};var _0x2ccff8=util[_0xf0dc('0x45')]('%s:%s',_0x4798f9[_0xf0dc('0x51')],_0x4798f9[_0xf0dc('0x20')]);var _0x4e2407={'method':_0xf0dc('0x38'),'uri':util[_0xf0dc('0x45')](_0xf0dc('0x52'),_0x4798f9[_0xf0dc('0x51')]),'body':_0x2e371c,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x2ccff8)[_0xf0dc('0x53')](_0xf0dc('0x48')))},'json':!![]};rp(_0x4e2407)[_0xf0dc('0x17')](function(_0x2ac076){var _0x2f5f69={'messageId':_0x2ac076[_0xf0dc('0x54')][0x0]};return _0x3674bb[_0xf0dc('0x18')](_0x2f5f69);})[_0xf0dc('0x28')](function(_0x2c063c){logger[_0xf0dc('0x29')](_0xf0dc('0x2c'),_0xf0dc('0x2a'),_0xf0dc('0x4f'),util['inspect'](_0x2c063c,{'showHidden':![],'depth':null}));});}else{logger[_0xf0dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf0dc('0x4f'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xf0dc('0x55'):if(_0x4798f9[_0xf0dc('0x2f')]&&_0x4798f9[_0xf0dc('0x30')]){if(_0x4798f9[_0xf0dc('0x56')]){var _0xebeeb4={'method':'POST','uri':_0x4798f9[_0xf0dc('0x56')]+_0xf0dc('0x57'),'body':{'username':_0x4798f9['username'],'password':_0x4798f9[_0xf0dc('0x30')]},'json':!![]};return rp(_0xebeeb4)[_0xf0dc('0x17')](function(_0x30d7bf){var _0x4e535b={'method':_0xf0dc('0x38'),'uri':_0x4798f9[_0xf0dc('0x56')]+_0xf0dc('0x58'),'body':{'messages':[{'from':_0x4798f9['phone'],'destinations':[{'to':_0x502f8d['phone']}],'text':_0x502f8d[_0xf0dc('0xc')],'notifyUrl':_0x4798f9[_0xf0dc('0x24')]+'/api/sms/messages/'+_0x502f8d['id']+_0xf0dc('0x50')+_0x4798f9[_0xf0dc('0x26')],'notifyContentType':_0xf0dc('0x59'),'callbackData':_0x4798f9[_0xf0dc('0x21')]+';'+_0x502f8d[_0xf0dc('0xc')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x30d7bf[_0xf0dc('0x26')]},'json':!![]};return rp(_0x4e535b)[_0xf0dc('0x17')](function(_0x1e8ba5){if(_0x1e8ba5['messages']){var _0x1dc7b9={'messageId':_0x1e8ba5[_0xf0dc('0x22')][0x0]['messageId']};if(!_0x4798f9[_0xf0dc('0x3d')]){_0x1dc7b9[_0xf0dc('0x3e')]=!![];}return _0x3674bb['update'](_0x1dc7b9);}else{return logger['error'](_0xf0dc('0x2c'),'afterCreate',_0xf0dc('0x55'),util[_0xf0dc('0x2b')](_0x1e8ba5,{'showHidden':![],'depth':null}));}});})[_0xf0dc('0x28')](function(_0x1245cc){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf0dc('0x55'),util['inspect'](_0x1245cc,{'showHidden':![],'depth':null}));});}else{logger[_0xf0dc('0x29')](_0xf0dc('0x2c'),'afterCreate',_0xf0dc('0x55'),'Missing\x20parameters:\x20base_url');}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0dc('0x2a'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case _0xf0dc('0x5a'):var _0x51ce08=require(_0xf0dc('0x5b'));if(_0x4798f9[_0xf0dc('0x5c')]){var _0x4c92a0={};_0x4c92a0[_0xf0dc('0x5d')]=_0x4798f9[_0xf0dc('0x2f')];_0x4c92a0['phone']=_0x502f8d[_0xf0dc('0x21')];_0x4c92a0['sender']=_0x4798f9['phone'];_0x4c92a0['text']=_0x502f8d[_0xf0dc('0xc')];_0x4c92a0[_0xf0dc('0x5e')]=+new Date();var _0x42f152='';var _0x35eed1='';var _0x43f3e0=Object[_0xf0dc('0x5f')](_0x4c92a0);_0x43f3e0[_0xf0dc('0x60')]();for(var _0x3447d5=0x0;_0x3447d5<_0x43f3e0[_0xf0dc('0x61')];_0x3447d5++){if(_0x42f152!=''){_0x42f152+='&';}_0x42f152+=_0x43f3e0[_0x3447d5]+'='+encodeURIComponent(_0x4c92a0[_0x43f3e0[_0x3447d5]]);_0x35eed1+=_0x4c92a0[_0x43f3e0[_0x3447d5]];}_0x35eed1+=_0x4798f9[_0xf0dc('0x5c')];_0x35eed1=_0x51ce08[_0xf0dc('0x62')]('md5')[_0xf0dc('0x18')](_0x35eed1)[_0xf0dc('0x63')]('hex');if(_0x42f152!==''){_0x42f152+='&';}_0x42f152+='signature='+_0x35eed1;var _0x2aefea={'method':_0xf0dc('0x35'),'uri':_0x4798f9['baseUrl']+_0xf0dc('0x64')+_0x42f152,'json':!![]};return rp(_0x2aefea)['then'](function(_0x573889){var _0x116c62=Object['keys'](_0x573889);if(_0x573889[_0x116c62[0x0]][_0xf0dc('0x29')]&&parseInt(_0x573889[_0x116c62[0x0]]['error'])===0x0){var _0x40adf9={'messageId':_0x573889[_0x116c62[0x0]][_0xf0dc('0x65')]};if(!_0x4798f9[_0xf0dc('0x3d')]){_0x40adf9[_0xf0dc('0x3e')]=!![];}return _0x3674bb[_0xf0dc('0x18')](_0x40adf9);}else{return logger[_0xf0dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0dc('0x2a'),_0xf0dc('0x5a'),util[_0xf0dc('0x2b')](_0x573889[_0xf0dc('0x29')],{'showHidden':![],'depth':null}));}})[_0xf0dc('0x28')](function(_0x3a82de){return logger[_0xf0dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf0dc('0x5a'),util[_0xf0dc('0x2b')](_0x3a82de,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf0dc('0x2c'),'afterCreate',_0xf0dc('0x5a'),_0xf0dc('0x66'));}break;case _0xf0dc('0x67'):if(_0x4798f9[_0xf0dc('0x5c')]){var _0x3d9285={'method':_0xf0dc('0x38'),'uri':_0xf0dc('0x68'),'headers':{'Authorization':_0x4798f9[_0xf0dc('0x5c')]},'body':{'content':_0x502f8d['body'],'to':[_0x502f8d[_0xf0dc('0x21')]],'from':_0x4798f9[_0xf0dc('0x21')],'binary':![],'clientMessageId':_0xf0dc('0x69'),'charset':_0xf0dc('0x6a')},'json':!![]};rp(_0x3d9285)[_0xf0dc('0x17')](function(_0x1314dd){if(!_0x1314dd[_0xf0dc('0x29')]){var _0x14ffb2={'messageId':_0x1314dd[_0xf0dc('0x22')][0x0]['apiMessageId']};if(!_0x4798f9[_0xf0dc('0x3d')]){_0x14ffb2[_0xf0dc('0x3e')]=!![];}return _0x3674bb[_0xf0dc('0x18')](_0x14ffb2);}else{return logger[_0xf0dc('0x29')](_0xf0dc('0x2c'),_0xf0dc('0x2a'),'clickatell',util[_0xf0dc('0x2b')](_0x1314dd[_0xf0dc('0x29')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x151094){return logger[_0xf0dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf0dc('0x67'),util['inspect'](_0x151094,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf0dc('0x2c'),'afterCreate',_0xf0dc('0x67'),_0xf0dc('0x66'));}break;case _0xf0dc('0x6b'):if(_0x4798f9['username']&&_0x4798f9[_0xf0dc('0x30')]){var _0x2ccff8=util[_0xf0dc('0x45')](_0xf0dc('0x46'),_0x4798f9[_0xf0dc('0x2f')],_0x4798f9[_0xf0dc('0x30')]);var _0x4e2407={'method':_0xf0dc('0x38'),'uri':_0xf0dc('0x6c')+_0x4798f9['accountId']+_0xf0dc('0x6d'),'body':{'to':[_0x502f8d[_0xf0dc('0x21')]],'text':_0x502f8d[_0xf0dc('0xc')],'from':_0x4798f9['phone'],'applicationId':_0x4798f9['applicationId']},'headers':{'Authorization':util[_0xf0dc('0x45')](_0xf0dc('0x6e'),new Buffer(_0x2ccff8)['toString']('base64'))},'json':!![]};rp(_0x4e2407)[_0xf0dc('0x17')](function(_0x3ec748){if(_0x3ec748['id']){var _0x5362b5={'messageId':_0x3ec748['id']};return _0x3674bb['update'](_0x5362b5);}else{logger[_0xf0dc('0x29')](_0xf0dc('0x2c'),'afterCreate',_0xf0dc('0x6b'),util['inspect'](_0x3ec748,{'showHidden':![],'depth':null}));}})['catch'](function(_0x781b64){logger[_0xf0dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf0dc('0x6b'),util[_0xf0dc('0x2b')](_0x781b64,{'showHidden':![],'depth':null}));});}else{logger[_0xf0dc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0dc('0x2a'),'bandwidth',_0xf0dc('0x4e'));}break;case'intelepeer':if(_0x4798f9['apiKey']){var _0x410aa5={};var _0x2aefea={'method':_0xf0dc('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xf0dc('0x6f')+_0x4798f9[_0xf0dc('0x5c')],'Content-Type':_0xf0dc('0x59')},'body':{'from':_0x4798f9['phone'],'to':_0x502f8d['phone'],'text':_0x502f8d['body']},'json':!![]};return rp(_0x2aefea)[_0xf0dc('0x17')](function(_0x539e9e){if(_0x539e9e[_0xf0dc('0x70')]==0xca){_0x410aa5[_0xf0dc('0x71')]=_0x539e9e;var _0x498f91={'method':'POST','uri':_0xf0dc('0x72'),'headers':{'Authorization':_0xf0dc('0x6f')+_0x4798f9['apiKey'],'Content-Type':_0xf0dc('0x59')},'body':{'refid':_0x410aa5[_0xf0dc('0x71')][_0xf0dc('0x73')]},'json':!![]};return rp(_0x498f91)[_0xf0dc('0x17')](function(_0x45493e){_0x410aa5['status']=_0x45493e;var _0x3f4907={'messageId':_0x410aa5[_0xf0dc('0x71')][_0xf0dc('0x73')],'read':!![]};return _0x3674bb[_0xf0dc('0x18')](_0x3f4907);});}else{return logger[_0xf0dc('0x29')](_0xf0dc('0x2c'),_0xf0dc('0x2a'),_0xf0dc('0x74'),util[_0xf0dc('0x2b')](_0x539e9e,{'showHidden':![],'depth':null}));}})[_0xf0dc('0x28')](function(_0x570feb){return logger['error'](_0xf0dc('0x2c'),_0xf0dc('0x2a'),_0xf0dc('0x74'),util[_0xf0dc('0x2b')](_0x570feb,{'showHidden':![],'depth':null}));});}else{return logger[_0xf0dc('0x29')](_0xf0dc('0x2c'),'afterCreate',_0xf0dc('0x74'),_0xf0dc('0x75'));}break;}}})[_0xf0dc('0x76')](function(){_0x5c10e2();});}else{_0x5c10e2();}}},'charset':_0xf0dc('0x77'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4368=['https://platform.clickatell.com/messages','uuid','UTF-8','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','applicationId','Bearer\x20','code','message','status','refid','intelepeer','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','toLowerCase','UserId','SmsInteraction','findOne','SmsInteractionId','then','createdAt','catch','direction','out','secret','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','GET','split','user_key','session_key','internal_order_id','read','error','skebby','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','deliveryReport','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','POST','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','crypto','text','timestamp','length','apiKey','createHash','digest','hex','signature=','/external/get/send.php?','csc','clickatell'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4368,0x82));var _0x8436=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x4368[_0xa8883];return _0x479426;};'use strict';var _=require(_0x8436('0x0'));var util=require(_0x8436('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8436('0x2'));var BPromise=require(_0x8436('0x3'));var rp=require(_0x8436('0x4'));var fs=require('fs');var path=require(_0x8436('0x5'));var rimraf=require(_0x8436('0x6'));var config=require('../../config/environment');var attributes=require(_0x8436('0x7'));module[_0x8436('0x8')]=function(_0x1a53de,_0x232b54){return _0x1a53de[_0x8436('0x9')]('SmsMessage',attributes,{'tableName':_0x8436('0xa'),'paranoid':![],'indexes':[{'name':_0x8436('0xb'),'fields':[_0x8436('0xb')]},{'name':_0x8436('0xc'),'fields':[_0x8436('0xd')],'type':_0x8436('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5093df,_0x61d285,_0x494c1b){var _0x136c0b=_0x1a53de['models'];var _0x1b3f9e=_0x5093df['get']({'plain':!![]});if(_0x1b3f9e['direction'][_0x8436('0xf')]()==='in'||_0x1b3f9e['direction'][_0x8436('0xf')]()==='out'&&!_0x1b3f9e['secret']&&!_['isNil'](_0x1b3f9e[_0x8436('0x10')])){_0x136c0b[_0x8436('0x11')][_0x8436('0x12')]({'where':{'id':_0x1b3f9e[_0x8436('0x13')]}})[_0x8436('0x14')](function(_0xd994d3){if(_0xd994d3){_0xd994d3['update']({'lastMsgAt':_0x1b3f9e[_0x8436('0x15')],'lastMsgDirection':_0x1b3f9e['direction'][_0x8436('0xf')]()});}})[_0x8436('0x16')](function(_0x465f6f){console['error'](_0x465f6f);});}if(_0x1b3f9e[_0x8436('0x17')]===_0x8436('0x18')&&!_0x1b3f9e[_0x8436('0x19')]){var _0x42a80d;_0x136c0b['SmsAccount'][_0x8436('0x1a')]({'where':{'id':_0x1b3f9e[_0x8436('0x1b')]},'raw':!![]})[_0x8436('0x14')](function(_0x4a9b67){_0x42a80d=_0x4a9b67;if(_0x42a80d&&_0x42a80d[_0x8436('0x1c')]){switch(_0x42a80d[_0x8436('0x1c')]){case _0x8436('0x1d'):var _0x5b45c4=require('twilio');if(_0x42a80d[_0x8436('0x1e')]&&_0x42a80d[_0x8436('0x1f')]&&_0x42a80d[_0x8436('0x20')]){var _0x2dda02=new _0x5b45c4(_0x42a80d[_0x8436('0x1e')],_0x42a80d[_0x8436('0x1f')]);_0x2dda02[_0x8436('0x21')][_0x8436('0x22')]({'body':_0x1b3f9e[_0x8436('0xd')],'to':_0x1b3f9e['phone'],'from':_0x42a80d['phone'],'statusCallback':_0x42a80d[_0x8436('0x23')]+_0x8436('0x24')+_0x1b3f9e['id']+_0x8436('0x25')+_0x42a80d[_0x8436('0x26')]})[_0x8436('0x14')](function(_0x1b4fd3){if(_0x1b4fd3[_0x8436('0x27')]){return _0x5093df[_0x8436('0x28')]({'messageId':_0x1b4fd3[_0x8436('0x27')]});}})['catch'](function(_0x1436d3){logger['error'](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x1d'),util[_0x8436('0x2b')](_0x1436d3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x1d'),_0x8436('0x2c'));}break;case'skebby':var _0x28750c=_0x8436('0x2d');if(_0x42a80d[_0x8436('0x2e')]&&_0x42a80d[_0x8436('0x2f')]){var _0x2b80da={'recipient':[_0x1b3f9e[_0x8436('0x20')]],'message':_0x1b3f9e[_0x8436('0xd')],'message_type':_0x42a80d[_0x8436('0x30')]};if(_0x42a80d['smsMethod']&&_0x42a80d[_0x8436('0x30')]!=='SI'){_0x2b80da[_0x8436('0x31')]=_0x42a80d['phone'];}var _0x27aa63={'url':_0x28750c+'login?username='+_0x42a80d[_0x8436('0x2e')]+'&password='+_0x42a80d[_0x8436('0x2f')],'method':_0x8436('0x32')};rp(_0x27aa63)[_0x8436('0x14')](function(_0x6cc6f0){var _0x5812e4=_0x6cc6f0[_0x8436('0x33')](';');var _0x5e7131={'user_key':_0x5812e4[0x0],'session_key':_0x5812e4[0x1]};_0x27aa63={'url':_0x28750c+'sms','method':'POST','headers':{'user_key':_0x5e7131[_0x8436('0x34')],'Session_key':_0x5e7131[_0x8436('0x35')]},'json':!![],'body':_0x2b80da};return rp(_0x27aa63);})[_0x8436('0x14')](function(_0x3a5a04){if(_0x3a5a04['total_sent']>=0x1){var _0x2301ed={'messageId':_0x3a5a04[_0x8436('0x36')]};if(_0x42a80d[_0x8436('0x30')]!=='GP'||!_0x42a80d['deliveryReport']){_0x2301ed[_0x8436('0x37')]=!![];}return _0x5093df[_0x8436('0x28')](_0x2301ed);}else{return logger[_0x8436('0x38')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8436('0x2a'),_0x8436('0x39'),util[_0x8436('0x2b')](_0x3a5a04,{'showHidden':![],'depth':null}));}})[_0x8436('0x16')](function(_0x1e0b7d){return logger[_0x8436('0x38')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8436('0x2a'),_0x8436('0x39'),util['inspect'](_0x1e0b7d,{'showHidden':![],'depth':null}));});}else{logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x39'),_0x8436('0x3a'));}break;case'connectel':if(_0x42a80d[_0x8436('0x1f')]){var _0x2c1ca2={'recipient':_0x1b3f9e[_0x8436('0x20')],'message':_0x1b3f9e[_0x8436('0xd')],'sender':_0x42a80d[_0x8436('0x3b')]||_0x42a80d['phone'],'authorization':_0x42a80d['authToken']};var _0x61d285={'method':'POST','uri':_0x8436('0x3c'),'body':_0x2c1ca2,'json':!![]};rp(_0x61d285)['then'](function(_0x2c8de4){var _0xfed9d9={'messageId':_0x2c8de4['requestid']};if(!_0x42a80d[_0x8436('0x3d')]){_0xfed9d9[_0x8436('0x37')]=!![];}return _0x5093df['update'](_0xfed9d9);})[_0x8436('0x16')](function(_0x18bc41){logger[_0x8436('0x38')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8436('0x3e'),util[_0x8436('0x2b')](_0x18bc41,{'showHidden':![],'depth':null}));});}else{logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),'connectel',_0x8436('0x3f'));}break;case _0x8436('0x40'):if(_0x42a80d[_0x8436('0x2e')]&&_0x42a80d[_0x8436('0x2f')]){var _0x2c1ca2={'messages':[{'source':_0x8436('0x41'),'to':_0x1b3f9e[_0x8436('0x20')],'body':_0x1b3f9e[_0x8436('0xd')],'from':_0x42a80d['senderString']||_0x42a80d[_0x8436('0x20')]}]};var _0x2def6f=util[_0x8436('0x42')]('%s:%s',_0x42a80d[_0x8436('0x2e')],_0x42a80d['password']);var _0x61d285={'method':_0x8436('0x43'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x2c1ca2,'headers':{'Authorization':util[_0x8436('0x42')](_0x8436('0x44'),new Buffer(_0x2def6f)[_0x8436('0x45')](_0x8436('0x46')))},'json':!![]};rp(_0x61d285)[_0x8436('0x14')](function(_0x489b61){if(_0x489b61[_0x8436('0x47')]>=0xc8&&_0x489b61[_0x8436('0x47')]<=0xce){if(_0x489b61[_0x8436('0x48')]&&_0x489b61[_0x8436('0x48')][_0x8436('0x49')]>0x0){var _0x3fbce0=_['head'](_0x489b61[_0x8436('0x48')][_0x8436('0x21')]);var _0x225445={'messageId':_0x3fbce0[_0x8436('0x4a')]};if(!_0x42a80d[_0x8436('0x3d')]){_0x225445[_0x8436('0x37')]=!![];}return _0x5093df[_0x8436('0x28')](_0x225445);}else{logger[_0x8436('0x38')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8436('0x2a'),_0x8436('0x4b'),util['inspect'](_0x489b61,{'showHidden':![],'depth':null}));}}else{logger[_0x8436('0x38')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8436('0x2a'),_0x8436('0x4b'),util['inspect'](_0x489b61,{'showHidden':![],'depth':null}));}})['catch'](function(_0x290efa){logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),'clickSend',util['inspect'](_0x290efa,{'showHidden':![],'depth':null}));});}else{logger[_0x8436('0x38')](_0x8436('0x29'),'afterCreate',_0x8436('0x4b'),_0x8436('0x3a'));}break;case'plivo':if(_0x42a80d[_0x8436('0x4c')]&&_0x42a80d['authToken']){var _0x2c1ca2={'dst':_0x1b3f9e['phone'],'text':_0x1b3f9e[_0x8436('0xd')],'src':_0x42a80d[_0x8436('0x3b')]||_0x42a80d[_0x8436('0x20')],'url':_0x42a80d['remote']+_0x8436('0x24')+_0x1b3f9e['id']+_0x8436('0x25')+_0x42a80d[_0x8436('0x26')]};var _0x2def6f=util['format'](_0x8436('0x4d'),_0x42a80d[_0x8436('0x4c')],_0x42a80d[_0x8436('0x1f')]);var _0x61d285={'method':_0x8436('0x43'),'uri':util[_0x8436('0x42')](_0x8436('0x4e'),_0x42a80d['authId']),'body':_0x2c1ca2,'headers':{'Authorization':util[_0x8436('0x42')]('Basic\x20%s',new Buffer(_0x2def6f)['toString'](_0x8436('0x46')))},'json':!![]};rp(_0x61d285)[_0x8436('0x14')](function(_0xad03e4){var _0x2346c3={'messageId':_0xad03e4[_0x8436('0x4f')][0x0]};return _0x5093df[_0x8436('0x28')](_0x2346c3);})[_0x8436('0x16')](function(_0x1112e9){logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x50'),util['inspect'](_0x1112e9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x50'),_0x8436('0x51'));}break;case _0x8436('0x52'):if(_0x42a80d[_0x8436('0x2e')]&&_0x42a80d['password']){if(_0x42a80d[_0x8436('0x53')]){var _0x116a5e={'method':_0x8436('0x43'),'uri':_0x42a80d['baseUrl']+_0x8436('0x54'),'body':{'username':_0x42a80d[_0x8436('0x2e')],'password':_0x42a80d[_0x8436('0x2f')]},'json':!![]};return rp(_0x116a5e)[_0x8436('0x14')](function(_0x4d4e80){var _0x5e9f07={'method':_0x8436('0x43'),'uri':_0x42a80d[_0x8436('0x53')]+_0x8436('0x55'),'body':{'messages':[{'from':_0x42a80d[_0x8436('0x20')],'destinations':[{'to':_0x1b3f9e[_0x8436('0x20')]}],'text':_0x1b3f9e[_0x8436('0xd')],'notifyUrl':_0x42a80d['remote']+_0x8436('0x24')+_0x1b3f9e['id']+_0x8436('0x25')+_0x42a80d[_0x8436('0x26')],'notifyContentType':_0x8436('0x56'),'callbackData':_0x42a80d[_0x8436('0x20')]+';'+_0x1b3f9e[_0x8436('0xd')]}]},'headers':{'Authorization':_0x8436('0x57')+_0x4d4e80[_0x8436('0x26')]},'json':!![]};return rp(_0x5e9f07)[_0x8436('0x14')](function(_0xd690e6){if(_0xd690e6[_0x8436('0x21')]){var _0x14993b={'messageId':_0xd690e6['messages'][0x0][_0x8436('0xb')]};if(!_0x42a80d[_0x8436('0x3d')]){_0x14993b[_0x8436('0x37')]=!![];}return _0x5093df['update'](_0x14993b);}else{return logger[_0x8436('0x38')](_0x8436('0x29'),'afterCreate',_0x8436('0x52'),util[_0x8436('0x2b')](_0xd690e6,{'showHidden':![],'depth':null}));}});})[_0x8436('0x16')](function(_0x1a665b){return logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x52'),util[_0x8436('0x2b')](_0x1a665b,{'showHidden':![],'depth':null}));});}else{logger[_0x8436('0x38')](_0x8436('0x29'),'afterCreate','infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x534092=require(_0x8436('0x58'));if(_0x42a80d['apiKey']){var _0x296f5d={};_0x296f5d['login']=_0x42a80d[_0x8436('0x2e')];_0x296f5d[_0x8436('0x20')]=_0x1b3f9e[_0x8436('0x20')];_0x296f5d[_0x8436('0x31')]=_0x42a80d[_0x8436('0x20')];_0x296f5d[_0x8436('0x59')]=_0x1b3f9e[_0x8436('0xd')];_0x296f5d[_0x8436('0x5a')]=+new Date();var _0x48b76e='';var _0x20e77d='';var _0x4e6e6a=Object['keys'](_0x296f5d);_0x4e6e6a['sort']();for(var _0x363a18=0x0;_0x363a18<_0x4e6e6a[_0x8436('0x5b')];_0x363a18++){if(_0x48b76e!=''){_0x48b76e+='&';}_0x48b76e+=_0x4e6e6a[_0x363a18]+'='+encodeURIComponent(_0x296f5d[_0x4e6e6a[_0x363a18]]);_0x20e77d+=_0x296f5d[_0x4e6e6a[_0x363a18]];}_0x20e77d+=_0x42a80d[_0x8436('0x5c')];_0x20e77d=_0x534092[_0x8436('0x5d')]('md5')[_0x8436('0x28')](_0x20e77d)[_0x8436('0x5e')](_0x8436('0x5f'));if(_0x48b76e!==''){_0x48b76e+='&';}_0x48b76e+=_0x8436('0x60')+_0x20e77d;var _0x27aa63={'method':_0x8436('0x32'),'uri':_0x42a80d[_0x8436('0x53')]+_0x8436('0x61')+_0x48b76e,'json':!![]};return rp(_0x27aa63)[_0x8436('0x14')](function(_0x1a09ed){var _0xd2ae53=Object['keys'](_0x1a09ed);if(_0x1a09ed[_0xd2ae53[0x0]][_0x8436('0x38')]&&parseInt(_0x1a09ed[_0xd2ae53[0x0]][_0x8436('0x38')])===0x0){var _0x164b0d={'messageId':_0x1a09ed[_0xd2ae53[0x0]]['id_sms']};if(!_0x42a80d[_0x8436('0x3d')]){_0x164b0d[_0x8436('0x37')]=!![];}return _0x5093df[_0x8436('0x28')](_0x164b0d);}else{return logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x62'),util[_0x8436('0x2b')](_0x1a09ed[_0x8436('0x38')],{'showHidden':![],'depth':null}));}})[_0x8436('0x16')](function(_0x24a40b){return logger[_0x8436('0x38')](_0x8436('0x29'),'afterCreate',_0x8436('0x62'),util[_0x8436('0x2b')](_0x24a40b,{'showHidden':![],'depth':null}));});}else{logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x62'),'Missing\x20parameters:\x20apiKey');}break;case _0x8436('0x63'):if(_0x42a80d[_0x8436('0x5c')]){var _0x1c132a={'method':_0x8436('0x43'),'uri':_0x8436('0x64'),'headers':{'Authorization':_0x42a80d['apiKey']},'body':{'content':_0x1b3f9e[_0x8436('0xd')],'to':[_0x1b3f9e[_0x8436('0x20')]],'from':_0x42a80d[_0x8436('0x20')],'binary':![],'clientMessageId':_0x8436('0x65'),'charset':_0x8436('0x66')},'json':!![]};rp(_0x1c132a)[_0x8436('0x14')](function(_0x39926f){if(!_0x39926f[_0x8436('0x38')]){var _0x553b4c={'messageId':_0x39926f['messages'][0x0]['apiMessageId']};if(!_0x42a80d[_0x8436('0x3d')]){_0x553b4c[_0x8436('0x37')]=!![];}return _0x5093df[_0x8436('0x28')](_0x553b4c);}else{return logger[_0x8436('0x38')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8436('0x2a'),_0x8436('0x63'),util[_0x8436('0x2b')](_0x39926f['error'],{'showHidden':![],'depth':null}));}})[_0x8436('0x16')](function(_0x15584f){return logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x63'),util[_0x8436('0x2b')](_0x15584f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8436('0x29'),'afterCreate',_0x8436('0x63'),_0x8436('0x67'));}break;case _0x8436('0x68'):if(_0x42a80d[_0x8436('0x2e')]&&_0x42a80d['password']){var _0x2def6f=util[_0x8436('0x42')]('%s:%s',_0x42a80d[_0x8436('0x2e')],_0x42a80d[_0x8436('0x2f')]);var _0x61d285={'method':_0x8436('0x43'),'uri':_0x8436('0x69')+_0x42a80d['accountId']+'/messages','body':{'to':[_0x1b3f9e['phone']],'text':_0x1b3f9e[_0x8436('0xd')],'from':_0x42a80d[_0x8436('0x20')],'applicationId':_0x42a80d[_0x8436('0x6a')]},'headers':{'Authorization':util[_0x8436('0x42')]('Basic\x20%s',new Buffer(_0x2def6f)[_0x8436('0x45')](_0x8436('0x46')))},'json':!![]};rp(_0x61d285)[_0x8436('0x14')](function(_0x4e55c3){if(_0x4e55c3['id']){var _0x51fe20={'messageId':_0x4e55c3['id']};return _0x5093df[_0x8436('0x28')](_0x51fe20);}else{logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x68'),util['inspect'](_0x4e55c3,{'showHidden':![],'depth':null}));}})[_0x8436('0x16')](function(_0x399228){logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x68'),util['inspect'](_0x399228,{'showHidden':![],'depth':null}));});}else{logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x68'),_0x8436('0x3a'));}break;case'intelepeer':if(_0x42a80d['apiKey']){var _0x30d932={};var _0x27aa63={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x8436('0x6b')+_0x42a80d[_0x8436('0x5c')],'Content-Type':_0x8436('0x56')},'body':{'from':_0x42a80d[_0x8436('0x20')],'to':_0x1b3f9e['phone'],'text':_0x1b3f9e[_0x8436('0xd')]},'json':!![]};return rp(_0x27aa63)[_0x8436('0x14')](function(_0x444b11){if(_0x444b11[_0x8436('0x6c')]==0xca){_0x30d932[_0x8436('0x6d')]=_0x444b11;var _0x5918d1={'method':_0x8436('0x43'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x42a80d[_0x8436('0x5c')],'Content-Type':_0x8436('0x56')},'body':{'refid':_0x30d932[_0x8436('0x6d')]['refid']},'json':!![]};return rp(_0x5918d1)[_0x8436('0x14')](function(_0x335451){_0x30d932[_0x8436('0x6e')]=_0x335451;var _0x1bdd4d={'messageId':_0x30d932[_0x8436('0x6d')][_0x8436('0x6f')],'read':!![]};return _0x5093df['update'](_0x1bdd4d);});}else{return logger[_0x8436('0x38')](_0x8436('0x29'),'afterCreate','intelepeer',util[_0x8436('0x2b')](_0x444b11,{'showHidden':![],'depth':null}));}})[_0x8436('0x16')](function(_0x531f7b){return logger[_0x8436('0x38')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8436('0x2a'),_0x8436('0x70'),util[_0x8436('0x2b')](_0x531f7b,{'showHidden':![],'depth':null}));});}else{return logger[_0x8436('0x38')](_0x8436('0x29'),_0x8436('0x2a'),_0x8436('0x70'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x494c1b();});}else{_0x494c1b();}}},'charset':_0x8436('0x71'),'collate':_0x8436('0x72')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 2d98879..e958225 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 _0x68f7=['register','then','info','request\x20sent','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x129f62,_0x1cdf67){var _0x2ea030=function(_0x2a3ae){while(--_0x2a3ae){_0x129f62['push'](_0x129f62['shift']());}};_0x2ea030(++_0x1cdf67);}(_0x68f7,0x1a5));var _0x768f=function(_0x53be2f,_0x2b041e){_0x53be2f=_0x53be2f-0x0;var _0x225286=_0x68f7[_0x53be2f];return _0x225286;};'use strict';var _=require('lodash');var util=require(_0x768f('0x0'));var moment=require('moment');var BPromise=require(_0x768f('0x1'));var rs=require(_0x768f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x768f('0x3'))['db'];var utils=require(_0x768f('0x4'));var logger=require(_0x768f('0x5'))('rpc');var config=require(_0x768f('0x6'));var jayson=require(_0x768f('0x7'));var client=jayson[_0x768f('0x8')]['http']({'port':0x232a});config[_0x768f('0x9')]=_[_0x768f('0xa')](config['redis'],{'host':_0x768f('0xb'),'port':0x18eb});var socket=require(_0x768f('0xc'))(new Redis(config[_0x768f('0x9')]));require('./smsMessage.socket')[_0x768f('0xd')](socket);function respondWithRpcPromise(_0x59aa57,_0x2b1200,_0xa319a1){return new BPromise(function(_0x2fa08b,_0x288a02){return client['request'](_0x59aa57,_0xa319a1)[_0x768f('0xe')](function(_0x2bfc49){logger[_0x768f('0xf')]('SmsMessage,\x20%s,\x20%s',_0x2b1200,_0x768f('0x10'));logger[_0x768f('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2b1200,_0x768f('0x10'),JSON[_0x768f('0x12')](_0x2bfc49));if(_0x2bfc49['error']){if(_0x2bfc49[_0x768f('0x13')][_0x768f('0x14')]===0x1f4){logger[_0x768f('0x13')](_0x768f('0x15'),_0x2b1200,_0x2bfc49[_0x768f('0x13')][_0x768f('0x16')]);return _0x288a02(_0x2bfc49[_0x768f('0x13')][_0x768f('0x16')]);}logger[_0x768f('0x13')](_0x768f('0x15'),_0x2b1200,_0x2bfc49['error'][_0x768f('0x16')]);return _0x2fa08b(_0x2bfc49['error'][_0x768f('0x16')]);}else{logger[_0x768f('0xf')](_0x768f('0x15'),_0x2b1200,_0x768f('0x10'));_0x2fa08b(_0x2bfc49[_0x768f('0x17')][_0x768f('0x16')]);}})[_0x768f('0x18')](function(_0x764754){logger['error']('SmsMessage,\x20%s,\x20%s',_0x2b1200,_0x764754);_0x288a02(_0x764754);});});}exports[_0x768f('0x19')]=function(_0x33ef14){var _0x1a3a8d=this;return new Promise(function(_0x2c3043,_0x3f3523){return db[_0x768f('0x1a')][_0x768f('0x1b')](_0x33ef14[_0x768f('0x1c')],{'raw':_0x33ef14[_0x768f('0x1d')]?_0x33ef14[_0x768f('0x1d')][_0x768f('0x1e')]===undefined?!![]:![]:!![]})[_0x768f('0xe')](function(_0x380cfc){logger[_0x768f('0xf')](_0x768f('0x19'),_0x33ef14);logger['debug']('CreateSmsMessage',_0x33ef14,JSON[_0x768f('0x12')](_0x380cfc));_0x2c3043(_0x380cfc);})['catch'](function(_0x2a7171){logger[_0x768f('0x13')](_0x768f('0x19'),_0x2a7171[_0x768f('0x16')],_0x33ef14);_0x3f3523(_0x1a3a8d['error'](0x1f4,_0x2a7171[_0x768f('0x16')]));});});}; \ No newline at end of file +var _0x27c3=['rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','body','options','raw','CreateSmsMessage','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x27c3,0x12f));var _0x327c=function(_0x4a9433,_0x5337cb){_0x4a9433=_0x4a9433-0x0;var _0x434947=_0x27c3[_0x4a9433];return _0x434947;};'use strict';var _=require(_0x327c('0x0'));var util=require(_0x327c('0x1'));var moment=require(_0x327c('0x2'));var BPromise=require('bluebird');var rs=require(_0x327c('0x3'));var fs=require('fs');var Redis=require(_0x327c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x327c('0x5'));var logger=require(_0x327c('0x6'))(_0x327c('0x7'));var config=require(_0x327c('0x8'));var jayson=require(_0x327c('0x9'));var client=jayson[_0x327c('0xa')]['http']({'port':0x232a});config[_0x327c('0xb')]=_['defaults'](config[_0x327c('0xb')],{'host':_0x327c('0xc'),'port':0x18eb});var socket=require(_0x327c('0xd'))(new Redis(config['redis']));require(_0x327c('0xe'))[_0x327c('0xf')](socket);function respondWithRpcPromise(_0x32fa0d,_0x2b37cb,_0xe931f8){return new BPromise(function(_0x360ab2,_0x3e5960){return client[_0x327c('0x10')](_0x32fa0d,_0xe931f8)[_0x327c('0x11')](function(_0x3a2c90){logger[_0x327c('0x12')](_0x327c('0x13'),_0x2b37cb,_0x327c('0x14'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2b37cb,'request\x20sent',JSON[_0x327c('0x15')](_0x3a2c90));if(_0x3a2c90['error']){if(_0x3a2c90[_0x327c('0x16')][_0x327c('0x17')]===0x1f4){logger[_0x327c('0x16')](_0x327c('0x13'),_0x2b37cb,_0x3a2c90[_0x327c('0x16')][_0x327c('0x18')]);return _0x3e5960(_0x3a2c90[_0x327c('0x16')][_0x327c('0x18')]);}logger[_0x327c('0x16')](_0x327c('0x13'),_0x2b37cb,_0x3a2c90[_0x327c('0x16')][_0x327c('0x18')]);return _0x360ab2(_0x3a2c90[_0x327c('0x16')][_0x327c('0x18')]);}else{logger[_0x327c('0x12')]('SmsMessage,\x20%s,\x20%s',_0x2b37cb,_0x327c('0x14'));_0x360ab2(_0x3a2c90['result'][_0x327c('0x18')]);}})[_0x327c('0x19')](function(_0x2a9f5a){logger[_0x327c('0x16')](_0x327c('0x13'),_0x2b37cb,_0x2a9f5a);_0x3e5960(_0x2a9f5a);});});}exports['CreateSmsMessage']=function(_0x704aa1){var _0x2b0912=this;return new Promise(function(_0x27bb15,_0x2a607c){return db['SmsMessage']['create'](_0x704aa1[_0x327c('0x1a')],{'raw':_0x704aa1[_0x327c('0x1b')]?_0x704aa1['options'][_0x327c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x172ee7){logger[_0x327c('0x12')](_0x327c('0x1d'),_0x704aa1);logger[_0x327c('0x1e')](_0x327c('0x1d'),_0x704aa1,JSON['stringify'](_0x172ee7));_0x27bb15(_0x172ee7);})[_0x327c('0x19')](function(_0x4b7db9){logger[_0x327c('0x16')](_0x327c('0x1d'),_0x4b7db9['message'],_0x704aa1);_0x2a607c(_0x2b0912['error'](0x1f4,_0x4b7db9[_0x327c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index b626bf9..eb2fb35 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 _0x5471=['save','remove','update','removeListener','register','smsMessage:'];(function(_0x4bb842,_0xae8709){var _0x23c6d4=function(_0x5118f4){while(--_0x5118f4){_0x4bb842['push'](_0x4bb842['shift']());}};_0x23c6d4(++_0xae8709);}(_0x5471,0x1e6));var _0x1547=function(_0xfc0feb,_0x4f6e0d){_0xfc0feb=_0xfc0feb-0x0;var _0x297e27=_0x5471[_0xfc0feb];return _0x297e27;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x1547('0x0'),_0x1547('0x1'),_0x1547('0x2')];function createListener(_0x70079b,_0x3857f2){return function(_0x43238b){_0x3857f2['emit'](_0x70079b,_0x43238b);};}function removeListener(_0x401b81,_0x4cdac7){return function(){SmsMessageEvents[_0x1547('0x3')](_0x401b81,_0x4cdac7);};}exports[_0x1547('0x4')]=function(_0x2ceeaf){for(var _0x1b2a91=0x0,_0x85bb84=events['length'];_0x1b2a91<_0x85bb84;_0x1b2a91++){var _0x4c6856=events[_0x1b2a91];var _0x3e2097=createListener(_0x1547('0x5')+_0x4c6856,_0x2ceeaf);SmsMessageEvents['on'](_0x4c6856,_0x3e2097);}}; \ No newline at end of file +var _0xb95c=['./smsMessage.events','save','emit','removeListener','register','length','smsMessage:'];(function(_0x2472a6,_0x5f2d82){var _0x5c04b9=function(_0x184f77){while(--_0x184f77){_0x2472a6['push'](_0x2472a6['shift']());}};_0x5c04b9(++_0x5f2d82);}(_0xb95c,0x17a));var _0xcb95=function(_0x5accf6,_0x26a155){_0x5accf6=_0x5accf6-0x0;var _0x10218c=_0xb95c[_0x5accf6];return _0x10218c;};'use strict';var SmsMessageEvents=require(_0xcb95('0x0'));var events=[_0xcb95('0x1'),'remove','update'];function createListener(_0xdbceac,_0x24309d){return function(_0x5bc68f){_0x24309d[_0xcb95('0x2')](_0xdbceac,_0x5bc68f);};}function removeListener(_0x5a2c0b,_0x51c09d){return function(){SmsMessageEvents[_0xcb95('0x3')](_0x5a2c0b,_0x51c09d);};}exports[_0xcb95('0x4')]=function(_0x2f53f6){for(var _0x4999bf=0x0,_0x129ccc=events[_0xcb95('0x5')];_0x4999bf<_0x129ccc;_0x4999bf++){var _0x2fe746=events[_0x4999bf];var _0x5da07c=createListener(_0xcb95('0x6')+_0x2fe746,_0x2f53f6);SmsMessageEvents['on'](_0x2fe746,_0x5da07c);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index ff47e1c..63e0ab2 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 _0x9018=['addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post','create'];(function(_0x34725a,_0x443114){var _0x1739ef=function(_0x3b11a2){while(--_0x3b11a2){_0x34725a['push'](_0x34725a['shift']());}};_0x1739ef(++_0x443114);}(_0x9018,0x1bb));var _0x8901=function(_0xef4fc0,_0x33cc41){_0xef4fc0=_0xef4fc0-0x0;var _0x57dade=_0x9018[_0xef4fc0];return _0x57dade;};'use strict';var multer=require(_0x8901('0x0'));var util=require(_0x8901('0x1'));var path=require(_0x8901('0x2'));var timeout=require(_0x8901('0x3'));var express=require(_0x8901('0x4'));var router=express['Router']();var fs_extra=require(_0x8901('0x5'));var auth=require(_0x8901('0x6'));var interaction=require(_0x8901('0x7'));var config=require(_0x8901('0x8'));var controller=require(_0x8901('0x9'));router[_0x8901('0xa')]('/',auth[_0x8901('0xb')](),controller['index']);router['get'](_0x8901('0xc'),auth[_0x8901('0xb')](),controller['describe']);router[_0x8901('0xa')](_0x8901('0xd'),auth[_0x8901('0xb')](),controller[_0x8901('0xe')]);router['get'](_0x8901('0xf'),auth[_0x8901('0xb')](),controller[_0x8901('0x10')]);router['get'](_0x8901('0x11'),auth[_0x8901('0xb')](),controller['getTeams']);router[_0x8901('0xa')](_0x8901('0x12'),auth[_0x8901('0xb')](),controller['getAgents']);router[_0x8901('0x13')]('/',auth['isAuthenticated'](),controller[_0x8901('0x14')]);router[_0x8901('0x13')](_0x8901('0x11'),auth['isAuthenticated'](),controller[_0x8901('0x15')]);router[_0x8901('0x13')]('/:id/users',auth[_0x8901('0xb')](),controller[_0x8901('0x16')]);router[_0x8901('0x17')](_0x8901('0xd'),auth[_0x8901('0xb')](),controller[_0x8901('0x18')]);router[_0x8901('0x19')]('/:id',auth[_0x8901('0xb')](),controller[_0x8901('0x1a')]);router[_0x8901('0x19')](_0x8901('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x8901('0x19')](_0x8901('0x12'),auth[_0x8901('0xb')](),controller[_0x8901('0x1b')]);module[_0x8901('0x1c')]=router; \ No newline at end of file +var _0x272a=['getTeams','/:id/users','getAgents','post','addAgents','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams'];(function(_0x469341,_0x385011){var _0x51d063=function(_0x45677d){while(--_0x45677d){_0x469341['push'](_0x469341['shift']());}};_0x51d063(++_0x385011);}(_0x272a,0x132));var _0xa272=function(_0xf2e241,_0x4abe27){_0xf2e241=_0xf2e241-0x0;var _0x45ff23=_0x272a[_0xf2e241];return _0x45ff23;};'use strict';var multer=require(_0xa272('0x0'));var util=require('util');var path=require(_0xa272('0x1'));var timeout=require(_0xa272('0x2'));var express=require(_0xa272('0x3'));var router=express[_0xa272('0x4')]();var fs_extra=require(_0xa272('0x5'));var auth=require(_0xa272('0x6'));var interaction=require(_0xa272('0x7'));var config=require(_0xa272('0x8'));var controller=require(_0xa272('0x9'));router[_0xa272('0xa')]('/',auth[_0xa272('0xb')](),controller[_0xa272('0xc')]);router[_0xa272('0xa')](_0xa272('0xd'),auth['isAuthenticated'](),controller[_0xa272('0xe')]);router[_0xa272('0xa')](_0xa272('0xf'),auth['isAuthenticated'](),controller[_0xa272('0x10')]);router['get']('/:id/members',auth[_0xa272('0xb')](),controller['getMembers']);router[_0xa272('0xa')](_0xa272('0x11'),auth[_0xa272('0xb')](),controller[_0xa272('0x12')]);router['get'](_0xa272('0x13'),auth[_0xa272('0xb')](),controller[_0xa272('0x14')]);router[_0xa272('0x15')]('/',auth[_0xa272('0xb')](),controller['create']);router[_0xa272('0x15')](_0xa272('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0xa272('0x15')](_0xa272('0x13'),auth['isAuthenticated'](),controller[_0xa272('0x16')]);router['put'](_0xa272('0xf'),auth['isAuthenticated'](),controller[_0xa272('0x17')]);router[_0xa272('0x18')](_0xa272('0xf'),auth[_0xa272('0xb')](),controller[_0xa272('0x19')]);router[_0xa272('0x18')](_0xa272('0x11'),auth[_0xa272('0xb')](),controller['removeTeams']);router['delete'](_0xa272('0x13'),auth[_0xa272('0xb')](),controller['removeAgents']);module[_0xa272('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 24d9541..eb4e439 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 _0x51c4=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x4fddf3,_0x3d3a99){var _0xe5feec=function(_0x3afdef){while(--_0x3afdef){_0x4fddf3['push'](_0x4fddf3['shift']());}};_0xe5feec(++_0x3d3a99);}(_0x51c4,0x192));var _0x451c=function(_0x11d7ad,_0x10fe19){_0x11d7ad=_0x11d7ad-0x0;var _0x5f5410=_0x51c4[_0x11d7ad];return _0x5f5410;};'use strict';var Sequelize=require('sequelize');module[_0x451c('0x0')]={'name':{'type':Sequelize[_0x451c('0x1')],'unique':_0x451c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x451c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x451c('0x4'),_0x451c('0x5'),_0x451c('0x6'))}}; \ No newline at end of file +var _0x4abd=['rrmemory','beepall','sequelize','exports','STRING','INTEGER'];(function(_0x43eadd,_0x36ca50){var _0x125bde=function(_0x5d74cf){while(--_0x5d74cf){_0x43eadd['push'](_0x43eadd['shift']());}};_0x125bde(++_0x36ca50);}(_0x4abd,0xbc));var _0xd4ab=function(_0x15e0d2,_0x8333c){_0x15e0d2=_0x15e0d2-0x0;var _0x45bb73=_0x4abd[_0x15e0d2];return _0x45bb73;};'use strict';var Sequelize=require(_0xd4ab('0x0'));module[_0xd4ab('0x1')]={'name':{'type':Sequelize[_0xd4ab('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd4ab('0x2')]},'timeout':{'type':Sequelize[_0xd4ab('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd4ab('0x4'),_0xd4ab('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 2e69c8d..ae9666b 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 _0xafa8=['includes','all','union','compact','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../config/license/util','../../mysqldb','redis','defaults','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','destroy','SmsQueues','UserProfileResource','then','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','createdAt','%s/%s','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','QueryTypes','TeamId'];(function(_0xd158dc,_0x128608){var _0x12d25f=function(_0x2e9d2b){while(--_0x2e9d2b){_0xd158dc['push'](_0xd158dc['shift']());}};_0x12d25f(++_0x128608);}(_0xafa8,0x93));var _0x8afa=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0xafa8[_0x6d6a66];return _0x11eb6e;};'use strict';var emlformat=require(_0x8afa('0x0'));var rimraf=require(_0x8afa('0x1'));var zipdir=require(_0x8afa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8afa('0x3'));var moment=require(_0x8afa('0x4'));var BPromise=require(_0x8afa('0x5'));var Mustache=require(_0x8afa('0x6'));var util=require(_0x8afa('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8afa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8afa('0x9'));var crypto=require(_0x8afa('0xa'));var jsforce=require(_0x8afa('0xb'));var deskjs=require(_0x8afa('0xc'));var toCsv=require(_0x8afa('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8afa('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8afa('0xf'));var db=require(_0x8afa('0x10'))['db'];config[_0x8afa('0x11')]=_[_0x8afa('0x12')](config[_0x8afa('0x11')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8afa('0x13'))[_0x8afa('0x14')](socket);function respondWithStatusCode(_0x2d817a,_0x2f9534){_0x2f9534=_0x2f9534||0xcc;return function(_0x21db57){if(_0x21db57){return _0x2d817a[_0x8afa('0x15')](_0x2f9534);}return _0x2d817a[_0x8afa('0x16')](_0x2f9534)[_0x8afa('0x17')]();};}function respondWithResult(_0x5e7d39,_0x3e2ea9){_0x3e2ea9=_0x3e2ea9||0xc8;return function(_0x2c8c4c){if(_0x2c8c4c){return _0x5e7d39['status'](_0x3e2ea9)[_0x8afa('0x18')](_0x2c8c4c);}};}function respondWithFilteredResult(_0x10771b,_0x5e0620){return function(_0x455f2e){if(_0x455f2e){var _0x40b75b=_0x455f2e['count'],_0x3df3a3=_0x5e0620[_0x8afa('0x19')],_0x505b06=_0x5e0620[_0x8afa('0x19')]+_0x5e0620[_0x8afa('0x1a')],_0x1d08e3;if(_0x505b06>=_0x40b75b){_0x505b06=_0x40b75b;_0x1d08e3=0xc8;}else{_0x1d08e3=0xce;}_0x10771b[_0x8afa('0x16')](_0x1d08e3);return _0x10771b[_0x8afa('0x1b')](_0x8afa('0x1c'),_0x3df3a3+'-'+_0x505b06+'/'+_0x40b75b)[_0x8afa('0x18')](_0x455f2e);}return null;};}function patchUpdates(_0xd2b67){return function(_0x28df87){try{jsonpatch[_0x8afa('0x1d')](_0x28df87,_0xd2b67,!![]);}catch(_0x48ba46){return BPromise['reject'](_0x48ba46);}return _0x28df87[_0x8afa('0x1e')]();};}function saveUpdates(_0x215c55,_0x2ddb58){return function(_0x96daf0){if(_0x96daf0){return _0x96daf0['update'](_0x215c55)['then'](function(_0xf08d81){return _0xf08d81;});}return null;};}function removeEntity(_0xdb0b8a,_0x108174){return function(_0x369df3){if(_0x369df3){return _0x369df3[_0x8afa('0x1f')]()['then'](function(){var _0x543cde=_0x369df3['get']({'plain':!![]});var _0x3efa7f=_0x8afa('0x20');return db[_0x8afa('0x21')][_0x8afa('0x1f')]({'where':{'type':_0x3efa7f,'resourceId':_0x543cde['id']}})['then'](function(){return _0x369df3;});})[_0x8afa('0x22')](function(){_0xdb0b8a[_0x8afa('0x16')](0xcc)[_0x8afa('0x17')]();});}};}function handleEntityNotFound(_0x1b3864,_0x41f766){return function(_0x425a44){if(!_0x425a44){_0x1b3864[_0x8afa('0x15')](0x194);}return _0x425a44;};}function handleError(_0x154173,_0x2f0cc9){_0x2f0cc9=_0x2f0cc9||0x1f4;return function(_0x19887a){logger['error'](_0x19887a[_0x8afa('0x23')]);if(_0x19887a[_0x8afa('0x24')]){delete _0x19887a[_0x8afa('0x24')];}_0x154173[_0x8afa('0x16')](_0x2f0cc9)[_0x8afa('0x25')](_0x19887a);};}exports[_0x8afa('0x26')]=function(_0xf83a15,_0x362f54){var _0x36cf0a={},_0x15929e={},_0x5970cd={'count':0x0,'rows':[]};var _0x326bc2=_[_0x8afa('0x27')](db[_0x8afa('0x28')][_0x8afa('0x29')],function(_0x15e39a){return{'name':_0x15e39a[_0x8afa('0x2a')],'type':_0x15e39a[_0x8afa('0x2b')][_0x8afa('0x2c')]};});_0x15929e[_0x8afa('0x2d')]=_[_0x8afa('0x27')](_0x326bc2,_0x8afa('0x24'));_0x15929e[_0x8afa('0x2e')]=_['keys'](_0xf83a15['query']);_0x15929e['filters']=_[_0x8afa('0x2f')](_0x15929e[_0x8afa('0x2d')],_0x15929e[_0x8afa('0x2e')]);_0x36cf0a[_0x8afa('0x30')]=_[_0x8afa('0x2f')](_0x15929e['model'],qs[_0x8afa('0x31')](_0xf83a15[_0x8afa('0x2e')][_0x8afa('0x31')]));_0x36cf0a[_0x8afa('0x30')]=_0x36cf0a[_0x8afa('0x30')][_0x8afa('0x32')]?_0x36cf0a['attributes']:_0x15929e['model'];if(!_0xf83a15[_0x8afa('0x2e')][_0x8afa('0x33')](_0x8afa('0x34'))){_0x36cf0a[_0x8afa('0x1a')]=qs[_0x8afa('0x1a')](_0xf83a15[_0x8afa('0x2e')][_0x8afa('0x1a')]);_0x36cf0a[_0x8afa('0x19')]=qs[_0x8afa('0x19')](_0xf83a15[_0x8afa('0x2e')][_0x8afa('0x19')]);}_0x36cf0a[_0x8afa('0x35')]=qs[_0x8afa('0x36')](_0xf83a15[_0x8afa('0x2e')][_0x8afa('0x36')]);_0x36cf0a[_0x8afa('0x37')]=qs[_0x8afa('0x38')](_[_0x8afa('0x39')](_0xf83a15['query'],_0x15929e[_0x8afa('0x38')]),_0x326bc2);if(_0xf83a15[_0x8afa('0x2e')][_0x8afa('0x3a')]){_0x36cf0a[_0x8afa('0x37')]=_[_0x8afa('0x3b')](_0x36cf0a[_0x8afa('0x37')],{'$or':_[_0x8afa('0x27')](_0x326bc2,function(_0x3ba60f){if(_0x3ba60f[_0x8afa('0x2b')]!==_0x8afa('0x3c')){var _0x45009a={};_0x45009a[_0x3ba60f[_0x8afa('0x24')]]={'$like':'%'+_0xf83a15[_0x8afa('0x2e')]['filter']+'%'};return _0x45009a;}})});}_0x36cf0a=_[_0x8afa('0x3b')]({},_0x36cf0a,_0xf83a15[_0x8afa('0x3d')]);var _0x194c4c={'where':_0x36cf0a['where']};return db[_0x8afa('0x28')][_0x8afa('0x3e')](_0x194c4c)[_0x8afa('0x22')](function(_0x7a5362){_0x5970cd['count']=_0x7a5362;if(_0xf83a15['query'][_0x8afa('0x3f')]){_0x36cf0a[_0x8afa('0x40')]=[{'all':!![]}];}return db['SmsQueue'][_0x8afa('0x41')](_0x36cf0a);})[_0x8afa('0x22')](function(_0x428872){_0x5970cd[_0x8afa('0x42')]=_0x428872;return _0x5970cd;})[_0x8afa('0x22')](respondWithFilteredResult(_0x362f54,_0x36cf0a))[_0x8afa('0x43')](handleError(_0x362f54,null));};exports[_0x8afa('0x44')]=function(_0x170204,_0x5b720d){var _0x844d14={'raw':!![],'where':{'id':_0x170204[_0x8afa('0x45')]['id']}},_0x38e52c={};_0x38e52c[_0x8afa('0x2d')]=_[_0x8afa('0x46')](db[_0x8afa('0x28')][_0x8afa('0x29')]);_0x38e52c[_0x8afa('0x2e')]=_[_0x8afa('0x46')](_0x170204['query']);_0x38e52c['filters']=_[_0x8afa('0x2f')](_0x38e52c['model'],_0x38e52c[_0x8afa('0x2e')]);_0x844d14[_0x8afa('0x30')]=_[_0x8afa('0x2f')](_0x38e52c['model'],qs[_0x8afa('0x31')](_0x170204['query'][_0x8afa('0x31')]));_0x844d14[_0x8afa('0x30')]=_0x844d14[_0x8afa('0x30')][_0x8afa('0x32')]?_0x844d14['attributes']:_0x38e52c[_0x8afa('0x2d')];if(_0x170204[_0x8afa('0x2e')]['includeAll']){_0x844d14[_0x8afa('0x40')]=[{'all':!![]}];}_0x844d14=_[_0x8afa('0x3b')]({},_0x844d14,_0x170204[_0x8afa('0x3d')]);return db['SmsQueue'][_0x8afa('0x47')](_0x844d14)[_0x8afa('0x22')](handleEntityNotFound(_0x5b720d,null))[_0x8afa('0x22')](respondWithResult(_0x5b720d,null))[_0x8afa('0x43')](handleError(_0x5b720d,null));};exports[_0x8afa('0x48')]=function(_0x173794,_0x1bfd7f){return db[_0x8afa('0x28')][_0x8afa('0x48')](_0x173794[_0x8afa('0x49')],{})[_0x8afa('0x22')](function(_0x48e34e){var _0x33ff28=_0x173794[_0x8afa('0x4a')][_0x8afa('0x4b')]({'plain':!![]});if(!_0x33ff28)throw new Error(_0x8afa('0x4c'));if(_0x33ff28[_0x8afa('0x4d')]===_0x8afa('0x4a')){var _0x11315c=_0x48e34e[_0x8afa('0x4b')]({'plain':!![]});var _0x45fbac=_0x8afa('0x20');return db[_0x8afa('0x4e')]['find']({'where':{'name':_0x45fbac,'userProfileId':_0x33ff28[_0x8afa('0x4f')]},'raw':!![]})[_0x8afa('0x22')](function(_0x43aef0){if(_0x43aef0&&_0x43aef0[_0x8afa('0x50')]===0x0){return db[_0x8afa('0x21')]['create']({'name':_0x11315c[_0x8afa('0x24')],'resourceId':_0x11315c['id'],'type':_0x43aef0['name'],'sectionId':_0x43aef0['id']},{})[_0x8afa('0x22')](function(){return _0x48e34e;});}else{return _0x48e34e;}})[_0x8afa('0x43')](function(_0x4d6f64){logger[_0x8afa('0x51')](_0x8afa('0x52'),_0x4d6f64);throw _0x4d6f64;});}return _0x48e34e;})[_0x8afa('0x22')](respondWithResult(_0x1bfd7f,0xc9))[_0x8afa('0x43')](handleError(_0x1bfd7f,null));};exports[_0x8afa('0x53')]=function(_0x300adb,_0x52da2a){if(_0x300adb['body']['id']){delete _0x300adb[_0x8afa('0x49')]['id'];}return db['SmsQueue'][_0x8afa('0x47')]({'where':{'id':_0x300adb[_0x8afa('0x45')]['id']}})[_0x8afa('0x22')](handleEntityNotFound(_0x52da2a,null))['then'](saveUpdates(_0x300adb[_0x8afa('0x49')],null))[_0x8afa('0x22')](respondWithResult(_0x52da2a,null))['catch'](handleError(_0x52da2a,null));};exports[_0x8afa('0x1f')]=function(_0x21ae97,_0x33bf20){return db[_0x8afa('0x28')][_0x8afa('0x47')]({'where':{'id':_0x21ae97[_0x8afa('0x45')]['id']}})[_0x8afa('0x22')](handleEntityNotFound(_0x33bf20,null))['then'](removeEntity(_0x33bf20,null))['catch'](handleError(_0x33bf20,null));};exports[_0x8afa('0x54')]=function(_0x29719e,_0x1d192a){return db[_0x8afa('0x28')][_0x8afa('0x54')]()[_0x8afa('0x22')](respondWithResult(_0x1d192a,null))[_0x8afa('0x43')](handleError(_0x1d192a,null));};exports[_0x8afa('0x55')]=function(_0x4670bc,_0x7c0b45,_0x537ad8){var _0x527c3e={'raw':!![],'where':{}},_0x38f192={},_0x372718;return db['SmsQueue'][_0x8afa('0x56')]({'where':{'id':_0x4670bc['params']['id']}})[_0x8afa('0x22')](handleEntityNotFound(_0x7c0b45,null))[_0x8afa('0x22')](function(_0x3e1593){if(_0x3e1593){_0x372718=_0x3e1593[_0x8afa('0x4b')]({'plain':!![]});_0x38f192[_0x8afa('0x2d')]=_['keys'](db[_0x8afa('0x57')][_0x8afa('0x29')]);_0x38f192[_0x8afa('0x2e')]=_['keys'](_0x4670bc[_0x8afa('0x2e')]);_0x38f192[_0x8afa('0x38')]=_[_0x8afa('0x2f')](_0x38f192[_0x8afa('0x2d')],_0x38f192['query']);_0x527c3e[_0x8afa('0x30')]=_['intersection'](_0x38f192[_0x8afa('0x2d')],qs[_0x8afa('0x31')](_0x4670bc[_0x8afa('0x2e')]['fields']));_0x527c3e[_0x8afa('0x30')]=_0x527c3e[_0x8afa('0x30')][_0x8afa('0x32')]?_0x527c3e[_0x8afa('0x30')]:_0x38f192[_0x8afa('0x2d')];if(!_0x4670bc[_0x8afa('0x2e')][_0x8afa('0x33')](_0x8afa('0x34'))){_0x527c3e[_0x8afa('0x1a')]=qs[_0x8afa('0x1a')](_0x4670bc[_0x8afa('0x2e')][_0x8afa('0x1a')]);_0x527c3e[_0x8afa('0x19')]=qs[_0x8afa('0x19')](_0x4670bc[_0x8afa('0x2e')][_0x8afa('0x19')]);}_0x527c3e['order']=qs[_0x8afa('0x36')](_0x4670bc[_0x8afa('0x2e')][_0x8afa('0x36')]);_0x527c3e[_0x8afa('0x37')]=qs[_0x8afa('0x38')](_[_0x8afa('0x39')](_0x4670bc[_0x8afa('0x2e')],_0x38f192[_0x8afa('0x38')]));_0x527c3e['where'][_0x8afa('0x58')]=_0x3e1593['id'];if(_0x4670bc[_0x8afa('0x2e')][_0x8afa('0x3a')]){_0x527c3e['where']=_[_0x8afa('0x3b')](_0x527c3e[_0x8afa('0x37')],{'$or':_[_0x8afa('0x27')](_0x527c3e[_0x8afa('0x30')],function(_0x5e995e){var _0x5f5c34={};_0x5f5c34[_0x5e995e]={'$like':'%'+_0x4670bc[_0x8afa('0x2e')][_0x8afa('0x3a')]+'%'};return _0x5f5c34;})});}_0x527c3e=_[_0x8afa('0x3b')]({},_0x527c3e,_0x4670bc[_0x8afa('0x3d')]);return db[_0x8afa('0x57')][_0x8afa('0x41')](_0x527c3e);}})[_0x8afa('0x22')](function(_0x32e54c){if(_0x32e54c){return db[_0x8afa('0x59')][_0x8afa('0x5a')]({'where':{'id':_[_0x8afa('0x27')](_0x32e54c,_0x8afa('0x5b')),'role':_0x8afa('0x5c')},'attributes':['id','name',_0x8afa('0x5d'),'updatedAt',_0x8afa('0x5e')]});}})['then'](function(_0x49265f){if(_0x49265f){return{'count':_0x49265f[_0x8afa('0x3e')],'rows':_[_0x8afa('0x27')](_0x49265f[_0x8afa('0x42')],function(_0x130c4c){return{'membername':_0x130c4c[_0x8afa('0x24')],'UserId':_0x130c4c['id'],'queue_name':_0x372718[_0x8afa('0x24')],'SmsQueueId':_0x372718['id'],'interface':util['format'](_0x8afa('0x5f'),'SIP',_0x130c4c[_0x8afa('0x24')]),'penalty':0x0,'paused':_0x130c4c[_0x8afa('0x5d')],'createdAt':_0x130c4c[_0x8afa('0x5e')],'updatedAt':_0x130c4c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8afa('0x22')](respondWithFilteredResult(_0x7c0b45,_0x527c3e))['catch'](handleError(_0x7c0b45,null));};exports[_0x8afa('0x60')]=function(_0x358f36,_0x2727be,_0x3bfd17){var _0x4cea03={};var _0x15b5f8={};var _0x1506f0;var _0x7bf00;return db['SmsQueue'][_0x8afa('0x56')]({'where':{'id':_0x358f36[_0x8afa('0x45')]['id']}})['then'](handleEntityNotFound(_0x2727be,null))[_0x8afa('0x22')](function(_0x303347){if(_0x303347){_0x1506f0=_0x303347;_0x15b5f8[_0x8afa('0x2d')]=_['keys'](db['Team'][_0x8afa('0x29')]);_0x15b5f8[_0x8afa('0x2e')]=_[_0x8afa('0x46')](_0x358f36[_0x8afa('0x2e')]);_0x15b5f8[_0x8afa('0x38')]=_['intersection'](_0x15b5f8[_0x8afa('0x2d')],_0x15b5f8[_0x8afa('0x2e')]);_0x4cea03['attributes']=_[_0x8afa('0x2f')](_0x15b5f8[_0x8afa('0x2d')],qs['fields'](_0x358f36['query']['fields']));_0x4cea03[_0x8afa('0x30')]=_0x4cea03['attributes'][_0x8afa('0x32')]?_0x4cea03[_0x8afa('0x30')]:_0x15b5f8['model'];_0x4cea03[_0x8afa('0x35')]=qs[_0x8afa('0x36')](_0x358f36[_0x8afa('0x2e')][_0x8afa('0x36')]);_0x4cea03[_0x8afa('0x37')]=qs[_0x8afa('0x38')](_[_0x8afa('0x39')](_0x358f36[_0x8afa('0x2e')],_0x15b5f8[_0x8afa('0x38')]));if(_0x358f36[_0x8afa('0x2e')][_0x8afa('0x3a')]){_0x4cea03[_0x8afa('0x37')]=_[_0x8afa('0x3b')](_0x4cea03[_0x8afa('0x37')],{'$or':_[_0x8afa('0x27')](_0x4cea03[_0x8afa('0x30')],function(_0x3773dd){var _0x250320={};_0x250320[_0x3773dd]={'$like':'%'+_0x358f36['query']['filter']+'%'};return _0x250320;})});}_0x4cea03=_['merge']({},_0x4cea03,_0x358f36['options']);return _0x1506f0[_0x8afa('0x60')](_0x4cea03);}})['then'](function(_0x4d0196){if(_0x4d0196){_0x7bf00=_0x4d0196[_0x8afa('0x32')];if(!_0x358f36[_0x8afa('0x2e')][_0x8afa('0x33')]('nolimit')){_0x4cea03[_0x8afa('0x1a')]=qs[_0x8afa('0x1a')](_0x358f36[_0x8afa('0x2e')]['limit']);_0x4cea03[_0x8afa('0x19')]=qs[_0x8afa('0x19')](_0x358f36[_0x8afa('0x2e')][_0x8afa('0x19')]);}return _0x1506f0[_0x8afa('0x60')](_0x4cea03);}})[_0x8afa('0x22')](function(_0x5dff8f){if(_0x5dff8f){return _0x5dff8f?{'count':_0x7bf00,'rows':_0x5dff8f}:null;}})[_0x8afa('0x22')](respondWithResult(_0x2727be,null))[_0x8afa('0x43')](handleError(_0x2727be,null));};exports[_0x8afa('0x61')]=function(_0x19c557,_0x1aa7c2,_0x5622c7){var _0x105fbe=_0x19c557[_0x8afa('0x49')][_0x8afa('0x62')];return db[_0x8afa('0x63')]['findAll']({'where':{'id':_0x105fbe},'attributes':['id'],'include':[{'model':db[_0x8afa('0x59')],'as':_0x8afa('0x64'),'attributes':['id','name','online',_0x8afa('0x65'),_0x8afa('0x66')],'raw':!![]}]})[_0x8afa('0x22')](function(_0x491e18){if(_0x491e18){var _0x2697ea=_[_0x8afa('0x67')](_0x491e18,function(_0x22828a){var _0x33279f=_0x22828a[_0x8afa('0x4b')]({'plain':!![]});return _0x33279f['Agents'];});return db[_0x8afa('0x28')][_0x8afa('0x47')]({'where':{'id':_0x19c557[_0x8afa('0x45')]['id']}})[_0x8afa('0x22')](function(_0x178c5a){return db[_0x8afa('0x68')][_0x8afa('0x69')](function(_0x26bf9e){return _0x178c5a[_0x8afa('0x61')](_0x105fbe,{'transaction':_0x26bf9e})['then'](function(){return BPromise['each'](_0x2697ea,function(_0x28c616){return db['UserSmsQueue'][_0x8afa('0x6a')]({'where':{'UserId':_0x28c616['id'],'SmsQueueId':_0x19c557[_0x8afa('0x45')]['id']},'transaction':_0x26bf9e});});})[_0x8afa('0x22')](function(){_0x2697ea['forEach'](function(_0x3205ef){socket[_0x8afa('0x6b')](_0x8afa('0x6c'),{'UserId':_0x3205ef['id'],'SmsQueueId':_0x178c5a['id']});});});});});}})[_0x8afa('0x22')](respondWithStatusCode(_0x1aa7c2,null))['catch'](handleError(_0x1aa7c2,null));};exports[_0x8afa('0x6d')]=function(_0x1ff47d,_0x5d7fa9,_0x18d890){return db[_0x8afa('0x63')]['findAll']({'where':{'id':_0x1ff47d[_0x8afa('0x2e')][_0x8afa('0x62')]},'attributes':['id'],'include':[{'model':db[_0x8afa('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5d7fa9,null))[_0x8afa('0x22')](function(_0x2f9efb){var _0x4acffd=_[_0x8afa('0x27')](_0x2f9efb,'id');var _0x4e5d12=[];var _0x489124=[];var _0xdc31b=squel[_0x8afa('0x6e')]();_0xdc31b[_0x8afa('0x6f')](_0x8afa('0x70'))[_0x8afa('0x71')](_0x8afa('0x72'),'tq')[_0x8afa('0x73')](_0x8afa('0x74'),'ut',_0x8afa('0x75'))['where']('SmsQueueId\x20=\x20?',_0x1ff47d[_0x8afa('0x45')]['id']);for(var _0x329b00=0x0;_0x329b00<_0x2f9efb['length'];_0x329b00+=0x1){let _0x5f3076=_0x2f9efb[_0x329b00];for(var _0x29776e=0x0;_0x29776e<_0x5f3076['Agents'][_0x8afa('0x32')];_0x29776e+=0x1){let _0x3d92a5=_0x5f3076[_0x8afa('0x64')][_0x29776e];var _0x521d48=_0xdc31b['clone']();_0x521d48[_0x8afa('0x37')](_0x8afa('0x76'),_0x3d92a5['id']);_0x489124['push'](db[_0x8afa('0x68')][_0x8afa('0x2e')](_0x521d48['toString'](),{'type':db[_0x8afa('0x68')][_0x8afa('0x77')]['SELECT']})['then'](function(_0x3835b7){if(_0x3835b7[_0x8afa('0x32')]===0x1){return _0x3d92a5['id'];}else{var _0x345b7e=_['every'](_[_0x8afa('0x27')](_0x3835b7,_0x8afa('0x78')),function(_0x2da53b){return _[_0x8afa('0x79')](_0x4acffd,_0x2da53b);});if(_0x345b7e){return _0x3d92a5['id'];}}}));}}return BPromise[_0x8afa('0x7a')](_0x489124)[_0x8afa('0x22')](function(_0x581177){_0x4e5d12=_(_0x4e5d12)[_0x8afa('0x7b')](_0x581177)[_0x8afa('0x7c')]()[_0x8afa('0x7d')]();return db[_0x8afa('0x28')][_0x8afa('0x47')]({'where':{'id':_0x1ff47d[_0x8afa('0x45')]['id']}})['then'](function(_0x4166ac){return db[_0x8afa('0x68')][_0x8afa('0x69')](function(_0x361bdb){return _0x4166ac['removeTeams'](_0x1ff47d[_0x8afa('0x2e')][_0x8afa('0x62')],{'transaction':_0x361bdb})[_0x8afa('0x22')](function(){if(!_[_0x8afa('0x7e')](_0x4e5d12)){return _0x4166ac[_0x8afa('0x7f')](_0x4e5d12,{'transaction':_0x361bdb});}})['then'](function(){_0x4e5d12[_0x8afa('0x80')](function(_0x47e61a){socket[_0x8afa('0x6b')](_0x8afa('0x81'),{'UserId':_0x47e61a,'SmsQueueId':_0x4166ac['id']});});});});});});})[_0x8afa('0x22')](respondWithStatusCode(_0x5d7fa9,null))[_0x8afa('0x43')](handleError(_0x5d7fa9,null));};exports['addAgents']=function(_0x5d07cb,_0x119ead,_0x4bfb3b){return db[_0x8afa('0x28')][_0x8afa('0x47')]({'where':{'id':_0x5d07cb[_0x8afa('0x45')]['id']}})[_0x8afa('0x22')](handleEntityNotFound(_0x119ead,null))['then'](function(_0x42f6f6){if(_0x42f6f6){return _0x42f6f6[_0x8afa('0x82')](_0x5d07cb['body']['ids'],_['omit'](_0x5d07cb[_0x8afa('0x49')],[_0x8afa('0x62'),'id'])||{})[_0x8afa('0x83')](function(_0x5b3991){for(var _0x3a66f3=0x0;_0x3a66f3<_0x5d07cb[_0x8afa('0x49')][_0x8afa('0x62')][_0x8afa('0x32')];_0x3a66f3+=0x1){socket[_0x8afa('0x6b')]('userSmsQueue:save',{'UserId':_0x5d07cb['body']['ids'][_0x3a66f3],'SmsQueueId':_0x5d07cb[_0x8afa('0x45')]['id']});}return _0x5b3991;});}})['then'](respondWithResult(_0x119ead,null))['catch'](handleError(_0x119ead,null));};exports[_0x8afa('0x7f')]=function(_0x1e0b14,_0x56fc4f,_0x19331c){return db[_0x8afa('0x28')]['find']({'where':{'id':_0x1e0b14[_0x8afa('0x45')]['id']}})[_0x8afa('0x22')](handleEntityNotFound(_0x56fc4f,null))[_0x8afa('0x22')](function(_0x33f363){if(_0x33f363){return _0x33f363['removeAgents'](_0x1e0b14[_0x8afa('0x2e')][_0x8afa('0x62')])[_0x8afa('0x22')](function(){if(_[_0x8afa('0x84')](_0x1e0b14['query'][_0x8afa('0x62')])){for(var _0x2a20c5=0x0;_0x2a20c5<_0x1e0b14[_0x8afa('0x2e')][_0x8afa('0x62')][_0x8afa('0x32')];_0x2a20c5+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x1e0b14[_0x8afa('0x2e')][_0x8afa('0x62')][_0x2a20c5]),'SmsQueueId':Number(_0x1e0b14[_0x8afa('0x45')]['id'])});}}else{socket[_0x8afa('0x6b')](_0x8afa('0x81'),{'UserId':Number(_0x1e0b14[_0x8afa('0x2e')]['ids']),'SmsQueueId':Number(_0x1e0b14['params']['id'])});}});}})[_0x8afa('0x22')](respondWithStatusCode(_0x56fc4f,null))[_0x8afa('0x43')](handleError(_0x56fc4f,null));};exports[_0x8afa('0x85')]=function(_0x4ac54c,_0x111d7e,_0xf66eb0){var _0x59616f={};var _0x552449={};var _0x43e396;var _0x5d5db4;return db['SmsQueue'][_0x8afa('0x56')]({'where':{'id':_0x4ac54c[_0x8afa('0x45')]['id']}})[_0x8afa('0x22')](handleEntityNotFound(_0x111d7e,null))[_0x8afa('0x22')](function(_0xbdbdaf){if(_0xbdbdaf){_0x43e396=_0xbdbdaf;_0x552449[_0x8afa('0x2d')]=_[_0x8afa('0x46')](db[_0x8afa('0x59')]['rawAttributes']);_0x552449['query']=_[_0x8afa('0x46')](_0x4ac54c[_0x8afa('0x2e')]);_0x552449[_0x8afa('0x38')]=_['intersection'](_0x552449[_0x8afa('0x2d')],_0x552449[_0x8afa('0x2e')]);_0x59616f[_0x8afa('0x30')]=_[_0x8afa('0x2f')](_0x552449[_0x8afa('0x2d')],qs[_0x8afa('0x31')](_0x4ac54c[_0x8afa('0x2e')][_0x8afa('0x31')]));_0x59616f[_0x8afa('0x30')]=_0x59616f[_0x8afa('0x30')][_0x8afa('0x32')]?_0x59616f[_0x8afa('0x30')]:_0x552449[_0x8afa('0x2d')];_0x59616f[_0x8afa('0x35')]=qs[_0x8afa('0x36')](_0x4ac54c['query'][_0x8afa('0x36')]);_0x59616f[_0x8afa('0x37')]=qs[_0x8afa('0x38')](_[_0x8afa('0x39')](_0x4ac54c[_0x8afa('0x2e')],_0x552449[_0x8afa('0x38')]));if(_0x4ac54c[_0x8afa('0x2e')]['filter']){_0x59616f[_0x8afa('0x37')]=_[_0x8afa('0x3b')](_0x59616f[_0x8afa('0x37')],{'$or':_[_0x8afa('0x27')](_0x59616f[_0x8afa('0x30')],function(_0x4a04bb){var _0x5b9f66={};_0x5b9f66[_0x4a04bb]={'$like':'%'+_0x4ac54c[_0x8afa('0x2e')]['filter']+'%'};return _0x5b9f66;})});}_0x59616f=_['merge']({},_0x59616f,_0x4ac54c[_0x8afa('0x3d')]);return _0x43e396[_0x8afa('0x85')](_0x59616f);}})[_0x8afa('0x22')](function(_0x43a0e5){if(_0x43a0e5){_0x5d5db4=_0x43a0e5[_0x8afa('0x32')];if(!_0x4ac54c[_0x8afa('0x2e')][_0x8afa('0x33')](_0x8afa('0x34'))){_0x59616f[_0x8afa('0x1a')]=qs[_0x8afa('0x1a')](_0x4ac54c[_0x8afa('0x2e')][_0x8afa('0x1a')]);_0x59616f[_0x8afa('0x19')]=qs[_0x8afa('0x19')](_0x4ac54c['query']['offset']);}return _0x43e396[_0x8afa('0x85')](_0x59616f);}})['then'](function(_0x588c64){if(_0x588c64){return _0x588c64?{'count':_0x5d5db4,'rows':_0x588c64}:null;}})['then'](respondWithResult(_0x111d7e,null))['catch'](handleError(_0x111d7e,null));}; \ No newline at end of file +var _0x0b15=['filters','pick','merge','VIRTUAL','options','SmsQueue','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','userProfileId','autoAssociation','update','getMembers','findOne','UserSmsQueue','filter','User','smsPause','updatedAt','getTeams','addTeams','ids','Team','Agents','voicePause','interface','sequelize','each','findOrCreate','forEach','emit','userSmsQueue:save','select','field','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','TeamId','includes','all','compact','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./smsQueue.socket','register','sendStatus','status','end','json','count','offset','Content-Range','then','destroy','get','UserProfileResource','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x0b15,0x1c0));var _0x50b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b15[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x50b1('0x0'));var rimraf=require(_0x50b1('0x1'));var zipdir=require(_0x50b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x50b1('0x3'));var moment=require(_0x50b1('0x4'));var BPromise=require(_0x50b1('0x5'));var Mustache=require(_0x50b1('0x6'));var util=require(_0x50b1('0x7'));var path=require(_0x50b1('0x8'));var sox=require(_0x50b1('0x9'));var csv=require(_0x50b1('0xa'));var ejs=require(_0x50b1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50b1('0xc'));var squel=require(_0x50b1('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x50b1('0xe'));var toCsv=require(_0x50b1('0xa'));var querystring=require(_0x50b1('0xf'));var Papa=require(_0x50b1('0x10'));var Redis=require(_0x50b1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x50b1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x50b1('0x13'));var logger=require(_0x50b1('0x14'))(_0x50b1('0x15'));var utils=require(_0x50b1('0x16'));var config=require(_0x50b1('0x17'));var licenseUtil=require(_0x50b1('0x18'));var db=require(_0x50b1('0x19'))['db'];config['redis']=_['defaults'](config[_0x50b1('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50b1('0x1a')]));require(_0x50b1('0x1b'))[_0x50b1('0x1c')](socket);function respondWithStatusCode(_0x4abdb3,_0x25a86a){_0x25a86a=_0x25a86a||0xcc;return function(_0x4e3bed){if(_0x4e3bed){return _0x4abdb3[_0x50b1('0x1d')](_0x25a86a);}return _0x4abdb3[_0x50b1('0x1e')](_0x25a86a)[_0x50b1('0x1f')]();};}function respondWithResult(_0x5ed00e,_0xf2ab6d){_0xf2ab6d=_0xf2ab6d||0xc8;return function(_0x181288){if(_0x181288){return _0x5ed00e['status'](_0xf2ab6d)[_0x50b1('0x20')](_0x181288);}};}function respondWithFilteredResult(_0x48d72e,_0x516476){return function(_0x23ac51){if(_0x23ac51){var _0x5a10c1=_0x23ac51[_0x50b1('0x21')],_0x2459ae=_0x516476[_0x50b1('0x22')],_0x5cfcf9=_0x516476[_0x50b1('0x22')]+_0x516476['limit'],_0x19627d;if(_0x5cfcf9>=_0x5a10c1){_0x5cfcf9=_0x5a10c1;_0x19627d=0xc8;}else{_0x19627d=0xce;}_0x48d72e[_0x50b1('0x1e')](_0x19627d);return _0x48d72e['set'](_0x50b1('0x23'),_0x2459ae+'-'+_0x5cfcf9+'/'+_0x5a10c1)[_0x50b1('0x20')](_0x23ac51);}return null;};}function patchUpdates(_0x5e8f17){return function(_0x3b296c){try{jsonpatch['apply'](_0x3b296c,_0x5e8f17,!![]);}catch(_0x1f8007){return BPromise['reject'](_0x1f8007);}return _0x3b296c['save']();};}function saveUpdates(_0x3eb6fb,_0x2b2a50){return function(_0xb66387){if(_0xb66387){return _0xb66387['update'](_0x3eb6fb)[_0x50b1('0x24')](function(_0x1fe86d){return _0x1fe86d;});}return null;};}function removeEntity(_0x591a9b,_0x426fb9){return function(_0x27a87b){if(_0x27a87b){return _0x27a87b[_0x50b1('0x25')]()[_0x50b1('0x24')](function(){var _0x29490a=_0x27a87b[_0x50b1('0x26')]({'plain':!![]});var _0x373ba6='SmsQueues';return db[_0x50b1('0x27')][_0x50b1('0x25')]({'where':{'type':_0x373ba6,'resourceId':_0x29490a['id']}})[_0x50b1('0x24')](function(){return _0x27a87b;});})[_0x50b1('0x24')](function(){_0x591a9b['status'](0xcc)[_0x50b1('0x1f')]();});}};}function handleEntityNotFound(_0x2db5a1,_0x44bd71){return function(_0x185ffb){if(!_0x185ffb){_0x2db5a1[_0x50b1('0x1d')](0x194);}return _0x185ffb;};}function handleError(_0x3b450b,_0xc77fd3){_0xc77fd3=_0xc77fd3||0x1f4;return function(_0x4d4a42){logger['error'](_0x4d4a42['stack']);if(_0x4d4a42[_0x50b1('0x28')]){delete _0x4d4a42[_0x50b1('0x28')];}_0x3b450b[_0x50b1('0x1e')](_0xc77fd3)[_0x50b1('0x29')](_0x4d4a42);};}exports['index']=function(_0x2e4259,_0x939d72){var _0x4e8d81={},_0x288a4e={},_0x3daab9={'count':0x0,'rows':[]};var _0x48144c=_[_0x50b1('0x2a')](db['SmsQueue'][_0x50b1('0x2b')],function(_0x5c42c3){return{'name':_0x5c42c3[_0x50b1('0x2c')],'type':_0x5c42c3[_0x50b1('0x2d')][_0x50b1('0x2e')]};});_0x288a4e[_0x50b1('0x2f')]=_['map'](_0x48144c,_0x50b1('0x28'));_0x288a4e[_0x50b1('0x30')]=_[_0x50b1('0x31')](_0x2e4259['query']);_0x288a4e['filters']=_[_0x50b1('0x32')](_0x288a4e['model'],_0x288a4e[_0x50b1('0x30')]);_0x4e8d81[_0x50b1('0x33')]=_[_0x50b1('0x32')](_0x288a4e[_0x50b1('0x2f')],qs[_0x50b1('0x34')](_0x2e4259[_0x50b1('0x30')][_0x50b1('0x34')]));_0x4e8d81[_0x50b1('0x33')]=_0x4e8d81['attributes'][_0x50b1('0x35')]?_0x4e8d81[_0x50b1('0x33')]:_0x288a4e[_0x50b1('0x2f')];if(!_0x2e4259['query'][_0x50b1('0x36')](_0x50b1('0x37'))){_0x4e8d81[_0x50b1('0x38')]=qs[_0x50b1('0x38')](_0x2e4259['query'][_0x50b1('0x38')]);_0x4e8d81['offset']=qs[_0x50b1('0x22')](_0x2e4259[_0x50b1('0x30')][_0x50b1('0x22')]);}_0x4e8d81[_0x50b1('0x39')]=qs[_0x50b1('0x3a')](_0x2e4259[_0x50b1('0x30')][_0x50b1('0x3a')]);_0x4e8d81[_0x50b1('0x3b')]=qs[_0x50b1('0x3c')](_[_0x50b1('0x3d')](_0x2e4259[_0x50b1('0x30')],_0x288a4e[_0x50b1('0x3c')]),_0x48144c);if(_0x2e4259[_0x50b1('0x30')]['filter']){_0x4e8d81[_0x50b1('0x3b')]=_[_0x50b1('0x3e')](_0x4e8d81['where'],{'$or':_[_0x50b1('0x2a')](_0x48144c,function(_0x5c8f43){if(_0x5c8f43[_0x50b1('0x2d')]!==_0x50b1('0x3f')){var _0x372e79={};_0x372e79[_0x5c8f43[_0x50b1('0x28')]]={'$like':'%'+_0x2e4259[_0x50b1('0x30')]['filter']+'%'};return _0x372e79;}})});}_0x4e8d81=_['merge']({},_0x4e8d81,_0x2e4259[_0x50b1('0x40')]);var _0x5d1e22={'where':_0x4e8d81['where']};return db[_0x50b1('0x41')][_0x50b1('0x21')](_0x5d1e22)[_0x50b1('0x24')](function(_0x5f31de){_0x3daab9[_0x50b1('0x21')]=_0x5f31de;if(_0x2e4259['query'][_0x50b1('0x42')]){_0x4e8d81[_0x50b1('0x43')]=[{'all':!![]}];}return db[_0x50b1('0x41')][_0x50b1('0x44')](_0x4e8d81);})[_0x50b1('0x24')](function(_0x125ee5){_0x3daab9[_0x50b1('0x45')]=_0x125ee5;return _0x3daab9;})[_0x50b1('0x24')](respondWithFilteredResult(_0x939d72,_0x4e8d81))[_0x50b1('0x46')](handleError(_0x939d72,null));};exports[_0x50b1('0x47')]=function(_0x51e4e8,_0x36a528){var _0x34fa72={'raw':!![],'where':{'id':_0x51e4e8[_0x50b1('0x48')]['id']}},_0x53aa9a={};_0x53aa9a[_0x50b1('0x2f')]=_[_0x50b1('0x31')](db[_0x50b1('0x41')][_0x50b1('0x2b')]);_0x53aa9a[_0x50b1('0x30')]=_['keys'](_0x51e4e8[_0x50b1('0x30')]);_0x53aa9a[_0x50b1('0x3c')]=_[_0x50b1('0x32')](_0x53aa9a[_0x50b1('0x2f')],_0x53aa9a[_0x50b1('0x30')]);_0x34fa72[_0x50b1('0x33')]=_[_0x50b1('0x32')](_0x53aa9a[_0x50b1('0x2f')],qs[_0x50b1('0x34')](_0x51e4e8['query'][_0x50b1('0x34')]));_0x34fa72['attributes']=_0x34fa72[_0x50b1('0x33')][_0x50b1('0x35')]?_0x34fa72[_0x50b1('0x33')]:_0x53aa9a[_0x50b1('0x2f')];if(_0x51e4e8[_0x50b1('0x30')]['includeAll']){_0x34fa72['include']=[{'all':!![]}];}_0x34fa72=_[_0x50b1('0x3e')]({},_0x34fa72,_0x51e4e8[_0x50b1('0x40')]);return db[_0x50b1('0x41')][_0x50b1('0x49')](_0x34fa72)[_0x50b1('0x24')](handleEntityNotFound(_0x36a528,null))[_0x50b1('0x24')](respondWithResult(_0x36a528,null))[_0x50b1('0x46')](handleError(_0x36a528,null));};exports[_0x50b1('0x4a')]=function(_0x2e2aff,_0x3f1707){return db[_0x50b1('0x41')][_0x50b1('0x4a')](_0x2e2aff[_0x50b1('0x4b')],{})[_0x50b1('0x24')](function(_0x549679){var _0x4364fb=_0x2e2aff[_0x50b1('0x4c')][_0x50b1('0x26')]({'plain':!![]});if(!_0x4364fb)throw new Error(_0x50b1('0x4d'));if(_0x4364fb[_0x50b1('0x4e')]===_0x50b1('0x4c')){var _0x1458e1=_0x549679[_0x50b1('0x26')]({'plain':!![]});var _0x168255=_0x50b1('0x4f');return db[_0x50b1('0x50')]['find']({'where':{'name':_0x168255,'userProfileId':_0x4364fb[_0x50b1('0x51')]},'raw':!![]})[_0x50b1('0x24')](function(_0x5b81d6){if(_0x5b81d6&&_0x5b81d6[_0x50b1('0x52')]===0x0){return db[_0x50b1('0x27')][_0x50b1('0x4a')]({'name':_0x1458e1[_0x50b1('0x28')],'resourceId':_0x1458e1['id'],'type':_0x5b81d6[_0x50b1('0x28')],'sectionId':_0x5b81d6['id']},{})['then'](function(){return _0x549679;});}else{return _0x549679;}})[_0x50b1('0x46')](function(_0x44829e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44829e);throw _0x44829e;});}return _0x549679;})[_0x50b1('0x24')](respondWithResult(_0x3f1707,0xc9))[_0x50b1('0x46')](handleError(_0x3f1707,null));};exports[_0x50b1('0x53')]=function(_0x5011ea,_0x1de279){if(_0x5011ea[_0x50b1('0x4b')]['id']){delete _0x5011ea[_0x50b1('0x4b')]['id'];}return db[_0x50b1('0x41')][_0x50b1('0x49')]({'where':{'id':_0x5011ea[_0x50b1('0x48')]['id']}})['then'](handleEntityNotFound(_0x1de279,null))['then'](saveUpdates(_0x5011ea['body'],null))[_0x50b1('0x24')](respondWithResult(_0x1de279,null))['catch'](handleError(_0x1de279,null));};exports[_0x50b1('0x25')]=function(_0x861684,_0x2cf21c){return db[_0x50b1('0x41')]['find']({'where':{'id':_0x861684['params']['id']}})[_0x50b1('0x24')](handleEntityNotFound(_0x2cf21c,null))[_0x50b1('0x24')](removeEntity(_0x2cf21c,null))['catch'](handleError(_0x2cf21c,null));};exports['describe']=function(_0x1d2dfe,_0x57f45e){return db[_0x50b1('0x41')]['describe']()['then'](respondWithResult(_0x57f45e,null))[_0x50b1('0x46')](handleError(_0x57f45e,null));};exports[_0x50b1('0x54')]=function(_0x3fa6af,_0x2f0fa3,_0x149f6e){var _0x187807={'raw':!![],'where':{}},_0x4594bf={},_0x4fb2f3;return db['SmsQueue'][_0x50b1('0x55')]({'where':{'id':_0x3fa6af[_0x50b1('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f0fa3,null))[_0x50b1('0x24')](function(_0x50af89){if(_0x50af89){_0x4fb2f3=_0x50af89[_0x50b1('0x26')]({'plain':!![]});_0x4594bf['model']=_[_0x50b1('0x31')](db[_0x50b1('0x56')][_0x50b1('0x2b')]);_0x4594bf[_0x50b1('0x30')]=_[_0x50b1('0x31')](_0x3fa6af[_0x50b1('0x30')]);_0x4594bf[_0x50b1('0x3c')]=_[_0x50b1('0x32')](_0x4594bf[_0x50b1('0x2f')],_0x4594bf[_0x50b1('0x30')]);_0x187807[_0x50b1('0x33')]=_[_0x50b1('0x32')](_0x4594bf[_0x50b1('0x2f')],qs[_0x50b1('0x34')](_0x3fa6af[_0x50b1('0x30')]['fields']));_0x187807[_0x50b1('0x33')]=_0x187807[_0x50b1('0x33')][_0x50b1('0x35')]?_0x187807['attributes']:_0x4594bf['model'];if(!_0x3fa6af[_0x50b1('0x30')][_0x50b1('0x36')](_0x50b1('0x37'))){_0x187807[_0x50b1('0x38')]=qs[_0x50b1('0x38')](_0x3fa6af[_0x50b1('0x30')]['limit']);_0x187807[_0x50b1('0x22')]=qs['offset'](_0x3fa6af[_0x50b1('0x30')][_0x50b1('0x22')]);}_0x187807[_0x50b1('0x39')]=qs['sort'](_0x3fa6af[_0x50b1('0x30')]['sort']);_0x187807['where']=qs[_0x50b1('0x3c')](_[_0x50b1('0x3d')](_0x3fa6af['query'],_0x4594bf[_0x50b1('0x3c')]));_0x187807[_0x50b1('0x3b')]['SmsQueueId']=_0x50af89['id'];if(_0x3fa6af[_0x50b1('0x30')][_0x50b1('0x57')]){_0x187807[_0x50b1('0x3b')]=_[_0x50b1('0x3e')](_0x187807['where'],{'$or':_[_0x50b1('0x2a')](_0x187807[_0x50b1('0x33')],function(_0x38b0ff){var _0x4e28ad={};_0x4e28ad[_0x38b0ff]={'$like':'%'+_0x3fa6af[_0x50b1('0x30')][_0x50b1('0x57')]+'%'};return _0x4e28ad;})});}_0x187807=_['merge']({},_0x187807,_0x3fa6af[_0x50b1('0x40')]);return db[_0x50b1('0x56')]['findAll'](_0x187807);}})[_0x50b1('0x24')](function(_0x2eb0a4){if(_0x2eb0a4){return db[_0x50b1('0x58')]['findAndCountAll']({'where':{'id':_[_0x50b1('0x2a')](_0x2eb0a4,'UserId'),'role':'agent'},'attributes':['id',_0x50b1('0x28'),_0x50b1('0x59'),'updatedAt','createdAt']});}})[_0x50b1('0x24')](function(_0x2c53d6){if(_0x2c53d6){return{'count':_0x2c53d6[_0x50b1('0x21')],'rows':_[_0x50b1('0x2a')](_0x2c53d6[_0x50b1('0x45')],function(_0x23e082){return{'membername':_0x23e082[_0x50b1('0x28')],'UserId':_0x23e082['id'],'queue_name':_0x4fb2f3[_0x50b1('0x28')],'SmsQueueId':_0x4fb2f3['id'],'interface':util['format']('%s/%s','SIP',_0x23e082[_0x50b1('0x28')]),'penalty':0x0,'paused':_0x23e082[_0x50b1('0x59')],'createdAt':_0x23e082['createdAt'],'updatedAt':_0x23e082[_0x50b1('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x50b1('0x24')](respondWithFilteredResult(_0x2f0fa3,_0x187807))[_0x50b1('0x46')](handleError(_0x2f0fa3,null));};exports[_0x50b1('0x5b')]=function(_0x3afeae,_0x13269f,_0x11a2a0){var _0x3c988f={};var _0x315f4d={};var _0x5508a0;var _0x45be29;return db[_0x50b1('0x41')][_0x50b1('0x55')]({'where':{'id':_0x3afeae[_0x50b1('0x48')]['id']}})[_0x50b1('0x24')](handleEntityNotFound(_0x13269f,null))[_0x50b1('0x24')](function(_0x9963eb){if(_0x9963eb){_0x5508a0=_0x9963eb;_0x315f4d['model']=_[_0x50b1('0x31')](db['Team'][_0x50b1('0x2b')]);_0x315f4d[_0x50b1('0x30')]=_['keys'](_0x3afeae[_0x50b1('0x30')]);_0x315f4d[_0x50b1('0x3c')]=_[_0x50b1('0x32')](_0x315f4d[_0x50b1('0x2f')],_0x315f4d[_0x50b1('0x30')]);_0x3c988f[_0x50b1('0x33')]=_[_0x50b1('0x32')](_0x315f4d[_0x50b1('0x2f')],qs[_0x50b1('0x34')](_0x3afeae['query'][_0x50b1('0x34')]));_0x3c988f[_0x50b1('0x33')]=_0x3c988f[_0x50b1('0x33')]['length']?_0x3c988f[_0x50b1('0x33')]:_0x315f4d['model'];_0x3c988f[_0x50b1('0x39')]=qs['sort'](_0x3afeae['query']['sort']);_0x3c988f[_0x50b1('0x3b')]=qs['filters'](_[_0x50b1('0x3d')](_0x3afeae['query'],_0x315f4d[_0x50b1('0x3c')]));if(_0x3afeae[_0x50b1('0x30')][_0x50b1('0x57')]){_0x3c988f[_0x50b1('0x3b')]=_['merge'](_0x3c988f[_0x50b1('0x3b')],{'$or':_['map'](_0x3c988f['attributes'],function(_0xd8703b){var _0x43fb30={};_0x43fb30[_0xd8703b]={'$like':'%'+_0x3afeae[_0x50b1('0x30')][_0x50b1('0x57')]+'%'};return _0x43fb30;})});}_0x3c988f=_[_0x50b1('0x3e')]({},_0x3c988f,_0x3afeae[_0x50b1('0x40')]);return _0x5508a0[_0x50b1('0x5b')](_0x3c988f);}})[_0x50b1('0x24')](function(_0x4e4945){if(_0x4e4945){_0x45be29=_0x4e4945[_0x50b1('0x35')];if(!_0x3afeae['query'][_0x50b1('0x36')](_0x50b1('0x37'))){_0x3c988f[_0x50b1('0x38')]=qs[_0x50b1('0x38')](_0x3afeae[_0x50b1('0x30')][_0x50b1('0x38')]);_0x3c988f[_0x50b1('0x22')]=qs['offset'](_0x3afeae[_0x50b1('0x30')][_0x50b1('0x22')]);}return _0x5508a0[_0x50b1('0x5b')](_0x3c988f);}})['then'](function(_0x343c67){if(_0x343c67){return _0x343c67?{'count':_0x45be29,'rows':_0x343c67}:null;}})[_0x50b1('0x24')](respondWithResult(_0x13269f,null))[_0x50b1('0x46')](handleError(_0x13269f,null));};exports[_0x50b1('0x5c')]=function(_0x564881,_0x3cd377,_0x60dffe){var _0x1046a6=_0x564881[_0x50b1('0x4b')][_0x50b1('0x5d')];return db[_0x50b1('0x5e')][_0x50b1('0x44')]({'where':{'id':_0x1046a6},'attributes':['id'],'include':[{'model':db[_0x50b1('0x58')],'as':_0x50b1('0x5f'),'attributes':['id',_0x50b1('0x28'),'online',_0x50b1('0x60'),_0x50b1('0x61')],'raw':!![]}]})['then'](function(_0x4a5190){if(_0x4a5190){var _0x1f64a3=_['flatMap'](_0x4a5190,function(_0x31049d){var _0x3ca631=_0x31049d[_0x50b1('0x26')]({'plain':!![]});return _0x3ca631[_0x50b1('0x5f')];});return db[_0x50b1('0x41')][_0x50b1('0x49')]({'where':{'id':_0x564881[_0x50b1('0x48')]['id']}})['then'](function(_0xa6a290){return db[_0x50b1('0x62')]['transaction'](function(_0x40fb2a){return _0xa6a290[_0x50b1('0x5c')](_0x1046a6,{'transaction':_0x40fb2a})['then'](function(){return BPromise[_0x50b1('0x63')](_0x1f64a3,function(_0x1fe08e){return db[_0x50b1('0x56')][_0x50b1('0x64')]({'where':{'UserId':_0x1fe08e['id'],'SmsQueueId':_0x564881[_0x50b1('0x48')]['id']},'transaction':_0x40fb2a});});})[_0x50b1('0x24')](function(){_0x1f64a3[_0x50b1('0x65')](function(_0x177f8b){socket[_0x50b1('0x66')](_0x50b1('0x67'),{'UserId':_0x177f8b['id'],'SmsQueueId':_0xa6a290['id']});});});});});}})[_0x50b1('0x24')](respondWithStatusCode(_0x3cd377,null))[_0x50b1('0x46')](handleError(_0x3cd377,null));};exports['removeTeams']=function(_0x1f915a,_0x28a003,_0x5bd48a){return db[_0x50b1('0x5e')][_0x50b1('0x44')]({'where':{'id':_0x1f915a['query'][_0x50b1('0x5d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x50b1('0x5f'),'attributes':['id'],'raw':!![]}]})[_0x50b1('0x24')](handleEntityNotFound(_0x28a003,null))[_0x50b1('0x24')](function(_0x516c31){var _0x5ac7d7=_[_0x50b1('0x2a')](_0x516c31,'id');var _0x2b6df2=[];var _0x3e0dba=[];var _0xecd804=squel[_0x50b1('0x68')]();_0xecd804[_0x50b1('0x69')]('tq.TeamId')[_0x50b1('0x6a')](_0x50b1('0x6b'),'tq')[_0x50b1('0x6c')]('user_has_teams','ut',_0x50b1('0x6d'))['where'](_0x50b1('0x6e'),_0x1f915a[_0x50b1('0x48')]['id']);for(var _0x205f5b=0x0;_0x205f5b<_0x516c31[_0x50b1('0x35')];_0x205f5b+=0x1){let _0x2d871a=_0x516c31[_0x205f5b];for(var _0x2b345c=0x0;_0x2b345c<_0x2d871a[_0x50b1('0x5f')]['length'];_0x2b345c+=0x1){let _0x1eae43=_0x2d871a['Agents'][_0x2b345c];var _0x52aede=_0xecd804['clone']();_0x52aede['where'](_0x50b1('0x6f'),_0x1eae43['id']);_0x3e0dba[_0x50b1('0x70')](db['sequelize'][_0x50b1('0x30')](_0x52aede['toString'](),{'type':db[_0x50b1('0x62')]['QueryTypes'][_0x50b1('0x71')]})[_0x50b1('0x24')](function(_0x39b894){if(_0x39b894[_0x50b1('0x35')]===0x1){return _0x1eae43['id'];}else{var _0x1eeb6d=_['every'](_[_0x50b1('0x2a')](_0x39b894,_0x50b1('0x72')),function(_0x40459d){return _[_0x50b1('0x73')](_0x5ac7d7,_0x40459d);});if(_0x1eeb6d){return _0x1eae43['id'];}}}));}}return BPromise[_0x50b1('0x74')](_0x3e0dba)[_0x50b1('0x24')](function(_0x31f8c5){_0x2b6df2=_(_0x2b6df2)['union'](_0x31f8c5)[_0x50b1('0x75')]()['value']();return db[_0x50b1('0x41')][_0x50b1('0x49')]({'where':{'id':_0x1f915a[_0x50b1('0x48')]['id']}})[_0x50b1('0x24')](function(_0x15642c){return db[_0x50b1('0x62')][_0x50b1('0x76')](function(_0x5706fb){return _0x15642c['removeTeams'](_0x1f915a[_0x50b1('0x30')][_0x50b1('0x5d')],{'transaction':_0x5706fb})['then'](function(){if(!_[_0x50b1('0x77')](_0x2b6df2)){return _0x15642c[_0x50b1('0x78')](_0x2b6df2,{'transaction':_0x5706fb});}})[_0x50b1('0x24')](function(){_0x2b6df2[_0x50b1('0x65')](function(_0xb89e22){socket[_0x50b1('0x66')](_0x50b1('0x79'),{'UserId':_0xb89e22,'SmsQueueId':_0x15642c['id']});});});});});});})['then'](respondWithStatusCode(_0x28a003,null))[_0x50b1('0x46')](handleError(_0x28a003,null));};exports[_0x50b1('0x7a')]=function(_0x519f49,_0x2304a3,_0x166491){return db[_0x50b1('0x41')][_0x50b1('0x49')]({'where':{'id':_0x519f49[_0x50b1('0x48')]['id']}})[_0x50b1('0x24')](handleEntityNotFound(_0x2304a3,null))[_0x50b1('0x24')](function(_0x5b7b0a){if(_0x5b7b0a){return _0x5b7b0a[_0x50b1('0x7a')](_0x519f49['body'][_0x50b1('0x5d')],_[_0x50b1('0x7b')](_0x519f49['body'],['ids','id'])||{})[_0x50b1('0x7c')](function(_0x1f81cf){for(var _0x4face4=0x0;_0x4face4<_0x519f49[_0x50b1('0x4b')]['ids']['length'];_0x4face4+=0x1){socket[_0x50b1('0x66')]('userSmsQueue:save',{'UserId':_0x519f49['body'][_0x50b1('0x5d')][_0x4face4],'SmsQueueId':_0x519f49['params']['id']});}return _0x1f81cf;});}})[_0x50b1('0x24')](respondWithResult(_0x2304a3,null))[_0x50b1('0x46')](handleError(_0x2304a3,null));};exports['removeAgents']=function(_0x3a72c2,_0x3a8d43,_0x436ffb){return db[_0x50b1('0x41')]['find']({'where':{'id':_0x3a72c2[_0x50b1('0x48')]['id']}})[_0x50b1('0x24')](handleEntityNotFound(_0x3a8d43,null))['then'](function(_0x56a82a){if(_0x56a82a){return _0x56a82a['removeAgents'](_0x3a72c2[_0x50b1('0x30')][_0x50b1('0x5d')])[_0x50b1('0x24')](function(){if(_[_0x50b1('0x7d')](_0x3a72c2['query'][_0x50b1('0x5d')])){for(var _0x11153f=0x0;_0x11153f<_0x3a72c2[_0x50b1('0x30')][_0x50b1('0x5d')][_0x50b1('0x35')];_0x11153f+=0x1){socket[_0x50b1('0x66')](_0x50b1('0x79'),{'UserId':Number(_0x3a72c2[_0x50b1('0x30')][_0x50b1('0x5d')][_0x11153f]),'SmsQueueId':Number(_0x3a72c2[_0x50b1('0x48')]['id'])});}}else{socket[_0x50b1('0x66')](_0x50b1('0x79'),{'UserId':Number(_0x3a72c2[_0x50b1('0x30')]['ids']),'SmsQueueId':Number(_0x3a72c2[_0x50b1('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x3a8d43,null))[_0x50b1('0x46')](handleError(_0x3a8d43,null));};exports[_0x50b1('0x7e')]=function(_0x8ba6f7,_0x44f4cd,_0x4c03f1){var _0x56dace={};var _0x30b83e={};var _0x568753;var _0x481df2;return db['SmsQueue']['findOne']({'where':{'id':_0x8ba6f7[_0x50b1('0x48')]['id']}})[_0x50b1('0x24')](handleEntityNotFound(_0x44f4cd,null))[_0x50b1('0x24')](function(_0x550301){if(_0x550301){_0x568753=_0x550301;_0x30b83e[_0x50b1('0x2f')]=_[_0x50b1('0x31')](db[_0x50b1('0x58')][_0x50b1('0x2b')]);_0x30b83e[_0x50b1('0x30')]=_[_0x50b1('0x31')](_0x8ba6f7[_0x50b1('0x30')]);_0x30b83e[_0x50b1('0x3c')]=_[_0x50b1('0x32')](_0x30b83e['model'],_0x30b83e['query']);_0x56dace[_0x50b1('0x33')]=_['intersection'](_0x30b83e[_0x50b1('0x2f')],qs[_0x50b1('0x34')](_0x8ba6f7[_0x50b1('0x30')][_0x50b1('0x34')]));_0x56dace[_0x50b1('0x33')]=_0x56dace[_0x50b1('0x33')][_0x50b1('0x35')]?_0x56dace[_0x50b1('0x33')]:_0x30b83e[_0x50b1('0x2f')];_0x56dace['order']=qs[_0x50b1('0x3a')](_0x8ba6f7[_0x50b1('0x30')][_0x50b1('0x3a')]);_0x56dace[_0x50b1('0x3b')]=qs['filters'](_[_0x50b1('0x3d')](_0x8ba6f7['query'],_0x30b83e[_0x50b1('0x3c')]));if(_0x8ba6f7[_0x50b1('0x30')][_0x50b1('0x57')]){_0x56dace['where']=_[_0x50b1('0x3e')](_0x56dace['where'],{'$or':_[_0x50b1('0x2a')](_0x56dace[_0x50b1('0x33')],function(_0x55839d){var _0x5ef94c={};_0x5ef94c[_0x55839d]={'$like':'%'+_0x8ba6f7['query'][_0x50b1('0x57')]+'%'};return _0x5ef94c;})});}_0x56dace=_[_0x50b1('0x3e')]({},_0x56dace,_0x8ba6f7[_0x50b1('0x40')]);return _0x568753[_0x50b1('0x7e')](_0x56dace);}})[_0x50b1('0x24')](function(_0x2a006b){if(_0x2a006b){_0x481df2=_0x2a006b[_0x50b1('0x35')];if(!_0x8ba6f7[_0x50b1('0x30')][_0x50b1('0x36')](_0x50b1('0x37'))){_0x56dace[_0x50b1('0x38')]=qs[_0x50b1('0x38')](_0x8ba6f7[_0x50b1('0x30')]['limit']);_0x56dace[_0x50b1('0x22')]=qs[_0x50b1('0x22')](_0x8ba6f7[_0x50b1('0x30')]['offset']);}return _0x568753[_0x50b1('0x7e')](_0x56dace);}})['then'](function(_0x273c68){if(_0x273c68){return _0x273c68?{'count':_0x481df2,'rows':_0x273c68}:null;}})[_0x50b1('0x24')](respondWithResult(_0x44f4cd,null))['catch'](handleError(_0x44f4cd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 19fe30a..054f992 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 _0x12e6=['save','emit','exports','../../mysqldb','setMaxListeners'];(function(_0x2f3305,_0x57082f){var _0x4e2d5c=function(_0x385206){while(--_0x385206){_0x2f3305['push'](_0x2f3305['shift']());}};_0x4e2d5c(++_0x57082f);}(_0x12e6,0x184));var _0x612e=function(_0x2550ac,_0x1fdc75){_0x2550ac=_0x2550ac-0x0;var _0x267b28=_0x12e6[_0x2550ac];return _0x267b28;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x612e('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x612e('0x1')](0x0);var events={'afterCreate':_0x612e('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x19cfa3){return function(_0x20ef1e,_0x4abeee,_0x190d04){SmsQueueEvents[_0x612e('0x3')](_0x19cfa3+':'+_0x20ef1e['id'],_0x20ef1e);SmsQueueEvents[_0x612e('0x3')](_0x19cfa3,_0x20ef1e);_0x190d04(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x612e('0x4')]=SmsQueueEvents; \ No newline at end of file +var _0x319c=['hasOwnProperty','hook','events','../../mysqldb','SmsQueue','save','update','remove','emit'];(function(_0x6ec9cd,_0x278cc0){var _0x55fc63=function(_0x21c6c0){while(--_0x21c6c0){_0x6ec9cd['push'](_0x6ec9cd['shift']());}};_0x55fc63(++_0x278cc0);}(_0x319c,0x173));var _0xc319=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x319c[_0x243b59];return _0x3e1676;};'use strict';var EventEmitter=require(_0xc319('0x0'));var SmsQueue=require(_0xc319('0x1'))['db'][_0xc319('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc319('0x3'),'afterUpdate':_0xc319('0x4'),'afterDestroy':_0xc319('0x5')};function emitEvent(_0x3f3b39){return function(_0x16467a,_0x4ab5cc,_0x2aca41){SmsQueueEvents[_0xc319('0x6')](_0x3f3b39+':'+_0x16467a['id'],_0x16467a);SmsQueueEvents[_0xc319('0x6')](_0x3f3b39,_0x16467a);_0x2aca41(null);};}for(var e in events){if(events[_0xc319('0x7')](e)){var event=events[e];SmsQueue[_0xc319('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 8c91188..a96263c 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 _0x150a=['define','SmsQueue','sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./smsQueue.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x150a,0x1a7));var _0xa150=function(_0x345b24,_0x5e9229){_0x345b24=_0x345b24-0x0;var _0x3c76e3=_0x150a[_0x345b24];return _0x3c76e3;};'use strict';var _=require(_0xa150('0x0'));var util=require(_0xa150('0x1'));var logger=require(_0xa150('0x2'))('api');var moment=require(_0xa150('0x3'));var BPromise=require(_0xa150('0x4'));var rp=require(_0xa150('0x5'));var fs=require('fs');var path=require(_0xa150('0x6'));var rimraf=require('rimraf');var config=require(_0xa150('0x7'));var attributes=require(_0xa150('0x8'));module['exports']=function(_0x59c49c,_0x245742){return _0x59c49c[_0xa150('0x9')](_0xa150('0xa'),attributes,{'tableName':_0xa150('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x280b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash','util'];(function(_0x255011,_0x29530f){var _0x216879=function(_0x5ea3cb){while(--_0x5ea3cb){_0x255011['push'](_0x255011['shift']());}};_0x216879(++_0x29530f);}(_0x280b,0xce));var _0xb280=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x280b[_0x432682];return _0x463d05;};'use strict';var _=require(_0xb280('0x0'));var util=require(_0xb280('0x1'));var logger=require('../../config/logger')(_0xb280('0x2'));var moment=require(_0xb280('0x3'));var BPromise=require(_0xb280('0x4'));var rp=require(_0xb280('0x5'));var fs=require('fs');var path=require(_0xb280('0x6'));var rimraf=require(_0xb280('0x7'));var config=require(_0xb280('0x8'));var attributes=require(_0xb280('0x9'));module[_0xb280('0xa')]=function(_0x5d1991,_0x4d1b2e){return _0x5d1991[_0xb280('0xb')](_0xb280('0xc'),attributes,{'tableName':'sms_queues','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 915505e..360d518 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 _0x73bd=['map','model','catch','find','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include'];(function(_0x4fabbe,_0xc514f3){var _0x5510dd=function(_0x1e7d23){while(--_0x1e7d23){_0x4fabbe['push'](_0x4fabbe['shift']());}};_0x5510dd(++_0xc514f3);}(_0x73bd,0x181));var _0xd73b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x73bd[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xd73b('0x0'));var util=require(_0xd73b('0x1'));var moment=require(_0xd73b('0x2'));var BPromise=require(_0xd73b('0x3'));var rs=require(_0xd73b('0x4'));var fs=require('fs');var Redis=require(_0xd73b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd73b('0x6'))(_0xd73b('0x7'));var config=require(_0xd73b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd73b('0x9')][_0xd73b('0xa')]({'port':0x232a});config[_0xd73b('0xb')]=_[_0xd73b('0xc')](config[_0xd73b('0xb')],{'host':_0xd73b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd73b('0xb')]));require('./smsQueue.socket')[_0xd73b('0xe')](socket);function respondWithRpcPromise(_0x25f290,_0x141925,_0x453eb7){return new BPromise(function(_0x1d3743,_0x3ed151){return client['request'](_0x25f290,_0x453eb7)[_0xd73b('0xf')](function(_0x547bc2){logger[_0xd73b('0x10')](_0xd73b('0x11'),_0x141925,_0xd73b('0x12'));logger[_0xd73b('0x13')](_0xd73b('0x14'),_0x141925,_0xd73b('0x12'),JSON[_0xd73b('0x15')](_0x547bc2));if(_0x547bc2[_0xd73b('0x16')]){if(_0x547bc2[_0xd73b('0x16')]['code']===0x1f4){logger[_0xd73b('0x16')](_0xd73b('0x11'),_0x141925,_0x547bc2[_0xd73b('0x16')][_0xd73b('0x17')]);return _0x3ed151(_0x547bc2[_0xd73b('0x16')][_0xd73b('0x17')]);}logger[_0xd73b('0x16')]('SmsQueue,\x20%s,\x20%s',_0x141925,_0x547bc2['error'][_0xd73b('0x17')]);return _0x1d3743(_0x547bc2['error'][_0xd73b('0x17')]);}else{logger[_0xd73b('0x10')](_0xd73b('0x11'),_0x141925,_0xd73b('0x12'));_0x1d3743(_0x547bc2[_0xd73b('0x18')][_0xd73b('0x17')]);}})['catch'](function(_0x23268e){logger[_0xd73b('0x16')](_0xd73b('0x11'),_0x141925,_0x23268e);_0x3ed151(_0x23268e);});});}exports[_0xd73b('0x19')]=function(_0x455333){var _0x2be2e4=this;return new Promise(function(_0x354c52,_0x334955){return db[_0xd73b('0x1a')]['findAll']({'raw':_0x455333['options']?_0x455333[_0xd73b('0x1b')][_0xd73b('0x1c')]===undefined?!![]:![]:!![],'where':_0x455333[_0xd73b('0x1b')]?_0x455333[_0xd73b('0x1b')][_0xd73b('0x1d')]||null:null,'attributes':_0x455333[_0xd73b('0x1b')]?_0x455333[_0xd73b('0x1b')][_0xd73b('0x1e')]||null:null,'limit':_0x455333[_0xd73b('0x1b')]?_0x455333['options'][_0xd73b('0x1f')]||null:null,'include':_0x455333[_0xd73b('0x1b')]?_0x455333[_0xd73b('0x1b')][_0xd73b('0x20')]?_[_0xd73b('0x21')](_0x455333['options']['include'],function(_0x3f0fcc){return{'model':db[_0x3f0fcc[_0xd73b('0x22')]],'as':_0x3f0fcc['as'],'attributes':_0x3f0fcc[_0xd73b('0x1e')],'include':_0x3f0fcc[_0xd73b('0x20')]?_[_0xd73b('0x21')](_0x3f0fcc[_0xd73b('0x20')],function(_0xede853){return{'model':db[_0xede853[_0xd73b('0x22')]],'as':_0xede853['as'],'attributes':_0xede853[_0xd73b('0x1e')],'include':_0xede853[_0xd73b('0x20')]?_['map'](_0xede853[_0xd73b('0x20')],function(_0x3ddc13){return{'model':db[_0x3ddc13[_0xd73b('0x22')]],'as':_0x3ddc13['as'],'attributes':_0x3ddc13[_0xd73b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd73b('0xf')](function(_0x384da4){logger[_0xd73b('0x10')](_0xd73b('0x19'),_0x455333);logger['debug'](_0xd73b('0x19'),_0x455333,JSON[_0xd73b('0x15')](_0x384da4));_0x354c52(_0x384da4);})[_0xd73b('0x23')](function(_0x101321){logger['error']('GetSmsQueue',_0x101321[_0xd73b('0x17')],_0x455333);_0x334955(_0x2be2e4[_0xd73b('0x16')](0x1f4,_0x101321[_0xd73b('0x17')]));});});};exports['ShowSmsQueue']=function(_0x53c180){var _0x5efbef=this;return new Promise(function(_0x47e67f,_0xd340e6){return db[_0xd73b('0x1a')][_0xd73b('0x24')]({'raw':_0x53c180['options']?_0x53c180['options'][_0xd73b('0x1c')]===undefined?!![]:![]:!![],'where':_0x53c180[_0xd73b('0x1b')]?_0x53c180[_0xd73b('0x1b')][_0xd73b('0x1d')]||null:null,'attributes':_0x53c180[_0xd73b('0x1b')]?_0x53c180[_0xd73b('0x1b')][_0xd73b('0x1e')]||null:null,'include':_0x53c180[_0xd73b('0x1b')]?_0x53c180[_0xd73b('0x1b')][_0xd73b('0x20')]?_['map'](_0x53c180[_0xd73b('0x1b')][_0xd73b('0x20')],function(_0x3be61f){return{'model':db[_0x3be61f[_0xd73b('0x22')]],'as':_0x3be61f['as'],'attributes':_0x3be61f[_0xd73b('0x1e')],'include':_0x3be61f[_0xd73b('0x20')]?_[_0xd73b('0x21')](_0x3be61f[_0xd73b('0x20')],function(_0x503690){return{'model':db[_0x503690[_0xd73b('0x22')]],'as':_0x503690['as'],'attributes':_0x503690['attributes'],'include':_0x503690[_0xd73b('0x20')]?_['map'](_0x503690['include'],function(_0x4af7cb){return{'model':db[_0x4af7cb['model']],'as':_0x4af7cb['as'],'attributes':_0x4af7cb['attributes']};}):[]};}):[]};}):[]:[]})[_0xd73b('0xf')](function(_0x35b360){logger[_0xd73b('0x10')]('ShowSmsQueue',_0x53c180);logger['debug'](_0xd73b('0x25'),_0x53c180,JSON[_0xd73b('0x15')](_0x35b360));_0x47e67f(_0x35b360);})['catch'](function(_0xff2230){logger[_0xd73b('0x16')]('ShowSmsQueue',_0xff2230['message'],_0x53c180);_0xd340e6(_0x5efbef[_0xd73b('0x16')](0x1f4,_0xff2230[_0xd73b('0x17')]));});});}; \ No newline at end of file +var _0x1baa=['limit','include','map','model','then','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x1baa,0x81));var _0xa1ba=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1baa[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xa1ba('0x0'));var util=require(_0xa1ba('0x1'));var moment=require(_0xa1ba('0x2'));var BPromise=require(_0xa1ba('0x3'));var rs=require(_0xa1ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1ba('0x5'))['db'];var utils=require(_0xa1ba('0x6'));var logger=require(_0xa1ba('0x7'))(_0xa1ba('0x8'));var config=require(_0xa1ba('0x9'));var jayson=require(_0xa1ba('0xa'));var client=jayson[_0xa1ba('0xb')][_0xa1ba('0xc')]({'port':0x232a});config['redis']=_[_0xa1ba('0xd')](config[_0xa1ba('0xe')],{'host':_0xa1ba('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1ba('0xe')]));require(_0xa1ba('0x10'))[_0xa1ba('0x11')](socket);function respondWithRpcPromise(_0x52f8a2,_0x4d8bd8,_0x249c5f){return new BPromise(function(_0x3805be,_0x410fb0){return client[_0xa1ba('0x12')](_0x52f8a2,_0x249c5f)['then'](function(_0x50ffd7){logger[_0xa1ba('0x13')](_0xa1ba('0x14'),_0x4d8bd8,'request\x20sent');logger[_0xa1ba('0x15')](_0xa1ba('0x16'),_0x4d8bd8,_0xa1ba('0x17'),JSON[_0xa1ba('0x18')](_0x50ffd7));if(_0x50ffd7[_0xa1ba('0x19')]){if(_0x50ffd7[_0xa1ba('0x19')]['code']===0x1f4){logger[_0xa1ba('0x19')](_0xa1ba('0x14'),_0x4d8bd8,_0x50ffd7[_0xa1ba('0x19')][_0xa1ba('0x1a')]);return _0x410fb0(_0x50ffd7['error'][_0xa1ba('0x1a')]);}logger[_0xa1ba('0x19')]('SmsQueue,\x20%s,\x20%s',_0x4d8bd8,_0x50ffd7['error'][_0xa1ba('0x1a')]);return _0x3805be(_0x50ffd7['error']['message']);}else{logger['info'](_0xa1ba('0x14'),_0x4d8bd8,'request\x20sent');_0x3805be(_0x50ffd7['result']['message']);}})[_0xa1ba('0x1b')](function(_0x4f6b46){logger[_0xa1ba('0x19')](_0xa1ba('0x14'),_0x4d8bd8,_0x4f6b46);_0x410fb0(_0x4f6b46);});});}exports[_0xa1ba('0x1c')]=function(_0x4cc236){var _0x6d5775=this;return new Promise(function(_0x255f2c,_0x4aae78){return db[_0xa1ba('0x1d')][_0xa1ba('0x1e')]({'raw':_0x4cc236['options']?_0x4cc236[_0xa1ba('0x1f')][_0xa1ba('0x20')]===undefined?!![]:![]:!![],'where':_0x4cc236[_0xa1ba('0x1f')]?_0x4cc236['options'][_0xa1ba('0x21')]||null:null,'attributes':_0x4cc236['options']?_0x4cc236[_0xa1ba('0x1f')][_0xa1ba('0x22')]||null:null,'limit':_0x4cc236[_0xa1ba('0x1f')]?_0x4cc236['options'][_0xa1ba('0x23')]||null:null,'include':_0x4cc236['options']?_0x4cc236[_0xa1ba('0x1f')][_0xa1ba('0x24')]?_[_0xa1ba('0x25')](_0x4cc236[_0xa1ba('0x1f')][_0xa1ba('0x24')],function(_0xe31b3b){return{'model':db[_0xe31b3b[_0xa1ba('0x26')]],'as':_0xe31b3b['as'],'attributes':_0xe31b3b[_0xa1ba('0x22')],'include':_0xe31b3b[_0xa1ba('0x24')]?_[_0xa1ba('0x25')](_0xe31b3b['include'],function(_0x44470b){return{'model':db[_0x44470b[_0xa1ba('0x26')]],'as':_0x44470b['as'],'attributes':_0x44470b[_0xa1ba('0x22')],'include':_0x44470b[_0xa1ba('0x24')]?_[_0xa1ba('0x25')](_0x44470b['include'],function(_0x462c96){return{'model':db[_0x462c96[_0xa1ba('0x26')]],'as':_0x462c96['as'],'attributes':_0x462c96[_0xa1ba('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa1ba('0x27')](function(_0x15e1f5){logger[_0xa1ba('0x13')](_0xa1ba('0x1c'),_0x4cc236);logger[_0xa1ba('0x15')]('GetSmsQueue',_0x4cc236,JSON['stringify'](_0x15e1f5));_0x255f2c(_0x15e1f5);})[_0xa1ba('0x1b')](function(_0x47343c){logger[_0xa1ba('0x19')]('GetSmsQueue',_0x47343c[_0xa1ba('0x1a')],_0x4cc236);_0x4aae78(_0x6d5775[_0xa1ba('0x19')](0x1f4,_0x47343c[_0xa1ba('0x1a')]));});});};exports[_0xa1ba('0x28')]=function(_0x7c7740){var _0x2e4900=this;return new Promise(function(_0x5f5afd,_0x304779){return db['SmsQueue']['find']({'raw':_0x7c7740[_0xa1ba('0x1f')]?_0x7c7740[_0xa1ba('0x1f')][_0xa1ba('0x20')]===undefined?!![]:![]:!![],'where':_0x7c7740[_0xa1ba('0x1f')]?_0x7c7740['options'][_0xa1ba('0x21')]||null:null,'attributes':_0x7c7740[_0xa1ba('0x1f')]?_0x7c7740[_0xa1ba('0x1f')]['attributes']||null:null,'include':_0x7c7740['options']?_0x7c7740['options'][_0xa1ba('0x24')]?_[_0xa1ba('0x25')](_0x7c7740['options'][_0xa1ba('0x24')],function(_0x10abf2){return{'model':db[_0x10abf2[_0xa1ba('0x26')]],'as':_0x10abf2['as'],'attributes':_0x10abf2[_0xa1ba('0x22')],'include':_0x10abf2[_0xa1ba('0x24')]?_['map'](_0x10abf2[_0xa1ba('0x24')],function(_0x307ff0){return{'model':db[_0x307ff0[_0xa1ba('0x26')]],'as':_0x307ff0['as'],'attributes':_0x307ff0['attributes'],'include':_0x307ff0['include']?_[_0xa1ba('0x25')](_0x307ff0['include'],function(_0x5cd03f){return{'model':db[_0x5cd03f[_0xa1ba('0x26')]],'as':_0x5cd03f['as'],'attributes':_0x5cd03f[_0xa1ba('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8af7d7){logger[_0xa1ba('0x13')](_0xa1ba('0x28'),_0x7c7740);logger[_0xa1ba('0x15')](_0xa1ba('0x28'),_0x7c7740,JSON[_0xa1ba('0x18')](_0x8af7d7));_0x5f5afd(_0x8af7d7);})[_0xa1ba('0x1b')](function(_0x3ab3c9){logger[_0xa1ba('0x19')](_0xa1ba('0x28'),_0x3ab3c9[_0xa1ba('0x1a')],_0x7c7740);_0x304779(_0x2e4900[_0xa1ba('0x19')](0x1f4,_0x3ab3c9[_0xa1ba('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 42fb694..d2b7a88 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 _0xf884=['save','remove','emit','register','length','./smsQueue.events'];(function(_0x152953,_0x46ff51){var _0x3dbc2c=function(_0x3e1d59){while(--_0x3e1d59){_0x152953['push'](_0x152953['shift']());}};_0x3dbc2c(++_0x46ff51);}(_0xf884,0x1bb));var _0x4f88=function(_0x1ba28a,_0x4f212d){_0x1ba28a=_0x1ba28a-0x0;var _0x469d31=_0xf884[_0x1ba28a];return _0x469d31;};'use strict';var SmsQueueEvents=require(_0x4f88('0x0'));var events=[_0x4f88('0x1'),_0x4f88('0x2'),'update'];function createListener(_0x4d6791,_0x49edcc){return function(_0x48e716){_0x49edcc[_0x4f88('0x3')](_0x4d6791,_0x48e716);};}function removeListener(_0x13dcd1,_0x34c513){return function(){SmsQueueEvents['removeListener'](_0x13dcd1,_0x34c513);};}exports[_0x4f88('0x4')]=function(_0x20fe14){for(var _0x17acb1=0x0,_0x31f6db=events[_0x4f88('0x5')];_0x17acb1<_0x31f6db;_0x17acb1++){var _0x58c8c8=events[_0x17acb1];var _0x33e0f3=createListener('smsQueue:'+_0x58c8c8,_0x20fe14);SmsQueueEvents['on'](_0x58c8c8,_0x33e0f3);}}; \ No newline at end of file +var _0xade2=['remove','emit','removeListener','register','smsQueue:'];(function(_0x655011,_0x511d14){var _0x528446=function(_0x39a6c9){while(--_0x39a6c9){_0x655011['push'](_0x655011['shift']());}};_0x528446(++_0x511d14);}(_0xade2,0x82));var _0x2ade=function(_0x5e3d40,_0x389949){_0x5e3d40=_0x5e3d40-0x0;var _0x46e1a5=_0xade2[_0x5e3d40];return _0x46e1a5;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x2ade('0x0'),'update'];function createListener(_0x119ec4,_0x8afabb){return function(_0x3a7bac){_0x8afabb[_0x2ade('0x1')](_0x119ec4,_0x3a7bac);};}function removeListener(_0x55af6f,_0x3af14d){return function(){SmsQueueEvents[_0x2ade('0x2')](_0x55af6f,_0x3af14d);};}exports[_0x2ade('0x3')]=function(_0x1b8b82){for(var _0x1769cc=0x0,_0x47453e=events['length'];_0x1769cc<_0x47453e;_0x1769cc++){var _0x449885=events[_0x1769cc];var _0x56a7b4=createListener(_0x2ade('0x4')+_0x449885,_0x1b8b82);SmsQueueEvents['on'](_0x449885,_0x56a7b4);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 529bfc6..30858fa 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 _0x8dad=['isAuthenticated','/describe','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get'];(function(_0x5df61d,_0x158640){var _0x24cc4c=function(_0x2de006){while(--_0x2de006){_0x5df61d['push'](_0x5df61d['shift']());}};_0x24cc4c(++_0x158640);}(_0x8dad,0x1bd));var _0xd8da=function(_0x19f4d5,_0x26f329){_0x19f4d5=_0x19f4d5-0x0;var _0x4397d9=_0x8dad[_0x19f4d5];return _0x4397d9;};'use strict';var multer=require(_0xd8da('0x0'));var util=require(_0xd8da('0x1'));var path=require(_0xd8da('0x2'));var timeout=require(_0xd8da('0x3'));var express=require(_0xd8da('0x4'));var router=express['Router']();var fs_extra=require(_0xd8da('0x5'));var auth=require(_0xd8da('0x6'));var interaction=require(_0xd8da('0x7'));var config=require(_0xd8da('0x8'));var controller=require(_0xd8da('0x9'));router[_0xd8da('0xa')]('/',auth[_0xd8da('0xb')](),controller['index']);router['get'](_0xd8da('0xc'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xd8da('0xb')](),controller['show']);router[_0xd8da('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd8da('0xe')](_0xd8da('0xf'),auth[_0xd8da('0xb')](),controller[_0xd8da('0x10')]);router[_0xd8da('0x11')](_0xd8da('0xf'),auth[_0xd8da('0xb')](),controller['destroy']);module[_0xd8da('0x12')]=router; \ No newline at end of file +var _0x428f=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer'];(function(_0x1e857e,_0x6d9b92){var _0x420d67=function(_0x327ea7){while(--_0x327ea7){_0x1e857e['push'](_0x1e857e['shift']());}};_0x420d67(++_0x6d9b92);}(_0x428f,0x143));var _0xf428=function(_0x537294,_0x55698b){_0x537294=_0x537294-0x0;var _0x3272f1=_0x428f[_0x537294];return _0x3272f1;};'use strict';var multer=require(_0xf428('0x0'));var util=require(_0xf428('0x1'));var path=require('path');var timeout=require(_0xf428('0x2'));var express=require('express');var router=express[_0xf428('0x3')]();var fs_extra=require(_0xf428('0x4'));var auth=require(_0xf428('0x5'));var interaction=require(_0xf428('0x6'));var config=require(_0xf428('0x7'));var controller=require('./smsQueueReport.controller');router[_0xf428('0x8')]('/',auth[_0xf428('0x9')](),controller[_0xf428('0xa')]);router[_0xf428('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf428('0x8')](_0xf428('0xb'),auth[_0xf428('0x9')](),controller[_0xf428('0xc')]);router[_0xf428('0xd')]('/',auth['isAuthenticated'](),controller[_0xf428('0xe')]);router[_0xf428('0xf')]('/:id',auth[_0xf428('0x9')](),controller[_0xf428('0x10')]);router['delete'](_0xf428('0xb'),auth[_0xf428('0x9')](),controller['destroy']);module[_0xf428('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 7da0628..6ea1ac3 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 _0x915d=['exports','STRING','DATE','moment','sequelize'];(function(_0x47c8b9,_0xd2065f){var _0xc99ac9=function(_0x225c26){while(--_0x225c26){_0x47c8b9['push'](_0x47c8b9['shift']());}};_0xc99ac9(++_0xd2065f);}(_0x915d,0x8a));var _0xd915=function(_0x17268c,_0x3e2890){_0x17268c=_0x17268c-0x0;var _0x2f9c50=_0x915d[_0x17268c];return _0x2f9c50;};'use strict';var moment=require(_0xd915('0x0'));var Sequelize=require(_0xd915('0x1'));module[_0xd915('0x2')]={'uniqueid':{'type':Sequelize[_0xd915('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd915('0x3')]},'joinAt':{'type':Sequelize[_0xd915('0x4')]},'leaveAt':{'type':Sequelize[_0xd915('0x4')]},'acceptAt':{'type':Sequelize[_0xd915('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd915('0x3')]}}; \ No newline at end of file +var _0xcb47=['exports','STRING','DATE'];(function(_0x317f7c,_0x152a63){var _0x1b8a97=function(_0xed6018){while(--_0xed6018){_0x317f7c['push'](_0x317f7c['shift']());}};_0x1b8a97(++_0x152a63);}(_0xcb47,0x156));var _0x7cb4=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0xcb47[_0x3ef45e];return _0x69e7c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x7cb4('0x0')]={'uniqueid':{'type':Sequelize[_0x7cb4('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7cb4('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7cb4('0x2')]},'exitAt':{'type':Sequelize[_0x7cb4('0x2')]},'reason':{'type':Sequelize[_0x7cb4('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 168ff0b..6c11552 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 _0xc420=['options','SmsQueueReport','count','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','set','apply','reject','update','destroy','then','end','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x4e75a2,_0x1de215){var _0x28a8ab=function(_0xe3e853){while(--_0xe3e853){_0x4e75a2['push'](_0x4e75a2['shift']());}};_0x28a8ab(++_0x1de215);}(_0xc420,0x186));var _0x0c42=function(_0x44592c,_0x201171){_0x44592c=_0x44592c-0x0;var _0x37721a=_0xc420[_0x44592c];return _0x37721a;};'use strict';var emlformat=require(_0x0c42('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c42('0x1'));var jsonpatch=require(_0x0c42('0x2'));var rp=require(_0x0c42('0x3'));var moment=require('moment');var BPromise=require(_0x0c42('0x4'));var Mustache=require(_0x0c42('0x5'));var util=require(_0x0c42('0x6'));var path=require(_0x0c42('0x7'));var sox=require(_0x0c42('0x8'));var csv=require(_0x0c42('0x9'));var ejs=require(_0x0c42('0xa'));var fs=require('fs');var fs_extra=require(_0x0c42('0xb'));var _=require(_0x0c42('0xc'));var squel=require(_0x0c42('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0c42('0xe'));var toCsv=require(_0x0c42('0x9'));var querystring=require(_0x0c42('0xf'));var Papa=require(_0x0c42('0x10'));var Redis=require(_0x0c42('0x11'));var authService=require(_0x0c42('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0c42('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c42('0x14'))(_0x0c42('0x15'));var utils=require(_0x0c42('0x16'));var config=require(_0x0c42('0x17'));var licenseUtil=require(_0x0c42('0x18'));var db=require(_0x0c42('0x19'))['db'];function respondWithStatusCode(_0x27c5b3,_0xaf0fdd){_0xaf0fdd=_0xaf0fdd||0xcc;return function(_0x2863b7){if(_0x2863b7){return _0x27c5b3['sendStatus'](_0xaf0fdd);}return _0x27c5b3['status'](_0xaf0fdd)['end']();};}function respondWithResult(_0x18cf4b,_0x3c871d){_0x3c871d=_0x3c871d||0xc8;return function(_0x16fb1e){if(_0x16fb1e){return _0x18cf4b[_0x0c42('0x1a')](_0x3c871d)[_0x0c42('0x1b')](_0x16fb1e);}};}function respondWithFilteredResult(_0x391d57,_0x36fae1){return function(_0x3c3fd8){if(_0x3c3fd8){var _0x160c76=_0x3c3fd8['count'],_0x4e5726=_0x36fae1[_0x0c42('0x1c')],_0x3b3814=_0x36fae1[_0x0c42('0x1c')]+_0x36fae1['limit'],_0x4e4080;if(_0x3b3814>=_0x160c76){_0x3b3814=_0x160c76;_0x4e4080=0xc8;}else{_0x4e4080=0xce;}_0x391d57[_0x0c42('0x1a')](_0x4e4080);return _0x391d57[_0x0c42('0x1d')]('Content-Range',_0x4e5726+'-'+_0x3b3814+'/'+_0x160c76)[_0x0c42('0x1b')](_0x3c3fd8);}return null;};}function patchUpdates(_0x293e57){return function(_0x27f0e2){try{jsonpatch[_0x0c42('0x1e')](_0x27f0e2,_0x293e57,!![]);}catch(_0x4ef07b){return BPromise[_0x0c42('0x1f')](_0x4ef07b);}return _0x27f0e2['save']();};}function saveUpdates(_0x5a85e9,_0x2b8e8e){return function(_0x4e7393){if(_0x4e7393){return _0x4e7393[_0x0c42('0x20')](_0x5a85e9)['then'](function(_0x4ea721){return _0x4ea721;});}return null;};}function removeEntity(_0xe1215e,_0x2b10a1){return function(_0x46411c){if(_0x46411c){return _0x46411c[_0x0c42('0x21')]()[_0x0c42('0x22')](function(){_0xe1215e[_0x0c42('0x1a')](0xcc)[_0x0c42('0x23')]();});}};}function handleEntityNotFound(_0x117ce8,_0x1f917b){return function(_0x5722c2){if(!_0x5722c2){_0x117ce8[_0x0c42('0x24')](0x194);}return _0x5722c2;};}function handleError(_0x429e93,_0xd7a7fd){_0xd7a7fd=_0xd7a7fd||0x1f4;return function(_0x22b2c1){logger['error'](_0x22b2c1[_0x0c42('0x25')]);if(_0x22b2c1[_0x0c42('0x26')]){delete _0x22b2c1[_0x0c42('0x26')];}_0x429e93['status'](_0xd7a7fd)[_0x0c42('0x27')](_0x22b2c1);};}exports['index']=function(_0xdb5bd4,_0x195c8b){var _0x3de2e4={},_0x4c84e7={},_0x5767ca={'count':0x0,'rows':[]};var _0xa99ed7=_[_0x0c42('0x28')](db['SmsQueueReport'][_0x0c42('0x29')],function(_0x2db559){return{'name':_0x2db559[_0x0c42('0x2a')],'type':_0x2db559[_0x0c42('0x2b')][_0x0c42('0x2c')]};});_0x4c84e7['model']=_[_0x0c42('0x28')](_0xa99ed7,_0x0c42('0x26'));_0x4c84e7[_0x0c42('0x2d')]=_['keys'](_0xdb5bd4[_0x0c42('0x2d')]);_0x4c84e7[_0x0c42('0x2e')]=_[_0x0c42('0x2f')](_0x4c84e7[_0x0c42('0x30')],_0x4c84e7[_0x0c42('0x2d')]);_0x3de2e4[_0x0c42('0x31')]=_[_0x0c42('0x2f')](_0x4c84e7[_0x0c42('0x30')],qs[_0x0c42('0x32')](_0xdb5bd4['query'][_0x0c42('0x32')]));_0x3de2e4[_0x0c42('0x31')]=_0x3de2e4['attributes']['length']?_0x3de2e4[_0x0c42('0x31')]:_0x4c84e7['model'];if(!_0xdb5bd4[_0x0c42('0x2d')][_0x0c42('0x33')](_0x0c42('0x34'))){_0x3de2e4[_0x0c42('0x35')]=qs[_0x0c42('0x35')](_0xdb5bd4[_0x0c42('0x2d')][_0x0c42('0x35')]);_0x3de2e4[_0x0c42('0x1c')]=qs[_0x0c42('0x1c')](_0xdb5bd4[_0x0c42('0x2d')][_0x0c42('0x1c')]);}_0x3de2e4[_0x0c42('0x36')]=qs[_0x0c42('0x37')](_0xdb5bd4['query'][_0x0c42('0x37')]);_0x3de2e4[_0x0c42('0x38')]=qs['filters'](_['pick'](_0xdb5bd4['query'],_0x4c84e7[_0x0c42('0x2e')]),_0xa99ed7);if(_0xdb5bd4['query'][_0x0c42('0x39')]){_0x3de2e4[_0x0c42('0x38')]=_[_0x0c42('0x3a')](_0x3de2e4[_0x0c42('0x38')],{'$or':_['map'](_0xa99ed7,function(_0x2662b3){if(_0x2662b3['type']!==_0x0c42('0x3b')){var _0x5b8934={};_0x5b8934[_0x2662b3['name']]={'$like':'%'+_0xdb5bd4['query']['filter']+'%'};return _0x5b8934;}})});}_0x3de2e4=_[_0x0c42('0x3a')]({},_0x3de2e4,_0xdb5bd4[_0x0c42('0x3c')]);var _0x4b5519={'where':_0x3de2e4[_0x0c42('0x38')]};return db[_0x0c42('0x3d')][_0x0c42('0x3e')](_0x4b5519)[_0x0c42('0x22')](function(_0x137fd2){_0x5767ca[_0x0c42('0x3e')]=_0x137fd2;if(_0xdb5bd4['query'][_0x0c42('0x3f')]){_0x3de2e4[_0x0c42('0x40')]=[{'all':!![]}];}return db[_0x0c42('0x3d')][_0x0c42('0x41')](_0x3de2e4);})[_0x0c42('0x22')](function(_0x3d9614){_0x5767ca[_0x0c42('0x42')]=_0x3d9614;return _0x5767ca;})[_0x0c42('0x22')](respondWithFilteredResult(_0x195c8b,_0x3de2e4))[_0x0c42('0x43')](handleError(_0x195c8b,null));};exports[_0x0c42('0x44')]=function(_0x1ee0c5,_0xb3f06a){var _0x367616={'raw':!![],'where':{'id':_0x1ee0c5['params']['id']}},_0x526342={};_0x526342[_0x0c42('0x30')]=_[_0x0c42('0x45')](db[_0x0c42('0x3d')]['rawAttributes']);_0x526342[_0x0c42('0x2d')]=_[_0x0c42('0x45')](_0x1ee0c5['query']);_0x526342['filters']=_['intersection'](_0x526342[_0x0c42('0x30')],_0x526342['query']);_0x367616[_0x0c42('0x31')]=_['intersection'](_0x526342[_0x0c42('0x30')],qs[_0x0c42('0x32')](_0x1ee0c5[_0x0c42('0x2d')][_0x0c42('0x32')]));_0x367616[_0x0c42('0x31')]=_0x367616[_0x0c42('0x31')]['length']?_0x367616[_0x0c42('0x31')]:_0x526342[_0x0c42('0x30')];if(_0x1ee0c5[_0x0c42('0x2d')]['includeAll']){_0x367616[_0x0c42('0x40')]=[{'all':!![]}];}_0x367616=_[_0x0c42('0x3a')]({},_0x367616,_0x1ee0c5[_0x0c42('0x3c')]);return db[_0x0c42('0x3d')][_0x0c42('0x46')](_0x367616)[_0x0c42('0x22')](handleEntityNotFound(_0xb3f06a,null))[_0x0c42('0x22')](respondWithResult(_0xb3f06a,null))[_0x0c42('0x43')](handleError(_0xb3f06a,null));};exports[_0x0c42('0x47')]=function(_0xc4d652,_0x50c44b){return db[_0x0c42('0x3d')]['create'](_0xc4d652[_0x0c42('0x48')],{})[_0x0c42('0x22')](respondWithResult(_0x50c44b,0xc9))[_0x0c42('0x43')](handleError(_0x50c44b,null));};exports[_0x0c42('0x20')]=function(_0x4e8313,_0x2cea49){if(_0x4e8313[_0x0c42('0x48')]['id']){delete _0x4e8313[_0x0c42('0x48')]['id'];}return db[_0x0c42('0x3d')][_0x0c42('0x46')]({'where':{'id':_0x4e8313[_0x0c42('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cea49,null))[_0x0c42('0x22')](saveUpdates(_0x4e8313[_0x0c42('0x48')],null))[_0x0c42('0x22')](respondWithResult(_0x2cea49,null))[_0x0c42('0x43')](handleError(_0x2cea49,null));};exports[_0x0c42('0x21')]=function(_0x1cbb2e,_0x5213b5){return db[_0x0c42('0x3d')]['find']({'where':{'id':_0x1cbb2e[_0x0c42('0x49')]['id']}})[_0x0c42('0x22')](handleEntityNotFound(_0x5213b5,null))[_0x0c42('0x22')](removeEntity(_0x5213b5,null))['catch'](handleError(_0x5213b5,null));};exports[_0x0c42('0x4a')]=function(_0x3f781a,_0x40eb11){return db['SmsQueueReport'][_0x0c42('0x4a')]()[_0x0c42('0x22')](respondWithResult(_0x40eb11,null))[_0x0c42('0x43')](handleError(_0x40eb11,null));}; \ No newline at end of file +var _0xee0a=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','SmsQueueReport','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xee0a,0x16d));var _0xaee0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee0a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xaee0('0x0'));var rimraf=require(_0xaee0('0x1'));var zipdir=require(_0xaee0('0x2'));var jsonpatch=require(_0xaee0('0x3'));var rp=require(_0xaee0('0x4'));var moment=require(_0xaee0('0x5'));var BPromise=require(_0xaee0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xaee0('0x7'));var csv=require(_0xaee0('0x8'));var ejs=require(_0xaee0('0x9'));var fs=require('fs');var fs_extra=require(_0xaee0('0xa'));var _=require(_0xaee0('0xb'));var squel=require(_0xaee0('0xc'));var crypto=require(_0xaee0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaee0('0xe'));var toCsv=require(_0xaee0('0x8'));var querystring=require(_0xaee0('0xf'));var Papa=require(_0xaee0('0x10'));var Redis=require(_0xaee0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaee0('0x12'));var as=require(_0xaee0('0x13'));var hardwareService=require(_0xaee0('0x14'));var logger=require(_0xaee0('0x15'))(_0xaee0('0x16'));var utils=require('../../config/utils');var config=require(_0xaee0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xaee0('0x18'))['db'];function respondWithStatusCode(_0x973e05,_0x304ec8){_0x304ec8=_0x304ec8||0xcc;return function(_0x22d3c7){if(_0x22d3c7){return _0x973e05[_0xaee0('0x19')](_0x304ec8);}return _0x973e05['status'](_0x304ec8)['end']();};}function respondWithResult(_0x42be65,_0x5a3524){_0x5a3524=_0x5a3524||0xc8;return function(_0x3de99c){if(_0x3de99c){return _0x42be65[_0xaee0('0x1a')](_0x5a3524)[_0xaee0('0x1b')](_0x3de99c);}};}function respondWithFilteredResult(_0x458ce0,_0x4501e0){return function(_0x5635f1){if(_0x5635f1){var _0x58c2d2=_0x5635f1[_0xaee0('0x1c')],_0x1f3fc5=_0x4501e0[_0xaee0('0x1d')],_0x220d2d=_0x4501e0[_0xaee0('0x1d')]+_0x4501e0[_0xaee0('0x1e')],_0x28b249;if(_0x220d2d>=_0x58c2d2){_0x220d2d=_0x58c2d2;_0x28b249=0xc8;}else{_0x28b249=0xce;}_0x458ce0[_0xaee0('0x1a')](_0x28b249);return _0x458ce0[_0xaee0('0x1f')](_0xaee0('0x20'),_0x1f3fc5+'-'+_0x220d2d+'/'+_0x58c2d2)[_0xaee0('0x1b')](_0x5635f1);}return null;};}function patchUpdates(_0x1072f4){return function(_0x53519b){try{jsonpatch[_0xaee0('0x21')](_0x53519b,_0x1072f4,!![]);}catch(_0x49fda4){return BPromise[_0xaee0('0x22')](_0x49fda4);}return _0x53519b[_0xaee0('0x23')]();};}function saveUpdates(_0x14fd72,_0x44ebde){return function(_0x4b2202){if(_0x4b2202){return _0x4b2202[_0xaee0('0x24')](_0x14fd72)[_0xaee0('0x25')](function(_0x440c91){return _0x440c91;});}return null;};}function removeEntity(_0x31356b,_0x3d790d){return function(_0x223994){if(_0x223994){return _0x223994[_0xaee0('0x26')]()[_0xaee0('0x25')](function(){_0x31356b[_0xaee0('0x1a')](0xcc)[_0xaee0('0x27')]();});}};}function handleEntityNotFound(_0x5065e8,_0x4bb170){return function(_0x17039b){if(!_0x17039b){_0x5065e8[_0xaee0('0x19')](0x194);}return _0x17039b;};}function handleError(_0x5c6a0a,_0x242a8c){_0x242a8c=_0x242a8c||0x1f4;return function(_0x4d31d1){logger[_0xaee0('0x28')](_0x4d31d1[_0xaee0('0x29')]);if(_0x4d31d1[_0xaee0('0x2a')]){delete _0x4d31d1[_0xaee0('0x2a')];}_0x5c6a0a['status'](_0x242a8c)['send'](_0x4d31d1);};}exports[_0xaee0('0x2b')]=function(_0x30566c,_0x4cca88){var _0x492d58={},_0x26e826={},_0x2f8f29={'count':0x0,'rows':[]};var _0x436045=_[_0xaee0('0x2c')](db[_0xaee0('0x2d')][_0xaee0('0x2e')],function(_0xa72cc5){return{'name':_0xa72cc5[_0xaee0('0x2f')],'type':_0xa72cc5['type']['key']};});_0x26e826[_0xaee0('0x30')]=_['map'](_0x436045,_0xaee0('0x2a'));_0x26e826['query']=_[_0xaee0('0x31')](_0x30566c[_0xaee0('0x32')]);_0x26e826[_0xaee0('0x33')]=_[_0xaee0('0x34')](_0x26e826[_0xaee0('0x30')],_0x26e826[_0xaee0('0x32')]);_0x492d58[_0xaee0('0x35')]=_[_0xaee0('0x34')](_0x26e826[_0xaee0('0x30')],qs['fields'](_0x30566c[_0xaee0('0x32')][_0xaee0('0x36')]));_0x492d58[_0xaee0('0x35')]=_0x492d58[_0xaee0('0x35')][_0xaee0('0x37')]?_0x492d58[_0xaee0('0x35')]:_0x26e826[_0xaee0('0x30')];if(!_0x30566c[_0xaee0('0x32')][_0xaee0('0x38')](_0xaee0('0x39'))){_0x492d58[_0xaee0('0x1e')]=qs[_0xaee0('0x1e')](_0x30566c['query'][_0xaee0('0x1e')]);_0x492d58[_0xaee0('0x1d')]=qs['offset'](_0x30566c[_0xaee0('0x32')][_0xaee0('0x1d')]);}_0x492d58['order']=qs[_0xaee0('0x3a')](_0x30566c[_0xaee0('0x32')]['sort']);_0x492d58[_0xaee0('0x3b')]=qs['filters'](_[_0xaee0('0x3c')](_0x30566c[_0xaee0('0x32')],_0x26e826[_0xaee0('0x33')]),_0x436045);if(_0x30566c[_0xaee0('0x32')]['filter']){_0x492d58[_0xaee0('0x3b')]=_[_0xaee0('0x3d')](_0x492d58[_0xaee0('0x3b')],{'$or':_[_0xaee0('0x2c')](_0x436045,function(_0x4fcfd5){if(_0x4fcfd5[_0xaee0('0x3e')]!==_0xaee0('0x3f')){var _0x13972e={};_0x13972e[_0x4fcfd5[_0xaee0('0x2a')]]={'$like':'%'+_0x30566c[_0xaee0('0x32')][_0xaee0('0x40')]+'%'};return _0x13972e;}})});}_0x492d58=_['merge']({},_0x492d58,_0x30566c[_0xaee0('0x41')]);var _0x667d70={'where':_0x492d58[_0xaee0('0x3b')]};return db[_0xaee0('0x2d')]['count'](_0x667d70)[_0xaee0('0x25')](function(_0xf118c4){_0x2f8f29[_0xaee0('0x1c')]=_0xf118c4;if(_0x30566c[_0xaee0('0x32')][_0xaee0('0x42')]){_0x492d58[_0xaee0('0x43')]=[{'all':!![]}];}return db[_0xaee0('0x2d')][_0xaee0('0x44')](_0x492d58);})[_0xaee0('0x25')](function(_0x440ace){_0x2f8f29[_0xaee0('0x45')]=_0x440ace;return _0x2f8f29;})[_0xaee0('0x25')](respondWithFilteredResult(_0x4cca88,_0x492d58))[_0xaee0('0x46')](handleError(_0x4cca88,null));};exports[_0xaee0('0x47')]=function(_0x21e4ef,_0x5eb9b9){var _0x168485={'raw':!![],'where':{'id':_0x21e4ef[_0xaee0('0x48')]['id']}},_0x3cfcaf={};_0x3cfcaf[_0xaee0('0x30')]=_[_0xaee0('0x31')](db[_0xaee0('0x2d')][_0xaee0('0x2e')]);_0x3cfcaf[_0xaee0('0x32')]=_[_0xaee0('0x31')](_0x21e4ef[_0xaee0('0x32')]);_0x3cfcaf['filters']=_['intersection'](_0x3cfcaf[_0xaee0('0x30')],_0x3cfcaf['query']);_0x168485['attributes']=_[_0xaee0('0x34')](_0x3cfcaf['model'],qs[_0xaee0('0x36')](_0x21e4ef[_0xaee0('0x32')][_0xaee0('0x36')]));_0x168485['attributes']=_0x168485[_0xaee0('0x35')]['length']?_0x168485[_0xaee0('0x35')]:_0x3cfcaf[_0xaee0('0x30')];if(_0x21e4ef[_0xaee0('0x32')][_0xaee0('0x42')]){_0x168485[_0xaee0('0x43')]=[{'all':!![]}];}_0x168485=_[_0xaee0('0x3d')]({},_0x168485,_0x21e4ef[_0xaee0('0x41')]);return db[_0xaee0('0x2d')][_0xaee0('0x49')](_0x168485)[_0xaee0('0x25')](handleEntityNotFound(_0x5eb9b9,null))[_0xaee0('0x25')](respondWithResult(_0x5eb9b9,null))[_0xaee0('0x46')](handleError(_0x5eb9b9,null));};exports[_0xaee0('0x4a')]=function(_0x36e6d3,_0x15e74b){return db[_0xaee0('0x2d')][_0xaee0('0x4a')](_0x36e6d3[_0xaee0('0x4b')],{})['then'](respondWithResult(_0x15e74b,0xc9))[_0xaee0('0x46')](handleError(_0x15e74b,null));};exports['update']=function(_0x2d6e0b,_0x152b7c){if(_0x2d6e0b['body']['id']){delete _0x2d6e0b['body']['id'];}return db[_0xaee0('0x2d')][_0xaee0('0x49')]({'where':{'id':_0x2d6e0b['params']['id']}})[_0xaee0('0x25')](handleEntityNotFound(_0x152b7c,null))[_0xaee0('0x25')](saveUpdates(_0x2d6e0b[_0xaee0('0x4b')],null))[_0xaee0('0x25')](respondWithResult(_0x152b7c,null))[_0xaee0('0x46')](handleError(_0x152b7c,null));};exports[_0xaee0('0x26')]=function(_0x20237c,_0x4d64b8){return db['SmsQueueReport'][_0xaee0('0x49')]({'where':{'id':_0x20237c[_0xaee0('0x48')]['id']}})[_0xaee0('0x25')](handleEntityNotFound(_0x4d64b8,null))[_0xaee0('0x25')](removeEntity(_0x4d64b8,null))['catch'](handleError(_0x4d64b8,null));};exports[_0xaee0('0x4c')]=function(_0x52d8cf,_0x296643){return db[_0xaee0('0x2d')][_0xaee0('0x4c')]()[_0xaee0('0x25')](respondWithResult(_0x296643,null))[_0xaee0('0x46')](handleError(_0x296643,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 81cbbab..9c46a3b 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 _0x48ea=['lodash','../../config/logger','api','moment','path','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x26b51c,_0xd6ad59){var _0x46f0aa=function(_0x1ba8b9){while(--_0x1ba8b9){_0x26b51c['push'](_0x26b51c['shift']());}};_0x46f0aa(++_0xd6ad59);}(_0x48ea,0x9c));var _0xa48e=function(_0x18afc5,_0x1b130e){_0x18afc5=_0x18afc5-0x0;var _0x1774b7=_0x48ea[_0x18afc5];return _0x1774b7;};'use strict';var _=require(_0xa48e('0x0'));var util=require('util');var logger=require(_0xa48e('0x1'))(_0xa48e('0x2'));var moment=require(_0xa48e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa48e('0x4'));var rimraf=require('rimraf');var config=require(_0xa48e('0x5'));var attributes=require(_0xa48e('0x6'));module[_0xa48e('0x7')]=function(_0x4387b5,_0x2b058d){return _0x4387b5[_0xa48e('0x8')](_0xa48e('0x9'),attributes,{'tableName':_0xa48e('0xa'),'paranoid':![],'indexes':[{'name':_0xa48e('0xb'),'fields':[_0xa48e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad75=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','uniqueid','lodash'];(function(_0x4fbe20,_0x319f2a){var _0x7afad=function(_0x1c73ae){while(--_0x1c73ae){_0x4fbe20['push'](_0x4fbe20['shift']());}};_0x7afad(++_0x319f2a);}(_0xad75,0xdb));var _0x5ad7=function(_0x2ba9ef,_0x32c749){_0x2ba9ef=_0x2ba9ef-0x0;var _0x20defb=_0xad75[_0x2ba9ef];return _0x20defb;};'use strict';var _=require(_0x5ad7('0x0'));var util=require(_0x5ad7('0x1'));var logger=require(_0x5ad7('0x2'))(_0x5ad7('0x3'));var moment=require(_0x5ad7('0x4'));var BPromise=require(_0x5ad7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ad7('0x6'));var rimraf=require(_0x5ad7('0x7'));var config=require(_0x5ad7('0x8'));var attributes=require('./smsQueueReport.attributes');module[_0x5ad7('0x9')]=function(_0x36f296,_0x4a4846){return _0x36f296['define']('SmsQueueReport',attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x5ad7('0xa'),'fields':[_0x5ad7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 105871c..5dfe846 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 _0x2909=['stringify','error','message','catch','CreateSmsQueueReport','SmsQueueReport','options','raw','then','UpdateSmsQueueReport','update','where','attributes','limit','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2909,0x187));var _0x9290=function(_0x18b6af,_0x4418d3){_0x18b6af=_0x18b6af-0x0;var _0x550550=_0x2909[_0x18b6af];return _0x550550;};'use strict';var _=require(_0x9290('0x0'));var util=require('util');var moment=require(_0x9290('0x1'));var BPromise=require(_0x9290('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9290('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9290('0x4'))(_0x9290('0x5'));var config=require(_0x9290('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9290('0x7')][_0x9290('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3591f3,_0x164840,_0x9b6589){return new BPromise(function(_0x4f0c38,_0x31fcef){return client[_0x9290('0x9')](_0x3591f3,_0x9b6589)['then'](function(_0x339edc){logger[_0x9290('0xa')](_0x9290('0xb'),_0x164840,_0x9290('0xc'));logger[_0x9290('0xd')](_0x9290('0xe'),_0x164840,_0x9290('0xc'),JSON[_0x9290('0xf')](_0x339edc));if(_0x339edc[_0x9290('0x10')]){if(_0x339edc['error']['code']===0x1f4){logger[_0x9290('0x10')](_0x9290('0xb'),_0x164840,_0x339edc['error'][_0x9290('0x11')]);return _0x31fcef(_0x339edc[_0x9290('0x10')][_0x9290('0x11')]);}logger[_0x9290('0x10')](_0x9290('0xb'),_0x164840,_0x339edc[_0x9290('0x10')][_0x9290('0x11')]);return _0x4f0c38(_0x339edc[_0x9290('0x10')][_0x9290('0x11')]);}else{logger[_0x9290('0xa')](_0x9290('0xb'),_0x164840,'request\x20sent');_0x4f0c38(_0x339edc['result'][_0x9290('0x11')]);}})[_0x9290('0x12')](function(_0x112ccf){logger['error'](_0x9290('0xb'),_0x164840,_0x112ccf);_0x31fcef(_0x112ccf);});});}exports[_0x9290('0x13')]=function(_0x1aee73){var _0x2de421=this;return new Promise(function(_0x4a8df8,_0x21dd49){return db[_0x9290('0x14')]['create'](_0x1aee73['body'],{'raw':_0x1aee73[_0x9290('0x15')]?_0x1aee73[_0x9290('0x15')][_0x9290('0x16')]===undefined?!![]:![]:!![]})[_0x9290('0x17')](function(_0x23ae99){logger['info'](_0x9290('0x13'),_0x1aee73);logger[_0x9290('0xd')](_0x9290('0x13'),_0x1aee73,JSON['stringify'](_0x23ae99));_0x4a8df8(_0x23ae99);})[_0x9290('0x12')](function(_0x577931){logger['error'](_0x9290('0x13'),_0x577931[_0x9290('0x11')],_0x1aee73);_0x21dd49(_0x2de421[_0x9290('0x10')](0x1f4,_0x577931['message']));});});};exports[_0x9290('0x18')]=function(_0x590e45){var _0x11a499=this;return new Promise(function(_0x3538d9,_0x345d78){return db[_0x9290('0x14')][_0x9290('0x19')](_0x590e45['body'],{'raw':_0x590e45['options']?_0x590e45[_0x9290('0x15')][_0x9290('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x590e45[_0x9290('0x15')]?_0x590e45[_0x9290('0x15')][_0x9290('0x1a')]||null:null,'attributes':_0x590e45[_0x9290('0x15')]?_0x590e45[_0x9290('0x15')][_0x9290('0x1b')]||null:null,'limit':_0x590e45['options']?_0x590e45[_0x9290('0x15')][_0x9290('0x1c')]||null:null})[_0x9290('0x17')](function(_0x18c11e){logger[_0x9290('0xa')]('UpdateSmsQueueReport',_0x590e45);logger[_0x9290('0xd')](_0x9290('0x18'),_0x590e45,JSON['stringify'](_0x18c11e));_0x3538d9(_0x18c11e);})[_0x9290('0x12')](function(_0x478c9a){logger['error'](_0x9290('0x18'),_0x478c9a[_0x9290('0x11')],_0x590e45);_0x345d78(_0x11a499[_0x9290('0x10')](0x1f4,_0x478c9a[_0x9290('0x11')]));});});}; \ No newline at end of file +var _0xae9c=['SmsQueueReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateSmsQueueReport','create','body','options','raw','stringify','catch','UpdateSmsQueueReport'];(function(_0x31c5fd,_0x33131f){var _0x3799ab=function(_0x1538bf){while(--_0x1538bf){_0x31c5fd['push'](_0x31c5fd['shift']());}};_0x3799ab(++_0x33131f);}(_0xae9c,0x8b));var _0xcae9=function(_0x365808,_0x597fdb){_0x365808=_0x365808-0x0;var _0x5a11e1=_0xae9c[_0x365808];return _0x5a11e1;};'use strict';var _=require(_0xcae9('0x0'));var util=require(_0xcae9('0x1'));var moment=require(_0xcae9('0x2'));var BPromise=require(_0xcae9('0x3'));var rs=require(_0xcae9('0x4'));var fs=require('fs');var Redis=require(_0xcae9('0x5'));var db=require(_0xcae9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcae9('0x7'))('rpc');var config=require(_0xcae9('0x8'));var jayson=require(_0xcae9('0x9'));var client=jayson[_0xcae9('0xa')][_0xcae9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x357658,_0x9bed9b,_0xfd459f){return new BPromise(function(_0x2c4788,_0x15d7d1){return client[_0xcae9('0xc')](_0x357658,_0xfd459f)[_0xcae9('0xd')](function(_0xd15e3d){logger[_0xcae9('0xe')](_0xcae9('0xf'),_0x9bed9b,'request\x20sent');logger[_0xcae9('0x10')](_0xcae9('0x11'),_0x9bed9b,_0xcae9('0x12'),JSON['stringify'](_0xd15e3d));if(_0xd15e3d['error']){if(_0xd15e3d[_0xcae9('0x13')][_0xcae9('0x14')]===0x1f4){logger['error'](_0xcae9('0xf'),_0x9bed9b,_0xd15e3d[_0xcae9('0x13')][_0xcae9('0x15')]);return _0x15d7d1(_0xd15e3d[_0xcae9('0x13')][_0xcae9('0x15')]);}logger[_0xcae9('0x13')](_0xcae9('0xf'),_0x9bed9b,_0xd15e3d[_0xcae9('0x13')][_0xcae9('0x15')]);return _0x2c4788(_0xd15e3d[_0xcae9('0x13')][_0xcae9('0x15')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x9bed9b,_0xcae9('0x12'));_0x2c4788(_0xd15e3d[_0xcae9('0x16')]['message']);}})['catch'](function(_0x30589b){logger[_0xcae9('0x13')](_0xcae9('0xf'),_0x9bed9b,_0x30589b);_0x15d7d1(_0x30589b);});});}exports[_0xcae9('0x17')]=function(_0x3a86a0){var _0x16201c=this;return new Promise(function(_0x108c5c,_0x51e8a2){return db['SmsQueueReport'][_0xcae9('0x18')](_0x3a86a0[_0xcae9('0x19')],{'raw':_0x3a86a0[_0xcae9('0x1a')]?_0x3a86a0[_0xcae9('0x1a')][_0xcae9('0x1b')]===undefined?!![]:![]:!![]})[_0xcae9('0xd')](function(_0x43da1c){logger['info'](_0xcae9('0x17'),_0x3a86a0);logger[_0xcae9('0x10')](_0xcae9('0x17'),_0x3a86a0,JSON[_0xcae9('0x1c')](_0x43da1c));_0x108c5c(_0x43da1c);})[_0xcae9('0x1d')](function(_0x5a0209){logger['error'](_0xcae9('0x17'),_0x5a0209['message'],_0x3a86a0);_0x51e8a2(_0x16201c[_0xcae9('0x13')](0x1f4,_0x5a0209['message']));});});};exports[_0xcae9('0x1e')]=function(_0x333670){var _0x13f9c1=this;return new Promise(function(_0x1a19ba,_0x361c46){return db[_0xcae9('0x1f')][_0xcae9('0x20')](_0x333670[_0xcae9('0x19')],{'raw':_0x333670[_0xcae9('0x1a')]?_0x333670[_0xcae9('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x333670[_0xcae9('0x1a')]?_0x333670[_0xcae9('0x1a')][_0xcae9('0x21')]||null:null,'attributes':_0x333670[_0xcae9('0x1a')]?_0x333670[_0xcae9('0x1a')]['attributes']||null:null,'limit':_0x333670[_0xcae9('0x1a')]?_0x333670[_0xcae9('0x1a')]['limit']||null:null})[_0xcae9('0xd')](function(_0x286b2a){logger[_0xcae9('0xe')](_0xcae9('0x1e'),_0x333670);logger[_0xcae9('0x10')](_0xcae9('0x1e'),_0x333670,JSON[_0xcae9('0x1c')](_0x286b2a));_0x1a19ba(_0x286b2a);})['catch'](function(_0x15142a){logger[_0xcae9('0x13')]('UpdateSmsQueueReport',_0x15142a[_0xcae9('0x15')],_0x333670);_0x361c46(_0x13f9c1[_0xcae9('0x13')](0x1f4,_0x15142a[_0xcae9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 0483f81..6ce9d95 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 _0xdda0=['describe','/:id','post','create','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x37a007,_0x11c51d){var _0x371b1d=function(_0x12a152){while(--_0x12a152){_0x37a007['push'](_0x37a007['shift']());}};_0x371b1d(++_0x11c51d);}(_0xdda0,0x7f));var _0x0dda=function(_0x392533,_0x355c13){_0x392533=_0x392533-0x0;var _0x57a3cd=_0xdda0[_0x392533];return _0x57a3cd;};'use strict';var multer=require(_0x0dda('0x0'));var util=require('util');var path=require(_0x0dda('0x1'));var timeout=require(_0x0dda('0x2'));var express=require('express');var router=express[_0x0dda('0x3')]();var fs_extra=require(_0x0dda('0x4'));var auth=require(_0x0dda('0x5'));var interaction=require(_0x0dda('0x6'));var config=require(_0x0dda('0x7'));var controller=require(_0x0dda('0x8'));router[_0x0dda('0x9')]('/',auth[_0x0dda('0xa')](),controller[_0x0dda('0xb')]);router[_0x0dda('0x9')](_0x0dda('0xc'),auth['isAuthenticated'](),controller[_0x0dda('0xd')]);router['get'](_0x0dda('0xe'),auth[_0x0dda('0xa')](),controller['show']);router[_0x0dda('0xf')]('/',auth['isAuthenticated'](),controller[_0x0dda('0x10')]);router['put'](_0x0dda('0xe'),auth[_0x0dda('0xa')](),controller[_0x0dda('0x11')]);router[_0x0dda('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0dda('0x13')]=router; \ No newline at end of file +var _0xb57a=['delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x27df6a,_0x59e43c){var _0x25e655=function(_0x2cfee6){while(--_0x2cfee6){_0x27df6a['push'](_0x27df6a['shift']());}};_0x25e655(++_0x59e43c);}(_0xb57a,0x13d));var _0xab57=function(_0x44da09,_0x155beb){_0x44da09=_0x44da09-0x0;var _0x36c8db=_0xb57a[_0x44da09];return _0x36c8db;};'use strict';var multer=require(_0xab57('0x0'));var util=require(_0xab57('0x1'));var path=require(_0xab57('0x2'));var timeout=require(_0xab57('0x3'));var express=require(_0xab57('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xab57('0x5'));var interaction=require(_0xab57('0x6'));var config=require(_0xab57('0x7'));var controller=require(_0xab57('0x8'));router[_0xab57('0x9')]('/',auth[_0xab57('0xa')](),controller[_0xab57('0xb')]);router['get'](_0xab57('0xc'),auth[_0xab57('0xa')](),controller[_0xab57('0xd')]);router[_0xab57('0x9')](_0xab57('0xe'),auth[_0xab57('0xa')](),controller[_0xab57('0xf')]);router[_0xab57('0x10')]('/',auth[_0xab57('0xa')](),controller['create']);router[_0xab57('0x11')](_0xab57('0xe'),auth[_0xab57('0xa')](),controller[_0xab57('0x12')]);router[_0xab57('0x13')](_0xab57('0xe'),auth[_0xab57('0xa')](),controller[_0xab57('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index ae8ee67..5250274 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 _0x4d45=['account','agent','queue','NOW','moment','sequelize','exports','ENUM'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4d45,0x19c));var _0x54d4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4d45[_0x167cc1];return _0x10bc4b;};'use strict';var moment=require(_0x54d4('0x0'));var Sequelize=require(_0x54d4('0x1'));module[_0x54d4('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x54d4('0x3')](_0x54d4('0x4'),_0x54d4('0x5'),_0x54d4('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x54d4('0x7')]}}; \ No newline at end of file +var _0x31cf=['agent','queue','moment','sequelize','exports','STRING','account'];(function(_0x46d672,_0x407a9b){var _0x2e222b=function(_0x30f5f0){while(--_0x30f5f0){_0x46d672['push'](_0x46d672['shift']());}};_0x2e222b(++_0x407a9b);}(_0x31cf,0x12f));var _0xf31c=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x31cf[_0xb833b1];return _0x1ab87a;};'use strict';var moment=require(_0xf31c('0x0'));var Sequelize=require(_0xf31c('0x1'));module[_0xf31c('0x2')]={'uniqueid':{'type':Sequelize[_0xf31c('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf31c('0x4'),_0xf31c('0x5'),'queue'),'allowNull':![],'defaultValue':_0xf31c('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index f8e4a50..029e48b 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 _0x2deb=['util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x120a5f,_0x4b6fc2){var _0x53cb62=function(_0x3ce87b){while(--_0x3ce87b){_0x120a5f['push'](_0x120a5f['shift']());}};_0x53cb62(++_0x4b6fc2);}(_0x2deb,0xdb));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xb2de('0x0'));var rimraf=require(_0xb2de('0x1'));var zipdir=require(_0xb2de('0x2'));var jsonpatch=require(_0xb2de('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb2de('0x4'));var Mustache=require(_0xb2de('0x5'));var util=require(_0xb2de('0x6'));var path=require(_0xb2de('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb2de('0x8'));var fs=require('fs');var fs_extra=require(_0xb2de('0x9'));var _=require(_0xb2de('0xa'));var squel=require('squel');var crypto=require(_0xb2de('0xb'));var jsforce=require(_0xb2de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb2de('0xd'));var querystring=require(_0xb2de('0xe'));var Papa=require(_0xb2de('0xf'));var Redis=require('ioredis');var authService=require(_0xb2de('0x10'));var qs=require(_0xb2de('0x11'));var as=require(_0xb2de('0x12'));var hardwareService=require(_0xb2de('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb2de('0x14'));var config=require(_0xb2de('0x15'));var licenseUtil=require(_0xb2de('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e2237,_0x343024){_0x343024=_0x343024||0xcc;return function(_0xec4373){if(_0xec4373){return _0x1e2237['sendStatus'](_0x343024);}return _0x1e2237[_0xb2de('0x17')](_0x343024)['end']();};}function respondWithResult(_0x160d61,_0x4feb90){_0x4feb90=_0x4feb90||0xc8;return function(_0x10ef21){if(_0x10ef21){return _0x160d61[_0xb2de('0x17')](_0x4feb90)[_0xb2de('0x18')](_0x10ef21);}};}function respondWithFilteredResult(_0x5a1f02,_0x209429){return function(_0x40f29d){if(_0x40f29d){var _0x2dc98f=_0x40f29d[_0xb2de('0x19')],_0x1413f6=_0x209429[_0xb2de('0x1a')],_0x317528=_0x209429[_0xb2de('0x1a')]+_0x209429['limit'],_0x2dc15c;if(_0x317528>=_0x2dc98f){_0x317528=_0x2dc98f;_0x2dc15c=0xc8;}else{_0x2dc15c=0xce;}_0x5a1f02[_0xb2de('0x17')](_0x2dc15c);return _0x5a1f02['set'](_0xb2de('0x1b'),_0x1413f6+'-'+_0x317528+'/'+_0x2dc98f)[_0xb2de('0x18')](_0x40f29d);}return null;};}function patchUpdates(_0x4c7ad4){return function(_0x2fbe63){try{jsonpatch[_0xb2de('0x1c')](_0x2fbe63,_0x4c7ad4,!![]);}catch(_0x499c2f){return BPromise[_0xb2de('0x1d')](_0x499c2f);}return _0x2fbe63[_0xb2de('0x1e')]();};}function saveUpdates(_0x34b228,_0x148c91){return function(_0x449edb){if(_0x449edb){return _0x449edb[_0xb2de('0x1f')](_0x34b228)[_0xb2de('0x20')](function(_0x26e02f){return _0x26e02f;});}return null;};}function removeEntity(_0x20d7f8,_0x506a50){return function(_0x280644){if(_0x280644){return _0x280644[_0xb2de('0x21')]()[_0xb2de('0x20')](function(){_0x20d7f8[_0xb2de('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55051f,_0x102da8){return function(_0x1efd51){if(!_0x1efd51){_0x55051f[_0xb2de('0x22')](0x194);}return _0x1efd51;};}function handleError(_0x543ff7,_0x45fda0){_0x45fda0=_0x45fda0||0x1f4;return function(_0x1cc2db){logger['error'](_0x1cc2db[_0xb2de('0x23')]);if(_0x1cc2db['name']){delete _0x1cc2db[_0xb2de('0x24')];}_0x543ff7[_0xb2de('0x17')](_0x45fda0)[_0xb2de('0x25')](_0x1cc2db);};}exports[_0xb2de('0x26')]=function(_0xeb4e31,_0x1ad5a2){var _0x48675d={},_0x391bc7={},_0x5b04ae={'count':0x0,'rows':[]};var _0x38fee9=_['map'](db['SmsTransferReport'][_0xb2de('0x27')],function(_0x4269ab){return{'name':_0x4269ab[_0xb2de('0x28')],'type':_0x4269ab[_0xb2de('0x29')][_0xb2de('0x2a')]};});_0x391bc7[_0xb2de('0x2b')]=_[_0xb2de('0x2c')](_0x38fee9,_0xb2de('0x24'));_0x391bc7[_0xb2de('0x2d')]=_[_0xb2de('0x2e')](_0xeb4e31[_0xb2de('0x2d')]);_0x391bc7[_0xb2de('0x2f')]=_['intersection'](_0x391bc7[_0xb2de('0x2b')],_0x391bc7[_0xb2de('0x2d')]);_0x48675d['attributes']=_[_0xb2de('0x30')](_0x391bc7[_0xb2de('0x2b')],qs['fields'](_0xeb4e31[_0xb2de('0x2d')][_0xb2de('0x31')]));_0x48675d[_0xb2de('0x32')]=_0x48675d['attributes'][_0xb2de('0x33')]?_0x48675d[_0xb2de('0x32')]:_0x391bc7[_0xb2de('0x2b')];if(!_0xeb4e31[_0xb2de('0x2d')][_0xb2de('0x34')](_0xb2de('0x35'))){_0x48675d[_0xb2de('0x36')]=qs[_0xb2de('0x36')](_0xeb4e31[_0xb2de('0x2d')][_0xb2de('0x36')]);_0x48675d[_0xb2de('0x1a')]=qs['offset'](_0xeb4e31[_0xb2de('0x2d')][_0xb2de('0x1a')]);}_0x48675d[_0xb2de('0x37')]=qs[_0xb2de('0x38')](_0xeb4e31[_0xb2de('0x2d')][_0xb2de('0x38')]);_0x48675d[_0xb2de('0x39')]=qs[_0xb2de('0x2f')](_[_0xb2de('0x3a')](_0xeb4e31[_0xb2de('0x2d')],_0x391bc7[_0xb2de('0x2f')]),_0x38fee9);if(_0xeb4e31[_0xb2de('0x2d')][_0xb2de('0x3b')]){_0x48675d[_0xb2de('0x39')]=_[_0xb2de('0x3c')](_0x48675d['where'],{'$or':_[_0xb2de('0x2c')](_0x38fee9,function(_0x48ca28){if(_0x48ca28[_0xb2de('0x29')]!==_0xb2de('0x3d')){var _0x3e5747={};_0x3e5747[_0x48ca28[_0xb2de('0x24')]]={'$like':'%'+_0xeb4e31[_0xb2de('0x2d')][_0xb2de('0x3b')]+'%'};return _0x3e5747;}})});}_0x48675d=_[_0xb2de('0x3c')]({},_0x48675d,_0xeb4e31[_0xb2de('0x3e')]);var _0x24f53b={'where':_0x48675d[_0xb2de('0x39')]};return db[_0xb2de('0x3f')][_0xb2de('0x19')](_0x24f53b)[_0xb2de('0x20')](function(_0x1e7091){_0x5b04ae[_0xb2de('0x19')]=_0x1e7091;if(_0xeb4e31['query'][_0xb2de('0x40')]){_0x48675d[_0xb2de('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xb2de('0x42')](_0x48675d);})[_0xb2de('0x20')](function(_0x33427e){_0x5b04ae[_0xb2de('0x43')]=_0x33427e;return _0x5b04ae;})['then'](respondWithFilteredResult(_0x1ad5a2,_0x48675d))[_0xb2de('0x44')](handleError(_0x1ad5a2,null));};exports[_0xb2de('0x45')]=function(_0x5d341e,_0x47448a){var _0x250b65={'raw':!![],'where':{'id':_0x5d341e[_0xb2de('0x46')]['id']}},_0x488992={};_0x488992['model']=_['keys'](db[_0xb2de('0x3f')]['rawAttributes']);_0x488992['query']=_[_0xb2de('0x2e')](_0x5d341e[_0xb2de('0x2d')]);_0x488992['filters']=_[_0xb2de('0x30')](_0x488992[_0xb2de('0x2b')],_0x488992[_0xb2de('0x2d')]);_0x250b65[_0xb2de('0x32')]=_['intersection'](_0x488992[_0xb2de('0x2b')],qs[_0xb2de('0x31')](_0x5d341e[_0xb2de('0x2d')][_0xb2de('0x31')]));_0x250b65[_0xb2de('0x32')]=_0x250b65[_0xb2de('0x32')][_0xb2de('0x33')]?_0x250b65['attributes']:_0x488992[_0xb2de('0x2b')];if(_0x5d341e[_0xb2de('0x2d')][_0xb2de('0x40')]){_0x250b65['include']=[{'all':!![]}];}_0x250b65=_[_0xb2de('0x3c')]({},_0x250b65,_0x5d341e['options']);return db[_0xb2de('0x3f')][_0xb2de('0x47')](_0x250b65)[_0xb2de('0x20')](handleEntityNotFound(_0x47448a,null))[_0xb2de('0x20')](respondWithResult(_0x47448a,null))['catch'](handleError(_0x47448a,null));};exports[_0xb2de('0x48')]=function(_0x47b0a3,_0x569f58){return db['SmsTransferReport'][_0xb2de('0x48')](_0x47b0a3[_0xb2de('0x49')],{})[_0xb2de('0x20')](respondWithResult(_0x569f58,0xc9))[_0xb2de('0x44')](handleError(_0x569f58,null));};exports[_0xb2de('0x1f')]=function(_0x541942,_0x304bab){if(_0x541942['body']['id']){delete _0x541942[_0xb2de('0x49')]['id'];}return db['SmsTransferReport'][_0xb2de('0x47')]({'where':{'id':_0x541942[_0xb2de('0x46')]['id']}})['then'](handleEntityNotFound(_0x304bab,null))[_0xb2de('0x20')](saveUpdates(_0x541942['body'],null))[_0xb2de('0x20')](respondWithResult(_0x304bab,null))[_0xb2de('0x44')](handleError(_0x304bab,null));};exports[_0xb2de('0x21')]=function(_0x39a9aa,_0x5e0968){return db[_0xb2de('0x3f')][_0xb2de('0x47')]({'where':{'id':_0x39a9aa[_0xb2de('0x46')]['id']}})[_0xb2de('0x20')](handleEntityNotFound(_0x5e0968,null))[_0xb2de('0x20')](removeEntity(_0x5e0968,null))['catch'](handleError(_0x5e0968,null));};exports[_0xb2de('0x4a')]=function(_0x9fab63,_0x45ebf1){return db[_0xb2de('0x3f')][_0xb2de('0x4a')]()['then'](respondWithResult(_0x45ebf1,null))[_0xb2de('0x44')](handleError(_0x45ebf1,null));}; \ No newline at end of file +var _0xcac2=['catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','reject','save','update','destroy','error','stack','name','send','index','SmsTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','options','count','includeAll','include','findAll','then','rows','show','find'];(function(_0x21c76e,_0x657e32){var _0x1c28c7=function(_0x1053ed){while(--_0x1053ed){_0x21c76e['push'](_0x21c76e['shift']());}};_0x1c28c7(++_0x657e32);}(_0xcac2,0x1e8));var _0x2cac=function(_0x4925b6,_0x32a770){_0x4925b6=_0x4925b6-0x0;var _0x5195ea=_0xcac2[_0x4925b6];return _0x5195ea;};'use strict';var emlformat=require(_0x2cac('0x0'));var rimraf=require(_0x2cac('0x1'));var zipdir=require(_0x2cac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cac('0x3'));var moment=require(_0x2cac('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2cac('0x5'));var csv=require(_0x2cac('0x6'));var ejs=require(_0x2cac('0x7'));var fs=require('fs');var fs_extra=require(_0x2cac('0x8'));var _=require(_0x2cac('0x9'));var squel=require(_0x2cac('0xa'));var crypto=require(_0x2cac('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2cac('0x6'));var querystring=require('querystring');var Papa=require(_0x2cac('0xc'));var Redis=require(_0x2cac('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2cac('0xe'));var hardwareService=require(_0x2cac('0xf'));var logger=require('../../config/logger')(_0x2cac('0x10'));var utils=require('../../config/utils');var config=require(_0x2cac('0x11'));var licenseUtil=require(_0x2cac('0x12'));var db=require(_0x2cac('0x13'))['db'];function respondWithStatusCode(_0x1ccf7b,_0x2b5975){_0x2b5975=_0x2b5975||0xcc;return function(_0x58aad7){if(_0x58aad7){return _0x1ccf7b[_0x2cac('0x14')](_0x2b5975);}return _0x1ccf7b[_0x2cac('0x15')](_0x2b5975)['end']();};}function respondWithResult(_0x440617,_0x302d91){_0x302d91=_0x302d91||0xc8;return function(_0x3c1b1f){if(_0x3c1b1f){return _0x440617['status'](_0x302d91)[_0x2cac('0x16')](_0x3c1b1f);}};}function respondWithFilteredResult(_0x354ab7,_0x3d846b){return function(_0x5e731b){if(_0x5e731b){var _0x46db00=_0x5e731b['count'],_0x3e7e90=_0x3d846b[_0x2cac('0x17')],_0xe4041f=_0x3d846b[_0x2cac('0x17')]+_0x3d846b[_0x2cac('0x18')],_0x4d4646;if(_0xe4041f>=_0x46db00){_0xe4041f=_0x46db00;_0x4d4646=0xc8;}else{_0x4d4646=0xce;}_0x354ab7[_0x2cac('0x15')](_0x4d4646);return _0x354ab7[_0x2cac('0x19')]('Content-Range',_0x3e7e90+'-'+_0xe4041f+'/'+_0x46db00)[_0x2cac('0x16')](_0x5e731b);}return null;};}function patchUpdates(_0x2764c7){return function(_0x397e70){try{jsonpatch[_0x2cac('0x1a')](_0x397e70,_0x2764c7,!![]);}catch(_0xccf89b){return BPromise[_0x2cac('0x1b')](_0xccf89b);}return _0x397e70[_0x2cac('0x1c')]();};}function saveUpdates(_0xd04add,_0x5871af){return function(_0x3830e3){if(_0x3830e3){return _0x3830e3[_0x2cac('0x1d')](_0xd04add)['then'](function(_0x4f0168){return _0x4f0168;});}return null;};}function removeEntity(_0x35d99b,_0x53f335){return function(_0xbdb16b){if(_0xbdb16b){return _0xbdb16b[_0x2cac('0x1e')]()['then'](function(){_0x35d99b[_0x2cac('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43b372,_0x4267cc){return function(_0x37ac60){if(!_0x37ac60){_0x43b372[_0x2cac('0x14')](0x194);}return _0x37ac60;};}function handleError(_0x547154,_0x1de4c8){_0x1de4c8=_0x1de4c8||0x1f4;return function(_0x1de22c){logger[_0x2cac('0x1f')](_0x1de22c[_0x2cac('0x20')]);if(_0x1de22c[_0x2cac('0x21')]){delete _0x1de22c[_0x2cac('0x21')];}_0x547154['status'](_0x1de4c8)[_0x2cac('0x22')](_0x1de22c);};}exports[_0x2cac('0x23')]=function(_0x523e2b,_0x1f189a){var _0x4b6ad1={},_0x24966b={},_0x387e56={'count':0x0,'rows':[]};var _0x5d70a7=_['map'](db[_0x2cac('0x24')][_0x2cac('0x25')],function(_0x246cef){return{'name':_0x246cef['fieldName'],'type':_0x246cef[_0x2cac('0x26')][_0x2cac('0x27')]};});_0x24966b[_0x2cac('0x28')]=_['map'](_0x5d70a7,_0x2cac('0x21'));_0x24966b[_0x2cac('0x29')]=_[_0x2cac('0x2a')](_0x523e2b[_0x2cac('0x29')]);_0x24966b[_0x2cac('0x2b')]=_[_0x2cac('0x2c')](_0x24966b[_0x2cac('0x28')],_0x24966b['query']);_0x4b6ad1[_0x2cac('0x2d')]=_[_0x2cac('0x2c')](_0x24966b[_0x2cac('0x28')],qs['fields'](_0x523e2b[_0x2cac('0x29')][_0x2cac('0x2e')]));_0x4b6ad1[_0x2cac('0x2d')]=_0x4b6ad1[_0x2cac('0x2d')][_0x2cac('0x2f')]?_0x4b6ad1[_0x2cac('0x2d')]:_0x24966b[_0x2cac('0x28')];if(!_0x523e2b[_0x2cac('0x29')][_0x2cac('0x30')]('nolimit')){_0x4b6ad1['limit']=qs['limit'](_0x523e2b[_0x2cac('0x29')][_0x2cac('0x18')]);_0x4b6ad1['offset']=qs['offset'](_0x523e2b['query']['offset']);}_0x4b6ad1['order']=qs[_0x2cac('0x31')](_0x523e2b['query'][_0x2cac('0x31')]);_0x4b6ad1[_0x2cac('0x32')]=qs[_0x2cac('0x2b')](_[_0x2cac('0x33')](_0x523e2b[_0x2cac('0x29')],_0x24966b[_0x2cac('0x2b')]),_0x5d70a7);if(_0x523e2b[_0x2cac('0x29')][_0x2cac('0x34')]){_0x4b6ad1[_0x2cac('0x32')]=_[_0x2cac('0x35')](_0x4b6ad1['where'],{'$or':_[_0x2cac('0x36')](_0x5d70a7,function(_0x27a48d){if(_0x27a48d['type']!=='VIRTUAL'){var _0x41de45={};_0x41de45[_0x27a48d[_0x2cac('0x21')]]={'$like':'%'+_0x523e2b[_0x2cac('0x29')][_0x2cac('0x34')]+'%'};return _0x41de45;}})});}_0x4b6ad1=_[_0x2cac('0x35')]({},_0x4b6ad1,_0x523e2b[_0x2cac('0x37')]);var _0xf67ef0={'where':_0x4b6ad1[_0x2cac('0x32')]};return db[_0x2cac('0x24')][_0x2cac('0x38')](_0xf67ef0)['then'](function(_0x565744){_0x387e56[_0x2cac('0x38')]=_0x565744;if(_0x523e2b[_0x2cac('0x29')][_0x2cac('0x39')]){_0x4b6ad1[_0x2cac('0x3a')]=[{'all':!![]}];}return db[_0x2cac('0x24')][_0x2cac('0x3b')](_0x4b6ad1);})[_0x2cac('0x3c')](function(_0x1546b5){_0x387e56[_0x2cac('0x3d')]=_0x1546b5;return _0x387e56;})[_0x2cac('0x3c')](respondWithFilteredResult(_0x1f189a,_0x4b6ad1))['catch'](handleError(_0x1f189a,null));};exports[_0x2cac('0x3e')]=function(_0x378aba,_0x25c9f9){var _0x185178={'raw':!![],'where':{'id':_0x378aba['params']['id']}},_0x226a28={};_0x226a28[_0x2cac('0x28')]=_[_0x2cac('0x2a')](db['SmsTransferReport'][_0x2cac('0x25')]);_0x226a28[_0x2cac('0x29')]=_[_0x2cac('0x2a')](_0x378aba[_0x2cac('0x29')]);_0x226a28[_0x2cac('0x2b')]=_[_0x2cac('0x2c')](_0x226a28['model'],_0x226a28[_0x2cac('0x29')]);_0x185178[_0x2cac('0x2d')]=_['intersection'](_0x226a28[_0x2cac('0x28')],qs[_0x2cac('0x2e')](_0x378aba[_0x2cac('0x29')]['fields']));_0x185178[_0x2cac('0x2d')]=_0x185178['attributes']['length']?_0x185178['attributes']:_0x226a28[_0x2cac('0x28')];if(_0x378aba[_0x2cac('0x29')]['includeAll']){_0x185178['include']=[{'all':!![]}];}_0x185178=_[_0x2cac('0x35')]({},_0x185178,_0x378aba[_0x2cac('0x37')]);return db[_0x2cac('0x24')][_0x2cac('0x3f')](_0x185178)[_0x2cac('0x3c')](handleEntityNotFound(_0x25c9f9,null))['then'](respondWithResult(_0x25c9f9,null))[_0x2cac('0x40')](handleError(_0x25c9f9,null));};exports[_0x2cac('0x41')]=function(_0x232e7b,_0x16896d){return db['SmsTransferReport'][_0x2cac('0x41')](_0x232e7b[_0x2cac('0x42')],{})[_0x2cac('0x3c')](respondWithResult(_0x16896d,0xc9))[_0x2cac('0x40')](handleError(_0x16896d,null));};exports[_0x2cac('0x1d')]=function(_0x4a1651,_0x1da471){if(_0x4a1651['body']['id']){delete _0x4a1651[_0x2cac('0x42')]['id'];}return db[_0x2cac('0x24')][_0x2cac('0x3f')]({'where':{'id':_0x4a1651[_0x2cac('0x43')]['id']}})[_0x2cac('0x3c')](handleEntityNotFound(_0x1da471,null))[_0x2cac('0x3c')](saveUpdates(_0x4a1651[_0x2cac('0x42')],null))[_0x2cac('0x3c')](respondWithResult(_0x1da471,null))[_0x2cac('0x40')](handleError(_0x1da471,null));};exports[_0x2cac('0x1e')]=function(_0x2c7d9c,_0x3a2124){return db[_0x2cac('0x24')][_0x2cac('0x3f')]({'where':{'id':_0x2c7d9c[_0x2cac('0x43')]['id']}})[_0x2cac('0x3c')](handleEntityNotFound(_0x3a2124,null))[_0x2cac('0x3c')](removeEntity(_0x3a2124,null))[_0x2cac('0x40')](handleError(_0x3a2124,null));};exports[_0x2cac('0x44')]=function(_0x5d8638,_0x2a90a6){return db[_0x2cac('0x24')][_0x2cac('0x44')]()['then'](respondWithResult(_0x2a90a6,null))['catch'](handleError(_0x2a90a6,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 1a6dea1..39cd2e5 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 _0x5496=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','define','report_sms_transfer'];(function(_0x5cba47,_0x5e83ee){var _0x59ef99=function(_0x268211){while(--_0x268211){_0x5cba47['push'](_0x5cba47['shift']());}};_0x59ef99(++_0x5e83ee);}(_0x5496,0x175));var _0x6549=function(_0x22b684,_0x32fc4f){_0x22b684=_0x22b684-0x0;var _0x4152a8=_0x5496[_0x22b684];return _0x4152a8;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('SmsTransferReport',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf69d=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer'];(function(_0x1c1b8c,_0x4c253d){var _0x1ee4c4=function(_0xb9bff5){while(--_0xb9bff5){_0x1c1b8c['push'](_0x1c1b8c['shift']());}};_0x1ee4c4(++_0x4c253d);}(_0xf69d,0xd3));var _0xdf69=function(_0x337aa1,_0x4287e9){_0x337aa1=_0x337aa1-0x0;var _0x2e3f6c=_0xf69d[_0x337aa1];return _0x2e3f6c;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var moment=require(_0xdf69('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf69('0x5'));var fs=require('fs');var path=require(_0xdf69('0x6'));var rimraf=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var attributes=require(_0xdf69('0x9'));module[_0xdf69('0xa')]=function(_0x2d456f,_0x465b1b){return _0x2d456f[_0xdf69('0xb')](_0xdf69('0xc'),attributes,{'tableName':_0xdf69('0xd'),'paranoid':![],'indexes':[{'name':_0xdf69('0xe'),'fields':[_0xdf69('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 346625f..9bbb793 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 _0xc393=['request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x4ac48d,_0x171a68){var _0x7537af=function(_0x1c6ca6){while(--_0x1c6ca6){_0x4ac48d['push'](_0x4ac48d['shift']());}};_0x7537af(++_0x171a68);}(_0xc393,0x197));var _0x3c39=function(_0x24a48a,_0x3843a5){_0x24a48a=_0x24a48a-0x0;var _0x2f9b60=_0xc393[_0x24a48a];return _0x2f9b60;};'use strict';var _=require(_0x3c39('0x0'));var util=require(_0x3c39('0x1'));var moment=require(_0x3c39('0x2'));var BPromise=require(_0x3c39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3c39('0x4'));var logger=require(_0x3c39('0x5'))(_0x3c39('0x6'));var config=require(_0x3c39('0x7'));var jayson=require(_0x3c39('0x8'));var client=jayson[_0x3c39('0x9')][_0x3c39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28fb2a,_0x25999b,_0x25b896){return new BPromise(function(_0x1af981,_0x43da6b){return client[_0x3c39('0xb')](_0x28fb2a,_0x25b896)['then'](function(_0x5d3157){logger[_0x3c39('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x25999b,_0x3c39('0xd'));logger['debug'](_0x3c39('0xe'),_0x25999b,_0x3c39('0xd'),JSON[_0x3c39('0xf')](_0x5d3157));if(_0x5d3157[_0x3c39('0x10')]){if(_0x5d3157['error'][_0x3c39('0x11')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x25999b,_0x5d3157[_0x3c39('0x10')]['message']);return _0x43da6b(_0x5d3157[_0x3c39('0x10')][_0x3c39('0x12')]);}logger[_0x3c39('0x10')](_0x3c39('0x13'),_0x25999b,_0x5d3157[_0x3c39('0x10')][_0x3c39('0x12')]);return _0x1af981(_0x5d3157[_0x3c39('0x10')][_0x3c39('0x12')]);}else{logger[_0x3c39('0xc')](_0x3c39('0x13'),_0x25999b,_0x3c39('0xd'));_0x1af981(_0x5d3157[_0x3c39('0x14')][_0x3c39('0x12')]);}})['catch'](function(_0x36d162){logger['error'](_0x3c39('0x13'),_0x25999b,_0x36d162);_0x43da6b(_0x36d162);});});} \ No newline at end of file +var _0x3ab2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment'];(function(_0x164e8f,_0xdba27a){var _0x2b2840=function(_0x4458f0){while(--_0x4458f0){_0x164e8f['push'](_0x164e8f['shift']());}};_0x2b2840(++_0xdba27a);}(_0x3ab2,0x15b));var _0x23ab=function(_0x3d2a6d,_0x4ccde0){_0x3d2a6d=_0x3d2a6d-0x0;var _0x27234b=_0x3ab2[_0x3d2a6d];return _0x27234b;};'use strict';var _=require(_0x23ab('0x0'));var util=require(_0x23ab('0x1'));var moment=require(_0x23ab('0x2'));var BPromise=require(_0x23ab('0x3'));var rs=require(_0x23ab('0x4'));var fs=require('fs');var Redis=require(_0x23ab('0x5'));var db=require(_0x23ab('0x6'))['db'];var utils=require(_0x23ab('0x7'));var logger=require(_0x23ab('0x8'))(_0x23ab('0x9'));var config=require(_0x23ab('0xa'));var jayson=require(_0x23ab('0xb'));var client=jayson[_0x23ab('0xc')][_0x23ab('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x458f98,_0x4b183e,_0x2acbcd){return new BPromise(function(_0x597117,_0x198563){return client[_0x23ab('0xe')](_0x458f98,_0x2acbcd)[_0x23ab('0xf')](function(_0x1deb21){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x4b183e,_0x23ab('0x10'));logger[_0x23ab('0x11')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x4b183e,_0x23ab('0x10'),JSON[_0x23ab('0x12')](_0x1deb21));if(_0x1deb21[_0x23ab('0x13')]){if(_0x1deb21[_0x23ab('0x13')][_0x23ab('0x14')]===0x1f4){logger['error'](_0x23ab('0x15'),_0x4b183e,_0x1deb21[_0x23ab('0x13')][_0x23ab('0x16')]);return _0x198563(_0x1deb21['error'][_0x23ab('0x16')]);}logger[_0x23ab('0x13')](_0x23ab('0x15'),_0x4b183e,_0x1deb21[_0x23ab('0x13')]['message']);return _0x597117(_0x1deb21[_0x23ab('0x13')][_0x23ab('0x16')]);}else{logger[_0x23ab('0x17')]('SmsTransferReport,\x20%s,\x20%s',_0x4b183e,'request\x20sent');_0x597117(_0x1deb21['result'][_0x23ab('0x16')]);}})[_0x23ab('0x18')](function(_0xdd8bad){logger['error'](_0x23ab('0x15'),_0x4b183e,_0xdd8bad);_0x198563(_0xdd8bad);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 9e06cb8..71710ec 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 _0xd680=['extname','now','single','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xd680,0x87));var _0x0d68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd680[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0d68('0x0'));var util=require(_0x0d68('0x1'));var path=require(_0x0d68('0x2'));var timeout=require(_0x0d68('0x3'));var express=require(_0x0d68('0x4'));var router=express[_0x0d68('0x5')]();var fs_extra=require(_0x0d68('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0d68('0x7'));var config=require('../../config/environment');var controller=require(_0x0d68('0x8'));router[_0x0d68('0x9')]('/',auth['isAuthenticated'](),controller[_0x0d68('0xa')]);router[_0x0d68('0x9')](_0x0d68('0xb'),auth[_0x0d68('0xc')](),controller[_0x0d68('0xd')]);router['get'](_0x0d68('0xe'),auth[_0x0d68('0xc')](),controller[_0x0d68('0xf')]);var upload=multer({'storage':multer[_0x0d68('0x10')]({'destination':function(_0x26016b,_0x348646,_0x23e4c7){_0x23e4c7(null,path[_0x0d68('0x11')](config[_0x0d68('0x12')],_0x0d68('0x13')));},'filename':function(_0xac1f94,_0x1a6613,_0x1d8c2f){_0x1a6613[_0x0d68('0x14')]=_0x1a6613[_0x0d68('0x14')][_0x0d68('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d8c2f(null,util[_0x0d68('0x16')](_0x0d68('0x17'),path[_0x0d68('0x18')](_0x1a6613[_0x0d68('0x14')],path[_0x0d68('0x19')](_0x1a6613[_0x0d68('0x14')])),Date[_0x0d68('0x1a')](),path[_0x0d68('0x19')](_0x1a6613[_0x0d68('0x14')])));}})});router['post']('/',upload[_0x0d68('0x1b')]('file'),controller[_0x0d68('0x1c')]);router[_0x0d68('0x1d')](_0x0d68('0xb'),auth[_0x0d68('0xc')](),controller[_0x0d68('0x1e')]);router['delete'](_0x0d68('0xb'),auth[_0x0d68('0xc')](),controller[_0x0d68('0x1f')]);module['exports']=router; \ No newline at end of file +var _0xf5fe=['%s-%s%s','basename','extname','now','post','single','file','create','update','delete','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','join','server/files/sounds/original/','originalname','replace','format'];(function(_0x4ae731,_0x2a4968){var _0x387501=function(_0x44d53b){while(--_0x44d53b){_0x4ae731['push'](_0x4ae731['shift']());}};_0x387501(++_0x2a4968);}(_0xf5fe,0x82));var _0xef5f=function(_0x5f4cbc,_0x28fad7){_0x5f4cbc=_0x5f4cbc-0x0;var _0x3c7140=_0xf5fe[_0x5f4cbc];return _0x3c7140;};'use strict';var multer=require(_0xef5f('0x0'));var util=require(_0xef5f('0x1'));var path=require('path');var timeout=require(_0xef5f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xef5f('0x3'));var auth=require(_0xef5f('0x4'));var interaction=require(_0xef5f('0x5'));var config=require(_0xef5f('0x6'));var controller=require(_0xef5f('0x7'));router['get']('/',auth[_0xef5f('0x8')](),controller[_0xef5f('0x9')]);router[_0xef5f('0xa')](_0xef5f('0xb'),auth['isAuthenticated'](),controller[_0xef5f('0xc')]);router['get'](_0xef5f('0xd'),auth['isAuthenticated'](),controller[_0xef5f('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2d5fa6,_0x4dc4e8,_0x3544f3){_0x3544f3(null,path[_0xef5f('0xf')](config['root'],_0xef5f('0x10')));},'filename':function(_0x175c5c,_0x5d4844,_0x48539a){_0x5d4844[_0xef5f('0x11')]=_0x5d4844['originalname'][_0xef5f('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x48539a(null,util[_0xef5f('0x13')](_0xef5f('0x14'),path[_0xef5f('0x15')](_0x5d4844[_0xef5f('0x11')],path[_0xef5f('0x16')](_0x5d4844['originalname'])),Date[_0xef5f('0x17')](),path[_0xef5f('0x16')](_0x5d4844[_0xef5f('0x11')])));}})});router[_0xef5f('0x18')]('/',upload[_0xef5f('0x19')](_0xef5f('0x1a')),controller[_0xef5f('0x1b')]);router['put']('/:id',auth[_0xef5f('0x8')](),controller[_0xef5f('0x1c')]);router[_0xef5f('0x1d')](_0xef5f('0xb'),auth['isAuthenticated'](),controller[_0xef5f('0x1d')]);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 3f28fb5..dfc8997 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 _0x5ffb=['FLOAT','sequelize','exports','STRING','name','BIGINT','INTEGER'];(function(_0x573b7f,_0x38ffac){var _0x2ecd22=function(_0x50914c){while(--_0x50914c){_0x573b7f['push'](_0x573b7f['shift']());}};_0x2ecd22(++_0x38ffac);}(_0x5ffb,0xc5));var _0xb5ff=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5ffb[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xb5ff('0x0'));module[_0xb5ff('0x1')]={'name':{'type':Sequelize[_0xb5ff('0x2')],'unique':_0xb5ff('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xb5ff('0x2')]},'display_name':{'type':Sequelize[_0xb5ff('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xb5ff('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xb5ff('0x4')]},'original_channelCount':{'type':Sequelize[_0xb5ff('0x5')]},'original_bitRate':{'type':Sequelize[_0xb5ff('0x4')]},'original_sampleRate':{'type':Sequelize[_0xb5ff('0x5')]},'converted_format':{'type':Sequelize[_0xb5ff('0x2')]},'converted_duration':{'type':Sequelize[_0xb5ff('0x6')]},'converted_sampleCount':{'type':Sequelize[_0xb5ff('0x4')]},'converted_channelCount':{'type':Sequelize[_0xb5ff('0x5')]},'converted_bitRate':{'type':Sequelize[_0xb5ff('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf347=['BIGINT','INTEGER','sequelize','exports','STRING','name','FLOAT'];(function(_0x1a72bb,_0x48f3aa){var _0x217c22=function(_0x4b839e){while(--_0x4b839e){_0x1a72bb['push'](_0x1a72bb['shift']());}};_0x217c22(++_0x48f3aa);}(_0xf347,0xd4));var _0x7f34=function(_0xdec3ea,_0x5c1e64){_0xdec3ea=_0xdec3ea-0x0;var _0x27bbf0=_0xf347[_0xdec3ea];return _0x27bbf0;};'use strict';var Sequelize=require(_0x7f34('0x0'));module[_0x7f34('0x1')]={'name':{'type':Sequelize[_0x7f34('0x2')],'unique':_0x7f34('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x7f34('0x2')]},'display_name':{'type':Sequelize[_0x7f34('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x7f34('0x2')]},'original_format':{'type':Sequelize[_0x7f34('0x2')]},'original_duration':{'type':Sequelize[_0x7f34('0x4')]},'original_sampleCount':{'type':Sequelize[_0x7f34('0x5')]},'original_channelCount':{'type':Sequelize[_0x7f34('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x7f34('0x6')]},'converted_format':{'type':Sequelize[_0x7f34('0x2')]},'converted_duration':{'type':Sequelize[_0x7f34('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x7f34('0x6')]},'converted_bitRate':{'type':Sequelize[_0x7f34('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x7f34('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 68bc8e0..f7b738c 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 _0x0675=['converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','start','description','delete','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','type','merge','Sound','includeAll','include','findAll','catch','show','find','download','params','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','format','%s.%s','file','originalname','extname','basename','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0675,0x180));var _0x5067=function(_0x57a182,_0x5aa9e7){_0x57a182=_0x57a182-0x0;var _0x3b1e31=_0x0675[_0x57a182];return _0x3b1e31;};'use strict';var emlformat=require(_0x5067('0x0'));var rimraf=require(_0x5067('0x1'));var zipdir=require(_0x5067('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5067('0x3'));var moment=require(_0x5067('0x4'));var BPromise=require(_0x5067('0x5'));var Mustache=require(_0x5067('0x6'));var util=require(_0x5067('0x7'));var path=require(_0x5067('0x8'));var sox=require(_0x5067('0x9'));var csv=require(_0x5067('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5067('0xb'));var _=require(_0x5067('0xc'));var squel=require(_0x5067('0xd'));var crypto=require(_0x5067('0xe'));var jsforce=require(_0x5067('0xf'));var deskjs=require(_0x5067('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5067('0x11'));var Papa=require('papaparse');var Redis=require(_0x5067('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5067('0x13'));var hardwareService=require(_0x5067('0x14'));var logger=require(_0x5067('0x15'))(_0x5067('0x16'));var utils=require('../../config/utils');var config=require(_0x5067('0x17'));var licenseUtil=require(_0x5067('0x18'));var db=require(_0x5067('0x19'))['db'];function respondWithStatusCode(_0x1f87f9,_0x5b724c){_0x5b724c=_0x5b724c||0xcc;return function(_0xf644df){if(_0xf644df){return _0x1f87f9[_0x5067('0x1a')](_0x5b724c);}return _0x1f87f9['status'](_0x5b724c)[_0x5067('0x1b')]();};}function respondWithResult(_0x4a496e,_0x10c393){_0x10c393=_0x10c393||0xc8;return function(_0x4f0cd5){if(_0x4f0cd5){return _0x4a496e[_0x5067('0x1c')](_0x10c393)[_0x5067('0x1d')](_0x4f0cd5);}};}function respondWithFilteredResult(_0x17fc81,_0x5870c4){return function(_0x36edd8){if(_0x36edd8){var _0x30735a=_0x36edd8[_0x5067('0x1e')],_0x408456=_0x5870c4[_0x5067('0x1f')],_0x3d99e6=_0x5870c4[_0x5067('0x1f')]+_0x5870c4[_0x5067('0x20')],_0x5ceba9;if(_0x3d99e6>=_0x30735a){_0x3d99e6=_0x30735a;_0x5ceba9=0xc8;}else{_0x5ceba9=0xce;}_0x17fc81[_0x5067('0x1c')](_0x5ceba9);return _0x17fc81['set'](_0x5067('0x21'),_0x408456+'-'+_0x3d99e6+'/'+_0x30735a)[_0x5067('0x1d')](_0x36edd8);}return null;};}function patchUpdates(_0x5c8ee5){return function(_0x338a8f){try{jsonpatch[_0x5067('0x22')](_0x338a8f,_0x5c8ee5,!![]);}catch(_0x460411){return BPromise['reject'](_0x460411);}return _0x338a8f['save']();};}function saveUpdates(_0x3cccbb,_0x10559e){return function(_0x3e4ba9){if(_0x3e4ba9){return _0x3e4ba9[_0x5067('0x23')](_0x3cccbb)[_0x5067('0x24')](function(_0x1b6058){return _0x1b6058;});}return null;};}function removeEntity(_0x5f976b,_0x5a3917){return function(_0x51a79b){if(_0x51a79b){return _0x51a79b[_0x5067('0x25')]()[_0x5067('0x24')](function(){var _0x3df936=_0x51a79b[_0x5067('0x26')]({'plain':!![]});var _0x27ba9b=_0x5067('0x27');return db[_0x5067('0x28')][_0x5067('0x25')]({'where':{'type':_0x27ba9b,'resourceId':_0x3df936['id']}})[_0x5067('0x24')](function(){return _0x51a79b;});})[_0x5067('0x24')](function(){_0x5f976b[_0x5067('0x1c')](0xcc)[_0x5067('0x1b')]();});}};}function handleEntityNotFound(_0x5d86a6,_0x4cdfd1){return function(_0x7f7d74){if(!_0x7f7d74){_0x5d86a6[_0x5067('0x1a')](0x194);}return _0x7f7d74;};}function handleError(_0x4d6a20,_0x5b7080){_0x5b7080=_0x5b7080||0x1f4;return function(_0x2a30c0){logger[_0x5067('0x29')](_0x2a30c0[_0x5067('0x2a')]);if(_0x2a30c0['name']){delete _0x2a30c0[_0x5067('0x2b')];}_0x4d6a20[_0x5067('0x1c')](_0x5b7080)[_0x5067('0x2c')](_0x2a30c0);};}exports['index']=function(_0x4746c0,_0x3154ad){var _0x24d8c0={},_0x1f0bb9={},_0x1f026b={'count':0x0,'rows':[]};var _0x5b7b18=_['map'](db['Sound'][_0x5067('0x2d')],function(_0x1c91b0){return{'name':_0x1c91b0[_0x5067('0x2e')],'type':_0x1c91b0['type'][_0x5067('0x2f')]};});_0x1f0bb9[_0x5067('0x30')]=_[_0x5067('0x31')](_0x5b7b18,_0x5067('0x2b'));_0x1f0bb9[_0x5067('0x32')]=_[_0x5067('0x33')](_0x4746c0[_0x5067('0x32')]);_0x1f0bb9[_0x5067('0x34')]=_[_0x5067('0x35')](_0x1f0bb9[_0x5067('0x30')],_0x1f0bb9[_0x5067('0x32')]);_0x24d8c0[_0x5067('0x36')]=_['intersection'](_0x1f0bb9['model'],qs[_0x5067('0x37')](_0x4746c0[_0x5067('0x32')][_0x5067('0x37')]));_0x24d8c0[_0x5067('0x36')]=_0x24d8c0['attributes'][_0x5067('0x38')]?_0x24d8c0[_0x5067('0x36')]:_0x1f0bb9['model'];if(!_0x4746c0[_0x5067('0x32')]['hasOwnProperty']('nolimit')){_0x24d8c0['limit']=qs[_0x5067('0x20')](_0x4746c0['query'][_0x5067('0x20')]);_0x24d8c0[_0x5067('0x1f')]=qs[_0x5067('0x1f')](_0x4746c0[_0x5067('0x32')][_0x5067('0x1f')]);}_0x24d8c0['order']=qs[_0x5067('0x39')](_0x4746c0[_0x5067('0x32')][_0x5067('0x39')]);_0x24d8c0[_0x5067('0x3a')]=qs['filters'](_[_0x5067('0x3b')](_0x4746c0[_0x5067('0x32')],_0x1f0bb9[_0x5067('0x34')]),_0x5b7b18);if(_0x4746c0[_0x5067('0x32')][_0x5067('0x3c')]){_0x24d8c0[_0x5067('0x3a')]=_['merge'](_0x24d8c0[_0x5067('0x3a')],{'$or':_['map'](_0x5b7b18,function(_0x48805a){if(_0x48805a[_0x5067('0x3d')]!=='VIRTUAL'){var _0x23843a={};_0x23843a[_0x48805a[_0x5067('0x2b')]]={'$like':'%'+_0x4746c0[_0x5067('0x32')][_0x5067('0x3c')]+'%'};return _0x23843a;}})});}_0x24d8c0=_[_0x5067('0x3e')]({},_0x24d8c0,_0x4746c0['options']);var _0x225126={'where':_0x24d8c0['where']};return db[_0x5067('0x3f')][_0x5067('0x1e')](_0x225126)['then'](function(_0x2021ef){_0x1f026b['count']=_0x2021ef;if(_0x4746c0[_0x5067('0x32')][_0x5067('0x40')]){_0x24d8c0[_0x5067('0x41')]=[{'all':!![]}];}return db[_0x5067('0x3f')][_0x5067('0x42')](_0x24d8c0);})[_0x5067('0x24')](function(_0x3a476a){_0x1f026b['rows']=_0x3a476a;return _0x1f026b;})[_0x5067('0x24')](respondWithFilteredResult(_0x3154ad,_0x24d8c0))[_0x5067('0x43')](handleError(_0x3154ad,null));};exports[_0x5067('0x44')]=function(_0x178bb3,_0x6ff07a){var _0x47bc05={'raw':!![],'where':{'id':_0x178bb3['params']['id']}},_0x4a4e6c={};_0x4a4e6c[_0x5067('0x30')]=_[_0x5067('0x33')](db['Sound'][_0x5067('0x2d')]);_0x4a4e6c[_0x5067('0x32')]=_[_0x5067('0x33')](_0x178bb3['query']);_0x4a4e6c[_0x5067('0x34')]=_[_0x5067('0x35')](_0x4a4e6c[_0x5067('0x30')],_0x4a4e6c[_0x5067('0x32')]);_0x47bc05[_0x5067('0x36')]=_['intersection'](_0x4a4e6c[_0x5067('0x30')],qs[_0x5067('0x37')](_0x178bb3['query'][_0x5067('0x37')]));_0x47bc05[_0x5067('0x36')]=_0x47bc05[_0x5067('0x36')][_0x5067('0x38')]?_0x47bc05['attributes']:_0x4a4e6c[_0x5067('0x30')];if(_0x178bb3[_0x5067('0x32')][_0x5067('0x40')]){_0x47bc05[_0x5067('0x41')]=[{'all':!![]}];}_0x47bc05=_[_0x5067('0x3e')]({},_0x47bc05,_0x178bb3['options']);return db[_0x5067('0x3f')][_0x5067('0x45')](_0x47bc05)[_0x5067('0x24')](handleEntityNotFound(_0x6ff07a,null))[_0x5067('0x24')](respondWithResult(_0x6ff07a,null))['catch'](handleError(_0x6ff07a,null));};exports[_0x5067('0x46')]=function(_0x3d54d8,_0x5a97c1,_0x1fbc1c){return db[_0x5067('0x3f')]['find']({'where':{'id':_0x3d54d8[_0x5067('0x47')]['id']},'attributes':[_0x5067('0x2b'),'save_name',_0x5067('0x48')],'raw':!![]})[_0x5067('0x24')](handleEntityNotFound(_0x5a97c1,null))[_0x5067('0x24')](function(_0xfea1fb){if(_0xfea1fb){if(!fs[_0x5067('0x49')](path[_0x5067('0x4a')](config[_0x5067('0x4b')],_0x5067('0x4c'),_0xfea1fb[_0x5067('0x4d')]+'.'+_0xfea1fb[_0x5067('0x48')]))){throw new db['Sequelize']['ValidationError']('Sound\x20not\x20found');}return _0x5a97c1[_0x5067('0x46')](path[_0x5067('0x4a')](config[_0x5067('0x4b')],_0x5067('0x4c'),util[_0x5067('0x4e')](_0x5067('0x4f'),_0xfea1fb['save_name'],_0xfea1fb[_0x5067('0x48')])),util[_0x5067('0x4e')](_0x5067('0x4f'),_0xfea1fb['name'],_0xfea1fb[_0x5067('0x48')]));}return null;})[_0x5067('0x43')](handleError(_0x5a97c1,null));};exports['create']=function(_0x129248,_0x47489f,_0x53fe49){var _0x5968b1={'name':path['basename'](_0x129248[_0x5067('0x50')][_0x5067('0x51')],path[_0x5067('0x52')](_0x129248[_0x5067('0x50')]['originalname'])),'save_name':path[_0x5067('0x53')](_0x129248[_0x5067('0x50')][_0x5067('0x54')],path['extname'](_0x129248[_0x5067('0x50')]['filename'])),'original_format':path['extname'](_0x129248[_0x5067('0x50')][_0x5067('0x51')])[_0x5067('0x55')](0x1),'converted_format':_0x5067('0x56')};var _0x246209=path[_0x5067('0x4a')](config[_0x5067('0x4b')],_0x5067('0x57'),_0x129248[_0x5067('0x50')][_0x5067('0x54')]);var _0x52c28b=path[_0x5067('0x4a')](config['root'],'server/files/sounds/converted',util[_0x5067('0x4e')](_0x5067('0x4f'),path[_0x5067('0x53')](_0x129248[_0x5067('0x50')][_0x5067('0x54')],path['extname'](_0x129248[_0x5067('0x50')][_0x5067('0x54')])),_0x5968b1[_0x5067('0x48')]));logger['info'](_0x5067('0x58'),_0x246209);logger[_0x5067('0x59')](_0x5067('0x5a'),_0x52c28b);try{fs[_0x5067('0x5b')](_0x246209,parseInt(_0x5067('0x5c'),0x8));var _0x23f7fc=sox[_0x5067('0x5d')](_0x246209,_0x52c28b,{'sampleRate':0x1f40,'format':_0x5067('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x23f7fc['on'](_0x5067('0x29'),function(_0x244dbb){fs[_0x5067('0x5e')](_0x246209);_0x47489f['status'](0x1f4)[_0x5067('0x2c')](_0x244dbb);});_0x23f7fc['on'](_0x5067('0x5f'),function(_0x1705ee){_0x5968b1[_0x5067('0x60')]=isNaN(_0x1705ee[_0x5067('0x61')])?null:_0x1705ee[_0x5067('0x61')]*0x3e8;_0x5968b1[_0x5067('0x62')]=isNaN(_0x1705ee[_0x5067('0x63')])?null:_0x1705ee[_0x5067('0x63')];_0x5968b1[_0x5067('0x64')]=isNaN(_0x1705ee[_0x5067('0x65')])?null:_0x1705ee[_0x5067('0x65')];_0x5968b1['original_bitRate']=isNaN(_0x1705ee['bitRate'])?null:_0x1705ee[_0x5067('0x66')];_0x5968b1[_0x5067('0x67')]=isNaN(_0x1705ee[_0x5067('0x68')])?null:_0x1705ee[_0x5067('0x68')];});_0x23f7fc['on'](_0x5067('0x69'),function(_0xbbab8b){_0x5968b1[_0x5067('0x6a')]=isNaN(_0xbbab8b[_0x5067('0x61')])?null:_0xbbab8b[_0x5067('0x61')]*0x3e8;_0x5968b1[_0x5067('0x6b')]=isNaN(_0xbbab8b[_0x5067('0x63')])?null:_0xbbab8b[_0x5067('0x63')];_0x5968b1[_0x5067('0x6c')]=isNaN(_0xbbab8b['channelCount'])?null:_0xbbab8b[_0x5067('0x65')];_0x5968b1[_0x5067('0x6d')]=isNaN(_0xbbab8b['bitRate'])?null:_0xbbab8b['bitRate'];_0x5968b1[_0x5067('0x6e')]=isNaN(_0xbbab8b[_0x5067('0x68')])?null:_0xbbab8b[_0x5067('0x68')];});_0x23f7fc['on'](_0x5067('0x1b'),function(){fs['chmodSync'](_0x52c28b,parseInt(_0x5067('0x5c'),0x8));return db[_0x5067('0x3f')]['create'](_0x5968b1)[_0x5067('0x24')](function(_0x45e551){var _0x575a73={'role':_0x129248['body'][_0x5067('0x6f')],'userProfileId':_0x129248[_0x5067('0x70')][_0x5067('0x71')]};if(!_0x575a73)throw new Error(_0x5067('0x72'));if(_0x575a73[_0x5067('0x6f')]===_0x5067('0x73')){var _0x5caedc=_0x45e551[_0x5067('0x26')]({'plain':!![]});return db[_0x5067('0x74')][_0x5067('0x45')]({'where':{'name':'Sounds','userProfileId':_0x575a73[_0x5067('0x71')]},'raw':!![]})[_0x5067('0x24')](function(_0x19610c){if(_0x19610c&&_0x19610c[_0x5067('0x75')]===0x0){return db[_0x5067('0x28')][_0x5067('0x76')]({'name':_0x5caedc[_0x5067('0x2b')],'resourceId':_0x5caedc['id'],'type':_0x19610c[_0x5067('0x2b')],'sectionId':_0x19610c['id']},{})[_0x5067('0x24')](function(){return _0x45e551;});}else{return _0x45e551;}})[_0x5067('0x43')](function(_0x574b0c){logger[_0x5067('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x574b0c);throw _0x574b0c;});}return _0x45e551;})[_0x5067('0x24')](respondWithResult(_0x47489f,null))[_0x5067('0x43')](handleError(_0x47489f,null));});_0x23f7fc[_0x5067('0x77')]();}catch(_0x5c4979){_0x47489f[_0x5067('0x1c')](0x1f4)['send'](_0x5c4979);}};exports[_0x5067('0x23')]=function(_0x403d78,_0x52f3ff,_0x4f32ce){return db[_0x5067('0x3f')][_0x5067('0x45')]({'where':{'id':_0x403d78['params']['id']}})[_0x5067('0x24')](handleEntityNotFound(_0x52f3ff,null))[_0x5067('0x24')](saveUpdates(_[_0x5067('0x3b')](_0x403d78[_0x5067('0x70')],[_0x5067('0x2b'),_0x5067('0x78')]),null))['then'](respondWithResult(_0x52f3ff,null))[_0x5067('0x43')](handleError(_0x52f3ff,null));};exports[_0x5067('0x79')]=function(_0x108f89,_0x2e1f00,_0x4f5792){return db['Sound'][_0x5067('0x45')]({'where':{'id':_0x108f89[_0x5067('0x47')]['id']}})[_0x5067('0x24')](function(_0x433a19){if(_0x433a19){return _0x433a19[_0x5067('0x25')]();}})[_0x5067('0x24')](function(_0x511345){var _0x1a862e=path['join'](config['root'],_0x5067('0x57'),util[_0x5067('0x4e')](_0x5067('0x4f'),_0x511345[_0x5067('0x4d')],_0x511345[_0x5067('0x7a')]));var _0x29d668=path[_0x5067('0x4a')](config[_0x5067('0x4b')],_0x5067('0x4c'),util['format'](_0x5067('0x4f'),_0x511345['save_name'],_0x511345[_0x5067('0x48')]));fs[_0x5067('0x5e')](_0x1a862e);fs[_0x5067('0x5e')](_0x29d668);return _0x511345;})['then'](function(_0x3f37f4){if(_0x3f37f4){return _0x2e1f00[_0x5067('0x1c')](0xcc)[_0x5067('0x1b')]();}})['then'](handleEntityNotFound(_0x2e1f00,null))[_0x5067('0x43')](handleError(_0x2e1f00,null));}; \ No newline at end of file +var _0x2748=['existsSync','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','end','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Sounds','UserProfileResource','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Sound','include','catch','show','params','length','includeAll','download','find','save_name'];(function(_0xb57a1f,_0x505fe8){var _0x558851=function(_0x293226){while(--_0x293226){_0xb57a1f['push'](_0xb57a1f['shift']());}};_0x558851(++_0x505fe8);}(_0x2748,0x130));var _0x8274=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2748[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x8274('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8274('0x1'));var jsonpatch=require(_0x8274('0x2'));var rp=require(_0x8274('0x3'));var moment=require('moment');var BPromise=require(_0x8274('0x4'));var Mustache=require(_0x8274('0x5'));var util=require(_0x8274('0x6'));var path=require('path');var sox=require(_0x8274('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8274('0x8'));var _=require(_0x8274('0x9'));var squel=require('squel');var crypto=require(_0x8274('0xa'));var jsforce=require(_0x8274('0xb'));var deskjs=require(_0x8274('0xc'));var toCsv=require(_0x8274('0xd'));var querystring=require(_0x8274('0xe'));var Papa=require(_0x8274('0xf'));var Redis=require(_0x8274('0x10'));var authService=require(_0x8274('0x11'));var qs=require(_0x8274('0x12'));var as=require(_0x8274('0x13'));var hardwareService=require(_0x8274('0x14'));var logger=require('../../config/logger')(_0x8274('0x15'));var utils=require(_0x8274('0x16'));var config=require(_0x8274('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23f0a1,_0x4d9bc4){_0x4d9bc4=_0x4d9bc4||0xcc;return function(_0x1e0d42){if(_0x1e0d42){return _0x23f0a1[_0x8274('0x18')](_0x4d9bc4);}return _0x23f0a1[_0x8274('0x19')](_0x4d9bc4)['end']();};}function respondWithResult(_0x372a5f,_0x184e4a){_0x184e4a=_0x184e4a||0xc8;return function(_0x4fbd0a){if(_0x4fbd0a){return _0x372a5f[_0x8274('0x19')](_0x184e4a)[_0x8274('0x1a')](_0x4fbd0a);}};}function respondWithFilteredResult(_0x3a60db,_0x4ecd18){return function(_0x7b5f21){if(_0x7b5f21){var _0x285dc1=_0x7b5f21[_0x8274('0x1b')],_0x482215=_0x4ecd18[_0x8274('0x1c')],_0x4cbcbd=_0x4ecd18[_0x8274('0x1c')]+_0x4ecd18[_0x8274('0x1d')],_0x292e32;if(_0x4cbcbd>=_0x285dc1){_0x4cbcbd=_0x285dc1;_0x292e32=0xc8;}else{_0x292e32=0xce;}_0x3a60db['status'](_0x292e32);return _0x3a60db[_0x8274('0x1e')](_0x8274('0x1f'),_0x482215+'-'+_0x4cbcbd+'/'+_0x285dc1)[_0x8274('0x1a')](_0x7b5f21);}return null;};}function patchUpdates(_0xb0e2b7){return function(_0x47e5fa){try{jsonpatch[_0x8274('0x20')](_0x47e5fa,_0xb0e2b7,!![]);}catch(_0x2f413a){return BPromise[_0x8274('0x21')](_0x2f413a);}return _0x47e5fa[_0x8274('0x22')]();};}function saveUpdates(_0x591f54,_0x21f964){return function(_0x1a7582){if(_0x1a7582){return _0x1a7582[_0x8274('0x23')](_0x591f54)['then'](function(_0x55989e){return _0x55989e;});}return null;};}function removeEntity(_0x1c760a,_0x576b6b){return function(_0x115d72){if(_0x115d72){return _0x115d72['destroy']()[_0x8274('0x24')](function(){var _0x43fa58=_0x115d72[_0x8274('0x25')]({'plain':!![]});var _0x5b9c3e=_0x8274('0x26');return db[_0x8274('0x27')][_0x8274('0x28')]({'where':{'type':_0x5b9c3e,'resourceId':_0x43fa58['id']}})['then'](function(){return _0x115d72;});})[_0x8274('0x24')](function(){_0x1c760a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5477a2,_0x24eb15){return function(_0x41951b){if(!_0x41951b){_0x5477a2[_0x8274('0x18')](0x194);}return _0x41951b;};}function handleError(_0x484e75,_0x28e55e){_0x28e55e=_0x28e55e||0x1f4;return function(_0x729e8c){logger[_0x8274('0x29')](_0x729e8c[_0x8274('0x2a')]);if(_0x729e8c['name']){delete _0x729e8c[_0x8274('0x2b')];}_0x484e75[_0x8274('0x19')](_0x28e55e)['send'](_0x729e8c);};}exports[_0x8274('0x2c')]=function(_0xfcab6f,_0x3e0425){var _0x9a953e={},_0x5e5301={},_0xac2b7f={'count':0x0,'rows':[]};var _0x2c1b23=_['map'](db['Sound'][_0x8274('0x2d')],function(_0x1f5605){return{'name':_0x1f5605[_0x8274('0x2e')],'type':_0x1f5605[_0x8274('0x2f')][_0x8274('0x30')]};});_0x5e5301['model']=_[_0x8274('0x31')](_0x2c1b23,_0x8274('0x2b'));_0x5e5301[_0x8274('0x32')]=_[_0x8274('0x33')](_0xfcab6f[_0x8274('0x32')]);_0x5e5301[_0x8274('0x34')]=_[_0x8274('0x35')](_0x5e5301[_0x8274('0x36')],_0x5e5301['query']);_0x9a953e['attributes']=_[_0x8274('0x35')](_0x5e5301[_0x8274('0x36')],qs[_0x8274('0x37')](_0xfcab6f['query'][_0x8274('0x37')]));_0x9a953e[_0x8274('0x38')]=_0x9a953e[_0x8274('0x38')]['length']?_0x9a953e[_0x8274('0x38')]:_0x5e5301[_0x8274('0x36')];if(!_0xfcab6f[_0x8274('0x32')][_0x8274('0x39')](_0x8274('0x3a'))){_0x9a953e[_0x8274('0x1d')]=qs[_0x8274('0x1d')](_0xfcab6f[_0x8274('0x32')]['limit']);_0x9a953e[_0x8274('0x1c')]=qs['offset'](_0xfcab6f[_0x8274('0x32')][_0x8274('0x1c')]);}_0x9a953e[_0x8274('0x3b')]=qs[_0x8274('0x3c')](_0xfcab6f[_0x8274('0x32')][_0x8274('0x3c')]);_0x9a953e[_0x8274('0x3d')]=qs[_0x8274('0x34')](_[_0x8274('0x3e')](_0xfcab6f['query'],_0x5e5301[_0x8274('0x34')]),_0x2c1b23);if(_0xfcab6f[_0x8274('0x32')][_0x8274('0x3f')]){_0x9a953e[_0x8274('0x3d')]=_[_0x8274('0x40')](_0x9a953e[_0x8274('0x3d')],{'$or':_['map'](_0x2c1b23,function(_0x46d744){if(_0x46d744['type']!==_0x8274('0x41')){var _0x47740d={};_0x47740d[_0x46d744[_0x8274('0x2b')]]={'$like':'%'+_0xfcab6f[_0x8274('0x32')]['filter']+'%'};return _0x47740d;}})});}_0x9a953e=_['merge']({},_0x9a953e,_0xfcab6f[_0x8274('0x42')]);var _0x26ec38={'where':_0x9a953e[_0x8274('0x3d')]};return db[_0x8274('0x43')][_0x8274('0x1b')](_0x26ec38)[_0x8274('0x24')](function(_0x35af5f){_0xac2b7f[_0x8274('0x1b')]=_0x35af5f;if(_0xfcab6f['query']['includeAll']){_0x9a953e[_0x8274('0x44')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x9a953e);})[_0x8274('0x24')](function(_0x24da69){_0xac2b7f['rows']=_0x24da69;return _0xac2b7f;})[_0x8274('0x24')](respondWithFilteredResult(_0x3e0425,_0x9a953e))[_0x8274('0x45')](handleError(_0x3e0425,null));};exports[_0x8274('0x46')]=function(_0x386350,_0x285c50){var _0x2c641e={'raw':!![],'where':{'id':_0x386350[_0x8274('0x47')]['id']}},_0x24d674={};_0x24d674[_0x8274('0x36')]=_['keys'](db['Sound'][_0x8274('0x2d')]);_0x24d674[_0x8274('0x32')]=_['keys'](_0x386350[_0x8274('0x32')]);_0x24d674[_0x8274('0x34')]=_['intersection'](_0x24d674[_0x8274('0x36')],_0x24d674[_0x8274('0x32')]);_0x2c641e['attributes']=_[_0x8274('0x35')](_0x24d674[_0x8274('0x36')],qs[_0x8274('0x37')](_0x386350['query']['fields']));_0x2c641e[_0x8274('0x38')]=_0x2c641e[_0x8274('0x38')][_0x8274('0x48')]?_0x2c641e[_0x8274('0x38')]:_0x24d674[_0x8274('0x36')];if(_0x386350[_0x8274('0x32')][_0x8274('0x49')]){_0x2c641e[_0x8274('0x44')]=[{'all':!![]}];}_0x2c641e=_[_0x8274('0x40')]({},_0x2c641e,_0x386350['options']);return db[_0x8274('0x43')]['find'](_0x2c641e)[_0x8274('0x24')](handleEntityNotFound(_0x285c50,null))[_0x8274('0x24')](respondWithResult(_0x285c50,null))[_0x8274('0x45')](handleError(_0x285c50,null));};exports[_0x8274('0x4a')]=function(_0x14a274,_0x3b576e,_0x5f2776){return db[_0x8274('0x43')][_0x8274('0x4b')]({'where':{'id':_0x14a274[_0x8274('0x47')]['id']},'attributes':[_0x8274('0x2b'),_0x8274('0x4c'),'converted_format'],'raw':!![]})[_0x8274('0x24')](handleEntityNotFound(_0x3b576e,null))[_0x8274('0x24')](function(_0x5136f7){if(_0x5136f7){if(!fs[_0x8274('0x4d')](path['join'](config[_0x8274('0x4e')],_0x8274('0x4f'),_0x5136f7['save_name']+'.'+_0x5136f7[_0x8274('0x50')]))){throw new db[(_0x8274('0x51'))][(_0x8274('0x52'))](_0x8274('0x53'));}return _0x3b576e['download'](path[_0x8274('0x54')](config[_0x8274('0x4e')],'server/files/sounds/converted',util[_0x8274('0x55')](_0x8274('0x56'),_0x5136f7[_0x8274('0x4c')],_0x5136f7[_0x8274('0x50')])),util[_0x8274('0x55')](_0x8274('0x56'),_0x5136f7['name'],_0x5136f7[_0x8274('0x50')]));}return null;})[_0x8274('0x45')](handleError(_0x3b576e,null));};exports[_0x8274('0x57')]=function(_0x274b39,_0x2b863f,_0x4a533e){var _0x197344={'name':path[_0x8274('0x58')](_0x274b39[_0x8274('0x59')][_0x8274('0x5a')],path[_0x8274('0x5b')](_0x274b39[_0x8274('0x59')][_0x8274('0x5a')])),'save_name':path[_0x8274('0x58')](_0x274b39[_0x8274('0x59')][_0x8274('0x5c')],path[_0x8274('0x5b')](_0x274b39[_0x8274('0x59')][_0x8274('0x5c')])),'original_format':path['extname'](_0x274b39['file'][_0x8274('0x5a')])['substring'](0x1),'converted_format':_0x8274('0x5d')};var _0x622f18=path[_0x8274('0x54')](config[_0x8274('0x4e')],_0x8274('0x5e'),_0x274b39[_0x8274('0x59')][_0x8274('0x5c')]);var _0x9ea82e=path[_0x8274('0x54')](config[_0x8274('0x4e')],_0x8274('0x4f'),util[_0x8274('0x55')](_0x8274('0x56'),path[_0x8274('0x58')](_0x274b39[_0x8274('0x59')][_0x8274('0x5c')],path[_0x8274('0x5b')](_0x274b39[_0x8274('0x59')]['filename'])),_0x197344[_0x8274('0x50')]));logger[_0x8274('0x5f')]('Sound\x20upload\x20filepath:\x20%s',_0x622f18);logger[_0x8274('0x5f')](_0x8274('0x60'),_0x9ea82e);try{fs[_0x8274('0x61')](_0x622f18,parseInt(_0x8274('0x62'),0x8));var _0x575a5e=sox['transcode'](_0x622f18,_0x9ea82e,{'sampleRate':0x1f40,'format':_0x8274('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x575a5e['on'](_0x8274('0x29'),function(_0x359f93){fs[_0x8274('0x63')](_0x622f18);_0x2b863f[_0x8274('0x19')](0x1f4)['send'](_0x359f93);});_0x575a5e['on']('src',function(_0x32b013){_0x197344[_0x8274('0x64')]=isNaN(_0x32b013[_0x8274('0x65')])?null:_0x32b013[_0x8274('0x65')]*0x3e8;_0x197344[_0x8274('0x66')]=isNaN(_0x32b013['sampleCount'])?null:_0x32b013[_0x8274('0x67')];_0x197344[_0x8274('0x68')]=isNaN(_0x32b013['channelCount'])?null:_0x32b013[_0x8274('0x69')];_0x197344[_0x8274('0x6a')]=isNaN(_0x32b013[_0x8274('0x6b')])?null:_0x32b013['bitRate'];_0x197344['original_sampleRate']=isNaN(_0x32b013[_0x8274('0x6c')])?null:_0x32b013['sampleRate'];});_0x575a5e['on'](_0x8274('0x6d'),function(_0x23caf9){_0x197344[_0x8274('0x6e')]=isNaN(_0x23caf9['duration'])?null:_0x23caf9[_0x8274('0x65')]*0x3e8;_0x197344['converted_sampleCount']=isNaN(_0x23caf9[_0x8274('0x67')])?null:_0x23caf9[_0x8274('0x67')];_0x197344[_0x8274('0x6f')]=isNaN(_0x23caf9[_0x8274('0x69')])?null:_0x23caf9[_0x8274('0x69')];_0x197344[_0x8274('0x70')]=isNaN(_0x23caf9[_0x8274('0x6b')])?null:_0x23caf9['bitRate'];_0x197344[_0x8274('0x71')]=isNaN(_0x23caf9['sampleRate'])?null:_0x23caf9['sampleRate'];});_0x575a5e['on'](_0x8274('0x72'),function(){fs[_0x8274('0x61')](_0x9ea82e,parseInt('0777',0x8));return db['Sound'][_0x8274('0x57')](_0x197344)[_0x8274('0x24')](function(_0x5f3bf5){var _0x4ec352={'role':_0x274b39[_0x8274('0x73')]['role'],'userProfileId':_0x274b39['body'][_0x8274('0x74')]};if(!_0x4ec352)throw new Error(_0x8274('0x75'));if(_0x4ec352[_0x8274('0x76')]===_0x8274('0x77')){var _0x3cac36=_0x5f3bf5[_0x8274('0x25')]({'plain':!![]});return db[_0x8274('0x78')][_0x8274('0x4b')]({'where':{'name':_0x8274('0x26'),'userProfileId':_0x4ec352[_0x8274('0x74')]},'raw':!![]})[_0x8274('0x24')](function(_0x5afa77){if(_0x5afa77&&_0x5afa77[_0x8274('0x79')]===0x0){return db['UserProfileResource'][_0x8274('0x57')]({'name':_0x3cac36['name'],'resourceId':_0x3cac36['id'],'type':_0x5afa77[_0x8274('0x2b')],'sectionId':_0x5afa77['id']},{})[_0x8274('0x24')](function(){return _0x5f3bf5;});}else{return _0x5f3bf5;}})[_0x8274('0x45')](function(_0x3a1974){logger[_0x8274('0x29')](_0x8274('0x7a'),_0x3a1974);throw _0x3a1974;});}return _0x5f3bf5;})[_0x8274('0x24')](respondWithResult(_0x2b863f,null))[_0x8274('0x45')](handleError(_0x2b863f,null));});_0x575a5e[_0x8274('0x7b')]();}catch(_0x1b7d6d){_0x2b863f['status'](0x1f4)['send'](_0x1b7d6d);}};exports[_0x8274('0x23')]=function(_0x40549d,_0x4b4b85,_0x32f1a1){return db[_0x8274('0x43')][_0x8274('0x4b')]({'where':{'id':_0x40549d[_0x8274('0x47')]['id']}})[_0x8274('0x24')](handleEntityNotFound(_0x4b4b85,null))['then'](saveUpdates(_[_0x8274('0x3e')](_0x40549d[_0x8274('0x73')],[_0x8274('0x2b'),_0x8274('0x7c')]),null))[_0x8274('0x24')](respondWithResult(_0x4b4b85,null))[_0x8274('0x45')](handleError(_0x4b4b85,null));};exports[_0x8274('0x7d')]=function(_0x52e090,_0x2af336,_0x2acf7f){return db[_0x8274('0x43')][_0x8274('0x4b')]({'where':{'id':_0x52e090[_0x8274('0x47')]['id']}})[_0x8274('0x24')](function(_0x57a3e7){if(_0x57a3e7){return _0x57a3e7[_0x8274('0x28')]();}})[_0x8274('0x24')](function(_0x47efe1){var _0x4af7ea=path[_0x8274('0x54')](config[_0x8274('0x4e')],'server/files/sounds/original',util[_0x8274('0x55')]('%s.%s',_0x47efe1[_0x8274('0x4c')],_0x47efe1[_0x8274('0x7e')]));var _0x22b69c=path[_0x8274('0x54')](config[_0x8274('0x4e')],_0x8274('0x4f'),util[_0x8274('0x55')](_0x8274('0x56'),_0x47efe1[_0x8274('0x4c')],_0x47efe1[_0x8274('0x50')]));fs['unlinkSync'](_0x4af7ea);fs[_0x8274('0x63')](_0x22b69c);return _0x47efe1;})[_0x8274('0x24')](function(_0x2a789d){if(_0x2a789d){return _0x2af336[_0x8274('0x19')](0xcc)[_0x8274('0x72')]();}})[_0x8274('0x24')](handleEntityNotFound(_0x2af336,null))[_0x8274('0x45')](handleError(_0x2af336,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 4fe385b..6b0f56d 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 _0x9e77=['request-promise','path','rimraf','./sound.attributes','define','Sound','tools_sounds','lodash','util','../../config/logger','api','bluebird'];(function(_0xe894bd,_0x43a96e){var _0x467659=function(_0x1c77f4){while(--_0x1c77f4){_0xe894bd['push'](_0xe894bd['shift']());}};_0x467659(++_0x43a96e);}(_0x9e77,0xeb));var _0x79e7=function(_0x1fd65d,_0x59e997){_0x1fd65d=_0x1fd65d-0x0;var _0x4f416e=_0x9e77[_0x1fd65d];return _0x4f416e;};'use strict';var _=require(_0x79e7('0x0'));var util=require(_0x79e7('0x1'));var logger=require(_0x79e7('0x2'))(_0x79e7('0x3'));var moment=require('moment');var BPromise=require(_0x79e7('0x4'));var rp=require(_0x79e7('0x5'));var fs=require('fs');var path=require(_0x79e7('0x6'));var rimraf=require(_0x79e7('0x7'));var config=require('../../config/environment');var attributes=require(_0x79e7('0x8'));module['exports']=function(_0x46d49d,_0x4c4274){return _0x46d49d[_0x79e7('0x9')](_0x79e7('0xa'),attributes,{'tableName':_0x79e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe174=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash'];(function(_0x3eac13,_0x23fcd8){var _0x37eb99=function(_0x3545bd){while(--_0x3545bd){_0x3eac13['push'](_0x3eac13['shift']());}};_0x37eb99(++_0x23fcd8);}(_0xe174,0x141));var _0x4e17=function(_0x28a80e,_0x2127ee){_0x28a80e=_0x28a80e-0x0;var _0x59c8cb=_0xe174[_0x28a80e];return _0x59c8cb;};'use strict';var _=require(_0x4e17('0x0'));var util=require(_0x4e17('0x1'));var logger=require(_0x4e17('0x2'))(_0x4e17('0x3'));var moment=require(_0x4e17('0x4'));var BPromise=require('bluebird');var rp=require(_0x4e17('0x5'));var fs=require('fs');var path=require(_0x4e17('0x6'));var rimraf=require(_0x4e17('0x7'));var config=require(_0x4e17('0x8'));var attributes=require(_0x4e17('0x9'));module[_0x4e17('0xa')]=function(_0x23d71d,_0x335bd2){return _0x23d71d[_0x4e17('0xb')](_0x4e17('0xc'),attributes,{'tableName':_0x4e17('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index ccbc039..a7dd790 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 _0x9c5f=['../../config/environment','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','raw','map','include','model','attributes','ShowSound','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x8770bd,_0x4d6cfd){var _0x54119c=function(_0x549b09){while(--_0x549b09){_0x8770bd['push'](_0x8770bd['shift']());}};_0x54119c(++_0x4d6cfd);}(_0x9c5f,0x1bb));var _0xf9c5=function(_0x55c3df,_0x3cb324){_0x55c3df=_0x55c3df-0x0;var _0x2eafae=_0x9c5f[_0x55c3df];return _0x2eafae;};'use strict';var _=require(_0xf9c5('0x0'));var util=require(_0xf9c5('0x1'));var moment=require(_0xf9c5('0x2'));var BPromise=require('bluebird');var rs=require(_0xf9c5('0x3'));var fs=require('fs');var Redis=require(_0xf9c5('0x4'));var db=require(_0xf9c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9c5('0x6'))('rpc');var config=require(_0xf9c5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf9c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x539be8,_0x515b7e,_0x2c82f0){return new BPromise(function(_0x5b2a4b,_0x630e7e){return client[_0xf9c5('0x9')](_0x539be8,_0x2c82f0)[_0xf9c5('0xa')](function(_0x2839d9){logger[_0xf9c5('0xb')](_0xf9c5('0xc'),_0x515b7e,_0xf9c5('0xd'));logger[_0xf9c5('0xe')](_0xf9c5('0xf'),_0x515b7e,_0xf9c5('0xd'),JSON[_0xf9c5('0x10')](_0x2839d9));if(_0x2839d9[_0xf9c5('0x11')]){if(_0x2839d9[_0xf9c5('0x11')][_0xf9c5('0x12')]===0x1f4){logger[_0xf9c5('0x11')](_0xf9c5('0xc'),_0x515b7e,_0x2839d9[_0xf9c5('0x11')][_0xf9c5('0x13')]);return _0x630e7e(_0x2839d9[_0xf9c5('0x11')][_0xf9c5('0x13')]);}logger[_0xf9c5('0x11')]('Sound,\x20%s,\x20%s',_0x515b7e,_0x2839d9['error'][_0xf9c5('0x13')]);return _0x5b2a4b(_0x2839d9[_0xf9c5('0x11')][_0xf9c5('0x13')]);}else{logger[_0xf9c5('0xb')](_0xf9c5('0xc'),_0x515b7e,_0xf9c5('0xd'));_0x5b2a4b(_0x2839d9[_0xf9c5('0x14')][_0xf9c5('0x13')]);}})[_0xf9c5('0x15')](function(_0x3dc88d){logger[_0xf9c5('0x11')]('Sound,\x20%s,\x20%s',_0x515b7e,_0x3dc88d);_0x630e7e(_0x3dc88d);});});}exports['ShowSound']=function(_0x1db2f9){var _0x1d05b2=this;return new Promise(function(_0x263a19,_0x852a5e){return db['Sound'][_0xf9c5('0x16')]({'raw':_0x1db2f9[_0xf9c5('0x17')]?_0x1db2f9[_0xf9c5('0x17')][_0xf9c5('0x18')]===undefined?!![]:![]:!![],'where':_0x1db2f9[_0xf9c5('0x17')]?_0x1db2f9['options']['where']||null:null,'attributes':_0x1db2f9[_0xf9c5('0x17')]?_0x1db2f9['options']['attributes']||null:null,'include':_0x1db2f9['options']?_0x1db2f9['options']['include']?_[_0xf9c5('0x19')](_0x1db2f9[_0xf9c5('0x17')][_0xf9c5('0x1a')],function(_0x2a5f6f){return{'model':db[_0x2a5f6f[_0xf9c5('0x1b')]],'as':_0x2a5f6f['as'],'attributes':_0x2a5f6f[_0xf9c5('0x1c')],'include':_0x2a5f6f[_0xf9c5('0x1a')]?_['map'](_0x2a5f6f['include'],function(_0x517c11){return{'model':db[_0x517c11['model']],'as':_0x517c11['as'],'attributes':_0x517c11[_0xf9c5('0x1c')],'include':_0x517c11[_0xf9c5('0x1a')]?_[_0xf9c5('0x19')](_0x517c11[_0xf9c5('0x1a')],function(_0x381b94){return{'model':db[_0x381b94[_0xf9c5('0x1b')]],'as':_0x381b94['as'],'attributes':_0x381b94[_0xf9c5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf9c5('0xa')](function(_0x173c50){logger[_0xf9c5('0xb')](_0xf9c5('0x1d'),_0x1db2f9);logger[_0xf9c5('0xe')](_0xf9c5('0x1d'),_0x1db2f9,JSON[_0xf9c5('0x10')](_0x173c50));_0x263a19(_0x173c50);})[_0xf9c5('0x15')](function(_0x18b7d3){logger[_0xf9c5('0x11')]('ShowSound',_0x18b7d3[_0xf9c5('0x13')],_0x1db2f9);_0x852a5e(_0x1d05b2[_0xf9c5('0x11')](0x1f4,_0x18b7d3[_0xf9c5('0x13')]));});});}; \ No newline at end of file +var _0x5503=['options','raw','where','attributes','include','map','model','ShowSound','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','Sound'];(function(_0xfd9b19,_0x21d75f){var _0x514918=function(_0x52e212){while(--_0x52e212){_0xfd9b19['push'](_0xfd9b19['shift']());}};_0x514918(++_0x21d75f);}(_0x5503,0xbd));var _0x3550=function(_0x1a48be,_0x4ecfeb){_0x1a48be=_0x1a48be-0x0;var _0xb65ce2=_0x5503[_0x1a48be];return _0xb65ce2;};'use strict';var _=require('lodash');var util=require(_0x3550('0x0'));var moment=require(_0x3550('0x1'));var BPromise=require(_0x3550('0x2'));var rs=require(_0x3550('0x3'));var fs=require('fs');var Redis=require(_0x3550('0x4'));var db=require(_0x3550('0x5'))['db'];var utils=require(_0x3550('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3550('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3550('0x8')][_0x3550('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x194260,_0x4632b9,_0x271eb0){return new BPromise(function(_0x695ff3,_0x3220aa){return client[_0x3550('0xa')](_0x194260,_0x271eb0)[_0x3550('0xb')](function(_0x15fe1e){logger[_0x3550('0xc')](_0x3550('0xd'),_0x4632b9,_0x3550('0xe'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x4632b9,'request\x20sent',JSON['stringify'](_0x15fe1e));if(_0x15fe1e[_0x3550('0xf')]){if(_0x15fe1e[_0x3550('0xf')][_0x3550('0x10')]===0x1f4){logger[_0x3550('0xf')](_0x3550('0xd'),_0x4632b9,_0x15fe1e[_0x3550('0xf')][_0x3550('0x11')]);return _0x3220aa(_0x15fe1e[_0x3550('0xf')][_0x3550('0x11')]);}logger[_0x3550('0xf')](_0x3550('0xd'),_0x4632b9,_0x15fe1e[_0x3550('0xf')][_0x3550('0x11')]);return _0x695ff3(_0x15fe1e[_0x3550('0xf')][_0x3550('0x11')]);}else{logger[_0x3550('0xc')](_0x3550('0xd'),_0x4632b9,_0x3550('0xe'));_0x695ff3(_0x15fe1e[_0x3550('0x12')][_0x3550('0x11')]);}})[_0x3550('0x13')](function(_0x29fc57){logger['error'](_0x3550('0xd'),_0x4632b9,_0x29fc57);_0x3220aa(_0x29fc57);});});}exports['ShowSound']=function(_0x2ae7d2){var _0x52ad94=this;return new Promise(function(_0xfdacc8,_0x4d46b9){return db[_0x3550('0x14')]['find']({'raw':_0x2ae7d2['options']?_0x2ae7d2[_0x3550('0x15')][_0x3550('0x16')]===undefined?!![]:![]:!![],'where':_0x2ae7d2['options']?_0x2ae7d2[_0x3550('0x15')][_0x3550('0x17')]||null:null,'attributes':_0x2ae7d2[_0x3550('0x15')]?_0x2ae7d2[_0x3550('0x15')][_0x3550('0x18')]||null:null,'include':_0x2ae7d2[_0x3550('0x15')]?_0x2ae7d2[_0x3550('0x15')][_0x3550('0x19')]?_['map'](_0x2ae7d2['options'][_0x3550('0x19')],function(_0x1fda37){return{'model':db[_0x1fda37['model']],'as':_0x1fda37['as'],'attributes':_0x1fda37[_0x3550('0x18')],'include':_0x1fda37['include']?_[_0x3550('0x1a')](_0x1fda37['include'],function(_0x4763cd){return{'model':db[_0x4763cd[_0x3550('0x1b')]],'as':_0x4763cd['as'],'attributes':_0x4763cd[_0x3550('0x18')],'include':_0x4763cd['include']?_[_0x3550('0x1a')](_0x4763cd['include'],function(_0x20b104){return{'model':db[_0x20b104[_0x3550('0x1b')]],'as':_0x20b104['as'],'attributes':_0x20b104['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33dae1){logger[_0x3550('0xc')](_0x3550('0x1c'),_0x2ae7d2);logger['debug']('ShowSound',_0x2ae7d2,JSON[_0x3550('0x1d')](_0x33dae1));_0xfdacc8(_0x33dae1);})[_0x3550('0x13')](function(_0x1a659f){logger['error'](_0x3550('0x1c'),_0x1a659f[_0x3550('0x11')],_0x2ae7d2);_0x4d46b9(_0x52ad94[_0x3550('0xf')](0x1f4,_0x1a659f['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 04db370..a73d0c2 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 _0xf62e=['/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get'];(function(_0x25cc47,_0xd375f9){var _0x4ead03=function(_0x3abc29){while(--_0x3abc29){_0x25cc47['push'](_0x25cc47['shift']());}};_0x4ead03(++_0xd375f9);}(_0xf62e,0xa8));var _0xef62=function(_0x42c219,_0x38672d){_0x42c219=_0x42c219-0x0;var _0x6de136=_0xf62e[_0x42c219];return _0x6de136;};'use strict';var multer=require(_0xef62('0x0'));var util=require(_0xef62('0x1'));var path=require('path');var timeout=require(_0xef62('0x2'));var express=require(_0xef62('0x3'));var router=express[_0xef62('0x4')]();var fs_extra=require(_0xef62('0x5'));var auth=require(_0xef62('0x6'));var interaction=require(_0xef62('0x7'));var config=require('../../config/environment');var controller=require(_0xef62('0x8'));router['get']('/',auth[_0xef62('0x9')](),controller[_0xef62('0xa')]);router[_0xef62('0xb')](_0xef62('0xc'),auth[_0xef62('0x9')](),controller['show']);router[_0xef62('0xd')]('/',auth['isAuthenticated'](),controller[_0xef62('0xe')]);router[_0xef62('0xf')](_0xef62('0xc'),auth['isAuthenticated'](),controller[_0xef62('0x10')]);router[_0xef62('0x11')](_0xef62('0xc'),auth[_0xef62('0x9')](),controller[_0xef62('0x12')]);module[_0xef62('0x13')]=router; \ No newline at end of file +var _0xa755=['../../config/environment','./squareMessage.controller','get','isAuthenticated','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3de91c,_0x3f2fa){var _0x71adcd=function(_0x2a6cec){while(--_0x2a6cec){_0x3de91c['push'](_0x3de91c['shift']());}};_0x71adcd(++_0x3f2fa);}(_0xa755,0x174));var _0x5a75=function(_0x51f7a0,_0x4a6712){_0x51f7a0=_0x51f7a0-0x0;var _0x801711=_0xa755[_0x51f7a0];return _0x801711;};'use strict';var multer=require(_0x5a75('0x0'));var util=require(_0x5a75('0x1'));var path=require(_0x5a75('0x2'));var timeout=require(_0x5a75('0x3'));var express=require('express');var router=express[_0x5a75('0x4')]();var fs_extra=require(_0x5a75('0x5'));var auth=require(_0x5a75('0x6'));var interaction=require(_0x5a75('0x7'));var config=require(_0x5a75('0x8'));var controller=require(_0x5a75('0x9'));router[_0x5a75('0xa')]('/',auth[_0x5a75('0xb')](),controller['index']);router[_0x5a75('0xa')](_0x5a75('0xc'),auth[_0x5a75('0xb')](),controller[_0x5a75('0xd')]);router[_0x5a75('0xe')]('/',auth[_0x5a75('0xb')](),controller[_0x5a75('0xf')]);router['put'](_0x5a75('0xc'),auth[_0x5a75('0xb')](),controller['update']);router[_0x5a75('0x10')](_0x5a75('0xc'),auth[_0x5a75('0xb')](),controller[_0x5a75('0x11')]);module[_0x5a75('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index c7c2b54..826819e 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 _0x0bde=['out','exports','TEXT','medium','ENUM'];(function(_0x43a29b,_0x13807c){var _0x243c5d=function(_0x1fe093){while(--_0x1fe093){_0x43a29b['push'](_0x43a29b['shift']());}};_0x243c5d(++_0x13807c);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0xe0bd('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xe0bd('0x1')](_0xe0bd('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xe0bd('0x3')]('in',_0xe0bd('0x4')),'defaultValue':_0xe0bd('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe0bd('0x1')]}}; \ No newline at end of file +var _0xc949=['out','sequelize','STRING','TEXT','medium','ENUM'];(function(_0x4cc090,_0x52e24e){var _0x3a8e87=function(_0x5c225b){while(--_0x5c225b){_0x4cc090['push'](_0x4cc090['shift']());}};_0x3a8e87(++_0x52e24e);}(_0xc949,0x181));var _0x9c94=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xc949[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0x9c94('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9c94('0x1')]},'body':{'type':Sequelize[_0x9c94('0x2')](_0x9c94('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x9c94('0x4')]('in','out'),'defaultValue':_0x9c94('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x9c94('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 8c6d524..0e5aa6a 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 _0x2fd6=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','json','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir'];(function(_0x4a0c33,_0x5686bb){var _0x6488f9=function(_0x3bbd97){while(--_0x3bbd97){_0x4a0c33['push'](_0x4a0c33['shift']());}};_0x6488f9(++_0x5686bb);}(_0x2fd6,0x166));var _0x62fd=function(_0x392d62,_0x297b0a){_0x392d62=_0x392d62-0x0;var _0x2b69f6=_0x2fd6[_0x392d62];return _0x2b69f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62fd('0x0'));var zipdir=require(_0x62fd('0x1'));var jsonpatch=require(_0x62fd('0x2'));var rp=require(_0x62fd('0x3'));var moment=require(_0x62fd('0x4'));var BPromise=require(_0x62fd('0x5'));var Mustache=require(_0x62fd('0x6'));var util=require(_0x62fd('0x7'));var path=require('path');var sox=require(_0x62fd('0x8'));var csv=require(_0x62fd('0x9'));var ejs=require(_0x62fd('0xa'));var fs=require('fs');var fs_extra=require(_0x62fd('0xb'));var _=require(_0x62fd('0xc'));var squel=require(_0x62fd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x62fd('0xe'));var toCsv=require(_0x62fd('0x9'));var querystring=require('querystring');var Papa=require(_0x62fd('0xf'));var Redis=require(_0x62fd('0x10'));var authService=require(_0x62fd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x62fd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62fd('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x62fd('0x14'));var licenseUtil=require(_0x62fd('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54f02e,_0x182825){_0x182825=_0x182825||0xcc;return function(_0x1bdf6f){if(_0x1bdf6f){return _0x54f02e[_0x62fd('0x16')](_0x182825);}return _0x54f02e['status'](_0x182825)[_0x62fd('0x17')]();};}function respondWithResult(_0x3649f5,_0x30e7c0){_0x30e7c0=_0x30e7c0||0xc8;return function(_0x4f17f4){if(_0x4f17f4){return _0x3649f5[_0x62fd('0x18')](_0x30e7c0)[_0x62fd('0x19')](_0x4f17f4);}};}function respondWithFilteredResult(_0x5384bb,_0x19f179){return function(_0x3d4c56){if(_0x3d4c56){var _0xb8e85a=_0x3d4c56[_0x62fd('0x1a')],_0xa70685=_0x19f179['offset'],_0x2d09a7=_0x19f179[_0x62fd('0x1b')]+_0x19f179[_0x62fd('0x1c')],_0x46a085;if(_0x2d09a7>=_0xb8e85a){_0x2d09a7=_0xb8e85a;_0x46a085=0xc8;}else{_0x46a085=0xce;}_0x5384bb['status'](_0x46a085);return _0x5384bb[_0x62fd('0x1d')]('Content-Range',_0xa70685+'-'+_0x2d09a7+'/'+_0xb8e85a)['json'](_0x3d4c56);}return null;};}function patchUpdates(_0x21d329){return function(_0x271483){try{jsonpatch[_0x62fd('0x1e')](_0x271483,_0x21d329,!![]);}catch(_0x453579){return BPromise[_0x62fd('0x1f')](_0x453579);}return _0x271483['save']();};}function saveUpdates(_0x4659ae,_0x2896f7){return function(_0x21bc21){if(_0x21bc21){return _0x21bc21[_0x62fd('0x20')](_0x4659ae)[_0x62fd('0x21')](function(_0x4451a5){return _0x4451a5;});}return null;};}function removeEntity(_0xadccd9,_0x4d1c30){return function(_0x26a36b){if(_0x26a36b){return _0x26a36b[_0x62fd('0x22')]()[_0x62fd('0x21')](function(){_0xadccd9[_0x62fd('0x18')](0xcc)[_0x62fd('0x17')]();});}};}function handleEntityNotFound(_0x2dcf26,_0xc06b59){return function(_0x515a70){if(!_0x515a70){_0x2dcf26[_0x62fd('0x16')](0x194);}return _0x515a70;};}function handleError(_0x42f30d,_0x1382e8){_0x1382e8=_0x1382e8||0x1f4;return function(_0x8a9142){logger[_0x62fd('0x23')](_0x8a9142[_0x62fd('0x24')]);if(_0x8a9142[_0x62fd('0x25')]){delete _0x8a9142['name'];}_0x42f30d[_0x62fd('0x18')](_0x1382e8)[_0x62fd('0x26')](_0x8a9142);};}exports[_0x62fd('0x27')]=function(_0x4db008,_0x23f563){var _0x12a6d2={},_0x15f9d8={},_0x35f8ee={'count':0x0,'rows':[]};var _0x5701fd=_[_0x62fd('0x28')](db[_0x62fd('0x29')][_0x62fd('0x2a')],function(_0xaa1fe2){return{'name':_0xaa1fe2[_0x62fd('0x2b')],'type':_0xaa1fe2['type'][_0x62fd('0x2c')]};});_0x15f9d8[_0x62fd('0x2d')]=_[_0x62fd('0x28')](_0x5701fd,_0x62fd('0x25'));_0x15f9d8['query']=_[_0x62fd('0x2e')](_0x4db008[_0x62fd('0x2f')]);_0x15f9d8[_0x62fd('0x30')]=_[_0x62fd('0x31')](_0x15f9d8[_0x62fd('0x2d')],_0x15f9d8[_0x62fd('0x2f')]);_0x12a6d2[_0x62fd('0x32')]=_[_0x62fd('0x31')](_0x15f9d8['model'],qs['fields'](_0x4db008['query'][_0x62fd('0x33')]));_0x12a6d2['attributes']=_0x12a6d2[_0x62fd('0x32')][_0x62fd('0x34')]?_0x12a6d2['attributes']:_0x15f9d8[_0x62fd('0x2d')];if(!_0x4db008[_0x62fd('0x2f')][_0x62fd('0x35')]('nolimit')){_0x12a6d2[_0x62fd('0x1c')]=qs[_0x62fd('0x1c')](_0x4db008[_0x62fd('0x2f')]['limit']);_0x12a6d2[_0x62fd('0x1b')]=qs[_0x62fd('0x1b')](_0x4db008[_0x62fd('0x2f')]['offset']);}_0x12a6d2[_0x62fd('0x36')]=qs[_0x62fd('0x37')](_0x4db008[_0x62fd('0x2f')]['sort']);_0x12a6d2['where']=qs[_0x62fd('0x30')](_['pick'](_0x4db008[_0x62fd('0x2f')],_0x15f9d8[_0x62fd('0x30')]),_0x5701fd);if(_0x4db008[_0x62fd('0x2f')][_0x62fd('0x38')]){_0x12a6d2[_0x62fd('0x39')]=_[_0x62fd('0x3a')](_0x12a6d2[_0x62fd('0x39')],{'$or':_[_0x62fd('0x28')](_0x5701fd,function(_0x1a7d47){if(_0x1a7d47[_0x62fd('0x3b')]!==_0x62fd('0x3c')){var _0x3597b1={};_0x3597b1[_0x1a7d47[_0x62fd('0x25')]]={'$like':'%'+_0x4db008['query'][_0x62fd('0x38')]+'%'};return _0x3597b1;}})});}_0x12a6d2=_[_0x62fd('0x3a')]({},_0x12a6d2,_0x4db008[_0x62fd('0x3d')]);var _0xc6559e={'where':_0x12a6d2[_0x62fd('0x39')]};return db['SquareMessage'][_0x62fd('0x1a')](_0xc6559e)[_0x62fd('0x21')](function(_0x52d358){_0x35f8ee['count']=_0x52d358;if(_0x4db008[_0x62fd('0x2f')][_0x62fd('0x3e')]){_0x12a6d2[_0x62fd('0x3f')]=[{'all':!![]}];}return db[_0x62fd('0x29')][_0x62fd('0x40')](_0x12a6d2);})[_0x62fd('0x21')](function(_0x452586){_0x35f8ee[_0x62fd('0x41')]=_0x452586;return _0x35f8ee;})[_0x62fd('0x21')](respondWithFilteredResult(_0x23f563,_0x12a6d2))[_0x62fd('0x42')](handleError(_0x23f563,null));};exports[_0x62fd('0x43')]=function(_0x591175,_0x1ee317){var _0x21bd69={'raw':!![],'where':{'id':_0x591175[_0x62fd('0x44')]['id']}},_0x3e0023={};_0x3e0023[_0x62fd('0x2d')]=_[_0x62fd('0x2e')](db[_0x62fd('0x29')][_0x62fd('0x2a')]);_0x3e0023[_0x62fd('0x2f')]=_[_0x62fd('0x2e')](_0x591175[_0x62fd('0x2f')]);_0x3e0023[_0x62fd('0x30')]=_[_0x62fd('0x31')](_0x3e0023['model'],_0x3e0023[_0x62fd('0x2f')]);_0x21bd69[_0x62fd('0x32')]=_[_0x62fd('0x31')](_0x3e0023['model'],qs[_0x62fd('0x33')](_0x591175[_0x62fd('0x2f')][_0x62fd('0x33')]));_0x21bd69[_0x62fd('0x32')]=_0x21bd69[_0x62fd('0x32')]['length']?_0x21bd69[_0x62fd('0x32')]:_0x3e0023['model'];if(_0x591175[_0x62fd('0x2f')][_0x62fd('0x3e')]){_0x21bd69[_0x62fd('0x3f')]=[{'all':!![]}];}_0x21bd69=_[_0x62fd('0x3a')]({},_0x21bd69,_0x591175[_0x62fd('0x3d')]);return db[_0x62fd('0x29')][_0x62fd('0x45')](_0x21bd69)[_0x62fd('0x21')](handleEntityNotFound(_0x1ee317,null))[_0x62fd('0x21')](respondWithResult(_0x1ee317,null))[_0x62fd('0x42')](handleError(_0x1ee317,null));};exports[_0x62fd('0x46')]=function(_0x5192c5,_0x1d2c22){return db[_0x62fd('0x29')][_0x62fd('0x46')](_0x5192c5[_0x62fd('0x47')],{})[_0x62fd('0x21')](respondWithResult(_0x1d2c22,0xc9))[_0x62fd('0x42')](handleError(_0x1d2c22,null));};exports[_0x62fd('0x20')]=function(_0x5dd7ce,_0x210c79){if(_0x5dd7ce[_0x62fd('0x47')]['id']){delete _0x5dd7ce[_0x62fd('0x47')]['id'];}return db['SquareMessage'][_0x62fd('0x45')]({'where':{'id':_0x5dd7ce[_0x62fd('0x44')]['id']}})[_0x62fd('0x21')](handleEntityNotFound(_0x210c79,null))[_0x62fd('0x21')](saveUpdates(_0x5dd7ce['body'],null))[_0x62fd('0x21')](respondWithResult(_0x210c79,null))[_0x62fd('0x42')](handleError(_0x210c79,null));};exports[_0x62fd('0x22')]=function(_0x560d60,_0x2fbb95){return db[_0x62fd('0x29')][_0x62fd('0x45')]({'where':{'id':_0x560d60[_0x62fd('0x44')]['id']}})['then'](handleEntityNotFound(_0x2fbb95,null))[_0x62fd('0x21')](removeEntity(_0x2fbb95,null))[_0x62fd('0x42')](handleError(_0x2fbb95,null));}; \ No newline at end of file +var _0x5484=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','index','rawAttributes','type','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','SquareMessage','includeAll','include','findAll','show','params','options','create','catch','body','find','eml-format','rimraf','zip-dir'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x5484,0x165));var _0x4548=function(_0x14e1d8,_0x2ab24c){_0x14e1d8=_0x14e1d8-0x0;var _0x23452e=_0x5484[_0x14e1d8];return _0x23452e;};'use strict';var emlformat=require(_0x4548('0x0'));var rimraf=require(_0x4548('0x1'));var zipdir=require(_0x4548('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4548('0x3'));var moment=require(_0x4548('0x4'));var BPromise=require(_0x4548('0x5'));var Mustache=require(_0x4548('0x6'));var util=require(_0x4548('0x7'));var path=require('path');var sox=require(_0x4548('0x8'));var csv=require(_0x4548('0x9'));var ejs=require(_0x4548('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4548('0xb'));var squel=require(_0x4548('0xc'));var crypto=require(_0x4548('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4548('0xe'));var toCsv=require(_0x4548('0x9'));var querystring=require(_0x4548('0xf'));var Papa=require(_0x4548('0x10'));var Redis=require(_0x4548('0x11'));var authService=require(_0x4548('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4548('0x13'));var logger=require(_0x4548('0x14'))(_0x4548('0x15'));var utils=require('../../config/utils');var config=require(_0x4548('0x16'));var licenseUtil=require(_0x4548('0x17'));var db=require(_0x4548('0x18'))['db'];function respondWithStatusCode(_0x4f9538,_0x5be10e){_0x5be10e=_0x5be10e||0xcc;return function(_0x1144cd){if(_0x1144cd){return _0x4f9538[_0x4548('0x19')](_0x5be10e);}return _0x4f9538[_0x4548('0x1a')](_0x5be10e)['end']();};}function respondWithResult(_0x562f48,_0x4572da){_0x4572da=_0x4572da||0xc8;return function(_0x579cc4){if(_0x579cc4){return _0x562f48[_0x4548('0x1a')](_0x4572da)['json'](_0x579cc4);}};}function respondWithFilteredResult(_0x3573f2,_0xcaee87){return function(_0x74ca67){if(_0x74ca67){var _0x101e5c=_0x74ca67[_0x4548('0x1b')],_0x1059fe=_0xcaee87[_0x4548('0x1c')],_0x1ebc8a=_0xcaee87[_0x4548('0x1c')]+_0xcaee87['limit'],_0x13c6d2;if(_0x1ebc8a>=_0x101e5c){_0x1ebc8a=_0x101e5c;_0x13c6d2=0xc8;}else{_0x13c6d2=0xce;}_0x3573f2[_0x4548('0x1a')](_0x13c6d2);return _0x3573f2[_0x4548('0x1d')](_0x4548('0x1e'),_0x1059fe+'-'+_0x1ebc8a+'/'+_0x101e5c)[_0x4548('0x1f')](_0x74ca67);}return null;};}function patchUpdates(_0x3aabfb){return function(_0x55dabe){try{jsonpatch[_0x4548('0x20')](_0x55dabe,_0x3aabfb,!![]);}catch(_0x16aa32){return BPromise[_0x4548('0x21')](_0x16aa32);}return _0x55dabe[_0x4548('0x22')]();};}function saveUpdates(_0x99c97a,_0x12901e){return function(_0x209b4e){if(_0x209b4e){return _0x209b4e[_0x4548('0x23')](_0x99c97a)[_0x4548('0x24')](function(_0x40bd8f){return _0x40bd8f;});}return null;};}function removeEntity(_0x56a618,_0x1389bf){return function(_0x1e2e46){if(_0x1e2e46){return _0x1e2e46[_0x4548('0x25')]()[_0x4548('0x24')](function(){_0x56a618[_0x4548('0x1a')](0xcc)[_0x4548('0x26')]();});}};}function handleEntityNotFound(_0x57c56d,_0x5eb6bf){return function(_0x222085){if(!_0x222085){_0x57c56d[_0x4548('0x19')](0x194);}return _0x222085;};}function handleError(_0x1f13ea,_0x106879){_0x106879=_0x106879||0x1f4;return function(_0x22f9c1){logger['error'](_0x22f9c1['stack']);if(_0x22f9c1[_0x4548('0x27')]){delete _0x22f9c1[_0x4548('0x27')];}_0x1f13ea[_0x4548('0x1a')](_0x106879)[_0x4548('0x28')](_0x22f9c1);};}exports[_0x4548('0x29')]=function(_0x4bfeac,_0x3dfc47){var _0x1b0dd7={},_0x4ed31f={},_0x34cca8={'count':0x0,'rows':[]};var _0x12c238=_['map'](db['SquareMessage'][_0x4548('0x2a')],function(_0x268255){return{'name':_0x268255['fieldName'],'type':_0x268255[_0x4548('0x2b')]['key']};});_0x4ed31f['model']=_[_0x4548('0x2c')](_0x12c238,_0x4548('0x27'));_0x4ed31f['query']=_[_0x4548('0x2d')](_0x4bfeac[_0x4548('0x2e')]);_0x4ed31f[_0x4548('0x2f')]=_[_0x4548('0x30')](_0x4ed31f[_0x4548('0x31')],_0x4ed31f[_0x4548('0x2e')]);_0x1b0dd7[_0x4548('0x32')]=_[_0x4548('0x30')](_0x4ed31f[_0x4548('0x31')],qs[_0x4548('0x33')](_0x4bfeac[_0x4548('0x2e')]['fields']));_0x1b0dd7[_0x4548('0x32')]=_0x1b0dd7[_0x4548('0x32')][_0x4548('0x34')]?_0x1b0dd7['attributes']:_0x4ed31f[_0x4548('0x31')];if(!_0x4bfeac['query'][_0x4548('0x35')]('nolimit')){_0x1b0dd7[_0x4548('0x36')]=qs['limit'](_0x4bfeac[_0x4548('0x2e')][_0x4548('0x36')]);_0x1b0dd7[_0x4548('0x1c')]=qs[_0x4548('0x1c')](_0x4bfeac[_0x4548('0x2e')]['offset']);}_0x1b0dd7[_0x4548('0x37')]=qs[_0x4548('0x38')](_0x4bfeac[_0x4548('0x2e')]['sort']);_0x1b0dd7[_0x4548('0x39')]=qs[_0x4548('0x2f')](_[_0x4548('0x3a')](_0x4bfeac[_0x4548('0x2e')],_0x4ed31f[_0x4548('0x2f')]),_0x12c238);if(_0x4bfeac[_0x4548('0x2e')][_0x4548('0x3b')]){_0x1b0dd7[_0x4548('0x39')]=_[_0x4548('0x3c')](_0x1b0dd7[_0x4548('0x39')],{'$or':_[_0x4548('0x2c')](_0x12c238,function(_0x1a659d){if(_0x1a659d[_0x4548('0x2b')]!=='VIRTUAL'){var _0x2a416e={};_0x2a416e[_0x1a659d[_0x4548('0x27')]]={'$like':'%'+_0x4bfeac[_0x4548('0x2e')][_0x4548('0x3b')]+'%'};return _0x2a416e;}})});}_0x1b0dd7=_[_0x4548('0x3c')]({},_0x1b0dd7,_0x4bfeac['options']);var _0x29b27a={'where':_0x1b0dd7[_0x4548('0x39')]};return db[_0x4548('0x3d')]['count'](_0x29b27a)['then'](function(_0x1cfdb8){_0x34cca8['count']=_0x1cfdb8;if(_0x4bfeac['query'][_0x4548('0x3e')]){_0x1b0dd7[_0x4548('0x3f')]=[{'all':!![]}];}return db['SquareMessage'][_0x4548('0x40')](_0x1b0dd7);})['then'](function(_0x51f09c){_0x34cca8['rows']=_0x51f09c;return _0x34cca8;})[_0x4548('0x24')](respondWithFilteredResult(_0x3dfc47,_0x1b0dd7))['catch'](handleError(_0x3dfc47,null));};exports[_0x4548('0x41')]=function(_0x65d190,_0xb85008){var _0x41b615={'raw':!![],'where':{'id':_0x65d190[_0x4548('0x42')]['id']}},_0x9b0d5d={};_0x9b0d5d[_0x4548('0x31')]=_['keys'](db[_0x4548('0x3d')][_0x4548('0x2a')]);_0x9b0d5d[_0x4548('0x2e')]=_[_0x4548('0x2d')](_0x65d190[_0x4548('0x2e')]);_0x9b0d5d[_0x4548('0x2f')]=_[_0x4548('0x30')](_0x9b0d5d['model'],_0x9b0d5d['query']);_0x41b615['attributes']=_[_0x4548('0x30')](_0x9b0d5d[_0x4548('0x31')],qs['fields'](_0x65d190[_0x4548('0x2e')][_0x4548('0x33')]));_0x41b615[_0x4548('0x32')]=_0x41b615[_0x4548('0x32')][_0x4548('0x34')]?_0x41b615[_0x4548('0x32')]:_0x9b0d5d[_0x4548('0x31')];if(_0x65d190['query']['includeAll']){_0x41b615[_0x4548('0x3f')]=[{'all':!![]}];}_0x41b615=_[_0x4548('0x3c')]({},_0x41b615,_0x65d190[_0x4548('0x43')]);return db[_0x4548('0x3d')]['find'](_0x41b615)['then'](handleEntityNotFound(_0xb85008,null))[_0x4548('0x24')](respondWithResult(_0xb85008,null))['catch'](handleError(_0xb85008,null));};exports[_0x4548('0x44')]=function(_0x102286,_0x4410e1){return db['SquareMessage']['create'](_0x102286['body'],{})[_0x4548('0x24')](respondWithResult(_0x4410e1,0xc9))[_0x4548('0x45')](handleError(_0x4410e1,null));};exports[_0x4548('0x23')]=function(_0x2c7943,_0x1f6dfc){if(_0x2c7943['body']['id']){delete _0x2c7943[_0x4548('0x46')]['id'];}return db[_0x4548('0x3d')][_0x4548('0x47')]({'where':{'id':_0x2c7943[_0x4548('0x42')]['id']}})[_0x4548('0x24')](handleEntityNotFound(_0x1f6dfc,null))[_0x4548('0x24')](saveUpdates(_0x2c7943[_0x4548('0x46')],null))['then'](respondWithResult(_0x1f6dfc,null))[_0x4548('0x45')](handleError(_0x1f6dfc,null));};exports[_0x4548('0x25')]=function(_0x299261,_0x2d19ea){return db[_0x4548('0x3d')]['find']({'where':{'id':_0x299261[_0x4548('0x42')]['id']}})[_0x4548('0x24')](handleEntityNotFound(_0x2d19ea,null))[_0x4548('0x24')](removeEntity(_0x2d19ea,null))[_0x4548('0x45')](handleError(_0x2d19ea,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 50e4dee..05a8076 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 _0x704f=['bluebird','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','square_messages','util','../../config/logger','api','moment'];(function(_0x40121d,_0x13bbdd){var _0x47e2cc=function(_0x574309){while(--_0x574309){_0x40121d['push'](_0x40121d['shift']());}};_0x47e2cc(++_0x13bbdd);}(_0x704f,0x1c4));var _0xf704=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x704f[_0x39e164];return _0x13fa6b;};'use strict';var _=require('lodash');var util=require(_0xf704('0x0'));var logger=require(_0xf704('0x1'))(_0xf704('0x2'));var moment=require(_0xf704('0x3'));var BPromise=require(_0xf704('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf704('0x5'));var rimraf=require(_0xf704('0x6'));var config=require(_0xf704('0x7'));var attributes=require(_0xf704('0x8'));module[_0xf704('0x9')]=function(_0x42ac99,_0x235900){return _0x42ac99[_0xf704('0xa')]('SquareMessage',attributes,{'tableName':_0xf704('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bd1=['square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1a675c,_0x4648bc){var _0x4ee1dc=function(_0x4ab719){while(--_0x4ab719){_0x1a675c['push'](_0x1a675c['shift']());}};_0x4ee1dc(++_0x4648bc);}(_0x0bd1,0x15d));var _0x10bd=function(_0x1daebd,_0x79a89){_0x1daebd=_0x1daebd-0x0;var _0x462a89=_0x0bd1[_0x1daebd];return _0x462a89;};'use strict';var _=require(_0x10bd('0x0'));var util=require('util');var logger=require(_0x10bd('0x1'))(_0x10bd('0x2'));var moment=require(_0x10bd('0x3'));var BPromise=require(_0x10bd('0x4'));var rp=require(_0x10bd('0x5'));var fs=require('fs');var path=require(_0x10bd('0x6'));var rimraf=require(_0x10bd('0x7'));var config=require(_0x10bd('0x8'));var attributes=require('./squareMessage.attributes');module[_0x10bd('0x9')]=function(_0x4a6b89,_0x4b0f77){return _0x4a6b89[_0x10bd('0xa')]('SquareMessage',attributes,{'tableName':_0x10bd('0xb'),'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 c6af61a..2a84327 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 _0xa9e0=['message','result','catch','SquareMessage','create','body','options','raw','then','CreateSquareMessage','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x4a3a90,_0x271540){var _0x2439d0=function(_0x5073a4){while(--_0x5073a4){_0x4a3a90['push'](_0x4a3a90['shift']());}};_0x2439d0(++_0x271540);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['CreateSquareMessage']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![]})[_0x0a9e('0x19')](function(_0x105080){logger['info'](_0x0a9e('0x1a'),_0x459eb1);logger[_0x0a9e('0xd')]('CreateSquareMessage',_0x459eb1,JSON[_0x0a9e('0x1b')](_0x105080));_0x106033(_0x105080);})['catch'](function(_0x588269){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x588269[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x588269['message']));});});}; \ No newline at end of file +var _0xa9e0=['message','result','catch','SquareMessage','create','body','options','raw','then','CreateSquareMessage','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','code','error'];(function(_0xd29a90,_0x45eb0e){var _0x316cc9=function(_0x343498){while(--_0x343498){_0xd29a90['push'](_0xd29a90['shift']());}};_0x316cc9(++_0x45eb0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['CreateSquareMessage']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![]})[_0x0a9e('0x19')](function(_0x105080){logger['info'](_0x0a9e('0x1a'),_0x459eb1);logger[_0x0a9e('0xd')]('CreateSquareMessage',_0x459eb1,JSON[_0x0a9e('0x1b')](_0x105080));_0x106033(_0x105080);})['catch'](function(_0x588269){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x588269[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x588269['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index f74c1af..d256581 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 _0x7f8d=['path','connect-timeout','express','fs-extra','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','put','exports','multer','util'];(function(_0x1a3436,_0x6576db){var _0x515c2e=function(_0x2c4443){while(--_0x2c4443){_0x1a3436['push'](_0x1a3436['shift']());}};_0x515c2e(++_0x6576db);}(_0x7f8d,0x1ec));var _0xd7f8=function(_0x469ed4,_0x49da48){_0x469ed4=_0x469ed4-0x0;var _0x2e7c14=_0x7f8d[_0x469ed4];return _0x2e7c14;};'use strict';var multer=require(_0xd7f8('0x0'));var util=require(_0xd7f8('0x1'));var path=require(_0xd7f8('0x2'));var timeout=require(_0xd7f8('0x3'));var express=require(_0xd7f8('0x4'));var router=express['Router']();var fs_extra=require(_0xd7f8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd7f8('0x6'));var config=require('../../config/environment');var controller=require(_0xd7f8('0x7'));router[_0xd7f8('0x8')]('/',auth[_0xd7f8('0x9')](),controller[_0xd7f8('0xa')]);router[_0xd7f8('0x8')](_0xd7f8('0xb'),auth[_0xd7f8('0x9')](),controller[_0xd7f8('0xc')]);router['get'](_0xd7f8('0xd'),auth[_0xd7f8('0x9')](),timeout(_0xd7f8('0xe')),controller[_0xd7f8('0xf')]);router[_0xd7f8('0x10')]('/',auth[_0xd7f8('0x9')](),controller['create']);router[_0xd7f8('0x11')]('/:id',auth[_0xd7f8('0x9')](),controller['update']);router['delete']('/:id',auth[_0xd7f8('0x9')](),controller['destroy']);module[_0xd7f8('0x12')]=router; \ No newline at end of file +var _0x0359=['test','post','create','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s'];(function(_0x35b505,_0x24a38c){var _0x4738b5=function(_0xa349f5){while(--_0xa349f5){_0x35b505['push'](_0x35b505['shift']());}};_0x4738b5(++_0x24a38c);}(_0x0359,0x123));var _0x9035=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x0359[_0x1203f];return _0x365f0a;};'use strict';var multer=require(_0x9035('0x0'));var util=require(_0x9035('0x1'));var path=require(_0x9035('0x2'));var timeout=require(_0x9035('0x3'));var express=require(_0x9035('0x4'));var router=express['Router']();var fs_extra=require(_0x9035('0x5'));var auth=require(_0x9035('0x6'));var interaction=require(_0x9035('0x7'));var config=require(_0x9035('0x8'));var controller=require(_0x9035('0x9'));router[_0x9035('0xa')]('/',auth[_0x9035('0xb')](),controller[_0x9035('0xc')]);router[_0x9035('0xa')](_0x9035('0xd'),auth[_0x9035('0xb')](),controller[_0x9035('0xe')]);router['get'](_0x9035('0xf'),auth['isAuthenticated'](),timeout(_0x9035('0x10')),controller[_0x9035('0x11')]);router[_0x9035('0x12')]('/',auth[_0x9035('0xb')](),controller[_0x9035('0x13')]);router[_0x9035('0x14')](_0x9035('0xd'),auth[_0x9035('0xb')](),controller['update']);router[_0x9035('0x15')](_0x9035('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 896fac2..081089b 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 _0xf1f5=['name','STRING','sequelize'];(function(_0xfbcc28,_0x14cd67){var _0x19ee5d=function(_0x3519fc){while(--_0x3519fc){_0xfbcc28['push'](_0xfbcc28['shift']());}};_0x19ee5d(++_0x14cd67);}(_0xf1f5,0x1dc));var _0x5f1f=function(_0x4d4f61,_0x56d7a7){_0x4d4f61=_0x4d4f61-0x0;var _0x297414=_0xf1f5[_0x4d4f61];return _0x297414;};'use strict';var Sequelize=require(_0x5f1f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5f1f('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x5f1f('0x2')]},'description':{'type':Sequelize[_0x5f1f('0x2')]}}; \ No newline at end of file +var _0x4916=['STRING','sequelize','exports'];(function(_0x1253d0,_0x2808fc){var _0x50003f=function(_0xfa539a){while(--_0xfa539a){_0x1253d0['push'](_0x1253d0['shift']());}};_0x50003f(++_0x2808fc);}(_0x4916,0xc1));var _0x6491=function(_0x37ad8e,_0x4a06b8){_0x37ad8e=_0x37ad8e-0x0;var _0x38962b=_0x4916[_0x37ad8e];return _0x38962b;};'use strict';var Sequelize=require(_0x6491('0x0'));module[_0x6491('0x1')]={'name':{'type':Sequelize[_0x6491('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x6491('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index df12a7b..163ffcb 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 _0x6c50=['../../config/environment','../../config/license/util','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','apply','save','destroy','then','get','ODBC','UserProfileResource','sendStatus','error','name','send','map','SquareOdbc','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','test','odbc','openSync','dsn','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x6c50,0xe2));var _0x06c5=function(_0x830fc6,_0x4a4717){_0x830fc6=_0x830fc6-0x0;var _0xced872=_0x6c50[_0x830fc6];return _0xced872;};'use strict';var emlformat=require(_0x06c5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x06c5('0x1'));var jsonpatch=require(_0x06c5('0x2'));var rp=require(_0x06c5('0x3'));var moment=require(_0x06c5('0x4'));var BPromise=require(_0x06c5('0x5'));var Mustache=require('mustache');var util=require(_0x06c5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x06c5('0x7'));var ejs=require(_0x06c5('0x8'));var fs=require('fs');var fs_extra=require(_0x06c5('0x9'));var _=require(_0x06c5('0xa'));var squel=require(_0x06c5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x06c5('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x06c5('0xd'));var Redis=require(_0x06c5('0xe'));var authService=require(_0x06c5('0xf'));var qs=require(_0x06c5('0x10'));var as=require(_0x06c5('0x11'));var hardwareService=require(_0x06c5('0x12'));var logger=require(_0x06c5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x06c5('0x14'));var licenseUtil=require(_0x06c5('0x15'));var db=require(_0x06c5('0x16'))['db'];function respondWithStatusCode(_0x3e4432,_0x13b136){_0x13b136=_0x13b136||0xcc;return function(_0x467656){if(_0x467656){return _0x3e4432['sendStatus'](_0x13b136);}return _0x3e4432['status'](_0x13b136)[_0x06c5('0x17')]();};}function respondWithResult(_0xe6b8a4,_0x1dfd94){_0x1dfd94=_0x1dfd94||0xc8;return function(_0x4f563a){if(_0x4f563a){return _0xe6b8a4['status'](_0x1dfd94)[_0x06c5('0x18')](_0x4f563a);}};}function respondWithFilteredResult(_0x30f9c1,_0x5eb3db){return function(_0x3cfc25){if(_0x3cfc25){var _0x2b2f66=_0x3cfc25[_0x06c5('0x19')],_0x221b7b=_0x5eb3db[_0x06c5('0x1a')],_0x1e721b=_0x5eb3db[_0x06c5('0x1a')]+_0x5eb3db[_0x06c5('0x1b')],_0x5754d0;if(_0x1e721b>=_0x2b2f66){_0x1e721b=_0x2b2f66;_0x5754d0=0xc8;}else{_0x5754d0=0xce;}_0x30f9c1[_0x06c5('0x1c')](_0x5754d0);return _0x30f9c1[_0x06c5('0x1d')](_0x06c5('0x1e'),_0x221b7b+'-'+_0x1e721b+'/'+_0x2b2f66)[_0x06c5('0x18')](_0x3cfc25);}return null;};}function patchUpdates(_0x216b39){return function(_0x576de9){try{jsonpatch[_0x06c5('0x1f')](_0x576de9,_0x216b39,!![]);}catch(_0xf1b1a4){return BPromise['reject'](_0xf1b1a4);}return _0x576de9[_0x06c5('0x20')]();};}function saveUpdates(_0x4c3eb8,_0x42c3f7){return function(_0x569624){if(_0x569624){return _0x569624['update'](_0x4c3eb8)['then'](function(_0x446eb5){return _0x446eb5;});}return null;};}function removeEntity(_0x42340f,_0xb50eb4){return function(_0xa5f82){if(_0xa5f82){return _0xa5f82[_0x06c5('0x21')]()[_0x06c5('0x22')](function(){var _0x135e3b=_0xa5f82[_0x06c5('0x23')]({'plain':!![]});var _0x4b7e83=_0x06c5('0x24');return db[_0x06c5('0x25')]['destroy']({'where':{'type':_0x4b7e83,'resourceId':_0x135e3b['id']}})[_0x06c5('0x22')](function(){return _0xa5f82;});})['then'](function(){_0x42340f[_0x06c5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4842cf,_0xf89639){return function(_0x41c486){if(!_0x41c486){_0x4842cf[_0x06c5('0x26')](0x194);}return _0x41c486;};}function handleError(_0x2b38f7,_0x576040){_0x576040=_0x576040||0x1f4;return function(_0x33e4a8){logger[_0x06c5('0x27')](_0x33e4a8['stack']);if(_0x33e4a8[_0x06c5('0x28')]){delete _0x33e4a8[_0x06c5('0x28')];}_0x2b38f7['status'](_0x576040)[_0x06c5('0x29')](_0x33e4a8);};}exports['index']=function(_0x18c960,_0x565a64){var _0x16a8eb={},_0x20939f={},_0x2bdea8={'count':0x0,'rows':[]};var _0x104582=_[_0x06c5('0x2a')](db[_0x06c5('0x2b')]['rawAttributes'],function(_0x597dbf){return{'name':_0x597dbf[_0x06c5('0x2c')],'type':_0x597dbf[_0x06c5('0x2d')][_0x06c5('0x2e')]};});_0x20939f[_0x06c5('0x2f')]=_['map'](_0x104582,_0x06c5('0x28'));_0x20939f[_0x06c5('0x30')]=_['keys'](_0x18c960[_0x06c5('0x30')]);_0x20939f[_0x06c5('0x31')]=_[_0x06c5('0x32')](_0x20939f[_0x06c5('0x2f')],_0x20939f['query']);_0x16a8eb[_0x06c5('0x33')]=_[_0x06c5('0x32')](_0x20939f[_0x06c5('0x2f')],qs[_0x06c5('0x34')](_0x18c960[_0x06c5('0x30')][_0x06c5('0x34')]));_0x16a8eb['attributes']=_0x16a8eb['attributes'][_0x06c5('0x35')]?_0x16a8eb['attributes']:_0x20939f[_0x06c5('0x2f')];if(!_0x18c960['query'][_0x06c5('0x36')](_0x06c5('0x37'))){_0x16a8eb[_0x06c5('0x1b')]=qs[_0x06c5('0x1b')](_0x18c960[_0x06c5('0x30')][_0x06c5('0x1b')]);_0x16a8eb[_0x06c5('0x1a')]=qs[_0x06c5('0x1a')](_0x18c960['query'][_0x06c5('0x1a')]);}_0x16a8eb['order']=qs[_0x06c5('0x38')](_0x18c960[_0x06c5('0x30')]['sort']);_0x16a8eb[_0x06c5('0x39')]=qs[_0x06c5('0x31')](_[_0x06c5('0x3a')](_0x18c960[_0x06c5('0x30')],_0x20939f[_0x06c5('0x31')]),_0x104582);if(_0x18c960['query']['filter']){_0x16a8eb[_0x06c5('0x39')]=_[_0x06c5('0x3b')](_0x16a8eb[_0x06c5('0x39')],{'$or':_[_0x06c5('0x2a')](_0x104582,function(_0x42f408){if(_0x42f408[_0x06c5('0x2d')]!==_0x06c5('0x3c')){var _0x4da3ab={};_0x4da3ab[_0x42f408['name']]={'$like':'%'+_0x18c960[_0x06c5('0x30')][_0x06c5('0x3d')]+'%'};return _0x4da3ab;}})});}_0x16a8eb=_['merge']({},_0x16a8eb,_0x18c960['options']);var _0x59dfe8={'where':_0x16a8eb[_0x06c5('0x39')]};return db['SquareOdbc'][_0x06c5('0x19')](_0x59dfe8)[_0x06c5('0x22')](function(_0x5c039a){_0x2bdea8[_0x06c5('0x19')]=_0x5c039a;if(_0x18c960[_0x06c5('0x30')]['includeAll']){_0x16a8eb[_0x06c5('0x3e')]=[{'all':!![]}];}return db[_0x06c5('0x2b')][_0x06c5('0x3f')](_0x16a8eb);})[_0x06c5('0x22')](function(_0x504105){_0x2bdea8[_0x06c5('0x40')]=_0x504105;return _0x2bdea8;})[_0x06c5('0x22')](respondWithFilteredResult(_0x565a64,_0x16a8eb))[_0x06c5('0x41')](handleError(_0x565a64,null));};exports['show']=function(_0x49ea74,_0x177960){var _0x48f377={'raw':!![],'where':{'id':_0x49ea74[_0x06c5('0x42')]['id']}},_0x2611ee={};_0x2611ee[_0x06c5('0x2f')]=_[_0x06c5('0x43')](db[_0x06c5('0x2b')][_0x06c5('0x44')]);_0x2611ee[_0x06c5('0x30')]=_['keys'](_0x49ea74[_0x06c5('0x30')]);_0x2611ee['filters']=_[_0x06c5('0x32')](_0x2611ee[_0x06c5('0x2f')],_0x2611ee[_0x06c5('0x30')]);_0x48f377[_0x06c5('0x33')]=_[_0x06c5('0x32')](_0x2611ee['model'],qs[_0x06c5('0x34')](_0x49ea74[_0x06c5('0x30')][_0x06c5('0x34')]));_0x48f377['attributes']=_0x48f377[_0x06c5('0x33')][_0x06c5('0x35')]?_0x48f377['attributes']:_0x2611ee[_0x06c5('0x2f')];if(_0x49ea74[_0x06c5('0x30')][_0x06c5('0x45')]){_0x48f377[_0x06c5('0x3e')]=[{'all':!![]}];}_0x48f377=_[_0x06c5('0x3b')]({},_0x48f377,_0x49ea74['options']);return db[_0x06c5('0x2b')][_0x06c5('0x46')](_0x48f377)['then'](handleEntityNotFound(_0x177960,null))['then'](respondWithResult(_0x177960,null))['catch'](handleError(_0x177960,null));};exports[_0x06c5('0x47')]=function(_0x2368a8,_0x36ef95){return db[_0x06c5('0x2b')][_0x06c5('0x47')](_0x2368a8[_0x06c5('0x48')],{})[_0x06c5('0x22')](function(_0x2d41c3){var _0x423c3f=_0x2368a8[_0x06c5('0x49')][_0x06c5('0x23')]({'plain':!![]});if(!_0x423c3f)throw new Error(_0x06c5('0x4a'));if(_0x423c3f[_0x06c5('0x4b')]===_0x06c5('0x49')){var _0x2aaaa9=_0x2d41c3['get']({'plain':!![]});var _0x2f0417='ODBC';return db['UserProfileSection'][_0x06c5('0x46')]({'where':{'name':_0x2f0417,'userProfileId':_0x423c3f['userProfileId']},'raw':!![]})[_0x06c5('0x22')](function(_0x60814){if(_0x60814&&_0x60814[_0x06c5('0x4c')]===0x0){return db[_0x06c5('0x25')][_0x06c5('0x47')]({'name':_0x2aaaa9[_0x06c5('0x28')],'resourceId':_0x2aaaa9['id'],'type':_0x60814[_0x06c5('0x28')],'sectionId':_0x60814['id']},{})[_0x06c5('0x22')](function(){return _0x2d41c3;});}else{return _0x2d41c3;}})[_0x06c5('0x41')](function(_0x3946e1){logger[_0x06c5('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3946e1);throw _0x3946e1;});}return _0x2d41c3;})[_0x06c5('0x22')](respondWithResult(_0x36ef95,0xc9))['catch'](handleError(_0x36ef95,null));};exports['update']=function(_0x50e154,_0x53dea7){if(_0x50e154[_0x06c5('0x48')]['id']){delete _0x50e154['body']['id'];}return db[_0x06c5('0x2b')][_0x06c5('0x46')]({'where':{'id':_0x50e154[_0x06c5('0x42')]['id']}})['then'](handleEntityNotFound(_0x53dea7,null))['then'](saveUpdates(_0x50e154['body'],null))[_0x06c5('0x22')](respondWithResult(_0x53dea7,null))[_0x06c5('0x41')](handleError(_0x53dea7,null));};exports[_0x06c5('0x21')]=function(_0x1e97da,_0x276b4f){return db[_0x06c5('0x2b')][_0x06c5('0x46')]({'where':{'id':_0x1e97da[_0x06c5('0x42')]['id']}})[_0x06c5('0x22')](handleEntityNotFound(_0x276b4f,null))['then'](removeEntity(_0x276b4f,null))[_0x06c5('0x41')](handleError(_0x276b4f,null));};exports[_0x06c5('0x4d')]=function(_0x44e7ad,_0x39bb28,_0x3d5353){var _0x22f220;return db[_0x06c5('0x2b')]['find']({'where':{'id':_0x44e7ad[_0x06c5('0x42')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x39bb28,null))[_0x06c5('0x22')](function(_0x724898){if(_0x724898){var _0x38c16d=require(_0x06c5('0x4e'))();_0x38c16d[_0x06c5('0x4f')](_0x724898[_0x06c5('0x50')]);_0x38c16d[_0x06c5('0x51')]();return _0x724898;}})[_0x06c5('0x22')](respondWithResult(_0x39bb28,null))['catch'](handleError(_0x39bb28,null));}; \ No newline at end of file +var _0x08fd=['zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','then','get','ODBC','error','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','test','dsn','odbc','openSync','closeSync','eml-format','rimraf'];(function(_0x21c225,_0x531849){var _0x539351=function(_0x48fef3){while(--_0x48fef3){_0x21c225['push'](_0x21c225['shift']());}};_0x539351(++_0x531849);}(_0x08fd,0xa6));var _0xd08f=function(_0x43fd4e,_0x52c4a6){_0x43fd4e=_0x43fd4e-0x0;var _0x456822=_0x08fd[_0x43fd4e];return _0x456822;};'use strict';var emlformat=require(_0xd08f('0x0'));var rimraf=require(_0xd08f('0x1'));var zipdir=require(_0xd08f('0x2'));var jsonpatch=require(_0xd08f('0x3'));var rp=require('request-promise');var moment=require(_0xd08f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd08f('0x5'));var path=require(_0xd08f('0x6'));var sox=require(_0xd08f('0x7'));var csv=require(_0xd08f('0x8'));var ejs=require(_0xd08f('0x9'));var fs=require('fs');var fs_extra=require(_0xd08f('0xa'));var _=require('lodash');var squel=require(_0xd08f('0xb'));var crypto=require(_0xd08f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd08f('0x8'));var querystring=require(_0xd08f('0xd'));var Papa=require(_0xd08f('0xe'));var Redis=require(_0xd08f('0xf'));var authService=require(_0xd08f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd08f('0x11'));var logger=require('../../config/logger')(_0xd08f('0x12'));var utils=require('../../config/utils');var config=require(_0xd08f('0x13'));var licenseUtil=require(_0xd08f('0x14'));var db=require(_0xd08f('0x15'))['db'];function respondWithStatusCode(_0x3e8c38,_0x3f6136){_0x3f6136=_0x3f6136||0xcc;return function(_0x15664b){if(_0x15664b){return _0x3e8c38[_0xd08f('0x16')](_0x3f6136);}return _0x3e8c38[_0xd08f('0x17')](_0x3f6136)[_0xd08f('0x18')]();};}function respondWithResult(_0x59c987,_0x4c2fc3){_0x4c2fc3=_0x4c2fc3||0xc8;return function(_0x1bc5a0){if(_0x1bc5a0){return _0x59c987['status'](_0x4c2fc3)[_0xd08f('0x19')](_0x1bc5a0);}};}function respondWithFilteredResult(_0x136dbe,_0x58fd99){return function(_0x2027db){if(_0x2027db){var _0x36299d=_0x2027db[_0xd08f('0x1a')],_0x4c9e40=_0x58fd99[_0xd08f('0x1b')],_0x668607=_0x58fd99['offset']+_0x58fd99[_0xd08f('0x1c')],_0x1efc45;if(_0x668607>=_0x36299d){_0x668607=_0x36299d;_0x1efc45=0xc8;}else{_0x1efc45=0xce;}_0x136dbe['status'](_0x1efc45);return _0x136dbe['set'](_0xd08f('0x1d'),_0x4c9e40+'-'+_0x668607+'/'+_0x36299d)[_0xd08f('0x19')](_0x2027db);}return null;};}function patchUpdates(_0x217bfe){return function(_0x29bdc9){try{jsonpatch[_0xd08f('0x1e')](_0x29bdc9,_0x217bfe,!![]);}catch(_0x3a953b){return BPromise[_0xd08f('0x1f')](_0x3a953b);}return _0x29bdc9['save']();};}function saveUpdates(_0x52622b,_0x7032c1){return function(_0x366758){if(_0x366758){return _0x366758['update'](_0x52622b)[_0xd08f('0x20')](function(_0x552e22){return _0x552e22;});}return null;};}function removeEntity(_0x66f5d2,_0x480465){return function(_0x304c84){if(_0x304c84){return _0x304c84['destroy']()[_0xd08f('0x20')](function(){var _0x2a86aa=_0x304c84[_0xd08f('0x21')]({'plain':!![]});var _0x94940b=_0xd08f('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x94940b,'resourceId':_0x2a86aa['id']}})[_0xd08f('0x20')](function(){return _0x304c84;});})['then'](function(){_0x66f5d2[_0xd08f('0x17')](0xcc)[_0xd08f('0x18')]();});}};}function handleEntityNotFound(_0x1fe448,_0x46bc2a){return function(_0x14010d){if(!_0x14010d){_0x1fe448[_0xd08f('0x16')](0x194);}return _0x14010d;};}function handleError(_0x2d9dc5,_0x4cd769){_0x4cd769=_0x4cd769||0x1f4;return function(_0x150af3){logger[_0xd08f('0x23')](_0x150af3['stack']);if(_0x150af3[_0xd08f('0x24')]){delete _0x150af3['name'];}_0x2d9dc5[_0xd08f('0x17')](_0x4cd769)['send'](_0x150af3);};}exports[_0xd08f('0x25')]=function(_0x27d048,_0xde2de4){var _0x39b86a={},_0x1786ae={},_0x31ce0e={'count':0x0,'rows':[]};var _0x1b9c51=_[_0xd08f('0x26')](db[_0xd08f('0x27')][_0xd08f('0x28')],function(_0x4cc291){return{'name':_0x4cc291[_0xd08f('0x29')],'type':_0x4cc291[_0xd08f('0x2a')][_0xd08f('0x2b')]};});_0x1786ae[_0xd08f('0x2c')]=_[_0xd08f('0x26')](_0x1b9c51,_0xd08f('0x24'));_0x1786ae[_0xd08f('0x2d')]=_['keys'](_0x27d048[_0xd08f('0x2d')]);_0x1786ae[_0xd08f('0x2e')]=_[_0xd08f('0x2f')](_0x1786ae['model'],_0x1786ae[_0xd08f('0x2d')]);_0x39b86a[_0xd08f('0x30')]=_[_0xd08f('0x2f')](_0x1786ae['model'],qs[_0xd08f('0x31')](_0x27d048[_0xd08f('0x2d')][_0xd08f('0x31')]));_0x39b86a[_0xd08f('0x30')]=_0x39b86a['attributes']['length']?_0x39b86a[_0xd08f('0x30')]:_0x1786ae[_0xd08f('0x2c')];if(!_0x27d048['query'][_0xd08f('0x32')](_0xd08f('0x33'))){_0x39b86a[_0xd08f('0x1c')]=qs[_0xd08f('0x1c')](_0x27d048['query'][_0xd08f('0x1c')]);_0x39b86a[_0xd08f('0x1b')]=qs[_0xd08f('0x1b')](_0x27d048[_0xd08f('0x2d')][_0xd08f('0x1b')]);}_0x39b86a['order']=qs[_0xd08f('0x34')](_0x27d048[_0xd08f('0x2d')][_0xd08f('0x34')]);_0x39b86a[_0xd08f('0x35')]=qs[_0xd08f('0x2e')](_[_0xd08f('0x36')](_0x27d048[_0xd08f('0x2d')],_0x1786ae['filters']),_0x1b9c51);if(_0x27d048[_0xd08f('0x2d')][_0xd08f('0x37')]){_0x39b86a[_0xd08f('0x35')]=_['merge'](_0x39b86a['where'],{'$or':_[_0xd08f('0x26')](_0x1b9c51,function(_0x10100b){if(_0x10100b[_0xd08f('0x2a')]!==_0xd08f('0x38')){var _0x517dd2={};_0x517dd2[_0x10100b['name']]={'$like':'%'+_0x27d048[_0xd08f('0x2d')][_0xd08f('0x37')]+'%'};return _0x517dd2;}})});}_0x39b86a=_[_0xd08f('0x39')]({},_0x39b86a,_0x27d048[_0xd08f('0x3a')]);var _0x583d3d={'where':_0x39b86a['where']};return db[_0xd08f('0x27')][_0xd08f('0x1a')](_0x583d3d)[_0xd08f('0x20')](function(_0x54409a){_0x31ce0e[_0xd08f('0x1a')]=_0x54409a;if(_0x27d048['query'][_0xd08f('0x3b')]){_0x39b86a[_0xd08f('0x3c')]=[{'all':!![]}];}return db[_0xd08f('0x27')][_0xd08f('0x3d')](_0x39b86a);})['then'](function(_0x4b598f){_0x31ce0e[_0xd08f('0x3e')]=_0x4b598f;return _0x31ce0e;})['then'](respondWithFilteredResult(_0xde2de4,_0x39b86a))['catch'](handleError(_0xde2de4,null));};exports[_0xd08f('0x3f')]=function(_0x3ca9ef,_0x19d207){var _0x7f6aa9={'raw':!![],'where':{'id':_0x3ca9ef[_0xd08f('0x40')]['id']}},_0x1b52e7={};_0x1b52e7[_0xd08f('0x2c')]=_[_0xd08f('0x41')](db[_0xd08f('0x27')][_0xd08f('0x28')]);_0x1b52e7[_0xd08f('0x2d')]=_[_0xd08f('0x41')](_0x3ca9ef[_0xd08f('0x2d')]);_0x1b52e7[_0xd08f('0x2e')]=_[_0xd08f('0x2f')](_0x1b52e7[_0xd08f('0x2c')],_0x1b52e7['query']);_0x7f6aa9[_0xd08f('0x30')]=_[_0xd08f('0x2f')](_0x1b52e7[_0xd08f('0x2c')],qs[_0xd08f('0x31')](_0x3ca9ef['query'][_0xd08f('0x31')]));_0x7f6aa9[_0xd08f('0x30')]=_0x7f6aa9['attributes'][_0xd08f('0x42')]?_0x7f6aa9[_0xd08f('0x30')]:_0x1b52e7[_0xd08f('0x2c')];if(_0x3ca9ef[_0xd08f('0x2d')]['includeAll']){_0x7f6aa9[_0xd08f('0x3c')]=[{'all':!![]}];}_0x7f6aa9=_['merge']({},_0x7f6aa9,_0x3ca9ef['options']);return db[_0xd08f('0x27')][_0xd08f('0x43')](_0x7f6aa9)[_0xd08f('0x20')](handleEntityNotFound(_0x19d207,null))['then'](respondWithResult(_0x19d207,null))[_0xd08f('0x44')](handleError(_0x19d207,null));};exports[_0xd08f('0x45')]=function(_0x2de5fe,_0x4c0958){return db['SquareOdbc'][_0xd08f('0x45')](_0x2de5fe['body'],{})[_0xd08f('0x20')](function(_0x4e1ef8){var _0x583981=_0x2de5fe[_0xd08f('0x46')]['get']({'plain':!![]});if(!_0x583981)throw new Error(_0xd08f('0x47'));if(_0x583981[_0xd08f('0x48')]==='user'){var _0x472a58=_0x4e1ef8['get']({'plain':!![]});var _0x5573de=_0xd08f('0x22');return db['UserProfileSection'][_0xd08f('0x43')]({'where':{'name':_0x5573de,'userProfileId':_0x583981['userProfileId']},'raw':!![]})[_0xd08f('0x20')](function(_0x2f818f){if(_0x2f818f&&_0x2f818f[_0xd08f('0x49')]===0x0){return db[_0xd08f('0x4a')]['create']({'name':_0x472a58[_0xd08f('0x24')],'resourceId':_0x472a58['id'],'type':_0x2f818f[_0xd08f('0x24')],'sectionId':_0x2f818f['id']},{})['then'](function(){return _0x4e1ef8;});}else{return _0x4e1ef8;}})[_0xd08f('0x44')](function(_0x2c50f3){logger[_0xd08f('0x23')](_0xd08f('0x4b'),_0x2c50f3);throw _0x2c50f3;});}return _0x4e1ef8;})[_0xd08f('0x20')](respondWithResult(_0x4c0958,0xc9))['catch'](handleError(_0x4c0958,null));};exports[_0xd08f('0x4c')]=function(_0xa8c800,_0x3da7ed){if(_0xa8c800['body']['id']){delete _0xa8c800[_0xd08f('0x4d')]['id'];}return db[_0xd08f('0x27')][_0xd08f('0x43')]({'where':{'id':_0xa8c800[_0xd08f('0x40')]['id']}})[_0xd08f('0x20')](handleEntityNotFound(_0x3da7ed,null))['then'](saveUpdates(_0xa8c800[_0xd08f('0x4d')],null))['then'](respondWithResult(_0x3da7ed,null))[_0xd08f('0x44')](handleError(_0x3da7ed,null));};exports[_0xd08f('0x4e')]=function(_0x2f1306,_0x50fd47){return db[_0xd08f('0x27')][_0xd08f('0x43')]({'where':{'id':_0x2f1306[_0xd08f('0x40')]['id']}})[_0xd08f('0x20')](handleEntityNotFound(_0x50fd47,null))[_0xd08f('0x20')](removeEntity(_0x50fd47,null))[_0xd08f('0x44')](handleError(_0x50fd47,null));};exports[_0xd08f('0x4f')]=function(_0x2b0496,_0x1424c2,_0x4262f7){var _0x5e9917;return db[_0xd08f('0x27')][_0xd08f('0x43')]({'where':{'id':_0x2b0496[_0xd08f('0x40')]['id']},'attributes':['id',_0xd08f('0x50')]})[_0xd08f('0x20')](handleEntityNotFound(_0x1424c2,null))[_0xd08f('0x20')](function(_0x3b62ef){if(_0x3b62ef){var _0x4ca48b=require(_0xd08f('0x51'))();_0x4ca48b[_0xd08f('0x52')](_0x3b62ef[_0xd08f('0x50')]);_0x4ca48b[_0xd08f('0x53')]();return _0x3b62ef;}})['then'](respondWithResult(_0x1424c2,null))[_0xd08f('0x44')](handleError(_0x1424c2,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 3507936..d6f0196 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 _0x3895=['square_odbc','util','moment','bluebird','../../config/environment','exports','SquareOdbc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3895,0x112));var _0x5389=function(_0x2f5f97,_0x1665e2){_0x2f5f97=_0x2f5f97-0x0;var _0x164481=_0x3895[_0x2f5f97];return _0x164481;};'use strict';var _=require('lodash');var util=require(_0x5389('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5389('0x1'));var BPromise=require(_0x5389('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5389('0x3'));var attributes=require('./squareOdbc.attributes');module[_0x5389('0x4')]=function(_0x572f82,_0x314db7){return _0x572f82['define'](_0x5389('0x5'),attributes,{'tableName':_0x5389('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1548=['rimraf','./squareOdbc.attributes','exports','define','square_odbc','lodash','util','api','moment','bluebird','path'];(function(_0x1dd7eb,_0x13b76a){var _0x3e6f1b=function(_0x2b5079){while(--_0x2b5079){_0x1dd7eb['push'](_0x1dd7eb['shift']());}};_0x3e6f1b(++_0x13b76a);}(_0x1548,0x12e));var _0x8154=function(_0x206ea8,_0x8453ef){_0x206ea8=_0x206ea8-0x0;var _0x4771af=_0x1548[_0x206ea8];return _0x4771af;};'use strict';var _=require(_0x8154('0x0'));var util=require(_0x8154('0x1'));var logger=require('../../config/logger')(_0x8154('0x2'));var moment=require(_0x8154('0x3'));var BPromise=require(_0x8154('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8154('0x5'));var rimraf=require(_0x8154('0x6'));var config=require('../../config/environment');var attributes=require(_0x8154('0x7'));module[_0x8154('0x8')]=function(_0x1b5f16,_0x3c3022){return _0x1b5f16[_0x8154('0x9')]('SquareOdbc',attributes,{'tableName':_0x8154('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 650e57f..a438960 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 _0x9957=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x19ecb3,_0xa45bee){var _0x1c510e=function(_0x9440b9){while(--_0x9440b9){_0x19ecb3['push'](_0x19ecb3['shift']());}};_0x1c510e(++_0xa45bee);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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']('SquareOdbc,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['SquareOdbc'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowSquareOdbc',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x7217=['where','attributes','map','include','model','ShowSquareOdbc','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw'];(function(_0x58a476,_0x291496){var _0x159e6f=function(_0x3c352e){while(--_0x3c352e){_0x58a476['push'](_0x58a476['shift']());}};_0x159e6f(++_0x291496);}(_0x7217,0x19e));var _0x7721=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7217[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowSquareOdbc']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowSquareOdbc',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f4fccf4..aa6ef4a 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 _0xe84f=['/:id','show','getUsers','post','create','/:id/users','addUsers','update','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','get'];(function(_0x64f672,_0xad6bed){var _0x1e63a9=function(_0x148740){while(--_0x148740){_0x64f672['push'](_0x64f672['shift']());}};_0x1e63a9(++_0xad6bed);}(_0xe84f,0xaa));var _0xfe84=function(_0x3a8478,_0x4be1cb){_0x3a8478=_0x3a8478-0x0;var _0x27b185=_0xe84f[_0x3a8478];return _0x27b185;};'use strict';var multer=require(_0xfe84('0x0'));var util=require('util');var path=require(_0xfe84('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe84('0x2'));var router=express['Router']();var fs_extra=require(_0xfe84('0x3'));var auth=require(_0xfe84('0x4'));var interaction=require(_0xfe84('0x5'));var config=require(_0xfe84('0x6'));var controller=require(_0xfe84('0x7'));router['get']('/',auth[_0xfe84('0x8')](),controller['index']);router[_0xfe84('0x9')](_0xfe84('0xa'),auth[_0xfe84('0x8')](),controller[_0xfe84('0xb')]);router['get']('/:id/users',auth[_0xfe84('0x8')](),controller[_0xfe84('0xc')]);router[_0xfe84('0xd')]('/',auth[_0xfe84('0x8')](),controller[_0xfe84('0xe')]);router[_0xfe84('0xd')](_0xfe84('0xf'),auth[_0xfe84('0x8')](),controller[_0xfe84('0x10')]);router['put']('/:id',auth[_0xfe84('0x8')](),controller[_0xfe84('0x11')]);router[_0xfe84('0x12')](_0xfe84('0xa'),auth['isAuthenticated'](),controller[_0xfe84('0x13')]);router[_0xfe84('0x12')](_0xfe84('0xf'),auth[_0xfe84('0x8')](),controller['removeUsers']);module['exports']=router; \ No newline at end of file +var _0xb8e1=['get','getUsers','post','create','addUsers','put','delete','destroy','/:id/users','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show'];(function(_0x3a1de8,_0x3cd4c0){var _0x1d4499=function(_0x47aeca){while(--_0x47aeca){_0x3a1de8['push'](_0x3a1de8['shift']());}};_0x1d4499(++_0x3cd4c0);}(_0xb8e1,0x11a));var _0x1b8e=function(_0x2f199a,_0x151017){_0x2f199a=_0x2f199a-0x0;var _0x393ae9=_0xb8e1[_0x2f199a];return _0x393ae9;};'use strict';var multer=require(_0x1b8e('0x0'));var util=require(_0x1b8e('0x1'));var path=require('path');var timeout=require(_0x1b8e('0x2'));var express=require('express');var router=express[_0x1b8e('0x3')]();var fs_extra=require(_0x1b8e('0x4'));var auth=require(_0x1b8e('0x5'));var interaction=require(_0x1b8e('0x6'));var config=require(_0x1b8e('0x7'));var controller=require('./squareProject.controller');router['get']('/',auth[_0x1b8e('0x8')](),controller[_0x1b8e('0x9')]);router['get'](_0x1b8e('0xa'),auth['isAuthenticated'](),controller[_0x1b8e('0xb')]);router[_0x1b8e('0xc')]('/:id/users',auth[_0x1b8e('0x8')](),controller[_0x1b8e('0xd')]);router[_0x1b8e('0xe')]('/',auth[_0x1b8e('0x8')](),controller[_0x1b8e('0xf')]);router[_0x1b8e('0xe')]('/:id/users',auth[_0x1b8e('0x8')](),controller[_0x1b8e('0x10')]);router[_0x1b8e('0x11')]('/:id',auth[_0x1b8e('0x8')](),controller['update']);router[_0x1b8e('0x12')](_0x1b8e('0xa'),auth[_0x1b8e('0x8')](),controller[_0x1b8e('0x13')]);router[_0x1b8e('0x12')](_0x1b8e('0x14'),auth['isAuthenticated'](),controller['removeUsers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 0111210..18bdc52 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 _0x7763=['TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING'];(function(_0x28b7ab,_0x16a764){var _0x56791b=function(_0x25d20d){while(--_0x25d20d){_0x28b7ab['push'](_0x28b7ab['shift']());}};_0x56791b(++_0x16a764);}(_0x7763,0x135));var _0x3776=function(_0x2a1507,_0x729808){_0x2a1507=_0x2a1507-0x0;var _0x557b4f=_0x7763[_0x2a1507];return _0x557b4f;};'use strict';var Sequelize=require(_0x3776('0x0'));module[_0x3776('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x3776('0x2')]},'notes':{'type':Sequelize[_0x3776('0x3')]},'preproduction':{'type':Sequelize[_0x3776('0x4')](_0x3776('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x3776('0x6')](_0x3776('0x7'))[_0x3776('0x8')](_0x3776('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0x3776('0x5')),'get':function(){if(this[_0x3776('0x6')](_0x3776('0xa'))){return this[_0x3776('0x6')](_0x3776('0xa'))[_0x3776('0x8')](_0x3776('0x9'));}}},'savedAt':{'type':Sequelize[_0x3776('0xb')]},'publishedAt':{'type':Sequelize[_0x3776('0xb')]}}; \ No newline at end of file +var _0x0cde=['production','DATE','exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0cde,0x1d0));var _0xe0cd=function(_0x4e4e65,_0xb2c8f7){_0x4e4e65=_0x4e4e65-0x0;var _0x671905=_0x0cde[_0x4e4e65];return _0x671905;};'use strict';var Sequelize=require('sequelize');module[_0xe0cd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xe0cd('0x1')]},'notes':{'type':Sequelize[_0xe0cd('0x2')]},'preproduction':{'type':Sequelize[_0xe0cd('0x3')](_0xe0cd('0x4')),'get':function(){if(this[_0xe0cd('0x5')](_0xe0cd('0x6'))){return this[_0xe0cd('0x5')](_0xe0cd('0x6'))[_0xe0cd('0x7')](_0xe0cd('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xe0cd('0x4')),'get':function(){if(this[_0xe0cd('0x5')]('production')){return this['getDataValue'](_0xe0cd('0x9'))[_0xe0cd('0x7')](_0xe0cd('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xe0cd('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 71a803a..c44e7b3 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 _0xe204=['fields','length','hasOwnProperty','offset','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','rows','catch','params','keys','rawAttributes','includeAll','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','User','getUsers','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','SquareProjects','UserProfileResource','stack','name','send','SquareProject','fieldName','type','model','map','query','attributes','intersection'];(function(_0x3314a3,_0x712212){var _0xc5d6a4=function(_0x34cac2){while(--_0x34cac2){_0x3314a3['push'](_0x3314a3['shift']());}};_0xc5d6a4(++_0x712212);}(_0xe204,0x196));var _0x4e20=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe204[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4e20('0x0'));var jsonpatch=require(_0x4e20('0x1'));var rp=require('request-promise');var moment=require(_0x4e20('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4e20('0x3'));var util=require(_0x4e20('0x4'));var path=require('path');var sox=require(_0x4e20('0x5'));var csv=require(_0x4e20('0x6'));var ejs=require(_0x4e20('0x7'));var fs=require('fs');var fs_extra=require(_0x4e20('0x8'));var _=require(_0x4e20('0x9'));var squel=require('squel');var crypto=require(_0x4e20('0xa'));var jsforce=require(_0x4e20('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4e20('0x6'));var querystring=require(_0x4e20('0xc'));var Papa=require(_0x4e20('0xd'));var Redis=require(_0x4e20('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4e20('0xf'));var hardwareService=require(_0x4e20('0x10'));var logger=require(_0x4e20('0x11'))(_0x4e20('0x12'));var utils=require(_0x4e20('0x13'));var config=require(_0x4e20('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x4e20('0x15')](config[_0x4e20('0x16')],{'host':_0x4e20('0x17'),'port':0x18eb});var socket=require(_0x4e20('0x18'))(new Redis(config['redis']));require(_0x4e20('0x19'))[_0x4e20('0x1a')](socket);function respondWithStatusCode(_0x44dfac,_0x56fcb9){_0x56fcb9=_0x56fcb9||0xcc;return function(_0x109d2d){if(_0x109d2d){return _0x44dfac[_0x4e20('0x1b')](_0x56fcb9);}return _0x44dfac[_0x4e20('0x1c')](_0x56fcb9)[_0x4e20('0x1d')]();};}function respondWithResult(_0x4ec530,_0x2cc981){_0x2cc981=_0x2cc981||0xc8;return function(_0x9f5a69){if(_0x9f5a69){return _0x4ec530['status'](_0x2cc981)[_0x4e20('0x1e')](_0x9f5a69);}};}function respondWithFilteredResult(_0x2c7ca4,_0x2382d3){return function(_0xea89e9){if(_0xea89e9){var _0x2a28ee=_0xea89e9[_0x4e20('0x1f')],_0x48e105=_0x2382d3['offset'],_0x31d571=_0x2382d3['offset']+_0x2382d3[_0x4e20('0x20')],_0x429018;if(_0x31d571>=_0x2a28ee){_0x31d571=_0x2a28ee;_0x429018=0xc8;}else{_0x429018=0xce;}_0x2c7ca4[_0x4e20('0x1c')](_0x429018);return _0x2c7ca4[_0x4e20('0x21')](_0x4e20('0x22'),_0x48e105+'-'+_0x31d571+'/'+_0x2a28ee)[_0x4e20('0x1e')](_0xea89e9);}return null;};}function patchUpdates(_0x557314){return function(_0x38704b){try{jsonpatch[_0x4e20('0x23')](_0x38704b,_0x557314,!![]);}catch(_0x2a4c3a){return BPromise[_0x4e20('0x24')](_0x2a4c3a);}return _0x38704b[_0x4e20('0x25')]();};}function saveUpdates(_0x229a2e,_0x2c9a3b){return function(_0x1ae0bf){if(_0x1ae0bf){return _0x1ae0bf[_0x4e20('0x26')](_0x229a2e)[_0x4e20('0x27')](function(_0x5318e0){return _0x5318e0;});}return null;};}function removeEntity(_0x9fe972,_0x413ac4){return function(_0x3e4e6a){if(_0x3e4e6a){return _0x3e4e6a[_0x4e20('0x28')]()['then'](function(){var _0x2a54b3=_0x3e4e6a['get']({'plain':!![]});var _0x4797db=_0x4e20('0x29');return db[_0x4e20('0x2a')][_0x4e20('0x28')]({'where':{'type':_0x4797db,'resourceId':_0x2a54b3['id']}})[_0x4e20('0x27')](function(){return _0x3e4e6a;});})[_0x4e20('0x27')](function(){_0x9fe972[_0x4e20('0x1c')](0xcc)[_0x4e20('0x1d')]();});}};}function handleEntityNotFound(_0xdb8ebd,_0x46786a){return function(_0x24666a){if(!_0x24666a){_0xdb8ebd['sendStatus'](0x194);}return _0x24666a;};}function handleError(_0x37d42f,_0x15e182){_0x15e182=_0x15e182||0x1f4;return function(_0x1a7893){logger['error'](_0x1a7893[_0x4e20('0x2b')]);if(_0x1a7893['name']){delete _0x1a7893[_0x4e20('0x2c')];}_0x37d42f[_0x4e20('0x1c')](_0x15e182)[_0x4e20('0x2d')](_0x1a7893);};}exports['index']=function(_0x2d9078,_0x572fa2){var _0x420745={},_0x20f782={},_0x4f238e={'count':0x0,'rows':[]};var _0x4c1285=_['map'](db[_0x4e20('0x2e')]['rawAttributes'],function(_0x578e08){return{'name':_0x578e08[_0x4e20('0x2f')],'type':_0x578e08[_0x4e20('0x30')]['key']};});_0x20f782[_0x4e20('0x31')]=_[_0x4e20('0x32')](_0x4c1285,_0x4e20('0x2c'));_0x20f782['query']=_['keys'](_0x2d9078[_0x4e20('0x33')]);_0x20f782['filters']=_['intersection'](_0x20f782[_0x4e20('0x31')],_0x20f782[_0x4e20('0x33')]);_0x420745[_0x4e20('0x34')]=_[_0x4e20('0x35')](_0x20f782[_0x4e20('0x31')],qs['fields'](_0x2d9078[_0x4e20('0x33')][_0x4e20('0x36')]));_0x420745[_0x4e20('0x34')]=_0x420745[_0x4e20('0x34')][_0x4e20('0x37')]?_0x420745['attributes']:_0x20f782[_0x4e20('0x31')];if(!_0x2d9078['query'][_0x4e20('0x38')]('nolimit')){_0x420745['limit']=qs[_0x4e20('0x20')](_0x2d9078['query'][_0x4e20('0x20')]);_0x420745[_0x4e20('0x39')]=qs['offset'](_0x2d9078[_0x4e20('0x33')][_0x4e20('0x39')]);}_0x420745[_0x4e20('0x3a')]=qs[_0x4e20('0x3b')](_0x2d9078['query'][_0x4e20('0x3b')]);_0x420745[_0x4e20('0x3c')]=qs[_0x4e20('0x3d')](_[_0x4e20('0x3e')](_0x2d9078[_0x4e20('0x33')],_0x20f782['filters']),_0x4c1285);if(_0x2d9078['query'][_0x4e20('0x3f')]){_0x420745['where']=_['merge'](_0x420745[_0x4e20('0x3c')],{'$or':_[_0x4e20('0x32')](_0x4c1285,function(_0x367bbe){if(_0x367bbe['type']!==_0x4e20('0x40')){var _0x12173f={};_0x12173f[_0x367bbe[_0x4e20('0x2c')]]={'$like':'%'+_0x2d9078[_0x4e20('0x33')][_0x4e20('0x3f')]+'%'};return _0x12173f;}})});}_0x420745=_[_0x4e20('0x41')]({},_0x420745,_0x2d9078['options']);var _0x598dc7={'where':_0x420745[_0x4e20('0x3c')]};return db['SquareProject'][_0x4e20('0x1f')](_0x598dc7)[_0x4e20('0x27')](function(_0x5f2f5f){_0x4f238e[_0x4e20('0x1f')]=_0x5f2f5f;if(_0x2d9078[_0x4e20('0x33')]['includeAll']){_0x420745[_0x4e20('0x42')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x420745);})[_0x4e20('0x27')](function(_0x1d10bb){_0x4f238e[_0x4e20('0x43')]=_0x1d10bb;return _0x4f238e;})[_0x4e20('0x27')](respondWithFilteredResult(_0x572fa2,_0x420745))[_0x4e20('0x44')](handleError(_0x572fa2,null));};exports['show']=function(_0x18d4f8,_0xbc840e){var _0x1cfe35={'raw':![],'where':{'id':_0x18d4f8[_0x4e20('0x45')]['id']}},_0x3658e7={};_0x3658e7[_0x4e20('0x31')]=_[_0x4e20('0x46')](db[_0x4e20('0x2e')][_0x4e20('0x47')]);_0x3658e7[_0x4e20('0x33')]=_[_0x4e20('0x46')](_0x18d4f8['query']);_0x3658e7[_0x4e20('0x3d')]=_['intersection'](_0x3658e7['model'],_0x3658e7['query']);_0x1cfe35[_0x4e20('0x34')]=_[_0x4e20('0x35')](_0x3658e7[_0x4e20('0x31')],qs[_0x4e20('0x36')](_0x18d4f8[_0x4e20('0x33')][_0x4e20('0x36')]));_0x1cfe35[_0x4e20('0x34')]=_0x1cfe35[_0x4e20('0x34')][_0x4e20('0x37')]?_0x1cfe35[_0x4e20('0x34')]:_0x3658e7['model'];if(_0x18d4f8[_0x4e20('0x33')][_0x4e20('0x48')]){_0x1cfe35[_0x4e20('0x42')]=[{'all':!![]}];}_0x1cfe35=_[_0x4e20('0x41')]({},_0x1cfe35,_0x18d4f8[_0x4e20('0x49')]);return db[_0x4e20('0x2e')][_0x4e20('0x4a')](_0x1cfe35)['then'](handleEntityNotFound(_0xbc840e,null))['then'](respondWithResult(_0xbc840e,null))['catch'](handleError(_0xbc840e,null));};exports['create']=function(_0x175fca,_0x2240a6){return db['SquareProject'][_0x4e20('0x4b')](_0x175fca['body'],{})[_0x4e20('0x27')](function(_0x302df5){var _0x225d5c=_0x175fca[_0x4e20('0x4c')][_0x4e20('0x4d')]({'plain':!![]});if(!_0x225d5c)throw new Error(_0x4e20('0x4e'));if(_0x225d5c[_0x4e20('0x4f')]===_0x4e20('0x4c')){var _0x5c341a=_0x302df5[_0x4e20('0x4d')]({'plain':!![]});var _0x379d3b='SquareProjects';return db['UserProfileSection']['find']({'where':{'name':_0x379d3b,'userProfileId':_0x225d5c[_0x4e20('0x50')]},'raw':!![]})[_0x4e20('0x27')](function(_0x99144c){if(_0x99144c&&_0x99144c['autoAssociation']===0x0){return db[_0x4e20('0x2a')][_0x4e20('0x4b')]({'name':_0x5c341a[_0x4e20('0x2c')],'resourceId':_0x5c341a['id'],'type':_0x99144c[_0x4e20('0x2c')],'sectionId':_0x99144c['id']},{})[_0x4e20('0x27')](function(){return _0x302df5;});}else{return _0x302df5;}})[_0x4e20('0x44')](function(_0x1a4271){logger[_0x4e20('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a4271);throw _0x1a4271;});}return _0x302df5;})[_0x4e20('0x27')](respondWithResult(_0x2240a6,0xc9))[_0x4e20('0x44')](handleError(_0x2240a6,null));};exports[_0x4e20('0x26')]=function(_0x427443,_0x538529){if(_0x427443[_0x4e20('0x52')]['id']){delete _0x427443[_0x4e20('0x52')]['id'];}return db[_0x4e20('0x2e')][_0x4e20('0x4a')]({'where':{'id':_0x427443['params']['id']}})[_0x4e20('0x27')](handleEntityNotFound(_0x538529,null))[_0x4e20('0x27')](saveUpdates(_0x427443[_0x4e20('0x52')],null))[_0x4e20('0x27')](respondWithResult(_0x538529,null))[_0x4e20('0x44')](handleError(_0x538529,null));};exports[_0x4e20('0x28')]=function(_0x175ba6,_0x2070c2){return db['SquareProject'][_0x4e20('0x4a')]({'where':{'id':_0x175ba6[_0x4e20('0x45')]['id']}})[_0x4e20('0x27')](handleEntityNotFound(_0x2070c2,null))[_0x4e20('0x27')](removeEntity(_0x2070c2,null))[_0x4e20('0x44')](handleError(_0x2070c2,null));};exports[_0x4e20('0x53')]=function(_0x5fb475,_0x2e6724,_0x1e4c44){return db['SquareProject'][_0x4e20('0x4a')]({'where':{'id':_0x5fb475[_0x4e20('0x45')]['id']}})[_0x4e20('0x27')](handleEntityNotFound(_0x2e6724,null))['then'](function(_0x38300e){if(_0x38300e){return _0x38300e[_0x4e20('0x53')](_0x5fb475[_0x4e20('0x52')][_0x4e20('0x54')],_[_0x4e20('0x55')](_0x5fb475['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x2e6724,null))[_0x4e20('0x44')](handleError(_0x2e6724,null));};exports[_0x4e20('0x56')]=function(_0x3c5c55,_0x5acb49,_0x5878e4){return db[_0x4e20('0x2e')][_0x4e20('0x4a')]({'where':{'id':_0x3c5c55[_0x4e20('0x45')]['id']}})[_0x4e20('0x27')](handleEntityNotFound(_0x5acb49,null))[_0x4e20('0x27')](function(_0x21980a){if(_0x21980a){return _0x21980a[_0x4e20('0x56')](_0x3c5c55[_0x4e20('0x33')][_0x4e20('0x54')])[_0x4e20('0x27')](function(){if(_[_0x4e20('0x57')](_0x3c5c55['query']['ids'])){for(var _0x1b53bf=0x0;_0x1b53bf<_0x3c5c55[_0x4e20('0x33')]['ids'][_0x4e20('0x37')];_0x1b53bf+=0x1){socket[_0x4e20('0x58')](_0x4e20('0x59'),{'UserId':Number(_0x3c5c55[_0x4e20('0x33')][_0x4e20('0x54')][_0x1b53bf]),'SquareProjectId':Number(_0x3c5c55[_0x4e20('0x45')]['id'])});}}else{socket['emit'](_0x4e20('0x59'),{'UserId':Number(_0x3c5c55[_0x4e20('0x33')][_0x4e20('0x54')]),'SquareProjectId':Number(_0x3c5c55[_0x4e20('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x5acb49,null))[_0x4e20('0x44')](handleError(_0x5acb49,null));};exports['getUsers']=function(_0x5bfe84,_0x4e3b74,_0x271604){var _0x16ec52={};var _0x54e52f={};var _0x4c4800;var _0x28edb7;return db[_0x4e20('0x2e')]['findOne']({'where':{'id':_0x5bfe84[_0x4e20('0x45')]['id']}})[_0x4e20('0x27')](handleEntityNotFound(_0x4e3b74,null))['then'](function(_0x410ae0){if(_0x410ae0){_0x4c4800=_0x410ae0;_0x54e52f[_0x4e20('0x31')]=_['keys'](db[_0x4e20('0x5a')]['rawAttributes']);_0x54e52f['query']=_[_0x4e20('0x46')](_0x5bfe84[_0x4e20('0x33')]);_0x54e52f[_0x4e20('0x3d')]=_['intersection'](_0x54e52f[_0x4e20('0x31')],_0x54e52f[_0x4e20('0x33')]);_0x16ec52['attributes']=_[_0x4e20('0x35')](_0x54e52f[_0x4e20('0x31')],qs[_0x4e20('0x36')](_0x5bfe84['query']['fields']));_0x16ec52[_0x4e20('0x34')]=_0x16ec52[_0x4e20('0x34')]['length']?_0x16ec52['attributes']:_0x54e52f['model'];_0x16ec52['order']=qs[_0x4e20('0x3b')](_0x5bfe84[_0x4e20('0x33')]['sort']);_0x16ec52[_0x4e20('0x3c')]=qs[_0x4e20('0x3d')](_[_0x4e20('0x3e')](_0x5bfe84[_0x4e20('0x33')],_0x54e52f['filters']));if(_0x5bfe84[_0x4e20('0x33')][_0x4e20('0x3f')]){_0x16ec52[_0x4e20('0x3c')]=_[_0x4e20('0x41')](_0x16ec52['where'],{'$or':_[_0x4e20('0x32')](_0x16ec52[_0x4e20('0x34')],function(_0x46a8c6){var _0x3b2ea4={};_0x3b2ea4[_0x46a8c6]={'$like':'%'+_0x5bfe84[_0x4e20('0x33')][_0x4e20('0x3f')]+'%'};return _0x3b2ea4;})});}_0x16ec52=_[_0x4e20('0x41')]({},_0x16ec52,_0x5bfe84[_0x4e20('0x49')]);return _0x4c4800[_0x4e20('0x5b')](_0x16ec52);}})[_0x4e20('0x27')](function(_0x349bb2){if(_0x349bb2){_0x28edb7=_0x349bb2[_0x4e20('0x37')];if(!_0x5bfe84[_0x4e20('0x33')]['hasOwnProperty']('nolimit')){_0x16ec52['limit']=qs[_0x4e20('0x20')](_0x5bfe84[_0x4e20('0x33')][_0x4e20('0x20')]);_0x16ec52[_0x4e20('0x39')]=qs[_0x4e20('0x39')](_0x5bfe84[_0x4e20('0x33')]['offset']);}return _0x4c4800['getUsers'](_0x16ec52);}})[_0x4e20('0x27')](function(_0x2ad87a){if(_0x2ad87a){return _0x2ad87a?{'count':_0x28edb7,'rows':_0x2ad87a}:null;}})[_0x4e20('0x27')](respondWithResult(_0x4e3b74,null))['catch'](handleError(_0x4e3b74,null));}; \ No newline at end of file +var _0x36c7=['role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','find','ids','removeUsers','userSquareProject:remove','emit','findOne','User','getUsers','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','get','SquareProjects','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x36c7,0x186));var _0x736c=function(_0x2e4fd9,_0x25ea75){_0x2e4fd9=_0x2e4fd9-0x0;var _0x1618bb=_0x36c7[_0x2e4fd9];return _0x1618bb;};'use strict';var emlformat=require(_0x736c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x736c('0x1'));var jsonpatch=require(_0x736c('0x2'));var rp=require('request-promise');var moment=require(_0x736c('0x3'));var BPromise=require(_0x736c('0x4'));var Mustache=require('mustache');var util=require(_0x736c('0x5'));var path=require(_0x736c('0x6'));var sox=require(_0x736c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x736c('0x8'));var _=require(_0x736c('0x9'));var squel=require(_0x736c('0xa'));var crypto=require(_0x736c('0xb'));var jsforce=require(_0x736c('0xc'));var deskjs=require(_0x736c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x736c('0xe'));var Redis=require(_0x736c('0xf'));var authService=require(_0x736c('0x10'));var qs=require(_0x736c('0x11'));var as=require(_0x736c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x736c('0x13'))(_0x736c('0x14'));var utils=require(_0x736c('0x15'));var config=require(_0x736c('0x16'));var licenseUtil=require(_0x736c('0x17'));var db=require(_0x736c('0x18'))['db'];config[_0x736c('0x19')]=_['defaults'](config[_0x736c('0x19')],{'host':_0x736c('0x1a'),'port':0x18eb});var socket=require(_0x736c('0x1b'))(new Redis(config[_0x736c('0x19')]));require(_0x736c('0x1c'))[_0x736c('0x1d')](socket);function respondWithStatusCode(_0x490746,_0x7ba6d1){_0x7ba6d1=_0x7ba6d1||0xcc;return function(_0x78903c){if(_0x78903c){return _0x490746[_0x736c('0x1e')](_0x7ba6d1);}return _0x490746[_0x736c('0x1f')](_0x7ba6d1)[_0x736c('0x20')]();};}function respondWithResult(_0x2943ab,_0x2691a9){_0x2691a9=_0x2691a9||0xc8;return function(_0x52f6c7){if(_0x52f6c7){return _0x2943ab[_0x736c('0x1f')](_0x2691a9)[_0x736c('0x21')](_0x52f6c7);}};}function respondWithFilteredResult(_0x4ff27f,_0x27f9fd){return function(_0x13c1e1){if(_0x13c1e1){var _0x12c8f9=_0x13c1e1[_0x736c('0x22')],_0x247a44=_0x27f9fd[_0x736c('0x23')],_0x311d91=_0x27f9fd['offset']+_0x27f9fd[_0x736c('0x24')],_0x67cb87;if(_0x311d91>=_0x12c8f9){_0x311d91=_0x12c8f9;_0x67cb87=0xc8;}else{_0x67cb87=0xce;}_0x4ff27f['status'](_0x67cb87);return _0x4ff27f[_0x736c('0x25')](_0x736c('0x26'),_0x247a44+'-'+_0x311d91+'/'+_0x12c8f9)[_0x736c('0x21')](_0x13c1e1);}return null;};}function patchUpdates(_0x443e98){return function(_0x35364a){try{jsonpatch['apply'](_0x35364a,_0x443e98,!![]);}catch(_0x5cdab4){return BPromise[_0x736c('0x27')](_0x5cdab4);}return _0x35364a['save']();};}function saveUpdates(_0x2f4ef5,_0xc73eb5){return function(_0x1c5d1b){if(_0x1c5d1b){return _0x1c5d1b[_0x736c('0x28')](_0x2f4ef5)[_0x736c('0x29')](function(_0x22d21f){return _0x22d21f;});}return null;};}function removeEntity(_0x4ad085,_0x1ad484){return function(_0x5aa088){if(_0x5aa088){return _0x5aa088[_0x736c('0x2a')]()[_0x736c('0x29')](function(){var _0x13a6f2=_0x5aa088[_0x736c('0x2b')]({'plain':!![]});var _0x1c852a=_0x736c('0x2c');return db['UserProfileResource'][_0x736c('0x2a')]({'where':{'type':_0x1c852a,'resourceId':_0x13a6f2['id']}})[_0x736c('0x29')](function(){return _0x5aa088;});})[_0x736c('0x29')](function(){_0x4ad085[_0x736c('0x1f')](0xcc)[_0x736c('0x20')]();});}};}function handleEntityNotFound(_0x4074f4,_0x2cf5ad){return function(_0x3dd7bf){if(!_0x3dd7bf){_0x4074f4['sendStatus'](0x194);}return _0x3dd7bf;};}function handleError(_0x5cc472,_0x3428a7){_0x3428a7=_0x3428a7||0x1f4;return function(_0x5e2ad4){logger['error'](_0x5e2ad4[_0x736c('0x2d')]);if(_0x5e2ad4[_0x736c('0x2e')]){delete _0x5e2ad4[_0x736c('0x2e')];}_0x5cc472[_0x736c('0x1f')](_0x3428a7)[_0x736c('0x2f')](_0x5e2ad4);};}exports[_0x736c('0x30')]=function(_0x1e4a99,_0x353ff5){var _0x1975e4={},_0x41fc38={},_0x4e0d94={'count':0x0,'rows':[]};var _0xef61fb=_[_0x736c('0x31')](db[_0x736c('0x32')][_0x736c('0x33')],function(_0x264607){return{'name':_0x264607[_0x736c('0x34')],'type':_0x264607['type']['key']};});_0x41fc38[_0x736c('0x35')]=_[_0x736c('0x31')](_0xef61fb,_0x736c('0x2e'));_0x41fc38[_0x736c('0x36')]=_[_0x736c('0x37')](_0x1e4a99[_0x736c('0x36')]);_0x41fc38['filters']=_[_0x736c('0x38')](_0x41fc38[_0x736c('0x35')],_0x41fc38[_0x736c('0x36')]);_0x1975e4[_0x736c('0x39')]=_[_0x736c('0x38')](_0x41fc38[_0x736c('0x35')],qs[_0x736c('0x3a')](_0x1e4a99[_0x736c('0x36')][_0x736c('0x3a')]));_0x1975e4[_0x736c('0x39')]=_0x1975e4[_0x736c('0x39')][_0x736c('0x3b')]?_0x1975e4[_0x736c('0x39')]:_0x41fc38['model'];if(!_0x1e4a99[_0x736c('0x36')][_0x736c('0x3c')](_0x736c('0x3d'))){_0x1975e4[_0x736c('0x24')]=qs[_0x736c('0x24')](_0x1e4a99[_0x736c('0x36')][_0x736c('0x24')]);_0x1975e4[_0x736c('0x23')]=qs[_0x736c('0x23')](_0x1e4a99[_0x736c('0x36')][_0x736c('0x23')]);}_0x1975e4['order']=qs[_0x736c('0x3e')](_0x1e4a99[_0x736c('0x36')][_0x736c('0x3e')]);_0x1975e4[_0x736c('0x3f')]=qs[_0x736c('0x40')](_[_0x736c('0x41')](_0x1e4a99[_0x736c('0x36')],_0x41fc38[_0x736c('0x40')]),_0xef61fb);if(_0x1e4a99[_0x736c('0x36')][_0x736c('0x42')]){_0x1975e4['where']=_[_0x736c('0x43')](_0x1975e4[_0x736c('0x3f')],{'$or':_[_0x736c('0x31')](_0xef61fb,function(_0x4e5bc2){if(_0x4e5bc2['type']!==_0x736c('0x44')){var _0x44aef5={};_0x44aef5[_0x4e5bc2[_0x736c('0x2e')]]={'$like':'%'+_0x1e4a99[_0x736c('0x36')][_0x736c('0x42')]+'%'};return _0x44aef5;}})});}_0x1975e4=_[_0x736c('0x43')]({},_0x1975e4,_0x1e4a99[_0x736c('0x45')]);var _0x3cabd2={'where':_0x1975e4['where']};return db[_0x736c('0x32')][_0x736c('0x22')](_0x3cabd2)[_0x736c('0x29')](function(_0x328a1f){_0x4e0d94[_0x736c('0x22')]=_0x328a1f;if(_0x1e4a99[_0x736c('0x36')][_0x736c('0x46')]){_0x1975e4['include']=[{'all':!![]}];}return db[_0x736c('0x32')][_0x736c('0x47')](_0x1975e4);})['then'](function(_0x2c1a37){_0x4e0d94['rows']=_0x2c1a37;return _0x4e0d94;})['then'](respondWithFilteredResult(_0x353ff5,_0x1975e4))[_0x736c('0x48')](handleError(_0x353ff5,null));};exports[_0x736c('0x49')]=function(_0x31ee18,_0x4ee7da){var _0x4da76b={'raw':![],'where':{'id':_0x31ee18[_0x736c('0x4a')]['id']}},_0x30ed6d={};_0x30ed6d[_0x736c('0x35')]=_[_0x736c('0x37')](db[_0x736c('0x32')][_0x736c('0x33')]);_0x30ed6d['query']=_['keys'](_0x31ee18[_0x736c('0x36')]);_0x30ed6d[_0x736c('0x40')]=_[_0x736c('0x38')](_0x30ed6d[_0x736c('0x35')],_0x30ed6d['query']);_0x4da76b[_0x736c('0x39')]=_[_0x736c('0x38')](_0x30ed6d[_0x736c('0x35')],qs[_0x736c('0x3a')](_0x31ee18[_0x736c('0x36')][_0x736c('0x3a')]));_0x4da76b[_0x736c('0x39')]=_0x4da76b[_0x736c('0x39')]['length']?_0x4da76b[_0x736c('0x39')]:_0x30ed6d[_0x736c('0x35')];if(_0x31ee18[_0x736c('0x36')]['includeAll']){_0x4da76b[_0x736c('0x4b')]=[{'all':!![]}];}_0x4da76b=_[_0x736c('0x43')]({},_0x4da76b,_0x31ee18[_0x736c('0x45')]);return db[_0x736c('0x32')]['find'](_0x4da76b)[_0x736c('0x29')](handleEntityNotFound(_0x4ee7da,null))[_0x736c('0x29')](respondWithResult(_0x4ee7da,null))[_0x736c('0x48')](handleError(_0x4ee7da,null));};exports[_0x736c('0x4c')]=function(_0x3d04b5,_0x279a52){return db[_0x736c('0x32')][_0x736c('0x4c')](_0x3d04b5[_0x736c('0x4d')],{})['then'](function(_0x2e1c06){var _0x4e9fa3=_0x3d04b5[_0x736c('0x4e')]['get']({'plain':!![]});if(!_0x4e9fa3)throw new Error(_0x736c('0x4f'));if(_0x4e9fa3[_0x736c('0x50')]===_0x736c('0x4e')){var _0x25baa4=_0x2e1c06[_0x736c('0x2b')]({'plain':!![]});var _0x19896c=_0x736c('0x2c');return db[_0x736c('0x51')]['find']({'where':{'name':_0x19896c,'userProfileId':_0x4e9fa3[_0x736c('0x52')]},'raw':!![]})['then'](function(_0xad0014){if(_0xad0014&&_0xad0014['autoAssociation']===0x0){return db['UserProfileResource'][_0x736c('0x4c')]({'name':_0x25baa4[_0x736c('0x2e')],'resourceId':_0x25baa4['id'],'type':_0xad0014[_0x736c('0x2e')],'sectionId':_0xad0014['id']},{})[_0x736c('0x29')](function(){return _0x2e1c06;});}else{return _0x2e1c06;}})[_0x736c('0x48')](function(_0x9bdbd5){logger[_0x736c('0x53')](_0x736c('0x54'),_0x9bdbd5);throw _0x9bdbd5;});}return _0x2e1c06;})[_0x736c('0x29')](respondWithResult(_0x279a52,0xc9))['catch'](handleError(_0x279a52,null));};exports[_0x736c('0x28')]=function(_0x4db490,_0x3ec466){if(_0x4db490[_0x736c('0x4d')]['id']){delete _0x4db490['body']['id'];}return db[_0x736c('0x32')]['find']({'where':{'id':_0x4db490[_0x736c('0x4a')]['id']}})[_0x736c('0x29')](handleEntityNotFound(_0x3ec466,null))[_0x736c('0x29')](saveUpdates(_0x4db490['body'],null))['then'](respondWithResult(_0x3ec466,null))[_0x736c('0x48')](handleError(_0x3ec466,null));};exports[_0x736c('0x2a')]=function(_0x3fdad7,_0x4d1651){return db[_0x736c('0x32')]['find']({'where':{'id':_0x3fdad7[_0x736c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4d1651,null))['then'](removeEntity(_0x4d1651,null))['catch'](handleError(_0x4d1651,null));};exports[_0x736c('0x55')]=function(_0x4be483,_0x279e24,_0x260c5c){return db['SquareProject'][_0x736c('0x56')]({'where':{'id':_0x4be483[_0x736c('0x4a')]['id']}})[_0x736c('0x29')](handleEntityNotFound(_0x279e24,null))['then'](function(_0x248d8e){if(_0x248d8e){return _0x248d8e[_0x736c('0x55')](_0x4be483[_0x736c('0x4d')][_0x736c('0x57')],_['omit'](_0x4be483['body'],[_0x736c('0x57'),'id'])||{});}})[_0x736c('0x29')](respondWithResult(_0x279e24,null))[_0x736c('0x48')](handleError(_0x279e24,null));};exports[_0x736c('0x58')]=function(_0x102846,_0x155027,_0x6ad42a){return db[_0x736c('0x32')][_0x736c('0x56')]({'where':{'id':_0x102846[_0x736c('0x4a')]['id']}})[_0x736c('0x29')](handleEntityNotFound(_0x155027,null))[_0x736c('0x29')](function(_0x1039a0){if(_0x1039a0){return _0x1039a0[_0x736c('0x58')](_0x102846['query']['ids'])[_0x736c('0x29')](function(){if(_['isArray'](_0x102846['query'][_0x736c('0x57')])){for(var _0x294b8b=0x0;_0x294b8b<_0x102846[_0x736c('0x36')][_0x736c('0x57')]['length'];_0x294b8b+=0x1){socket['emit'](_0x736c('0x59'),{'UserId':Number(_0x102846[_0x736c('0x36')]['ids'][_0x294b8b]),'SquareProjectId':Number(_0x102846[_0x736c('0x4a')]['id'])});}}else{socket[_0x736c('0x5a')](_0x736c('0x59'),{'UserId':Number(_0x102846[_0x736c('0x36')][_0x736c('0x57')]),'SquareProjectId':Number(_0x102846[_0x736c('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x155027,null))[_0x736c('0x48')](handleError(_0x155027,null));};exports['getUsers']=function(_0x2f91fe,_0x4d9753,_0x6143a){var _0x1f185e={};var _0x49e070={};var _0x54086e;var _0x415f3b;return db[_0x736c('0x32')][_0x736c('0x5b')]({'where':{'id':_0x2f91fe[_0x736c('0x4a')]['id']}})[_0x736c('0x29')](handleEntityNotFound(_0x4d9753,null))[_0x736c('0x29')](function(_0x4e625c){if(_0x4e625c){_0x54086e=_0x4e625c;_0x49e070['model']=_[_0x736c('0x37')](db[_0x736c('0x5c')]['rawAttributes']);_0x49e070[_0x736c('0x36')]=_[_0x736c('0x37')](_0x2f91fe[_0x736c('0x36')]);_0x49e070[_0x736c('0x40')]=_[_0x736c('0x38')](_0x49e070[_0x736c('0x35')],_0x49e070[_0x736c('0x36')]);_0x1f185e[_0x736c('0x39')]=_['intersection'](_0x49e070[_0x736c('0x35')],qs[_0x736c('0x3a')](_0x2f91fe[_0x736c('0x36')][_0x736c('0x3a')]));_0x1f185e['attributes']=_0x1f185e[_0x736c('0x39')][_0x736c('0x3b')]?_0x1f185e[_0x736c('0x39')]:_0x49e070[_0x736c('0x35')];_0x1f185e['order']=qs[_0x736c('0x3e')](_0x2f91fe[_0x736c('0x36')][_0x736c('0x3e')]);_0x1f185e['where']=qs[_0x736c('0x40')](_['pick'](_0x2f91fe['query'],_0x49e070['filters']));if(_0x2f91fe[_0x736c('0x36')][_0x736c('0x42')]){_0x1f185e['where']=_['merge'](_0x1f185e[_0x736c('0x3f')],{'$or':_[_0x736c('0x31')](_0x1f185e[_0x736c('0x39')],function(_0x4a1f42){var _0x2c9b04={};_0x2c9b04[_0x4a1f42]={'$like':'%'+_0x2f91fe['query']['filter']+'%'};return _0x2c9b04;})});}_0x1f185e=_[_0x736c('0x43')]({},_0x1f185e,_0x2f91fe['options']);return _0x54086e[_0x736c('0x5d')](_0x1f185e);}})[_0x736c('0x29')](function(_0x242d27){if(_0x242d27){_0x415f3b=_0x242d27[_0x736c('0x3b')];if(!_0x2f91fe[_0x736c('0x36')][_0x736c('0x3c')](_0x736c('0x3d'))){_0x1f185e[_0x736c('0x24')]=qs['limit'](_0x2f91fe['query'][_0x736c('0x24')]);_0x1f185e[_0x736c('0x23')]=qs['offset'](_0x2f91fe[_0x736c('0x36')]['offset']);}return _0x54086e['getUsers'](_0x1f185e);}})[_0x736c('0x29')](function(_0x5e35d7){if(_0x5e35d7){return _0x5e35d7?{'count':_0x415f3b,'rows':_0x5e35d7}:null;}})[_0x736c('0x29')](respondWithResult(_0x4d9753,null))[_0x736c('0x48')](handleError(_0x4d9753,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index be76e33..41ce84d 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 _0xfa2d=['SquareProject','save','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x4044e9,_0x465da4){var _0x30c579=function(_0x597dc5){while(--_0x597dc5){_0x4044e9['push'](_0x4044e9['shift']());}};_0x30c579(++_0x465da4);}(_0xfa2d,0x112));var _0xdfa2=function(_0x127a0f,_0x2b6f09){_0x127a0f=_0x127a0f-0x0;var _0x59f26a=_0xfa2d[_0x127a0f];return _0x59f26a;};'use strict';var EventEmitter=require(_0xdfa2('0x0'));var SquareProject=require(_0xdfa2('0x1'))['db'][_0xdfa2('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdfa2('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x370fb3){return function(_0x1d462e,_0x583f22,_0xddc305){SquareProjectEvents[_0xdfa2('0x4')](_0x370fb3+':'+_0x1d462e['id'],_0x1d462e);SquareProjectEvents[_0xdfa2('0x4')](_0x370fb3,_0x1d462e);_0xddc305(null);};}for(var e in events){if(events[_0xdfa2('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xe035=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','update'];(function(_0x472837,_0x542aa2){var _0x170d2a=function(_0x478aab){while(--_0x478aab){_0x472837['push'](_0x472837['shift']());}};_0x170d2a(++_0x542aa2);}(_0xe035,0x1eb));var _0x5e03=function(_0x55a4e1,_0x117cb2){_0x55a4e1=_0x55a4e1-0x0;var _0x30b35a=_0xe035[_0x55a4e1];return _0x30b35a;};'use strict';var EventEmitter=require(_0x5e03('0x0'));var SquareProject=require(_0x5e03('0x1'))['db'][_0x5e03('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e03('0x3'),'afterDestroy':_0x5e03('0x4')};function emitEvent(_0x18de06){return function(_0x24f1d7,_0x41a5d4,_0x145c24){SquareProjectEvents[_0x5e03('0x5')](_0x18de06+':'+_0x24f1d7['id'],_0x24f1d7);SquareProjectEvents[_0x5e03('0x5')](_0x18de06,_0x24f1d7);_0x145c24(null);};}for(var e in events){if(events[_0x5e03('0x6')](e)){var event=events[e];SquareProject[_0x5e03('0x7')](e,emitEvent(event));}}module[_0x5e03('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 146f8eb..f529cc1 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 _0xfa2b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util'];(function(_0x4753c7,_0x5e0b51){var _0x445386=function(_0x156b28){while(--_0x156b28){_0x4753c7['push'](_0x4753c7['shift']());}};_0x445386(++_0x5e0b51);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x3b9d0a,_0x4d3eca){_0x3b9d0a=_0x3b9d0a-0x0;var _0x18de42=_0xfa2b[_0x3b9d0a];return _0x18de42;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var logger=require(_0xbfa2('0x2'))(_0xbfa2('0x3'));var moment=require(_0xbfa2('0x4'));var BPromise=require(_0xbfa2('0x5'));var rp=require(_0xbfa2('0x6'));var fs=require('fs');var path=require(_0xbfa2('0x7'));var rimraf=require(_0xbfa2('0x8'));var config=require(_0xbfa2('0x9'));var attributes=require(_0xbfa2('0xa'));module[_0xbfa2('0xb')]=function(_0x12d71e,_0x237a99){return _0x12d71e[_0xbfa2('0xc')](_0xbfa2('0xd'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46a151,_0x4f17e6,_0x329e40){if(_0x46a151[_0xbfa2('0xe')](_0xbfa2('0xf'))){_0x46a151[_0xbfa2('0x10')]=moment()[_0xbfa2('0x11')](_0xbfa2('0x12'));}if(_0x46a151[_0xbfa2('0xe')](_0xbfa2('0x13'))){_0x46a151[_0xbfa2('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x329e40(null,_0x46a151);}}});}; \ No newline at end of file +var _0xd6ce=['bluebird','request-promise','path','./squareProject.attributes','exports','square_projects','changed','preproduction','savedAt','format','lodash','util','../../config/logger','api','moment'];(function(_0x177bc4,_0x89fcb7){var _0x1cd3b4=function(_0x5ef8c8){while(--_0x5ef8c8){_0x177bc4['push'](_0x177bc4['shift']());}};_0x1cd3b4(++_0x89fcb7);}(_0xd6ce,0x127));var _0xed6c=function(_0x137cf5,_0x7892d){_0x137cf5=_0x137cf5-0x0;var _0x5663a4=_0xd6ce[_0x137cf5];return _0x5663a4;};'use strict';var _=require(_0xed6c('0x0'));var util=require(_0xed6c('0x1'));var logger=require(_0xed6c('0x2'))(_0xed6c('0x3'));var moment=require(_0xed6c('0x4'));var BPromise=require(_0xed6c('0x5'));var rp=require(_0xed6c('0x6'));var fs=require('fs');var path=require(_0xed6c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xed6c('0x8'));module[_0xed6c('0x9')]=function(_0x1a6d96,_0x1d0912){return _0x1a6d96['define']('SquareProject',attributes,{'tableName':_0xed6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46e2c4,_0x4fd673,_0x583dfb){if(_0x46e2c4[_0xed6c('0xb')](_0xed6c('0xc'))){_0x46e2c4[_0xed6c('0xd')]=moment()[_0xed6c('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x46e2c4['changed']('production')){_0x46e2c4['publishedAt']=moment()[_0xed6c('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x583dfb(null,_0x46e2c4);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 4c12dba..5a072c8 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 _0xb9e4=['catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','request','then','info','SquareProject,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result'];(function(_0x4f5119,_0x3d7151){var _0x461230=function(_0x3c7ad7){while(--_0x3c7ad7){_0x4f5119['push'](_0x4f5119['shift']());}};_0x461230(++_0x3d7151);}(_0xb9e4,0x10e));var _0x4b9e=function(_0x47edea,_0xe58ff0){_0x47edea=_0x47edea-0x0;var _0x2fc451=_0xb9e4[_0x47edea];return _0x2fc451;};'use strict';var _=require(_0x4b9e('0x0'));var util=require(_0x4b9e('0x1'));var moment=require('moment');var BPromise=require(_0x4b9e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b9e('0x3'));var db=require(_0x4b9e('0x4'))['db'];var utils=require(_0x4b9e('0x5'));var logger=require(_0x4b9e('0x6'))('rpc');var config=require(_0x4b9e('0x7'));var jayson=require(_0x4b9e('0x8'));var client=jayson[_0x4b9e('0x9')][_0x4b9e('0xa')]({'port':0x232a});config[_0x4b9e('0xb')]=_[_0x4b9e('0xc')](config[_0x4b9e('0xb')],{'host':_0x4b9e('0xd'),'port':0x18eb});var socket=require(_0x4b9e('0xe'))(new Redis(config['redis']));require(_0x4b9e('0xf'))['register'](socket);function respondWithRpcPromise(_0x151f22,_0x3a6859,_0x1025c8){return new BPromise(function(_0x2dc3a3,_0x379516){return client[_0x4b9e('0x10')](_0x151f22,_0x1025c8)[_0x4b9e('0x11')](function(_0x48d95a){logger[_0x4b9e('0x12')](_0x4b9e('0x13'),_0x3a6859,'request\x20sent');logger[_0x4b9e('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x3a6859,_0x4b9e('0x15'),JSON[_0x4b9e('0x16')](_0x48d95a));if(_0x48d95a[_0x4b9e('0x17')]){if(_0x48d95a['error']['code']===0x1f4){logger[_0x4b9e('0x17')](_0x4b9e('0x13'),_0x3a6859,_0x48d95a[_0x4b9e('0x17')][_0x4b9e('0x18')]);return _0x379516(_0x48d95a[_0x4b9e('0x17')]['message']);}logger[_0x4b9e('0x17')](_0x4b9e('0x13'),_0x3a6859,_0x48d95a[_0x4b9e('0x17')]['message']);return _0x2dc3a3(_0x48d95a[_0x4b9e('0x17')][_0x4b9e('0x18')]);}else{logger['info'](_0x4b9e('0x13'),_0x3a6859,_0x4b9e('0x15'));_0x2dc3a3(_0x48d95a[_0x4b9e('0x19')]['message']);}})[_0x4b9e('0x1a')](function(_0x4c659a){logger[_0x4b9e('0x17')](_0x4b9e('0x13'),_0x3a6859,_0x4c659a);_0x379516(_0x4c659a);});});}exports[_0x4b9e('0x1b')]=function(_0x3f00c2){var _0x2e6da3=this;return new Promise(function(_0x42454d,_0x3f0f45){return db[_0x4b9e('0x1c')][_0x4b9e('0x1d')]({'raw':_0x3f00c2[_0x4b9e('0x1e')]?_0x3f00c2[_0x4b9e('0x1e')][_0x4b9e('0x1f')]===undefined?!![]:![]:!![],'where':_0x3f00c2[_0x4b9e('0x1e')]?_0x3f00c2[_0x4b9e('0x1e')][_0x4b9e('0x20')]||null:null,'attributes':_0x3f00c2['options']?_0x3f00c2[_0x4b9e('0x1e')][_0x4b9e('0x21')]||null:null,'include':_0x3f00c2[_0x4b9e('0x1e')]?_0x3f00c2[_0x4b9e('0x1e')][_0x4b9e('0x22')]?_[_0x4b9e('0x23')](_0x3f00c2[_0x4b9e('0x1e')]['include'],function(_0x1ebf88){return{'model':db[_0x1ebf88[_0x4b9e('0x24')]],'as':_0x1ebf88['as'],'attributes':_0x1ebf88[_0x4b9e('0x21')],'include':_0x1ebf88['include']?_[_0x4b9e('0x23')](_0x1ebf88[_0x4b9e('0x22')],function(_0xbaa5c8){return{'model':db[_0xbaa5c8[_0x4b9e('0x24')]],'as':_0xbaa5c8['as'],'attributes':_0xbaa5c8[_0x4b9e('0x21')],'include':_0xbaa5c8[_0x4b9e('0x22')]?_[_0x4b9e('0x23')](_0xbaa5c8['include'],function(_0x4dc59f){return{'model':db[_0x4dc59f['model']],'as':_0x4dc59f['as'],'attributes':_0x4dc59f['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b9e('0x11')](function(_0x2ec3b9){logger[_0x4b9e('0x12')]('ShowSquareProject',_0x3f00c2);logger[_0x4b9e('0x14')]('ShowSquareProject',_0x3f00c2,JSON[_0x4b9e('0x16')](_0x2ec3b9));_0x42454d(_0x2ec3b9);})['catch'](function(_0x17d91b){logger['error'](_0x4b9e('0x1b'),_0x17d91b[_0x4b9e('0x18')],_0x3f00c2);_0x3f0f45(_0x2e6da3[_0x4b9e('0x17')](0x1f4,_0x17d91b['message']));});});}; \ No newline at end of file +var _0xff7a=['redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSquareProject','find','options','raw','map','attributes','include','model','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x139454,_0x4ab4ba){var _0xa63cf8=function(_0x2b1641){while(--_0x2b1641){_0x139454['push'](_0x139454['shift']());}};_0xa63cf8(++_0x4ab4ba);}(_0xff7a,0x66));var _0xaff7=function(_0x1d1968,_0x38a439){_0x1d1968=_0x1d1968-0x0;var _0x488aef=_0xff7a[_0x1d1968];return _0x488aef;};'use strict';var _=require(_0xaff7('0x0'));var util=require(_0xaff7('0x1'));var moment=require(_0xaff7('0x2'));var BPromise=require(_0xaff7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaff7('0x4'));var db=require(_0xaff7('0x5'))['db'];var utils=require(_0xaff7('0x6'));var logger=require(_0xaff7('0x7'))(_0xaff7('0x8'));var config=require(_0xaff7('0x9'));var jayson=require(_0xaff7('0xa'));var client=jayson[_0xaff7('0xb')]['http']({'port':0x232a});config[_0xaff7('0xc')]=_[_0xaff7('0xd')](config[_0xaff7('0xc')],{'host':_0xaff7('0xe'),'port':0x18eb});var socket=require(_0xaff7('0xf'))(new Redis(config['redis']));require(_0xaff7('0x10'))[_0xaff7('0x11')](socket);function respondWithRpcPromise(_0x232ee8,_0x1e93ad,_0x9e44df){return new BPromise(function(_0x3b8d4f,_0xb6edad){return client[_0xaff7('0x12')](_0x232ee8,_0x9e44df)[_0xaff7('0x13')](function(_0x30bfc7){logger[_0xaff7('0x14')](_0xaff7('0x15'),_0x1e93ad,_0xaff7('0x16'));logger[_0xaff7('0x17')](_0xaff7('0x18'),_0x1e93ad,'request\x20sent',JSON['stringify'](_0x30bfc7));if(_0x30bfc7[_0xaff7('0x19')]){if(_0x30bfc7[_0xaff7('0x19')][_0xaff7('0x1a')]===0x1f4){logger[_0xaff7('0x19')](_0xaff7('0x15'),_0x1e93ad,_0x30bfc7[_0xaff7('0x19')][_0xaff7('0x1b')]);return _0xb6edad(_0x30bfc7[_0xaff7('0x19')][_0xaff7('0x1b')]);}logger[_0xaff7('0x19')](_0xaff7('0x15'),_0x1e93ad,_0x30bfc7[_0xaff7('0x19')][_0xaff7('0x1b')]);return _0x3b8d4f(_0x30bfc7[_0xaff7('0x19')]['message']);}else{logger[_0xaff7('0x14')]('SquareProject,\x20%s,\x20%s',_0x1e93ad,_0xaff7('0x16'));_0x3b8d4f(_0x30bfc7['result']['message']);}})[_0xaff7('0x1c')](function(_0xeef455){logger[_0xaff7('0x19')](_0xaff7('0x15'),_0x1e93ad,_0xeef455);_0xb6edad(_0xeef455);});});}exports[_0xaff7('0x1d')]=function(_0x1569f9){var _0xe5c1d7=this;return new Promise(function(_0x576305,_0x883f35){return db['SquareProject'][_0xaff7('0x1e')]({'raw':_0x1569f9[_0xaff7('0x1f')]?_0x1569f9[_0xaff7('0x1f')][_0xaff7('0x20')]===undefined?!![]:![]:!![],'where':_0x1569f9[_0xaff7('0x1f')]?_0x1569f9[_0xaff7('0x1f')]['where']||null:null,'attributes':_0x1569f9[_0xaff7('0x1f')]?_0x1569f9['options']['attributes']||null:null,'include':_0x1569f9[_0xaff7('0x1f')]?_0x1569f9[_0xaff7('0x1f')]['include']?_[_0xaff7('0x21')](_0x1569f9[_0xaff7('0x1f')]['include'],function(_0xea47cd){return{'model':db[_0xea47cd['model']],'as':_0xea47cd['as'],'attributes':_0xea47cd[_0xaff7('0x22')],'include':_0xea47cd[_0xaff7('0x23')]?_['map'](_0xea47cd[_0xaff7('0x23')],function(_0x30ffe1){return{'model':db[_0x30ffe1['model']],'as':_0x30ffe1['as'],'attributes':_0x30ffe1[_0xaff7('0x22')],'include':_0x30ffe1[_0xaff7('0x23')]?_[_0xaff7('0x21')](_0x30ffe1[_0xaff7('0x23')],function(_0x4422ce){return{'model':db[_0x4422ce[_0xaff7('0x24')]],'as':_0x4422ce['as'],'attributes':_0x4422ce[_0xaff7('0x22')]};}):[]};}):[]};}):[]:[]})[_0xaff7('0x13')](function(_0x38a8d2){logger[_0xaff7('0x14')](_0xaff7('0x1d'),_0x1569f9);logger[_0xaff7('0x17')](_0xaff7('0x1d'),_0x1569f9,JSON[_0xaff7('0x25')](_0x38a8d2));_0x576305(_0x38a8d2);})['catch'](function(_0x5d9a95){logger[_0xaff7('0x19')](_0xaff7('0x1d'),_0x5d9a95[_0xaff7('0x1b')],_0x1569f9);_0x883f35(_0xe5c1d7[_0xaff7('0x19')](0x1f4,_0x5d9a95[_0xaff7('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index ee90f92..343d3d7 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 _0xc2c7=['register','squareProject:','save','remove','update','emit'];(function(_0xd2b525,_0x363908){var _0x1ea52d=function(_0x1cdbe4){while(--_0x1cdbe4){_0xd2b525['push'](_0xd2b525['shift']());}};_0x1ea52d(++_0x363908);}(_0xc2c7,0x134));var _0x7c2c=function(_0x36e149,_0x19e5d3){_0x36e149=_0x36e149-0x0;var _0x57c844=_0xc2c7[_0x36e149];return _0x57c844;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x7c2c('0x0'),_0x7c2c('0x1'),_0x7c2c('0x2')];function createListener(_0x330870,_0x380d13){return function(_0x237e4d){_0x380d13[_0x7c2c('0x3')](_0x330870,_0x237e4d);};}function removeListener(_0x116f8a,_0x4bbc14){return function(){SquareProjectEvents['removeListener'](_0x116f8a,_0x4bbc14);};}exports[_0x7c2c('0x4')]=function(_0x42ecc9){for(var _0x23c038=0x0,_0x54f027=events['length'];_0x23c038<_0x54f027;_0x23c038++){var _0x5a1027=events[_0x23c038];var _0x2274cd=createListener(_0x7c2c('0x5')+_0x5a1027,_0x42ecc9);SquareProjectEvents['on'](_0x5a1027,_0x2274cd);}}; \ No newline at end of file +var _0x5d17=['./squareProject.events','save','removeListener','register','length','squareProject:'];(function(_0x17c6c7,_0x5335ed){var _0x3e87a2=function(_0x3de9f2){while(--_0x3de9f2){_0x17c6c7['push'](_0x17c6c7['shift']());}};_0x3e87a2(++_0x5335ed);}(_0x5d17,0x114));var _0x75d1=function(_0x3c95a3,_0x1159f1){_0x3c95a3=_0x3c95a3-0x0;var _0x57b25b=_0x5d17[_0x3c95a3];return _0x57b25b;};'use strict';var SquareProjectEvents=require(_0x75d1('0x0'));var events=[_0x75d1('0x1'),'remove','update'];function createListener(_0x39c0ec,_0x426717){return function(_0x1c9ba6){_0x426717['emit'](_0x39c0ec,_0x1c9ba6);};}function removeListener(_0x177460,_0x45d03a){return function(){SquareProjectEvents[_0x75d1('0x2')](_0x177460,_0x45d03a);};}exports[_0x75d1('0x3')]=function(_0x56ac0a){for(var _0x458681=0x0,_0x116a51=events[_0x75d1('0x4')];_0x458681<_0x116a51;_0x458681++){var _0x1ee61b=events[_0x458681];var _0x3a9d5e=createListener(_0x75d1('0x5')+_0x1ee61b,_0x56ac0a);SquareProjectEvents['on'](_0x1ee61b,_0x3a9d5e);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index bf808e5..42d5f3b 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 _0x72ba=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/download','download','post','create','put','update','/:id/delete','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72ba,0x1a3));var _0xa72b=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x72ba[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require(_0xa72b('0x0'));var util=require(_0xa72b('0x1'));var path=require('path');var timeout=require(_0xa72b('0x2'));var express=require(_0xa72b('0x3'));var router=express[_0xa72b('0x4')]();var fs_extra=require(_0xa72b('0x5'));var auth=require(_0xa72b('0x6'));var interaction=require(_0xa72b('0x7'));var config=require(_0xa72b('0x8'));var controller=require('./squareRecording.controller');router[_0xa72b('0x9')]('/',auth[_0xa72b('0xa')](),controller[_0xa72b('0xb')]);router[_0xa72b('0x9')]('/:id',auth[_0xa72b('0xa')](),controller['show']);router[_0xa72b('0x9')](_0xa72b('0xc'),auth[_0xa72b('0xa')](),controller[_0xa72b('0xd')]);router[_0xa72b('0xe')]('/',auth[_0xa72b('0xa')](),controller[_0xa72b('0xf')]);router[_0xa72b('0x10')]('/:id',auth[_0xa72b('0xa')](),controller[_0xa72b('0x11')]);router['delete'](_0xa72b('0x12'),auth[_0xa72b('0xa')](),controller[_0xa72b('0x13')]);module[_0xa72b('0x14')]=router; \ No newline at end of file +var _0x6d1c=['get','/:id','/:id/download','download','put','update','/:id/delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6d1c,0x16e));var _0xc6d1=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x6d1c[_0x1a89a1];return _0x3d5b46;};'use strict';var multer=require('multer');var util=require(_0xc6d1('0x0'));var path=require('path');var timeout=require(_0xc6d1('0x1'));var express=require(_0xc6d1('0x2'));var router=express['Router']();var fs_extra=require(_0xc6d1('0x3'));var auth=require(_0xc6d1('0x4'));var interaction=require(_0xc6d1('0x5'));var config=require('../../config/environment');var controller=require('./squareRecording.controller');router['get']('/',auth[_0xc6d1('0x6')](),controller[_0xc6d1('0x7')]);router[_0xc6d1('0x8')](_0xc6d1('0x9'),auth[_0xc6d1('0x6')](),controller['show']);router[_0xc6d1('0x8')](_0xc6d1('0xa'),auth[_0xc6d1('0x6')](),controller[_0xc6d1('0xb')]);router['post']('/',auth[_0xc6d1('0x6')](),controller['create']);router[_0xc6d1('0xc')](_0xc6d1('0x9'),auth[_0xc6d1('0x6')](),controller[_0xc6d1('0xd')]);router['delete'](_0xc6d1('0xe'),auth[_0xc6d1('0x6')](),controller[_0xc6d1('0xf')]);module[_0xc6d1('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 498bad7..da6d689 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 _0xa195=['savePath','substring','lastIndexOf','sequelize','exports','STRING','getDataValue'];(function(_0x5d0b15,_0x1a2d71){var _0x354384=function(_0x5302c6){while(--_0x5302c6){_0x5d0b15['push'](_0x5d0b15['shift']());}};_0x354384(++_0x1a2d71);}(_0xa195,0x13e));var _0x5a19=function(_0x391a49,_0x4623a8){_0x391a49=_0x391a49-0x0;var _0x3614ce=_0xa195[_0x391a49];return _0x3614ce;};'use strict';var Sequelize=require(_0x5a19('0x0'));module[_0x5a19('0x1')]={'uniqueid':{'type':Sequelize[_0x5a19('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5a19('0x2')]},'context':{'type':Sequelize[_0x5a19('0x2')]},'extension':{'type':Sequelize[_0x5a19('0x2')]},'priority':{'type':Sequelize[_0x5a19('0x2')]},'accountcode':{'type':Sequelize[_0x5a19('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x5a19('0x2')]},'saveName':{'type':Sequelize[_0x5a19('0x2')]},'filename':{'type':Sequelize[_0x5a19('0x2')]},'savePath':{'type':Sequelize[_0x5a19('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0xb9d950='';var _0xa33970=this[_0x5a19('0x3')](_0x5a19('0x4'));if(_0xa33970){_0xb9d950=_0xa33970[_0x5a19('0x5')](_0xa33970[_0x5a19('0x6')]('.'));}return _0xb9d950;}}}; \ No newline at end of file +var _0xf161=['getDataValue','savePath','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0x19da82,_0x585b5e){var _0x1957d3=function(_0x515dee){while(--_0x515dee){_0x19da82['push'](_0x19da82['shift']());}};_0x1957d3(++_0x585b5e);}(_0xf161,0x1d1));var _0x1f16=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xf161[_0x1fa759];return _0x2da9f4;};'use strict';var Sequelize=require(_0x1f16('0x0'));module[_0x1f16('0x1')]={'uniqueid':{'type':Sequelize[_0x1f16('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1f16('0x2')]},'context':{'type':Sequelize[_0x1f16('0x2')]},'extension':{'type':Sequelize[_0x1f16('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1f16('0x2')]},'dnid':{'type':Sequelize[_0x1f16('0x2')]},'projectName':{'type':Sequelize[_0x1f16('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x1f16('0x2')]},'savePath':{'type':Sequelize[_0x1f16('0x2')]},'format':{'type':Sequelize[_0x1f16('0x3')],'get':function(){var _0x537955='';var _0x33b315=this[_0x1f16('0x4')](_0x1f16('0x5'));if(_0x33b315){_0x537955=_0x33b315[_0x1f16('0x6')](_0x33b315['lastIndexOf']('.'));}return _0x537955;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index afe2067..d855ce4 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 _0x8f58=['catch','rawAttributes','find','create','body','params','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','end','error','stack','name','send','index','SquareRecording','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x2c2389,_0x1fb0f6){var _0xfc3ea0=function(_0x3687fa){while(--_0x3687fa){_0x2c2389['push'](_0x2c2389['shift']());}};_0xfc3ea0(++_0x1fb0f6);}(_0x8f58,0xdd));var _0x88f5=function(_0x11aab6,_0x2be6ad){_0x11aab6=_0x11aab6-0x0;var _0x293938=_0x8f58[_0x11aab6];return _0x293938;};'use strict';var emlformat=require(_0x88f5('0x0'));var rimraf=require(_0x88f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x88f5('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x88f5('0x3'));var path=require(_0x88f5('0x4'));var sox=require(_0x88f5('0x5'));var csv=require(_0x88f5('0x6'));var ejs=require(_0x88f5('0x7'));var fs=require('fs');var fs_extra=require(_0x88f5('0x8'));var _=require(_0x88f5('0x9'));var squel=require('squel');var crypto=require(_0x88f5('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x88f5('0xb'));var Redis=require('ioredis');var authService=require(_0x88f5('0xc'));var qs=require(_0x88f5('0xd'));var as=require(_0x88f5('0xe'));var hardwareService=require(_0x88f5('0xf'));var logger=require('../../config/logger')(_0x88f5('0x10'));var utils=require(_0x88f5('0x11'));var config=require(_0x88f5('0x12'));var licenseUtil=require(_0x88f5('0x13'));var db=require(_0x88f5('0x14'))['db'];function respondWithStatusCode(_0x5d64c6,_0x5efe39){_0x5efe39=_0x5efe39||0xcc;return function(_0xd41177){if(_0xd41177){return _0x5d64c6[_0x88f5('0x15')](_0x5efe39);}return _0x5d64c6[_0x88f5('0x16')](_0x5efe39)['end']();};}function respondWithResult(_0x565656,_0x2d8e88){_0x2d8e88=_0x2d8e88||0xc8;return function(_0x35727e){if(_0x35727e){return _0x565656['status'](_0x2d8e88)[_0x88f5('0x17')](_0x35727e);}};}function respondWithFilteredResult(_0x36758f,_0x4f6d8f){return function(_0x512143){if(_0x512143){var _0x565017=_0x512143[_0x88f5('0x18')],_0x4f9fa0=_0x4f6d8f[_0x88f5('0x19')],_0x462200=_0x4f6d8f[_0x88f5('0x19')]+_0x4f6d8f[_0x88f5('0x1a')],_0x8417ce;if(_0x462200>=_0x565017){_0x462200=_0x565017;_0x8417ce=0xc8;}else{_0x8417ce=0xce;}_0x36758f['status'](_0x8417ce);return _0x36758f[_0x88f5('0x1b')]('Content-Range',_0x4f9fa0+'-'+_0x462200+'/'+_0x565017)[_0x88f5('0x17')](_0x512143);}return null;};}function patchUpdates(_0xced712){return function(_0x108a63){try{jsonpatch[_0x88f5('0x1c')](_0x108a63,_0xced712,!![]);}catch(_0x35cd7d){return BPromise[_0x88f5('0x1d')](_0x35cd7d);}return _0x108a63[_0x88f5('0x1e')]();};}function saveUpdates(_0x289051,_0x87f15b){return function(_0x2206a6){if(_0x2206a6){return _0x2206a6[_0x88f5('0x1f')](_0x289051)[_0x88f5('0x20')](function(_0x5a776c){return _0x5a776c;});}return null;};}function removeEntity(_0xa3ad4a,_0x87e3c9){return function(_0x21d4b5){if(_0x21d4b5){return _0x21d4b5['destroy']()[_0x88f5('0x20')](function(){_0xa3ad4a[_0x88f5('0x16')](0xcc)[_0x88f5('0x21')]();});}};}function handleEntityNotFound(_0x14a1e5,_0x5315d6){return function(_0x4f6ad7){if(!_0x4f6ad7){_0x14a1e5[_0x88f5('0x15')](0x194);}return _0x4f6ad7;};}function handleError(_0x53dbf2,_0x1ed86e){_0x1ed86e=_0x1ed86e||0x1f4;return function(_0x1da841){logger[_0x88f5('0x22')](_0x1da841[_0x88f5('0x23')]);if(_0x1da841[_0x88f5('0x24')]){delete _0x1da841[_0x88f5('0x24')];}_0x53dbf2[_0x88f5('0x16')](_0x1ed86e)[_0x88f5('0x25')](_0x1da841);};}exports[_0x88f5('0x26')]=function(_0x548f9b,_0x17c603){var _0x46b03={},_0x4d3db2={},_0x37d4cd={'count':0x0,'rows':[]};var _0x53dc74=_['map'](db[_0x88f5('0x27')]['rawAttributes'],function(_0x4486a8){return{'name':_0x4486a8['fieldName'],'type':_0x4486a8[_0x88f5('0x28')][_0x88f5('0x29')]};});_0x4d3db2[_0x88f5('0x2a')]=_[_0x88f5('0x2b')](_0x53dc74,_0x88f5('0x24'));_0x4d3db2[_0x88f5('0x2c')]=_[_0x88f5('0x2d')](_0x548f9b[_0x88f5('0x2c')]);_0x4d3db2['filters']=_[_0x88f5('0x2e')](_0x4d3db2[_0x88f5('0x2a')],_0x4d3db2[_0x88f5('0x2c')]);_0x46b03[_0x88f5('0x2f')]=_[_0x88f5('0x2e')](_0x4d3db2[_0x88f5('0x2a')],qs[_0x88f5('0x30')](_0x548f9b[_0x88f5('0x2c')][_0x88f5('0x30')]));_0x46b03[_0x88f5('0x2f')]=_0x46b03[_0x88f5('0x2f')][_0x88f5('0x31')]?_0x46b03[_0x88f5('0x2f')]:_0x4d3db2['model'];if(!_0x548f9b[_0x88f5('0x2c')][_0x88f5('0x32')]('nolimit')){_0x46b03[_0x88f5('0x1a')]=qs[_0x88f5('0x1a')](_0x548f9b['query'][_0x88f5('0x1a')]);_0x46b03[_0x88f5('0x19')]=qs[_0x88f5('0x19')](_0x548f9b[_0x88f5('0x2c')][_0x88f5('0x19')]);}_0x46b03[_0x88f5('0x33')]=qs[_0x88f5('0x34')](_0x548f9b['query'][_0x88f5('0x34')]);_0x46b03[_0x88f5('0x35')]=qs[_0x88f5('0x36')](_[_0x88f5('0x37')](_0x548f9b[_0x88f5('0x2c')],_0x4d3db2[_0x88f5('0x36')]),_0x53dc74);if(_0x548f9b['query'][_0x88f5('0x38')]){_0x46b03[_0x88f5('0x35')]=_[_0x88f5('0x39')](_0x46b03['where'],{'$or':_[_0x88f5('0x2b')](_0x53dc74,function(_0xeb90ba){if(_0xeb90ba[_0x88f5('0x28')]!==_0x88f5('0x3a')){var _0x399ca0={};_0x399ca0[_0xeb90ba[_0x88f5('0x24')]]={'$like':'%'+_0x548f9b[_0x88f5('0x2c')][_0x88f5('0x38')]+'%'};return _0x399ca0;}})});}_0x46b03=_[_0x88f5('0x39')]({},_0x46b03,_0x548f9b[_0x88f5('0x3b')]);var _0x23e9ea={'where':_0x46b03[_0x88f5('0x35')]};return db[_0x88f5('0x27')][_0x88f5('0x18')](_0x23e9ea)['then'](function(_0x19fbb6){_0x37d4cd[_0x88f5('0x18')]=_0x19fbb6;if(_0x548f9b[_0x88f5('0x2c')][_0x88f5('0x3c')]){_0x46b03[_0x88f5('0x3d')]=[{'all':!![]}];}return db[_0x88f5('0x27')][_0x88f5('0x3e')](_0x46b03);})[_0x88f5('0x20')](function(_0x593dd0){_0x37d4cd[_0x88f5('0x3f')]=_0x593dd0;return _0x37d4cd;})[_0x88f5('0x20')](respondWithFilteredResult(_0x17c603,_0x46b03))[_0x88f5('0x40')](handleError(_0x17c603,null));};exports['show']=function(_0x578a1c,_0x46f4e0){var _0x3cf38f={'raw':!![],'where':{'id':_0x578a1c['params']['id']}},_0x5c8296={};_0x5c8296[_0x88f5('0x2a')]=_[_0x88f5('0x2d')](db['SquareRecording'][_0x88f5('0x41')]);_0x5c8296[_0x88f5('0x2c')]=_[_0x88f5('0x2d')](_0x578a1c[_0x88f5('0x2c')]);_0x5c8296[_0x88f5('0x36')]=_[_0x88f5('0x2e')](_0x5c8296[_0x88f5('0x2a')],_0x5c8296[_0x88f5('0x2c')]);_0x3cf38f['attributes']=_['intersection'](_0x5c8296[_0x88f5('0x2a')],qs[_0x88f5('0x30')](_0x578a1c[_0x88f5('0x2c')][_0x88f5('0x30')]));_0x3cf38f['attributes']=_0x3cf38f[_0x88f5('0x2f')][_0x88f5('0x31')]?_0x3cf38f[_0x88f5('0x2f')]:_0x5c8296[_0x88f5('0x2a')];if(_0x578a1c[_0x88f5('0x2c')][_0x88f5('0x3c')]){_0x3cf38f[_0x88f5('0x3d')]=[{'all':!![]}];}_0x3cf38f=_[_0x88f5('0x39')]({},_0x3cf38f,_0x578a1c[_0x88f5('0x3b')]);return db[_0x88f5('0x27')][_0x88f5('0x42')](_0x3cf38f)[_0x88f5('0x20')](handleEntityNotFound(_0x46f4e0,null))[_0x88f5('0x20')](respondWithResult(_0x46f4e0,null))[_0x88f5('0x40')](handleError(_0x46f4e0,null));};exports[_0x88f5('0x43')]=function(_0x5c3274,_0x4fbd5b){return db[_0x88f5('0x27')]['create'](_0x5c3274[_0x88f5('0x44')],{})['then'](respondWithResult(_0x4fbd5b,0xc9))[_0x88f5('0x40')](handleError(_0x4fbd5b,null));};exports[_0x88f5('0x1f')]=function(_0x4fabf7,_0x13c55a){if(_0x4fabf7[_0x88f5('0x44')]['id']){delete _0x4fabf7[_0x88f5('0x44')]['id'];}return db[_0x88f5('0x27')]['find']({'where':{'id':_0x4fabf7[_0x88f5('0x45')]['id']}})[_0x88f5('0x20')](handleEntityNotFound(_0x13c55a,null))['then'](saveUpdates(_0x4fabf7[_0x88f5('0x44')],null))[_0x88f5('0x20')](respondWithResult(_0x13c55a,null))[_0x88f5('0x40')](handleError(_0x13c55a,null));};exports[_0x88f5('0x46')]=function(_0x5413f5,_0x1f9bf8,_0x4dd65d){var _0x451c34=require('../../components/encryptor');var _0x4468c4=![];var _0x4b296f={};if(_0x5413f5[_0x88f5('0x2c')]['type']&&_0x5413f5[_0x88f5('0x2c')][_0x88f5('0x28')]==='uniqueid'){_0x4b296f[_0x88f5('0x47')]=_0x5413f5['params']['id'];}else{_0x4b296f['id']=_0x5413f5['params']['id'];}return db[_0x88f5('0x27')][_0x88f5('0x42')]({'where':_0x4b296f,'attributes':['id',_0x88f5('0x48'),_0x88f5('0x49')],'raw':!![]})[_0x88f5('0x20')](handleEntityNotFound(_0x1f9bf8,null))[_0x88f5('0x20')](function(_0x4b49d3){if(_0x4b49d3){var _0x519445=_0x4b49d3[_0x88f5('0x48')];var _0x4235d4=util[_0x88f5('0x4a')](_0x88f5('0x4b'),_0x519445);if(fs[_0x88f5('0x4c')](_0x4235d4)){_0x4468c4=!![];return _0x451c34[_0x88f5('0x4d')](_0x4235d4,_0x519445,config[_0x88f5('0x4e')][_0x88f5('0x4f')])['then'](function(){return _0x4b49d3;});}return _0x4b49d3;}})['then'](function(_0x2a0a53){if(_0x2a0a53){var _0x5948dc=_0x2a0a53[_0x88f5('0x48')];if(!fs[_0x88f5('0x4c')](_0x5948dc)){throw new db[(_0x88f5('0x50'))][(_0x88f5('0x51'))](_0x88f5('0x52'));}if(_0x2a0a53[_0x88f5('0x49')]){return _0x1f9bf8[_0x88f5('0x46')](_0x5948dc,_0x2a0a53[_0x88f5('0x49')]+path[_0x88f5('0x53')](_0x5948dc),function(){if(_0x4468c4){fs[_0x88f5('0x54')](_0x5948dc);}});}else{return _0x1f9bf8[_0x88f5('0x46')](_0x5948dc,function(_0x2e4f70){if(_0x4468c4){fs['unlink'](_0x5948dc);}});}}})[_0x88f5('0x40')](function(_0xb64c04){if(_0xb64c04[_0x88f5('0x55')]===_0x88f5('0x52')){_0x1f9bf8[_0x88f5('0x16')](0x194)[_0x88f5('0x25')]('Not\x20found');}else{return handleError(_0x1f9bf8,null);}});};exports[_0x88f5('0x56')]=function(_0x3829f8,_0x1a627b){return db[_0x88f5('0x27')][_0x88f5('0x42')]({'where':{'id':_0x3829f8[_0x88f5('0x45')]['id']}})[_0x88f5('0x20')](function(_0x473996){if(!_0x473996)throw new ReferenceError(_0x88f5('0x57'));return _0x473996;})[_0x88f5('0x20')](function(_0x1cda3d){var _0x3b12cf=_0x1cda3d[_0x88f5('0x48')];logger[_0x88f5('0x58')](_0x88f5('0x59'),_0x3b12cf);if(!_[_0x88f5('0x5a')](_0x1cda3d[_0x88f5('0x48')])&&fs[_0x88f5('0x4c')](_0x3b12cf)){logger[_0x88f5('0x58')](_0x88f5('0x5b')+_0x3b12cf+_0x88f5('0x5c'));fs['unlinkSync'](_0x3b12cf);}_0x3b12cf=_0x3b12cf+_0x88f5('0x5d');if(!_['isNil'](_0x1cda3d['savePath'])&&fs['existsSync'](_0x3b12cf)){logger[_0x88f5('0x58')](_0x88f5('0x5b')+_0x3b12cf+_0x88f5('0x5c'));fs[_0x88f5('0x5e')](_0x3b12cf);}return _0x1cda3d;})['then'](function(_0x57d5e4){if(!_0x57d5e4)throw new InternalError();return _0x57d5e4[_0x88f5('0x56')]();})[_0x88f5('0x20')](function(){_0x1a627b['status'](0xcc)[_0x88f5('0x21')]();})[_0x88f5('0x40')](handleError(_0x1a627b,null));}; \ No newline at end of file +var _0xf993=['fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','SquareRecording','count','includeAll','include','show','params','find','catch','body','download','../../components/encryptor','savePath','format','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','send','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','existsSync','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','save','update','then','stack','name','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x430f40,_0x291a08){var _0x1f5f7d=function(_0x171c58){while(--_0x171c58){_0x430f40['push'](_0x430f40['shift']());}};_0x1f5f7d(++_0x291a08);}(_0xf993,0x19d));var _0x3f99=function(_0x1a62c7,_0x3e842d){_0x1a62c7=_0x1a62c7-0x0;var _0x594e62=_0xf993[_0x1a62c7];return _0x594e62;};'use strict';var emlformat=require(_0x3f99('0x0'));var rimraf=require(_0x3f99('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f99('0x2'));var rp=require(_0x3f99('0x3'));var moment=require(_0x3f99('0x4'));var BPromise=require(_0x3f99('0x5'));var Mustache=require(_0x3f99('0x6'));var util=require('util');var path=require(_0x3f99('0x7'));var sox=require(_0x3f99('0x8'));var csv=require(_0x3f99('0x9'));var ejs=require(_0x3f99('0xa'));var fs=require('fs');var fs_extra=require(_0x3f99('0xb'));var _=require(_0x3f99('0xc'));var squel=require('squel');var crypto=require(_0x3f99('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3f99('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3f99('0xf'));var Papa=require(_0x3f99('0x10'));var Redis=require(_0x3f99('0x11'));var authService=require(_0x3f99('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3f99('0x13'));var hardwareService=require(_0x3f99('0x14'));var logger=require('../../config/logger')(_0x3f99('0x15'));var utils=require('../../config/utils');var config=require(_0x3f99('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f99('0x17'))['db'];function respondWithStatusCode(_0x5c7061,_0x2e7352){_0x2e7352=_0x2e7352||0xcc;return function(_0x21e4d9){if(_0x21e4d9){return _0x5c7061[_0x3f99('0x18')](_0x2e7352);}return _0x5c7061[_0x3f99('0x19')](_0x2e7352)[_0x3f99('0x1a')]();};}function respondWithResult(_0x3f9209,_0x26e1b1){_0x26e1b1=_0x26e1b1||0xc8;return function(_0x17ad25){if(_0x17ad25){return _0x3f9209[_0x3f99('0x19')](_0x26e1b1)[_0x3f99('0x1b')](_0x17ad25);}};}function respondWithFilteredResult(_0x5812f6,_0x11ce8c){return function(_0x2bc46e){if(_0x2bc46e){var _0x15fc10=_0x2bc46e['count'],_0x19119f=_0x11ce8c[_0x3f99('0x1c')],_0xb00012=_0x11ce8c[_0x3f99('0x1c')]+_0x11ce8c['limit'],_0x35ef23;if(_0xb00012>=_0x15fc10){_0xb00012=_0x15fc10;_0x35ef23=0xc8;}else{_0x35ef23=0xce;}_0x5812f6[_0x3f99('0x19')](_0x35ef23);return _0x5812f6[_0x3f99('0x1d')](_0x3f99('0x1e'),_0x19119f+'-'+_0xb00012+'/'+_0x15fc10)[_0x3f99('0x1b')](_0x2bc46e);}return null;};}function patchUpdates(_0x36c2b3){return function(_0x3f9c14){try{jsonpatch['apply'](_0x3f9c14,_0x36c2b3,!![]);}catch(_0x46019d){return BPromise['reject'](_0x46019d);}return _0x3f9c14[_0x3f99('0x1f')]();};}function saveUpdates(_0x4b5df8,_0x46f4d5){return function(_0x105b58){if(_0x105b58){return _0x105b58[_0x3f99('0x20')](_0x4b5df8)['then'](function(_0x314b60){return _0x314b60;});}return null;};}function removeEntity(_0x5eff8b,_0x39e94b){return function(_0x417071){if(_0x417071){return _0x417071['destroy']()[_0x3f99('0x21')](function(){_0x5eff8b[_0x3f99('0x19')](0xcc)[_0x3f99('0x1a')]();});}};}function handleEntityNotFound(_0x4e8b46,_0x427e7d){return function(_0x3cf974){if(!_0x3cf974){_0x4e8b46[_0x3f99('0x18')](0x194);}return _0x3cf974;};}function handleError(_0x3dbfa0,_0x4873d0){_0x4873d0=_0x4873d0||0x1f4;return function(_0xad01d3){logger['error'](_0xad01d3[_0x3f99('0x22')]);if(_0xad01d3[_0x3f99('0x23')]){delete _0xad01d3['name'];}_0x3dbfa0['status'](_0x4873d0)['send'](_0xad01d3);};}exports[_0x3f99('0x24')]=function(_0x44a3eb,_0x14d6fd){var _0xd7c04e={},_0x594aa={},_0x5c03b0={'count':0x0,'rows':[]};var _0x2eeaac=_['map'](db['SquareRecording']['rawAttributes'],function(_0x2bc9e4){return{'name':_0x2bc9e4[_0x3f99('0x25')],'type':_0x2bc9e4[_0x3f99('0x26')][_0x3f99('0x27')]};});_0x594aa[_0x3f99('0x28')]=_[_0x3f99('0x29')](_0x2eeaac,_0x3f99('0x23'));_0x594aa[_0x3f99('0x2a')]=_[_0x3f99('0x2b')](_0x44a3eb[_0x3f99('0x2a')]);_0x594aa[_0x3f99('0x2c')]=_[_0x3f99('0x2d')](_0x594aa[_0x3f99('0x28')],_0x594aa['query']);_0xd7c04e[_0x3f99('0x2e')]=_['intersection'](_0x594aa['model'],qs[_0x3f99('0x2f')](_0x44a3eb['query'][_0x3f99('0x2f')]));_0xd7c04e[_0x3f99('0x2e')]=_0xd7c04e[_0x3f99('0x2e')][_0x3f99('0x30')]?_0xd7c04e[_0x3f99('0x2e')]:_0x594aa[_0x3f99('0x28')];if(!_0x44a3eb['query'][_0x3f99('0x31')](_0x3f99('0x32'))){_0xd7c04e[_0x3f99('0x33')]=qs[_0x3f99('0x33')](_0x44a3eb[_0x3f99('0x2a')][_0x3f99('0x33')]);_0xd7c04e[_0x3f99('0x1c')]=qs[_0x3f99('0x1c')](_0x44a3eb['query'][_0x3f99('0x1c')]);}_0xd7c04e[_0x3f99('0x34')]=qs[_0x3f99('0x35')](_0x44a3eb['query']['sort']);_0xd7c04e[_0x3f99('0x36')]=qs[_0x3f99('0x2c')](_[_0x3f99('0x37')](_0x44a3eb[_0x3f99('0x2a')],_0x594aa[_0x3f99('0x2c')]),_0x2eeaac);if(_0x44a3eb['query']['filter']){_0xd7c04e[_0x3f99('0x36')]=_[_0x3f99('0x38')](_0xd7c04e[_0x3f99('0x36')],{'$or':_[_0x3f99('0x29')](_0x2eeaac,function(_0x3f1c3b){if(_0x3f1c3b[_0x3f99('0x26')]!==_0x3f99('0x39')){var _0x12a1b3={};_0x12a1b3[_0x3f1c3b[_0x3f99('0x23')]]={'$like':'%'+_0x44a3eb[_0x3f99('0x2a')]['filter']+'%'};return _0x12a1b3;}})});}_0xd7c04e=_[_0x3f99('0x38')]({},_0xd7c04e,_0x44a3eb[_0x3f99('0x3a')]);var _0xf4636={'where':_0xd7c04e[_0x3f99('0x36')]};return db[_0x3f99('0x3b')]['count'](_0xf4636)[_0x3f99('0x21')](function(_0x46592e){_0x5c03b0[_0x3f99('0x3c')]=_0x46592e;if(_0x44a3eb[_0x3f99('0x2a')][_0x3f99('0x3d')]){_0xd7c04e[_0x3f99('0x3e')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0xd7c04e);})[_0x3f99('0x21')](function(_0x1ac542){_0x5c03b0['rows']=_0x1ac542;return _0x5c03b0;})['then'](respondWithFilteredResult(_0x14d6fd,_0xd7c04e))['catch'](handleError(_0x14d6fd,null));};exports[_0x3f99('0x3f')]=function(_0x33b291,_0x2a6d7a){var _0x591978={'raw':!![],'where':{'id':_0x33b291[_0x3f99('0x40')]['id']}},_0x1f2ddc={};_0x1f2ddc['model']=_['keys'](db[_0x3f99('0x3b')]['rawAttributes']);_0x1f2ddc[_0x3f99('0x2a')]=_[_0x3f99('0x2b')](_0x33b291[_0x3f99('0x2a')]);_0x1f2ddc['filters']=_[_0x3f99('0x2d')](_0x1f2ddc['model'],_0x1f2ddc[_0x3f99('0x2a')]);_0x591978[_0x3f99('0x2e')]=_['intersection'](_0x1f2ddc[_0x3f99('0x28')],qs[_0x3f99('0x2f')](_0x33b291[_0x3f99('0x2a')][_0x3f99('0x2f')]));_0x591978[_0x3f99('0x2e')]=_0x591978[_0x3f99('0x2e')][_0x3f99('0x30')]?_0x591978[_0x3f99('0x2e')]:_0x1f2ddc[_0x3f99('0x28')];if(_0x33b291[_0x3f99('0x2a')][_0x3f99('0x3d')]){_0x591978['include']=[{'all':!![]}];}_0x591978=_['merge']({},_0x591978,_0x33b291[_0x3f99('0x3a')]);return db[_0x3f99('0x3b')][_0x3f99('0x41')](_0x591978)[_0x3f99('0x21')](handleEntityNotFound(_0x2a6d7a,null))['then'](respondWithResult(_0x2a6d7a,null))[_0x3f99('0x42')](handleError(_0x2a6d7a,null));};exports['create']=function(_0x11e5e3,_0x260bb5){return db[_0x3f99('0x3b')]['create'](_0x11e5e3[_0x3f99('0x43')],{})['then'](respondWithResult(_0x260bb5,0xc9))['catch'](handleError(_0x260bb5,null));};exports['update']=function(_0x151e0e,_0xc4bd35){if(_0x151e0e[_0x3f99('0x43')]['id']){delete _0x151e0e['body']['id'];}return db[_0x3f99('0x3b')]['find']({'where':{'id':_0x151e0e[_0x3f99('0x40')]['id']}})[_0x3f99('0x21')](handleEntityNotFound(_0xc4bd35,null))[_0x3f99('0x21')](saveUpdates(_0x151e0e[_0x3f99('0x43')],null))[_0x3f99('0x21')](respondWithResult(_0xc4bd35,null))[_0x3f99('0x42')](handleError(_0xc4bd35,null));};exports[_0x3f99('0x44')]=function(_0xa9d27,_0x50fe4d,_0x40a3a5){var _0x425127=require(_0x3f99('0x45'));var _0xfba9a7=![];var _0x4da5f2={};if(_0xa9d27[_0x3f99('0x2a')][_0x3f99('0x26')]&&_0xa9d27[_0x3f99('0x2a')][_0x3f99('0x26')]==='uniqueid'){_0x4da5f2['uniqueid']=_0xa9d27[_0x3f99('0x40')]['id'];}else{_0x4da5f2['id']=_0xa9d27[_0x3f99('0x40')]['id'];}return db[_0x3f99('0x3b')]['find']({'where':_0x4da5f2,'attributes':['id',_0x3f99('0x46'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x50fe4d,null))[_0x3f99('0x21')](function(_0x287339){if(_0x287339){var _0x403e40=_0x287339['savePath'];var _0x231c10=util[_0x3f99('0x47')](_0x3f99('0x48'),_0x403e40);if(fs['existsSync'](_0x231c10)){_0xfba9a7=!![];return _0x425127[_0x3f99('0x49')](_0x231c10,_0x403e40,config[_0x3f99('0x4a')]['recording'])['then'](function(){return _0x287339;});}return _0x287339;}})[_0x3f99('0x21')](function(_0xbc7c65){if(_0xbc7c65){var _0x4a1ba6=_0xbc7c65['savePath'];if(!fs['existsSync'](_0x4a1ba6)){throw new db[(_0x3f99('0x4b'))][(_0x3f99('0x4c'))](_0x3f99('0x4d'));}if(_0xbc7c65['filename']){return _0x50fe4d[_0x3f99('0x44')](_0x4a1ba6,_0xbc7c65[_0x3f99('0x4e')]+path[_0x3f99('0x4f')](_0x4a1ba6),function(){if(_0xfba9a7){fs[_0x3f99('0x50')](_0x4a1ba6);}});}else{return _0x50fe4d[_0x3f99('0x44')](_0x4a1ba6,function(_0x5b197c){if(_0xfba9a7){fs[_0x3f99('0x50')](_0x4a1ba6);}});}}})[_0x3f99('0x42')](function(_0x889cf1){if(_0x889cf1[_0x3f99('0x51')]==='SquareRecording\x20not\x20found'){_0x50fe4d[_0x3f99('0x19')](0x194)[_0x3f99('0x52')]('Not\x20found');}else{return handleError(_0x50fe4d,null);}});};exports[_0x3f99('0x53')]=function(_0x12d0c3,_0x2bb737){return db[_0x3f99('0x3b')][_0x3f99('0x41')]({'where':{'id':_0x12d0c3[_0x3f99('0x40')]['id']}})[_0x3f99('0x21')](function(_0x18cf7f){if(!_0x18cf7f)throw new ReferenceError('Entity\x20not\x20found');return _0x18cf7f;})['then'](function(_0x116a76){var _0x22193f=_0x116a76[_0x3f99('0x46')];logger[_0x3f99('0x54')](_0x3f99('0x55'),_0x22193f);if(!_[_0x3f99('0x56')](_0x116a76[_0x3f99('0x46')])&&fs['existsSync'](_0x22193f)){logger[_0x3f99('0x54')](_0x3f99('0x57')+_0x22193f+_0x3f99('0x58'));fs['unlinkSync'](_0x22193f);}_0x22193f=_0x22193f+_0x3f99('0x59');if(!_[_0x3f99('0x56')](_0x116a76[_0x3f99('0x46')])&&fs[_0x3f99('0x5a')](_0x22193f)){logger[_0x3f99('0x54')](_0x3f99('0x57')+_0x22193f+_0x3f99('0x58'));fs[_0x3f99('0x5b')](_0x22193f);}return _0x116a76;})[_0x3f99('0x21')](function(_0x5118f6){if(!_0x5118f6)throw new InternalError();return _0x5118f6[_0x3f99('0x53')]();})['then'](function(){_0x2bb737[_0x3f99('0x19')](0xcc)[_0x3f99('0x1a')]();})[_0x3f99('0x42')](handleError(_0x2bb737,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 4932ba1..7cf62a3 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 _0x2bab=['define','square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareRecording.attributes'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0x2bab,0x1ba));var _0xb2ba=function(_0x22a028,_0x5c5403){_0x22a028=_0x22a028-0x0;var _0x4dd66d=_0x2bab[_0x22a028];return _0x4dd66d;};'use strict';var _=require(_0xb2ba('0x0'));var util=require(_0xb2ba('0x1'));var logger=require(_0xb2ba('0x2'))(_0xb2ba('0x3'));var moment=require('moment');var BPromise=require(_0xb2ba('0x4'));var rp=require(_0xb2ba('0x5'));var fs=require('fs');var path=require(_0xb2ba('0x6'));var rimraf=require('rimraf');var config=require(_0xb2ba('0x7'));var attributes=require(_0xb2ba('0x8'));module['exports']=function(_0x5ea667,_0x5ab92f){return _0x5ea667[_0xb2ba('0x9')]('SquareRecording',attributes,{'tableName':_0xb2ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf567=['rimraf','../../config/environment','./squareRecording.attributes','define','square_recordings','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0xf46074,_0x296efa){var _0x11066f=function(_0x175b4b){while(--_0x175b4b){_0xf46074['push'](_0xf46074['shift']());}};_0x11066f(++_0x296efa);}(_0xf567,0x118));var _0x7f56=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf567[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var logger=require(_0x7f56('0x2'))('api');var moment=require(_0x7f56('0x3'));var BPromise=require(_0x7f56('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f56('0x5'));var rimraf=require(_0x7f56('0x6'));var config=require(_0x7f56('0x7'));var attributes=require(_0x7f56('0x8'));module['exports']=function(_0x444b66,_0x215ff1){return _0x444b66[_0x7f56('0x9')]('SquareRecording',attributes,{'tableName':_0x7f56('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 710fe40..e16c485 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 _0x98b4=['jayson/promise','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','CreateSquareRecording','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4716b9,_0x3d1435){var _0x472146=function(_0x3b9c55){while(--_0x3b9c55){_0x4716b9['push'](_0x4716b9['shift']());}};_0x472146(++_0x3d1435);}(_0x98b4,0x18b));var _0x498b=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x98b4[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0x498b('0x0'));var util=require(_0x498b('0x1'));var moment=require(_0x498b('0x2'));var BPromise=require(_0x498b('0x3'));var rs=require(_0x498b('0x4'));var fs=require('fs');var Redis=require(_0x498b('0x5'));var db=require(_0x498b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x498b('0x7'))(_0x498b('0x8'));var config=require(_0x498b('0x9'));var jayson=require(_0x498b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52d7e8,_0x1235ba,_0x5602c8){return new BPromise(function(_0x321a76,_0x4cb5fe){return client[_0x498b('0xb')](_0x52d7e8,_0x5602c8)[_0x498b('0xc')](function(_0x2514cc){logger['info'](_0x498b('0xd'),_0x1235ba,_0x498b('0xe'));logger[_0x498b('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x1235ba,_0x498b('0xe'),JSON['stringify'](_0x2514cc));if(_0x2514cc[_0x498b('0x10')]){if(_0x2514cc['error'][_0x498b('0x11')]===0x1f4){logger['error'](_0x498b('0xd'),_0x1235ba,_0x2514cc['error']['message']);return _0x4cb5fe(_0x2514cc[_0x498b('0x10')]['message']);}logger[_0x498b('0x10')](_0x498b('0xd'),_0x1235ba,_0x2514cc[_0x498b('0x10')][_0x498b('0x12')]);return _0x321a76(_0x2514cc[_0x498b('0x10')]['message']);}else{logger[_0x498b('0x13')](_0x498b('0xd'),_0x1235ba,_0x498b('0xe'));_0x321a76(_0x2514cc[_0x498b('0x14')][_0x498b('0x12')]);}})['catch'](function(_0x35b2a0){logger['error'](_0x498b('0xd'),_0x1235ba,_0x35b2a0);_0x4cb5fe(_0x35b2a0);});});}exports[_0x498b('0x15')]=function(_0xa49daa){var _0x5bdee4=this;return new Promise(function(_0x4ab931,_0x34f906){return db['SquareRecording'][_0x498b('0x16')](_0xa49daa[_0x498b('0x17')],{'raw':_0xa49daa[_0x498b('0x18')]?_0xa49daa[_0x498b('0x18')][_0x498b('0x19')]===undefined?!![]:![]:!![]})[_0x498b('0xc')](function(_0x15967f){logger[_0x498b('0x13')](_0x498b('0x15'),_0xa49daa);logger['debug'](_0x498b('0x15'),_0xa49daa,JSON[_0x498b('0x1a')](_0x15967f));_0x4ab931(_0x15967f);})['catch'](function(_0x5b4161){logger['error'](_0x498b('0x15'),_0x5b4161[_0x498b('0x12')],_0xa49daa);_0x34f906(_0x5bdee4[_0x498b('0x10')](0x1f4,_0x5b4161[_0x498b('0x12')]));});});}; \ No newline at end of file +var _0xc045=['client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareRecording','then','CreateSquareRecording','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x42184d,_0x264f92){var _0x144722=function(_0x4926d8){while(--_0x4926d8){_0x42184d['push'](_0x42184d['shift']());}};_0x144722(++_0x264f92);}(_0xc045,0x18b));var _0x5c04=function(_0x502137,_0x372ad2){_0x502137=_0x502137-0x0;var _0x443ecf=_0xc045[_0x502137];return _0x443ecf;};'use strict';var _=require(_0x5c04('0x0'));var util=require(_0x5c04('0x1'));var moment=require(_0x5c04('0x2'));var BPromise=require('bluebird');var rs=require(_0x5c04('0x3'));var fs=require('fs');var Redis=require(_0x5c04('0x4'));var db=require(_0x5c04('0x5'))['db'];var utils=require(_0x5c04('0x6'));var logger=require(_0x5c04('0x7'))(_0x5c04('0x8'));var config=require(_0x5c04('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5c04('0xa')][_0x5c04('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54c88f,_0x20bb93,_0x4d517c){return new BPromise(function(_0x50b35e,_0x3aa469){return client[_0x5c04('0xc')](_0x54c88f,_0x4d517c)['then'](function(_0x568ddd){logger[_0x5c04('0xd')](_0x5c04('0xe'),_0x20bb93,_0x5c04('0xf'));logger[_0x5c04('0x10')](_0x5c04('0x11'),_0x20bb93,'request\x20sent',JSON[_0x5c04('0x12')](_0x568ddd));if(_0x568ddd[_0x5c04('0x13')]){if(_0x568ddd[_0x5c04('0x13')][_0x5c04('0x14')]===0x1f4){logger[_0x5c04('0x13')](_0x5c04('0xe'),_0x20bb93,_0x568ddd['error'][_0x5c04('0x15')]);return _0x3aa469(_0x568ddd['error'][_0x5c04('0x15')]);}logger[_0x5c04('0x13')](_0x5c04('0xe'),_0x20bb93,_0x568ddd[_0x5c04('0x13')][_0x5c04('0x15')]);return _0x50b35e(_0x568ddd[_0x5c04('0x13')][_0x5c04('0x15')]);}else{logger[_0x5c04('0xd')](_0x5c04('0xe'),_0x20bb93,_0x5c04('0xf'));_0x50b35e(_0x568ddd[_0x5c04('0x16')]['message']);}})[_0x5c04('0x17')](function(_0x9d8d11){logger[_0x5c04('0x13')](_0x5c04('0xe'),_0x20bb93,_0x9d8d11);_0x3aa469(_0x9d8d11);});});}exports['CreateSquareRecording']=function(_0x207c03){var _0x3bd730=this;return new Promise(function(_0xebbd82,_0x20f5fb){return db[_0x5c04('0x18')]['create'](_0x207c03['body'],{'raw':_0x207c03['options']?_0x207c03['options']['raw']===undefined?!![]:![]:!![]})[_0x5c04('0x19')](function(_0xf83e31){logger[_0x5c04('0xd')](_0x5c04('0x1a'),_0x207c03);logger['debug'](_0x5c04('0x1a'),_0x207c03,JSON[_0x5c04('0x12')](_0xf83e31));_0xebbd82(_0xf83e31);})[_0x5c04('0x17')](function(_0xac7279){logger[_0x5c04('0x13')](_0x5c04('0x1a'),_0xac7279[_0x5c04('0x15')],_0x207c03);_0x20f5fb(_0x3bd730[_0x5c04('0x13')](0x1f4,_0xac7279[_0x5c04('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index a586274..42df425 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 _0x8cf6=['/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8cf6,0xba));var _0x68cf=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x8cf6[_0x5ecadc];return _0x565037;};'use strict';var multer=require(_0x68cf('0x0'));var util=require(_0x68cf('0x1'));var path=require(_0x68cf('0x2'));var timeout=require(_0x68cf('0x3'));var express=require(_0x68cf('0x4'));var router=express['Router']();var fs_extra=require(_0x68cf('0x5'));var auth=require(_0x68cf('0x6'));var interaction=require(_0x68cf('0x7'));var config=require(_0x68cf('0x8'));var controller=require(_0x68cf('0x9'));router[_0x68cf('0xa')]('/',auth[_0x68cf('0xb')](),controller['index']);router[_0x68cf('0xa')](_0x68cf('0xc'),auth[_0x68cf('0xb')](),controller[_0x68cf('0xd')]);router['get'](_0x68cf('0xe'),auth['isAuthenticated'](),controller[_0x68cf('0xf')]);router['post']('/',auth[_0x68cf('0xb')](),controller['create']);router[_0x68cf('0x10')](_0x68cf('0xe'),auth[_0x68cf('0xb')](),controller['update']);router[_0x68cf('0x11')](_0x68cf('0xe'),auth[_0x68cf('0xb')](),controller[_0x68cf('0x12')]);module[_0x68cf('0x13')]=router; \ No newline at end of file +var _0xec64=['index','/describe','describe','/:id','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReport.controller','get','isAuthenticated'];(function(_0x40ebd0,_0x1a98a2){var _0x2b1a30=function(_0x30f384){while(--_0x30f384){_0x40ebd0['push'](_0x40ebd0['shift']());}};_0x2b1a30(++_0x1a98a2);}(_0xec64,0x88));var _0x4ec6=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0xec64[_0x3cfb0d];return _0x3486b4;};'use strict';var multer=require(_0x4ec6('0x0'));var util=require('util');var path=require(_0x4ec6('0x1'));var timeout=require(_0x4ec6('0x2'));var express=require(_0x4ec6('0x3'));var router=express[_0x4ec6('0x4')]();var fs_extra=require(_0x4ec6('0x5'));var auth=require(_0x4ec6('0x6'));var interaction=require(_0x4ec6('0x7'));var config=require('../../config/environment');var controller=require(_0x4ec6('0x8'));router[_0x4ec6('0x9')]('/',auth[_0x4ec6('0xa')](),controller[_0x4ec6('0xb')]);router[_0x4ec6('0x9')](_0x4ec6('0xc'),auth[_0x4ec6('0xa')](),controller[_0x4ec6('0xd')]);router['get'](_0x4ec6('0xe'),auth[_0x4ec6('0xa')](),controller['show']);router[_0x4ec6('0xf')]('/',auth['isAuthenticated'](),controller[_0x4ec6('0x10')]);router['put'](_0x4ec6('0xe'),auth[_0x4ec6('0xa')](),controller[_0x4ec6('0x11')]);router[_0x4ec6('0x12')]('/:id',auth[_0x4ec6('0xa')](),controller[_0x4ec6('0x13')]);module[_0x4ec6('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 5a3a2c7..3610fdc 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 _0x2294=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x5179a5,_0x419746){var _0x15c8ce=function(_0x1b13c4){while(--_0x1b13c4){_0x5179a5['push'](_0x5179a5['shift']());}};_0x15c8ce(++_0x419746);}(_0x2294,0x199));var _0x4229=function(_0x314672,_0x370d21){_0x314672=_0x314672-0x0;var _0xae423c=_0x2294[_0x314672];return _0xae423c;};'use strict';var Sequelize=require(_0x4229('0x0'));module[_0x4229('0x1')]={'network':{'type':Sequelize[_0x4229('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x4229('0x2')]},'channel':{'type':Sequelize[_0x4229('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4229('0x2')]},'version':{'type':Sequelize[_0x4229('0x2')]},'callerid':{'type':Sequelize[_0x4229('0x2')]},'calleridname':{'type':Sequelize[_0x4229('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x4229('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x4229('0x2')]},'rdnis':{'type':Sequelize[_0x4229('0x2')]},'context':{'type':Sequelize[_0x4229('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4229('0x2')]},'enhanced':{'type':Sequelize[_0x4229('0x2')]},'accountcode':{'type':Sequelize[_0x4229('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x4229('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4229('0x3')]},'bot':{'type':Sequelize[_0x4229('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x299b=['STRING','DATE','BOOLEAN'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x299b,0x120));var _0xb299=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x299b[_0x1ad926];return _0x1b81dc;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0xb299('0x0')]},'network_script':{'type':Sequelize[_0xb299('0x0')]},'request':{'type':Sequelize[_0xb299('0x0')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb299('0x0')]},'type':{'type':Sequelize[_0xb299('0x0')]},'uniqueid':{'type':Sequelize[_0xb299('0x0')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb299('0x0')]},'calleridname':{'type':Sequelize[_0xb299('0x0')]},'callingpres':{'type':Sequelize[_0xb299('0x0')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xb299('0x0')]},'callingtns':{'type':Sequelize[_0xb299('0x0')]},'dnid':{'type':Sequelize[_0xb299('0x0')]},'rdnis':{'type':Sequelize[_0xb299('0x0')]},'context':{'type':Sequelize[_0xb299('0x0')]},'extension':{'type':Sequelize[_0xb299('0x0')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xb299('0x0')]},'accountcode':{'type':Sequelize[_0xb299('0x0')]},'threadid':{'type':Sequelize[_0xb299('0x0')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb299('0x1')]},'leaveAt':{'type':Sequelize[_0xb299('0x1')]},'bot':{'type':Sequelize[_0xb299('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index fca355c..6440de9 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 _0x9651=['desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','stack','send','index','map','type','key','name','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SquareReport','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','find','create','body','destroy','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce'];(function(_0x21125a,_0x24e0f1){var _0x4b99e=function(_0x30af10){while(--_0x30af10){_0x21125a['push'](_0x21125a['shift']());}};_0x4b99e(++_0x24e0f1);}(_0x9651,0x166));var _0x1965=function(_0x48cd74,_0x4b28db){_0x48cd74=_0x48cd74-0x0;var _0x44df56=_0x9651[_0x48cd74];return _0x44df56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1965('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1965('0x1'));var rp=require(_0x1965('0x2'));var moment=require('moment');var BPromise=require(_0x1965('0x3'));var Mustache=require(_0x1965('0x4'));var util=require(_0x1965('0x5'));var path=require(_0x1965('0x6'));var sox=require(_0x1965('0x7'));var csv=require(_0x1965('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1965('0x9'));var _=require(_0x1965('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1965('0xb'));var deskjs=require(_0x1965('0xc'));var toCsv=require(_0x1965('0x8'));var querystring=require(_0x1965('0xd'));var Papa=require(_0x1965('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1965('0xf'));var hardwareService=require(_0x1965('0x10'));var logger=require(_0x1965('0x11'))(_0x1965('0x12'));var utils=require(_0x1965('0x13'));var config=require(_0x1965('0x14'));var licenseUtil=require(_0x1965('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe28598,_0x409727){_0x409727=_0x409727||0xcc;return function(_0x56ee8f){if(_0x56ee8f){return _0xe28598[_0x1965('0x16')](_0x409727);}return _0xe28598[_0x1965('0x17')](_0x409727)[_0x1965('0x18')]();};}function respondWithResult(_0x15d140,_0x516f8c){_0x516f8c=_0x516f8c||0xc8;return function(_0x38dbf4){if(_0x38dbf4){return _0x15d140[_0x1965('0x17')](_0x516f8c)[_0x1965('0x19')](_0x38dbf4);}};}function respondWithFilteredResult(_0x3c190a,_0x2457ba){return function(_0x327fa3){if(_0x327fa3){var _0xd82857=_0x327fa3[_0x1965('0x1a')],_0x25bea6=_0x2457ba[_0x1965('0x1b')],_0x1d8e0c=_0x2457ba[_0x1965('0x1b')]+_0x2457ba[_0x1965('0x1c')],_0x3c97de;if(_0x1d8e0c>=_0xd82857){_0x1d8e0c=_0xd82857;_0x3c97de=0xc8;}else{_0x3c97de=0xce;}_0x3c190a[_0x1965('0x17')](_0x3c97de);return _0x3c190a[_0x1965('0x1d')](_0x1965('0x1e'),_0x25bea6+'-'+_0x1d8e0c+'/'+_0xd82857)[_0x1965('0x19')](_0x327fa3);}return null;};}function patchUpdates(_0x14973b){return function(_0xc9bfad){try{jsonpatch['apply'](_0xc9bfad,_0x14973b,!![]);}catch(_0x27a706){return BPromise[_0x1965('0x1f')](_0x27a706);}return _0xc9bfad[_0x1965('0x20')]();};}function saveUpdates(_0x31e0c0,_0xd881ea){return function(_0x31ee7e){if(_0x31ee7e){return _0x31ee7e[_0x1965('0x21')](_0x31e0c0)[_0x1965('0x22')](function(_0x4a053e){return _0x4a053e;});}return null;};}function removeEntity(_0x314d5d,_0x33afb9){return function(_0xd5320){if(_0xd5320){return _0xd5320['destroy']()['then'](function(){_0x314d5d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3029dc,_0x5c06b9){return function(_0x36b5b9){if(!_0x36b5b9){_0x3029dc[_0x1965('0x16')](0x194);}return _0x36b5b9;};}function handleError(_0x581f73,_0x33d030){_0x33d030=_0x33d030||0x1f4;return function(_0x3a3ff4){logger[_0x1965('0x23')](_0x3a3ff4[_0x1965('0x24')]);if(_0x3a3ff4['name']){delete _0x3a3ff4['name'];}_0x581f73[_0x1965('0x17')](_0x33d030)[_0x1965('0x25')](_0x3a3ff4);};}exports[_0x1965('0x26')]=function(_0x41ff51,_0x3ccc77){var _0x34a532={},_0x4eaf92={},_0x466716={'count':0x0,'rows':[]};var _0x50cfd7=_[_0x1965('0x27')](db['SquareReport']['rawAttributes'],function(_0x1c9a7e){return{'name':_0x1c9a7e['fieldName'],'type':_0x1c9a7e[_0x1965('0x28')][_0x1965('0x29')]};});_0x4eaf92['model']=_[_0x1965('0x27')](_0x50cfd7,_0x1965('0x2a'));_0x4eaf92[_0x1965('0x2b')]=_['keys'](_0x41ff51[_0x1965('0x2b')]);_0x4eaf92['filters']=_['intersection'](_0x4eaf92[_0x1965('0x2c')],_0x4eaf92[_0x1965('0x2b')]);_0x34a532[_0x1965('0x2d')]=_[_0x1965('0x2e')](_0x4eaf92[_0x1965('0x2c')],qs['fields'](_0x41ff51[_0x1965('0x2b')][_0x1965('0x2f')]));_0x34a532[_0x1965('0x2d')]=_0x34a532['attributes'][_0x1965('0x30')]?_0x34a532[_0x1965('0x2d')]:_0x4eaf92[_0x1965('0x2c')];if(!_0x41ff51[_0x1965('0x2b')][_0x1965('0x31')](_0x1965('0x32'))){_0x34a532[_0x1965('0x1c')]=qs[_0x1965('0x1c')](_0x41ff51['query'][_0x1965('0x1c')]);_0x34a532[_0x1965('0x1b')]=qs[_0x1965('0x1b')](_0x41ff51[_0x1965('0x2b')][_0x1965('0x1b')]);}_0x34a532[_0x1965('0x33')]=qs[_0x1965('0x34')](_0x41ff51[_0x1965('0x2b')][_0x1965('0x34')]);_0x34a532[_0x1965('0x35')]=qs[_0x1965('0x36')](_[_0x1965('0x37')](_0x41ff51[_0x1965('0x2b')],_0x4eaf92['filters']),_0x50cfd7);if(_0x41ff51[_0x1965('0x2b')][_0x1965('0x38')]){_0x34a532[_0x1965('0x35')]=_[_0x1965('0x39')](_0x34a532[_0x1965('0x35')],{'$or':_['map'](_0x50cfd7,function(_0x303c02){if(_0x303c02['type']!==_0x1965('0x3a')){var _0x3fae0b={};_0x3fae0b[_0x303c02[_0x1965('0x2a')]]={'$like':'%'+_0x41ff51[_0x1965('0x2b')][_0x1965('0x38')]+'%'};return _0x3fae0b;}})});}_0x34a532=_[_0x1965('0x39')]({},_0x34a532,_0x41ff51[_0x1965('0x3b')]);var _0x2e3bae={'where':_0x34a532[_0x1965('0x35')]};return db[_0x1965('0x3c')]['count'](_0x2e3bae)[_0x1965('0x22')](function(_0x4b8460){_0x466716['count']=_0x4b8460;if(_0x41ff51[_0x1965('0x2b')][_0x1965('0x3d')]){_0x34a532[_0x1965('0x3e')]=[{'all':!![]}];}return db[_0x1965('0x3c')][_0x1965('0x3f')](_0x34a532);})[_0x1965('0x22')](function(_0x2d6ea7){_0x466716[_0x1965('0x40')]=_0x2d6ea7;return _0x466716;})['then'](respondWithFilteredResult(_0x3ccc77,_0x34a532))[_0x1965('0x41')](handleError(_0x3ccc77,null));};exports['show']=function(_0xdcdd02,_0x56ee11){var _0x6bdc2a={'raw':!![],'where':{'id':_0xdcdd02[_0x1965('0x42')]['id']}},_0x55b770={};_0x55b770[_0x1965('0x2c')]=_['keys'](db['SquareReport'][_0x1965('0x43')]);_0x55b770['query']=_[_0x1965('0x44')](_0xdcdd02[_0x1965('0x2b')]);_0x55b770['filters']=_[_0x1965('0x2e')](_0x55b770[_0x1965('0x2c')],_0x55b770['query']);_0x6bdc2a[_0x1965('0x2d')]=_[_0x1965('0x2e')](_0x55b770[_0x1965('0x2c')],qs['fields'](_0xdcdd02[_0x1965('0x2b')]['fields']));_0x6bdc2a['attributes']=_0x6bdc2a[_0x1965('0x2d')]['length']?_0x6bdc2a[_0x1965('0x2d')]:_0x55b770[_0x1965('0x2c')];if(_0xdcdd02[_0x1965('0x2b')][_0x1965('0x3d')]){_0x6bdc2a[_0x1965('0x3e')]=[{'all':!![]}];}_0x6bdc2a=_[_0x1965('0x39')]({},_0x6bdc2a,_0xdcdd02[_0x1965('0x3b')]);return db[_0x1965('0x3c')][_0x1965('0x45')](_0x6bdc2a)[_0x1965('0x22')](handleEntityNotFound(_0x56ee11,null))[_0x1965('0x22')](respondWithResult(_0x56ee11,null))['catch'](handleError(_0x56ee11,null));};exports[_0x1965('0x46')]=function(_0x1b999e,_0x205039){return db[_0x1965('0x3c')]['create'](_0x1b999e[_0x1965('0x47')],{})[_0x1965('0x22')](respondWithResult(_0x205039,0xc9))[_0x1965('0x41')](handleError(_0x205039,null));};exports[_0x1965('0x21')]=function(_0x3f66f1,_0x344e60){if(_0x3f66f1['body']['id']){delete _0x3f66f1[_0x1965('0x47')]['id'];}return db[_0x1965('0x3c')][_0x1965('0x45')]({'where':{'id':_0x3f66f1[_0x1965('0x42')]['id']}})[_0x1965('0x22')](handleEntityNotFound(_0x344e60,null))[_0x1965('0x22')](saveUpdates(_0x3f66f1[_0x1965('0x47')],null))[_0x1965('0x22')](respondWithResult(_0x344e60,null))['catch'](handleError(_0x344e60,null));};exports[_0x1965('0x48')]=function(_0x1f9f82,_0x254dec){return db['SquareReport'][_0x1965('0x45')]({'where':{'id':_0x1f9f82[_0x1965('0x42')]['id']}})[_0x1965('0x22')](handleEntityNotFound(_0x254dec,null))['then'](removeEntity(_0x254dec,null))[_0x1965('0x41')](handleError(_0x254dec,null));};exports[_0x1965('0x49')]=function(_0x5e7657,_0x1a9ed3){return db[_0x1965('0x3c')]['describe']()[_0x1965('0x22')](respondWithResult(_0x1a9ed3,null))[_0x1965('0x41')](handleError(_0x1a9ed3,null));}; \ No newline at end of file +var _0x1fe2=['save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','SquareReport','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x1a9aa6,_0x5aa13d){var _0x3cd246=function(_0x1bd201){while(--_0x1bd201){_0x1a9aa6['push'](_0x1a9aa6['shift']());}};_0x3cd246(++_0x5aa13d);}(_0x1fe2,0x72));var _0x21fe=function(_0x2b44fa,_0x35bb63){_0x2b44fa=_0x2b44fa-0x0;var _0x476b71=_0x1fe2[_0x2b44fa];return _0x476b71;};'use strict';var emlformat=require(_0x21fe('0x0'));var rimraf=require(_0x21fe('0x1'));var zipdir=require(_0x21fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x21fe('0x3'));var moment=require(_0x21fe('0x4'));var BPromise=require(_0x21fe('0x5'));var Mustache=require(_0x21fe('0x6'));var util=require(_0x21fe('0x7'));var path=require('path');var sox=require(_0x21fe('0x8'));var csv=require(_0x21fe('0x9'));var ejs=require(_0x21fe('0xa'));var fs=require('fs');var fs_extra=require(_0x21fe('0xb'));var _=require(_0x21fe('0xc'));var squel=require('squel');var crypto=require(_0x21fe('0xd'));var jsforce=require(_0x21fe('0xe'));var deskjs=require(_0x21fe('0xf'));var toCsv=require(_0x21fe('0x9'));var querystring=require('querystring');var Papa=require(_0x21fe('0x10'));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(_0x21fe('0x11'));var logger=require(_0x21fe('0x12'))(_0x21fe('0x13'));var utils=require('../../config/utils');var config=require(_0x21fe('0x14'));var licenseUtil=require(_0x21fe('0x15'));var db=require(_0x21fe('0x16'))['db'];function respondWithStatusCode(_0x5cb17e,_0x257be5){_0x257be5=_0x257be5||0xcc;return function(_0xb5260e){if(_0xb5260e){return _0x5cb17e[_0x21fe('0x17')](_0x257be5);}return _0x5cb17e['status'](_0x257be5)[_0x21fe('0x18')]();};}function respondWithResult(_0x2ec17d,_0x12a383){_0x12a383=_0x12a383||0xc8;return function(_0x3edea7){if(_0x3edea7){return _0x2ec17d[_0x21fe('0x19')](_0x12a383)[_0x21fe('0x1a')](_0x3edea7);}};}function respondWithFilteredResult(_0x1fa00c,_0x38d9ab){return function(_0x5cff2a){if(_0x5cff2a){var _0x15f42c=_0x5cff2a[_0x21fe('0x1b')],_0x5f3934=_0x38d9ab[_0x21fe('0x1c')],_0x3b952f=_0x38d9ab[_0x21fe('0x1c')]+_0x38d9ab[_0x21fe('0x1d')],_0x3fa079;if(_0x3b952f>=_0x15f42c){_0x3b952f=_0x15f42c;_0x3fa079=0xc8;}else{_0x3fa079=0xce;}_0x1fa00c[_0x21fe('0x19')](_0x3fa079);return _0x1fa00c[_0x21fe('0x1e')](_0x21fe('0x1f'),_0x5f3934+'-'+_0x3b952f+'/'+_0x15f42c)['json'](_0x5cff2a);}return null;};}function patchUpdates(_0x2e0618){return function(_0x4d1801){try{jsonpatch[_0x21fe('0x20')](_0x4d1801,_0x2e0618,!![]);}catch(_0xa1f61a){return BPromise[_0x21fe('0x21')](_0xa1f61a);}return _0x4d1801[_0x21fe('0x22')]();};}function saveUpdates(_0x19fee3,_0x1e7ced){return function(_0x1a5c80){if(_0x1a5c80){return _0x1a5c80['update'](_0x19fee3)[_0x21fe('0x23')](function(_0x26ba51){return _0x26ba51;});}return null;};}function removeEntity(_0xdfcf8b,_0x17f0a7){return function(_0x244d44){if(_0x244d44){return _0x244d44[_0x21fe('0x24')]()[_0x21fe('0x23')](function(){_0xdfcf8b['status'](0xcc)[_0x21fe('0x18')]();});}};}function handleEntityNotFound(_0x2229bc,_0xc71dac){return function(_0x2a319f){if(!_0x2a319f){_0x2229bc[_0x21fe('0x17')](0x194);}return _0x2a319f;};}function handleError(_0x2fc16d,_0x465345){_0x465345=_0x465345||0x1f4;return function(_0x10729e){logger[_0x21fe('0x25')](_0x10729e[_0x21fe('0x26')]);if(_0x10729e[_0x21fe('0x27')]){delete _0x10729e[_0x21fe('0x27')];}_0x2fc16d[_0x21fe('0x19')](_0x465345)[_0x21fe('0x28')](_0x10729e);};}exports[_0x21fe('0x29')]=function(_0x53a92f,_0x33372f){var _0x394279={},_0x4ee4d6={},_0x5828dc={'count':0x0,'rows':[]};var _0x128917=_[_0x21fe('0x2a')](db['SquareReport'][_0x21fe('0x2b')],function(_0x566a97){return{'name':_0x566a97['fieldName'],'type':_0x566a97[_0x21fe('0x2c')]['key']};});_0x4ee4d6[_0x21fe('0x2d')]=_[_0x21fe('0x2a')](_0x128917,_0x21fe('0x27'));_0x4ee4d6[_0x21fe('0x2e')]=_[_0x21fe('0x2f')](_0x53a92f[_0x21fe('0x2e')]);_0x4ee4d6[_0x21fe('0x30')]=_[_0x21fe('0x31')](_0x4ee4d6[_0x21fe('0x2d')],_0x4ee4d6[_0x21fe('0x2e')]);_0x394279[_0x21fe('0x32')]=_[_0x21fe('0x31')](_0x4ee4d6[_0x21fe('0x2d')],qs['fields'](_0x53a92f[_0x21fe('0x2e')]['fields']));_0x394279[_0x21fe('0x32')]=_0x394279[_0x21fe('0x32')][_0x21fe('0x33')]?_0x394279[_0x21fe('0x32')]:_0x4ee4d6['model'];if(!_0x53a92f[_0x21fe('0x2e')][_0x21fe('0x34')](_0x21fe('0x35'))){_0x394279[_0x21fe('0x1d')]=qs[_0x21fe('0x1d')](_0x53a92f[_0x21fe('0x2e')][_0x21fe('0x1d')]);_0x394279['offset']=qs[_0x21fe('0x1c')](_0x53a92f[_0x21fe('0x2e')]['offset']);}_0x394279['order']=qs[_0x21fe('0x36')](_0x53a92f[_0x21fe('0x2e')]['sort']);_0x394279[_0x21fe('0x37')]=qs[_0x21fe('0x30')](_[_0x21fe('0x38')](_0x53a92f[_0x21fe('0x2e')],_0x4ee4d6[_0x21fe('0x30')]),_0x128917);if(_0x53a92f['query']['filter']){_0x394279[_0x21fe('0x37')]=_[_0x21fe('0x39')](_0x394279[_0x21fe('0x37')],{'$or':_[_0x21fe('0x2a')](_0x128917,function(_0x2e54fb){if(_0x2e54fb['type']!==_0x21fe('0x3a')){var _0x23f696={};_0x23f696[_0x2e54fb[_0x21fe('0x27')]]={'$like':'%'+_0x53a92f[_0x21fe('0x2e')]['filter']+'%'};return _0x23f696;}})});}_0x394279=_[_0x21fe('0x39')]({},_0x394279,_0x53a92f[_0x21fe('0x3b')]);var _0x4b8aeb={'where':_0x394279[_0x21fe('0x37')]};return db[_0x21fe('0x3c')][_0x21fe('0x1b')](_0x4b8aeb)[_0x21fe('0x23')](function(_0x220b12){_0x5828dc[_0x21fe('0x1b')]=_0x220b12;if(_0x53a92f['query'][_0x21fe('0x3d')]){_0x394279[_0x21fe('0x3e')]=[{'all':!![]}];}return db['SquareReport'][_0x21fe('0x3f')](_0x394279);})[_0x21fe('0x23')](function(_0x31b55b){_0x5828dc[_0x21fe('0x40')]=_0x31b55b;return _0x5828dc;})[_0x21fe('0x23')](respondWithFilteredResult(_0x33372f,_0x394279))[_0x21fe('0x41')](handleError(_0x33372f,null));};exports[_0x21fe('0x42')]=function(_0x2a8741,_0x46c5b8){var _0x1a1690={'raw':!![],'where':{'id':_0x2a8741[_0x21fe('0x43')]['id']}},_0x53dbaa={};_0x53dbaa[_0x21fe('0x2d')]=_[_0x21fe('0x2f')](db[_0x21fe('0x3c')]['rawAttributes']);_0x53dbaa[_0x21fe('0x2e')]=_[_0x21fe('0x2f')](_0x2a8741[_0x21fe('0x2e')]);_0x53dbaa[_0x21fe('0x30')]=_[_0x21fe('0x31')](_0x53dbaa[_0x21fe('0x2d')],_0x53dbaa['query']);_0x1a1690[_0x21fe('0x32')]=_[_0x21fe('0x31')](_0x53dbaa['model'],qs[_0x21fe('0x44')](_0x2a8741[_0x21fe('0x2e')][_0x21fe('0x44')]));_0x1a1690[_0x21fe('0x32')]=_0x1a1690['attributes'][_0x21fe('0x33')]?_0x1a1690['attributes']:_0x53dbaa['model'];if(_0x2a8741[_0x21fe('0x2e')][_0x21fe('0x3d')]){_0x1a1690['include']=[{'all':!![]}];}_0x1a1690=_[_0x21fe('0x39')]({},_0x1a1690,_0x2a8741[_0x21fe('0x3b')]);return db[_0x21fe('0x3c')][_0x21fe('0x45')](_0x1a1690)[_0x21fe('0x23')](handleEntityNotFound(_0x46c5b8,null))[_0x21fe('0x23')](respondWithResult(_0x46c5b8,null))[_0x21fe('0x41')](handleError(_0x46c5b8,null));};exports['create']=function(_0x5172d6,_0x1c154d){return db['SquareReport'][_0x21fe('0x46')](_0x5172d6[_0x21fe('0x47')],{})[_0x21fe('0x23')](respondWithResult(_0x1c154d,0xc9))['catch'](handleError(_0x1c154d,null));};exports[_0x21fe('0x48')]=function(_0x5e5e61,_0x5ed16f){if(_0x5e5e61['body']['id']){delete _0x5e5e61[_0x21fe('0x47')]['id'];}return db[_0x21fe('0x3c')][_0x21fe('0x45')]({'where':{'id':_0x5e5e61['params']['id']}})[_0x21fe('0x23')](handleEntityNotFound(_0x5ed16f,null))[_0x21fe('0x23')](saveUpdates(_0x5e5e61[_0x21fe('0x47')],null))['then'](respondWithResult(_0x5ed16f,null))['catch'](handleError(_0x5ed16f,null));};exports[_0x21fe('0x24')]=function(_0x1702fe,_0xe1643d){return db[_0x21fe('0x3c')][_0x21fe('0x45')]({'where':{'id':_0x1702fe[_0x21fe('0x43')]['id']}})[_0x21fe('0x23')](handleEntityNotFound(_0xe1643d,null))['then'](removeEntity(_0xe1643d,null))[_0x21fe('0x41')](handleError(_0xe1643d,null));};exports[_0x21fe('0x49')]=function(_0x2dc9c5,_0x16eac9){return db[_0x21fe('0x3c')][_0x21fe('0x49')]()['then'](respondWithResult(_0x16eac9,null))[_0x21fe('0x41')](handleError(_0x16eac9,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index bf5620a..abfcb2b 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 _0xef4a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','leaveAt','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef4a,0x1cf));var _0xaef4=function(_0x2d156f,_0x310ea0){_0x2d156f=_0x2d156f-0x0;var _0x3c8f2b=_0xef4a[_0x2d156f];return _0x3c8f2b;};'use strict';var _=require(_0xaef4('0x0'));var util=require(_0xaef4('0x1'));var logger=require(_0xaef4('0x2'))(_0xaef4('0x3'));var moment=require(_0xaef4('0x4'));var BPromise=require(_0xaef4('0x5'));var rp=require(_0xaef4('0x6'));var fs=require('fs');var path=require(_0xaef4('0x7'));var rimraf=require(_0xaef4('0x8'));var config=require(_0xaef4('0x9'));var attributes=require(_0xaef4('0xa'));module['exports']=function(_0xaf1ac7,_0x3cc847){return _0xaf1ac7[_0xaef4('0xb')](_0xaef4('0xc'),attributes,{'tableName':_0xaef4('0xd'),'paranoid':![],'indexes':[{'name':_0xaef4('0xe'),'fields':['uniqueid','project_name']},{'name':_0xaef4('0xf'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6157=['../../config/environment','./squareReport.attributes','report_square','uid_pname','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x36fa68,_0x2fbb18){var _0x3a8177=function(_0x28a6c1){while(--_0x28a6c1){_0x36fa68['push'](_0x36fa68['shift']());}};_0x3a8177(++_0x2fbb18);}(_0x6157,0x1f0));var _0x7615=function(_0x5f2712,_0x4ac4fd){_0x5f2712=_0x5f2712-0x0;var _0x25e4e3=_0x6157[_0x5f2712];return _0x25e4e3;};'use strict';var _=require(_0x7615('0x0'));var util=require(_0x7615('0x1'));var logger=require(_0x7615('0x2'))(_0x7615('0x3'));var moment=require(_0x7615('0x4'));var BPromise=require(_0x7615('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7615('0x6'));var rimraf=require(_0x7615('0x7'));var config=require(_0x7615('0x8'));var attributes=require(_0x7615('0x9'));module['exports']=function(_0x1ce226,_0x1a4458){return _0x1ce226['define']('SquareReport',attributes,{'tableName':_0x7615('0xa'),'paranoid':![],'indexes':[{'name':_0x7615('0xb'),'fields':['uniqueid',_0x7615('0xc')]},{'name':'leaveAt','fields':[_0x7615('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index ad2cf0f..283221b 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 _0x1cb9=['options','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareReport','SquareReport','body','raw','then','UpdateSquareReport','update'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x1cb9,0x14e));var _0x91cb=function(_0x181035,_0x161316){_0x181035=_0x181035-0x0;var _0x53f49c=_0x1cb9[_0x181035];return _0x53f49c;};'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')]('SquareReport,\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')]['create'](_0x1cd34b[_0x91cb('0x18')],{'raw':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]===undefined?!![]:![]:!![]})[_0x91cb('0x1a')](function(_0x56e409){logger['info']('CreateSquareReport',_0x1cd34b);logger[_0x91cb('0xf')](_0x91cb('0x16'),_0x1cd34b,JSON[_0x91cb('0x11')](_0x56e409));_0x5cc1c3(_0x56e409);})[_0x91cb('0x15')](function(_0x5c6a15){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x5c6a15[_0x91cb('0x13')],_0x1cd34b);_0x3fba4f(_0xcd1a78['error'](0x1f4,_0x5c6a15[_0x91cb('0x13')]));});});};exports[_0x91cb('0x1b')]=function(_0x2447e7){var _0x422d14=this;return new Promise(function(_0x3ca500,_0x7ad361){return db[_0x91cb('0x17')][_0x91cb('0x1c')](_0x2447e7[_0x91cb('0x18')],{'raw':_0x2447e7['options']?_0x2447e7['options'][_0x91cb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2447e7['options']?_0x2447e7[_0x91cb('0x1d')][_0x91cb('0x1e')]||null:null,'attributes':_0x2447e7[_0x91cb('0x1d')]?_0x2447e7['options'][_0x91cb('0x1f')]||null:null,'limit':_0x2447e7['options']?_0x2447e7[_0x91cb('0x1d')][_0x91cb('0x20')]||null:null})[_0x91cb('0x1a')](function(_0x2fb473){logger[_0x91cb('0xc')]('UpdateSquareReport',_0x2447e7);logger[_0x91cb('0xf')]('UpdateSquareReport',_0x2447e7,JSON[_0x91cb('0x11')](_0x2fb473));_0x3ca500(_0x2fb473);})[_0x91cb('0x15')](function(_0x445fe1){logger['error'](_0x91cb('0x1b'),_0x445fe1[_0x91cb('0x13')],_0x2447e7);_0x7ad361(_0x422d14[_0x91cb('0x12')](0x1f4,_0x445fe1[_0x91cb('0x13')]));});});}; \ No newline at end of file +var _0x7fbe=['stringify','error','code','message','result','catch','SquareReport','create','options','raw','CreateSquareReport','update','where','limit','info','UpdateSquareReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x347541,_0x137cf){_0x347541=_0x347541-0x0;var _0x5c0e38=_0x7fbe[_0x347541];return _0x5c0e38;};'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);});});}exports['CreateSquareReport']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')](_0x293a47['body'],{'raw':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x15f7a4){logger['info'](_0xe7fb('0x1c'),_0x293a47);logger[_0xe7fb('0x10')]('CreateSquareReport',_0x293a47,JSON[_0xe7fb('0x12')](_0x15f7a4));_0x1e77fd(_0x15f7a4);})[_0xe7fb('0x17')](function(_0x3ae8f1){logger['error'](_0xe7fb('0x1c'),_0x3ae8f1[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463['error'](0x1f4,_0x3ae8f1['message']));});});};exports['UpdateSquareReport']=function(_0x35e4db){var _0x53c43a=this;return new Promise(function(_0x49b219,_0x4026b1){return db[_0xe7fb('0x18')][_0xe7fb('0x1d')](_0x35e4db['body'],{'raw':_0x35e4db[_0xe7fb('0x1a')]?_0x35e4db[_0xe7fb('0x1a')][_0xe7fb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35e4db[_0xe7fb('0x1a')]?_0x35e4db[_0xe7fb('0x1a')][_0xe7fb('0x1e')]||null:null,'attributes':_0x35e4db[_0xe7fb('0x1a')]?_0x35e4db['options']['attributes']||null:null,'limit':_0x35e4db[_0xe7fb('0x1a')]?_0x35e4db[_0xe7fb('0x1a')][_0xe7fb('0x1f')]||null:null})['then'](function(_0xb1f2f4){logger[_0xe7fb('0x20')](_0xe7fb('0x21'),_0x35e4db);logger[_0xe7fb('0x10')](_0xe7fb('0x21'),_0x35e4db,JSON[_0xe7fb('0x12')](_0xb1f2f4));_0x49b219(_0xb1f2f4);})[_0xe7fb('0x17')](function(_0x3dd0be){logger['error'](_0xe7fb('0x21'),_0x3dd0be[_0xe7fb('0x15')],_0x35e4db);_0x4026b1(_0x53c43a[_0xe7fb('0x13')](0x1f4,_0x3dd0be['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index d912140..0ffd779 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 _0x75f3=['delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x218f38,_0xa91554){var _0x3dff4e=function(_0x5b6980){while(--_0x5b6980){_0x218f38['push'](_0x218f38['shift']());}};_0x3dff4e(++_0xa91554);}(_0x75f3,0x189));var _0x375f=function(_0x14b890,_0x54f95f){_0x14b890=_0x14b890-0x0;var _0x50b17c=_0x75f3[_0x14b890];return _0x50b17c;};'use strict';var multer=require(_0x375f('0x0'));var util=require(_0x375f('0x1'));var path=require(_0x375f('0x2'));var timeout=require('connect-timeout');var express=require(_0x375f('0x3'));var router=express[_0x375f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x375f('0x5'));var config=require(_0x375f('0x6'));var controller=require(_0x375f('0x7'));router[_0x375f('0x8')]('/',auth[_0x375f('0x9')](),controller['index']);router[_0x375f('0x8')](_0x375f('0xa'),auth[_0x375f('0x9')](),controller[_0x375f('0xb')]);router[_0x375f('0x8')](_0x375f('0xc'),auth[_0x375f('0x9')](),controller[_0x375f('0xd')]);router[_0x375f('0xe')]('/',auth[_0x375f('0x9')](),controller['create']);router['put'](_0x375f('0xc'),auth[_0x375f('0x9')](),controller['update']);router[_0x375f('0xf')]('/:id',auth[_0x375f('0x9')](),controller['destroy']);module[_0x375f('0x10')]=router; \ No newline at end of file +var _0x5e60=['create','put','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0x5e60,0x77));var _0x05e6=function(_0x365416,_0x3d8b00){_0x365416=_0x365416-0x0;var _0x5dcaa7=_0x5e60[_0x365416];return _0x5dcaa7;};'use strict';var multer=require(_0x05e6('0x0'));var util=require(_0x05e6('0x1'));var path=require(_0x05e6('0x2'));var timeout=require('connect-timeout');var express=require(_0x05e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x05e6('0x4'));var interaction=require(_0x05e6('0x5'));var config=require(_0x05e6('0x6'));var controller=require(_0x05e6('0x7'));router[_0x05e6('0x8')]('/',auth[_0x05e6('0x9')](),controller[_0x05e6('0xa')]);router[_0x05e6('0x8')](_0x05e6('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x05e6('0xc'),auth[_0x05e6('0x9')](),controller[_0x05e6('0xd')]);router['post']('/',auth[_0x05e6('0x9')](),controller[_0x05e6('0xe')]);router[_0x05e6('0xf')](_0x05e6('0xc'),auth[_0x05e6('0x9')](),controller[_0x05e6('0x10')]);router['delete']('/:id',auth[_0x05e6('0x9')](),controller[_0x05e6('0x11')]);module[_0x05e6('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index e681a6d..87e78c8 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 _0xa9df=['STRING','TEXT','sequelize','exports'];(function(_0x3800e9,_0x17b736){var _0x438557=function(_0x4f4251){while(--_0x4f4251){_0x3800e9['push'](_0x3800e9['shift']());}};_0x438557(++_0x17b736);}(_0xa9df,0x9a));var _0xfa9d=function(_0x5db519,_0x5bbfae){_0x5db519=_0x5db519-0x0;var _0x31c584=_0xa9df[_0x5db519];return _0x31c584;};'use strict';var Sequelize=require(_0xfa9d('0x0'));module[_0xfa9d('0x1')]={'uniqueid':{'type':Sequelize[_0xfa9d('0x2')]},'node':{'type':Sequelize[_0xfa9d('0x2')]},'application':{'type':Sequelize[_0xfa9d('0x2')]},'data':{'type':Sequelize[_0xfa9d('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xfa9d('0x2')]}}; \ No newline at end of file +var _0x8942=['sequelize','exports','STRING','TEXT'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x8942,0x1e4));var _0x2894=function(_0x4192da,_0x46b408){_0x4192da=_0x4192da-0x0;var _0xe87ea6=_0x8942[_0x4192da];return _0xe87ea6;};'use strict';var Sequelize=require(_0x2894('0x0'));module[_0x2894('0x1')]={'uniqueid':{'type':Sequelize[_0x2894('0x2')]},'node':{'type':Sequelize[_0x2894('0x2')]},'application':{'type':Sequelize[_0x2894('0x2')]},'data':{'type':Sequelize[_0x2894('0x3')]},'project_name':{'type':Sequelize[_0x2894('0x2')]},'callerid':{'type':Sequelize[_0x2894('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 2ee476e..e8f7325 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 _0xe95c=['body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','offset','limit','set','json','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','count','includeAll','include','SquareDetailsReport','findAll','rows','show','params','options','create'];(function(_0x5a311a,_0x2919bc){var _0x4b98b1=function(_0x31d9b8){while(--_0x31d9b8){_0x5a311a['push'](_0x5a311a['shift']());}};_0x4b98b1(++_0x2919bc);}(_0xe95c,0x1a2));var _0xce95=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe95c[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xce95('0x0'));var rimraf=require(_0xce95('0x1'));var zipdir=require(_0xce95('0x2'));var jsonpatch=require(_0xce95('0x3'));var rp=require('request-promise');var moment=require(_0xce95('0x4'));var BPromise=require(_0xce95('0x5'));var Mustache=require(_0xce95('0x6'));var util=require('util');var path=require(_0xce95('0x7'));var sox=require(_0xce95('0x8'));var csv=require(_0xce95('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce95('0xa'));var _=require(_0xce95('0xb'));var squel=require(_0xce95('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xce95('0xd'));var toCsv=require(_0xce95('0x9'));var querystring=require(_0xce95('0xe'));var Papa=require('papaparse');var Redis=require(_0xce95('0xf'));var authService=require(_0xce95('0x10'));var qs=require(_0xce95('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce95('0x12'));var logger=require(_0xce95('0x13'))(_0xce95('0x14'));var utils=require(_0xce95('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28ff90,_0x450ab6){_0x450ab6=_0x450ab6||0xcc;return function(_0x442876){if(_0x442876){return _0x28ff90['sendStatus'](_0x450ab6);}return _0x28ff90['status'](_0x450ab6)[_0xce95('0x16')]();};}function respondWithResult(_0x1774a8,_0x5986a0){_0x5986a0=_0x5986a0||0xc8;return function(_0x4cd894){if(_0x4cd894){return _0x1774a8[_0xce95('0x17')](_0x5986a0)['json'](_0x4cd894);}};}function respondWithFilteredResult(_0xf98083,_0x5ccedd){return function(_0x23acca){if(_0x23acca){var _0x115bcb=_0x23acca['count'],_0x436598=_0x5ccedd['offset'],_0xba1f90=_0x5ccedd[_0xce95('0x18')]+_0x5ccedd[_0xce95('0x19')],_0x3083e0;if(_0xba1f90>=_0x115bcb){_0xba1f90=_0x115bcb;_0x3083e0=0xc8;}else{_0x3083e0=0xce;}_0xf98083[_0xce95('0x17')](_0x3083e0);return _0xf98083[_0xce95('0x1a')]('Content-Range',_0x436598+'-'+_0xba1f90+'/'+_0x115bcb)[_0xce95('0x1b')](_0x23acca);}return null;};}function patchUpdates(_0x1309cc){return function(_0x15a379){try{jsonpatch['apply'](_0x15a379,_0x1309cc,!![]);}catch(_0x4254c7){return BPromise['reject'](_0x4254c7);}return _0x15a379[_0xce95('0x1c')]();};}function saveUpdates(_0x377067,_0x22a3e2){return function(_0x40d89b){if(_0x40d89b){return _0x40d89b[_0xce95('0x1d')](_0x377067)[_0xce95('0x1e')](function(_0x1eb7e3){return _0x1eb7e3;});}return null;};}function removeEntity(_0x48adeb,_0x139a35){return function(_0x44a2da){if(_0x44a2da){return _0x44a2da[_0xce95('0x1f')]()[_0xce95('0x1e')](function(){_0x48adeb[_0xce95('0x17')](0xcc)[_0xce95('0x16')]();});}};}function handleEntityNotFound(_0x57700b,_0xa39a7d){return function(_0x204615){if(!_0x204615){_0x57700b[_0xce95('0x20')](0x194);}return _0x204615;};}function handleError(_0x4fcca9,_0x5a62a4){_0x5a62a4=_0x5a62a4||0x1f4;return function(_0xf0b3ba){logger[_0xce95('0x21')](_0xf0b3ba['stack']);if(_0xf0b3ba['name']){delete _0xf0b3ba[_0xce95('0x22')];}_0x4fcca9['status'](_0x5a62a4)[_0xce95('0x23')](_0xf0b3ba);};}exports['index']=function(_0x63deaf,_0x1a0194){var _0x55164c={},_0x4d7468={},_0x13067e={'count':0x0,'rows':[]};var _0x131b08=_[_0xce95('0x24')](db['SquareDetailsReport'][_0xce95('0x25')],function(_0x163681){return{'name':_0x163681[_0xce95('0x26')],'type':_0x163681[_0xce95('0x27')]['key']};});_0x4d7468[_0xce95('0x28')]=_['map'](_0x131b08,_0xce95('0x22'));_0x4d7468[_0xce95('0x29')]=_[_0xce95('0x2a')](_0x63deaf[_0xce95('0x29')]);_0x4d7468[_0xce95('0x2b')]=_[_0xce95('0x2c')](_0x4d7468[_0xce95('0x28')],_0x4d7468[_0xce95('0x29')]);_0x55164c[_0xce95('0x2d')]=_['intersection'](_0x4d7468[_0xce95('0x28')],qs[_0xce95('0x2e')](_0x63deaf[_0xce95('0x29')][_0xce95('0x2e')]));_0x55164c[_0xce95('0x2d')]=_0x55164c['attributes'][_0xce95('0x2f')]?_0x55164c[_0xce95('0x2d')]:_0x4d7468[_0xce95('0x28')];if(!_0x63deaf[_0xce95('0x29')]['hasOwnProperty'](_0xce95('0x30'))){_0x55164c['limit']=qs['limit'](_0x63deaf[_0xce95('0x29')]['limit']);_0x55164c[_0xce95('0x18')]=qs[_0xce95('0x18')](_0x63deaf['query']['offset']);}_0x55164c[_0xce95('0x31')]=qs['sort'](_0x63deaf[_0xce95('0x29')]['sort']);_0x55164c[_0xce95('0x32')]=qs[_0xce95('0x2b')](_[_0xce95('0x33')](_0x63deaf[_0xce95('0x29')],_0x4d7468['filters']),_0x131b08);if(_0x63deaf[_0xce95('0x29')][_0xce95('0x34')]){_0x55164c[_0xce95('0x32')]=_[_0xce95('0x35')](_0x55164c['where'],{'$or':_[_0xce95('0x24')](_0x131b08,function(_0x1b6bc0){if(_0x1b6bc0[_0xce95('0x27')]!==_0xce95('0x36')){var _0x30a5a1={};_0x30a5a1[_0x1b6bc0[_0xce95('0x22')]]={'$like':'%'+_0x63deaf[_0xce95('0x29')]['filter']+'%'};return _0x30a5a1;}})});}_0x55164c=_[_0xce95('0x35')]({},_0x55164c,_0x63deaf['options']);var _0x4ae6f7={'where':_0x55164c[_0xce95('0x32')]};return db['SquareDetailsReport']['count'](_0x4ae6f7)[_0xce95('0x1e')](function(_0xfd1b73){_0x13067e[_0xce95('0x37')]=_0xfd1b73;if(_0x63deaf[_0xce95('0x29')][_0xce95('0x38')]){_0x55164c[_0xce95('0x39')]=[{'all':!![]}];}return db[_0xce95('0x3a')][_0xce95('0x3b')](_0x55164c);})[_0xce95('0x1e')](function(_0x1e2d86){_0x13067e[_0xce95('0x3c')]=_0x1e2d86;return _0x13067e;})['then'](respondWithFilteredResult(_0x1a0194,_0x55164c))['catch'](handleError(_0x1a0194,null));};exports[_0xce95('0x3d')]=function(_0x20316c,_0x536d32){var _0x20f02f={'raw':!![],'where':{'id':_0x20316c[_0xce95('0x3e')]['id']}},_0x3fff32={};_0x3fff32[_0xce95('0x28')]=_['keys'](db[_0xce95('0x3a')][_0xce95('0x25')]);_0x3fff32[_0xce95('0x29')]=_[_0xce95('0x2a')](_0x20316c[_0xce95('0x29')]);_0x3fff32['filters']=_[_0xce95('0x2c')](_0x3fff32['model'],_0x3fff32[_0xce95('0x29')]);_0x20f02f[_0xce95('0x2d')]=_['intersection'](_0x3fff32['model'],qs[_0xce95('0x2e')](_0x20316c['query'][_0xce95('0x2e')]));_0x20f02f[_0xce95('0x2d')]=_0x20f02f[_0xce95('0x2d')][_0xce95('0x2f')]?_0x20f02f[_0xce95('0x2d')]:_0x3fff32[_0xce95('0x28')];if(_0x20316c['query'][_0xce95('0x38')]){_0x20f02f[_0xce95('0x39')]=[{'all':!![]}];}_0x20f02f=_[_0xce95('0x35')]({},_0x20f02f,_0x20316c[_0xce95('0x3f')]);return db['SquareDetailsReport']['find'](_0x20f02f)['then'](handleEntityNotFound(_0x536d32,null))[_0xce95('0x1e')](respondWithResult(_0x536d32,null))['catch'](handleError(_0x536d32,null));};exports[_0xce95('0x40')]=function(_0x1e8f1c,_0x5abd56){return db[_0xce95('0x3a')][_0xce95('0x40')](_0x1e8f1c[_0xce95('0x41')],{})['then'](respondWithResult(_0x5abd56,0xc9))[_0xce95('0x42')](handleError(_0x5abd56,null));};exports[_0xce95('0x1d')]=function(_0x13771b,_0x33f6d5){if(_0x13771b[_0xce95('0x41')]['id']){delete _0x13771b[_0xce95('0x41')]['id'];}return db[_0xce95('0x3a')][_0xce95('0x43')]({'where':{'id':_0x13771b[_0xce95('0x3e')]['id']}})[_0xce95('0x1e')](handleEntityNotFound(_0x33f6d5,null))['then'](saveUpdates(_0x13771b[_0xce95('0x41')],null))[_0xce95('0x1e')](respondWithResult(_0x33f6d5,null))[_0xce95('0x42')](handleError(_0x33f6d5,null));};exports[_0xce95('0x1f')]=function(_0x401cef,_0x14aa7c){return db['SquareDetailsReport'][_0xce95('0x43')]({'where':{'id':_0x401cef['params']['id']}})[_0xce95('0x1e')](handleEntityNotFound(_0x14aa7c,null))[_0xce95('0x1e')](removeEntity(_0x14aa7c,null))[_0xce95('0x42')](handleError(_0x14aa7c,null));};exports[_0xce95('0x44')]=function(_0x59af40,_0xc2a2d5){return db['SquareDetailsReport'][_0xce95('0x44')]()[_0xce95('0x1e')](respondWithResult(_0xc2a2d5,null))[_0xce95('0x42')](handleError(_0xc2a2d5,null));}; \ No newline at end of file +var _0xfc9d=['rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','include','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','error','stack','name','send','index','map','SquareDetailsReport'];(function(_0x4f6467,_0x11b602){var _0x4c8330=function(_0x166541){while(--_0x166541){_0x4f6467['push'](_0x4f6467['shift']());}};_0x4c8330(++_0x11b602);}(_0xfc9d,0x67));var _0xdfc9=function(_0x1f336d,_0x5d0bee){_0x1f336d=_0x1f336d-0x0;var _0x49199d=_0xfc9d[_0x1f336d];return _0x49199d;};'use strict';var emlformat=require(_0xdfc9('0x0'));var rimraf=require(_0xdfc9('0x1'));var zipdir=require(_0xdfc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdfc9('0x3'));var moment=require(_0xdfc9('0x4'));var BPromise=require(_0xdfc9('0x5'));var Mustache=require(_0xdfc9('0x6'));var util=require(_0xdfc9('0x7'));var path=require(_0xdfc9('0x8'));var sox=require(_0xdfc9('0x9'));var csv=require(_0xdfc9('0xa'));var ejs=require(_0xdfc9('0xb'));var fs=require('fs');var fs_extra=require(_0xdfc9('0xc'));var _=require('lodash');var squel=require(_0xdfc9('0xd'));var crypto=require('crypto');var jsforce=require(_0xdfc9('0xe'));var deskjs=require(_0xdfc9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdfc9('0x10'));var Papa=require(_0xdfc9('0x11'));var Redis=require(_0xdfc9('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdfc9('0x13'));var hardwareService=require(_0xdfc9('0x14'));var logger=require(_0xdfc9('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xdfc9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdfc9('0x17'))['db'];function respondWithStatusCode(_0x2e3332,_0x133e97){_0x133e97=_0x133e97||0xcc;return function(_0x41b706){if(_0x41b706){return _0x2e3332[_0xdfc9('0x18')](_0x133e97);}return _0x2e3332[_0xdfc9('0x19')](_0x133e97)[_0xdfc9('0x1a')]();};}function respondWithResult(_0x2c3c32,_0x394367){_0x394367=_0x394367||0xc8;return function(_0x3a94f2){if(_0x3a94f2){return _0x2c3c32[_0xdfc9('0x19')](_0x394367)[_0xdfc9('0x1b')](_0x3a94f2);}};}function respondWithFilteredResult(_0x535a66,_0x469c1a){return function(_0x204e25){if(_0x204e25){var _0x86ff2e=_0x204e25[_0xdfc9('0x1c')],_0x40afa5=_0x469c1a['offset'],_0x25813e=_0x469c1a[_0xdfc9('0x1d')]+_0x469c1a[_0xdfc9('0x1e')],_0x14ac8c;if(_0x25813e>=_0x86ff2e){_0x25813e=_0x86ff2e;_0x14ac8c=0xc8;}else{_0x14ac8c=0xce;}_0x535a66['status'](_0x14ac8c);return _0x535a66['set']('Content-Range',_0x40afa5+'-'+_0x25813e+'/'+_0x86ff2e)[_0xdfc9('0x1b')](_0x204e25);}return null;};}function patchUpdates(_0x55e5f1){return function(_0x28ed1f){try{jsonpatch[_0xdfc9('0x1f')](_0x28ed1f,_0x55e5f1,!![]);}catch(_0x26a24b){return BPromise[_0xdfc9('0x20')](_0x26a24b);}return _0x28ed1f[_0xdfc9('0x21')]();};}function saveUpdates(_0x2f7827,_0x4e1984){return function(_0x6caa71){if(_0x6caa71){return _0x6caa71[_0xdfc9('0x22')](_0x2f7827)[_0xdfc9('0x23')](function(_0x2d811e){return _0x2d811e;});}return null;};}function removeEntity(_0x1774a7,_0x3c492c){return function(_0x5b5466){if(_0x5b5466){return _0x5b5466['destroy']()[_0xdfc9('0x23')](function(){_0x1774a7[_0xdfc9('0x19')](0xcc)[_0xdfc9('0x1a')]();});}};}function handleEntityNotFound(_0x5e0831,_0x75dba5){return function(_0xfdd120){if(!_0xfdd120){_0x5e0831[_0xdfc9('0x18')](0x194);}return _0xfdd120;};}function handleError(_0x29d690,_0x411c5c){_0x411c5c=_0x411c5c||0x1f4;return function(_0x4a2a48){logger[_0xdfc9('0x24')](_0x4a2a48[_0xdfc9('0x25')]);if(_0x4a2a48[_0xdfc9('0x26')]){delete _0x4a2a48[_0xdfc9('0x26')];}_0x29d690[_0xdfc9('0x19')](_0x411c5c)[_0xdfc9('0x27')](_0x4a2a48);};}exports[_0xdfc9('0x28')]=function(_0x4f00e0,_0x51cc40){var _0x1e9002={},_0x223ba1={},_0x41d04d={'count':0x0,'rows':[]};var _0x1aaf5b=_[_0xdfc9('0x29')](db[_0xdfc9('0x2a')][_0xdfc9('0x2b')],function(_0x113647){return{'name':_0x113647['fieldName'],'type':_0x113647[_0xdfc9('0x2c')][_0xdfc9('0x2d')]};});_0x223ba1[_0xdfc9('0x2e')]=_[_0xdfc9('0x29')](_0x1aaf5b,_0xdfc9('0x26'));_0x223ba1['query']=_['keys'](_0x4f00e0[_0xdfc9('0x2f')]);_0x223ba1[_0xdfc9('0x30')]=_[_0xdfc9('0x31')](_0x223ba1[_0xdfc9('0x2e')],_0x223ba1[_0xdfc9('0x2f')]);_0x1e9002[_0xdfc9('0x32')]=_[_0xdfc9('0x31')](_0x223ba1[_0xdfc9('0x2e')],qs[_0xdfc9('0x33')](_0x4f00e0[_0xdfc9('0x2f')][_0xdfc9('0x33')]));_0x1e9002[_0xdfc9('0x32')]=_0x1e9002[_0xdfc9('0x32')][_0xdfc9('0x34')]?_0x1e9002['attributes']:_0x223ba1['model'];if(!_0x4f00e0['query'][_0xdfc9('0x35')]('nolimit')){_0x1e9002[_0xdfc9('0x1e')]=qs[_0xdfc9('0x1e')](_0x4f00e0['query'][_0xdfc9('0x1e')]);_0x1e9002[_0xdfc9('0x1d')]=qs['offset'](_0x4f00e0[_0xdfc9('0x2f')][_0xdfc9('0x1d')]);}_0x1e9002[_0xdfc9('0x36')]=qs[_0xdfc9('0x37')](_0x4f00e0[_0xdfc9('0x2f')][_0xdfc9('0x37')]);_0x1e9002[_0xdfc9('0x38')]=qs[_0xdfc9('0x30')](_[_0xdfc9('0x39')](_0x4f00e0[_0xdfc9('0x2f')],_0x223ba1[_0xdfc9('0x30')]),_0x1aaf5b);if(_0x4f00e0[_0xdfc9('0x2f')][_0xdfc9('0x3a')]){_0x1e9002[_0xdfc9('0x38')]=_[_0xdfc9('0x3b')](_0x1e9002['where'],{'$or':_[_0xdfc9('0x29')](_0x1aaf5b,function(_0x16a231){if(_0x16a231[_0xdfc9('0x2c')]!==_0xdfc9('0x3c')){var _0x302a64={};_0x302a64[_0x16a231[_0xdfc9('0x26')]]={'$like':'%'+_0x4f00e0[_0xdfc9('0x2f')][_0xdfc9('0x3a')]+'%'};return _0x302a64;}})});}_0x1e9002=_['merge']({},_0x1e9002,_0x4f00e0[_0xdfc9('0x3d')]);var _0x544c6b={'where':_0x1e9002[_0xdfc9('0x38')]};return db[_0xdfc9('0x2a')][_0xdfc9('0x1c')](_0x544c6b)[_0xdfc9('0x23')](function(_0x273aa1){_0x41d04d[_0xdfc9('0x1c')]=_0x273aa1;if(_0x4f00e0[_0xdfc9('0x2f')][_0xdfc9('0x3e')]){_0x1e9002['include']=[{'all':!![]}];}return db[_0xdfc9('0x2a')][_0xdfc9('0x3f')](_0x1e9002);})['then'](function(_0x25824b){_0x41d04d['rows']=_0x25824b;return _0x41d04d;})[_0xdfc9('0x23')](respondWithFilteredResult(_0x51cc40,_0x1e9002))['catch'](handleError(_0x51cc40,null));};exports[_0xdfc9('0x40')]=function(_0x561c26,_0x3e0a70){var _0x2472ff={'raw':!![],'where':{'id':_0x561c26[_0xdfc9('0x41')]['id']}},_0xaf5298={};_0xaf5298[_0xdfc9('0x2e')]=_[_0xdfc9('0x42')](db[_0xdfc9('0x2a')]['rawAttributes']);_0xaf5298[_0xdfc9('0x2f')]=_[_0xdfc9('0x42')](_0x561c26[_0xdfc9('0x2f')]);_0xaf5298['filters']=_[_0xdfc9('0x31')](_0xaf5298[_0xdfc9('0x2e')],_0xaf5298['query']);_0x2472ff['attributes']=_['intersection'](_0xaf5298[_0xdfc9('0x2e')],qs[_0xdfc9('0x33')](_0x561c26[_0xdfc9('0x2f')][_0xdfc9('0x33')]));_0x2472ff[_0xdfc9('0x32')]=_0x2472ff[_0xdfc9('0x32')][_0xdfc9('0x34')]?_0x2472ff[_0xdfc9('0x32')]:_0xaf5298[_0xdfc9('0x2e')];if(_0x561c26[_0xdfc9('0x2f')][_0xdfc9('0x3e')]){_0x2472ff[_0xdfc9('0x43')]=[{'all':!![]}];}_0x2472ff=_[_0xdfc9('0x3b')]({},_0x2472ff,_0x561c26[_0xdfc9('0x3d')]);return db[_0xdfc9('0x2a')]['find'](_0x2472ff)[_0xdfc9('0x23')](handleEntityNotFound(_0x3e0a70,null))[_0xdfc9('0x23')](respondWithResult(_0x3e0a70,null))['catch'](handleError(_0x3e0a70,null));};exports[_0xdfc9('0x44')]=function(_0x3cde24,_0x33a81c){return db[_0xdfc9('0x2a')]['create'](_0x3cde24[_0xdfc9('0x45')],{})['then'](respondWithResult(_0x33a81c,0xc9))[_0xdfc9('0x46')](handleError(_0x33a81c,null));};exports[_0xdfc9('0x22')]=function(_0x33e3e4,_0x40a2d1){if(_0x33e3e4[_0xdfc9('0x45')]['id']){delete _0x33e3e4[_0xdfc9('0x45')]['id'];}return db[_0xdfc9('0x2a')]['find']({'where':{'id':_0x33e3e4[_0xdfc9('0x41')]['id']}})[_0xdfc9('0x23')](handleEntityNotFound(_0x40a2d1,null))[_0xdfc9('0x23')](saveUpdates(_0x33e3e4[_0xdfc9('0x45')],null))[_0xdfc9('0x23')](respondWithResult(_0x40a2d1,null))[_0xdfc9('0x46')](handleError(_0x40a2d1,null));};exports[_0xdfc9('0x47')]=function(_0x5af613,_0x130507){return db[_0xdfc9('0x2a')]['find']({'where':{'id':_0x5af613['params']['id']}})[_0xdfc9('0x23')](handleEntityNotFound(_0x130507,null))['then'](removeEntity(_0x130507,null))[_0xdfc9('0x46')](handleError(_0x130507,null));};exports['describe']=function(_0x1a8fdc,_0x3cd50a){return db[_0xdfc9('0x2a')][_0xdfc9('0x48')]()[_0xdfc9('0x23')](respondWithResult(_0x3cd50a,null))[_0xdfc9('0x46')](handleError(_0x3cd50a,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 3bc19cb..c7c6090 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 _0x1b03=['bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','lodash','util','../../config/logger','api','moment'];(function(_0x42f0d1,_0x45fe4a){var _0x43f981=function(_0x5882e8){while(--_0x5882e8){_0x42f0d1['push'](_0x42f0d1['shift']());}};_0x43f981(++_0x45fe4a);}(_0x1b03,0x191));var _0x31b0=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x1b03[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0x31b0('0x0'));var util=require(_0x31b0('0x1'));var logger=require(_0x31b0('0x2'))(_0x31b0('0x3'));var moment=require(_0x31b0('0x4'));var BPromise=require(_0x31b0('0x5'));var rp=require(_0x31b0('0x6'));var fs=require('fs');var path=require(_0x31b0('0x7'));var rimraf=require(_0x31b0('0x8'));var config=require(_0x31b0('0x9'));var attributes=require(_0x31b0('0xa'));module[_0x31b0('0xb')]=function(_0x1ec049,_0x5ae3fa){return _0x1ec049[_0x31b0('0xc')]('SquareDetailsReport',attributes,{'tableName':_0x31b0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb247=['moment','bluebird','request-promise','rimraf','../../config/environment','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api'];(function(_0x385a40,_0x528256){var _0x5854df=function(_0x5e0b18){while(--_0x5e0b18){_0x385a40['push'](_0x385a40['shift']());}};_0x5854df(++_0x528256);}(_0xb247,0x98));var _0x7b24=function(_0x12e898,_0x1ef073){_0x12e898=_0x12e898-0x0;var _0x190631=_0xb247[_0x12e898];return _0x190631;};'use strict';var _=require(_0x7b24('0x0'));var util=require(_0x7b24('0x1'));var logger=require(_0x7b24('0x2'))(_0x7b24('0x3'));var moment=require(_0x7b24('0x4'));var BPromise=require(_0x7b24('0x5'));var rp=require(_0x7b24('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b24('0x7'));var config=require(_0x7b24('0x8'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x46ab15,_0x4b5626){return _0x46ab15[_0x7b24('0x9')](_0x7b24('0xa'),attributes,{'tableName':_0x7b24('0xb'),'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 47a78c9..12d02a5 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 _0x3dbc=['message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5c3e24,_0x375a27){var _0x2239ed=function(_0x568fc3){while(--_0x568fc3){_0x5c3e24['push'](_0x5c3e24['shift']());}};_0x2239ed(++_0x375a27);}(_0x3dbc,0xf9));var _0xc3db=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3dbc[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xc3db('0x0'));var util=require(_0xc3db('0x1'));var moment=require(_0xc3db('0x2'));var BPromise=require(_0xc3db('0x3'));var rs=require(_0xc3db('0x4'));var fs=require('fs');var Redis=require(_0xc3db('0x5'));var db=require(_0xc3db('0x6'))['db'];var utils=require(_0xc3db('0x7'));var logger=require(_0xc3db('0x8'))(_0xc3db('0x9'));var config=require('../../config/environment');var jayson=require(_0xc3db('0xa'));var client=jayson['client'][_0xc3db('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39bf54,_0x2ac735,_0x19ed05){return new BPromise(function(_0x366f6c,_0x32ee9e){return client[_0xc3db('0xc')](_0x39bf54,_0x19ed05)[_0xc3db('0xd')](function(_0xf106af){logger[_0xc3db('0xe')](_0xc3db('0xf'),_0x2ac735,_0xc3db('0x10'));logger[_0xc3db('0x11')](_0xc3db('0x12'),_0x2ac735,_0xc3db('0x10'),JSON[_0xc3db('0x13')](_0xf106af));if(_0xf106af[_0xc3db('0x14')]){if(_0xf106af['error']['code']===0x1f4){logger[_0xc3db('0x14')](_0xc3db('0xf'),_0x2ac735,_0xf106af[_0xc3db('0x14')]['message']);return _0x32ee9e(_0xf106af[_0xc3db('0x14')][_0xc3db('0x15')]);}logger[_0xc3db('0x14')](_0xc3db('0xf'),_0x2ac735,_0xf106af[_0xc3db('0x14')][_0xc3db('0x15')]);return _0x366f6c(_0xf106af['error'][_0xc3db('0x15')]);}else{logger[_0xc3db('0xe')](_0xc3db('0xf'),_0x2ac735,_0xc3db('0x10'));_0x366f6c(_0xf106af[_0xc3db('0x16')][_0xc3db('0x15')]);}})[_0xc3db('0x17')](function(_0x2d3c16){logger[_0xc3db('0x14')](_0xc3db('0xf'),_0x2ac735,_0x2d3c16);_0x32ee9e(_0x2d3c16);});});}exports[_0xc3db('0x18')]=function(_0x5b4829){var _0x221dce=this;return new Promise(function(_0x4a1972,_0x3cc56c){return db[_0xc3db('0x19')][_0xc3db('0x1a')](_0x5b4829[_0xc3db('0x1b')],{'raw':_0x5b4829['options']?_0x5b4829[_0xc3db('0x1c')][_0xc3db('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x4460dc){logger['info'](_0xc3db('0x18'),_0x5b4829);logger['debug']('CreateSquareDetailsReport',_0x5b4829,JSON[_0xc3db('0x13')](_0x4460dc));_0x4a1972(_0x4460dc);})[_0xc3db('0x17')](function(_0x318ab7){logger[_0xc3db('0x14')](_0xc3db('0x18'),_0x318ab7['message'],_0x5b4829);_0x3cc56c(_0x221dce['error'](0x1f4,_0x318ab7[_0xc3db('0x15')]));});});}; \ No newline at end of file +var _0x323f=['stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x323f,0x1b3));var _0xf323=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x323f[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf323('0x0'));var BPromise=require(_0xf323('0x1'));var rs=require(_0xf323('0x2'));var fs=require('fs');var Redis=require(_0xf323('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf323('0x4'))(_0xf323('0x5'));var config=require(_0xf323('0x6'));var jayson=require(_0xf323('0x7'));var client=jayson[_0xf323('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41b141,_0x73ef2c,_0x2eb595){return new BPromise(function(_0x56f447,_0x1f3417){return client[_0xf323('0x9')](_0x41b141,_0x2eb595)[_0xf323('0xa')](function(_0x3919fd){logger[_0xf323('0xb')](_0xf323('0xc'),_0x73ef2c,_0xf323('0xd'));logger[_0xf323('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x73ef2c,_0xf323('0xd'),JSON[_0xf323('0xf')](_0x3919fd));if(_0x3919fd[_0xf323('0x10')]){if(_0x3919fd['error']['code']===0x1f4){logger['error'](_0xf323('0xc'),_0x73ef2c,_0x3919fd[_0xf323('0x10')][_0xf323('0x11')]);return _0x1f3417(_0x3919fd[_0xf323('0x10')][_0xf323('0x11')]);}logger['error'](_0xf323('0xc'),_0x73ef2c,_0x3919fd[_0xf323('0x10')]['message']);return _0x56f447(_0x3919fd[_0xf323('0x10')][_0xf323('0x11')]);}else{logger[_0xf323('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x73ef2c,_0xf323('0xd'));_0x56f447(_0x3919fd[_0xf323('0x12')][_0xf323('0x11')]);}})[_0xf323('0x13')](function(_0x27d9e0){logger['error'](_0xf323('0xc'),_0x73ef2c,_0x27d9e0);_0x1f3417(_0x27d9e0);});});}exports[_0xf323('0x14')]=function(_0x8acf59){var _0x56bf27=this;return new Promise(function(_0x4b49de,_0x29aef8){return db[_0xf323('0x15')]['create'](_0x8acf59[_0xf323('0x16')],{'raw':_0x8acf59[_0xf323('0x17')]?_0x8acf59[_0xf323('0x17')][_0xf323('0x18')]===undefined?!![]:![]:!![]})[_0xf323('0xa')](function(_0xfd47b6){logger[_0xf323('0xb')](_0xf323('0x14'),_0x8acf59);logger[_0xf323('0xe')]('CreateSquareDetailsReport',_0x8acf59,JSON['stringify'](_0xfd47b6));_0x4b49de(_0xfd47b6);})[_0xf323('0x13')](function(_0x533cf1){logger['error']('CreateSquareDetailsReport',_0x533cf1[_0xf323('0x11')],_0x8acf59);_0x29aef8(_0x56bf27[_0xf323('0x10')](0x1f4,_0x533cf1[_0xf323('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 579d876..a4ab61a 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 _0x25e7=['../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','express','Router'];(function(_0x266666,_0x1b0604){var _0x167232=function(_0xc0b156){while(--_0xc0b156){_0x266666['push'](_0x266666['shift']());}};_0x167232(++_0x1b0604);}(_0x25e7,0x1d6));var _0x725e=function(_0x4d3940,_0x167a82){_0x4d3940=_0x4d3940-0x0;var _0x542862=_0x25e7[_0x4d3940];return _0x542862;};'use strict';var express=require(_0x725e('0x0'));var router=express[_0x725e('0x1')]();var auth=require(_0x725e('0x2'));var controller=require(_0x725e('0x3'));router[_0x725e('0x4')]('/',auth[_0x725e('0x5')](),controller[_0x725e('0x6')]);router[_0x725e('0x4')](_0x725e('0x7'),auth[_0x725e('0x5')](),controller['killProcess']);module['exports']=router; \ No newline at end of file +var _0x9761=['exports','express','Router','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess'];(function(_0x5b825f,_0x3cb8f7){var _0x1826c1=function(_0x2c56aa){while(--_0x2c56aa){_0x5b825f['push'](_0x5b825f['shift']());}};_0x1826c1(++_0x3cb8f7);}(_0x9761,0xd3));var _0x1976=function(_0x24f6a2,_0x3182a6){_0x24f6a2=_0x24f6a2-0x0;var _0x521d7e=_0x9761[_0x24f6a2];return _0x521d7e;};'use strict';var express=require(_0x1976('0x0'));var router=express[_0x1976('0x1')]();var auth=require(_0x1976('0x2'));var controller=require(_0x1976('0x3'));router[_0x1976('0x4')]('/',auth['isAuthenticated'](),controller[_0x1976('0x5')]);router[_0x1976('0x4')](_0x1976('0x6'),auth[_0x1976('0x7')](),controller[_0x1976('0x8')]);module[_0x1976('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 09ae9c6..f3939af 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 _0x047e=['index','getAllData','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','Process\x20with\x20pid\x20%s\x20not\x20found!','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send'];(function(_0x38080e,_0x95512d){var _0x4e4c87=function(_0x2be6b3){while(--_0x2be6b3){_0x38080e['push'](_0x38080e['shift']());}};_0x4e4c87(++_0x95512d);}(_0x047e,0x121));var _0xe047=function(_0x3f6f55,_0x1e25b4){_0x3f6f55=_0x3f6f55-0x0;var _0x272e7c=_0x047e[_0x3f6f55];return _0x272e7c;};'use strict';var info=require(_0xe047('0x0'));var exec=require('child_process')[_0xe047('0x1')];var logger=require(_0xe047('0x2'))(_0xe047('0x3'));var util=require(_0xe047('0x4'));var BPromise=require(_0xe047('0x5'));var _=require('lodash');function handleError(_0x10278a,_0x54f84d,_0x5100a3){_0x54f84d=_0x54f84d||0x1f4;return function(_0x4b7e53){logger[_0xe047('0x6')](_0xe047('0x7'),_0x5100a3,_0x54f84d,util['inspect'](_0x4b7e53,{'showHidden':![],'depth':null}));delete _0x4b7e53[_0xe047('0x8')];_0x10278a[_0xe047('0x9')](_0x54f84d)[_0xe047('0xa')](_0x4b7e53);};}exports[_0xe047('0xb')]=function(_0x2400de,_0x1c9012){return info[_0xe047('0xc')]()['then'](function(_0x4b22cf){return _0x1c9012['status'](0xc8)[_0xe047('0xd')](_0x4b22cf);})[_0xe047('0xe')](function(_0x3aa7a8){return _0x1c9012[_0xe047('0x9')](0x1f4)[_0xe047('0xd')](_0x3aa7a8);});};exports['killProcess']=function(_0x2b177f,_0x141624){var _0x312490=[_0xe047('0xf')];return new BPromise(function(_0x547a82,_0x18e74a){return exec(util['format'](_0xe047('0x10'),_0x2b177f[_0xe047('0x11')][_0xe047('0x12')]),function(_0x1f0389,_0x521361,_0x364517){if(_0x1f0389){return _0x18e74a(_0x1f0389);}return _0x547a82(_0x521361);});})[_0xe047('0x13')](function(_0x6e1c7c){var _0x198dfe=![];var _0x519a87=_0x6e1c7c[_0xe047('0x14')](/\n/);for(var _0x20d24f=0x0,_0x310440=_0x312490['length'];_0x20d24f<_0x310440,_0x198dfe===![];_0x20d24f+=0x1){if(_0x6e1c7c['indexOf'](_0x312490[_0x20d24f])>=0x0){_0x198dfe=!![];}}if(!_0x198dfe){throw new Error(util['format'](_0xe047('0x15'),_0x2b177f['params'][_0xe047('0x12')]));}process['kill'](_0x2b177f[_0xe047('0x11')][_0xe047('0x12')],'SIGINT');return _0x141624[_0xe047('0x9')](0xc8)[_0xe047('0xd')]({'message':util[_0xe047('0x16')](_0xe047('0x17'),_0x2b177f[_0xe047('0x11')][_0xe047('0x12')])});})[_0xe047('0xe')](handleError(_0x141624,null,_0xe047('0x18')));}; \ No newline at end of file +var _0xf898=['api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','index','then','status','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger'];(function(_0x508ae7,_0x47cd6b){var _0x5cdbc9=function(_0x3c65b0){while(--_0x3c65b0){_0x508ae7['push'](_0x508ae7['shift']());}};_0x5cdbc9(++_0x47cd6b);}(_0xf898,0x14d));var _0x8f89=function(_0x9c819b,_0xf167a9){_0x9c819b=_0x9c819b-0x0;var _0x55dca3=_0xf898[_0x9c819b];return _0x55dca3;};'use strict';var info=require(_0x8f89('0x0'));var exec=require(_0x8f89('0x1'))['exec'];var logger=require(_0x8f89('0x2'))(_0x8f89('0x3'));var util=require(_0x8f89('0x4'));var BPromise=require(_0x8f89('0x5'));var _=require('lodash');function handleError(_0x4d283c,_0x4bd395,_0xae7b92){_0x4bd395=_0x4bd395||0x1f4;return function(_0x42a43c){logger[_0x8f89('0x6')](_0x8f89('0x7'),_0xae7b92,_0x4bd395,util[_0x8f89('0x8')](_0x42a43c,{'showHidden':![],'depth':null}));delete _0x42a43c['name'];_0x4d283c['status'](_0x4bd395)['send'](_0x42a43c);};}exports[_0x8f89('0x9')]=function(_0x565972,_0x10a951){return info['getAllData']()[_0x8f89('0xa')](function(_0x551a2d){return _0x10a951[_0x8f89('0xb')](0xc8)[_0x8f89('0xc')](_0x551a2d);})[_0x8f89('0xd')](function(_0x103c9d){return _0x10a951[_0x8f89('0xb')](0x1f4)['json'](_0x103c9d);});};exports['killProcess']=function(_0x20077c,_0x3af05b){var _0x37f6bf=[_0x8f89('0xe')];return new BPromise(function(_0x29d70f,_0x54c97c){return exec(util['format'](_0x8f89('0xf'),_0x20077c[_0x8f89('0x10')][_0x8f89('0x11')]),function(_0x566725,_0x2ca42c,_0x3b732e){if(_0x566725){return _0x54c97c(_0x566725);}return _0x29d70f(_0x2ca42c);});})['then'](function(_0x3fa4fe){var _0x48628d=![];var _0x17581c=_0x3fa4fe[_0x8f89('0x12')](/\n/);for(var _0x3e6214=0x0,_0x45821d=_0x37f6bf[_0x8f89('0x13')];_0x3e6214<_0x45821d,_0x48628d===![];_0x3e6214+=0x1){if(_0x3fa4fe['indexOf'](_0x37f6bf[_0x3e6214])>=0x0){_0x48628d=!![];}}if(!_0x48628d){throw new Error(util[_0x8f89('0x14')](_0x8f89('0x15'),_0x20077c[_0x8f89('0x10')]['pid']));}process[_0x8f89('0x16')](_0x20077c[_0x8f89('0x10')][_0x8f89('0x11')],'SIGINT');return _0x3af05b[_0x8f89('0xb')](0xc8)[_0x8f89('0xc')]({'message':util[_0x8f89('0x14')](_0x8f89('0x17'),_0x20077c['params'][_0x8f89('0x11')])});})[_0x8f89('0xd')](handleError(_0x3af05b,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 0147f1f..085ff3c 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 _0x20ad=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1b0a2e,_0x87952c){var _0x13ebd7=function(_0x4279bc){while(--_0x4279bc){_0x1b0a2e['push'](_0x1b0a2e['shift']());}};_0x13ebd7(++_0x87952c);}(_0x20ad,0x13a));var _0xd20a=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x20ad[_0x18cd5b];return _0x5eaa52;};'use strict';var multer=require(_0xd20a('0x0'));var util=require(_0xd20a('0x1'));var path=require(_0xd20a('0x2'));var timeout=require(_0xd20a('0x3'));var express=require('express');var router=express[_0xd20a('0x4')]();var fs_extra=require(_0xd20a('0x5'));var auth=require(_0xd20a('0x6'));var interaction=require(_0xd20a('0x7'));var config=require(_0xd20a('0x8'));var controller=require(_0xd20a('0x9'));router[_0xd20a('0xa')]('/',auth[_0xd20a('0xb')](),controller[_0xd20a('0xc')]);router['get'](_0xd20a('0xd'),auth[_0xd20a('0xb')](),controller['show']);router[_0xd20a('0xe')]('/',auth[_0xd20a('0xb')](),controller[_0xd20a('0xf')]);router[_0xd20a('0x10')](_0xd20a('0xd'),auth[_0xd20a('0xb')](),controller[_0xd20a('0x11')]);router[_0xd20a('0x12')]('/:id',auth[_0xd20a('0xb')](),controller['destroy']);module[_0xd20a('0x13')]=router; \ No newline at end of file +var _0x3a4d=['delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','show','post','create','put','isAuthenticated'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0x3a4d,0x1e8));var _0xd3a4=function(_0x3edf53,_0xfcd5d){_0x3edf53=_0x3edf53-0x0;var _0x4e7f9e=_0x3a4d[_0x3edf53];return _0x4e7f9e;};'use strict';var multer=require(_0xd3a4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd3a4('0x1'));var express=require(_0xd3a4('0x2'));var router=express[_0xd3a4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd3a4('0x4'));var interaction=require(_0xd3a4('0x5'));var config=require(_0xd3a4('0x6'));var controller=require(_0xd3a4('0x7'));router[_0xd3a4('0x8')]('/',auth['isAuthenticated'](),controller[_0xd3a4('0x9')]);router['get'](_0xd3a4('0xa'),auth['isAuthenticated'](),controller[_0xd3a4('0xb')]);router[_0xd3a4('0xc')]('/',auth['isAuthenticated'](),controller[_0xd3a4('0xd')]);router[_0xd3a4('0xe')](_0xd3a4('0xa'),auth[_0xd3a4('0xf')](),controller['update']);router[_0xd3a4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xd3a4('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 8328dba..a81d9bd 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 _0xda3f=['exports','STRING'];(function(_0x55a7a3,_0x5a4037){var _0x463c82=function(_0x1766f9){while(--_0x1766f9){_0x55a7a3['push'](_0x55a7a3['shift']());}};_0x463c82(++_0x5a4037);}(_0xda3f,0xec));var _0xfda3=function(_0x467d59,_0x339fff){_0x467d59=_0x467d59-0x0;var _0x591192=_0xda3f[_0x467d59];return _0x591192;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'name':{'type':Sequelize[_0xfda3('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xfda3('0x1')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb7e7[_0x38a7ac];return _0x53061a;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index f5c3331..3b01acd 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 _0xa66d=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','destroy','then','get','Tags','UserProfileResource','stack','name','send','index','map','Tag','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0xa66d,0xee));var _0xda66=function(_0xf76425,_0x5ea0e6){_0xf76425=_0xf76425-0x0;var _0x16f287=_0xa66d[_0xf76425];return _0x16f287;};'use strict';var emlformat=require(_0xda66('0x0'));var rimraf=require(_0xda66('0x1'));var zipdir=require(_0xda66('0x2'));var jsonpatch=require(_0xda66('0x3'));var rp=require(_0xda66('0x4'));var moment=require(_0xda66('0x5'));var BPromise=require(_0xda66('0x6'));var Mustache=require(_0xda66('0x7'));var util=require(_0xda66('0x8'));var path=require(_0xda66('0x9'));var sox=require(_0xda66('0xa'));var csv=require(_0xda66('0xb'));var ejs=require(_0xda66('0xc'));var fs=require('fs');var fs_extra=require(_0xda66('0xd'));var _=require(_0xda66('0xe'));var squel=require(_0xda66('0xf'));var crypto=require(_0xda66('0x10'));var jsforce=require(_0xda66('0x11'));var deskjs=require(_0xda66('0x12'));var toCsv=require(_0xda66('0xb'));var querystring=require('querystring');var Papa=require(_0xda66('0x13'));var Redis=require(_0xda66('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xda66('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda66('0x16'))(_0xda66('0x17'));var utils=require('../../config/utils');var config=require(_0xda66('0x18'));var licenseUtil=require(_0xda66('0x19'));var db=require(_0xda66('0x1a'))['db'];function respondWithStatusCode(_0x39bace,_0x26fcf6){_0x26fcf6=_0x26fcf6||0xcc;return function(_0x2fa030){if(_0x2fa030){return _0x39bace[_0xda66('0x1b')](_0x26fcf6);}return _0x39bace[_0xda66('0x1c')](_0x26fcf6)[_0xda66('0x1d')]();};}function respondWithResult(_0x48874b,_0xe300fd){_0xe300fd=_0xe300fd||0xc8;return function(_0x4c496e){if(_0x4c496e){return _0x48874b['status'](_0xe300fd)['json'](_0x4c496e);}};}function respondWithFilteredResult(_0x27c0dd,_0x18367b){return function(_0x2d8843){if(_0x2d8843){var _0x5412ab=_0x2d8843['count'],_0x163569=_0x18367b[_0xda66('0x1e')],_0x434bf1=_0x18367b['offset']+_0x18367b[_0xda66('0x1f')],_0x544c47;if(_0x434bf1>=_0x5412ab){_0x434bf1=_0x5412ab;_0x544c47=0xc8;}else{_0x544c47=0xce;}_0x27c0dd[_0xda66('0x1c')](_0x544c47);return _0x27c0dd[_0xda66('0x20')](_0xda66('0x21'),_0x163569+'-'+_0x434bf1+'/'+_0x5412ab)[_0xda66('0x22')](_0x2d8843);}return null;};}function patchUpdates(_0x812972){return function(_0x2863ed){try{jsonpatch['apply'](_0x2863ed,_0x812972,!![]);}catch(_0x363e0a){return BPromise[_0xda66('0x23')](_0x363e0a);}return _0x2863ed[_0xda66('0x24')]();};}function saveUpdates(_0x23a85e,_0x2b7afd){return function(_0x45a2f5){if(_0x45a2f5){return _0x45a2f5[_0xda66('0x25')](_0x23a85e)['then'](function(_0x5b24f4){return _0x5b24f4;});}return null;};}function removeEntity(_0x5c1def,_0x228efb){return function(_0x4bf037){if(_0x4bf037){return _0x4bf037[_0xda66('0x26')]()[_0xda66('0x27')](function(){var _0x5d3baa=_0x4bf037[_0xda66('0x28')]({'plain':!![]});var _0x3105a7=_0xda66('0x29');return db[_0xda66('0x2a')][_0xda66('0x26')]({'where':{'type':_0x3105a7,'resourceId':_0x5d3baa['id']}})['then'](function(){return _0x4bf037;});})[_0xda66('0x27')](function(){_0x5c1def[_0xda66('0x1c')](0xcc)[_0xda66('0x1d')]();});}};}function handleEntityNotFound(_0xb8d665,_0x219058){return function(_0xcd5760){if(!_0xcd5760){_0xb8d665['sendStatus'](0x194);}return _0xcd5760;};}function handleError(_0x37d13b,_0x337456){_0x337456=_0x337456||0x1f4;return function(_0x4cbe5c){logger['error'](_0x4cbe5c[_0xda66('0x2b')]);if(_0x4cbe5c['name']){delete _0x4cbe5c[_0xda66('0x2c')];}_0x37d13b[_0xda66('0x1c')](_0x337456)[_0xda66('0x2d')](_0x4cbe5c);};}exports[_0xda66('0x2e')]=function(_0x48a614,_0x36fb5a){var _0x41b6dd={},_0x11cc3a={},_0x1b587e={'count':0x0,'rows':[]};var _0x8ac33a=_[_0xda66('0x2f')](db[_0xda66('0x30')]['rawAttributes'],function(_0xff9cd3){return{'name':_0xff9cd3['fieldName'],'type':_0xff9cd3[_0xda66('0x31')][_0xda66('0x32')]};});_0x11cc3a[_0xda66('0x33')]=_[_0xda66('0x2f')](_0x8ac33a,_0xda66('0x2c'));_0x11cc3a[_0xda66('0x34')]=_[_0xda66('0x35')](_0x48a614['query']);_0x11cc3a[_0xda66('0x36')]=_[_0xda66('0x37')](_0x11cc3a['model'],_0x11cc3a[_0xda66('0x34')]);_0x41b6dd[_0xda66('0x38')]=_[_0xda66('0x37')](_0x11cc3a[_0xda66('0x33')],qs[_0xda66('0x39')](_0x48a614[_0xda66('0x34')]['fields']));_0x41b6dd[_0xda66('0x38')]=_0x41b6dd[_0xda66('0x38')]['length']?_0x41b6dd[_0xda66('0x38')]:_0x11cc3a[_0xda66('0x33')];if(!_0x48a614[_0xda66('0x34')][_0xda66('0x3a')](_0xda66('0x3b'))){_0x41b6dd[_0xda66('0x1f')]=qs['limit'](_0x48a614[_0xda66('0x34')][_0xda66('0x1f')]);_0x41b6dd['offset']=qs[_0xda66('0x1e')](_0x48a614[_0xda66('0x34')][_0xda66('0x1e')]);}_0x41b6dd['order']=qs[_0xda66('0x3c')](_0x48a614[_0xda66('0x34')][_0xda66('0x3c')]);_0x41b6dd[_0xda66('0x3d')]=qs[_0xda66('0x36')](_[_0xda66('0x3e')](_0x48a614['query'],_0x11cc3a[_0xda66('0x36')]),_0x8ac33a);if(_0x48a614[_0xda66('0x34')][_0xda66('0x3f')]){_0x41b6dd[_0xda66('0x3d')]=_[_0xda66('0x40')](_0x41b6dd[_0xda66('0x3d')],{'$or':_[_0xda66('0x2f')](_0x8ac33a,function(_0x15cdbe){if(_0x15cdbe[_0xda66('0x31')]!=='VIRTUAL'){var _0x192912={};_0x192912[_0x15cdbe['name']]={'$like':'%'+_0x48a614[_0xda66('0x34')][_0xda66('0x3f')]+'%'};return _0x192912;}})});}_0x41b6dd=_[_0xda66('0x40')]({},_0x41b6dd,_0x48a614[_0xda66('0x41')]);var _0x160a6e={'where':_0x41b6dd['where']};return db[_0xda66('0x30')][_0xda66('0x42')](_0x160a6e)[_0xda66('0x27')](function(_0x42091e){_0x1b587e[_0xda66('0x42')]=_0x42091e;if(_0x48a614[_0xda66('0x34')][_0xda66('0x43')]){_0x41b6dd[_0xda66('0x44')]=[{'all':!![]}];}return db[_0xda66('0x30')][_0xda66('0x45')](_0x41b6dd);})[_0xda66('0x27')](function(_0x27f71d){_0x1b587e[_0xda66('0x46')]=_0x27f71d;return _0x1b587e;})[_0xda66('0x27')](respondWithFilteredResult(_0x36fb5a,_0x41b6dd))[_0xda66('0x47')](handleError(_0x36fb5a,null));};exports['show']=function(_0x3254e7,_0x2ad258){var _0x2e6899={'raw':!![],'where':{'id':_0x3254e7[_0xda66('0x48')]['id']}},_0x45d571={};_0x45d571[_0xda66('0x33')]=_[_0xda66('0x35')](db[_0xda66('0x30')]['rawAttributes']);_0x45d571[_0xda66('0x34')]=_[_0xda66('0x35')](_0x3254e7[_0xda66('0x34')]);_0x45d571[_0xda66('0x36')]=_['intersection'](_0x45d571[_0xda66('0x33')],_0x45d571[_0xda66('0x34')]);_0x2e6899[_0xda66('0x38')]=_[_0xda66('0x37')](_0x45d571['model'],qs[_0xda66('0x39')](_0x3254e7[_0xda66('0x34')][_0xda66('0x39')]));_0x2e6899[_0xda66('0x38')]=_0x2e6899[_0xda66('0x38')][_0xda66('0x49')]?_0x2e6899[_0xda66('0x38')]:_0x45d571['model'];if(_0x3254e7['query'][_0xda66('0x43')]){_0x2e6899[_0xda66('0x44')]=[{'all':!![]}];}_0x2e6899=_[_0xda66('0x40')]({},_0x2e6899,_0x3254e7[_0xda66('0x41')]);return db[_0xda66('0x30')][_0xda66('0x4a')](_0x2e6899)['then'](handleEntityNotFound(_0x2ad258,null))[_0xda66('0x27')](respondWithResult(_0x2ad258,null))['catch'](handleError(_0x2ad258,null));};exports[_0xda66('0x4b')]=function(_0x4e1746,_0x42d25a){return db[_0xda66('0x30')][_0xda66('0x4b')](_0x4e1746[_0xda66('0x4c')],{})['then'](function(_0x31ba7d){var _0x124c74=_0x4e1746[_0xda66('0x4d')][_0xda66('0x28')]({'plain':!![]});if(!_0x124c74)throw new Error(_0xda66('0x4e'));if(_0x124c74['role']==='user'){var _0x47bdda=_0x31ba7d['get']({'plain':!![]});var _0x427b05=_0xda66('0x29');return db[_0xda66('0x4f')][_0xda66('0x4a')]({'where':{'name':_0x427b05,'userProfileId':_0x124c74[_0xda66('0x50')]},'raw':!![]})[_0xda66('0x27')](function(_0x37ccca){if(_0x37ccca&&_0x37ccca[_0xda66('0x51')]===0x0){return db[_0xda66('0x2a')][_0xda66('0x4b')]({'name':_0x47bdda[_0xda66('0x2c')],'resourceId':_0x47bdda['id'],'type':_0x37ccca[_0xda66('0x2c')],'sectionId':_0x37ccca['id']},{})['then'](function(){return _0x31ba7d;});}else{return _0x31ba7d;}})[_0xda66('0x47')](function(_0x1c06a4){logger[_0xda66('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c06a4);throw _0x1c06a4;});}return _0x31ba7d;})[_0xda66('0x27')](respondWithResult(_0x42d25a,0xc9))[_0xda66('0x47')](handleError(_0x42d25a,null));};exports[_0xda66('0x25')]=function(_0x534ab8,_0x49869e){if(_0x534ab8[_0xda66('0x4c')]['id']){delete _0x534ab8['body']['id'];}return db[_0xda66('0x30')][_0xda66('0x4a')]({'where':{'id':_0x534ab8['params']['id']}})[_0xda66('0x27')](handleEntityNotFound(_0x49869e,null))['then'](saveUpdates(_0x534ab8[_0xda66('0x4c')],null))[_0xda66('0x27')](respondWithResult(_0x49869e,null))['catch'](handleError(_0x49869e,null));};exports[_0xda66('0x26')]=function(_0xe5c646,_0x920f67){return db[_0xda66('0x30')]['find']({'where':{'id':_0xe5c646[_0xda66('0x48')]['id']}})[_0xda66('0x27')](handleEntityNotFound(_0x920f67,null))['then'](removeEntity(_0x920f67,null))['catch'](handleError(_0x920f67,null));}; \ No newline at end of file +var _0x0546=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','options','Tag','includeAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x27a5b1,_0x6ca6b8){var _0x3d84a6=function(_0xe1aaee){while(--_0xe1aaee){_0x27a5b1['push'](_0x27a5b1['shift']());}};_0x3d84a6(++_0x6ca6b8);}(_0x0546,0xe5));var _0x6054=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0x0546[_0x4687df];return _0x32eaef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6054('0x0'));var jsonpatch=require(_0x6054('0x1'));var rp=require(_0x6054('0x2'));var moment=require(_0x6054('0x3'));var BPromise=require(_0x6054('0x4'));var Mustache=require(_0x6054('0x5'));var util=require(_0x6054('0x6'));var path=require(_0x6054('0x7'));var sox=require('sox');var csv=require(_0x6054('0x8'));var ejs=require(_0x6054('0x9'));var fs=require('fs');var fs_extra=require(_0x6054('0xa'));var _=require('lodash');var squel=require(_0x6054('0xb'));var crypto=require(_0x6054('0xc'));var jsforce=require(_0x6054('0xd'));var deskjs=require(_0x6054('0xe'));var toCsv=require(_0x6054('0x8'));var querystring=require('querystring');var Papa=require(_0x6054('0xf'));var Redis=require(_0x6054('0x10'));var authService=require(_0x6054('0x11'));var qs=require(_0x6054('0x12'));var as=require(_0x6054('0x13'));var hardwareService=require(_0x6054('0x14'));var logger=require(_0x6054('0x15'))(_0x6054('0x16'));var utils=require(_0x6054('0x17'));var config=require(_0x6054('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6054('0x19'))['db'];function respondWithStatusCode(_0x3f7f25,_0x32904b){_0x32904b=_0x32904b||0xcc;return function(_0x46b095){if(_0x46b095){return _0x3f7f25[_0x6054('0x1a')](_0x32904b);}return _0x3f7f25[_0x6054('0x1b')](_0x32904b)[_0x6054('0x1c')]();};}function respondWithResult(_0x42c4af,_0x4d1499){_0x4d1499=_0x4d1499||0xc8;return function(_0x109746){if(_0x109746){return _0x42c4af['status'](_0x4d1499)['json'](_0x109746);}};}function respondWithFilteredResult(_0x1c787d,_0x567ddb){return function(_0xa7401e){if(_0xa7401e){var _0x359cff=_0xa7401e[_0x6054('0x1d')],_0xf41a89=_0x567ddb[_0x6054('0x1e')],_0x3bbcba=_0x567ddb['offset']+_0x567ddb[_0x6054('0x1f')],_0x50c6e3;if(_0x3bbcba>=_0x359cff){_0x3bbcba=_0x359cff;_0x50c6e3=0xc8;}else{_0x50c6e3=0xce;}_0x1c787d[_0x6054('0x1b')](_0x50c6e3);return _0x1c787d[_0x6054('0x20')](_0x6054('0x21'),_0xf41a89+'-'+_0x3bbcba+'/'+_0x359cff)['json'](_0xa7401e);}return null;};}function patchUpdates(_0x4228ad){return function(_0x19e307){try{jsonpatch[_0x6054('0x22')](_0x19e307,_0x4228ad,!![]);}catch(_0x36f1d4){return BPromise[_0x6054('0x23')](_0x36f1d4);}return _0x19e307[_0x6054('0x24')]();};}function saveUpdates(_0xaf366d,_0x4fb557){return function(_0xe58307){if(_0xe58307){return _0xe58307[_0x6054('0x25')](_0xaf366d)[_0x6054('0x26')](function(_0x192679){return _0x192679;});}return null;};}function removeEntity(_0x3f5157,_0x8dd7ca){return function(_0x58f0e9){if(_0x58f0e9){return _0x58f0e9[_0x6054('0x27')]()[_0x6054('0x26')](function(){var _0x580f9d=_0x58f0e9[_0x6054('0x28')]({'plain':!![]});var _0x3e6095=_0x6054('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x3e6095,'resourceId':_0x580f9d['id']}})['then'](function(){return _0x58f0e9;});})[_0x6054('0x26')](function(){_0x3f5157[_0x6054('0x1b')](0xcc)[_0x6054('0x1c')]();});}};}function handleEntityNotFound(_0x4cfdfb,_0x14d705){return function(_0x4f1a0d){if(!_0x4f1a0d){_0x4cfdfb[_0x6054('0x1a')](0x194);}return _0x4f1a0d;};}function handleError(_0x4a0192,_0xd6cc56){_0xd6cc56=_0xd6cc56||0x1f4;return function(_0x3ad991){logger['error'](_0x3ad991[_0x6054('0x2a')]);if(_0x3ad991[_0x6054('0x2b')]){delete _0x3ad991['name'];}_0x4a0192[_0x6054('0x1b')](_0xd6cc56)[_0x6054('0x2c')](_0x3ad991);};}exports[_0x6054('0x2d')]=function(_0x1253c5,_0x58631f){var _0x43abf4={},_0x21ebd8={},_0x5c56b4={'count':0x0,'rows':[]};var _0x38b60b=_[_0x6054('0x2e')](db['Tag'][_0x6054('0x2f')],function(_0x3b1782){return{'name':_0x3b1782['fieldName'],'type':_0x3b1782[_0x6054('0x30')][_0x6054('0x31')]};});_0x21ebd8[_0x6054('0x32')]=_[_0x6054('0x2e')](_0x38b60b,'name');_0x21ebd8[_0x6054('0x33')]=_[_0x6054('0x34')](_0x1253c5['query']);_0x21ebd8[_0x6054('0x35')]=_[_0x6054('0x36')](_0x21ebd8[_0x6054('0x32')],_0x21ebd8[_0x6054('0x33')]);_0x43abf4[_0x6054('0x37')]=_[_0x6054('0x36')](_0x21ebd8[_0x6054('0x32')],qs[_0x6054('0x38')](_0x1253c5[_0x6054('0x33')]['fields']));_0x43abf4[_0x6054('0x37')]=_0x43abf4[_0x6054('0x37')][_0x6054('0x39')]?_0x43abf4[_0x6054('0x37')]:_0x21ebd8[_0x6054('0x32')];if(!_0x1253c5[_0x6054('0x33')]['hasOwnProperty'](_0x6054('0x3a'))){_0x43abf4['limit']=qs[_0x6054('0x1f')](_0x1253c5[_0x6054('0x33')]['limit']);_0x43abf4['offset']=qs['offset'](_0x1253c5[_0x6054('0x33')][_0x6054('0x1e')]);}_0x43abf4[_0x6054('0x3b')]=qs[_0x6054('0x3c')](_0x1253c5[_0x6054('0x33')][_0x6054('0x3c')]);_0x43abf4[_0x6054('0x3d')]=qs[_0x6054('0x35')](_[_0x6054('0x3e')](_0x1253c5[_0x6054('0x33')],_0x21ebd8[_0x6054('0x35')]),_0x38b60b);if(_0x1253c5[_0x6054('0x33')]['filter']){_0x43abf4[_0x6054('0x3d')]=_[_0x6054('0x3f')](_0x43abf4[_0x6054('0x3d')],{'$or':_['map'](_0x38b60b,function(_0x34b586){if(_0x34b586['type']!=='VIRTUAL'){var _0x26ca94={};_0x26ca94[_0x34b586[_0x6054('0x2b')]]={'$like':'%'+_0x1253c5[_0x6054('0x33')]['filter']+'%'};return _0x26ca94;}})});}_0x43abf4=_[_0x6054('0x3f')]({},_0x43abf4,_0x1253c5[_0x6054('0x40')]);var _0x3ce683={'where':_0x43abf4[_0x6054('0x3d')]};return db[_0x6054('0x41')][_0x6054('0x1d')](_0x3ce683)['then'](function(_0x1edc58){_0x5c56b4['count']=_0x1edc58;if(_0x1253c5[_0x6054('0x33')][_0x6054('0x42')]){_0x43abf4['include']=[{'all':!![]}];}return db[_0x6054('0x41')]['findAll'](_0x43abf4);})[_0x6054('0x26')](function(_0x4a5341){_0x5c56b4[_0x6054('0x43')]=_0x4a5341;return _0x5c56b4;})[_0x6054('0x26')](respondWithFilteredResult(_0x58631f,_0x43abf4))[_0x6054('0x44')](handleError(_0x58631f,null));};exports[_0x6054('0x45')]=function(_0x4e2501,_0x4e62b1){var _0x37d82f={'raw':!![],'where':{'id':_0x4e2501[_0x6054('0x46')]['id']}},_0x1fca57={};_0x1fca57[_0x6054('0x32')]=_['keys'](db[_0x6054('0x41')][_0x6054('0x2f')]);_0x1fca57[_0x6054('0x33')]=_['keys'](_0x4e2501[_0x6054('0x33')]);_0x1fca57['filters']=_[_0x6054('0x36')](_0x1fca57[_0x6054('0x32')],_0x1fca57[_0x6054('0x33')]);_0x37d82f['attributes']=_[_0x6054('0x36')](_0x1fca57['model'],qs['fields'](_0x4e2501[_0x6054('0x33')][_0x6054('0x38')]));_0x37d82f['attributes']=_0x37d82f['attributes']['length']?_0x37d82f[_0x6054('0x37')]:_0x1fca57[_0x6054('0x32')];if(_0x4e2501[_0x6054('0x33')][_0x6054('0x42')]){_0x37d82f['include']=[{'all':!![]}];}_0x37d82f=_['merge']({},_0x37d82f,_0x4e2501[_0x6054('0x40')]);return db['Tag'][_0x6054('0x47')](_0x37d82f)[_0x6054('0x26')](handleEntityNotFound(_0x4e62b1,null))[_0x6054('0x26')](respondWithResult(_0x4e62b1,null))[_0x6054('0x44')](handleError(_0x4e62b1,null));};exports[_0x6054('0x48')]=function(_0x2ac498,_0x72406a){return db[_0x6054('0x41')][_0x6054('0x48')](_0x2ac498[_0x6054('0x49')],{})[_0x6054('0x26')](function(_0x564db9){var _0x3bc66a=_0x2ac498[_0x6054('0x4a')][_0x6054('0x28')]({'plain':!![]});if(!_0x3bc66a)throw new Error(_0x6054('0x4b'));if(_0x3bc66a[_0x6054('0x4c')]===_0x6054('0x4a')){var _0x1d12c6=_0x564db9[_0x6054('0x28')]({'plain':!![]});var _0x551e3f=_0x6054('0x29');return db['UserProfileSection'][_0x6054('0x47')]({'where':{'name':_0x551e3f,'userProfileId':_0x3bc66a[_0x6054('0x4d')]},'raw':!![]})['then'](function(_0x979a1d){if(_0x979a1d&&_0x979a1d[_0x6054('0x4e')]===0x0){return db[_0x6054('0x4f')][_0x6054('0x48')]({'name':_0x1d12c6[_0x6054('0x2b')],'resourceId':_0x1d12c6['id'],'type':_0x979a1d[_0x6054('0x2b')],'sectionId':_0x979a1d['id']},{})[_0x6054('0x26')](function(){return _0x564db9;});}else{return _0x564db9;}})[_0x6054('0x44')](function(_0x1d6182){logger[_0x6054('0x50')](_0x6054('0x51'),_0x1d6182);throw _0x1d6182;});}return _0x564db9;})['then'](respondWithResult(_0x72406a,0xc9))['catch'](handleError(_0x72406a,null));};exports[_0x6054('0x25')]=function(_0x1f965b,_0x4d8abb){if(_0x1f965b[_0x6054('0x49')]['id']){delete _0x1f965b[_0x6054('0x49')]['id'];}return db[_0x6054('0x41')][_0x6054('0x47')]({'where':{'id':_0x1f965b[_0x6054('0x46')]['id']}})[_0x6054('0x26')](handleEntityNotFound(_0x4d8abb,null))[_0x6054('0x26')](saveUpdates(_0x1f965b['body'],null))['then'](respondWithResult(_0x4d8abb,null))['catch'](handleError(_0x4d8abb,null));};exports[_0x6054('0x27')]=function(_0x5455ab,_0x484d36){return db['Tag'][_0x6054('0x47')]({'where':{'id':_0x5455ab[_0x6054('0x46')]['id']}})['then'](handleEntityNotFound(_0x484d36,null))[_0x6054('0x26')](removeEntity(_0x484d36,null))[_0x6054('0x44')](handleError(_0x484d36,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index a29fa5c..d2acff7 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 _0xac99=['./tag.attributes','exports','Tag','tools_tags','lodash','util','../../config/logger','api','bluebird','../../config/environment'];(function(_0x23a12d,_0x4171f2){var _0x136b63=function(_0x5292f6){while(--_0x5292f6){_0x23a12d['push'](_0x23a12d['shift']());}};_0x136b63(++_0x4171f2);}(_0xac99,0x108));var _0x9ac9=function(_0x25dd3b,_0x27e043){_0x25dd3b=_0x25dd3b-0x0;var _0x3084aa=_0xac99[_0x25dd3b];return _0x3084aa;};'use strict';var _=require(_0x9ac9('0x0'));var util=require(_0x9ac9('0x1'));var logger=require(_0x9ac9('0x2'))(_0x9ac9('0x3'));var moment=require('moment');var BPromise=require(_0x9ac9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ac9('0x5'));var attributes=require(_0x9ac9('0x6'));module[_0x9ac9('0x7')]=function(_0x51cc3c,_0x51b31e){return _0x51cc3c['define'](_0x9ac9('0x8'),attributes,{'tableName':_0x9ac9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ebb=['path','rimraf','../../config/environment','exports','Tag','tools_tags','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x9ebb,0x11a));var _0xb9eb=function(_0x3c5f36,_0x4e22a0){_0x3c5f36=_0x3c5f36-0x0;var _0x407a54=_0x9ebb[_0x3c5f36];return _0x407a54;};'use strict';var _=require(_0xb9eb('0x0'));var util=require('util');var logger=require(_0xb9eb('0x1'))(_0xb9eb('0x2'));var moment=require(_0xb9eb('0x3'));var BPromise=require(_0xb9eb('0x4'));var rp=require(_0xb9eb('0x5'));var fs=require('fs');var path=require(_0xb9eb('0x6'));var rimraf=require(_0xb9eb('0x7'));var config=require(_0xb9eb('0x8'));var attributes=require('./tag.attributes');module[_0xb9eb('0x9')]=function(_0x2685e4,_0x154812){return _0x2685e4['define'](_0xb9eb('0xa'),attributes,{'tableName':_0xb9eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 7e83b53..d848e57 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 _0xb58b=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird'];(function(_0x8af9cd,_0x5c5942){var _0x5282bb=function(_0x2f1b99){while(--_0x2f1b99){_0x8af9cd['push'](_0x8af9cd['shift']());}};_0x5282bb(++_0x5c5942);}(_0xb58b,0x1f1));var _0xbb58=function(_0x2405de,_0x548637){_0x2405de=_0x2405de-0x0;var _0xeadb6e=_0xb58b[_0x2405de];return _0xeadb6e;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var moment=require(_0xbb58('0x1'));var BPromise=require(_0xbb58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb58('0x3'));var db=require(_0xbb58('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb58('0x5'))('rpc');var config=require(_0xbb58('0x6'));var jayson=require(_0xbb58('0x7'));var client=jayson[_0xbb58('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27cbda,_0x323066,_0xe874f2){return new BPromise(function(_0x5d7fe8,_0xd94f1){return client[_0xbb58('0x9')](_0x27cbda,_0xe874f2)[_0xbb58('0xa')](function(_0x36ca50){logger[_0xbb58('0xb')](_0xbb58('0xc'),_0x323066,_0xbb58('0xd'));logger['debug'](_0xbb58('0xe'),_0x323066,'request\x20sent',JSON[_0xbb58('0xf')](_0x36ca50));if(_0x36ca50[_0xbb58('0x10')]){if(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x11')]===0x1f4){logger['error'](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0xd94f1(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}logger[_0xbb58('0x10')](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0x5d7fe8(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}else{logger['info']('Tag,\x20%s,\x20%s',_0x323066,_0xbb58('0xd'));_0x5d7fe8(_0x36ca50[_0xbb58('0x13')][_0xbb58('0x12')]);}})['catch'](function(_0x5edc97){logger['error']('Tag,\x20%s,\x20%s',_0x323066,_0x5edc97);_0xd94f1(_0x5edc97);});});} \ No newline at end of file +var _0x702d=['stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x8e971e,_0xd060a7){var _0x52228c=function(_0x2123a4){while(--_0x2123a4){_0x8e971e['push'](_0x8e971e['shift']());}};_0x52228c(++_0xd060a7);}(_0x702d,0x147));var _0xd702=function(_0x46046c,_0x5269fd){_0x46046c=_0x46046c-0x0;var _0x71b9bc=_0x702d[_0x46046c];return _0x71b9bc;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var moment=require(_0xd702('0x2'));var BPromise=require(_0xd702('0x3'));var rs=require(_0xd702('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd702('0x5'))['db'];var utils=require(_0xd702('0x6'));var logger=require(_0xd702('0x7'))(_0xd702('0x8'));var config=require('../../config/environment');var jayson=require(_0xd702('0x9'));var client=jayson['client'][_0xd702('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2c03,_0xf4bf4f,_0x5af246){return new BPromise(function(_0x12bb75,_0x53bd02){return client[_0xd702('0xb')](_0x3a2c03,_0x5af246)[_0xd702('0xc')](function(_0x907a9f){logger[_0xd702('0xd')](_0xd702('0xe'),_0xf4bf4f,_0xd702('0xf'));logger[_0xd702('0x10')](_0xd702('0x11'),_0xf4bf4f,_0xd702('0xf'),JSON[_0xd702('0x12')](_0x907a9f));if(_0x907a9f['error']){if(_0x907a9f['error'][_0xd702('0x13')]===0x1f4){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f['error'][_0xd702('0x15')]);return _0x53bd02(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f[_0xd702('0x14')]['message']);return _0x12bb75(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}else{logger['info'](_0xd702('0xe'),_0xf4bf4f,'request\x20sent');_0x12bb75(_0x907a9f[_0xd702('0x16')][_0xd702('0x15')]);}})['catch'](function(_0x2ba791){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x2ba791);_0x53bd02(_0x2ba791);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 2332e12..250bc21 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 _0x61e6=['../../config/environment','./team.controller','get','isAuthenticated','index','/:id','show','/:id/queues','getQueues','getAgents','create','addQueues','/:id/users','addAgents','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x61e6,0xea));var _0x661e=function(_0x427a64,_0x2a621e){_0x427a64=_0x427a64-0x0;var _0x33e904=_0x61e6[_0x427a64];return _0x33e904;};'use strict';var multer=require(_0x661e('0x0'));var util=require('util');var path=require(_0x661e('0x1'));var timeout=require(_0x661e('0x2'));var express=require(_0x661e('0x3'));var router=express['Router']();var fs_extra=require(_0x661e('0x4'));var auth=require(_0x661e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x661e('0x6'));var controller=require(_0x661e('0x7'));router[_0x661e('0x8')]('/',auth[_0x661e('0x9')](),controller[_0x661e('0xa')]);router[_0x661e('0x8')](_0x661e('0xb'),auth[_0x661e('0x9')](),controller[_0x661e('0xc')]);router[_0x661e('0x8')](_0x661e('0xd'),auth[_0x661e('0x9')](),controller[_0x661e('0xe')]);router[_0x661e('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x661e('0xf')]);router['post']('/',auth[_0x661e('0x9')](),controller[_0x661e('0x10')]);router['post'](_0x661e('0xd'),auth[_0x661e('0x9')](),controller[_0x661e('0x11')]);router['post'](_0x661e('0x12'),auth[_0x661e('0x9')](),controller[_0x661e('0x13')]);router[_0x661e('0x14')](_0x661e('0xb'),auth[_0x661e('0x9')](),controller['update']);router[_0x661e('0x15')](_0x661e('0xb'),auth[_0x661e('0x9')](),controller[_0x661e('0x16')]);router[_0x661e('0x15')](_0x661e('0xd'),auth[_0x661e('0x9')](),controller['removeQueues']);router[_0x661e('0x15')](_0x661e('0x12'),auth[_0x661e('0x9')](),controller['removeAgents']);module[_0x661e('0x17')]=router; \ No newline at end of file +var _0xd69e=['update','delete','destroy','removeQueues','removeAgents','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./team.controller','get','isAuthenticated','/:id','show','getQueues','getAgents','post','create','/:id/queues','addQueues','/:id/users','put'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xd69e,0x163));var _0xed69=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd69e[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xed69('0x0'));var util=require('util');var path=require(_0xed69('0x1'));var timeout=require(_0xed69('0x2'));var express=require(_0xed69('0x3'));var router=express['Router']();var fs_extra=require(_0xed69('0x4'));var auth=require(_0xed69('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed69('0x6'));var controller=require(_0xed69('0x7'));router[_0xed69('0x8')]('/',auth[_0xed69('0x9')](),controller['index']);router[_0xed69('0x8')](_0xed69('0xa'),auth['isAuthenticated'](),controller[_0xed69('0xb')]);router[_0xed69('0x8')]('/:id/queues',auth[_0xed69('0x9')](),controller[_0xed69('0xc')]);router['get']('/:id/users',auth[_0xed69('0x9')](),controller[_0xed69('0xd')]);router[_0xed69('0xe')]('/',auth[_0xed69('0x9')](),controller[_0xed69('0xf')]);router[_0xed69('0xe')](_0xed69('0x10'),auth[_0xed69('0x9')](),controller[_0xed69('0x11')]);router[_0xed69('0xe')](_0xed69('0x12'),auth[_0xed69('0x9')](),controller['addAgents']);router[_0xed69('0x13')](_0xed69('0xa'),auth[_0xed69('0x9')](),controller[_0xed69('0x14')]);router[_0xed69('0x15')](_0xed69('0xa'),auth['isAuthenticated'](),controller[_0xed69('0x16')]);router['delete'](_0xed69('0x10'),auth['isAuthenticated'](),controller[_0xed69('0x17')]);router[_0xed69('0x15')](_0xed69('0x12'),auth[_0xed69('0x9')](),controller[_0xed69('0x18')]);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 64d9fd9..2ccf7e6 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 _0x21fa=['STRING','name','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x21fa,0x8e));var _0xa21f=function(_0x4d24d5,_0x5147a8){_0x4d24d5=_0x4d24d5-0x0;var _0x297953=_0x21fa[_0x4d24d5];return _0x297953;};'use strict';var Sequelize=require(_0xa21f('0x0'));module[_0xa21f('0x1')]={'name':{'type':Sequelize[_0xa21f('0x2')],'allowNull':![],'unique':_0xa21f('0x3')},'description':{'type':Sequelize[_0xa21f('0x2')]}}; \ No newline at end of file +var _0x0aed=['sequelize','STRING'];(function(_0xe83ac5,_0x279b67){var _0x3df16e=function(_0x5a1577){while(--_0x5a1577){_0xe83ac5['push'](_0xe83ac5['shift']());}};_0x3df16e(++_0x279b67);}(_0x0aed,0x14c));var _0xd0ae=function(_0x348fec,_0x486f87){_0x348fec=_0x348fec-0x0;var _0x5914c7=_0x0aed[_0x348fec];return _0x5914c7;};'use strict';var Sequelize=require(_0xd0ae('0x0'));module['exports']={'name':{'type':Sequelize[_0xd0ae('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0xd0ae('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 8a0b9b8..bd93508 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 _0x1e1c=['QueueId','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','TeamVoiceQueue','all','spread','removeAgents','parse','Queue:remove','getAgents','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','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','./team.socket','register','sendStatus','status','end','limit','json','apply','reject','save','update','then','UserProfileResource','destroy','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','channel','ValidationError','toLowerCase','Queue','capitalize','Queues','addQueues','isValidChannel','Sequelize','Unknown\x20channel','add','removeQueues','findOne','remove','ids','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','penalty'];(function(_0x221ba2,_0x79208){var _0x47d08e=function(_0xaf14ee){while(--_0xaf14ee){_0x221ba2['push'](_0x221ba2['shift']());}};_0x47d08e(++_0x79208);}(_0x1e1c,0x9b));var _0xc1e1=function(_0x411b40,_0x399dc9){_0x411b40=_0x411b40-0x0;var _0x133bcf=_0x1e1c[_0x411b40];return _0x133bcf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1e1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc1e1('0x1'));var moment=require(_0xc1e1('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc1e1('0x3'));var util=require(_0xc1e1('0x4'));var path=require(_0xc1e1('0x5'));var sox=require(_0xc1e1('0x6'));var csv=require(_0xc1e1('0x7'));var ejs=require(_0xc1e1('0x8'));var fs=require('fs');var fs_extra=require(_0xc1e1('0x9'));var _=require(_0xc1e1('0xa'));var squel=require(_0xc1e1('0xb'));var crypto=require(_0xc1e1('0xc'));var jsforce=require(_0xc1e1('0xd'));var deskjs=require(_0xc1e1('0xe'));var toCsv=require(_0xc1e1('0x7'));var querystring=require(_0xc1e1('0xf'));var Papa=require('papaparse');var Redis=require(_0xc1e1('0x10'));var authService=require(_0xc1e1('0x11'));var qs=require(_0xc1e1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1e1('0x13'));var logger=require(_0xc1e1('0x14'))(_0xc1e1('0x15'));var utils=require(_0xc1e1('0x16'));var config=require(_0xc1e1('0x17'));var licenseUtil=require(_0xc1e1('0x18'));var db=require(_0xc1e1('0x19'))['db'];config[_0xc1e1('0x1a')]=_[_0xc1e1('0x1b')](config[_0xc1e1('0x1a')],{'host':_0xc1e1('0x1c'),'port':0x18eb});var socket=require(_0xc1e1('0x1d'))(new Redis(config[_0xc1e1('0x1a')]));require(_0xc1e1('0x1e'))[_0xc1e1('0x1f')](socket);function respondWithStatusCode(_0x31480e,_0x3de1ce){_0x3de1ce=_0x3de1ce||0xcc;return function(_0x4fe7a4){if(_0x4fe7a4){return _0x31480e[_0xc1e1('0x20')](_0x3de1ce);}return _0x31480e[_0xc1e1('0x21')](_0x3de1ce)[_0xc1e1('0x22')]();};}function respondWithResult(_0x638fc5,_0x3ef07d){_0x3ef07d=_0x3ef07d||0xc8;return function(_0x52d7cb){if(_0x52d7cb){return _0x638fc5['status'](_0x3ef07d)['json'](_0x52d7cb);}};}function respondWithFilteredResult(_0x271566,_0x1ea6f4){return function(_0x1a8ead){if(_0x1a8ead){var _0x37f44d=_0x1a8ead['count'],_0x1f00b9=_0x1ea6f4['offset'],_0xf4290d=_0x1ea6f4['offset']+_0x1ea6f4[_0xc1e1('0x23')],_0x474744;if(_0xf4290d>=_0x37f44d){_0xf4290d=_0x37f44d;_0x474744=0xc8;}else{_0x474744=0xce;}_0x271566[_0xc1e1('0x21')](_0x474744);return _0x271566['set']('Content-Range',_0x1f00b9+'-'+_0xf4290d+'/'+_0x37f44d)[_0xc1e1('0x24')](_0x1a8ead);}return null;};}function patchUpdates(_0x5770cb){return function(_0x7c7a8f){try{jsonpatch[_0xc1e1('0x25')](_0x7c7a8f,_0x5770cb,!![]);}catch(_0x3f5f9d){return BPromise[_0xc1e1('0x26')](_0x3f5f9d);}return _0x7c7a8f[_0xc1e1('0x27')]();};}function saveUpdates(_0x289baf,_0x6fad30){return function(_0x182d69){if(_0x182d69){return _0x182d69[_0xc1e1('0x28')](_0x289baf)[_0xc1e1('0x29')](function(_0xcf3527){return _0xcf3527;});}return null;};}function removeEntity(_0x595f4a,_0x4a9ca2){return function(_0x5bbd4d){if(_0x5bbd4d){return _0x5bbd4d['destroy']()[_0xc1e1('0x29')](function(){var _0x152db6=_0x5bbd4d['get']({'plain':!![]});var _0x4110c5='Teams';return db[_0xc1e1('0x2a')][_0xc1e1('0x2b')]({'where':{'type':_0x4110c5,'resourceId':_0x152db6['id']}})[_0xc1e1('0x29')](function(){return _0x5bbd4d;});})[_0xc1e1('0x29')](function(){_0x595f4a[_0xc1e1('0x21')](0xcc)[_0xc1e1('0x22')]();});}};}function handleEntityNotFound(_0x4d6314,_0x253e60){return function(_0x4874d1){if(!_0x4874d1){_0x4d6314['sendStatus'](0x194);}return _0x4874d1;};}function handleError(_0x42942d,_0x1ea6e1){_0x1ea6e1=_0x1ea6e1||0x1f4;return function(_0xcd8c6){logger[_0xc1e1('0x2c')](_0xcd8c6[_0xc1e1('0x2d')]);if(_0xcd8c6[_0xc1e1('0x2e')]){delete _0xcd8c6[_0xc1e1('0x2e')];}_0x42942d[_0xc1e1('0x21')](_0x1ea6e1)[_0xc1e1('0x2f')](_0xcd8c6);};}exports[_0xc1e1('0x30')]=function(_0x220e78,_0x4e8579){var _0x3e0007={},_0x5e88bf={},_0x191ae8={'count':0x0,'rows':[]};var _0x4dbe71=_[_0xc1e1('0x31')](db[_0xc1e1('0x32')][_0xc1e1('0x33')],function(_0x1ce17d){return{'name':_0x1ce17d[_0xc1e1('0x34')],'type':_0x1ce17d[_0xc1e1('0x35')]['key']};});_0x5e88bf[_0xc1e1('0x36')]=_[_0xc1e1('0x31')](_0x4dbe71,_0xc1e1('0x2e'));_0x5e88bf[_0xc1e1('0x37')]=_[_0xc1e1('0x38')](_0x220e78[_0xc1e1('0x37')]);_0x5e88bf[_0xc1e1('0x39')]=_[_0xc1e1('0x3a')](_0x5e88bf[_0xc1e1('0x36')],_0x5e88bf[_0xc1e1('0x37')]);_0x3e0007[_0xc1e1('0x3b')]=_[_0xc1e1('0x3a')](_0x5e88bf[_0xc1e1('0x36')],qs[_0xc1e1('0x3c')](_0x220e78[_0xc1e1('0x37')][_0xc1e1('0x3c')]));_0x3e0007[_0xc1e1('0x3b')]=_0x3e0007[_0xc1e1('0x3b')][_0xc1e1('0x3d')]?_0x3e0007[_0xc1e1('0x3b')]:_0x5e88bf[_0xc1e1('0x36')];if(!_0x220e78[_0xc1e1('0x37')]['hasOwnProperty'](_0xc1e1('0x3e'))){_0x3e0007['limit']=qs['limit'](_0x220e78[_0xc1e1('0x37')][_0xc1e1('0x23')]);_0x3e0007[_0xc1e1('0x3f')]=qs['offset'](_0x220e78[_0xc1e1('0x37')][_0xc1e1('0x3f')]);}_0x3e0007[_0xc1e1('0x40')]=qs[_0xc1e1('0x41')](_0x220e78[_0xc1e1('0x37')]['sort']);_0x3e0007[_0xc1e1('0x42')]=qs[_0xc1e1('0x39')](_[_0xc1e1('0x43')](_0x220e78[_0xc1e1('0x37')],_0x5e88bf[_0xc1e1('0x39')]),_0x4dbe71);if(_0x220e78['query'][_0xc1e1('0x44')]){_0x3e0007[_0xc1e1('0x42')]=_[_0xc1e1('0x45')](_0x3e0007['where'],{'$or':_['map'](_0x4dbe71,function(_0x227a1b){if(_0x227a1b[_0xc1e1('0x35')]!==_0xc1e1('0x46')){var _0x2a2d17={};_0x2a2d17[_0x227a1b[_0xc1e1('0x2e')]]={'$like':'%'+_0x220e78['query'][_0xc1e1('0x44')]+'%'};return _0x2a2d17;}})});}_0x3e0007=_[_0xc1e1('0x45')]({},_0x3e0007,_0x220e78[_0xc1e1('0x47')]);var _0x249682={'where':_0x3e0007[_0xc1e1('0x42')]};return db[_0xc1e1('0x32')]['count'](_0x249682)[_0xc1e1('0x29')](function(_0x2f08ac){_0x191ae8[_0xc1e1('0x48')]=_0x2f08ac;if(_0x220e78['query']['includeAll']){_0x3e0007[_0xc1e1('0x49')]=[{'all':!![]}];}return db[_0xc1e1('0x32')][_0xc1e1('0x4a')](_0x3e0007);})[_0xc1e1('0x29')](function(_0x483f1d){_0x191ae8[_0xc1e1('0x4b')]=_0x483f1d;return _0x191ae8;})[_0xc1e1('0x29')](respondWithFilteredResult(_0x4e8579,_0x3e0007))[_0xc1e1('0x4c')](handleError(_0x4e8579,null));};exports['show']=function(_0x4c6132,_0x26ca1c){var _0x54a95a={'raw':![],'where':{'id':_0x4c6132['params']['id']}},_0xaf97d0={};_0xaf97d0['model']=_[_0xc1e1('0x38')](db['Team'][_0xc1e1('0x33')]);_0xaf97d0[_0xc1e1('0x37')]=_[_0xc1e1('0x38')](_0x4c6132[_0xc1e1('0x37')]);_0xaf97d0[_0xc1e1('0x39')]=_[_0xc1e1('0x3a')](_0xaf97d0[_0xc1e1('0x36')],_0xaf97d0[_0xc1e1('0x37')]);_0x54a95a[_0xc1e1('0x3b')]=_[_0xc1e1('0x3a')](_0xaf97d0[_0xc1e1('0x36')],qs[_0xc1e1('0x3c')](_0x4c6132['query'][_0xc1e1('0x3c')]));_0x54a95a[_0xc1e1('0x3b')]=_0x54a95a[_0xc1e1('0x3b')]['length']?_0x54a95a[_0xc1e1('0x3b')]:_0xaf97d0[_0xc1e1('0x36')];if(_0x4c6132[_0xc1e1('0x37')][_0xc1e1('0x4d')]){_0x54a95a[_0xc1e1('0x49')]=[{'all':!![]}];}_0x54a95a=_[_0xc1e1('0x45')]({},_0x54a95a,_0x4c6132[_0xc1e1('0x47')]);return db[_0xc1e1('0x32')][_0xc1e1('0x4e')](_0x54a95a)[_0xc1e1('0x29')](handleEntityNotFound(_0x26ca1c,null))['then'](respondWithResult(_0x26ca1c,null))['catch'](handleError(_0x26ca1c,null));};exports[_0xc1e1('0x4f')]=function(_0x6904b1,_0x2ac0f7){return db[_0xc1e1('0x32')][_0xc1e1('0x4f')](_0x6904b1[_0xc1e1('0x50')],{})[_0xc1e1('0x29')](function(_0x51d481){var _0x1496b1=_0x6904b1[_0xc1e1('0x51')][_0xc1e1('0x52')]({'plain':!![]});if(!_0x1496b1)throw new Error(_0xc1e1('0x53'));if(_0x1496b1[_0xc1e1('0x54')]===_0xc1e1('0x51')){var _0x390ebf=_0x51d481['get']({'plain':!![]});var _0x141bf7=_0xc1e1('0x55');return db[_0xc1e1('0x56')]['find']({'where':{'name':_0x141bf7,'userProfileId':_0x1496b1[_0xc1e1('0x57')]},'raw':!![]})['then'](function(_0x398e66){if(_0x398e66&&_0x398e66[_0xc1e1('0x58')]===0x0){return db[_0xc1e1('0x2a')]['create']({'name':_0x390ebf[_0xc1e1('0x2e')],'resourceId':_0x390ebf['id'],'type':_0x398e66['name'],'sectionId':_0x398e66['id']},{})[_0xc1e1('0x29')](function(){return _0x51d481;});}else{return _0x51d481;}})['catch'](function(_0x463821){logger[_0xc1e1('0x2c')](_0xc1e1('0x59'),_0x463821);throw _0x463821;});}return _0x51d481;})['then'](respondWithResult(_0x2ac0f7,0xc9))[_0xc1e1('0x4c')](handleError(_0x2ac0f7,null));};exports['update']=function(_0x44f1b9,_0x1f099e){if(_0x44f1b9['body']['id']){delete _0x44f1b9[_0xc1e1('0x50')]['id'];}return db[_0xc1e1('0x32')][_0xc1e1('0x4e')]({'where':{'id':_0x44f1b9['params']['id']}})[_0xc1e1('0x29')](handleEntityNotFound(_0x1f099e,null))[_0xc1e1('0x29')](saveUpdates(_0x44f1b9[_0xc1e1('0x50')],null))['then'](respondWithResult(_0x1f099e,null))['catch'](handleError(_0x1f099e,null));};exports[_0xc1e1('0x2b')]=function(_0x27ee2f,_0x330aad){return db['Team'][_0xc1e1('0x4e')]({'where':{'id':_0x27ee2f[_0xc1e1('0x5a')]['id']}})[_0xc1e1('0x29')](handleEntityNotFound(_0x330aad,null))[_0xc1e1('0x29')](removeEntity(_0x330aad,null))['catch'](handleError(_0x330aad,null));};exports['getQueues']=function(_0x30bdca,_0x3cfc72,_0x2134cd){return db[_0xc1e1('0x32')]['findOne']({'where':{'id':_0x30bdca['params']['id']}})[_0xc1e1('0x29')](handleEntityNotFound(_0x3cfc72,null))[_0xc1e1('0x29')](function(_0x1f5eb3){if(!_0x30bdca[_0xc1e1('0x37')]['channel']||!utils['isValidChannel'](_0x30bdca[_0xc1e1('0x37')][_0xc1e1('0x5b')])){throw new db['Sequelize'][(_0xc1e1('0x5c'))]('Unknown\x20channel');}var _0x3ba83c={};var _0xa8dbd0={};_0xa8dbd0[_0xc1e1('0x36')]=_[_0xc1e1('0x38')](db[_['capitalize'](_0x30bdca[_0xc1e1('0x37')][_0xc1e1('0x5b')][_0xc1e1('0x5d')]())+_0xc1e1('0x5e')][_0xc1e1('0x33')]);_0xa8dbd0[_0xc1e1('0x37')]=_[_0xc1e1('0x38')](_0x30bdca[_0xc1e1('0x37')]);_0xa8dbd0[_0xc1e1('0x39')]=_[_0xc1e1('0x3a')](_0xa8dbd0['model'],_0xa8dbd0['query']);_0x3ba83c[_0xc1e1('0x3b')]=_[_0xc1e1('0x3a')](_0xa8dbd0['model'],qs['fields'](_0x30bdca[_0xc1e1('0x37')][_0xc1e1('0x3c')]));_0x3ba83c[_0xc1e1('0x3b')]=_0x3ba83c[_0xc1e1('0x3b')][_0xc1e1('0x3d')]?_0x3ba83c[_0xc1e1('0x3b')]:_0xa8dbd0[_0xc1e1('0x36')];_0x3ba83c[_0xc1e1('0x23')]=qs['limit'](_0x30bdca[_0xc1e1('0x37')][_0xc1e1('0x23')]);_0x3ba83c[_0xc1e1('0x3f')]=qs[_0xc1e1('0x3f')](_0x30bdca[_0xc1e1('0x37')][_0xc1e1('0x3f')]);_0x3ba83c['order']=qs[_0xc1e1('0x41')](_0x30bdca[_0xc1e1('0x37')]['sort']);_0x3ba83c['where']=qs[_0xc1e1('0x39')](_[_0xc1e1('0x43')](_0x30bdca[_0xc1e1('0x37')],_0xa8dbd0[_0xc1e1('0x39')]));_0x3ba83c=_[_0xc1e1('0x45')]({},_0x3ba83c,_0x30bdca['options']);return _0x1f5eb3['get'+_[_0xc1e1('0x5f')](_0x30bdca[_0xc1e1('0x37')][_0xc1e1('0x5b')]['toLowerCase']())+_0xc1e1('0x60')](_0x3ba83c);})[_0xc1e1('0x29')](respondWithResult(_0x3cfc72,null))[_0xc1e1('0x4c')](handleError(_0x3cfc72,null));};exports[_0xc1e1('0x61')]=function(_0x1591ef,_0x11ec91,_0x2816c8){return db[_0xc1e1('0x32')]['findOne']({'where':{'id':_0x1591ef[_0xc1e1('0x5a')]['id']}})['then'](function(_0x1d67aa){if(_0x1d67aa){if(!_0x1591ef[_0xc1e1('0x50')][_0xc1e1('0x5b')]||!utils[_0xc1e1('0x62')](_0x1591ef[_0xc1e1('0x50')][_0xc1e1('0x5b')])){throw new db[(_0xc1e1('0x63'))]['ValidationError'](_0xc1e1('0x64'));}return _0x1d67aa[_0xc1e1('0x65')+_['capitalize'](_0x1591ef[_0xc1e1('0x50')][_0xc1e1('0x5b')][_0xc1e1('0x5d')]())+_0xc1e1('0x60')](_0x1591ef['body']['ids']);}return null;})['then'](handleEntityNotFound(_0x11ec91,null))['then'](respondWithStatusCode(_0x11ec91,null))[_0xc1e1('0x4c')](handleError(_0x11ec91,null));};exports[_0xc1e1('0x66')]=function(_0x5497ac,_0x8de9f5,_0x1f5e9d){return db['Team'][_0xc1e1('0x67')]({'where':{'id':_0x5497ac[_0xc1e1('0x5a')]['id']}})[_0xc1e1('0x29')](function(_0x4960bc){if(_0x4960bc){if(!_0x5497ac[_0xc1e1('0x37')][_0xc1e1('0x5b')]||!utils['isValidChannel'](_0x5497ac['query'][_0xc1e1('0x5b')])){throw new db['Sequelize'][(_0xc1e1('0x5c'))]('Unknown\x20channel');}return _0x4960bc[_0xc1e1('0x68')+_['capitalize'](_0x5497ac[_0xc1e1('0x37')]['channel'][_0xc1e1('0x5d')]())+'Queues'](_0x5497ac[_0xc1e1('0x37')][_0xc1e1('0x69')]);}return null;})[_0xc1e1('0x29')](handleEntityNotFound(_0x8de9f5,null))[_0xc1e1('0x29')](respondWithStatusCode(_0x8de9f5,null))[_0xc1e1('0x4c')](handleError(_0x8de9f5,null));};exports[_0xc1e1('0x6a')]=function(_0xcb2a1d,_0x2c5efb){return db[_0xc1e1('0x32')][_0xc1e1('0x4e')]({'where':{'id':_0xcb2a1d[_0xc1e1('0x5a')]['id']}})[_0xc1e1('0x29')](handleEntityNotFound(_0x2c5efb,null))[_0xc1e1('0x29')](function(_0x11272b){if(_0x11272b){var _0x47ca8c=[_0xc1e1('0x6b'),_0xc1e1('0x6c'),_0xc1e1('0x6d'),_0xc1e1('0x6e'),_0xc1e1('0x6f'),_0xc1e1('0x70'),_0xc1e1('0x71')];return db[_0xc1e1('0x72')][_0xc1e1('0x73')](function(_0x3aa5f3){var _0x161c66=_[_0xc1e1('0x31')](_0x47ca8c,function(_0x33d7a8){var _0x3f45ff={'attributes':['id',_0xc1e1('0x2e')]};if(_0x33d7a8===_0xc1e1('0x6b')){_0x3f45ff['through']={'attributes':[_0xc1e1('0x74')]};}return _0x11272b[_0xc1e1('0x52')+_0x33d7a8+_0xc1e1('0x60')](_0x3f45ff)[_0xc1e1('0x29')](function(_0x262101){var _0x2876bd=_[_0xc1e1('0x31')](_0x262101,function(_0x367732){var _0xb0983a=_[_0xc1e1('0x31')](_0xcb2a1d[_0xc1e1('0x50')]['ids'],function(_0x5920b3){var _0x4d81e4={'where':{'UserId':_0x5920b3,[_0x33d7a8+_0xc1e1('0x75')]:_0x367732['id']},'transaction':_0x3aa5f3};if(_0x33d7a8===_0xc1e1('0x6b')){_0x4d81e4[_0xc1e1('0x1b')]={'penalty':_0x367732['TeamVoiceQueue'][_0xc1e1('0x74')]};}return db[_0xc1e1('0x76')+_0x33d7a8+'Queue'][_0xc1e1('0x77')](_0x4d81e4)[_0xc1e1('0x29')](function(){socket[_0xc1e1('0x78')]('user'+_0x33d7a8+_0xc1e1('0x79'),{'UserId':_0x5920b3,[_0x33d7a8+'QueueId']:_0x367732['id']});if(_0x33d7a8!==_0xc1e1('0x6b'))return;return db['User'][_0xc1e1('0x4a')]({'where':{'id':_0xcb2a1d['body']['ids'],'online':0x1},'attributes':['id','name',_0xc1e1('0x7a'),_0xc1e1('0x7b'),_0xc1e1('0x7c')],'raw':!![]})[_0xc1e1('0x29')](function(_0x580f89){var _0x34686a=_[_0xc1e1('0x31')](_0x580f89,function(_0xf03015){return db[_0xc1e1('0x7d')]['upsert']({'membername':_0xf03015[_0xc1e1('0x2e')],'UserId':_0xf03015['id'],'queue_name':_0x367732[_0xc1e1('0x2e')],'VoiceQueueId':_0x367732['id'],'interface':_[_0xc1e1('0x7e')](_0xf03015['interface'])?util[_0xc1e1('0x7f')](_0xc1e1('0x80'),_0xf03015[_0xc1e1('0x2e')]):_0xf03015[_0xc1e1('0x7c')],'paused':_0xf03015[_0xc1e1('0x7b')]||![],'penalty':_0x367732[_0xc1e1('0x81')][_0xc1e1('0x74')]},{'transaction':_0x3aa5f3});});return Promise['all'](_0x34686a);});});});return Promise[_0xc1e1('0x82')](_0xb0983a);});return Promise[_0xc1e1('0x82')](_0x2876bd);});});return Promise['all'](_0x161c66)[_0xc1e1('0x29')](function(){return _0x11272b[_0xc1e1('0x6a')](_0xcb2a1d['body']['ids'],{'transaction':_0x3aa5f3})[_0xc1e1('0x83')](function(_0x37f0e9){return _0x37f0e9;});});});}})[_0xc1e1('0x29')](respondWithResult(_0x2c5efb,null))[_0xc1e1('0x4c')](handleError(_0x2c5efb,null));};exports[_0xc1e1('0x84')]=function(_0x3f1ad8,_0x49a0bb){return db[_0xc1e1('0x32')][_0xc1e1('0x4e')]({'where':{'id':_0x3f1ad8[_0xc1e1('0x5a')]['id']}})[_0xc1e1('0x29')](handleEntityNotFound(_0x49a0bb,null))[_0xc1e1('0x29')](function(_0x578a96){if(_0x578a96){var _0xce1419=[_0xc1e1('0x6b'),_0xc1e1('0x6c'),_0xc1e1('0x6d'),_0xc1e1('0x6e'),'Fax',_0xc1e1('0x70'),'Whatsapp'];return db[_0xc1e1('0x72')][_0xc1e1('0x73')](function(_0x18e90e){var _0x1138d2=_[_0xc1e1('0x31')](_0xce1419,function(_0x140dcb){var _0x35e913={'attributes':['id','name']};return _0x578a96[_0xc1e1('0x52')+_0x140dcb+_0xc1e1('0x60')](_0x35e913)['then'](function(_0x540b86){var _0x341a3a=_['map'](_0x540b86,function(_0x24102b){return _0x24102b[_0xc1e1('0x84')](_0x3f1ad8[_0xc1e1('0x37')][_0xc1e1('0x69')],{'transaction':_0x18e90e})['then'](function(){var _0x274004=JSON[_0xc1e1('0x85')]('['+_0x3f1ad8[_0xc1e1('0x37')][_0xc1e1('0x69')]+']');var _0x180f3e=_['map'](_0x274004,function(_0x202465){socket[_0xc1e1('0x78')]('user'+_0x140dcb+_0xc1e1('0x86'),{'UserId':Number(_0x202465),[_0x140dcb+'QueueId']:_0x24102b['id']});if(_0x140dcb!==_0xc1e1('0x6b'))return;return db[_0xc1e1('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x24102b['id'],'UserId':_0x202465},'transaction':_0x18e90e});});return Promise[_0xc1e1('0x82')](_0x180f3e);});});return Promise[_0xc1e1('0x82')](_0x341a3a);});});return Promise[_0xc1e1('0x82')](_0x1138d2)[_0xc1e1('0x29')](function(){return _0x578a96['removeAgents'](_0x3f1ad8[_0xc1e1('0x37')][_0xc1e1('0x69')],{'transaction':_0x18e90e});});});}})[_0xc1e1('0x29')](respondWithStatusCode(_0x49a0bb,null))['catch'](handleError(_0x49a0bb,null));};exports[_0xc1e1('0x87')]=function(_0x24c024,_0x419d1c,_0x5c139d){var _0x5d1cf9={};var _0x399125={};var _0x517e34;var _0xb3e7af;return db[_0xc1e1('0x32')][_0xc1e1('0x67')]({'where':{'id':_0x24c024['params']['id']}})[_0xc1e1('0x29')](handleEntityNotFound(_0x419d1c,null))[_0xc1e1('0x29')](function(_0x3bea9e){if(_0x3bea9e){_0x517e34=_0x3bea9e;_0x399125[_0xc1e1('0x36')]=_[_0xc1e1('0x38')](db[_0xc1e1('0x76')]['rawAttributes']);_0x399125[_0xc1e1('0x37')]=_[_0xc1e1('0x38')](_0x24c024['query']);_0x399125['filters']=_[_0xc1e1('0x3a')](_0x399125['model'],_0x399125[_0xc1e1('0x37')]);_0x5d1cf9[_0xc1e1('0x3b')]=_[_0xc1e1('0x3a')](_0x399125[_0xc1e1('0x36')],qs['fields'](_0x24c024['query'][_0xc1e1('0x3c')]));_0x5d1cf9[_0xc1e1('0x3b')]=_0x5d1cf9['attributes'][_0xc1e1('0x3d')]?_0x5d1cf9[_0xc1e1('0x3b')]:_0x399125[_0xc1e1('0x36')];_0x5d1cf9[_0xc1e1('0x40')]=qs[_0xc1e1('0x41')](_0x24c024[_0xc1e1('0x37')]['sort']);_0x5d1cf9['where']=qs[_0xc1e1('0x39')](_[_0xc1e1('0x43')](_0x24c024[_0xc1e1('0x37')],_0x399125[_0xc1e1('0x39')]));if(_0x24c024[_0xc1e1('0x37')][_0xc1e1('0x44')]){_0x5d1cf9['where']=_['merge'](_0x5d1cf9['where'],{'$or':_['map'](_0x5d1cf9[_0xc1e1('0x3b')],function(_0x384523){var _0x3b8de5={};_0x3b8de5[_0x384523]={'$like':'%'+_0x24c024['query'][_0xc1e1('0x44')]+'%'};return _0x3b8de5;})});}_0x5d1cf9=_[_0xc1e1('0x45')]({},_0x5d1cf9,_0x24c024['options']);return _0x517e34['getAgents'](_0x5d1cf9);}})['then'](function(_0x55cc9b){if(_0x55cc9b){_0xb3e7af=_0x55cc9b[_0xc1e1('0x3d')];if(!_0x24c024[_0xc1e1('0x37')]['hasOwnProperty'](_0xc1e1('0x3e'))){_0x5d1cf9['limit']=qs['limit'](_0x24c024[_0xc1e1('0x37')][_0xc1e1('0x23')]);_0x5d1cf9[_0xc1e1('0x3f')]=qs[_0xc1e1('0x3f')](_0x24c024['query'][_0xc1e1('0x3f')]);}return _0x517e34['getAgents'](_0x5d1cf9);}})[_0xc1e1('0x29')](function(_0x533209){if(_0x533209){return _0x533209?{'count':_0xb3e7af,'rows':_0x533209}:null;}})['then'](respondWithResult(_0x419d1c,null))[_0xc1e1('0x4c')](handleError(_0x419d1c,null));}; \ No newline at end of file +var _0xb589=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','Teams','error','name','send','index','map','Team','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','channel','ValidationError','Unknown\x20channel','capitalize','pick','toLowerCase','Queues','addQueues','findOne','ids','removeQueues','Sequelize','remove','addAgents','Voice','Chat','Mail','Sms','Fax','sequelize','transaction','through','penalty','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','QueueId','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','spread','removeAgents','Openchannel','Whatsapp','parse','Queue:remove','getAgents','nolimit','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x14c702,_0x5c2e21){var _0x276559=function(_0x438344){while(--_0x438344){_0x14c702['push'](_0x14c702['shift']());}};_0x276559(++_0x5c2e21);}(_0xb589,0x102));var _0x9b58=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0xb589[_0x5d8631];return _0x34c15e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b58('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b58('0x1'));var rp=require('request-promise');var moment=require(_0x9b58('0x2'));var BPromise=require(_0x9b58('0x3'));var Mustache=require(_0x9b58('0x4'));var util=require(_0x9b58('0x5'));var path=require('path');var sox=require(_0x9b58('0x6'));var csv=require(_0x9b58('0x7'));var ejs=require(_0x9b58('0x8'));var fs=require('fs');var fs_extra=require(_0x9b58('0x9'));var _=require(_0x9b58('0xa'));var squel=require(_0x9b58('0xb'));var crypto=require(_0x9b58('0xc'));var jsforce=require(_0x9b58('0xd'));var deskjs=require(_0x9b58('0xe'));var toCsv=require(_0x9b58('0x7'));var querystring=require(_0x9b58('0xf'));var Papa=require(_0x9b58('0x10'));var Redis=require(_0x9b58('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9b58('0x12'));var as=require(_0x9b58('0x13'));var hardwareService=require(_0x9b58('0x14'));var logger=require(_0x9b58('0x15'))(_0x9b58('0x16'));var utils=require(_0x9b58('0x17'));var config=require(_0x9b58('0x18'));var licenseUtil=require(_0x9b58('0x19'));var db=require(_0x9b58('0x1a'))['db'];config[_0x9b58('0x1b')]=_[_0x9b58('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9b58('0x1d'))(new Redis(config['redis']));require(_0x9b58('0x1e'))['register'](socket);function respondWithStatusCode(_0x151cee,_0x102f52){_0x102f52=_0x102f52||0xcc;return function(_0x607fc5){if(_0x607fc5){return _0x151cee[_0x9b58('0x1f')](_0x102f52);}return _0x151cee[_0x9b58('0x20')](_0x102f52)[_0x9b58('0x21')]();};}function respondWithResult(_0x31b4c6,_0x591e8d){_0x591e8d=_0x591e8d||0xc8;return function(_0x9d7527){if(_0x9d7527){return _0x31b4c6['status'](_0x591e8d)[_0x9b58('0x22')](_0x9d7527);}};}function respondWithFilteredResult(_0x5cf3f9,_0x31d620){return function(_0x3ebc3f){if(_0x3ebc3f){var _0x5f18d8=_0x3ebc3f[_0x9b58('0x23')],_0x313288=_0x31d620[_0x9b58('0x24')],_0x8e2243=_0x31d620[_0x9b58('0x24')]+_0x31d620[_0x9b58('0x25')],_0x30d376;if(_0x8e2243>=_0x5f18d8){_0x8e2243=_0x5f18d8;_0x30d376=0xc8;}else{_0x30d376=0xce;}_0x5cf3f9['status'](_0x30d376);return _0x5cf3f9[_0x9b58('0x26')](_0x9b58('0x27'),_0x313288+'-'+_0x8e2243+'/'+_0x5f18d8)[_0x9b58('0x22')](_0x3ebc3f);}return null;};}function patchUpdates(_0x42e2f7){return function(_0x10c3d9){try{jsonpatch[_0x9b58('0x28')](_0x10c3d9,_0x42e2f7,!![]);}catch(_0x70e233){return BPromise['reject'](_0x70e233);}return _0x10c3d9['save']();};}function saveUpdates(_0x1eb435,_0x4d673d){return function(_0x1e2c0b){if(_0x1e2c0b){return _0x1e2c0b[_0x9b58('0x29')](_0x1eb435)[_0x9b58('0x2a')](function(_0x546790){return _0x546790;});}return null;};}function removeEntity(_0x1372bd,_0x2fbb44){return function(_0x1618c6){if(_0x1618c6){return _0x1618c6[_0x9b58('0x2b')]()[_0x9b58('0x2a')](function(){var _0x4af26a=_0x1618c6[_0x9b58('0x2c')]({'plain':!![]});var _0x101b0d=_0x9b58('0x2d');return db['UserProfileResource'][_0x9b58('0x2b')]({'where':{'type':_0x101b0d,'resourceId':_0x4af26a['id']}})[_0x9b58('0x2a')](function(){return _0x1618c6;});})['then'](function(){_0x1372bd[_0x9b58('0x20')](0xcc)[_0x9b58('0x21')]();});}};}function handleEntityNotFound(_0x1c25c7,_0x54fb4e){return function(_0x5c9ee5){if(!_0x5c9ee5){_0x1c25c7[_0x9b58('0x1f')](0x194);}return _0x5c9ee5;};}function handleError(_0x8b5858,_0x19b6bf){_0x19b6bf=_0x19b6bf||0x1f4;return function(_0x92a5ab){logger[_0x9b58('0x2e')](_0x92a5ab['stack']);if(_0x92a5ab['name']){delete _0x92a5ab[_0x9b58('0x2f')];}_0x8b5858[_0x9b58('0x20')](_0x19b6bf)[_0x9b58('0x30')](_0x92a5ab);};}exports[_0x9b58('0x31')]=function(_0xd941c,_0x224d7e){var _0x394bdc={},_0x274239={},_0x4fc38a={'count':0x0,'rows':[]};var _0x4cc743=_[_0x9b58('0x32')](db[_0x9b58('0x33')][_0x9b58('0x34')],function(_0x1f27fa){return{'name':_0x1f27fa['fieldName'],'type':_0x1f27fa[_0x9b58('0x35')][_0x9b58('0x36')]};});_0x274239[_0x9b58('0x37')]=_[_0x9b58('0x32')](_0x4cc743,_0x9b58('0x2f'));_0x274239[_0x9b58('0x38')]=_[_0x9b58('0x39')](_0xd941c[_0x9b58('0x38')]);_0x274239['filters']=_['intersection'](_0x274239[_0x9b58('0x37')],_0x274239['query']);_0x394bdc['attributes']=_[_0x9b58('0x3a')](_0x274239[_0x9b58('0x37')],qs[_0x9b58('0x3b')](_0xd941c['query'][_0x9b58('0x3b')]));_0x394bdc[_0x9b58('0x3c')]=_0x394bdc[_0x9b58('0x3c')][_0x9b58('0x3d')]?_0x394bdc[_0x9b58('0x3c')]:_0x274239[_0x9b58('0x37')];if(!_0xd941c['query'][_0x9b58('0x3e')]('nolimit')){_0x394bdc[_0x9b58('0x25')]=qs['limit'](_0xd941c['query']['limit']);_0x394bdc[_0x9b58('0x24')]=qs[_0x9b58('0x24')](_0xd941c[_0x9b58('0x38')][_0x9b58('0x24')]);}_0x394bdc[_0x9b58('0x3f')]=qs[_0x9b58('0x40')](_0xd941c[_0x9b58('0x38')][_0x9b58('0x40')]);_0x394bdc[_0x9b58('0x41')]=qs['filters'](_['pick'](_0xd941c[_0x9b58('0x38')],_0x274239[_0x9b58('0x42')]),_0x4cc743);if(_0xd941c[_0x9b58('0x38')][_0x9b58('0x43')]){_0x394bdc[_0x9b58('0x41')]=_[_0x9b58('0x44')](_0x394bdc[_0x9b58('0x41')],{'$or':_[_0x9b58('0x32')](_0x4cc743,function(_0x43e08c){if(_0x43e08c[_0x9b58('0x35')]!==_0x9b58('0x45')){var _0x511651={};_0x511651[_0x43e08c['name']]={'$like':'%'+_0xd941c[_0x9b58('0x38')]['filter']+'%'};return _0x511651;}})});}_0x394bdc=_['merge']({},_0x394bdc,_0xd941c['options']);var _0x385e80={'where':_0x394bdc[_0x9b58('0x41')]};return db[_0x9b58('0x33')][_0x9b58('0x23')](_0x385e80)['then'](function(_0x2094c4){_0x4fc38a['count']=_0x2094c4;if(_0xd941c[_0x9b58('0x38')][_0x9b58('0x46')]){_0x394bdc[_0x9b58('0x47')]=[{'all':!![]}];}return db[_0x9b58('0x33')][_0x9b58('0x48')](_0x394bdc);})[_0x9b58('0x2a')](function(_0x328384){_0x4fc38a[_0x9b58('0x49')]=_0x328384;return _0x4fc38a;})['then'](respondWithFilteredResult(_0x224d7e,_0x394bdc))[_0x9b58('0x4a')](handleError(_0x224d7e,null));};exports[_0x9b58('0x4b')]=function(_0x133d08,_0x413cbd){var _0x4d67a1={'raw':![],'where':{'id':_0x133d08[_0x9b58('0x4c')]['id']}},_0x38f243={};_0x38f243[_0x9b58('0x37')]=_[_0x9b58('0x39')](db[_0x9b58('0x33')][_0x9b58('0x34')]);_0x38f243[_0x9b58('0x38')]=_[_0x9b58('0x39')](_0x133d08['query']);_0x38f243['filters']=_[_0x9b58('0x3a')](_0x38f243[_0x9b58('0x37')],_0x38f243[_0x9b58('0x38')]);_0x4d67a1['attributes']=_[_0x9b58('0x3a')](_0x38f243['model'],qs[_0x9b58('0x3b')](_0x133d08[_0x9b58('0x38')]['fields']));_0x4d67a1['attributes']=_0x4d67a1['attributes']['length']?_0x4d67a1[_0x9b58('0x3c')]:_0x38f243[_0x9b58('0x37')];if(_0x133d08[_0x9b58('0x38')][_0x9b58('0x46')]){_0x4d67a1[_0x9b58('0x47')]=[{'all':!![]}];}_0x4d67a1=_[_0x9b58('0x44')]({},_0x4d67a1,_0x133d08[_0x9b58('0x4d')]);return db['Team'][_0x9b58('0x4e')](_0x4d67a1)['then'](handleEntityNotFound(_0x413cbd,null))[_0x9b58('0x2a')](respondWithResult(_0x413cbd,null))[_0x9b58('0x4a')](handleError(_0x413cbd,null));};exports[_0x9b58('0x4f')]=function(_0x557dd9,_0xee94b3){return db[_0x9b58('0x33')][_0x9b58('0x4f')](_0x557dd9[_0x9b58('0x50')],{})[_0x9b58('0x2a')](function(_0x117110){var _0x269bbc=_0x557dd9[_0x9b58('0x51')][_0x9b58('0x2c')]({'plain':!![]});if(!_0x269bbc)throw new Error(_0x9b58('0x52'));if(_0x269bbc[_0x9b58('0x53')]===_0x9b58('0x51')){var _0x29f330=_0x117110[_0x9b58('0x2c')]({'plain':!![]});var _0x10e0d8=_0x9b58('0x2d');return db[_0x9b58('0x54')][_0x9b58('0x4e')]({'where':{'name':_0x10e0d8,'userProfileId':_0x269bbc[_0x9b58('0x55')]},'raw':!![]})[_0x9b58('0x2a')](function(_0x38d8e1){if(_0x38d8e1&&_0x38d8e1[_0x9b58('0x56')]===0x0){return db[_0x9b58('0x57')][_0x9b58('0x4f')]({'name':_0x29f330[_0x9b58('0x2f')],'resourceId':_0x29f330['id'],'type':_0x38d8e1[_0x9b58('0x2f')],'sectionId':_0x38d8e1['id']},{})[_0x9b58('0x2a')](function(){return _0x117110;});}else{return _0x117110;}})[_0x9b58('0x4a')](function(_0x12e488){logger[_0x9b58('0x2e')](_0x9b58('0x58'),_0x12e488);throw _0x12e488;});}return _0x117110;})[_0x9b58('0x2a')](respondWithResult(_0xee94b3,0xc9))[_0x9b58('0x4a')](handleError(_0xee94b3,null));};exports['update']=function(_0x4caf73,_0x5308b3){if(_0x4caf73[_0x9b58('0x50')]['id']){delete _0x4caf73[_0x9b58('0x50')]['id'];}return db['Team'][_0x9b58('0x4e')]({'where':{'id':_0x4caf73[_0x9b58('0x4c')]['id']}})[_0x9b58('0x2a')](handleEntityNotFound(_0x5308b3,null))[_0x9b58('0x2a')](saveUpdates(_0x4caf73['body'],null))[_0x9b58('0x2a')](respondWithResult(_0x5308b3,null))[_0x9b58('0x4a')](handleError(_0x5308b3,null));};exports[_0x9b58('0x2b')]=function(_0x22b9e7,_0x3502a7){return db['Team']['find']({'where':{'id':_0x22b9e7[_0x9b58('0x4c')]['id']}})[_0x9b58('0x2a')](handleEntityNotFound(_0x3502a7,null))['then'](removeEntity(_0x3502a7,null))[_0x9b58('0x4a')](handleError(_0x3502a7,null));};exports[_0x9b58('0x59')]=function(_0x2fe974,_0x51971a,_0xa912fc){return db[_0x9b58('0x33')]['findOne']({'where':{'id':_0x2fe974[_0x9b58('0x4c')]['id']}})[_0x9b58('0x2a')](handleEntityNotFound(_0x51971a,null))[_0x9b58('0x2a')](function(_0x2085c2){if(!_0x2fe974[_0x9b58('0x38')]['channel']||!utils['isValidChannel'](_0x2fe974[_0x9b58('0x38')][_0x9b58('0x5a')])){throw new db['Sequelize'][(_0x9b58('0x5b'))](_0x9b58('0x5c'));}var _0x24592e={};var _0x4a1603={};_0x4a1603[_0x9b58('0x37')]=_[_0x9b58('0x39')](db[_[_0x9b58('0x5d')](_0x2fe974[_0x9b58('0x38')][_0x9b58('0x5a')]['toLowerCase']())+'Queue'][_0x9b58('0x34')]);_0x4a1603[_0x9b58('0x38')]=_[_0x9b58('0x39')](_0x2fe974[_0x9b58('0x38')]);_0x4a1603['filters']=_[_0x9b58('0x3a')](_0x4a1603[_0x9b58('0x37')],_0x4a1603[_0x9b58('0x38')]);_0x24592e['attributes']=_['intersection'](_0x4a1603[_0x9b58('0x37')],qs[_0x9b58('0x3b')](_0x2fe974[_0x9b58('0x38')][_0x9b58('0x3b')]));_0x24592e[_0x9b58('0x3c')]=_0x24592e[_0x9b58('0x3c')]['length']?_0x24592e[_0x9b58('0x3c')]:_0x4a1603['model'];_0x24592e[_0x9b58('0x25')]=qs['limit'](_0x2fe974[_0x9b58('0x38')]['limit']);_0x24592e[_0x9b58('0x24')]=qs['offset'](_0x2fe974[_0x9b58('0x38')]['offset']);_0x24592e['order']=qs[_0x9b58('0x40')](_0x2fe974[_0x9b58('0x38')][_0x9b58('0x40')]);_0x24592e['where']=qs[_0x9b58('0x42')](_[_0x9b58('0x5e')](_0x2fe974[_0x9b58('0x38')],_0x4a1603[_0x9b58('0x42')]));_0x24592e=_[_0x9b58('0x44')]({},_0x24592e,_0x2fe974['options']);return _0x2085c2[_0x9b58('0x2c')+_[_0x9b58('0x5d')](_0x2fe974[_0x9b58('0x38')][_0x9b58('0x5a')][_0x9b58('0x5f')]())+_0x9b58('0x60')](_0x24592e);})['then'](respondWithResult(_0x51971a,null))[_0x9b58('0x4a')](handleError(_0x51971a,null));};exports[_0x9b58('0x61')]=function(_0x139b94,_0x2911c9,_0x1b9974){return db[_0x9b58('0x33')][_0x9b58('0x62')]({'where':{'id':_0x139b94[_0x9b58('0x4c')]['id']}})[_0x9b58('0x2a')](function(_0x33d369){if(_0x33d369){if(!_0x139b94['body']['channel']||!utils['isValidChannel'](_0x139b94[_0x9b58('0x50')][_0x9b58('0x5a')])){throw new db['Sequelize'][(_0x9b58('0x5b'))](_0x9b58('0x5c'));}return _0x33d369['add'+_[_0x9b58('0x5d')](_0x139b94[_0x9b58('0x50')][_0x9b58('0x5a')][_0x9b58('0x5f')]())+_0x9b58('0x60')](_0x139b94[_0x9b58('0x50')][_0x9b58('0x63')]);}return null;})[_0x9b58('0x2a')](handleEntityNotFound(_0x2911c9,null))['then'](respondWithStatusCode(_0x2911c9,null))[_0x9b58('0x4a')](handleError(_0x2911c9,null));};exports[_0x9b58('0x64')]=function(_0x53273c,_0x37b6a1,_0x5ab681){return db['Team'][_0x9b58('0x62')]({'where':{'id':_0x53273c['params']['id']}})[_0x9b58('0x2a')](function(_0x23a24c){if(_0x23a24c){if(!_0x53273c[_0x9b58('0x38')]['channel']||!utils['isValidChannel'](_0x53273c[_0x9b58('0x38')][_0x9b58('0x5a')])){throw new db[(_0x9b58('0x65'))][(_0x9b58('0x5b'))]('Unknown\x20channel');}return _0x23a24c[_0x9b58('0x66')+_[_0x9b58('0x5d')](_0x53273c[_0x9b58('0x38')][_0x9b58('0x5a')][_0x9b58('0x5f')]())+'Queues'](_0x53273c[_0x9b58('0x38')]['ids']);}return null;})[_0x9b58('0x2a')](handleEntityNotFound(_0x37b6a1,null))['then'](respondWithStatusCode(_0x37b6a1,null))[_0x9b58('0x4a')](handleError(_0x37b6a1,null));};exports[_0x9b58('0x67')]=function(_0x5296cb,_0x4a85a3){return db[_0x9b58('0x33')][_0x9b58('0x4e')]({'where':{'id':_0x5296cb['params']['id']}})[_0x9b58('0x2a')](handleEntityNotFound(_0x4a85a3,null))[_0x9b58('0x2a')](function(_0x5053be){if(_0x5053be){var _0x47351b=[_0x9b58('0x68'),_0x9b58('0x69'),_0x9b58('0x6a'),_0x9b58('0x6b'),_0x9b58('0x6c'),'Openchannel','Whatsapp'];return db[_0x9b58('0x6d')][_0x9b58('0x6e')](function(_0x37fc26){var _0x4b45b8=_['map'](_0x47351b,function(_0xcb5caf){var _0x39553d={'attributes':['id','name']};if(_0xcb5caf===_0x9b58('0x68')){_0x39553d[_0x9b58('0x6f')]={'attributes':[_0x9b58('0x70')]};}return _0x5053be['get'+_0xcb5caf+_0x9b58('0x60')](_0x39553d)[_0x9b58('0x2a')](function(_0x25a5ed){var _0x52b4da=_[_0x9b58('0x32')](_0x25a5ed,function(_0x153ff2){var _0x4ccfff=_[_0x9b58('0x32')](_0x5296cb[_0x9b58('0x50')][_0x9b58('0x63')],function(_0x5a29a5){var _0x35e30e={'where':{'UserId':_0x5a29a5,[_0xcb5caf+'QueueId']:_0x153ff2['id']},'transaction':_0x37fc26};if(_0xcb5caf===_0x9b58('0x68')){_0x35e30e[_0x9b58('0x1c')]={'penalty':_0x153ff2[_0x9b58('0x71')]['penalty']};}return db[_0x9b58('0x72')+_0xcb5caf+_0x9b58('0x73')][_0x9b58('0x74')](_0x35e30e)[_0x9b58('0x2a')](function(){socket[_0x9b58('0x75')](_0x9b58('0x51')+_0xcb5caf+_0x9b58('0x76'),{'UserId':_0x5a29a5,[_0xcb5caf+_0x9b58('0x77')]:_0x153ff2['id']});if(_0xcb5caf!==_0x9b58('0x68'))return;return db[_0x9b58('0x72')][_0x9b58('0x48')]({'where':{'id':_0x5296cb[_0x9b58('0x50')]['ids'],'online':0x1},'attributes':['id','name',_0x9b58('0x78'),_0x9b58('0x79'),_0x9b58('0x7a')],'raw':!![]})[_0x9b58('0x2a')](function(_0x4ad51d){var _0x595393=_[_0x9b58('0x32')](_0x4ad51d,function(_0x5d6eae){return db[_0x9b58('0x7b')][_0x9b58('0x7c')]({'membername':_0x5d6eae['name'],'UserId':_0x5d6eae['id'],'queue_name':_0x153ff2[_0x9b58('0x2f')],'VoiceQueueId':_0x153ff2['id'],'interface':_[_0x9b58('0x7d')](_0x5d6eae[_0x9b58('0x7a')])?util[_0x9b58('0x7e')](_0x9b58('0x7f'),_0x5d6eae[_0x9b58('0x2f')]):_0x5d6eae['interface'],'paused':_0x5d6eae[_0x9b58('0x79')]||![],'penalty':_0x153ff2['TeamVoiceQueue'][_0x9b58('0x70')]},{'transaction':_0x37fc26});});return Promise[_0x9b58('0x80')](_0x595393);});});});return Promise[_0x9b58('0x80')](_0x4ccfff);});return Promise[_0x9b58('0x80')](_0x52b4da);});});return Promise['all'](_0x4b45b8)[_0x9b58('0x2a')](function(){return _0x5053be[_0x9b58('0x67')](_0x5296cb[_0x9b58('0x50')][_0x9b58('0x63')],{'transaction':_0x37fc26})[_0x9b58('0x81')](function(_0x58a3fb){return _0x58a3fb;});});});}})[_0x9b58('0x2a')](respondWithResult(_0x4a85a3,null))[_0x9b58('0x4a')](handleError(_0x4a85a3,null));};exports[_0x9b58('0x82')]=function(_0x1a5306,_0x20205f){return db[_0x9b58('0x33')]['find']({'where':{'id':_0x1a5306[_0x9b58('0x4c')]['id']}})[_0x9b58('0x2a')](handleEntityNotFound(_0x20205f,null))[_0x9b58('0x2a')](function(_0xfc0f39){if(_0xfc0f39){var _0x460cbf=[_0x9b58('0x68'),_0x9b58('0x69'),_0x9b58('0x6a'),_0x9b58('0x6b'),_0x9b58('0x6c'),_0x9b58('0x83'),_0x9b58('0x84')];return db[_0x9b58('0x6d')]['transaction'](function(_0x172d59){var _0x5e6a4d=_['map'](_0x460cbf,function(_0xd6c0a6){var _0x3430b6={'attributes':['id',_0x9b58('0x2f')]};return _0xfc0f39[_0x9b58('0x2c')+_0xd6c0a6+'Queues'](_0x3430b6)['then'](function(_0x1b775a){var _0x515ab4=_[_0x9b58('0x32')](_0x1b775a,function(_0x214fb6){return _0x214fb6[_0x9b58('0x82')](_0x1a5306[_0x9b58('0x38')][_0x9b58('0x63')],{'transaction':_0x172d59})['then'](function(){var _0xa2d373=JSON[_0x9b58('0x85')]('['+_0x1a5306[_0x9b58('0x38')][_0x9b58('0x63')]+']');var _0x580c84=_['map'](_0xa2d373,function(_0x4aab5c){socket[_0x9b58('0x75')]('user'+_0xd6c0a6+_0x9b58('0x86'),{'UserId':Number(_0x4aab5c),[_0xd6c0a6+'QueueId']:_0x214fb6['id']});if(_0xd6c0a6!==_0x9b58('0x68'))return;return db[_0x9b58('0x7b')][_0x9b58('0x2b')]({'where':{'VoiceQueueId':_0x214fb6['id'],'UserId':_0x4aab5c},'transaction':_0x172d59});});return Promise[_0x9b58('0x80')](_0x580c84);});});return Promise[_0x9b58('0x80')](_0x515ab4);});});return Promise[_0x9b58('0x80')](_0x5e6a4d)[_0x9b58('0x2a')](function(){return _0xfc0f39['removeAgents'](_0x1a5306['query']['ids'],{'transaction':_0x172d59});});});}})[_0x9b58('0x2a')](respondWithStatusCode(_0x20205f,null))[_0x9b58('0x4a')](handleError(_0x20205f,null));};exports[_0x9b58('0x87')]=function(_0x403c22,_0x33b08d,_0x1dd207){var _0x4e0926={};var _0xca2a80={};var _0x2f55e1;var _0x37498f;return db[_0x9b58('0x33')][_0x9b58('0x62')]({'where':{'id':_0x403c22['params']['id']}})[_0x9b58('0x2a')](handleEntityNotFound(_0x33b08d,null))[_0x9b58('0x2a')](function(_0x156650){if(_0x156650){_0x2f55e1=_0x156650;_0xca2a80[_0x9b58('0x37')]=_['keys'](db[_0x9b58('0x72')]['rawAttributes']);_0xca2a80['query']=_[_0x9b58('0x39')](_0x403c22[_0x9b58('0x38')]);_0xca2a80['filters']=_['intersection'](_0xca2a80['model'],_0xca2a80['query']);_0x4e0926[_0x9b58('0x3c')]=_[_0x9b58('0x3a')](_0xca2a80['model'],qs['fields'](_0x403c22[_0x9b58('0x38')][_0x9b58('0x3b')]));_0x4e0926[_0x9b58('0x3c')]=_0x4e0926[_0x9b58('0x3c')]['length']?_0x4e0926[_0x9b58('0x3c')]:_0xca2a80[_0x9b58('0x37')];_0x4e0926[_0x9b58('0x3f')]=qs['sort'](_0x403c22['query']['sort']);_0x4e0926['where']=qs[_0x9b58('0x42')](_[_0x9b58('0x5e')](_0x403c22[_0x9b58('0x38')],_0xca2a80[_0x9b58('0x42')]));if(_0x403c22[_0x9b58('0x38')]['filter']){_0x4e0926['where']=_[_0x9b58('0x44')](_0x4e0926[_0x9b58('0x41')],{'$or':_[_0x9b58('0x32')](_0x4e0926[_0x9b58('0x3c')],function(_0x571011){var _0x1cb032={};_0x1cb032[_0x571011]={'$like':'%'+_0x403c22['query'][_0x9b58('0x43')]+'%'};return _0x1cb032;})});}_0x4e0926=_['merge']({},_0x4e0926,_0x403c22[_0x9b58('0x4d')]);return _0x2f55e1[_0x9b58('0x87')](_0x4e0926);}})[_0x9b58('0x2a')](function(_0x573f80){if(_0x573f80){_0x37498f=_0x573f80[_0x9b58('0x3d')];if(!_0x403c22['query'][_0x9b58('0x3e')](_0x9b58('0x88'))){_0x4e0926[_0x9b58('0x25')]=qs['limit'](_0x403c22[_0x9b58('0x38')][_0x9b58('0x25')]);_0x4e0926[_0x9b58('0x24')]=qs[_0x9b58('0x24')](_0x403c22[_0x9b58('0x38')]['offset']);}return _0x2f55e1[_0x9b58('0x87')](_0x4e0926);}})['then'](function(_0x3ff157){if(_0x3ff157){return _0x3ff157?{'count':_0x37498f,'rows':_0x3ff157}:null;}})[_0x9b58('0x2a')](respondWithResult(_0x33b08d,null))[_0x9b58('0x4a')](handleError(_0x33b08d,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index ab3404f..c412c5b 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 _0x44a4=['update','emit','hasOwnProperty','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x44a4,0x124));var _0x444a=function(_0x5e79a8,_0xa19d4){_0x5e79a8=_0x5e79a8-0x0;var _0x52d947=_0x44a4[_0x5e79a8];return _0x52d947;};'use strict';var EventEmitter=require(_0x444a('0x0'));var Team=require(_0x444a('0x1'))['db'][_0x444a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x444a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x444a('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa06163){return function(_0x553513,_0x34b1ec,_0x5ec125){TeamEvents[_0x444a('0x5')](_0xa06163+':'+_0x553513['id'],_0x553513);TeamEvents[_0x444a('0x5')](_0xa06163,_0x553513);_0x5ec125(null);};}for(var e in events){if(events[_0x444a('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x444a('0x7')]=TeamEvents; \ No newline at end of file +var _0x68ce=['save','emit','hasOwnProperty','events','Team','setMaxListeners'];(function(_0x1383b0,_0x48dd2a){var _0x5989b1=function(_0x5b9615){while(--_0x5b9615){_0x1383b0['push'](_0x1383b0['shift']());}};_0x5989b1(++_0x48dd2a);}(_0x68ce,0x10b));var _0xe68c=function(_0x389c88,_0x46d30a){_0x389c88=_0x389c88-0x0;var _0x32b899=_0x68ce[_0x389c88];return _0x32b899;};'use strict';var EventEmitter=require(_0xe68c('0x0'));var Team=require('../../mysqldb')['db'][_0xe68c('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xe68c('0x2')](0x0);var events={'afterCreate':_0xe68c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x292b41){return function(_0xf75e70,_0x1daeb1,_0x165241){TeamEvents[_0xe68c('0x4')](_0x292b41+':'+_0xf75e70['id'],_0xf75e70);TeamEvents[_0xe68c('0x4')](_0x292b41,_0xf75e70);_0x165241(null);};}for(var e in events){if(events[_0xe68c('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index d0bd38a..944246f 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 _0xd763=['../../config/environment','./team.attributes','exports','define','Team','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1528cf,_0x27ef21){var _0x249f28=function(_0x28a479){while(--_0x28a479){_0x1528cf['push'](_0x1528cf['shift']());}};_0x249f28(++_0x27ef21);}(_0xd763,0xdd));var _0x3d76=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xd763[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x3d76('0x0'));var util=require(_0x3d76('0x1'));var logger=require(_0x3d76('0x2'))(_0x3d76('0x3'));var moment=require(_0x3d76('0x4'));var BPromise=require(_0x3d76('0x5'));var rp=require(_0x3d76('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3d76('0x7'));var attributes=require(_0x3d76('0x8'));module[_0x3d76('0x9')]=function(_0x4a0148,_0x5ae2e6){return _0x4a0148[_0x3d76('0xa')](_0x3d76('0xb'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9380=['../../config/environment','./team.attributes','define','lodash','../../config/logger','api','request-promise','rimraf'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x9380,0x16b));var _0x0938=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x9380[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x0938('0x0'));var util=require('util');var logger=require(_0x0938('0x1'))(_0x0938('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0938('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0938('0x4'));var config=require(_0x0938('0x5'));var attributes=require(_0x0938('0x6'));module['exports']=function(_0x56fc58,_0x210681){return _0x56fc58[_0x0938('0x7')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 9f31a38..8c64fd7 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 _0x572f=['../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./team.socket','register','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring'];(function(_0x57793f,_0x2a9483){var _0x53b093=function(_0x2aae5a){while(--_0x2aae5a){_0x57793f['push'](_0x57793f['shift']());}};_0x53b093(++_0x2a9483);}(_0x572f,0x13f));var _0xf572=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x572f[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf572('0x0'));var BPromise=require(_0xf572('0x1'));var rs=require(_0xf572('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf572('0x3'));var logger=require(_0xf572('0x4'))(_0xf572('0x5'));var config=require('../../config/environment');var jayson=require(_0xf572('0x6'));var client=jayson[_0xf572('0x7')]['http']({'port':0x232a});config['redis']=_[_0xf572('0x8')](config[_0xf572('0x9')],{'host':_0xf572('0xa'),'port':0x18eb});var socket=require(_0xf572('0xb'))(new Redis(config[_0xf572('0x9')]));require(_0xf572('0xc'))[_0xf572('0xd')](socket);function respondWithRpcPromise(_0xaeb0f5,_0x38576d,_0x419606){return new BPromise(function(_0x5da70b,_0x4b1320){return client['request'](_0xaeb0f5,_0x419606)[_0xf572('0xe')](function(_0x2897d9){logger['info'](_0xf572('0xf'),_0x38576d,_0xf572('0x10'));logger['debug'](_0xf572('0x11'),_0x38576d,_0xf572('0x10'),JSON[_0xf572('0x12')](_0x2897d9));if(_0x2897d9[_0xf572('0x13')]){if(_0x2897d9[_0xf572('0x13')]['code']===0x1f4){logger[_0xf572('0x13')](_0xf572('0xf'),_0x38576d,_0x2897d9[_0xf572('0x13')][_0xf572('0x14')]);return _0x4b1320(_0x2897d9['error'][_0xf572('0x14')]);}logger['error']('Team,\x20%s,\x20%s',_0x38576d,_0x2897d9[_0xf572('0x13')][_0xf572('0x14')]);return _0x5da70b(_0x2897d9[_0xf572('0x13')][_0xf572('0x14')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x38576d,'request\x20sent');_0x5da70b(_0x2897d9[_0xf572('0x15')][_0xf572('0x14')]);}})[_0xf572('0x16')](function(_0x38d520){logger['error']('Team,\x20%s,\x20%s',_0x38576d,_0x38d520);_0x4b1320(_0x38d520);});});} \ No newline at end of file +var _0xf107=['../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger'];(function(_0x1f787b,_0x52cab7){var _0x37fa0b=function(_0x1022d4){while(--_0x1022d4){_0x1f787b['push'](_0x1f787b['shift']());}};_0x37fa0b(++_0x52cab7);}(_0xf107,0x153));var _0x7f10=function(_0x5caee9,_0x2c4bb8){_0x5caee9=_0x5caee9-0x0;var _0x567931=_0xf107[_0x5caee9];return _0x567931;};'use strict';var _=require(_0x7f10('0x0'));var util=require(_0x7f10('0x1'));var moment=require(_0x7f10('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f10('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f10('0x5'))('rpc');var config=require(_0x7f10('0x6'));var jayson=require(_0x7f10('0x7'));var client=jayson[_0x7f10('0x8')]['http']({'port':0x232a});config[_0x7f10('0x9')]=_[_0x7f10('0xa')](config[_0x7f10('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f10('0xb'))(new Redis(config['redis']));require('./team.socket')[_0x7f10('0xc')](socket);function respondWithRpcPromise(_0x46e3e2,_0xe1256c,_0x4e1207){return new BPromise(function(_0xebe1a9,_0x1ae2b5){return client['request'](_0x46e3e2,_0x4e1207)['then'](function(_0x3ff046){logger[_0x7f10('0xd')](_0x7f10('0xe'),_0xe1256c,'request\x20sent');logger[_0x7f10('0xf')](_0x7f10('0x10'),_0xe1256c,'request\x20sent',JSON[_0x7f10('0x11')](_0x3ff046));if(_0x3ff046[_0x7f10('0x12')]){if(_0x3ff046[_0x7f10('0x12')][_0x7f10('0x13')]===0x1f4){logger['error'](_0x7f10('0xe'),_0xe1256c,_0x3ff046[_0x7f10('0x12')][_0x7f10('0x14')]);return _0x1ae2b5(_0x3ff046[_0x7f10('0x12')][_0x7f10('0x14')]);}logger[_0x7f10('0x12')](_0x7f10('0xe'),_0xe1256c,_0x3ff046['error'][_0x7f10('0x14')]);return _0xebe1a9(_0x3ff046[_0x7f10('0x12')]['message']);}else{logger[_0x7f10('0xd')](_0x7f10('0xe'),_0xe1256c,_0x7f10('0x15'));_0xebe1a9(_0x3ff046['result']['message']);}})[_0x7f10('0x16')](function(_0x18bcd3){logger[_0x7f10('0x12')](_0x7f10('0xe'),_0xe1256c,_0x18bcd3);_0x1ae2b5(_0x18bcd3);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index b22d296..267cde1 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 _0xa817=['update','emit','removeListener','register','length','team:','./team.events','save','remove'];(function(_0xc6d51a,_0x240da5){var _0x537508=function(_0x15b24b){while(--_0x15b24b){_0xc6d51a['push'](_0xc6d51a['shift']());}};_0x537508(++_0x240da5);}(_0xa817,0x7b));var _0x7a81=function(_0x3b9515,_0x33d857){_0x3b9515=_0x3b9515-0x0;var _0x1a0226=_0xa817[_0x3b9515];return _0x1a0226;};'use strict';var TeamEvents=require(_0x7a81('0x0'));var events=[_0x7a81('0x1'),_0x7a81('0x2'),_0x7a81('0x3')];function createListener(_0x20e6ae,_0x1916b5){return function(_0x142188){_0x1916b5[_0x7a81('0x4')](_0x20e6ae,_0x142188);};}function removeListener(_0x32f6ff,_0x4b5d54){return function(){TeamEvents[_0x7a81('0x5')](_0x32f6ff,_0x4b5d54);};}exports[_0x7a81('0x6')]=function(_0x5bf69b){for(var _0x2249d1=0x0,_0x35c35a=events[_0x7a81('0x7')];_0x2249d1<_0x35c35a;_0x2249d1++){var _0x705d4e=events[_0x2249d1];var _0x1869fb=createListener(_0x7a81('0x8')+_0x705d4e,_0x5bf69b);TeamEvents['on'](_0x705d4e,_0x1869fb);}}; \ No newline at end of file +var _0xc6ac=['removeListener','register','length','./team.events','save','remove','update','emit'];(function(_0x21443d,_0x1d6e0b){var _0x2eb7de=function(_0x47f385){while(--_0x47f385){_0x21443d['push'](_0x21443d['shift']());}};_0x2eb7de(++_0x1d6e0b);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x512afa,_0x544962){_0x512afa=_0x512afa-0x0;var _0x5416d6=_0xc6ac[_0x512afa];return _0x5416d6;};'use strict';var TeamEvents=require(_0xcc6a('0x0'));var events=[_0xcc6a('0x1'),_0xcc6a('0x2'),_0xcc6a('0x3')];function createListener(_0x276972,_0x279d85){return function(_0x17d786){_0x279d85[_0xcc6a('0x4')](_0x276972,_0x17d786);};}function removeListener(_0x297643,_0x22ee99){return function(){TeamEvents[_0xcc6a('0x5')](_0x297643,_0x22ee99);};}exports[_0xcc6a('0x6')]=function(_0x12330e){for(var _0x197bd7=0x0,_0x5f3887=events[_0xcc6a('0x7')];_0x197bd7<_0x5f3887;_0x197bd7++){var _0x11b919=events[_0x197bd7];var _0xf02261=createListener('team:'+_0x11b919,_0x12330e);TeamEvents['on'](_0x11b919,_0xf02261);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index d71ed97..5ce7ea2 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 _0xd7a0=['../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','connect-timeout','Router','fs-extra'];(function(_0x13d2a5,_0x5016a4){var _0x437a87=function(_0x54854d){while(--_0x54854d){_0x13d2a5['push'](_0x13d2a5['shift']());}};_0x437a87(++_0x5016a4);}(_0xd7a0,0x163));var _0x0d7a=function(_0x5cf82,_0x9bc857){_0x5cf82=_0x5cf82-0x0;var _0x48f983=_0xd7a0[_0x5cf82];return _0x48f983;};'use strict';var multer=require(_0x0d7a('0x0'));var util=require(_0x0d7a('0x1'));var path=require('path');var timeout=require(_0x0d7a('0x2'));var express=require('express');var router=express[_0x0d7a('0x3')]();var fs_extra=require(_0x0d7a('0x4'));var auth=require(_0x0d7a('0x5'));var interaction=require(_0x0d7a('0x6'));var config=require(_0x0d7a('0x7'));module['exports']=router; \ No newline at end of file +var _0x13cc=['exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28a5fe,_0x1fb8b1){var _0x3518ac=function(_0xee4809){while(--_0xee4809){_0x28a5fe['push'](_0x28a5fe['shift']());}};_0x3518ac(++_0x1fb8b1);}(_0x13cc,0x161));var _0xc13c=function(_0x12be2a,_0x37136a){_0x12be2a=_0x12be2a-0x0;var _0x63dd4=_0x13cc[_0x12be2a];return _0x63dd4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc13c('0x0'));var timeout=require(_0xc13c('0x1'));var express=require('express');var router=express[_0xc13c('0x2')]();var fs_extra=require(_0xc13c('0x3'));var auth=require(_0xc13c('0x4'));var interaction=require(_0xc13c('0x5'));var config=require(_0xc13c('0x6'));module[_0xc13c('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 3e90844..32da6d5 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x16deb3,_0x3c57c3){var _0x3d0506=function(_0x1891be){while(--_0x1891be){_0x16deb3['push'](_0x16deb3['shift']());}};_0x3d0506(++_0x3c57c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x513db1,_0x28846d){var _0x204c23=function(_0x1c72e8){while(--_0x1c72e8){_0x513db1['push'](_0x513db1['shift']());}};_0x204c23(++_0x28846d);}(_0xe706,0xa3));var _0x6e70=function(_0x2e1a2,_0x81aa1c){_0x2e1a2=_0x2e1a2-0x0;var _0x3df6c8=_0xe706[_0x2e1a2];return _0x3df6c8;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('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 4d8849a..4b5656c 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 _0x8500=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues'];(function(_0x1c0c30,_0x16a742){var _0x186974=function(_0x197091){while(--_0x197091){_0x1c0c30['push'](_0x1c0c30['shift']());}};_0x186974(++_0x16a742);}(_0x8500,0x18c));var _0x0850=function(_0x7c3756,_0x409986){_0x7c3756=_0x7c3756-0x0;var _0x456308=_0x8500[_0x7c3756];return _0x456308;};'use strict';var _=require('lodash');var util=require(_0x0850('0x0'));var logger=require(_0x0850('0x1'))(_0x0850('0x2'));var moment=require('moment');var BPromise=require(_0x0850('0x3'));var rp=require(_0x0850('0x4'));var fs=require('fs');var path=require(_0x0850('0x5'));var rimraf=require(_0x0850('0x6'));var config=require(_0x0850('0x7'));var attributes=require(_0x0850('0x8'));module[_0x0850('0x9')]=function(_0x4c1a06,_0x87c05c){return _0x4c1a06[_0x0850('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x0850('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f9d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','team_has_voice_queues','lodash','util'];(function(_0x1a9bca,_0x247b44){var _0x5d2891=function(_0x55355a){while(--_0x55355a){_0x1a9bca['push'](_0x1a9bca['shift']());}};_0x5d2891(++_0x247b44);}(_0x3f9d,0x1c6));var _0xd3f9=function(_0x4cdba5,_0x5373a7){_0x4cdba5=_0x4cdba5-0x0;var _0x3be43d=_0x3f9d[_0x4cdba5];return _0x3be43d;};'use strict';var _=require(_0xd3f9('0x0'));var util=require(_0xd3f9('0x1'));var logger=require(_0xd3f9('0x2'))(_0xd3f9('0x3'));var moment=require(_0xd3f9('0x4'));var BPromise=require(_0xd3f9('0x5'));var rp=require(_0xd3f9('0x6'));var fs=require('fs');var path=require(_0xd3f9('0x7'));var rimraf=require(_0xd3f9('0x8'));var config=require(_0xd3f9('0x9'));var attributes=require('./teamVoiceQueue.attributes');module[_0xd3f9('0xa')]=function(_0x567a53,_0xadede5){return _0x567a53['define']('TeamVoiceQueue',attributes,{'tableName':_0xd3f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index b31341c..4e46f84 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 _0xfa1d=['http','then','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','randomstring','../../config/logger','rpc','jayson/promise','client'];(function(_0x2d44b8,_0x38229f){var _0x1f3f9f=function(_0x15f640){while(--_0x15f640){_0x2d44b8['push'](_0x2d44b8['shift']());}};_0x1f3f9f(++_0x38229f);}(_0xfa1d,0x1e6));var _0xdfa1=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xfa1d[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xdfa1('0x0'));var util=require(_0xdfa1('0x1'));var moment=require(_0xdfa1('0x2'));var BPromise=require('bluebird');var rs=require(_0xdfa1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdfa1('0x4'))(_0xdfa1('0x5'));var config=require('../../config/environment');var jayson=require(_0xdfa1('0x6'));var client=jayson[_0xdfa1('0x7')][_0xdfa1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53d910,_0x1d0fda,_0x16b761){return new BPromise(function(_0x78a7b3,_0x4952a9){return client['request'](_0x53d910,_0x16b761)[_0xdfa1('0x9')](function(_0x11c325){logger[_0xdfa1('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1d0fda,'request\x20sent');logger[_0xdfa1('0xb')](_0xdfa1('0xc'),_0x1d0fda,'request\x20sent',JSON['stringify'](_0x11c325));if(_0x11c325['error']){if(_0x11c325[_0xdfa1('0xd')][_0xdfa1('0xe')]===0x1f4){logger['error'](_0xdfa1('0xf'),_0x1d0fda,_0x11c325[_0xdfa1('0xd')][_0xdfa1('0x10')]);return _0x4952a9(_0x11c325['error'][_0xdfa1('0x10')]);}logger['error'](_0xdfa1('0xf'),_0x1d0fda,_0x11c325[_0xdfa1('0xd')][_0xdfa1('0x10')]);return _0x78a7b3(_0x11c325[_0xdfa1('0xd')][_0xdfa1('0x10')]);}else{logger[_0xdfa1('0xa')](_0xdfa1('0xf'),_0x1d0fda,_0xdfa1('0x11'));_0x78a7b3(_0x11c325[_0xdfa1('0x12')][_0xdfa1('0x10')]);}})['catch'](function(_0x383354){logger[_0xdfa1('0xd')](_0xdfa1('0xf'),_0x1d0fda,_0x383354);_0x4952a9(_0x383354);});});} \ No newline at end of file +var _0xcea2=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0xcea2,0x89));var _0x2cea=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xcea2[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2cea('0x0'));var BPromise=require(_0x2cea('0x1'));var rs=require(_0x2cea('0x2'));var fs=require('fs');var Redis=require(_0x2cea('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2cea('0x4'));var logger=require(_0x2cea('0x5'))(_0x2cea('0x6'));var config=require(_0x2cea('0x7'));var jayson=require(_0x2cea('0x8'));var client=jayson[_0x2cea('0x9')][_0x2cea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18bacb,_0x5e3633,_0x4d46d6){return new BPromise(function(_0x204f0f,_0x2787e8){return client[_0x2cea('0xb')](_0x18bacb,_0x4d46d6)[_0x2cea('0xc')](function(_0x26f02d){logger[_0x2cea('0xd')](_0x2cea('0xe'),_0x5e3633,_0x2cea('0xf'));logger[_0x2cea('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5e3633,_0x2cea('0xf'),JSON[_0x2cea('0x11')](_0x26f02d));if(_0x26f02d[_0x2cea('0x12')]){if(_0x26f02d['error'][_0x2cea('0x13')]===0x1f4){logger[_0x2cea('0x12')](_0x2cea('0xe'),_0x5e3633,_0x26f02d[_0x2cea('0x12')][_0x2cea('0x14')]);return _0x2787e8(_0x26f02d[_0x2cea('0x12')]['message']);}logger[_0x2cea('0x12')](_0x2cea('0xe'),_0x5e3633,_0x26f02d[_0x2cea('0x12')][_0x2cea('0x14')]);return _0x204f0f(_0x26f02d[_0x2cea('0x12')][_0x2cea('0x14')]);}else{logger[_0x2cea('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5e3633,_0x2cea('0xf'));_0x204f0f(_0x26f02d[_0x2cea('0x15')][_0x2cea('0x14')]);}})[_0x2cea('0x16')](function(_0x211501){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x5e3633,_0x211501);_0x2787e8(_0x211501);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index b7a7777..18738df 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 _0x2d17=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0xa0b622,_0xf68e91){var _0x4195aa=function(_0x2a8386){while(--_0x2a8386){_0xa0b622['push'](_0xa0b622['shift']());}};_0x4195aa(++_0xf68e91);}(_0x2d17,0x17e));var _0x72d1=function(_0xb8356b,_0x1bde01){_0xb8356b=_0xb8356b-0x0;var _0x542156=_0x2d17[_0xb8356b];return _0x542156;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./template.controller');router[_0x72d1('0x7')]('/',auth['isAuthenticated'](),controller[_0x72d1('0x8')]);router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x9')](),controller[_0x72d1('0xa')]);router[_0x72d1('0xb')]('/',auth['isAuthenticated'](),controller[_0x72d1('0xc')]);router[_0x72d1('0xd')](_0x72d1('0xe'),auth['isAuthenticated'](),controller[_0x72d1('0xf')]);router[_0x72d1('0x10')](_0x72d1('0xe'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x11')]);module[_0x72d1('0x12')]=router; \ No newline at end of file +var _0x207c=['fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','show','post','isAuthenticated','put','update','delete','util','path','connect-timeout','express','Router'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0x207c,0x1e8));var _0xc207=function(_0x5aff19,_0x1b2577){_0x5aff19=_0x5aff19-0x0;var _0x30d5ff=_0x207c[_0x5aff19];return _0x30d5ff;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./template.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0xc')]('/',auth[_0xc207('0xd')](),controller['create']);router[_0xc207('0xe')](_0xc207('0xa'),auth[_0xc207('0xd')](),controller[_0xc207('0xf')]);router[_0xc207('0x10')](_0xc207('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 70b8867..a7cbb8a 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 _0xff3c=['exports','STRING','TEXT','sequelize'];(function(_0x364cab,_0x35fa9e){var _0x5cdd1c=function(_0x5b33bb){while(--_0x5b33bb){_0x364cab['push'](_0x364cab['shift']());}};_0x5cdd1c(++_0x35fa9e);}(_0xff3c,0x1a3));var _0xcff3=function(_0xa2e16,_0x4a24c7){_0xa2e16=_0xa2e16-0x0;var _0x3b9c17=_0xff3c[_0xa2e16];return _0x3b9c17;};'use strict';var Sequelize=require(_0xcff3('0x0'));module[_0xcff3('0x1')]={'name':{'type':Sequelize[_0xcff3('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xcff3('0x3')]}}; \ No newline at end of file +var _0x0b57=['TEXT','sequelize','exports','STRING'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x0b57,0xb1));var _0x70b5=function(_0x4a4760,_0x7ce6b4){_0x4a4760=_0x4a4760-0x0;var _0x3c2c17=_0x0b57[_0x4a4760];return _0x3c2c17;};'use strict';var Sequelize=require(_0x70b5('0x0'));module[_0x70b5('0x1')]={'name':{'type':Sequelize[_0x70b5('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x70b5('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 2d829d4..89ecb22 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 _0xb647=['../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','get','Templates','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Template','rawAttributes','fieldName','model','keys','filters','attributes','intersection','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','fields','find','create','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x13f79f,_0x469e66){var _0x586358=function(_0x44a59e){while(--_0x44a59e){_0x13f79f['push'](_0x13f79f['shift']());}};_0x586358(++_0x469e66);}(_0xb647,0xdb));var _0x7b64=function(_0x18cce5,_0x42254d){_0x18cce5=_0x18cce5-0x0;var _0x544796=_0xb647[_0x18cce5];return _0x544796;};'use strict';var emlformat=require(_0x7b64('0x0'));var rimraf=require(_0x7b64('0x1'));var zipdir=require(_0x7b64('0x2'));var jsonpatch=require(_0x7b64('0x3'));var rp=require(_0x7b64('0x4'));var moment=require(_0x7b64('0x5'));var BPromise=require(_0x7b64('0x6'));var Mustache=require(_0x7b64('0x7'));var util=require('util');var path=require(_0x7b64('0x8'));var sox=require('sox');var csv=require(_0x7b64('0x9'));var ejs=require(_0x7b64('0xa'));var fs=require('fs');var fs_extra=require(_0x7b64('0xb'));var _=require(_0x7b64('0xc'));var squel=require(_0x7b64('0xd'));var crypto=require(_0x7b64('0xe'));var jsforce=require(_0x7b64('0xf'));var deskjs=require(_0x7b64('0x10'));var toCsv=require(_0x7b64('0x9'));var querystring=require('querystring');var Papa=require(_0x7b64('0x11'));var Redis=require('ioredis');var authService=require(_0x7b64('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b64('0x13'));var logger=require(_0x7b64('0x14'))('api');var utils=require(_0x7b64('0x15'));var config=require(_0x7b64('0x16'));var licenseUtil=require(_0x7b64('0x17'));var db=require(_0x7b64('0x18'))['db'];function respondWithStatusCode(_0x25e135,_0x432626){_0x432626=_0x432626||0xcc;return function(_0x5ea1dd){if(_0x5ea1dd){return _0x25e135['sendStatus'](_0x432626);}return _0x25e135[_0x7b64('0x19')](_0x432626)['end']();};}function respondWithResult(_0x530938,_0x2f21d8){_0x2f21d8=_0x2f21d8||0xc8;return function(_0x29a596){if(_0x29a596){return _0x530938[_0x7b64('0x19')](_0x2f21d8)[_0x7b64('0x1a')](_0x29a596);}};}function respondWithFilteredResult(_0x33ebe7,_0x437ddc){return function(_0x306a4e){if(_0x306a4e){var _0x519316=_0x306a4e[_0x7b64('0x1b')],_0xca026a=_0x437ddc[_0x7b64('0x1c')],_0x40066b=_0x437ddc['offset']+_0x437ddc[_0x7b64('0x1d')],_0x16ff72;if(_0x40066b>=_0x519316){_0x40066b=_0x519316;_0x16ff72=0xc8;}else{_0x16ff72=0xce;}_0x33ebe7[_0x7b64('0x19')](_0x16ff72);return _0x33ebe7['set'](_0x7b64('0x1e'),_0xca026a+'-'+_0x40066b+'/'+_0x519316)[_0x7b64('0x1a')](_0x306a4e);}return null;};}function patchUpdates(_0x5ef53f){return function(_0x23845e){try{jsonpatch[_0x7b64('0x1f')](_0x23845e,_0x5ef53f,!![]);}catch(_0x30d633){return BPromise[_0x7b64('0x20')](_0x30d633);}return _0x23845e['save']();};}function saveUpdates(_0x123a3b,_0x5c4135){return function(_0x4a7549){if(_0x4a7549){return _0x4a7549[_0x7b64('0x21')](_0x123a3b)['then'](function(_0x2d2d9a){return _0x2d2d9a;});}return null;};}function removeEntity(_0x587da6,_0x1bbd87){return function(_0x1ad95f){if(_0x1ad95f){return _0x1ad95f[_0x7b64('0x22')]()[_0x7b64('0x23')](function(){var _0x450b7e=_0x1ad95f[_0x7b64('0x24')]({'plain':!![]});var _0x215ea9=_0x7b64('0x25');return db[_0x7b64('0x26')][_0x7b64('0x22')]({'where':{'type':_0x215ea9,'resourceId':_0x450b7e['id']}})[_0x7b64('0x23')](function(){return _0x1ad95f;});})[_0x7b64('0x23')](function(){_0x587da6[_0x7b64('0x19')](0xcc)[_0x7b64('0x27')]();});}};}function handleEntityNotFound(_0x50d06c,_0xc61df8){return function(_0x5d9586){if(!_0x5d9586){_0x50d06c[_0x7b64('0x28')](0x194);}return _0x5d9586;};}function handleError(_0x21fbd3,_0x5c10ca){_0x5c10ca=_0x5c10ca||0x1f4;return function(_0x5acdb3){logger[_0x7b64('0x29')](_0x5acdb3[_0x7b64('0x2a')]);if(_0x5acdb3[_0x7b64('0x2b')]){delete _0x5acdb3[_0x7b64('0x2b')];}_0x21fbd3[_0x7b64('0x19')](_0x5c10ca)[_0x7b64('0x2c')](_0x5acdb3);};}exports[_0x7b64('0x2d')]=function(_0x2729f1,_0x53e29b){var _0x1616c9={},_0x2c4619={},_0x5d7fd9={'count':0x0,'rows':[]};var _0x6b1d0=_[_0x7b64('0x2e')](db[_0x7b64('0x2f')][_0x7b64('0x30')],function(_0x144327){return{'name':_0x144327[_0x7b64('0x31')],'type':_0x144327['type']['key']};});_0x2c4619[_0x7b64('0x32')]=_[_0x7b64('0x2e')](_0x6b1d0,'name');_0x2c4619['query']=_[_0x7b64('0x33')](_0x2729f1['query']);_0x2c4619[_0x7b64('0x34')]=_['intersection'](_0x2c4619['model'],_0x2c4619['query']);_0x1616c9[_0x7b64('0x35')]=_[_0x7b64('0x36')](_0x2c4619[_0x7b64('0x32')],qs['fields'](_0x2729f1[_0x7b64('0x37')]['fields']));_0x1616c9[_0x7b64('0x35')]=_0x1616c9[_0x7b64('0x35')][_0x7b64('0x38')]?_0x1616c9[_0x7b64('0x35')]:_0x2c4619[_0x7b64('0x32')];if(!_0x2729f1['query'][_0x7b64('0x39')](_0x7b64('0x3a'))){_0x1616c9[_0x7b64('0x1d')]=qs[_0x7b64('0x1d')](_0x2729f1['query'][_0x7b64('0x1d')]);_0x1616c9[_0x7b64('0x1c')]=qs[_0x7b64('0x1c')](_0x2729f1[_0x7b64('0x37')][_0x7b64('0x1c')]);}_0x1616c9[_0x7b64('0x3b')]=qs[_0x7b64('0x3c')](_0x2729f1['query']['sort']);_0x1616c9[_0x7b64('0x3d')]=qs[_0x7b64('0x34')](_[_0x7b64('0x3e')](_0x2729f1[_0x7b64('0x37')],_0x2c4619[_0x7b64('0x34')]),_0x6b1d0);if(_0x2729f1[_0x7b64('0x37')][_0x7b64('0x3f')]){_0x1616c9[_0x7b64('0x3d')]=_[_0x7b64('0x40')](_0x1616c9['where'],{'$or':_[_0x7b64('0x2e')](_0x6b1d0,function(_0x2e58b2){if(_0x2e58b2[_0x7b64('0x41')]!==_0x7b64('0x42')){var _0x3bf413={};_0x3bf413[_0x2e58b2[_0x7b64('0x2b')]]={'$like':'%'+_0x2729f1[_0x7b64('0x37')][_0x7b64('0x3f')]+'%'};return _0x3bf413;}})});}_0x1616c9=_[_0x7b64('0x40')]({},_0x1616c9,_0x2729f1[_0x7b64('0x43')]);var _0xb24499={'where':_0x1616c9[_0x7b64('0x3d')]};return db[_0x7b64('0x2f')][_0x7b64('0x1b')](_0xb24499)[_0x7b64('0x23')](function(_0x42cc06){_0x5d7fd9[_0x7b64('0x1b')]=_0x42cc06;if(_0x2729f1[_0x7b64('0x37')][_0x7b64('0x44')]){_0x1616c9[_0x7b64('0x45')]=[{'all':!![]}];}return db['Template'][_0x7b64('0x46')](_0x1616c9);})[_0x7b64('0x23')](function(_0x163580){_0x5d7fd9['rows']=_0x163580;return _0x5d7fd9;})[_0x7b64('0x23')](respondWithFilteredResult(_0x53e29b,_0x1616c9))[_0x7b64('0x47')](handleError(_0x53e29b,null));};exports['show']=function(_0x216c58,_0xf0d4a1){var _0x54d7d2={'raw':!![],'where':{'id':_0x216c58['params']['id']}},_0x132d39={};_0x132d39[_0x7b64('0x32')]=_[_0x7b64('0x33')](db[_0x7b64('0x2f')]['rawAttributes']);_0x132d39[_0x7b64('0x37')]=_[_0x7b64('0x33')](_0x216c58[_0x7b64('0x37')]);_0x132d39[_0x7b64('0x34')]=_[_0x7b64('0x36')](_0x132d39[_0x7b64('0x32')],_0x132d39['query']);_0x54d7d2[_0x7b64('0x35')]=_[_0x7b64('0x36')](_0x132d39[_0x7b64('0x32')],qs[_0x7b64('0x48')](_0x216c58[_0x7b64('0x37')]['fields']));_0x54d7d2['attributes']=_0x54d7d2['attributes']['length']?_0x54d7d2[_0x7b64('0x35')]:_0x132d39[_0x7b64('0x32')];if(_0x216c58[_0x7b64('0x37')][_0x7b64('0x44')]){_0x54d7d2[_0x7b64('0x45')]=[{'all':!![]}];}_0x54d7d2=_[_0x7b64('0x40')]({},_0x54d7d2,_0x216c58[_0x7b64('0x43')]);return db[_0x7b64('0x2f')][_0x7b64('0x49')](_0x54d7d2)[_0x7b64('0x23')](handleEntityNotFound(_0xf0d4a1,null))[_0x7b64('0x23')](respondWithResult(_0xf0d4a1,null))[_0x7b64('0x47')](handleError(_0xf0d4a1,null));};exports['create']=function(_0x4c2006,_0x31d364){return db[_0x7b64('0x2f')][_0x7b64('0x4a')](_0x4c2006[_0x7b64('0x4b')],{})[_0x7b64('0x23')](function(_0x5a8639){var _0x3e5321=_0x4c2006[_0x7b64('0x4c')][_0x7b64('0x24')]({'plain':!![]});if(!_0x3e5321)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e5321[_0x7b64('0x4d')]===_0x7b64('0x4c')){var _0x27c9f9=_0x5a8639[_0x7b64('0x24')]({'plain':!![]});var _0x18c5b0='Templates';return db[_0x7b64('0x4e')][_0x7b64('0x49')]({'where':{'name':_0x18c5b0,'userProfileId':_0x3e5321['userProfileId']},'raw':!![]})[_0x7b64('0x23')](function(_0x3dffa5){if(_0x3dffa5&&_0x3dffa5['autoAssociation']===0x0){return db[_0x7b64('0x26')][_0x7b64('0x4a')]({'name':_0x27c9f9[_0x7b64('0x2b')],'resourceId':_0x27c9f9['id'],'type':_0x3dffa5[_0x7b64('0x2b')],'sectionId':_0x3dffa5['id']},{})[_0x7b64('0x23')](function(){return _0x5a8639;});}else{return _0x5a8639;}})[_0x7b64('0x47')](function(_0x253b33){logger[_0x7b64('0x29')](_0x7b64('0x4f'),_0x253b33);throw _0x253b33;});}return _0x5a8639;})[_0x7b64('0x23')](respondWithResult(_0x31d364,0xc9))[_0x7b64('0x47')](handleError(_0x31d364,null));};exports[_0x7b64('0x21')]=function(_0x473aa3,_0x1ef736){if(_0x473aa3[_0x7b64('0x4b')]['id']){delete _0x473aa3[_0x7b64('0x4b')]['id'];}return db[_0x7b64('0x2f')][_0x7b64('0x49')]({'where':{'id':_0x473aa3['params']['id']}})[_0x7b64('0x23')](handleEntityNotFound(_0x1ef736,null))['then'](saveUpdates(_0x473aa3[_0x7b64('0x4b')],null))[_0x7b64('0x23')](respondWithResult(_0x1ef736,null))[_0x7b64('0x47')](handleError(_0x1ef736,null));};exports['destroy']=function(_0x5b4971,_0x3f16e5){return db['Template']['find']({'where':{'id':_0x5b4971[_0x7b64('0x50')]['id']}})[_0x7b64('0x23')](handleEntityNotFound(_0x3f16e5,null))[_0x7b64('0x23')](removeEntity(_0x3f16e5,null))['catch'](handleError(_0x3f16e5,null));}; \ No newline at end of file +var _0x7c8e=['rows','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','map','Template','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','filter','merge','type','options','includeAll','include','findAll'];(function(_0x24a956,_0x1a7a4f){var _0x38aac9=function(_0x12d778){while(--_0x12d778){_0x24a956['push'](_0x24a956['shift']());}};_0x38aac9(++_0x1a7a4f);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0x7c8e[_0x1fc84d];return _0x2658fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7c8('0x0'));var zipdir=require(_0xe7c8('0x1'));var jsonpatch=require(_0xe7c8('0x2'));var rp=require(_0xe7c8('0x3'));var moment=require(_0xe7c8('0x4'));var BPromise=require(_0xe7c8('0x5'));var Mustache=require(_0xe7c8('0x6'));var util=require(_0xe7c8('0x7'));var path=require(_0xe7c8('0x8'));var sox=require(_0xe7c8('0x9'));var csv=require(_0xe7c8('0xa'));var ejs=require(_0xe7c8('0xb'));var fs=require('fs');var fs_extra=require(_0xe7c8('0xc'));var _=require(_0xe7c8('0xd'));var squel=require(_0xe7c8('0xe'));var crypto=require(_0xe7c8('0xf'));var jsforce=require(_0xe7c8('0x10'));var deskjs=require(_0xe7c8('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe7c8('0x12'));var Papa=require(_0xe7c8('0x13'));var Redis=require(_0xe7c8('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe7c8('0x15'));var as=require(_0xe7c8('0x16'));var hardwareService=require(_0xe7c8('0x17'));var logger=require(_0xe7c8('0x18'))(_0xe7c8('0x19'));var utils=require(_0xe7c8('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe7c8('0x1b'))['db'];function respondWithStatusCode(_0xff3ec8,_0x40eb9d){_0x40eb9d=_0x40eb9d||0xcc;return function(_0x15d4f1){if(_0x15d4f1){return _0xff3ec8[_0xe7c8('0x1c')](_0x40eb9d);}return _0xff3ec8[_0xe7c8('0x1d')](_0x40eb9d)['end']();};}function respondWithResult(_0x53b2ac,_0x37c6be){_0x37c6be=_0x37c6be||0xc8;return function(_0x593bf1){if(_0x593bf1){return _0x53b2ac['status'](_0x37c6be)[_0xe7c8('0x1e')](_0x593bf1);}};}function respondWithFilteredResult(_0x3f4bcd,_0x564250){return function(_0x2f4efa){if(_0x2f4efa){var _0x58693e=_0x2f4efa[_0xe7c8('0x1f')],_0x4c6eda=_0x564250['offset'],_0x568d7a=_0x564250[_0xe7c8('0x20')]+_0x564250[_0xe7c8('0x21')],_0x52768d;if(_0x568d7a>=_0x58693e){_0x568d7a=_0x58693e;_0x52768d=0xc8;}else{_0x52768d=0xce;}_0x3f4bcd[_0xe7c8('0x1d')](_0x52768d);return _0x3f4bcd[_0xe7c8('0x22')](_0xe7c8('0x23'),_0x4c6eda+'-'+_0x568d7a+'/'+_0x58693e)[_0xe7c8('0x1e')](_0x2f4efa);}return null;};}function patchUpdates(_0x15e2d8){return function(_0x3797b0){try{jsonpatch[_0xe7c8('0x24')](_0x3797b0,_0x15e2d8,!![]);}catch(_0x5e7cd1){return BPromise[_0xe7c8('0x25')](_0x5e7cd1);}return _0x3797b0['save']();};}function saveUpdates(_0x105d6b,_0xdc9f3a){return function(_0x23f6d2){if(_0x23f6d2){return _0x23f6d2[_0xe7c8('0x26')](_0x105d6b)[_0xe7c8('0x27')](function(_0x3d20c4){return _0x3d20c4;});}return null;};}function removeEntity(_0x4093f2,_0x4093ef){return function(_0x35936c){if(_0x35936c){return _0x35936c[_0xe7c8('0x28')]()[_0xe7c8('0x27')](function(){var _0x8cbf0a=_0x35936c[_0xe7c8('0x29')]({'plain':!![]});var _0x392b79=_0xe7c8('0x2a');return db[_0xe7c8('0x2b')][_0xe7c8('0x28')]({'where':{'type':_0x392b79,'resourceId':_0x8cbf0a['id']}})['then'](function(){return _0x35936c;});})['then'](function(){_0x4093f2[_0xe7c8('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f0efc,_0x452c1d){return function(_0x3bf2bd){if(!_0x3bf2bd){_0x4f0efc[_0xe7c8('0x1c')](0x194);}return _0x3bf2bd;};}function handleError(_0x15c3aa,_0x477627){_0x477627=_0x477627||0x1f4;return function(_0x3e3d94){logger[_0xe7c8('0x2c')](_0x3e3d94[_0xe7c8('0x2d')]);if(_0x3e3d94[_0xe7c8('0x2e')]){delete _0x3e3d94['name'];}_0x15c3aa[_0xe7c8('0x1d')](_0x477627)[_0xe7c8('0x2f')](_0x3e3d94);};}exports['index']=function(_0x5d4753,_0xfd6b44){var _0x1c187e={},_0x3e57a7={},_0x5d5cab={'count':0x0,'rows':[]};var _0x15663f=_[_0xe7c8('0x30')](db[_0xe7c8('0x31')][_0xe7c8('0x32')],function(_0x277bd1){return{'name':_0x277bd1[_0xe7c8('0x33')],'type':_0x277bd1['type'][_0xe7c8('0x34')]};});_0x3e57a7['model']=_[_0xe7c8('0x30')](_0x15663f,_0xe7c8('0x2e'));_0x3e57a7[_0xe7c8('0x35')]=_[_0xe7c8('0x36')](_0x5d4753['query']);_0x3e57a7[_0xe7c8('0x37')]=_[_0xe7c8('0x38')](_0x3e57a7[_0xe7c8('0x39')],_0x3e57a7[_0xe7c8('0x35')]);_0x1c187e[_0xe7c8('0x3a')]=_['intersection'](_0x3e57a7['model'],qs[_0xe7c8('0x3b')](_0x5d4753[_0xe7c8('0x35')][_0xe7c8('0x3b')]));_0x1c187e[_0xe7c8('0x3a')]=_0x1c187e['attributes']['length']?_0x1c187e[_0xe7c8('0x3a')]:_0x3e57a7[_0xe7c8('0x39')];if(!_0x5d4753[_0xe7c8('0x35')][_0xe7c8('0x3c')]('nolimit')){_0x1c187e[_0xe7c8('0x21')]=qs[_0xe7c8('0x21')](_0x5d4753[_0xe7c8('0x35')][_0xe7c8('0x21')]);_0x1c187e[_0xe7c8('0x20')]=qs[_0xe7c8('0x20')](_0x5d4753['query'][_0xe7c8('0x20')]);}_0x1c187e['order']=qs['sort'](_0x5d4753[_0xe7c8('0x35')][_0xe7c8('0x3d')]);_0x1c187e[_0xe7c8('0x3e')]=qs['filters'](_['pick'](_0x5d4753[_0xe7c8('0x35')],_0x3e57a7['filters']),_0x15663f);if(_0x5d4753['query'][_0xe7c8('0x3f')]){_0x1c187e[_0xe7c8('0x3e')]=_[_0xe7c8('0x40')](_0x1c187e['where'],{'$or':_[_0xe7c8('0x30')](_0x15663f,function(_0x4ac62f){if(_0x4ac62f[_0xe7c8('0x41')]!=='VIRTUAL'){var _0x3b5087={};_0x3b5087[_0x4ac62f[_0xe7c8('0x2e')]]={'$like':'%'+_0x5d4753[_0xe7c8('0x35')]['filter']+'%'};return _0x3b5087;}})});}_0x1c187e=_[_0xe7c8('0x40')]({},_0x1c187e,_0x5d4753[_0xe7c8('0x42')]);var _0x4d365a={'where':_0x1c187e[_0xe7c8('0x3e')]};return db[_0xe7c8('0x31')][_0xe7c8('0x1f')](_0x4d365a)[_0xe7c8('0x27')](function(_0xb395ba){_0x5d5cab[_0xe7c8('0x1f')]=_0xb395ba;if(_0x5d4753[_0xe7c8('0x35')][_0xe7c8('0x43')]){_0x1c187e[_0xe7c8('0x44')]=[{'all':!![]}];}return db[_0xe7c8('0x31')][_0xe7c8('0x45')](_0x1c187e);})[_0xe7c8('0x27')](function(_0x28b322){_0x5d5cab[_0xe7c8('0x46')]=_0x28b322;return _0x5d5cab;})['then'](respondWithFilteredResult(_0xfd6b44,_0x1c187e))['catch'](handleError(_0xfd6b44,null));};exports[_0xe7c8('0x47')]=function(_0x41a431,_0x4fb96d){var _0x141976={'raw':!![],'where':{'id':_0x41a431[_0xe7c8('0x48')]['id']}},_0x3592f8={};_0x3592f8['model']=_['keys'](db['Template']['rawAttributes']);_0x3592f8['query']=_[_0xe7c8('0x36')](_0x41a431['query']);_0x3592f8[_0xe7c8('0x37')]=_[_0xe7c8('0x38')](_0x3592f8[_0xe7c8('0x39')],_0x3592f8[_0xe7c8('0x35')]);_0x141976[_0xe7c8('0x3a')]=_[_0xe7c8('0x38')](_0x3592f8[_0xe7c8('0x39')],qs[_0xe7c8('0x3b')](_0x41a431['query']['fields']));_0x141976[_0xe7c8('0x3a')]=_0x141976[_0xe7c8('0x3a')][_0xe7c8('0x49')]?_0x141976[_0xe7c8('0x3a')]:_0x3592f8[_0xe7c8('0x39')];if(_0x41a431['query'][_0xe7c8('0x43')]){_0x141976['include']=[{'all':!![]}];}_0x141976=_['merge']({},_0x141976,_0x41a431['options']);return db[_0xe7c8('0x31')][_0xe7c8('0x4a')](_0x141976)[_0xe7c8('0x27')](handleEntityNotFound(_0x4fb96d,null))[_0xe7c8('0x27')](respondWithResult(_0x4fb96d,null))['catch'](handleError(_0x4fb96d,null));};exports[_0xe7c8('0x4b')]=function(_0x19a58f,_0x2df765){return db[_0xe7c8('0x31')][_0xe7c8('0x4b')](_0x19a58f[_0xe7c8('0x4c')],{})[_0xe7c8('0x27')](function(_0x3dab82){var _0x57ccf4=_0x19a58f[_0xe7c8('0x4d')][_0xe7c8('0x29')]({'plain':!![]});if(!_0x57ccf4)throw new Error(_0xe7c8('0x4e'));if(_0x57ccf4[_0xe7c8('0x4f')]===_0xe7c8('0x4d')){var _0x59fe73=_0x3dab82['get']({'plain':!![]});var _0x1edc30=_0xe7c8('0x2a');return db[_0xe7c8('0x50')][_0xe7c8('0x4a')]({'where':{'name':_0x1edc30,'userProfileId':_0x57ccf4[_0xe7c8('0x51')]},'raw':!![]})['then'](function(_0xd587c8){if(_0xd587c8&&_0xd587c8[_0xe7c8('0x52')]===0x0){return db['UserProfileResource'][_0xe7c8('0x4b')]({'name':_0x59fe73['name'],'resourceId':_0x59fe73['id'],'type':_0xd587c8[_0xe7c8('0x2e')],'sectionId':_0xd587c8['id']},{})['then'](function(){return _0x3dab82;});}else{return _0x3dab82;}})['catch'](function(_0x153bd6){logger[_0xe7c8('0x2c')](_0xe7c8('0x53'),_0x153bd6);throw _0x153bd6;});}return _0x3dab82;})[_0xe7c8('0x27')](respondWithResult(_0x2df765,0xc9))[_0xe7c8('0x54')](handleError(_0x2df765,null));};exports[_0xe7c8('0x26')]=function(_0x5c64e7,_0x1b934c){if(_0x5c64e7['body']['id']){delete _0x5c64e7['body']['id'];}return db[_0xe7c8('0x31')][_0xe7c8('0x4a')]({'where':{'id':_0x5c64e7[_0xe7c8('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b934c,null))[_0xe7c8('0x27')](saveUpdates(_0x5c64e7[_0xe7c8('0x4c')],null))['then'](respondWithResult(_0x1b934c,null))[_0xe7c8('0x54')](handleError(_0x1b934c,null));};exports[_0xe7c8('0x28')]=function(_0x1642a9,_0x42d66c){return db[_0xe7c8('0x31')][_0xe7c8('0x4a')]({'where':{'id':_0x1642a9[_0xe7c8('0x48')]['id']}})[_0xe7c8('0x27')](handleEntityNotFound(_0x42d66c,null))[_0xe7c8('0x27')](removeEntity(_0x42d66c,null))[_0xe7c8('0x54')](handleError(_0x42d66c,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 17ab724..0e41a5a 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 _0xd208=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','define','Template','tools_templates'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0xd208,0xfd));var _0x8d20=function(_0x160396,_0x179dd1){_0x160396=_0x160396-0x0;var _0x3fd904=_0xd208[_0x160396];return _0x3fd904;};'use strict';var _=require(_0x8d20('0x0'));var util=require(_0x8d20('0x1'));var logger=require('../../config/logger')(_0x8d20('0x2'));var moment=require(_0x8d20('0x3'));var BPromise=require(_0x8d20('0x4'));var rp=require(_0x8d20('0x5'));var fs=require('fs');var path=require(_0x8d20('0x6'));var rimraf=require('rimraf');var config=require(_0x8d20('0x7'));var attributes=require('./template.attributes');module['exports']=function(_0x408ba7,_0x773c5b){return _0x408ba7[_0x8d20('0x8')](_0x8d20('0x9'),attributes,{'tableName':_0x8d20('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65fe=['../../config/environment','./template.attributes','define','Template','tools_templates','lodash','util','../../config/logger','api','bluebird','path'];(function(_0xcfc44,_0x179bc1){var _0x307a25=function(_0x2b64de){while(--_0x2b64de){_0xcfc44['push'](_0xcfc44['shift']());}};_0x307a25(++_0x179bc1);}(_0x65fe,0x1e9));var _0xe65f=function(_0x529a1b,_0x337f71){_0x529a1b=_0x529a1b-0x0;var _0x35071f=_0x65fe[_0x529a1b];return _0x35071f;};'use strict';var _=require(_0xe65f('0x0'));var util=require(_0xe65f('0x1'));var logger=require(_0xe65f('0x2'))(_0xe65f('0x3'));var moment=require('moment');var BPromise=require(_0xe65f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe65f('0x5'));var rimraf=require('rimraf');var config=require(_0xe65f('0x6'));var attributes=require(_0xe65f('0x7'));module['exports']=function(_0x24810f,_0xd8a860){return _0x24810f[_0xe65f('0x8')](_0xe65f('0x9'),attributes,{'tableName':_0xe65f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 8c70111..f9214dd 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 _0x2c65=['request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','map','include','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s'];(function(_0x585be4,_0x3d2c44){var _0x20977d=function(_0x34b1fc){while(--_0x34b1fc){_0x585be4['push'](_0x585be4['shift']());}};_0x20977d(++_0x3d2c44);}(_0x2c65,0x1f4));var _0x52c6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2c65[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x52c6('0x0'));var util=require(_0x52c6('0x1'));var moment=require('moment');var BPromise=require(_0x52c6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52c6('0x3'));var db=require(_0x52c6('0x4'))['db'];var utils=require(_0x52c6('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x52c6('0x6'));var client=jayson[_0x52c6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11dd9a,_0x3a16df,_0x27a705){return new BPromise(function(_0x50f7d,_0x33bebb){return client[_0x52c6('0x8')](_0x11dd9a,_0x27a705)[_0x52c6('0x9')](function(_0x431b43){logger[_0x52c6('0xa')](_0x52c6('0xb'),_0x3a16df,_0x52c6('0xc'));logger[_0x52c6('0xd')](_0x52c6('0xe'),_0x3a16df,_0x52c6('0xc'),JSON[_0x52c6('0xf')](_0x431b43));if(_0x431b43[_0x52c6('0x10')]){if(_0x431b43[_0x52c6('0x10')][_0x52c6('0x11')]===0x1f4){logger['error'](_0x52c6('0xb'),_0x3a16df,_0x431b43[_0x52c6('0x10')][_0x52c6('0x12')]);return _0x33bebb(_0x431b43['error'][_0x52c6('0x12')]);}logger[_0x52c6('0x10')]('Template,\x20%s,\x20%s',_0x3a16df,_0x431b43[_0x52c6('0x10')][_0x52c6('0x12')]);return _0x50f7d(_0x431b43['error']['message']);}else{logger[_0x52c6('0xa')]('Template,\x20%s,\x20%s',_0x3a16df,_0x52c6('0xc'));_0x50f7d(_0x431b43[_0x52c6('0x13')][_0x52c6('0x12')]);}})[_0x52c6('0x14')](function(_0x1b9501){logger[_0x52c6('0x10')](_0x52c6('0xb'),_0x3a16df,_0x1b9501);_0x33bebb(_0x1b9501);});});}exports[_0x52c6('0x15')]=function(_0x2af73b){var _0x235302=this;return new Promise(function(_0xef9fae,_0x4ba4f1){return db[_0x52c6('0x16')][_0x52c6('0x17')]({'raw':_0x2af73b[_0x52c6('0x18')]?_0x2af73b[_0x52c6('0x18')][_0x52c6('0x19')]===undefined?!![]:![]:!![],'where':_0x2af73b[_0x52c6('0x18')]?_0x2af73b[_0x52c6('0x18')][_0x52c6('0x1a')]||null:null,'attributes':_0x2af73b[_0x52c6('0x18')]?_0x2af73b['options'][_0x52c6('0x1b')]||null:null,'limit':_0x2af73b[_0x52c6('0x18')]?_0x2af73b['options'][_0x52c6('0x1c')]||null:null,'include':_0x2af73b[_0x52c6('0x18')]?_0x2af73b[_0x52c6('0x18')]['include']?_[_0x52c6('0x1d')](_0x2af73b[_0x52c6('0x18')][_0x52c6('0x1e')],function(_0x1269e0){return{'model':db[_0x1269e0['model']],'as':_0x1269e0['as'],'attributes':_0x1269e0[_0x52c6('0x1b')],'include':_0x1269e0['include']?_[_0x52c6('0x1d')](_0x1269e0[_0x52c6('0x1e')],function(_0x59e7cb){return{'model':db[_0x59e7cb[_0x52c6('0x1f')]],'as':_0x59e7cb['as'],'attributes':_0x59e7cb['attributes'],'include':_0x59e7cb[_0x52c6('0x1e')]?_[_0x52c6('0x1d')](_0x59e7cb['include'],function(_0x1c55f5){return{'model':db[_0x1c55f5[_0x52c6('0x1f')]],'as':_0x1c55f5['as'],'attributes':_0x1c55f5['attributes']};}):[]};}):[]};}):[]:[]})[_0x52c6('0x9')](function(_0x5179b8){logger['info'](_0x52c6('0x15'),_0x2af73b);logger[_0x52c6('0xd')](_0x52c6('0x15'),_0x2af73b,JSON[_0x52c6('0xf')](_0x5179b8));_0xef9fae(_0x5179b8);})['catch'](function(_0x899fd8){logger[_0x52c6('0x10')]('GetTemplate',_0x899fd8[_0x52c6('0x12')],_0x2af73b);_0x4ba4f1(_0x235302['error'](0x1f4,_0x899fd8[_0x52c6('0x12')]));});});}; \ No newline at end of file +var _0x229d=['../../mysqldb','../../config/utils','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTemplate','options','where','attributes','limit','include','map','model','stringify','lodash','util','bluebird','randomstring','ioredis'];(function(_0x1fe21b,_0x32030d){var _0x443ccd=function(_0x304d03){while(--_0x304d03){_0x1fe21b['push'](_0x1fe21b['shift']());}};_0x443ccd(++_0x32030d);}(_0x229d,0x19b));var _0xd229=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x229d[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xd229('0x0'));var util=require(_0xd229('0x1'));var moment=require('moment');var BPromise=require(_0xd229('0x2'));var rs=require(_0xd229('0x3'));var fs=require('fs');var Redis=require(_0xd229('0x4'));var db=require(_0xd229('0x5'))['db'];var utils=require(_0xd229('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2010ab,_0x3a09cb,_0x393a4d){return new BPromise(function(_0x1d91ba,_0x2a83c1){return client['request'](_0x2010ab,_0x393a4d)[_0xd229('0x7')](function(_0x98d5ca){logger['info'](_0xd229('0x8'),_0x3a09cb,_0xd229('0x9'));logger[_0xd229('0xa')](_0xd229('0xb'),_0x3a09cb,_0xd229('0x9'),JSON['stringify'](_0x98d5ca));if(_0x98d5ca['error']){if(_0x98d5ca[_0xd229('0xc')][_0xd229('0xd')]===0x1f4){logger[_0xd229('0xc')](_0xd229('0x8'),_0x3a09cb,_0x98d5ca[_0xd229('0xc')][_0xd229('0xe')]);return _0x2a83c1(_0x98d5ca[_0xd229('0xc')][_0xd229('0xe')]);}logger[_0xd229('0xc')](_0xd229('0x8'),_0x3a09cb,_0x98d5ca['error'][_0xd229('0xe')]);return _0x1d91ba(_0x98d5ca[_0xd229('0xc')]['message']);}else{logger['info'](_0xd229('0x8'),_0x3a09cb,_0xd229('0x9'));_0x1d91ba(_0x98d5ca[_0xd229('0xf')][_0xd229('0xe')]);}})[_0xd229('0x10')](function(_0x4d13a4){logger['error'](_0xd229('0x8'),_0x3a09cb,_0x4d13a4);_0x2a83c1(_0x4d13a4);});});}exports[_0xd229('0x11')]=function(_0xf32b47){var _0x5da333=this;return new Promise(function(_0x3d11af,_0x49fce8){return db['Template']['findAll']({'raw':_0xf32b47['options']?_0xf32b47[_0xd229('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0xf32b47[_0xd229('0x12')]?_0xf32b47[_0xd229('0x12')][_0xd229('0x13')]||null:null,'attributes':_0xf32b47[_0xd229('0x12')]?_0xf32b47[_0xd229('0x12')][_0xd229('0x14')]||null:null,'limit':_0xf32b47[_0xd229('0x12')]?_0xf32b47[_0xd229('0x12')][_0xd229('0x15')]||null:null,'include':_0xf32b47[_0xd229('0x12')]?_0xf32b47[_0xd229('0x12')][_0xd229('0x16')]?_[_0xd229('0x17')](_0xf32b47['options']['include'],function(_0x478493){return{'model':db[_0x478493[_0xd229('0x18')]],'as':_0x478493['as'],'attributes':_0x478493[_0xd229('0x14')],'include':_0x478493[_0xd229('0x16')]?_[_0xd229('0x17')](_0x478493[_0xd229('0x16')],function(_0x16536c){return{'model':db[_0x16536c['model']],'as':_0x16536c['as'],'attributes':_0x16536c[_0xd229('0x14')],'include':_0x16536c['include']?_['map'](_0x16536c[_0xd229('0x16')],function(_0x1b3abd){return{'model':db[_0x1b3abd[_0xd229('0x18')]],'as':_0x1b3abd['as'],'attributes':_0x1b3abd[_0xd229('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x247924){logger['info'](_0xd229('0x11'),_0xf32b47);logger[_0xd229('0xa')]('GetTemplate',_0xf32b47,JSON[_0xd229('0x19')](_0x247924));_0x3d11af(_0x247924);})[_0xd229('0x10')](function(_0x1271d6){logger['error'](_0xd229('0x11'),_0x1271d6[_0xd229('0xe')],_0xf32b47);_0x49fce8(_0x5da333['error'](0x1f4,_0x1271d6[_0xd229('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 769d017..1b7fb5e 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 _0x68cf=['/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','addAction','/:id','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','./trigger.controller','get','isAuthenticated','show'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x68cf,0x117));var _0xf68c=function(_0x16ed87,_0x3ccf0b){_0x16ed87=_0x16ed87-0x0;var _0x493ba7=_0x68cf[_0x16ed87];return _0x493ba7;};'use strict';var multer=require(_0xf68c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf68c('0x1'));var express=require(_0xf68c('0x2'));var router=express['Router']();var fs_extra=require(_0xf68c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf68c('0x4'));var config=require('../../config/environment');var controller=require(_0xf68c('0x5'));router[_0xf68c('0x6')]('/',auth[_0xf68c('0x7')](),controller['index']);router[_0xf68c('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xf68c('0x8')]);router[_0xf68c('0x6')](_0xf68c('0x9'),auth[_0xf68c('0x7')](),controller[_0xf68c('0xa')]);router['get'](_0xf68c('0xb'),auth['isAuthenticated'](),controller[_0xf68c('0xc')]);router[_0xf68c('0x6')](_0xf68c('0xd'),auth[_0xf68c('0x7')](),controller[_0xf68c('0xe')]);router[_0xf68c('0xf')]('/',auth[_0xf68c('0x7')](),controller[_0xf68c('0x10')]);router[_0xf68c('0xf')](_0xf68c('0x9'),auth[_0xf68c('0x7')](),controller['addAllCondition']);router[_0xf68c('0xf')](_0xf68c('0xb'),auth[_0xf68c('0x7')](),controller[_0xf68c('0x11')]);router[_0xf68c('0xf')](_0xf68c('0xd'),auth[_0xf68c('0x7')](),controller[_0xf68c('0x12')]);router['put'](_0xf68c('0x13'),auth[_0xf68c('0x7')](),controller[_0xf68c('0x14')]);router[_0xf68c('0x15')](_0xf68c('0x13'),auth[_0xf68c('0x7')](),controller[_0xf68c('0x16')]);module[_0xf68c('0x17')]=router; \ No newline at end of file +var _0x84e9=['./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x84e9,0x180));var _0x984e=function(_0x566350,_0x1e4817){_0x566350=_0x566350-0x0;var _0x548590=_0x84e9[_0x566350];return _0x548590;};'use strict';var multer=require(_0x984e('0x0'));var util=require(_0x984e('0x1'));var path=require(_0x984e('0x2'));var timeout=require(_0x984e('0x3'));var express=require(_0x984e('0x4'));var router=express['Router']();var fs_extra=require(_0x984e('0x5'));var auth=require(_0x984e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x984e('0x7'));var controller=require(_0x984e('0x8'));router[_0x984e('0x9')]('/',auth['isAuthenticated'](),controller[_0x984e('0xa')]);router[_0x984e('0x9')](_0x984e('0xb'),auth[_0x984e('0xc')](),controller[_0x984e('0xd')]);router[_0x984e('0x9')](_0x984e('0xe'),auth[_0x984e('0xc')](),controller['getAllConditions']);router['get'](_0x984e('0xf'),auth['isAuthenticated'](),controller[_0x984e('0x10')]);router[_0x984e('0x9')](_0x984e('0x11'),auth['isAuthenticated'](),controller[_0x984e('0x12')]);router[_0x984e('0x13')]('/',auth[_0x984e('0xc')](),controller[_0x984e('0x14')]);router[_0x984e('0x13')](_0x984e('0xe'),auth[_0x984e('0xc')](),controller[_0x984e('0x15')]);router[_0x984e('0x13')]('/:id/any_conditions',auth[_0x984e('0xc')](),controller[_0x984e('0x16')]);router[_0x984e('0x13')](_0x984e('0x11'),auth[_0x984e('0xc')](),controller[_0x984e('0x17')]);router['put'](_0x984e('0xb'),auth['isAuthenticated'](),controller[_0x984e('0x18')]);router[_0x984e('0x19')](_0x984e('0xb'),auth[_0x984e('0xc')](),controller[_0x984e('0x1a')]);module[_0x984e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 2bed8f3..09c9f46 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 _0x46ae=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x46ae,0xbb));var _0xe46a=function(_0x43faed,_0xb360cc){_0x43faed=_0x43faed-0x0;var _0x56ee45=_0x46ae[_0x43faed];return _0x56ee45;};'use strict';var Sequelize=require(_0xe46a('0x0'));module[_0xe46a('0x1')]={'name':{'type':Sequelize[_0xe46a('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe46a('0x2')]},'status':{'type':Sequelize[_0xe46a('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0e9d=['STRING','BOOLEAN','sequelize','exports'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x0e9d,0x19e));var _0xd0e9=function(_0x5cdd70,_0x17d6f3){_0x5cdd70=_0x5cdd70-0x0;var _0x1d1267=_0x0e9d[_0x5cdd70];return _0x1d1267;};'use strict';var Sequelize=require(_0xd0e9('0x0'));module[_0xd0e9('0x1')]={'name':{'type':Sequelize[_0xd0e9('0x2')]},'channel':{'type':Sequelize[_0xd0e9('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xd0e9('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 77ff746..c743230 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 _0x852a=['VIRTUAL','Trigger','includeAll','include','rows','catch','show','params','intersection','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','pick','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','count','offset','limit','set','json','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0x852a,0x7c));var _0xa852=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x852a[_0x31cb5f];return _0x586042;};'use strict';var emlformat=require(_0xa852('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa852('0x1'));var jsonpatch=require(_0xa852('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa852('0x3'));var Mustache=require(_0xa852('0x4'));var util=require(_0xa852('0x5'));var path=require(_0xa852('0x6'));var sox=require(_0xa852('0x7'));var csv=require(_0xa852('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa852('0x9'));var _=require(_0xa852('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa852('0xb'));var deskjs=require(_0xa852('0xc'));var toCsv=require(_0xa852('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa852('0xd'));var authService=require(_0xa852('0xe'));var qs=require(_0xa852('0xf'));var as=require(_0xa852('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa852('0x11'))(_0xa852('0x12'));var utils=require(_0xa852('0x13'));var config=require(_0xa852('0x14'));var licenseUtil=require(_0xa852('0x15'));var db=require(_0xa852('0x16'))['db'];function respondWithStatusCode(_0x34dbd7,_0x199582){_0x199582=_0x199582||0xcc;return function(_0x569aed){if(_0x569aed){return _0x34dbd7[_0xa852('0x17')](_0x199582);}return _0x34dbd7['status'](_0x199582)[_0xa852('0x18')]();};}function respondWithResult(_0x426cea,_0x55e9cd){_0x55e9cd=_0x55e9cd||0xc8;return function(_0x62f0db){if(_0x62f0db){return _0x426cea[_0xa852('0x19')](_0x55e9cd)['json'](_0x62f0db);}};}function respondWithFilteredResult(_0x2c881b,_0x3b1970){return function(_0x471147){if(_0x471147){var _0x520af1=_0x471147[_0xa852('0x1a')],_0x53ce5d=_0x3b1970[_0xa852('0x1b')],_0x2d4966=_0x3b1970[_0xa852('0x1b')]+_0x3b1970[_0xa852('0x1c')],_0x3d5d22;if(_0x2d4966>=_0x520af1){_0x2d4966=_0x520af1;_0x3d5d22=0xc8;}else{_0x3d5d22=0xce;}_0x2c881b[_0xa852('0x19')](_0x3d5d22);return _0x2c881b[_0xa852('0x1d')]('Content-Range',_0x53ce5d+'-'+_0x2d4966+'/'+_0x520af1)[_0xa852('0x1e')](_0x471147);}return null;};}function patchUpdates(_0xea5f44){return function(_0x5f3af4){try{jsonpatch['apply'](_0x5f3af4,_0xea5f44,!![]);}catch(_0x21e017){return BPromise[_0xa852('0x1f')](_0x21e017);}return _0x5f3af4[_0xa852('0x20')]();};}function saveUpdates(_0x54c253,_0x1b0324){return function(_0x50604e){if(_0x50604e){return _0x50604e[_0xa852('0x21')](_0x54c253)[_0xa852('0x22')](function(_0x2e3208){return _0x2e3208;});}return null;};}function removeEntity(_0x2879e4,_0x31484e){return function(_0x48f851){if(_0x48f851){return _0x48f851[_0xa852('0x23')]()[_0xa852('0x22')](function(){var _0x235178=_0x48f851[_0xa852('0x24')]({'plain':!![]});var _0x29aa8e=_0xa852('0x25');return db[_0xa852('0x26')][_0xa852('0x23')]({'where':{'type':_0x29aa8e,'resourceId':_0x235178['id']}})[_0xa852('0x22')](function(){return _0x48f851;});})[_0xa852('0x22')](function(){_0x2879e4[_0xa852('0x19')](0xcc)[_0xa852('0x18')]();});}};}function handleEntityNotFound(_0x2a7f17,_0x14cc29){return function(_0x3725e7){if(!_0x3725e7){_0x2a7f17['sendStatus'](0x194);}return _0x3725e7;};}function handleError(_0xaef096,_0x992bea){_0x992bea=_0x992bea||0x1f4;return function(_0x48f2cb){logger[_0xa852('0x27')](_0x48f2cb['stack']);if(_0x48f2cb[_0xa852('0x28')]){delete _0x48f2cb[_0xa852('0x28')];}_0xaef096[_0xa852('0x19')](_0x992bea)[_0xa852('0x29')](_0x48f2cb);};}exports[_0xa852('0x2a')]=function(_0x8e801d,_0x21c0b0){var _0x4444ef={},_0x55415c={},_0x50311a={'count':0x0,'rows':[]};var _0x57b7a3=_['map'](db['Trigger'][_0xa852('0x2b')],function(_0xa91b61){return{'name':_0xa91b61[_0xa852('0x2c')],'type':_0xa91b61['type'][_0xa852('0x2d')]};});_0x55415c[_0xa852('0x2e')]=_[_0xa852('0x2f')](_0x57b7a3,_0xa852('0x28'));_0x55415c[_0xa852('0x30')]=_[_0xa852('0x31')](_0x8e801d[_0xa852('0x30')]);_0x55415c[_0xa852('0x32')]=_['intersection'](_0x55415c[_0xa852('0x2e')],_0x55415c['query']);_0x4444ef[_0xa852('0x33')]=_['intersection'](_0x55415c[_0xa852('0x2e')],qs[_0xa852('0x34')](_0x8e801d[_0xa852('0x30')][_0xa852('0x34')]));_0x4444ef['attributes']=_0x4444ef[_0xa852('0x33')][_0xa852('0x35')]?_0x4444ef[_0xa852('0x33')]:_0x55415c[_0xa852('0x2e')];if(!_0x8e801d['query'][_0xa852('0x36')](_0xa852('0x37'))){_0x4444ef[_0xa852('0x1c')]=qs[_0xa852('0x1c')](_0x8e801d[_0xa852('0x30')]['limit']);_0x4444ef[_0xa852('0x1b')]=qs[_0xa852('0x1b')](_0x8e801d[_0xa852('0x30')][_0xa852('0x1b')]);}_0x4444ef[_0xa852('0x38')]=qs[_0xa852('0x39')](_0x8e801d['query'][_0xa852('0x39')]);_0x4444ef['where']=qs[_0xa852('0x32')](_['pick'](_0x8e801d['query'],_0x55415c[_0xa852('0x32')]),_0x57b7a3);if(_0x8e801d[_0xa852('0x30')][_0xa852('0x3a')]){_0x4444ef[_0xa852('0x3b')]=_[_0xa852('0x3c')](_0x4444ef[_0xa852('0x3b')],{'$or':_[_0xa852('0x2f')](_0x57b7a3,function(_0x5ef2dc){if(_0x5ef2dc[_0xa852('0x3d')]!==_0xa852('0x3e')){var _0x3cf202={};_0x3cf202[_0x5ef2dc[_0xa852('0x28')]]={'$like':'%'+_0x8e801d[_0xa852('0x30')][_0xa852('0x3a')]+'%'};return _0x3cf202;}})});}_0x4444ef=_[_0xa852('0x3c')]({},_0x4444ef,_0x8e801d['options']);var _0x5f739={'where':_0x4444ef[_0xa852('0x3b')]};return db[_0xa852('0x3f')][_0xa852('0x1a')](_0x5f739)[_0xa852('0x22')](function(_0x5056f0){_0x50311a['count']=_0x5056f0;if(_0x8e801d[_0xa852('0x30')][_0xa852('0x40')]){_0x4444ef[_0xa852('0x41')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x4444ef);})[_0xa852('0x22')](function(_0x308ed6){_0x50311a[_0xa852('0x42')]=_0x308ed6;return _0x50311a;})[_0xa852('0x22')](respondWithFilteredResult(_0x21c0b0,_0x4444ef))[_0xa852('0x43')](handleError(_0x21c0b0,null));};exports[_0xa852('0x44')]=function(_0x599b10,_0x33181f){var _0x205aa1={'raw':![],'where':{'id':_0x599b10[_0xa852('0x45')]['id']}},_0x17caa3={};_0x17caa3['model']=_[_0xa852('0x31')](db[_0xa852('0x3f')]['rawAttributes']);_0x17caa3[_0xa852('0x30')]=_[_0xa852('0x31')](_0x599b10[_0xa852('0x30')]);_0x17caa3[_0xa852('0x32')]=_[_0xa852('0x46')](_0x17caa3[_0xa852('0x2e')],_0x17caa3[_0xa852('0x30')]);_0x205aa1[_0xa852('0x33')]=_[_0xa852('0x46')](_0x17caa3['model'],qs[_0xa852('0x34')](_0x599b10[_0xa852('0x30')]['fields']));_0x205aa1[_0xa852('0x33')]=_0x205aa1[_0xa852('0x33')][_0xa852('0x35')]?_0x205aa1[_0xa852('0x33')]:_0x17caa3[_0xa852('0x2e')];if(_0x599b10[_0xa852('0x30')][_0xa852('0x40')]){_0x205aa1['include']=[{'all':!![]}];}_0x205aa1=_[_0xa852('0x3c')]({},_0x205aa1,_0x599b10[_0xa852('0x47')]);return db[_0xa852('0x3f')]['find'](_0x205aa1)[_0xa852('0x22')](handleEntityNotFound(_0x33181f,null))['then'](respondWithResult(_0x33181f,null))[_0xa852('0x43')](handleError(_0x33181f,null));};exports[_0xa852('0x48')]=function(_0x343f41,_0x125e0d){return db[_0xa852('0x3f')]['create'](_0x343f41[_0xa852('0x49')],{})[_0xa852('0x22')](function(_0x472029){var _0x508cdb=_0x343f41[_0xa852('0x4a')][_0xa852('0x24')]({'plain':!![]});if(!_0x508cdb)throw new Error(_0xa852('0x4b'));if(_0x508cdb[_0xa852('0x4c')]===_0xa852('0x4a')){var _0x5ba520=_0x472029['get']({'plain':!![]});var _0x110985=_0xa852('0x25');return db['UserProfileSection'][_0xa852('0x4d')]({'where':{'name':_0x110985,'userProfileId':_0x508cdb[_0xa852('0x4e')]},'raw':!![]})[_0xa852('0x22')](function(_0x557ad2){if(_0x557ad2&&_0x557ad2['autoAssociation']===0x0){return db[_0xa852('0x26')][_0xa852('0x48')]({'name':_0x5ba520[_0xa852('0x28')],'resourceId':_0x5ba520['id'],'type':_0x557ad2[_0xa852('0x28')],'sectionId':_0x557ad2['id']},{})['then'](function(){return _0x472029;});}else{return _0x472029;}})[_0xa852('0x43')](function(_0x81e39c){logger[_0xa852('0x27')](_0xa852('0x4f'),_0x81e39c);throw _0x81e39c;});}return _0x472029;})[_0xa852('0x22')](respondWithResult(_0x125e0d,0xc9))['catch'](handleError(_0x125e0d,null));};exports['update']=function(_0x2d1524,_0x4c7bc6){if(_0x2d1524[_0xa852('0x49')]['id']){delete _0x2d1524['body']['id'];}return db[_0xa852('0x3f')][_0xa852('0x4d')]({'where':{'id':_0x2d1524[_0xa852('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c7bc6,null))[_0xa852('0x22')](saveUpdates(_0x2d1524[_0xa852('0x49')],null))['then'](respondWithResult(_0x4c7bc6,null))['catch'](handleError(_0x4c7bc6,null));};exports[_0xa852('0x23')]=function(_0x4087d9,_0x549bfc){return db[_0xa852('0x3f')]['find']({'where':{'id':_0x4087d9[_0xa852('0x45')]['id']}})[_0xa852('0x22')](handleEntityNotFound(_0x549bfc,null))[_0xa852('0x22')](removeEntity(_0x549bfc,null))[_0xa852('0x43')](handleError(_0x549bfc,null));};exports[_0xa852('0x50')]=function(_0x2ee8b1,_0xe9baa0,_0x3095cd){if(_0x2ee8b1['body']['id']){delete _0x2ee8b1['body']['id'];}return db[_0xa852('0x3f')]['find']({'where':{'id':_0x2ee8b1[_0xa852('0x45')]['id']}})[_0xa852('0x22')](handleEntityNotFound(_0xe9baa0,null))['then'](function(_0x413ff5){if(_0x413ff5){_0x2ee8b1[_0xa852('0x49')][_0xa852('0x51')]=_0x413ff5['id'];return db[_0xa852('0x52')]['create'](_0x2ee8b1[_0xa852('0x49')]);}})[_0xa852('0x22')](respondWithResult(_0xe9baa0,null))[_0xa852('0x43')](handleError(_0xe9baa0,null));};exports[_0xa852('0x53')]=function(_0x1a4eeb,_0x30fb2f,_0x45d916){if(_0x1a4eeb[_0xa852('0x49')]['id']){delete _0x1a4eeb[_0xa852('0x49')]['id'];}return db[_0xa852('0x3f')][_0xa852('0x4d')]({'where':{'id':_0x1a4eeb['params']['id']}})[_0xa852('0x22')](handleEntityNotFound(_0x30fb2f,null))[_0xa852('0x22')](function(_0x387092){if(_0x387092){_0x1a4eeb[_0xa852('0x49')][_0xa852('0x54')]=_0x387092['id'];return db[_0xa852('0x52')][_0xa852('0x48')](_0x1a4eeb[_0xa852('0x49')]);}})[_0xa852('0x22')](respondWithResult(_0x30fb2f,null))[_0xa852('0x43')](handleError(_0x30fb2f,null));};exports[_0xa852('0x55')]=function(_0x144834,_0x1b748c,_0x3308aa){var _0x1679a5={};var _0x4fc426={};var _0x38a426;var _0x3c0e88;return db[_0xa852('0x3f')]['findOne']({'where':{'id':_0x144834[_0xa852('0x45')]['id']}})[_0xa852('0x22')](handleEntityNotFound(_0x1b748c,null))['then'](function(_0x158566){if(_0x158566){_0x38a426=_0x158566;_0x4fc426[_0xa852('0x2e')]=_['keys'](db[_0xa852('0x52')][_0xa852('0x2b')]);_0x4fc426[_0xa852('0x30')]=_[_0xa852('0x31')](_0x144834[_0xa852('0x30')]);_0x4fc426[_0xa852('0x32')]=_[_0xa852('0x46')](_0x4fc426[_0xa852('0x2e')],_0x4fc426[_0xa852('0x30')]);_0x1679a5[_0xa852('0x33')]=_['intersection'](_0x4fc426[_0xa852('0x2e')],qs[_0xa852('0x34')](_0x144834[_0xa852('0x30')]['fields']));_0x1679a5[_0xa852('0x33')]=_0x1679a5[_0xa852('0x33')][_0xa852('0x35')]?_0x1679a5['attributes']:_0x4fc426[_0xa852('0x2e')];_0x1679a5['order']=qs[_0xa852('0x39')](_0x144834[_0xa852('0x30')][_0xa852('0x39')]);_0x1679a5[_0xa852('0x3b')]=qs[_0xa852('0x32')](_[_0xa852('0x56')](_0x144834['query'],_0x4fc426[_0xa852('0x32')]));if(_0x144834[_0xa852('0x30')]['filter']){_0x1679a5[_0xa852('0x3b')]=_[_0xa852('0x3c')](_0x1679a5[_0xa852('0x3b')],{'$or':_[_0xa852('0x2f')](_0x1679a5[_0xa852('0x33')],function(_0x5e18f0){var _0x4e2b9c={};_0x4e2b9c[_0x5e18f0]={'$like':'%'+_0x144834['query'][_0xa852('0x3a')]+'%'};return _0x4e2b9c;})});}_0x1679a5=_[_0xa852('0x3c')]({},_0x1679a5,_0x144834[_0xa852('0x47')]);return _0x38a426['getAllConditions'](_0x1679a5);}})[_0xa852('0x22')](function(_0x5eca9c){if(_0x5eca9c){_0x3c0e88=_0x5eca9c[_0xa852('0x35')];if(!_0x144834[_0xa852('0x30')][_0xa852('0x36')](_0xa852('0x37'))){_0x1679a5['limit']=qs['limit'](_0x144834['query']['limit']);_0x1679a5[_0xa852('0x1b')]=qs['offset'](_0x144834[_0xa852('0x30')][_0xa852('0x1b')]);}return _0x38a426['getAllConditions'](_0x1679a5);}})[_0xa852('0x22')](function(_0x27e970){if(_0x27e970){return _0x27e970?{'count':_0x3c0e88,'rows':_0x27e970}:null;}})[_0xa852('0x22')](respondWithResult(_0x1b748c,null))['catch'](handleError(_0x1b748c,null));};exports[_0xa852('0x57')]=function(_0x1267fc,_0x235c6a,_0x2ab75a){var _0x5189fa={};var _0x42d3c5={};var _0x53b224;var _0x41e1a0;return db[_0xa852('0x3f')][_0xa852('0x58')]({'where':{'id':_0x1267fc[_0xa852('0x45')]['id']}})[_0xa852('0x22')](handleEntityNotFound(_0x235c6a,null))[_0xa852('0x22')](function(_0x44cd97){if(_0x44cd97){_0x53b224=_0x44cd97;_0x42d3c5[_0xa852('0x2e')]=_[_0xa852('0x31')](db[_0xa852('0x52')][_0xa852('0x2b')]);_0x42d3c5[_0xa852('0x30')]=_['keys'](_0x1267fc['query']);_0x42d3c5[_0xa852('0x32')]=_[_0xa852('0x46')](_0x42d3c5[_0xa852('0x2e')],_0x42d3c5[_0xa852('0x30')]);_0x5189fa[_0xa852('0x33')]=_[_0xa852('0x46')](_0x42d3c5[_0xa852('0x2e')],qs[_0xa852('0x34')](_0x1267fc[_0xa852('0x30')][_0xa852('0x34')]));_0x5189fa[_0xa852('0x33')]=_0x5189fa[_0xa852('0x33')][_0xa852('0x35')]?_0x5189fa['attributes']:_0x42d3c5[_0xa852('0x2e')];_0x5189fa['order']=qs['sort'](_0x1267fc['query'][_0xa852('0x39')]);_0x5189fa[_0xa852('0x3b')]=qs[_0xa852('0x32')](_['pick'](_0x1267fc[_0xa852('0x30')],_0x42d3c5[_0xa852('0x32')]));if(_0x1267fc[_0xa852('0x30')][_0xa852('0x3a')]){_0x5189fa[_0xa852('0x3b')]=_['merge'](_0x5189fa[_0xa852('0x3b')],{'$or':_[_0xa852('0x2f')](_0x5189fa[_0xa852('0x33')],function(_0x3d855f){var _0x50d2c3={};_0x50d2c3[_0x3d855f]={'$like':'%'+_0x1267fc[_0xa852('0x30')][_0xa852('0x3a')]+'%'};return _0x50d2c3;})});}_0x5189fa=_[_0xa852('0x3c')]({},_0x5189fa,_0x1267fc[_0xa852('0x47')]);return _0x53b224[_0xa852('0x57')](_0x5189fa);}})[_0xa852('0x22')](function(_0x3dbaee){if(_0x3dbaee){_0x41e1a0=_0x3dbaee[_0xa852('0x35')];if(!_0x1267fc[_0xa852('0x30')][_0xa852('0x36')](_0xa852('0x37'))){_0x5189fa['limit']=qs[_0xa852('0x1c')](_0x1267fc[_0xa852('0x30')]['limit']);_0x5189fa[_0xa852('0x1b')]=qs['offset'](_0x1267fc[_0xa852('0x30')][_0xa852('0x1b')]);}return _0x53b224['getAnyConditions'](_0x5189fa);}})[_0xa852('0x22')](function(_0x486d1e){if(_0x486d1e){return _0x486d1e?{'count':_0x41e1a0,'rows':_0x486d1e}:null;}})[_0xa852('0x22')](respondWithResult(_0x235c6a,null))['catch'](handleError(_0x235c6a,null));};exports[_0xa852('0x59')]=function(_0x5a1da3,_0x2c821e,_0x1754e5){if(_0x5a1da3[_0xa852('0x49')]['id']){delete _0x5a1da3[_0xa852('0x49')]['id'];}return db[_0xa852('0x3f')][_0xa852('0x4d')]({'where':{'id':_0x5a1da3[_0xa852('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c821e,null))[_0xa852('0x22')](function(_0x1f5804){if(_0x1f5804){_0x5a1da3['body'][_0xa852('0x5a')]=_0x1f5804['id'];return db[_0xa852('0x5b')][_0xa852('0x48')](_0x5a1da3[_0xa852('0x49')]);}})[_0xa852('0x22')](respondWithResult(_0x2c821e,null))['catch'](handleError(_0x2c821e,null));};exports['getActions']=function(_0x5c40f0,_0x56d324,_0x18d382){var _0x417a61={};var _0x1fb4dd={};var _0x2ce038;var _0x5eaf44;return db[_0xa852('0x3f')][_0xa852('0x58')]({'where':{'id':_0x5c40f0['params']['id']}})[_0xa852('0x22')](handleEntityNotFound(_0x56d324,null))[_0xa852('0x22')](function(_0x1bf334){if(_0x1bf334){_0x2ce038=_0x1bf334;_0x1fb4dd['model']=_[_0xa852('0x31')](db['Action'][_0xa852('0x2b')]);_0x1fb4dd['query']=_['keys'](_0x5c40f0[_0xa852('0x30')]);_0x1fb4dd[_0xa852('0x32')]=_[_0xa852('0x46')](_0x1fb4dd[_0xa852('0x2e')],_0x1fb4dd[_0xa852('0x30')]);_0x417a61['attributes']=_[_0xa852('0x46')](_0x1fb4dd['model'],qs[_0xa852('0x34')](_0x5c40f0[_0xa852('0x30')]['fields']));_0x417a61[_0xa852('0x33')]=_0x417a61['attributes'][_0xa852('0x35')]?_0x417a61[_0xa852('0x33')]:_0x1fb4dd[_0xa852('0x2e')];_0x417a61[_0xa852('0x38')]=qs[_0xa852('0x39')](_0x5c40f0[_0xa852('0x30')][_0xa852('0x39')]);_0x417a61[_0xa852('0x3b')]=qs[_0xa852('0x32')](_[_0xa852('0x56')](_0x5c40f0[_0xa852('0x30')],_0x1fb4dd['filters']));if(_0x5c40f0['query'][_0xa852('0x3a')]){_0x417a61[_0xa852('0x3b')]=_[_0xa852('0x3c')](_0x417a61['where'],{'$or':_['map'](_0x417a61[_0xa852('0x33')],function(_0x4b4fe7){var _0x33590b={};_0x33590b[_0x4b4fe7]={'$like':'%'+_0x5c40f0[_0xa852('0x30')]['filter']+'%'};return _0x33590b;})});}_0x417a61=_[_0xa852('0x3c')]({},_0x417a61,_0x5c40f0[_0xa852('0x47')]);return _0x2ce038['getActions'](_0x417a61);}})['then'](function(_0x139ef3){if(_0x139ef3){_0x5eaf44=_0x139ef3['length'];if(!_0x5c40f0[_0xa852('0x30')][_0xa852('0x36')](_0xa852('0x37'))){_0x417a61[_0xa852('0x1c')]=qs[_0xa852('0x1c')](_0x5c40f0[_0xa852('0x30')][_0xa852('0x1c')]);_0x417a61[_0xa852('0x1b')]=qs[_0xa852('0x1b')](_0x5c40f0[_0xa852('0x30')][_0xa852('0x1b')]);}return _0x2ce038[_0xa852('0x5c')](_0x417a61);}})['then'](function(_0x5a3d4f){if(_0x5a3d4f){return _0x5a3d4f?{'count':_0x5eaf44,'rows':_0x5a3d4f}:null;}})[_0xa852('0x22')](respondWithResult(_0x56d324,null))[_0xa852('0x43')](handleError(_0x56d324,null));}; \ No newline at end of file +var _0xf318=['status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','options','Trigger','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','user','Triggers','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','body','TriggerAllId','addAnyCondition','Condition','filter','getAllConditions','hasOwnProperty','getAnyConditions','findOne','addAction','Action','getActions','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x3f9e5e,_0x20ab1b){var _0x2826e2=function(_0x19ba0e){while(--_0x19ba0e){_0x3f9e5e['push'](_0x3f9e5e['shift']());}};_0x2826e2(++_0x20ab1b);}(_0xf318,0x9f));var _0x8f31=function(_0x4289cc,_0x4a5691){_0x4289cc=_0x4289cc-0x0;var _0x4a26be=_0xf318[_0x4289cc];return _0x4a26be;};'use strict';var emlformat=require(_0x8f31('0x0'));var rimraf=require(_0x8f31('0x1'));var zipdir=require(_0x8f31('0x2'));var jsonpatch=require(_0x8f31('0x3'));var rp=require(_0x8f31('0x4'));var moment=require(_0x8f31('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8f31('0x6'));var util=require(_0x8f31('0x7'));var path=require(_0x8f31('0x8'));var sox=require(_0x8f31('0x9'));var csv=require(_0x8f31('0xa'));var ejs=require(_0x8f31('0xb'));var fs=require('fs');var fs_extra=require(_0x8f31('0xc'));var _=require(_0x8f31('0xd'));var squel=require(_0x8f31('0xe'));var crypto=require(_0x8f31('0xf'));var jsforce=require(_0x8f31('0x10'));var deskjs=require(_0x8f31('0x11'));var toCsv=require(_0x8f31('0xa'));var querystring=require('querystring');var Papa=require(_0x8f31('0x12'));var Redis=require(_0x8f31('0x13'));var authService=require(_0x8f31('0x14'));var qs=require(_0x8f31('0x15'));var as=require(_0x8f31('0x16'));var hardwareService=require(_0x8f31('0x17'));var logger=require(_0x8f31('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x8f31('0x19'));var licenseUtil=require(_0x8f31('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57702d,_0x38cc76){_0x38cc76=_0x38cc76||0xcc;return function(_0x8fccdf){if(_0x8fccdf){return _0x57702d[_0x8f31('0x1b')](_0x38cc76);}return _0x57702d['status'](_0x38cc76)[_0x8f31('0x1c')]();};}function respondWithResult(_0x534c2a,_0x3a1f43){_0x3a1f43=_0x3a1f43||0xc8;return function(_0x506107){if(_0x506107){return _0x534c2a[_0x8f31('0x1d')](_0x3a1f43)[_0x8f31('0x1e')](_0x506107);}};}function respondWithFilteredResult(_0xe61f6d,_0x107154){return function(_0x3b08dc){if(_0x3b08dc){var _0x54c407=_0x3b08dc[_0x8f31('0x1f')],_0x767438=_0x107154[_0x8f31('0x20')],_0x489455=_0x107154[_0x8f31('0x20')]+_0x107154[_0x8f31('0x21')],_0x438c2b;if(_0x489455>=_0x54c407){_0x489455=_0x54c407;_0x438c2b=0xc8;}else{_0x438c2b=0xce;}_0xe61f6d[_0x8f31('0x1d')](_0x438c2b);return _0xe61f6d[_0x8f31('0x22')](_0x8f31('0x23'),_0x767438+'-'+_0x489455+'/'+_0x54c407)[_0x8f31('0x1e')](_0x3b08dc);}return null;};}function patchUpdates(_0x8b1f){return function(_0x23c8f5){try{jsonpatch[_0x8f31('0x24')](_0x23c8f5,_0x8b1f,!![]);}catch(_0xc2103b){return BPromise['reject'](_0xc2103b);}return _0x23c8f5['save']();};}function saveUpdates(_0x549e87,_0x2a4060){return function(_0x19b072){if(_0x19b072){return _0x19b072[_0x8f31('0x25')](_0x549e87)[_0x8f31('0x26')](function(_0x8e16f9){return _0x8e16f9;});}return null;};}function removeEntity(_0x21871c,_0x50166b){return function(_0xfc05c6){if(_0xfc05c6){return _0xfc05c6[_0x8f31('0x27')]()[_0x8f31('0x26')](function(){var _0x37cab8=_0xfc05c6[_0x8f31('0x28')]({'plain':!![]});var _0xd34a0b='Triggers';return db[_0x8f31('0x29')][_0x8f31('0x27')]({'where':{'type':_0xd34a0b,'resourceId':_0x37cab8['id']}})['then'](function(){return _0xfc05c6;});})[_0x8f31('0x26')](function(){_0x21871c[_0x8f31('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cfa77,_0x31f614){return function(_0x31fe09){if(!_0x31fe09){_0x1cfa77[_0x8f31('0x1b')](0x194);}return _0x31fe09;};}function handleError(_0x59c27f,_0x23b930){_0x23b930=_0x23b930||0x1f4;return function(_0x571cee){logger[_0x8f31('0x2a')](_0x571cee[_0x8f31('0x2b')]);if(_0x571cee['name']){delete _0x571cee[_0x8f31('0x2c')];}_0x59c27f[_0x8f31('0x1d')](_0x23b930)['send'](_0x571cee);};}exports[_0x8f31('0x2d')]=function(_0x379dfd,_0x5e3020){var _0x3734d1={},_0xd2b53={},_0x59ab65={'count':0x0,'rows':[]};var _0x52e290=_[_0x8f31('0x2e')](db['Trigger']['rawAttributes'],function(_0x2132c1){return{'name':_0x2132c1[_0x8f31('0x2f')],'type':_0x2132c1[_0x8f31('0x30')][_0x8f31('0x31')]};});_0xd2b53[_0x8f31('0x32')]=_[_0x8f31('0x2e')](_0x52e290,_0x8f31('0x2c'));_0xd2b53[_0x8f31('0x33')]=_['keys'](_0x379dfd[_0x8f31('0x33')]);_0xd2b53['filters']=_[_0x8f31('0x34')](_0xd2b53[_0x8f31('0x32')],_0xd2b53[_0x8f31('0x33')]);_0x3734d1[_0x8f31('0x35')]=_[_0x8f31('0x34')](_0xd2b53[_0x8f31('0x32')],qs[_0x8f31('0x36')](_0x379dfd[_0x8f31('0x33')][_0x8f31('0x36')]));_0x3734d1['attributes']=_0x3734d1[_0x8f31('0x35')][_0x8f31('0x37')]?_0x3734d1['attributes']:_0xd2b53['model'];if(!_0x379dfd['query']['hasOwnProperty'](_0x8f31('0x38'))){_0x3734d1[_0x8f31('0x21')]=qs[_0x8f31('0x21')](_0x379dfd[_0x8f31('0x33')][_0x8f31('0x21')]);_0x3734d1[_0x8f31('0x20')]=qs['offset'](_0x379dfd['query']['offset']);}_0x3734d1[_0x8f31('0x39')]=qs[_0x8f31('0x3a')](_0x379dfd['query'][_0x8f31('0x3a')]);_0x3734d1[_0x8f31('0x3b')]=qs[_0x8f31('0x3c')](_[_0x8f31('0x3d')](_0x379dfd[_0x8f31('0x33')],_0xd2b53['filters']),_0x52e290);if(_0x379dfd['query']['filter']){_0x3734d1[_0x8f31('0x3b')]=_['merge'](_0x3734d1[_0x8f31('0x3b')],{'$or':_[_0x8f31('0x2e')](_0x52e290,function(_0x150c80){if(_0x150c80[_0x8f31('0x30')]!=='VIRTUAL'){var _0x422ce4={};_0x422ce4[_0x150c80[_0x8f31('0x2c')]]={'$like':'%'+_0x379dfd[_0x8f31('0x33')]['filter']+'%'};return _0x422ce4;}})});}_0x3734d1=_[_0x8f31('0x3e')]({},_0x3734d1,_0x379dfd[_0x8f31('0x3f')]);var _0x3d91fe={'where':_0x3734d1['where']};return db[_0x8f31('0x40')][_0x8f31('0x1f')](_0x3d91fe)[_0x8f31('0x26')](function(_0x1357a9){_0x59ab65['count']=_0x1357a9;if(_0x379dfd['query']['includeAll']){_0x3734d1[_0x8f31('0x41')]=[{'all':!![]}];}return db[_0x8f31('0x40')][_0x8f31('0x42')](_0x3734d1);})[_0x8f31('0x26')](function(_0x50606a){_0x59ab65[_0x8f31('0x43')]=_0x50606a;return _0x59ab65;})['then'](respondWithFilteredResult(_0x5e3020,_0x3734d1))[_0x8f31('0x44')](handleError(_0x5e3020,null));};exports[_0x8f31('0x45')]=function(_0x53c32c,_0x1e046){var _0x119cde={'raw':![],'where':{'id':_0x53c32c[_0x8f31('0x46')]['id']}},_0x2323d9={};_0x2323d9['model']=_[_0x8f31('0x47')](db['Trigger'][_0x8f31('0x48')]);_0x2323d9[_0x8f31('0x33')]=_['keys'](_0x53c32c[_0x8f31('0x33')]);_0x2323d9[_0x8f31('0x3c')]=_[_0x8f31('0x34')](_0x2323d9[_0x8f31('0x32')],_0x2323d9['query']);_0x119cde[_0x8f31('0x35')]=_[_0x8f31('0x34')](_0x2323d9[_0x8f31('0x32')],qs[_0x8f31('0x36')](_0x53c32c[_0x8f31('0x33')]['fields']));_0x119cde[_0x8f31('0x35')]=_0x119cde[_0x8f31('0x35')][_0x8f31('0x37')]?_0x119cde[_0x8f31('0x35')]:_0x2323d9[_0x8f31('0x32')];if(_0x53c32c[_0x8f31('0x33')]['includeAll']){_0x119cde[_0x8f31('0x41')]=[{'all':!![]}];}_0x119cde=_[_0x8f31('0x3e')]({},_0x119cde,_0x53c32c[_0x8f31('0x3f')]);return db['Trigger'][_0x8f31('0x49')](_0x119cde)['then'](handleEntityNotFound(_0x1e046,null))[_0x8f31('0x26')](respondWithResult(_0x1e046,null))['catch'](handleError(_0x1e046,null));};exports[_0x8f31('0x4a')]=function(_0x5cad2e,_0x99a1d2){return db[_0x8f31('0x40')][_0x8f31('0x4a')](_0x5cad2e['body'],{})[_0x8f31('0x26')](function(_0x1c71eb){var _0x2b173b=_0x5cad2e[_0x8f31('0x4b')][_0x8f31('0x28')]({'plain':!![]});if(!_0x2b173b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b173b['role']===_0x8f31('0x4b')){var _0x433c92=_0x1c71eb[_0x8f31('0x28')]({'plain':!![]});var _0x5682cd=_0x8f31('0x4c');return db[_0x8f31('0x4d')][_0x8f31('0x49')]({'where':{'name':_0x5682cd,'userProfileId':_0x2b173b[_0x8f31('0x4e')]},'raw':!![]})[_0x8f31('0x26')](function(_0x2abc36){if(_0x2abc36&&_0x2abc36[_0x8f31('0x4f')]===0x0){return db[_0x8f31('0x29')][_0x8f31('0x4a')]({'name':_0x433c92[_0x8f31('0x2c')],'resourceId':_0x433c92['id'],'type':_0x2abc36[_0x8f31('0x2c')],'sectionId':_0x2abc36['id']},{})[_0x8f31('0x26')](function(){return _0x1c71eb;});}else{return _0x1c71eb;}})[_0x8f31('0x44')](function(_0x15e282){logger[_0x8f31('0x2a')](_0x8f31('0x50'),_0x15e282);throw _0x15e282;});}return _0x1c71eb;})[_0x8f31('0x26')](respondWithResult(_0x99a1d2,0xc9))[_0x8f31('0x44')](handleError(_0x99a1d2,null));};exports[_0x8f31('0x25')]=function(_0x1d9e61,_0xcd183d){if(_0x1d9e61['body']['id']){delete _0x1d9e61['body']['id'];}return db[_0x8f31('0x40')][_0x8f31('0x49')]({'where':{'id':_0x1d9e61[_0x8f31('0x46')]['id']}})[_0x8f31('0x26')](handleEntityNotFound(_0xcd183d,null))[_0x8f31('0x26')](saveUpdates(_0x1d9e61['body'],null))[_0x8f31('0x26')](respondWithResult(_0xcd183d,null))[_0x8f31('0x44')](handleError(_0xcd183d,null));};exports[_0x8f31('0x27')]=function(_0x18a13a,_0x49283e){return db[_0x8f31('0x40')][_0x8f31('0x49')]({'where':{'id':_0x18a13a['params']['id']}})[_0x8f31('0x26')](handleEntityNotFound(_0x49283e,null))[_0x8f31('0x26')](removeEntity(_0x49283e,null))[_0x8f31('0x44')](handleError(_0x49283e,null));};exports[_0x8f31('0x51')]=function(_0x2cd115,_0x2a2ee9,_0x2cdeea){if(_0x2cd115[_0x8f31('0x52')]['id']){delete _0x2cd115[_0x8f31('0x52')]['id'];}return db[_0x8f31('0x40')]['find']({'where':{'id':_0x2cd115['params']['id']}})[_0x8f31('0x26')](handleEntityNotFound(_0x2a2ee9,null))['then'](function(_0x2c20c7){if(_0x2c20c7){_0x2cd115[_0x8f31('0x52')][_0x8f31('0x53')]=_0x2c20c7['id'];return db['Condition'][_0x8f31('0x4a')](_0x2cd115[_0x8f31('0x52')]);}})['then'](respondWithResult(_0x2a2ee9,null))[_0x8f31('0x44')](handleError(_0x2a2ee9,null));};exports[_0x8f31('0x54')]=function(_0x1d1c2b,_0x226ef6,_0x2f16a3){if(_0x1d1c2b['body']['id']){delete _0x1d1c2b['body']['id'];}return db[_0x8f31('0x40')][_0x8f31('0x49')]({'where':{'id':_0x1d1c2b[_0x8f31('0x46')]['id']}})[_0x8f31('0x26')](handleEntityNotFound(_0x226ef6,null))[_0x8f31('0x26')](function(_0x5ed8b3){if(_0x5ed8b3){_0x1d1c2b[_0x8f31('0x52')]['TriggerAnyId']=_0x5ed8b3['id'];return db[_0x8f31('0x55')][_0x8f31('0x4a')](_0x1d1c2b[_0x8f31('0x52')]);}})['then'](respondWithResult(_0x226ef6,null))[_0x8f31('0x44')](handleError(_0x226ef6,null));};exports['getAllConditions']=function(_0x1815eb,_0x4bf401,_0x474294){var _0x302e0c={};var _0x190312={};var _0x2c03f8;var _0x2b49fc;return db[_0x8f31('0x40')]['findOne']({'where':{'id':_0x1815eb[_0x8f31('0x46')]['id']}})[_0x8f31('0x26')](handleEntityNotFound(_0x4bf401,null))['then'](function(_0x49f7ab){if(_0x49f7ab){_0x2c03f8=_0x49f7ab;_0x190312['model']=_[_0x8f31('0x47')](db[_0x8f31('0x55')][_0x8f31('0x48')]);_0x190312[_0x8f31('0x33')]=_['keys'](_0x1815eb[_0x8f31('0x33')]);_0x190312['filters']=_['intersection'](_0x190312[_0x8f31('0x32')],_0x190312['query']);_0x302e0c[_0x8f31('0x35')]=_[_0x8f31('0x34')](_0x190312[_0x8f31('0x32')],qs['fields'](_0x1815eb[_0x8f31('0x33')][_0x8f31('0x36')]));_0x302e0c[_0x8f31('0x35')]=_0x302e0c[_0x8f31('0x35')]['length']?_0x302e0c['attributes']:_0x190312[_0x8f31('0x32')];_0x302e0c['order']=qs[_0x8f31('0x3a')](_0x1815eb[_0x8f31('0x33')]['sort']);_0x302e0c[_0x8f31('0x3b')]=qs[_0x8f31('0x3c')](_['pick'](_0x1815eb[_0x8f31('0x33')],_0x190312[_0x8f31('0x3c')]));if(_0x1815eb[_0x8f31('0x33')][_0x8f31('0x56')]){_0x302e0c['where']=_[_0x8f31('0x3e')](_0x302e0c[_0x8f31('0x3b')],{'$or':_[_0x8f31('0x2e')](_0x302e0c['attributes'],function(_0x147ef5){var _0x5ede0d={};_0x5ede0d[_0x147ef5]={'$like':'%'+_0x1815eb[_0x8f31('0x33')][_0x8f31('0x56')]+'%'};return _0x5ede0d;})});}_0x302e0c=_['merge']({},_0x302e0c,_0x1815eb['options']);return _0x2c03f8[_0x8f31('0x57')](_0x302e0c);}})[_0x8f31('0x26')](function(_0x145f46){if(_0x145f46){_0x2b49fc=_0x145f46[_0x8f31('0x37')];if(!_0x1815eb[_0x8f31('0x33')][_0x8f31('0x58')](_0x8f31('0x38'))){_0x302e0c[_0x8f31('0x21')]=qs[_0x8f31('0x21')](_0x1815eb[_0x8f31('0x33')][_0x8f31('0x21')]);_0x302e0c[_0x8f31('0x20')]=qs[_0x8f31('0x20')](_0x1815eb['query'][_0x8f31('0x20')]);}return _0x2c03f8[_0x8f31('0x57')](_0x302e0c);}})[_0x8f31('0x26')](function(_0x58a768){if(_0x58a768){return _0x58a768?{'count':_0x2b49fc,'rows':_0x58a768}:null;}})[_0x8f31('0x26')](respondWithResult(_0x4bf401,null))[_0x8f31('0x44')](handleError(_0x4bf401,null));};exports[_0x8f31('0x59')]=function(_0x3a2993,_0x75d8de,_0xdc56fc){var _0x210d13={};var _0x40c86d={};var _0x538dc6;var _0x173b35;return db[_0x8f31('0x40')][_0x8f31('0x5a')]({'where':{'id':_0x3a2993[_0x8f31('0x46')]['id']}})[_0x8f31('0x26')](handleEntityNotFound(_0x75d8de,null))[_0x8f31('0x26')](function(_0x1b0eec){if(_0x1b0eec){_0x538dc6=_0x1b0eec;_0x40c86d[_0x8f31('0x32')]=_['keys'](db[_0x8f31('0x55')]['rawAttributes']);_0x40c86d[_0x8f31('0x33')]=_['keys'](_0x3a2993[_0x8f31('0x33')]);_0x40c86d['filters']=_['intersection'](_0x40c86d[_0x8f31('0x32')],_0x40c86d[_0x8f31('0x33')]);_0x210d13[_0x8f31('0x35')]=_['intersection'](_0x40c86d[_0x8f31('0x32')],qs[_0x8f31('0x36')](_0x3a2993[_0x8f31('0x33')][_0x8f31('0x36')]));_0x210d13[_0x8f31('0x35')]=_0x210d13[_0x8f31('0x35')][_0x8f31('0x37')]?_0x210d13[_0x8f31('0x35')]:_0x40c86d['model'];_0x210d13[_0x8f31('0x39')]=qs[_0x8f31('0x3a')](_0x3a2993[_0x8f31('0x33')][_0x8f31('0x3a')]);_0x210d13[_0x8f31('0x3b')]=qs[_0x8f31('0x3c')](_[_0x8f31('0x3d')](_0x3a2993[_0x8f31('0x33')],_0x40c86d[_0x8f31('0x3c')]));if(_0x3a2993[_0x8f31('0x33')][_0x8f31('0x56')]){_0x210d13[_0x8f31('0x3b')]=_[_0x8f31('0x3e')](_0x210d13[_0x8f31('0x3b')],{'$or':_[_0x8f31('0x2e')](_0x210d13[_0x8f31('0x35')],function(_0x344063){var _0x25a812={};_0x25a812[_0x344063]={'$like':'%'+_0x3a2993[_0x8f31('0x33')][_0x8f31('0x56')]+'%'};return _0x25a812;})});}_0x210d13=_['merge']({},_0x210d13,_0x3a2993[_0x8f31('0x3f')]);return _0x538dc6[_0x8f31('0x59')](_0x210d13);}})[_0x8f31('0x26')](function(_0xcc9555){if(_0xcc9555){_0x173b35=_0xcc9555['length'];if(!_0x3a2993[_0x8f31('0x33')][_0x8f31('0x58')](_0x8f31('0x38'))){_0x210d13[_0x8f31('0x21')]=qs[_0x8f31('0x21')](_0x3a2993['query'][_0x8f31('0x21')]);_0x210d13['offset']=qs[_0x8f31('0x20')](_0x3a2993['query'][_0x8f31('0x20')]);}return _0x538dc6['getAnyConditions'](_0x210d13);}})[_0x8f31('0x26')](function(_0x498d33){if(_0x498d33){return _0x498d33?{'count':_0x173b35,'rows':_0x498d33}:null;}})[_0x8f31('0x26')](respondWithResult(_0x75d8de,null))[_0x8f31('0x44')](handleError(_0x75d8de,null));};exports[_0x8f31('0x5b')]=function(_0x159007,_0xad1e84,_0x29407e){if(_0x159007[_0x8f31('0x52')]['id']){delete _0x159007['body']['id'];}return db[_0x8f31('0x40')][_0x8f31('0x49')]({'where':{'id':_0x159007[_0x8f31('0x46')]['id']}})[_0x8f31('0x26')](handleEntityNotFound(_0xad1e84,null))['then'](function(_0x2f7daa){if(_0x2f7daa){_0x159007[_0x8f31('0x52')]['TriggerId']=_0x2f7daa['id'];return db[_0x8f31('0x5c')][_0x8f31('0x4a')](_0x159007[_0x8f31('0x52')]);}})[_0x8f31('0x26')](respondWithResult(_0xad1e84,null))[_0x8f31('0x44')](handleError(_0xad1e84,null));};exports[_0x8f31('0x5d')]=function(_0x593543,_0x289ef3,_0x303d84){var _0x277891={};var _0x173f57={};var _0x448187;var _0xb55436;return db[_0x8f31('0x40')][_0x8f31('0x5a')]({'where':{'id':_0x593543[_0x8f31('0x46')]['id']}})[_0x8f31('0x26')](handleEntityNotFound(_0x289ef3,null))[_0x8f31('0x26')](function(_0x160bb2){if(_0x160bb2){_0x448187=_0x160bb2;_0x173f57[_0x8f31('0x32')]=_[_0x8f31('0x47')](db[_0x8f31('0x5c')][_0x8f31('0x48')]);_0x173f57['query']=_['keys'](_0x593543[_0x8f31('0x33')]);_0x173f57['filters']=_[_0x8f31('0x34')](_0x173f57[_0x8f31('0x32')],_0x173f57[_0x8f31('0x33')]);_0x277891['attributes']=_[_0x8f31('0x34')](_0x173f57[_0x8f31('0x32')],qs['fields'](_0x593543[_0x8f31('0x33')]['fields']));_0x277891['attributes']=_0x277891[_0x8f31('0x35')][_0x8f31('0x37')]?_0x277891[_0x8f31('0x35')]:_0x173f57[_0x8f31('0x32')];_0x277891[_0x8f31('0x39')]=qs[_0x8f31('0x3a')](_0x593543['query'][_0x8f31('0x3a')]);_0x277891[_0x8f31('0x3b')]=qs[_0x8f31('0x3c')](_['pick'](_0x593543[_0x8f31('0x33')],_0x173f57[_0x8f31('0x3c')]));if(_0x593543[_0x8f31('0x33')][_0x8f31('0x56')]){_0x277891['where']=_[_0x8f31('0x3e')](_0x277891[_0x8f31('0x3b')],{'$or':_[_0x8f31('0x2e')](_0x277891[_0x8f31('0x35')],function(_0x5bcc2c){var _0x298c96={};_0x298c96[_0x5bcc2c]={'$like':'%'+_0x593543[_0x8f31('0x33')][_0x8f31('0x56')]+'%'};return _0x298c96;})});}_0x277891=_[_0x8f31('0x3e')]({},_0x277891,_0x593543[_0x8f31('0x3f')]);return _0x448187[_0x8f31('0x5d')](_0x277891);}})[_0x8f31('0x26')](function(_0x17de2f){if(_0x17de2f){_0xb55436=_0x17de2f[_0x8f31('0x37')];if(!_0x593543[_0x8f31('0x33')][_0x8f31('0x58')](_0x8f31('0x38'))){_0x277891[_0x8f31('0x21')]=qs['limit'](_0x593543[_0x8f31('0x33')][_0x8f31('0x21')]);_0x277891[_0x8f31('0x20')]=qs['offset'](_0x593543['query'][_0x8f31('0x20')]);}return _0x448187[_0x8f31('0x5d')](_0x277891);}})['then'](function(_0x22922a){if(_0x22922a){return _0x22922a?{'count':_0xb55436,'rows':_0x22922a}:null;}})[_0x8f31('0x26')](respondWithResult(_0x289ef3,null))[_0x8f31('0x44')](handleError(_0x289ef3,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index ba377e5..98c90fb 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 _0xfad9=['request-promise','path','../../config/environment','exports','define','Trigger','lodash','util','../../config/logger','api','moment'];(function(_0x4757df,_0x205594){var _0x46117b=function(_0x56f681){while(--_0x56f681){_0x4757df['push'](_0x4757df['shift']());}};_0x46117b(++_0x205594);}(_0xfad9,0xcc));var _0x9fad=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0xfad9[_0x503ffd];return _0x160437;};'use strict';var _=require(_0x9fad('0x0'));var util=require(_0x9fad('0x1'));var logger=require(_0x9fad('0x2'))(_0x9fad('0x3'));var moment=require(_0x9fad('0x4'));var BPromise=require('bluebird');var rp=require(_0x9fad('0x5'));var fs=require('fs');var path=require(_0x9fad('0x6'));var rimraf=require('rimraf');var config=require(_0x9fad('0x7'));var attributes=require('./trigger.attributes');module[_0x9fad('0x8')]=function(_0x53f067,_0x53126a){return _0x53f067[_0x9fad('0x9')](_0x9fad('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7478=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','tools_triggers','lodash'];(function(_0xe75d24,_0x54f93b){var _0x4d2587=function(_0x1e5fc9){while(--_0x1e5fc9){_0xe75d24['push'](_0xe75d24['shift']());}};_0x4d2587(++_0x54f93b);}(_0x7478,0x9b));var _0x8747=function(_0x17edf1,_0x5e2462){_0x17edf1=_0x17edf1-0x0;var _0x522901=_0x7478[_0x17edf1];return _0x522901;};'use strict';var _=require(_0x8747('0x0'));var util=require(_0x8747('0x1'));var logger=require(_0x8747('0x2'))(_0x8747('0x3'));var moment=require(_0x8747('0x4'));var BPromise=require(_0x8747('0x5'));var rp=require(_0x8747('0x6'));var fs=require('fs');var path=require(_0x8747('0x7'));var rimraf=require(_0x8747('0x8'));var config=require(_0x8747('0x9'));var attributes=require(_0x8747('0xa'));module[_0x8747('0xb')]=function(_0x13bc74,_0x428808){return _0x13bc74['define']('Trigger',attributes,{'tableName':_0x8747('0xc'),'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 fd284c8..98c8c7a 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 _0xf4f4=['then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','model','map','ShowTrigger','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x39df33,_0x1ece89){var _0x1ef7df=function(_0x42a0c4){while(--_0x42a0c4){_0x39df33['push'](_0x39df33['shift']());}};_0x1ef7df(++_0x1ece89);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x295c5a,_0x154dad){_0x295c5a=_0x295c5a-0x0;var _0x334e9a=_0xf4f4[_0x295c5a];return _0x334e9a;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var moment=require('moment');var BPromise=require(_0x4f4f('0x2'));var rs=require(_0x4f4f('0x3'));var fs=require('fs');var Redis=require(_0x4f4f('0x4'));var db=require(_0x4f4f('0x5'))['db'];var utils=require(_0x4f4f('0x6'));var logger=require('../../config/logger')(_0x4f4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f4f('0x8'));var client=jayson[_0x4f4f('0x9')][_0x4f4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ff75a,_0x3c4877,_0x249f8a){return new BPromise(function(_0x2faba9,_0x3768d7){return client['request'](_0x1ff75a,_0x249f8a)[_0x4f4f('0xb')](function(_0x38d110){logger[_0x4f4f('0xc')](_0x4f4f('0xd'),_0x3c4877,_0x4f4f('0xe'));logger[_0x4f4f('0xf')](_0x4f4f('0x10'),_0x3c4877,_0x4f4f('0xe'),JSON['stringify'](_0x38d110));if(_0x38d110['error']){if(_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x12')]===0x1f4){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x3768d7(_0x38d110['error'][_0x4f4f('0x13')]);}logger['error'](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x2faba9(_0x38d110[_0x4f4f('0x11')]['message']);}else{logger[_0x4f4f('0xc')]('Trigger,\x20%s,\x20%s',_0x3c4877,'request\x20sent');_0x2faba9(_0x38d110['result'][_0x4f4f('0x13')]);}})[_0x4f4f('0x14')](function(_0x2d21ed){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x2d21ed);_0x3768d7(_0x2d21ed);});});}exports[_0x4f4f('0x15')]=function(_0x1245c4){var _0x60ce2=this;return new Promise(function(_0x929a0b,_0x2f9397){return db[_0x4f4f('0x16')][_0x4f4f('0x17')]({'raw':_0x1245c4['options']?_0x1245c4[_0x4f4f('0x18')][_0x4f4f('0x19')]===undefined?!![]:![]:!![],'where':_0x1245c4[_0x4f4f('0x18')]?_0x1245c4[_0x4f4f('0x18')][_0x4f4f('0x1a')]||null:null,'attributes':_0x1245c4[_0x4f4f('0x18')]?_0x1245c4[_0x4f4f('0x18')][_0x4f4f('0x1b')]||null:null,'limit':_0x1245c4[_0x4f4f('0x18')]?_0x1245c4[_0x4f4f('0x18')][_0x4f4f('0x1c')]||null:null,'include':_0x1245c4[_0x4f4f('0x18')]?_0x1245c4[_0x4f4f('0x18')][_0x4f4f('0x1d')]?_['map'](_0x1245c4['options']['include'],function(_0x272125){return{'model':db[_0x272125[_0x4f4f('0x1e')]],'as':_0x272125['as'],'attributes':_0x272125['attributes'],'include':_0x272125[_0x4f4f('0x1d')]?_[_0x4f4f('0x1f')](_0x272125[_0x4f4f('0x1d')],function(_0x2ec92a){return{'model':db[_0x2ec92a[_0x4f4f('0x1e')]],'as':_0x2ec92a['as'],'attributes':_0x2ec92a[_0x4f4f('0x1b')],'include':_0x2ec92a[_0x4f4f('0x1d')]?_['map'](_0x2ec92a[_0x4f4f('0x1d')],function(_0x237cf9){return{'model':db[_0x237cf9[_0x4f4f('0x1e')]],'as':_0x237cf9['as'],'attributes':_0x237cf9[_0x4f4f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f4f('0xb')](function(_0x4ad33d){logger[_0x4f4f('0xc')](_0x4f4f('0x15'),_0x1245c4);logger[_0x4f4f('0xf')]('GetTrigger',_0x1245c4,JSON['stringify'](_0x4ad33d));_0x929a0b(_0x4ad33d);})['catch'](function(_0x73b8bb){logger['error'](_0x4f4f('0x15'),_0x73b8bb[_0x4f4f('0x13')],_0x1245c4);_0x2f9397(_0x60ce2[_0x4f4f('0x11')](0x1f4,_0x73b8bb['message']));});});};exports[_0x4f4f('0x20')]=function(_0x1b6f53){var _0x5dd5a3=this;return new Promise(function(_0x413b71,_0x1a551a){return db[_0x4f4f('0x16')]['find']({'raw':_0x1b6f53[_0x4f4f('0x18')]?_0x1b6f53[_0x4f4f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1b6f53['options']?_0x1b6f53[_0x4f4f('0x18')][_0x4f4f('0x1a')]||null:null,'attributes':_0x1b6f53[_0x4f4f('0x18')]?_0x1b6f53[_0x4f4f('0x18')][_0x4f4f('0x1b')]||null:null,'include':_0x1b6f53[_0x4f4f('0x18')]?_0x1b6f53[_0x4f4f('0x18')][_0x4f4f('0x1d')]?_[_0x4f4f('0x1f')](_0x1b6f53[_0x4f4f('0x18')]['include'],function(_0x4d87fd){return{'model':db[_0x4d87fd[_0x4f4f('0x1e')]],'as':_0x4d87fd['as'],'attributes':_0x4d87fd['attributes'],'include':_0x4d87fd[_0x4f4f('0x1d')]?_[_0x4f4f('0x1f')](_0x4d87fd[_0x4f4f('0x1d')],function(_0x4215da){return{'model':db[_0x4215da[_0x4f4f('0x1e')]],'as':_0x4215da['as'],'attributes':_0x4215da[_0x4f4f('0x1b')],'include':_0x4215da[_0x4f4f('0x1d')]?_[_0x4f4f('0x1f')](_0x4215da[_0x4f4f('0x1d')],function(_0x19785e){return{'model':db[_0x19785e[_0x4f4f('0x1e')]],'as':_0x19785e['as'],'attributes':_0x19785e[_0x4f4f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x411e94){logger[_0x4f4f('0xc')](_0x4f4f('0x20'),_0x1b6f53);logger[_0x4f4f('0xf')](_0x4f4f('0x20'),_0x1b6f53,JSON[_0x4f4f('0x21')](_0x411e94));_0x413b71(_0x411e94);})[_0x4f4f('0x14')](function(_0x32b077){logger[_0x4f4f('0x11')]('ShowTrigger',_0x32b077[_0x4f4f('0x13')],_0x1b6f53);_0x1a551a(_0x5dd5a3[_0x4f4f('0x11')](0x1f4,_0x32b077[_0x4f4f('0x13')]));});});}; \ No newline at end of file +var _0x84a0=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Trigger,\x20%s,\x20%s','message','result','catch','Trigger','findAll','options','raw','where','attributes','limit','include','model','map','GetTrigger','ShowTrigger','find','lodash','util','moment'];(function(_0x429705,_0x2ec52d){var _0x626386=function(_0x2acde0){while(--_0x2acde0){_0x429705['push'](_0x429705['shift']());}};_0x626386(++_0x2ec52d);}(_0x84a0,0x66));var _0x084a=function(_0x2d9280,_0x2bb994){_0x2d9280=_0x2d9280-0x0;var _0x54f49c=_0x84a0[_0x2d9280];return _0x54f49c;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e6810,_0x373d2,_0x2b30bc){return new BPromise(function(_0x58d419,_0x1051a9){return client[_0x084a('0xa')](_0x2e6810,_0x2b30bc)[_0x084a('0xb')](function(_0x2888e3){logger[_0x084a('0xc')]('Trigger,\x20%s,\x20%s',_0x373d2,'request\x20sent');logger[_0x084a('0xd')](_0x084a('0xe'),_0x373d2,_0x084a('0xf'),JSON[_0x084a('0x10')](_0x2888e3));if(_0x2888e3[_0x084a('0x11')]){if(_0x2888e3['error']['code']===0x1f4){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);return _0x1051a9(_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);}logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3['error'][_0x084a('0x13')]);return _0x58d419(_0x2888e3['error'][_0x084a('0x13')]);}else{logger[_0x084a('0xc')](_0x084a('0x12'),_0x373d2,_0x084a('0xf'));_0x58d419(_0x2888e3[_0x084a('0x14')]['message']);}})[_0x084a('0x15')](function(_0x4abd81){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x4abd81);_0x1051a9(_0x4abd81);});});}exports['GetTrigger']=function(_0xf2c333){var _0x32c729=this;return new Promise(function(_0x4134b9,_0x14bb19){return db[_0x084a('0x16')][_0x084a('0x17')]({'raw':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x19')]===undefined?!![]:![]:!![],'where':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1a')]||null:null,'attributes':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1b')]||null:null,'limit':_0xf2c333['options']?_0xf2c333[_0x084a('0x18')][_0x084a('0x1c')]||null:null,'include':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1d')]?_['map'](_0xf2c333[_0x084a('0x18')][_0x084a('0x1d')],function(_0x6346a5){return{'model':db[_0x6346a5[_0x084a('0x1e')]],'as':_0x6346a5['as'],'attributes':_0x6346a5[_0x084a('0x1b')],'include':_0x6346a5[_0x084a('0x1d')]?_['map'](_0x6346a5[_0x084a('0x1d')],function(_0x2af138){return{'model':db[_0x2af138[_0x084a('0x1e')]],'as':_0x2af138['as'],'attributes':_0x2af138['attributes'],'include':_0x2af138[_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x2af138[_0x084a('0x1d')],function(_0x4c5658){return{'model':db[_0x4c5658['model']],'as':_0x4c5658['as'],'attributes':_0x4c5658['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33b88f){logger['info']('GetTrigger',_0xf2c333);logger['debug'](_0x084a('0x20'),_0xf2c333,JSON[_0x084a('0x10')](_0x33b88f));_0x4134b9(_0x33b88f);})[_0x084a('0x15')](function(_0x2c4149){logger[_0x084a('0x11')](_0x084a('0x20'),_0x2c4149[_0x084a('0x13')],_0xf2c333);_0x14bb19(_0x32c729[_0x084a('0x11')](0x1f4,_0x2c4149['message']));});});};exports[_0x084a('0x21')]=function(_0x3b2b38){var _0x501a16=this;return new Promise(function(_0xe1980b,_0x24bcf5){return db[_0x084a('0x16')][_0x084a('0x22')]({'raw':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x19')]===undefined?!![]:![]:!![],'where':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x1a')]||null:null,'attributes':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x1b')]||null:null,'include':_0x3b2b38['options']?_0x3b2b38['options'][_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x3b2b38[_0x084a('0x18')][_0x084a('0x1d')],function(_0x83f94f){return{'model':db[_0x83f94f['model']],'as':_0x83f94f['as'],'attributes':_0x83f94f[_0x084a('0x1b')],'include':_0x83f94f[_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x83f94f['include'],function(_0x109593){return{'model':db[_0x109593[_0x084a('0x1e')]],'as':_0x109593['as'],'attributes':_0x109593[_0x084a('0x1b')],'include':_0x109593['include']?_['map'](_0x109593['include'],function(_0xf97d1b){return{'model':db[_0xf97d1b[_0x084a('0x1e')]],'as':_0xf97d1b['as'],'attributes':_0xf97d1b[_0x084a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c09c3){logger[_0x084a('0xc')](_0x084a('0x21'),_0x3b2b38);logger[_0x084a('0xd')](_0x084a('0x21'),_0x3b2b38,JSON[_0x084a('0x10')](_0x3c09c3));_0xe1980b(_0x3c09c3);})[_0x084a('0x15')](function(_0x19354f){logger[_0x084a('0x11')](_0x084a('0x21'),_0x19354f[_0x084a('0x13')],_0x3b2b38);_0x24bcf5(_0x501a16[_0x084a('0x11')](0x1f4,_0x19354f[_0x084a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 5df996e..0a7deb0 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 _0x23f6=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','/:id/clone','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x227837,_0x186ef4){var _0x29a56c=function(_0x17711a){while(--_0x17711a){_0x227837['push'](_0x227837['shift']());}};_0x29a56c(++_0x186ef4);}(_0x23f6,0x103));var _0x623f=function(_0x527212,_0xfdb598){_0x527212=_0x527212-0x0;var _0x504753=_0x23f6[_0x527212];return _0x504753;};'use strict';var multer=require(_0x623f('0x0'));var util=require(_0x623f('0x1'));var path=require(_0x623f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x623f('0x3')]();var fs_extra=require(_0x623f('0x4'));var auth=require(_0x623f('0x5'));var interaction=require(_0x623f('0x6'));var config=require(_0x623f('0x7'));var controller=require('./trunk.controller');router[_0x623f('0x8')]('/',auth[_0x623f('0x9')](),controller['index']);router[_0x623f('0x8')]('/:id',auth[_0x623f('0x9')](),controller[_0x623f('0xa')]);router[_0x623f('0xb')](_0x623f('0xc'),auth[_0x623f('0x9')](),controller['clone']);router[_0x623f('0xb')]('/',auth[_0x623f('0x9')](),controller[_0x623f('0xd')]);router[_0x623f('0xe')](_0x623f('0xf'),auth[_0x623f('0x9')](),controller[_0x623f('0x10')]);router[_0x623f('0x11')](_0x623f('0xf'),auth['isAuthenticated'](),controller[_0x623f('0x12')]);module[_0x623f('0x13')]=router; \ No newline at end of file +var _0xc48b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','post','clone','update','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x50e15f,_0x691fdb){var _0xeb1425=function(_0x281585){while(--_0x281585){_0x50e15f['push'](_0x50e15f['shift']());}};_0xeb1425(++_0x691fdb);}(_0xc48b,0x12d));var _0xbc48=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0xc48b[_0x2dc96f];return _0xd012da;};'use strict';var multer=require('multer');var util=require(_0xbc48('0x0'));var path=require('path');var timeout=require(_0xbc48('0x1'));var express=require(_0xbc48('0x2'));var router=express[_0xbc48('0x3')]();var fs_extra=require(_0xbc48('0x4'));var auth=require(_0xbc48('0x5'));var interaction=require(_0xbc48('0x6'));var config=require(_0xbc48('0x7'));var controller=require(_0xbc48('0x8'));router[_0xbc48('0x9')]('/',auth['isAuthenticated'](),controller[_0xbc48('0xa')]);router[_0xbc48('0x9')](_0xbc48('0xb'),auth[_0xbc48('0xc')](),controller['show']);router[_0xbc48('0xd')]('/:id/clone',auth[_0xbc48('0xc')](),controller[_0xbc48('0xe')]);router[_0xbc48('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xbc48('0xf')]);router['delete'](_0xbc48('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xbc48('0x10')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 6a18a94..c76cac7 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 _0xee37=['split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','certificate','passive','actpass','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat'];(function(_0x28d3c7,_0x3d8072){var _0xf1105=function(_0x5044bc){while(--_0x5044bc){_0x28d3c7['push'](_0x28d3c7['shift']());}};_0xf1105(++_0x3d8072);}(_0xee37,0x1ce));var _0x7ee3=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0xee37[_0x1bb58c];return _0x277586;};'use strict';var Sequelize=require(_0x7ee3('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ee3('0x1')],'allowNull':![],'unique':_0x7ee3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x4'),_0x7ee3('0x5'),_0x7ee3('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7ee3('0x7')},'callingpres':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x8'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x7ee3('0x9'),_0x7ee3('0xa'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x7ee3('0xb'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x7ee3('0x1')]},'secret':{'type':Sequelize[_0x7ee3('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x7ee3('0x1')]},'transport':{'type':Sequelize[_0x7ee3('0x1')],'defaultValue':_0x7ee3('0xc'),'set':function(_0x363a28){this['setDataValue'](_0x7ee3('0xd'),_0x363a28?_0x363a28[_0x7ee3('0xe')](','):null);},'get':function(){return this[_0x7ee3('0xf')](_0x7ee3('0xd'))?this[_0x7ee3('0xf')](_0x7ee3('0xd'))['split'](','):null;},'comment':_0x7ee3('0x10')},'dtmfmode':{'type':Sequelize[_0x7ee3('0x3')]('rfc2833',_0x7ee3('0x11'),_0x7ee3('0x12'),'inband',_0x7ee3('0x13')),'defaultValue':_0x7ee3('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0x7ee3('0x15'),'no',_0x7ee3('0x16'),_0x7ee3('0x17'),_0x7ee3('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7ee3('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7ee3('0x1')]},'directmediadeny':{'type':Sequelize[_0x7ee3('0x1')]},'nat':{'type':Sequelize[_0x7ee3('0x1')],'defaultValue':_0x7ee3('0x19'),'set':function(_0x4f76c0){this[_0x7ee3('0x1a')]('nat',_0x4f76c0?_0x4f76c0['join'](','):null);},'get':function(){return this[_0x7ee3('0xf')](_0x7ee3('0x1b'))?this[_0x7ee3('0xf')](_0x7ee3('0x1b'))[_0x7ee3('0x1c')](','):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['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7ee3('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7ee3('0x1')],'defaultValue':_0x7ee3('0x1d')},'allow':{'type':Sequelize[_0x7ee3('0x1')],'allowNull':![],'defaultValue':_0x7ee3('0x1e'),'set':function(_0x308ad1){this['setDataValue'](_0x7ee3('0x1f'),_0x308ad1?_0x308ad1[_0x7ee3('0xe')](';'):_0x7ee3('0x1e'));},'get':function(){return this['getDataValue']('allow')?this[_0x7ee3('0xf')](_0x7ee3('0x1f'))[_0x7ee3('0x1c')](';'):null;},'comment':_0x7ee3('0x20')},'autoframing':{'type':Sequelize['ENUM'](_0x7ee3('0x15'),'no')},'insecure':{'type':Sequelize[_0x7ee3('0x1')],'defaultValue':_0x7ee3('0x21'),'set':function(_0x3103b5){this[_0x7ee3('0x1a')]('insecure',_0x3103b5?_0x3103b5['join'](','):null);},'get':function(){return this[_0x7ee3('0xf')](_0x7ee3('0x22'))?this[_0x7ee3('0xf')](_0x7ee3('0x22'))[_0x7ee3('0x1c')](','):null;},'comment':_0x7ee3('0x23')},'trustrpid':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no','never')},'promiscredir':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no')},'useclientcode':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no')},'accountcode':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'setvar':{'type':Sequelize[_0x7ee3('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x7ee3('0x25')},'amaflags':{'type':Sequelize[_0x7ee3('0x1')]},'callcounter':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no'),'defaultValue':_0x7ee3('0x15')},'busylevel':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x7ee3('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0x7ee3('0x1')]},'template':{'type':Sequelize[_0x7ee3('0x1')]},'videosupport':{'type':Sequelize[_0x7ee3('0x3')]('yes','no',_0x7ee3('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no')},'mailbox':{'type':Sequelize[_0x7ee3('0x1')]},'session_timers':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x27'),_0x7ee3('0x28'),'originate')},'session_expires':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x29'),'uas'),'defaultValue':_0x7ee3('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x7ee3('0x1')]},'regexten':{'type':Sequelize[_0x7ee3('0x1')]},'fromdomain':{'type':Sequelize[_0x7ee3('0x1')]},'fromuser':{'type':Sequelize[_0x7ee3('0x1')]},'port':{'type':Sequelize[_0x7ee3('0x24')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x7ee3('0x1')]},'rtptimeout':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x7ee3('0x15'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7ee3('0x1')]},'callbackextension':{'type':Sequelize[_0x7ee3('0x1')]},'timert1':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'timerb':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x7ee3('0x1')]},'contactdeny':{'type':Sequelize[_0x7ee3('0x1')]},'contactacl':{'type':Sequelize[_0x7ee3('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x7ee3('0x1')]},'use_q850_reason':{'type':Sequelize[_0x7ee3('0x1')]},'maxforwards':{'type':Sequelize[_0x7ee3('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x7ee3('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7ee3('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no')},'icesupport':{'type':Sequelize[_0x7ee3('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x7ee3('0x3')]('yes','no',_0x7ee3('0x2b'),_0x7ee3('0x2c'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x7ee3('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x7ee3('0x1')]},'dtlscipher':{'type':Sequelize[_0x7ee3('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x7ee3('0x3')]('active',_0x7ee3('0x2d'),_0x7ee3('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7ee3('0x1')]},'usereqphone':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7ee3('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x7ee3('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0x7ee3('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0x7ee3('0x1')]},'mohinterpret':{'type':Sequelize[_0x7ee3('0x1')]},'mohsuggest':{'type':Sequelize[_0x7ee3('0x1')]},'parkinglot':{'type':Sequelize[_0x7ee3('0x1')]},'description':{'type':Sequelize[_0x7ee3('0x1')]},'host':{'type':Sequelize[_0x7ee3('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x7ee3('0x3')](_0x7ee3('0x15'),'no',_0x7ee3('0x16'),'update',_0x7ee3('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7ee3('0x1')]},'otherFields':{'type':Sequelize[_0x7ee3('0x1')]},'active':{'type':Sequelize[_0x7ee3('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x0af3=['shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','\x22\x22\x20<>','always','INTEGER','accept','refuse','originate','uac','uas','pai','certificate','active','actpass','dynamic','BOOLEAN','sequelize','exports','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','PROHIB_NOT_SCREENED','STRING','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833'];(function(_0x55dcaa,_0x55f333){var _0x5aea42=function(_0x40e234){while(--_0x40e234){_0x55dcaa['push'](_0x55dcaa['shift']());}};_0x5aea42(++_0x55f333);}(_0x0af3,0xe8));var _0x30af=function(_0x4ffbf0,_0x4203e3){_0x4ffbf0=_0x4ffbf0-0x0;var _0x33236b=_0x0af3[_0x4ffbf0];return _0x33236b;};'use strict';var Sequelize=require(_0x30af('0x0'));module[_0x30af('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x30af('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x4'),_0x30af('0x5'),_0x30af('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x30af('0x7')},'callingpres':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x8'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED',_0x30af('0x9'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x30af('0xa')]},'secret':{'type':Sequelize[_0x30af('0xa')]},'md5secret':{'type':Sequelize[_0x30af('0xa')]},'remotesecret':{'type':Sequelize[_0x30af('0xa')]},'transport':{'type':Sequelize[_0x30af('0xa')],'defaultValue':_0x30af('0xb'),'set':function(_0x811ac){this[_0x30af('0xc')](_0x30af('0xd'),_0x811ac?_0x811ac[_0x30af('0xe')](','):null);},'get':function(){return this[_0x30af('0xf')](_0x30af('0xd'))?this[_0x30af('0xf')](_0x30af('0xd'))['split'](','):null;},'comment':_0x30af('0x10')},'dtmfmode':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x11'),'info',_0x30af('0x12'),_0x30af('0x13'),_0x30af('0x14')),'defaultValue':_0x30af('0x11')},'directmedia':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no',_0x30af('0x16'),_0x30af('0x17'),_0x30af('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x30af('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x30af('0xa')]},'directmediadeny':{'type':Sequelize[_0x30af('0xa')]},'nat':{'type':Sequelize[_0x30af('0xa')],'defaultValue':_0x30af('0x19'),'set':function(_0x30bc81){this[_0x30af('0xc')]('nat',_0x30bc81?_0x30bc81[_0x30af('0xe')](','):null);},'get':function(){return this[_0x30af('0xf')]('nat')?this[_0x30af('0xf')](_0x30af('0x1a'))[_0x30af('0x1b')](','):null;},'comment':_0x30af('0x1c')},'callgroup':{'type':Sequelize[_0x30af('0xa')]},'namedcallgroup':{'type':Sequelize[_0x30af('0xa')]},'pickupgroup':{'type':Sequelize[_0x30af('0xa')]},'namedpickupgroup':{'type':Sequelize[_0x30af('0xa')]},'language':{'type':Sequelize[_0x30af('0xa')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x30af('0xa')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x30af('0xa')],'defaultValue':_0x30af('0x1d')},'allow':{'type':Sequelize[_0x30af('0xa')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x138b3f){this[_0x30af('0xc')](_0x30af('0x1e'),_0x138b3f?_0x138b3f['join'](';'):_0x30af('0x1f'));},'get':function(){return this['getDataValue'](_0x30af('0x1e'))?this[_0x30af('0xf')]('allow')[_0x30af('0x1b')](';'):null;},'comment':_0x30af('0x20')},'autoframing':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no')},'insecure':{'type':Sequelize[_0x30af('0xa')],'defaultValue':_0x30af('0x21'),'set':function(_0x5be947){this[_0x30af('0xc')]('insecure',_0x5be947?_0x5be947['join'](','):null);},'get':function(){return this['getDataValue'](_0x30af('0x22'))?this[_0x30af('0xf')](_0x30af('0x22'))[_0x30af('0x1b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no',_0x30af('0x23'))},'promiscredir':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no')},'useclientcode':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x30af('0xa')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x30af('0x24')},'amaflags':{'type':Sequelize[_0x30af('0xa')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x30af('0x15')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x30af('0xa')]},'videosupport':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no',_0x30af('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x30af('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x30af('0x15'),'no')},'mailbox':{'type':Sequelize[_0x30af('0xa')]},'session_timers':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x27'),_0x30af('0x28'),_0x30af('0x29'))},'session_expires':{'type':Sequelize[_0x30af('0x26')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x30af('0x2a'),'uas'),'defaultValue':_0x30af('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x30af('0xa')]},'regexten':{'type':Sequelize[_0x30af('0xa')]},'fromdomain':{'type':Sequelize[_0x30af('0xa')]},'fromuser':{'type':Sequelize[_0x30af('0xa')]},'port':{'type':Sequelize[_0x30af('0x26')](0x5)},'qualify':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no'),'defaultValue':_0x30af('0x15')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x30af('0xa')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x30af('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x30af('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x30af('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no',_0x30af('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x30af('0xa')]},'timert1':{'type':Sequelize[_0x30af('0x26')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x30af('0xa')]},'contactdeny':{'type':Sequelize[_0x30af('0xa')]},'contactacl':{'type':Sequelize[_0x30af('0xa')]},'unsolicited_mailbox':{'type':Sequelize[_0x30af('0xa')]},'use_q850_reason':{'type':Sequelize[_0x30af('0xa')]},'maxforwards':{'type':Sequelize[_0x30af('0x26')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x30af('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x30af('0x3')]('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0x30af('0x15'),'no')},'icesupport':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x30af('0x3')]('yes','no','fingerprint',_0x30af('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x30af('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x30af('0xa')]},'dtlsprivatekey':{'type':Sequelize[_0x30af('0xa')]},'dtlscipher':{'type':Sequelize[_0x30af('0xa')]},'dtlscafile':{'type':Sequelize[_0x30af('0xa')]},'dtlscapath':{'type':Sequelize[_0x30af('0xa')]},'dtlssetup':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x2e'),'passive',_0x30af('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x30af('0xa')]},'usereqphone':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x30af('0xa')]},'recordofffeature':{'type':Sequelize[_0x30af('0xa')]},'call_limit':{'type':Sequelize[_0x30af('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x30af('0x15'),'no')},'subscribemwi':{'type':Sequelize[_0x30af('0x3')](_0x30af('0x15'),'no')},'vmexten':{'type':Sequelize[_0x30af('0xa')]},'mohinterpret':{'type':Sequelize[_0x30af('0xa')]},'mohsuggest':{'type':Sequelize[_0x30af('0xa')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x30af('0xa')]},'host':{'type':Sequelize[_0x30af('0xa')],'defaultValue':_0x30af('0x30')},'canreinvite':{'type':Sequelize['ENUM'](_0x30af('0x15'),'no',_0x30af('0x16'),_0x30af('0x17'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x30af('0xa')]},'otherFields':{'type':Sequelize[_0x30af('0xa')]},'active':{'type':Sequelize[_0x30af('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x30af('0xa')],'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 62ebacd..ecdc153 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 _0xabd8=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','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','count','offset','limit','set','Content-Range','reject','save','then','Trunks','UserProfileResource','destroy','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','Trunk','includeAll','include','findAll','show','params','keys','length','find','clone','get','omit','updatedAt','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','utf8','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','render','/etc/asterisk/sip_xcally_registers.conf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x14a209,_0x2ee981){var _0x2e0eba=function(_0x1f78af){while(--_0x1f78af){_0x14a209['push'](_0x14a209['shift']());}};_0x2e0eba(++_0x2ee981);}(_0xabd8,0x142));var _0x8abd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xabd8[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8abd('0x0'));var rp=require(_0x8abd('0x1'));var moment=require(_0x8abd('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8abd('0x3'));var util=require(_0x8abd('0x4'));var path=require(_0x8abd('0x5'));var sox=require(_0x8abd('0x6'));var csv=require(_0x8abd('0x7'));var ejs=require(_0x8abd('0x8'));var fs=require('fs');var fs_extra=require(_0x8abd('0x9'));var _=require(_0x8abd('0xa'));var squel=require(_0x8abd('0xb'));var crypto=require(_0x8abd('0xc'));var jsforce=require(_0x8abd('0xd'));var deskjs=require(_0x8abd('0xe'));var toCsv=require(_0x8abd('0x7'));var querystring=require('querystring');var Papa=require(_0x8abd('0xf'));var Redis=require(_0x8abd('0x10'));var authService=require(_0x8abd('0x11'));var qs=require(_0x8abd('0x12'));var as=require(_0x8abd('0x13'));var hardwareService=require(_0x8abd('0x14'));var logger=require(_0x8abd('0x15'))(_0x8abd('0x16'));var utils=require(_0x8abd('0x17'));var config=require(_0x8abd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8abd('0x19'))['db'];var jayson=require(_0x8abd('0x1a'));var client=jayson[_0x8abd('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x208df8,_0xba05a4,_0x32f6fc,_0x767f76){return new BPromise(function(_0x10915d,_0x7da358){var _0xaa39c0=_0x767f76||client;return _0xaa39c0[_0x8abd('0x1c')](_0x208df8,_0x32f6fc)['then'](function(_0x4942c2){logger[_0x8abd('0x1d')](_0x8abd('0x1e'),_0xba05a4,_0x8abd('0x1f'));logger[_0x8abd('0x20')](_0x8abd('0x21'),_0xba05a4,_0x8abd('0x1f'),JSON[_0x8abd('0x22')](_0x4942c2));if(_0x4942c2['error']){if(_0x4942c2[_0x8abd('0x23')][_0x8abd('0x24')]===0x1f4){logger[_0x8abd('0x23')](_0x8abd('0x1e'),_0xba05a4,_0x4942c2[_0x8abd('0x23')][_0x8abd('0x25')]);return _0x7da358(_0x4942c2[_0x8abd('0x23')]['message']);}logger['error'](_0x8abd('0x1e'),_0xba05a4,_0x4942c2[_0x8abd('0x23')][_0x8abd('0x25')]);return _0x10915d(_0x4942c2['error'][_0x8abd('0x25')]);}else{logger[_0x8abd('0x1d')]('Trunk,\x20%s,\x20%s',_0xba05a4,_0x8abd('0x1f'));_0x10915d(_0x4942c2[_0x8abd('0x26')][_0x8abd('0x25')]);}})[_0x8abd('0x27')](function(_0x4d74a6){logger[_0x8abd('0x23')](_0x8abd('0x1e'),_0xba05a4,_0x4d74a6);_0x7da358(_0x4d74a6);});});}function respondWithStatusCode(_0xf9f6a6,_0x17e649){_0x17e649=_0x17e649||0xcc;return function(_0x597aec){if(_0x597aec){return _0xf9f6a6['sendStatus'](_0x17e649);}return _0xf9f6a6[_0x8abd('0x28')](_0x17e649)[_0x8abd('0x29')]();};}function respondWithResult(_0x34013b,_0x14a5b7){_0x14a5b7=_0x14a5b7||0xc8;return function(_0x5d64ea){if(_0x5d64ea){return _0x34013b[_0x8abd('0x28')](_0x14a5b7)[_0x8abd('0x2a')](_0x5d64ea);}};}function respondWithFilteredResult(_0x5799dc,_0x25b372){return function(_0x2f4a39){if(_0x2f4a39){var _0x4d07f6=_0x2f4a39[_0x8abd('0x2b')],_0x34aa0b=_0x25b372[_0x8abd('0x2c')],_0x4b817d=_0x25b372[_0x8abd('0x2c')]+_0x25b372[_0x8abd('0x2d')],_0x120564;if(_0x4b817d>=_0x4d07f6){_0x4b817d=_0x4d07f6;_0x120564=0xc8;}else{_0x120564=0xce;}_0x5799dc[_0x8abd('0x28')](_0x120564);return _0x5799dc[_0x8abd('0x2e')](_0x8abd('0x2f'),_0x34aa0b+'-'+_0x4b817d+'/'+_0x4d07f6)[_0x8abd('0x2a')](_0x2f4a39);}return null;};}function patchUpdates(_0x57a157){return function(_0x51acfe){try{jsonpatch['apply'](_0x51acfe,_0x57a157,!![]);}catch(_0x32729d){return BPromise[_0x8abd('0x30')](_0x32729d);}return _0x51acfe[_0x8abd('0x31')]();};}function saveUpdates(_0x51f718,_0x2211a6){return function(_0x4395f4){if(_0x4395f4){return _0x4395f4['update'](_0x51f718)[_0x8abd('0x32')](function(_0x47a659){return _0x47a659;});}return null;};}function removeEntity(_0x23420e,_0x45b2b1){return function(_0x568088){if(_0x568088){return _0x568088['destroy']()[_0x8abd('0x32')](function(){var _0x2ff17=_0x568088['get']({'plain':!![]});var _0x3153df=_0x8abd('0x33');return db[_0x8abd('0x34')][_0x8abd('0x35')]({'where':{'type':_0x3153df,'resourceId':_0x2ff17['id']}})['then'](function(){return _0x568088;});})[_0x8abd('0x32')](function(){_0x23420e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16c76e,_0x3eec8d){return function(_0xb3cf2b){if(!_0xb3cf2b){_0x16c76e['sendStatus'](0x194);}return _0xb3cf2b;};}function handleError(_0x489e2f,_0x4cc689){_0x4cc689=_0x4cc689||0x1f4;return function(_0x257340){logger['error'](_0x257340[_0x8abd('0x36')]);if(_0x257340['name']){delete _0x257340[_0x8abd('0x37')];}_0x489e2f[_0x8abd('0x28')](_0x4cc689)[_0x8abd('0x38')](_0x257340);};}exports['index']=function(_0x4111e0,_0x17dd6b){var _0x14969e={},_0x591607={},_0x21f607={'count':0x0,'rows':[]};var _0x16b7b8=_['map'](db['Trunk'][_0x8abd('0x39')],function(_0x6f4000){return{'name':_0x6f4000[_0x8abd('0x3a')],'type':_0x6f4000['type'][_0x8abd('0x3b')]};});_0x591607[_0x8abd('0x3c')]=_[_0x8abd('0x3d')](_0x16b7b8,_0x8abd('0x37'));_0x591607[_0x8abd('0x3e')]=_['keys'](_0x4111e0['query']);_0x591607[_0x8abd('0x3f')]=_['intersection'](_0x591607[_0x8abd('0x3c')],_0x591607[_0x8abd('0x3e')]);_0x14969e[_0x8abd('0x40')]=_[_0x8abd('0x41')](_0x591607[_0x8abd('0x3c')],qs[_0x8abd('0x42')](_0x4111e0['query'][_0x8abd('0x42')]));_0x14969e[_0x8abd('0x40')]=_0x14969e['attributes']['length']?_0x14969e['attributes']:_0x591607['model'];if(!_0x4111e0[_0x8abd('0x3e')][_0x8abd('0x43')](_0x8abd('0x44'))){_0x14969e[_0x8abd('0x2d')]=qs[_0x8abd('0x2d')](_0x4111e0['query'][_0x8abd('0x2d')]);_0x14969e['offset']=qs['offset'](_0x4111e0['query'][_0x8abd('0x2c')]);}_0x14969e[_0x8abd('0x45')]=qs[_0x8abd('0x46')](_0x4111e0[_0x8abd('0x3e')][_0x8abd('0x46')]);_0x14969e['where']=qs[_0x8abd('0x3f')](_[_0x8abd('0x47')](_0x4111e0[_0x8abd('0x3e')],_0x591607[_0x8abd('0x3f')]),_0x16b7b8);if(_0x4111e0['query']['filter']){_0x14969e[_0x8abd('0x48')]=_[_0x8abd('0x49')](_0x14969e['where'],{'$or':_[_0x8abd('0x3d')](_0x16b7b8,function(_0x34b51c){if(_0x34b51c[_0x8abd('0x4a')]!==_0x8abd('0x4b')){var _0x24b632={};_0x24b632[_0x34b51c[_0x8abd('0x37')]]={'$like':'%'+_0x4111e0['query']['filter']+'%'};return _0x24b632;}})});}_0x14969e=_[_0x8abd('0x49')]({},_0x14969e,_0x4111e0[_0x8abd('0x4c')]);var _0x55f0ce={'where':_0x14969e[_0x8abd('0x48')]};return db[_0x8abd('0x4d')][_0x8abd('0x2b')](_0x55f0ce)[_0x8abd('0x32')](function(_0x24d8bd){_0x21f607[_0x8abd('0x2b')]=_0x24d8bd;if(_0x4111e0[_0x8abd('0x3e')][_0x8abd('0x4e')]){_0x14969e[_0x8abd('0x4f')]=[{'all':!![]}];}return db['Trunk'][_0x8abd('0x50')](_0x14969e);})[_0x8abd('0x32')](function(_0x2d541a){_0x21f607['rows']=_0x2d541a;return _0x21f607;})[_0x8abd('0x32')](respondWithFilteredResult(_0x17dd6b,_0x14969e))[_0x8abd('0x27')](handleError(_0x17dd6b,null));};exports[_0x8abd('0x51')]=function(_0x42a17e,_0x4f6133){var _0x1dd891={'raw':![],'where':{'id':_0x42a17e[_0x8abd('0x52')]['id']}},_0x14c9e9={};_0x14c9e9[_0x8abd('0x3c')]=_[_0x8abd('0x53')](db[_0x8abd('0x4d')][_0x8abd('0x39')]);_0x14c9e9[_0x8abd('0x3e')]=_[_0x8abd('0x53')](_0x42a17e[_0x8abd('0x3e')]);_0x14c9e9[_0x8abd('0x3f')]=_['intersection'](_0x14c9e9[_0x8abd('0x3c')],_0x14c9e9[_0x8abd('0x3e')]);_0x1dd891[_0x8abd('0x40')]=_[_0x8abd('0x41')](_0x14c9e9[_0x8abd('0x3c')],qs['fields'](_0x42a17e[_0x8abd('0x3e')][_0x8abd('0x42')]));_0x1dd891['attributes']=_0x1dd891[_0x8abd('0x40')][_0x8abd('0x54')]?_0x1dd891['attributes']:_0x14c9e9['model'];if(_0x42a17e[_0x8abd('0x3e')][_0x8abd('0x4e')]){_0x1dd891[_0x8abd('0x4f')]=[{'all':!![]}];}_0x1dd891=_['merge']({},_0x1dd891,_0x42a17e[_0x8abd('0x4c')]);return db[_0x8abd('0x4d')][_0x8abd('0x55')](_0x1dd891)[_0x8abd('0x32')](handleEntityNotFound(_0x4f6133,null))[_0x8abd('0x32')](respondWithResult(_0x4f6133,null))[_0x8abd('0x27')](handleError(_0x4f6133,null));};exports[_0x8abd('0x56')]=function(_0x4a5d54,_0x27f4ae){var _0x499955={'where':{'id':_0x4a5d54[_0x8abd('0x52')]['id']}},_0x1c157b={};_0x1c157b['model']=_['keys'](db[_0x8abd('0x4d')][_0x8abd('0x39')]);_0x499955[_0x8abd('0x40')]=_[_0x8abd('0x41')](_0x1c157b[_0x8abd('0x3c')],qs[_0x8abd('0x42')](_0x4a5d54['query'][_0x8abd('0x42')]));_0x499955[_0x8abd('0x40')]=_0x499955['attributes'][_0x8abd('0x54')]?_0x499955['attributes']:_0x1c157b[_0x8abd('0x3c')];if(_0x4a5d54[_0x8abd('0x3e')][_0x8abd('0x4e')]){_0x499955[_0x8abd('0x4f')]=[{'all':!![]}];}_0x499955=_[_0x8abd('0x49')]({},_0x499955,_0x4a5d54[_0x8abd('0x4c')]);return db[_0x8abd('0x4d')][_0x8abd('0x55')](_0x499955)[_0x8abd('0x32')](handleEntityNotFound(_0x27f4ae,null))[_0x8abd('0x32')](function(_0x824c25){if(_0x824c25){var _0x26c077=_0x824c25[_0x8abd('0x57')]({'plain':!![]});_0x26c077=qs[_0x8abd('0x58')](_0x26c077,['id','createdAt',_0x8abd('0x59')]);_0x4a5d54[_0x8abd('0x5a')]=_[_0x8abd('0x58')](_0x4a5d54[_0x8abd('0x5a')],['id',_0x8abd('0x5b'),_0x8abd('0x59')]);return db['Trunk'][_0x8abd('0x5c')](_[_0x8abd('0x49')](_0x26c077,_0x4a5d54[_0x8abd('0x5a')]),{'include':_0x4a5d54[_0x8abd('0x3e')][_0x8abd('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x11b907){var _0x314b81=_0x4a5d54[_0x8abd('0x5d')][_0x8abd('0x57')]({'plain':!![]});if(!_0x314b81)throw new Error(_0x8abd('0x5e'));if(_0x314b81[_0x8abd('0x5f')]==='user'){var _0x185c58=_0x11b907[_0x8abd('0x57')]({'plain':!![]});var _0x4aec79='Trunks';return db[_0x8abd('0x60')][_0x8abd('0x55')]({'where':{'name':_0x4aec79,'userProfileId':_0x314b81[_0x8abd('0x61')]},'raw':!![]})['then'](function(_0x47e4e7){if(_0x47e4e7&&_0x47e4e7[_0x8abd('0x62')]===0x0){return db[_0x8abd('0x34')][_0x8abd('0x5c')]({'name':_0x185c58[_0x8abd('0x37')],'resourceId':_0x185c58['id'],'type':_0x47e4e7[_0x8abd('0x37')],'sectionId':_0x47e4e7['id']},{})['then'](function(){return _0x11b907;});}else{return _0x11b907;}})[_0x8abd('0x27')](function(_0x412fcf){logger['error'](_0x8abd('0x63'),_0x412fcf);throw _0x412fcf;});}return _0x11b907;});}})[_0x8abd('0x32')](respondWithResult(_0x27f4ae,0xc9))[_0x8abd('0x27')](handleError(_0x27f4ae,null));};exports[_0x8abd('0x5c')]=function(_0x46b889,_0xd79148,_0x2fc712){var _0x2b5068;return db[_0x8abd('0x4d')][_0x8abd('0x5c')](_0x46b889[_0x8abd('0x5a')],{'raw':!![]})[_0x8abd('0x32')](function(_0x462040){_0x2b5068=_0x462040;return db[_0x8abd('0x4d')][_0x8abd('0x50')]({'raw':!![]});})['then'](function(_0x7b0216){var _0x374867=fs[_0x8abd('0x64')](path[_0x8abd('0x65')](config[_0x8abd('0x66')],'server/files/templates/trunk.ejs'),_0x8abd('0x67'));var _0x308c0f=fs[_0x8abd('0x64')](path[_0x8abd('0x65')](config[_0x8abd('0x66')],_0x8abd('0x68')),_0x8abd('0x67'));var _0x158a79=ejs['render'](_0x374867,{'trunks':_0x7b0216||[]});fs[_0x8abd('0x69')](_0x8abd('0x6a'),_0x158a79);if(_0x2b5068[_0x8abd('0x6b')]){var _0x539700=ejs['render'](_0x308c0f,{'trunks':_0x7b0216||[]});fs[_0x8abd('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x539700);}})[_0x8abd('0x32')](function(){return respondWithRpcPromise(_0x8abd('0x6c'),_0x8abd('0x5c'),{'module':_0x8abd('0x6d')});})[_0x8abd('0x32')](function(){var _0x5443e6=_0x46b889[_0x8abd('0x5d')][_0x8abd('0x57')]({'plain':!![]});if(!_0x5443e6)throw new Error(_0x8abd('0x5e'));if(_0x5443e6['role']===_0x8abd('0x5d')){var _0x52f921=_0x2b5068[_0x8abd('0x57')]({'plain':!![]});return db[_0x8abd('0x60')][_0x8abd('0x55')]({'where':{'name':_0x8abd('0x33'),'userProfileId':_0x5443e6['userProfileId']},'raw':!![]})[_0x8abd('0x32')](function(_0x395821){if(_0x395821&&_0x395821['autoAssociation']===0x0){return db['UserProfileResource'][_0x8abd('0x5c')]({'name':_0x52f921['name'],'resourceId':_0x52f921['id'],'type':_0x395821[_0x8abd('0x37')],'sectionId':_0x395821['id']},{})[_0x8abd('0x32')](function(){return _0x2b5068;});}else{return _0x2b5068;}})[_0x8abd('0x27')](function(_0x454154){logger[_0x8abd('0x23')](_0x8abd('0x63'),_0x454154);throw _0x454154;});}return _0x2b5068;})[_0x8abd('0x32')](respondWithResult(_0xd79148,0xc9))['catch'](handleError(_0xd79148,null));};exports[_0x8abd('0x6e')]=function(_0x85dc4d,_0x2bedd5,_0x5a36a0){var _0x3119ff;return db['Trunk'][_0x8abd('0x55')]({'where':{'id':_0x85dc4d[_0x8abd('0x52')]['id']}})[_0x8abd('0x32')](handleEntityNotFound(_0x2bedd5,null))[_0x8abd('0x32')](saveUpdates(_0x85dc4d[_0x8abd('0x5a')],null))[_0x8abd('0x32')](function(_0x1aeb7d){if(_0x1aeb7d){_0x3119ff=_0x1aeb7d;return db[_0x8abd('0x4d')][_0x8abd('0x50')]({'raw':!![]});}})[_0x8abd('0x32')](function(_0x35b807){if(_0x35b807){var _0x49ffcb=fs['readFileSync'](path['join'](config['root'],_0x8abd('0x6f')),_0x8abd('0x67'));var _0x25397d=fs[_0x8abd('0x64')](path[_0x8abd('0x65')](config['root'],_0x8abd('0x68')),'utf8');var _0x4509fd=ejs[_0x8abd('0x70')](_0x49ffcb,{'trunks':_0x35b807||[]});fs[_0x8abd('0x69')](_0x8abd('0x6a'),_0x4509fd);var _0x12775f=ejs[_0x8abd('0x70')](_0x25397d,{'trunks':_0x35b807||[]});fs[_0x8abd('0x69')](_0x8abd('0x71'),_0x12775f);return respondWithRpcPromise(_0x8abd('0x6c'),_0x8abd('0x6e'),{'module':_0x8abd('0x6d')});}return null;})['then'](function(_0x58bb37){if(_0x58bb37){return _0x3119ff;}})[_0x8abd('0x32')](respondWithResult(_0x2bedd5,null))[_0x8abd('0x27')](handleError(_0x2bedd5,null));};exports['destroy']=function(_0x6ef91f,_0x2b2237,_0x18ed74){var _0x59ca93;return db[_0x8abd('0x4d')][_0x8abd('0x55')]({'where':{'id':_0x6ef91f[_0x8abd('0x52')]['id']}})[_0x8abd('0x32')](handleEntityNotFound(_0x2b2237,null))[_0x8abd('0x32')](removeEntity(_0x2b2237,null))[_0x8abd('0x32')](function(){return db[_0x8abd('0x4d')][_0x8abd('0x50')]({'raw':!![]});})[_0x8abd('0x32')](function(_0x575049){var _0x2912bc=fs[_0x8abd('0x64')](path[_0x8abd('0x65')](config['root'],_0x8abd('0x6f')),'utf8');var _0x3e6575=fs[_0x8abd('0x64')](path[_0x8abd('0x65')](config['root'],_0x8abd('0x68')),_0x8abd('0x67'));var _0x574bb7=ejs[_0x8abd('0x70')](_0x2912bc,{'trunks':_0x575049});var _0x797ce5=ejs[_0x8abd('0x70')](_0x3e6575,{'trunks':_0x575049});fs[_0x8abd('0x69')]('/etc/asterisk/sip_xcally_trunks.conf',_0x574bb7);fs['writeFileSync'](_0x8abd('0x71'),_0x797ce5);return respondWithRpcPromise('Reload','destroy',{'module':_0x8abd('0x6d')});})[_0x8abd('0x27')](handleError(_0x2b2237,null));}; \ No newline at end of file +var _0x8d00=['pick','filters','filter','merge','Trunk','include','rows','show','params','rawAttributes','includeAll','clone','options','find','omit','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','create','findAll','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','UserProfileResource','update','render','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','client','http','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','sendStatus','status','end','count','offset','Content-Range','apply','reject','save','destroy','get','Trunks','stack','name','send','index','map','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8d00,0x160));var _0x08d0=function(_0x21a746,_0x389e79){_0x21a746=_0x21a746-0x0;var _0x2c9076=_0x8d00[_0x21a746];return _0x2c9076;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x08d0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x08d0('0x1'));var moment=require(_0x08d0('0x2'));var BPromise=require(_0x08d0('0x3'));var Mustache=require(_0x08d0('0x4'));var util=require('util');var path=require(_0x08d0('0x5'));var sox=require(_0x08d0('0x6'));var csv=require('to-csv');var ejs=require(_0x08d0('0x7'));var fs=require('fs');var fs_extra=require(_0x08d0('0x8'));var _=require(_0x08d0('0x9'));var squel=require('squel');var crypto=require(_0x08d0('0xa'));var jsforce=require(_0x08d0('0xb'));var deskjs=require(_0x08d0('0xc'));var toCsv=require(_0x08d0('0xd'));var querystring=require(_0x08d0('0xe'));var Papa=require(_0x08d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x08d0('0x10'));var as=require(_0x08d0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x08d0('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x08d0('0x13'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x08d0('0x14')][_0x08d0('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x52323e,_0x3f9310,_0x2b2f53,_0x5867c3){return new BPromise(function(_0x57fa2a,_0x151e49){var _0x1dca0a=_0x5867c3||client;return _0x1dca0a['request'](_0x52323e,_0x2b2f53)[_0x08d0('0x16')](function(_0x6dafae){logger[_0x08d0('0x17')](_0x08d0('0x18'),_0x3f9310,'request\x20sent');logger[_0x08d0('0x19')](_0x08d0('0x1a'),_0x3f9310,'request\x20sent',JSON['stringify'](_0x6dafae));if(_0x6dafae[_0x08d0('0x1b')]){if(_0x6dafae[_0x08d0('0x1b')][_0x08d0('0x1c')]===0x1f4){logger[_0x08d0('0x1b')](_0x08d0('0x18'),_0x3f9310,_0x6dafae[_0x08d0('0x1b')][_0x08d0('0x1d')]);return _0x151e49(_0x6dafae[_0x08d0('0x1b')][_0x08d0('0x1d')]);}logger[_0x08d0('0x1b')]('Trunk,\x20%s,\x20%s',_0x3f9310,_0x6dafae[_0x08d0('0x1b')][_0x08d0('0x1d')]);return _0x57fa2a(_0x6dafae[_0x08d0('0x1b')][_0x08d0('0x1d')]);}else{logger[_0x08d0('0x17')](_0x08d0('0x18'),_0x3f9310,_0x08d0('0x1e'));_0x57fa2a(_0x6dafae[_0x08d0('0x1f')]['message']);}})[_0x08d0('0x20')](function(_0x91c3ad){logger[_0x08d0('0x1b')](_0x08d0('0x18'),_0x3f9310,_0x91c3ad);_0x151e49(_0x91c3ad);});});}function respondWithStatusCode(_0x453ed2,_0x380b3a){_0x380b3a=_0x380b3a||0xcc;return function(_0x47ec7f){if(_0x47ec7f){return _0x453ed2[_0x08d0('0x21')](_0x380b3a);}return _0x453ed2[_0x08d0('0x22')](_0x380b3a)[_0x08d0('0x23')]();};}function respondWithResult(_0xb31ccd,_0x182eda){_0x182eda=_0x182eda||0xc8;return function(_0x5c189c){if(_0x5c189c){return _0xb31ccd[_0x08d0('0x22')](_0x182eda)['json'](_0x5c189c);}};}function respondWithFilteredResult(_0x41558d,_0x583b85){return function(_0x148fc3){if(_0x148fc3){var _0x4ebd8e=_0x148fc3[_0x08d0('0x24')],_0x31cf23=_0x583b85[_0x08d0('0x25')],_0x1714d5=_0x583b85[_0x08d0('0x25')]+_0x583b85['limit'],_0x1f2fa5;if(_0x1714d5>=_0x4ebd8e){_0x1714d5=_0x4ebd8e;_0x1f2fa5=0xc8;}else{_0x1f2fa5=0xce;}_0x41558d[_0x08d0('0x22')](_0x1f2fa5);return _0x41558d['set'](_0x08d0('0x26'),_0x31cf23+'-'+_0x1714d5+'/'+_0x4ebd8e)['json'](_0x148fc3);}return null;};}function patchUpdates(_0x2af407){return function(_0xc3dba){try{jsonpatch[_0x08d0('0x27')](_0xc3dba,_0x2af407,!![]);}catch(_0x3b39fc){return BPromise[_0x08d0('0x28')](_0x3b39fc);}return _0xc3dba[_0x08d0('0x29')]();};}function saveUpdates(_0x2f309f,_0x137baa){return function(_0x24f5ed){if(_0x24f5ed){return _0x24f5ed['update'](_0x2f309f)['then'](function(_0x3374a5){return _0x3374a5;});}return null;};}function removeEntity(_0x50632e,_0x3f5012){return function(_0x2b471b){if(_0x2b471b){return _0x2b471b[_0x08d0('0x2a')]()[_0x08d0('0x16')](function(){var _0x207497=_0x2b471b[_0x08d0('0x2b')]({'plain':!![]});var _0x1a69ce=_0x08d0('0x2c');return db['UserProfileResource'][_0x08d0('0x2a')]({'where':{'type':_0x1a69ce,'resourceId':_0x207497['id']}})[_0x08d0('0x16')](function(){return _0x2b471b;});})[_0x08d0('0x16')](function(){_0x50632e[_0x08d0('0x22')](0xcc)[_0x08d0('0x23')]();});}};}function handleEntityNotFound(_0x3ea793,_0x51e6f4){return function(_0x2b19b3){if(!_0x2b19b3){_0x3ea793[_0x08d0('0x21')](0x194);}return _0x2b19b3;};}function handleError(_0x463637,_0x37db5d){_0x37db5d=_0x37db5d||0x1f4;return function(_0x33d702){logger[_0x08d0('0x1b')](_0x33d702[_0x08d0('0x2d')]);if(_0x33d702['name']){delete _0x33d702[_0x08d0('0x2e')];}_0x463637['status'](_0x37db5d)[_0x08d0('0x2f')](_0x33d702);};}exports[_0x08d0('0x30')]=function(_0x50df48,_0x585c6c){var _0x95570a={},_0x2b7505={},_0x5eb30c={'count':0x0,'rows':[]};var _0x197022=_[_0x08d0('0x31')](db['Trunk']['rawAttributes'],function(_0x53464a){return{'name':_0x53464a['fieldName'],'type':_0x53464a[_0x08d0('0x32')][_0x08d0('0x33')]};});_0x2b7505[_0x08d0('0x34')]=_[_0x08d0('0x31')](_0x197022,_0x08d0('0x2e'));_0x2b7505['query']=_[_0x08d0('0x35')](_0x50df48[_0x08d0('0x36')]);_0x2b7505['filters']=_['intersection'](_0x2b7505[_0x08d0('0x34')],_0x2b7505[_0x08d0('0x36')]);_0x95570a[_0x08d0('0x37')]=_[_0x08d0('0x38')](_0x2b7505['model'],qs['fields'](_0x50df48['query'][_0x08d0('0x39')]));_0x95570a['attributes']=_0x95570a[_0x08d0('0x37')][_0x08d0('0x3a')]?_0x95570a[_0x08d0('0x37')]:_0x2b7505['model'];if(!_0x50df48[_0x08d0('0x36')][_0x08d0('0x3b')](_0x08d0('0x3c'))){_0x95570a[_0x08d0('0x3d')]=qs[_0x08d0('0x3d')](_0x50df48[_0x08d0('0x36')][_0x08d0('0x3d')]);_0x95570a[_0x08d0('0x25')]=qs[_0x08d0('0x25')](_0x50df48['query'][_0x08d0('0x25')]);}_0x95570a['order']=qs['sort'](_0x50df48['query'][_0x08d0('0x3e')]);_0x95570a[_0x08d0('0x3f')]=qs['filters'](_[_0x08d0('0x40')](_0x50df48['query'],_0x2b7505[_0x08d0('0x41')]),_0x197022);if(_0x50df48[_0x08d0('0x36')][_0x08d0('0x42')]){_0x95570a[_0x08d0('0x3f')]=_[_0x08d0('0x43')](_0x95570a[_0x08d0('0x3f')],{'$or':_[_0x08d0('0x31')](_0x197022,function(_0xed795){if(_0xed795[_0x08d0('0x32')]!=='VIRTUAL'){var _0x1fba19={};_0x1fba19[_0xed795[_0x08d0('0x2e')]]={'$like':'%'+_0x50df48[_0x08d0('0x36')][_0x08d0('0x42')]+'%'};return _0x1fba19;}})});}_0x95570a=_['merge']({},_0x95570a,_0x50df48['options']);var _0x320f20={'where':_0x95570a[_0x08d0('0x3f')]};return db[_0x08d0('0x44')][_0x08d0('0x24')](_0x320f20)[_0x08d0('0x16')](function(_0x580649){_0x5eb30c[_0x08d0('0x24')]=_0x580649;if(_0x50df48['query']['includeAll']){_0x95570a[_0x08d0('0x45')]=[{'all':!![]}];}return db[_0x08d0('0x44')]['findAll'](_0x95570a);})[_0x08d0('0x16')](function(_0x13313b){_0x5eb30c[_0x08d0('0x46')]=_0x13313b;return _0x5eb30c;})['then'](respondWithFilteredResult(_0x585c6c,_0x95570a))[_0x08d0('0x20')](handleError(_0x585c6c,null));};exports[_0x08d0('0x47')]=function(_0x44b602,_0x4ff944){var _0xcb8f51={'raw':![],'where':{'id':_0x44b602[_0x08d0('0x48')]['id']}},_0x31e871={};_0x31e871[_0x08d0('0x34')]=_['keys'](db[_0x08d0('0x44')][_0x08d0('0x49')]);_0x31e871['query']=_[_0x08d0('0x35')](_0x44b602['query']);_0x31e871[_0x08d0('0x41')]=_[_0x08d0('0x38')](_0x31e871['model'],_0x31e871[_0x08d0('0x36')]);_0xcb8f51['attributes']=_['intersection'](_0x31e871[_0x08d0('0x34')],qs[_0x08d0('0x39')](_0x44b602[_0x08d0('0x36')][_0x08d0('0x39')]));_0xcb8f51['attributes']=_0xcb8f51[_0x08d0('0x37')][_0x08d0('0x3a')]?_0xcb8f51[_0x08d0('0x37')]:_0x31e871[_0x08d0('0x34')];if(_0x44b602[_0x08d0('0x36')][_0x08d0('0x4a')]){_0xcb8f51[_0x08d0('0x45')]=[{'all':!![]}];}_0xcb8f51=_[_0x08d0('0x43')]({},_0xcb8f51,_0x44b602['options']);return db[_0x08d0('0x44')]['find'](_0xcb8f51)[_0x08d0('0x16')](handleEntityNotFound(_0x4ff944,null))[_0x08d0('0x16')](respondWithResult(_0x4ff944,null))[_0x08d0('0x20')](handleError(_0x4ff944,null));};exports[_0x08d0('0x4b')]=function(_0x48fb59,_0x101340){var _0x2f2155={'where':{'id':_0x48fb59[_0x08d0('0x48')]['id']}},_0x5b093d={};_0x5b093d['model']=_[_0x08d0('0x35')](db[_0x08d0('0x44')][_0x08d0('0x49')]);_0x2f2155[_0x08d0('0x37')]=_[_0x08d0('0x38')](_0x5b093d['model'],qs[_0x08d0('0x39')](_0x48fb59[_0x08d0('0x36')]['fields']));_0x2f2155[_0x08d0('0x37')]=_0x2f2155['attributes'][_0x08d0('0x3a')]?_0x2f2155[_0x08d0('0x37')]:_0x5b093d['model'];if(_0x48fb59[_0x08d0('0x36')]['includeAll']){_0x2f2155[_0x08d0('0x45')]=[{'all':!![]}];}_0x2f2155=_[_0x08d0('0x43')]({},_0x2f2155,_0x48fb59[_0x08d0('0x4c')]);return db[_0x08d0('0x44')][_0x08d0('0x4d')](_0x2f2155)[_0x08d0('0x16')](handleEntityNotFound(_0x101340,null))['then'](function(_0x40c6b0){if(_0x40c6b0){var _0x429941=_0x40c6b0[_0x08d0('0x2b')]({'plain':!![]});_0x429941=qs[_0x08d0('0x4e')](_0x429941,['id','createdAt',_0x08d0('0x4f')]);_0x48fb59['body']=_['omit'](_0x48fb59[_0x08d0('0x50')],['id',_0x08d0('0x51'),_0x08d0('0x4f')]);return db[_0x08d0('0x44')]['create'](_[_0x08d0('0x43')](_0x429941,_0x48fb59[_0x08d0('0x50')]),{'include':_0x48fb59[_0x08d0('0x36')]['includeAll']?[{'all':!![]}]:undefined})[_0x08d0('0x16')](function(_0x2fdc4e){var _0x201ae5=_0x48fb59['user']['get']({'plain':!![]});if(!_0x201ae5)throw new Error(_0x08d0('0x52'));if(_0x201ae5[_0x08d0('0x53')]===_0x08d0('0x54')){var _0x2ea642=_0x2fdc4e[_0x08d0('0x2b')]({'plain':!![]});var _0x5d7a50=_0x08d0('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x5d7a50,'userProfileId':_0x201ae5[_0x08d0('0x55')]},'raw':!![]})[_0x08d0('0x16')](function(_0x46486b){if(_0x46486b&&_0x46486b[_0x08d0('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x2ea642[_0x08d0('0x2e')],'resourceId':_0x2ea642['id'],'type':_0x46486b[_0x08d0('0x2e')],'sectionId':_0x46486b['id']},{})['then'](function(){return _0x2fdc4e;});}else{return _0x2fdc4e;}})['catch'](function(_0x289785){logger[_0x08d0('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x289785);throw _0x289785;});}return _0x2fdc4e;});}})[_0x08d0('0x16')](respondWithResult(_0x101340,0xc9))[_0x08d0('0x20')](handleError(_0x101340,null));};exports[_0x08d0('0x57')]=function(_0x21df66,_0x6822f5,_0x2ff026){var _0x52ada2;return db[_0x08d0('0x44')][_0x08d0('0x57')](_0x21df66['body'],{'raw':!![]})['then'](function(_0x46295d){_0x52ada2=_0x46295d;return db[_0x08d0('0x44')][_0x08d0('0x58')]({'raw':!![]});})[_0x08d0('0x16')](function(_0x22d484){var _0x319837=fs[_0x08d0('0x59')](path[_0x08d0('0x5a')](config[_0x08d0('0x5b')],_0x08d0('0x5c')),_0x08d0('0x5d'));var _0x281065=fs[_0x08d0('0x59')](path[_0x08d0('0x5a')](config[_0x08d0('0x5b')],_0x08d0('0x5e')),'utf8');var _0x4f52fd=ejs['render'](_0x319837,{'trunks':_0x22d484||[]});fs[_0x08d0('0x5f')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f52fd);if(_0x52ada2[_0x08d0('0x60')]){var _0x4a838d=ejs['render'](_0x281065,{'trunks':_0x22d484||[]});fs[_0x08d0('0x5f')](_0x08d0('0x61'),_0x4a838d);}})[_0x08d0('0x16')](function(){return respondWithRpcPromise(_0x08d0('0x62'),_0x08d0('0x57'),{'module':_0x08d0('0x63')});})[_0x08d0('0x16')](function(){var _0x4c1842=_0x21df66[_0x08d0('0x54')]['get']({'plain':!![]});if(!_0x4c1842)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c1842[_0x08d0('0x53')]===_0x08d0('0x54')){var _0x1d1244=_0x52ada2['get']({'plain':!![]});return db[_0x08d0('0x64')][_0x08d0('0x4d')]({'where':{'name':_0x08d0('0x2c'),'userProfileId':_0x4c1842[_0x08d0('0x55')]},'raw':!![]})[_0x08d0('0x16')](function(_0xfb3823){if(_0xfb3823&&_0xfb3823[_0x08d0('0x56')]===0x0){return db[_0x08d0('0x65')][_0x08d0('0x57')]({'name':_0x1d1244[_0x08d0('0x2e')],'resourceId':_0x1d1244['id'],'type':_0xfb3823[_0x08d0('0x2e')],'sectionId':_0xfb3823['id']},{})['then'](function(){return _0x52ada2;});}else{return _0x52ada2;}})['catch'](function(_0x3d780b){logger[_0x08d0('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d780b);throw _0x3d780b;});}return _0x52ada2;})[_0x08d0('0x16')](respondWithResult(_0x6822f5,0xc9))[_0x08d0('0x20')](handleError(_0x6822f5,null));};exports[_0x08d0('0x66')]=function(_0xd6936d,_0x214a32,_0xa054a4){var _0x533c53;return db['Trunk'][_0x08d0('0x4d')]({'where':{'id':_0xd6936d[_0x08d0('0x48')]['id']}})[_0x08d0('0x16')](handleEntityNotFound(_0x214a32,null))[_0x08d0('0x16')](saveUpdates(_0xd6936d[_0x08d0('0x50')],null))[_0x08d0('0x16')](function(_0x63a8b2){if(_0x63a8b2){_0x533c53=_0x63a8b2;return db[_0x08d0('0x44')][_0x08d0('0x58')]({'raw':!![]});}})[_0x08d0('0x16')](function(_0x3d1f02){if(_0x3d1f02){var _0x5d81c6=fs[_0x08d0('0x59')](path['join'](config[_0x08d0('0x5b')],_0x08d0('0x5c')),_0x08d0('0x5d'));var _0xa436c9=fs['readFileSync'](path[_0x08d0('0x5a')](config[_0x08d0('0x5b')],_0x08d0('0x5e')),'utf8');var _0x3d703c=ejs['render'](_0x5d81c6,{'trunks':_0x3d1f02||[]});fs[_0x08d0('0x5f')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3d703c);var _0x5b0cce=ejs[_0x08d0('0x67')](_0xa436c9,{'trunks':_0x3d1f02||[]});fs[_0x08d0('0x5f')](_0x08d0('0x61'),_0x5b0cce);return respondWithRpcPromise(_0x08d0('0x62'),_0x08d0('0x66'),{'module':_0x08d0('0x63')});}return null;})[_0x08d0('0x16')](function(_0x54c368){if(_0x54c368){return _0x533c53;}})['then'](respondWithResult(_0x214a32,null))[_0x08d0('0x20')](handleError(_0x214a32,null));};exports['destroy']=function(_0x42c8c6,_0x324d42,_0x51405c){var _0x3eb8c8;return db[_0x08d0('0x44')][_0x08d0('0x4d')]({'where':{'id':_0x42c8c6['params']['id']}})[_0x08d0('0x16')](handleEntityNotFound(_0x324d42,null))[_0x08d0('0x16')](removeEntity(_0x324d42,null))[_0x08d0('0x16')](function(){return db[_0x08d0('0x44')][_0x08d0('0x58')]({'raw':!![]});})[_0x08d0('0x16')](function(_0x9ce842){var _0x5ac804=fs[_0x08d0('0x59')](path['join'](config[_0x08d0('0x5b')],'server/files/templates/trunk.ejs'),_0x08d0('0x5d'));var _0x5cdc9=fs[_0x08d0('0x59')](path['join'](config[_0x08d0('0x5b')],_0x08d0('0x5e')),_0x08d0('0x5d'));var _0x67fd5f=ejs[_0x08d0('0x67')](_0x5ac804,{'trunks':_0x9ce842});var _0x124781=ejs[_0x08d0('0x67')](_0x5cdc9,{'trunks':_0x9ce842});fs[_0x08d0('0x5f')]('/etc/asterisk/sip_xcally_trunks.conf',_0x67fd5f);fs[_0x08d0('0x5f')](_0x08d0('0x61'),_0x124781);return respondWithRpcPromise(_0x08d0('0x62'),'destroy',{'module':_0x08d0('0x63')});})[_0x08d0('0x20')](handleError(_0x324d42,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 63a6a46..a48a601 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 _0xc346=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./trunk.attributes','Trunk','tools_trunks'];(function(_0x1d20c8,_0x40e6e7){var _0x278857=function(_0x5aa6f6){while(--_0x5aa6f6){_0x1d20c8['push'](_0x1d20c8['shift']());}};_0x278857(++_0x40e6e7);}(_0xc346,0x6c));var _0x6c34=function(_0x260558,_0x2152ff){_0x260558=_0x260558-0x0;var _0x57a80b=_0xc346[_0x260558];return _0x57a80b;};'use strict';var _=require(_0x6c34('0x0'));var util=require(_0x6c34('0x1'));var logger=require(_0x6c34('0x2'))(_0x6c34('0x3'));var moment=require(_0x6c34('0x4'));var BPromise=require(_0x6c34('0x5'));var rp=require(_0x6c34('0x6'));var fs=require('fs');var path=require(_0x6c34('0x7'));var rimraf=require('rimraf');var config=require(_0x6c34('0x8'));var attributes=require(_0x6c34('0x9'));module['exports']=function(_0x3a5320,_0x410645){return _0x3a5320['define'](_0x6c34('0xa'),attributes,{'tableName':_0x6c34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2521=['moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util','api'];(function(_0x47ca97,_0x55b696){var _0x3f5ad0=function(_0x3ae487){while(--_0x3ae487){_0x47ca97['push'](_0x47ca97['shift']());}};_0x3f5ad0(++_0x55b696);}(_0x2521,0x1ea));var _0x1252=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x2521[_0x4e11d5];return _0x5e4e4c;};'use strict';var _=require('lodash');var util=require(_0x1252('0x0'));var logger=require('../../config/logger')(_0x1252('0x1'));var moment=require(_0x1252('0x2'));var BPromise=require('bluebird');var rp=require(_0x1252('0x3'));var fs=require('fs');var path=require(_0x1252('0x4'));var rimraf=require(_0x1252('0x5'));var config=require(_0x1252('0x6'));var attributes=require(_0x1252('0x7'));module[_0x1252('0x8')]=function(_0x7a07bb,_0x124c06){return _0x7a07bb[_0x1252('0x9')](_0x1252('0xa'),attributes,{'tableName':_0x1252('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 70cac69..3411095 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 _0xb10b=['../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','map','model','debug','catch','ShowTrunk','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x49f4e3,_0x523406){var _0x473267=function(_0x13ac99){while(--_0x13ac99){_0x49f4e3['push'](_0x49f4e3['shift']());}};_0x473267(++_0x523406);}(_0xb10b,0x12a));var _0xbb10=function(_0x48d732,_0x202a72){_0x48d732=_0x48d732-0x0;var _0x221c79=_0xb10b[_0x48d732];return _0x221c79;};'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,'limit':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['limit']||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x407cb4){return{'model':db[_0x407cb4[_0xbb10('0x1e')]],'as':_0x407cb4['as'],'attributes':_0x407cb4[_0xbb10('0x1b')],'include':_0x407cb4[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x407cb4[_0xbb10('0x1c')],function(_0x537898){return{'model':db[_0x537898['model']],'as':_0x537898['as'],'attributes':_0x537898['attributes'],'include':_0x537898[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x537898[_0xbb10('0x1c')],function(_0x4e25ff){return{'model':db[_0x4e25ff[_0xbb10('0x1e')]],'as':_0x4e25ff['as'],'attributes':_0x4e25ff[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x1d5e95){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')]('GetTrunk',_0x378da8,JSON[_0xbb10('0x11')](_0x1d5e95));_0x575cca(_0x1d5e95);})[_0xbb10('0x20')](function(_0xfc3595){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0xfc3595[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0xfc3595[_0xbb10('0x13')]));});});};exports['ShowTrunk']=function(_0x448d5c){var _0x56f2da=this;return new Promise(function(_0x16ad2a,_0x1dcc9c){return db[_0xbb10('0x16')]['find']({'raw':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'include':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x8c1ce6){return{'model':db[_0x8c1ce6[_0xbb10('0x1e')]],'as':_0x8c1ce6['as'],'attributes':_0x8c1ce6[_0xbb10('0x1b')],'include':_0x8c1ce6[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x8c1ce6[_0xbb10('0x1c')],function(_0x56943c){return{'model':db[_0x56943c[_0xbb10('0x1e')]],'as':_0x56943c['as'],'attributes':_0x56943c[_0xbb10('0x1b')],'include':_0x56943c[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x56943c['include'],function(_0x111762){return{'model':db[_0x111762['model']],'as':_0x111762['as'],'attributes':_0x111762['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x40c164){logger[_0xbb10('0xd')](_0xbb10('0x21'),_0x448d5c);logger[_0xbb10('0x1f')](_0xbb10('0x21'),_0x448d5c,JSON['stringify'](_0x40c164));_0x16ad2a(_0x40c164);})[_0xbb10('0x20')](function(_0x25d72f){logger['error']('ShowTrunk',_0x25d72f['message'],_0x448d5c);_0x1dcc9c(_0x56f2da[_0xbb10('0x12')](0x1f4,_0x25d72f[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x5f66=['debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','GetTrunk','findAll','options','attributes','limit','include','model','map','ShowTrunk','Trunk','raw','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x26290e,_0x811767){var _0x36e5b6=function(_0x522e67){while(--_0x522e67){_0x26290e['push'](_0x26290e['shift']());}};_0x36e5b6(++_0x811767);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f66[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('Trunk,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}exports[_0x65f6('0x15')]=function(_0x1f974c){var _0xc8660c=this;return new Promise(function(_0x18380e,_0x495dd6){return db['Trunk'][_0x65f6('0x16')]({'raw':_0x1f974c['options']?_0x1f974c['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')]['where']||null:null,'attributes':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x18')]||null:null,'limit':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x19')]||null:null,'include':_0x1f974c['options']?_0x1f974c[_0x65f6('0x17')]['include']?_['map'](_0x1f974c[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x524e42){return{'model':db[_0x524e42[_0x65f6('0x1b')]],'as':_0x524e42['as'],'attributes':_0x524e42[_0x65f6('0x18')],'include':_0x524e42[_0x65f6('0x1a')]?_[_0x65f6('0x1c')](_0x524e42['include'],function(_0x9d7bb0){return{'model':db[_0x9d7bb0[_0x65f6('0x1b')]],'as':_0x9d7bb0['as'],'attributes':_0x9d7bb0[_0x65f6('0x18')],'include':_0x9d7bb0['include']?_['map'](_0x9d7bb0['include'],function(_0x29abdb){return{'model':db[_0x29abdb[_0x65f6('0x1b')]],'as':_0x29abdb['as'],'attributes':_0x29abdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x28f710){logger['info'](_0x65f6('0x15'),_0x1f974c);logger[_0x65f6('0xd')](_0x65f6('0x15'),_0x1f974c,JSON['stringify'](_0x28f710));_0x18380e(_0x28f710);})['catch'](function(_0x488d36){logger[_0x65f6('0x12')](_0x65f6('0x15'),_0x488d36[_0x65f6('0x11')],_0x1f974c);_0x495dd6(_0xc8660c[_0x65f6('0x12')](0x1f4,_0x488d36[_0x65f6('0x11')]));});});};exports[_0x65f6('0x1d')]=function(_0x144e55){var _0x4ace4c=this;return new Promise(function(_0x4ea23d,_0x154cbd){return db[_0x65f6('0x1e')]['find']({'raw':_0x144e55['options']?_0x144e55[_0x65f6('0x17')][_0x65f6('0x1f')]===undefined?!![]:![]:!![],'where':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')][_0x65f6('0x20')]||null:null,'attributes':_0x144e55[_0x65f6('0x17')]?_0x144e55['options'][_0x65f6('0x18')]||null:null,'include':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')]['include']?_[_0x65f6('0x1c')](_0x144e55[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x45510a){return{'model':db[_0x45510a[_0x65f6('0x1b')]],'as':_0x45510a['as'],'attributes':_0x45510a[_0x65f6('0x18')],'include':_0x45510a['include']?_[_0x65f6('0x1c')](_0x45510a[_0x65f6('0x1a')],function(_0x4f3e22){return{'model':db[_0x4f3e22[_0x65f6('0x1b')]],'as':_0x4f3e22['as'],'attributes':_0x4f3e22['attributes'],'include':_0x4f3e22[_0x65f6('0x1a')]?_['map'](_0x4f3e22[_0x65f6('0x1a')],function(_0x24f7fd){return{'model':db[_0x24f7fd['model']],'as':_0x24f7fd['as'],'attributes':_0x24f7fd[_0x65f6('0x18')]};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x3b261d){logger['info']('ShowTrunk',_0x144e55);logger[_0x65f6('0xd')]('ShowTrunk',_0x144e55,JSON[_0x65f6('0xf')](_0x3b261d));_0x4ea23d(_0x3b261d);})['catch'](function(_0x22d760){logger[_0x65f6('0x12')]('ShowTrunk',_0x22d760[_0x65f6('0x11')],_0x144e55);_0x154cbd(_0x4ace4c['error'](0x1f4,_0x22d760['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 31f6f37..71addcb 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 _0x447b=['get','isAuthenticated','/describe','describe','/whoami','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','/create_many','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','/:id/fax_accounts','addFaxAccounts','/:id/mail_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','/:id','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeApiKey','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x447b,0xe4));var _0xb447=function(_0x47d206,_0x169c68){_0x47d206=_0x47d206-0x0;var _0x52515b=_0x447b[_0x47d206];return _0x52515b;};'use strict';var multer=require(_0xb447('0x0'));var util=require(_0xb447('0x1'));var path=require('path');var timeout=require(_0xb447('0x2'));var express=require(_0xb447('0x3'));var router=express[_0xb447('0x4')]();var fs_extra=require(_0xb447('0x5'));var auth=require(_0xb447('0x6'));var interaction=require(_0xb447('0x7'));var config=require(_0xb447('0x8'));var controller=require(_0xb447('0x9'));router[_0xb447('0xa')]('/',auth[_0xb447('0xb')](),controller['index']);router['get'](_0xb447('0xc'),auth['isAuthenticated'](),controller[_0xb447('0xd')]);router[_0xb447('0xa')](_0xb447('0xe'),auth[_0xb447('0xb')](),controller[_0xb447('0xf')]);router['get'](_0xb447('0x10'),auth[_0xb447('0xb')](),controller[_0xb447('0x11')]);router[_0xb447('0xa')]('/:id',auth[_0xb447('0xb')](),controller[_0xb447('0x12')]);router[_0xb447('0xa')](_0xb447('0x13'),controller[_0xb447('0x14')]);router[_0xb447('0xa')](_0xb447('0x15'),auth[_0xb447('0xb')](),controller[_0xb447('0x16')]);router['get']('/:id/contacts',auth[_0xb447('0xb')](),controller[_0xb447('0x17')]);router['get'](_0xb447('0x18'),auth[_0xb447('0xb')](),controller[_0xb447('0x19')]);router['get']('/:id/queues_rt',auth[_0xb447('0xb')](),controller['getVoiceQueuesRt']);router[_0xb447('0xa')]('/:id/groups',auth[_0xb447('0xb')](),controller[_0xb447('0x1a')]);router[_0xb447('0xa')](_0xb447('0x1b'),auth[_0xb447('0xb')](),controller[_0xb447('0x1c')]);router[_0xb447('0xa')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0xb447('0x1d')]);router[_0xb447('0xa')](_0xb447('0x1e'),auth['isAuthenticated'](),controller[_0xb447('0x1f')]);router[_0xb447('0xa')](_0xb447('0x20'),auth[_0xb447('0xb')](),controller[_0xb447('0x21')]);router['get'](_0xb447('0x22'),auth[_0xb447('0xb')](),controller[_0xb447('0x23')]);router[_0xb447('0xa')](_0xb447('0x24'),auth[_0xb447('0xb')](),controller['getSmsInteractions']);router[_0xb447('0xa')](_0xb447('0x25'),auth[_0xb447('0xb')](),controller[_0xb447('0x26')]);router[_0xb447('0xa')]('/:id/whatsapp/interactions',auth[_0xb447('0xb')](),controller[_0xb447('0x27')]);router[_0xb447('0xa')](_0xb447('0x28'),auth[_0xb447('0xb')](),controller[_0xb447('0x29')]);router[_0xb447('0xa')](_0xb447('0x2a'),auth['isAuthenticated'](),controller[_0xb447('0x2b')]);router[_0xb447('0xa')](_0xb447('0x2c'),auth[_0xb447('0xb')](),controller[_0xb447('0x2d')]);router[_0xb447('0xa')](_0xb447('0x2e'),auth[_0xb447('0xb')](),controller[_0xb447('0x2f')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xb447('0x30')]);router['get']('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xb447('0x31')]);router[_0xb447('0xa')](_0xb447('0x32'),auth[_0xb447('0xb')](),controller['getOpenchannelAccounts']);router[_0xb447('0xa')](_0xb447('0x33'),auth[_0xb447('0xb')](),controller[_0xb447('0x34')]);router[_0xb447('0xa')](_0xb447('0x35'),auth[_0xb447('0xb')](),controller[_0xb447('0x36')]);router[_0xb447('0xa')](_0xb447('0x37'),auth[_0xb447('0xb')](),controller[_0xb447('0x38')]);router[_0xb447('0xa')](_0xb447('0x39'),auth['isAuthenticated'](),controller[_0xb447('0x3a')]);router[_0xb447('0xa')](_0xb447('0x3b'),auth[_0xb447('0xb')](),controller[_0xb447('0x3c')]);router[_0xb447('0xa')]('/:id/api_key',auth[_0xb447('0xb')](),controller[_0xb447('0x3d')]);router[_0xb447('0x3e')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xb447('0x3f')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb447('0x40')]);router[_0xb447('0x3e')](_0xb447('0x41'),auth['isAuthenticated'](),controller['bulkCreate']);router['post'](_0xb447('0x18'),auth['isAuthenticated'](),controller[_0xb447('0x42')]);var upload=multer({'storage':multer[_0xb447('0x43')]({'destination':function(_0x2a3af1,_0x31e16b,_0x41dab6){_0x41dab6(null,path[_0xb447('0x44')](config[_0xb447('0x45')],_0xb447('0x46')));},'filename':function(_0x3a2b3e,_0x5853b4,_0x22d816){_0x22d816(null,util['format'](_0xb447('0x47'),Date[_0xb447('0x48')](),_0x5853b4[_0xb447('0x49')]));}})});router['post'](_0xb447('0x13'),upload[_0xb447('0x4a')](_0xb447('0x4b')),controller[_0xb447('0x4c')]);router[_0xb447('0x3e')](_0xb447('0x4d'),auth['isAuthenticated'](),controller[_0xb447('0x4e')]);router[_0xb447('0x3e')]('/:id/logout',auth[_0xb447('0xb')](),controller[_0xb447('0x4f')]);router['post'](_0xb447('0x50'),auth['isAuthenticated'](),controller[_0xb447('0x51')]);router['post'](_0xb447('0x52'),auth[_0xb447('0xb')](),controller[_0xb447('0x53')]);router[_0xb447('0x3e')](_0xb447('0x28'),auth[_0xb447('0xb')](),controller[_0xb447('0x54')]);router[_0xb447('0x3e')](_0xb447('0x55'),auth[_0xb447('0xb')](),controller['addChatInteractions']);router[_0xb447('0x3e')](_0xb447('0x56'),auth[_0xb447('0xb')](),controller[_0xb447('0x57')]);router['post'](_0xb447('0x58'),auth[_0xb447('0xb')](),controller[_0xb447('0x59')]);router[_0xb447('0x3e')](_0xb447('0x5a'),auth[_0xb447('0xb')](),controller[_0xb447('0x5b')]);router['post'](_0xb447('0x5c'),auth[_0xb447('0xb')](),controller['addOpenchannelInteractions']);router[_0xb447('0x3e')](_0xb447('0x5d'),auth[_0xb447('0xb')](),controller['addWhatsappInteractions']);router[_0xb447('0x3e')](_0xb447('0x5e'),auth[_0xb447('0xb')](),controller[_0xb447('0x5f')]);router['post'](_0xb447('0x60'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0xb447('0x3e')](_0xb447('0x32'),auth[_0xb447('0xb')](),controller[_0xb447('0x61')]);router[_0xb447('0x3e')](_0xb447('0x33'),auth[_0xb447('0xb')](),controller[_0xb447('0x62')]);router[_0xb447('0x3e')](_0xb447('0x35'),auth['isAuthenticated'](),controller[_0xb447('0x63')]);router[_0xb447('0x3e')](_0xb447('0x37'),auth[_0xb447('0xb')](),controller['addWhatsappAccounts']);router['post'](_0xb447('0x39'),auth[_0xb447('0xb')](),controller[_0xb447('0x64')]);router['post'](_0xb447('0x65'),auth[_0xb447('0xb')](),controller[_0xb447('0x66')]);router[_0xb447('0x67')](_0xb447('0x68'),auth['isAuthenticated'](),controller[_0xb447('0x69')]);router[_0xb447('0x67')](_0xb447('0x6a'),auth[_0xb447('0xb')](),controller['changePassword']);router[_0xb447('0x6b')](_0xb447('0x18'),auth[_0xb447('0xb')](),controller[_0xb447('0x6c')]);router[_0xb447('0x6b')]('/:id/teams',auth[_0xb447('0xb')](),controller[_0xb447('0x6d')]);router[_0xb447('0x6b')](_0xb447('0x68'),auth[_0xb447('0xb')](),controller[_0xb447('0x6e')]);router['delete'](_0xb447('0x55'),auth[_0xb447('0xb')](),controller[_0xb447('0x6f')]);router[_0xb447('0x6b')](_0xb447('0x56'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0xb447('0x6b')](_0xb447('0x58'),auth[_0xb447('0xb')](),controller['removeFaxInteractions']);router[_0xb447('0x6b')](_0xb447('0x5a'),auth[_0xb447('0xb')](),controller['removeSmsInteractions']);router[_0xb447('0x6b')](_0xb447('0x5c'),auth[_0xb447('0xb')](),controller[_0xb447('0x70')]);router[_0xb447('0x6b')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0xb447('0x71')]);router[_0xb447('0x6b')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0xb447('0x6b')](_0xb447('0x60'),auth[_0xb447('0xb')](),controller[_0xb447('0x72')]);router['delete'](_0xb447('0x32'),auth['isAuthenticated'](),controller[_0xb447('0x73')]);router[_0xb447('0x6b')]('/:id/sms_accounts',auth[_0xb447('0xb')](),controller['removeSmsAccounts']);router['delete'](_0xb447('0x35'),auth['isAuthenticated'](),controller[_0xb447('0x74')]);router[_0xb447('0x6b')](_0xb447('0x37'),auth[_0xb447('0xb')](),controller['removeWhatsappAccounts']);router['delete']('/:id/square_projects',auth[_0xb447('0xb')](),controller['removeSquareProjects']);router[_0xb447('0x6b')](_0xb447('0x65'),auth[_0xb447('0xb')](),controller[_0xb447('0x75')]);module[_0xb447('0x76')]=router; \ No newline at end of file +var _0x503a=['/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','addContacts','post','create','/create_many','bulkCreate','diskStorage','root','server/files/images/','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','login','/:id/logout','logout','/:id/pause','/:id/unpause','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id','update','/:id/password','changePassword','removeQueues','delete','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/whoami','whoami','getPresence','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts'];(function(_0x3083a1,_0x38902b){var _0xf1fa78=function(_0x4de251){while(--_0x4de251){_0x3083a1['push'](_0x3083a1['shift']());}};_0xf1fa78(++_0x38902b);}(_0x503a,0x19d));var _0xa503=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0x503a[_0x43b06b];return _0x2c555b;};'use strict';var multer=require(_0xa503('0x0'));var util=require(_0xa503('0x1'));var path=require('path');var timeout=require(_0xa503('0x2'));var express=require('express');var router=express[_0xa503('0x3')]();var fs_extra=require(_0xa503('0x4'));var auth=require(_0xa503('0x5'));var interaction=require(_0xa503('0x6'));var config=require(_0xa503('0x7'));var controller=require('./user.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa503('0x8')]);router[_0xa503('0x9')]('/describe',auth[_0xa503('0xa')](),controller[_0xa503('0xb')]);router[_0xa503('0x9')](_0xa503('0xc'),auth[_0xa503('0xa')](),controller[_0xa503('0xd')]);router[_0xa503('0x9')]('/presence',auth[_0xa503('0xa')](),controller[_0xa503('0xe')]);router[_0xa503('0x9')]('/:id',auth[_0xa503('0xa')](),controller['show']);router[_0xa503('0x9')]('/:id/avatar',controller[_0xa503('0xf')]);router[_0xa503('0x9')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0xa503('0x10')]);router[_0xa503('0x9')](_0xa503('0x11'),auth[_0xa503('0xa')](),controller[_0xa503('0x12')]);router[_0xa503('0x9')](_0xa503('0x13'),auth[_0xa503('0xa')](),controller[_0xa503('0x14')]);router[_0xa503('0x9')](_0xa503('0x15'),auth[_0xa503('0xa')](),controller[_0xa503('0x16')]);router[_0xa503('0x9')]('/:id/groups',auth[_0xa503('0xa')](),controller[_0xa503('0x17')]);router[_0xa503('0x9')](_0xa503('0x18'),auth[_0xa503('0xa')](),controller['getRecordings']);router[_0xa503('0x9')]('/:id/screen_recordings',auth[_0xa503('0xa')](),controller[_0xa503('0x19')]);router[_0xa503('0x9')](_0xa503('0x1a'),auth[_0xa503('0xa')](),controller[_0xa503('0x1b')]);router[_0xa503('0x9')](_0xa503('0x1c'),auth[_0xa503('0xa')](),controller[_0xa503('0x1d')]);router[_0xa503('0x9')](_0xa503('0x1e'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0xa503('0x9')](_0xa503('0x1f'),auth[_0xa503('0xa')](),controller[_0xa503('0x20')]);router[_0xa503('0x9')]('/:id/fax/interactions',auth[_0xa503('0xa')](),controller[_0xa503('0x21')]);router[_0xa503('0x9')]('/:id/whatsapp/interactions',auth[_0xa503('0xa')](),controller[_0xa503('0x22')]);router['get'](_0xa503('0x23'),auth['isAuthenticated'](),controller[_0xa503('0x24')]);router[_0xa503('0x9')](_0xa503('0x25'),auth[_0xa503('0xa')](),controller['getLists']);router['get'](_0xa503('0x26'),auth[_0xa503('0xa')](),controller[_0xa503('0x27')]);router[_0xa503('0x9')](_0xa503('0x28'),auth[_0xa503('0xa')](),controller['getVoicePrefixes']);router[_0xa503('0x9')](_0xa503('0x29'),auth[_0xa503('0xa')](),controller[_0xa503('0x2a')]);router['get'](_0xa503('0x2b'),auth['isAuthenticated'](),controller[_0xa503('0x2c')]);router[_0xa503('0x9')](_0xa503('0x2d'),auth[_0xa503('0xa')](),controller[_0xa503('0x2e')]);router[_0xa503('0x9')](_0xa503('0x2f'),auth['isAuthenticated'](),controller[_0xa503('0x30')]);router[_0xa503('0x9')](_0xa503('0x31'),auth[_0xa503('0xa')](),controller[_0xa503('0x32')]);router[_0xa503('0x9')](_0xa503('0x33'),auth[_0xa503('0xa')](),controller[_0xa503('0x34')]);router['get'](_0xa503('0x35'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0xa503('0x9')](_0xa503('0x36'),auth[_0xa503('0xa')](),controller[_0xa503('0x37')]);router[_0xa503('0x9')](_0xa503('0x38'),auth[_0xa503('0xa')](),controller['getApiKey']);router['post'](_0xa503('0x11'),auth[_0xa503('0xa')](),controller[_0xa503('0x39')]);router[_0xa503('0x3a')]('/',auth[_0xa503('0xa')](),controller[_0xa503('0x3b')]);router[_0xa503('0x3a')](_0xa503('0x3c'),auth['isAuthenticated'](),controller[_0xa503('0x3d')]);router[_0xa503('0x3a')](_0xa503('0x13'),auth[_0xa503('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0xa503('0x3e')]({'destination':function(_0x1f1d8e,_0x4cd364,_0x413f13){_0x413f13(null,path['join'](config[_0xa503('0x3f')],_0xa503('0x40')));},'filename':function(_0x4e75b7,_0x181c7b,_0x38ae58){_0x38ae58(null,util['format'](_0xa503('0x41'),Date[_0xa503('0x42')](),_0x181c7b[_0xa503('0x43')]));}})});router[_0xa503('0x3a')](_0xa503('0x44'),upload[_0xa503('0x45')](_0xa503('0x46')),controller[_0xa503('0x47')]);router[_0xa503('0x3a')]('/:id/login',auth['isAuthenticated'](),controller[_0xa503('0x48')]);router[_0xa503('0x3a')](_0xa503('0x49'),auth[_0xa503('0xa')](),controller[_0xa503('0x4a')]);router[_0xa503('0x3a')](_0xa503('0x4b'),auth[_0xa503('0xa')](),controller['pause']);router[_0xa503('0x3a')](_0xa503('0x4c'),auth[_0xa503('0xa')](),controller['unpause']);router[_0xa503('0x3a')](_0xa503('0x23'),auth[_0xa503('0xa')](),controller['addTeams']);router[_0xa503('0x3a')](_0xa503('0x4d'),auth[_0xa503('0xa')](),controller['addChatInteractions']);router[_0xa503('0x3a')](_0xa503('0x4e'),auth[_0xa503('0xa')](),controller[_0xa503('0x4f')]);router[_0xa503('0x3a')](_0xa503('0x50'),auth['isAuthenticated'](),controller[_0xa503('0x51')]);router[_0xa503('0x3a')](_0xa503('0x52'),auth['isAuthenticated'](),controller[_0xa503('0x53')]);router[_0xa503('0x3a')](_0xa503('0x54'),auth[_0xa503('0xa')](),controller[_0xa503('0x55')]);router[_0xa503('0x3a')](_0xa503('0x56'),auth[_0xa503('0xa')](),controller[_0xa503('0x57')]);router['post']('/:id/fax_accounts',auth[_0xa503('0xa')](),controller['addFaxAccounts']);router['post'](_0xa503('0x2b'),auth['isAuthenticated'](),controller[_0xa503('0x58')]);router[_0xa503('0x3a')](_0xa503('0x2d'),auth[_0xa503('0xa')](),controller[_0xa503('0x59')]);router[_0xa503('0x3a')](_0xa503('0x2f'),auth[_0xa503('0xa')](),controller['addSmsAccounts']);router[_0xa503('0x3a')](_0xa503('0x31'),auth[_0xa503('0xa')](),controller[_0xa503('0x5a')]);router[_0xa503('0x3a')](_0xa503('0x33'),auth[_0xa503('0xa')](),controller[_0xa503('0x5b')]);router[_0xa503('0x3a')]('/:id/square_projects',auth[_0xa503('0xa')](),controller['addSquareProjects']);router[_0xa503('0x3a')]('/:id/api_key',auth[_0xa503('0xa')](),controller[_0xa503('0x5c')]);router[_0xa503('0x5d')](_0xa503('0x5e'),auth[_0xa503('0xa')](),controller[_0xa503('0x5f')]);router[_0xa503('0x5d')](_0xa503('0x60'),auth[_0xa503('0xa')](),controller[_0xa503('0x61')]);router['delete'](_0xa503('0x13'),auth[_0xa503('0xa')](),controller[_0xa503('0x62')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xa503('0x63')]('/:id',auth['isAuthenticated'](),controller[_0xa503('0x64')]);router['delete']('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0xa503('0x65')]);router[_0xa503('0x63')](_0xa503('0x4e'),auth[_0xa503('0xa')](),controller[_0xa503('0x66')]);router['delete'](_0xa503('0x50'),auth['isAuthenticated'](),controller[_0xa503('0x67')]);router[_0xa503('0x63')](_0xa503('0x52'),auth[_0xa503('0xa')](),controller[_0xa503('0x68')]);router[_0xa503('0x63')](_0xa503('0x54'),auth['isAuthenticated'](),controller[_0xa503('0x69')]);router['delete'](_0xa503('0x56'),auth[_0xa503('0xa')](),controller[_0xa503('0x6a')]);router[_0xa503('0x63')](_0xa503('0x29'),auth[_0xa503('0xa')](),controller[_0xa503('0x6b')]);router[_0xa503('0x63')](_0xa503('0x2b'),auth[_0xa503('0xa')](),controller[_0xa503('0x6c')]);router[_0xa503('0x63')](_0xa503('0x2d'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0xa503('0x63')](_0xa503('0x2f'),auth[_0xa503('0xa')](),controller[_0xa503('0x6d')]);router[_0xa503('0x63')](_0xa503('0x31'),auth[_0xa503('0xa')](),controller[_0xa503('0x6e')]);router[_0xa503('0x63')](_0xa503('0x33'),auth[_0xa503('0xa')](),controller[_0xa503('0x6f')]);router[_0xa503('0x63')](_0xa503('0x35'),auth[_0xa503('0xa')](),controller['removeSquareProjects']);router['delete'](_0xa503('0x38'),auth['isAuthenticated'](),controller[_0xa503('0x70')]);module[_0xa503('0x71')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 3d4a7b0..8499b1a 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 _0xecae=['force_avp','dtlsenable','dtlscertfile','dtlsprivatekey','rtcp_mux','icesupport','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','fullname','format','internal','email','toLowerCase','admin','user','agent','telephone','local','INTEGER','callerid','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','update','update,nonat','showWebBar','get','wss','encryption','avpf'];(function(_0x2fc660,_0xc8376a){var _0x2a2a7f=function(_0x288680){while(--_0x288680){_0x2fc660['push'](_0x2fc660['shift']());}};_0x2a2a7f(++_0xc8376a);}(_0xecae,0xcc));var _0xeeca=function(_0x8ed364,_0xf255a3){_0x8ed364=_0x8ed364-0x0;var _0x4dadd1=_0xecae[_0x8ed364];return _0x4dadd1;};'use strict';var Sequelize=require(_0xeeca('0x0'));var moment=require(_0xeeca('0x1'));var util=require(_0xeeca('0x2'));var _=require(_0xeeca('0x3'));module[_0xeeca('0x4')]={'name':{'type':Sequelize[_0xeeca('0x5')],'allowNull':![],'unique':_0xeeca('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5e94a0){this[_0xeeca('0x7')](_0xeeca('0x6'),_0x5e94a0);this['setDataValue'](_0xeeca('0x8'),_0x5e94a0);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xeeca('0x5')],'allowNull':![],'set':function(_0x43e04c){this[_0xeeca('0x7')](_0xeeca('0x9'),_0x43e04c);this['setDataValue']('callerid',util[_0xeeca('0xa')]('\x22%s\x22\x20<%s>',_0x43e04c,this['getDataValue'](_0xeeca('0xb'))));}},'alias':{'type':Sequelize[_0xeeca('0x5')]},'email':{'type':Sequelize[_0xeeca('0x5')],'allowNull':![],'unique':_0xeeca('0xc'),'validate':{'isEmail':!![]},'set':function(_0x4d1427){if(_0x4d1427){this['setDataValue'](_0xeeca('0xc'),_0x4d1427[_0xeeca('0xd')]());}}},'role':{'type':Sequelize['ENUM'](_0xeeca('0xe'),_0xeeca('0xf'),_0xeeca('0x10'),_0xeeca('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0xeeca('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xeeca('0x5')],'defaultValue':_0xeeca('0x12')},'internal':{'type':Sequelize[_0xeeca('0x13')](0xb),'allowNull':![],'unique':_0xeeca('0xb'),'set':function(_0x2b9a84){this[_0xeeca('0x7')](_0xeeca('0xb'),_0x2b9a84);this['setDataValue']('accountcode',_0x2b9a84);this['setDataValue'](_0xeeca('0x14'),util[_0xeeca('0xa')]('\x22%s\x22\x20<%s>',this[_0xeeca('0x15')](_0xeeca('0x9')),_0x2b9a84));}},'salt':{'type':Sequelize[_0xeeca('0x5')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xeeca('0x5')]},'address':{'type':Sequelize[_0xeeca('0x5')]},'zipcode':{'type':Sequelize[_0xeeca('0x5')]},'userpic':{'type':Sequelize[_0xeeca('0x5')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xeeca('0x5')]},'online':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xeeca('0x17')]},'voicePause':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xeeca('0x5')],'defaultValue':_0xeeca('0x18')},'lastPauseAt':{'type':Sequelize[_0xeeca('0x17')]},'chatCapacity':{'type':Sequelize[_0xeeca('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xeeca('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xeeca('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xeeca('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xeeca('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xeeca('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xeeca('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xeeca('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xeeca('0x19')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xeeca('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xeeca('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x1b'),'user',_0xeeca('0x1c')),'allowNull':!![],'defaultValue':_0xeeca('0x1b')},'context':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![],'defaultValue':_0xeeca('0x1d')},'callingpres':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x1e'),_0xeeca('0x1f'),'ALLOWED_FAILED_SCREEN',_0xeeca('0x20'),_0xeeca('0x21'),_0xeeca('0x22'),_0xeeca('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xeeca('0x24'),'set':function(_0x3145ce){this['setDataValue'](_0xeeca('0x25'),_0x3145ce?_0x3145ce[_0xeeca('0x26')](','):null);},'get':function(){return this[_0xeeca('0x15')](_0xeeca('0x25'))?this[_0xeeca('0x15')]('transport')[_0xeeca('0x27')](','):null;},'comment':_0xeeca('0x28')},'dtmfmode':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x29'),_0xeeca('0x2a'),'shortinfo',_0xeeca('0x2b'),'auto'),'allowNull':!![],'defaultValue':_0xeeca('0x29')},'directmedia':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no',_0xeeca('0x2d'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![],'defaultValue':_0xeeca('0x2e'),'set':function(_0x3d553c){this[_0xeeca('0x7')]('nat',_0x3d553c?_0x3d553c[_0xeeca('0x26')](','):null);},'get':function(){return this['getDataValue'](_0xeeca('0x2f'))?this[_0xeeca('0x15')](_0xeeca('0x2f'))[_0xeeca('0x27')](','):null;},'comment':_0xeeca('0x30')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xeeca('0x5')]},'pickupgroup':{'type':Sequelize[_0xeeca('0x5')]},'namedpickupgroup':{'type':Sequelize[_0xeeca('0x5')]},'language':{'type':Sequelize[_0xeeca('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xeeca('0x5')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xeeca('0x31')},'allow':{'type':Sequelize[_0xeeca('0x5')],'allowNull':![],'defaultValue':_0xeeca('0x32'),'set':function(_0x35af9d){this[_0xeeca('0x7')](_0xeeca('0x33'),_0x35af9d?_0x35af9d['join'](';'):_0xeeca('0x32'));},'get':function(){return this[_0xeeca('0x15')](_0xeeca('0x33'))?this[_0xeeca('0x15')](_0xeeca('0x33'))[_0xeeca('0x27')](';'):null;},'comment':_0xeeca('0x34')},'autoframing':{'type':Sequelize['ENUM'](_0xeeca('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![],'set':function(_0x5a90d3){this['setDataValue'](_0xeeca('0x35'),_0x5a90d3?_0x5a90d3[_0xeeca('0x26')](','):null);},'get':function(){return this[_0xeeca('0x15')](_0xeeca('0x35'))?this[_0xeeca('0x15')](_0xeeca('0x35'))[_0xeeca('0x27')](','):null;},'comment':_0xeeca('0x36')},'trustrpid':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xeeca('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no',_0xeeca('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xeeca('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xeeca('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![],'defaultValue':_0xeeca('0x38')},'amaflags':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xeeca('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xeeca('0x2c')},'busylevel':{'type':Sequelize[_0xeeca('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xeeca('0x1a')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xeeca('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no',_0xeeca('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xeeca('0x3a'),_0xeeca('0x3b'),_0xeeca('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xeeca('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xeeca('0x1a')]('uac','uas'),'allowNull':!![],'defaultValue':_0xeeca('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xeeca('0x2c')},'keepalive':{'type':Sequelize[_0xeeca('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xeeca('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xeeca('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xeeca('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xeeca('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xeeca('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no','fingerprint',_0xeeca('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x3f'),_0xeeca('0x40'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xeeca('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no','nonat',_0xeeca('0x41'),_0xeeca('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xeeca('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0xeeca('0x17')]},'passwordResetAt':{'type':Sequelize[_0xeeca('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xeeca('0x5')]},'showWebBar':{'type':Sequelize[_0xeeca('0x13')],'defaultValue':0x0,'set':function(_0x2af467){this['setDataValue'](_0xeeca('0x43'),_0x2af467);var _0x30f85d=this[_0xeeca('0x44')]({'plain':!![]});switch(_0x2af467){case 0x0:case 0x1:var _0x105546=_0x30f85d[_0xeeca('0x25')]?_['isArray'](_0x30f85d[_0xeeca('0x25')])?_0x30f85d[_0xeeca('0x25')][_0xeeca('0x26')]():_0x30f85d['transport']:_0xeeca('0x24');if(_0x105546===_0xeeca('0x45')){_0x105546=_0xeeca('0x24');}this[_0xeeca('0x7')](_0xeeca('0x25'),_0x105546);this[_0xeeca('0x7')](_0xeeca('0x46'),'no');this[_0xeeca('0x7')](_0xeeca('0x47'),null);this[_0xeeca('0x7')](_0xeeca('0x48'),null);this['setDataValue']('icesupport',null);this['setDataValue'](_0xeeca('0x49'),null);this['setDataValue']('dtlsverify',null);this['setDataValue']('dtlssetup',null);this[_0xeeca('0x7')](_0xeeca('0x4a'),null);this[_0xeeca('0x7')](_0xeeca('0x4b'),null);this[_0xeeca('0x7')](_0xeeca('0x4c'),'no');break;case 0x2:this[_0xeeca('0x7')](_0xeeca('0x25'),'wss');this[_0xeeca('0x7')](_0xeeca('0x46'),'yes');this['setDataValue'](_0xeeca('0x47'),_0xeeca('0x2c'));this[_0xeeca('0x7')](_0xeeca('0x48'),_0xeeca('0x2c'));this[_0xeeca('0x7')](_0xeeca('0x4d'),_0xeeca('0x2c'));this[_0xeeca('0x7')](_0xeeca('0x49'),'yes');this['setDataValue'](_0xeeca('0x4e'),'no');this['setDataValue'](_0xeeca('0x4f'),_0xeeca('0x50'));this[_0xeeca('0x7')](_0xeeca('0x4a'),_0x30f85d['dtlscertfile']||_0xeeca('0x51'));this[_0xeeca('0x7')](_0xeeca('0x4b'),_0x30f85d['dtlsprivatekey']||_0xeeca('0x52'));this[_0xeeca('0x7')](_0xeeca('0x4c'),_0xeeca('0x2c'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x51949a){this[_0xeeca('0x7')]('permissions',_0x51949a?_0x51949a[_0xeeca('0x26')](','):[]);},'get':function(){return this[_0xeeca('0x15')](_0xeeca('0x53'))?_[_0xeeca('0x54')](this[_0xeeca('0x15')](_0xeeca('0x53'))['split'](','),function(_0x271fb0){return parseInt(_0x271fb0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xeeca('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xeeca('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0xeeca('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xeeca('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xeeca('0x1a')](_0xeeca('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xeeca('0x5')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xeeca('0x55')],'get':function(){return this[_0xeeca('0x15')]('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0xeeca('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xeeca('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xeeca('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![],'set':function(_0x29ac9d){if(typeof _0x29ac9d===_0xeeca('0x57')){var _0x241d08=_0x29ac9d==='1'?!![]:_0x29ac9d==='0'?![]:_0x29ac9d===_0xeeca('0x58')?!![]:_0x29ac9d===_0xeeca('0x59')?![]:![];this[_0xeeca('0x7')](_0xeeca('0x5a'),_0x241d08);}else{this[_0xeeca('0x7')](_0xeeca('0x5a'),_0x29ac9d);}}},'blocked':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![],'set':function(_0x34df4c){this[_0xeeca('0x7')]('blocked',_0x34df4c);if(_0x34df4c===!![]){this[_0xeeca('0x7')](_0xeeca('0x5b'),moment());this['setDataValue']('loginAttempts',0x0);}else{this['setDataValue'](_0xeeca('0x5b'),null);}}},'blockedAt':{'type':Sequelize[_0xeeca('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xeeca('0x16')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6055=['fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','isArray','wss','udp','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','force_avp','dtlssetup','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','lodash','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','email','toLowerCase','admin','user','telephone','INTEGER','internal','getDataValue','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas'];(function(_0x8b8478,_0x251af8){var _0x35c6e5=function(_0x4fc65b){while(--_0x4fc65b){_0x8b8478['push'](_0x8b8478['shift']());}};_0x35c6e5(++_0x251af8);}(_0x6055,0x7d));var _0x5605=function(_0x65b6a7,_0x10373c){_0x65b6a7=_0x65b6a7-0x0;var _0x1bc3e8=_0x6055[_0x65b6a7];return _0x1bc3e8;};'use strict';var Sequelize=require(_0x5605('0x0'));var moment=require(_0x5605('0x1'));var util=require('util');var _=require(_0x5605('0x2'));module['exports']={'name':{'type':Sequelize[_0x5605('0x3')],'allowNull':![],'unique':_0x5605('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2a1b51){this['setDataValue']('name',_0x2a1b51);this[_0x5605('0x5')]('defaultuser',_0x2a1b51);},'comment':_0x5605('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x36ed51){this[_0x5605('0x5')]('fullname',_0x36ed51);this['setDataValue'](_0x5605('0x7'),util[_0x5605('0x8')](_0x5605('0x9'),_0x36ed51,this['getDataValue']('internal')));}},'alias':{'type':Sequelize[_0x5605('0x3')]},'email':{'type':Sequelize[_0x5605('0x3')],'allowNull':![],'unique':_0x5605('0xa'),'validate':{'isEmail':!![]},'set':function(_0x38bfcf){if(_0x38bfcf){this[_0x5605('0x5')](_0x5605('0xa'),_0x38bfcf[_0x5605('0xb')]());}}},'role':{'type':Sequelize['ENUM'](_0x5605('0xc'),_0x5605('0xd'),'agent',_0x5605('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x5605('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x5605('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':![],'unique':_0x5605('0x10'),'set':function(_0x68ef1b){this[_0x5605('0x5')]('internal',_0x68ef1b);this[_0x5605('0x5')]('accountcode',_0x68ef1b);this[_0x5605('0x5')](_0x5605('0x7'),util['format'](_0x5605('0x9'),this[_0x5605('0x11')](_0x5605('0x12')),_0x68ef1b));}},'salt':{'type':Sequelize[_0x5605('0x3')]},'phone':{'type':Sequelize[_0x5605('0x3')]},'mobile':{'type':Sequelize[_0x5605('0x3')]},'address':{'type':Sequelize[_0x5605('0x3')]},'zipcode':{'type':Sequelize[_0x5605('0x3')]},'userpic':{'type':Sequelize[_0x5605('0x3')]},'city':{'type':Sequelize[_0x5605('0x3')]},'country':{'type':Sequelize[_0x5605('0x3')]},'online':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x5605('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x5605('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x5605('0x14')]},'chatCapacity':{'type':Sequelize[_0x5605('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x5605('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x5605('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x5605('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x5605('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x5605('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x5605('0x13')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![],'defaultValue':_0x5605('0x15')},'ipaddr':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x5605('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x17'),_0x5605('0xd'),_0x5605('0x18')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM'](_0x5605('0x19'),_0x5605('0x1a'),_0x5605('0x1b'),_0x5605('0x1c'),_0x5605('0x1d'),'PROHIB_PASSED_SCREEN',_0x5605('0x1e'),_0x5605('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0xffa2f8){this['setDataValue']('transport',_0xffa2f8?_0xffa2f8[_0x5605('0x20')](','):null);},'get':function(){return this[_0x5605('0x11')](_0x5605('0x21'))?this[_0x5605('0x11')](_0x5605('0x21'))[_0x5605('0x22')](','):null;},'comment':_0x5605('0x23')},'dtmfmode':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x24'),_0x5605('0x25'),_0x5605('0x26'),'inband','auto'),'allowNull':!![],'defaultValue':_0x5605('0x24')},'directmedia':{'type':Sequelize[_0x5605('0x16')]('yes','no',_0x5605('0x27'),_0x5605('0x28'),_0x5605('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5605('0x16')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x5605('0x2a'),'set':function(_0x2593c4){this[_0x5605('0x5')](_0x5605('0x2b'),_0x2593c4?_0x2593c4[_0x5605('0x20')](','):null);},'get':function(){return this[_0x5605('0x11')](_0x5605('0x2b'))?this[_0x5605('0x11')](_0x5605('0x2b'))[_0x5605('0x22')](','):null;},'comment':_0x5605('0x2c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x5605('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5605('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5605('0x3')]},'disallow':{'type':Sequelize[_0x5605('0x3')],'allowNull':![],'defaultValue':_0x5605('0x2d')},'allow':{'type':Sequelize[_0x5605('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x53bc21){this[_0x5605('0x5')](_0x5605('0x2e'),_0x53bc21?_0x53bc21[_0x5605('0x20')](';'):_0x5605('0x2f'));},'get':function(){return this[_0x5605('0x11')](_0x5605('0x2e'))?this['getDataValue'](_0x5605('0x2e'))['split'](';'):null;},'comment':_0x5605('0x30')},'autoframing':{'type':Sequelize['ENUM'](_0x5605('0x31'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0xb42722){this['setDataValue'](_0x5605('0x32'),_0xb42722?_0xb42722['join'](','):null);},'get':function(){return this[_0x5605('0x11')](_0x5605('0x32'))?this['getDataValue'](_0x5605('0x32'))[_0x5605('0x22')](','):null;},'comment':_0x5605('0x33')},'trustrpid':{'type':Sequelize['ENUM'](_0x5605('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x5605('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x31'),'no',_0x5605('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x31'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x5605('0x31'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![],'defaultValue':_0x5605('0x35')},'amaflags':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x5605('0x31'),'no'),'allowNull':!![],'defaultValue':_0x5605('0x31')},'busylevel':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x5605('0x16')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x31'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x5605('0x16')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x5605('0x31'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x5605('0x16')]('yes','no',_0x5605('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x5605('0x16')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x37'),_0x5605('0x38'),_0x5605('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac','uas'),'allowNull':!![],'defaultValue':_0x5605('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x31'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x5605('0x31'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x5605('0x16')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x31'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x5605('0x31'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x5605('0x16')]('yes','no',_0x5605('0x3b'),_0x5605('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x5605('0x3d'),_0x5605('0x3e'),_0x5605('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x31'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x5605('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x5605('0x31'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x5605('0x16')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x31'),'no',_0x5605('0x27'),_0x5605('0x28'),_0x5605('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x5605('0x14')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x5605('0x3')]},'showWebBar':{'type':Sequelize[_0x5605('0xf')],'defaultValue':0x0,'set':function(_0x590449){this[_0x5605('0x5')](_0x5605('0x41'),_0x590449);var _0x3ed9ec=this['get']({'plain':!![]});switch(_0x590449){case 0x0:case 0x1:var _0x30de86=_0x3ed9ec[_0x5605('0x21')]?_[_0x5605('0x42')](_0x3ed9ec[_0x5605('0x21')])?_0x3ed9ec['transport'][_0x5605('0x20')]():_0x3ed9ec[_0x5605('0x21')]:'udp';if(_0x30de86===_0x5605('0x43')){_0x30de86=_0x5605('0x44');}this[_0x5605('0x5')](_0x5605('0x21'),_0x30de86);this[_0x5605('0x5')](_0x5605('0x45'),'no');this['setDataValue'](_0x5605('0x46'),null);this[_0x5605('0x5')]('force_avp',null);this[_0x5605('0x5')](_0x5605('0x47'),null);this[_0x5605('0x5')](_0x5605('0x48'),null);this[_0x5605('0x5')](_0x5605('0x49'),null);this[_0x5605('0x5')]('dtlssetup',null);this[_0x5605('0x5')](_0x5605('0x4a'),null);this[_0x5605('0x5')](_0x5605('0x4b'),null);this[_0x5605('0x5')]('rtcp_mux','no');break;case 0x2:this[_0x5605('0x5')](_0x5605('0x21'),_0x5605('0x43'));this[_0x5605('0x5')](_0x5605('0x45'),_0x5605('0x31'));this[_0x5605('0x5')](_0x5605('0x46'),'yes');this['setDataValue'](_0x5605('0x4c'),_0x5605('0x31'));this['setDataValue'](_0x5605('0x47'),_0x5605('0x31'));this['setDataValue'](_0x5605('0x48'),'yes');this[_0x5605('0x5')](_0x5605('0x49'),'no');this[_0x5605('0x5')](_0x5605('0x4d'),'actpass');this[_0x5605('0x5')]('dtlscertfile',_0x3ed9ec[_0x5605('0x4a')]||_0x5605('0x4e'));this[_0x5605('0x5')](_0x5605('0x4b'),_0x3ed9ec[_0x5605('0x4b')]||_0x5605('0x4f'));this[_0x5605('0x5')](_0x5605('0x50'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x5605('0x51')],'set':function(_0xc920c3){this[_0x5605('0x5')](_0x5605('0x52'),_0xc920c3?_0xc920c3[_0x5605('0x20')](','):[]);},'get':function(){return this[_0x5605('0x11')](_0x5605('0x52'))?_[_0x5605('0x53')](this[_0x5605('0x11')]('permissions')['split'](','),function(_0x5393f0){return parseInt(_0x5393f0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x5605('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x5605('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x5605('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x5605('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x5605('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x5605('0x16')](_0x5605('0x31'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x5605('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x5605('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x5605('0x54')],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0x5605('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'interface':{'type':Sequelize[_0x5605('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x5605('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![],'set':function(_0x28c61e){if(typeof _0x28c61e===_0x5605('0x56')){var _0x193aaa=_0x28c61e==='1'?!![]:_0x28c61e==='0'?![]:_0x28c61e===_0x5605('0x57')?!![]:_0x28c61e==='false'?![]:![];this[_0x5605('0x5')](_0x5605('0x58'),_0x193aaa);}else{this[_0x5605('0x5')](_0x5605('0x58'),_0x28c61e);}}},'blocked':{'type':Sequelize[_0x5605('0x13')],'defaultValue':![],'set':function(_0x1d64f4){this[_0x5605('0x5')](_0x5605('0x59'),_0x1d64f4);if(_0x1d64f4===!![]){this[_0x5605('0x5')](_0x5605('0x5a'),moment());this[_0x5605('0x5')](_0x5605('0x5b'),0x0);}else{this['setDataValue'](_0x5605('0x5a'),null);}}},'blockedAt':{'type':Sequelize[_0x5605('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x5605('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x5605('0x13')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index b095322..65884af 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 _0x399c=['attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','sequelize','lower','col','merge','options','User','count','includeAll','include','push','true','length','sms','rows','dataValues','mail','openchannel','whatsapp','all','show','params','keys','find','openTabs','chat','body','describe','addContacts','ids','omit','Setting','findById','securePassword','validatePasswordPattern','max','internal','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','isNil','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','113','110','104','106','107','109','100','111','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','admin','settingsEnabled','userProfileId','UserProfileSection','Agents','Telephones','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','checkUserLimits','findAll','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','loginInPause','interface','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','VoiceQueue','voice','SIP/%s','each','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','remove','Queue:remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','fax','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','getContacts','CmContact','CmList','List','Tag','color','tag','Queue','getVoiceQueuesRt','getGroups','ChatGroup','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','mobile','LOCAL/%s@from-sip/n','intrf','format','user:%s','emit','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','getChannels','forEach','DEFAULT\x20PAUSE','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','unpause','manual','%s%s','Pause','Team','getTeams','addTeams','setDataValue','Voice','getMailQueues','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','flatten','transaction','getDataValue','removeTeams','Chat','Openchannel','removeAgent','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','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','getFaxAccounts','FaxAccount','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$not','$between','$notBetween','$in','$notIn','$like','$notILike','$overlap','$contains','$any','firstName','lastName','phone','Contact','dialActive','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','queues','isEmpty','teams','inbound','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','offline','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','ui.','field','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','eml-format','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','get','user','agent','telephone','filter','ignore','map','value','includes','role','name','UserProfileResource','send','index','rawAttributes','type','key','model','differenceBy','password','salt','intersection','query'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x399c,0x161));var _0xc399=function(_0x2f5c1c,_0x15edb0){_0x2f5c1c=_0x2f5c1c-0x0;var _0x1eb7a6=_0x399c[_0x2f5c1c];return _0x1eb7a6;};'use strict';var emlformat=require(_0xc399('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc399('0x1'));var jsonpatch=require(_0xc399('0x2'));var rp=require('request-promise');var moment=require(_0xc399('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc399('0x4'));var path=require('path');var sox=require(_0xc399('0x5'));var csv=require(_0xc399('0x6'));var ejs=require(_0xc399('0x7'));var fs=require('fs');var fs_extra=require(_0xc399('0x8'));var _=require(_0xc399('0x9'));var squel=require(_0xc399('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc399('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc399('0xc'));var Redis=require(_0xc399('0xd'));var values;var authService=require('../../components/auth/service');var qs=require(_0xc399('0xe'));var as=require(_0xc399('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc399('0x10'));var config=require(_0xc399('0x11'));var licenseUtil=require(_0xc399('0x12'));var db=require(_0xc399('0x13'))['db'];config[_0xc399('0x14')]=_['defaults'](config['redis'],{'host':_0xc399('0x15'),'port':0x18eb});var socket=require(_0xc399('0x16'))(new Redis(config[_0xc399('0x14')]));require('./user.socket')[_0xc399('0x17')](socket);var jayson=require(_0xc399('0x18'));var client=jayson[_0xc399('0x19')][_0xc399('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3fd2cd,_0x5cec7f,_0xd06869,_0x14b8f2){return new BPromise(function(_0x28672f,_0x4f1706){var _0x2f9965=_0x14b8f2||client;return _0x2f9965[_0xc399('0x1b')](_0x3fd2cd,_0xd06869)[_0xc399('0x1c')](function(_0x4cdb39){logger[_0xc399('0x1d')]('User,\x20%s,\x20%s',_0x5cec7f,_0xc399('0x1e'));logger[_0xc399('0x1f')](_0xc399('0x20'),_0x5cec7f,'request\x20sent',JSON['stringify'](_0x4cdb39));if(_0x4cdb39[_0xc399('0x21')]){if(_0x4cdb39[_0xc399('0x21')][_0xc399('0x22')]===0x1f4){logger['error'](_0xc399('0x23'),_0x5cec7f,_0x4cdb39['error']['message']);return _0x4f1706(_0x4cdb39['error']['message']);}logger[_0xc399('0x21')](_0xc399('0x23'),_0x5cec7f,_0x4cdb39[_0xc399('0x21')][_0xc399('0x24')]);return _0x28672f(_0x4cdb39['error'][_0xc399('0x24')]);}else{logger[_0xc399('0x1d')](_0xc399('0x23'),_0x5cec7f,_0xc399('0x1e'));_0x28672f(_0x4cdb39[_0xc399('0x25')][_0xc399('0x24')]);}})[_0xc399('0x26')](function(_0x3ab3b5){logger[_0xc399('0x21')](_0xc399('0x23'),_0x5cec7f,_0x3ab3b5);_0x4f1706(_0x3ab3b5);});});}function respondWithStatusCode(_0x34e8b9,_0x2f7b1e){_0x2f7b1e=_0x2f7b1e||0xcc;return function(_0x3d6cc4){if(_0x3d6cc4){return _0x34e8b9[_0xc399('0x27')](_0x2f7b1e);}return _0x34e8b9[_0xc399('0x28')](_0x2f7b1e)[_0xc399('0x29')]();};}function respondWithResult(_0x1b88e0,_0x283452){_0x283452=_0x283452||0xc8;return function(_0xadd887){if(_0xadd887){return _0x1b88e0[_0xc399('0x28')](_0x283452)[_0xc399('0x2a')](_0xadd887);}};}function respondWithFilteredResult(_0x49a849,_0x271d0b){return function(_0x1ecdb8){if(_0x1ecdb8){var _0x16b1c1=_0x1ecdb8['count'],_0x7c30be=_0x271d0b[_0xc399('0x2b')],_0x5ad541=_0x271d0b[_0xc399('0x2b')]+_0x271d0b['limit'],_0x307cd1;if(_0x5ad541>=_0x16b1c1){_0x5ad541=_0x16b1c1;_0x307cd1=0xc8;}else{_0x307cd1=0xce;}_0x49a849[_0xc399('0x28')](_0x307cd1);return _0x49a849[_0xc399('0x2c')](_0xc399('0x2d'),_0x7c30be+'-'+_0x5ad541+'/'+_0x16b1c1)[_0xc399('0x2a')](_0x1ecdb8);}return null;};}function patchUpdates(_0x16b54a){return function(_0x3e36b6){try{jsonpatch[_0xc399('0x2e')](_0x3e36b6,_0x16b54a,!![]);}catch(_0x677dc0){return BPromise[_0xc399('0x2f')](_0x677dc0);}return _0x3e36b6[_0xc399('0x30')]();};}function saveUpdates(_0x18fb0c,_0x12ca27){return function(_0x56389e){if(_0x56389e){return _0x56389e[_0xc399('0x31')](_0x18fb0c)[_0xc399('0x1c')](function(_0x56d6e4){return _0x56d6e4;});}return null;};}function removeEntity(_0x151475,_0x4e5acb){return function(_0x21d781){if(_0x21d781){return _0x21d781[_0xc399('0x32')]()['then'](function(){var _0x3cbea2=_0x21d781[_0xc399('0x33')]({'plain':!![]});if(_0x3cbea2['role']==='admin')return;var _0x418ca2=[{'name':'Users','value':_0xc399('0x34'),'ignore':!![]},{'name':'Agents','value':_0xc399('0x35'),'ignore':![]},{'name':'Telephones','value':_0xc399('0x36'),'ignore':![]}];var _0x5f0476=_(_0x418ca2)[_0xc399('0x37')](_0xc399('0x38'))[_0xc399('0x39')]('value')[_0xc399('0x3a')]();if(_[_0xc399('0x3b')](_0x5f0476,_0x3cbea2[_0xc399('0x3c')])){return;}var _0x4c2448=_['find'](_0x418ca2,[_0xc399('0x3a'),_0x3cbea2['role']])[_0xc399('0x3d')];return db[_0xc399('0x3e')][_0xc399('0x32')]({'where':{'type':_0x4c2448,'resourceId':_0x3cbea2['id']}})[_0xc399('0x1c')](function(){return _0x21d781;});})['then'](function(){_0x151475[_0xc399('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d467,_0xaf28a1){return function(_0x33b606){if(!_0x33b606){_0x59d467[_0xc399('0x27')](0x194);}return _0x33b606;};}function handleError(_0x466422,_0x5ccdbf){_0x5ccdbf=_0x5ccdbf||0x1f4;return function(_0x32076a){logger['error'](_0x32076a['stack']);if(_0x32076a[_0xc399('0x3d')]){delete _0x32076a[_0xc399('0x3d')];}_0x466422[_0xc399('0x28')](_0x5ccdbf)[_0xc399('0x3f')](_0x32076a);};}exports[_0xc399('0x40')]=function(_0x3b96d3,_0x5b7f81){var _0x53961e={},_0x47f8f8={},_0x2947ef={'count':0x0,'rows':[]};var _0x253932=_[_0xc399('0x39')](db['User'][_0xc399('0x41')],function(_0x3e17b8){return{'name':_0x3e17b8['fieldName'],'type':_0x3e17b8[_0xc399('0x42')][_0xc399('0x43')]};});_0x47f8f8[_0xc399('0x44')]=_[_0xc399('0x45')](_['map'](_0x253932,_0xc399('0x3d')),[_0xc399('0x46'),_0xc399('0x47')]);_0x47f8f8['query']=_['keys'](_0x3b96d3['query']);_0x47f8f8['filters']=_[_0xc399('0x48')](_0x47f8f8[_0xc399('0x44')],_0x47f8f8[_0xc399('0x49')]);_0x53961e[_0xc399('0x4a')]=_[_0xc399('0x48')](_0x47f8f8[_0xc399('0x44')],qs['fields'](_0x3b96d3[_0xc399('0x49')][_0xc399('0x4b')]));_0x53961e['attributes']=_0x53961e['attributes']['length']?_0x53961e[_0xc399('0x4a')]:_0x47f8f8['model'];if(!_0x3b96d3[_0xc399('0x49')][_0xc399('0x4c')](_0xc399('0x4d'))){_0x53961e[_0xc399('0x4e')]=qs['limit'](_0x3b96d3['query'][_0xc399('0x4e')]);_0x53961e[_0xc399('0x2b')]=qs[_0xc399('0x2b')](_0x3b96d3[_0xc399('0x49')][_0xc399('0x2b')]);}_0x53961e[_0xc399('0x4f')]=qs[_0xc399('0x50')](_0x3b96d3[_0xc399('0x49')]['sort']);_0x53961e[_0xc399('0x51')]=qs[_0xc399('0x52')](_[_0xc399('0x53')](_0x3b96d3[_0xc399('0x49')],_0x47f8f8['filters']),_0x253932);if(_0x3b96d3[_0xc399('0x49')][_0xc399('0x37')]){_0x53961e[_0xc399('0x51')]=_['merge'](_0x53961e['where'],{'$or':_[_0xc399('0x39')](_0x253932,function(_0x1af3ab){if(_0x1af3ab[_0xc399('0x42')]!==_0xc399('0x54')){return db[_0xc399('0x55')][_0xc399('0x51')](db[_0xc399('0x55')]['fn'](_0xc399('0x56'),db[_0xc399('0x55')][_0xc399('0x57')](_0x1af3ab[_0xc399('0x3d')])),{'$like':db[_0xc399('0x55')]['fn']('lower','%'+_0x3b96d3[_0xc399('0x49')][_0xc399('0x37')]+'%')});}})});}_0x53961e=_[_0xc399('0x58')]({},_0x53961e,_0x3b96d3[_0xc399('0x59')]);var _0x328522={'where':_0x53961e[_0xc399('0x51')]};return db[_0xc399('0x5a')][_0xc399('0x5b')](_0x328522)[_0xc399('0x1c')](function(_0x201e5c){_0x2947ef[_0xc399('0x5b')]=_0x201e5c;if(_0x3b96d3[_0xc399('0x49')][_0xc399('0x5c')]){_0x53961e[_0xc399('0x5d')]=[{'all':!![]}];}if(!_[_0xc399('0x3b')](_0x53961e[_0xc399('0x4a')],'id')){_0x53961e[_0xc399('0x4a')][_0xc399('0x5e')]('id');}return db[_0xc399('0x5a')]['findAll'](_0x53961e);})[_0xc399('0x1c')](function(_0x5666d6){_0x2947ef['rows']=_0x5666d6;if(_0x3b96d3[_0xc399('0x49')]['openTabs']===_0xc399('0x5f')){var _0x31300f=[];for(var _0x5f4ecd=0x0;_0x5f4ecd<_0x2947ef['rows'][_0xc399('0x60')];_0x5f4ecd++){_0x31300f['push'](get_open_tabs('chat',_0x2947ef['rows'][_0x5f4ecd]['dataValues']));_0x31300f['push'](get_open_tabs(_0xc399('0x61'),_0x2947ef[_0xc399('0x62')][_0x5f4ecd][_0xc399('0x63')]));_0x31300f['push'](get_open_tabs('fax',_0x2947ef[_0xc399('0x62')][_0x5f4ecd][_0xc399('0x63')]));_0x31300f[_0xc399('0x5e')](get_open_tabs(_0xc399('0x64'),_0x2947ef[_0xc399('0x62')][_0x5f4ecd][_0xc399('0x63')]));_0x31300f[_0xc399('0x5e')](get_open_tabs(_0xc399('0x65'),_0x2947ef[_0xc399('0x62')][_0x5f4ecd][_0xc399('0x63')]));_0x31300f['push'](get_open_tabs(_0xc399('0x66'),_0x2947ef[_0xc399('0x62')][_0x5f4ecd][_0xc399('0x63')]));}return BPromise[_0xc399('0x67')](_0x31300f)[_0xc399('0x1c')](function(_0x615c7a){return _0x2947ef;});}else{return _0x2947ef;}})[_0xc399('0x1c')](respondWithFilteredResult(_0x5b7f81,_0x53961e))[_0xc399('0x26')](handleError(_0x5b7f81,null));};exports[_0xc399('0x68')]=function(_0xef1706,_0x107750){var _0x578ab4={'raw':![],'where':{'id':_0xef1706[_0xc399('0x69')]['id']}},_0x3cd077={};_0x3cd077['model']=_[_0xc399('0x45')](_[_0xc399('0x6a')](db['User']['rawAttributes']),['password',_0xc399('0x47')]);_0x3cd077['query']=_[_0xc399('0x6a')](_0xef1706[_0xc399('0x49')]);_0x3cd077[_0xc399('0x52')]=_[_0xc399('0x48')](_0x3cd077[_0xc399('0x44')],_0x3cd077[_0xc399('0x49')]);_0x578ab4['attributes']=_[_0xc399('0x48')](_0x3cd077['model'],qs['fields'](_0xef1706[_0xc399('0x49')][_0xc399('0x4b')]));_0x578ab4[_0xc399('0x4a')]=_0x578ab4[_0xc399('0x4a')][_0xc399('0x60')]?_0x578ab4[_0xc399('0x4a')]:_0x3cd077[_0xc399('0x44')];if(_0xef1706[_0xc399('0x49')][_0xc399('0x5c')]){_0x578ab4[_0xc399('0x5d')]=[{'all':!![]}];}_0x578ab4=_[_0xc399('0x58')]({},_0x578ab4,_0xef1706[_0xc399('0x59')]);if(!_['includes'](_0x578ab4[_0xc399('0x4a')],'id')){_0x578ab4['attributes'][_0xc399('0x5e')]('id');}return db[_0xc399('0x5a')][_0xc399('0x6b')](_0x578ab4)['then'](handleEntityNotFound(_0x107750,null))[_0xc399('0x1c')](function(_0x5b45b2){var _0x3e5590=[];values=_0x5b45b2;if(_0xef1706[_0xc399('0x49')][_0xc399('0x6c')]===_0xc399('0x5f')){_0x3e5590[_0xc399('0x5e')](get_open_tabs(_0xc399('0x6d'),_0x5b45b2[_0xc399('0x63')]));_0x3e5590[_0xc399('0x5e')](get_open_tabs('sms',_0x5b45b2[_0xc399('0x63')]));_0x3e5590[_0xc399('0x5e')](get_open_tabs(_0xc399('0x65'),_0x5b45b2[_0xc399('0x63')]));_0x3e5590['push'](get_open_tabs(_0xc399('0x66'),_0x5b45b2['dataValues']));_0x3e5590[_0xc399('0x5e')](get_open_tabs('fax',_0x5b45b2['dataValues']));_0x3e5590['push'](get_open_tabs(_0xc399('0x64'),_0x5b45b2[_0xc399('0x63')]));return BPromise['all'](_0x3e5590);}else{return values;}})[_0xc399('0x1c')](function(_0x5330a4){return values;})[_0xc399('0x1c')](respondWithResult(_0x107750,null))[_0xc399('0x26')](handleError(_0x107750,null));};exports['update']=function(_0xc4431c,_0x1f8d3c){if(_0xc4431c['body']['id']){delete _0xc4431c[_0xc399('0x6e')]['id'];}delete _0xc4431c[_0xc399('0x6e')]['role'];return db[_0xc399('0x5a')][_0xc399('0x6b')]({'where':{'id':_0xc4431c[_0xc399('0x69')]['id']}})[_0xc399('0x1c')](handleEntityNotFound(_0x1f8d3c,null))[_0xc399('0x1c')](saveUpdates(_0xc4431c[_0xc399('0x6e')],null))[_0xc399('0x1c')](respondWithResult(_0x1f8d3c,null))[_0xc399('0x26')](handleError(_0x1f8d3c,null));};exports[_0xc399('0x6f')]=function(_0x134c49,_0x5ad505){return db[_0xc399('0x5a')][_0xc399('0x6f')]()['then'](respondWithResult(_0x5ad505,null))[_0xc399('0x26')](handleError(_0x5ad505,null));};exports[_0xc399('0x70')]=function(_0x326cbb,_0x5bf4c0,_0x45d834){return db['User'][_0xc399('0x6b')]({'where':{'id':_0x326cbb['params']['id']}})[_0xc399('0x1c')](handleEntityNotFound(_0x5bf4c0,null))[_0xc399('0x1c')](function(_0x462f96){if(_0x462f96){return _0x462f96['addContacts'](_0x326cbb[_0xc399('0x6e')][_0xc399('0x71')],_[_0xc399('0x72')](_0x326cbb[_0xc399('0x6e')],[_0xc399('0x71'),'id'])||{});}})[_0xc399('0x1c')](respondWithResult(_0x5bf4c0,null))['catch'](handleError(_0x5bf4c0,null));};function validateUser(_0x13ac92){return new BPromise(function(_0x1d0fb3,_0x5e1049){if(_0x13ac92['internal'])return _0x1d0fb3(_0x13ac92);return db[_0xc399('0x73')][_0xc399('0x74')](0x1)[_0xc399('0x1c')](function(_0x25f78d){if(_0x25f78d[_0xc399('0x75')])authService[_0xc399('0x76')](_0x13ac92[_0xc399('0x46')]);db[_0xc399('0x5a')][_0xc399('0x77')](_0xc399('0x78'))['then'](function(_0x57df87){if(_['isNil'](_0x57df87)){_0x13ac92['internal']=_0x25f78d[_0xc399('0x79')]||0x1;return;}if(_['isNil'](_0x25f78d['min_internal'])||_0x25f78d[_0xc399('0x79')]===_0x57df87){_0x13ac92[_0xc399('0x78')]=_0x57df87+0x1;return;}if(_0x25f78d[_0xc399('0x79')]>_0x57df87){_0x13ac92[_0xc399('0x78')]=_0x25f78d[_0xc399('0x79')];return;}return db[_0xc399('0x55')][_0xc399('0x49')](_0xc399('0x7a'),{'type':db['sequelize'][_0xc399('0x7b')][_0xc399('0x7c')]})[_0xc399('0x1c')](function(_0x185a1e){if(_0x185a1e&&_0x185a1e[_0xc399('0x60')]){for(var _0x11d3fd=0x0,_0x4018fa=_0x185a1e[_0xc399('0x60')];_0x11d3fd<_0x4018fa&&_[_0xc399('0x7d')](_0x13ac92[_0xc399('0x78')]);_0x11d3fd++){if(_0x25f78d[_0xc399('0x79')]<=_0x185a1e[_0x11d3fd][_0xc399('0x7e')]){_0x13ac92[_0xc399('0x78')]=_0x185a1e[_0x11d3fd]['from'];}else if(_0x25f78d['min_internal']>_0x185a1e[_0x11d3fd][_0xc399('0x7e')]&&_0x25f78d['min_internal']<=_0x185a1e[_0x11d3fd]['to']){_0x13ac92[_0xc399('0x78')]=_0x25f78d[_0xc399('0x79')];}}}if(_[_0xc399('0x7d')](_0x13ac92['internal'])){_0x13ac92[_0xc399('0x78')]=_0x57df87+0x1;}return _0x1d0fb3(_0x13ac92);});});})[_0xc399('0x26')](function(_0x5787d8){_0x5e1049(_0x5787d8);});});}function updateUser(_0x1efa11){return new BPromise(function(_0x645903,_0x2fad0a){try{if(_0x1efa11[_0xc399('0x7f')]){_0x1efa11[_0xc399('0x80')]=_0x1efa11[_0xc399('0x78')];_0x1efa11[_0xc399('0x81')]={'mailbox':_0x1efa11[_0xc399('0x78')],'password':_0x1efa11['password'],'fullname':_0x1efa11[_0xc399('0x82')],'email':_0x1efa11[_0xc399('0x83')]};}if(_0x1efa11['role']===_0xc399('0x35')){if(!_0x1efa11[_0xc399('0x84')])_0x1efa11['permissions']=[_0xc399('0x85'),'102','103',_0xc399('0x86'),_0xc399('0x87'),_0xc399('0x88'),'105',_0xc399('0x89'),_0xc399('0x8a'),'108',_0xc399('0x8b'),_0xc399('0x8c'),_0xc399('0x8d'),'114',_0xc399('0x8e')];}_0x645903(_0x1efa11);}catch(_0xc27dbc){_0x2fad0a(_0xc27dbc);}});}exports[_0xc399('0x8f')]=function(_0x59a3d8,_0x291687){if(_0x59a3d8['user'][_0xc399('0x3c')]===_0xc399('0x35'))throw new Error(_0xc399('0x90'));if(_0x59a3d8[_0xc399('0x6e')][_0xc399('0x3c')]===_0xc399('0x34')&&_0x59a3d8[_0xc399('0x34')]['role']!=='admin'){throw new Error(_0xc399('0x91'));}if(_0x59a3d8[_0xc399('0x6e')]['role']===_0xc399('0x92')&&_0x59a3d8[_0xc399('0x34')][_0xc399('0x3c')]!==_0xc399('0x92')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x59a3d8[_0xc399('0x6e')]])[_0xc399('0x1c')](function(){return validateUser(_0x59a3d8[_0xc399('0x6e')]);})['then'](function(_0xcef70c){return updateUser(_0xcef70c)[_0xc399('0x1c')](function(_0x26ffc1){if(_0x26ffc1[_0xc399('0x3c')]===_0xc399('0x92')){_0x26ffc1['settingsEnabled']=_0x59a3d8['user'][_0xc399('0x93')];delete _0x26ffc1[_0xc399('0x94')];}return _0x26ffc1;});})[_0xc399('0x1c')](function(_0x2b337c){return db[_0xc399('0x5a')][_0xc399('0x8f')](_0x2b337c,{'include':[{'model':db[_0xc399('0x81')],'as':_0xc399('0x81')}]});})[_0xc399('0x1c')](function(_0x4c7688){if(_0x59a3d8[_0xc399('0x6e')][_0xc399('0x3c')]===_0xc399('0x34'))return _0x4c7688;if(_0x59a3d8[_0xc399('0x34')][_0xc399('0x3c')]!==_0xc399('0x34'))return _0x4c7688;return db[_0xc399('0x95')][_0xc399('0x6b')]({'where':{'name':_0x4c7688[_0xc399('0x3c')]===_0xc399('0x35')?_0xc399('0x96'):_0xc399('0x97'),'userProfileId':_0x59a3d8[_0xc399('0x34')]['userProfileId']},'raw':!![]})[_0xc399('0x1c')](function(_0x3fb5e0){if(!_0x3fb5e0||_0x3fb5e0['autoAssociation']!=0x0)return _0x4c7688;return db['UserProfileResource'][_0xc399('0x8f')]({'name':_0x4c7688[_0xc399('0x3d')],'resourceId':_0x4c7688['id'],'type':_0x3fb5e0[_0xc399('0x3d')],'sectionId':_0x3fb5e0['id']},{})[_0xc399('0x1c')](function(){return _0x4c7688;});})[_0xc399('0x26')](function(_0x1cdf42){logger[_0xc399('0x21')](_0xc399('0x98'),_0x1cdf42);throw _0x1cdf42;});})[_0xc399('0x1c')](respondWithResult(_0x291687,0xc9))[_0xc399('0x26')](handleError(_0x291687,null));};exports[_0xc399('0x99')]=function(_0x31b63a,_0x17ca9b){var _0x5cf1fb=_0x31b63a['body'];var _0x48295c=[];if(_0x31b63a[_0xc399('0x34')]['role']===_0xc399('0x35'))throw new Error('Unauthorized');if(_['some'](_0x5cf1fb,[_0xc399('0x3c'),'user'])&&_0x31b63a[_0xc399('0x34')]['role']!==_0xc399('0x92')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xc399('0x9a')](_0x5cf1fb,[_0xc399('0x3c'),'admin'])&&_0x31b63a[_0xc399('0x34')][_0xc399('0x3c')]!==_0xc399('0x92')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xc399('0x9b')](_0x5cf1fb)[_0xc399('0x1c')](function(){return validateUser(_0x5cf1fb[0x0]);})[_0xc399('0x1c')](function(){for(var _0xeecd22=0x1;_0xeecd22<_0x5cf1fb['length'];_0xeecd22++){var _0x3b69e8=_0x5cf1fb[_0xeecd22-0x1]['internal'];if(!_0x5cf1fb[_0xeecd22][_0xc399('0x78')])_0x5cf1fb[_0xeecd22][_0xc399('0x78')]=_0x3b69e8+0x1;_0x48295c['push'](validateUser(_0x5cf1fb[_0xeecd22]));}return BPromise[_0xc399('0x67')](_0x48295c);})[_0xc399('0x1c')](function(){_0x48295c=[];for(var _0x58a1cc=0x0;_0x58a1cc<_0x5cf1fb[_0xc399('0x60')];_0x58a1cc++){_0x48295c['push'](updateUser(_0x5cf1fb[_0x58a1cc]));}return BPromise[_0xc399('0x67')](_0x48295c);})[_0xc399('0x1c')](function(){return BPromise['each'](_0x5cf1fb,function(_0x2fde35){return db[_0xc399('0x5a')][_0xc399('0x8f')](_0x2fde35,{'include':[{'model':db['VoiceMail'],'as':_0xc399('0x81')}]})[_0xc399('0x1c')](function(_0x5f349e){_0x2fde35['id']=_0x5f349e['id'];return _0x2fde35;});});})[_0xc399('0x1c')](function(_0x59f05f){if(_0x31b63a[_0xc399('0x6e')][_0xc399('0x3c')]===_0xc399('0x34'))return _0x59f05f;if(_0x31b63a[_0xc399('0x34')][_0xc399('0x3c')]!==_0xc399('0x34'))return _0x59f05f;var _0x370a42=_['some'](_0x59f05f,function(_0x471a3d){return _0x471a3d[_0xc399('0x3c')]===_0xc399('0x35')||_0x471a3d[_0xc399('0x3c')]===_0xc399('0x36');});if(!_0x370a42)return _0x59f05f;return db[_0xc399('0x95')][_0xc399('0x9c')]({'where':{'name':{'$or':['Agents',_0xc399('0x97')]},'userProfileId':_0x31b63a['user']['userProfileId']},'raw':!![]})[_0xc399('0x1c')](function(_0x2f0cc5){if(_['isEmpty'](_0x2f0cc5)||!_[_0xc399('0x9a')](_0x2f0cc5,['autoAssociation',0x0]))return _0x59f05f;_0x48295c=[];var _0x55c022=_(_0x2f0cc5)[_0xc399('0x39')](function(_0x5783f9){if(_0x5783f9[_0xc399('0x9d')]===0x1)return;return _0x5783f9[_0xc399('0x3d')]===_0xc399('0x96')?_0xc399('0x35'):'telephone';})[_0xc399('0x9e')]()[_0xc399('0x3a')]();for(var _0x2d2511=0x0;_0x2d2511<_0x59f05f['length'];_0x2d2511++){if(!_[_0xc399('0x3b')](_0x55c022,_0x59f05f[_0x2d2511][_0xc399('0x3c')]))return;var _0x28dc61=_0x59f05f[_0x2d2511][_0xc399('0x3c')]===_0xc399('0x35')?'Agents':_0xc399('0x97');_0x48295c[_0xc399('0x5e')](db[_0xc399('0x3e')][_0xc399('0x8f')]({'name':_0x59f05f[_0x2d2511][_0xc399('0x3d')],'resourceId':_0x59f05f[_0x2d2511]['id'],'type':_0x28dc61,'sectionId':_[_0xc399('0x6b')](_0x2f0cc5,[_0xc399('0x3d'),_0x28dc61])['id']},{}));}return BPromise['all'](_0x48295c);});})[_0xc399('0x1c')](respondWithResult(_0x17ca9b,0xc9))[_0xc399('0x26')](handleError(_0x17ca9b,null));};exports[_0xc399('0x9f')]=function(_0x2f3f8b,_0x7a287a,_0x156558){if(_0x2f3f8b[_0xc399('0x6e')]['id']){delete _0x2f3f8b[_0xc399('0x6e')]['id'];}return db[_0xc399('0x5a')][_0xc399('0x6b')]({'where':{'id':_0x2f3f8b[_0xc399('0x69')]['id']}})[_0xc399('0x1c')](function(_0x2c9690){if(!_0x2c9690)return null;if(_0x2c9690['id']===_0x2f3f8b[_0xc399('0x34')]['id']){if(!_0x2f3f8b['body'][_0xc399('0xa0')]||!_0x2f3f8b[_0xc399('0x6e')][_0xc399('0xa1')]){throw new db[(_0xc399('0xa2'))][(_0xc399('0xa3'))](_0xc399('0xa4'));}if(!_0x2c9690[_0xc399('0xa5')](_0x2f3f8b[_0xc399('0x6e')]['oldPassword'])){throw new db['Sequelize']['ValidationError'](_0xc399('0xa6'));}if(_0x2f3f8b[_0xc399('0x6e')][_0xc399('0xa0')]===_0x2f3f8b[_0xc399('0x6e')][_0xc399('0xa1')]){throw new db[(_0xc399('0xa2'))][(_0xc399('0xa3'))](_0xc399('0xa7'));}}else if(_0x2f3f8b['user']['role']===_0xc399('0x92')){if(!_0x2f3f8b[_0xc399('0x6e')]['newPassword']){throw new db[(_0xc399('0xa2'))][(_0xc399('0xa3'))](_0xc399('0xa8'));}}else if(_0x2f3f8b['user'][_0xc399('0x3c')]==='user'){if(!_0x2f3f8b[_0xc399('0x6e')]['newPassword']){throw new db[(_0xc399('0xa2'))][(_0xc399('0xa3'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x2c9690[_0xc399('0x3c')]!=='agent'){throw new db[(_0xc399('0xa2'))][(_0xc399('0xa3'))]('Unauthorized');}}else{throw new db[(_0xc399('0xa2'))][(_0xc399('0xa3'))](_0xc399('0x90'));}return _0x2c9690;})[_0xc399('0x1c')](handleEntityNotFound(_0x7a287a,null))[_0xc399('0x1c')](function(_0x1f42e0){return db[_0xc399('0x73')][_0xc399('0xa9')]({'attributes':['id',_0xc399('0x75'),'enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x9bbd20){if(_0x9bbd20['securePassword'])authService[_0xc399('0x76')](_0x2f3f8b[_0xc399('0x6e')][_0xc399('0xa1')]);if(!_0x9bbd20['enforcePasswordHistory']||!_0x1f42e0[_0xc399('0xaa')])return _0x1f42e0;authService[_0xc399('0xab')](_0x2f3f8b[_0xc399('0x6e')][_0xc399('0xa1')],_0x1f42e0[_0xc399('0xaa')],_0x9bbd20[_0xc399('0xac')]);return _0x1f42e0;})[_0xc399('0x1c')](saveUpdates({'password':_0x2f3f8b['body'][_0xc399('0xa1')],'passwordResetAt':_0x2f3f8b['user']['id']==_0x2f3f8b['params']['id']?moment():null,'previousPasswords':authService[_0xc399('0xad')](_0x2f3f8b[_0xc399('0x6e')][_0xc399('0xa1')],_0x1f42e0['previousPasswords'])},null));})[_0xc399('0x1c')](respondWithResult(_0x7a287a,null))[_0xc399('0x26')](handleError(_0x7a287a,null));};exports[_0xc399('0xae')]=function(_0x12fed0,_0x592250,_0x192b2c){var _0x57dcf6=_0x12fed0[_0xc399('0x6e')][_0xc399('0xaf')];return db[_0xc399('0x5a')][_0xc399('0x6b')]({'where':{'id':_0x12fed0['params']['id']},'attributes':['id',_0xc399('0x3d'),_0xc399('0x3c'),_0xc399('0xb0'),_0xc399('0xb1'),'voicePause',_0xc399('0xb2')]})['then'](handleEntityNotFound(_0x592250,null))['then'](function(_0x3797e8){if(_0x3797e8){if(!utils['isValidChannel'](_0x57dcf6)){throw new db[(_0xc399('0xa2'))]['ValidationError'](_0xc399('0xb3'));}return _0x3797e8[_0xc399('0xb4')+_[_0xc399('0xb5')](_0x57dcf6[_0xc399('0xb6')]())+_0xc399('0xb7')](_0x12fed0[_0xc399('0x6e')]['ids'],{'penalty':_0x12fed0[_0xc399('0x6e')][_0xc399('0xb8')]||0x0})[_0xc399('0xb9')](function(_0x195c02){for(var _0x1ffb58=0x0;_0x1ffb58<_0x12fed0[_0xc399('0x6e')][_0xc399('0x71')][_0xc399('0x60')];_0x1ffb58+=0x1){var _0x4426b9={'UserId':_0x12fed0['params']['id']};_0x4426b9[_[_0xc399('0xb5')](_0x57dcf6[_0xc399('0xb6')]())+_0xc399('0xba')]=_0x12fed0[_0xc399('0x6e')][_0xc399('0x71')][_0x1ffb58];socket['emit'](_0xc399('0x34')+_[_0xc399('0xb5')](_0x57dcf6[_0xc399('0xb6')]())+_0xc399('0xbb'),_0x4426b9);}return _0x195c02;})[_0xc399('0x1c')](function(){if(_0x57dcf6==='voice'){return db[_0xc399('0xbc')][_0xc399('0x9c')]({'where':{'id':_0x12fed0['body'][_0xc399('0x71')]||[]},'raw':!![],'attributes':['id',_0xc399('0x3d')]});}})[_0xc399('0x1c')](function(_0x4d1d2c){var _0x103fc7=_0x3797e8[_0xc399('0x33')]({'plain':!![]});var _0x387355=[];if(_0x57dcf6===_0xc399('0xbd')&&_0x103fc7[_0xc399('0x3c')]===_0xc399('0x35')&&_0x103fc7[_0xc399('0xb0')]){for(var _0x207d47=0x0;_0x207d47<_0x4d1d2c[_0xc399('0x60')];_0x207d47+=0x1){_0x387355[_0xc399('0x5e')]({'membername':_0x103fc7[_0xc399('0x3d')],'UserId':_0x103fc7['id'],'queue_name':_0x4d1d2c[_0x207d47]['name'],'VoiceQueueId':_0x4d1d2c[_0x207d47]['id'],'interface':_['isNil'](_0x103fc7['interface'])?util['format'](_0xc399('0xbe'),_0x103fc7[_0xc399('0x3d')]):_0x103fc7[_0xc399('0xb2')],'paused':_0x103fc7['voicePause']||![],'penalty':_0x12fed0[_0xc399('0x6e')][_0xc399('0xb8')]||0x0});}return BPromise[_0xc399('0xbf')](_0x387355,function(_0x5c6c8f){return db[_0xc399('0xc0')][_0xc399('0xc1')](_0x5c6c8f);});}return _0x3797e8;});}})['then'](respondWithStatusCode(_0x592250,null))['catch'](handleError(_0x592250,null));};exports[_0xc399('0xc2')]=function(_0x57589d,_0x41d3aa,_0x4bdbcc){var _0x569b5a;return db['User'][_0xc399('0x6b')]({'where':{'id':_0x57589d[_0xc399('0x69')]['id']},'attributes':['id',_0xc399('0x3d'),_0xc399('0x3c')]})['then'](handleEntityNotFound(_0x41d3aa,null))[_0xc399('0x1c')](function(_0x2be09a){if(_0x2be09a){_0x569b5a=_0x2be09a;if(!_0x57589d[_0xc399('0x49')]['channel']||!utils[_0xc399('0xc3')](_0x57589d[_0xc399('0x49')][_0xc399('0xaf')])){throw new db[(_0xc399('0xa2'))][(_0xc399('0xa3'))]('Unknown\x20channel');}return _0x2be09a[_0xc399('0xc4')+_[_0xc399('0xb5')](_0x57589d[_0xc399('0x49')]['channel']['toLowerCase']())+_0xc399('0xb7')](_0x57589d[_0xc399('0x49')][_0xc399('0x71')]);}})['then'](function(_0x2c0300){for(var _0x59e4b0=0x0;_0x59e4b0<_0x57589d[_0xc399('0x49')][_0xc399('0x71')]['length'];_0x59e4b0+=0x1){var _0x296291={'UserId':_0x57589d[_0xc399('0x69')]['id']};_0x296291[_[_0xc399('0xb5')](_0x57589d['query'][_0xc399('0xaf')][_0xc399('0xb6')]())+_0xc399('0xba')]=_0x57589d[_0xc399('0x49')][_0xc399('0x71')][_0x59e4b0];socket['emit'](_0xc399('0x34')+_[_0xc399('0xb5')](_0x57589d[_0xc399('0x49')][_0xc399('0xaf')][_0xc399('0xb6')]())+_0xc399('0xc5'),_0x296291);}return _0x2c0300;})[_0xc399('0x1c')](function(){if(_0x57589d[_0xc399('0x49')][_0xc399('0xaf')]===_0xc399('0xbd')){return db[_0xc399('0xc0')]['destroy']({'where':{'UserId':_0x57589d[_0xc399('0x69')]['id'],'VoiceQueueId':_0x57589d[_0xc399('0x49')][_0xc399('0x71')]},'individualHooks':!![]})[_0xc399('0x1c')](function(){return _0x569b5a;});}return _0x569b5a;})[_0xc399('0x1c')](respondWithStatusCode(_0x41d3aa,null))['catch'](handleError(_0x41d3aa,null));};exports['addAvatar']=function(_0x15c8ce,_0x14f2c6,_0x48bf8f){_0x15c8ce['body'][_0xc399('0xc6')]=_0x15c8ce[_0xc399('0xc7')][_0xc399('0xc8')];return db[_0xc399('0x5a')]['find']({'where':{'id':_0x15c8ce['params']['id']}})[_0xc399('0x1c')](handleEntityNotFound(_0x14f2c6,null))[_0xc399('0x1c')](saveUpdates(_0x15c8ce[_0xc399('0x6e')],null))[_0xc399('0x1c')](respondWithResult(_0x14f2c6,null))[_0xc399('0x26')](handleError(_0x14f2c6,null));};exports[_0xc399('0xc9')]=function(_0x4d793e,_0x41edac,_0x50bf74){var _0x48f784=path[_0xc399('0xca')](config[_0xc399('0xcb')],_0xc399('0xcc'));return db['User'][_0xc399('0x6b')]({'where':{'id':_0x4d793e['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x41edac,null))[_0xc399('0x1c')](function(_0x573284){if(_0x573284){if(_[_0xc399('0x7d')](_0x573284[_0xc399('0xc6')])){return _0x41edac[_0xc399('0xcd')](_0x48f784);}else{if(!fs[_0xc399('0xce')](path[_0xc399('0xca')](config[_0xc399('0xcb')],_0xc399('0xcf'),_0x573284[_0xc399('0xc6')]))){return _0x41edac[_0xc399('0xcd')](_0x48f784);}return _0x41edac[_0xc399('0xcd')](path[_0xc399('0xca')](config[_0xc399('0xcb')],_0xc399('0xcf'),_0x573284[_0xc399('0xc6')]));}}})[_0xc399('0x26')](handleError(_0x41edac,null));};exports[_0xc399('0xd0')]=function(_0x5577c7,_0xed5aae,_0x53a09b){return db['User']['find']({'where':{'id':_0x5577c7['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0xed5aae,null))[_0xc399('0x1c')](function(_0x1a7a53){var _0x2e8e2b=[];values=_0x1a7a53['dataValues'];_0x2e8e2b[_0xc399('0x5e')](get_open_tabs(_0xc399('0x6d'),_0x1a7a53[_0xc399('0x63')]));_0x2e8e2b['push'](get_open_tabs(_0xc399('0x61'),_0x1a7a53[_0xc399('0x63')]));_0x2e8e2b[_0xc399('0x5e')](get_open_tabs('openchannel',_0x1a7a53[_0xc399('0x63')]));_0x2e8e2b[_0xc399('0x5e')](get_open_tabs(_0xc399('0x66'),_0x1a7a53['dataValues']));_0x2e8e2b['push'](get_open_tabs(_0xc399('0xd1'),_0x1a7a53[_0xc399('0x63')]));_0x2e8e2b[_0xc399('0x5e')](get_open_tabs('mail',_0x1a7a53[_0xc399('0x63')]));return BPromise[_0xc399('0x67')](_0x2e8e2b);})[_0xc399('0x1c')](function(_0x16e612){var _0x195a95=[];if(_0x16e612){for(var _0x37d9e5=0x0;_0x37d9e5=_0x2d9e08){_0x5c09d3=_0x2d9e08;_0x395a95=0xc8;}else{_0x395a95=0xce;}_0x25eb67[_0x5ee8('0x2c')](_0x395a95);return _0x25eb67['set']('Content-Range',_0x420685+'-'+_0x5c09d3+'/'+_0x2d9e08)[_0x5ee8('0x30')](_0x2cf24c);}return null;};}function patchUpdates(_0x4f9cb0){return function(_0x3b619c){try{jsonpatch[_0x5ee8('0x31')](_0x3b619c,_0x4f9cb0,!![]);}catch(_0x3508b8){return BPromise[_0x5ee8('0x32')](_0x3508b8);}return _0x3b619c[_0x5ee8('0x33')]();};}function saveUpdates(_0x282a15,_0x24e057){return function(_0x908605){if(_0x908605){return _0x908605[_0x5ee8('0x34')](_0x282a15)[_0x5ee8('0x22')](function(_0x1a7018){return _0x1a7018;});}return null;};}function removeEntity(_0x373ee1,_0x1f1dc5){return function(_0x115b25){if(_0x115b25){return _0x115b25['destroy']()['then'](function(){var _0x215aa6=_0x115b25['get']({'plain':!![]});if(_0x215aa6[_0x5ee8('0x35')]===_0x5ee8('0x36'))return;var _0x2b1611=[{'name':_0x5ee8('0x37'),'value':_0x5ee8('0x38'),'ignore':!![]},{'name':'Agents','value':_0x5ee8('0x39'),'ignore':![]},{'name':_0x5ee8('0x3a'),'value':_0x5ee8('0x3b'),'ignore':![]}];var _0x250042=_(_0x2b1611)[_0x5ee8('0x3c')](_0x5ee8('0x3d'))['map'](_0x5ee8('0x3e'))[_0x5ee8('0x3e')]();if(_[_0x5ee8('0x3f')](_0x250042,_0x215aa6[_0x5ee8('0x35')])){return;}var _0x457463=_[_0x5ee8('0x40')](_0x2b1611,[_0x5ee8('0x3e'),_0x215aa6[_0x5ee8('0x35')]])['name'];return db[_0x5ee8('0x41')][_0x5ee8('0x42')]({'where':{'type':_0x457463,'resourceId':_0x215aa6['id']}})[_0x5ee8('0x22')](function(){return _0x115b25;});})[_0x5ee8('0x22')](function(){_0x373ee1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fd584,_0x27f1eb){return function(_0x13625a){if(!_0x13625a){_0x3fd584[_0x5ee8('0x43')](0x194);}return _0x13625a;};}function handleError(_0x3c7ab0,_0xb3c4b3){_0xb3c4b3=_0xb3c4b3||0x1f4;return function(_0x421e75){logger[_0x5ee8('0x27')](_0x421e75[_0x5ee8('0x44')]);if(_0x421e75['name']){delete _0x421e75[_0x5ee8('0x45')];}_0x3c7ab0[_0x5ee8('0x2c')](_0xb3c4b3)[_0x5ee8('0x46')](_0x421e75);};}exports[_0x5ee8('0x47')]=function(_0x67a7db,_0xb9beef){var _0x45f49e={},_0x347f86={},_0x13b3b5={'count':0x0,'rows':[]};var _0x5b9003=_[_0x5ee8('0x48')](db[_0x5ee8('0x49')][_0x5ee8('0x4a')],function(_0x5bfa81){return{'name':_0x5bfa81[_0x5ee8('0x4b')],'type':_0x5bfa81[_0x5ee8('0x4c')][_0x5ee8('0x4d')]};});_0x347f86[_0x5ee8('0x4e')]=_[_0x5ee8('0x4f')](_[_0x5ee8('0x48')](_0x5b9003,_0x5ee8('0x45')),[_0x5ee8('0x50'),'salt']);_0x347f86[_0x5ee8('0x51')]=_[_0x5ee8('0x52')](_0x67a7db['query']);_0x347f86['filters']=_[_0x5ee8('0x53')](_0x347f86[_0x5ee8('0x4e')],_0x347f86[_0x5ee8('0x51')]);_0x45f49e['attributes']=_[_0x5ee8('0x53')](_0x347f86['model'],qs[_0x5ee8('0x54')](_0x67a7db['query'][_0x5ee8('0x54')]));_0x45f49e[_0x5ee8('0x55')]=_0x45f49e[_0x5ee8('0x55')]['length']?_0x45f49e[_0x5ee8('0x55')]:_0x347f86[_0x5ee8('0x4e')];if(!_0x67a7db[_0x5ee8('0x51')]['hasOwnProperty']('nolimit')){_0x45f49e['limit']=qs['limit'](_0x67a7db[_0x5ee8('0x51')]['limit']);_0x45f49e[_0x5ee8('0x2e')]=qs['offset'](_0x67a7db['query']['offset']);}_0x45f49e[_0x5ee8('0x56')]=qs[_0x5ee8('0x57')](_0x67a7db[_0x5ee8('0x51')][_0x5ee8('0x57')]);_0x45f49e[_0x5ee8('0x58')]=qs[_0x5ee8('0x59')](_[_0x5ee8('0x5a')](_0x67a7db[_0x5ee8('0x51')],_0x347f86[_0x5ee8('0x59')]),_0x5b9003);if(_0x67a7db['query'][_0x5ee8('0x3c')]){_0x45f49e['where']=_[_0x5ee8('0x5b')](_0x45f49e[_0x5ee8('0x58')],{'$or':_[_0x5ee8('0x48')](_0x5b9003,function(_0x142977){if(_0x142977[_0x5ee8('0x4c')]!==_0x5ee8('0x5c')){return db['sequelize']['where'](db[_0x5ee8('0x5d')]['fn'](_0x5ee8('0x5e'),db[_0x5ee8('0x5d')][_0x5ee8('0x5f')](_0x142977['name'])),{'$like':db[_0x5ee8('0x5d')]['fn'](_0x5ee8('0x5e'),'%'+_0x67a7db['query'][_0x5ee8('0x3c')]+'%')});}})});}_0x45f49e=_['merge']({},_0x45f49e,_0x67a7db['options']);var _0x2f2db1={'where':_0x45f49e[_0x5ee8('0x58')]};return db['User'][_0x5ee8('0x60')](_0x2f2db1)[_0x5ee8('0x22')](function(_0x4cbd12){_0x13b3b5[_0x5ee8('0x60')]=_0x4cbd12;if(_0x67a7db[_0x5ee8('0x51')][_0x5ee8('0x61')]){_0x45f49e[_0x5ee8('0x62')]=[{'all':!![]}];}if(!_[_0x5ee8('0x3f')](_0x45f49e['attributes'],'id')){_0x45f49e[_0x5ee8('0x55')][_0x5ee8('0x63')]('id');}return db['User'][_0x5ee8('0x64')](_0x45f49e);})[_0x5ee8('0x22')](function(_0x29d618){_0x13b3b5[_0x5ee8('0x65')]=_0x29d618;if(_0x67a7db[_0x5ee8('0x51')][_0x5ee8('0x66')]==='true'){var _0x489023=[];for(var _0x158404=0x0;_0x158404<_0x13b3b5[_0x5ee8('0x65')]['length'];_0x158404++){_0x489023['push'](get_open_tabs(_0x5ee8('0x67'),_0x13b3b5[_0x5ee8('0x65')][_0x158404][_0x5ee8('0x68')]));_0x489023[_0x5ee8('0x63')](get_open_tabs(_0x5ee8('0x69'),_0x13b3b5[_0x5ee8('0x65')][_0x158404][_0x5ee8('0x68')]));_0x489023[_0x5ee8('0x63')](get_open_tabs(_0x5ee8('0x6a'),_0x13b3b5[_0x5ee8('0x65')][_0x158404][_0x5ee8('0x68')]));_0x489023[_0x5ee8('0x63')](get_open_tabs(_0x5ee8('0x6b'),_0x13b3b5[_0x5ee8('0x65')][_0x158404][_0x5ee8('0x68')]));_0x489023['push'](get_open_tabs(_0x5ee8('0x6c'),_0x13b3b5['rows'][_0x158404][_0x5ee8('0x68')]));_0x489023['push'](get_open_tabs(_0x5ee8('0x6d'),_0x13b3b5[_0x5ee8('0x65')][_0x158404][_0x5ee8('0x68')]));}return BPromise[_0x5ee8('0x6e')](_0x489023)[_0x5ee8('0x22')](function(_0x4fc978){return _0x13b3b5;});}else{return _0x13b3b5;}})[_0x5ee8('0x22')](respondWithFilteredResult(_0xb9beef,_0x45f49e))[_0x5ee8('0x2b')](handleError(_0xb9beef,null));};exports[_0x5ee8('0x6f')]=function(_0x10db28,_0x2aab19){var _0x2885c8={'raw':![],'where':{'id':_0x10db28['params']['id']}},_0x5bce81={};_0x5bce81[_0x5ee8('0x4e')]=_[_0x5ee8('0x4f')](_[_0x5ee8('0x52')](db[_0x5ee8('0x49')][_0x5ee8('0x4a')]),[_0x5ee8('0x50'),'salt']);_0x5bce81['query']=_['keys'](_0x10db28[_0x5ee8('0x51')]);_0x5bce81[_0x5ee8('0x59')]=_[_0x5ee8('0x53')](_0x5bce81[_0x5ee8('0x4e')],_0x5bce81[_0x5ee8('0x51')]);_0x2885c8[_0x5ee8('0x55')]=_[_0x5ee8('0x53')](_0x5bce81[_0x5ee8('0x4e')],qs['fields'](_0x10db28[_0x5ee8('0x51')][_0x5ee8('0x54')]));_0x2885c8[_0x5ee8('0x55')]=_0x2885c8[_0x5ee8('0x55')]['length']?_0x2885c8[_0x5ee8('0x55')]:_0x5bce81[_0x5ee8('0x4e')];if(_0x10db28[_0x5ee8('0x51')][_0x5ee8('0x61')]){_0x2885c8[_0x5ee8('0x62')]=[{'all':!![]}];}_0x2885c8=_[_0x5ee8('0x5b')]({},_0x2885c8,_0x10db28['options']);if(!_['includes'](_0x2885c8[_0x5ee8('0x55')],'id')){_0x2885c8[_0x5ee8('0x55')]['push']('id');}return db[_0x5ee8('0x49')][_0x5ee8('0x40')](_0x2885c8)[_0x5ee8('0x22')](handleEntityNotFound(_0x2aab19,null))[_0x5ee8('0x22')](function(_0x33a4ba){var _0x23d82f=[];values=_0x33a4ba;if(_0x10db28[_0x5ee8('0x51')][_0x5ee8('0x66')]===_0x5ee8('0x70')){_0x23d82f['push'](get_open_tabs(_0x5ee8('0x67'),_0x33a4ba['dataValues']));_0x23d82f['push'](get_open_tabs(_0x5ee8('0x69'),_0x33a4ba['dataValues']));_0x23d82f[_0x5ee8('0x63')](get_open_tabs(_0x5ee8('0x6c'),_0x33a4ba[_0x5ee8('0x68')]));_0x23d82f[_0x5ee8('0x63')](get_open_tabs(_0x5ee8('0x6d'),_0x33a4ba[_0x5ee8('0x68')]));_0x23d82f[_0x5ee8('0x63')](get_open_tabs(_0x5ee8('0x6a'),_0x33a4ba[_0x5ee8('0x68')]));_0x23d82f[_0x5ee8('0x63')](get_open_tabs('mail',_0x33a4ba[_0x5ee8('0x68')]));return BPromise[_0x5ee8('0x6e')](_0x23d82f);}else{return values;}})[_0x5ee8('0x22')](function(_0x3420af){return values;})[_0x5ee8('0x22')](respondWithResult(_0x2aab19,null))[_0x5ee8('0x2b')](handleError(_0x2aab19,null));};exports[_0x5ee8('0x34')]=function(_0x15e866,_0x2765c6){if(_0x15e866[_0x5ee8('0x71')]['id']){delete _0x15e866['body']['id'];}delete _0x15e866['body']['role'];return db['User'][_0x5ee8('0x40')]({'where':{'id':_0x15e866[_0x5ee8('0x72')]['id']}})[_0x5ee8('0x22')](handleEntityNotFound(_0x2765c6,null))[_0x5ee8('0x22')](saveUpdates(_0x15e866[_0x5ee8('0x71')],null))[_0x5ee8('0x22')](respondWithResult(_0x2765c6,null))['catch'](handleError(_0x2765c6,null));};exports[_0x5ee8('0x73')]=function(_0x485b0c,_0x4e951f){return db[_0x5ee8('0x49')][_0x5ee8('0x73')]()[_0x5ee8('0x22')](respondWithResult(_0x4e951f,null))['catch'](handleError(_0x4e951f,null));};exports['addContacts']=function(_0x4c5ca4,_0x32f397,_0x5c959e){return db['User'][_0x5ee8('0x40')]({'where':{'id':_0x4c5ca4[_0x5ee8('0x72')]['id']}})[_0x5ee8('0x22')](handleEntityNotFound(_0x32f397,null))[_0x5ee8('0x22')](function(_0x1cf7a7){if(_0x1cf7a7){return _0x1cf7a7[_0x5ee8('0x74')](_0x4c5ca4[_0x5ee8('0x71')][_0x5ee8('0x75')],_[_0x5ee8('0x76')](_0x4c5ca4[_0x5ee8('0x71')],['ids','id'])||{});}})[_0x5ee8('0x22')](respondWithResult(_0x32f397,null))[_0x5ee8('0x2b')](handleError(_0x32f397,null));};function validateUser(_0x14e91f){return new BPromise(function(_0x714f31,_0x773165){if(_0x14e91f[_0x5ee8('0x77')])return _0x714f31(_0x14e91f);return db['Setting'][_0x5ee8('0x78')](0x1)[_0x5ee8('0x22')](function(_0x4e6c5f){if(_0x4e6c5f['securePassword'])authService[_0x5ee8('0x79')](_0x14e91f[_0x5ee8('0x50')]);db['User'][_0x5ee8('0x7a')](_0x5ee8('0x77'))['then'](function(_0x59222e){if(_['isNil'](_0x59222e)){_0x14e91f[_0x5ee8('0x77')]=_0x4e6c5f['min_internal']||0x1;return;}if(_['isNil'](_0x4e6c5f[_0x5ee8('0x7b')])||_0x4e6c5f[_0x5ee8('0x7b')]===_0x59222e){_0x14e91f[_0x5ee8('0x77')]=_0x59222e+0x1;return;}if(_0x4e6c5f[_0x5ee8('0x7b')]>_0x59222e){_0x14e91f[_0x5ee8('0x77')]=_0x4e6c5f[_0x5ee8('0x7b')];return;}return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x5ee8('0x5d')][_0x5ee8('0x7c')]['SELECT']})[_0x5ee8('0x22')](function(_0x59a8f8){if(_0x59a8f8&&_0x59a8f8[_0x5ee8('0x7d')]){for(var _0x388125=0x0,_0x487251=_0x59a8f8[_0x5ee8('0x7d')];_0x388125<_0x487251&&_['isNil'](_0x14e91f[_0x5ee8('0x77')]);_0x388125++){if(_0x4e6c5f[_0x5ee8('0x7b')]<=_0x59a8f8[_0x388125]['from']){_0x14e91f[_0x5ee8('0x77')]=_0x59a8f8[_0x388125][_0x5ee8('0x7e')];}else if(_0x4e6c5f[_0x5ee8('0x7b')]>_0x59a8f8[_0x388125][_0x5ee8('0x7e')]&&_0x4e6c5f[_0x5ee8('0x7b')]<=_0x59a8f8[_0x388125]['to']){_0x14e91f['internal']=_0x4e6c5f['min_internal'];}}}if(_[_0x5ee8('0x7f')](_0x14e91f['internal'])){_0x14e91f[_0x5ee8('0x77')]=_0x59222e+0x1;}return _0x714f31(_0x14e91f);});});})[_0x5ee8('0x2b')](function(_0x5c1db3){_0x773165(_0x5c1db3);});});}function updateUser(_0x26d179){return new BPromise(function(_0x2b6db4,_0x547b5e){try{if(_0x26d179[_0x5ee8('0x80')]){_0x26d179[_0x5ee8('0x81')]=_0x26d179[_0x5ee8('0x77')];_0x26d179[_0x5ee8('0x82')]={'mailbox':_0x26d179[_0x5ee8('0x77')],'password':_0x26d179[_0x5ee8('0x50')],'fullname':_0x26d179[_0x5ee8('0x83')],'email':_0x26d179[_0x5ee8('0x84')]};}if(_0x26d179[_0x5ee8('0x35')]===_0x5ee8('0x39')){if(!_0x26d179[_0x5ee8('0x85')])_0x26d179['permissions']=[_0x5ee8('0x86'),_0x5ee8('0x87'),'103',_0x5ee8('0x88'),_0x5ee8('0x89'),_0x5ee8('0x8a'),_0x5ee8('0x8b'),_0x5ee8('0x8c'),_0x5ee8('0x8d'),_0x5ee8('0x8e'),_0x5ee8('0x8f'),_0x5ee8('0x90'),_0x5ee8('0x91'),_0x5ee8('0x92'),'115'];}_0x2b6db4(_0x26d179);}catch(_0x9ea79a){_0x547b5e(_0x9ea79a);}});}exports[_0x5ee8('0x93')]=function(_0x1b3f4b,_0x280fe8){if(_0x1b3f4b[_0x5ee8('0x38')][_0x5ee8('0x35')]===_0x5ee8('0x39'))throw new Error(_0x5ee8('0x94'));if(_0x1b3f4b['body'][_0x5ee8('0x35')]===_0x5ee8('0x38')&&_0x1b3f4b[_0x5ee8('0x38')][_0x5ee8('0x35')]!=='admin'){throw new Error(_0x5ee8('0x95'));}if(_0x1b3f4b['body'][_0x5ee8('0x35')]===_0x5ee8('0x36')&&_0x1b3f4b[_0x5ee8('0x38')][_0x5ee8('0x35')]!=='admin'){throw new Error(_0x5ee8('0x96'));}return licenseUtil[_0x5ee8('0x97')]([_0x1b3f4b[_0x5ee8('0x71')]])[_0x5ee8('0x22')](function(){return validateUser(_0x1b3f4b['body']);})[_0x5ee8('0x22')](function(_0xc67f0a){return updateUser(_0xc67f0a)['then'](function(_0x1ee611){if(_0x1ee611[_0x5ee8('0x35')]==='admin'){_0x1ee611[_0x5ee8('0x98')]=_0x1b3f4b['user'][_0x5ee8('0x98')];delete _0x1ee611['userProfileId'];}return _0x1ee611;});})[_0x5ee8('0x22')](function(_0x5f4402){return db[_0x5ee8('0x49')][_0x5ee8('0x93')](_0x5f4402,{'include':[{'model':db[_0x5ee8('0x82')],'as':_0x5ee8('0x82')}]});})[_0x5ee8('0x22')](function(_0x164aeb){if(_0x1b3f4b['body'][_0x5ee8('0x35')]===_0x5ee8('0x38'))return _0x164aeb;if(_0x1b3f4b['user'][_0x5ee8('0x35')]!==_0x5ee8('0x38'))return _0x164aeb;return db['UserProfileSection'][_0x5ee8('0x40')]({'where':{'name':_0x164aeb[_0x5ee8('0x35')]===_0x5ee8('0x39')?_0x5ee8('0x99'):_0x5ee8('0x3a'),'userProfileId':_0x1b3f4b[_0x5ee8('0x38')][_0x5ee8('0x9a')]},'raw':!![]})[_0x5ee8('0x22')](function(_0x10d25b){if(!_0x10d25b||_0x10d25b['autoAssociation']!=0x0)return _0x164aeb;return db['UserProfileResource'][_0x5ee8('0x93')]({'name':_0x164aeb[_0x5ee8('0x45')],'resourceId':_0x164aeb['id'],'type':_0x10d25b[_0x5ee8('0x45')],'sectionId':_0x10d25b['id']},{})[_0x5ee8('0x22')](function(){return _0x164aeb;});})[_0x5ee8('0x2b')](function(_0x240360){logger[_0x5ee8('0x27')](_0x5ee8('0x9b'),_0x240360);throw _0x240360;});})['then'](respondWithResult(_0x280fe8,0xc9))[_0x5ee8('0x2b')](handleError(_0x280fe8,null));};exports[_0x5ee8('0x9c')]=function(_0x405e74,_0x42a212){var _0x2a5792=_0x405e74[_0x5ee8('0x71')];var _0x30b2b0=[];if(_0x405e74['user'][_0x5ee8('0x35')]===_0x5ee8('0x39'))throw new Error(_0x5ee8('0x94'));if(_[_0x5ee8('0x9d')](_0x2a5792,['role',_0x5ee8('0x38')])&&_0x405e74[_0x5ee8('0x38')][_0x5ee8('0x35')]!==_0x5ee8('0x36')){throw new Error(_0x5ee8('0x95'));}if(_['some'](_0x2a5792,[_0x5ee8('0x35'),_0x5ee8('0x36')])&&_0x405e74[_0x5ee8('0x38')]['role']!==_0x5ee8('0x36')){throw new Error(_0x5ee8('0x9e'));}return licenseUtil['checkUserLimits'](_0x2a5792)[_0x5ee8('0x22')](function(){return validateUser(_0x2a5792[0x0]);})['then'](function(){for(var _0x4a085b=0x1;_0x4a085b<_0x2a5792[_0x5ee8('0x7d')];_0x4a085b++){var _0x310cf2=_0x2a5792[_0x4a085b-0x1][_0x5ee8('0x77')];if(!_0x2a5792[_0x4a085b][_0x5ee8('0x77')])_0x2a5792[_0x4a085b][_0x5ee8('0x77')]=_0x310cf2+0x1;_0x30b2b0['push'](validateUser(_0x2a5792[_0x4a085b]));}return BPromise[_0x5ee8('0x6e')](_0x30b2b0);})[_0x5ee8('0x22')](function(){_0x30b2b0=[];for(var _0x214c00=0x0;_0x214c00<_0x2a5792[_0x5ee8('0x7d')];_0x214c00++){_0x30b2b0[_0x5ee8('0x63')](updateUser(_0x2a5792[_0x214c00]));}return BPromise[_0x5ee8('0x6e')](_0x30b2b0);})['then'](function(){return BPromise['each'](_0x2a5792,function(_0x11a4e9){return db[_0x5ee8('0x49')][_0x5ee8('0x93')](_0x11a4e9,{'include':[{'model':db[_0x5ee8('0x82')],'as':_0x5ee8('0x82')}]})[_0x5ee8('0x22')](function(_0x42f0b7){_0x11a4e9['id']=_0x42f0b7['id'];return _0x11a4e9;});});})['then'](function(_0x433b2f){if(_0x405e74['body'][_0x5ee8('0x35')]===_0x5ee8('0x38'))return _0x433b2f;if(_0x405e74[_0x5ee8('0x38')][_0x5ee8('0x35')]!==_0x5ee8('0x38'))return _0x433b2f;var _0x43295b=_[_0x5ee8('0x9d')](_0x433b2f,function(_0x13cc86){return _0x13cc86[_0x5ee8('0x35')]===_0x5ee8('0x39')||_0x13cc86[_0x5ee8('0x35')]===_0x5ee8('0x3b');});if(!_0x43295b)return _0x433b2f;return db[_0x5ee8('0x9f')][_0x5ee8('0x64')]({'where':{'name':{'$or':[_0x5ee8('0x99'),_0x5ee8('0x3a')]},'userProfileId':_0x405e74['user'][_0x5ee8('0x9a')]},'raw':!![]})[_0x5ee8('0x22')](function(_0x2d3343){if(_[_0x5ee8('0xa0')](_0x2d3343)||!_[_0x5ee8('0x9d')](_0x2d3343,[_0x5ee8('0xa1'),0x0]))return _0x433b2f;_0x30b2b0=[];var _0x530e6a=_(_0x2d3343)[_0x5ee8('0x48')](function(_0x13c13){if(_0x13c13[_0x5ee8('0xa1')]===0x1)return;return _0x13c13[_0x5ee8('0x45')]===_0x5ee8('0x99')?_0x5ee8('0x39'):_0x5ee8('0x3b');})[_0x5ee8('0xa2')]()['value']();for(var _0x2fe045=0x0;_0x2fe045<_0x433b2f[_0x5ee8('0x7d')];_0x2fe045++){if(!_['includes'](_0x530e6a,_0x433b2f[_0x2fe045][_0x5ee8('0x35')]))return;var _0x44e92d=_0x433b2f[_0x2fe045]['role']==='agent'?'Agents':_0x5ee8('0x3a');_0x30b2b0[_0x5ee8('0x63')](db[_0x5ee8('0x41')][_0x5ee8('0x93')]({'name':_0x433b2f[_0x2fe045][_0x5ee8('0x45')],'resourceId':_0x433b2f[_0x2fe045]['id'],'type':_0x44e92d,'sectionId':_[_0x5ee8('0x40')](_0x2d3343,[_0x5ee8('0x45'),_0x44e92d])['id']},{}));}return BPromise['all'](_0x30b2b0);});})[_0x5ee8('0x22')](respondWithResult(_0x42a212,0xc9))['catch'](handleError(_0x42a212,null));};exports[_0x5ee8('0xa3')]=function(_0x339547,_0x542e24,_0x1cb632){if(_0x339547['body']['id']){delete _0x339547[_0x5ee8('0x71')]['id'];}return db['User'][_0x5ee8('0x40')]({'where':{'id':_0x339547[_0x5ee8('0x72')]['id']}})[_0x5ee8('0x22')](function(_0x4e97e1){if(!_0x4e97e1)return null;if(_0x4e97e1['id']===_0x339547[_0x5ee8('0x38')]['id']){if(!_0x339547[_0x5ee8('0x71')][_0x5ee8('0xa4')]||!_0x339547[_0x5ee8('0x71')]['newPassword']){throw new db[(_0x5ee8('0xa5'))][(_0x5ee8('0xa6'))](_0x5ee8('0xa7'));}if(!_0x4e97e1[_0x5ee8('0xa8')](_0x339547['body'][_0x5ee8('0xa4')])){throw new db[(_0x5ee8('0xa5'))][(_0x5ee8('0xa6'))](_0x5ee8('0xa9'));}if(_0x339547[_0x5ee8('0x71')][_0x5ee8('0xa4')]===_0x339547[_0x5ee8('0x71')]['newPassword']){throw new db[(_0x5ee8('0xa5'))][(_0x5ee8('0xa6'))](_0x5ee8('0xaa'));}}else if(_0x339547[_0x5ee8('0x38')]['role']==='admin'){if(!_0x339547['body']['newPassword']){throw new db[(_0x5ee8('0xa5'))][(_0x5ee8('0xa6'))](_0x5ee8('0xab'));}}else if(_0x339547[_0x5ee8('0x38')]['role']===_0x5ee8('0x38')){if(!_0x339547[_0x5ee8('0x71')][_0x5ee8('0xac')]){throw new db['Sequelize'][(_0x5ee8('0xa6'))](_0x5ee8('0xab'));}if(_0x4e97e1[_0x5ee8('0x35')]!==_0x5ee8('0x39')){throw new db[(_0x5ee8('0xa5'))][(_0x5ee8('0xa6'))](_0x5ee8('0x94'));}}else{throw new db['Sequelize'][(_0x5ee8('0xa6'))](_0x5ee8('0x94'));}return _0x4e97e1;})['then'](handleEntityNotFound(_0x542e24,null))[_0x5ee8('0x22')](function(_0x28e923){return db[_0x5ee8('0xad')]['findOne']({'attributes':['id',_0x5ee8('0xae'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x5ee8('0x22')](function(_0x22a8d4){if(_0x22a8d4[_0x5ee8('0xae')])authService[_0x5ee8('0x79')](_0x339547[_0x5ee8('0x71')][_0x5ee8('0xac')]);if(!_0x22a8d4[_0x5ee8('0xaf')]||!_0x28e923[_0x5ee8('0xb0')])return _0x28e923;authService[_0x5ee8('0xb1')](_0x339547[_0x5ee8('0x71')][_0x5ee8('0xac')],_0x28e923[_0x5ee8('0xb0')],_0x22a8d4['passwordHistoryLimit']);return _0x28e923;})[_0x5ee8('0x22')](saveUpdates({'password':_0x339547[_0x5ee8('0x71')]['newPassword'],'passwordResetAt':_0x339547[_0x5ee8('0x38')]['id']==_0x339547[_0x5ee8('0x72')]['id']?moment():null,'previousPasswords':authService[_0x5ee8('0xb2')](_0x339547[_0x5ee8('0x71')][_0x5ee8('0xac')],_0x28e923[_0x5ee8('0xb0')])},null));})[_0x5ee8('0x22')](respondWithResult(_0x542e24,null))['catch'](handleError(_0x542e24,null));};exports[_0x5ee8('0xb3')]=function(_0x241c39,_0x286393,_0x19d019){var _0x552372=_0x241c39[_0x5ee8('0x71')][_0x5ee8('0xb4')];return db['User']['find']({'where':{'id':_0x241c39[_0x5ee8('0x72')]['id']},'attributes':['id',_0x5ee8('0x45'),_0x5ee8('0x35'),_0x5ee8('0xb5'),_0x5ee8('0xb6'),_0x5ee8('0xb7'),_0x5ee8('0xb8')]})[_0x5ee8('0x22')](handleEntityNotFound(_0x286393,null))[_0x5ee8('0x22')](function(_0x311a51){if(_0x311a51){if(!utils['isValidChannel'](_0x552372)){throw new db[(_0x5ee8('0xa5'))]['ValidationError'](_0x5ee8('0xb9'));}return _0x311a51[_0x5ee8('0xba')+_['capitalize'](_0x552372[_0x5ee8('0xbb')]())+_0x5ee8('0xbc')](_0x241c39[_0x5ee8('0x71')][_0x5ee8('0x75')],{'penalty':_0x241c39[_0x5ee8('0x71')][_0x5ee8('0xbd')]||0x0})[_0x5ee8('0xbe')](function(_0x557f30){for(var _0x297725=0x0;_0x297725<_0x241c39[_0x5ee8('0x71')][_0x5ee8('0x75')][_0x5ee8('0x7d')];_0x297725+=0x1){var _0x44e1c2={'UserId':_0x241c39[_0x5ee8('0x72')]['id']};_0x44e1c2[_[_0x5ee8('0xbf')](_0x552372[_0x5ee8('0xbb')]())+_0x5ee8('0xc0')]=_0x241c39[_0x5ee8('0x71')][_0x5ee8('0x75')][_0x297725];socket['emit'](_0x5ee8('0x38')+_[_0x5ee8('0xbf')](_0x552372['toLowerCase']())+_0x5ee8('0xc1'),_0x44e1c2);}return _0x557f30;})[_0x5ee8('0x22')](function(){if(_0x552372===_0x5ee8('0xc2')){return db[_0x5ee8('0xc3')][_0x5ee8('0x64')]({'where':{'id':_0x241c39['body']['ids']||[]},'raw':!![],'attributes':['id',_0x5ee8('0x45')]});}})['then'](function(_0x28854b){var _0x3a82da=_0x311a51[_0x5ee8('0xc4')]({'plain':!![]});var _0x44701c=[];if(_0x552372===_0x5ee8('0xc2')&&_0x3a82da[_0x5ee8('0x35')]===_0x5ee8('0x39')&&_0x3a82da[_0x5ee8('0xb5')]){for(var _0x581d14=0x0;_0x581d14<_0x28854b[_0x5ee8('0x7d')];_0x581d14+=0x1){_0x44701c[_0x5ee8('0x63')]({'membername':_0x3a82da['name'],'UserId':_0x3a82da['id'],'queue_name':_0x28854b[_0x581d14][_0x5ee8('0x45')],'VoiceQueueId':_0x28854b[_0x581d14]['id'],'interface':_[_0x5ee8('0x7f')](_0x3a82da[_0x5ee8('0xb8')])?util[_0x5ee8('0xc5')](_0x5ee8('0xc6'),_0x3a82da[_0x5ee8('0x45')]):_0x3a82da[_0x5ee8('0xb8')],'paused':_0x3a82da[_0x5ee8('0xb7')]||![],'penalty':_0x241c39['body'][_0x5ee8('0xbd')]||0x0});}return BPromise[_0x5ee8('0xc7')](_0x44701c,function(_0x3a43bb){return db[_0x5ee8('0xc8')][_0x5ee8('0xc9')](_0x3a43bb);});}return _0x311a51;});}})[_0x5ee8('0x22')](respondWithStatusCode(_0x286393,null))[_0x5ee8('0x2b')](handleError(_0x286393,null));};exports[_0x5ee8('0xca')]=function(_0x7519f6,_0x1d8d23,_0x376392){var _0x152d66;return db[_0x5ee8('0x49')][_0x5ee8('0x40')]({'where':{'id':_0x7519f6[_0x5ee8('0x72')]['id']},'attributes':['id','name',_0x5ee8('0x35')]})[_0x5ee8('0x22')](handleEntityNotFound(_0x1d8d23,null))['then'](function(_0x57fc6a){if(_0x57fc6a){_0x152d66=_0x57fc6a;if(!_0x7519f6['query']['channel']||!utils[_0x5ee8('0xcb')](_0x7519f6[_0x5ee8('0x51')]['channel'])){throw new db[(_0x5ee8('0xa5'))][(_0x5ee8('0xa6'))]('Unknown\x20channel');}return _0x57fc6a[_0x5ee8('0xcc')+_[_0x5ee8('0xbf')](_0x7519f6[_0x5ee8('0x51')][_0x5ee8('0xb4')][_0x5ee8('0xbb')]())+_0x5ee8('0xbc')](_0x7519f6[_0x5ee8('0x51')]['ids']);}})['then'](function(_0x318e29){for(var _0x48cbb0=0x0;_0x48cbb0<_0x7519f6[_0x5ee8('0x51')][_0x5ee8('0x75')][_0x5ee8('0x7d')];_0x48cbb0+=0x1){var _0x355c07={'UserId':_0x7519f6[_0x5ee8('0x72')]['id']};_0x355c07[_[_0x5ee8('0xbf')](_0x7519f6['query'][_0x5ee8('0xb4')][_0x5ee8('0xbb')]())+_0x5ee8('0xc0')]=_0x7519f6['query']['ids'][_0x48cbb0];socket['emit']('user'+_[_0x5ee8('0xbf')](_0x7519f6[_0x5ee8('0x51')][_0x5ee8('0xb4')][_0x5ee8('0xbb')]())+_0x5ee8('0xcd'),_0x355c07);}return _0x318e29;})['then'](function(){if(_0x7519f6[_0x5ee8('0x51')][_0x5ee8('0xb4')]==='voice'){return db['UserVoiceQueueRt'][_0x5ee8('0x42')]({'where':{'UserId':_0x7519f6[_0x5ee8('0x72')]['id'],'VoiceQueueId':_0x7519f6['query'][_0x5ee8('0x75')]},'individualHooks':!![]})[_0x5ee8('0x22')](function(){return _0x152d66;});}return _0x152d66;})['then'](respondWithStatusCode(_0x1d8d23,null))['catch'](handleError(_0x1d8d23,null));};exports[_0x5ee8('0xce')]=function(_0x341102,_0x1d4e85,_0x5b7be3){_0x341102[_0x5ee8('0x71')][_0x5ee8('0xcf')]=_0x341102[_0x5ee8('0xd0')]['filename'];return db[_0x5ee8('0x49')][_0x5ee8('0x40')]({'where':{'id':_0x341102[_0x5ee8('0x72')]['id']}})[_0x5ee8('0x22')](handleEntityNotFound(_0x1d4e85,null))[_0x5ee8('0x22')](saveUpdates(_0x341102[_0x5ee8('0x71')],null))[_0x5ee8('0x22')](respondWithResult(_0x1d4e85,null))[_0x5ee8('0x2b')](handleError(_0x1d4e85,null));};exports['getAvatar']=function(_0x247674,_0x2996d3,_0x56146b){var _0xb30e99=path[_0x5ee8('0xd1')](config[_0x5ee8('0xd2')],_0x5ee8('0xd3'));return db['User'][_0x5ee8('0x40')]({'where':{'id':_0x247674[_0x5ee8('0x72')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x5ee8('0x22')](handleEntityNotFound(_0x2996d3,null))[_0x5ee8('0x22')](function(_0x3447a4){if(_0x3447a4){if(_['isNil'](_0x3447a4[_0x5ee8('0xcf')])){return _0x2996d3[_0x5ee8('0xd4')](_0xb30e99);}else{if(!fs[_0x5ee8('0xd5')](path[_0x5ee8('0xd1')](config[_0x5ee8('0xd2')],_0x5ee8('0xd6'),_0x3447a4[_0x5ee8('0xcf')]))){return _0x2996d3['download'](_0xb30e99);}return _0x2996d3['download'](path['join'](config[_0x5ee8('0xd2')],_0x5ee8('0xd6'),_0x3447a4[_0x5ee8('0xcf')]));}}})['catch'](handleError(_0x2996d3,null));};exports[_0x5ee8('0xd7')]=function(_0x194012,_0x35d165,_0x89187e){return db[_0x5ee8('0x49')]['find']({'where':{'id':_0x194012['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x35d165,null))[_0x5ee8('0x22')](function(_0x662c08){var _0x233f8d=[];values=_0x662c08[_0x5ee8('0x68')];_0x233f8d[_0x5ee8('0x63')](get_open_tabs(_0x5ee8('0x67'),_0x662c08[_0x5ee8('0x68')]));_0x233f8d[_0x5ee8('0x63')](get_open_tabs('sms',_0x662c08['dataValues']));_0x233f8d['push'](get_open_tabs(_0x5ee8('0x6c'),_0x662c08[_0x5ee8('0x68')]));_0x233f8d[_0x5ee8('0x63')](get_open_tabs(_0x5ee8('0x6d'),_0x662c08[_0x5ee8('0x68')]));_0x233f8d['push'](get_open_tabs(_0x5ee8('0x6a'),_0x662c08['dataValues']));_0x233f8d['push'](get_open_tabs('mail',_0x662c08[_0x5ee8('0x68')]));return BPromise[_0x5ee8('0x6e')](_0x233f8d);})['then'](function(_0x5d3469){var _0x18df72=[];if(_0x5d3469){for(var _0x4a27ed=0x0;_0x4a27ed=_0x57477a[_0xad7f('0x50')]){throw new Error(_0xad7f('0x51'));}})[_0xad7f('0x24')](function(){if(_0x537df8){return db[_0xad7f('0x28')]['destroy']({'where':{'membername':_0x537df8[_0xad7f('0x27')]},'individualHooks':!![]});}})['then'](function(){if(_0x537df8){return _0x537df8[_0xad7f('0x52')]({'raw':!![]});}})[_0xad7f('0x24')](function(_0x29a0db){if(_0x537df8){if(_0x29a0db){var _0x46ec47=[];_0x551fd2=_0x29a0db;if(_0x551fd2['length']){for(var _0x162e1f=0x0;_0x162e1f<_0x551fd2['length'];_0x162e1f++){_0x46ec47[_0xad7f('0x46')](db[_0xad7f('0x28')][_0xad7f('0x53')]({'membername':_0x537df8[_0xad7f('0x27')],'UserId':_0x537df8['id'],'queue_name':_0x551fd2[_0x162e1f]['name'],'VoiceQueueId':_0x551fd2[_0x162e1f]['id'],'interface':_0x40cc55,'paused':_0x537df8[_0xad7f('0x4d')]||![],'penalty':_0x551fd2[_0x162e1f][_0xad7f('0x54')]||0x0}));}return BPromise[_0xad7f('0x47')](_0x46ec47);}}}})['then'](function(){if(_0x537df8){return db[_0xad7f('0x2a')][_0xad7f('0x2b')]({'where':{'membername':_0x537df8['name'],'exitAt':null}});}})['then'](function(_0x231cdb){if(_0x537df8){if(_0x231cdb&&_0x231cdb[_0xad7f('0x2d')]){var _0x203bad=[];_0x231cdb['forEach'](function(_0x20f17e){_0x203bad['push'](_0x20f17e['update']({'exitAt':moment()[_0xad7f('0x2e')](_0xad7f('0x34'))}));});return BPromise['all'](_0x203bad);}}})['then'](function(_0x22421b){if(_0x537df8){var _0x196ac7=[];var _0x562a1e=[];var _0x10224d=utils[_0xad7f('0x2f')]();var _0x5305f4={'membername':_0x537df8[_0xad7f('0x27')],'interface':_0x40cc55,'enterAt':moment()[_0xad7f('0x2e')](_0xad7f('0x34')),'role':_0x537df8[_0xad7f('0x38')],'internal':_0x537df8['internal']};_0x10224d['forEach'](function(_0x4930c0){_0x196ac7['push'](_[_0xad7f('0x55')]({'channel':_0x4930c0,'type':_0xad7f('0x56'),'data1':'callysquare','data2':_0x40cc55},_0x5305f4));if(_0x537df8[_0xad7f('0x4d')]){_0x562a1e[_0xad7f('0x46')](_[_0xad7f('0x55')]({'channel':_0x4930c0,'type':_0xad7f('0x2c'),'data1':'LOGININPAUSE'},_0x5305f4));}});return db['MemberReport']['bulkCreate'](_0x196ac7[_0xad7f('0x57')](_0x562a1e),{'individualHooks':!![]});}})[_0xad7f('0x24')](function(){if(_0x537df8){return _0x537df8[_0xad7f('0x29')]({'online':!![],'lastLoginAt':moment()['format'](_0xad7f('0x34')),'voicePause':_0x537df8[_0xad7f('0x4d')]||![],'mailPause':_0x537df8[_0xad7f('0x4d')]||![],'chatPause':_0x537df8[_0xad7f('0x4d')]||![],'faxPause':_0x537df8[_0xad7f('0x4d')]||![],'smsPause':_0x537df8[_0xad7f('0x4d')]||![],'openchannelPause':_0x537df8[_0xad7f('0x4d')]||![],'pauseType':_0x537df8['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0xad7f('0x34')),'interface':_0x40cc55});}})[_0xad7f('0x24')](function(_0xe567db){_0x20043b(_0xe567db);})[_0xad7f('0x19')](function(_0xb739a1){_0x97ffd5(_0x7c8068[_0xad7f('0x15')](0x1f4,_0xb739a1[_0xad7f('0x17')]));});});}; \ No newline at end of file +var _0x581f=['push','LogoutUser','findOne','destroy','LoginUser','mobile','phone','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','loginInPause','all','merge','LOGIN','callysquare','LOGININPAUSE','bulkCreate','concat','util','moment','../../mysqldb','../../config/utils','../../config/logger','client','http','defaults','redis','socket.io-emitter','./user.socket','register','request','then','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetUser','debug','ShowUser','User','PauseUser','internal','UserVoiceQueueRt','update','MemberReport','name','PAUSE','length','getChannels','forEach','isNil','interface','format','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','type','role','DEFAULT\x20PAUSE','channel','system','mail','chat','sms','whatsapp','find','set','%s%s','Pause'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x581f,0x6d));var _0xf581=function(_0x14bf67,_0x49df21){_0x14bf67=_0x14bf67-0x0;var _0xe26936=_0x581f[_0x14bf67];return _0xe26936;};'use strict';var _=require('lodash');var util=require(_0xf581('0x0'));var moment=require(_0xf581('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf581('0x2'))['db'];var utils=require(_0xf581('0x3'));var logger=require(_0xf581('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf581('0x5')][_0xf581('0x6')]({'port':0x232a});config['redis']=_[_0xf581('0x7')](config[_0xf581('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xf581('0x9'))(new Redis(config['redis']));require(_0xf581('0xa'))[_0xf581('0xb')](socket);function respondWithRpcPromise(_0x19ba01,_0x44f3d7,_0x52f0e7){return new BPromise(function(_0x303147,_0x119399){return client[_0xf581('0xc')](_0x19ba01,_0x52f0e7)[_0xf581('0xd')](function(_0x3160e4){logger['info'](_0xf581('0xe'),_0x44f3d7,'request\x20sent');logger['debug'](_0xf581('0xf'),_0x44f3d7,_0xf581('0x10'),JSON[_0xf581('0x11')](_0x3160e4));if(_0x3160e4['error']){if(_0x3160e4[_0xf581('0x12')][_0xf581('0x13')]===0x1f4){logger[_0xf581('0x12')](_0xf581('0xe'),_0x44f3d7,_0x3160e4[_0xf581('0x12')][_0xf581('0x14')]);return _0x119399(_0x3160e4[_0xf581('0x12')][_0xf581('0x14')]);}logger[_0xf581('0x12')](_0xf581('0xe'),_0x44f3d7,_0x3160e4[_0xf581('0x12')][_0xf581('0x14')]);return _0x303147(_0x3160e4[_0xf581('0x12')][_0xf581('0x14')]);}else{logger[_0xf581('0x15')](_0xf581('0xe'),_0x44f3d7,_0xf581('0x10'));_0x303147(_0x3160e4['result'][_0xf581('0x14')]);}})[_0xf581('0x16')](function(_0x7e1220){logger[_0xf581('0x12')](_0xf581('0xe'),_0x44f3d7,_0x7e1220);_0x119399(_0x7e1220);});});}exports['GetUser']=function(_0x1a5a7a){var _0x163fa4=this;return new Promise(function(_0x4de875,_0xf0df36){return db['User'][_0xf581('0x17')]({'raw':_0x1a5a7a[_0xf581('0x18')]?_0x1a5a7a['options'][_0xf581('0x19')]===undefined?!![]:![]:!![],'where':_0x1a5a7a[_0xf581('0x18')]?_0x1a5a7a[_0xf581('0x18')][_0xf581('0x1a')]||null:null,'attributes':_0x1a5a7a['options']?_0x1a5a7a['options'][_0xf581('0x1b')]||null:null,'limit':_0x1a5a7a['options']?_0x1a5a7a[_0xf581('0x18')][_0xf581('0x1c')]||null:null,'include':_0x1a5a7a['options']?_0x1a5a7a[_0xf581('0x18')][_0xf581('0x1d')]?_[_0xf581('0x1e')](_0x1a5a7a['options']['include'],function(_0x582b25){return{'model':db[_0x582b25[_0xf581('0x1f')]],'as':_0x582b25['as'],'attributes':_0x582b25[_0xf581('0x1b')],'include':_0x582b25[_0xf581('0x1d')]?_[_0xf581('0x1e')](_0x582b25[_0xf581('0x1d')],function(_0x3889bb){return{'model':db[_0x3889bb[_0xf581('0x1f')]],'as':_0x3889bb['as'],'attributes':_0x3889bb[_0xf581('0x1b')],'include':_0x3889bb[_0xf581('0x1d')]?_[_0xf581('0x1e')](_0x3889bb['include'],function(_0xb10de0){return{'model':db[_0xb10de0[_0xf581('0x1f')]],'as':_0xb10de0['as'],'attributes':_0xb10de0[_0xf581('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf581('0xd')](function(_0x13a0bb){logger['info'](_0xf581('0x20'),_0x1a5a7a);logger[_0xf581('0x21')](_0xf581('0x20'),_0x1a5a7a,JSON['stringify'](_0x13a0bb));_0x4de875(_0x13a0bb);})[_0xf581('0x16')](function(_0x2d7662){logger['error'](_0xf581('0x20'),_0x2d7662[_0xf581('0x14')],_0x1a5a7a);_0xf0df36(_0x163fa4[_0xf581('0x12')](0x1f4,_0x2d7662['message']));});});};exports[_0xf581('0x22')]=function(_0x587a6d){var _0xca0aae=this;return new Promise(function(_0x1aab93,_0xf59f63){return db[_0xf581('0x23')]['find']({'raw':_0x587a6d[_0xf581('0x18')]?_0x587a6d[_0xf581('0x18')][_0xf581('0x19')]===undefined?!![]:![]:!![],'where':_0x587a6d[_0xf581('0x18')]?_0x587a6d[_0xf581('0x18')][_0xf581('0x1a')]||null:null,'attributes':_0x587a6d[_0xf581('0x18')]?_0x587a6d['options'][_0xf581('0x1b')]||null:null,'include':_0x587a6d[_0xf581('0x18')]?_0x587a6d['options'][_0xf581('0x1d')]?_[_0xf581('0x1e')](_0x587a6d[_0xf581('0x18')]['include'],function(_0x22ce51){return{'model':db[_0x22ce51['model']],'as':_0x22ce51['as'],'attributes':_0x22ce51[_0xf581('0x1b')],'include':_0x22ce51['include']?_['map'](_0x22ce51[_0xf581('0x1d')],function(_0x3aa527){return{'model':db[_0x3aa527['model']],'as':_0x3aa527['as'],'attributes':_0x3aa527[_0xf581('0x1b')],'include':_0x3aa527['include']?_['map'](_0x3aa527['include'],function(_0x58d92f){return{'model':db[_0x58d92f['model']],'as':_0x58d92f['as'],'attributes':_0x58d92f[_0xf581('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf581('0xd')](function(_0x2efa2a){logger[_0xf581('0x15')]('ShowUser',_0x587a6d);logger[_0xf581('0x21')](_0xf581('0x22'),_0x587a6d,JSON[_0xf581('0x11')](_0x2efa2a));_0x1aab93(_0x2efa2a);})[_0xf581('0x16')](function(_0x4201ec){logger[_0xf581('0x12')](_0xf581('0x22'),_0x4201ec['message'],_0x587a6d);_0xf59f63(_0xca0aae[_0xf581('0x12')](0x1f4,_0x4201ec[_0xf581('0x14')]));});});};exports[_0xf581('0x24')]=function(_0x5c20b1){var _0x2fcb24=this;return new Promise(function(_0x21eb08,_0x34c9ff){var _0xf1d6c3;return db[_0xf581('0x23')]['find']({'where':_0x5c20b1[_0xf581('0x18')][_0xf581('0x1a')]||{},'attributes':['id','name','role',_0xf581('0x25'),'interface']})['then'](function(_0x337d6e){if(_0x337d6e){_0xf1d6c3=_0x337d6e;return db[_0xf581('0x26')][_0xf581('0x27')]({'paused':0x1},{'where':{'UserId':_0xf1d6c3['id']},'individualHooks':!![]});}})['then'](function(){if(_0xf1d6c3){return db[_0xf581('0x28')]['findAll']({'where':{'membername':_0xf1d6c3[_0xf581('0x29')],'type':_0xf581('0x2a'),'exitAt':null}});}})[_0xf581('0xd')](function(_0x3eda5a){if(_0xf1d6c3){if(_0x3eda5a&&_0x3eda5a['length']){var _0x4b0406=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x57ce53=0x0,_0x43273b=_0x3eda5a[_0xf581('0x2b')];_0x57ce53<_0x43273b;_0x57ce53++){_0x3eda5a[_0x57ce53]['updateAttributes']({'exitAt':_0x4b0406});}}}})[_0xf581('0xd')](function(){if(_0xf1d6c3){var _0xa5e794=[];var _0x5436db=utils[_0xf581('0x2c')]();_0x5436db[_0xf581('0x2d')](function(_0x20baeb){_0xa5e794['push']({'channel':_0x20baeb,'membername':_0xf1d6c3[_0xf581('0x29')],'interface':_[_0xf581('0x2e')](_0xf1d6c3[_0xf581('0x2f')])?util[_0xf581('0x30')](_0xf581('0x31'),_0xf1d6c3[_0xf581('0x29')]):_0xf1d6c3[_0xf581('0x2f')],'type':_0xf581('0x2a'),'enterAt':moment()['format'](_0xf581('0x32')),'data1':_0x5c20b1[_0xf581('0x33')][_0xf581('0x34')]||'DEFAULT\x20PAUSE','role':_0xf1d6c3[_0xf581('0x35')],'internal':_0xf1d6c3[_0xf581('0x25')],'uniqueid':_0x5c20b1['body']['uniqueid']||null});});return db[_0xf581('0x28')]['bulkCreate'](_0xa5e794,{'individualHooks':!![]});}})[_0xf581('0xd')](function(){if(_0xf1d6c3){return _0xf1d6c3[_0xf581('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x5c20b1[_0xf581('0x33')][_0xf581('0x34')]||_0xf581('0x36'),'lastPauseAt':moment()['format'](_0xf581('0x32'))});}})[_0xf581('0xd')](function(_0x27fd45){_0x21eb08(_0x27fd45);})[_0xf581('0x16')](function(_0x38af95){_0x34c9ff(_0x2fcb24[_0xf581('0x12')](0x1f4,_0x38af95[_0xf581('0x14')]));});});};exports['UnpauseUser']=function(_0x3e4b99){var _0x3607c0=this;return new Promise(function(_0x588804,_0x1fe8f2){var _0x5f554e;return db['User']['findOne']({'where':_0x3e4b99[_0xf581('0x18')][_0xf581('0x1a')]||{},'attributes':['id',_0xf581('0x29')]})['then'](function(_0x1eb1a8){if(_0x1eb1a8){_0x5f554e=_0x1eb1a8;if(_0x3e4b99[_0xf581('0x33')][_0xf581('0x37')]&&!utils['isValidChannel'](_0x3e4b99[_0xf581('0x33')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x3e4b99[_0xf581('0x33')][_0xf581('0x37')]){case'voice':return db[_0xf581('0x26')][_0xf581('0x27')]({'paused':0x0},{'where':{'UserId':_0x5f554e['id']}})['then'](function(){return db[_0xf581('0x28')]['find']({'where':{'channel':_0x3e4b99[_0xf581('0x33')]['channel'],'membername':_0x5f554e[_0xf581('0x29')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x5d0c2d){if(_0x5d0c2d){return _0x5d0c2d[_0xf581('0x27')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xf581('0x38')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x5f554e['update']({'voicePause':![]});});case _0xf581('0x39'):case _0xf581('0x3a'):case'fax':case _0xf581('0x3b'):case'openchannel':case _0xf581('0x3c'):return db[_0xf581('0x28')][_0xf581('0x3d')]({'where':{'channel':_0x3e4b99[_0xf581('0x33')][_0xf581('0x37')],'membername':_0x5f554e[_0xf581('0x29')],'type':'PAUSE','exitAt':null}})[_0xf581('0xd')](function(_0x43055d){return _0x43055d[_0xf581('0x27')]({'exitAt':moment()[_0xf581('0x30')](_0xf581('0x32')),'data2':_0xf581('0x38')},{'individualHooks':!![]});})[_0xf581('0xd')](function(){var _0x29f732={};_[_0xf581('0x3e')](_0x29f732,util[_0xf581('0x30')](_0xf581('0x3f'),_0x3e4b99[_0xf581('0x33')][_0xf581('0x37')],_0xf581('0x40')),![]);return _0x5f554e[_0xf581('0x27')](_0x29f732);});default:return db[_0xf581('0x26')][_0xf581('0x27')]({'paused':0x0},{'where':{'UserId':_0x5f554e['id']}})['then'](function(){return db[_0xf581('0x28')][_0xf581('0x17')]({'where':{'membername':_0x5f554e[_0xf581('0x29')],'type':'PAUSE','exitAt':null}});})[_0xf581('0xd')](function(_0x58207f){var _0x3b67f1=[];_0x58207f[_0xf581('0x2d')](function(_0x5dbcbc){_0x3b67f1[_0xf581('0x41')](_0x5dbcbc[_0xf581('0x27')]({'exitAt':moment()[_0xf581('0x30')](_0xf581('0x32')),'data2':_0xf581('0x38')}));});return BPromise['all'](_0x3b67f1);})[_0xf581('0xd')](function(){return _0x5f554e['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xf581('0xd')](function(_0x3a92ce){_0x588804(_0x3a92ce);})[_0xf581('0x16')](function(_0x29ffd8){_0x1fe8f2(_0x3607c0[_0xf581('0x12')](0x1f4,_0x29ffd8[_0xf581('0x14')]));});});};exports[_0xf581('0x42')]=function(_0x798445){var _0x251362=this;return new Promise(function(_0x3c1610,_0x25da8f){var _0x460629;return db[_0xf581('0x23')][_0xf581('0x43')]({'where':_0x798445[_0xf581('0x18')]['where']||{},'attributes':['id','name']})[_0xf581('0xd')](function(_0xcdd713){if(_0xcdd713){_0x460629=_0xcdd713;return db['UserVoiceQueueRt'][_0xf581('0x44')]({'where':{'membername':_0x460629[_0xf581('0x29')]},'individualHooks':!![]});}})['then'](function(){if(_0x460629){return db['MemberReport'][_0xf581('0x17')]({'where':{'membername':_0x460629[_0xf581('0x29')],'exitAt':null}});}})['then'](function(_0x580b81){if(_0x460629){if(_0x580b81&&_0x580b81[_0xf581('0x2b')]){var _0x866700=[];_0x580b81['forEach'](function(_0x253800){_0x866700[_0xf581('0x41')](_0x253800[_0xf581('0x27')]({'exitAt':moment()['format'](_0xf581('0x32'))}));});return BPromise['all'](_0x866700);}}})[_0xf581('0xd')](function(){if(_0x460629){return _0x460629[_0xf581('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xf581('0xd')](function(_0x5e6b4a){_0x3c1610(_0x5e6b4a);})[_0xf581('0x16')](function(_0x155f57){_0x25da8f(_0x251362[_0xf581('0x12')](0x1f4,_0x155f57[_0xf581('0x14')]));});});};exports[_0xf581('0x45')]=function(_0x5bd0fa){var _0x1059bc=this;return new Promise(function(_0x284e6f,_0x40ba15){var _0x3265d2;var _0x30131a;var _0x16fc82;var _0x584bfc;return db[_0xf581('0x23')][_0xf581('0x43')]({'where':_0x5bd0fa[_0xf581('0x18')][_0xf581('0x1a')]||{},'attributes':['id',_0xf581('0x29'),_0xf581('0x35'),_0xf581('0x46'),_0xf581('0x47'),'internal','loginInPause',_0xf581('0x2f')]})[_0xf581('0xd')](function(_0x543ec4){if(_0x543ec4){_0x3265d2=_0x543ec4;_0x584bfc=_0x5bd0fa[_0xf581('0x33')]['interface']?_0x5bd0fa[_0xf581('0x33')]['interface']:util['format']('SIP/%s',_0x3265d2[_0xf581('0x29')]);return db['User'][_0xf581('0x48')]({'where':{'role':_0xf581('0x49'),'online':!![],'id':{'$ne':_0x3265d2['id']}}});}})[_0xf581('0xd')](function(_0x2bd9d2){if(_0x2bd9d2){_0x16fc82=_0x2bd9d2;return require(_0xf581('0x4a'))[_0xf581('0x4b')]();}})['then'](function(_0x3e83ad){if(_0x3e83ad&&_0x3e83ad[_0xf581('0x4c')]&&_0x16fc82>=_0x3e83ad['agents']){throw new Error(_0xf581('0x4d'));}})[_0xf581('0xd')](function(){if(_0x3265d2){return db[_0xf581('0x26')][_0xf581('0x44')]({'where':{'membername':_0x3265d2[_0xf581('0x29')]},'individualHooks':!![]});}})[_0xf581('0xd')](function(){if(_0x3265d2){return _0x3265d2['getVoiceQueues']({'raw':!![]});}})[_0xf581('0xd')](function(_0x3d5f21){if(_0x3265d2){if(_0x3d5f21){var _0xa1ac7c=[];_0x30131a=_0x3d5f21;if(_0x30131a[_0xf581('0x2b')]){for(var _0xc787f6=0x0;_0xc787f6<_0x30131a[_0xf581('0x2b')];_0xc787f6++){_0xa1ac7c[_0xf581('0x41')](db[_0xf581('0x26')][_0xf581('0x4e')]({'membername':_0x3265d2[_0xf581('0x29')],'UserId':_0x3265d2['id'],'queue_name':_0x30131a[_0xc787f6]['name'],'VoiceQueueId':_0x30131a[_0xc787f6]['id'],'interface':_0x584bfc,'paused':_0x3265d2[_0xf581('0x4f')]||![],'penalty':_0x30131a[_0xc787f6]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0xa1ac7c);}}}})[_0xf581('0xd')](function(){if(_0x3265d2){return db[_0xf581('0x28')][_0xf581('0x17')]({'where':{'membername':_0x3265d2[_0xf581('0x29')],'exitAt':null}});}})[_0xf581('0xd')](function(_0x4e1cfe){if(_0x3265d2){if(_0x4e1cfe&&_0x4e1cfe[_0xf581('0x2b')]){var _0x4c58e6=[];_0x4e1cfe[_0xf581('0x2d')](function(_0x62c87b){_0x4c58e6[_0xf581('0x41')](_0x62c87b[_0xf581('0x27')]({'exitAt':moment()[_0xf581('0x30')](_0xf581('0x32'))}));});return BPromise[_0xf581('0x50')](_0x4c58e6);}}})[_0xf581('0xd')](function(_0x4d088f){if(_0x3265d2){var _0x56c48c=[];var _0x1cb8d1=[];var _0x49c5b3=utils[_0xf581('0x2c')]();var _0x142ffd={'membername':_0x3265d2['name'],'interface':_0x584bfc,'enterAt':moment()[_0xf581('0x30')](_0xf581('0x32')),'role':_0x3265d2[_0xf581('0x35')],'internal':_0x3265d2[_0xf581('0x25')]};_0x49c5b3[_0xf581('0x2d')](function(_0xa6b981){_0x56c48c[_0xf581('0x41')](_[_0xf581('0x51')]({'channel':_0xa6b981,'type':_0xf581('0x52'),'data1':_0xf581('0x53'),'data2':_0x584bfc},_0x142ffd));if(_0x3265d2[_0xf581('0x4f')]){_0x1cb8d1[_0xf581('0x41')](_[_0xf581('0x51')]({'channel':_0xa6b981,'type':_0xf581('0x2a'),'data1':_0xf581('0x54')},_0x142ffd));}});return db[_0xf581('0x28')][_0xf581('0x55')](_0x56c48c[_0xf581('0x56')](_0x1cb8d1),{'individualHooks':!![]});}})[_0xf581('0xd')](function(){if(_0x3265d2){return _0x3265d2[_0xf581('0x27')]({'online':!![],'lastLoginAt':moment()['format'](_0xf581('0x32')),'voicePause':_0x3265d2[_0xf581('0x4f')]||![],'mailPause':_0x3265d2['loginInPause']||![],'chatPause':_0x3265d2['loginInPause']||![],'faxPause':_0x3265d2[_0xf581('0x4f')]||![],'smsPause':_0x3265d2[_0xf581('0x4f')]||![],'openchannelPause':_0x3265d2['loginInPause']||![],'pauseType':_0x3265d2['loginInPause']?_0xf581('0x54'):null,'lastPauseAt':moment()[_0xf581('0x30')](_0xf581('0x32')),'interface':_0x584bfc});}})[_0xf581('0xd')](function(_0x183398){_0x284e6f(_0x183398);})[_0xf581('0x16')](function(_0x102e86){_0x40ba15(_0x1059bc['error'](0x1f4,_0x102e86['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 6e6370c..78a7d40 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 _0x190a=['./user.events','save','remove','update','emit','removeListener','register','length','user:'];(function(_0x50d4ce,_0x2e759a){var _0x220c47=function(_0x3a0706){while(--_0x3a0706){_0x50d4ce['push'](_0x50d4ce['shift']());}};_0x220c47(++_0x2e759a);}(_0x190a,0x18c));var _0xa190=function(_0x15ff01,_0x4ab1ed){_0x15ff01=_0x15ff01-0x0;var _0x14a906=_0x190a[_0x15ff01];return _0x14a906;};'use strict';var UserEvents=require(_0xa190('0x0'));var events=[_0xa190('0x1'),_0xa190('0x2'),_0xa190('0x3')];function createListener(_0x310d75,_0x45be9c){return function(_0x2fcf4a){_0x45be9c[_0xa190('0x4')](_0x310d75,_0x2fcf4a);};}function removeListener(_0x513291,_0x4a69d2){return function(){UserEvents[_0xa190('0x5')](_0x513291,_0x4a69d2);};}exports[_0xa190('0x6')]=function(_0x50b824){for(var _0x5f3f1e=0x0,_0x36e72b=events[_0xa190('0x7')];_0x5f3f1e<_0x36e72b;_0x5f3f1e++){var _0x542777=events[_0x5f3f1e];var _0x1afe49=createListener(_0xa190('0x8')+_0x542777,_0x50b824);UserEvents['on'](_0x542777,_0x1afe49);}}; \ No newline at end of file +var _0x61c9=['register','length','user:','./user.events','remove','update','emit'];(function(_0x5d18a6,_0x416183){var _0x335faf=function(_0x46ee0a){while(--_0x46ee0a){_0x5d18a6['push'](_0x5d18a6['shift']());}};_0x335faf(++_0x416183);}(_0x61c9,0xc0));var _0x961c=function(_0x2e067a,_0xab528c){_0x2e067a=_0x2e067a-0x0;var _0xc64976=_0x61c9[_0x2e067a];return _0xc64976;};'use strict';var UserEvents=require(_0x961c('0x0'));var events=['save',_0x961c('0x1'),_0x961c('0x2')];function createListener(_0x3157c5,_0x5e488f){return function(_0x46b47b){_0x5e488f[_0x961c('0x3')](_0x3157c5,_0x46b47b);};}function removeListener(_0x48514a,_0x700ab4){return function(){UserEvents['removeListener'](_0x48514a,_0x700ab4);};}exports[_0x961c('0x4')]=function(_0x5acebc){for(var _0x38b62d=0x0,_0x1e77ff=events[_0x961c('0x5')];_0x38b62d<_0x1e77ff;_0x38b62d++){var _0xc0f510=events[_0x38b62d];var _0x3e8654=createListener(_0x961c('0x6')+_0xc0f510,_0x5acebc);UserEvents['on'](_0xc0f510,_0x3e8654);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 63adae9..644d049 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 _0xb4e2=['multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xb4e2,0x1aa));var _0x2b4e=function(_0x1e4acf,_0xe942be){_0x1e4acf=_0x1e4acf-0x0;var _0x4dd47d=_0xb4e2[_0x1e4acf];return _0x4dd47d;};'use strict';var multer=require(_0x2b4e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2b4e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2b4e('0x2'));var interaction=require(_0x2b4e('0x3'));var config=require(_0x2b4e('0x4'));module[_0x2b4e('0x5')]=router; \ No newline at end of file +var _0x7275=['../../components/auth/service','../../config/environment','exports','multer','util','path','express','fs-extra'];(function(_0x4dcd22,_0x371b4){var _0x56ef4e=function(_0x11b5fa){while(--_0x11b5fa){_0x4dcd22['push'](_0x4dcd22['shift']());}};_0x56ef4e(++_0x371b4);}(_0x7275,0x143));var _0x5727=function(_0x5b2b57,_0x4d5827){_0x5b2b57=_0x5b2b57-0x0;var _0x11c6e6=_0x7275[_0x5b2b57];return _0x11c6e6;};'use strict';var multer=require(_0x5727('0x0'));var util=require(_0x5727('0x1'));var path=require(_0x5727('0x2'));var timeout=require('connect-timeout');var express=require(_0x5727('0x3'));var router=express['Router']();var fs_extra=require(_0x5727('0x4'));var auth=require(_0x5727('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5727('0x6'));module[_0x5727('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 0807a03..f511bbe 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x474e54,_0x3481e6){var _0x226a7f=function(_0x3a8966){while(--_0x3a8966){_0x474e54['push'](_0x474e54['shift']());}};_0x226a7f(++_0x3481e6);}(_0xe706,0xa3));var _0x6e70=function(_0x501099,_0x223250){_0x501099=_0x501099-0x0;var _0x555ebf=_0xe706[_0x501099];return _0x555ebf;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0xcf69e4,_0x22359f){var _0x3ae183=function(_0x34d0fc){while(--_0x34d0fc){_0xcf69e4['push'](_0xcf69e4['shift']());}};_0x3ae183(++_0x22359f);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index cbb9478..90a0fe4 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 _0x3546=['./userChatQueue.attributes','exports','UserChatQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x522bc8,_0x3525bf){var _0x5c5ab4=function(_0x48cafe){while(--_0x48cafe){_0x522bc8['push'](_0x522bc8['shift']());}};_0x5c5ab4(++_0x3525bf);}(_0x3546,0x123));var _0x6354=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x3546[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x6354('0x0'));var util=require(_0x6354('0x1'));var logger=require(_0x6354('0x2'))(_0x6354('0x3'));var moment=require(_0x6354('0x4'));var BPromise=require(_0x6354('0x5'));var rp=require(_0x6354('0x6'));var fs=require('fs');var path=require(_0x6354('0x7'));var rimraf=require('rimraf');var config=require(_0x6354('0x8'));var attributes=require(_0x6354('0x9'));module[_0x6354('0xa')]=function(_0x5a5752,_0x1ffae3){return _0x5a5752['define'](_0x6354('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa56=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','user_has_chat_queues'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xaa56,0xc6));var _0x6aa5=function(_0x5b1ed5,_0xc6a74){_0x5b1ed5=_0x5b1ed5-0x0;var _0x128ce0=_0xaa56[_0x5b1ed5];return _0x128ce0;};'use strict';var _=require('lodash');var util=require(_0x6aa5('0x0'));var logger=require(_0x6aa5('0x1'))(_0x6aa5('0x2'));var moment=require('moment');var BPromise=require(_0x6aa5('0x3'));var rp=require(_0x6aa5('0x4'));var fs=require('fs');var path=require(_0x6aa5('0x5'));var rimraf=require(_0x6aa5('0x6'));var config=require(_0x6aa5('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x6aa5('0x8')]=function(_0x556859,_0x267a65){return _0x556859[_0x6aa5('0x9')]('UserChatQueue',attributes,{'tableName':_0x6aa5('0xa'),'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 2a2f9c2..ef35350 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 _0xa3f3=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x34ed02,_0x3eddbb){var _0xa80fcd=function(_0x1ea952){while(--_0x1ea952){_0x34ed02['push'](_0x34ed02['shift']());}};_0xa80fcd(++_0x3eddbb);}(_0xa3f3,0x98));var _0x3a3f=function(_0x56e466,_0x1464f5){_0x56e466=_0x56e466-0x0;var _0x57c0a9=_0xa3f3[_0x56e466];return _0x57c0a9;};'use strict';var _=require('lodash');var util=require(_0x3a3f('0x0'));var moment=require(_0x3a3f('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a3f('0x2'));var fs=require('fs');var Redis=require(_0x3a3f('0x3'));var db=require(_0x3a3f('0x4'))['db'];var utils=require(_0x3a3f('0x5'));var logger=require(_0x3a3f('0x6'))(_0x3a3f('0x7'));var config=require(_0x3a3f('0x8'));var jayson=require(_0x3a3f('0x9'));var client=jayson[_0x3a3f('0xa')][_0x3a3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49aaa5,_0x23cd07,_0x281525){return new BPromise(function(_0x3a629e,_0x563a68){return client[_0x3a3f('0xc')](_0x49aaa5,_0x281525)[_0x3a3f('0xd')](function(_0x304c9b){logger[_0x3a3f('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x23cd07,_0x3a3f('0xf'));logger[_0x3a3f('0x10')](_0x3a3f('0x11'),_0x23cd07,_0x3a3f('0xf'),JSON[_0x3a3f('0x12')](_0x304c9b));if(_0x304c9b['error']){if(_0x304c9b[_0x3a3f('0x13')][_0x3a3f('0x14')]===0x1f4){logger['error'](_0x3a3f('0x15'),_0x23cd07,_0x304c9b[_0x3a3f('0x13')][_0x3a3f('0x16')]);return _0x563a68(_0x304c9b['error'][_0x3a3f('0x16')]);}logger[_0x3a3f('0x13')](_0x3a3f('0x15'),_0x23cd07,_0x304c9b['error']['message']);return _0x3a629e(_0x304c9b['error'][_0x3a3f('0x16')]);}else{logger[_0x3a3f('0xe')](_0x3a3f('0x15'),_0x23cd07,_0x3a3f('0xf'));_0x3a629e(_0x304c9b['result']['message']);}})[_0x3a3f('0x17')](function(_0x54aef9){logger[_0x3a3f('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x23cd07,_0x54aef9);_0x563a68(_0x54aef9);});});} \ No newline at end of file +var _0xdcce=['request','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x10df5c,_0x14c714){var _0x9fcba6=function(_0x4d4554){while(--_0x4d4554){_0x10df5c['push'](_0x10df5c['shift']());}};_0x9fcba6(++_0x14c714);}(_0xdcce,0xfb));var _0xedcc=function(_0x81e6f,_0x40c197){_0x81e6f=_0x81e6f-0x0;var _0x522ab3=_0xdcce[_0x81e6f];return _0x522ab3;};'use strict';var _=require('lodash');var util=require(_0xedcc('0x0'));var moment=require(_0xedcc('0x1'));var BPromise=require(_0xedcc('0x2'));var rs=require(_0xedcc('0x3'));var fs=require('fs');var Redis=require(_0xedcc('0x4'));var db=require(_0xedcc('0x5'))['db'];var utils=require(_0xedcc('0x6'));var logger=require(_0xedcc('0x7'))(_0xedcc('0x8'));var config=require(_0xedcc('0x9'));var jayson=require(_0xedcc('0xa'));var client=jayson[_0xedcc('0xb')][_0xedcc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc184b2,_0x4f414d,_0x266cb7){return new BPromise(function(_0x752811,_0x441e0e){return client[_0xedcc('0xd')](_0xc184b2,_0x266cb7)['then'](function(_0x4523bf){logger['info'](_0xedcc('0xe'),_0x4f414d,_0xedcc('0xf'));logger[_0xedcc('0x10')](_0xedcc('0x11'),_0x4f414d,_0xedcc('0xf'),JSON['stringify'](_0x4523bf));if(_0x4523bf[_0xedcc('0x12')]){if(_0x4523bf['error'][_0xedcc('0x13')]===0x1f4){logger['error'](_0xedcc('0xe'),_0x4f414d,_0x4523bf[_0xedcc('0x12')][_0xedcc('0x14')]);return _0x441e0e(_0x4523bf[_0xedcc('0x12')][_0xedcc('0x14')]);}logger[_0xedcc('0x12')](_0xedcc('0xe'),_0x4f414d,_0x4523bf[_0xedcc('0x12')][_0xedcc('0x14')]);return _0x752811(_0x4523bf['error']['message']);}else{logger['info'](_0xedcc('0xe'),_0x4f414d,_0xedcc('0xf'));_0x752811(_0x4523bf['result']['message']);}})[_0xedcc('0x15')](function(_0x5a815a){logger['error'](_0xedcc('0xe'),_0x4f414d,_0x5a815a);_0x441e0e(_0x5a815a);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 3f19c90..cd0ebe3 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 _0x07a2=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0xf1dbd8,_0x1cb2e1){var _0x5ee4be=function(_0x2b8af1){while(--_0x2b8af1){_0xf1dbd8['push'](_0xf1dbd8['shift']());}};_0x5ee4be(++_0x1cb2e1);}(_0x07a2,0x12c));var _0x207a=function(_0x3c62ef,_0x4bb6ab){_0x3c62ef=_0x3c62ef-0x0;var _0x4d44f1=_0x07a2[_0x3c62ef];return _0x4d44f1;};'use strict';var multer=require(_0x207a('0x0'));var util=require(_0x207a('0x1'));var path=require('path');var timeout=require(_0x207a('0x2'));var express=require(_0x207a('0x3'));var router=express[_0x207a('0x4')]();var fs_extra=require(_0x207a('0x5'));var auth=require(_0x207a('0x6'));var interaction=require(_0x207a('0x7'));var config=require(_0x207a('0x8'));module[_0x207a('0x9')]=router; \ No newline at end of file +var _0x6f75=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x7aa1b,_0x5307d4){var _0x638cda=function(_0x2bfe8f){while(--_0x2bfe8f){_0x7aa1b['push'](_0x7aa1b['shift']());}};_0x638cda(++_0x5307d4);}(_0x6f75,0x71));var _0x56f7=function(_0x1091e6,_0x44eb9c){_0x1091e6=_0x1091e6-0x0;var _0x2f44c9=_0x6f75[_0x1091e6];return _0x2f44c9;};'use strict';var multer=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var path=require(_0x56f7('0x2'));var timeout=require(_0x56f7('0x3'));var express=require(_0x56f7('0x4'));var router=express[_0x56f7('0x5')]();var fs_extra=require(_0x56f7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x56f7('0x7'));var config=require(_0x56f7('0x8'));module[_0x56f7('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 0b3bab8..95ad141 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 _0x7916=['sequelize','INTEGER'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x7916,0x128));var _0x6791=function(_0x5390a3,_0x4d60f7){_0x5390a3=_0x5390a3-0x0;var _0x45d220=_0x7916[_0x5390a3];return _0x45d220;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6791('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6791('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0b0e=['STRING','sequelize','INTEGER'];(function(_0x3ae297,_0x2f58a5){var _0x25eae6=function(_0x5ca5d2){while(--_0x5ca5d2){_0x3ae297['push'](_0x3ae297['shift']());}};_0x25eae6(++_0x2f58a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34b5ca,_0x594010){_0x34b5ca=_0x34b5ca-0x0;var _0x2d72c0=_0x0b0e[_0x34b5ca];return _0x2d72c0;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xe0b0('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 861f86a..d13f517 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 _0xe2cf=['rimraf','./userFaxQueue.attributes','exports','user_has_fax_queues','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x2f9500,_0xc35c7e){var _0x208d91=function(_0x3d755f){while(--_0x3d755f){_0x2f9500['push'](_0x2f9500['shift']());}};_0x208d91(++_0xc35c7e);}(_0xe2cf,0x14e));var _0xfe2c=function(_0x41ccbb,_0x3771e8){_0x41ccbb=_0x41ccbb-0x0;var _0x519c61=_0xe2cf[_0x41ccbb];return _0x519c61;};'use strict';var _=require(_0xfe2c('0x0'));var util=require(_0xfe2c('0x1'));var logger=require(_0xfe2c('0x2'))('api');var moment=require(_0xfe2c('0x3'));var BPromise=require(_0xfe2c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe2c('0x5'));var rimraf=require(_0xfe2c('0x6'));var config=require('../../config/environment');var attributes=require(_0xfe2c('0x7'));module[_0xfe2c('0x8')]=function(_0x5c6c01,_0x336936){return _0x5c6c01['define']('UserFaxQueue',attributes,{'tableName':_0xfe2c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26f9=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','api','request-promise','path','../../config/environment','./userFaxQueue.attributes'];(function(_0x3aae56,_0x17c3dd){var _0x27cfa1=function(_0x382848){while(--_0x382848){_0x3aae56['push'](_0x3aae56['shift']());}};_0x27cfa1(++_0x17c3dd);}(_0x26f9,0x16f));var _0x926f=function(_0x303310,_0x3d6211){_0x303310=_0x303310-0x0;var _0x1e4370=_0x26f9[_0x303310];return _0x1e4370;};'use strict';var _=require(_0x926f('0x0'));var util=require(_0x926f('0x1'));var logger=require('../../config/logger')(_0x926f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x926f('0x3'));var fs=require('fs');var path=require(_0x926f('0x4'));var rimraf=require('rimraf');var config=require(_0x926f('0x5'));var attributes=require(_0x926f('0x6'));module[_0x926f('0x7')]=function(_0x66dbcf,_0x46ff8e){return _0x66dbcf[_0x926f('0x8')](_0x926f('0x9'),attributes,{'tableName':_0x926f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 321bec2..a6a4a25 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 _0x6e73=['../../config/environment','jayson/promise','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6e73,0x13b));var _0x36e7=function(_0xde0d24,_0x53da82){_0xde0d24=_0xde0d24-0x0;var _0x38b551=_0x6e73[_0xde0d24];return _0x38b551;};'use strict';var _=require(_0x36e7('0x0'));var util=require(_0x36e7('0x1'));var moment=require('moment');var BPromise=require(_0x36e7('0x2'));var rs=require(_0x36e7('0x3'));var fs=require('fs');var Redis=require(_0x36e7('0x4'));var db=require(_0x36e7('0x5'))['db'];var utils=require(_0x36e7('0x6'));var logger=require(_0x36e7('0x7'))('rpc');var config=require(_0x36e7('0x8'));var jayson=require(_0x36e7('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x401c8d,_0x1d2fac,_0x552219){return new BPromise(function(_0x3649eb,_0x293206){return client[_0x36e7('0xa')](_0x401c8d,_0x552219)['then'](function(_0x33cdd8){logger[_0x36e7('0xb')](_0x36e7('0xc'),_0x1d2fac,_0x36e7('0xd'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x1d2fac,_0x36e7('0xd'),JSON[_0x36e7('0xe')](_0x33cdd8));if(_0x33cdd8['error']){if(_0x33cdd8[_0x36e7('0xf')]['code']===0x1f4){logger[_0x36e7('0xf')](_0x36e7('0xc'),_0x1d2fac,_0x33cdd8['error']['message']);return _0x293206(_0x33cdd8[_0x36e7('0xf')][_0x36e7('0x10')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x1d2fac,_0x33cdd8['error'][_0x36e7('0x10')]);return _0x3649eb(_0x33cdd8[_0x36e7('0xf')][_0x36e7('0x10')]);}else{logger['info'](_0x36e7('0xc'),_0x1d2fac,_0x36e7('0xd'));_0x3649eb(_0x33cdd8[_0x36e7('0x11')][_0x36e7('0x10')]);}})[_0x36e7('0x12')](function(_0x40c161){logger['error'](_0x36e7('0xc'),_0x1d2fac,_0x40c161);_0x293206(_0x40c161);});});} \ No newline at end of file +var _0x97ce=['jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x120ba4,_0x1c320c){var _0x7d165a=function(_0x2a82ea){while(--_0x2a82ea){_0x120ba4['push'](_0x120ba4['shift']());}};_0x7d165a(++_0x1c320c);}(_0x97ce,0x151));var _0xe97c=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x97ce[_0x45b034];return _0x509cb0;};'use strict';var _=require(_0xe97c('0x0'));var util=require(_0xe97c('0x1'));var moment=require(_0xe97c('0x2'));var BPromise=require(_0xe97c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe97c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe97c('0x5'));var logger=require('../../config/logger')(_0xe97c('0x6'));var config=require(_0xe97c('0x7'));var jayson=require(_0xe97c('0x8'));var client=jayson[_0xe97c('0x9')][_0xe97c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6603e0,_0x522f0a,_0x3bf4ef){return new BPromise(function(_0x9c1b00,_0x9ce6d){return client['request'](_0x6603e0,_0x3bf4ef)[_0xe97c('0xb')](function(_0x5717fb){logger[_0xe97c('0xc')](_0xe97c('0xd'),_0x522f0a,_0xe97c('0xe'));logger[_0xe97c('0xf')](_0xe97c('0x10'),_0x522f0a,_0xe97c('0xe'),JSON[_0xe97c('0x11')](_0x5717fb));if(_0x5717fb['error']){if(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x13')]===0x1f4){logger[_0xe97c('0x12')](_0xe97c('0xd'),_0x522f0a,_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);return _0x9ce6d(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);}logger[_0xe97c('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x522f0a,_0x5717fb['error'][_0xe97c('0x14')]);return _0x9c1b00(_0x5717fb['error'][_0xe97c('0x14')]);}else{logger[_0xe97c('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x522f0a,'request\x20sent');_0x9c1b00(_0x5717fb[_0xe97c('0x15')][_0xe97c('0x14')]);}})[_0xe97c('0x16')](function(_0x2e026d){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x522f0a,_0x2e026d);_0x9ce6d(_0x2e026d);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 1ee6b03..a74a597 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 _0xb01a=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x2647ed,_0x5126e5){var _0x2413e7=function(_0xea01d){while(--_0xea01d){_0x2647ed['push'](_0x2647ed['shift']());}};_0x2413e7(++_0x5126e5);}(_0xb01a,0x1a1));var _0xab01=function(_0x327615,_0x128547){_0x327615=_0x327615-0x0;var _0xd86a49=_0xb01a[_0x327615];return _0xd86a49;};'use strict';var multer=require(_0xab01('0x0'));var util=require(_0xab01('0x1'));var path=require(_0xab01('0x2'));var timeout=require(_0xab01('0x3'));var express=require(_0xab01('0x4'));var router=express[_0xab01('0x5')]();var fs_extra=require(_0xab01('0x6'));var auth=require(_0xab01('0x7'));var interaction=require(_0xab01('0x8'));var config=require(_0xab01('0x9'));module[_0xab01('0xa')]=router; \ No newline at end of file +var _0x0ffc=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path'];(function(_0x4eb863,_0x4dfda9){var _0x456061=function(_0x41b406){while(--_0x41b406){_0x4eb863['push'](_0x4eb863['shift']());}};_0x456061(++_0x4dfda9);}(_0x0ffc,0x9e));var _0xc0ff=function(_0xc81e6c,_0x593b0f){_0xc81e6c=_0xc81e6c-0x0;var _0x3ded1d=_0x0ffc[_0xc81e6c];return _0x3ded1d;};'use strict';var multer=require('multer');var util=require(_0xc0ff('0x0'));var path=require(_0xc0ff('0x1'));var timeout=require('connect-timeout');var express=require(_0xc0ff('0x2'));var router=express['Router']();var fs_extra=require(_0xc0ff('0x3'));var auth=require(_0xc0ff('0x4'));var interaction=require(_0xc0ff('0x5'));var config=require(_0xc0ff('0x6'));module[_0xc0ff('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 edf58f7..4e47fad 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x2ed732,_0x38baca){var _0x58dbcf=function(_0x5b0582){while(--_0x5b0582){_0x2ed732['push'](_0x2ed732['shift']());}};_0x58dbcf(++_0x38baca);}(_0xe706,0xa3));var _0x6e70=function(_0x3ec501,_0x1d035a){_0x3ec501=_0x3ec501-0x0;var _0x5a3037=_0xe706[_0x3ec501];return _0x5a3037;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 62a61d5..d463628 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','../../config/logger'];(function(_0x568a61,_0x2124f8){var _0x334c3b=function(_0x1afc39){while(--_0x1afc39){_0x568a61['push'](_0x568a61['shift']());}};_0x334c3b(++_0x2124f8);}(_0xb10b,0x12a));var _0xbb10=function(_0x34501b,_0x264e47){_0x34501b=_0x34501b-0x0;var _0xdcbacd=_0xb10b[_0x34501b];return _0xdcbacd;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('UserMailQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['define','user_has_mail_queues','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x421bec,_0x5efe48){var _0x26ad85=function(_0x30cdad){while(--_0x30cdad){_0x421bec['push'](_0x421bec['shift']());}};_0x26ad85(++_0x5efe48);}(_0x757a,0xde));var _0xa757=function(_0x507fbb,_0x3a4127){_0x507fbb=_0x507fbb-0x0;var _0x40e54e=_0x757a[_0x507fbb];return _0x40e54e;};'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')]('UserMailQueue',attributes,{'tableName':_0xa757('0x9'),'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 26e4979..47e1457 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 _0x004c=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x23fce2,_0x29b0aa){var _0x7af835=function(_0x3c0b04){while(--_0x3c0b04){_0x23fce2['push'](_0x23fce2['shift']());}};_0x7af835(++_0x29b0aa);}(_0x004c,0x85));var _0xc004=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x004c[_0x1b6186];return _0x186121;};'use strict';var _=require(_0xc004('0x0'));var util=require(_0xc004('0x1'));var moment=require(_0xc004('0x2'));var BPromise=require(_0xc004('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc004('0x4'));var db=require(_0xc004('0x5'))['db'];var utils=require(_0xc004('0x6'));var logger=require(_0xc004('0x7'))('rpc');var config=require(_0xc004('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc004('0x9')][_0xc004('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ef023,_0x4c12db,_0x1b5007){return new BPromise(function(_0x46dcf9,_0x40ad0c){return client[_0xc004('0xb')](_0x5ef023,_0x1b5007)['then'](function(_0x13f5c7){logger[_0xc004('0xc')](_0xc004('0xd'),_0x4c12db,_0xc004('0xe'));logger[_0xc004('0xf')](_0xc004('0x10'),_0x4c12db,_0xc004('0xe'),JSON[_0xc004('0x11')](_0x13f5c7));if(_0x13f5c7[_0xc004('0x12')]){if(_0x13f5c7[_0xc004('0x12')]['code']===0x1f4){logger[_0xc004('0x12')](_0xc004('0xd'),_0x4c12db,_0x13f5c7[_0xc004('0x12')][_0xc004('0x13')]);return _0x40ad0c(_0x13f5c7[_0xc004('0x12')][_0xc004('0x13')]);}logger[_0xc004('0x12')](_0xc004('0xd'),_0x4c12db,_0x13f5c7[_0xc004('0x12')][_0xc004('0x13')]);return _0x46dcf9(_0x13f5c7[_0xc004('0x12')][_0xc004('0x13')]);}else{logger[_0xc004('0xc')](_0xc004('0xd'),_0x4c12db,'request\x20sent');_0x46dcf9(_0x13f5c7[_0xc004('0x14')][_0xc004('0x13')]);}})[_0xc004('0x15')](function(_0x2795bb){logger[_0xc004('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x4c12db,_0x2795bb);_0x40ad0c(_0x2795bb);});});} \ No newline at end of file +var _0x036b=['http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x036b,0x145));var _0xb036=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x036b[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0xb036('0x0'));var util=require(_0xb036('0x1'));var moment=require(_0xb036('0x2'));var BPromise=require('bluebird');var rs=require(_0xb036('0x3'));var fs=require('fs');var Redis=require(_0xb036('0x4'));var db=require(_0xb036('0x5'))['db'];var utils=require(_0xb036('0x6'));var logger=require(_0xb036('0x7'))('rpc');var config=require(_0xb036('0x8'));var jayson=require(_0xb036('0x9'));var client=jayson[_0xb036('0xa')][_0xb036('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d495e,_0x35a13f,_0x5bbb44){return new BPromise(function(_0x465d7d,_0x5b3e48){return client[_0xb036('0xc')](_0x1d495e,_0x5bbb44)[_0xb036('0xd')](function(_0x347811){logger[_0xb036('0xe')](_0xb036('0xf'),_0x35a13f,_0xb036('0x10'));logger[_0xb036('0x11')](_0xb036('0x12'),_0x35a13f,_0xb036('0x10'),JSON[_0xb036('0x13')](_0x347811));if(_0x347811[_0xb036('0x14')]){if(_0x347811[_0xb036('0x14')][_0xb036('0x15')]===0x1f4){logger[_0xb036('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x35a13f,_0x347811['error']['message']);return _0x5b3e48(_0x347811[_0xb036('0x14')][_0xb036('0x16')]);}logger['error'](_0xb036('0xf'),_0x35a13f,_0x347811[_0xb036('0x14')][_0xb036('0x16')]);return _0x465d7d(_0x347811[_0xb036('0x14')]['message']);}else{logger[_0xb036('0xe')](_0xb036('0xf'),_0x35a13f,'request\x20sent');_0x465d7d(_0x347811['result'][_0xb036('0x16')]);}})[_0xb036('0x17')](function(_0x3c4adc){logger[_0xb036('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x35a13f,_0x3c4adc);_0x5b3e48(_0x3c4adc);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 1c5e85a..bc255cb 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 _0x05a1=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','sendUserNotification','exports','util'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x05a1,0x175));var _0x105a=function(_0x4405db,_0x3056b3){_0x4405db=_0x4405db-0x0;var _0x3532aa=_0x05a1[_0x4405db];return _0x3532aa;};'use strict';var multer=require('multer');var util=require(_0x105a('0x0'));var path=require(_0x105a('0x1'));var timeout=require(_0x105a('0x2'));var express=require(_0x105a('0x3'));var router=express[_0x105a('0x4')]();var fs_extra=require(_0x105a('0x5'));var auth=require(_0x105a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x105a('0x7'));var controller=require(_0x105a('0x8'));router['post']('/',auth['isAuthenticated'](),controller[_0x105a('0x9')]);module[_0x105a('0xa')]=router; \ No newline at end of file +var _0x455d=['multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification'];(function(_0x411c2e,_0x4ece66){var _0x5ed361=function(_0x193b6c){while(--_0x193b6c){_0x411c2e['push'](_0x411c2e['shift']());}};_0x5ed361(++_0x4ece66);}(_0x455d,0x1ea));var _0xd455=function(_0x31d09e,_0x4f4bce){_0x31d09e=_0x31d09e-0x0;var _0x2a29cc=_0x455d[_0x31d09e];return _0x2a29cc;};'use strict';var multer=require(_0xd455('0x0'));var util=require('util');var path=require(_0xd455('0x1'));var timeout=require(_0xd455('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd455('0x3'));var auth=require(_0xd455('0x4'));var interaction=require(_0xd455('0x5'));var config=require(_0xd455('0x6'));var controller=require(_0xd455('0x7'));router['post']('/',auth[_0xd455('0x8')](),controller[_0xd455('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 3b17f16..36483cf 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 _0x7eb3=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x7eb3,0x169));var _0x37eb=function(_0x50cbfd,_0x3f471d){_0x50cbfd=_0x50cbfd-0x0;var _0x58f4a5=_0x7eb3[_0x50cbfd];return _0x58f4a5;};'use strict';var Sequelize=require(_0x37eb('0x0'));module[_0x37eb('0x1')]={'body':{'type':Sequelize[_0x37eb('0x2')]},'senderName':{'type':Sequelize[_0x37eb('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x37eb('0x3')]},'beep':{'type':Sequelize[_0x37eb('0x4')]}}; \ No newline at end of file +var _0xddf5=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x20b886,_0x58cef5){var _0x52a844=function(_0x30136f){while(--_0x30136f){_0x20b886['push'](_0x20b886['shift']());}};_0x52a844(++_0x58cef5);}(_0xddf5,0x16e));var _0x5ddf=function(_0x45d0f3,_0x22e5a2){_0x45d0f3=_0x45d0f3-0x0;var _0x41c0d8=_0xddf5[_0x45d0f3];return _0x41c0d8;};'use strict';var Sequelize=require(_0x5ddf('0x0'));module[_0x5ddf('0x1')]={'body':{'type':Sequelize[_0x5ddf('0x2')]},'senderName':{'type':Sequelize[_0x5ddf('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x5ddf('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 954ffad..5ed88e1 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 _0x1b83=['mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','sortBy','join','transaction','UserNotification','forEach','recipient','emit','userNotification:send','Template','findOne','html','TemplateId','render','view','catch','startCase','ids','queue','replace','all','union','flatten','getAgents','map','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','defaults','redis','localhost','sendStatus','status','end','json','count','limit','Content-Range','reject','destroy','then','error','stack','name','send','sendUserNotification','hasOwnProperty','text','body','ValidationError','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','parse','chatqueue','faxqueue'];(function(_0xbf0060,_0x25274c){var _0x2ab323=function(_0xd22a50){while(--_0xd22a50){_0xbf0060['push'](_0xbf0060['shift']());}};_0x2ab323(++_0x25274c);}(_0x1b83,0x194));var _0x31b8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1b83[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x31b8('0x0'));var rimraf=require(_0x31b8('0x1'));var zipdir=require(_0x31b8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x31b8('0x3'));var BPromise=require(_0x31b8('0x4'));var Mustache=require(_0x31b8('0x5'));var util=require(_0x31b8('0x6'));var path=require(_0x31b8('0x7'));var sox=require(_0x31b8('0x8'));var csv=require('to-csv');var ejs=require(_0x31b8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x31b8('0xa'));var squel=require(_0x31b8('0xb'));var crypto=require(_0x31b8('0xc'));var jsforce=require(_0x31b8('0xd'));var deskjs=require(_0x31b8('0xe'));var toCsv=require(_0x31b8('0xf'));var querystring=require(_0x31b8('0x10'));var Papa=require(_0x31b8('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x31b8('0x12'));var hardwareService=require(_0x31b8('0x13'));var logger=require(_0x31b8('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x31b8('0x15'));var db=require(_0x31b8('0x16'))['db'];config['redis']=_[_0x31b8('0x17')](config[_0x31b8('0x18')],{'host':_0x31b8('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x31b8('0x18')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x18f638,_0x1fc2af){_0x1fc2af=_0x1fc2af||0xcc;return function(_0x503813){if(_0x503813){return _0x18f638[_0x31b8('0x1a')](_0x1fc2af);}return _0x18f638[_0x31b8('0x1b')](_0x1fc2af)[_0x31b8('0x1c')]();};}function respondWithResult(_0xca4b2d,_0x57a9e8){_0x57a9e8=_0x57a9e8||0xc8;return function(_0x5bff93){if(_0x5bff93){return _0xca4b2d[_0x31b8('0x1b')](_0x57a9e8)[_0x31b8('0x1d')](_0x5bff93);}};}function respondWithFilteredResult(_0x318a51,_0x47dcd9){return function(_0x397f47){if(_0x397f47){var _0x4ffa7c=_0x397f47[_0x31b8('0x1e')],_0x4f18d4=_0x47dcd9['offset'],_0x4e8f27=_0x47dcd9['offset']+_0x47dcd9[_0x31b8('0x1f')],_0x400167;if(_0x4e8f27>=_0x4ffa7c){_0x4e8f27=_0x4ffa7c;_0x400167=0xc8;}else{_0x400167=0xce;}_0x318a51[_0x31b8('0x1b')](_0x400167);return _0x318a51['set'](_0x31b8('0x20'),_0x4f18d4+'-'+_0x4e8f27+'/'+_0x4ffa7c)['json'](_0x397f47);}return null;};}function patchUpdates(_0xe8a6f2){return function(_0x5b7b97){try{jsonpatch['apply'](_0x5b7b97,_0xe8a6f2,!![]);}catch(_0x3362c5){return BPromise[_0x31b8('0x21')](_0x3362c5);}return _0x5b7b97['save']();};}function saveUpdates(_0x483885,_0x52d02c){return function(_0x170e40){if(_0x170e40){return _0x170e40['update'](_0x483885)['then'](function(_0x391731){return _0x391731;});}return null;};}function removeEntity(_0x27b9dc,_0x5ef10e){return function(_0x4ac1c3){if(_0x4ac1c3){return _0x4ac1c3[_0x31b8('0x22')]()[_0x31b8('0x23')](function(){_0x27b9dc[_0x31b8('0x1b')](0xcc)[_0x31b8('0x1c')]();});}};}function handleEntityNotFound(_0x3fe752,_0x4d5fb4){return function(_0x5354da){if(!_0x5354da){_0x3fe752[_0x31b8('0x1a')](0x194);}return _0x5354da;};}function handleError(_0x58874c,_0x41313a){_0x41313a=_0x41313a||0x1f4;return function(_0x2ed514){logger[_0x31b8('0x24')](_0x2ed514[_0x31b8('0x25')]);if(_0x2ed514[_0x31b8('0x26')]){delete _0x2ed514['name'];}_0x58874c[_0x31b8('0x1b')](_0x41313a)[_0x31b8('0x27')](_0x2ed514);};}exports[_0x31b8('0x28')]=function(_0x5b0943,_0x1478f0,_0x7ed274){if(!_0x5b0943['body'][_0x31b8('0x29')](_0x31b8('0x2a'))&&!_0x5b0943[_0x31b8('0x2b')][_0x31b8('0x29')]('TemplateId')){throw new db['Sequelize'][(_0x31b8('0x2c'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x5b0943['body'][_0x31b8('0x29')]('TemplateId')&&!_0x5b0943[_0x31b8('0x2b')][_0x31b8('0x29')]('view')){throw new db[(_0x31b8('0x2d'))][(_0x31b8('0x2c'))](_0x31b8('0x2e'));}if(!_0x5b0943[_0x31b8('0x2b')]['hasOwnProperty'](_0x31b8('0x2f'))){throw new db[(_0x31b8('0x2d'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x4277e7=JSON[_0x31b8('0x30')](_0x5b0943[_0x31b8('0x2b')][_0x31b8('0x2f')]);}catch(_0x1d8a29){logger[_0x31b8('0x24')](_0x1d8a29);throw new db['Sequelize']['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x1f8de8=[_0x31b8('0x31'),_0x31b8('0x32'),_0x31b8('0x33'),_0x31b8('0x34'),_0x31b8('0x35'),_0x31b8('0x36'),_0x31b8('0x37'),_0x31b8('0x38'),'user'];if(_['some'](_0x4277e7,function(_0x35088b){return!_[_0x31b8('0x39')](_0x1f8de8,_0x35088b[_0x31b8('0x3a')][_0x31b8('0x3b')]());})){throw new db[(_0x31b8('0x2d'))][(_0x31b8('0x2c'))](_0x31b8('0x3c'));}}}var _0x3c7a4b={};_0x3c7a4b[_0x31b8('0x3d')]=_0x5b0943[_0x31b8('0x2b')][_0x31b8('0x29')](_0x31b8('0x3d'))?_0x5b0943[_0x31b8('0x2b')][_0x31b8('0x3d')]:_0x5b0943[_0x31b8('0x3e')][_0x31b8('0x3f')];_0x3c7a4b[_0x31b8('0x40')]=_[_0x31b8('0x41')](_0x5b0943[_0x31b8('0x2b')]['recipientsDescription'])?null:_0x5b0943['body'][_0x31b8('0x40')];_0x3c7a4b[_0x31b8('0x42')]=_0x5b0943[_0x31b8('0x2b')][_0x31b8('0x42')]||![];_0x3c7a4b['SenderId']=_0x5b0943['user']['id'];return getContent(_0x5b0943[_0x31b8('0x2b')])[_0x31b8('0x23')](function(_0x28c0be){_0x3c7a4b[_0x31b8('0x2b')]=_0x28c0be;return getRecipients(_0x4277e7);})[_0x31b8('0x23')](function(_0x31945f){_0x3c7a4b['recipientsId']=_[_0x31b8('0x43')](_0x31945f)[_0x31b8('0x44')](',');return db['sequelize'][_0x31b8('0x45')](function(_0x127777){return db[_0x31b8('0x46')]['create'](_0x3c7a4b,{'raw':!![],'transaction':_0x127777})[_0x31b8('0x23')](function(_0xadf656){var _0x492d35={'sender':_0x3c7a4b[_0x31b8('0x3d')],'description':_0x3c7a4b[_0x31b8('0x40')],'content':_0x3c7a4b['body'],'beep':_0x3c7a4b[_0x31b8('0x42')]};_0x31945f[_0x31b8('0x47')](function(_0x5e7da9){_0x492d35[_0x31b8('0x48')]=_0x5e7da9;socket[_0x31b8('0x49')](_0x31b8('0x4a'),_0x492d35);});return _0xadf656;});});})[_0x31b8('0x23')](respondWithResult(_0x1478f0,0xc9))['catch'](handleError(_0x1478f0,null));};function getContent(_0x360c7d){return new BPromise(function(_0x21f96e,_0x535784){if(_0x360c7d[_0x31b8('0x2a')]){_0x21f96e(_0x360c7d[_0x31b8('0x2a')]);return;}return db[_0x31b8('0x4b')][_0x31b8('0x4c')]({'attributes':[_0x31b8('0x4d')],'where':{'id':_0x360c7d[_0x31b8('0x4e')]},'raw':!![]})[_0x31b8('0x23')](function(_0x48ed24){if(!_0x48ed24)throw new db[(_0x31b8('0x2d'))][(_0x31b8('0x2c'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x3acaee=Mustache[_0x31b8('0x4f')](_0x48ed24[_0x31b8('0x4d')],_0x360c7d[_0x31b8('0x50')]);_0x21f96e(_0x3acaee);})[_0x31b8('0x51')](function(_0x261b79){_0x535784(_0x261b79);});});}function getRecipients(_0x2c9726){return new BPromise(function(_0x541410,_0x4c25a6){var _0x2e2635=[];var _0xd7df5b=[];_0x2c9726[_0x31b8('0x47')](function(_0x1704c0){var _0x153587=_[_0x31b8('0x52')](_0x1704c0['model'][_0x31b8('0x3b')]());if(_0x153587==='User'){_0x2e2635=_['union'](_0x2e2635,_0x1704c0[_0x31b8('0x53')]);}else{if(_[_0x31b8('0x39')](_0x153587,_0x31b8('0x54')))_0x153587=_0x153587[_0x31b8('0x55')](_0x31b8('0x54'),'Queue');_0x1704c0[_0x31b8('0x53')][_0x31b8('0x47')](function(_0x56e909){_0xd7df5b['push'](getAgents(_0x153587,_0x56e909));});}});return BPromise[_0x31b8('0x56')](_0xd7df5b)[_0x31b8('0x23')](function(_0x1f4cc0){_0x2e2635=_[_0x31b8('0x57')](_0x2e2635,_[_0x31b8('0x58')](_0x1f4cc0));_0x541410(_0x2e2635);})['catch'](function(_0x3a4f4c){_0x4c25a6(_0x3a4f4c);});});}function getAgents(_0x3f5f69,_0x5a191c){return new BPromise(function(_0x3ae13d,_0x16a5c2){return db[_0x3f5f69][_0x31b8('0x4c')]({'where':{'id':_0x5a191c}})[_0x31b8('0x23')](function(_0x107bfc){return _0x107bfc[_0x31b8('0x59')]({'attributes':['id'],'raw':!![]})[_0x31b8('0x23')](function(_0x432842){var _0x505b38=_[_0x31b8('0x5a')](_0x432842,'id');_0x3ae13d(_0x505b38);});})[_0x31b8('0x51')](function(_0x4c5a87){_0x16a5c2(_0x4c5a87);});});} \ No newline at end of file +var _0xc465=['view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','voicequeue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','user','recipientsId','sequelize','UserNotification','create','recipient','emit','userNotification:send','catch','text','Template','findOne','html','TemplateId','render','forEach','startCase','User','union','ids','queue','replace','Queue','push','all','flatten','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','sendUserNotification','hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body'];(function(_0x95a390,_0x3ab31a){var _0x5cd40e=function(_0x13cc25){while(--_0x13cc25){_0x95a390['push'](_0x95a390['shift']());}};_0x5cd40e(++_0x3ab31a);}(_0xc465,0x100));var _0x5c46=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xc465[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x5c46('0x0'));var rimraf=require(_0x5c46('0x1'));var zipdir=require(_0x5c46('0x2'));var jsonpatch=require(_0x5c46('0x3'));var rp=require(_0x5c46('0x4'));var moment=require(_0x5c46('0x5'));var BPromise=require(_0x5c46('0x6'));var Mustache=require(_0x5c46('0x7'));var util=require(_0x5c46('0x8'));var path=require('path');var sox=require(_0x5c46('0x9'));var csv=require(_0x5c46('0xa'));var ejs=require(_0x5c46('0xb'));var fs=require('fs');var fs_extra=require(_0x5c46('0xc'));var _=require(_0x5c46('0xd'));var squel=require(_0x5c46('0xe'));var crypto=require(_0x5c46('0xf'));var jsforce=require(_0x5c46('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5c46('0xa'));var querystring=require(_0x5c46('0x11'));var Papa=require(_0x5c46('0x12'));var Redis=require(_0x5c46('0x13'));var authService=require(_0x5c46('0x14'));var qs=require(_0x5c46('0x15'));var as=require(_0x5c46('0x16'));var hardwareService=require(_0x5c46('0x17'));var logger=require(_0x5c46('0x18'))(_0x5c46('0x19'));var utils=require(_0x5c46('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x5c46('0x1b'));var db=require(_0x5c46('0x1c'))['db'];config[_0x5c46('0x1d')]=_['defaults'](config[_0x5c46('0x1d')],{'host':_0x5c46('0x1e'),'port':0x18eb});var socket=require(_0x5c46('0x1f'))(new Redis(config[_0x5c46('0x1d')]));require(_0x5c46('0x20'))['register'](socket);function respondWithStatusCode(_0x43ee09,_0x31fbe5){_0x31fbe5=_0x31fbe5||0xcc;return function(_0x130aaf){if(_0x130aaf){return _0x43ee09[_0x5c46('0x21')](_0x31fbe5);}return _0x43ee09[_0x5c46('0x22')](_0x31fbe5)[_0x5c46('0x23')]();};}function respondWithResult(_0x1b9790,_0x4c612b){_0x4c612b=_0x4c612b||0xc8;return function(_0x56a5bf){if(_0x56a5bf){return _0x1b9790[_0x5c46('0x22')](_0x4c612b)[_0x5c46('0x24')](_0x56a5bf);}};}function respondWithFilteredResult(_0x3b692c,_0x5742a6){return function(_0x19d27e){if(_0x19d27e){var _0x24805e=_0x19d27e[_0x5c46('0x25')],_0x1612d1=_0x5742a6[_0x5c46('0x26')],_0x5c0bc3=_0x5742a6['offset']+_0x5742a6[_0x5c46('0x27')],_0x2d6680;if(_0x5c0bc3>=_0x24805e){_0x5c0bc3=_0x24805e;_0x2d6680=0xc8;}else{_0x2d6680=0xce;}_0x3b692c['status'](_0x2d6680);return _0x3b692c[_0x5c46('0x28')](_0x5c46('0x29'),_0x1612d1+'-'+_0x5c0bc3+'/'+_0x24805e)[_0x5c46('0x24')](_0x19d27e);}return null;};}function patchUpdates(_0x1a3eeb){return function(_0x437354){try{jsonpatch[_0x5c46('0x2a')](_0x437354,_0x1a3eeb,!![]);}catch(_0x1f2e51){return BPromise[_0x5c46('0x2b')](_0x1f2e51);}return _0x437354['save']();};}function saveUpdates(_0x46d1f6,_0x1436f4){return function(_0x21e5b2){if(_0x21e5b2){return _0x21e5b2['update'](_0x46d1f6)['then'](function(_0x3f6fb8){return _0x3f6fb8;});}return null;};}function removeEntity(_0x562fc2,_0x440d72){return function(_0xe95f4d){if(_0xe95f4d){return _0xe95f4d[_0x5c46('0x2c')]()[_0x5c46('0x2d')](function(){_0x562fc2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5edec9,_0x1e92e5){return function(_0x2bcd38){if(!_0x2bcd38){_0x5edec9[_0x5c46('0x21')](0x194);}return _0x2bcd38;};}function handleError(_0x16d411,_0x45f79f){_0x45f79f=_0x45f79f||0x1f4;return function(_0x105dad){logger[_0x5c46('0x2e')](_0x105dad[_0x5c46('0x2f')]);if(_0x105dad[_0x5c46('0x30')]){delete _0x105dad[_0x5c46('0x30')];}_0x16d411[_0x5c46('0x22')](_0x45f79f)[_0x5c46('0x31')](_0x105dad);};}exports[_0x5c46('0x32')]=function(_0x5d5c9c,_0x36bb5b,_0x5a5241){if(!_0x5d5c9c['body'][_0x5c46('0x33')]('text')&&!_0x5d5c9c['body'][_0x5c46('0x33')]('TemplateId')){throw new db[(_0x5c46('0x34'))][(_0x5c46('0x35'))](_0x5c46('0x36'));}else{if(_0x5d5c9c[_0x5c46('0x37')][_0x5c46('0x33')]('TemplateId')&&!_0x5d5c9c['body'][_0x5c46('0x33')](_0x5c46('0x38'))){throw new db[(_0x5c46('0x34'))][(_0x5c46('0x35'))](_0x5c46('0x39'));}if(!_0x5d5c9c[_0x5c46('0x37')][_0x5c46('0x33')](_0x5c46('0x3a'))){throw new db[(_0x5c46('0x34'))][(_0x5c46('0x35'))](_0x5c46('0x3b'));}else{try{var _0x41a31b=JSON['parse'](_0x5d5c9c[_0x5c46('0x37')][_0x5c46('0x3a')]);}catch(_0x3fb7bf){logger[_0x5c46('0x2e')](_0x3fb7bf);throw new db[(_0x5c46('0x34'))][(_0x5c46('0x35'))](_0x5c46('0x3c'));}var _0x44f6b2=['chatqueue',_0x5c46('0x3d'),_0x5c46('0x3e'),_0x5c46('0x3f'),'smsqueue',_0x5c46('0x40'),'whatsappqueue',_0x5c46('0x41'),'user'];if(_[_0x5c46('0x42')](_0x41a31b,function(_0x51222a){return!_[_0x5c46('0x43')](_0x44f6b2,_0x51222a[_0x5c46('0x44')][_0x5c46('0x45')]());})){throw new db['Sequelize'][(_0x5c46('0x35'))](_0x5c46('0x46'));}}}var _0x21ea42={};_0x21ea42[_0x5c46('0x47')]=_0x5d5c9c[_0x5c46('0x37')][_0x5c46('0x33')]('senderName')?_0x5d5c9c[_0x5c46('0x37')][_0x5c46('0x47')]:_0x5d5c9c['user'][_0x5c46('0x48')];_0x21ea42[_0x5c46('0x49')]=_[_0x5c46('0x4a')](_0x5d5c9c['body'][_0x5c46('0x49')])?null:_0x5d5c9c['body'][_0x5c46('0x49')];_0x21ea42[_0x5c46('0x4b')]=_0x5d5c9c[_0x5c46('0x37')]['beep']||![];_0x21ea42[_0x5c46('0x4c')]=_0x5d5c9c[_0x5c46('0x4d')]['id'];return getContent(_0x5d5c9c['body'])['then'](function(_0xc7f36e){_0x21ea42[_0x5c46('0x37')]=_0xc7f36e;return getRecipients(_0x41a31b);})[_0x5c46('0x2d')](function(_0x178198){_0x21ea42[_0x5c46('0x4e')]=_['sortBy'](_0x178198)['join'](',');return db[_0x5c46('0x4f')]['transaction'](function(_0x490cdf){return db[_0x5c46('0x50')][_0x5c46('0x51')](_0x21ea42,{'raw':!![],'transaction':_0x490cdf})[_0x5c46('0x2d')](function(_0x568d3e){var _0x334d85={'sender':_0x21ea42[_0x5c46('0x47')],'description':_0x21ea42[_0x5c46('0x49')],'content':_0x21ea42[_0x5c46('0x37')],'beep':_0x21ea42[_0x5c46('0x4b')]};_0x178198['forEach'](function(_0x7bba77){_0x334d85[_0x5c46('0x52')]=_0x7bba77;socket[_0x5c46('0x53')](_0x5c46('0x54'),_0x334d85);});return _0x568d3e;});});})[_0x5c46('0x2d')](respondWithResult(_0x36bb5b,0xc9))[_0x5c46('0x55')](handleError(_0x36bb5b,null));};function getContent(_0xa1c6e8){return new BPromise(function(_0x46e811,_0x503e7e){if(_0xa1c6e8['text']){_0x46e811(_0xa1c6e8[_0x5c46('0x56')]);return;}return db[_0x5c46('0x57')][_0x5c46('0x58')]({'attributes':[_0x5c46('0x59')],'where':{'id':_0xa1c6e8[_0x5c46('0x5a')]},'raw':!![]})[_0x5c46('0x2d')](function(_0x237bae){if(!_0x237bae)throw new db[(_0x5c46('0x34'))][(_0x5c46('0x35'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x25e9a6=Mustache[_0x5c46('0x5b')](_0x237bae[_0x5c46('0x59')],_0xa1c6e8['view']);_0x46e811(_0x25e9a6);})[_0x5c46('0x55')](function(_0x229663){_0x503e7e(_0x229663);});});}function getRecipients(_0x318266){return new BPromise(function(_0x14ee5f,_0x528ff9){var _0x460119=[];var _0x3e6834=[];_0x318266[_0x5c46('0x5c')](function(_0x4bd678){var _0x4ee7eb=_[_0x5c46('0x5d')](_0x4bd678[_0x5c46('0x44')][_0x5c46('0x45')]());if(_0x4ee7eb===_0x5c46('0x5e')){_0x460119=_[_0x5c46('0x5f')](_0x460119,_0x4bd678[_0x5c46('0x60')]);}else{if(_[_0x5c46('0x43')](_0x4ee7eb,_0x5c46('0x61')))_0x4ee7eb=_0x4ee7eb[_0x5c46('0x62')]('queue',_0x5c46('0x63'));_0x4bd678[_0x5c46('0x60')]['forEach'](function(_0x44c09e){_0x3e6834[_0x5c46('0x64')](getAgents(_0x4ee7eb,_0x44c09e));});}});return BPromise[_0x5c46('0x65')](_0x3e6834)[_0x5c46('0x2d')](function(_0x17942d){_0x460119=_[_0x5c46('0x5f')](_0x460119,_[_0x5c46('0x66')](_0x17942d));_0x14ee5f(_0x460119);})['catch'](function(_0x593b90){_0x528ff9(_0x593b90);});});}function getAgents(_0x34b413,_0x3650fb){return new BPromise(function(_0x5b081f,_0xf4e889){return db[_0x34b413]['findOne']({'where':{'id':_0x3650fb}})[_0x5c46('0x2d')](function(_0x450514){return _0x450514[_0x5c46('0x67')]({'attributes':['id'],'raw':!![]})[_0x5c46('0x2d')](function(_0x3bb14a){var _0x3555b6=_['map'](_0x3bb14a,'id');_0x5b081f(_0x3555b6);});})[_0x5c46('0x55')](function(_0x1a77fb){_0xf4e889(_0x1a77fb);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index ad65171..cdb5887 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 _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x55ca,0x126));var _0xa55c=function(_0x3afbdf,_0x9e463b){_0x3afbdf=_0x3afbdf-0x0;var _0x5b6861=_0x55ca[_0x3afbdf];return _0x5b6861;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var UserNotification=require(_0xa55c('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){UserNotificationEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);UserNotificationEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];UserNotification[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x5c12=['../../mysqldb','UserNotification','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4f004f,_0x3ec1ca){var _0x3cd3bf=function(_0x3e7ad8){while(--_0x3e7ad8){_0x4f004f['push'](_0x4f004f['shift']());}};_0x3cd3bf(++_0x3ec1ca);}(_0x5c12,0x188));var _0x25c1=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x5c12[_0x8a969d];return _0x1d8dc7;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x25c1('0x0'))['db'][_0x25c1('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x25c1('0x2'),'afterUpdate':_0x25c1('0x3'),'afterDestroy':_0x25c1('0x4')};function emitEvent(_0x10f10c){return function(_0x2c5df0,_0x21ec20,_0x3f0f35){UserNotificationEvents['emit'](_0x10f10c+':'+_0x2c5df0['id'],_0x2c5df0);UserNotificationEvents[_0x25c1('0x5')](_0x10f10c,_0x2c5df0);_0x3f0f35(null);};}for(var e in events){if(events[_0x25c1('0x6')](e)){var event=events[e];UserNotification[_0x25c1('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 8ef8528..d3f9151 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 _0xa71c=['../../config/logger','api','moment','request-promise','path','../../config/environment','./userNotification.attributes','define','UserNotification','utf8mb4_unicode_ci','lodash','util'];(function(_0xb6a23a,_0x4bc065){var _0x124795=function(_0x5c95b6){while(--_0x5c95b6){_0xb6a23a['push'](_0xb6a23a['shift']());}};_0x124795(++_0x4bc065);}(_0xa71c,0x12a));var _0xca71=function(_0x5c04f5,_0x1e76e7){_0x5c04f5=_0x5c04f5-0x0;var _0x49d2bc=_0xa71c[_0x5c04f5];return _0x49d2bc;};'use strict';var _=require(_0xca71('0x0'));var util=require(_0xca71('0x1'));var logger=require(_0xca71('0x2'))(_0xca71('0x3'));var moment=require(_0xca71('0x4'));var BPromise=require('bluebird');var rp=require(_0xca71('0x5'));var fs=require('fs');var path=require(_0xca71('0x6'));var rimraf=require('rimraf');var config=require(_0xca71('0x7'));var attributes=require(_0xca71('0x8'));module['exports']=function(_0x13c689,_0x286096){return _0x13c689[_0xca71('0x9')](_0xca71('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xca71('0xb')});}; \ No newline at end of file +var _0xe5fc=['utf8mb4','lodash','../../config/logger','api','moment','rimraf','./userNotification.attributes','exports','define','UserNotification','userNotifications'];(function(_0x3b9afb,_0x2133f4){var _0x136e05=function(_0x1fb7e2){while(--_0x1fb7e2){_0x3b9afb['push'](_0x3b9afb['shift']());}};_0x136e05(++_0x2133f4);}(_0xe5fc,0x109));var _0xce5f=function(_0x32f571,_0xb177){_0x32f571=_0x32f571-0x0;var _0x155982=_0xe5fc[_0x32f571];return _0x155982;};'use strict';var _=require(_0xce5f('0x0'));var util=require('util');var logger=require(_0xce5f('0x1'))(_0xce5f('0x2'));var moment=require(_0xce5f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce5f('0x4'));var config=require('../../config/environment');var attributes=require(_0xce5f('0x5'));module[_0xce5f('0x6')]=function(_0x2c23b0,_0x12d30e){return _0x2c23b0[_0xce5f('0x7')](_0xce5f('0x8'),attributes,{'tableName':_0xce5f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xce5f('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 39c405c..1aed4fe 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 _0x7c29=['catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4fdee1,_0x3f290c){var _0x87826e=function(_0x2cbeaa){while(--_0x2cbeaa){_0x4fdee1['push'](_0x4fdee1['shift']());}};_0x87826e(++_0x3f290c);}(_0x7c29,0x16d));var _0x97c2=function(_0xecb0e9,_0x5cf22){_0xecb0e9=_0xecb0e9-0x0;var _0x41428a=_0x7c29[_0xecb0e9];return _0x41428a;};'use strict';var _=require('lodash');var util=require(_0x97c2('0x0'));var moment=require(_0x97c2('0x1'));var BPromise=require(_0x97c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97c2('0x3'));var db=require(_0x97c2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x97c2('0x5'));var config=require(_0x97c2('0x6'));var jayson=require(_0x97c2('0x7'));var client=jayson[_0x97c2('0x8')][_0x97c2('0x9')]({'port':0x232a});config[_0x97c2('0xa')]=_[_0x97c2('0xb')](config[_0x97c2('0xa')],{'host':_0x97c2('0xc'),'port':0x18eb});var socket=require(_0x97c2('0xd'))(new Redis(config[_0x97c2('0xa')]));require(_0x97c2('0xe'))[_0x97c2('0xf')](socket);function respondWithRpcPromise(_0x3dc794,_0x42562b,_0x1870de){return new BPromise(function(_0x124906,_0x4a3db5){return client[_0x97c2('0x10')](_0x3dc794,_0x1870de)['then'](function(_0x49bdbf){logger['info'](_0x97c2('0x11'),_0x42562b,_0x97c2('0x12'));logger[_0x97c2('0x13')](_0x97c2('0x14'),_0x42562b,_0x97c2('0x12'),JSON[_0x97c2('0x15')](_0x49bdbf));if(_0x49bdbf[_0x97c2('0x16')]){if(_0x49bdbf['error'][_0x97c2('0x17')]===0x1f4){logger[_0x97c2('0x16')]('UserNotification,\x20%s,\x20%s',_0x42562b,_0x49bdbf[_0x97c2('0x16')][_0x97c2('0x18')]);return _0x4a3db5(_0x49bdbf[_0x97c2('0x16')][_0x97c2('0x18')]);}logger[_0x97c2('0x16')](_0x97c2('0x11'),_0x42562b,_0x49bdbf[_0x97c2('0x16')][_0x97c2('0x18')]);return _0x124906(_0x49bdbf['error'][_0x97c2('0x18')]);}else{logger['info'](_0x97c2('0x11'),_0x42562b,'request\x20sent');_0x124906(_0x49bdbf['result'][_0x97c2('0x18')]);}})[_0x97c2('0x19')](function(_0x90252e){logger[_0x97c2('0x16')]('UserNotification,\x20%s,\x20%s',_0x42562b,_0x90252e);_0x4a3db5(_0x90252e);});});} \ No newline at end of file +var _0x790f=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x790f,0xdf));var _0xf790=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0x790f[_0x32c012];return _0x48562e;};'use strict';var _=require('lodash');var util=require(_0xf790('0x0'));var moment=require(_0xf790('0x1'));var BPromise=require('bluebird');var rs=require(_0xf790('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf790('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf790('0x4'))(_0xf790('0x5'));var config=require(_0xf790('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf790('0x7')]({'port':0x232a});config[_0xf790('0x8')]=_[_0xf790('0x9')](config[_0xf790('0x8')],{'host':_0xf790('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf790('0x8')]));require(_0xf790('0xb'))[_0xf790('0xc')](socket);function respondWithRpcPromise(_0x3d5fcd,_0x391480,_0x2a6428){return new BPromise(function(_0x239620,_0x1bfea1){return client[_0xf790('0xd')](_0x3d5fcd,_0x2a6428)['then'](function(_0x11a7e9){logger[_0xf790('0xe')](_0xf790('0xf'),_0x391480,'request\x20sent');logger[_0xf790('0x10')](_0xf790('0x11'),_0x391480,_0xf790('0x12'),JSON[_0xf790('0x13')](_0x11a7e9));if(_0x11a7e9['error']){if(_0x11a7e9[_0xf790('0x14')][_0xf790('0x15')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x391480,_0x11a7e9[_0xf790('0x14')][_0xf790('0x16')]);return _0x1bfea1(_0x11a7e9[_0xf790('0x14')]['message']);}logger[_0xf790('0x14')](_0xf790('0xf'),_0x391480,_0x11a7e9[_0xf790('0x14')][_0xf790('0x16')]);return _0x239620(_0x11a7e9[_0xf790('0x14')]['message']);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x391480,_0xf790('0x12'));_0x239620(_0x11a7e9[_0xf790('0x17')][_0xf790('0x16')]);}})[_0xf790('0x18')](function(_0x422818){logger[_0xf790('0x14')]('UserNotification,\x20%s,\x20%s',_0x391480,_0x422818);_0x1bfea1(_0x422818);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 3faf715..a02a370 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 _0x8c79=['./userNotification.events','emit','length'];(function(_0x397bf9,_0x20817d){var _0x3463c9=function(_0x3be6fa){while(--_0x3be6fa){_0x397bf9['push'](_0x397bf9['shift']());}};_0x3463c9(++_0x20817d);}(_0x8c79,0xa8));var _0x98c7=function(_0x554af3,_0x570447){_0x554af3=_0x554af3-0x0;var _0x3670ef=_0x8c79[_0x554af3];return _0x3670ef;};'use strict';var UserNotificationEvents=require(_0x98c7('0x0'));var events=['save','remove','update'];function createListener(_0x14ca25,_0x55824b){return function(_0x255cd6){_0x55824b[_0x98c7('0x1')](_0x14ca25,_0x255cd6);};}function removeListener(_0x5ecf19,_0x456fb6){return function(){UserNotificationEvents['removeListener'](_0x5ecf19,_0x456fb6);};}exports['register']=function(_0x553d51){for(var _0x9e9609=0x0,_0x57b072=events[_0x98c7('0x2')];_0x9e9609<_0x57b072;_0x9e9609++){var _0x25dd4c=events[_0x9e9609];var _0x513208=createListener('userNotification:'+_0x25dd4c,_0x553d51);UserNotificationEvents['on'](_0x25dd4c,_0x513208);}}; \ No newline at end of file +var _0x8098=['register','userNotification:','remove','update','removeListener'];(function(_0x8fdfe3,_0x39c95c){var _0x9b768=function(_0x2eebf7){while(--_0x2eebf7){_0x8fdfe3['push'](_0x8fdfe3['shift']());}};_0x9b768(++_0x39c95c);}(_0x8098,0x1ba));var _0x8809=function(_0x7486c3,_0x5c367b){_0x7486c3=_0x7486c3-0x0;var _0x197e1a=_0x8098[_0x7486c3];return _0x197e1a;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0x8809('0x0'),_0x8809('0x1')];function createListener(_0x4037be,_0x22f28d){return function(_0x3348e0){_0x22f28d['emit'](_0x4037be,_0x3348e0);};}function removeListener(_0x2bb438,_0x1d7425){return function(){UserNotificationEvents[_0x8809('0x2')](_0x2bb438,_0x1d7425);};}exports[_0x8809('0x3')]=function(_0x5804f0){for(var _0xeb811=0x0,_0x2af39c=events['length'];_0xeb811<_0x2af39c;_0xeb811++){var _0x3f4bee=events[_0xeb811];var _0x3fd084=createListener(_0x8809('0x4')+_0x3f4bee,_0x5804f0);UserNotificationEvents['on'](_0x3f4bee,_0x3fd084);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 43e1690..9a0fa53 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 _0xb9a7=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9a7,0x112));var _0x7b9a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xb9a7[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require('multer');var util=require(_0x7b9a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b9a('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7b9a('0x2'));var interaction=require(_0x7b9a('0x3'));var config=require(_0x7b9a('0x4'));module[_0x7b9a('0x5')]=router; \ No newline at end of file +var _0xc15c=['connect-timeout','express','fs-extra','../../config/environment','path'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc15c,0xae));var _0xcc15=function(_0x34bfc6,_0x20289e){_0x34bfc6=_0x34bfc6-0x0;var _0x1445d7=_0xc15c[_0x34bfc6];return _0x1445d7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcc15('0x0'));var timeout=require(_0xcc15('0x1'));var express=require(_0xcc15('0x2'));var router=express['Router']();var fs_extra=require(_0xcc15('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcc15('0x4'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index d1f6cf5..5b7c8b9 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 _0xd8b0=['exports','sequelize'];(function(_0x305cb0,_0x124dbf){var _0x5b4133=function(_0x3af47d){while(--_0x3af47d){_0x305cb0['push'](_0x305cb0['shift']());}};_0x5b4133(++_0x124dbf);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x50cb5c,_0x377a47){var _0x361ad4=function(_0x3c8d51){while(--_0x3c8d51){_0x50cb5c['push'](_0x50cb5c['shift']());}};_0x361ad4(++_0x377a47);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'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 fc16ed9..1a6aa77 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 _0x9311=['moment','bluebird','path','../../config/environment','./userOpenchannelQueue.attributes','user_has_openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x220976,_0x3d3918){var _0x1aeb39=function(_0x3ca954){while(--_0x3ca954){_0x220976['push'](_0x220976['shift']());}};_0x1aeb39(++_0x3d3918);}(_0x9311,0x1be));var _0x1931=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9311[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1931('0x0'));var util=require(_0x1931('0x1'));var logger=require(_0x1931('0x2'))(_0x1931('0x3'));var moment=require(_0x1931('0x4'));var BPromise=require(_0x1931('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1931('0x6'));var rimraf=require('rimraf');var config=require(_0x1931('0x7'));var attributes=require(_0x1931('0x8'));module['exports']=function(_0xf5e72c,_0x520f8a){return _0xf5e72c['define']('UserOpenchannelQueue',attributes,{'tableName':_0x1931('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a33=['request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0x2a33,0xd7));var _0x32a3=function(_0x3fe9b4,_0x5cb1ec){_0x3fe9b4=_0x3fe9b4-0x0;var _0xe717cb=_0x2a33[_0x3fe9b4];return _0xe717cb;};'use strict';var _=require(_0x32a3('0x0'));var util=require(_0x32a3('0x1'));var logger=require(_0x32a3('0x2'))(_0x32a3('0x3'));var moment=require(_0x32a3('0x4'));var BPromise=require(_0x32a3('0x5'));var rp=require(_0x32a3('0x6'));var fs=require('fs');var path=require(_0x32a3('0x7'));var rimraf=require(_0x32a3('0x8'));var config=require(_0x32a3('0x9'));var attributes=require(_0x32a3('0xa'));module[_0x32a3('0xb')]=function(_0x1ac99e,_0x8de88f){return _0x1ac99e[_0x32a3('0xc')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 17f28ab..df77f40 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 _0x9cda=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x36b400,_0x277ec5){var _0x4d47bf=function(_0x55372b){while(--_0x55372b){_0x36b400['push'](_0x36b400['shift']());}};_0x4d47bf(++_0x277ec5);}(_0x9cda,0x118));var _0xa9cd=function(_0x48c8ce,_0x11b828){_0x48c8ce=_0x48c8ce-0x0;var _0x594f3a=_0x9cda[_0x48c8ce];return _0x594f3a;};'use strict';var _=require('lodash');var util=require(_0xa9cd('0x0'));var moment=require(_0xa9cd('0x1'));var BPromise=require(_0xa9cd('0x2'));var rs=require(_0xa9cd('0x3'));var fs=require('fs');var Redis=require(_0xa9cd('0x4'));var db=require(_0xa9cd('0x5'))['db'];var utils=require(_0xa9cd('0x6'));var logger=require(_0xa9cd('0x7'))(_0xa9cd('0x8'));var config=require(_0xa9cd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa9cd('0xa')][_0xa9cd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x450be0,_0xced470,_0x4e8539){return new BPromise(function(_0x15cd9d,_0x549ea8){return client[_0xa9cd('0xc')](_0x450be0,_0x4e8539)['then'](function(_0x25a6e8){logger[_0xa9cd('0xd')](_0xa9cd('0xe'),_0xced470,_0xa9cd('0xf'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xced470,'request\x20sent',JSON[_0xa9cd('0x10')](_0x25a6e8));if(_0x25a6e8[_0xa9cd('0x11')]){if(_0x25a6e8[_0xa9cd('0x11')]['code']===0x1f4){logger[_0xa9cd('0x11')](_0xa9cd('0xe'),_0xced470,_0x25a6e8[_0xa9cd('0x11')][_0xa9cd('0x12')]);return _0x549ea8(_0x25a6e8[_0xa9cd('0x11')][_0xa9cd('0x12')]);}logger[_0xa9cd('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xced470,_0x25a6e8[_0xa9cd('0x11')]['message']);return _0x15cd9d(_0x25a6e8[_0xa9cd('0x11')][_0xa9cd('0x12')]);}else{logger['info'](_0xa9cd('0xe'),_0xced470,_0xa9cd('0xf'));_0x15cd9d(_0x25a6e8[_0xa9cd('0x13')]['message']);}})['catch'](function(_0x58b8f0){logger['error'](_0xa9cd('0xe'),_0xced470,_0x58b8f0);_0x549ea8(_0x58b8f0);});});} \ No newline at end of file +var _0xa6c0=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3e2623,_0x2fb760){var _0xe902e2=function(_0x786565){while(--_0x786565){_0x3e2623['push'](_0x3e2623['shift']());}};_0xe902e2(++_0x2fb760);}(_0xa6c0,0x1b3));var _0x0a6c=function(_0x4ef5fb,_0x51236d){_0x4ef5fb=_0x4ef5fb-0x0;var _0x322b00=_0xa6c0[_0x4ef5fb];return _0x322b00;};'use strict';var _=require('lodash');var util=require(_0x0a6c('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(_0x0a6c('0x1'));var logger=require(_0x0a6c('0x2'))(_0x0a6c('0x3'));var config=require(_0x0a6c('0x4'));var jayson=require(_0x0a6c('0x5'));var client=jayson[_0x0a6c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x402ad5,_0x117301,_0x5dadb9){return new BPromise(function(_0x514f19,_0x4817e9){return client['request'](_0x402ad5,_0x5dadb9)[_0x0a6c('0x7')](function(_0x2d6009){logger[_0x0a6c('0x8')](_0x0a6c('0x9'),_0x117301,'request\x20sent');logger['debug'](_0x0a6c('0xa'),_0x117301,_0x0a6c('0xb'),JSON['stringify'](_0x2d6009));if(_0x2d6009[_0x0a6c('0xc')]){if(_0x2d6009[_0x0a6c('0xc')][_0x0a6c('0xd')]===0x1f4){logger[_0x0a6c('0xc')](_0x0a6c('0x9'),_0x117301,_0x2d6009[_0x0a6c('0xc')][_0x0a6c('0xe')]);return _0x4817e9(_0x2d6009[_0x0a6c('0xc')][_0x0a6c('0xe')]);}logger[_0x0a6c('0xc')](_0x0a6c('0x9'),_0x117301,_0x2d6009[_0x0a6c('0xc')][_0x0a6c('0xe')]);return _0x514f19(_0x2d6009[_0x0a6c('0xc')][_0x0a6c('0xe')]);}else{logger[_0x0a6c('0x8')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x117301,_0x0a6c('0xb'));_0x514f19(_0x2d6009[_0x0a6c('0xf')]['message']);}})[_0x0a6c('0x10')](function(_0x19df1f){logger[_0x0a6c('0xc')](_0x0a6c('0x9'),_0x117301,_0x19df1f);_0x4817e9(_0x19df1f);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index b221bd2..8efb061 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 _0xaac6=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','put','update','delete','destroy','removeResources','exports','multer','util'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xaac6,0x8f));var _0x6aac=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xaac6[_0x235482];return _0x5f5bea;};'use strict';var multer=require(_0x6aac('0x0'));var util=require(_0x6aac('0x1'));var path=require(_0x6aac('0x2'));var timeout=require(_0x6aac('0x3'));var express=require(_0x6aac('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6aac('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6aac('0x6'));var controller=require(_0x6aac('0x7'));router[_0x6aac('0x8')]('/',auth['isAuthenticated'](),controller[_0x6aac('0x9')]);router['get'](_0x6aac('0xa'),auth[_0x6aac('0xb')](),controller[_0x6aac('0xc')]);router[_0x6aac('0x8')](_0x6aac('0xd'),auth[_0x6aac('0xb')](),controller[_0x6aac('0xe')]);router[_0x6aac('0x8')]('/:id/sections',auth['isAuthenticated'](),controller[_0x6aac('0xf')]);router[_0x6aac('0x8')](_0x6aac('0x10'),auth[_0x6aac('0xb')](),controller[_0x6aac('0x11')]);router[_0x6aac('0x12')]('/',auth[_0x6aac('0xb')](),controller[_0x6aac('0x13')]);router['post'](_0x6aac('0x14'),auth[_0x6aac('0xb')](),controller['clone']);router[_0x6aac('0x12')]('/:id/sections',auth[_0x6aac('0xb')](),controller[_0x6aac('0x15')]);router[_0x6aac('0x12')]('/:id/resources',auth[_0x6aac('0xb')](),controller[_0x6aac('0x16')]);router[_0x6aac('0x17')](_0x6aac('0xd'),auth[_0x6aac('0xb')](),controller[_0x6aac('0x18')]);router[_0x6aac('0x19')](_0x6aac('0xd'),auth['isAuthenticated'](),controller[_0x6aac('0x1a')]);router[_0x6aac('0x19')]('/:id/sections',auth[_0x6aac('0xb')](),controller['removeSections']);router[_0x6aac('0x19')](_0x6aac('0x10'),auth['isAuthenticated'](),controller[_0x6aac('0x1b')]);module[_0x6aac('0x1c')]=router; \ No newline at end of file +var _0xb63c=['removeSections','removeResources','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','getSections','/:id/resources','getResources','post','create','addSections','addResources','put','update','delete','destroy','/:id/sections'];(function(_0x536e55,_0x504399){var _0x366c0f=function(_0x1cb4fc){while(--_0x1cb4fc){_0x536e55['push'](_0x536e55['shift']());}};_0x366c0f(++_0x504399);}(_0xb63c,0x99));var _0xcb63=function(_0x32a5af,_0x20fe30){_0x32a5af=_0x32a5af-0x0;var _0x1e019b=_0xb63c[_0x32a5af];return _0x1e019b;};'use strict';var multer=require('multer');var util=require(_0xcb63('0x0'));var path=require(_0xcb63('0x1'));var timeout=require(_0xcb63('0x2'));var express=require(_0xcb63('0x3'));var router=express[_0xcb63('0x4')]();var fs_extra=require(_0xcb63('0x5'));var auth=require(_0xcb63('0x6'));var interaction=require(_0xcb63('0x7'));var config=require(_0xcb63('0x8'));var controller=require(_0xcb63('0x9'));router[_0xcb63('0xa')]('/',auth[_0xcb63('0xb')](),controller['index']);router[_0xcb63('0xa')](_0xcb63('0xc'),auth[_0xcb63('0xb')](),controller[_0xcb63('0xd')]);router[_0xcb63('0xa')](_0xcb63('0xe'),auth[_0xcb63('0xb')](),controller['show']);router[_0xcb63('0xa')]('/:id/sections',auth[_0xcb63('0xb')](),controller[_0xcb63('0xf')]);router[_0xcb63('0xa')](_0xcb63('0x10'),auth[_0xcb63('0xb')](),controller[_0xcb63('0x11')]);router[_0xcb63('0x12')]('/',auth[_0xcb63('0xb')](),controller[_0xcb63('0x13')]);router[_0xcb63('0x12')]('/:id/clone',auth[_0xcb63('0xb')](),controller['clone']);router['post']('/:id/sections',auth[_0xcb63('0xb')](),controller[_0xcb63('0x14')]);router[_0xcb63('0x12')](_0xcb63('0x10'),auth[_0xcb63('0xb')](),controller[_0xcb63('0x15')]);router[_0xcb63('0x16')](_0xcb63('0xe'),auth[_0xcb63('0xb')](),controller[_0xcb63('0x17')]);router[_0xcb63('0x18')](_0xcb63('0xe'),auth[_0xcb63('0xb')](),controller[_0xcb63('0x19')]);router[_0xcb63('0x18')](_0xcb63('0x1a'),auth[_0xcb63('0xb')](),controller[_0xcb63('0x1b')]);router[_0xcb63('0x18')](_0xcb63('0x10'),auth[_0xcb63('0xb')](),controller[_0xcb63('0x1c')]);module[_0xcb63('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 007e143..e20d847 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 _0x9f4d=['setDataValue','crudPermissions','join','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x3ef4f1,_0x5f0f9b){_0x3ef4f1=_0x3ef4f1-0x0;var _0x69953c=_0x9f4d[_0x3ef4f1];return _0x69953c;};'use strict';var Sequelize=require(_0xd9f4('0x0'));module[_0xd9f4('0x1')]={'name':{'type':Sequelize[_0xd9f4('0x2')],'allowNull':![],'unique':_0xd9f4('0x3')},'crudPermissions':{'type':Sequelize[_0xd9f4('0x2')],'set':function(_0x81f443){this[_0xd9f4('0x4')](_0xd9f4('0x5'),_0x81f443?_0x81f443[_0xd9f4('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xd9f4('0x5'))?this['getDataValue'](_0xd9f4('0x5'))[_0xd9f4('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd9f4('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd9f4('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x1d2d=['sequelize','exports','STRING','name','setDataValue','getDataValue','crudPermissions','split'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x1e116c,_0x10e69e){_0x1e116c=_0x1e116c-0x0;var _0x499718=_0x1d2d[_0x1e116c];return _0x499718;};'use strict';var Sequelize=require(_0xd1d2('0x0'));module[_0xd1d2('0x1')]={'name':{'type':Sequelize[_0xd1d2('0x2')],'allowNull':![],'unique':_0xd1d2('0x3')},'crudPermissions':{'type':Sequelize[_0xd1d2('0x2')],'set':function(_0x4f5f7f){this[_0xd1d2('0x4')]('crudPermissions',_0x4f5f7f?_0x4f5f7f['join'](''):[]);},'get':function(){return this[_0xd1d2('0x5')](_0xd1d2('0x6'))?this[_0xd1d2('0x5')](_0xd1d2('0x6'))[_0xd1d2('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd1d2('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 988e2d6..ea82de7 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 _0x7378=['hasOwnProperty','nolimit','order','filters','pick','filter','merge','type','VIRTUAL','where','count','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','clone','params','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','autoAssociation','UserProfileResource','userProfileId','Resources','update','describe','addSections','UserProfileSection','sectionId','each','push','ids','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','undefined','Sequelize','Unknown\x20section','mergeResources','ValidationError','Invalid\x20section\x20\x27','isEmpty','parentSections','all','ignore','union','childModel','sort','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','tag','ThroughTags','color','value','toLowerCase','squareprojects','odbc','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelaccounts','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','VoiceQueues','users','agents','telephones','Users','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','intervals','Interval','pauses','Schedule','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','AnalyticMetric','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./userProfile.socket','sendStatus','status','end','offset','limit','set','Content-Range','reject','then','destroy','stack','name','map','UserProfile','rawAttributes','fieldName','key','keys','intersection','query','fields','attributes','model'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7378,0xbd));var _0x8737=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7378[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8737('0x0'));var zipdir=require(_0x8737('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8737('0x2'));var BPromise=require(_0x8737('0x3'));var Mustache=require('mustache');var util=require(_0x8737('0x4'));var path=require(_0x8737('0x5'));var sox=require(_0x8737('0x6'));var csv=require(_0x8737('0x7'));var ejs=require(_0x8737('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8737('0x9'));var squel=require(_0x8737('0xa'));var crypto=require('crypto');var jsforce=require(_0x8737('0xb'));var deskjs=require(_0x8737('0xc'));var toCsv=require(_0x8737('0x7'));var querystring=require('querystring');var Papa=require(_0x8737('0xd'));var Redis=require(_0x8737('0xe'));var authService=require(_0x8737('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8737('0x10'));var hardwareService=require(_0x8737('0x11'));var logger=require(_0x8737('0x12'))(_0x8737('0x13'));var utils=require('../../config/utils');var config=require(_0x8737('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8737('0x15'))['db'];config[_0x8737('0x16')]=_[_0x8737('0x17')](config[_0x8737('0x16')],{'host':_0x8737('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8737('0x19'))['register'](socket);function respondWithStatusCode(_0x162b10,_0x47f49e){_0x47f49e=_0x47f49e||0xcc;return function(_0x269456){if(_0x269456){return _0x162b10[_0x8737('0x1a')](_0x47f49e);}return _0x162b10[_0x8737('0x1b')](_0x47f49e)[_0x8737('0x1c')]();};}function respondWithResult(_0x223d8e,_0x3c03cc){_0x3c03cc=_0x3c03cc||0xc8;return function(_0x4c5ab4){if(_0x4c5ab4){return _0x223d8e[_0x8737('0x1b')](_0x3c03cc)['json'](_0x4c5ab4);}};}function respondWithFilteredResult(_0x47e56f,_0x298dc3){return function(_0x522d5e){if(_0x522d5e){var _0x1873e4=_0x522d5e['count'],_0xa0c78d=_0x298dc3[_0x8737('0x1d')],_0x237843=_0x298dc3[_0x8737('0x1d')]+_0x298dc3[_0x8737('0x1e')],_0xc97618;if(_0x237843>=_0x1873e4){_0x237843=_0x1873e4;_0xc97618=0xc8;}else{_0xc97618=0xce;}_0x47e56f[_0x8737('0x1b')](_0xc97618);return _0x47e56f[_0x8737('0x1f')](_0x8737('0x20'),_0xa0c78d+'-'+_0x237843+'/'+_0x1873e4)['json'](_0x522d5e);}return null;};}function patchUpdates(_0x3d900b){return function(_0x3cb626){try{jsonpatch['apply'](_0x3cb626,_0x3d900b,!![]);}catch(_0xd5998d){return BPromise[_0x8737('0x21')](_0xd5998d);}return _0x3cb626['save']();};}function saveUpdates(_0x4c68a3,_0x4ebfe5){return function(_0x67d2e0){if(_0x67d2e0){return _0x67d2e0['update'](_0x4c68a3)[_0x8737('0x22')](function(_0x54cebf){return _0x54cebf;});}return null;};}function removeEntity(_0x508a3c,_0xe974a0){return function(_0x281593){if(_0x281593){return _0x281593[_0x8737('0x23')]()[_0x8737('0x22')](function(){_0x508a3c[_0x8737('0x1b')](0xcc)[_0x8737('0x1c')]();});}};}function handleEntityNotFound(_0x10de7b,_0x500f10){return function(_0x3a895a){if(!_0x3a895a){_0x10de7b['sendStatus'](0x194);}return _0x3a895a;};}function handleError(_0x123470,_0x13b105){_0x13b105=_0x13b105||0x1f4;return function(_0x945c52){logger['error'](_0x945c52[_0x8737('0x24')]);if(_0x945c52[_0x8737('0x25')]){delete _0x945c52[_0x8737('0x25')];}_0x123470[_0x8737('0x1b')](_0x13b105)['send'](_0x945c52);};}exports['index']=function(_0x1eeba5,_0x1d3e6e){var _0x2cff94={},_0x502e76={},_0x19d1d0={'count':0x0,'rows':[]};var _0x16d283=_[_0x8737('0x26')](db[_0x8737('0x27')][_0x8737('0x28')],function(_0x174b8f){return{'name':_0x174b8f[_0x8737('0x29')],'type':_0x174b8f['type'][_0x8737('0x2a')]};});_0x502e76['model']=_[_0x8737('0x26')](_0x16d283,_0x8737('0x25'));_0x502e76['query']=_[_0x8737('0x2b')](_0x1eeba5['query']);_0x502e76['filters']=_[_0x8737('0x2c')](_0x502e76['model'],_0x502e76[_0x8737('0x2d')]);_0x2cff94['attributes']=_['intersection'](_0x502e76['model'],qs[_0x8737('0x2e')](_0x1eeba5[_0x8737('0x2d')][_0x8737('0x2e')]));_0x2cff94[_0x8737('0x2f')]=_0x2cff94[_0x8737('0x2f')]['length']?_0x2cff94[_0x8737('0x2f')]:_0x502e76[_0x8737('0x30')];if(!_0x1eeba5[_0x8737('0x2d')][_0x8737('0x31')](_0x8737('0x32'))){_0x2cff94[_0x8737('0x1e')]=qs['limit'](_0x1eeba5[_0x8737('0x2d')][_0x8737('0x1e')]);_0x2cff94[_0x8737('0x1d')]=qs['offset'](_0x1eeba5[_0x8737('0x2d')]['offset']);}_0x2cff94[_0x8737('0x33')]=qs['sort'](_0x1eeba5[_0x8737('0x2d')]['sort']);_0x2cff94['where']=qs[_0x8737('0x34')](_[_0x8737('0x35')](_0x1eeba5[_0x8737('0x2d')],_0x502e76[_0x8737('0x34')]),_0x16d283);if(_0x1eeba5[_0x8737('0x2d')][_0x8737('0x36')]){_0x2cff94['where']=_[_0x8737('0x37')](_0x2cff94['where'],{'$or':_[_0x8737('0x26')](_0x16d283,function(_0x5df791){if(_0x5df791[_0x8737('0x38')]!==_0x8737('0x39')){var _0x373790={};_0x373790[_0x5df791['name']]={'$like':'%'+_0x1eeba5[_0x8737('0x2d')][_0x8737('0x36')]+'%'};return _0x373790;}})});}_0x2cff94=_['merge']({},_0x2cff94,_0x1eeba5['options']);var _0x395026={'where':_0x2cff94[_0x8737('0x3a')]};return db['UserProfile']['count'](_0x395026)['then'](function(_0x39bc05){_0x19d1d0[_0x8737('0x3b')]=_0x39bc05;if(_0x1eeba5['query'][_0x8737('0x3c')]){_0x2cff94[_0x8737('0x3d')]=[{'all':!![]}];}return db[_0x8737('0x27')][_0x8737('0x3e')](_0x2cff94);})[_0x8737('0x22')](function(_0x88067c){_0x19d1d0[_0x8737('0x3f')]=_0x88067c;return _0x19d1d0;})['then'](respondWithFilteredResult(_0x1d3e6e,_0x2cff94))[_0x8737('0x40')](handleError(_0x1d3e6e,null));};exports[_0x8737('0x41')]=function(_0x5b2dd9,_0x6a9807){var _0x343514={'raw':![],'where':{'id':_0x5b2dd9['params']['id']}},_0x159846={};_0x159846['model']=_[_0x8737('0x2b')](db['UserProfile'][_0x8737('0x28')]);_0x159846[_0x8737('0x2d')]=_['keys'](_0x5b2dd9[_0x8737('0x2d')]);_0x159846['filters']=_[_0x8737('0x2c')](_0x159846['model'],_0x159846[_0x8737('0x2d')]);_0x343514[_0x8737('0x2f')]=_[_0x8737('0x2c')](_0x159846[_0x8737('0x30')],qs['fields'](_0x5b2dd9[_0x8737('0x2d')][_0x8737('0x2e')]));_0x343514['attributes']=_0x343514['attributes'][_0x8737('0x42')]?_0x343514[_0x8737('0x2f')]:_0x159846[_0x8737('0x30')];if(_0x5b2dd9['query'][_0x8737('0x3c')]){_0x343514['include']=[{'all':!![]}];}_0x343514=_[_0x8737('0x37')]({},_0x343514,_0x5b2dd9[_0x8737('0x43')]);return db[_0x8737('0x27')][_0x8737('0x44')](_0x343514)[_0x8737('0x22')](handleEntityNotFound(_0x6a9807,null))[_0x8737('0x22')](respondWithResult(_0x6a9807,null))['catch'](handleError(_0x6a9807,null));};exports['create']=function(_0x44e7f8,_0x3e861b){return db['UserProfile'][_0x8737('0x45')](_0x44e7f8[_0x8737('0x46')],{})[_0x8737('0x22')](respondWithResult(_0x3e861b,0xc9))[_0x8737('0x40')](handleError(_0x3e861b,null));};exports[_0x8737('0x47')]=function(_0xe54da9,_0x4df287){var _0x299b44={'where':{'id':_0xe54da9[_0x8737('0x48')]['id']}},_0x530e1f={};_0x530e1f[_0x8737('0x30')]=_['keys'](db[_0x8737('0x27')]['rawAttributes']);_0x299b44[_0x8737('0x2f')]=_[_0x8737('0x2c')](_0x530e1f[_0x8737('0x30')],qs['fields'](_0xe54da9['query']['fields']));_0x299b44[_0x8737('0x2f')]=_0x299b44[_0x8737('0x2f')]['length']?_0x299b44[_0x8737('0x2f')]:_0x530e1f[_0x8737('0x30')];if(_0xe54da9[_0x8737('0x2d')][_0x8737('0x3c')]){_0x299b44[_0x8737('0x3d')]=[{'all':!![]}];}_0x299b44=_[_0x8737('0x37')]({},_0x299b44,_0xe54da9['options']);return db[_0x8737('0x27')][_0x8737('0x44')](_0x299b44)[_0x8737('0x22')](handleEntityNotFound(_0x4df287,null))[_0x8737('0x22')](function(_0x339c40){if(_0x339c40){var _0x1dece5=_0x339c40[_0x8737('0x49')]({'plain':!![]});_0x1dece5=qs[_0x8737('0x4a')](_0x1dece5,['id','createdAt',_0x8737('0x4b'),_0x8737('0x4c')]);_0xe54da9[_0x8737('0x46')]=_['omit'](_0xe54da9[_0x8737('0x46')],['id',_0x8737('0x4d'),_0x8737('0x4b')]);return db[_0x8737('0x4e')][_0x8737('0x4f')](function(_0x36bb7f){return db['UserProfile'][_0x8737('0x45')](_[_0x8737('0x37')](_0x1dece5,_0xe54da9[_0x8737('0x46')]),{'include':_0xe54da9[_0x8737('0x2d')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x36bb7f})[_0x8737('0x22')](function(_0x5d4b4d){var _0x805c52=_0x5d4b4d['get']({'plain':!![]});return db['UserProfileSection'][_0x8737('0x3e')]({'where':{'userProfileId':_0xe54da9['params']['id']},'raw':!![]})['then'](function(_0x1ebbaa){if(_0x1ebbaa){return BPromise['each'](_0x1ebbaa,function(_0x45c72b){return new BPromise(function(_0x546699,_0x32e1a2){if(_0x45c72b[_0x8737('0x50')]===null||_0x45c72b['autoAssociation']===0x1)_0x546699(null);return db[_0x8737('0x51')]['findAll']({'where':{'sectionId':_0x45c72b['id']},'raw':!![]})[_0x8737('0x22')](function(_0x557825){var _0x51dd11=_['map'](_0x557825,function(_0x28586f){return qs['omit'](_0x28586f,['id',_0x8737('0x4d'),_0x8737('0x4b'),'sectionId']);});_0x546699(_0x51dd11);})[_0x8737('0x40')](function(_0x50ac16){_0x32e1a2(_0x50ac16);});})['then'](function(_0x7293b5){var _0x2da26e=qs[_0x8737('0x4a')](_0x45c72b,['id','createdAt',_0x8737('0x4b')]);_0x2da26e[_0x8737('0x52')]=_0x805c52['id'];if(_0x7293b5)_0x2da26e['Resources']=_0x7293b5;return _0x2da26e;})['then'](function(_0x3d0ed5){return db['UserProfileSection']['create'](_0x3d0ed5,{'include':[{'model':db[_0x8737('0x51')],'as':_0x8737('0x53')}],'raw':!![],'transaction':_0x36bb7f});});})[_0x8737('0x22')](function(){return _0x805c52;});}});});});}})[_0x8737('0x22')](respondWithResult(_0x4df287,0xc9))[_0x8737('0x40')](handleError(_0x4df287,null));};exports[_0x8737('0x54')]=function(_0x38ef7e,_0x227487){if(_0x38ef7e[_0x8737('0x46')]['id']){delete _0x38ef7e['body']['id'];}return db[_0x8737('0x27')]['find']({'where':{'id':_0x38ef7e['params']['id']}})[_0x8737('0x22')](handleEntityNotFound(_0x227487,null))[_0x8737('0x22')](saveUpdates(_0x38ef7e[_0x8737('0x46')],null))[_0x8737('0x22')](respondWithResult(_0x227487,null))[_0x8737('0x40')](handleError(_0x227487,null));};exports[_0x8737('0x23')]=function(_0x44c6fe,_0x38033e){return db[_0x8737('0x27')]['find']({'where':{'id':_0x44c6fe[_0x8737('0x48')]['id']}})['then'](handleEntityNotFound(_0x38033e,null))[_0x8737('0x22')](removeEntity(_0x38033e,null))['catch'](handleError(_0x38033e,null));};exports[_0x8737('0x55')]=function(_0x1ded5f,_0x546987){return db['UserProfile'][_0x8737('0x55')]()['then'](respondWithResult(_0x546987,null))[_0x8737('0x40')](handleError(_0x546987,null));};exports[_0x8737('0x56')]=function(_0xd04136,_0x32cfb2){var _0x5aacec=_0xd04136[_0x8737('0x46')];return db['UserProfile']['find']({'where':{'id':_0xd04136[_0x8737('0x48')]['id']}})['then'](handleEntityNotFound(_0x32cfb2,null))['then'](function(_0xbc315){if(_0xbc315){return db['sequelize']['transaction'](function(_0x282d0a){return db[_0x8737('0x57')][_0x8737('0x23')]({'where':{'userProfileId':_0xd04136[_0x8737('0x48')]['id'],'sectionId':_[_0x8737('0x26')](_0x5aacec,function(_0xd3d514){return _0xd3d514[_0x8737('0x58')];})},'transaction':_0x282d0a})['then'](function(){var _0xbe947d=_[_0x8737('0x26')](_0x5aacec,function(_0x38b859){_0x38b859[_0x8737('0x52')]=_0xd04136[_0x8737('0x48')]['id'];return _0x38b859;});var _0xf27e1b=[];return BPromise[_0x8737('0x59')](_0xbe947d,function(_0x4a652f){return db['UserProfileSection']['create'](_0x4a652f,{'include':[{'model':db[_0x8737('0x51')],'as':_0x8737('0x53')}],'raw':!![],'transaction':_0x282d0a})['then'](function(_0x3555c9){_0xf27e1b[_0x8737('0x5a')](_0x3555c9[_0x8737('0x49')]({'plain':!![]}));});})[_0x8737('0x22')](function(){return _0xf27e1b;});});});}})['then'](function(_0xf2eef4){return _0xf2eef4;})[_0x8737('0x22')](respondWithResult(_0x32cfb2,null))['catch'](handleError(_0x32cfb2,null));};exports['removeSections']=function(_0x1c956d,_0x41f0df){var _0x4d5c9c;return db['UserProfile'][_0x8737('0x44')]({'where':{'id':_0x1c956d[_0x8737('0x48')]['id']},'attributes':['id',_0x8737('0x25')]})[_0x8737('0x22')](handleEntityNotFound(_0x41f0df,null))['then'](function(_0x53a19c){if(_0x53a19c){_0x4d5c9c=_0x53a19c;return db[_0x8737('0x57')][_0x8737('0x23')]({'where':{'userProfileId':_0x1c956d['params']['id'],'sectionId':_0x1c956d[_0x8737('0x2d')][_0x8737('0x5b')]}});}})[_0x8737('0x22')](function(){return _0x4d5c9c;})[_0x8737('0x22')](respondWithStatusCode(_0x41f0df,null))[_0x8737('0x40')](handleError(_0x41f0df,null));};exports[_0x8737('0x5c')]=function(_0x2bb122,_0x536bc8){var _0x11a8e3=[];var _0x2746f9=[];return db[_0x8737('0x57')]['findAll']({'where':{'userProfileId':_0x2bb122['params']['id']},'raw':!![]})[_0x8737('0x22')](function(_0x373510){_0x11a8e3=_[_0x8737('0x36')](_0x373510,function(_0x22c44b){return _0x22c44b[_0x8737('0x5d')]===0x1||_[_0x8737('0x5e')]([0x3eb,0x709],_0x22c44b[_0x8737('0x58')]);});if(!_['isEmpty'](_0x11a8e3)){return _['map'](_0x11a8e3,function(_0x438ca2){return _0x438ca2['sectionId'];});}else{return;}})[_0x8737('0x22')](function(_0x1131e6){if(_0x1131e6)_0x2746f9=_0x1131e6;if(_[_0x8737('0x5e')](_0x2746f9,0x64)){var _0x3a0c2c=_[_0x8737('0x44')](_0x11a8e3,{'sectionId':0x64});return hasDefaultDashboard(_0x3a0c2c)[_0x8737('0x22')](function(_0x45e26a){return _[_0x8737('0x26')](_0x11a8e3,function(_0x2607f8){if(_0x2607f8[_0x8737('0x58')]===0x64){_0x2607f8['subsections']=_0x45e26a;}return _0x2607f8;});});}else{return;}})[_0x8737('0x22')](function(_0x300a47){if(_0x300a47)_0x11a8e3=_0x300a47;if(_['includes'](_0x2746f9,0x3eb)){var _0x39947e=_['find'](_0x11a8e3,{'sectionId':0x3eb});return getCustomDashboards(_0x39947e)[_0x8737('0x22')](function(_0x828f36){return _[_0x8737('0x26')](_0x11a8e3,function(_0x5a57f0){if(_0x39947e[_0x8737('0x5d')]){if(_0x5a57f0[_0x8737('0x58')]===0x3eb){_0x5a57f0[_0x8737('0x5f')]=_0x828f36;}}else{if(_0x5a57f0[_0x8737('0x58')]===0x64){_0x5a57f0[_0x8737('0x5f')]=_0x828f36;}}return _0x5a57f0;});});}else{return;}})[_0x8737('0x22')](function(_0x35e7a4){if(_0x35e7a4)_0x11a8e3=_0x35e7a4;if(_['includes'](_0x2746f9,0x709)){var _0x3a58ad=_[_0x8737('0x44')](_0x11a8e3,{'sectionId':0x709});return getPlugins(_0x3a58ad)[_0x8737('0x22')](function(_0x3be9db){if(_0x3a58ad[_0x8737('0x5d')]){return _[_0x8737('0x26')](_0x11a8e3,function(_0x52788d){if(_0x52788d[_0x8737('0x58')]===0x709){_0x52788d['subsections']=_0x3be9db;}return _0x52788d;});}else{var _0x45e463={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3be9db};var _0x2bad3e=_[_0x8737('0x26')](_0x11a8e3);_0x2bad3e[_0x8737('0x5a')](_0x45e463);return _0x2bad3e;}});}else{return;}})['then'](function(_0x3c1b02){if(_0x3c1b02)_0x11a8e3=_0x3c1b02;return _[_0x8737('0x36')](_0x11a8e3,[_0x8737('0x5d'),0x1]);})[_0x8737('0x22')](respondWithResult(_0x536bc8,null))[_0x8737('0x40')](handleError(_0x536bc8,null));};function hasDefaultDashboard(_0x49cf24){var _0x26fe0e=[0x65];return new BPromise(function(_0x22e61f,_0xd598d1){try{if(_0x49cf24[_0x8737('0x50')]){_0x22e61f(_0x26fe0e);}else{return db[_0x8737('0x51')][_0x8737('0x60')]({'where':{'sectionId':_0x49cf24['id']},'raw':!![]})[_0x8737('0x22')](function(_0x628229){_0x628229?_0x22e61f(_0x26fe0e):_0x22e61f();});}}catch(_0x44afd8){_0xd598d1(_0x44afd8);}});}function getCustomDashboards(_0x7240f){var _0x2705c0=[];return new BPromise(function(_0x20607f,_0x27bd19){try{if(_0x7240f[_0x8737('0x50')]){return db[_0x8737('0x61')][_0x8737('0x3e')]({'raw':!![]})[_0x8737('0x22')](function(_0x511e0c){_0x511e0c['forEach'](function(_0x56c22a){_0x2705c0[_0x8737('0x5a')](_0x56c22a['id']+0x1869f);});_0x20607f(_0x2705c0);});}else{return db[_0x8737('0x51')][_0x8737('0x3e')]({'where':{'sectionId':_0x7240f['id']},'raw':!![]})[_0x8737('0x22')](function(_0x23dbfd){_0x23dbfd[_0x8737('0x62')](function(_0x36669e){_0x2705c0[_0x8737('0x5a')](_0x36669e[_0x8737('0x63')]+0x1869f);});_0x20607f(_0x2705c0);});}}catch(_0x7ec93a){_0x27bd19(_0x7ec93a);}});}function getPlugins(_0x7bb283){var _0x150c3c=[];return new BPromise(function(_0x33e2f5,_0x368b3e){try{if(_0x7bb283[_0x8737('0x50')]){return db[_0x8737('0x64')]['findAll']({'raw':!![]})[_0x8737('0x22')](function(_0x35418f){_0x35418f[_0x8737('0x62')](function(_0x2d551e){_0x150c3c[_0x8737('0x5a')](_0x2d551e['id']+0x15b38);});_0x33e2f5(_0x150c3c);});}else{return db['UserProfileResource'][_0x8737('0x3e')]({'where':{'sectionId':_0x7bb283['id']},'raw':!![]})[_0x8737('0x22')](function(_0x2aa06c){_0x2aa06c['forEach'](function(_0x41e4c5){_0x150c3c[_0x8737('0x5a')](_0x41e4c5[_0x8737('0x63')]+0x15b38);});_0x33e2f5(_0x150c3c);});}}catch(_0x25c87c){_0x368b3e(_0x25c87c);}});}exports[_0x8737('0x65')]=function(_0x1fd434,_0x3865d5){return db[_0x8737('0x27')][_0x8737('0x44')]({'where':{'id':_0x1fd434[_0x8737('0x48')]['id']}})[_0x8737('0x22')](handleEntityNotFound(_0x3865d5,null))[_0x8737('0x22')](function(_0x13cfd6){if(_0x13cfd6){return db[_0x8737('0x4e')][_0x8737('0x4f')](function(_0x5c3eb0){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x1fd434[_0x8737('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x8737('0x22')](function(_0x5ed43e){if(_0x5ed43e){return db[_0x8737('0x57')][_0x8737('0x23')]({'where':{'userProfileId':_0x1fd434[_0x8737('0x48')]['id'],'id':_[_0x8737('0x26')](_0x5ed43e,function(_0x10c8ce){return _0x10c8ce['id'];})},'transaction':_0x5c3eb0});}})[_0x8737('0x22')](function(_0x29a12a){var _0x22d956=_[_0x8737('0x26')](_0x1fd434['body'],function(_0x5b1ce0){_0x5b1ce0[_0x8737('0x52')]=_0x1fd434[_0x8737('0x48')]['id'];return _0x5b1ce0;});return db[_0x8737('0x57')][_0x8737('0x66')](_0x22d956,{'raw':!![],'transaction':_0x5c3eb0});})['then'](function(_0x1ed02a){var _0x49271f=_[_0x8737('0x36')](_[_0x8737('0x26')](_0x1ed02a,function(_0x2ff48a){return _0x2ff48a['get']({'plain':!![]});}),{'includeAll':![]});if(_0x49271f){return db[_0x8737('0x57')][_0x8737('0x3e')]({'where':{'userProfileId':_0x1fd434['params']['id'],'sectionId':_[_0x8737('0x26')](_0x49271f,function(_0x3f97cb){return _0x3f97cb['sectionId'];})},'attributes':['id',_0x8737('0x58')],'raw':!![]})['then'](function(_0x44c4f3){var _0x250928=_[_0x8737('0x26')](_0x1fd434[_0x8737('0x46')],function(_0xcb709d){_0xcb709d[_0x8737('0x52')]=_0x1fd434[_0x8737('0x48')]['id'];return _0xcb709d;});return db[_0x8737('0x51')][_0x8737('0x66')](_0x250928,{'raw':!![],'transaction':_0x5c3eb0});});}})[_0x8737('0x40')](handleError(_0x3865d5,null));});}})['then'](function(_0x1cf3e8){var _0x47b168=_[_0x8737('0x26')](_0x1cf3e8,function(_0xb688a9){return _0xb688a9[_0x8737('0x49')]({'plain':!![]});});})['then'](respondWithResult(_0x3865d5,null))[_0x8737('0x40')](handleError(_0x3865d5,null));};exports[_0x8737('0x67')]=function(_0x115b52,_0x20ccf4,_0x2e1ff7){return db[_0x8737('0x27')][_0x8737('0x44')]({'where':{'id':_0x115b52[_0x8737('0x48')]['id']}})[_0x8737('0x22')](handleEntityNotFound(_0x20ccf4,null))[_0x8737('0x22')](function(_0x2d339c){if(_0x2d339c){return _0x2d339c['removeResources'](_0x115b52[_0x8737('0x2d')][_0x8737('0x5b')]);}})['then'](respondWithStatusCode(_0x20ccf4,null))[_0x8737('0x40')](handleError(_0x20ccf4,null));};exports[_0x8737('0x68')]=function(_0x13360e,_0x56e6d8){var _0x48221d={'raw':![],'where':{}};var _0x256931={};var _0x4a099d={'count':0x0,'rows':[]};var _0x232148=_0x13360e[_0x8737('0x2d')]['section'];if(typeof _0x232148===_0x8737('0x69')){throw new db[(_0x8737('0x6a'))]['ValidationError'](_0x8737('0x6b'));}var _0x57301b=_0x13360e[_0x8737('0x2d')][_0x8737('0x6c')]||![];var _0x31ef22=getQueryModels(_0x232148,_0x57301b);if(typeof _0x31ef22['childModel']==='undefined'){throw new db[(_0x8737('0x6a'))][(_0x8737('0x6d'))](_0x8737('0x6e')+_0x232148+'\x27');}var _0x176691=[];if(!_[_0x8737('0x6f')](_0x31ef22[_0x8737('0x70')])){_0x176691=_0x31ef22[_0x8737('0x70')];}else{_0x176691=[{'name':_0x232148}];}return db[_0x8737('0x27')]['findOne']({'where':{'id':_0x13360e[_0x8737('0x48')]['id']}})[_0x8737('0x22')](handleEntityNotFound(_0x56e6d8,null))[_0x8737('0x22')](function(_0x3c790f){if(_0x3c790f){var _0x510bbd=[];for(var _0x14fcc6=0x0;_0x14fcc6<_0x176691[_0x8737('0x42')];_0x14fcc6++){_0x510bbd[_0x8737('0x5a')](db[_0x8737('0x57')][_0x8737('0x60')]({'where':{'userProfileId':_0x3c790f['id'],'name':_0x176691[_0x14fcc6]['name']},'raw':!![]}));}return BPromise[_0x8737('0x71')](_0x510bbd);}})[_0x8737('0x22')](function(_0x13e6fd){var _0x563e6b=_['filter'](_0x13e6fd,function(_0x495ca5){return _0x495ca5?_0x495ca5:undefined;});var _0x17ad9d=_[_0x8737('0x36')](_0x176691,[_0x8737('0x72'),!![]]);var _0x5f2fcb=_[_0x8737('0x6f')](_0x563e6b)&&_[_0x8737('0x6f')](_0x17ad9d)?null:_[_0x8737('0x73')](_0x17ad9d,_0x563e6b);if(_0x5f2fcb){var _0x4cec20=[];for(var _0x1df080=0x0;_0x1df080<_0x5f2fcb[_0x8737('0x42')];_0x1df080++){var _0x34a505=_[_0x8737('0x44')](_0x176691,function(_0x1ae718){return _0x5f2fcb[_0x1df080]?_0x1ae718[_0x8737('0x25')]===_0x5f2fcb[_0x1df080][_0x8737('0x25')]:null;});if(_0x34a505){if(_0x5f2fcb[_0x1df080]['ignore']){_0x4cec20[_0x8737('0x5a')](getAllResources(_0x31ef22['childModel'],_0x5f2fcb[_0x1df080]));}else{if(!_0x5f2fcb[_0x1df080][_0x8737('0x50')]){_0x4cec20['push'](getAllowedResources(_0x34a505,_0x5f2fcb[_0x1df080],_0x31ef22[_0x8737('0x74')]));}else{if(_0x34a505['model']){_0x4cec20[_0x8737('0x5a')](getAllFilteredResources(_0x34a505,_0x5f2fcb[_0x1df080]));}}}}}return BPromise[_0x8737('0x71')](_0x4cec20);}else{return null;}})[_0x8737('0x22')](function(_0x4edcb0){var _0x58bb80=_0x4edcb0;var _0x102e31=null;if(_0x58bb80){_0x102e31=_0x58bb80[_0x8737('0x42')]===0x1?_0x58bb80[0x0]:null;}if(_0x102e31||_0x58bb80){var _0x1f8221=db[_0x31ef22['childModel']][_0x8737('0x28')];_0x256931[_0x8737('0x30')]=_['keys'](_0x1f8221);_0x256931[_0x8737('0x2d')]=_[_0x8737('0x2b')](_0x13360e['query']);_0x256931['filters']=_[_0x8737('0x2c')](_0x256931['model'],_0x256931[_0x8737('0x2d')]);_0x48221d[_0x8737('0x2f')]=_[_0x8737('0x2c')](_0x256931['model'],qs[_0x8737('0x2e')](_0x13360e[_0x8737('0x2d')][_0x8737('0x2e')]));_0x48221d['attributes']=_0x48221d[_0x8737('0x2f')][_0x8737('0x42')]?_0x48221d['attributes']:_0x256931[_0x8737('0x30')];if(!_0x13360e[_0x8737('0x2d')][_0x8737('0x31')](_0x8737('0x32'))){_0x48221d[_0x8737('0x1e')]=qs['limit'](_0x13360e[_0x8737('0x2d')]['limit']);_0x48221d['offset']=qs['offset'](_0x13360e[_0x8737('0x2d')][_0x8737('0x1d')]);}_0x48221d['order']=qs[_0x8737('0x75')](_0x13360e[_0x8737('0x2d')]['sort']);_0x48221d[_0x8737('0x3a')]=qs[_0x8737('0x34')](_[_0x8737('0x35')](_0x13360e[_0x8737('0x2d')],_0x256931[_0x8737('0x34')]));if(_0x13360e['query'][_0x8737('0x36')]){_0x48221d[_0x8737('0x3a')]=_['merge'](_0x48221d['where'],{'$or':_[_0x8737('0x26')](_0x1f8221,function(_0x409d54){if(_0x409d54[_0x8737('0x38')][_0x8737('0x2a')]!==_0x8737('0x39')){var _0x1c196a={};_0x1c196a[_0x409d54[_0x8737('0x76')]]={'$like':'%'+_0x13360e[_0x8737('0x2d')][_0x8737('0x36')]+'%'};return _0x1c196a;}})});}var _0x50df27=[];if(_0x102e31){var _0x448082=_['find'](_0x176691,[_0x8737('0x25'),_0x102e31['name']]);if(_0x448082[_0x8737('0x76')]){var _0x428884={};if(_0x31ef22['childModel']===_0x8737('0x77')){_0x428884[_0x448082[_0x8737('0x78')]]=_[_0x8737('0x26')](_0x102e31[_0x8737('0x79')],'id');}else{_0x428884[_0x448082['foreignKey']]=_0x102e31[_0x8737('0x79')];}_0x50df27[_0x8737('0x5a')](_0x428884);}else{_0x48221d[_0x8737('0x3a')]['id']=_0x102e31['associatedResources'];}}else{for(var _0x26c02d=0x0;_0x26c02d<_0x58bb80['length'];_0x26c02d++){var _0x448082=_[_0x8737('0x44')](_0x176691,['name',_0x58bb80[_0x26c02d]['name']]);if(_0x448082[_0x8737('0x76')]){var _0x428884={};_0x428884[_0x448082[_0x8737('0x78')]]=_0x58bb80[_0x26c02d][_0x8737('0x79')];_0x50df27[_0x8737('0x5a')](_0x428884);}else{if(!_0x48221d[_0x8737('0x3a')]['id'])_0x48221d['where']['id']=[];_0x58bb80[_0x26c02d][_0x8737('0x79')][_0x8737('0x62')](function(_0x361278){_0x48221d['where']['id'][_0x8737('0x5a')](_0x361278);});}}}if(!_[_0x8737('0x6f')](_0x50df27)){_0x48221d['where']=_['merge'](_0x48221d['where'],{'$and':{'$or':_0x50df27}});}_0x48221d=_[_0x8737('0x37')]({},_0x48221d,_0x13360e['options']);if(_0x102e31&&!_0x102e31[_0x8737('0x50')]&&_0x31ef22[_0x8737('0x74')]===_0x8737('0x77')){if(_0x13360e[_0x8737('0x2d')][_0x8737('0x3c')]){_0x48221d[_0x8737('0x3d')]=[{'all':!![]}];}return db[_0x31ef22[_0x8737('0x74')]]['findAll'](_0x48221d)['then'](function(_0x2e630a){var _0x330034=[];_0x2e630a[_0x8737('0x62')](function(_0x46a416){var _0x4c2997;switch(_0x46a416[_0x8737('0x7a')]){case'default':_0x4c2997=_[_0x8737('0x44')](_0x102e31['associatedResources'],function(_0x2eec0e){return _0x2eec0e['id']===_0x46a416[_0x8737('0x7b')]&&_0x2eec0e[_0x8737('0x38')]===_0x8737('0x7c');});break;case _0x8737('0x7d'):_0x4c2997=_['find'](_0x102e31[_0x8737('0x79')],function(_0x59e82b){return _0x59e82b['id']===_0x46a416[_0x8737('0x7b')]&&_0x59e82b[_0x8737('0x38')]===_0x8737('0x7e');});break;}if(_0x4c2997)_0x330034[_0x8737('0x5a')](_0x46a416);});_0x4a099d['count']=_0x330034[_0x8737('0x42')];_0x4a099d[_0x8737('0x3f')]=_0x330034;return _0x4a099d;});}else{return db[_0x31ef22[_0x8737('0x74')]][_0x8737('0x3b')]({'where':_0x48221d['where']})[_0x8737('0x22')](function(_0x3bc6c6){_0x4a099d[_0x8737('0x3b')]=_0x3bc6c6;if(_0x13360e[_0x8737('0x2d')][_0x8737('0x3c')]){if(_0x31ef22['childModel']===_0x8737('0x7f')){_0x48221d['include']=[{'model':db[_0x8737('0x80')],'as':_0x8737('0x81'),'attributes':['id',_0x8737('0x25'),'color'],'required':_0x13360e['query'][_0x8737('0x82')]?!![]:![]},{'model':db[_0x8737('0x80')],'as':_0x8737('0x83'),'attributes':['id',_0x8737('0x25'),_0x8737('0x84')],'through':_0x13360e[_0x8737('0x2d')][_0x8737('0x82')]?{'attributes':[],'where':{'TagId':_0x13360e[_0x8737('0x2d')][_0x8737('0x82')]||undefined}}:{},'required':_0x13360e[_0x8737('0x2d')]['tag']?!![]:![]}];}else{_0x48221d['include']=[{'all':!![]}];}}return db[_0x31ef22[_0x8737('0x74')]][_0x8737('0x3e')](_0x48221d);})[_0x8737('0x22')](function(_0xf98816){_0x4a099d[_0x8737('0x3f')]=_0xf98816;return _0x4a099d;});}}else{return _0x4a099d;}})['then'](respondWithFilteredResult(_0x56e6d8,_0x48221d))[_0x8737('0x40')](handleError(_0x56e6d8,null));};function getAllResources(_0x386fbc,_0x30b703){return new BPromise(function(_0x3496c8,_0x270d4a){if(_0x30b703){var _0x571923=_0x30b703[_0x8737('0x36')]?{[_0x30b703[_0x8737('0x36')][_0x8737('0x76')]]:_0x30b703['filter'][_0x8737('0x85')]}:undefined;return db[_0x386fbc][_0x8737('0x3e')]({'where':_0x571923,'raw':!![]})[_0x8737('0x22')](function(_0x33f503){_0x30b703['associatedResources']=_[_0x8737('0x26')](_0x33f503,'id');_0x3496c8(_0x30b703);})[_0x8737('0x40')](function(_0x50405f){_0x270d4a(_0x50405f);});}else{_0x3496c8(null);}});}function getAllFilteredResources(_0x313780,_0x4dce26){return new BPromise(function(_0xe8c8d,_0x587b29){var _0x2c1985=_0x313780[_0x8737('0x36')]?{[_0x313780[_0x8737('0x36')][_0x8737('0x76')]]:_0x313780[_0x8737('0x36')]['value']}:undefined;return db[_0x313780[_0x8737('0x30')]]['findAll']({'where':_0x2c1985,'raw':!![]})[_0x8737('0x22')](function(_0x25ae39){_0x4dce26['associatedResources']=_[_0x8737('0x26')](_0x25ae39,function(_0x116940){return _0x116940[_0x8737('0x25')];});_0xe8c8d(_0x4dce26);})[_0x8737('0x40')](function(_0x1dd311){_0x587b29(_0x1dd311);});});}function getAllowedResources(_0x2d5807,_0x44cc30,_0x1d0a11){return new BPromise(function(_0x3c0683,_0x242990){if(_0x44cc30){return db[_0x8737('0x51')]['findAll']({'where':{'sectionId':_0x44cc30['id']},'raw':!![]})[_0x8737('0x22')](function(_0x2a323e){if(_0x2d5807[_0x8737('0x76')]&&_0x2d5807[_0x8737('0x76')]!=='id'){_0x44cc30[_0x8737('0x79')]=_['map'](_0x2a323e,function(_0x2f524d){return _0x2f524d[_0x2d5807['field']];});}else{if(_0x1d0a11===_0x8737('0x77')){_0x44cc30[_0x8737('0x79')]=_[_0x8737('0x26')](_0x2a323e,function(_0x15c98b){return{'id':_0x15c98b['resourceId'],'type':_0x15c98b['type']};});}else{_0x44cc30['associatedResources']=_[_0x8737('0x26')](_0x2a323e,function(_0x505db0){return _0x505db0[_0x8737('0x63')];});}}_0x3c0683(_0x44cc30);})[_0x8737('0x40')](function(_0x1870c0){_0x242990(_0x1870c0);});}else{_0x3c0683(null);}});}function getQueryModels(_0x26f1c2,_0x3a5e59){var _0x2928bb=_0x26f1c2[_0x8737('0x86')]();var _0x2f00b6={'childModel':undefined,'parentSections':[]};switch(_0x2928bb){case _0x8737('0x87'):_0x2f00b6['childModel']='SquareProject';break;case _0x8737('0x88'):_0x2f00b6[_0x8737('0x74')]='SquareOdbc';break;case _0x8737('0x89'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0x8a');_0x2f00b6['parentSections']=[{'name':_0x8737('0x8b'),'field':'name','foreignKey':_0x8737('0x8c')}];break;case'projects':_0x2f00b6[_0x8737('0x74')]=_0x8737('0x8d');break;case _0x8737('0x8e'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0x7f');_0x2f00b6[_0x8737('0x70')]=[{'name':_0x8737('0x8f'),'field':'id','foreignKey':_0x8737('0x90')}];break;case _0x8737('0x91'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0x92');break;case _0x8737('0x93'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0x94');break;case _0x8737('0x95'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0x96');break;case'chatqueues':_0x2f00b6['childModel']=_0x8737('0x97');break;case _0x8737('0x98'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0x99');break;case _0x8737('0x9a'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0x9b');break;case _0x8737('0x9c'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0x9d');break;case _0x8737('0x9e'):case'internalroutes':case _0x8737('0x9f'):_0x2f00b6[_0x8737('0x74')]='VoiceExtension';break;case'contexts':_0x2f00b6['childModel']=_0x8737('0xa0');break;case _0x8737('0xa1'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xa2');break;case _0x8737('0xa3'):_0x2f00b6['childModel']=_0x8737('0xa4');_0x2f00b6[_0x8737('0x70')]=[{'name':_0x8737('0xa5'),'field':_0x8737('0x25'),'foreignKey':_0x8737('0xa6'),'model':_0x8737('0xa7'),'filter':{'field':'role','value':[_0x8737('0xa8')]}},{'name':_0x8737('0xa9'),'field':_0x8737('0x25'),'foreignKey':_0x8737('0xa6'),'model':_0x8737('0xa7'),'filter':{'field':_0x8737('0xaa'),'value':[_0x8737('0xab')]}},{'name':'VoiceQueues','field':'name','foreignKey':'queue','model':_0x8737('0xac'),'filter':{'field':_0x8737('0x38'),'value':[_0x8737('0xad')]}},{'name':_0x8737('0xae'),'field':'name','foreignKey':_0x8737('0xaf'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x8737('0xb0')]}}];break;case _0x8737('0xb1'):_0x2f00b6['childModel']='VoiceMusicOnHold';break;case _0x8737('0xb2'):_0x2f00b6['childModel']=_0x8737('0xb3');break;case _0x8737('0xb4'):_0x2f00b6['childModel']=_0x8737('0xb5');break;case _0x8737('0xb6'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xb7');break;case'mailqueues':_0x2f00b6[_0x8737('0x74')]=_0x8737('0xb8');break;case _0x8737('0xb9'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xba');break;case _0x8737('0xbb'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xbc');break;case'openchannelqueues':_0x2f00b6['childModel']='OpenchannelQueue';break;case _0x8737('0xbd'):_0x2f00b6[_0x8737('0x74')]='OpenchannelAccount';break;case _0x8737('0xbe'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xbf');break;case'smsaccounts':_0x2f00b6['childModel']=_0x8737('0xc0');break;case _0x8737('0xc1'):_0x2f00b6['childModel']=_0x8737('0xc2');break;case _0x8737('0xc3'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xc4');break;case _0x8737('0xc5'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xc6');break;case _0x8737('0xc7'):case _0x8737('0xc8'):_0x2f00b6['childModel']=_0x8737('0xac');if(_0x3a5e59){_0x2f00b6['parentSections']=[{'name':_0x8737('0xc9')},{'name':_0x8737('0xae')}];}break;case _0x8737('0xca'):case _0x8737('0xcb'):case _0x8737('0xcc'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xa7');if(_0x3a5e59){_0x2f00b6['parentSections']=[{'name':_0x8737('0xcd'),'filter':{'field':_0x8737('0xaa'),'value':['admin','user']},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x8737('0xce'):_0x2f00b6[_0x8737('0x74')]='ZendeskAccount';break;case'salesforceaccounts':_0x2f00b6['childModel']=_0x8737('0xcf');break;case _0x8737('0xd0'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xd1');break;case _0x8737('0xd2'):_0x2f00b6['childModel']='SugarcrmAccount';break;case _0x8737('0xd3'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xd4');break;case _0x8737('0xd5'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xd6');break;case _0x8737('0xd7'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xa7');break;case _0x8737('0xd8'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xd9');break;case'dispositions':_0x2f00b6[_0x8737('0x74')]=_0x8737('0xda');break;case _0x8737('0xdb'):_0x2f00b6[_0x8737('0x74')]='Dashboard';break;case _0x8737('0xdc'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xdd');break;case _0x8737('0xde'):_0x2f00b6[_0x8737('0x74')]='Pause';break;case'scheduler':_0x2f00b6[_0x8737('0x74')]=_0x8737('0xdf');break;case'sounds':_0x2f00b6[_0x8737('0x74')]=_0x8737('0xe0');break;case _0x8737('0xe1'):_0x2f00b6['childModel']=_0x8737('0x80');break;case _0x8737('0xe2'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xe3');break;case _0x8737('0xe4'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xe5');break;case _0x8737('0xe6'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xe7');break;case _0x8737('0xe8'):_0x2f00b6['childModel']=_0x8737('0xe9');break;case _0x8737('0xea'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0x64');break;case _0x8737('0xeb'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0x77');_0x2f00b6[_0x8737('0x70')]=[{'name':_0x8737('0xec'),'field':'id','foreignKey':_0x8737('0x7b')}];break;case'metrics':_0x2f00b6[_0x8737('0x74')]=_0x8737('0xed');break;case _0x8737('0xc3'):_0x2f00b6[_0x8737('0x74')]=_0x8737('0xc4');break;default:return _0x2f00b6;}return _0x2f00b6;} \ No newline at end of file +var _0x5dcd=['SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','intervals','Interval','Pause','Schedule','tags','templates','trunks','plugins','metrics','AnalyticMetric','WhatsappAccount','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','limit','apply','reject','update','then','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','UserProfile','rows','catch','show','params','include','find','create','body','clone','get','crudPermissions','omit','updatedAt','sequelize','transaction','each','autoAssociation','UserProfileResource','createdAt','sectionId','userProfileId','Resources','UserProfileSection','destroy','describe','addSections','ids','enabled','includes','isEmpty','subsections','push','findOne','Dashboard','findAll','forEach','resourceId','addResources','bulkCreate','removeResources','section','undefined','Sequelize','ValidationError','mergeResources','Invalid\x20section\x20\x27','parentSections','all','ignore','childModel','filters','key','field','foreignKey','associatedResources','AnalyticExtractedReport','reportType','default','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','mailaccounts','MailAccount','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','WhatsappQueue','teams','Team','queuecampaigns','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts'];(function(_0x27b8d7,_0x23aab9){var _0x2e5568=function(_0xba9577){while(--_0xba9577){_0x27b8d7['push'](_0x27b8d7['shift']());}};_0x2e5568(++_0x23aab9);}(_0x5dcd,0xf8));var _0xd5dc=function(_0x5ed4e6,_0xa93a52){_0x5ed4e6=_0x5ed4e6-0x0;var _0x185c3c=_0x5dcd[_0x5ed4e6];return _0x185c3c;};'use strict';var emlformat=require(_0xd5dc('0x0'));var rimraf=require(_0xd5dc('0x1'));var zipdir=require(_0xd5dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd5dc('0x3'));var moment=require(_0xd5dc('0x4'));var BPromise=require(_0xd5dc('0x5'));var Mustache=require(_0xd5dc('0x6'));var util=require('util');var path=require(_0xd5dc('0x7'));var sox=require(_0xd5dc('0x8'));var csv=require('to-csv');var ejs=require(_0xd5dc('0x9'));var fs=require('fs');var fs_extra=require(_0xd5dc('0xa'));var _=require(_0xd5dc('0xb'));var squel=require('squel');var crypto=require(_0xd5dc('0xc'));var jsforce=require(_0xd5dc('0xd'));var deskjs=require(_0xd5dc('0xe'));var toCsv=require(_0xd5dc('0xf'));var querystring=require(_0xd5dc('0x10'));var Papa=require(_0xd5dc('0x11'));var Redis=require(_0xd5dc('0x12'));var authService=require(_0xd5dc('0x13'));var qs=require(_0xd5dc('0x14'));var as=require(_0xd5dc('0x15'));var hardwareService=require(_0xd5dc('0x16'));var logger=require(_0xd5dc('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xd5dc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd5dc('0x19'))['db'];config[_0xd5dc('0x1a')]=_[_0xd5dc('0x1b')](config['redis'],{'host':_0xd5dc('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd5dc('0x1a')]));require('./userProfile.socket')[_0xd5dc('0x1d')](socket);function respondWithStatusCode(_0x5753ea,_0x535382){_0x535382=_0x535382||0xcc;return function(_0x2d5738){if(_0x2d5738){return _0x5753ea[_0xd5dc('0x1e')](_0x535382);}return _0x5753ea[_0xd5dc('0x1f')](_0x535382)[_0xd5dc('0x20')]();};}function respondWithResult(_0xc389bd,_0x90a868){_0x90a868=_0x90a868||0xc8;return function(_0x28b132){if(_0x28b132){return _0xc389bd[_0xd5dc('0x1f')](_0x90a868)[_0xd5dc('0x21')](_0x28b132);}};}function respondWithFilteredResult(_0x524c5f,_0x5be769){return function(_0x2591e4){if(_0x2591e4){var _0x31794a=_0x2591e4['count'],_0x337f1c=_0x5be769[_0xd5dc('0x22')],_0x35f11a=_0x5be769[_0xd5dc('0x22')]+_0x5be769[_0xd5dc('0x23')],_0x5b8030;if(_0x35f11a>=_0x31794a){_0x35f11a=_0x31794a;_0x5b8030=0xc8;}else{_0x5b8030=0xce;}_0x524c5f[_0xd5dc('0x1f')](_0x5b8030);return _0x524c5f['set']('Content-Range',_0x337f1c+'-'+_0x35f11a+'/'+_0x31794a)[_0xd5dc('0x21')](_0x2591e4);}return null;};}function patchUpdates(_0x453a62){return function(_0x194316){try{jsonpatch[_0xd5dc('0x24')](_0x194316,_0x453a62,!![]);}catch(_0x3b184a){return BPromise[_0xd5dc('0x25')](_0x3b184a);}return _0x194316['save']();};}function saveUpdates(_0x5b0286,_0x482167){return function(_0x5d2579){if(_0x5d2579){return _0x5d2579[_0xd5dc('0x26')](_0x5b0286)[_0xd5dc('0x27')](function(_0x540893){return _0x540893;});}return null;};}function removeEntity(_0x5af22b,_0x40d1b4){return function(_0x30f1fa){if(_0x30f1fa){return _0x30f1fa['destroy']()[_0xd5dc('0x27')](function(){_0x5af22b[_0xd5dc('0x1f')](0xcc)[_0xd5dc('0x20')]();});}};}function handleEntityNotFound(_0x31e578,_0x5126fe){return function(_0xbf8627){if(!_0xbf8627){_0x31e578[_0xd5dc('0x1e')](0x194);}return _0xbf8627;};}function handleError(_0x4d9e42,_0x526e43){_0x526e43=_0x526e43||0x1f4;return function(_0x175fd1){logger['error'](_0x175fd1['stack']);if(_0x175fd1[_0xd5dc('0x28')]){delete _0x175fd1[_0xd5dc('0x28')];}_0x4d9e42[_0xd5dc('0x1f')](_0x526e43)['send'](_0x175fd1);};}exports[_0xd5dc('0x29')]=function(_0x4d31fe,_0x4bb830){var _0x15a18c={},_0x3b84b2={},_0x28aa81={'count':0x0,'rows':[]};var _0x249e91=_[_0xd5dc('0x2a')](db['UserProfile'][_0xd5dc('0x2b')],function(_0x524b81){return{'name':_0x524b81[_0xd5dc('0x2c')],'type':_0x524b81[_0xd5dc('0x2d')]['key']};});_0x3b84b2['model']=_[_0xd5dc('0x2a')](_0x249e91,'name');_0x3b84b2[_0xd5dc('0x2e')]=_[_0xd5dc('0x2f')](_0x4d31fe['query']);_0x3b84b2['filters']=_[_0xd5dc('0x30')](_0x3b84b2['model'],_0x3b84b2[_0xd5dc('0x2e')]);_0x15a18c[_0xd5dc('0x31')]=_['intersection'](_0x3b84b2[_0xd5dc('0x32')],qs['fields'](_0x4d31fe[_0xd5dc('0x2e')][_0xd5dc('0x33')]));_0x15a18c['attributes']=_0x15a18c[_0xd5dc('0x31')][_0xd5dc('0x34')]?_0x15a18c['attributes']:_0x3b84b2[_0xd5dc('0x32')];if(!_0x4d31fe[_0xd5dc('0x2e')]['hasOwnProperty'](_0xd5dc('0x35'))){_0x15a18c[_0xd5dc('0x23')]=qs[_0xd5dc('0x23')](_0x4d31fe[_0xd5dc('0x2e')][_0xd5dc('0x23')]);_0x15a18c[_0xd5dc('0x22')]=qs[_0xd5dc('0x22')](_0x4d31fe[_0xd5dc('0x2e')][_0xd5dc('0x22')]);}_0x15a18c[_0xd5dc('0x36')]=qs[_0xd5dc('0x37')](_0x4d31fe[_0xd5dc('0x2e')]['sort']);_0x15a18c['where']=qs['filters'](_[_0xd5dc('0x38')](_0x4d31fe[_0xd5dc('0x2e')],_0x3b84b2['filters']),_0x249e91);if(_0x4d31fe['query']['filter']){_0x15a18c[_0xd5dc('0x39')]=_[_0xd5dc('0x3a')](_0x15a18c['where'],{'$or':_[_0xd5dc('0x2a')](_0x249e91,function(_0x10b8f3){if(_0x10b8f3['type']!==_0xd5dc('0x3b')){var _0x1a6598={};_0x1a6598[_0x10b8f3[_0xd5dc('0x28')]]={'$like':'%'+_0x4d31fe[_0xd5dc('0x2e')][_0xd5dc('0x3c')]+'%'};return _0x1a6598;}})});}_0x15a18c=_[_0xd5dc('0x3a')]({},_0x15a18c,_0x4d31fe[_0xd5dc('0x3d')]);var _0x2566a7={'where':_0x15a18c[_0xd5dc('0x39')]};return db['UserProfile'][_0xd5dc('0x3e')](_0x2566a7)['then'](function(_0x5c18c5){_0x28aa81[_0xd5dc('0x3e')]=_0x5c18c5;if(_0x4d31fe[_0xd5dc('0x2e')][_0xd5dc('0x3f')]){_0x15a18c['include']=[{'all':!![]}];}return db[_0xd5dc('0x40')]['findAll'](_0x15a18c);})[_0xd5dc('0x27')](function(_0x343312){_0x28aa81[_0xd5dc('0x41')]=_0x343312;return _0x28aa81;})[_0xd5dc('0x27')](respondWithFilteredResult(_0x4bb830,_0x15a18c))[_0xd5dc('0x42')](handleError(_0x4bb830,null));};exports[_0xd5dc('0x43')]=function(_0x4475ff,_0x2126d7){var _0x5cbc43={'raw':![],'where':{'id':_0x4475ff[_0xd5dc('0x44')]['id']}},_0x3abb50={};_0x3abb50[_0xd5dc('0x32')]=_[_0xd5dc('0x2f')](db[_0xd5dc('0x40')][_0xd5dc('0x2b')]);_0x3abb50[_0xd5dc('0x2e')]=_[_0xd5dc('0x2f')](_0x4475ff['query']);_0x3abb50['filters']=_['intersection'](_0x3abb50[_0xd5dc('0x32')],_0x3abb50[_0xd5dc('0x2e')]);_0x5cbc43[_0xd5dc('0x31')]=_['intersection'](_0x3abb50[_0xd5dc('0x32')],qs[_0xd5dc('0x33')](_0x4475ff['query'][_0xd5dc('0x33')]));_0x5cbc43[_0xd5dc('0x31')]=_0x5cbc43[_0xd5dc('0x31')][_0xd5dc('0x34')]?_0x5cbc43[_0xd5dc('0x31')]:_0x3abb50[_0xd5dc('0x32')];if(_0x4475ff[_0xd5dc('0x2e')][_0xd5dc('0x3f')]){_0x5cbc43[_0xd5dc('0x45')]=[{'all':!![]}];}_0x5cbc43=_[_0xd5dc('0x3a')]({},_0x5cbc43,_0x4475ff[_0xd5dc('0x3d')]);return db[_0xd5dc('0x40')][_0xd5dc('0x46')](_0x5cbc43)[_0xd5dc('0x27')](handleEntityNotFound(_0x2126d7,null))[_0xd5dc('0x27')](respondWithResult(_0x2126d7,null))['catch'](handleError(_0x2126d7,null));};exports[_0xd5dc('0x47')]=function(_0x4ab5c7,_0x177f26){return db[_0xd5dc('0x40')]['create'](_0x4ab5c7[_0xd5dc('0x48')],{})[_0xd5dc('0x27')](respondWithResult(_0x177f26,0xc9))[_0xd5dc('0x42')](handleError(_0x177f26,null));};exports[_0xd5dc('0x49')]=function(_0x2e7c62,_0x5040b1){var _0x25dca2={'where':{'id':_0x2e7c62['params']['id']}},_0x52e857={};_0x52e857[_0xd5dc('0x32')]=_[_0xd5dc('0x2f')](db[_0xd5dc('0x40')][_0xd5dc('0x2b')]);_0x25dca2[_0xd5dc('0x31')]=_[_0xd5dc('0x30')](_0x52e857[_0xd5dc('0x32')],qs['fields'](_0x2e7c62['query'][_0xd5dc('0x33')]));_0x25dca2[_0xd5dc('0x31')]=_0x25dca2[_0xd5dc('0x31')][_0xd5dc('0x34')]?_0x25dca2[_0xd5dc('0x31')]:_0x52e857[_0xd5dc('0x32')];if(_0x2e7c62[_0xd5dc('0x2e')]['includeAll']){_0x25dca2[_0xd5dc('0x45')]=[{'all':!![]}];}_0x25dca2=_[_0xd5dc('0x3a')]({},_0x25dca2,_0x2e7c62['options']);return db[_0xd5dc('0x40')][_0xd5dc('0x46')](_0x25dca2)[_0xd5dc('0x27')](handleEntityNotFound(_0x5040b1,null))['then'](function(_0x561a5b){if(_0x561a5b){var _0x525037=_0x561a5b[_0xd5dc('0x4a')]({'plain':!![]});_0x525037=qs['omit'](_0x525037,['id','createdAt','updatedAt',_0xd5dc('0x4b')]);_0x2e7c62[_0xd5dc('0x48')]=_[_0xd5dc('0x4c')](_0x2e7c62['body'],['id','createdAt',_0xd5dc('0x4d')]);return db[_0xd5dc('0x4e')][_0xd5dc('0x4f')](function(_0x1758d7){return db[_0xd5dc('0x40')][_0xd5dc('0x47')](_['merge'](_0x525037,_0x2e7c62[_0xd5dc('0x48')]),{'include':_0x2e7c62[_0xd5dc('0x2e')][_0xd5dc('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x1758d7})[_0xd5dc('0x27')](function(_0x5bc743){var _0x295e72=_0x5bc743[_0xd5dc('0x4a')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2e7c62['params']['id']},'raw':!![]})[_0xd5dc('0x27')](function(_0x4ea289){if(_0x4ea289){return BPromise[_0xd5dc('0x50')](_0x4ea289,function(_0x54d3a9){return new BPromise(function(_0x273338,_0x3e5264){if(_0x54d3a9['autoAssociation']===null||_0x54d3a9[_0xd5dc('0x51')]===0x1)_0x273338(null);return db[_0xd5dc('0x52')]['findAll']({'where':{'sectionId':_0x54d3a9['id']},'raw':!![]})[_0xd5dc('0x27')](function(_0xdfdb89){var _0x1a7b46=_[_0xd5dc('0x2a')](_0xdfdb89,function(_0x59b504){return qs[_0xd5dc('0x4c')](_0x59b504,['id',_0xd5dc('0x53'),'updatedAt',_0xd5dc('0x54')]);});_0x273338(_0x1a7b46);})[_0xd5dc('0x42')](function(_0x2f6710){_0x3e5264(_0x2f6710);});})[_0xd5dc('0x27')](function(_0x4ec8e1){var _0x4c0f4e=qs[_0xd5dc('0x4c')](_0x54d3a9,['id',_0xd5dc('0x53'),'updatedAt']);_0x4c0f4e[_0xd5dc('0x55')]=_0x295e72['id'];if(_0x4ec8e1)_0x4c0f4e[_0xd5dc('0x56')]=_0x4ec8e1;return _0x4c0f4e;})[_0xd5dc('0x27')](function(_0x566e17){return db[_0xd5dc('0x57')][_0xd5dc('0x47')](_0x566e17,{'include':[{'model':db['UserProfileResource'],'as':_0xd5dc('0x56')}],'raw':!![],'transaction':_0x1758d7});});})[_0xd5dc('0x27')](function(){return _0x295e72;});}});});});}})['then'](respondWithResult(_0x5040b1,0xc9))[_0xd5dc('0x42')](handleError(_0x5040b1,null));};exports[_0xd5dc('0x26')]=function(_0x397c86,_0x5a3385){if(_0x397c86[_0xd5dc('0x48')]['id']){delete _0x397c86['body']['id'];}return db[_0xd5dc('0x40')][_0xd5dc('0x46')]({'where':{'id':_0x397c86['params']['id']}})[_0xd5dc('0x27')](handleEntityNotFound(_0x5a3385,null))['then'](saveUpdates(_0x397c86['body'],null))[_0xd5dc('0x27')](respondWithResult(_0x5a3385,null))[_0xd5dc('0x42')](handleError(_0x5a3385,null));};exports[_0xd5dc('0x58')]=function(_0xe55c6f,_0x36ded4){return db['UserProfile'][_0xd5dc('0x46')]({'where':{'id':_0xe55c6f[_0xd5dc('0x44')]['id']}})[_0xd5dc('0x27')](handleEntityNotFound(_0x36ded4,null))['then'](removeEntity(_0x36ded4,null))[_0xd5dc('0x42')](handleError(_0x36ded4,null));};exports[_0xd5dc('0x59')]=function(_0x60d82c,_0x1be419){return db[_0xd5dc('0x40')][_0xd5dc('0x59')]()[_0xd5dc('0x27')](respondWithResult(_0x1be419,null))[_0xd5dc('0x42')](handleError(_0x1be419,null));};exports[_0xd5dc('0x5a')]=function(_0x12f067,_0x26a803){var _0x514fb3=_0x12f067['body'];return db['UserProfile'][_0xd5dc('0x46')]({'where':{'id':_0x12f067['params']['id']}})['then'](handleEntityNotFound(_0x26a803,null))[_0xd5dc('0x27')](function(_0x477e2c){if(_0x477e2c){return db[_0xd5dc('0x4e')][_0xd5dc('0x4f')](function(_0x5b592e){return db[_0xd5dc('0x57')][_0xd5dc('0x58')]({'where':{'userProfileId':_0x12f067['params']['id'],'sectionId':_[_0xd5dc('0x2a')](_0x514fb3,function(_0x393f58){return _0x393f58[_0xd5dc('0x54')];})},'transaction':_0x5b592e})['then'](function(){var _0x5f3338=_[_0xd5dc('0x2a')](_0x514fb3,function(_0x532aa5){_0x532aa5['userProfileId']=_0x12f067[_0xd5dc('0x44')]['id'];return _0x532aa5;});var _0xff7ba1=[];return BPromise['each'](_0x5f3338,function(_0x54f6de){return db[_0xd5dc('0x57')]['create'](_0x54f6de,{'include':[{'model':db[_0xd5dc('0x52')],'as':'Resources'}],'raw':!![],'transaction':_0x5b592e})[_0xd5dc('0x27')](function(_0x1605e7){_0xff7ba1['push'](_0x1605e7[_0xd5dc('0x4a')]({'plain':!![]}));});})[_0xd5dc('0x27')](function(){return _0xff7ba1;});});});}})[_0xd5dc('0x27')](function(_0xd4f31a){return _0xd4f31a;})[_0xd5dc('0x27')](respondWithResult(_0x26a803,null))[_0xd5dc('0x42')](handleError(_0x26a803,null));};exports['removeSections']=function(_0x5d5b24,_0x35a0b4){var _0x669543;return db[_0xd5dc('0x40')][_0xd5dc('0x46')]({'where':{'id':_0x5d5b24[_0xd5dc('0x44')]['id']},'attributes':['id',_0xd5dc('0x28')]})[_0xd5dc('0x27')](handleEntityNotFound(_0x35a0b4,null))[_0xd5dc('0x27')](function(_0x1e51a0){if(_0x1e51a0){_0x669543=_0x1e51a0;return db[_0xd5dc('0x57')][_0xd5dc('0x58')]({'where':{'userProfileId':_0x5d5b24[_0xd5dc('0x44')]['id'],'sectionId':_0x5d5b24['query'][_0xd5dc('0x5b')]}});}})['then'](function(){return _0x669543;})[_0xd5dc('0x27')](respondWithStatusCode(_0x35a0b4,null))['catch'](handleError(_0x35a0b4,null));};exports['getSections']=function(_0x3042e5,_0x5ac43a){var _0x103dac=[];var _0x570e00=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3042e5[_0xd5dc('0x44')]['id']},'raw':!![]})[_0xd5dc('0x27')](function(_0x5de9a3){_0x103dac=_[_0xd5dc('0x3c')](_0x5de9a3,function(_0x31e621){return _0x31e621[_0xd5dc('0x5c')]===0x1||_[_0xd5dc('0x5d')]([0x3eb,0x709],_0x31e621[_0xd5dc('0x54')]);});if(!_[_0xd5dc('0x5e')](_0x103dac)){return _[_0xd5dc('0x2a')](_0x103dac,function(_0x5a4907){return _0x5a4907[_0xd5dc('0x54')];});}else{return;}})[_0xd5dc('0x27')](function(_0x1eec08){if(_0x1eec08)_0x570e00=_0x1eec08;if(_[_0xd5dc('0x5d')](_0x570e00,0x64)){var _0x3fb1ed=_[_0xd5dc('0x46')](_0x103dac,{'sectionId':0x64});return hasDefaultDashboard(_0x3fb1ed)[_0xd5dc('0x27')](function(_0x491a0c){return _[_0xd5dc('0x2a')](_0x103dac,function(_0x403ea7){if(_0x403ea7[_0xd5dc('0x54')]===0x64){_0x403ea7[_0xd5dc('0x5f')]=_0x491a0c;}return _0x403ea7;});});}else{return;}})[_0xd5dc('0x27')](function(_0x318275){if(_0x318275)_0x103dac=_0x318275;if(_[_0xd5dc('0x5d')](_0x570e00,0x3eb)){var _0x381c65=_[_0xd5dc('0x46')](_0x103dac,{'sectionId':0x3eb});return getCustomDashboards(_0x381c65)[_0xd5dc('0x27')](function(_0x294114){return _[_0xd5dc('0x2a')](_0x103dac,function(_0x1f6a1b){if(_0x381c65[_0xd5dc('0x5c')]){if(_0x1f6a1b[_0xd5dc('0x54')]===0x3eb){_0x1f6a1b[_0xd5dc('0x5f')]=_0x294114;}}else{if(_0x1f6a1b[_0xd5dc('0x54')]===0x64){_0x1f6a1b[_0xd5dc('0x5f')]=_0x294114;}}return _0x1f6a1b;});});}else{return;}})[_0xd5dc('0x27')](function(_0x7e9472){if(_0x7e9472)_0x103dac=_0x7e9472;if(_[_0xd5dc('0x5d')](_0x570e00,0x709)){var _0x332e19=_[_0xd5dc('0x46')](_0x103dac,{'sectionId':0x709});return getPlugins(_0x332e19)[_0xd5dc('0x27')](function(_0x2dc539){if(_0x332e19[_0xd5dc('0x5c')]){return _[_0xd5dc('0x2a')](_0x103dac,function(_0x5c348d){if(_0x5c348d['sectionId']===0x709){_0x5c348d[_0xd5dc('0x5f')]=_0x2dc539;}return _0x5c348d;});}else{var _0x4c245d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2dc539};var _0x14fa8e=_[_0xd5dc('0x2a')](_0x103dac);_0x14fa8e[_0xd5dc('0x60')](_0x4c245d);return _0x14fa8e;}});}else{return;}})[_0xd5dc('0x27')](function(_0x495905){if(_0x495905)_0x103dac=_0x495905;return _[_0xd5dc('0x3c')](_0x103dac,[_0xd5dc('0x5c'),0x1]);})['then'](respondWithResult(_0x5ac43a,null))['catch'](handleError(_0x5ac43a,null));};function hasDefaultDashboard(_0x5af7a5){var _0xc42e4c=[0x65];return new BPromise(function(_0x3e9416,_0x424ee4){try{if(_0x5af7a5[_0xd5dc('0x51')]){_0x3e9416(_0xc42e4c);}else{return db[_0xd5dc('0x52')][_0xd5dc('0x61')]({'where':{'sectionId':_0x5af7a5['id']},'raw':!![]})[_0xd5dc('0x27')](function(_0x4c764d){_0x4c764d?_0x3e9416(_0xc42e4c):_0x3e9416();});}}catch(_0xc9dc76){_0x424ee4(_0xc9dc76);}});}function getCustomDashboards(_0x367313){var _0xf06ab5=[];return new BPromise(function(_0x5ce43b,_0x55c164){try{if(_0x367313[_0xd5dc('0x51')]){return db[_0xd5dc('0x62')][_0xd5dc('0x63')]({'raw':!![]})[_0xd5dc('0x27')](function(_0x3ff40b){_0x3ff40b[_0xd5dc('0x64')](function(_0x5904a8){_0xf06ab5['push'](_0x5904a8['id']+0x1869f);});_0x5ce43b(_0xf06ab5);});}else{return db[_0xd5dc('0x52')][_0xd5dc('0x63')]({'where':{'sectionId':_0x367313['id']},'raw':!![]})['then'](function(_0x140283){_0x140283[_0xd5dc('0x64')](function(_0x4ed730){_0xf06ab5['push'](_0x4ed730[_0xd5dc('0x65')]+0x1869f);});_0x5ce43b(_0xf06ab5);});}}catch(_0x6de700){_0x55c164(_0x6de700);}});}function getPlugins(_0x20d480){var _0x5d0001=[];return new BPromise(function(_0x310424,_0x1461c8){try{if(_0x20d480['autoAssociation']){return db['Plugin'][_0xd5dc('0x63')]({'raw':!![]})[_0xd5dc('0x27')](function(_0x24d0f6){_0x24d0f6[_0xd5dc('0x64')](function(_0x396dd3){_0x5d0001[_0xd5dc('0x60')](_0x396dd3['id']+0x15b38);});_0x310424(_0x5d0001);});}else{return db[_0xd5dc('0x52')]['findAll']({'where':{'sectionId':_0x20d480['id']},'raw':!![]})[_0xd5dc('0x27')](function(_0x580ead){_0x580ead['forEach'](function(_0x471bd7){_0x5d0001[_0xd5dc('0x60')](_0x471bd7['resourceId']+0x15b38);});_0x310424(_0x5d0001);});}}catch(_0x2fd15b){_0x1461c8(_0x2fd15b);}});}exports[_0xd5dc('0x66')]=function(_0x11dae8,_0xaa10d8){return db[_0xd5dc('0x40')][_0xd5dc('0x46')]({'where':{'id':_0x11dae8[_0xd5dc('0x44')]['id']}})[_0xd5dc('0x27')](handleEntityNotFound(_0xaa10d8,null))[_0xd5dc('0x27')](function(_0x56d489){if(_0x56d489){return db[_0xd5dc('0x4e')][_0xd5dc('0x4f')](function(_0x511907){return db[_0xd5dc('0x57')]['findAll']({'where':{'userProfileId':_0x11dae8[_0xd5dc('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0xd5dc('0x27')](function(_0x587c5a){if(_0x587c5a){return db[_0xd5dc('0x57')][_0xd5dc('0x58')]({'where':{'userProfileId':_0x11dae8[_0xd5dc('0x44')]['id'],'id':_[_0xd5dc('0x2a')](_0x587c5a,function(_0x597126){return _0x597126['id'];})},'transaction':_0x511907});}})[_0xd5dc('0x27')](function(_0x21df58){var _0x29e5d4=_[_0xd5dc('0x2a')](_0x11dae8[_0xd5dc('0x48')],function(_0x3de87e){_0x3de87e[_0xd5dc('0x55')]=_0x11dae8[_0xd5dc('0x44')]['id'];return _0x3de87e;});return db[_0xd5dc('0x57')][_0xd5dc('0x67')](_0x29e5d4,{'raw':!![],'transaction':_0x511907});})[_0xd5dc('0x27')](function(_0x50e21d){var _0x11c8a5=_[_0xd5dc('0x3c')](_[_0xd5dc('0x2a')](_0x50e21d,function(_0x2e654f){return _0x2e654f[_0xd5dc('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x11c8a5){return db['UserProfileSection'][_0xd5dc('0x63')]({'where':{'userProfileId':_0x11dae8[_0xd5dc('0x44')]['id'],'sectionId':_[_0xd5dc('0x2a')](_0x11c8a5,function(_0x5c4aaf){return _0x5c4aaf[_0xd5dc('0x54')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x1ad04e){var _0x15de9f=_[_0xd5dc('0x2a')](_0x11dae8[_0xd5dc('0x48')],function(_0x3243eb){_0x3243eb['userProfileId']=_0x11dae8[_0xd5dc('0x44')]['id'];return _0x3243eb;});return db[_0xd5dc('0x52')]['bulkCreate'](_0x15de9f,{'raw':!![],'transaction':_0x511907});});}})[_0xd5dc('0x42')](handleError(_0xaa10d8,null));});}})[_0xd5dc('0x27')](function(_0x47e9d6){var _0x91ff27=_[_0xd5dc('0x2a')](_0x47e9d6,function(_0x2ccea5){return _0x2ccea5[_0xd5dc('0x4a')]({'plain':!![]});});})['then'](respondWithResult(_0xaa10d8,null))[_0xd5dc('0x42')](handleError(_0xaa10d8,null));};exports[_0xd5dc('0x68')]=function(_0x158648,_0x456b25,_0x3ecc22){return db['UserProfile'][_0xd5dc('0x46')]({'where':{'id':_0x158648[_0xd5dc('0x44')]['id']}})['then'](handleEntityNotFound(_0x456b25,null))['then'](function(_0x3f7064){if(_0x3f7064){return _0x3f7064[_0xd5dc('0x68')](_0x158648[_0xd5dc('0x2e')]['ids']);}})[_0xd5dc('0x27')](respondWithStatusCode(_0x456b25,null))['catch'](handleError(_0x456b25,null));};exports['getResources']=function(_0x496cf5,_0x3491f7){var _0x420bb3={'raw':![],'where':{}};var _0x20b33e={};var _0x29e3dc={'count':0x0,'rows':[]};var _0x27243a=_0x496cf5[_0xd5dc('0x2e')][_0xd5dc('0x69')];if(typeof _0x27243a===_0xd5dc('0x6a')){throw new db[(_0xd5dc('0x6b'))][(_0xd5dc('0x6c'))]('Unknown\x20section');}var _0x1e1769=_0x496cf5['query'][_0xd5dc('0x6d')]||![];var _0x5916a3=getQueryModels(_0x27243a,_0x1e1769);if(typeof _0x5916a3['childModel']===_0xd5dc('0x6a')){throw new db[(_0xd5dc('0x6b'))]['ValidationError'](_0xd5dc('0x6e')+_0x27243a+'\x27');}var _0x28d96a=[];if(!_[_0xd5dc('0x5e')](_0x5916a3[_0xd5dc('0x6f')])){_0x28d96a=_0x5916a3[_0xd5dc('0x6f')];}else{_0x28d96a=[{'name':_0x27243a}];}return db['UserProfile']['findOne']({'where':{'id':_0x496cf5['params']['id']}})['then'](handleEntityNotFound(_0x3491f7,null))[_0xd5dc('0x27')](function(_0x327cc9){if(_0x327cc9){var _0xcb73a3=[];for(var _0x560d38=0x0;_0x560d38<_0x28d96a[_0xd5dc('0x34')];_0x560d38++){_0xcb73a3['push'](db[_0xd5dc('0x57')]['findOne']({'where':{'userProfileId':_0x327cc9['id'],'name':_0x28d96a[_0x560d38][_0xd5dc('0x28')]},'raw':!![]}));}return BPromise[_0xd5dc('0x70')](_0xcb73a3);}})[_0xd5dc('0x27')](function(_0x511221){var _0x179508=_[_0xd5dc('0x3c')](_0x511221,function(_0xeec2ce){return _0xeec2ce?_0xeec2ce:undefined;});var _0xabd355=_[_0xd5dc('0x3c')](_0x28d96a,['ignore',!![]]);var _0x33d1a8=_['isEmpty'](_0x179508)&&_[_0xd5dc('0x5e')](_0xabd355)?null:_['union'](_0xabd355,_0x179508);if(_0x33d1a8){var _0x2f9f7e=[];for(var _0x23d631=0x0;_0x23d631<_0x33d1a8[_0xd5dc('0x34')];_0x23d631++){var _0x2f53a4=_[_0xd5dc('0x46')](_0x28d96a,function(_0x370132){return _0x33d1a8[_0x23d631]?_0x370132[_0xd5dc('0x28')]===_0x33d1a8[_0x23d631]['name']:null;});if(_0x2f53a4){if(_0x33d1a8[_0x23d631][_0xd5dc('0x71')]){_0x2f9f7e[_0xd5dc('0x60')](getAllResources(_0x5916a3['childModel'],_0x33d1a8[_0x23d631]));}else{if(!_0x33d1a8[_0x23d631][_0xd5dc('0x51')]){_0x2f9f7e[_0xd5dc('0x60')](getAllowedResources(_0x2f53a4,_0x33d1a8[_0x23d631],_0x5916a3[_0xd5dc('0x72')]));}else{if(_0x2f53a4['model']){_0x2f9f7e['push'](getAllFilteredResources(_0x2f53a4,_0x33d1a8[_0x23d631]));}}}}}return BPromise[_0xd5dc('0x70')](_0x2f9f7e);}else{return null;}})[_0xd5dc('0x27')](function(_0x39a10d){var _0xcad7e9=_0x39a10d;var _0x43ea1e=null;if(_0xcad7e9){_0x43ea1e=_0xcad7e9['length']===0x1?_0xcad7e9[0x0]:null;}if(_0x43ea1e||_0xcad7e9){var _0xd65b8e=db[_0x5916a3[_0xd5dc('0x72')]][_0xd5dc('0x2b')];_0x20b33e[_0xd5dc('0x32')]=_['keys'](_0xd65b8e);_0x20b33e[_0xd5dc('0x2e')]=_[_0xd5dc('0x2f')](_0x496cf5[_0xd5dc('0x2e')]);_0x20b33e['filters']=_[_0xd5dc('0x30')](_0x20b33e[_0xd5dc('0x32')],_0x20b33e[_0xd5dc('0x2e')]);_0x420bb3['attributes']=_[_0xd5dc('0x30')](_0x20b33e[_0xd5dc('0x32')],qs[_0xd5dc('0x33')](_0x496cf5[_0xd5dc('0x2e')]['fields']));_0x420bb3[_0xd5dc('0x31')]=_0x420bb3[_0xd5dc('0x31')][_0xd5dc('0x34')]?_0x420bb3[_0xd5dc('0x31')]:_0x20b33e[_0xd5dc('0x32')];if(!_0x496cf5[_0xd5dc('0x2e')]['hasOwnProperty'](_0xd5dc('0x35'))){_0x420bb3[_0xd5dc('0x23')]=qs[_0xd5dc('0x23')](_0x496cf5[_0xd5dc('0x2e')][_0xd5dc('0x23')]);_0x420bb3['offset']=qs[_0xd5dc('0x22')](_0x496cf5[_0xd5dc('0x2e')][_0xd5dc('0x22')]);}_0x420bb3[_0xd5dc('0x36')]=qs[_0xd5dc('0x37')](_0x496cf5['query']['sort']);_0x420bb3[_0xd5dc('0x39')]=qs[_0xd5dc('0x73')](_[_0xd5dc('0x38')](_0x496cf5['query'],_0x20b33e[_0xd5dc('0x73')]));if(_0x496cf5[_0xd5dc('0x2e')]['filter']){_0x420bb3[_0xd5dc('0x39')]=_[_0xd5dc('0x3a')](_0x420bb3['where'],{'$or':_['map'](_0xd65b8e,function(_0xa8e011){if(_0xa8e011[_0xd5dc('0x2d')][_0xd5dc('0x74')]!==_0xd5dc('0x3b')){var _0xabdacf={};_0xabdacf[_0xa8e011[_0xd5dc('0x75')]]={'$like':'%'+_0x496cf5[_0xd5dc('0x2e')]['filter']+'%'};return _0xabdacf;}})});}var _0x3134b9=[];if(_0x43ea1e){var _0x9f1952=_[_0xd5dc('0x46')](_0x28d96a,[_0xd5dc('0x28'),_0x43ea1e[_0xd5dc('0x28')]]);if(_0x9f1952['field']){var _0x4a2754={};if(_0x5916a3[_0xd5dc('0x72')]==='AnalyticExtractedReport'){_0x4a2754[_0x9f1952[_0xd5dc('0x76')]]=_['map'](_0x43ea1e[_0xd5dc('0x77')],'id');}else{_0x4a2754[_0x9f1952[_0xd5dc('0x76')]]=_0x43ea1e['associatedResources'];}_0x3134b9[_0xd5dc('0x60')](_0x4a2754);}else{_0x420bb3['where']['id']=_0x43ea1e[_0xd5dc('0x77')];}}else{for(var _0xa778b0=0x0;_0xa778b0<_0xcad7e9[_0xd5dc('0x34')];_0xa778b0++){var _0x9f1952=_[_0xd5dc('0x46')](_0x28d96a,['name',_0xcad7e9[_0xa778b0]['name']]);if(_0x9f1952['field']){var _0x4a2754={};_0x4a2754[_0x9f1952['foreignKey']]=_0xcad7e9[_0xa778b0][_0xd5dc('0x77')];_0x3134b9[_0xd5dc('0x60')](_0x4a2754);}else{if(!_0x420bb3[_0xd5dc('0x39')]['id'])_0x420bb3[_0xd5dc('0x39')]['id']=[];_0xcad7e9[_0xa778b0]['associatedResources'][_0xd5dc('0x64')](function(_0x195407){_0x420bb3[_0xd5dc('0x39')]['id'][_0xd5dc('0x60')](_0x195407);});}}}if(!_['isEmpty'](_0x3134b9)){_0x420bb3[_0xd5dc('0x39')]=_[_0xd5dc('0x3a')](_0x420bb3[_0xd5dc('0x39')],{'$and':{'$or':_0x3134b9}});}_0x420bb3=_[_0xd5dc('0x3a')]({},_0x420bb3,_0x496cf5[_0xd5dc('0x3d')]);if(_0x43ea1e&&!_0x43ea1e[_0xd5dc('0x51')]&&_0x5916a3[_0xd5dc('0x72')]===_0xd5dc('0x78')){if(_0x496cf5['query'][_0xd5dc('0x3f')]){_0x420bb3[_0xd5dc('0x45')]=[{'all':!![]}];}return db[_0x5916a3[_0xd5dc('0x72')]][_0xd5dc('0x63')](_0x420bb3)['then'](function(_0x1f84c3){var _0x4ed60a=[];_0x1f84c3[_0xd5dc('0x64')](function(_0x25d5d6){var _0x2dd0c2;switch(_0x25d5d6[_0xd5dc('0x79')]){case _0xd5dc('0x7a'):_0x2dd0c2=_[_0xd5dc('0x46')](_0x43ea1e['associatedResources'],function(_0x35ef5c){return _0x35ef5c['id']===_0x25d5d6[_0xd5dc('0x7b')]&&_0x35ef5c[_0xd5dc('0x2d')]===_0xd5dc('0x7c');});break;case _0xd5dc('0x7d'):_0x2dd0c2=_[_0xd5dc('0x46')](_0x43ea1e['associatedResources'],function(_0x39e8b8){return _0x39e8b8['id']===_0x25d5d6['reportId']&&_0x39e8b8['type']===_0xd5dc('0x7e');});break;}if(_0x2dd0c2)_0x4ed60a[_0xd5dc('0x60')](_0x25d5d6);});_0x29e3dc['count']=_0x4ed60a['length'];_0x29e3dc['rows']=_0x4ed60a;return _0x29e3dc;});}else{return db[_0x5916a3[_0xd5dc('0x72')]][_0xd5dc('0x3e')]({'where':_0x420bb3[_0xd5dc('0x39')]})[_0xd5dc('0x27')](function(_0x257e25){_0x29e3dc[_0xd5dc('0x3e')]=_0x257e25;if(_0x496cf5['query'][_0xd5dc('0x3f')]){if(_0x5916a3[_0xd5dc('0x72')]===_0xd5dc('0x7f')){_0x420bb3[_0xd5dc('0x45')]=[{'model':db[_0xd5dc('0x80')],'as':_0xd5dc('0x81'),'attributes':['id',_0xd5dc('0x28'),_0xd5dc('0x82')],'required':_0x496cf5[_0xd5dc('0x2e')][_0xd5dc('0x83')]?!![]:![]},{'model':db[_0xd5dc('0x80')],'as':_0xd5dc('0x84'),'attributes':['id',_0xd5dc('0x28'),'color'],'through':_0x496cf5[_0xd5dc('0x2e')][_0xd5dc('0x83')]?{'attributes':[],'where':{'TagId':_0x496cf5['query']['tag']||undefined}}:{},'required':_0x496cf5[_0xd5dc('0x2e')][_0xd5dc('0x83')]?!![]:![]}];}else{_0x420bb3[_0xd5dc('0x45')]=[{'all':!![]}];}}return db[_0x5916a3[_0xd5dc('0x72')]][_0xd5dc('0x63')](_0x420bb3);})['then'](function(_0x271bea){_0x29e3dc[_0xd5dc('0x41')]=_0x271bea;return _0x29e3dc;});}}else{return _0x29e3dc;}})[_0xd5dc('0x27')](respondWithFilteredResult(_0x3491f7,_0x420bb3))['catch'](handleError(_0x3491f7,null));};function getAllResources(_0x3b0ed3,_0x1521ad){return new BPromise(function(_0x4baf63,_0x49f8af){if(_0x1521ad){var _0x2a8332=_0x1521ad[_0xd5dc('0x3c')]?{[_0x1521ad['filter']['field']]:_0x1521ad['filter'][_0xd5dc('0x85')]}:undefined;return db[_0x3b0ed3]['findAll']({'where':_0x2a8332,'raw':!![]})[_0xd5dc('0x27')](function(_0x2775b6){_0x1521ad[_0xd5dc('0x77')]=_[_0xd5dc('0x2a')](_0x2775b6,'id');_0x4baf63(_0x1521ad);})[_0xd5dc('0x42')](function(_0x2a91f0){_0x49f8af(_0x2a91f0);});}else{_0x4baf63(null);}});}function getAllFilteredResources(_0x5b012c,_0x4cc10d){return new BPromise(function(_0x5bee86,_0xecfd14){var _0x2e936a=_0x5b012c[_0xd5dc('0x3c')]?{[_0x5b012c[_0xd5dc('0x3c')][_0xd5dc('0x75')]]:_0x5b012c[_0xd5dc('0x3c')][_0xd5dc('0x85')]}:undefined;return db[_0x5b012c[_0xd5dc('0x32')]][_0xd5dc('0x63')]({'where':_0x2e936a,'raw':!![]})[_0xd5dc('0x27')](function(_0x39634b){_0x4cc10d[_0xd5dc('0x77')]=_[_0xd5dc('0x2a')](_0x39634b,function(_0x29729d){return _0x29729d[_0xd5dc('0x28')];});_0x5bee86(_0x4cc10d);})[_0xd5dc('0x42')](function(_0x3eea28){_0xecfd14(_0x3eea28);});});}function getAllowedResources(_0x59865a,_0x21144c,_0x3af5f){return new BPromise(function(_0x12f1db,_0x3ce849){if(_0x21144c){return db['UserProfileResource'][_0xd5dc('0x63')]({'where':{'sectionId':_0x21144c['id']},'raw':!![]})[_0xd5dc('0x27')](function(_0x15e021){if(_0x59865a['field']&&_0x59865a[_0xd5dc('0x75')]!=='id'){_0x21144c[_0xd5dc('0x77')]=_[_0xd5dc('0x2a')](_0x15e021,function(_0x59e765){return _0x59e765[_0x59865a[_0xd5dc('0x75')]];});}else{if(_0x3af5f===_0xd5dc('0x78')){_0x21144c[_0xd5dc('0x77')]=_[_0xd5dc('0x2a')](_0x15e021,function(_0xf751c3){return{'id':_0xf751c3[_0xd5dc('0x65')],'type':_0xf751c3[_0xd5dc('0x2d')]};});}else{_0x21144c[_0xd5dc('0x77')]=_[_0xd5dc('0x2a')](_0x15e021,function(_0x327f12){return _0x327f12[_0xd5dc('0x65')];});}}_0x12f1db(_0x21144c);})[_0xd5dc('0x42')](function(_0x3df7e9){_0x3ce849(_0x3df7e9);});}else{_0x12f1db(null);}});}function getQueryModels(_0x1f011a,_0x5e621b){var _0x3ea499=_0x1f011a[_0xd5dc('0x86')]();var _0x37f60e={'childModel':undefined,'parentSections':[]};switch(_0x3ea499){case _0xd5dc('0x87'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0x88');break;case _0xd5dc('0x89'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0x8a');break;case'squarerecordings':_0x37f60e['childModel']=_0xd5dc('0x8b');_0x37f60e['parentSections']=[{'name':_0xd5dc('0x8c'),'field':_0xd5dc('0x28'),'foreignKey':_0xd5dc('0x8d')}];break;case _0xd5dc('0x8e'):_0x37f60e['childModel']=_0xd5dc('0x8f');break;case _0xd5dc('0x90'):_0x37f60e[_0xd5dc('0x72')]='CmContact';_0x37f60e['parentSections']=[{'name':_0xd5dc('0x91'),'field':'id','foreignKey':_0xd5dc('0x92')}];break;case _0xd5dc('0x93'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0x94');break;case _0xd5dc('0x95'):_0x37f60e[_0xd5dc('0x72')]='CmCompany';break;case _0xd5dc('0x96'):_0x37f60e['childModel']=_0xd5dc('0x97');break;case'chatqueues':_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0x98');break;case _0xd5dc('0x99'):_0x37f60e[_0xd5dc('0x72')]='ChatWebsite';break;case _0xd5dc('0x9a'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0x9b');break;case _0xd5dc('0x9c'):_0x37f60e['childModel']=_0xd5dc('0x9d');break;case _0xd5dc('0x9e'):case _0xd5dc('0x9f'):case'outboundroutes':_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xa0');break;case _0xd5dc('0xa1'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xa2');break;case _0xd5dc('0xa3'):_0x37f60e[_0xd5dc('0x72')]='VoiceMail';break;case _0xd5dc('0xa4'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xa5');_0x37f60e['parentSections']=[{'name':_0xd5dc('0xa6'),'field':_0xd5dc('0x28'),'foreignKey':_0xd5dc('0xa7'),'model':'User','filter':{'field':_0xd5dc('0xa8'),'value':[_0xd5dc('0xa9')]}},{'name':_0xd5dc('0xaa'),'field':_0xd5dc('0x28'),'foreignKey':_0xd5dc('0xa7'),'model':_0xd5dc('0xab'),'filter':{'field':_0xd5dc('0xa8'),'value':[_0xd5dc('0xac')]}},{'name':_0xd5dc('0xad'),'field':'name','foreignKey':'queue','model':_0xd5dc('0xae'),'filter':{'field':_0xd5dc('0x2d'),'value':[_0xd5dc('0xaf')]}},{'name':_0xd5dc('0xb0'),'field':_0xd5dc('0x28'),'foreignKey':_0xd5dc('0xb1'),'model':_0xd5dc('0xae'),'filter':{'field':'type','value':[_0xd5dc('0xb2')]}}];break;case _0xd5dc('0xb3'):_0x37f60e[_0xd5dc('0x72')]='VoiceMusicOnHold';break;case _0xd5dc('0xb4'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xb5');break;case _0xd5dc('0xb6'):_0x37f60e[_0xd5dc('0x72')]='VoicePrefix';break;case _0xd5dc('0xb7'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xb8');break;case'mailqueues':_0x37f60e[_0xd5dc('0x72')]='MailQueue';break;case _0xd5dc('0xb9'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xba');break;case'mailsubstatuses':_0x37f60e[_0xd5dc('0x72')]='MailSubstatus';break;case _0xd5dc('0xbb'):_0x37f60e['childModel']=_0xd5dc('0xbc');break;case _0xd5dc('0xbd'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xbe');break;case'smsqueues':_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xbf');break;case _0xd5dc('0xc0'):_0x37f60e[_0xd5dc('0x72')]='SmsAccount';break;case'whatsappqueues':_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xc1');break;case'whatsappaccounts':_0x37f60e['childModel']='WhatsappAccount';break;case _0xd5dc('0xc2'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xc3');break;case'voicequeues':case _0xd5dc('0xc4'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xae');if(_0x5e621b){_0x37f60e['parentSections']=[{'name':_0xd5dc('0xad')},{'name':_0xd5dc('0xb0')}];}break;case'users':case _0xd5dc('0xc5'):case _0xd5dc('0xc6'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xab');if(_0x5e621b){_0x37f60e[_0xd5dc('0x6f')]=[{'name':_0xd5dc('0xc7'),'filter':{'field':_0xd5dc('0xa8'),'value':[_0xd5dc('0xc8'),_0xd5dc('0xc9')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0xd5dc('0xca'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xcb');break;case _0xd5dc('0xcc'):_0x37f60e['childModel']=_0xd5dc('0xcd');break;case _0xd5dc('0xce'):_0x37f60e['childModel']='FreshdeskAccount';break;case _0xd5dc('0xcf'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xd0');break;case _0xd5dc('0xd1'):_0x37f60e['childModel']=_0xd5dc('0xd2');break;case _0xd5dc('0xd3'):_0x37f60e[_0xd5dc('0x72')]='ZohoAccount';break;case _0xd5dc('0xd4'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xab');break;case _0xd5dc('0xd5'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xd6');break;case _0xd5dc('0xd7'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xd8');break;case'customdashboards':_0x37f60e['childModel']=_0xd5dc('0x62');break;case _0xd5dc('0xd9'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xda');break;case'pauses':_0x37f60e['childModel']=_0xd5dc('0xdb');break;case'scheduler':_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xdc');break;case'sounds':_0x37f60e[_0xd5dc('0x72')]='Sound';break;case _0xd5dc('0xdd'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0x80');break;case _0xd5dc('0xde'):_0x37f60e[_0xd5dc('0x72')]='Template';break;case'triggers':_0x37f60e[_0xd5dc('0x72')]='Trigger';break;case _0xd5dc('0xdf'):_0x37f60e[_0xd5dc('0x72')]='Trunk';break;case'variables':_0x37f60e[_0xd5dc('0x72')]='Variable';break;case _0xd5dc('0xe0'):_0x37f60e[_0xd5dc('0x72')]='Plugin';break;case'extractedreports':_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0x78');_0x37f60e['parentSections']=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0xd5dc('0xe1'):_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xe2');break;case'whatsappaccounts':_0x37f60e[_0xd5dc('0x72')]=_0xd5dc('0xe3');break;default:return _0x37f60e;}return _0x37f60e;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index f806338..76238df 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 _0x8642=['exports','events','save','update','remove','emit','hasOwnProperty'];(function(_0x5f5b62,_0x5246f9){var _0x5adce8=function(_0xc9198b){while(--_0xc9198b){_0x5f5b62['push'](_0x5f5b62['shift']());}};_0x5adce8(++_0x5246f9);}(_0x8642,0x1cf));var _0x2864=function(_0x20cc29,_0x30a46d){_0x20cc29=_0x20cc29-0x0;var _0x28d513=_0x8642[_0x20cc29];return _0x28d513;};'use strict';var EventEmitter=require(_0x2864('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2864('0x1'),'afterUpdate':_0x2864('0x2'),'afterDestroy':_0x2864('0x3')};function emitEvent(_0x1d65fd){return function(_0x57c19c,_0x6f23f7,_0x9869de){UserProfileEvents[_0x2864('0x4')](_0x1d65fd+':'+_0x57c19c['id'],_0x57c19c);UserProfileEvents[_0x2864('0x4')](_0x1d65fd,_0x57c19c);_0x9869de(null);};}for(var e in events){if(events[_0x2864('0x5')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x2864('0x6')]=UserProfileEvents; \ No newline at end of file +var _0x9762=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4df3df,_0x3594d7){var _0x50dfe1=function(_0x1f4e53){while(--_0x1f4e53){_0x4df3df['push'](_0x4df3df['shift']());}};_0x50dfe1(++_0x3594d7);}(_0x9762,0x141));var _0x2976=function(_0x20cdf0,_0x5ebdd6){_0x20cdf0=_0x20cdf0-0x0;var _0x3385b6=_0x9762[_0x20cdf0];return _0x3385b6;};'use strict';var EventEmitter=require(_0x2976('0x0'));var UserProfile=require(_0x2976('0x1'))['db'][_0x2976('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2976('0x3')](0x0);var events={'afterCreate':_0x2976('0x4'),'afterUpdate':_0x2976('0x5'),'afterDestroy':_0x2976('0x6')};function emitEvent(_0x2f4b50){return function(_0x155b85,_0x1644a4,_0x25f0a3){UserProfileEvents['emit'](_0x2f4b50+':'+_0x155b85['id'],_0x155b85);UserProfileEvents[_0x2976('0x7')](_0x2f4b50,_0x155b85);_0x25f0a3(null);};}for(var e in events){if(events[_0x2976('0x8')](e)){var event=events[e];UserProfile[_0x2976('0x9')](e,emitEvent(event));}}module[_0x2976('0xa')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 8938bba..7208760 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 _0x3715=['../../config/environment','./userProfile.attributes','exports','define','user_profiles','update','privacyEnabled','then','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x308b18,_0x14d693){var _0x4378b4=function(_0x4f4950){while(--_0x4f4950){_0x308b18['push'](_0x308b18['shift']());}};_0x4378b4(++_0x14d693);}(_0x3715,0xc3));var _0x5371=function(_0x3d57b3,_0x350ae7){_0x3d57b3=_0x3d57b3-0x0;var _0x262944=_0x3715[_0x3d57b3];return _0x262944;};'use strict';var _=require(_0x5371('0x0'));var util=require(_0x5371('0x1'));var logger=require(_0x5371('0x2'))(_0x5371('0x3'));var moment=require(_0x5371('0x4'));var BPromise=require(_0x5371('0x5'));var rp=require(_0x5371('0x6'));var fs=require('fs');var path=require(_0x5371('0x7'));var rimraf=require(_0x5371('0x8'));var config=require(_0x5371('0x9'));var attributes=require(_0x5371('0xa'));module[_0x5371('0xb')]=function(_0x50a759,_0x1ffdcb){return _0x50a759[_0x5371('0xc')]('UserProfile',attributes,{'tableName':_0x5371('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x16c64a,_0x41d142,_0x56debd){var _0xdbc695=_0x50a759['models'];_0xdbc695['User'][_0x5371('0xe')]({'privacyEnabled':_0x16c64a[_0x5371('0xf')]},{'where':{'UserProfileId':_0x16c64a['id']}})[_0x5371('0x10')](function(){_0x56debd();})['catch'](function(_0x2e27a5){_0x56debd(_0x2e27a5);});}}});}; \ No newline at end of file +var _0x7af2=['request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports','define','user_profiles','models','User','privacyEnabled','util','../../config/logger','api','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7af2,0x119));var _0x27af=function(_0xe397b4,_0x37f1c0){_0xe397b4=_0xe397b4-0x0;var _0x384f1e=_0x7af2[_0xe397b4];return _0x384f1e;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var logger=require(_0x27af('0x1'))(_0x27af('0x2'));var moment=require(_0x27af('0x3'));var BPromise=require('bluebird');var rp=require(_0x27af('0x4'));var fs=require('fs');var path=require(_0x27af('0x5'));var rimraf=require(_0x27af('0x6'));var config=require(_0x27af('0x7'));var attributes=require(_0x27af('0x8'));module[_0x27af('0x9')]=function(_0x350532,_0x184630){return _0x350532[_0x27af('0xa')]('UserProfile',attributes,{'tableName':_0x27af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x366868,_0x389e97,_0x583db8){var _0x369a20=_0x350532[_0x27af('0xc')];_0x369a20[_0x27af('0xd')]['update']({'privacyEnabled':_0x366868[_0x27af('0xe')]},{'where':{'UserProfileId':_0x366868['id']}})['then'](function(){_0x583db8();})['catch'](function(_0x3e4b33){_0x583db8(_0x3e4b33);});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index d4b865f..c7f02d6 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 _0x5fd1=['http','redis','defaults','localhost','socket.io-emitter','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1e42c3,_0x1c48b5){var _0x27656c=function(_0x1f809f){while(--_0x1f809f){_0x1e42c3['push'](_0x1e42c3['shift']());}};_0x27656c(++_0x1c48b5);}(_0x5fd1,0x155));var _0x15fd=function(_0x23c2e4,_0x5bfc04){_0x23c2e4=_0x23c2e4-0x0;var _0x2a68c4=_0x5fd1[_0x23c2e4];return _0x2a68c4;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./userProfile.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('UserProfile,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});} \ No newline at end of file +var _0x71ab=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','request\x20sent','stringify','error','message','UserProfile,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x8b5586,_0x3944bb){var _0x1002ed=function(_0x4a5f5c){while(--_0x4a5f5c){_0x8b5586['push'](_0x8b5586['shift']());}};_0x1002ed(++_0x3944bb);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});config[_0xb71a('0xb')]=_[_0xb71a('0xc')](config[_0xb71a('0xb')],{'host':_0xb71a('0xd'),'port':0x18eb});var socket=require(_0xb71a('0xe'))(new Redis(config[_0xb71a('0xb')]));require(_0xb71a('0xf'))[_0xb71a('0x10')](socket);function respondWithRpcPromise(_0x2e8883,_0x517eed,_0xfec897){return new BPromise(function(_0x58956d,_0x3d7bd7){return client[_0xb71a('0x11')](_0x2e8883,_0xfec897)[_0xb71a('0x12')](function(_0x591311){logger[_0xb71a('0x13')]('UserProfile,\x20%s,\x20%s',_0x517eed,_0xb71a('0x14'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x517eed,_0xb71a('0x14'),JSON[_0xb71a('0x15')](_0x591311));if(_0x591311[_0xb71a('0x16')]){if(_0x591311[_0xb71a('0x16')]['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x517eed,_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);return _0x3d7bd7(_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);}logger[_0xb71a('0x16')](_0xb71a('0x18'),_0x517eed,_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);return _0x58956d(_0x591311[_0xb71a('0x16')]['message']);}else{logger[_0xb71a('0x13')](_0xb71a('0x18'),_0x517eed,_0xb71a('0x14'));_0x58956d(_0x591311[_0xb71a('0x19')][_0xb71a('0x17')]);}})[_0xb71a('0x1a')](function(_0x349de1){logger[_0xb71a('0x16')](_0xb71a('0x18'),_0x517eed,_0x349de1);_0x3d7bd7(_0x349de1);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 11cfbc7..d4388d1 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 _0x190d=['emit','register','length','userProfile:','./userProfile.events','save','update'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x190d,0xd6));var _0xd190=function(_0x25142f,_0x4ef8cb){_0x25142f=_0x25142f-0x0;var _0x59ecdb=_0x190d[_0x25142f];return _0x59ecdb;};'use strict';var UserProfileEvents=require(_0xd190('0x0'));var events=[_0xd190('0x1'),'remove',_0xd190('0x2')];function createListener(_0x695be9,_0x2dd046){return function(_0x26b0a7){_0x2dd046[_0xd190('0x3')](_0x695be9,_0x26b0a7);};}function removeListener(_0x20cea9,_0x16493f){return function(){UserProfileEvents['removeListener'](_0x20cea9,_0x16493f);};}exports[_0xd190('0x4')]=function(_0xfd7c94){for(var _0xc6d1c6=0x0,_0x23a078=events[_0xd190('0x5')];_0xc6d1c6<_0x23a078;_0xc6d1c6++){var _0x57f354=events[_0xc6d1c6];var _0x379785=createListener(_0xd190('0x6')+_0x57f354,_0xfd7c94);UserProfileEvents['on'](_0x57f354,_0x379785);}}; \ No newline at end of file +var _0x3399=['remove','emit','removeListener','length','userProfile:','save'];(function(_0x4d8e08,_0x5c4c73){var _0x49a12a=function(_0xe0ba77){while(--_0xe0ba77){_0x4d8e08['push'](_0x4d8e08['shift']());}};_0x49a12a(++_0x5c4c73);}(_0x3399,0xef));var _0x9339=function(_0x132074,_0x1651d8){_0x132074=_0x132074-0x0;var _0xb502b7=_0x3399[_0x132074];return _0xb502b7;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x9339('0x0'),_0x9339('0x1'),'update'];function createListener(_0x494086,_0x332b11){return function(_0x42bc2e){_0x332b11[_0x9339('0x2')](_0x494086,_0x42bc2e);};}function removeListener(_0x3d04da,_0x260766){return function(){UserProfileEvents[_0x9339('0x3')](_0x3d04da,_0x260766);};}exports['register']=function(_0x268170){for(var _0xf4292d=0x0,_0x571c29=events[_0x9339('0x4')];_0xf4292d<_0x571c29;_0xf4292d++){var _0x1f26cd=events[_0xf4292d];var _0x272f5b=createListener(_0x9339('0x5')+_0x1f26cd,_0x268170);UserProfileEvents['on'](_0x1f26cd,_0x272f5b);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index c275b4e..47e3abd 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 _0xa280=['describe','/:id','post','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe'];(function(_0x4abb10,_0x26897f){var _0x2494fe=function(_0x44c085){while(--_0x44c085){_0x4abb10['push'](_0x4abb10['shift']());}};_0x2494fe(++_0x26897f);}(_0xa280,0xc4));var _0x0a28=function(_0x64207e,_0x49f785){_0x64207e=_0x64207e-0x0;var _0x2f0246=_0xa280[_0x64207e];return _0x2f0246;};'use strict';var multer=require(_0x0a28('0x0'));var util=require(_0x0a28('0x1'));var path=require('path');var timeout=require(_0x0a28('0x2'));var express=require(_0x0a28('0x3'));var router=express[_0x0a28('0x4')]();var fs_extra=require(_0x0a28('0x5'));var auth=require(_0x0a28('0x6'));var interaction=require(_0x0a28('0x7'));var config=require(_0x0a28('0x8'));var controller=require(_0x0a28('0x9'));router[_0x0a28('0xa')]('/',auth[_0x0a28('0xb')](),controller[_0x0a28('0xc')]);router[_0x0a28('0xa')](_0x0a28('0xd'),auth[_0x0a28('0xb')](),controller[_0x0a28('0xe')]);router[_0x0a28('0xa')](_0x0a28('0xf'),auth[_0x0a28('0xb')](),controller['show']);router[_0x0a28('0x10')]('/',auth[_0x0a28('0xb')](),controller['create']);router[_0x0a28('0x11')](_0x0a28('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x0a28('0x12')](_0x0a28('0xf'),auth[_0x0a28('0xb')](),controller[_0x0a28('0x13')]);module[_0x0a28('0x14')]=router; \ No newline at end of file +var _0xf6f8=['Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x7c2035,_0x13334){var _0x50f5c1=function(_0x20a9b4){while(--_0x20a9b4){_0x7c2035['push'](_0x7c2035['shift']());}};_0x50f5c1(++_0x13334);}(_0xf6f8,0xf8));var _0x8f6f=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xf6f8[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0x8f6f('0x0'));var util=require(_0x8f6f('0x1'));var path=require(_0x8f6f('0x2'));var timeout=require(_0x8f6f('0x3'));var express=require(_0x8f6f('0x4'));var router=express[_0x8f6f('0x5')]();var fs_extra=require(_0x8f6f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8f6f('0x7'));var config=require(_0x8f6f('0x8'));var controller=require(_0x8f6f('0x9'));router[_0x8f6f('0xa')]('/',auth[_0x8f6f('0xb')](),controller[_0x8f6f('0xc')]);router[_0x8f6f('0xa')](_0x8f6f('0xd'),auth[_0x8f6f('0xb')](),controller[_0x8f6f('0xe')]);router[_0x8f6f('0xa')](_0x8f6f('0xf'),auth[_0x8f6f('0xb')](),controller[_0x8f6f('0x10')]);router[_0x8f6f('0x11')]('/',auth[_0x8f6f('0xb')](),controller['create']);router[_0x8f6f('0x12')](_0x8f6f('0xf'),auth['isAuthenticated'](),controller[_0x8f6f('0x13')]);router[_0x8f6f('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x8f6f('0x15')]);module[_0x8f6f('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 270ef51..e19e3aa 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 _0xc520=['sequelize','exports','INTEGER','STRING'];(function(_0x5969ef,_0x3febea){var _0x1e80b3=function(_0x3b83c0){while(--_0x3b83c0){_0x5969ef['push'](_0x5969ef['shift']());}};_0x1e80b3(++_0x3febea);}(_0xc520,0x158));var _0x0c52=function(_0x2b7d1d,_0x2bd105){_0x2b7d1d=_0x2b7d1d-0x0;var _0x2da9a0=_0xc520[_0x2b7d1d];return _0x2da9a0;};'use strict';var Sequelize=require(_0x0c52('0x0'));module[_0x0c52('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0c52('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0c52('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x874b=['INTEGER','sequelize','STRING'];(function(_0x55a785,_0x254068){var _0x1bfde9=function(_0x322980){while(--_0x322980){_0x55a785['push'](_0x55a785['shift']());}};_0x1bfde9(++_0x254068);}(_0x874b,0xb2));var _0xb874=function(_0xe63ca1,_0x38dbee){_0xe63ca1=_0xe63ca1-0x0;var _0x3a2983=_0x874b[_0xe63ca1];return _0x3a2983;};'use strict';var Sequelize=require(_0xb874('0x0'));module['exports']={'name':{'type':Sequelize[_0xb874('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xb874('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb874('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 6574298..e5880e4 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 _0xe2fe=['where','filters','pick','filter','merge','options','rows','params','rawAttributes','find','create','catch','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','sendStatus','status','offset','set','json','reject','save','then','destroy','end','error','stack','name','send','map','UserProfileResource','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x1138c4,_0x841d33){var _0x200cc1=function(_0x2f6d85){while(--_0x2f6d85){_0x1138c4['push'](_0x1138c4['shift']());}};_0x200cc1(++_0x841d33);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];function respondWithStatusCode(_0x346dbc,_0xa13e7b){_0xa13e7b=_0xa13e7b||0xcc;return function(_0x100449){if(_0x100449){return _0x346dbc[_0xee2f('0x11')](_0xa13e7b);}return _0x346dbc[_0xee2f('0x12')](_0xa13e7b)['end']();};}function respondWithResult(_0x3861e6,_0x531c3a){_0x531c3a=_0x531c3a||0xc8;return function(_0x36db10){if(_0x36db10){return _0x3861e6[_0xee2f('0x12')](_0x531c3a)['json'](_0x36db10);}};}function respondWithFilteredResult(_0x445ba8,_0x145241){return function(_0x28b614){if(_0x28b614){var _0x1bbf7d=_0x28b614['count'],_0x390c2c=_0x145241[_0xee2f('0x13')],_0x58f42a=_0x145241[_0xee2f('0x13')]+_0x145241['limit'],_0x3f6372;if(_0x58f42a>=_0x1bbf7d){_0x58f42a=_0x1bbf7d;_0x3f6372=0xc8;}else{_0x3f6372=0xce;}_0x445ba8['status'](_0x3f6372);return _0x445ba8[_0xee2f('0x14')]('Content-Range',_0x390c2c+'-'+_0x58f42a+'/'+_0x1bbf7d)[_0xee2f('0x15')](_0x28b614);}return null;};}function patchUpdates(_0x3e0b31){return function(_0x28549d){try{jsonpatch['apply'](_0x28549d,_0x3e0b31,!![]);}catch(_0x35e1a4){return BPromise[_0xee2f('0x16')](_0x35e1a4);}return _0x28549d[_0xee2f('0x17')]();};}function saveUpdates(_0x21fdf4,_0x3d892d){return function(_0x5d36d4){if(_0x5d36d4){return _0x5d36d4['update'](_0x21fdf4)[_0xee2f('0x18')](function(_0x3a1852){return _0x3a1852;});}return null;};}function removeEntity(_0x1ea808,_0x203b2f){return function(_0x472e3b){if(_0x472e3b){return _0x472e3b[_0xee2f('0x19')]()[_0xee2f('0x18')](function(){_0x1ea808['status'](0xcc)[_0xee2f('0x1a')]();});}};}function handleEntityNotFound(_0x2c47c5,_0x15ceda){return function(_0x70e308){if(!_0x70e308){_0x2c47c5[_0xee2f('0x11')](0x194);}return _0x70e308;};}function handleError(_0xf77cf5,_0x15a1b1){_0x15a1b1=_0x15a1b1||0x1f4;return function(_0x13013f){logger[_0xee2f('0x1b')](_0x13013f[_0xee2f('0x1c')]);if(_0x13013f[_0xee2f('0x1d')]){delete _0x13013f[_0xee2f('0x1d')];}_0xf77cf5[_0xee2f('0x12')](_0x15a1b1)[_0xee2f('0x1e')](_0x13013f);};}exports['index']=function(_0x4ef690,_0x58ba65){var _0x18bdbb={},_0x18ff19={},_0x2cb0cb={'count':0x0,'rows':[]};var _0xc7f004=_[_0xee2f('0x1f')](db[_0xee2f('0x20')]['rawAttributes'],function(_0x3d3806){return{'name':_0x3d3806['fieldName'],'type':_0x3d3806[_0xee2f('0x21')][_0xee2f('0x22')]};});_0x18ff19[_0xee2f('0x23')]=_[_0xee2f('0x1f')](_0xc7f004,_0xee2f('0x1d'));_0x18ff19['query']=_[_0xee2f('0x24')](_0x4ef690[_0xee2f('0x25')]);_0x18ff19['filters']=_['intersection'](_0x18ff19[_0xee2f('0x23')],_0x18ff19['query']);_0x18bdbb[_0xee2f('0x26')]=_[_0xee2f('0x27')](_0x18ff19['model'],qs[_0xee2f('0x28')](_0x4ef690['query']['fields']));_0x18bdbb['attributes']=_0x18bdbb[_0xee2f('0x26')][_0xee2f('0x29')]?_0x18bdbb['attributes']:_0x18ff19[_0xee2f('0x23')];if(!_0x4ef690[_0xee2f('0x25')][_0xee2f('0x2a')](_0xee2f('0x2b'))){_0x18bdbb[_0xee2f('0x2c')]=qs['limit'](_0x4ef690[_0xee2f('0x25')]['limit']);_0x18bdbb[_0xee2f('0x13')]=qs[_0xee2f('0x13')](_0x4ef690[_0xee2f('0x25')]['offset']);}_0x18bdbb[_0xee2f('0x2d')]=qs['sort'](_0x4ef690[_0xee2f('0x25')]['sort']);_0x18bdbb[_0xee2f('0x2e')]=qs[_0xee2f('0x2f')](_[_0xee2f('0x30')](_0x4ef690[_0xee2f('0x25')],_0x18ff19[_0xee2f('0x2f')]),_0xc7f004);if(_0x4ef690[_0xee2f('0x25')][_0xee2f('0x31')]){_0x18bdbb[_0xee2f('0x2e')]=_[_0xee2f('0x32')](_0x18bdbb[_0xee2f('0x2e')],{'$or':_[_0xee2f('0x1f')](_0xc7f004,function(_0x5ad0a7){if(_0x5ad0a7[_0xee2f('0x21')]!=='VIRTUAL'){var _0x46166f={};_0x46166f[_0x5ad0a7[_0xee2f('0x1d')]]={'$like':'%'+_0x4ef690[_0xee2f('0x25')][_0xee2f('0x31')]+'%'};return _0x46166f;}})});}_0x18bdbb=_[_0xee2f('0x32')]({},_0x18bdbb,_0x4ef690[_0xee2f('0x33')]);var _0x694950={'where':_0x18bdbb[_0xee2f('0x2e')]};return db['UserProfileResource']['count'](_0x694950)['then'](function(_0x46d9a2){_0x2cb0cb['count']=_0x46d9a2;if(_0x4ef690[_0xee2f('0x25')]['includeAll']){_0x18bdbb['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x18bdbb);})[_0xee2f('0x18')](function(_0x692686){_0x2cb0cb[_0xee2f('0x34')]=_0x692686;return _0x2cb0cb;})[_0xee2f('0x18')](respondWithFilteredResult(_0x58ba65,_0x18bdbb))['catch'](handleError(_0x58ba65,null));};exports['show']=function(_0x3f2194,_0x5e12b7){var _0x5a7825={'raw':![],'where':{'id':_0x3f2194[_0xee2f('0x35')]['id']}},_0x8204dc={};_0x8204dc[_0xee2f('0x23')]=_['keys'](db[_0xee2f('0x20')][_0xee2f('0x36')]);_0x8204dc[_0xee2f('0x25')]=_['keys'](_0x3f2194['query']);_0x8204dc[_0xee2f('0x2f')]=_[_0xee2f('0x27')](_0x8204dc[_0xee2f('0x23')],_0x8204dc[_0xee2f('0x25')]);_0x5a7825['attributes']=_[_0xee2f('0x27')](_0x8204dc[_0xee2f('0x23')],qs[_0xee2f('0x28')](_0x3f2194[_0xee2f('0x25')][_0xee2f('0x28')]));_0x5a7825[_0xee2f('0x26')]=_0x5a7825[_0xee2f('0x26')][_0xee2f('0x29')]?_0x5a7825[_0xee2f('0x26')]:_0x8204dc[_0xee2f('0x23')];if(_0x3f2194['query']['includeAll']){_0x5a7825['include']=[{'all':!![]}];}_0x5a7825=_['merge']({},_0x5a7825,_0x3f2194[_0xee2f('0x33')]);return db[_0xee2f('0x20')][_0xee2f('0x37')](_0x5a7825)[_0xee2f('0x18')](handleEntityNotFound(_0x5e12b7,null))[_0xee2f('0x18')](respondWithResult(_0x5e12b7,null))['catch'](handleError(_0x5e12b7,null));};exports[_0xee2f('0x38')]=function(_0x36c5cc,_0x9aef4b){return db[_0xee2f('0x20')]['create'](_0x36c5cc['body'],{})['then'](respondWithResult(_0x9aef4b,0xc9))[_0xee2f('0x39')](handleError(_0x9aef4b,null));};exports['update']=function(_0x4bb7c8,_0x57ce3c){if(_0x4bb7c8['body']['id']){delete _0x4bb7c8[_0xee2f('0x3a')]['id'];}return db[_0xee2f('0x20')][_0xee2f('0x37')]({'where':{'id':_0x4bb7c8['params']['id']}})[_0xee2f('0x18')](handleEntityNotFound(_0x57ce3c,null))['then'](saveUpdates(_0x4bb7c8[_0xee2f('0x3a')],null))[_0xee2f('0x18')](respondWithResult(_0x57ce3c,null))[_0xee2f('0x39')](handleError(_0x57ce3c,null));};exports[_0xee2f('0x19')]=function(_0x3d86b4,_0x4978eb){return db['UserProfileResource'][_0xee2f('0x37')]({'where':{'id':_0x3d86b4['params']['id']}})[_0xee2f('0x18')](handleEntityNotFound(_0x4978eb,null))[_0xee2f('0x18')](removeEntity(_0x4978eb,null))[_0xee2f('0x39')](handleError(_0x4978eb,null));};exports[_0xee2f('0x3b')]=function(_0x4fb3a0,_0x5df503){return db[_0xee2f('0x20')][_0xee2f('0x3b')]()[_0xee2f('0x18')](respondWithResult(_0x5df503,null))[_0xee2f('0x39')](handleError(_0x5df503,null));}; \ No newline at end of file +var _0x1967=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','count','offset','limit','status','destroy','then','error','stack','send','index','map','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','UserProfileResource','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x1967,0x173));var _0x7196=function(_0x24d10c,_0x55f3fd){_0x24d10c=_0x24d10c-0x0;var _0x1dddb9=_0x1967[_0x24d10c];return _0x1dddb9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=_0x2590a6[_0x7196('0x1f')],_0x3ed1ad=_0xe32933[_0x7196('0x20')],_0x12dce7=_0xe32933[_0x7196('0x20')]+_0xe32933[_0x7196('0x21')],_0x2e3e0e;if(_0x12dce7>=_0xf7e97){_0x12dce7=_0xf7e97;_0x2e3e0e=0xc8;}else{_0x2e3e0e=0xce;}_0x539414[_0x7196('0x22')](_0x2e3e0e);return _0x539414['set']('Content-Range',_0x3ed1ad+'-'+_0x12dce7+'/'+_0xf7e97)[_0x7196('0x1e')](_0x2590a6);}return null;};}function patchUpdates(_0x26b447){return function(_0x40418d){try{jsonpatch['apply'](_0x40418d,_0x26b447,!![]);}catch(_0x39b944){return BPromise['reject'](_0x39b944);}return _0x40418d['save']();};}function saveUpdates(_0x296e07,_0x627223){return function(_0x8dee9d){if(_0x8dee9d){return _0x8dee9d['update'](_0x296e07)['then'](function(_0x38d291){return _0x38d291;});}return null;};}function removeEntity(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x23')]()[_0x7196('0x24')](function(){_0x3cd8ff[_0x7196('0x22')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0x549f34,_0x3f8178){return function(_0x520d01){if(!_0x520d01){_0x549f34[_0x7196('0x1c')](0x194);}return _0x520d01;};}function handleError(_0x1b1f4b,_0x2e15c7){_0x2e15c7=_0x2e15c7||0x1f4;return function(_0xa69810){logger[_0x7196('0x25')](_0xa69810[_0x7196('0x26')]);if(_0xa69810['name']){delete _0xa69810['name'];}_0x1b1f4b[_0x7196('0x22')](_0x2e15c7)[_0x7196('0x27')](_0xa69810);};}exports[_0x7196('0x28')]=function(_0x4e878f,_0x5aa538){var _0x41cfd2={},_0x162cfc={},_0x675e64={'count':0x0,'rows':[]};var _0x4c6006=_[_0x7196('0x29')](db['UserProfileResource'][_0x7196('0x2a')],function(_0x59d79d){return{'name':_0x59d79d[_0x7196('0x2b')],'type':_0x59d79d[_0x7196('0x2c')][_0x7196('0x2d')]};});_0x162cfc['model']=_[_0x7196('0x29')](_0x4c6006,_0x7196('0x2e'));_0x162cfc[_0x7196('0x2f')]=_[_0x7196('0x30')](_0x4e878f['query']);_0x162cfc[_0x7196('0x31')]=_[_0x7196('0x32')](_0x162cfc[_0x7196('0x33')],_0x162cfc[_0x7196('0x2f')]);_0x41cfd2[_0x7196('0x34')]=_[_0x7196('0x32')](_0x162cfc[_0x7196('0x33')],qs[_0x7196('0x35')](_0x4e878f[_0x7196('0x2f')][_0x7196('0x35')]));_0x41cfd2[_0x7196('0x34')]=_0x41cfd2['attributes'][_0x7196('0x36')]?_0x41cfd2['attributes']:_0x162cfc[_0x7196('0x33')];if(!_0x4e878f['query'][_0x7196('0x37')](_0x7196('0x38'))){_0x41cfd2['limit']=qs[_0x7196('0x21')](_0x4e878f[_0x7196('0x2f')][_0x7196('0x21')]);_0x41cfd2[_0x7196('0x20')]=qs[_0x7196('0x20')](_0x4e878f['query'][_0x7196('0x20')]);}_0x41cfd2[_0x7196('0x39')]=qs[_0x7196('0x3a')](_0x4e878f[_0x7196('0x2f')][_0x7196('0x3a')]);_0x41cfd2[_0x7196('0x3b')]=qs['filters'](_[_0x7196('0x3c')](_0x4e878f[_0x7196('0x2f')],_0x162cfc[_0x7196('0x31')]),_0x4c6006);if(_0x4e878f['query'][_0x7196('0x3d')]){_0x41cfd2[_0x7196('0x3b')]=_[_0x7196('0x3e')](_0x41cfd2[_0x7196('0x3b')],{'$or':_[_0x7196('0x29')](_0x4c6006,function(_0x31fca7){if(_0x31fca7[_0x7196('0x2c')]!==_0x7196('0x3f')){var _0x92cfb1={};_0x92cfb1[_0x31fca7[_0x7196('0x2e')]]={'$like':'%'+_0x4e878f['query'][_0x7196('0x3d')]+'%'};return _0x92cfb1;}})});}_0x41cfd2=_[_0x7196('0x3e')]({},_0x41cfd2,_0x4e878f['options']);var _0x186efe={'where':_0x41cfd2['where']};return db['UserProfileResource'][_0x7196('0x1f')](_0x186efe)[_0x7196('0x24')](function(_0x4d03c9){_0x675e64['count']=_0x4d03c9;if(_0x4e878f[_0x7196('0x2f')][_0x7196('0x40')]){_0x41cfd2[_0x7196('0x41')]=[{'all':!![]}];}return db['UserProfileResource'][_0x7196('0x42')](_0x41cfd2);})[_0x7196('0x24')](function(_0x29ba1c){_0x675e64[_0x7196('0x43')]=_0x29ba1c;return _0x675e64;})[_0x7196('0x24')](respondWithFilteredResult(_0x5aa538,_0x41cfd2))[_0x7196('0x44')](handleError(_0x5aa538,null));};exports[_0x7196('0x45')]=function(_0x440077,_0x5cd903){var _0x89c8ea={'raw':![],'where':{'id':_0x440077['params']['id']}},_0xa852e1={};_0xa852e1[_0x7196('0x33')]=_[_0x7196('0x30')](db['UserProfileResource'][_0x7196('0x2a')]);_0xa852e1[_0x7196('0x2f')]=_[_0x7196('0x30')](_0x440077['query']);_0xa852e1[_0x7196('0x31')]=_[_0x7196('0x32')](_0xa852e1['model'],_0xa852e1[_0x7196('0x2f')]);_0x89c8ea[_0x7196('0x34')]=_['intersection'](_0xa852e1[_0x7196('0x33')],qs['fields'](_0x440077['query']['fields']));_0x89c8ea['attributes']=_0x89c8ea['attributes'][_0x7196('0x36')]?_0x89c8ea['attributes']:_0xa852e1[_0x7196('0x33')];if(_0x440077[_0x7196('0x2f')][_0x7196('0x40')]){_0x89c8ea[_0x7196('0x41')]=[{'all':!![]}];}_0x89c8ea=_['merge']({},_0x89c8ea,_0x440077[_0x7196('0x46')]);return db['UserProfileResource'][_0x7196('0x47')](_0x89c8ea)[_0x7196('0x24')](handleEntityNotFound(_0x5cd903,null))[_0x7196('0x24')](respondWithResult(_0x5cd903,null))['catch'](handleError(_0x5cd903,null));};exports[_0x7196('0x48')]=function(_0x44d8e5,_0x1b5c68){return db['UserProfileResource']['create'](_0x44d8e5[_0x7196('0x49')],{})['then'](respondWithResult(_0x1b5c68,0xc9))[_0x7196('0x44')](handleError(_0x1b5c68,null));};exports['update']=function(_0x53b4c7,_0x14b489){if(_0x53b4c7['body']['id']){delete _0x53b4c7['body']['id'];}return db['UserProfileResource'][_0x7196('0x47')]({'where':{'id':_0x53b4c7['params']['id']}})['then'](handleEntityNotFound(_0x14b489,null))[_0x7196('0x24')](saveUpdates(_0x53b4c7[_0x7196('0x49')],null))[_0x7196('0x24')](respondWithResult(_0x14b489,null))[_0x7196('0x44')](handleError(_0x14b489,null));};exports['destroy']=function(_0x50cc66,_0x564688){return db[_0x7196('0x4a')][_0x7196('0x47')]({'where':{'id':_0x50cc66['params']['id']}})[_0x7196('0x24')](handleEntityNotFound(_0x564688,null))[_0x7196('0x24')](removeEntity(_0x564688,null))[_0x7196('0x44')](handleError(_0x564688,null));};exports['describe']=function(_0x317ab6,_0x5d51aa){return db[_0x7196('0x4a')][_0x7196('0x4b')]()[_0x7196('0x24')](respondWithResult(_0x5d51aa,null))[_0x7196('0x44')](handleError(_0x5d51aa,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 2db6a83..bd5da2d 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 _0xa3b2=['define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes'];(function(_0x19ff18,_0x5b13c5){var _0x27d9c4=function(_0x4c9d33){while(--_0x4c9d33){_0x19ff18['push'](_0x19ff18['shift']());}};_0x27d9c4(++_0x5b13c5);}(_0xa3b2,0x11d));var _0x2a3b=function(_0x23a079,_0xb8c9aa){_0x23a079=_0x23a079-0x0;var _0x53f2a5=_0xa3b2[_0x23a079];return _0x53f2a5;};'use strict';var _=require(_0x2a3b('0x0'));var util=require(_0x2a3b('0x1'));var logger=require(_0x2a3b('0x2'))('api');var moment=require(_0x2a3b('0x3'));var BPromise=require(_0x2a3b('0x4'));var rp=require(_0x2a3b('0x5'));var fs=require('fs');var path=require(_0x2a3b('0x6'));var rimraf=require('rimraf');var config=require(_0x2a3b('0x7'));var attributes=require(_0x2a3b('0x8'));module['exports']=function(_0x34085a,_0x592d04){return _0x34085a[_0x2a3b('0x9')](_0x2a3b('0xa'),attributes,{'tableName':_0x2a3b('0xb'),'paranoid':![],'indexes':[{'name':_0x2a3b('0xc'),'fields':['resourceId',_0x2a3b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa399=['sectionId','util','api','moment','request-promise','../../config/environment','./userProfileResource.attributes','define','UserProfileResource'];(function(_0x1ea46c,_0x849015){var _0xb8f343=function(_0x25a09f){while(--_0x25a09f){_0x1ea46c['push'](_0x1ea46c['shift']());}};_0xb8f343(++_0x849015);}(_0xa399,0x1cc));var _0x9a39=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xa399[_0x55abd9];return _0x3e5669;};'use strict';var _=require('lodash');var util=require(_0x9a39('0x0'));var logger=require('../../config/logger')(_0x9a39('0x1'));var moment=require(_0x9a39('0x2'));var BPromise=require('bluebird');var rp=require(_0x9a39('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9a39('0x4'));var attributes=require(_0x9a39('0x5'));module['exports']=function(_0x1417c7,_0x467283){return _0x1417c7[_0x9a39('0x6')](_0x9a39('0x7'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x9a39('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 56e1110..9891562 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 _0xcb46=['../../config/logger','rpc','jayson/promise','client','http','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x271f9e,_0x361765){var _0x26bb6b=function(_0x258fcd){while(--_0x258fcd){_0x271f9e['push'](_0x271f9e['shift']());}};_0x26bb6b(++_0x361765);}(_0xcb46,0x14a));var _0x6cb4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb46[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6cb4('0x0'));var util=require('util');var moment=require(_0x6cb4('0x1'));var BPromise=require(_0x6cb4('0x2'));var rs=require(_0x6cb4('0x3'));var fs=require('fs');var Redis=require(_0x6cb4('0x4'));var db=require(_0x6cb4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6cb4('0x6'))(_0x6cb4('0x7'));var config=require('../../config/environment');var jayson=require(_0x6cb4('0x8'));var client=jayson[_0x6cb4('0x9')][_0x6cb4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1486a6,_0x36c922,_0x4e388c){return new BPromise(function(_0x59d5ae,_0x11b66c){return client['request'](_0x1486a6,_0x4e388c)['then'](function(_0x1ef1de){logger[_0x6cb4('0xb')](_0x6cb4('0xc'),_0x36c922,_0x6cb4('0xd'));logger[_0x6cb4('0xe')](_0x6cb4('0xf'),_0x36c922,_0x6cb4('0xd'),JSON[_0x6cb4('0x10')](_0x1ef1de));if(_0x1ef1de[_0x6cb4('0x11')]){if(_0x1ef1de['error']['code']===0x1f4){logger[_0x6cb4('0x11')](_0x6cb4('0xc'),_0x36c922,_0x1ef1de[_0x6cb4('0x11')]['message']);return _0x11b66c(_0x1ef1de[_0x6cb4('0x11')]['message']);}logger[_0x6cb4('0x11')](_0x6cb4('0xc'),_0x36c922,_0x1ef1de[_0x6cb4('0x11')]['message']);return _0x59d5ae(_0x1ef1de[_0x6cb4('0x11')][_0x6cb4('0x12')]);}else{logger[_0x6cb4('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x36c922,_0x6cb4('0xd'));_0x59d5ae(_0x1ef1de[_0x6cb4('0x13')]['message']);}})[_0x6cb4('0x14')](function(_0x3f2a7a){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x36c922,_0x3f2a7a);_0x11b66c(_0x3f2a7a);});});} \ No newline at end of file +var _0xda0d=['jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2e2929,_0x1ad84a){var _0x2fe8ba=function(_0x525356){while(--_0x525356){_0x2e2929['push'](_0x2e2929['shift']());}};_0x2fe8ba(++_0x1ad84a);}(_0xda0d,0x172));var _0xdda0=function(_0x5c6e64,_0x553198){_0x5c6e64=_0x5c6e64-0x0;var _0x52ad11=_0xda0d[_0x5c6e64];return _0x52ad11;};'use strict';var _=require('lodash');var util=require(_0xdda0('0x0'));var moment=require(_0xdda0('0x1'));var BPromise=require('bluebird');var rs=require(_0xdda0('0x2'));var fs=require('fs');var Redis=require(_0xdda0('0x3'));var db=require(_0xdda0('0x4'))['db'];var utils=require(_0xdda0('0x5'));var logger=require(_0xdda0('0x6'))(_0xdda0('0x7'));var config=require('../../config/environment');var jayson=require(_0xdda0('0x8'));var client=jayson['client'][_0xdda0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43bd8f,_0x4818ae,_0x3edc2a){return new BPromise(function(_0x51f25f,_0x11a03d){return client[_0xdda0('0xa')](_0x43bd8f,_0x3edc2a)[_0xdda0('0xb')](function(_0x3aaea0){logger[_0xdda0('0xc')](_0xdda0('0xd'),_0x4818ae,'request\x20sent');logger[_0xdda0('0xe')](_0xdda0('0xf'),_0x4818ae,'request\x20sent',JSON['stringify'](_0x3aaea0));if(_0x3aaea0[_0xdda0('0x10')]){if(_0x3aaea0[_0xdda0('0x10')][_0xdda0('0x11')]===0x1f4){logger[_0xdda0('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x4818ae,_0x3aaea0[_0xdda0('0x10')][_0xdda0('0x12')]);return _0x11a03d(_0x3aaea0[_0xdda0('0x10')][_0xdda0('0x12')]);}logger[_0xdda0('0x10')](_0xdda0('0xd'),_0x4818ae,_0x3aaea0[_0xdda0('0x10')][_0xdda0('0x12')]);return _0x51f25f(_0x3aaea0['error'][_0xdda0('0x12')]);}else{logger['info'](_0xdda0('0xd'),_0x4818ae,_0xdda0('0x13'));_0x51f25f(_0x3aaea0['result'][_0xdda0('0x12')]);}})[_0xdda0('0x14')](function(_0x216642){logger[_0xdda0('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x4818ae,_0x216642);_0x11a03d(_0x216642);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 8d57bca..d5efe21 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 _0x2f5d=['/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x5a2291,_0x3ddda7){var _0x10e3f5=function(_0xc510cc){while(--_0xc510cc){_0x5a2291['push'](_0x5a2291['shift']());}};_0x10e3f5(++_0x3ddda7);}(_0x2f5d,0xf8));var _0xd2f5=function(_0x5c26ca,_0x2d96fd){_0x5c26ca=_0x5c26ca-0x0;var _0x77d0fc=_0x2f5d[_0x5c26ca];return _0x77d0fc;};'use strict';var multer=require(_0xd2f5('0x0'));var util=require('util');var path=require(_0xd2f5('0x1'));var timeout=require(_0xd2f5('0x2'));var express=require(_0xd2f5('0x3'));var router=express[_0xd2f5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd2f5('0x5'));var config=require(_0xd2f5('0x6'));var controller=require('./userProfileSection.controller');router[_0xd2f5('0x7')]('/',auth['isAuthenticated'](),controller[_0xd2f5('0x8')]);router[_0xd2f5('0x7')](_0xd2f5('0x9'),auth[_0xd2f5('0xa')](),controller[_0xd2f5('0xb')]);router[_0xd2f5('0x7')](_0xd2f5('0xc'),auth[_0xd2f5('0xa')](),controller[_0xd2f5('0xd')]);router[_0xd2f5('0xe')]('/',auth[_0xd2f5('0xa')](),controller[_0xd2f5('0xf')]);router[_0xd2f5('0x10')]('/:id',auth[_0xd2f5('0xa')](),controller[_0xd2f5('0x11')]);router[_0xd2f5('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd2f5('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc410=['index','/:id','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x5e8c1d,_0x38d6b2){var _0xa0ebdd=function(_0x5f05fe){while(--_0x5f05fe){_0x5e8c1d['push'](_0x5e8c1d['shift']());}};_0xa0ebdd(++_0x38d6b2);}(_0xc410,0x183));var _0x0c41=function(_0x1e3bd3,_0x380bf2){_0x1e3bd3=_0x1e3bd3-0x0;var _0x110df1=_0xc410[_0x1e3bd3];return _0x110df1;};'use strict';var multer=require(_0x0c41('0x0'));var util=require(_0x0c41('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c41('0x2'));var router=express[_0x0c41('0x3')]();var fs_extra=require(_0x0c41('0x4'));var auth=require(_0x0c41('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0c41('0x6'));var controller=require('./userProfileSection.controller');router[_0x0c41('0x7')]('/',auth[_0x0c41('0x8')](),controller[_0x0c41('0x9')]);router[_0x0c41('0x7')]('/describe',auth[_0x0c41('0x8')](),controller['describe']);router[_0x0c41('0x7')](_0x0c41('0xa'),auth[_0x0c41('0x8')](),controller['show']);router[_0x0c41('0xb')]('/',auth['isAuthenticated'](),controller[_0x0c41('0xc')]);router[_0x0c41('0xd')]('/:id',auth[_0x0c41('0x8')](),controller[_0x0c41('0xe')]);router[_0x0c41('0xf')](_0x0c41('0xa'),auth['isAuthenticated'](),controller[_0x0c41('0x10')]);module[_0x0c41('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index be92a1c..bc7980b 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 _0x8fe4=['sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','split'];(function(_0x48010f,_0x41a6e2){var _0x598b25=function(_0x36f9cc){while(--_0x36f9cc){_0x48010f['push'](_0x48010f['shift']());}};_0x598b25(++_0x41a6e2);}(_0x8fe4,0x170));var _0x48fe=function(_0x90c8e7,_0x3c4a17){_0x90c8e7=_0x90c8e7-0x0;var _0x47953f=_0x8fe4[_0x90c8e7];return _0x47953f;};'use strict';var Sequelize=require(_0x48fe('0x0'));module[_0x48fe('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x48fe('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x48fe('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x48fe('0x2')],'set':function(_0x3cc016){this[_0x48fe('0x4')](_0x48fe('0x5'),_0x3cc016?_0x3cc016[_0x48fe('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue']('crudPermissions')[_0x48fe('0x7')](''):[];}}}; \ No newline at end of file +var _0x52b2=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','INTEGER'];(function(_0x38a19e,_0x36f6d2){var _0x449275=function(_0x2fc9c8){while(--_0x2fc9c8){_0x38a19e['push'](_0x38a19e['shift']());}};_0x449275(++_0x36f6d2);}(_0x52b2,0x11e));var _0x252b=function(_0x53c145,_0x481583){_0x53c145=_0x53c145-0x0;var _0x3fbd8f=_0x52b2[_0x53c145];return _0x3fbd8f;};'use strict';var Sequelize=require(_0x252b('0x0'));module[_0x252b('0x1')]={'name':{'type':Sequelize[_0x252b('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x252b('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x252b('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x252b('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x252b('0x2')],'set':function(_0x35fe82){this[_0x252b('0x5')](_0x252b('0x6'),_0x35fe82?_0x35fe82[_0x252b('0x7')](''):[]);},'get':function(){return this['getDataValue'](_0x252b('0x6'))?this[_0x252b('0x8')](_0x252b('0x6'))[_0x252b('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 3098911..a153b1f 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 _0x2883=['destroy','error','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','UserProfileSection','includeAll','rows','catch','show','create','body','find','params','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','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then'];(function(_0x199933,_0x55e133){var _0x34b447=function(_0x39cb9c){while(--_0x39cb9c){_0x199933['push'](_0x199933['shift']());}};_0x34b447(++_0x55e133);}(_0x2883,0x1ab));var _0x3288=function(_0x35551f,_0x5d32eb){_0x35551f=_0x35551f-0x0;var _0x3c0efe=_0x2883[_0x35551f];return _0x3c0efe;};'use strict';var emlformat=require(_0x3288('0x0'));var rimraf=require(_0x3288('0x1'));var zipdir=require(_0x3288('0x2'));var jsonpatch=require(_0x3288('0x3'));var rp=require(_0x3288('0x4'));var moment=require(_0x3288('0x5'));var BPromise=require(_0x3288('0x6'));var Mustache=require(_0x3288('0x7'));var util=require(_0x3288('0x8'));var path=require(_0x3288('0x9'));var sox=require(_0x3288('0xa'));var csv=require(_0x3288('0xb'));var ejs=require(_0x3288('0xc'));var fs=require('fs');var fs_extra=require(_0x3288('0xd'));var _=require('lodash');var squel=require(_0x3288('0xe'));var crypto=require('crypto');var jsforce=require(_0x3288('0xf'));var deskjs=require(_0x3288('0x10'));var toCsv=require(_0x3288('0xb'));var querystring=require(_0x3288('0x11'));var Papa=require(_0x3288('0x12'));var Redis=require(_0x3288('0x13'));var authService=require(_0x3288('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3288('0x15'));var logger=require(_0x3288('0x16'))(_0x3288('0x17'));var utils=require(_0x3288('0x18'));var config=require(_0x3288('0x19'));var licenseUtil=require(_0x3288('0x1a'));var db=require(_0x3288('0x1b'))['db'];function respondWithStatusCode(_0x1406be,_0x3cfdfb){_0x3cfdfb=_0x3cfdfb||0xcc;return function(_0x4aacd4){if(_0x4aacd4){return _0x1406be[_0x3288('0x1c')](_0x3cfdfb);}return _0x1406be[_0x3288('0x1d')](_0x3cfdfb)[_0x3288('0x1e')]();};}function respondWithResult(_0x25d08a,_0x2fd32a){_0x2fd32a=_0x2fd32a||0xc8;return function(_0x2111a6){if(_0x2111a6){return _0x25d08a['status'](_0x2fd32a)[_0x3288('0x1f')](_0x2111a6);}};}function respondWithFilteredResult(_0x45576c,_0x5a9fd5){return function(_0x583439){if(_0x583439){var _0x4625d4=_0x583439[_0x3288('0x20')],_0x115505=_0x5a9fd5[_0x3288('0x21')],_0x83681e=_0x5a9fd5[_0x3288('0x21')]+_0x5a9fd5[_0x3288('0x22')],_0x4b0a3e;if(_0x83681e>=_0x4625d4){_0x83681e=_0x4625d4;_0x4b0a3e=0xc8;}else{_0x4b0a3e=0xce;}_0x45576c[_0x3288('0x1d')](_0x4b0a3e);return _0x45576c[_0x3288('0x23')](_0x3288('0x24'),_0x115505+'-'+_0x83681e+'/'+_0x4625d4)[_0x3288('0x1f')](_0x583439);}return null;};}function patchUpdates(_0x1376ac){return function(_0x4a7fc3){try{jsonpatch[_0x3288('0x25')](_0x4a7fc3,_0x1376ac,!![]);}catch(_0x26a9d6){return BPromise['reject'](_0x26a9d6);}return _0x4a7fc3[_0x3288('0x26')]();};}function saveUpdates(_0x3197a2,_0x36b3d1){return function(_0x4e9471){if(_0x4e9471){return _0x4e9471[_0x3288('0x27')](_0x3197a2)[_0x3288('0x28')](function(_0x19b796){return _0x19b796;});}return null;};}function removeEntity(_0x30cf43,_0x38e942){return function(_0x8749d){if(_0x8749d){return _0x8749d[_0x3288('0x29')]()[_0x3288('0x28')](function(){_0x30cf43[_0x3288('0x1d')](0xcc)[_0x3288('0x1e')]();});}};}function handleEntityNotFound(_0x595e79,_0x468b85){return function(_0x28cf82){if(!_0x28cf82){_0x595e79[_0x3288('0x1c')](0x194);}return _0x28cf82;};}function handleError(_0x529ac6,_0x4a522c){_0x4a522c=_0x4a522c||0x1f4;return function(_0x283513){logger[_0x3288('0x2a')](_0x283513['stack']);if(_0x283513[_0x3288('0x2b')]){delete _0x283513[_0x3288('0x2b')];}_0x529ac6[_0x3288('0x1d')](_0x4a522c)[_0x3288('0x2c')](_0x283513);};}exports[_0x3288('0x2d')]=function(_0x27523a,_0x70bda7){var _0x58da15={},_0x50d8a9={},_0x1dd0d8={'count':0x0,'rows':[]};var _0x5b1306=_['map'](db['UserProfileSection'][_0x3288('0x2e')],function(_0x1bfcc4){return{'name':_0x1bfcc4[_0x3288('0x2f')],'type':_0x1bfcc4[_0x3288('0x30')]['key']};});_0x50d8a9[_0x3288('0x31')]=_[_0x3288('0x32')](_0x5b1306,_0x3288('0x2b'));_0x50d8a9[_0x3288('0x33')]=_[_0x3288('0x34')](_0x27523a[_0x3288('0x33')]);_0x50d8a9[_0x3288('0x35')]=_[_0x3288('0x36')](_0x50d8a9[_0x3288('0x31')],_0x50d8a9['query']);_0x58da15[_0x3288('0x37')]=_[_0x3288('0x36')](_0x50d8a9[_0x3288('0x31')],qs['fields'](_0x27523a[_0x3288('0x33')][_0x3288('0x38')]));_0x58da15[_0x3288('0x37')]=_0x58da15['attributes'][_0x3288('0x39')]?_0x58da15[_0x3288('0x37')]:_0x50d8a9[_0x3288('0x31')];if(!_0x27523a[_0x3288('0x33')][_0x3288('0x3a')](_0x3288('0x3b'))){_0x58da15[_0x3288('0x22')]=qs[_0x3288('0x22')](_0x27523a[_0x3288('0x33')]['limit']);_0x58da15[_0x3288('0x21')]=qs[_0x3288('0x21')](_0x27523a[_0x3288('0x33')][_0x3288('0x21')]);}_0x58da15[_0x3288('0x3c')]=qs[_0x3288('0x3d')](_0x27523a['query'][_0x3288('0x3d')]);_0x58da15['where']=qs[_0x3288('0x35')](_[_0x3288('0x3e')](_0x27523a['query'],_0x50d8a9[_0x3288('0x35')]),_0x5b1306);if(_0x27523a['query'][_0x3288('0x3f')]){_0x58da15[_0x3288('0x40')]=_[_0x3288('0x41')](_0x58da15[_0x3288('0x40')],{'$or':_[_0x3288('0x32')](_0x5b1306,function(_0x2c9a53){if(_0x2c9a53['type']!==_0x3288('0x42')){var _0x369a14={};_0x369a14[_0x2c9a53[_0x3288('0x2b')]]={'$like':'%'+_0x27523a[_0x3288('0x33')][_0x3288('0x3f')]+'%'};return _0x369a14;}})});}_0x58da15=_[_0x3288('0x41')]({},_0x58da15,_0x27523a[_0x3288('0x43')]);var _0x49e513={'where':_0x58da15[_0x3288('0x40')]};return db[_0x3288('0x44')][_0x3288('0x20')](_0x49e513)[_0x3288('0x28')](function(_0x5d02de){_0x1dd0d8['count']=_0x5d02de;if(_0x27523a['query'][_0x3288('0x45')]){_0x58da15['include']=[{'all':!![]}];}return db[_0x3288('0x44')]['findAll'](_0x58da15);})[_0x3288('0x28')](function(_0x4409eb){_0x1dd0d8[_0x3288('0x46')]=_0x4409eb;return _0x1dd0d8;})['then'](respondWithFilteredResult(_0x70bda7,_0x58da15))[_0x3288('0x47')](handleError(_0x70bda7,null));};exports[_0x3288('0x48')]=function(_0x2b2acd,_0x1a34c2){var _0x4f3987={'raw':![],'where':{'id':_0x2b2acd['params']['id']}},_0x50be89={};_0x50be89[_0x3288('0x31')]=_[_0x3288('0x34')](db[_0x3288('0x44')][_0x3288('0x2e')]);_0x50be89[_0x3288('0x33')]=_[_0x3288('0x34')](_0x2b2acd[_0x3288('0x33')]);_0x50be89[_0x3288('0x35')]=_['intersection'](_0x50be89[_0x3288('0x31')],_0x50be89[_0x3288('0x33')]);_0x4f3987[_0x3288('0x37')]=_[_0x3288('0x36')](_0x50be89['model'],qs[_0x3288('0x38')](_0x2b2acd['query'][_0x3288('0x38')]));_0x4f3987[_0x3288('0x37')]=_0x4f3987[_0x3288('0x37')][_0x3288('0x39')]?_0x4f3987[_0x3288('0x37')]:_0x50be89[_0x3288('0x31')];if(_0x2b2acd[_0x3288('0x33')][_0x3288('0x45')]){_0x4f3987['include']=[{'all':!![]}];}_0x4f3987=_[_0x3288('0x41')]({},_0x4f3987,_0x2b2acd[_0x3288('0x43')]);return db['UserProfileSection']['find'](_0x4f3987)[_0x3288('0x28')](handleEntityNotFound(_0x1a34c2,null))[_0x3288('0x28')](respondWithResult(_0x1a34c2,null))['catch'](handleError(_0x1a34c2,null));};exports[_0x3288('0x49')]=function(_0x12bcf9,_0x449e5e){return db['UserProfileSection'][_0x3288('0x49')](_0x12bcf9['body'],{})[_0x3288('0x28')](respondWithResult(_0x449e5e,0xc9))[_0x3288('0x47')](handleError(_0x449e5e,null));};exports[_0x3288('0x27')]=function(_0xc27f66,_0x477ddf){if(_0xc27f66[_0x3288('0x4a')]['id']){delete _0xc27f66[_0x3288('0x4a')]['id'];}return db['UserProfileSection'][_0x3288('0x4b')]({'where':{'id':_0xc27f66[_0x3288('0x4c')]['id']}})['then'](handleEntityNotFound(_0x477ddf,null))['then'](saveUpdates(_0xc27f66[_0x3288('0x4a')],null))['then'](respondWithResult(_0x477ddf,null))[_0x3288('0x47')](handleError(_0x477ddf,null));};exports[_0x3288('0x29')]=function(_0x17f333,_0x27f658){return db[_0x3288('0x44')][_0x3288('0x4b')]({'where':{'id':_0x17f333[_0x3288('0x4c')]['id']}})[_0x3288('0x28')](handleEntityNotFound(_0x27f658,null))[_0x3288('0x28')](removeEntity(_0x27f658,null))[_0x3288('0x47')](handleError(_0x27f658,null));};exports['describe']=function(_0x2cd5c4,_0x51e2d0){return db[_0x3288('0x44')][_0x3288('0x4d')]()[_0x3288('0x28')](respondWithResult(_0x51e2d0,null))[_0x3288('0x47')](handleError(_0x51e2d0,null));}; \ No newline at end of file +var _0x5a46=['rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','findAll','catch','params','length','find','create','body','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','save','update','then','error','stack','name','send','index','map','UserProfileSection'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x5a46,0xe2));var _0x65a4=function(_0x5f57a3,_0x59bc9e){_0x5f57a3=_0x5f57a3-0x0;var _0x2bc8d8=_0x5a46[_0x5f57a3];return _0x2bc8d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65a4('0x0'));var zipdir=require(_0x65a4('0x1'));var jsonpatch=require(_0x65a4('0x2'));var rp=require('request-promise');var moment=require(_0x65a4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x65a4('0x4'));var util=require(_0x65a4('0x5'));var path=require(_0x65a4('0x6'));var sox=require('sox');var csv=require(_0x65a4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x65a4('0x8'));var squel=require(_0x65a4('0x9'));var crypto=require(_0x65a4('0xa'));var jsforce=require(_0x65a4('0xb'));var deskjs=require(_0x65a4('0xc'));var toCsv=require(_0x65a4('0x7'));var querystring=require(_0x65a4('0xd'));var Papa=require(_0x65a4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x65a4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x65a4('0x10'));var logger=require(_0x65a4('0x11'))(_0x65a4('0x12'));var utils=require(_0x65a4('0x13'));var config=require(_0x65a4('0x14'));var licenseUtil=require(_0x65a4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42be1d,_0x2438be){_0x2438be=_0x2438be||0xcc;return function(_0x38f64c){if(_0x38f64c){return _0x42be1d[_0x65a4('0x16')](_0x2438be);}return _0x42be1d[_0x65a4('0x17')](_0x2438be)[_0x65a4('0x18')]();};}function respondWithResult(_0x36dc0f,_0x1e8245){_0x1e8245=_0x1e8245||0xc8;return function(_0x5127aa){if(_0x5127aa){return _0x36dc0f['status'](_0x1e8245)[_0x65a4('0x19')](_0x5127aa);}};}function respondWithFilteredResult(_0x1d3db3,_0x221b95){return function(_0x313447){if(_0x313447){var _0x1d4225=_0x313447['count'],_0x46cd5a=_0x221b95[_0x65a4('0x1a')],_0x219ccb=_0x221b95[_0x65a4('0x1a')]+_0x221b95[_0x65a4('0x1b')],_0x559388;if(_0x219ccb>=_0x1d4225){_0x219ccb=_0x1d4225;_0x559388=0xc8;}else{_0x559388=0xce;}_0x1d3db3['status'](_0x559388);return _0x1d3db3['set']('Content-Range',_0x46cd5a+'-'+_0x219ccb+'/'+_0x1d4225)['json'](_0x313447);}return null;};}function patchUpdates(_0x29e72c){return function(_0x46d92d){try{jsonpatch['apply'](_0x46d92d,_0x29e72c,!![]);}catch(_0x5e82d5){return BPromise['reject'](_0x5e82d5);}return _0x46d92d[_0x65a4('0x1c')]();};}function saveUpdates(_0x23ce57,_0x39acc6){return function(_0x411d54){if(_0x411d54){return _0x411d54[_0x65a4('0x1d')](_0x23ce57)[_0x65a4('0x1e')](function(_0x55ba70){return _0x55ba70;});}return null;};}function removeEntity(_0x590f02,_0x233fab){return function(_0x3addbf){if(_0x3addbf){return _0x3addbf['destroy']()['then'](function(){_0x590f02[_0x65a4('0x17')](0xcc)[_0x65a4('0x18')]();});}};}function handleEntityNotFound(_0x19b8d1,_0x477e24){return function(_0x21a673){if(!_0x21a673){_0x19b8d1[_0x65a4('0x16')](0x194);}return _0x21a673;};}function handleError(_0xac655d,_0x321192){_0x321192=_0x321192||0x1f4;return function(_0x15be0a){logger[_0x65a4('0x1f')](_0x15be0a[_0x65a4('0x20')]);if(_0x15be0a[_0x65a4('0x21')]){delete _0x15be0a[_0x65a4('0x21')];}_0xac655d[_0x65a4('0x17')](_0x321192)[_0x65a4('0x22')](_0x15be0a);};}exports[_0x65a4('0x23')]=function(_0xc29b3c,_0x5e0c54){var _0x3b1443={},_0x194ef1={},_0x28fe2a={'count':0x0,'rows':[]};var _0x59a774=_[_0x65a4('0x24')](db[_0x65a4('0x25')][_0x65a4('0x26')],function(_0x20a731){return{'name':_0x20a731['fieldName'],'type':_0x20a731[_0x65a4('0x27')][_0x65a4('0x28')]};});_0x194ef1[_0x65a4('0x29')]=_[_0x65a4('0x24')](_0x59a774,_0x65a4('0x21'));_0x194ef1[_0x65a4('0x2a')]=_[_0x65a4('0x2b')](_0xc29b3c['query']);_0x194ef1[_0x65a4('0x2c')]=_['intersection'](_0x194ef1[_0x65a4('0x29')],_0x194ef1[_0x65a4('0x2a')]);_0x3b1443['attributes']=_[_0x65a4('0x2d')](_0x194ef1['model'],qs[_0x65a4('0x2e')](_0xc29b3c[_0x65a4('0x2a')][_0x65a4('0x2e')]));_0x3b1443[_0x65a4('0x2f')]=_0x3b1443[_0x65a4('0x2f')]['length']?_0x3b1443[_0x65a4('0x2f')]:_0x194ef1[_0x65a4('0x29')];if(!_0xc29b3c[_0x65a4('0x2a')][_0x65a4('0x30')](_0x65a4('0x31'))){_0x3b1443[_0x65a4('0x1b')]=qs[_0x65a4('0x1b')](_0xc29b3c[_0x65a4('0x2a')][_0x65a4('0x1b')]);_0x3b1443['offset']=qs[_0x65a4('0x1a')](_0xc29b3c[_0x65a4('0x2a')]['offset']);}_0x3b1443[_0x65a4('0x32')]=qs[_0x65a4('0x33')](_0xc29b3c[_0x65a4('0x2a')][_0x65a4('0x33')]);_0x3b1443[_0x65a4('0x34')]=qs['filters'](_['pick'](_0xc29b3c[_0x65a4('0x2a')],_0x194ef1[_0x65a4('0x2c')]),_0x59a774);if(_0xc29b3c['query'][_0x65a4('0x35')]){_0x3b1443[_0x65a4('0x34')]=_[_0x65a4('0x36')](_0x3b1443[_0x65a4('0x34')],{'$or':_['map'](_0x59a774,function(_0x1308b6){if(_0x1308b6[_0x65a4('0x27')]!=='VIRTUAL'){var _0x314718={};_0x314718[_0x1308b6['name']]={'$like':'%'+_0xc29b3c[_0x65a4('0x2a')]['filter']+'%'};return _0x314718;}})});}_0x3b1443=_[_0x65a4('0x36')]({},_0x3b1443,_0xc29b3c[_0x65a4('0x37')]);var _0x7e2df0={'where':_0x3b1443[_0x65a4('0x34')]};return db[_0x65a4('0x25')][_0x65a4('0x38')](_0x7e2df0)[_0x65a4('0x1e')](function(_0x182bd8){_0x28fe2a['count']=_0x182bd8;if(_0xc29b3c['query'][_0x65a4('0x39')]){_0x3b1443[_0x65a4('0x3a')]=[{'all':!![]}];}return db[_0x65a4('0x25')][_0x65a4('0x3b')](_0x3b1443);})[_0x65a4('0x1e')](function(_0x3bb08d){_0x28fe2a['rows']=_0x3bb08d;return _0x28fe2a;})['then'](respondWithFilteredResult(_0x5e0c54,_0x3b1443))[_0x65a4('0x3c')](handleError(_0x5e0c54,null));};exports['show']=function(_0x3ece30,_0x2ba3e2){var _0x6120bb={'raw':![],'where':{'id':_0x3ece30[_0x65a4('0x3d')]['id']}},_0x267208={};_0x267208[_0x65a4('0x29')]=_['keys'](db['UserProfileSection'][_0x65a4('0x26')]);_0x267208[_0x65a4('0x2a')]=_['keys'](_0x3ece30[_0x65a4('0x2a')]);_0x267208['filters']=_['intersection'](_0x267208[_0x65a4('0x29')],_0x267208[_0x65a4('0x2a')]);_0x6120bb[_0x65a4('0x2f')]=_[_0x65a4('0x2d')](_0x267208['model'],qs[_0x65a4('0x2e')](_0x3ece30[_0x65a4('0x2a')][_0x65a4('0x2e')]));_0x6120bb['attributes']=_0x6120bb[_0x65a4('0x2f')][_0x65a4('0x3e')]?_0x6120bb[_0x65a4('0x2f')]:_0x267208['model'];if(_0x3ece30['query'][_0x65a4('0x39')]){_0x6120bb[_0x65a4('0x3a')]=[{'all':!![]}];}_0x6120bb=_[_0x65a4('0x36')]({},_0x6120bb,_0x3ece30['options']);return db[_0x65a4('0x25')][_0x65a4('0x3f')](_0x6120bb)[_0x65a4('0x1e')](handleEntityNotFound(_0x2ba3e2,null))[_0x65a4('0x1e')](respondWithResult(_0x2ba3e2,null))[_0x65a4('0x3c')](handleError(_0x2ba3e2,null));};exports[_0x65a4('0x40')]=function(_0x53f401,_0x5bcd2b){return db[_0x65a4('0x25')][_0x65a4('0x40')](_0x53f401[_0x65a4('0x41')],{})[_0x65a4('0x1e')](respondWithResult(_0x5bcd2b,0xc9))[_0x65a4('0x3c')](handleError(_0x5bcd2b,null));};exports[_0x65a4('0x1d')]=function(_0x4d0246,_0x470ba2){if(_0x4d0246[_0x65a4('0x41')]['id']){delete _0x4d0246['body']['id'];}return db[_0x65a4('0x25')][_0x65a4('0x3f')]({'where':{'id':_0x4d0246['params']['id']}})[_0x65a4('0x1e')](handleEntityNotFound(_0x470ba2,null))['then'](saveUpdates(_0x4d0246[_0x65a4('0x41')],null))[_0x65a4('0x1e')](respondWithResult(_0x470ba2,null))[_0x65a4('0x3c')](handleError(_0x470ba2,null));};exports['destroy']=function(_0x26ac27,_0x138c78){return db[_0x65a4('0x25')][_0x65a4('0x3f')]({'where':{'id':_0x26ac27['params']['id']}})[_0x65a4('0x1e')](handleEntityNotFound(_0x138c78,null))['then'](removeEntity(_0x138c78,null))[_0x65a4('0x3c')](handleError(_0x138c78,null));};exports['describe']=function(_0x29d5cd,_0x5cce29){return db['UserProfileSection']['describe']()[_0x65a4('0x1e')](respondWithResult(_0x5cce29,null))[_0x65a4('0x3c')](handleError(_0x5cce29,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 59a68e6..3d2b173 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 _0x0796=['rimraf','../../config/environment','./userProfileSection.attributes','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0796,0x12d));var _0x6079=function(_0x2bfb66,_0x349ce7){_0x2bfb66=_0x2bfb66-0x0;var _0x163720=_0x0796[_0x2bfb66];return _0x163720;};'use strict';var _=require(_0x6079('0x0'));var util=require(_0x6079('0x1'));var logger=require(_0x6079('0x2'))(_0x6079('0x3'));var moment=require(_0x6079('0x4'));var BPromise=require('bluebird');var rp=require(_0x6079('0x5'));var fs=require('fs');var path=require(_0x6079('0x6'));var rimraf=require(_0x6079('0x7'));var config=require(_0x6079('0x8'));var attributes=require(_0x6079('0x9'));module['exports']=function(_0x54b544,_0x57d727){return _0x54b544['define']('UserProfileSection',attributes,{'tableName':_0x6079('0xa'),'paranoid':![],'indexes':[{'name':_0x6079('0xb'),'fields':[_0x6079('0xc'),_0x6079('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0036=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0xe25556,_0x5d2e45){var _0x184848=function(_0x5afa6d){while(--_0x5afa6d){_0xe25556['push'](_0xe25556['shift']());}};_0x184848(++_0x5d2e45);}(_0x0036,0x73));var _0x6003=function(_0x3c472a,_0xbe009d){_0x3c472a=_0x3c472a-0x0;var _0x25f0c2=_0x0036[_0x3c472a];return _0x25f0c2;};'use strict';var _=require(_0x6003('0x0'));var util=require(_0x6003('0x1'));var logger=require(_0x6003('0x2'))(_0x6003('0x3'));var moment=require(_0x6003('0x4'));var BPromise=require(_0x6003('0x5'));var rp=require(_0x6003('0x6'));var fs=require('fs');var path=require(_0x6003('0x7'));var rimraf=require(_0x6003('0x8'));var config=require(_0x6003('0x9'));var attributes=require(_0x6003('0xa'));module[_0x6003('0xb')]=function(_0x159d55,_0x23976c){return _0x159d55[_0x6003('0xc')]('UserProfileSection',attributes,{'tableName':_0x6003('0xd'),'paranoid':![],'indexes':[{'name':_0x6003('0xe'),'fields':[_0x6003('0xf'),_0x6003('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 90843d9..33ea6ae 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 _0x3fe9=['UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x541e85,_0x3fe914){var _0x511538=function(_0x203147){while(--_0x203147){_0x541e85['push'](_0x541e85['shift']());}};_0x511538(++_0x3fe914);}(_0x3fe9,0x106));var _0x93fe=function(_0xbe5a07,_0x37067a){_0xbe5a07=_0xbe5a07-0x0;var _0x17928a=_0x3fe9[_0xbe5a07];return _0x17928a;};'use strict';var _=require(_0x93fe('0x0'));var util=require(_0x93fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x93fe('0x2'));var fs=require('fs');var Redis=require(_0x93fe('0x3'));var db=require(_0x93fe('0x4'))['db'];var utils=require(_0x93fe('0x5'));var logger=require('../../config/logger')(_0x93fe('0x6'));var config=require(_0x93fe('0x7'));var jayson=require(_0x93fe('0x8'));var client=jayson[_0x93fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7195,_0x40b7d3,_0x148776){return new BPromise(function(_0x34cd8a,_0x4fc055){return client[_0x93fe('0xa')](_0x3f7195,_0x148776)['then'](function(_0x5b0b5d){logger['info'](_0x93fe('0xb'),_0x40b7d3,_0x93fe('0xc'));logger[_0x93fe('0xd')](_0x93fe('0xe'),_0x40b7d3,_0x93fe('0xc'),JSON['stringify'](_0x5b0b5d));if(_0x5b0b5d[_0x93fe('0xf')]){if(_0x5b0b5d[_0x93fe('0xf')][_0x93fe('0x10')]===0x1f4){logger[_0x93fe('0xf')](_0x93fe('0xb'),_0x40b7d3,_0x5b0b5d['error'][_0x93fe('0x11')]);return _0x4fc055(_0x5b0b5d[_0x93fe('0xf')][_0x93fe('0x11')]);}logger[_0x93fe('0xf')](_0x93fe('0xb'),_0x40b7d3,_0x5b0b5d['error'][_0x93fe('0x11')]);return _0x34cd8a(_0x5b0b5d['error'][_0x93fe('0x11')]);}else{logger[_0x93fe('0x12')](_0x93fe('0xb'),_0x40b7d3,'request\x20sent');_0x34cd8a(_0x5b0b5d[_0x93fe('0x13')][_0x93fe('0x11')]);}})[_0x93fe('0x14')](function(_0x268508){logger[_0x93fe('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x40b7d3,_0x268508);_0x4fc055(_0x268508);});});} \ No newline at end of file +var _0x648f=['debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent'];(function(_0x473ada,_0x42dde3){var _0x15bd2d=function(_0x1b3cb7){while(--_0x1b3cb7){_0x473ada['push'](_0x473ada['shift']());}};_0x15bd2d(++_0x42dde3);}(_0x648f,0xdf));var _0xf648=function(_0x2e9da9,_0x4e877a){_0x2e9da9=_0x2e9da9-0x0;var _0x264d3f=_0x648f[_0x2e9da9];return _0x264d3f;};'use strict';var _=require(_0xf648('0x0'));var util=require(_0xf648('0x1'));var moment=require(_0xf648('0x2'));var BPromise=require('bluebird');var rs=require(_0xf648('0x3'));var fs=require('fs');var Redis=require(_0xf648('0x4'));var db=require(_0xf648('0x5'))['db'];var utils=require(_0xf648('0x6'));var logger=require('../../config/logger')(_0xf648('0x7'));var config=require(_0xf648('0x8'));var jayson=require(_0xf648('0x9'));var client=jayson[_0xf648('0xa')][_0xf648('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x532c16,_0x4c21e9,_0x493909){return new BPromise(function(_0x281e7e,_0xca382e){return client[_0xf648('0xc')](_0x532c16,_0x493909)[_0xf648('0xd')](function(_0x57439c){logger[_0xf648('0xe')](_0xf648('0xf'),_0x4c21e9,_0xf648('0x10'));logger[_0xf648('0x11')](_0xf648('0x12'),_0x4c21e9,_0xf648('0x10'),JSON[_0xf648('0x13')](_0x57439c));if(_0x57439c['error']){if(_0x57439c[_0xf648('0x14')][_0xf648('0x15')]===0x1f4){logger[_0xf648('0x14')](_0xf648('0xf'),_0x4c21e9,_0x57439c[_0xf648('0x14')][_0xf648('0x16')]);return _0xca382e(_0x57439c[_0xf648('0x14')][_0xf648('0x16')]);}logger[_0xf648('0x14')](_0xf648('0xf'),_0x4c21e9,_0x57439c[_0xf648('0x14')][_0xf648('0x16')]);return _0x281e7e(_0x57439c['error'][_0xf648('0x16')]);}else{logger['info'](_0xf648('0xf'),_0x4c21e9,'request\x20sent');_0x281e7e(_0x57439c[_0xf648('0x17')][_0xf648('0x16')]);}})['catch'](function(_0x5506f4){logger[_0xf648('0x14')](_0xf648('0xf'),_0x4c21e9,_0x5506f4);_0xca382e(_0x5506f4);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index a28a1c0..4f8154f 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 _0x24e9=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','path'];(function(_0x168617,_0x2f9d8c){var _0x4094ae=function(_0x782b5a){while(--_0x782b5a){_0x168617['push'](_0x168617['shift']());}};_0x4094ae(++_0x2f9d8c);}(_0x24e9,0x85));var _0x924e=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x24e9[_0x22f8ab];return _0x2a70e5;};'use strict';var multer=require(_0x924e('0x0'));var util=require('util');var path=require(_0x924e('0x1'));var timeout=require(_0x924e('0x2'));var express=require(_0x924e('0x3'));var router=express[_0x924e('0x4')]();var fs_extra=require(_0x924e('0x5'));var auth=require(_0x924e('0x6'));var interaction=require(_0x924e('0x7'));var config=require(_0x924e('0x8'));module['exports']=router; \ No newline at end of file +var _0x9e63=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x34782e,_0x2aa2f1){var _0x247288=function(_0x4e1729){while(--_0x4e1729){_0x34782e['push'](_0x34782e['shift']());}};_0x247288(++_0x2aa2f1);}(_0x9e63,0x65));var _0x39e6=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x9e63[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x39e6('0x0'));var util=require(_0x39e6('0x1'));var path=require(_0x39e6('0x2'));var timeout=require('connect-timeout');var express=require(_0x39e6('0x3'));var router=express[_0x39e6('0x4')]();var fs_extra=require(_0x39e6('0x5'));var auth=require(_0x39e6('0x6'));var interaction=require(_0x39e6('0x7'));var config=require(_0x39e6('0x8'));module[_0x39e6('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index b7cb5f5..226bd22 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 _0xbaf0=['exports','INTEGER'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x5c6189,_0x5875f4){var _0xad0917=function(_0x5a91fa){while(--_0x5a91fa){_0x5c6189['push'](_0x5c6189['shift']());}};_0xad0917(++_0x5875f4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'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 9b6ba80..689106f 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 _0x7e51=['lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues'];(function(_0x227650,_0x362bfa){var _0x331f07=function(_0x25da2d){while(--_0x25da2d){_0x227650['push'](_0x227650['shift']());}};_0x331f07(++_0x362bfa);}(_0x7e51,0xe7));var _0x17e5=function(_0x34db14,_0x55cf34){_0x34db14=_0x34db14-0x0;var _0x225b1a=_0x7e51[_0x34db14];return _0x225b1a;};'use strict';var _=require(_0x17e5('0x0'));var util=require(_0x17e5('0x1'));var logger=require(_0x17e5('0x2'))(_0x17e5('0x3'));var moment=require('moment');var BPromise=require(_0x17e5('0x4'));var rp=require(_0x17e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x17e5('0x6'));var attributes=require(_0x17e5('0x7'));module[_0x17e5('0x8')]=function(_0x345739,_0x30a815){return _0x345739[_0x17e5('0x9')]('UserSmsQueue',attributes,{'tableName':_0x17e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe231=['exports','define','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','./userSmsQueue.attributes'];(function(_0x4e41c8,_0x49fcd){var _0x3ea219=function(_0x4ace7e){while(--_0x4ace7e){_0x4e41c8['push'](_0x4e41c8['shift']());}};_0x3ea219(++_0x49fcd);}(_0xe231,0x11b));var _0x1e23=function(_0x59ee41,_0xaf7db8){_0x59ee41=_0x59ee41-0x0;var _0x3ecd3e=_0xe231[_0x59ee41];return _0x3ecd3e;};'use strict';var _=require(_0x1e23('0x0'));var util=require('util');var logger=require(_0x1e23('0x1'))(_0x1e23('0x2'));var moment=require(_0x1e23('0x3'));var BPromise=require(_0x1e23('0x4'));var rp=require(_0x1e23('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1e23('0x6'));module[_0x1e23('0x7')]=function(_0x333234,_0x41b578){return _0x333234[_0x1e23('0x8')]('UserSmsQueue',attributes,{'tableName':_0x1e23('0x9'),'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 e8576b5..164966e 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 _0x080f=['request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','UserSmsQueue,\x20%s,\x20%s'];(function(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0x080f,0x134));var _0xf080=function(_0x5e6dd0,_0x3aa201){_0x5e6dd0=_0x5e6dd0-0x0;var _0x5d4d3b=_0x080f[_0x5e6dd0];return _0x5d4d3b;};'use strict';var _=require(_0xf080('0x0'));var util=require(_0xf080('0x1'));var moment=require(_0xf080('0x2'));var BPromise=require(_0xf080('0x3'));var rs=require(_0xf080('0x4'));var fs=require('fs');var Redis=require(_0xf080('0x5'));var db=require(_0xf080('0x6'))['db'];var utils=require(_0xf080('0x7'));var logger=require('../../config/logger')(_0xf080('0x8'));var config=require(_0xf080('0x9'));var jayson=require(_0xf080('0xa'));var client=jayson['client'][_0xf080('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48f39c,_0x5bef28,_0x4c0728){return new BPromise(function(_0x270134,_0xd47064){return client[_0xf080('0xc')](_0x48f39c,_0x4c0728)['then'](function(_0x31757f){logger['info'](_0xf080('0xd'),_0x5bef28,_0xf080('0xe'));logger[_0xf080('0xf')](_0xf080('0x10'),_0x5bef28,'request\x20sent',JSON[_0xf080('0x11')](_0x31757f));if(_0x31757f['error']){if(_0x31757f['error'][_0xf080('0x12')]===0x1f4){logger[_0xf080('0x13')](_0xf080('0xd'),_0x5bef28,_0x31757f['error'][_0xf080('0x14')]);return _0xd47064(_0x31757f[_0xf080('0x13')][_0xf080('0x14')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x5bef28,_0x31757f[_0xf080('0x13')]['message']);return _0x270134(_0x31757f[_0xf080('0x13')][_0xf080('0x14')]);}else{logger[_0xf080('0x15')](_0xf080('0xd'),_0x5bef28,_0xf080('0xe'));_0x270134(_0x31757f['result'][_0xf080('0x14')]);}})[_0xf080('0x16')](function(_0x142eeb){logger[_0xf080('0x13')](_0xf080('0xd'),_0x5bef28,_0x142eeb);_0xd47064(_0x142eeb);});});} \ No newline at end of file +var _0xf06b=['catch','util','bluebird','../../config/logger','../../config/environment','jayson/promise','http','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3219cf,_0x140739){var _0x10f4a6=function(_0x4efe99){while(--_0x4efe99){_0x3219cf['push'](_0x3219cf['shift']());}};_0x10f4a6(++_0x140739);}(_0xf06b,0xab));var _0xbf06=function(_0x5960ac,_0x481c64){_0x5960ac=_0x5960ac-0x0;var _0x456f4b=_0xf06b[_0x5960ac];return _0x456f4b;};'use strict';var _=require('lodash');var util=require(_0xbf06('0x0'));var moment=require('moment');var BPromise=require(_0xbf06('0x1'));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(_0xbf06('0x2'))('rpc');var config=require(_0xbf06('0x3'));var jayson=require(_0xbf06('0x4'));var client=jayson['client'][_0xbf06('0x5')]({'port':0x232a});function respondWithRpcPromise(_0xb09880,_0x153478,_0x3829f2){return new BPromise(function(_0x195291,_0x4cbde6){return client['request'](_0xb09880,_0x3829f2)['then'](function(_0x48d7af){logger[_0xbf06('0x6')](_0xbf06('0x7'),_0x153478,_0xbf06('0x8'));logger[_0xbf06('0x9')](_0xbf06('0xa'),_0x153478,'request\x20sent',JSON[_0xbf06('0xb')](_0x48d7af));if(_0x48d7af[_0xbf06('0xc')]){if(_0x48d7af[_0xbf06('0xc')][_0xbf06('0xd')]===0x1f4){logger[_0xbf06('0xc')](_0xbf06('0x7'),_0x153478,_0x48d7af['error'][_0xbf06('0xe')]);return _0x4cbde6(_0x48d7af['error'][_0xbf06('0xe')]);}logger['error'](_0xbf06('0x7'),_0x153478,_0x48d7af['error']['message']);return _0x195291(_0x48d7af[_0xbf06('0xc')][_0xbf06('0xe')]);}else{logger[_0xbf06('0x6')](_0xbf06('0x7'),_0x153478,_0xbf06('0x8'));_0x195291(_0x48d7af[_0xbf06('0xf')][_0xbf06('0xe')]);}})[_0xbf06('0x10')](function(_0x41e847){logger['error'](_0xbf06('0x7'),_0x153478,_0x41e847);_0x4cbde6(_0x41e847);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 3d01525..84ac999 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 _0x2f3a=['../../components/auth/service','../../components/interaction/service','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x400197,_0x2a3028){var _0x1680e4=function(_0x3e7b82){while(--_0x3e7b82){_0x400197['push'](_0x400197['shift']());}};_0x1680e4(++_0x2a3028);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x1b2cf0,_0x3e1559){_0x1b2cf0=_0x1b2cf0-0x0;var _0x566935=_0x2f3a[_0x1b2cf0];return _0x566935;};'use strict';var multer=require(_0xa2f3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa2f3('0x1'));var express=require(_0xa2f3('0x2'));var router=express[_0xa2f3('0x3')]();var fs_extra=require(_0xa2f3('0x4'));var auth=require(_0xa2f3('0x5'));var interaction=require(_0xa2f3('0x6'));var config=require('../../config/environment');module[_0xa2f3('0x7')]=router; \ No newline at end of file +var _0xa03c=['fs-extra','../../components/auth/service','../../components/interaction/service','exports','multer','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa03c,0x94));var _0xca03=function(_0x3a2269,_0x3ef598){_0x3a2269=_0x3a2269-0x0;var _0x34b10b=_0xa03c[_0x3a2269];return _0x34b10b;};'use strict';var multer=require(_0xca03('0x0'));var util=require('util');var path=require(_0xca03('0x1'));var timeout=require(_0xca03('0x2'));var express=require(_0xca03('0x3'));var router=express['Router']();var fs_extra=require(_0xca03('0x4'));var auth=require(_0xca03('0x5'));var interaction=require(_0xca03('0x6'));var config=require('../../config/environment');module[_0xca03('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 4f3cc65..3bc672a 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 _0xbaf0=['exports','INTEGER'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x54e37e,_0x3231a7){var _0x1f9a35=function(_0x4481dc){while(--_0x4481dc){_0x54e37e['push'](_0x54e37e['shift']());}};_0x1f9a35(++_0x3231a7);}(_0xe706,0xa3));var _0x6e70=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0xe706[_0x2c1114];return _0x2b877c;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('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 ff78eca..fa9a9d5 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 _0xeec6=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2986e9,_0x469d4f){var _0x2e90a4=function(_0x4c0052){while(--_0x4c0052){_0x2986e9['push'](_0x2986e9['shift']());}};_0x2e90a4(++_0x469d4f);}(_0xeec6,0x1c2));var _0x6eec=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0xeec6[_0x45346d];return _0x5ce7ca;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var logger=require(_0x6eec('0x2'))(_0x6eec('0x3'));var moment=require('moment');var BPromise=require(_0x6eec('0x4'));var rp=require(_0x6eec('0x5'));var fs=require('fs');var path=require(_0x6eec('0x6'));var rimraf=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var attributes=require(_0x6eec('0x9'));module['exports']=function(_0x185f31,_0x3c6eda){return _0x185f31['define'](_0x6eec('0xa'),attributes,{'tableName':_0x6eec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa630=['define','UserVoiceQueue','user_has_voice_queues','lodash','util','moment','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa630,0xbe));var _0x0a63=function(_0x251ff8,_0x5ba673){_0x251ff8=_0x251ff8-0x0;var _0x2b0e62=_0xa630[_0x251ff8];return _0x2b0e62;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a63('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var attributes=require(_0x0a63('0x6'));module[_0x0a63('0x7')]=function(_0x37b4c9,_0x4b7474){return _0x37b4c9[_0x0a63('0x8')](_0x0a63('0x9'),attributes,{'tableName':_0x0a63('0xa'),'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 989795f..373f235 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 _0xa960=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xc4cfef,_0x4b6935){var _0x5bd14f=function(_0x14a3d3){while(--_0x14a3d3){_0xc4cfef['push'](_0xc4cfef['shift']());}};_0x5bd14f(++_0x4b6935);}(_0xa960,0xd3));var _0x0a96=function(_0x1bffb9,_0xe64b3e){_0x1bffb9=_0x1bffb9-0x0;var _0x1cbe8a=_0xa960[_0x1bffb9];return _0x1cbe8a;};'use strict';var _=require(_0x0a96('0x0'));var util=require(_0x0a96('0x1'));var moment=require(_0x0a96('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a96('0x3'));var fs=require('fs');var Redis=require(_0x0a96('0x4'));var db=require(_0x0a96('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a96('0x6'))('rpc');var config=require(_0x0a96('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0a96('0x8')][_0x0a96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1850da,_0x1a75d5,_0xb6166a){return new BPromise(function(_0x2837c3,_0x3b7e10){return client[_0x0a96('0xa')](_0x1850da,_0xb6166a)[_0x0a96('0xb')](function(_0x1e7ac6){logger[_0x0a96('0xc')](_0x0a96('0xd'),_0x1a75d5,'request\x20sent');logger[_0x0a96('0xe')](_0x0a96('0xf'),_0x1a75d5,_0x0a96('0x10'),JSON[_0x0a96('0x11')](_0x1e7ac6));if(_0x1e7ac6[_0x0a96('0x12')]){if(_0x1e7ac6['error'][_0x0a96('0x13')]===0x1f4){logger[_0x0a96('0x12')](_0x0a96('0xd'),_0x1a75d5,_0x1e7ac6[_0x0a96('0x12')]['message']);return _0x3b7e10(_0x1e7ac6[_0x0a96('0x12')][_0x0a96('0x14')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x1a75d5,_0x1e7ac6[_0x0a96('0x12')][_0x0a96('0x14')]);return _0x2837c3(_0x1e7ac6[_0x0a96('0x12')][_0x0a96('0x14')]);}else{logger[_0x0a96('0xc')](_0x0a96('0xd'),_0x1a75d5,_0x0a96('0x10'));_0x2837c3(_0x1e7ac6[_0x0a96('0x15')][_0x0a96('0x14')]);}})[_0x0a96('0x16')](function(_0x402282){logger[_0x0a96('0x12')](_0x0a96('0xd'),_0x1a75d5,_0x402282);_0x3b7e10(_0x402282);});});} \ No newline at end of file +var _0xf03f=['code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14525d,_0x747b83){var _0x26b05c=function(_0xf98e52){while(--_0xf98e52){_0x14525d['push'](_0x14525d['shift']());}};_0x26b05c(++_0x747b83);}(_0xf03f,0x194));var _0xff03=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0xf03f[_0x4063a4];return _0x17908d;};'use strict';var _=require(_0xff03('0x0'));var util=require(_0xff03('0x1'));var moment=require(_0xff03('0x2'));var BPromise=require(_0xff03('0x3'));var rs=require(_0xff03('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff03('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xff03('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xff03('0x7'));var client=jayson[_0xff03('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10314a,_0x697859,_0x26697e){return new BPromise(function(_0x5e72d4,_0x59b8c1){return client[_0xff03('0x9')](_0x10314a,_0x26697e)[_0xff03('0xa')](function(_0x5300c7){logger[_0xff03('0xb')](_0xff03('0xc'),_0x697859,_0xff03('0xd'));logger['debug'](_0xff03('0xe'),_0x697859,_0xff03('0xd'),JSON[_0xff03('0xf')](_0x5300c7));if(_0x5300c7['error']){if(_0x5300c7['error'][_0xff03('0x10')]===0x1f4){logger[_0xff03('0x11')](_0xff03('0xc'),_0x697859,_0x5300c7[_0xff03('0x11')][_0xff03('0x12')]);return _0x59b8c1(_0x5300c7['error'][_0xff03('0x12')]);}logger[_0xff03('0x11')](_0xff03('0xc'),_0x697859,_0x5300c7[_0xff03('0x11')][_0xff03('0x12')]);return _0x5e72d4(_0x5300c7[_0xff03('0x11')]['message']);}else{logger[_0xff03('0xb')](_0xff03('0xc'),_0x697859,_0xff03('0xd'));_0x5e72d4(_0x5300c7[_0xff03('0x13')][_0xff03('0x12')]);}})[_0xff03('0x14')](function(_0x4e67aa){logger['error'](_0xff03('0xc'),_0x697859,_0x4e67aa);_0x59b8c1(_0x4e67aa);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 925b332..fd6c048 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 _0xc2e8=['multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2b6257,_0x5bd6e0){var _0x5ceb44=function(_0x40def5){while(--_0x40def5){_0x2b6257['push'](_0x2b6257['shift']());}};_0x5ceb44(++_0x5bd6e0);}(_0xc2e8,0x70));var _0x8c2e=function(_0x4f2b44,_0xb210ed){_0x4f2b44=_0x4f2b44-0x0;var _0x3d64fe=_0xc2e8[_0x4f2b44];return _0x3d64fe;};'use strict';var multer=require(_0x8c2e('0x0'));var util=require(_0x8c2e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8c2e('0x2'));var router=express['Router']();var fs_extra=require(_0x8c2e('0x3'));var auth=require(_0x8c2e('0x4'));var interaction=require(_0x8c2e('0x5'));var config=require('../../config/environment');module[_0x8c2e('0x6')]=router; \ No newline at end of file +var _0x6cb4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports','multer','util','path','connect-timeout','express'];(function(_0x133f07,_0x5e6d19){var _0x4761a3=function(_0x3daee5){while(--_0x3daee5){_0x133f07['push'](_0x133f07['shift']());}};_0x4761a3(++_0x5e6d19);}(_0x6cb4,0xff));var _0x46cb=function(_0x45a7db,_0x7fa07a){_0x45a7db=_0x45a7db-0x0;var _0x3b9230=_0x6cb4[_0x45a7db];return _0x3b9230;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var fs_extra=require(_0x46cb('0x6'));var auth=require(_0x46cb('0x7'));var interaction=require(_0x46cb('0x8'));var config=require('../../config/environment');module[_0x46cb('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index ab428af..e458c6b 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 _0x0773=['Required\x20by\x20Asterisk','STRING','queue_interface','INTEGER'];(function(_0x37b529,_0x6724e7){var _0x116152=function(_0x36d367){while(--_0x36d367){_0x37b529['push'](_0x37b529['shift']());}};_0x116152(++_0x6724e7);}(_0x0773,0x1c7));var _0x3077=function(_0xad15b6,_0x48e317){_0xad15b6=_0xad15b6-0x0;var _0x2adf11=_0x0773[_0xad15b6];return _0x2adf11;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3077('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x3077('0x1')},'membername':{'type':Sequelize[_0x3077('0x2')],'allowNull':![],'comment':_0x3077('0x1')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x3077('0x2')],'allowNull':![],'unique':_0x3077('0x3'),'comment':_0x3077('0x1')},'VoiceQueueId':{'type':Sequelize[_0x3077('0x0')],'allowNull':![]},'interface':{'type':Sequelize[_0x3077('0x2')],'allowNull':![],'unique':_0x3077('0x3'),'comment':_0x3077('0x1')},'penalty':{'type':Sequelize[_0x3077('0x0')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x3077('0x0')](0xb),'defaultValue':0x0,'comment':_0x3077('0x1')}}; \ No newline at end of file +var _0xa74f=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xa74f,0xed));var _0xfa74=function(_0x4d7379,_0x4b4e63){_0x4d7379=_0x4d7379-0x0;var _0x46d7cf=_0xa74f[_0x4d7379];return _0x46d7cf;};'use strict';var Sequelize=require(_0xfa74('0x0'));module[_0xfa74('0x1')]={'uniqueid':{'type':Sequelize[_0xfa74('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xfa74('0x3')},'membername':{'type':Sequelize[_0xfa74('0x4')],'allowNull':![],'comment':_0xfa74('0x3')},'UserId':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfa74('0x5'),'comment':_0xfa74('0x3')},'VoiceQueueId':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xfa74('0x4')],'allowNull':![],'unique':_0xfa74('0x5'),'comment':_0xfa74('0x3')},'penalty':{'type':Sequelize[_0xfa74('0x2')](0xb),'defaultValue':0x0,'comment':_0xfa74('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xfa74('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index ab4ef4f..9b6a1e3 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 _0x86dc=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86dc,0x1da));var _0xc86d=function(_0x1259ae,_0x21837a){_0x1259ae=_0x1259ae-0x0;var _0x4e972b=_0x86dc[_0x1259ae];return _0x4e972b;};'use strict';var EventEmitter=require(_0xc86d('0x0'));var UserVoiceQueueRt=require(_0xc86d('0x1'))['db'][_0xc86d('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xc86d('0x3')](0x0);var events={'afterCreate':_0xc86d('0x4'),'afterUpdate':_0xc86d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x24efad){return function(_0xd2e463,_0xd87e21,_0x15eeb9){UserVoiceQueueRtEvents[_0xc86d('0x6')](_0x24efad+':'+_0xd2e463['id'],_0xd2e463);UserVoiceQueueRtEvents[_0xc86d('0x6')](_0x24efad,_0xd2e463);_0x15eeb9(null);};}for(var e in events){if(events[_0xc86d('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xc86d('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x753e=['update','remove','emit','hasOwnProperty','../../mysqldb','UserVoiceQueueRt','save'];(function(_0x449e1f,_0x189fbf){var _0xaa6438=function(_0x3be435){while(--_0x3be435){_0x449e1f['push'](_0x449e1f['shift']());}};_0xaa6438(++_0x189fbf);}(_0x753e,0xeb));var _0xe753=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x753e[_0xaa0309];return _0x5de7ce;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xe753('0x0'))['db'][_0xe753('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe753('0x2'),'afterUpdate':_0xe753('0x3'),'afterDestroy':_0xe753('0x4')};function emitEvent(_0x388aa2){return function(_0x523831,_0x28a4a7,_0x126299){UserVoiceQueueRtEvents[_0xe753('0x5')](_0x388aa2+':'+_0x523831['id'],_0x523831);UserVoiceQueueRtEvents[_0xe753('0x5')](_0x388aa2,_0x523831);_0x126299(null);};}for(var e in events){if(events[_0xe753('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](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 20ccbce..79a1805 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 _0x1f46=['bluebird','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment'];(function(_0x296a40,_0xa725d1){var _0x409185=function(_0x466a1e){while(--_0x466a1e){_0x296a40['push'](_0x296a40['shift']());}};_0x409185(++_0xa725d1);}(_0x1f46,0x1d4));var _0x61f4=function(_0x525609,_0x1bfcd9){_0x525609=_0x525609-0x0;var _0x3f991e=_0x1f46[_0x525609];return _0x3f991e;};'use strict';var _=require(_0x61f4('0x0'));var util=require(_0x61f4('0x1'));var logger=require(_0x61f4('0x2'))(_0x61f4('0x3'));var moment=require(_0x61f4('0x4'));var BPromise=require(_0x61f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x61f4('0x6'));var config=require(_0x61f4('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x61f4('0x8')]=function(_0x56a993,_0x4b03ee){return _0x56a993[_0x61f4('0x9')](_0x61f4('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb877=['moment','bluebird','path','rimraf','../../config/environment','define','UserVoiceQueueRt','lodash','util','../../config/logger'];(function(_0x4c29f9,_0x5bddd4){var _0x4e17b8=function(_0x12e055){while(--_0x12e055){_0x4c29f9['push'](_0x4c29f9['shift']());}};_0x4e17b8(++_0x5bddd4);}(_0xb877,0x13d));var _0x7b87=function(_0x1ec4d0,_0x3f2b34){_0x1ec4d0=_0x1ec4d0-0x0;var _0x205536=_0xb877[_0x1ec4d0];return _0x205536;};'use strict';var _=require(_0x7b87('0x0'));var util=require(_0x7b87('0x1'));var logger=require(_0x7b87('0x2'))('api');var moment=require(_0x7b87('0x3'));var BPromise=require(_0x7b87('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b87('0x5'));var rimraf=require(_0x7b87('0x6'));var config=require(_0x7b87('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x5099cd,_0x2bbfa2){return _0x5099cd[_0x7b87('0x8')](_0x7b87('0x9'),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 94dce0a..c38097a 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 _0xbd5d=['error','code','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','then','GetVoiceQueueRtPauses','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x23c5cb,_0xfbaea6){var _0x48d3f1=function(_0x13576d){while(--_0x13576d){_0x23c5cb['push'](_0x23c5cb['shift']());}};_0x48d3f1(++_0xfbaea6);}(_0xbd5d,0x1d7));var _0xdbd5=function(_0x13e132,_0x165c6d){_0x13e132=_0x13e132-0x0;var _0x1e295d=_0xbd5d[_0x13e132];return _0x1e295d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdbd5('0x0'));var BPromise=require(_0xdbd5('0x1'));var rs=require(_0xdbd5('0x2'));var fs=require('fs');var Redis=require(_0xdbd5('0x3'));var db=require(_0xdbd5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdbd5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdbd5('0x6')]['http']({'port':0x232a});config[_0xdbd5('0x7')]=_[_0xdbd5('0x8')](config['redis'],{'host':_0xdbd5('0x9'),'port':0x18eb});var socket=require(_0xdbd5('0xa'))(new Redis(config[_0xdbd5('0x7')]));require(_0xdbd5('0xb'))['register'](socket);function respondWithRpcPromise(_0x3c9fe7,_0x2252b9,_0x3f068d){return new BPromise(function(_0x59befb,_0x21f02d){return client[_0xdbd5('0xc')](_0x3c9fe7,_0x3f068d)['then'](function(_0x2ea470){logger[_0xdbd5('0xd')](_0xdbd5('0xe'),_0x2252b9,_0xdbd5('0xf'));logger[_0xdbd5('0x10')](_0xdbd5('0x11'),_0x2252b9,_0xdbd5('0xf'),JSON[_0xdbd5('0x12')](_0x2ea470));if(_0x2ea470[_0xdbd5('0x13')]){if(_0x2ea470[_0xdbd5('0x13')][_0xdbd5('0x14')]===0x1f4){logger[_0xdbd5('0x13')](_0xdbd5('0xe'),_0x2252b9,_0x2ea470[_0xdbd5('0x13')][_0xdbd5('0x15')]);return _0x21f02d(_0x2ea470[_0xdbd5('0x13')][_0xdbd5('0x15')]);}logger['error'](_0xdbd5('0xe'),_0x2252b9,_0x2ea470[_0xdbd5('0x13')][_0xdbd5('0x15')]);return _0x59befb(_0x2ea470['error'][_0xdbd5('0x15')]);}else{logger[_0xdbd5('0xd')](_0xdbd5('0xe'),_0x2252b9,_0xdbd5('0xf'));_0x59befb(_0x2ea470[_0xdbd5('0x16')][_0xdbd5('0x15')]);}})[_0xdbd5('0x17')](function(_0x4c8193){logger[_0xdbd5('0x13')](_0xdbd5('0xe'),_0x2252b9,_0x4c8193);_0x21f02d(_0x4c8193);});});}exports['GetVoiceQueueRtPauses']=function(_0x62fd90){var _0x5d980b=this;return new Promise(function(_0x472bf6,_0x134b5b){return db[_0xdbd5('0x18')][_0xdbd5('0x19')]({'raw':_0x62fd90[_0xdbd5('0x1a')]?_0x62fd90[_0xdbd5('0x1a')][_0xdbd5('0x1b')]===undefined?!![]:![]:!![],'where':_0x62fd90['options']?_0x62fd90[_0xdbd5('0x1a')][_0xdbd5('0x1c')]||null:null,'attributes':[[db[_0xdbd5('0x1d')]['fn'](_0xdbd5('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0xdbd5('0x1f')]('`paused`\x20=\x201,\x201,\x20null'))),_0xdbd5('0x20')]]})[_0xdbd5('0x21')](function(_0x5d8def){logger[_0xdbd5('0xd')](_0xdbd5('0x22'),_0x62fd90);logger[_0xdbd5('0x10')](_0xdbd5('0x22'),_0x62fd90,JSON[_0xdbd5('0x12')](_0x5d8def));_0x472bf6(_0x5d8def);})[_0xdbd5('0x17')](function(_0x3f08a2){logger[_0xdbd5('0x13')](_0xdbd5('0x22'),_0x3f08a2[_0xdbd5('0x15')],_0x62fd90);_0x134b5b(_0x5d980b[_0xdbd5('0x13')](0x1f4,_0x3f08a2[_0xdbd5('0x15')]));});});}; \ No newline at end of file +var _0xad50=['debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0xad50,0xf0));var _0x0ad5=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0xad50[_0x17882c];return _0x355a59;};'use strict';var _=require(_0x0ad5('0x0'));var util=require('util');var moment=require(_0x0ad5('0x1'));var BPromise=require(_0x0ad5('0x2'));var rs=require(_0x0ad5('0x3'));var fs=require('fs');var Redis=require(_0x0ad5('0x4'));var db=require(_0x0ad5('0x5'))['db'];var utils=require(_0x0ad5('0x6'));var logger=require('../../config/logger')(_0x0ad5('0x7'));var config=require(_0x0ad5('0x8'));var jayson=require(_0x0ad5('0x9'));var client=jayson[_0x0ad5('0xa')]['http']({'port':0x232a});config[_0x0ad5('0xb')]=_[_0x0ad5('0xc')](config[_0x0ad5('0xb')],{'host':_0x0ad5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0ad5('0xe'))[_0x0ad5('0xf')](socket);function respondWithRpcPromise(_0x4fed94,_0x5b07d5,_0x5d46d6){return new BPromise(function(_0x3fd10c,_0x4c1c77){return client['request'](_0x4fed94,_0x5d46d6)[_0x0ad5('0x10')](function(_0x2f82a2){logger['info'](_0x0ad5('0x11'),_0x5b07d5,_0x0ad5('0x12'));logger[_0x0ad5('0x13')](_0x0ad5('0x14'),_0x5b07d5,_0x0ad5('0x12'),JSON[_0x0ad5('0x15')](_0x2f82a2));if(_0x2f82a2[_0x0ad5('0x16')]){if(_0x2f82a2['error'][_0x0ad5('0x17')]===0x1f4){logger[_0x0ad5('0x16')](_0x0ad5('0x11'),_0x5b07d5,_0x2f82a2[_0x0ad5('0x16')][_0x0ad5('0x18')]);return _0x4c1c77(_0x2f82a2[_0x0ad5('0x16')][_0x0ad5('0x18')]);}logger[_0x0ad5('0x16')](_0x0ad5('0x11'),_0x5b07d5,_0x2f82a2[_0x0ad5('0x16')][_0x0ad5('0x18')]);return _0x3fd10c(_0x2f82a2[_0x0ad5('0x16')][_0x0ad5('0x18')]);}else{logger[_0x0ad5('0x19')](_0x0ad5('0x11'),_0x5b07d5,'request\x20sent');_0x3fd10c(_0x2f82a2[_0x0ad5('0x1a')]['message']);}})[_0x0ad5('0x1b')](function(_0x13923d){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5b07d5,_0x13923d);_0x4c1c77(_0x13923d);});});}exports[_0x0ad5('0x1c')]=function(_0x374b2f){var _0x51fb32=this;return new Promise(function(_0x342516,_0x19ece3){return db[_0x0ad5('0x1d')][_0x0ad5('0x1e')]({'raw':_0x374b2f['options']?_0x374b2f['options']['raw']===undefined?!![]:![]:!![],'where':_0x374b2f['options']?_0x374b2f[_0x0ad5('0x1f')]['where']||null:null,'attributes':[[db[_0x0ad5('0x20')]['fn'](_0x0ad5('0x21'),db['sequelize']['fn']('IF',db[_0x0ad5('0x20')][_0x0ad5('0x22')](_0x0ad5('0x23')))),_0x0ad5('0x24')]]})[_0x0ad5('0x10')](function(_0x4f432c){logger[_0x0ad5('0x19')](_0x0ad5('0x1c'),_0x374b2f);logger['debug'](_0x0ad5('0x1c'),_0x374b2f,JSON['stringify'](_0x4f432c));_0x342516(_0x4f432c);})[_0x0ad5('0x1b')](function(_0x39c06a){logger[_0x0ad5('0x16')](_0x0ad5('0x1c'),_0x39c06a[_0x0ad5('0x18')],_0x374b2f);_0x19ece3(_0x51fb32[_0x0ad5('0x16')](0x1f4,_0x39c06a[_0x0ad5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 3fbfdf9..6f99303 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 _0xfaff=['userVoiceQueueRt:','save','remove','emit','removeListener','register','length'];(function(_0x4f4d19,_0x574245){var _0x27a258=function(_0x38da3e){while(--_0x38da3e){_0x4f4d19['push'](_0x4f4d19['shift']());}};_0x27a258(++_0x574245);}(_0xfaff,0x151));var _0xffaf=function(_0x35c517,_0x240386){_0x35c517=_0x35c517-0x0;var _0x421563=_0xfaff[_0x35c517];return _0x421563;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xffaf('0x0'),_0xffaf('0x1'),'update'];function createListener(_0x46638b,_0x251ca2){return function(_0x1d82dc){_0x251ca2[_0xffaf('0x2')](_0x46638b,_0x1d82dc);};}function removeListener(_0x2cba68,_0x524ab0){return function(){UserVoiceQueueRtEvents[_0xffaf('0x3')](_0x2cba68,_0x524ab0);};}exports[_0xffaf('0x4')]=function(_0x829ef4){for(var _0x1514ce=0x0,_0x155466=events[_0xffaf('0x5')];_0x1514ce<_0x155466;_0x1514ce++){var _0x2b549a=events[_0x1514ce];var _0x32a5f1=createListener(_0xffaf('0x6')+_0x2b549a,_0x829ef4);UserVoiceQueueRtEvents['on'](_0x2b549a,_0x32a5f1);}}; \ No newline at end of file +var _0xc2e3=['emit','removeListener','length','userVoiceQueueRt:','save','remove'];(function(_0xb67345,_0x5e31d2){var _0x95e0b2=function(_0x52dd2f){while(--_0x52dd2f){_0xb67345['push'](_0xb67345['shift']());}};_0x95e0b2(++_0x5e31d2);}(_0xc2e3,0x82));var _0x3c2e=function(_0x3b5238,_0x31b3d2){_0x3b5238=_0x3b5238-0x0;var _0x4edf8a=_0xc2e3[_0x3b5238];return _0x4edf8a;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x3c2e('0x0'),_0x3c2e('0x1'),'update'];function createListener(_0xa85c5d,_0x431311){return function(_0x126197){_0x431311[_0x3c2e('0x2')](_0xa85c5d,_0x126197);};}function removeListener(_0x37b8bf,_0x469891){return function(){UserVoiceQueueRtEvents[_0x3c2e('0x3')](_0x37b8bf,_0x469891);};}exports['register']=function(_0x407bc0){for(var _0x86d7ed=0x0,_0x801cf7=events[_0x3c2e('0x4')];_0x86d7ed<_0x801cf7;_0x86d7ed++){var _0xef5abf=events[_0x86d7ed];var _0x1141e3=createListener(_0x3c2e('0x5')+_0xef5abf,_0x407bc0);UserVoiceQueueRtEvents['on'](_0xef5abf,_0x1141e3);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index da0f73b..50a0342 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 _0x7e22=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1344de,_0x37fb56){var _0x59bba5=function(_0x3af6ef){while(--_0x3af6ef){_0x1344de['push'](_0x1344de['shift']());}};_0x59bba5(++_0x37fb56);}(_0x7e22,0x1d8));var _0x27e2=function(_0x594392,_0x54a063){_0x594392=_0x594392-0x0;var _0xb4a365=_0x7e22[_0x594392];return _0xb4a365;};'use strict';var multer=require(_0x27e2('0x0'));var util=require('util');var path=require(_0x27e2('0x1'));var timeout=require(_0x27e2('0x2'));var express=require(_0x27e2('0x3'));var router=express[_0x27e2('0x4')]();var fs_extra=require(_0x27e2('0x5'));var auth=require(_0x27e2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x27e2('0x7'));module['exports']=router; \ No newline at end of file +var _0x8286=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x37d4da,_0x4725be){var _0x4521bd=function(_0xe5fb1){while(--_0xe5fb1){_0x37d4da['push'](_0x37d4da['shift']());}};_0x4521bd(++_0x4725be);}(_0x8286,0x66));var _0x6828=function(_0x49427f,_0x4a9225){_0x49427f=_0x49427f-0x0;var _0x1bde0b=_0x8286[_0x49427f];return _0x1bde0b;};'use strict';var multer=require(_0x6828('0x0'));var util=require(_0x6828('0x1'));var path=require(_0x6828('0x2'));var timeout=require(_0x6828('0x3'));var express=require(_0x6828('0x4'));var router=express[_0x6828('0x5')]();var fs_extra=require(_0x6828('0x6'));var auth=require(_0x6828('0x7'));var interaction=require(_0x6828('0x8'));var config=require(_0x6828('0x9'));module[_0x6828('0xa')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index fb6f198..c741fe5 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 _0xbaf0=['exports','INTEGER'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x5c2bef,_0x16806e){var _0xd60cc1=function(_0x40e74a){while(--_0x40e74a){_0x5c2bef['push'](_0x5c2bef['shift']());}};_0xd60cc1(++_0x16806e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('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 521d523..c2476b3 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','lodash','../../config/logger'];(function(_0x4e0eb6,_0x240784){var _0x46e432=function(_0x24b973){while(--_0x24b973){_0x4e0eb6['push'](_0x4e0eb6['shift']());}};_0x46e432(++_0x240784);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f345d,_0x22f2ea){_0x4f345d=_0x4f345d-0x0;var _0x4e75d5=_0xb10b[_0x4f345d];return _0x4e75d5;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('UserWhatsappQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd4f=['exports','define','UserWhatsappQueue','lodash','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x1b9371,_0x404417){_0x1b9371=_0x1b9371-0x0;var _0xe48bb9=_0xdd4f[_0x1b9371];return _0xe48bb9;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfdd4('0x1'));var BPromise=require(_0xfdd4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdd4('0x3'));var rimraf=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var attributes=require('./userWhatsappQueue.attributes');module[_0xfdd4('0x6')]=function(_0x43cbcf,_0x30e080){return _0x43cbcf[_0xfdd4('0x7')](_0xfdd4('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','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 28f7cc4..5aa6fcf 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 _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0x22eed4,_0x5cd292){var _0x7a917f=function(_0x3df406){while(--_0x3df406){_0x22eed4['push'](_0x22eed4['shift']());}};_0x7a917f(++_0x5cd292);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0x5c6557,_0x18c699){var _0x4805c2=function(_0x49fcda){while(--_0x49fcda){_0x5c6557['push'](_0x5c6557['shift']());}};_0x4805c2(++_0x18c699);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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/variable/index.js b/server/api/variable/index.js index 39d7b74..bfabf3b 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 _0xcfd1=['put','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./variable.controller','index','/:id','isAuthenticated','show','post'];(function(_0x338d84,_0x51b9ce){var _0x53b218=function(_0x393df5){while(--_0x393df5){_0x338d84['push'](_0x338d84['shift']());}};_0x53b218(++_0x51b9ce);}(_0xcfd1,0x1d5));var _0x1cfd=function(_0x1ff171,_0x4012af){_0x1ff171=_0x1ff171-0x0;var _0x456656=_0xcfd1[_0x1ff171];return _0x456656;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cfd('0x0'));var timeout=require(_0x1cfd('0x1'));var express=require('express');var router=express[_0x1cfd('0x2')]();var fs_extra=require(_0x1cfd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1cfd('0x4'));var config=require('../../config/environment');var controller=require(_0x1cfd('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x1cfd('0x6')]);router['get'](_0x1cfd('0x7'),auth[_0x1cfd('0x8')](),controller[_0x1cfd('0x9')]);router[_0x1cfd('0xa')]('/',auth[_0x1cfd('0x8')](),controller['create']);router[_0x1cfd('0xb')]('/:id',auth[_0x1cfd('0x8')](),controller[_0x1cfd('0xc')]);router[_0x1cfd('0xd')](_0x1cfd('0x7'),auth[_0x1cfd('0x8')](),controller[_0x1cfd('0xe')]);module['exports']=router; \ No newline at end of file +var _0xa201=['create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','isAuthenticated','get','/:id','show'];(function(_0x2c8356,_0x3fe139){var _0x3caefa=function(_0x15ebfc){while(--_0x15ebfc){_0x2c8356['push'](_0x2c8356['shift']());}};_0x3caefa(++_0x3fe139);}(_0xa201,0x115));var _0x1a20=function(_0x5e492e,_0x54ecec){_0x5e492e=_0x5e492e-0x0;var _0x339e70=_0xa201[_0x5e492e];return _0x339e70;};'use strict';var multer=require('multer');var util=require(_0x1a20('0x0'));var path=require('path');var timeout=require(_0x1a20('0x1'));var express=require(_0x1a20('0x2'));var router=express[_0x1a20('0x3')]();var fs_extra=require(_0x1a20('0x4'));var auth=require(_0x1a20('0x5'));var interaction=require(_0x1a20('0x6'));var config=require('../../config/environment');var controller=require(_0x1a20('0x7'));router['get']('/',auth[_0x1a20('0x8')](),controller['index']);router[_0x1a20('0x9')](_0x1a20('0xa'),auth[_0x1a20('0x8')](),controller[_0x1a20('0xb')]);router['post']('/',auth[_0x1a20('0x8')](),controller[_0x1a20('0xc')]);router[_0x1a20('0xd')](_0x1a20('0xa'),auth[_0x1a20('0x8')](),controller['update']);router[_0x1a20('0xe')]('/:id',auth[_0x1a20('0x8')](),controller[_0x1a20('0xf')]);module[_0x1a20('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index b1525f3..7bd9269 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 _0xf752=['exports','name','STRING','sequelize'];(function(_0x1e9df3,_0x3ec5ea){var _0x4ae252=function(_0x2ac97e){while(--_0x2ac97e){_0x1e9df3['push'](_0x1e9df3['shift']());}};_0x4ae252(++_0x3ec5ea);}(_0xf752,0xef));var _0x2f75=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf752[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x2f75('0x0'));module[_0x2f75('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2f75('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2f75('0x3')]}}; \ No newline at end of file +var _0x0b51=['sequelize','name','STRING'];(function(_0x3a9b24,_0xcc7640){var _0x440802=function(_0x59f567){while(--_0x59f567){_0x3a9b24['push'](_0x3a9b24['shift']());}};_0x440802(++_0xcc7640);}(_0x0b51,0xde));var _0x10b5=function(_0x1a1d50,_0x219068){_0x1a1d50=_0x1a1d50-0x0;var _0x365611=_0x0b51[_0x1a1d50];return _0x365611;};'use strict';var Sequelize=require(_0x10b5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x10b5('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x10b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index d0178ca..dde4276 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 _0x4787=['sort','where','pick','merge','VIRTUAL','options','Variable','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x3adaf2,_0x306b7e){var _0x46960c=function(_0x273ca4){while(--_0x273ca4){_0x3adaf2['push'](_0x3adaf2['shift']());}};_0x46960c(++_0x306b7e);}(_0x4787,0xc7));var _0x7478=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x4787[_0x409353];return _0x4f4b59;};'use strict';var emlformat=require(_0x7478('0x0'));var rimraf=require(_0x7478('0x1'));var zipdir=require(_0x7478('0x2'));var jsonpatch=require(_0x7478('0x3'));var rp=require(_0x7478('0x4'));var moment=require(_0x7478('0x5'));var BPromise=require(_0x7478('0x6'));var Mustache=require(_0x7478('0x7'));var util=require(_0x7478('0x8'));var path=require(_0x7478('0x9'));var sox=require(_0x7478('0xa'));var csv=require(_0x7478('0xb'));var ejs=require(_0x7478('0xc'));var fs=require('fs');var fs_extra=require(_0x7478('0xd'));var _=require(_0x7478('0xe'));var squel=require(_0x7478('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7478('0x10'));var toCsv=require(_0x7478('0xb'));var querystring=require(_0x7478('0x11'));var Papa=require(_0x7478('0x12'));var Redis=require(_0x7478('0x13'));var authService=require(_0x7478('0x14'));var qs=require(_0x7478('0x15'));var as=require(_0x7478('0x16'));var hardwareService=require(_0x7478('0x17'));var logger=require('../../config/logger')(_0x7478('0x18'));var utils=require(_0x7478('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x7478('0x1a'));var db=require(_0x7478('0x1b'))['db'];function respondWithStatusCode(_0x27ccf3,_0x29bab0){_0x29bab0=_0x29bab0||0xcc;return function(_0x49af6d){if(_0x49af6d){return _0x27ccf3[_0x7478('0x1c')](_0x29bab0);}return _0x27ccf3[_0x7478('0x1d')](_0x29bab0)['end']();};}function respondWithResult(_0x318a2b,_0x101224){_0x101224=_0x101224||0xc8;return function(_0x2570bd){if(_0x2570bd){return _0x318a2b[_0x7478('0x1d')](_0x101224)[_0x7478('0x1e')](_0x2570bd);}};}function respondWithFilteredResult(_0x26f7f7,_0x13c096){return function(_0x442be8){if(_0x442be8){var _0x150b07=_0x442be8[_0x7478('0x1f')],_0x2557bc=_0x13c096[_0x7478('0x20')],_0x144284=_0x13c096['offset']+_0x13c096[_0x7478('0x21')],_0x560a4b;if(_0x144284>=_0x150b07){_0x144284=_0x150b07;_0x560a4b=0xc8;}else{_0x560a4b=0xce;}_0x26f7f7['status'](_0x560a4b);return _0x26f7f7[_0x7478('0x22')](_0x7478('0x23'),_0x2557bc+'-'+_0x144284+'/'+_0x150b07)[_0x7478('0x1e')](_0x442be8);}return null;};}function patchUpdates(_0x190610){return function(_0x273c20){try{jsonpatch[_0x7478('0x24')](_0x273c20,_0x190610,!![]);}catch(_0x20565f){return BPromise[_0x7478('0x25')](_0x20565f);}return _0x273c20[_0x7478('0x26')]();};}function saveUpdates(_0x15a7d8,_0x2b156a){return function(_0x553af0){if(_0x553af0){return _0x553af0[_0x7478('0x27')](_0x15a7d8)[_0x7478('0x28')](function(_0x4a1f3d){return _0x4a1f3d;});}return null;};}function removeEntity(_0x5a12c7,_0x5d307d){return function(_0x33e073){if(_0x33e073){return _0x33e073[_0x7478('0x29')]()[_0x7478('0x28')](function(){var _0x18b277=_0x33e073[_0x7478('0x2a')]({'plain':!![]});var _0x25cd18=_0x7478('0x2b');return db[_0x7478('0x2c')][_0x7478('0x29')]({'where':{'type':_0x25cd18,'resourceId':_0x18b277['id']}})['then'](function(){return _0x33e073;});})['then'](function(){_0x5a12c7[_0x7478('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x571c30,_0x5dfddb){return function(_0x542112){if(!_0x542112){_0x571c30['sendStatus'](0x194);}return _0x542112;};}function handleError(_0xd44481,_0x4c7a12){_0x4c7a12=_0x4c7a12||0x1f4;return function(_0x15786e){logger[_0x7478('0x2d')](_0x15786e[_0x7478('0x2e')]);if(_0x15786e[_0x7478('0x2f')]){delete _0x15786e['name'];}_0xd44481[_0x7478('0x1d')](_0x4c7a12)[_0x7478('0x30')](_0x15786e);};}exports[_0x7478('0x31')]=function(_0x144e3f,_0x535247){var _0x10a09b={},_0x41ab20={},_0x2c8a28={'count':0x0,'rows':[]};var _0x5d5b4e=_[_0x7478('0x32')](db['Variable']['rawAttributes'],function(_0x556931){return{'name':_0x556931[_0x7478('0x33')],'type':_0x556931[_0x7478('0x34')][_0x7478('0x35')]};});_0x41ab20[_0x7478('0x36')]=_['map'](_0x5d5b4e,_0x7478('0x2f'));_0x41ab20[_0x7478('0x37')]=_[_0x7478('0x38')](_0x144e3f['query']);_0x41ab20[_0x7478('0x39')]=_[_0x7478('0x3a')](_0x41ab20[_0x7478('0x36')],_0x41ab20[_0x7478('0x37')]);_0x10a09b['attributes']=_['intersection'](_0x41ab20[_0x7478('0x36')],qs['fields'](_0x144e3f[_0x7478('0x37')][_0x7478('0x3b')]));_0x10a09b[_0x7478('0x3c')]=_0x10a09b[_0x7478('0x3c')][_0x7478('0x3d')]?_0x10a09b[_0x7478('0x3c')]:_0x41ab20[_0x7478('0x36')];if(!_0x144e3f['query'][_0x7478('0x3e')](_0x7478('0x3f'))){_0x10a09b[_0x7478('0x21')]=qs[_0x7478('0x21')](_0x144e3f[_0x7478('0x37')][_0x7478('0x21')]);_0x10a09b[_0x7478('0x20')]=qs['offset'](_0x144e3f['query']['offset']);}_0x10a09b[_0x7478('0x40')]=qs[_0x7478('0x41')](_0x144e3f['query'][_0x7478('0x41')]);_0x10a09b[_0x7478('0x42')]=qs[_0x7478('0x39')](_[_0x7478('0x43')](_0x144e3f[_0x7478('0x37')],_0x41ab20['filters']),_0x5d5b4e);if(_0x144e3f['query']['filter']){_0x10a09b['where']=_[_0x7478('0x44')](_0x10a09b['where'],{'$or':_[_0x7478('0x32')](_0x5d5b4e,function(_0x1df6e8){if(_0x1df6e8['type']!==_0x7478('0x45')){var _0x2b0893={};_0x2b0893[_0x1df6e8[_0x7478('0x2f')]]={'$like':'%'+_0x144e3f[_0x7478('0x37')]['filter']+'%'};return _0x2b0893;}})});}_0x10a09b=_[_0x7478('0x44')]({},_0x10a09b,_0x144e3f[_0x7478('0x46')]);var _0x502953={'where':_0x10a09b['where']};return db[_0x7478('0x47')][_0x7478('0x1f')](_0x502953)[_0x7478('0x28')](function(_0x10e050){_0x2c8a28[_0x7478('0x1f')]=_0x10e050;if(_0x144e3f[_0x7478('0x37')]['includeAll']){_0x10a09b[_0x7478('0x48')]=[{'all':!![]}];}return db[_0x7478('0x47')][_0x7478('0x49')](_0x10a09b);})[_0x7478('0x28')](function(_0x3b1cc4){_0x2c8a28[_0x7478('0x4a')]=_0x3b1cc4;return _0x2c8a28;})[_0x7478('0x28')](respondWithFilteredResult(_0x535247,_0x10a09b))[_0x7478('0x4b')](handleError(_0x535247,null));};exports[_0x7478('0x4c')]=function(_0xfefd34,_0xdd0deb){var _0x379404={'raw':!![],'where':{'id':_0xfefd34[_0x7478('0x4d')]['id']}},_0x2b43ae={};_0x2b43ae[_0x7478('0x36')]=_['keys'](db[_0x7478('0x47')][_0x7478('0x4e')]);_0x2b43ae[_0x7478('0x37')]=_[_0x7478('0x38')](_0xfefd34[_0x7478('0x37')]);_0x2b43ae['filters']=_['intersection'](_0x2b43ae[_0x7478('0x36')],_0x2b43ae[_0x7478('0x37')]);_0x379404['attributes']=_[_0x7478('0x3a')](_0x2b43ae[_0x7478('0x36')],qs[_0x7478('0x3b')](_0xfefd34[_0x7478('0x37')][_0x7478('0x3b')]));_0x379404[_0x7478('0x3c')]=_0x379404['attributes'][_0x7478('0x3d')]?_0x379404[_0x7478('0x3c')]:_0x2b43ae[_0x7478('0x36')];if(_0xfefd34[_0x7478('0x37')]['includeAll']){_0x379404[_0x7478('0x48')]=[{'all':!![]}];}_0x379404=_[_0x7478('0x44')]({},_0x379404,_0xfefd34[_0x7478('0x46')]);return db['Variable'][_0x7478('0x4f')](_0x379404)[_0x7478('0x28')](handleEntityNotFound(_0xdd0deb,null))['then'](respondWithResult(_0xdd0deb,null))[_0x7478('0x4b')](handleError(_0xdd0deb,null));};exports['create']=function(_0x3bca35,_0x2fed17){return db[_0x7478('0x47')][_0x7478('0x50')](_0x3bca35[_0x7478('0x51')],{})[_0x7478('0x28')](function(_0x369740){var _0x3b59a4=_0x3bca35[_0x7478('0x52')][_0x7478('0x2a')]({'plain':!![]});if(!_0x3b59a4)throw new Error(_0x7478('0x53'));if(_0x3b59a4[_0x7478('0x54')]===_0x7478('0x52')){var _0x259782=_0x369740['get']({'plain':!![]});var _0x419a8e='Variables';return db[_0x7478('0x55')][_0x7478('0x4f')]({'where':{'name':_0x419a8e,'userProfileId':_0x3b59a4['userProfileId']},'raw':!![]})[_0x7478('0x28')](function(_0x168992){if(_0x168992&&_0x168992[_0x7478('0x56')]===0x0){return db[_0x7478('0x2c')][_0x7478('0x50')]({'name':_0x259782[_0x7478('0x2f')],'resourceId':_0x259782['id'],'type':_0x168992[_0x7478('0x2f')],'sectionId':_0x168992['id']},{})['then'](function(){return _0x369740;});}else{return _0x369740;}})[_0x7478('0x4b')](function(_0x232f9f){logger[_0x7478('0x2d')](_0x7478('0x57'),_0x232f9f);throw _0x232f9f;});}return _0x369740;})[_0x7478('0x28')](respondWithResult(_0x2fed17,0xc9))[_0x7478('0x4b')](handleError(_0x2fed17,null));};exports[_0x7478('0x27')]=function(_0x3fcc88,_0x3e26bb){if(_0x3fcc88[_0x7478('0x51')]['id']){delete _0x3fcc88[_0x7478('0x51')]['id'];}return db[_0x7478('0x47')][_0x7478('0x4f')]({'where':{'id':_0x3fcc88['params']['id']}})[_0x7478('0x28')](handleEntityNotFound(_0x3e26bb,null))[_0x7478('0x28')](saveUpdates(_0x3fcc88['body'],null))['then'](respondWithResult(_0x3e26bb,null))[_0x7478('0x4b')](handleError(_0x3e26bb,null));};exports['destroy']=function(_0x2f6e49,_0x8128a5){return db[_0x7478('0x47')][_0x7478('0x4f')]({'where':{'id':_0x2f6e49[_0x7478('0x4d')]['id']}})[_0x7478('0x28')](handleEntityNotFound(_0x8128a5,null))[_0x7478('0x28')](removeEntity(_0x8128a5,null))[_0x7478('0x4b')](handleError(_0x8128a5,null));}; \ No newline at end of file +var _0xf3e5=['autoAssociation','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Variables','UserProfileResource','sendStatus','error','stack','name','send','map','Variable','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','show','params','options','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0xf3e5,0x13e));var _0x5f3e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xf3e5[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x5f3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f3e('0x1'));var jsonpatch=require(_0x5f3e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5f3e('0x3'));var Mustache=require(_0x5f3e('0x4'));var util=require('util');var path=require(_0x5f3e('0x5'));var sox=require(_0x5f3e('0x6'));var csv=require(_0x5f3e('0x7'));var ejs=require(_0x5f3e('0x8'));var fs=require('fs');var fs_extra=require(_0x5f3e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f3e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5f3e('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5f3e('0xc'));var Papa=require('papaparse');var Redis=require(_0x5f3e('0xd'));var authService=require(_0x5f3e('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f3e('0xf'));var logger=require(_0x5f3e('0x10'))(_0x5f3e('0x11'));var utils=require(_0x5f3e('0x12'));var config=require(_0x5f3e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f3e('0x14'))['db'];function respondWithStatusCode(_0x27b0ae,_0x5e39f2){_0x5e39f2=_0x5e39f2||0xcc;return function(_0x97d962){if(_0x97d962){return _0x27b0ae['sendStatus'](_0x5e39f2);}return _0x27b0ae[_0x5f3e('0x15')](_0x5e39f2)[_0x5f3e('0x16')]();};}function respondWithResult(_0x5921a8,_0x55eb7e){_0x55eb7e=_0x55eb7e||0xc8;return function(_0x1682c7){if(_0x1682c7){return _0x5921a8[_0x5f3e('0x15')](_0x55eb7e)[_0x5f3e('0x17')](_0x1682c7);}};}function respondWithFilteredResult(_0x3c6058,_0x4e63f2){return function(_0x1eae77){if(_0x1eae77){var _0x2081cc=_0x1eae77[_0x5f3e('0x18')],_0x47d438=_0x4e63f2[_0x5f3e('0x19')],_0x28d83d=_0x4e63f2[_0x5f3e('0x19')]+_0x4e63f2[_0x5f3e('0x1a')],_0x36483d;if(_0x28d83d>=_0x2081cc){_0x28d83d=_0x2081cc;_0x36483d=0xc8;}else{_0x36483d=0xce;}_0x3c6058[_0x5f3e('0x15')](_0x36483d);return _0x3c6058[_0x5f3e('0x1b')](_0x5f3e('0x1c'),_0x47d438+'-'+_0x28d83d+'/'+_0x2081cc)[_0x5f3e('0x17')](_0x1eae77);}return null;};}function patchUpdates(_0x55ab0d){return function(_0x367d7d){try{jsonpatch[_0x5f3e('0x1d')](_0x367d7d,_0x55ab0d,!![]);}catch(_0x4fb07b){return BPromise[_0x5f3e('0x1e')](_0x4fb07b);}return _0x367d7d[_0x5f3e('0x1f')]();};}function saveUpdates(_0x3d27a9,_0x32f127){return function(_0x1fe625){if(_0x1fe625){return _0x1fe625[_0x5f3e('0x20')](_0x3d27a9)[_0x5f3e('0x21')](function(_0x64240a){return _0x64240a;});}return null;};}function removeEntity(_0x149ba8,_0xd42071){return function(_0x1eee25){if(_0x1eee25){return _0x1eee25[_0x5f3e('0x22')]()[_0x5f3e('0x21')](function(){var _0x111934=_0x1eee25['get']({'plain':!![]});var _0xd64bc3=_0x5f3e('0x23');return db[_0x5f3e('0x24')][_0x5f3e('0x22')]({'where':{'type':_0xd64bc3,'resourceId':_0x111934['id']}})[_0x5f3e('0x21')](function(){return _0x1eee25;});})[_0x5f3e('0x21')](function(){_0x149ba8[_0x5f3e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28b2cb,_0x218c41){return function(_0x3561b8){if(!_0x3561b8){_0x28b2cb[_0x5f3e('0x25')](0x194);}return _0x3561b8;};}function handleError(_0x59d526,_0x8fa662){_0x8fa662=_0x8fa662||0x1f4;return function(_0x1bf176){logger[_0x5f3e('0x26')](_0x1bf176[_0x5f3e('0x27')]);if(_0x1bf176[_0x5f3e('0x28')]){delete _0x1bf176['name'];}_0x59d526['status'](_0x8fa662)[_0x5f3e('0x29')](_0x1bf176);};}exports['index']=function(_0x49e89a,_0x3ec752){var _0x32254a={},_0x288aca={},_0x50ae0e={'count':0x0,'rows':[]};var _0x4f1556=_[_0x5f3e('0x2a')](db[_0x5f3e('0x2b')][_0x5f3e('0x2c')],function(_0x52cf3b){return{'name':_0x52cf3b[_0x5f3e('0x2d')],'type':_0x52cf3b['type'][_0x5f3e('0x2e')]};});_0x288aca[_0x5f3e('0x2f')]=_['map'](_0x4f1556,'name');_0x288aca[_0x5f3e('0x30')]=_[_0x5f3e('0x31')](_0x49e89a[_0x5f3e('0x30')]);_0x288aca[_0x5f3e('0x32')]=_[_0x5f3e('0x33')](_0x288aca[_0x5f3e('0x2f')],_0x288aca[_0x5f3e('0x30')]);_0x32254a[_0x5f3e('0x34')]=_[_0x5f3e('0x33')](_0x288aca[_0x5f3e('0x2f')],qs['fields'](_0x49e89a[_0x5f3e('0x30')][_0x5f3e('0x35')]));_0x32254a[_0x5f3e('0x34')]=_0x32254a[_0x5f3e('0x34')][_0x5f3e('0x36')]?_0x32254a[_0x5f3e('0x34')]:_0x288aca['model'];if(!_0x49e89a[_0x5f3e('0x30')][_0x5f3e('0x37')](_0x5f3e('0x38'))){_0x32254a[_0x5f3e('0x1a')]=qs[_0x5f3e('0x1a')](_0x49e89a[_0x5f3e('0x30')][_0x5f3e('0x1a')]);_0x32254a[_0x5f3e('0x19')]=qs[_0x5f3e('0x19')](_0x49e89a[_0x5f3e('0x30')][_0x5f3e('0x19')]);}_0x32254a[_0x5f3e('0x39')]=qs['sort'](_0x49e89a[_0x5f3e('0x30')]['sort']);_0x32254a[_0x5f3e('0x3a')]=qs[_0x5f3e('0x32')](_[_0x5f3e('0x3b')](_0x49e89a[_0x5f3e('0x30')],_0x288aca['filters']),_0x4f1556);if(_0x49e89a[_0x5f3e('0x30')]['filter']){_0x32254a[_0x5f3e('0x3a')]=_[_0x5f3e('0x3c')](_0x32254a['where'],{'$or':_[_0x5f3e('0x2a')](_0x4f1556,function(_0x350405){if(_0x350405['type']!==_0x5f3e('0x3d')){var _0x5c5c15={};_0x5c5c15[_0x350405['name']]={'$like':'%'+_0x49e89a[_0x5f3e('0x30')][_0x5f3e('0x3e')]+'%'};return _0x5c5c15;}})});}_0x32254a=_[_0x5f3e('0x3c')]({},_0x32254a,_0x49e89a['options']);var _0x26d8ab={'where':_0x32254a[_0x5f3e('0x3a')]};return db['Variable'][_0x5f3e('0x18')](_0x26d8ab)[_0x5f3e('0x21')](function(_0x1fba7b){_0x50ae0e[_0x5f3e('0x18')]=_0x1fba7b;if(_0x49e89a[_0x5f3e('0x30')][_0x5f3e('0x3f')]){_0x32254a[_0x5f3e('0x40')]=[{'all':!![]}];}return db[_0x5f3e('0x2b')]['findAll'](_0x32254a);})['then'](function(_0x18e8d6){_0x50ae0e['rows']=_0x18e8d6;return _0x50ae0e;})[_0x5f3e('0x21')](respondWithFilteredResult(_0x3ec752,_0x32254a))['catch'](handleError(_0x3ec752,null));};exports[_0x5f3e('0x41')]=function(_0x1524bc,_0xaaf0e0){var _0x185b20={'raw':!![],'where':{'id':_0x1524bc[_0x5f3e('0x42')]['id']}},_0x245ff7={};_0x245ff7['model']=_['keys'](db['Variable']['rawAttributes']);_0x245ff7[_0x5f3e('0x30')]=_[_0x5f3e('0x31')](_0x1524bc[_0x5f3e('0x30')]);_0x245ff7[_0x5f3e('0x32')]=_['intersection'](_0x245ff7['model'],_0x245ff7['query']);_0x185b20[_0x5f3e('0x34')]=_['intersection'](_0x245ff7[_0x5f3e('0x2f')],qs[_0x5f3e('0x35')](_0x1524bc[_0x5f3e('0x30')][_0x5f3e('0x35')]));_0x185b20[_0x5f3e('0x34')]=_0x185b20[_0x5f3e('0x34')][_0x5f3e('0x36')]?_0x185b20[_0x5f3e('0x34')]:_0x245ff7['model'];if(_0x1524bc[_0x5f3e('0x30')]['includeAll']){_0x185b20['include']=[{'all':!![]}];}_0x185b20=_['merge']({},_0x185b20,_0x1524bc[_0x5f3e('0x43')]);return db[_0x5f3e('0x2b')][_0x5f3e('0x44')](_0x185b20)[_0x5f3e('0x21')](handleEntityNotFound(_0xaaf0e0,null))[_0x5f3e('0x21')](respondWithResult(_0xaaf0e0,null))[_0x5f3e('0x45')](handleError(_0xaaf0e0,null));};exports[_0x5f3e('0x46')]=function(_0x449c8a,_0x412a03){return db[_0x5f3e('0x2b')][_0x5f3e('0x46')](_0x449c8a['body'],{})[_0x5f3e('0x21')](function(_0x2cc775){var _0x404fbd=_0x449c8a['user'][_0x5f3e('0x47')]({'plain':!![]});if(!_0x404fbd)throw new Error(_0x5f3e('0x48'));if(_0x404fbd[_0x5f3e('0x49')]===_0x5f3e('0x4a')){var _0x2a45de=_0x2cc775[_0x5f3e('0x47')]({'plain':!![]});var _0x512926='Variables';return db[_0x5f3e('0x4b')][_0x5f3e('0x44')]({'where':{'name':_0x512926,'userProfileId':_0x404fbd[_0x5f3e('0x4c')]},'raw':!![]})[_0x5f3e('0x21')](function(_0x2670a9){if(_0x2670a9&&_0x2670a9[_0x5f3e('0x4d')]===0x0){return db[_0x5f3e('0x24')][_0x5f3e('0x46')]({'name':_0x2a45de[_0x5f3e('0x28')],'resourceId':_0x2a45de['id'],'type':_0x2670a9[_0x5f3e('0x28')],'sectionId':_0x2670a9['id']},{})[_0x5f3e('0x21')](function(){return _0x2cc775;});}else{return _0x2cc775;}})[_0x5f3e('0x45')](function(_0x39a6ee){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39a6ee);throw _0x39a6ee;});}return _0x2cc775;})['then'](respondWithResult(_0x412a03,0xc9))[_0x5f3e('0x45')](handleError(_0x412a03,null));};exports[_0x5f3e('0x20')]=function(_0x3ba905,_0x299fdc){if(_0x3ba905[_0x5f3e('0x4e')]['id']){delete _0x3ba905[_0x5f3e('0x4e')]['id'];}return db[_0x5f3e('0x2b')][_0x5f3e('0x44')]({'where':{'id':_0x3ba905[_0x5f3e('0x42')]['id']}})[_0x5f3e('0x21')](handleEntityNotFound(_0x299fdc,null))[_0x5f3e('0x21')](saveUpdates(_0x3ba905[_0x5f3e('0x4e')],null))[_0x5f3e('0x21')](respondWithResult(_0x299fdc,null))['catch'](handleError(_0x299fdc,null));};exports[_0x5f3e('0x22')]=function(_0x13c551,_0x1c5575){return db[_0x5f3e('0x2b')][_0x5f3e('0x44')]({'where':{'id':_0x13c551['params']['id']}})[_0x5f3e('0x21')](handleEntityNotFound(_0x1c5575,null))[_0x5f3e('0x21')](removeEntity(_0x1c5575,null))[_0x5f3e('0x45')](handleError(_0x1c5575,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 16bd453..eae2ae7 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 _0x9809=['request-promise','path','rimraf','../../config/environment','./variable.attributes','Variable','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9809,0x1da));var _0x9980=function(_0x25384a,_0x36f51f){_0x25384a=_0x25384a-0x0;var _0x22adf7=_0x9809[_0x25384a];return _0x22adf7;};'use strict';var _=require(_0x9980('0x0'));var util=require(_0x9980('0x1'));var logger=require(_0x9980('0x2'))(_0x9980('0x3'));var moment=require(_0x9980('0x4'));var BPromise=require(_0x9980('0x5'));var rp=require(_0x9980('0x6'));var fs=require('fs');var path=require(_0x9980('0x7'));var rimraf=require(_0x9980('0x8'));var config=require(_0x9980('0x9'));var attributes=require(_0x9980('0xa'));module['exports']=function(_0x4017d5,_0x477af4){return _0x4017d5['define'](_0x9980('0xb'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a9a=['./variable.attributes','exports','define','../../config/logger','api','moment','request-promise','path'];(function(_0x4367c6,_0x76525f){var _0x234c59=function(_0x19079c){while(--_0x19079c){_0x4367c6['push'](_0x4367c6['shift']());}};_0x234c59(++_0x76525f);}(_0x8a9a,0x193));var _0xa8a9=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x8a9a[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa8a9('0x0'))(_0xa8a9('0x1'));var moment=require(_0xa8a9('0x2'));var BPromise=require('bluebird');var rp=require(_0xa8a9('0x3'));var fs=require('fs');var path=require(_0xa8a9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8a9('0x5'));module[_0xa8a9('0x6')]=function(_0x16b086,_0x39d1db){return _0x16b086[_0xa8a9('0x7')]('Variable',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 fa91c23..9e18af8 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 _0x36b9=['client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','Variable','options','raw','attributes','include','map','model','then','lodash','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x36b9,0xad));var _0x936b=function(_0x3e4c86,_0x56f2ef){_0x3e4c86=_0x3e4c86-0x0;var _0x534acb=_0x36b9[_0x3e4c86];return _0x534acb;};'use strict';var _=require(_0x936b('0x0'));var util=require('util');var moment=require(_0x936b('0x1'));var BPromise=require(_0x936b('0x2'));var rs=require(_0x936b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x936b('0x4'));var logger=require('../../config/logger')(_0x936b('0x5'));var config=require('../../config/environment');var jayson=require(_0x936b('0x6'));var client=jayson[_0x936b('0x7')][_0x936b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2465fd,_0x41b784,_0x147eec){return new BPromise(function(_0x61316,_0x52317a){return client[_0x936b('0x9')](_0x2465fd,_0x147eec)['then'](function(_0x5a0aa0){logger[_0x936b('0xa')](_0x936b('0xb'),_0x41b784,_0x936b('0xc'));logger[_0x936b('0xd')](_0x936b('0xe'),_0x41b784,_0x936b('0xc'),JSON[_0x936b('0xf')](_0x5a0aa0));if(_0x5a0aa0[_0x936b('0x10')]){if(_0x5a0aa0[_0x936b('0x10')][_0x936b('0x11')]===0x1f4){logger[_0x936b('0x10')](_0x936b('0xb'),_0x41b784,_0x5a0aa0[_0x936b('0x10')][_0x936b('0x12')]);return _0x52317a(_0x5a0aa0[_0x936b('0x10')]['message']);}logger[_0x936b('0x10')](_0x936b('0xb'),_0x41b784,_0x5a0aa0[_0x936b('0x10')][_0x936b('0x12')]);return _0x61316(_0x5a0aa0[_0x936b('0x10')][_0x936b('0x12')]);}else{logger[_0x936b('0xa')](_0x936b('0xb'),_0x41b784,_0x936b('0xc'));_0x61316(_0x5a0aa0[_0x936b('0x13')][_0x936b('0x12')]);}})[_0x936b('0x14')](function(_0x119205){logger[_0x936b('0x10')](_0x936b('0xb'),_0x41b784,_0x119205);_0x52317a(_0x119205);});});}exports[_0x936b('0x15')]=function(_0x153e13){var _0x52a15d=this;return new Promise(function(_0x33b2fc,_0x3d8465){return db[_0x936b('0x16')]['find']({'raw':_0x153e13[_0x936b('0x17')]?_0x153e13['options'][_0x936b('0x18')]===undefined?!![]:![]:!![],'where':_0x153e13[_0x936b('0x17')]?_0x153e13[_0x936b('0x17')]['where']||null:null,'attributes':_0x153e13[_0x936b('0x17')]?_0x153e13[_0x936b('0x17')][_0x936b('0x19')]||null:null,'include':_0x153e13['options']?_0x153e13[_0x936b('0x17')][_0x936b('0x1a')]?_[_0x936b('0x1b')](_0x153e13['options'][_0x936b('0x1a')],function(_0x559fce){return{'model':db[_0x559fce[_0x936b('0x1c')]],'as':_0x559fce['as'],'attributes':_0x559fce['attributes'],'include':_0x559fce[_0x936b('0x1a')]?_['map'](_0x559fce['include'],function(_0x205436){return{'model':db[_0x205436['model']],'as':_0x205436['as'],'attributes':_0x205436['attributes'],'include':_0x205436[_0x936b('0x1a')]?_['map'](_0x205436[_0x936b('0x1a')],function(_0x29c9ed){return{'model':db[_0x29c9ed[_0x936b('0x1c')]],'as':_0x29c9ed['as'],'attributes':_0x29c9ed[_0x936b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x936b('0x1d')](function(_0x20767a){logger[_0x936b('0xa')](_0x936b('0x15'),_0x153e13);logger[_0x936b('0xd')](_0x936b('0x15'),_0x153e13,JSON['stringify'](_0x20767a));_0x33b2fc(_0x20767a);})['catch'](function(_0x266614){logger[_0x936b('0x10')](_0x936b('0x15'),_0x266614[_0x936b('0x12')],_0x153e13);_0x3d8465(_0x52a15d['error'](0x1f4,_0x266614[_0x936b('0x12')]));});});}; \ No newline at end of file +var _0xffd8=['../../mysqldb','../../config/utils','jayson/promise','http','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','Variable,\x20%s,\x20%s','message','result','catch','find','options','attributes','map','include','model','ShowVariable','stringify','lodash','util','moment','randomstring','ioredis'];(function(_0x1523db,_0x23ad21){var _0x16971e=function(_0x187b29){while(--_0x187b29){_0x1523db['push'](_0x1523db['shift']());}};_0x16971e(++_0x23ad21);}(_0xffd8,0x14b));var _0x8ffd=function(_0x4a63d3,_0x4b184f){_0x4a63d3=_0x4a63d3-0x0;var _0x5c40ce=_0xffd8[_0x4a63d3];return _0x5c40ce;};'use strict';var _=require(_0x8ffd('0x0'));var util=require(_0x8ffd('0x1'));var moment=require(_0x8ffd('0x2'));var BPromise=require('bluebird');var rs=require(_0x8ffd('0x3'));var fs=require('fs');var Redis=require(_0x8ffd('0x4'));var db=require(_0x8ffd('0x5'))['db'];var utils=require(_0x8ffd('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8ffd('0x7'));var client=jayson['client'][_0x8ffd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38988f,_0x31fc61,_0x11036a){return new BPromise(function(_0x21c1e7,_0x5a4396){return client['request'](_0x38988f,_0x11036a)[_0x8ffd('0x9')](function(_0x28bd5b){logger[_0x8ffd('0xa')]('Variable,\x20%s,\x20%s',_0x31fc61,_0x8ffd('0xb'));logger[_0x8ffd('0xc')](_0x8ffd('0xd'),_0x31fc61,_0x8ffd('0xb'),JSON['stringify'](_0x28bd5b));if(_0x28bd5b['error']){if(_0x28bd5b[_0x8ffd('0xe')][_0x8ffd('0xf')]===0x1f4){logger['error'](_0x8ffd('0x10'),_0x31fc61,_0x28bd5b[_0x8ffd('0xe')]['message']);return _0x5a4396(_0x28bd5b['error'][_0x8ffd('0x11')]);}logger[_0x8ffd('0xe')](_0x8ffd('0x10'),_0x31fc61,_0x28bd5b['error'][_0x8ffd('0x11')]);return _0x21c1e7(_0x28bd5b['error'][_0x8ffd('0x11')]);}else{logger[_0x8ffd('0xa')](_0x8ffd('0x10'),_0x31fc61,_0x8ffd('0xb'));_0x21c1e7(_0x28bd5b[_0x8ffd('0x12')][_0x8ffd('0x11')]);}})[_0x8ffd('0x13')](function(_0x18c923){logger[_0x8ffd('0xe')](_0x8ffd('0x10'),_0x31fc61,_0x18c923);_0x5a4396(_0x18c923);});});}exports['ShowVariable']=function(_0x4b0de5){var _0x4c1103=this;return new Promise(function(_0x376d07,_0xac564d){return db['Variable'][_0x8ffd('0x14')]({'raw':_0x4b0de5[_0x8ffd('0x15')]?_0x4b0de5[_0x8ffd('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4b0de5[_0x8ffd('0x15')]?_0x4b0de5[_0x8ffd('0x15')]['where']||null:null,'attributes':_0x4b0de5[_0x8ffd('0x15')]?_0x4b0de5[_0x8ffd('0x15')][_0x8ffd('0x16')]||null:null,'include':_0x4b0de5['options']?_0x4b0de5[_0x8ffd('0x15')]['include']?_[_0x8ffd('0x17')](_0x4b0de5[_0x8ffd('0x15')][_0x8ffd('0x18')],function(_0x10f70f){return{'model':db[_0x10f70f[_0x8ffd('0x19')]],'as':_0x10f70f['as'],'attributes':_0x10f70f['attributes'],'include':_0x10f70f[_0x8ffd('0x18')]?_[_0x8ffd('0x17')](_0x10f70f[_0x8ffd('0x18')],function(_0x440e01){return{'model':db[_0x440e01['model']],'as':_0x440e01['as'],'attributes':_0x440e01['attributes'],'include':_0x440e01['include']?_[_0x8ffd('0x17')](_0x440e01[_0x8ffd('0x18')],function(_0xfa500b){return{'model':db[_0xfa500b[_0x8ffd('0x19')]],'as':_0xfa500b['as'],'attributes':_0xfa500b[_0x8ffd('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x386a29){logger[_0x8ffd('0xa')](_0x8ffd('0x1a'),_0x4b0de5);logger[_0x8ffd('0xc')]('ShowVariable',_0x4b0de5,JSON[_0x8ffd('0x1b')](_0x386a29));_0x376d07(_0x386a29);})['catch'](function(_0x50cdfb){logger[_0x8ffd('0xe')]('ShowVariable',_0x50cdfb[_0x8ffd('0x11')],_0x4b0de5);_0xac564d(_0x4c1103[_0x8ffd('0xe')](0x1f4,_0x50cdfb[_0x8ffd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index a4fbfc2..c21ab95 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 _0xc3d6=['/fetch','isAuthenticated','canUpdate','reset','/pull','pull','/restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index'];(function(_0x24cac4,_0x563d50){var _0x84b4cb=function(_0x4a2d00){while(--_0x4a2d00){_0x24cac4['push'](_0x24cac4['shift']());}};_0x84b4cb(++_0x563d50);}(_0xc3d6,0x153));var _0x6c3d=function(_0x5ebbfe,_0x586ebf){_0x5ebbfe=_0x5ebbfe-0x0;var _0x279570=_0xc3d6[_0x5ebbfe];return _0x279570;};'use strict';var express=require(_0x6c3d('0x0'));var router=express[_0x6c3d('0x1')]();var auth=require(_0x6c3d('0x2'));var controller=require(_0x6c3d('0x3'));router[_0x6c3d('0x4')]('/',controller[_0x6c3d('0x5')]);router[_0x6c3d('0x4')](_0x6c3d('0x6'),auth[_0x6c3d('0x7')](),auth[_0x6c3d('0x8')](),controller['fetch']);router[_0x6c3d('0x4')]('/reset',auth[_0x6c3d('0x7')](),auth['canUpdate'](),controller[_0x6c3d('0x9')]);router[_0x6c3d('0x4')](_0x6c3d('0xa'),auth[_0x6c3d('0x7')](),auth[_0x6c3d('0x8')](),controller[_0x6c3d('0xb')]);router[_0x6c3d('0x4')](_0x6c3d('0xc'),auth[_0x6c3d('0x7')](),controller['restart']);router[_0x6c3d('0x4')](_0x6c3d('0xd'),controller['migrations']);module[_0x6c3d('0xe')]=router; \ No newline at end of file +var _0x1609=['canUpdate','fetch','get','/reset','reset','/pull','pull','/restart','restart','/migrations','express','Router','../../components/auth/service','./version.controller','/fetch'];(function(_0x19a11f,_0x6d8be7){var _0x51485f=function(_0x1394a1){while(--_0x1394a1){_0x19a11f['push'](_0x19a11f['shift']());}};_0x51485f(++_0x6d8be7);}(_0x1609,0x190));var _0x9160=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x1609[_0x433a86];return _0x23000c;};'use strict';var express=require(_0x9160('0x0'));var router=express[_0x9160('0x1')]();var auth=require(_0x9160('0x2'));var controller=require(_0x9160('0x3'));router['get']('/',controller['index']);router['get'](_0x9160('0x4'),auth['isAuthenticated'](),auth[_0x9160('0x5')](),controller[_0x9160('0x6')]);router[_0x9160('0x7')](_0x9160('0x8'),auth['isAuthenticated'](),auth[_0x9160('0x5')](),controller[_0x9160('0x9')]);router[_0x9160('0x7')](_0x9160('0xa'),auth['isAuthenticated'](),auth[_0x9160('0x5')](),controller[_0x9160('0xb')]);router[_0x9160('0x7')](_0x9160('0xc'),auth['isAuthenticated'](),controller[_0x9160('0xd')]);router['get'](_0x9160('0xe'),controller['migrations']);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 8e6bdef..38a66a1 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 _0x404d=['exports','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','simple-git','root','query','latest','fetch','2.0.0','status','json','origin','master','error','info','git\x20fetch','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js'];(function(_0x35e7aa,_0x3ba531){var _0x530270=function(_0x417d36){while(--_0x417d36){_0x35e7aa['push'](_0x35e7aa['shift']());}};_0x530270(++_0x3ba531);}(_0x404d,0x1e9));var _0xd404=function(_0x5e1cb4,_0x75c121){_0x5e1cb4=_0x5e1cb4-0x0;var _0x251a7e=_0x404d[_0x5e1cb4];return _0x251a7e;};'use strict';var Umzug=require(_0xd404('0x0'));var path=require(_0xd404('0x1'));var fs=require('fs');var _=require(_0xd404('0x2'));var pkginfo=require(_0xd404('0x3'))(module,_0xd404('0x4'));var compareVersions=require(_0xd404('0x5'));var exec=require(_0xd404('0x6'))[_0xd404('0x7')];var db=require(_0xd404('0x8'))['db'];var config=require('../../config/environment');var pm2=require(_0xd404('0x9'));var logger=require(_0xd404('0xa'))('update');var git=require(_0xd404('0xb'))(config[_0xd404('0xc')]);exports['index']=function(_0x5c335f,_0x10021a){var _0x3d7e8a={'current':module['exports']['version'],'phonebar':0x2};if(_0x5c335f[_0xd404('0xd')]&&_0x5c335f[_0xd404('0xd')][_0xd404('0xe')]){return git[_0xd404('0xf')]()['tags'](function(_0x4b60f2,_0x3b0ee1){_0x3d7e8a[_0xd404('0xe')]=(_0x4b60f2?module['exports'][_0xd404('0x4')]:_0x3b0ee1[_0xd404('0xe')])||_0xd404('0x10');return _0x10021a[_0xd404('0x11')](0xc8)[_0xd404('0x12')](_0x3d7e8a);});}else{return _0x10021a[_0xd404('0x11')](0xc8)[_0xd404('0x12')](_0x3d7e8a);}};exports[_0xd404('0xf')]=function(_0x1b0dcd,_0x31c8f8){return git[_0xd404('0xf')]([_0xd404('0x13'),_0xd404('0x14')],function(_0x6d79a4){if(_0x6d79a4){logger[_0xd404('0x15')](_0x6d79a4);return _0x31c8f8[_0xd404('0x11')](0x1f4)[_0xd404('0x12')](_0x6d79a4);}logger[_0xd404('0x16')](_0xd404('0x17'));return _0x31c8f8[_0xd404('0x11')](0xc8)[_0xd404('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xd404('0x18')]=function(_0x8bdcd1,_0x5e19e4){return git[_0xd404('0x18')]([_0xd404('0x19'),'FETCH_HEAD'],function(_0x209a6b){if(_0x209a6b){logger[_0xd404('0x15')](_0x209a6b);return _0x5e19e4[_0xd404('0x11')](0x1f4)['json'](_0x209a6b);}logger[_0xd404('0x16')](_0xd404('0x1a'));return _0x5e19e4[_0xd404('0x11')](0xc8)[_0xd404('0x12')]({'output':_0xd404('0x1b')});});};exports[_0xd404('0x1c')]=function(_0x458f6e,_0x5c0264){exec(_0xd404('0x1d'),function(_0xcc7bf1,_0x50c0e2,_0x17d0e6){logger['info'](_0x50c0e2);logger['info'](_0x17d0e6);if(_0xcc7bf1){logger[_0xd404('0x15')](_0xcc7bf1);return _0x5c0264[_0xd404('0x11')](0x1f4)[_0xd404('0x12')](_0xcc7bf1);}return _0x5c0264[_0xd404('0x11')](0xc8)['json']({'output':_0x50c0e2});});};exports[_0xd404('0x1e')]=function(_0x2a5d84,_0x13af69){return pm2['restart']('motion2')[_0xd404('0x1f')](function(_0xaccaa8){logger[_0xd404('0x16')](_0xd404('0x20'),_0xaccaa8);return _0x13af69[_0xd404('0x11')](0xc8)[_0xd404('0x12')]({'output':_0xd404('0x21')});})[_0xd404('0x22')](function(_0x586b97){logger['error'](_0x586b97);return _0x13af69[_0xd404('0x11')](0x1f4)['json'](_0x586b97);});};exports[_0xd404('0x23')]=function(_0x4f210c,_0x23525b){var _0x1e6341=fs[_0xd404('0x24')](path[_0xd404('0x25')](config[_0xd404('0xc')],_0xd404('0x26'),_0xd404('0x23')));var _0x4ece21=[];for(var _0x585b67=0x0;_0x585b67<_0x1e6341[_0xd404('0x27')];_0x585b67++){var _0x541c78=_0x1e6341[_0x585b67]['replace'](_0xd404('0x28'),'');if(compareVersions(module[_0xd404('0x29')][_0xd404('0x4')],_0x541c78)===-0x1){_0x4ece21['push'](_0x541c78);}}if(_0x4ece21[_0xd404('0x27')]){var _0x54f0c5=_0x4ece21[_0xd404('0x2a')](compareVersions);var _0x1de7b9=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xd404('0x2b')],'modelName':_0xd404('0x2b'),'columnName':_0xd404('0x4')},'migrations':{'params':[db[_0xd404('0x2c')][_0xd404('0x2d')](),db['sequelize'][_0xd404('0x2e')],function(){throw new Error(_0xd404('0x2f'));}],'path':path[_0xd404('0x25')](config['root'],_0xd404('0x26'),_0xd404('0x23')),'pattern':/\.js$/}});_0x1de7b9['up']({'migrations':_[_0xd404('0x30')](_0x54f0c5,function(_0x296331){return _0x296331+'.js';})})['then'](function(){return _0x23525b[_0xd404('0x11')](0xc8)[_0xd404('0x12')]({'output':_0xd404('0x31')+module[_0xd404('0x29')][_0xd404('0x4')]+_0xd404('0x32')+_['last'](_0x54f0c5),'migrations':_[_0xd404('0x25')](_0x54f0c5)});})[_0xd404('0x22')](function(_0x1f5675){if(_0x1f5675 instanceof db['sequelize'][_0xd404('0x33')]){return _0x23525b[_0xd404('0x11')](0xc8)[_0xd404('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x23525b[_0xd404('0x11')](0x1f4)[_0xd404('0x12')](_0x1f5675);}});}else{return _0x23525b[_0xd404('0x11')](0xc8)['json']({'output':_0xd404('0x34')});}}; \ No newline at end of file +var _0x4489=['compare-versions','child_process','update','root','query','latest','fetch','tags','exports','2.0.0','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','server','length','replace','.js','sort','sequelize','Migration','getQueryInterface','join','map','\x20to\x20','last','UniqueConstraintError','umzug','path','pkginfo','version'];(function(_0x4fc9e1,_0x2d3a31){var _0x439bda=function(_0x45ef32){while(--_0x45ef32){_0x4fc9e1['push'](_0x4fc9e1['shift']());}};_0x439bda(++_0x2d3a31);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var Umzug=require(_0x9448('0x0'));var path=require(_0x9448('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x9448('0x2'))(module,_0x9448('0x3'));var compareVersions=require(_0x9448('0x4'));var exec=require(_0x9448('0x5'))['exec'];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x9448('0x6'));var git=require('simple-git')(config[_0x9448('0x7')]);exports['index']=function(_0x46ea5c,_0x3996a1){var _0x26bd97={'current':module['exports']['version'],'phonebar':0x2};if(_0x46ea5c['query']&&_0x46ea5c[_0x9448('0x8')][_0x9448('0x9')]){return git[_0x9448('0xa')]()[_0x9448('0xb')](function(_0x20b436,_0x58e18b){_0x26bd97[_0x9448('0x9')]=(_0x20b436?module[_0x9448('0xc')][_0x9448('0x3')]:_0x58e18b[_0x9448('0x9')])||_0x9448('0xd');return _0x3996a1[_0x9448('0xe')](0xc8)[_0x9448('0xf')](_0x26bd97);});}else{return _0x3996a1[_0x9448('0xe')](0xc8)['json'](_0x26bd97);}};exports[_0x9448('0xa')]=function(_0x56fd4a,_0x323fd2){return git[_0x9448('0xa')](['origin',_0x9448('0x10')],function(_0x23b1fa){if(_0x23b1fa){logger[_0x9448('0x11')](_0x23b1fa);return _0x323fd2[_0x9448('0xe')](0x1f4)[_0x9448('0xf')](_0x23b1fa);}logger[_0x9448('0x12')](_0x9448('0x13'));return _0x323fd2[_0x9448('0xe')](0xc8)['json']({'output':_0x9448('0x14')});});};exports['reset']=function(_0x2c8f0b,_0xc448c6){return git[_0x9448('0x15')]([_0x9448('0x16'),_0x9448('0x17')],function(_0x194e0e){if(_0x194e0e){logger[_0x9448('0x11')](_0x194e0e);return _0xc448c6[_0x9448('0xe')](0x1f4)[_0x9448('0xf')](_0x194e0e);}logger[_0x9448('0x12')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0xc448c6[_0x9448('0xe')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x9448('0x18')]=function(_0x5cc7da,_0x594b6b){exec('npm\x20install\x20--production',function(_0x9d711a,_0x5befa0,_0x39948a){logger[_0x9448('0x12')](_0x5befa0);logger[_0x9448('0x12')](_0x39948a);if(_0x9d711a){logger['error'](_0x9d711a);return _0x594b6b[_0x9448('0xe')](0x1f4)[_0x9448('0xf')](_0x9d711a);}return _0x594b6b[_0x9448('0xe')](0xc8)[_0x9448('0xf')]({'output':_0x5befa0});});};exports[_0x9448('0x19')]=function(_0x985d73,_0x4d8a8a){return pm2['restart'](_0x9448('0x1a'))[_0x9448('0x1b')](function(_0x24240d){logger[_0x9448('0x12')](_0x9448('0x1c'),_0x24240d);return _0x4d8a8a['status'](0xc8)[_0x9448('0xf')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x9448('0x1d')](function(_0x99f7b9){logger[_0x9448('0x11')](_0x99f7b9);return _0x4d8a8a['status'](0x1f4)[_0x9448('0xf')](_0x99f7b9);});};exports[_0x9448('0x1e')]=function(_0x25669c,_0x89bc24){var _0x14009a=fs[_0x9448('0x1f')](path['join'](config[_0x9448('0x7')],_0x9448('0x20'),'migrations'));var _0x57ac6=[];for(var _0x329f36=0x0;_0x329f36<_0x14009a[_0x9448('0x21')];_0x329f36++){var _0x3ed2d6=_0x14009a[_0x329f36][_0x9448('0x22')](_0x9448('0x23'),'');if(compareVersions(module['exports'][_0x9448('0x3')],_0x3ed2d6)===-0x1){_0x57ac6['push'](_0x3ed2d6);}}if(_0x57ac6[_0x9448('0x21')]){var _0x28b398=_0x57ac6[_0x9448('0x24')](compareVersions);var _0x1f0d8f=new Umzug({'storage':_0x9448('0x25'),'storageOptions':{'model':db[_0x9448('0x26')],'modelName':_0x9448('0x26'),'columnName':_0x9448('0x3')},'migrations':{'params':[db['sequelize'][_0x9448('0x27')](),db[_0x9448('0x25')]['constructor'],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[_0x9448('0x28')](config[_0x9448('0x7')],'server',_0x9448('0x1e')),'pattern':/\.js$/}});_0x1f0d8f['up']({'migrations':_[_0x9448('0x29')](_0x28b398,function(_0x3db0cd){return _0x3db0cd+_0x9448('0x23');})})[_0x9448('0x1b')](function(){return _0x89bc24[_0x9448('0xe')](0xc8)[_0x9448('0xf')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x9448('0xc')][_0x9448('0x3')]+_0x9448('0x2a')+_[_0x9448('0x2b')](_0x28b398),'migrations':_[_0x9448('0x28')](_0x28b398)});})[_0x9448('0x1d')](function(_0x1775da){if(_0x1775da instanceof db[_0x9448('0x25')][_0x9448('0x2c')]){return _0x89bc24[_0x9448('0xe')](0xc8)[_0x9448('0xf')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x89bc24[_0x9448('0xe')](0x1f4)[_0x9448('0xf')](_0x1775da);}});}else{return _0x89bc24[_0x9448('0xe')](0xc8)[_0x9448('0xf')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 71d1c1f..33692a8 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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x154b38,_0x14bf20){var _0x4cc8fa=function(_0x19443c){while(--_0x19443c){_0x154b38['push'](_0x154b38['shift']());}};_0x4cc8fa(++_0x14bf20);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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 +var _0x757a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','util','path'];(function(_0xf368fe,_0x12d9e8){var _0x15c0cb=function(_0x50efe3){while(--_0x50efe3){_0xf368fe['push'](_0xf368fe['shift']());}};_0x15c0cb(++_0x12d9e8);}(_0x757a,0xde));var _0xa757=function(_0x1e45d9,_0x2b407f){_0x1e45d9=_0x1e45d9-0x0;var _0xb41096=_0x757a[_0x1e45d9];return _0xb41096;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/describe',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['show']);router[_0xa757('0xc')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0xe')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller[_0xa757('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 2de0556..dc40076 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 _0x4819=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4819,0xcd));var _0x9481=function(_0x249d7c,_0x17163a){_0x249d7c=_0x249d7c-0x0;var _0x20f24b=_0x4819[_0x249d7c];return _0x20f24b;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'type':{'type':Sequelize[_0x9481('0x1')]},'uniqueid':{'type':Sequelize[_0x9481('0x1')]},'calleridnum':{'type':Sequelize[_0x9481('0x1')]},'calleridname':{'type':Sequelize[_0x9481('0x1')]},'queue':{'type':Sequelize[_0x9481('0x1')]},'interface':{'type':Sequelize[_0x9481('0x1')]},'membername':{'type':Sequelize[_0x9481('0x1')]},'agentcalledAt':{'type':Sequelize[_0x9481('0x2')]},'agentconnectAt':{'type':Sequelize[_0x9481('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x9481('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9481('0x4')]},'agentacw':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x9481('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9481('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9481('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9481('0x1')]},'connectedlinename':{'type':Sequelize[_0x9481('0x1')]},'language':{'type':Sequelize[_0x9481('0x1')]},'accountcode':{'type':Sequelize[_0x9481('0x1')]},'context':{'type':Sequelize[_0x9481('0x1')]},'exten':{'type':Sequelize[_0x9481('0x1')]},'priority':{'type':Sequelize[_0x9481('0x1')]},'destchannel':{'type':Sequelize[_0x9481('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x9481('0x1')]},'destcalleridname':{'type':Sequelize[_0x9481('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x9481('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x9481('0x1')]},'destlanguage':{'type':Sequelize[_0x9481('0x1')]},'destaccountcode':{'type':Sequelize[_0x9481('0x1')]},'destcontext':{'type':Sequelize[_0x9481('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9481('0x1')]},'destuniqueid':{'type':Sequelize[_0x9481('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x9481('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9481('0x1')],'comment':_0x9481('0x5')},'transferexten':{'type':Sequelize[_0x9481('0x1')]},'transferuniqueid':{'type':Sequelize[_0x9481('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7dfd=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x11d37e,_0x36e28d){var _0x88cfad=function(_0x38e155){while(--_0x38e155){_0x11d37e['push'](_0x11d37e['shift']());}};_0x88cfad(++_0x36e28d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'type':{'type':Sequelize[_0xd7df('0x2')]},'uniqueid':{'type':Sequelize[_0xd7df('0x2')]},'calleridnum':{'type':Sequelize[_0xd7df('0x2')]},'calleridname':{'type':Sequelize[_0xd7df('0x2')]},'queue':{'type':Sequelize[_0xd7df('0x2')]},'interface':{'type':Sequelize[_0xd7df('0x2')]},'membername':{'type':Sequelize[_0xd7df('0x2')]},'agentcalledAt':{'type':Sequelize[_0xd7df('0x3')]},'agentconnectAt':{'type':Sequelize[_0xd7df('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xd7df('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xd7df('0x3')]},'agentdumpAt':{'type':Sequelize[_0xd7df('0x3')]},'holdtime':{'type':Sequelize[_0xd7df('0x4')]},'agentcomplete':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd7df('0x4')]},'agentacw':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd7df('0x4')]},'reason':{'type':Sequelize[_0xd7df('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd7df('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd7df('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd7df('0x2')]},'language':{'type':Sequelize[_0xd7df('0x2')]},'accountcode':{'type':Sequelize[_0xd7df('0x2')]},'context':{'type':Sequelize[_0xd7df('0x2')]},'exten':{'type':Sequelize[_0xd7df('0x2')]},'priority':{'type':Sequelize[_0xd7df('0x2')]},'destchannel':{'type':Sequelize[_0xd7df('0x2')]},'destchannelstate':{'type':Sequelize[_0xd7df('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xd7df('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd7df('0x2')]},'destcalleridname':{'type':Sequelize[_0xd7df('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd7df('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd7df('0x2')]},'destlanguage':{'type':Sequelize[_0xd7df('0x2')]},'destaccountcode':{'type':Sequelize[_0xd7df('0x2')]},'destcontext':{'type':Sequelize[_0xd7df('0x2')]},'destexten':{'type':Sequelize[_0xd7df('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd7df('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd7df('0x2')]},'transferuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'agententerreason':{'type':Sequelize[_0xd7df('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 99b01d3..7c60d35 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 _0x2bb1=['json','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','merge','where','VIRTUAL','filter','options','VoiceAgentReport','includeAll','findAll','rows','catch','show','keys','create','body','find','params','describe','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x32c522,_0x556765){var _0x167c3c=function(_0x3af6d3){while(--_0x3af6d3){_0x32c522['push'](_0x32c522['shift']());}};_0x167c3c(++_0x556765);}(_0x2bb1,0x197));var _0x12bb=function(_0x4c9ba3,_0x355f36){_0x4c9ba3=_0x4c9ba3-0x0;var _0x4db012=_0x2bb1[_0x4c9ba3];return _0x4db012;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x12bb('0x0'));var rp=require(_0x12bb('0x1'));var moment=require(_0x12bb('0x2'));var BPromise=require(_0x12bb('0x3'));var Mustache=require('mustache');var util=require(_0x12bb('0x4'));var path=require('path');var sox=require(_0x12bb('0x5'));var csv=require(_0x12bb('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x12bb('0x7'));var _=require(_0x12bb('0x8'));var squel=require(_0x12bb('0x9'));var crypto=require(_0x12bb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x12bb('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x12bb('0xc'));var Redis=require(_0x12bb('0xd'));var authService=require(_0x12bb('0xe'));var qs=require(_0x12bb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12bb('0x10'));var logger=require(_0x12bb('0x11'))(_0x12bb('0x12'));var utils=require(_0x12bb('0x13'));var config=require(_0x12bb('0x14'));var licenseUtil=require(_0x12bb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e0fc9,_0x214d77){_0x214d77=_0x214d77||0xcc;return function(_0x3180a7){if(_0x3180a7){return _0x3e0fc9[_0x12bb('0x16')](_0x214d77);}return _0x3e0fc9[_0x12bb('0x17')](_0x214d77)[_0x12bb('0x18')]();};}function respondWithResult(_0x1bf582,_0x1fb746){_0x1fb746=_0x1fb746||0xc8;return function(_0x4a2a79){if(_0x4a2a79){return _0x1bf582['status'](_0x1fb746)[_0x12bb('0x19')](_0x4a2a79);}};}function respondWithFilteredResult(_0x57a0a0,_0x47d972){return function(_0x3b8fe7){if(_0x3b8fe7){var _0x241053=_0x3b8fe7[_0x12bb('0x1a')],_0x7308c=_0x47d972['offset'],_0x73bff2=_0x47d972[_0x12bb('0x1b')]+_0x47d972['limit'],_0x52d090;if(_0x73bff2>=_0x241053){_0x73bff2=_0x241053;_0x52d090=0xc8;}else{_0x52d090=0xce;}_0x57a0a0[_0x12bb('0x17')](_0x52d090);return _0x57a0a0[_0x12bb('0x1c')](_0x12bb('0x1d'),_0x7308c+'-'+_0x73bff2+'/'+_0x241053)[_0x12bb('0x19')](_0x3b8fe7);}return null;};}function patchUpdates(_0x47d1bc){return function(_0xd3d190){try{jsonpatch[_0x12bb('0x1e')](_0xd3d190,_0x47d1bc,!![]);}catch(_0xbb7688){return BPromise['reject'](_0xbb7688);}return _0xd3d190[_0x12bb('0x1f')]();};}function saveUpdates(_0x186786,_0x4198f4){return function(_0x38254f){if(_0x38254f){return _0x38254f[_0x12bb('0x20')](_0x186786)['then'](function(_0x1b4f7b){return _0x1b4f7b;});}return null;};}function removeEntity(_0x4513d3,_0x4570db){return function(_0x3476b8){if(_0x3476b8){return _0x3476b8[_0x12bb('0x21')]()[_0x12bb('0x22')](function(){_0x4513d3[_0x12bb('0x17')](0xcc)[_0x12bb('0x18')]();});}};}function handleEntityNotFound(_0x3f448e,_0x212161){return function(_0x3684d8){if(!_0x3684d8){_0x3f448e[_0x12bb('0x16')](0x194);}return _0x3684d8;};}function handleError(_0x5aed89,_0x3bbfdb){_0x3bbfdb=_0x3bbfdb||0x1f4;return function(_0x1a2f51){logger[_0x12bb('0x23')](_0x1a2f51[_0x12bb('0x24')]);if(_0x1a2f51['name']){delete _0x1a2f51[_0x12bb('0x25')];}_0x5aed89['status'](_0x3bbfdb)['send'](_0x1a2f51);};}exports[_0x12bb('0x26')]=function(_0x118c8c,_0x38f3a7){var _0x59e6a9={},_0x1867a4={},_0x465d94={'count':0x0,'rows':[]};var _0x3cdd5f=_[_0x12bb('0x27')](db['VoiceAgentReport'][_0x12bb('0x28')],function(_0x103db8){return{'name':_0x103db8[_0x12bb('0x29')],'type':_0x103db8[_0x12bb('0x2a')]['key']};});_0x1867a4['model']=_[_0x12bb('0x27')](_0x3cdd5f,_0x12bb('0x25'));_0x1867a4[_0x12bb('0x2b')]=_['keys'](_0x118c8c[_0x12bb('0x2b')]);_0x1867a4[_0x12bb('0x2c')]=_['intersection'](_0x1867a4[_0x12bb('0x2d')],_0x1867a4['query']);_0x59e6a9[_0x12bb('0x2e')]=_[_0x12bb('0x2f')](_0x1867a4[_0x12bb('0x2d')],qs[_0x12bb('0x30')](_0x118c8c['query'][_0x12bb('0x30')]));_0x59e6a9[_0x12bb('0x2e')]=_0x59e6a9[_0x12bb('0x2e')][_0x12bb('0x31')]?_0x59e6a9[_0x12bb('0x2e')]:_0x1867a4[_0x12bb('0x2d')];if(!_0x118c8c[_0x12bb('0x2b')][_0x12bb('0x32')]('nolimit')){_0x59e6a9[_0x12bb('0x33')]=qs[_0x12bb('0x33')](_0x118c8c[_0x12bb('0x2b')][_0x12bb('0x33')]);_0x59e6a9[_0x12bb('0x1b')]=qs[_0x12bb('0x1b')](_0x118c8c[_0x12bb('0x2b')][_0x12bb('0x1b')]);}_0x59e6a9[_0x12bb('0x34')]=qs[_0x12bb('0x35')](_0x118c8c['query']['sort']);_0x59e6a9['where']=qs[_0x12bb('0x2c')](_[_0x12bb('0x36')](_0x118c8c[_0x12bb('0x2b')],_0x1867a4[_0x12bb('0x2c')]),_0x3cdd5f);if(_0x118c8c[_0x12bb('0x2b')]['filter']){_0x59e6a9['where']=_[_0x12bb('0x37')](_0x59e6a9[_0x12bb('0x38')],{'$or':_['map'](_0x3cdd5f,function(_0x21a0d8){if(_0x21a0d8[_0x12bb('0x2a')]!==_0x12bb('0x39')){var _0xf70790={};_0xf70790[_0x21a0d8['name']]={'$like':'%'+_0x118c8c[_0x12bb('0x2b')][_0x12bb('0x3a')]+'%'};return _0xf70790;}})});}_0x59e6a9=_[_0x12bb('0x37')]({},_0x59e6a9,_0x118c8c[_0x12bb('0x3b')]);var _0x235736={'where':_0x59e6a9[_0x12bb('0x38')]};return db[_0x12bb('0x3c')]['count'](_0x235736)[_0x12bb('0x22')](function(_0x47f0b3){_0x465d94[_0x12bb('0x1a')]=_0x47f0b3;if(_0x118c8c[_0x12bb('0x2b')][_0x12bb('0x3d')]){_0x59e6a9['include']=[{'all':!![]}];}return db[_0x12bb('0x3c')][_0x12bb('0x3e')](_0x59e6a9);})['then'](function(_0x25d4d7){_0x465d94[_0x12bb('0x3f')]=_0x25d4d7;return _0x465d94;})['then'](respondWithFilteredResult(_0x38f3a7,_0x59e6a9))[_0x12bb('0x40')](handleError(_0x38f3a7,null));};exports[_0x12bb('0x41')]=function(_0x35d6b5,_0x1ca23f){var _0x38ba23={'raw':![],'where':{'id':_0x35d6b5['params']['id']}},_0x372b80={};_0x372b80[_0x12bb('0x2d')]=_[_0x12bb('0x42')](db[_0x12bb('0x3c')][_0x12bb('0x28')]);_0x372b80[_0x12bb('0x2b')]=_[_0x12bb('0x42')](_0x35d6b5['query']);_0x372b80[_0x12bb('0x2c')]=_[_0x12bb('0x2f')](_0x372b80[_0x12bb('0x2d')],_0x372b80['query']);_0x38ba23[_0x12bb('0x2e')]=_[_0x12bb('0x2f')](_0x372b80[_0x12bb('0x2d')],qs[_0x12bb('0x30')](_0x35d6b5['query'][_0x12bb('0x30')]));_0x38ba23['attributes']=_0x38ba23[_0x12bb('0x2e')][_0x12bb('0x31')]?_0x38ba23[_0x12bb('0x2e')]:_0x372b80[_0x12bb('0x2d')];if(_0x35d6b5[_0x12bb('0x2b')]['includeAll']){_0x38ba23['include']=[{'all':!![]}];}_0x38ba23=_[_0x12bb('0x37')]({},_0x38ba23,_0x35d6b5['options']);return db[_0x12bb('0x3c')]['find'](_0x38ba23)[_0x12bb('0x22')](handleEntityNotFound(_0x1ca23f,null))[_0x12bb('0x22')](respondWithResult(_0x1ca23f,null))[_0x12bb('0x40')](handleError(_0x1ca23f,null));};exports['create']=function(_0x524f21,_0x2daa05){return db[_0x12bb('0x3c')][_0x12bb('0x43')](_0x524f21['body'],{})[_0x12bb('0x22')](respondWithResult(_0x2daa05,0xc9))[_0x12bb('0x40')](handleError(_0x2daa05,null));};exports['update']=function(_0x4464d8,_0x30fb2f){if(_0x4464d8[_0x12bb('0x44')]['id']){delete _0x4464d8[_0x12bb('0x44')]['id'];}return db[_0x12bb('0x3c')][_0x12bb('0x45')]({'where':{'id':_0x4464d8[_0x12bb('0x46')]['id']}})[_0x12bb('0x22')](handleEntityNotFound(_0x30fb2f,null))[_0x12bb('0x22')](saveUpdates(_0x4464d8['body'],null))[_0x12bb('0x22')](respondWithResult(_0x30fb2f,null))[_0x12bb('0x40')](handleError(_0x30fb2f,null));};exports['destroy']=function(_0x727e48,_0x89a319){return db[_0x12bb('0x3c')][_0x12bb('0x45')]({'where':{'id':_0x727e48['params']['id']}})[_0x12bb('0x22')](handleEntityNotFound(_0x89a319,null))['then'](removeEntity(_0x89a319,null))[_0x12bb('0x40')](handleError(_0x89a319,null));};exports['describe']=function(_0xf5a03,_0xd7c0ce){return db[_0x12bb('0x3c')][_0x12bb('0x47')]()[_0x12bb('0x22')](respondWithResult(_0xd7c0ce,null))[_0x12bb('0x40')](handleError(_0xd7c0ce,null));}; \ No newline at end of file +var _0xbf1c=['../../config/logger','../../config/utils','../../mysqldb','sendStatus','count','offset','limit','status','set','Content-Range','json','save','then','destroy','error','name','index','map','VoiceAgentReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','options','include','rows','show','fields','includeAll','find','catch','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x36c00c,_0x4d381d){var _0x53c15e=function(_0x23cc21){while(--_0x23cc21){_0x36c00c['push'](_0x36c00c['shift']());}};_0x53c15e(++_0x4d381d);}(_0xbf1c,0x77));var _0xcbf1=function(_0x1b9911,_0x5015e1){_0x1b9911=_0x1b9911-0x0;var _0x4bbd04=_0xbf1c[_0x1b9911];return _0x4bbd04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcbf1('0x0'));var zipdir=require(_0xcbf1('0x1'));var jsonpatch=require(_0xcbf1('0x2'));var rp=require(_0xcbf1('0x3'));var moment=require(_0xcbf1('0x4'));var BPromise=require(_0xcbf1('0x5'));var Mustache=require(_0xcbf1('0x6'));var util=require('util');var path=require(_0xcbf1('0x7'));var sox=require(_0xcbf1('0x8'));var csv=require('to-csv');var ejs=require(_0xcbf1('0x9'));var fs=require('fs');var fs_extra=require(_0xcbf1('0xa'));var _=require('lodash');var squel=require(_0xcbf1('0xb'));var crypto=require('crypto');var jsforce=require(_0xcbf1('0xc'));var deskjs=require(_0xcbf1('0xd'));var toCsv=require(_0xcbf1('0xe'));var querystring=require(_0xcbf1('0xf'));var Papa=require(_0xcbf1('0x10'));var Redis=require('ioredis');var authService=require(_0xcbf1('0x11'));var qs=require(_0xcbf1('0x12'));var as=require(_0xcbf1('0x13'));var hardwareService=require(_0xcbf1('0x14'));var logger=require(_0xcbf1('0x15'))('api');var utils=require(_0xcbf1('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcbf1('0x17'))['db'];function respondWithStatusCode(_0x243479,_0x151dd7){_0x151dd7=_0x151dd7||0xcc;return function(_0x28fffe){if(_0x28fffe){return _0x243479[_0xcbf1('0x18')](_0x151dd7);}return _0x243479['status'](_0x151dd7)['end']();};}function respondWithResult(_0x17462b,_0x3503d7){_0x3503d7=_0x3503d7||0xc8;return function(_0x5577af){if(_0x5577af){return _0x17462b['status'](_0x3503d7)['json'](_0x5577af);}};}function respondWithFilteredResult(_0x31c623,_0x541d77){return function(_0x3b8a56){if(_0x3b8a56){var _0x525ab4=_0x3b8a56[_0xcbf1('0x19')],_0x24119e=_0x541d77[_0xcbf1('0x1a')],_0x3bacce=_0x541d77[_0xcbf1('0x1a')]+_0x541d77[_0xcbf1('0x1b')],_0xc81efc;if(_0x3bacce>=_0x525ab4){_0x3bacce=_0x525ab4;_0xc81efc=0xc8;}else{_0xc81efc=0xce;}_0x31c623[_0xcbf1('0x1c')](_0xc81efc);return _0x31c623[_0xcbf1('0x1d')](_0xcbf1('0x1e'),_0x24119e+'-'+_0x3bacce+'/'+_0x525ab4)[_0xcbf1('0x1f')](_0x3b8a56);}return null;};}function patchUpdates(_0x31daa6){return function(_0x2cb071){try{jsonpatch['apply'](_0x2cb071,_0x31daa6,!![]);}catch(_0x1afc65){return BPromise['reject'](_0x1afc65);}return _0x2cb071[_0xcbf1('0x20')]();};}function saveUpdates(_0x29b75a,_0x5ba9e3){return function(_0x374b13){if(_0x374b13){return _0x374b13['update'](_0x29b75a)[_0xcbf1('0x21')](function(_0x117c94){return _0x117c94;});}return null;};}function removeEntity(_0x1475fc,_0xab912e){return function(_0x3b99b8){if(_0x3b99b8){return _0x3b99b8[_0xcbf1('0x22')]()[_0xcbf1('0x21')](function(){_0x1475fc[_0xcbf1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x512eaf,_0x11f89d){return function(_0x517344){if(!_0x517344){_0x512eaf[_0xcbf1('0x18')](0x194);}return _0x517344;};}function handleError(_0x45c55f,_0x4d948){_0x4d948=_0x4d948||0x1f4;return function(_0x3b0ea0){logger[_0xcbf1('0x23')](_0x3b0ea0['stack']);if(_0x3b0ea0[_0xcbf1('0x24')]){delete _0x3b0ea0[_0xcbf1('0x24')];}_0x45c55f[_0xcbf1('0x1c')](_0x4d948)['send'](_0x3b0ea0);};}exports[_0xcbf1('0x25')]=function(_0x56ddda,_0x1de06d){var _0x386f20={},_0x4c7974={},_0x3b08a6={'count':0x0,'rows':[]};var _0x599334=_[_0xcbf1('0x26')](db[_0xcbf1('0x27')][_0xcbf1('0x28')],function(_0x34dcd9){return{'name':_0x34dcd9[_0xcbf1('0x29')],'type':_0x34dcd9['type'][_0xcbf1('0x2a')]};});_0x4c7974[_0xcbf1('0x2b')]=_['map'](_0x599334,_0xcbf1('0x24'));_0x4c7974[_0xcbf1('0x2c')]=_[_0xcbf1('0x2d')](_0x56ddda[_0xcbf1('0x2c')]);_0x4c7974['filters']=_[_0xcbf1('0x2e')](_0x4c7974[_0xcbf1('0x2b')],_0x4c7974['query']);_0x386f20[_0xcbf1('0x2f')]=_['intersection'](_0x4c7974['model'],qs['fields'](_0x56ddda[_0xcbf1('0x2c')]['fields']));_0x386f20[_0xcbf1('0x2f')]=_0x386f20[_0xcbf1('0x2f')][_0xcbf1('0x30')]?_0x386f20[_0xcbf1('0x2f')]:_0x4c7974['model'];if(!_0x56ddda[_0xcbf1('0x2c')][_0xcbf1('0x31')]('nolimit')){_0x386f20[_0xcbf1('0x1b')]=qs[_0xcbf1('0x1b')](_0x56ddda[_0xcbf1('0x2c')][_0xcbf1('0x1b')]);_0x386f20[_0xcbf1('0x1a')]=qs['offset'](_0x56ddda[_0xcbf1('0x2c')][_0xcbf1('0x1a')]);}_0x386f20[_0xcbf1('0x32')]=qs['sort'](_0x56ddda['query'][_0xcbf1('0x33')]);_0x386f20[_0xcbf1('0x34')]=qs['filters'](_[_0xcbf1('0x35')](_0x56ddda[_0xcbf1('0x2c')],_0x4c7974[_0xcbf1('0x36')]),_0x599334);if(_0x56ddda[_0xcbf1('0x2c')][_0xcbf1('0x37')]){_0x386f20[_0xcbf1('0x34')]=_[_0xcbf1('0x38')](_0x386f20[_0xcbf1('0x34')],{'$or':_['map'](_0x599334,function(_0x4b4fed){if(_0x4b4fed[_0xcbf1('0x39')]!=='VIRTUAL'){var _0x4ae649={};_0x4ae649[_0x4b4fed[_0xcbf1('0x24')]]={'$like':'%'+_0x56ddda[_0xcbf1('0x2c')][_0xcbf1('0x37')]+'%'};return _0x4ae649;}})});}_0x386f20=_[_0xcbf1('0x38')]({},_0x386f20,_0x56ddda[_0xcbf1('0x3a')]);var _0x7266df={'where':_0x386f20[_0xcbf1('0x34')]};return db['VoiceAgentReport']['count'](_0x7266df)[_0xcbf1('0x21')](function(_0x2d56b7){_0x3b08a6[_0xcbf1('0x19')]=_0x2d56b7;if(_0x56ddda['query']['includeAll']){_0x386f20[_0xcbf1('0x3b')]=[{'all':!![]}];}return db[_0xcbf1('0x27')]['findAll'](_0x386f20);})[_0xcbf1('0x21')](function(_0x229309){_0x3b08a6[_0xcbf1('0x3c')]=_0x229309;return _0x3b08a6;})['then'](respondWithFilteredResult(_0x1de06d,_0x386f20))['catch'](handleError(_0x1de06d,null));};exports[_0xcbf1('0x3d')]=function(_0x3f2f4b,_0xda8cb8){var _0xfd69d={'raw':![],'where':{'id':_0x3f2f4b['params']['id']}},_0x5ac664={};_0x5ac664[_0xcbf1('0x2b')]=_['keys'](db[_0xcbf1('0x27')]['rawAttributes']);_0x5ac664['query']=_[_0xcbf1('0x2d')](_0x3f2f4b[_0xcbf1('0x2c')]);_0x5ac664[_0xcbf1('0x36')]=_[_0xcbf1('0x2e')](_0x5ac664[_0xcbf1('0x2b')],_0x5ac664['query']);_0xfd69d['attributes']=_[_0xcbf1('0x2e')](_0x5ac664[_0xcbf1('0x2b')],qs['fields'](_0x3f2f4b[_0xcbf1('0x2c')][_0xcbf1('0x3e')]));_0xfd69d[_0xcbf1('0x2f')]=_0xfd69d['attributes']['length']?_0xfd69d[_0xcbf1('0x2f')]:_0x5ac664[_0xcbf1('0x2b')];if(_0x3f2f4b[_0xcbf1('0x2c')][_0xcbf1('0x3f')]){_0xfd69d[_0xcbf1('0x3b')]=[{'all':!![]}];}_0xfd69d=_[_0xcbf1('0x38')]({},_0xfd69d,_0x3f2f4b[_0xcbf1('0x3a')]);return db[_0xcbf1('0x27')][_0xcbf1('0x40')](_0xfd69d)[_0xcbf1('0x21')](handleEntityNotFound(_0xda8cb8,null))['then'](respondWithResult(_0xda8cb8,null))[_0xcbf1('0x41')](handleError(_0xda8cb8,null));};exports[_0xcbf1('0x42')]=function(_0x1c08ee,_0x5deabf){return db[_0xcbf1('0x27')][_0xcbf1('0x42')](_0x1c08ee[_0xcbf1('0x43')],{})[_0xcbf1('0x21')](respondWithResult(_0x5deabf,0xc9))[_0xcbf1('0x41')](handleError(_0x5deabf,null));};exports[_0xcbf1('0x44')]=function(_0x1afbd2,_0x9dbdb9){if(_0x1afbd2['body']['id']){delete _0x1afbd2['body']['id'];}return db[_0xcbf1('0x27')][_0xcbf1('0x40')]({'where':{'id':_0x1afbd2['params']['id']}})[_0xcbf1('0x21')](handleEntityNotFound(_0x9dbdb9,null))[_0xcbf1('0x21')](saveUpdates(_0x1afbd2[_0xcbf1('0x43')],null))[_0xcbf1('0x21')](respondWithResult(_0x9dbdb9,null))['catch'](handleError(_0x9dbdb9,null));};exports[_0xcbf1('0x22')]=function(_0x530d8d,_0x1adc87){return db[_0xcbf1('0x27')][_0xcbf1('0x40')]({'where':{'id':_0x530d8d[_0xcbf1('0x45')]['id']}})[_0xcbf1('0x21')](handleEntityNotFound(_0x1adc87,null))['then'](removeEntity(_0x1adc87,null))[_0xcbf1('0x41')](handleError(_0x1adc87,null));};exports['describe']=function(_0x2f477f,_0x5a5a7f){return db[_0xcbf1('0x27')]['describe']()[_0xcbf1('0x21')](respondWithResult(_0x5a5a7f,null))[_0xcbf1('0x41')](handleError(_0x5a5a7f,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 1f0df5a..d32192b 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 _0x2cff=['uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceAgentReport','report_agent'];(function(_0x1ed15f,_0x392cf0){var _0x445dc8=function(_0x2d45e7){while(--_0x2d45e7){_0x1ed15f['push'](_0x1ed15f['shift']());}};_0x445dc8(++_0x392cf0);}(_0x2cff,0xa7));var _0xf2cf=function(_0x39bc8f,_0x5f4e5d){_0x39bc8f=_0x39bc8f-0x0;var _0x162014=_0x2cff[_0x39bc8f];return _0x162014;};'use strict';var _=require(_0xf2cf('0x0'));var util=require(_0xf2cf('0x1'));var logger=require(_0xf2cf('0x2'))(_0xf2cf('0x3'));var moment=require(_0xf2cf('0x4'));var BPromise=require(_0xf2cf('0x5'));var rp=require(_0xf2cf('0x6'));var fs=require('fs');var path=require(_0xf2cf('0x7'));var rimraf=require(_0xf2cf('0x8'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0xf2cf('0x9')]=function(_0x13a0c2,_0x2f09f1){return _0x13a0c2[_0xf2cf('0xa')](_0xf2cf('0xb'),attributes,{'tableName':_0xf2cf('0xc'),'paranoid':![],'indexes':[{'fields':[_0xf2cf('0xd'),_0xf2cf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2a8e=['rimraf','exports','define','VoiceAgentReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4eaa30,_0x5b4c11){var _0x28a6f4=function(_0xf07b17){while(--_0xf07b17){_0x4eaa30['push'](_0x4eaa30['shift']());}};_0x28a6f4(++_0x5b4c11);}(_0x2a8e,0x191));var _0xe2a8=function(_0x224b26,_0x504950){_0x224b26=_0x224b26-0x0;var _0x42bb22=_0x2a8e[_0x224b26];return _0x42bb22;};'use strict';var _=require(_0xe2a8('0x0'));var util=require('util');var logger=require(_0xe2a8('0x1'))(_0xe2a8('0x2'));var moment=require(_0xe2a8('0x3'));var BPromise=require(_0xe2a8('0x4'));var rp=require(_0xe2a8('0x5'));var fs=require('fs');var path=require(_0xe2a8('0x6'));var rimraf=require(_0xe2a8('0x7'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0xe2a8('0x8')]=function(_0x25f5c0,_0x1d06b8){return _0x25f5c0[_0xe2a8('0x9')](_0xe2a8('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xe2a8('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index f2b9199..c393e28 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 _0xf7df=['catch','UpdateVoiceAgentReport','update','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xf7df,0x10d));var _0xff7d=function(_0x1d51fe,_0x245f78){_0x1d51fe=_0x1d51fe-0x0;var _0x2cf9cb=_0xf7df[_0x1d51fe];return _0x2cf9cb;};'use strict';var _=require(_0xff7d('0x0'));var util=require('util');var moment=require(_0xff7d('0x1'));var BPromise=require('bluebird');var rs=require(_0xff7d('0x2'));var fs=require('fs');var Redis=require(_0xff7d('0x3'));var db=require(_0xff7d('0x4'))['db'];var utils=require(_0xff7d('0x5'));var logger=require('../../config/logger')(_0xff7d('0x6'));var config=require(_0xff7d('0x7'));var jayson=require(_0xff7d('0x8'));var client=jayson[_0xff7d('0x9')][_0xff7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xea4cae,_0x333391,_0x3999c3){return new BPromise(function(_0x450a1f,_0x17b4f0){return client[_0xff7d('0xb')](_0xea4cae,_0x3999c3)[_0xff7d('0xc')](function(_0x300cd9){logger[_0xff7d('0xd')](_0xff7d('0xe'),_0x333391,'request\x20sent');logger[_0xff7d('0xf')](_0xff7d('0x10'),_0x333391,'request\x20sent',JSON['stringify'](_0x300cd9));if(_0x300cd9[_0xff7d('0x11')]){if(_0x300cd9['error'][_0xff7d('0x12')]===0x1f4){logger['error'](_0xff7d('0xe'),_0x333391,_0x300cd9[_0xff7d('0x11')][_0xff7d('0x13')]);return _0x17b4f0(_0x300cd9[_0xff7d('0x11')][_0xff7d('0x13')]);}logger[_0xff7d('0x11')](_0xff7d('0xe'),_0x333391,_0x300cd9[_0xff7d('0x11')][_0xff7d('0x13')]);return _0x450a1f(_0x300cd9[_0xff7d('0x11')][_0xff7d('0x13')]);}else{logger[_0xff7d('0xd')](_0xff7d('0xe'),_0x333391,_0xff7d('0x14'));_0x450a1f(_0x300cd9['result'][_0xff7d('0x13')]);}})['catch'](function(_0x28520c){logger[_0xff7d('0x11')](_0xff7d('0xe'),_0x333391,_0x28520c);_0x17b4f0(_0x28520c);});});}exports[_0xff7d('0x15')]=function(_0xf68bfe){var _0x1de324=this;return new Promise(function(_0x2a0643,_0x540750){return db[_0xff7d('0x16')][_0xff7d('0x17')](_0xf68bfe[_0xff7d('0x18')],{'raw':_0xf68bfe[_0xff7d('0x19')]?_0xf68bfe['options'][_0xff7d('0x1a')]===undefined?!![]:![]:!![]})[_0xff7d('0xc')](function(_0x384229){logger['info'](_0xff7d('0x15'),_0xf68bfe);logger[_0xff7d('0xf')](_0xff7d('0x15'),_0xf68bfe,JSON[_0xff7d('0x1b')](_0x384229));_0x2a0643(_0x384229);})[_0xff7d('0x1c')](function(_0x268945){logger[_0xff7d('0x11')]('CreateVoiceAgentReport',_0x268945[_0xff7d('0x13')],_0xf68bfe);_0x540750(_0x1de324[_0xff7d('0x11')](0x1f4,_0x268945[_0xff7d('0x13')]));});});};exports[_0xff7d('0x1d')]=function(_0x5c2f97){var _0x1171b1=this;return new Promise(function(_0x1073ab,_0x4a6821){return db['VoiceAgentReport'][_0xff7d('0x1e')](_0x5c2f97['body'],{'raw':_0x5c2f97[_0xff7d('0x19')]?_0x5c2f97['options'][_0xff7d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c2f97[_0xff7d('0x19')]?_0x5c2f97['options']['where']||null:null,'attributes':_0x5c2f97['options']?_0x5c2f97['options'][_0xff7d('0x1f')]||null:null,'limit':_0x5c2f97['options']?_0x5c2f97[_0xff7d('0x19')][_0xff7d('0x20')]||null:null})['then'](function(_0x4abecd){logger['info'](_0xff7d('0x1d'),_0x5c2f97);logger[_0xff7d('0xf')](_0xff7d('0x1d'),_0x5c2f97,JSON[_0xff7d('0x1b')](_0x4abecd));_0x1073ab(_0x4abecd);})[_0xff7d('0x1c')](function(_0x38edd9){logger[_0xff7d('0x11')](_0xff7d('0x1d'),_0x38edd9[_0xff7d('0x13')],_0x5c2f97);_0x4a6821(_0x1171b1[_0xff7d('0x11')](0x1f4,_0x38edd9['message']));});});}; \ No newline at end of file +var _0xa3a5=['create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceAgentReport'];(function(_0x5dd826,_0x42aee1){var _0x31209b=function(_0x3b3739){while(--_0x3b3739){_0x5dd826['push'](_0x5dd826['shift']());}};_0x31209b(++_0x42aee1);}(_0xa3a5,0xf9));var _0x5a3a=function(_0x2f7442,_0x96f83d){_0x2f7442=_0x2f7442-0x0;var _0x5d93ec=_0xa3a5[_0x2f7442];return _0x5d93ec;};'use strict';var _=require(_0x5a3a('0x0'));var util=require('util');var moment=require(_0x5a3a('0x1'));var BPromise=require(_0x5a3a('0x2'));var rs=require(_0x5a3a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a3a('0x4'))['db'];var utils=require(_0x5a3a('0x5'));var logger=require('../../config/logger')(_0x5a3a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5a3a('0x7')][_0x5a3a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f22c5,_0x463813,_0x2159f1){return new BPromise(function(_0x53cb69,_0x4817da){return client[_0x5a3a('0x9')](_0x2f22c5,_0x2159f1)['then'](function(_0x20a634){logger[_0x5a3a('0xa')](_0x5a3a('0xb'),_0x463813,_0x5a3a('0xc'));logger[_0x5a3a('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x463813,_0x5a3a('0xc'),JSON[_0x5a3a('0xe')](_0x20a634));if(_0x20a634['error']){if(_0x20a634[_0x5a3a('0xf')][_0x5a3a('0x10')]===0x1f4){logger[_0x5a3a('0xf')](_0x5a3a('0xb'),_0x463813,_0x20a634[_0x5a3a('0xf')][_0x5a3a('0x11')]);return _0x4817da(_0x20a634['error'][_0x5a3a('0x11')]);}logger[_0x5a3a('0xf')](_0x5a3a('0xb'),_0x463813,_0x20a634['error'][_0x5a3a('0x11')]);return _0x53cb69(_0x20a634[_0x5a3a('0xf')][_0x5a3a('0x11')]);}else{logger[_0x5a3a('0xa')](_0x5a3a('0xb'),_0x463813,_0x5a3a('0xc'));_0x53cb69(_0x20a634[_0x5a3a('0x12')][_0x5a3a('0x11')]);}})[_0x5a3a('0x13')](function(_0x24a766){logger['error'](_0x5a3a('0xb'),_0x463813,_0x24a766);_0x4817da(_0x24a766);});});}exports['CreateVoiceAgentReport']=function(_0xc138fe){var _0x48e0f2=this;return new Promise(function(_0x1df54f,_0x27ea8f){return db[_0x5a3a('0x14')][_0x5a3a('0x15')](_0xc138fe[_0x5a3a('0x16')],{'raw':_0xc138fe[_0x5a3a('0x17')]?_0xc138fe['options'][_0x5a3a('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x259ea4){logger[_0x5a3a('0xa')](_0x5a3a('0x19'),_0xc138fe);logger[_0x5a3a('0xd')](_0x5a3a('0x19'),_0xc138fe,JSON[_0x5a3a('0xe')](_0x259ea4));_0x1df54f(_0x259ea4);})[_0x5a3a('0x13')](function(_0x4bd529){logger['error'](_0x5a3a('0x19'),_0x4bd529[_0x5a3a('0x11')],_0xc138fe);_0x27ea8f(_0x48e0f2[_0x5a3a('0xf')](0x1f4,_0x4bd529['message']));});});};exports[_0x5a3a('0x1a')]=function(_0x4da310){var _0x2c83d5=this;return new Promise(function(_0xb5d711,_0x397d08){return db['VoiceAgentReport'][_0x5a3a('0x1b')](_0x4da310[_0x5a3a('0x16')],{'raw':_0x4da310[_0x5a3a('0x17')]?_0x4da310[_0x5a3a('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4da310[_0x5a3a('0x17')]?_0x4da310[_0x5a3a('0x17')][_0x5a3a('0x1c')]||null:null,'attributes':_0x4da310['options']?_0x4da310[_0x5a3a('0x17')][_0x5a3a('0x1d')]||null:null,'limit':_0x4da310['options']?_0x4da310[_0x5a3a('0x17')]['limit']||null:null})['then'](function(_0x1bf189){logger[_0x5a3a('0xa')]('UpdateVoiceAgentReport',_0x4da310);logger['debug'](_0x5a3a('0x1a'),_0x4da310,JSON[_0x5a3a('0xe')](_0x1bf189));_0xb5d711(_0x1bf189);})['catch'](function(_0x57f63d){logger[_0x5a3a('0xf')](_0x5a3a('0x1a'),_0x57f63d[_0x5a3a('0x11')],_0x4da310);_0x397d08(_0x2c83d5[_0x5a3a('0xf')](0x1f4,_0x57f63d['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 8565ed4..7773581 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','show','post'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','show','post'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 2eb5956..5932843 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 _0x277c=['TEXT','DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer'];(function(_0x4c7f6c,_0x2844b4){var _0x44b000=function(_0x41797a){while(--_0x41797a){_0x4c7f6c['push'](_0x4c7f6c['shift']());}};_0x44b000(++_0x2844b4);}(_0x277c,0x153));var _0xc277=function(_0x1119fc,_0x38fa13){_0x1119fc=_0x1119fc-0x0;var _0x41527e=_0x277c[_0x1119fc];return _0x41527e;};'use strict';var Sequelize=require(_0xc277('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc277('0x1')]},'type':{'type':Sequelize[_0xc277('0x2')](_0xc277('0x3'),_0xc277('0x4'),_0xc277('0x5'),_0xc277('0x6'),_0xc277('0x7'),_0xc277('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xc277('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xc277('0x1')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc277('0x1')]},'destinationchannel':{'type':Sequelize[_0xc277('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xc277('0x9')]},'starttime':{'type':Sequelize[_0xc277('0xa')]},'systemanswertime':{'type':Sequelize[_0xc277('0xa')]},'answertime':{'type':Sequelize[_0xc277('0xa')]},'endtime':{'type':Sequelize[_0xc277('0xa')]},'duration':{'type':Sequelize[_0xc277('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc277('0x1')]},'amaflags':{'type':Sequelize[_0xc277('0x1')]},'userfield':{'type':Sequelize[_0xc277('0x1')]},'userDisposition':{'type':Sequelize[_0xc277('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xc277('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xc277('0x1')]},'routeid':{'type':Sequelize[_0xc277('0xb')]},'sipcallid':{'type':Sequelize[_0xc277('0x1')]}}; \ No newline at end of file +var _0x2eb2=['outbound','outbound-fax','TEXT','DATE','INTEGER','exports','STRING','ENUM','inbound','internal'];(function(_0x2948ba,_0x119762){var _0x39859e=function(_0x5cb1cc){while(--_0x5cb1cc){_0x2948ba['push'](_0x2948ba['shift']());}};_0x39859e(++_0x119762);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x2eb2[_0x3e112d];return _0x531c31;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'uniqueid':{'type':Sequelize[_0x22eb('0x1')]},'type':{'type':Sequelize[_0x22eb('0x2')](_0x22eb('0x3'),_0x22eb('0x4'),_0x22eb('0x5'),'inbound-fax',_0x22eb('0x6'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x22eb('0x1')]},'source':{'type':Sequelize[_0x22eb('0x1')]},'destination':{'type':Sequelize[_0x22eb('0x1')]},'destinationcontext':{'type':Sequelize[_0x22eb('0x1')]},'callerid':{'type':Sequelize[_0x22eb('0x1')]},'channel':{'type':Sequelize[_0x22eb('0x1')]},'destinationchannel':{'type':Sequelize[_0x22eb('0x1')]},'lastapplication':{'type':Sequelize[_0x22eb('0x1')]},'lastdata':{'type':Sequelize[_0x22eb('0x7')]},'starttime':{'type':Sequelize[_0x22eb('0x8')]},'systemanswertime':{'type':Sequelize[_0x22eb('0x8')]},'answertime':{'type':Sequelize[_0x22eb('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x22eb('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x22eb('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x22eb('0x1')]},'userDisposition':{'type':Sequelize[_0x22eb('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x22eb('0x1')]},'prefix':{'type':Sequelize[_0x22eb('0x1')]},'routeid':{'type':Sequelize[_0x22eb('0x9')]},'sipcallid':{'type':Sequelize[_0x22eb('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 960bbcc..b324b8c 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 _0x2700=['sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','offset','sort','where','pick','filter','VIRTUAL','options','includeAll','include','User','findAll','rows','catch','params','length','merge','find','create','body','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util'];(function(_0x5d1978,_0x1c6811){var _0x1c60e1=function(_0x11fcbb){while(--_0x11fcbb){_0x5d1978['push'](_0x5d1978['shift']());}};_0x1c60e1(++_0x1c6811);}(_0x2700,0x8e));var _0x0270=function(_0x386842,_0x4cc77e){_0x386842=_0x386842-0x0;var _0x3bd4a7=_0x2700[_0x386842];return _0x3bd4a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0270('0x0'));var zipdir=require(_0x0270('0x1'));var jsonpatch=require(_0x0270('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0270('0x3'));var Mustache=require(_0x0270('0x4'));var util=require(_0x0270('0x5'));var path=require('path');var sox=require(_0x0270('0x6'));var csv=require(_0x0270('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0270('0x8'));var squel=require(_0x0270('0x9'));var crypto=require(_0x0270('0xa'));var jsforce=require(_0x0270('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0270('0x7'));var querystring=require(_0x0270('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0270('0xd'));var hardwareService=require(_0x0270('0xe'));var logger=require(_0x0270('0xf'))(_0x0270('0x10'));var utils=require(_0x0270('0x11'));var config=require(_0x0270('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x0270('0x13'))['db'];function respondWithStatusCode(_0x5200f8,_0x3a02c9){_0x3a02c9=_0x3a02c9||0xcc;return function(_0x36e700){if(_0x36e700){return _0x5200f8[_0x0270('0x14')](_0x3a02c9);}return _0x5200f8[_0x0270('0x15')](_0x3a02c9)['end']();};}function respondWithResult(_0x516d73,_0x270bd3){_0x270bd3=_0x270bd3||0xc8;return function(_0x1534a9){if(_0x1534a9){return _0x516d73['status'](_0x270bd3)[_0x0270('0x16')](_0x1534a9);}};}function respondWithFilteredResult(_0x5331eb,_0x353262){return function(_0x853a9f){if(_0x853a9f){var _0x3c5214=_0x853a9f[_0x0270('0x17')],_0x3c24ad=_0x353262['offset'],_0x3d00b0=_0x353262['offset']+_0x353262[_0x0270('0x18')],_0x4e7a86;if(_0x3d00b0>=_0x3c5214){_0x3d00b0=_0x3c5214;_0x4e7a86=0xc8;}else{_0x4e7a86=0xce;}_0x5331eb['status'](_0x4e7a86);return _0x5331eb[_0x0270('0x19')](_0x0270('0x1a'),_0x3c24ad+'-'+_0x3d00b0+'/'+_0x3c5214)[_0x0270('0x16')](_0x853a9f);}return null;};}function patchUpdates(_0x321351){return function(_0x251416){try{jsonpatch[_0x0270('0x1b')](_0x251416,_0x321351,!![]);}catch(_0x127f44){return BPromise[_0x0270('0x1c')](_0x127f44);}return _0x251416[_0x0270('0x1d')]();};}function saveUpdates(_0x984423,_0x5142a0){return function(_0x25ce50){if(_0x25ce50){return _0x25ce50[_0x0270('0x1e')](_0x984423)[_0x0270('0x1f')](function(_0x13166d){return _0x13166d;});}return null;};}function removeEntity(_0x5bb65f,_0x1e3c9d){return function(_0x8e39d2){if(_0x8e39d2){return _0x8e39d2[_0x0270('0x20')]()[_0x0270('0x1f')](function(){_0x5bb65f[_0x0270('0x15')](0xcc)[_0x0270('0x21')]();});}};}function handleEntityNotFound(_0x40582b,_0x3ed903){return function(_0x48ba76){if(!_0x48ba76){_0x40582b[_0x0270('0x14')](0x194);}return _0x48ba76;};}function handleError(_0xec8ec1,_0x956547){_0x956547=_0x956547||0x1f4;return function(_0x336996){logger[_0x0270('0x22')](_0x336996[_0x0270('0x23')]);if(_0x336996[_0x0270('0x24')]){delete _0x336996[_0x0270('0x24')];}_0xec8ec1[_0x0270('0x15')](_0x956547)[_0x0270('0x25')](_0x336996);};}exports[_0x0270('0x26')]=function(_0x2b855e,_0x48da45){var _0x493145={},_0x49e30b={},_0x581f66={'count':0x0,'rows':[]};var _0x51861e=_[_0x0270('0x27')](db[_0x0270('0x28')][_0x0270('0x29')],function(_0x2c3a8e){return{'name':_0x2c3a8e[_0x0270('0x2a')],'type':_0x2c3a8e[_0x0270('0x2b')]['key']};});_0x49e30b[_0x0270('0x2c')]=_[_0x0270('0x27')](_0x51861e,_0x0270('0x24'));_0x49e30b[_0x0270('0x2d')]=_[_0x0270('0x2e')](_0x2b855e[_0x0270('0x2d')]);_0x49e30b[_0x0270('0x2f')]=_[_0x0270('0x30')](_0x49e30b[_0x0270('0x2c')],_0x49e30b['query']);_0x493145['attributes']=_[_0x0270('0x30')](_0x49e30b['model'],qs['fields'](_0x2b855e[_0x0270('0x2d')][_0x0270('0x31')]));_0x493145['attributes']=_0x493145[_0x0270('0x32')]['length']?_0x493145[_0x0270('0x32')]:_0x49e30b[_0x0270('0x2c')];if(!_0x2b855e[_0x0270('0x2d')][_0x0270('0x33')]('nolimit')){_0x493145[_0x0270('0x18')]=qs[_0x0270('0x18')](_0x2b855e[_0x0270('0x2d')]['limit']);_0x493145[_0x0270('0x34')]=qs[_0x0270('0x34')](_0x2b855e['query'][_0x0270('0x34')]);}_0x493145['order']=qs[_0x0270('0x35')](_0x2b855e[_0x0270('0x2d')][_0x0270('0x35')]);_0x493145[_0x0270('0x36')]=qs[_0x0270('0x2f')](_[_0x0270('0x37')](_0x2b855e[_0x0270('0x2d')],_0x49e30b[_0x0270('0x2f')]),_0x51861e);if(_0x2b855e[_0x0270('0x2d')][_0x0270('0x38')]){_0x493145['where']=_['merge'](_0x493145[_0x0270('0x36')],{'$or':_[_0x0270('0x27')](_0x51861e,function(_0x3a8b93){if(_0x3a8b93[_0x0270('0x2b')]!==_0x0270('0x39')){var _0x2bca6b={};_0x2bca6b[_0x3a8b93[_0x0270('0x24')]]={'$like':'%'+_0x2b855e[_0x0270('0x2d')][_0x0270('0x38')]+'%'};return _0x2bca6b;}})});}_0x493145=_['merge']({},_0x493145,_0x2b855e[_0x0270('0x3a')]);var _0x319c4c={'where':_0x493145[_0x0270('0x36')]};return db['VoiceCallReport'][_0x0270('0x17')](_0x319c4c)['then'](function(_0x4d36de){_0x581f66['count']=_0x4d36de;if(_0x2b855e[_0x0270('0x2d')][_0x0270('0x3b')]){_0x493145[_0x0270('0x3c')]=[{'attributes':['id',_0x0270('0x24'),'fullname','alias'],'model':db[_0x0270('0x3d')],'as':_0x0270('0x3d')}];}return db[_0x0270('0x28')][_0x0270('0x3e')](_0x493145);})[_0x0270('0x1f')](function(_0x48ae19){_0x581f66[_0x0270('0x3f')]=_0x48ae19;return _0x581f66;})[_0x0270('0x1f')](respondWithFilteredResult(_0x48da45,_0x493145))[_0x0270('0x40')](handleError(_0x48da45,null));};exports['show']=function(_0x451d88,_0x582d82){var _0x9d9275={'raw':!![],'where':{'id':_0x451d88[_0x0270('0x41')]['id']}},_0x14028a={};_0x14028a[_0x0270('0x2c')]=_[_0x0270('0x2e')](db['VoiceCallReport'][_0x0270('0x29')]);_0x14028a[_0x0270('0x2d')]=_[_0x0270('0x2e')](_0x451d88['query']);_0x14028a[_0x0270('0x2f')]=_['intersection'](_0x14028a['model'],_0x14028a[_0x0270('0x2d')]);_0x9d9275['attributes']=_[_0x0270('0x30')](_0x14028a[_0x0270('0x2c')],qs[_0x0270('0x31')](_0x451d88['query'][_0x0270('0x31')]));_0x9d9275['attributes']=_0x9d9275[_0x0270('0x32')][_0x0270('0x42')]?_0x9d9275[_0x0270('0x32')]:_0x14028a[_0x0270('0x2c')];if(_0x451d88[_0x0270('0x2d')][_0x0270('0x3b')]){_0x9d9275[_0x0270('0x3c')]=[{'all':!![]}];}_0x9d9275=_[_0x0270('0x43')]({},_0x9d9275,_0x451d88[_0x0270('0x3a')]);return db[_0x0270('0x28')][_0x0270('0x44')](_0x9d9275)[_0x0270('0x1f')](handleEntityNotFound(_0x582d82,null))[_0x0270('0x1f')](respondWithResult(_0x582d82,null))['catch'](handleError(_0x582d82,null));};exports['create']=function(_0x477bc9,_0x4f3322){return db[_0x0270('0x28')][_0x0270('0x45')](_0x477bc9[_0x0270('0x46')],{})[_0x0270('0x1f')](respondWithResult(_0x4f3322,0xc9))['catch'](handleError(_0x4f3322,null));};exports['destroy']=function(_0x5a4b28,_0x1c3d92){return db[_0x0270('0x28')][_0x0270('0x44')]({'where':{'id':_0x5a4b28[_0x0270('0x41')]['id']}})[_0x0270('0x1f')](handleEntityNotFound(_0x1c3d92,null))[_0x0270('0x1f')](removeEntity(_0x1c3d92,null))[_0x0270('0x40')](handleError(_0x1c3d92,null));};exports[_0x0270('0x47')]=function(_0x4030a4,_0xe15042){return db[_0x0270('0x28')][_0x0270('0x47')]()['then'](respondWithResult(_0xe15042,null))['catch'](handleError(_0xe15042,null));};exports['update']=function(_0x6da6f4,_0x599ec0){if(_0x6da6f4[_0x0270('0x46')][_0x0270('0x48')]){delete _0x6da6f4[_0x0270('0x46')][_0x0270('0x48')];}return db['VoiceCallReport']['find']({'where':{'uniqueid':_0x6da6f4[_0x0270('0x41')]['id'],'UserId':{'$or':[null,_0x6da6f4[_0x0270('0x49')]['id']]}}})[_0x0270('0x1f')](handleEntityNotFound(_0x599ec0,null))[_0x0270('0x1f')](saveUpdates(_0x6da6f4[_0x0270('0x46')],null))[_0x0270('0x1f')](respondWithResult(_0x599ec0,null))[_0x0270('0x40')](handleError(_0x599ec0,null));}; \ No newline at end of file +var _0xb133=['find','catch','create','body','describe','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','limit','order','sort','where','VIRTUAL','merge','options','includeAll','include','fullname','alias','User','findAll','show','params'];(function(_0x5b356c,_0x29a3f1){var _0x5684d7=function(_0x32bee0){while(--_0x32bee0){_0x5b356c['push'](_0x5b356c['shift']());}};_0x5684d7(++_0x29a3f1);}(_0xb133,0x197));var _0x3b13=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb133[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x3b13('0x0'));var rimraf=require(_0x3b13('0x1'));var zipdir=require(_0x3b13('0x2'));var jsonpatch=require(_0x3b13('0x3'));var rp=require(_0x3b13('0x4'));var moment=require('moment');var BPromise=require(_0x3b13('0x5'));var Mustache=require(_0x3b13('0x6'));var util=require(_0x3b13('0x7'));var path=require(_0x3b13('0x8'));var sox=require(_0x3b13('0x9'));var csv=require(_0x3b13('0xa'));var ejs=require(_0x3b13('0xb'));var fs=require('fs');var fs_extra=require(_0x3b13('0xc'));var _=require(_0x3b13('0xd'));var squel=require(_0x3b13('0xe'));var crypto=require(_0x3b13('0xf'));var jsforce=require(_0x3b13('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3b13('0x11'));var authService=require(_0x3b13('0x12'));var qs=require(_0x3b13('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b13('0x14'));var logger=require(_0x3b13('0x15'))(_0x3b13('0x16'));var utils=require(_0x3b13('0x17'));var config=require(_0x3b13('0x18'));var licenseUtil=require(_0x3b13('0x19'));var db=require(_0x3b13('0x1a'))['db'];function respondWithStatusCode(_0x1972d8,_0x534d8d){_0x534d8d=_0x534d8d||0xcc;return function(_0x40c94f){if(_0x40c94f){return _0x1972d8[_0x3b13('0x1b')](_0x534d8d);}return _0x1972d8[_0x3b13('0x1c')](_0x534d8d)['end']();};}function respondWithResult(_0x429311,_0x3edeaf){_0x3edeaf=_0x3edeaf||0xc8;return function(_0x1c3fc0){if(_0x1c3fc0){return _0x429311[_0x3b13('0x1c')](_0x3edeaf)['json'](_0x1c3fc0);}};}function respondWithFilteredResult(_0x355b05,_0x486946){return function(_0x5df52c){if(_0x5df52c){var _0x36bebb=_0x5df52c[_0x3b13('0x1d')],_0x266ec1=_0x486946[_0x3b13('0x1e')],_0x5aff56=_0x486946[_0x3b13('0x1e')]+_0x486946['limit'],_0xe2910a;if(_0x5aff56>=_0x36bebb){_0x5aff56=_0x36bebb;_0xe2910a=0xc8;}else{_0xe2910a=0xce;}_0x355b05['status'](_0xe2910a);return _0x355b05[_0x3b13('0x1f')](_0x3b13('0x20'),_0x266ec1+'-'+_0x5aff56+'/'+_0x36bebb)[_0x3b13('0x21')](_0x5df52c);}return null;};}function patchUpdates(_0x463829){return function(_0x2976da){try{jsonpatch[_0x3b13('0x22')](_0x2976da,_0x463829,!![]);}catch(_0x535028){return BPromise[_0x3b13('0x23')](_0x535028);}return _0x2976da[_0x3b13('0x24')]();};}function saveUpdates(_0x349be7,_0x2e1b45){return function(_0x547b1f){if(_0x547b1f){return _0x547b1f['update'](_0x349be7)[_0x3b13('0x25')](function(_0x38a768){return _0x38a768;});}return null;};}function removeEntity(_0x1ec213,_0x7d1fd5){return function(_0x4c9e74){if(_0x4c9e74){return _0x4c9e74[_0x3b13('0x26')]()[_0x3b13('0x25')](function(){_0x1ec213[_0x3b13('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe16e79,_0xe83b10){return function(_0x4143a6){if(!_0x4143a6){_0xe16e79[_0x3b13('0x1b')](0x194);}return _0x4143a6;};}function handleError(_0x5ef4f7,_0x1f3d4b){_0x1f3d4b=_0x1f3d4b||0x1f4;return function(_0xea77f5){logger[_0x3b13('0x27')](_0xea77f5[_0x3b13('0x28')]);if(_0xea77f5[_0x3b13('0x29')]){delete _0xea77f5[_0x3b13('0x29')];}_0x5ef4f7[_0x3b13('0x1c')](_0x1f3d4b)[_0x3b13('0x2a')](_0xea77f5);};}exports[_0x3b13('0x2b')]=function(_0x437b38,_0x2d9ecf){var _0x454b9b={},_0x159e61={},_0x148465={'count':0x0,'rows':[]};var _0x599039=_[_0x3b13('0x2c')](db[_0x3b13('0x2d')][_0x3b13('0x2e')],function(_0x1e0b61){return{'name':_0x1e0b61[_0x3b13('0x2f')],'type':_0x1e0b61[_0x3b13('0x30')][_0x3b13('0x31')]};});_0x159e61[_0x3b13('0x32')]=_['map'](_0x599039,_0x3b13('0x29'));_0x159e61[_0x3b13('0x33')]=_[_0x3b13('0x34')](_0x437b38[_0x3b13('0x33')]);_0x159e61[_0x3b13('0x35')]=_[_0x3b13('0x36')](_0x159e61['model'],_0x159e61[_0x3b13('0x33')]);_0x454b9b['attributes']=_['intersection'](_0x159e61['model'],qs[_0x3b13('0x37')](_0x437b38['query']['fields']));_0x454b9b[_0x3b13('0x38')]=_0x454b9b[_0x3b13('0x38')][_0x3b13('0x39')]?_0x454b9b[_0x3b13('0x38')]:_0x159e61[_0x3b13('0x32')];if(!_0x437b38[_0x3b13('0x33')]['hasOwnProperty']('nolimit')){_0x454b9b[_0x3b13('0x3a')]=qs['limit'](_0x437b38['query'][_0x3b13('0x3a')]);_0x454b9b[_0x3b13('0x1e')]=qs[_0x3b13('0x1e')](_0x437b38[_0x3b13('0x33')][_0x3b13('0x1e')]);}_0x454b9b[_0x3b13('0x3b')]=qs[_0x3b13('0x3c')](_0x437b38[_0x3b13('0x33')][_0x3b13('0x3c')]);_0x454b9b['where']=qs[_0x3b13('0x35')](_['pick'](_0x437b38[_0x3b13('0x33')],_0x159e61['filters']),_0x599039);if(_0x437b38[_0x3b13('0x33')]['filter']){_0x454b9b[_0x3b13('0x3d')]=_['merge'](_0x454b9b[_0x3b13('0x3d')],{'$or':_['map'](_0x599039,function(_0x2a9b4e){if(_0x2a9b4e['type']!==_0x3b13('0x3e')){var _0x5984b8={};_0x5984b8[_0x2a9b4e[_0x3b13('0x29')]]={'$like':'%'+_0x437b38['query']['filter']+'%'};return _0x5984b8;}})});}_0x454b9b=_[_0x3b13('0x3f')]({},_0x454b9b,_0x437b38[_0x3b13('0x40')]);var _0xb29ef2={'where':_0x454b9b[_0x3b13('0x3d')]};return db[_0x3b13('0x2d')][_0x3b13('0x1d')](_0xb29ef2)[_0x3b13('0x25')](function(_0x3d490b){_0x148465[_0x3b13('0x1d')]=_0x3d490b;if(_0x437b38[_0x3b13('0x33')][_0x3b13('0x41')]){_0x454b9b[_0x3b13('0x42')]=[{'attributes':['id',_0x3b13('0x29'),_0x3b13('0x43'),_0x3b13('0x44')],'model':db['User'],'as':_0x3b13('0x45')}];}return db[_0x3b13('0x2d')][_0x3b13('0x46')](_0x454b9b);})[_0x3b13('0x25')](function(_0x56ce20){_0x148465['rows']=_0x56ce20;return _0x148465;})[_0x3b13('0x25')](respondWithFilteredResult(_0x2d9ecf,_0x454b9b))['catch'](handleError(_0x2d9ecf,null));};exports[_0x3b13('0x47')]=function(_0x206b36,_0x55df7e){var _0x10117e={'raw':!![],'where':{'id':_0x206b36[_0x3b13('0x48')]['id']}},_0x324795={};_0x324795[_0x3b13('0x32')]=_[_0x3b13('0x34')](db['VoiceCallReport']['rawAttributes']);_0x324795[_0x3b13('0x33')]=_[_0x3b13('0x34')](_0x206b36['query']);_0x324795[_0x3b13('0x35')]=_[_0x3b13('0x36')](_0x324795['model'],_0x324795[_0x3b13('0x33')]);_0x10117e['attributes']=_['intersection'](_0x324795[_0x3b13('0x32')],qs[_0x3b13('0x37')](_0x206b36[_0x3b13('0x33')][_0x3b13('0x37')]));_0x10117e[_0x3b13('0x38')]=_0x10117e[_0x3b13('0x38')]['length']?_0x10117e[_0x3b13('0x38')]:_0x324795[_0x3b13('0x32')];if(_0x206b36['query'][_0x3b13('0x41')]){_0x10117e[_0x3b13('0x42')]=[{'all':!![]}];}_0x10117e=_['merge']({},_0x10117e,_0x206b36[_0x3b13('0x40')]);return db[_0x3b13('0x2d')][_0x3b13('0x49')](_0x10117e)[_0x3b13('0x25')](handleEntityNotFound(_0x55df7e,null))['then'](respondWithResult(_0x55df7e,null))[_0x3b13('0x4a')](handleError(_0x55df7e,null));};exports[_0x3b13('0x4b')]=function(_0xb14d01,_0x511907){return db[_0x3b13('0x2d')][_0x3b13('0x4b')](_0xb14d01[_0x3b13('0x4c')],{})[_0x3b13('0x25')](respondWithResult(_0x511907,0xc9))[_0x3b13('0x4a')](handleError(_0x511907,null));};exports['destroy']=function(_0x11373b,_0x24fd8d){return db[_0x3b13('0x2d')][_0x3b13('0x49')]({'where':{'id':_0x11373b[_0x3b13('0x48')]['id']}})[_0x3b13('0x25')](handleEntityNotFound(_0x24fd8d,null))[_0x3b13('0x25')](removeEntity(_0x24fd8d,null))[_0x3b13('0x4a')](handleError(_0x24fd8d,null));};exports[_0x3b13('0x4d')]=function(_0x3af35a,_0x33b41a){return db[_0x3b13('0x2d')][_0x3b13('0x4d')]()['then'](respondWithResult(_0x33b41a,null))[_0x3b13('0x4a')](handleError(_0x33b41a,null));};exports['update']=function(_0x53eabd,_0x9aedc8){if(_0x53eabd[_0x3b13('0x4c')][_0x3b13('0x4e')]){delete _0x53eabd[_0x3b13('0x4c')][_0x3b13('0x4e')];}return db[_0x3b13('0x2d')][_0x3b13('0x49')]({'where':{'uniqueid':_0x53eabd[_0x3b13('0x48')]['id'],'UserId':{'$or':[null,_0x53eabd[_0x3b13('0x4f')]['id']]}}})[_0x3b13('0x25')](handleEntityNotFound(_0x9aedc8,null))[_0x3b13('0x25')](saveUpdates(_0x53eabd[_0x3b13('0x4c')],null))[_0x3b13('0x25')](respondWithResult(_0x9aedc8,null))[_0x3b13('0x4a')](handleError(_0x9aedc8,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 4d4b09a..f6b373f 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 _0x5a80=['define','VoiceCallReport','report_call','uniqueid','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x1ccdcc,_0x838292){var _0x4b96be=function(_0x1af66a){while(--_0x1af66a){_0x1ccdcc['push'](_0x1ccdcc['shift']());}};_0x4b96be(++_0x838292);}(_0x5a80,0x124));var _0x05a8=function(_0x14c837,_0x304fc0){_0x14c837=_0x14c837-0x0;var _0x3a8033=_0x5a80[_0x14c837];return _0x3a8033;};'use strict';var _=require(_0x05a8('0x0'));var util=require(_0x05a8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x05a8('0x2'));var BPromise=require('bluebird');var rp=require(_0x05a8('0x3'));var fs=require('fs');var path=require(_0x05a8('0x4'));var rimraf=require(_0x05a8('0x5'));var config=require(_0x05a8('0x6'));var attributes=require(_0x05a8('0x7'));module['exports']=function(_0x3f2f40,_0x4e6e72){return _0x3f2f40[_0x05a8('0x8')](_0x05a8('0x9'),attributes,{'tableName':_0x05a8('0xa'),'paranoid':![],'indexes':[{'fields':[_0x05a8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc8b=['uniqueid','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','VoiceCallReport'];(function(_0x3e6f08,_0x4ec425){var _0x137c93=function(_0x5b3593){while(--_0x5b3593){_0x3e6f08['push'](_0x3e6f08['shift']());}};_0x137c93(++_0x4ec425);}(_0xcc8b,0xd9));var _0xbcc8=function(_0x1ea8b5,_0x5d3011){_0x1ea8b5=_0x1ea8b5-0x0;var _0x3a9df6=_0xcc8b[_0x1ea8b5];return _0x3a9df6;};'use strict';var _=require(_0xbcc8('0x0'));var util=require(_0xbcc8('0x1'));var logger=require(_0xbcc8('0x2'))('api');var moment=require(_0xbcc8('0x3'));var BPromise=require('bluebird');var rp=require(_0xbcc8('0x4'));var fs=require('fs');var path=require(_0xbcc8('0x5'));var rimraf=require('rimraf');var config=require(_0xbcc8('0x6'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x51a809,_0x15a65b){return _0x51a809['define'](_0xbcc8('0x7'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xbcc8('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index ccc9260..82c490b 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 _0x1ae0=['map','model','attributes','catch','CreateVoiceCallReport','create','body','raw','stringify','UpdateVoiceCallReport','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','limit','include'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x1ae0,0x16a));var _0x01ae=function(_0x404460,_0x53dcf8){_0x404460=_0x404460-0x0;var _0x423a08=_0x1ae0[_0x404460];return _0x423a08;};'use strict';var _=require(_0x01ae('0x0'));var util=require(_0x01ae('0x1'));var moment=require(_0x01ae('0x2'));var BPromise=require(_0x01ae('0x3'));var rs=require(_0x01ae('0x4'));var fs=require('fs');var Redis=require(_0x01ae('0x5'));var db=require(_0x01ae('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x01ae('0x7'))(_0x01ae('0x8'));var config=require(_0x01ae('0x9'));var jayson=require(_0x01ae('0xa'));var client=jayson['client'][_0x01ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x160937,_0x1b4586,_0x296873){return new BPromise(function(_0x3d314f,_0x4439c5){return client[_0x01ae('0xc')](_0x160937,_0x296873)[_0x01ae('0xd')](function(_0x115ea3){logger[_0x01ae('0xe')](_0x01ae('0xf'),_0x1b4586,'request\x20sent');logger[_0x01ae('0x10')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1b4586,_0x01ae('0x11'),JSON['stringify'](_0x115ea3));if(_0x115ea3[_0x01ae('0x12')]){if(_0x115ea3[_0x01ae('0x12')][_0x01ae('0x13')]===0x1f4){logger['error'](_0x01ae('0xf'),_0x1b4586,_0x115ea3[_0x01ae('0x12')]['message']);return _0x4439c5(_0x115ea3[_0x01ae('0x12')][_0x01ae('0x14')]);}logger[_0x01ae('0x12')](_0x01ae('0xf'),_0x1b4586,_0x115ea3[_0x01ae('0x12')]['message']);return _0x3d314f(_0x115ea3[_0x01ae('0x12')][_0x01ae('0x14')]);}else{logger['info'](_0x01ae('0xf'),_0x1b4586,_0x01ae('0x11'));_0x3d314f(_0x115ea3[_0x01ae('0x15')][_0x01ae('0x14')]);}})['catch'](function(_0x436c4a){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x1b4586,_0x436c4a);_0x4439c5(_0x436c4a);});});}exports[_0x01ae('0x16')]=function(_0x20190d){var _0x3b8fbc=this;return new Promise(function(_0x2a30cf,_0x4dc64b){return db[_0x01ae('0x17')][_0x01ae('0x18')]({'raw':_0x20190d['options']?_0x20190d['options']['raw']===undefined?!![]:![]:!![],'where':_0x20190d[_0x01ae('0x19')]?_0x20190d['options']['where']||null:null,'attributes':_0x20190d[_0x01ae('0x19')]?_0x20190d[_0x01ae('0x19')]['attributes']||null:null,'limit':_0x20190d[_0x01ae('0x19')]?_0x20190d[_0x01ae('0x19')][_0x01ae('0x1a')]||null:null,'include':_0x20190d[_0x01ae('0x19')]?_0x20190d[_0x01ae('0x19')][_0x01ae('0x1b')]?_[_0x01ae('0x1c')](_0x20190d[_0x01ae('0x19')][_0x01ae('0x1b')],function(_0x526a26){return{'model':db[_0x526a26[_0x01ae('0x1d')]],'as':_0x526a26['as'],'attributes':_0x526a26[_0x01ae('0x1e')],'include':_0x526a26['include']?_[_0x01ae('0x1c')](_0x526a26[_0x01ae('0x1b')],function(_0x557ff3){return{'model':db[_0x557ff3['model']],'as':_0x557ff3['as'],'attributes':_0x557ff3['attributes'],'include':_0x557ff3[_0x01ae('0x1b')]?_['map'](_0x557ff3['include'],function(_0x16c0a0){return{'model':db[_0x16c0a0['model']],'as':_0x16c0a0['as'],'attributes':_0x16c0a0[_0x01ae('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x01ae('0xd')](function(_0x36a7f8){logger[_0x01ae('0xe')](_0x01ae('0x16'),_0x20190d);logger[_0x01ae('0x10')]('GetVoiceCallReport',_0x20190d,JSON['stringify'](_0x36a7f8));_0x2a30cf(_0x36a7f8);})[_0x01ae('0x1f')](function(_0x15ae2f){logger[_0x01ae('0x12')](_0x01ae('0x16'),_0x15ae2f[_0x01ae('0x14')],_0x20190d);_0x4dc64b(_0x3b8fbc[_0x01ae('0x12')](0x1f4,_0x15ae2f[_0x01ae('0x14')]));});});};exports[_0x01ae('0x20')]=function(_0x54d78f){var _0xdd8d50=this;return new Promise(function(_0x139868,_0x33b4d3){return db['VoiceCallReport'][_0x01ae('0x21')](_0x54d78f[_0x01ae('0x22')],{'raw':_0x54d78f[_0x01ae('0x19')]?_0x54d78f['options'][_0x01ae('0x23')]===undefined?!![]:![]:!![]})[_0x01ae('0xd')](function(_0x4a75c3){logger[_0x01ae('0xe')]('CreateVoiceCallReport',_0x54d78f);logger['debug'](_0x01ae('0x20'),_0x54d78f,JSON[_0x01ae('0x24')](_0x4a75c3));_0x139868(_0x4a75c3);})[_0x01ae('0x1f')](function(_0x216e2c){logger[_0x01ae('0x12')]('CreateVoiceCallReport',_0x216e2c['message'],_0x54d78f);_0x33b4d3(_0xdd8d50[_0x01ae('0x12')](0x1f4,_0x216e2c['message']));});});};exports[_0x01ae('0x25')]=function(_0x12be15){var _0x3ed3b8=this;return new Promise(function(_0x186dcb,_0x260280){return db[_0x01ae('0x17')]['update'](_0x12be15[_0x01ae('0x22')],{'raw':_0x12be15[_0x01ae('0x19')]?_0x12be15[_0x01ae('0x19')][_0x01ae('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12be15[_0x01ae('0x19')]?_0x12be15[_0x01ae('0x19')][_0x01ae('0x26')]||null:null,'attributes':_0x12be15[_0x01ae('0x19')]?_0x12be15[_0x01ae('0x19')][_0x01ae('0x1e')]||null:null,'limit':_0x12be15[_0x01ae('0x19')]?_0x12be15[_0x01ae('0x19')][_0x01ae('0x1a')]||null:null})['then'](function(_0x302e2b){logger[_0x01ae('0xe')](_0x01ae('0x25'),_0x12be15);logger[_0x01ae('0x10')](_0x01ae('0x25'),_0x12be15,JSON['stringify'](_0x302e2b));_0x186dcb(_0x302e2b);})[_0x01ae('0x1f')](function(_0x28396c){logger['error'](_0x01ae('0x25'),_0x28396c[_0x01ae('0x14')],_0x12be15);_0x260280(_0x3ed3b8[_0x01ae('0x12')](0x1f4,_0x28396c[_0x01ae('0x14')]));});});}; \ No newline at end of file +var _0x30aa=['create','update','body','raw','UpdateVoiceCallReport','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','where','attributes','limit','include','map','model','CreateVoiceCallReport'];(function(_0x2bab69,_0x1a39d6){var _0x16d45a=function(_0x3c92ed){while(--_0x3c92ed){_0x2bab69['push'](_0x2bab69['shift']());}};_0x16d45a(++_0x1a39d6);}(_0x30aa,0x99));var _0xa30a=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x30aa[_0x411add];return _0x238242;};'use strict';var _=require(_0xa30a('0x0'));var util=require(_0xa30a('0x1'));var moment=require(_0xa30a('0x2'));var BPromise=require('bluebird');var rs=require(_0xa30a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa30a('0x4'));var logger=require(_0xa30a('0x5'))(_0xa30a('0x6'));var config=require(_0xa30a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa30a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f9f9e,_0x157d84,_0x2ed0f0){return new BPromise(function(_0x4fc518,_0x9497f5){return client[_0xa30a('0x9')](_0x2f9f9e,_0x2ed0f0)[_0xa30a('0xa')](function(_0x42d516){logger[_0xa30a('0xb')](_0xa30a('0xc'),_0x157d84,_0xa30a('0xd'));logger[_0xa30a('0xe')](_0xa30a('0xf'),_0x157d84,_0xa30a('0xd'),JSON[_0xa30a('0x10')](_0x42d516));if(_0x42d516[_0xa30a('0x11')]){if(_0x42d516['error'][_0xa30a('0x12')]===0x1f4){logger[_0xa30a('0x11')](_0xa30a('0xc'),_0x157d84,_0x42d516['error'][_0xa30a('0x13')]);return _0x9497f5(_0x42d516[_0xa30a('0x11')][_0xa30a('0x13')]);}logger['error'](_0xa30a('0xc'),_0x157d84,_0x42d516[_0xa30a('0x11')][_0xa30a('0x13')]);return _0x4fc518(_0x42d516[_0xa30a('0x11')]['message']);}else{logger[_0xa30a('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x157d84,_0xa30a('0xd'));_0x4fc518(_0x42d516[_0xa30a('0x14')]['message']);}})[_0xa30a('0x15')](function(_0x46e6bf){logger[_0xa30a('0x11')](_0xa30a('0xc'),_0x157d84,_0x46e6bf);_0x9497f5(_0x46e6bf);});});}exports[_0xa30a('0x16')]=function(_0x1a70c6){var _0x319509=this;return new Promise(function(_0x4ec02c,_0x26b070){return db[_0xa30a('0x17')]['findAll']({'raw':_0x1a70c6['options']?_0x1a70c6[_0xa30a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1a70c6[_0xa30a('0x18')]?_0x1a70c6[_0xa30a('0x18')][_0xa30a('0x19')]||null:null,'attributes':_0x1a70c6[_0xa30a('0x18')]?_0x1a70c6[_0xa30a('0x18')][_0xa30a('0x1a')]||null:null,'limit':_0x1a70c6[_0xa30a('0x18')]?_0x1a70c6[_0xa30a('0x18')][_0xa30a('0x1b')]||null:null,'include':_0x1a70c6[_0xa30a('0x18')]?_0x1a70c6[_0xa30a('0x18')][_0xa30a('0x1c')]?_[_0xa30a('0x1d')](_0x1a70c6[_0xa30a('0x18')][_0xa30a('0x1c')],function(_0x52812b){return{'model':db[_0x52812b[_0xa30a('0x1e')]],'as':_0x52812b['as'],'attributes':_0x52812b[_0xa30a('0x1a')],'include':_0x52812b[_0xa30a('0x1c')]?_[_0xa30a('0x1d')](_0x52812b[_0xa30a('0x1c')],function(_0x3e6a0b){return{'model':db[_0x3e6a0b['model']],'as':_0x3e6a0b['as'],'attributes':_0x3e6a0b['attributes'],'include':_0x3e6a0b['include']?_[_0xa30a('0x1d')](_0x3e6a0b[_0xa30a('0x1c')],function(_0x4959d2){return{'model':db[_0x4959d2['model']],'as':_0x4959d2['as'],'attributes':_0x4959d2[_0xa30a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x180ef3){logger[_0xa30a('0xb')](_0xa30a('0x16'),_0x1a70c6);logger['debug'](_0xa30a('0x16'),_0x1a70c6,JSON[_0xa30a('0x10')](_0x180ef3));_0x4ec02c(_0x180ef3);})[_0xa30a('0x15')](function(_0x358df7){logger[_0xa30a('0x11')](_0xa30a('0x16'),_0x358df7['message'],_0x1a70c6);_0x26b070(_0x319509[_0xa30a('0x11')](0x1f4,_0x358df7['message']));});});};exports[_0xa30a('0x1f')]=function(_0x4fc774){var _0x126b5b=this;return new Promise(function(_0x24516f,_0x16741c){return db[_0xa30a('0x17')][_0xa30a('0x20')](_0x4fc774['body'],{'raw':_0x4fc774[_0xa30a('0x18')]?_0x4fc774[_0xa30a('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xa30a('0xa')](function(_0x444345){logger[_0xa30a('0xb')]('CreateVoiceCallReport',_0x4fc774);logger[_0xa30a('0xe')](_0xa30a('0x1f'),_0x4fc774,JSON[_0xa30a('0x10')](_0x444345));_0x24516f(_0x444345);})[_0xa30a('0x15')](function(_0x2cc3cf){logger[_0xa30a('0x11')](_0xa30a('0x1f'),_0x2cc3cf['message'],_0x4fc774);_0x16741c(_0x126b5b[_0xa30a('0x11')](0x1f4,_0x2cc3cf[_0xa30a('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x4d775e){var _0x5543ca=this;return new Promise(function(_0x405e2f,_0xa9eecc){return db[_0xa30a('0x17')][_0xa30a('0x21')](_0x4d775e[_0xa30a('0x22')],{'raw':_0x4d775e[_0xa30a('0x18')]?_0x4d775e[_0xa30a('0x18')][_0xa30a('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d775e['options']?_0x4d775e[_0xa30a('0x18')][_0xa30a('0x19')]||null:null,'attributes':_0x4d775e[_0xa30a('0x18')]?_0x4d775e[_0xa30a('0x18')][_0xa30a('0x1a')]||null:null,'limit':_0x4d775e[_0xa30a('0x18')]?_0x4d775e['options']['limit']||null:null})[_0xa30a('0xa')](function(_0x7e739a){logger[_0xa30a('0xb')](_0xa30a('0x24'),_0x4d775e);logger[_0xa30a('0xe')](_0xa30a('0x24'),_0x4d775e,JSON[_0xa30a('0x10')](_0x7e739a));_0x405e2f(_0x7e739a);})[_0xa30a('0x15')](function(_0x4ac805){logger['error'](_0xa30a('0x24'),_0x4ac805['message'],_0x4d775e);_0xa9eecc(_0x5543ca[_0xa30a('0x11')](0x1f4,_0x4ac805[_0xa30a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 96f0898..f18e483 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 _0x07cf=['show','post','create','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','isAuthenticated','index','/:id'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0x07cf,0x84));var _0xf07c=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x07cf[_0x487b0c];return _0x1adbdc;};'use strict';var multer=require(_0xf07c('0x0'));var util=require(_0xf07c('0x1'));var path=require(_0xf07c('0x2'));var timeout=require('connect-timeout');var express=require(_0xf07c('0x3'));var router=express[_0xf07c('0x4')]();var fs_extra=require(_0xf07c('0x5'));var auth=require(_0xf07c('0x6'));var interaction=require(_0xf07c('0x7'));var config=require('../../config/environment');var controller=require(_0xf07c('0x8'));router['get']('/',auth[_0xf07c('0x9')](),controller[_0xf07c('0xa')]);router['get'](_0xf07c('0xb'),auth[_0xf07c('0x9')](),controller[_0xf07c('0xc')]);router[_0xf07c('0xd')]('/',auth[_0xf07c('0x9')](),controller[_0xf07c('0xe')]);router[_0xf07c('0xf')]('/:id',auth[_0xf07c('0x9')](),controller['update']);router[_0xf07c('0x10')](_0xf07c('0xb'),auth[_0xf07c('0x9')](),controller['destroy']);module[_0xf07c('0x11')]=router; \ No newline at end of file +var _0x372b=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','connect-timeout','express','Router'];(function(_0x54f696,_0x532152){var _0x1323d8=function(_0x336656){while(--_0x336656){_0x54f696['push'](_0x54f696['shift']());}};_0x1323d8(++_0x532152);}(_0x372b,0x18a));var _0xb372=function(_0x357c6a,_0x356444){_0x357c6a=_0x357c6a-0x0;var _0x42ebf5=_0x372b[_0x357c6a];return _0x42ebf5;};'use strict';var multer=require(_0xb372('0x0'));var util=require(_0xb372('0x1'));var path=require('path');var timeout=require(_0xb372('0x2'));var express=require(_0xb372('0x3'));var router=express[_0xb372('0x4')]();var fs_extra=require(_0xb372('0x5'));var auth=require(_0xb372('0x6'));var interaction=require(_0xb372('0x7'));var config=require('../../config/environment');var controller=require(_0xb372('0x8'));router[_0xb372('0x9')]('/',auth[_0xb372('0xa')](),controller[_0xb372('0xb')]);router[_0xb372('0x9')](_0xb372('0xc'),auth[_0xb372('0xa')](),controller[_0xb372('0xd')]);router[_0xb372('0xe')]('/',auth[_0xb372('0xa')](),controller[_0xb372('0xf')]);router[_0xb372('0x10')]('/:id',auth[_0xb372('0xa')](),controller[_0xb372('0x11')]);router['delete'](_0xb372('0xc'),auth[_0xb372('0xa')](),controller['destroy']);module[_0xb372('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ea9af85..e3a4cef 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 _0x9934=['sequelize','exports','STRING','setDataValue','options','join','getDataValue','split','BOOLEAN'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x9934,0xf3));var _0x4993=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0x9934[_0x5e2751];return _0x139a39;};'use strict';var Sequelize=require(_0x4993('0x0'));module[_0x4993('0x1')]={'name':{'type':Sequelize[_0x4993('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x4993('0x2')],'set':function(_0x8837e){this[_0x4993('0x3')](_0x4993('0x4'),_0x8837e?_0x8837e[_0x4993('0x5')](''):[]);},'get':function(){return this[_0x4993('0x6')](_0x4993('0x4'))?this[_0x4993('0x6')](_0x4993('0x4'))[_0x4993('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x4993('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4993('0x2')]},'description':{'type':Sequelize[_0x4993('0x2')]}}; \ No newline at end of file +var _0xd41b=['options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x3bbbbf,_0xdcd66b){var _0x586a30=function(_0x20fbea){while(--_0x20fbea){_0x3bbbbf['push'](_0x3bbbbf['shift']());}};_0x586a30(++_0xdcd66b);}(_0xd41b,0x176));var _0xbd41=function(_0x555524,_0x283b03){_0x555524=_0x555524-0x0;var _0x3c3f11=_0xd41b[_0x555524];return _0x3c3f11;};'use strict';var Sequelize=require(_0xbd41('0x0'));module[_0xbd41('0x1')]={'name':{'type':Sequelize[_0xbd41('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xbd41('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xbd41('0x2')],'set':function(_0x23ed5d){this['setDataValue'](_0xbd41('0x4'),_0x23ed5d?_0x23ed5d[_0xbd41('0x5')](''):[]);},'get':function(){return this[_0xbd41('0x6')](_0xbd41('0x4'))?this[_0xbd41('0x6')](_0xbd41('0x4'))[_0xbd41('0x7')](''):[];}},'auth':{'type':Sequelize[_0xbd41('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xbd41('0x2')]},'record':{'type':Sequelize[_0xbd41('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbd41('0x2')]},'description':{'type':Sequelize[_0xbd41('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index d528c55..894500e 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 _0xc89f=['end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','rawAttributes','keys','length','find','create','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','request-promise','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status'];(function(_0x40064f,_0x4c53a5){var _0x2fef9b=function(_0x4820c8){while(--_0x4820c8){_0x40064f['push'](_0x40064f['shift']());}};_0x2fef9b(++_0x4c53a5);}(_0xc89f,0xc5));var _0xfc89=function(_0x54a816,_0x24f7b6){_0x54a816=_0x54a816-0x0;var _0x35b0d9=_0xc89f[_0x54a816];return _0x35b0d9;};'use strict';var emlformat=require(_0xfc89('0x0'));var rimraf=require(_0xfc89('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc89('0x2'));var rp=require(_0xfc89('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfc89('0x4'));var path=require(_0xfc89('0x5'));var sox=require('sox');var csv=require(_0xfc89('0x6'));var ejs=require(_0xfc89('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfc89('0x8'));var crypto=require(_0xfc89('0x9'));var jsforce=require(_0xfc89('0xa'));var deskjs=require(_0xfc89('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfc89('0xc'));var Papa=require(_0xfc89('0xd'));var Redis=require(_0xfc89('0xe'));var authService=require(_0xfc89('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfc89('0x10'));var hardwareService=require(_0xfc89('0x11'));var logger=require(_0xfc89('0x12'))(_0xfc89('0x13'));var utils=require('../../config/utils');var config=require(_0xfc89('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3adbcc,_0x4d89aa){_0x4d89aa=_0x4d89aa||0xcc;return function(_0x2ae43e){if(_0x2ae43e){return _0x3adbcc['sendStatus'](_0x4d89aa);}return _0x3adbcc[_0xfc89('0x15')](_0x4d89aa)[_0xfc89('0x16')]();};}function respondWithResult(_0x49bb8f,_0x2ec30e){_0x2ec30e=_0x2ec30e||0xc8;return function(_0x1fe5d5){if(_0x1fe5d5){return _0x49bb8f['status'](_0x2ec30e)[_0xfc89('0x17')](_0x1fe5d5);}};}function respondWithFilteredResult(_0x4ffede,_0x2217d2){return function(_0x4543fc){if(_0x4543fc){var _0x5d53b6=_0x4543fc[_0xfc89('0x18')],_0x24e6b5=_0x2217d2[_0xfc89('0x19')],_0x155605=_0x2217d2[_0xfc89('0x19')]+_0x2217d2[_0xfc89('0x1a')],_0x5093b4;if(_0x155605>=_0x5d53b6){_0x155605=_0x5d53b6;_0x5093b4=0xc8;}else{_0x5093b4=0xce;}_0x4ffede[_0xfc89('0x15')](_0x5093b4);return _0x4ffede[_0xfc89('0x1b')](_0xfc89('0x1c'),_0x24e6b5+'-'+_0x155605+'/'+_0x5d53b6)[_0xfc89('0x17')](_0x4543fc);}return null;};}function patchUpdates(_0xb5b38f){return function(_0x5b6380){try{jsonpatch['apply'](_0x5b6380,_0xb5b38f,!![]);}catch(_0x5162a5){return BPromise[_0xfc89('0x1d')](_0x5162a5);}return _0x5b6380[_0xfc89('0x1e')]();};}function saveUpdates(_0x16f667,_0x3bc988){return function(_0x260e2c){if(_0x260e2c){return _0x260e2c[_0xfc89('0x1f')](_0x16f667)[_0xfc89('0x20')](function(_0x45f2a0){return _0x45f2a0;});}return null;};}function removeEntity(_0x5b8247,_0x288df9){return function(_0x1e4b61){if(_0x1e4b61){return _0x1e4b61[_0xfc89('0x21')]()[_0xfc89('0x20')](function(){var _0x2b8197=_0x1e4b61[_0xfc89('0x22')]({'plain':!![]});var _0x2b008a='ChanSpies';return db[_0xfc89('0x23')][_0xfc89('0x21')]({'where':{'type':_0x2b008a,'resourceId':_0x2b8197['id']}})[_0xfc89('0x20')](function(){return _0x1e4b61;});})[_0xfc89('0x20')](function(){_0x5b8247[_0xfc89('0x15')](0xcc)[_0xfc89('0x16')]();});}};}function handleEntityNotFound(_0x55180f,_0x14a828){return function(_0x782ec0){if(!_0x782ec0){_0x55180f[_0xfc89('0x24')](0x194);}return _0x782ec0;};}function handleError(_0x35ad10,_0x2b5923){_0x2b5923=_0x2b5923||0x1f4;return function(_0x19b87c){logger['error'](_0x19b87c[_0xfc89('0x25')]);if(_0x19b87c[_0xfc89('0x26')]){delete _0x19b87c['name'];}_0x35ad10[_0xfc89('0x15')](_0x2b5923)[_0xfc89('0x27')](_0x19b87c);};}exports[_0xfc89('0x28')]=function(_0x483986,_0x37dcd9){var _0x511746={},_0x58e020={},_0x3d3cb0={'count':0x0,'rows':[]};var _0x48ea93=_[_0xfc89('0x29')](db[_0xfc89('0x2a')]['rawAttributes'],function(_0x2455bb){return{'name':_0x2455bb[_0xfc89('0x2b')],'type':_0x2455bb[_0xfc89('0x2c')][_0xfc89('0x2d')]};});_0x58e020[_0xfc89('0x2e')]=_['map'](_0x48ea93,'name');_0x58e020['query']=_['keys'](_0x483986[_0xfc89('0x2f')]);_0x58e020[_0xfc89('0x30')]=_[_0xfc89('0x31')](_0x58e020[_0xfc89('0x2e')],_0x58e020[_0xfc89('0x2f')]);_0x511746['attributes']=_[_0xfc89('0x31')](_0x58e020[_0xfc89('0x2e')],qs[_0xfc89('0x32')](_0x483986['query'][_0xfc89('0x32')]));_0x511746[_0xfc89('0x33')]=_0x511746['attributes']['length']?_0x511746['attributes']:_0x58e020[_0xfc89('0x2e')];if(!_0x483986[_0xfc89('0x2f')][_0xfc89('0x34')](_0xfc89('0x35'))){_0x511746[_0xfc89('0x1a')]=qs[_0xfc89('0x1a')](_0x483986[_0xfc89('0x2f')][_0xfc89('0x1a')]);_0x511746[_0xfc89('0x19')]=qs[_0xfc89('0x19')](_0x483986[_0xfc89('0x2f')][_0xfc89('0x19')]);}_0x511746['order']=qs['sort'](_0x483986['query']['sort']);_0x511746[_0xfc89('0x36')]=qs[_0xfc89('0x30')](_[_0xfc89('0x37')](_0x483986[_0xfc89('0x2f')],_0x58e020[_0xfc89('0x30')]),_0x48ea93);if(_0x483986['query'][_0xfc89('0x38')]){_0x511746[_0xfc89('0x36')]=_[_0xfc89('0x39')](_0x511746[_0xfc89('0x36')],{'$or':_['map'](_0x48ea93,function(_0x3bf54e){if(_0x3bf54e[_0xfc89('0x2c')]!==_0xfc89('0x3a')){var _0x2de1c4={};_0x2de1c4[_0x3bf54e['name']]={'$like':'%'+_0x483986[_0xfc89('0x2f')]['filter']+'%'};return _0x2de1c4;}})});}_0x511746=_['merge']({},_0x511746,_0x483986[_0xfc89('0x3b')]);var _0x229ba8={'where':_0x511746[_0xfc89('0x36')]};return db[_0xfc89('0x2a')][_0xfc89('0x18')](_0x229ba8)[_0xfc89('0x20')](function(_0x5d3bee){_0x3d3cb0[_0xfc89('0x18')]=_0x5d3bee;if(_0x483986[_0xfc89('0x2f')][_0xfc89('0x3c')]){_0x511746['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xfc89('0x3d')](_0x511746);})['then'](function(_0x19d8d0){_0x3d3cb0['rows']=_0x19d8d0;return _0x3d3cb0;})[_0xfc89('0x20')](respondWithFilteredResult(_0x37dcd9,_0x511746))[_0xfc89('0x3e')](handleError(_0x37dcd9,null));};exports['show']=function(_0x1aef26,_0x177b8d){var _0x199d5d={'raw':![],'where':{'id':_0x1aef26['params']['id']}},_0x56a1f6={};_0x56a1f6['model']=_['keys'](db['VoiceChanSpy'][_0xfc89('0x3f')]);_0x56a1f6[_0xfc89('0x2f')]=_[_0xfc89('0x40')](_0x1aef26['query']);_0x56a1f6[_0xfc89('0x30')]=_[_0xfc89('0x31')](_0x56a1f6[_0xfc89('0x2e')],_0x56a1f6[_0xfc89('0x2f')]);_0x199d5d['attributes']=_[_0xfc89('0x31')](_0x56a1f6[_0xfc89('0x2e')],qs[_0xfc89('0x32')](_0x1aef26[_0xfc89('0x2f')][_0xfc89('0x32')]));_0x199d5d[_0xfc89('0x33')]=_0x199d5d[_0xfc89('0x33')][_0xfc89('0x41')]?_0x199d5d[_0xfc89('0x33')]:_0x56a1f6[_0xfc89('0x2e')];if(_0x1aef26[_0xfc89('0x2f')][_0xfc89('0x3c')]){_0x199d5d['include']=[{'all':!![]}];}_0x199d5d=_[_0xfc89('0x39')]({},_0x199d5d,_0x1aef26['options']);return db[_0xfc89('0x2a')][_0xfc89('0x42')](_0x199d5d)['then'](handleEntityNotFound(_0x177b8d,null))[_0xfc89('0x20')](respondWithResult(_0x177b8d,null))[_0xfc89('0x3e')](handleError(_0x177b8d,null));};exports['create']=function(_0x5deb72,_0x46c793){return db[_0xfc89('0x2a')][_0xfc89('0x43')](_0x5deb72['body'],{})['then'](function(_0x26161e){var _0x5f1d9=_0x5deb72[_0xfc89('0x44')][_0xfc89('0x22')]({'plain':!![]});if(!_0x5f1d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f1d9[_0xfc89('0x45')]===_0xfc89('0x44')){var _0x41c804=_0x26161e['get']({'plain':!![]});var _0x3d8070='ChanSpies';return db['UserProfileSection'][_0xfc89('0x42')]({'where':{'name':_0x3d8070,'userProfileId':_0x5f1d9['userProfileId']},'raw':!![]})[_0xfc89('0x20')](function(_0x2666d9){if(_0x2666d9&&_0x2666d9['autoAssociation']===0x0){return db[_0xfc89('0x23')][_0xfc89('0x43')]({'name':_0x41c804['name'],'resourceId':_0x41c804['id'],'type':_0x2666d9['name'],'sectionId':_0x2666d9['id']},{})['then'](function(){return _0x26161e;});}else{return _0x26161e;}})['catch'](function(_0x425df3){logger['error'](_0xfc89('0x46'),_0x425df3);throw _0x425df3;});}return _0x26161e;})[_0xfc89('0x20')](respondWithResult(_0x46c793,0xc9))['catch'](handleError(_0x46c793,null));};exports[_0xfc89('0x1f')]=function(_0x3ceb2c,_0x4d59a0){if(_0x3ceb2c[_0xfc89('0x47')]['id']){delete _0x3ceb2c['body']['id'];}return db['VoiceChanSpy'][_0xfc89('0x42')]({'where':{'id':_0x3ceb2c[_0xfc89('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d59a0,null))[_0xfc89('0x20')](saveUpdates(_0x3ceb2c['body'],null))[_0xfc89('0x20')](respondWithResult(_0x4d59a0,null))[_0xfc89('0x3e')](handleError(_0x4d59a0,null));};exports['destroy']=function(_0x2e552d,_0x493d11){return db[_0xfc89('0x2a')][_0xfc89('0x42')]({'where':{'id':_0x2e552d['params']['id']}})['then'](handleEntityNotFound(_0x493d11,null))['then'](removeEntity(_0x493d11,null))['catch'](handleError(_0x493d11,null));}; \ No newline at end of file +var _0x5752=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','include','find','catch'];(function(_0x53807d,_0x4a90a8){var _0x501207=function(_0xea7078){while(--_0xea7078){_0x53807d['push'](_0x53807d['shift']());}};_0x501207(++_0x4a90a8);}(_0x5752,0x17f));var _0x2575=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x5752[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require(_0x2575('0x0'));var rimraf=require(_0x2575('0x1'));var zipdir=require(_0x2575('0x2'));var jsonpatch=require(_0x2575('0x3'));var rp=require(_0x2575('0x4'));var moment=require('moment');var BPromise=require(_0x2575('0x5'));var Mustache=require(_0x2575('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2575('0x7'));var fs=require('fs');var fs_extra=require(_0x2575('0x8'));var _=require('lodash');var squel=require(_0x2575('0x9'));var crypto=require(_0x2575('0xa'));var jsforce=require(_0x2575('0xb'));var deskjs=require(_0x2575('0xc'));var toCsv=require(_0x2575('0xd'));var querystring=require(_0x2575('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2575('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2575('0x10'));var licenseUtil=require(_0x2575('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xabef4a,_0xf0fab7){_0xf0fab7=_0xf0fab7||0xcc;return function(_0x42bd7d){if(_0x42bd7d){return _0xabef4a[_0x2575('0x12')](_0xf0fab7);}return _0xabef4a[_0x2575('0x13')](_0xf0fab7)[_0x2575('0x14')]();};}function respondWithResult(_0x2ecaa9,_0x3b1daf){_0x3b1daf=_0x3b1daf||0xc8;return function(_0x56d32b){if(_0x56d32b){return _0x2ecaa9[_0x2575('0x13')](_0x3b1daf)[_0x2575('0x15')](_0x56d32b);}};}function respondWithFilteredResult(_0x41391b,_0x18c069){return function(_0xc316ad){if(_0xc316ad){var _0xc3ff3e=_0xc316ad[_0x2575('0x16')],_0x3ca886=_0x18c069[_0x2575('0x17')],_0x18946c=_0x18c069[_0x2575('0x17')]+_0x18c069[_0x2575('0x18')],_0x3a572e;if(_0x18946c>=_0xc3ff3e){_0x18946c=_0xc3ff3e;_0x3a572e=0xc8;}else{_0x3a572e=0xce;}_0x41391b[_0x2575('0x13')](_0x3a572e);return _0x41391b[_0x2575('0x19')](_0x2575('0x1a'),_0x3ca886+'-'+_0x18946c+'/'+_0xc3ff3e)[_0x2575('0x15')](_0xc316ad);}return null;};}function patchUpdates(_0x3a09b4){return function(_0x5f35df){try{jsonpatch[_0x2575('0x1b')](_0x5f35df,_0x3a09b4,!![]);}catch(_0x276f3a){return BPromise[_0x2575('0x1c')](_0x276f3a);}return _0x5f35df['save']();};}function saveUpdates(_0x19dd0a,_0x3f15cb){return function(_0x2659f9){if(_0x2659f9){return _0x2659f9[_0x2575('0x1d')](_0x19dd0a)[_0x2575('0x1e')](function(_0x3cd5c0){return _0x3cd5c0;});}return null;};}function removeEntity(_0x1aa3ca,_0x3f5eb4){return function(_0x634945){if(_0x634945){return _0x634945[_0x2575('0x1f')]()[_0x2575('0x1e')](function(){var _0xbe04ad=_0x634945[_0x2575('0x20')]({'plain':!![]});var _0x2da5b1=_0x2575('0x21');return db[_0x2575('0x22')][_0x2575('0x1f')]({'where':{'type':_0x2da5b1,'resourceId':_0xbe04ad['id']}})[_0x2575('0x1e')](function(){return _0x634945;});})[_0x2575('0x1e')](function(){_0x1aa3ca[_0x2575('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x527aba,_0x3f09a0){return function(_0x3b204a){if(!_0x3b204a){_0x527aba['sendStatus'](0x194);}return _0x3b204a;};}function handleError(_0x6c1800,_0x357afc){_0x357afc=_0x357afc||0x1f4;return function(_0x1dab35){logger[_0x2575('0x23')](_0x1dab35[_0x2575('0x24')]);if(_0x1dab35[_0x2575('0x25')]){delete _0x1dab35[_0x2575('0x25')];}_0x6c1800[_0x2575('0x13')](_0x357afc)[_0x2575('0x26')](_0x1dab35);};}exports[_0x2575('0x27')]=function(_0x1619bb,_0x1c4e58){var _0x17bb5c={},_0x29575c={},_0x38942d={'count':0x0,'rows':[]};var _0x42a570=_[_0x2575('0x28')](db[_0x2575('0x29')][_0x2575('0x2a')],function(_0x25a30f){return{'name':_0x25a30f[_0x2575('0x2b')],'type':_0x25a30f[_0x2575('0x2c')][_0x2575('0x2d')]};});_0x29575c[_0x2575('0x2e')]=_['map'](_0x42a570,_0x2575('0x25'));_0x29575c[_0x2575('0x2f')]=_[_0x2575('0x30')](_0x1619bb[_0x2575('0x2f')]);_0x29575c[_0x2575('0x31')]=_['intersection'](_0x29575c[_0x2575('0x2e')],_0x29575c[_0x2575('0x2f')]);_0x17bb5c[_0x2575('0x32')]=_[_0x2575('0x33')](_0x29575c[_0x2575('0x2e')],qs['fields'](_0x1619bb['query'][_0x2575('0x34')]));_0x17bb5c['attributes']=_0x17bb5c[_0x2575('0x32')][_0x2575('0x35')]?_0x17bb5c[_0x2575('0x32')]:_0x29575c[_0x2575('0x2e')];if(!_0x1619bb[_0x2575('0x2f')]['hasOwnProperty']('nolimit')){_0x17bb5c[_0x2575('0x18')]=qs[_0x2575('0x18')](_0x1619bb[_0x2575('0x2f')]['limit']);_0x17bb5c[_0x2575('0x17')]=qs[_0x2575('0x17')](_0x1619bb[_0x2575('0x2f')][_0x2575('0x17')]);}_0x17bb5c[_0x2575('0x36')]=qs[_0x2575('0x37')](_0x1619bb[_0x2575('0x2f')]['sort']);_0x17bb5c[_0x2575('0x38')]=qs[_0x2575('0x31')](_[_0x2575('0x39')](_0x1619bb[_0x2575('0x2f')],_0x29575c[_0x2575('0x31')]),_0x42a570);if(_0x1619bb[_0x2575('0x2f')][_0x2575('0x3a')]){_0x17bb5c['where']=_[_0x2575('0x3b')](_0x17bb5c['where'],{'$or':_[_0x2575('0x28')](_0x42a570,function(_0x1e25f8){if(_0x1e25f8[_0x2575('0x2c')]!==_0x2575('0x3c')){var _0x1133f2={};_0x1133f2[_0x1e25f8[_0x2575('0x25')]]={'$like':'%'+_0x1619bb[_0x2575('0x2f')][_0x2575('0x3a')]+'%'};return _0x1133f2;}})});}_0x17bb5c=_[_0x2575('0x3b')]({},_0x17bb5c,_0x1619bb[_0x2575('0x3d')]);var _0x2b638a={'where':_0x17bb5c['where']};return db['VoiceChanSpy'][_0x2575('0x16')](_0x2b638a)[_0x2575('0x1e')](function(_0x21c7a8){_0x38942d[_0x2575('0x16')]=_0x21c7a8;if(_0x1619bb[_0x2575('0x2f')]['includeAll']){_0x17bb5c['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x2575('0x3e')](_0x17bb5c);})[_0x2575('0x1e')](function(_0x398cef){_0x38942d[_0x2575('0x3f')]=_0x398cef;return _0x38942d;})[_0x2575('0x1e')](respondWithFilteredResult(_0x1c4e58,_0x17bb5c))['catch'](handleError(_0x1c4e58,null));};exports['show']=function(_0x4651a3,_0x207e5b){var _0x4f9eeb={'raw':![],'where':{'id':_0x4651a3['params']['id']}},_0xe46072={};_0xe46072[_0x2575('0x2e')]=_[_0x2575('0x30')](db['VoiceChanSpy']['rawAttributes']);_0xe46072[_0x2575('0x2f')]=_[_0x2575('0x30')](_0x4651a3[_0x2575('0x2f')]);_0xe46072[_0x2575('0x31')]=_[_0x2575('0x33')](_0xe46072[_0x2575('0x2e')],_0xe46072[_0x2575('0x2f')]);_0x4f9eeb['attributes']=_[_0x2575('0x33')](_0xe46072[_0x2575('0x2e')],qs[_0x2575('0x34')](_0x4651a3['query'][_0x2575('0x34')]));_0x4f9eeb['attributes']=_0x4f9eeb['attributes']['length']?_0x4f9eeb[_0x2575('0x32')]:_0xe46072['model'];if(_0x4651a3['query']['includeAll']){_0x4f9eeb[_0x2575('0x40')]=[{'all':!![]}];}_0x4f9eeb=_['merge']({},_0x4f9eeb,_0x4651a3[_0x2575('0x3d')]);return db[_0x2575('0x29')][_0x2575('0x41')](_0x4f9eeb)[_0x2575('0x1e')](handleEntityNotFound(_0x207e5b,null))['then'](respondWithResult(_0x207e5b,null))[_0x2575('0x42')](handleError(_0x207e5b,null));};exports[_0x2575('0x43')]=function(_0x53f4b5,_0x281916){return db[_0x2575('0x29')][_0x2575('0x43')](_0x53f4b5[_0x2575('0x44')],{})[_0x2575('0x1e')](function(_0x688d40){var _0x3c7efe=_0x53f4b5[_0x2575('0x45')][_0x2575('0x20')]({'plain':!![]});if(!_0x3c7efe)throw new Error(_0x2575('0x46'));if(_0x3c7efe[_0x2575('0x47')]===_0x2575('0x45')){var _0x35a4d0=_0x688d40[_0x2575('0x20')]({'plain':!![]});var _0x1ae499='ChanSpies';return db['UserProfileSection']['find']({'where':{'name':_0x1ae499,'userProfileId':_0x3c7efe[_0x2575('0x48')]},'raw':!![]})[_0x2575('0x1e')](function(_0x2c2ecb){if(_0x2c2ecb&&_0x2c2ecb[_0x2575('0x49')]===0x0){return db[_0x2575('0x22')]['create']({'name':_0x35a4d0[_0x2575('0x25')],'resourceId':_0x35a4d0['id'],'type':_0x2c2ecb[_0x2575('0x25')],'sectionId':_0x2c2ecb['id']},{})[_0x2575('0x1e')](function(){return _0x688d40;});}else{return _0x688d40;}})[_0x2575('0x42')](function(_0x1c4c97){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c4c97);throw _0x1c4c97;});}return _0x688d40;})['then'](respondWithResult(_0x281916,0xc9))[_0x2575('0x42')](handleError(_0x281916,null));};exports[_0x2575('0x1d')]=function(_0xbc6316,_0x3c3d98){if(_0xbc6316[_0x2575('0x44')]['id']){delete _0xbc6316[_0x2575('0x44')]['id'];}return db[_0x2575('0x29')]['find']({'where':{'id':_0xbc6316[_0x2575('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c3d98,null))[_0x2575('0x1e')](saveUpdates(_0xbc6316[_0x2575('0x44')],null))[_0x2575('0x1e')](respondWithResult(_0x3c3d98,null))[_0x2575('0x42')](handleError(_0x3c3d98,null));};exports[_0x2575('0x1f')]=function(_0x42cbf8,_0x20e51b){return db[_0x2575('0x29')][_0x2575('0x41')]({'where':{'id':_0x42cbf8[_0x2575('0x4a')]['id']}})['then'](handleEntityNotFound(_0x20e51b,null))['then'](removeEntity(_0x20e51b,null))['catch'](handleError(_0x20e51b,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 770784c..892663f 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 _0x18b8=['VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','join','StopMixMonitor','length','internal','concat','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy'];(function(_0x1263b8,_0x2636c4){var _0x5de4bc=function(_0x258fdb){while(--_0x258fdb){_0x1263b8['push'](_0x1263b8['shift']());}};_0x5de4bc(++_0x2636c4);}(_0x18b8,0xff));var _0x818b=function(_0x4bcda0,_0x1b34fd){_0x4bcda0=_0x4bcda0-0x0;var _0x5e079e=_0x18b8[_0x4bcda0];return _0x5e079e;};'use strict';var _=require(_0x818b('0x0'));var util=require(_0x818b('0x1'));var BPromise=require(_0x818b('0x2'));var attributes=require(_0x818b('0x3'));var getUserApplications=function(_0x2b8488,_0x18bf70,_0x40793d){var _0x1bf5f4=0x1;var _0x47047f=[];var _0x3717c6={'context':_0x18bf70['context']||_0x818b('0x4'),'exten':util[_0x818b('0x5')](_0x818b('0x6'),_0x2b8488[_0x818b('0x7')],_0x40793d),'type':_0x818b('0x8'),'isApp':![],'ChanSpyId':_0x2b8488['id'],'UserId':_0x18bf70['id']};_0x47047f[_0x818b('0x9')](_[_0x818b('0xa')]({'app':_0x818b('0xb'),'appdata':util['format'](_0x818b('0xc'),_0x818b('0xd')),'priority':_0x1bf5f4++},_0x3717c6));if(_0x2b8488[_0x818b('0xe')]){_0x47047f[_0x818b('0x9')](_['merge']({'app':_0x818b('0xf'),'appdata':util[_0x818b('0x5')](_0x818b('0x10'),_0x2b8488[_0x818b('0x11')]),'priority':_0x1bf5f4++},_0x3717c6));}if(_0x2b8488[_0x818b('0x12')]){_0x47047f[_0x818b('0x9')](_[_0x818b('0xa')]({'app':_0x818b('0x13'),'appdata':_0x2b8488[_0x818b('0x14')],'priority':_0x1bf5f4++},_0x3717c6));}_0x47047f['push'](_['merge']({'app':'ChanSpy','appdata':util[_0x818b('0x5')](_0x818b('0x15'),_0x18bf70[_0x818b('0x16')],_0x2b8488[_0x818b('0x17')]?_0x2b8488[_0x818b('0x17')][_0x818b('0x18')](''):''),'priority':_0x1bf5f4++},_0x3717c6));if(_0x2b8488[_0x818b('0xe')]){_0x47047f[_0x818b('0x9')](_[_0x818b('0xa')]({'app':_0x818b('0x19'),'priority':_0x1bf5f4++},_0x3717c6));}return _0x47047f;};var getChanSpyApplications=function(_0x526481,_0x9a12a5){var _0x8a4306=[];for(var _0x463153=0x0,_0x3d426b=0x1;_0x463153<_0x9a12a5[_0x818b('0x1a')];_0x463153++,_0x3d426b=0x1){_0x8a4306=_0x8a4306['concat'](getUserApplications(_0x526481,_0x9a12a5[_0x463153],_0x9a12a5[_0x463153][_0x818b('0x1b')]));if(_0x9a12a5[_0x463153][_0x818b('0x1b')]!=_0x9a12a5[_0x463153][_0x818b('0x16')]){_0x8a4306=_0x8a4306[_0x818b('0x1c')](getUserApplications(_0x526481,_0x9a12a5[_0x463153],_0x9a12a5[_0x463153][_0x818b('0x16')]));}}return _0x8a4306;};var getChanSpyPromise=function(_0x2f6621,_0x4558c1){return new BPromise(function(_0x1865e7,_0x39cafa){return _0x2f6621[_0x818b('0x1d')][_0x818b('0x1e')]({'attributes':['id','name',_0x818b('0x1b')],'where':{'role':_0x818b('0x1f'),'chanspy':!![]},'raw':!![]})[_0x818b('0x20')](function(_0x4b3773){if(_0x4b3773){return _0x1865e7(getChanSpyApplications(_0x4558c1,_0x4b3773));}return _0x1865e7([]);})[_0x818b('0x21')](function(_0x2cd9d4){_0x39cafa(_0x2cd9d4);});});};module[_0x818b('0x22')]=function(_0x5c3f5c,_0x26aa40){var _0x1485cc=_0x5c3f5c[_0x818b('0x23')];return _0x5c3f5c[_0x818b('0x24')](_0x818b('0x25'),attributes,{'tableName':_0x818b('0x26'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xe08d42,_0x1b411e,_0x153135){return getChanSpyPromise(_0x1485cc,_0xe08d42)['then'](function(_0x415c89){if(_0x415c89&&_0x415c89[_0x818b('0x1a')]){return _0x1485cc[_0x818b('0x27')][_0x818b('0x28')](_0x415c89);}})['then'](function(){_0x153135();})[_0x818b('0x21')](function(_0x1cb1c8){_0x153135(_0x1cb1c8);});},'afterUpdate':function(_0x1f1829,_0x941386,_0x5e1f41){return _0x1485cc[_0x818b('0x27')]['destroy']({'where':{'ChanSpyId':_0x1f1829['id']}})[_0x818b('0x20')](function(){return getChanSpyPromise(_0x1485cc,_0x1f1829);})['then'](function(_0x736c3b){if(_0x736c3b&&_0x736c3b['length']){return _0x1485cc[_0x818b('0x27')][_0x818b('0x28')](_0x736c3b);}})[_0x818b('0x20')](function(){_0x5e1f41();})[_0x818b('0x21')](function(_0x1a9b5b){_0x5e1f41(_0x1a9b5b);});},'afterDestroy':function(_0x5f11f3,_0x81d77c,_0x5bc168){return _0x1485cc[_0x818b('0x27')][_0x818b('0x29')]({'where':{'ChanSpyId':_0x5f11f3['id']}})['then'](function(){_0x5bc168();})[_0x818b('0x21')](function(_0x25dc80){_0x5bc168(_0x25dc80);});}}});}; \ No newline at end of file +var _0xd0b5=['password','ChanSpy','SIP/%s,%s','options','StopMixMonitor','length','concat','internal','name','User','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','record','MixMonitor','recordingFormat','auth','Authenticate'];(function(_0x20c5ba,_0x1ae240){var _0x580bc8=function(_0x4e4fa8){while(--_0x4e4fa8){_0x20c5ba['push'](_0x20c5ba['shift']());}};_0x580bc8(++_0x1ae240);}(_0xd0b5,0x1b8));var _0x5d0b=function(_0x14b65a,_0x46af0a){_0x14b65a=_0x14b65a-0x0;var _0xb58977=_0xd0b5[_0x14b65a];return _0xb58977;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x5d0b('0x0'));var attributes=require(_0x5d0b('0x1'));var getUserApplications=function(_0x4ec330,_0x279734,_0x3e0e4a){var _0xa54ad7=0x1;var _0xb4d787=[];var _0x417046={'context':_0x279734[_0x5d0b('0x2')]||_0x5d0b('0x3'),'exten':util[_0x5d0b('0x4')](_0x5d0b('0x5'),_0x4ec330[_0x5d0b('0x6')],_0x3e0e4a),'type':_0x5d0b('0x7'),'isApp':![],'ChanSpyId':_0x4ec330['id'],'UserId':_0x279734['id']};_0xb4d787[_0x5d0b('0x8')](_[_0x5d0b('0x9')]({'app':'Set','appdata':util[_0x5d0b('0x4')]('CDR(type)=%s','chanspy'),'priority':_0xa54ad7++},_0x417046));if(_0x4ec330[_0x5d0b('0xa')]){_0xb4d787[_0x5d0b('0x8')](_['merge']({'app':_0x5d0b('0xb'),'appdata':util[_0x5d0b('0x4')]('${UNIQUEID}.%s,a',_0x4ec330[_0x5d0b('0xc')]),'priority':_0xa54ad7++},_0x417046));}if(_0x4ec330[_0x5d0b('0xd')]){_0xb4d787[_0x5d0b('0x8')](_[_0x5d0b('0x9')]({'app':_0x5d0b('0xe'),'appdata':_0x4ec330[_0x5d0b('0xf')],'priority':_0xa54ad7++},_0x417046));}_0xb4d787['push'](_[_0x5d0b('0x9')]({'app':_0x5d0b('0x10'),'appdata':util[_0x5d0b('0x4')](_0x5d0b('0x11'),_0x279734['name'],_0x4ec330[_0x5d0b('0x12')]?_0x4ec330[_0x5d0b('0x12')]['join'](''):''),'priority':_0xa54ad7++},_0x417046));if(_0x4ec330[_0x5d0b('0xa')]){_0xb4d787['push'](_['merge']({'app':_0x5d0b('0x13'),'priority':_0xa54ad7++},_0x417046));}return _0xb4d787;};var getChanSpyApplications=function(_0x411ed2,_0x3bd719){var _0x2937db=[];for(var _0x4892a4=0x0,_0x4e0fb9=0x1;_0x4892a4<_0x3bd719[_0x5d0b('0x14')];_0x4892a4++,_0x4e0fb9=0x1){_0x2937db=_0x2937db[_0x5d0b('0x15')](getUserApplications(_0x411ed2,_0x3bd719[_0x4892a4],_0x3bd719[_0x4892a4][_0x5d0b('0x16')]));if(_0x3bd719[_0x4892a4][_0x5d0b('0x16')]!=_0x3bd719[_0x4892a4][_0x5d0b('0x17')]){_0x2937db=_0x2937db[_0x5d0b('0x15')](getUserApplications(_0x411ed2,_0x3bd719[_0x4892a4],_0x3bd719[_0x4892a4][_0x5d0b('0x17')]));}}return _0x2937db;};var getChanSpyPromise=function(_0x27b434,_0x32cb2d){return new BPromise(function(_0x120b8f,_0x3cdb7d){return _0x27b434[_0x5d0b('0x18')]['findAll']({'attributes':['id','name',_0x5d0b('0x16')],'where':{'role':_0x5d0b('0x19'),'chanspy':!![]},'raw':!![]})[_0x5d0b('0x1a')](function(_0x25d4e1){if(_0x25d4e1){return _0x120b8f(getChanSpyApplications(_0x32cb2d,_0x25d4e1));}return _0x120b8f([]);})[_0x5d0b('0x1b')](function(_0x5975c1){_0x3cdb7d(_0x5975c1);});});};module[_0x5d0b('0x1c')]=function(_0x41afe3,_0x5a39f1){var _0x24e096=_0x41afe3[_0x5d0b('0x1d')];return _0x41afe3[_0x5d0b('0x1e')](_0x5d0b('0x1f'),attributes,{'tableName':_0x5d0b('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a6f66,_0x2c0928,_0x24c044){return getChanSpyPromise(_0x24e096,_0x4a6f66)[_0x5d0b('0x1a')](function(_0x2bdf03){if(_0x2bdf03&&_0x2bdf03[_0x5d0b('0x14')]){return _0x24e096[_0x5d0b('0x21')][_0x5d0b('0x22')](_0x2bdf03);}})['then'](function(){_0x24c044();})[_0x5d0b('0x1b')](function(_0x5b2adc){_0x24c044(_0x5b2adc);});},'afterUpdate':function(_0x4f0196,_0x40c6e2,_0x2c1b03){return _0x24e096[_0x5d0b('0x21')]['destroy']({'where':{'ChanSpyId':_0x4f0196['id']}})[_0x5d0b('0x1a')](function(){return getChanSpyPromise(_0x24e096,_0x4f0196);})[_0x5d0b('0x1a')](function(_0x4bfcc2){if(_0x4bfcc2&&_0x4bfcc2[_0x5d0b('0x14')]){return _0x24e096[_0x5d0b('0x21')][_0x5d0b('0x22')](_0x4bfcc2);}})['then'](function(){_0x2c1b03();})[_0x5d0b('0x1b')](function(_0xe387d2){_0x2c1b03(_0xe387d2);});},'afterDestroy':function(_0x3a6f22,_0x15e1b1,_0x2a93ec){return _0x24e096[_0x5d0b('0x21')]['destroy']({'where':{'ChanSpyId':_0x3a6f22['id']}})[_0x5d0b('0x1a')](function(){_0x2a93ec();})[_0x5d0b('0x1b')](function(_0x56a21c){_0x2a93ec(_0x56a21c);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index d62b9c0..f619057 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 _0xff48=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird'];(function(_0x29215d,_0x39143f){var _0x265037=function(_0x3e07ff){while(--_0x3e07ff){_0x29215d['push'](_0x29215d['shift']());}};_0x265037(++_0x39143f);}(_0xff48,0x15e));var _0x8ff4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff48[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ff4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8ff4('0x1'));var rs=require(_0x8ff4('0x2'));var fs=require('fs');var Redis=require(_0x8ff4('0x3'));var db=require(_0x8ff4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ff4('0x5'))(_0x8ff4('0x6'));var config=require(_0x8ff4('0x7'));var jayson=require(_0x8ff4('0x8'));var client=jayson[_0x8ff4('0x9')][_0x8ff4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x140b3a,_0x4ad888,_0x4de501){return new BPromise(function(_0x452ec9,_0x15e1e1){return client['request'](_0x140b3a,_0x4de501)[_0x8ff4('0xb')](function(_0x548465){logger[_0x8ff4('0xc')](_0x8ff4('0xd'),_0x4ad888,_0x8ff4('0xe'));logger[_0x8ff4('0xf')](_0x8ff4('0x10'),_0x4ad888,'request\x20sent',JSON[_0x8ff4('0x11')](_0x548465));if(_0x548465[_0x8ff4('0x12')]){if(_0x548465['error']['code']===0x1f4){logger[_0x8ff4('0x12')](_0x8ff4('0xd'),_0x4ad888,_0x548465['error'][_0x8ff4('0x13')]);return _0x15e1e1(_0x548465[_0x8ff4('0x12')]['message']);}logger[_0x8ff4('0x12')](_0x8ff4('0xd'),_0x4ad888,_0x548465[_0x8ff4('0x12')][_0x8ff4('0x13')]);return _0x452ec9(_0x548465[_0x8ff4('0x12')][_0x8ff4('0x13')]);}else{logger['info'](_0x8ff4('0xd'),_0x4ad888,'request\x20sent');_0x452ec9(_0x548465[_0x8ff4('0x14')][_0x8ff4('0x13')]);}})[_0x8ff4('0x15')](function(_0x1cb8bd){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x4ad888,_0x1cb8bd);_0x15e1e1(_0x1cb8bd);});});} \ No newline at end of file +var _0x23bf=['error','code','message','info','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x156a7b,_0x581641){var _0x2a8b96=function(_0x571881){while(--_0x571881){_0x156a7b['push'](_0x156a7b['shift']());}};_0x2a8b96(++_0x581641);}(_0x23bf,0x1a9));var _0xf23b=function(_0x2ed5dd,_0x11de93){_0x2ed5dd=_0x2ed5dd-0x0;var _0x4573ff=_0x23bf[_0x2ed5dd];return _0x4573ff;};'use strict';var _=require('lodash');var util=require(_0xf23b('0x0'));var moment=require(_0xf23b('0x1'));var BPromise=require(_0xf23b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf23b('0x3'));var db=require(_0xf23b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf23b('0x5'))(_0xf23b('0x6'));var config=require(_0xf23b('0x7'));var jayson=require(_0xf23b('0x8'));var client=jayson[_0xf23b('0x9')][_0xf23b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27f8f3,_0x588a5c,_0x575650){return new BPromise(function(_0x411d81,_0x341949){return client['request'](_0x27f8f3,_0x575650)[_0xf23b('0xb')](function(_0x3dfa27){logger['info'](_0xf23b('0xc'),_0x588a5c,_0xf23b('0xd'));logger['debug'](_0xf23b('0xe'),_0x588a5c,'request\x20sent',JSON[_0xf23b('0xf')](_0x3dfa27));if(_0x3dfa27['error']){if(_0x3dfa27[_0xf23b('0x10')][_0xf23b('0x11')]===0x1f4){logger[_0xf23b('0x10')](_0xf23b('0xc'),_0x588a5c,_0x3dfa27['error'][_0xf23b('0x12')]);return _0x341949(_0x3dfa27[_0xf23b('0x10')][_0xf23b('0x12')]);}logger[_0xf23b('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x588a5c,_0x3dfa27['error'][_0xf23b('0x12')]);return _0x411d81(_0x3dfa27[_0xf23b('0x10')][_0xf23b('0x12')]);}else{logger[_0xf23b('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x588a5c,_0xf23b('0xd'));_0x411d81(_0x3dfa27['result'][_0xf23b('0x12')]);}})[_0xf23b('0x14')](function(_0x4f7b97){logger[_0xf23b('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x588a5c,_0x4f7b97);_0x341949(_0x4f7b97);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 952115c..a1e2c5c 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 _0x3b75=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceContext.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete'];(function(_0x5efb15,_0x54361e){var _0x41997d=function(_0x2b8e56){while(--_0x2b8e56){_0x5efb15['push'](_0x5efb15['shift']());}};_0x41997d(++_0x54361e);}(_0x3b75,0x144));var _0x53b7=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0x3b75[_0x25c988];return _0x45fcc2;};'use strict';var multer=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var path=require(_0x53b7('0x2'));var timeout=require(_0x53b7('0x3'));var express=require(_0x53b7('0x4'));var router=express[_0x53b7('0x5')]();var fs_extra=require(_0x53b7('0x6'));var auth=require(_0x53b7('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x53b7('0x8'));router[_0x53b7('0x9')]('/',auth[_0x53b7('0xa')](),controller[_0x53b7('0xb')]);router['get']('/:id',auth[_0x53b7('0xa')](),controller[_0x53b7('0xc')]);router[_0x53b7('0xd')]('/',auth[_0x53b7('0xa')](),controller[_0x53b7('0xe')]);router['put'](_0x53b7('0xf'),auth[_0x53b7('0xa')](),controller[_0x53b7('0x10')]);router[_0x53b7('0x11')](_0x53b7('0xf'),auth[_0x53b7('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5178=['../../config/environment','get','index','/:id','isAuthenticated','show','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x577831,_0x5b8f90){var _0x181033=function(_0x2fa1b7){while(--_0x2fa1b7){_0x577831['push'](_0x577831['shift']());}};_0x181033(++_0x5b8f90);}(_0x5178,0x171));var _0x8517=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5178[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require(_0x8517('0x0'));var path=require(_0x8517('0x1'));var timeout=require(_0x8517('0x2'));var express=require(_0x8517('0x3'));var router=express[_0x8517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var controller=require('./voiceContext.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),auth[_0x8517('0xa')](),controller[_0x8517('0xb')]);router['post']('/',auth[_0x8517('0xa')](),controller['create']);router['put'](_0x8517('0x9'),auth[_0x8517('0xa')](),controller['update']);router[_0x8517('0xc')](_0x8517('0x9'),auth[_0x8517('0xa')](),controller[_0x8517('0xd')]);module[_0x8517('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index eab5be8..02b1d19 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 _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x363379,_0x52663a){var _0x3e0549=function(_0x3e2730){while(--_0x3e2730){_0x363379['push'](_0x363379['shift']());}};_0x3e0549(++_0x52663a);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe14b=['exports','STRING','BOOLEAN','sequelize'];(function(_0x15e5a,_0x30501e){var _0x335b2e=function(_0x39584d){while(--_0x39584d){_0x15e5a['push'](_0x15e5a['shift']());}};_0x335b2e(++_0x30501e);}(_0xe14b,0x93));var _0xbe14=function(_0xba2ada,_0x430c39){_0xba2ada=_0xba2ada-0x0;var _0x41f7fe=_0xe14b[_0xba2ada];return _0x41f7fe;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xbe14('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xbe14('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index b3b7a5b..a751bbb 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 _0x46df=['Contexts','UserProfileResource','end','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','Reload','rimraf','request-promise','bluebird','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','get'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x46df,0x95));var _0xf46d=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x46df[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf46d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf46d('0x1'));var moment=require('moment');var BPromise=require(_0xf46d('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf46d('0x3'));var sox=require(_0xf46d('0x4'));var csv=require(_0xf46d('0x5'));var ejs=require(_0xf46d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf46d('0x7'));var jsforce=require(_0xf46d('0x8'));var deskjs=require(_0xf46d('0x9'));var toCsv=require(_0xf46d('0x5'));var querystring=require('querystring');var Papa=require(_0xf46d('0xa'));var Redis=require(_0xf46d('0xb'));var authService=require(_0xf46d('0xc'));var qs=require(_0xf46d('0xd'));var as=require(_0xf46d('0xe'));var hardwareService=require(_0xf46d('0xf'));var logger=require(_0xf46d('0x10'))('api');var utils=require(_0xf46d('0x11'));var config=require(_0xf46d('0x12'));var licenseUtil=require(_0xf46d('0x13'));var db=require(_0xf46d('0x14'))['db'];var jayson=require(_0xf46d('0x15'));var client=jayson[_0xf46d('0x16')][_0xf46d('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x240d49,_0x1ddd27,_0x3a31ba,_0x25b0d3){return new BPromise(function(_0x26b56d,_0x484d4a){var _0x4d7b4e=_0x25b0d3||client;return _0x4d7b4e[_0xf46d('0x18')](_0x240d49,_0x3a31ba)[_0xf46d('0x19')](function(_0x7aab01){logger[_0xf46d('0x1a')](_0xf46d('0x1b'),_0x1ddd27,_0xf46d('0x1c'));logger[_0xf46d('0x1d')](_0xf46d('0x1e'),_0x1ddd27,_0xf46d('0x1c'),JSON[_0xf46d('0x1f')](_0x7aab01));if(_0x7aab01['error']){if(_0x7aab01[_0xf46d('0x20')][_0xf46d('0x21')]===0x1f4){logger[_0xf46d('0x20')](_0xf46d('0x1b'),_0x1ddd27,_0x7aab01['error'][_0xf46d('0x22')]);return _0x484d4a(_0x7aab01['error'][_0xf46d('0x22')]);}logger['error'](_0xf46d('0x1b'),_0x1ddd27,_0x7aab01[_0xf46d('0x20')][_0xf46d('0x22')]);return _0x26b56d(_0x7aab01[_0xf46d('0x20')][_0xf46d('0x22')]);}else{logger[_0xf46d('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x1ddd27,_0xf46d('0x1c'));_0x26b56d(_0x7aab01[_0xf46d('0x23')][_0xf46d('0x22')]);}})[_0xf46d('0x24')](function(_0x3692a7){logger[_0xf46d('0x20')](_0xf46d('0x1b'),_0x1ddd27,_0x3692a7);_0x484d4a(_0x3692a7);});});}function respondWithStatusCode(_0x5484c3,_0x14d615){_0x14d615=_0x14d615||0xcc;return function(_0x46751a){if(_0x46751a){return _0x5484c3[_0xf46d('0x25')](_0x14d615);}return _0x5484c3['status'](_0x14d615)['end']();};}function respondWithResult(_0x57c1b3,_0x165bf7){_0x165bf7=_0x165bf7||0xc8;return function(_0x841005){if(_0x841005){return _0x57c1b3[_0xf46d('0x26')](_0x165bf7)[_0xf46d('0x27')](_0x841005);}};}function respondWithFilteredResult(_0x30b48a,_0x17bd3b){return function(_0x12f493){if(_0x12f493){var _0x6ed6c4=_0x12f493[_0xf46d('0x28')],_0xfb13de=_0x17bd3b[_0xf46d('0x29')],_0x203642=_0x17bd3b[_0xf46d('0x29')]+_0x17bd3b[_0xf46d('0x2a')],_0x23b593;if(_0x203642>=_0x6ed6c4){_0x203642=_0x6ed6c4;_0x23b593=0xc8;}else{_0x23b593=0xce;}_0x30b48a[_0xf46d('0x26')](_0x23b593);return _0x30b48a['set'](_0xf46d('0x2b'),_0xfb13de+'-'+_0x203642+'/'+_0x6ed6c4)[_0xf46d('0x27')](_0x12f493);}return null;};}function patchUpdates(_0x249f64){return function(_0x21f975){try{jsonpatch[_0xf46d('0x2c')](_0x21f975,_0x249f64,!![]);}catch(_0x1497bd){return BPromise[_0xf46d('0x2d')](_0x1497bd);}return _0x21f975['save']();};}function saveUpdates(_0x1450f1,_0x1d2ee8){return function(_0x45a99f){if(_0x45a99f){return _0x45a99f[_0xf46d('0x2e')](_0x1450f1)[_0xf46d('0x19')](function(_0x8ec665){return _0x8ec665;});}return null;};}function removeEntity(_0x353e0c,_0x3498f0){return function(_0x2a15e1){if(_0x2a15e1){return _0x2a15e1[_0xf46d('0x2f')]()[_0xf46d('0x19')](function(){var _0x2f4ed7=_0x2a15e1[_0xf46d('0x30')]({'plain':!![]});var _0x2445b3=_0xf46d('0x31');return db[_0xf46d('0x32')][_0xf46d('0x2f')]({'where':{'type':_0x2445b3,'resourceId':_0x2f4ed7['id']}})[_0xf46d('0x19')](function(){return _0x2a15e1;});})['then'](function(){_0x353e0c['status'](0xcc)[_0xf46d('0x33')]();});}};}function handleEntityNotFound(_0x31a73d,_0x561329){return function(_0x10e76a){if(!_0x10e76a){_0x31a73d['sendStatus'](0x194);}return _0x10e76a;};}function handleError(_0x30df17,_0x4f8902){_0x4f8902=_0x4f8902||0x1f4;return function(_0x4f62e3){logger[_0xf46d('0x20')](_0x4f62e3[_0xf46d('0x34')]);if(_0x4f62e3[_0xf46d('0x35')]){delete _0x4f62e3[_0xf46d('0x35')];}_0x30df17['status'](_0x4f8902)['send'](_0x4f62e3);};}exports[_0xf46d('0x36')]=function(_0x12a380,_0x1fbd52){var _0x49f79b={},_0x81e8a1={},_0x205485={'count':0x0,'rows':[]};var _0x110a84=_[_0xf46d('0x37')](db[_0xf46d('0x38')][_0xf46d('0x39')],function(_0x4d2d13){return{'name':_0x4d2d13[_0xf46d('0x3a')],'type':_0x4d2d13[_0xf46d('0x3b')][_0xf46d('0x3c')]};});_0x81e8a1[_0xf46d('0x3d')]=_[_0xf46d('0x37')](_0x110a84,'name');_0x81e8a1[_0xf46d('0x3e')]=_[_0xf46d('0x3f')](_0x12a380['query']);_0x81e8a1['filters']=_[_0xf46d('0x40')](_0x81e8a1[_0xf46d('0x3d')],_0x81e8a1[_0xf46d('0x3e')]);_0x49f79b['attributes']=_[_0xf46d('0x40')](_0x81e8a1[_0xf46d('0x3d')],qs['fields'](_0x12a380[_0xf46d('0x3e')][_0xf46d('0x41')]));_0x49f79b[_0xf46d('0x42')]=_0x49f79b['attributes'][_0xf46d('0x43')]?_0x49f79b[_0xf46d('0x42')]:_0x81e8a1['model'];if(!_0x12a380[_0xf46d('0x3e')][_0xf46d('0x44')]('nolimit')){_0x49f79b[_0xf46d('0x2a')]=qs[_0xf46d('0x2a')](_0x12a380[_0xf46d('0x3e')][_0xf46d('0x2a')]);_0x49f79b[_0xf46d('0x29')]=qs[_0xf46d('0x29')](_0x12a380[_0xf46d('0x3e')][_0xf46d('0x29')]);}_0x49f79b['order']=qs[_0xf46d('0x45')](_0x12a380[_0xf46d('0x3e')]['sort']);_0x49f79b[_0xf46d('0x46')]=qs[_0xf46d('0x47')](_[_0xf46d('0x48')](_0x12a380[_0xf46d('0x3e')],_0x81e8a1['filters']),_0x110a84);if(_0x12a380[_0xf46d('0x3e')]['filter']){_0x49f79b[_0xf46d('0x46')]=_[_0xf46d('0x49')](_0x49f79b['where'],{'$or':_['map'](_0x110a84,function(_0x5575b7){if(_0x5575b7['type']!==_0xf46d('0x4a')){var _0x21aba1={};_0x21aba1[_0x5575b7[_0xf46d('0x35')]]={'$like':'%'+_0x12a380['query']['filter']+'%'};return _0x21aba1;}})});}_0x49f79b=_[_0xf46d('0x49')]({},_0x49f79b,_0x12a380[_0xf46d('0x4b')]);var _0x296ca0={'where':_0x49f79b['where']};return db[_0xf46d('0x38')][_0xf46d('0x28')](_0x296ca0)[_0xf46d('0x19')](function(_0xdf0e1f){_0x205485['count']=_0xdf0e1f;if(_0x12a380[_0xf46d('0x3e')][_0xf46d('0x4c')]){_0x49f79b[_0xf46d('0x4d')]=[{'all':!![]}];}return db[_0xf46d('0x38')][_0xf46d('0x4e')](_0x49f79b);})[_0xf46d('0x19')](function(_0x364c76){_0x205485[_0xf46d('0x4f')]=_0x364c76;return _0x205485;})[_0xf46d('0x19')](respondWithFilteredResult(_0x1fbd52,_0x49f79b))[_0xf46d('0x24')](handleError(_0x1fbd52,null));};exports[_0xf46d('0x50')]=function(_0x51ee21,_0x4859ab){var _0x61d8f4={'raw':![],'where':{'id':_0x51ee21[_0xf46d('0x51')]['id']}},_0x2275d1={};_0x2275d1[_0xf46d('0x3d')]=_['keys'](db['VoiceContext'][_0xf46d('0x39')]);_0x2275d1[_0xf46d('0x3e')]=_[_0xf46d('0x3f')](_0x51ee21[_0xf46d('0x3e')]);_0x2275d1[_0xf46d('0x47')]=_[_0xf46d('0x40')](_0x2275d1['model'],_0x2275d1[_0xf46d('0x3e')]);_0x61d8f4['attributes']=_['intersection'](_0x2275d1[_0xf46d('0x3d')],qs[_0xf46d('0x41')](_0x51ee21[_0xf46d('0x3e')][_0xf46d('0x41')]));_0x61d8f4['attributes']=_0x61d8f4[_0xf46d('0x42')][_0xf46d('0x43')]?_0x61d8f4[_0xf46d('0x42')]:_0x2275d1[_0xf46d('0x3d')];if(_0x51ee21[_0xf46d('0x3e')][_0xf46d('0x4c')]){_0x61d8f4[_0xf46d('0x4d')]=[{'all':!![]}];}_0x61d8f4=_[_0xf46d('0x49')]({},_0x61d8f4,_0x51ee21[_0xf46d('0x4b')]);return db['VoiceContext'][_0xf46d('0x52')](_0x61d8f4)[_0xf46d('0x19')](handleEntityNotFound(_0x4859ab,null))[_0xf46d('0x19')](respondWithResult(_0x4859ab,null))[_0xf46d('0x24')](handleError(_0x4859ab,null));};exports[_0xf46d('0x53')]=function(_0x282d54,_0x168d19,_0x2fd5e0){var _0x17c214;return db['VoiceContext'][_0xf46d('0x53')](_0x282d54[_0xf46d('0x54')],{'raw':!![]})[_0xf46d('0x19')](function(_0x49f17a){_0x17c214=_0x49f17a;return db[_0xf46d('0x38')][_0xf46d('0x4e')]({'raw':!![]});})[_0xf46d('0x19')](function(_0x72248c){var _0x4bcfea=fs[_0xf46d('0x55')](path[_0xf46d('0x56')](config[_0xf46d('0x57')],_0xf46d('0x58')),'utf8');var _0x2844c6=ejs[_0xf46d('0x59')](_0x4bcfea,{'contexts':_0x72248c||[]});fs[_0xf46d('0x5a')](_0xf46d('0x5b'),_0x2844c6);})['then'](function(){return respondWithRpcPromise('Reload',_0xf46d('0x53'),{'module':_0xf46d('0x5c')});})[_0xf46d('0x19')](function(){var _0x4431af=_0x282d54['user'][_0xf46d('0x30')]({'plain':!![]});if(!_0x4431af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4431af[_0xf46d('0x5d')]==='user'){var _0x6f0c93=_0x17c214[_0xf46d('0x30')]({'plain':!![]});return db['UserProfileSection'][_0xf46d('0x52')]({'where':{'name':_0xf46d('0x31'),'userProfileId':_0x4431af[_0xf46d('0x5e')]},'raw':!![]})[_0xf46d('0x19')](function(_0xc37419){if(_0xc37419&&_0xc37419[_0xf46d('0x5f')]===0x0){return db[_0xf46d('0x32')][_0xf46d('0x53')]({'name':_0x6f0c93[_0xf46d('0x35')],'resourceId':_0x6f0c93['id'],'type':_0xc37419[_0xf46d('0x35')],'sectionId':_0xc37419['id']},{})[_0xf46d('0x19')](function(){return _0x17c214;});}else{return _0x17c214;}})[_0xf46d('0x24')](function(_0x34c2e1){logger[_0xf46d('0x20')](_0xf46d('0x60'),_0x34c2e1);throw _0x34c2e1;});}return _0x17c214;})['then'](respondWithResult(_0x168d19,0xc9))[_0xf46d('0x24')](handleError(_0x168d19,null));};exports[_0xf46d('0x2e')]=function(_0x2f865a,_0x564e02,_0x1764eb){var _0x4b5544;return db[_0xf46d('0x38')][_0xf46d('0x52')]({'where':{'id':_0x2f865a[_0xf46d('0x51')]['id']}})[_0xf46d('0x19')](handleEntityNotFound(_0x564e02,null))['then'](saveUpdates(_0x2f865a[_0xf46d('0x54')],null))[_0xf46d('0x19')](function(_0x3470ff){if(_0x3470ff){_0x4b5544=_0x3470ff;return db[_0xf46d('0x38')][_0xf46d('0x4e')]({'raw':!![]});}})['then'](function(_0x3c4042){var _0xc2bc56=fs[_0xf46d('0x55')](path[_0xf46d('0x56')](config['root'],_0xf46d('0x58')),_0xf46d('0x61'));var _0x4d85b8=ejs[_0xf46d('0x59')](_0xc2bc56,{'contexts':_0x3c4042||[]});fs[_0xf46d('0x5a')](_0xf46d('0x5b'),_0x4d85b8);})['then'](function(){return respondWithRpcPromise(_0xf46d('0x62'),_0xf46d('0x2e'),{'module':'chan_sip.so'});})['then'](function(){return _0x4b5544;})[_0xf46d('0x19')](respondWithResult(_0x564e02,null))[_0xf46d('0x24')](handleError(_0x564e02,null));};exports[_0xf46d('0x2f')]=function(_0x25f3a,_0x3d8305,_0x40ddb3){var _0x162423;return db[_0xf46d('0x38')][_0xf46d('0x52')]({'where':{'id':_0x25f3a[_0xf46d('0x51')]['id']}})[_0xf46d('0x19')](handleEntityNotFound(_0x3d8305,null))[_0xf46d('0x19')](removeEntity(_0x3d8305,null))[_0xf46d('0x19')](function(){return db[_0xf46d('0x38')][_0xf46d('0x4e')]({'raw':!![]});})['then'](function(_0x2671ef){var _0x3c36b4=fs['readFileSync'](path[_0xf46d('0x56')](config[_0xf46d('0x57')],_0xf46d('0x58')),_0xf46d('0x61'));var _0x3b7387=ejs[_0xf46d('0x59')](_0x3c36b4,{'contexts':_0x2671ef});fs[_0xf46d('0x5a')](_0xf46d('0x5b'),_0x3b7387);return respondWithRpcPromise(_0xf46d('0x62'),_0xf46d('0x2f'),{'module':_0xf46d('0x5c')});})[_0xf46d('0x24')](handleError(_0x3d8305,null));}; \ No newline at end of file +var _0x78ce=['map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','include','findAll','rows','params','includeAll','options','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','request\x20sent','catch','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','get','Contexts','sendStatus','stack','name','send','index'];(function(_0x1d8a15,_0x4acbca){var _0x17b14b=function(_0x52c9e9){while(--_0x52c9e9){_0x1d8a15['push'](_0x1d8a15['shift']());}};_0x17b14b(++_0x4acbca);}(_0x78ce,0x1ca));var _0xe78c=function(_0x566342,_0x4a8a5d){_0x566342=_0x566342-0x0;var _0x1271e6=_0x78ce[_0x566342];return _0x1271e6;};'use strict';var emlformat=require(_0xe78c('0x0'));var rimraf=require(_0xe78c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe78c('0x2'));var rp=require('request-promise');var moment=require(_0xe78c('0x3'));var BPromise=require(_0xe78c('0x4'));var Mustache=require(_0xe78c('0x5'));var util=require(_0xe78c('0x6'));var path=require(_0xe78c('0x7'));var sox=require(_0xe78c('0x8'));var csv=require(_0xe78c('0x9'));var ejs=require(_0xe78c('0xa'));var fs=require('fs');var fs_extra=require(_0xe78c('0xb'));var _=require(_0xe78c('0xc'));var squel=require(_0xe78c('0xd'));var crypto=require('crypto');var jsforce=require(_0xe78c('0xe'));var deskjs=require(_0xe78c('0xf'));var toCsv=require(_0xe78c('0x9'));var querystring=require(_0xe78c('0x10'));var Papa=require('papaparse');var Redis=require(_0xe78c('0x11'));var authService=require(_0xe78c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe78c('0x13'));var hardwareService=require(_0xe78c('0x14'));var logger=require(_0xe78c('0x15'))('api');var utils=require(_0xe78c('0x16'));var config=require(_0xe78c('0x17'));var licenseUtil=require(_0xe78c('0x18'));var db=require(_0xe78c('0x19'))['db'];var jayson=require(_0xe78c('0x1a'));var client=jayson['client'][_0xe78c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1834d0,_0x673ce9,_0x107a33,_0x3fc341){return new BPromise(function(_0x4d629d,_0x39abb6){var _0x944a9=_0x3fc341||client;return _0x944a9[_0xe78c('0x1c')](_0x1834d0,_0x107a33)['then'](function(_0x50350c){logger[_0xe78c('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x673ce9,'request\x20sent');logger[_0xe78c('0x1e')](_0xe78c('0x1f'),_0x673ce9,'request\x20sent',JSON['stringify'](_0x50350c));if(_0x50350c[_0xe78c('0x20')]){if(_0x50350c['error'][_0xe78c('0x21')]===0x1f4){logger[_0xe78c('0x20')](_0xe78c('0x22'),_0x673ce9,_0x50350c[_0xe78c('0x20')][_0xe78c('0x23')]);return _0x39abb6(_0x50350c['error']['message']);}logger[_0xe78c('0x20')](_0xe78c('0x22'),_0x673ce9,_0x50350c[_0xe78c('0x20')][_0xe78c('0x23')]);return _0x4d629d(_0x50350c[_0xe78c('0x20')][_0xe78c('0x23')]);}else{logger[_0xe78c('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x673ce9,_0xe78c('0x24'));_0x4d629d(_0x50350c['result'][_0xe78c('0x23')]);}})[_0xe78c('0x25')](function(_0x1cf983){logger[_0xe78c('0x20')](_0xe78c('0x22'),_0x673ce9,_0x1cf983);_0x39abb6(_0x1cf983);});});}function respondWithStatusCode(_0x40c37d,_0x1c4a4a){_0x1c4a4a=_0x1c4a4a||0xcc;return function(_0xd06926){if(_0xd06926){return _0x40c37d['sendStatus'](_0x1c4a4a);}return _0x40c37d[_0xe78c('0x26')](_0x1c4a4a)[_0xe78c('0x27')]();};}function respondWithResult(_0x22936c,_0x3a158b){_0x3a158b=_0x3a158b||0xc8;return function(_0x563d6a){if(_0x563d6a){return _0x22936c[_0xe78c('0x26')](_0x3a158b)[_0xe78c('0x28')](_0x563d6a);}};}function respondWithFilteredResult(_0x4b15e8,_0x52a084){return function(_0x4d91d1){if(_0x4d91d1){var _0x272f10=_0x4d91d1[_0xe78c('0x29')],_0x555a96=_0x52a084[_0xe78c('0x2a')],_0x8f822b=_0x52a084[_0xe78c('0x2a')]+_0x52a084[_0xe78c('0x2b')],_0x34cda9;if(_0x8f822b>=_0x272f10){_0x8f822b=_0x272f10;_0x34cda9=0xc8;}else{_0x34cda9=0xce;}_0x4b15e8[_0xe78c('0x26')](_0x34cda9);return _0x4b15e8[_0xe78c('0x2c')]('Content-Range',_0x555a96+'-'+_0x8f822b+'/'+_0x272f10)['json'](_0x4d91d1);}return null;};}function patchUpdates(_0x13da7e){return function(_0x5f49f9){try{jsonpatch['apply'](_0x5f49f9,_0x13da7e,!![]);}catch(_0x2f37ca){return BPromise[_0xe78c('0x2d')](_0x2f37ca);}return _0x5f49f9[_0xe78c('0x2e')]();};}function saveUpdates(_0x15b297,_0x596d96){return function(_0x501387){if(_0x501387){return _0x501387[_0xe78c('0x2f')](_0x15b297)[_0xe78c('0x30')](function(_0x58b674){return _0x58b674;});}return null;};}function removeEntity(_0x2c1278,_0x1efe5d){return function(_0x5cead5){if(_0x5cead5){return _0x5cead5[_0xe78c('0x31')]()['then'](function(){var _0x48934a=_0x5cead5[_0xe78c('0x32')]({'plain':!![]});var _0x4ffa66=_0xe78c('0x33');return db['UserProfileResource']['destroy']({'where':{'type':_0x4ffa66,'resourceId':_0x48934a['id']}})['then'](function(){return _0x5cead5;});})['then'](function(){_0x2c1278[_0xe78c('0x26')](0xcc)[_0xe78c('0x27')]();});}};}function handleEntityNotFound(_0x351c8f,_0x41d546){return function(_0x23f7d2){if(!_0x23f7d2){_0x351c8f[_0xe78c('0x34')](0x194);}return _0x23f7d2;};}function handleError(_0x2baed4,_0x360a3a){_0x360a3a=_0x360a3a||0x1f4;return function(_0x47ffbc){logger[_0xe78c('0x20')](_0x47ffbc[_0xe78c('0x35')]);if(_0x47ffbc[_0xe78c('0x36')]){delete _0x47ffbc[_0xe78c('0x36')];}_0x2baed4[_0xe78c('0x26')](_0x360a3a)[_0xe78c('0x37')](_0x47ffbc);};}exports[_0xe78c('0x38')]=function(_0x40e872,_0xd3b0a9){var _0x34ad15={},_0x4e9082={},_0x5dc569={'count':0x0,'rows':[]};var _0x20cf9d=_[_0xe78c('0x39')](db[_0xe78c('0x3a')][_0xe78c('0x3b')],function(_0x86ef5b){return{'name':_0x86ef5b[_0xe78c('0x3c')],'type':_0x86ef5b[_0xe78c('0x3d')][_0xe78c('0x3e')]};});_0x4e9082[_0xe78c('0x3f')]=_[_0xe78c('0x39')](_0x20cf9d,'name');_0x4e9082[_0xe78c('0x40')]=_[_0xe78c('0x41')](_0x40e872[_0xe78c('0x40')]);_0x4e9082[_0xe78c('0x42')]=_[_0xe78c('0x43')](_0x4e9082['model'],_0x4e9082[_0xe78c('0x40')]);_0x34ad15[_0xe78c('0x44')]=_[_0xe78c('0x43')](_0x4e9082[_0xe78c('0x3f')],qs['fields'](_0x40e872['query'][_0xe78c('0x45')]));_0x34ad15[_0xe78c('0x44')]=_0x34ad15[_0xe78c('0x44')][_0xe78c('0x46')]?_0x34ad15[_0xe78c('0x44')]:_0x4e9082[_0xe78c('0x3f')];if(!_0x40e872['query'][_0xe78c('0x47')](_0xe78c('0x48'))){_0x34ad15['limit']=qs[_0xe78c('0x2b')](_0x40e872[_0xe78c('0x40')][_0xe78c('0x2b')]);_0x34ad15[_0xe78c('0x2a')]=qs[_0xe78c('0x2a')](_0x40e872[_0xe78c('0x40')]['offset']);}_0x34ad15['order']=qs[_0xe78c('0x49')](_0x40e872[_0xe78c('0x40')][_0xe78c('0x49')]);_0x34ad15[_0xe78c('0x4a')]=qs[_0xe78c('0x42')](_['pick'](_0x40e872[_0xe78c('0x40')],_0x4e9082[_0xe78c('0x42')]),_0x20cf9d);if(_0x40e872['query'][_0xe78c('0x4b')]){_0x34ad15[_0xe78c('0x4a')]=_[_0xe78c('0x4c')](_0x34ad15[_0xe78c('0x4a')],{'$or':_[_0xe78c('0x39')](_0x20cf9d,function(_0x5333d7){if(_0x5333d7[_0xe78c('0x3d')]!==_0xe78c('0x4d')){var _0x123fd0={};_0x123fd0[_0x5333d7[_0xe78c('0x36')]]={'$like':'%'+_0x40e872['query'][_0xe78c('0x4b')]+'%'};return _0x123fd0;}})});}_0x34ad15=_[_0xe78c('0x4c')]({},_0x34ad15,_0x40e872['options']);var _0x4284f0={'where':_0x34ad15[_0xe78c('0x4a')]};return db[_0xe78c('0x3a')][_0xe78c('0x29')](_0x4284f0)[_0xe78c('0x30')](function(_0x41454b){_0x5dc569[_0xe78c('0x29')]=_0x41454b;if(_0x40e872[_0xe78c('0x40')]['includeAll']){_0x34ad15[_0xe78c('0x4e')]=[{'all':!![]}];}return db['VoiceContext'][_0xe78c('0x4f')](_0x34ad15);})[_0xe78c('0x30')](function(_0x2cf94e){_0x5dc569[_0xe78c('0x50')]=_0x2cf94e;return _0x5dc569;})[_0xe78c('0x30')](respondWithFilteredResult(_0xd3b0a9,_0x34ad15))[_0xe78c('0x25')](handleError(_0xd3b0a9,null));};exports['show']=function(_0x50bbfb,_0x456484){var _0x2b2f58={'raw':![],'where':{'id':_0x50bbfb[_0xe78c('0x51')]['id']}},_0x29054f={};_0x29054f[_0xe78c('0x3f')]=_['keys'](db[_0xe78c('0x3a')][_0xe78c('0x3b')]);_0x29054f[_0xe78c('0x40')]=_[_0xe78c('0x41')](_0x50bbfb[_0xe78c('0x40')]);_0x29054f['filters']=_[_0xe78c('0x43')](_0x29054f['model'],_0x29054f[_0xe78c('0x40')]);_0x2b2f58[_0xe78c('0x44')]=_[_0xe78c('0x43')](_0x29054f[_0xe78c('0x3f')],qs[_0xe78c('0x45')](_0x50bbfb[_0xe78c('0x40')][_0xe78c('0x45')]));_0x2b2f58['attributes']=_0x2b2f58[_0xe78c('0x44')][_0xe78c('0x46')]?_0x2b2f58['attributes']:_0x29054f[_0xe78c('0x3f')];if(_0x50bbfb[_0xe78c('0x40')][_0xe78c('0x52')]){_0x2b2f58['include']=[{'all':!![]}];}_0x2b2f58=_[_0xe78c('0x4c')]({},_0x2b2f58,_0x50bbfb[_0xe78c('0x53')]);return db[_0xe78c('0x3a')][_0xe78c('0x54')](_0x2b2f58)['then'](handleEntityNotFound(_0x456484,null))[_0xe78c('0x30')](respondWithResult(_0x456484,null))[_0xe78c('0x25')](handleError(_0x456484,null));};exports[_0xe78c('0x55')]=function(_0x2689dd,_0x30b8de,_0x5bb1e7){var _0x4c4899;return db[_0xe78c('0x3a')][_0xe78c('0x55')](_0x2689dd[_0xe78c('0x56')],{'raw':!![]})[_0xe78c('0x30')](function(_0x245cc8){_0x4c4899=_0x245cc8;return db[_0xe78c('0x3a')][_0xe78c('0x4f')]({'raw':!![]});})['then'](function(_0x5ddbaa){var _0x4481f9=fs[_0xe78c('0x57')](path[_0xe78c('0x58')](config[_0xe78c('0x59')],_0xe78c('0x5a')),_0xe78c('0x5b'));var _0xa0f35c=ejs[_0xe78c('0x5c')](_0x4481f9,{'contexts':_0x5ddbaa||[]});fs[_0xe78c('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xa0f35c);})[_0xe78c('0x30')](function(){return respondWithRpcPromise(_0xe78c('0x5e'),'create',{'module':_0xe78c('0x5f')});})[_0xe78c('0x30')](function(){var _0x53cbd6=_0x2689dd[_0xe78c('0x60')]['get']({'plain':!![]});if(!_0x53cbd6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53cbd6['role']===_0xe78c('0x60')){var _0x2e3a08=_0x4c4899['get']({'plain':!![]});return db[_0xe78c('0x61')][_0xe78c('0x54')]({'where':{'name':_0xe78c('0x33'),'userProfileId':_0x53cbd6[_0xe78c('0x62')]},'raw':!![]})[_0xe78c('0x30')](function(_0x2e5ce8){if(_0x2e5ce8&&_0x2e5ce8[_0xe78c('0x63')]===0x0){return db[_0xe78c('0x64')][_0xe78c('0x55')]({'name':_0x2e3a08['name'],'resourceId':_0x2e3a08['id'],'type':_0x2e5ce8['name'],'sectionId':_0x2e5ce8['id']},{})[_0xe78c('0x30')](function(){return _0x4c4899;});}else{return _0x4c4899;}})['catch'](function(_0x2f07dc){logger[_0xe78c('0x20')](_0xe78c('0x65'),_0x2f07dc);throw _0x2f07dc;});}return _0x4c4899;})['then'](respondWithResult(_0x30b8de,0xc9))[_0xe78c('0x25')](handleError(_0x30b8de,null));};exports[_0xe78c('0x2f')]=function(_0x669295,_0x48ca08,_0x2f3a8f){var _0x19cf51;return db[_0xe78c('0x3a')][_0xe78c('0x54')]({'where':{'id':_0x669295['params']['id']}})['then'](handleEntityNotFound(_0x48ca08,null))['then'](saveUpdates(_0x669295[_0xe78c('0x56')],null))[_0xe78c('0x30')](function(_0x34db09){if(_0x34db09){_0x19cf51=_0x34db09;return db[_0xe78c('0x3a')][_0xe78c('0x4f')]({'raw':!![]});}})[_0xe78c('0x30')](function(_0xfeba9b){var _0x21a9dd=fs[_0xe78c('0x57')](path[_0xe78c('0x58')](config[_0xe78c('0x59')],'server/files/templates/context.ejs'),'utf8');var _0x1ddd21=ejs[_0xe78c('0x5c')](_0x21a9dd,{'contexts':_0xfeba9b||[]});fs[_0xe78c('0x5d')](_0xe78c('0x66'),_0x1ddd21);})[_0xe78c('0x30')](function(){return respondWithRpcPromise(_0xe78c('0x5e'),_0xe78c('0x2f'),{'module':_0xe78c('0x5f')});})[_0xe78c('0x30')](function(){return _0x19cf51;})[_0xe78c('0x30')](respondWithResult(_0x48ca08,null))[_0xe78c('0x25')](handleError(_0x48ca08,null));};exports['destroy']=function(_0x3a8884,_0x2584fc,_0x1de4e1){var _0x270f0d;return db[_0xe78c('0x3a')][_0xe78c('0x54')]({'where':{'id':_0x3a8884[_0xe78c('0x51')]['id']}})[_0xe78c('0x30')](handleEntityNotFound(_0x2584fc,null))[_0xe78c('0x30')](removeEntity(_0x2584fc,null))[_0xe78c('0x30')](function(){return db[_0xe78c('0x3a')][_0xe78c('0x4f')]({'raw':!![]});})[_0xe78c('0x30')](function(_0x8e5a2e){var _0x226275=fs[_0xe78c('0x57')](path[_0xe78c('0x58')](config[_0xe78c('0x59')],_0xe78c('0x5a')),'utf8');var _0xe016de=ejs['render'](_0x226275,{'contexts':_0x8e5a2e});fs[_0xe78c('0x5d')](_0xe78c('0x66'),_0xe016de);return respondWithRpcPromise(_0xe78c('0x5e'),_0xe78c('0x31'),{'module':_0xe78c('0x5f')});})[_0xe78c('0x25')](handleError(_0x2584fc,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index b596ca0..8d64b0e 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 _0xa90f=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','VoiceContext','lodash','util','../../config/logger'];(function(_0x26747b,_0x501406){var _0x169db1=function(_0x1445c0){while(--_0x1445c0){_0x26747b['push'](_0x26747b['shift']());}};_0x169db1(++_0x501406);}(_0xa90f,0x131));var _0xfa90=function(_0x46bc75,_0x3fda3b){_0x46bc75=_0x46bc75-0x0;var _0x3294c5=_0xa90f[_0x46bc75];return _0x3294c5;};'use strict';var _=require(_0xfa90('0x0'));var util=require(_0xfa90('0x1'));var logger=require(_0xfa90('0x2'))(_0xfa90('0x3'));var moment=require(_0xfa90('0x4'));var BPromise=require(_0xfa90('0x5'));var rp=require(_0xfa90('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa90('0x7'));var config=require(_0xfa90('0x8'));var attributes=require(_0xfa90('0x9'));module['exports']=function(_0x1816a8,_0x2fd36c){return _0x1816a8['define'](_0xfa90('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d8a=['rimraf','./voiceContext.attributes','exports','VoiceContext','voice_contexts','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa40bd2,_0x2b1c33){var _0x5c16ef=function(_0x2aed24){while(--_0x2aed24){_0xa40bd2['push'](_0xa40bd2['shift']());}};_0x5c16ef(++_0x2b1c33);}(_0x9d8a,0x73));var _0xa9d8=function(_0x1dfd17,_0x344695){_0x1dfd17=_0x1dfd17-0x0;var _0x1e68e7=_0x9d8a[_0x1dfd17];return _0x1e68e7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa9d8('0x0'))(_0xa9d8('0x1'));var moment=require(_0xa9d8('0x2'));var BPromise=require(_0xa9d8('0x3'));var rp=require(_0xa9d8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9d8('0x5'));var config=require('../../config/environment');var attributes=require(_0xa9d8('0x6'));module[_0xa9d8('0x7')]=function(_0x4a30fb,_0x5f485a){return _0x4a30fb['define'](_0xa9d8('0x8'),attributes,{'tableName':_0xa9d8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 7cf7978..a42574b 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 _0xa672=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x4a8fc4,_0x1195c4){var _0x493e51=function(_0x5499cf){while(--_0x5499cf){_0x4a8fc4['push'](_0x4a8fc4['shift']());}};_0x493e51(++_0x1195c4);}(_0xa672,0x1d4));var _0x2a67=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa672[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x2a67('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2a67('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a67('0x2'));var db=require(_0x2a67('0x3'))['db'];var utils=require(_0x2a67('0x4'));var logger=require(_0x2a67('0x5'))(_0x2a67('0x6'));var config=require(_0x2a67('0x7'));var jayson=require(_0x2a67('0x8'));var client=jayson[_0x2a67('0x9')][_0x2a67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e37fb,_0x1a2dea,_0xc3bfdc){return new BPromise(function(_0x3fa399,_0x3c1753){return client[_0x2a67('0xb')](_0x5e37fb,_0xc3bfdc)[_0x2a67('0xc')](function(_0x5dae14){logger[_0x2a67('0xd')](_0x2a67('0xe'),_0x1a2dea,_0x2a67('0xf'));logger[_0x2a67('0x10')](_0x2a67('0x11'),_0x1a2dea,_0x2a67('0xf'),JSON['stringify'](_0x5dae14));if(_0x5dae14['error']){if(_0x5dae14['error'][_0x2a67('0x12')]===0x1f4){logger[_0x2a67('0x13')](_0x2a67('0xe'),_0x1a2dea,_0x5dae14[_0x2a67('0x13')]['message']);return _0x3c1753(_0x5dae14[_0x2a67('0x13')]['message']);}logger[_0x2a67('0x13')](_0x2a67('0xe'),_0x1a2dea,_0x5dae14['error'][_0x2a67('0x14')]);return _0x3fa399(_0x5dae14[_0x2a67('0x13')]['message']);}else{logger[_0x2a67('0xd')](_0x2a67('0xe'),_0x1a2dea,_0x2a67('0xf'));_0x3fa399(_0x5dae14[_0x2a67('0x15')][_0x2a67('0x14')]);}})[_0x2a67('0x16')](function(_0x5c02f4){logger[_0x2a67('0x13')]('VoiceContext,\x20%s,\x20%s',_0x1a2dea,_0x5c02f4);_0x3c1753(_0x5c02f4);});});} \ No newline at end of file +var _0x96ee=['http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','../../config/utils','../../config/environment','jayson/promise'];(function(_0xedffe8,_0x23df68){var _0x5567f5=function(_0xa194d0){while(--_0xa194d0){_0xedffe8['push'](_0xedffe8['shift']());}};_0x5567f5(++_0x23df68);}(_0x96ee,0x72));var _0xe96e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x96ee[_0x134c2e];return _0x2825db;};'use strict';var _=require('lodash');var util=require(_0xe96e('0x0'));var moment=require(_0xe96e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe96e('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0xe96e('0x3'));var jayson=require(_0xe96e('0x4'));var client=jayson['client'][_0xe96e('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x46dcc6,_0x1d1f5f,_0x493b55){return new BPromise(function(_0x14fc3f,_0x112c3f){return client[_0xe96e('0x6')](_0x46dcc6,_0x493b55)[_0xe96e('0x7')](function(_0x321ab7){logger[_0xe96e('0x8')](_0xe96e('0x9'),_0x1d1f5f,_0xe96e('0xa'));logger[_0xe96e('0xb')](_0xe96e('0xc'),_0x1d1f5f,'request\x20sent',JSON['stringify'](_0x321ab7));if(_0x321ab7[_0xe96e('0xd')]){if(_0x321ab7[_0xe96e('0xd')][_0xe96e('0xe')]===0x1f4){logger[_0xe96e('0xd')](_0xe96e('0x9'),_0x1d1f5f,_0x321ab7[_0xe96e('0xd')]['message']);return _0x112c3f(_0x321ab7['error'][_0xe96e('0xf')]);}logger[_0xe96e('0xd')](_0xe96e('0x9'),_0x1d1f5f,_0x321ab7['error'][_0xe96e('0xf')]);return _0x14fc3f(_0x321ab7['error'][_0xe96e('0xf')]);}else{logger[_0xe96e('0x8')](_0xe96e('0x9'),_0x1d1f5f,_0xe96e('0xa'));_0x14fc3f(_0x321ab7[_0xe96e('0x10')]['message']);}})['catch'](function(_0x328717){logger[_0xe96e('0xd')](_0xe96e('0x9'),_0x1d1f5f,_0x328717);_0x112c3f(_0x328717);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 8a5c8f5..f155269 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 _0xcb99=['create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x4ec362,_0x18c1f0){var _0x245d0c=function(_0x23749f){while(--_0x23749f){_0x4ec362['push'](_0x4ec362['shift']());}};_0x245d0c(++_0x18c1f0);}(_0xcb99,0x8b));var _0x9cb9=function(_0x163977,_0x4ef72e){_0x163977=_0x163977-0x0;var _0x28bf3a=_0xcb99[_0x163977];return _0x28bf3a;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var fs_extra=require(_0x9cb9('0x3'));var auth=require(_0x9cb9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb9('0x5'));var controller=require(_0x9cb9('0x6'));router['get']('/',auth[_0x9cb9('0x7')](),controller['index']);router[_0x9cb9('0x8')](_0x9cb9('0x9'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x8')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9cb9('0xd')]);router[_0x9cb9('0xe')](_0x9cb9('0xb'),auth['isAuthenticated'](),controller[_0x9cb9('0xf')]);router[_0x9cb9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x11')]);module[_0x9cb9('0x12')]=router; \ No newline at end of file +var _0x80d9=['get','/:id','show','post','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','index','isAuthenticated','describe'];(function(_0x47727c,_0x3332e9){var _0x244403=function(_0x4d7140){while(--_0x4d7140){_0x47727c['push'](_0x47727c['shift']());}};_0x244403(++_0x3332e9);}(_0x80d9,0x15c));var _0x980d=function(_0x15d391,_0x2f9d5b){_0x15d391=_0x15d391-0x0;var _0x1e2b30=_0x80d9[_0x15d391];return _0x1e2b30;};'use strict';var multer=require(_0x980d('0x0'));var util=require('util');var path=require(_0x980d('0x1'));var timeout=require(_0x980d('0x2'));var express=require(_0x980d('0x3'));var router=express['Router']();var fs_extra=require(_0x980d('0x4'));var auth=require(_0x980d('0x5'));var interaction=require(_0x980d('0x6'));var config=require(_0x980d('0x7'));var controller=require(_0x980d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x980d('0x9')]);router['get']('/describe',auth[_0x980d('0xa')](),controller[_0x980d('0xb')]);router[_0x980d('0xc')](_0x980d('0xd'),auth[_0x980d('0xa')](),controller[_0x980d('0xe')]);router[_0x980d('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x980d('0xd'),auth[_0x980d('0xa')](),controller['update']);router[_0x980d('0x10')]('/:id',auth[_0x980d('0xa')](),controller['destroy']);module[_0x980d('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index beae4de..3115863 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 _0x85fc=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x85fc,0x1d4));var _0xc85f=function(_0x148e0f,_0x5c47c3){_0x148e0f=_0x148e0f-0x0;var _0x2bb878=_0x85fc[_0x148e0f];return _0x2bb878;};'use strict';var Sequelize=require(_0xc85f('0x0'));module[_0xc85f('0x1')]={'privilege':{'type':Sequelize[_0xc85f('0x2')]},'channel':{'type':Sequelize[_0xc85f('0x2')]},'channelstate':{'type':Sequelize[_0xc85f('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc85f('0x2')]},'calleridnum':{'type':Sequelize[_0xc85f('0x2')]},'calleridname':{'type':Sequelize[_0xc85f('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc85f('0x2')]},'connectedlinename':{'type':Sequelize[_0xc85f('0x2')]},'language':{'type':Sequelize[_0xc85f('0x2')]},'accountcode':{'type':Sequelize[_0xc85f('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc85f('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc85f('0x2')]},'destchannel':{'type':Sequelize[_0xc85f('0x2')]},'destchannelstate':{'type':Sequelize[_0xc85f('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc85f('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc85f('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc85f('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xc85f('0x2')]},'destcontext':{'type':Sequelize[_0xc85f('0x2')]},'destexten':{'type':Sequelize[_0xc85f('0x2')]},'destpriority':{'type':Sequelize[_0xc85f('0x3')]},'destuniqueid':{'type':Sequelize[_0xc85f('0x2')]},'destlinkedid':{'type':Sequelize[_0xc85f('0x2')]},'dialstring':{'type':Sequelize[_0xc85f('0x2')]},'dialstatus':{'type':Sequelize[_0xc85f('0x2')]},'starttime':{'type':Sequelize[_0xc85f('0x4')]},'answertime':{'type':Sequelize[_0xc85f('0x4')]},'endtime':{'type':Sequelize[_0xc85f('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xc85f('0x5')},'routeId':{'type':Sequelize[_0xc85f('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc85f('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xc975=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x59429e,_0x3d4a71){var _0x48502b=function(_0x181bba){while(--_0x181bba){_0x59429e['push'](_0x59429e['shift']());}};_0x48502b(++_0x3d4a71);}(_0xc975,0x78));var _0x5c97=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc975[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x5c97('0x0'));module[_0x5c97('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5c97('0x2')]},'channelstate':{'type':Sequelize[_0x5c97('0x3')]},'channelstatedesc':{'type':Sequelize[_0x5c97('0x2')]},'calleridnum':{'type':Sequelize[_0x5c97('0x2')]},'calleridname':{'type':Sequelize[_0x5c97('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5c97('0x2')]},'connectedlinename':{'type':Sequelize[_0x5c97('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5c97('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5c97('0x2')]},'priority':{'type':Sequelize[_0x5c97('0x3')]},'uniqueid':{'type':Sequelize[_0x5c97('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x5c97('0x2')]},'destchannelstate':{'type':Sequelize[_0x5c97('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x5c97('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5c97('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x5c97('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5c97('0x2')]},'destaccountcode':{'type':Sequelize[_0x5c97('0x2')]},'destcontext':{'type':Sequelize[_0x5c97('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5c97('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x5c97('0x2')]},'dialstring':{'type':Sequelize[_0x5c97('0x2')]},'dialstatus':{'type':Sequelize[_0x5c97('0x2')]},'starttime':{'type':Sequelize[_0x5c97('0x4')]},'answertime':{'type':Sequelize[_0x5c97('0x4')]},'endtime':{'type':Sequelize[_0x5c97('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x5c97('0x3')]},'duration':{'type':Sequelize[_0x5c97('0x3')]},'holdtime':{'type':Sequelize[_0x5c97('0x3')]},'billableseconds':{'type':Sequelize[_0x5c97('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 8983dd1..71dcbe5 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 _0x213f=['VoiceDialReport','intersection','length','create','body','destroy','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','json','offset','limit','set','Content-Range','apply','reject','update','then','end','rawAttributes','type','key','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','count','includeAll','include','catch','show','params'];(function(_0x2a4fe2,_0x3ec53a){var _0x225c4a=function(_0x1eccfa){while(--_0x1eccfa){_0x2a4fe2['push'](_0x2a4fe2['shift']());}};_0x225c4a(++_0x3ec53a);}(_0x213f,0x1c4));var _0xf213=function(_0xd49003,_0x2eedba){_0xd49003=_0xd49003-0x0;var _0x2a92a1=_0x213f[_0xd49003];return _0x2a92a1;};'use strict';var emlformat=require(_0xf213('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf213('0x1'));var jsonpatch=require(_0xf213('0x2'));var rp=require(_0xf213('0x3'));var moment=require(_0xf213('0x4'));var BPromise=require(_0xf213('0x5'));var Mustache=require(_0xf213('0x6'));var util=require(_0xf213('0x7'));var path=require(_0xf213('0x8'));var sox=require(_0xf213('0x9'));var csv=require(_0xf213('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf213('0xb'));var _=require(_0xf213('0xc'));var squel=require(_0xf213('0xd'));var crypto=require(_0xf213('0xe'));var jsforce=require(_0xf213('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf213('0x10'));var Papa=require(_0xf213('0x11'));var Redis=require(_0xf213('0x12'));var authService=require(_0xf213('0x13'));var qs=require(_0xf213('0x14'));var as=require(_0xf213('0x15'));var hardwareService=require(_0xf213('0x16'));var logger=require(_0xf213('0x17'))(_0xf213('0x18'));var utils=require(_0xf213('0x19'));var config=require(_0xf213('0x1a'));var licenseUtil=require(_0xf213('0x1b'));var db=require(_0xf213('0x1c'))['db'];function respondWithStatusCode(_0x58d94d,_0x136f83){_0x136f83=_0x136f83||0xcc;return function(_0x5b2df3){if(_0x5b2df3){return _0x58d94d[_0xf213('0x1d')](_0x136f83);}return _0x58d94d[_0xf213('0x1e')](_0x136f83)['end']();};}function respondWithResult(_0x2df484,_0x440028){_0x440028=_0x440028||0xc8;return function(_0x1351f5){if(_0x1351f5){return _0x2df484[_0xf213('0x1e')](_0x440028)[_0xf213('0x1f')](_0x1351f5);}};}function respondWithFilteredResult(_0x277d9b,_0x52c563){return function(_0x2f5b54){if(_0x2f5b54){var _0x4c20d0=_0x2f5b54['count'],_0x2d2600=_0x52c563['offset'],_0x14ff57=_0x52c563[_0xf213('0x20')]+_0x52c563[_0xf213('0x21')],_0x3339bb;if(_0x14ff57>=_0x4c20d0){_0x14ff57=_0x4c20d0;_0x3339bb=0xc8;}else{_0x3339bb=0xce;}_0x277d9b['status'](_0x3339bb);return _0x277d9b[_0xf213('0x22')](_0xf213('0x23'),_0x2d2600+'-'+_0x14ff57+'/'+_0x4c20d0)[_0xf213('0x1f')](_0x2f5b54);}return null;};}function patchUpdates(_0x1fe7d9){return function(_0x23f853){try{jsonpatch[_0xf213('0x24')](_0x23f853,_0x1fe7d9,!![]);}catch(_0x4215af){return BPromise[_0xf213('0x25')](_0x4215af);}return _0x23f853['save']();};}function saveUpdates(_0x25d6a7,_0x2d0c2e){return function(_0x16287d){if(_0x16287d){return _0x16287d[_0xf213('0x26')](_0x25d6a7)['then'](function(_0x437c38){return _0x437c38;});}return null;};}function removeEntity(_0x3d637b,_0x2a6f1a){return function(_0xb8884c){if(_0xb8884c){return _0xb8884c['destroy']()[_0xf213('0x27')](function(){_0x3d637b[_0xf213('0x1e')](0xcc)[_0xf213('0x28')]();});}};}function handleEntityNotFound(_0x4f6b1a,_0x14d9d3){return function(_0x536fec){if(!_0x536fec){_0x4f6b1a['sendStatus'](0x194);}return _0x536fec;};}function handleError(_0x2ae664,_0x154ade){_0x154ade=_0x154ade||0x1f4;return function(_0x39a7b2){logger['error'](_0x39a7b2['stack']);if(_0x39a7b2['name']){delete _0x39a7b2['name'];}_0x2ae664[_0xf213('0x1e')](_0x154ade)['send'](_0x39a7b2);};}exports['index']=function(_0x56de70,_0x38ee2b){var _0x1a1b27={},_0x303b8f={},_0x2df04b={'count':0x0,'rows':[]};var _0x1dda22=_['map'](db['VoiceDialReport'][_0xf213('0x29')],function(_0x11562f){return{'name':_0x11562f['fieldName'],'type':_0x11562f[_0xf213('0x2a')][_0xf213('0x2b')]};});_0x303b8f[_0xf213('0x2c')]=_['map'](_0x1dda22,'name');_0x303b8f['query']=_[_0xf213('0x2d')](_0x56de70[_0xf213('0x2e')]);_0x303b8f[_0xf213('0x2f')]=_['intersection'](_0x303b8f[_0xf213('0x2c')],_0x303b8f[_0xf213('0x2e')]);_0x1a1b27[_0xf213('0x30')]=_['intersection'](_0x303b8f[_0xf213('0x2c')],qs[_0xf213('0x31')](_0x56de70[_0xf213('0x2e')][_0xf213('0x31')]));_0x1a1b27[_0xf213('0x30')]=_0x1a1b27['attributes']['length']?_0x1a1b27[_0xf213('0x30')]:_0x303b8f[_0xf213('0x2c')];if(!_0x56de70['query'][_0xf213('0x32')](_0xf213('0x33'))){_0x1a1b27['limit']=qs['limit'](_0x56de70[_0xf213('0x2e')][_0xf213('0x21')]);_0x1a1b27[_0xf213('0x20')]=qs[_0xf213('0x20')](_0x56de70[_0xf213('0x2e')][_0xf213('0x20')]);}_0x1a1b27[_0xf213('0x34')]=qs[_0xf213('0x35')](_0x56de70[_0xf213('0x2e')]['sort']);_0x1a1b27[_0xf213('0x36')]=qs['filters'](_['pick'](_0x56de70[_0xf213('0x2e')],_0x303b8f[_0xf213('0x2f')]),_0x1dda22);if(_0x56de70[_0xf213('0x2e')][_0xf213('0x37')]){_0x1a1b27[_0xf213('0x36')]=_[_0xf213('0x38')](_0x1a1b27[_0xf213('0x36')],{'$or':_['map'](_0x1dda22,function(_0x1c674f){if(_0x1c674f[_0xf213('0x2a')]!==_0xf213('0x39')){var _0x30d9ca={};_0x30d9ca[_0x1c674f[_0xf213('0x3a')]]={'$like':'%'+_0x56de70[_0xf213('0x2e')][_0xf213('0x37')]+'%'};return _0x30d9ca;}})});}_0x1a1b27=_[_0xf213('0x38')]({},_0x1a1b27,_0x56de70[_0xf213('0x3b')]);var _0x10ad15={'where':_0x1a1b27[_0xf213('0x36')]};return db['VoiceDialReport']['count'](_0x10ad15)[_0xf213('0x27')](function(_0xb62cfa){_0x2df04b[_0xf213('0x3c')]=_0xb62cfa;if(_0x56de70['query'][_0xf213('0x3d')]){_0x1a1b27[_0xf213('0x3e')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x1a1b27);})[_0xf213('0x27')](function(_0x4bf15e){_0x2df04b['rows']=_0x4bf15e;return _0x2df04b;})[_0xf213('0x27')](respondWithFilteredResult(_0x38ee2b,_0x1a1b27))[_0xf213('0x3f')](handleError(_0x38ee2b,null));};exports[_0xf213('0x40')]=function(_0x5888e6,_0x5b510c){var _0x5e301d={'raw':!![],'where':{'id':_0x5888e6[_0xf213('0x41')]['id']}},_0x4b7b75={};_0x4b7b75[_0xf213('0x2c')]=_[_0xf213('0x2d')](db[_0xf213('0x42')][_0xf213('0x29')]);_0x4b7b75['query']=_[_0xf213('0x2d')](_0x5888e6['query']);_0x4b7b75[_0xf213('0x2f')]=_[_0xf213('0x43')](_0x4b7b75[_0xf213('0x2c')],_0x4b7b75[_0xf213('0x2e')]);_0x5e301d[_0xf213('0x30')]=_[_0xf213('0x43')](_0x4b7b75[_0xf213('0x2c')],qs[_0xf213('0x31')](_0x5888e6[_0xf213('0x2e')]['fields']));_0x5e301d['attributes']=_0x5e301d[_0xf213('0x30')][_0xf213('0x44')]?_0x5e301d['attributes']:_0x4b7b75[_0xf213('0x2c')];if(_0x5888e6['query'][_0xf213('0x3d')]){_0x5e301d['include']=[{'all':!![]}];}_0x5e301d=_[_0xf213('0x38')]({},_0x5e301d,_0x5888e6['options']);return db[_0xf213('0x42')]['find'](_0x5e301d)[_0xf213('0x27')](handleEntityNotFound(_0x5b510c,null))[_0xf213('0x27')](respondWithResult(_0x5b510c,null))['catch'](handleError(_0x5b510c,null));};exports[_0xf213('0x45')]=function(_0xc7fb75,_0x5e453f){return db[_0xf213('0x42')][_0xf213('0x45')](_0xc7fb75[_0xf213('0x46')],{})[_0xf213('0x27')](respondWithResult(_0x5e453f,0xc9))['catch'](handleError(_0x5e453f,null));};exports['update']=function(_0x23b0a1,_0x1fee66){if(_0x23b0a1[_0xf213('0x46')]['id']){delete _0x23b0a1['body']['id'];}return db[_0xf213('0x42')]['find']({'where':{'id':_0x23b0a1['params']['id']}})['then'](handleEntityNotFound(_0x1fee66,null))['then'](saveUpdates(_0x23b0a1[_0xf213('0x46')],null))[_0xf213('0x27')](respondWithResult(_0x1fee66,null))[_0xf213('0x3f')](handleError(_0x1fee66,null));};exports[_0xf213('0x47')]=function(_0xa28cc0,_0xedbcb3){return db[_0xf213('0x42')][_0xf213('0x48')]({'where':{'id':_0xa28cc0['params']['id']}})[_0xf213('0x27')](handleEntityNotFound(_0xedbcb3,null))['then'](removeEntity(_0xedbcb3,null))[_0xf213('0x3f')](handleError(_0xedbcb3,null));};exports['describe']=function(_0x2bb1f1,_0x383d3c){return db[_0xf213('0x42')][_0xf213('0x49')]()[_0xf213('0x27')](respondWithResult(_0x383d3c,null))[_0xf213('0x3f')](handleError(_0x383d3c,null));}; \ No newline at end of file +var _0x9040=['show','params','keys','find','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','json','offset','limit','status','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','include','rows','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9040,0x1c3));var _0x0904=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9040[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x0904('0x0'));var rimraf=require(_0x0904('0x1'));var zipdir=require(_0x0904('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0904('0x3'));var moment=require(_0x0904('0x4'));var BPromise=require(_0x0904('0x5'));var Mustache=require(_0x0904('0x6'));var util=require(_0x0904('0x7'));var path=require(_0x0904('0x8'));var sox=require('sox');var csv=require(_0x0904('0x9'));var ejs=require(_0x0904('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0904('0xb'));var squel=require('squel');var crypto=require(_0x0904('0xc'));var jsforce=require(_0x0904('0xd'));var deskjs=require(_0x0904('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0904('0xf'));var Papa=require('papaparse');var Redis=require(_0x0904('0x10'));var authService=require(_0x0904('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0904('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0904('0x13'))(_0x0904('0x14'));var utils=require(_0x0904('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0904('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15d1f2,_0x561812){_0x561812=_0x561812||0xcc;return function(_0x362115){if(_0x362115){return _0x15d1f2['sendStatus'](_0x561812);}return _0x15d1f2['status'](_0x561812)['end']();};}function respondWithResult(_0x1d914b,_0x477666){_0x477666=_0x477666||0xc8;return function(_0x5006a2){if(_0x5006a2){return _0x1d914b['status'](_0x477666)[_0x0904('0x17')](_0x5006a2);}};}function respondWithFilteredResult(_0x224fb3,_0x85d6d){return function(_0x5dfc9b){if(_0x5dfc9b){var _0x5b6af0=_0x5dfc9b['count'],_0x4ddfab=_0x85d6d[_0x0904('0x18')],_0x39d713=_0x85d6d['offset']+_0x85d6d[_0x0904('0x19')],_0x26c01f;if(_0x39d713>=_0x5b6af0){_0x39d713=_0x5b6af0;_0x26c01f=0xc8;}else{_0x26c01f=0xce;}_0x224fb3[_0x0904('0x1a')](_0x26c01f);return _0x224fb3['set'](_0x0904('0x1b'),_0x4ddfab+'-'+_0x39d713+'/'+_0x5b6af0)[_0x0904('0x17')](_0x5dfc9b);}return null;};}function patchUpdates(_0x481f5e){return function(_0x2140e6){try{jsonpatch[_0x0904('0x1c')](_0x2140e6,_0x481f5e,!![]);}catch(_0x294677){return BPromise[_0x0904('0x1d')](_0x294677);}return _0x2140e6[_0x0904('0x1e')]();};}function saveUpdates(_0x33fa04,_0x5d1bba){return function(_0x4ca504){if(_0x4ca504){return _0x4ca504[_0x0904('0x1f')](_0x33fa04)[_0x0904('0x20')](function(_0x3865c6){return _0x3865c6;});}return null;};}function removeEntity(_0x402afb,_0xbdad73){return function(_0x1bf8eb){if(_0x1bf8eb){return _0x1bf8eb['destroy']()[_0x0904('0x20')](function(){_0x402afb[_0x0904('0x1a')](0xcc)[_0x0904('0x21')]();});}};}function handleEntityNotFound(_0xdf8fd1,_0x1d213f){return function(_0x3f967c){if(!_0x3f967c){_0xdf8fd1[_0x0904('0x22')](0x194);}return _0x3f967c;};}function handleError(_0x189b04,_0x1b7a00){_0x1b7a00=_0x1b7a00||0x1f4;return function(_0x419ec7){logger[_0x0904('0x23')](_0x419ec7[_0x0904('0x24')]);if(_0x419ec7['name']){delete _0x419ec7[_0x0904('0x25')];}_0x189b04[_0x0904('0x1a')](_0x1b7a00)[_0x0904('0x26')](_0x419ec7);};}exports[_0x0904('0x27')]=function(_0x5034da,_0x36ca8b){var _0x3ef998={},_0x4ef497={},_0x31164d={'count':0x0,'rows':[]};var _0x4bebc8=_[_0x0904('0x28')](db[_0x0904('0x29')][_0x0904('0x2a')],function(_0xd5efc0){return{'name':_0xd5efc0[_0x0904('0x2b')],'type':_0xd5efc0[_0x0904('0x2c')][_0x0904('0x2d')]};});_0x4ef497[_0x0904('0x2e')]=_[_0x0904('0x28')](_0x4bebc8,_0x0904('0x25'));_0x4ef497['query']=_['keys'](_0x5034da['query']);_0x4ef497[_0x0904('0x2f')]=_[_0x0904('0x30')](_0x4ef497[_0x0904('0x2e')],_0x4ef497[_0x0904('0x31')]);_0x3ef998[_0x0904('0x32')]=_['intersection'](_0x4ef497['model'],qs['fields'](_0x5034da['query'][_0x0904('0x33')]));_0x3ef998['attributes']=_0x3ef998[_0x0904('0x32')][_0x0904('0x34')]?_0x3ef998[_0x0904('0x32')]:_0x4ef497[_0x0904('0x2e')];if(!_0x5034da[_0x0904('0x31')][_0x0904('0x35')](_0x0904('0x36'))){_0x3ef998[_0x0904('0x19')]=qs[_0x0904('0x19')](_0x5034da[_0x0904('0x31')][_0x0904('0x19')]);_0x3ef998[_0x0904('0x18')]=qs[_0x0904('0x18')](_0x5034da['query'][_0x0904('0x18')]);}_0x3ef998[_0x0904('0x37')]=qs[_0x0904('0x38')](_0x5034da[_0x0904('0x31')][_0x0904('0x38')]);_0x3ef998['where']=qs['filters'](_[_0x0904('0x39')](_0x5034da[_0x0904('0x31')],_0x4ef497[_0x0904('0x2f')]),_0x4bebc8);if(_0x5034da[_0x0904('0x31')][_0x0904('0x3a')]){_0x3ef998[_0x0904('0x3b')]=_[_0x0904('0x3c')](_0x3ef998[_0x0904('0x3b')],{'$or':_['map'](_0x4bebc8,function(_0xb922c7){if(_0xb922c7[_0x0904('0x2c')]!==_0x0904('0x3d')){var _0x3e79b8={};_0x3e79b8[_0xb922c7[_0x0904('0x25')]]={'$like':'%'+_0x5034da[_0x0904('0x31')][_0x0904('0x3a')]+'%'};return _0x3e79b8;}})});}_0x3ef998=_[_0x0904('0x3c')]({},_0x3ef998,_0x5034da[_0x0904('0x3e')]);var _0xf989c9={'where':_0x3ef998[_0x0904('0x3b')]};return db[_0x0904('0x29')][_0x0904('0x3f')](_0xf989c9)[_0x0904('0x20')](function(_0x48cd51){_0x31164d[_0x0904('0x3f')]=_0x48cd51;if(_0x5034da['query']['includeAll']){_0x3ef998[_0x0904('0x40')]=[{'all':!![]}];}return db[_0x0904('0x29')]['findAll'](_0x3ef998);})[_0x0904('0x20')](function(_0x43edba){_0x31164d[_0x0904('0x41')]=_0x43edba;return _0x31164d;})[_0x0904('0x20')](respondWithFilteredResult(_0x36ca8b,_0x3ef998))[_0x0904('0x42')](handleError(_0x36ca8b,null));};exports[_0x0904('0x43')]=function(_0x49e601,_0x188736){var _0x541eda={'raw':!![],'where':{'id':_0x49e601[_0x0904('0x44')]['id']}},_0x3e0a88={};_0x3e0a88[_0x0904('0x2e')]=_[_0x0904('0x45')](db[_0x0904('0x29')][_0x0904('0x2a')]);_0x3e0a88['query']=_[_0x0904('0x45')](_0x49e601['query']);_0x3e0a88[_0x0904('0x2f')]=_[_0x0904('0x30')](_0x3e0a88['model'],_0x3e0a88[_0x0904('0x31')]);_0x541eda['attributes']=_[_0x0904('0x30')](_0x3e0a88[_0x0904('0x2e')],qs[_0x0904('0x33')](_0x49e601[_0x0904('0x31')]['fields']));_0x541eda[_0x0904('0x32')]=_0x541eda[_0x0904('0x32')][_0x0904('0x34')]?_0x541eda[_0x0904('0x32')]:_0x3e0a88['model'];if(_0x49e601[_0x0904('0x31')]['includeAll']){_0x541eda[_0x0904('0x40')]=[{'all':!![]}];}_0x541eda=_[_0x0904('0x3c')]({},_0x541eda,_0x49e601[_0x0904('0x3e')]);return db[_0x0904('0x29')][_0x0904('0x46')](_0x541eda)['then'](handleEntityNotFound(_0x188736,null))[_0x0904('0x20')](respondWithResult(_0x188736,null))['catch'](handleError(_0x188736,null));};exports['create']=function(_0x5596f3,_0x15cb8c){return db['VoiceDialReport']['create'](_0x5596f3['body'],{})[_0x0904('0x20')](respondWithResult(_0x15cb8c,0xc9))[_0x0904('0x42')](handleError(_0x15cb8c,null));};exports[_0x0904('0x1f')]=function(_0x34bc44,_0x25b42a){if(_0x34bc44[_0x0904('0x47')]['id']){delete _0x34bc44['body']['id'];}return db[_0x0904('0x29')][_0x0904('0x46')]({'where':{'id':_0x34bc44[_0x0904('0x44')]['id']}})['then'](handleEntityNotFound(_0x25b42a,null))[_0x0904('0x20')](saveUpdates(_0x34bc44[_0x0904('0x47')],null))[_0x0904('0x20')](respondWithResult(_0x25b42a,null))[_0x0904('0x42')](handleError(_0x25b42a,null));};exports[_0x0904('0x48')]=function(_0x2a9e8b,_0xc607af){return db[_0x0904('0x29')][_0x0904('0x46')]({'where':{'id':_0x2a9e8b['params']['id']}})[_0x0904('0x20')](handleEntityNotFound(_0xc607af,null))[_0x0904('0x20')](removeEntity(_0xc607af,null))[_0x0904('0x42')](handleError(_0xc607af,null));};exports[_0x0904('0x49')]=function(_0x1a8ce0,_0x45afb7){return db[_0x0904('0x29')][_0x0904('0x49')]()[_0x0904('0x20')](respondWithResult(_0x45afb7,null))['catch'](handleError(_0x45afb7,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 308548f..10fe1bc 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 _0xd2cf=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial'];(function(_0xb93969,_0x3606f5){var _0x4a86d2=function(_0x520ace){while(--_0x520ace){_0xb93969['push'](_0xb93969['shift']());}};_0x4a86d2(++_0x3606f5);}(_0xd2cf,0x101));var _0xfd2c=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0xd2cf[_0x4c0622];return _0x1799d8;};'use strict';var _=require(_0xfd2c('0x0'));var util=require(_0xfd2c('0x1'));var logger=require(_0xfd2c('0x2'))(_0xfd2c('0x3'));var moment=require(_0xfd2c('0x4'));var BPromise=require(_0xfd2c('0x5'));var rp=require(_0xfd2c('0x6'));var fs=require('fs');var path=require(_0xfd2c('0x7'));var rimraf=require(_0xfd2c('0x8'));var config=require(_0xfd2c('0x9'));var attributes=require(_0xfd2c('0xa'));module[_0xfd2c('0xb')]=function(_0x14f860,_0x50286a){return _0x14f860[_0xfd2c('0xc')](_0xfd2c('0xd'),attributes,{'tableName':_0xfd2c('0xe'),'paranoid':![],'indexes':[{'fields':[_0xfd2c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8b6a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceDialReport','report_dial','lodash','../../config/logger','api'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0x8b6a,0x1e9));var _0xa8b6=function(_0x39e302,_0x5c0269){_0x39e302=_0x39e302-0x0;var _0x21bdef=_0x8b6a[_0x39e302];return _0x21bdef;};'use strict';var _=require(_0xa8b6('0x0'));var util=require('util');var logger=require(_0xa8b6('0x1'))(_0xa8b6('0x2'));var moment=require(_0xa8b6('0x3'));var BPromise=require(_0xa8b6('0x4'));var rp=require(_0xa8b6('0x5'));var fs=require('fs');var path=require(_0xa8b6('0x6'));var rimraf=require(_0xa8b6('0x7'));var config=require(_0xa8b6('0x8'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x19cb2a,_0x402ae5){return _0x19cb2a[_0xa8b6('0x9')](_0xa8b6('0xa'),attributes,{'tableName':_0xa8b6('0xb'),'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 e063fdb..e07ac50 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 _0x8478=['then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','catch','update','limit','UpdateVoiceDialReport','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x4b6fd5,_0x4554bb){var _0x222ab5=function(_0x3b00b8){while(--_0x3b00b8){_0x4b6fd5['push'](_0x4b6fd5['shift']());}};_0x222ab5(++_0x4554bb);}(_0x8478,0x18e));var _0x8847=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8478[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8847('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8847('0x1'));var db=require(_0x8847('0x2'))['db'];var utils=require(_0x8847('0x3'));var logger=require(_0x8847('0x4'))(_0x8847('0x5'));var config=require(_0x8847('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8847('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3869c2,_0x2f214a,_0x10ab38){return new BPromise(function(_0x376ef3,_0x2d8784){return client['request'](_0x3869c2,_0x10ab38)[_0x8847('0x8')](function(_0x5994b7){logger['info'](_0x8847('0x9'),_0x2f214a,_0x8847('0xa'));logger[_0x8847('0xb')](_0x8847('0xc'),_0x2f214a,_0x8847('0xa'),JSON[_0x8847('0xd')](_0x5994b7));if(_0x5994b7['error']){if(_0x5994b7['error'][_0x8847('0xe')]===0x1f4){logger['error'](_0x8847('0x9'),_0x2f214a,_0x5994b7[_0x8847('0xf')][_0x8847('0x10')]);return _0x2d8784(_0x5994b7[_0x8847('0xf')][_0x8847('0x10')]);}logger[_0x8847('0xf')](_0x8847('0x9'),_0x2f214a,_0x5994b7[_0x8847('0xf')][_0x8847('0x10')]);return _0x376ef3(_0x5994b7[_0x8847('0xf')][_0x8847('0x10')]);}else{logger[_0x8847('0x11')](_0x8847('0x9'),_0x2f214a,_0x8847('0xa'));_0x376ef3(_0x5994b7[_0x8847('0x12')][_0x8847('0x10')]);}})['catch'](function(_0x34e09d){logger[_0x8847('0xf')](_0x8847('0x9'),_0x2f214a,_0x34e09d);_0x2d8784(_0x34e09d);});});}exports[_0x8847('0x13')]=function(_0x4de145){var _0x2b881a=this;return new Promise(function(_0x13f8ae,_0x170c70){return db[_0x8847('0x14')][_0x8847('0x15')](_0x4de145[_0x8847('0x16')],{'raw':_0x4de145[_0x8847('0x17')]?_0x4de145['options'][_0x8847('0x18')]===undefined?!![]:![]:!![]})[_0x8847('0x8')](function(_0x33bcf0){logger['info']('CreateVoiceDialReport',_0x4de145);logger[_0x8847('0xb')]('CreateVoiceDialReport',_0x4de145,JSON['stringify'](_0x33bcf0));_0x13f8ae(_0x33bcf0);})[_0x8847('0x19')](function(_0x1f55a6){logger[_0x8847('0xf')](_0x8847('0x13'),_0x1f55a6['message'],_0x4de145);_0x170c70(_0x2b881a[_0x8847('0xf')](0x1f4,_0x1f55a6[_0x8847('0x10')]));});});};exports['UpdateVoiceDialReport']=function(_0x29effd){var _0x548a5f=this;return new Promise(function(_0x2baa74,_0x2208f6){return db['VoiceDialReport'][_0x8847('0x1a')](_0x29effd['body'],{'raw':_0x29effd[_0x8847('0x17')]?_0x29effd[_0x8847('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29effd[_0x8847('0x17')]?_0x29effd['options']['where']||null:null,'attributes':_0x29effd[_0x8847('0x17')]?_0x29effd['options']['attributes']||null:null,'limit':_0x29effd[_0x8847('0x17')]?_0x29effd[_0x8847('0x17')][_0x8847('0x1b')]||null:null})[_0x8847('0x8')](function(_0x1a6a75){logger[_0x8847('0x11')](_0x8847('0x1c'),_0x29effd);logger['debug'](_0x8847('0x1c'),_0x29effd,JSON[_0x8847('0xd')](_0x1a6a75));_0x2baa74(_0x1a6a75);})[_0x8847('0x19')](function(_0x1cdcbf){logger[_0x8847('0xf')](_0x8847('0x1c'),_0x1cdcbf[_0x8847('0x10')],_0x29effd);_0x2208f6(_0x548a5f['error'](0x1f4,_0x1cdcbf[_0x8847('0x10')]));});});}; \ No newline at end of file +var _0x2046=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','request\x20sent','error','code','VoiceDialReport,\x20%s,\x20%s','message','info','CreateVoiceDialReport','VoiceDialReport','create','options','raw','catch','UpdateVoiceDialReport','body','where','attributes','limit','stringify','lodash'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x2046,0x19f));var _0x6204=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2046[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6204('0x0'));var util=require(_0x6204('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6204('0x2'));var fs=require('fs');var Redis=require(_0x6204('0x3'));var db=require(_0x6204('0x4'))['db'];var utils=require(_0x6204('0x5'));var logger=require(_0x6204('0x6'))(_0x6204('0x7'));var config=require('../../config/environment');var jayson=require(_0x6204('0x8'));var client=jayson[_0x6204('0x9')][_0x6204('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c0b3e,_0x25a38c,_0x43231e){return new BPromise(function(_0xa9e8ef,_0x12ef73){return client[_0x6204('0xb')](_0x3c0b3e,_0x43231e)[_0x6204('0xc')](function(_0x10652c){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x25a38c,'request\x20sent');logger[_0x6204('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x25a38c,_0x6204('0xe'),JSON['stringify'](_0x10652c));if(_0x10652c[_0x6204('0xf')]){if(_0x10652c['error'][_0x6204('0x10')]===0x1f4){logger['error'](_0x6204('0x11'),_0x25a38c,_0x10652c[_0x6204('0xf')][_0x6204('0x12')]);return _0x12ef73(_0x10652c['error'][_0x6204('0x12')]);}logger[_0x6204('0xf')](_0x6204('0x11'),_0x25a38c,_0x10652c[_0x6204('0xf')][_0x6204('0x12')]);return _0xa9e8ef(_0x10652c[_0x6204('0xf')]['message']);}else{logger[_0x6204('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x25a38c,_0x6204('0xe'));_0xa9e8ef(_0x10652c['result'][_0x6204('0x12')]);}})['catch'](function(_0x2648ef){logger[_0x6204('0xf')](_0x6204('0x11'),_0x25a38c,_0x2648ef);_0x12ef73(_0x2648ef);});});}exports[_0x6204('0x14')]=function(_0x51461b){var _0x5aeee7=this;return new Promise(function(_0x760b1a,_0x4472ca){return db[_0x6204('0x15')][_0x6204('0x16')](_0x51461b['body'],{'raw':_0x51461b['options']?_0x51461b[_0x6204('0x17')][_0x6204('0x18')]===undefined?!![]:![]:!![]})[_0x6204('0xc')](function(_0x2b2d73){logger['info'](_0x6204('0x14'),_0x51461b);logger[_0x6204('0xd')]('CreateVoiceDialReport',_0x51461b,JSON['stringify'](_0x2b2d73));_0x760b1a(_0x2b2d73);})[_0x6204('0x19')](function(_0x2fd1db){logger[_0x6204('0xf')](_0x6204('0x14'),_0x2fd1db[_0x6204('0x12')],_0x51461b);_0x4472ca(_0x5aeee7['error'](0x1f4,_0x2fd1db['message']));});});};exports[_0x6204('0x1a')]=function(_0x4ba525){var _0x2f8b2a=this;return new Promise(function(_0x100a8d,_0x208690){return db[_0x6204('0x15')]['update'](_0x4ba525[_0x6204('0x1b')],{'raw':_0x4ba525[_0x6204('0x17')]?_0x4ba525['options'][_0x6204('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ba525[_0x6204('0x17')]?_0x4ba525[_0x6204('0x17')][_0x6204('0x1c')]||null:null,'attributes':_0x4ba525[_0x6204('0x17')]?_0x4ba525['options'][_0x6204('0x1d')]||null:null,'limit':_0x4ba525[_0x6204('0x17')]?_0x4ba525[_0x6204('0x17')][_0x6204('0x1e')]||null:null})[_0x6204('0xc')](function(_0x53cfe3){logger[_0x6204('0x13')](_0x6204('0x1a'),_0x4ba525);logger['debug'](_0x6204('0x1a'),_0x4ba525,JSON[_0x6204('0x1f')](_0x53cfe3));_0x100a8d(_0x53cfe3);})[_0x6204('0x19')](function(_0x316b43){logger[_0x6204('0xf')](_0x6204('0x1a'),_0x316b43[_0x6204('0x12')],_0x4ba525);_0x208690(_0x2f8b2a[_0x6204('0xf')](0x1f4,_0x316b43['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a6762b9..0c5153e 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 _0xa017=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/:id/applications','addApplications','put','update','delete','multer'];(function(_0x50865c,_0x5c7b60){var _0x5b7717=function(_0xb71650){while(--_0xb71650){_0x50865c['push'](_0x50865c['shift']());}};_0x5b7717(++_0x5c7b60);}(_0xa017,0x1b4));var _0x7a01=function(_0x26ec61,_0x495ae1){_0x26ec61=_0x26ec61-0x0;var _0x322ddb=_0xa017[_0x26ec61];return _0x322ddb;};'use strict';var multer=require(_0x7a01('0x0'));var util=require(_0x7a01('0x1'));var path=require(_0x7a01('0x2'));var timeout=require(_0x7a01('0x3'));var express=require(_0x7a01('0x4'));var router=express[_0x7a01('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7a01('0x6'));var interaction=require(_0x7a01('0x7'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x7a01('0x8')]('/',auth[_0x7a01('0x9')](),controller[_0x7a01('0xa')]);router[_0x7a01('0x8')](_0x7a01('0xb'),auth['isAuthenticated'](),controller[_0x7a01('0xc')]);router[_0x7a01('0xd')]('/',auth[_0x7a01('0x9')](),controller['create']);router[_0x7a01('0xd')](_0x7a01('0xe'),auth[_0x7a01('0x9')](),controller[_0x7a01('0xf')]);router[_0x7a01('0x10')](_0x7a01('0xb'),auth[_0x7a01('0x9')](),controller[_0x7a01('0x11')]);router[_0x7a01('0x12')](_0x7a01('0xb'),auth[_0x7a01('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa84f=['../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','post','create','/:id/applications','addApplications','delete','multer','connect-timeout','express','fs-extra'];(function(_0x35ed44,_0x2f66b9){var _0x8f9fd2=function(_0x2a5f34){while(--_0x2a5f34){_0x35ed44['push'](_0x35ed44['shift']());}};_0x8f9fd2(++_0x2f66b9);}(_0xa84f,0xec));var _0xfa84=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0xa84f[_0x3a78a0];return _0x48e917;};'use strict';var multer=require(_0xfa84('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfa84('0x1'));var express=require(_0xfa84('0x2'));var router=express['Router']();var fs_extra=require(_0xfa84('0x3'));var auth=require(_0xfa84('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfa84('0x5'));var controller=require(_0xfa84('0x6'));router[_0xfa84('0x7')]('/',auth[_0xfa84('0x8')](),controller['index']);router[_0xfa84('0x7')](_0xfa84('0x9'),auth[_0xfa84('0x8')](),controller['show']);router[_0xfa84('0xa')]('/',auth[_0xfa84('0x8')](),controller[_0xfa84('0xb')]);router[_0xfa84('0xa')](_0xfa84('0xc'),auth[_0xfa84('0x8')](),controller[_0xfa84('0xd')]);router['put'](_0xfa84('0x9'),auth[_0xfa84('0x8')](),controller['update']);router[_0xfa84('0xe')](_0xfa84('0x9'),auth[_0xfa84('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index c4258f3..faeedc3 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 _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x2c9695,_0x4c9738){var _0x5d9806=function(_0x4d9a0c){while(--_0x4d9a0c){_0x2c9695['push'](_0x2c9695['shift']());}};_0x5d9806(++_0x4c9738);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x1335bb,_0xfd4276){var _0x19d320=function(_0x57e64e){while(--_0x57e64e){_0x1335bb['push'](_0x1335bb['shift']());}};_0x19d320(++_0xfd4276);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index d07d4ef..c78f406 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 _0xe615=['inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','type','find','name','destroy','error','stack','send','VoiceExtension','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','length','catch','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','count','offset','set','reject','update','then','get','InboundRoutes'];(function(_0x2ce596,_0x10313b){var _0x2e65a4=function(_0x2f6e17){while(--_0x2f6e17){_0x2ce596['push'](_0x2ce596['shift']());}};_0x2e65a4(++_0x10313b);}(_0xe615,0xae));var _0x5e61=function(_0x7902d0,_0x378152){_0x7902d0=_0x7902d0-0x0;var _0x2ab4ac=_0xe615[_0x7902d0];return _0x2ab4ac;};'use strict';var emlformat=require(_0x5e61('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e61('0x1'));var jsonpatch=require(_0x5e61('0x2'));var rp=require(_0x5e61('0x3'));var moment=require(_0x5e61('0x4'));var BPromise=require(_0x5e61('0x5'));var Mustache=require(_0x5e61('0x6'));var util=require(_0x5e61('0x7'));var path=require(_0x5e61('0x8'));var sox=require(_0x5e61('0x9'));var csv=require(_0x5e61('0xa'));var ejs=require(_0x5e61('0xb'));var fs=require('fs');var fs_extra=require(_0x5e61('0xc'));var _=require(_0x5e61('0xd'));var squel=require(_0x5e61('0xe'));var crypto=require(_0x5e61('0xf'));var jsforce=require(_0x5e61('0x10'));var deskjs=require(_0x5e61('0x11'));var toCsv=require(_0x5e61('0xa'));var querystring=require(_0x5e61('0x12'));var Papa=require(_0x5e61('0x13'));var Redis=require(_0x5e61('0x14'));var authService=require(_0x5e61('0x15'));var qs=require(_0x5e61('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e61('0x17'));var logger=require('../../config/logger')(_0x5e61('0x18'));var utils=require(_0x5e61('0x19'));var config=require(_0x5e61('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x5e61('0x1b')](config[_0x5e61('0x1c')],{'host':_0x5e61('0x1d'),'port':0x18eb});var socket=require(_0x5e61('0x1e'))(new Redis(config[_0x5e61('0x1c')]));require(_0x5e61('0x1f'))[_0x5e61('0x20')](socket);function respondWithStatusCode(_0x532eb4,_0x4b31a3){_0x4b31a3=_0x4b31a3||0xcc;return function(_0x21bf96){if(_0x21bf96){return _0x532eb4[_0x5e61('0x21')](_0x4b31a3);}return _0x532eb4[_0x5e61('0x22')](_0x4b31a3)['end']();};}function respondWithResult(_0x18c940,_0xd16ef4){_0xd16ef4=_0xd16ef4||0xc8;return function(_0x370212){if(_0x370212){return _0x18c940['status'](_0xd16ef4)[_0x5e61('0x23')](_0x370212);}};}function respondWithFilteredResult(_0x41fae2,_0x301c77){return function(_0x4600a9){if(_0x4600a9){var _0x641dcf=_0x4600a9[_0x5e61('0x24')],_0x365712=_0x301c77[_0x5e61('0x25')],_0x2c05da=_0x301c77[_0x5e61('0x25')]+_0x301c77['limit'],_0xec39b8;if(_0x2c05da>=_0x641dcf){_0x2c05da=_0x641dcf;_0xec39b8=0xc8;}else{_0xec39b8=0xce;}_0x41fae2[_0x5e61('0x22')](_0xec39b8);return _0x41fae2[_0x5e61('0x26')]('Content-Range',_0x365712+'-'+_0x2c05da+'/'+_0x641dcf)[_0x5e61('0x23')](_0x4600a9);}return null;};}function patchUpdates(_0x18e5c3){return function(_0x281ff7){try{jsonpatch['apply'](_0x281ff7,_0x18e5c3,!![]);}catch(_0x2e4663){return BPromise[_0x5e61('0x27')](_0x2e4663);}return _0x281ff7['save']();};}function saveUpdates(_0x1f474f,_0x6b3b91){return function(_0x17679f){if(_0x17679f){return _0x17679f[_0x5e61('0x28')](_0x1f474f)[_0x5e61('0x29')](function(_0x1b123a){return _0x1b123a;});}return null;};}function removeEntity(_0x23eeec,_0x45f8da){return function(_0x1fb759){if(_0x1fb759){return _0x1fb759['destroy']()['then'](function(){var _0x40e8c3=_0x1fb759[_0x5e61('0x2a')]({'plain':!![]});var _0x58fe09=[{'name':_0x5e61('0x2b'),'value':_0x5e61('0x2c'),'ignore':![]},{'name':_0x5e61('0x2d'),'value':_0x5e61('0x2e'),'ignore':![]},{'name':_0x5e61('0x2f'),'value':_0x5e61('0x30'),'ignore':![]}];var _0xfb4a27=_(_0x58fe09)['filter'](_0x5e61('0x31'))[_0x5e61('0x32')](_0x5e61('0x33'))[_0x5e61('0x33')]();if(_['includes'](_0xfb4a27,_0x40e8c3[_0x5e61('0x34')])){return;}var _0xe61b04=_[_0x5e61('0x35')](_0x58fe09,['value',_0x40e8c3[_0x5e61('0x34')]])[_0x5e61('0x36')];return db['UserProfileResource'][_0x5e61('0x37')]({'where':{'type':_0xe61b04,'resourceId':_0x40e8c3['id']}})['then'](function(){return _0x1fb759;});})[_0x5e61('0x29')](function(){_0x23eeec[_0x5e61('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a556d,_0x5c941a){return function(_0x3a0c09){if(!_0x3a0c09){_0x5a556d[_0x5e61('0x21')](0x194);}return _0x3a0c09;};}function handleError(_0x17665d,_0x1ad5d9){_0x1ad5d9=_0x1ad5d9||0x1f4;return function(_0x5eba4d){logger[_0x5e61('0x38')](_0x5eba4d[_0x5e61('0x39')]);if(_0x5eba4d[_0x5e61('0x36')]){delete _0x5eba4d[_0x5e61('0x36')];}_0x17665d[_0x5e61('0x22')](_0x1ad5d9)[_0x5e61('0x3a')](_0x5eba4d);};}exports['index']=function(_0x568949,_0x284f02){var _0x3fb777={},_0x1a6b72={},_0x13fb10={'count':0x0,'rows':[]};var _0x4a5ddc=_['map'](db[_0x5e61('0x3b')][_0x5e61('0x3c')],function(_0x3cd27a){return{'name':_0x3cd27a[_0x5e61('0x3d')],'type':_0x3cd27a[_0x5e61('0x34')][_0x5e61('0x3e')]};});_0x1a6b72['model']=_[_0x5e61('0x32')](_0x4a5ddc,_0x5e61('0x36'));_0x1a6b72['query']=_[_0x5e61('0x3f')](_0x568949[_0x5e61('0x40')]);_0x1a6b72[_0x5e61('0x41')]=_[_0x5e61('0x42')](_0x1a6b72[_0x5e61('0x43')],_0x1a6b72[_0x5e61('0x40')]);_0x3fb777[_0x5e61('0x44')]=_[_0x5e61('0x42')](_0x1a6b72['model'],qs[_0x5e61('0x45')](_0x568949[_0x5e61('0x40')][_0x5e61('0x45')]));_0x3fb777[_0x5e61('0x44')]=_0x3fb777[_0x5e61('0x44')]['length']?_0x3fb777[_0x5e61('0x44')]:_0x1a6b72[_0x5e61('0x43')];if(!_0x568949[_0x5e61('0x40')][_0x5e61('0x46')](_0x5e61('0x47'))){_0x3fb777[_0x5e61('0x48')]=qs[_0x5e61('0x48')](_0x568949[_0x5e61('0x40')][_0x5e61('0x48')]);_0x3fb777[_0x5e61('0x25')]=qs[_0x5e61('0x25')](_0x568949[_0x5e61('0x40')][_0x5e61('0x25')]);}_0x3fb777[_0x5e61('0x49')]=qs[_0x5e61('0x4a')](_0x568949[_0x5e61('0x40')][_0x5e61('0x4a')]);_0x3fb777[_0x5e61('0x4b')]=qs[_0x5e61('0x41')](_[_0x5e61('0x4c')](_0x568949['query'],_0x1a6b72['filters']),_0x4a5ddc);if(_0x568949['query'][_0x5e61('0x4d')]){_0x3fb777[_0x5e61('0x4b')]=_[_0x5e61('0x4e')](_0x3fb777[_0x5e61('0x4b')],{'$or':_[_0x5e61('0x32')](_0x4a5ddc,function(_0x50bf63){if(_0x50bf63['type']!=='VIRTUAL'){var _0x2f4777={};_0x2f4777[_0x50bf63[_0x5e61('0x36')]]={'$like':'%'+_0x568949[_0x5e61('0x40')][_0x5e61('0x4d')]+'%'};return _0x2f4777;}})});}_0x3fb777=_['merge']({},_0x3fb777,_0x568949[_0x5e61('0x4f')]);var _0xa33a43={'where':_0x3fb777[_0x5e61('0x4b')]};return db['VoiceExtension'][_0x5e61('0x24')](_0xa33a43)[_0x5e61('0x29')](function(_0xd33b82){_0x13fb10[_0x5e61('0x24')]=_0xd33b82;if(_0x568949['query'][_0x5e61('0x50')]){_0x3fb777[_0x5e61('0x51')]=[{'all':!![]}];}return db[_0x5e61('0x3b')][_0x5e61('0x52')](_0x3fb777);})[_0x5e61('0x29')](function(_0x38bec0){_0x13fb10[_0x5e61('0x53')]=_0x38bec0;return _0x13fb10;})[_0x5e61('0x29')](respondWithFilteredResult(_0x284f02,_0x3fb777))['catch'](handleError(_0x284f02,null));};exports['show']=function(_0x5035e8,_0x22fc46){var _0x50ca34={'raw':![],'where':{'id':_0x5035e8[_0x5e61('0x54')]['id']}},_0x208e91={};_0x208e91[_0x5e61('0x43')]=_[_0x5e61('0x3f')](db['VoiceExtension'][_0x5e61('0x3c')]);_0x208e91[_0x5e61('0x40')]=_[_0x5e61('0x3f')](_0x5035e8['query']);_0x208e91[_0x5e61('0x41')]=_['intersection'](_0x208e91[_0x5e61('0x43')],_0x208e91['query']);_0x50ca34[_0x5e61('0x44')]=_[_0x5e61('0x42')](_0x208e91[_0x5e61('0x43')],qs['fields'](_0x5035e8['query']['fields']));_0x50ca34['attributes']=_0x50ca34[_0x5e61('0x44')][_0x5e61('0x55')]?_0x50ca34[_0x5e61('0x44')]:_0x208e91[_0x5e61('0x43')];if(_0x5035e8[_0x5e61('0x40')][_0x5e61('0x50')]){_0x50ca34[_0x5e61('0x51')]=[{'all':!![]}];}_0x50ca34=_[_0x5e61('0x4e')]({},_0x50ca34,_0x5035e8[_0x5e61('0x4f')]);return db['VoiceExtension'][_0x5e61('0x35')](_0x50ca34)[_0x5e61('0x29')](handleEntityNotFound(_0x22fc46,null))[_0x5e61('0x29')](respondWithResult(_0x22fc46,null))[_0x5e61('0x56')](handleError(_0x22fc46,null));};exports['destroy']=function(_0x4d00aa,_0x6c4196){return db[_0x5e61('0x3b')][_0x5e61('0x35')]({'where':{'id':_0x4d00aa[_0x5e61('0x54')]['id']}})[_0x5e61('0x29')](handleEntityNotFound(_0x6c4196,null))[_0x5e61('0x29')](removeEntity(_0x6c4196,null))[_0x5e61('0x56')](handleError(_0x6c4196,null));};exports[_0x5e61('0x57')]=function(_0x5a2be0,_0x36c853){if(_0x5a2be0[_0x5e61('0x58')][_0x5e61('0x34')]==='outbound'&&!_['startsWith'](_0x5a2be0[_0x5e61('0x58')][_0x5e61('0x59')],'_')){_0x5a2be0['body'][_0x5e61('0x59')]='_'[_0x5e61('0x5a')](_0x5a2be0[_0x5e61('0x58')][_0x5e61('0x59')]);}return db[_0x5e61('0x3b')][_0x5e61('0x57')](_0x5a2be0[_0x5e61('0x58')],{'raw':![]})[_0x5e61('0x29')](function(_0x30d0b2){var _0x2dbfef=_0x5a2be0[_0x5e61('0x5b')][_0x5e61('0x2a')]({'plain':!![]});if(!_0x2dbfef)throw new Error(_0x5e61('0x5c'));if(_0x2dbfef[_0x5e61('0x5d')]===_0x5e61('0x5b')){var _0x33918c=_0x30d0b2[_0x5e61('0x2a')]({'plain':!![]});var _0x2cb6f7=[{'name':_0x5e61('0x2b'),'value':_0x5e61('0x2c')},{'name':_0x5e61('0x2d'),'value':_0x5e61('0x2e')},{'name':_0x5e61('0x2f'),'value':_0x5e61('0x30')}];var _0x4599a7=_[_0x5e61('0x35')](_0x2cb6f7,[_0x5e61('0x33'),_0x33918c[_0x5e61('0x34')]])['name'];return db['UserProfileSection'][_0x5e61('0x35')]({'where':{'name':_0x4599a7,'userProfileId':_0x2dbfef[_0x5e61('0x5e')]},'raw':!![]})[_0x5e61('0x29')](function(_0x2111ba){if(_0x2111ba&&_0x2111ba[_0x5e61('0x5f')]===0x0){return db[_0x5e61('0x60')]['create']({'name':_0x33918c['name'],'resourceId':_0x33918c['id'],'type':_0x2111ba[_0x5e61('0x36')],'sectionId':_0x2111ba['id']},{})[_0x5e61('0x29')](function(){return _0x30d0b2;});}else{return _0x30d0b2;}})[_0x5e61('0x56')](function(_0x471e6b){logger[_0x5e61('0x38')](_0x5e61('0x61'),_0x471e6b);throw _0x471e6b;});}return _0x30d0b2;})[_0x5e61('0x29')](respondWithResult(_0x36c853,0xc9))[_0x5e61('0x56')](handleError(_0x36c853,null));};exports['update']=function(_0x30ee6a,_0x48fbe1){if(_0x30ee6a[_0x5e61('0x58')]['id']){delete _0x30ee6a['body']['id'];}return db['VoiceExtension'][_0x5e61('0x35')]({'where':{'id':_0x30ee6a[_0x5e61('0x54')]['id']}})[_0x5e61('0x29')](handleEntityNotFound(_0x48fbe1,null))[_0x5e61('0x29')](function(_0x447353){if(_0x447353){return db[_0x5e61('0x3b')]['update'](_[_0x5e61('0x4c')](_0x30ee6a[_0x5e61('0x58')],[_0x5e61('0x59'),_0x5e61('0x62'),'description',_0x5e61('0x63'),_0x5e61('0x64'),_0x5e61('0x65')]),{'where':{'context':_0x447353[_0x5e61('0x62')],'exten':_0x447353['exten']},'individualHooks':!![]})[_0x5e61('0x29')](function(_0x186a53){return _0x186a53;});}return null;})[_0x5e61('0x29')](respondWithStatusCode(_0x48fbe1,null))[_0x5e61('0x56')](handleError(_0x48fbe1,null));};exports[_0x5e61('0x66')]=function(_0x73b87c,_0x4b0b32,_0x1472a1){return db['VoiceExtension'][_0x5e61('0x67')]({'where':{'id':_0x73b87c[_0x5e61('0x54')]['id']}})[_0x5e61('0x29')](handleEntityNotFound(_0x4b0b32,null))[_0x5e61('0x29')](function(_0x137a79){if(_0x137a79){return db[_0x5e61('0x68')][_0x5e61('0x69')](function(_0x1030fd){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x73b87c['params']['id']},'transaction':_0x1030fd})[_0x5e61('0x29')](function(_0x5a4242){var _0x35a6e9=_[_0x5e61('0x32')](_0x73b87c['body'],function(_0x1bde3a){_0x1bde3a[_0x5e61('0x6a')]=_0x73b87c[_0x5e61('0x54')]['id'];return _0x1bde3a;});return db[_0x5e61('0x3b')][_0x5e61('0x6b')](_0x35a6e9,{'transaction':_0x1030fd});});})['then'](function(){return db['VoiceExtension'][_0x5e61('0x6c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x73b87c['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x5e61('0x29')](respondWithResult(_0x4b0b32,null))[_0x5e61('0x56')](handleError(_0x4b0b32,null));}; \ No newline at end of file +var _0xcf88=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','transaction','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','destroy','stack','send','index','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','findAll','rows','params','length','include','catch','body','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation'];(function(_0x47909c,_0xd75b59){var _0x565c35=function(_0x2b1382){while(--_0x2b1382){_0x47909c['push'](_0x47909c['shift']());}};_0x565c35(++_0xd75b59);}(_0xcf88,0x1ac));var _0x8cf8=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xcf88[_0x543084];return _0x306a57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cf8('0x0'));var zipdir=require(_0x8cf8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8cf8('0x2'));var moment=require(_0x8cf8('0x3'));var BPromise=require(_0x8cf8('0x4'));var Mustache=require(_0x8cf8('0x5'));var util=require('util');var path=require(_0x8cf8('0x6'));var sox=require(_0x8cf8('0x7'));var csv=require(_0x8cf8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8cf8('0x9'));var crypto=require('crypto');var jsforce=require(_0x8cf8('0xa'));var deskjs=require(_0x8cf8('0xb'));var toCsv=require(_0x8cf8('0x8'));var querystring=require(_0x8cf8('0xc'));var Papa=require('papaparse');var Redis=require(_0x8cf8('0xd'));var authService=require(_0x8cf8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8cf8('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8cf8('0x10'))(_0x8cf8('0x11'));var utils=require(_0x8cf8('0x12'));var config=require(_0x8cf8('0x13'));var licenseUtil=require(_0x8cf8('0x14'));var db=require(_0x8cf8('0x15'))['db'];config['redis']=_[_0x8cf8('0x16')](config[_0x8cf8('0x17')],{'host':_0x8cf8('0x18'),'port':0x18eb});var socket=require(_0x8cf8('0x19'))(new Redis(config[_0x8cf8('0x17')]));require(_0x8cf8('0x1a'))['register'](socket);function respondWithStatusCode(_0x5b0b02,_0x355628){_0x355628=_0x355628||0xcc;return function(_0x971e30){if(_0x971e30){return _0x5b0b02[_0x8cf8('0x1b')](_0x355628);}return _0x5b0b02[_0x8cf8('0x1c')](_0x355628)[_0x8cf8('0x1d')]();};}function respondWithResult(_0x565f72,_0x58c90d){_0x58c90d=_0x58c90d||0xc8;return function(_0x878921){if(_0x878921){return _0x565f72[_0x8cf8('0x1c')](_0x58c90d)[_0x8cf8('0x1e')](_0x878921);}};}function respondWithFilteredResult(_0xc8d961,_0x3b1648){return function(_0x1b400){if(_0x1b400){var _0xe96daf=_0x1b400['count'],_0x1a39ff=_0x3b1648[_0x8cf8('0x1f')],_0x5583c4=_0x3b1648[_0x8cf8('0x1f')]+_0x3b1648[_0x8cf8('0x20')],_0x5cf109;if(_0x5583c4>=_0xe96daf){_0x5583c4=_0xe96daf;_0x5cf109=0xc8;}else{_0x5cf109=0xce;}_0xc8d961['status'](_0x5cf109);return _0xc8d961[_0x8cf8('0x21')](_0x8cf8('0x22'),_0x1a39ff+'-'+_0x5583c4+'/'+_0xe96daf)[_0x8cf8('0x1e')](_0x1b400);}return null;};}function patchUpdates(_0x47d525){return function(_0x8ef01b){try{jsonpatch[_0x8cf8('0x23')](_0x8ef01b,_0x47d525,!![]);}catch(_0x53d15d){return BPromise['reject'](_0x53d15d);}return _0x8ef01b[_0x8cf8('0x24')]();};}function saveUpdates(_0x542db2,_0x3ff0f1){return function(_0x287667){if(_0x287667){return _0x287667[_0x8cf8('0x25')](_0x542db2)[_0x8cf8('0x26')](function(_0x305036){return _0x305036;});}return null;};}function removeEntity(_0x320dbd,_0x2b4476){return function(_0x35790f){if(_0x35790f){return _0x35790f['destroy']()[_0x8cf8('0x26')](function(){var _0x5771d5=_0x35790f[_0x8cf8('0x27')]({'plain':!![]});var _0x525958=[{'name':_0x8cf8('0x28'),'value':_0x8cf8('0x29'),'ignore':![]},{'name':_0x8cf8('0x2a'),'value':_0x8cf8('0x2b'),'ignore':![]},{'name':_0x8cf8('0x2c'),'value':_0x8cf8('0x2d'),'ignore':![]}];var _0x593408=_(_0x525958)[_0x8cf8('0x2e')](_0x8cf8('0x2f'))[_0x8cf8('0x30')](_0x8cf8('0x31'))[_0x8cf8('0x31')]();if(_[_0x8cf8('0x32')](_0x593408,_0x5771d5[_0x8cf8('0x33')])){return;}var _0x3bfafc=_[_0x8cf8('0x34')](_0x525958,['value',_0x5771d5['type']])[_0x8cf8('0x35')];return db['UserProfileResource'][_0x8cf8('0x36')]({'where':{'type':_0x3bfafc,'resourceId':_0x5771d5['id']}})[_0x8cf8('0x26')](function(){return _0x35790f;});})[_0x8cf8('0x26')](function(){_0x320dbd[_0x8cf8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x518359,_0x474581){return function(_0x206320){if(!_0x206320){_0x518359[_0x8cf8('0x1b')](0x194);}return _0x206320;};}function handleError(_0x204245,_0x24a586){_0x24a586=_0x24a586||0x1f4;return function(_0x423488){logger['error'](_0x423488[_0x8cf8('0x37')]);if(_0x423488['name']){delete _0x423488[_0x8cf8('0x35')];}_0x204245['status'](_0x24a586)[_0x8cf8('0x38')](_0x423488);};}exports[_0x8cf8('0x39')]=function(_0x36aa26,_0x3509c1){var _0x3473a0={},_0x912229={},_0x51c5e0={'count':0x0,'rows':[]};var _0x3a9fd4=_['map'](db['VoiceExtension'][_0x8cf8('0x3a')],function(_0x3b749b){return{'name':_0x3b749b[_0x8cf8('0x3b')],'type':_0x3b749b['type'][_0x8cf8('0x3c')]};});_0x912229[_0x8cf8('0x3d')]=_[_0x8cf8('0x30')](_0x3a9fd4,_0x8cf8('0x35'));_0x912229['query']=_[_0x8cf8('0x3e')](_0x36aa26[_0x8cf8('0x3f')]);_0x912229[_0x8cf8('0x40')]=_[_0x8cf8('0x41')](_0x912229[_0x8cf8('0x3d')],_0x912229[_0x8cf8('0x3f')]);_0x3473a0[_0x8cf8('0x42')]=_[_0x8cf8('0x41')](_0x912229['model'],qs[_0x8cf8('0x43')](_0x36aa26['query'][_0x8cf8('0x43')]));_0x3473a0[_0x8cf8('0x42')]=_0x3473a0[_0x8cf8('0x42')]['length']?_0x3473a0['attributes']:_0x912229[_0x8cf8('0x3d')];if(!_0x36aa26['query']['hasOwnProperty']('nolimit')){_0x3473a0[_0x8cf8('0x20')]=qs[_0x8cf8('0x20')](_0x36aa26[_0x8cf8('0x3f')][_0x8cf8('0x20')]);_0x3473a0[_0x8cf8('0x1f')]=qs[_0x8cf8('0x1f')](_0x36aa26[_0x8cf8('0x3f')][_0x8cf8('0x1f')]);}_0x3473a0[_0x8cf8('0x44')]=qs['sort'](_0x36aa26['query'][_0x8cf8('0x45')]);_0x3473a0[_0x8cf8('0x46')]=qs[_0x8cf8('0x40')](_[_0x8cf8('0x47')](_0x36aa26['query'],_0x912229[_0x8cf8('0x40')]),_0x3a9fd4);if(_0x36aa26[_0x8cf8('0x3f')][_0x8cf8('0x2e')]){_0x3473a0['where']=_[_0x8cf8('0x48')](_0x3473a0['where'],{'$or':_['map'](_0x3a9fd4,function(_0x5381e9){if(_0x5381e9['type']!==_0x8cf8('0x49')){var _0x4368e8={};_0x4368e8[_0x5381e9[_0x8cf8('0x35')]]={'$like':'%'+_0x36aa26[_0x8cf8('0x3f')][_0x8cf8('0x2e')]+'%'};return _0x4368e8;}})});}_0x3473a0=_['merge']({},_0x3473a0,_0x36aa26[_0x8cf8('0x4a')]);var _0x56de0e={'where':_0x3473a0[_0x8cf8('0x46')]};return db[_0x8cf8('0x4b')]['count'](_0x56de0e)[_0x8cf8('0x26')](function(_0x591472){_0x51c5e0['count']=_0x591472;if(_0x36aa26[_0x8cf8('0x3f')][_0x8cf8('0x4c')]){_0x3473a0['include']=[{'all':!![]}];}return db[_0x8cf8('0x4b')][_0x8cf8('0x4d')](_0x3473a0);})[_0x8cf8('0x26')](function(_0x446e2f){_0x51c5e0[_0x8cf8('0x4e')]=_0x446e2f;return _0x51c5e0;})[_0x8cf8('0x26')](respondWithFilteredResult(_0x3509c1,_0x3473a0))['catch'](handleError(_0x3509c1,null));};exports['show']=function(_0x2130e3,_0x5a5618){var _0x2db84c={'raw':![],'where':{'id':_0x2130e3[_0x8cf8('0x4f')]['id']}},_0x49ca26={};_0x49ca26['model']=_[_0x8cf8('0x3e')](db['VoiceExtension'][_0x8cf8('0x3a')]);_0x49ca26[_0x8cf8('0x3f')]=_[_0x8cf8('0x3e')](_0x2130e3[_0x8cf8('0x3f')]);_0x49ca26[_0x8cf8('0x40')]=_['intersection'](_0x49ca26[_0x8cf8('0x3d')],_0x49ca26['query']);_0x2db84c['attributes']=_[_0x8cf8('0x41')](_0x49ca26[_0x8cf8('0x3d')],qs['fields'](_0x2130e3[_0x8cf8('0x3f')][_0x8cf8('0x43')]));_0x2db84c['attributes']=_0x2db84c[_0x8cf8('0x42')][_0x8cf8('0x50')]?_0x2db84c[_0x8cf8('0x42')]:_0x49ca26[_0x8cf8('0x3d')];if(_0x2130e3['query']['includeAll']){_0x2db84c[_0x8cf8('0x51')]=[{'all':!![]}];}_0x2db84c=_['merge']({},_0x2db84c,_0x2130e3[_0x8cf8('0x4a')]);return db[_0x8cf8('0x4b')]['find'](_0x2db84c)[_0x8cf8('0x26')](handleEntityNotFound(_0x5a5618,null))[_0x8cf8('0x26')](respondWithResult(_0x5a5618,null))[_0x8cf8('0x52')](handleError(_0x5a5618,null));};exports[_0x8cf8('0x36')]=function(_0x5bfe4c,_0x2e99f6){return db[_0x8cf8('0x4b')]['find']({'where':{'id':_0x5bfe4c['params']['id']}})[_0x8cf8('0x26')](handleEntityNotFound(_0x2e99f6,null))[_0x8cf8('0x26')](removeEntity(_0x2e99f6,null))[_0x8cf8('0x52')](handleError(_0x2e99f6,null));};exports['create']=function(_0x307254,_0xc7aa0e){if(_0x307254[_0x8cf8('0x53')]['type']===_0x8cf8('0x2b')&&!_['startsWith'](_0x307254[_0x8cf8('0x53')]['exten'],'_')){_0x307254[_0x8cf8('0x53')][_0x8cf8('0x54')]='_'[_0x8cf8('0x55')](_0x307254['body'][_0x8cf8('0x54')]);}return db[_0x8cf8('0x4b')][_0x8cf8('0x56')](_0x307254[_0x8cf8('0x53')],{'raw':![]})[_0x8cf8('0x26')](function(_0x2e7eaa){var _0x422be6=_0x307254[_0x8cf8('0x57')]['get']({'plain':!![]});if(!_0x422be6)throw new Error(_0x8cf8('0x58'));if(_0x422be6[_0x8cf8('0x59')]===_0x8cf8('0x57')){var _0xd124fc=_0x2e7eaa[_0x8cf8('0x27')]({'plain':!![]});var _0x384376=[{'name':_0x8cf8('0x28'),'value':_0x8cf8('0x29')},{'name':_0x8cf8('0x2a'),'value':_0x8cf8('0x2b')},{'name':_0x8cf8('0x2c'),'value':'internal'}];var _0x14fe47=_[_0x8cf8('0x34')](_0x384376,[_0x8cf8('0x31'),_0xd124fc[_0x8cf8('0x33')]])[_0x8cf8('0x35')];return db[_0x8cf8('0x5a')][_0x8cf8('0x34')]({'where':{'name':_0x14fe47,'userProfileId':_0x422be6['userProfileId']},'raw':!![]})[_0x8cf8('0x26')](function(_0x20883e){if(_0x20883e&&_0x20883e[_0x8cf8('0x5b')]===0x0){return db['UserProfileResource'][_0x8cf8('0x56')]({'name':_0xd124fc[_0x8cf8('0x35')],'resourceId':_0xd124fc['id'],'type':_0x20883e[_0x8cf8('0x35')],'sectionId':_0x20883e['id']},{})[_0x8cf8('0x26')](function(){return _0x2e7eaa;});}else{return _0x2e7eaa;}})[_0x8cf8('0x52')](function(_0x52c0f9){logger[_0x8cf8('0x5c')](_0x8cf8('0x5d'),_0x52c0f9);throw _0x52c0f9;});}return _0x2e7eaa;})[_0x8cf8('0x26')](respondWithResult(_0xc7aa0e,0xc9))[_0x8cf8('0x52')](handleError(_0xc7aa0e,null));};exports['update']=function(_0x29bf99,_0x512d50){if(_0x29bf99['body']['id']){delete _0x29bf99[_0x8cf8('0x53')]['id'];}return db[_0x8cf8('0x4b')]['find']({'where':{'id':_0x29bf99[_0x8cf8('0x4f')]['id']}})[_0x8cf8('0x26')](handleEntityNotFound(_0x512d50,null))[_0x8cf8('0x26')](function(_0x41883e){if(_0x41883e){return db[_0x8cf8('0x4b')][_0x8cf8('0x25')](_[_0x8cf8('0x47')](_0x29bf99[_0x8cf8('0x53')],['exten',_0x8cf8('0x5e'),_0x8cf8('0x5f'),_0x8cf8('0x60'),_0x8cf8('0x61'),_0x8cf8('0x62')]),{'where':{'context':_0x41883e[_0x8cf8('0x5e')],'exten':_0x41883e[_0x8cf8('0x54')]},'individualHooks':!![]})['then'](function(_0x37181b){return _0x37181b;});}return null;})['then'](respondWithStatusCode(_0x512d50,null))['catch'](handleError(_0x512d50,null));};exports[_0x8cf8('0x63')]=function(_0x213b21,_0x4eacb2,_0x1a3c87){return db[_0x8cf8('0x4b')]['findOne']({'where':{'id':_0x213b21['params']['id']}})[_0x8cf8('0x26')](handleEntityNotFound(_0x4eacb2,null))['then'](function(_0x53968c){if(_0x53968c){return db['sequelize'][_0x8cf8('0x64')](function(_0x35cd2f){return db[_0x8cf8('0x4b')]['destroy']({'where':{'VoiceExtensionId':_0x213b21['params']['id']},'transaction':_0x35cd2f})['then'](function(_0x23028e){var _0x1ceb8d=_['map'](_0x213b21[_0x8cf8('0x53')],function(_0x29d035){_0x29d035['VoiceExtensionId']=_0x213b21[_0x8cf8('0x4f')]['id'];return _0x29d035;});return db[_0x8cf8('0x4b')][_0x8cf8('0x65')](_0x1ceb8d,{'transaction':_0x35cd2f});});})[_0x8cf8('0x26')](function(){return db[_0x8cf8('0x4b')][_0x8cf8('0x66')]({'where':{'isApp':!![],'VoiceExtensionId':_0x213b21[_0x8cf8('0x4f')]['id']},'order':_0x8cf8('0x67')});});}})[_0x8cf8('0x26')](respondWithResult(_0x4eacb2,null))[_0x8cf8('0x52')](handleError(_0x4eacb2,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index ebaac1f..ea4bf1b 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 _0xc3ed=['emit','hasOwnProperty','hook','exports','save','update'];(function(_0x1a80ee,_0x295292){var _0x1cc350=function(_0x3da5a4){while(--_0x3da5a4){_0x1a80ee['push'](_0x1a80ee['shift']());}};_0x1cc350(++_0x295292);}(_0xc3ed,0xb2));var _0xdc3e=function(_0x4e6ca2,_0x135ba1){_0x4e6ca2=_0x4e6ca2-0x0;var _0x1e92c8=_0xc3ed[_0x4e6ca2];return _0x1e92c8;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdc3e('0x0'),'afterUpdate':_0xdc3e('0x1'),'afterDestroy':'remove'};function emitEvent(_0x6d97d8){return function(_0x49cf77,_0x39c392,_0x2a633c){VoiceExtensionEvents[_0xdc3e('0x2')](_0x6d97d8+':'+_0x49cf77['id'],_0x49cf77);VoiceExtensionEvents[_0xdc3e('0x2')](_0x6d97d8,_0x49cf77);_0x2a633c(null);};}for(var e in events){if(events[_0xdc3e('0x3')](e)){var event=events[e];VoiceExtension[_0xdc3e('0x4')](e,emitEvent(event));}}module[_0xdc3e('0x5')]=VoiceExtensionEvents; \ No newline at end of file +var _0x40cb=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x10f7ca,_0x2adf14){var _0x5256e3=function(_0x5b468f){while(--_0x5b468f){_0x10f7ca['push'](_0x10f7ca['shift']());}};_0x5256e3(++_0x2adf14);}(_0x40cb,0x105));var _0xb40c=function(_0x253e62,_0x53abaf){_0x253e62=_0x253e62-0x0;var _0x41da25=_0x40cb[_0x253e62];return _0x41da25;};'use strict';var EventEmitter=require(_0xb40c('0x0'));var VoiceExtension=require(_0xb40c('0x1'))['db'][_0xb40c('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb40c('0x3')](0x0);var events={'afterCreate':_0xb40c('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x508710){return function(_0x5565e2,_0x51c13c,_0x48e373){VoiceExtensionEvents[_0xb40c('0x5')](_0x508710+':'+_0x5565e2['id'],_0x5565e2);VoiceExtensionEvents[_0xb40c('0x5')](_0x508710,_0x5565e2);_0x48e373(null);};}for(var e in events){if(events[_0xb40c('0x6')](e)){var event=events[e];VoiceExtension[_0xb40c('0x7')](e,emitEvent(event));}}module[_0xb40c('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 266f6dc..f4003aa 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 _0xea68=['rimraf','../../config/environment','./voiceExtension.attributes','define','voice_extensions','lodash','util','api','bluebird','request-promise','path'];(function(_0x1facbf,_0x56ccdf){var _0x371a20=function(_0x4838f2){while(--_0x4838f2){_0x1facbf['push'](_0x1facbf['shift']());}};_0x371a20(++_0x56ccdf);}(_0xea68,0x1bd));var _0x8ea6=function(_0x302d40,_0x2daddc){_0x302d40=_0x302d40-0x0;var _0x4e5a37=_0xea68[_0x302d40];return _0x4e5a37;};'use strict';var _=require(_0x8ea6('0x0'));var util=require(_0x8ea6('0x1'));var logger=require('../../config/logger')(_0x8ea6('0x2'));var moment=require('moment');var BPromise=require(_0x8ea6('0x3'));var rp=require(_0x8ea6('0x4'));var fs=require('fs');var path=require(_0x8ea6('0x5'));var rimraf=require(_0x8ea6('0x6'));var config=require(_0x8ea6('0x7'));var attributes=require(_0x8ea6('0x8'));module['exports']=function(_0xca03d7,_0x40a700){return _0xca03d7[_0x8ea6('0x9')]('VoiceExtension',attributes,{'tableName':_0x8ea6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa984=['voice_extensions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceExtension.attributes','exports','define','VoiceExtension'];(function(_0x596b3d,_0x4e271b){var _0x3edd94=function(_0x495e9e){while(--_0x495e9e){_0x596b3d['push'](_0x596b3d['shift']());}};_0x3edd94(++_0x4e271b);}(_0xa984,0x139));var _0x4a98=function(_0x38f6ee,_0xf06a6c){_0x38f6ee=_0x38f6ee-0x0;var _0x49aeef=_0xa984[_0x38f6ee];return _0x49aeef;};'use strict';var _=require('lodash');var util=require(_0x4a98('0x0'));var logger=require(_0x4a98('0x1'))(_0x4a98('0x2'));var moment=require(_0x4a98('0x3'));var BPromise=require(_0x4a98('0x4'));var rp=require(_0x4a98('0x5'));var fs=require('fs');var path=require(_0x4a98('0x6'));var rimraf=require(_0x4a98('0x7'));var config=require('../../config/environment');var attributes=require(_0x4a98('0x8'));module[_0x4a98('0x9')]=function(_0x1991d3,_0x37c319){return _0x1991d3[_0x4a98('0xa')](_0x4a98('0xb'),attributes,{'tableName':_0x4a98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index baded36..d9d5507 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 _0x4c6c=['jayson/promise','client','http','redis','defaults','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','include','map','model','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2e8a6e,_0x18e64f){var _0x259829=function(_0x230dac){while(--_0x230dac){_0x2e8a6e['push'](_0x2e8a6e['shift']());}};_0x259829(++_0x18e64f);}(_0x4c6c,0x100));var _0xc4c6=function(_0x450b03,_0x16b6e2){_0x450b03=_0x450b03-0x0;var _0x16267b=_0x4c6c[_0x450b03];return _0x16267b;};'use strict';var _=require(_0xc4c6('0x0'));var util=require(_0xc4c6('0x1'));var moment=require(_0xc4c6('0x2'));var BPromise=require(_0xc4c6('0x3'));var rs=require(_0xc4c6('0x4'));var fs=require('fs');var Redis=require(_0xc4c6('0x5'));var db=require(_0xc4c6('0x6'))['db'];var utils=require(_0xc4c6('0x7'));var logger=require('../../config/logger')(_0xc4c6('0x8'));var config=require(_0xc4c6('0x9'));var jayson=require(_0xc4c6('0xa'));var client=jayson[_0xc4c6('0xb')][_0xc4c6('0xc')]({'port':0x232a});config[_0xc4c6('0xd')]=_[_0xc4c6('0xe')](config[_0xc4c6('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc4c6('0xd')]));require(_0xc4c6('0xf'))['register'](socket);function respondWithRpcPromise(_0x31c33e,_0x301d1c,_0x28a100){return new BPromise(function(_0x29aee5,_0x1f26a7){return client[_0xc4c6('0x10')](_0x31c33e,_0x28a100)[_0xc4c6('0x11')](function(_0x15b343){logger['info'](_0xc4c6('0x12'),_0x301d1c,'request\x20sent');logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x301d1c,_0xc4c6('0x13'),JSON[_0xc4c6('0x14')](_0x15b343));if(_0x15b343['error']){if(_0x15b343[_0xc4c6('0x15')][_0xc4c6('0x16')]===0x1f4){logger[_0xc4c6('0x15')](_0xc4c6('0x12'),_0x301d1c,_0x15b343[_0xc4c6('0x15')][_0xc4c6('0x17')]);return _0x1f26a7(_0x15b343[_0xc4c6('0x15')][_0xc4c6('0x17')]);}logger['error'](_0xc4c6('0x12'),_0x301d1c,_0x15b343[_0xc4c6('0x15')][_0xc4c6('0x17')]);return _0x29aee5(_0x15b343[_0xc4c6('0x15')][_0xc4c6('0x17')]);}else{logger[_0xc4c6('0x18')](_0xc4c6('0x12'),_0x301d1c,'request\x20sent');_0x29aee5(_0x15b343[_0xc4c6('0x19')][_0xc4c6('0x17')]);}})['catch'](function(_0x499059){logger[_0xc4c6('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x301d1c,_0x499059);_0x1f26a7(_0x499059);});});}exports[_0xc4c6('0x1a')]=function(_0x3c37b0){var _0x3b245e=this;return new Promise(function(_0x4b271b,_0x1a0c0e){return db[_0xc4c6('0x1b')][_0xc4c6('0x1c')]({'raw':_0x3c37b0[_0xc4c6('0x1d')]?_0x3c37b0['options'][_0xc4c6('0x1e')]===undefined?!![]:![]:!![],'where':_0x3c37b0[_0xc4c6('0x1d')]?_0x3c37b0['options'][_0xc4c6('0x1f')]||null:null,'attributes':_0x3c37b0[_0xc4c6('0x1d')]?_0x3c37b0['options'][_0xc4c6('0x20')]||null:null,'limit':_0x3c37b0['options']?_0x3c37b0[_0xc4c6('0x1d')]['limit']||null:null,'include':_0x3c37b0[_0xc4c6('0x1d')]?_0x3c37b0[_0xc4c6('0x1d')][_0xc4c6('0x21')]?_[_0xc4c6('0x22')](_0x3c37b0['options'][_0xc4c6('0x21')],function(_0x55e520){return{'model':db[_0x55e520[_0xc4c6('0x23')]],'as':_0x55e520['as'],'attributes':_0x55e520['attributes'],'include':_0x55e520[_0xc4c6('0x21')]?_['map'](_0x55e520['include'],function(_0x12681a){return{'model':db[_0x12681a[_0xc4c6('0x23')]],'as':_0x12681a['as'],'attributes':_0x12681a[_0xc4c6('0x20')],'include':_0x12681a['include']?_['map'](_0x12681a['include'],function(_0x821d7){return{'model':db[_0x821d7[_0xc4c6('0x23')]],'as':_0x821d7['as'],'attributes':_0x821d7[_0xc4c6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc4c6('0x11')](function(_0x7dc0eb){logger[_0xc4c6('0x18')]('GetVoiceExtension',_0x3c37b0);logger[_0xc4c6('0x24')](_0xc4c6('0x1a'),_0x3c37b0,JSON[_0xc4c6('0x14')](_0x7dc0eb));_0x4b271b(_0x7dc0eb);})[_0xc4c6('0x25')](function(_0x81fd67){logger[_0xc4c6('0x15')]('GetVoiceExtension',_0x81fd67[_0xc4c6('0x17')],_0x3c37b0);_0x1a0c0e(_0x3b245e[_0xc4c6('0x15')](0x1f4,_0x81fd67['message']));});});}; \ No newline at end of file +var _0x0701=['jayson/promise','client','redis','socket.io-emitter','./voiceExtension.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment'];(function(_0x1fee92,_0x3add7e){var _0x856852=function(_0x3faf2a){while(--_0x3faf2a){_0x1fee92['push'](_0x1fee92['shift']());}};_0x856852(++_0x3add7e);}(_0x0701,0x14e));var _0x1070=function(_0x5c2639,_0x1ee8c5){_0x5c2639=_0x5c2639-0x0;var _0x2c2643=_0x0701[_0x5c2639];return _0x2c2643;};'use strict';var _=require(_0x1070('0x0'));var util=require('util');var moment=require(_0x1070('0x1'));var BPromise=require(_0x1070('0x2'));var rs=require(_0x1070('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1070('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1070('0x5'));var jayson=require(_0x1070('0x6'));var client=jayson[_0x1070('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x1070('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x1070('0x9'))(new Redis(config[_0x1070('0x8')]));require(_0x1070('0xa'))[_0x1070('0xb')](socket);function respondWithRpcPromise(_0xb0ab9a,_0x480aea,_0x2c7e98){return new BPromise(function(_0xe10032,_0x2e4a68){return client[_0x1070('0xc')](_0xb0ab9a,_0x2c7e98)[_0x1070('0xd')](function(_0x105c26){logger[_0x1070('0xe')]('VoiceExtension,\x20%s,\x20%s',_0x480aea,'request\x20sent');logger[_0x1070('0xf')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x480aea,_0x1070('0x10'),JSON[_0x1070('0x11')](_0x105c26));if(_0x105c26[_0x1070('0x12')]){if(_0x105c26['error'][_0x1070('0x13')]===0x1f4){logger['error'](_0x1070('0x14'),_0x480aea,_0x105c26[_0x1070('0x12')][_0x1070('0x15')]);return _0x2e4a68(_0x105c26['error']['message']);}logger[_0x1070('0x12')](_0x1070('0x14'),_0x480aea,_0x105c26[_0x1070('0x12')][_0x1070('0x15')]);return _0xe10032(_0x105c26[_0x1070('0x12')][_0x1070('0x15')]);}else{logger[_0x1070('0xe')](_0x1070('0x14'),_0x480aea,_0x1070('0x10'));_0xe10032(_0x105c26['result']['message']);}})[_0x1070('0x16')](function(_0x47a795){logger['error'](_0x1070('0x14'),_0x480aea,_0x47a795);_0x2e4a68(_0x47a795);});});}exports[_0x1070('0x17')]=function(_0x16be4b){var _0x121214=this;return new Promise(function(_0x28f963,_0x32f6ea){return db[_0x1070('0x18')][_0x1070('0x19')]({'raw':_0x16be4b[_0x1070('0x1a')]?_0x16be4b[_0x1070('0x1a')][_0x1070('0x1b')]===undefined?!![]:![]:!![],'where':_0x16be4b[_0x1070('0x1a')]?_0x16be4b['options'][_0x1070('0x1c')]||null:null,'attributes':_0x16be4b[_0x1070('0x1a')]?_0x16be4b[_0x1070('0x1a')][_0x1070('0x1d')]||null:null,'limit':_0x16be4b['options']?_0x16be4b['options'][_0x1070('0x1e')]||null:null,'include':_0x16be4b[_0x1070('0x1a')]?_0x16be4b['options'][_0x1070('0x1f')]?_[_0x1070('0x20')](_0x16be4b[_0x1070('0x1a')]['include'],function(_0x2a9cb8){return{'model':db[_0x2a9cb8[_0x1070('0x21')]],'as':_0x2a9cb8['as'],'attributes':_0x2a9cb8[_0x1070('0x1d')],'include':_0x2a9cb8[_0x1070('0x1f')]?_['map'](_0x2a9cb8[_0x1070('0x1f')],function(_0x40fb3c){return{'model':db[_0x40fb3c[_0x1070('0x21')]],'as':_0x40fb3c['as'],'attributes':_0x40fb3c[_0x1070('0x1d')],'include':_0x40fb3c[_0x1070('0x1f')]?_['map'](_0x40fb3c['include'],function(_0x492aa0){return{'model':db[_0x492aa0[_0x1070('0x21')]],'as':_0x492aa0['as'],'attributes':_0x492aa0['attributes']};}):[]};}):[]};}):[]:[]})[_0x1070('0xd')](function(_0x529f6e){logger['info']('GetVoiceExtension',_0x16be4b);logger[_0x1070('0xf')]('GetVoiceExtension',_0x16be4b,JSON[_0x1070('0x11')](_0x529f6e));_0x28f963(_0x529f6e);})[_0x1070('0x16')](function(_0x17b5e5){logger[_0x1070('0x12')](_0x1070('0x17'),_0x17b5e5[_0x1070('0x15')],_0x16be4b);_0x32f6ea(_0x121214['error'](0x1f4,_0x17b5e5[_0x1070('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 133733d..33d7d36 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 _0xaba9=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','emit'];(function(_0x33cdc6,_0x3a13ad){var _0x2f456e=function(_0x27431e){while(--_0x27431e){_0x33cdc6['push'](_0x33cdc6['shift']());}};_0x2f456e(++_0x3a13ad);}(_0xaba9,0x18c));var _0x9aba=function(_0x4f4beb,_0x5c01aa){_0x4f4beb=_0x4f4beb-0x0;var _0x496443=_0xaba9[_0x4f4beb];return _0x496443;};'use strict';var VoiceExtensionEvents=require(_0x9aba('0x0'));var events=[_0x9aba('0x1'),_0x9aba('0x2'),'update'];function createListener(_0x4d32e1,_0x33964f){return function(_0x544a1f){_0x33964f[_0x9aba('0x3')](_0x4d32e1,_0x544a1f);};}function removeListener(_0x54ba19,_0x3aeb55){return function(){VoiceExtensionEvents[_0x9aba('0x4')](_0x54ba19,_0x3aeb55);};}exports[_0x9aba('0x5')]=function(_0x317103){for(var _0x2e4157=0x0,_0x33607b=events[_0x9aba('0x6')];_0x2e4157<_0x33607b;_0x2e4157++){var _0x1182eb=events[_0x2e4157];var _0x10e203=createListener(_0x9aba('0x7')+_0x1182eb,_0x317103);VoiceExtensionEvents['on'](_0x1182eb,_0x10e203);}}; \ No newline at end of file +var _0x0d5a=['update','removeListener','register','length','./voiceExtension.events','save'];(function(_0xd6b0b1,_0x2db1e5){var _0x1e2560=function(_0x21247b){while(--_0x21247b){_0xd6b0b1['push'](_0xd6b0b1['shift']());}};_0x1e2560(++_0x2db1e5);}(_0x0d5a,0x178));var _0xa0d5=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x0d5a[_0x110c3d];return _0x226d67;};'use strict';var VoiceExtensionEvents=require(_0xa0d5('0x0'));var events=[_0xa0d5('0x1'),'remove',_0xa0d5('0x2')];function createListener(_0x45a79b,_0x3eb39d){return function(_0x1663fd){_0x3eb39d['emit'](_0x45a79b,_0x1663fd);};}function removeListener(_0x3fc5e4,_0x2a6af4){return function(){VoiceExtensionEvents[_0xa0d5('0x3')](_0x3fc5e4,_0x2a6af4);};}exports[_0xa0d5('0x4')]=function(_0x18426a){for(var _0x4ac248=0x0,_0x503baa=events[_0xa0d5('0x5')];_0x4ac248<_0x503baa;_0x4ac248++){var _0x3fb378=events[_0x4ac248];var _0x3c9529=createListener('voiceExtension:'+_0x3fb378,_0x18426a);VoiceExtensionEvents['on'](_0x3fb378,_0x3c9529);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index b18a21f..4668337 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 _0x578c=['update','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create'];(function(_0x194035,_0x2ac741){var _0x1eb086=function(_0x3e5858){while(--_0x3e5858){_0x194035['push'](_0x194035['shift']());}};_0x1eb086(++_0x2ac741);}(_0x578c,0x158));var _0xc578=function(_0x5d390b,_0x218d9a){_0x5d390b=_0x5d390b-0x0;var _0x2efa7f=_0x578c[_0x5d390b];return _0x2efa7f;};'use strict';var multer=require(_0xc578('0x0'));var util=require(_0xc578('0x1'));var path=require(_0xc578('0x2'));var timeout=require('connect-timeout');var express=require(_0xc578('0x3'));var router=express[_0xc578('0x4')]();var fs_extra=require(_0xc578('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc578('0x6'));var config=require(_0xc578('0x7'));var controller=require(_0xc578('0x8'));router[_0xc578('0x9')]('/',auth[_0xc578('0xa')](),controller[_0xc578('0xb')]);router[_0xc578('0x9')](_0xc578('0xc'),auth[_0xc578('0xa')](),controller[_0xc578('0xd')]);router[_0xc578('0x9')](_0xc578('0xe'),auth[_0xc578('0xa')](),controller[_0xc578('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc578('0x10')]);router['put'](_0xc578('0xc'),auth[_0xc578('0xa')](),controller[_0xc578('0x11')]);router['delete'](_0xc578('0xc'),auth[_0xc578('0xa')](),controller[_0xc578('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf6e8=['fs-extra','../../components/interaction/service','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x313168,_0x15fe03){_0x313168=_0x313168-0x0;var _0x9d1305=_0xf6e8[_0x313168];return _0x9d1305;};'use strict';var multer=require('multer');var util=require(_0x8f6e('0x0'));var path=require(_0x8f6e('0x1'));var timeout=require(_0x8f6e('0x2'));var express=require(_0x8f6e('0x3'));var router=express[_0x8f6e('0x4')]();var fs_extra=require(_0x8f6e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8f6e('0x6'));var config=require('../../config/environment');var controller=require(_0x8f6e('0x7'));router[_0x8f6e('0x8')]('/',auth['isAuthenticated'](),controller[_0x8f6e('0x9')]);router[_0x8f6e('0x8')](_0x8f6e('0xa'),auth[_0x8f6e('0xb')](),controller[_0x8f6e('0xc')]);router[_0x8f6e('0x8')](_0x8f6e('0xd'),auth[_0x8f6e('0xb')](),controller[_0x8f6e('0xe')]);router[_0x8f6e('0xf')]('/',auth['isAuthenticated'](),controller[_0x8f6e('0x10')]);router[_0x8f6e('0x11')]('/:id',auth[_0x8f6e('0xb')](),controller[_0x8f6e('0x12')]);router[_0x8f6e('0x13')](_0x8f6e('0xa'),auth[_0x8f6e('0xb')](),controller[_0x8f6e('0x14')]);module[_0x8f6e('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 e2aeea9..1a9faa5 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 _0x4cf8=['mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue'];(function(_0x23608d,_0x3c87db){var _0x30890a=function(_0x36523d){while(--_0x36523d){_0x23608d['push'](_0x23608d['shift']());}};_0x30890a(++_0x3c87db);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x208505,_0x241a77){_0x208505=_0x208505-0x0;var _0x1a985f=_0x4cf8[_0x208505];return _0x1a985f;};'use strict';var Sequelize=require(_0x84cf('0x0'));module[_0x84cf('0x1')]={'customer_id':{'type':Sequelize[_0x84cf('0x2')]},'context':{'type':Sequelize[_0x84cf('0x2')],'defaultValue':_0x84cf('0x3'),'unique':_0x84cf('0x4')},'mailbox':{'type':Sequelize[_0x84cf('0x2')],'defaultValue':'','allowNull':![],'unique':_0x84cf('0x4')},'password':{'type':Sequelize[_0x84cf('0x2')]},'fullname':{'type':Sequelize[_0x84cf('0x2')]},'email':{'type':Sequelize[_0x84cf('0x2')],'validate':{'isEmail':!![]},'set':function(_0x2c613d){this['setDataValue']('email',typeof _0x2c613d===_0x84cf('0x5')&&_0x2c613d['trim']()?_0x2c613d[_0x84cf('0x6')]():null);}},'pager':{'type':Sequelize[_0x84cf('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x84cf('0x7')},'attach':{'type':Sequelize[_0x84cf('0x8')]('yes','no'),'defaultValue':_0x84cf('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':_0x84cf('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x84cf('0x2')]},'review':{'type':Sequelize[_0x84cf('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x84cf('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':_0x84cf('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x84cf('0xb')},'emailsubject':{'type':Sequelize[_0x84cf('0x2')]},'emailbody':{'type':Sequelize[_0x84cf('0x2')]},'maxsecs':{'type':Sequelize[_0x84cf('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x84cf('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x84cf('0xd')],'get':function(){return this[_0x84cf('0xe')]('fullname')+'\x20-\x20'+this[_0x84cf('0xe')](_0x84cf('0xf'));}}}; \ No newline at end of file +var _0xa571=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','string'];(function(_0x5c8b28,_0x3ac641){var _0x46683d=function(_0x581497){while(--_0x581497){_0x5c8b28['push'](_0x5c8b28['shift']());}};_0x46683d(++_0x3ac641);}(_0xa571,0x107));var _0x1a57=function(_0x1f7bea,_0x411dd6){_0x1f7bea=_0x1f7bea-0x0;var _0xdb9a17=_0xa571[_0x1f7bea];return _0xdb9a17;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'customer_id':{'type':Sequelize[_0x1a57('0x2')]},'context':{'type':Sequelize[_0x1a57('0x2')],'defaultValue':'from-voicemail','unique':_0x1a57('0x3')},'mailbox':{'type':Sequelize[_0x1a57('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x1a57('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0xa58922){this[_0x1a57('0x4')](_0x1a57('0x5'),typeof _0xa58922===_0x1a57('0x6')&&_0xa58922[_0x1a57('0x7')]()?_0xa58922[_0x1a57('0x7')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x1a57('0x2')],'defaultValue':_0x1a57('0x8')},'attach':{'type':Sequelize[_0x1a57('0x9')]('yes','no'),'defaultValue':_0x1a57('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1a57('0x9')](_0x1a57('0xa'),'no'),'defaultValue':_0x1a57('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x1a57('0x2')]},'callback':{'type':Sequelize[_0x1a57('0x2')]},'review':{'type':Sequelize[_0x1a57('0x9')](_0x1a57('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1a57('0x9')](_0x1a57('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1a57('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1a57('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1a57('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1a57('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1a57('0x9')](_0x1a57('0xa'),'no'),'defaultValue':_0x1a57('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1a57('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1a57('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x1a57('0xa'),'no'),'defaultValue':_0x1a57('0xa'),'allowNull':![]},'stamp':{'type':_0x1a57('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x1a57('0x2')]},'maxsecs':{'type':Sequelize[_0x1a57('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1a57('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1a57('0xe')](_0x1a57('0xf'))+_0x1a57('0x10')+this[_0x1a57('0xe')](_0x1a57('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 46bb937..90f88e6 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 _0x5a01=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x335859,_0x46ef87){var _0x5e38cc=function(_0x4fed49){while(--_0x4fed49){_0x335859['push'](_0x335859['shift']());}};_0x5e38cc(++_0x46ef87);}(_0x5a01,0x1af));var _0x15a0=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0x5a01[_0x52c4e9];return _0x252a03;};'use strict';var emlformat=require(_0x15a0('0x0'));var rimraf=require(_0x15a0('0x1'));var zipdir=require(_0x15a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x15a0('0x3'));var BPromise=require(_0x15a0('0x4'));var Mustache=require('mustache');var util=require(_0x15a0('0x5'));var path=require(_0x15a0('0x6'));var sox=require(_0x15a0('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15a0('0x8'));var _=require(_0x15a0('0x9'));var squel=require(_0x15a0('0xa'));var crypto=require('crypto');var jsforce=require(_0x15a0('0xb'));var deskjs=require(_0x15a0('0xc'));var toCsv=require(_0x15a0('0xd'));var querystring=require(_0x15a0('0xe'));var Papa=require(_0x15a0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x15a0('0x10'));var as=require(_0x15a0('0x11'));var hardwareService=require(_0x15a0('0x12'));var logger=require(_0x15a0('0x13'))(_0x15a0('0x14'));var utils=require(_0x15a0('0x15'));var config=require(_0x15a0('0x16'));var licenseUtil=require(_0x15a0('0x17'));var db=require(_0x15a0('0x18'))['db'];function respondWithStatusCode(_0x131ea2,_0x17108f){_0x17108f=_0x17108f||0xcc;return function(_0x418907){if(_0x418907){return _0x131ea2['sendStatus'](_0x17108f);}return _0x131ea2['status'](_0x17108f)[_0x15a0('0x19')]();};}function respondWithResult(_0x1bacb4,_0xa580bf){_0xa580bf=_0xa580bf||0xc8;return function(_0x1c4d39){if(_0x1c4d39){return _0x1bacb4[_0x15a0('0x1a')](_0xa580bf)[_0x15a0('0x1b')](_0x1c4d39);}};}function respondWithFilteredResult(_0x2595c1,_0x2568ee){return function(_0x2b8a17){if(_0x2b8a17){var _0x547d10=_0x2b8a17[_0x15a0('0x1c')],_0x40d6e7=_0x2568ee[_0x15a0('0x1d')],_0x545aad=_0x2568ee[_0x15a0('0x1d')]+_0x2568ee[_0x15a0('0x1e')],_0x593f2c;if(_0x545aad>=_0x547d10){_0x545aad=_0x547d10;_0x593f2c=0xc8;}else{_0x593f2c=0xce;}_0x2595c1['status'](_0x593f2c);return _0x2595c1['set'](_0x15a0('0x1f'),_0x40d6e7+'-'+_0x545aad+'/'+_0x547d10)[_0x15a0('0x1b')](_0x2b8a17);}return null;};}function patchUpdates(_0x56a2be){return function(_0x1a71b6){try{jsonpatch['apply'](_0x1a71b6,_0x56a2be,!![]);}catch(_0x3d7637){return BPromise[_0x15a0('0x20')](_0x3d7637);}return _0x1a71b6[_0x15a0('0x21')]();};}function saveUpdates(_0xc035d3,_0x225aac){return function(_0xeeefcf){if(_0xeeefcf){return _0xeeefcf[_0x15a0('0x22')](_0xc035d3)['then'](function(_0x4d4c1b){return _0x4d4c1b;});}return null;};}function removeEntity(_0x32eafd,_0x23a2f6){return function(_0x349623){if(_0x349623){return _0x349623[_0x15a0('0x23')]()[_0x15a0('0x24')](function(){var _0x3a06cc=_0x349623[_0x15a0('0x25')]({'plain':!![]});var _0x53e470='Voicemails';return db[_0x15a0('0x26')]['destroy']({'where':{'type':_0x53e470,'resourceId':_0x3a06cc['id']}})[_0x15a0('0x24')](function(){return _0x349623;});})[_0x15a0('0x24')](function(){_0x32eafd[_0x15a0('0x1a')](0xcc)[_0x15a0('0x19')]();});}};}function handleEntityNotFound(_0x23a06b,_0x20cbd3){return function(_0x3b050f){if(!_0x3b050f){_0x23a06b[_0x15a0('0x27')](0x194);}return _0x3b050f;};}function handleError(_0x3608d6,_0x4123b6){_0x4123b6=_0x4123b6||0x1f4;return function(_0xf9781){logger['error'](_0xf9781[_0x15a0('0x28')]);if(_0xf9781['name']){delete _0xf9781[_0x15a0('0x29')];}_0x3608d6['status'](_0x4123b6)[_0x15a0('0x2a')](_0xf9781);};}exports[_0x15a0('0x2b')]=function(_0x1a20ed,_0x15a2e7){var _0x1d76c3={},_0x2c7001={},_0x366d1e={'count':0x0,'rows':[]};var _0xda099f=_[_0x15a0('0x2c')](db[_0x15a0('0x2d')][_0x15a0('0x2e')],function(_0xf5b7c4){return{'name':_0xf5b7c4[_0x15a0('0x2f')],'type':_0xf5b7c4[_0x15a0('0x30')][_0x15a0('0x31')]};});_0x2c7001['model']=_[_0x15a0('0x2c')](_0xda099f,_0x15a0('0x29'));_0x2c7001['query']=_['keys'](_0x1a20ed[_0x15a0('0x32')]);_0x2c7001[_0x15a0('0x33')]=_['intersection'](_0x2c7001[_0x15a0('0x34')],_0x2c7001[_0x15a0('0x32')]);_0x1d76c3['attributes']=_[_0x15a0('0x35')](_0x2c7001[_0x15a0('0x34')],qs[_0x15a0('0x36')](_0x1a20ed['query'][_0x15a0('0x36')]));_0x1d76c3[_0x15a0('0x37')]=_0x1d76c3[_0x15a0('0x37')][_0x15a0('0x38')]?_0x1d76c3['attributes']:_0x2c7001[_0x15a0('0x34')];if(!_0x1a20ed[_0x15a0('0x32')]['hasOwnProperty']('nolimit')){_0x1d76c3['limit']=qs[_0x15a0('0x1e')](_0x1a20ed[_0x15a0('0x32')][_0x15a0('0x1e')]);_0x1d76c3[_0x15a0('0x1d')]=qs[_0x15a0('0x1d')](_0x1a20ed[_0x15a0('0x32')][_0x15a0('0x1d')]);}_0x1d76c3[_0x15a0('0x39')]=qs[_0x15a0('0x3a')](_0x1a20ed[_0x15a0('0x32')][_0x15a0('0x3a')]);_0x1d76c3[_0x15a0('0x3b')]=qs[_0x15a0('0x33')](_[_0x15a0('0x3c')](_0x1a20ed[_0x15a0('0x32')],_0x2c7001[_0x15a0('0x33')]),_0xda099f);if(_0x1a20ed[_0x15a0('0x32')][_0x15a0('0x3d')]){_0x1d76c3[_0x15a0('0x3b')]=_[_0x15a0('0x3e')](_0x1d76c3[_0x15a0('0x3b')],{'$or':_[_0x15a0('0x2c')](_0xda099f,function(_0x484fdc){if(_0x484fdc[_0x15a0('0x30')]!==_0x15a0('0x3f')){var _0x28d84b={};_0x28d84b[_0x484fdc[_0x15a0('0x29')]]={'$like':'%'+_0x1a20ed[_0x15a0('0x32')]['filter']+'%'};return _0x28d84b;}})});}_0x1d76c3=_[_0x15a0('0x3e')]({},_0x1d76c3,_0x1a20ed[_0x15a0('0x40')]);var _0x46cd13={'where':_0x1d76c3[_0x15a0('0x3b')]};return db['VoiceMail'][_0x15a0('0x1c')](_0x46cd13)[_0x15a0('0x24')](function(_0xff9655){_0x366d1e[_0x15a0('0x1c')]=_0xff9655;if(_0x1a20ed[_0x15a0('0x32')][_0x15a0('0x41')]){_0x1d76c3['include']=[{'all':!![]}];}return db[_0x15a0('0x2d')][_0x15a0('0x42')](_0x1d76c3);})[_0x15a0('0x24')](function(_0x2f9945){_0x366d1e['rows']=_0x2f9945;return _0x366d1e;})[_0x15a0('0x24')](respondWithFilteredResult(_0x15a2e7,_0x1d76c3))[_0x15a0('0x43')](handleError(_0x15a2e7,null));};exports[_0x15a0('0x44')]=function(_0x5989f7,_0xec055a){var _0x4f3367={'raw':!![],'where':{'id':_0x5989f7[_0x15a0('0x45')]['id']}},_0x19b857={};_0x19b857[_0x15a0('0x34')]=_[_0x15a0('0x46')](db['VoiceMail'][_0x15a0('0x2e')]);_0x19b857[_0x15a0('0x32')]=_['keys'](_0x5989f7['query']);_0x19b857['filters']=_['intersection'](_0x19b857[_0x15a0('0x34')],_0x19b857[_0x15a0('0x32')]);_0x4f3367[_0x15a0('0x37')]=_[_0x15a0('0x35')](_0x19b857['model'],qs[_0x15a0('0x36')](_0x5989f7[_0x15a0('0x32')][_0x15a0('0x36')]));_0x4f3367[_0x15a0('0x37')]=_0x4f3367['attributes'][_0x15a0('0x38')]?_0x4f3367['attributes']:_0x19b857[_0x15a0('0x34')];if(_0x5989f7[_0x15a0('0x32')][_0x15a0('0x41')]){_0x4f3367[_0x15a0('0x47')]=[{'all':!![]}];}_0x4f3367=_[_0x15a0('0x3e')]({},_0x4f3367,_0x5989f7[_0x15a0('0x40')]);return db[_0x15a0('0x2d')]['find'](_0x4f3367)[_0x15a0('0x24')](handleEntityNotFound(_0xec055a,null))[_0x15a0('0x24')](respondWithResult(_0xec055a,null))[_0x15a0('0x43')](handleError(_0xec055a,null));};exports[_0x15a0('0x48')]=function(_0xd9ded,_0x67414a){return db[_0x15a0('0x2d')][_0x15a0('0x48')](_0xd9ded[_0x15a0('0x49')],{})['then'](function(_0x51d164){var _0x10372a=_0xd9ded[_0x15a0('0x4a')][_0x15a0('0x25')]({'plain':!![]});if(!_0x10372a)throw new Error(_0x15a0('0x4b'));if(_0x10372a[_0x15a0('0x4c')]===_0x15a0('0x4a')){var _0x3f7307=_0x51d164[_0x15a0('0x25')]({'plain':!![]});var _0x13f24f=_0x15a0('0x4d');return db[_0x15a0('0x4e')][_0x15a0('0x4f')]({'where':{'name':_0x13f24f,'userProfileId':_0x10372a[_0x15a0('0x50')]},'raw':!![]})[_0x15a0('0x24')](function(_0x304d80){if(_0x304d80&&_0x304d80[_0x15a0('0x51')]===0x0){return db['UserProfileResource'][_0x15a0('0x48')]({'name':_0x3f7307['name'],'resourceId':_0x3f7307['id'],'type':_0x304d80[_0x15a0('0x29')],'sectionId':_0x304d80['id']},{})[_0x15a0('0x24')](function(){return _0x51d164;});}else{return _0x51d164;}})['catch'](function(_0x24afd4){logger[_0x15a0('0x52')](_0x15a0('0x53'),_0x24afd4);throw _0x24afd4;});}return _0x51d164;})[_0x15a0('0x24')](respondWithResult(_0x67414a,0xc9))[_0x15a0('0x43')](handleError(_0x67414a,null));};exports[_0x15a0('0x22')]=function(_0xb14ccf,_0x49dc3c){if(_0xb14ccf[_0x15a0('0x49')]['id']){delete _0xb14ccf['body']['id'];}return db[_0x15a0('0x2d')]['find']({'where':{'id':_0xb14ccf['params']['id']}})[_0x15a0('0x24')](handleEntityNotFound(_0x49dc3c,null))[_0x15a0('0x24')](saveUpdates(_0xb14ccf[_0x15a0('0x49')],null))[_0x15a0('0x24')](respondWithResult(_0x49dc3c,null))[_0x15a0('0x43')](handleError(_0x49dc3c,null));};exports[_0x15a0('0x23')]=function(_0x48097a,_0x3a485d){return db['VoiceMail']['find']({'where':{'id':_0x48097a[_0x15a0('0x45')]['id']}})[_0x15a0('0x24')](handleEntityNotFound(_0x3a485d,null))[_0x15a0('0x24')](removeEntity(_0x3a485d,null))[_0x15a0('0x43')](handleError(_0x3a485d,null));};exports['getMessages']=function(_0x1b02d4,_0x6eebbf,_0x2969b1){return db[_0x15a0('0x2d')][_0x15a0('0x54')]({'where':{'id':_0x1b02d4[_0x15a0('0x45')]['id']}})[_0x15a0('0x24')](handleEntityNotFound(_0x6eebbf,null))[_0x15a0('0x24')](function(_0x56a998){var _0x371b9b;var _0xa72b34={},_0x25e8dc={};_0x25e8dc['model']=_['keys'](db[_0x15a0('0x55')]['rawAttributes']);_0x25e8dc[_0x15a0('0x32')]=_[_0x15a0('0x46')](_0x1b02d4['query']);_0x25e8dc['filters']=_[_0x15a0('0x35')](_0x25e8dc['model'],_0x25e8dc[_0x15a0('0x32')]);_0xa72b34['attributes']=_[_0x15a0('0x35')](_0x25e8dc[_0x15a0('0x34')],qs[_0x15a0('0x36')](_0x1b02d4[_0x15a0('0x32')][_0x15a0('0x36')]));_0xa72b34['attributes']=_0xa72b34[_0x15a0('0x37')][_0x15a0('0x38')]?_0xa72b34[_0x15a0('0x37')]:_0x25e8dc['model'];if(!_0x1b02d4[_0x15a0('0x32')][_0x15a0('0x56')](_0x15a0('0x57'))){_0xa72b34[_0x15a0('0x1e')]=qs['limit'](_0x1b02d4[_0x15a0('0x32')][_0x15a0('0x1e')]);_0xa72b34[_0x15a0('0x1d')]=qs[_0x15a0('0x1d')](_0x1b02d4[_0x15a0('0x32')][_0x15a0('0x1d')]);}_0xa72b34[_0x15a0('0x39')]=qs[_0x15a0('0x3a')](_0x1b02d4[_0x15a0('0x32')][_0x15a0('0x3a')]);_0xa72b34['where']=qs[_0x15a0('0x33')](_[_0x15a0('0x3c')](_0x1b02d4[_0x15a0('0x32')],_0x25e8dc[_0x15a0('0x33')]));if(_0x1b02d4[_0x15a0('0x32')]['filter']){_0xa72b34[_0x15a0('0x3b')]=_[_0x15a0('0x3e')](_0xa72b34[_0x15a0('0x3b')],{'$or':_[_0x15a0('0x2c')](_0xa72b34[_0x15a0('0x37')],function(_0xfbf402){var _0x3cf83a={};_0x3cf83a[_0xfbf402]={'$like':'%'+_0x1b02d4[_0x15a0('0x32')][_0x15a0('0x3d')]+'%'};return _0x3cf83a;})});}_0xa72b34[_0x15a0('0x3b')]=_[_0x15a0('0x3e')](_0xa72b34['where'],{'mailboxuser':_0x56a998[_0x15a0('0x58')]});_0xa72b34=_[_0x15a0('0x3e')]({},_0xa72b34,_0x1b02d4[_0x15a0('0x40')]);return db['VoiceMailMessage'][_0x15a0('0x59')](_0xa72b34)['then'](respondWithFilteredResult(_0x6eebbf,_0xa72b34));})[_0x15a0('0x43')](handleError(_0x6eebbf,null));}; \ No newline at end of file +var _0x2029=['mailbox','VoiceMailMessage','findAndCountAll','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','VIRTUAL','options','where','includeAll','findAll','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','nolimit'];(function(_0x2b8e2f,_0x5c8a59){var _0x389e90=function(_0x5899e4){while(--_0x5899e4){_0x2b8e2f['push'](_0x2b8e2f['shift']());}};_0x389e90(++_0x5c8a59);}(_0x2029,0xb5));var _0x9202=function(_0x225cf9,_0xe28acf){_0x225cf9=_0x225cf9-0x0;var _0x460221=_0x2029[_0x225cf9];return _0x460221;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9202('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9202('0x1'));var rp=require(_0x9202('0x2'));var moment=require(_0x9202('0x3'));var BPromise=require(_0x9202('0x4'));var Mustache=require(_0x9202('0x5'));var util=require(_0x9202('0x6'));var path=require('path');var sox=require(_0x9202('0x7'));var csv=require(_0x9202('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9202('0x9'));var squel=require(_0x9202('0xa'));var crypto=require(_0x9202('0xb'));var jsforce=require(_0x9202('0xc'));var deskjs=require(_0x9202('0xd'));var toCsv=require(_0x9202('0x8'));var querystring=require(_0x9202('0xe'));var Papa=require(_0x9202('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9202('0x10'));var as=require(_0x9202('0x11'));var hardwareService=require(_0x9202('0x12'));var logger=require(_0x9202('0x13'))('api');var utils=require(_0x9202('0x14'));var config=require(_0x9202('0x15'));var licenseUtil=require(_0x9202('0x16'));var db=require(_0x9202('0x17'))['db'];function respondWithStatusCode(_0xf69244,_0x4d7248){_0x4d7248=_0x4d7248||0xcc;return function(_0x34fa32){if(_0x34fa32){return _0xf69244[_0x9202('0x18')](_0x4d7248);}return _0xf69244[_0x9202('0x19')](_0x4d7248)[_0x9202('0x1a')]();};}function respondWithResult(_0x5d8ff2,_0x35e60e){_0x35e60e=_0x35e60e||0xc8;return function(_0x25dcd0){if(_0x25dcd0){return _0x5d8ff2[_0x9202('0x19')](_0x35e60e)[_0x9202('0x1b')](_0x25dcd0);}};}function respondWithFilteredResult(_0x346a65,_0x16a7f1){return function(_0x40af6c){if(_0x40af6c){var _0xc079f2=_0x40af6c[_0x9202('0x1c')],_0x4fba8e=_0x16a7f1[_0x9202('0x1d')],_0xcb88a2=_0x16a7f1[_0x9202('0x1d')]+_0x16a7f1[_0x9202('0x1e')],_0x298849;if(_0xcb88a2>=_0xc079f2){_0xcb88a2=_0xc079f2;_0x298849=0xc8;}else{_0x298849=0xce;}_0x346a65[_0x9202('0x19')](_0x298849);return _0x346a65[_0x9202('0x1f')](_0x9202('0x20'),_0x4fba8e+'-'+_0xcb88a2+'/'+_0xc079f2)['json'](_0x40af6c);}return null;};}function patchUpdates(_0x514d47){return function(_0x2c8856){try{jsonpatch[_0x9202('0x21')](_0x2c8856,_0x514d47,!![]);}catch(_0x40d8a5){return BPromise['reject'](_0x40d8a5);}return _0x2c8856[_0x9202('0x22')]();};}function saveUpdates(_0x45ef65,_0x23f803){return function(_0x720bac){if(_0x720bac){return _0x720bac[_0x9202('0x23')](_0x45ef65)[_0x9202('0x24')](function(_0x2fb4b9){return _0x2fb4b9;});}return null;};}function removeEntity(_0x392277,_0x3ff154){return function(_0x4f91e1){if(_0x4f91e1){return _0x4f91e1[_0x9202('0x25')]()[_0x9202('0x24')](function(){var _0x3510ab=_0x4f91e1[_0x9202('0x26')]({'plain':!![]});var _0x241760='Voicemails';return db[_0x9202('0x27')][_0x9202('0x25')]({'where':{'type':_0x241760,'resourceId':_0x3510ab['id']}})['then'](function(){return _0x4f91e1;});})[_0x9202('0x24')](function(){_0x392277[_0x9202('0x19')](0xcc)[_0x9202('0x1a')]();});}};}function handleEntityNotFound(_0x12f430,_0x13088e){return function(_0x37bac6){if(!_0x37bac6){_0x12f430[_0x9202('0x18')](0x194);}return _0x37bac6;};}function handleError(_0x24206a,_0x224d79){_0x224d79=_0x224d79||0x1f4;return function(_0x1659fa){logger[_0x9202('0x28')](_0x1659fa[_0x9202('0x29')]);if(_0x1659fa[_0x9202('0x2a')]){delete _0x1659fa[_0x9202('0x2a')];}_0x24206a[_0x9202('0x19')](_0x224d79)[_0x9202('0x2b')](_0x1659fa);};}exports[_0x9202('0x2c')]=function(_0x5e2eb9,_0x59b1eb){var _0x5aa9e2={},_0x347044={},_0x4794c0={'count':0x0,'rows':[]};var _0x29f669=_[_0x9202('0x2d')](db[_0x9202('0x2e')][_0x9202('0x2f')],function(_0x1237ec){return{'name':_0x1237ec[_0x9202('0x30')],'type':_0x1237ec[_0x9202('0x31')][_0x9202('0x32')]};});_0x347044[_0x9202('0x33')]=_[_0x9202('0x2d')](_0x29f669,_0x9202('0x2a'));_0x347044[_0x9202('0x34')]=_[_0x9202('0x35')](_0x5e2eb9[_0x9202('0x34')]);_0x347044[_0x9202('0x36')]=_[_0x9202('0x37')](_0x347044[_0x9202('0x33')],_0x347044[_0x9202('0x34')]);_0x5aa9e2[_0x9202('0x38')]=_[_0x9202('0x37')](_0x347044[_0x9202('0x33')],qs[_0x9202('0x39')](_0x5e2eb9[_0x9202('0x34')][_0x9202('0x39')]));_0x5aa9e2[_0x9202('0x38')]=_0x5aa9e2['attributes'][_0x9202('0x3a')]?_0x5aa9e2[_0x9202('0x38')]:_0x347044['model'];if(!_0x5e2eb9[_0x9202('0x34')][_0x9202('0x3b')]('nolimit')){_0x5aa9e2[_0x9202('0x1e')]=qs['limit'](_0x5e2eb9[_0x9202('0x34')][_0x9202('0x1e')]);_0x5aa9e2['offset']=qs['offset'](_0x5e2eb9['query']['offset']);}_0x5aa9e2[_0x9202('0x3c')]=qs[_0x9202('0x3d')](_0x5e2eb9[_0x9202('0x34')][_0x9202('0x3d')]);_0x5aa9e2['where']=qs[_0x9202('0x36')](_[_0x9202('0x3e')](_0x5e2eb9[_0x9202('0x34')],_0x347044[_0x9202('0x36')]),_0x29f669);if(_0x5e2eb9[_0x9202('0x34')][_0x9202('0x3f')]){_0x5aa9e2['where']=_['merge'](_0x5aa9e2['where'],{'$or':_['map'](_0x29f669,function(_0x43a525){if(_0x43a525['type']!==_0x9202('0x40')){var _0x2d982b={};_0x2d982b[_0x43a525[_0x9202('0x2a')]]={'$like':'%'+_0x5e2eb9[_0x9202('0x34')][_0x9202('0x3f')]+'%'};return _0x2d982b;}})});}_0x5aa9e2=_['merge']({},_0x5aa9e2,_0x5e2eb9[_0x9202('0x41')]);var _0x245025={'where':_0x5aa9e2[_0x9202('0x42')]};return db['VoiceMail']['count'](_0x245025)['then'](function(_0x3d61c4){_0x4794c0[_0x9202('0x1c')]=_0x3d61c4;if(_0x5e2eb9[_0x9202('0x34')][_0x9202('0x43')]){_0x5aa9e2['include']=[{'all':!![]}];}return db[_0x9202('0x2e')][_0x9202('0x44')](_0x5aa9e2);})[_0x9202('0x24')](function(_0x382391){_0x4794c0[_0x9202('0x45')]=_0x382391;return _0x4794c0;})[_0x9202('0x24')](respondWithFilteredResult(_0x59b1eb,_0x5aa9e2))[_0x9202('0x46')](handleError(_0x59b1eb,null));};exports[_0x9202('0x47')]=function(_0x4128cd,_0x5bd21b){var _0x59fe7d={'raw':!![],'where':{'id':_0x4128cd[_0x9202('0x48')]['id']}},_0x125450={};_0x125450['model']=_[_0x9202('0x35')](db['VoiceMail'][_0x9202('0x2f')]);_0x125450[_0x9202('0x34')]=_['keys'](_0x4128cd[_0x9202('0x34')]);_0x125450['filters']=_[_0x9202('0x37')](_0x125450[_0x9202('0x33')],_0x125450[_0x9202('0x34')]);_0x59fe7d[_0x9202('0x38')]=_['intersection'](_0x125450[_0x9202('0x33')],qs[_0x9202('0x39')](_0x4128cd[_0x9202('0x34')][_0x9202('0x39')]));_0x59fe7d[_0x9202('0x38')]=_0x59fe7d[_0x9202('0x38')][_0x9202('0x3a')]?_0x59fe7d[_0x9202('0x38')]:_0x125450[_0x9202('0x33')];if(_0x4128cd[_0x9202('0x34')][_0x9202('0x43')]){_0x59fe7d['include']=[{'all':!![]}];}_0x59fe7d=_[_0x9202('0x49')]({},_0x59fe7d,_0x4128cd['options']);return db[_0x9202('0x2e')][_0x9202('0x4a')](_0x59fe7d)[_0x9202('0x24')](handleEntityNotFound(_0x5bd21b,null))[_0x9202('0x24')](respondWithResult(_0x5bd21b,null))['catch'](handleError(_0x5bd21b,null));};exports['create']=function(_0x522057,_0x182c1b){return db[_0x9202('0x2e')][_0x9202('0x4b')](_0x522057[_0x9202('0x4c')],{})['then'](function(_0x49446f){var _0x5ec3fb=_0x522057[_0x9202('0x4d')]['get']({'plain':!![]});if(!_0x5ec3fb)throw new Error(_0x9202('0x4e'));if(_0x5ec3fb[_0x9202('0x4f')]===_0x9202('0x4d')){var _0x5c9d66=_0x49446f[_0x9202('0x26')]({'plain':!![]});var _0x636fe7=_0x9202('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x636fe7,'userProfileId':_0x5ec3fb[_0x9202('0x51')]},'raw':!![]})['then'](function(_0x5012f2){if(_0x5012f2&&_0x5012f2[_0x9202('0x52')]===0x0){return db[_0x9202('0x27')]['create']({'name':_0x5c9d66['name'],'resourceId':_0x5c9d66['id'],'type':_0x5012f2[_0x9202('0x2a')],'sectionId':_0x5012f2['id']},{})[_0x9202('0x24')](function(){return _0x49446f;});}else{return _0x49446f;}})[_0x9202('0x46')](function(_0x156127){logger[_0x9202('0x28')](_0x9202('0x53'),_0x156127);throw _0x156127;});}return _0x49446f;})[_0x9202('0x24')](respondWithResult(_0x182c1b,0xc9))[_0x9202('0x46')](handleError(_0x182c1b,null));};exports[_0x9202('0x23')]=function(_0x4ec315,_0x53f2a8){if(_0x4ec315[_0x9202('0x4c')]['id']){delete _0x4ec315['body']['id'];}return db[_0x9202('0x2e')][_0x9202('0x4a')]({'where':{'id':_0x4ec315[_0x9202('0x48')]['id']}})[_0x9202('0x24')](handleEntityNotFound(_0x53f2a8,null))[_0x9202('0x24')](saveUpdates(_0x4ec315[_0x9202('0x4c')],null))['then'](respondWithResult(_0x53f2a8,null))[_0x9202('0x46')](handleError(_0x53f2a8,null));};exports[_0x9202('0x25')]=function(_0x29cdd7,_0x5e58ae){return db[_0x9202('0x2e')][_0x9202('0x4a')]({'where':{'id':_0x29cdd7[_0x9202('0x48')]['id']}})[_0x9202('0x24')](handleEntityNotFound(_0x5e58ae,null))['then'](removeEntity(_0x5e58ae,null))[_0x9202('0x46')](handleError(_0x5e58ae,null));};exports['getMessages']=function(_0x5e37c1,_0x47db50,_0x27ab3d){return db['VoiceMail'][_0x9202('0x54')]({'where':{'id':_0x5e37c1[_0x9202('0x48')]['id']}})[_0x9202('0x24')](handleEntityNotFound(_0x47db50,null))[_0x9202('0x24')](function(_0x1353e4){var _0x3a4ded;var _0x26e1cb={},_0x493163={};_0x493163[_0x9202('0x33')]=_[_0x9202('0x35')](db['VoiceMailMessage'][_0x9202('0x2f')]);_0x493163[_0x9202('0x34')]=_['keys'](_0x5e37c1[_0x9202('0x34')]);_0x493163[_0x9202('0x36')]=_[_0x9202('0x37')](_0x493163[_0x9202('0x33')],_0x493163['query']);_0x26e1cb['attributes']=_['intersection'](_0x493163[_0x9202('0x33')],qs[_0x9202('0x39')](_0x5e37c1['query']['fields']));_0x26e1cb[_0x9202('0x38')]=_0x26e1cb[_0x9202('0x38')]['length']?_0x26e1cb[_0x9202('0x38')]:_0x493163[_0x9202('0x33')];if(!_0x5e37c1[_0x9202('0x34')]['hasOwnProperty'](_0x9202('0x55'))){_0x26e1cb['limit']=qs[_0x9202('0x1e')](_0x5e37c1[_0x9202('0x34')][_0x9202('0x1e')]);_0x26e1cb[_0x9202('0x1d')]=qs['offset'](_0x5e37c1['query'][_0x9202('0x1d')]);}_0x26e1cb[_0x9202('0x3c')]=qs[_0x9202('0x3d')](_0x5e37c1[_0x9202('0x34')][_0x9202('0x3d')]);_0x26e1cb[_0x9202('0x42')]=qs['filters'](_[_0x9202('0x3e')](_0x5e37c1[_0x9202('0x34')],_0x493163['filters']));if(_0x5e37c1[_0x9202('0x34')][_0x9202('0x3f')]){_0x26e1cb[_0x9202('0x42')]=_['merge'](_0x26e1cb[_0x9202('0x42')],{'$or':_[_0x9202('0x2d')](_0x26e1cb[_0x9202('0x38')],function(_0xf588b6){var _0x308960={};_0x308960[_0xf588b6]={'$like':'%'+_0x5e37c1[_0x9202('0x34')][_0x9202('0x3f')]+'%'};return _0x308960;})});}_0x26e1cb['where']=_[_0x9202('0x49')](_0x26e1cb[_0x9202('0x42')],{'mailboxuser':_0x1353e4[_0x9202('0x56')]});_0x26e1cb=_[_0x9202('0x49')]({},_0x26e1cb,_0x5e37c1[_0x9202('0x41')]);return db[_0x9202('0x57')][_0x9202('0x58')](_0x26e1cb)['then'](respondWithFilteredResult(_0x47db50,_0x26e1cb));})[_0x9202('0x46')](handleError(_0x47db50,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f6152b0..b22bd35 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 _0x2b84=['util','api','moment','bluebird','path','../../config/environment','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash'];(function(_0x5d3a02,_0x26b9dc){var _0x121210=function(_0x31674a){while(--_0x31674a){_0x5d3a02['push'](_0x5d3a02['shift']());}};_0x121210(++_0x26b9dc);}(_0x2b84,0x1ed));var _0x42b8=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x2b84[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x42b8('0x0'));var util=require(_0x42b8('0x1'));var logger=require('../../config/logger')(_0x42b8('0x2'));var moment=require(_0x42b8('0x3'));var BPromise=require(_0x42b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42b8('0x5'));var rimraf=require('rimraf');var config=require(_0x42b8('0x6'));var attributes=require('./voiceMail.attributes');module[_0x42b8('0x7')]=function(_0xb151dc,_0x4d0fe0){return _0xb151dc['define'](_0x42b8('0x8'),attributes,{'tableName':_0x42b8('0x9'),'paranoid':![],'indexes':[{'name':_0x42b8('0xa'),'fields':[_0x42b8('0xb'),_0x42b8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa923=['util','api','moment','request-promise','rimraf','../../config/environment','exports','define','voice_voicemail','mailbox','context','lodash'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0xa923,0xcb));var _0x3a92=function(_0x1980ac,_0x1217da){_0x1980ac=_0x1980ac-0x0;var _0x314baf=_0xa923[_0x1980ac];return _0x314baf;};'use strict';var _=require(_0x3a92('0x0'));var util=require(_0x3a92('0x1'));var logger=require('../../config/logger')(_0x3a92('0x2'));var moment=require(_0x3a92('0x3'));var BPromise=require('bluebird');var rp=require(_0x3a92('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a92('0x5'));var config=require(_0x3a92('0x6'));var attributes=require('./voiceMail.attributes');module[_0x3a92('0x7')]=function(_0x1db71b,_0xc76af2){return _0x1db71b[_0x3a92('0x8')]('VoiceMail',attributes,{'tableName':_0x3a92('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x3a92('0xa'),_0x3a92('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 2e42994..e7b0b86 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 _0x5dfc=['jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x437808,_0x5d54e4){var _0x3752ac=function(_0x366aeb){while(--_0x366aeb){_0x437808['push'](_0x437808['shift']());}};_0x3752ac(++_0x5d54e4);}(_0x5dfc,0x1c4));var _0xc5df=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x5dfc[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0xc5df('0x0'));var util=require('util');var moment=require(_0xc5df('0x1'));var BPromise=require(_0xc5df('0x2'));var rs=require(_0xc5df('0x3'));var fs=require('fs');var Redis=require(_0xc5df('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc5df('0x5'))(_0xc5df('0x6'));var config=require(_0xc5df('0x7'));var jayson=require(_0xc5df('0x8'));var client=jayson[_0xc5df('0x9')][_0xc5df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x468cc8,_0x2519fb,_0x34e941){return new BPromise(function(_0x58fbb3,_0xdb7056){return client[_0xc5df('0xb')](_0x468cc8,_0x34e941)[_0xc5df('0xc')](function(_0x553e56){logger[_0xc5df('0xd')](_0xc5df('0xe'),_0x2519fb,_0xc5df('0xf'));logger[_0xc5df('0x10')](_0xc5df('0x11'),_0x2519fb,'request\x20sent',JSON['stringify'](_0x553e56));if(_0x553e56[_0xc5df('0x12')]){if(_0x553e56[_0xc5df('0x12')][_0xc5df('0x13')]===0x1f4){logger[_0xc5df('0x12')](_0xc5df('0xe'),_0x2519fb,_0x553e56['error'][_0xc5df('0x14')]);return _0xdb7056(_0x553e56[_0xc5df('0x12')][_0xc5df('0x14')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x2519fb,_0x553e56['error'][_0xc5df('0x14')]);return _0x58fbb3(_0x553e56[_0xc5df('0x12')][_0xc5df('0x14')]);}else{logger[_0xc5df('0xd')](_0xc5df('0xe'),_0x2519fb,_0xc5df('0xf'));_0x58fbb3(_0x553e56[_0xc5df('0x15')]['message']);}})[_0xc5df('0x16')](function(_0x556e47){logger[_0xc5df('0x12')](_0xc5df('0xe'),_0x2519fb,_0x556e47);_0xdb7056(_0x556e47);});});} \ No newline at end of file +var _0xbc05=['../../config/logger','../../config/environment','jayson/promise','request','info','VoiceMail,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x45123e,_0x3e734c){var _0x1b34d7=function(_0xb6d873){while(--_0xb6d873){_0x45123e['push'](_0x45123e['shift']());}};_0x1b34d7(++_0x3e734c);}(_0xbc05,0x11c));var _0x5bc0=function(_0x5470f3,_0x51e032){_0x5470f3=_0x5470f3-0x0;var _0x5343d8=_0xbc05[_0x5470f3];return _0x5343d8;};'use strict';var _=require(_0x5bc0('0x0'));var util=require(_0x5bc0('0x1'));var moment=require('moment');var BPromise=require(_0x5bc0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5bc0('0x3'))['db'];var utils=require(_0x5bc0('0x4'));var logger=require(_0x5bc0('0x5'))('rpc');var config=require(_0x5bc0('0x6'));var jayson=require(_0x5bc0('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c3984,_0x5dd4e7,_0x2d3912){return new BPromise(function(_0x3d7a66,_0x3ae1d9){return client[_0x5bc0('0x8')](_0x5c3984,_0x2d3912)['then'](function(_0x4c744b){logger[_0x5bc0('0x9')](_0x5bc0('0xa'),_0x5dd4e7,'request\x20sent');logger[_0x5bc0('0xb')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x5dd4e7,_0x5bc0('0xc'),JSON['stringify'](_0x4c744b));if(_0x4c744b['error']){if(_0x4c744b[_0x5bc0('0xd')][_0x5bc0('0xe')]===0x1f4){logger['error'](_0x5bc0('0xa'),_0x5dd4e7,_0x4c744b[_0x5bc0('0xd')][_0x5bc0('0xf')]);return _0x3ae1d9(_0x4c744b['error']['message']);}logger[_0x5bc0('0xd')]('VoiceMail,\x20%s,\x20%s',_0x5dd4e7,_0x4c744b[_0x5bc0('0xd')][_0x5bc0('0xf')]);return _0x3d7a66(_0x4c744b[_0x5bc0('0xd')][_0x5bc0('0xf')]);}else{logger['info'](_0x5bc0('0xa'),_0x5dd4e7,_0x5bc0('0xc'));_0x3d7a66(_0x4c744b[_0x5bc0('0x10')][_0x5bc0('0xf')]);}})['catch'](function(_0x289879){logger[_0x5bc0('0xd')]('VoiceMail,\x20%s,\x20%s',_0x5dd4e7,_0x289879);_0x3ae1d9(_0x289879);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index afdaedb..535a4c7 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 _0xda16=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','get','/:id/download','download','post','create','put','update','delete','destroy','multer','util'];(function(_0x5bfbda,_0x2e8cd9){var _0x3fa109=function(_0x5075e2){while(--_0x5075e2){_0x5bfbda['push'](_0x5bfbda['shift']());}};_0x3fa109(++_0x2e8cd9);}(_0xda16,0x1e1));var _0x6da1=function(_0x1c9263,_0x162625){_0x1c9263=_0x1c9263-0x0;var _0x4b7bec=_0xda16[_0x1c9263];return _0x4b7bec;};'use strict';var multer=require(_0x6da1('0x0'));var util=require(_0x6da1('0x1'));var path=require('path');var timeout=require(_0x6da1('0x2'));var express=require(_0x6da1('0x3'));var router=express[_0x6da1('0x4')]();var fs_extra=require(_0x6da1('0x5'));var auth=require(_0x6da1('0x6'));var interaction=require(_0x6da1('0x7'));var config=require(_0x6da1('0x8'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6da1('0x9'),auth[_0x6da1('0xa')](),controller[_0x6da1('0xb')]);router[_0x6da1('0xc')](_0x6da1('0xd'),auth[_0x6da1('0xa')](),controller[_0x6da1('0xe')]);router[_0x6da1('0xf')]('/',auth[_0x6da1('0xa')](),controller[_0x6da1('0x10')]);router[_0x6da1('0x11')](_0x6da1('0x9'),auth[_0x6da1('0xa')](),controller[_0x6da1('0x12')]);router[_0x6da1('0x13')](_0x6da1('0x9'),auth[_0x6da1('0xa')](),controller[_0x6da1('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc46f=['destroy','exports','multer','path','Router','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','get','/:id','show','/:id/download','download','post','isAuthenticated','create','put','update'];(function(_0x114b63,_0x416c40){var _0x349d70=function(_0x2dfe93){while(--_0x2dfe93){_0x114b63['push'](_0x114b63['shift']());}};_0x349d70(++_0x416c40);}(_0xc46f,0x158));var _0xfc46=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc46f[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xfc46('0x0'));var util=require('util');var path=require(_0xfc46('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfc46('0x2')]();var fs_extra=require(_0xfc46('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfc46('0x4'));var config=require('../../config/environment');var controller=require(_0xfc46('0x5'));router[_0xfc46('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xfc46('0x7'),auth['isAuthenticated'](),controller[_0xfc46('0x8')]);router['get'](_0xfc46('0x9'),auth['isAuthenticated'](),controller[_0xfc46('0xa')]);router[_0xfc46('0xb')]('/',auth[_0xfc46('0xc')](),controller[_0xfc46('0xd')]);router[_0xfc46('0xe')](_0xfc46('0x7'),auth[_0xfc46('0xc')](),controller[_0xfc46('0xf')]);router['delete'](_0xfc46('0x7'),auth['isAuthenticated'](),controller[_0xfc46('0x10')]);module[_0xfc46('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 1499249..45cfcc5 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 _0x033b=['INTEGER','STRING','BLOB','long','literal','sequelize','VIRTUAL'];(function(_0x3be5d9,_0x20c94d){var _0x3d19b0=function(_0x4f5976){while(--_0x4f5976){_0x3be5d9['push'](_0x3be5d9['shift']());}};_0x3d19b0(++_0x20c94d);}(_0x033b,0xe5));var _0xb033=function(_0x5784ca,_0x1e6f0a){_0x5784ca=_0x5784ca-0x0;var _0x6904a5=_0x033b[_0x5784ca];return _0x6904a5;};'use strict';var Sequelize=require(_0xb033('0x0'));module['exports']={'name':{'type':Sequelize[_0xb033('0x1')],'get':function(_0x5a0d01){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xb033('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xb033('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb033('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb033('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xb033('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb033('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xb033('0x4')](_0xb033('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xb033('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xb033('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x072d=['STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','getDataValue'];(function(_0x3e2f58,_0xff6a3f){var _0x5662f3=function(_0x2cf254){while(--_0x2cf254){_0x3e2f58['push'](_0x3e2f58['shift']());}};_0x5662f3(++_0xff6a3f);}(_0x072d,0x11f));var _0xd072=function(_0x47f276,_0x170ca1){_0x47f276=_0x47f276-0x0;var _0x132a21=_0x072d[_0x47f276];return _0x132a21;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x19a5f7){return this[_0xd072('0x0')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd072('0x1')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xd072('0x1')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd072('0x1')],'defaultValue':''},'duration':{'type':Sequelize[_0xd072('0x1')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd072('0x1')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd072('0x1')],'defaultValue':''},'recording':{'type':Sequelize[_0xd072('0x2')](_0xd072('0x3')),'defaultValue':null},'flag':{'type':Sequelize[_0xd072('0x1')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd072('0x1')],'defaultValue':''},'stamp':{'type':_0xd072('0x4'),'defaultValue':Sequelize['literal'](_0xd072('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index d548e20..322e1f6 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 _0xb465=['attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','recording','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','params','options','find','create','body','download','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found'];(function(_0x58839e,_0x548f95){var _0x318c7b=function(_0x465ab8){while(--_0x465ab8){_0x58839e['push'](_0x58839e['shift']());}};_0x318c7b(++_0x548f95);}(_0xb465,0xaf));var _0x5b46=function(_0x1cf705,_0x4b2948){_0x1cf705=_0x1cf705-0x0;var _0x4ce37d=_0xb465[_0x1cf705];return _0x4ce37d;};'use strict';var emlformat=require(_0x5b46('0x0'));var rimraf=require(_0x5b46('0x1'));var zipdir=require(_0x5b46('0x2'));var jsonpatch=require(_0x5b46('0x3'));var rp=require(_0x5b46('0x4'));var moment=require(_0x5b46('0x5'));var BPromise=require(_0x5b46('0x6'));var Mustache=require(_0x5b46('0x7'));var util=require(_0x5b46('0x8'));var path=require(_0x5b46('0x9'));var sox=require(_0x5b46('0xa'));var csv=require(_0x5b46('0xb'));var ejs=require(_0x5b46('0xc'));var fs=require('fs');var fs_extra=require(_0x5b46('0xd'));var _=require(_0x5b46('0xe'));var squel=require('squel');var crypto=require(_0x5b46('0xf'));var jsforce=require(_0x5b46('0x10'));var deskjs=require(_0x5b46('0x11'));var toCsv=require(_0x5b46('0xb'));var querystring=require(_0x5b46('0x12'));var Papa=require(_0x5b46('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5b46('0x14'));var hardwareService=require(_0x5b46('0x15'));var logger=require('../../config/logger')(_0x5b46('0x16'));var utils=require(_0x5b46('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5b46('0x18'));var db=require(_0x5b46('0x19'))['db'];function respondWithStatusCode(_0x337fbe,_0x1692f3){_0x1692f3=_0x1692f3||0xcc;return function(_0x7eb616){if(_0x7eb616){return _0x337fbe[_0x5b46('0x1a')](_0x1692f3);}return _0x337fbe[_0x5b46('0x1b')](_0x1692f3)[_0x5b46('0x1c')]();};}function respondWithResult(_0x454e8e,_0x24bf97){_0x24bf97=_0x24bf97||0xc8;return function(_0x1b1d66){if(_0x1b1d66){return _0x454e8e[_0x5b46('0x1b')](_0x24bf97)[_0x5b46('0x1d')](_0x1b1d66);}};}function respondWithFilteredResult(_0x4c4d83,_0x1f588c){return function(_0x14f2db){if(_0x14f2db){var _0x5a94b9=_0x14f2db[_0x5b46('0x1e')],_0x17e54c=_0x1f588c[_0x5b46('0x1f')],_0x3f2741=_0x1f588c['offset']+_0x1f588c[_0x5b46('0x20')],_0x377f9d;if(_0x3f2741>=_0x5a94b9){_0x3f2741=_0x5a94b9;_0x377f9d=0xc8;}else{_0x377f9d=0xce;}_0x4c4d83[_0x5b46('0x1b')](_0x377f9d);return _0x4c4d83[_0x5b46('0x21')](_0x5b46('0x22'),_0x17e54c+'-'+_0x3f2741+'/'+_0x5a94b9)[_0x5b46('0x1d')](_0x14f2db);}return null;};}function patchUpdates(_0x1a2ce3){return function(_0x1bf06c){try{jsonpatch[_0x5b46('0x23')](_0x1bf06c,_0x1a2ce3,!![]);}catch(_0x288c6b){return BPromise[_0x5b46('0x24')](_0x288c6b);}return _0x1bf06c['save']();};}function saveUpdates(_0x4fb171,_0xde773f){return function(_0x5dcc78){if(_0x5dcc78){return _0x5dcc78[_0x5b46('0x25')](_0x4fb171)[_0x5b46('0x26')](function(_0x4365a8){return _0x4365a8;});}return null;};}function removeEntity(_0x44c1d6,_0x16b3f1){return function(_0x393bf4){if(_0x393bf4){return _0x393bf4['destroy']()[_0x5b46('0x26')](function(){_0x44c1d6[_0x5b46('0x1b')](0xcc)[_0x5b46('0x1c')]();});}};}function handleEntityNotFound(_0x58ea14,_0x3e5c25){return function(_0x30144d){if(!_0x30144d){_0x58ea14['sendStatus'](0x194);}return _0x30144d;};}function handleError(_0x445710,_0x4294d7){_0x4294d7=_0x4294d7||0x1f4;return function(_0x5ecce2){logger['error'](_0x5ecce2[_0x5b46('0x27')]);if(_0x5ecce2[_0x5b46('0x28')]){delete _0x5ecce2[_0x5b46('0x28')];}_0x445710[_0x5b46('0x1b')](_0x4294d7)[_0x5b46('0x29')](_0x5ecce2);};}exports[_0x5b46('0x2a')]=function(_0x2a15c6,_0x3f0526){var _0x404ef0={},_0x15da79={},_0x35a47e={'count':0x0,'rows':[]};var _0x4f1aa9=_[_0x5b46('0x2b')](db[_0x5b46('0x2c')][_0x5b46('0x2d')],function(_0x3f1288){return{'name':_0x3f1288[_0x5b46('0x2e')],'type':_0x3f1288[_0x5b46('0x2f')][_0x5b46('0x30')]};});_0x15da79['model']=_[_0x5b46('0x31')](_['map'](_0x4f1aa9,_0x5b46('0x28')),['name']);_0x15da79[_0x5b46('0x32')]=_[_0x5b46('0x33')](_0x2a15c6['query']);_0x15da79[_0x5b46('0x34')]=_[_0x5b46('0x35')](_0x15da79[_0x5b46('0x36')],_0x15da79[_0x5b46('0x32')]);_0x404ef0[_0x5b46('0x37')]=_[_0x5b46('0x35')](_0x15da79[_0x5b46('0x36')],qs[_0x5b46('0x38')](_0x2a15c6['query']['fields']));_0x404ef0[_0x5b46('0x37')]=_0x404ef0[_0x5b46('0x37')][_0x5b46('0x39')]?_0x404ef0[_0x5b46('0x37')]:_0x15da79[_0x5b46('0x36')];if(!_0x2a15c6['query'][_0x5b46('0x3a')](_0x5b46('0x3b'))){_0x404ef0['limit']=qs[_0x5b46('0x20')](_0x2a15c6[_0x5b46('0x32')][_0x5b46('0x20')]);_0x404ef0['offset']=qs[_0x5b46('0x1f')](_0x2a15c6[_0x5b46('0x32')][_0x5b46('0x1f')]);}_0x404ef0[_0x5b46('0x3c')]=qs[_0x5b46('0x3d')](_0x2a15c6['query'][_0x5b46('0x3d')]);_0x404ef0[_0x5b46('0x3e')]=qs[_0x5b46('0x34')](_[_0x5b46('0x3f')](_0x2a15c6[_0x5b46('0x32')],_0x15da79[_0x5b46('0x34')]),_0x4f1aa9);if(_0x2a15c6['query'][_0x5b46('0x40')]){_0x404ef0[_0x5b46('0x3e')]=_[_0x5b46('0x41')](_0x404ef0[_0x5b46('0x3e')],{'$or':_['map'](_0x4f1aa9,function(_0x43861c){if(_0x43861c[_0x5b46('0x2f')]!==_0x5b46('0x42')){var _0x1242af={};_0x1242af[_0x43861c[_0x5b46('0x28')]]={'$like':'%'+_0x2a15c6[_0x5b46('0x32')][_0x5b46('0x40')]+'%'};return _0x1242af;}})});}_0x404ef0=_[_0x5b46('0x41')]({},_0x404ef0,_0x2a15c6['options']);var _0x5501ce={'where':_0x404ef0[_0x5b46('0x3e')]};return db['VoiceMailMessage'][_0x5b46('0x1e')](_0x5501ce)[_0x5b46('0x26')](function(_0x523c76){_0x35a47e['count']=_0x523c76;if(_0x2a15c6[_0x5b46('0x32')][_0x5b46('0x43')]){_0x404ef0[_0x5b46('0x44')]=[{'all':!![]}];}return db[_0x5b46('0x2c')]['findAll'](_0x404ef0);})[_0x5b46('0x26')](function(_0x57800a){_0x35a47e['rows']=_0x57800a;return _0x35a47e;})['then'](respondWithFilteredResult(_0x3f0526,_0x404ef0))[_0x5b46('0x45')](handleError(_0x3f0526,null));};exports['show']=function(_0x295c11,_0x111f7d){var _0x30d247={'raw':!![],'where':{'id':_0x295c11[_0x5b46('0x46')]['id']}},_0x46be1e={};_0x46be1e[_0x5b46('0x36')]=_[_0x5b46('0x33')](db[_0x5b46('0x2c')][_0x5b46('0x2d')]);_0x46be1e[_0x5b46('0x32')]=_['keys'](_0x295c11[_0x5b46('0x32')]);_0x46be1e[_0x5b46('0x34')]=_['intersection'](_0x46be1e['model'],_0x46be1e['query']);_0x30d247['attributes']=_[_0x5b46('0x35')](_0x46be1e['model'],qs['fields'](_0x295c11[_0x5b46('0x32')][_0x5b46('0x38')]));_0x30d247[_0x5b46('0x37')]=_0x30d247['attributes'][_0x5b46('0x39')]?_0x30d247['attributes']:_0x46be1e[_0x5b46('0x36')];if(_0x295c11['query'][_0x5b46('0x43')]){_0x30d247['include']=[{'all':!![]}];}_0x30d247=_['merge']({},_0x30d247,_0x295c11[_0x5b46('0x47')]);return db['VoiceMailMessage'][_0x5b46('0x48')](_0x30d247)['then'](handleEntityNotFound(_0x111f7d,null))[_0x5b46('0x26')](respondWithResult(_0x111f7d,null))[_0x5b46('0x45')](handleError(_0x111f7d,null));};exports[_0x5b46('0x49')]=function(_0x13bad6,_0x3c1393){return db['VoiceMailMessage'][_0x5b46('0x49')](_0x13bad6[_0x5b46('0x4a')],{})['then'](respondWithResult(_0x3c1393,0xc9))['catch'](handleError(_0x3c1393,null));};exports[_0x5b46('0x25')]=function(_0x2895d8,_0x50914a){if(_0x2895d8[_0x5b46('0x4a')]['id']){delete _0x2895d8[_0x5b46('0x4a')]['id'];}return db['VoiceMailMessage'][_0x5b46('0x48')]({'where':{'id':_0x2895d8['params']['id']}})['then'](handleEntityNotFound(_0x50914a,null))['then'](saveUpdates(_0x2895d8[_0x5b46('0x4a')],null))[_0x5b46('0x26')](respondWithResult(_0x50914a,null))[_0x5b46('0x45')](handleError(_0x50914a,null));};exports['destroy']=function(_0xbcd4cb,_0x3f9497){return db['VoiceMailMessage'][_0x5b46('0x48')]({'where':{'id':_0xbcd4cb['params']['id']}})[_0x5b46('0x26')](handleEntityNotFound(_0x3f9497,null))[_0x5b46('0x26')](removeEntity(_0x3f9497,null))[_0x5b46('0x45')](handleError(_0x3f9497,null));};exports[_0x5b46('0x4b')]=function(_0x307af3,_0x2c888a,_0xfc1e51){return db[_0x5b46('0x2c')]['find']({'where':{'id':_0x307af3[_0x5b46('0x46')]['id']},'attributes':['id','recording',_0x5b46('0x4c')]})[_0x5b46('0x26')](handleEntityNotFound(_0x2c888a,null))[_0x5b46('0x26')](function(_0x363098){if(_0x363098){if(!_0x363098['recording']){throw new db[(_0x5b46('0x4d'))][(_0x5b46('0x4e'))](_0x5b46('0x4f'));}var _0x47fb39={'Content-Type':'audio/wav','Content-Disposition':_0x5b46('0x50')};if(_0x363098['msg_id']){_0x47fb39[_0x5b46('0x51')]=_0x5b46('0x52')+_0x363098[_0x5b46('0x4c')]+_0x5b46('0x53');}_0x2c888a[_0x5b46('0x21')](_0x47fb39);return _0x2c888a[_0x5b46('0x29')](new Buffer(_0x363098[_0x5b46('0x54')]));}})[_0x5b46('0x45')](handleError(_0x2c888a,null));}; \ No newline at end of file +var _0x6e9e=['params','rawAttributes','keys','include','find','create','update','body','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','set','send','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','then','error','name','index','map','VoiceMailMessage','fieldName','type','key','model','differenceBy','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6e9e,0x10e));var _0xe6e9=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x6e9e[_0x3b711c];return _0x2685f0;};'use strict';var emlformat=require(_0xe6e9('0x0'));var rimraf=require(_0xe6e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe6e9('0x2'));var moment=require(_0xe6e9('0x3'));var BPromise=require(_0xe6e9('0x4'));var Mustache=require('mustache');var util=require(_0xe6e9('0x5'));var path=require(_0xe6e9('0x6'));var sox=require(_0xe6e9('0x7'));var csv=require(_0xe6e9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6e9('0x9'));var _=require(_0xe6e9('0xa'));var squel=require(_0xe6e9('0xb'));var crypto=require(_0xe6e9('0xc'));var jsforce=require(_0xe6e9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe6e9('0x8'));var querystring=require(_0xe6e9('0xe'));var Papa=require(_0xe6e9('0xf'));var Redis=require(_0xe6e9('0x10'));var authService=require(_0xe6e9('0x11'));var qs=require(_0xe6e9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6e9('0x13'));var logger=require(_0xe6e9('0x14'))(_0xe6e9('0x15'));var utils=require(_0xe6e9('0x16'));var config=require(_0xe6e9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6e9('0x18'))['db'];function respondWithStatusCode(_0x151e39,_0x55d220){_0x55d220=_0x55d220||0xcc;return function(_0xb805b2){if(_0xb805b2){return _0x151e39[_0xe6e9('0x19')](_0x55d220);}return _0x151e39[_0xe6e9('0x1a')](_0x55d220)[_0xe6e9('0x1b')]();};}function respondWithResult(_0x26f9fd,_0x33ddd2){_0x33ddd2=_0x33ddd2||0xc8;return function(_0x5b67e8){if(_0x5b67e8){return _0x26f9fd[_0xe6e9('0x1a')](_0x33ddd2)[_0xe6e9('0x1c')](_0x5b67e8);}};}function respondWithFilteredResult(_0x5a7228,_0xbbd1c0){return function(_0x3c985a){if(_0x3c985a){var _0x240529=_0x3c985a[_0xe6e9('0x1d')],_0x64ec4f=_0xbbd1c0[_0xe6e9('0x1e')],_0x376f70=_0xbbd1c0[_0xe6e9('0x1e')]+_0xbbd1c0[_0xe6e9('0x1f')],_0x24a8ea;if(_0x376f70>=_0x240529){_0x376f70=_0x240529;_0x24a8ea=0xc8;}else{_0x24a8ea=0xce;}_0x5a7228[_0xe6e9('0x1a')](_0x24a8ea);return _0x5a7228['set'](_0xe6e9('0x20'),_0x64ec4f+'-'+_0x376f70+'/'+_0x240529)[_0xe6e9('0x1c')](_0x3c985a);}return null;};}function patchUpdates(_0x564a87){return function(_0x3ec4f7){try{jsonpatch[_0xe6e9('0x21')](_0x3ec4f7,_0x564a87,!![]);}catch(_0x378a6c){return BPromise[_0xe6e9('0x22')](_0x378a6c);}return _0x3ec4f7['save']();};}function saveUpdates(_0x1b9e01,_0x45654a){return function(_0x3f69ab){if(_0x3f69ab){return _0x3f69ab['update'](_0x1b9e01)[_0xe6e9('0x23')](function(_0xc2fde9){return _0xc2fde9;});}return null;};}function removeEntity(_0x5c4d3c,_0x18f9a6){return function(_0x36d8c4){if(_0x36d8c4){return _0x36d8c4['destroy']()[_0xe6e9('0x23')](function(){_0x5c4d3c[_0xe6e9('0x1a')](0xcc)[_0xe6e9('0x1b')]();});}};}function handleEntityNotFound(_0x5cfd43,_0x2df6d5){return function(_0x23f844){if(!_0x23f844){_0x5cfd43['sendStatus'](0x194);}return _0x23f844;};}function handleError(_0x338a9d,_0xebded7){_0xebded7=_0xebded7||0x1f4;return function(_0xdd2b27){logger[_0xe6e9('0x24')](_0xdd2b27['stack']);if(_0xdd2b27['name']){delete _0xdd2b27[_0xe6e9('0x25')];}_0x338a9d[_0xe6e9('0x1a')](_0xebded7)['send'](_0xdd2b27);};}exports[_0xe6e9('0x26')]=function(_0x11e688,_0x3e0267){var _0x30b8f4={},_0x42c4bf={},_0xb29004={'count':0x0,'rows':[]};var _0x571489=_[_0xe6e9('0x27')](db[_0xe6e9('0x28')]['rawAttributes'],function(_0x13b73a){return{'name':_0x13b73a[_0xe6e9('0x29')],'type':_0x13b73a[_0xe6e9('0x2a')][_0xe6e9('0x2b')]};});_0x42c4bf[_0xe6e9('0x2c')]=_[_0xe6e9('0x2d')](_[_0xe6e9('0x27')](_0x571489,_0xe6e9('0x25')),[_0xe6e9('0x25')]);_0x42c4bf[_0xe6e9('0x2e')]=_['keys'](_0x11e688['query']);_0x42c4bf['filters']=_[_0xe6e9('0x2f')](_0x42c4bf[_0xe6e9('0x2c')],_0x42c4bf[_0xe6e9('0x2e')]);_0x30b8f4[_0xe6e9('0x30')]=_['intersection'](_0x42c4bf[_0xe6e9('0x2c')],qs[_0xe6e9('0x31')](_0x11e688['query']['fields']));_0x30b8f4[_0xe6e9('0x30')]=_0x30b8f4[_0xe6e9('0x30')][_0xe6e9('0x32')]?_0x30b8f4[_0xe6e9('0x30')]:_0x42c4bf['model'];if(!_0x11e688[_0xe6e9('0x2e')][_0xe6e9('0x33')](_0xe6e9('0x34'))){_0x30b8f4['limit']=qs[_0xe6e9('0x1f')](_0x11e688[_0xe6e9('0x2e')][_0xe6e9('0x1f')]);_0x30b8f4[_0xe6e9('0x1e')]=qs[_0xe6e9('0x1e')](_0x11e688['query'][_0xe6e9('0x1e')]);}_0x30b8f4[_0xe6e9('0x35')]=qs[_0xe6e9('0x36')](_0x11e688[_0xe6e9('0x2e')][_0xe6e9('0x36')]);_0x30b8f4[_0xe6e9('0x37')]=qs['filters'](_[_0xe6e9('0x38')](_0x11e688[_0xe6e9('0x2e')],_0x42c4bf['filters']),_0x571489);if(_0x11e688[_0xe6e9('0x2e')]['filter']){_0x30b8f4[_0xe6e9('0x37')]=_['merge'](_0x30b8f4[_0xe6e9('0x37')],{'$or':_[_0xe6e9('0x27')](_0x571489,function(_0xdc46a0){if(_0xdc46a0[_0xe6e9('0x2a')]!==_0xe6e9('0x39')){var _0x3f4545={};_0x3f4545[_0xdc46a0[_0xe6e9('0x25')]]={'$like':'%'+_0x11e688[_0xe6e9('0x2e')][_0xe6e9('0x3a')]+'%'};return _0x3f4545;}})});}_0x30b8f4=_[_0xe6e9('0x3b')]({},_0x30b8f4,_0x11e688[_0xe6e9('0x3c')]);var _0x36a01e={'where':_0x30b8f4[_0xe6e9('0x37')]};return db[_0xe6e9('0x28')][_0xe6e9('0x1d')](_0x36a01e)[_0xe6e9('0x23')](function(_0x1fc3b3){_0xb29004[_0xe6e9('0x1d')]=_0x1fc3b3;if(_0x11e688[_0xe6e9('0x2e')][_0xe6e9('0x3d')]){_0x30b8f4['include']=[{'all':!![]}];}return db[_0xe6e9('0x28')][_0xe6e9('0x3e')](_0x30b8f4);})[_0xe6e9('0x23')](function(_0x5642bc){_0xb29004[_0xe6e9('0x3f')]=_0x5642bc;return _0xb29004;})['then'](respondWithFilteredResult(_0x3e0267,_0x30b8f4))[_0xe6e9('0x40')](handleError(_0x3e0267,null));};exports[_0xe6e9('0x41')]=function(_0x4fa500,_0x28b329){var _0x3b7758={'raw':!![],'where':{'id':_0x4fa500[_0xe6e9('0x42')]['id']}},_0x2f661b={};_0x2f661b['model']=_['keys'](db[_0xe6e9('0x28')][_0xe6e9('0x43')]);_0x2f661b[_0xe6e9('0x2e')]=_[_0xe6e9('0x44')](_0x4fa500['query']);_0x2f661b['filters']=_[_0xe6e9('0x2f')](_0x2f661b[_0xe6e9('0x2c')],_0x2f661b[_0xe6e9('0x2e')]);_0x3b7758[_0xe6e9('0x30')]=_[_0xe6e9('0x2f')](_0x2f661b[_0xe6e9('0x2c')],qs[_0xe6e9('0x31')](_0x4fa500[_0xe6e9('0x2e')]['fields']));_0x3b7758['attributes']=_0x3b7758['attributes'][_0xe6e9('0x32')]?_0x3b7758[_0xe6e9('0x30')]:_0x2f661b[_0xe6e9('0x2c')];if(_0x4fa500[_0xe6e9('0x2e')][_0xe6e9('0x3d')]){_0x3b7758[_0xe6e9('0x45')]=[{'all':!![]}];}_0x3b7758=_[_0xe6e9('0x3b')]({},_0x3b7758,_0x4fa500[_0xe6e9('0x3c')]);return db[_0xe6e9('0x28')][_0xe6e9('0x46')](_0x3b7758)['then'](handleEntityNotFound(_0x28b329,null))[_0xe6e9('0x23')](respondWithResult(_0x28b329,null))[_0xe6e9('0x40')](handleError(_0x28b329,null));};exports[_0xe6e9('0x47')]=function(_0x37cde5,_0x616122){return db[_0xe6e9('0x28')][_0xe6e9('0x47')](_0x37cde5['body'],{})[_0xe6e9('0x23')](respondWithResult(_0x616122,0xc9))[_0xe6e9('0x40')](handleError(_0x616122,null));};exports[_0xe6e9('0x48')]=function(_0x118812,_0x424b5d){if(_0x118812[_0xe6e9('0x49')]['id']){delete _0x118812[_0xe6e9('0x49')]['id'];}return db[_0xe6e9('0x28')]['find']({'where':{'id':_0x118812[_0xe6e9('0x42')]['id']}})[_0xe6e9('0x23')](handleEntityNotFound(_0x424b5d,null))[_0xe6e9('0x23')](saveUpdates(_0x118812[_0xe6e9('0x49')],null))[_0xe6e9('0x23')](respondWithResult(_0x424b5d,null))[_0xe6e9('0x40')](handleError(_0x424b5d,null));};exports['destroy']=function(_0x3efc03,_0x376fe7){return db[_0xe6e9('0x28')][_0xe6e9('0x46')]({'where':{'id':_0x3efc03[_0xe6e9('0x42')]['id']}})[_0xe6e9('0x23')](handleEntityNotFound(_0x376fe7,null))['then'](removeEntity(_0x376fe7,null))[_0xe6e9('0x40')](handleError(_0x376fe7,null));};exports['download']=function(_0x2c440c,_0x54a113,_0xbb0224){return db[_0xe6e9('0x28')]['find']({'where':{'id':_0x2c440c[_0xe6e9('0x42')]['id']},'attributes':['id',_0xe6e9('0x4a'),_0xe6e9('0x4b')]})['then'](handleEntityNotFound(_0x54a113,null))[_0xe6e9('0x23')](function(_0x263e95){if(_0x263e95){if(!_0x263e95[_0xe6e9('0x4a')]){throw new db['Sequelize'][(_0xe6e9('0x4c'))](_0xe6e9('0x4d'));}var _0x3cdd64={'Content-Type':_0xe6e9('0x4e'),'Content-Disposition':_0xe6e9('0x4f')};if(_0x263e95[_0xe6e9('0x4b')]){_0x3cdd64[_0xe6e9('0x50')]='attachment;\x20filename=\x22'+_0x263e95[_0xe6e9('0x4b')]+_0xe6e9('0x51');}_0x54a113[_0xe6e9('0x52')](_0x3cdd64);return _0x54a113[_0xe6e9('0x53')](new Buffer(_0x263e95[_0xe6e9('0x4a')]));}})[_0xe6e9('0x40')](handleError(_0x54a113,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index c868881..6401550 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 _0x57c6=['../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','moment','request-promise','path'];(function(_0x2dbde5,_0x1c1df9){var _0x460803=function(_0x5067ec){while(--_0x5067ec){_0x2dbde5['push'](_0x2dbde5['shift']());}};_0x460803(++_0x1c1df9);}(_0x57c6,0xa3));var _0x657c=function(_0x23288c,_0x7bcfcd){_0x23288c=_0x23288c-0x0;var _0x1305a6=_0x57c6[_0x23288c];return _0x1305a6;};'use strict';var _=require(_0x657c('0x0'));var util=require(_0x657c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x657c('0x2'));var BPromise=require('bluebird');var rp=require(_0x657c('0x3'));var fs=require('fs');var path=require(_0x657c('0x4'));var rimraf=require('rimraf');var config=require(_0x657c('0x5'));var attributes=require(_0x657c('0x6'));module[_0x657c('0x7')]=function(_0x11d062,_0x36f7a2){return _0x11d062[_0x657c('0x8')](_0x657c('0x9'),attributes,{'tableName':_0x657c('0xa'),'paranoid':![],'indexes':[{'name':_0x657c('0xb'),'fields':[_0x657c('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9039=['lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x5c96eb,_0x5404da){var _0x4ddbad=function(_0x5a1225){while(--_0x5a1225){_0x5c96eb['push'](_0x5c96eb['shift']());}};_0x4ddbad(++_0x5404da);}(_0x9039,0x68));var _0x9903=function(_0x498396,_0x395c9a){_0x498396=_0x498396-0x0;var _0x1b0fbd=_0x9039[_0x498396];return _0x1b0fbd;};'use strict';var _=require(_0x9903('0x0'));var util=require('util');var logger=require(_0x9903('0x1'))(_0x9903('0x2'));var moment=require(_0x9903('0x3'));var BPromise=require(_0x9903('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9903('0x5'));var rimraf=require('rimraf');var config=require(_0x9903('0x6'));var attributes=require(_0x9903('0x7'));module[_0x9903('0x8')]=function(_0x8d8b69,_0x407f45){return _0x8d8b69[_0x9903('0x9')](_0x9903('0xa'),attributes,{'tableName':_0x9903('0xb'),'paranoid':![],'indexes':[{'name':_0x9903('0xc'),'fields':[_0x9903('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 7064f59..9148efa 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 _0x57ca=['client','http','request','info','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x6fb7b4,_0x4f0b9f){var _0x3cb233=function(_0x5e0aee){while(--_0x5e0aee){_0x6fb7b4['push'](_0x6fb7b4['shift']());}};_0x3cb233(++_0x4f0b9f);}(_0x57ca,0x108));var _0xa57c=function(_0x382a49,_0x62522d){_0x382a49=_0x382a49-0x0;var _0x2fc40b=_0x57ca[_0x382a49];return _0x2fc40b;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch','lodash'];(function(_0x93cf30,_0x487a90){var _0x1baa06=function(_0x4bec59){while(--_0x4bec59){_0x93cf30['push'](_0x93cf30['shift']());}};_0x1baa06(++_0x487a90);}(_0x66fa,0x117));var _0xa66f=function(_0x11bd8c,_0x51e776){_0x11bd8c=_0x11bd8c-0x0;var _0x5e5ff0=_0x66fa[_0x11bd8c];return _0x5e5ff0;};'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')]('VoiceMailMessage,\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')]('VoiceMailMessage,\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 diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 6e5253e..21492a0 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 _0x1536=['removeSound','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','getSounds','create','addSound','delete','/:id/sounds/:id2'];(function(_0x45c222,_0x5d2129){var _0x43fd25=function(_0x2da3fc){while(--_0x2da3fc){_0x45c222['push'](_0x45c222['shift']());}};_0x43fd25(++_0x5d2129);}(_0x1536,0x1bb));var _0x6153=function(_0x35b014,_0x34a75c){_0x35b014=_0x35b014-0x0;var _0x13eb9a=_0x1536[_0x35b014];return _0x13eb9a;};'use strict';var multer=require(_0x6153('0x0'));var util=require('util');var path=require(_0x6153('0x1'));var timeout=require(_0x6153('0x2'));var express=require('express');var router=express[_0x6153('0x3')]();var fs_extra=require(_0x6153('0x4'));var auth=require(_0x6153('0x5'));var interaction=require(_0x6153('0x6'));var config=require(_0x6153('0x7'));var controller=require(_0x6153('0x8'));router[_0x6153('0x9')]('/',auth[_0x6153('0xa')](),controller['index']);router[_0x6153('0x9')](_0x6153('0xb'),auth[_0x6153('0xa')](),controller[_0x6153('0xc')]);router[_0x6153('0x9')](_0x6153('0xd'),auth[_0x6153('0xa')](),controller[_0x6153('0xe')]);router['post']('/',auth[_0x6153('0xa')](),controller[_0x6153('0xf')]);router['post'](_0x6153('0xd'),auth[_0x6153('0xa')](),controller[_0x6153('0x10')]);router['put']('/:id',auth[_0x6153('0xa')](),controller['update']);router[_0x6153('0x11')](_0x6153('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x6153('0x11')](_0x6153('0x12'),auth[_0x6153('0xa')](),controller[_0x6153('0x13')]);module[_0x6153('0x14')]=router; \ No newline at end of file +var _0x4822=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','util'];(function(_0x7b41ca,_0x140d09){var _0x2ca93a=function(_0x2bb227){while(--_0x2bb227){_0x7b41ca['push'](_0x7b41ca['shift']());}};_0x2ca93a(++_0x140d09);}(_0x4822,0x12a));var _0x2482=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4822[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0x2482('0x0'));var path=require('path');var timeout=require(_0x2482('0x1'));var express=require(_0x2482('0x2'));var router=express[_0x2482('0x3')]();var fs_extra=require(_0x2482('0x4'));var auth=require(_0x2482('0x5'));var interaction=require(_0x2482('0x6'));var config=require(_0x2482('0x7'));var controller=require(_0x2482('0x8'));router[_0x2482('0x9')]('/',auth[_0x2482('0xa')](),controller['index']);router[_0x2482('0x9')](_0x2482('0xb'),auth['isAuthenticated'](),controller[_0x2482('0xc')]);router[_0x2482('0x9')](_0x2482('0xd'),auth[_0x2482('0xa')](),controller['getSounds']);router['post']('/',auth[_0x2482('0xa')](),controller[_0x2482('0xe')]);router['post'](_0x2482('0xd'),auth[_0x2482('0xa')](),controller[_0x2482('0xf')]);router[_0x2482('0x10')](_0x2482('0xb'),auth[_0x2482('0xa')](),controller[_0x2482('0x11')]);router[_0x2482('0x12')](_0x2482('0xb'),auth['isAuthenticated'](),controller[_0x2482('0x13')]);router['delete'](_0x2482('0x14'),auth[_0x2482('0xa')](),controller[_0x2482('0x15')]);module[_0x2482('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c485840..7cd4fe9 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 _0xd8a2=['custom','mp3nb','quietmp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0xd8a2,0x14b));var _0x2d8a=function(_0x1fc4bc,_0x5cfa14){_0x1fc4bc=_0x1fc4bc-0x0;var _0x52b186=_0xd8a2[_0x1fc4bc];return _0x52b186;};'use strict';var Sequelize=require(_0x2d8a('0x0'));module[_0x2d8a('0x1')]={'name':{'type':Sequelize[_0x2d8a('0x2')],'allowNull':![],'unique':_0x2d8a('0x3')},'mode':{'type':Sequelize[_0x2d8a('0x4')](_0x2d8a('0x5'),'files',_0x2d8a('0x6'),_0x2d8a('0x7'),_0x2d8a('0x8'),_0x2d8a('0x9')),'allowNull':!![],'defaultValue':_0x2d8a('0xa')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x2d8a('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2d8a('0xb')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x2d8a('0xc')},'defaultEntry':{'type':Sequelize[_0x2d8a('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0x547f=['TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x547f,0x195));var _0xf547=function(_0x1f05ba,_0x5b002a){_0x1f05ba=_0x1f05ba-0x0;var _0x4220c5=_0x547f[_0x1f05ba];return _0x4220c5;};'use strict';var Sequelize=require(_0xf547('0x0'));module[_0xf547('0x1')]={'name':{'type':Sequelize[_0xf547('0x2')],'allowNull':![],'unique':_0xf547('0x3')},'mode':{'type':Sequelize['ENUM'](_0xf547('0x4'),_0xf547('0x5'),_0xf547('0x6'),_0xf547('0x7'),_0xf547('0x8'),_0xf547('0x9')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xf547('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xf547('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xf547('0x2')],'allowNull':!![],'defaultValue':_0xf547('0xa')},'format':{'type':Sequelize[_0xf547('0x2')],'allowNull':!![]},'stamp':{'type':_0xf547('0xb')},'defaultEntry':{'type':Sequelize[_0xf547('0xc')],'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 ea445f9..a042395 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 _0xa9e0=['json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','MusicOnHolds','UserProfileResource','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','body','find','create','sequelize','directory','join','root','server/files/moh','mode','files','0777','get','role','UserProfileSection','userProfileId','autoAssociation','transaction','readdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','removeSound','id2','getSounds','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'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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=_0x5d0880['count'],_0x519dfd=_0x22dccb[_0x0a9e('0x19')],_0x16033c=_0x22dccb['offset']+_0x22dccb[_0x0a9e('0x1a')],_0x12066b;if(_0x16033c>=_0x1985b6){_0x16033c=_0x1985b6;_0x12066b=0xc8;}else{_0x12066b=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x12066b);return _0x52a03d[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x519dfd+'-'+_0x16033c+'/'+_0x1985b6)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x2eb11f){return function(_0x530eb7){try{jsonpatch[_0x0a9e('0x1d')](_0x530eb7,_0x2eb11f,!![]);}catch(_0x1314ae){return BPromise[_0x0a9e('0x1e')](_0x1314ae);}return _0x530eb7[_0x0a9e('0x1f')]();};}function saveUpdates(_0x105080,_0x4bb1e3){return function(_0x2c3407){if(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')](_0x105080)['then'](function(_0x20f109){return _0x20f109;});}return null;};}function removeEntity(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){var _0x30bae6=_0x3a02e1['get']({'plain':!![]});var _0xfb6e48=_0x0a9e('0x23');return db[_0x0a9e('0x24')][_0x0a9e('0x21')]({'where':{'type':_0xfb6e48,'resourceId':_0x30bae6['id']}})[_0x0a9e('0x22')](function(){return _0x3a02e1;});})[_0x0a9e('0x22')](function(){_0x5a09ef[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x15')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x25')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x26')];}_0x33161b[_0x0a9e('0x17')](_0x526cf3)[_0x0a9e('0x27')](_0x384319);};}exports[_0x0a9e('0x28')]=function(_0x140511,_0x1538a4){var _0x11c3b6={},_0x14de77={},_0x5a101a={'count':0x0,'rows':[]};var _0x3652a7=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x2c')],'type':_0x5c877d[_0x0a9e('0x2d')][_0x0a9e('0x2e')]};});_0x14de77[_0x0a9e('0x2f')]=_[_0x0a9e('0x29')](_0x3652a7,_0x0a9e('0x26'));_0x14de77[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x140511[_0x0a9e('0x30')]);_0x14de77['filters']=_[_0x0a9e('0x32')](_0x14de77['model'],_0x14de77[_0x0a9e('0x30')]);_0x11c3b6[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x14de77[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x140511['query'][_0x0a9e('0x34')]));_0x11c3b6[_0x0a9e('0x33')]=_0x11c3b6[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x11c3b6[_0x0a9e('0x33')]:_0x14de77[_0x0a9e('0x2f')];if(!_0x140511[_0x0a9e('0x30')][_0x0a9e('0x36')]('nolimit')){_0x11c3b6[_0x0a9e('0x1a')]=qs['limit'](_0x140511[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x11c3b6[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x140511['query'][_0x0a9e('0x19')]);}_0x11c3b6[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x140511[_0x0a9e('0x30')]['sort']);delete _0x140511['query'][_0x0a9e('0x38')];_0x11c3b6['where']=qs[_0x0a9e('0x39')](_[_0x0a9e('0x3a')](_0x140511[_0x0a9e('0x30')],_0x14de77[_0x0a9e('0x39')]),_0x3652a7);if(_0x140511['query'][_0x0a9e('0x3b')]){_0x11c3b6[_0x0a9e('0x3c')]=_[_0x0a9e('0x3d')](_0x11c3b6['where'],{'$or':_[_0x0a9e('0x29')](_0x3652a7,function(_0x1a180b){if(_0x1a180b[_0x0a9e('0x2d')]!=='VIRTUAL'){var _0x546ef8={};_0x546ef8[_0x1a180b[_0x0a9e('0x26')]]={'$like':'%'+_0x140511[_0x0a9e('0x30')]['filter']+'%'};return _0x546ef8;}})});}_0x11c3b6=_[_0x0a9e('0x3d')]({},_0x11c3b6,_0x140511[_0x0a9e('0x3e')]);var _0x2e1b3a={'where':_0x11c3b6[_0x0a9e('0x3c')]};return db['VoiceMusicOnHold']['count'](_0x2e1b3a)[_0x0a9e('0x22')](function(_0x45b3d0){_0x5a101a['count']=_0x45b3d0;if(_0x140511[_0x0a9e('0x30')][_0x0a9e('0x3f')]){_0x11c3b6[_0x0a9e('0x40')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x0a9e('0x41')](_0x11c3b6);})[_0x0a9e('0x22')](function(_0x274e8e){_0x5a101a[_0x0a9e('0x42')]=_0x274e8e;return _0x5a101a;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x1538a4,_0x11c3b6))[_0x0a9e('0x43')](handleError(_0x1538a4,null));};exports[_0x0a9e('0x44')]=function(_0x45a9b8,_0x23b089){var _0x3da2cd={'raw':![],'where':{'id':_0x45a9b8[_0x0a9e('0x45')]['id']}},_0x2c3711={};_0x2c3711[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x2a')]['rawAttributes']);_0x2c3711['query']=_[_0x0a9e('0x31')](_0x45a9b8[_0x0a9e('0x30')]);_0x2c3711[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x2c3711[_0x0a9e('0x2f')],_0x2c3711[_0x0a9e('0x30')]);_0x3da2cd[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x2c3711[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x45a9b8[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0x3da2cd['attributes']=_0x3da2cd[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x3da2cd[_0x0a9e('0x33')]:_0x2c3711[_0x0a9e('0x2f')];if(_0x45a9b8[_0x0a9e('0x30')][_0x0a9e('0x3f')]){_0x3da2cd[_0x0a9e('0x40')]=[{'all':!![]}];}_0x3da2cd=_[_0x0a9e('0x3d')]({},_0x3da2cd,_0x45a9b8['options']);return db[_0x0a9e('0x2a')]['find'](_0x3da2cd)[_0x0a9e('0x22')](handleEntityNotFound(_0x23b089,null))[_0x0a9e('0x22')](respondWithResult(_0x23b089,null))[_0x0a9e('0x43')](handleError(_0x23b089,null));};exports['update']=function(_0x14bec2,_0x7f6eb1){if(_0x14bec2[_0x0a9e('0x46')]['id']){delete _0x14bec2[_0x0a9e('0x46')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x47')]({'where':{'id':_0x14bec2[_0x0a9e('0x45')]['id']}})['then'](handleEntityNotFound(_0x7f6eb1,null))[_0x0a9e('0x22')](saveUpdates(_0x14bec2[_0x0a9e('0x46')],null))[_0x0a9e('0x22')](respondWithResult(_0x7f6eb1,null))[_0x0a9e('0x43')](handleError(_0x7f6eb1,null));};exports[_0x0a9e('0x48')]=function(_0x992c77,_0x6054ee,_0x19383e){return db[_0x0a9e('0x49')]['transaction'](function(_0xe401a){if(_0x992c77[_0x0a9e('0x46')]['mode']==='files'){_0x992c77['body'][_0x0a9e('0x4a')]=path[_0x0a9e('0x4b')](config[_0x0a9e('0x4c')],_0x0a9e('0x4d'),_0x992c77[_0x0a9e('0x46')][_0x0a9e('0x26')]);}return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x992c77['body'],{'transaction':_0xe401a})['then'](function(_0x53975a){if(_0x992c77[_0x0a9e('0x46')][_0x0a9e('0x4e')]===_0x0a9e('0x4f')){fs['mkdirSync'](_0x53975a[_0x0a9e('0x4a')],parseInt(_0x0a9e('0x50'),0x8));}var _0x53d113=_0x992c77['user'][_0x0a9e('0x51')]({'plain':!![]});if(!_0x53d113)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53d113[_0x0a9e('0x52')]==='user'){var _0x2e5e62=_0x53975a[_0x0a9e('0x51')]({'plain':!![]});return db[_0x0a9e('0x53')]['find']({'where':{'name':_0x0a9e('0x23'),'userProfileId':_0x53d113[_0x0a9e('0x54')]},'raw':!![]})['then'](function(_0x50f687){if(_0x50f687&&_0x50f687[_0x0a9e('0x55')]===0x0){return db[_0x0a9e('0x24')]['create']({'name':_0x2e5e62[_0x0a9e('0x26')],'resourceId':_0x2e5e62['id'],'type':_0x50f687['name'],'sectionId':_0x50f687['id']},{})[_0x0a9e('0x22')](function(){return _0x53975a;});}else{return _0x53975a;}})['catch'](function(_0xe22ccc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe22ccc);});}return _0x53975a;});})['then'](respondWithResult(_0x6054ee,0xc9))[_0x0a9e('0x43')](handleError(_0x6054ee,null));};exports['destroy']=function(_0x2f7092,_0x65432,_0x3cfd00){var _0x19b4df;return db[_0x0a9e('0x2a')][_0x0a9e('0x47')]({'where':{'id':_0x2f7092[_0x0a9e('0x45')]['id']}})[_0x0a9e('0x22')](function(_0x4e67ab){if(_0x4e67ab){return db[_0x0a9e('0x49')][_0x0a9e('0x56')](function(_0x2642bb){return _0x4e67ab[_0x0a9e('0x21')]({'transaction':_0x2642bb,'raw':!![]})[_0x0a9e('0x22')](function(_0x156662){if(_0x156662['directory']){fs[_0x0a9e('0x57')](_0x156662[_0x0a9e('0x4a')])['forEach'](function(_0x3649cc){fs['unlinkSync'](path[_0x0a9e('0x4b')](_0x156662['directory'],_0x3649cc));});fs['rmdirSync'](_0x156662['directory']);}return _0x156662;});})[_0x0a9e('0x43')](function(_0x49d231){throw new db[(_0x0a9e('0x58'))][(_0x0a9e('0x59'))](_0x49d231[_0x0a9e('0x5a')]);});}})[_0x0a9e('0x22')](handleEntityNotFound(_0x65432,null))[_0x0a9e('0x22')](removeEntity(_0x65432,null))[_0x0a9e('0x43')](handleError(_0x65432,null));};exports['addSound']=function(_0x1627a7,_0x5854cc,_0xca4ade){return db[_0x0a9e('0x49')][_0x0a9e('0x56')](function(_0x5adf8f){var _0x453360;return db[_0x0a9e('0x2a')][_0x0a9e('0x47')]({'where':{'id':_0x1627a7[_0x0a9e('0x45')]['id']}})['then'](function(_0x1d0dc8){if(_0x1d0dc8){_0x453360=_0x1d0dc8;return _0x1d0dc8[_0x0a9e('0x5b')](_0x1627a7['body']['id'],{'transaction':_0x5adf8f});}})[_0x0a9e('0x22')](function(_0x17e88c){if(_0x17e88c){return db[_0x0a9e('0x5c')][_0x0a9e('0x5d')]({'where':{'id':_0x1627a7[_0x0a9e('0x46')]['id']},'attributes':['id','name',_0x0a9e('0x5e'),_0x0a9e('0x5f'),_0x0a9e('0x60')],'raw':!![]});}})['then'](function(_0x3528b7){if(_0x3528b7){var _0x4f1e60=path['join'](config[_0x0a9e('0x4c')],_0x0a9e('0x61'),util[_0x0a9e('0x62')](_0x0a9e('0x63'),path[_0x0a9e('0x64')](_0x3528b7[_0x0a9e('0x5e')],path[_0x0a9e('0x65')](_0x3528b7[_0x0a9e('0x5e')])),_0x3528b7[_0x0a9e('0x5f')]));var _0x1cc4f3=path[_0x0a9e('0x4b')](config[_0x0a9e('0x4c')],_0x0a9e('0x4d'),_0x453360[_0x0a9e('0x26')],util[_0x0a9e('0x62')](_0x0a9e('0x63'),_0x3528b7[_0x0a9e('0x26')],_0x3528b7[_0x0a9e('0x5f')]));fs['symlinkSync'](_0x4f1e60,_0x1cc4f3);return _0x3528b7;}})[_0x0a9e('0x43')](function(_0x295763){throw new db[(_0x0a9e('0x58'))]['ValidationError'](_0x295763[_0x0a9e('0x5a')]);});})[_0x0a9e('0x22')](handleEntityNotFound(_0x5854cc,null))['then'](respondWithResult(_0x5854cc,0xc9))[_0x0a9e('0x43')](handleError(_0x5854cc,null));};exports[_0x0a9e('0x66')]=function(_0x3ef315,_0x427946,_0x13b5c0){return db['sequelize']['transaction'](function(_0x4a2438){var _0x40fb85;return db[_0x0a9e('0x2a')][_0x0a9e('0x5d')]({'where':{'id':_0x3ef315[_0x0a9e('0x45')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x427946,null))[_0x0a9e('0x22')](function(_0xeef20){if(_0xeef20){_0x40fb85=_0xeef20;return _0xeef20[_0x0a9e('0x66')](_0x3ef315['params'][_0x0a9e('0x67')]);}})[_0x0a9e('0x22')](function(_0x12ccdb){if(_0x12ccdb){return db['Sound'][_0x0a9e('0x5d')]({'where':{'id':_0x3ef315['params'][_0x0a9e('0x67')]},'attributes':['id',_0x0a9e('0x26'),'save_name',_0x0a9e('0x5f'),_0x0a9e('0x60')],'raw':!![]});}})[_0x0a9e('0x22')](function(_0x317c0c){if(_0x317c0c){fs['unlinkSync'](path[_0x0a9e('0x4b')](_0x40fb85[_0x0a9e('0x4a')],util[_0x0a9e('0x62')](_0x0a9e('0x63'),_0x317c0c['name'],_0x317c0c[_0x0a9e('0x5f')])));return _0x317c0c;}})[_0x0a9e('0x43')](function(_0x2d5506){throw new db[(_0x0a9e('0x58'))]['ValidationError'](_0x2d5506[_0x0a9e('0x5a')]);});})[_0x0a9e('0x22')](handleEntityNotFound(_0x427946,null))[_0x0a9e('0x22')](respondWithStatusCode(_0x427946,0xcc))[_0x0a9e('0x43')](handleError(_0x427946,null));};exports[_0x0a9e('0x68')]=function(_0xdb98ca,_0x40fc56,_0x3df0e3){var _0x1a7b03={};var _0x336dc3={};var _0xc4c230;var _0x1f10ef;return db[_0x0a9e('0x2a')][_0x0a9e('0x5d')]({'where':{'id':_0xdb98ca['params']['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x40fc56,null))[_0x0a9e('0x22')](function(_0xc599b3){if(_0xc599b3){_0xc4c230=_0xc599b3;_0x336dc3['model']=_[_0x0a9e('0x31')](db[_0x0a9e('0x5c')][_0x0a9e('0x2b')]);_0x336dc3[_0x0a9e('0x30')]=_['keys'](_0xdb98ca['query']);_0x336dc3[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x336dc3['model'],_0x336dc3[_0x0a9e('0x30')]);_0x1a7b03['attributes']=_[_0x0a9e('0x32')](_0x336dc3[_0x0a9e('0x2f')],qs['fields'](_0xdb98ca[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0x1a7b03[_0x0a9e('0x33')]=_0x1a7b03[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x1a7b03[_0x0a9e('0x33')]:_0x336dc3[_0x0a9e('0x2f')];_0x1a7b03['order']=qs[_0x0a9e('0x38')](_0xdb98ca[_0x0a9e('0x30')][_0x0a9e('0x38')]);_0x1a7b03[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x3a')](_0xdb98ca[_0x0a9e('0x30')],_0x336dc3['filters']));if(_0xdb98ca[_0x0a9e('0x30')]['filter']){_0x1a7b03[_0x0a9e('0x3c')]=_[_0x0a9e('0x3d')](_0x1a7b03[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x1a7b03['attributes'],function(_0x51ccd7){var _0x353384={};_0x353384[_0x51ccd7]={'$like':'%'+_0xdb98ca[_0x0a9e('0x30')][_0x0a9e('0x3b')]+'%'};return _0x353384;})});}_0x1a7b03=_['merge']({},_0x1a7b03,_0xdb98ca[_0x0a9e('0x3e')]);return _0xc4c230[_0x0a9e('0x68')](_0x1a7b03);}})['then'](function(_0x4e46b2){if(_0x4e46b2){_0x1f10ef=_0x4e46b2[_0x0a9e('0x35')];if(!_0xdb98ca['query']['hasOwnProperty']('nolimit')){_0x1a7b03[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0xdb98ca[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x1a7b03[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0xdb98ca['query'][_0x0a9e('0x19')]);}return _0xc4c230['getSounds'](_0x1a7b03);}})[_0x0a9e('0x22')](function(_0x2aabab){if(_0x2aabab){return _0x2aabab?{'count':_0x1f10ef,'rows':_0x2aabab}:null;}})[_0x0a9e('0x22')](respondWithResult(_0x40fc56,null))[_0x0a9e('0x43')](handleError(_0x40fc56,null));}; \ No newline at end of file +var _0xa9e0=['json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','MusicOnHolds','UserProfileResource','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','body','find','create','sequelize','directory','join','root','server/files/moh','mode','files','0777','get','role','UserProfileSection','userProfileId','autoAssociation','transaction','readdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','removeSound','id2','getSounds','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'];(function(_0x12833b,_0x26c1d2){var _0x3acad3=function(_0x2f9ec9){while(--_0x2f9ec9){_0x12833b['push'](_0x12833b['shift']());}};_0x3acad3(++_0x26c1d2);}(_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=_0x5d0880['count'],_0x519dfd=_0x22dccb[_0x0a9e('0x19')],_0x16033c=_0x22dccb['offset']+_0x22dccb[_0x0a9e('0x1a')],_0x12066b;if(_0x16033c>=_0x1985b6){_0x16033c=_0x1985b6;_0x12066b=0xc8;}else{_0x12066b=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x12066b);return _0x52a03d[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x519dfd+'-'+_0x16033c+'/'+_0x1985b6)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x2eb11f){return function(_0x530eb7){try{jsonpatch[_0x0a9e('0x1d')](_0x530eb7,_0x2eb11f,!![]);}catch(_0x1314ae){return BPromise[_0x0a9e('0x1e')](_0x1314ae);}return _0x530eb7[_0x0a9e('0x1f')]();};}function saveUpdates(_0x105080,_0x4bb1e3){return function(_0x2c3407){if(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')](_0x105080)['then'](function(_0x20f109){return _0x20f109;});}return null;};}function removeEntity(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){var _0x30bae6=_0x3a02e1['get']({'plain':!![]});var _0xfb6e48=_0x0a9e('0x23');return db[_0x0a9e('0x24')][_0x0a9e('0x21')]({'where':{'type':_0xfb6e48,'resourceId':_0x30bae6['id']}})[_0x0a9e('0x22')](function(){return _0x3a02e1;});})[_0x0a9e('0x22')](function(){_0x5a09ef[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x15')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x25')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x26')];}_0x33161b[_0x0a9e('0x17')](_0x526cf3)[_0x0a9e('0x27')](_0x384319);};}exports[_0x0a9e('0x28')]=function(_0x140511,_0x1538a4){var _0x11c3b6={},_0x14de77={},_0x5a101a={'count':0x0,'rows':[]};var _0x3652a7=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x2c')],'type':_0x5c877d[_0x0a9e('0x2d')][_0x0a9e('0x2e')]};});_0x14de77[_0x0a9e('0x2f')]=_[_0x0a9e('0x29')](_0x3652a7,_0x0a9e('0x26'));_0x14de77[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x140511[_0x0a9e('0x30')]);_0x14de77['filters']=_[_0x0a9e('0x32')](_0x14de77['model'],_0x14de77[_0x0a9e('0x30')]);_0x11c3b6[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x14de77[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x140511['query'][_0x0a9e('0x34')]));_0x11c3b6[_0x0a9e('0x33')]=_0x11c3b6[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x11c3b6[_0x0a9e('0x33')]:_0x14de77[_0x0a9e('0x2f')];if(!_0x140511[_0x0a9e('0x30')][_0x0a9e('0x36')]('nolimit')){_0x11c3b6[_0x0a9e('0x1a')]=qs['limit'](_0x140511[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x11c3b6[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x140511['query'][_0x0a9e('0x19')]);}_0x11c3b6[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x140511[_0x0a9e('0x30')]['sort']);delete _0x140511['query'][_0x0a9e('0x38')];_0x11c3b6['where']=qs[_0x0a9e('0x39')](_[_0x0a9e('0x3a')](_0x140511[_0x0a9e('0x30')],_0x14de77[_0x0a9e('0x39')]),_0x3652a7);if(_0x140511['query'][_0x0a9e('0x3b')]){_0x11c3b6[_0x0a9e('0x3c')]=_[_0x0a9e('0x3d')](_0x11c3b6['where'],{'$or':_[_0x0a9e('0x29')](_0x3652a7,function(_0x1a180b){if(_0x1a180b[_0x0a9e('0x2d')]!=='VIRTUAL'){var _0x546ef8={};_0x546ef8[_0x1a180b[_0x0a9e('0x26')]]={'$like':'%'+_0x140511[_0x0a9e('0x30')]['filter']+'%'};return _0x546ef8;}})});}_0x11c3b6=_[_0x0a9e('0x3d')]({},_0x11c3b6,_0x140511[_0x0a9e('0x3e')]);var _0x2e1b3a={'where':_0x11c3b6[_0x0a9e('0x3c')]};return db['VoiceMusicOnHold']['count'](_0x2e1b3a)[_0x0a9e('0x22')](function(_0x45b3d0){_0x5a101a['count']=_0x45b3d0;if(_0x140511[_0x0a9e('0x30')][_0x0a9e('0x3f')]){_0x11c3b6[_0x0a9e('0x40')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x0a9e('0x41')](_0x11c3b6);})[_0x0a9e('0x22')](function(_0x274e8e){_0x5a101a[_0x0a9e('0x42')]=_0x274e8e;return _0x5a101a;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x1538a4,_0x11c3b6))[_0x0a9e('0x43')](handleError(_0x1538a4,null));};exports[_0x0a9e('0x44')]=function(_0x45a9b8,_0x23b089){var _0x3da2cd={'raw':![],'where':{'id':_0x45a9b8[_0x0a9e('0x45')]['id']}},_0x2c3711={};_0x2c3711[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x2a')]['rawAttributes']);_0x2c3711['query']=_[_0x0a9e('0x31')](_0x45a9b8[_0x0a9e('0x30')]);_0x2c3711[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x2c3711[_0x0a9e('0x2f')],_0x2c3711[_0x0a9e('0x30')]);_0x3da2cd[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x2c3711[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x45a9b8[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0x3da2cd['attributes']=_0x3da2cd[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x3da2cd[_0x0a9e('0x33')]:_0x2c3711[_0x0a9e('0x2f')];if(_0x45a9b8[_0x0a9e('0x30')][_0x0a9e('0x3f')]){_0x3da2cd[_0x0a9e('0x40')]=[{'all':!![]}];}_0x3da2cd=_[_0x0a9e('0x3d')]({},_0x3da2cd,_0x45a9b8['options']);return db[_0x0a9e('0x2a')]['find'](_0x3da2cd)[_0x0a9e('0x22')](handleEntityNotFound(_0x23b089,null))[_0x0a9e('0x22')](respondWithResult(_0x23b089,null))[_0x0a9e('0x43')](handleError(_0x23b089,null));};exports['update']=function(_0x14bec2,_0x7f6eb1){if(_0x14bec2[_0x0a9e('0x46')]['id']){delete _0x14bec2[_0x0a9e('0x46')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x47')]({'where':{'id':_0x14bec2[_0x0a9e('0x45')]['id']}})['then'](handleEntityNotFound(_0x7f6eb1,null))[_0x0a9e('0x22')](saveUpdates(_0x14bec2[_0x0a9e('0x46')],null))[_0x0a9e('0x22')](respondWithResult(_0x7f6eb1,null))[_0x0a9e('0x43')](handleError(_0x7f6eb1,null));};exports[_0x0a9e('0x48')]=function(_0x992c77,_0x6054ee,_0x19383e){return db[_0x0a9e('0x49')]['transaction'](function(_0xe401a){if(_0x992c77[_0x0a9e('0x46')]['mode']==='files'){_0x992c77['body'][_0x0a9e('0x4a')]=path[_0x0a9e('0x4b')](config[_0x0a9e('0x4c')],_0x0a9e('0x4d'),_0x992c77[_0x0a9e('0x46')][_0x0a9e('0x26')]);}return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x992c77['body'],{'transaction':_0xe401a})['then'](function(_0x53975a){if(_0x992c77[_0x0a9e('0x46')][_0x0a9e('0x4e')]===_0x0a9e('0x4f')){fs['mkdirSync'](_0x53975a[_0x0a9e('0x4a')],parseInt(_0x0a9e('0x50'),0x8));}var _0x53d113=_0x992c77['user'][_0x0a9e('0x51')]({'plain':!![]});if(!_0x53d113)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53d113[_0x0a9e('0x52')]==='user'){var _0x2e5e62=_0x53975a[_0x0a9e('0x51')]({'plain':!![]});return db[_0x0a9e('0x53')]['find']({'where':{'name':_0x0a9e('0x23'),'userProfileId':_0x53d113[_0x0a9e('0x54')]},'raw':!![]})['then'](function(_0x50f687){if(_0x50f687&&_0x50f687[_0x0a9e('0x55')]===0x0){return db[_0x0a9e('0x24')]['create']({'name':_0x2e5e62[_0x0a9e('0x26')],'resourceId':_0x2e5e62['id'],'type':_0x50f687['name'],'sectionId':_0x50f687['id']},{})[_0x0a9e('0x22')](function(){return _0x53975a;});}else{return _0x53975a;}})['catch'](function(_0xe22ccc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe22ccc);});}return _0x53975a;});})['then'](respondWithResult(_0x6054ee,0xc9))[_0x0a9e('0x43')](handleError(_0x6054ee,null));};exports['destroy']=function(_0x2f7092,_0x65432,_0x3cfd00){var _0x19b4df;return db[_0x0a9e('0x2a')][_0x0a9e('0x47')]({'where':{'id':_0x2f7092[_0x0a9e('0x45')]['id']}})[_0x0a9e('0x22')](function(_0x4e67ab){if(_0x4e67ab){return db[_0x0a9e('0x49')][_0x0a9e('0x56')](function(_0x2642bb){return _0x4e67ab[_0x0a9e('0x21')]({'transaction':_0x2642bb,'raw':!![]})[_0x0a9e('0x22')](function(_0x156662){if(_0x156662['directory']){fs[_0x0a9e('0x57')](_0x156662[_0x0a9e('0x4a')])['forEach'](function(_0x3649cc){fs['unlinkSync'](path[_0x0a9e('0x4b')](_0x156662['directory'],_0x3649cc));});fs['rmdirSync'](_0x156662['directory']);}return _0x156662;});})[_0x0a9e('0x43')](function(_0x49d231){throw new db[(_0x0a9e('0x58'))][(_0x0a9e('0x59'))](_0x49d231[_0x0a9e('0x5a')]);});}})[_0x0a9e('0x22')](handleEntityNotFound(_0x65432,null))[_0x0a9e('0x22')](removeEntity(_0x65432,null))[_0x0a9e('0x43')](handleError(_0x65432,null));};exports['addSound']=function(_0x1627a7,_0x5854cc,_0xca4ade){return db[_0x0a9e('0x49')][_0x0a9e('0x56')](function(_0x5adf8f){var _0x453360;return db[_0x0a9e('0x2a')][_0x0a9e('0x47')]({'where':{'id':_0x1627a7[_0x0a9e('0x45')]['id']}})['then'](function(_0x1d0dc8){if(_0x1d0dc8){_0x453360=_0x1d0dc8;return _0x1d0dc8[_0x0a9e('0x5b')](_0x1627a7['body']['id'],{'transaction':_0x5adf8f});}})[_0x0a9e('0x22')](function(_0x17e88c){if(_0x17e88c){return db[_0x0a9e('0x5c')][_0x0a9e('0x5d')]({'where':{'id':_0x1627a7[_0x0a9e('0x46')]['id']},'attributes':['id','name',_0x0a9e('0x5e'),_0x0a9e('0x5f'),_0x0a9e('0x60')],'raw':!![]});}})['then'](function(_0x3528b7){if(_0x3528b7){var _0x4f1e60=path['join'](config[_0x0a9e('0x4c')],_0x0a9e('0x61'),util[_0x0a9e('0x62')](_0x0a9e('0x63'),path[_0x0a9e('0x64')](_0x3528b7[_0x0a9e('0x5e')],path[_0x0a9e('0x65')](_0x3528b7[_0x0a9e('0x5e')])),_0x3528b7[_0x0a9e('0x5f')]));var _0x1cc4f3=path[_0x0a9e('0x4b')](config[_0x0a9e('0x4c')],_0x0a9e('0x4d'),_0x453360[_0x0a9e('0x26')],util[_0x0a9e('0x62')](_0x0a9e('0x63'),_0x3528b7[_0x0a9e('0x26')],_0x3528b7[_0x0a9e('0x5f')]));fs['symlinkSync'](_0x4f1e60,_0x1cc4f3);return _0x3528b7;}})[_0x0a9e('0x43')](function(_0x295763){throw new db[(_0x0a9e('0x58'))]['ValidationError'](_0x295763[_0x0a9e('0x5a')]);});})[_0x0a9e('0x22')](handleEntityNotFound(_0x5854cc,null))['then'](respondWithResult(_0x5854cc,0xc9))[_0x0a9e('0x43')](handleError(_0x5854cc,null));};exports[_0x0a9e('0x66')]=function(_0x3ef315,_0x427946,_0x13b5c0){return db['sequelize']['transaction'](function(_0x4a2438){var _0x40fb85;return db[_0x0a9e('0x2a')][_0x0a9e('0x5d')]({'where':{'id':_0x3ef315[_0x0a9e('0x45')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x427946,null))[_0x0a9e('0x22')](function(_0xeef20){if(_0xeef20){_0x40fb85=_0xeef20;return _0xeef20[_0x0a9e('0x66')](_0x3ef315['params'][_0x0a9e('0x67')]);}})[_0x0a9e('0x22')](function(_0x12ccdb){if(_0x12ccdb){return db['Sound'][_0x0a9e('0x5d')]({'where':{'id':_0x3ef315['params'][_0x0a9e('0x67')]},'attributes':['id',_0x0a9e('0x26'),'save_name',_0x0a9e('0x5f'),_0x0a9e('0x60')],'raw':!![]});}})[_0x0a9e('0x22')](function(_0x317c0c){if(_0x317c0c){fs['unlinkSync'](path[_0x0a9e('0x4b')](_0x40fb85[_0x0a9e('0x4a')],util[_0x0a9e('0x62')](_0x0a9e('0x63'),_0x317c0c['name'],_0x317c0c[_0x0a9e('0x5f')])));return _0x317c0c;}})[_0x0a9e('0x43')](function(_0x2d5506){throw new db[(_0x0a9e('0x58'))]['ValidationError'](_0x2d5506[_0x0a9e('0x5a')]);});})[_0x0a9e('0x22')](handleEntityNotFound(_0x427946,null))[_0x0a9e('0x22')](respondWithStatusCode(_0x427946,0xcc))[_0x0a9e('0x43')](handleError(_0x427946,null));};exports[_0x0a9e('0x68')]=function(_0xdb98ca,_0x40fc56,_0x3df0e3){var _0x1a7b03={};var _0x336dc3={};var _0xc4c230;var _0x1f10ef;return db[_0x0a9e('0x2a')][_0x0a9e('0x5d')]({'where':{'id':_0xdb98ca['params']['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x40fc56,null))[_0x0a9e('0x22')](function(_0xc599b3){if(_0xc599b3){_0xc4c230=_0xc599b3;_0x336dc3['model']=_[_0x0a9e('0x31')](db[_0x0a9e('0x5c')][_0x0a9e('0x2b')]);_0x336dc3[_0x0a9e('0x30')]=_['keys'](_0xdb98ca['query']);_0x336dc3[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x336dc3['model'],_0x336dc3[_0x0a9e('0x30')]);_0x1a7b03['attributes']=_[_0x0a9e('0x32')](_0x336dc3[_0x0a9e('0x2f')],qs['fields'](_0xdb98ca[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0x1a7b03[_0x0a9e('0x33')]=_0x1a7b03[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x1a7b03[_0x0a9e('0x33')]:_0x336dc3[_0x0a9e('0x2f')];_0x1a7b03['order']=qs[_0x0a9e('0x38')](_0xdb98ca[_0x0a9e('0x30')][_0x0a9e('0x38')]);_0x1a7b03[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x3a')](_0xdb98ca[_0x0a9e('0x30')],_0x336dc3['filters']));if(_0xdb98ca[_0x0a9e('0x30')]['filter']){_0x1a7b03[_0x0a9e('0x3c')]=_[_0x0a9e('0x3d')](_0x1a7b03[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x1a7b03['attributes'],function(_0x51ccd7){var _0x353384={};_0x353384[_0x51ccd7]={'$like':'%'+_0xdb98ca[_0x0a9e('0x30')][_0x0a9e('0x3b')]+'%'};return _0x353384;})});}_0x1a7b03=_['merge']({},_0x1a7b03,_0xdb98ca[_0x0a9e('0x3e')]);return _0xc4c230[_0x0a9e('0x68')](_0x1a7b03);}})['then'](function(_0x4e46b2){if(_0x4e46b2){_0x1f10ef=_0x4e46b2[_0x0a9e('0x35')];if(!_0xdb98ca['query']['hasOwnProperty']('nolimit')){_0x1a7b03[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0xdb98ca[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x1a7b03[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0xdb98ca['query'][_0x0a9e('0x19')]);}return _0xc4c230['getSounds'](_0x1a7b03);}})[_0x0a9e('0x22')](function(_0x2aabab){if(_0x2aabab){return _0x2aabab?{'count':_0x1f10ef,'rows':_0x2aabab}:null;}})[_0x0a9e('0x22')](respondWithResult(_0x40fc56,null))[_0x0a9e('0x43')](handleError(_0x40fc56,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index bbd6dab..de0d1ab 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 _0x34b2=['./voiceMusicOnHold.attributes','VoiceMusicOnHold','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2123ca,_0xc48d31){var _0xbb794f=function(_0x58277c){while(--_0x58277c){_0x2123ca['push'](_0x2123ca['shift']());}};_0xbb794f(++_0xc48d31);}(_0x34b2,0x12b));var _0x234b=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x34b2[_0x289891];return _0x31cf2e;};'use strict';var _=require(_0x234b('0x0'));var util=require(_0x234b('0x1'));var logger=require(_0x234b('0x2'))(_0x234b('0x3'));var moment=require(_0x234b('0x4'));var BPromise=require('bluebird');var rp=require(_0x234b('0x5'));var fs=require('fs');var path=require(_0x234b('0x6'));var rimraf=require(_0x234b('0x7'));var config=require(_0x234b('0x8'));var attributes=require(_0x234b('0x9'));module['exports']=function(_0x2f810f,_0x24c09d){return _0x2f810f['define'](_0x234b('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2764=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x1b8358,_0xdc0154){var _0x3a9c06=function(_0x4f72c2){while(--_0x4f72c2){_0x1b8358['push'](_0x1b8358['shift']());}};_0x3a9c06(++_0xdc0154);}(_0x2764,0xbb));var _0x4276=function(_0x53cd00,_0x18127a){_0x53cd00=_0x53cd00-0x0;var _0x1da1d4=_0x2764[_0x53cd00];return _0x1da1d4;};'use strict';var _=require(_0x4276('0x0'));var util=require(_0x4276('0x1'));var logger=require(_0x4276('0x2'))(_0x4276('0x3'));var moment=require(_0x4276('0x4'));var BPromise=require('bluebird');var rp=require(_0x4276('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4276('0x6'));var config=require(_0x4276('0x7'));var attributes=require(_0x4276('0x8'));module[_0x4276('0x9')]=function(_0x2d2522,_0x5eb933){return _0x2d2522[_0x4276('0xa')](_0x4276('0xb'),attributes,{'tableName':_0x4276('0xc'),'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 1d147c8..3622b4c 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 _0x17b1=['../../mysqldb','../../config/logger','rpc','../../config/environment','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x19c0da,_0x49dc0f){var _0xf30c47=function(_0xc41342){while(--_0xc41342){_0x19c0da['push'](_0x19c0da['shift']());}};_0xf30c47(++_0x49dc0f);}(_0x17b1,0x1cf));var _0x117b=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x17b1[_0x4c2f30];return _0xb8854d;};'use strict';var _=require(_0x117b('0x0'));var util=require('util');var moment=require(_0x117b('0x1'));var BPromise=require(_0x117b('0x2'));var rs=require(_0x117b('0x3'));var fs=require('fs');var Redis=require(_0x117b('0x4'));var db=require(_0x117b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x117b('0x6'))(_0x117b('0x7'));var config=require(_0x117b('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9b443,_0x263c4a,_0xbfd433){return new BPromise(function(_0x198e48,_0x46e283){return client[_0x117b('0x9')](_0x9b443,_0xbfd433)['then'](function(_0x30c0c6){logger[_0x117b('0xa')](_0x117b('0xb'),_0x263c4a,_0x117b('0xc'));logger[_0x117b('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x263c4a,_0x117b('0xc'),JSON['stringify'](_0x30c0c6));if(_0x30c0c6[_0x117b('0xe')]){if(_0x30c0c6[_0x117b('0xe')]['code']===0x1f4){logger['error'](_0x117b('0xb'),_0x263c4a,_0x30c0c6[_0x117b('0xe')][_0x117b('0xf')]);return _0x46e283(_0x30c0c6[_0x117b('0xe')][_0x117b('0xf')]);}logger[_0x117b('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x263c4a,_0x30c0c6[_0x117b('0xe')]['message']);return _0x198e48(_0x30c0c6['error'][_0x117b('0xf')]);}else{logger[_0x117b('0xa')](_0x117b('0xb'),_0x263c4a,_0x117b('0xc'));_0x198e48(_0x30c0c6[_0x117b('0x10')][_0x117b('0xf')]);}})[_0x117b('0x11')](function(_0x2261c9){logger[_0x117b('0xe')](_0x117b('0xb'),_0x263c4a,_0x2261c9);_0x46e283(_0x2261c9);});});} \ No newline at end of file +var _0x5b12=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4bf2cb,_0x55f9c){var _0x5c22e3=function(_0xc9c678){while(--_0xc9c678){_0x4bf2cb['push'](_0x4bf2cb['shift']());}};_0x5c22e3(++_0x55f9c);}(_0x5b12,0x156));var _0x25b1=function(_0x4768eb,_0x1e5eb9){_0x4768eb=_0x4768eb-0x0;var _0x57a37a=_0x5b12[_0x4768eb];return _0x57a37a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x25b1('0x0'));var rs=require(_0x25b1('0x1'));var fs=require('fs');var Redis=require(_0x25b1('0x2'));var db=require(_0x25b1('0x3'))['db'];var utils=require(_0x25b1('0x4'));var logger=require(_0x25b1('0x5'))(_0x25b1('0x6'));var config=require(_0x25b1('0x7'));var jayson=require(_0x25b1('0x8'));var client=jayson[_0x25b1('0x9')][_0x25b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x193aa1,_0x2173ce,_0x3128f9){return new BPromise(function(_0x59cb0f,_0x4e2f6d){return client[_0x25b1('0xb')](_0x193aa1,_0x3128f9)[_0x25b1('0xc')](function(_0x2896a4){logger[_0x25b1('0xd')](_0x25b1('0xe'),_0x2173ce,_0x25b1('0xf'));logger['debug'](_0x25b1('0x10'),_0x2173ce,_0x25b1('0xf'),JSON[_0x25b1('0x11')](_0x2896a4));if(_0x2896a4[_0x25b1('0x12')]){if(_0x2896a4[_0x25b1('0x12')][_0x25b1('0x13')]===0x1f4){logger['error'](_0x25b1('0xe'),_0x2173ce,_0x2896a4[_0x25b1('0x12')][_0x25b1('0x14')]);return _0x4e2f6d(_0x2896a4[_0x25b1('0x12')][_0x25b1('0x14')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2173ce,_0x2896a4[_0x25b1('0x12')][_0x25b1('0x14')]);return _0x59cb0f(_0x2896a4[_0x25b1('0x12')]['message']);}else{logger[_0x25b1('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2173ce,'request\x20sent');_0x59cb0f(_0x2896a4['result'][_0x25b1('0x14')]);}})[_0x25b1('0x15')](function(_0xee2313){logger[_0x25b1('0x12')](_0x25b1('0xe'),_0x2173ce,_0xee2313);_0x4e2f6d(_0xee2313);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 1a74973..44f9588 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 _0xbd51=['addAgents','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','./voicePrefix.controller','get','isAuthenticated','/describe','describe','/:id/users','getAgents','post'];(function(_0xc971a4,_0x5b381c){var _0x4ebd6b=function(_0x371149){while(--_0x371149){_0xc971a4['push'](_0xc971a4['shift']());}};_0x4ebd6b(++_0x5b381c);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x462800,_0x567bce){_0x462800=_0x462800-0x0;var _0x15ae8c=_0xbd51[_0x462800];return _0x15ae8c;};'use strict';var multer=require(_0x1bd5('0x0'));var util=require('util');var path=require(_0x1bd5('0x1'));var timeout=require(_0x1bd5('0x2'));var express=require(_0x1bd5('0x3'));var router=express[_0x1bd5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1bd5('0x5'));router[_0x1bd5('0x6')]('/',auth[_0x1bd5('0x7')](),controller['index']);router[_0x1bd5('0x6')](_0x1bd5('0x8'),auth[_0x1bd5('0x7')](),controller[_0x1bd5('0x9')]);router[_0x1bd5('0x6')]('/:id',auth[_0x1bd5('0x7')](),controller['show']);router[_0x1bd5('0x6')](_0x1bd5('0xa'),auth[_0x1bd5('0x7')](),controller[_0x1bd5('0xb')]);router[_0x1bd5('0xc')]('/',auth[_0x1bd5('0x7')](),controller['create']);router[_0x1bd5('0xc')]('/:id/users',auth[_0x1bd5('0x7')](),controller[_0x1bd5('0xd')]);router[_0x1bd5('0xe')](_0x1bd5('0xf'),auth[_0x1bd5('0x7')](),controller[_0x1bd5('0x10')]);router[_0x1bd5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1bd5('0x12')]);router[_0x1bd5('0x11')](_0x1bd5('0xa'),auth[_0x1bd5('0x7')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x323f=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeAgents','exports'];(function(_0xe86ec8,_0x43b0f8){var _0xaa3a0c=function(_0x5177ac){while(--_0x5177ac){_0xe86ec8['push'](_0xe86ec8['shift']());}};_0xaa3a0c(++_0x43b0f8);}(_0x323f,0x1ee));var _0xf323=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x323f[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require('multer');var util=require(_0xf323('0x0'));var path=require('path');var timeout=require(_0xf323('0x1'));var express=require(_0xf323('0x2'));var router=express[_0xf323('0x3')]();var fs_extra=require(_0xf323('0x4'));var auth=require(_0xf323('0x5'));var interaction=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var controller=require(_0xf323('0x8'));router[_0xf323('0x9')]('/',auth[_0xf323('0xa')](),controller['index']);router[_0xf323('0x9')](_0xf323('0xb'),auth[_0xf323('0xa')](),controller[_0xf323('0xc')]);router[_0xf323('0x9')](_0xf323('0xd'),auth[_0xf323('0xa')](),controller[_0xf323('0xe')]);router[_0xf323('0x9')](_0xf323('0xf'),auth[_0xf323('0xa')](),controller[_0xf323('0x10')]);router[_0xf323('0x11')]('/',auth[_0xf323('0xa')](),controller[_0xf323('0x12')]);router[_0xf323('0x11')](_0xf323('0xf'),auth['isAuthenticated'](),controller[_0xf323('0x13')]);router[_0xf323('0x14')](_0xf323('0xd'),auth['isAuthenticated'](),controller[_0xf323('0x15')]);router[_0xf323('0x16')](_0xf323('0xd'),auth[_0xf323('0xa')](),controller[_0xf323('0x17')]);router[_0xf323('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0xf323('0x18')]);module[_0xf323('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 6252bbb..515fb55 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 _0x3fb7=['exports','STRING','name','system-','getDataValue','INTEGER','sequelize'];(function(_0x3bddde,_0x1409a1){var _0x2f5d10=function(_0x2a0035){while(--_0x2a0035){_0x3bddde['push'](_0x3bddde['shift']());}};_0x2f5d10(++_0x1409a1);}(_0x3fb7,0x187));var _0x73fb=function(_0x27db89,_0x57ec96){_0x27db89=_0x27db89-0x0;var _0x1dd260=_0x3fb7[_0x27db89];return _0x1dd260;};'use strict';var Sequelize=require(_0x73fb('0x0'));module[_0x73fb('0x1')]={'name':{'type':Sequelize[_0x73fb('0x2')],'allowNull':![],'unique':_0x73fb('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x230672){return _0x73fb('0x4')+this[_0x73fb('0x5')](_0x73fb('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x73fb('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x73fb('0x6')]}}; \ No newline at end of file +var _0x0b40=['system-','getDataValue','name','INTEGER','exports','STRING','VIRTUAL'];(function(_0x42ee1e,_0x3f1a64){var _0x1e21b8=function(_0x56098b){while(--_0x56098b){_0x42ee1e['push'](_0x42ee1e['shift']());}};_0x1e21b8(++_0x3f1a64);}(_0x0b40,0xba));var _0x00b4=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x0b40[_0x503950];return _0x1657a9;};'use strict';var Sequelize=require('sequelize');module[_0x00b4('0x0')]={'name':{'type':Sequelize[_0x00b4('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x00b4('0x2')],'get':function(_0x309480){return _0x00b4('0x3')+this[_0x00b4('0x4')](_0x00b4('0x5'))+'-';}},'description':{'type':Sequelize[_0x00b4('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x00b4('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 217e349..373f079 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 _0x91af=['merge','type','count','includeAll','include','rows','catch','show','params','keys','options','find','describe','create','transaction','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','push','Set','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','body','findById','omit','ids','spread','emit','removeAgents','isArray','userVoicePrefix:remove','findOne','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','name','index','map','VoicePrefix','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter'];(function(_0x21141c,_0x1bf3b9){var _0x592432=function(_0x1b76d0){while(--_0x1b76d0){_0x21141c['push'](_0x21141c['shift']());}};_0x592432(++_0x1bf3b9);}(_0x91af,0x114));var _0xf91a=function(_0x1c4c4a,_0x1a5a19){_0x1c4c4a=_0x1c4c4a-0x0;var _0x46093f=_0x91af[_0x1c4c4a];return _0x46093f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf91a('0x0'));var zipdir=require(_0xf91a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf91a('0x2'));var BPromise=require(_0xf91a('0x3'));var Mustache=require(_0xf91a('0x4'));var util=require(_0xf91a('0x5'));var path=require(_0xf91a('0x6'));var sox=require(_0xf91a('0x7'));var csv=require('to-csv');var ejs=require(_0xf91a('0x8'));var fs=require('fs');var fs_extra=require(_0xf91a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf91a('0xa'));var jsforce=require(_0xf91a('0xb'));var deskjs=require(_0xf91a('0xc'));var toCsv=require(_0xf91a('0xd'));var querystring=require(_0xf91a('0xe'));var Papa=require(_0xf91a('0xf'));var Redis=require(_0xf91a('0x10'));var authService=require(_0xf91a('0x11'));var qs=require(_0xf91a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf91a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf91a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf91a('0x15'));var db=require(_0xf91a('0x16'))['db'];config[_0xf91a('0x17')]=_[_0xf91a('0x18')](config[_0xf91a('0x17')],{'host':_0xf91a('0x19'),'port':0x18eb});var socket=require(_0xf91a('0x1a'))(new Redis(config[_0xf91a('0x17')]));require('./voicePrefix.socket')[_0xf91a('0x1b')](socket);function respondWithStatusCode(_0x128bae,_0x4dc704){_0x4dc704=_0x4dc704||0xcc;return function(_0x45681b){if(_0x45681b){return _0x128bae[_0xf91a('0x1c')](_0x4dc704);}return _0x128bae[_0xf91a('0x1d')](_0x4dc704)[_0xf91a('0x1e')]();};}function respondWithResult(_0x3654e6,_0x47ad06){_0x47ad06=_0x47ad06||0xc8;return function(_0x2b4f99){if(_0x2b4f99){return _0x3654e6[_0xf91a('0x1d')](_0x47ad06)[_0xf91a('0x1f')](_0x2b4f99);}};}function respondWithFilteredResult(_0x250966,_0x2017da){return function(_0x4a7020){if(_0x4a7020){var _0x5ab79b=_0x4a7020['count'],_0x3e07ab=_0x2017da[_0xf91a('0x20')],_0x15997c=_0x2017da[_0xf91a('0x20')]+_0x2017da[_0xf91a('0x21')],_0x4b841c;if(_0x15997c>=_0x5ab79b){_0x15997c=_0x5ab79b;_0x4b841c=0xc8;}else{_0x4b841c=0xce;}_0x250966[_0xf91a('0x1d')](_0x4b841c);return _0x250966[_0xf91a('0x22')]('Content-Range',_0x3e07ab+'-'+_0x15997c+'/'+_0x5ab79b)[_0xf91a('0x1f')](_0x4a7020);}return null;};}function patchUpdates(_0x31e735){return function(_0x597bc7){try{jsonpatch[_0xf91a('0x23')](_0x597bc7,_0x31e735,!![]);}catch(_0x516fe3){return BPromise[_0xf91a('0x24')](_0x516fe3);}return _0x597bc7[_0xf91a('0x25')]();};}function saveUpdates(_0x1bf0e3,_0x2577cb){return function(_0x1d2346){if(_0x1d2346){return _0x1d2346[_0xf91a('0x26')](_0x1bf0e3)[_0xf91a('0x27')](function(_0x5ce8a8){return _0x5ce8a8;});}return null;};}function removeEntity(_0x402a73,_0x32e26d){return function(_0x9b6710){if(_0x9b6710){return _0x9b6710[_0xf91a('0x28')]()[_0xf91a('0x27')](function(){var _0x3eca0d=_0x9b6710[_0xf91a('0x29')]({'plain':!![]});var _0x196586=_0xf91a('0x2a');return db[_0xf91a('0x2b')][_0xf91a('0x28')]({'where':{'type':_0x196586,'resourceId':_0x3eca0d['id']}})['then'](function(){return _0x9b6710;});})[_0xf91a('0x27')](function(){_0x402a73[_0xf91a('0x1d')](0xcc)[_0xf91a('0x1e')]();});}};}function handleEntityNotFound(_0x5b99d4,_0xc740ab){return function(_0x59c1e0){if(!_0x59c1e0){_0x5b99d4[_0xf91a('0x1c')](0x194);}return _0x59c1e0;};}function handleError(_0x5d972c,_0x1fcf00){_0x1fcf00=_0x1fcf00||0x1f4;return function(_0x9944dd){logger[_0xf91a('0x2c')](_0x9944dd['stack']);if(_0x9944dd[_0xf91a('0x2d')]){delete _0x9944dd[_0xf91a('0x2d')];}_0x5d972c[_0xf91a('0x1d')](_0x1fcf00)['send'](_0x9944dd);};}exports[_0xf91a('0x2e')]=function(_0x197aa0,_0x2589b5){var _0x5e87ee={},_0x1f9abe={},_0x4a0c0c={'count':0x0,'rows':[]};var _0x5e438f=_[_0xf91a('0x2f')](db[_0xf91a('0x30')][_0xf91a('0x31')],function(_0x570c75){return{'name':_0x570c75['fieldName'],'type':_0x570c75['type'][_0xf91a('0x32')]};});_0x1f9abe[_0xf91a('0x33')]=_['map'](_0x5e438f,_0xf91a('0x2d'));_0x1f9abe[_0xf91a('0x34')]=_['keys'](_0x197aa0[_0xf91a('0x34')]);_0x1f9abe[_0xf91a('0x35')]=_[_0xf91a('0x36')](_0x1f9abe[_0xf91a('0x33')],_0x1f9abe[_0xf91a('0x34')]);_0x5e87ee[_0xf91a('0x37')]=_['intersection'](_0x1f9abe[_0xf91a('0x33')],qs['fields'](_0x197aa0[_0xf91a('0x34')][_0xf91a('0x38')]));_0x5e87ee[_0xf91a('0x37')]=_0x5e87ee[_0xf91a('0x37')][_0xf91a('0x39')]?_0x5e87ee[_0xf91a('0x37')]:_0x1f9abe['model'];if(!_0x197aa0[_0xf91a('0x34')][_0xf91a('0x3a')]('nolimit')){_0x5e87ee[_0xf91a('0x21')]=qs[_0xf91a('0x21')](_0x197aa0[_0xf91a('0x34')]['limit']);_0x5e87ee['offset']=qs[_0xf91a('0x20')](_0x197aa0[_0xf91a('0x34')]['offset']);}_0x5e87ee[_0xf91a('0x3b')]=qs['sort'](_0x197aa0[_0xf91a('0x34')][_0xf91a('0x3c')]);_0x5e87ee[_0xf91a('0x3d')]=qs['filters'](_['pick'](_0x197aa0[_0xf91a('0x34')],_0x1f9abe['filters']),_0x5e438f);if(_0x197aa0['query'][_0xf91a('0x3e')]){_0x5e87ee[_0xf91a('0x3d')]=_[_0xf91a('0x3f')](_0x5e87ee[_0xf91a('0x3d')],{'$or':_[_0xf91a('0x2f')](_0x5e438f,function(_0x4b196e){if(_0x4b196e[_0xf91a('0x40')]!=='VIRTUAL'){var _0xbc00c6={};_0xbc00c6[_0x4b196e[_0xf91a('0x2d')]]={'$like':'%'+_0x197aa0['query']['filter']+'%'};return _0xbc00c6;}})});}_0x5e87ee=_[_0xf91a('0x3f')]({},_0x5e87ee,_0x197aa0['options']);var _0x5e84b5={'where':_0x5e87ee[_0xf91a('0x3d')]};return db[_0xf91a('0x30')][_0xf91a('0x41')](_0x5e84b5)['then'](function(_0x4ca8eb){_0x4a0c0c[_0xf91a('0x41')]=_0x4ca8eb;if(_0x197aa0['query'][_0xf91a('0x42')]){_0x5e87ee[_0xf91a('0x43')]=[{'all':!![]}];}return db[_0xf91a('0x30')]['findAll'](_0x5e87ee);})['then'](function(_0x26d3ad){_0x4a0c0c[_0xf91a('0x44')]=_0x26d3ad;return _0x4a0c0c;})[_0xf91a('0x27')](respondWithFilteredResult(_0x2589b5,_0x5e87ee))[_0xf91a('0x45')](handleError(_0x2589b5,null));};exports[_0xf91a('0x46')]=function(_0x238310,_0x3bae3){var _0x2a4afa={'raw':![],'where':{'id':_0x238310[_0xf91a('0x47')]['id']}},_0x20dd8f={};_0x20dd8f[_0xf91a('0x33')]=_[_0xf91a('0x48')](db['VoicePrefix'][_0xf91a('0x31')]);_0x20dd8f[_0xf91a('0x34')]=_[_0xf91a('0x48')](_0x238310[_0xf91a('0x34')]);_0x20dd8f[_0xf91a('0x35')]=_[_0xf91a('0x36')](_0x20dd8f['model'],_0x20dd8f[_0xf91a('0x34')]);_0x2a4afa[_0xf91a('0x37')]=_['intersection'](_0x20dd8f['model'],qs[_0xf91a('0x38')](_0x238310[_0xf91a('0x34')]['fields']));_0x2a4afa['attributes']=_0x2a4afa[_0xf91a('0x37')][_0xf91a('0x39')]?_0x2a4afa[_0xf91a('0x37')]:_0x20dd8f[_0xf91a('0x33')];if(_0x238310[_0xf91a('0x34')][_0xf91a('0x42')]){_0x2a4afa[_0xf91a('0x43')]=[{'all':!![]}];}_0x2a4afa=_['merge']({},_0x2a4afa,_0x238310[_0xf91a('0x49')]);return db['VoicePrefix'][_0xf91a('0x4a')](_0x2a4afa)[_0xf91a('0x27')](handleEntityNotFound(_0x3bae3,null))[_0xf91a('0x27')](respondWithResult(_0x3bae3,null))['catch'](handleError(_0x3bae3,null));};exports[_0xf91a('0x28')]=function(_0x4df2b7,_0x3d915e){return db[_0xf91a('0x30')][_0xf91a('0x4a')]({'where':{'id':_0x4df2b7[_0xf91a('0x47')]['id']}})[_0xf91a('0x27')](handleEntityNotFound(_0x3d915e,null))[_0xf91a('0x27')](removeEntity(_0x3d915e,null))[_0xf91a('0x45')](handleError(_0x3d915e,null));};exports[_0xf91a('0x4b')]=function(_0x1754bf,_0x35bae4){return db[_0xf91a('0x30')][_0xf91a('0x4b')]()[_0xf91a('0x27')](respondWithResult(_0x35bae4,null))[_0xf91a('0x45')](handleError(_0x35bae4,null));};exports[_0xf91a('0x4c')]=function(_0x53c42d,_0x257a71){var _0x71783f;return db['sequelize'][_0xf91a('0x4d')](function(_0x31e2bc){return db['VoicePrefix'][_0xf91a('0x4c')](_0x53c42d['body'],{'transaction':_0x31e2bc})['then'](function(_0x3a6cf9){_0x71783f=_0x3a6cf9[_0xf91a('0x29')]({'plain':!![]});return db[_0xf91a('0x4e')]['find']({'where':{'id':_0x71783f[_0xf91a('0x4f')]},'raw':!![]})['then'](function(_0xaeaaa8){return createVoicePrefixExtensions(_0x71783f,_0xaeaaa8,_0x31e2bc);});});})[_0xf91a('0x27')](function(){var _0x5765ed=_0x53c42d['user'][_0xf91a('0x29')]({'plain':!![]});if(!_0x5765ed)throw new Error(_0xf91a('0x50'));if(_0x5765ed[_0xf91a('0x51')]===_0xf91a('0x52')){var _0x1d7a5d=_0x71783f;return db['UserProfileSection'][_0xf91a('0x4a')]({'where':{'name':_0xf91a('0x2a'),'userProfileId':_0x5765ed[_0xf91a('0x53')]},'raw':!![]})[_0xf91a('0x27')](function(_0x4f562a){if(_0x4f562a&&_0x4f562a[_0xf91a('0x54')]===0x0){return db[_0xf91a('0x2b')][_0xf91a('0x4c')]({'name':_0x1d7a5d[_0xf91a('0x2d')],'resourceId':_0x1d7a5d['id'],'type':_0x4f562a[_0xf91a('0x2d')],'sectionId':_0x4f562a['id']},{})['then'](function(){return _0x71783f;});}else{return _0x71783f;}})[_0xf91a('0x45')](function(_0x3c0c50){logger['error'](_0xf91a('0x55'),_0x3c0c50);throw _0x3c0c50;});}return _0x71783f;})[_0xf91a('0x27')](respondWithResult(_0x257a71,null))[_0xf91a('0x45')](handleError(_0x257a71,null));};function Extension(_0x4e17a6,_0x54b189,_0x293500,_0x59cc1d){this['context']=_0xf91a('0x56');this[_0xf91a('0x57')]=_0x4e17a6;this['app']=_0x293500;this[_0xf91a('0x40')]=_0xf91a('0x58');this['description']=_0xf91a('0x59');this[_0xf91a('0x5a')]=_0x54b189;this[_0xf91a('0x5b')]=_0x59cc1d;}function createVoicePrefixExtensions(_0x557491,_0x4d883f,_0x33da22){return new BPromise(function(_0x5eb8c0,_0x1c6a17){var _0x14ec00=new Extension(formatPrefixName(_0x557491['prefix']),0x1,_0xf91a('0x5c'),_0xf91a('0x5d'));_0x14ec00[_0xf91a('0x5e')]=_0x557491['id'];return db[_0xf91a('0x4e')][_0xf91a('0x4c')](_0x14ec00,{'transaction':_0x33da22})['then'](function(_0x38a833){var _0x2c670e=_0x38a833[_0xf91a('0x29')]({'plain':!![]});var _0x790dde=_[_0xf91a('0x2f')](addVoicePrefixExtensions(_0x557491,_0x4d883f),function(_0x50a381){_0x50a381['VoiceExtensionId']=_0x2c670e['id'];_0x50a381['VoicePrefixId']=_0x557491['id'];return _0x50a381;});return db['VoiceExtension']['bulkCreate'](_0x790dde,{'transaction':_0x33da22})[_0xf91a('0x27')](function(_0x56b739){if(!_0x56b739){return _0x1c6a17('Extensions\x20creation\x20failed');}else{return _0x5eb8c0(_0x56b739);}})[_0xf91a('0x45')](function(_0x105220){return _0x1c6a17(_0x105220);});});;});};function addVoicePrefixExtensions(_0x526b63,_0x1863e9){var _0x484f7d=[];var _0x583755=formatPrefixName(_0x526b63['prefix']);_0x484f7d[_0xf91a('0x5f')](new Extension(_0x583755,0x2,_0xf91a('0x60'),'CDR(prefix)='+_0x526b63[_0xf91a('0x2d')]));if(_0x526b63[_0xf91a('0x61')]){_0x484f7d['push'](new Extension(_0x583755,0x3,_0xf91a('0x60'),'PREFIX-CALLERIDALL='+_0x526b63[_0xf91a('0x61')]));}else{_0x484f7d[_0xf91a('0x5f')](new Extension(_0x583755,0x3,'NoOp',_0xf91a('0x62')));}_0x484f7d[_0xf91a('0x5f')](new Extension(_0x583755,0x4,'goto',_0x1863e9[_0xf91a('0x63')]+','+_0xf91a('0x64')+(0x8+_0x526b63[_0xf91a('0x2d')][_0xf91a('0x39')])+'}'+','+0x1));return _0x484f7d;}function formatPrefixName(_0xcc6d98){var _0x3f0065='_';for(var _0x24dbee=0x0;_0x24dbee<_0xcc6d98[_0xf91a('0x39')];_0x24dbee++){if(_0xcc6d98[_0xf91a('0x65')](_0x24dbee)=='-'){_0x3f0065+=_0xcc6d98[_0xf91a('0x65')](_0x24dbee);}else{_0x3f0065+='['+_0xcc6d98[_0xf91a('0x65')](_0x24dbee)+']';}}_0x3f0065+='.';return _0x3f0065;}exports['update']=function(_0x4cd614,_0x26aa63,_0x1ee285){var _0x818cad=_0x4cd614[_0xf91a('0x66')];_0x818cad['prefix']='system-'+_0x818cad[_0xf91a('0x2d')]+'-';return db['sequelize']['transaction'](function(_0x57fed9){return db[_0xf91a('0x30')]['update'](_0x818cad,{'where':{'id':_0x818cad['id']},'transaction':_0x57fed9})['then'](function(){return db[_0xf91a('0x4e')][_0xf91a('0x28')]({'where':{'VoicePrefixId':_0x818cad['id']},'transaction':_0x57fed9})[_0xf91a('0x27')](function(){return db[_0xf91a('0x4e')][_0xf91a('0x4a')]({'where':{'id':_0x818cad[_0xf91a('0x4f')]},'raw':!![]})[_0xf91a('0x27')](function(_0x31cfc8){return createVoicePrefixExtensions(_0x818cad,_0x31cfc8,_0x57fed9);});});});})['then'](function(){return db['VoicePrefix'][_0xf91a('0x67')](_0x818cad['id']);})[_0xf91a('0x27')](respondWithResult(_0x26aa63,null))[_0xf91a('0x45')](handleError(_0x26aa63,null));};exports['addAgents']=function(_0x5ecff7,_0x29c688,_0x5a4b78){return db[_0xf91a('0x30')][_0xf91a('0x4a')]({'where':{'id':_0x5ecff7['params']['id']}})['then'](handleEntityNotFound(_0x29c688,null))['then'](function(_0x4467b7){if(_0x4467b7){return _0x4467b7['addAgents'](_0x5ecff7[_0xf91a('0x66')]['ids'],_[_0xf91a('0x68')](_0x5ecff7[_0xf91a('0x66')],[_0xf91a('0x69'),'id'])||{})[_0xf91a('0x6a')](function(_0x587ae0){for(var _0x511e29=0x0;_0x511e29<_0x5ecff7[_0xf91a('0x66')][_0xf91a('0x69')][_0xf91a('0x39')];_0x511e29+=0x1){socket[_0xf91a('0x6b')]('userVoicePrefix:save',{'UserId':_0x5ecff7[_0xf91a('0x66')][_0xf91a('0x69')][_0x511e29],'VoicePrefixId':_0x5ecff7[_0xf91a('0x47')]['id']});}return _0x587ae0;});}})['then'](respondWithResult(_0x29c688,null))[_0xf91a('0x45')](handleError(_0x29c688,null));};exports[_0xf91a('0x6c')]=function(_0x1aabdc,_0x252705,_0x5a4f2f){return db['VoicePrefix'][_0xf91a('0x4a')]({'where':{'id':_0x1aabdc['params']['id']}})[_0xf91a('0x27')](handleEntityNotFound(_0x252705,null))[_0xf91a('0x27')](function(_0x2861d2){if(_0x2861d2){return _0x2861d2[_0xf91a('0x6c')](_0x1aabdc['query'][_0xf91a('0x69')])[_0xf91a('0x27')](function(){if(_[_0xf91a('0x6d')](_0x1aabdc[_0xf91a('0x34')][_0xf91a('0x69')])){for(var _0x307719=0x0;_0x307719<_0x1aabdc[_0xf91a('0x34')][_0xf91a('0x69')]['length'];_0x307719+=0x1){socket[_0xf91a('0x6b')](_0xf91a('0x6e'),{'UserId':Number(_0x1aabdc[_0xf91a('0x34')][_0xf91a('0x69')][_0x307719]),'VoicePrefixId':Number(_0x1aabdc['params']['id'])});}}else{socket[_0xf91a('0x6b')](_0xf91a('0x6e'),{'UserId':Number(_0x1aabdc['query']['ids']),'VoicePrefixId':Number(_0x1aabdc[_0xf91a('0x47')]['id'])});}});}})[_0xf91a('0x27')](respondWithStatusCode(_0x252705,null))['catch'](handleError(_0x252705,null));};exports['getAgents']=function(_0x56af6c,_0x5bac77,_0x46c63d){var _0x2584f9={};var _0xacf635={};var _0x18bf06;var _0x4898d0;return db['VoicePrefix'][_0xf91a('0x6f')]({'where':{'id':_0x56af6c['params']['id']}})[_0xf91a('0x27')](handleEntityNotFound(_0x5bac77,null))[_0xf91a('0x27')](function(_0x136ab3){if(_0x136ab3){_0x18bf06=_0x136ab3;_0xacf635['model']=_[_0xf91a('0x48')](db['User']['rawAttributes']);_0xacf635[_0xf91a('0x34')]=_[_0xf91a('0x48')](_0x56af6c[_0xf91a('0x34')]);_0xacf635[_0xf91a('0x35')]=_[_0xf91a('0x36')](_0xacf635[_0xf91a('0x33')],_0xacf635[_0xf91a('0x34')]);_0x2584f9['attributes']=_[_0xf91a('0x36')](_0xacf635[_0xf91a('0x33')],qs['fields'](_0x56af6c[_0xf91a('0x34')][_0xf91a('0x38')]));_0x2584f9[_0xf91a('0x37')]=_0x2584f9[_0xf91a('0x37')][_0xf91a('0x39')]?_0x2584f9['attributes']:_0xacf635[_0xf91a('0x33')];_0x2584f9[_0xf91a('0x3b')]=qs[_0xf91a('0x3c')](_0x56af6c[_0xf91a('0x34')][_0xf91a('0x3c')]);_0x2584f9[_0xf91a('0x3d')]=qs['filters'](_['pick'](_0x56af6c[_0xf91a('0x34')],_0xacf635['filters']));if(_0x56af6c[_0xf91a('0x34')][_0xf91a('0x3e')]){_0x2584f9[_0xf91a('0x3d')]=_[_0xf91a('0x3f')](_0x2584f9[_0xf91a('0x3d')],{'$or':_[_0xf91a('0x2f')](_0x2584f9['attributes'],function(_0x13fd1f){var _0x403826={};_0x403826[_0x13fd1f]={'$like':'%'+_0x56af6c['query'][_0xf91a('0x3e')]+'%'};return _0x403826;})});}_0x2584f9=_[_0xf91a('0x3f')]({},_0x2584f9,_0x56af6c[_0xf91a('0x49')]);return _0x18bf06[_0xf91a('0x70')](_0x2584f9);}})['then'](function(_0x41bc49){if(_0x41bc49){_0x4898d0=_0x41bc49[_0xf91a('0x39')];if(!_0x56af6c['query'][_0xf91a('0x3a')]('nolimit')){_0x2584f9[_0xf91a('0x21')]=qs[_0xf91a('0x21')](_0x56af6c['query'][_0xf91a('0x21')]);_0x2584f9[_0xf91a('0x20')]=qs['offset'](_0x56af6c['query'][_0xf91a('0x20')]);}return _0x18bf06['getAgents'](_0x2584f9);}})[_0xf91a('0x27')](function(_0x4ce04c){if(_0x4ce04c){return _0x4ce04c?{'count':_0x4898d0,'rows':_0x4ce04c}:null;}})[_0xf91a('0x27')](respondWithResult(_0x5bac77,null))[_0xf91a('0x45')](handleError(_0x5bac77,null));}; \ No newline at end of file +var _0x803f=['../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','VoicePrefixes','stack','name','send','map','VoicePrefix','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','includeAll','findAll','catch','show','params','include','merge','options','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','autoAssociation','UserProfileResource','context','from-sip','exten','app','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','callerIdAll','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','findOne','User','getAgents','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x803f,0x144));var _0xf803=function(_0x93fa94,_0x38ea85){_0x93fa94=_0x93fa94-0x0;var _0x35eb88=_0x803f[_0x93fa94];return _0x35eb88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf803('0x0'));var zipdir=require(_0xf803('0x1'));var jsonpatch=require(_0xf803('0x2'));var rp=require(_0xf803('0x3'));var moment=require(_0xf803('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf803('0x5'));var util=require(_0xf803('0x6'));var path=require(_0xf803('0x7'));var sox=require(_0xf803('0x8'));var csv=require(_0xf803('0x9'));var ejs=require(_0xf803('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf803('0xb'));var squel=require(_0xf803('0xc'));var crypto=require(_0xf803('0xd'));var jsforce=require(_0xf803('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf803('0xf'));var Papa=require('papaparse');var Redis=require(_0xf803('0x10'));var authService=require(_0xf803('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf803('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf803('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf803('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf803('0x15')]=_[_0xf803('0x16')](config[_0xf803('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xf803('0x17'))(new Redis(config[_0xf803('0x15')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0xaf3d8d,_0x266308){_0x266308=_0x266308||0xcc;return function(_0x217079){if(_0x217079){return _0xaf3d8d[_0xf803('0x18')](_0x266308);}return _0xaf3d8d[_0xf803('0x19')](_0x266308)[_0xf803('0x1a')]();};}function respondWithResult(_0x56a5db,_0x454471){_0x454471=_0x454471||0xc8;return function(_0x5f281c){if(_0x5f281c){return _0x56a5db[_0xf803('0x19')](_0x454471)[_0xf803('0x1b')](_0x5f281c);}};}function respondWithFilteredResult(_0x1d645b,_0x2e30dc){return function(_0x5641a0){if(_0x5641a0){var _0x232bc8=_0x5641a0[_0xf803('0x1c')],_0x4d2ce7=_0x2e30dc[_0xf803('0x1d')],_0x4594de=_0x2e30dc['offset']+_0x2e30dc[_0xf803('0x1e')],_0x41c219;if(_0x4594de>=_0x232bc8){_0x4594de=_0x232bc8;_0x41c219=0xc8;}else{_0x41c219=0xce;}_0x1d645b['status'](_0x41c219);return _0x1d645b['set'](_0xf803('0x1f'),_0x4d2ce7+'-'+_0x4594de+'/'+_0x232bc8)[_0xf803('0x1b')](_0x5641a0);}return null;};}function patchUpdates(_0x6e7c8d){return function(_0xb3e488){try{jsonpatch[_0xf803('0x20')](_0xb3e488,_0x6e7c8d,!![]);}catch(_0x831a71){return BPromise['reject'](_0x831a71);}return _0xb3e488[_0xf803('0x21')]();};}function saveUpdates(_0x59f6f2,_0x48d266){return function(_0x11282a){if(_0x11282a){return _0x11282a[_0xf803('0x22')](_0x59f6f2)[_0xf803('0x23')](function(_0x4cd887){return _0x4cd887;});}return null;};}function removeEntity(_0x1b998e,_0x5afaee){return function(_0x2e8e3b){if(_0x2e8e3b){return _0x2e8e3b[_0xf803('0x24')]()[_0xf803('0x23')](function(){var _0x5390a8=_0x2e8e3b[_0xf803('0x25')]({'plain':!![]});var _0x69c7fc=_0xf803('0x26');return db['UserProfileResource'][_0xf803('0x24')]({'where':{'type':_0x69c7fc,'resourceId':_0x5390a8['id']}})[_0xf803('0x23')](function(){return _0x2e8e3b;});})[_0xf803('0x23')](function(){_0x1b998e[_0xf803('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ad8b6,_0x5d5912){return function(_0x18e68b){if(!_0x18e68b){_0x3ad8b6[_0xf803('0x18')](0x194);}return _0x18e68b;};}function handleError(_0x1404de,_0x554d17){_0x554d17=_0x554d17||0x1f4;return function(_0x419229){logger['error'](_0x419229[_0xf803('0x27')]);if(_0x419229[_0xf803('0x28')]){delete _0x419229[_0xf803('0x28')];}_0x1404de[_0xf803('0x19')](_0x554d17)[_0xf803('0x29')](_0x419229);};}exports['index']=function(_0x1335bc,_0x4c77ff){var _0x467543={},_0x1a0b38={},_0x553a49={'count':0x0,'rows':[]};var _0x261270=_[_0xf803('0x2a')](db[_0xf803('0x2b')][_0xf803('0x2c')],function(_0x1e4ddc){return{'name':_0x1e4ddc['fieldName'],'type':_0x1e4ddc[_0xf803('0x2d')][_0xf803('0x2e')]};});_0x1a0b38[_0xf803('0x2f')]=_[_0xf803('0x2a')](_0x261270,'name');_0x1a0b38[_0xf803('0x30')]=_[_0xf803('0x31')](_0x1335bc[_0xf803('0x30')]);_0x1a0b38[_0xf803('0x32')]=_[_0xf803('0x33')](_0x1a0b38[_0xf803('0x2f')],_0x1a0b38[_0xf803('0x30')]);_0x467543[_0xf803('0x34')]=_['intersection'](_0x1a0b38[_0xf803('0x2f')],qs['fields'](_0x1335bc[_0xf803('0x30')][_0xf803('0x35')]));_0x467543[_0xf803('0x34')]=_0x467543[_0xf803('0x34')][_0xf803('0x36')]?_0x467543[_0xf803('0x34')]:_0x1a0b38['model'];if(!_0x1335bc[_0xf803('0x30')][_0xf803('0x37')]('nolimit')){_0x467543[_0xf803('0x1e')]=qs[_0xf803('0x1e')](_0x1335bc[_0xf803('0x30')][_0xf803('0x1e')]);_0x467543[_0xf803('0x1d')]=qs['offset'](_0x1335bc[_0xf803('0x30')]['offset']);}_0x467543[_0xf803('0x38')]=qs[_0xf803('0x39')](_0x1335bc[_0xf803('0x30')][_0xf803('0x39')]);_0x467543[_0xf803('0x3a')]=qs[_0xf803('0x32')](_[_0xf803('0x3b')](_0x1335bc[_0xf803('0x30')],_0x1a0b38['filters']),_0x261270);if(_0x1335bc[_0xf803('0x30')]['filter']){_0x467543[_0xf803('0x3a')]=_['merge'](_0x467543['where'],{'$or':_[_0xf803('0x2a')](_0x261270,function(_0x5be7a5){if(_0x5be7a5[_0xf803('0x2d')]!==_0xf803('0x3c')){var _0x131d46={};_0x131d46[_0x5be7a5[_0xf803('0x28')]]={'$like':'%'+_0x1335bc[_0xf803('0x30')][_0xf803('0x3d')]+'%'};return _0x131d46;}})});}_0x467543=_['merge']({},_0x467543,_0x1335bc['options']);var _0x39279d={'where':_0x467543['where']};return db[_0xf803('0x2b')][_0xf803('0x1c')](_0x39279d)[_0xf803('0x23')](function(_0x325f06){_0x553a49[_0xf803('0x1c')]=_0x325f06;if(_0x1335bc[_0xf803('0x30')][_0xf803('0x3e')]){_0x467543['include']=[{'all':!![]}];}return db[_0xf803('0x2b')][_0xf803('0x3f')](_0x467543);})[_0xf803('0x23')](function(_0x1abde3){_0x553a49['rows']=_0x1abde3;return _0x553a49;})[_0xf803('0x23')](respondWithFilteredResult(_0x4c77ff,_0x467543))[_0xf803('0x40')](handleError(_0x4c77ff,null));};exports[_0xf803('0x41')]=function(_0xfc0991,_0x35132d){var _0xff25a0={'raw':![],'where':{'id':_0xfc0991[_0xf803('0x42')]['id']}},_0x53e223={};_0x53e223[_0xf803('0x2f')]=_[_0xf803('0x31')](db[_0xf803('0x2b')][_0xf803('0x2c')]);_0x53e223[_0xf803('0x30')]=_['keys'](_0xfc0991[_0xf803('0x30')]);_0x53e223[_0xf803('0x32')]=_[_0xf803('0x33')](_0x53e223[_0xf803('0x2f')],_0x53e223[_0xf803('0x30')]);_0xff25a0[_0xf803('0x34')]=_[_0xf803('0x33')](_0x53e223['model'],qs[_0xf803('0x35')](_0xfc0991['query'][_0xf803('0x35')]));_0xff25a0[_0xf803('0x34')]=_0xff25a0[_0xf803('0x34')][_0xf803('0x36')]?_0xff25a0[_0xf803('0x34')]:_0x53e223['model'];if(_0xfc0991[_0xf803('0x30')][_0xf803('0x3e')]){_0xff25a0[_0xf803('0x43')]=[{'all':!![]}];}_0xff25a0=_[_0xf803('0x44')]({},_0xff25a0,_0xfc0991[_0xf803('0x45')]);return db['VoicePrefix'][_0xf803('0x46')](_0xff25a0)[_0xf803('0x23')](handleEntityNotFound(_0x35132d,null))['then'](respondWithResult(_0x35132d,null))[_0xf803('0x40')](handleError(_0x35132d,null));};exports[_0xf803('0x24')]=function(_0x259973,_0x5544c5){return db[_0xf803('0x2b')][_0xf803('0x46')]({'where':{'id':_0x259973[_0xf803('0x42')]['id']}})[_0xf803('0x23')](handleEntityNotFound(_0x5544c5,null))[_0xf803('0x23')](removeEntity(_0x5544c5,null))['catch'](handleError(_0x5544c5,null));};exports[_0xf803('0x47')]=function(_0x3f7f97,_0x7ca2e8){return db[_0xf803('0x2b')][_0xf803('0x47')]()[_0xf803('0x23')](respondWithResult(_0x7ca2e8,null))[_0xf803('0x40')](handleError(_0x7ca2e8,null));};exports[_0xf803('0x48')]=function(_0x59c3d9,_0x5d3bc6){var _0x85ef04;return db[_0xf803('0x49')][_0xf803('0x4a')](function(_0xd40ab2){return db['VoicePrefix'][_0xf803('0x48')](_0x59c3d9['body'],{'transaction':_0xd40ab2})[_0xf803('0x23')](function(_0x837f54){_0x85ef04=_0x837f54[_0xf803('0x25')]({'plain':!![]});return db[_0xf803('0x4b')][_0xf803('0x46')]({'where':{'id':_0x85ef04[_0xf803('0x4c')]},'raw':!![]})['then'](function(_0xe14b1f){return createVoicePrefixExtensions(_0x85ef04,_0xe14b1f,_0xd40ab2);});});})[_0xf803('0x23')](function(){var _0x11bbe2=_0x59c3d9[_0xf803('0x4d')][_0xf803('0x25')]({'plain':!![]});if(!_0x11bbe2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11bbe2[_0xf803('0x4e')]===_0xf803('0x4d')){var _0xea9eef=_0x85ef04;return db[_0xf803('0x4f')]['find']({'where':{'name':_0xf803('0x26'),'userProfileId':_0x11bbe2['userProfileId']},'raw':!![]})[_0xf803('0x23')](function(_0x5bd57d){if(_0x5bd57d&&_0x5bd57d[_0xf803('0x50')]===0x0){return db[_0xf803('0x51')][_0xf803('0x48')]({'name':_0xea9eef[_0xf803('0x28')],'resourceId':_0xea9eef['id'],'type':_0x5bd57d[_0xf803('0x28')],'sectionId':_0x5bd57d['id']},{})['then'](function(){return _0x85ef04;});}else{return _0x85ef04;}})[_0xf803('0x40')](function(_0x2486ad){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2486ad);throw _0x2486ad;});}return _0x85ef04;})['then'](respondWithResult(_0x5d3bc6,null))[_0xf803('0x40')](handleError(_0x5d3bc6,null));};function Extension(_0x59bbfb,_0x22a7d0,_0x4821a9,_0x43424b){this[_0xf803('0x52')]=_0xf803('0x53');this[_0xf803('0x54')]=_0x59bbfb;this[_0xf803('0x55')]=_0x4821a9;this[_0xf803('0x2d')]='system';this['description']='Voice\x20Prefix\x20Extension';this[_0xf803('0x56')]=_0x22a7d0;this['appdata']=_0x43424b;}function createVoicePrefixExtensions(_0x110b92,_0x10f5ca,_0x5cc77d){return new BPromise(function(_0x251473,_0x1781d8){var _0xa0d21b=new Extension(formatPrefixName(_0x110b92[_0xf803('0x57')]),0x1,'NoOp',_0xf803('0x58'));_0xa0d21b[_0xf803('0x59')]=_0x110b92['id'];return db[_0xf803('0x4b')][_0xf803('0x48')](_0xa0d21b,{'transaction':_0x5cc77d})[_0xf803('0x23')](function(_0x581bb7){var _0x274819=_0x581bb7[_0xf803('0x25')]({'plain':!![]});var _0x33f01c=_[_0xf803('0x2a')](addVoicePrefixExtensions(_0x110b92,_0x10f5ca),function(_0x34c1ee){_0x34c1ee['VoiceExtensionId']=_0x274819['id'];_0x34c1ee[_0xf803('0x59')]=_0x110b92['id'];return _0x34c1ee;});return db[_0xf803('0x4b')][_0xf803('0x5a')](_0x33f01c,{'transaction':_0x5cc77d})[_0xf803('0x23')](function(_0x5dfa99){if(!_0x5dfa99){return _0x1781d8('Extensions\x20creation\x20failed');}else{return _0x251473(_0x5dfa99);}})[_0xf803('0x40')](function(_0x23444b){return _0x1781d8(_0x23444b);});});;});};function addVoicePrefixExtensions(_0x59f473,_0x31e07b){var _0x567565=[];var _0x91a198=formatPrefixName(_0x59f473[_0xf803('0x57')]);_0x567565[_0xf803('0x5b')](new Extension(_0x91a198,0x2,_0xf803('0x5c'),'CDR(prefix)='+_0x59f473[_0xf803('0x28')]));if(_0x59f473[_0xf803('0x5d')]){_0x567565[_0xf803('0x5b')](new Extension(_0x91a198,0x3,_0xf803('0x5c'),'PREFIX-CALLERIDALL='+_0x59f473[_0xf803('0x5d')]));}else{_0x567565[_0xf803('0x5b')](new Extension(_0x91a198,0x3,_0xf803('0x5e'),_0xf803('0x5f')));}_0x567565[_0xf803('0x5b')](new Extension(_0x91a198,0x4,_0xf803('0x60'),_0x31e07b[_0xf803('0x52')]+','+_0xf803('0x61')+(0x8+_0x59f473['name'][_0xf803('0x36')])+'}'+','+0x1));return _0x567565;}function formatPrefixName(_0x553463){var _0x35e828='_';for(var _0x1fd8ff=0x0;_0x1fd8ff<_0x553463['length'];_0x1fd8ff++){if(_0x553463[_0xf803('0x62')](_0x1fd8ff)=='-'){_0x35e828+=_0x553463[_0xf803('0x62')](_0x1fd8ff);}else{_0x35e828+='['+_0x553463['charAt'](_0x1fd8ff)+']';}}_0x35e828+='.';return _0x35e828;}exports['update']=function(_0x7c52f3,_0xe13470,_0x2c34fe){var _0x2420b3=_0x7c52f3[_0xf803('0x63')];_0x2420b3[_0xf803('0x57')]=_0xf803('0x64')+_0x2420b3[_0xf803('0x28')]+'-';return db['sequelize'][_0xf803('0x4a')](function(_0x3dcded){return db[_0xf803('0x2b')]['update'](_0x2420b3,{'where':{'id':_0x2420b3['id']},'transaction':_0x3dcded})['then'](function(){return db['VoiceExtension'][_0xf803('0x24')]({'where':{'VoicePrefixId':_0x2420b3['id']},'transaction':_0x3dcded})[_0xf803('0x23')](function(){return db[_0xf803('0x4b')][_0xf803('0x46')]({'where':{'id':_0x2420b3[_0xf803('0x4c')]},'raw':!![]})['then'](function(_0x26f8ed){return createVoicePrefixExtensions(_0x2420b3,_0x26f8ed,_0x3dcded);});});});})[_0xf803('0x23')](function(){return db[_0xf803('0x2b')][_0xf803('0x65')](_0x2420b3['id']);})[_0xf803('0x23')](respondWithResult(_0xe13470,null))[_0xf803('0x40')](handleError(_0xe13470,null));};exports['addAgents']=function(_0x3b015a,_0x30615f,_0x1bf875){return db[_0xf803('0x2b')][_0xf803('0x46')]({'where':{'id':_0x3b015a[_0xf803('0x42')]['id']}})[_0xf803('0x23')](handleEntityNotFound(_0x30615f,null))[_0xf803('0x23')](function(_0x456769){if(_0x456769){return _0x456769[_0xf803('0x66')](_0x3b015a[_0xf803('0x63')][_0xf803('0x67')],_[_0xf803('0x68')](_0x3b015a[_0xf803('0x63')],[_0xf803('0x67'),'id'])||{})[_0xf803('0x69')](function(_0x27ddb8){for(var _0x66af0a=0x0;_0x66af0a<_0x3b015a['body'][_0xf803('0x67')]['length'];_0x66af0a+=0x1){socket[_0xf803('0x6a')](_0xf803('0x6b'),{'UserId':_0x3b015a[_0xf803('0x63')][_0xf803('0x67')][_0x66af0a],'VoicePrefixId':_0x3b015a[_0xf803('0x42')]['id']});}return _0x27ddb8;});}})[_0xf803('0x23')](respondWithResult(_0x30615f,null))['catch'](handleError(_0x30615f,null));};exports[_0xf803('0x6c')]=function(_0x3c991f,_0x68d56f,_0x5f3ad){return db['VoicePrefix'][_0xf803('0x46')]({'where':{'id':_0x3c991f[_0xf803('0x42')]['id']}})[_0xf803('0x23')](handleEntityNotFound(_0x68d56f,null))[_0xf803('0x23')](function(_0xab0f9f){if(_0xab0f9f){return _0xab0f9f[_0xf803('0x6c')](_0x3c991f['query'][_0xf803('0x67')])[_0xf803('0x23')](function(){if(_['isArray'](_0x3c991f[_0xf803('0x30')][_0xf803('0x67')])){for(var _0x1150e3=0x0;_0x1150e3<_0x3c991f['query'][_0xf803('0x67')][_0xf803('0x36')];_0x1150e3+=0x1){socket['emit'](_0xf803('0x6d'),{'UserId':Number(_0x3c991f[_0xf803('0x30')][_0xf803('0x67')][_0x1150e3]),'VoicePrefixId':Number(_0x3c991f['params']['id'])});}}else{socket[_0xf803('0x6a')](_0xf803('0x6d'),{'UserId':Number(_0x3c991f[_0xf803('0x30')][_0xf803('0x67')]),'VoicePrefixId':Number(_0x3c991f['params']['id'])});}});}})[_0xf803('0x23')](respondWithStatusCode(_0x68d56f,null))[_0xf803('0x40')](handleError(_0x68d56f,null));};exports['getAgents']=function(_0x5e63df,_0x13f414,_0x104258){var _0x320f30={};var _0x427641={};var _0x892b34;var _0x417168;return db[_0xf803('0x2b')][_0xf803('0x6e')]({'where':{'id':_0x5e63df[_0xf803('0x42')]['id']}})[_0xf803('0x23')](handleEntityNotFound(_0x13f414,null))['then'](function(_0x524aee){if(_0x524aee){_0x892b34=_0x524aee;_0x427641['model']=_[_0xf803('0x31')](db[_0xf803('0x6f')][_0xf803('0x2c')]);_0x427641['query']=_['keys'](_0x5e63df[_0xf803('0x30')]);_0x427641[_0xf803('0x32')]=_['intersection'](_0x427641[_0xf803('0x2f')],_0x427641[_0xf803('0x30')]);_0x320f30[_0xf803('0x34')]=_[_0xf803('0x33')](_0x427641[_0xf803('0x2f')],qs[_0xf803('0x35')](_0x5e63df[_0xf803('0x30')]['fields']));_0x320f30['attributes']=_0x320f30[_0xf803('0x34')]['length']?_0x320f30[_0xf803('0x34')]:_0x427641['model'];_0x320f30[_0xf803('0x38')]=qs[_0xf803('0x39')](_0x5e63df[_0xf803('0x30')][_0xf803('0x39')]);_0x320f30['where']=qs[_0xf803('0x32')](_[_0xf803('0x3b')](_0x5e63df[_0xf803('0x30')],_0x427641[_0xf803('0x32')]));if(_0x5e63df[_0xf803('0x30')]['filter']){_0x320f30[_0xf803('0x3a')]=_[_0xf803('0x44')](_0x320f30[_0xf803('0x3a')],{'$or':_['map'](_0x320f30[_0xf803('0x34')],function(_0x5bea71){var _0x5e7a7b={};_0x5e7a7b[_0x5bea71]={'$like':'%'+_0x5e63df[_0xf803('0x30')]['filter']+'%'};return _0x5e7a7b;})});}_0x320f30=_[_0xf803('0x44')]({},_0x320f30,_0x5e63df[_0xf803('0x45')]);return _0x892b34[_0xf803('0x70')](_0x320f30);}})[_0xf803('0x23')](function(_0x1dde00){if(_0x1dde00){_0x417168=_0x1dde00[_0xf803('0x36')];if(!_0x5e63df[_0xf803('0x30')]['hasOwnProperty'](_0xf803('0x71'))){_0x320f30[_0xf803('0x1e')]=qs[_0xf803('0x1e')](_0x5e63df['query']['limit']);_0x320f30['offset']=qs[_0xf803('0x1d')](_0x5e63df[_0xf803('0x30')][_0xf803('0x1d')]);}return _0x892b34[_0xf803('0x70')](_0x320f30);}})[_0xf803('0x23')](function(_0x59eb39){if(_0x59eb39){return _0x59eb39?{'count':_0x417168,'rows':_0x59eb39}:null;}})['then'](respondWithResult(_0x13f414,null))[_0xf803('0x40')](handleError(_0x13f414,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 9653db3..97be529 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 _0xcb91=['save','update','emit','hasOwnProperty','hook','VoicePrefix','setMaxListeners'];(function(_0x2c59d3,_0x64a34a){var _0x55ad08=function(_0x4ade38){while(--_0x4ade38){_0x2c59d3['push'](_0x2c59d3['shift']());}};_0x55ad08(++_0x64a34a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0xcb91[_0x337748];return _0x3bb03f;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x1cb9('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){VoicePrefixEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);VoicePrefixEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];VoicePrefix[_0x1cb9('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','VoicePrefix','setMaxListeners'];(function(_0x2bc00e,_0x56c785){var _0x3ea41c=function(_0x1dbecf){while(--_0x1dbecf){_0x2bc00e['push'](_0x2bc00e['shift']());}};_0x3ea41c(++_0x56c785);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x49c4('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){VoicePrefixEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);VoicePrefixEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];VoicePrefix[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 1eae1ef..c89ee50 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 _0x30e0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x30e0,0x1e0));var _0x030e=function(_0x4d3924,_0x327b56){_0x4d3924=_0x4d3924-0x0;var _0x844555=_0x30e0[_0x4d3924];return _0x844555;};'use strict';var _=require(_0x030e('0x0'));var util=require(_0x030e('0x1'));var logger=require(_0x030e('0x2'))(_0x030e('0x3'));var moment=require(_0x030e('0x4'));var BPromise=require(_0x030e('0x5'));var rp=require(_0x030e('0x6'));var fs=require('fs');var path=require(_0x030e('0x7'));var rimraf=require(_0x030e('0x8'));var config=require(_0x030e('0x9'));var attributes=require(_0x030e('0xa'));module[_0x030e('0xb')]=function(_0x5ba7ba,_0x30e5c6){return _0x5ba7ba[_0x030e('0xc')](_0x030e('0xd'),attributes,{'tableName':_0x030e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bb9=['define','voice_prefixes','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voicePrefix.attributes'];(function(_0x419ede,_0x27f80b){var _0x2dc6b5=function(_0x552707){while(--_0x552707){_0x419ede['push'](_0x419ede['shift']());}};_0x2dc6b5(++_0x27f80b);}(_0x7bb9,0x1a6));var _0x97bb=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x7bb9[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0x97bb('0x0'));var util=require(_0x97bb('0x1'));var logger=require(_0x97bb('0x2'))('api');var moment=require('moment');var BPromise=require(_0x97bb('0x3'));var rp=require(_0x97bb('0x4'));var fs=require('fs');var path=require(_0x97bb('0x5'));var rimraf=require(_0x97bb('0x6'));var config=require('../../config/environment');var attributes=require(_0x97bb('0x7'));module['exports']=function(_0x446fdc,_0x2deb46){return _0x446fdc[_0x97bb('0x8')]('VoicePrefix',attributes,{'tableName':_0x97bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 6c24940..88e8e06 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 _0x1b1e=['request','then','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register'];(function(_0x3b33f5,_0x569e8f){var _0x1fb110=function(_0x45e0a6){while(--_0x45e0a6){_0x3b33f5['push'](_0x3b33f5['shift']());}};_0x1fb110(++_0x569e8f);}(_0x1b1e,0x1e7));var _0xe1b1=function(_0x160b08,_0x1e4b9d){_0x160b08=_0x160b08-0x0;var _0x5a96ec=_0x1b1e[_0x160b08];return _0x5a96ec;};'use strict';var _=require(_0xe1b1('0x0'));var util=require(_0xe1b1('0x1'));var moment=require(_0xe1b1('0x2'));var BPromise=require(_0xe1b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe1b1('0x4'));var db=require(_0xe1b1('0x5'))['db'];var utils=require(_0xe1b1('0x6'));var logger=require(_0xe1b1('0x7'))(_0xe1b1('0x8'));var config=require(_0xe1b1('0x9'));var jayson=require(_0xe1b1('0xa'));var client=jayson['client'][_0xe1b1('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe1b1('0xc')],{'host':_0xe1b1('0xd'),'port':0x18eb});var socket=require(_0xe1b1('0xe'))(new Redis(config['redis']));require(_0xe1b1('0xf'))[_0xe1b1('0x10')](socket);function respondWithRpcPromise(_0x4031c3,_0x5c826a,_0x42b56c){return new BPromise(function(_0x3a8d12,_0x27cc1d){return client[_0xe1b1('0x11')](_0x4031c3,_0x42b56c)[_0xe1b1('0x12')](function(_0x1026fc){logger[_0xe1b1('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x5c826a,_0xe1b1('0x14'));logger['debug'](_0xe1b1('0x15'),_0x5c826a,'request\x20sent',JSON[_0xe1b1('0x16')](_0x1026fc));if(_0x1026fc['error']){if(_0x1026fc[_0xe1b1('0x17')][_0xe1b1('0x18')]===0x1f4){logger[_0xe1b1('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x5c826a,_0x1026fc[_0xe1b1('0x17')]['message']);return _0x27cc1d(_0x1026fc[_0xe1b1('0x17')]['message']);}logger[_0xe1b1('0x17')](_0xe1b1('0x19'),_0x5c826a,_0x1026fc[_0xe1b1('0x17')][_0xe1b1('0x1a')]);return _0x3a8d12(_0x1026fc[_0xe1b1('0x17')][_0xe1b1('0x1a')]);}else{logger[_0xe1b1('0x13')](_0xe1b1('0x19'),_0x5c826a,_0xe1b1('0x14'));_0x3a8d12(_0x1026fc['result']['message']);}})[_0xe1b1('0x1b')](function(_0x191f14){logger[_0xe1b1('0x17')](_0xe1b1('0x19'),_0x5c826a,_0x191f14);_0x27cc1d(_0x191f14);});});} \ No newline at end of file +var _0x7e04=['request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','info','VoicePrefix,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7e04,0xd6));var _0x47e0=function(_0x3bb43c,_0x5e18f3){_0x3bb43c=_0x3bb43c-0x0;var _0x1c5bf9=_0x7e04[_0x3bb43c];return _0x1c5bf9;};'use strict';var _=require(_0x47e0('0x0'));var util=require(_0x47e0('0x1'));var moment=require(_0x47e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x47e0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x47e0('0x4'));var logger=require(_0x47e0('0x5'))('rpc');var config=require(_0x47e0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x47e0('0x7')][_0x47e0('0x8')]({'port':0x232a});config[_0x47e0('0x9')]=_['defaults'](config['redis'],{'host':_0x47e0('0xa'),'port':0x18eb});var socket=require(_0x47e0('0xb'))(new Redis(config[_0x47e0('0x9')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x3dc947,_0x142e5a,_0x10303c){return new BPromise(function(_0x2696f2,_0x2f7940){return client[_0x47e0('0xc')](_0x3dc947,_0x10303c)[_0x47e0('0xd')](function(_0x4db9cb){logger[_0x47e0('0xe')](_0x47e0('0xf'),_0x142e5a,_0x47e0('0x10'));logger[_0x47e0('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x142e5a,_0x47e0('0x10'),JSON[_0x47e0('0x12')](_0x4db9cb));if(_0x4db9cb[_0x47e0('0x13')]){if(_0x4db9cb['error'][_0x47e0('0x14')]===0x1f4){logger[_0x47e0('0x13')](_0x47e0('0xf'),_0x142e5a,_0x4db9cb[_0x47e0('0x13')][_0x47e0('0x15')]);return _0x2f7940(_0x4db9cb['error'][_0x47e0('0x15')]);}logger['error'](_0x47e0('0xf'),_0x142e5a,_0x4db9cb[_0x47e0('0x13')][_0x47e0('0x15')]);return _0x2696f2(_0x4db9cb[_0x47e0('0x13')][_0x47e0('0x15')]);}else{logger['info'](_0x47e0('0xf'),_0x142e5a,_0x47e0('0x10'));_0x2696f2(_0x4db9cb[_0x47e0('0x16')]['message']);}})['catch'](function(_0x31ffc7){logger[_0x47e0('0x13')](_0x47e0('0xf'),_0x142e5a,_0x31ffc7);_0x2f7940(_0x31ffc7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 9866070..c14c276 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 _0xb7be=['register','length','voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener'];(function(_0x5d4079,_0x5d1fd6){var _0x2b19f3=function(_0x401f5a){while(--_0x401f5a){_0x5d4079['push'](_0x5d4079['shift']());}};_0x2b19f3(++_0x5d1fd6);}(_0xb7be,0x150));var _0xeb7b=function(_0x5bab8e,_0x5a9ed6){_0x5bab8e=_0x5bab8e-0x0;var _0x3e14ea=_0xb7be[_0x5bab8e];return _0x3e14ea;};'use strict';var VoicePrefixEvents=require(_0xeb7b('0x0'));var events=[_0xeb7b('0x1'),_0xeb7b('0x2'),_0xeb7b('0x3')];function createListener(_0x88fa2a,_0x1d921c){return function(_0x11eb98){_0x1d921c[_0xeb7b('0x4')](_0x88fa2a,_0x11eb98);};}function removeListener(_0x52a37a,_0xd2210){return function(){VoicePrefixEvents[_0xeb7b('0x5')](_0x52a37a,_0xd2210);};}exports[_0xeb7b('0x6')]=function(_0x2f1613){for(var _0x424e8a=0x0,_0x35a9e4=events[_0xeb7b('0x7')];_0x424e8a<_0x35a9e4;_0x424e8a++){var _0x495468=events[_0x424e8a];var _0x2c92b7=createListener(_0xeb7b('0x8')+_0x495468,_0x2f1613);VoicePrefixEvents['on'](_0x495468,_0x2c92b7);}}; \ No newline at end of file +var _0xcbda=['removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','update'];(function(_0x16317e,_0x101c85){var _0x195004=function(_0xe6f93b){while(--_0xe6f93b){_0x16317e['push'](_0x16317e['shift']());}};_0x195004(++_0x101c85);}(_0xcbda,0xac));var _0xacbd=function(_0x29dce3,_0x4ab903){_0x29dce3=_0x29dce3-0x0;var _0x3b9abf=_0xcbda[_0x29dce3];return _0x3b9abf;};'use strict';var VoicePrefixEvents=require(_0xacbd('0x0'));var events=[_0xacbd('0x1'),_0xacbd('0x2'),_0xacbd('0x3')];function createListener(_0x3ba11d,_0x85e9ef){return function(_0x43857d){_0x85e9ef['emit'](_0x3ba11d,_0x43857d);};}function removeListener(_0x2f5677,_0x4e514f){return function(){VoicePrefixEvents[_0xacbd('0x4')](_0x2f5677,_0x4e514f);};}exports[_0xacbd('0x5')]=function(_0x423c7a){for(var _0x17b893=0x0,_0x3d472e=events[_0xacbd('0x6')];_0x17b893<_0x3d472e;_0x17b893++){var _0x4ed614=events[_0x17b893];var _0x1900d0=createListener(_0xacbd('0x7')+_0x4ed614,_0x423c7a);VoicePrefixEvents['on'](_0x4ed614,_0x1900d0);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 68bce64..24a8859 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 _0x1db0=['/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','addLists','delete','destroy','removeTeams','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','/:id/lists'];(function(_0x1e1858,_0x2bc0ec){var _0x4d8d7a=function(_0x2145eb){while(--_0x2145eb){_0x1e1858['push'](_0x1e1858['shift']());}};_0x4d8d7a(++_0x2bc0ec);}(_0x1db0,0x1e8));var _0x01db=function(_0x5cfb75,_0x224a85){_0x5cfb75=_0x5cfb75-0x0;var _0x2613d6=_0x1db0[_0x5cfb75];return _0x2613d6;};'use strict';var multer=require(_0x01db('0x0'));var util=require(_0x01db('0x1'));var path=require(_0x01db('0x2'));var timeout=require(_0x01db('0x3'));var express=require(_0x01db('0x4'));var router=express['Router']();var fs_extra=require(_0x01db('0x5'));var auth=require(_0x01db('0x6'));var interaction=require(_0x01db('0x7'));var config=require(_0x01db('0x8'));var controller=require(_0x01db('0x9'));router[_0x01db('0xa')]('/',auth[_0x01db('0xb')](),controller[_0x01db('0xc')]);router[_0x01db('0xa')](_0x01db('0xd'),auth['isAuthenticated'](),controller[_0x01db('0xe')]);router[_0x01db('0xa')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x01db('0xf')]);router['get'](_0x01db('0x10'),auth['isAuthenticated'](),controller[_0x01db('0x11')]);router[_0x01db('0xa')](_0x01db('0x12'),auth[_0x01db('0xb')](),controller[_0x01db('0x13')]);router[_0x01db('0xa')](_0x01db('0x14'),auth[_0x01db('0xb')](),controller[_0x01db('0x15')]);router[_0x01db('0xa')](_0x01db('0x16'),auth[_0x01db('0xb')](),controller[_0x01db('0x17')]);router['get'](_0x01db('0x18'),auth['isAuthenticated'](),controller[_0x01db('0x19')]);router[_0x01db('0xa')](_0x01db('0x1a'),auth[_0x01db('0xb')](),controller['getMembers']);router[_0x01db('0xa')](_0x01db('0x1b'),auth[_0x01db('0xb')](),controller['getLists']);router[_0x01db('0xa')](_0x01db('0x1c'),auth[_0x01db('0xb')](),controller[_0x01db('0x1d')]);router[_0x01db('0x1e')]('/',auth[_0x01db('0xb')](),controller[_0x01db('0x1f')]);router['post'](_0x01db('0x20'),auth['isAuthenticated'](),controller[_0x01db('0x21')]);router[_0x01db('0x1e')](_0x01db('0x16'),auth[_0x01db('0xb')](),controller[_0x01db('0x22')]);router[_0x01db('0x1e')](_0x01db('0x18'),auth[_0x01db('0xb')](),controller[_0x01db('0x23')]);router[_0x01db('0x1e')]('/:id/lists',auth[_0x01db('0xb')](),controller[_0x01db('0x24')]);router[_0x01db('0x1e')]('/:id/blacklists',auth[_0x01db('0xb')](),controller['addBlackLists']);router['put'](_0x01db('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x01db('0x25')](_0x01db('0xd'),auth[_0x01db('0xb')](),controller[_0x01db('0x26')]);router[_0x01db('0x25')](_0x01db('0x16'),auth[_0x01db('0xb')](),controller[_0x01db('0x27')]);router[_0x01db('0x25')](_0x01db('0x18'),auth['isAuthenticated'](),controller['removeAgents']);router[_0x01db('0x25')](_0x01db('0x1b'),auth[_0x01db('0xb')](),controller[_0x01db('0x28')]);router[_0x01db('0x25')]('/:id/blacklists',auth[_0x01db('0xb')](),controller[_0x01db('0x29')]);module[_0x01db('0x2a')]=router; \ No newline at end of file +var _0x34d2=['isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','getAgents','getMembers','/:id/lists','getBlackLists','post','create','/:id/clone','clone','/:id/teams','addTeams','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeTeams','removeLists','removeBlackLists','exports','util','Router','../../components/auth/service','../../components/interaction/service','get','/:id'];(function(_0x365056,_0x5afa4f){var _0x412743=function(_0x224968){while(--_0x224968){_0x365056['push'](_0x365056['shift']());}};_0x412743(++_0x5afa4f);}(_0x34d2,0x12a));var _0x234d=function(_0x199ecf,_0x28833b){_0x199ecf=_0x199ecf-0x0;var _0x4b2798=_0x34d2[_0x199ecf];return _0x4b2798;};'use strict';var multer=require('multer');var util=require(_0x234d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x234d('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x234d('0x2'));var interaction=require(_0x234d('0x3'));var config=require('../../config/environment');var controller=require('./voiceQueue.controller');router[_0x234d('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x234d('0x4')](_0x234d('0x5'),auth[_0x234d('0x6')](),controller[_0x234d('0x7')]);router['get'](_0x234d('0x8'),auth[_0x234d('0x6')](),controller[_0x234d('0x9')]);router[_0x234d('0x4')](_0x234d('0xa'),auth[_0x234d('0x6')](),controller[_0x234d('0xb')]);router['get']('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x234d('0xc')]);router['get'](_0x234d('0xd'),auth[_0x234d('0x6')](),controller[_0x234d('0xe')]);router[_0x234d('0x4')]('/:id/teams',auth[_0x234d('0x6')](),controller[_0x234d('0xf')]);router['get'](_0x234d('0x10'),auth[_0x234d('0x6')](),controller[_0x234d('0x11')]);router[_0x234d('0x4')]('/:id/members',auth['isAuthenticated'](),controller[_0x234d('0x12')]);router[_0x234d('0x4')](_0x234d('0x13'),auth[_0x234d('0x6')](),controller['getLists']);router[_0x234d('0x4')]('/:id/blacklists',auth[_0x234d('0x6')](),controller[_0x234d('0x14')]);router[_0x234d('0x15')]('/',auth['isAuthenticated'](),controller[_0x234d('0x16')]);router[_0x234d('0x15')](_0x234d('0x17'),auth[_0x234d('0x6')](),controller[_0x234d('0x18')]);router[_0x234d('0x15')](_0x234d('0x19'),auth[_0x234d('0x6')](),controller[_0x234d('0x1a')]);router[_0x234d('0x15')]('/:id/users',auth[_0x234d('0x6')](),controller['addAgents']);router['post'](_0x234d('0x13'),auth['isAuthenticated'](),controller[_0x234d('0x1b')]);router['post'](_0x234d('0x1c'),auth[_0x234d('0x6')](),controller[_0x234d('0x1d')]);router[_0x234d('0x1e')]('/:id',auth[_0x234d('0x6')](),controller[_0x234d('0x1f')]);router[_0x234d('0x20')](_0x234d('0x5'),auth[_0x234d('0x6')](),controller[_0x234d('0x21')]);router[_0x234d('0x20')](_0x234d('0x19'),auth['isAuthenticated'](),controller[_0x234d('0x22')]);router[_0x234d('0x20')](_0x234d('0x10'),auth[_0x234d('0x6')](),controller['removeAgents']);router['delete'](_0x234d('0x13'),auth[_0x234d('0x6')](),controller[_0x234d('0x23')]);router['delete']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x234d('0x24')]);module[_0x234d('0x25')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index e08b39b..68890d5 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 _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\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','onlyIfOpen','#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','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x24857e,_0x3370c){var _0x3401a6=function(_0x562da5){while(--_0x562da5){_0x24857e['push'](_0x24857e['shift']());}};_0x3401a6(++_0x3370c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\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','onlyIfOpen','#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','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x20823b,_0x88604f){var _0x4a7a50=function(_0x5a8890){while(--_0x5a8890){_0x20823b['push'](_0x20823b['shift']());}};_0x4a7a50(++_0x88604f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 37e6237..1da4eb5 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 _0x9bfb=['Team','teams','voicePause','interface','flatMap','penalty','Agents','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','forEach','emit','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','online','SIP/%s','isArray','getAgents','getMembers','CmList','getLists','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ListId','NOW()','scheduledAt','ContactId','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','into','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','get','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','name','destroy','then','end','stack','send','index','map','VoiceQueue','rawAttributes','fieldName','key','query','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','include','findAll','show','keys','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','inbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9bfb,0x1c0));var _0xb9bf=function(_0x218ca4,_0x41cc40){_0x218ca4=_0x218ca4-0x0;var _0x1b3ff9=_0x9bfb[_0x218ca4];return _0x1b3ff9;};'use strict';var emlformat=require(_0xb9bf('0x0'));var rimraf=require(_0xb9bf('0x1'));var zipdir=require(_0xb9bf('0x2'));var jsonpatch=require(_0xb9bf('0x3'));var rp=require(_0xb9bf('0x4'));var moment=require(_0xb9bf('0x5'));var BPromise=require(_0xb9bf('0x6'));var Mustache=require(_0xb9bf('0x7'));var util=require('util');var path=require(_0xb9bf('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9bf('0x9'));var _=require('lodash');var squel=require(_0xb9bf('0xa'));var crypto=require(_0xb9bf('0xb'));var jsforce=require(_0xb9bf('0xc'));var deskjs=require(_0xb9bf('0xd'));var toCsv=require(_0xb9bf('0xe'));var querystring=require('querystring');var Papa=require(_0xb9bf('0xf'));var Redis=require(_0xb9bf('0x10'));var authService=require(_0xb9bf('0x11'));var qs=require(_0xb9bf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9bf('0x13'));var logger=require('../../config/logger')(_0xb9bf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb9bf('0x15'))['db'];config['redis']=_[_0xb9bf('0x16')](config[_0xb9bf('0x17')],{'host':_0xb9bf('0x18'),'port':0x18eb});var socket=require(_0xb9bf('0x19'))(new Redis(config[_0xb9bf('0x17')]));require(_0xb9bf('0x1a'))[_0xb9bf('0x1b')](socket);function respondWithStatusCode(_0x56be0f,_0x306cc9){_0x306cc9=_0x306cc9||0xcc;return function(_0x273038){if(_0x273038){return _0x56be0f[_0xb9bf('0x1c')](_0x306cc9);}return _0x56be0f['status'](_0x306cc9)['end']();};}function respondWithResult(_0xa9e664,_0x42324c){_0x42324c=_0x42324c||0xc8;return function(_0x5b0e1a){if(_0x5b0e1a){return _0xa9e664[_0xb9bf('0x1d')](_0x42324c)[_0xb9bf('0x1e')](_0x5b0e1a);}};}function respondWithFilteredResult(_0x439de9,_0x16a81e){return function(_0x375ff9){if(_0x375ff9){var _0x45138a=_0x375ff9['count'],_0xb72759=_0x16a81e[_0xb9bf('0x1f')],_0x28bcba=_0x16a81e['offset']+_0x16a81e[_0xb9bf('0x20')],_0x56b7ef;if(_0x28bcba>=_0x45138a){_0x28bcba=_0x45138a;_0x56b7ef=0xc8;}else{_0x56b7ef=0xce;}_0x439de9[_0xb9bf('0x1d')](_0x56b7ef);return _0x439de9[_0xb9bf('0x21')](_0xb9bf('0x22'),_0xb72759+'-'+_0x28bcba+'/'+_0x45138a)[_0xb9bf('0x1e')](_0x375ff9);}return null;};}function patchUpdates(_0xd1e9cf){return function(_0xc9c964){try{jsonpatch[_0xb9bf('0x23')](_0xc9c964,_0xd1e9cf,!![]);}catch(_0x4bf359){return BPromise[_0xb9bf('0x24')](_0x4bf359);}return _0xc9c964[_0xb9bf('0x25')]();};}function saveUpdates(_0x440a20,_0x46d636){return function(_0x3758e3){if(_0x3758e3){return _0x3758e3[_0xb9bf('0x26')](_0x440a20)['then'](function(_0x47544a){return _0x47544a;});}return null;};}function removeEntity(_0x3098e6,_0x6a8149){return function(_0x54d005){if(_0x54d005){return _0x54d005['destroy']()['then'](function(){var _0x7471a5=_0x54d005[_0xb9bf('0x27')]({'plain':!![]});var _0x4f9ece=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0xb9bf('0x28'),'value':_0xb9bf('0x29'),'ignore':![]}];var _0x512b27=_(_0x4f9ece)[_0xb9bf('0x2a')](_0xb9bf('0x2b'))['map'](_0xb9bf('0x2c'))[_0xb9bf('0x2c')]();if(_[_0xb9bf('0x2d')](_0x512b27,_0x7471a5[_0xb9bf('0x2e')])){return;}var _0x536c30=_[_0xb9bf('0x2f')](_0x4f9ece,[_0xb9bf('0x2c'),_0x7471a5[_0xb9bf('0x2e')]])[_0xb9bf('0x30')];return db['UserProfileResource'][_0xb9bf('0x31')]({'where':{'type':_0x536c30,'resourceId':_0x7471a5['id']}})[_0xb9bf('0x32')](function(){return _0x54d005;});})['then'](function(){_0x3098e6[_0xb9bf('0x1d')](0xcc)[_0xb9bf('0x33')]();});}};}function handleEntityNotFound(_0x3d4c7b,_0x282dfb){return function(_0x241b59){if(!_0x241b59){_0x3d4c7b['sendStatus'](0x194);}return _0x241b59;};}function handleError(_0x1de822,_0x3172b7){_0x3172b7=_0x3172b7||0x1f4;return function(_0x5427ba){logger['error'](_0x5427ba[_0xb9bf('0x34')]);if(_0x5427ba[_0xb9bf('0x30')]){delete _0x5427ba[_0xb9bf('0x30')];}_0x1de822['status'](_0x3172b7)[_0xb9bf('0x35')](_0x5427ba);};}exports[_0xb9bf('0x36')]=function(_0x35aefb,_0x110068){var _0x353bb9={},_0x4c371d={},_0x40a822={'count':0x0,'rows':[]};var _0x3ca146=_[_0xb9bf('0x37')](db[_0xb9bf('0x38')][_0xb9bf('0x39')],function(_0xb091f5){return{'name':_0xb091f5[_0xb9bf('0x3a')],'type':_0xb091f5['type'][_0xb9bf('0x3b')]};});_0x4c371d['model']=_[_0xb9bf('0x37')](_0x3ca146,'name');_0x4c371d[_0xb9bf('0x3c')]=_['keys'](_0x35aefb[_0xb9bf('0x3c')]);_0x4c371d[_0xb9bf('0x3d')]=_['intersection'](_0x4c371d['model'],_0x4c371d[_0xb9bf('0x3c')]);_0x353bb9[_0xb9bf('0x3e')]=_[_0xb9bf('0x3f')](_0x4c371d['model'],qs['fields'](_0x35aefb[_0xb9bf('0x3c')][_0xb9bf('0x40')]));_0x353bb9[_0xb9bf('0x3e')]=_0x353bb9['attributes'][_0xb9bf('0x41')]?_0x353bb9[_0xb9bf('0x3e')]:_0x4c371d[_0xb9bf('0x42')];if(!_0x35aefb['query'][_0xb9bf('0x43')](_0xb9bf('0x44'))){_0x353bb9['limit']=qs['limit'](_0x35aefb['query'][_0xb9bf('0x20')]);_0x353bb9['offset']=qs[_0xb9bf('0x1f')](_0x35aefb['query'][_0xb9bf('0x1f')]);}_0x353bb9[_0xb9bf('0x45')]=qs['sort'](_0x35aefb[_0xb9bf('0x3c')][_0xb9bf('0x46')]);_0x353bb9[_0xb9bf('0x47')]=qs[_0xb9bf('0x3d')](_[_0xb9bf('0x48')](_0x35aefb['query'],_0x4c371d['filters']),_0x3ca146);if(_0x35aefb[_0xb9bf('0x3c')]['filter']){_0x353bb9[_0xb9bf('0x47')]=_[_0xb9bf('0x49')](_0x353bb9[_0xb9bf('0x47')],{'$or':_[_0xb9bf('0x37')](_0x3ca146,function(_0x44ae71){if(_0x44ae71[_0xb9bf('0x2e')]!==_0xb9bf('0x4a')){var _0x2588a8={};_0x2588a8[_0x44ae71[_0xb9bf('0x30')]]={'$like':'%'+_0x35aefb['query'][_0xb9bf('0x2a')]+'%'};return _0x2588a8;}})});}_0x353bb9=_[_0xb9bf('0x49')]({},_0x353bb9,_0x35aefb[_0xb9bf('0x4b')]);var _0x5034ad={'where':_0x353bb9[_0xb9bf('0x47')]};return db['VoiceQueue']['count'](_0x5034ad)[_0xb9bf('0x32')](function(_0x57ae18){_0x40a822[_0xb9bf('0x4c')]=_0x57ae18;if(_0x35aefb[_0xb9bf('0x3c')]['includeAll']){_0x353bb9[_0xb9bf('0x4d')]=[{'all':!![]}];}return db[_0xb9bf('0x38')][_0xb9bf('0x4e')](_0x353bb9);})[_0xb9bf('0x32')](function(_0xec6cc1){_0x40a822['rows']=_0xec6cc1;return _0x40a822;})[_0xb9bf('0x32')](respondWithFilteredResult(_0x110068,_0x353bb9))['catch'](handleError(_0x110068,null));};exports[_0xb9bf('0x4f')]=function(_0x2ab3b8,_0x97828b){var _0xdd5db3={'raw':![],'where':{'id':_0x2ab3b8['params']['id']}},_0x29dddc={};_0x29dddc[_0xb9bf('0x42')]=_[_0xb9bf('0x50')](db[_0xb9bf('0x38')][_0xb9bf('0x39')]);_0x29dddc[_0xb9bf('0x3c')]=_[_0xb9bf('0x50')](_0x2ab3b8[_0xb9bf('0x3c')]);_0x29dddc[_0xb9bf('0x3d')]=_[_0xb9bf('0x3f')](_0x29dddc[_0xb9bf('0x42')],_0x29dddc[_0xb9bf('0x3c')]);_0xdd5db3[_0xb9bf('0x3e')]=_[_0xb9bf('0x3f')](_0x29dddc[_0xb9bf('0x42')],qs[_0xb9bf('0x40')](_0x2ab3b8[_0xb9bf('0x3c')][_0xb9bf('0x40')]));_0xdd5db3[_0xb9bf('0x3e')]=_0xdd5db3[_0xb9bf('0x3e')][_0xb9bf('0x41')]?_0xdd5db3[_0xb9bf('0x3e')]:_0x29dddc[_0xb9bf('0x42')];if(_0x2ab3b8[_0xb9bf('0x3c')][_0xb9bf('0x51')]){_0xdd5db3[_0xb9bf('0x4d')]=[{'all':!![]}];}_0xdd5db3=_[_0xb9bf('0x49')]({},_0xdd5db3,_0x2ab3b8['options']);return db[_0xb9bf('0x38')][_0xb9bf('0x2f')](_0xdd5db3)[_0xb9bf('0x32')](handleEntityNotFound(_0x97828b,null))[_0xb9bf('0x32')](respondWithResult(_0x97828b,null))[_0xb9bf('0x52')](handleError(_0x97828b,null));};exports['create']=function(_0x490d8f,_0x52b326){return db[_0xb9bf('0x38')][_0xb9bf('0x53')](_0x490d8f[_0xb9bf('0x54')],{})['then'](function(_0x19f091){var _0x18d353=_0x490d8f[_0xb9bf('0x55')]['get']({'plain':!![]});if(!_0x18d353)throw new Error(_0xb9bf('0x56'));if(_0x18d353[_0xb9bf('0x57')]===_0xb9bf('0x55')){var _0x2fd267=_0x19f091['get']({'plain':!![]});var _0x14b2a9=[{'name':_0xb9bf('0x58'),'value':_0xb9bf('0x59')},{'name':_0xb9bf('0x28'),'value':_0xb9bf('0x29')}];var _0xada234=_['find'](_0x14b2a9,['value',_0x2fd267[_0xb9bf('0x2e')]])[_0xb9bf('0x30')];return db[_0xb9bf('0x5a')][_0xb9bf('0x2f')]({'where':{'name':_0xada234,'userProfileId':_0x18d353[_0xb9bf('0x5b')]},'raw':!![]})['then'](function(_0x538974){if(_0x538974&&_0x538974[_0xb9bf('0x5c')]===0x0){return db[_0xb9bf('0x5d')]['create']({'name':_0x2fd267[_0xb9bf('0x30')],'resourceId':_0x2fd267['id'],'type':_0x538974[_0xb9bf('0x30')],'sectionId':_0x538974['id']},{})[_0xb9bf('0x32')](function(){return _0x19f091;});}else{return _0x19f091;}})[_0xb9bf('0x52')](function(_0x864ad9){logger[_0xb9bf('0x5e')](_0xb9bf('0x5f'),_0x864ad9);throw _0x864ad9;});}return _0x19f091;})[_0xb9bf('0x32')](respondWithResult(_0x52b326,0xc9))['catch'](handleError(_0x52b326,null));};exports[_0xb9bf('0x60')]=function(_0x2139fe,_0x4157bd){var _0x157af1={'where':{'id':_0x2139fe[_0xb9bf('0x61')]['id']}},_0x159291={};_0x159291['model']=_['keys'](db[_0xb9bf('0x38')][_0xb9bf('0x39')]);_0x157af1['attributes']=_[_0xb9bf('0x3f')](_0x159291[_0xb9bf('0x42')],qs[_0xb9bf('0x40')](_0x2139fe[_0xb9bf('0x3c')][_0xb9bf('0x40')]));_0x157af1[_0xb9bf('0x3e')]=_0x157af1[_0xb9bf('0x3e')][_0xb9bf('0x41')]?_0x157af1[_0xb9bf('0x3e')]:_0x159291[_0xb9bf('0x42')];if(_0x2139fe['query'][_0xb9bf('0x51')]){_0x157af1[_0xb9bf('0x4d')]=[{'all':!![]}];}_0x157af1=_['merge']({},_0x157af1,_0x2139fe['options']);return db[_0xb9bf('0x38')][_0xb9bf('0x2f')](_0x157af1)[_0xb9bf('0x32')](handleEntityNotFound(_0x4157bd,null))[_0xb9bf('0x32')](function(_0x10be77){if(_0x10be77){var _0x2e102a=_0x10be77[_0xb9bf('0x27')]({'plain':!![]});_0x2e102a=qs[_0xb9bf('0x62')](_0x2e102a,['id',_0xb9bf('0x63'),_0xb9bf('0x64')]);_0x2139fe['body']=_[_0xb9bf('0x62')](_0x2139fe[_0xb9bf('0x54')],['id',_0xb9bf('0x63'),_0xb9bf('0x64')]);return db[_0xb9bf('0x38')][_0xb9bf('0x53')](_[_0xb9bf('0x49')](_0x2e102a,_0x2139fe[_0xb9bf('0x54')]),{'include':_0x2139fe[_0xb9bf('0x3c')][_0xb9bf('0x51')]?[{'all':!![]}]:undefined})['then'](function(_0x447724){var _0x818bd0=_0x2139fe[_0xb9bf('0x55')][_0xb9bf('0x27')]({'plain':!![]});if(!_0x818bd0)throw new Error(_0xb9bf('0x56'));if(_0x818bd0[_0xb9bf('0x57')]===_0xb9bf('0x55')){var _0x5b0859=_0x447724[_0xb9bf('0x27')]({'plain':!![]});var _0x2a0b89=[{'name':_0xb9bf('0x58'),'value':_0xb9bf('0x59')},{'name':'QueueCampaigns','value':'outbound'}];var _0x48e035=_['find'](_0x2a0b89,[_0xb9bf('0x2c'),_0x5b0859[_0xb9bf('0x2e')]])['name'];return db['UserProfileSection'][_0xb9bf('0x2f')]({'where':{'name':_0x48e035,'userProfileId':_0x818bd0[_0xb9bf('0x5b')]},'raw':!![]})[_0xb9bf('0x32')](function(_0x25911d){if(_0x25911d&&_0x25911d[_0xb9bf('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0x5b0859[_0xb9bf('0x30')],'resourceId':_0x5b0859['id'],'type':_0x25911d[_0xb9bf('0x30')],'sectionId':_0x25911d['id']},{})[_0xb9bf('0x32')](function(){return _0x447724;});}else{return _0x447724;}})['catch'](function(_0x2e0735){logger[_0xb9bf('0x5e')](_0xb9bf('0x5f'),_0x2e0735);throw _0x2e0735;});}return _0x447724;});}})[_0xb9bf('0x32')](respondWithResult(_0x4157bd,0xc9))[_0xb9bf('0x52')](handleError(_0x4157bd,null));};exports[_0xb9bf('0x26')]=function(_0x12c6bd,_0x2ae4a0){if(_0x12c6bd[_0xb9bf('0x54')]['id']){delete _0x12c6bd[_0xb9bf('0x54')]['id'];}return db[_0xb9bf('0x38')][_0xb9bf('0x2f')]({'where':{'id':_0x12c6bd[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x2ae4a0,null))[_0xb9bf('0x32')](saveUpdates(_0x12c6bd[_0xb9bf('0x54')],null))['then'](respondWithResult(_0x2ae4a0,null))[_0xb9bf('0x52')](handleError(_0x2ae4a0,null));};exports[_0xb9bf('0x31')]=function(_0x12f2ab,_0x18e763){return db[_0xb9bf('0x38')][_0xb9bf('0x2f')]({'where':{'id':_0x12f2ab[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x18e763,null))[_0xb9bf('0x32')](removeEntity(_0x18e763,null))[_0xb9bf('0x52')](handleError(_0x18e763,null));};exports[_0xb9bf('0x65')]=function(_0x21ea92,_0x73aeb6,_0x23be45){var _0x595a00={'raw':![],'where':{}};var _0x5df005={};var _0x539217={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xb9bf('0x66')]({'where':{'id':_0x21ea92[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x73aeb6,null))[_0xb9bf('0x32')](function(_0x53c970){if(_0x53c970){_0x5df005[_0xb9bf('0x42')]=_[_0xb9bf('0x50')](db[_0xb9bf('0x67')][_0xb9bf('0x39')]);_0x5df005[_0xb9bf('0x3c')]=_['keys'](_0x21ea92[_0xb9bf('0x3c')]);_0x5df005[_0xb9bf('0x3d')]=_['intersection'](_0x5df005['model'],_0x5df005[_0xb9bf('0x3c')]);_0x595a00[_0xb9bf('0x3e')]=_[_0xb9bf('0x3f')](_0x5df005[_0xb9bf('0x42')],qs['fields'](_0x21ea92['query'][_0xb9bf('0x40')]));_0x595a00[_0xb9bf('0x3e')]=_0x595a00[_0xb9bf('0x3e')][_0xb9bf('0x41')]?_0x595a00[_0xb9bf('0x3e')]:_0x5df005[_0xb9bf('0x42')];if(!_0x21ea92[_0xb9bf('0x3c')]['hasOwnProperty'](_0xb9bf('0x44'))){_0x595a00['limit']=qs['limit'](_0x21ea92[_0xb9bf('0x3c')][_0xb9bf('0x20')]);_0x595a00[_0xb9bf('0x1f')]=qs['offset'](_0x21ea92[_0xb9bf('0x3c')][_0xb9bf('0x1f')]);}_0x595a00['order']=qs[_0xb9bf('0x46')](_0x21ea92[_0xb9bf('0x3c')]['sort']);_0x595a00[_0xb9bf('0x47')]=qs[_0xb9bf('0x3d')](_[_0xb9bf('0x48')](_0x21ea92[_0xb9bf('0x3c')],_0x5df005['filters']));_0x595a00[_0xb9bf('0x47')][_0xb9bf('0x68')]=_0x53c970['id'];if(_0x21ea92[_0xb9bf('0x3c')][_0xb9bf('0x2a')]){_0x595a00[_0xb9bf('0x47')]=_['merge'](_0x595a00[_0xb9bf('0x47')],{'$or':_[_0xb9bf('0x37')](_0x595a00[_0xb9bf('0x3e')],function(_0x37fe2b){var _0xced5fc={};_0xced5fc[_0x37fe2b]={'$like':'%'+_0x21ea92['query'][_0xb9bf('0x2a')]+'%'};return _0xced5fc;})});}_0x595a00=_[_0xb9bf('0x49')]({},_0x595a00,_0x21ea92[_0xb9bf('0x4b')]);return db[_0xb9bf('0x67')]['count']({'where':_0x595a00[_0xb9bf('0x47')]})[_0xb9bf('0x32')](function(_0x5a439c){_0x539217[_0xb9bf('0x4c')]=_0x5a439c;if(_0x21ea92[_0xb9bf('0x3c')][_0xb9bf('0x51')]){_0x595a00[_0xb9bf('0x4d')]=[{'all':!![]}];}return db[_0xb9bf('0x67')][_0xb9bf('0x4e')](_0x595a00);})[_0xb9bf('0x32')](function(_0x7c8610){_0x539217[_0xb9bf('0x69')]=_0x7c8610;return _0x539217;});}})['then'](respondWithFilteredResult(_0x73aeb6,_0x595a00))[_0xb9bf('0x52')](handleError(_0x73aeb6,null));};exports[_0xb9bf('0x6a')]=function(_0x11b208,_0x3c2142,_0x43acb2){var _0x58c446={'raw':!![],'where':{}};var _0x1b551a={};var _0x3af337={'count':0x0,'rows':[]};return db[_0xb9bf('0x38')][_0xb9bf('0x66')]({'where':{'id':_0x11b208[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x3c2142,null))[_0xb9bf('0x32')](function(_0x1a61a9){if(_0x1a61a9){_0x1b551a[_0xb9bf('0x42')]=_[_0xb9bf('0x50')](db[_0xb9bf('0x6b')][_0xb9bf('0x39')]);_0x1b551a[_0xb9bf('0x3c')]=_[_0xb9bf('0x50')](_0x11b208['query']);_0x1b551a[_0xb9bf('0x3d')]=_[_0xb9bf('0x3f')](_0x1b551a[_0xb9bf('0x42')],_0x1b551a[_0xb9bf('0x3c')]);_0x58c446[_0xb9bf('0x3e')]=_[_0xb9bf('0x3f')](_0x1b551a[_0xb9bf('0x42')],qs[_0xb9bf('0x40')](_0x11b208[_0xb9bf('0x3c')]['fields']));_0x58c446[_0xb9bf('0x3e')]=_0x58c446[_0xb9bf('0x3e')]['length']?_0x58c446[_0xb9bf('0x3e')]:_0x1b551a['model'];if(!_0x11b208[_0xb9bf('0x3c')][_0xb9bf('0x43')]('nolimit')){_0x58c446[_0xb9bf('0x20')]=qs['limit'](_0x11b208[_0xb9bf('0x3c')]['limit']);_0x58c446['offset']=qs[_0xb9bf('0x1f')](_0x11b208[_0xb9bf('0x3c')][_0xb9bf('0x1f')]);}_0x58c446[_0xb9bf('0x45')]=qs[_0xb9bf('0x46')](_0x11b208[_0xb9bf('0x3c')][_0xb9bf('0x46')]);_0x58c446['where']=qs[_0xb9bf('0x3d')](_[_0xb9bf('0x48')](_0x11b208[_0xb9bf('0x3c')],_0x1b551a[_0xb9bf('0x3d')]));_0x58c446[_0xb9bf('0x47')]['VoiceQueueId']=_0x1a61a9['id'];if(_0x11b208[_0xb9bf('0x3c')][_0xb9bf('0x2a')]){_0x58c446['where']=_[_0xb9bf('0x49')](_0x58c446[_0xb9bf('0x47')],{'$or':_[_0xb9bf('0x37')](_0x58c446['attributes'],function(_0xfcf825){var _0x42fb80={};_0x42fb80[_0xfcf825]={'$like':'%'+_0x11b208[_0xb9bf('0x3c')]['filter']+'%'};return _0x42fb80;})});}_0x58c446=_[_0xb9bf('0x49')]({},_0x58c446,_0x11b208['options']);return db[_0xb9bf('0x6b')][_0xb9bf('0x4c')]({'where':_0x58c446[_0xb9bf('0x47')]})[_0xb9bf('0x32')](function(_0x53f7d6){_0x3af337[_0xb9bf('0x4c')]=_0x53f7d6;if(_0x11b208['query'][_0xb9bf('0x51')]){_0x58c446[_0xb9bf('0x4d')]=[{'all':!![]}];}return db[_0xb9bf('0x6b')][_0xb9bf('0x4e')](_0x58c446);})[_0xb9bf('0x32')](function(_0x1d5a58){_0x3af337[_0xb9bf('0x69')]=_0x1d5a58;return _0x3af337;});}})[_0xb9bf('0x32')](respondWithFilteredResult(_0x3c2142,_0x58c446))['catch'](handleError(_0x3c2142,null));};exports[_0xb9bf('0x6c')]=function(_0x2b74d0,_0xb0710f,_0x41fb88){var _0x59ea5f={'raw':!![],'where':{}};var _0xe6f445={};var _0x200921={'count':0x0,'rows':[]};return db[_0xb9bf('0x38')]['findOne']({'where':{'id':_0x2b74d0[_0xb9bf('0x61')]['id']}})['then'](handleEntityNotFound(_0xb0710f,null))[_0xb9bf('0x32')](function(_0x3a8544){if(_0x3a8544){_0xe6f445[_0xb9bf('0x42')]=_['keys'](db[_0xb9bf('0x6d')][_0xb9bf('0x39')]);_0xe6f445[_0xb9bf('0x3c')]=_['keys'](_0x2b74d0[_0xb9bf('0x3c')]);_0xe6f445['filters']=_['intersection'](_0xe6f445[_0xb9bf('0x42')],_0xe6f445[_0xb9bf('0x3c')]);_0x59ea5f[_0xb9bf('0x3e')]=_['intersection'](_0xe6f445[_0xb9bf('0x42')],qs['fields'](_0x2b74d0[_0xb9bf('0x3c')][_0xb9bf('0x40')]));_0x59ea5f[_0xb9bf('0x3e')]=_0x59ea5f[_0xb9bf('0x3e')][_0xb9bf('0x41')]?_0x59ea5f['attributes']:_0xe6f445[_0xb9bf('0x42')];if(!_0x2b74d0[_0xb9bf('0x3c')]['hasOwnProperty'](_0xb9bf('0x44'))){_0x59ea5f[_0xb9bf('0x20')]=qs[_0xb9bf('0x20')](_0x2b74d0[_0xb9bf('0x3c')][_0xb9bf('0x20')]);_0x59ea5f[_0xb9bf('0x1f')]=qs[_0xb9bf('0x1f')](_0x2b74d0[_0xb9bf('0x3c')][_0xb9bf('0x1f')]);}_0x59ea5f[_0xb9bf('0x45')]=qs[_0xb9bf('0x46')](_0x2b74d0[_0xb9bf('0x3c')]['sort']);_0x59ea5f['where']=qs['filters'](_[_0xb9bf('0x48')](_0x2b74d0[_0xb9bf('0x3c')],_0xe6f445[_0xb9bf('0x3d')]));_0x59ea5f[_0xb9bf('0x47')]['VoiceQueueId']=_0x3a8544['id'];if(_0x2b74d0[_0xb9bf('0x3c')][_0xb9bf('0x2a')]){_0x59ea5f[_0xb9bf('0x47')]=_[_0xb9bf('0x49')](_0x59ea5f[_0xb9bf('0x47')],{'$or':_[_0xb9bf('0x37')](_0x59ea5f['attributes'],function(_0x1c1564){var _0x55f74b={};_0x55f74b[_0x1c1564]={'$like':'%'+_0x2b74d0['query'][_0xb9bf('0x2a')]+'%'};return _0x55f74b;})});}_0x59ea5f=_[_0xb9bf('0x49')]({},_0x59ea5f,_0x2b74d0[_0xb9bf('0x4b')]);return db[_0xb9bf('0x6d')][_0xb9bf('0x4c')]({'where':_0x59ea5f[_0xb9bf('0x47')]})[_0xb9bf('0x32')](function(_0x124d53){_0x200921[_0xb9bf('0x4c')]=_0x124d53;if(_0x2b74d0[_0xb9bf('0x3c')][_0xb9bf('0x51')]){_0x59ea5f[_0xb9bf('0x4d')]=[{'all':!![]}];}return db[_0xb9bf('0x6d')][_0xb9bf('0x4e')](_0x59ea5f);})[_0xb9bf('0x32')](function(_0x56f676){_0x200921[_0xb9bf('0x69')]=_0x56f676;return _0x200921;});}})[_0xb9bf('0x32')](respondWithFilteredResult(_0xb0710f,_0x59ea5f))[_0xb9bf('0x52')](handleError(_0xb0710f,null));};exports[_0xb9bf('0x6e')]=function(_0x49ed99,_0x28735a,_0x74bc67){var _0x1c0b0e={'raw':!![],'where':{}};var _0xb6a14e={};var _0x3fbf87={'count':0x0,'rows':[]};return db[_0xb9bf('0x38')][_0xb9bf('0x66')]({'where':{'id':_0x49ed99[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x28735a,null))['then'](function(_0x56422e){if(_0x56422e){_0xb6a14e['model']=_[_0xb9bf('0x50')](db[_0xb9bf('0x6f')][_0xb9bf('0x39')]);_0xb6a14e[_0xb9bf('0x3c')]=_[_0xb9bf('0x50')](_0x49ed99[_0xb9bf('0x3c')]);_0xb6a14e[_0xb9bf('0x3d')]=_[_0xb9bf('0x3f')](_0xb6a14e[_0xb9bf('0x42')],_0xb6a14e[_0xb9bf('0x3c')]);_0x1c0b0e[_0xb9bf('0x3e')]=_[_0xb9bf('0x3f')](_0xb6a14e[_0xb9bf('0x42')],qs['fields'](_0x49ed99['query'][_0xb9bf('0x40')]));_0x1c0b0e[_0xb9bf('0x3e')]=_0x1c0b0e['attributes'][_0xb9bf('0x41')]?_0x1c0b0e[_0xb9bf('0x3e')]:_0xb6a14e[_0xb9bf('0x42')];if(!_0x49ed99['query'][_0xb9bf('0x43')](_0xb9bf('0x44'))){_0x1c0b0e[_0xb9bf('0x20')]=qs[_0xb9bf('0x20')](_0x49ed99[_0xb9bf('0x3c')][_0xb9bf('0x20')]);_0x1c0b0e[_0xb9bf('0x1f')]=qs[_0xb9bf('0x1f')](_0x49ed99['query'][_0xb9bf('0x1f')]);}_0x1c0b0e['order']=qs[_0xb9bf('0x46')](_0x49ed99[_0xb9bf('0x3c')]['sort']);_0x1c0b0e[_0xb9bf('0x47')]=qs[_0xb9bf('0x3d')](_[_0xb9bf('0x48')](_0x49ed99[_0xb9bf('0x3c')],_0xb6a14e['filters']));_0x1c0b0e[_0xb9bf('0x47')][_0xb9bf('0x68')]=_0x56422e['id'];if(_0x49ed99[_0xb9bf('0x3c')][_0xb9bf('0x2a')]){_0x1c0b0e[_0xb9bf('0x47')]=_['merge'](_0x1c0b0e[_0xb9bf('0x47')],{'$or':_[_0xb9bf('0x37')](_0x1c0b0e[_0xb9bf('0x3e')],function(_0x354d7c){var _0x410689={};_0x410689[_0x354d7c]={'$like':'%'+_0x49ed99[_0xb9bf('0x3c')]['filter']+'%'};return _0x410689;})});}_0x1c0b0e=_[_0xb9bf('0x49')]({},_0x1c0b0e,_0x49ed99[_0xb9bf('0x4b')]);return db[_0xb9bf('0x6f')][_0xb9bf('0x4c')]({'where':_0x1c0b0e[_0xb9bf('0x47')]})['then'](function(_0x79a9bf){_0x3fbf87[_0xb9bf('0x4c')]=_0x79a9bf;if(_0x49ed99['query'][_0xb9bf('0x51')]){_0x1c0b0e[_0xb9bf('0x4d')]=[{'all':!![]}];}return db[_0xb9bf('0x6f')]['findAll'](_0x1c0b0e);})['then'](function(_0x49666b){_0x3fbf87['rows']=_0x49666b;return _0x3fbf87;});}})[_0xb9bf('0x32')](respondWithFilteredResult(_0x28735a,_0x1c0b0e))[_0xb9bf('0x52')](handleError(_0x28735a,null));};exports[_0xb9bf('0x70')]=function(_0xc668c8,_0x1a0ac3,_0x250993){var _0x110d75={};var _0x4b7901={};var _0x3d2833;var _0xf56709;return db['VoiceQueue']['findOne']({'where':{'id':_0xc668c8[_0xb9bf('0x61')]['id']}})['then'](handleEntityNotFound(_0x1a0ac3,null))[_0xb9bf('0x32')](function(_0x10dde2){if(_0x10dde2){_0x3d2833=_0x10dde2;_0x4b7901[_0xb9bf('0x42')]=_['keys'](db[_0xb9bf('0x71')][_0xb9bf('0x39')]);_0x4b7901[_0xb9bf('0x3c')]=_['keys'](_0xc668c8[_0xb9bf('0x3c')]);_0x4b7901[_0xb9bf('0x3d')]=_[_0xb9bf('0x3f')](_0x4b7901[_0xb9bf('0x42')],_0x4b7901[_0xb9bf('0x3c')]);_0x110d75[_0xb9bf('0x3e')]=_[_0xb9bf('0x3f')](_0x4b7901[_0xb9bf('0x42')],qs[_0xb9bf('0x40')](_0xc668c8[_0xb9bf('0x3c')][_0xb9bf('0x40')]));_0x110d75[_0xb9bf('0x3e')]=_0x110d75[_0xb9bf('0x3e')][_0xb9bf('0x41')]?_0x110d75['attributes']:_0x4b7901[_0xb9bf('0x42')];_0x110d75[_0xb9bf('0x45')]=qs['sort'](_0xc668c8[_0xb9bf('0x3c')][_0xb9bf('0x46')]);_0x110d75['where']=qs[_0xb9bf('0x3d')](_['pick'](_0xc668c8[_0xb9bf('0x3c')],_0x4b7901[_0xb9bf('0x3d')]));if(_0xc668c8[_0xb9bf('0x3c')][_0xb9bf('0x2a')]){_0x110d75[_0xb9bf('0x47')]=_['merge'](_0x110d75[_0xb9bf('0x47')],{'$or':_[_0xb9bf('0x37')](_0x110d75[_0xb9bf('0x3e')],function(_0x42b073){var _0x4d8bd3={};_0x4d8bd3[_0x42b073]={'$like':'%'+_0xc668c8[_0xb9bf('0x3c')]['filter']+'%'};return _0x4d8bd3;})});}_0x110d75=_[_0xb9bf('0x49')]({},_0x110d75,_0xc668c8[_0xb9bf('0x4b')]);return _0x3d2833['getTeams'](_0x110d75);}})[_0xb9bf('0x32')](function(_0x4c4c87){if(_0x4c4c87){_0xf56709=_0x4c4c87[_0xb9bf('0x41')];if(!_0xc668c8[_0xb9bf('0x3c')][_0xb9bf('0x43')](_0xb9bf('0x44'))){_0x110d75[_0xb9bf('0x20')]=qs[_0xb9bf('0x20')](_0xc668c8['query'][_0xb9bf('0x20')]);_0x110d75['offset']=qs[_0xb9bf('0x1f')](_0xc668c8[_0xb9bf('0x3c')][_0xb9bf('0x1f')]);}return _0x3d2833[_0xb9bf('0x70')](_0x110d75);}})[_0xb9bf('0x32')](function(_0x51f59c){if(_0x51f59c){return _0x51f59c?{'count':_0xf56709,'rows':_0x51f59c}:null;}})['then'](respondWithResult(_0x1a0ac3,null))[_0xb9bf('0x52')](handleError(_0x1a0ac3,null));};exports['addTeams']=function(_0x391659,_0x1f981c,_0x2765bd){var _0x369179=_0x391659['body'][_0xb9bf('0x72')];var _0x484a17=_[_0xb9bf('0x37')](_0x369179,'id');return db[_0xb9bf('0x71')][_0xb9bf('0x4e')]({'where':{'id':_0x484a17},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb9bf('0x30'),'online',_0xb9bf('0x73'),_0xb9bf('0x74')],'raw':!![]}]})[_0xb9bf('0x32')](function(_0xdf187d){if(_0xdf187d){var _0x3caf36=_[_0xb9bf('0x75')](_0xdf187d,function(_0x177759){var _0x4a5b3f=_0x177759[_0xb9bf('0x27')]({'plain':!![]});_0x4a5b3f['Agents']['forEach'](function(_0x3ec790){_0x3ec790[_0xb9bf('0x76')]=_['find'](_0x369179,{'id':_0x4a5b3f['id']})[_0xb9bf('0x76')];});return _0x4a5b3f[_0xb9bf('0x77')];});return db['VoiceQueue'][_0xb9bf('0x2f')]({'where':{'id':_0x391659[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](function(_0x578468){return db['sequelize'][_0xb9bf('0x78')](function(_0x1caa23){return _0x578468['addTeams'](_0x484a17,{'transaction':_0x1caa23})['then'](function(){return BPromise[_0xb9bf('0x79')](_0x369179,function(_0x4a929f){return db[_0xb9bf('0x7a')][_0xb9bf('0x7b')]({'TeamId':_0x4a929f['id'],'VoiceQueueId':_0x391659['params']['id'],'penalty':_0x4a929f['penalty']},{'transaction':_0x1caa23});});})[_0xb9bf('0x32')](function(){return BPromise[_0xb9bf('0x79')](_0x3caf36,function(_0x4b8478){return db['UserVoiceQueue'][_0xb9bf('0x7c')]({'where':{'UserId':_0x4b8478['id'],'VoiceQueueId':_0x391659[_0xb9bf('0x61')]['id']},'defaults':{'penalty':_0x4b8478[_0xb9bf('0x76')]},'transaction':_0x1caa23});});})[_0xb9bf('0x32')](function(){return BPromise['each'](_['filter'](_0x3caf36,{'online':!![]}),function(_0x48f827){return db[_0xb9bf('0x7d')][_0xb9bf('0x7b')]({'membername':_0x48f827['name'],'UserId':_0x48f827['id'],'queue_name':_0x578468['name'],'VoiceQueueId':_0x578468['id'],'interface':_[_0xb9bf('0x7e')](_0x48f827['interface'])?util[_0xb9bf('0x7f')]('SIP/%s',_0x48f827[_0xb9bf('0x30')]):_0x48f827[_0xb9bf('0x74')],'paused':_0x48f827[_0xb9bf('0x73')]||![],'penalty':_0x48f827[_0xb9bf('0x76')]},{'transaction':_0x1caa23});});})[_0xb9bf('0x32')](function(){_0x3caf36[_0xb9bf('0x80')](function(_0x539574){socket[_0xb9bf('0x81')](_0xb9bf('0x82'),{'UserId':_0x539574['id'],'VoiceQueueId':_0x578468['id']});});});});});}})[_0xb9bf('0x32')](respondWithStatusCode(_0x1f981c,null))['catch'](handleError(_0x1f981c,null));};exports[_0xb9bf('0x83')]=function(_0x2f09c7,_0x1e079f,_0x559c93){return db[_0xb9bf('0x71')]['findAll']({'where':{'id':_0x2f09c7['query'][_0xb9bf('0x84')]},'attributes':['id'],'include':[{'model':db[_0xb9bf('0x85')],'as':_0xb9bf('0x77'),'attributes':['id'],'raw':!![]}]})[_0xb9bf('0x32')](handleEntityNotFound(_0x1e079f,null))[_0xb9bf('0x32')](function(_0xac3ea9){var _0x3a9b10=_[_0xb9bf('0x37')](_0xac3ea9,'id');var _0x564c56=[];var _0x278ff1=[];var _0x333f4e=squel[_0xb9bf('0x86')]();_0x333f4e[_0xb9bf('0x87')](_0xb9bf('0x88'))[_0xb9bf('0x89')](_0xb9bf('0x8a'),'tq')[_0xb9bf('0x8b')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb9bf('0x47')](_0xb9bf('0x8c'),_0x2f09c7[_0xb9bf('0x61')]['id']);for(var _0x5ede33=0x0;_0x5ede33<_0xac3ea9[_0xb9bf('0x41')];_0x5ede33+=0x1){let _0x24b964=_0xac3ea9[_0x5ede33];for(var _0x243c14=0x0;_0x243c14<_0x24b964[_0xb9bf('0x77')]['length'];_0x243c14+=0x1){let _0x260731=_0x24b964[_0xb9bf('0x77')][_0x243c14];var _0x53dc03=_0x333f4e['clone']();_0x53dc03['where'](_0xb9bf('0x8d'),_0x260731['id']);_0x278ff1[_0xb9bf('0x8e')](db[_0xb9bf('0x8f')][_0xb9bf('0x3c')](_0x53dc03[_0xb9bf('0x90')](),{'type':db[_0xb9bf('0x8f')][_0xb9bf('0x91')]['SELECT']})[_0xb9bf('0x32')](function(_0x3fbda2){if(_0x3fbda2[_0xb9bf('0x41')]===0x1){return _0x260731['id'];}else{var _0x416d35=_[_0xb9bf('0x92')](_[_0xb9bf('0x37')](_0x3fbda2,'TeamId'),function(_0x4dafca){return _[_0xb9bf('0x2d')](_0x3a9b10,_0x4dafca);});if(_0x416d35){return _0x260731['id'];}}}));}}return BPromise[_0xb9bf('0x93')](_0x278ff1)[_0xb9bf('0x32')](function(_0x236df3){_0x564c56=_(_0x564c56)[_0xb9bf('0x94')](_0x236df3)[_0xb9bf('0x95')]()['value']();return db['VoiceQueue'][_0xb9bf('0x2f')]({'where':{'id':_0x2f09c7['params']['id']}})[_0xb9bf('0x32')](function(_0x36da5d){return db[_0xb9bf('0x8f')][_0xb9bf('0x78')](function(_0x55bb20){return _0x36da5d[_0xb9bf('0x83')](_0x2f09c7[_0xb9bf('0x3c')][_0xb9bf('0x84')],{'transaction':_0x55bb20})[_0xb9bf('0x32')](function(){if(!_[_0xb9bf('0x96')](_0x564c56)){return _0x36da5d[_0xb9bf('0x97')](_0x564c56,{'transaction':_0x55bb20})[_0xb9bf('0x32')](function(){return db[_0xb9bf('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x2f09c7[_0xb9bf('0x61')]['id'],'UserId':_0x564c56},'transaction':_0x55bb20});});}})['then'](function(){_0x564c56[_0xb9bf('0x80')](function(_0x3702db){socket['emit'](_0xb9bf('0x98'),{'UserId':_0x3702db,'VoiceQueueId':_0x36da5d['id']});});});});});});})['then'](respondWithStatusCode(_0x1e079f,null))[_0xb9bf('0x52')](handleError(_0x1e079f,null));};exports[_0xb9bf('0x99')]=function(_0x3bb5f0,_0x47f8ae,_0x2942a7){var _0x4a4429,_0x4c03ba;return db['VoiceQueue'][_0xb9bf('0x2f')]({'where':{'id':_0x3bb5f0['params']['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x47f8ae,null))[_0xb9bf('0x32')](function(_0x29876f){if(_0x29876f){_0x4c03ba=_0x29876f;return _0x29876f[_0xb9bf('0x99')](_0x3bb5f0[_0xb9bf('0x54')][_0xb9bf('0x84')],_[_0xb9bf('0x62')](_0x3bb5f0[_0xb9bf('0x54')],[_0xb9bf('0x84'),'id'])||{})['spread'](function(_0x59814c){for(var _0xf567c9=0x0;_0xf567c9<_0x3bb5f0[_0xb9bf('0x54')][_0xb9bf('0x84')]['length'];_0xf567c9+=0x1){socket[_0xb9bf('0x81')](_0xb9bf('0x82'),{'UserId':_0x3bb5f0[_0xb9bf('0x54')][_0xb9bf('0x84')][_0xf567c9],'VoiceQueueId':_0x3bb5f0['params']['id']});}return _0x59814c;});}})[_0xb9bf('0x32')](function(_0x301bc9){_0x4a4429=_0x301bc9||[];if(_0x4c03ba){return db['User'][_0xb9bf('0x4e')]({'where':{'id':_0x3bb5f0[_0xb9bf('0x54')][_0xb9bf('0x84')]},'attributes':['id',_0xb9bf('0x30'),'online',_0xb9bf('0x73'),'interface'],'raw':!![]});}})[_0xb9bf('0x32')](function(_0xb9a474){if(!_[_0xb9bf('0x96')](_0xb9a474)){var _0x16051b=[];for(var _0x473f61=0x0;_0x473f61<_0xb9a474[_0xb9bf('0x41')];_0x473f61++){if(_0xb9a474[_0x473f61][_0xb9bf('0x9a')]){_0x16051b[_0xb9bf('0x8e')](db[_0xb9bf('0x7d')]['upsert']({'membername':_0xb9a474[_0x473f61][_0xb9bf('0x30')],'UserId':_0xb9a474[_0x473f61]['id'],'queue_name':_0x4c03ba[_0xb9bf('0x30')],'VoiceQueueId':_0x4c03ba['id'],'interface':_['isNil'](_0xb9a474[_0x473f61]['interface'])?util[_0xb9bf('0x7f')](_0xb9bf('0x9b'),_0xb9a474[_0x473f61]['name']):_0xb9a474[_0x473f61][_0xb9bf('0x74')],'paused':_0xb9a474[_0x473f61]['voicePause']||![],'penalty':_0x3bb5f0[_0xb9bf('0x54')][_0xb9bf('0x76')]||0x0}));}}return BPromise['all'](_0x16051b);}})['then'](function(){return _0x4a4429;})[_0xb9bf('0x32')](respondWithResult(_0x47f8ae,null))[_0xb9bf('0x52')](handleError(_0x47f8ae,null));};exports[_0xb9bf('0x97')]=function(_0x1bc763,_0x584493,_0x183e1b){return db[_0xb9bf('0x38')][_0xb9bf('0x2f')]({'where':{'id':_0x1bc763['params']['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x584493,null))[_0xb9bf('0x32')](function(_0x3548ed){if(_0x3548ed){return _0x3548ed[_0xb9bf('0x97')](_0x1bc763[_0xb9bf('0x3c')][_0xb9bf('0x84')])[_0xb9bf('0x32')](function(){if(_[_0xb9bf('0x9c')](_0x1bc763['query'][_0xb9bf('0x84')])){for(var _0x1fb873=0x0;_0x1fb873<_0x1bc763[_0xb9bf('0x3c')][_0xb9bf('0x84')][_0xb9bf('0x41')];_0x1fb873+=0x1){socket['emit'](_0xb9bf('0x98'),{'UserId':Number(_0x1bc763[_0xb9bf('0x3c')][_0xb9bf('0x84')][_0x1fb873]),'VoiceQueueId':Number(_0x1bc763[_0xb9bf('0x61')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x1bc763['query']['ids']),'VoiceQueueId':Number(_0x1bc763[_0xb9bf('0x61')]['id'])});}});}})['then'](function(_0x543c28){return db[_0xb9bf('0x7d')][_0xb9bf('0x31')]({'where':{'VoiceQueueId':_0x1bc763[_0xb9bf('0x61')]['id'],'UserId':_0x1bc763['query'][_0xb9bf('0x84')]}})[_0xb9bf('0x32')](function(){return _0x543c28;});})[_0xb9bf('0x32')](respondWithStatusCode(_0x584493,null))[_0xb9bf('0x52')](handleError(_0x584493,null));};exports[_0xb9bf('0x9d')]=function(_0x150d3,_0x18acab,_0x2becff){var _0x4be109={};var _0x2457aa={};var _0x3bd966;var _0x23fda6;return db[_0xb9bf('0x38')]['findOne']({'where':{'id':_0x150d3[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x18acab,null))[_0xb9bf('0x32')](function(_0x2e0c0a){if(_0x2e0c0a){_0x3bd966=_0x2e0c0a;_0x2457aa[_0xb9bf('0x42')]=_['keys'](db[_0xb9bf('0x85')][_0xb9bf('0x39')]);_0x2457aa[_0xb9bf('0x3c')]=_['keys'](_0x150d3[_0xb9bf('0x3c')]);_0x2457aa['filters']=_['intersection'](_0x2457aa['model'],_0x2457aa[_0xb9bf('0x3c')]);_0x4be109[_0xb9bf('0x3e')]=_[_0xb9bf('0x3f')](_0x2457aa[_0xb9bf('0x42')],qs[_0xb9bf('0x40')](_0x150d3[_0xb9bf('0x3c')][_0xb9bf('0x40')]));_0x4be109[_0xb9bf('0x3e')]=_0x4be109[_0xb9bf('0x3e')][_0xb9bf('0x41')]?_0x4be109[_0xb9bf('0x3e')]:_0x2457aa[_0xb9bf('0x42')];_0x4be109[_0xb9bf('0x45')]=qs[_0xb9bf('0x46')](_0x150d3[_0xb9bf('0x3c')][_0xb9bf('0x46')]);_0x4be109['where']=qs[_0xb9bf('0x3d')](_[_0xb9bf('0x48')](_0x150d3[_0xb9bf('0x3c')],_0x2457aa[_0xb9bf('0x3d')]));if(_0x150d3[_0xb9bf('0x3c')][_0xb9bf('0x2a')]){_0x4be109[_0xb9bf('0x47')]=_[_0xb9bf('0x49')](_0x4be109['where'],{'$or':_['map'](_0x4be109[_0xb9bf('0x3e')],function(_0x55f36){var _0x2d9380={};_0x2d9380[_0x55f36]={'$like':'%'+_0x150d3[_0xb9bf('0x3c')][_0xb9bf('0x2a')]+'%'};return _0x2d9380;})});}_0x4be109=_[_0xb9bf('0x49')]({},_0x4be109,_0x150d3[_0xb9bf('0x4b')]);return _0x3bd966['getAgents'](_0x4be109);}})[_0xb9bf('0x32')](function(_0x3b71e5){if(_0x3b71e5){_0x23fda6=_0x3b71e5['length'];if(!_0x150d3['query'][_0xb9bf('0x43')]('nolimit')){_0x4be109[_0xb9bf('0x20')]=qs[_0xb9bf('0x20')](_0x150d3[_0xb9bf('0x3c')][_0xb9bf('0x20')]);_0x4be109[_0xb9bf('0x1f')]=qs[_0xb9bf('0x1f')](_0x150d3[_0xb9bf('0x3c')]['offset']);}return _0x3bd966['getAgents'](_0x4be109);}})[_0xb9bf('0x32')](function(_0x1a706c){if(_0x1a706c){return _0x1a706c?{'count':_0x23fda6,'rows':_0x1a706c}:null;}})[_0xb9bf('0x32')](respondWithResult(_0x18acab,null))['catch'](handleError(_0x18acab,null));};exports[_0xb9bf('0x9e')]=function(_0x588e20,_0x1355a9,_0x33695c){var _0x4890b7={};var _0x22234d={};var _0x397e51;var _0x5d8721;return db['VoiceQueue'][_0xb9bf('0x66')]({'where':{'id':_0x588e20['params']['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x1355a9,null))['then'](function(_0x7301a){if(_0x7301a){_0x397e51=_0x7301a;_0x22234d[_0xb9bf('0x42')]=_[_0xb9bf('0x50')](db[_0xb9bf('0x7d')][_0xb9bf('0x39')]);_0x22234d['query']=_[_0xb9bf('0x50')](_0x588e20[_0xb9bf('0x3c')]);_0x22234d[_0xb9bf('0x3d')]=_['intersection'](_0x22234d['model'],_0x22234d[_0xb9bf('0x3c')]);_0x4890b7['attributes']=_[_0xb9bf('0x3f')](_0x22234d[_0xb9bf('0x42')],qs[_0xb9bf('0x40')](_0x588e20['query'][_0xb9bf('0x40')]));_0x4890b7[_0xb9bf('0x3e')]=_0x4890b7[_0xb9bf('0x3e')][_0xb9bf('0x41')]?_0x4890b7[_0xb9bf('0x3e')]:_0x22234d[_0xb9bf('0x42')];_0x4890b7[_0xb9bf('0x45')]=qs[_0xb9bf('0x46')](_0x588e20[_0xb9bf('0x3c')]['sort']);_0x4890b7[_0xb9bf('0x47')]=qs[_0xb9bf('0x3d')](_[_0xb9bf('0x48')](_0x588e20[_0xb9bf('0x3c')],_0x22234d[_0xb9bf('0x3d')]));if(_0x588e20[_0xb9bf('0x3c')][_0xb9bf('0x2a')]){_0x4890b7['where']=_[_0xb9bf('0x49')](_0x4890b7[_0xb9bf('0x47')],{'$or':_['map'](_0x4890b7['attributes'],function(_0xa38641){var _0x264b1c={};_0x264b1c[_0xa38641]={'$like':'%'+_0x588e20[_0xb9bf('0x3c')][_0xb9bf('0x2a')]+'%'};return _0x264b1c;})});}_0x4890b7=_[_0xb9bf('0x49')]({},_0x4890b7,_0x588e20['options']);return _0x397e51['getMembers'](_0x4890b7);}})[_0xb9bf('0x32')](function(_0x1a40e9){if(_0x1a40e9){_0x5d8721=_0x1a40e9[_0xb9bf('0x41')];if(!_0x588e20[_0xb9bf('0x3c')]['hasOwnProperty'](_0xb9bf('0x44'))){_0x4890b7[_0xb9bf('0x20')]=qs[_0xb9bf('0x20')](_0x588e20[_0xb9bf('0x3c')]['limit']);_0x4890b7[_0xb9bf('0x1f')]=qs[_0xb9bf('0x1f')](_0x588e20['query'][_0xb9bf('0x1f')]);}return _0x397e51['getMembers'](_0x4890b7);}})[_0xb9bf('0x32')](function(_0x57b803){return _0x57b803?{'count':_0x5d8721,'rows':_0x57b803}:null;})[_0xb9bf('0x32')](respondWithResult(_0x1355a9,null))[_0xb9bf('0x52')](handleError(_0x1355a9,null));};exports['getLists']=function(_0x36e43f,_0x580bc3,_0x1ddad6){var _0x29585a={};var _0x52bf41={};var _0x56ac87;var _0x44c41b;return db['VoiceQueue']['findOne']({'where':{'id':_0x36e43f[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x580bc3,null))[_0xb9bf('0x32')](function(_0x4f3bd4){if(_0x4f3bd4){_0x56ac87=_0x4f3bd4;_0x52bf41[_0xb9bf('0x42')]=_[_0xb9bf('0x50')](db[_0xb9bf('0x9f')]['rawAttributes']);_0x52bf41[_0xb9bf('0x3c')]=_[_0xb9bf('0x50')](_0x36e43f[_0xb9bf('0x3c')]);_0x52bf41[_0xb9bf('0x3d')]=_[_0xb9bf('0x3f')](_0x52bf41[_0xb9bf('0x42')],_0x52bf41['query']);_0x29585a['attributes']=_[_0xb9bf('0x3f')](_0x52bf41['model'],qs[_0xb9bf('0x40')](_0x36e43f[_0xb9bf('0x3c')]['fields']));_0x29585a['attributes']=_0x29585a['attributes'][_0xb9bf('0x41')]?_0x29585a['attributes']:_0x52bf41[_0xb9bf('0x42')];_0x29585a[_0xb9bf('0x45')]=qs[_0xb9bf('0x46')](_0x36e43f[_0xb9bf('0x3c')]['sort']);_0x29585a[_0xb9bf('0x47')]=qs[_0xb9bf('0x3d')](_[_0xb9bf('0x48')](_0x36e43f[_0xb9bf('0x3c')],_0x52bf41[_0xb9bf('0x3d')]));if(_0x36e43f['query'][_0xb9bf('0x2a')]){_0x29585a[_0xb9bf('0x47')]=_['merge'](_0x29585a[_0xb9bf('0x47')],{'$or':_[_0xb9bf('0x37')](_0x29585a[_0xb9bf('0x3e')],function(_0x3b1904){var _0x1a96c1={};_0x1a96c1[_0x3b1904]={'$like':'%'+_0x36e43f[_0xb9bf('0x3c')][_0xb9bf('0x2a')]+'%'};return _0x1a96c1;})});}_0x29585a=_[_0xb9bf('0x49')]({},_0x29585a,_0x36e43f[_0xb9bf('0x4b')]);return _0x56ac87[_0xb9bf('0xa0')](_0x29585a);}})[_0xb9bf('0x32')](function(_0x1a3989){if(_0x1a3989){_0x44c41b=_0x1a3989[_0xb9bf('0x41')];if(!_0x36e43f[_0xb9bf('0x3c')][_0xb9bf('0x43')]('nolimit')){_0x29585a[_0xb9bf('0x20')]=qs['limit'](_0x36e43f[_0xb9bf('0x3c')]['limit']);_0x29585a[_0xb9bf('0x1f')]=qs[_0xb9bf('0x1f')](_0x36e43f[_0xb9bf('0x3c')][_0xb9bf('0x1f')]);}return _0x56ac87[_0xb9bf('0xa0')](_0x29585a);}})[_0xb9bf('0x32')](function(_0x5ecf42){if(_0x5ecf42){return _0x5ecf42?{'count':_0x44c41b,'rows':_0x5ecf42}:null;}})['then'](respondWithResult(_0x580bc3,null))[_0xb9bf('0x52')](handleError(_0x580bc3,null));};exports['addLists']=function(_0x5d13c3,_0x12c90b,_0x29827a){var _0x5d9341,_0x4f1433;return db['VoiceQueue'][_0xb9bf('0x2f')]({'where':{'id':_0x5d13c3[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x12c90b,null))[_0xb9bf('0x32')](function(_0x55da3b){if(_0x55da3b){_0x4f1433=_0x55da3b;return _0x55da3b[_0xb9bf('0xa1')](_0x5d13c3[_0xb9bf('0x54')]['ids'],_['omit'](_0x5d13c3[_0xb9bf('0x54')],[_0xb9bf('0x84'),'id'])||{});}return null;})[_0xb9bf('0xa2')](function(_0x478343){var _0x3eb8b7;_0x5d9341=_0x478343||[];var _0x538f0d=[];if(_0x478343){for(var _0x493140=0x0;_0x493140<_0x478343['length'];_0x493140+=0x1){var _0x3a6a1c=_0x478343[_0x493140][_0xb9bf('0x27')]({'plain':!![]});_0x4f1433[_0xb9bf('0xa3')]=_0x5d13c3[_0xb9bf('0x54')]['dialCheckDuplicateType']?_0x5d13c3['body'][_0xb9bf('0xa3')]:_0x4f1433['dialCheckDuplicateType'];switch(_0x4f1433[_0xb9bf('0xa3')]){case _0xb9bf('0xa4'):_0x3eb8b7=squel[_0xb9bf('0xa5')]()['into'](_0xb9bf('0xa6'))[_0xb9bf('0xa7')]([_0xb9bf('0xa8'),'scheduledAt','ContactId',_0xb9bf('0xa9'),'VoiceQueueId',_0xb9bf('0x63'),_0xb9bf('0x64')],squel['select']()[_0xb9bf('0x87')](_0xb9bf('0xa8'),_0xb9bf('0xa8'))[_0xb9bf('0x87')](_0xb9bf('0xaa'),_0xb9bf('0xab'))['field']('id',_0xb9bf('0xac'))[_0xb9bf('0x87')](_0x3a6a1c[_0xb9bf('0xad')][_0xb9bf('0x90')](),_0xb9bf('0xa9'))[_0xb9bf('0x87')](_0x5d13c3[_0xb9bf('0x61')]['id'][_0xb9bf('0x90')](),_0xb9bf('0x68'))[_0xb9bf('0x87')](_0xb9bf('0xaa'),_0xb9bf('0x63'))[_0xb9bf('0x87')](_0xb9bf('0xaa'),_0xb9bf('0x64'))['from'](_0xb9bf('0xae'))[_0xb9bf('0x47')]('deletedAt\x20IS\x20NULL')['where'](_0xb9bf('0xaf'),_0x3a6a1c[_0xb9bf('0xad')][_0xb9bf('0x90')]())[_0xb9bf('0x47')](_0xb9bf('0xb0'))['where'](_0xb9bf('0xb1'),squel[_0xb9bf('0x86')]()[_0xb9bf('0x87')](_0xb9bf('0xb2'))[_0xb9bf('0x89')]('cm_hopper_final')['where'](_0xb9bf('0x8c'),_0x5d13c3['params']['id'][_0xb9bf('0x90')]()))[_0xb9bf('0x47')](_0xb9bf('0xb1'),squel['select']()[_0xb9bf('0x87')](_0xb9bf('0xb3'))['from']('cm_hopper')['where'](_0xb9bf('0x8c'),_0x5d13c3[_0xb9bf('0x61')]['id'][_0xb9bf('0x90')]())))[_0xb9bf('0x90')]();break;case'onlyIfOpen':_0x3eb8b7=squel['insert']()[_0xb9bf('0xb4')](_0xb9bf('0xa6'))['fromQuery']([_0xb9bf('0xa8'),'scheduledAt',_0xb9bf('0xac'),_0xb9bf('0xa9'),_0xb9bf('0x68'),_0xb9bf('0x63'),_0xb9bf('0x64')],squel[_0xb9bf('0x86')]()[_0xb9bf('0x87')](_0xb9bf('0xa8'),_0xb9bf('0xa8'))[_0xb9bf('0x87')](_0xb9bf('0xaa'),_0xb9bf('0xab'))['field']('id','ContactId')['field'](_0x3a6a1c['CmListId']['toString'](),_0xb9bf('0xa9'))[_0xb9bf('0x87')](_0x5d13c3[_0xb9bf('0x61')]['id'][_0xb9bf('0x90')](),_0xb9bf('0x68'))[_0xb9bf('0x87')]('NOW()',_0xb9bf('0x63'))['field'](_0xb9bf('0xaa'),_0xb9bf('0x64'))[_0xb9bf('0x89')](_0xb9bf('0xae'))[_0xb9bf('0x47')](_0xb9bf('0xb5'))[_0xb9bf('0x47')](_0xb9bf('0xaf'),_0x3a6a1c[_0xb9bf('0xad')][_0xb9bf('0x90')]())[_0xb9bf('0x47')](_0xb9bf('0xb0'))[_0xb9bf('0x47')](_0xb9bf('0xb1'),squel['select']()[_0xb9bf('0x87')](_0xb9bf('0xb3'))[_0xb9bf('0x89')](_0xb9bf('0xa6'))['where'](_0xb9bf('0x8c'),_0x5d13c3[_0xb9bf('0x61')]['id'][_0xb9bf('0x90')]())))['toString']();break;default:_0x3eb8b7=squel[_0xb9bf('0xa5')]()[_0xb9bf('0xb4')]('cm_hopper')[_0xb9bf('0xa7')]([_0xb9bf('0xa8'),'scheduledAt',_0xb9bf('0xac'),_0xb9bf('0xa9'),'VoiceQueueId','createdAt',_0xb9bf('0x64')],squel[_0xb9bf('0x86')]()[_0xb9bf('0x87')](_0xb9bf('0xa8'),'phone')[_0xb9bf('0x87')](_0xb9bf('0xaa'),_0xb9bf('0xab'))[_0xb9bf('0x87')]('id',_0xb9bf('0xac'))[_0xb9bf('0x87')](_0x3a6a1c[_0xb9bf('0xad')][_0xb9bf('0x90')](),'ListId')[_0xb9bf('0x87')](_0x5d13c3[_0xb9bf('0x61')]['id']['toString'](),'VoiceQueueId')['field'](_0xb9bf('0xaa'),'createdAt')[_0xb9bf('0x87')](_0xb9bf('0xaa'),_0xb9bf('0x64'))[_0xb9bf('0x89')]('cm_contacts')[_0xb9bf('0x47')](_0xb9bf('0xb5'))['where'](_0xb9bf('0xaf'),_0x3a6a1c[_0xb9bf('0xad')][_0xb9bf('0x90')]())[_0xb9bf('0x47')](_0xb9bf('0xb0')))[_0xb9bf('0x90')]();}_0x538f0d[_0xb9bf('0x8e')](db[_0xb9bf('0x8f')]['query'](_0x3eb8b7));}return BPromise[_0xb9bf('0x93')](_0x538f0d);}})['then'](function(){return _0x5d9341;})[_0xb9bf('0x32')](respondWithResult(_0x12c90b,null))['catch'](handleError(_0x12c90b,null));};exports[_0xb9bf('0xb6')]=function(_0x1a6dfd,_0x3e441b,_0x4adb50){return db['VoiceQueue'][_0xb9bf('0x2f')]({'where':{'id':_0x1a6dfd[_0xb9bf('0x61')]['id']}})['then'](handleEntityNotFound(_0x3e441b,null))[_0xb9bf('0x32')](function(_0x19f76b){if(_0x19f76b){return _0x19f76b[_0xb9bf('0xb6')](_0x1a6dfd[_0xb9bf('0x3c')][_0xb9bf('0x84')]);}})[_0xb9bf('0x32')](function(_0x75896c){if(_0x75896c){return db[_0xb9bf('0x67')]['destroy']({'where':{'ListId':_0x1a6dfd[_0xb9bf('0x3c')][_0xb9bf('0x84')],'VoiceQueueId':_0x1a6dfd['params']['id']}})[_0xb9bf('0x32')](function(){return _0x75896c;});}})[_0xb9bf('0x32')](respondWithStatusCode(_0x3e441b,null))[_0xb9bf('0x52')](handleError(_0x3e441b,null));};exports[_0xb9bf('0xb7')]=function(_0x1891a4,_0x3f861d,_0xf585cf){var _0x2ec98f={};var _0x332326={};var _0x11541a;var _0x132903;return db[_0xb9bf('0x38')]['findOne']({'where':{'id':_0x1891a4[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x3f861d,null))[_0xb9bf('0x32')](function(_0x416c39){if(_0x416c39){_0x11541a=_0x416c39;_0x332326[_0xb9bf('0x42')]=_['keys'](db['CmList'][_0xb9bf('0x39')]);_0x332326['query']=_[_0xb9bf('0x50')](_0x1891a4[_0xb9bf('0x3c')]);_0x332326[_0xb9bf('0x3d')]=_[_0xb9bf('0x3f')](_0x332326[_0xb9bf('0x42')],_0x332326[_0xb9bf('0x3c')]);_0x2ec98f[_0xb9bf('0x3e')]=_[_0xb9bf('0x3f')](_0x332326[_0xb9bf('0x42')],qs[_0xb9bf('0x40')](_0x1891a4[_0xb9bf('0x3c')][_0xb9bf('0x40')]));_0x2ec98f[_0xb9bf('0x3e')]=_0x2ec98f['attributes'][_0xb9bf('0x41')]?_0x2ec98f[_0xb9bf('0x3e')]:_0x332326['model'];_0x2ec98f[_0xb9bf('0x45')]=qs['sort'](_0x1891a4[_0xb9bf('0x3c')]['sort']);_0x2ec98f[_0xb9bf('0x47')]=qs[_0xb9bf('0x3d')](_['pick'](_0x1891a4[_0xb9bf('0x3c')],_0x332326['filters']));if(_0x1891a4[_0xb9bf('0x3c')][_0xb9bf('0x2a')]){_0x2ec98f[_0xb9bf('0x47')]=_[_0xb9bf('0x49')](_0x2ec98f[_0xb9bf('0x47')],{'$or':_[_0xb9bf('0x37')](_0x2ec98f[_0xb9bf('0x3e')],function(_0x26e613){var _0x36384e={};_0x36384e[_0x26e613]={'$like':'%'+_0x1891a4['query'][_0xb9bf('0x2a')]+'%'};return _0x36384e;})});}_0x2ec98f=_[_0xb9bf('0x49')]({},_0x2ec98f,_0x1891a4[_0xb9bf('0x4b')]);return _0x11541a[_0xb9bf('0xb7')](_0x2ec98f);}})[_0xb9bf('0x32')](function(_0x35d345){if(_0x35d345){_0x132903=_0x35d345[_0xb9bf('0x41')];if(!_0x1891a4['query'][_0xb9bf('0x43')](_0xb9bf('0x44'))){_0x2ec98f[_0xb9bf('0x20')]=qs[_0xb9bf('0x20')](_0x1891a4[_0xb9bf('0x3c')][_0xb9bf('0x20')]);_0x2ec98f[_0xb9bf('0x1f')]=qs[_0xb9bf('0x1f')](_0x1891a4[_0xb9bf('0x3c')][_0xb9bf('0x1f')]);}return _0x11541a['getBlackLists'](_0x2ec98f);}})[_0xb9bf('0x32')](function(_0xf6973f){if(_0xf6973f){return _0xf6973f?{'count':_0x132903,'rows':_0xf6973f}:null;}})['then'](respondWithResult(_0x3f861d,null))[_0xb9bf('0x52')](handleError(_0x3f861d,null));};exports['addBlackLists']=function(_0x1790cb,_0x1e839a,_0x3f5aa5){var _0x2ed450,_0x120a73;return db['VoiceQueue']['find']({'where':{'id':_0x1790cb[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x1e839a,null))[_0xb9bf('0x32')](function(_0x40bb63){if(_0x40bb63){_0x120a73=_0x40bb63;return _0x40bb63[_0xb9bf('0xb8')](_0x1790cb[_0xb9bf('0x54')][_0xb9bf('0x84')],_[_0xb9bf('0x62')](_0x1790cb[_0xb9bf('0x54')],[_0xb9bf('0x84'),'id'])||{});}return null;})[_0xb9bf('0xa2')](function(_0xa429d9){var _0xc8fcc;_0x2ed450=_0xa429d9||[];var _0x16e34f=[];if(_0xa429d9){for(var _0x56807a=0x0;_0x56807a<_0xa429d9['length'];_0x56807a+=0x1){var _0x505ac2=_0xa429d9[_0x56807a][_0xb9bf('0x27')]({'plain':!![]});_0xc8fcc=squel[_0xb9bf('0xa5')]()[_0xb9bf('0xb4')](_0xb9bf('0xb9'))[_0xb9bf('0xa7')]([_0xb9bf('0xa8'),'ContactId',_0xb9bf('0xa9'),_0xb9bf('0x68'),_0xb9bf('0x63'),'updatedAt'],squel['select']()[_0xb9bf('0x87')]('phone',_0xb9bf('0xa8'))[_0xb9bf('0x87')]('id',_0xb9bf('0xac'))[_0xb9bf('0x87')](_0x505ac2[_0xb9bf('0xad')][_0xb9bf('0x90')](),'ListId')[_0xb9bf('0x87')](_0x1790cb[_0xb9bf('0x61')]['id'][_0xb9bf('0x90')](),'VoiceQueueId')['field'](_0xb9bf('0xaa'),_0xb9bf('0x63'))[_0xb9bf('0x87')](_0xb9bf('0xaa'),_0xb9bf('0x64'))[_0xb9bf('0x89')](_0xb9bf('0xae'))['where'](_0xb9bf('0xb5'))[_0xb9bf('0x47')](_0xb9bf('0xaf'),_0x505ac2['CmListId']['toString']())[_0xb9bf('0x47')](_0xb9bf('0xb0')))['toString']();_0x16e34f[_0xb9bf('0x8e')](db[_0xb9bf('0x8f')][_0xb9bf('0x3c')](_0xc8fcc));}return BPromise['all'](_0x16e34f);}})['then'](function(){return _0x2ed450;})[_0xb9bf('0x32')](respondWithResult(_0x1e839a,null))['catch'](handleError(_0x1e839a,null));};exports[_0xb9bf('0xba')]=function(_0x37812c,_0x12df45,_0x35319d){return db[_0xb9bf('0x38')]['find']({'where':{'id':_0x37812c['params']['id']}})[_0xb9bf('0x32')](handleEntityNotFound(_0x12df45,null))[_0xb9bf('0x32')](function(_0x2d9815){if(_0x2d9815){return _0x2d9815['removeBlackLists'](_0x37812c['query'][_0xb9bf('0x84')]);}})[_0xb9bf('0x32')](function(_0x3f08a0){if(_0x3f08a0){return db[_0xb9bf('0x6f')]['destroy']({'where':{'ListId':_0x37812c[_0xb9bf('0x3c')]['ids'],'VoiceQueueId':_0x37812c[_0xb9bf('0x61')]['id']}})[_0xb9bf('0x32')](function(){return _0x3f08a0;});}})[_0xb9bf('0x32')](respondWithStatusCode(_0x12df45,null))[_0xb9bf('0x52')](handleError(_0x12df45,null));}; \ No newline at end of file +var _0x52b3=['to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voiceQueue.socket','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','type','find','name','UserProfileResource','then','sendStatus','error','stack','index','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','VoiceQueue','includeAll','include','findAll','rows','catch','show','params','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','body','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','upsert','isNil','format','SIP/%s','emit','ids','select','field','tq.TeamId','from','team_has_voice_queues','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','toString','SELECT','TeamId','all','union','removeTeams','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','into','cm_hopper','fromQuery','scheduledAt','ContactId','phone','NOW()','CmListId','ListId','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x577467,_0x4356f3){var _0x434b6c=function(_0x79524f){while(--_0x79524f){_0x577467['push'](_0x577467['shift']());}};_0x434b6c(++_0x4356f3);}(_0x52b3,0x154));var _0x352b=function(_0x127a1b,_0x35ecca){_0x127a1b=_0x127a1b-0x0;var _0x1e7b2e=_0x52b3[_0x127a1b];return _0x1e7b2e;};'use strict';var emlformat=require(_0x352b('0x0'));var rimraf=require(_0x352b('0x1'));var zipdir=require(_0x352b('0x2'));var jsonpatch=require(_0x352b('0x3'));var rp=require('request-promise');var moment=require(_0x352b('0x4'));var BPromise=require(_0x352b('0x5'));var Mustache=require('mustache');var util=require(_0x352b('0x6'));var path=require('path');var sox=require(_0x352b('0x7'));var csv=require('to-csv');var ejs=require(_0x352b('0x8'));var fs=require('fs');var fs_extra=require(_0x352b('0x9'));var _=require(_0x352b('0xa'));var squel=require(_0x352b('0xb'));var crypto=require('crypto');var jsforce=require(_0x352b('0xc'));var deskjs=require(_0x352b('0xd'));var toCsv=require(_0x352b('0xe'));var querystring=require('querystring');var Papa=require(_0x352b('0xf'));var Redis=require(_0x352b('0x10'));var authService=require(_0x352b('0x11'));var qs=require(_0x352b('0x12'));var as=require(_0x352b('0x13'));var hardwareService=require(_0x352b('0x14'));var logger=require(_0x352b('0x15'))('api');var utils=require(_0x352b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x352b('0x17'));var db=require(_0x352b('0x18'))['db'];config[_0x352b('0x19')]=_['defaults'](config[_0x352b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x352b('0x1a'))(new Redis(config['redis']));require(_0x352b('0x1b'))['register'](socket);function respondWithStatusCode(_0x430d2a,_0x2799a2){_0x2799a2=_0x2799a2||0xcc;return function(_0x22d13f){if(_0x22d13f){return _0x430d2a['sendStatus'](_0x2799a2);}return _0x430d2a[_0x352b('0x1c')](_0x2799a2)['end']();};}function respondWithResult(_0x152771,_0x4d7312){_0x4d7312=_0x4d7312||0xc8;return function(_0x25ba2f){if(_0x25ba2f){return _0x152771[_0x352b('0x1c')](_0x4d7312)[_0x352b('0x1d')](_0x25ba2f);}};}function respondWithFilteredResult(_0x4fd433,_0x475d6d){return function(_0x4d28ea){if(_0x4d28ea){var _0xa8e649=_0x4d28ea[_0x352b('0x1e')],_0x1ec3cf=_0x475d6d[_0x352b('0x1f')],_0x48a4d8=_0x475d6d[_0x352b('0x1f')]+_0x475d6d[_0x352b('0x20')],_0x279adb;if(_0x48a4d8>=_0xa8e649){_0x48a4d8=_0xa8e649;_0x279adb=0xc8;}else{_0x279adb=0xce;}_0x4fd433[_0x352b('0x1c')](_0x279adb);return _0x4fd433[_0x352b('0x21')](_0x352b('0x22'),_0x1ec3cf+'-'+_0x48a4d8+'/'+_0xa8e649)[_0x352b('0x1d')](_0x4d28ea);}return null;};}function patchUpdates(_0x4950d1){return function(_0x57c9a7){try{jsonpatch[_0x352b('0x23')](_0x57c9a7,_0x4950d1,!![]);}catch(_0x2248db){return BPromise[_0x352b('0x24')](_0x2248db);}return _0x57c9a7[_0x352b('0x25')]();};}function saveUpdates(_0x4d0831,_0x5b27d2){return function(_0x2e4d89){if(_0x2e4d89){return _0x2e4d89[_0x352b('0x26')](_0x4d0831)['then'](function(_0x42a19a){return _0x42a19a;});}return null;};}function removeEntity(_0x172cfd,_0x3fd1b6){return function(_0xe7d998){if(_0xe7d998){return _0xe7d998[_0x352b('0x27')]()['then'](function(){var _0x57868e=_0xe7d998[_0x352b('0x28')]({'plain':!![]});var _0x11ed09=[{'name':_0x352b('0x29'),'value':_0x352b('0x2a'),'ignore':![]},{'name':_0x352b('0x2b'),'value':_0x352b('0x2c'),'ignore':![]}];var _0x56204e=_(_0x11ed09)[_0x352b('0x2d')]('ignore')[_0x352b('0x2e')]('value')[_0x352b('0x2f')]();if(_[_0x352b('0x30')](_0x56204e,_0x57868e[_0x352b('0x31')])){return;}var _0x442fd9=_[_0x352b('0x32')](_0x11ed09,[_0x352b('0x2f'),_0x57868e['type']])[_0x352b('0x33')];return db[_0x352b('0x34')]['destroy']({'where':{'type':_0x442fd9,'resourceId':_0x57868e['id']}})[_0x352b('0x35')](function(){return _0xe7d998;});})[_0x352b('0x35')](function(){_0x172cfd[_0x352b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50bedd,_0x1be9d1){return function(_0x5e95ee){if(!_0x5e95ee){_0x50bedd[_0x352b('0x36')](0x194);}return _0x5e95ee;};}function handleError(_0x182569,_0x2695ea){_0x2695ea=_0x2695ea||0x1f4;return function(_0x13a135){logger[_0x352b('0x37')](_0x13a135[_0x352b('0x38')]);if(_0x13a135[_0x352b('0x33')]){delete _0x13a135[_0x352b('0x33')];}_0x182569[_0x352b('0x1c')](_0x2695ea)['send'](_0x13a135);};}exports[_0x352b('0x39')]=function(_0xef9592,_0x2ced1b){var _0xc8f81f={},_0x3356bf={},_0x22c75b={'count':0x0,'rows':[]};var _0x7092f6=_['map'](db['VoiceQueue'][_0x352b('0x3a')],function(_0x3e4952){return{'name':_0x3e4952['fieldName'],'type':_0x3e4952[_0x352b('0x31')][_0x352b('0x3b')]};});_0x3356bf[_0x352b('0x3c')]=_[_0x352b('0x2e')](_0x7092f6,_0x352b('0x33'));_0x3356bf[_0x352b('0x3d')]=_[_0x352b('0x3e')](_0xef9592[_0x352b('0x3d')]);_0x3356bf[_0x352b('0x3f')]=_[_0x352b('0x40')](_0x3356bf['model'],_0x3356bf[_0x352b('0x3d')]);_0xc8f81f['attributes']=_[_0x352b('0x40')](_0x3356bf[_0x352b('0x3c')],qs[_0x352b('0x41')](_0xef9592[_0x352b('0x3d')][_0x352b('0x41')]));_0xc8f81f[_0x352b('0x42')]=_0xc8f81f[_0x352b('0x42')][_0x352b('0x43')]?_0xc8f81f[_0x352b('0x42')]:_0x3356bf['model'];if(!_0xef9592[_0x352b('0x3d')][_0x352b('0x44')](_0x352b('0x45'))){_0xc8f81f[_0x352b('0x20')]=qs['limit'](_0xef9592['query'][_0x352b('0x20')]);_0xc8f81f['offset']=qs['offset'](_0xef9592[_0x352b('0x3d')][_0x352b('0x1f')]);}_0xc8f81f[_0x352b('0x46')]=qs[_0x352b('0x47')](_0xef9592[_0x352b('0x3d')][_0x352b('0x47')]);_0xc8f81f[_0x352b('0x48')]=qs[_0x352b('0x3f')](_[_0x352b('0x49')](_0xef9592['query'],_0x3356bf['filters']),_0x7092f6);if(_0xef9592[_0x352b('0x3d')][_0x352b('0x2d')]){_0xc8f81f[_0x352b('0x48')]=_['merge'](_0xc8f81f[_0x352b('0x48')],{'$or':_[_0x352b('0x2e')](_0x7092f6,function(_0x177056){if(_0x177056[_0x352b('0x31')]!=='VIRTUAL'){var _0x46680b={};_0x46680b[_0x177056[_0x352b('0x33')]]={'$like':'%'+_0xef9592[_0x352b('0x3d')][_0x352b('0x2d')]+'%'};return _0x46680b;}})});}_0xc8f81f=_[_0x352b('0x4a')]({},_0xc8f81f,_0xef9592[_0x352b('0x4b')]);var _0x404128={'where':_0xc8f81f[_0x352b('0x48')]};return db[_0x352b('0x4c')][_0x352b('0x1e')](_0x404128)[_0x352b('0x35')](function(_0x3c3f92){_0x22c75b[_0x352b('0x1e')]=_0x3c3f92;if(_0xef9592[_0x352b('0x3d')][_0x352b('0x4d')]){_0xc8f81f[_0x352b('0x4e')]=[{'all':!![]}];}return db['VoiceQueue'][_0x352b('0x4f')](_0xc8f81f);})[_0x352b('0x35')](function(_0xc0f1e0){_0x22c75b[_0x352b('0x50')]=_0xc0f1e0;return _0x22c75b;})[_0x352b('0x35')](respondWithFilteredResult(_0x2ced1b,_0xc8f81f))[_0x352b('0x51')](handleError(_0x2ced1b,null));};exports[_0x352b('0x52')]=function(_0x45910a,_0x4c8745){var _0x3ba9fe={'raw':![],'where':{'id':_0x45910a[_0x352b('0x53')]['id']}},_0x58e626={};_0x58e626['model']=_[_0x352b('0x3e')](db[_0x352b('0x4c')][_0x352b('0x3a')]);_0x58e626[_0x352b('0x3d')]=_[_0x352b('0x3e')](_0x45910a[_0x352b('0x3d')]);_0x58e626[_0x352b('0x3f')]=_['intersection'](_0x58e626[_0x352b('0x3c')],_0x58e626[_0x352b('0x3d')]);_0x3ba9fe[_0x352b('0x42')]=_[_0x352b('0x40')](_0x58e626['model'],qs[_0x352b('0x41')](_0x45910a[_0x352b('0x3d')][_0x352b('0x41')]));_0x3ba9fe[_0x352b('0x42')]=_0x3ba9fe[_0x352b('0x42')]['length']?_0x3ba9fe[_0x352b('0x42')]:_0x58e626['model'];if(_0x45910a[_0x352b('0x3d')]['includeAll']){_0x3ba9fe[_0x352b('0x4e')]=[{'all':!![]}];}_0x3ba9fe=_[_0x352b('0x4a')]({},_0x3ba9fe,_0x45910a['options']);return db[_0x352b('0x4c')][_0x352b('0x32')](_0x3ba9fe)[_0x352b('0x35')](handleEntityNotFound(_0x4c8745,null))[_0x352b('0x35')](respondWithResult(_0x4c8745,null))['catch'](handleError(_0x4c8745,null));};exports['create']=function(_0x1b3170,_0x34e28f){return db[_0x352b('0x4c')][_0x352b('0x54')](_0x1b3170['body'],{})['then'](function(_0x5f17d3){var _0x5d63b9=_0x1b3170[_0x352b('0x55')][_0x352b('0x28')]({'plain':!![]});if(!_0x5d63b9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d63b9[_0x352b('0x56')]===_0x352b('0x55')){var _0x3a2c1e=_0x5f17d3[_0x352b('0x28')]({'plain':!![]});var _0x1357d4=[{'name':_0x352b('0x29'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x352b('0x2c')}];var _0xb0b672=_[_0x352b('0x32')](_0x1357d4,[_0x352b('0x2f'),_0x3a2c1e[_0x352b('0x31')]])[_0x352b('0x33')];return db[_0x352b('0x57')][_0x352b('0x32')]({'where':{'name':_0xb0b672,'userProfileId':_0x5d63b9[_0x352b('0x58')]},'raw':!![]})[_0x352b('0x35')](function(_0x1f820e){if(_0x1f820e&&_0x1f820e[_0x352b('0x59')]===0x0){return db[_0x352b('0x34')][_0x352b('0x54')]({'name':_0x3a2c1e[_0x352b('0x33')],'resourceId':_0x3a2c1e['id'],'type':_0x1f820e[_0x352b('0x33')],'sectionId':_0x1f820e['id']},{})['then'](function(){return _0x5f17d3;});}else{return _0x5f17d3;}})['catch'](function(_0x51fc4f){logger[_0x352b('0x37')](_0x352b('0x5a'),_0x51fc4f);throw _0x51fc4f;});}return _0x5f17d3;})[_0x352b('0x35')](respondWithResult(_0x34e28f,0xc9))[_0x352b('0x51')](handleError(_0x34e28f,null));};exports[_0x352b('0x5b')]=function(_0x3907ca,_0x9baa3a){var _0x18cb68={'where':{'id':_0x3907ca[_0x352b('0x53')]['id']}},_0x3c181a={};_0x3c181a['model']=_['keys'](db[_0x352b('0x4c')][_0x352b('0x3a')]);_0x18cb68[_0x352b('0x42')]=_[_0x352b('0x40')](_0x3c181a[_0x352b('0x3c')],qs[_0x352b('0x41')](_0x3907ca[_0x352b('0x3d')][_0x352b('0x41')]));_0x18cb68[_0x352b('0x42')]=_0x18cb68[_0x352b('0x42')][_0x352b('0x43')]?_0x18cb68['attributes']:_0x3c181a[_0x352b('0x3c')];if(_0x3907ca[_0x352b('0x3d')][_0x352b('0x4d')]){_0x18cb68[_0x352b('0x4e')]=[{'all':!![]}];}_0x18cb68=_[_0x352b('0x4a')]({},_0x18cb68,_0x3907ca[_0x352b('0x4b')]);return db[_0x352b('0x4c')]['find'](_0x18cb68)['then'](handleEntityNotFound(_0x9baa3a,null))[_0x352b('0x35')](function(_0x16017d){if(_0x16017d){var _0x19da9b=_0x16017d[_0x352b('0x28')]({'plain':!![]});_0x19da9b=qs['omit'](_0x19da9b,['id',_0x352b('0x5c'),'updatedAt']);_0x3907ca[_0x352b('0x5d')]=_[_0x352b('0x5e')](_0x3907ca['body'],['id',_0x352b('0x5c'),_0x352b('0x5f')]);return db[_0x352b('0x4c')][_0x352b('0x54')](_[_0x352b('0x4a')](_0x19da9b,_0x3907ca[_0x352b('0x5d')]),{'include':_0x3907ca[_0x352b('0x3d')][_0x352b('0x4d')]?[{'all':!![]}]:undefined})[_0x352b('0x35')](function(_0x3da8e9){var _0x186f41=_0x3907ca[_0x352b('0x55')][_0x352b('0x28')]({'plain':!![]});if(!_0x186f41)throw new Error(_0x352b('0x60'));if(_0x186f41[_0x352b('0x56')]==='user'){var _0x410e22=_0x3da8e9[_0x352b('0x28')]({'plain':!![]});var _0x3cb37d=[{'name':_0x352b('0x29'),'value':_0x352b('0x2a')},{'name':_0x352b('0x2b'),'value':_0x352b('0x2c')}];var _0x33f006=_['find'](_0x3cb37d,[_0x352b('0x2f'),_0x410e22['type']])['name'];return db[_0x352b('0x57')][_0x352b('0x32')]({'where':{'name':_0x33f006,'userProfileId':_0x186f41[_0x352b('0x58')]},'raw':!![]})[_0x352b('0x35')](function(_0xfaedec){if(_0xfaedec&&_0xfaedec[_0x352b('0x59')]===0x0){return db[_0x352b('0x34')][_0x352b('0x54')]({'name':_0x410e22['name'],'resourceId':_0x410e22['id'],'type':_0xfaedec[_0x352b('0x33')],'sectionId':_0xfaedec['id']},{})[_0x352b('0x35')](function(){return _0x3da8e9;});}else{return _0x3da8e9;}})[_0x352b('0x51')](function(_0xd15b93){logger[_0x352b('0x37')](_0x352b('0x5a'),_0xd15b93);throw _0xd15b93;});}return _0x3da8e9;});}})[_0x352b('0x35')](respondWithResult(_0x9baa3a,0xc9))['catch'](handleError(_0x9baa3a,null));};exports[_0x352b('0x26')]=function(_0x33ee23,_0x1a238f){if(_0x33ee23[_0x352b('0x5d')]['id']){delete _0x33ee23[_0x352b('0x5d')]['id'];}return db[_0x352b('0x4c')][_0x352b('0x32')]({'where':{'id':_0x33ee23[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x1a238f,null))[_0x352b('0x35')](saveUpdates(_0x33ee23[_0x352b('0x5d')],null))[_0x352b('0x35')](respondWithResult(_0x1a238f,null))[_0x352b('0x51')](handleError(_0x1a238f,null));};exports[_0x352b('0x27')]=function(_0x27f967,_0x1f9c35){return db[_0x352b('0x4c')]['find']({'where':{'id':_0x27f967[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x1f9c35,null))[_0x352b('0x35')](removeEntity(_0x1f9c35,null))[_0x352b('0x51')](handleError(_0x1f9c35,null));};exports[_0x352b('0x61')]=function(_0x4c2b8e,_0x4d1402,_0x3196ae){var _0x88959b={'raw':![],'where':{}};var _0x11542f={};var _0x7b6147={'count':0x0,'rows':[]};return db[_0x352b('0x4c')][_0x352b('0x62')]({'where':{'id':_0x4c2b8e[_0x352b('0x53')]['id']}})['then'](handleEntityNotFound(_0x4d1402,null))[_0x352b('0x35')](function(_0x57ed92){if(_0x57ed92){_0x11542f[_0x352b('0x3c')]=_[_0x352b('0x3e')](db[_0x352b('0x63')][_0x352b('0x3a')]);_0x11542f[_0x352b('0x3d')]=_[_0x352b('0x3e')](_0x4c2b8e[_0x352b('0x3d')]);_0x11542f['filters']=_[_0x352b('0x40')](_0x11542f[_0x352b('0x3c')],_0x11542f[_0x352b('0x3d')]);_0x88959b['attributes']=_['intersection'](_0x11542f[_0x352b('0x3c')],qs[_0x352b('0x41')](_0x4c2b8e[_0x352b('0x3d')][_0x352b('0x41')]));_0x88959b['attributes']=_0x88959b[_0x352b('0x42')]['length']?_0x88959b[_0x352b('0x42')]:_0x11542f[_0x352b('0x3c')];if(!_0x4c2b8e['query'][_0x352b('0x44')](_0x352b('0x45'))){_0x88959b[_0x352b('0x20')]=qs[_0x352b('0x20')](_0x4c2b8e[_0x352b('0x3d')][_0x352b('0x20')]);_0x88959b[_0x352b('0x1f')]=qs['offset'](_0x4c2b8e[_0x352b('0x3d')][_0x352b('0x1f')]);}_0x88959b['order']=qs['sort'](_0x4c2b8e[_0x352b('0x3d')][_0x352b('0x47')]);_0x88959b[_0x352b('0x48')]=qs['filters'](_[_0x352b('0x49')](_0x4c2b8e[_0x352b('0x3d')],_0x11542f[_0x352b('0x3f')]));_0x88959b[_0x352b('0x48')][_0x352b('0x64')]=_0x57ed92['id'];if(_0x4c2b8e['query']['filter']){_0x88959b[_0x352b('0x48')]=_[_0x352b('0x4a')](_0x88959b[_0x352b('0x48')],{'$or':_[_0x352b('0x2e')](_0x88959b[_0x352b('0x42')],function(_0x50705f){var _0x4795f8={};_0x4795f8[_0x50705f]={'$like':'%'+_0x4c2b8e['query'][_0x352b('0x2d')]+'%'};return _0x4795f8;})});}_0x88959b=_[_0x352b('0x4a')]({},_0x88959b,_0x4c2b8e['options']);return db[_0x352b('0x63')]['count']({'where':_0x88959b[_0x352b('0x48')]})[_0x352b('0x35')](function(_0x270598){_0x7b6147[_0x352b('0x1e')]=_0x270598;if(_0x4c2b8e[_0x352b('0x3d')][_0x352b('0x4d')]){_0x88959b[_0x352b('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0x352b('0x4f')](_0x88959b);})[_0x352b('0x35')](function(_0x2a3980){_0x7b6147[_0x352b('0x50')]=_0x2a3980;return _0x7b6147;});}})[_0x352b('0x35')](respondWithFilteredResult(_0x4d1402,_0x88959b))[_0x352b('0x51')](handleError(_0x4d1402,null));};exports['getHopperHistories']=function(_0x4f0829,_0x36e9d0,_0x29f865){var _0x43f2e7={'raw':!![],'where':{}};var _0x49c579={};var _0x262239={'count':0x0,'rows':[]};return db[_0x352b('0x4c')][_0x352b('0x62')]({'where':{'id':_0x4f0829['params']['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x36e9d0,null))['then'](function(_0xc31378){if(_0xc31378){_0x49c579[_0x352b('0x3c')]=_[_0x352b('0x3e')](db[_0x352b('0x65')][_0x352b('0x3a')]);_0x49c579[_0x352b('0x3d')]=_[_0x352b('0x3e')](_0x4f0829['query']);_0x49c579[_0x352b('0x3f')]=_[_0x352b('0x40')](_0x49c579[_0x352b('0x3c')],_0x49c579['query']);_0x43f2e7[_0x352b('0x42')]=_[_0x352b('0x40')](_0x49c579[_0x352b('0x3c')],qs[_0x352b('0x41')](_0x4f0829[_0x352b('0x3d')]['fields']));_0x43f2e7[_0x352b('0x42')]=_0x43f2e7[_0x352b('0x42')][_0x352b('0x43')]?_0x43f2e7[_0x352b('0x42')]:_0x49c579[_0x352b('0x3c')];if(!_0x4f0829[_0x352b('0x3d')][_0x352b('0x44')]('nolimit')){_0x43f2e7[_0x352b('0x20')]=qs[_0x352b('0x20')](_0x4f0829[_0x352b('0x3d')][_0x352b('0x20')]);_0x43f2e7[_0x352b('0x1f')]=qs['offset'](_0x4f0829['query'][_0x352b('0x1f')]);}_0x43f2e7[_0x352b('0x46')]=qs['sort'](_0x4f0829[_0x352b('0x3d')][_0x352b('0x47')]);_0x43f2e7[_0x352b('0x48')]=qs[_0x352b('0x3f')](_[_0x352b('0x49')](_0x4f0829[_0x352b('0x3d')],_0x49c579[_0x352b('0x3f')]));_0x43f2e7[_0x352b('0x48')][_0x352b('0x64')]=_0xc31378['id'];if(_0x4f0829[_0x352b('0x3d')][_0x352b('0x2d')]){_0x43f2e7[_0x352b('0x48')]=_['merge'](_0x43f2e7[_0x352b('0x48')],{'$or':_['map'](_0x43f2e7['attributes'],function(_0x2a0c53){var _0x412ebb={};_0x412ebb[_0x2a0c53]={'$like':'%'+_0x4f0829['query'][_0x352b('0x2d')]+'%'};return _0x412ebb;})});}_0x43f2e7=_['merge']({},_0x43f2e7,_0x4f0829[_0x352b('0x4b')]);return db['CmHopperHistory'][_0x352b('0x1e')]({'where':_0x43f2e7[_0x352b('0x48')]})['then'](function(_0x32bb65){_0x262239[_0x352b('0x1e')]=_0x32bb65;if(_0x4f0829[_0x352b('0x3d')][_0x352b('0x4d')]){_0x43f2e7['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x352b('0x4f')](_0x43f2e7);})['then'](function(_0x594e23){_0x262239[_0x352b('0x50')]=_0x594e23;return _0x262239;});}})['then'](respondWithFilteredResult(_0x36e9d0,_0x43f2e7))[_0x352b('0x51')](handleError(_0x36e9d0,null));};exports['getHopperFinals']=function(_0x4c0ffb,_0x5ae3b5,_0x28ed67){var _0x27d17e={'raw':!![],'where':{}};var _0x5938f4={};var _0x2e1074={'count':0x0,'rows':[]};return db[_0x352b('0x4c')][_0x352b('0x62')]({'where':{'id':_0x4c0ffb['params']['id']}})['then'](handleEntityNotFound(_0x5ae3b5,null))[_0x352b('0x35')](function(_0x1d0004){if(_0x1d0004){_0x5938f4['model']=_[_0x352b('0x3e')](db[_0x352b('0x66')][_0x352b('0x3a')]);_0x5938f4[_0x352b('0x3d')]=_[_0x352b('0x3e')](_0x4c0ffb[_0x352b('0x3d')]);_0x5938f4[_0x352b('0x3f')]=_[_0x352b('0x40')](_0x5938f4['model'],_0x5938f4[_0x352b('0x3d')]);_0x27d17e[_0x352b('0x42')]=_['intersection'](_0x5938f4[_0x352b('0x3c')],qs[_0x352b('0x41')](_0x4c0ffb[_0x352b('0x3d')][_0x352b('0x41')]));_0x27d17e[_0x352b('0x42')]=_0x27d17e[_0x352b('0x42')][_0x352b('0x43')]?_0x27d17e[_0x352b('0x42')]:_0x5938f4['model'];if(!_0x4c0ffb[_0x352b('0x3d')]['hasOwnProperty'](_0x352b('0x45'))){_0x27d17e['limit']=qs[_0x352b('0x20')](_0x4c0ffb[_0x352b('0x3d')][_0x352b('0x20')]);_0x27d17e['offset']=qs[_0x352b('0x1f')](_0x4c0ffb[_0x352b('0x3d')][_0x352b('0x1f')]);}_0x27d17e[_0x352b('0x46')]=qs[_0x352b('0x47')](_0x4c0ffb[_0x352b('0x3d')][_0x352b('0x47')]);_0x27d17e[_0x352b('0x48')]=qs[_0x352b('0x3f')](_[_0x352b('0x49')](_0x4c0ffb[_0x352b('0x3d')],_0x5938f4[_0x352b('0x3f')]));_0x27d17e[_0x352b('0x48')][_0x352b('0x64')]=_0x1d0004['id'];if(_0x4c0ffb[_0x352b('0x3d')][_0x352b('0x2d')]){_0x27d17e[_0x352b('0x48')]=_[_0x352b('0x4a')](_0x27d17e[_0x352b('0x48')],{'$or':_[_0x352b('0x2e')](_0x27d17e[_0x352b('0x42')],function(_0xa8fe27){var _0x1c9380={};_0x1c9380[_0xa8fe27]={'$like':'%'+_0x4c0ffb['query']['filter']+'%'};return _0x1c9380;})});}_0x27d17e=_[_0x352b('0x4a')]({},_0x27d17e,_0x4c0ffb[_0x352b('0x4b')]);return db['CmHopperFinal'][_0x352b('0x1e')]({'where':_0x27d17e['where']})[_0x352b('0x35')](function(_0x2b75f1){_0x2e1074[_0x352b('0x1e')]=_0x2b75f1;if(_0x4c0ffb[_0x352b('0x3d')]['includeAll']){_0x27d17e['include']=[{'all':!![]}];}return db[_0x352b('0x66')]['findAll'](_0x27d17e);})[_0x352b('0x35')](function(_0x75fe30){_0x2e1074[_0x352b('0x50')]=_0x75fe30;return _0x2e1074;});}})['then'](respondWithFilteredResult(_0x5ae3b5,_0x27d17e))[_0x352b('0x51')](handleError(_0x5ae3b5,null));};exports['getHopperBlacks']=function(_0x24a879,_0x4aab25,_0x44c4bf){var _0x139973={'raw':!![],'where':{}};var _0x5200e3={};var _0x599f2b={'count':0x0,'rows':[]};return db[_0x352b('0x4c')][_0x352b('0x62')]({'where':{'id':_0x24a879[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x4aab25,null))[_0x352b('0x35')](function(_0x1690a8){if(_0x1690a8){_0x5200e3[_0x352b('0x3c')]=_[_0x352b('0x3e')](db[_0x352b('0x67')][_0x352b('0x3a')]);_0x5200e3['query']=_[_0x352b('0x3e')](_0x24a879[_0x352b('0x3d')]);_0x5200e3[_0x352b('0x3f')]=_['intersection'](_0x5200e3[_0x352b('0x3c')],_0x5200e3[_0x352b('0x3d')]);_0x139973['attributes']=_[_0x352b('0x40')](_0x5200e3[_0x352b('0x3c')],qs[_0x352b('0x41')](_0x24a879[_0x352b('0x3d')][_0x352b('0x41')]));_0x139973[_0x352b('0x42')]=_0x139973[_0x352b('0x42')][_0x352b('0x43')]?_0x139973['attributes']:_0x5200e3[_0x352b('0x3c')];if(!_0x24a879[_0x352b('0x3d')]['hasOwnProperty'](_0x352b('0x45'))){_0x139973['limit']=qs[_0x352b('0x20')](_0x24a879[_0x352b('0x3d')][_0x352b('0x20')]);_0x139973[_0x352b('0x1f')]=qs[_0x352b('0x1f')](_0x24a879[_0x352b('0x3d')][_0x352b('0x1f')]);}_0x139973[_0x352b('0x46')]=qs[_0x352b('0x47')](_0x24a879[_0x352b('0x3d')][_0x352b('0x47')]);_0x139973[_0x352b('0x48')]=qs[_0x352b('0x3f')](_[_0x352b('0x49')](_0x24a879[_0x352b('0x3d')],_0x5200e3[_0x352b('0x3f')]));_0x139973[_0x352b('0x48')][_0x352b('0x64')]=_0x1690a8['id'];if(_0x24a879[_0x352b('0x3d')][_0x352b('0x2d')]){_0x139973[_0x352b('0x48')]=_[_0x352b('0x4a')](_0x139973[_0x352b('0x48')],{'$or':_[_0x352b('0x2e')](_0x139973[_0x352b('0x42')],function(_0x43a092){var _0x1b0dc0={};_0x1b0dc0[_0x43a092]={'$like':'%'+_0x24a879[_0x352b('0x3d')]['filter']+'%'};return _0x1b0dc0;})});}_0x139973=_[_0x352b('0x4a')]({},_0x139973,_0x24a879[_0x352b('0x4b')]);return db[_0x352b('0x67')]['count']({'where':_0x139973[_0x352b('0x48')]})[_0x352b('0x35')](function(_0x2d010d){_0x599f2b[_0x352b('0x1e')]=_0x2d010d;if(_0x24a879['query'][_0x352b('0x4d')]){_0x139973[_0x352b('0x4e')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x139973);})[_0x352b('0x35')](function(_0x586fbd){_0x599f2b[_0x352b('0x50')]=_0x586fbd;return _0x599f2b;});}})['then'](respondWithFilteredResult(_0x4aab25,_0x139973))[_0x352b('0x51')](handleError(_0x4aab25,null));};exports[_0x352b('0x68')]=function(_0x578d9b,_0x421e94,_0xea00db){var _0x52549a={};var _0x428efe={};var _0x3afc05;var _0x2f7ee0;return db[_0x352b('0x4c')][_0x352b('0x62')]({'where':{'id':_0x578d9b[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x421e94,null))[_0x352b('0x35')](function(_0x33117c){if(_0x33117c){_0x3afc05=_0x33117c;_0x428efe['model']=_[_0x352b('0x3e')](db[_0x352b('0x69')][_0x352b('0x3a')]);_0x428efe['query']=_[_0x352b('0x3e')](_0x578d9b[_0x352b('0x3d')]);_0x428efe[_0x352b('0x3f')]=_['intersection'](_0x428efe[_0x352b('0x3c')],_0x428efe['query']);_0x52549a['attributes']=_[_0x352b('0x40')](_0x428efe[_0x352b('0x3c')],qs[_0x352b('0x41')](_0x578d9b[_0x352b('0x3d')]['fields']));_0x52549a['attributes']=_0x52549a[_0x352b('0x42')][_0x352b('0x43')]?_0x52549a[_0x352b('0x42')]:_0x428efe[_0x352b('0x3c')];_0x52549a[_0x352b('0x46')]=qs[_0x352b('0x47')](_0x578d9b[_0x352b('0x3d')]['sort']);_0x52549a[_0x352b('0x48')]=qs[_0x352b('0x3f')](_[_0x352b('0x49')](_0x578d9b['query'],_0x428efe[_0x352b('0x3f')]));if(_0x578d9b[_0x352b('0x3d')][_0x352b('0x2d')]){_0x52549a[_0x352b('0x48')]=_['merge'](_0x52549a['where'],{'$or':_[_0x352b('0x2e')](_0x52549a['attributes'],function(_0x5e4a14){var _0x17d962={};_0x17d962[_0x5e4a14]={'$like':'%'+_0x578d9b[_0x352b('0x3d')][_0x352b('0x2d')]+'%'};return _0x17d962;})});}_0x52549a=_['merge']({},_0x52549a,_0x578d9b[_0x352b('0x4b')]);return _0x3afc05[_0x352b('0x68')](_0x52549a);}})[_0x352b('0x35')](function(_0x2884a5){if(_0x2884a5){_0x2f7ee0=_0x2884a5[_0x352b('0x43')];if(!_0x578d9b[_0x352b('0x3d')][_0x352b('0x44')](_0x352b('0x45'))){_0x52549a['limit']=qs[_0x352b('0x20')](_0x578d9b['query'][_0x352b('0x20')]);_0x52549a['offset']=qs[_0x352b('0x1f')](_0x578d9b[_0x352b('0x3d')][_0x352b('0x1f')]);}return _0x3afc05['getTeams'](_0x52549a);}})[_0x352b('0x35')](function(_0xcdda8a){if(_0xcdda8a){return _0xcdda8a?{'count':_0x2f7ee0,'rows':_0xcdda8a}:null;}})[_0x352b('0x35')](respondWithResult(_0x421e94,null))[_0x352b('0x51')](handleError(_0x421e94,null));};exports['addTeams']=function(_0xc1d42f,_0x36003b,_0x3cece4){var _0x24ecb0=_0xc1d42f[_0x352b('0x5d')]['teams'];var _0x1a70f4=_['map'](_0x24ecb0,'id');return db[_0x352b('0x69')][_0x352b('0x4f')]({'where':{'id':_0x1a70f4},'attributes':['id'],'include':[{'model':db[_0x352b('0x6a')],'as':_0x352b('0x6b'),'attributes':['id','name',_0x352b('0x6c'),_0x352b('0x6d'),_0x352b('0x6e')],'raw':!![]}]})[_0x352b('0x35')](function(_0x59fe1f){if(_0x59fe1f){var _0x46e96b=_[_0x352b('0x6f')](_0x59fe1f,function(_0x1c099c){var _0xf16b33=_0x1c099c[_0x352b('0x28')]({'plain':!![]});_0xf16b33[_0x352b('0x6b')][_0x352b('0x70')](function(_0x188415){_0x188415[_0x352b('0x71')]=_['find'](_0x24ecb0,{'id':_0xf16b33['id']})[_0x352b('0x71')];});return _0xf16b33[_0x352b('0x6b')];});return db[_0x352b('0x4c')][_0x352b('0x32')]({'where':{'id':_0xc1d42f[_0x352b('0x53')]['id']}})[_0x352b('0x35')](function(_0x4286fd){return db[_0x352b('0x72')][_0x352b('0x73')](function(_0x5bd9f5){return _0x4286fd[_0x352b('0x74')](_0x1a70f4,{'transaction':_0x5bd9f5})[_0x352b('0x35')](function(){return BPromise[_0x352b('0x75')](_0x24ecb0,function(_0x4ccb99){return db[_0x352b('0x76')]['upsert']({'TeamId':_0x4ccb99['id'],'VoiceQueueId':_0xc1d42f[_0x352b('0x53')]['id'],'penalty':_0x4ccb99['penalty']},{'transaction':_0x5bd9f5});});})[_0x352b('0x35')](function(){return BPromise[_0x352b('0x75')](_0x46e96b,function(_0x396cd4){return db[_0x352b('0x77')][_0x352b('0x78')]({'where':{'UserId':_0x396cd4['id'],'VoiceQueueId':_0xc1d42f[_0x352b('0x53')]['id']},'defaults':{'penalty':_0x396cd4[_0x352b('0x71')]},'transaction':_0x5bd9f5});});})[_0x352b('0x35')](function(){return BPromise[_0x352b('0x75')](_[_0x352b('0x2d')](_0x46e96b,{'online':!![]}),function(_0xa77a7f){return db['UserVoiceQueueRt'][_0x352b('0x79')]({'membername':_0xa77a7f['name'],'UserId':_0xa77a7f['id'],'queue_name':_0x4286fd[_0x352b('0x33')],'VoiceQueueId':_0x4286fd['id'],'interface':_[_0x352b('0x7a')](_0xa77a7f[_0x352b('0x6e')])?util[_0x352b('0x7b')](_0x352b('0x7c'),_0xa77a7f[_0x352b('0x33')]):_0xa77a7f[_0x352b('0x6e')],'paused':_0xa77a7f[_0x352b('0x6d')]||![],'penalty':_0xa77a7f['penalty']},{'transaction':_0x5bd9f5});});})[_0x352b('0x35')](function(){_0x46e96b[_0x352b('0x70')](function(_0x415ee3){socket[_0x352b('0x7d')]('userVoiceQueue:save',{'UserId':_0x415ee3['id'],'VoiceQueueId':_0x4286fd['id']});});});});});}})['then'](respondWithStatusCode(_0x36003b,null))[_0x352b('0x51')](handleError(_0x36003b,null));};exports['removeTeams']=function(_0x18b131,_0x5710c6,_0x2d5bb8){return db[_0x352b('0x69')][_0x352b('0x4f')]({'where':{'id':_0x18b131[_0x352b('0x3d')][_0x352b('0x7e')]},'attributes':['id'],'include':[{'model':db[_0x352b('0x6a')],'as':_0x352b('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5710c6,null))['then'](function(_0x5d85b3){var _0xf9360a=_['map'](_0x5d85b3,'id');var _0x57e39b=[];var _0x180901=[];var _0x2748f1=squel[_0x352b('0x7f')]();_0x2748f1[_0x352b('0x80')](_0x352b('0x81'))[_0x352b('0x82')](_0x352b('0x83'),'tq')['join']('user_has_teams','ut',_0x352b('0x84'))[_0x352b('0x48')](_0x352b('0x85'),_0x18b131[_0x352b('0x53')]['id']);for(var _0x16a942=0x0;_0x16a942<_0x5d85b3[_0x352b('0x43')];_0x16a942+=0x1){let _0x469699=_0x5d85b3[_0x16a942];for(var _0x2cac9b=0x0;_0x2cac9b<_0x469699[_0x352b('0x6b')][_0x352b('0x43')];_0x2cac9b+=0x1){let _0x19f098=_0x469699['Agents'][_0x2cac9b];var _0x37c368=_0x2748f1[_0x352b('0x5b')]();_0x37c368[_0x352b('0x48')]('ut.UserId\x20=\x20?',_0x19f098['id']);_0x180901['push'](db[_0x352b('0x72')][_0x352b('0x3d')](_0x37c368[_0x352b('0x86')](),{'type':db['sequelize']['QueryTypes'][_0x352b('0x87')]})[_0x352b('0x35')](function(_0x133813){if(_0x133813[_0x352b('0x43')]===0x1){return _0x19f098['id'];}else{var _0x830ac5=_['every'](_['map'](_0x133813,_0x352b('0x88')),function(_0x527547){return _[_0x352b('0x30')](_0xf9360a,_0x527547);});if(_0x830ac5){return _0x19f098['id'];}}}));}}return BPromise[_0x352b('0x89')](_0x180901)[_0x352b('0x35')](function(_0x276140){_0x57e39b=_(_0x57e39b)[_0x352b('0x8a')](_0x276140)['compact']()['value']();return db['VoiceQueue'][_0x352b('0x32')]({'where':{'id':_0x18b131['params']['id']}})[_0x352b('0x35')](function(_0x23cbb9){return db['sequelize'][_0x352b('0x73')](function(_0x20f582){return _0x23cbb9[_0x352b('0x8b')](_0x18b131['query'][_0x352b('0x7e')],{'transaction':_0x20f582})['then'](function(){if(!_[_0x352b('0x8c')](_0x57e39b)){return _0x23cbb9[_0x352b('0x8d')](_0x57e39b,{'transaction':_0x20f582})[_0x352b('0x35')](function(){return db[_0x352b('0x8e')][_0x352b('0x27')]({'where':{'VoiceQueueId':_0x18b131[_0x352b('0x53')]['id'],'UserId':_0x57e39b},'transaction':_0x20f582});});}})['then'](function(){_0x57e39b[_0x352b('0x70')](function(_0x234ae4){socket[_0x352b('0x7d')](_0x352b('0x8f'),{'UserId':_0x234ae4,'VoiceQueueId':_0x23cbb9['id']});});});});});});})[_0x352b('0x35')](respondWithStatusCode(_0x5710c6,null))[_0x352b('0x51')](handleError(_0x5710c6,null));};exports[_0x352b('0x90')]=function(_0x47b5a7,_0x5b54f6,_0x1e3f3e){var _0x230bd5,_0x5e4ed5;return db[_0x352b('0x4c')][_0x352b('0x32')]({'where':{'id':_0x47b5a7[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x5b54f6,null))[_0x352b('0x35')](function(_0x13f580){if(_0x13f580){_0x5e4ed5=_0x13f580;return _0x13f580['addAgents'](_0x47b5a7[_0x352b('0x5d')][_0x352b('0x7e')],_[_0x352b('0x5e')](_0x47b5a7[_0x352b('0x5d')],['ids','id'])||{})[_0x352b('0x91')](function(_0x101efc){for(var _0x391006=0x0;_0x391006<_0x47b5a7['body']['ids'][_0x352b('0x43')];_0x391006+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':_0x47b5a7['body'][_0x352b('0x7e')][_0x391006],'VoiceQueueId':_0x47b5a7[_0x352b('0x53')]['id']});}return _0x101efc;});}})[_0x352b('0x35')](function(_0xdfc929){_0x230bd5=_0xdfc929||[];if(_0x5e4ed5){return db[_0x352b('0x6a')][_0x352b('0x4f')]({'where':{'id':_0x47b5a7[_0x352b('0x5d')][_0x352b('0x7e')]},'attributes':['id',_0x352b('0x33'),_0x352b('0x6c'),'voicePause',_0x352b('0x6e')],'raw':!![]});}})[_0x352b('0x35')](function(_0x53f970){if(!_[_0x352b('0x8c')](_0x53f970)){var _0x7a0de4=[];for(var _0x20c9a8=0x0;_0x20c9a8<_0x53f970[_0x352b('0x43')];_0x20c9a8++){if(_0x53f970[_0x20c9a8][_0x352b('0x6c')]){_0x7a0de4['push'](db[_0x352b('0x8e')][_0x352b('0x79')]({'membername':_0x53f970[_0x20c9a8]['name'],'UserId':_0x53f970[_0x20c9a8]['id'],'queue_name':_0x5e4ed5['name'],'VoiceQueueId':_0x5e4ed5['id'],'interface':_[_0x352b('0x7a')](_0x53f970[_0x20c9a8][_0x352b('0x6e')])?util[_0x352b('0x7b')](_0x352b('0x7c'),_0x53f970[_0x20c9a8][_0x352b('0x33')]):_0x53f970[_0x20c9a8][_0x352b('0x6e')],'paused':_0x53f970[_0x20c9a8][_0x352b('0x6d')]||![],'penalty':_0x47b5a7[_0x352b('0x5d')]['penalty']||0x0}));}}return BPromise['all'](_0x7a0de4);}})[_0x352b('0x35')](function(){return _0x230bd5;})[_0x352b('0x35')](respondWithResult(_0x5b54f6,null))['catch'](handleError(_0x5b54f6,null));};exports[_0x352b('0x8d')]=function(_0xb7903b,_0x3ca1c9,_0x1d2375){return db[_0x352b('0x4c')][_0x352b('0x32')]({'where':{'id':_0xb7903b[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x3ca1c9,null))[_0x352b('0x35')](function(_0x2ffc0a){if(_0x2ffc0a){return _0x2ffc0a[_0x352b('0x8d')](_0xb7903b[_0x352b('0x3d')][_0x352b('0x7e')])[_0x352b('0x35')](function(){if(_[_0x352b('0x92')](_0xb7903b[_0x352b('0x3d')][_0x352b('0x7e')])){for(var _0x5a4ef3=0x0;_0x5a4ef3<_0xb7903b[_0x352b('0x3d')][_0x352b('0x7e')]['length'];_0x5a4ef3+=0x1){socket[_0x352b('0x7d')](_0x352b('0x8f'),{'UserId':Number(_0xb7903b['query'][_0x352b('0x7e')][_0x5a4ef3]),'VoiceQueueId':Number(_0xb7903b[_0x352b('0x53')]['id'])});}}else{socket[_0x352b('0x7d')]('userVoiceQueue:remove',{'UserId':Number(_0xb7903b[_0x352b('0x3d')][_0x352b('0x7e')]),'VoiceQueueId':Number(_0xb7903b[_0x352b('0x53')]['id'])});}});}})[_0x352b('0x35')](function(_0xd14752){return db['UserVoiceQueueRt'][_0x352b('0x27')]({'where':{'VoiceQueueId':_0xb7903b[_0x352b('0x53')]['id'],'UserId':_0xb7903b['query'][_0x352b('0x7e')]}})['then'](function(){return _0xd14752;});})['then'](respondWithStatusCode(_0x3ca1c9,null))[_0x352b('0x51')](handleError(_0x3ca1c9,null));};exports[_0x352b('0x93')]=function(_0x3d44bd,_0x2f5557,_0x39d332){var _0x5bde89={};var _0x5a9226={};var _0x3b631a;var _0x19d457;return db[_0x352b('0x4c')][_0x352b('0x62')]({'where':{'id':_0x3d44bd[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x2f5557,null))[_0x352b('0x35')](function(_0x44c8f1){if(_0x44c8f1){_0x3b631a=_0x44c8f1;_0x5a9226[_0x352b('0x3c')]=_[_0x352b('0x3e')](db[_0x352b('0x6a')][_0x352b('0x3a')]);_0x5a9226[_0x352b('0x3d')]=_[_0x352b('0x3e')](_0x3d44bd[_0x352b('0x3d')]);_0x5a9226[_0x352b('0x3f')]=_[_0x352b('0x40')](_0x5a9226[_0x352b('0x3c')],_0x5a9226[_0x352b('0x3d')]);_0x5bde89[_0x352b('0x42')]=_['intersection'](_0x5a9226[_0x352b('0x3c')],qs[_0x352b('0x41')](_0x3d44bd[_0x352b('0x3d')]['fields']));_0x5bde89[_0x352b('0x42')]=_0x5bde89[_0x352b('0x42')][_0x352b('0x43')]?_0x5bde89['attributes']:_0x5a9226[_0x352b('0x3c')];_0x5bde89[_0x352b('0x46')]=qs[_0x352b('0x47')](_0x3d44bd[_0x352b('0x3d')][_0x352b('0x47')]);_0x5bde89[_0x352b('0x48')]=qs[_0x352b('0x3f')](_['pick'](_0x3d44bd['query'],_0x5a9226['filters']));if(_0x3d44bd['query'][_0x352b('0x2d')]){_0x5bde89[_0x352b('0x48')]=_[_0x352b('0x4a')](_0x5bde89[_0x352b('0x48')],{'$or':_[_0x352b('0x2e')](_0x5bde89[_0x352b('0x42')],function(_0x28d9d5){var _0x4b5721={};_0x4b5721[_0x28d9d5]={'$like':'%'+_0x3d44bd[_0x352b('0x3d')][_0x352b('0x2d')]+'%'};return _0x4b5721;})});}_0x5bde89=_['merge']({},_0x5bde89,_0x3d44bd[_0x352b('0x4b')]);return _0x3b631a[_0x352b('0x93')](_0x5bde89);}})[_0x352b('0x35')](function(_0x16bdc9){if(_0x16bdc9){_0x19d457=_0x16bdc9[_0x352b('0x43')];if(!_0x3d44bd[_0x352b('0x3d')]['hasOwnProperty'](_0x352b('0x45'))){_0x5bde89['limit']=qs['limit'](_0x3d44bd[_0x352b('0x3d')][_0x352b('0x20')]);_0x5bde89[_0x352b('0x1f')]=qs[_0x352b('0x1f')](_0x3d44bd[_0x352b('0x3d')][_0x352b('0x1f')]);}return _0x3b631a[_0x352b('0x93')](_0x5bde89);}})[_0x352b('0x35')](function(_0x280339){if(_0x280339){return _0x280339?{'count':_0x19d457,'rows':_0x280339}:null;}})['then'](respondWithResult(_0x2f5557,null))[_0x352b('0x51')](handleError(_0x2f5557,null));};exports[_0x352b('0x94')]=function(_0x298c85,_0x11459a,_0x4c5043){var _0x24d101={};var _0x21da47={};var _0x21376a;var _0x16a20d;return db[_0x352b('0x4c')]['findOne']({'where':{'id':_0x298c85[_0x352b('0x53')]['id']}})['then'](handleEntityNotFound(_0x11459a,null))['then'](function(_0x365b5c){if(_0x365b5c){_0x21376a=_0x365b5c;_0x21da47[_0x352b('0x3c')]=_['keys'](db[_0x352b('0x8e')][_0x352b('0x3a')]);_0x21da47[_0x352b('0x3d')]=_[_0x352b('0x3e')](_0x298c85[_0x352b('0x3d')]);_0x21da47[_0x352b('0x3f')]=_[_0x352b('0x40')](_0x21da47[_0x352b('0x3c')],_0x21da47[_0x352b('0x3d')]);_0x24d101['attributes']=_['intersection'](_0x21da47['model'],qs[_0x352b('0x41')](_0x298c85[_0x352b('0x3d')]['fields']));_0x24d101[_0x352b('0x42')]=_0x24d101[_0x352b('0x42')][_0x352b('0x43')]?_0x24d101[_0x352b('0x42')]:_0x21da47[_0x352b('0x3c')];_0x24d101[_0x352b('0x46')]=qs[_0x352b('0x47')](_0x298c85[_0x352b('0x3d')][_0x352b('0x47')]);_0x24d101['where']=qs[_0x352b('0x3f')](_[_0x352b('0x49')](_0x298c85[_0x352b('0x3d')],_0x21da47['filters']));if(_0x298c85[_0x352b('0x3d')][_0x352b('0x2d')]){_0x24d101[_0x352b('0x48')]=_[_0x352b('0x4a')](_0x24d101[_0x352b('0x48')],{'$or':_[_0x352b('0x2e')](_0x24d101['attributes'],function(_0x186551){var _0x4f6655={};_0x4f6655[_0x186551]={'$like':'%'+_0x298c85['query'][_0x352b('0x2d')]+'%'};return _0x4f6655;})});}_0x24d101=_[_0x352b('0x4a')]({},_0x24d101,_0x298c85[_0x352b('0x4b')]);return _0x21376a['getMembers'](_0x24d101);}})['then'](function(_0x3f073d){if(_0x3f073d){_0x16a20d=_0x3f073d['length'];if(!_0x298c85[_0x352b('0x3d')][_0x352b('0x44')](_0x352b('0x45'))){_0x24d101[_0x352b('0x20')]=qs[_0x352b('0x20')](_0x298c85[_0x352b('0x3d')][_0x352b('0x20')]);_0x24d101[_0x352b('0x1f')]=qs['offset'](_0x298c85[_0x352b('0x3d')]['offset']);}return _0x21376a['getMembers'](_0x24d101);}})['then'](function(_0x36f342){return _0x36f342?{'count':_0x16a20d,'rows':_0x36f342}:null;})[_0x352b('0x35')](respondWithResult(_0x11459a,null))['catch'](handleError(_0x11459a,null));};exports['getLists']=function(_0x4c348e,_0xc682e4,_0x395d09){var _0x21426b={};var _0x10b88d={};var _0xb53705;var _0x5198e8;return db['VoiceQueue']['findOne']({'where':{'id':_0x4c348e[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0xc682e4,null))['then'](function(_0x4ecd4c){if(_0x4ecd4c){_0xb53705=_0x4ecd4c;_0x10b88d[_0x352b('0x3c')]=_[_0x352b('0x3e')](db[_0x352b('0x95')][_0x352b('0x3a')]);_0x10b88d[_0x352b('0x3d')]=_['keys'](_0x4c348e[_0x352b('0x3d')]);_0x10b88d[_0x352b('0x3f')]=_['intersection'](_0x10b88d[_0x352b('0x3c')],_0x10b88d['query']);_0x21426b[_0x352b('0x42')]=_[_0x352b('0x40')](_0x10b88d[_0x352b('0x3c')],qs[_0x352b('0x41')](_0x4c348e[_0x352b('0x3d')][_0x352b('0x41')]));_0x21426b[_0x352b('0x42')]=_0x21426b[_0x352b('0x42')][_0x352b('0x43')]?_0x21426b['attributes']:_0x10b88d[_0x352b('0x3c')];_0x21426b[_0x352b('0x46')]=qs[_0x352b('0x47')](_0x4c348e['query'][_0x352b('0x47')]);_0x21426b[_0x352b('0x48')]=qs[_0x352b('0x3f')](_[_0x352b('0x49')](_0x4c348e[_0x352b('0x3d')],_0x10b88d[_0x352b('0x3f')]));if(_0x4c348e[_0x352b('0x3d')][_0x352b('0x2d')]){_0x21426b[_0x352b('0x48')]=_[_0x352b('0x4a')](_0x21426b[_0x352b('0x48')],{'$or':_[_0x352b('0x2e')](_0x21426b['attributes'],function(_0x33e4cd){var _0x30a888={};_0x30a888[_0x33e4cd]={'$like':'%'+_0x4c348e[_0x352b('0x3d')]['filter']+'%'};return _0x30a888;})});}_0x21426b=_[_0x352b('0x4a')]({},_0x21426b,_0x4c348e['options']);return _0xb53705['getLists'](_0x21426b);}})[_0x352b('0x35')](function(_0x54c4c2){if(_0x54c4c2){_0x5198e8=_0x54c4c2[_0x352b('0x43')];if(!_0x4c348e['query'][_0x352b('0x44')]('nolimit')){_0x21426b[_0x352b('0x20')]=qs[_0x352b('0x20')](_0x4c348e[_0x352b('0x3d')][_0x352b('0x20')]);_0x21426b['offset']=qs[_0x352b('0x1f')](_0x4c348e['query']['offset']);}return _0xb53705[_0x352b('0x96')](_0x21426b);}})['then'](function(_0x55d356){if(_0x55d356){return _0x55d356?{'count':_0x5198e8,'rows':_0x55d356}:null;}})[_0x352b('0x35')](respondWithResult(_0xc682e4,null))[_0x352b('0x51')](handleError(_0xc682e4,null));};exports[_0x352b('0x97')]=function(_0x3c71d6,_0x3f84d5,_0x299d9b){var _0x541a63,_0x11f12e;return db[_0x352b('0x4c')]['find']({'where':{'id':_0x3c71d6[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x3f84d5,null))[_0x352b('0x35')](function(_0x46fd5b){if(_0x46fd5b){_0x11f12e=_0x46fd5b;return _0x46fd5b['addLists'](_0x3c71d6[_0x352b('0x5d')][_0x352b('0x7e')],_[_0x352b('0x5e')](_0x3c71d6[_0x352b('0x5d')],[_0x352b('0x7e'),'id'])||{});}return null;})['spread'](function(_0x579d64){var _0x38b3c8;_0x541a63=_0x579d64||[];var _0x2cf401=[];if(_0x579d64){for(var _0x4431b4=0x0;_0x4431b4<_0x579d64[_0x352b('0x43')];_0x4431b4+=0x1){var _0x1124fc=_0x579d64[_0x4431b4][_0x352b('0x28')]({'plain':!![]});_0x11f12e[_0x352b('0x98')]=_0x3c71d6[_0x352b('0x5d')][_0x352b('0x98')]?_0x3c71d6[_0x352b('0x5d')][_0x352b('0x98')]:_0x11f12e[_0x352b('0x98')];switch(_0x11f12e[_0x352b('0x98')]){case'always':_0x38b3c8=squel['insert']()[_0x352b('0x99')](_0x352b('0x9a'))[_0x352b('0x9b')](['phone',_0x352b('0x9c'),_0x352b('0x9d'),'ListId',_0x352b('0x64'),_0x352b('0x5c'),_0x352b('0x5f')],squel[_0x352b('0x7f')]()[_0x352b('0x80')](_0x352b('0x9e'),_0x352b('0x9e'))[_0x352b('0x80')](_0x352b('0x9f'),_0x352b('0x9c'))['field']('id','ContactId')[_0x352b('0x80')](_0x1124fc[_0x352b('0xa0')][_0x352b('0x86')](),_0x352b('0xa1'))['field'](_0x3c71d6[_0x352b('0x53')]['id'][_0x352b('0x86')](),'VoiceQueueId')[_0x352b('0x80')](_0x352b('0x9f'),_0x352b('0x5c'))[_0x352b('0x80')](_0x352b('0x9f'),'updatedAt')['from'](_0x352b('0xa2'))[_0x352b('0x48')]('deletedAt\x20IS\x20NULL')['where'](_0x352b('0xa3'),_0x1124fc[_0x352b('0xa0')][_0x352b('0x86')]())[_0x352b('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x352b('0x48')](_0x352b('0xa4'),squel['select']()[_0x352b('0x80')](_0x352b('0xa5'))[_0x352b('0x82')]('cm_hopper_final')[_0x352b('0x48')](_0x352b('0x85'),_0x3c71d6['params']['id'][_0x352b('0x86')]()))[_0x352b('0x48')](_0x352b('0xa4'),squel[_0x352b('0x7f')]()['field'](_0x352b('0xa6'))[_0x352b('0x82')]('cm_hopper')['where'](_0x352b('0x85'),_0x3c71d6[_0x352b('0x53')]['id'][_0x352b('0x86')]())))[_0x352b('0x86')]();break;case _0x352b('0xa7'):_0x38b3c8=squel[_0x352b('0xa8')]()[_0x352b('0x99')]('cm_hopper')['fromQuery']([_0x352b('0x9e'),'scheduledAt',_0x352b('0x9d'),_0x352b('0xa1'),_0x352b('0x64'),_0x352b('0x5c'),_0x352b('0x5f')],squel[_0x352b('0x7f')]()['field'](_0x352b('0x9e'),_0x352b('0x9e'))[_0x352b('0x80')](_0x352b('0x9f'),_0x352b('0x9c'))[_0x352b('0x80')]('id',_0x352b('0x9d'))['field'](_0x1124fc[_0x352b('0xa0')][_0x352b('0x86')](),_0x352b('0xa1'))[_0x352b('0x80')](_0x3c71d6['params']['id'][_0x352b('0x86')](),_0x352b('0x64'))[_0x352b('0x80')]('NOW()',_0x352b('0x5c'))[_0x352b('0x80')]('NOW()',_0x352b('0x5f'))['from'](_0x352b('0xa2'))[_0x352b('0x48')]('deletedAt\x20IS\x20NULL')[_0x352b('0x48')]('ListId\x20=\x20?',_0x1124fc['CmListId'][_0x352b('0x86')]())[_0x352b('0x48')](_0x352b('0xa9'))[_0x352b('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x352b('0x7f')]()['field'](_0x352b('0xa6'))['from'](_0x352b('0x9a'))['where'](_0x352b('0x85'),_0x3c71d6[_0x352b('0x53')]['id'][_0x352b('0x86')]())))[_0x352b('0x86')]();break;default:_0x38b3c8=squel[_0x352b('0xa8')]()['into'](_0x352b('0x9a'))['fromQuery']([_0x352b('0x9e'),_0x352b('0x9c'),_0x352b('0x9d'),_0x352b('0xa1'),_0x352b('0x64'),'createdAt',_0x352b('0x5f')],squel['select']()[_0x352b('0x80')](_0x352b('0x9e'),_0x352b('0x9e'))['field'](_0x352b('0x9f'),'scheduledAt')[_0x352b('0x80')]('id',_0x352b('0x9d'))[_0x352b('0x80')](_0x1124fc[_0x352b('0xa0')]['toString'](),_0x352b('0xa1'))['field'](_0x3c71d6[_0x352b('0x53')]['id'][_0x352b('0x86')](),_0x352b('0x64'))[_0x352b('0x80')]('NOW()',_0x352b('0x5c'))[_0x352b('0x80')](_0x352b('0x9f'),_0x352b('0x5f'))[_0x352b('0x82')]('cm_contacts')[_0x352b('0x48')](_0x352b('0xaa'))['where'](_0x352b('0xa3'),_0x1124fc[_0x352b('0xa0')]['toString']())[_0x352b('0x48')](_0x352b('0xa9')))[_0x352b('0x86')]();}_0x2cf401[_0x352b('0xab')](db[_0x352b('0x72')][_0x352b('0x3d')](_0x38b3c8));}return BPromise[_0x352b('0x89')](_0x2cf401);}})[_0x352b('0x35')](function(){return _0x541a63;})[_0x352b('0x35')](respondWithResult(_0x3f84d5,null))[_0x352b('0x51')](handleError(_0x3f84d5,null));};exports[_0x352b('0xac')]=function(_0xeffb7b,_0x3bed7e,_0x53dec2){return db[_0x352b('0x4c')][_0x352b('0x32')]({'where':{'id':_0xeffb7b[_0x352b('0x53')]['id']}})['then'](handleEntityNotFound(_0x3bed7e,null))[_0x352b('0x35')](function(_0x265185){if(_0x265185){return _0x265185[_0x352b('0xac')](_0xeffb7b[_0x352b('0x3d')]['ids']);}})[_0x352b('0x35')](function(_0x2adc5d){if(_0x2adc5d){return db[_0x352b('0x63')][_0x352b('0x27')]({'where':{'ListId':_0xeffb7b[_0x352b('0x3d')][_0x352b('0x7e')],'VoiceQueueId':_0xeffb7b[_0x352b('0x53')]['id']}})[_0x352b('0x35')](function(){return _0x2adc5d;});}})[_0x352b('0x35')](respondWithStatusCode(_0x3bed7e,null))['catch'](handleError(_0x3bed7e,null));};exports['getBlackLists']=function(_0x3fc8ed,_0x30f82e,_0x1d59aa){var _0x188969={};var _0x38b8ea={};var _0x56b47b;var _0x4c0311;return db['VoiceQueue'][_0x352b('0x62')]({'where':{'id':_0x3fc8ed[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x30f82e,null))['then'](function(_0x42bb2e){if(_0x42bb2e){_0x56b47b=_0x42bb2e;_0x38b8ea[_0x352b('0x3c')]=_['keys'](db[_0x352b('0x95')][_0x352b('0x3a')]);_0x38b8ea[_0x352b('0x3d')]=_['keys'](_0x3fc8ed[_0x352b('0x3d')]);_0x38b8ea[_0x352b('0x3f')]=_[_0x352b('0x40')](_0x38b8ea[_0x352b('0x3c')],_0x38b8ea[_0x352b('0x3d')]);_0x188969[_0x352b('0x42')]=_[_0x352b('0x40')](_0x38b8ea['model'],qs[_0x352b('0x41')](_0x3fc8ed[_0x352b('0x3d')][_0x352b('0x41')]));_0x188969[_0x352b('0x42')]=_0x188969[_0x352b('0x42')][_0x352b('0x43')]?_0x188969['attributes']:_0x38b8ea[_0x352b('0x3c')];_0x188969[_0x352b('0x46')]=qs[_0x352b('0x47')](_0x3fc8ed[_0x352b('0x3d')]['sort']);_0x188969[_0x352b('0x48')]=qs[_0x352b('0x3f')](_[_0x352b('0x49')](_0x3fc8ed[_0x352b('0x3d')],_0x38b8ea[_0x352b('0x3f')]));if(_0x3fc8ed[_0x352b('0x3d')][_0x352b('0x2d')]){_0x188969[_0x352b('0x48')]=_['merge'](_0x188969['where'],{'$or':_['map'](_0x188969[_0x352b('0x42')],function(_0x1d7dae){var _0x54a033={};_0x54a033[_0x1d7dae]={'$like':'%'+_0x3fc8ed[_0x352b('0x3d')][_0x352b('0x2d')]+'%'};return _0x54a033;})});}_0x188969=_[_0x352b('0x4a')]({},_0x188969,_0x3fc8ed[_0x352b('0x4b')]);return _0x56b47b[_0x352b('0xad')](_0x188969);}})[_0x352b('0x35')](function(_0xab5254){if(_0xab5254){_0x4c0311=_0xab5254['length'];if(!_0x3fc8ed[_0x352b('0x3d')][_0x352b('0x44')](_0x352b('0x45'))){_0x188969[_0x352b('0x20')]=qs[_0x352b('0x20')](_0x3fc8ed[_0x352b('0x3d')][_0x352b('0x20')]);_0x188969[_0x352b('0x1f')]=qs[_0x352b('0x1f')](_0x3fc8ed[_0x352b('0x3d')][_0x352b('0x1f')]);}return _0x56b47b[_0x352b('0xad')](_0x188969);}})[_0x352b('0x35')](function(_0x1dc0eb){if(_0x1dc0eb){return _0x1dc0eb?{'count':_0x4c0311,'rows':_0x1dc0eb}:null;}})[_0x352b('0x35')](respondWithResult(_0x30f82e,null))[_0x352b('0x51')](handleError(_0x30f82e,null));};exports[_0x352b('0xae')]=function(_0x53fa67,_0x3cf156,_0x572d49){var _0x1fab29,_0xac0d53;return db[_0x352b('0x4c')][_0x352b('0x32')]({'where':{'id':_0x53fa67[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x3cf156,null))[_0x352b('0x35')](function(_0x4628a0){if(_0x4628a0){_0xac0d53=_0x4628a0;return _0x4628a0[_0x352b('0xae')](_0x53fa67[_0x352b('0x5d')]['ids'],_[_0x352b('0x5e')](_0x53fa67[_0x352b('0x5d')],['ids','id'])||{});}return null;})[_0x352b('0x91')](function(_0x1e49fa){var _0xd1ccbc;_0x1fab29=_0x1e49fa||[];var _0x39f606=[];if(_0x1e49fa){for(var _0x3d66d4=0x0;_0x3d66d4<_0x1e49fa['length'];_0x3d66d4+=0x1){var _0x3d3e54=_0x1e49fa[_0x3d66d4][_0x352b('0x28')]({'plain':!![]});_0xd1ccbc=squel[_0x352b('0xa8')]()[_0x352b('0x99')](_0x352b('0xaf'))[_0x352b('0x9b')]([_0x352b('0x9e'),'ContactId','ListId',_0x352b('0x64'),'createdAt',_0x352b('0x5f')],squel[_0x352b('0x7f')]()[_0x352b('0x80')](_0x352b('0x9e'),_0x352b('0x9e'))[_0x352b('0x80')]('id',_0x352b('0x9d'))[_0x352b('0x80')](_0x3d3e54[_0x352b('0xa0')]['toString'](),_0x352b('0xa1'))[_0x352b('0x80')](_0x53fa67[_0x352b('0x53')]['id'][_0x352b('0x86')](),'VoiceQueueId')[_0x352b('0x80')](_0x352b('0x9f'),_0x352b('0x5c'))['field'](_0x352b('0x9f'),_0x352b('0x5f'))[_0x352b('0x82')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x352b('0x48')](_0x352b('0xa3'),_0x3d3e54[_0x352b('0xa0')][_0x352b('0x86')]())['where'](_0x352b('0xa9')))[_0x352b('0x86')]();_0x39f606[_0x352b('0xab')](db[_0x352b('0x72')][_0x352b('0x3d')](_0xd1ccbc));}return BPromise[_0x352b('0x89')](_0x39f606);}})[_0x352b('0x35')](function(){return _0x1fab29;})[_0x352b('0x35')](respondWithResult(_0x3cf156,null))[_0x352b('0x51')](handleError(_0x3cf156,null));};exports[_0x352b('0xb0')]=function(_0x5eab89,_0x3059cf,_0x214757){return db[_0x352b('0x4c')][_0x352b('0x32')]({'where':{'id':_0x5eab89[_0x352b('0x53')]['id']}})[_0x352b('0x35')](handleEntityNotFound(_0x3059cf,null))[_0x352b('0x35')](function(_0x171d36){if(_0x171d36){return _0x171d36[_0x352b('0xb0')](_0x5eab89[_0x352b('0x3d')][_0x352b('0x7e')]);}})[_0x352b('0x35')](function(_0x3ef2){if(_0x3ef2){return db['CmHopperBlack'][_0x352b('0x27')]({'where':{'ListId':_0x5eab89[_0x352b('0x3d')]['ids'],'VoiceQueueId':_0x5eab89[_0x352b('0x53')]['id']}})[_0x352b('0x35')](function(){return _0x3ef2;});}})[_0x352b('0x35')](respondWithStatusCode(_0x3059cf,null))[_0x352b('0x51')](handleError(_0x3059cf,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 76c79eb..6e8f74c 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 _0xf14f=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners','update'];(function(_0x5eb780,_0x29ee53){var _0x479a83=function(_0x1a4e70){while(--_0x1a4e70){_0x5eb780['push'](_0x5eb780['shift']());}};_0x479a83(++_0x29ee53);}(_0xf14f,0x1e2));var _0xff14=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0xf14f[_0xaaf2e2];return _0x28bc36;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xff14('0x0'))['db'][_0xff14('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xff14('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xff14('0x3'),'afterDestroy':_0xff14('0x4')};function emitEvent(_0x51c81e){return function(_0x2e3788,_0x242de6,_0x19a020){VoiceQueueEvents[_0xff14('0x5')](_0x51c81e+':'+_0x2e3788['id'],_0x2e3788);VoiceQueueEvents[_0xff14('0x5')](_0x51c81e,_0x2e3788);_0x19a020(null);};}for(var e in events){if(events[_0xff14('0x6')](e)){var event=events[e];VoiceQueue[_0xff14('0x7')](e,emitEvent(event));}}module[_0xff14('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x8266=['setMaxListeners','save','remove','emit','exports','events','../../mysqldb','VoiceQueue'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x8266,0x1dd));var _0x6826=function(_0x4c5f7c,_0x423d7f){_0x4c5f7c=_0x4c5f7c-0x0;var _0x434b8e=_0x8266[_0x4c5f7c];return _0x434b8e;};'use strict';var EventEmitter=require(_0x6826('0x0'));var VoiceQueue=require(_0x6826('0x1'))['db'][_0x6826('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6826('0x3')](0x0);var events={'afterCreate':_0x6826('0x4'),'afterUpdate':'update','afterDestroy':_0x6826('0x5')};function emitEvent(_0x5c2450){return function(_0x2ba3b6,_0x37aecf,_0x39b303){VoiceQueueEvents[_0x6826('0x6')](_0x5c2450+':'+_0x2ba3b6['id'],_0x2ba3b6);VoiceQueueEvents[_0x6826('0x6')](_0x5c2450,_0x2ba3b6);_0x39b303(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x6826('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 f5c81ee..19fa7ec 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 _0xf57a=['exports','define','voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes'];(function(_0xe30713,_0x770c52){var _0x7e0562=function(_0x5bcbf7){while(--_0x5bcbf7){_0xe30713['push'](_0xe30713['shift']());}};_0x7e0562(++_0x770c52);}(_0xf57a,0x123));var _0xaf57=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xf57a[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xaf57('0x0'));var util=require(_0xaf57('0x1'));var logger=require(_0xaf57('0x2'))('api');var moment=require('moment');var BPromise=require(_0xaf57('0x3'));var rp=require(_0xaf57('0x4'));var fs=require('fs');var path=require(_0xaf57('0x5'));var rimraf=require(_0xaf57('0x6'));var config=require(_0xaf57('0x7'));var attributes=require(_0xaf57('0x8'));module[_0xaf57('0x9')]=function(_0x2b65ee,_0x35a606){return _0x2b65ee[_0xaf57('0xa')]('VoiceQueue',attributes,{'tableName':_0xaf57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x614b=['path','rimraf','exports','voice_queues','lodash','util','bluebird','request-promise'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x614b,0x17c));var _0xb614=function(_0x512f8c,_0x3545c1){_0x512f8c=_0x512f8c-0x0;var _0x2099f8=_0x614b[_0x512f8c];return _0x2099f8;};'use strict';var _=require(_0xb614('0x0'));var util=require(_0xb614('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb614('0x2'));var rp=require(_0xb614('0x3'));var fs=require('fs');var path=require(_0xb614('0x4'));var rimraf=require(_0xb614('0x5'));var config=require('../../config/environment');var attributes=require('./voiceQueue.attributes');module[_0xb614('0x6')]=function(_0xcc6ec9,_0x463a93){return _0xcc6ec9['define']('VoiceQueue',attributes,{'tableName':_0xb614('0x7'),'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 9641f00..0f7f0c1 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 _0xc367=['VoiceQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','request','then','info','request\x20sent','debug','stringify','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','findAll','options','where','attributes','include','map','model','ShowVoiceQueue'];(function(_0x15e1b8,_0x10d3a9){var _0x46f7e9=function(_0xae110e){while(--_0xae110e){_0x15e1b8['push'](_0x15e1b8['shift']());}};_0x46f7e9(++_0x10d3a9);}(_0xc367,0x14b));var _0x7c36=function(_0x39dfce,_0x37f996){_0x39dfce=_0x39dfce-0x0;var _0x496ab3=_0xc367[_0x39dfce];return _0x496ab3;};'use strict';var _=require(_0x7c36('0x0'));var util=require(_0x7c36('0x1'));var moment=require(_0x7c36('0x2'));var BPromise=require(_0x7c36('0x3'));var rs=require(_0x7c36('0x4'));var fs=require('fs');var Redis=require(_0x7c36('0x5'));var db=require(_0x7c36('0x6'))['db'];var utils=require(_0x7c36('0x7'));var logger=require(_0x7c36('0x8'))(_0x7c36('0x9'));var config=require(_0x7c36('0xa'));var jayson=require(_0x7c36('0xb'));var client=jayson[_0x7c36('0xc')][_0x7c36('0xd')]({'port':0x232a});config[_0x7c36('0xe')]=_[_0x7c36('0xf')](config[_0x7c36('0xe')],{'host':_0x7c36('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c36('0xe')]));require(_0x7c36('0x11'))['register'](socket);function respondWithRpcPromise(_0x54be5f,_0x4f16a9,_0x1825bd){return new BPromise(function(_0x51d12d,_0x372688){return client[_0x7c36('0x12')](_0x54be5f,_0x1825bd)[_0x7c36('0x13')](function(_0x2f17fb){logger[_0x7c36('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x4f16a9,_0x7c36('0x15'));logger[_0x7c36('0x16')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x4f16a9,'request\x20sent',JSON[_0x7c36('0x17')](_0x2f17fb));if(_0x2f17fb['error']){if(_0x2f17fb[_0x7c36('0x18')]['code']===0x1f4){logger[_0x7c36('0x18')](_0x7c36('0x19'),_0x4f16a9,_0x2f17fb[_0x7c36('0x18')][_0x7c36('0x1a')]);return _0x372688(_0x2f17fb[_0x7c36('0x18')][_0x7c36('0x1a')]);}logger['error'](_0x7c36('0x19'),_0x4f16a9,_0x2f17fb['error'][_0x7c36('0x1a')]);return _0x51d12d(_0x2f17fb[_0x7c36('0x18')][_0x7c36('0x1a')]);}else{logger['info'](_0x7c36('0x19'),_0x4f16a9,'request\x20sent');_0x51d12d(_0x2f17fb[_0x7c36('0x1b')][_0x7c36('0x1a')]);}})[_0x7c36('0x1c')](function(_0x2008d2){logger['error'](_0x7c36('0x19'),_0x4f16a9,_0x2008d2);_0x372688(_0x2008d2);});});}exports[_0x7c36('0x1d')]=function(_0x352842){var _0x1af4ea=this;return new Promise(function(_0x5342dc,_0x5d5cba){return db['VoiceQueue'][_0x7c36('0x1e')]({'raw':_0x352842['options']?_0x352842[_0x7c36('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x352842[_0x7c36('0x1f')]?_0x352842[_0x7c36('0x1f')][_0x7c36('0x20')]||null:null,'attributes':_0x352842['options']?_0x352842[_0x7c36('0x1f')][_0x7c36('0x21')]||null:null,'limit':_0x352842[_0x7c36('0x1f')]?_0x352842['options']['limit']||null:null,'include':_0x352842[_0x7c36('0x1f')]?_0x352842[_0x7c36('0x1f')][_0x7c36('0x22')]?_[_0x7c36('0x23')](_0x352842[_0x7c36('0x1f')]['include'],function(_0x29b1d7){return{'model':db[_0x29b1d7[_0x7c36('0x24')]],'as':_0x29b1d7['as'],'attributes':_0x29b1d7[_0x7c36('0x21')],'include':_0x29b1d7[_0x7c36('0x22')]?_['map'](_0x29b1d7['include'],function(_0x416114){return{'model':db[_0x416114[_0x7c36('0x24')]],'as':_0x416114['as'],'attributes':_0x416114[_0x7c36('0x21')],'include':_0x416114[_0x7c36('0x22')]?_['map'](_0x416114[_0x7c36('0x22')],function(_0x58621a){return{'model':db[_0x58621a['model']],'as':_0x58621a['as'],'attributes':_0x58621a[_0x7c36('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7c36('0x13')](function(_0x394629){logger[_0x7c36('0x14')](_0x7c36('0x1d'),_0x352842);logger[_0x7c36('0x16')](_0x7c36('0x1d'),_0x352842,JSON[_0x7c36('0x17')](_0x394629));_0x5342dc(_0x394629);})[_0x7c36('0x1c')](function(_0x157765){logger[_0x7c36('0x18')](_0x7c36('0x1d'),_0x157765[_0x7c36('0x1a')],_0x352842);_0x5d5cba(_0x1af4ea[_0x7c36('0x18')](0x1f4,_0x157765[_0x7c36('0x1a')]));});});};exports[_0x7c36('0x25')]=function(_0xffd6f5){var _0x4f3cab=this;return new Promise(function(_0xc0520,_0x3e090f){return db[_0x7c36('0x26')][_0x7c36('0x27')]({'raw':_0xffd6f5['options']?_0xffd6f5['options'][_0x7c36('0x28')]===undefined?!![]:![]:!![],'where':_0xffd6f5[_0x7c36('0x1f')]?_0xffd6f5[_0x7c36('0x1f')]['where']||null:null,'attributes':_0xffd6f5[_0x7c36('0x1f')]?_0xffd6f5[_0x7c36('0x1f')]['attributes']||null:null,'include':_0xffd6f5[_0x7c36('0x1f')]?_0xffd6f5['options'][_0x7c36('0x22')]?_['map'](_0xffd6f5[_0x7c36('0x1f')][_0x7c36('0x22')],function(_0x19fd6c){return{'model':db[_0x19fd6c[_0x7c36('0x24')]],'as':_0x19fd6c['as'],'attributes':_0x19fd6c['attributes'],'include':_0x19fd6c[_0x7c36('0x22')]?_[_0x7c36('0x23')](_0x19fd6c['include'],function(_0x150c8f){return{'model':db[_0x150c8f[_0x7c36('0x24')]],'as':_0x150c8f['as'],'attributes':_0x150c8f[_0x7c36('0x21')],'include':_0x150c8f[_0x7c36('0x22')]?_[_0x7c36('0x23')](_0x150c8f[_0x7c36('0x22')],function(_0x16f03c){return{'model':db[_0x16f03c[_0x7c36('0x24')]],'as':_0x16f03c['as'],'attributes':_0x16f03c[_0x7c36('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7c36('0x13')](function(_0x32ba49){logger[_0x7c36('0x14')](_0x7c36('0x25'),_0xffd6f5);logger[_0x7c36('0x16')](_0x7c36('0x25'),_0xffd6f5,JSON[_0x7c36('0x17')](_0x32ba49));_0xc0520(_0x32ba49);})['catch'](function(_0x5e5a94){logger[_0x7c36('0x18')]('ShowVoiceQueue',_0x5e5a94[_0x7c36('0x1a')],_0xffd6f5);_0x3e090f(_0x4f3cab[_0x7c36('0x18')](0x1f4,_0x5e5a94[_0x7c36('0x1a')]));});});}; \ No newline at end of file +var _0x9e1e=['raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','limit','include','model','attributes','map','then','ShowVoiceQueue','find'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x9e1e,0x82));var _0xe9e1=function(_0x3b5867,_0x4d6b1a){_0x3b5867=_0x3b5867-0x0;var _0x3b8cb0=_0x9e1e[_0x3b5867];return _0x3b8cb0;};'use strict';var _=require(_0xe9e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe9e1('0x1'));var fs=require('fs');var Redis=require(_0xe9e1('0x2'));var db=require(_0xe9e1('0x3'))['db'];var utils=require(_0xe9e1('0x4'));var logger=require(_0xe9e1('0x5'))(_0xe9e1('0x6'));var config=require(_0xe9e1('0x7'));var jayson=require(_0xe9e1('0x8'));var client=jayson[_0xe9e1('0x9')][_0xe9e1('0xa')]({'port':0x232a});config[_0xe9e1('0xb')]=_[_0xe9e1('0xc')](config[_0xe9e1('0xb')],{'host':_0xe9e1('0xd'),'port':0x18eb});var socket=require(_0xe9e1('0xe'))(new Redis(config[_0xe9e1('0xb')]));require(_0xe9e1('0xf'))[_0xe9e1('0x10')](socket);function respondWithRpcPromise(_0xd18791,_0x4b5128,_0x53e6cd){return new BPromise(function(_0x21c958,_0x65a3c1){return client[_0xe9e1('0x11')](_0xd18791,_0x53e6cd)['then'](function(_0x5c71c3){logger[_0xe9e1('0x12')](_0xe9e1('0x13'),_0x4b5128,_0xe9e1('0x14'));logger[_0xe9e1('0x15')](_0xe9e1('0x16'),_0x4b5128,_0xe9e1('0x14'),JSON[_0xe9e1('0x17')](_0x5c71c3));if(_0x5c71c3[_0xe9e1('0x18')]){if(_0x5c71c3[_0xe9e1('0x18')][_0xe9e1('0x19')]===0x1f4){logger[_0xe9e1('0x18')](_0xe9e1('0x13'),_0x4b5128,_0x5c71c3['error'][_0xe9e1('0x1a')]);return _0x65a3c1(_0x5c71c3[_0xe9e1('0x18')][_0xe9e1('0x1a')]);}logger[_0xe9e1('0x18')](_0xe9e1('0x13'),_0x4b5128,_0x5c71c3[_0xe9e1('0x18')]['message']);return _0x21c958(_0x5c71c3['error']['message']);}else{logger['info'](_0xe9e1('0x13'),_0x4b5128,_0xe9e1('0x14'));_0x21c958(_0x5c71c3[_0xe9e1('0x1b')][_0xe9e1('0x1a')]);}})[_0xe9e1('0x1c')](function(_0x2ad924){logger[_0xe9e1('0x18')](_0xe9e1('0x13'),_0x4b5128,_0x2ad924);_0x65a3c1(_0x2ad924);});});}exports[_0xe9e1('0x1d')]=function(_0x4de3f7){var _0x3509df=this;return new Promise(function(_0x1a5236,_0x43506a){return db[_0xe9e1('0x1e')][_0xe9e1('0x1f')]({'raw':_0x4de3f7[_0xe9e1('0x20')]?_0x4de3f7[_0xe9e1('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x4de3f7[_0xe9e1('0x20')]?_0x4de3f7['options'][_0xe9e1('0x21')]||null:null,'attributes':_0x4de3f7['options']?_0x4de3f7[_0xe9e1('0x20')]['attributes']||null:null,'limit':_0x4de3f7[_0xe9e1('0x20')]?_0x4de3f7['options'][_0xe9e1('0x22')]||null:null,'include':_0x4de3f7[_0xe9e1('0x20')]?_0x4de3f7[_0xe9e1('0x20')]['include']?_['map'](_0x4de3f7['options'][_0xe9e1('0x23')],function(_0x4be97c){return{'model':db[_0x4be97c[_0xe9e1('0x24')]],'as':_0x4be97c['as'],'attributes':_0x4be97c[_0xe9e1('0x25')],'include':_0x4be97c[_0xe9e1('0x23')]?_['map'](_0x4be97c['include'],function(_0x5f815){return{'model':db[_0x5f815[_0xe9e1('0x24')]],'as':_0x5f815['as'],'attributes':_0x5f815['attributes'],'include':_0x5f815['include']?_[_0xe9e1('0x26')](_0x5f815['include'],function(_0x420670){return{'model':db[_0x420670[_0xe9e1('0x24')]],'as':_0x420670['as'],'attributes':_0x420670[_0xe9e1('0x25')]};}):[]};}):[]};}):[]:[]})[_0xe9e1('0x27')](function(_0x137b96){logger['info'](_0xe9e1('0x1d'),_0x4de3f7);logger[_0xe9e1('0x15')](_0xe9e1('0x1d'),_0x4de3f7,JSON['stringify'](_0x137b96));_0x1a5236(_0x137b96);})[_0xe9e1('0x1c')](function(_0x5c959f){logger['error'](_0xe9e1('0x1d'),_0x5c959f[_0xe9e1('0x1a')],_0x4de3f7);_0x43506a(_0x3509df[_0xe9e1('0x18')](0x1f4,_0x5c959f[_0xe9e1('0x1a')]));});});};exports[_0xe9e1('0x28')]=function(_0x4bb740){var _0x4afae1=this;return new Promise(function(_0x2bea25,_0x59ede5){return db[_0xe9e1('0x1e')][_0xe9e1('0x29')]({'raw':_0x4bb740[_0xe9e1('0x20')]?_0x4bb740['options'][_0xe9e1('0x2a')]===undefined?!![]:![]:!![],'where':_0x4bb740[_0xe9e1('0x20')]?_0x4bb740[_0xe9e1('0x20')][_0xe9e1('0x21')]||null:null,'attributes':_0x4bb740[_0xe9e1('0x20')]?_0x4bb740[_0xe9e1('0x20')][_0xe9e1('0x25')]||null:null,'include':_0x4bb740[_0xe9e1('0x20')]?_0x4bb740['options'][_0xe9e1('0x23')]?_[_0xe9e1('0x26')](_0x4bb740[_0xe9e1('0x20')][_0xe9e1('0x23')],function(_0x3d9080){return{'model':db[_0x3d9080[_0xe9e1('0x24')]],'as':_0x3d9080['as'],'attributes':_0x3d9080[_0xe9e1('0x25')],'include':_0x3d9080[_0xe9e1('0x23')]?_['map'](_0x3d9080[_0xe9e1('0x23')],function(_0x1d6843){return{'model':db[_0x1d6843[_0xe9e1('0x24')]],'as':_0x1d6843['as'],'attributes':_0x1d6843['attributes'],'include':_0x1d6843[_0xe9e1('0x23')]?_['map'](_0x1d6843[_0xe9e1('0x23')],function(_0x34310d){return{'model':db[_0x34310d[_0xe9e1('0x24')]],'as':_0x34310d['as'],'attributes':_0x34310d[_0xe9e1('0x25')]};}):[]};}):[]};}):[]:[]})[_0xe9e1('0x27')](function(_0x27f785){logger[_0xe9e1('0x12')]('ShowVoiceQueue',_0x4bb740);logger[_0xe9e1('0x15')](_0xe9e1('0x28'),_0x4bb740,JSON[_0xe9e1('0x17')](_0x27f785));_0x2bea25(_0x27f785);})[_0xe9e1('0x1c')](function(_0x3d9942){logger[_0xe9e1('0x18')](_0xe9e1('0x28'),_0x3d9942[_0xe9e1('0x1a')],_0x4bb740);_0x59ede5(_0x4afae1['error'](0x1f4,_0x3d9942[_0xe9e1('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 7322184..4215cde 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 _0x60c9=['remove','update','emit','removeListener','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x60c9,0x116));var _0x960c=function(_0x20ccc6,_0x5289cb){_0x20ccc6=_0x20ccc6-0x0;var _0x5c3435=_0x60c9[_0x20ccc6];return _0x5c3435;};'use strict';var VoiceQueueEvents=require(_0x960c('0x0'));var events=[_0x960c('0x1'),_0x960c('0x2'),_0x960c('0x3')];function createListener(_0x147af5,_0x198894){return function(_0x394079){_0x198894[_0x960c('0x4')](_0x147af5,_0x394079);};}function removeListener(_0x2af81d,_0x1054d5){return function(){VoiceQueueEvents[_0x960c('0x5')](_0x2af81d,_0x1054d5);};}exports['register']=function(_0x1301c3){for(var _0x58b1f0=0x0,_0x1d0a6e=events[_0x960c('0x6')];_0x58b1f0<_0x1d0a6e;_0x58b1f0++){var _0x400c88=events[_0x58b1f0];var _0x16ceff=createListener(_0x960c('0x7')+_0x400c88,_0x1301c3);VoiceQueueEvents['on'](_0x400c88,_0x16ceff);}}; \ No newline at end of file +var _0x0bb9=['length','voiceQueue:','./voiceQueue.events','remove','update','removeListener','register'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0x0bb9,0xd4));var _0x90bb=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x0bb9[_0x5f3f88];return _0xd08119;};'use strict';var VoiceQueueEvents=require(_0x90bb('0x0'));var events=['save',_0x90bb('0x1'),_0x90bb('0x2')];function createListener(_0x5f2b6d,_0x3b8df8){return function(_0x283a27){_0x3b8df8['emit'](_0x5f2b6d,_0x283a27);};}function removeListener(_0x4b79da,_0x29f70d){return function(){VoiceQueueEvents[_0x90bb('0x3')](_0x4b79da,_0x29f70d);};}exports[_0x90bb('0x4')]=function(_0x1d90ad){for(var _0x12ceaa=0x0,_0x3b54fd=events[_0x90bb('0x5')];_0x12ceaa<_0x3b54fd;_0x12ceaa++){var _0x595e5c=events[_0x12ceaa];var _0x3f827f=createListener(_0x90bb('0x6')+_0x595e5c,_0x1d90ad);VoiceQueueEvents['on'](_0x595e5c,_0x3f827f);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 995b9dc..13509ce 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 _0x86bf=['../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','get','/describe','/index','getVoiceQueuesReport','/:id','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x28f909,_0x45712f){var _0x1d798e=function(_0x21a957){while(--_0x21a957){_0x28f909['push'](_0x28f909['shift']());}};_0x1d798e(++_0x45712f);}(_0x86bf,0x18a));var _0xf86b=function(_0xcb4b58,_0x18af37){_0xcb4b58=_0xcb4b58-0x0;var _0x10459e=_0x86bf[_0xcb4b58];return _0x10459e;};'use strict';var multer=require('multer');var util=require(_0xf86b('0x0'));var path=require(_0xf86b('0x1'));var timeout=require(_0xf86b('0x2'));var express=require(_0xf86b('0x3'));var router=express[_0xf86b('0x4')]();var fs_extra=require(_0xf86b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf86b('0x6'));var config=require(_0xf86b('0x7'));var controller=require(_0xf86b('0x8'));router['get']('/',auth[_0xf86b('0x9')](),controller['index']);router[_0xf86b('0xa')](_0xf86b('0xb'),auth[_0xf86b('0x9')](),controller['describe']);router[_0xf86b('0xa')](_0xf86b('0xc'),auth['isAuthenticated'](),controller[_0xf86b('0xd')]);router['get'](_0xf86b('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf86b('0x9')](),controller[_0xf86b('0xf')]);router[_0xf86b('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf86b('0x11')](_0xf86b('0xe'),auth[_0xf86b('0x9')](),controller[_0xf86b('0x12')]);module[_0xf86b('0x13')]=router; \ No newline at end of file +var _0xfe7a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','delete','destroy','exports','multer','util','path','Router'];(function(_0x4d734c,_0x58a26d){var _0x2696be=function(_0x13b96d){while(--_0x13b96d){_0x4d734c['push'](_0x4d734c['shift']());}};_0x2696be(++_0x58a26d);}(_0xfe7a,0x1c8));var _0xafe7=function(_0x58217c,_0x2aea63){_0x58217c=_0x58217c-0x0;var _0x4de8d6=_0xfe7a[_0x58217c];return _0x4de8d6;};'use strict';var multer=require(_0xafe7('0x0'));var util=require(_0xafe7('0x1'));var path=require(_0xafe7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xafe7('0x3')]();var fs_extra=require(_0xafe7('0x4'));var auth=require(_0xafe7('0x5'));var interaction=require(_0xafe7('0x6'));var config=require(_0xafe7('0x7'));var controller=require(_0xafe7('0x8'));router[_0xafe7('0x9')]('/',auth[_0xafe7('0xa')](),controller[_0xafe7('0xb')]);router[_0xafe7('0x9')](_0xafe7('0xc'),auth[_0xafe7('0xa')](),controller[_0xafe7('0xd')]);router[_0xafe7('0x9')](_0xafe7('0xe'),auth['isAuthenticated'](),controller[_0xafe7('0xf')]);router[_0xafe7('0x9')](_0xafe7('0x10'),auth[_0xafe7('0xa')](),controller[_0xafe7('0x11')]);router[_0xafe7('0x12')]('/',auth[_0xafe7('0xa')](),controller[_0xafe7('0x13')]);router['put'](_0xafe7('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xafe7('0x14')]('/:id',auth[_0xafe7('0xa')](),controller[_0xafe7('0x15')]);module[_0xafe7('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index ebbe890..f6497ec 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 _0xcb91=['setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xcb91[_0x5a3cf0];return _0x5a64ee;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1cb9('0x0')]={'type':{'type':Sequelize[_0x1cb9('0x1')]},'uniqueid':{'type':Sequelize[_0x1cb9('0x1')]},'calleridnum':{'type':Sequelize[_0x1cb9('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x1cb9('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x1cb9('0x2')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x13d5fd){var _0x1b26cd=moment(_0x13d5fd);var _0x53ffbd=moment(this[_0x1cb9('0x3')](_0x1cb9('0x4')))['format'](_0x1cb9('0x5'));var _0x12567c=_0x1b26cd['diff'](_0x53ffbd,_0x1cb9('0x6'));this['setDataValue']('queuecallerleaveAt',_0x13d5fd);this[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x12567c||null);}},'position':{'type':Sequelize[_0x1cb9('0x9')]},'count':{'type':Sequelize[_0x1cb9('0x9')]},'queuecallerabandon':{'type':Sequelize[_0x1cb9('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x1cb9('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1cb9('0x2')]},'queuecallerexit':{'type':Sequelize[_0x1cb9('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1cb9('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x1cb9('0x1')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1cb9('0x1')]},'connectedlinename':{'type':Sequelize[_0x1cb9('0x1')]},'accountcode':{'type':Sequelize[_0x1cb9('0x1')]},'context':{'type':Sequelize[_0x1cb9('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1cb9('0x1')]},'holdtime':{'type':Sequelize[_0x1cb9('0x9')]},'mohtime':{'type':Sequelize[_0x1cb9('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1cb9('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1cb9('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x1cb9('0xb')},'transferexten':{'type':Sequelize[_0x1cb9('0x1')]},'transferuniqueid':{'type':Sequelize[_0x1cb9('0x1')]},'disposition':{'type':Sequelize[_0x1cb9('0x1')]},'secondDisposition':{'type':Sequelize[_0x1cb9('0x1')]},'thirdDisposition':{'type':Sequelize[_0x1cb9('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x1cb9('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x70e0=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x471f36,_0x43674f){var _0x1b7bf8=function(_0x85e62f){while(--_0x85e62f){_0x471f36['push'](_0x471f36['shift']());}};_0x1b7bf8(++_0x43674f);}(_0x70e0,0x17b));var _0x070e=function(_0xe42059,_0x4fef29){_0xe42059=_0xe42059-0x0;var _0x3a331d=_0x70e0[_0xe42059];return _0x3a331d;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));module[_0x070e('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x070e('0x3')]},'calleridname':{'type':Sequelize[_0x070e('0x3')]},'queue':{'type':Sequelize[_0x070e('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x070e('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x7bce9b){var _0x579a6b=moment(_0x7bce9b);var _0x46fe68=moment(this['getDataValue']('queuecallerjoinAt'))['format'](_0x070e('0x5'));var _0x1e11f0=_0x579a6b[_0x070e('0x6')](_0x46fe68,_0x070e('0x7'));this[_0x070e('0x8')](_0x070e('0x9'),_0x7bce9b);this[_0x070e('0x8')]('holdtime',_0x1e11f0||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x070e('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x070e('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x070e('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x070e('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x070e('0x4')]},'queuecallerexit':{'type':Sequelize[_0x070e('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x070e('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x070e('0x3')],'comment':_0x070e('0xc')},'originalposition':{'type':Sequelize[_0x070e('0xa')]},'channel':{'type':Sequelize[_0x070e('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x070e('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x070e('0xa')]},'mohtime':{'type':Sequelize[_0x070e('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x070e('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x070e('0x3')],'comment':_0x070e('0xd')},'transferexten':{'type':Sequelize[_0x070e('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x070e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x070e('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x070e('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index e6afb73..6dc1b9b 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 _0x9b7c=['show','params','keys','find','create','body','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','sendStatus','status','end','json','offset','Content-Range','apply','update','destroy','then','error','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch'];(function(_0x19aff5,_0x32b643){var _0x212d39=function(_0x10ef1d){while(--_0x10ef1d){_0x19aff5['push'](_0x19aff5['shift']());}};_0x212d39(++_0x32b643);}(_0x9b7c,0xa6));var _0xc9b7=function(_0x3bb557,_0x2d4e15){_0x3bb557=_0x3bb557-0x0;var _0x5eebcb=_0x9b7c[_0x3bb557];return _0x5eebcb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9b7('0x0'));var zipdir=require(_0xc9b7('0x1'));var jsonpatch=require(_0xc9b7('0x2'));var rp=require(_0xc9b7('0x3'));var moment=require(_0xc9b7('0x4'));var BPromise=require(_0xc9b7('0x5'));var Mustache=require(_0xc9b7('0x6'));var util=require(_0xc9b7('0x7'));var path=require(_0xc9b7('0x8'));var sox=require(_0xc9b7('0x9'));var csv=require(_0xc9b7('0xa'));var ejs=require(_0xc9b7('0xb'));var fs=require('fs');var fs_extra=require(_0xc9b7('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc9b7('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc9b7('0xe'));var Papa=require(_0xc9b7('0xf'));var Redis=require(_0xc9b7('0x10'));var authService=require(_0xc9b7('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9b7('0x12'))(_0xc9b7('0x13'));var utils=require('../../config/utils');var config=require(_0xc9b7('0x14'));var licenseUtil=require(_0xc9b7('0x15'));var db=require(_0xc9b7('0x16'))['db'];config['redis']=_[_0xc9b7('0x17')](config['redis'],{'host':_0xc9b7('0x18'),'port':0x18eb});var socket=require(_0xc9b7('0x19'))(new Redis(config[_0xc9b7('0x1a')]));require(_0xc9b7('0x1b'))['register'](socket);function respondWithStatusCode(_0x2c2d7d,_0x1e49c6){_0x1e49c6=_0x1e49c6||0xcc;return function(_0x242f99){if(_0x242f99){return _0x2c2d7d[_0xc9b7('0x1c')](_0x1e49c6);}return _0x2c2d7d[_0xc9b7('0x1d')](_0x1e49c6)[_0xc9b7('0x1e')]();};}function respondWithResult(_0x2bf21e,_0x5a0693){_0x5a0693=_0x5a0693||0xc8;return function(_0x131d59){if(_0x131d59){return _0x2bf21e[_0xc9b7('0x1d')](_0x5a0693)[_0xc9b7('0x1f')](_0x131d59);}};}function respondWithFilteredResult(_0x14fadc,_0x1c57b2){return function(_0x2741b0){if(_0x2741b0){var _0x1b572c=_0x2741b0['count'],_0x49480a=_0x1c57b2[_0xc9b7('0x20')],_0x50f1ba=_0x1c57b2[_0xc9b7('0x20')]+_0x1c57b2['limit'],_0x408ec7;if(_0x50f1ba>=_0x1b572c){_0x50f1ba=_0x1b572c;_0x408ec7=0xc8;}else{_0x408ec7=0xce;}_0x14fadc['status'](_0x408ec7);return _0x14fadc['set'](_0xc9b7('0x21'),_0x49480a+'-'+_0x50f1ba+'/'+_0x1b572c)[_0xc9b7('0x1f')](_0x2741b0);}return null;};}function patchUpdates(_0x286e5d){return function(_0x1cca29){try{jsonpatch[_0xc9b7('0x22')](_0x1cca29,_0x286e5d,!![]);}catch(_0x544306){return BPromise['reject'](_0x544306);}return _0x1cca29['save']();};}function saveUpdates(_0x19c3b1,_0x457a08){return function(_0x4f02f2){if(_0x4f02f2){return _0x4f02f2[_0xc9b7('0x23')](_0x19c3b1)['then'](function(_0x4603f9){return _0x4603f9;});}return null;};}function removeEntity(_0x3b38a4,_0x184b62){return function(_0x420b1e){if(_0x420b1e){return _0x420b1e[_0xc9b7('0x24')]()[_0xc9b7('0x25')](function(){_0x3b38a4[_0xc9b7('0x1d')](0xcc)[_0xc9b7('0x1e')]();});}};}function handleEntityNotFound(_0x3eb040,_0x3fab6e){return function(_0x35dc02){if(!_0x35dc02){_0x3eb040['sendStatus'](0x194);}return _0x35dc02;};}function handleError(_0x104651,_0x5d9157){_0x5d9157=_0x5d9157||0x1f4;return function(_0xac7484){logger[_0xc9b7('0x26')](_0xac7484['stack']);if(_0xac7484[_0xc9b7('0x27')]){delete _0xac7484[_0xc9b7('0x27')];}_0x104651['status'](_0x5d9157)[_0xc9b7('0x28')](_0xac7484);};}exports[_0xc9b7('0x29')]=function(_0x3d2516,_0x559894){var _0x262e86={},_0x4a0172={},_0x4ee470={'count':0x0,'rows':[]};var _0x255921=_[_0xc9b7('0x2a')](db[_0xc9b7('0x2b')][_0xc9b7('0x2c')],function(_0x309a3c){return{'name':_0x309a3c[_0xc9b7('0x2d')],'type':_0x309a3c['type'][_0xc9b7('0x2e')]};});_0x4a0172[_0xc9b7('0x2f')]=_['map'](_0x255921,_0xc9b7('0x27'));_0x4a0172[_0xc9b7('0x30')]=_['keys'](_0x3d2516[_0xc9b7('0x30')]);_0x4a0172['filters']=_[_0xc9b7('0x31')](_0x4a0172[_0xc9b7('0x2f')],_0x4a0172[_0xc9b7('0x30')]);_0x262e86['attributes']=_[_0xc9b7('0x31')](_0x4a0172['model'],qs[_0xc9b7('0x32')](_0x3d2516[_0xc9b7('0x30')]['fields']));_0x262e86[_0xc9b7('0x33')]=_0x262e86[_0xc9b7('0x33')][_0xc9b7('0x34')]?_0x262e86[_0xc9b7('0x33')]:_0x4a0172['model'];if(!_0x3d2516[_0xc9b7('0x30')][_0xc9b7('0x35')](_0xc9b7('0x36'))){_0x262e86[_0xc9b7('0x37')]=qs[_0xc9b7('0x37')](_0x3d2516[_0xc9b7('0x30')][_0xc9b7('0x37')]);_0x262e86[_0xc9b7('0x20')]=qs[_0xc9b7('0x20')](_0x3d2516[_0xc9b7('0x30')][_0xc9b7('0x20')]);}_0x262e86[_0xc9b7('0x38')]=qs[_0xc9b7('0x39')](_0x3d2516[_0xc9b7('0x30')]['sort']);_0x262e86[_0xc9b7('0x3a')]=qs[_0xc9b7('0x3b')](_[_0xc9b7('0x3c')](_0x3d2516[_0xc9b7('0x30')],_0x4a0172[_0xc9b7('0x3b')]),_0x255921);if(_0x3d2516[_0xc9b7('0x30')][_0xc9b7('0x3d')]){_0x262e86['where']=_[_0xc9b7('0x3e')](_0x262e86['where'],{'$or':_[_0xc9b7('0x2a')](_0x255921,function(_0x5d5368){if(_0x5d5368['type']!==_0xc9b7('0x3f')){var _0x2f0f9b={};_0x2f0f9b[_0x5d5368[_0xc9b7('0x27')]]={'$like':'%'+_0x3d2516['query']['filter']+'%'};return _0x2f0f9b;}})});}_0x262e86=_[_0xc9b7('0x3e')]({},_0x262e86,_0x3d2516[_0xc9b7('0x40')]);var _0x4f8e95={'where':_0x262e86[_0xc9b7('0x3a')]};return db['VoiceQueueReport'][_0xc9b7('0x41')](_0x4f8e95)[_0xc9b7('0x25')](function(_0x27360d){_0x4ee470[_0xc9b7('0x41')]=_0x27360d;if(_0x3d2516[_0xc9b7('0x30')][_0xc9b7('0x42')]){_0x262e86[_0xc9b7('0x43')]=[{'all':!![]}];}return db[_0xc9b7('0x2b')][_0xc9b7('0x44')](_0x262e86);})['then'](function(_0x332e1d){_0x4ee470[_0xc9b7('0x45')]=_0x332e1d;return _0x4ee470;})['then'](respondWithFilteredResult(_0x559894,_0x262e86))[_0xc9b7('0x46')](handleError(_0x559894,null));};exports[_0xc9b7('0x47')]=function(_0x3b4753,_0x432cda){var _0x1c9766={'raw':![],'where':{'id':_0x3b4753[_0xc9b7('0x48')]['id']}},_0x16d008={};_0x16d008[_0xc9b7('0x2f')]=_[_0xc9b7('0x49')](db[_0xc9b7('0x2b')]['rawAttributes']);_0x16d008[_0xc9b7('0x30')]=_[_0xc9b7('0x49')](_0x3b4753[_0xc9b7('0x30')]);_0x16d008[_0xc9b7('0x3b')]=_[_0xc9b7('0x31')](_0x16d008[_0xc9b7('0x2f')],_0x16d008[_0xc9b7('0x30')]);_0x1c9766[_0xc9b7('0x33')]=_[_0xc9b7('0x31')](_0x16d008['model'],qs[_0xc9b7('0x32')](_0x3b4753['query']['fields']));_0x1c9766[_0xc9b7('0x33')]=_0x1c9766[_0xc9b7('0x33')]['length']?_0x1c9766[_0xc9b7('0x33')]:_0x16d008['model'];if(_0x3b4753[_0xc9b7('0x30')][_0xc9b7('0x42')]){_0x1c9766[_0xc9b7('0x43')]=[{'all':!![]}];}_0x1c9766=_[_0xc9b7('0x3e')]({},_0x1c9766,_0x3b4753[_0xc9b7('0x40')]);return db[_0xc9b7('0x2b')][_0xc9b7('0x4a')](_0x1c9766)['then'](handleEntityNotFound(_0x432cda,null))[_0xc9b7('0x25')](respondWithResult(_0x432cda,null))[_0xc9b7('0x46')](handleError(_0x432cda,null));};exports[_0xc9b7('0x4b')]=function(_0x39e046,_0xc236a9){return db[_0xc9b7('0x2b')]['create'](_0x39e046[_0xc9b7('0x4c')],{})['then'](respondWithResult(_0xc236a9,0xc9))[_0xc9b7('0x46')](handleError(_0xc236a9,null));};exports['update']=function(_0x29cecc,_0x2abe56){if(_0x29cecc[_0xc9b7('0x4c')]['id']){delete _0x29cecc[_0xc9b7('0x4c')]['id'];}return db[_0xc9b7('0x2b')][_0xc9b7('0x4a')]({'where':{'id':_0x29cecc['params']['id']}})[_0xc9b7('0x25')](handleEntityNotFound(_0x2abe56,null))[_0xc9b7('0x25')](saveUpdates(_0x29cecc[_0xc9b7('0x4c')],null))[_0xc9b7('0x25')](respondWithResult(_0x2abe56,null))['catch'](handleError(_0x2abe56,null));};exports[_0xc9b7('0x24')]=function(_0x24afe2,_0x41a1e9){return db[_0xc9b7('0x2b')][_0xc9b7('0x4a')]({'where':{'id':_0x24afe2[_0xc9b7('0x48')]['id']}})['then'](handleEntityNotFound(_0x41a1e9,null))[_0xc9b7('0x25')](removeEntity(_0x41a1e9,null))[_0xc9b7('0x46')](handleError(_0x41a1e9,null));};exports[_0xc9b7('0x4d')]=function(_0x3db553,_0x1c1c57){return db[_0xc9b7('0x2b')]['describe']()[_0xc9b7('0x25')](respondWithResult(_0x1c1c57,null))['catch'](handleError(_0x1c1c57,null));};exports[_0xc9b7('0x4e')]=function(_0x36dfcf,_0x1a9ca7){var _0x14dbb1={},_0x2e597a={},_0x5463ec={'count':0x0,'rows':[]};_0x2e597a[_0xc9b7('0x2f')]=_[_0xc9b7('0x49')](db[_0xc9b7('0x2b')][_0xc9b7('0x2c')]);_0x2e597a[_0xc9b7('0x30')]=_[_0xc9b7('0x49')](_0x36dfcf['query']);_0x2e597a['filters']=_['intersection'](_0x2e597a['model'],_0x2e597a[_0xc9b7('0x30')]);_0x14dbb1[_0xc9b7('0x33')]=_[_0xc9b7('0x31')](_0x2e597a['model'],qs[_0xc9b7('0x32')](_0x36dfcf['query'][_0xc9b7('0x32')]));_0x14dbb1[_0xc9b7('0x33')]=_0x14dbb1['attributes'][_0xc9b7('0x34')]?_0x14dbb1[_0xc9b7('0x33')]:_0x2e597a['model'];if(!_0x36dfcf[_0xc9b7('0x30')][_0xc9b7('0x35')](_0xc9b7('0x36'))){_0x14dbb1[_0xc9b7('0x37')]=qs[_0xc9b7('0x37')](_0x36dfcf['query'][_0xc9b7('0x37')]);_0x14dbb1[_0xc9b7('0x20')]=qs[_0xc9b7('0x20')](_0x36dfcf['query'][_0xc9b7('0x20')]);}_0x14dbb1[_0xc9b7('0x38')]=qs[_0xc9b7('0x39')](_0x36dfcf[_0xc9b7('0x30')][_0xc9b7('0x39')]);_0x14dbb1[_0xc9b7('0x3a')]=qs[_0xc9b7('0x3b')](_[_0xc9b7('0x3c')](_0x36dfcf['query'],_0x2e597a[_0xc9b7('0x3b')]));if(_0x36dfcf['query']['filter']){_0x14dbb1['where']=_[_0xc9b7('0x3e')](_0x14dbb1[_0xc9b7('0x3a')],{'$or':_['map'](_0x14dbb1[_0xc9b7('0x33')],function(_0x5b896b){var _0x572ed3={};_0x572ed3[_0x5b896b]={'$like':'%'+_0x36dfcf[_0xc9b7('0x30')]['filter']+'%'};return _0x572ed3;})});}_0x14dbb1=_[_0xc9b7('0x3e')]({},_0x14dbb1,_0x36dfcf['options']);var _0x22de6f={'where':_0x14dbb1[_0xc9b7('0x3a')]};return db[_0xc9b7('0x2b')][_0xc9b7('0x41')](_0x22de6f)[_0xc9b7('0x25')](function(_0x277128){_0x5463ec['count']=_0x277128;if(_0x36dfcf[_0xc9b7('0x30')]['includeAll']){_0x14dbb1[_0xc9b7('0x43')]=[{'all':!![]}];}return db[_0xc9b7('0x2b')]['findAll'](_0x14dbb1);})[_0xc9b7('0x25')](function(_0x57483b){_0x5463ec[_0xc9b7('0x45')]=_0x57483b;return _0x5463ec;})[_0xc9b7('0x25')](respondWithFilteredResult(_0x1a9ca7,_0x14dbb1,_0xc9b7('0x4e')))[_0xc9b7('0x46')](handleError(_0x1a9ca7,null,_0xc9b7('0x4e')));}; \ No newline at end of file +var _0x3f00=['rows','show','params','length','include','catch','create','body','find','getVoiceQueuesReport','nolimit','sort','pick','filter','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','json','count','offset','limit','set','apply','save','update','destroy','then','end','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','keys','intersection','attributes','fields','query','hasOwnProperty','order','where','filters','VIRTUAL','merge','options','includeAll'];(function(_0x3ca627,_0x1e70d9){var _0xef06b5=function(_0x4da56b){while(--_0x4da56b){_0x3ca627['push'](_0x3ca627['shift']());}};_0xef06b5(++_0x1e70d9);}(_0x3f00,0xab));var _0x03f0=function(_0x146cb9,_0x349d0b){_0x146cb9=_0x146cb9-0x0;var _0x2dbc9a=_0x3f00[_0x146cb9];return _0x2dbc9a;};'use strict';var emlformat=require(_0x03f0('0x0'));var rimraf=require(_0x03f0('0x1'));var zipdir=require(_0x03f0('0x2'));var jsonpatch=require(_0x03f0('0x3'));var rp=require(_0x03f0('0x4'));var moment=require('moment');var BPromise=require(_0x03f0('0x5'));var Mustache=require('mustache');var util=require(_0x03f0('0x6'));var path=require(_0x03f0('0x7'));var sox=require(_0x03f0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03f0('0x9'));var _=require(_0x03f0('0xa'));var squel=require(_0x03f0('0xb'));var crypto=require(_0x03f0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x03f0('0xd'));var querystring=require(_0x03f0('0xe'));var Papa=require(_0x03f0('0xf'));var Redis=require(_0x03f0('0x10'));var authService=require(_0x03f0('0x11'));var qs=require(_0x03f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x03f0('0x13'));var config=require(_0x03f0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x03f0('0x15'))['db'];config['redis']=_[_0x03f0('0x16')](config[_0x03f0('0x17')],{'host':_0x03f0('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03f0('0x17')]));require('./voiceQueueReport.socket')[_0x03f0('0x19')](socket);function respondWithStatusCode(_0xf9b118,_0x27e5d1){_0x27e5d1=_0x27e5d1||0xcc;return function(_0x1fc05d){if(_0x1fc05d){return _0xf9b118[_0x03f0('0x1a')](_0x27e5d1);}return _0xf9b118[_0x03f0('0x1b')](_0x27e5d1)['end']();};}function respondWithResult(_0x244afd,_0x23ae07){_0x23ae07=_0x23ae07||0xc8;return function(_0x43c20b){if(_0x43c20b){return _0x244afd[_0x03f0('0x1b')](_0x23ae07)[_0x03f0('0x1c')](_0x43c20b);}};}function respondWithFilteredResult(_0x3a6ab7,_0xf378fc){return function(_0x393672){if(_0x393672){var _0x4f18b2=_0x393672[_0x03f0('0x1d')],_0x42de3=_0xf378fc['offset'],_0x599fc3=_0xf378fc[_0x03f0('0x1e')]+_0xf378fc[_0x03f0('0x1f')],_0x13c02f;if(_0x599fc3>=_0x4f18b2){_0x599fc3=_0x4f18b2;_0x13c02f=0xc8;}else{_0x13c02f=0xce;}_0x3a6ab7['status'](_0x13c02f);return _0x3a6ab7[_0x03f0('0x20')]('Content-Range',_0x42de3+'-'+_0x599fc3+'/'+_0x4f18b2)[_0x03f0('0x1c')](_0x393672);}return null;};}function patchUpdates(_0xddebe){return function(_0x2c0907){try{jsonpatch[_0x03f0('0x21')](_0x2c0907,_0xddebe,!![]);}catch(_0x3150e0){return BPromise['reject'](_0x3150e0);}return _0x2c0907[_0x03f0('0x22')]();};}function saveUpdates(_0x37fbb2,_0x54d7a5){return function(_0x435cc5){if(_0x435cc5){return _0x435cc5[_0x03f0('0x23')](_0x37fbb2)['then'](function(_0x51eaf2){return _0x51eaf2;});}return null;};}function removeEntity(_0x29f725,_0xc20c39){return function(_0x1a0046){if(_0x1a0046){return _0x1a0046[_0x03f0('0x24')]()[_0x03f0('0x25')](function(){_0x29f725['status'](0xcc)[_0x03f0('0x26')]();});}};}function handleEntityNotFound(_0x47912b,_0x23a98e){return function(_0x1b823a){if(!_0x1b823a){_0x47912b[_0x03f0('0x1a')](0x194);}return _0x1b823a;};}function handleError(_0x535c25,_0x3e6b39){_0x3e6b39=_0x3e6b39||0x1f4;return function(_0x21f5f3){logger[_0x03f0('0x27')](_0x21f5f3[_0x03f0('0x28')]);if(_0x21f5f3[_0x03f0('0x29')]){delete _0x21f5f3['name'];}_0x535c25['status'](_0x3e6b39)[_0x03f0('0x2a')](_0x21f5f3);};}exports[_0x03f0('0x2b')]=function(_0x57e647,_0x5742ca){var _0x189d36={},_0x47e138={},_0x22c889={'count':0x0,'rows':[]};var _0x1504f1=_[_0x03f0('0x2c')](db[_0x03f0('0x2d')][_0x03f0('0x2e')],function(_0x14bcd6){return{'name':_0x14bcd6[_0x03f0('0x2f')],'type':_0x14bcd6[_0x03f0('0x30')]['key']};});_0x47e138[_0x03f0('0x31')]=_['map'](_0x1504f1,_0x03f0('0x29'));_0x47e138['query']=_[_0x03f0('0x32')](_0x57e647['query']);_0x47e138['filters']=_[_0x03f0('0x33')](_0x47e138[_0x03f0('0x31')],_0x47e138['query']);_0x189d36[_0x03f0('0x34')]=_[_0x03f0('0x33')](_0x47e138[_0x03f0('0x31')],qs[_0x03f0('0x35')](_0x57e647[_0x03f0('0x36')][_0x03f0('0x35')]));_0x189d36['attributes']=_0x189d36['attributes']['length']?_0x189d36[_0x03f0('0x34')]:_0x47e138['model'];if(!_0x57e647[_0x03f0('0x36')][_0x03f0('0x37')]('nolimit')){_0x189d36[_0x03f0('0x1f')]=qs['limit'](_0x57e647[_0x03f0('0x36')][_0x03f0('0x1f')]);_0x189d36[_0x03f0('0x1e')]=qs['offset'](_0x57e647[_0x03f0('0x36')][_0x03f0('0x1e')]);}_0x189d36[_0x03f0('0x38')]=qs['sort'](_0x57e647['query']['sort']);_0x189d36[_0x03f0('0x39')]=qs[_0x03f0('0x3a')](_['pick'](_0x57e647[_0x03f0('0x36')],_0x47e138['filters']),_0x1504f1);if(_0x57e647[_0x03f0('0x36')]['filter']){_0x189d36['where']=_['merge'](_0x189d36[_0x03f0('0x39')],{'$or':_[_0x03f0('0x2c')](_0x1504f1,function(_0x4c570e){if(_0x4c570e[_0x03f0('0x30')]!==_0x03f0('0x3b')){var _0x905433={};_0x905433[_0x4c570e[_0x03f0('0x29')]]={'$like':'%'+_0x57e647['query']['filter']+'%'};return _0x905433;}})});}_0x189d36=_[_0x03f0('0x3c')]({},_0x189d36,_0x57e647[_0x03f0('0x3d')]);var _0x274c47={'where':_0x189d36[_0x03f0('0x39')]};return db[_0x03f0('0x2d')][_0x03f0('0x1d')](_0x274c47)[_0x03f0('0x25')](function(_0x4e43a1){_0x22c889['count']=_0x4e43a1;if(_0x57e647[_0x03f0('0x36')][_0x03f0('0x3e')]){_0x189d36['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x189d36);})[_0x03f0('0x25')](function(_0x334dab){_0x22c889[_0x03f0('0x3f')]=_0x334dab;return _0x22c889;})['then'](respondWithFilteredResult(_0x5742ca,_0x189d36))['catch'](handleError(_0x5742ca,null));};exports[_0x03f0('0x40')]=function(_0x2f497e,_0x511803){var _0x3e5e2a={'raw':![],'where':{'id':_0x2f497e[_0x03f0('0x41')]['id']}},_0x16d3d3={};_0x16d3d3[_0x03f0('0x31')]=_[_0x03f0('0x32')](db[_0x03f0('0x2d')][_0x03f0('0x2e')]);_0x16d3d3[_0x03f0('0x36')]=_['keys'](_0x2f497e['query']);_0x16d3d3[_0x03f0('0x3a')]=_[_0x03f0('0x33')](_0x16d3d3[_0x03f0('0x31')],_0x16d3d3[_0x03f0('0x36')]);_0x3e5e2a[_0x03f0('0x34')]=_[_0x03f0('0x33')](_0x16d3d3[_0x03f0('0x31')],qs[_0x03f0('0x35')](_0x2f497e[_0x03f0('0x36')][_0x03f0('0x35')]));_0x3e5e2a[_0x03f0('0x34')]=_0x3e5e2a[_0x03f0('0x34')][_0x03f0('0x42')]?_0x3e5e2a[_0x03f0('0x34')]:_0x16d3d3[_0x03f0('0x31')];if(_0x2f497e[_0x03f0('0x36')][_0x03f0('0x3e')]){_0x3e5e2a[_0x03f0('0x43')]=[{'all':!![]}];}_0x3e5e2a=_[_0x03f0('0x3c')]({},_0x3e5e2a,_0x2f497e[_0x03f0('0x3d')]);return db[_0x03f0('0x2d')]['find'](_0x3e5e2a)[_0x03f0('0x25')](handleEntityNotFound(_0x511803,null))[_0x03f0('0x25')](respondWithResult(_0x511803,null))[_0x03f0('0x44')](handleError(_0x511803,null));};exports[_0x03f0('0x45')]=function(_0xd7b997,_0x2885f9){return db[_0x03f0('0x2d')][_0x03f0('0x45')](_0xd7b997[_0x03f0('0x46')],{})['then'](respondWithResult(_0x2885f9,0xc9))[_0x03f0('0x44')](handleError(_0x2885f9,null));};exports[_0x03f0('0x23')]=function(_0x2f2538,_0x45cd97){if(_0x2f2538[_0x03f0('0x46')]['id']){delete _0x2f2538[_0x03f0('0x46')]['id'];}return db[_0x03f0('0x2d')][_0x03f0('0x47')]({'where':{'id':_0x2f2538['params']['id']}})[_0x03f0('0x25')](handleEntityNotFound(_0x45cd97,null))[_0x03f0('0x25')](saveUpdates(_0x2f2538[_0x03f0('0x46')],null))['then'](respondWithResult(_0x45cd97,null))[_0x03f0('0x44')](handleError(_0x45cd97,null));};exports['destroy']=function(_0x19ca34,_0x2f6d10){return db[_0x03f0('0x2d')]['find']({'where':{'id':_0x19ca34[_0x03f0('0x41')]['id']}})[_0x03f0('0x25')](handleEntityNotFound(_0x2f6d10,null))[_0x03f0('0x25')](removeEntity(_0x2f6d10,null))['catch'](handleError(_0x2f6d10,null));};exports['describe']=function(_0x1ca1d7,_0x3bcb80){return db['VoiceQueueReport']['describe']()[_0x03f0('0x25')](respondWithResult(_0x3bcb80,null))[_0x03f0('0x44')](handleError(_0x3bcb80,null));};exports[_0x03f0('0x48')]=function(_0x54b4f4,_0x23ae77){var _0x2b7950={},_0x8fe982={},_0x10aca0={'count':0x0,'rows':[]};_0x8fe982[_0x03f0('0x31')]=_[_0x03f0('0x32')](db[_0x03f0('0x2d')][_0x03f0('0x2e')]);_0x8fe982[_0x03f0('0x36')]=_['keys'](_0x54b4f4[_0x03f0('0x36')]);_0x8fe982[_0x03f0('0x3a')]=_[_0x03f0('0x33')](_0x8fe982['model'],_0x8fe982['query']);_0x2b7950[_0x03f0('0x34')]=_[_0x03f0('0x33')](_0x8fe982[_0x03f0('0x31')],qs[_0x03f0('0x35')](_0x54b4f4[_0x03f0('0x36')]['fields']));_0x2b7950['attributes']=_0x2b7950['attributes'][_0x03f0('0x42')]?_0x2b7950[_0x03f0('0x34')]:_0x8fe982[_0x03f0('0x31')];if(!_0x54b4f4[_0x03f0('0x36')][_0x03f0('0x37')](_0x03f0('0x49'))){_0x2b7950[_0x03f0('0x1f')]=qs[_0x03f0('0x1f')](_0x54b4f4[_0x03f0('0x36')][_0x03f0('0x1f')]);_0x2b7950[_0x03f0('0x1e')]=qs[_0x03f0('0x1e')](_0x54b4f4['query'][_0x03f0('0x1e')]);}_0x2b7950[_0x03f0('0x38')]=qs[_0x03f0('0x4a')](_0x54b4f4[_0x03f0('0x36')]['sort']);_0x2b7950[_0x03f0('0x39')]=qs[_0x03f0('0x3a')](_[_0x03f0('0x4b')](_0x54b4f4['query'],_0x8fe982[_0x03f0('0x3a')]));if(_0x54b4f4[_0x03f0('0x36')][_0x03f0('0x4c')]){_0x2b7950[_0x03f0('0x39')]=_['merge'](_0x2b7950[_0x03f0('0x39')],{'$or':_[_0x03f0('0x2c')](_0x2b7950[_0x03f0('0x34')],function(_0x585137){var _0x4b2ff7={};_0x4b2ff7[_0x585137]={'$like':'%'+_0x54b4f4[_0x03f0('0x36')][_0x03f0('0x4c')]+'%'};return _0x4b2ff7;})});}_0x2b7950=_[_0x03f0('0x3c')]({},_0x2b7950,_0x54b4f4[_0x03f0('0x3d')]);var _0xae22b6={'where':_0x2b7950[_0x03f0('0x39')]};return db[_0x03f0('0x2d')][_0x03f0('0x1d')](_0xae22b6)[_0x03f0('0x25')](function(_0x5977b9){_0x10aca0[_0x03f0('0x1d')]=_0x5977b9;if(_0x54b4f4['query'][_0x03f0('0x3e')]){_0x2b7950[_0x03f0('0x43')]=[{'all':!![]}];}return db[_0x03f0('0x2d')][_0x03f0('0x4d')](_0x2b7950);})[_0x03f0('0x25')](function(_0x2f5351){_0x10aca0['rows']=_0x2f5351;return _0x10aca0;})['then'](respondWithFilteredResult(_0x23ae77,_0x2b7950,_0x03f0('0x48')))['catch'](handleError(_0x23ae77,null,_0x03f0('0x48')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 23bb844..336df47 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 _0xe5f1=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5f1,0xe3));var _0x1e5f=function(_0xa0c79,_0x20f43a){_0xa0c79=_0xa0c79-0x0;var _0x48c024=_0xe5f1[_0xa0c79];return _0x48c024;};'use strict';var EventEmitter=require(_0x1e5f('0x0'));var VoiceQueueReport=require(_0x1e5f('0x1'))['db'][_0x1e5f('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1e5f('0x3')](0x0);var events={'afterCreate':_0x1e5f('0x4'),'afterUpdate':_0x1e5f('0x5'),'afterDestroy':_0x1e5f('0x6')};function emitEvent(_0x412a47){return function(_0x1fae74,_0x65984d,_0xb9089e){VoiceQueueReportEvents[_0x1e5f('0x7')](_0x412a47+':'+_0x1fae74['id'],_0x1fae74);VoiceQueueReportEvents[_0x1e5f('0x7')](_0x412a47,_0x1fae74);_0xb9089e(null);};}for(var e in events){if(events[_0x1e5f('0x8')](e)){var event=events[e];VoiceQueueReport[_0x1e5f('0x9')](e,emitEvent(event));}}module[_0x1e5f('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x5f3d=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','save','remove','emit'];(function(_0x1b9d0a,_0x4b42f3){var _0x28a22d=function(_0x5a9aff){while(--_0x5a9aff){_0x1b9d0a['push'](_0x1b9d0a['shift']());}};_0x28a22d(++_0x4b42f3);}(_0x5f3d,0x78));var _0xd5f3=function(_0x4ed814,_0xfbf00a){_0x4ed814=_0x4ed814-0x0;var _0x10e6c9=_0x5f3d[_0x4ed814];return _0x10e6c9;};'use strict';var EventEmitter=require(_0xd5f3('0x0'));var VoiceQueueReport=require(_0xd5f3('0x1'))['db'][_0xd5f3('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd5f3('0x3'),'afterUpdate':'update','afterDestroy':_0xd5f3('0x4')};function emitEvent(_0x2abc0b){return function(_0x48455b,_0x8c4771,_0x120cfe){VoiceQueueReportEvents[_0xd5f3('0x5')](_0x2abc0b+':'+_0x48455b['id'],_0x48455b);VoiceQueueReportEvents[_0xd5f3('0x5')](_0x2abc0b,_0x48455b);_0x120cfe(null);};}for(var e in events){if(events[_0xd5f3('0x6')](e)){var event=events[e];VoiceQueueReport[_0xd5f3('0x7')](e,emitEvent(event));}}module[_0xd5f3('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 615817c..047c4ba 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 _0x757a=['./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x51d3a0,_0x1b1104){var _0x581ef3=function(_0xbf4e4c){while(--_0xbf4e4c){_0x51d3a0['push'](_0x51d3a0['shift']());}};_0x581ef3(++_0x1b1104);}(_0x757a,0xde));var _0xa757=function(_0x43cb90,_0x23586a){_0x43cb90=_0x43cb90-0x0;var _0x3f3296=_0x757a[_0x43cb90];return _0x3f3296;};'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')]('VoiceQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa757('0xa')]},{'fields':[_0xa757('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x17077f,_0x2a280f){var _0x19c1ee=function(_0x4b8a53){while(--_0x4b8a53){_0x17077f['push'](_0x17077f['shift']());}};_0x19c1ee(++_0x2a280f);}(_0x757a,0xde));var _0xa757=function(_0x45e6ca,_0x4f498e){_0x45e6ca=_0x45e6ca-0x0;var _0x3678a2=_0x757a[_0x45e6ca];return _0x3678a2;};'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')]('VoiceQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa757('0xa')]},{'fields':[_0xa757('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 71785ab..2500973 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 _0xf263=['request','then','info','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','VoiceQueueReport','create','UpdateVoiceQueueReport','update','body','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf263,0x149));var _0x3f26=function(_0x158a58,_0x28e8e7){_0x158a58=_0x158a58-0x0;var _0x4935d9=_0xf263[_0x158a58];return _0x4935d9;};'use strict';var _=require(_0x3f26('0x0'));var util=require(_0x3f26('0x1'));var moment=require(_0x3f26('0x2'));var BPromise=require(_0x3f26('0x3'));var rs=require(_0x3f26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f26('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f26('0x6'))(_0x3f26('0x7'));var config=require(_0x3f26('0x8'));var jayson=require(_0x3f26('0x9'));var client=jayson['client'][_0x3f26('0xa')]({'port':0x232a});config[_0x3f26('0xb')]=_['defaults'](config['redis'],{'host':_0x3f26('0xc'),'port':0x18eb});var socket=require(_0x3f26('0xd'))(new Redis(config[_0x3f26('0xb')]));require('./voiceQueueReport.socket')[_0x3f26('0xe')](socket);function respondWithRpcPromise(_0x3407b9,_0x15b19c,_0x27ae32){return new BPromise(function(_0x33fff0,_0x4770f5){return client[_0x3f26('0xf')](_0x3407b9,_0x27ae32)[_0x3f26('0x10')](function(_0x19aed9){logger[_0x3f26('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x15b19c,'request\x20sent');logger[_0x3f26('0x12')](_0x3f26('0x13'),_0x15b19c,_0x3f26('0x14'),JSON[_0x3f26('0x15')](_0x19aed9));if(_0x19aed9['error']){if(_0x19aed9[_0x3f26('0x16')][_0x3f26('0x17')]===0x1f4){logger[_0x3f26('0x16')](_0x3f26('0x18'),_0x15b19c,_0x19aed9['error'][_0x3f26('0x19')]);return _0x4770f5(_0x19aed9[_0x3f26('0x16')][_0x3f26('0x19')]);}logger[_0x3f26('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x15b19c,_0x19aed9[_0x3f26('0x16')][_0x3f26('0x19')]);return _0x33fff0(_0x19aed9[_0x3f26('0x16')][_0x3f26('0x19')]);}else{logger[_0x3f26('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x15b19c,'request\x20sent');_0x33fff0(_0x19aed9['result'][_0x3f26('0x19')]);}})[_0x3f26('0x1a')](function(_0x54e79b){logger[_0x3f26('0x16')](_0x3f26('0x18'),_0x15b19c,_0x54e79b);_0x4770f5(_0x54e79b);});});}exports['GetVoiceQueueReport']=function(_0x4e9077){var _0x47c4b9=this;return new Promise(function(_0x3080f2,_0x20fe9c){return db['VoiceQueueReport'][_0x3f26('0x1b')]({'raw':_0x4e9077[_0x3f26('0x1c')]?_0x4e9077[_0x3f26('0x1c')][_0x3f26('0x1d')]===undefined?!![]:![]:!![],'where':_0x4e9077[_0x3f26('0x1c')]?_0x4e9077['options'][_0x3f26('0x1e')]||null:null,'attributes':_0x4e9077[_0x3f26('0x1c')]?_0x4e9077[_0x3f26('0x1c')][_0x3f26('0x1f')]||null:null,'limit':_0x4e9077[_0x3f26('0x1c')]?_0x4e9077[_0x3f26('0x1c')][_0x3f26('0x20')]||null:null,'include':_0x4e9077[_0x3f26('0x1c')]?_0x4e9077[_0x3f26('0x1c')][_0x3f26('0x21')]?_[_0x3f26('0x22')](_0x4e9077[_0x3f26('0x1c')]['include'],function(_0x42c589){return{'model':db[_0x42c589[_0x3f26('0x23')]],'as':_0x42c589['as'],'attributes':_0x42c589[_0x3f26('0x1f')],'include':_0x42c589['include']?_['map'](_0x42c589[_0x3f26('0x21')],function(_0x1eab9c){return{'model':db[_0x1eab9c[_0x3f26('0x23')]],'as':_0x1eab9c['as'],'attributes':_0x1eab9c[_0x3f26('0x1f')],'include':_0x1eab9c[_0x3f26('0x21')]?_[_0x3f26('0x22')](_0x1eab9c[_0x3f26('0x21')],function(_0x2d2c2d){return{'model':db[_0x2d2c2d[_0x3f26('0x23')]],'as':_0x2d2c2d['as'],'attributes':_0x2d2c2d[_0x3f26('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f35e9){logger[_0x3f26('0x11')](_0x3f26('0x24'),_0x4e9077);logger['debug']('GetVoiceQueueReport',_0x4e9077,JSON['stringify'](_0x1f35e9));_0x3080f2(_0x1f35e9);})[_0x3f26('0x1a')](function(_0x460927){logger[_0x3f26('0x16')]('GetVoiceQueueReport',_0x460927[_0x3f26('0x19')],_0x4e9077);_0x20fe9c(_0x47c4b9['error'](0x1f4,_0x460927[_0x3f26('0x19')]));});});};exports[_0x3f26('0x25')]=function(_0x447f62){var _0x5a3cfe=this;return new Promise(function(_0xbdfa3d,_0x4b4b16){return db[_0x3f26('0x26')][_0x3f26('0x27')](_0x447f62['body'],{'raw':_0x447f62[_0x3f26('0x1c')]?_0x447f62[_0x3f26('0x1c')][_0x3f26('0x1d')]===undefined?!![]:![]:!![]})[_0x3f26('0x10')](function(_0x4d042d){logger[_0x3f26('0x11')](_0x3f26('0x25'),_0x447f62);logger[_0x3f26('0x12')](_0x3f26('0x25'),_0x447f62,JSON[_0x3f26('0x15')](_0x4d042d));_0xbdfa3d(_0x4d042d);})[_0x3f26('0x1a')](function(_0x34ccee){logger['error'](_0x3f26('0x25'),_0x34ccee[_0x3f26('0x19')],_0x447f62);_0x4b4b16(_0x5a3cfe['error'](0x1f4,_0x34ccee['message']));});});};exports[_0x3f26('0x28')]=function(_0x5c448c){var _0x38d371=this;return new Promise(function(_0x861a5f,_0x1e1db0){return db['VoiceQueueReport'][_0x3f26('0x29')](_0x5c448c[_0x3f26('0x2a')],{'raw':_0x5c448c['options']?_0x5c448c[_0x3f26('0x1c')][_0x3f26('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c448c[_0x3f26('0x1c')]?_0x5c448c[_0x3f26('0x1c')][_0x3f26('0x1e')]||null:null,'attributes':_0x5c448c[_0x3f26('0x1c')]?_0x5c448c[_0x3f26('0x1c')][_0x3f26('0x1f')]||null:null,'limit':_0x5c448c[_0x3f26('0x1c')]?_0x5c448c[_0x3f26('0x1c')][_0x3f26('0x20')]||null:null})[_0x3f26('0x10')](function(_0x2e9d31){logger[_0x3f26('0x11')](_0x3f26('0x28'),_0x5c448c);logger['debug']('UpdateVoiceQueueReport',_0x5c448c,JSON[_0x3f26('0x15')](_0x2e9d31));_0x861a5f(_0x2e9d31);})[_0x3f26('0x1a')](function(_0x232a7e){logger[_0x3f26('0x16')](_0x3f26('0x28'),_0x232a7e[_0x3f26('0x19')],_0x5c448c);_0x1e1db0(_0x38d371[_0x3f26('0x16')](0x1f4,_0x232a7e[_0x3f26('0x19')]));});});}; \ No newline at end of file +var _0x2ed6=['body','CreateVoiceQueueReport','UpdateVoiceQueueReport','then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','request','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','VoiceQueueReport','options','raw','where','attributes','include','model','map','GetVoiceQueueReport'];(function(_0x40c0cb,_0x2ffa34){var _0x52cfed=function(_0x10be77){while(--_0x10be77){_0x40c0cb['push'](_0x40c0cb['shift']());}};_0x52cfed(++_0x2ffa34);}(_0x2ed6,0x13c));var _0x62ed=function(_0x188261,_0x586bfc){_0x188261=_0x188261-0x0;var _0x36e5f8=_0x2ed6[_0x188261];return _0x36e5f8;};'use strict';var _=require(_0x62ed('0x0'));var util=require('util');var moment=require(_0x62ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x62ed('0x2'));var fs=require('fs');var Redis=require(_0x62ed('0x3'));var db=require(_0x62ed('0x4'))['db'];var utils=require(_0x62ed('0x5'));var logger=require('../../config/logger')(_0x62ed('0x6'));var config=require(_0x62ed('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x62ed('0x8')][_0x62ed('0x9')]({'port':0x232a});config[_0x62ed('0xa')]=_[_0x62ed('0xb')](config[_0x62ed('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x62ed('0xc'))(new Redis(config[_0x62ed('0xa')]));require(_0x62ed('0xd'))['register'](socket);function respondWithRpcPromise(_0x56e89c,_0x462450,_0x3b98ad){return new BPromise(function(_0x311b19,_0x54e08b){return client[_0x62ed('0xe')](_0x56e89c,_0x3b98ad)['then'](function(_0x5a6bb0){logger[_0x62ed('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x462450,_0x62ed('0x10'));logger[_0x62ed('0x11')](_0x62ed('0x12'),_0x462450,'request\x20sent',JSON[_0x62ed('0x13')](_0x5a6bb0));if(_0x5a6bb0[_0x62ed('0x14')]){if(_0x5a6bb0[_0x62ed('0x14')][_0x62ed('0x15')]===0x1f4){logger[_0x62ed('0x14')](_0x62ed('0x16'),_0x462450,_0x5a6bb0[_0x62ed('0x14')]['message']);return _0x54e08b(_0x5a6bb0[_0x62ed('0x14')][_0x62ed('0x17')]);}logger['error'](_0x62ed('0x16'),_0x462450,_0x5a6bb0['error'][_0x62ed('0x17')]);return _0x311b19(_0x5a6bb0[_0x62ed('0x14')][_0x62ed('0x17')]);}else{logger[_0x62ed('0xf')](_0x62ed('0x16'),_0x462450,_0x62ed('0x10'));_0x311b19(_0x5a6bb0[_0x62ed('0x18')][_0x62ed('0x17')]);}})[_0x62ed('0x19')](function(_0x458856){logger['error'](_0x62ed('0x16'),_0x462450,_0x458856);_0x54e08b(_0x458856);});});}exports['GetVoiceQueueReport']=function(_0x2a9a12){var _0x1e8608=this;return new Promise(function(_0x40852e,_0x3c5a92){return db[_0x62ed('0x1a')]['findAll']({'raw':_0x2a9a12[_0x62ed('0x1b')]?_0x2a9a12[_0x62ed('0x1b')][_0x62ed('0x1c')]===undefined?!![]:![]:!![],'where':_0x2a9a12[_0x62ed('0x1b')]?_0x2a9a12['options'][_0x62ed('0x1d')]||null:null,'attributes':_0x2a9a12[_0x62ed('0x1b')]?_0x2a9a12['options'][_0x62ed('0x1e')]||null:null,'limit':_0x2a9a12[_0x62ed('0x1b')]?_0x2a9a12[_0x62ed('0x1b')]['limit']||null:null,'include':_0x2a9a12['options']?_0x2a9a12[_0x62ed('0x1b')][_0x62ed('0x1f')]?_['map'](_0x2a9a12[_0x62ed('0x1b')][_0x62ed('0x1f')],function(_0x172271){return{'model':db[_0x172271[_0x62ed('0x20')]],'as':_0x172271['as'],'attributes':_0x172271[_0x62ed('0x1e')],'include':_0x172271[_0x62ed('0x1f')]?_[_0x62ed('0x21')](_0x172271['include'],function(_0x60d961){return{'model':db[_0x60d961[_0x62ed('0x20')]],'as':_0x60d961['as'],'attributes':_0x60d961[_0x62ed('0x1e')],'include':_0x60d961[_0x62ed('0x1f')]?_['map'](_0x60d961[_0x62ed('0x1f')],function(_0x46bca0){return{'model':db[_0x46bca0[_0x62ed('0x20')]],'as':_0x46bca0['as'],'attributes':_0x46bca0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x46ee72){logger[_0x62ed('0xf')](_0x62ed('0x22'),_0x2a9a12);logger[_0x62ed('0x11')](_0x62ed('0x22'),_0x2a9a12,JSON[_0x62ed('0x13')](_0x46ee72));_0x40852e(_0x46ee72);})[_0x62ed('0x19')](function(_0x584d5d){logger['error']('GetVoiceQueueReport',_0x584d5d[_0x62ed('0x17')],_0x2a9a12);_0x3c5a92(_0x1e8608[_0x62ed('0x14')](0x1f4,_0x584d5d[_0x62ed('0x17')]));});});};exports['CreateVoiceQueueReport']=function(_0x308e4a){var _0x4736fb=this;return new Promise(function(_0x1304eb,_0x4f98dd){return db[_0x62ed('0x1a')]['create'](_0x308e4a[_0x62ed('0x23')],{'raw':_0x308e4a[_0x62ed('0x1b')]?_0x308e4a['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x11a22a){logger[_0x62ed('0xf')]('CreateVoiceQueueReport',_0x308e4a);logger[_0x62ed('0x11')]('CreateVoiceQueueReport',_0x308e4a,JSON[_0x62ed('0x13')](_0x11a22a));_0x1304eb(_0x11a22a);})[_0x62ed('0x19')](function(_0x3626bc){logger['error'](_0x62ed('0x24'),_0x3626bc[_0x62ed('0x17')],_0x308e4a);_0x4f98dd(_0x4736fb[_0x62ed('0x14')](0x1f4,_0x3626bc['message']));});});};exports[_0x62ed('0x25')]=function(_0x201a28){var _0x575301=this;return new Promise(function(_0xe45f42,_0x35cd08){return db['VoiceQueueReport']['update'](_0x201a28[_0x62ed('0x23')],{'raw':_0x201a28['options']?_0x201a28['options'][_0x62ed('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x201a28[_0x62ed('0x1b')]?_0x201a28[_0x62ed('0x1b')][_0x62ed('0x1d')]||null:null,'attributes':_0x201a28[_0x62ed('0x1b')]?_0x201a28[_0x62ed('0x1b')][_0x62ed('0x1e')]||null:null,'limit':_0x201a28[_0x62ed('0x1b')]?_0x201a28[_0x62ed('0x1b')]['limit']||null:null})[_0x62ed('0x26')](function(_0x54da73){logger[_0x62ed('0xf')](_0x62ed('0x25'),_0x201a28);logger[_0x62ed('0x11')]('UpdateVoiceQueueReport',_0x201a28,JSON[_0x62ed('0x13')](_0x54da73));_0xe45f42(_0x54da73);})[_0x62ed('0x19')](function(_0x47721d){logger['error'](_0x62ed('0x25'),_0x47721d[_0x62ed('0x17')],_0x201a28);_0x35cd08(_0x575301[_0x62ed('0x14')](0x1f4,_0x47721d['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index dd15d75..bd5f711 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 _0x4b89=['register','length','./voiceQueueReport.events','save','remove','emit','removeListener'];(function(_0xa6f90c,_0x1d315b){var _0x2b19c8=function(_0x4817be){while(--_0x4817be){_0xa6f90c['push'](_0xa6f90c['shift']());}};_0x2b19c8(++_0x1d315b);}(_0x4b89,0x167));var _0x94b8=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0x4b89[_0x2389bc];return _0x170548;};'use strict';var VoiceQueueReportEvents=require(_0x94b8('0x0'));var events=[_0x94b8('0x1'),_0x94b8('0x2'),'update'];function createListener(_0x4400e4,_0x5102af){return function(_0x3459d1){_0x5102af[_0x94b8('0x3')](_0x4400e4,_0x3459d1);};}function removeListener(_0x480176,_0x2c9db7){return function(){VoiceQueueReportEvents[_0x94b8('0x4')](_0x480176,_0x2c9db7);};}exports[_0x94b8('0x5')]=function(_0x1447c6){for(var _0x28b6ad=0x0,_0x5b1112=events[_0x94b8('0x6')];_0x28b6ad<_0x5b1112;_0x28b6ad++){var _0x32a154=events[_0x28b6ad];var _0x342d67=createListener('voiceQueueReport:'+_0x32a154,_0x1447c6);VoiceQueueReportEvents['on'](_0x32a154,_0x342d67);}}; \ No newline at end of file +var _0x1650=['remove','update','emit','register','./voiceQueueReport.events','save'];(function(_0x4ddaa5,_0x2fe143){var _0x417730=function(_0x41cee8){while(--_0x41cee8){_0x4ddaa5['push'](_0x4ddaa5['shift']());}};_0x417730(++_0x2fe143);}(_0x1650,0xc4));var _0x0165=function(_0x3cd128,_0x4c36f5){_0x3cd128=_0x3cd128-0x0;var _0x1c3e99=_0x1650[_0x3cd128];return _0x1c3e99;};'use strict';var VoiceQueueReportEvents=require(_0x0165('0x0'));var events=[_0x0165('0x1'),_0x0165('0x2'),_0x0165('0x3')];function createListener(_0x4795c0,_0x3b2128){return function(_0x560f92){_0x3b2128[_0x0165('0x4')](_0x4795c0,_0x560f92);};}function removeListener(_0x3e40ea,_0x2e76d5){return function(){VoiceQueueReportEvents['removeListener'](_0x3e40ea,_0x2e76d5);};}exports[_0x0165('0x5')]=function(_0x202748){for(var _0x39f4df=0x0,_0x31ee15=events['length'];_0x39f4df<_0x31ee15;_0x39f4df++){var _0x127c53=events[_0x39f4df];var _0x4d1ecc=createListener('voiceQueueReport:'+_0x127c53,_0x202748);VoiceQueueReportEvents['on'](_0x127c53,_0x4d1ecc);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 32167d8..818cfb0 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 _0xee2c=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xee2c,0x1c7));var _0xcee2=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xee2c[_0x2aec52];return _0x3b8835;};'use strict';var multer=require(_0xcee2('0x0'));var util=require('util');var path=require(_0xcee2('0x1'));var timeout=require(_0xcee2('0x2'));var express=require(_0xcee2('0x3'));var router=express[_0xcee2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcee2('0x5'));var config=require(_0xcee2('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xcee2('0x7')]('/',auth[_0xcee2('0x8')](),controller[_0xcee2('0x9')]);router[_0xcee2('0x7')](_0xcee2('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xcee2('0xb')]('/',auth[_0xcee2('0x8')](),controller[_0xcee2('0xc')]);router[_0xcee2('0xd')](_0xcee2('0xa'),auth[_0xcee2('0x8')](),controller[_0xcee2('0xe')]);router[_0xcee2('0xf')]('/:id',auth[_0xcee2('0x8')](),controller[_0xcee2('0x10')]);module[_0xcee2('0x11')]=router; \ No newline at end of file +var _0x6afc=['../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','show','create','update','destroy','multer','path','express','Router','../../components/auth/service'];(function(_0x2eae6d,_0xd60dce){var _0x554c75=function(_0x19c92c){while(--_0x19c92c){_0x2eae6d['push'](_0x2eae6d['shift']());}};_0x554c75(++_0xd60dce);}(_0x6afc,0x16b));var _0xc6af=function(_0x24de29,_0xba28f3){_0x24de29=_0x24de29-0x0;var _0x560a81=_0x6afc[_0x24de29];return _0x560a81;};'use strict';var multer=require(_0xc6af('0x0'));var util=require('util');var path=require(_0xc6af('0x1'));var timeout=require('connect-timeout');var express=require(_0xc6af('0x2'));var router=express[_0xc6af('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc6af('0x4'));var interaction=require(_0xc6af('0x5'));var config=require(_0xc6af('0x6'));var controller=require(_0xc6af('0x7'));router['get']('/',auth[_0xc6af('0x8')](),controller[_0xc6af('0x9')]);router[_0xc6af('0xa')](_0xc6af('0xb'),auth[_0xc6af('0x8')](),controller[_0xc6af('0xc')]);router['post']('/',auth[_0xc6af('0x8')](),controller[_0xc6af('0xd')]);router['put']('/:id',auth[_0xc6af('0x8')](),controller[_0xc6af('0xe')]);router['delete'](_0xc6af('0xb'),auth[_0xc6af('0x8')](),controller[_0xc6af('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 978854b..09282cc 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 _0x1a06=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x47e6d0,_0x38fd4d){var _0x26892d=function(_0x1ea72d){while(--_0x1ea72d){_0x47e6d0['push'](_0x47e6d0['shift']());}};_0x26892d(++_0x38fd4d);}(_0x1a06,0x91));var _0x61a0=function(_0x5835cc,_0x482e2d){_0x5835cc=_0x5835cc-0x0;var _0x3accf5=_0x1a06[_0x5835cc];return _0x3accf5;};'use strict';var Sequelize=require(_0x61a0('0x0'));var moment=require(_0x61a0('0x1'));module[_0x61a0('0x2')]={'time':{'type':Sequelize[_0x61a0('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x61a0('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x61a0('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x61a0('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x61a0('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x61a0('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x61a0('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x61a0('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x61a0('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x61a0('0x4')],'allowNull':![],'defaultValue':moment()[_0x61a0('0x5')](_0x61a0('0x6'))}}; \ No newline at end of file +var _0xd5f1=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','format'];(function(_0x307bf6,_0x55bdd5){var _0x2878fc=function(_0x4fa44f){while(--_0x4fa44f){_0x307bf6['push'](_0x307bf6['shift']());}};_0x2878fc(++_0x55bdd5);}(_0xd5f1,0x1b1));var _0x1d5f=function(_0x49a9ac,_0x4554f0){_0x49a9ac=_0x49a9ac-0x0;var _0x46f986=_0xd5f1[_0x49a9ac];return _0x46f986;};'use strict';var Sequelize=require(_0x1d5f('0x0'));var moment=require(_0x1d5f('0x1'));module[_0x1d5f('0x2')]={'time':{'type':Sequelize[_0x1d5f('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x1d5f('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x1d5f('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x1d5f('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x1d5f('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x1d5f('0x4')](_0x1d5f('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index f29ae2a..ac6fdbd 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 _0x40dd=['update','then','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','type','query','keys','model','fields','attributes','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x4fb805,_0x522612){var _0xf72291=function(_0x1f0459){while(--_0x1f0459){_0x4fb805['push'](_0x4fb805['shift']());}};_0xf72291(++_0x522612);}(_0x40dd,0x18d));var _0xd40d=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x40dd[_0x2160a9];return _0xa88cf7;};'use strict';var emlformat=require(_0xd40d('0x0'));var rimraf=require(_0xd40d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd40d('0x2'));var rp=require(_0xd40d('0x3'));var moment=require(_0xd40d('0x4'));var BPromise=require(_0xd40d('0x5'));var Mustache=require(_0xd40d('0x6'));var util=require(_0xd40d('0x7'));var path=require(_0xd40d('0x8'));var sox=require(_0xd40d('0x9'));var csv=require(_0xd40d('0xa'));var ejs=require(_0xd40d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd40d('0xc'));var crypto=require('crypto');var jsforce=require(_0xd40d('0xd'));var deskjs=require(_0xd40d('0xe'));var toCsv=require(_0xd40d('0xa'));var querystring=require('querystring');var Papa=require(_0xd40d('0xf'));var Redis=require('ioredis');var authService=require(_0xd40d('0x10'));var qs=require(_0xd40d('0x11'));var as=require(_0xd40d('0x12'));var hardwareService=require(_0xd40d('0x13'));var logger=require('../../config/logger')(_0xd40d('0x14'));var utils=require(_0xd40d('0x15'));var config=require(_0xd40d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd40d('0x17'))['db'];function respondWithStatusCode(_0xda5c64,_0x3886af){_0x3886af=_0x3886af||0xcc;return function(_0x1fd09f){if(_0x1fd09f){return _0xda5c64['sendStatus'](_0x3886af);}return _0xda5c64[_0xd40d('0x18')](_0x3886af)[_0xd40d('0x19')]();};}function respondWithResult(_0x2c5379,_0x2e3e62){_0x2e3e62=_0x2e3e62||0xc8;return function(_0x576b77){if(_0x576b77){return _0x2c5379['status'](_0x2e3e62)[_0xd40d('0x1a')](_0x576b77);}};}function respondWithFilteredResult(_0x2260f4,_0x5713b4){return function(_0xca0b48){if(_0xca0b48){var _0xb6db69=_0xca0b48[_0xd40d('0x1b')],_0x5dda1c=_0x5713b4[_0xd40d('0x1c')],_0x43bef5=_0x5713b4[_0xd40d('0x1c')]+_0x5713b4[_0xd40d('0x1d')],_0xa15ff0;if(_0x43bef5>=_0xb6db69){_0x43bef5=_0xb6db69;_0xa15ff0=0xc8;}else{_0xa15ff0=0xce;}_0x2260f4[_0xd40d('0x18')](_0xa15ff0);return _0x2260f4[_0xd40d('0x1e')](_0xd40d('0x1f'),_0x5dda1c+'-'+_0x43bef5+'/'+_0xb6db69)[_0xd40d('0x1a')](_0xca0b48);}return null;};}function patchUpdates(_0x295754){return function(_0x509394){try{jsonpatch[_0xd40d('0x20')](_0x509394,_0x295754,!![]);}catch(_0x769aae){return BPromise[_0xd40d('0x21')](_0x769aae);}return _0x509394[_0xd40d('0x22')]();};}function saveUpdates(_0x50458f,_0x1e4a20){return function(_0x4e054b){if(_0x4e054b){return _0x4e054b[_0xd40d('0x23')](_0x50458f)[_0xd40d('0x24')](function(_0x1b8a96){return _0x1b8a96;});}return null;};}function removeEntity(_0x525e7b,_0x213f11){return function(_0x2dd99e){if(_0x2dd99e){return _0x2dd99e['destroy']()[_0xd40d('0x24')](function(){_0x525e7b[_0xd40d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cac4d,_0x586537){return function(_0xa71f50){if(!_0xa71f50){_0x3cac4d[_0xd40d('0x25')](0x194);}return _0xa71f50;};}function handleError(_0x4be8b0,_0x2eae06){_0x2eae06=_0x2eae06||0x1f4;return function(_0x320dd4){logger[_0xd40d('0x26')](_0x320dd4[_0xd40d('0x27')]);if(_0x320dd4[_0xd40d('0x28')]){delete _0x320dd4[_0xd40d('0x28')];}_0x4be8b0['status'](_0x2eae06)[_0xd40d('0x29')](_0x320dd4);};}exports[_0xd40d('0x2a')]=function(_0x41c42e,_0x12d773){var _0x8407ba={},_0x59fff8={},_0x895744={'count':0x0,'rows':[]};var _0x34897e=_[_0xd40d('0x2b')](db[_0xd40d('0x2c')]['rawAttributes'],function(_0x174408){return{'name':_0x174408['fieldName'],'type':_0x174408[_0xd40d('0x2d')]['key']};});_0x59fff8['model']=_['map'](_0x34897e,_0xd40d('0x28'));_0x59fff8[_0xd40d('0x2e')]=_[_0xd40d('0x2f')](_0x41c42e['query']);_0x59fff8['filters']=_['intersection'](_0x59fff8[_0xd40d('0x30')],_0x59fff8[_0xd40d('0x2e')]);_0x8407ba['attributes']=_['intersection'](_0x59fff8[_0xd40d('0x30')],qs[_0xd40d('0x31')](_0x41c42e['query'][_0xd40d('0x31')]));_0x8407ba[_0xd40d('0x32')]=_0x8407ba[_0xd40d('0x32')][_0xd40d('0x33')]?_0x8407ba[_0xd40d('0x32')]:_0x59fff8[_0xd40d('0x30')];if(!_0x41c42e[_0xd40d('0x2e')]['hasOwnProperty']('nolimit')){_0x8407ba['limit']=qs['limit'](_0x41c42e['query'][_0xd40d('0x1d')]);_0x8407ba['offset']=qs['offset'](_0x41c42e[_0xd40d('0x2e')][_0xd40d('0x1c')]);}_0x8407ba[_0xd40d('0x34')]=qs[_0xd40d('0x35')](_0x41c42e[_0xd40d('0x2e')][_0xd40d('0x35')]);_0x8407ba[_0xd40d('0x36')]=qs[_0xd40d('0x37')](_[_0xd40d('0x38')](_0x41c42e[_0xd40d('0x2e')],_0x59fff8[_0xd40d('0x37')]),_0x34897e);if(_0x41c42e['query'][_0xd40d('0x39')]){_0x8407ba['where']=_['merge'](_0x8407ba[_0xd40d('0x36')],{'$or':_['map'](_0x34897e,function(_0x3dd0e5){if(_0x3dd0e5[_0xd40d('0x2d')]!==_0xd40d('0x3a')){var _0x37035f={};_0x37035f[_0x3dd0e5['name']]={'$like':'%'+_0x41c42e['query'][_0xd40d('0x39')]+'%'};return _0x37035f;}})});}_0x8407ba=_[_0xd40d('0x3b')]({},_0x8407ba,_0x41c42e[_0xd40d('0x3c')]);var _0x5169e6={'where':_0x8407ba['where']};return db['VoiceQueuesLog'][_0xd40d('0x1b')](_0x5169e6)[_0xd40d('0x24')](function(_0x8055ba){_0x895744[_0xd40d('0x1b')]=_0x8055ba;if(_0x41c42e[_0xd40d('0x2e')][_0xd40d('0x3d')]){_0x8407ba[_0xd40d('0x3e')]=[{'all':!![]}];}return db[_0xd40d('0x2c')]['findAll'](_0x8407ba);})[_0xd40d('0x24')](function(_0x216a51){_0x895744[_0xd40d('0x3f')]=_0x216a51;return _0x895744;})[_0xd40d('0x24')](respondWithFilteredResult(_0x12d773,_0x8407ba))[_0xd40d('0x40')](handleError(_0x12d773,null));};exports[_0xd40d('0x41')]=function(_0x1ba61c,_0x12e2ce){var _0x38ccff={'raw':!![],'where':{'id':_0x1ba61c[_0xd40d('0x42')]['id']}},_0xea4879={};_0xea4879[_0xd40d('0x30')]=_[_0xd40d('0x2f')](db['VoiceQueuesLog']['rawAttributes']);_0xea4879['query']=_[_0xd40d('0x2f')](_0x1ba61c[_0xd40d('0x2e')]);_0xea4879[_0xd40d('0x37')]=_[_0xd40d('0x43')](_0xea4879[_0xd40d('0x30')],_0xea4879['query']);_0x38ccff[_0xd40d('0x32')]=_['intersection'](_0xea4879[_0xd40d('0x30')],qs[_0xd40d('0x31')](_0x1ba61c[_0xd40d('0x2e')][_0xd40d('0x31')]));_0x38ccff[_0xd40d('0x32')]=_0x38ccff['attributes'][_0xd40d('0x33')]?_0x38ccff[_0xd40d('0x32')]:_0xea4879[_0xd40d('0x30')];if(_0x1ba61c['query'][_0xd40d('0x3d')]){_0x38ccff[_0xd40d('0x3e')]=[{'all':!![]}];}_0x38ccff=_['merge']({},_0x38ccff,_0x1ba61c[_0xd40d('0x3c')]);return db[_0xd40d('0x2c')][_0xd40d('0x44')](_0x38ccff)[_0xd40d('0x24')](handleEntityNotFound(_0x12e2ce,null))[_0xd40d('0x24')](respondWithResult(_0x12e2ce,null))[_0xd40d('0x40')](handleError(_0x12e2ce,null));};exports[_0xd40d('0x45')]=function(_0x3498d4,_0x98b70a){return db['VoiceQueuesLog'][_0xd40d('0x45')](_0x3498d4['body'],{})[_0xd40d('0x24')](respondWithResult(_0x98b70a,0xc9))[_0xd40d('0x40')](handleError(_0x98b70a,null));};exports[_0xd40d('0x23')]=function(_0xd16c8a,_0xfa1a82){if(_0xd16c8a[_0xd40d('0x46')]['id']){delete _0xd16c8a['body']['id'];}return db[_0xd40d('0x2c')][_0xd40d('0x44')]({'where':{'id':_0xd16c8a[_0xd40d('0x42')]['id']}})[_0xd40d('0x24')](handleEntityNotFound(_0xfa1a82,null))['then'](saveUpdates(_0xd16c8a['body'],null))[_0xd40d('0x24')](respondWithResult(_0xfa1a82,null))['catch'](handleError(_0xfa1a82,null));};exports[_0xd40d('0x47')]=function(_0x3fddac,_0xd11b76){return db[_0xd40d('0x2c')][_0xd40d('0x44')]({'where':{'id':_0x3fddac[_0xd40d('0x42')]['id']}})['then'](handleEntityNotFound(_0xd11b76,null))[_0xd40d('0x24')](removeEntity(_0xd11b76,null))['catch'](handleError(_0xd11b76,null));}; \ No newline at end of file +var _0x6cca=['../../config/environment','../../config/license/util','../../mysqldb','end','json','count','offset','limit','status','set','reject','save','then','destroy','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','show','params','intersection','options','catch','create','update','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cca,0x10e));var _0xa6cc=function(_0x5c713e,_0x14bf36){_0x5c713e=_0x5c713e-0x0;var _0xc8c323=_0x6cca[_0x5c713e];return _0xc8c323;};'use strict';var emlformat=require(_0xa6cc('0x0'));var rimraf=require(_0xa6cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6cc('0x2'));var rp=require(_0xa6cc('0x3'));var moment=require(_0xa6cc('0x4'));var BPromise=require(_0xa6cc('0x5'));var Mustache=require('mustache');var util=require(_0xa6cc('0x6'));var path=require(_0xa6cc('0x7'));var sox=require(_0xa6cc('0x8'));var csv=require(_0xa6cc('0x9'));var ejs=require(_0xa6cc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6cc('0xb'));var squel=require(_0xa6cc('0xc'));var crypto=require(_0xa6cc('0xd'));var jsforce=require(_0xa6cc('0xe'));var deskjs=require(_0xa6cc('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa6cc('0x10'));var Papa=require('papaparse');var Redis=require(_0xa6cc('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6cc('0x12'));var hardwareService=require(_0xa6cc('0x13'));var logger=require(_0xa6cc('0x14'))(_0xa6cc('0x15'));var utils=require('../../config/utils');var config=require(_0xa6cc('0x16'));var licenseUtil=require(_0xa6cc('0x17'));var db=require(_0xa6cc('0x18'))['db'];function respondWithStatusCode(_0x2a168d,_0x3df60d){_0x3df60d=_0x3df60d||0xcc;return function(_0x3d854f){if(_0x3d854f){return _0x2a168d['sendStatus'](_0x3df60d);}return _0x2a168d['status'](_0x3df60d)[_0xa6cc('0x19')]();};}function respondWithResult(_0x17c995,_0x4f7819){_0x4f7819=_0x4f7819||0xc8;return function(_0x2d50ff){if(_0x2d50ff){return _0x17c995['status'](_0x4f7819)[_0xa6cc('0x1a')](_0x2d50ff);}};}function respondWithFilteredResult(_0x3b797e,_0x27c2a6){return function(_0x7ac53b){if(_0x7ac53b){var _0xe9c74e=_0x7ac53b[_0xa6cc('0x1b')],_0x248c78=_0x27c2a6[_0xa6cc('0x1c')],_0x291746=_0x27c2a6['offset']+_0x27c2a6[_0xa6cc('0x1d')],_0x333cfe;if(_0x291746>=_0xe9c74e){_0x291746=_0xe9c74e;_0x333cfe=0xc8;}else{_0x333cfe=0xce;}_0x3b797e[_0xa6cc('0x1e')](_0x333cfe);return _0x3b797e[_0xa6cc('0x1f')]('Content-Range',_0x248c78+'-'+_0x291746+'/'+_0xe9c74e)[_0xa6cc('0x1a')](_0x7ac53b);}return null;};}function patchUpdates(_0x475ead){return function(_0x354700){try{jsonpatch['apply'](_0x354700,_0x475ead,!![]);}catch(_0x59b404){return BPromise[_0xa6cc('0x20')](_0x59b404);}return _0x354700[_0xa6cc('0x21')]();};}function saveUpdates(_0x168abd,_0x367cb5){return function(_0x213a99){if(_0x213a99){return _0x213a99['update'](_0x168abd)[_0xa6cc('0x22')](function(_0x116677){return _0x116677;});}return null;};}function removeEntity(_0x10380d,_0x50d0ab){return function(_0x21b05c){if(_0x21b05c){return _0x21b05c[_0xa6cc('0x23')]()[_0xa6cc('0x22')](function(){_0x10380d[_0xa6cc('0x1e')](0xcc)[_0xa6cc('0x19')]();});}};}function handleEntityNotFound(_0x3ca6e3,_0x371a00){return function(_0x35c8c5){if(!_0x35c8c5){_0x3ca6e3['sendStatus'](0x194);}return _0x35c8c5;};}function handleError(_0x1dd7da,_0xf6f086){_0xf6f086=_0xf6f086||0x1f4;return function(_0x1aa1ba){logger[_0xa6cc('0x24')](_0x1aa1ba['stack']);if(_0x1aa1ba[_0xa6cc('0x25')]){delete _0x1aa1ba[_0xa6cc('0x25')];}_0x1dd7da['status'](_0xf6f086)[_0xa6cc('0x26')](_0x1aa1ba);};}exports[_0xa6cc('0x27')]=function(_0x45252b,_0x239c54){var _0x4cf606={},_0x5bd191={},_0x3cc1c0={'count':0x0,'rows':[]};var _0x522429=_[_0xa6cc('0x28')](db[_0xa6cc('0x29')][_0xa6cc('0x2a')],function(_0x804485){return{'name':_0x804485[_0xa6cc('0x2b')],'type':_0x804485['type']['key']};});_0x5bd191[_0xa6cc('0x2c')]=_[_0xa6cc('0x28')](_0x522429,'name');_0x5bd191[_0xa6cc('0x2d')]=_[_0xa6cc('0x2e')](_0x45252b[_0xa6cc('0x2d')]);_0x5bd191[_0xa6cc('0x2f')]=_['intersection'](_0x5bd191[_0xa6cc('0x2c')],_0x5bd191[_0xa6cc('0x2d')]);_0x4cf606[_0xa6cc('0x30')]=_['intersection'](_0x5bd191['model'],qs[_0xa6cc('0x31')](_0x45252b[_0xa6cc('0x2d')]['fields']));_0x4cf606[_0xa6cc('0x30')]=_0x4cf606[_0xa6cc('0x30')][_0xa6cc('0x32')]?_0x4cf606[_0xa6cc('0x30')]:_0x5bd191[_0xa6cc('0x2c')];if(!_0x45252b[_0xa6cc('0x2d')][_0xa6cc('0x33')](_0xa6cc('0x34'))){_0x4cf606['limit']=qs[_0xa6cc('0x1d')](_0x45252b['query'][_0xa6cc('0x1d')]);_0x4cf606[_0xa6cc('0x1c')]=qs['offset'](_0x45252b[_0xa6cc('0x2d')][_0xa6cc('0x1c')]);}_0x4cf606[_0xa6cc('0x35')]=qs[_0xa6cc('0x36')](_0x45252b[_0xa6cc('0x2d')][_0xa6cc('0x36')]);_0x4cf606[_0xa6cc('0x37')]=qs[_0xa6cc('0x2f')](_[_0xa6cc('0x38')](_0x45252b[_0xa6cc('0x2d')],_0x5bd191[_0xa6cc('0x2f')]),_0x522429);if(_0x45252b['query']['filter']){_0x4cf606['where']=_[_0xa6cc('0x39')](_0x4cf606[_0xa6cc('0x37')],{'$or':_['map'](_0x522429,function(_0x2e207e){if(_0x2e207e[_0xa6cc('0x3a')]!==_0xa6cc('0x3b')){var _0x392f40={};_0x392f40[_0x2e207e['name']]={'$like':'%'+_0x45252b['query'][_0xa6cc('0x3c')]+'%'};return _0x392f40;}})});}_0x4cf606=_[_0xa6cc('0x39')]({},_0x4cf606,_0x45252b['options']);var _0x23cfb3={'where':_0x4cf606[_0xa6cc('0x37')]};return db['VoiceQueuesLog']['count'](_0x23cfb3)[_0xa6cc('0x22')](function(_0x1acf19){_0x3cc1c0[_0xa6cc('0x1b')]=_0x1acf19;if(_0x45252b[_0xa6cc('0x2d')][_0xa6cc('0x3d')]){_0x4cf606[_0xa6cc('0x3e')]=[{'all':!![]}];}return db[_0xa6cc('0x29')]['findAll'](_0x4cf606);})[_0xa6cc('0x22')](function(_0x2a52e0){_0x3cc1c0[_0xa6cc('0x3f')]=_0x2a52e0;return _0x3cc1c0;})['then'](respondWithFilteredResult(_0x239c54,_0x4cf606))['catch'](handleError(_0x239c54,null));};exports[_0xa6cc('0x40')]=function(_0x1a1d73,_0xe64092){var _0x44f990={'raw':!![],'where':{'id':_0x1a1d73[_0xa6cc('0x41')]['id']}},_0x5cf548={};_0x5cf548[_0xa6cc('0x2c')]=_[_0xa6cc('0x2e')](db[_0xa6cc('0x29')][_0xa6cc('0x2a')]);_0x5cf548[_0xa6cc('0x2d')]=_['keys'](_0x1a1d73[_0xa6cc('0x2d')]);_0x5cf548['filters']=_[_0xa6cc('0x42')](_0x5cf548[_0xa6cc('0x2c')],_0x5cf548[_0xa6cc('0x2d')]);_0x44f990[_0xa6cc('0x30')]=_[_0xa6cc('0x42')](_0x5cf548[_0xa6cc('0x2c')],qs['fields'](_0x1a1d73[_0xa6cc('0x2d')][_0xa6cc('0x31')]));_0x44f990['attributes']=_0x44f990[_0xa6cc('0x30')][_0xa6cc('0x32')]?_0x44f990[_0xa6cc('0x30')]:_0x5cf548[_0xa6cc('0x2c')];if(_0x1a1d73['query']['includeAll']){_0x44f990[_0xa6cc('0x3e')]=[{'all':!![]}];}_0x44f990=_[_0xa6cc('0x39')]({},_0x44f990,_0x1a1d73[_0xa6cc('0x43')]);return db[_0xa6cc('0x29')]['find'](_0x44f990)[_0xa6cc('0x22')](handleEntityNotFound(_0xe64092,null))[_0xa6cc('0x22')](respondWithResult(_0xe64092,null))[_0xa6cc('0x44')](handleError(_0xe64092,null));};exports[_0xa6cc('0x45')]=function(_0x3d4652,_0x56952b){return db[_0xa6cc('0x29')][_0xa6cc('0x45')](_0x3d4652['body'],{})[_0xa6cc('0x22')](respondWithResult(_0x56952b,0xc9))['catch'](handleError(_0x56952b,null));};exports[_0xa6cc('0x46')]=function(_0x166090,_0xd4bd62){if(_0x166090[_0xa6cc('0x47')]['id']){delete _0x166090[_0xa6cc('0x47')]['id'];}return db[_0xa6cc('0x29')][_0xa6cc('0x48')]({'where':{'id':_0x166090[_0xa6cc('0x41')]['id']}})[_0xa6cc('0x22')](handleEntityNotFound(_0xd4bd62,null))[_0xa6cc('0x22')](saveUpdates(_0x166090[_0xa6cc('0x47')],null))[_0xa6cc('0x22')](respondWithResult(_0xd4bd62,null))[_0xa6cc('0x44')](handleError(_0xd4bd62,null));};exports[_0xa6cc('0x23')]=function(_0x207a53,_0x46c851){return db[_0xa6cc('0x29')][_0xa6cc('0x48')]({'where':{'id':_0x207a53[_0xa6cc('0x41')]['id']}})[_0xa6cc('0x22')](handleEntityNotFound(_0x46c851,null))[_0xa6cc('0x22')](removeEntity(_0x46c851,null))[_0xa6cc('0x44')](handleError(_0x46c851,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 24469f2..7e2843a 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 _0x3b6d=['../../config/logger','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','event','dtm','lodash'];(function(_0x325a08,_0x571fff){var _0x436e01=function(_0x2c7719){while(--_0x2c7719){_0x325a08['push'](_0x325a08['shift']());}};_0x436e01(++_0x571fff);}(_0x3b6d,0x67));var _0xd3b6=function(_0xece93a,_0x182adb){_0xece93a=_0xece93a-0x0;var _0x42c33e=_0x3b6d[_0xece93a];return _0x42c33e;};'use strict';var _=require(_0xd3b6('0x0'));var util=require('util');var logger=require(_0xd3b6('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd3b6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3b6('0x3'));var rimraf=require(_0xd3b6('0x4'));var config=require(_0xd3b6('0x5'));var attributes=require(_0xd3b6('0x6'));module[_0xd3b6('0x7')]=function(_0xbff4a8,_0x154007){return _0xbff4a8[_0xd3b6('0x8')](_0xd3b6('0x9'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xd3b6('0xa'),'fields':[_0xd3b6('0xb'),_0xd3b6('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xc601=['event','dtm','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueuesLog','event_dtm'];(function(_0x5bc8a6,_0x56d59d){var _0x29373b=function(_0x28531f){while(--_0x28531f){_0x5bc8a6['push'](_0x5bc8a6['shift']());}};_0x29373b(++_0x56d59d);}(_0xc601,0x18a));var _0x1c60=function(_0x25ee3a,_0x29c2f8){_0x25ee3a=_0x25ee3a-0x0;var _0x3fb7d6=_0xc601[_0x25ee3a];return _0x3fb7d6;};'use strict';var _=require('lodash');var util=require(_0x1c60('0x0'));var logger=require(_0x1c60('0x1'))(_0x1c60('0x2'));var moment=require('moment');var BPromise=require(_0x1c60('0x3'));var rp=require(_0x1c60('0x4'));var fs=require('fs');var path=require(_0x1c60('0x5'));var rimraf=require(_0x1c60('0x6'));var config=require(_0x1c60('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x1c60('0x8')]=function(_0x1d5faf,_0x32f70a){return _0x1d5faf[_0x1c60('0x9')](_0x1c60('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x1c60('0xb'),'fields':[_0x1c60('0xc'),_0x1c60('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index e835e0e..a72cced 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 _0x80ed=['request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0xe25333,_0x151869){var _0x4bc4ad=function(_0x6060ee){while(--_0x6060ee){_0xe25333['push'](_0xe25333['shift']());}};_0x4bc4ad(++_0x151869);}(_0x80ed,0x11c));var _0xd80e=function(_0x5de417,_0x254388){_0x5de417=_0x5de417-0x0;var _0x288d74=_0x80ed[_0x5de417];return _0x288d74;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51c361,_0x411b3a,_0x438f7d){return new BPromise(function(_0x3b4f35,_0x1bacd3){return client[_0xd80e('0xb')](_0x51c361,_0x438f7d)[_0xd80e('0xc')](function(_0x3063ff){logger[_0xd80e('0xd')](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));logger['debug'](_0xd80e('0x10'),_0x411b3a,_0xd80e('0xf'),JSON[_0xd80e('0x11')](_0x3063ff));if(_0x3063ff[_0xd80e('0x12')]){if(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x13')]===0x1f4){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')]['message']);return _0x1bacd3(_0x3063ff['error']['message']);}logger['error'](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);return _0x3b4f35(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);}else{logger['info'](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));_0x3b4f35(_0x3063ff[_0xd80e('0x15')][_0xd80e('0x14')]);}})[_0xd80e('0x16')](function(_0xc25d82){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0xc25d82);_0x1bacd3(_0xc25d82);});});} \ No newline at end of file +var _0xbc9d=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x3f906e,_0x1c917f){_0x3f906e=_0x3f906e-0x0;var _0x53364b=_0xbc9d[_0x3f906e];return _0x53364b;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var moment=require(_0xdbc9('0x2'));var BPromise=require(_0xdbc9('0x3'));var rs=require(_0xdbc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdbc9('0x5'))(_0xdbc9('0x6'));var config=require(_0xdbc9('0x7'));var jayson=require(_0xdbc9('0x8'));var client=jayson[_0xdbc9('0x9')][_0xdbc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381a0e,_0x4a9246,_0x2dbd23){return new BPromise(function(_0x181f8a,_0x3d4918){return client['request'](_0x381a0e,_0x2dbd23)[_0xdbc9('0xb')](function(_0x53cff1){logger['info'](_0xdbc9('0xc'),_0x4a9246,_0xdbc9('0xd'));logger[_0xdbc9('0xe')](_0xdbc9('0xf'),_0x4a9246,'request\x20sent',JSON[_0xdbc9('0x10')](_0x53cff1));if(_0x53cff1[_0xdbc9('0x11')]){if(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x12')]===0x1f4){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1['error']['message']);return _0x3d4918(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1[_0xdbc9('0x11')]['message']);return _0x181f8a(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}else{logger[_0xdbc9('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4a9246,_0xdbc9('0xd'));_0x181f8a(_0x53cff1[_0xdbc9('0x15')]['message']);}})[_0xdbc9('0x16')](function(_0x37856d){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x37856d);_0x3d4918(_0x37856d);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 75a272f..6fbf284 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 _0x5e14=['index','/describe','isAuthenticated','describe','show','/:id/download','download','/:id/downloads','downloadTranscribe','runTranscribe','put','/:id','update','destroy','exports','util','path','express','Router','../../config/environment','./voiceRecording.controller','get'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x5e14,0xa9));var _0x45e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e14[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x45e1('0x0'));var path=require(_0x45e1('0x1'));var timeout=require('connect-timeout');var express=require(_0x45e1('0x2'));var router=express[_0x45e1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x45e1('0x4'));var controller=require(_0x45e1('0x5'));router[_0x45e1('0x6')]('/',auth['isAuthenticated'](),controller[_0x45e1('0x7')]);router[_0x45e1('0x6')](_0x45e1('0x8'),auth[_0x45e1('0x9')](),controller[_0x45e1('0xa')]);router['get']('/:id',auth[_0x45e1('0x9')](),controller[_0x45e1('0xb')]);router[_0x45e1('0x6')](_0x45e1('0xc'),auth[_0x45e1('0x9')](),controller[_0x45e1('0xd')]);router[_0x45e1('0x6')](_0x45e1('0xe'),controller['downloads']);router[_0x45e1('0x6')]('/:id/transcribe',auth[_0x45e1('0x9')](),controller[_0x45e1('0xf')]);router['post']('/',auth[_0x45e1('0x9')](),controller['create']);router['post']('/:id/transcribe',auth[_0x45e1('0x9')](),controller[_0x45e1('0x10')]);router[_0x45e1('0x11')](_0x45e1('0x12'),auth[_0x45e1('0x9')](),controller[_0x45e1('0x13')]);router['delete']('/:id',auth[_0x45e1('0x9')](),controller[_0x45e1('0x14')]);module[_0x45e1('0x15')]=router; \ No newline at end of file +var _0xfab5=['isAuthenticated','index','/describe','describe','/:id','show','download','downloads','/:id/transcribe','downloadTranscribe','create','destroy','multer','path','express','fs-extra','../../components/auth/service','get'];(function(_0x41930d,_0x478ed3){var _0x455ade=function(_0x24cb07){while(--_0x24cb07){_0x41930d['push'](_0x41930d['shift']());}};_0x455ade(++_0x478ed3);}(_0xfab5,0x78));var _0x5fab=function(_0x5a452e,_0x355a90){_0x5a452e=_0x5a452e-0x0;var _0x2c4c43=_0xfab5[_0x5a452e];return _0x2c4c43;};'use strict';var multer=require(_0x5fab('0x0'));var util=require('util');var path=require(_0x5fab('0x1'));var timeout=require('connect-timeout');var express=require(_0x5fab('0x2'));var router=express['Router']();var fs_extra=require(_0x5fab('0x3'));var auth=require(_0x5fab('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x5fab('0x5')]('/',auth[_0x5fab('0x6')](),controller[_0x5fab('0x7')]);router[_0x5fab('0x5')](_0x5fab('0x8'),auth['isAuthenticated'](),controller[_0x5fab('0x9')]);router['get'](_0x5fab('0xa'),auth[_0x5fab('0x6')](),controller[_0x5fab('0xb')]);router[_0x5fab('0x5')]('/:id/download',auth[_0x5fab('0x6')](),controller[_0x5fab('0xc')]);router[_0x5fab('0x5')]('/:id/downloads',controller[_0x5fab('0xd')]);router['get'](_0x5fab('0xe'),auth[_0x5fab('0x6')](),controller[_0x5fab('0xf')]);router['post']('/',auth[_0x5fab('0x6')](),controller[_0x5fab('0x10')]);router['post']('/:id/transcribe',auth['isAuthenticated'](),controller['runTranscribe']);router['put']('/:id',auth[_0x5fab('0x6')](),controller['update']);router['delete'](_0x5fab('0xa'),auth['isAuthenticated'](),controller[_0x5fab('0x11')]);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 4023e65..be56be4 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 _0xfb94=['createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','exports','getDataValue','value','extname','STRING','setDataValue','channel','membername','split','TEXT','NEW','FLOAT','BOOLEAN','DATE'];(function(_0x1fe609,_0x26d34e){var _0xd5dd35=function(_0x95c9c7){while(--_0x95c9c7){_0x1fe609['push'](_0x1fe609['shift']());}};_0xd5dd35(++_0x26d34e);}(_0xfb94,0x89));var _0x4fb9=function(_0x25c34a,_0x515106){_0x25c34a=_0x25c34a-0x0;var _0x31821c=_0xfb94[_0x25c34a];return _0x31821c;};'use strict';var Sequelize=require(_0x4fb9('0x0'));var moment=require(_0x4fb9('0x1'));var path=require(_0x4fb9('0x2'));module[_0x4fb9('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4fb9('0x4')](_0x4fb9('0x5'))?path[_0x4fb9('0x6')](this['getDataValue'](_0x4fb9('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x4fb9('0x7')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x8db858){if(_0x8db858){this[_0x4fb9('0x8')](_0x4fb9('0x9'),_0x8db858);this['setDataValue'](_0x4fb9('0xa'),_0x8db858[_0x4fb9('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x4fb9('0x7')]},'calleridnum':{'type':Sequelize[_0x4fb9('0x7')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x4fb9('0x7')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4fb9('0x7')]},'context':{'type':Sequelize[_0x4fb9('0x7')]},'exten':{'type':Sequelize[_0x4fb9('0x7')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4fb9('0x7')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x4fb9('0x7')]},'userThirdDisposition':{'type':Sequelize['STRING']},'location':{'type':Sequelize[_0x4fb9('0xc')]},'transcribeName':{'type':Sequelize[_0x4fb9('0x7')]},'transcribeStatus':{'type':Sequelize[_0x4fb9('0x7')],'defaultValue':_0x4fb9('0xd')},'fileUri':{'type':Sequelize[_0x4fb9('0xc')]},'fileText':{'type':Sequelize[_0x4fb9('0xc')]},'failureReason':{'type':Sequelize[_0x4fb9('0xc')]},'sentiment':{'type':Sequelize['STRING']},'sPositive':{'type':Sequelize[_0x4fb9('0xe')]},'sNegative':{'type':Sequelize['FLOAT']},'sNeutral':{'type':Sequelize['FLOAT']},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x4fb9('0xf')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0x4fb9('0x10')],'get':function(){return moment(this[_0x4fb9('0x4')](_0x4fb9('0x11')))[_0x4fb9('0x12')](_0x4fb9('0x13'))[_0x4fb9('0x14')]();}},'updatedAt':{'type':Sequelize[_0x4fb9('0x10')],'get':function(){return moment(this[_0x4fb9('0x4')](_0x4fb9('0x15')))[_0x4fb9('0x12')](_0x4fb9('0x13'))['toString']();}}}; \ No newline at end of file +var _0x2c02=['sequelize','moment','exports','VIRTUAL','value','extname','getDataValue','STRING','setDataValue','channel','membername','split','INTEGER','TEXT','NEW','FLOAT','BOOLEAN','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x2c02,0xf2));var _0x22c0=function(_0x11b780,_0x332ff3){_0x11b780=_0x11b780-0x0;var _0x4094c3=_0x2c02[_0x11b780];return _0x4094c3;};'use strict';var Sequelize=require(_0x22c0('0x0'));var moment=require(_0x22c0('0x1'));var path=require('path');module[_0x22c0('0x2')]={'format':{'type':Sequelize[_0x22c0('0x3')],'get':function(){return this['getDataValue'](_0x22c0('0x4'))?path[_0x22c0('0x5')](this[_0x22c0('0x6')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0x22c0('0x7')]},'channel':{'type':Sequelize[_0x22c0('0x7')],'set':function(_0x37115c){if(_0x37115c){this[_0x22c0('0x8')](_0x22c0('0x9'),_0x37115c);this['setDataValue'](_0x22c0('0xa'),_0x37115c[_0x22c0('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x22c0('0x7')]},'calleridnum':{'type':Sequelize[_0x22c0('0x7')]},'calleridname':{'type':Sequelize[_0x22c0('0x7')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x22c0('0x7')]},'accountcode':{'type':Sequelize[_0x22c0('0x7')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x22c0('0x7')]},'type':{'type':Sequelize[_0x22c0('0x7')]},'rating':{'type':Sequelize[_0x22c0('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x22c0('0x7')]},'userDisposition':{'type':Sequelize[_0x22c0('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x22c0('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x22c0('0x7')]},'location':{'type':Sequelize[_0x22c0('0xd')]},'transcribeName':{'type':Sequelize['STRING']},'transcribeStatus':{'type':Sequelize['STRING'],'defaultValue':_0x22c0('0xe')},'fileUri':{'type':Sequelize[_0x22c0('0xd')]},'fileText':{'type':Sequelize[_0x22c0('0xd')]},'failureReason':{'type':Sequelize['TEXT']},'sentiment':{'type':Sequelize[_0x22c0('0x7')]},'sPositive':{'type':Sequelize[_0x22c0('0xf')]},'sNegative':{'type':Sequelize[_0x22c0('0xf')]},'sNeutral':{'type':Sequelize[_0x22c0('0xf')]},'sMixed':{'type':Sequelize[_0x22c0('0xf')]},'tempSentiment':{'type':Sequelize[_0x22c0('0x10')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0x22c0('0x11')],'get':function(){return moment(this[_0x22c0('0x6')]('createdAt'))[_0x22c0('0x12')](_0x22c0('0x13'))[_0x22c0('0x14')]();}},'updatedAt':{'type':Sequelize[_0x22c0('0x11')],'get':function(){return moment(this[_0x22c0('0x6')](_0x22c0('0x15')))['format'](_0x22c0('0x13'))[_0x22c0('0x14')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index af662a0..e4f71e0 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 _0xbf4c=['include','findAll','rows','catch','params','options','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','extname','unlink','message','downloads','sequelize','col','token','$and','push','recording','VoiceRecording\x20not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','includeAll'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xbf4c,0xf2));var _0xcbf4=function(_0x3c302e,_0x2a353c){_0x3c302e=_0x3c302e-0x0;var _0x7bf43c=_0xbf4c[_0x3c302e];return _0x7bf43c;};'use strict';var emlformat=require(_0xcbf4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcbf4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbf4('0x2'));var moment=require(_0xcbf4('0x3'));var BPromise=require(_0xcbf4('0x4'));var Mustache=require(_0xcbf4('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcbf4('0x6'));var csv=require(_0xcbf4('0x7'));var ejs=require(_0xcbf4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbf4('0x9'));var squel=require(_0xcbf4('0xa'));var crypto=require(_0xcbf4('0xb'));var jsforce=require(_0xcbf4('0xc'));var deskjs=require(_0xcbf4('0xd'));var toCsv=require(_0xcbf4('0x7'));var querystring=require('querystring');var Papa=require(_0xcbf4('0xe'));var AWS=require('aws-sdk');var uuidv4=require(_0xcbf4('0xf'));var Redis=require('ioredis');var authService=require(_0xcbf4('0x10'));var qs=require(_0xcbf4('0x11'));var as=require(_0xcbf4('0x12'));var hardwareService=require(_0xcbf4('0x13'));var logger=require(_0xcbf4('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xcbf4('0x15'));var licenseUtil=require(_0xcbf4('0x16'));var db=require(_0xcbf4('0x17'))['db'];function respondWithStatusCode(_0x26657b,_0x194271){_0x194271=_0x194271||0xcc;return function(_0x4811c6){if(_0x4811c6){return _0x26657b[_0xcbf4('0x18')](_0x194271);}return _0x26657b[_0xcbf4('0x19')](_0x194271)[_0xcbf4('0x1a')]();};}function respondWithResult(_0xbdba3c,_0x18b0ac){_0x18b0ac=_0x18b0ac||0xc8;return function(_0x486b12){if(_0x486b12){return _0xbdba3c[_0xcbf4('0x19')](_0x18b0ac)[_0xcbf4('0x1b')](_0x486b12);}};}function respondWithFilteredResult(_0x2a444a,_0x3aed83){return function(_0x2e2d8e){if(_0x2e2d8e){var _0x37a013=_0x2e2d8e[_0xcbf4('0x1c')],_0x1eeb04=_0x3aed83[_0xcbf4('0x1d')],_0x544b9c=_0x3aed83[_0xcbf4('0x1d')]+_0x3aed83[_0xcbf4('0x1e')],_0x3a4642;if(_0x544b9c>=_0x37a013){_0x544b9c=_0x37a013;_0x3a4642=0xc8;}else{_0x3a4642=0xce;}_0x2a444a[_0xcbf4('0x19')](_0x3a4642);return _0x2a444a['set'](_0xcbf4('0x1f'),_0x1eeb04+'-'+_0x544b9c+'/'+_0x37a013)[_0xcbf4('0x1b')](_0x2e2d8e);}return null;};}function patchUpdates(_0x8c371d){return function(_0x574a64){try{jsonpatch[_0xcbf4('0x20')](_0x574a64,_0x8c371d,!![]);}catch(_0x5081ee){return BPromise[_0xcbf4('0x21')](_0x5081ee);}return _0x574a64[_0xcbf4('0x22')]();};}function saveUpdates(_0x2de2de,_0x43eb6d){return function(_0x1f6d57){if(_0x1f6d57){return _0x1f6d57[_0xcbf4('0x23')](_0x2de2de)['then'](function(_0x24874a){return _0x24874a;});}return null;};}function removeEntity(_0x4ffe7e,_0x1dfc13){return function(_0x11ab4e){if(_0x11ab4e){return _0x11ab4e[_0xcbf4('0x24')]()[_0xcbf4('0x25')](function(){_0x4ffe7e[_0xcbf4('0x19')](0xcc)[_0xcbf4('0x1a')]();});}};}function handleEntityNotFound(_0x578190,_0x20bf7c){return function(_0xdf68e5){if(!_0xdf68e5){_0x578190[_0xcbf4('0x18')](0x194);}return _0xdf68e5;};}function handleError(_0x4b6bf4,_0x222a53){_0x222a53=_0x222a53||0x1f4;return function(_0x36a76f){logger[_0xcbf4('0x26')](_0x36a76f[_0xcbf4('0x27')]);if(_0x36a76f[_0xcbf4('0x28')]){delete _0x36a76f[_0xcbf4('0x28')];}_0x4b6bf4[_0xcbf4('0x19')](_0x222a53)[_0xcbf4('0x29')](_0x36a76f);};}exports['index']=function(_0x561d05,_0x47ad3b){var _0x5add34={},_0x18292b={},_0x1cc7f2={'count':0x0,'rows':[]};var _0x389747=_[_0xcbf4('0x2a')](db[_0xcbf4('0x2b')][_0xcbf4('0x2c')],function(_0x18de87){return{'name':_0x18de87[_0xcbf4('0x2d')],'type':_0x18de87[_0xcbf4('0x2e')][_0xcbf4('0x2f')]};});_0x18292b[_0xcbf4('0x30')]=_[_0xcbf4('0x31')](_['map'](_0x389747,_0xcbf4('0x28')),[_0xcbf4('0x32')]);_0x18292b[_0xcbf4('0x33')]=_[_0xcbf4('0x34')](_0x561d05[_0xcbf4('0x33')]);_0x18292b[_0xcbf4('0x35')]=_[_0xcbf4('0x36')](_0x18292b[_0xcbf4('0x30')],_0x18292b[_0xcbf4('0x33')]);_0x5add34[_0xcbf4('0x37')]=_[_0xcbf4('0x36')](_0x18292b[_0xcbf4('0x30')],qs[_0xcbf4('0x38')](_0x561d05['query'][_0xcbf4('0x38')]));_0x5add34[_0xcbf4('0x37')]=_0x5add34['attributes'][_0xcbf4('0x39')]?_0x5add34[_0xcbf4('0x37')]:_0x18292b[_0xcbf4('0x30')];if(!_0x561d05[_0xcbf4('0x33')]['hasOwnProperty']('nolimit')){_0x5add34[_0xcbf4('0x1e')]=qs['limit'](_0x561d05[_0xcbf4('0x33')]['limit']);_0x5add34[_0xcbf4('0x1d')]=qs['offset'](_0x561d05[_0xcbf4('0x33')][_0xcbf4('0x1d')]);}_0x5add34[_0xcbf4('0x3a')]=qs[_0xcbf4('0x3b')](_0x561d05[_0xcbf4('0x33')]['sort']);_0x5add34[_0xcbf4('0x3c')]=qs[_0xcbf4('0x35')](_[_0xcbf4('0x3d')](_0x561d05['query'],_0x18292b[_0xcbf4('0x35')]),_0x389747);if(_0x561d05['query'][_0xcbf4('0x3e')]){_0x5add34['where']=_['merge'](_0x5add34['where'],{'$or':_[_0xcbf4('0x2a')](_0x389747,function(_0x5c0b83){if(_0x5c0b83['type']!==_0xcbf4('0x3f')){var _0x3585eb={};_0x3585eb[_0x5c0b83[_0xcbf4('0x28')]]={'$like':'%'+_0x561d05['query']['filter']+'%'};return _0x3585eb;}})});}_0x5add34=_[_0xcbf4('0x40')]({},_0x5add34,_0x561d05['options']);var _0x25b4d8={'where':_0x5add34[_0xcbf4('0x3c')]};return db[_0xcbf4('0x2b')]['count'](_0x25b4d8)[_0xcbf4('0x25')](function(_0x68937a){_0x1cc7f2[_0xcbf4('0x1c')]=_0x68937a;if(_0x561d05[_0xcbf4('0x33')][_0xcbf4('0x41')]){_0x5add34[_0xcbf4('0x42')]=[{'all':!![]}];}return db[_0xcbf4('0x2b')][_0xcbf4('0x43')](_0x5add34);})[_0xcbf4('0x25')](function(_0x59f882){_0x1cc7f2[_0xcbf4('0x44')]=_0x59f882;return _0x1cc7f2;})[_0xcbf4('0x25')](respondWithFilteredResult(_0x47ad3b,_0x5add34))[_0xcbf4('0x45')](handleError(_0x47ad3b,null));};exports['show']=function(_0x53879d,_0x54b19b){var _0x4a4d3a={'raw':![],'where':{'id':_0x53879d[_0xcbf4('0x46')]['id']}},_0x9fb395={};_0x9fb395[_0xcbf4('0x30')]=_[_0xcbf4('0x34')](db[_0xcbf4('0x2b')]['rawAttributes']);_0x9fb395[_0xcbf4('0x33')]=_[_0xcbf4('0x34')](_0x53879d['query']);_0x9fb395[_0xcbf4('0x35')]=_[_0xcbf4('0x36')](_0x9fb395['model'],_0x9fb395['query']);_0x4a4d3a[_0xcbf4('0x37')]=_[_0xcbf4('0x36')](_0x9fb395[_0xcbf4('0x30')],qs[_0xcbf4('0x38')](_0x53879d[_0xcbf4('0x33')][_0xcbf4('0x38')]));_0x4a4d3a[_0xcbf4('0x37')]=_0x4a4d3a['attributes']['length']?_0x4a4d3a[_0xcbf4('0x37')]:_0x9fb395[_0xcbf4('0x30')];if(_0x53879d['query'][_0xcbf4('0x41')]){_0x4a4d3a['include']=[{'all':!![]}];}_0x4a4d3a=_[_0xcbf4('0x40')]({},_0x4a4d3a,_0x53879d[_0xcbf4('0x47')]);return db[_0xcbf4('0x2b')][_0xcbf4('0x48')](_0x4a4d3a)['then'](handleEntityNotFound(_0x54b19b,null))[_0xcbf4('0x25')](respondWithResult(_0x54b19b,null))[_0xcbf4('0x45')](handleError(_0x54b19b,null));};exports[_0xcbf4('0x49')]=function(_0x59b514,_0xffbf10){return db[_0xcbf4('0x2b')][_0xcbf4('0x49')](_0x59b514[_0xcbf4('0x4a')],{})['then'](respondWithResult(_0xffbf10,0xc9))[_0xcbf4('0x45')](handleError(_0xffbf10,null));};exports['update']=function(_0x10a5bd,_0x57d460){if(_0x10a5bd[_0xcbf4('0x4a')]['id']){delete _0x10a5bd[_0xcbf4('0x4a')]['id'];}return db[_0xcbf4('0x2b')][_0xcbf4('0x48')]({'where':{'id':_0x10a5bd[_0xcbf4('0x46')]['id']}})['then'](handleEntityNotFound(_0x57d460,null))[_0xcbf4('0x25')](saveUpdates(_0x10a5bd[_0xcbf4('0x4a')],null))[_0xcbf4('0x25')](respondWithResult(_0x57d460,null))[_0xcbf4('0x45')](handleError(_0x57d460,null));};exports[_0xcbf4('0x4b')]=function(_0x17107d,_0x4fb4ee){return db[_0xcbf4('0x2b')][_0xcbf4('0x4b')]()[_0xcbf4('0x25')](respondWithResult(_0x4fb4ee,null))[_0xcbf4('0x45')](handleError(_0x4fb4ee,null));};exports[_0xcbf4('0x4c')]=function(_0x24236e,_0x5d9220,_0x47f619){var _0xc4c60a=require(_0xcbf4('0x4d'));var _0x498f2f=![];var _0x31707a={};if(_0x24236e[_0xcbf4('0x33')][_0xcbf4('0x2e')]&&_0x24236e['query'][_0xcbf4('0x2e')]===_0xcbf4('0x4e')){_0x31707a['uniqueid']=_0x24236e[_0xcbf4('0x46')]['id'];}else{_0x31707a['id']=_0x24236e['params']['id'];}return db[_0xcbf4('0x2b')][_0xcbf4('0x48')]({'where':_0x31707a,'attributes':['id',_0xcbf4('0x4f')],'raw':!![]})[_0xcbf4('0x25')](handleEntityNotFound(_0x5d9220,null))[_0xcbf4('0x25')](function(_0x3660a9){if(_0x3660a9){var _0x5ab494=_0x3660a9['value'];var _0x27ca12=util[_0xcbf4('0x32')](_0xcbf4('0x50'),_0x5ab494);if(fs[_0xcbf4('0x51')](_0x27ca12)){_0x498f2f=!![];return _0xc4c60a[_0xcbf4('0x52')](_0x27ca12,_0x5ab494,config[_0xcbf4('0x53')]['recording'])[_0xcbf4('0x25')](function(){return _0x3660a9;});}return _0x3660a9;}})[_0xcbf4('0x25')](function(_0xc428e0){if(_0xc428e0){var _0x10da1b=_0xc428e0['value'];if(!fs[_0xcbf4('0x51')](_0x10da1b)){throw new db[(_0xcbf4('0x54'))][(_0xcbf4('0x55'))]('VoiceRecording\x20not\x20found');}if(_0xc428e0[_0xcbf4('0x56')]){return _0x5d9220[_0xcbf4('0x4c')](_0x10da1b,_0xc428e0['filename']+path[_0xcbf4('0x57')](_0x10da1b),function(){if(_0x498f2f){fs[_0xcbf4('0x58')](_0x10da1b);}});}else{return _0x5d9220[_0xcbf4('0x4c')](_0x10da1b,function(_0x54638a){if(_0x498f2f){fs['unlink'](_0x10da1b);}});}}})['catch'](function(_0x409549){if(_0x409549[_0xcbf4('0x59')]==='VoiceRecording\x20not\x20found'){_0x5d9220['status'](0x194)[_0xcbf4('0x29')]('Not\x20found');}else{return handleError(_0x5d9220,null);}});};exports[_0xcbf4('0x5a')]=function(_0x5885d6,_0x5d0d2f,_0x1525d7){var _0x388e36=require(_0xcbf4('0x4d'));var _0x37636a=![];var _0x3a95e2={'$and':[db[_0xcbf4('0x5b')][_0xcbf4('0x3c')](db[_0xcbf4('0x5b')]['fn']('MD5',db[_0xcbf4('0x5b')][_0xcbf4('0x5c')](_0xcbf4('0x4e'))),_0x5885d6[_0xcbf4('0x33')][_0xcbf4('0x5d')])]};if(_0x5885d6[_0xcbf4('0x33')][_0xcbf4('0x2e')]&&_0x5885d6[_0xcbf4('0x33')]['type']==='uniqueid'){_0x3a95e2[_0xcbf4('0x5e')][_0xcbf4('0x5f')]({'uniqueid':_0x5885d6[_0xcbf4('0x46')]['id']});}else{_0x3a95e2[_0xcbf4('0x5e')]['push']({'id':_0x5885d6[_0xcbf4('0x46')]['id']});}return db[_0xcbf4('0x2b')]['find']({'where':_0x3a95e2,'attributes':['id','value'],'raw':!![]})[_0xcbf4('0x25')](handleEntityNotFound(_0x5d0d2f,null))[_0xcbf4('0x25')](function(_0x107fcd){if(_0x107fcd){var _0x52797b=util['format'](_0xcbf4('0x50'),_0x107fcd[_0xcbf4('0x4f')]);if(fs[_0xcbf4('0x51')](_0x52797b)){_0x37636a=!![];return _0x388e36['decryptFile'](_0x52797b,_0x107fcd[_0xcbf4('0x4f')],config[_0xcbf4('0x53')][_0xcbf4('0x60')])['then'](function(){return _0x107fcd;});}return _0x107fcd;}})['then'](function(_0x595dd1){if(_0x595dd1){if(!fs[_0xcbf4('0x51')](_0x595dd1['value'])){throw new db[(_0xcbf4('0x54'))][(_0xcbf4('0x55'))](_0xcbf4('0x61'));}if(_0x595dd1[_0xcbf4('0x56')]){return _0x5d0d2f[_0xcbf4('0x4c')](_0x595dd1[_0xcbf4('0x4f')],_0x595dd1[_0xcbf4('0x56')]+path[_0xcbf4('0x57')](_0x595dd1[_0xcbf4('0x4f')]),function(){if(_0x37636a){fs[_0xcbf4('0x58')](_0x595dd1[_0xcbf4('0x4f')]);}});}else{return _0x5d0d2f[_0xcbf4('0x4c')](_0x595dd1[_0xcbf4('0x4f')],function(_0x206758){if(_0x37636a){fs['unlink'](_0x595dd1[_0xcbf4('0x4f')]);}});}}})['catch'](handleError(_0x5d0d2f,null));};exports[_0xcbf4('0x24')]=function(_0x4ddc87,_0x47f295){return db['VoiceRecording'][_0xcbf4('0x48')]({'where':{'id':_0x4ddc87[_0xcbf4('0x46')]['id']}})[_0xcbf4('0x25')](function(_0x395308){if(!_0x395308)throw new ReferenceError(_0xcbf4('0x62'));return _0x395308;})['then'](function(_0x5c2f83){var _0x37d0ff=_0x5c2f83[_0xcbf4('0x4f')];logger[_0xcbf4('0x63')](_0xcbf4('0x64'),_0x37d0ff);if(!_[_0xcbf4('0x65')](_0x5c2f83['value'])&&fs[_0xcbf4('0x51')](_0x37d0ff)){logger[_0xcbf4('0x63')](_0xcbf4('0x66')+_0x37d0ff+_0xcbf4('0x67'));fs['unlinkSync'](_0x37d0ff);}_0x37d0ff=_0x37d0ff+_0xcbf4('0x68');if(!_[_0xcbf4('0x65')](_0x5c2f83[_0xcbf4('0x4f')])&&fs[_0xcbf4('0x51')](_0x37d0ff)){logger[_0xcbf4('0x63')]('File:\x20\x22'+_0x37d0ff+_0xcbf4('0x67'));fs[_0xcbf4('0x69')](_0x37d0ff);}return _0x5c2f83;})['then'](function(_0x2d756d){if(!_0x2d756d)throw new InternalError();return _0x2d756d['destroy']();})[_0xcbf4('0x25')](function(){_0x47f295[_0xcbf4('0x19')](0xcc)[_0xcbf4('0x1a')]();})[_0xcbf4('0x45')](handleError(_0x47f295,null));};function getBucketslist(_0x21be4d,_0x2ce763,_0x40d6b8){return new Promise(function(_0x8d50a9,_0x56ca39){var _0x238b3e=new AWS['S3']({'accessKeyId':_0x2ce763,'secretAccessKey':_0x21be4d,'region':_0x40d6b8});_0x238b3e[_0xcbf4('0x6a')]({},function(_0x5b6f86,_0x570868){if(_0x5b6f86){return _0x56ca39(_0x5b6f86);}else{return _0x8d50a9(_0x570868);}});});}function createBucket(_0x42127c,_0x50e543,_0x30dae1,_0x22e0fb){return new Promise(function(_0x3f9eaa,_0x583334){var _0x463d55=new AWS['S3']({'accessKeyId':_0x50e543,'secretAccessKey':_0x42127c,'region':_0x30dae1});_0x463d55[_0xcbf4('0x6b')]({'Bucket':_0x22e0fb},function(_0x16ac30,_0x470384){if(_0x16ac30){return _0x583334(_0x16ac30);}else{return _0x3f9eaa(_0x470384);}});});}function uploadFile(_0x5e9f1b,_0x4f2673,_0xa4d101,_0x2d31be,_0x46ee12,_0x26be43){return new Promise(function(_0x44e450,_0x1ed488){var _0x360d00=new AWS['S3']({'accessKeyId':_0x4f2673,'secretAccessKey':_0x5e9f1b,'region':_0xa4d101});_0x360d00[_0xcbf4('0x6c')]({'Bucket':_0x2d31be,'Key':_0x46ee12,'Body':_0x26be43},function(_0xf50fd4,_0xdd68a3){if(_0xf50fd4){return _0x1ed488(_0xf50fd4);}else{return _0x44e450(_0xdd68a3);}});});}function startTranscribe(_0x52168e,_0x1ae7c6,_0x481cf1,_0x5bfb3f,_0x302eea,_0x20ee75){return new Promise(function(_0x2e5dee,_0x54cb52){var _0x468b96=new AWS[(_0xcbf4('0x6d'))]({'accessKeyId':_0x1ae7c6,'secretAccessKey':_0x52168e,'region':_0x481cf1});_0x468b96[_0xcbf4('0x6e')]({'TranscriptionJobName':_0x5bfb3f,'LanguageCode':_0x302eea,'Media':{'MediaFileUri':_0x20ee75}},function(_0x15876b,_0x6b8239){if(_0x15876b){return _0x54cb52(_0x15876b);}else{return _0x2e5dee(_0x6b8239);}});});}function transcribe(_0x4c9d31,_0x20e034,_0x591b51,_0x2d9d1f,_0x545a1c,_0x50c39c,_0x20d315){return new Promise(function(_0x4b557a,_0x122be3){var _0xe14235={};logger[_0xcbf4('0x63')](util[_0xcbf4('0x32')](_0xcbf4('0x6f'),_0x4c9d31,_0x545a1c));return uploadFile(_0x20e034,_0x591b51,_0x2d9d1f,_0x545a1c,path['basename'](_0x50c39c),fs[_0xcbf4('0x70')](_0x50c39c))['then'](function(_0x156f7c){logger[_0xcbf4('0x63')](util[_0xcbf4('0x32')](_0xcbf4('0x71'),_0x4c9d31,_0x545a1c,_0x156f7c[_0xcbf4('0x72')]));_0xe14235[_0xcbf4('0x73')]=_0x156f7c[_0xcbf4('0x74')];_0xe14235[_0xcbf4('0x75')]=_0x156f7c[_0xcbf4('0x72')];logger[_0xcbf4('0x63')](util[_0xcbf4('0x32')](_0xcbf4('0x76'),_0x4c9d31));return startTranscribe(_0x20e034,_0x591b51,_0x2d9d1f,uuidv4(),_0x20d315,_0x156f7c[_0xcbf4('0x72')]);})[_0xcbf4('0x25')](function(_0x42dc64){logger[_0xcbf4('0x63')](util[_0xcbf4('0x32')](_0xcbf4('0x77'),_0x4c9d31,_0x42dc64[_0xcbf4('0x78')][_0xcbf4('0x79')]));_0xe14235[_0xcbf4('0x7a')]=_0x42dc64[_0xcbf4('0x78')][_0xcbf4('0x79')];_0xe14235['transcribeStatus']=_0x42dc64[_0xcbf4('0x78')]['TranscriptionJobStatus'];return _0x4b557a(_0xe14235);})[_0xcbf4('0x45')](function(_0x32c2ea){return _0x122be3(_0x32c2ea);});});}exports[_0xcbf4('0x7b')]=function(_0xb9a7a2,_0x55f7fb,_0x309c60){var _0x197351;var _0x3fd6b7;var _0x52b8fd;var _0x5249fd=require('../../components/encryptor');return db[_0xcbf4('0x2b')][_0xcbf4('0x7c')]({'where':{'id':_0xb9a7a2['params']['id']}})[_0xcbf4('0x25')](function(_0x228af4){if(_0x228af4){var _0xcc5c1d=util['format'](_0xcbf4('0x50'),_0x228af4[_0xcbf4('0x4f')]);if(fs[_0xcbf4('0x51')](_0xcc5c1d)){cypher=!![];return _0x5249fd[_0xcbf4('0x52')](_0xcc5c1d,_0x228af4[_0xcbf4('0x4f')],config[_0xcbf4('0x53')][_0xcbf4('0x60')])['then'](function(){return _0x228af4;});}return _0x228af4;}})['then'](function(_0x19fd3b){if(!_0x19fd3b){throw new db[(_0xcbf4('0x54'))][(_0xcbf4('0x55'))](_0xcbf4('0x7d'));}_0x3fd6b7=_0x19fd3b;return db[_0xcbf4('0x7e')][_0xcbf4('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x55f7fb,null))[_0xcbf4('0x25')](function(_0x46e599){if(_0x46e599){_0x197351=_0x46e599;if(!_0x197351[_0xcbf4('0x7f')]||!_0x197351[_0xcbf4('0x80')]||!_0x197351['transcribeRegion']||!_0x197351['language']||!_0x197351[_0xcbf4('0x73')]){throw new db[(_0xcbf4('0x54'))][(_0xcbf4('0x55'))](_0xcbf4('0x81'));}if(_0xb9a7a2[_0xcbf4('0x4a')]['runSentiment']&&(!_0x197351['sentiment']||!_0x197351[_0xcbf4('0x82')]||!_0x197351[_0xcbf4('0x83')]||!_0x197351[_0xcbf4('0x84')]||!_0x197351['bucket'])){throw new db[(_0xcbf4('0x54'))][(_0xcbf4('0x55'))](_0xcbf4('0x85'));}return db[_0xcbf4('0x86')][_0xcbf4('0x7c')]({'where':{'id':_0x197351[_0xcbf4('0x80')]}});}})[_0xcbf4('0x25')](function(_0x17d69e){if(!_0x17d69e){throw new db[(_0xcbf4('0x54'))][(_0xcbf4('0x55'))](_0xcbf4('0x87'));}if(!_0x17d69e['data1']||!_0x17d69e[_0xcbf4('0x88')]){throw new db[(_0xcbf4('0x54'))][(_0xcbf4('0x55'))](_0xcbf4('0x89'));}_0x52b8fd=_0x17d69e;return getBucketslist(_0x52b8fd[_0xcbf4('0x8a')],_0x52b8fd['data2'],_0x197351[_0xcbf4('0x8b')]);})[_0xcbf4('0x25')](function(_0x34fd3e){if(_0x34fd3e&&_0x34fd3e['Buckets']){var _0x2f92b5=_[_0xcbf4('0x48')](_0x34fd3e[_0xcbf4('0x8c')],function(_0x4cec2c){return _0x4cec2c[_0xcbf4('0x8d')]===_0x197351[_0xcbf4('0x73')];});if(!_0x2f92b5){logger[_0xcbf4('0x63')](util[_0xcbf4('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xb9a7a2[_0xcbf4('0x46')]['id'],_0x197351[_0xcbf4('0x73')]));return createBucket(_0x52b8fd['data1'],_0x52b8fd[_0xcbf4('0x88')],_0x197351['transcribeRegion'],_0x197351[_0xcbf4('0x73')]);}logger[_0xcbf4('0x63')](util['format'](_0xcbf4('0x8e'),_0xb9a7a2['params']['id'],_0x197351[_0xcbf4('0x73')]));return;}})[_0xcbf4('0x25')](function(_0x102822){if(_0x3fd6b7[_0xcbf4('0x8f')]===_0xcbf4('0x90')){return transcribe(_0xb9a7a2['params']['id'],_0x52b8fd[_0xcbf4('0x8a')],_0x52b8fd[_0xcbf4('0x88')],_0x197351[_0xcbf4('0x8b')],_0x197351['bucket'],_0x3fd6b7[_0xcbf4('0x4f')],_0x197351[_0xcbf4('0x84')]);}else{logger[_0xcbf4('0x63')](util['format'](_0xcbf4('0x91'),_0xb9a7a2[_0xcbf4('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xcbf4('0x25')](function(_0x17f196){if(_0x17f196){_0x17f196[_0xcbf4('0x92')]=_0xb9a7a2[_0xcbf4('0x4a')]['runSentiment'];return _0x3fd6b7[_0xcbf4('0x93')](_0x17f196);}})[_0xcbf4('0x25')](respondWithResult(_0x55f7fb,null))[_0xcbf4('0x45')](handleError(_0x55f7fb,null));};function writeFile(_0x1bcd7d,_0x13e563){return new Promise(function(_0x4f1c04,_0x3632c4){fs[_0xcbf4('0x94')](_0x13e563,_0x1bcd7d,function(_0x247072,_0x220542){if(_0x247072){return _0x3632c4(_0x247072);}else{return _0x4f1c04(_0x220542);}});});}exports[_0xcbf4('0x95')]=function(_0x46d1e8,_0x3a930e,_0x541e7a){return db[_0xcbf4('0x2b')][_0xcbf4('0x7c')]({'where':{'id':_0x46d1e8[_0xcbf4('0x46')]['id']}})[_0xcbf4('0x25')](handleEntityNotFound(_0x3a930e))[_0xcbf4('0x25')](function(_0x2cce43){if(_0x2cce43&&_0x2cce43['fileText']){var _0xc48f0b=_0x2cce43[_0xcbf4('0x96')];var _0x878564=config['root']+_0xcbf4('0x97')+_0x2cce43['id']+_0xcbf4('0x98');if(fs[_0xcbf4('0x51')](_0x878564)){return _0x878564;}return writeFile(_0xc48f0b,_0x878564)['then'](function(){return _0x878564;});}else{throw new db[(_0xcbf4('0x54'))][(_0xcbf4('0x55'))](_0xcbf4('0x99'));}})[_0xcbf4('0x25')](function(_0x2c0519){return _0x3a930e[_0xcbf4('0x4c')](_0x2c0519);})[_0xcbf4('0x45')](handleError(_0x3a930e));}; \ No newline at end of file +var _0x3300=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','col','token','$and','push','find','format','decryptFile','ValidationError','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path'];(function(_0x217652,_0x30f44d){var _0x4f03a1=function(_0x23a62a){while(--_0x23a62a){_0x217652['push'](_0x217652['shift']());}};_0x4f03a1(++_0x30f44d);}(_0x3300,0x1c4));var _0x0330=function(_0x55d76f,_0x3ec4e8){_0x55d76f=_0x55d76f-0x0;var _0x27f726=_0x3300[_0x55d76f];return _0x27f726;};'use strict';var emlformat=require(_0x0330('0x0'));var rimraf=require(_0x0330('0x1'));var zipdir=require(_0x0330('0x2'));var jsonpatch=require(_0x0330('0x3'));var rp=require('request-promise');var moment=require(_0x0330('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0330('0x5'));var util=require('util');var path=require(_0x0330('0x6'));var sox=require(_0x0330('0x7'));var csv=require(_0x0330('0x8'));var ejs=require(_0x0330('0x9'));var fs=require('fs');var fs_extra=require(_0x0330('0xa'));var _=require(_0x0330('0xb'));var squel=require(_0x0330('0xc'));var crypto=require(_0x0330('0xd'));var jsforce=require(_0x0330('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0330('0xf'));var Papa=require(_0x0330('0x10'));var AWS=require(_0x0330('0x11'));var uuidv4=require(_0x0330('0x12'));var Redis=require(_0x0330('0x13'));var authService=require(_0x0330('0x14'));var qs=require(_0x0330('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0330('0x16'));var logger=require(_0x0330('0x17'))(_0x0330('0x18'));var utils=require('../../config/utils');var config=require(_0x0330('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0330('0x1a'))['db'];function respondWithStatusCode(_0x8e7ae0,_0x6cfaa3){_0x6cfaa3=_0x6cfaa3||0xcc;return function(_0x29e1ff){if(_0x29e1ff){return _0x8e7ae0[_0x0330('0x1b')](_0x6cfaa3);}return _0x8e7ae0[_0x0330('0x1c')](_0x6cfaa3)[_0x0330('0x1d')]();};}function respondWithResult(_0x3680a2,_0x55079e){_0x55079e=_0x55079e||0xc8;return function(_0x2f3b2d){if(_0x2f3b2d){return _0x3680a2[_0x0330('0x1c')](_0x55079e)[_0x0330('0x1e')](_0x2f3b2d);}};}function respondWithFilteredResult(_0x32df4d,_0x56b12a){return function(_0x295df5){if(_0x295df5){var _0x25a57b=_0x295df5[_0x0330('0x1f')],_0x40ab76=_0x56b12a[_0x0330('0x20')],_0x5e90ec=_0x56b12a[_0x0330('0x20')]+_0x56b12a[_0x0330('0x21')],_0x28bb2e;if(_0x5e90ec>=_0x25a57b){_0x5e90ec=_0x25a57b;_0x28bb2e=0xc8;}else{_0x28bb2e=0xce;}_0x32df4d[_0x0330('0x1c')](_0x28bb2e);return _0x32df4d[_0x0330('0x22')](_0x0330('0x23'),_0x40ab76+'-'+_0x5e90ec+'/'+_0x25a57b)[_0x0330('0x1e')](_0x295df5);}return null;};}function patchUpdates(_0x244ef1){return function(_0x1a1055){try{jsonpatch[_0x0330('0x24')](_0x1a1055,_0x244ef1,!![]);}catch(_0x35b7ec){return BPromise[_0x0330('0x25')](_0x35b7ec);}return _0x1a1055[_0x0330('0x26')]();};}function saveUpdates(_0x4b0ebe,_0x4106b0){return function(_0x552174){if(_0x552174){return _0x552174[_0x0330('0x27')](_0x4b0ebe)[_0x0330('0x28')](function(_0x3e706f){return _0x3e706f;});}return null;};}function removeEntity(_0x34c737,_0x883789){return function(_0x159bbd){if(_0x159bbd){return _0x159bbd[_0x0330('0x29')]()[_0x0330('0x28')](function(){_0x34c737['status'](0xcc)[_0x0330('0x1d')]();});}};}function handleEntityNotFound(_0x53b105,_0x3bf6c1){return function(_0x2ba29f){if(!_0x2ba29f){_0x53b105[_0x0330('0x1b')](0x194);}return _0x2ba29f;};}function handleError(_0x4b304e,_0x5b6238){_0x5b6238=_0x5b6238||0x1f4;return function(_0x4fcf18){logger['error'](_0x4fcf18['stack']);if(_0x4fcf18[_0x0330('0x2a')]){delete _0x4fcf18[_0x0330('0x2a')];}_0x4b304e[_0x0330('0x1c')](_0x5b6238)[_0x0330('0x2b')](_0x4fcf18);};}exports[_0x0330('0x2c')]=function(_0xc44600,_0xf0f742){var _0x3c1395={},_0xf32343={},_0xcf538a={'count':0x0,'rows':[]};var _0x1e65b7=_[_0x0330('0x2d')](db[_0x0330('0x2e')][_0x0330('0x2f')],function(_0x41baf8){return{'name':_0x41baf8[_0x0330('0x30')],'type':_0x41baf8['type'][_0x0330('0x31')]};});_0xf32343[_0x0330('0x32')]=_[_0x0330('0x33')](_[_0x0330('0x2d')](_0x1e65b7,_0x0330('0x2a')),['format']);_0xf32343[_0x0330('0x34')]=_[_0x0330('0x35')](_0xc44600[_0x0330('0x34')]);_0xf32343['filters']=_[_0x0330('0x36')](_0xf32343['model'],_0xf32343['query']);_0x3c1395[_0x0330('0x37')]=_[_0x0330('0x36')](_0xf32343[_0x0330('0x32')],qs[_0x0330('0x38')](_0xc44600['query'][_0x0330('0x38')]));_0x3c1395[_0x0330('0x37')]=_0x3c1395['attributes'][_0x0330('0x39')]?_0x3c1395['attributes']:_0xf32343[_0x0330('0x32')];if(!_0xc44600[_0x0330('0x34')][_0x0330('0x3a')]('nolimit')){_0x3c1395['limit']=qs[_0x0330('0x21')](_0xc44600[_0x0330('0x34')][_0x0330('0x21')]);_0x3c1395['offset']=qs[_0x0330('0x20')](_0xc44600[_0x0330('0x34')][_0x0330('0x20')]);}_0x3c1395[_0x0330('0x3b')]=qs[_0x0330('0x3c')](_0xc44600[_0x0330('0x34')]['sort']);_0x3c1395[_0x0330('0x3d')]=qs[_0x0330('0x3e')](_[_0x0330('0x3f')](_0xc44600[_0x0330('0x34')],_0xf32343[_0x0330('0x3e')]),_0x1e65b7);if(_0xc44600[_0x0330('0x34')]['filter']){_0x3c1395[_0x0330('0x3d')]=_[_0x0330('0x40')](_0x3c1395[_0x0330('0x3d')],{'$or':_[_0x0330('0x2d')](_0x1e65b7,function(_0x5abd32){if(_0x5abd32[_0x0330('0x41')]!==_0x0330('0x42')){var _0x2c17c2={};_0x2c17c2[_0x5abd32[_0x0330('0x2a')]]={'$like':'%'+_0xc44600[_0x0330('0x34')][_0x0330('0x43')]+'%'};return _0x2c17c2;}})});}_0x3c1395=_['merge']({},_0x3c1395,_0xc44600[_0x0330('0x44')]);var _0x2d9a61={'where':_0x3c1395[_0x0330('0x3d')]};return db[_0x0330('0x2e')]['count'](_0x2d9a61)[_0x0330('0x28')](function(_0x17b7a1){_0xcf538a['count']=_0x17b7a1;if(_0xc44600[_0x0330('0x34')][_0x0330('0x45')]){_0x3c1395['include']=[{'all':!![]}];}return db[_0x0330('0x2e')][_0x0330('0x46')](_0x3c1395);})['then'](function(_0x8f00e2){_0xcf538a[_0x0330('0x47')]=_0x8f00e2;return _0xcf538a;})['then'](respondWithFilteredResult(_0xf0f742,_0x3c1395))[_0x0330('0x48')](handleError(_0xf0f742,null));};exports[_0x0330('0x49')]=function(_0x4497cd,_0x5c1bf3){var _0x54af58={'raw':![],'where':{'id':_0x4497cd[_0x0330('0x4a')]['id']}},_0x2f960d={};_0x2f960d[_0x0330('0x32')]=_[_0x0330('0x35')](db['VoiceRecording'][_0x0330('0x2f')]);_0x2f960d['query']=_['keys'](_0x4497cd[_0x0330('0x34')]);_0x2f960d[_0x0330('0x3e')]=_['intersection'](_0x2f960d[_0x0330('0x32')],_0x2f960d[_0x0330('0x34')]);_0x54af58[_0x0330('0x37')]=_[_0x0330('0x36')](_0x2f960d[_0x0330('0x32')],qs[_0x0330('0x38')](_0x4497cd[_0x0330('0x34')][_0x0330('0x38')]));_0x54af58['attributes']=_0x54af58[_0x0330('0x37')][_0x0330('0x39')]?_0x54af58[_0x0330('0x37')]:_0x2f960d[_0x0330('0x32')];if(_0x4497cd['query']['includeAll']){_0x54af58[_0x0330('0x4b')]=[{'all':!![]}];}_0x54af58=_[_0x0330('0x40')]({},_0x54af58,_0x4497cd[_0x0330('0x44')]);return db['VoiceRecording']['find'](_0x54af58)['then'](handleEntityNotFound(_0x5c1bf3,null))['then'](respondWithResult(_0x5c1bf3,null))[_0x0330('0x48')](handleError(_0x5c1bf3,null));};exports[_0x0330('0x4c')]=function(_0x1245ca,_0x370b00){return db[_0x0330('0x2e')][_0x0330('0x4c')](_0x1245ca[_0x0330('0x4d')],{})['then'](respondWithResult(_0x370b00,0xc9))[_0x0330('0x48')](handleError(_0x370b00,null));};exports[_0x0330('0x27')]=function(_0x171213,_0x2abc6a){if(_0x171213['body']['id']){delete _0x171213['body']['id'];}return db[_0x0330('0x2e')]['find']({'where':{'id':_0x171213['params']['id']}})[_0x0330('0x28')](handleEntityNotFound(_0x2abc6a,null))[_0x0330('0x28')](saveUpdates(_0x171213[_0x0330('0x4d')],null))[_0x0330('0x28')](respondWithResult(_0x2abc6a,null))[_0x0330('0x48')](handleError(_0x2abc6a,null));};exports[_0x0330('0x4e')]=function(_0x1165cb,_0x598c5e){return db[_0x0330('0x2e')][_0x0330('0x4e')]()['then'](respondWithResult(_0x598c5e,null))['catch'](handleError(_0x598c5e,null));};exports[_0x0330('0x4f')]=function(_0x5cc033,_0x305170,_0x90081a){var _0x5f39b2=require(_0x0330('0x50'));var _0x3cc1a4=![];var _0x45f5d3={};if(_0x5cc033[_0x0330('0x34')][_0x0330('0x41')]&&_0x5cc033['query']['type']===_0x0330('0x51')){_0x45f5d3['uniqueid']=_0x5cc033[_0x0330('0x4a')]['id'];}else{_0x45f5d3['id']=_0x5cc033[_0x0330('0x4a')]['id'];}return db['VoiceRecording']['find']({'where':_0x45f5d3,'attributes':['id',_0x0330('0x52')],'raw':!![]})[_0x0330('0x28')](handleEntityNotFound(_0x305170,null))[_0x0330('0x28')](function(_0x26f5cd){if(_0x26f5cd){var _0x5034b5=_0x26f5cd['value'];var _0x48337f=util['format'](_0x0330('0x53'),_0x5034b5);if(fs[_0x0330('0x54')](_0x48337f)){_0x3cc1a4=!![];return _0x5f39b2['decryptFile'](_0x48337f,_0x5034b5,config[_0x0330('0x55')][_0x0330('0x56')])['then'](function(){return _0x26f5cd;});}return _0x26f5cd;}})[_0x0330('0x28')](function(_0x2b3f7c){if(_0x2b3f7c){var _0x3a7fff=_0x2b3f7c[_0x0330('0x52')];if(!fs['existsSync'](_0x3a7fff)){throw new db[(_0x0330('0x57'))]['ValidationError'](_0x0330('0x58'));}if(_0x2b3f7c['filename']){return _0x305170[_0x0330('0x4f')](_0x3a7fff,_0x2b3f7c[_0x0330('0x59')]+path[_0x0330('0x5a')](_0x3a7fff),function(){if(_0x3cc1a4){fs['unlink'](_0x3a7fff);}});}else{return _0x305170[_0x0330('0x4f')](_0x3a7fff,function(_0x569c41){if(_0x3cc1a4){fs[_0x0330('0x5b')](_0x3a7fff);}});}}})[_0x0330('0x48')](function(_0xf17374){if(_0xf17374[_0x0330('0x5c')]===_0x0330('0x58')){_0x305170[_0x0330('0x1c')](0x194)['send'](_0x0330('0x5d'));}else{return handleError(_0x305170,null);}});};exports['downloads']=function(_0x3434d6,_0xd41453,_0x9b7e0a){var _0x5ba4b3=require('../../components/encryptor');var _0x239531=![];var _0x27a44e={'$and':[db[_0x0330('0x5e')][_0x0330('0x3d')](db[_0x0330('0x5e')]['fn']('MD5',db[_0x0330('0x5e')][_0x0330('0x5f')](_0x0330('0x51'))),_0x3434d6[_0x0330('0x34')][_0x0330('0x60')])]};if(_0x3434d6[_0x0330('0x34')]['type']&&_0x3434d6[_0x0330('0x34')][_0x0330('0x41')]===_0x0330('0x51')){_0x27a44e[_0x0330('0x61')][_0x0330('0x62')]({'uniqueid':_0x3434d6[_0x0330('0x4a')]['id']});}else{_0x27a44e[_0x0330('0x61')][_0x0330('0x62')]({'id':_0x3434d6[_0x0330('0x4a')]['id']});}return db[_0x0330('0x2e')][_0x0330('0x63')]({'where':_0x27a44e,'attributes':['id','value'],'raw':!![]})[_0x0330('0x28')](handleEntityNotFound(_0xd41453,null))[_0x0330('0x28')](function(_0x4b2aa){if(_0x4b2aa){var _0x5be870=util[_0x0330('0x64')](_0x0330('0x53'),_0x4b2aa[_0x0330('0x52')]);if(fs['existsSync'](_0x5be870)){_0x239531=!![];return _0x5ba4b3[_0x0330('0x65')](_0x5be870,_0x4b2aa[_0x0330('0x52')],config['secrets']['recording'])[_0x0330('0x28')](function(){return _0x4b2aa;});}return _0x4b2aa;}})['then'](function(_0x1ea30e){if(_0x1ea30e){if(!fs[_0x0330('0x54')](_0x1ea30e[_0x0330('0x52')])){throw new db[(_0x0330('0x57'))][(_0x0330('0x66'))]('VoiceRecording\x20not\x20found');}if(_0x1ea30e[_0x0330('0x59')]){return _0xd41453[_0x0330('0x4f')](_0x1ea30e[_0x0330('0x52')],_0x1ea30e[_0x0330('0x59')]+path[_0x0330('0x5a')](_0x1ea30e[_0x0330('0x52')]),function(){if(_0x239531){fs[_0x0330('0x5b')](_0x1ea30e[_0x0330('0x52')]);}});}else{return _0xd41453[_0x0330('0x4f')](_0x1ea30e['value'],function(_0x4b426c){if(_0x239531){fs[_0x0330('0x5b')](_0x1ea30e['value']);}});}}})[_0x0330('0x48')](handleError(_0xd41453,null));};exports[_0x0330('0x29')]=function(_0x2d8dd7,_0x780957){return db[_0x0330('0x2e')][_0x0330('0x63')]({'where':{'id':_0x2d8dd7['params']['id']}})['then'](function(_0x3ea3d1){if(!_0x3ea3d1)throw new ReferenceError(_0x0330('0x67'));return _0x3ea3d1;})['then'](function(_0x2b6c4a){var _0x275daa=_0x2b6c4a[_0x0330('0x52')];logger[_0x0330('0x68')](_0x0330('0x69'),_0x275daa);if(!_[_0x0330('0x6a')](_0x2b6c4a[_0x0330('0x52')])&&fs[_0x0330('0x54')](_0x275daa)){logger[_0x0330('0x68')](_0x0330('0x6b')+_0x275daa+_0x0330('0x6c'));fs['unlinkSync'](_0x275daa);}_0x275daa=_0x275daa+_0x0330('0x6d');if(!_[_0x0330('0x6a')](_0x2b6c4a[_0x0330('0x52')])&&fs[_0x0330('0x54')](_0x275daa)){logger[_0x0330('0x68')](_0x0330('0x6b')+_0x275daa+_0x0330('0x6c'));fs[_0x0330('0x6e')](_0x275daa);}return _0x2b6c4a;})[_0x0330('0x28')](function(_0x3d1e36){if(!_0x3d1e36)throw new InternalError();return _0x3d1e36[_0x0330('0x29')]();})[_0x0330('0x28')](function(){_0x780957['status'](0xcc)['end']();})[_0x0330('0x48')](handleError(_0x780957,null));};function getBucketslist(_0x1f23d8,_0x164439,_0x2a0d20){return new Promise(function(_0x1f6de6,_0x39a446){var _0x32d071=new AWS['S3']({'accessKeyId':_0x164439,'secretAccessKey':_0x1f23d8,'region':_0x2a0d20});_0x32d071[_0x0330('0x6f')]({},function(_0x587594,_0x198e76){if(_0x587594){return _0x39a446(_0x587594);}else{return _0x1f6de6(_0x198e76);}});});}function createBucket(_0x2a71c0,_0x9fcdf9,_0x4e3967,_0x4c18ad){return new Promise(function(_0x184d19,_0x13cd64){var _0x4b0868=new AWS['S3']({'accessKeyId':_0x9fcdf9,'secretAccessKey':_0x2a71c0,'region':_0x4e3967});_0x4b0868[_0x0330('0x70')]({'Bucket':_0x4c18ad},function(_0x50975f,_0x31180e){if(_0x50975f){return _0x13cd64(_0x50975f);}else{return _0x184d19(_0x31180e);}});});}function uploadFile(_0x673351,_0x1960dd,_0x4408dd,_0x141599,_0x151cb5,_0x5ee4e7){return new Promise(function(_0x208752,_0x3eb468){var _0x525cd7=new AWS['S3']({'accessKeyId':_0x1960dd,'secretAccessKey':_0x673351,'region':_0x4408dd});_0x525cd7[_0x0330('0x71')]({'Bucket':_0x141599,'Key':_0x151cb5,'Body':_0x5ee4e7},function(_0x4d0cd6,_0x2440bb){if(_0x4d0cd6){return _0x3eb468(_0x4d0cd6);}else{return _0x208752(_0x2440bb);}});});}function startTranscribe(_0x54aa39,_0xe60f87,_0x40a4b0,_0x3e7f24,_0x5c10d6,_0x2995c9){return new Promise(function(_0x3155f4,_0x1a19f1){var _0x509298=new AWS[(_0x0330('0x72'))]({'accessKeyId':_0xe60f87,'secretAccessKey':_0x54aa39,'region':_0x40a4b0});_0x509298['startTranscriptionJob']({'TranscriptionJobName':_0x3e7f24,'LanguageCode':_0x5c10d6,'Media':{'MediaFileUri':_0x2995c9}},function(_0x356a8c,_0x5d619e){if(_0x356a8c){return _0x1a19f1(_0x356a8c);}else{return _0x3155f4(_0x5d619e);}});});}function transcribe(_0x373d0a,_0x493481,_0x3d2372,_0x472671,_0x21948a,_0x23efb0,_0x318787){return new Promise(function(_0x5343fb,_0x59b965){var _0x165306={};logger[_0x0330('0x68')](util[_0x0330('0x64')](_0x0330('0x73'),_0x373d0a,_0x21948a));return uploadFile(_0x493481,_0x3d2372,_0x472671,_0x21948a,path['basename'](_0x23efb0),fs[_0x0330('0x74')](_0x23efb0))[_0x0330('0x28')](function(_0x424462){logger[_0x0330('0x68')](util[_0x0330('0x64')](_0x0330('0x75'),_0x373d0a,_0x21948a,_0x424462[_0x0330('0x76')]));_0x165306['bucket']=_0x424462[_0x0330('0x77')];_0x165306[_0x0330('0x78')]=_0x424462[_0x0330('0x76')];logger[_0x0330('0x68')](util[_0x0330('0x64')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x373d0a));return startTranscribe(_0x493481,_0x3d2372,_0x472671,uuidv4(),_0x318787,_0x424462[_0x0330('0x76')]);})[_0x0330('0x28')](function(_0x291846){logger[_0x0330('0x68')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x373d0a,_0x291846['TranscriptionJob'][_0x0330('0x79')]));_0x165306['transcribeName']=_0x291846[_0x0330('0x7a')]['TranscriptionJobName'];_0x165306[_0x0330('0x7b')]=_0x291846[_0x0330('0x7a')][_0x0330('0x7c')];return _0x5343fb(_0x165306);})[_0x0330('0x48')](function(_0x17fff8){return _0x59b965(_0x17fff8);});});}exports['runTranscribe']=function(_0x284e08,_0x166d7b,_0x2f19ca){var _0x15e775;var _0x3572b3;var _0x599329;var _0x263f1c=require(_0x0330('0x50'));return db[_0x0330('0x2e')][_0x0330('0x7d')]({'where':{'id':_0x284e08[_0x0330('0x4a')]['id']}})['then'](function(_0x40c64e){if(_0x40c64e){var _0x5edba1=util[_0x0330('0x64')]('%s.cypher',_0x40c64e[_0x0330('0x52')]);if(fs[_0x0330('0x54')](_0x5edba1)){cypher=!![];return _0x263f1c[_0x0330('0x65')](_0x5edba1,_0x40c64e[_0x0330('0x52')],config[_0x0330('0x55')][_0x0330('0x56')])[_0x0330('0x28')](function(){return _0x40c64e;});}return _0x40c64e;}})[_0x0330('0x28')](function(_0x51a730){if(!_0x51a730){throw new db['Sequelize']['ValidationError'](_0x0330('0x7e'));}_0x3572b3=_0x51a730;return db[_0x0330('0x7f')][_0x0330('0x7d')]({'where':{'id':0x1}});})[_0x0330('0x28')](handleEntityNotFound(_0x166d7b,null))[_0x0330('0x28')](function(_0x3a1f27){if(_0x3a1f27){_0x15e775=_0x3a1f27;if(!_0x15e775[_0x0330('0x80')]||!_0x15e775[_0x0330('0x81')]||!_0x15e775[_0x0330('0x82')]||!_0x15e775[_0x0330('0x83')]||!_0x15e775[_0x0330('0x84')]){throw new db['Sequelize']['ValidationError'](_0x0330('0x85'));}if(_0x284e08[_0x0330('0x4d')]['runSentiment']&&(!_0x15e775[_0x0330('0x86')]||!_0x15e775[_0x0330('0x87')]||!_0x15e775['sentimentRegion']||!_0x15e775[_0x0330('0x83')]||!_0x15e775['bucket'])){throw new db['Sequelize'][(_0x0330('0x66'))](_0x0330('0x88'));}return db['CloudProvider'][_0x0330('0x7d')]({'where':{'id':_0x15e775[_0x0330('0x81')]}});}})[_0x0330('0x28')](function(_0x220f2f){if(!_0x220f2f){throw new db[(_0x0330('0x57'))][(_0x0330('0x66'))](_0x0330('0x89'));}if(!_0x220f2f[_0x0330('0x8a')]||!_0x220f2f[_0x0330('0x8b')]){throw new db[(_0x0330('0x57'))][(_0x0330('0x66'))]('Cloud\x20Provider\x20not\x20configured');}_0x599329=_0x220f2f;return getBucketslist(_0x599329[_0x0330('0x8a')],_0x599329[_0x0330('0x8b')],_0x15e775[_0x0330('0x82')]);})[_0x0330('0x28')](function(_0x23403d){if(_0x23403d&&_0x23403d[_0x0330('0x8c')]){var _0x354931=_[_0x0330('0x63')](_0x23403d[_0x0330('0x8c')],function(_0x52479d){return _0x52479d[_0x0330('0x8d')]===_0x15e775[_0x0330('0x84')];});if(!_0x354931){logger['info'](util[_0x0330('0x64')](_0x0330('0x8e'),_0x284e08['params']['id'],_0x15e775[_0x0330('0x84')]));return createBucket(_0x599329[_0x0330('0x8a')],_0x599329[_0x0330('0x8b')],_0x15e775[_0x0330('0x82')],_0x15e775[_0x0330('0x84')]);}logger[_0x0330('0x68')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x284e08[_0x0330('0x4a')]['id'],_0x15e775[_0x0330('0x84')]));return;}})[_0x0330('0x28')](function(_0x42e724){if(_0x3572b3[_0x0330('0x7b')]===_0x0330('0x8f')){return transcribe(_0x284e08[_0x0330('0x4a')]['id'],_0x599329[_0x0330('0x8a')],_0x599329[_0x0330('0x8b')],_0x15e775['transcribeRegion'],_0x15e775[_0x0330('0x84')],_0x3572b3[_0x0330('0x52')],_0x15e775[_0x0330('0x83')]);}else{logger[_0x0330('0x68')](util[_0x0330('0x64')](_0x0330('0x90'),_0x284e08[_0x0330('0x4a')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x0330('0x28')](function(_0x8847aa){if(_0x8847aa){_0x8847aa[_0x0330('0x91')]=_0x284e08[_0x0330('0x4d')][_0x0330('0x92')];return _0x3572b3['updateAttributes'](_0x8847aa);}})[_0x0330('0x28')](respondWithResult(_0x166d7b,null))[_0x0330('0x48')](handleError(_0x166d7b,null));};function writeFile(_0x2f68b1,_0x1074d1){return new Promise(function(_0x4659dd,_0x201713){fs[_0x0330('0x93')](_0x1074d1,_0x2f68b1,function(_0x48d57e,_0x87bf94){if(_0x48d57e){return _0x201713(_0x48d57e);}else{return _0x4659dd(_0x87bf94);}});});}exports[_0x0330('0x94')]=function(_0x5acae3,_0x215ec6,_0x148e3e){return db[_0x0330('0x2e')][_0x0330('0x7d')]({'where':{'id':_0x5acae3['params']['id']}})[_0x0330('0x28')](handleEntityNotFound(_0x215ec6))[_0x0330('0x28')](function(_0x38a3d8){if(_0x38a3d8&&_0x38a3d8[_0x0330('0x95')]){var _0x1d3aa9=_0x38a3d8[_0x0330('0x95')];var _0x3494a5=config[_0x0330('0x96')]+_0x0330('0x97')+_0x38a3d8['id']+'.txt';if(fs['existsSync'](_0x3494a5)){return _0x3494a5;}return writeFile(_0x1d3aa9,_0x3494a5)[_0x0330('0x28')](function(){return _0x3494a5;});}else{throw new db['Sequelize']['ValidationError'](_0x0330('0x98'));}})['then'](function(_0x526b80){return _0x215ec6[_0x0330('0x4f')](_0x526b80);})[_0x0330('0x48')](handleError(_0x215ec6));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 6d0ec2e..8d93a35 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 _0xbf33=['exports','define','VoiceRecording','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xbf33,0x16c));var _0x3bf3=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xbf33[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x3bf3('0x0'));var util=require(_0x3bf3('0x1'));var logger=require(_0x3bf3('0x2'))(_0x3bf3('0x3'));var moment=require(_0x3bf3('0x4'));var BPromise=require(_0x3bf3('0x5'));var rp=require(_0x3bf3('0x6'));var fs=require('fs');var path=require(_0x3bf3('0x7'));var rimraf=require(_0x3bf3('0x8'));var config=require(_0x3bf3('0x9'));var attributes=require(_0x3bf3('0xa'));module[_0x3bf3('0xb')]=function(_0x3591c2,_0x1f737c){return _0x3591c2[_0x3bf3('0xc')](_0x3bf3('0xd'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x3bf3('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4370=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x4370,0x1e1));var _0x0437=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x4370[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x0437('0x0'));var logger=require(_0x0437('0x1'))(_0x0437('0x2'));var moment=require(_0x0437('0x3'));var BPromise=require('bluebird');var rp=require(_0x0437('0x4'));var fs=require('fs');var path=require(_0x0437('0x5'));var rimraf=require(_0x0437('0x6'));var config=require(_0x0437('0x7'));var attributes=require('./voiceRecording.attributes');module[_0x0437('0x8')]=function(_0x403797,_0x5f142c){return _0x403797[_0x0437('0x9')](_0x0437('0xa'),attributes,{'tableName':_0x0437('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0437('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 9258534..b8a9b1a 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 _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x1bfa86,_0x4a8606){var _0x1bd346=function(_0x1a1135){while(--_0x1a1135){_0x1bfa86['push'](_0x1bfa86['shift']());}};_0x1bd346(++_0x4a8606);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x1aeb39,_0x2e8404){var _0x439790=function(_0x199911){while(--_0x199911){_0x1aeb39['push'](_0x1aeb39['shift']());}};_0x439790(++_0x2e8404);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index e140dcb..1acbae9 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 _0xd401=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','describe'];(function(_0x534d0c,_0x315658){var _0x2ecfdf=function(_0x15a58b){while(--_0x15a58b){_0x534d0c['push'](_0x534d0c['shift']());}};_0x2ecfdf(++_0x315658);}(_0xd401,0xc1));var _0x1d40=function(_0x3ec41f,_0x12e95e){_0x3ec41f=_0x3ec41f-0x0;var _0x350c58=_0xd401[_0x3ec41f];return _0x350c58;};'use strict';var multer=require(_0x1d40('0x0'));var util=require(_0x1d40('0x1'));var path=require(_0x1d40('0x2'));var timeout=require(_0x1d40('0x3'));var express=require(_0x1d40('0x4'));var router=express[_0x1d40('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1d40('0x6'));var interaction=require(_0x1d40('0x7'));var config=require(_0x1d40('0x8'));var controller=require(_0x1d40('0x9'));router['get']('/',auth[_0x1d40('0xa')](),controller[_0x1d40('0xb')]);router[_0x1d40('0xc')]('/describe',auth[_0x1d40('0xa')](),controller[_0x1d40('0xd')]);router[_0x1d40('0xc')](_0x1d40('0xe'),auth[_0x1d40('0xa')](),controller[_0x1d40('0xf')]);router[_0x1d40('0x10')]('/',auth[_0x1d40('0xa')](),controller[_0x1d40('0x11')]);router[_0x1d40('0x12')](_0x1d40('0xe'),auth[_0x1d40('0xa')](),controller[_0x1d40('0x13')]);router[_0x1d40('0x14')](_0x1d40('0xe'),auth[_0x1d40('0xa')](),controller[_0x1d40('0x15')]);module[_0x1d40('0x16')]=router; \ No newline at end of file +var _0x0e01=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x40aa6f,_0x11ad11){var _0x561bd2=function(_0x18415b){while(--_0x18415b){_0x40aa6f['push'](_0x40aa6f['shift']());}};_0x561bd2(++_0x11ad11);}(_0x0e01,0xdc));var _0x10e0=function(_0x4b94ea,_0x250d6f){_0x4b94ea=_0x4b94ea-0x0;var _0x3fe80f=_0x0e01[_0x4b94ea];return _0x3fe80f;};'use strict';var multer=require(_0x10e0('0x0'));var util=require(_0x10e0('0x1'));var path=require(_0x10e0('0x2'));var timeout=require(_0x10e0('0x3'));var express=require(_0x10e0('0x4'));var router=express[_0x10e0('0x5')]();var fs_extra=require(_0x10e0('0x6'));var auth=require(_0x10e0('0x7'));var interaction=require(_0x10e0('0x8'));var config=require(_0x10e0('0x9'));var controller=require(_0x10e0('0xa'));router[_0x10e0('0xb')]('/',auth[_0x10e0('0xc')](),controller[_0x10e0('0xd')]);router[_0x10e0('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x10e0('0xe')]);router[_0x10e0('0xb')](_0x10e0('0xf'),auth[_0x10e0('0xc')](),controller[_0x10e0('0x10')]);router[_0x10e0('0x11')]('/',auth[_0x10e0('0xc')](),controller[_0x10e0('0x12')]);router[_0x10e0('0x13')](_0x10e0('0xf'),auth['isAuthenticated'](),controller[_0x10e0('0x14')]);router[_0x10e0('0x15')](_0x10e0('0xf'),auth['isAuthenticated'](),controller[_0x10e0('0x16')]);module[_0x10e0('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 58c5769..eb6fc72 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 _0x4080=['attended','STRING','ENUM','Yes','moment','exports','blind'];(function(_0x1b2255,_0x3de34f){var _0x33e57d=function(_0x2f9cce){while(--_0x2f9cce){_0x1b2255['push'](_0x1b2255['shift']());}};_0x33e57d(++_0x3de34f);}(_0x4080,0xa5));var _0x0408=function(_0x36d703,_0x55b354){_0x36d703=_0x36d703-0x0;var _0x12c909=_0x4080[_0x36d703];return _0x12c909;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0408('0x0'));module[_0x0408('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0408('0x2'),_0x0408('0x3'))},'result':{'type':Sequelize[_0x0408('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x0408('0x4')]},'transferercalleridname':{'type':Sequelize[_0x0408('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x0408('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x0408('0x4')]},'transferercontext':{'type':Sequelize[_0x0408('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x0408('0x4')]},'transfereechannel':{'type':Sequelize[_0x0408('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x0408('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x0408('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x0408('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x0408('0x4')]},'transfereecontext':{'type':Sequelize[_0x0408('0x4')]},'transfereeexten':{'type':Sequelize[_0x0408('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x0408('0x5')](_0x0408('0x6'),'No')},'context':{'type':Sequelize[_0x0408('0x4')]},'extension':{'type':Sequelize[_0x0408('0x4')]}}; \ No newline at end of file +var _0x868f=['attended','STRING','ENUM','Yes','sequelize','moment','blind'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x868f,0x177));var _0xf868=function(_0x3dcc81,_0x1cbc50){_0x3dcc81=_0x3dcc81-0x0;var _0x1fc58a=_0x868f[_0x3dcc81];return _0x1fc58a;};'use strict';var Sequelize=require(_0xf868('0x0'));var moment=require(_0xf868('0x1'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xf868('0x2'),_0xf868('0x3'))},'result':{'type':Sequelize[_0xf868('0x4')]},'transfererchannel':{'type':Sequelize[_0xf868('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xf868('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xf868('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xf868('0x4')]},'transferercontext':{'type':Sequelize[_0xf868('0x4')]},'transfererexten':{'type':Sequelize[_0xf868('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xf868('0x4')]},'transfereechannel':{'type':Sequelize[_0xf868('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xf868('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xf868('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xf868('0x4')]},'transfereeexten':{'type':Sequelize[_0xf868('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xf868('0x4')]},'isexternal':{'type':Sequelize[_0xf868('0x5')](_0xf868('0x6'),'No')},'context':{'type':Sequelize[_0xf868('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 7751c7f..b664345 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 _0x6b95=['type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName'];(function(_0xc427e5,_0x59926e){var _0x2549fc=function(_0x351965){while(--_0x351965){_0xc427e5['push'](_0xc427e5['shift']());}};_0x2549fc(++_0x59926e);}(_0x6b95,0xb4));var _0x56b9=function(_0x4830c9,_0x9d4bc2){_0x4830c9=_0x4830c9-0x0;var _0x22bd4c=_0x6b95[_0x4830c9];return _0x22bd4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56b9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x56b9('0x1'));var rp=require(_0x56b9('0x2'));var moment=require('moment');var BPromise=require(_0x56b9('0x3'));var Mustache=require(_0x56b9('0x4'));var util=require(_0x56b9('0x5'));var path=require(_0x56b9('0x6'));var sox=require(_0x56b9('0x7'));var csv=require(_0x56b9('0x8'));var ejs=require(_0x56b9('0x9'));var fs=require('fs');var fs_extra=require(_0x56b9('0xa'));var _=require(_0x56b9('0xb'));var squel=require(_0x56b9('0xc'));var crypto=require(_0x56b9('0xd'));var jsforce=require(_0x56b9('0xe'));var deskjs=require(_0x56b9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x56b9('0x10'));var Papa=require(_0x56b9('0x11'));var Redis=require('ioredis');var authService=require(_0x56b9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x56b9('0x13'));var hardwareService=require(_0x56b9('0x14'));var logger=require(_0x56b9('0x15'))(_0x56b9('0x16'));var utils=require('../../config/utils');var config=require(_0x56b9('0x17'));var licenseUtil=require(_0x56b9('0x18'));var db=require(_0x56b9('0x19'))['db'];function respondWithStatusCode(_0x4a2367,_0x5c2501){_0x5c2501=_0x5c2501||0xcc;return function(_0x4c0b4e){if(_0x4c0b4e){return _0x4a2367[_0x56b9('0x1a')](_0x5c2501);}return _0x4a2367['status'](_0x5c2501)[_0x56b9('0x1b')]();};}function respondWithResult(_0x55d653,_0x1d9d76){_0x1d9d76=_0x1d9d76||0xc8;return function(_0xd33f8e){if(_0xd33f8e){return _0x55d653[_0x56b9('0x1c')](_0x1d9d76)[_0x56b9('0x1d')](_0xd33f8e);}};}function respondWithFilteredResult(_0x43b96f,_0x431bd2){return function(_0x3c1d9b){if(_0x3c1d9b){var _0x55034a=_0x3c1d9b[_0x56b9('0x1e')],_0x1fe3fc=_0x431bd2['offset'],_0x117db1=_0x431bd2[_0x56b9('0x1f')]+_0x431bd2[_0x56b9('0x20')],_0x25f7ec;if(_0x117db1>=_0x55034a){_0x117db1=_0x55034a;_0x25f7ec=0xc8;}else{_0x25f7ec=0xce;}_0x43b96f['status'](_0x25f7ec);return _0x43b96f[_0x56b9('0x21')]('Content-Range',_0x1fe3fc+'-'+_0x117db1+'/'+_0x55034a)[_0x56b9('0x1d')](_0x3c1d9b);}return null;};}function patchUpdates(_0x2cb70a){return function(_0x5a97d3){try{jsonpatch[_0x56b9('0x22')](_0x5a97d3,_0x2cb70a,!![]);}catch(_0x408cb3){return BPromise[_0x56b9('0x23')](_0x408cb3);}return _0x5a97d3[_0x56b9('0x24')]();};}function saveUpdates(_0x51516e,_0x5b1e61){return function(_0x297a7f){if(_0x297a7f){return _0x297a7f[_0x56b9('0x25')](_0x51516e)[_0x56b9('0x26')](function(_0x45e319){return _0x45e319;});}return null;};}function removeEntity(_0x1353db,_0x93d101){return function(_0x496d92){if(_0x496d92){return _0x496d92[_0x56b9('0x27')]()['then'](function(){_0x1353db['status'](0xcc)[_0x56b9('0x1b')]();});}};}function handleEntityNotFound(_0x23ea01,_0x448020){return function(_0x196935){if(!_0x196935){_0x23ea01[_0x56b9('0x1a')](0x194);}return _0x196935;};}function handleError(_0x5d1ef2,_0x31eb08){_0x31eb08=_0x31eb08||0x1f4;return function(_0x382014){logger[_0x56b9('0x28')](_0x382014[_0x56b9('0x29')]);if(_0x382014[_0x56b9('0x2a')]){delete _0x382014[_0x56b9('0x2a')];}_0x5d1ef2[_0x56b9('0x1c')](_0x31eb08)['send'](_0x382014);};}exports[_0x56b9('0x2b')]=function(_0x5daa4f,_0x210287){var _0x23d7d4={},_0x24243f={},_0x1363fb={'count':0x0,'rows':[]};var _0x42897a=_[_0x56b9('0x2c')](db[_0x56b9('0x2d')][_0x56b9('0x2e')],function(_0x4161b0){return{'name':_0x4161b0[_0x56b9('0x2f')],'type':_0x4161b0[_0x56b9('0x30')][_0x56b9('0x31')]};});_0x24243f[_0x56b9('0x32')]=_[_0x56b9('0x2c')](_0x42897a,'name');_0x24243f[_0x56b9('0x33')]=_[_0x56b9('0x34')](_0x5daa4f[_0x56b9('0x33')]);_0x24243f[_0x56b9('0x35')]=_[_0x56b9('0x36')](_0x24243f[_0x56b9('0x32')],_0x24243f[_0x56b9('0x33')]);_0x23d7d4['attributes']=_[_0x56b9('0x36')](_0x24243f[_0x56b9('0x32')],qs[_0x56b9('0x37')](_0x5daa4f['query'][_0x56b9('0x37')]));_0x23d7d4[_0x56b9('0x38')]=_0x23d7d4[_0x56b9('0x38')]['length']?_0x23d7d4['attributes']:_0x24243f[_0x56b9('0x32')];if(!_0x5daa4f['query'][_0x56b9('0x39')](_0x56b9('0x3a'))){_0x23d7d4['limit']=qs[_0x56b9('0x20')](_0x5daa4f[_0x56b9('0x33')][_0x56b9('0x20')]);_0x23d7d4[_0x56b9('0x1f')]=qs[_0x56b9('0x1f')](_0x5daa4f['query'][_0x56b9('0x1f')]);}_0x23d7d4[_0x56b9('0x3b')]=qs[_0x56b9('0x3c')](_0x5daa4f[_0x56b9('0x33')][_0x56b9('0x3c')]);_0x23d7d4[_0x56b9('0x3d')]=qs['filters'](_[_0x56b9('0x3e')](_0x5daa4f[_0x56b9('0x33')],_0x24243f['filters']),_0x42897a);if(_0x5daa4f[_0x56b9('0x33')]['filter']){_0x23d7d4['where']=_['merge'](_0x23d7d4['where'],{'$or':_[_0x56b9('0x2c')](_0x42897a,function(_0x27fe7d){if(_0x27fe7d[_0x56b9('0x30')]!=='VIRTUAL'){var _0x1ee0a1={};_0x1ee0a1[_0x27fe7d[_0x56b9('0x2a')]]={'$like':'%'+_0x5daa4f[_0x56b9('0x33')]['filter']+'%'};return _0x1ee0a1;}})});}_0x23d7d4=_[_0x56b9('0x3f')]({},_0x23d7d4,_0x5daa4f[_0x56b9('0x40')]);var _0x2ba98e={'where':_0x23d7d4['where']};return db[_0x56b9('0x2d')][_0x56b9('0x1e')](_0x2ba98e)[_0x56b9('0x26')](function(_0x1e032b){_0x1363fb[_0x56b9('0x1e')]=_0x1e032b;if(_0x5daa4f[_0x56b9('0x33')][_0x56b9('0x41')]){_0x23d7d4[_0x56b9('0x42')]=[{'all':!![]}];}return db[_0x56b9('0x2d')][_0x56b9('0x43')](_0x23d7d4);})[_0x56b9('0x26')](function(_0x15d0ad){_0x1363fb['rows']=_0x15d0ad;return _0x1363fb;})[_0x56b9('0x26')](respondWithFilteredResult(_0x210287,_0x23d7d4))[_0x56b9('0x44')](handleError(_0x210287,null));};exports[_0x56b9('0x45')]=function(_0x377a32,_0x22dcff){var _0x546ad1={'raw':!![],'where':{'id':_0x377a32[_0x56b9('0x46')]['id']}},_0x31df94={};_0x31df94[_0x56b9('0x32')]=_[_0x56b9('0x34')](db[_0x56b9('0x2d')][_0x56b9('0x2e')]);_0x31df94['query']=_[_0x56b9('0x34')](_0x377a32[_0x56b9('0x33')]);_0x31df94['filters']=_['intersection'](_0x31df94[_0x56b9('0x32')],_0x31df94[_0x56b9('0x33')]);_0x546ad1[_0x56b9('0x38')]=_[_0x56b9('0x36')](_0x31df94[_0x56b9('0x32')],qs['fields'](_0x377a32[_0x56b9('0x33')][_0x56b9('0x37')]));_0x546ad1[_0x56b9('0x38')]=_0x546ad1['attributes'][_0x56b9('0x47')]?_0x546ad1[_0x56b9('0x38')]:_0x31df94['model'];if(_0x377a32[_0x56b9('0x33')]['includeAll']){_0x546ad1[_0x56b9('0x42')]=[{'all':!![]}];}_0x546ad1=_[_0x56b9('0x3f')]({},_0x546ad1,_0x377a32[_0x56b9('0x40')]);return db[_0x56b9('0x2d')][_0x56b9('0x48')](_0x546ad1)[_0x56b9('0x26')](handleEntityNotFound(_0x22dcff,null))[_0x56b9('0x26')](respondWithResult(_0x22dcff,null))[_0x56b9('0x44')](handleError(_0x22dcff,null));};exports[_0x56b9('0x49')]=function(_0x3d055d,_0x2039d6){return db[_0x56b9('0x2d')][_0x56b9('0x49')](_0x3d055d[_0x56b9('0x4a')],{})['then'](respondWithResult(_0x2039d6,0xc9))[_0x56b9('0x44')](handleError(_0x2039d6,null));};exports[_0x56b9('0x25')]=function(_0x13e09d,_0xc6b1c6){if(_0x13e09d[_0x56b9('0x4a')]['id']){delete _0x13e09d['body']['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x13e09d[_0x56b9('0x46')]['id']}})[_0x56b9('0x26')](handleEntityNotFound(_0xc6b1c6,null))['then'](saveUpdates(_0x13e09d[_0x56b9('0x4a')],null))[_0x56b9('0x26')](respondWithResult(_0xc6b1c6,null))[_0x56b9('0x44')](handleError(_0xc6b1c6,null));};exports[_0x56b9('0x27')]=function(_0x3d800c,_0x4bd870){return db['VoiceTransferReport']['find']({'where':{'id':_0x3d800c[_0x56b9('0x46')]['id']}})[_0x56b9('0x26')](handleEntityNotFound(_0x4bd870,null))[_0x56b9('0x26')](removeEntity(_0x4bd870,null))['catch'](handleError(_0x4bd870,null));};exports[_0x56b9('0x4b')]=function(_0x4269cf,_0x1da08e){return db[_0x56b9('0x2d')][_0x56b9('0x4b')]()[_0x56b9('0x26')](respondWithResult(_0x1da08e,null))[_0x56b9('0x44')](handleError(_0x1da08e,null));}; \ No newline at end of file +var _0x7246=['fields','length','offset','sort','where','pick','filter','merge','options','show','params','keys','includeAll','catch','create','update','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','count','limit','status','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0x2967a4,_0x5cc3ce){var _0x1d6f8f=function(_0x43b146){while(--_0x43b146){_0x2967a4['push'](_0x2967a4['shift']());}};_0x1d6f8f(++_0x5cc3ce);}(_0x7246,0xf1));var _0x6724=function(_0xf778ab,_0x4c87a0){_0xf778ab=_0xf778ab-0x0;var _0x19b8b7=_0x7246[_0xf778ab];return _0x19b8b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6724('0x0'));var zipdir=require(_0x6724('0x1'));var jsonpatch=require(_0x6724('0x2'));var rp=require(_0x6724('0x3'));var moment=require('moment');var BPromise=require(_0x6724('0x4'));var Mustache=require(_0x6724('0x5'));var util=require(_0x6724('0x6'));var path=require(_0x6724('0x7'));var sox=require(_0x6724('0x8'));var csv=require('to-csv');var ejs=require(_0x6724('0x9'));var fs=require('fs');var fs_extra=require(_0x6724('0xa'));var _=require('lodash');var squel=require(_0x6724('0xb'));var crypto=require(_0x6724('0xc'));var jsforce=require(_0x6724('0xd'));var deskjs=require(_0x6724('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6724('0xf'));var Papa=require(_0x6724('0x10'));var Redis=require(_0x6724('0x11'));var authService=require(_0x6724('0x12'));var qs=require(_0x6724('0x13'));var as=require(_0x6724('0x14'));var hardwareService=require(_0x6724('0x15'));var logger=require(_0x6724('0x16'))(_0x6724('0x17'));var utils=require(_0x6724('0x18'));var config=require(_0x6724('0x19'));var licenseUtil=require(_0x6724('0x1a'));var db=require(_0x6724('0x1b'))['db'];function respondWithStatusCode(_0x50bb70,_0x33a265){_0x33a265=_0x33a265||0xcc;return function(_0x362673){if(_0x362673){return _0x50bb70['sendStatus'](_0x33a265);}return _0x50bb70['status'](_0x33a265)['end']();};}function respondWithResult(_0x1f2371,_0x3a7641){_0x3a7641=_0x3a7641||0xc8;return function(_0x2589ce){if(_0x2589ce){return _0x1f2371['status'](_0x3a7641)[_0x6724('0x1c')](_0x2589ce);}};}function respondWithFilteredResult(_0x9a5e33,_0xbfb138){return function(_0x29f5e6){if(_0x29f5e6){var _0x1058ca=_0x29f5e6[_0x6724('0x1d')],_0x4926d0=_0xbfb138['offset'],_0x49e96a=_0xbfb138['offset']+_0xbfb138[_0x6724('0x1e')],_0x10a78e;if(_0x49e96a>=_0x1058ca){_0x49e96a=_0x1058ca;_0x10a78e=0xc8;}else{_0x10a78e=0xce;}_0x9a5e33[_0x6724('0x1f')](_0x10a78e);return _0x9a5e33[_0x6724('0x20')](_0x6724('0x21'),_0x4926d0+'-'+_0x49e96a+'/'+_0x1058ca)[_0x6724('0x1c')](_0x29f5e6);}return null;};}function patchUpdates(_0x3fb146){return function(_0xfa5f27){try{jsonpatch[_0x6724('0x22')](_0xfa5f27,_0x3fb146,!![]);}catch(_0x4041f0){return BPromise[_0x6724('0x23')](_0x4041f0);}return _0xfa5f27[_0x6724('0x24')]();};}function saveUpdates(_0x1ba5bb,_0x1b0868){return function(_0x4942f2){if(_0x4942f2){return _0x4942f2['update'](_0x1ba5bb)[_0x6724('0x25')](function(_0x528895){return _0x528895;});}return null;};}function removeEntity(_0x3c56cd,_0x111146){return function(_0x13d983){if(_0x13d983){return _0x13d983[_0x6724('0x26')]()[_0x6724('0x25')](function(){_0x3c56cd[_0x6724('0x1f')](0xcc)[_0x6724('0x27')]();});}};}function handleEntityNotFound(_0x4a13b2,_0x7991a8){return function(_0x530ebd){if(!_0x530ebd){_0x4a13b2[_0x6724('0x28')](0x194);}return _0x530ebd;};}function handleError(_0x118733,_0x1382e6){_0x1382e6=_0x1382e6||0x1f4;return function(_0x184ddd){logger[_0x6724('0x29')](_0x184ddd[_0x6724('0x2a')]);if(_0x184ddd['name']){delete _0x184ddd[_0x6724('0x2b')];}_0x118733[_0x6724('0x1f')](_0x1382e6)['send'](_0x184ddd);};}exports['index']=function(_0x16ad74,_0x47c5b0){var _0x158dd1={},_0x94184c={},_0x73e2d2={'count':0x0,'rows':[]};var _0x2c709a=_[_0x6724('0x2c')](db[_0x6724('0x2d')][_0x6724('0x2e')],function(_0xccd1a4){return{'name':_0xccd1a4[_0x6724('0x2f')],'type':_0xccd1a4[_0x6724('0x30')][_0x6724('0x31')]};});_0x94184c[_0x6724('0x32')]=_[_0x6724('0x2c')](_0x2c709a,_0x6724('0x2b'));_0x94184c['query']=_['keys'](_0x16ad74[_0x6724('0x33')]);_0x94184c[_0x6724('0x34')]=_[_0x6724('0x35')](_0x94184c[_0x6724('0x32')],_0x94184c[_0x6724('0x33')]);_0x158dd1[_0x6724('0x36')]=_[_0x6724('0x35')](_0x94184c[_0x6724('0x32')],qs[_0x6724('0x37')](_0x16ad74[_0x6724('0x33')][_0x6724('0x37')]));_0x158dd1[_0x6724('0x36')]=_0x158dd1[_0x6724('0x36')][_0x6724('0x38')]?_0x158dd1[_0x6724('0x36')]:_0x94184c['model'];if(!_0x16ad74[_0x6724('0x33')]['hasOwnProperty']('nolimit')){_0x158dd1['limit']=qs[_0x6724('0x1e')](_0x16ad74['query'][_0x6724('0x1e')]);_0x158dd1[_0x6724('0x39')]=qs[_0x6724('0x39')](_0x16ad74[_0x6724('0x33')]['offset']);}_0x158dd1['order']=qs[_0x6724('0x3a')](_0x16ad74[_0x6724('0x33')][_0x6724('0x3a')]);_0x158dd1[_0x6724('0x3b')]=qs['filters'](_[_0x6724('0x3c')](_0x16ad74[_0x6724('0x33')],_0x94184c[_0x6724('0x34')]),_0x2c709a);if(_0x16ad74[_0x6724('0x33')][_0x6724('0x3d')]){_0x158dd1[_0x6724('0x3b')]=_[_0x6724('0x3e')](_0x158dd1[_0x6724('0x3b')],{'$or':_['map'](_0x2c709a,function(_0x507554){if(_0x507554['type']!=='VIRTUAL'){var _0xa80bae={};_0xa80bae[_0x507554[_0x6724('0x2b')]]={'$like':'%'+_0x16ad74[_0x6724('0x33')][_0x6724('0x3d')]+'%'};return _0xa80bae;}})});}_0x158dd1=_[_0x6724('0x3e')]({},_0x158dd1,_0x16ad74[_0x6724('0x3f')]);var _0x959855={'where':_0x158dd1[_0x6724('0x3b')]};return db[_0x6724('0x2d')]['count'](_0x959855)['then'](function(_0x94b251){_0x73e2d2['count']=_0x94b251;if(_0x16ad74[_0x6724('0x33')]['includeAll']){_0x158dd1['include']=[{'all':!![]}];}return db[_0x6724('0x2d')]['findAll'](_0x158dd1);})['then'](function(_0x37e9c7){_0x73e2d2['rows']=_0x37e9c7;return _0x73e2d2;})[_0x6724('0x25')](respondWithFilteredResult(_0x47c5b0,_0x158dd1))['catch'](handleError(_0x47c5b0,null));};exports[_0x6724('0x40')]=function(_0x2a600d,_0x2f4a93){var _0xea8721={'raw':!![],'where':{'id':_0x2a600d[_0x6724('0x41')]['id']}},_0x3c1dcd={};_0x3c1dcd[_0x6724('0x32')]=_[_0x6724('0x42')](db[_0x6724('0x2d')][_0x6724('0x2e')]);_0x3c1dcd[_0x6724('0x33')]=_[_0x6724('0x42')](_0x2a600d[_0x6724('0x33')]);_0x3c1dcd[_0x6724('0x34')]=_['intersection'](_0x3c1dcd[_0x6724('0x32')],_0x3c1dcd[_0x6724('0x33')]);_0xea8721[_0x6724('0x36')]=_[_0x6724('0x35')](_0x3c1dcd[_0x6724('0x32')],qs[_0x6724('0x37')](_0x2a600d[_0x6724('0x33')][_0x6724('0x37')]));_0xea8721[_0x6724('0x36')]=_0xea8721['attributes'][_0x6724('0x38')]?_0xea8721[_0x6724('0x36')]:_0x3c1dcd[_0x6724('0x32')];if(_0x2a600d[_0x6724('0x33')][_0x6724('0x43')]){_0xea8721['include']=[{'all':!![]}];}_0xea8721=_[_0x6724('0x3e')]({},_0xea8721,_0x2a600d[_0x6724('0x3f')]);return db[_0x6724('0x2d')]['find'](_0xea8721)[_0x6724('0x25')](handleEntityNotFound(_0x2f4a93,null))[_0x6724('0x25')](respondWithResult(_0x2f4a93,null))[_0x6724('0x44')](handleError(_0x2f4a93,null));};exports[_0x6724('0x45')]=function(_0x345c6c,_0x2a02aa){return db[_0x6724('0x2d')]['create'](_0x345c6c['body'],{})[_0x6724('0x25')](respondWithResult(_0x2a02aa,0xc9))[_0x6724('0x44')](handleError(_0x2a02aa,null));};exports[_0x6724('0x46')]=function(_0x18234a,_0x375dd2){if(_0x18234a[_0x6724('0x47')]['id']){delete _0x18234a[_0x6724('0x47')]['id'];}return db[_0x6724('0x2d')][_0x6724('0x48')]({'where':{'id':_0x18234a['params']['id']}})[_0x6724('0x25')](handleEntityNotFound(_0x375dd2,null))['then'](saveUpdates(_0x18234a['body'],null))[_0x6724('0x25')](respondWithResult(_0x375dd2,null))[_0x6724('0x44')](handleError(_0x375dd2,null));};exports[_0x6724('0x26')]=function(_0x2be299,_0x5dc5b4){return db[_0x6724('0x2d')][_0x6724('0x48')]({'where':{'id':_0x2be299[_0x6724('0x41')]['id']}})[_0x6724('0x25')](handleEntityNotFound(_0x5dc5b4,null))[_0x6724('0x25')](removeEntity(_0x5dc5b4,null))[_0x6724('0x44')](handleError(_0x5dc5b4,null));};exports[_0x6724('0x49')]=function(_0x474ece,_0x555590){return db[_0x6724('0x2d')][_0x6724('0x49')]()[_0x6724('0x25')](respondWithResult(_0x555590,null))[_0x6724('0x44')](handleError(_0x555590,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index c488f8b..cc08bbf 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 _0x434f=['define','VoiceTransferReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4a3b02,_0x3f5b31){var _0x40d53c=function(_0x792cc7){while(--_0x792cc7){_0x4a3b02['push'](_0x4a3b02['shift']());}};_0x40d53c(++_0x3f5b31);}(_0x434f,0x120));var _0xf434=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x434f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf434('0x0'));var util=require(_0xf434('0x1'));var logger=require(_0xf434('0x2'))(_0xf434('0x3'));var moment=require(_0xf434('0x4'));var BPromise=require(_0xf434('0x5'));var rp=require(_0xf434('0x6'));var fs=require('fs');var path=require(_0xf434('0x7'));var rimraf=require(_0xf434('0x8'));var config=require(_0xf434('0x9'));var attributes=require('./voiceTransferReport.attributes');module[_0xf434('0xa')]=function(_0xb282b7,_0x465732){return _0xb282b7[_0xf434('0xb')](_0xf434('0xc'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x518b=['api','moment','rimraf','../../config/environment','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger'];(function(_0x5359c0,_0x13b40e){var _0x4e0db1=function(_0x468d1c){while(--_0x468d1c){_0x5359c0['push'](_0x5359c0['shift']());}};_0x4e0db1(++_0x13b40e);}(_0x518b,0x15b));var _0xb518=function(_0x4f8661,_0x18bdf4){_0x4f8661=_0x4f8661-0x0;var _0x2484ba=_0x518b[_0x4f8661];return _0x2484ba;};'use strict';var _=require(_0xb518('0x0'));var util=require(_0xb518('0x1'));var logger=require(_0xb518('0x2'))(_0xb518('0x3'));var moment=require(_0xb518('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb518('0x5'));var config=require(_0xb518('0x6'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x376e3e,_0x485944){return _0x376e3e[_0xb518('0x7')](_0xb518('0x8'),attributes,{'tableName':_0xb518('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 6eb0cfb..d6e0892 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 _0x894f=['../../config/utils','../../config/environment','jayson/promise','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x894f,0x14d));var _0xf894=function(_0x459fe7,_0x33ff61){_0x459fe7=_0x459fe7-0x0;var _0x391f4d=_0x894f[_0x459fe7];return _0x391f4d;};'use strict';var _=require(_0xf894('0x0'));var util=require(_0xf894('0x1'));var moment=require(_0xf894('0x2'));var BPromise=require(_0xf894('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf894('0x4'))['db'];var utils=require(_0xf894('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf894('0x6'));var jayson=require(_0xf894('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23a9fc,_0x371f86,_0x56d9d6){return new BPromise(function(_0x190cb1,_0x3d8f21){return client[_0xf894('0x8')](_0x23a9fc,_0x56d9d6)[_0xf894('0x9')](function(_0x10bb84){logger[_0xf894('0xa')](_0xf894('0xb'),_0x371f86,_0xf894('0xc'));logger[_0xf894('0xd')](_0xf894('0xe'),_0x371f86,_0xf894('0xc'),JSON[_0xf894('0xf')](_0x10bb84));if(_0x10bb84[_0xf894('0x10')]){if(_0x10bb84[_0xf894('0x10')][_0xf894('0x11')]===0x1f4){logger[_0xf894('0x10')](_0xf894('0xb'),_0x371f86,_0x10bb84[_0xf894('0x10')][_0xf894('0x12')]);return _0x3d8f21(_0x10bb84[_0xf894('0x10')][_0xf894('0x12')]);}logger[_0xf894('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x371f86,_0x10bb84[_0xf894('0x10')]['message']);return _0x190cb1(_0x10bb84['error'][_0xf894('0x12')]);}else{logger[_0xf894('0xa')](_0xf894('0xb'),_0x371f86,_0xf894('0xc'));_0x190cb1(_0x10bb84[_0xf894('0x13')]['message']);}})['catch'](function(_0x1865be){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x371f86,_0x1865be);_0x3d8f21(_0x1865be);});});}exports[_0xf894('0x14')]=function(_0x340345){var _0x3f29f1=this;return new Promise(function(_0x4bd77c,_0x45d995){return db[_0xf894('0x15')][_0xf894('0x16')](_0x340345['body'],{'raw':_0x340345['options']?_0x340345[_0xf894('0x17')][_0xf894('0x18')]===undefined?!![]:![]:!![]})[_0xf894('0x9')](function(_0x3abfd1){logger[_0xf894('0xa')](_0xf894('0x14'),_0x340345);logger[_0xf894('0xd')](_0xf894('0x14'),_0x340345,JSON[_0xf894('0xf')](_0x3abfd1));_0x4bd77c(_0x3abfd1);})[_0xf894('0x19')](function(_0x1ccbd1){logger[_0xf894('0x10')]('CreateVoiceTransferReport',_0x1ccbd1[_0xf894('0x12')],_0x340345);_0x45d995(_0x3f29f1['error'](0x1f4,_0x1ccbd1['message']));});});}; \ No newline at end of file +var _0x30e7=['util','bluebird','randomstring','rpc','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','debug','lodash'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x30e7,0x144));var _0x730e=function(_0x4ec7bd,_0x586cff){_0x4ec7bd=_0x4ec7bd-0x0;var _0x4830a9=_0x30e7[_0x4ec7bd];return _0x4830a9;};'use strict';var _=require(_0x730e('0x0'));var util=require(_0x730e('0x1'));var moment=require('moment');var BPromise=require(_0x730e('0x2'));var rs=require(_0x730e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x730e('0x4'));var config=require('../../config/environment');var jayson=require(_0x730e('0x5'));var client=jayson[_0x730e('0x6')][_0x730e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c8149,_0x13e59a,_0x3a0b3b){return new BPromise(function(_0x1cf321,_0x5eaffe){return client[_0x730e('0x8')](_0x1c8149,_0x3a0b3b)[_0x730e('0x9')](function(_0x5e46fa){logger[_0x730e('0xa')](_0x730e('0xb'),_0x13e59a,_0x730e('0xc'));logger['debug'](_0x730e('0xd'),_0x13e59a,'request\x20sent',JSON[_0x730e('0xe')](_0x5e46fa));if(_0x5e46fa[_0x730e('0xf')]){if(_0x5e46fa['error']['code']===0x1f4){logger[_0x730e('0xf')](_0x730e('0xb'),_0x13e59a,_0x5e46fa['error'][_0x730e('0x10')]);return _0x5eaffe(_0x5e46fa[_0x730e('0xf')]['message']);}logger[_0x730e('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x13e59a,_0x5e46fa[_0x730e('0xf')][_0x730e('0x10')]);return _0x1cf321(_0x5e46fa[_0x730e('0xf')][_0x730e('0x10')]);}else{logger[_0x730e('0xa')](_0x730e('0xb'),_0x13e59a,_0x730e('0xc'));_0x1cf321(_0x5e46fa[_0x730e('0x11')][_0x730e('0x10')]);}})[_0x730e('0x12')](function(_0x4172a2){logger['error'](_0x730e('0xb'),_0x13e59a,_0x4172a2);_0x5eaffe(_0x4172a2);});});}exports[_0x730e('0x13')]=function(_0x344fd7){var _0x5c5a30=this;return new Promise(function(_0x45d7d7,_0x3d8d89){return db['VoiceTransferReport'][_0x730e('0x14')](_0x344fd7[_0x730e('0x15')],{'raw':_0x344fd7[_0x730e('0x16')]?_0x344fd7[_0x730e('0x16')][_0x730e('0x17')]===undefined?!![]:![]:!![]})[_0x730e('0x9')](function(_0x53614a){logger[_0x730e('0xa')](_0x730e('0x13'),_0x344fd7);logger[_0x730e('0x18')]('CreateVoiceTransferReport',_0x344fd7,JSON[_0x730e('0xe')](_0x53614a));_0x45d7d7(_0x53614a);})['catch'](function(_0x1adf0c){logger[_0x730e('0xf')](_0x730e('0x13'),_0x1adf0c[_0x730e('0x10')],_0x344fd7);_0x3d8d89(_0x5c5a30[_0x730e('0xf')](0x1f4,_0x1adf0c['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 7f75016..cb521ee 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 _0xe79f=['/hold','hold','/unhold','calls','transfer','exports','express','../../components/auth/service','post','originate','/hangup','hangup','isAuthenticated','canUpdate'];(function(_0x17bafe,_0x5e18e3){var _0x4582ed=function(_0x4690aa){while(--_0x4690aa){_0x17bafe['push'](_0x17bafe['shift']());}};_0x4582ed(++_0x5e18e3);}(_0xe79f,0x13a));var _0xfe79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe79f[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xfe79('0x0'));var router=express['Router']();var auth=require(_0xfe79('0x1'));var controller=require('./webbar.controller');router[_0xfe79('0x2')]('/originate',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xfe79('0x3')]);router[_0xfe79('0x2')](_0xfe79('0x4'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xfe79('0x5')]);router[_0xfe79('0x2')]('/answer',auth[_0xfe79('0x6')](),auth[_0xfe79('0x7')](),controller['answer']);router[_0xfe79('0x2')](_0xfe79('0x8'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xfe79('0x9')]);router[_0xfe79('0x2')](_0xfe79('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller['unhold']);router[_0xfe79('0x2')]('/calls',auth[_0xfe79('0x6')](),auth[_0xfe79('0x7')](),controller[_0xfe79('0xb')]);router[_0xfe79('0x2')]('/transfer',auth[_0xfe79('0x6')](),auth[_0xfe79('0x7')](),controller[_0xfe79('0xc')]);module[_0xfe79('0xd')]=router; \ No newline at end of file +var _0xf7f3=['originate','isAuthenticated','hangup','/hold','canUpdate','hold','/unhold','/calls','calls','transfer','express','Router','../../components/auth/service','./webbar.controller','post','/originate'];(function(_0x225278,_0x31da3f){var _0xe8f81d=function(_0x55c434){while(--_0x55c434){_0x225278['push'](_0x225278['shift']());}};_0xe8f81d(++_0x31da3f);}(_0xf7f3,0x12a));var _0x3f7f=function(_0x253925,_0x1c9250){_0x253925=_0x253925-0x0;var _0x5e1e13=_0xf7f3[_0x253925];return _0x5e1e13;};'use strict';var express=require(_0x3f7f('0x0'));var router=express[_0x3f7f('0x1')]();var auth=require(_0x3f7f('0x2'));var controller=require(_0x3f7f('0x3'));router[_0x3f7f('0x4')](_0x3f7f('0x5'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x3f7f('0x6')]);router[_0x3f7f('0x4')]('/hangup',auth[_0x3f7f('0x7')](),auth['canUpdate'](),controller[_0x3f7f('0x8')]);router[_0x3f7f('0x4')]('/answer',auth['isAuthenticated'](),auth['canUpdate'](),controller['answer']);router[_0x3f7f('0x4')](_0x3f7f('0x9'),auth[_0x3f7f('0x7')](),auth[_0x3f7f('0xa')](),controller[_0x3f7f('0xb')]);router[_0x3f7f('0x4')](_0x3f7f('0xc'),auth[_0x3f7f('0x7')](),auth['canUpdate'](),controller['unhold']);router[_0x3f7f('0x4')](_0x3f7f('0xd'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x3f7f('0xe')]);router[_0x3f7f('0x4')]('/transfer',auth[_0x3f7f('0x7')](),auth[_0x3f7f('0xa')](),controller[_0x3f7f('0xf')]);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 6a3da4b..1f24dd2 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 _0xdad2=['send','NotFound','then','error','code','message','catch','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','originate','info','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup\x20fired:','webbar:hangup','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer\x20fired:','transferNumber','transfer\x20executed!','lodash','../../mysqldb','util','bluebird','jayson/promise','http','../../config/logger','ioredis','redis','defaults','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','stack','name','status'];(function(_0x529587,_0x7b9e47){var _0x4ea039=function(_0x51cf40){while(--_0x51cf40){_0x529587['push'](_0x529587['shift']());}};_0x4ea039(++_0x7b9e47);}(_0xdad2,0x14c));var _0x2dad=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xdad2[_0x59ee6f];return _0x4c0979;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x2dad('0x0'));var db=require(_0x2dad('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x2dad('0x2'));var BPromise=require(_0x2dad('0x3'));var jayson=require(_0x2dad('0x4'));var amiClient=jayson['client'][_0x2dad('0x5')]({'port':0x232a});var logger=require(_0x2dad('0x6'))('webbarapi');var Redis=require(_0x2dad('0x7'));config[_0x2dad('0x8')]=_[_0x2dad('0x9')](config[_0x2dad('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2dad('0x8')]));var Schema=require(_0x2dad('0xa'));var originateValidation=new Schema({'userId':{'type':_0x2dad('0xb'),'required':[!![],_0x2dad('0xc')]},'callNumber':{'type':_0x2dad('0xd'),'required':[!![],_0x2dad('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x2dad('0xd')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2dad('0xc')]},'sessionId':{'type':_0x2dad('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2dad('0xc')]},'sessionId':{'type':_0x2dad('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2dad('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2dad('0xd'),'required':[!![],_0x2dad('0xf')]},'transferNumber':{'type':'string','required':[!![],_0x2dad('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x2dad('0xb'),'required':[!![],_0x2dad('0xc')]},'sessionId':{'type':_0x2dad('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2dad('0xc')]},'sessionId':{'type':_0x2dad('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2dad('0xb'),'required':[!![],_0x2dad('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x2dad('0xb'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x569c25,_0x26ac1d,_0x511f4a){logger['info'](_0x569c25,_0x26ac1d,JSON['stringify'](_0x511f4a));io['to'](_0x569c25)[_0x2dad('0x11')](_0x26ac1d,_0x511f4a);}function handleError(_0x100b84){return function(_0x2a2602){console[_0x2dad('0x12')](_0x2dad('0x13'),_0x2a2602,_0x2a2602 instanceof RangeError);logger['error'](_0x2a2602[_0x2dad('0x14')]);if(_0x2a2602 instanceof RangeError){if(_0x2a2602[_0x2dad('0x15')]){delete _0x2a2602['name'];}_0x100b84[_0x2dad('0x16')](0x194)['send'](_0x2a2602);}else{if(_0x2a2602['name']){delete _0x2a2602[_0x2dad('0x15')];}_0x100b84[_0x2dad('0x16')](0x1f4)[_0x2dad('0x17')](_0x2a2602);}};}function checkError(){return function(_0x3b8fe5){if(!_0x3b8fe5){throw new RangeError(_0x2dad('0x18'));}return _0x3b8fe5;};}function respondWithRpcPromise(_0x1f3461,_0x49624c){return new BPromise(function(_0x4e1bd1,_0x2e1798){var _0x5d66af=amiClient;return _0x5d66af['request'](_0x1f3461,_0x49624c)[_0x2dad('0x19')](function(_0x3865e9){if(_0x3865e9[_0x2dad('0x1a')]){if(_0x3865e9['error'][_0x2dad('0x1b')]===0x1f4){return _0x2e1798(_0x3865e9['error'][_0x2dad('0x1c')]);}return _0x4e1bd1(_0x3865e9[_0x2dad('0x1a')][_0x2dad('0x1c')]);}else{_0x4e1bd1(_0x3865e9['result']);}})[_0x2dad('0x1d')](function(_0x30e0fe){_0x2e1798(_0x30e0fe);});});}function getAgent(_0xa8d751){return db['User'][_0x2dad('0x1e')]({'where':{'id':_0xa8d751,'role':_0x2dad('0x1f')}})[_0x2dad('0x19')](checkError());}function getAgentCheckSession(_0x518ee2,_0xa7b9f0){return new BPromise(function(_0x343905,_0x3c1434){var _0x379961=respondWithRpcPromise(_0x2dad('0x20'));var _0x37c3e1=getAgent(_0x518ee2);Promise[_0x2dad('0x21')]([_0x379961,_0x37c3e1])['then'](function(_0x202f0a){var _0x1dd053=_0x202f0a[0x0];var _0x4c46b4=_0x202f0a[0x1];var _0x5d4d37=_[_0x2dad('0x22')](_0x1dd053[_0x2dad('0x23')],function(_0x5acfe0){return _0x5acfe0[_0x2dad('0x24')]==_0x4c46b4['id']&&_0x5acfe0[_0x2dad('0x25')]==_0xa7b9f0;});if(_0x5d4d37[_0x2dad('0x26')]==0x1){_0x343905(_0x4c46b4);}else{_0x3c1434(new RangeError('sessionId\x20'+_0xa7b9f0+'\x20not\x20found!'));}});});}exports[_0x2dad('0x27')]=function(_0x305d12,_0x353370){logger[_0x2dad('0x28')](_0x2dad('0x29'),_0x305d12['body']);var _0x3d1e69=originateValidation['validate'](_0x305d12[_0x2dad('0x2a')]);if(_0x3d1e69[_0x2dad('0x26')]>0x0){return _0x353370[_0x2dad('0x16')](0x190)[_0x2dad('0x2b')](_0x3d1e69);}var _0x35cf62=_0x305d12[_0x2dad('0x2a')][_0x2dad('0x2c')];var _0x37176c=_0x305d12[_0x2dad('0x2a')][_0x2dad('0x2d')];var _0x77af3b=_0x305d12[_0x2dad('0x2a')][_0x2dad('0x2e')];var _0x128a75=_0x305d12[_0x2dad('0x2a')][_0x2dad('0x2f')];return getAgent(_0x35cf62)[_0x2dad('0x19')](function(_0x347e76){logger['info'](_0x2dad('0x30'),_0x347e76['name']);emit(util[_0x2dad('0x31')](_0x2dad('0x32'),_0x347e76['name']),_0x2dad('0x33'),{'callNumber':_0x37176c,'callerId':_0x77af3b,'callbackUrl':_0x128a75});return _0x353370[_0x2dad('0x16')](0xc8)[_0x2dad('0x2b')]({'error':![],'message':_0x2dad('0x34')});})['catch'](handleError(_0x353370));};exports['hangup']=function(_0x38b285,_0x3b5e41){logger[_0x2dad('0x28')](_0x2dad('0x35'),_0x38b285[_0x2dad('0x2a')]);var _0x26c69c=hangupValidation['validate'](_0x38b285[_0x2dad('0x2a')]);if(_0x26c69c[_0x2dad('0x26')]>0x0){return _0x3b5e41[_0x2dad('0x16')](0x190)['json'](_0x26c69c);}var _0xae523f=_0x38b285[_0x2dad('0x2a')]['userId'];var _0xbdef8b=_0x38b285[_0x2dad('0x2a')][_0x2dad('0x25')];return getAgent(_0xae523f)[_0x2dad('0x19')](function(_0x54c327){logger[_0x2dad('0x28')](_0x2dad('0x30'),_0x54c327['name']);emit(util['format'](_0x2dad('0x32'),_0x54c327['name']),_0x2dad('0x36'),{'sessionId':_0xbdef8b});return _0x3b5e41[_0x2dad('0x16')](0xc8)['json']({'error':![],'message':'hangup\x20executed!'});})[_0x2dad('0x1d')](handleError(_0x3b5e41));};exports[_0x2dad('0x37')]=function(_0x4bf50a,_0x15ac17){logger[_0x2dad('0x28')]('answer\x20fired:',_0x4bf50a[_0x2dad('0x2a')]);var _0x5905f8=answerValidation[_0x2dad('0xa')](_0x4bf50a[_0x2dad('0x2a')]);if(_0x5905f8[_0x2dad('0x26')]>0x0){return _0x15ac17['status'](0x190)[_0x2dad('0x2b')](_0x5905f8);}var _0x300d0b=_0x4bf50a[_0x2dad('0x2a')][_0x2dad('0x2c')];var _0x5cb5f1=_0x4bf50a[_0x2dad('0x2a')][_0x2dad('0x25')];return getAgent(_0x300d0b)['then'](function(_0x442a13){logger['info']('entityFound:',_0x442a13[_0x2dad('0x15')]);emit(util[_0x2dad('0x31')](_0x2dad('0x32'),_0x442a13[_0x2dad('0x15')]),_0x2dad('0x38'),{'sessionId':_0x5cb5f1});return _0x15ac17[_0x2dad('0x16')](0xc8)[_0x2dad('0x2b')]({'error':![],'message':_0x2dad('0x39')});})['catch'](handleError(_0x15ac17));};exports[_0x2dad('0x3a')]=function(_0x18017a,_0x155f48){logger['info'](_0x2dad('0x3b'),_0x18017a[_0x2dad('0x2a')]);var _0x285934=holdValidation[_0x2dad('0xa')](_0x18017a[_0x2dad('0x2a')]);if(_0x285934['length']>0x0){return _0x155f48['status'](0x190)['json'](_0x285934);}var _0x59084c=_0x18017a[_0x2dad('0x2a')]['userId'];var _0x3fcd88=_0x18017a[_0x2dad('0x2a')][_0x2dad('0x25')];return getAgent(_0x59084c)[_0x2dad('0x19')](function(_0x44c295){logger['info'](_0x2dad('0x30'),_0x44c295[_0x2dad('0x15')]);emit(util[_0x2dad('0x31')](_0x2dad('0x32'),_0x44c295['name']),'webbar:hold',{'sessionId':_0x3fcd88});return _0x155f48[_0x2dad('0x16')](0xc8)['json']({'error':![],'message':_0x2dad('0x3c')});})[_0x2dad('0x1d')](handleError(_0x155f48));};exports['unhold']=function(_0x1bc98b,_0x54d139){logger[_0x2dad('0x28')]('unhold\x20fired:',_0x1bc98b['body']);var _0x35aca1=unholdValidation[_0x2dad('0xa')](_0x1bc98b['body']);if(_0x35aca1[_0x2dad('0x26')]>0x0){return _0x54d139[_0x2dad('0x16')](0x190)[_0x2dad('0x2b')](_0x35aca1);}var _0x26620f=_0x1bc98b['body']['userId'];var _0xbb93bd=_0x1bc98b['body'][_0x2dad('0x25')];return getAgent(_0x26620f)[_0x2dad('0x19')](function(_0x37ff75){logger[_0x2dad('0x28')](_0x2dad('0x30'),_0x37ff75[_0x2dad('0x15')]);emit(util[_0x2dad('0x31')](_0x2dad('0x32'),_0x37ff75['name']),_0x2dad('0x3d'),{'sessionId':_0xbb93bd});return _0x54d139[_0x2dad('0x16')](0xc8)['json']({'error':![],'message':_0x2dad('0x3e')});})[_0x2dad('0x1d')](handleError(_0x54d139));};exports[_0x2dad('0x3f')]=function(_0x1fb14b,_0x2e48e3){logger[_0x2dad('0x28')](_0x2dad('0x40'),_0x2e48e3[_0x2dad('0x2a')]);var _0x3b6c3d=callsValidation[_0x2dad('0xa')](_0x1fb14b[_0x2dad('0x2a')]);if(_0x3b6c3d[_0x2dad('0x26')]>0x0){return _0x2e48e3['status'](0x190)[_0x2dad('0x2b')](_0x3b6c3d);}var _0x20b3a2=_0x1fb14b[_0x2dad('0x2a')][_0x2dad('0x2c')];var _0x1001c1=respondWithRpcPromise(_0x2dad('0x20'));var _0x315ba0=getAgent(_0x20b3a2);return Promise['all']([_0x1001c1,_0x315ba0])[_0x2dad('0x19')](function(_0x5d7778){var _0x66da4d=_0x5d7778[0x0];var _0x40f6ee=_0x5d7778[0x1];var _0x3a3c94=_[_0x2dad('0x22')](_0x66da4d[_0x2dad('0x23')],function(_0x29c810){return _0x29c810[_0x2dad('0x24')]==_0x40f6ee['id'];});return _0x2e48e3[_0x2dad('0x16')](0xc8)[_0x2dad('0x2b')]({'count':_0x3a3c94[_0x2dad('0x26')],'rows':_0x3a3c94});})[_0x2dad('0x1d')](handleError(_0x2e48e3));};exports[_0x2dad('0x41')]=function(_0x4c2ff1,_0x1a7628){logger[_0x2dad('0x28')](_0x2dad('0x42'),_0x4c2ff1[_0x2dad('0x2a')]);var _0x390be0=conferenceValidation[_0x2dad('0xa')](_0x4c2ff1[_0x2dad('0x2a')]);if(_0x390be0[_0x2dad('0x26')]>0x0){return _0x1a7628['status'](0x190)[_0x2dad('0x2b')](_0x390be0);}var _0x3b4ccb=_0x4c2ff1[_0x2dad('0x2a')][_0x2dad('0x2c')];return getAgent(_0x3b4ccb)['then'](function(_0x106c45){logger[_0x2dad('0x28')](_0x2dad('0x30'),_0x106c45[_0x2dad('0x15')]);emit(util[_0x2dad('0x31')](_0x2dad('0x32'),_0x106c45[_0x2dad('0x15')]),'webbar:conference');return _0x1a7628['status'](0xc8)[_0x2dad('0x2b')]({'error':![],'message':_0x2dad('0x43')});})[_0x2dad('0x1d')](handleError(_0x1a7628));};exports['transfer']=function(_0x14983b,_0x401f70){logger[_0x2dad('0x28')](_0x2dad('0x44'),_0x14983b['body']);var _0x3c03b2=transferValidation[_0x2dad('0xa')](_0x14983b[_0x2dad('0x2a')]);if(_0x3c03b2[_0x2dad('0x26')]>0x0){return _0x401f70['status'](0x190)[_0x2dad('0x2b')](_0x3c03b2);}var _0x4f306e=_0x14983b['body']['userId'];var _0x1e59a8=_0x14983b[_0x2dad('0x2a')][_0x2dad('0x25')];var _0x377b39=_0x14983b[_0x2dad('0x2a')][_0x2dad('0x45')];return getAgent(_0x4f306e)['then'](function(_0x36101b){logger[_0x2dad('0x28')](_0x2dad('0x30'),_0x36101b['name']);emit(util[_0x2dad('0x31')]('user:%s',_0x36101b['name']),'webbar:transfer',{'sessionId':_0x1e59a8,'transferNumber':_0x377b39});return _0x401f70[_0x2dad('0x16')](0xc8)[_0x2dad('0x2b')]({'error':![],'message':_0x2dad('0x46')});})[_0x2dad('0x1d')](handleError(_0x401f70));}; \ No newline at end of file +var _0x9c48=['webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','json','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','info','stringify','emit','log','handleError:','error','name','send','then','code','message','result','catch','User','findOne','agent','VoiceChannels','filter','rows','UserId','sessionId','originate','originate\x20fired:','body','length','status','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s'];(function(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0x9c48,0xb1));var _0x89c4=function(_0x399d0c,_0x390299){_0x399d0c=_0x399d0c-0x0;var _0x199691=_0x9c48[_0x399d0c];return _0x199691;};'use strict';var path=require(_0x89c4('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x89c4('0x1'))['db'];var config=require(_0x89c4('0x2'));var util=require(_0x89c4('0x3'));var BPromise=require(_0x89c4('0x4'));var jayson=require(_0x89c4('0x5'));var amiClient=jayson[_0x89c4('0x6')][_0x89c4('0x7')]({'port':0x232a});var logger=require(_0x89c4('0x8'))(_0x89c4('0x9'));var Redis=require(_0x89c4('0xa'));config[_0x89c4('0xb')]=_[_0x89c4('0xc')](config[_0x89c4('0xb')],{'host':_0x89c4('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x89c4('0xb')]));var Schema=require(_0x89c4('0xe'));var originateValidation=new Schema({'userId':{'type':_0x89c4('0xf'),'required':[!![],_0x89c4('0x10')]},'callNumber':{'type':_0x89c4('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x89c4('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x89c4('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x89c4('0xf'),'required':[!![],_0x89c4('0x10')]},'sessionId':{'type':_0x89c4('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x89c4('0x10')]},'sessionId':{'type':_0x89c4('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x89c4('0x11'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x89c4('0xf'),'required':[!![],_0x89c4('0x10')]},'sessionId':{'type':_0x89c4('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x89c4('0xf'),'required':[!![],_0x89c4('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x89c4('0xf'),'required':[!![],_0x89c4('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x89c4('0xf'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x6f9159,_0x4e2097,_0x55a3a2){logger[_0x89c4('0x12')](_0x6f9159,_0x4e2097,JSON[_0x89c4('0x13')](_0x55a3a2));io['to'](_0x6f9159)[_0x89c4('0x14')](_0x4e2097,_0x55a3a2);}function handleError(_0xfad9ff){return function(_0x47276b){console[_0x89c4('0x15')](_0x89c4('0x16'),_0x47276b,_0x47276b instanceof RangeError);logger[_0x89c4('0x17')](_0x47276b['stack']);if(_0x47276b instanceof RangeError){if(_0x47276b[_0x89c4('0x18')]){delete _0x47276b[_0x89c4('0x18')];}_0xfad9ff['status'](0x194)[_0x89c4('0x19')](_0x47276b);}else{if(_0x47276b[_0x89c4('0x18')]){delete _0x47276b['name'];}_0xfad9ff['status'](0x1f4)[_0x89c4('0x19')](_0x47276b);}};}function checkError(){return function(_0x4ba3a8){if(!_0x4ba3a8){throw new RangeError('NotFound');}return _0x4ba3a8;};}function respondWithRpcPromise(_0x5ce126,_0x5bd254){return new BPromise(function(_0x2b0fe1,_0x468808){var _0x31e1c1=amiClient;return _0x31e1c1['request'](_0x5ce126,_0x5bd254)[_0x89c4('0x1a')](function(_0x4695b3){if(_0x4695b3['error']){if(_0x4695b3[_0x89c4('0x17')][_0x89c4('0x1b')]===0x1f4){return _0x468808(_0x4695b3[_0x89c4('0x17')][_0x89c4('0x1c')]);}return _0x2b0fe1(_0x4695b3[_0x89c4('0x17')][_0x89c4('0x1c')]);}else{_0x2b0fe1(_0x4695b3[_0x89c4('0x1d')]);}})[_0x89c4('0x1e')](function(_0x2fcd04){_0x468808(_0x2fcd04);});});}function getAgent(_0x37f836){return db[_0x89c4('0x1f')][_0x89c4('0x20')]({'where':{'id':_0x37f836,'role':_0x89c4('0x21')}})[_0x89c4('0x1a')](checkError());}function getAgentCheckSession(_0x338f57,_0x35f1a7){return new BPromise(function(_0x5b393a,_0x3dd289){var _0x1b9217=respondWithRpcPromise(_0x89c4('0x22'));var _0x4d7ee7=getAgent(_0x338f57);Promise['all']([_0x1b9217,_0x4d7ee7])['then'](function(_0x25ff07){var _0x34a0af=_0x25ff07[0x0];var _0x242bb4=_0x25ff07[0x1];var _0x25e43b=_[_0x89c4('0x23')](_0x34a0af[_0x89c4('0x24')],function(_0x22a961){return _0x22a961[_0x89c4('0x25')]==_0x242bb4['id']&&_0x22a961[_0x89c4('0x26')]==_0x35f1a7;});if(_0x25e43b['length']==0x1){_0x5b393a(_0x242bb4);}else{_0x3dd289(new RangeError('sessionId\x20'+_0x35f1a7+'\x20not\x20found!'));}});});}exports[_0x89c4('0x27')]=function(_0x4ddf9d,_0x16d50e){logger['info'](_0x89c4('0x28'),_0x4ddf9d[_0x89c4('0x29')]);var _0x5dd051=originateValidation[_0x89c4('0xe')](_0x4ddf9d[_0x89c4('0x29')]);if(_0x5dd051[_0x89c4('0x2a')]>0x0){return _0x16d50e[_0x89c4('0x2b')](0x190)['json'](_0x5dd051);}var _0x57fd7a=_0x4ddf9d['body'][_0x89c4('0x2c')];var _0xa3ddb4=_0x4ddf9d['body'][_0x89c4('0x2d')];var _0x160139=_0x4ddf9d[_0x89c4('0x29')][_0x89c4('0x2e')];var _0x5315ac=_0x4ddf9d['body'][_0x89c4('0x2f')];return getAgent(_0x57fd7a)['then'](function(_0x171a33){logger[_0x89c4('0x12')](_0x89c4('0x30'),_0x171a33[_0x89c4('0x18')]);emit(util[_0x89c4('0x31')](_0x89c4('0x32'),_0x171a33['name']),_0x89c4('0x33'),{'callNumber':_0xa3ddb4,'callerId':_0x160139,'callbackUrl':_0x5315ac});return _0x16d50e[_0x89c4('0x2b')](0xc8)['json']({'error':![],'message':_0x89c4('0x34')});})[_0x89c4('0x1e')](handleError(_0x16d50e));};exports[_0x89c4('0x35')]=function(_0x59a69b,_0x3d386d){logger['info'](_0x89c4('0x36'),_0x59a69b[_0x89c4('0x29')]);var _0x51e861=hangupValidation[_0x89c4('0xe')](_0x59a69b[_0x89c4('0x29')]);if(_0x51e861[_0x89c4('0x2a')]>0x0){return _0x3d386d[_0x89c4('0x2b')](0x190)[_0x89c4('0x37')](_0x51e861);}var _0x283ff6=_0x59a69b[_0x89c4('0x29')][_0x89c4('0x2c')];var _0x435acd=_0x59a69b['body'][_0x89c4('0x26')];return getAgent(_0x283ff6)[_0x89c4('0x1a')](function(_0x108188){logger[_0x89c4('0x12')](_0x89c4('0x30'),_0x108188[_0x89c4('0x18')]);emit(util[_0x89c4('0x31')]('user:%s',_0x108188[_0x89c4('0x18')]),'webbar:hangup',{'sessionId':_0x435acd});return _0x3d386d[_0x89c4('0x2b')](0xc8)[_0x89c4('0x37')]({'error':![],'message':_0x89c4('0x38')});})['catch'](handleError(_0x3d386d));};exports[_0x89c4('0x39')]=function(_0x50f461,_0xe17737){logger[_0x89c4('0x12')](_0x89c4('0x3a'),_0x50f461['body']);var _0x2f55d4=answerValidation[_0x89c4('0xe')](_0x50f461[_0x89c4('0x29')]);if(_0x2f55d4[_0x89c4('0x2a')]>0x0){return _0xe17737[_0x89c4('0x2b')](0x190)['json'](_0x2f55d4);}var _0x39d0af=_0x50f461['body'][_0x89c4('0x2c')];var _0x4e3aa8=_0x50f461[_0x89c4('0x29')][_0x89c4('0x26')];return getAgent(_0x39d0af)[_0x89c4('0x1a')](function(_0x486847){logger['info'](_0x89c4('0x30'),_0x486847['name']);emit(util[_0x89c4('0x31')]('user:%s',_0x486847['name']),_0x89c4('0x3b'),{'sessionId':_0x4e3aa8});return _0xe17737[_0x89c4('0x2b')](0xc8)[_0x89c4('0x37')]({'error':![],'message':'answer\x20executed!'});})[_0x89c4('0x1e')](handleError(_0xe17737));};exports[_0x89c4('0x3c')]=function(_0x4e1d85,_0x3bedcb){logger[_0x89c4('0x12')]('hold\x20fired:',_0x4e1d85['body']);var _0x5ef567=holdValidation[_0x89c4('0xe')](_0x4e1d85[_0x89c4('0x29')]);if(_0x5ef567[_0x89c4('0x2a')]>0x0){return _0x3bedcb['status'](0x190)[_0x89c4('0x37')](_0x5ef567);}var _0x298dce=_0x4e1d85[_0x89c4('0x29')]['userId'];var _0x5f19d8=_0x4e1d85[_0x89c4('0x29')]['sessionId'];return getAgent(_0x298dce)[_0x89c4('0x1a')](function(_0x2c91eb){logger[_0x89c4('0x12')](_0x89c4('0x30'),_0x2c91eb[_0x89c4('0x18')]);emit(util[_0x89c4('0x31')](_0x89c4('0x32'),_0x2c91eb[_0x89c4('0x18')]),_0x89c4('0x3d'),{'sessionId':_0x5f19d8});return _0x3bedcb[_0x89c4('0x2b')](0xc8)[_0x89c4('0x37')]({'error':![],'message':_0x89c4('0x3e')});})[_0x89c4('0x1e')](handleError(_0x3bedcb));};exports[_0x89c4('0x3f')]=function(_0x4b3e15,_0x2a9af3){logger[_0x89c4('0x12')](_0x89c4('0x40'),_0x4b3e15['body']);var _0x19e844=unholdValidation['validate'](_0x4b3e15[_0x89c4('0x29')]);if(_0x19e844[_0x89c4('0x2a')]>0x0){return _0x2a9af3[_0x89c4('0x2b')](0x190)[_0x89c4('0x37')](_0x19e844);}var _0x5d8d32=_0x4b3e15[_0x89c4('0x29')]['userId'];var _0x40e847=_0x4b3e15[_0x89c4('0x29')][_0x89c4('0x26')];return getAgent(_0x5d8d32)[_0x89c4('0x1a')](function(_0x3df021){logger[_0x89c4('0x12')](_0x89c4('0x30'),_0x3df021[_0x89c4('0x18')]);emit(util[_0x89c4('0x31')](_0x89c4('0x32'),_0x3df021[_0x89c4('0x18')]),_0x89c4('0x41'),{'sessionId':_0x40e847});return _0x2a9af3['status'](0xc8)[_0x89c4('0x37')]({'error':![],'message':_0x89c4('0x42')});})['catch'](handleError(_0x2a9af3));};exports[_0x89c4('0x43')]=function(_0x13affc,_0x241a58){logger['info']('calls\x20fired:',_0x241a58[_0x89c4('0x29')]);var _0x78d73c=callsValidation[_0x89c4('0xe')](_0x13affc[_0x89c4('0x29')]);if(_0x78d73c[_0x89c4('0x2a')]>0x0){return _0x241a58[_0x89c4('0x2b')](0x190)[_0x89c4('0x37')](_0x78d73c);}var _0x371492=_0x13affc[_0x89c4('0x29')][_0x89c4('0x2c')];var _0x3969a7=respondWithRpcPromise('VoiceChannels');var _0x56269d=getAgent(_0x371492);return Promise['all']([_0x3969a7,_0x56269d])['then'](function(_0x19789d){var _0x3df244=_0x19789d[0x0];var _0x2910af=_0x19789d[0x1];var _0x7a60e0=_[_0x89c4('0x23')](_0x3df244['rows'],function(_0x3e221c){return _0x3e221c[_0x89c4('0x25')]==_0x2910af['id'];});return _0x241a58['status'](0xc8)[_0x89c4('0x37')]({'count':_0x7a60e0[_0x89c4('0x2a')],'rows':_0x7a60e0});})['catch'](handleError(_0x241a58));};exports['conference']=function(_0x4ffbf9,_0x51a060){logger['info'](_0x89c4('0x44'),_0x4ffbf9[_0x89c4('0x29')]);var _0x19add6=conferenceValidation['validate'](_0x4ffbf9['body']);if(_0x19add6[_0x89c4('0x2a')]>0x0){return _0x51a060[_0x89c4('0x2b')](0x190)['json'](_0x19add6);}var _0x5cd861=_0x4ffbf9[_0x89c4('0x29')]['userId'];return getAgent(_0x5cd861)['then'](function(_0x339223){logger[_0x89c4('0x12')](_0x89c4('0x30'),_0x339223[_0x89c4('0x18')]);emit(util[_0x89c4('0x31')](_0x89c4('0x32'),_0x339223['name']),_0x89c4('0x45'));return _0x51a060[_0x89c4('0x2b')](0xc8)[_0x89c4('0x37')]({'error':![],'message':_0x89c4('0x46')});})[_0x89c4('0x1e')](handleError(_0x51a060));};exports[_0x89c4('0x47')]=function(_0x242a21,_0x1a0e3d){logger['info'](_0x89c4('0x48'),_0x242a21[_0x89c4('0x29')]);var _0x21ed54=transferValidation[_0x89c4('0xe')](_0x242a21['body']);if(_0x21ed54['length']>0x0){return _0x1a0e3d[_0x89c4('0x2b')](0x190)['json'](_0x21ed54);}var _0x54d5fa=_0x242a21['body'][_0x89c4('0x2c')];var _0x403295=_0x242a21[_0x89c4('0x29')][_0x89c4('0x26')];var _0x45d23b=_0x242a21[_0x89c4('0x29')][_0x89c4('0x49')];return getAgent(_0x54d5fa)[_0x89c4('0x1a')](function(_0x325e85){logger[_0x89c4('0x12')](_0x89c4('0x30'),_0x325e85[_0x89c4('0x18')]);emit(util[_0x89c4('0x31')](_0x89c4('0x32'),_0x325e85[_0x89c4('0x18')]),_0x89c4('0x4a'),{'sessionId':_0x403295,'transferNumber':_0x45d23b});return _0x1a0e3d[_0x89c4('0x2b')](0xc8)[_0x89c4('0x37')]({'error':![],'message':_0x89c4('0x4b')});})['catch'](handleError(_0x1a0e3d));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index b14a3b0..5e3c6e9 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 _0xa784=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getAgents','/:id/applications','getApplications','post','/:id/dispositions','addDisposition','addAnswer','/:id/users','addAgents','notify','send','put','update','delete','destroy','removeDispositions','removeAgents','exports'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xa784,0xb9));var _0x4a78=function(_0x4c99ee,_0x2d8768){_0x4c99ee=_0x4c99ee-0x0;var _0x24bc5f=_0xa784[_0x4c99ee];return _0x24bc5f;};'use strict';var multer=require(_0x4a78('0x0'));var util=require('util');var path=require(_0x4a78('0x1'));var timeout=require(_0x4a78('0x2'));var express=require(_0x4a78('0x3'));var router=express[_0x4a78('0x4')]();var fs_extra=require(_0x4a78('0x5'));var auth=require(_0x4a78('0x6'));var interaction=require(_0x4a78('0x7'));var config=require(_0x4a78('0x8'));var controller=require('./whatsappAccount.controller');router[_0x4a78('0x9')]('/',auth[_0x4a78('0xa')](),controller[_0x4a78('0xb')]);router[_0x4a78('0x9')](_0x4a78('0xc'),auth[_0x4a78('0xa')](),controller[_0x4a78('0xd')]);router[_0x4a78('0x9')](_0x4a78('0xe'),auth[_0x4a78('0xa')](),controller[_0x4a78('0xf')]);router[_0x4a78('0x9')]('/:id/dispositions',auth[_0x4a78('0xa')](),controller[_0x4a78('0x10')]);router[_0x4a78('0x9')](_0x4a78('0x11'),auth['isAuthenticated'](),controller[_0x4a78('0x12')]);router[_0x4a78('0x9')]('/:id/users',auth[_0x4a78('0xa')](),controller[_0x4a78('0x13')]);router[_0x4a78('0x9')](_0x4a78('0x14'),auth[_0x4a78('0xa')](),controller[_0x4a78('0x15')]);router[_0x4a78('0x16')]('/',auth[_0x4a78('0xa')](),controller['create']);router['post'](_0x4a78('0x17'),auth['isAuthenticated'](),controller[_0x4a78('0x18')]);router['post'](_0x4a78('0x11'),auth[_0x4a78('0xa')](),controller[_0x4a78('0x19')]);router['post'](_0x4a78('0x1a'),auth[_0x4a78('0xa')](),controller[_0x4a78('0x1b')]);router[_0x4a78('0x16')](_0x4a78('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0x4a78('0x16')]('/:id/notify',controller[_0x4a78('0x1c')]);router[_0x4a78('0x16')]('/:id/send',auth[_0x4a78('0xa')](),controller[_0x4a78('0x1d')]);router[_0x4a78('0x1e')]('/:id',auth[_0x4a78('0xa')](),controller[_0x4a78('0x1f')]);router[_0x4a78('0x20')](_0x4a78('0xe'),auth[_0x4a78('0xa')](),controller[_0x4a78('0x21')]);router[_0x4a78('0x20')](_0x4a78('0x17'),auth[_0x4a78('0xa')](),controller[_0x4a78('0x22')]);router['delete'](_0x4a78('0x11'),auth[_0x4a78('0xa')](),controller['removeAnswers']);router[_0x4a78('0x20')](_0x4a78('0x1a'),auth[_0x4a78('0xa')](),controller[_0x4a78('0x23')]);module[_0x4a78('0x24')]=router; \ No newline at end of file +var _0x45de=['/:id/notify','/:id/send','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addAgents','addApplications'];(function(_0x1192d9,_0x313474){var _0x282d50=function(_0x3bb324){while(--_0x3bb324){_0x1192d9['push'](_0x1192d9['shift']());}};_0x282d50(++_0x313474);}(_0x45de,0x6e));var _0xe45d=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x45de[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0xe45d('0x0'));var util=require(_0xe45d('0x1'));var path=require('path');var timeout=require(_0xe45d('0x2'));var express=require('express');var router=express[_0xe45d('0x3')]();var fs_extra=require(_0xe45d('0x4'));var auth=require(_0xe45d('0x5'));var interaction=require(_0xe45d('0x6'));var config=require(_0xe45d('0x7'));var controller=require(_0xe45d('0x8'));router[_0xe45d('0x9')]('/',auth[_0xe45d('0xa')](),controller[_0xe45d('0xb')]);router['get'](_0xe45d('0xc'),auth[_0xe45d('0xa')](),controller[_0xe45d('0xd')]);router[_0xe45d('0x9')](_0xe45d('0xe'),auth[_0xe45d('0xa')](),controller[_0xe45d('0xf')]);router[_0xe45d('0x9')](_0xe45d('0x10'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xe45d('0x9')](_0xe45d('0x11'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xe45d('0x12'),auth[_0xe45d('0xa')](),controller[_0xe45d('0x13')]);router['get'](_0xe45d('0x14'),auth[_0xe45d('0xa')](),controller[_0xe45d('0x15')]);router[_0xe45d('0x16')]('/',auth['isAuthenticated'](),controller[_0xe45d('0x17')]);router['post'](_0xe45d('0x10'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xe45d('0x16')](_0xe45d('0x11'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xe45d('0x16')]('/:id/users',auth[_0xe45d('0xa')](),controller[_0xe45d('0x18')]);router[_0xe45d('0x16')](_0xe45d('0x14'),auth[_0xe45d('0xa')](),controller[_0xe45d('0x19')]);router[_0xe45d('0x16')](_0xe45d('0x1a'),controller['notify']);router[_0xe45d('0x16')](_0xe45d('0x1b'),auth[_0xe45d('0xa')](),controller['send']);router[_0xe45d('0x1c')](_0xe45d('0xe'),auth[_0xe45d('0xa')](),controller[_0xe45d('0x1d')]);router[_0xe45d('0x1e')](_0xe45d('0xe'),auth[_0xe45d('0xa')](),controller['destroy']);router[_0xe45d('0x1e')](_0xe45d('0x10'),auth[_0xe45d('0xa')](),controller[_0xe45d('0x1f')]);router[_0xe45d('0x1e')](_0xe45d('0x11'),auth[_0xe45d('0xa')](),controller[_0xe45d('0x20')]);router[_0xe45d('0x1e')]('/:id/users',auth[_0xe45d('0xa')](),controller['removeAgents']);module[_0xe45d('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index ec70c53..a054e5b 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 _0xe1e1=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','name','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x3df4de,_0x4c86ab){var _0x26ac7e=function(_0x53d47b){while(--_0x53d47b){_0x3df4de['push'](_0x3df4de['shift']());}};_0x26ac7e(++_0x4c86ab);}(_0xe1e1,0x1cd));var _0x1e1e=function(_0x5d9d28,_0x2ea831){_0x5d9d28=_0x5d9d28-0x0;var _0xfb75d3=_0xe1e1[_0x5d9d28];return _0xfb75d3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1e1e('0x0'));module['exports']={'name':{'type':Sequelize[_0x1e1e('0x1')],'unique':_0x1e1e('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x1e1e('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x1e1e('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x1e1e('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x1e1e('0x1')]},'type':{'type':Sequelize[_0x1e1e('0x3')](_0x1e1e('0x4'))},'accountSid':{'type':Sequelize[_0x1e1e('0x1')]},'authToken':{'type':Sequelize[_0x1e1e('0x1')]},'notificationTemplate':{'type':Sequelize[_0x1e1e('0x5')],'defaultValue':function(){return _0x1e1e('0x6');}},'notificationSound':{'type':Sequelize[_0x1e1e('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1e1e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1e1e('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1e1e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1e1e('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1e1e('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1e1e('0x7')],'defaultValue':![],'comment':_0x1e1e('0x9'),'set':function(_0x39484a){if(!_0x39484a){this[_0x1e1e('0xa')](_0x1e1e('0xb'),null);}this[_0x1e1e('0xa')](_0x1e1e('0xc'),_0x39484a);}},'description':{'type':Sequelize[_0x1e1e('0x1')]}}; \ No newline at end of file +var _0xf4bf=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf4bf,0xb8));var _0xff4b=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0xf4bf[_0x101802];return _0x5d61ce;};'use strict';var Sequelize=require(_0xff4b('0x0'));var rs=require(_0xff4b('0x1'));module[_0xff4b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xff4b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xff4b('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xff4b('0x4')],'defaultValue':function(){return rs[_0xff4b('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xff4b('0x6')](_0xff4b('0x7'))},'accountSid':{'type':Sequelize[_0xff4b('0x4')]},'authToken':{'type':Sequelize[_0xff4b('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xff4b('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xff4b('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xff4b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xff4b('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xff4b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xff4b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xff4b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xff4b('0x9')],'comment':_0xff4b('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xff4b('0xb'),'set':function(_0x41bf24){if(!_0x41bf24){this[_0xff4b('0xc')]('mandatoryDispositionPauseId',null);}this[_0xff4b('0xc')]('mandatoryDisposition',_0x41bf24);}},'description':{'type':Sequelize[_0xff4b('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index a70ab6e..45afec6 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 _0x4975=['save','update','destroy','then','get','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','filters','filter','where','merge','options','includeAll','findAll','rows','show','params','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','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','whatsapp','Applications','account','asc','CmContact','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','mobile','type','from','replace','whatsapp:','messageId','MessageSid','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','contact','WhatsappInteraction','spread','interaction','created','autoclose','applications','close','*,*,*,*','WhatsappMessage','ContactId','UserId','unshift','agent','Start','receiveMessage','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','\x0a','json','body\x20is\x20mandatory\x20and\x20not\x20empty','List','out','Messages','push','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','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','set','Content-Range','apply','reject'];(function(_0x339122,_0x33f9f1){var _0x4912d7=function(_0x2e2532){while(--_0x2e2532){_0x339122['push'](_0x339122['shift']());}};_0x4912d7(++_0x33f9f1);}(_0x4975,0x86));var _0x5497=function(_0x4f7952,_0x41f217){_0x4f7952=_0x4f7952-0x0;var _0x3048eb=_0x4975[_0x4f7952];return _0x3048eb;};'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'];config[_0x5497('0x18')]=_[_0x5497('0x19')](config[_0x5497('0x18')],{'host':_0x5497('0x1a'),'port':0x18eb});var socket=require(_0x5497('0x1b'))(new Redis(config[_0x5497('0x18')]));require(_0x5497('0x1c'))[_0x5497('0x1d')](socket);var jayson=require(_0x5497('0x1e'));var client=jayson['client'][_0x5497('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x4fb8e9,_0x4237a9,_0x2bfd8a,_0x19e5f3){return new BPromise(function(_0x3ce50b,_0x37c18e){var _0x4073e6=_0x19e5f3||client;return _0x4073e6[_0x5497('0x20')](_0x4fb8e9,_0x2bfd8a)['then'](function(_0x56a788){logger[_0x5497('0x21')](_0x5497('0x22'),_0x4237a9,_0x5497('0x23'));logger['debug'](_0x5497('0x24'),_0x4237a9,_0x5497('0x23'),JSON[_0x5497('0x25')](_0x56a788));if(_0x56a788[_0x5497('0x26')]){if(_0x56a788[_0x5497('0x26')][_0x5497('0x27')]===0x1f4){logger[_0x5497('0x26')](_0x5497('0x22'),_0x4237a9,_0x56a788[_0x5497('0x26')][_0x5497('0x28')]);return _0x37c18e(_0x56a788[_0x5497('0x26')]['message']);}logger[_0x5497('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x4237a9,_0x56a788[_0x5497('0x26')][_0x5497('0x28')]);return _0x3ce50b(_0x56a788[_0x5497('0x26')][_0x5497('0x28')]);}else{logger[_0x5497('0x21')](_0x5497('0x22'),_0x4237a9,'request\x20sent');_0x3ce50b(_0x56a788['result'][_0x5497('0x28')]);}})[_0x5497('0x29')](function(_0x24482a){logger[_0x5497('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x4237a9,_0x24482a);_0x37c18e(_0x24482a);});});}function respondWithStatusCode(_0x13b7a4,_0x57268c){_0x57268c=_0x57268c||0xcc;return function(_0x1f3198){if(_0x1f3198){return _0x13b7a4[_0x5497('0x2a')](_0x57268c);}return _0x13b7a4[_0x5497('0x2b')](_0x57268c)[_0x5497('0x2c')]();};}function respondWithResult(_0x163a30,_0x31cd01){_0x31cd01=_0x31cd01||0xc8;return function(_0x48b835){if(_0x48b835){return _0x163a30[_0x5497('0x2b')](_0x31cd01)['json'](_0x48b835);}};}function respondWithFilteredResult(_0x583d06,_0x498f15){return function(_0x39a2b7){if(_0x39a2b7){var _0x48d146=_0x39a2b7[_0x5497('0x2d')],_0x5e9356=_0x498f15['offset'],_0xc3465=_0x498f15['offset']+_0x498f15['limit'],_0xb14593;if(_0xc3465>=_0x48d146){_0xc3465=_0x48d146;_0xb14593=0xc8;}else{_0xb14593=0xce;}_0x583d06[_0x5497('0x2b')](_0xb14593);return _0x583d06[_0x5497('0x2e')](_0x5497('0x2f'),_0x5e9356+'-'+_0xc3465+'/'+_0x48d146)['json'](_0x39a2b7);}return null;};}function patchUpdates(_0x489f71){return function(_0x594866){try{jsonpatch[_0x5497('0x30')](_0x594866,_0x489f71,!![]);}catch(_0x572460){return BPromise[_0x5497('0x31')](_0x572460);}return _0x594866[_0x5497('0x32')]();};}function saveUpdates(_0x77c575,_0x4d05c4){return function(_0x1d208f){if(_0x1d208f){return _0x1d208f[_0x5497('0x33')](_0x77c575)['then'](function(_0xce7cb2){return _0xce7cb2;});}return null;};}function removeEntity(_0xce2e81,_0x331dfc){return function(_0x489fbd){if(_0x489fbd){return _0x489fbd[_0x5497('0x34')]()[_0x5497('0x35')](function(){var _0x125d51=_0x489fbd[_0x5497('0x36')]({'plain':!![]});var _0x412f5b='WhatsappAccounts';return db[_0x5497('0x37')][_0x5497('0x34')]({'where':{'type':_0x412f5b,'resourceId':_0x125d51['id']}})['then'](function(){return _0x489fbd;});})[_0x5497('0x35')](function(){_0xce2e81[_0x5497('0x2b')](0xcc)[_0x5497('0x2c')]();});}};}function handleEntityNotFound(_0x1b9cd8,_0x1656c7){return function(_0x37011c){if(!_0x37011c){_0x1b9cd8['sendStatus'](0x194);}return _0x37011c;};}function handleError(_0x14314d,_0x5b3990){_0x5b3990=_0x5b3990||0x1f4;return function(_0x7880e4){logger[_0x5497('0x26')](_0x7880e4[_0x5497('0x38')]);if(_0x7880e4['name']){delete _0x7880e4['name'];}_0x14314d[_0x5497('0x2b')](_0x5b3990)[_0x5497('0x39')](_0x7880e4);};}exports[_0x5497('0x3a')]=function(_0x429cbf,_0x43d15f){var _0xc8a689={'include':[{'model':db[_0x5497('0x3b')],'as':_0x5497('0x3c')}]},_0x4f53c1={},_0x2c5c3a={'count':0x0,'rows':[]};var _0x2bd07a=_[_0x5497('0x3d')](db[_0x5497('0x3e')][_0x5497('0x3f')],function(_0x179635){return{'name':_0x179635[_0x5497('0x40')],'type':_0x179635['type'][_0x5497('0x41')]};});_0x4f53c1[_0x5497('0x42')]=_[_0x5497('0x3d')](_0x2bd07a,_0x5497('0x43'));_0x4f53c1[_0x5497('0x44')]=_[_0x5497('0x45')](_0x429cbf[_0x5497('0x44')]);_0x4f53c1['filters']=_[_0x5497('0x46')](_0x4f53c1[_0x5497('0x42')],_0x4f53c1[_0x5497('0x44')]);_0xc8a689[_0x5497('0x47')]=_[_0x5497('0x46')](_0x4f53c1[_0x5497('0x42')],qs[_0x5497('0x48')](_0x429cbf['query'][_0x5497('0x48')]));_0xc8a689[_0x5497('0x47')]=_0xc8a689[_0x5497('0x47')][_0x5497('0x49')]?_0xc8a689[_0x5497('0x47')]:_0x4f53c1[_0x5497('0x42')];if(!_0x429cbf[_0x5497('0x44')][_0x5497('0x4a')](_0x5497('0x4b'))){_0xc8a689[_0x5497('0x4c')]=qs['limit'](_0x429cbf[_0x5497('0x44')]['limit']);_0xc8a689[_0x5497('0x4d')]=qs[_0x5497('0x4d')](_0x429cbf[_0x5497('0x44')][_0x5497('0x4d')]);}_0xc8a689[_0x5497('0x4e')]=qs['sort'](_0x429cbf[_0x5497('0x44')][_0x5497('0x4f')]);_0xc8a689['where']=qs[_0x5497('0x50')](_['pick'](_0x429cbf[_0x5497('0x44')],_0x4f53c1['filters']),_0x2bd07a);if(_0x429cbf[_0x5497('0x44')][_0x5497('0x51')]){_0xc8a689[_0x5497('0x52')]=_[_0x5497('0x53')](_0xc8a689[_0x5497('0x52')],{'$or':_['map'](_0x2bd07a,function(_0x495068){if(_0x495068['type']!=='VIRTUAL'){var _0x3cbe4b={};_0x3cbe4b[_0x495068[_0x5497('0x43')]]={'$like':'%'+_0x429cbf[_0x5497('0x44')][_0x5497('0x51')]+'%'};return _0x3cbe4b;}})});}_0xc8a689=_[_0x5497('0x53')]({},_0xc8a689,_0x429cbf[_0x5497('0x54')]);var _0xc78abe={'where':_0xc8a689[_0x5497('0x52')]};return db[_0x5497('0x3e')]['count'](_0xc78abe)[_0x5497('0x35')](function(_0x18db5b){_0x2c5c3a[_0x5497('0x2d')]=_0x18db5b;if(_0x429cbf['query'][_0x5497('0x55')]){_0xc8a689['include']=[{'all':!![]}];}return db[_0x5497('0x3e')][_0x5497('0x56')](_0xc8a689);})[_0x5497('0x35')](function(_0x5580cf){_0x2c5c3a[_0x5497('0x57')]=_0x5580cf;return _0x2c5c3a;})[_0x5497('0x35')](respondWithFilteredResult(_0x43d15f,_0xc8a689))['catch'](handleError(_0x43d15f,null));};exports[_0x5497('0x58')]=function(_0x4f7781,_0x3fc36b){var _0x5a7880={'raw':![],'where':{'id':_0x4f7781[_0x5497('0x59')]['id']},'include':[{'model':db[_0x5497('0x3b')],'as':_0x5497('0x3c')}]},_0x416f76={};_0x416f76[_0x5497('0x42')]=_[_0x5497('0x45')](db[_0x5497('0x3e')][_0x5497('0x3f')]);_0x416f76['query']=_[_0x5497('0x45')](_0x4f7781['query']);_0x416f76['filters']=_[_0x5497('0x46')](_0x416f76[_0x5497('0x42')],_0x416f76['query']);_0x5a7880[_0x5497('0x47')]=_[_0x5497('0x46')](_0x416f76[_0x5497('0x42')],qs[_0x5497('0x48')](_0x4f7781['query'][_0x5497('0x48')]));_0x5a7880['attributes']=_0x5a7880['attributes'][_0x5497('0x49')]?_0x5a7880[_0x5497('0x47')]:_0x416f76[_0x5497('0x42')];if(_0x4f7781['query']['includeAll']){_0x5a7880[_0x5497('0x5a')]=[{'all':!![]}];}_0x5a7880=_['merge']({},_0x5a7880,_0x4f7781[_0x5497('0x54')]);return db['WhatsappAccount'][_0x5497('0x5b')](_0x5a7880)['then'](handleEntityNotFound(_0x3fc36b,null))[_0x5497('0x35')](respondWithResult(_0x3fc36b,null))[_0x5497('0x29')](handleError(_0x3fc36b,null));};exports['create']=function(_0x418f17,_0x5dccfb){return db['WhatsappAccount'][_0x5497('0x5c')](_0x418f17[_0x5497('0x5d')],{})['then'](function(_0x37336a){var _0x4be39e=_0x418f17[_0x5497('0x5e')][_0x5497('0x36')]({'plain':!![]});if(!_0x4be39e)throw new Error(_0x5497('0x5f'));if(_0x4be39e[_0x5497('0x60')]==='user'){var _0x215ea8=_0x37336a['get']({'plain':!![]});var _0x4e0d4c='WhatsappAccounts';return db[_0x5497('0x61')][_0x5497('0x5b')]({'where':{'name':_0x4e0d4c,'userProfileId':_0x4be39e[_0x5497('0x62')]},'raw':!![]})['then'](function(_0x53eafd){if(_0x53eafd&&_0x53eafd['autoAssociation']===0x0){return db['UserProfileResource'][_0x5497('0x5c')]({'name':_0x215ea8[_0x5497('0x43')],'resourceId':_0x215ea8['id'],'type':_0x53eafd[_0x5497('0x43')],'sectionId':_0x53eafd['id']},{})[_0x5497('0x35')](function(){return _0x37336a;});}else{return _0x37336a;}})[_0x5497('0x29')](function(_0x45e622){logger['error'](_0x5497('0x63'),_0x45e622);throw _0x45e622;});}return _0x37336a;})[_0x5497('0x35')](respondWithResult(_0x5dccfb,0xc9))[_0x5497('0x29')](handleError(_0x5dccfb,null));};exports[_0x5497('0x33')]=function(_0x4b86a8,_0x179be4){if(_0x4b86a8[_0x5497('0x5d')]['id']){delete _0x4b86a8[_0x5497('0x5d')]['id'];}return db[_0x5497('0x3e')]['find']({'where':{'id':_0x4b86a8[_0x5497('0x59')]['id']},'include':[{'model':db[_0x5497('0x3b')],'as':_0x5497('0x3c')}]})['then'](handleEntityNotFound(_0x179be4,null))[_0x5497('0x35')](saveUpdates(_0x4b86a8['body'],null))['then'](respondWithResult(_0x179be4,null))['catch'](handleError(_0x179be4,null));};exports[_0x5497('0x34')]=function(_0x1ca4d8,_0x1e01a7){return db['WhatsappAccount'][_0x5497('0x5b')]({'where':{'id':_0x1ca4d8[_0x5497('0x59')]['id']}})[_0x5497('0x35')](handleEntityNotFound(_0x1e01a7,null))[_0x5497('0x35')](removeEntity(_0x1e01a7,null))['catch'](handleError(_0x1e01a7,null));};exports[_0x5497('0x64')]=function(_0x43b681,_0x27ab5b){return db['WhatsappAccount'][_0x5497('0x64')]()[_0x5497('0x35')](respondWithResult(_0x27ab5b,null))[_0x5497('0x29')](handleError(_0x27ab5b,null));};exports[_0x5497('0x65')]=function(_0x1467c4,_0xcd2175,_0x15c05b){if(_0x1467c4['body']['id']){delete _0x1467c4[_0x5497('0x5d')]['id'];}return db[_0x5497('0x3e')][_0x5497('0x5b')]({'where':{'id':_0x1467c4[_0x5497('0x59')]['id']}})['then'](handleEntityNotFound(_0xcd2175,null))['then'](function(_0x4a7360){if(_0x4a7360){_0x1467c4[_0x5497('0x5d')][_0x5497('0x66')]=_0x4a7360['id'];return db[_0x5497('0x67')]['create'](_0x1467c4[_0x5497('0x5d')]);}})[_0x5497('0x35')](respondWithResult(_0xcd2175,null))[_0x5497('0x29')](handleError(_0xcd2175,null));};exports[_0x5497('0x68')]=function(_0x3e92fb,_0x4338d4,_0x3f38bf){var _0x23bd32={'raw':![],'where':{}};var _0x21da3d={};var _0x940188={'count':0x0,'rows':[]};return db[_0x5497('0x3e')]['findOne']({'where':{'id':_0x3e92fb[_0x5497('0x59')]['id']}})[_0x5497('0x35')](handleEntityNotFound(_0x4338d4,null))[_0x5497('0x35')](function(_0x4ef195){if(_0x4ef195){_0x21da3d[_0x5497('0x42')]=_['keys'](db[_0x5497('0x67')][_0x5497('0x3f')]);_0x21da3d['query']=_[_0x5497('0x45')](_0x3e92fb[_0x5497('0x44')]);_0x21da3d[_0x5497('0x50')]=_[_0x5497('0x46')](_0x21da3d['model'],_0x21da3d[_0x5497('0x44')]);_0x23bd32[_0x5497('0x47')]=_[_0x5497('0x46')](_0x21da3d['model'],qs[_0x5497('0x48')](_0x3e92fb[_0x5497('0x44')]['fields']));_0x23bd32[_0x5497('0x47')]=_0x23bd32[_0x5497('0x47')][_0x5497('0x49')]?_0x23bd32['attributes']:_0x21da3d['model'];if(!_0x3e92fb[_0x5497('0x44')][_0x5497('0x4a')](_0x5497('0x4b'))){_0x23bd32[_0x5497('0x4c')]=qs[_0x5497('0x4c')](_0x3e92fb[_0x5497('0x44')][_0x5497('0x4c')]);_0x23bd32['offset']=qs['offset'](_0x3e92fb[_0x5497('0x44')][_0x5497('0x4d')]);}_0x23bd32['order']=qs[_0x5497('0x4f')](_0x3e92fb[_0x5497('0x44')][_0x5497('0x4f')]);_0x23bd32['where']=qs[_0x5497('0x50')](_[_0x5497('0x69')](_0x3e92fb['query'],_0x21da3d[_0x5497('0x50')]));_0x23bd32[_0x5497('0x52')][_0x5497('0x66')]=_0x4ef195['id'];if(_0x3e92fb[_0x5497('0x44')][_0x5497('0x51')]){_0x23bd32['where']=_[_0x5497('0x53')](_0x23bd32[_0x5497('0x52')],{'$or':_[_0x5497('0x3d')](_0x23bd32[_0x5497('0x47')],function(_0xd38364){var _0x503a51={};_0x503a51[_0xd38364]={'$like':'%'+_0x3e92fb[_0x5497('0x44')][_0x5497('0x51')]+'%'};return _0x503a51;})});}_0x23bd32=_[_0x5497('0x53')]({},_0x23bd32,_0x3e92fb[_0x5497('0x54')]);return db['Disposition'][_0x5497('0x2d')]({'where':_0x23bd32[_0x5497('0x52')]})['then'](function(_0xb72eed){_0x940188[_0x5497('0x2d')]=_0xb72eed;if(_0x3e92fb[_0x5497('0x44')][_0x5497('0x55')]){_0x23bd32['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x23bd32);})['then'](function(_0x594761){_0x940188[_0x5497('0x57')]=_0x594761;return _0x940188;});}})[_0x5497('0x35')](respondWithFilteredResult(_0x4338d4,_0x23bd32))[_0x5497('0x29')](handleError(_0x4338d4,null));};exports[_0x5497('0x6a')]=function(_0x41f347,_0x4b7c43,_0x5352bd){return db[_0x5497('0x3e')][_0x5497('0x5b')]({'where':{'id':_0x41f347[_0x5497('0x59')]['id']}})[_0x5497('0x35')](handleEntityNotFound(_0x4b7c43,null))[_0x5497('0x35')](function(_0x4ec76d){if(_0x4ec76d){return _0x4ec76d[_0x5497('0x6a')](_0x41f347[_0x5497('0x44')][_0x5497('0x6b')]);}})[_0x5497('0x35')](respondWithStatusCode(_0x4b7c43,null))['catch'](handleError(_0x4b7c43,null));};exports[_0x5497('0x6c')]=function(_0x4118ec,_0x2868b1,_0x25f06e){if(_0x4118ec[_0x5497('0x5d')]['id']){delete _0x4118ec[_0x5497('0x5d')]['id'];}return db['WhatsappAccount'][_0x5497('0x5b')]({'where':{'id':_0x4118ec['params']['id']}})[_0x5497('0x35')](handleEntityNotFound(_0x2868b1,null))[_0x5497('0x35')](function(_0x2207b9){if(_0x2207b9){_0x4118ec['body']['WhatsappAccountId']=_0x2207b9['id'];return db[_0x5497('0x6d')][_0x5497('0x5c')](_0x4118ec[_0x5497('0x5d')]);}})[_0x5497('0x35')](respondWithResult(_0x2868b1,null))[_0x5497('0x29')](handleError(_0x2868b1,null));};exports[_0x5497('0x6e')]=function(_0x2a1d6e,_0x41c82d,_0x5cf415){var _0x53257a={'raw':![],'where':{}};var _0x492372={};var _0x1f47e6={'count':0x0,'rows':[]};return db[_0x5497('0x3e')][_0x5497('0x6f')]({'where':{'id':_0x2a1d6e[_0x5497('0x59')]['id']}})['then'](handleEntityNotFound(_0x41c82d,null))['then'](function(_0x29502d){if(_0x29502d){_0x492372[_0x5497('0x42')]=_['keys'](db[_0x5497('0x6d')][_0x5497('0x3f')]);_0x492372[_0x5497('0x44')]=_[_0x5497('0x45')](_0x2a1d6e['query']);_0x492372['filters']=_['intersection'](_0x492372['model'],_0x492372['query']);_0x53257a[_0x5497('0x47')]=_['intersection'](_0x492372[_0x5497('0x42')],qs['fields'](_0x2a1d6e[_0x5497('0x44')][_0x5497('0x48')]));_0x53257a[_0x5497('0x47')]=_0x53257a[_0x5497('0x47')][_0x5497('0x49')]?_0x53257a[_0x5497('0x47')]:_0x492372['model'];if(!_0x2a1d6e[_0x5497('0x44')]['hasOwnProperty'](_0x5497('0x4b'))){_0x53257a[_0x5497('0x4c')]=qs[_0x5497('0x4c')](_0x2a1d6e[_0x5497('0x44')][_0x5497('0x4c')]);_0x53257a[_0x5497('0x4d')]=qs[_0x5497('0x4d')](_0x2a1d6e[_0x5497('0x44')][_0x5497('0x4d')]);}_0x53257a[_0x5497('0x4e')]=qs['sort'](_0x2a1d6e[_0x5497('0x44')]['sort']);_0x53257a[_0x5497('0x52')]=qs[_0x5497('0x50')](_['pick'](_0x2a1d6e[_0x5497('0x44')],_0x492372[_0x5497('0x50')]));_0x53257a[_0x5497('0x52')][_0x5497('0x66')]=_0x29502d['id'];if(_0x2a1d6e[_0x5497('0x44')][_0x5497('0x51')]){_0x53257a[_0x5497('0x52')]=_[_0x5497('0x53')](_0x53257a[_0x5497('0x52')],{'$or':_[_0x5497('0x3d')](_0x53257a[_0x5497('0x47')],function(_0x926bc1){var _0x38d9fe={};_0x38d9fe[_0x926bc1]={'$like':'%'+_0x2a1d6e[_0x5497('0x44')]['filter']+'%'};return _0x38d9fe;})});}_0x53257a=_[_0x5497('0x53')]({},_0x53257a,_0x2a1d6e[_0x5497('0x54')]);return db[_0x5497('0x6d')][_0x5497('0x2d')]({'where':_0x53257a[_0x5497('0x52')]})['then'](function(_0x3e8fce){_0x1f47e6[_0x5497('0x2d')]=_0x3e8fce;if(_0x2a1d6e['query']['includeAll']){_0x53257a[_0x5497('0x5a')]=[{'all':!![]}];}return db[_0x5497('0x6d')][_0x5497('0x56')](_0x53257a);})[_0x5497('0x35')](function(_0x3d649c){_0x1f47e6['rows']=_0x3d649c;return _0x1f47e6;});}})['then'](respondWithFilteredResult(_0x41c82d,_0x53257a))[_0x5497('0x29')](handleError(_0x41c82d,null));};exports['removeAnswers']=function(_0x17d98c,_0x59b28e,_0x3fa5d8){return db[_0x5497('0x3e')][_0x5497('0x5b')]({'where':{'id':_0x17d98c[_0x5497('0x59')]['id']}})['then'](handleEntityNotFound(_0x59b28e,null))['then'](function(_0x85a1fa){if(_0x85a1fa){return _0x85a1fa[_0x5497('0x70')](_0x17d98c[_0x5497('0x44')]['ids']);}})[_0x5497('0x35')](respondWithStatusCode(_0x59b28e,null))['catch'](handleError(_0x59b28e,null));};exports[_0x5497('0x71')]=function(_0x5ec87d,_0x57961a,_0x39d79c){return db[_0x5497('0x3e')]['find']({'where':{'id':_0x5ec87d[_0x5497('0x59')]['id']}})[_0x5497('0x35')](handleEntityNotFound(_0x57961a,null))[_0x5497('0x35')](function(_0x268b7b){if(_0x268b7b){return _0x268b7b['addAgents'](_0x5ec87d[_0x5497('0x5d')][_0x5497('0x6b')],_[_0x5497('0x72')](_0x5ec87d[_0x5497('0x5d')],[_0x5497('0x6b'),'id'])||{})['spread'](function(_0x204763){for(var _0x488655=0x0;_0x488655<_0x5ec87d[_0x5497('0x5d')][_0x5497('0x6b')][_0x5497('0x49')];_0x488655+=0x1){socket[_0x5497('0x73')](_0x5497('0x74'),{'UserId':_0x5ec87d[_0x5497('0x5d')][_0x5497('0x6b')][_0x488655],'WhatsappAccountId':_0x5ec87d[_0x5497('0x59')]['id']});}return _0x204763;});}})[_0x5497('0x35')](respondWithResult(_0x57961a,null))[_0x5497('0x29')](handleError(_0x57961a,null));};exports[_0x5497('0x75')]=function(_0x5841c5,_0x28d457,_0xa85abe){return db[_0x5497('0x3e')][_0x5497('0x5b')]({'where':{'id':_0x5841c5[_0x5497('0x59')]['id']}})[_0x5497('0x35')](handleEntityNotFound(_0x28d457,null))[_0x5497('0x35')](function(_0x31ccde){if(_0x31ccde){return _0x31ccde[_0x5497('0x75')](_0x5841c5[_0x5497('0x44')][_0x5497('0x6b')])['then'](function(){if(_[_0x5497('0x76')](_0x5841c5[_0x5497('0x44')][_0x5497('0x6b')])){for(var _0x101057=0x0;_0x101057<_0x5841c5[_0x5497('0x44')][_0x5497('0x6b')][_0x5497('0x49')];_0x101057+=0x1){socket[_0x5497('0x73')](_0x5497('0x77'),{'UserId':Number(_0x5841c5[_0x5497('0x44')][_0x5497('0x6b')][_0x101057]),'WhatsappAccountId':Number(_0x5841c5[_0x5497('0x59')]['id'])});}}else{socket[_0x5497('0x73')](_0x5497('0x77'),{'UserId':Number(_0x5841c5['query']['ids']),'WhatsappAccountId':Number(_0x5841c5[_0x5497('0x59')]['id'])});}});}})[_0x5497('0x35')](respondWithStatusCode(_0x28d457,null))[_0x5497('0x29')](handleError(_0x28d457,null));};exports['getAgents']=function(_0x349a89,_0x20a59f,_0x2caea1){var _0x2bd48c={};var _0x3651ba={};var _0x331385;var _0x428ea5;return db[_0x5497('0x3e')]['findOne']({'where':{'id':_0x349a89['params']['id']}})['then'](handleEntityNotFound(_0x20a59f,null))[_0x5497('0x35')](function(_0xba8dcd){if(_0xba8dcd){_0x331385=_0xba8dcd;_0x3651ba['model']=_[_0x5497('0x45')](db[_0x5497('0x78')][_0x5497('0x3f')]);_0x3651ba['query']=_[_0x5497('0x45')](_0x349a89['query']);_0x3651ba[_0x5497('0x50')]=_[_0x5497('0x46')](_0x3651ba[_0x5497('0x42')],_0x3651ba['query']);_0x2bd48c[_0x5497('0x47')]=_[_0x5497('0x46')](_0x3651ba['model'],qs[_0x5497('0x48')](_0x349a89[_0x5497('0x44')][_0x5497('0x48')]));_0x2bd48c['attributes']=_0x2bd48c[_0x5497('0x47')][_0x5497('0x49')]?_0x2bd48c[_0x5497('0x47')]:_0x3651ba[_0x5497('0x42')];_0x2bd48c[_0x5497('0x4e')]=qs[_0x5497('0x4f')](_0x349a89[_0x5497('0x44')][_0x5497('0x4f')]);_0x2bd48c[_0x5497('0x52')]=qs[_0x5497('0x50')](_[_0x5497('0x69')](_0x349a89[_0x5497('0x44')],_0x3651ba[_0x5497('0x50')]));if(_0x349a89[_0x5497('0x44')][_0x5497('0x51')]){_0x2bd48c['where']=_[_0x5497('0x53')](_0x2bd48c['where'],{'$or':_[_0x5497('0x3d')](_0x2bd48c[_0x5497('0x47')],function(_0x59230a){var _0x54f920={};_0x54f920[_0x59230a]={'$like':'%'+_0x349a89[_0x5497('0x44')][_0x5497('0x51')]+'%'};return _0x54f920;})});}_0x2bd48c=_[_0x5497('0x53')]({},_0x2bd48c,_0x349a89[_0x5497('0x54')]);return _0x331385['getAgents'](_0x2bd48c);}})[_0x5497('0x35')](function(_0x1299cd){if(_0x1299cd){_0x428ea5=_0x1299cd['length'];if(!_0x349a89['query'][_0x5497('0x4a')](_0x5497('0x4b'))){_0x2bd48c[_0x5497('0x4c')]=qs[_0x5497('0x4c')](_0x349a89[_0x5497('0x44')]['limit']);_0x2bd48c['offset']=qs[_0x5497('0x4d')](_0x349a89[_0x5497('0x44')]['offset']);}return _0x331385[_0x5497('0x79')](_0x2bd48c);}})[_0x5497('0x35')](function(_0x2e09ad){if(_0x2e09ad){return _0x2e09ad?{'count':_0x428ea5,'rows':_0x2e09ad}:null;}})[_0x5497('0x35')](respondWithResult(_0x20a59f,null))[_0x5497('0x29')](handleError(_0x20a59f,null));};exports[_0x5497('0x7a')]=function(_0x188d21,_0xf92129,_0x2d5cc1){return db['WhatsappAccount']['findOne']({'where':{'id':_0x188d21[_0x5497('0x59')]['id']}})[_0x5497('0x35')](handleEntityNotFound(_0xf92129,null))[_0x5497('0x35')](function(_0x5e07b0){if(_0x5e07b0){return db[_0x5497('0x7b')][_0x5497('0x7c')](function(_0x402b0e){return db['WhatsappApplication'][_0x5497('0x34')]({'where':{'WhatsappAccountId':_0x188d21[_0x5497('0x59')]['id']},'transaction':_0x402b0e})['then'](function(_0x5264a8){var _0x40b0ed=_[_0x5497('0x3d')](_0x188d21['body'],function(_0x26b604){_0x26b604['WhatsappAccountId']=_0x188d21[_0x5497('0x59')]['id'];return _0x26b604;});return db[_0x5497('0x7d')][_0x5497('0x7e')](_0x40b0ed,{'transaction':_0x402b0e});});})[_0x5497('0x35')](function(){return db[_0x5497('0x7d')][_0x5497('0x7f')]({'where':{'WhatsappAccountId':_0x188d21[_0x5497('0x59')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0xf92129,null))[_0x5497('0x29')](handleError(_0xf92129,null));};exports[_0x5497('0x80')]=function(_0x4ec65c,_0x487333,_0x45725a){var _0x144b74={};var _0xceb5f9={};var _0x315143;var _0x1eda10;return db[_0x5497('0x3e')]['findOne']({'where':{'id':_0x4ec65c[_0x5497('0x59')]['id']}})[_0x5497('0x35')](handleEntityNotFound(_0x487333,null))[_0x5497('0x35')](function(_0xf71aae){if(_0xf71aae){_0x315143=_0xf71aae;_0xceb5f9[_0x5497('0x42')]=_[_0x5497('0x45')](db['WhatsappApplication'][_0x5497('0x3f')]);_0xceb5f9['query']=_[_0x5497('0x45')](_0x4ec65c[_0x5497('0x44')]);_0xceb5f9[_0x5497('0x50')]=_['intersection'](_0xceb5f9[_0x5497('0x42')],_0xceb5f9['query']);_0x144b74['attributes']=_[_0x5497('0x46')](_0xceb5f9[_0x5497('0x42')],qs['fields'](_0x4ec65c[_0x5497('0x44')][_0x5497('0x48')]));_0x144b74[_0x5497('0x47')]=_0x144b74[_0x5497('0x47')][_0x5497('0x49')]?_0x144b74[_0x5497('0x47')]:_0xceb5f9[_0x5497('0x42')];_0x144b74[_0x5497('0x4e')]=qs[_0x5497('0x4f')](_0x4ec65c['query'][_0x5497('0x4f')]);_0x144b74[_0x5497('0x52')]=qs[_0x5497('0x50')](_[_0x5497('0x69')](_0x4ec65c[_0x5497('0x44')],_0xceb5f9[_0x5497('0x50')]));if(_0x4ec65c[_0x5497('0x44')][_0x5497('0x51')]){_0x144b74[_0x5497('0x52')]=_[_0x5497('0x53')](_0x144b74[_0x5497('0x52')],{'$or':_[_0x5497('0x3d')](_0x144b74[_0x5497('0x47')],function(_0x1f050e){var _0x3d71dc={};_0x3d71dc[_0x1f050e]={'$like':'%'+_0x4ec65c[_0x5497('0x44')][_0x5497('0x51')]+'%'};return _0x3d71dc;})});}_0x144b74=_[_0x5497('0x53')]({},_0x144b74,_0x4ec65c[_0x5497('0x54')]);return _0x315143['getApplications'](_0x144b74);}})[_0x5497('0x35')](function(_0x2bfb0c){if(_0x2bfb0c){_0x1eda10=_0x2bfb0c['length'];if(!_0x4ec65c['query'][_0x5497('0x4a')]('nolimit')){_0x144b74[_0x5497('0x4c')]=qs[_0x5497('0x4c')](_0x4ec65c[_0x5497('0x44')][_0x5497('0x4c')]);_0x144b74[_0x5497('0x4d')]=qs[_0x5497('0x4d')](_0x4ec65c[_0x5497('0x44')][_0x5497('0x4d')]);}return _0x315143[_0x5497('0x80')](_0x144b74);}})[_0x5497('0x35')](function(_0x884878){if(_0x884878){return _0x884878?{'count':_0x1eda10,'rows':_0x884878}:null;}})['then'](respondWithResult(_0x487333,null))[_0x5497('0x29')](handleError(_0x487333,null));};exports['notify']=function(_0x250c8d,_0x387429,_0x452c9e){var _0x5b9802={'channel':_0x5497('0x81')};var _0x296e58=[];var _0xc34204=[];var _0x461e32={};return db['WhatsappAccount']['find']({'where':{'id':_0x250c8d[_0x5497('0x59')]['id']},'include':[{'model':db[_0x5497('0x7d')],'as':_0x5497('0x82')}]})[_0x5497('0x35')](handleEntityNotFound(_0x387429,null))[_0x5497('0x35')](function(_0x5bb0ec){_0x5b9802[_0x5497('0x83')]=_0x5bb0ec;_0x5b9802['applications']=_['orderBy'](_0x5bb0ec['Applications'],['priority'],[_0x5497('0x84')]);if(_0x5b9802['account']['Applications']){delete _0x5b9802[_0x5497('0x83')][_0x5497('0x82')];}return db[_0x5497('0x85')][_0x5497('0x64')]();})['then'](function(_0x2e62ae){if(!_0x2e62ae){throw new db['Sequelize']['ValidationError'](_0x5497('0x86'));}_0x296e58=_['difference'](_[_0x5497('0x45')](_0x2e62ae),[_0x5497('0x87'),_0x5497('0x88')]);_0xc34204=_['difference'](_[_0x5497('0x45')](_0x2e62ae),['createdAt',_0x5497('0x88'),_0x5497('0x89'),_0x5497('0x8a')]);_0x5b9802[_0x5497('0x5d')]={'mapKey':_0x5497('0x8b')};if(_0x5b9802[_0x5497('0x83')][_0x5497('0x8c')]&&_0x5b9802[_0x5497('0x83')][_0x5497('0x8c')]==='twilio'){_0x5b9802[_0x5497('0x5d')][_0x5497('0x8d')]=_0x250c8d[_0x5497('0x5d')]['From'][_0x5497('0x8e')](_0x5497('0x8f'),'');_0x5b9802[_0x5497('0x5d')][_0x5497('0x5d')]=_0x250c8d[_0x5497('0x5d')]['Body'];_0x5b9802[_0x5497('0x5d')][_0x5497('0x90')]=_0x250c8d[_0x5497('0x5d')][_0x5497('0x91')];}if(_0x5b9802['body']['id']){delete _0x5b9802[_0x5497('0x5d')]['id'];}if(_[_0x5497('0x92')](_0x5b9802[_0x5497('0x5d')][_0x5497('0x8d')])){throw new db[(_0x5497('0x93'))][(_0x5497('0x94'))](_0x5497('0x95'));}if(_['isNil'](_0x5b9802[_0x5497('0x5d')]['body'])||_0x5b9802[_0x5497('0x5d')][_0x5497('0x5d')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5497('0x92')](_0x5b9802[_0x5497('0x5d')][_0x5497('0x96')])){throw new db[(_0x5497('0x93'))]['ValidationError'](_0x5497('0x97')+_0xc34204);}if(!_[_0x5497('0x98')](_0xc34204,_0x5b9802[_0x5497('0x5d')][_0x5497('0x96')])){throw new db[(_0x5497('0x93'))]['ValidationError'](_0x5497('0x99')+_0xc34204);}_0x461e32[_0x5b9802['body'][_0x5497('0x96')]]=_0x5b9802[_0x5497('0x5d')][_0x5497('0x8d')];return db[_0x5497('0x9a')]['find']({'where':{'id':_0x5b9802['account'][_0x5497('0x8a')]},'include':[{'model':db['CmContact'],'as':_0x5497('0x9b'),'where':_0x461e32,'limit':0x1,'order':[['updatedAt',_0x5497('0x9c')]]}]});})['then'](handleEntityNotFound(_0x387429,null))[_0x5497('0x35')](function(_0x1bb216){if(_0x1bb216){_0x5b9802['list']=_[_0x5497('0x72')](_0x1bb216,[_0x5497('0x9b')]);if(_0x1bb216[_0x5497('0x9b')][_0x5497('0x49')]){return _0x1bb216['Contacts'][0x0];}var _0x33184c=_[_0x5497('0x19')](_0x5b9802[_0x5497('0x5d')],{'firstName':_0x5b9802[_0x5497('0x5d')][_0x5497('0x8d')],'ListId':_0x1bb216['id']});_0x33184c[_0x5b9802[_0x5497('0x5d')][_0x5497('0x96')]]=_0x5b9802[_0x5497('0x5d')][_0x5497('0x8d')];return db[_0x5497('0x85')][_0x5497('0x5c')](_0x33184c,{'fields':_0x296e58,'raw':!![]});}})[_0x5497('0x35')](handleEntityNotFound(_0x387429,null))[_0x5497('0x35')](function(_0x42148e){if(_0x42148e){_0x5b9802[_0x5497('0x9d')]=_0x42148e;var _0xdc4284={'ContactId':_0x42148e['id'],'phone':_0x5b9802[_0x5497('0x5d')][_0x5497('0x8d')],'WhatsappAccountId':_0x250c8d[_0x5497('0x59')]['id']};var _0x330d60={'ContactId':_0x42148e['id'],'WhatsappAccountId':_0x250c8d[_0x5497('0x59')]['id'],'closed':![]};return db[_0x5497('0x9e')][_0x5497('0x5b')]({'where':_0x330d60})[_0x5497('0x35')](function(_0x559929){if(_0x559929){return[_0x559929,![]];}return db[_0x5497('0x9e')]['create'](_0xdc4284)[_0x5497('0x35')](function(_0x52c48f){return[_0x52c48f,!![]];});});}})[_0x5497('0x9f')](function(_0x5a7adf,_0x4ff022){_0x5b9802[_0x5497('0xa0')]=_0x5a7adf['get']({'plain':!![]});_0x5b9802[_0x5497('0xa0')][_0x5497('0xa1')]=![];if(_0x4ff022){if(_0x5b9802['account'][_0x5497('0xa2')]){_0x5b9802['applications']['push']({'id':0x0,'priority':_0x5b9802[_0x5497('0xa3')][_0x5497('0x49')]+0x1,'app':_0x5497('0xa4'),'appdata':'unmanaged','interval':_0x5497('0xa5')});}_0x5b9802[_0x5497('0xa0')][_0x5497('0xa1')]=!![];}return db[_0x5497('0xa6')][_0x5497('0x5c')]({'phone':_0x5b9802['body'][_0x5497('0x8d')],'messageId':_0x5b9802['body']['messageId'],'body':_0x5b9802[_0x5497('0x5d')][_0x5497('0x5d')],'WhatsappAccountId':_0x250c8d['params']['id'],'WhatsappInteractionId':_0x5a7adf['id'],'direction':'in','ContactId':_0x5a7adf[_0x5497('0xa7')],'AttachmentId':_0x5b9802['body']['AttachmentId']});})[_0x5497('0x35')](function(_0x2e2a6e){_0x5b9802[_0x5497('0x28')]=_0x2e2a6e;if(_0x5b9802[_0x5497('0xa0')]['UserId']){return db[_0x5497('0x78')][_0x5497('0x5b')]({'attributes':['id',_0x5497('0x43')],'where':{'id':_0x5b9802[_0x5497('0xa0')][_0x5497('0xa8')]}})['then'](function(_0x5e3328){if(_0x5e3328){_0x5b9802[_0x5497('0xa3')][_0x5497('0xa9')]({'id':0x0,'priority':0x0,'app':_0x5497('0xaa'),'appdata':_0x5e3328[_0x5497('0x43')]+','+(_0x5b9802[_0x5497('0x83')]['waitForTheAssignedAgent']||0xa),'interval':_0x5497('0xa5')});}return respondWithRpcPromise(_0x5497('0xab'),'startRouting',_0x5b9802);});}return respondWithRpcPromise('Start','startRouting',_0x5b9802);})[_0x5497('0x35')](function(_0x2b6c76){if(_0x2b6c76){var _0x186c1d=0xc8;var _0x19ad4b=_0x5497('0xac');logger[_0x5497('0x21')](_0x5497('0x24'),_0x19ad4b,_0x186c1d,'entity\x20found');logger[_0x5497('0xad')](_0x5497('0xae'),_0x19ad4b,_0x186c1d,'entity\x20found',JSON['stringify'](_0x2b6c76));if(_0x5b9802[_0x5497('0x83')]['type']===_0x5497('0xaf')){return _0x387429[_0x5497('0x2b')](_0x186c1d)[_0x5497('0x2e')](_0x5497('0xb0'),'text/xml')[_0x5497('0x39')](_0x5497('0xb1'));}else{return _0x387429[_0x5497('0x2b')](_0x186c1d)[_0x5497('0xb2')](_0x2b6c76);}}})[_0x5497('0x29')](handleError(_0x387429,null));};exports['send']=function(_0x1da7e5,_0x3b05b0,_0x366702){var _0x2668d5,_0x1f9046,_0x14fa45;if(_[_0x5497('0x92')](_0x1da7e5['body']['body'])||_0x1da7e5[_0x5497('0x5d')][_0x5497('0x5d')]===''){throw new db['Sequelize'][(_0x5497('0x94'))](_0x5497('0xb3'));}if(_['isNil'](_0x1da7e5['body']['to'])){throw new db[(_0x5497('0x93'))][(_0x5497('0x94'))]('to\x20is\x20mandatory');}_0x2668d5=_0x1da7e5['body']['to'];return db['WhatsappAccount'][_0x5497('0x5b')]({'where':{'id':_0x1da7e5[_0x5497('0x59')]['id']},'include':[{'model':db[_0x5497('0x9a')],'as':'List','include':[{'model':db[_0x5497('0x85')],'as':'Contacts','where':{'mobile':_0x2668d5},'limit':0x1,'order':[[_0x5497('0x88'),'DESC']]}]}]})[_0x5497('0x35')](handleEntityNotFound(_0x3b05b0,null))['then'](function(_0x2b7fec){if(_0x2b7fec&&_0x2b7fec[_0x5497('0xb4')]){_0x1f9046=_0x2b7fec[_0x5497('0x36')]({'plain':!![]});if(_0x1f9046[_0x5497('0xb4')]&&_0x1f9046[_0x5497('0xb4')][_0x5497('0x9b')][_0x5497('0x49')]){return _0x1f9046[_0x5497('0xb4')][_0x5497('0x9b')][0x0];}return db[_0x5497('0x85')][_0x5497('0x5c')](_[_0x5497('0x19')](_0x1da7e5['body'],{'firstName':_0x2668d5,'mobile':_0x2668d5,'phone':_0x2668d5,'ListId':_0x1f9046[_0x5497('0x8a')]}));}})[_0x5497('0x35')](handleEntityNotFound(_0x3b05b0,null))['then'](function(_0x1af00c){if(_0x1af00c){_0x14fa45=_0x1af00c;return db[_0x5497('0x9e')][_0x5497('0x5b')]({'where':{'ContactId':_0x14fa45['id'],'closed':![],'WhatsappAccountId':_0x1f9046['id']}})[_0x5497('0x35')](function(_0x4e498b){if(_0x4e498b){return[_0x4e498b,![]];}return db[_0x5497('0x9e')][_0x5497('0x5c')]({'UserId':_0x1da7e5[_0x5497('0x5e')]['id'],'ContactId':_0x14fa45['id'],'WhatsappAccountId':_0x1f9046['id'],'phone':_0x2668d5,'firstMsgDirection':_0x5497('0xb5'),'Messages':[_[_0x5497('0x53')](_0x1da7e5[_0x5497('0x5d')],{'read':![],'body':_0x1da7e5['body'][_0x5497('0x5d')],'phone':_0x2668d5,'WhatsappAccountId':_0x1f9046['id'],'UserId':_0x1da7e5['user']['id'],'ContactId':_0x14fa45['id']})]},{'include':[{'model':db[_0x5497('0xa6')],'as':_0x5497('0xb6')}]})[_0x5497('0x35')](function(_0x237d6b){return[_0x237d6b,!![]];});});}})[_0x5497('0x9f')](function(_0x546fe9,_0x430d74){if(_0x430d74){return _0x546fe9;}return db[_0x5497('0xa6')][_0x5497('0x5c')](_[_0x5497('0x53')](_0x1da7e5[_0x5497('0x5d')],{'read':![],'body':_0x1da7e5[_0x5497('0x5d')][_0x5497('0x5d')],'phone':_0x2668d5,'WhatsappAccountId':_0x1f9046['id'],'WhatsappInteractionId':_0x546fe9['id'],'UserId':_0x1da7e5[_0x5497('0x5e')]['id'],'ContactId':_0x14fa45['id']}))[_0x5497('0x35')](function(_0xf0c900){_0x546fe9['dataValues'][_0x5497('0xb6')]=[];_0x546fe9['dataValues'][_0x5497('0xb6')][_0x5497('0xb7')](_0xf0c900['dataValues']);return _0x546fe9;});})[_0x5497('0x35')](respondWithResult(_0x3b05b0,null))[_0x5497('0x29')](handleError(_0x3b05b0,null));}; \ No newline at end of file +var _0x326f=['WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','AttachmentId','UserId','unshift','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','send','\x0a','CmList','List','DESC','out','Messages','spread','dataValues','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','get','WhatsappAccounts','UserProfileResource','name','index','Pause','map','WhatsappAccount','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','show','params','mandatoryDispositionPause','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','keys','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','whatsapp','account','applications','orderBy','Applications','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','from','From','replace','Body','messageId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmContact','Contacts','updatedAt','list'];(function(_0x3c0c9e,_0x3ecdee){var _0x5ba5fe=function(_0x1f4a60){while(--_0x1f4a60){_0x3c0c9e['push'](_0x3c0c9e['shift']());}};_0x5ba5fe(++_0x3ecdee);}(_0x326f,0xd1));var _0xf326=function(_0x534ecf,_0xcb46b7){_0x534ecf=_0x534ecf-0x0;var _0x42021e=_0x326f[_0x534ecf];return _0x42021e;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];config[_0xf326('0x17')]=_[_0xf326('0x18')](config['redis'],{'host':_0xf326('0x19'),'port':0x18eb});var socket=require(_0xf326('0x1a'))(new Redis(config[_0xf326('0x17')]));require(_0xf326('0x1b'))['register'](socket);var jayson=require(_0xf326('0x1c'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0xdf21d9,_0x11f6d2,_0x1f2e5a,_0xa63d1a){return new BPromise(function(_0x292f4b,_0x287a2a){var _0x34128e=_0xa63d1a||client;return _0x34128e[_0xf326('0x1d')](_0xdf21d9,_0x1f2e5a)['then'](function(_0x3ad7da){logger[_0xf326('0x1e')](_0xf326('0x1f'),_0x11f6d2,_0xf326('0x20'));logger[_0xf326('0x21')](_0xf326('0x22'),_0x11f6d2,'request\x20sent',JSON['stringify'](_0x3ad7da));if(_0x3ad7da['error']){if(_0x3ad7da[_0xf326('0x23')][_0xf326('0x24')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da[_0xf326('0x23')]['message']);return _0x287a2a(_0x3ad7da['error'][_0xf326('0x25')]);}logger[_0xf326('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da['error'][_0xf326('0x25')]);return _0x292f4b(_0x3ad7da[_0xf326('0x23')]['message']);}else{logger[_0xf326('0x1e')](_0xf326('0x1f'),_0x11f6d2,_0xf326('0x20'));_0x292f4b(_0x3ad7da[_0xf326('0x26')][_0xf326('0x25')]);}})[_0xf326('0x27')](function(_0x5ce532){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x11f6d2,_0x5ce532);_0x287a2a(_0x5ce532);});});}function respondWithStatusCode(_0x520d85,_0x1a2c4e){_0x1a2c4e=_0x1a2c4e||0xcc;return function(_0x2cd45a){if(_0x2cd45a){return _0x520d85[_0xf326('0x28')](_0x1a2c4e);}return _0x520d85[_0xf326('0x29')](_0x1a2c4e)[_0xf326('0x2a')]();};}function respondWithResult(_0x5217d4,_0x201d28){_0x201d28=_0x201d28||0xc8;return function(_0xa3c0b){if(_0xa3c0b){return _0x5217d4[_0xf326('0x29')](_0x201d28)['json'](_0xa3c0b);}};}function respondWithFilteredResult(_0x1617d2,_0x55ad0f){return function(_0x4a9abf){if(_0x4a9abf){var _0x6a8e89=_0x4a9abf[_0xf326('0x2b')],_0x1ae23a=_0x55ad0f[_0xf326('0x2c')],_0x2fa28e=_0x55ad0f['offset']+_0x55ad0f[_0xf326('0x2d')],_0x5dbe63;if(_0x2fa28e>=_0x6a8e89){_0x2fa28e=_0x6a8e89;_0x5dbe63=0xc8;}else{_0x5dbe63=0xce;}_0x1617d2[_0xf326('0x29')](_0x5dbe63);return _0x1617d2[_0xf326('0x2e')](_0xf326('0x2f'),_0x1ae23a+'-'+_0x2fa28e+'/'+_0x6a8e89)[_0xf326('0x30')](_0x4a9abf);}return null;};}function patchUpdates(_0x269be9){return function(_0x161143){try{jsonpatch[_0xf326('0x31')](_0x161143,_0x269be9,!![]);}catch(_0x43b951){return BPromise[_0xf326('0x32')](_0x43b951);}return _0x161143['save']();};}function saveUpdates(_0x1035ed,_0x424104){return function(_0x21b23d){if(_0x21b23d){return _0x21b23d['update'](_0x1035ed)[_0xf326('0x33')](function(_0x1721fd){return _0x1721fd;});}return null;};}function removeEntity(_0x303dc6,_0x4df451){return function(_0x5b101d){if(_0x5b101d){return _0x5b101d[_0xf326('0x34')]()[_0xf326('0x33')](function(){var _0x9c3039=_0x5b101d[_0xf326('0x35')]({'plain':!![]});var _0x30694f=_0xf326('0x36');return db[_0xf326('0x37')][_0xf326('0x34')]({'where':{'type':_0x30694f,'resourceId':_0x9c3039['id']}})['then'](function(){return _0x5b101d;});})[_0xf326('0x33')](function(){_0x303dc6[_0xf326('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4083a2,_0x4e5d7c){return function(_0xce1cbb){if(!_0xce1cbb){_0x4083a2['sendStatus'](0x194);}return _0xce1cbb;};}function handleError(_0x51f147,_0xadb020){_0xadb020=_0xadb020||0x1f4;return function(_0x4d8eac){logger[_0xf326('0x23')](_0x4d8eac['stack']);if(_0x4d8eac[_0xf326('0x38')]){delete _0x4d8eac[_0xf326('0x38')];}_0x51f147[_0xf326('0x29')](_0xadb020)['send'](_0x4d8eac);};}exports[_0xf326('0x39')]=function(_0x4095e6,_0x48525a){var _0x13932b={'include':[{'model':db[_0xf326('0x3a')],'as':'mandatoryDispositionPause'}]},_0xf64dd0={},_0x40fa7a={'count':0x0,'rows':[]};var _0x2c4416=_[_0xf326('0x3b')](db[_0xf326('0x3c')][_0xf326('0x3d')],function(_0x1d88ed){return{'name':_0x1d88ed['fieldName'],'type':_0x1d88ed[_0xf326('0x3e')][_0xf326('0x3f')]};});_0xf64dd0['model']=_['map'](_0x2c4416,_0xf326('0x38'));_0xf64dd0['query']=_['keys'](_0x4095e6[_0xf326('0x40')]);_0xf64dd0['filters']=_[_0xf326('0x41')](_0xf64dd0[_0xf326('0x42')],_0xf64dd0[_0xf326('0x40')]);_0x13932b[_0xf326('0x43')]=_['intersection'](_0xf64dd0[_0xf326('0x42')],qs[_0xf326('0x44')](_0x4095e6[_0xf326('0x40')][_0xf326('0x44')]));_0x13932b[_0xf326('0x43')]=_0x13932b[_0xf326('0x43')][_0xf326('0x45')]?_0x13932b[_0xf326('0x43')]:_0xf64dd0[_0xf326('0x42')];if(!_0x4095e6[_0xf326('0x40')][_0xf326('0x46')](_0xf326('0x47'))){_0x13932b['limit']=qs[_0xf326('0x2d')](_0x4095e6[_0xf326('0x40')][_0xf326('0x2d')]);_0x13932b[_0xf326('0x2c')]=qs[_0xf326('0x2c')](_0x4095e6[_0xf326('0x40')]['offset']);}_0x13932b[_0xf326('0x48')]=qs[_0xf326('0x49')](_0x4095e6['query'][_0xf326('0x49')]);_0x13932b[_0xf326('0x4a')]=qs[_0xf326('0x4b')](_[_0xf326('0x4c')](_0x4095e6[_0xf326('0x40')],_0xf64dd0['filters']),_0x2c4416);if(_0x4095e6['query'][_0xf326('0x4d')]){_0x13932b[_0xf326('0x4a')]=_['merge'](_0x13932b['where'],{'$or':_[_0xf326('0x3b')](_0x2c4416,function(_0x269e89){if(_0x269e89[_0xf326('0x3e')]!=='VIRTUAL'){var _0x301e65={};_0x301e65[_0x269e89[_0xf326('0x38')]]={'$like':'%'+_0x4095e6[_0xf326('0x40')][_0xf326('0x4d')]+'%'};return _0x301e65;}})});}_0x13932b=_[_0xf326('0x4e')]({},_0x13932b,_0x4095e6[_0xf326('0x4f')]);var _0x12792c={'where':_0x13932b[_0xf326('0x4a')]};return db[_0xf326('0x3c')][_0xf326('0x2b')](_0x12792c)[_0xf326('0x33')](function(_0xa1ba7a){_0x40fa7a[_0xf326('0x2b')]=_0xa1ba7a;if(_0x4095e6[_0xf326('0x40')][_0xf326('0x50')]){_0x13932b['include']=[{'all':!![]}];}return db[_0xf326('0x3c')][_0xf326('0x51')](_0x13932b);})[_0xf326('0x33')](function(_0x28dde6){_0x40fa7a['rows']=_0x28dde6;return _0x40fa7a;})[_0xf326('0x33')](respondWithFilteredResult(_0x48525a,_0x13932b))[_0xf326('0x27')](handleError(_0x48525a,null));};exports[_0xf326('0x52')]=function(_0x46fe85,_0x49341c){var _0x30a356={'raw':![],'where':{'id':_0x46fe85[_0xf326('0x53')]['id']},'include':[{'model':db[_0xf326('0x3a')],'as':_0xf326('0x54')}]},_0x1967ab={};_0x1967ab['model']=_['keys'](db[_0xf326('0x3c')][_0xf326('0x3d')]);_0x1967ab[_0xf326('0x40')]=_['keys'](_0x46fe85[_0xf326('0x40')]);_0x1967ab[_0xf326('0x4b')]=_[_0xf326('0x41')](_0x1967ab['model'],_0x1967ab['query']);_0x30a356[_0xf326('0x43')]=_['intersection'](_0x1967ab[_0xf326('0x42')],qs['fields'](_0x46fe85[_0xf326('0x40')][_0xf326('0x44')]));_0x30a356[_0xf326('0x43')]=_0x30a356[_0xf326('0x43')][_0xf326('0x45')]?_0x30a356[_0xf326('0x43')]:_0x1967ab[_0xf326('0x42')];if(_0x46fe85['query'][_0xf326('0x50')]){_0x30a356[_0xf326('0x55')]=[{'all':!![]}];}_0x30a356=_[_0xf326('0x4e')]({},_0x30a356,_0x46fe85['options']);return db[_0xf326('0x3c')][_0xf326('0x56')](_0x30a356)[_0xf326('0x33')](handleEntityNotFound(_0x49341c,null))[_0xf326('0x33')](respondWithResult(_0x49341c,null))[_0xf326('0x27')](handleError(_0x49341c,null));};exports['create']=function(_0x161fb3,_0x21eac7){return db[_0xf326('0x3c')][_0xf326('0x57')](_0x161fb3['body'],{})[_0xf326('0x33')](function(_0x2c362f){var _0x227850=_0x161fb3[_0xf326('0x58')]['get']({'plain':!![]});if(!_0x227850)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x227850[_0xf326('0x59')]===_0xf326('0x58')){var _0x55ca96=_0x2c362f[_0xf326('0x35')]({'plain':!![]});var _0x29de71=_0xf326('0x36');return db[_0xf326('0x5a')]['find']({'where':{'name':_0x29de71,'userProfileId':_0x227850[_0xf326('0x5b')]},'raw':!![]})['then'](function(_0x5dbeb9){if(_0x5dbeb9&&_0x5dbeb9[_0xf326('0x5c')]===0x0){return db['UserProfileResource'][_0xf326('0x57')]({'name':_0x55ca96[_0xf326('0x38')],'resourceId':_0x55ca96['id'],'type':_0x5dbeb9[_0xf326('0x38')],'sectionId':_0x5dbeb9['id']},{})['then'](function(){return _0x2c362f;});}else{return _0x2c362f;}})['catch'](function(_0x1fd9c9){logger[_0xf326('0x23')](_0xf326('0x5d'),_0x1fd9c9);throw _0x1fd9c9;});}return _0x2c362f;})['then'](respondWithResult(_0x21eac7,0xc9))[_0xf326('0x27')](handleError(_0x21eac7,null));};exports['update']=function(_0xe4a00d,_0x40929c){if(_0xe4a00d[_0xf326('0x5e')]['id']){delete _0xe4a00d[_0xf326('0x5e')]['id'];}return db[_0xf326('0x3c')][_0xf326('0x56')]({'where':{'id':_0xe4a00d[_0xf326('0x53')]['id']},'include':[{'model':db[_0xf326('0x3a')],'as':_0xf326('0x54')}]})[_0xf326('0x33')](handleEntityNotFound(_0x40929c,null))[_0xf326('0x33')](saveUpdates(_0xe4a00d[_0xf326('0x5e')],null))[_0xf326('0x33')](respondWithResult(_0x40929c,null))['catch'](handleError(_0x40929c,null));};exports[_0xf326('0x34')]=function(_0x5ae666,_0x6ac6){return db[_0xf326('0x3c')]['find']({'where':{'id':_0x5ae666[_0xf326('0x53')]['id']}})['then'](handleEntityNotFound(_0x6ac6,null))[_0xf326('0x33')](removeEntity(_0x6ac6,null))[_0xf326('0x27')](handleError(_0x6ac6,null));};exports[_0xf326('0x5f')]=function(_0x2d45c9,_0x31b6dd){return db['WhatsappAccount']['describe']()[_0xf326('0x33')](respondWithResult(_0x31b6dd,null))[_0xf326('0x27')](handleError(_0x31b6dd,null));};exports[_0xf326('0x60')]=function(_0x21b3cc,_0x1fc586,_0x579d2c){if(_0x21b3cc[_0xf326('0x5e')]['id']){delete _0x21b3cc[_0xf326('0x5e')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x21b3cc['params']['id']}})[_0xf326('0x33')](handleEntityNotFound(_0x1fc586,null))[_0xf326('0x33')](function(_0x4150fa){if(_0x4150fa){_0x21b3cc[_0xf326('0x5e')][_0xf326('0x61')]=_0x4150fa['id'];return db[_0xf326('0x62')][_0xf326('0x57')](_0x21b3cc['body']);}})[_0xf326('0x33')](respondWithResult(_0x1fc586,null))[_0xf326('0x27')](handleError(_0x1fc586,null));};exports[_0xf326('0x63')]=function(_0x13cf83,_0x58de1e,_0x3717fe){var _0x5eebe8={'raw':![],'where':{}};var _0x499b59={};var _0x2dd9e4={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xf326('0x64')]({'where':{'id':_0x13cf83[_0xf326('0x53')]['id']}})[_0xf326('0x33')](handleEntityNotFound(_0x58de1e,null))[_0xf326('0x33')](function(_0x17cd36){if(_0x17cd36){_0x499b59['model']=_['keys'](db['Disposition'][_0xf326('0x3d')]);_0x499b59[_0xf326('0x40')]=_[_0xf326('0x65')](_0x13cf83[_0xf326('0x40')]);_0x499b59[_0xf326('0x4b')]=_['intersection'](_0x499b59[_0xf326('0x42')],_0x499b59[_0xf326('0x40')]);_0x5eebe8[_0xf326('0x43')]=_['intersection'](_0x499b59['model'],qs[_0xf326('0x44')](_0x13cf83[_0xf326('0x40')]['fields']));_0x5eebe8['attributes']=_0x5eebe8[_0xf326('0x43')]['length']?_0x5eebe8[_0xf326('0x43')]:_0x499b59['model'];if(!_0x13cf83['query']['hasOwnProperty'](_0xf326('0x47'))){_0x5eebe8[_0xf326('0x2d')]=qs[_0xf326('0x2d')](_0x13cf83['query'][_0xf326('0x2d')]);_0x5eebe8[_0xf326('0x2c')]=qs[_0xf326('0x2c')](_0x13cf83[_0xf326('0x40')][_0xf326('0x2c')]);}_0x5eebe8[_0xf326('0x48')]=qs[_0xf326('0x49')](_0x13cf83[_0xf326('0x40')][_0xf326('0x49')]);_0x5eebe8['where']=qs[_0xf326('0x4b')](_['pick'](_0x13cf83[_0xf326('0x40')],_0x499b59[_0xf326('0x4b')]));_0x5eebe8[_0xf326('0x4a')]['WhatsappAccountId']=_0x17cd36['id'];if(_0x13cf83[_0xf326('0x40')][_0xf326('0x4d')]){_0x5eebe8[_0xf326('0x4a')]=_['merge'](_0x5eebe8[_0xf326('0x4a')],{'$or':_[_0xf326('0x3b')](_0x5eebe8[_0xf326('0x43')],function(_0x42c7cf){var _0x5bf77a={};_0x5bf77a[_0x42c7cf]={'$like':'%'+_0x13cf83[_0xf326('0x40')]['filter']+'%'};return _0x5bf77a;})});}_0x5eebe8=_['merge']({},_0x5eebe8,_0x13cf83[_0xf326('0x4f')]);return db[_0xf326('0x62')]['count']({'where':_0x5eebe8['where']})['then'](function(_0x2bd990){_0x2dd9e4['count']=_0x2bd990;if(_0x13cf83[_0xf326('0x40')][_0xf326('0x50')]){_0x5eebe8[_0xf326('0x55')]=[{'all':!![]}];}return db[_0xf326('0x62')][_0xf326('0x51')](_0x5eebe8);})[_0xf326('0x33')](function(_0x5d23f0){_0x2dd9e4[_0xf326('0x66')]=_0x5d23f0;return _0x2dd9e4;});}})[_0xf326('0x33')](respondWithFilteredResult(_0x58de1e,_0x5eebe8))['catch'](handleError(_0x58de1e,null));};exports['removeDispositions']=function(_0x14eecc,_0x537afc,_0x35a7c9){return db[_0xf326('0x3c')][_0xf326('0x56')]({'where':{'id':_0x14eecc[_0xf326('0x53')]['id']}})[_0xf326('0x33')](handleEntityNotFound(_0x537afc,null))[_0xf326('0x33')](function(_0x293600){if(_0x293600){return _0x293600[_0xf326('0x67')](_0x14eecc[_0xf326('0x40')]['ids']);}})[_0xf326('0x33')](respondWithStatusCode(_0x537afc,null))[_0xf326('0x27')](handleError(_0x537afc,null));};exports['addAnswer']=function(_0x3c82cf,_0x5b0f2d,_0x28763a){if(_0x3c82cf[_0xf326('0x5e')]['id']){delete _0x3c82cf[_0xf326('0x5e')]['id'];}return db['WhatsappAccount'][_0xf326('0x56')]({'where':{'id':_0x3c82cf[_0xf326('0x53')]['id']}})[_0xf326('0x33')](handleEntityNotFound(_0x5b0f2d,null))[_0xf326('0x33')](function(_0x30e096){if(_0x30e096){_0x3c82cf[_0xf326('0x5e')][_0xf326('0x61')]=_0x30e096['id'];return db[_0xf326('0x68')][_0xf326('0x57')](_0x3c82cf[_0xf326('0x5e')]);}})[_0xf326('0x33')](respondWithResult(_0x5b0f2d,null))[_0xf326('0x27')](handleError(_0x5b0f2d,null));};exports[_0xf326('0x69')]=function(_0x3abcff,_0x1f990d,_0x53e75f){var _0x3bec1e={'raw':![],'where':{}};var _0x24aaca={};var _0x4829ae={'count':0x0,'rows':[]};return db[_0xf326('0x3c')][_0xf326('0x64')]({'where':{'id':_0x3abcff['params']['id']}})[_0xf326('0x33')](handleEntityNotFound(_0x1f990d,null))[_0xf326('0x33')](function(_0x2b5747){if(_0x2b5747){_0x24aaca[_0xf326('0x42')]=_[_0xf326('0x65')](db[_0xf326('0x68')][_0xf326('0x3d')]);_0x24aaca['query']=_[_0xf326('0x65')](_0x3abcff[_0xf326('0x40')]);_0x24aaca[_0xf326('0x4b')]=_[_0xf326('0x41')](_0x24aaca[_0xf326('0x42')],_0x24aaca[_0xf326('0x40')]);_0x3bec1e[_0xf326('0x43')]=_[_0xf326('0x41')](_0x24aaca['model'],qs[_0xf326('0x44')](_0x3abcff[_0xf326('0x40')]['fields']));_0x3bec1e[_0xf326('0x43')]=_0x3bec1e['attributes'][_0xf326('0x45')]?_0x3bec1e[_0xf326('0x43')]:_0x24aaca[_0xf326('0x42')];if(!_0x3abcff[_0xf326('0x40')][_0xf326('0x46')](_0xf326('0x47'))){_0x3bec1e[_0xf326('0x2d')]=qs[_0xf326('0x2d')](_0x3abcff[_0xf326('0x40')][_0xf326('0x2d')]);_0x3bec1e[_0xf326('0x2c')]=qs[_0xf326('0x2c')](_0x3abcff[_0xf326('0x40')][_0xf326('0x2c')]);}_0x3bec1e['order']=qs[_0xf326('0x49')](_0x3abcff[_0xf326('0x40')][_0xf326('0x49')]);_0x3bec1e[_0xf326('0x4a')]=qs[_0xf326('0x4b')](_['pick'](_0x3abcff[_0xf326('0x40')],_0x24aaca[_0xf326('0x4b')]));_0x3bec1e[_0xf326('0x4a')][_0xf326('0x61')]=_0x2b5747['id'];if(_0x3abcff[_0xf326('0x40')]['filter']){_0x3bec1e['where']=_[_0xf326('0x4e')](_0x3bec1e['where'],{'$or':_[_0xf326('0x3b')](_0x3bec1e[_0xf326('0x43')],function(_0x29610a){var _0x4f35e3={};_0x4f35e3[_0x29610a]={'$like':'%'+_0x3abcff['query'][_0xf326('0x4d')]+'%'};return _0x4f35e3;})});}_0x3bec1e=_[_0xf326('0x4e')]({},_0x3bec1e,_0x3abcff[_0xf326('0x4f')]);return db[_0xf326('0x68')][_0xf326('0x2b')]({'where':_0x3bec1e['where']})[_0xf326('0x33')](function(_0x428eae){_0x4829ae[_0xf326('0x2b')]=_0x428eae;if(_0x3abcff['query']['includeAll']){_0x3bec1e['include']=[{'all':!![]}];}return db[_0xf326('0x68')][_0xf326('0x51')](_0x3bec1e);})[_0xf326('0x33')](function(_0x30922e){_0x4829ae[_0xf326('0x66')]=_0x30922e;return _0x4829ae;});}})[_0xf326('0x33')](respondWithFilteredResult(_0x1f990d,_0x3bec1e))[_0xf326('0x27')](handleError(_0x1f990d,null));};exports['removeAnswers']=function(_0x4a3379,_0x3e10f0,_0x228c81){return db[_0xf326('0x3c')]['find']({'where':{'id':_0x4a3379[_0xf326('0x53')]['id']}})[_0xf326('0x33')](handleEntityNotFound(_0x3e10f0,null))[_0xf326('0x33')](function(_0x597005){if(_0x597005){return _0x597005[_0xf326('0x6a')](_0x4a3379[_0xf326('0x40')][_0xf326('0x6b')]);}})[_0xf326('0x33')](respondWithStatusCode(_0x3e10f0,null))['catch'](handleError(_0x3e10f0,null));};exports['addAgents']=function(_0x5a7af3,_0x11c920,_0x3c6435){return db[_0xf326('0x3c')]['find']({'where':{'id':_0x5a7af3[_0xf326('0x53')]['id']}})[_0xf326('0x33')](handleEntityNotFound(_0x11c920,null))[_0xf326('0x33')](function(_0x568015){if(_0x568015){return _0x568015[_0xf326('0x6c')](_0x5a7af3[_0xf326('0x5e')][_0xf326('0x6b')],_[_0xf326('0x6d')](_0x5a7af3['body'],[_0xf326('0x6b'),'id'])||{})['spread'](function(_0x2b94b8){for(var _0x32e742=0x0;_0x32e742<_0x5a7af3[_0xf326('0x5e')][_0xf326('0x6b')]['length'];_0x32e742+=0x1){socket[_0xf326('0x6e')]('userWhatsappAccount:save',{'UserId':_0x5a7af3[_0xf326('0x5e')][_0xf326('0x6b')][_0x32e742],'WhatsappAccountId':_0x5a7af3[_0xf326('0x53')]['id']});}return _0x2b94b8;});}})[_0xf326('0x33')](respondWithResult(_0x11c920,null))[_0xf326('0x27')](handleError(_0x11c920,null));};exports['removeAgents']=function(_0x512bf8,_0x19d6c8,_0x22f894){return db[_0xf326('0x3c')][_0xf326('0x56')]({'where':{'id':_0x512bf8['params']['id']}})[_0xf326('0x33')](handleEntityNotFound(_0x19d6c8,null))['then'](function(_0x3598c8){if(_0x3598c8){return _0x3598c8[_0xf326('0x6f')](_0x512bf8[_0xf326('0x40')]['ids'])[_0xf326('0x33')](function(){if(_[_0xf326('0x70')](_0x512bf8[_0xf326('0x40')][_0xf326('0x6b')])){for(var _0x1138d9=0x0;_0x1138d9<_0x512bf8['query'][_0xf326('0x6b')][_0xf326('0x45')];_0x1138d9+=0x1){socket['emit'](_0xf326('0x71'),{'UserId':Number(_0x512bf8[_0xf326('0x40')][_0xf326('0x6b')][_0x1138d9]),'WhatsappAccountId':Number(_0x512bf8[_0xf326('0x53')]['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x512bf8[_0xf326('0x40')][_0xf326('0x6b')]),'WhatsappAccountId':Number(_0x512bf8['params']['id'])});}});}})[_0xf326('0x33')](respondWithStatusCode(_0x19d6c8,null))['catch'](handleError(_0x19d6c8,null));};exports['getAgents']=function(_0x4cad0,_0x2590ed,_0x2e24eb){var _0x37cd6f={};var _0x16b5a2={};var _0xdfae35;var _0xf5440;return db[_0xf326('0x3c')][_0xf326('0x64')]({'where':{'id':_0x4cad0['params']['id']}})[_0xf326('0x33')](handleEntityNotFound(_0x2590ed,null))[_0xf326('0x33')](function(_0x31c63f){if(_0x31c63f){_0xdfae35=_0x31c63f;_0x16b5a2[_0xf326('0x42')]=_['keys'](db[_0xf326('0x72')][_0xf326('0x3d')]);_0x16b5a2[_0xf326('0x40')]=_[_0xf326('0x65')](_0x4cad0[_0xf326('0x40')]);_0x16b5a2['filters']=_[_0xf326('0x41')](_0x16b5a2['model'],_0x16b5a2[_0xf326('0x40')]);_0x37cd6f[_0xf326('0x43')]=_[_0xf326('0x41')](_0x16b5a2[_0xf326('0x42')],qs['fields'](_0x4cad0[_0xf326('0x40')][_0xf326('0x44')]));_0x37cd6f[_0xf326('0x43')]=_0x37cd6f['attributes'][_0xf326('0x45')]?_0x37cd6f[_0xf326('0x43')]:_0x16b5a2[_0xf326('0x42')];_0x37cd6f[_0xf326('0x48')]=qs['sort'](_0x4cad0[_0xf326('0x40')][_0xf326('0x49')]);_0x37cd6f[_0xf326('0x4a')]=qs[_0xf326('0x4b')](_['pick'](_0x4cad0[_0xf326('0x40')],_0x16b5a2[_0xf326('0x4b')]));if(_0x4cad0[_0xf326('0x40')]['filter']){_0x37cd6f[_0xf326('0x4a')]=_[_0xf326('0x4e')](_0x37cd6f['where'],{'$or':_[_0xf326('0x3b')](_0x37cd6f[_0xf326('0x43')],function(_0x2ed6f1){var _0x22f5a3={};_0x22f5a3[_0x2ed6f1]={'$like':'%'+_0x4cad0[_0xf326('0x40')][_0xf326('0x4d')]+'%'};return _0x22f5a3;})});}_0x37cd6f=_['merge']({},_0x37cd6f,_0x4cad0['options']);return _0xdfae35[_0xf326('0x73')](_0x37cd6f);}})[_0xf326('0x33')](function(_0x4307d9){if(_0x4307d9){_0xf5440=_0x4307d9[_0xf326('0x45')];if(!_0x4cad0[_0xf326('0x40')][_0xf326('0x46')]('nolimit')){_0x37cd6f[_0xf326('0x2d')]=qs[_0xf326('0x2d')](_0x4cad0[_0xf326('0x40')][_0xf326('0x2d')]);_0x37cd6f[_0xf326('0x2c')]=qs[_0xf326('0x2c')](_0x4cad0[_0xf326('0x40')][_0xf326('0x2c')]);}return _0xdfae35[_0xf326('0x73')](_0x37cd6f);}})['then'](function(_0x3ca75e){if(_0x3ca75e){return _0x3ca75e?{'count':_0xf5440,'rows':_0x3ca75e}:null;}})['then'](respondWithResult(_0x2590ed,null))['catch'](handleError(_0x2590ed,null));};exports[_0xf326('0x74')]=function(_0x549a1f,_0x1f37f9,_0x3e0918){return db[_0xf326('0x3c')][_0xf326('0x64')]({'where':{'id':_0x549a1f[_0xf326('0x53')]['id']}})[_0xf326('0x33')](handleEntityNotFound(_0x1f37f9,null))[_0xf326('0x33')](function(_0x18b3cc){if(_0x18b3cc){return db[_0xf326('0x75')][_0xf326('0x76')](function(_0x2f0b09){return db[_0xf326('0x77')]['destroy']({'where':{'WhatsappAccountId':_0x549a1f[_0xf326('0x53')]['id']},'transaction':_0x2f0b09})[_0xf326('0x33')](function(_0x5657){var _0x3c5204=_[_0xf326('0x3b')](_0x549a1f[_0xf326('0x5e')],function(_0x1ba5a4){_0x1ba5a4['WhatsappAccountId']=_0x549a1f[_0xf326('0x53')]['id'];return _0x1ba5a4;});return db[_0xf326('0x77')][_0xf326('0x78')](_0x3c5204,{'transaction':_0x2f0b09});});})[_0xf326('0x33')](function(){return db[_0xf326('0x77')][_0xf326('0x79')]({'where':{'WhatsappAccountId':_0x549a1f[_0xf326('0x53')]['id']},'order':'priority'});});}})[_0xf326('0x33')](respondWithResult(_0x1f37f9,null))[_0xf326('0x27')](handleError(_0x1f37f9,null));};exports[_0xf326('0x7a')]=function(_0x9a0455,_0x62e352,_0x10cb51){var _0x209f83={};var _0x422de9={};var _0x72b9d4;var _0x42af9b;return db[_0xf326('0x3c')][_0xf326('0x64')]({'where':{'id':_0x9a0455['params']['id']}})[_0xf326('0x33')](handleEntityNotFound(_0x62e352,null))[_0xf326('0x33')](function(_0x337afe){if(_0x337afe){_0x72b9d4=_0x337afe;_0x422de9['model']=_['keys'](db[_0xf326('0x77')][_0xf326('0x3d')]);_0x422de9[_0xf326('0x40')]=_[_0xf326('0x65')](_0x9a0455['query']);_0x422de9[_0xf326('0x4b')]=_[_0xf326('0x41')](_0x422de9[_0xf326('0x42')],_0x422de9['query']);_0x209f83['attributes']=_['intersection'](_0x422de9[_0xf326('0x42')],qs[_0xf326('0x44')](_0x9a0455[_0xf326('0x40')]['fields']));_0x209f83[_0xf326('0x43')]=_0x209f83['attributes'][_0xf326('0x45')]?_0x209f83['attributes']:_0x422de9[_0xf326('0x42')];_0x209f83[_0xf326('0x48')]=qs[_0xf326('0x49')](_0x9a0455[_0xf326('0x40')][_0xf326('0x49')]);_0x209f83[_0xf326('0x4a')]=qs[_0xf326('0x4b')](_[_0xf326('0x4c')](_0x9a0455[_0xf326('0x40')],_0x422de9[_0xf326('0x4b')]));if(_0x9a0455[_0xf326('0x40')][_0xf326('0x4d')]){_0x209f83[_0xf326('0x4a')]=_[_0xf326('0x4e')](_0x209f83['where'],{'$or':_[_0xf326('0x3b')](_0x209f83[_0xf326('0x43')],function(_0x2ca205){var _0x4e0286={};_0x4e0286[_0x2ca205]={'$like':'%'+_0x9a0455['query']['filter']+'%'};return _0x4e0286;})});}_0x209f83=_[_0xf326('0x4e')]({},_0x209f83,_0x9a0455[_0xf326('0x4f')]);return _0x72b9d4[_0xf326('0x7a')](_0x209f83);}})[_0xf326('0x33')](function(_0xfa0cbf){if(_0xfa0cbf){_0x42af9b=_0xfa0cbf[_0xf326('0x45')];if(!_0x9a0455['query'][_0xf326('0x46')](_0xf326('0x47'))){_0x209f83[_0xf326('0x2d')]=qs[_0xf326('0x2d')](_0x9a0455[_0xf326('0x40')]['limit']);_0x209f83[_0xf326('0x2c')]=qs[_0xf326('0x2c')](_0x9a0455[_0xf326('0x40')][_0xf326('0x2c')]);}return _0x72b9d4[_0xf326('0x7a')](_0x209f83);}})['then'](function(_0x4b0a1b){if(_0x4b0a1b){return _0x4b0a1b?{'count':_0x42af9b,'rows':_0x4b0a1b}:null;}})[_0xf326('0x33')](respondWithResult(_0x62e352,null))['catch'](handleError(_0x62e352,null));};exports['notify']=function(_0x78e7b0,_0x16087e,_0x300edd){var _0x3529b6={'channel':_0xf326('0x7b')};var _0x5aa1ca=[];var _0x51bfee=[];var _0x456d89={};return db[_0xf326('0x3c')][_0xf326('0x56')]({'where':{'id':_0x78e7b0['params']['id']},'include':[{'model':db[_0xf326('0x77')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x16087e,null))['then'](function(_0x4ee718){_0x3529b6[_0xf326('0x7c')]=_0x4ee718;_0x3529b6[_0xf326('0x7d')]=_[_0xf326('0x7e')](_0x4ee718[_0xf326('0x7f')],[_0xf326('0x80')],[_0xf326('0x81')]);if(_0x3529b6[_0xf326('0x7c')][_0xf326('0x7f')]){delete _0x3529b6[_0xf326('0x7c')][_0xf326('0x7f')];}return db['CmContact'][_0xf326('0x5f')]();})[_0xf326('0x33')](function(_0x2a17bf){if(!_0x2a17bf){throw new db[(_0xf326('0x82'))][(_0xf326('0x83'))](_0xf326('0x84'));}_0x5aa1ca=_[_0xf326('0x85')](_[_0xf326('0x65')](_0x2a17bf),[_0xf326('0x86'),'updatedAt']);_0x51bfee=_[_0xf326('0x85')](_[_0xf326('0x65')](_0x2a17bf),[_0xf326('0x86'),'updatedAt','CompanyId',_0xf326('0x87')]);_0x3529b6[_0xf326('0x5e')]={'mapKey':'mobile'};if(_0x3529b6['account'][_0xf326('0x3e')]&&_0x3529b6['account'][_0xf326('0x3e')]==='twilio'){_0x3529b6[_0xf326('0x5e')][_0xf326('0x88')]=_0x78e7b0[_0xf326('0x5e')][_0xf326('0x89')][_0xf326('0x8a')]('whatsapp:','');_0x3529b6[_0xf326('0x5e')]['body']=_0x78e7b0[_0xf326('0x5e')][_0xf326('0x8b')];_0x3529b6[_0xf326('0x5e')][_0xf326('0x8c')]=_0x78e7b0[_0xf326('0x5e')]['MessageSid'];}if(_0x3529b6['body']['id']){delete _0x3529b6[_0xf326('0x5e')]['id'];}if(_['isNil'](_0x3529b6['body']['from'])){throw new db['Sequelize'][(_0xf326('0x83'))](_0xf326('0x8d'));}if(_[_0xf326('0x8e')](_0x3529b6[_0xf326('0x5e')][_0xf326('0x5e')])||_0x3529b6[_0xf326('0x5e')][_0xf326('0x5e')]===''){throw new db[(_0xf326('0x82'))][(_0xf326('0x83'))](_0xf326('0x8f'));}if(_[_0xf326('0x8e')](_0x3529b6['body'][_0xf326('0x90')])){throw new db[(_0xf326('0x82'))][(_0xf326('0x83'))](_0xf326('0x91')+_0x51bfee);}if(!_[_0xf326('0x92')](_0x51bfee,_0x3529b6[_0xf326('0x5e')][_0xf326('0x90')])){throw new db[(_0xf326('0x82'))][(_0xf326('0x83'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x51bfee);}_0x456d89[_0x3529b6[_0xf326('0x5e')]['mapKey']]=_0x3529b6[_0xf326('0x5e')]['from'];return db['CmList'][_0xf326('0x56')]({'where':{'id':_0x3529b6['account'][_0xf326('0x87')]},'include':[{'model':db[_0xf326('0x93')],'as':_0xf326('0x94'),'where':_0x456d89,'limit':0x1,'order':[[_0xf326('0x95'),'DESC']]}]});})[_0xf326('0x33')](handleEntityNotFound(_0x16087e,null))[_0xf326('0x33')](function(_0x244f8e){if(_0x244f8e){_0x3529b6[_0xf326('0x96')]=_['omit'](_0x244f8e,['Contacts']);if(_0x244f8e[_0xf326('0x94')][_0xf326('0x45')]){return _0x244f8e[_0xf326('0x94')][0x0];}var _0x160086=_[_0xf326('0x18')](_0x3529b6[_0xf326('0x5e')],{'firstName':_0x3529b6[_0xf326('0x5e')][_0xf326('0x88')],'ListId':_0x244f8e['id']});_0x160086[_0x3529b6[_0xf326('0x5e')][_0xf326('0x90')]]=_0x3529b6[_0xf326('0x5e')]['from'];return db[_0xf326('0x93')][_0xf326('0x57')](_0x160086,{'fields':_0x5aa1ca,'raw':!![]});}})[_0xf326('0x33')](handleEntityNotFound(_0x16087e,null))['then'](function(_0x38390d){if(_0x38390d){_0x3529b6['contact']=_0x38390d;var _0x2667dc={'ContactId':_0x38390d['id'],'phone':_0x3529b6[_0xf326('0x5e')]['from'],'WhatsappAccountId':_0x78e7b0[_0xf326('0x53')]['id']};var _0x317c66={'ContactId':_0x38390d['id'],'WhatsappAccountId':_0x78e7b0[_0xf326('0x53')]['id'],'closed':![]};return db[_0xf326('0x97')]['find']({'where':_0x317c66})[_0xf326('0x33')](function(_0x26f3a5){if(_0x26f3a5){return[_0x26f3a5,![]];}return db[_0xf326('0x97')][_0xf326('0x57')](_0x2667dc)[_0xf326('0x33')](function(_0x5da162){return[_0x5da162,!![]];});});}})['spread'](function(_0x412887,_0x9875ad){_0x3529b6[_0xf326('0x98')]=_0x412887[_0xf326('0x35')]({'plain':!![]});_0x3529b6[_0xf326('0x98')][_0xf326('0x99')]=![];if(_0x9875ad){if(_0x3529b6[_0xf326('0x7c')][_0xf326('0x9a')]){_0x3529b6[_0xf326('0x7d')][_0xf326('0x9b')]({'id':0x0,'priority':_0x3529b6['applications']['length']+0x1,'app':_0xf326('0x9c'),'appdata':_0xf326('0x9d'),'interval':_0xf326('0x9e')});}_0x3529b6[_0xf326('0x98')]['created']=!![];}return db[_0xf326('0x9f')][_0xf326('0x57')]({'phone':_0x3529b6[_0xf326('0x5e')][_0xf326('0x88')],'messageId':_0x3529b6[_0xf326('0x5e')][_0xf326('0x8c')],'body':_0x3529b6['body'][_0xf326('0x5e')],'WhatsappAccountId':_0x78e7b0['params']['id'],'WhatsappInteractionId':_0x412887['id'],'direction':'in','ContactId':_0x412887['ContactId'],'AttachmentId':_0x3529b6[_0xf326('0x5e')][_0xf326('0xa0')]});})[_0xf326('0x33')](function(_0x41c97d){_0x3529b6[_0xf326('0x25')]=_0x41c97d;if(_0x3529b6['interaction'][_0xf326('0xa1')]){return db[_0xf326('0x72')][_0xf326('0x56')]({'attributes':['id','name'],'where':{'id':_0x3529b6[_0xf326('0x98')][_0xf326('0xa1')]}})[_0xf326('0x33')](function(_0x207dfa){if(_0x207dfa){_0x3529b6['applications'][_0xf326('0xa2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x207dfa['name']+','+(_0x3529b6[_0xf326('0x7c')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf326('0xa3'),_0xf326('0xa4'),_0x3529b6);});}return respondWithRpcPromise(_0xf326('0xa3'),_0xf326('0xa4'),_0x3529b6);})['then'](function(_0x5932b6){if(_0x5932b6){var _0x106a46=0xc8;var _0x14e473=_0xf326('0xa5');logger[_0xf326('0x1e')](_0xf326('0x22'),_0x14e473,_0x106a46,_0xf326('0xa6'));logger[_0xf326('0x21')](_0xf326('0xa7'),_0x14e473,_0x106a46,_0xf326('0xa6'),JSON['stringify'](_0x5932b6));if(_0x3529b6[_0xf326('0x7c')][_0xf326('0x3e')]===_0xf326('0xa8')){return _0x16087e['status'](_0x106a46)['set'](_0xf326('0xa9'),_0xf326('0xaa'))[_0xf326('0xab')](_0xf326('0xac'));}else{return _0x16087e['status'](_0x106a46)['json'](_0x5932b6);}}})['catch'](handleError(_0x16087e,null));};exports[_0xf326('0xab')]=function(_0x216c75,_0x730518,_0x59a37a){var _0x5e4896,_0x34bfdf,_0x15c66f;if(_[_0xf326('0x8e')](_0x216c75['body']['body'])||_0x216c75['body'][_0xf326('0x5e')]===''){throw new db[(_0xf326('0x82'))][(_0xf326('0x83'))](_0xf326('0x8f'));}if(_[_0xf326('0x8e')](_0x216c75[_0xf326('0x5e')]['to'])){throw new db[(_0xf326('0x82'))][(_0xf326('0x83'))]('to\x20is\x20mandatory');}_0x5e4896=_0x216c75['body']['to'];return db[_0xf326('0x3c')]['find']({'where':{'id':_0x216c75['params']['id']},'include':[{'model':db[_0xf326('0xad')],'as':_0xf326('0xae'),'include':[{'model':db[_0xf326('0x93')],'as':_0xf326('0x94'),'where':{'mobile':_0x5e4896},'limit':0x1,'order':[[_0xf326('0x95'),_0xf326('0xaf')]]}]}]})[_0xf326('0x33')](handleEntityNotFound(_0x730518,null))[_0xf326('0x33')](function(_0x3ec320){if(_0x3ec320&&_0x3ec320[_0xf326('0xae')]){_0x34bfdf=_0x3ec320[_0xf326('0x35')]({'plain':!![]});if(_0x34bfdf[_0xf326('0xae')]&&_0x34bfdf['List'][_0xf326('0x94')][_0xf326('0x45')]){return _0x34bfdf[_0xf326('0xae')][_0xf326('0x94')][0x0];}return db['CmContact'][_0xf326('0x57')](_[_0xf326('0x18')](_0x216c75[_0xf326('0x5e')],{'firstName':_0x5e4896,'mobile':_0x5e4896,'phone':_0x5e4896,'ListId':_0x34bfdf[_0xf326('0x87')]}));}})[_0xf326('0x33')](handleEntityNotFound(_0x730518,null))['then'](function(_0x330d7b){if(_0x330d7b){_0x15c66f=_0x330d7b;return db[_0xf326('0x97')][_0xf326('0x56')]({'where':{'ContactId':_0x15c66f['id'],'closed':![],'WhatsappAccountId':_0x34bfdf['id']}})[_0xf326('0x33')](function(_0x2a17d4){if(_0x2a17d4){return[_0x2a17d4,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x216c75[_0xf326('0x58')]['id'],'ContactId':_0x15c66f['id'],'WhatsappAccountId':_0x34bfdf['id'],'phone':_0x5e4896,'firstMsgDirection':_0xf326('0xb0'),'Messages':[_['merge'](_0x216c75[_0xf326('0x5e')],{'read':![],'body':_0x216c75[_0xf326('0x5e')][_0xf326('0x5e')],'phone':_0x5e4896,'WhatsappAccountId':_0x34bfdf['id'],'UserId':_0x216c75[_0xf326('0x58')]['id'],'ContactId':_0x15c66f['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xf326('0xb1')}]})[_0xf326('0x33')](function(_0x5c66ab){return[_0x5c66ab,!![]];});});}})[_0xf326('0xb2')](function(_0x2a60f5,_0x21064d){if(_0x21064d){return _0x2a60f5;}return db[_0xf326('0x9f')][_0xf326('0x57')](_[_0xf326('0x4e')](_0x216c75[_0xf326('0x5e')],{'read':![],'body':_0x216c75[_0xf326('0x5e')][_0xf326('0x5e')],'phone':_0x5e4896,'WhatsappAccountId':_0x34bfdf['id'],'WhatsappInteractionId':_0x2a60f5['id'],'UserId':_0x216c75[_0xf326('0x58')]['id'],'ContactId':_0x15c66f['id']}))[_0xf326('0x33')](function(_0x4f75e4){_0x2a60f5[_0xf326('0xb3')][_0xf326('0xb1')]=[];_0x2a60f5[_0xf326('0xb3')][_0xf326('0xb1')][_0xf326('0x9b')](_0x4f75e4[_0xf326('0xb3')]);return _0x2a60f5;});})[_0xf326('0x33')](respondWithResult(_0x730518,null))[_0xf326('0x27')](handleError(_0x730518,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 9727dd5..d9e91ad 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 _0x7880=['../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x36e3ab,_0x5af3a1){var _0x178894=function(_0x531b6d){while(--_0x531b6d){_0x36e3ab['push'](_0x36e3ab['shift']());}};_0x178894(++_0x5af3a1);}(_0x7880,0x1f4));var _0x0788=function(_0x4454e7,_0x2e916a){_0x4454e7=_0x4454e7-0x0;var _0x4c2a56=_0x7880[_0x4454e7];return _0x4c2a56;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x0788('0x0'))['db'][_0x0788('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0788('0x2')](0x0);var events={'afterCreate':_0x0788('0x3'),'afterUpdate':_0x0788('0x4'),'afterDestroy':_0x0788('0x5')};function emitEvent(_0x5c29f7){return function(_0x3925a6,_0x1e0814,_0x317885){WhatsappAccountEvents[_0x0788('0x6')](_0x5c29f7+':'+_0x3925a6['id'],_0x3925a6);WhatsappAccountEvents[_0x0788('0x6')](_0x5c29f7,_0x3925a6);_0x317885(null);};}for(var e in events){if(events[_0x0788('0x7')](e)){var event=events[e];WhatsappAccount[_0x0788('0x8')](e,emitEvent(event));}}module[_0x0788('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0xd481=['remove','emit','hook','exports','events','WhatsappAccount','setMaxListeners','update'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0xd481,0x1e4));var _0x1d48=function(_0x386345,_0x52d84f){_0x386345=_0x386345-0x0;var _0x462ab1=_0xd481[_0x386345];return _0x462ab1;};'use strict';var EventEmitter=require(_0x1d48('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x1d48('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1d48('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1d48('0x3'),'afterDestroy':_0x1d48('0x4')};function emitEvent(_0x1bce72){return function(_0x59c90f,_0x35864e,_0x5aa42e){WhatsappAccountEvents[_0x1d48('0x5')](_0x1bce72+':'+_0x59c90f['id'],_0x59c90f);WhatsappAccountEvents[_0x1d48('0x5')](_0x1bce72,_0x59c90f);_0x5aa42e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x1d48('0x6')](e,emitEvent(event));}}module[_0x1d48('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index ece0dba..499fe5b 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 _0xd157=['lodash','api','request-promise','path','../../config/environment','exports','WhatsappAccount'];(function(_0x50d166,_0x5a9276){var _0x5bc89e=function(_0x890a36){while(--_0x890a36){_0x50d166['push'](_0x50d166['shift']());}};_0x5bc89e(++_0x5a9276);}(_0xd157,0x19d));var _0x7d15=function(_0x137fd,_0x84d2ab){_0x137fd=_0x137fd-0x0;var _0x123a16=_0xd157[_0x137fd];return _0x123a16;};'use strict';var _=require(_0x7d15('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7d15('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d15('0x2'));var fs=require('fs');var path=require(_0x7d15('0x3'));var rimraf=require('rimraf');var config=require(_0x7d15('0x4'));var attributes=require('./whatsappAccount.attributes');module[_0x7d15('0x5')]=function(_0x3d212c,_0x2f052a){return _0x3d212c['define'](_0x7d15('0x6'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9dd5=['WhatsappAccount','lodash','util','../../config/logger','path','../../config/environment','exports','define'];(function(_0x4b92ef,_0x48da52){var _0x5526c9=function(_0x4f6267){while(--_0x4f6267){_0x4b92ef['push'](_0x4b92ef['shift']());}};_0x5526c9(++_0x48da52);}(_0x9dd5,0x1d1));var _0x59dd=function(_0x1e812c,_0x4b6727){_0x1e812c=_0x1e812c-0x0;var _0xac472=_0x9dd5[_0x1e812c];return _0xac472;};'use strict';var _=require(_0x59dd('0x0'));var util=require(_0x59dd('0x1'));var logger=require(_0x59dd('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x59dd('0x3'));var rimraf=require('rimraf');var config=require(_0x59dd('0x4'));var attributes=require('./whatsappAccount.attributes');module[_0x59dd('0x5')]=function(_0x13fbaa,_0x226fcb){return _0x13fbaa[_0x59dd('0x6')](_0x59dd('0x7'),attributes,{'tableName':'whatsapp_accounts','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 14446eb..3253b1a 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 _0xb385=['./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','attributes','include','model','map','ShowWhatsappAccount','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb385,0xa1));var _0x5b38=function(_0x4b92ce,_0x32afe7){_0x4b92ce=_0x4b92ce-0x0;var _0x18a5c0=_0xb385[_0x4b92ce];return _0x18a5c0;};'use strict';var _=require(_0x5b38('0x0'));var util=require(_0x5b38('0x1'));var moment=require(_0x5b38('0x2'));var BPromise=require(_0x5b38('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b38('0x5'));var logger=require(_0x5b38('0x6'))(_0x5b38('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5b38('0x8')][_0x5b38('0x9')]({'port':0x232a});config['redis']=_[_0x5b38('0xa')](config[_0x5b38('0xb')],{'host':_0x5b38('0xc'),'port':0x18eb});var socket=require(_0x5b38('0xd'))(new Redis(config[_0x5b38('0xb')]));require(_0x5b38('0xe'))[_0x5b38('0xf')](socket);function respondWithRpcPromise(_0x2d3bf2,_0x354c12,_0x28b8fa){return new BPromise(function(_0x28b0f5,_0x31757a){return client[_0x5b38('0x10')](_0x2d3bf2,_0x28b8fa)[_0x5b38('0x11')](function(_0x1084b5){logger[_0x5b38('0x12')](_0x5b38('0x13'),_0x354c12,'request\x20sent');logger[_0x5b38('0x14')](_0x5b38('0x15'),_0x354c12,_0x5b38('0x16'),JSON[_0x5b38('0x17')](_0x1084b5));if(_0x1084b5[_0x5b38('0x18')]){if(_0x1084b5[_0x5b38('0x18')][_0x5b38('0x19')]===0x1f4){logger[_0x5b38('0x18')](_0x5b38('0x13'),_0x354c12,_0x1084b5[_0x5b38('0x18')][_0x5b38('0x1a')]);return _0x31757a(_0x1084b5['error'][_0x5b38('0x1a')]);}logger[_0x5b38('0x18')](_0x5b38('0x13'),_0x354c12,_0x1084b5[_0x5b38('0x18')][_0x5b38('0x1a')]);return _0x28b0f5(_0x1084b5[_0x5b38('0x18')][_0x5b38('0x1a')]);}else{logger[_0x5b38('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x354c12,_0x5b38('0x16'));_0x28b0f5(_0x1084b5[_0x5b38('0x1b')][_0x5b38('0x1a')]);}})[_0x5b38('0x1c')](function(_0x385a4a){logger[_0x5b38('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x354c12,_0x385a4a);_0x31757a(_0x385a4a);});});}exports['ShowWhatsappAccount']=function(_0x3f9d9b){var _0x2f6454=this;return new Promise(function(_0x5e18d1,_0x13110b){return db['WhatsappAccount']['find']({'raw':_0x3f9d9b[_0x5b38('0x1d')]?_0x3f9d9b[_0x5b38('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3f9d9b[_0x5b38('0x1d')]?_0x3f9d9b[_0x5b38('0x1d')]['where']||null:null,'attributes':_0x3f9d9b['options']?_0x3f9d9b[_0x5b38('0x1d')][_0x5b38('0x1e')]||null:null,'include':_0x3f9d9b[_0x5b38('0x1d')]?_0x3f9d9b[_0x5b38('0x1d')]['include']?_['map'](_0x3f9d9b[_0x5b38('0x1d')][_0x5b38('0x1f')],function(_0x329d9c){return{'model':db[_0x329d9c[_0x5b38('0x20')]],'as':_0x329d9c['as'],'attributes':_0x329d9c['attributes'],'include':_0x329d9c[_0x5b38('0x1f')]?_[_0x5b38('0x21')](_0x329d9c[_0x5b38('0x1f')],function(_0x587e2a){return{'model':db[_0x587e2a[_0x5b38('0x20')]],'as':_0x587e2a['as'],'attributes':_0x587e2a[_0x5b38('0x1e')],'include':_0x587e2a[_0x5b38('0x1f')]?_[_0x5b38('0x21')](_0x587e2a['include'],function(_0x2ecb5b){return{'model':db[_0x2ecb5b['model']],'as':_0x2ecb5b['as'],'attributes':_0x2ecb5b[_0x5b38('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x154f70){logger['info'](_0x5b38('0x22'),_0x3f9d9b);logger[_0x5b38('0x14')](_0x5b38('0x22'),_0x3f9d9b,JSON[_0x5b38('0x17')](_0x154f70));_0x5e18d1(_0x154f70);})['catch'](function(_0x1a4bfb){logger[_0x5b38('0x18')]('ShowWhatsappAccount',_0x1a4bfb['message'],_0x3f9d9b);_0x13110b(_0x2f6454[_0x5b38('0x18')](0x1f4,_0x1a4bfb[_0x5b38('0x1a')]));});});}; \ No newline at end of file +var _0xd23a=['WhatsappAccount','find','options','where','attributes','include','map','model','ShowWhatsappAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x21eb60,_0x335cc4){var _0x32c61b=function(_0xcb8644){while(--_0xcb8644){_0x21eb60['push'](_0x21eb60['shift']());}};_0x32c61b(++_0x335cc4);}(_0xd23a,0xe7));var _0xad23=function(_0x47e639,_0x15659){_0x47e639=_0x47e639-0x0;var _0x416d6d=_0xd23a[_0x47e639];return _0x416d6d;};'use strict';var _=require(_0xad23('0x0'));var util=require('util');var moment=require(_0xad23('0x1'));var BPromise=require(_0xad23('0x2'));var rs=require(_0xad23('0x3'));var fs=require('fs');var Redis=require(_0xad23('0x4'));var db=require(_0xad23('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xad23('0x6'))(_0xad23('0x7'));var config=require('../../config/environment');var jayson=require(_0xad23('0x8'));var client=jayson[_0xad23('0x9')][_0xad23('0xa')]({'port':0x232a});config[_0xad23('0xb')]=_['defaults'](config[_0xad23('0xb')],{'host':_0xad23('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad23('0xb')]));require(_0xad23('0xd'))[_0xad23('0xe')](socket);function respondWithRpcPromise(_0xd2e238,_0x5ce941,_0x5c66aa){return new BPromise(function(_0x3f3954,_0x25a158){return client[_0xad23('0xf')](_0xd2e238,_0x5c66aa)[_0xad23('0x10')](function(_0x5c35b5){logger[_0xad23('0x11')](_0xad23('0x12'),_0x5ce941,_0xad23('0x13'));logger[_0xad23('0x14')](_0xad23('0x15'),_0x5ce941,_0xad23('0x13'),JSON[_0xad23('0x16')](_0x5c35b5));if(_0x5c35b5[_0xad23('0x17')]){if(_0x5c35b5[_0xad23('0x17')][_0xad23('0x18')]===0x1f4){logger[_0xad23('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x5ce941,_0x5c35b5[_0xad23('0x17')][_0xad23('0x19')]);return _0x25a158(_0x5c35b5[_0xad23('0x17')][_0xad23('0x19')]);}logger[_0xad23('0x17')](_0xad23('0x12'),_0x5ce941,_0x5c35b5[_0xad23('0x17')][_0xad23('0x19')]);return _0x3f3954(_0x5c35b5[_0xad23('0x17')][_0xad23('0x19')]);}else{logger['info'](_0xad23('0x12'),_0x5ce941,_0xad23('0x13'));_0x3f3954(_0x5c35b5[_0xad23('0x1a')][_0xad23('0x19')]);}})[_0xad23('0x1b')](function(_0x1f1972){logger[_0xad23('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x5ce941,_0x1f1972);_0x25a158(_0x1f1972);});});}exports['ShowWhatsappAccount']=function(_0x444426){var _0x5e3119=this;return new Promise(function(_0x15eb54,_0x5d49f2){return db[_0xad23('0x1c')][_0xad23('0x1d')]({'raw':_0x444426[_0xad23('0x1e')]?_0x444426[_0xad23('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x444426[_0xad23('0x1e')]?_0x444426['options'][_0xad23('0x1f')]||null:null,'attributes':_0x444426[_0xad23('0x1e')]?_0x444426[_0xad23('0x1e')][_0xad23('0x20')]||null:null,'include':_0x444426[_0xad23('0x1e')]?_0x444426['options'][_0xad23('0x21')]?_[_0xad23('0x22')](_0x444426[_0xad23('0x1e')][_0xad23('0x21')],function(_0x3f8f85){return{'model':db[_0x3f8f85[_0xad23('0x23')]],'as':_0x3f8f85['as'],'attributes':_0x3f8f85[_0xad23('0x20')],'include':_0x3f8f85[_0xad23('0x21')]?_['map'](_0x3f8f85['include'],function(_0x304b14){return{'model':db[_0x304b14[_0xad23('0x23')]],'as':_0x304b14['as'],'attributes':_0x304b14[_0xad23('0x20')],'include':_0x304b14['include']?_[_0xad23('0x22')](_0x304b14['include'],function(_0x4982cf){return{'model':db[_0x4982cf['model']],'as':_0x4982cf['as'],'attributes':_0x4982cf[_0xad23('0x20')]};}):[]};}):[]};}):[]:[]})[_0xad23('0x10')](function(_0x4f32c8){logger[_0xad23('0x11')](_0xad23('0x24'),_0x444426);logger[_0xad23('0x14')](_0xad23('0x24'),_0x444426,JSON[_0xad23('0x16')](_0x4f32c8));_0x15eb54(_0x4f32c8);})[_0xad23('0x1b')](function(_0x285676){logger[_0xad23('0x17')](_0xad23('0x24'),_0x285676[_0xad23('0x19')],_0x444426);_0x5d49f2(_0x5e3119[_0xad23('0x17')](0x1f4,_0x285676[_0xad23('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 72506b1..52a5d8e 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 _0x0bcc=['save','remove','update','removeListener','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x45c4ae,_0x416cd5){var _0xe3f4bb=function(_0x12ae81){while(--_0x12ae81){_0x45c4ae['push'](_0x45c4ae['shift']());}};_0xe3f4bb(++_0x416cd5);}(_0x0bcc,0x156));var _0xc0bc=function(_0x45380c,_0xc10e5d){_0x45380c=_0x45380c-0x0;var _0x26fccb=_0x0bcc[_0x45380c];return _0x26fccb;};'use strict';var WhatsappAccountEvents=require(_0xc0bc('0x0'));var events=[_0xc0bc('0x1'),_0xc0bc('0x2'),_0xc0bc('0x3')];function createListener(_0x3c8aa9,_0x28e0f4){return function(_0x47275d){_0x28e0f4['emit'](_0x3c8aa9,_0x47275d);};}function removeListener(_0xdf0c78,_0x69bf45){return function(){WhatsappAccountEvents[_0xc0bc('0x4')](_0xdf0c78,_0x69bf45);};}exports[_0xc0bc('0x5')]=function(_0xcc6174){for(var _0x39d7dd=0x0,_0x686a7d=events['length'];_0x39d7dd<_0x686a7d;_0x39d7dd++){var _0x1fc789=events[_0x39d7dd];var _0x4c6a75=createListener(_0xc0bc('0x6')+_0x1fc789,_0xcc6174);WhatsappAccountEvents['on'](_0x1fc789,_0x4c6a75);}}; \ No newline at end of file +var _0x886b=['./whatsappAccount.events','save','remove','removeListener','register','length'];(function(_0x34ac64,_0x23f246){var _0xae8ae9=function(_0x34cdcd){while(--_0x34cdcd){_0x34ac64['push'](_0x34ac64['shift']());}};_0xae8ae9(++_0x23f246);}(_0x886b,0x1e6));var _0xb886=function(_0x385109,_0x2b1c9f){_0x385109=_0x385109-0x0;var _0x392add=_0x886b[_0x385109];return _0x392add;};'use strict';var WhatsappAccountEvents=require(_0xb886('0x0'));var events=[_0xb886('0x1'),_0xb886('0x2'),'update'];function createListener(_0x5ce1f0,_0x6bbd11){return function(_0x19393c){_0x6bbd11['emit'](_0x5ce1f0,_0x19393c);};}function removeListener(_0x308bb8,_0x1c6c0e){return function(){WhatsappAccountEvents[_0xb886('0x3')](_0x308bb8,_0x1c6c0e);};}exports[_0xb886('0x4')]=function(_0x5562f0){for(var _0x23b042=0x0,_0x35a063=events[_0xb886('0x5')];_0x23b042<_0x35a063;_0x23b042++){var _0x27a742=events[_0x23b042];var _0x485afd=createListener('whatsappAccount:'+_0x27a742,_0x5562f0);WhatsappAccountEvents['on'](_0x27a742,_0x485afd);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index ed2ee9c..e4e49e1 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 _0x732b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x4cf72b,_0x3ab028){var _0x591e52=function(_0x48fe3a){while(--_0x48fe3a){_0x4cf72b['push'](_0x4cf72b['shift']());}};_0x591e52(++_0x3ab028);}(_0x732b,0x13d));var _0xb732=function(_0x2558c9,_0x1e6b31){_0x2558c9=_0x2558c9-0x0;var _0x511b30=_0x732b[_0x2558c9];return _0x511b30;};'use strict';var multer=require(_0xb732('0x0'));var util=require(_0xb732('0x1'));var path=require(_0xb732('0x2'));var timeout=require(_0xb732('0x3'));var express=require(_0xb732('0x4'));var router=express[_0xb732('0x5')]();var fs_extra=require(_0xb732('0x6'));var auth=require(_0xb732('0x7'));var interaction=require(_0xb732('0x8'));var config=require(_0xb732('0x9'));var controller=require('./whatsappApplication.controller');router[_0xb732('0xa')]('/',auth[_0xb732('0xb')](),controller[_0xb732('0xc')]);router[_0xb732('0xa')](_0xb732('0xd'),auth[_0xb732('0xb')](),controller[_0xb732('0xe')]);router[_0xb732('0xf')]('/',auth[_0xb732('0xb')](),controller[_0xb732('0x10')]);router[_0xb732('0x11')](_0xb732('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xb732('0x12')](_0xb732('0xd'),auth[_0xb732('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x98da=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x221c0e,_0x1cf4e5){var _0x1ffc3a=function(_0x5acf10){while(--_0x5acf10){_0x221c0e['push'](_0x221c0e['shift']());}};_0x1ffc3a(++_0x1cf4e5);}(_0x98da,0x1e4));var _0xa98d=function(_0x13c9d8,_0xcab345){_0x13c9d8=_0x13c9d8-0x0;var _0x328d6c=_0x98da[_0x13c9d8];return _0x328d6c;};'use strict';var multer=require(_0xa98d('0x0'));var util=require(_0xa98d('0x1'));var path=require(_0xa98d('0x2'));var timeout=require(_0xa98d('0x3'));var express=require('express');var router=express[_0xa98d('0x4')]();var fs_extra=require(_0xa98d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa98d('0x6'));var config=require(_0xa98d('0x7'));var controller=require(_0xa98d('0x8'));router[_0xa98d('0x9')]('/',auth[_0xa98d('0xa')](),controller[_0xa98d('0xb')]);router[_0xa98d('0x9')](_0xa98d('0xc'),auth[_0xa98d('0xa')](),controller[_0xa98d('0xd')]);router[_0xa98d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa98d('0xf')](_0xa98d('0xc'),auth[_0xa98d('0xa')](),controller[_0xa98d('0x10')]);router[_0xa98d('0x11')](_0xa98d('0xc'),auth[_0xa98d('0xa')](),controller[_0xa98d('0x12')]);module[_0xa98d('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index ea8efc3..807a9c1 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 _0xb961=['sequelize','exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x4487b2,_0x432f6b){var _0x5b33a1=function(_0x5c7baf){while(--_0x5c7baf){_0x4487b2['push'](_0x4487b2['shift']());}};_0x5b33a1(++_0x432f6b);}(_0xb961,0x114));var _0x1b96=function(_0x542439,_0x351d64){_0x542439=_0x542439-0x0;var _0xb9db8c=_0xb961[_0x542439];return _0xb9db8c;};'use strict';var Sequelize=require(_0x1b96('0x0'));module[_0x1b96('0x1')]={'priority':{'type':Sequelize[_0x1b96('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1b96('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1b96('0x4')]()},'description':{'type':Sequelize[_0x1b96('0x3')]},'interval':{'type':Sequelize[_0x1b96('0x3')],'defaultValue':_0x1b96('0x5')}}; \ No newline at end of file +var _0x1de6=['STRING','noop','TEXT','*,*,*,*','INTEGER'];(function(_0x425d63,_0xfd9bcb){var _0x173eed=function(_0x233915){while(--_0x233915){_0x425d63['push'](_0x425d63['shift']());}};_0x173eed(++_0xfd9bcb);}(_0x1de6,0x1d5));var _0x61de=function(_0x2eadbe,_0x3aa115){_0x2eadbe=_0x2eadbe-0x0;var _0x249dee=_0x1de6[_0x2eadbe];return _0x249dee;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x61de('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x61de('0x1')],'allowNull':![],'defaultValue':_0x61de('0x2')},'appdata':{'type':Sequelize[_0x61de('0x3')]()},'description':{'type':Sequelize[_0x61de('0x1')]},'interval':{'type':Sequelize[_0x61de('0x1')],'defaultValue':_0x61de('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index a6086f0..f56a9e1 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 _0xc905=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','WhatsappApplication','includeAll','include','rows','show','params','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv'];(function(_0x3fb4ab,_0x16fd17){var _0x12f4a9=function(_0x5a372b){while(--_0x5a372b){_0x3fb4ab['push'](_0x3fb4ab['shift']());}};_0x12f4a9(++_0x16fd17);}(_0xc905,0x1b3));var _0x5c90=function(_0x57d911,_0x24f494){_0x57d911=_0x57d911-0x0;var _0x52840a=_0xc905[_0x57d911];return _0x52840a;};'use strict';var emlformat=require(_0x5c90('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c90('0x1'));var jsonpatch=require(_0x5c90('0x2'));var rp=require(_0x5c90('0x3'));var moment=require(_0x5c90('0x4'));var BPromise=require(_0x5c90('0x5'));var Mustache=require(_0x5c90('0x6'));var util=require(_0x5c90('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5c90('0x8'));var ejs=require(_0x5c90('0x9'));var fs=require('fs');var fs_extra=require(_0x5c90('0xa'));var _=require('lodash');var squel=require(_0x5c90('0xb'));var crypto=require(_0x5c90('0xc'));var jsforce=require(_0x5c90('0xd'));var deskjs=require(_0x5c90('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5c90('0xf'));var Papa=require(_0x5c90('0x10'));var Redis=require(_0x5c90('0x11'));var authService=require(_0x5c90('0x12'));var qs=require(_0x5c90('0x13'));var as=require(_0x5c90('0x14'));var hardwareService=require(_0x5c90('0x15'));var logger=require(_0x5c90('0x16'))(_0x5c90('0x17'));var utils=require(_0x5c90('0x18'));var config=require(_0x5c90('0x19'));var licenseUtil=require(_0x5c90('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x263210,_0x54488c){_0x54488c=_0x54488c||0xcc;return function(_0x813b55){if(_0x813b55){return _0x263210[_0x5c90('0x1b')](_0x54488c);}return _0x263210[_0x5c90('0x1c')](_0x54488c)[_0x5c90('0x1d')]();};}function respondWithResult(_0x43b856,_0x37069f){_0x37069f=_0x37069f||0xc8;return function(_0x2c8472){if(_0x2c8472){return _0x43b856[_0x5c90('0x1c')](_0x37069f)[_0x5c90('0x1e')](_0x2c8472);}};}function respondWithFilteredResult(_0x17d30a,_0x92a011){return function(_0x2606ea){if(_0x2606ea){var _0x3bf668=_0x2606ea[_0x5c90('0x1f')],_0x5b01c0=_0x92a011[_0x5c90('0x20')],_0x457cd4=_0x92a011[_0x5c90('0x20')]+_0x92a011[_0x5c90('0x21')],_0x1c5820;if(_0x457cd4>=_0x3bf668){_0x457cd4=_0x3bf668;_0x1c5820=0xc8;}else{_0x1c5820=0xce;}_0x17d30a[_0x5c90('0x1c')](_0x1c5820);return _0x17d30a[_0x5c90('0x22')](_0x5c90('0x23'),_0x5b01c0+'-'+_0x457cd4+'/'+_0x3bf668)['json'](_0x2606ea);}return null;};}function patchUpdates(_0x506cf4){return function(_0x1f9a00){try{jsonpatch['apply'](_0x1f9a00,_0x506cf4,!![]);}catch(_0x6873a4){return BPromise[_0x5c90('0x24')](_0x6873a4);}return _0x1f9a00[_0x5c90('0x25')]();};}function saveUpdates(_0x37a166,_0x1fdf18){return function(_0x199466){if(_0x199466){return _0x199466[_0x5c90('0x26')](_0x37a166)[_0x5c90('0x27')](function(_0x47ff5c){return _0x47ff5c;});}return null;};}function removeEntity(_0x59cc44,_0x25f8a1){return function(_0x139a70){if(_0x139a70){return _0x139a70[_0x5c90('0x28')]()[_0x5c90('0x27')](function(){_0x59cc44[_0x5c90('0x1c')](0xcc)[_0x5c90('0x1d')]();});}};}function handleEntityNotFound(_0xd68986,_0x3af79e){return function(_0x129c8b){if(!_0x129c8b){_0xd68986[_0x5c90('0x1b')](0x194);}return _0x129c8b;};}function handleError(_0x4df525,_0x10a1ab){_0x10a1ab=_0x10a1ab||0x1f4;return function(_0x4685ad){logger[_0x5c90('0x29')](_0x4685ad[_0x5c90('0x2a')]);if(_0x4685ad['name']){delete _0x4685ad[_0x5c90('0x2b')];}_0x4df525['status'](_0x10a1ab)[_0x5c90('0x2c')](_0x4685ad);};}exports[_0x5c90('0x2d')]=function(_0x4f90ff,_0x616d){var _0x78c022={},_0x3343d9={},_0x1fa120={'count':0x0,'rows':[]};var _0x3a4a9f=_['map'](db['WhatsappApplication'][_0x5c90('0x2e')],function(_0x13dacc){return{'name':_0x13dacc[_0x5c90('0x2f')],'type':_0x13dacc[_0x5c90('0x30')]['key']};});_0x3343d9['model']=_[_0x5c90('0x31')](_0x3a4a9f,_0x5c90('0x2b'));_0x3343d9[_0x5c90('0x32')]=_[_0x5c90('0x33')](_0x4f90ff[_0x5c90('0x32')]);_0x3343d9[_0x5c90('0x34')]=_[_0x5c90('0x35')](_0x3343d9[_0x5c90('0x36')],_0x3343d9['query']);_0x78c022[_0x5c90('0x37')]=_[_0x5c90('0x35')](_0x3343d9[_0x5c90('0x36')],qs[_0x5c90('0x38')](_0x4f90ff['query']['fields']));_0x78c022[_0x5c90('0x37')]=_0x78c022['attributes'][_0x5c90('0x39')]?_0x78c022['attributes']:_0x3343d9[_0x5c90('0x36')];if(!_0x4f90ff[_0x5c90('0x32')][_0x5c90('0x3a')](_0x5c90('0x3b'))){_0x78c022[_0x5c90('0x21')]=qs[_0x5c90('0x21')](_0x4f90ff[_0x5c90('0x32')]['limit']);_0x78c022[_0x5c90('0x20')]=qs['offset'](_0x4f90ff['query']['offset']);}_0x78c022[_0x5c90('0x3c')]=qs[_0x5c90('0x3d')](_0x4f90ff[_0x5c90('0x32')][_0x5c90('0x3d')]);_0x78c022[_0x5c90('0x3e')]=qs[_0x5c90('0x34')](_['pick'](_0x4f90ff['query'],_0x3343d9[_0x5c90('0x34')]),_0x3a4a9f);if(_0x4f90ff[_0x5c90('0x32')]['filter']){_0x78c022[_0x5c90('0x3e')]=_['merge'](_0x78c022[_0x5c90('0x3e')],{'$or':_[_0x5c90('0x31')](_0x3a4a9f,function(_0x15b429){if(_0x15b429[_0x5c90('0x30')]!=='VIRTUAL'){var _0x730ee1={};_0x730ee1[_0x15b429[_0x5c90('0x2b')]]={'$like':'%'+_0x4f90ff[_0x5c90('0x32')][_0x5c90('0x3f')]+'%'};return _0x730ee1;}})});}_0x78c022=_[_0x5c90('0x40')]({},_0x78c022,_0x4f90ff[_0x5c90('0x41')]);var _0x3ace47={'where':_0x78c022[_0x5c90('0x3e')]};return db[_0x5c90('0x42')][_0x5c90('0x1f')](_0x3ace47)[_0x5c90('0x27')](function(_0x2b312c){_0x1fa120[_0x5c90('0x1f')]=_0x2b312c;if(_0x4f90ff['query'][_0x5c90('0x43')]){_0x78c022[_0x5c90('0x44')]=[{'all':!![]}];}return db[_0x5c90('0x42')]['findAll'](_0x78c022);})[_0x5c90('0x27')](function(_0xbb504d){_0x1fa120[_0x5c90('0x45')]=_0xbb504d;return _0x1fa120;})[_0x5c90('0x27')](respondWithFilteredResult(_0x616d,_0x78c022))['catch'](handleError(_0x616d,null));};exports[_0x5c90('0x46')]=function(_0x61d8f0,_0x4b5f07){var _0x33f7fa={'raw':!![],'where':{'id':_0x61d8f0[_0x5c90('0x47')]['id']}},_0x125be2={};_0x125be2['model']=_['keys'](db['WhatsappApplication'][_0x5c90('0x2e')]);_0x125be2[_0x5c90('0x32')]=_['keys'](_0x61d8f0[_0x5c90('0x32')]);_0x125be2['filters']=_['intersection'](_0x125be2[_0x5c90('0x36')],_0x125be2[_0x5c90('0x32')]);_0x33f7fa[_0x5c90('0x37')]=_[_0x5c90('0x35')](_0x125be2['model'],qs[_0x5c90('0x38')](_0x61d8f0[_0x5c90('0x32')]['fields']));_0x33f7fa['attributes']=_0x33f7fa[_0x5c90('0x37')]['length']?_0x33f7fa[_0x5c90('0x37')]:_0x125be2['model'];if(_0x61d8f0['query'][_0x5c90('0x43')]){_0x33f7fa[_0x5c90('0x44')]=[{'all':!![]}];}_0x33f7fa=_['merge']({},_0x33f7fa,_0x61d8f0[_0x5c90('0x41')]);return db['WhatsappApplication']['find'](_0x33f7fa)['then'](handleEntityNotFound(_0x4b5f07,null))['then'](respondWithResult(_0x4b5f07,null))['catch'](handleError(_0x4b5f07,null));};exports['create']=function(_0x2bf201,_0x3b5553){return db['WhatsappApplication']['create'](_0x2bf201[_0x5c90('0x48')],{})['then'](respondWithResult(_0x3b5553,0xc9))['catch'](handleError(_0x3b5553,null));};exports['update']=function(_0x5b8022,_0x15dd31){if(_0x5b8022[_0x5c90('0x48')]['id']){delete _0x5b8022[_0x5c90('0x48')]['id'];}return db[_0x5c90('0x42')]['find']({'where':{'id':_0x5b8022[_0x5c90('0x47')]['id']}})[_0x5c90('0x27')](handleEntityNotFound(_0x15dd31,null))[_0x5c90('0x27')](saveUpdates(_0x5b8022[_0x5c90('0x48')],null))['then'](respondWithResult(_0x15dd31,null))[_0x5c90('0x49')](handleError(_0x15dd31,null));};exports[_0x5c90('0x28')]=function(_0x8ca35,_0x1d87c9){return db['WhatsappApplication']['find']({'where':{'id':_0x8ca35[_0x5c90('0x47')]['id']}})[_0x5c90('0x27')](handleEntityNotFound(_0x1d87c9,null))[_0x5c90('0x27')](removeEntity(_0x1d87c9,null))['catch'](handleError(_0x1d87c9,null));}; \ No newline at end of file +var _0x45d7=['json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','WhatsappApplication','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','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','sendStatus','status','end'];(function(_0x4d75c6,_0x3b0a68){var _0x612c4b=function(_0x13a710){while(--_0x13a710){_0x4d75c6['push'](_0x4d75c6['shift']());}};_0x612c4b(++_0x3b0a68);}(_0x45d7,0x1de));var _0x745d=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x45d7[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x745d('0x0'));var rp=require(_0x745d('0x1'));var moment=require(_0x745d('0x2'));var BPromise=require(_0x745d('0x3'));var Mustache=require(_0x745d('0x4'));var util=require(_0x745d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x745d('0x6'));var ejs=require(_0x745d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x745d('0x8'));var squel=require(_0x745d('0x9'));var crypto=require('crypto');var jsforce=require(_0x745d('0xa'));var deskjs=require(_0x745d('0xb'));var toCsv=require(_0x745d('0x6'));var querystring=require(_0x745d('0xc'));var Papa=require('papaparse');var Redis=require(_0x745d('0xd'));var authService=require(_0x745d('0xe'));var qs=require(_0x745d('0xf'));var as=require(_0x745d('0x10'));var hardwareService=require(_0x745d('0x11'));var logger=require('../../config/logger')(_0x745d('0x12'));var utils=require(_0x745d('0x13'));var config=require(_0x745d('0x14'));var licenseUtil=require(_0x745d('0x15'));var db=require(_0x745d('0x16'))['db'];function respondWithStatusCode(_0x314c52,_0x2309db){_0x2309db=_0x2309db||0xcc;return function(_0x175125){if(_0x175125){return _0x314c52[_0x745d('0x17')](_0x2309db);}return _0x314c52[_0x745d('0x18')](_0x2309db)[_0x745d('0x19')]();};}function respondWithResult(_0x5d33d0,_0x31b9b4){_0x31b9b4=_0x31b9b4||0xc8;return function(_0x473bde){if(_0x473bde){return _0x5d33d0[_0x745d('0x18')](_0x31b9b4)[_0x745d('0x1a')](_0x473bde);}};}function respondWithFilteredResult(_0x5c75a4,_0x44dab0){return function(_0x515ddc){if(_0x515ddc){var _0x4172db=_0x515ddc[_0x745d('0x1b')],_0x3d0f9b=_0x44dab0['offset'],_0x1d31ae=_0x44dab0[_0x745d('0x1c')]+_0x44dab0['limit'],_0x2a3849;if(_0x1d31ae>=_0x4172db){_0x1d31ae=_0x4172db;_0x2a3849=0xc8;}else{_0x2a3849=0xce;}_0x5c75a4[_0x745d('0x18')](_0x2a3849);return _0x5c75a4[_0x745d('0x1d')](_0x745d('0x1e'),_0x3d0f9b+'-'+_0x1d31ae+'/'+_0x4172db)[_0x745d('0x1a')](_0x515ddc);}return null;};}function patchUpdates(_0xb05ca5){return function(_0x225802){try{jsonpatch[_0x745d('0x1f')](_0x225802,_0xb05ca5,!![]);}catch(_0x5eb0c6){return BPromise['reject'](_0x5eb0c6);}return _0x225802[_0x745d('0x20')]();};}function saveUpdates(_0xa62f17,_0x4226db){return function(_0x4dcb29){if(_0x4dcb29){return _0x4dcb29[_0x745d('0x21')](_0xa62f17)[_0x745d('0x22')](function(_0x58cd67){return _0x58cd67;});}return null;};}function removeEntity(_0x344af6,_0x5ce3c5){return function(_0x2d43ce){if(_0x2d43ce){return _0x2d43ce[_0x745d('0x23')]()[_0x745d('0x22')](function(){_0x344af6[_0x745d('0x18')](0xcc)[_0x745d('0x19')]();});}};}function handleEntityNotFound(_0x4d3ed8,_0x34841a){return function(_0x1f9f29){if(!_0x1f9f29){_0x4d3ed8[_0x745d('0x17')](0x194);}return _0x1f9f29;};}function handleError(_0x3e2752,_0x28e573){_0x28e573=_0x28e573||0x1f4;return function(_0x380010){logger[_0x745d('0x24')](_0x380010['stack']);if(_0x380010[_0x745d('0x25')]){delete _0x380010['name'];}_0x3e2752[_0x745d('0x18')](_0x28e573)[_0x745d('0x26')](_0x380010);};}exports[_0x745d('0x27')]=function(_0x457eac,_0x616eb5){var _0x1a3ef2={},_0xd3d4b8={},_0x5518d9={'count':0x0,'rows':[]};var _0x308b28=_['map'](db[_0x745d('0x28')][_0x745d('0x29')],function(_0xce98f0){return{'name':_0xce98f0[_0x745d('0x2a')],'type':_0xce98f0[_0x745d('0x2b')]['key']};});_0xd3d4b8[_0x745d('0x2c')]=_['map'](_0x308b28,_0x745d('0x25'));_0xd3d4b8[_0x745d('0x2d')]=_['keys'](_0x457eac[_0x745d('0x2d')]);_0xd3d4b8[_0x745d('0x2e')]=_[_0x745d('0x2f')](_0xd3d4b8['model'],_0xd3d4b8[_0x745d('0x2d')]);_0x1a3ef2['attributes']=_[_0x745d('0x2f')](_0xd3d4b8[_0x745d('0x2c')],qs[_0x745d('0x30')](_0x457eac[_0x745d('0x2d')][_0x745d('0x30')]));_0x1a3ef2[_0x745d('0x31')]=_0x1a3ef2[_0x745d('0x31')][_0x745d('0x32')]?_0x1a3ef2[_0x745d('0x31')]:_0xd3d4b8['model'];if(!_0x457eac[_0x745d('0x2d')][_0x745d('0x33')]('nolimit')){_0x1a3ef2['limit']=qs[_0x745d('0x34')](_0x457eac[_0x745d('0x2d')][_0x745d('0x34')]);_0x1a3ef2[_0x745d('0x1c')]=qs[_0x745d('0x1c')](_0x457eac[_0x745d('0x2d')][_0x745d('0x1c')]);}_0x1a3ef2[_0x745d('0x35')]=qs[_0x745d('0x36')](_0x457eac['query'][_0x745d('0x36')]);_0x1a3ef2[_0x745d('0x37')]=qs['filters'](_[_0x745d('0x38')](_0x457eac[_0x745d('0x2d')],_0xd3d4b8[_0x745d('0x2e')]),_0x308b28);if(_0x457eac[_0x745d('0x2d')][_0x745d('0x39')]){_0x1a3ef2[_0x745d('0x37')]=_[_0x745d('0x3a')](_0x1a3ef2['where'],{'$or':_[_0x745d('0x3b')](_0x308b28,function(_0x403851){if(_0x403851[_0x745d('0x2b')]!=='VIRTUAL'){var _0x1cfc47={};_0x1cfc47[_0x403851[_0x745d('0x25')]]={'$like':'%'+_0x457eac[_0x745d('0x2d')][_0x745d('0x39')]+'%'};return _0x1cfc47;}})});}_0x1a3ef2=_[_0x745d('0x3a')]({},_0x1a3ef2,_0x457eac[_0x745d('0x3c')]);var _0x710f8={'where':_0x1a3ef2[_0x745d('0x37')]};return db['WhatsappApplication'][_0x745d('0x1b')](_0x710f8)['then'](function(_0x11d5d8){_0x5518d9[_0x745d('0x1b')]=_0x11d5d8;if(_0x457eac[_0x745d('0x2d')][_0x745d('0x3d')]){_0x1a3ef2[_0x745d('0x3e')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x745d('0x3f')](_0x1a3ef2);})[_0x745d('0x22')](function(_0x2629cc){_0x5518d9[_0x745d('0x40')]=_0x2629cc;return _0x5518d9;})[_0x745d('0x22')](respondWithFilteredResult(_0x616eb5,_0x1a3ef2))[_0x745d('0x41')](handleError(_0x616eb5,null));};exports[_0x745d('0x42')]=function(_0x38464d,_0x158dde){var _0x386bb0={'raw':!![],'where':{'id':_0x38464d[_0x745d('0x43')]['id']}},_0x3d6d06={};_0x3d6d06['model']=_[_0x745d('0x44')](db[_0x745d('0x28')][_0x745d('0x29')]);_0x3d6d06[_0x745d('0x2d')]=_[_0x745d('0x44')](_0x38464d[_0x745d('0x2d')]);_0x3d6d06[_0x745d('0x2e')]=_[_0x745d('0x2f')](_0x3d6d06[_0x745d('0x2c')],_0x3d6d06[_0x745d('0x2d')]);_0x386bb0['attributes']=_[_0x745d('0x2f')](_0x3d6d06[_0x745d('0x2c')],qs[_0x745d('0x30')](_0x38464d[_0x745d('0x2d')][_0x745d('0x30')]));_0x386bb0[_0x745d('0x31')]=_0x386bb0[_0x745d('0x31')]['length']?_0x386bb0[_0x745d('0x31')]:_0x3d6d06['model'];if(_0x38464d[_0x745d('0x2d')]['includeAll']){_0x386bb0[_0x745d('0x3e')]=[{'all':!![]}];}_0x386bb0=_[_0x745d('0x3a')]({},_0x386bb0,_0x38464d[_0x745d('0x3c')]);return db[_0x745d('0x28')][_0x745d('0x45')](_0x386bb0)[_0x745d('0x22')](handleEntityNotFound(_0x158dde,null))[_0x745d('0x22')](respondWithResult(_0x158dde,null))[_0x745d('0x41')](handleError(_0x158dde,null));};exports[_0x745d('0x46')]=function(_0x4c939e,_0xaf13eb){return db[_0x745d('0x28')][_0x745d('0x46')](_0x4c939e['body'],{})[_0x745d('0x22')](respondWithResult(_0xaf13eb,0xc9))['catch'](handleError(_0xaf13eb,null));};exports['update']=function(_0x505193,_0x260d16){if(_0x505193['body']['id']){delete _0x505193[_0x745d('0x47')]['id'];}return db[_0x745d('0x28')][_0x745d('0x45')]({'where':{'id':_0x505193['params']['id']}})[_0x745d('0x22')](handleEntityNotFound(_0x260d16,null))[_0x745d('0x22')](saveUpdates(_0x505193['body'],null))[_0x745d('0x22')](respondWithResult(_0x260d16,null))['catch'](handleError(_0x260d16,null));};exports[_0x745d('0x23')]=function(_0x56d974,_0x3b3357){return db[_0x745d('0x28')][_0x745d('0x45')]({'where':{'id':_0x56d974[_0x745d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3b3357,null))[_0x745d('0x22')](removeEntity(_0x3b3357,null))['catch'](handleError(_0x3b3357,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 71ff89f..2565995 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 _0xd8a2=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','utf8mb4'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd8a2,0x187));var _0x2d8a=function(_0x19e99a,_0x482d89){_0x19e99a=_0x19e99a-0x0;var _0x29233d=_0xd8a2[_0x19e99a];return _0x29233d;};'use strict';var _=require('lodash');var util=require(_0x2d8a('0x0'));var logger=require(_0x2d8a('0x1'))(_0x2d8a('0x2'));var moment=require(_0x2d8a('0x3'));var BPromise=require(_0x2d8a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d8a('0x5'));var rimraf=require('rimraf');var config=require(_0x2d8a('0x6'));var attributes=require(_0x2d8a('0x7'));module[_0x2d8a('0x8')]=function(_0x526220,_0xa53a25){return _0x526220[_0x2d8a('0x9')](_0x2d8a('0xa'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d8a('0xb'),'collate':_0x2d8a('0xc')});}; \ No newline at end of file +var _0x8a1c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications'];(function(_0x47d83c,_0x281f31){var _0x57cd79=function(_0x1a1503){while(--_0x1a1503){_0x47d83c['push'](_0x47d83c['shift']());}};_0x57cd79(++_0x281f31);}(_0x8a1c,0x126));var _0xc8a1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8a1c[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xc8a1('0x0'));var util=require(_0xc8a1('0x1'));var logger=require(_0xc8a1('0x2'))(_0xc8a1('0x3'));var moment=require(_0xc8a1('0x4'));var BPromise=require(_0xc8a1('0x5'));var rp=require(_0xc8a1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8a1('0x7'));var config=require(_0xc8a1('0x8'));var attributes=require(_0xc8a1('0x9'));module[_0xc8a1('0xa')]=function(_0x35bbab,_0x446ee7){return _0x35bbab[_0xc8a1('0xb')](_0xc8a1('0xc'),attributes,{'tableName':_0xc8a1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 f261b58..41fc8d3 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 _0xa6bb=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0x380fc0,_0x197b18){var _0x2dea76=function(_0x391292){while(--_0x391292){_0x380fc0['push'](_0x380fc0['shift']());}};_0x2dea76(++_0x197b18);}(_0xa6bb,0x12c));var _0xba6b=function(_0x5e369e,_0x4b3b9d){_0x5e369e=_0x5e369e-0x0;var _0x6d6a19=_0xa6bb[_0x5e369e];return _0x6d6a19;};'use strict';var _=require('lodash');var util=require(_0xba6b('0x0'));var moment=require(_0xba6b('0x1'));var BPromise=require(_0xba6b('0x2'));var rs=require(_0xba6b('0x3'));var fs=require('fs');var Redis=require(_0xba6b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba6b('0x5'))(_0xba6b('0x6'));var config=require(_0xba6b('0x7'));var jayson=require(_0xba6b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a00d6,_0x4f6c6c,_0x2f305e){return new BPromise(function(_0x5506d6,_0x55f5c3){return client[_0xba6b('0x9')](_0x2a00d6,_0x2f305e)[_0xba6b('0xa')](function(_0x2cab30){logger[_0xba6b('0xb')](_0xba6b('0xc'),_0x4f6c6c,'request\x20sent');logger[_0xba6b('0xd')](_0xba6b('0xe'),_0x4f6c6c,_0xba6b('0xf'),JSON['stringify'](_0x2cab30));if(_0x2cab30[_0xba6b('0x10')]){if(_0x2cab30[_0xba6b('0x10')][_0xba6b('0x11')]===0x1f4){logger[_0xba6b('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4f6c6c,_0x2cab30[_0xba6b('0x10')]['message']);return _0x55f5c3(_0x2cab30[_0xba6b('0x10')][_0xba6b('0x12')]);}logger[_0xba6b('0x10')](_0xba6b('0xc'),_0x4f6c6c,_0x2cab30[_0xba6b('0x10')]['message']);return _0x5506d6(_0x2cab30[_0xba6b('0x10')][_0xba6b('0x12')]);}else{logger['info'](_0xba6b('0xc'),_0x4f6c6c,_0xba6b('0xf'));_0x5506d6(_0x2cab30['result']['message']);}})[_0xba6b('0x13')](function(_0x5b32cd){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x4f6c6c,_0x5b32cd);_0x55f5c3(_0x5b32cd);});});} \ No newline at end of file +var _0x44e8=['WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug'];(function(_0x3759d1,_0x448438){var _0x4077c9=function(_0x10b820){while(--_0x10b820){_0x3759d1['push'](_0x3759d1['shift']());}};_0x4077c9(++_0x448438);}(_0x44e8,0xd7));var _0x844e=function(_0x16fb0e,_0x421512){_0x16fb0e=_0x16fb0e-0x0;var _0xa6e783=_0x44e8[_0x16fb0e];return _0xa6e783;};'use strict';var _=require(_0x844e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x844e('0x1'));var rs=require(_0x844e('0x2'));var fs=require('fs');var Redis=require(_0x844e('0x3'));var db=require(_0x844e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x844e('0x5'))(_0x844e('0x6'));var config=require(_0x844e('0x7'));var jayson=require(_0x844e('0x8'));var client=jayson['client'][_0x844e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x238796,_0x1706b3,_0x11cbd6){return new BPromise(function(_0x571b91,_0x31ab50){return client[_0x844e('0xa')](_0x238796,_0x11cbd6)[_0x844e('0xb')](function(_0x134672){logger[_0x844e('0xc')](_0x844e('0xd'),_0x1706b3,'request\x20sent');logger[_0x844e('0xe')](_0x844e('0xf'),_0x1706b3,_0x844e('0x10'),JSON[_0x844e('0x11')](_0x134672));if(_0x134672[_0x844e('0x12')]){if(_0x134672[_0x844e('0x12')][_0x844e('0x13')]===0x1f4){logger['error'](_0x844e('0xd'),_0x1706b3,_0x134672[_0x844e('0x12')]['message']);return _0x31ab50(_0x134672[_0x844e('0x12')][_0x844e('0x14')]);}logger['error'](_0x844e('0xd'),_0x1706b3,_0x134672[_0x844e('0x12')][_0x844e('0x14')]);return _0x571b91(_0x134672['error'][_0x844e('0x14')]);}else{logger[_0x844e('0xc')](_0x844e('0xd'),_0x1706b3,_0x844e('0x10'));_0x571b91(_0x134672[_0x844e('0x15')][_0x844e('0x14')]);}})[_0x844e('0x16')](function(_0x5506ef){logger['error'](_0x844e('0xd'),_0x1706b3,_0x5506ef);_0x31ab50(_0x5506ef);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 9b0da3d..8906247 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 _0xa2aa=['update','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','put','whatsapp','whatsappinteraction:update'];(function(_0x5b6ca1,_0x5be263){var _0x253508=function(_0x121d89){while(--_0x121d89){_0x5b6ca1['push'](_0x5b6ca1['shift']());}};_0x253508(++_0x5be263);}(_0xa2aa,0x109));var _0xaa2a=function(_0x3bdda5,_0x895c28){_0x3bdda5=_0x3bdda5-0x0;var _0x212c6a=_0xa2aa[_0x3bdda5];return _0x212c6a;};'use strict';var multer=require(_0xaa2a('0x0'));var util=require(_0xaa2a('0x1'));var path=require(_0xaa2a('0x2'));var timeout=require(_0xaa2a('0x3'));var express=require(_0xaa2a('0x4'));var router=express[_0xaa2a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xaa2a('0x6'));var interaction=require(_0xaa2a('0x7'));var config=require(_0xaa2a('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xaa2a('0x9')](),controller[_0xaa2a('0xa')]);router[_0xaa2a('0xb')]('/describe',auth[_0xaa2a('0x9')](),controller[_0xaa2a('0xc')]);router['get'](_0xaa2a('0xd'),auth[_0xaa2a('0x9')](),controller['show']);router[_0xaa2a('0xb')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0xaa2a('0xe'),auth[_0xaa2a('0x9')](),controller[_0xaa2a('0xf')]);router[_0xaa2a('0x10')]('/',auth[_0xaa2a('0x9')](),controller['create']);router[_0xaa2a('0x10')](_0xaa2a('0x11'),auth['isAuthenticated'](),controller[_0xaa2a('0x12')]);router[_0xaa2a('0x10')](_0xaa2a('0x13'),auth[_0xaa2a('0x9')](),interaction[_0xaa2a('0x14')]('whatsapp',_0xaa2a('0x15')),controller['addTags']);router[_0xaa2a('0x16')]('/:id',auth[_0xaa2a('0x9')](),interaction['tracked'](_0xaa2a('0x17'),_0xaa2a('0x18')),controller[_0xaa2a('0x19')]);router[_0xaa2a('0x1a')](_0xaa2a('0xd'),auth[_0xaa2a('0x9')](),interaction[_0xaa2a('0x14')]('whatsapp','whatsappinteraction:destroy'),controller['destroy']);router[_0xaa2a('0x1a')](_0xaa2a('0x13'),auth['isAuthenticated'](),controller[_0xaa2a('0x1b')]);module[_0xaa2a('0x1c')]=router; \ No newline at end of file +var _0xac43=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','delete','whatsappinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x192a33,_0xd4589){var _0x50a0bb=function(_0xe3ec7a){while(--_0xe3ec7a){_0x192a33['push'](_0x192a33['shift']());}};_0x50a0bb(++_0xd4589);}(_0xac43,0x197));var _0x3ac4=function(_0x47f927,_0x31c11b){_0x47f927=_0x47f927-0x0;var _0x18798b=_0xac43[_0x47f927];return _0x18798b;};'use strict';var multer=require(_0x3ac4('0x0'));var util=require(_0x3ac4('0x1'));var path=require(_0x3ac4('0x2'));var timeout=require(_0x3ac4('0x3'));var express=require('express');var router=express[_0x3ac4('0x4')]();var fs_extra=require(_0x3ac4('0x5'));var auth=require(_0x3ac4('0x6'));var interaction=require(_0x3ac4('0x7'));var config=require(_0x3ac4('0x8'));var controller=require('./whatsappInteraction.controller');router[_0x3ac4('0x9')]('/',auth[_0x3ac4('0xa')](),controller[_0x3ac4('0xb')]);router[_0x3ac4('0x9')](_0x3ac4('0xc'),auth['isAuthenticated'](),controller[_0x3ac4('0xd')]);router[_0x3ac4('0x9')](_0x3ac4('0xe'),auth[_0x3ac4('0xa')](),controller[_0x3ac4('0xf')]);router['get'](_0x3ac4('0x10'),auth[_0x3ac4('0xa')](),controller[_0x3ac4('0x11')]);router[_0x3ac4('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x3ac4('0x12')]);router[_0x3ac4('0x13')]('/',auth[_0x3ac4('0xa')](),controller[_0x3ac4('0x14')]);router[_0x3ac4('0x13')]('/:id/messages',auth[_0x3ac4('0xa')](),controller['addMessage']);router[_0x3ac4('0x13')](_0x3ac4('0x15'),auth[_0x3ac4('0xa')](),interaction[_0x3ac4('0x16')]('whatsapp',_0x3ac4('0x17')),controller[_0x3ac4('0x18')]);router[_0x3ac4('0x19')](_0x3ac4('0xe'),auth[_0x3ac4('0xa')](),interaction[_0x3ac4('0x16')](_0x3ac4('0x1a'),_0x3ac4('0x1b')),controller['update']);router[_0x3ac4('0x1c')](_0x3ac4('0xe'),auth[_0x3ac4('0xa')](),interaction[_0x3ac4('0x16')](_0x3ac4('0x1a'),_0x3ac4('0x1d')),controller['destroy']);router[_0x3ac4('0x1c')](_0x3ac4('0x15'),auth[_0x3ac4('0xa')](),controller[_0x3ac4('0x1e')]);module[_0x3ac4('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 85f3787..6a7e310 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 _0x7df1=['DATE','ENUM','out','moment','exports','STRING'];(function(_0x2e5521,_0x119b54){var _0x87a890=function(_0x288b67){while(--_0x288b67){_0x2e5521['push'](_0x2e5521['shift']());}};_0x87a890(++_0x119b54);}(_0x7df1,0x1bf));var _0x17df=function(_0x19f6cb,_0x5f1647){_0x19f6cb=_0x19f6cb-0x0;var _0x27e6a8=_0x7df1[_0x19f6cb];return _0x27e6a8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x17df('0x0'));module[_0x17df('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x17df('0x2')]},'secondDisposition':{'type':Sequelize[_0x17df('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x17df('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x17df('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x17df('0x4')]('in',_0x17df('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x17df('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x17df('0x4')]('in',_0x17df('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xf87d=['moment','DATE','STRING','ENUM','out','sequelize'];(function(_0x3b730b,_0x40fdb1){var _0x4540fb=function(_0x58ee88){while(--_0x58ee88){_0x3b730b['push'](_0x3b730b['shift']());}};_0x4540fb(++_0x40fdb1);}(_0xf87d,0x8f));var _0xdf87=function(_0x237a97,_0x3c67df){_0x237a97=_0x237a97-0x0;var _0x445729=_0xf87d[_0x237a97];return _0x445729;};'use strict';var Sequelize=require(_0xdf87('0x0'));var moment=require(_0xdf87('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdf87('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdf87('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xdf87('0x3')]},'read1stAt':{'type':Sequelize[_0xdf87('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xdf87('0x4')]('in',_0xdf87('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdf87('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xdf87('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 9ad9017..f2d06ae 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 _0xade1=['conditions','find','value','`\x20=\x200','having','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','start','keys','isEmpty','WhatsappAccountId','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','WhatsappInteraction','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','params','includeAll','include','options','create','body','destroy','WhatsappMessage','addMessage','ids','omit','$gte','format','findAll','addTags','setTags','spread','Tag','emit','whatsappInteractionTags:save','removeTags','unix','join','root','files','tmp','server','attachments','push','CmContact','firstName','lastName','Attachment','Messages','createdAt','secret','WhatsappAccount','Account','Owner','Whatsapp','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','basename','existsSync','createReadStream','createWriteStream','direction','out','System','renderFile','views','downloadInteraction.html','transcript-','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','stack','name','send','Users','map','fullname','TagIds','forEach','Tags','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_whatsapp_interactions','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','left_join','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator'];(function(_0x31304d,_0x2d4b7b){var _0x3f5319=function(_0x1f354a){while(--_0x1f354a){_0x31304d['push'](_0x31304d['shift']());}};_0x3f5319(++_0x2d4b7b);}(_0xade1,0x181));var _0x1ade=function(_0x36a005,_0xe8245b){_0x36a005=_0x36a005-0x0;var _0x11b148=_0xade1[_0x36a005];return _0x11b148;};'use strict';var emlformat=require(_0x1ade('0x0'));var rimraf=require(_0x1ade('0x1'));var zipdir=require(_0x1ade('0x2'));var jsonpatch=require(_0x1ade('0x3'));var rp=require(_0x1ade('0x4'));var moment=require('moment');var BPromise=require(_0x1ade('0x5'));var Mustache=require('mustache');var util=require(_0x1ade('0x6'));var path=require(_0x1ade('0x7'));var sox=require(_0x1ade('0x8'));var csv=require(_0x1ade('0x9'));var ejs=require(_0x1ade('0xa'));var fs=require('fs');var fs_extra=require(_0x1ade('0xb'));var _=require('lodash');var squel=require(_0x1ade('0xc'));var crypto=require(_0x1ade('0xd'));var jsforce=require(_0x1ade('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1ade('0x9'));var querystring=require(_0x1ade('0xf'));var Papa=require(_0x1ade('0x10'));var Redis=require(_0x1ade('0x11'));var authService=require(_0x1ade('0x12'));var qs=require(_0x1ade('0x13'));var as=require(_0x1ade('0x14'));var pdf=require(_0x1ade('0x15'));var hardwareService=require(_0x1ade('0x16'));var logger=require('../../config/logger')(_0x1ade('0x17'));var utils=require(_0x1ade('0x18'));var config=require(_0x1ade('0x19'));var licenseUtil=require(_0x1ade('0x1a'));var db=require('../../mysqldb')['db'];config[_0x1ade('0x1b')]=_['defaults'](config[_0x1ade('0x1b')],{'host':_0x1ade('0x1c'),'port':0x18eb});var socket=require(_0x1ade('0x1d'))(new Redis(config[_0x1ade('0x1b')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x35ada9,_0x3e60e2){_0x3e60e2=_0x3e60e2||0xcc;return function(_0x5aee48){if(_0x5aee48){return _0x35ada9[_0x1ade('0x1e')](_0x3e60e2);}return _0x35ada9[_0x1ade('0x1f')](_0x3e60e2)[_0x1ade('0x20')]();};}function respondWithResult(_0x2a0a82,_0x477f0e){_0x477f0e=_0x477f0e||0xc8;return function(_0x3842b1){if(_0x3842b1){return _0x2a0a82[_0x1ade('0x1f')](_0x477f0e)[_0x1ade('0x21')](_0x3842b1);}};}function respondWithFilteredResult(_0x200e37,_0x5294aa){return function(_0x2c6495){if(_0x2c6495){var _0x41a853=_0x2c6495[_0x1ade('0x22')],_0x2109f3=_0x5294aa[_0x1ade('0x23')],_0x3c96c4=_0x5294aa['offset']+_0x5294aa[_0x1ade('0x24')],_0x290deb;if(_0x3c96c4>=_0x41a853){_0x3c96c4=_0x41a853;_0x290deb=0xc8;}else{_0x290deb=0xce;}_0x200e37[_0x1ade('0x1f')](_0x290deb);return _0x200e37[_0x1ade('0x25')](_0x1ade('0x26'),_0x2109f3+'-'+_0x3c96c4+'/'+_0x41a853)[_0x1ade('0x21')](_0x2c6495);}return null;};}function patchUpdates(_0x1a2782){return function(_0x3e3c17){try{jsonpatch['apply'](_0x3e3c17,_0x1a2782,!![]);}catch(_0x332e2c){return BPromise[_0x1ade('0x27')](_0x332e2c);}return _0x3e3c17['save']();};}function saveUpdates(_0x198ec7,_0x1f95b3){return function(_0x18dc02){if(_0x18dc02){return _0x18dc02[_0x1ade('0x28')](_0x198ec7)[_0x1ade('0x29')](function(_0x95d4c3){return _0x95d4c3;});}return null;};}function removeEntity(_0x522326,_0x646655){return function(_0x1fb932){if(_0x1fb932){return _0x1fb932['destroy']()[_0x1ade('0x29')](function(){_0x522326[_0x1ade('0x1f')](0xcc)[_0x1ade('0x20')]();});}};}function handleEntityNotFound(_0x2c1da8,_0x57cfb){return function(_0x3f868b){if(!_0x3f868b){_0x2c1da8[_0x1ade('0x1e')](0x194);}return _0x3f868b;};}function handleError(_0x3ccf98,_0x5f09fe){_0x5f09fe=_0x5f09fe||0x1f4;return function(_0x2abf46){logger['error'](_0x2abf46[_0x1ade('0x2a')]);if(_0x2abf46[_0x1ade('0x2b')]){delete _0x2abf46[_0x1ade('0x2b')];}_0x3ccf98['status'](_0x5f09fe)[_0x1ade('0x2c')](_0x2abf46);};}function getInteractionUsers(_0x1f5941,_0xe44018){return new BPromise(function(_0x3918d0,_0x92a934){try{if(_0xe44018[_0x1f5941['id']]){_0x1f5941[_0x1ade('0x2d')]=_[_0x1ade('0x2e')](_0xe44018[_0x1f5941['id']],function(_0x3178cc){return{'id':_0x3178cc['id'],'fullname':_0x3178cc[_0x1ade('0x2f')]};});}}catch(_0x1f0f93){_0x92a934(_0x1f0f93);}_0x3918d0(_0x1f5941);});}function getInteractionTags(_0x4792f8,_0x19d26a){return new BPromise(function(_0x1351fe,_0x774e6b){try{if(_0x4792f8[_0x1ade('0x30')]){_0x4792f8['Tags']=[];_0x4792f8[_0x1ade('0x30')]['split'](',')[_0x1ade('0x31')](function(_0xea46e4){_0x4792f8[_0x1ade('0x32')]['push'](_0x19d26a[_0xea46e4]);});}delete _0x4792f8[_0x1ade('0x30')];}catch(_0x297cfc){_0x774e6b(_0x297cfc);}_0x1351fe(_0x4792f8);});}function updateWhatsappInteraction(_0x51e1ec,_0x11b005,_0x2509ac){return new BPromise(function(_0x45725c,_0x3ebe1e){return getInteractionUsers(_0x51e1ec,_0x2509ac)[_0x1ade('0x29')](function(_0x27b5c4){return getInteractionTags(_0x27b5c4,_0x11b005);})[_0x1ade('0x29')](function(_0x5d049d){_0x45725c(_0x5d049d);})['catch'](function(_0x1b06a5){_0x3ebe1e(_0x1b06a5);});});}exports['index']=function(_0x7b77a5,_0x3178f5){var _0x1477d6={},_0x4ebd4c={},_0x49ab00={'count':0x0,'rows':[]};var _0x32a70c=_[_0x1ade('0x2e')](db['WhatsappInteraction'][_0x1ade('0x33')],function(_0x4204fd){return{'name':_0x4204fd[_0x1ade('0x34')],'type':_0x4204fd[_0x1ade('0x35')][_0x1ade('0x36')]};});_0x4ebd4c[_0x1ade('0x37')]=_['map'](_0x32a70c,_0x1ade('0x2b'));_0x4ebd4c[_0x1ade('0x38')]=_['keys'](_0x7b77a5['query']);_0x4ebd4c['filters']=_['intersection'](_0x4ebd4c[_0x1ade('0x37')],_0x4ebd4c[_0x1ade('0x38')]);_0x1477d6['attributes']=_[_0x1ade('0x39')](_0x4ebd4c[_0x1ade('0x37')],qs[_0x1ade('0x3a')](_0x7b77a5['query'][_0x1ade('0x3a')]));_0x1477d6[_0x1ade('0x3b')]=_0x1477d6[_0x1ade('0x3b')][_0x1ade('0x3c')]?_0x1477d6['attributes']:_0x4ebd4c[_0x1ade('0x37')];if(!_0x7b77a5['query'][_0x1ade('0x3d')](_0x1ade('0x3e'))){_0x1477d6[_0x1ade('0x24')]=qs[_0x1ade('0x24')](_0x7b77a5[_0x1ade('0x38')][_0x1ade('0x24')]);_0x1477d6[_0x1ade('0x23')]=qs[_0x1ade('0x23')](_0x7b77a5[_0x1ade('0x38')][_0x1ade('0x23')]);}_0x1477d6[_0x1ade('0x3f')]=qs['sort'](_0x7b77a5[_0x1ade('0x38')][_0x1ade('0x40')]);_0x1477d6[_0x1ade('0x41')]=qs[_0x1ade('0x42')](_[_0x1ade('0x43')](_0x7b77a5['query'],_0x4ebd4c[_0x1ade('0x42')]),_0x32a70c);var _0x3f6129=[];var _0x49cec0=squel[_0x1ade('0x44')]()[_0x1ade('0x45')]('id')[_0x1ade('0x45')](_0x1ade('0x2b'))['field'](_0x1ade('0x46'))[_0x1ade('0x47')](_0x1ade('0x48'));var _0x31fcd9=squel[_0x1ade('0x44')]()[_0x1ade('0x45')](_0x1ade('0x49'))[_0x1ade('0x45')](_0x1ade('0x4a'))['field']('ui.WhatsappInteractionId')[_0x1ade('0x47')](_0x1ade('0x4b'),'ui')['left_join']('users','u',_0x1ade('0x4c'));var _0xf1191e=squel[_0x1ade('0x44')]()[_0x1ade('0x47')](_0x1ade('0x4d'),'i')['left_join']('cm_contacts','c',_0x1ade('0x4e'))['left_join'](_0x1ade('0x4f'),'o',_0x1ade('0x50'))['left_join']('whatsapp_accounts','a',_0x1ade('0x51'))[_0x1ade('0x52')](_0x1ade('0x53'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x1ade('0x52')](_0x1ade('0x54'),'it',_0x1ade('0x55'))[_0x1ade('0x52')](_0x1ade('0x48'),'t',_0x1ade('0x56'));var _0x1c1b5d=squel['expr']();var _0x4e3e23=[];var _0x39e953=squel[_0x1ade('0x57')]();var _0x18746d;if(_0x7b77a5[_0x1ade('0x38')][_0x1ade('0x58')]){_0x18746d=as[_0x1ade('0x59')](_0x7b77a5['query'][_0x1ade('0x58')]);var _0x35714d=_0x18746d[_0x1ade('0x5a')];for(var _0x503def=0x0;_0x503def<_0x18746d['conditions'][_0x1ade('0x3c')];_0x503def++){var _0x22c3a2=_0x18746d[_0x1ade('0x5b')][_0x503def];var _0x3429d8='i';var _0x524272=_[_0x1ade('0x5c')](_0x32a70c,[_0x1ade('0x2b'),_0x22c3a2[_0x1ade('0x45')]]);if(!_0x524272){switch(_0x22c3a2[_0x1ade('0x45')]){case'unreadMessages':if(_0x22c3a2[_0x1ade('0x5d')]==0x1){_0xf1191e['having']('`'+_0x22c3a2[_0x1ade('0x45')]+_0x1ade('0x5e'));}else{_0xf1191e[_0x1ade('0x5f')]('`'+_0x22c3a2['field']+'`\x20>\x200');}break;case _0x1ade('0x60'):if(_0x22c3a2[_0x1ade('0x61')]===_0x1ade('0x62')){if(_0x22c3a2[_0x1ade('0x5d')][_0x1ade('0x63')]('\x20')[_0x1ade('0x3c')]>0x1){_0x1c1b5d[_0x35714d](_0x1ade('0x64'),qs[_0x1ade('0x65')](_0x22c3a2[_0x1ade('0x5d')]),null);}else{var _0x192469='%'+_0x22c3a2[_0x1ade('0x5d')]+'%';_0x1c1b5d[_0x35714d](_0x1ade('0x66'),_0x192469,_0x192469,_0x192469);}}else{_0x524272=_[_0x1ade('0x5c')](_0x32a70c,['name','ContactId']);_0x22c3a2[_0x1ade('0x45')]=_0x1ade('0x67');_0x2f89de=as[_0x1ade('0x68')](_0x3429d8,_0x524272['type'],_0x22c3a2);_0x1c1b5d[_0x35714d](_0x2f89de[_0x1ade('0x69')],_0x2f89de[_0x1ade('0x5d')]['start'],_0x2f89de[_0x1ade('0x5d')][_0x1ade('0x20')]);}break;case'Tag':var _0xc4b3a1=_0x22c3a2[_0x1ade('0x5d')][_0x1ade('0x63')](',')[_0x1ade('0x2e')](function(_0x18b0a2){return Number(_0x18b0a2);});_0xc4b3a1[_0x1ade('0x31')](function(_0x857cb1){_0x39e953['or'](_0x1ade('0x6a'),'%,'+_0x857cb1+',%');});_0x4e3e23=_[_0x1ade('0x6b')](_0x4e3e23,_0xc4b3a1);break;case _0x1ade('0x6c'):if(_0x22c3a2[_0x1ade('0x61')]==='$substring'){_0x1c1b5d[_0x35714d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x22c3a2[_0x1ade('0x5d')]+'%',null);}else{_0x524272=_[_0x1ade('0x5c')](_0x32a70c,['name',_0x1ade('0x6d')]);_0x22c3a2['field']='UserId';_0x2f89de=as[_0x1ade('0x68')](_0x3429d8,_0x524272['type'],_0x22c3a2);_0x1c1b5d[_0x35714d](_0x2f89de['text'],_0x2f89de[_0x1ade('0x5d')][_0x1ade('0x6e')],_0x2f89de[_0x1ade('0x5d')]['end']);}break;case'body':_0x2f89de=as['buildExpression']('me',null,_0x22c3a2);_0x1c1b5d[_0x35714d](_0x2f89de[_0x1ade('0x69')],_0x2f89de[_0x1ade('0x5d')][_0x1ade('0x6e')],_0x2f89de[_0x1ade('0x5d')]['end']);break;}}else{var _0x2f89de=as['buildExpression'](_0x3429d8,_0x524272['type'],_0x22c3a2);_0x1c1b5d[_0x35714d](_0x2f89de[_0x1ade('0x69')],_0x2f89de[_0x1ade('0x5d')]['start'],_0x2f89de[_0x1ade('0x5d')]['end']);}}}else{var _0x479a0d=_(_0x7b77a5[_0x1ade('0x38')])[_0x1ade('0x6f')]()[_0x1ade('0x2e')](function(_0x3656c4){return _['some'](_0x32a70c,[_0x1ade('0x2b'),_0x3656c4])?_0x3656c4:undefined;})['compact']()[_0x1ade('0x5d')]();if(!_[_0x1ade('0x70')](_0x479a0d)){_0x479a0d[_0x1ade('0x31')](function(_0x157fd1){if(_0x157fd1===_0x1ade('0x71')){_0xf1191e['where']('i.WhatsappAccountId\x20IN\x20?',[][_0x1ade('0x72')](_0x7b77a5[_0x1ade('0x38')][_0x157fd1]));}else if(_0x157fd1==='createdAt'){var _0x1667a3=JSON[_0x1ade('0x73')](_0x7b77a5[_0x1ade('0x38')][_0x157fd1])['$gte'];var _0x2e85b7=JSON[_0x1ade('0x73')](_0x7b77a5[_0x1ade('0x38')][_0x157fd1])[_0x1ade('0x74')];_0xf1191e[_0x1ade('0x41')](_0x1ade('0x75'),_0x1667a3,_0x2e85b7);}else{if(_0x7b77a5[_0x1ade('0x38')][_0x157fd1]===_0x1ade('0x76')){_0xf1191e[_0x1ade('0x41')]('i.'+_0x157fd1+_0x1ade('0x77'));}else{_0xf1191e['where']('i.'+_0x157fd1+_0x1ade('0x78'),_0x7b77a5[_0x1ade('0x38')][_0x157fd1]);}}});}if(_0x7b77a5[_0x1ade('0x38')][_0x1ade('0x79')]){if(_0x7b77a5[_0x1ade('0x38')][_0x1ade('0x79')]==0x1){_0xf1191e[_0x1ade('0x5f')](_0x1ade('0x7a'));}else{_0xf1191e[_0x1ade('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x7b77a5[_0x1ade('0x38')][_0x1ade('0x7b')]){_0x4e3e23=_[_0x1ade('0x7c')](_0x7b77a5['query'][_0x1ade('0x7b')])?_0x7b77a5['query'][_0x1ade('0x7b')]:new Array(_0x7b77a5[_0x1ade('0x38')][_0x1ade('0x7b')]);_0x4e3e23[_0x1ade('0x31')](function(_0x1e2b45){_0x39e953['or'](_0x1ade('0x6a'),'%,'+_0x1e2b45+',%');});}if(_0x7b77a5[_0x1ade('0x38')][_0x1ade('0x7d')]){var _0x2d19ee=_0x7b77a5[_0x1ade('0x38')]['filter']['replace']('\x5c','\x5c\x5c')[_0x1ade('0x7e')](/'/g,'\x27\x27');if(qs[_0x1ade('0x7f')](_0x2d19ee)){_0x1c1b5d['or'](_0x1ade('0x80'),_0x2d19ee+'%')['or'](_0x1ade('0x81'),_0x2d19ee+'%');}else{_0x1c1b5d['or'](_0x1ade('0x82'),qs[_0x1ade('0x65')](_0x2d19ee))['or'](_0x1ade('0x83'),_0x2d19ee+'%');}}}_0xf1191e[_0x1ade('0x41')](_0x1c1b5d);_0xf1191e[_0x1ade('0x84')](_0x1ade('0x85'));var _0x4dac63={'type':db['Sequelize'][_0x1ade('0x86')]['SELECT'],'raw':!![]};var _0x2b6ac9=_0xf1191e[_0x1ade('0x87')]();_0x2b6ac9[_0x1ade('0x45')](_0x1ade('0x85'));_0x2b6ac9[_0x1ade('0x45')](_0x1ade('0x88'),'unreadMessages');if(_0x1477d6[_0x1ade('0x3f')]){_0x1477d6[_0x1ade('0x3f')][_0x1ade('0x31')](function(_0x1de8d2){var _0x523af6=_0x1de8d2[0x0]===_0x1ade('0x89')?_0x1de8d2[0x0]:'i.'+_0x1de8d2[0x0];_0xf1191e[_0x1ade('0x3f')](_0x523af6,_0x1de8d2[0x1]===_0x1ade('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x4e3e23)){_0xf1191e[_0x1ade('0x5f')](_0x39e953);_0x2b6ac9['where'](_0x1ade('0x8b'),_0x4e3e23);}BPromise[_0x1ade('0x8c')]()[_0x1ade('0x29')](function(){if(!_0x18746d){if(_0x7b77a5[_0x1ade('0x38')][_0x1ade('0x71')])return;_0x2b6ac9[_0x1ade('0x41')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0xf1191e[_0x1ade('0x41')](_0x1ade('0x8d'));return;}if(_0x7b77a5[_0x1ade('0x8e')][_0x1ade('0x8f')]!==_0x1ade('0x90'))return;return _0x7b77a5[_0x1ade('0x8e')][_0x1ade('0x91')]({'attributes':['id'],'raw':!![]})[_0x1ade('0x29')](function(_0x42bc47){if(_[_0x1ade('0x70')](_0x42bc47)){_0x2b6ac9[_0x1ade('0x41')]('i.WhatsappAccountId\x20IS\x20NULL');_0xf1191e['where'](_0x1ade('0x92'));}else{_0x2b6ac9['where'](_0x1ade('0x93'),_[_0x1ade('0x2e')](_0x42bc47,'id'));_0xf1191e[_0x1ade('0x41')](_0x1ade('0x93'),_[_0x1ade('0x2e')](_0x42bc47,'id'));}});})[_0x1ade('0x29')](function(){if(_0x7b77a5[_0x1ade('0x8e')][_0x1ade('0x8f')]==='agent'&&!_0x18746d&&!_0x7b77a5[_0x1ade('0x38')][_0x1ade('0x71')])return[];return db[_0x1ade('0x94')]['query'](_0x2b6ac9[_0x1ade('0x95')](),_0x4dac63);})[_0x1ade('0x29')](function(_0x2159fc){_0x49ab00['count']=_0x2159fc[_0x1ade('0x3c')];if(_0x49ab00[_0x1ade('0x22')]===0x0)return[];return db[_0x1ade('0x94')][_0x1ade('0x38')](_0x49cec0['toString'](),_0x4dac63)[_0x1ade('0x29')](function(_0x6831b3){_0x3f6129=_[_0x1ade('0x96')](_0x6831b3,'id');_0x4dac63=_[_0x1ade('0x97')](_0x4dac63,{'model':db[_0x1ade('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x7b77a5['query']['fields']){_0x1477d6['attributes'][_0x1ade('0x31')](function(_0x41abd2){_0xf1191e[_0x1ade('0x45')]('i.'+_0x41abd2);});}else{_0xf1191e[_0x1ade('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1ade('0x99'));_0xf1191e[_0x1ade('0x45')](_0x1ade('0x9a'),_0x1ade('0x9b'));_0xf1191e[_0x1ade('0x45')](_0x1ade('0x9c'),_0x1ade('0x9d'));_0xf1191e[_0x1ade('0x45')](_0x1ade('0x9e'),_0x1ade('0x89'));_0xf1191e['field'](_0x1ade('0x9f'));_0xf1191e[_0x1ade('0x45')](_0x1ade('0xa0'),_0x1ade('0xa1'));_0xf1191e['field'](_0x1ade('0xa2'),_0x1ade('0xa3'));_0xf1191e[_0x1ade('0x45')](_0x1ade('0xa4'),'Contact.email');_0xf1191e[_0x1ade('0x45')]('c.phone','Contact.phone');_0xf1191e[_0x1ade('0x45')](_0x1ade('0xa5'),_0x1ade('0xa6'));_0xf1191e[_0x1ade('0x45')]('c.fax',_0x1ade('0xa7'));_0xf1191e['field'](_0x1ade('0xa8'),_0x1ade('0xa9'));_0xf1191e[_0x1ade('0x45')](_0x1ade('0xaa'),_0x1ade('0xab'));_0xf1191e[_0x1ade('0x45')](_0x1ade('0xac'),_0x1ade('0x30'));}if(_0x1477d6['limit'])_0xf1191e[_0x1ade('0x24')](_0x1477d6['limit']);if(_0x1477d6[_0x1ade('0x23')])_0xf1191e['offset'](_0x1477d6[_0x1ade('0x23')]);return db[_0x1ade('0x94')]['query'](_0xf1191e[_0x1ade('0x95')](),_0x4dac63);})[_0x1ade('0x29')](function(_0x3db13e){_0x31fcd9[_0x1ade('0x41')](_0x1ade('0xad'),_[_0x1ade('0x2e')](_0x3db13e,'id'));return db[_0x1ade('0x94')][_0x1ade('0x38')](_0x31fcd9[_0x1ade('0x95')](),_0x4dac63)[_0x1ade('0x29')](function(_0x46fea6){var _0x6cb47a=_[_0x1ade('0xae')](_0x46fea6,_0x1ade('0xaf'));var _0x16f2d8=[];_0x3db13e[_0x1ade('0x31')](function(_0x212f61){_0x16f2d8['push'](updateWhatsappInteraction(_0x212f61,_0x3f6129,_0x6cb47a));});return BPromise[_0x1ade('0xb0')](_0x16f2d8);});});})[_0x1ade('0x29')](function(_0x15fa9d){_0x49ab00[_0x1ade('0xb1')]=_0x15fa9d;return _0x49ab00;})['then'](respondWithFilteredResult(_0x3178f5,_0x1477d6))[_0x1ade('0xb2')](handleError(_0x3178f5,null));};exports[_0x1ade('0xb3')]=function(_0x534b7f,_0x23b967){var _0x2fe111={'raw':![],'where':{'id':_0x534b7f[_0x1ade('0xb4')]['id']}},_0x2d1bed={};_0x2d1bed['model']=_[_0x1ade('0x6f')](db[_0x1ade('0x98')][_0x1ade('0x33')]);_0x2d1bed[_0x1ade('0x38')]=_[_0x1ade('0x6f')](_0x534b7f[_0x1ade('0x38')]);_0x2d1bed[_0x1ade('0x42')]=_[_0x1ade('0x39')](_0x2d1bed['model'],_0x2d1bed[_0x1ade('0x38')]);_0x2fe111[_0x1ade('0x3b')]=_[_0x1ade('0x39')](_0x2d1bed[_0x1ade('0x37')],qs[_0x1ade('0x3a')](_0x534b7f[_0x1ade('0x38')]['fields']));_0x2fe111[_0x1ade('0x3b')]=_0x2fe111[_0x1ade('0x3b')][_0x1ade('0x3c')]?_0x2fe111[_0x1ade('0x3b')]:_0x2d1bed['model'];if(_0x534b7f[_0x1ade('0x38')][_0x1ade('0xb5')]){_0x2fe111[_0x1ade('0xb6')]=[{'all':!![]}];}_0x2fe111=_[_0x1ade('0x97')]({},_0x2fe111,_0x534b7f[_0x1ade('0xb7')]);return db[_0x1ade('0x98')][_0x1ade('0x5c')](_0x2fe111)[_0x1ade('0x29')](handleEntityNotFound(_0x23b967,null))[_0x1ade('0x29')](respondWithResult(_0x23b967,null))['catch'](handleError(_0x23b967,null));};exports[_0x1ade('0xb8')]=function(_0x142d9d,_0x11c96f){return db[_0x1ade('0x98')]['create'](_0x142d9d[_0x1ade('0xb9')],{})[_0x1ade('0x29')](respondWithResult(_0x11c96f,0xc9))[_0x1ade('0xb2')](handleError(_0x11c96f,null));};exports[_0x1ade('0x28')]=function(_0x230346,_0x5abc83){if(_0x230346[_0x1ade('0xb9')]['id']){delete _0x230346[_0x1ade('0xb9')]['id'];}return db[_0x1ade('0x98')][_0x1ade('0x5c')]({'where':{'id':_0x230346[_0x1ade('0xb4')]['id']}})['then'](handleEntityNotFound(_0x5abc83,null))[_0x1ade('0x29')](saveUpdates(_0x230346[_0x1ade('0xb9')],null))[_0x1ade('0x29')](respondWithResult(_0x5abc83,null))[_0x1ade('0xb2')](handleError(_0x5abc83,null));};exports[_0x1ade('0xba')]=function(_0x457c3d,_0x9a0d44){return db[_0x1ade('0x98')][_0x1ade('0x5c')]({'where':{'id':_0x457c3d[_0x1ade('0xb4')]['id']}})['then'](handleEntityNotFound(_0x9a0d44,null))[_0x1ade('0x29')](removeEntity(_0x9a0d44,null))[_0x1ade('0xb2')](handleError(_0x9a0d44,null));};exports['describe']=function(_0x3aadcf,_0x29a92f){return db[_0x1ade('0x98')]['describe']()[_0x1ade('0x29')](respondWithResult(_0x29a92f,null))[_0x1ade('0xb2')](handleError(_0x29a92f,null));};exports['addMessage']=function(_0x2ef152,_0x227817,_0x342f59){return db[_0x1ade('0xbb')]['find']({'where':{'id':_0x2ef152[_0x1ade('0xb4')]['id']}})['then'](handleEntityNotFound(_0x227817,null))['then'](function(_0x52a97a){if(_0x52a97a){return _0x52a97a[_0x1ade('0xbc')](_0x2ef152['body'][_0x1ade('0xbd')],_[_0x1ade('0xbe')](_0x2ef152[_0x1ade('0xb9')],[_0x1ade('0xbd'),'id'])||{});}})[_0x1ade('0x29')](respondWithResult(_0x227817,null))[_0x1ade('0xb2')](handleError(_0x227817,null));};exports['getMessages']=function(_0x5227f3,_0x3e928a,_0x5c86c9){var _0x326f17={'raw':![],'where':{}};var _0x47c401={};var _0x167fbc={'count':0x0,'rows':[]};return db[_0x1ade('0x98')]['findOne']({'where':{'id':_0x5227f3['params']['id']}})[_0x1ade('0x29')](handleEntityNotFound(_0x3e928a,null))[_0x1ade('0x29')](function(_0x297556){if(_0x297556){_0x47c401[_0x1ade('0x37')]=_['keys'](db[_0x1ade('0xbb')][_0x1ade('0x33')]);_0x47c401[_0x1ade('0x38')]=_['keys'](_0x5227f3[_0x1ade('0x38')]);_0x47c401[_0x1ade('0x42')]=_['intersection'](_0x47c401['model'],_0x47c401[_0x1ade('0x38')]);_0x326f17['attributes']=_['intersection'](_0x47c401[_0x1ade('0x37')],qs[_0x1ade('0x3a')](_0x5227f3[_0x1ade('0x38')][_0x1ade('0x3a')]));_0x326f17[_0x1ade('0x3b')]=_0x326f17['attributes'][_0x1ade('0x3c')]?_0x326f17[_0x1ade('0x3b')]:_0x47c401[_0x1ade('0x37')];if(!_0x5227f3[_0x1ade('0x38')][_0x1ade('0x3d')](_0x1ade('0x3e'))){_0x326f17[_0x1ade('0x24')]=qs[_0x1ade('0x24')](_0x5227f3[_0x1ade('0x38')][_0x1ade('0x24')]);_0x326f17[_0x1ade('0x23')]=qs[_0x1ade('0x23')](_0x5227f3[_0x1ade('0x38')][_0x1ade('0x23')]);}_0x326f17[_0x1ade('0x3f')]=qs['sort'](_0x5227f3[_0x1ade('0x38')][_0x1ade('0x40')]);_0x326f17['where']=qs[_0x1ade('0x42')](_[_0x1ade('0x43')](_0x5227f3[_0x1ade('0x38')],_0x47c401[_0x1ade('0x42')]));_0x326f17[_0x1ade('0x41')]['WhatsappInteractionId']=_0x297556['id'];if(_0x5227f3['query']['filter']){_0x326f17[_0x1ade('0x41')]=_['merge'](_0x326f17[_0x1ade('0x41')],{'$or':_[_0x1ade('0x2e')](_0x326f17[_0x1ade('0x3b')],function(_0x30de94){var _0x498fa9={};_0x498fa9[_0x30de94]={'$like':'%'+_0x5227f3[_0x1ade('0x38')][_0x1ade('0x7d')]+'%'};return _0x498fa9;})});}if(_0x5227f3[_0x1ade('0x38')][_0x1ade('0xbf')]){var _0x26ad40=_0x5227f3[_0x1ade('0x38')][_0x1ade('0xbf')][_0x1ade('0x63')](',');var _0x3cc11b={};_0x3cc11b[_0x26ad40[0x0]]={'$gte':moment(_0x26ad40[0x1])[_0x1ade('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x326f17['where']=_[_0x1ade('0x97')](_0x326f17[_0x1ade('0x41')],_0x3cc11b);}_0x326f17=_[_0x1ade('0x97')]({},_0x326f17,_0x5227f3['options']);return db[_0x1ade('0xbb')][_0x1ade('0x22')]({'where':_0x326f17['where']})[_0x1ade('0x29')](function(_0x29b4c4){_0x167fbc[_0x1ade('0x22')]=_0x29b4c4;if(_0x5227f3[_0x1ade('0x38')][_0x1ade('0xb5')]){_0x326f17['include']=[{'all':!![]}];}return db[_0x1ade('0xbb')][_0x1ade('0xc1')](_0x326f17);})['then'](function(_0x4bdfab){_0x167fbc[_0x1ade('0xb1')]=_0x4bdfab;return _0x167fbc;});}})[_0x1ade('0x29')](respondWithFilteredResult(_0x3e928a,_0x326f17))[_0x1ade('0xb2')](handleError(_0x3e928a,null));};exports[_0x1ade('0xc2')]=function(_0x4cc6c7,_0x1d8fa2,_0x37114c){return db[_0x1ade('0x98')][_0x1ade('0x5c')]({'where':{'id':_0x4cc6c7[_0x1ade('0xb4')]['id']}})['then'](handleEntityNotFound(_0x1d8fa2,null))[_0x1ade('0x29')](function(_0x4ae3de){if(_0x4ae3de){return _0x4ae3de[_0x1ade('0xc3')](_0x4cc6c7[_0x1ade('0xb9')][_0x1ade('0xbd')],_['omit'](_0x4cc6c7['body'],[_0x1ade('0xbd'),'id'])||{})[_0x1ade('0xc4')](function(){return db[_0x1ade('0xc5')]['findAll']({'attributes':['id',_0x1ade('0x2b'),_0x1ade('0x46')],'where':{'id':_0x4cc6c7[_0x1ade('0xb9')][_0x1ade('0xbd')]}});})[_0x1ade('0x29')](function(_0x2f9cd2){socket[_0x1ade('0xc6')](_0x1ade('0xc7'),{'id':Number(_0x4cc6c7['params']['id']),'tags':_0x2f9cd2||[]});return{'id':Number(_0x4cc6c7['params']['id']),'tags':_0x2f9cd2||[]};});}})[_0x1ade('0x29')](respondWithResult(_0x1d8fa2,null))[_0x1ade('0xb2')](handleError(_0x1d8fa2,null));};exports[_0x1ade('0xc8')]=function(_0x47fc46,_0x3c71b9,_0x1df89e){return db[_0x1ade('0x98')][_0x1ade('0x5c')]({'where':{'id':_0x47fc46['params']['id']}})[_0x1ade('0x29')](handleEntityNotFound(_0x3c71b9,null))[_0x1ade('0x29')](function(_0x11e9f9){if(_0x11e9f9){return _0x11e9f9[_0x1ade('0xc8')](_0x47fc46[_0x1ade('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x3c71b9,null))['catch'](handleError(_0x3c71b9,null));};exports['download']=function(_0xf4bcf3,_0x9be613){var _0x59ce42=moment()[_0x1ade('0xc9')]()[_0x1ade('0x95')]();var _0x5843ec=path[_0x1ade('0xca')](config[_0x1ade('0xcb')],'server',_0x1ade('0xcc'),_0x1ade('0xcd'));var _0x3986a4=path[_0x1ade('0xca')](config['root'],_0x1ade('0xce'),_0x1ade('0xcc'),_0x1ade('0xcf'));var _0x544ac3=path['join'](_0x5843ec,_0x59ce42);var _0x4e2d51=util[_0x1ade('0xc0')]('transcript-%d-%s.zip',_0xf4bcf3[_0x1ade('0xb4')]['id'],_0x59ce42);var _0x5c80a2=path[_0x1ade('0xca')](_0x5843ec,_0x4e2d51);var _0x2a2390=[];_0x2a2390[_0x1ade('0xd0')]({'model':db['User'],'as':'User','attributes':['id',_0x1ade('0x2f')],'raw':!![]});_0x2a2390[_0x1ade('0xd0')]({'model':db[_0x1ade('0xd1')],'as':_0x1ade('0x60'),'attributes':['id',_0x1ade('0xd2'),_0x1ade('0xd3')],'raw':!![]});if(_0xf4bcf3[_0x1ade('0x38')][_0x1ade('0xcf')]){_0x2a2390[_0x1ade('0xd0')]({'model':db[_0x1ade('0xd4')],'as':_0x1ade('0xd4'),'raw':!![]});}var _0x379526=[{'model':db['WhatsappMessage'],'as':_0x1ade('0xd5'),'attributes':['id',_0x1ade('0xb9'),_0x1ade('0xd6'),'direction',_0x1ade('0xd7'),'read'],'include':_0x2a2390}];_0x379526[_0x1ade('0xd0')]({'model':db[_0x1ade('0xd8')],'as':_0x1ade('0xd9'),'attributes':['id','name']});_0x379526[_0x1ade('0xd0')]({'model':db[_0x1ade('0x6c')],'as':_0x1ade('0xda'),'attributes':['id','fullname']});return db[_0x1ade('0x98')][_0x1ade('0x5c')]({'where':{'id':_0xf4bcf3[_0x1ade('0xb4')]['id']},'include':_0x379526})[_0x1ade('0x29')](handleEntityNotFound(_0x9be613,null))['then'](function(_0x834af){if(_0x834af){var _0x3a3f4b=_0x834af['get']({'plain':!![]});fs['mkdirSync'](_0x544ac3);var _0x475be6={'channel':_0x1ade('0xdb'),'account':_0x3a3f4b[_0x1ade('0xd9')]['name'],'agent':_0x3a3f4b[_0x1ade('0xda')]?_0x3a3f4b['Owner']['fullname']:'N.A.','createdAt':moment(_0x3a3f4b[_0x1ade('0xd6')])[_0x1ade('0xc0')](_0x1ade('0xdc'))[_0x1ade('0x95')](),'closedAt':_0x3a3f4b[_0x1ade('0xdd')]?moment(_0x3a3f4b[_0x1ade('0xde')])[_0x1ade('0xc0')](_0x1ade('0xdc'))[_0x1ade('0x95')]():'','disposition':_0x3a3f4b['disposition'],'messages':_(_0x3a3f4b[_0x1ade('0xd5')])[_0x1ade('0x7d')]({'secret':![]})[_0x1ade('0x2e')](function(_0x368480){if(_0x368480[_0x1ade('0xd4')]){var _0x206b55=path[_0x1ade('0xca')](_0x3986a4,_0x368480[_0x1ade('0xd4')][_0x1ade('0xdf')]);if(fs[_0x1ade('0xe0')](_0x206b55)){fs[_0x1ade('0xe1')](_0x206b55)['pipe'](fs[_0x1ade('0xe2')](path['join'](_0x544ac3,_0x368480[_0x1ade('0xd4')]['basename'])));}}return{'date':moment(_0x368480[_0x1ade('0xd6')])['format'](_0x1ade('0xdc'))[_0x1ade('0x95')](),'sender':_0x368480[_0x1ade('0xe3')]===_0x1ade('0xe4')?_0x368480[_0x1ade('0x6c')]?_0x368480[_0x1ade('0x6c')][_0x1ade('0x2f')]:_0x1ade('0xe5'):_0x368480['Contact'][_0x1ade('0xd2')]+(_0x368480[_0x1ade('0x60')][_0x1ade('0xd3')]?'\x20'+_0x368480[_0x1ade('0x60')][_0x1ade('0xd3')]:''),'body':_0x368480['Attachment']?_0x368480[_0x1ade('0xd4')]['basename']:_0x368480[_0x1ade('0xb9')],'direction':_0x368480['direction']===_0x1ade('0xe4')?'A':'C','secret':_0x368480['secret'],'read':_0x368480[_0x1ade('0x79')],'attachment':_0x368480[_0x1ade('0xd4')]};})[_0x1ade('0x5d')]()};return ejs[_0x1ade('0xe6')](path[_0x1ade('0xca')](config[_0x1ade('0xcb')],_0x1ade('0xce'),_0x1ade('0xe7'),_0x1ade('0xe8')),{'interaction':_0x475be6})[_0x1ade('0x29')](function(_0x6ac02){var _0x4181b7=path[_0x1ade('0xca')](_0x544ac3,_0x1ade('0xe9')+_0x3a3f4b['id']+'-'+_0x59ce42+'.pdf');var _0x30a1ff={'path':_0x4181b7,'channel':_0x1ade('0xdb'),'interactionId':_0x3a3f4b['id']};return pdf['createPdfFromHTML'](_0x6ac02,_0x30a1ff);})['then'](function(){return new BPromise(function(_0x32da92,_0x1f5b0a){zipdir(_0x544ac3,{'saveTo':_0x5c80a2},function(_0x1ed7ae,_0x3d9ce4){if(_0x1ed7ae)return _0x1f5b0a(_0x1ed7ae);return _0x32da92(_0x3d9ce4);});})[_0x1ade('0x29')](function(){return new BPromise(function(_0x32e20e,_0x2698c2){rimraf(_0x544ac3,function(_0x4b88a4){if(_0x4b88a4)_0x2698c2(_0x4b88a4);return _0x32e20e();});});})['then'](function(){return _0x9be613[_0x1ade('0xea')](_0x5c80a2,_0x4e2d51,function(_0x2353ff){if(_0x2353ff){console[_0x1ade('0xeb')](_0x1ade('0xec'),_0x2353ff);}else{fs[_0x1ade('0xed')](_0x5c80a2);}});});});}else{return _0x9be613[_0x1ade('0x1e')](0xc8);}})[_0x1ade('0xb2')](handleError(_0x9be613,null));}; \ No newline at end of file +var _0x6cc9=['Tags','push','catch','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','sort','pick','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','end','body','isEmpty','where','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','role','sequelize','toString','keyBy','merge','WhatsappInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','params','includeAll','include','create','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','hasOwnProperty','filter','format','options','findAll','addTags','setTags','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','basename','createReadStream','pipe','createWriteStream','out','renderFile','views','transcript-','.pdf','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','split','forEach'];(function(_0x1e51fe,_0x1543e4){var _0x9b8c5f=function(_0x341add){while(--_0x341add){_0x1e51fe['push'](_0x1e51fe['shift']());}};_0x9b8c5f(++_0x1543e4);}(_0x6cc9,0xb9));var _0x96cc=function(_0x5cd463,_0x1f6022){_0x5cd463=_0x5cd463-0x0;var _0x1c1a64=_0x6cc9[_0x5cd463];return _0x1c1a64;};'use strict';var emlformat=require(_0x96cc('0x0'));var rimraf=require(_0x96cc('0x1'));var zipdir=require(_0x96cc('0x2'));var jsonpatch=require(_0x96cc('0x3'));var rp=require('request-promise');var moment=require(_0x96cc('0x4'));var BPromise=require(_0x96cc('0x5'));var Mustache=require('mustache');var util=require(_0x96cc('0x6'));var path=require(_0x96cc('0x7'));var sox=require(_0x96cc('0x8'));var csv=require(_0x96cc('0x9'));var ejs=require(_0x96cc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x96cc('0xb'));var crypto=require('crypto');var jsforce=require(_0x96cc('0xc'));var deskjs=require(_0x96cc('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x96cc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x96cc('0xf'));var as=require(_0x96cc('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x96cc('0x11'))(_0x96cc('0x12'));var utils=require(_0x96cc('0x13'));var config=require(_0x96cc('0x14'));var licenseUtil=require(_0x96cc('0x15'));var db=require('../../mysqldb')['db'];config[_0x96cc('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x96cc('0x17'))(new Redis(config[_0x96cc('0x16')]));require('./whatsappInteraction.socket')[_0x96cc('0x18')](socket);function respondWithStatusCode(_0x2f2ad0,_0x25e949){_0x25e949=_0x25e949||0xcc;return function(_0x138348){if(_0x138348){return _0x2f2ad0[_0x96cc('0x19')](_0x25e949);}return _0x2f2ad0[_0x96cc('0x1a')](_0x25e949)['end']();};}function respondWithResult(_0x1e7ba8,_0x1904e0){_0x1904e0=_0x1904e0||0xc8;return function(_0x4b1a36){if(_0x4b1a36){return _0x1e7ba8[_0x96cc('0x1a')](_0x1904e0)[_0x96cc('0x1b')](_0x4b1a36);}};}function respondWithFilteredResult(_0x59b68f,_0x377fa9){return function(_0x1f9107){if(_0x1f9107){var _0x42c3e3=_0x1f9107[_0x96cc('0x1c')],_0x118b9b=_0x377fa9[_0x96cc('0x1d')],_0x4611ba=_0x377fa9[_0x96cc('0x1d')]+_0x377fa9['limit'],_0xb48084;if(_0x4611ba>=_0x42c3e3){_0x4611ba=_0x42c3e3;_0xb48084=0xc8;}else{_0xb48084=0xce;}_0x59b68f[_0x96cc('0x1a')](_0xb48084);return _0x59b68f[_0x96cc('0x1e')](_0x96cc('0x1f'),_0x118b9b+'-'+_0x4611ba+'/'+_0x42c3e3)[_0x96cc('0x1b')](_0x1f9107);}return null;};}function patchUpdates(_0x409e75){return function(_0x57f9e8){try{jsonpatch['apply'](_0x57f9e8,_0x409e75,!![]);}catch(_0x379bbb){return BPromise[_0x96cc('0x20')](_0x379bbb);}return _0x57f9e8[_0x96cc('0x21')]();};}function saveUpdates(_0x531e46,_0x36162b){return function(_0x3f15d7){if(_0x3f15d7){return _0x3f15d7[_0x96cc('0x22')](_0x531e46)[_0x96cc('0x23')](function(_0x331aa6){return _0x331aa6;});}return null;};}function removeEntity(_0x166eff,_0xcb396d){return function(_0x17afb1){if(_0x17afb1){return _0x17afb1[_0x96cc('0x24')]()[_0x96cc('0x23')](function(){_0x166eff[_0x96cc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48dbab,_0x24638a){return function(_0x1e3dd1){if(!_0x1e3dd1){_0x48dbab[_0x96cc('0x19')](0x194);}return _0x1e3dd1;};}function handleError(_0x99ce9f,_0x24e585){_0x24e585=_0x24e585||0x1f4;return function(_0x440953){logger[_0x96cc('0x25')](_0x440953[_0x96cc('0x26')]);if(_0x440953['name']){delete _0x440953[_0x96cc('0x27')];}_0x99ce9f[_0x96cc('0x1a')](_0x24e585)[_0x96cc('0x28')](_0x440953);};}function getInteractionUsers(_0x5c016a,_0x47e072){return new BPromise(function(_0x1377a0,_0x2544a1){try{if(_0x47e072[_0x5c016a['id']]){_0x5c016a[_0x96cc('0x29')]=_[_0x96cc('0x2a')](_0x47e072[_0x5c016a['id']],function(_0xbd2185){return{'id':_0xbd2185['id'],'fullname':_0xbd2185[_0x96cc('0x2b')]};});}}catch(_0x2ef38d){_0x2544a1(_0x2ef38d);}_0x1377a0(_0x5c016a);});}function getInteractionTags(_0x120587,_0x36862a){return new BPromise(function(_0x25bad1,_0x1c9f93){try{if(_0x120587[_0x96cc('0x2c')]){_0x120587['Tags']=[];_0x120587[_0x96cc('0x2c')][_0x96cc('0x2d')](',')[_0x96cc('0x2e')](function(_0x565a5a){_0x120587[_0x96cc('0x2f')][_0x96cc('0x30')](_0x36862a[_0x565a5a]);});}delete _0x120587[_0x96cc('0x2c')];}catch(_0x2de907){_0x1c9f93(_0x2de907);}_0x25bad1(_0x120587);});}function updateWhatsappInteraction(_0x2aec1a,_0x29cfee,_0x2f074e){return new BPromise(function(_0x10fa7e,_0xdff78d){return getInteractionUsers(_0x2aec1a,_0x2f074e)[_0x96cc('0x23')](function(_0x3c4f2f){return getInteractionTags(_0x3c4f2f,_0x29cfee);})[_0x96cc('0x23')](function(_0x44f876){_0x10fa7e(_0x44f876);})[_0x96cc('0x31')](function(_0x362f50){_0xdff78d(_0x362f50);});});}exports[_0x96cc('0x32')]=function(_0x36e7db,_0x36c04e){var _0x22538c={},_0x50f9fa={},_0x30e93f={'count':0x0,'rows':[]};var _0x4e351a=_[_0x96cc('0x2a')](db['WhatsappInteraction'][_0x96cc('0x33')],function(_0x2858e7){return{'name':_0x2858e7[_0x96cc('0x34')],'type':_0x2858e7[_0x96cc('0x35')]['key']};});_0x50f9fa[_0x96cc('0x36')]=_[_0x96cc('0x2a')](_0x4e351a,_0x96cc('0x27'));_0x50f9fa[_0x96cc('0x37')]=_[_0x96cc('0x38')](_0x36e7db[_0x96cc('0x37')]);_0x50f9fa[_0x96cc('0x39')]=_[_0x96cc('0x3a')](_0x50f9fa[_0x96cc('0x36')],_0x50f9fa[_0x96cc('0x37')]);_0x22538c[_0x96cc('0x3b')]=_[_0x96cc('0x3a')](_0x50f9fa['model'],qs[_0x96cc('0x3c')](_0x36e7db[_0x96cc('0x37')][_0x96cc('0x3c')]));_0x22538c[_0x96cc('0x3b')]=_0x22538c['attributes']['length']?_0x22538c[_0x96cc('0x3b')]:_0x50f9fa['model'];if(!_0x36e7db[_0x96cc('0x37')]['hasOwnProperty'](_0x96cc('0x3d'))){_0x22538c['limit']=qs[_0x96cc('0x3e')](_0x36e7db['query']['limit']);_0x22538c[_0x96cc('0x1d')]=qs[_0x96cc('0x1d')](_0x36e7db[_0x96cc('0x37')][_0x96cc('0x1d')]);}_0x22538c['order']=qs['sort'](_0x36e7db[_0x96cc('0x37')][_0x96cc('0x3f')]);_0x22538c['where']=qs[_0x96cc('0x39')](_[_0x96cc('0x40')](_0x36e7db['query'],_0x50f9fa[_0x96cc('0x39')]),_0x4e351a);var _0x4b5ffb=[];var _0x223f7f=squel[_0x96cc('0x41')]()['field']('id')[_0x96cc('0x42')](_0x96cc('0x27'))['field'](_0x96cc('0x43'))[_0x96cc('0x44')]('tools_tags');var _0x49297a=squel[_0x96cc('0x41')]()[_0x96cc('0x42')](_0x96cc('0x45'))[_0x96cc('0x42')](_0x96cc('0x46'))[_0x96cc('0x42')](_0x96cc('0x47'))[_0x96cc('0x44')]('user_has_whatsapp_interactions','ui')[_0x96cc('0x48')](_0x96cc('0x49'),'u',_0x96cc('0x4a'));var _0x148456=squel[_0x96cc('0x41')]()[_0x96cc('0x44')]('whatsapp_interactions','i')[_0x96cc('0x48')](_0x96cc('0x4b'),'c',_0x96cc('0x4c'))[_0x96cc('0x48')](_0x96cc('0x49'),'o',_0x96cc('0x4d'))[_0x96cc('0x48')](_0x96cc('0x4e'),'a',_0x96cc('0x4f'))[_0x96cc('0x48')](_0x96cc('0x50'),'me',_0x96cc('0x51'))[_0x96cc('0x48')](_0x96cc('0x52'),'it',_0x96cc('0x53'))[_0x96cc('0x48')](_0x96cc('0x54'),'t',_0x96cc('0x55'));var _0xf222ba=squel[_0x96cc('0x56')]();var _0x4d6ed1=[];var _0x4614a5=squel[_0x96cc('0x56')]();var _0x3d5055;if(_0x36e7db[_0x96cc('0x37')][_0x96cc('0x57')]){_0x3d5055=as[_0x96cc('0x58')](_0x36e7db[_0x96cc('0x37')][_0x96cc('0x57')]);var _0x21323b=_0x3d5055[_0x96cc('0x59')];for(var _0x5c0227=0x0;_0x5c0227<_0x3d5055[_0x96cc('0x5a')][_0x96cc('0x5b')];_0x5c0227++){var _0x5a2d82=_0x3d5055['conditions'][_0x5c0227];var _0x11788d='i';var _0x27df02=_[_0x96cc('0x5c')](_0x4e351a,[_0x96cc('0x27'),_0x5a2d82['field']]);if(!_0x27df02){switch(_0x5a2d82[_0x96cc('0x42')]){case _0x96cc('0x5d'):if(_0x5a2d82[_0x96cc('0x5e')]==0x1){_0x148456[_0x96cc('0x5f')]('`'+_0x5a2d82[_0x96cc('0x42')]+'`\x20=\x200');}else{_0x148456[_0x96cc('0x5f')]('`'+_0x5a2d82[_0x96cc('0x42')]+_0x96cc('0x60'));}break;case _0x96cc('0x61'):if(_0x5a2d82['operator']===_0x96cc('0x62')){if(_0x5a2d82['value'][_0x96cc('0x2d')]('\x20')[_0x96cc('0x5b')]>0x1){_0xf222ba[_0x21323b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x96cc('0x63')](_0x5a2d82['value']),null);}else{var _0x3b2a45='%'+_0x5a2d82[_0x96cc('0x5e')]+'%';_0xf222ba[_0x21323b](_0x96cc('0x64'),_0x3b2a45,_0x3b2a45,_0x3b2a45);}}else{_0x27df02=_[_0x96cc('0x5c')](_0x4e351a,[_0x96cc('0x27'),_0x96cc('0x65')]);_0x5a2d82[_0x96cc('0x42')]='ContactId';_0x555bc0=as['buildExpression'](_0x11788d,_0x27df02[_0x96cc('0x35')],_0x5a2d82);_0xf222ba[_0x21323b](_0x555bc0['text'],_0x555bc0['value'][_0x96cc('0x66')],_0x555bc0[_0x96cc('0x5e')]['end']);}break;case _0x96cc('0x67'):var _0x28dd5b=_0x5a2d82[_0x96cc('0x5e')][_0x96cc('0x2d')](',')['map'](function(_0x3a5901){return Number(_0x3a5901);});_0x28dd5b['forEach'](function(_0x22bc46){_0x4614a5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x22bc46+',%');});_0x4d6ed1=_['union'](_0x4d6ed1,_0x28dd5b);break;case _0x96cc('0x68'):if(_0x5a2d82[_0x96cc('0x69')]===_0x96cc('0x62')){_0xf222ba[_0x21323b](_0x96cc('0x6a'),'%'+_0x5a2d82['value']+'%',null);}else{_0x27df02=_[_0x96cc('0x5c')](_0x4e351a,[_0x96cc('0x27'),_0x96cc('0x6b')]);_0x5a2d82[_0x96cc('0x42')]='UserId';_0x555bc0=as[_0x96cc('0x6c')](_0x11788d,_0x27df02['type'],_0x5a2d82);_0xf222ba[_0x21323b](_0x555bc0[_0x96cc('0x6d')],_0x555bc0['value'][_0x96cc('0x66')],_0x555bc0['value'][_0x96cc('0x6e')]);}break;case _0x96cc('0x6f'):_0x555bc0=as[_0x96cc('0x6c')]('me',null,_0x5a2d82);_0xf222ba[_0x21323b](_0x555bc0[_0x96cc('0x6d')],_0x555bc0['value'][_0x96cc('0x66')],_0x555bc0[_0x96cc('0x5e')][_0x96cc('0x6e')]);break;}}else{var _0x555bc0=as['buildExpression'](_0x11788d,_0x27df02[_0x96cc('0x35')],_0x5a2d82);_0xf222ba[_0x21323b](_0x555bc0['text'],_0x555bc0[_0x96cc('0x5e')][_0x96cc('0x66')],_0x555bc0['value'][_0x96cc('0x6e')]);}}}else{var _0xd7c17c=_(_0x36e7db['query'])[_0x96cc('0x38')]()[_0x96cc('0x2a')](function(_0x45fde7){return _['some'](_0x4e351a,[_0x96cc('0x27'),_0x45fde7])?_0x45fde7:undefined;})['compact']()['value']();if(!_[_0x96cc('0x70')](_0xd7c17c)){_0xd7c17c['forEach'](function(_0x13287d){if(_0x13287d==='WhatsappAccountId'){_0x148456[_0x96cc('0x71')]('i.WhatsappAccountId\x20IN\x20?',[][_0x96cc('0x72')](_0x36e7db[_0x96cc('0x37')][_0x13287d]));}else if(_0x13287d===_0x96cc('0x73')){var _0x318c2b=JSON['parse'](_0x36e7db[_0x96cc('0x37')][_0x13287d])[_0x96cc('0x74')];var _0x3527bf=JSON[_0x96cc('0x75')](_0x36e7db['query'][_0x13287d])['$lte'];_0x148456[_0x96cc('0x71')](_0x96cc('0x76'),_0x318c2b,_0x3527bf);}else{if(_0x36e7db[_0x96cc('0x37')][_0x13287d]===_0x96cc('0x77')){_0x148456[_0x96cc('0x71')]('i.'+_0x13287d+_0x96cc('0x78'));}else{_0x148456[_0x96cc('0x71')]('i.'+_0x13287d+'\x20=\x20?',_0x36e7db['query'][_0x13287d]);}}});}if(_0x36e7db[_0x96cc('0x37')][_0x96cc('0x79')]){if(_0x36e7db['query'][_0x96cc('0x79')]==0x1){_0x148456[_0x96cc('0x5f')](_0x96cc('0x7a'));}else{_0x148456['having'](_0x96cc('0x7b'));}}if(_0x36e7db[_0x96cc('0x37')][_0x96cc('0x7c')]){_0x4d6ed1=_[_0x96cc('0x7d')](_0x36e7db[_0x96cc('0x37')][_0x96cc('0x7c')])?_0x36e7db[_0x96cc('0x37')][_0x96cc('0x7c')]:new Array(_0x36e7db[_0x96cc('0x37')]['tag']);_0x4d6ed1[_0x96cc('0x2e')](function(_0x5b32ab){_0x4614a5['or'](_0x96cc('0x7e'),'%,'+_0x5b32ab+',%');});}if(_0x36e7db[_0x96cc('0x37')]['filter']){var _0x1f7e32=_0x36e7db['query']['filter'][_0x96cc('0x7f')]('\x5c','\x5c\x5c')[_0x96cc('0x7f')](/'/g,'\x27\x27');if(qs[_0x96cc('0x80')](_0x1f7e32)){_0xf222ba['or'](_0x96cc('0x81'),_0x1f7e32+'%')['or'](_0x96cc('0x82'),_0x1f7e32+'%');}else{_0xf222ba['or'](_0x96cc('0x83'),qs[_0x96cc('0x63')](_0x1f7e32))['or'](_0x96cc('0x84'),_0x1f7e32+'%');}}}_0x148456[_0x96cc('0x71')](_0xf222ba);_0x148456['group'](_0x96cc('0x85'));var _0x48aeea={'type':db['Sequelize'][_0x96cc('0x86')][_0x96cc('0x87')],'raw':!![]};var _0x34f4ef=_0x148456[_0x96cc('0x88')]();_0x34f4ef[_0x96cc('0x42')](_0x96cc('0x85'));_0x34f4ef['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x22538c[_0x96cc('0x89')]){_0x22538c[_0x96cc('0x89')]['forEach'](function(_0x52033b){var _0x11c465=_0x52033b[0x0]===_0x96cc('0x8a')?_0x52033b[0x0]:'i.'+_0x52033b[0x0];_0x148456[_0x96cc('0x89')](_0x11c465,_0x52033b[0x1]===_0x96cc('0x8b')?![]:!![]);});}if(!_[_0x96cc('0x70')](_0x4d6ed1)){_0x148456['having'](_0x4614a5);_0x34f4ef[_0x96cc('0x71')](_0x96cc('0x8c'),_0x4d6ed1);}BPromise[_0x96cc('0x8d')]()[_0x96cc('0x23')](function(){if(!_0x3d5055){if(_0x36e7db[_0x96cc('0x37')][_0x96cc('0x8e')])return;_0x34f4ef[_0x96cc('0x71')](_0x96cc('0x8f'));_0x148456[_0x96cc('0x71')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x36e7db[_0x96cc('0x90')]['role']!==_0x96cc('0x91'))return;return _0x36e7db[_0x96cc('0x90')][_0x96cc('0x92')]({'attributes':['id'],'raw':!![]})[_0x96cc('0x23')](function(_0x28256b){if(_[_0x96cc('0x70')](_0x28256b)){_0x34f4ef[_0x96cc('0x71')](_0x96cc('0x93'));_0x148456[_0x96cc('0x71')](_0x96cc('0x93'));}else{_0x34f4ef[_0x96cc('0x71')](_0x96cc('0x94'),_[_0x96cc('0x2a')](_0x28256b,'id'));_0x148456[_0x96cc('0x71')](_0x96cc('0x94'),_[_0x96cc('0x2a')](_0x28256b,'id'));}});})[_0x96cc('0x23')](function(){if(_0x36e7db[_0x96cc('0x90')][_0x96cc('0x95')]===_0x96cc('0x91')&&!_0x3d5055&&!_0x36e7db[_0x96cc('0x37')][_0x96cc('0x8e')])return[];return db[_0x96cc('0x96')][_0x96cc('0x37')](_0x34f4ef[_0x96cc('0x97')](),_0x48aeea);})['then'](function(_0x3c5be1){_0x30e93f[_0x96cc('0x1c')]=_0x3c5be1[_0x96cc('0x5b')];if(_0x30e93f['count']===0x0)return[];return db['sequelize']['query'](_0x223f7f[_0x96cc('0x97')](),_0x48aeea)[_0x96cc('0x23')](function(_0x6f39ec){_0x4b5ffb=_[_0x96cc('0x98')](_0x6f39ec,'id');_0x48aeea=_[_0x96cc('0x99')](_0x48aeea,{'model':db[_0x96cc('0x9a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x36e7db['query'][_0x96cc('0x3c')]){_0x22538c[_0x96cc('0x3b')]['forEach'](function(_0x3034c1){_0x148456['field']('i.'+_0x3034c1);});}else{_0x148456[_0x96cc('0x42')](_0x96cc('0x9b'),_0x96cc('0x5d'));_0x148456[_0x96cc('0x42')](_0x96cc('0x9c'),'Account.key');_0x148456[_0x96cc('0x42')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x148456[_0x96cc('0x42')](_0x96cc('0x9d'),_0x96cc('0x8a'));_0x148456[_0x96cc('0x42')](_0x96cc('0x9e'));_0x148456[_0x96cc('0x42')]('c.firstName',_0x96cc('0x9f'));_0x148456['field']('c.lastName',_0x96cc('0xa0'));_0x148456[_0x96cc('0x42')](_0x96cc('0xa1'),_0x96cc('0xa2'));_0x148456[_0x96cc('0x42')](_0x96cc('0xa3'),_0x96cc('0xa4'));_0x148456[_0x96cc('0x42')]('c.mobile','Contact.mobile');_0x148456[_0x96cc('0x42')](_0x96cc('0xa5'),'Contact.fax');_0x148456[_0x96cc('0x42')](_0x96cc('0xa6'),'Owner.fullname');_0x148456['field'](_0x96cc('0xa7'),_0x96cc('0xa8'));_0x148456[_0x96cc('0x42')](_0x96cc('0xa9'),'TagIds');}if(_0x22538c[_0x96cc('0x3e')])_0x148456[_0x96cc('0x3e')](_0x22538c[_0x96cc('0x3e')]);if(_0x22538c['offset'])_0x148456[_0x96cc('0x1d')](_0x22538c[_0x96cc('0x1d')]);return db['sequelize'][_0x96cc('0x37')](_0x148456['toString'](),_0x48aeea);})[_0x96cc('0x23')](function(_0x9f656b){_0x49297a[_0x96cc('0x71')](_0x96cc('0xaa'),_['map'](_0x9f656b,'id'));return db[_0x96cc('0x96')]['query'](_0x49297a[_0x96cc('0x97')](),_0x48aeea)[_0x96cc('0x23')](function(_0x8aa1fc){var _0x32072a=_[_0x96cc('0xab')](_0x8aa1fc,_0x96cc('0xac'));var _0x2023aa=[];_0x9f656b[_0x96cc('0x2e')](function(_0x10ef85){_0x2023aa[_0x96cc('0x30')](updateWhatsappInteraction(_0x10ef85,_0x4b5ffb,_0x32072a));});return BPromise[_0x96cc('0xad')](_0x2023aa);});});})[_0x96cc('0x23')](function(_0x4c9fd7){_0x30e93f[_0x96cc('0xae')]=_0x4c9fd7;return _0x30e93f;})['then'](respondWithFilteredResult(_0x36c04e,_0x22538c))[_0x96cc('0x31')](handleError(_0x36c04e,null));};exports['show']=function(_0x35e95d,_0xd392ea){var _0xe64902={'raw':![],'where':{'id':_0x35e95d[_0x96cc('0xaf')]['id']}},_0x467975={};_0x467975['model']=_[_0x96cc('0x38')](db[_0x96cc('0x9a')][_0x96cc('0x33')]);_0x467975[_0x96cc('0x37')]=_[_0x96cc('0x38')](_0x35e95d['query']);_0x467975[_0x96cc('0x39')]=_[_0x96cc('0x3a')](_0x467975[_0x96cc('0x36')],_0x467975[_0x96cc('0x37')]);_0xe64902[_0x96cc('0x3b')]=_['intersection'](_0x467975[_0x96cc('0x36')],qs[_0x96cc('0x3c')](_0x35e95d[_0x96cc('0x37')][_0x96cc('0x3c')]));_0xe64902[_0x96cc('0x3b')]=_0xe64902['attributes'][_0x96cc('0x5b')]?_0xe64902['attributes']:_0x467975['model'];if(_0x35e95d[_0x96cc('0x37')][_0x96cc('0xb0')]){_0xe64902[_0x96cc('0xb1')]=[{'all':!![]}];}_0xe64902=_[_0x96cc('0x99')]({},_0xe64902,_0x35e95d['options']);return db[_0x96cc('0x9a')][_0x96cc('0x5c')](_0xe64902)['then'](handleEntityNotFound(_0xd392ea,null))['then'](respondWithResult(_0xd392ea,null))[_0x96cc('0x31')](handleError(_0xd392ea,null));};exports[_0x96cc('0xb2')]=function(_0x513ff5,_0x1d945d){return db[_0x96cc('0x9a')]['create'](_0x513ff5['body'],{})[_0x96cc('0x23')](respondWithResult(_0x1d945d,0xc9))['catch'](handleError(_0x1d945d,null));};exports[_0x96cc('0x22')]=function(_0x183db1,_0x38a989){if(_0x183db1[_0x96cc('0x6f')]['id']){delete _0x183db1[_0x96cc('0x6f')]['id'];}return db[_0x96cc('0x9a')][_0x96cc('0x5c')]({'where':{'id':_0x183db1[_0x96cc('0xaf')]['id']}})['then'](handleEntityNotFound(_0x38a989,null))[_0x96cc('0x23')](saveUpdates(_0x183db1[_0x96cc('0x6f')],null))[_0x96cc('0x23')](respondWithResult(_0x38a989,null))[_0x96cc('0x31')](handleError(_0x38a989,null));};exports[_0x96cc('0x24')]=function(_0x291cde,_0xb8cd9){return db[_0x96cc('0x9a')][_0x96cc('0x5c')]({'where':{'id':_0x291cde[_0x96cc('0xaf')]['id']}})['then'](handleEntityNotFound(_0xb8cd9,null))[_0x96cc('0x23')](removeEntity(_0xb8cd9,null))['catch'](handleError(_0xb8cd9,null));};exports['describe']=function(_0x3948cb,_0x2efe09){return db[_0x96cc('0x9a')][_0x96cc('0xb3')]()[_0x96cc('0x23')](respondWithResult(_0x2efe09,null))[_0x96cc('0x31')](handleError(_0x2efe09,null));};exports[_0x96cc('0xb4')]=function(_0x301377,_0x22f176,_0x13588a){return db['WhatsappMessage'][_0x96cc('0x5c')]({'where':{'id':_0x301377['params']['id']}})[_0x96cc('0x23')](handleEntityNotFound(_0x22f176,null))['then'](function(_0xc5266b){if(_0xc5266b){return _0xc5266b[_0x96cc('0xb4')](_0x301377['body'][_0x96cc('0xb5')],_[_0x96cc('0xb6')](_0x301377[_0x96cc('0x6f')],['ids','id'])||{});}})['then'](respondWithResult(_0x22f176,null))[_0x96cc('0x31')](handleError(_0x22f176,null));};exports[_0x96cc('0xb7')]=function(_0x20e487,_0xd1ddd0,_0x136f42){var _0x4af670={'raw':![],'where':{}};var _0x1ceb85={};var _0x1b0a94={'count':0x0,'rows':[]};return db[_0x96cc('0x9a')][_0x96cc('0xb8')]({'where':{'id':_0x20e487['params']['id']}})['then'](handleEntityNotFound(_0xd1ddd0,null))[_0x96cc('0x23')](function(_0x173acb){if(_0x173acb){_0x1ceb85['model']=_['keys'](db[_0x96cc('0xb9')][_0x96cc('0x33')]);_0x1ceb85[_0x96cc('0x37')]=_[_0x96cc('0x38')](_0x20e487[_0x96cc('0x37')]);_0x1ceb85['filters']=_[_0x96cc('0x3a')](_0x1ceb85[_0x96cc('0x36')],_0x1ceb85[_0x96cc('0x37')]);_0x4af670[_0x96cc('0x3b')]=_[_0x96cc('0x3a')](_0x1ceb85['model'],qs[_0x96cc('0x3c')](_0x20e487[_0x96cc('0x37')][_0x96cc('0x3c')]));_0x4af670[_0x96cc('0x3b')]=_0x4af670[_0x96cc('0x3b')][_0x96cc('0x5b')]?_0x4af670[_0x96cc('0x3b')]:_0x1ceb85['model'];if(!_0x20e487[_0x96cc('0x37')][_0x96cc('0xba')](_0x96cc('0x3d'))){_0x4af670[_0x96cc('0x3e')]=qs[_0x96cc('0x3e')](_0x20e487['query']['limit']);_0x4af670[_0x96cc('0x1d')]=qs['offset'](_0x20e487[_0x96cc('0x37')][_0x96cc('0x1d')]);}_0x4af670[_0x96cc('0x89')]=qs[_0x96cc('0x3f')](_0x20e487['query']['sort']);_0x4af670['where']=qs[_0x96cc('0x39')](_[_0x96cc('0x40')](_0x20e487[_0x96cc('0x37')],_0x1ceb85[_0x96cc('0x39')]));_0x4af670[_0x96cc('0x71')][_0x96cc('0xac')]=_0x173acb['id'];if(_0x20e487[_0x96cc('0x37')][_0x96cc('0xbb')]){_0x4af670[_0x96cc('0x71')]=_[_0x96cc('0x99')](_0x4af670[_0x96cc('0x71')],{'$or':_['map'](_0x4af670[_0x96cc('0x3b')],function(_0x471397){var _0x1d42a4={};_0x1d42a4[_0x471397]={'$like':'%'+_0x20e487[_0x96cc('0x37')][_0x96cc('0xbb')]+'%'};return _0x1d42a4;})});}if(_0x20e487[_0x96cc('0x37')]['$gte']){var _0x2d6a69=_0x20e487['query']['$gte'][_0x96cc('0x2d')](',');var _0x1e4dce={};_0x1e4dce[_0x2d6a69[0x0]]={'$gte':moment(_0x2d6a69[0x1])[_0x96cc('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4af670[_0x96cc('0x71')]=_[_0x96cc('0x99')](_0x4af670[_0x96cc('0x71')],_0x1e4dce);}_0x4af670=_['merge']({},_0x4af670,_0x20e487[_0x96cc('0xbd')]);return db[_0x96cc('0xb9')]['count']({'where':_0x4af670['where']})[_0x96cc('0x23')](function(_0x301d12){_0x1b0a94[_0x96cc('0x1c')]=_0x301d12;if(_0x20e487[_0x96cc('0x37')][_0x96cc('0xb0')]){_0x4af670[_0x96cc('0xb1')]=[{'all':!![]}];}return db[_0x96cc('0xb9')][_0x96cc('0xbe')](_0x4af670);})[_0x96cc('0x23')](function(_0x5f74d5){_0x1b0a94[_0x96cc('0xae')]=_0x5f74d5;return _0x1b0a94;});}})[_0x96cc('0x23')](respondWithFilteredResult(_0xd1ddd0,_0x4af670))[_0x96cc('0x31')](handleError(_0xd1ddd0,null));};exports[_0x96cc('0xbf')]=function(_0x4b2060,_0x4bae9e,_0x515e95){return db[_0x96cc('0x9a')][_0x96cc('0x5c')]({'where':{'id':_0x4b2060['params']['id']}})[_0x96cc('0x23')](handleEntityNotFound(_0x4bae9e,null))[_0x96cc('0x23')](function(_0x498786){if(_0x498786){return _0x498786[_0x96cc('0xc0')](_0x4b2060[_0x96cc('0x6f')][_0x96cc('0xb5')],_[_0x96cc('0xb6')](_0x4b2060[_0x96cc('0x6f')],[_0x96cc('0xb5'),'id'])||{})['spread'](function(){return db[_0x96cc('0x67')][_0x96cc('0xbe')]({'attributes':['id',_0x96cc('0x27'),_0x96cc('0x43')],'where':{'id':_0x4b2060[_0x96cc('0x6f')][_0x96cc('0xb5')]}});})[_0x96cc('0x23')](function(_0x21caa8){socket[_0x96cc('0xc1')](_0x96cc('0xc2'),{'id':Number(_0x4b2060[_0x96cc('0xaf')]['id']),'tags':_0x21caa8||[]});return{'id':Number(_0x4b2060[_0x96cc('0xaf')]['id']),'tags':_0x21caa8||[]};});}})[_0x96cc('0x23')](respondWithResult(_0x4bae9e,null))[_0x96cc('0x31')](handleError(_0x4bae9e,null));};exports[_0x96cc('0xc3')]=function(_0x41c3a4,_0x21c4f9,_0x5f38e9){return db[_0x96cc('0x9a')][_0x96cc('0x5c')]({'where':{'id':_0x41c3a4[_0x96cc('0xaf')]['id']}})[_0x96cc('0x23')](handleEntityNotFound(_0x21c4f9,null))[_0x96cc('0x23')](function(_0xaf9fec){if(_0xaf9fec){return _0xaf9fec[_0x96cc('0xc3')](_0x41c3a4['query'][_0x96cc('0xb5')]);}})[_0x96cc('0x23')](respondWithStatusCode(_0x21c4f9,null))[_0x96cc('0x31')](handleError(_0x21c4f9,null));};exports['download']=function(_0x415f19,_0xa95721){var _0x238e47=moment()[_0x96cc('0xc4')]()[_0x96cc('0x97')]();var _0x52c4a4=path['join'](config['root'],'server','files','tmp');var _0x2d057f=path[_0x96cc('0xc5')](config[_0x96cc('0xc6')],_0x96cc('0xc7'),'files',_0x96cc('0xc8'));var _0x139539=path[_0x96cc('0xc5')](_0x52c4a4,_0x238e47);var _0x3872d0=util['format'](_0x96cc('0xc9'),_0x415f19['params']['id'],_0x238e47);var _0x41f5ae=path[_0x96cc('0xc5')](_0x52c4a4,_0x3872d0);var _0xd4993b=[];_0xd4993b['push']({'model':db[_0x96cc('0x68')],'as':_0x96cc('0x68'),'attributes':['id',_0x96cc('0x2b')],'raw':!![]});_0xd4993b[_0x96cc('0x30')]({'model':db[_0x96cc('0xca')],'as':'Contact','attributes':['id',_0x96cc('0xcb'),_0x96cc('0xcc')],'raw':!![]});if(_0x415f19['query']['attachments']){_0xd4993b[_0x96cc('0x30')]({'model':db['Attachment'],'as':_0x96cc('0xcd'),'raw':!![]});}var _0x545681=[{'model':db[_0x96cc('0xb9')],'as':_0x96cc('0xce'),'attributes':['id','body',_0x96cc('0x73'),_0x96cc('0xcf'),_0x96cc('0xd0'),_0x96cc('0x79')],'include':_0xd4993b}];_0x545681['push']({'model':db[_0x96cc('0xd1')],'as':_0x96cc('0xd2'),'attributes':['id','name']});_0x545681[_0x96cc('0x30')]({'model':db[_0x96cc('0x68')],'as':'Owner','attributes':['id',_0x96cc('0x2b')]});return db[_0x96cc('0x9a')][_0x96cc('0x5c')]({'where':{'id':_0x415f19[_0x96cc('0xaf')]['id']},'include':_0x545681})[_0x96cc('0x23')](handleEntityNotFound(_0xa95721,null))[_0x96cc('0x23')](function(_0x2c363b){if(_0x2c363b){var _0x52406c=_0x2c363b[_0x96cc('0xd3')]({'plain':!![]});fs[_0x96cc('0xd4')](_0x139539);var _0x53c37d={'channel':_0x96cc('0xd5'),'account':_0x52406c[_0x96cc('0xd2')][_0x96cc('0x27')],'agent':_0x52406c[_0x96cc('0xd6')]?_0x52406c[_0x96cc('0xd6')]['fullname']:_0x96cc('0xd7'),'createdAt':moment(_0x52406c[_0x96cc('0x73')])['format'](_0x96cc('0xd8'))['toString'](),'closedAt':_0x52406c[_0x96cc('0xd9')]?moment(_0x52406c[_0x96cc('0xda')])['format'](_0x96cc('0xd8'))[_0x96cc('0x97')]():'','disposition':_0x52406c['disposition'],'messages':_(_0x52406c[_0x96cc('0xce')])['filter']({'secret':![]})[_0x96cc('0x2a')](function(_0x1d3d55){if(_0x1d3d55[_0x96cc('0xcd')]){var _0x144c8f=path['join'](_0x2d057f,_0x1d3d55[_0x96cc('0xcd')][_0x96cc('0xdb')]);if(fs['existsSync'](_0x144c8f)){fs[_0x96cc('0xdc')](_0x144c8f)[_0x96cc('0xdd')](fs[_0x96cc('0xde')](path['join'](_0x139539,_0x1d3d55['Attachment'][_0x96cc('0xdb')])));}}return{'date':moment(_0x1d3d55[_0x96cc('0x73')])[_0x96cc('0xbc')](_0x96cc('0xd8'))[_0x96cc('0x97')](),'sender':_0x1d3d55[_0x96cc('0xcf')]==='out'?_0x1d3d55[_0x96cc('0x68')]?_0x1d3d55[_0x96cc('0x68')][_0x96cc('0x2b')]:'System':_0x1d3d55[_0x96cc('0x61')]['firstName']+(_0x1d3d55['Contact']['lastName']?'\x20'+_0x1d3d55[_0x96cc('0x61')]['lastName']:''),'body':_0x1d3d55[_0x96cc('0xcd')]?_0x1d3d55[_0x96cc('0xcd')][_0x96cc('0xdb')]:_0x1d3d55[_0x96cc('0x6f')],'direction':_0x1d3d55[_0x96cc('0xcf')]===_0x96cc('0xdf')?'A':'C','secret':_0x1d3d55[_0x96cc('0xd0')],'read':_0x1d3d55[_0x96cc('0x79')],'attachment':_0x1d3d55[_0x96cc('0xcd')]};})[_0x96cc('0x5e')]()};return ejs[_0x96cc('0xe0')](path['join'](config['root'],_0x96cc('0xc7'),_0x96cc('0xe1'),'downloadInteraction.html'),{'interaction':_0x53c37d})[_0x96cc('0x23')](function(_0xf1e379){var _0x457459=path[_0x96cc('0xc5')](_0x139539,_0x96cc('0xe2')+_0x52406c['id']+'-'+_0x238e47+_0x96cc('0xe3'));var _0x47482f={'path':_0x457459,'channel':_0x96cc('0xd5'),'interactionId':_0x52406c['id']};return pdf[_0x96cc('0xe4')](_0xf1e379,_0x47482f);})[_0x96cc('0x23')](function(){return new BPromise(function(_0x1e9238,_0x1075b2){zipdir(_0x139539,{'saveTo':_0x41f5ae},function(_0x39fe2b,_0xa565){if(_0x39fe2b)return _0x1075b2(_0x39fe2b);return _0x1e9238(_0xa565);});})['then'](function(){return new BPromise(function(_0xfe86d8,_0x1da4a8){rimraf(_0x139539,function(_0x423b7e){if(_0x423b7e)_0x1da4a8(_0x423b7e);return _0xfe86d8();});});})[_0x96cc('0x23')](function(){return _0xa95721[_0x96cc('0xe5')](_0x41f5ae,_0x3872d0,function(_0x14fd34){if(_0x14fd34){console['log'](_0x96cc('0xe6'),_0x14fd34);}else{fs[_0x96cc('0xe7')](_0x41f5ae);}});});});}else{return _0xa95721[_0x96cc('0x19')](0xc8);}})[_0x96cc('0x31')](handleError(_0xa95721,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 0a58e10..898c9de 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 _0x1e5d=['hasOwnProperty','events','../../mysqldb','setMaxListeners','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x554e9a,_0x7092e4){var _0x235d00=function(_0x5259b2){while(--_0x5259b2){_0x554e9a['push'](_0x554e9a['shift']());}};_0x235d00(++_0x7092e4);}(_0x1e5d,0x1eb));var _0xd1e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1e5d[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xd1e5('0x0'));var WhatsappInteraction=require(_0xd1e5('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xd1e5('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd1e5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd1e5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cceaf){return function(_0x603b51,_0xa6e9d6,_0x27a873){_0x603b51[_0xd1e5('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x16d23d){_0x603b51[_0xd1e5('0x5')](_0xd1e5('0x6'),_0x16d23d[_0xd1e5('0x7')](function(_0x3fdc8f){return{'id':_0x3fdc8f['id']};}));return WhatsappMessage[_0xd1e5('0x8')]({'where':{'WhatsappInteractionId':_0x603b51['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd1e5('0x9')](function(_0x55049e){_0x603b51['setDataValue'](_0xd1e5('0xa'),_0x55049e[_0xd1e5('0xb')]);WhatsappInteractionEvents[_0xd1e5('0xc')](_0x3cceaf+':'+_0x603b51['id'],_0x603b51);WhatsappInteractionEvents[_0xd1e5('0xc')](_0x3cceaf,_0x603b51);_0x27a873(null);})['catch'](_0x27a873(null));};}for(var e in events){if(events[_0xd1e5('0xd')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x2374=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','setDataValue'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x2374,0xe6));var _0x4237=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2374[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x4237('0x0'));var WhatsappInteraction=require(_0x4237('0x1'))['db'][_0x4237('0x2')];var WhatsappMessage=require(_0x4237('0x1'))['db'][_0x4237('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4237('0x4')](0x0);var events={'afterCreate':_0x4237('0x5'),'afterUpdate':_0x4237('0x6'),'afterDestroy':_0x4237('0x7')};function emitEvent(_0x314683){return function(_0x1e0708,_0x2c920a,_0x2e0255){_0x1e0708[_0x4237('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x168a3d){_0x1e0708[_0x4237('0x9')](_0x4237('0xa'),_0x168a3d[_0x4237('0xb')](function(_0x3e2685){return{'id':_0x3e2685['id']};}));return WhatsappMessage[_0x4237('0xc')]({'where':{'WhatsappInteractionId':_0x1e0708['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2bb3f5){_0x1e0708['setDataValue'](_0x4237('0xd'),_0x2bb3f5[_0x4237('0xe')]);WhatsappInteractionEvents['emit'](_0x314683+':'+_0x1e0708['id'],_0x1e0708);WhatsappInteractionEvents[_0x4237('0xf')](_0x314683,_0x1e0708);_0x2e0255(null);})[_0x4237('0x10')](_0x2e0255(null));};}for(var e in events){if(events[_0x4237('0x11')](e)){var event=events[e];WhatsappInteraction[_0x4237('0x12')](e,emitEvent(event));}}module[_0x4237('0x13')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index e80e8d5..f41154e 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 _0x01ba=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','closed','format','lodash'];(function(_0x540b73,_0x53809c){var _0x1490bb=function(_0x5b9636){while(--_0x5b9636){_0x540b73['push'](_0x540b73['shift']());}};_0x1490bb(++_0x53809c);}(_0x01ba,0x1df));var _0xa01b=function(_0x1374f2,_0x4d530c){_0x1374f2=_0x1374f2-0x0;var _0x239f48=_0x01ba[_0x1374f2];return _0x239f48;};'use strict';var _=require(_0xa01b('0x0'));var util=require(_0xa01b('0x1'));var logger=require(_0xa01b('0x2'))(_0xa01b('0x3'));var moment=require(_0xa01b('0x4'));var BPromise=require(_0xa01b('0x5'));var rp=require(_0xa01b('0x6'));var fs=require('fs');var path=require(_0xa01b('0x7'));var rimraf=require(_0xa01b('0x8'));var config=require(_0xa01b('0x9'));var attributes=require(_0xa01b('0xa'));module[_0xa01b('0xb')]=function(_0x3133d4,_0x53eb44){return _0x3133d4['define'](_0xa01b('0xc'),attributes,{'tableName':_0xa01b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2950ae,_0x2c8641,_0x5004d3){if(_0x2950ae['changed'](_0xa01b('0xe'))){_0x2950ae['closedAt']=moment()[_0xa01b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5004d3(null,_0x2950ae);}}});}; \ No newline at end of file +var _0x1735=['path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x1735,0x17c));var _0x5173=function(_0x492e26,_0xa28503){_0x492e26=_0x492e26-0x0;var _0x2227df=_0x1735[_0x492e26];return _0x2227df;};'use strict';var _=require(_0x5173('0x0'));var util=require(_0x5173('0x1'));var logger=require(_0x5173('0x2'))(_0x5173('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5173('0x4'));var rimraf=require(_0x5173('0x5'));var config=require(_0x5173('0x6'));var attributes=require(_0x5173('0x7'));module[_0x5173('0x8')]=function(_0x14b496,_0x4866e9){return _0x14b496['define'](_0x5173('0x9'),attributes,{'tableName':_0x5173('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31655b,_0x5022e9,_0x4c63ca){if(_0x31655b[_0x5173('0xb')](_0x5173('0xc'))){_0x31655b[_0x5173('0xd')]=moment()[_0x5173('0xe')](_0x5173('0xf'));}_0x4c63ca(null,_0x31655b);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 97fa5b1..c2a3d75 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 _0x92f7=['find','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','then','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','WhatsappInteraction','update','body','options','where','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x92f7,0x19e));var _0x792f=function(_0x540311,_0x53ca8b){_0x540311=_0x540311-0x0;var _0x56beef=_0x92f7[_0x540311];return _0x56beef;};'use strict';var _=require(_0x792f('0x0'));var util=require(_0x792f('0x1'));var moment=require(_0x792f('0x2'));var BPromise=require('bluebird');var rs=require(_0x792f('0x3'));var fs=require('fs');var Redis=require(_0x792f('0x4'));var db=require(_0x792f('0x5'))['db'];var utils=require(_0x792f('0x6'));var logger=require(_0x792f('0x7'))(_0x792f('0x8'));var config=require(_0x792f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x792f('0xa')][_0x792f('0xb')]({'port':0x232a});config[_0x792f('0xc')]=_[_0x792f('0xd')](config[_0x792f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x792f('0xe'))(new Redis(config['redis']));require(_0x792f('0xf'))[_0x792f('0x10')](socket);function respondWithRpcPromise(_0x41a7e6,_0x1c2f0b,_0x425d65){return new BPromise(function(_0x43bdf6,_0x4d9c29){return client['request'](_0x41a7e6,_0x425d65)[_0x792f('0x11')](function(_0x25e8f2){logger['info'](_0x792f('0x12'),_0x1c2f0b,'request\x20sent');logger[_0x792f('0x13')](_0x792f('0x14'),_0x1c2f0b,_0x792f('0x15'),JSON[_0x792f('0x16')](_0x25e8f2));if(_0x25e8f2[_0x792f('0x17')]){if(_0x25e8f2['error'][_0x792f('0x18')]===0x1f4){logger['error'](_0x792f('0x12'),_0x1c2f0b,_0x25e8f2['error']['message']);return _0x4d9c29(_0x25e8f2[_0x792f('0x17')][_0x792f('0x19')]);}logger[_0x792f('0x17')](_0x792f('0x12'),_0x1c2f0b,_0x25e8f2['error'][_0x792f('0x19')]);return _0x43bdf6(_0x25e8f2['error'][_0x792f('0x19')]);}else{logger[_0x792f('0x1a')]('WhatsappInteraction,\x20%s,\x20%s',_0x1c2f0b,_0x792f('0x15'));_0x43bdf6(_0x25e8f2[_0x792f('0x1b')][_0x792f('0x19')]);}})[_0x792f('0x1c')](function(_0x2d1b4e){logger[_0x792f('0x17')](_0x792f('0x12'),_0x1c2f0b,_0x2d1b4e);_0x4d9c29(_0x2d1b4e);});});}exports['UpdateWhatsappInteraction']=function(_0x4c8649){var _0x3440e5=this;return new Promise(function(_0x3c2f3e,_0x56391e){return db[_0x792f('0x1d')][_0x792f('0x1e')](_0x4c8649[_0x792f('0x1f')],{'raw':_0x4c8649[_0x792f('0x20')]?_0x4c8649[_0x792f('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c8649[_0x792f('0x20')]?_0x4c8649[_0x792f('0x20')][_0x792f('0x21')]||null:null,'attributes':_0x4c8649['options']?_0x4c8649['options']['attributes']||null:null,'limit':_0x4c8649[_0x792f('0x20')]?_0x4c8649[_0x792f('0x20')][_0x792f('0x22')]||null:null})[_0x792f('0x11')](function(_0x4eb606){logger[_0x792f('0x1a')](_0x792f('0x23'),_0x4c8649);logger[_0x792f('0x13')]('UpdateWhatsappInteraction',_0x4c8649,JSON[_0x792f('0x16')](_0x4eb606));_0x3c2f3e(_0x4eb606);})[_0x792f('0x1c')](function(_0x1e4e72){logger[_0x792f('0x17')](_0x792f('0x23'),_0x1e4e72[_0x792f('0x19')],_0x4c8649);_0x56391e(_0x3440e5['error'](0x1f4,_0x1e4e72['message']));});});};exports[_0x792f('0x24')]=function(_0x2a554b){return new Promise(function(_0x10b4e0,_0x1b20a4){return db[_0x792f('0x1d')][_0x792f('0x25')]({'where':_0x2a554b['options']?_0x2a554b[_0x792f('0x20')][_0x792f('0x21')]||null:null})['then'](function(_0x453950){if(_0x453950){return _0x453950['addTags'](_0x2a554b[_0x792f('0x1f')][_0x792f('0x26')],_['omit'](_0x2a554b['body'],['ids','id'])||{});}})[_0x792f('0x27')](function(_0x41e9fe){logger[_0x792f('0x1a')]('AddTags',_0x2a554b);logger[_0x792f('0x13')]('AddTags',_0x2a554b,JSON[_0x792f('0x16')](_0x41e9fe));_0x10b4e0(_0x41e9fe);})[_0x792f('0x1c')](function(_0x4d2f06){logger[_0x792f('0x17')](_0x792f('0x28'),_0x4d2f06[_0x792f('0x19')],_0x2a554b);_0x1b20a4(_this[_0x792f('0x17')](0x1f4,_0x4d2f06[_0x792f('0x19')]));});});}; \ No newline at end of file +var _0x2adf=['http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','limit','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','client'];(function(_0x454190,_0x2ad284){var _0x2a9955=function(_0x222ee4){while(--_0x222ee4){_0x454190['push'](_0x454190['shift']());}};_0x2a9955(++_0x2ad284);}(_0x2adf,0x19c));var _0xf2ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2adf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf2ad('0x0'));var util=require(_0xf2ad('0x1'));var moment=require(_0xf2ad('0x2'));var BPromise=require(_0xf2ad('0x3'));var rs=require(_0xf2ad('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf2ad('0x5'));var logger=require('../../config/logger')(_0xf2ad('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf2ad('0x7')][_0xf2ad('0x8')]({'port':0x232a});config[_0xf2ad('0x9')]=_[_0xf2ad('0xa')](config[_0xf2ad('0x9')],{'host':_0xf2ad('0xb'),'port':0x18eb});var socket=require(_0xf2ad('0xc'))(new Redis(config[_0xf2ad('0x9')]));require(_0xf2ad('0xd'))[_0xf2ad('0xe')](socket);function respondWithRpcPromise(_0x21ac85,_0x1ee331,_0x172cb8){return new BPromise(function(_0x417d74,_0x5de98c){return client[_0xf2ad('0xf')](_0x21ac85,_0x172cb8)[_0xf2ad('0x10')](function(_0x1f262b){logger[_0xf2ad('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x1ee331,'request\x20sent');logger[_0xf2ad('0x12')](_0xf2ad('0x13'),_0x1ee331,_0xf2ad('0x14'),JSON[_0xf2ad('0x15')](_0x1f262b));if(_0x1f262b[_0xf2ad('0x16')]){if(_0x1f262b[_0xf2ad('0x16')][_0xf2ad('0x17')]===0x1f4){logger[_0xf2ad('0x16')](_0xf2ad('0x18'),_0x1ee331,_0x1f262b['error'][_0xf2ad('0x19')]);return _0x5de98c(_0x1f262b[_0xf2ad('0x16')][_0xf2ad('0x19')]);}logger[_0xf2ad('0x16')](_0xf2ad('0x18'),_0x1ee331,_0x1f262b[_0xf2ad('0x16')]['message']);return _0x417d74(_0x1f262b['error'][_0xf2ad('0x19')]);}else{logger[_0xf2ad('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x1ee331,_0xf2ad('0x14'));_0x417d74(_0x1f262b[_0xf2ad('0x1a')]['message']);}})[_0xf2ad('0x1b')](function(_0x462852){logger[_0xf2ad('0x16')](_0xf2ad('0x18'),_0x1ee331,_0x462852);_0x5de98c(_0x462852);});});}exports[_0xf2ad('0x1c')]=function(_0x59b3b7){var _0x48836d=this;return new Promise(function(_0x4ac563,_0x208eae){return db[_0xf2ad('0x1d')][_0xf2ad('0x1e')](_0x59b3b7[_0xf2ad('0x1f')],{'raw':_0x59b3b7[_0xf2ad('0x20')]?_0x59b3b7[_0xf2ad('0x20')][_0xf2ad('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59b3b7['options']?_0x59b3b7['options'][_0xf2ad('0x22')]||null:null,'attributes':_0x59b3b7[_0xf2ad('0x20')]?_0x59b3b7[_0xf2ad('0x20')]['attributes']||null:null,'limit':_0x59b3b7[_0xf2ad('0x20')]?_0x59b3b7['options'][_0xf2ad('0x23')]||null:null})[_0xf2ad('0x10')](function(_0x1b63ca){logger[_0xf2ad('0x11')](_0xf2ad('0x1c'),_0x59b3b7);logger[_0xf2ad('0x12')]('UpdateWhatsappInteraction',_0x59b3b7,JSON['stringify'](_0x1b63ca));_0x4ac563(_0x1b63ca);})[_0xf2ad('0x1b')](function(_0x3acd02){logger[_0xf2ad('0x16')](_0xf2ad('0x1c'),_0x3acd02[_0xf2ad('0x19')],_0x59b3b7);_0x208eae(_0x48836d[_0xf2ad('0x16')](0x1f4,_0x3acd02[_0xf2ad('0x19')]));});});};exports[_0xf2ad('0x24')]=function(_0x1ed2ff){return new Promise(function(_0xbcd467,_0x2142c5){return db[_0xf2ad('0x1d')][_0xf2ad('0x25')]({'where':_0x1ed2ff[_0xf2ad('0x20')]?_0x1ed2ff[_0xf2ad('0x20')][_0xf2ad('0x22')]||null:null})[_0xf2ad('0x10')](function(_0x57163c){if(_0x57163c){return _0x57163c[_0xf2ad('0x26')](_0x1ed2ff[_0xf2ad('0x1f')][_0xf2ad('0x27')],_['omit'](_0x1ed2ff[_0xf2ad('0x1f')],[_0xf2ad('0x27'),'id'])||{});}})[_0xf2ad('0x28')](function(_0xe0193){logger[_0xf2ad('0x11')](_0xf2ad('0x29'),_0x1ed2ff);logger['debug'](_0xf2ad('0x29'),_0x1ed2ff,JSON[_0xf2ad('0x15')](_0xe0193));_0xbcd467(_0xe0193);})[_0xf2ad('0x1b')](function(_0x2792e8){logger['error'](_0xf2ad('0x29'),_0x2792e8[_0xf2ad('0x19')],_0x1ed2ff);_0x2142c5(_this[_0xf2ad('0x16')](0x1f4,_0x2792e8[_0xf2ad('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index e6d4b33..7668ad9 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 _0x9207=['emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x353f08,_0x1510ac){var _0x2b90bd=function(_0x4ac5a8){while(--_0x4ac5a8){_0x353f08['push'](_0x353f08['shift']());}};_0x2b90bd(++_0x1510ac);}(_0x9207,0xf4));var _0x7920=function(_0x439534,_0x4ff786){_0x439534=_0x439534-0x0;var _0x211660=_0x9207[_0x439534];return _0x211660;};'use strict';var WhatsappInteractionEvents=require(_0x7920('0x0'));var events=[_0x7920('0x1'),_0x7920('0x2'),_0x7920('0x3')];function createListener(_0xd81b97,_0x10d5c0){return function(_0x4c851b){_0x10d5c0[_0x7920('0x4')](_0xd81b97,_0x4c851b);};}function removeListener(_0x47667c,_0x5cf1f7){return function(){WhatsappInteractionEvents[_0x7920('0x5')](_0x47667c,_0x5cf1f7);};}exports[_0x7920('0x6')]=function(_0x2d9552){for(var _0x2aa5a3=0x0,_0x49dc41=events['length'];_0x2aa5a3<_0x49dc41;_0x2aa5a3++){var _0x54984e=events[_0x2aa5a3];var _0x37dc28=createListener(_0x7920('0x7')+_0x54984e,_0x2d9552);WhatsappInteractionEvents['on'](_0x54984e,_0x37dc28);}}; \ No newline at end of file +var _0x43a8=['./whatsappInteraction.events','save','remove','update','removeListener','register','whatsappInteraction:'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x43a8,0x1c7));var _0x843a=function(_0x507b58,_0x2c0301){_0x507b58=_0x507b58-0x0;var _0x47599c=_0x43a8[_0x507b58];return _0x47599c;};'use strict';var WhatsappInteractionEvents=require(_0x843a('0x0'));var events=[_0x843a('0x1'),_0x843a('0x2'),_0x843a('0x3')];function createListener(_0xc92a1c,_0x41ca30){return function(_0x26f807){_0x41ca30['emit'](_0xc92a1c,_0x26f807);};}function removeListener(_0x347781,_0x7e5d2e){return function(){WhatsappInteractionEvents[_0x843a('0x4')](_0x347781,_0x7e5d2e);};}exports[_0x843a('0x5')]=function(_0x2dfda5){for(var _0x4a18ee=0x0,_0x4712b4=events['length'];_0x4a18ee<_0x4712b4;_0x4a18ee++){var _0x13e729=events[_0x4a18ee];var _0x10788a=createListener(_0x843a('0x6')+_0x13e729,_0x2dfda5);WhatsappInteractionEvents['on'](_0x13e729,_0x10788a);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 3419f2b..d5b7c71 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 _0x7da7=['/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','post','tracked','whatsappmessage:create','create','/:id/status','put'];(function(_0x5161fc,_0x37c5f6){var _0x38490b=function(_0x49ebd8){while(--_0x49ebd8){_0x5161fc['push'](_0x5161fc['shift']());}};_0x38490b(++_0x37c5f6);}(_0x7da7,0x10d));var _0x77da=function(_0x46c1d5,_0x5ca335){_0x46c1d5=_0x46c1d5-0x0;var _0x40fe7b=_0x7da7[_0x46c1d5];return _0x40fe7b;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./whatsappMessage.controller');router[_0x77da('0x7')]('/',auth[_0x77da('0x8')](),controller['index']);router[_0x77da('0x7')]('/describe',auth[_0x77da('0x8')](),controller[_0x77da('0x9')]);router[_0x77da('0x7')](_0x77da('0xa'),auth[_0x77da('0x8')](),controller['show']);router[_0x77da('0xb')]('/',auth[_0x77da('0x8')](),interaction[_0x77da('0xc')]('whatsapp',_0x77da('0xd')),controller[_0x77da('0xe')]);router[_0x77da('0xb')](_0x77da('0xf'),controller['status']);router[_0x77da('0x10')](_0x77da('0xa'),auth[_0x77da('0x8')](),controller['update']);router['put'](_0x77da('0x11'),auth[_0x77da('0x8')](),controller['accept']);router[_0x77da('0x10')](_0x77da('0x12'),auth[_0x77da('0x8')](),controller[_0x77da('0x13')]);router['delete'](_0x77da('0xa'),auth['isAuthenticated'](),controller[_0x77da('0x14')]);module[_0x77da('0x15')]=router; \ No newline at end of file +var _0x3e74=['connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','whatsapp','create','/:id/status','status','update','put','accept','/:id/reject','delete','destroy','multer','path'];(function(_0x249524,_0x2dbc53){var _0x4ae41d=function(_0x5c4ccd){while(--_0x5c4ccd){_0x249524['push'](_0x249524['shift']());}};_0x4ae41d(++_0x2dbc53);}(_0x3e74,0x175));var _0x43e7=function(_0x2ce821,_0x1d76e2){_0x2ce821=_0x2ce821-0x0;var _0x36962d=_0x3e74[_0x2ce821];return _0x36962d;};'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['post']('/',auth['isAuthenticated'](),interaction[_0x43e7('0xe')](_0x43e7('0xf'),'whatsappmessage:create'),controller[_0x43e7('0x10')]);router['post'](_0x43e7('0x11'),controller[_0x43e7('0x12')]);router['put'](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router[_0x43e7('0x14')]('/:id/accept',auth['isAuthenticated'](),controller[_0x43e7('0x15')]);router[_0x43e7('0x14')](_0x43e7('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0x43e7('0x17')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 277507f..33fdd84 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 _0x6dde=['DATE','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x3b118d,_0x36979e){var _0x575ffe=function(_0x5ee544){while(--_0x5ee544){_0x3b118d['push'](_0x3b118d['shift']());}};_0x575ffe(++_0x36979e);}(_0x6dde,0x174));var _0xe6dd=function(_0x11f663,_0x4b37c4){_0x11f663=_0x11f663-0x0;var _0x5e8059=_0x6dde[_0x11f663];return _0x5e8059;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xe6dd('0x0')](_0xe6dd('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xe6dd('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe6dd('0x3')]('in',_0xe6dd('0x4')),'defaultValue':_0xe6dd('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe6dd('0x5')](0xbe)},'phone':{'type':Sequelize[_0xe6dd('0x5')]},'readAt':{'type':Sequelize[_0xe6dd('0x6')]},'secret':{'type':Sequelize[_0xe6dd('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe6dd('0x0')]}}; \ No newline at end of file +var _0xbd9b=['exports','TEXT','medium','out','STRING'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0xbd9b,0xc8));var _0xbbd9=function(_0x55e605,_0x162ddb){_0x55e605=_0x55e605-0x0;var _0x20c0cc=_0xbd9b[_0x55e605];return _0x20c0cc;};'use strict';var Sequelize=require('sequelize');module[_0xbbd9('0x0')]={'body':{'type':Sequelize[_0xbbd9('0x1')](_0xbbd9('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbbd9('0x3')),'defaultValue':_0xbbd9('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xbbd9('0x4')](0xbe)},'phone':{'type':Sequelize[_0xbbd9('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbbd9('0x4')]},'providerResponse':{'type':Sequelize[_0xbbd9('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index b4fe211..263d24b 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 _0x1c7c=['result','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','WhatsappMessage','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','CmContact','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappMessage,\x20%s,\x20%s'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1c7c,0x164));var _0xc1c7=function(_0x45367d,_0x355dec){_0x45367d=_0x45367d-0x0;var _0x296bbc=_0x1c7c[_0x45367d];return _0x296bbc;};'use strict';var emlformat=require(_0xc1c7('0x0'));var rimraf=require(_0xc1c7('0x1'));var zipdir=require(_0xc1c7('0x2'));var jsonpatch=require(_0xc1c7('0x3'));var rp=require('request-promise');var moment=require(_0xc1c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1c7('0x5'));var util=require(_0xc1c7('0x6'));var path=require(_0xc1c7('0x7'));var sox=require(_0xc1c7('0x8'));var csv=require(_0xc1c7('0x9'));var ejs=require(_0xc1c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc1c7('0xb'));var _=require(_0xc1c7('0xc'));var squel=require(_0xc1c7('0xd'));var crypto=require(_0xc1c7('0xe'));var jsforce=require(_0xc1c7('0xf'));var deskjs=require(_0xc1c7('0x10'));var toCsv=require(_0xc1c7('0x9'));var querystring=require(_0xc1c7('0x11'));var Papa=require(_0xc1c7('0x12'));var Redis=require(_0xc1c7('0x13'));var authService=require(_0xc1c7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc1c7('0x15'));var hardwareService=require(_0xc1c7('0x16'));var logger=require('../../config/logger')(_0xc1c7('0x17'));var utils=require(_0xc1c7('0x18'));var config=require(_0xc1c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1c7('0x1a'))['db'];config[_0xc1c7('0x1b')]=_[_0xc1c7('0x1c')](config[_0xc1c7('0x1b')],{'host':_0xc1c7('0x1d'),'port':0x18eb});var socket=require(_0xc1c7('0x1e'))(new Redis(config[_0xc1c7('0x1b')]));require(_0xc1c7('0x1f'))[_0xc1c7('0x20')](socket);var jayson=require(_0xc1c7('0x21'));var client=jayson[_0xc1c7('0x22')][_0xc1c7('0x23')]({'port':0x232c});var client9002=jayson['client'][_0xc1c7('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x335600,_0x21911c,_0x555b59,_0x94678a){return new BPromise(function(_0x3939c1,_0x1446f3){var _0x39ac54=_0x94678a||client;return _0x39ac54[_0xc1c7('0x24')](_0x335600,_0x555b59)[_0xc1c7('0x25')](function(_0x21758a){logger[_0xc1c7('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x21911c,_0xc1c7('0x27'));logger[_0xc1c7('0x28')](_0xc1c7('0x29'),_0x21911c,_0xc1c7('0x27'),JSON['stringify'](_0x21758a));if(_0x21758a[_0xc1c7('0x2a')]){if(_0x21758a['error'][_0xc1c7('0x2b')]===0x1f4){logger[_0xc1c7('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x21911c,_0x21758a['error'][_0xc1c7('0x2c')]);return _0x1446f3(_0x21758a[_0xc1c7('0x2a')][_0xc1c7('0x2c')]);}logger['error'](_0xc1c7('0x2d'),_0x21911c,_0x21758a[_0xc1c7('0x2a')][_0xc1c7('0x2c')]);return _0x3939c1(_0x21758a[_0xc1c7('0x2a')][_0xc1c7('0x2c')]);}else{logger[_0xc1c7('0x26')](_0xc1c7('0x2d'),_0x21911c,_0xc1c7('0x27'));_0x3939c1(_0x21758a[_0xc1c7('0x2e')][_0xc1c7('0x2c')]);}})[_0xc1c7('0x2f')](function(_0x363fbc){logger[_0xc1c7('0x2a')](_0xc1c7('0x2d'),_0x21911c,_0x363fbc);_0x1446f3(_0x363fbc);});});}function respondWithStatusCode(_0xf1c405,_0x21563a){_0x21563a=_0x21563a||0xcc;return function(_0x5edb34){if(_0x5edb34){return _0xf1c405[_0xc1c7('0x30')](_0x21563a);}return _0xf1c405[_0xc1c7('0x31')](_0x21563a)['end']();};}function respondWithResult(_0x52a1d5,_0x352f24){_0x352f24=_0x352f24||0xc8;return function(_0x539931){if(_0x539931){return _0x52a1d5['status'](_0x352f24)[_0xc1c7('0x32')](_0x539931);}};}function respondWithFilteredResult(_0x1b873c,_0x46d045){return function(_0x243450){if(_0x243450){var _0x461360=_0x243450[_0xc1c7('0x33')],_0x4adb81=_0x46d045[_0xc1c7('0x34')],_0x574e1c=_0x46d045[_0xc1c7('0x34')]+_0x46d045[_0xc1c7('0x35')],_0x1b6f97;if(_0x574e1c>=_0x461360){_0x574e1c=_0x461360;_0x1b6f97=0xc8;}else{_0x1b6f97=0xce;}_0x1b873c['status'](_0x1b6f97);return _0x1b873c['set'](_0xc1c7('0x36'),_0x4adb81+'-'+_0x574e1c+'/'+_0x461360)[_0xc1c7('0x32')](_0x243450);}return null;};}function patchUpdates(_0x59170b){return function(_0x41b154){try{jsonpatch[_0xc1c7('0x37')](_0x41b154,_0x59170b,!![]);}catch(_0x39b68c){return BPromise[_0xc1c7('0x38')](_0x39b68c);}return _0x41b154[_0xc1c7('0x39')]();};}function saveUpdates(_0x2d69d3,_0x37533c){return function(_0x598239){if(_0x598239){return _0x598239[_0xc1c7('0x3a')](_0x2d69d3)[_0xc1c7('0x25')](function(_0x21ff91){return _0x21ff91;});}return null;};}function removeEntity(_0x3676ce,_0x712f40){return function(_0x1b713f){if(_0x1b713f){return _0x1b713f[_0xc1c7('0x3b')]()[_0xc1c7('0x25')](function(){_0x3676ce[_0xc1c7('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ba7c1,_0xc58e74){return function(_0x3bd89a){if(!_0x3bd89a){_0x5ba7c1[_0xc1c7('0x30')](0x194);}return _0x3bd89a;};}function handleError(_0x37220f,_0x2a8665){_0x2a8665=_0x2a8665||0x1f4;return function(_0x26f498){logger[_0xc1c7('0x2a')](_0x26f498[_0xc1c7('0x3c')]);if(_0x26f498[_0xc1c7('0x3d')]){delete _0x26f498[_0xc1c7('0x3d')];}_0x37220f[_0xc1c7('0x31')](_0x2a8665)[_0xc1c7('0x3e')](_0x26f498);};}exports[_0xc1c7('0x3f')]=function(_0x3c57d3,_0x43c8c1){var _0x11ce7f={},_0x41a847={},_0x3e4282={'count':0x0,'rows':[]};var _0x2f9e9a=_[_0xc1c7('0x40')](db[_0xc1c7('0x41')]['rawAttributes'],function(_0x568809){return{'name':_0x568809['fieldName'],'type':_0x568809[_0xc1c7('0x42')]['key']};});_0x41a847['model']=_[_0xc1c7('0x40')](_0x2f9e9a,_0xc1c7('0x3d'));_0x41a847[_0xc1c7('0x43')]=_[_0xc1c7('0x44')](_0x3c57d3['query']);_0x41a847[_0xc1c7('0x45')]=_[_0xc1c7('0x46')](_0x41a847[_0xc1c7('0x47')],_0x41a847[_0xc1c7('0x43')]);_0x11ce7f[_0xc1c7('0x48')]=_[_0xc1c7('0x46')](_0x41a847[_0xc1c7('0x47')],qs[_0xc1c7('0x49')](_0x3c57d3[_0xc1c7('0x43')][_0xc1c7('0x49')]));_0x11ce7f[_0xc1c7('0x48')]=_0x11ce7f[_0xc1c7('0x48')][_0xc1c7('0x4a')]?_0x11ce7f['attributes']:_0x41a847[_0xc1c7('0x47')];if(!_0x3c57d3[_0xc1c7('0x43')]['hasOwnProperty'](_0xc1c7('0x4b'))){_0x11ce7f[_0xc1c7('0x35')]=qs[_0xc1c7('0x35')](_0x3c57d3[_0xc1c7('0x43')][_0xc1c7('0x35')]);_0x11ce7f[_0xc1c7('0x34')]=qs[_0xc1c7('0x34')](_0x3c57d3[_0xc1c7('0x43')][_0xc1c7('0x34')]);}_0x11ce7f[_0xc1c7('0x4c')]=qs['sort'](_0x3c57d3[_0xc1c7('0x43')][_0xc1c7('0x4d')]);_0x11ce7f['where']=qs['filters'](_[_0xc1c7('0x4e')](_0x3c57d3[_0xc1c7('0x43')],_0x41a847[_0xc1c7('0x45')]),_0x2f9e9a);if(_0x3c57d3[_0xc1c7('0x43')][_0xc1c7('0x4f')]){_0x11ce7f['where']=_[_0xc1c7('0x50')](_0x11ce7f[_0xc1c7('0x51')],{'$or':_['map'](_0x2f9e9a,function(_0x4fccbf){if(_0x4fccbf['type']!==_0xc1c7('0x52')){var _0x1a9247={};_0x1a9247[_0x4fccbf[_0xc1c7('0x3d')]]={'$like':'%'+_0x3c57d3['query'][_0xc1c7('0x4f')]+'%'};return _0x1a9247;}})});}_0x11ce7f=_[_0xc1c7('0x50')]({},_0x11ce7f,_0x3c57d3['options']);var _0x1b869d={'where':_0x11ce7f[_0xc1c7('0x51')]};return db[_0xc1c7('0x41')][_0xc1c7('0x33')](_0x1b869d)[_0xc1c7('0x25')](function(_0x45bf42){_0x3e4282[_0xc1c7('0x33')]=_0x45bf42;if(_0x3c57d3[_0xc1c7('0x43')][_0xc1c7('0x53')]){_0x11ce7f[_0xc1c7('0x54')]=[{'all':!![]}];}return db[_0xc1c7('0x41')][_0xc1c7('0x55')](_0x11ce7f);})[_0xc1c7('0x25')](function(_0x2ede54){_0x3e4282[_0xc1c7('0x56')]=_0x2ede54;return _0x3e4282;})[_0xc1c7('0x25')](respondWithFilteredResult(_0x43c8c1,_0x11ce7f))[_0xc1c7('0x2f')](handleError(_0x43c8c1,null));};exports[_0xc1c7('0x57')]=function(_0x5da115,_0x42926d){var _0x5b0317={'raw':!![],'where':{'id':_0x5da115[_0xc1c7('0x58')]['id']}},_0x14493b={};_0x14493b[_0xc1c7('0x47')]=_['keys'](db[_0xc1c7('0x41')][_0xc1c7('0x59')]);_0x14493b['query']=_['keys'](_0x5da115['query']);_0x14493b[_0xc1c7('0x45')]=_[_0xc1c7('0x46')](_0x14493b['model'],_0x14493b[_0xc1c7('0x43')]);_0x5b0317[_0xc1c7('0x48')]=_[_0xc1c7('0x46')](_0x14493b[_0xc1c7('0x47')],qs[_0xc1c7('0x49')](_0x5da115[_0xc1c7('0x43')]['fields']));_0x5b0317[_0xc1c7('0x48')]=_0x5b0317['attributes'][_0xc1c7('0x4a')]?_0x5b0317[_0xc1c7('0x48')]:_0x14493b[_0xc1c7('0x47')];if(_0x5da115['query'][_0xc1c7('0x53')]){_0x5b0317[_0xc1c7('0x54')]=[{'all':!![]}];}_0x5b0317=_[_0xc1c7('0x50')]({},_0x5b0317,_0x5da115[_0xc1c7('0x5a')]);return db[_0xc1c7('0x41')][_0xc1c7('0x5b')](_0x5b0317)[_0xc1c7('0x25')](handleEntityNotFound(_0x42926d,null))[_0xc1c7('0x25')](respondWithResult(_0x42926d,null))['catch'](handleError(_0x42926d,null));};exports[_0xc1c7('0x5c')]=function(_0x2a8664,_0x2448e8){return db['WhatsappMessage']['create'](_0x2a8664[_0xc1c7('0x5d')],{})[_0xc1c7('0x25')](respondWithResult(_0x2448e8,0xc9))[_0xc1c7('0x2f')](handleError(_0x2448e8,null));};exports['update']=function(_0x1c636c,_0x48304a){if(_0x1c636c[_0xc1c7('0x5d')]['id']){delete _0x1c636c[_0xc1c7('0x5d')]['id'];}return db[_0xc1c7('0x41')][_0xc1c7('0x5b')]({'where':{'id':_0x1c636c[_0xc1c7('0x58')]['id']}})[_0xc1c7('0x25')](handleEntityNotFound(_0x48304a,null))[_0xc1c7('0x25')](saveUpdates(_0x1c636c['body'],null))[_0xc1c7('0x25')](respondWithResult(_0x48304a,null))[_0xc1c7('0x2f')](handleError(_0x48304a,null));};exports[_0xc1c7('0x3b')]=function(_0x526117,_0x24fa71){return db['WhatsappMessage'][_0xc1c7('0x5b')]({'where':{'id':_0x526117['params']['id']}})[_0xc1c7('0x25')](handleEntityNotFound(_0x24fa71,null))[_0xc1c7('0x25')](removeEntity(_0x24fa71,null))[_0xc1c7('0x2f')](handleError(_0x24fa71,null));};exports[_0xc1c7('0x5e')]=function(_0x156d51,_0x54e2c4){return db['WhatsappMessage']['describe']()[_0xc1c7('0x25')](respondWithResult(_0x54e2c4,null))[_0xc1c7('0x2f')](handleError(_0x54e2c4,null));};var interaction_log=require(_0xc1c7('0x5f'))(_0xc1c7('0x60'));exports[_0xc1c7('0x61')]=function(_0x33731c,_0x4d8805,_0x19b8d7){var _0xe5882={'agent':{},'channel':_0xc1c7('0x62')};if(_0x33731c[_0xc1c7('0x5d')]['id']){delete _0x33731c['body']['id'];}_0x33731c[_0xc1c7('0x5d')][_0xc1c7('0x63')]=!![];_0x33731c[_0xc1c7('0x5d')]['readAt']=moment()[_0xc1c7('0x64')](_0xc1c7('0x65'));_0x33731c[_0xc1c7('0x5d')][_0xc1c7('0x66')]=_0x33731c['body']['UserId']||_0x33731c[_0xc1c7('0x67')]['id'];_0xe5882[_0xc1c7('0x68')]['id']=_0x33731c['body'][_0xc1c7('0x66')];return db[_0xc1c7('0x41')]['find']({'where':{'id':_0x33731c[_0xc1c7('0x58')]['id'],'UserId':null},'include':[{'model':db[_0xc1c7('0x69')],'as':'Contact'}]})[_0xc1c7('0x25')](handleEntityNotFound(_0x4d8805,null))[_0xc1c7('0x25')](saveUpdates(_0x33731c[_0xc1c7('0x5d')],null))[_0xc1c7('0x25')](function(_0x1087b2){if(_0x1087b2){_0xe5882[_0xc1c7('0x2c')]=_0x1087b2[_0xc1c7('0x6a')]({'plain':!![]});return db[_0xc1c7('0x6b')][_0xc1c7('0x5b')]({'where':{'id':_0x1087b2[_0xc1c7('0x6c')]}});}return null;})[_0xc1c7('0x25')](handleEntityNotFound(_0x4d8805,null))[_0xc1c7('0x25')](function(_0x206afd){if(_0x206afd){return _0x206afd[_0xc1c7('0x3a')]({'UserId':_0x33731c[_0xc1c7('0x5d')][_0xc1c7('0x66')],'read1stAt':_[_0xc1c7('0x6d')](_0x206afd[_0xc1c7('0x6e')])?moment()[_0xc1c7('0x64')](_0xc1c7('0x65')):undefined});}return null;})[_0xc1c7('0x25')](function(_0x31bb3c){if(_0x31bb3c){_0xe5882[_0xc1c7('0x6f')]=_0x31bb3c[_0xc1c7('0x6a')]({'plain':!![]});interaction_log[_0xc1c7('0x26')](_0xc1c7('0x70'),_0x33731c[_0xc1c7('0x67')]['id'],_0x33731c[_0xc1c7('0x67')]['name'],_0x33731c[_0xc1c7('0x67')][_0xc1c7('0x71')],_0xe5882[_0xc1c7('0x6f')]['id'],_0x33731c[_0xc1c7('0x5d')]?JSON[_0xc1c7('0x72')](_0x33731c[_0xc1c7('0x5d')]):_0xc1c7('0x73'));return respondWithRpcPromise(_0xc1c7('0x74'),'acceptMessage',_0xe5882);}return null;})[_0xc1c7('0x25')](function(_0x20cd61){if(_0x20cd61){if(_0x33731c[_0xc1c7('0x5d')][_0xc1c7('0x75')]){_0xe5882[_0xc1c7('0x2c')][_0xc1c7('0x76')]=util[_0xc1c7('0x64')](_0xc1c7('0x77'),_0x33731c['user'][_0xc1c7('0x3d')]);_0xe5882[_0xc1c7('0x2c')][_0xc1c7('0x78')]=_0xe5882[_0xc1c7('0x78')];_0xe5882[_0xc1c7('0x2c')][_0xc1c7('0x79')]=_0xc1c7('0x61');return respondWithRpcPromise(_0xc1c7('0x7a'),_0xc1c7('0x7a'),{'event':_0xc1c7('0x7b'),'message':_0xe5882[_0xc1c7('0x2c')]},client9002)[_0xc1c7('0x25')](function(){return _0xe5882;});}return _0xe5882;}return null;})['then'](respondWithResult(_0x4d8805,null))['catch'](handleError(_0x4d8805,null));};var interaction_log=require(_0xc1c7('0x5f'))(_0xc1c7('0x60'));exports[_0xc1c7('0x38')]=function(_0x11fd01,_0x44a24b,_0x258dc5){var _0x3af6cd={'agent':{},'channel':_0xc1c7('0x62')};if(_0x11fd01[_0xc1c7('0x5d')]['id']){delete _0x11fd01[_0xc1c7('0x5d')]['id'];}_0x11fd01[_0xc1c7('0x5d')][_0xc1c7('0x66')]=_0x11fd01[_0xc1c7('0x5d')]['UserId']||_0x11fd01[_0xc1c7('0x67')]['id'];_0x3af6cd[_0xc1c7('0x68')]['id']=_0x11fd01[_0xc1c7('0x5d')]['UserId'];return db['WhatsappMessage']['find']({'where':{'id':_0x11fd01[_0xc1c7('0x58')]['id'],'UserId':null}})[_0xc1c7('0x25')](handleEntityNotFound(_0x44a24b,null))['then'](function(_0x1f2940){if(_0x1f2940){_0x3af6cd[_0xc1c7('0x2c')]=_0x1f2940['get']({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x1f2940[_0xc1c7('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x44a24b,null))[_0xc1c7('0x25')](function(_0x3bc3aa){if(_0x3bc3aa){_0x3af6cd[_0xc1c7('0x6f')]=_0x3bc3aa['get']({'plain':!![]});interaction_log[_0xc1c7('0x26')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x11fd01[_0xc1c7('0x67')]['id'],_0x11fd01[_0xc1c7('0x67')]['name'],_0x11fd01[_0xc1c7('0x67')][_0xc1c7('0x71')],_0x3af6cd[_0xc1c7('0x6f')]['id'],_0x11fd01[_0xc1c7('0x5d')]?JSON[_0xc1c7('0x72')](_0x11fd01[_0xc1c7('0x5d')]):_0xc1c7('0x73'));return respondWithRpcPromise(_0xc1c7('0x7c'),_0xc1c7('0x7d'),_0x3af6cd);}return null;})[_0xc1c7('0x25')](function(_0x4bb9bc){if(_0x4bb9bc){_0x4bb9bc[_0xc1c7('0x2c')][_0xc1c7('0x76')]=util[_0xc1c7('0x64')](_0xc1c7('0x77'),_0x11fd01['user'][_0xc1c7('0x3d')]);_0x4bb9bc[_0xc1c7('0x2c')]['channel']=_0x3af6cd['channel'];_0x4bb9bc[_0xc1c7('0x2c')][_0xc1c7('0x79')]=_0xc1c7('0x38');respondWithRpcPromise(_0xc1c7('0x7a'),_0xc1c7('0x7a'),{'event':_0xc1c7('0x7e'),'message':_0x4bb9bc['message']},client9002);return _0x3af6cd;}return null;})[_0xc1c7('0x25')](respondWithResult(_0x44a24b,null))[_0xc1c7('0x2f')](handleError(_0x44a24b,null));};exports['status']=function(_0x65161e,_0x32c26e,_0x327d89){if(_0x65161e[_0xc1c7('0x5d')]['id']){delete _0x65161e[_0xc1c7('0x5d')]['id'];}var _0x2528f3;return db[_0xc1c7('0x41')][_0xc1c7('0x5b')]({'where':{'id':_0x65161e[_0xc1c7('0x58')]['id']}})[_0xc1c7('0x25')](handleEntityNotFound(_0x32c26e,null))[_0xc1c7('0x25')](function(_0x42863c){if(_0x42863c){_0x2528f3=_0x42863c;return db[_0xc1c7('0x7f')][_0xc1c7('0x5b')]({'where':{'id':_0x42863c['WhatsappAccountId']}});}})[_0xc1c7('0x25')](handleEntityNotFound(_0x32c26e,null))[_0xc1c7('0x25')](function(_0x3a4265){if(_0x3a4265){logger[_0xc1c7('0x28')](_0xc1c7('0x80'),_0xc1c7('0x31'),'received\x20delivery\x20report\x20from',_0x3a4265[_0xc1c7('0x42')],util[_0xc1c7('0x81')](_0x65161e['body'],{'showHidden':![],'depth':null}));switch(_0x3a4265['type']){case _0xc1c7('0x82'):if(_0x65161e[_0xc1c7('0x5d')][_0xc1c7('0x83')]&&_0x65161e[_0xc1c7('0x5d')][_0xc1c7('0x83')]===_0x2528f3[_0xc1c7('0x84')]&&_0x65161e['body'][_0xc1c7('0x85')]&&_0x65161e[_0xc1c7('0x5d')][_0xc1c7('0x85')]===_0xc1c7('0x63')){return _0x2528f3['update']({'read':!![]});}else{logger[_0xc1c7('0x2a')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xc1c7('0x31'),'twilio',util[_0xc1c7('0x81')](_0x65161e[_0xc1c7('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x2528f3;}})['then'](respondWithResult(_0x32c26e,null))[_0xc1c7('0x2f')](handleError(_0x32c26e,null));}; \ No newline at end of file +var _0x8603=['merge','VIRTUAL','include','findAll','rows','params','options','find','create','body','update','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','agent','CmContact','Contact','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','user','role','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','null','rejectmessage','WhatsappAccountId','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','count','offset','limit','set','json','reject','save','destroy','name','send','WhatsappMessage','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','nolimit','sort','pick','filter','where'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x8603,0x190));var _0x3860=function(_0x456551,_0x4c9050){_0x456551=_0x456551-0x0;var _0x1af692=_0x8603[_0x456551];return _0x1af692;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];config[_0x3860('0x15')]=_[_0x3860('0x16')](config[_0x3860('0x15')],{'host':_0x3860('0x17'),'port':0x18eb});var socket=require(_0x3860('0x18'))(new Redis(config[_0x3860('0x15')]));require(_0x3860('0x19'))[_0x3860('0x1a')](socket);var jayson=require(_0x3860('0x1b'));var client=jayson['client'][_0x3860('0x1c')]({'port':0x232c});var client9002=jayson[_0x3860('0x1d')][_0x3860('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x37d9ab,_0x1055b3,_0xfa0c9a,_0x2d8a3a){return new BPromise(function(_0x378305,_0x311fdb){var _0x3c0d91=_0x2d8a3a||client;return _0x3c0d91[_0x3860('0x1e')](_0x37d9ab,_0xfa0c9a)[_0x3860('0x1f')](function(_0x4b6b15){logger['info'](_0x3860('0x20'),_0x1055b3,_0x3860('0x21'));logger[_0x3860('0x22')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1055b3,_0x3860('0x21'),JSON[_0x3860('0x23')](_0x4b6b15));if(_0x4b6b15[_0x3860('0x24')]){if(_0x4b6b15[_0x3860('0x24')][_0x3860('0x25')]===0x1f4){logger[_0x3860('0x24')](_0x3860('0x20'),_0x1055b3,_0x4b6b15[_0x3860('0x24')][_0x3860('0x26')]);return _0x311fdb(_0x4b6b15[_0x3860('0x24')][_0x3860('0x26')]);}logger[_0x3860('0x24')](_0x3860('0x20'),_0x1055b3,_0x4b6b15[_0x3860('0x24')][_0x3860('0x26')]);return _0x378305(_0x4b6b15['error'][_0x3860('0x26')]);}else{logger[_0x3860('0x27')](_0x3860('0x20'),_0x1055b3,_0x3860('0x21'));_0x378305(_0x4b6b15[_0x3860('0x28')]['message']);}})[_0x3860('0x29')](function(_0x568515){logger['error'](_0x3860('0x20'),_0x1055b3,_0x568515);_0x311fdb(_0x568515);});});}function respondWithStatusCode(_0x1c4bbc,_0x54b5ec){_0x54b5ec=_0x54b5ec||0xcc;return function(_0x4d9a90){if(_0x4d9a90){return _0x1c4bbc['sendStatus'](_0x54b5ec);}return _0x1c4bbc[_0x3860('0x2a')](_0x54b5ec)[_0x3860('0x2b')]();};}function respondWithResult(_0xb25cc2,_0x371f3a){_0x371f3a=_0x371f3a||0xc8;return function(_0x9332a5){if(_0x9332a5){return _0xb25cc2[_0x3860('0x2a')](_0x371f3a)['json'](_0x9332a5);}};}function respondWithFilteredResult(_0x4c4314,_0x389bd0){return function(_0x1f1809){if(_0x1f1809){var _0x5a9af2=_0x1f1809[_0x3860('0x2c')],_0x2551f4=_0x389bd0[_0x3860('0x2d')],_0x3d5143=_0x389bd0['offset']+_0x389bd0[_0x3860('0x2e')],_0x10d9e4;if(_0x3d5143>=_0x5a9af2){_0x3d5143=_0x5a9af2;_0x10d9e4=0xc8;}else{_0x10d9e4=0xce;}_0x4c4314[_0x3860('0x2a')](_0x10d9e4);return _0x4c4314[_0x3860('0x2f')]('Content-Range',_0x2551f4+'-'+_0x3d5143+'/'+_0x5a9af2)[_0x3860('0x30')](_0x1f1809);}return null;};}function patchUpdates(_0x5e25ce){return function(_0x294b3a){try{jsonpatch['apply'](_0x294b3a,_0x5e25ce,!![]);}catch(_0x1c498c){return BPromise[_0x3860('0x31')](_0x1c498c);}return _0x294b3a[_0x3860('0x32')]();};}function saveUpdates(_0x47e350,_0x39c751){return function(_0x451b0c){if(_0x451b0c){return _0x451b0c['update'](_0x47e350)[_0x3860('0x1f')](function(_0x5a54a6){return _0x5a54a6;});}return null;};}function removeEntity(_0x2c0bf3,_0x3a577a){return function(_0x35185c){if(_0x35185c){return _0x35185c[_0x3860('0x33')]()[_0x3860('0x1f')](function(){_0x2c0bf3[_0x3860('0x2a')](0xcc)[_0x3860('0x2b')]();});}};}function handleEntityNotFound(_0x4d30bc,_0x1a48b6){return function(_0x396ccf){if(!_0x396ccf){_0x4d30bc['sendStatus'](0x194);}return _0x396ccf;};}function handleError(_0x2a6aa4,_0x398525){_0x398525=_0x398525||0x1f4;return function(_0x3a17ea){logger['error'](_0x3a17ea['stack']);if(_0x3a17ea[_0x3860('0x34')]){delete _0x3a17ea[_0x3860('0x34')];}_0x2a6aa4[_0x3860('0x2a')](_0x398525)[_0x3860('0x35')](_0x3a17ea);};}exports['index']=function(_0x4d6b1c,_0x3ad0aa){var _0x40dae8={},_0xc715a0={},_0x1fa847={'count':0x0,'rows':[]};var _0x42f219=_['map'](db[_0x3860('0x36')][_0x3860('0x37')],function(_0x5a7b5b){return{'name':_0x5a7b5b['fieldName'],'type':_0x5a7b5b[_0x3860('0x38')][_0x3860('0x39')]};});_0xc715a0[_0x3860('0x3a')]=_[_0x3860('0x3b')](_0x42f219,_0x3860('0x34'));_0xc715a0['query']=_[_0x3860('0x3c')](_0x4d6b1c['query']);_0xc715a0[_0x3860('0x3d')]=_[_0x3860('0x3e')](_0xc715a0['model'],_0xc715a0[_0x3860('0x3f')]);_0x40dae8[_0x3860('0x40')]=_['intersection'](_0xc715a0[_0x3860('0x3a')],qs[_0x3860('0x41')](_0x4d6b1c[_0x3860('0x3f')][_0x3860('0x41')]));_0x40dae8['attributes']=_0x40dae8[_0x3860('0x40')][_0x3860('0x42')]?_0x40dae8[_0x3860('0x40')]:_0xc715a0['model'];if(!_0x4d6b1c[_0x3860('0x3f')]['hasOwnProperty'](_0x3860('0x43'))){_0x40dae8[_0x3860('0x2e')]=qs[_0x3860('0x2e')](_0x4d6b1c[_0x3860('0x3f')][_0x3860('0x2e')]);_0x40dae8[_0x3860('0x2d')]=qs['offset'](_0x4d6b1c[_0x3860('0x3f')][_0x3860('0x2d')]);}_0x40dae8['order']=qs['sort'](_0x4d6b1c[_0x3860('0x3f')][_0x3860('0x44')]);_0x40dae8['where']=qs[_0x3860('0x3d')](_[_0x3860('0x45')](_0x4d6b1c['query'],_0xc715a0[_0x3860('0x3d')]),_0x42f219);if(_0x4d6b1c[_0x3860('0x3f')][_0x3860('0x46')]){_0x40dae8[_0x3860('0x47')]=_[_0x3860('0x48')](_0x40dae8[_0x3860('0x47')],{'$or':_[_0x3860('0x3b')](_0x42f219,function(_0x15ebbd){if(_0x15ebbd[_0x3860('0x38')]!==_0x3860('0x49')){var _0x1991ca={};_0x1991ca[_0x15ebbd[_0x3860('0x34')]]={'$like':'%'+_0x4d6b1c[_0x3860('0x3f')]['filter']+'%'};return _0x1991ca;}})});}_0x40dae8=_[_0x3860('0x48')]({},_0x40dae8,_0x4d6b1c['options']);var _0xd14a={'where':_0x40dae8[_0x3860('0x47')]};return db[_0x3860('0x36')][_0x3860('0x2c')](_0xd14a)[_0x3860('0x1f')](function(_0x36d469){_0x1fa847[_0x3860('0x2c')]=_0x36d469;if(_0x4d6b1c[_0x3860('0x3f')]['includeAll']){_0x40dae8[_0x3860('0x4a')]=[{'all':!![]}];}return db[_0x3860('0x36')][_0x3860('0x4b')](_0x40dae8);})['then'](function(_0x9b8ab0){_0x1fa847[_0x3860('0x4c')]=_0x9b8ab0;return _0x1fa847;})[_0x3860('0x1f')](respondWithFilteredResult(_0x3ad0aa,_0x40dae8))[_0x3860('0x29')](handleError(_0x3ad0aa,null));};exports['show']=function(_0x5bb2d1,_0x228538){var _0x480a08={'raw':!![],'where':{'id':_0x5bb2d1[_0x3860('0x4d')]['id']}},_0x38f526={};_0x38f526[_0x3860('0x3a')]=_['keys'](db[_0x3860('0x36')]['rawAttributes']);_0x38f526[_0x3860('0x3f')]=_['keys'](_0x5bb2d1[_0x3860('0x3f')]);_0x38f526[_0x3860('0x3d')]=_[_0x3860('0x3e')](_0x38f526['model'],_0x38f526['query']);_0x480a08[_0x3860('0x40')]=_[_0x3860('0x3e')](_0x38f526['model'],qs[_0x3860('0x41')](_0x5bb2d1['query'][_0x3860('0x41')]));_0x480a08[_0x3860('0x40')]=_0x480a08[_0x3860('0x40')][_0x3860('0x42')]?_0x480a08[_0x3860('0x40')]:_0x38f526[_0x3860('0x3a')];if(_0x5bb2d1[_0x3860('0x3f')]['includeAll']){_0x480a08[_0x3860('0x4a')]=[{'all':!![]}];}_0x480a08=_[_0x3860('0x48')]({},_0x480a08,_0x5bb2d1[_0x3860('0x4e')]);return db[_0x3860('0x36')][_0x3860('0x4f')](_0x480a08)[_0x3860('0x1f')](handleEntityNotFound(_0x228538,null))['then'](respondWithResult(_0x228538,null))[_0x3860('0x29')](handleError(_0x228538,null));};exports[_0x3860('0x50')]=function(_0x19a26d,_0x31f2af){return db[_0x3860('0x36')][_0x3860('0x50')](_0x19a26d[_0x3860('0x51')],{})[_0x3860('0x1f')](respondWithResult(_0x31f2af,0xc9))['catch'](handleError(_0x31f2af,null));};exports[_0x3860('0x52')]=function(_0x2ff0bf,_0x53a669){if(_0x2ff0bf[_0x3860('0x51')]['id']){delete _0x2ff0bf[_0x3860('0x51')]['id'];}return db[_0x3860('0x36')]['find']({'where':{'id':_0x2ff0bf[_0x3860('0x4d')]['id']}})['then'](handleEntityNotFound(_0x53a669,null))[_0x3860('0x1f')](saveUpdates(_0x2ff0bf[_0x3860('0x51')],null))[_0x3860('0x1f')](respondWithResult(_0x53a669,null))[_0x3860('0x29')](handleError(_0x53a669,null));};exports[_0x3860('0x33')]=function(_0x1cee19,_0x1a4f58){return db[_0x3860('0x36')][_0x3860('0x4f')]({'where':{'id':_0x1cee19[_0x3860('0x4d')]['id']}})[_0x3860('0x1f')](handleEntityNotFound(_0x1a4f58,null))[_0x3860('0x1f')](removeEntity(_0x1a4f58,null))['catch'](handleError(_0x1a4f58,null));};exports['describe']=function(_0x5111e0,_0x5fbea0){return db['WhatsappMessage']['describe']()[_0x3860('0x1f')](respondWithResult(_0x5fbea0,null))[_0x3860('0x29')](handleError(_0x5fbea0,null));};var interaction_log=require(_0x3860('0x11'))(_0x3860('0x53'));exports[_0x3860('0x54')]=function(_0x2e5cf0,_0x509c97,_0x49ec68){var _0x4df47b={'agent':{},'channel':_0x3860('0x55')};if(_0x2e5cf0[_0x3860('0x51')]['id']){delete _0x2e5cf0[_0x3860('0x51')]['id'];}_0x2e5cf0['body'][_0x3860('0x56')]=!![];_0x2e5cf0['body'][_0x3860('0x57')]=moment()[_0x3860('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x2e5cf0[_0x3860('0x51')][_0x3860('0x59')]=_0x2e5cf0[_0x3860('0x51')][_0x3860('0x59')]||_0x2e5cf0['user']['id'];_0x4df47b[_0x3860('0x5a')]['id']=_0x2e5cf0[_0x3860('0x51')][_0x3860('0x59')];return db['WhatsappMessage']['find']({'where':{'id':_0x2e5cf0[_0x3860('0x4d')]['id'],'UserId':null},'include':[{'model':db[_0x3860('0x5b')],'as':_0x3860('0x5c')}]})[_0x3860('0x1f')](handleEntityNotFound(_0x509c97,null))[_0x3860('0x1f')](saveUpdates(_0x2e5cf0[_0x3860('0x51')],null))['then'](function(_0x2d916a){if(_0x2d916a){_0x4df47b[_0x3860('0x26')]=_0x2d916a['get']({'plain':!![]});return db[_0x3860('0x5d')][_0x3860('0x4f')]({'where':{'id':_0x2d916a[_0x3860('0x5e')]}});}return null;})[_0x3860('0x1f')](handleEntityNotFound(_0x509c97,null))[_0x3860('0x1f')](function(_0x2ee555){if(_0x2ee555){return _0x2ee555['update']({'UserId':_0x2e5cf0[_0x3860('0x51')][_0x3860('0x59')],'read1stAt':_[_0x3860('0x5f')](_0x2ee555[_0x3860('0x60')])?moment()[_0x3860('0x58')](_0x3860('0x61')):undefined});}return null;})['then'](function(_0x1ae31b){if(_0x1ae31b){_0x4df47b[_0x3860('0x62')]=_0x1ae31b[_0x3860('0x63')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e5cf0[_0x3860('0x64')]['id'],_0x2e5cf0[_0x3860('0x64')][_0x3860('0x34')],_0x2e5cf0[_0x3860('0x64')][_0x3860('0x65')],_0x4df47b['interaction']['id'],_0x2e5cf0['body']?JSON[_0x3860('0x23')](_0x2e5cf0[_0x3860('0x51')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3860('0x66'),_0x4df47b);}return null;})[_0x3860('0x1f')](function(_0x4ca6de){if(_0x4ca6de){if(_0x2e5cf0[_0x3860('0x51')][_0x3860('0x67')]){_0x4df47b[_0x3860('0x26')][_0x3860('0x68')]=util['format'](_0x3860('0x69'),_0x2e5cf0[_0x3860('0x64')]['name']);_0x4df47b['message'][_0x3860('0x6a')]=_0x4df47b[_0x3860('0x6a')];_0x4df47b['message'][_0x3860('0x6b')]='accept';return respondWithRpcPromise(_0x3860('0x6c'),'EventManager',{'event':'acceptmessage','message':_0x4df47b[_0x3860('0x26')]},client9002)['then'](function(){return _0x4df47b;});}return _0x4df47b;}return null;})[_0x3860('0x1f')](respondWithResult(_0x509c97,null))[_0x3860('0x29')](handleError(_0x509c97,null));};var interaction_log=require(_0x3860('0x11'))(_0x3860('0x53'));exports[_0x3860('0x31')]=function(_0x43c5a1,_0x4b3447,_0x3756b3){var _0x297321={'agent':{},'channel':_0x3860('0x55')};if(_0x43c5a1['body']['id']){delete _0x43c5a1[_0x3860('0x51')]['id'];}_0x43c5a1['body'][_0x3860('0x59')]=_0x43c5a1[_0x3860('0x51')]['UserId']||_0x43c5a1[_0x3860('0x64')]['id'];_0x297321[_0x3860('0x5a')]['id']=_0x43c5a1[_0x3860('0x51')]['UserId'];return db['WhatsappMessage']['find']({'where':{'id':_0x43c5a1['params']['id'],'UserId':null}})[_0x3860('0x1f')](handleEntityNotFound(_0x4b3447,null))[_0x3860('0x1f')](function(_0x3f8b7c){if(_0x3f8b7c){_0x297321[_0x3860('0x26')]=_0x3f8b7c['get']({'plain':!![]});return db['WhatsappInteraction'][_0x3860('0x4f')]({'where':{'id':_0x3f8b7c[_0x3860('0x5e')]}});}return null;})[_0x3860('0x1f')](handleEntityNotFound(_0x4b3447,null))[_0x3860('0x1f')](function(_0x4b0652){if(_0x4b0652){_0x297321[_0x3860('0x62')]=_0x4b0652[_0x3860('0x63')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43c5a1[_0x3860('0x64')]['id'],_0x43c5a1[_0x3860('0x64')][_0x3860('0x34')],_0x43c5a1[_0x3860('0x64')]['role'],_0x297321['interaction']['id'],_0x43c5a1[_0x3860('0x51')]?JSON['stringify'](_0x43c5a1[_0x3860('0x51')]):_0x3860('0x6d'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x297321);}return null;})['then'](function(_0x2d6eab){if(_0x2d6eab){_0x2d6eab[_0x3860('0x26')]['interface']=util[_0x3860('0x58')](_0x3860('0x69'),_0x43c5a1[_0x3860('0x64')][_0x3860('0x34')]);_0x2d6eab[_0x3860('0x26')]['channel']=_0x297321[_0x3860('0x6a')];_0x2d6eab[_0x3860('0x26')][_0x3860('0x6b')]=_0x3860('0x31');respondWithRpcPromise(_0x3860('0x6c'),'EventManager',{'event':_0x3860('0x6e'),'message':_0x2d6eab[_0x3860('0x26')]},client9002);return _0x297321;}return null;})[_0x3860('0x1f')](respondWithResult(_0x4b3447,null))[_0x3860('0x29')](handleError(_0x4b3447,null));};exports[_0x3860('0x2a')]=function(_0x543c98,_0x532370,_0x196c50){if(_0x543c98[_0x3860('0x51')]['id']){delete _0x543c98[_0x3860('0x51')]['id'];}var _0xf950d8;return db[_0x3860('0x36')][_0x3860('0x4f')]({'where':{'id':_0x543c98[_0x3860('0x4d')]['id']}})['then'](handleEntityNotFound(_0x532370,null))[_0x3860('0x1f')](function(_0x3eb292){if(_0x3eb292){_0xf950d8=_0x3eb292;return db['WhatsappAccount'][_0x3860('0x4f')]({'where':{'id':_0x3eb292[_0x3860('0x6f')]}});}})[_0x3860('0x1f')](handleEntityNotFound(_0x532370,null))['then'](function(_0x475a1d){if(_0x475a1d){logger[_0x3860('0x22')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x3860('0x2a'),'received\x20delivery\x20report\x20from',_0x475a1d[_0x3860('0x38')],util[_0x3860('0x70')](_0x543c98['body'],{'showHidden':![],'depth':null}));switch(_0x475a1d[_0x3860('0x38')]){case _0x3860('0x71'):if(_0x543c98[_0x3860('0x51')][_0x3860('0x72')]&&_0x543c98[_0x3860('0x51')]['MessageSid']===_0xf950d8[_0x3860('0x73')]&&_0x543c98[_0x3860('0x51')][_0x3860('0x74')]&&_0x543c98[_0x3860('0x51')][_0x3860('0x74')]==='read'){return _0xf950d8['update']({'read':!![]});}else{logger[_0x3860('0x24')](_0x3860('0x75'),'status',_0x3860('0x71'),util[_0x3860('0x70')](_0x543c98[_0x3860('0x51')],{'showHidden':![],'depth':null}));}break;}return _0xf950d8;}})[_0x3860('0x1f')](respondWithResult(_0x532370,null))['catch'](handleError(_0x532370,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 4325ca0..7d0c707 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 _0xb10b=['hasOwnProperty','hook','events','WhatsappMessage','setMaxListeners','save','remove','emit'];(function(_0x41a4be,_0x113c0b){var _0x1085b3=function(_0x10dd10){while(--_0x10dd10){_0x41a4be['push'](_0x41a4be['shift']());}};_0x1085b3(++_0x113c0b);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0xb10b[_0x4b7b69];return _0x173b4c;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xbb10('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){WhatsappMessageEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);WhatsappMessageEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];WhatsappMessage[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','WhatsappMessage','setMaxListeners','save','remove','emit'];(function(_0x447c4a,_0x5ea4cc){var _0x293b64=function(_0xb0f788){while(--_0xb0f788){_0x447c4a['push'](_0x447c4a['shift']());}};_0x293b64(++_0x5ea4cc);}(_0xb10b,0x12a));var _0xbb10=function(_0x26aafa,_0x100c92){_0x26aafa=_0x26aafa-0x0;var _0x13b20e=_0xb10b[_0x26aafa];return _0x13b20e;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xbb10('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){WhatsappMessageEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);WhatsappMessageEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];WhatsappMessage[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 5e49752..692c64a 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 _0x3527=['body','models','direction','toLowerCase','out','secret','WhatsappInteraction','findOne','then','update','createdAt','catch','error','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages'];(function(_0x55f500,_0xd5a849){var _0x5c12f5=function(_0x17a6e7){while(--_0x17a6e7){_0x55f500['push'](_0x55f500['shift']());}};_0x5c12f5(++_0xd5a849);}(_0x3527,0x171));var _0x7352=function(_0x23be51,_0xc02a1b){_0x23be51=_0x23be51-0x0;var _0x47a26d=_0x3527[_0x23be51];return _0x47a26d;};'use strict';var _=require(_0x7352('0x0'));var util=require('util');var logger=require(_0x7352('0x1'))(_0x7352('0x2'));var moment=require('moment');var BPromise=require(_0x7352('0x3'));var rp=require(_0x7352('0x4'));var fs=require('fs');var path=require(_0x7352('0x5'));var rimraf=require(_0x7352('0x6'));var config=require(_0x7352('0x7'));var attributes=require(_0x7352('0x8'));module[_0x7352('0x9')]=function(_0x311bd6,_0x1b95c4){return _0x311bd6[_0x7352('0xa')](_0x7352('0xb'),attributes,{'tableName':_0x7352('0xc'),'paranoid':![],'indexes':[{'name':_0x7352('0xd'),'fields':['messageId']},{'name':_0x7352('0xe'),'fields':[_0x7352('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x15fb4f,_0x28a03f,_0x17b600){var _0x5b7fa7=_0x311bd6[_0x7352('0x10')];var _0x247455=_0x15fb4f['get']({'plain':!![]});if(_0x247455[_0x7352('0x11')]['toLowerCase']()==='in'||_0x247455[_0x7352('0x11')][_0x7352('0x12')]()===_0x7352('0x13')&&!_0x247455[_0x7352('0x14')]&&!_['isNil'](_0x247455['UserId'])){_0x5b7fa7[_0x7352('0x15')][_0x7352('0x16')]({'where':{'id':_0x247455['WhatsappInteractionId']}})[_0x7352('0x17')](function(_0x31f327){if(_0x31f327){_0x31f327[_0x7352('0x18')]({'lastMsgAt':_0x247455[_0x7352('0x19')],'lastMsgDirection':_0x247455['direction'][_0x7352('0x12')]()});}})[_0x7352('0x1a')](function(_0x3f7a19){console[_0x7352('0x1b')](_0x3f7a19);});}if(_0x247455[_0x7352('0x11')]==='out'&&!_0x247455['secret']){var _0x34a4da;_0x5b7fa7['WhatsappAccount'][_0x7352('0x1c')]({'where':{'id':_0x247455[_0x7352('0x1d')]},'raw':!![]})[_0x7352('0x17')](function(_0xa680b2){_0x34a4da=_0xa680b2;if(_0x34a4da&&_0x34a4da[_0x7352('0x1e')]){switch(_0x34a4da[_0x7352('0x1e')]){case _0x7352('0x1f'):var _0x474c25=require('twilio');if(_0x34a4da[_0x7352('0x20')]&&_0x34a4da['authToken']&&_0x34a4da['phone']){var _0x107bce=new _0x474c25(_0x34a4da['accountSid'],_0x34a4da[_0x7352('0x21')]);_0x107bce[_0x7352('0x22')][_0x7352('0x23')]({'body':_0x247455[_0x7352('0xf')],'to':'whatsapp:'+_0x247455[_0x7352('0x24')],'from':'whatsapp:'+_0x34a4da[_0x7352('0x24')],'statusCallback':_0x34a4da[_0x7352('0x25')]+_0x7352('0x26')+_0x247455['id']+_0x7352('0x27')+_0x34a4da[_0x7352('0x28')]})[_0x7352('0x17')](function(_0x2df120){if(_0x2df120[_0x7352('0x29')]){return _0x15fb4f[_0x7352('0x18')]({'messageId':_0x2df120[_0x7352('0x29')]});}})[_0x7352('0x1a')](function(_0x2033b5){logger[_0x7352('0x1b')](_0x7352('0x2a'),_0x7352('0x2b'),_0x7352('0x1f'),util['inspect'](_0x2033b5,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x7352('0x2b'),'twilio',_0x7352('0x2c'));}break;}}})[_0x7352('0x2d')](function(){_0x17b600();});}else{_0x17b600();}}},'charset':_0x7352('0x2e'),'collate':_0x7352('0x2f')});}; \ No newline at end of file +var _0xed90=['twilio','accountSid','phone','authToken','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','token','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','createdAt','catch','error','secret','type'];(function(_0x5c8adc,_0x1b05c6){var _0x3ab545=function(_0x34fe79){while(--_0x34fe79){_0x5c8adc['push'](_0x5c8adc['shift']());}};_0x3ab545(++_0x1b05c6);}(_0xed90,0x16b));var _0x0ed9=function(_0x329726,_0x5e0f61){_0x329726=_0x329726-0x0;var _0x1f8d62=_0xed90[_0x329726];return _0x1f8d62;};'use strict';var _=require(_0x0ed9('0x0'));var util=require('util');var logger=require(_0x0ed9('0x1'))(_0x0ed9('0x2'));var moment=require(_0x0ed9('0x3'));var BPromise=require(_0x0ed9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ed9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0ed9('0x6'));module[_0x0ed9('0x7')]=function(_0x488a40,_0x32957e){return _0x488a40[_0x0ed9('0x8')](_0x0ed9('0x9'),attributes,{'tableName':_0x0ed9('0xa'),'paranoid':![],'indexes':[{'name':_0x0ed9('0xb'),'fields':[_0x0ed9('0xb')]},{'name':_0x0ed9('0xc'),'fields':['body'],'type':_0x0ed9('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x445c47,_0x3c277f,_0x1abe49){var _0x46916d=_0x488a40[_0x0ed9('0xe')];var _0x8e15d0=_0x445c47[_0x0ed9('0xf')]({'plain':!![]});if(_0x8e15d0[_0x0ed9('0x10')][_0x0ed9('0x11')]()==='in'||_0x8e15d0['direction'][_0x0ed9('0x11')]()===_0x0ed9('0x12')&&!_0x8e15d0['secret']&&!_[_0x0ed9('0x13')](_0x8e15d0['UserId'])){_0x46916d[_0x0ed9('0x14')][_0x0ed9('0x15')]({'where':{'id':_0x8e15d0[_0x0ed9('0x16')]}})[_0x0ed9('0x17')](function(_0x268761){if(_0x268761){_0x268761['update']({'lastMsgAt':_0x8e15d0[_0x0ed9('0x18')],'lastMsgDirection':_0x8e15d0['direction']['toLowerCase']()});}})[_0x0ed9('0x19')](function(_0x49b126){console[_0x0ed9('0x1a')](_0x49b126);});}if(_0x8e15d0[_0x0ed9('0x10')]===_0x0ed9('0x12')&&!_0x8e15d0[_0x0ed9('0x1b')]){var _0x4ce71f;_0x46916d['WhatsappAccount']['find']({'where':{'id':_0x8e15d0['WhatsappAccountId']},'raw':!![]})['then'](function(_0x527414){_0x4ce71f=_0x527414;if(_0x4ce71f&&_0x4ce71f[_0x0ed9('0x1c')]){switch(_0x4ce71f[_0x0ed9('0x1c')]){case _0x0ed9('0x1d'):var _0x54afa9=require(_0x0ed9('0x1d'));if(_0x4ce71f[_0x0ed9('0x1e')]&&_0x4ce71f['authToken']&&_0x4ce71f[_0x0ed9('0x1f')]){var _0x35ba39=new _0x54afa9(_0x4ce71f[_0x0ed9('0x1e')],_0x4ce71f[_0x0ed9('0x20')]);_0x35ba39[_0x0ed9('0x21')][_0x0ed9('0x22')]({'body':_0x8e15d0[_0x0ed9('0x23')],'to':_0x0ed9('0x24')+_0x8e15d0[_0x0ed9('0x1f')],'from':_0x0ed9('0x24')+_0x4ce71f[_0x0ed9('0x1f')],'statusCallback':_0x4ce71f[_0x0ed9('0x25')]+_0x0ed9('0x26')+_0x8e15d0['id']+'/status?token='+_0x4ce71f[_0x0ed9('0x27')]})[_0x0ed9('0x17')](function(_0x523985){if(_0x523985[_0x0ed9('0x28')]){return _0x445c47[_0x0ed9('0x29')]({'messageId':_0x523985[_0x0ed9('0x28')]});}})[_0x0ed9('0x19')](function(_0x24389c){logger[_0x0ed9('0x1a')](_0x0ed9('0x2a'),'afterCreate',_0x0ed9('0x1d'),util[_0x0ed9('0x2b')](_0x24389c,{'showHidden':![],'depth':null}));});}else{logger[_0x0ed9('0x1a')](_0x0ed9('0x2a'),_0x0ed9('0x2c'),_0x0ed9('0x1d'),_0x0ed9('0x2d'));}break;}}})[_0x0ed9('0x2e')](function(){_0x1abe49();});}else{_0x1abe49();}}},'charset':_0x0ed9('0x2f'),'collate':_0x0ed9('0x30')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 947d196..468d4ff 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 _0x9b98=['create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','CreateWhatsappMessage','WhatsappMessage'];(function(_0x261df1,_0x36c808){var _0x47482f=function(_0x142e02){while(--_0x142e02){_0x261df1['push'](_0x261df1['shift']());}};_0x47482f(++_0x36c808);}(_0x9b98,0xd7));var _0x89b9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9b98[_0x432682];return _0x463d05;};'use strict';var _=require(_0x89b9('0x0'));var util=require(_0x89b9('0x1'));var moment=require(_0x89b9('0x2'));var BPromise=require(_0x89b9('0x3'));var rs=require(_0x89b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x89b9('0x5'))(_0x89b9('0x6'));var config=require('../../config/environment');var jayson=require(_0x89b9('0x7'));var client=jayson['client'][_0x89b9('0x8')]({'port':0x232a});config[_0x89b9('0x9')]=_['defaults'](config[_0x89b9('0x9')],{'host':_0x89b9('0xa'),'port':0x18eb});var socket=require(_0x89b9('0xb'))(new Redis(config[_0x89b9('0x9')]));require(_0x89b9('0xc'))['register'](socket);function respondWithRpcPromise(_0x12b9ab,_0x2ec347,_0x3a0b81){return new BPromise(function(_0x77aa68,_0x4ff79d){return client[_0x89b9('0xd')](_0x12b9ab,_0x3a0b81)[_0x89b9('0xe')](function(_0x3c8165){logger[_0x89b9('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x2ec347,_0x89b9('0x10'));logger[_0x89b9('0x11')](_0x89b9('0x12'),_0x2ec347,'request\x20sent',JSON[_0x89b9('0x13')](_0x3c8165));if(_0x3c8165[_0x89b9('0x14')]){if(_0x3c8165['error']['code']===0x1f4){logger[_0x89b9('0x14')](_0x89b9('0x15'),_0x2ec347,_0x3c8165[_0x89b9('0x14')][_0x89b9('0x16')]);return _0x4ff79d(_0x3c8165[_0x89b9('0x14')]['message']);}logger[_0x89b9('0x14')](_0x89b9('0x15'),_0x2ec347,_0x3c8165[_0x89b9('0x14')]['message']);return _0x77aa68(_0x3c8165['error'][_0x89b9('0x16')]);}else{logger[_0x89b9('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x2ec347,'request\x20sent');_0x77aa68(_0x3c8165['result'][_0x89b9('0x16')]);}})['catch'](function(_0x3f4186){logger['error'](_0x89b9('0x15'),_0x2ec347,_0x3f4186);_0x4ff79d(_0x3f4186);});});}exports[_0x89b9('0x17')]=function(_0xcdfd59){var _0x2f128d=this;return new Promise(function(_0x4b0643,_0x1c1784){return db[_0x89b9('0x18')][_0x89b9('0x19')](_0xcdfd59[_0x89b9('0x1a')],{'raw':_0xcdfd59[_0x89b9('0x1b')]?_0xcdfd59['options'][_0x89b9('0x1c')]===undefined?!![]:![]:!![]})[_0x89b9('0xe')](function(_0x1d7436){logger[_0x89b9('0xf')](_0x89b9('0x17'),_0xcdfd59);logger['debug']('CreateWhatsappMessage',_0xcdfd59,JSON[_0x89b9('0x13')](_0x1d7436));_0x4b0643(_0x1d7436);})[_0x89b9('0x1d')](function(_0x2e0d82){logger['error'](_0x89b9('0x17'),_0x2e0d82[_0x89b9('0x16')],_0xcdfd59);_0x1c1784(_0x2f128d['error'](0x1f4,_0x2e0d82[_0x89b9('0x16')]));});});}; \ No newline at end of file +var _0x72b5=['message','info','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x72b5,0x120));var _0x572b=function(_0x37c56d,_0x52b6e3){_0x37c56d=_0x37c56d-0x0;var _0x536daf=_0x72b5[_0x37c56d];return _0x536daf;};'use strict';var _=require(_0x572b('0x0'));var util=require(_0x572b('0x1'));var moment=require('moment');var BPromise=require(_0x572b('0x2'));var rs=require(_0x572b('0x3'));var fs=require('fs');var Redis=require(_0x572b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x572b('0x5'));var logger=require(_0x572b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x572b('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x572b('0x8')]=_['defaults'](config[_0x572b('0x8')],{'host':_0x572b('0x9'),'port':0x18eb});var socket=require(_0x572b('0xa'))(new Redis(config[_0x572b('0x8')]));require(_0x572b('0xb'))[_0x572b('0xc')](socket);function respondWithRpcPromise(_0x1d6e75,_0x1c5192,_0x1f221d){return new BPromise(function(_0x6b37bb,_0x10b5dd){return client[_0x572b('0xd')](_0x1d6e75,_0x1f221d)[_0x572b('0xe')](function(_0x45ac12){logger['info'](_0x572b('0xf'),_0x1c5192,_0x572b('0x10'));logger[_0x572b('0x11')](_0x572b('0x12'),_0x1c5192,_0x572b('0x10'),JSON[_0x572b('0x13')](_0x45ac12));if(_0x45ac12['error']){if(_0x45ac12['error'][_0x572b('0x14')]===0x1f4){logger[_0x572b('0x15')](_0x572b('0xf'),_0x1c5192,_0x45ac12[_0x572b('0x15')]['message']);return _0x10b5dd(_0x45ac12[_0x572b('0x15')][_0x572b('0x16')]);}logger[_0x572b('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x1c5192,_0x45ac12['error'][_0x572b('0x16')]);return _0x6b37bb(_0x45ac12[_0x572b('0x15')][_0x572b('0x16')]);}else{logger[_0x572b('0x17')](_0x572b('0xf'),_0x1c5192,_0x572b('0x10'));_0x6b37bb(_0x45ac12['result'][_0x572b('0x16')]);}})[_0x572b('0x18')](function(_0x2fef3a){logger[_0x572b('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x1c5192,_0x2fef3a);_0x10b5dd(_0x2fef3a);});});}exports[_0x572b('0x19')]=function(_0x4cc203){var _0x31731f=this;return new Promise(function(_0x4d8f8e,_0x360d1b){return db[_0x572b('0x1a')][_0x572b('0x1b')](_0x4cc203[_0x572b('0x1c')],{'raw':_0x4cc203[_0x572b('0x1d')]?_0x4cc203[_0x572b('0x1d')][_0x572b('0x1e')]===undefined?!![]:![]:!![]})[_0x572b('0xe')](function(_0x14c038){logger[_0x572b('0x17')]('CreateWhatsappMessage',_0x4cc203);logger['debug'](_0x572b('0x19'),_0x4cc203,JSON[_0x572b('0x13')](_0x14c038));_0x4d8f8e(_0x14c038);})['catch'](function(_0x354ecb){logger[_0x572b('0x15')](_0x572b('0x19'),_0x354ecb[_0x572b('0x16')],_0x4cc203);_0x360d1b(_0x31731f['error'](0x1f4,_0x354ecb[_0x572b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 568a364..9b430f5 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 _0xcc9f=['./whatsappMessage.events','save','update','emit','removeListener','length','whatsappMessage:'];(function(_0x208326,_0x3a790c){var _0x2b0b3e=function(_0x3b16ee){while(--_0x3b16ee){_0x208326['push'](_0x208326['shift']());}};_0x2b0b3e(++_0x3a790c);}(_0xcc9f,0x1a4));var _0xfcc9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcc9f[_0x14add3];return _0x4a174f;};'use strict';var WhatsappMessageEvents=require(_0xfcc9('0x0'));var events=[_0xfcc9('0x1'),'remove',_0xfcc9('0x2')];function createListener(_0x402dc3,_0xdf8b79){return function(_0x3f3ade){_0xdf8b79[_0xfcc9('0x3')](_0x402dc3,_0x3f3ade);};}function removeListener(_0x1793d8,_0x26fda6){return function(){WhatsappMessageEvents[_0xfcc9('0x4')](_0x1793d8,_0x26fda6);};}exports['register']=function(_0xa70584){for(var _0x286bd7=0x0,_0x587ea6=events[_0xfcc9('0x5')];_0x286bd7<_0x587ea6;_0x286bd7++){var _0x3a1866=events[_0x286bd7];var _0x5c090f=createListener(_0xfcc9('0x6')+_0x3a1866,_0xa70584);WhatsappMessageEvents['on'](_0x3a1866,_0x5c090f);}}; \ No newline at end of file +var _0x37b6=['whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','register','length'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x37b6,0x119));var _0x637b=function(_0x368790,_0xc75e91){_0x368790=_0x368790-0x0;var _0x308528=_0x37b6[_0x368790];return _0x308528;};'use strict';var WhatsappMessageEvents=require(_0x637b('0x0'));var events=[_0x637b('0x1'),_0x637b('0x2'),_0x637b('0x3')];function createListener(_0x3d7633,_0x12eaba){return function(_0x1f7288){_0x12eaba[_0x637b('0x4')](_0x3d7633,_0x1f7288);};}function removeListener(_0x3918e7,_0x216c17){return function(){WhatsappMessageEvents['removeListener'](_0x3918e7,_0x216c17);};}exports[_0x637b('0x5')]=function(_0x36eedb){for(var _0x2ed114=0x0,_0x5583f9=events[_0x637b('0x6')];_0x2ed114<_0x5583f9;_0x2ed114++){var _0x152940=events[_0x2ed114];var _0x320814=createListener(_0x637b('0x7')+_0x152940,_0x36eedb);WhatsappMessageEvents['on'](_0x152940,_0x320814);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index a28385a..a7ed213 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 _0x0749=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports'];(function(_0x3d1122,_0x21d6be){var _0x4601b9=function(_0x295769){while(--_0x295769){_0x3d1122['push'](_0x3d1122['shift']());}};_0x4601b9(++_0x21d6be);}(_0x0749,0x122));var _0x9074=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0749[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x9074('0x0'));var util=require(_0x9074('0x1'));var path=require(_0x9074('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9074('0x3')]();var fs_extra=require(_0x9074('0x4'));var auth=require(_0x9074('0x5'));var interaction=require(_0x9074('0x6'));var config=require(_0x9074('0x7'));var controller=require('./whatsappQueue.controller');router[_0x9074('0x8')]('/',auth[_0x9074('0x9')](),controller[_0x9074('0xa')]);router[_0x9074('0x8')]('/describe',auth[_0x9074('0x9')](),controller[_0x9074('0xb')]);router[_0x9074('0x8')](_0x9074('0xc'),auth[_0x9074('0x9')](),controller[_0x9074('0xd')]);router[_0x9074('0x8')](_0x9074('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0x9074('0x8')](_0x9074('0xf'),auth[_0x9074('0x9')](),controller['getTeams']);router['get'](_0x9074('0x10'),auth[_0x9074('0x9')](),controller[_0x9074('0x11')]);router[_0x9074('0x12')]('/',auth[_0x9074('0x9')](),controller[_0x9074('0x13')]);router['post'](_0x9074('0xf'),auth[_0x9074('0x9')](),controller[_0x9074('0x14')]);router[_0x9074('0x12')](_0x9074('0x10'),auth[_0x9074('0x9')](),controller[_0x9074('0x15')]);router[_0x9074('0x16')]('/:id',auth[_0x9074('0x9')](),controller[_0x9074('0x17')]);router['delete'](_0x9074('0xc'),auth[_0x9074('0x9')](),controller[_0x9074('0x18')]);router[_0x9074('0x19')]('/:id/teams',auth[_0x9074('0x9')](),controller[_0x9074('0x1a')]);router[_0x9074('0x19')](_0x9074('0x10'),auth[_0x9074('0x9')](),controller[_0x9074('0x1b')]);module[_0x9074('0x1c')]=router; \ No newline at end of file +var _0xdf1a=['delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','post','addTeams','addAgents','put','update','destroy'];(function(_0x5e677d,_0x5b76cc){var _0x16ac32=function(_0x105e7e){while(--_0x105e7e){_0x5e677d['push'](_0x5e677d['shift']());}};_0x16ac32(++_0x5b76cc);}(_0xdf1a,0x12d));var _0xadf1=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0xdf1a[_0x54ccd7];return _0x4e667b;};'use strict';var multer=require(_0xadf1('0x0'));var util=require(_0xadf1('0x1'));var path=require(_0xadf1('0x2'));var timeout=require(_0xadf1('0x3'));var express=require('express');var router=express[_0xadf1('0x4')]();var fs_extra=require(_0xadf1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0xadf1('0x6')]('/',auth['isAuthenticated'](),controller[_0xadf1('0x7')]);router[_0xadf1('0x6')](_0xadf1('0x8'),auth[_0xadf1('0x9')](),controller[_0xadf1('0xa')]);router[_0xadf1('0x6')](_0xadf1('0xb'),auth[_0xadf1('0x9')](),controller[_0xadf1('0xc')]);router[_0xadf1('0x6')](_0xadf1('0xd'),auth[_0xadf1('0x9')](),controller[_0xadf1('0xe')]);router[_0xadf1('0x6')](_0xadf1('0xf'),auth[_0xadf1('0x9')](),controller['getTeams']);router[_0xadf1('0x6')](_0xadf1('0x10'),auth[_0xadf1('0x9')](),controller['getAgents']);router[_0xadf1('0x11')]('/',auth[_0xadf1('0x9')](),controller['create']);router[_0xadf1('0x11')](_0xadf1('0xf'),auth[_0xadf1('0x9')](),controller[_0xadf1('0x12')]);router['post'](_0xadf1('0x10'),auth[_0xadf1('0x9')](),controller[_0xadf1('0x13')]);router[_0xadf1('0x14')](_0xadf1('0xb'),auth['isAuthenticated'](),controller[_0xadf1('0x15')]);router['delete'](_0xadf1('0xb'),auth[_0xadf1('0x9')](),controller[_0xadf1('0x16')]);router[_0xadf1('0x17')]('/:id/teams',auth[_0xadf1('0x9')](),controller[_0xadf1('0x18')]);router[_0xadf1('0x17')](_0xadf1('0x10'),auth[_0xadf1('0x9')](),controller[_0xadf1('0x19')]);module[_0xadf1('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 104c5f7..0f697a9 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 _0xae42=['INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0x15c5b8,_0x3b670f){var _0xd45fe6=function(_0x15a775){while(--_0x15a775){_0x15c5b8['push'](_0x15c5b8['shift']());}};_0xd45fe6(++_0x3b670f);}(_0xae42,0x8d));var _0x2ae4=function(_0x353b98,_0x245238){_0x353b98=_0x353b98-0x0;var _0x7908e2=_0xae42[_0x353b98];return _0x7908e2;};'use strict';var Sequelize=require('sequelize');module[_0x2ae4('0x0')]={'name':{'type':Sequelize[_0x2ae4('0x1')],'unique':_0x2ae4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x2ae4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2ae4('0x4')](_0x2ae4('0x5'),_0x2ae4('0x6'),_0x2ae4('0x7'))},'description':{'type':Sequelize[_0x2ae4('0x1')]}}; \ No newline at end of file +var _0xcd2a=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x1f72c4,_0x519bbe){var _0x340f63=function(_0x261a06){while(--_0x261a06){_0x1f72c4['push'](_0x1f72c4['shift']());}};_0x340f63(++_0x519bbe);}(_0xcd2a,0x16b));var _0xacd2=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0xcd2a[_0x5a636f];return _0x6a8cfb;};'use strict';var Sequelize=require('sequelize');module[_0xacd2('0x0')]={'name':{'type':Sequelize[_0xacd2('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xacd2('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xacd2('0x3')](_0xacd2('0x4'),_0xacd2('0x5'),_0xacd2('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index e700e03..c48f8d5 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 _0xa00c=['userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','getAgents','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappQueue.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','WhatsappQueueId','User','agent','whatsappPause','updatedAt','rows','format','SIP','Team','getTeams','addTeams','ids','voicePause','interface','flatMap','Agents','transaction','each','UserWhatsappQueue','findOrCreate','emit','removeTeams','select','field','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','TeamId','includes','all','union','compact','isEmpty','removeAgents'];(function(_0x2d604d,_0x51a1f5){var _0x159761=function(_0x26d263){while(--_0x26d263){_0x2d604d['push'](_0x2d604d['shift']());}};_0x159761(++_0x51a1f5);}(_0xa00c,0x91));var _0xca00=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa00c[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xca00('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xca00('0x1'));var rp=require(_0xca00('0x2'));var moment=require('moment');var BPromise=require(_0xca00('0x3'));var Mustache=require(_0xca00('0x4'));var util=require('util');var path=require(_0xca00('0x5'));var sox=require(_0xca00('0x6'));var csv=require(_0xca00('0x7'));var ejs=require(_0xca00('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca00('0x9'));var squel=require('squel');var crypto=require(_0xca00('0xa'));var jsforce=require(_0xca00('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xca00('0x7'));var querystring=require(_0xca00('0xc'));var Papa=require(_0xca00('0xd'));var Redis=require(_0xca00('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xca00('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca00('0x10'));var logger=require(_0xca00('0x11'))(_0xca00('0x12'));var utils=require(_0xca00('0x13'));var config=require(_0xca00('0x14'));var licenseUtil=require(_0xca00('0x15'));var db=require(_0xca00('0x16'))['db'];config['redis']=_['defaults'](config[_0xca00('0x17')],{'host':_0xca00('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca00('0x17')]));require(_0xca00('0x19'))[_0xca00('0x1a')](socket);function respondWithStatusCode(_0x6eec41,_0x4bc606){_0x4bc606=_0x4bc606||0xcc;return function(_0x3f7911){if(_0x3f7911){return _0x6eec41['sendStatus'](_0x4bc606);}return _0x6eec41[_0xca00('0x1b')](_0x4bc606)[_0xca00('0x1c')]();};}function respondWithResult(_0x40edd2,_0x40c568){_0x40c568=_0x40c568||0xc8;return function(_0x482429){if(_0x482429){return _0x40edd2['status'](_0x40c568)[_0xca00('0x1d')](_0x482429);}};}function respondWithFilteredResult(_0x1f0450,_0x4043a3){return function(_0x158931){if(_0x158931){var _0x215053=_0x158931[_0xca00('0x1e')],_0x219c16=_0x4043a3['offset'],_0x32c3f3=_0x4043a3[_0xca00('0x1f')]+_0x4043a3[_0xca00('0x20')],_0x11d20a;if(_0x32c3f3>=_0x215053){_0x32c3f3=_0x215053;_0x11d20a=0xc8;}else{_0x11d20a=0xce;}_0x1f0450[_0xca00('0x1b')](_0x11d20a);return _0x1f0450[_0xca00('0x21')](_0xca00('0x22'),_0x219c16+'-'+_0x32c3f3+'/'+_0x215053)[_0xca00('0x1d')](_0x158931);}return null;};}function patchUpdates(_0x534944){return function(_0x110b4b){try{jsonpatch[_0xca00('0x23')](_0x110b4b,_0x534944,!![]);}catch(_0x12bec3){return BPromise[_0xca00('0x24')](_0x12bec3);}return _0x110b4b[_0xca00('0x25')]();};}function saveUpdates(_0x933b22,_0x20a6e5){return function(_0x34157e){if(_0x34157e){return _0x34157e[_0xca00('0x26')](_0x933b22)[_0xca00('0x27')](function(_0x36b077){return _0x36b077;});}return null;};}function removeEntity(_0x3d5a42,_0xc8e269){return function(_0x324ca7){if(_0x324ca7){return _0x324ca7[_0xca00('0x28')]()[_0xca00('0x27')](function(){var _0x3fd1bf=_0x324ca7[_0xca00('0x29')]({'plain':!![]});var _0x5de556=_0xca00('0x2a');return db[_0xca00('0x2b')][_0xca00('0x28')]({'where':{'type':_0x5de556,'resourceId':_0x3fd1bf['id']}})[_0xca00('0x27')](function(){return _0x324ca7;});})[_0xca00('0x27')](function(){_0x3d5a42['status'](0xcc)[_0xca00('0x1c')]();});}};}function handleEntityNotFound(_0x2beee8,_0x21dc02){return function(_0x7b61b0){if(!_0x7b61b0){_0x2beee8[_0xca00('0x2c')](0x194);}return _0x7b61b0;};}function handleError(_0x14ba18,_0x389f61){_0x389f61=_0x389f61||0x1f4;return function(_0x4b0a0a){logger['error'](_0x4b0a0a[_0xca00('0x2d')]);if(_0x4b0a0a[_0xca00('0x2e')]){delete _0x4b0a0a['name'];}_0x14ba18['status'](_0x389f61)[_0xca00('0x2f')](_0x4b0a0a);};}exports[_0xca00('0x30')]=function(_0x27a238,_0x393d8c){var _0x2b1b84={},_0x3874cd={},_0x2e5fbb={'count':0x0,'rows':[]};var _0x3166d0=_[_0xca00('0x31')](db[_0xca00('0x32')][_0xca00('0x33')],function(_0x33f79c){return{'name':_0x33f79c[_0xca00('0x34')],'type':_0x33f79c[_0xca00('0x35')][_0xca00('0x36')]};});_0x3874cd['model']=_[_0xca00('0x31')](_0x3166d0,_0xca00('0x2e'));_0x3874cd['query']=_[_0xca00('0x37')](_0x27a238[_0xca00('0x38')]);_0x3874cd[_0xca00('0x39')]=_['intersection'](_0x3874cd['model'],_0x3874cd[_0xca00('0x38')]);_0x2b1b84['attributes']=_[_0xca00('0x3a')](_0x3874cd[_0xca00('0x3b')],qs[_0xca00('0x3c')](_0x27a238['query'][_0xca00('0x3c')]));_0x2b1b84['attributes']=_0x2b1b84[_0xca00('0x3d')][_0xca00('0x3e')]?_0x2b1b84['attributes']:_0x3874cd[_0xca00('0x3b')];if(!_0x27a238[_0xca00('0x38')][_0xca00('0x3f')](_0xca00('0x40'))){_0x2b1b84[_0xca00('0x20')]=qs[_0xca00('0x20')](_0x27a238[_0xca00('0x38')][_0xca00('0x20')]);_0x2b1b84[_0xca00('0x1f')]=qs[_0xca00('0x1f')](_0x27a238[_0xca00('0x38')][_0xca00('0x1f')]);}_0x2b1b84[_0xca00('0x41')]=qs[_0xca00('0x42')](_0x27a238[_0xca00('0x38')][_0xca00('0x42')]);_0x2b1b84[_0xca00('0x43')]=qs[_0xca00('0x39')](_[_0xca00('0x44')](_0x27a238['query'],_0x3874cd['filters']),_0x3166d0);if(_0x27a238[_0xca00('0x38')][_0xca00('0x45')]){_0x2b1b84['where']=_[_0xca00('0x46')](_0x2b1b84[_0xca00('0x43')],{'$or':_['map'](_0x3166d0,function(_0x4c4f8b){if(_0x4c4f8b[_0xca00('0x35')]!==_0xca00('0x47')){var _0x14216e={};_0x14216e[_0x4c4f8b[_0xca00('0x2e')]]={'$like':'%'+_0x27a238[_0xca00('0x38')]['filter']+'%'};return _0x14216e;}})});}_0x2b1b84=_[_0xca00('0x46')]({},_0x2b1b84,_0x27a238[_0xca00('0x48')]);var _0x14bf50={'where':_0x2b1b84[_0xca00('0x43')]};return db[_0xca00('0x32')][_0xca00('0x1e')](_0x14bf50)[_0xca00('0x27')](function(_0x216543){_0x2e5fbb[_0xca00('0x1e')]=_0x216543;if(_0x27a238['query']['includeAll']){_0x2b1b84['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0xca00('0x49')](_0x2b1b84);})[_0xca00('0x27')](function(_0x42de26){_0x2e5fbb['rows']=_0x42de26;return _0x2e5fbb;})[_0xca00('0x27')](respondWithFilteredResult(_0x393d8c,_0x2b1b84))[_0xca00('0x4a')](handleError(_0x393d8c,null));};exports[_0xca00('0x4b')]=function(_0x3325bf,_0x2a996d){var _0x348091={'raw':!![],'where':{'id':_0x3325bf[_0xca00('0x4c')]['id']}},_0xdee727={};_0xdee727[_0xca00('0x3b')]=_[_0xca00('0x37')](db[_0xca00('0x32')][_0xca00('0x33')]);_0xdee727['query']=_[_0xca00('0x37')](_0x3325bf['query']);_0xdee727['filters']=_[_0xca00('0x3a')](_0xdee727[_0xca00('0x3b')],_0xdee727[_0xca00('0x38')]);_0x348091[_0xca00('0x3d')]=_[_0xca00('0x3a')](_0xdee727['model'],qs[_0xca00('0x3c')](_0x3325bf[_0xca00('0x38')][_0xca00('0x3c')]));_0x348091[_0xca00('0x3d')]=_0x348091[_0xca00('0x3d')][_0xca00('0x3e')]?_0x348091[_0xca00('0x3d')]:_0xdee727[_0xca00('0x3b')];if(_0x3325bf['query']['includeAll']){_0x348091[_0xca00('0x4d')]=[{'all':!![]}];}_0x348091=_['merge']({},_0x348091,_0x3325bf[_0xca00('0x48')]);return db[_0xca00('0x32')][_0xca00('0x4e')](_0x348091)['then'](handleEntityNotFound(_0x2a996d,null))[_0xca00('0x27')](respondWithResult(_0x2a996d,null))[_0xca00('0x4a')](handleError(_0x2a996d,null));};exports['create']=function(_0x18a7e5,_0x4c0f8d){return db['WhatsappQueue'][_0xca00('0x4f')](_0x18a7e5[_0xca00('0x50')],{})[_0xca00('0x27')](function(_0x23b4e6){var _0x41ac81=_0x18a7e5[_0xca00('0x51')][_0xca00('0x29')]({'plain':!![]});if(!_0x41ac81)throw new Error(_0xca00('0x52'));if(_0x41ac81[_0xca00('0x53')]===_0xca00('0x51')){var _0x5de1bf=_0x23b4e6[_0xca00('0x29')]({'plain':!![]});var _0x49206b=_0xca00('0x2a');return db[_0xca00('0x54')][_0xca00('0x4e')]({'where':{'name':_0x49206b,'userProfileId':_0x41ac81[_0xca00('0x55')]},'raw':!![]})[_0xca00('0x27')](function(_0x1aa3d0){if(_0x1aa3d0&&_0x1aa3d0[_0xca00('0x56')]===0x0){return db[_0xca00('0x2b')][_0xca00('0x4f')]({'name':_0x5de1bf[_0xca00('0x2e')],'resourceId':_0x5de1bf['id'],'type':_0x1aa3d0[_0xca00('0x2e')],'sectionId':_0x1aa3d0['id']},{})[_0xca00('0x27')](function(){return _0x23b4e6;});}else{return _0x23b4e6;}})[_0xca00('0x4a')](function(_0x5735d7){logger[_0xca00('0x57')](_0xca00('0x58'),_0x5735d7);throw _0x5735d7;});}return _0x23b4e6;})[_0xca00('0x27')](respondWithResult(_0x4c0f8d,0xc9))['catch'](handleError(_0x4c0f8d,null));};exports[_0xca00('0x26')]=function(_0x327cb3,_0x26916f){if(_0x327cb3['body']['id']){delete _0x327cb3[_0xca00('0x50')]['id'];}return db[_0xca00('0x32')][_0xca00('0x4e')]({'where':{'id':_0x327cb3[_0xca00('0x4c')]['id']}})['then'](handleEntityNotFound(_0x26916f,null))[_0xca00('0x27')](saveUpdates(_0x327cb3[_0xca00('0x50')],null))[_0xca00('0x27')](respondWithResult(_0x26916f,null))['catch'](handleError(_0x26916f,null));};exports[_0xca00('0x28')]=function(_0x41c2ef,_0x2f4264){return db[_0xca00('0x32')][_0xca00('0x4e')]({'where':{'id':_0x41c2ef[_0xca00('0x4c')]['id']}})[_0xca00('0x27')](handleEntityNotFound(_0x2f4264,null))[_0xca00('0x27')](removeEntity(_0x2f4264,null))[_0xca00('0x4a')](handleError(_0x2f4264,null));};exports[_0xca00('0x59')]=function(_0x29e7aa,_0x267790){return db[_0xca00('0x32')][_0xca00('0x59')]()[_0xca00('0x27')](respondWithResult(_0x267790,null))['catch'](handleError(_0x267790,null));};exports[_0xca00('0x5a')]=function(_0x397770,_0x380bce,_0x45967f){var _0x4cebc6={'raw':!![],'where':{}},_0x362565={},_0x176d7c;return db[_0xca00('0x32')]['findOne']({'where':{'id':_0x397770[_0xca00('0x4c')]['id']}})[_0xca00('0x27')](handleEntityNotFound(_0x380bce,null))[_0xca00('0x27')](function(_0x47427c){if(_0x47427c){_0x176d7c=_0x47427c[_0xca00('0x29')]({'plain':!![]});_0x362565[_0xca00('0x3b')]=_[_0xca00('0x37')](db['UserWhatsappQueue'][_0xca00('0x33')]);_0x362565[_0xca00('0x38')]=_[_0xca00('0x37')](_0x397770[_0xca00('0x38')]);_0x362565[_0xca00('0x39')]=_[_0xca00('0x3a')](_0x362565['model'],_0x362565[_0xca00('0x38')]);_0x4cebc6[_0xca00('0x3d')]=_[_0xca00('0x3a')](_0x362565[_0xca00('0x3b')],qs[_0xca00('0x3c')](_0x397770['query']['fields']));_0x4cebc6['attributes']=_0x4cebc6[_0xca00('0x3d')]['length']?_0x4cebc6['attributes']:_0x362565['model'];if(!_0x397770[_0xca00('0x38')][_0xca00('0x3f')]('nolimit')){_0x4cebc6[_0xca00('0x20')]=qs[_0xca00('0x20')](_0x397770['query'][_0xca00('0x20')]);_0x4cebc6[_0xca00('0x1f')]=qs[_0xca00('0x1f')](_0x397770[_0xca00('0x38')][_0xca00('0x1f')]);}_0x4cebc6['order']=qs[_0xca00('0x42')](_0x397770[_0xca00('0x38')]['sort']);_0x4cebc6[_0xca00('0x43')]=qs[_0xca00('0x39')](_[_0xca00('0x44')](_0x397770[_0xca00('0x38')],_0x362565['filters']));_0x4cebc6['where'][_0xca00('0x5b')]=_0x47427c['id'];if(_0x397770[_0xca00('0x38')][_0xca00('0x45')]){_0x4cebc6[_0xca00('0x43')]=_[_0xca00('0x46')](_0x4cebc6['where'],{'$or':_[_0xca00('0x31')](_0x4cebc6[_0xca00('0x3d')],function(_0xc82afd){var _0x4bfba5={};_0x4bfba5[_0xc82afd]={'$like':'%'+_0x397770[_0xca00('0x38')]['filter']+'%'};return _0x4bfba5;})});}_0x4cebc6=_[_0xca00('0x46')]({},_0x4cebc6,_0x397770[_0xca00('0x48')]);return db['UserWhatsappQueue'][_0xca00('0x49')](_0x4cebc6);}})[_0xca00('0x27')](function(_0x29da27){if(_0x29da27){return db[_0xca00('0x5c')]['findAndCountAll']({'where':{'id':_[_0xca00('0x31')](_0x29da27,'UserId'),'role':_0xca00('0x5d')},'attributes':['id',_0xca00('0x2e'),_0xca00('0x5e'),_0xca00('0x5f'),'createdAt']});}})[_0xca00('0x27')](function(_0x51f27c){if(_0x51f27c){return{'count':_0x51f27c[_0xca00('0x1e')],'rows':_[_0xca00('0x31')](_0x51f27c[_0xca00('0x60')],function(_0x2e048e){return{'membername':_0x2e048e[_0xca00('0x2e')],'UserId':_0x2e048e['id'],'queue_name':_0x176d7c[_0xca00('0x2e')],'WhatsappQueueId':_0x176d7c['id'],'interface':util[_0xca00('0x61')]('%s/%s',_0xca00('0x62'),_0x2e048e['name']),'penalty':0x0,'paused':_0x2e048e[_0xca00('0x5e')],'createdAt':_0x2e048e['createdAt'],'updatedAt':_0x2e048e[_0xca00('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xca00('0x27')](respondWithFilteredResult(_0x380bce,_0x4cebc6))[_0xca00('0x4a')](handleError(_0x380bce,null));};exports['getTeams']=function(_0x159140,_0xaaf10c,_0x1644cd){var _0x251bd8={};var _0x5d9fdf={};var _0x5432e0;var _0x3de927;return db['WhatsappQueue']['findOne']({'where':{'id':_0x159140['params']['id']}})[_0xca00('0x27')](handleEntityNotFound(_0xaaf10c,null))[_0xca00('0x27')](function(_0xff8685){if(_0xff8685){_0x5432e0=_0xff8685;_0x5d9fdf[_0xca00('0x3b')]=_['keys'](db[_0xca00('0x63')]['rawAttributes']);_0x5d9fdf[_0xca00('0x38')]=_[_0xca00('0x37')](_0x159140['query']);_0x5d9fdf[_0xca00('0x39')]=_[_0xca00('0x3a')](_0x5d9fdf[_0xca00('0x3b')],_0x5d9fdf[_0xca00('0x38')]);_0x251bd8['attributes']=_[_0xca00('0x3a')](_0x5d9fdf[_0xca00('0x3b')],qs[_0xca00('0x3c')](_0x159140[_0xca00('0x38')]['fields']));_0x251bd8['attributes']=_0x251bd8[_0xca00('0x3d')][_0xca00('0x3e')]?_0x251bd8['attributes']:_0x5d9fdf[_0xca00('0x3b')];_0x251bd8[_0xca00('0x41')]=qs[_0xca00('0x42')](_0x159140['query'][_0xca00('0x42')]);_0x251bd8[_0xca00('0x43')]=qs[_0xca00('0x39')](_[_0xca00('0x44')](_0x159140[_0xca00('0x38')],_0x5d9fdf[_0xca00('0x39')]));if(_0x159140[_0xca00('0x38')][_0xca00('0x45')]){_0x251bd8[_0xca00('0x43')]=_[_0xca00('0x46')](_0x251bd8[_0xca00('0x43')],{'$or':_[_0xca00('0x31')](_0x251bd8[_0xca00('0x3d')],function(_0x1bd8df){var _0x3f0675={};_0x3f0675[_0x1bd8df]={'$like':'%'+_0x159140[_0xca00('0x38')][_0xca00('0x45')]+'%'};return _0x3f0675;})});}_0x251bd8=_[_0xca00('0x46')]({},_0x251bd8,_0x159140[_0xca00('0x48')]);return _0x5432e0[_0xca00('0x64')](_0x251bd8);}})[_0xca00('0x27')](function(_0x2ad5ee){if(_0x2ad5ee){_0x3de927=_0x2ad5ee[_0xca00('0x3e')];if(!_0x159140[_0xca00('0x38')][_0xca00('0x3f')](_0xca00('0x40'))){_0x251bd8[_0xca00('0x20')]=qs['limit'](_0x159140[_0xca00('0x38')]['limit']);_0x251bd8['offset']=qs['offset'](_0x159140[_0xca00('0x38')][_0xca00('0x1f')]);}return _0x5432e0[_0xca00('0x64')](_0x251bd8);}})[_0xca00('0x27')](function(_0x180657){if(_0x180657){return _0x180657?{'count':_0x3de927,'rows':_0x180657}:null;}})[_0xca00('0x27')](respondWithResult(_0xaaf10c,null))[_0xca00('0x4a')](handleError(_0xaaf10c,null));};exports[_0xca00('0x65')]=function(_0x3e8f36,_0x3b795e,_0xb3f5c3){var _0x57f230=_0x3e8f36['body'][_0xca00('0x66')];return db[_0xca00('0x63')][_0xca00('0x49')]({'where':{'id':_0x57f230},'attributes':['id'],'include':[{'model':db[_0xca00('0x5c')],'as':'Agents','attributes':['id',_0xca00('0x2e'),'online',_0xca00('0x67'),_0xca00('0x68')],'raw':!![]}]})[_0xca00('0x27')](function(_0x2f451a){if(_0x2f451a){var _0xe79b0=_[_0xca00('0x69')](_0x2f451a,function(_0xd7fa0c){var _0x476ab9=_0xd7fa0c[_0xca00('0x29')]({'plain':!![]});return _0x476ab9[_0xca00('0x6a')];});return db[_0xca00('0x32')][_0xca00('0x4e')]({'where':{'id':_0x3e8f36[_0xca00('0x4c')]['id']}})[_0xca00('0x27')](function(_0x3cf5b3){return db['sequelize'][_0xca00('0x6b')](function(_0x4436cf){return _0x3cf5b3[_0xca00('0x65')](_0x57f230,{'transaction':_0x4436cf})['then'](function(){return BPromise[_0xca00('0x6c')](_0xe79b0,function(_0x42bd15){return db[_0xca00('0x6d')][_0xca00('0x6e')]({'where':{'UserId':_0x42bd15['id'],'WhatsappQueueId':_0x3e8f36[_0xca00('0x4c')]['id']},'transaction':_0x4436cf});});})['then'](function(){_0xe79b0['forEach'](function(_0xff3648){socket[_0xca00('0x6f')]('userWhatsappQueue:save',{'UserId':_0xff3648['id'],'WhatsappQueueId':_0x3cf5b3['id']});});});});});}})['then'](respondWithStatusCode(_0x3b795e,null))['catch'](handleError(_0x3b795e,null));};exports[_0xca00('0x70')]=function(_0x266363,_0x25160c,_0x3d5ba7){return db[_0xca00('0x63')]['findAll']({'where':{'id':_0x266363[_0xca00('0x38')][_0xca00('0x66')]},'attributes':['id'],'include':[{'model':db[_0xca00('0x5c')],'as':_0xca00('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xca00('0x27')](handleEntityNotFound(_0x25160c,null))['then'](function(_0x5be48f){var _0x2f3fb4=_[_0xca00('0x31')](_0x5be48f,'id');var _0x23f967=[];var _0x167295=[];var _0x27cb46=squel[_0xca00('0x71')]();_0x27cb46[_0xca00('0x72')]('tq.TeamId')[_0xca00('0x73')](_0xca00('0x74'),'tq')['join'](_0xca00('0x75'),'ut',_0xca00('0x76'))[_0xca00('0x43')](_0xca00('0x77'),_0x266363[_0xca00('0x4c')]['id']);for(var _0x305894=0x0;_0x305894<_0x5be48f['length'];_0x305894+=0x1){let _0x545f09=_0x5be48f[_0x305894];for(var _0x17b8b8=0x0;_0x17b8b8<_0x545f09['Agents'][_0xca00('0x3e')];_0x17b8b8+=0x1){let _0x5a68a5=_0x545f09[_0xca00('0x6a')][_0x17b8b8];var _0x49570f=_0x27cb46[_0xca00('0x78')]();_0x49570f[_0xca00('0x43')](_0xca00('0x79'),_0x5a68a5['id']);_0x167295[_0xca00('0x7a')](db[_0xca00('0x7b')]['query'](_0x49570f[_0xca00('0x7c')](),{'type':db[_0xca00('0x7b')][_0xca00('0x7d')]['SELECT']})[_0xca00('0x27')](function(_0x1c92b5){if(_0x1c92b5[_0xca00('0x3e')]===0x1){return _0x5a68a5['id'];}else{var _0x450326=_['every'](_[_0xca00('0x31')](_0x1c92b5,_0xca00('0x7e')),function(_0x281b80){return _[_0xca00('0x7f')](_0x2f3fb4,_0x281b80);});if(_0x450326){return _0x5a68a5['id'];}}}));}}return BPromise[_0xca00('0x80')](_0x167295)['then'](function(_0x4243ad){_0x23f967=_(_0x23f967)[_0xca00('0x81')](_0x4243ad)[_0xca00('0x82')]()['value']();return db['WhatsappQueue']['find']({'where':{'id':_0x266363[_0xca00('0x4c')]['id']}})[_0xca00('0x27')](function(_0x4c8ea9){return db[_0xca00('0x7b')][_0xca00('0x6b')](function(_0x47fe5d){return _0x4c8ea9[_0xca00('0x70')](_0x266363[_0xca00('0x38')][_0xca00('0x66')],{'transaction':_0x47fe5d})[_0xca00('0x27')](function(){if(!_[_0xca00('0x83')](_0x23f967)){return _0x4c8ea9[_0xca00('0x84')](_0x23f967,{'transaction':_0x47fe5d});}})['then'](function(){_0x23f967['forEach'](function(_0xadb0c8){socket[_0xca00('0x6f')](_0xca00('0x85'),{'UserId':_0xadb0c8,'WhatsappQueueId':_0x4c8ea9['id']});});});});});});})[_0xca00('0x27')](respondWithStatusCode(_0x25160c,null))[_0xca00('0x4a')](handleError(_0x25160c,null));};exports[_0xca00('0x86')]=function(_0x1196ca,_0x416e67,_0x1f34cb){return db[_0xca00('0x32')][_0xca00('0x4e')]({'where':{'id':_0x1196ca[_0xca00('0x4c')]['id']}})[_0xca00('0x27')](handleEntityNotFound(_0x416e67,null))[_0xca00('0x27')](function(_0x279363){if(_0x279363){return _0x279363[_0xca00('0x86')](_0x1196ca['body']['ids'],_[_0xca00('0x87')](_0x1196ca[_0xca00('0x50')],[_0xca00('0x66'),'id'])||{})[_0xca00('0x88')](function(_0x59a369){for(var _0x2523b1=0x0;_0x2523b1<_0x1196ca['body']['ids'][_0xca00('0x3e')];_0x2523b1+=0x1){socket[_0xca00('0x6f')](_0xca00('0x89'),{'UserId':_0x1196ca[_0xca00('0x50')]['ids'][_0x2523b1],'WhatsappQueueId':_0x1196ca[_0xca00('0x4c')]['id']});}return _0x59a369;});}})[_0xca00('0x27')](respondWithResult(_0x416e67,null))[_0xca00('0x4a')](handleError(_0x416e67,null));};exports[_0xca00('0x84')]=function(_0x3f33e1,_0x32318d,_0x372194){return db[_0xca00('0x32')][_0xca00('0x4e')]({'where':{'id':_0x3f33e1[_0xca00('0x4c')]['id']}})[_0xca00('0x27')](handleEntityNotFound(_0x32318d,null))[_0xca00('0x27')](function(_0x3d507d){if(_0x3d507d){return _0x3d507d['removeAgents'](_0x3f33e1[_0xca00('0x38')]['ids'])[_0xca00('0x27')](function(){if(_['isArray'](_0x3f33e1[_0xca00('0x38')][_0xca00('0x66')])){for(var _0x307deb=0x0;_0x307deb<_0x3f33e1[_0xca00('0x38')]['ids']['length'];_0x307deb+=0x1){socket[_0xca00('0x6f')](_0xca00('0x85'),{'UserId':Number(_0x3f33e1['query']['ids'][_0x307deb]),'WhatsappQueueId':Number(_0x3f33e1[_0xca00('0x4c')]['id'])});}}else{socket[_0xca00('0x6f')](_0xca00('0x85'),{'UserId':Number(_0x3f33e1[_0xca00('0x38')][_0xca00('0x66')]),'WhatsappQueueId':Number(_0x3f33e1[_0xca00('0x4c')]['id'])});}});}})[_0xca00('0x27')](respondWithStatusCode(_0x32318d,null))[_0xca00('0x4a')](handleError(_0x32318d,null));};exports[_0xca00('0x8a')]=function(_0x56f2cf,_0xc150e5,_0x6e4fae){var _0x532302={};var _0x560c76={};var _0x976bf1;var _0x17418e;return db[_0xca00('0x32')]['findOne']({'where':{'id':_0x56f2cf[_0xca00('0x4c')]['id']}})[_0xca00('0x27')](handleEntityNotFound(_0xc150e5,null))['then'](function(_0x370c18){if(_0x370c18){_0x976bf1=_0x370c18;_0x560c76[_0xca00('0x3b')]=_['keys'](db['User'][_0xca00('0x33')]);_0x560c76[_0xca00('0x38')]=_[_0xca00('0x37')](_0x56f2cf[_0xca00('0x38')]);_0x560c76[_0xca00('0x39')]=_['intersection'](_0x560c76[_0xca00('0x3b')],_0x560c76[_0xca00('0x38')]);_0x532302[_0xca00('0x3d')]=_[_0xca00('0x3a')](_0x560c76[_0xca00('0x3b')],qs[_0xca00('0x3c')](_0x56f2cf[_0xca00('0x38')]['fields']));_0x532302['attributes']=_0x532302[_0xca00('0x3d')]['length']?_0x532302[_0xca00('0x3d')]:_0x560c76[_0xca00('0x3b')];_0x532302[_0xca00('0x41')]=qs[_0xca00('0x42')](_0x56f2cf[_0xca00('0x38')][_0xca00('0x42')]);_0x532302[_0xca00('0x43')]=qs['filters'](_[_0xca00('0x44')](_0x56f2cf['query'],_0x560c76['filters']));if(_0x56f2cf[_0xca00('0x38')]['filter']){_0x532302['where']=_[_0xca00('0x46')](_0x532302[_0xca00('0x43')],{'$or':_[_0xca00('0x31')](_0x532302[_0xca00('0x3d')],function(_0x27548b){var _0x5f1c1a={};_0x5f1c1a[_0x27548b]={'$like':'%'+_0x56f2cf[_0xca00('0x38')][_0xca00('0x45')]+'%'};return _0x5f1c1a;})});}_0x532302=_[_0xca00('0x46')]({},_0x532302,_0x56f2cf[_0xca00('0x48')]);return _0x976bf1[_0xca00('0x8a')](_0x532302);}})['then'](function(_0x25b5b0){if(_0x25b5b0){_0x17418e=_0x25b5b0[_0xca00('0x3e')];if(!_0x56f2cf[_0xca00('0x38')][_0xca00('0x3f')](_0xca00('0x40'))){_0x532302[_0xca00('0x20')]=qs[_0xca00('0x20')](_0x56f2cf[_0xca00('0x38')]['limit']);_0x532302[_0xca00('0x1f')]=qs[_0xca00('0x1f')](_0x56f2cf[_0xca00('0x38')]['offset']);}return _0x976bf1[_0xca00('0x8a')](_0x532302);}})[_0xca00('0x27')](function(_0x57a636){if(_0x57a636){return _0x57a636?{'count':_0x17418e,'rows':_0x57a636}:null;}})['then'](respondWithResult(_0xc150e5,null))[_0xca00('0x4a')](handleError(_0xc150e5,null));}; \ No newline at end of file +var _0x3063=['nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','include','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','getMembers','findOne','UserWhatsappQueue','order','WhatsappQueueId','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','localhost','./whatsappQueue.socket','register','status','end','json','count','offset','set','Content-Range','apply','save','update','then','WhatsappQueues','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x112c85,_0x590cec){var _0x3cd249=function(_0x118383){while(--_0x118383){_0x112c85['push'](_0x112c85['shift']());}};_0x3cd249(++_0x590cec);}(_0x3063,0x16c));var _0x3306=function(_0x3bdd40,_0x414ee6){_0x3bdd40=_0x3bdd40-0x0;var _0x216370=_0x3063[_0x3bdd40];return _0x216370;};'use strict';var emlformat=require(_0x3306('0x0'));var rimraf=require(_0x3306('0x1'));var zipdir=require(_0x3306('0x2'));var jsonpatch=require(_0x3306('0x3'));var rp=require(_0x3306('0x4'));var moment=require(_0x3306('0x5'));var BPromise=require(_0x3306('0x6'));var Mustache=require('mustache');var util=require(_0x3306('0x7'));var path=require(_0x3306('0x8'));var sox=require(_0x3306('0x9'));var csv=require(_0x3306('0xa'));var ejs=require(_0x3306('0xb'));var fs=require('fs');var fs_extra=require(_0x3306('0xc'));var _=require(_0x3306('0xd'));var squel=require(_0x3306('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3306('0xf'));var toCsv=require(_0x3306('0xa'));var querystring=require('querystring');var Papa=require(_0x3306('0x10'));var Redis=require(_0x3306('0x11'));var authService=require(_0x3306('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3306('0x13'));var hardwareService=require(_0x3306('0x14'));var logger=require(_0x3306('0x15'))(_0x3306('0x16'));var utils=require('../../config/utils');var config=require(_0x3306('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x3306('0x18')](config[_0x3306('0x19')],{'host':_0x3306('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3306('0x1b'))[_0x3306('0x1c')](socket);function respondWithStatusCode(_0x3484ce,_0x3b41db){_0x3b41db=_0x3b41db||0xcc;return function(_0x5db948){if(_0x5db948){return _0x3484ce['sendStatus'](_0x3b41db);}return _0x3484ce[_0x3306('0x1d')](_0x3b41db)[_0x3306('0x1e')]();};}function respondWithResult(_0x15dda0,_0x2865c4){_0x2865c4=_0x2865c4||0xc8;return function(_0x1d7bce){if(_0x1d7bce){return _0x15dda0[_0x3306('0x1d')](_0x2865c4)[_0x3306('0x1f')](_0x1d7bce);}};}function respondWithFilteredResult(_0xb18564,_0x1d7a24){return function(_0x1fc57a){if(_0x1fc57a){var _0x15a04d=_0x1fc57a[_0x3306('0x20')],_0xcb6e48=_0x1d7a24[_0x3306('0x21')],_0x4ed9e3=_0x1d7a24[_0x3306('0x21')]+_0x1d7a24['limit'],_0x27c9d6;if(_0x4ed9e3>=_0x15a04d){_0x4ed9e3=_0x15a04d;_0x27c9d6=0xc8;}else{_0x27c9d6=0xce;}_0xb18564[_0x3306('0x1d')](_0x27c9d6);return _0xb18564[_0x3306('0x22')](_0x3306('0x23'),_0xcb6e48+'-'+_0x4ed9e3+'/'+_0x15a04d)[_0x3306('0x1f')](_0x1fc57a);}return null;};}function patchUpdates(_0x745704){return function(_0x385386){try{jsonpatch[_0x3306('0x24')](_0x385386,_0x745704,!![]);}catch(_0x22512e){return BPromise['reject'](_0x22512e);}return _0x385386[_0x3306('0x25')]();};}function saveUpdates(_0x26161e,_0x2a43b2){return function(_0x228d2f){if(_0x228d2f){return _0x228d2f[_0x3306('0x26')](_0x26161e)['then'](function(_0x3c82b0){return _0x3c82b0;});}return null;};}function removeEntity(_0x38961c,_0x4cc0c0){return function(_0x4b52b2){if(_0x4b52b2){return _0x4b52b2['destroy']()[_0x3306('0x27')](function(){var _0x23b846=_0x4b52b2['get']({'plain':!![]});var _0x34b066=_0x3306('0x28');return db[_0x3306('0x29')][_0x3306('0x2a')]({'where':{'type':_0x34b066,'resourceId':_0x23b846['id']}})[_0x3306('0x27')](function(){return _0x4b52b2;});})[_0x3306('0x27')](function(){_0x38961c['status'](0xcc)[_0x3306('0x1e')]();});}};}function handleEntityNotFound(_0x4f89c7,_0x4f9ac7){return function(_0x24691c){if(!_0x24691c){_0x4f89c7[_0x3306('0x2b')](0x194);}return _0x24691c;};}function handleError(_0x5eb711,_0x80c4a2){_0x80c4a2=_0x80c4a2||0x1f4;return function(_0x2a9bda){logger['error'](_0x2a9bda[_0x3306('0x2c')]);if(_0x2a9bda[_0x3306('0x2d')]){delete _0x2a9bda['name'];}_0x5eb711[_0x3306('0x1d')](_0x80c4a2)[_0x3306('0x2e')](_0x2a9bda);};}exports[_0x3306('0x2f')]=function(_0x138947,_0x38897f){var _0x21f7d1={},_0x4bcaae={},_0x27bb8f={'count':0x0,'rows':[]};var _0x57cc7d=_[_0x3306('0x30')](db[_0x3306('0x31')][_0x3306('0x32')],function(_0x5b58b5){return{'name':_0x5b58b5[_0x3306('0x33')],'type':_0x5b58b5[_0x3306('0x34')]['key']};});_0x4bcaae[_0x3306('0x35')]=_[_0x3306('0x30')](_0x57cc7d,_0x3306('0x2d'));_0x4bcaae[_0x3306('0x36')]=_[_0x3306('0x37')](_0x138947[_0x3306('0x36')]);_0x4bcaae[_0x3306('0x38')]=_[_0x3306('0x39')](_0x4bcaae[_0x3306('0x35')],_0x4bcaae[_0x3306('0x36')]);_0x21f7d1[_0x3306('0x3a')]=_[_0x3306('0x39')](_0x4bcaae[_0x3306('0x35')],qs[_0x3306('0x3b')](_0x138947[_0x3306('0x36')][_0x3306('0x3b')]));_0x21f7d1[_0x3306('0x3a')]=_0x21f7d1[_0x3306('0x3a')][_0x3306('0x3c')]?_0x21f7d1[_0x3306('0x3a')]:_0x4bcaae[_0x3306('0x35')];if(!_0x138947[_0x3306('0x36')][_0x3306('0x3d')](_0x3306('0x3e'))){_0x21f7d1[_0x3306('0x3f')]=qs[_0x3306('0x3f')](_0x138947[_0x3306('0x36')][_0x3306('0x3f')]);_0x21f7d1[_0x3306('0x21')]=qs[_0x3306('0x21')](_0x138947[_0x3306('0x36')][_0x3306('0x21')]);}_0x21f7d1['order']=qs[_0x3306('0x40')](_0x138947[_0x3306('0x36')][_0x3306('0x40')]);_0x21f7d1['where']=qs[_0x3306('0x38')](_[_0x3306('0x41')](_0x138947[_0x3306('0x36')],_0x4bcaae[_0x3306('0x38')]),_0x57cc7d);if(_0x138947[_0x3306('0x36')]['filter']){_0x21f7d1[_0x3306('0x42')]=_[_0x3306('0x43')](_0x21f7d1[_0x3306('0x42')],{'$or':_[_0x3306('0x30')](_0x57cc7d,function(_0x5e50e3){if(_0x5e50e3[_0x3306('0x34')]!==_0x3306('0x44')){var _0xde2d75={};_0xde2d75[_0x5e50e3[_0x3306('0x2d')]]={'$like':'%'+_0x138947[_0x3306('0x36')][_0x3306('0x45')]+'%'};return _0xde2d75;}})});}_0x21f7d1=_[_0x3306('0x43')]({},_0x21f7d1,_0x138947['options']);var _0x5f37a9={'where':_0x21f7d1[_0x3306('0x42')]};return db[_0x3306('0x31')][_0x3306('0x20')](_0x5f37a9)[_0x3306('0x27')](function(_0x5148c6){_0x27bb8f[_0x3306('0x20')]=_0x5148c6;if(_0x138947[_0x3306('0x36')][_0x3306('0x46')]){_0x21f7d1['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0x3306('0x47')](_0x21f7d1);})[_0x3306('0x27')](function(_0x2f9429){_0x27bb8f[_0x3306('0x48')]=_0x2f9429;return _0x27bb8f;})[_0x3306('0x27')](respondWithFilteredResult(_0x38897f,_0x21f7d1))[_0x3306('0x49')](handleError(_0x38897f,null));};exports[_0x3306('0x4a')]=function(_0x45cf3b,_0x41c831){var _0x4546b2={'raw':!![],'where':{'id':_0x45cf3b[_0x3306('0x4b')]['id']}},_0x32a1f6={};_0x32a1f6[_0x3306('0x35')]=_['keys'](db[_0x3306('0x31')][_0x3306('0x32')]);_0x32a1f6[_0x3306('0x36')]=_['keys'](_0x45cf3b[_0x3306('0x36')]);_0x32a1f6['filters']=_[_0x3306('0x39')](_0x32a1f6[_0x3306('0x35')],_0x32a1f6[_0x3306('0x36')]);_0x4546b2[_0x3306('0x3a')]=_[_0x3306('0x39')](_0x32a1f6[_0x3306('0x35')],qs[_0x3306('0x3b')](_0x45cf3b[_0x3306('0x36')]['fields']));_0x4546b2[_0x3306('0x3a')]=_0x4546b2[_0x3306('0x3a')][_0x3306('0x3c')]?_0x4546b2['attributes']:_0x32a1f6[_0x3306('0x35')];if(_0x45cf3b[_0x3306('0x36')][_0x3306('0x46')]){_0x4546b2[_0x3306('0x4c')]=[{'all':!![]}];}_0x4546b2=_[_0x3306('0x43')]({},_0x4546b2,_0x45cf3b[_0x3306('0x4d')]);return db[_0x3306('0x31')]['find'](_0x4546b2)[_0x3306('0x27')](handleEntityNotFound(_0x41c831,null))[_0x3306('0x27')](respondWithResult(_0x41c831,null))['catch'](handleError(_0x41c831,null));};exports[_0x3306('0x4e')]=function(_0xeb1f59,_0x5f2104){return db[_0x3306('0x31')][_0x3306('0x4e')](_0xeb1f59['body'],{})['then'](function(_0x442550){var _0x25feb1=_0xeb1f59[_0x3306('0x4f')][_0x3306('0x50')]({'plain':!![]});if(!_0x25feb1)throw new Error(_0x3306('0x51'));if(_0x25feb1[_0x3306('0x52')]===_0x3306('0x4f')){var _0x30088f=_0x442550['get']({'plain':!![]});var _0x1355e9='WhatsappQueues';return db[_0x3306('0x53')]['find']({'where':{'name':_0x1355e9,'userProfileId':_0x25feb1[_0x3306('0x54')]},'raw':!![]})[_0x3306('0x27')](function(_0x4e3c80){if(_0x4e3c80&&_0x4e3c80[_0x3306('0x55')]===0x0){return db['UserProfileResource'][_0x3306('0x4e')]({'name':_0x30088f['name'],'resourceId':_0x30088f['id'],'type':_0x4e3c80[_0x3306('0x2d')],'sectionId':_0x4e3c80['id']},{})[_0x3306('0x27')](function(){return _0x442550;});}else{return _0x442550;}})[_0x3306('0x49')](function(_0x3389b0){logger[_0x3306('0x56')](_0x3306('0x57'),_0x3389b0);throw _0x3389b0;});}return _0x442550;})['then'](respondWithResult(_0x5f2104,0xc9))[_0x3306('0x49')](handleError(_0x5f2104,null));};exports[_0x3306('0x26')]=function(_0x75b3,_0x3d4343){if(_0x75b3['body']['id']){delete _0x75b3[_0x3306('0x58')]['id'];}return db[_0x3306('0x31')]['find']({'where':{'id':_0x75b3['params']['id']}})[_0x3306('0x27')](handleEntityNotFound(_0x3d4343,null))['then'](saveUpdates(_0x75b3[_0x3306('0x58')],null))['then'](respondWithResult(_0x3d4343,null))[_0x3306('0x49')](handleError(_0x3d4343,null));};exports[_0x3306('0x2a')]=function(_0x187e6f,_0x49b5a7){return db[_0x3306('0x31')][_0x3306('0x59')]({'where':{'id':_0x187e6f[_0x3306('0x4b')]['id']}})[_0x3306('0x27')](handleEntityNotFound(_0x49b5a7,null))[_0x3306('0x27')](removeEntity(_0x49b5a7,null))[_0x3306('0x49')](handleError(_0x49b5a7,null));};exports['describe']=function(_0x3a71c0,_0x13275e){return db[_0x3306('0x31')][_0x3306('0x5a')]()['then'](respondWithResult(_0x13275e,null))[_0x3306('0x49')](handleError(_0x13275e,null));};exports[_0x3306('0x5b')]=function(_0xdb966f,_0x345335,_0x7493f){var _0x209cb9={'raw':!![],'where':{}},_0x52cd7c={},_0x44de60;return db[_0x3306('0x31')][_0x3306('0x5c')]({'where':{'id':_0xdb966f['params']['id']}})[_0x3306('0x27')](handleEntityNotFound(_0x345335,null))[_0x3306('0x27')](function(_0x43f0e8){if(_0x43f0e8){_0x44de60=_0x43f0e8[_0x3306('0x50')]({'plain':!![]});_0x52cd7c[_0x3306('0x35')]=_['keys'](db[_0x3306('0x5d')][_0x3306('0x32')]);_0x52cd7c[_0x3306('0x36')]=_[_0x3306('0x37')](_0xdb966f[_0x3306('0x36')]);_0x52cd7c[_0x3306('0x38')]=_[_0x3306('0x39')](_0x52cd7c[_0x3306('0x35')],_0x52cd7c[_0x3306('0x36')]);_0x209cb9['attributes']=_['intersection'](_0x52cd7c[_0x3306('0x35')],qs[_0x3306('0x3b')](_0xdb966f[_0x3306('0x36')][_0x3306('0x3b')]));_0x209cb9[_0x3306('0x3a')]=_0x209cb9[_0x3306('0x3a')][_0x3306('0x3c')]?_0x209cb9[_0x3306('0x3a')]:_0x52cd7c['model'];if(!_0xdb966f['query'][_0x3306('0x3d')](_0x3306('0x3e'))){_0x209cb9[_0x3306('0x3f')]=qs[_0x3306('0x3f')](_0xdb966f[_0x3306('0x36')]['limit']);_0x209cb9[_0x3306('0x21')]=qs[_0x3306('0x21')](_0xdb966f[_0x3306('0x36')][_0x3306('0x21')]);}_0x209cb9[_0x3306('0x5e')]=qs['sort'](_0xdb966f[_0x3306('0x36')][_0x3306('0x40')]);_0x209cb9['where']=qs[_0x3306('0x38')](_['pick'](_0xdb966f[_0x3306('0x36')],_0x52cd7c['filters']));_0x209cb9[_0x3306('0x42')][_0x3306('0x5f')]=_0x43f0e8['id'];if(_0xdb966f[_0x3306('0x36')][_0x3306('0x45')]){_0x209cb9[_0x3306('0x42')]=_[_0x3306('0x43')](_0x209cb9[_0x3306('0x42')],{'$or':_[_0x3306('0x30')](_0x209cb9[_0x3306('0x3a')],function(_0x48cb3f){var _0x362fdd={};_0x362fdd[_0x48cb3f]={'$like':'%'+_0xdb966f[_0x3306('0x36')][_0x3306('0x45')]+'%'};return _0x362fdd;})});}_0x209cb9=_[_0x3306('0x43')]({},_0x209cb9,_0xdb966f[_0x3306('0x4d')]);return db[_0x3306('0x5d')][_0x3306('0x47')](_0x209cb9);}})[_0x3306('0x27')](function(_0x5a3ea3){if(_0x5a3ea3){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x5a3ea3,_0x3306('0x60')),'role':_0x3306('0x61')},'attributes':['id','name','whatsappPause',_0x3306('0x62'),_0x3306('0x63')]});}})[_0x3306('0x27')](function(_0x36b2b1){if(_0x36b2b1){return{'count':_0x36b2b1[_0x3306('0x20')],'rows':_[_0x3306('0x30')](_0x36b2b1[_0x3306('0x48')],function(_0x417b3c){return{'membername':_0x417b3c['name'],'UserId':_0x417b3c['id'],'queue_name':_0x44de60[_0x3306('0x2d')],'WhatsappQueueId':_0x44de60['id'],'interface':util[_0x3306('0x64')](_0x3306('0x65'),_0x3306('0x66'),_0x417b3c[_0x3306('0x2d')]),'penalty':0x0,'paused':_0x417b3c['whatsappPause'],'createdAt':_0x417b3c['createdAt'],'updatedAt':_0x417b3c[_0x3306('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3306('0x27')](respondWithFilteredResult(_0x345335,_0x209cb9))[_0x3306('0x49')](handleError(_0x345335,null));};exports[_0x3306('0x67')]=function(_0x71e76a,_0x274417,_0x57f3f2){var _0x3c45e2={};var _0x29097e={};var _0x167d74;var _0x36f337;return db[_0x3306('0x31')][_0x3306('0x5c')]({'where':{'id':_0x71e76a[_0x3306('0x4b')]['id']}})[_0x3306('0x27')](handleEntityNotFound(_0x274417,null))[_0x3306('0x27')](function(_0x1c1414){if(_0x1c1414){_0x167d74=_0x1c1414;_0x29097e['model']=_['keys'](db[_0x3306('0x68')][_0x3306('0x32')]);_0x29097e[_0x3306('0x36')]=_[_0x3306('0x37')](_0x71e76a[_0x3306('0x36')]);_0x29097e[_0x3306('0x38')]=_['intersection'](_0x29097e[_0x3306('0x35')],_0x29097e[_0x3306('0x36')]);_0x3c45e2[_0x3306('0x3a')]=_['intersection'](_0x29097e[_0x3306('0x35')],qs[_0x3306('0x3b')](_0x71e76a[_0x3306('0x36')][_0x3306('0x3b')]));_0x3c45e2[_0x3306('0x3a')]=_0x3c45e2[_0x3306('0x3a')][_0x3306('0x3c')]?_0x3c45e2[_0x3306('0x3a')]:_0x29097e['model'];_0x3c45e2[_0x3306('0x5e')]=qs[_0x3306('0x40')](_0x71e76a[_0x3306('0x36')]['sort']);_0x3c45e2['where']=qs[_0x3306('0x38')](_[_0x3306('0x41')](_0x71e76a[_0x3306('0x36')],_0x29097e['filters']));if(_0x71e76a[_0x3306('0x36')][_0x3306('0x45')]){_0x3c45e2[_0x3306('0x42')]=_[_0x3306('0x43')](_0x3c45e2[_0x3306('0x42')],{'$or':_[_0x3306('0x30')](_0x3c45e2['attributes'],function(_0xda4e85){var _0x3f5db8={};_0x3f5db8[_0xda4e85]={'$like':'%'+_0x71e76a['query'][_0x3306('0x45')]+'%'};return _0x3f5db8;})});}_0x3c45e2=_[_0x3306('0x43')]({},_0x3c45e2,_0x71e76a[_0x3306('0x4d')]);return _0x167d74[_0x3306('0x67')](_0x3c45e2);}})[_0x3306('0x27')](function(_0x205e87){if(_0x205e87){_0x36f337=_0x205e87[_0x3306('0x3c')];if(!_0x71e76a[_0x3306('0x36')][_0x3306('0x3d')]('nolimit')){_0x3c45e2[_0x3306('0x3f')]=qs['limit'](_0x71e76a[_0x3306('0x36')]['limit']);_0x3c45e2[_0x3306('0x21')]=qs['offset'](_0x71e76a[_0x3306('0x36')][_0x3306('0x21')]);}return _0x167d74['getTeams'](_0x3c45e2);}})[_0x3306('0x27')](function(_0x4645ee){if(_0x4645ee){return _0x4645ee?{'count':_0x36f337,'rows':_0x4645ee}:null;}})[_0x3306('0x27')](respondWithResult(_0x274417,null))['catch'](handleError(_0x274417,null));};exports[_0x3306('0x69')]=function(_0x2921ae,_0x59ccad,_0x6921b6){var _0x29063e=_0x2921ae[_0x3306('0x58')][_0x3306('0x6a')];return db[_0x3306('0x68')][_0x3306('0x47')]({'where':{'id':_0x29063e},'attributes':['id'],'include':[{'model':db[_0x3306('0x6b')],'as':_0x3306('0x6c'),'attributes':['id',_0x3306('0x2d'),'online',_0x3306('0x6d'),_0x3306('0x6e')],'raw':!![]}]})[_0x3306('0x27')](function(_0x2b7ece){if(_0x2b7ece){var _0x35fd1c=_[_0x3306('0x6f')](_0x2b7ece,function(_0x4c3585){var _0x48c2bd=_0x4c3585[_0x3306('0x50')]({'plain':!![]});return _0x48c2bd[_0x3306('0x6c')];});return db[_0x3306('0x31')]['find']({'where':{'id':_0x2921ae[_0x3306('0x4b')]['id']}})['then'](function(_0x50c79a){return db[_0x3306('0x70')][_0x3306('0x71')](function(_0x46ef45){return _0x50c79a[_0x3306('0x69')](_0x29063e,{'transaction':_0x46ef45})[_0x3306('0x27')](function(){return BPromise['each'](_0x35fd1c,function(_0x3ff546){return db[_0x3306('0x5d')][_0x3306('0x72')]({'where':{'UserId':_0x3ff546['id'],'WhatsappQueueId':_0x2921ae[_0x3306('0x4b')]['id']},'transaction':_0x46ef45});});})['then'](function(){_0x35fd1c[_0x3306('0x73')](function(_0x3955fc){socket[_0x3306('0x74')](_0x3306('0x75'),{'UserId':_0x3955fc['id'],'WhatsappQueueId':_0x50c79a['id']});});});});});}})[_0x3306('0x27')](respondWithStatusCode(_0x59ccad,null))[_0x3306('0x49')](handleError(_0x59ccad,null));};exports[_0x3306('0x76')]=function(_0xc69f53,_0x553f0a,_0x5ab244){return db[_0x3306('0x68')][_0x3306('0x47')]({'where':{'id':_0xc69f53[_0x3306('0x36')][_0x3306('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x3306('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3306('0x27')](handleEntityNotFound(_0x553f0a,null))[_0x3306('0x27')](function(_0x5b42f5){var _0x24590c=_['map'](_0x5b42f5,'id');var _0x229074=[];var _0x1031ab=[];var _0x3bbbd1=squel[_0x3306('0x77')]();_0x3bbbd1[_0x3306('0x78')](_0x3306('0x79'))['from'](_0x3306('0x7a'),'tq')['join'](_0x3306('0x7b'),'ut',_0x3306('0x7c'))[_0x3306('0x42')](_0x3306('0x7d'),_0xc69f53[_0x3306('0x4b')]['id']);for(var _0x45d55a=0x0;_0x45d55a<_0x5b42f5[_0x3306('0x3c')];_0x45d55a+=0x1){let _0x1c8f35=_0x5b42f5[_0x45d55a];for(var _0x3c9d0b=0x0;_0x3c9d0b<_0x1c8f35[_0x3306('0x6c')][_0x3306('0x3c')];_0x3c9d0b+=0x1){let _0x4c10fa=_0x1c8f35[_0x3306('0x6c')][_0x3c9d0b];var _0x198e4c=_0x3bbbd1[_0x3306('0x7e')]();_0x198e4c['where'](_0x3306('0x7f'),_0x4c10fa['id']);_0x1031ab[_0x3306('0x80')](db[_0x3306('0x70')]['query'](_0x198e4c[_0x3306('0x81')](),{'type':db['sequelize'][_0x3306('0x82')][_0x3306('0x83')]})['then'](function(_0x214c11){if(_0x214c11[_0x3306('0x3c')]===0x1){return _0x4c10fa['id'];}else{var _0x57ced4=_['every'](_[_0x3306('0x30')](_0x214c11,_0x3306('0x84')),function(_0x25c975){return _['includes'](_0x24590c,_0x25c975);});if(_0x57ced4){return _0x4c10fa['id'];}}}));}}return BPromise[_0x3306('0x85')](_0x1031ab)[_0x3306('0x27')](function(_0x2bd176){_0x229074=_(_0x229074)['union'](_0x2bd176)['compact']()[_0x3306('0x86')]();return db[_0x3306('0x31')]['find']({'where':{'id':_0xc69f53['params']['id']}})[_0x3306('0x27')](function(_0x5c4b75){return db[_0x3306('0x70')][_0x3306('0x71')](function(_0x1a17e5){return _0x5c4b75[_0x3306('0x76')](_0xc69f53[_0x3306('0x36')][_0x3306('0x6a')],{'transaction':_0x1a17e5})[_0x3306('0x27')](function(){if(!_[_0x3306('0x87')](_0x229074)){return _0x5c4b75[_0x3306('0x88')](_0x229074,{'transaction':_0x1a17e5});}})[_0x3306('0x27')](function(){_0x229074['forEach'](function(_0x4464bf){socket[_0x3306('0x74')](_0x3306('0x89'),{'UserId':_0x4464bf,'WhatsappQueueId':_0x5c4b75['id']});});});});});});})['then'](respondWithStatusCode(_0x553f0a,null))[_0x3306('0x49')](handleError(_0x553f0a,null));};exports[_0x3306('0x8a')]=function(_0x4387ad,_0x2371c2,_0x1c1c73){return db[_0x3306('0x31')][_0x3306('0x59')]({'where':{'id':_0x4387ad[_0x3306('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2371c2,null))[_0x3306('0x27')](function(_0x37a937){if(_0x37a937){return _0x37a937['addAgents'](_0x4387ad[_0x3306('0x58')][_0x3306('0x6a')],_[_0x3306('0x8b')](_0x4387ad[_0x3306('0x58')],[_0x3306('0x6a'),'id'])||{})[_0x3306('0x8c')](function(_0x560a93){for(var _0x217dea=0x0;_0x217dea<_0x4387ad[_0x3306('0x58')]['ids']['length'];_0x217dea+=0x1){socket[_0x3306('0x74')](_0x3306('0x75'),{'UserId':_0x4387ad['body'][_0x3306('0x6a')][_0x217dea],'WhatsappQueueId':_0x4387ad['params']['id']});}return _0x560a93;});}})[_0x3306('0x27')](respondWithResult(_0x2371c2,null))[_0x3306('0x49')](handleError(_0x2371c2,null));};exports['removeAgents']=function(_0x57d4c8,_0x25e2b2,_0x382ab2){return db[_0x3306('0x31')][_0x3306('0x59')]({'where':{'id':_0x57d4c8[_0x3306('0x4b')]['id']}})['then'](handleEntityNotFound(_0x25e2b2,null))[_0x3306('0x27')](function(_0x54757b){if(_0x54757b){return _0x54757b[_0x3306('0x88')](_0x57d4c8[_0x3306('0x36')][_0x3306('0x6a')])[_0x3306('0x27')](function(){if(_['isArray'](_0x57d4c8[_0x3306('0x36')][_0x3306('0x6a')])){for(var _0x553b43=0x0;_0x553b43<_0x57d4c8[_0x3306('0x36')][_0x3306('0x6a')][_0x3306('0x3c')];_0x553b43+=0x1){socket['emit'](_0x3306('0x89'),{'UserId':Number(_0x57d4c8['query'][_0x3306('0x6a')][_0x553b43]),'WhatsappQueueId':Number(_0x57d4c8[_0x3306('0x4b')]['id'])});}}else{socket[_0x3306('0x74')](_0x3306('0x89'),{'UserId':Number(_0x57d4c8[_0x3306('0x36')][_0x3306('0x6a')]),'WhatsappQueueId':Number(_0x57d4c8['params']['id'])});}});}})[_0x3306('0x27')](respondWithStatusCode(_0x25e2b2,null))['catch'](handleError(_0x25e2b2,null));};exports[_0x3306('0x8d')]=function(_0x14ac60,_0x1c0bf7,_0xeb0e3c){var _0x25501c={};var _0x38b809={};var _0x293ad0;var _0x2563ae;return db['WhatsappQueue'][_0x3306('0x5c')]({'where':{'id':_0x14ac60['params']['id']}})[_0x3306('0x27')](handleEntityNotFound(_0x1c0bf7,null))['then'](function(_0x39bf52){if(_0x39bf52){_0x293ad0=_0x39bf52;_0x38b809['model']=_[_0x3306('0x37')](db['User'][_0x3306('0x32')]);_0x38b809[_0x3306('0x36')]=_[_0x3306('0x37')](_0x14ac60[_0x3306('0x36')]);_0x38b809[_0x3306('0x38')]=_['intersection'](_0x38b809['model'],_0x38b809[_0x3306('0x36')]);_0x25501c[_0x3306('0x3a')]=_[_0x3306('0x39')](_0x38b809[_0x3306('0x35')],qs[_0x3306('0x3b')](_0x14ac60[_0x3306('0x36')][_0x3306('0x3b')]));_0x25501c['attributes']=_0x25501c['attributes'][_0x3306('0x3c')]?_0x25501c[_0x3306('0x3a')]:_0x38b809[_0x3306('0x35')];_0x25501c[_0x3306('0x5e')]=qs[_0x3306('0x40')](_0x14ac60[_0x3306('0x36')][_0x3306('0x40')]);_0x25501c[_0x3306('0x42')]=qs[_0x3306('0x38')](_[_0x3306('0x41')](_0x14ac60['query'],_0x38b809[_0x3306('0x38')]));if(_0x14ac60[_0x3306('0x36')][_0x3306('0x45')]){_0x25501c[_0x3306('0x42')]=_[_0x3306('0x43')](_0x25501c[_0x3306('0x42')],{'$or':_['map'](_0x25501c[_0x3306('0x3a')],function(_0x3b35c1){var _0x5f50f1={};_0x5f50f1[_0x3b35c1]={'$like':'%'+_0x14ac60[_0x3306('0x36')][_0x3306('0x45')]+'%'};return _0x5f50f1;})});}_0x25501c=_[_0x3306('0x43')]({},_0x25501c,_0x14ac60[_0x3306('0x4d')]);return _0x293ad0[_0x3306('0x8d')](_0x25501c);}})['then'](function(_0x49d337){if(_0x49d337){_0x2563ae=_0x49d337[_0x3306('0x3c')];if(!_0x14ac60['query']['hasOwnProperty']('nolimit')){_0x25501c[_0x3306('0x3f')]=qs[_0x3306('0x3f')](_0x14ac60[_0x3306('0x36')][_0x3306('0x3f')]);_0x25501c[_0x3306('0x21')]=qs[_0x3306('0x21')](_0x14ac60[_0x3306('0x36')][_0x3306('0x21')]);}return _0x293ad0[_0x3306('0x8d')](_0x25501c);}})[_0x3306('0x27')](function(_0x1744e5){if(_0x1744e5){return _0x1744e5?{'count':_0x2563ae,'rows':_0x1744e5}:null;}})[_0x3306('0x27')](respondWithResult(_0x1c0bf7,null))[_0x3306('0x49')](handleError(_0x1c0bf7,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 89b028a..a670204 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 _0x2059=['hasOwnProperty','hook','exports','../../mysqldb','save','update','remove','emit'];(function(_0x84876d,_0x22a680){var _0x4f9515=function(_0x283bc6){while(--_0x283bc6){_0x84876d['push'](_0x84876d['shift']());}};_0x4f9515(++_0x22a680);}(_0x2059,0xcb));var _0x9205=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0x2059[_0x30d87a];return _0x48f64b;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x9205('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9205('0x1'),'afterUpdate':_0x9205('0x2'),'afterDestroy':_0x9205('0x3')};function emitEvent(_0xd58088){return function(_0x2e61b9,_0x55bcef,_0x15ea7d){WhatsappQueueEvents[_0x9205('0x4')](_0xd58088+':'+_0x2e61b9['id'],_0x2e61b9);WhatsappQueueEvents[_0x9205('0x4')](_0xd58088,_0x2e61b9);_0x15ea7d(null);};}for(var e in events){if(events[_0x9205('0x5')](e)){var event=events[e];WhatsappQueue[_0x9205('0x6')](e,emitEvent(event));}}module[_0x9205('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x3e2d=['update','remove','emit','hook','exports','../../mysqldb','WhatsappQueue','save'];(function(_0x250af1,_0x56ed60){var _0x1af75a=function(_0x12ca4c){while(--_0x12ca4c){_0x250af1['push'](_0x250af1['shift']());}};_0x1af75a(++_0x56ed60);}(_0x3e2d,0x185));var _0xd3e2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3e2d[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xd3e2('0x0'))['db'][_0xd3e2('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd3e2('0x2'),'afterUpdate':_0xd3e2('0x3'),'afterDestroy':_0xd3e2('0x4')};function emitEvent(_0x52bc0f){return function(_0x4c639a,_0x1d3ee5,_0x55b926){WhatsappQueueEvents[_0xd3e2('0x5')](_0x52bc0f+':'+_0x4c639a['id'],_0x4c639a);WhatsappQueueEvents['emit'](_0x52bc0f,_0x4c639a);_0x55b926(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xd3e2('0x6')](e,emitEvent(event));}}module[_0xd3e2('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 0f63721..6ad056b 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 _0x2bf8=['request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash','util','api','moment','bluebird'];(function(_0x4e5e72,_0x70fcbc){var _0x1ab548=function(_0x146ad4){while(--_0x146ad4){_0x4e5e72['push'](_0x4e5e72['shift']());}};_0x1ab548(++_0x70fcbc);}(_0x2bf8,0x17b));var _0x82bf=function(_0x5785c2,_0x33c67f){_0x5785c2=_0x5785c2-0x0;var _0x481e72=_0x2bf8[_0x5785c2];return _0x481e72;};'use strict';var _=require(_0x82bf('0x0'));var util=require(_0x82bf('0x1'));var logger=require('../../config/logger')(_0x82bf('0x2'));var moment=require(_0x82bf('0x3'));var BPromise=require(_0x82bf('0x4'));var rp=require(_0x82bf('0x5'));var fs=require('fs');var path=require(_0x82bf('0x6'));var rimraf=require('rimraf');var config=require(_0x82bf('0x7'));var attributes=require(_0x82bf('0x8'));module[_0x82bf('0x9')]=function(_0x2d6dd4,_0x24c536){return _0x2d6dd4['define'](_0x82bf('0xa'),attributes,{'tableName':_0x82bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9ed=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','whatsapp_queues','lodash','util'];(function(_0x353b90,_0x528e73){var _0x4e96df=function(_0x2bc277){while(--_0x2bc277){_0x353b90['push'](_0x353b90['shift']());}};_0x4e96df(++_0x528e73);}(_0xf9ed,0x143));var _0xdf9e=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xf9ed[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xdf9e('0x0'));var util=require(_0xdf9e('0x1'));var logger=require(_0xdf9e('0x2'))(_0xdf9e('0x3'));var moment=require(_0xdf9e('0x4'));var BPromise=require(_0xdf9e('0x5'));var rp=require(_0xdf9e('0x6'));var fs=require('fs');var path=require(_0xdf9e('0x7'));var rimraf=require(_0xdf9e('0x8'));var config=require(_0xdf9e('0x9'));var attributes=require(_0xdf9e('0xa'));module[_0xdf9e('0xb')]=function(_0x76fc8,_0x285fc0){return _0x76fc8['define']('WhatsappQueue',attributes,{'tableName':_0xdf9e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 7a2155c..a0fe085 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 _0x6f19=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','info','WhatsappQueue,\x20%s,\x20%s','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','limit','include','model','attributes','map','stringify','ShowWhatsappQueue','find','debug','lodash','util','bluebird','randomstring'];(function(_0x5b18c8,_0x3bbbe3){var _0x308e2c=function(_0x173473){while(--_0x173473){_0x5b18c8['push'](_0x5b18c8['shift']());}};_0x308e2c(++_0x3bbbe3);}(_0x6f19,0x1a9));var _0x96f1=function(_0x45e90f,_0x3f6455){_0x45e90f=_0x45e90f-0x0;var _0x12d76d=_0x6f19[_0x45e90f];return _0x12d76d;};'use strict';var _=require(_0x96f1('0x0'));var util=require(_0x96f1('0x1'));var moment=require('moment');var BPromise=require(_0x96f1('0x2'));var rs=require(_0x96f1('0x3'));var fs=require('fs');var Redis=require(_0x96f1('0x4'));var db=require(_0x96f1('0x5'))['db'];var utils=require(_0x96f1('0x6'));var logger=require('../../config/logger')(_0x96f1('0x7'));var config=require(_0x96f1('0x8'));var jayson=require(_0x96f1('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x96f1('0xa')]=_[_0x96f1('0xb')](config[_0x96f1('0xa')],{'host':_0x96f1('0xc'),'port':0x18eb});var socket=require(_0x96f1('0xd'))(new Redis(config['redis']));require(_0x96f1('0xe'))[_0x96f1('0xf')](socket);function respondWithRpcPromise(_0x32c56c,_0x19eb00,_0x49e92e){return new BPromise(function(_0x31b210,_0x3aef75){return client['request'](_0x32c56c,_0x49e92e)['then'](function(_0x425b1f){logger[_0x96f1('0x10')](_0x96f1('0x11'),_0x19eb00,'request\x20sent');logger['debug'](_0x96f1('0x12'),_0x19eb00,_0x96f1('0x13'),JSON['stringify'](_0x425b1f));if(_0x425b1f[_0x96f1('0x14')]){if(_0x425b1f[_0x96f1('0x14')][_0x96f1('0x15')]===0x1f4){logger[_0x96f1('0x14')](_0x96f1('0x11'),_0x19eb00,_0x425b1f[_0x96f1('0x14')][_0x96f1('0x16')]);return _0x3aef75(_0x425b1f[_0x96f1('0x14')]['message']);}logger[_0x96f1('0x14')](_0x96f1('0x11'),_0x19eb00,_0x425b1f[_0x96f1('0x14')][_0x96f1('0x16')]);return _0x31b210(_0x425b1f[_0x96f1('0x14')][_0x96f1('0x16')]);}else{logger[_0x96f1('0x10')](_0x96f1('0x11'),_0x19eb00,_0x96f1('0x13'));_0x31b210(_0x425b1f[_0x96f1('0x17')][_0x96f1('0x16')]);}})[_0x96f1('0x18')](function(_0x452322){logger[_0x96f1('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x19eb00,_0x452322);_0x3aef75(_0x452322);});});}exports[_0x96f1('0x19')]=function(_0x1052ec){var _0x3bc1d4=this;return new Promise(function(_0x4fcc15,_0x3b1089){return db[_0x96f1('0x1a')]['findAll']({'raw':_0x1052ec['options']?_0x1052ec[_0x96f1('0x1b')][_0x96f1('0x1c')]===undefined?!![]:![]:!![],'where':_0x1052ec[_0x96f1('0x1b')]?_0x1052ec['options'][_0x96f1('0x1d')]||null:null,'attributes':_0x1052ec[_0x96f1('0x1b')]?_0x1052ec[_0x96f1('0x1b')]['attributes']||null:null,'limit':_0x1052ec[_0x96f1('0x1b')]?_0x1052ec[_0x96f1('0x1b')][_0x96f1('0x1e')]||null:null,'include':_0x1052ec[_0x96f1('0x1b')]?_0x1052ec[_0x96f1('0x1b')][_0x96f1('0x1f')]?_['map'](_0x1052ec[_0x96f1('0x1b')][_0x96f1('0x1f')],function(_0x598228){return{'model':db[_0x598228[_0x96f1('0x20')]],'as':_0x598228['as'],'attributes':_0x598228[_0x96f1('0x21')],'include':_0x598228[_0x96f1('0x1f')]?_[_0x96f1('0x22')](_0x598228[_0x96f1('0x1f')],function(_0x538b96){return{'model':db[_0x538b96[_0x96f1('0x20')]],'as':_0x538b96['as'],'attributes':_0x538b96['attributes'],'include':_0x538b96[_0x96f1('0x1f')]?_[_0x96f1('0x22')](_0x538b96['include'],function(_0x103784){return{'model':db[_0x103784['model']],'as':_0x103784['as'],'attributes':_0x103784[_0x96f1('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x142e90){logger[_0x96f1('0x10')](_0x96f1('0x19'),_0x1052ec);logger['debug'](_0x96f1('0x19'),_0x1052ec,JSON[_0x96f1('0x23')](_0x142e90));_0x4fcc15(_0x142e90);})[_0x96f1('0x18')](function(_0x39c7ec){logger[_0x96f1('0x14')](_0x96f1('0x19'),_0x39c7ec[_0x96f1('0x16')],_0x1052ec);_0x3b1089(_0x3bc1d4[_0x96f1('0x14')](0x1f4,_0x39c7ec[_0x96f1('0x16')]));});});};exports[_0x96f1('0x24')]=function(_0x86a02a){var _0x1b2ffe=this;return new Promise(function(_0x294574,_0x1fba45){return db[_0x96f1('0x1a')][_0x96f1('0x25')]({'raw':_0x86a02a[_0x96f1('0x1b')]?_0x86a02a[_0x96f1('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x86a02a['options']?_0x86a02a[_0x96f1('0x1b')][_0x96f1('0x1d')]||null:null,'attributes':_0x86a02a[_0x96f1('0x1b')]?_0x86a02a[_0x96f1('0x1b')][_0x96f1('0x21')]||null:null,'include':_0x86a02a['options']?_0x86a02a['options'][_0x96f1('0x1f')]?_['map'](_0x86a02a[_0x96f1('0x1b')]['include'],function(_0x16ea41){return{'model':db[_0x16ea41['model']],'as':_0x16ea41['as'],'attributes':_0x16ea41['attributes'],'include':_0x16ea41[_0x96f1('0x1f')]?_[_0x96f1('0x22')](_0x16ea41[_0x96f1('0x1f')],function(_0x622434){return{'model':db[_0x622434[_0x96f1('0x20')]],'as':_0x622434['as'],'attributes':_0x622434[_0x96f1('0x21')],'include':_0x622434[_0x96f1('0x1f')]?_[_0x96f1('0x22')](_0x622434['include'],function(_0x10e98d){return{'model':db[_0x10e98d[_0x96f1('0x20')]],'as':_0x10e98d['as'],'attributes':_0x10e98d[_0x96f1('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x149c93){logger['info'](_0x96f1('0x24'),_0x86a02a);logger[_0x96f1('0x26')]('ShowWhatsappQueue',_0x86a02a,JSON[_0x96f1('0x23')](_0x149c93));_0x294574(_0x149c93);})[_0x96f1('0x18')](function(_0x58e41b){logger[_0x96f1('0x14')](_0x96f1('0x24'),_0x58e41b[_0x96f1('0x16')],_0x86a02a);_0x1fba45(_0x1b2ffe[_0x96f1('0x14')](0x1f4,_0x58e41b[_0x96f1('0x16')]));});});}; \ No newline at end of file +var _0x00d2=['options','raw','where','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x5490be,_0x1e0eb8){var _0x57d3f1=function(_0x5c71f8){while(--_0x5c71f8){_0x5490be['push'](_0x5490be['shift']());}};_0x57d3f1(++_0x1e0eb8);}(_0x00d2,0x196));var _0x200d=function(_0x54d9fd,_0x3d2f76){_0x54d9fd=_0x54d9fd-0x0;var _0x5370e1=_0x00d2[_0x54d9fd];return _0x5370e1;};'use strict';var _=require(_0x200d('0x0'));var util=require(_0x200d('0x1'));var moment=require(_0x200d('0x2'));var BPromise=require('bluebird');var rs=require(_0x200d('0x3'));var fs=require('fs');var Redis=require(_0x200d('0x4'));var db=require(_0x200d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x200d('0x6'));var config=require(_0x200d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x200d('0x8')]({'port':0x232a});config['redis']=_[_0x200d('0x9')](config['redis'],{'host':_0x200d('0xa'),'port':0x18eb});var socket=require(_0x200d('0xb'))(new Redis(config[_0x200d('0xc')]));require(_0x200d('0xd'))[_0x200d('0xe')](socket);function respondWithRpcPromise(_0x382182,_0x512262,_0x2fa462){return new BPromise(function(_0x504f06,_0x533376){return client[_0x200d('0xf')](_0x382182,_0x2fa462)[_0x200d('0x10')](function(_0x76ed24){logger[_0x200d('0x11')](_0x200d('0x12'),_0x512262,_0x200d('0x13'));logger[_0x200d('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x512262,_0x200d('0x13'),JSON[_0x200d('0x15')](_0x76ed24));if(_0x76ed24[_0x200d('0x16')]){if(_0x76ed24[_0x200d('0x16')]['code']===0x1f4){logger[_0x200d('0x16')](_0x200d('0x12'),_0x512262,_0x76ed24[_0x200d('0x16')][_0x200d('0x17')]);return _0x533376(_0x76ed24[_0x200d('0x16')][_0x200d('0x17')]);}logger[_0x200d('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x512262,_0x76ed24[_0x200d('0x16')][_0x200d('0x17')]);return _0x504f06(_0x76ed24[_0x200d('0x16')][_0x200d('0x17')]);}else{logger[_0x200d('0x11')](_0x200d('0x12'),_0x512262,'request\x20sent');_0x504f06(_0x76ed24[_0x200d('0x18')]['message']);}})[_0x200d('0x19')](function(_0x23461b){logger[_0x200d('0x16')](_0x200d('0x12'),_0x512262,_0x23461b);_0x533376(_0x23461b);});});}exports['GetWhatsappQueue']=function(_0xb61d86){var _0x1abb4c=this;return new Promise(function(_0x330f92,_0x5a14f9){return db['WhatsappQueue']['findAll']({'raw':_0xb61d86[_0x200d('0x1a')]?_0xb61d86[_0x200d('0x1a')][_0x200d('0x1b')]===undefined?!![]:![]:!![],'where':_0xb61d86[_0x200d('0x1a')]?_0xb61d86[_0x200d('0x1a')][_0x200d('0x1c')]||null:null,'attributes':_0xb61d86[_0x200d('0x1a')]?_0xb61d86[_0x200d('0x1a')][_0x200d('0x1d')]||null:null,'limit':_0xb61d86[_0x200d('0x1a')]?_0xb61d86[_0x200d('0x1a')][_0x200d('0x1e')]||null:null,'include':_0xb61d86[_0x200d('0x1a')]?_0xb61d86[_0x200d('0x1a')][_0x200d('0x1f')]?_[_0x200d('0x20')](_0xb61d86[_0x200d('0x1a')]['include'],function(_0x4c7ec4){return{'model':db[_0x4c7ec4[_0x200d('0x21')]],'as':_0x4c7ec4['as'],'attributes':_0x4c7ec4[_0x200d('0x1d')],'include':_0x4c7ec4[_0x200d('0x1f')]?_[_0x200d('0x20')](_0x4c7ec4['include'],function(_0x28a026){return{'model':db[_0x28a026['model']],'as':_0x28a026['as'],'attributes':_0x28a026[_0x200d('0x1d')],'include':_0x28a026['include']?_[_0x200d('0x20')](_0x28a026[_0x200d('0x1f')],function(_0x521847){return{'model':db[_0x521847[_0x200d('0x21')]],'as':_0x521847['as'],'attributes':_0x521847[_0x200d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x200d('0x10')](function(_0x364a50){logger[_0x200d('0x11')]('GetWhatsappQueue',_0xb61d86);logger[_0x200d('0x14')](_0x200d('0x22'),_0xb61d86,JSON['stringify'](_0x364a50));_0x330f92(_0x364a50);})['catch'](function(_0x407580){logger[_0x200d('0x16')](_0x200d('0x22'),_0x407580['message'],_0xb61d86);_0x5a14f9(_0x1abb4c[_0x200d('0x16')](0x1f4,_0x407580[_0x200d('0x17')]));});});};exports[_0x200d('0x23')]=function(_0x38d669){var _0x49bf3f=this;return new Promise(function(_0x50d255,_0x3d946b){return db['WhatsappQueue']['find']({'raw':_0x38d669[_0x200d('0x1a')]?_0x38d669[_0x200d('0x1a')][_0x200d('0x1b')]===undefined?!![]:![]:!![],'where':_0x38d669[_0x200d('0x1a')]?_0x38d669[_0x200d('0x1a')][_0x200d('0x1c')]||null:null,'attributes':_0x38d669[_0x200d('0x1a')]?_0x38d669[_0x200d('0x1a')][_0x200d('0x1d')]||null:null,'include':_0x38d669[_0x200d('0x1a')]?_0x38d669[_0x200d('0x1a')][_0x200d('0x1f')]?_[_0x200d('0x20')](_0x38d669['options'][_0x200d('0x1f')],function(_0x363f65){return{'model':db[_0x363f65[_0x200d('0x21')]],'as':_0x363f65['as'],'attributes':_0x363f65[_0x200d('0x1d')],'include':_0x363f65[_0x200d('0x1f')]?_['map'](_0x363f65['include'],function(_0x1d3990){return{'model':db[_0x1d3990[_0x200d('0x21')]],'as':_0x1d3990['as'],'attributes':_0x1d3990['attributes'],'include':_0x1d3990['include']?_['map'](_0x1d3990[_0x200d('0x1f')],function(_0x121d53){return{'model':db[_0x121d53[_0x200d('0x21')]],'as':_0x121d53['as'],'attributes':_0x121d53[_0x200d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x200d('0x10')](function(_0x166650){logger[_0x200d('0x11')]('ShowWhatsappQueue',_0x38d669);logger[_0x200d('0x14')](_0x200d('0x23'),_0x38d669,JSON[_0x200d('0x15')](_0x166650));_0x50d255(_0x166650);})[_0x200d('0x19')](function(_0x154eac){logger[_0x200d('0x16')](_0x200d('0x23'),_0x154eac['message'],_0x38d669);_0x3d946b(_0x49bf3f['error'](0x1f4,_0x154eac[_0x200d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 9c332dd..3945922 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 _0x4228=['whatsappQueue:','./whatsappQueue.events','save','remove','update','removeListener'];(function(_0x2905a3,_0x306563){var _0x51301d=function(_0x3b29a2){while(--_0x3b29a2){_0x2905a3['push'](_0x2905a3['shift']());}};_0x51301d(++_0x306563);}(_0x4228,0x1ab));var _0x8422=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4228[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require(_0x8422('0x0'));var events=[_0x8422('0x1'),_0x8422('0x2'),_0x8422('0x3')];function createListener(_0x458092,_0x1c570b){return function(_0x3be6c2){_0x1c570b['emit'](_0x458092,_0x3be6c2);};}function removeListener(_0x4928b5,_0x404175){return function(){WhatsappQueueEvents[_0x8422('0x4')](_0x4928b5,_0x404175);};}exports['register']=function(_0x191b2e){for(var _0x474173=0x0,_0x398252=events['length'];_0x474173<_0x398252;_0x474173++){var _0x5c8edb=events[_0x474173];var _0x24675f=createListener(_0x8422('0x5')+_0x5c8edb,_0x191b2e);WhatsappQueueEvents['on'](_0x5c8edb,_0x24675f);}}; \ No newline at end of file +var _0x43fe=['./whatsappQueue.events','remove','update','emit','removeListener'];(function(_0x3d894f,_0x2dffa3){var _0x1f21e4=function(_0x5cd202){while(--_0x5cd202){_0x3d894f['push'](_0x3d894f['shift']());}};_0x1f21e4(++_0x2dffa3);}(_0x43fe,0x17c));var _0xe43f=function(_0x2ec28e,_0x322396){_0x2ec28e=_0x2ec28e-0x0;var _0x4e0f8b=_0x43fe[_0x2ec28e];return _0x4e0f8b;};'use strict';var WhatsappQueueEvents=require(_0xe43f('0x0'));var events=['save',_0xe43f('0x1'),_0xe43f('0x2')];function createListener(_0x48c221,_0x55f445){return function(_0x3344d1){_0x55f445[_0xe43f('0x3')](_0x48c221,_0x3344d1);};}function removeListener(_0x139e1c,_0x82e351){return function(){WhatsappQueueEvents[_0xe43f('0x4')](_0x139e1c,_0x82e351);};}exports['register']=function(_0x1cb318){for(var _0x326c94=0x0,_0x236a8d=events['length'];_0x326c94<_0x236a8d;_0x326c94++){var _0x3d2bbe=events[_0x326c94];var _0x7b9e8a=createListener('whatsappQueue:'+_0x3d2bbe,_0x1cb318);WhatsappQueueEvents['on'](_0x3d2bbe,_0x7b9e8a);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 69c9b79..0d4a075 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 _0x222f=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x222f,0x1a4));var _0xf222=function(_0x26f866,_0x1900bc){_0x26f866=_0x26f866-0x0;var _0x1abef3=_0x222f[_0x26f866];return _0x1abef3;};'use strict';var multer=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var path=require(_0xf222('0x2'));var timeout=require(_0xf222('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf222('0x4'));var auth=require(_0xf222('0x5'));var interaction=require(_0xf222('0x6'));var config=require(_0xf222('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0xf222('0x8')]('/',auth['isAuthenticated'](),controller[_0xf222('0x9')]);router[_0xf222('0x8')]('/describe',auth[_0xf222('0xa')](),controller[_0xf222('0xb')]);router['get'](_0xf222('0xc'),auth[_0xf222('0xa')](),controller[_0xf222('0xd')]);router[_0xf222('0xe')]('/',auth[_0xf222('0xa')](),controller[_0xf222('0xf')]);router['put'](_0xf222('0xc'),auth[_0xf222('0xa')](),controller[_0xf222('0x10')]);router[_0xf222('0x11')]('/:id',auth[_0xf222('0xa')](),controller[_0xf222('0x12')]);module[_0xf222('0x13')]=router; \ No newline at end of file +var _0xee4e=['./whatsappQueueReport.controller','get','index','/describe','describe','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x110d38,_0x5a0d97){var _0x75ff3a=function(_0x292075){while(--_0x292075){_0x110d38['push'](_0x110d38['shift']());}};_0x75ff3a(++_0x5a0d97);}(_0xee4e,0x122));var _0xeee4=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xee4e[_0x1f9f37];return _0x21c080;};'use strict';var multer=require(_0xeee4('0x0'));var util=require(_0xeee4('0x1'));var path=require(_0xeee4('0x2'));var timeout=require('connect-timeout');var express=require(_0xeee4('0x3'));var router=express[_0xeee4('0x4')]();var fs_extra=require(_0xeee4('0x5'));var auth=require(_0xeee4('0x6'));var interaction=require(_0xeee4('0x7'));var config=require(_0xeee4('0x8'));var controller=require(_0xeee4('0x9'));router[_0xeee4('0xa')]('/',auth['isAuthenticated'](),controller[_0xeee4('0xb')]);router[_0xeee4('0xa')](_0xeee4('0xc'),auth['isAuthenticated'](),controller[_0xeee4('0xd')]);router[_0xeee4('0xa')](_0xeee4('0xe'),auth['isAuthenticated'](),controller[_0xeee4('0xf')]);router[_0xeee4('0x10')]('/',auth[_0xeee4('0x11')](),controller['create']);router[_0xeee4('0x12')]('/:id',auth[_0xeee4('0x11')](),controller[_0xeee4('0x13')]);router[_0xeee4('0x14')]('/:id',auth[_0xeee4('0x11')](),controller[_0xeee4('0x15')]);module[_0xeee4('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 6ff5826..48e1249 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 _0x6aa7=['DATE','sequelize','STRING'];(function(_0x52b0ef,_0x5f4989){var _0x321bbf=function(_0x1ba675){while(--_0x1ba675){_0x52b0ef['push'](_0x52b0ef['shift']());}};_0x321bbf(++_0x5f4989);}(_0x6aa7,0x178));var _0x76aa=function(_0x5edbe1,_0x1f5bd3){_0x5edbe1=_0x5edbe1-0x0;var _0x3c84f9=_0x6aa7[_0x5edbe1];return _0x3c84f9;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x76aa('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x76aa('0x1')]},'joinAt':{'type':Sequelize[_0x76aa('0x2')]},'leaveAt':{'type':Sequelize[_0x76aa('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x76aa('0x2')]},'reason':{'type':Sequelize[_0x76aa('0x1')]}}; \ No newline at end of file +var _0x7217=['sequelize','STRING','DATE'];(function(_0x2b8f7d,_0x15539a){var _0x327c4d=function(_0x2844c0){while(--_0x2844c0){_0x2b8f7d['push'](_0x2b8f7d['shift']());}};_0x327c4d(++_0x15539a);}(_0x7217,0x19e));var _0x7721=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x7217[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7721('0x1')]},'joinAt':{'type':Sequelize[_0x7721('0x2')]},'leaveAt':{'type':Sequelize[_0x7721('0x2')]},'acceptAt':{'type':Sequelize[_0x7721('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index f2bc6fe..e3394bf 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 _0xf2ee=['../../mysqldb','sendStatus','status','json','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','WhatsappQueueReport','count','includeAll','findAll','params','include','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x59726f,_0x12ca2b){var _0x261676=function(_0x48bc57){while(--_0x48bc57){_0x59726f['push'](_0x59726f['shift']());}};_0x261676(++_0x12ca2b);}(_0xf2ee,0x152));var _0xef2e=function(_0x133789,_0x24dd3d){_0x133789=_0x133789-0x0;var _0x329c5f=_0xf2ee[_0x133789];return _0x329c5f;};'use strict';var emlformat=require(_0xef2e('0x0'));var rimraf=require(_0xef2e('0x1'));var zipdir=require(_0xef2e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xef2e('0x3'));var BPromise=require(_0xef2e('0x4'));var Mustache=require(_0xef2e('0x5'));var util=require(_0xef2e('0x6'));var path=require(_0xef2e('0x7'));var sox=require('sox');var csv=require(_0xef2e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef2e('0x9'));var _=require(_0xef2e('0xa'));var squel=require('squel');var crypto=require(_0xef2e('0xb'));var jsforce=require(_0xef2e('0xc'));var deskjs=require(_0xef2e('0xd'));var toCsv=require(_0xef2e('0x8'));var querystring=require('querystring');var Papa=require(_0xef2e('0xe'));var Redis=require(_0xef2e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xef2e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef2e('0x11'));var logger=require(_0xef2e('0x12'))('api');var utils=require(_0xef2e('0x13'));var config=require(_0xef2e('0x14'));var licenseUtil=require(_0xef2e('0x15'));var db=require(_0xef2e('0x16'))['db'];function respondWithStatusCode(_0x34bcfe,_0x3152d5){_0x3152d5=_0x3152d5||0xcc;return function(_0x2eaa96){if(_0x2eaa96){return _0x34bcfe[_0xef2e('0x17')](_0x3152d5);}return _0x34bcfe[_0xef2e('0x18')](_0x3152d5)['end']();};}function respondWithResult(_0x181bae,_0x1cc5ec){_0x1cc5ec=_0x1cc5ec||0xc8;return function(_0x192bb3){if(_0x192bb3){return _0x181bae[_0xef2e('0x18')](_0x1cc5ec)[_0xef2e('0x19')](_0x192bb3);}};}function respondWithFilteredResult(_0x516760,_0x25bc02){return function(_0x5c312c){if(_0x5c312c){var _0x7927bf=_0x5c312c['count'],_0x151c09=_0x25bc02['offset'],_0x51e8ef=_0x25bc02['offset']+_0x25bc02['limit'],_0x39183b;if(_0x51e8ef>=_0x7927bf){_0x51e8ef=_0x7927bf;_0x39183b=0xc8;}else{_0x39183b=0xce;}_0x516760['status'](_0x39183b);return _0x516760[_0xef2e('0x1a')](_0xef2e('0x1b'),_0x151c09+'-'+_0x51e8ef+'/'+_0x7927bf)[_0xef2e('0x19')](_0x5c312c);}return null;};}function patchUpdates(_0x2307bc){return function(_0x216ab1){try{jsonpatch[_0xef2e('0x1c')](_0x216ab1,_0x2307bc,!![]);}catch(_0x3b0185){return BPromise[_0xef2e('0x1d')](_0x3b0185);}return _0x216ab1['save']();};}function saveUpdates(_0xcb5bb6,_0x2f48b6){return function(_0x5de944){if(_0x5de944){return _0x5de944[_0xef2e('0x1e')](_0xcb5bb6)[_0xef2e('0x1f')](function(_0x305c43){return _0x305c43;});}return null;};}function removeEntity(_0x4d03d7,_0x4e6202){return function(_0x4b0c5e){if(_0x4b0c5e){return _0x4b0c5e['destroy']()['then'](function(){_0x4d03d7['status'](0xcc)[_0xef2e('0x20')]();});}};}function handleEntityNotFound(_0xd25a4d,_0x109bb7){return function(_0x215dc1){if(!_0x215dc1){_0xd25a4d['sendStatus'](0x194);}return _0x215dc1;};}function handleError(_0x4dcf19,_0x3a0cbc){_0x3a0cbc=_0x3a0cbc||0x1f4;return function(_0x3c3b43){logger[_0xef2e('0x21')](_0x3c3b43[_0xef2e('0x22')]);if(_0x3c3b43[_0xef2e('0x23')]){delete _0x3c3b43[_0xef2e('0x23')];}_0x4dcf19[_0xef2e('0x18')](_0x3a0cbc)[_0xef2e('0x24')](_0x3c3b43);};}exports[_0xef2e('0x25')]=function(_0x263c54,_0x2a4a5d){var _0x1ba1b7={},_0x3e5bbb={},_0x5e3030={'count':0x0,'rows':[]};var _0xe52780=_['map'](db['WhatsappQueueReport'][_0xef2e('0x26')],function(_0xb352ac){return{'name':_0xb352ac[_0xef2e('0x27')],'type':_0xb352ac[_0xef2e('0x28')][_0xef2e('0x29')]};});_0x3e5bbb[_0xef2e('0x2a')]=_[_0xef2e('0x2b')](_0xe52780,_0xef2e('0x23'));_0x3e5bbb[_0xef2e('0x2c')]=_[_0xef2e('0x2d')](_0x263c54['query']);_0x3e5bbb[_0xef2e('0x2e')]=_['intersection'](_0x3e5bbb[_0xef2e('0x2a')],_0x3e5bbb[_0xef2e('0x2c')]);_0x1ba1b7[_0xef2e('0x2f')]=_[_0xef2e('0x30')](_0x3e5bbb[_0xef2e('0x2a')],qs[_0xef2e('0x31')](_0x263c54[_0xef2e('0x2c')][_0xef2e('0x31')]));_0x1ba1b7[_0xef2e('0x2f')]=_0x1ba1b7[_0xef2e('0x2f')][_0xef2e('0x32')]?_0x1ba1b7[_0xef2e('0x2f')]:_0x3e5bbb[_0xef2e('0x2a')];if(!_0x263c54[_0xef2e('0x2c')][_0xef2e('0x33')](_0xef2e('0x34'))){_0x1ba1b7['limit']=qs[_0xef2e('0x35')](_0x263c54[_0xef2e('0x2c')][_0xef2e('0x35')]);_0x1ba1b7['offset']=qs['offset'](_0x263c54[_0xef2e('0x2c')]['offset']);}_0x1ba1b7['order']=qs[_0xef2e('0x36')](_0x263c54[_0xef2e('0x2c')][_0xef2e('0x36')]);_0x1ba1b7[_0xef2e('0x37')]=qs[_0xef2e('0x2e')](_[_0xef2e('0x38')](_0x263c54[_0xef2e('0x2c')],_0x3e5bbb[_0xef2e('0x2e')]),_0xe52780);if(_0x263c54[_0xef2e('0x2c')][_0xef2e('0x39')]){_0x1ba1b7[_0xef2e('0x37')]=_[_0xef2e('0x3a')](_0x1ba1b7[_0xef2e('0x37')],{'$or':_[_0xef2e('0x2b')](_0xe52780,function(_0x2a2b1c){if(_0x2a2b1c['type']!==_0xef2e('0x3b')){var _0x36d625={};_0x36d625[_0x2a2b1c[_0xef2e('0x23')]]={'$like':'%'+_0x263c54[_0xef2e('0x2c')]['filter']+'%'};return _0x36d625;}})});}_0x1ba1b7=_['merge']({},_0x1ba1b7,_0x263c54['options']);var _0x38a7b8={'where':_0x1ba1b7[_0xef2e('0x37')]};return db[_0xef2e('0x3c')][_0xef2e('0x3d')](_0x38a7b8)[_0xef2e('0x1f')](function(_0x5eef34){_0x5e3030[_0xef2e('0x3d')]=_0x5eef34;if(_0x263c54[_0xef2e('0x2c')][_0xef2e('0x3e')]){_0x1ba1b7['include']=[{'all':!![]}];}return db[_0xef2e('0x3c')][_0xef2e('0x3f')](_0x1ba1b7);})['then'](function(_0x28d65f){_0x5e3030['rows']=_0x28d65f;return _0x5e3030;})[_0xef2e('0x1f')](respondWithFilteredResult(_0x2a4a5d,_0x1ba1b7))['catch'](handleError(_0x2a4a5d,null));};exports['show']=function(_0x408894,_0x425f10){var _0x56b070={'raw':!![],'where':{'id':_0x408894[_0xef2e('0x40')]['id']}},_0x2d335a={};_0x2d335a['model']=_['keys'](db[_0xef2e('0x3c')][_0xef2e('0x26')]);_0x2d335a[_0xef2e('0x2c')]=_[_0xef2e('0x2d')](_0x408894[_0xef2e('0x2c')]);_0x2d335a['filters']=_['intersection'](_0x2d335a['model'],_0x2d335a['query']);_0x56b070[_0xef2e('0x2f')]=_[_0xef2e('0x30')](_0x2d335a['model'],qs[_0xef2e('0x31')](_0x408894[_0xef2e('0x2c')][_0xef2e('0x31')]));_0x56b070['attributes']=_0x56b070[_0xef2e('0x2f')][_0xef2e('0x32')]?_0x56b070[_0xef2e('0x2f')]:_0x2d335a[_0xef2e('0x2a')];if(_0x408894[_0xef2e('0x2c')][_0xef2e('0x3e')]){_0x56b070[_0xef2e('0x41')]=[{'all':!![]}];}_0x56b070=_[_0xef2e('0x3a')]({},_0x56b070,_0x408894[_0xef2e('0x42')]);return db[_0xef2e('0x3c')][_0xef2e('0x43')](_0x56b070)[_0xef2e('0x1f')](handleEntityNotFound(_0x425f10,null))['then'](respondWithResult(_0x425f10,null))[_0xef2e('0x44')](handleError(_0x425f10,null));};exports[_0xef2e('0x45')]=function(_0x1c0e26,_0x292004){return db[_0xef2e('0x3c')][_0xef2e('0x45')](_0x1c0e26[_0xef2e('0x46')],{})[_0xef2e('0x1f')](respondWithResult(_0x292004,0xc9))[_0xef2e('0x44')](handleError(_0x292004,null));};exports[_0xef2e('0x1e')]=function(_0x5a3523,_0x3a1949){if(_0x5a3523[_0xef2e('0x46')]['id']){delete _0x5a3523[_0xef2e('0x46')]['id'];}return db[_0xef2e('0x3c')][_0xef2e('0x43')]({'where':{'id':_0x5a3523[_0xef2e('0x40')]['id']}})[_0xef2e('0x1f')](handleEntityNotFound(_0x3a1949,null))['then'](saveUpdates(_0x5a3523['body'],null))['then'](respondWithResult(_0x3a1949,null))[_0xef2e('0x44')](handleError(_0x3a1949,null));};exports['destroy']=function(_0x334994,_0xf4f39c){return db['WhatsappQueueReport']['find']({'where':{'id':_0x334994[_0xef2e('0x40')]['id']}})[_0xef2e('0x1f')](handleEntityNotFound(_0xf4f39c,null))['then'](removeEntity(_0xf4f39c,null))['catch'](handleError(_0xf4f39c,null));};exports[_0xef2e('0x47')]=function(_0x40c0f5,_0x5f5828){return db[_0xef2e('0x3c')][_0xef2e('0x47')]()[_0xef2e('0x1f')](respondWithResult(_0x5f5828,null))[_0xef2e('0x44')](handleError(_0x5f5828,null));}; \ No newline at end of file +var _0x7666=['then','destroy','end','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','WhatsappQueueReport','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7666,0x151));var _0x6766=function(_0x2647cf,_0x551bdc){_0x2647cf=_0x2647cf-0x0;var _0x11ee98=_0x7666[_0x2647cf];return _0x11ee98;};'use strict';var emlformat=require(_0x6766('0x0'));var rimraf=require(_0x6766('0x1'));var zipdir=require(_0x6766('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6766('0x3'));var moment=require('moment');var BPromise=require(_0x6766('0x4'));var Mustache=require('mustache');var util=require(_0x6766('0x5'));var path=require('path');var sox=require(_0x6766('0x6'));var csv=require(_0x6766('0x7'));var ejs=require(_0x6766('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6766('0x9'));var squel=require(_0x6766('0xa'));var crypto=require(_0x6766('0xb'));var jsforce=require(_0x6766('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6766('0x7'));var querystring=require(_0x6766('0xd'));var Papa=require(_0x6766('0xe'));var Redis=require(_0x6766('0xf'));var authService=require(_0x6766('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6766('0x11'));var hardwareService=require(_0x6766('0x12'));var logger=require('../../config/logger')(_0x6766('0x13'));var utils=require('../../config/utils');var config=require(_0x6766('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6766('0x15'))['db'];function respondWithStatusCode(_0x5d8ede,_0x58d3bd){_0x58d3bd=_0x58d3bd||0xcc;return function(_0x1f1a21){if(_0x1f1a21){return _0x5d8ede[_0x6766('0x16')](_0x58d3bd);}return _0x5d8ede['status'](_0x58d3bd)['end']();};}function respondWithResult(_0xd1e97b,_0x201bfc){_0x201bfc=_0x201bfc||0xc8;return function(_0x4a7ea5){if(_0x4a7ea5){return _0xd1e97b[_0x6766('0x17')](_0x201bfc)[_0x6766('0x18')](_0x4a7ea5);}};}function respondWithFilteredResult(_0x17691c,_0x437b4e){return function(_0x17b9e3){if(_0x17b9e3){var _0x9e3add=_0x17b9e3[_0x6766('0x19')],_0x7f4986=_0x437b4e['offset'],_0x3d3017=_0x437b4e[_0x6766('0x1a')]+_0x437b4e[_0x6766('0x1b')],_0x39b897;if(_0x3d3017>=_0x9e3add){_0x3d3017=_0x9e3add;_0x39b897=0xc8;}else{_0x39b897=0xce;}_0x17691c['status'](_0x39b897);return _0x17691c['set'](_0x6766('0x1c'),_0x7f4986+'-'+_0x3d3017+'/'+_0x9e3add)['json'](_0x17b9e3);}return null;};}function patchUpdates(_0x1a7f58){return function(_0x287ab8){try{jsonpatch[_0x6766('0x1d')](_0x287ab8,_0x1a7f58,!![]);}catch(_0x271c9e){return BPromise[_0x6766('0x1e')](_0x271c9e);}return _0x287ab8[_0x6766('0x1f')]();};}function saveUpdates(_0x3dbb48,_0x13e7af){return function(_0x4a23f3){if(_0x4a23f3){return _0x4a23f3[_0x6766('0x20')](_0x3dbb48)[_0x6766('0x21')](function(_0x218622){return _0x218622;});}return null;};}function removeEntity(_0x3aad2b,_0x259c16){return function(_0xd871b6){if(_0xd871b6){return _0xd871b6[_0x6766('0x22')]()[_0x6766('0x21')](function(){_0x3aad2b['status'](0xcc)[_0x6766('0x23')]();});}};}function handleEntityNotFound(_0x4b4ac2,_0x16e0df){return function(_0x44a6ab){if(!_0x44a6ab){_0x4b4ac2['sendStatus'](0x194);}return _0x44a6ab;};}function handleError(_0x1ea81c,_0x3f18e4){_0x3f18e4=_0x3f18e4||0x1f4;return function(_0x41fbee){logger['error'](_0x41fbee[_0x6766('0x24')]);if(_0x41fbee[_0x6766('0x25')]){delete _0x41fbee['name'];}_0x1ea81c[_0x6766('0x17')](_0x3f18e4)[_0x6766('0x26')](_0x41fbee);};}exports[_0x6766('0x27')]=function(_0x224ccb,_0x6cd452){var _0x3f6401={},_0x27d6cb={},_0xae8d8d={'count':0x0,'rows':[]};var _0x3bb21e=_[_0x6766('0x28')](db['WhatsappQueueReport']['rawAttributes'],function(_0x522773){return{'name':_0x522773[_0x6766('0x29')],'type':_0x522773[_0x6766('0x2a')][_0x6766('0x2b')]};});_0x27d6cb[_0x6766('0x2c')]=_[_0x6766('0x28')](_0x3bb21e,_0x6766('0x25'));_0x27d6cb[_0x6766('0x2d')]=_['keys'](_0x224ccb[_0x6766('0x2d')]);_0x27d6cb[_0x6766('0x2e')]=_[_0x6766('0x2f')](_0x27d6cb[_0x6766('0x2c')],_0x27d6cb[_0x6766('0x2d')]);_0x3f6401[_0x6766('0x30')]=_[_0x6766('0x2f')](_0x27d6cb[_0x6766('0x2c')],qs[_0x6766('0x31')](_0x224ccb[_0x6766('0x2d')][_0x6766('0x31')]));_0x3f6401['attributes']=_0x3f6401[_0x6766('0x30')][_0x6766('0x32')]?_0x3f6401[_0x6766('0x30')]:_0x27d6cb[_0x6766('0x2c')];if(!_0x224ccb[_0x6766('0x2d')][_0x6766('0x33')](_0x6766('0x34'))){_0x3f6401[_0x6766('0x1b')]=qs[_0x6766('0x1b')](_0x224ccb[_0x6766('0x2d')][_0x6766('0x1b')]);_0x3f6401[_0x6766('0x1a')]=qs[_0x6766('0x1a')](_0x224ccb[_0x6766('0x2d')][_0x6766('0x1a')]);}_0x3f6401[_0x6766('0x35')]=qs['sort'](_0x224ccb[_0x6766('0x2d')][_0x6766('0x36')]);_0x3f6401[_0x6766('0x37')]=qs[_0x6766('0x2e')](_[_0x6766('0x38')](_0x224ccb[_0x6766('0x2d')],_0x27d6cb[_0x6766('0x2e')]),_0x3bb21e);if(_0x224ccb[_0x6766('0x2d')][_0x6766('0x39')]){_0x3f6401[_0x6766('0x37')]=_['merge'](_0x3f6401[_0x6766('0x37')],{'$or':_[_0x6766('0x28')](_0x3bb21e,function(_0x106861){if(_0x106861['type']!==_0x6766('0x3a')){var _0x4971e3={};_0x4971e3[_0x106861[_0x6766('0x25')]]={'$like':'%'+_0x224ccb[_0x6766('0x2d')][_0x6766('0x39')]+'%'};return _0x4971e3;}})});}_0x3f6401=_[_0x6766('0x3b')]({},_0x3f6401,_0x224ccb['options']);var _0x5b68c6={'where':_0x3f6401[_0x6766('0x37')]};return db[_0x6766('0x3c')][_0x6766('0x19')](_0x5b68c6)['then'](function(_0x133329){_0xae8d8d[_0x6766('0x19')]=_0x133329;if(_0x224ccb[_0x6766('0x2d')][_0x6766('0x3d')]){_0x3f6401[_0x6766('0x3e')]=[{'all':!![]}];}return db[_0x6766('0x3c')][_0x6766('0x3f')](_0x3f6401);})[_0x6766('0x21')](function(_0x5bb696){_0xae8d8d[_0x6766('0x40')]=_0x5bb696;return _0xae8d8d;})[_0x6766('0x21')](respondWithFilteredResult(_0x6cd452,_0x3f6401))['catch'](handleError(_0x6cd452,null));};exports[_0x6766('0x41')]=function(_0x5ce35a,_0x58310b){var _0x1d1e3b={'raw':!![],'where':{'id':_0x5ce35a['params']['id']}},_0x7b7594={};_0x7b7594['model']=_[_0x6766('0x42')](db['WhatsappQueueReport'][_0x6766('0x43')]);_0x7b7594['query']=_[_0x6766('0x42')](_0x5ce35a[_0x6766('0x2d')]);_0x7b7594[_0x6766('0x2e')]=_['intersection'](_0x7b7594['model'],_0x7b7594[_0x6766('0x2d')]);_0x1d1e3b[_0x6766('0x30')]=_['intersection'](_0x7b7594[_0x6766('0x2c')],qs[_0x6766('0x31')](_0x5ce35a[_0x6766('0x2d')][_0x6766('0x31')]));_0x1d1e3b[_0x6766('0x30')]=_0x1d1e3b[_0x6766('0x30')][_0x6766('0x32')]?_0x1d1e3b[_0x6766('0x30')]:_0x7b7594[_0x6766('0x2c')];if(_0x5ce35a[_0x6766('0x2d')][_0x6766('0x3d')]){_0x1d1e3b[_0x6766('0x3e')]=[{'all':!![]}];}_0x1d1e3b=_['merge']({},_0x1d1e3b,_0x5ce35a['options']);return db[_0x6766('0x3c')][_0x6766('0x44')](_0x1d1e3b)[_0x6766('0x21')](handleEntityNotFound(_0x58310b,null))['then'](respondWithResult(_0x58310b,null))[_0x6766('0x45')](handleError(_0x58310b,null));};exports[_0x6766('0x46')]=function(_0x4a90cf,_0x32bbb1){return db[_0x6766('0x3c')][_0x6766('0x46')](_0x4a90cf[_0x6766('0x47')],{})[_0x6766('0x21')](respondWithResult(_0x32bbb1,0xc9))['catch'](handleError(_0x32bbb1,null));};exports[_0x6766('0x20')]=function(_0x16afe8,_0x10acd7){if(_0x16afe8['body']['id']){delete _0x16afe8[_0x6766('0x47')]['id'];}return db[_0x6766('0x3c')]['find']({'where':{'id':_0x16afe8['params']['id']}})[_0x6766('0x21')](handleEntityNotFound(_0x10acd7,null))['then'](saveUpdates(_0x16afe8[_0x6766('0x47')],null))[_0x6766('0x21')](respondWithResult(_0x10acd7,null))['catch'](handleError(_0x10acd7,null));};exports[_0x6766('0x22')]=function(_0x4b68c2,_0x34d71a){return db[_0x6766('0x3c')][_0x6766('0x44')]({'where':{'id':_0x4b68c2[_0x6766('0x48')]['id']}})[_0x6766('0x21')](handleEntityNotFound(_0x34d71a,null))['then'](removeEntity(_0x34d71a,null))[_0x6766('0x45')](handleError(_0x34d71a,null));};exports[_0x6766('0x49')]=function(_0x59d08f,_0x208eee){return db[_0x6766('0x3c')][_0x6766('0x49')]()['then'](respondWithResult(_0x208eee,null))[_0x6766('0x45')](handleError(_0x208eee,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 044ec66..7f3e4ba 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 _0xc27d=['moment','bluebird','request-promise','rimraf','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api'];(function(_0x13b86a,_0x1438a5){var _0x399d5a=function(_0x2e9344){while(--_0x2e9344){_0x13b86a['push'](_0x13b86a['shift']());}};_0x399d5a(++_0x1438a5);}(_0xc27d,0x101));var _0xdc27=function(_0x4a3f51,_0x3d9868){_0x4a3f51=_0x4a3f51-0x0;var _0x4d48d6=_0xc27d[_0x4a3f51];return _0x4d48d6;};'use strict';var _=require('lodash');var util=require(_0xdc27('0x0'));var logger=require(_0xdc27('0x1'))(_0xdc27('0x2'));var moment=require(_0xdc27('0x3'));var BPromise=require(_0xdc27('0x4'));var rp=require(_0xdc27('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc27('0x6'));var config=require('../../config/environment');var attributes=require(_0xdc27('0x7'));module[_0xdc27('0x8')]=function(_0xa140a3,_0x48d65c){return _0xa140a3[_0xdc27('0x9')](_0xdc27('0xa'),attributes,{'tableName':_0xdc27('0xb'),'paranoid':![],'indexes':[{'name':_0xdc27('0xc'),'fields':[_0xdc27('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e8c=['rimraf','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3b4b45,_0x47b233){var _0x82618b=function(_0x118c4a){while(--_0x118c4a){_0x3b4b45['push'](_0x3b4b45['shift']());}};_0x82618b(++_0x47b233);}(_0x7e8c,0x165));var _0xc7e8=function(_0x471456,_0x482a71){_0x471456=_0x471456-0x0;var _0x131881=_0x7e8c[_0x471456];return _0x131881;};'use strict';var _=require(_0xc7e8('0x0'));var util=require(_0xc7e8('0x1'));var logger=require(_0xc7e8('0x2'))(_0xc7e8('0x3'));var moment=require('moment');var BPromise=require(_0xc7e8('0x4'));var rp=require(_0xc7e8('0x5'));var fs=require('fs');var path=require(_0xc7e8('0x6'));var rimraf=require(_0xc7e8('0x7'));var config=require('../../config/environment');var attributes=require(_0xc7e8('0x8'));module[_0xc7e8('0x9')]=function(_0x1bf1cb,_0x2f5eba){return _0x1bf1cb['define'](_0xc7e8('0xa'),attributes,{'tableName':_0xc7e8('0xb'),'paranoid':![],'indexes':[{'name':_0xc7e8('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 6114ec7..a3bef36 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 _0x36a4=['message','catch','WhatsappQueueReport','create','body','options','then','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x32efa6,_0x29325d){var _0x2fc291=function(_0x310549){while(--_0x310549){_0x32efa6['push'](_0x32efa6['shift']());}};_0x2fc291(++_0x29325d);}(_0x36a4,0x83));var _0x436a=function(_0x3595f9,_0x4a3bf4){_0x3595f9=_0x3595f9-0x0;var _0x3af951=_0x36a4[_0x3595f9];return _0x3af951;};'use strict';var _=require('lodash');var util=require(_0x436a('0x0'));var moment=require(_0x436a('0x1'));var BPromise=require(_0x436a('0x2'));var rs=require(_0x436a('0x3'));var fs=require('fs');var Redis=require(_0x436a('0x4'));var db=require(_0x436a('0x5'))['db'];var utils=require(_0x436a('0x6'));var logger=require(_0x436a('0x7'))(_0x436a('0x8'));var config=require('../../config/environment');var jayson=require(_0x436a('0x9'));var client=jayson['client'][_0x436a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5164b9,_0x5430a0,_0x206fdd){return new BPromise(function(_0x2152c4,_0x5bbed3){return client['request'](_0x5164b9,_0x206fdd)['then'](function(_0x5a9d41){logger[_0x436a('0xb')](_0x436a('0xc'),_0x5430a0,_0x436a('0xd'));logger[_0x436a('0xe')](_0x436a('0xf'),_0x5430a0,_0x436a('0xd'),JSON[_0x436a('0x10')](_0x5a9d41));if(_0x5a9d41[_0x436a('0x11')]){if(_0x5a9d41['error'][_0x436a('0x12')]===0x1f4){logger['error'](_0x436a('0xc'),_0x5430a0,_0x5a9d41['error']['message']);return _0x5bbed3(_0x5a9d41[_0x436a('0x11')]['message']);}logger[_0x436a('0x11')](_0x436a('0xc'),_0x5430a0,_0x5a9d41['error']['message']);return _0x2152c4(_0x5a9d41['error'][_0x436a('0x13')]);}else{logger[_0x436a('0xb')](_0x436a('0xc'),_0x5430a0,_0x436a('0xd'));_0x2152c4(_0x5a9d41['result']['message']);}})[_0x436a('0x14')](function(_0x37249b){logger[_0x436a('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5430a0,_0x37249b);_0x5bbed3(_0x37249b);});});}exports['CreateWhatsappQueueReport']=function(_0x35b132){var _0x3f642f=this;return new Promise(function(_0x36dfcc,_0x3a6478){return db[_0x436a('0x15')][_0x436a('0x16')](_0x35b132[_0x436a('0x17')],{'raw':_0x35b132[_0x436a('0x18')]?_0x35b132[_0x436a('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x436a('0x19')](function(_0x3fc6c6){logger['info'](_0x436a('0x1a'),_0x35b132);logger['debug'](_0x436a('0x1a'),_0x35b132,JSON[_0x436a('0x10')](_0x3fc6c6));_0x36dfcc(_0x3fc6c6);})[_0x436a('0x14')](function(_0x2e7348){logger['error'](_0x436a('0x1a'),_0x2e7348[_0x436a('0x13')],_0x35b132);_0x3a6478(_0x3f642f[_0x436a('0x11')](0x1f4,_0x2e7348[_0x436a('0x13')]));});});};exports[_0x436a('0x1b')]=function(_0xfa59c2){var _0x4247e1=this;return new Promise(function(_0x2168e5,_0x1806b9){return db[_0x436a('0x15')][_0x436a('0x1c')](_0xfa59c2[_0x436a('0x17')],{'raw':_0xfa59c2['options']?_0xfa59c2[_0x436a('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfa59c2[_0x436a('0x18')]?_0xfa59c2[_0x436a('0x18')]['where']||null:null,'attributes':_0xfa59c2[_0x436a('0x18')]?_0xfa59c2[_0x436a('0x18')][_0x436a('0x1d')]||null:null,'limit':_0xfa59c2['options']?_0xfa59c2[_0x436a('0x18')]['limit']||null:null})[_0x436a('0x19')](function(_0x5d8fcf){logger['info'](_0x436a('0x1b'),_0xfa59c2);logger[_0x436a('0xe')]('UpdateWhatsappQueueReport',_0xfa59c2,JSON[_0x436a('0x10')](_0x5d8fcf));_0x2168e5(_0x5d8fcf);})[_0x436a('0x14')](function(_0x4cfd3b){logger[_0x436a('0x11')](_0x436a('0x1b'),_0x4cfd3b[_0x436a('0x13')],_0xfa59c2);_0x1806b9(_0x4247e1[_0x436a('0x11')](0x1f4,_0x4cfd3b[_0x436a('0x13')]));});});}; \ No newline at end of file +var _0x4a55=['message','request\x20sent','result','catch','WhatsappQueueReport','create','body','options','raw','then','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x55f722,_0x413125){var _0x595b13=function(_0x1a0c53){while(--_0x1a0c53){_0x55f722['push'](_0x55f722['shift']());}};_0x595b13(++_0x413125);}(_0x4a55,0x1d6));var _0x54a5=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x4a55[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x54a5('0x0'));var util=require(_0x54a5('0x1'));var moment=require(_0x54a5('0x2'));var BPromise=require(_0x54a5('0x3'));var rs=require(_0x54a5('0x4'));var fs=require('fs');var Redis=require(_0x54a5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x54a5('0x6'));var logger=require(_0x54a5('0x7'))(_0x54a5('0x8'));var config=require(_0x54a5('0x9'));var jayson=require(_0x54a5('0xa'));var client=jayson[_0x54a5('0xb')][_0x54a5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4920a9,_0x48093a,_0x5124b9){return new BPromise(function(_0x24a3cb,_0x4519ad){return client[_0x54a5('0xd')](_0x4920a9,_0x5124b9)['then'](function(_0x4d5202){logger[_0x54a5('0xe')](_0x54a5('0xf'),_0x48093a,'request\x20sent');logger[_0x54a5('0x10')](_0x54a5('0x11'),_0x48093a,'request\x20sent',JSON[_0x54a5('0x12')](_0x4d5202));if(_0x4d5202[_0x54a5('0x13')]){if(_0x4d5202['error']['code']===0x1f4){logger[_0x54a5('0x13')](_0x54a5('0xf'),_0x48093a,_0x4d5202[_0x54a5('0x13')][_0x54a5('0x14')]);return _0x4519ad(_0x4d5202[_0x54a5('0x13')][_0x54a5('0x14')]);}logger[_0x54a5('0x13')](_0x54a5('0xf'),_0x48093a,_0x4d5202['error']['message']);return _0x24a3cb(_0x4d5202[_0x54a5('0x13')][_0x54a5('0x14')]);}else{logger[_0x54a5('0xe')](_0x54a5('0xf'),_0x48093a,_0x54a5('0x15'));_0x24a3cb(_0x4d5202[_0x54a5('0x16')][_0x54a5('0x14')]);}})[_0x54a5('0x17')](function(_0x10f828){logger['error'](_0x54a5('0xf'),_0x48093a,_0x10f828);_0x4519ad(_0x10f828);});});}exports['CreateWhatsappQueueReport']=function(_0x1e07d3){var _0xa54c97=this;return new Promise(function(_0x3b6423,_0x25cfd4){return db[_0x54a5('0x18')][_0x54a5('0x19')](_0x1e07d3[_0x54a5('0x1a')],{'raw':_0x1e07d3[_0x54a5('0x1b')]?_0x1e07d3['options'][_0x54a5('0x1c')]===undefined?!![]:![]:!![]})[_0x54a5('0x1d')](function(_0xabdeab){logger[_0x54a5('0xe')]('CreateWhatsappQueueReport',_0x1e07d3);logger[_0x54a5('0x10')](_0x54a5('0x1e'),_0x1e07d3,JSON[_0x54a5('0x12')](_0xabdeab));_0x3b6423(_0xabdeab);})[_0x54a5('0x17')](function(_0x4cbccc){logger[_0x54a5('0x13')](_0x54a5('0x1e'),_0x4cbccc[_0x54a5('0x14')],_0x1e07d3);_0x25cfd4(_0xa54c97['error'](0x1f4,_0x4cbccc['message']));});});};exports[_0x54a5('0x1f')]=function(_0x276ddd){var _0x7d388c=this;return new Promise(function(_0x3a4489,_0x591190){return db[_0x54a5('0x18')][_0x54a5('0x20')](_0x276ddd[_0x54a5('0x1a')],{'raw':_0x276ddd['options']?_0x276ddd[_0x54a5('0x1b')][_0x54a5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x276ddd[_0x54a5('0x1b')]?_0x276ddd[_0x54a5('0x1b')][_0x54a5('0x21')]||null:null,'attributes':_0x276ddd[_0x54a5('0x1b')]?_0x276ddd[_0x54a5('0x1b')]['attributes']||null:null,'limit':_0x276ddd[_0x54a5('0x1b')]?_0x276ddd[_0x54a5('0x1b')][_0x54a5('0x22')]||null:null})['then'](function(_0x28234d){logger['info'](_0x54a5('0x1f'),_0x276ddd);logger[_0x54a5('0x10')](_0x54a5('0x1f'),_0x276ddd,JSON[_0x54a5('0x12')](_0x28234d));_0x3a4489(_0x28234d);})[_0x54a5('0x17')](function(_0x2baddd){logger[_0x54a5('0x13')]('UpdateWhatsappQueueReport',_0x2baddd['message'],_0x276ddd);_0x591190(_0x7d388c[_0x54a5('0x13')](0x1f4,_0x2baddd['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 22197ad..0b71ced 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 _0x6e76=['create','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x1ec24,_0x2ea0a7){var _0x4a7c18=function(_0x47a473){while(--_0x47a473){_0x1ec24['push'](_0x1ec24['shift']());}};_0x4a7c18(++_0x2ea0a7);}(_0x6e76,0x84));var _0x66e7=function(_0x46de20,_0x17f159){_0x46de20=_0x46de20-0x0;var _0x427294=_0x6e76[_0x46de20];return _0x427294;};'use strict';var multer=require('multer');var util=require(_0x66e7('0x0'));var path=require('path');var timeout=require(_0x66e7('0x1'));var express=require(_0x66e7('0x2'));var router=express['Router']();var fs_extra=require(_0x66e7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x66e7('0x4'));var config=require(_0x66e7('0x5'));var controller=require(_0x66e7('0x6'));router[_0x66e7('0x7')]('/',auth[_0x66e7('0x8')](),controller[_0x66e7('0x9')]);router[_0x66e7('0x7')](_0x66e7('0xa'),auth['isAuthenticated'](),controller[_0x66e7('0xb')]);router[_0x66e7('0x7')](_0x66e7('0xc'),auth[_0x66e7('0x8')](),controller[_0x66e7('0xd')]);router[_0x66e7('0xe')]('/',auth[_0x66e7('0x8')](),controller[_0x66e7('0xf')]);router[_0x66e7('0x10')](_0x66e7('0xc'),auth[_0x66e7('0x8')](),controller[_0x66e7('0x11')]);router[_0x66e7('0x12')](_0x66e7('0xc'),auth[_0x66e7('0x8')](),controller[_0x66e7('0x13')]);module[_0x66e7('0x14')]=router; \ No newline at end of file +var _0x3cc4=['express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3cc4,0x1eb));var _0x43cc=function(_0xdf117,_0x26f037){_0xdf117=_0xdf117-0x0;var _0x3a93bf=_0x3cc4[_0xdf117];return _0x3a93bf;};'use strict';var multer=require('multer');var util=require(_0x43cc('0x0'));var path=require(_0x43cc('0x1'));var timeout=require(_0x43cc('0x2'));var express=require(_0x43cc('0x3'));var router=express[_0x43cc('0x4')]();var fs_extra=require(_0x43cc('0x5'));var auth=require(_0x43cc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0x43cc('0x7')]('/',auth[_0x43cc('0x8')](),controller['index']);router[_0x43cc('0x7')](_0x43cc('0x9'),auth[_0x43cc('0x8')](),controller['describe']);router[_0x43cc('0x7')]('/:id',auth[_0x43cc('0x8')](),controller[_0x43cc('0xa')]);router[_0x43cc('0xb')]('/',auth[_0x43cc('0x8')](),controller[_0x43cc('0xc')]);router[_0x43cc('0xd')](_0x43cc('0xe'),auth[_0x43cc('0x8')](),controller[_0x43cc('0xf')]);router[_0x43cc('0x10')](_0x43cc('0xe'),auth['isAuthenticated'](),controller[_0x43cc('0x11')]);module[_0x43cc('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 1b4c00f..1fb3282 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 _0x5f66=['queue','DATE','exports','ENUM','account','agent'];(function(_0x320b8e,_0x1da3fe){var _0x55a10a=function(_0x148a56){while(--_0x148a56){_0x320b8e['push'](_0x320b8e['shift']());}};_0x55a10a(++_0x1da3fe);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x65f6('0x1')](_0x65f6('0x2'),_0x65f6('0x3'),_0x65f6('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x65f6('0x5')]}}; \ No newline at end of file +var _0xbaf0=['ENUM','account','agent','queue','exports','STRING'];(function(_0x233c20,_0x39082d){var _0x296971=function(_0x54aab3){while(--_0x54aab3){_0x233c20['push'](_0x233c20['shift']());}};_0x296971(++_0x39082d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'uniqueid':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0baf('0x2')](_0x0baf('0x3'),_0x0baf('0x4'),_0x0baf('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index cf4e3ca..bfdbb6e 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 _0xc914=['key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','then','destroy','name','send','index','map','WhatsappTransferReport','rawAttributes','type'];(function(_0x5cc1ed,_0x6a43c1){var _0x3c6695=function(_0x2f937c){while(--_0x2f937c){_0x5cc1ed['push'](_0x5cc1ed['shift']());}};_0x3c6695(++_0x6a43c1);}(_0xc914,0xf3));var _0x4c91=function(_0x5af38a,_0x45032b){_0x5af38a=_0x5af38a-0x0;var _0xdc751a=_0xc914[_0x5af38a];return _0xdc751a;};'use strict';var emlformat=require(_0x4c91('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c91('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4c91('0x2'));var BPromise=require(_0x4c91('0x3'));var Mustache=require('mustache');var util=require(_0x4c91('0x4'));var path=require('path');var sox=require(_0x4c91('0x5'));var csv=require(_0x4c91('0x6'));var ejs=require(_0x4c91('0x7'));var fs=require('fs');var fs_extra=require(_0x4c91('0x8'));var _=require('lodash');var squel=require(_0x4c91('0x9'));var crypto=require(_0x4c91('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4c91('0x6'));var querystring=require(_0x4c91('0xb'));var Papa=require(_0x4c91('0xc'));var Redis=require(_0x4c91('0xd'));var authService=require(_0x4c91('0xe'));var qs=require(_0x4c91('0xf'));var as=require(_0x4c91('0x10'));var hardwareService=require(_0x4c91('0x11'));var logger=require(_0x4c91('0x12'))(_0x4c91('0x13'));var utils=require(_0x4c91('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4c91('0x15'))['db'];function respondWithStatusCode(_0x182fba,_0x3ce3c8){_0x3ce3c8=_0x3ce3c8||0xcc;return function(_0x1e19ae){if(_0x1e19ae){return _0x182fba[_0x4c91('0x16')](_0x3ce3c8);}return _0x182fba[_0x4c91('0x17')](_0x3ce3c8)[_0x4c91('0x18')]();};}function respondWithResult(_0x2f0355,_0xb39c83){_0xb39c83=_0xb39c83||0xc8;return function(_0x11dc6c){if(_0x11dc6c){return _0x2f0355[_0x4c91('0x17')](_0xb39c83)[_0x4c91('0x19')](_0x11dc6c);}};}function respondWithFilteredResult(_0x3242a2,_0x5ca434){return function(_0x3beb07){if(_0x3beb07){var _0x3e01f2=_0x3beb07[_0x4c91('0x1a')],_0x41bf24=_0x5ca434[_0x4c91('0x1b')],_0x4085d0=_0x5ca434[_0x4c91('0x1b')]+_0x5ca434['limit'],_0x1ea140;if(_0x4085d0>=_0x3e01f2){_0x4085d0=_0x3e01f2;_0x1ea140=0xc8;}else{_0x1ea140=0xce;}_0x3242a2['status'](_0x1ea140);return _0x3242a2[_0x4c91('0x1c')](_0x4c91('0x1d'),_0x41bf24+'-'+_0x4085d0+'/'+_0x3e01f2)['json'](_0x3beb07);}return null;};}function patchUpdates(_0x5f0d82){return function(_0x2b80ed){try{jsonpatch['apply'](_0x2b80ed,_0x5f0d82,!![]);}catch(_0x31988b){return BPromise[_0x4c91('0x1e')](_0x31988b);}return _0x2b80ed[_0x4c91('0x1f')]();};}function saveUpdates(_0x56a866,_0x179fe3){return function(_0x4f03d0){if(_0x4f03d0){return _0x4f03d0['update'](_0x56a866)[_0x4c91('0x20')](function(_0x1ff482){return _0x1ff482;});}return null;};}function removeEntity(_0x31af18,_0x2eb72a){return function(_0x342599){if(_0x342599){return _0x342599[_0x4c91('0x21')]()[_0x4c91('0x20')](function(){_0x31af18[_0x4c91('0x17')](0xcc)[_0x4c91('0x18')]();});}};}function handleEntityNotFound(_0x1e4949,_0x1ac930){return function(_0x5114e6){if(!_0x5114e6){_0x1e4949[_0x4c91('0x16')](0x194);}return _0x5114e6;};}function handleError(_0x257cf7,_0x498b70){_0x498b70=_0x498b70||0x1f4;return function(_0x230407){logger['error'](_0x230407['stack']);if(_0x230407[_0x4c91('0x22')]){delete _0x230407[_0x4c91('0x22')];}_0x257cf7['status'](_0x498b70)[_0x4c91('0x23')](_0x230407);};}exports[_0x4c91('0x24')]=function(_0x56bd41,_0x55adc4){var _0x116a52={},_0x34e327={},_0x413633={'count':0x0,'rows':[]};var _0x1d3ed5=_[_0x4c91('0x25')](db[_0x4c91('0x26')][_0x4c91('0x27')],function(_0x2c24a7){return{'name':_0x2c24a7['fieldName'],'type':_0x2c24a7[_0x4c91('0x28')][_0x4c91('0x29')]};});_0x34e327[_0x4c91('0x2a')]=_[_0x4c91('0x25')](_0x1d3ed5,_0x4c91('0x22'));_0x34e327[_0x4c91('0x2b')]=_[_0x4c91('0x2c')](_0x56bd41['query']);_0x34e327[_0x4c91('0x2d')]=_[_0x4c91('0x2e')](_0x34e327[_0x4c91('0x2a')],_0x34e327[_0x4c91('0x2b')]);_0x116a52['attributes']=_['intersection'](_0x34e327['model'],qs[_0x4c91('0x2f')](_0x56bd41[_0x4c91('0x2b')][_0x4c91('0x2f')]));_0x116a52[_0x4c91('0x30')]=_0x116a52[_0x4c91('0x30')][_0x4c91('0x31')]?_0x116a52[_0x4c91('0x30')]:_0x34e327['model'];if(!_0x56bd41[_0x4c91('0x2b')]['hasOwnProperty'](_0x4c91('0x32'))){_0x116a52[_0x4c91('0x33')]=qs[_0x4c91('0x33')](_0x56bd41[_0x4c91('0x2b')][_0x4c91('0x33')]);_0x116a52[_0x4c91('0x1b')]=qs[_0x4c91('0x1b')](_0x56bd41['query'][_0x4c91('0x1b')]);}_0x116a52[_0x4c91('0x34')]=qs[_0x4c91('0x35')](_0x56bd41[_0x4c91('0x2b')][_0x4c91('0x35')]);_0x116a52[_0x4c91('0x36')]=qs[_0x4c91('0x2d')](_['pick'](_0x56bd41[_0x4c91('0x2b')],_0x34e327[_0x4c91('0x2d')]),_0x1d3ed5);if(_0x56bd41[_0x4c91('0x2b')][_0x4c91('0x37')]){_0x116a52[_0x4c91('0x36')]=_[_0x4c91('0x38')](_0x116a52[_0x4c91('0x36')],{'$or':_['map'](_0x1d3ed5,function(_0xe9cb38){if(_0xe9cb38[_0x4c91('0x28')]!==_0x4c91('0x39')){var _0x15dd4a={};_0x15dd4a[_0xe9cb38[_0x4c91('0x22')]]={'$like':'%'+_0x56bd41['query'][_0x4c91('0x37')]+'%'};return _0x15dd4a;}})});}_0x116a52=_[_0x4c91('0x38')]({},_0x116a52,_0x56bd41[_0x4c91('0x3a')]);var _0x5c41fe={'where':_0x116a52[_0x4c91('0x36')]};return db[_0x4c91('0x26')][_0x4c91('0x1a')](_0x5c41fe)['then'](function(_0x442104){_0x413633[_0x4c91('0x1a')]=_0x442104;if(_0x56bd41[_0x4c91('0x2b')][_0x4c91('0x3b')]){_0x116a52[_0x4c91('0x3c')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x4c91('0x3d')](_0x116a52);})[_0x4c91('0x20')](function(_0x384a8e){_0x413633[_0x4c91('0x3e')]=_0x384a8e;return _0x413633;})[_0x4c91('0x20')](respondWithFilteredResult(_0x55adc4,_0x116a52))[_0x4c91('0x3f')](handleError(_0x55adc4,null));};exports[_0x4c91('0x40')]=function(_0x1b4335,_0x45234a){var _0x536d4c={'raw':!![],'where':{'id':_0x1b4335[_0x4c91('0x41')]['id']}},_0x28dc08={};_0x28dc08[_0x4c91('0x2a')]=_['keys'](db['WhatsappTransferReport'][_0x4c91('0x27')]);_0x28dc08[_0x4c91('0x2b')]=_[_0x4c91('0x2c')](_0x1b4335['query']);_0x28dc08[_0x4c91('0x2d')]=_[_0x4c91('0x2e')](_0x28dc08['model'],_0x28dc08[_0x4c91('0x2b')]);_0x536d4c[_0x4c91('0x30')]=_[_0x4c91('0x2e')](_0x28dc08[_0x4c91('0x2a')],qs[_0x4c91('0x2f')](_0x1b4335['query'][_0x4c91('0x2f')]));_0x536d4c[_0x4c91('0x30')]=_0x536d4c['attributes'][_0x4c91('0x31')]?_0x536d4c[_0x4c91('0x30')]:_0x28dc08['model'];if(_0x1b4335[_0x4c91('0x2b')][_0x4c91('0x3b')]){_0x536d4c[_0x4c91('0x3c')]=[{'all':!![]}];}_0x536d4c=_[_0x4c91('0x38')]({},_0x536d4c,_0x1b4335['options']);return db['WhatsappTransferReport'][_0x4c91('0x42')](_0x536d4c)[_0x4c91('0x20')](handleEntityNotFound(_0x45234a,null))[_0x4c91('0x20')](respondWithResult(_0x45234a,null))[_0x4c91('0x3f')](handleError(_0x45234a,null));};exports[_0x4c91('0x43')]=function(_0x26a7ff,_0x41151a){return db[_0x4c91('0x26')][_0x4c91('0x43')](_0x26a7ff[_0x4c91('0x44')],{})[_0x4c91('0x20')](respondWithResult(_0x41151a,0xc9))[_0x4c91('0x3f')](handleError(_0x41151a,null));};exports[_0x4c91('0x45')]=function(_0x3b3396,_0x5db904){if(_0x3b3396[_0x4c91('0x44')]['id']){delete _0x3b3396[_0x4c91('0x44')]['id'];}return db[_0x4c91('0x26')][_0x4c91('0x42')]({'where':{'id':_0x3b3396[_0x4c91('0x41')]['id']}})['then'](handleEntityNotFound(_0x5db904,null))[_0x4c91('0x20')](saveUpdates(_0x3b3396['body'],null))[_0x4c91('0x20')](respondWithResult(_0x5db904,null))[_0x4c91('0x3f')](handleError(_0x5db904,null));};exports[_0x4c91('0x21')]=function(_0x2374dd,_0xb69be5){return db[_0x4c91('0x26')][_0x4c91('0x42')]({'where':{'id':_0x2374dd[_0x4c91('0x41')]['id']}})['then'](handleEntityNotFound(_0xb69be5,null))[_0x4c91('0x20')](removeEntity(_0xb69be5,null))['catch'](handleError(_0xb69be5,null));};exports[_0x4c91('0x46')]=function(_0x216d00,_0x53079b){return db['WhatsappTransferReport'][_0x4c91('0x46')]()[_0x4c91('0x20')](respondWithResult(_0x53079b,null))[_0x4c91('0x3f')](handleError(_0x53079b,null));}; \ No newline at end of file +var _0xd18e=['then','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','keys','includeAll','find','catch','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','save'];(function(_0x520866,_0x3af494){var _0x2e5dbe=function(_0x502742){while(--_0x502742){_0x520866['push'](_0x520866['shift']());}};_0x2e5dbe(++_0x3af494);}(_0xd18e,0xba));var _0xed18=function(_0x8688f3,_0x5cfce8){_0x8688f3=_0x8688f3-0x0;var _0x57c1d4=_0xd18e[_0x8688f3];return _0x57c1d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed18('0x0'));var zipdir=require(_0xed18('0x1'));var jsonpatch=require(_0xed18('0x2'));var rp=require(_0xed18('0x3'));var moment=require(_0xed18('0x4'));var BPromise=require(_0xed18('0x5'));var Mustache=require(_0xed18('0x6'));var util=require(_0xed18('0x7'));var path=require(_0xed18('0x8'));var sox=require(_0xed18('0x9'));var csv=require(_0xed18('0xa'));var ejs=require(_0xed18('0xb'));var fs=require('fs');var fs_extra=require(_0xed18('0xc'));var _=require('lodash');var squel=require(_0xed18('0xd'));var crypto=require(_0xed18('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xed18('0xf'));var toCsv=require(_0xed18('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xed18('0x10'));var authService=require(_0xed18('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xed18('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed18('0x13'))(_0xed18('0x14'));var utils=require(_0xed18('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xed18('0x16'))['db'];function respondWithStatusCode(_0x40a4f4,_0x1035a0){_0x1035a0=_0x1035a0||0xcc;return function(_0x4bd0c3){if(_0x4bd0c3){return _0x40a4f4['sendStatus'](_0x1035a0);}return _0x40a4f4[_0xed18('0x17')](_0x1035a0)[_0xed18('0x18')]();};}function respondWithResult(_0x37bde7,_0x4bc1cd){_0x4bc1cd=_0x4bc1cd||0xc8;return function(_0xecdf49){if(_0xecdf49){return _0x37bde7[_0xed18('0x17')](_0x4bc1cd)[_0xed18('0x19')](_0xecdf49);}};}function respondWithFilteredResult(_0xf01fb7,_0x56780b){return function(_0x3aa260){if(_0x3aa260){var _0x44dcd3=_0x3aa260[_0xed18('0x1a')],_0x78ef12=_0x56780b[_0xed18('0x1b')],_0x2f3e31=_0x56780b[_0xed18('0x1b')]+_0x56780b[_0xed18('0x1c')],_0xebcabe;if(_0x2f3e31>=_0x44dcd3){_0x2f3e31=_0x44dcd3;_0xebcabe=0xc8;}else{_0xebcabe=0xce;}_0xf01fb7[_0xed18('0x17')](_0xebcabe);return _0xf01fb7[_0xed18('0x1d')](_0xed18('0x1e'),_0x78ef12+'-'+_0x2f3e31+'/'+_0x44dcd3)['json'](_0x3aa260);}return null;};}function patchUpdates(_0x53621f){return function(_0x2fbdef){try{jsonpatch[_0xed18('0x1f')](_0x2fbdef,_0x53621f,!![]);}catch(_0x1f9cd0){return BPromise['reject'](_0x1f9cd0);}return _0x2fbdef[_0xed18('0x20')]();};}function saveUpdates(_0x4ccb3b,_0x1523a5){return function(_0x5736b7){if(_0x5736b7){return _0x5736b7['update'](_0x4ccb3b)[_0xed18('0x21')](function(_0x350dd7){return _0x350dd7;});}return null;};}function removeEntity(_0xa9b35b,_0x4ebb34){return function(_0xeb6e20){if(_0xeb6e20){return _0xeb6e20['destroy']()[_0xed18('0x21')](function(){_0xa9b35b[_0xed18('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ce455,_0x134ba7){return function(_0x2d708b){if(!_0x2d708b){_0x5ce455['sendStatus'](0x194);}return _0x2d708b;};}function handleError(_0x1abf41,_0x406512){_0x406512=_0x406512||0x1f4;return function(_0x6063ff){logger[_0xed18('0x22')](_0x6063ff[_0xed18('0x23')]);if(_0x6063ff[_0xed18('0x24')]){delete _0x6063ff['name'];}_0x1abf41[_0xed18('0x17')](_0x406512)[_0xed18('0x25')](_0x6063ff);};}exports[_0xed18('0x26')]=function(_0xf6750c,_0xbd72dd){var _0x493405={},_0x299493={},_0x40dc76={'count':0x0,'rows':[]};var _0x7ab4b0=_[_0xed18('0x27')](db[_0xed18('0x28')][_0xed18('0x29')],function(_0x2a116d){return{'name':_0x2a116d[_0xed18('0x2a')],'type':_0x2a116d[_0xed18('0x2b')][_0xed18('0x2c')]};});_0x299493[_0xed18('0x2d')]=_[_0xed18('0x27')](_0x7ab4b0,_0xed18('0x24'));_0x299493[_0xed18('0x2e')]=_['keys'](_0xf6750c[_0xed18('0x2e')]);_0x299493[_0xed18('0x2f')]=_[_0xed18('0x30')](_0x299493[_0xed18('0x2d')],_0x299493[_0xed18('0x2e')]);_0x493405[_0xed18('0x31')]=_[_0xed18('0x30')](_0x299493[_0xed18('0x2d')],qs[_0xed18('0x32')](_0xf6750c[_0xed18('0x2e')][_0xed18('0x32')]));_0x493405[_0xed18('0x31')]=_0x493405[_0xed18('0x31')][_0xed18('0x33')]?_0x493405['attributes']:_0x299493['model'];if(!_0xf6750c[_0xed18('0x2e')][_0xed18('0x34')](_0xed18('0x35'))){_0x493405[_0xed18('0x1c')]=qs['limit'](_0xf6750c[_0xed18('0x2e')][_0xed18('0x1c')]);_0x493405[_0xed18('0x1b')]=qs[_0xed18('0x1b')](_0xf6750c['query'][_0xed18('0x1b')]);}_0x493405['order']=qs[_0xed18('0x36')](_0xf6750c[_0xed18('0x2e')][_0xed18('0x36')]);_0x493405[_0xed18('0x37')]=qs[_0xed18('0x2f')](_[_0xed18('0x38')](_0xf6750c[_0xed18('0x2e')],_0x299493[_0xed18('0x2f')]),_0x7ab4b0);if(_0xf6750c[_0xed18('0x2e')][_0xed18('0x39')]){_0x493405['where']=_[_0xed18('0x3a')](_0x493405['where'],{'$or':_[_0xed18('0x27')](_0x7ab4b0,function(_0x12944f){if(_0x12944f['type']!==_0xed18('0x3b')){var _0x93ce3b={};_0x93ce3b[_0x12944f[_0xed18('0x24')]]={'$like':'%'+_0xf6750c['query']['filter']+'%'};return _0x93ce3b;}})});}_0x493405=_[_0xed18('0x3a')]({},_0x493405,_0xf6750c[_0xed18('0x3c')]);var _0x2340ba={'where':_0x493405['where']};return db[_0xed18('0x28')][_0xed18('0x1a')](_0x2340ba)[_0xed18('0x21')](function(_0xe28509){_0x40dc76[_0xed18('0x1a')]=_0xe28509;if(_0xf6750c['query']['includeAll']){_0x493405[_0xed18('0x3d')]=[{'all':!![]}];}return db[_0xed18('0x28')]['findAll'](_0x493405);})[_0xed18('0x21')](function(_0x1415fc){_0x40dc76[_0xed18('0x3e')]=_0x1415fc;return _0x40dc76;})[_0xed18('0x21')](respondWithFilteredResult(_0xbd72dd,_0x493405))['catch'](handleError(_0xbd72dd,null));};exports[_0xed18('0x3f')]=function(_0x8fb2fe,_0x1c7eb4){var _0x53bf54={'raw':!![],'where':{'id':_0x8fb2fe[_0xed18('0x40')]['id']}},_0x38ece1={};_0x38ece1[_0xed18('0x2d')]=_[_0xed18('0x41')](db[_0xed18('0x28')][_0xed18('0x29')]);_0x38ece1[_0xed18('0x2e')]=_['keys'](_0x8fb2fe[_0xed18('0x2e')]);_0x38ece1[_0xed18('0x2f')]=_[_0xed18('0x30')](_0x38ece1[_0xed18('0x2d')],_0x38ece1['query']);_0x53bf54[_0xed18('0x31')]=_['intersection'](_0x38ece1[_0xed18('0x2d')],qs[_0xed18('0x32')](_0x8fb2fe[_0xed18('0x2e')][_0xed18('0x32')]));_0x53bf54[_0xed18('0x31')]=_0x53bf54[_0xed18('0x31')][_0xed18('0x33')]?_0x53bf54[_0xed18('0x31')]:_0x38ece1['model'];if(_0x8fb2fe['query'][_0xed18('0x42')]){_0x53bf54[_0xed18('0x3d')]=[{'all':!![]}];}_0x53bf54=_[_0xed18('0x3a')]({},_0x53bf54,_0x8fb2fe[_0xed18('0x3c')]);return db[_0xed18('0x28')][_0xed18('0x43')](_0x53bf54)['then'](handleEntityNotFound(_0x1c7eb4,null))[_0xed18('0x21')](respondWithResult(_0x1c7eb4,null))[_0xed18('0x44')](handleError(_0x1c7eb4,null));};exports[_0xed18('0x45')]=function(_0x3935a5,_0x268b05){return db[_0xed18('0x28')][_0xed18('0x45')](_0x3935a5[_0xed18('0x46')],{})['then'](respondWithResult(_0x268b05,0xc9))['catch'](handleError(_0x268b05,null));};exports[_0xed18('0x47')]=function(_0xe3b1e5,_0x5d99df){if(_0xe3b1e5['body']['id']){delete _0xe3b1e5[_0xed18('0x46')]['id'];}return db[_0xed18('0x28')][_0xed18('0x43')]({'where':{'id':_0xe3b1e5['params']['id']}})['then'](handleEntityNotFound(_0x5d99df,null))[_0xed18('0x21')](saveUpdates(_0xe3b1e5[_0xed18('0x46')],null))[_0xed18('0x21')](respondWithResult(_0x5d99df,null))['catch'](handleError(_0x5d99df,null));};exports['destroy']=function(_0x2fcddf,_0x2eb331){return db[_0xed18('0x28')][_0xed18('0x43')]({'where':{'id':_0x2fcddf[_0xed18('0x40')]['id']}})[_0xed18('0x21')](handleEntityNotFound(_0x2eb331,null))[_0xed18('0x21')](removeEntity(_0x2eb331,null))['catch'](handleError(_0x2eb331,null));};exports[_0xed18('0x48')]=function(_0x238361,_0x319788){return db[_0xed18('0x28')]['describe']()['then'](respondWithResult(_0x319788,null))[_0xed18('0x44')](handleError(_0x319788,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 9edb6e0..a162141 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 _0xfaf7=['path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','moment'];(function(_0x40d0e7,_0x4b093c){var _0x4f9bc2=function(_0x381ef1){while(--_0x381ef1){_0x40d0e7['push'](_0x40d0e7['shift']());}};_0x4f9bc2(++_0x4b093c);}(_0xfaf7,0x13c));var _0x7faf=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xfaf7[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x7faf('0x0'));var util=require(_0x7faf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7faf('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7faf('0x3'));var rimraf=require(_0x7faf('0x4'));var config=require(_0x7faf('0x5'));var attributes=require(_0x7faf('0x6'));module[_0x7faf('0x7')]=function(_0x2f1608,_0x1efab5){return _0x2f1608['define'](_0x7faf('0x8'),attributes,{'tableName':_0x7faf('0x9'),'paranoid':![],'indexes':[{'name':_0x7faf('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6636=['../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5608df,_0xff2326){var _0x4c2e63=function(_0xec1440){while(--_0xec1440){_0x5608df['push'](_0x5608df['shift']());}};_0x4c2e63(++_0xff2326);}(_0x6636,0x12c));var _0x6663=function(_0x32b537,_0x13ada1){_0x32b537=_0x32b537-0x0;var _0x3f8389=_0x6636[_0x32b537];return _0x3f8389;};'use strict';var _=require(_0x6663('0x0'));var util=require(_0x6663('0x1'));var logger=require(_0x6663('0x2'))('api');var moment=require(_0x6663('0x3'));var BPromise=require(_0x6663('0x4'));var rp=require(_0x6663('0x5'));var fs=require('fs');var path=require(_0x6663('0x6'));var rimraf=require(_0x6663('0x7'));var config=require(_0x6663('0x8'));var attributes=require(_0x6663('0x9'));module[_0x6663('0xa')]=function(_0x4dc97e,_0x24e2ff){return _0x4dc97e[_0x6663('0xb')](_0x6663('0xc'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6663('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 32ebf51..15d6fa1 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 _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0x4738f6,_0x227333){var _0x5810cd=function(_0x4245cb){while(--_0x4245cb){_0x4738f6['push'](_0x4738f6['shift']());}};_0x5810cd(++_0x227333);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0x21e73c,_0x17d3e9){var _0x3ec083=function(_0x4b6efd){while(--_0x4b6efd){_0x21e73c['push'](_0x21e73c['shift']());}};_0x3ec083(++_0x17d3e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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/app.js b/server/app.js index 34e3013..71a21b9 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8921=['./config/seedDB','default','./config/license','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','listen','then','info','start','map','filter','online','join','Offline\x20apps:','status','name','None','seedDB'];(function(_0x43925d,_0x1989f5){var _0x3eb401=function(_0x48ddbe){while(--_0x48ddbe){_0x43925d['push'](_0x43925d['shift']());}};_0x3eb401(++_0x1989f5);}(_0x8921,0x9a));var _0x1892=function(_0x15bcc8,_0x1e3618){_0x15bcc8=_0x15bcc8-0x0;var _0x34d8e8=_0x8921[_0x15bcc8];return _0x34d8e8;};'use strict';var _=require(_0x1892('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x1892('0x1'));var config=require(_0x1892('0x2'));var logger=require(_0x1892('0x3'))(_0x1892('0x4'));var pm2=require(_0x1892('0x5'));var pm2Config=require(_0x1892('0x6'));var schedule=require(_0x1892('0x7'));var chat=require(_0x1892('0x8'));var whatsapp=require(_0x1892('0x9'));var transcribe=require(_0x1892('0xa'));function main(){return mysqldb['db'][_0x1892('0xb')][_0x1892('0xc')]()['then'](function(){return rpc[_0x1892('0xd')]();})[_0x1892('0xe')](function(_0x2db820){logger[_0x1892('0xf')](_0x2db820);return chat[_0x1892('0x10')]();})[_0x1892('0xe')](function(){return whatsapp['start']();})[_0x1892('0xe')](function(){return schedule[_0x1892('0x10')]();})[_0x1892('0xe')](function(){return transcribe[_0x1892('0x10')]();})[_0x1892('0xe')](function(_0x1af810){logger[_0x1892('0xf')](_0x1af810);return pm2[_0x1892('0x10')](pm2Config);})[_0x1892('0xe')](function(_0x22baab){logger[_0x1892('0xf')]('Online\x20apps:',_[_0x1892('0x11')](_[_0x1892('0x12')](_0x22baab,{'status':_0x1892('0x13')}),'name')[_0x1892('0x14')]());logger[_0x1892('0xf')](_0x1892('0x15'),_[_0x1892('0x11')](_['filter'](_0x22baab,function(_0x5e436d){return _0x5e436d[_0x1892('0x16')]!=='online';}),_0x1892('0x17'))['join']()||_0x1892('0x18'));config[_0x1892('0x19')]&&require(_0x1892('0x1a'))[_0x1892('0x1b')]();require(_0x1892('0x1c'))['default']();})['catch'](function(_0x349b58){logger['error'](_0x1892('0x1d'),_0x349b58);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xfef9=['./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','info','start','map','filter','online','join','Offline\x20apps:','status','name','None','seedDB','./config/seedDB','default','./config/license','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/environment','./config/logger','./config/pm2'];(function(_0x19684e,_0xcd7fba){var _0xb71480=function(_0x1f97e7){while(--_0x1f97e7){_0x19684e['push'](_0x19684e['shift']());}};_0xb71480(++_0xcd7fba);}(_0xfef9,0xd3));var _0x9fef=function(_0x24b773,_0x392c26){_0x24b773=_0x24b773-0x0;var _0x35f6c9=_0xfef9[_0x24b773];return _0x35f6c9;};'use strict';var _=require(_0x9fef('0x0'));var mysqldb=require(_0x9fef('0x1'));var rpc=require('./rpc');var config=require(_0x9fef('0x2'));var logger=require(_0x9fef('0x3'))('app');var pm2=require(_0x9fef('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x9fef('0x5'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x9fef('0x6'));var transcribe=require(_0x9fef('0x7'));function main(){return mysqldb['db']['sequelize'][_0x9fef('0x8')]()[_0x9fef('0x9')](function(){return rpc['listen']();})[_0x9fef('0x9')](function(_0x2d990b){logger[_0x9fef('0xa')](_0x2d990b);return chat['start']();})[_0x9fef('0x9')](function(){return whatsapp[_0x9fef('0xb')]();})[_0x9fef('0x9')](function(){return schedule['start']();})[_0x9fef('0x9')](function(){return transcribe['start']();})[_0x9fef('0x9')](function(_0x34442f){logger[_0x9fef('0xa')](_0x34442f);return pm2[_0x9fef('0xb')](pm2Config);})[_0x9fef('0x9')](function(_0x2213a7){logger[_0x9fef('0xa')]('Online\x20apps:',_[_0x9fef('0xc')](_[_0x9fef('0xd')](_0x2213a7,{'status':_0x9fef('0xe')}),'name')[_0x9fef('0xf')]());logger[_0x9fef('0xa')](_0x9fef('0x10'),_[_0x9fef('0xc')](_[_0x9fef('0xd')](_0x2213a7,function(_0x548b02){return _0x548b02[_0x9fef('0x11')]!=='online';}),_0x9fef('0x12'))['join']()||_0x9fef('0x13'));config[_0x9fef('0x14')]&&require(_0x9fef('0x15'))[_0x9fef('0x16')]();require(_0x9fef('0x17'))[_0x9fef('0x16')]();})['catch'](function(_0xa54b46){logger[_0x9fef('0x18')](_0x9fef('0x19'),_0xa54b46);process[_0x9fef('0x1a')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 5ef446d..9379eef 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 _0xa9fc=['catch','headers','authorization','startsWith','User','find','pass','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','Setting','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','payload','options','secrets','toString','hex','now','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','composable-middleware','basic-auth','moment','session','role','fullname','name','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarExpires','phoneBarRemoteControlPort','hotdesk','userProfileId','settingsEnabled','isAuthenticated','use','ChatInteraction','params','closed','disposition','then','status','unmanaged','json','Forbidden.'];(function(_0x3d8bff,_0x1c7272){var _0x50ddf6=function(_0x176ebe){while(--_0x176ebe){_0x3d8bff['push'](_0x3d8bff['shift']());}};_0x50ddf6(++_0x1c7272);}(_0xa9fc,0x19f));var _0xca9f=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xa9fc[_0xd09668];return _0x68726;};'use strict';var db=require(_0xca9f('0x0'))['db'];var config=require(_0xca9f('0x1'));var hardwareConf=require(_0xca9f('0x2'));var licenseUtil=require(_0xca9f('0x3'));var encryptor=require(_0xca9f('0x4'));var _=require('lodash');var jwt=require(_0xca9f('0x5'));var expressJwt=require('express-jwt');var compose=require(_0xca9f('0x6'));var basicAuth=require(_0xca9f('0x7'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require('util');var moment=require(_0xca9f('0x8'));var validateJwt=expressJwt({'secret':config['secrets'][_0xca9f('0x9')]});var userAttributes=['id',_0xca9f('0xa'),_0xca9f('0xb'),_0xca9f('0xc'),_0xca9f('0xd'),_0xca9f('0xe'),_0xca9f('0xf'),_0xca9f('0x10'),'md5secret',_0xca9f('0x11'),_0xca9f('0x12'),_0xca9f('0x13'),_0xca9f('0x14'),'smsPause',_0xca9f('0x15'),_0xca9f('0x16'),'showWebBar',_0xca9f('0x17'),_0xca9f('0x18'),_0xca9f('0x19'),_0xca9f('0x1a'),_0xca9f('0x1b'),_0xca9f('0x1c'),_0xca9f('0x1d'),_0xca9f('0x1e'),_0xca9f('0x1f'),_0xca9f('0x20'),'phoneBarEnableDtmfTone','phoneBarEnableSettings',_0xca9f('0x21'),'phoneBarPrefixRequired','phoneBarRemoteControl',_0xca9f('0x22'),_0xca9f('0x23'),'interface',_0xca9f('0x24'),'privacyEnabled',_0xca9f('0x25')];exports['isChatInteractionAuthorized']=function(){return this[_0xca9f('0x26')](!![])[_0xca9f('0x27')](function(_0x1543aa,_0x83aa2b,_0x25008f){if(_0x1543aa['user']){_0x25008f();}else{return db[_0xca9f('0x28')]['findOne']({'where':{'id':_0x1543aa[_0xca9f('0x29')]['id']},'attributes':['id',_0xca9f('0x2a'),_0xca9f('0x2b')],'raw':!![]})[_0xca9f('0x2c')](function(_0x132663){if(_0x132663&&_0x132663['closed']){return _0x83aa2b[_0xca9f('0x2d')](_0x132663[_0xca9f('0x2b')]===_0xca9f('0x2e')?0x195:0x193)[_0xca9f('0x2f')]({'message':_0x132663[_0xca9f('0x2b')]==='unmanaged'?'Unmanaged.':_0xca9f('0x30')});}else{_0x25008f();}})[_0xca9f('0x31')](function(_0x162328){_0x25008f(_0x162328);});}});};exports[_0xca9f('0x26')]=function isAuthenticated(_0x319b3b){return compose()['use'](function(_0x40ef71,_0x1f7939,_0x46a0e8){var _0x4d64eb;if(_0x40ef71[_0xca9f('0x32')][_0xca9f('0x33')]){if(_[_0xca9f('0x34')](_0x40ef71[_0xca9f('0x32')][_0xca9f('0x33')],'Basic')){var _0xa5f9bc=basicAuth(_0x40ef71);db[_0xca9f('0x35')][_0xca9f('0x36')]({'where':{'name':_0xa5f9bc[_0xca9f('0xc')]}})[_0xca9f('0x2c')](function(_0x5c8aa0){if(!_0x5c8aa0||!_0x5c8aa0['authenticate'](_0xa5f9bc[_0xca9f('0x37')])){return _0x1f7939['status'](0x191)[_0xca9f('0x2f')]({'message':_0xca9f('0x38')});}_0x40ef71[_0xca9f('0x39')]={'id':_0x5c8aa0['id']};_0x46a0e8();})[_0xca9f('0x31')](function(_0x5a270a){_0x46a0e8(_0x5a270a);});}else if(_['startsWith'](_0x40ef71[_0xca9f('0x32')]['authorization'],_0xca9f('0x3a'))){validateJwt(_0x40ef71,_0x1f7939,_0x46a0e8);}else{if(_0x319b3b){_0x46a0e8();}else{return _0x1f7939['status'](0x193)[_0xca9f('0x2f')]({'message':_0xca9f('0x3b')});}}}else if(_0x40ef71[_0xca9f('0x3c')][_0xca9f('0x3d')]){try{var _0x282dc4={'audience':hardwareConf[_0xca9f('0x3e')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x40ef71['query'][_0xca9f('0x3d')],_0x282dc4)['then'](function(_0x2b0176){return db[_0xca9f('0x35')][_0xca9f('0x36')]({'where':{'id':_0x2b0176['sub']}})['then'](function(_0x42b113){_0x4d64eb=_0x42b113;return db[_0xca9f('0x3f')][_0xca9f('0x40')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xca9f('0x41')],'raw':!![]});})[_0xca9f('0x2c')](function(_0x566150){if(!_0x4d64eb||!_['isEqual'](_0x4d64eb[_0xca9f('0x42')],_0x2b0176[_0xca9f('0x43')])){return _0x1f7939[_0xca9f('0x2d')](0x191)[_0xca9f('0x2f')]({'message':_0xca9f('0x44')});}if(_0x4d64eb[_0xca9f('0x45')]){return _0x1f7939[_0xca9f('0x2d')](0x191)[_0xca9f('0x2f')]({'message':_0xca9f('0x46')});}if(_0x4d64eb[_0xca9f('0x47')]){if(_0x566150[_0xca9f('0x41')]>0x0){if(moment(_0x4d64eb[_0xca9f('0x48')])[_0xca9f('0x49')](_0x566150['blockDuration'],_0xca9f('0x4a'))>moment()){return _0x1f7939['status'](0x191)[_0xca9f('0x2f')]({'message':_0xca9f('0x46')});}}else{return _0x1f7939['status'](0x191)[_0xca9f('0x2f')]({'message':_0xca9f('0x46')});}}_0x40ef71[_0xca9f('0x39')]={'id':_0x4d64eb['id']};_0x46a0e8();});})[_0xca9f('0x31')](function(){return _0x1f7939[_0xca9f('0x2d')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x4b5da3){_0x46a0e8(_0x4b5da3);}}else if(_0x319b3b){_0x46a0e8();}else{return _0x1f7939[_0xca9f('0x2d')](0x193)[_0xca9f('0x2f')]({'message':_0xca9f('0x3b')});}})['use'](function(_0x3a759a,_0x63edfe,_0x55ad0b){if(_0x3a759a[_0xca9f('0x39')]){db[_0xca9f('0x35')]['find']({'where':{'id':_0x3a759a[_0xca9f('0x39')]['id']},'attributes':userAttributes})[_0xca9f('0x2c')](function(_0x397d4a){if(!_0x397d4a){return _0x63edfe[_0xca9f('0x2d')](0x194)[_0xca9f('0x2f')]({'message':'User\x20not\x20found.'});}_0x3a759a[_0xca9f('0x39')]=_0x397d4a;_0x55ad0b();})[_0xca9f('0x31')](function(_0x5cfebe){_0x55ad0b(_0x5cfebe);});}else if(_0x319b3b){_0x55ad0b();}else{return _0x63edfe[_0xca9f('0x2d')](0x194)[_0xca9f('0x2f')]({'message':_0xca9f('0x4b')});}});};exports[_0xca9f('0x4c')]=function canUpdate(){return compose()[_0xca9f('0x27')](function(_0x40ae9a,_0x199bb9,_0x6284a1){return licenseUtil[_0xca9f('0x4d')]()[_0xca9f('0x2c')](function(_0x2bc911){if(_0x2bc911[_0xca9f('0x4e')]){_0x6284a1();}else{return _0x199bb9['status'](0x193)[_0xca9f('0x2f')]({'message':_0xca9f('0x4f')});}})[_0xca9f('0x31')](function(_0x2e2bd2){_0x6284a1(_0x2e2bd2);});});};exports[_0xca9f('0x50')]=function(_0x5233b6,_0x4b36cb,_0x470ad6){_0x5233b6['isMiddleware']=!![];return _0x470ad6();};exports[_0xca9f('0x51')]=function signToken(_0x3d2f61){return signJwt(_0x3d2f61);};exports[_0xca9f('0x52')]=function(_0x33cba8,_0x39ec0f){if(!_0x33cba8[_0xca9f('0x39')]){return _0x39ec0f['status'](0x194)[_0xca9f('0x2f')]({'message':_0xca9f('0x53')});}var _0x4c73a6={'payload':{'id':_0x33cba8[_0xca9f('0x39')]['id'],'role':_0x33cba8[_0xca9f('0x39')][_0xca9f('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4c73a6)[_0xca9f('0x2c')](function(_0x5b0942){_0x39ec0f[_0xca9f('0x54')]('motion.token',_0x5b0942);_0x39ec0f[_0xca9f('0x55')](_0xca9f('0x56'));})[_0xca9f('0x31')](function(_0x449e00){return _0x39ec0f['status'](0x1f4)['send'](_0x449e00);});};exports['retrieveApiKey']=function(_0x1450f1){if(_[_0xca9f('0x57')](_0x1450f1[_0xca9f('0x42')])||_[_0xca9f('0x57')](_0x1450f1[_0xca9f('0x58')])){return null;}else{return createJwt(_0x1450f1);}};exports[_0xca9f('0x59')]=function(_0x656430){_0x656430[_0xca9f('0x42')]=generateNonce();_0x656430[_0xca9f('0x58')]=generateIssuedAt();return createJwt(_0x656430);};exports[_0xca9f('0x5a')]=function(_0x4dfa6d,_0x43782c){var _0x573abe=_0x4dfa6d[_0xca9f('0x3c')][_0xca9f('0x3d')];if(_0x573abe){var _0x4eb702={'nonce':_0x43782c[_0xca9f('0x42')],'iat':_0x43782c[_0xca9f('0x58')],'audience':hardwareConf[_0xca9f('0x3e')](),'issuer':hardwareConf[_0xca9f('0x3e')]()};return verifyJwt(_0x573abe,_0x4eb702)[_0xca9f('0x2c')](function(){return generateApiKey(_0x43782c);});}else{throw{'message':_0xca9f('0x5b')};}};exports[_0xca9f('0x5c')]=function(_0x20310f){var _0x599e2d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x599e2d['test'](_0x20310f))throw new db[(_0xca9f('0x5d'))][(_0xca9f('0x5e'))](_0xca9f('0x5f'));return;};exports[_0xca9f('0x60')]=function(_0x18acdc,_0x14ba2c,_0x588d0d){var _0x58fb7f=encryptor[_0xca9f('0x61')](_0x14ba2c)[_0xca9f('0x62')](',');for(var _0x499930=0x0;_0x499930<_0x588d0d;_0x499930++){if(!_0x58fb7f[_0x499930])break;if(_0x18acdc[_0xca9f('0x63')]()===_0x58fb7f[_0x499930][_0xca9f('0x63')]()){var _0x595ba2=util['format'](_0xca9f('0x64'),_0x588d0d);if(_0x588d0d===0x1){_0x595ba2=_0xca9f('0x65');}throw new db[(_0xca9f('0x5d'))][(_0xca9f('0x5e'))](_0x595ba2);}}return;};exports[_0xca9f('0x66')]=function(_0x24cebd,_0x3f9b32){var _0x1e9583=_0x3f9b32?encryptor[_0xca9f('0x61')](_0x3f9b32)[_0xca9f('0x62')](','):[];if(_0x1e9583[_0xca9f('0x67')]===0x5){_0x1e9583[_0xca9f('0x68')](-0x1,0x1);}_0x1e9583[_0xca9f('0x69')](_0x24cebd);return encryptor[_0xca9f('0x6a')](_0x1e9583[_0xca9f('0x6b')](','));};function signJwt(_0x3cb4d3){var _0x35f4b8=BPromise[_0xca9f('0x6c')](jwt['sign'],{'context':jwt});var _0x3ad946=_0x3cb4d3[_0xca9f('0x6d')]||config['secrets']['session'];return new BPromise(function(_0x5ac9ed,_0x36512d){_0x35f4b8(_0x3cb4d3[_0xca9f('0x6e')],_0x3ad946,_0x3cb4d3[_0xca9f('0x6f')])[_0xca9f('0x2c')](function(_0x3ac8f1){_0x5ac9ed(_0x3ac8f1);})[_0xca9f('0x31')](function(_0x430789){_0x36512d(_0x430789);});});}function verifyJwt(_0xf769a8,_0x19282a,_0x581879){var _0x470f14=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x4f994c=_0x581879||config[_0xca9f('0x70')][_0xca9f('0x9')];return new BPromise(function(_0x2d7991,_0x4d700c){_0x470f14(_0xf769a8,_0x4f994c,_0x19282a)['then'](function(_0x698ed8){_0x2d7991(_0x698ed8);})[_0xca9f('0x31')](function(_0x5d1638){_0x4d700c(_0x5d1638);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xca9f('0x71')](_0xca9f('0x72'));}function generateIssuedAt(){return Math['floor'](Date[_0xca9f('0x73')]()/0x3e8)[_0xca9f('0x71')]();}function createJwt(_0x5a9fb3){var _0x517eda={'payload':{'iat':_0x5a9fb3[_0xca9f('0x58')],'nonce':_0x5a9fb3[_0xca9f('0x42')]},'options':{'algorithm':'HS512','subject':_0x5a9fb3['id'][_0xca9f('0x71')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x517eda)[_0xca9f('0x2c')](function(_0x5ee08b){return{'iat':_0x5a9fb3['apiKeyIat'],'nonce':_0x5a9fb3[_0xca9f('0x42')],'token':_0x5ee08b};});} \ No newline at end of file +var _0xebcd=['blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','send','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','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.','decryptString','length','splice','encryptString','join','promisify','sign','secret','session','options','toString','floor','now','../../mysqldb','../../config/license/hardware','lodash','express-jwt','basic-auth','crypto','bluebird','util','moment','secrets','role','internal','email','userpic','permissions','md5secret','voicePause','chatPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','use','user','findOne','params','closed','then','unmanaged','json','disposition','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','User','find','name','authenticate','pass','startsWith','Unknown\x20authorization\x20format','query','getUuid','apikey','Setting','isEqual','apiKeyNonce','nonce','status','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockDuration'];(function(_0x415c3e,_0x2a9fcf){var _0x360c00=function(_0x17f375){while(--_0x17f375){_0x415c3e['push'](_0x415c3e['shift']());}};_0x360c00(++_0x2a9fcf);}(_0xebcd,0x18c));var _0xdebc=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0xebcd[_0x53c256];return _0x25feb6;};'use strict';var db=require(_0xdebc('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xdebc('0x1'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xdebc('0x2'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xdebc('0x3'));var compose=require('composable-middleware');var basicAuth=require(_0xdebc('0x4'));var crypto=require(_0xdebc('0x5'));var BPromise=require(_0xdebc('0x6'));var util=require(_0xdebc('0x7'));var moment=require(_0xdebc('0x8'));var validateJwt=expressJwt({'secret':config[_0xdebc('0x9')]['session']});var userAttributes=['id',_0xdebc('0xa'),'fullname','name',_0xdebc('0xb'),_0xdebc('0xc'),_0xdebc('0xd'),_0xdebc('0xe'),_0xdebc('0xf'),_0xdebc('0x10'),_0xdebc('0x11'),'mailPause','faxPause',_0xdebc('0x12'),_0xdebc('0x13'),_0xdebc('0x14'),_0xdebc('0x15'),_0xdebc('0x16'),_0xdebc('0x17'),_0xdebc('0x18'),_0xdebc('0x19'),_0xdebc('0x1a'),_0xdebc('0x1b'),_0xdebc('0x1c'),_0xdebc('0x1d'),_0xdebc('0x1e'),_0xdebc('0x1f'),_0xdebc('0x20'),_0xdebc('0x21'),_0xdebc('0x22'),_0xdebc('0x23'),_0xdebc('0x24'),_0xdebc('0x25'),_0xdebc('0x26'),_0xdebc('0x27'),_0xdebc('0x28'),_0xdebc('0x29'),_0xdebc('0x2a')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0xdebc('0x2b')](function(_0x57405c,_0x3e9526,_0x280c40){if(_0x57405c[_0xdebc('0x2c')]){_0x280c40();}else{return db['ChatInteraction'][_0xdebc('0x2d')]({'where':{'id':_0x57405c[_0xdebc('0x2e')]['id']},'attributes':['id',_0xdebc('0x2f'),'disposition'],'raw':!![]})[_0xdebc('0x30')](function(_0x59501b){if(_0x59501b&&_0x59501b[_0xdebc('0x2f')]){return _0x3e9526['status'](_0x59501b['disposition']===_0xdebc('0x31')?0x195:0x193)[_0xdebc('0x32')]({'message':_0x59501b[_0xdebc('0x33')]===_0xdebc('0x31')?'Unmanaged.':_0xdebc('0x34')});}else{_0x280c40();}})[_0xdebc('0x35')](function(_0x2ba78e){_0x280c40(_0x2ba78e);});}});};exports[_0xdebc('0x36')]=function isAuthenticated(_0x19e843){return compose()['use'](function(_0x1326f7,_0x280499,_0x40d23c){var _0x411315;if(_0x1326f7[_0xdebc('0x37')][_0xdebc('0x38')]){if(_['startsWith'](_0x1326f7['headers'][_0xdebc('0x38')],_0xdebc('0x39'))){var _0x43b0f5=basicAuth(_0x1326f7);db[_0xdebc('0x3a')][_0xdebc('0x3b')]({'where':{'name':_0x43b0f5[_0xdebc('0x3c')]}})[_0xdebc('0x30')](function(_0x4a805e){if(!_0x4a805e||!_0x4a805e[_0xdebc('0x3d')](_0x43b0f5[_0xdebc('0x3e')])){return _0x280499['status'](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x1326f7[_0xdebc('0x2c')]={'id':_0x4a805e['id']};_0x40d23c();})[_0xdebc('0x35')](function(_0x4c18e4){_0x40d23c(_0x4c18e4);});}else if(_[_0xdebc('0x3f')](_0x1326f7[_0xdebc('0x37')][_0xdebc('0x38')],'Bearer')){validateJwt(_0x1326f7,_0x280499,_0x40d23c);}else{if(_0x19e843){_0x40d23c();}else{return _0x280499['status'](0x193)['json']({'message':_0xdebc('0x40')});}}}else if(_0x1326f7[_0xdebc('0x41')]['apikey']){try{var _0x2c1a97={'audience':hardwareConf[_0xdebc('0x42')](),'issuer':hardwareConf[_0xdebc('0x42')]()};verifyJwt(_0x1326f7[_0xdebc('0x41')][_0xdebc('0x43')],_0x2c1a97)[_0xdebc('0x30')](function(_0x1b4b96){return db[_0xdebc('0x3a')][_0xdebc('0x3b')]({'where':{'id':_0x1b4b96['sub']}})[_0xdebc('0x30')](function(_0x20ad61){_0x411315=_0x20ad61;return db[_0xdebc('0x44')][_0xdebc('0x2d')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})['then'](function(_0x287393){if(!_0x411315||!_[_0xdebc('0x45')](_0x411315[_0xdebc('0x46')],_0x1b4b96[_0xdebc('0x47')])){return _0x280499[_0xdebc('0x48')](0x191)[_0xdebc('0x32')]({'message':_0xdebc('0x49')});}if(_0x411315['disabled']){return _0x280499[_0xdebc('0x48')](0x191)[_0xdebc('0x32')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x411315[_0xdebc('0x4a')]){if(_0x287393[_0xdebc('0x4b')]>0x0){if(moment(_0x411315[_0xdebc('0x4c')])[_0xdebc('0x4d')](_0x287393[_0xdebc('0x4b')],_0xdebc('0x4e'))>moment()){return _0x280499[_0xdebc('0x48')](0x191)[_0xdebc('0x32')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x280499['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x1326f7[_0xdebc('0x2c')]={'id':_0x411315['id']};_0x40d23c();});})[_0xdebc('0x35')](function(){return _0x280499[_0xdebc('0x48')](0x191)[_0xdebc('0x32')]({'message':_0xdebc('0x4f')});});}catch(_0x58e140){_0x40d23c(_0x58e140);}}else if(_0x19e843){_0x40d23c();}else{return _0x280499[_0xdebc('0x48')](0x193)[_0xdebc('0x32')]({'message':_0xdebc('0x40')});}})[_0xdebc('0x2b')](function(_0x45a83e,_0x4e56ce,_0x4476e2){if(_0x45a83e['user']){db[_0xdebc('0x3a')][_0xdebc('0x3b')]({'where':{'id':_0x45a83e[_0xdebc('0x2c')]['id']},'attributes':userAttributes})[_0xdebc('0x30')](function(_0x586a0a){if(!_0x586a0a){return _0x4e56ce[_0xdebc('0x48')](0x194)['json']({'message':_0xdebc('0x50')});}_0x45a83e[_0xdebc('0x2c')]=_0x586a0a;_0x4476e2();})[_0xdebc('0x35')](function(_0x50cbdc){_0x4476e2(_0x50cbdc);});}else if(_0x19e843){_0x4476e2();}else{return _0x4e56ce[_0xdebc('0x48')](0x194)['json']({'message':_0xdebc('0x51')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xdebc('0x2b')](function(_0x3aef58,_0xb4b687,_0xbe0591){return licenseUtil[_0xdebc('0x52')]()[_0xdebc('0x30')](function(_0x2f0dbf){if(_0x2f0dbf[_0xdebc('0x53')]){_0xbe0591();}else{return _0xb4b687[_0xdebc('0x48')](0x193)[_0xdebc('0x32')]({'message':_0xdebc('0x54')});}})['catch'](function(_0xdc10cb){_0xbe0591(_0xdc10cb);});});};exports[_0xdebc('0x55')]=function(_0x267468,_0xb77b70,_0x2fd3d3){_0x267468[_0xdebc('0x55')]=!![];return _0x2fd3d3();};exports['signToken']=function signToken(_0x125633){return signJwt(_0x125633);};exports[_0xdebc('0x56')]=function(_0x124bc7,_0x4bc541){if(!_0x124bc7['user']){return _0x4bc541[_0xdebc('0x48')](0x194)[_0xdebc('0x32')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x1969ae={'payload':{'id':_0x124bc7[_0xdebc('0x2c')]['id'],'role':_0x124bc7[_0xdebc('0x2c')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x1969ae)['then'](function(_0x3739a7){_0x4bc541[_0xdebc('0x57')](_0xdebc('0x58'),_0x3739a7);_0x4bc541[_0xdebc('0x59')](_0xdebc('0x5a'));})['catch'](function(_0x383ef6){return _0x4bc541[_0xdebc('0x48')](0x1f4)[_0xdebc('0x5b')](_0x383ef6);});};exports['retrieveApiKey']=function(_0xd0201d){if(_['isNil'](_0xd0201d[_0xdebc('0x46')])||_['isNil'](_0xd0201d[_0xdebc('0x5c')])){return null;}else{return createJwt(_0xd0201d);}};exports[_0xdebc('0x5d')]=function(_0x327e7a){_0x327e7a['apiKeyNonce']=generateNonce();_0x327e7a[_0xdebc('0x5c')]=generateIssuedAt();return createJwt(_0x327e7a);};exports[_0xdebc('0x5e')]=function(_0x1d03ce,_0x2cb013){var _0x1e84f2=_0x1d03ce[_0xdebc('0x41')]['apikey'];if(_0x1e84f2){var _0x2f95ec={'nonce':_0x2cb013[_0xdebc('0x46')],'iat':_0x2cb013[_0xdebc('0x5c')],'audience':hardwareConf[_0xdebc('0x42')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x1e84f2,_0x2f95ec)['then'](function(){return generateApiKey(_0x2cb013);});}else{throw{'message':_0xdebc('0x5f')};}};exports[_0xdebc('0x60')]=function(_0x5b7a31){var _0x3fe968=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3fe968['test'](_0x5b7a31))throw new db[(_0xdebc('0x61'))][(_0xdebc('0x62'))](_0xdebc('0x63'));return;};exports['validatePasswordHistory']=function(_0x376dbe,_0x32d74b,_0x41af22){var _0x3d782a=encryptor['decryptString'](_0x32d74b)[_0xdebc('0x64')](',');for(var _0x194d84=0x0;_0x194d84<_0x41af22;_0x194d84++){if(!_0x3d782a[_0x194d84])break;if(_0x376dbe[_0xdebc('0x65')]()===_0x3d782a[_0x194d84][_0xdebc('0x65')]()){var _0x35ed09=util[_0xdebc('0x66')](_0xdebc('0x67'),_0x41af22);if(_0x41af22===0x1){_0x35ed09=_0xdebc('0x68');}throw new db[(_0xdebc('0x61'))][(_0xdebc('0x62'))](_0x35ed09);}}return;};exports['updatePasswordsHistory']=function(_0x1dfee7,_0x5d80fa){var _0x2e0676=_0x5d80fa?encryptor[_0xdebc('0x69')](_0x5d80fa)[_0xdebc('0x64')](','):[];if(_0x2e0676[_0xdebc('0x6a')]===0x5){_0x2e0676[_0xdebc('0x6b')](-0x1,0x1);}_0x2e0676['unshift'](_0x1dfee7);return encryptor[_0xdebc('0x6c')](_0x2e0676[_0xdebc('0x6d')](','));};function signJwt(_0x8a302f){var _0x1d3be3=BPromise[_0xdebc('0x6e')](jwt[_0xdebc('0x6f')],{'context':jwt});var _0x49aad2=_0x8a302f[_0xdebc('0x70')]||config[_0xdebc('0x9')][_0xdebc('0x71')];return new BPromise(function(_0x3c3bf9,_0x57f2ec){_0x1d3be3(_0x8a302f['payload'],_0x49aad2,_0x8a302f[_0xdebc('0x72')])[_0xdebc('0x30')](function(_0x396eb4){_0x3c3bf9(_0x396eb4);})[_0xdebc('0x35')](function(_0x1a2de2){_0x57f2ec(_0x1a2de2);});});}function verifyJwt(_0x99d2da,_0x3e6eaf,_0x41c703){var _0x43794d=BPromise[_0xdebc('0x6e')](jwt['verify'],{'context':jwt});var _0x13d5cb=_0x41c703||config['secrets']['session'];return new BPromise(function(_0x23332e,_0x3e35e6){_0x43794d(_0x99d2da,_0x13d5cb,_0x3e6eaf)[_0xdebc('0x30')](function(_0x4f84ce){_0x23332e(_0x4f84ce);})[_0xdebc('0x35')](function(_0x587c3a){_0x3e35e6(_0x587c3a);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xdebc('0x73')]('hex');}function generateIssuedAt(){return Math[_0xdebc('0x74')](Date[_0xdebc('0x75')]()/0x3e8)[_0xdebc('0x73')]();}function createJwt(_0x4ee583){var _0x509321={'payload':{'iat':_0x4ee583[_0xdebc('0x5c')],'nonce':_0x4ee583[_0xdebc('0x46')]},'options':{'algorithm':'HS512','subject':_0x4ee583['id'][_0xdebc('0x73')](),'issuer':hardwareConf[_0xdebc('0x42')](),'audience':hardwareConf[_0xdebc('0x42')]()}};return signJwt(_0x509321)[_0xdebc('0x30')](function(_0x1268d9){return{'iat':_0x4ee583[_0xdebc('0x5c')],'nonce':_0x4ee583[_0xdebc('0x46')],'token':_0x1268d9};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 3c080f6..c5a9c10 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 _0x4659=['unlink','decryptFile','createWriteStream','final','secret','base64','decryptString','createDecipher','utf8','crypto','bluebird','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','getCiphers','filter','indexOf','encryptFile','createReadStream','createCipher','data','update','binary','end','write','close'];(function(_0x3bdd55,_0x58eade){var _0x4659f1=function(_0xe0a951){while(--_0xe0a951){_0x3bdd55['push'](_0x3bdd55['shift']());}};_0x4659f1(++_0x58eade);}(_0x4659,0x6c));var _0x9465=function(_0x2797de,_0x44e5df){_0x2797de=_0x2797de-0x0;var _0x42ede0=_0x4659[_0x2797de];return _0x42ede0;};'use strict';var crypto=require(_0x9465('0x0'));var fs=require('fs');var BPromise=require(_0x9465('0x1'));var _=require('lodash');var config=require(_0x9465('0x2'));var logger=require(_0x9465('0x3'))(_0x9465('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x9465('0x5')][_0x9465('0x6')],'algorithm':_0x9465('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0x9465('0x8')]&&config[_0x9465('0x8')][_0x9465('0x9')]){var isSupported=isAlgorithmSupported(config[_0x9465('0x8')]['algorithm']);if(isSupported){fileOptions[_0x9465('0x9')]=config[_0x9465('0x8')][_0x9465('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9465('0xa')](',\x20');logger[_0x9465('0xb')](config[_0x9465('0x8')][_0x9465('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x1ae96f){return AES_SUPPORTED_RX['test'](_0x1ae96f);}function getSupportedCiphers(){return crypto[_0x9465('0xc')]()[_0x9465('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x110726){return getSupportedCiphers()[_0x9465('0xe')](_0x110726)>-0x1;}function combineOptions(_0x25d2c5){var _0x8f7cbb={};for(var _0x250f89 in fileOptions){if(fileOptions['hasOwnProperty'](_0x250f89)){_0x8f7cbb[_0x250f89]=fileOptions[_0x250f89];}}if(_0x25d2c5){for(var _0x433f7c in _0x25d2c5){if(_0x25d2c5['hasOwnProperty'](_0x433f7c)){_0x8f7cbb[_0x433f7c]=_0x25d2c5[_0x433f7c];}}}return _0x8f7cbb;}exports[_0x9465('0xf')]=function(_0x240274,_0x3524c6,_0x4ba45b,_0x13f9d1){return new BPromise(function(_0x484cc5,_0x42097c){_0x13f9d1=combineOptions(_0x13f9d1);var _0x56fc88=new Buffer(_0x4ba45b);var _0x3c10ee=fs[_0x9465('0x10')](_0x240274);var _0x24ac4e=fs['createWriteStream'](_0x3524c6);var _0x5f297d=crypto[_0x9465('0x11')](_0x13f9d1['algorithm'],_0x56fc88);_0x3c10ee['on'](_0x9465('0x12'),function(_0x415684){var _0x47e1b4=new Buffer(_0x5f297d[_0x9465('0x13')](_0x415684),_0x9465('0x14'));_0x24ac4e['write'](_0x47e1b4);});_0x3c10ee['on'](_0x9465('0x15'),function(){try{var _0x343d49=new Buffer(_0x5f297d['final']('binary'),_0x9465('0x14'));_0x24ac4e[_0x9465('0x16')](_0x343d49);_0x24ac4e[_0x9465('0x15')]();_0x24ac4e['on'](_0x9465('0x17'),function(){return _0x484cc5(_0x3524c6);});}catch(_0x2d6f96){fs[_0x9465('0x18')](_0x3524c6);return _0x42097c(_0x2d6f96);}});});};exports[_0x9465('0x19')]=function(_0x42c58d,_0x388b53,_0x4151a1,_0x74a427){return new BPromise(function(_0x135481,_0xa914ed){_0x74a427=combineOptions(_0x74a427);var _0x474cf8=new Buffer(_0x4151a1);var _0x2554ef=fs[_0x9465('0x10')](_0x42c58d);var _0x2674a4=fs[_0x9465('0x1a')](_0x388b53);var _0x4f6394=crypto['createDecipher'](_0x74a427[_0x9465('0x9')],_0x474cf8);_0x2554ef['on'](_0x9465('0x12'),function(_0x1756c9){var _0x4ee94a=new Buffer(_0x4f6394[_0x9465('0x13')](_0x1756c9),_0x9465('0x14'));_0x2674a4[_0x9465('0x16')](_0x4ee94a);});_0x2554ef['on'](_0x9465('0x15'),function(){try{var _0x6cf99=new Buffer(_0x4f6394[_0x9465('0x1b')](_0x9465('0x14')),_0x9465('0x14'));_0x2674a4[_0x9465('0x16')](_0x6cf99);_0x2674a4[_0x9465('0x15')]();_0x2674a4['on'](_0x9465('0x17'),function(){return _0x135481(_0x388b53);});}catch(_0x224287){fs[_0x9465('0x18')](_0x388b53);return _0xa914ed(_0x224287);}});});};exports['encryptString']=function(_0x2d2177,_0x5e3620,_0x3a20b1){var _0x451dc1=_0x3a20b1||stringOptions[_0x9465('0x9')];var _0x3b469a=_0x5e3620||stringOptions[_0x9465('0x1c')];var _0x36a900=crypto[_0x9465('0x11')](_0x451dc1,_0x3b469a);var _0x2843cb=_0x36a900[_0x9465('0x13')](_0x2d2177,'utf8',_0x9465('0x1d'));_0x2843cb+=_0x36a900[_0x9465('0x1b')](_0x9465('0x1d'));return _0x2843cb;};exports[_0x9465('0x1e')]=function(_0x4d0328,_0x568c3c,_0x427ff7){var _0x5de284=_0x427ff7||stringOptions[_0x9465('0x9')];var _0x3f77ae=_0x568c3c||stringOptions[_0x9465('0x1c')];var _0x4b5fb1=crypto[_0x9465('0x1f')](_0x5de284,_0x3f77ae);var _0x595f31=_0x4b5fb1[_0x9465('0x13')](_0x4d0328,_0x9465('0x1d'),_0x9465('0x20'));_0x595f31+=_0x4b5fb1['final'](_0x9465('0x20'));return _0x595f31;}; \ No newline at end of file +var _0x7fab=['decryptFile','createWriteStream','createDecipher','update','secret','utf8','base64','decryptString','crypto','lodash','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','binary','write','end','final','close','unlink'];(function(_0x249611,_0x52dbb0){var _0x1f23bd=function(_0x37509e){while(--_0x37509e){_0x249611['push'](_0x249611['shift']());}};_0x1f23bd(++_0x52dbb0);}(_0x7fab,0xf6));var _0xb7fa=function(_0x3c4f93,_0x24be5c){_0x3c4f93=_0x3c4f93-0x0;var _0x56d097=_0x7fab[_0x3c4f93];return _0x56d097;};'use strict';var crypto=require(_0xb7fa('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xb7fa('0x1'));var config=require('../../config/environment');var logger=require(_0xb7fa('0x2'))(_0xb7fa('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb7fa('0x4')][_0xb7fa('0x5')],'algorithm':_0xb7fa('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0xb7fa('0x7')]&&config[_0xb7fa('0x7')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xb7fa('0x7')]['algorithm']);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0xb7fa('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb7fa('0x9')](',\x20');logger['error'](config[_0xb7fa('0x7')][_0xb7fa('0x8')],_0xb7fa('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0xcc04e4){return AES_SUPPORTED_RX[_0xb7fa('0xb')](_0xcc04e4);}function getSupportedCiphers(){return crypto[_0xb7fa('0xc')]()[_0xb7fa('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x3bf843){return getSupportedCiphers()[_0xb7fa('0xe')](_0x3bf843)>-0x1;}function combineOptions(_0x1815cc){var _0x498015={};for(var _0x1455a0 in fileOptions){if(fileOptions[_0xb7fa('0xf')](_0x1455a0)){_0x498015[_0x1455a0]=fileOptions[_0x1455a0];}}if(_0x1815cc){for(var _0x1db00e in _0x1815cc){if(_0x1815cc[_0xb7fa('0xf')](_0x1db00e)){_0x498015[_0x1db00e]=_0x1815cc[_0x1db00e];}}}return _0x498015;}exports[_0xb7fa('0x10')]=function(_0x8b2289,_0x2dc35e,_0x141c07,_0x50ff36){return new BPromise(function(_0x352d34,_0x5c1117){_0x50ff36=combineOptions(_0x50ff36);var _0x55edb4=new Buffer(_0x141c07);var _0x75e27=fs[_0xb7fa('0x11')](_0x8b2289);var _0x392d03=fs['createWriteStream'](_0x2dc35e);var _0x1e6c11=crypto[_0xb7fa('0x12')](_0x50ff36[_0xb7fa('0x8')],_0x55edb4);_0x75e27['on'](_0xb7fa('0x13'),function(_0x3a42b9){var _0x158e28=new Buffer(_0x1e6c11['update'](_0x3a42b9),_0xb7fa('0x14'));_0x392d03[_0xb7fa('0x15')](_0x158e28);});_0x75e27['on'](_0xb7fa('0x16'),function(){try{var _0x5d152d=new Buffer(_0x1e6c11[_0xb7fa('0x17')](_0xb7fa('0x14')),_0xb7fa('0x14'));_0x392d03[_0xb7fa('0x15')](_0x5d152d);_0x392d03[_0xb7fa('0x16')]();_0x392d03['on'](_0xb7fa('0x18'),function(){return _0x352d34(_0x2dc35e);});}catch(_0x419a33){fs[_0xb7fa('0x19')](_0x2dc35e);return _0x5c1117(_0x419a33);}});});};exports[_0xb7fa('0x1a')]=function(_0x1fe1b3,_0x47d62b,_0x441301,_0x188dbf){return new BPromise(function(_0x3ae9f7,_0x4ab80a){_0x188dbf=combineOptions(_0x188dbf);var _0x1e1aef=new Buffer(_0x441301);var _0x542ff8=fs[_0xb7fa('0x11')](_0x1fe1b3);var _0x3e2f0c=fs[_0xb7fa('0x1b')](_0x47d62b);var _0x2b996b=crypto[_0xb7fa('0x1c')](_0x188dbf[_0xb7fa('0x8')],_0x1e1aef);_0x542ff8['on'](_0xb7fa('0x13'),function(_0x1838cf){var _0x170e1a=new Buffer(_0x2b996b[_0xb7fa('0x1d')](_0x1838cf),_0xb7fa('0x14'));_0x3e2f0c[_0xb7fa('0x15')](_0x170e1a);});_0x542ff8['on'](_0xb7fa('0x16'),function(){try{var _0x590d72=new Buffer(_0x2b996b[_0xb7fa('0x17')](_0xb7fa('0x14')),_0xb7fa('0x14'));_0x3e2f0c[_0xb7fa('0x15')](_0x590d72);_0x3e2f0c[_0xb7fa('0x16')]();_0x3e2f0c['on'](_0xb7fa('0x18'),function(){return _0x3ae9f7(_0x47d62b);});}catch(_0x4cbc54){fs[_0xb7fa('0x19')](_0x47d62b);return _0x4ab80a(_0x4cbc54);}});});};exports['encryptString']=function(_0x21facb,_0x5839e3,_0x593d1e){var _0x4fc546=_0x593d1e||stringOptions[_0xb7fa('0x8')];var _0x481c3f=_0x5839e3||stringOptions[_0xb7fa('0x1e')];var _0xaf7461=crypto[_0xb7fa('0x12')](_0x4fc546,_0x481c3f);var _0x915446=_0xaf7461['update'](_0x21facb,_0xb7fa('0x1f'),'base64');_0x915446+=_0xaf7461[_0xb7fa('0x17')](_0xb7fa('0x20'));return _0x915446;};exports[_0xb7fa('0x21')]=function(_0x1506c1,_0x56a579,_0x54f289){var _0x21bc27=_0x54f289||stringOptions[_0xb7fa('0x8')];var _0x4bda6d=_0x56a579||stringOptions[_0xb7fa('0x1e')];var _0x4050d6=crypto['createDecipher'](_0x21bc27,_0x4bda6d);var _0x5f1cae=_0x4050d6[_0xb7fa('0x1d')](_0x1506c1,_0xb7fa('0x20'),_0xb7fa('0x1f'));_0x5f1cae+=_0x4050d6[_0xb7fa('0x17')]('utf8');return _0x5f1cae;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index fd2e04d..d4d218b 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 _0xd2ea=['analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then','query','SELECT','num','Empty','length','push','sequelize','QueryTypes','dirname','basename','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','inspect','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger'];(function(_0x377220,_0x222c70){var _0x362787=function(_0x45c1f8){while(--_0x45c1f8){_0x377220['push'](_0x377220['shift']());}};_0x362787(++_0x222c70);}(_0xd2ea,0x15f));var _0xad2e=function(_0x40bf3a,_0x394e90){_0x40bf3a=_0x40bf3a-0x0;var _0x3d4d9d=_0xd2ea[_0x40bf3a];return _0x3d4d9d;};'use strict';var util=require(_0xad2e('0x0'));var path=require(_0xad2e('0x1'));var _=require(_0xad2e('0x2'));var csv=require(_0xad2e('0x3'));var fs=require('fs');var BPromise=require(_0xad2e('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xad2e('0x5'));var db=require(_0xad2e('0x6'))['db'];var dbH=require(_0xad2e('0x6'))[_0xad2e('0x7')];var logger=require(_0xad2e('0x8'))(_0xad2e('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xad2e('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xad2e('0xa')][0x4];function analyticExtractedReport(_0x3e3d1f,_0x2ff7b2){var _0x5710ac={'status':_0x3e3d1f};var _0x1e0e9e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ff7b2){_0x5710ac[_0xad2e('0xb')]=_0x2ff7b2;}return db['AnalyticExtractedReport'][_0xad2e('0xc')](_0x5710ac,_0x1e0e9e);}function main(){var _0x51f575=0x1388;var _0x430443;logger[_0xad2e('0xd')](util[_0xad2e('0xe')](_0xad2e('0xf'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xad2e('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xad2e('0x11'),_0xad2e('0x12')]})[_0xad2e('0x13')](function(_0x42e2f2){if(_0x42e2f2){_0x430443=_0x42e2f2;_0x51f575=_0x430443['splitSizeCsv']||0x1388;}})[_0xad2e('0x13')](function(){return dbH['sequelize'][_0xad2e('0x14')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xad2e('0x15')]});})[_0xad2e('0x13')](function(_0x1646d5){if(!_0x1646d5[0x0][_0xad2e('0x16')]){return analyticExtractedReport(_0xad2e('0x17'));}var _0x4180aa=[];var _0x2546e2=0x0;var _0x5941c5=!![];if(_0x1646d5&&_0x1646d5[_0xad2e('0x18')]){var _0xbc6df0=_0x1646d5[0x0][_0xad2e('0x16')]%(_0x2546e2+_0x51f575);if(_0x430443[_0xad2e('0x11')]){for(;_0x5941c5;_0x2546e2+=_0x51f575,_0xbc6df0=_0x1646d5[0x0][_0xad2e('0x16')]%(_0x2546e2+_0x51f575)){if(_0xbc6df0==0x0||_0xbc6df0==_0x1646d5[0x0][_0xad2e('0x16')]){_0x5941c5=![];}_0x4180aa[_0xad2e('0x19')](dbH['sequelize'][_0xad2e('0x14')](util[_0xad2e('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x51f575,_0x2546e2),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}else{_0x4180aa[_0xad2e('0x19')](dbH[_0xad2e('0x1a')][_0xad2e('0x14')](QUERY,{'type':dbH[_0xad2e('0x1a')][_0xad2e('0x1b')][_0xad2e('0x15')]}));}}var _0x29dc4f=path[_0xad2e('0x1c')](PATH);var _0x102169=path[_0xad2e('0x1d')](PATH,_0xad2e('0x1e'));var _0x142631=_0x430443[_0xad2e('0x11')]&&_0x4180aa[_0xad2e('0x18')]>0x1;var _0x207517=[];if(!fs[_0xad2e('0x1f')](path['join'](_0x29dc4f,_0x102169))&&_0x142631){fs[_0xad2e('0x20')](path[_0xad2e('0x21')](_0x29dc4f,_0x102169));}return BPromise[_0xad2e('0x22')](_0x4180aa,function(_0x350c66){_0x207517[_0xad2e('0x19')](_0x350c66);})[_0xad2e('0x13')](function(){for(var _0x1161d5=0x0;_0x1161d5<_0x207517[_0xad2e('0x18')];_0x1161d5+=0x1){var _0xfd90a4;var _0x50d446=_0x207517[_0x1161d5];if(_0x142631){_0xfd90a4=path[_0xad2e('0x21')](_0x29dc4f,_0x102169,util['format'](_0xad2e('0x23'),_0x102169,_0x1161d5,_0xad2e('0x24')));}else{_0xfd90a4=path[_0xad2e('0x21')](_0x29dc4f,util[_0xad2e('0xe')](_0xad2e('0x25'),_0x102169,_0xad2e('0x24')));}fs[_0xad2e('0x26')](_0xfd90a4,csv(_0x50d446));}})[_0xad2e('0x13')](function(){if(_0x142631){zipdir(path[_0xad2e('0x21')](_0x29dc4f,_0x102169),{'saveTo':path[_0xad2e('0x21')](_0x29dc4f,util['format'](_0xad2e('0x25'),_0x102169,_0xad2e('0x27')))},function(_0x2a0dc7,_0x4379f4){});rimraf(path[_0xad2e('0x21')](_0x29dc4f,_0x102169),function(){});}})[_0xad2e('0x13')](function(){logger[_0xad2e('0xd')](util[_0xad2e('0xe')](_0xad2e('0x28'),EXTRACTED_REPORT_ID,_0xad2e('0x29')));return analyticExtractedReport(_0xad2e('0x2a'),_0x142631?util['format'](_0xad2e('0x25'),_0x102169,_0x142631?'zip':_0xad2e('0x24')):null);});})[_0xad2e('0x2b')](function(_0x5ac436){logger[_0xad2e('0xd')](util[_0xad2e('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xad2e('0x29')),util[_0xad2e('0x2c')](_0x5ac436,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0xdace=['Empty','length','split','push','QueryTypes','dirname','basename','.csv','existsSync','join','mkdirSync','each','csv','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Setting','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num'];(function(_0x5d9df4,_0x248d6f){var _0x4dc587=function(_0x5e2f78){while(--_0x5e2f78){_0x5d9df4['push'](_0x5d9df4['shift']());}};_0x4dc587(++_0x248d6f);}(_0xdace,0xc5));var _0xedac=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xdace[_0x2d9c6a];return _0xf3c918;};'use strict';var util=require(_0xedac('0x0'));var path=require('path');var _=require(_0xedac('0x1'));var csv=require(_0xedac('0x2'));var fs=require('fs');var BPromise=require(_0xedac('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xedac('0x4'));var db=require(_0xedac('0x5'))['db'];var dbH=require(_0xedac('0x5'))[_0xedac('0x6')];var logger=require('../../config/logger')(_0xedac('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xedac('0x8')][0x2]);var QUERY=process[_0xedac('0x8')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x4081c6,_0x21440e){var _0x162eea={'status':_0x4081c6};var _0x53fa43={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21440e){_0x162eea[_0xedac('0x9')]=_0x21440e;}return db[_0xedac('0xa')][_0xedac('0xb')](_0x162eea,_0x53fa43);}function main(){var _0x4af030=0x1388;var _0x5e188c;logger[_0xedac('0xc')](util[_0xedac('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xedac('0xe')][_0xedac('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xedac('0x10')]})['then'](function(_0x21c6ae){if(_0x21c6ae){_0x5e188c=_0x21c6ae;_0x4af030=_0x5e188c[_0xedac('0x10')]||0x1388;}})[_0xedac('0x11')](function(){return dbH[_0xedac('0x12')][_0xedac('0x13')](util[_0xedac('0xd')](_0xedac('0x14'),QUERY),{'type':dbH[_0xedac('0x12')]['QueryTypes'][_0xedac('0x15')]});})[_0xedac('0x11')](function(_0x2f0c7c){if(!_0x2f0c7c[0x0][_0xedac('0x16')]){return analyticExtractedReport(_0xedac('0x17'));}var _0x590e9b=[];var _0xed25bb=0x0;var _0x594b11=!![];if(_0x2f0c7c&&_0x2f0c7c[_0xedac('0x18')]){var _0x2eeac9=_0x2f0c7c[0x0][_0xedac('0x16')]%(_0xed25bb+_0x4af030);if(_0x5e188c[_0xedac('0x19')]){for(;_0x594b11;_0xed25bb+=_0x4af030,_0x2eeac9=_0x2f0c7c[0x0]['num']%(_0xed25bb+_0x4af030)){if(_0x2eeac9==0x0||_0x2eeac9==_0x2f0c7c[0x0]['num']){_0x594b11=![];}_0x590e9b[_0xedac('0x1a')](dbH[_0xedac('0x12')][_0xedac('0x13')](util[_0xedac('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4af030,_0xed25bb),{'type':dbH['sequelize'][_0xedac('0x1b')][_0xedac('0x15')]}));}}else{_0x590e9b[_0xedac('0x1a')](dbH[_0xedac('0x12')][_0xedac('0x13')](QUERY,{'type':dbH[_0xedac('0x12')][_0xedac('0x1b')][_0xedac('0x15')]}));}}var _0x5353e3=path[_0xedac('0x1c')](PATH);var _0x510005=path[_0xedac('0x1d')](PATH,_0xedac('0x1e'));var _0x5111e6=_0x5e188c[_0xedac('0x19')]&&_0x590e9b[_0xedac('0x18')]>0x1;var _0x1c87bf=[];if(!fs[_0xedac('0x1f')](path[_0xedac('0x20')](_0x5353e3,_0x510005))&&_0x5111e6){fs[_0xedac('0x21')](path['join'](_0x5353e3,_0x510005));}return BPromise[_0xedac('0x22')](_0x590e9b,function(_0x87d343){_0x1c87bf[_0xedac('0x1a')](_0x87d343);})[_0xedac('0x11')](function(){for(var _0x1ff33e=0x0;_0x1ff33e<_0x1c87bf[_0xedac('0x18')];_0x1ff33e+=0x1){var _0x40ba53;var _0x26c6f7=_0x1c87bf[_0x1ff33e];if(_0x5111e6){_0x40ba53=path[_0xedac('0x20')](_0x5353e3,_0x510005,util[_0xedac('0xd')]('%s%d.%s',_0x510005,_0x1ff33e,_0xedac('0x23')));}else{_0x40ba53=path[_0xedac('0x20')](_0x5353e3,util[_0xedac('0xd')]('%s.%s',_0x510005,_0xedac('0x23')));}fs['writeFileSync'](_0x40ba53,csv(_0x26c6f7));}})['then'](function(){if(_0x5111e6){zipdir(path[_0xedac('0x20')](_0x5353e3,_0x510005),{'saveTo':path[_0xedac('0x20')](_0x5353e3,util[_0xedac('0xd')](_0xedac('0x24'),_0x510005,'zip'))},function(_0x4e25da,_0xe813e6){});rimraf(path[_0xedac('0x20')](_0x5353e3,_0x510005),function(){});}})[_0xedac('0x11')](function(){logger[_0xedac('0xc')](util[_0xedac('0xd')](_0xedac('0x25'),EXTRACTED_REPORT_ID,_0xedac('0x26')));return analyticExtractedReport('Completed',_0x5111e6?util[_0xedac('0xd')](_0xedac('0x24'),_0x510005,_0x5111e6?_0xedac('0x27'):'csv'):null);});})[_0xedac('0x28')](function(_0x1213dc){logger['info'](util[_0xedac('0xd')](_0xedac('0x29'),EXTRACTED_REPORT_ID,'CSV'),util[_0xedac('0x2a')](_0x1213dc,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xedac('0x2b'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 0dd2a6b..f9f1aef 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 _0x410d=['catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','createPdfFromHTML','lodash','util','path','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','body','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','endDate','header','margin','push','landscape','footer','Arial','right','num','Empty','dirname','pdf','Setting','find','then','splitSizePdf','split','sequelize','query','SELECT','QueryTypes','existsSync','join','mkdirSync','all','flatten','createPdfKitDocument','%s%d.%s','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x42278a,_0x5c74e0){var _0x2a721a=function(_0x1a6bc1){while(--_0x1a6bc1){_0x42278a['push'](_0x42278a['shift']());}};_0x2a721a(++_0x5c74e0);}(_0x410d,0x66));var _0xd410=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0x410d[_0x334d1e];return _0x3b33ba;};'use strict';var _=require(_0xd410('0x0'));var fs=require('fs');var util=require(_0xd410('0x1'));var path=require(_0xd410('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xd410('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xd410('0x4'));var rimraf=require(_0xd410('0x5'));var JSDOM=require(_0xd410('0x6'))[_0xd410('0x7')];var window=new JSDOM('')[_0xd410('0x8')];var db=require('../../mysqldb')['db'];var dbH=require(_0xd410('0x9'))[_0xd410('0xa')];var logger=require(_0xd410('0xb'))(_0xd410('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xd410('0xd')][0x2]);var QUERY=process[_0xd410('0xd')][0x3];var PATH=process[_0xd410('0xd')][0x4];var NAME=process[_0xd410('0xd')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;function analyticExtractedReport(_0x496370,_0x28d4cf){var _0x24a15a={'status':_0x496370};var _0x10e0bf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x28d4cf){_0x24a15a[_0xd410('0xe')]=_0x28d4cf;}return db[_0xd410('0xf')][_0xd410('0x10')](_0x24a15a,_0x10e0bf);}function getHeaders(_0x5bf300){return _[_0xd410('0x11')](_0x5bf300,function(_0x559da1){return{'text':_0x559da1,'style':_0xd410('0x12')};});}function getRows(_0x349b72,_0x44fb51){return _['map'](_0x44fb51,function(_0x46fa63){return _(_0x46fa63)[_0xd410('0x13')](_0x349b72)['map'](function(_0x47053c){return _0x47053c?_[_0xd410('0x14')](_0x47053c):'';})[_0xd410('0x15')]();});}function createTable(_0x52f609,_0x9142b8){var _0x568099={'widths':_[_0xd410('0x16')](Array(_0x52f609[_0xd410('0x17')]),0x91),'heights':function(_0x1d4c27){return _0x1d4c27===0x0?_0xd410('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xea14b=getHeaders(_0x52f609);_0x568099[_0xd410('0x19')]['push'](_0xea14b);var _0x4c4c90=getRows(_0x52f609,_0x9142b8);_0x568099[_0xd410('0x19')]=_0x568099['body'][_0xd410('0x1a')](_0x4c4c90);return _0x568099;}function createTables(_0x45c356){var _0x3a4a91=[];var _0x2e3b3e=Object['keys'](_0x45c356[0x0]);if(_0x45c356[_0xd410('0x17')]>0x5)_0x2e3b3e=_['chunk'](Object[_0xd410('0x1b')](_0x45c356[0x0]),0x5);_0x2e3b3e[_0xd410('0x1c')](function(_0x505a50){_0x3a4a91['push'](createTable(_0x505a50,_0x45c356));});return _0x3a4a91;}function getPDFDocDefinition(_0x18f8d8){var _0x5f265d=util[_0xd410('0x1d')](_0xd410('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xd410('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0xd410('0x1f')])[_0xd410('0x1d')](FORMAT));var _0x50a2c9=[];for(var _0x5c82d2=0x0;_0x5c82d2<_0x18f8d8[_0xd410('0x17')];_0x5c82d2++){var _0xf3660f=[];if(_0x5c82d2===0x0){_0xf3660f['push']({'text':_0x5f265d,'style':_0xd410('0x20')});}var _0x491ca8={'table':_0x18f8d8[_0x5c82d2]};if(_0x5c82d2>0x0){_0x491ca8['pageBreak']='before';_0x491ca8[_0xd410('0x21')]=[0x0,0x46,0x0,0x0];}_0xf3660f['push'](_0x491ca8);_0x50a2c9[_0xd410('0x22')](_0xf3660f);}return{'pageSize':'A4','pageOrientation':_0xd410('0x23'),'content':_0x50a2c9,'footer':function(_0x5744e5,_0x17e2d6){return{'text':_0x5744e5['toString']()+'\x20/\x20'+_0x17e2d6,'style':_0xd410('0x24')};},'defaultStyle':{'font':_0xd410('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xd410('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1b6ec4){var _0x3795b6=0x1388;var _0x5629f0;if(!_0x1b6ec4[0x0][_0xd410('0x27')]){return analyticExtractedReport(_0xd410('0x28'));}var _0x3a997b=[];var _0x394c28=0x0;var _0x18b2ff=!![];var _0xb9fb19=path[_0xd410('0x29')](PATH);var _0x5c3a60=path['basename'](PATH,'.pdf');var _0x28c2ec=path['join'](_0xb9fb19,util['format']('%s.%s',_0x5c3a60,_0xd410('0x2a')));var _0x188c11=![];return db[_0xd410('0x2b')][_0xd410('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0xd410('0x2d')](function(_0x260cfc){if(_0x260cfc){_0x5629f0=_0x260cfc;_0x3795b6=_0x5629f0[_0xd410('0x2e')]||0x3e8;}})[_0xd410('0x2d')](function(){if(_0x1b6ec4&&_0x1b6ec4[_0xd410('0x17')]){var _0x283860=_0x1b6ec4[0x0][_0xd410('0x27')]%(_0x394c28+_0x3795b6);if(_0x5629f0[_0xd410('0x2f')]){for(;_0x18b2ff;_0x394c28+=_0x3795b6,_0x283860=_0x1b6ec4[0x0][_0xd410('0x27')]%(_0x394c28+_0x3795b6)){if(_0x283860==0x0||_0x283860==_0x1b6ec4[0x0][_0xd410('0x27')]){_0x18b2ff=![];}_0x3a997b['push'](dbH[_0xd410('0x30')][_0xd410('0x31')](util[_0xd410('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3795b6,_0x394c28),{'type':dbH[_0xd410('0x30')]['QueryTypes'][_0xd410('0x32')]}));}}else{_0x3a997b[_0xd410('0x22')](dbH['sequelize'][_0xd410('0x31')](QUERY,{'type':dbH[_0xd410('0x30')][_0xd410('0x33')][_0xd410('0x32')]}));}}_0x188c11=_0x5629f0['split']&&_0x3a997b[_0xd410('0x17')]>0x1;if(!fs[_0xd410('0x34')](path[_0xd410('0x35')](_0xb9fb19,_0x5c3a60))&&_0x188c11){fs[_0xd410('0x36')](path[_0xd410('0x35')](_0xb9fb19,_0x5c3a60));}return Promise[_0xd410('0x37')](_0x3a997b);})['then'](function(_0x2045e6){return createTables(_[_0xd410('0x38')](_0x2045e6));})[_0xd410('0x2d')](function(_0x403287){var _0x460042=getPDFDocDefinition(_0x403287);var _0x358c70=getPDFPrinter();var _0x82d80f=_0x358c70[_0xd410('0x39')](_0x460042);if(_0x188c11)_0x28c2ec=path[_0xd410('0x35')](_0xb9fb19,_0x5c3a60,util[_0xd410('0x1d')](_0xd410('0x3a'),_0x5c3a60,index,'pdf'));return writePDFDocument(_0x82d80f,_0x28c2ec);})[_0xd410('0x2d')](function(){if(!_0x188c11)return;zipdir(path[_0xd410('0x35')](_0xb9fb19,_0x5c3a60),{'saveTo':path[_0xd410('0x35')](_0xb9fb19,util['format'](_0xd410('0x3b'),_0x5c3a60,_0xd410('0x3c')))},function(_0x3d9aa3){if(_0x3d9aa3)throw _0x3d9aa3;return;});})[_0xd410('0x2d')](function(){if(!_0x188c11)return;rimraf(path[_0xd410('0x35')](_0xb9fb19,_0x5c3a60),function(){});})[_0xd410('0x2d')](function(){logger[_0xd410('0x3d')](util['format'](_0xd410('0x3e'),EXTRACTED_REPORT_ID,_0xd410('0x3f')));return analyticExtractedReport(_0xd410('0x40'),_0x188c11?util[_0xd410('0x1d')](_0xd410('0x3b'),_0x5c3a60,_0x188c11?_0xd410('0x3c'):_0xd410('0x2a')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xd410('0x3d')](util['format'](_0xd410('0x41'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0xd410('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x5c9f25){EXTRACTED_REPORT=_0x5c9f25;return dbH['sequelize'][_0xd410('0x31')](util[_0xd410('0x1d')](_0xd410('0x43'),QUERY),{'type':dbH[_0xd410('0x30')]['QueryTypes']['SELECT']});})['then'](extractReport)[_0xd410('0x44')](function(_0x49341a){logger[_0xd410('0x3d')](util['format'](_0xd410('0x45'),EXTRACTED_REPORT_ID,'PDF'),util[_0xd410('0x46')](_0x49341a,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xd410('0x47'));});}main();function getPDFPrinter(){var _0x42f147=new PdfPrinter({'Arial':{'normal':__dirname+_0xd410('0x48'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xd410('0x49'),'bolditalics':__dirname+_0xd410('0x4a')}});return _0x42f147;}function getPDFDocDefinitionFromHTML(_0x496185,_0x539872){var _0x223d1d=util['format'](_0xd410('0x4b'),_0x539872[_0xd410('0x4c')],_0x539872['interactionId']);var _0x53bcc8=moment()[_0xd410('0x1d')]('YYYY-MM-DD')[_0xd410('0x14')]();var _0x14c409=htmlToPdfmake(_0x496185,{'window':window,'tableAutoSize':!![]});return{'content':[_0x14c409],'defaultStyle':{'font':_0xd410('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xd410('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xd410('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xd410('0x4e'),'style':_0xd410('0x20')}];},'footer':function(_0x33b297,_0x59387f){return[{'text':util[_0xd410('0x1d')](_0xd410('0x4f'),_0x223d1d,_0x33b297,_0x59387f,_0x53bcc8),'style':_0xd410('0x24')}];}};}function writePDFDocument(_0xc447f1,_0x458cb1){return new Promise(function(_0x1fae95,_0x3f963b){var _0x4aa802=_0xc447f1[_0xd410('0x50')](fs[_0xd410('0x51')](_0x458cb1));_0x4aa802['on'](_0xd410('0x52'),function(){_0x1fae95(_0xd410('0x52'));});_0x4aa802['on'](_0xd410('0x53'),function(_0x3ebda2){_0x3f963b(_0x3ebda2);});_0xc447f1['end']();});}exports[_0xd410('0x54')]=function(_0x38bd56,_0x1bc58f){var _0x2e42ae=getPDFPrinter();var _0x11cb76=getPDFDocDefinitionFromHTML(_0x38bd56,_0x1bc58f);var _0x143ea1=_0x2e42ae[_0xd410('0x39')](_0x11cb76);return writePDFDocument(_0x143ea1,_0x1bc58f['path'])[_0xd410('0x44')](function(_0x635f6a){throw _0x635f6a;});}; \ No newline at end of file +var _0xe57e=['path','moment','html-to-pdfmake','rimraf','JSDOM','window','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','value','length','auto','push','keys','chunk','forEach','name','format','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','Empty','basename','.pdf','join','pdf','Setting','find','split','then','num','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','existsSync','mkdirSync','all','createPdfKitDocument','%s%d.%s','info','CSV','%s.%s','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','createPdfFromHTML','lodash'];(function(_0x2bb9bf,_0xe5455b){var _0xd515fa=function(_0x4619e3){while(--_0x4619e3){_0x2bb9bf['push'](_0x2bb9bf['shift']());}};_0xd515fa(++_0xe5455b);}(_0xe57e,0xf2));var _0xee57=function(_0x5d3cd3,_0x3649b4){_0x5d3cd3=_0x5d3cd3-0x0;var _0x22bbe7=_0xe57e[_0x5d3cd3];return _0x22bbe7;};'use strict';var _=require(_0xee57('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xee57('0x1'));var moment=require(_0xee57('0x2'));var htmlToPdfmake=require(_0xee57('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0xee57('0x4'));var JSDOM=require('jsdom')[_0xee57('0x5')];var window=new JSDOM('')[_0xee57('0x6')];var db=require(_0xee57('0x7'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xee57('0x8'))(_0xee57('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xee57('0xa')][0x2]);var QUERY=process[_0xee57('0xa')][0x3];var PATH=process[_0xee57('0xa')][0x4];var NAME=process[_0xee57('0xa')][0x5];var FORMAT=_0xee57('0xb');var EXTRACTED_REPORT;function analyticExtractedReport(_0x51db0c,_0x571f54){var _0x195956={'status':_0x51db0c};var _0x3bbe45={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x571f54){_0x195956[_0xee57('0xc')]=_0x571f54;}return db[_0xee57('0xd')][_0xee57('0xe')](_0x195956,_0x3bbe45);}function getHeaders(_0x3eb823){return _[_0xee57('0xf')](_0x3eb823,function(_0x4cf131){return{'text':_0x4cf131,'style':'tableHeader'};});}function getRows(_0x45414f,_0x1f46e2){return _[_0xee57('0xf')](_0x1f46e2,function(_0x390305){return _(_0x390305)[_0xee57('0x10')](_0x45414f)['map'](function(_0x1a063f){return _0x1a063f?_['toString'](_0x1a063f):'';})[_0xee57('0x11')]();});}function createTable(_0x4f37fb,_0x312fe3){var _0x4c3b53={'widths':_['fill'](Array(_0x4f37fb[_0xee57('0x12')]),0x91),'heights':function(_0x44d800){return _0x44d800===0x0?_0xee57('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x17a05a=getHeaders(_0x4f37fb);_0x4c3b53['body'][_0xee57('0x14')](_0x17a05a);var _0x2b9106=getRows(_0x4f37fb,_0x312fe3);_0x4c3b53['body']=_0x4c3b53['body']['concat'](_0x2b9106);return _0x4c3b53;}function createTables(_0x41e018){var _0x558acc=[];var _0x9a6461=Object[_0xee57('0x15')](_0x41e018[0x0]);if(_0x41e018[_0xee57('0x12')]>0x5)_0x9a6461=_[_0xee57('0x16')](Object[_0xee57('0x15')](_0x41e018[0x0]),0x5);_0x9a6461[_0xee57('0x17')](function(_0x4ed2e6){_0x558acc[_0xee57('0x14')](createTable(_0x4ed2e6,_0x41e018));});return _0x558acc;}function getPDFDocDefinition(_0xa9c0a5){var _0x10b83c=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xee57('0x18')],moment(EXTRACTED_REPORT['startDate'])[_0xee57('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0xee57('0x1a')])['format'](FORMAT));var _0x466869=[];for(var _0x23fdf3=0x0;_0x23fdf3<_0xa9c0a5[_0xee57('0x12')];_0x23fdf3++){var _0x306f1f=[];if(_0x23fdf3===0x0){_0x306f1f['push']({'text':_0x10b83c,'style':_0xee57('0x1b')});}var _0xb1fdf2={'table':_0xa9c0a5[_0x23fdf3]};if(_0x23fdf3>0x0){_0xb1fdf2[_0xee57('0x1c')]=_0xee57('0x1d');_0xb1fdf2[_0xee57('0x1e')]=[0x0,0x46,0x0,0x0];}_0x306f1f['push'](_0xb1fdf2);_0x466869[_0xee57('0x14')](_0x306f1f);}return{'pageSize':'A4','pageOrientation':_0xee57('0x1f'),'content':_0x466869,'footer':function(_0x4eedc9,_0x2f5cf6){return{'text':_0x4eedc9['toString']()+_0xee57('0x20')+_0x2f5cf6,'style':_0xee57('0x21')};},'defaultStyle':{'font':_0xee57('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xee57('0x23')},'footer':{'alignment':_0xee57('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4f39c4){var _0x47bda3=0x1388;var _0x7ff11d;if(!_0x4f39c4[0x0]['num']){return analyticExtractedReport(_0xee57('0x25'));}var _0x2c4e0f=[];var _0x1c7079=0x0;var _0x19e4a6=!![];var _0x13a8fe=path['dirname'](PATH);var _0xe24fb1=path[_0xee57('0x26')](PATH,_0xee57('0x27'));var _0x51ff51=path[_0xee57('0x28')](_0x13a8fe,util[_0xee57('0x19')]('%s.%s',_0xe24fb1,_0xee57('0x29')));var _0x20ef98=![];return db[_0xee57('0x2a')][_0xee57('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xee57('0x2c'),'splitSizePdf']})[_0xee57('0x2d')](function(_0x75e21c){if(_0x75e21c){_0x7ff11d=_0x75e21c;_0x47bda3=_0x7ff11d['splitSizePdf']||0x3e8;}})[_0xee57('0x2d')](function(){if(_0x4f39c4&&_0x4f39c4[_0xee57('0x12')]){var _0xf5ea2e=_0x4f39c4[0x0][_0xee57('0x2e')]%(_0x1c7079+_0x47bda3);if(_0x7ff11d[_0xee57('0x2c')]){for(;_0x19e4a6;_0x1c7079+=_0x47bda3,_0xf5ea2e=_0x4f39c4[0x0]['num']%(_0x1c7079+_0x47bda3)){if(_0xf5ea2e==0x0||_0xf5ea2e==_0x4f39c4[0x0][_0xee57('0x2e')]){_0x19e4a6=![];}_0x2c4e0f[_0xee57('0x14')](dbH[_0xee57('0x2f')][_0xee57('0x30')](util[_0xee57('0x19')](_0xee57('0x31'),QUERY,_0x47bda3,_0x1c7079),{'type':dbH['sequelize']['QueryTypes'][_0xee57('0x32')]}));}}else{_0x2c4e0f[_0xee57('0x14')](dbH[_0xee57('0x2f')]['query'](QUERY,{'type':dbH['sequelize'][_0xee57('0x33')][_0xee57('0x32')]}));}}_0x20ef98=_0x7ff11d['split']&&_0x2c4e0f[_0xee57('0x12')]>0x1;if(!fs[_0xee57('0x34')](path['join'](_0x13a8fe,_0xe24fb1))&&_0x20ef98){fs[_0xee57('0x35')](path[_0xee57('0x28')](_0x13a8fe,_0xe24fb1));}return Promise[_0xee57('0x36')](_0x2c4e0f);})[_0xee57('0x2d')](function(_0x51e79c){return createTables(_['flatten'](_0x51e79c));})['then'](function(_0x130693){var _0x1b4f50=getPDFDocDefinition(_0x130693);var _0x276bbb=getPDFPrinter();var _0xf32d7b=_0x276bbb[_0xee57('0x37')](_0x1b4f50);if(_0x20ef98)_0x51ff51=path[_0xee57('0x28')](_0x13a8fe,_0xe24fb1,util[_0xee57('0x19')](_0xee57('0x38'),_0xe24fb1,index,_0xee57('0x29')));return writePDFDocument(_0xf32d7b,_0x51ff51);})[_0xee57('0x2d')](function(){if(!_0x20ef98)return;zipdir(path[_0xee57('0x28')](_0x13a8fe,_0xe24fb1),{'saveTo':path[_0xee57('0x28')](_0x13a8fe,util[_0xee57('0x19')]('%s.%s',_0xe24fb1,'zip'))},function(_0x581bfd){if(_0x581bfd)throw _0x581bfd;return;});})['then'](function(){if(!_0x20ef98)return;rimraf(path[_0xee57('0x28')](_0x13a8fe,_0xe24fb1),function(){});})[_0xee57('0x2d')](function(){logger[_0xee57('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xee57('0x3a')));return analyticExtractedReport('Completed',_0x20ef98?util[_0xee57('0x19')](_0xee57('0x3b'),_0xe24fb1,_0x20ef98?'zip':_0xee57('0x29')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0xee57('0x3c'),EXTRACTED_REPORT_ID,_0xee57('0x3d')));return db[_0xee57('0xd')][_0xee57('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xee57('0x2d')](function(_0x5c13e5){EXTRACTED_REPORT=_0x5c13e5;return dbH[_0xee57('0x2f')][_0xee57('0x30')](util[_0xee57('0x19')](_0xee57('0x3f'),QUERY),{'type':dbH[_0xee57('0x2f')][_0xee57('0x33')]['SELECT']});})[_0xee57('0x2d')](extractReport)[_0xee57('0x40')](function(_0x5d9ccb){logger[_0xee57('0x39')](util[_0xee57('0x19')](_0xee57('0x41'),EXTRACTED_REPORT_ID,_0xee57('0x3d')),util[_0xee57('0x42')](_0x5d9ccb,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xee57('0x43'));});}main();function getPDFPrinter(){var _0x3adcd8=new PdfPrinter({'Arial':{'normal':__dirname+_0xee57('0x44'),'bold':__dirname+_0xee57('0x45'),'italics':__dirname+_0xee57('0x46'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x3adcd8;}function getPDFDocDefinitionFromHTML(_0x369e01,_0x2e7af2){var _0x394101=util[_0xee57('0x19')](_0xee57('0x47'),_0x2e7af2[_0xee57('0x48')],_0x2e7af2['interactionId']);var _0x4adf92=moment()[_0xee57('0x19')](_0xee57('0x49'))['toString']();var _0x13058d=htmlToPdfmake(_0x369e01,{'window':window,'tableAutoSize':!![]});return{'content':[_0x13058d],'defaultStyle':{'font':_0xee57('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xee57('0x4a'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xee57('0x4a')}},'header':function(){return[{'text':_0xee57('0x4b'),'style':'header'}];},'footer':function(_0xe58a70,_0x378ba7){return[{'text':util['format'](_0xee57('0x4c'),_0x394101,_0xe58a70,_0x378ba7,_0x4adf92),'style':_0xee57('0x21')}];}};}function writePDFDocument(_0x2fd2b4,_0x423ee0){return new Promise(function(_0x13fd83,_0x2a2555){var _0x57a8f8=_0x2fd2b4['pipe'](fs[_0xee57('0x4d')](_0x423ee0));_0x57a8f8['on'](_0xee57('0x4e'),function(){_0x13fd83(_0xee57('0x4e'));});_0x57a8f8['on'](_0xee57('0x4f'),function(_0x14b3a1){_0x2a2555(_0x14b3a1);});_0x2fd2b4['end']();});}exports[_0xee57('0x50')]=function(_0x2b8a81,_0x3f17db){var _0x83b877=getPDFPrinter();var _0x14b40e=getPDFDocDefinitionFromHTML(_0x2b8a81,_0x3f17db);var _0x280ebc=_0x83b877[_0xee57('0x37')](_0x14b40e);return writePDFDocument(_0x280ebc,_0x3f17db[_0xee57('0x1')])[_0xee57('0x40')](function(_0xc3f41d){throw _0xc3f41d;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index cfee4e7..9392b69 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 _0x571e=['bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','existsSync','join','mkdirSync','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','json2xls'];(function(_0x59cb7b,_0x18843a){var _0x5da7c7=function(_0x56bfe0){while(--_0x56bfe0){_0x59cb7b['push'](_0x59cb7b['shift']());}};_0x5da7c7(++_0x18843a);}(_0x571e,0x1a4));var _0xe571=function(_0x3c26ce,_0x10ec7d){_0x3c26ce=_0x3c26ce-0x0;var _0x2b1cef=_0x571e[_0x3c26ce];return _0x2b1cef;};'use strict';var util=require(_0xe571('0x0'));var path=require(_0xe571('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xe571('0x2'));var BPromise=require(_0xe571('0x3'));var zipdir=require(_0xe571('0x4'));var rimraf=require(_0xe571('0x5'));var db=require(_0xe571('0x6'))['db'];var dbH=require(_0xe571('0x6'))[_0xe571('0x7')];var logger=require('../../config/logger')(_0xe571('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xe571('0x9')][0x4];function analyticExtractedReport(_0x59e1af,_0x119cad){var _0x431bc0={'status':_0x59e1af};var _0x1efe79={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x119cad){_0x431bc0[_0xe571('0xa')]=_0x119cad;}return db[_0xe571('0xb')]['update'](_0x431bc0,_0x1efe79);}function main(){var _0xf8b570=0x1388;var _0x1f2cb9;logger[_0xe571('0xc')](util[_0xe571('0xd')](_0xe571('0xe'),EXTRACTED_REPORT_ID,_0xe571('0xf')));return db[_0xe571('0x10')][_0xe571('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe571('0x12'),'splitSizeXlsx']})[_0xe571('0x13')](function(_0x5d5625){if(_0x5d5625){_0x1f2cb9=_0x5d5625;_0xf8b570=_0x1f2cb9[_0xe571('0x14')]||0x1388;}})['then'](function(){return dbH[_0xe571('0x15')][_0xe571('0x16')](util[_0xe571('0xd')](_0xe571('0x17'),QUERY),{'type':dbH[_0xe571('0x15')][_0xe571('0x18')][_0xe571('0x19')]});})[_0xe571('0x13')](function(_0x5ed512){if(!_0x5ed512[0x0]['num']){return analyticExtractedReport(_0xe571('0x1a'));}var _0x2f9f10=[];var _0x4a33c4=0x0;var _0x4a1550=!![];if(_0x1f2cb9[_0xe571('0x12')]){if(_0x5ed512&&_0x5ed512[_0xe571('0x1b')]){var _0x2a990c=_0x5ed512[0x0][_0xe571('0x1c')]%(_0x4a33c4+_0xf8b570);for(;_0x4a1550;_0x4a33c4+=_0xf8b570,_0x2a990c=_0x5ed512[0x0][_0xe571('0x1c')]%(_0x4a33c4+_0xf8b570)){if(_0x2a990c==0x0||_0x2a990c==_0x5ed512[0x0][_0xe571('0x1c')]){_0x4a1550=![];}_0x2f9f10[_0xe571('0x1d')](dbH['sequelize'][_0xe571('0x16')](util[_0xe571('0xd')](_0xe571('0x1e'),QUERY,_0xf8b570,_0x4a33c4),{'type':dbH[_0xe571('0x15')]['QueryTypes']['SELECT']}));}}}else{_0x2f9f10[_0xe571('0x1d')](dbH['sequelize'][_0xe571('0x16')](QUERY,{'type':dbH[_0xe571('0x15')][_0xe571('0x18')][_0xe571('0x19')]}));}var _0x319b78=path['dirname'](PATH);var _0x257fdc=path[_0xe571('0x1f')](PATH,'.xlsx');var _0x19fe27=_0x1f2cb9['split']&&_0x2f9f10[_0xe571('0x1b')]>0x1;var _0x24db96=[];if(!fs[_0xe571('0x20')](path[_0xe571('0x21')](_0x319b78,_0x257fdc))&&_0x19fe27){fs[_0xe571('0x22')](path[_0xe571('0x21')](_0x319b78,_0x257fdc));}return BPromise['each'](_0x2f9f10,function(_0x8f8e40){_0x24db96[_0xe571('0x1d')](_0x8f8e40);})['then'](function(){for(var _0x9ae173=0x0;_0x9ae173<_0x24db96[_0xe571('0x1b')];_0x9ae173+=0x1){var _0x128779;var _0x202ce9=_0x24db96[_0x9ae173];if(_0x19fe27){_0x128779=path[_0xe571('0x21')](_0x319b78,_0x257fdc,util[_0xe571('0xd')](_0xe571('0x23'),_0x257fdc,_0x9ae173,_0xe571('0x24')));}else{_0x128779=path['join'](_0x319b78,util[_0xe571('0xd')]('%s.%s',_0x257fdc,_0xe571('0x24')));}fs[_0xe571('0x25')](_0x128779,json2xls(_0x202ce9),_0xe571('0x26'));}})[_0xe571('0x13')](function(){if(_0x19fe27){zipdir(path[_0xe571('0x21')](_0x319b78,_0x257fdc),{'saveTo':path[_0xe571('0x21')](_0x319b78,util['format'](_0xe571('0x27'),_0x257fdc,_0xe571('0x28')))},function(_0x2b929d,_0x543252){});rimraf(path['join'](_0x319b78,_0x257fdc),function(){});}})[_0xe571('0x13')](function(){logger['info'](util['format'](_0xe571('0x29'),EXTRACTED_REPORT_ID,_0xe571('0xf')));return analyticExtractedReport(_0xe571('0x2a'),_0x19fe27?util[_0xe571('0xd')]('%s.%s',_0x257fdc,_0x19fe27?'zip':'xlsx'):null);});})[_0xe571('0x2b')](function(_0x5e9b38){logger[_0xe571('0xc')](util[_0xe571('0xd')](_0xe571('0x2c'),EXTRACTED_REPORT_ID,_0xe571('0xf')),util[_0xe571('0x2d')](_0x5e9b38,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xe571('0x2e'));});}main(); \ No newline at end of file +var _0x3c50=['find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.xlsx','length','mkdirSync','join','%s%d.%s','xlsx','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','info','format','XLSX','Setting'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0x3c50,0x132));var _0x03c5=function(_0x161203,_0x1f3d9a){_0x161203=_0x161203-0x0;var _0x438e10=_0x3c50[_0x161203];return _0x438e10;};'use strict';var util=require(_0x03c5('0x0'));var path=require('path');var _=require(_0x03c5('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x03c5('0x2'));var zipdir=require(_0x03c5('0x3'));var rimraf=require(_0x03c5('0x4'));var db=require(_0x03c5('0x5'))['db'];var dbH=require(_0x03c5('0x5'))[_0x03c5('0x6')];var logger=require('../../config/logger')(_0x03c5('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x03c5('0x8')][0x3];var PATH=process[_0x03c5('0x8')][0x4];function analyticExtractedReport(_0x2f856a,_0x55c6a3){var _0x3cc5ef={'status':_0x2f856a};var _0x4dadc4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x55c6a3){_0x3cc5ef['savename']=_0x55c6a3;}return db[_0x03c5('0x9')]['update'](_0x3cc5ef,_0x4dadc4);}function main(){var _0x457ec8=0x1388;var _0x5a3bed;logger[_0x03c5('0xa')](util[_0x03c5('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x03c5('0xc')));return db[_0x03c5('0xd')][_0x03c5('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x03c5('0xf'),_0x03c5('0x10')]})[_0x03c5('0x11')](function(_0x50b2e3){if(_0x50b2e3){_0x5a3bed=_0x50b2e3;_0x457ec8=_0x5a3bed[_0x03c5('0x10')]||0x1388;}})[_0x03c5('0x11')](function(){return dbH[_0x03c5('0x12')][_0x03c5('0x13')](util['format'](_0x03c5('0x14'),QUERY),{'type':dbH[_0x03c5('0x12')]['QueryTypes']['SELECT']});})[_0x03c5('0x11')](function(_0x5a7113){if(!_0x5a7113[0x0]['num']){return analyticExtractedReport('Empty');}var _0xc23735=[];var _0x4c71ed=0x0;var _0x2458fa=!![];if(_0x5a3bed[_0x03c5('0xf')]){if(_0x5a7113&&_0x5a7113['length']){var _0x39ab55=_0x5a7113[0x0][_0x03c5('0x15')]%(_0x4c71ed+_0x457ec8);for(;_0x2458fa;_0x4c71ed+=_0x457ec8,_0x39ab55=_0x5a7113[0x0][_0x03c5('0x15')]%(_0x4c71ed+_0x457ec8)){if(_0x39ab55==0x0||_0x39ab55==_0x5a7113[0x0]['num']){_0x2458fa=![];}_0xc23735[_0x03c5('0x16')](dbH[_0x03c5('0x12')]['query'](util['format'](_0x03c5('0x17'),QUERY,_0x457ec8,_0x4c71ed),{'type':dbH[_0x03c5('0x12')]['QueryTypes']['SELECT']}));}}}else{_0xc23735[_0x03c5('0x16')](dbH[_0x03c5('0x12')][_0x03c5('0x13')](QUERY,{'type':dbH[_0x03c5('0x12')]['QueryTypes'][_0x03c5('0x18')]}));}var _0x4b16b8=path[_0x03c5('0x19')](PATH);var _0x435a0d=path['basename'](PATH,_0x03c5('0x1a'));var _0x436711=_0x5a3bed[_0x03c5('0xf')]&&_0xc23735[_0x03c5('0x1b')]>0x1;var _0x22afe3=[];if(!fs['existsSync'](path['join'](_0x4b16b8,_0x435a0d))&&_0x436711){fs[_0x03c5('0x1c')](path[_0x03c5('0x1d')](_0x4b16b8,_0x435a0d));}return BPromise['each'](_0xc23735,function(_0x142158){_0x22afe3[_0x03c5('0x16')](_0x142158);})['then'](function(){for(var _0x5a5855=0x0;_0x5a5855<_0x22afe3[_0x03c5('0x1b')];_0x5a5855+=0x1){var _0x2926a2;var _0x1c8e68=_0x22afe3[_0x5a5855];if(_0x436711){_0x2926a2=path['join'](_0x4b16b8,_0x435a0d,util[_0x03c5('0xb')](_0x03c5('0x1e'),_0x435a0d,_0x5a5855,_0x03c5('0x1f')));}else{_0x2926a2=path[_0x03c5('0x1d')](_0x4b16b8,util[_0x03c5('0xb')](_0x03c5('0x20'),_0x435a0d,_0x03c5('0x1f')));}fs[_0x03c5('0x21')](_0x2926a2,json2xls(_0x1c8e68),'binary');}})[_0x03c5('0x11')](function(){if(_0x436711){zipdir(path[_0x03c5('0x1d')](_0x4b16b8,_0x435a0d),{'saveTo':path['join'](_0x4b16b8,util[_0x03c5('0xb')]('%s.%s',_0x435a0d,'zip'))},function(_0x54e5eb,_0x3d35f0){});rimraf(path[_0x03c5('0x1d')](_0x4b16b8,_0x435a0d),function(){});}})[_0x03c5('0x11')](function(){logger['info'](util['format'](_0x03c5('0x22'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x03c5('0x23'),_0x436711?util['format']('%s.%s',_0x435a0d,_0x436711?_0x03c5('0x24'):_0x03c5('0x1f')):null);});})['catch'](function(_0x3909fb){logger['info'](util[_0x03c5('0xb')](_0x03c5('0x25'),EXTRACTED_REPORT_ID,_0x03c5('0xc')),util[_0x03c5('0x26')](_0x3909fb,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x03c5('0x27'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index d3436d6..e99ff32 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 _0x01bb=['recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','toLowerCase','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','concat','Hangup','transaction','destroy','bulkCreate','catch','rewrite','lodash','util','Interval','then','models','VoiceExtension','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','VoiceExtensionId','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid='];(function(_0x2caa17,_0x5b090e){var _0x3eb7b2=function(_0x28882b){while(--_0x28882b){_0x2caa17['push'](_0x2caa17['shift']());}};_0x3eb7b2(++_0x5b090e);}(_0x01bb,0x171));var _0xb01b=function(_0x3bfe3d,_0x40ecce){_0x3bfe3d=_0x3bfe3d-0x0;var _0x59bb55=_0x01bb[_0x3bfe3d];return _0x59bb55;};'use strict';var _=require(_0xb01b('0x0'));var util=require(_0xb01b('0x1'));function rewrite(_0x3980b1,_0x183d89){var _0x8590b=this;return _0x3980b1['models'][_0xb01b('0x2')]['findAll']({'raw':!![]})[_0xb01b('0x3')](function(_0x4aee05){_0x8590b['intervals']=_0x4aee05;return _0x3980b1[_0xb01b('0x4')][_0xb01b('0x5')][_0xb01b('0x6')]({'where':{'IntervalId':_0x183d89[_0xb01b('0x7')]},'raw':!![]});})[_0xb01b('0x3')](function(_0x197515){return _0x3980b1[_0xb01b('0x4')][_0xb01b('0x5')]['findAll']({'where':{'exten':{'$in':_[_0xb01b('0x8')](_[_0xb01b('0x9')](_0x197515,_0xb01b('0xa')))}},'order':[{'raw':_0xb01b('0xb')}],'raw':!![]});})[_0xb01b('0x3')](function(_0x553de4){var _0x6326d6=_[_0xb01b('0xc')](_0x553de4,{'priority':'1'});var _0x1045ee=_[_0xb01b('0xc')](_0x553de4,{'isApp':0x1});var _0x5db279=_[_0xb01b('0xd')](_0x1045ee,_0xb01b('0xa'));var _0x5358a7=['queue',_0xb01b('0xe')];var _0x285696=[];var _0x2ab47c=[];for(var _0x1905b5 in _0x5db279){if(_0x5db279[_0xb01b('0xf')](_0x1905b5)){_0x8590b[_0xb01b('0x10')]=0x2;_0x8590b[_0xb01b('0x11')]=[];_0x8590b[_0xb01b('0x12')]=_[_0xb01b('0x13')](_0x6326d6,{'exten':_0x5db279[_0x1905b5][0x0][_0xb01b('0xa')]});_0x8590b['extensions'][_0xb01b('0x14')]({'type':_0x5db279[_0x1905b5][0x0][_0xb01b('0x15')],'app':_0xb01b('0x16'),'appdata':util[_0xb01b('0x17')](_0xb01b('0x18'),_0x5db279[_0x1905b5][0x0][_0xb01b('0x15')]),'context':_0x5db279[_0x1905b5][0x0][_0xb01b('0x19')],'exten':_0x5db279[_0x1905b5][0x0][_0xb01b('0xa')],'priority':_0x8590b[_0xb01b('0x10')]++,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0]['VoiceExtensionId']});if(_0x5db279[_0x1905b5][0x0][_0xb01b('0x15')]===_0xb01b('0x1a')){if(_0x8590b['extension']){_0x8590b[_0xb01b('0x11')][_0xb01b('0x14')]({'type':_0x5db279[_0x1905b5][0x0][_0xb01b('0x15')],'app':_0xb01b('0x16'),'appdata':_0xb01b('0x1b')+(_0x8590b[_0xb01b('0x12')]['cutdigits']?_0xb01b('0x1c')+_0x8590b[_0xb01b('0x12')][_0xb01b('0x1d')]+'}':_0xb01b('0x1e')),'context':_0x5db279[_0x1905b5][0x0][_0xb01b('0x19')],'exten':_0x5db279[_0x1905b5][0x0][_0xb01b('0xa')],'priority':_0x8590b[_0xb01b('0x10')]++,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]});}_0x8590b['extensions']['push']({'type':_0x5db279[_0x1905b5][0x0][_0xb01b('0x15')],'app':_0xb01b('0x16'),'appdata':_0xb01b('0x20')+_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')],'context':_0x5db279[_0x1905b5][0x0][_0xb01b('0x19')],'exten':_0x5db279[_0x1905b5][0x0][_0xb01b('0xa')],'priority':_0x8590b[_0xb01b('0x10')]++,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]});var _0x55da7e=_0x8590b[_0xb01b('0x10')]++;_0x8590b[_0xb01b('0x11')]['push']({'type':_0x5db279[_0x1905b5][0x0][_0xb01b('0x15')],'app':_0xb01b('0x21'),'appdata':_0xb01b('0x22')+(_0x55da7e+0x2)+_0xb01b('0x23')+(_0x55da7e+0x1)+')','context':_0x5db279[_0x1905b5][0x0][_0xb01b('0x19')],'exten':_0x5db279[_0x1905b5][0x0]['exten'],'priority':_0x55da7e,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]});if(_0x8590b[_0xb01b('0x12')]){_0x8590b[_0xb01b('0x11')][_0xb01b('0x14')]({'type':_0x5db279[_0x1905b5][0x0]['type'],'app':_0xb01b('0x16'),'appdata':_0x8590b[_0xb01b('0x12')][_0xb01b('0x1d')]?_0xb01b('0x24')+_0x8590b[_0xb01b('0x12')][_0xb01b('0x1d')]+'}':_0xb01b('0x25'),'context':_0x5db279[_0x1905b5][0x0][_0xb01b('0x19')],'exten':_0x5db279[_0x1905b5][0x0][_0xb01b('0xa')],'priority':_0x8590b[_0xb01b('0x10')]++,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]});}_0x8590b[_0xb01b('0x11')]['push']({'type':_0x5db279[_0x1905b5][0x0][_0xb01b('0x15')],'app':_0xb01b('0x16'),'appdata':_0xb01b('0x26')+_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')],'context':_0x5db279[_0x1905b5][0x0][_0xb01b('0x19')],'exten':_0x5db279[_0x1905b5][0x0][_0xb01b('0xa')],'priority':_0x8590b[_0xb01b('0x10')]++,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]});if(_0x8590b[_0xb01b('0x12')]&&_0x8590b[_0xb01b('0x12')][_0xb01b('0xf')]('recordingFormat')&&_0x8590b['extension'][_0xb01b('0x27')]!=='none'){_0x8590b[_0xb01b('0x11')]['push']({'type':_0x5db279[_0x1905b5][0x0][_0xb01b('0x15')],'app':_0xb01b('0x16'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5db279[_0x1905b5][0x0][_0xb01b('0x19')],'exten':_0x5db279[_0x1905b5][0x0][_0xb01b('0xa')],'priority':_0x8590b['priority']++,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]});_0x8590b[_0xb01b('0x11')]['push']({'type':_0x5db279[_0x1905b5][0x0]['type'],'app':_0xb01b('0x16'),'appdata':_0xb01b('0x28')+_0x8590b['extension'][_0xb01b('0x27')]||_0xb01b('0x29'),'context':_0x5db279[_0x1905b5][0x0][_0xb01b('0x19')],'exten':_0x5db279[_0x1905b5][0x0][_0xb01b('0xa')],'priority':_0x8590b['priority']++,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]});}}_0x8590b[_0xb01b('0x11')][_0xb01b('0x14')]({'type':_0x5db279[_0x1905b5][0x0]['type'],'app':_0xb01b('0x16'),'appdata':_0xb01b('0x2a'),'context':_0x5db279[_0x1905b5][0x0][_0xb01b('0x19')],'exten':_0x5db279[_0x1905b5][0x0][_0xb01b('0xa')],'priority':_0x8590b[_0xb01b('0x10')]++,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]});_0x8590b[_0xb01b('0x11')]['push']({'type':_0x5db279[_0x1905b5][0x0][_0xb01b('0x15')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5db279[_0x1905b5][0x0][_0xb01b('0x19')],'exten':_0x5db279[_0x1905b5][0x0]['exten'],'priority':_0x8590b['priority']++,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]});_0x8590b['extensions'][_0xb01b('0x14')]({'type':_0x5db279[_0x1905b5][0x0][_0xb01b('0x15')],'app':_0xb01b('0x16'),'appdata':_0xb01b('0x2b'),'context':_0x5db279[_0x1905b5][0x0][_0xb01b('0x19')],'exten':_0x5db279[_0x1905b5][0x0][_0xb01b('0xa')],'priority':_0x8590b[_0xb01b('0x10')]++,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0]['VoiceExtensionId']});for(var _0x532d1a=0x0,_0x2893c8=0x0;_0x532d1a<_0x5db279[_0x1905b5][_0xb01b('0x2c')];_0x532d1a+=0x1,_0x2893c8=0x0){var _0x5842a0=_0x5db279[_0x1905b5][_0x532d1a];if(_0x5842a0[_0xb01b('0x15')]){_0x5842a0[_0xb01b('0x15')]=_0x5842a0[_0xb01b('0x15')]['toLowerCase']();}var _0x4b5b42=[];var _0x5bf3bf=[];delete _0x5842a0['id'];delete _0x5842a0[_0xb01b('0x2d')];delete _0x5842a0[_0xb01b('0x2e')];var _0x4abb1d=_0x5842a0[_0xb01b('0x2f')]!==_0xb01b('0x30')?[_0x5842a0[_0xb01b('0x2f')]]:_0x5842a0[_0xb01b('0x7')]?_['map'](_['filter'](_0x8590b[_0xb01b('0x31')],{'IntervalId':_0x5842a0[_0xb01b('0x7')]}),_0xb01b('0x2f')):[];if(_0x5842a0['hasOwnProperty'](_0xb01b('0x32'))){if(_0x5842a0[_0xb01b('0x32')]&&_0x5842a0['tag']!=='--'){_0x4b5b42['push']({'type':_0x5842a0[_0xb01b('0x15')],'app':_0xb01b('0x16'),'appdata':'CDR(tag)='+_0x5842a0[_0xb01b('0x32')],'context':_0x5842a0[_0xb01b('0x19')],'exten':_0x5842a0['exten'],'priority':_0x4abb1d[_0xb01b('0x2c')]+_0x8590b[_0xb01b('0x10')]+_0x2893c8++,'VoiceExtensionId':_0x5842a0['VoiceExtensionId']});}}if(_0x5842a0[_0xb01b('0x15')]==='outbound'&&_0x5842a0[_0xb01b('0xf')](_0xb01b('0x33'))){if(_0x5842a0[_0xb01b('0x33')]){_0x4b5b42[_0xb01b('0x14')]({'type':_0x5842a0[_0xb01b('0x15')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x5842a0[_0xb01b('0x33')]+')','context':_0x5842a0[_0xb01b('0x19')],'exten':_0x5842a0['exten'],'priority':_0x4abb1d[_0xb01b('0x2c')]+_0x8590b['priority']+_0x2893c8++,'VoiceExtensionId':_0x5842a0[_0xb01b('0x1f')]});}else{_0x4b5b42[_0xb01b('0x14')]({'type':_0x5842a0['type'],'app':_0xb01b('0x21'),'appdata':_0xb01b('0x34'),'context':_0x5842a0[_0xb01b('0x19')],'exten':_0x5842a0['exten'],'priority':_0x4abb1d[_0xb01b('0x2c')]+_0x8590b[_0xb01b('0x10')]+_0x2893c8++,'VoiceExtensionId':_0x5842a0[_0xb01b('0x1f')]});}}if(_0x5842a0[_0xb01b('0xf')](_0xb01b('0x35'))){if(_0x5358a7[_0xb01b('0x36')](_0x5842a0['app'][_0xb01b('0x37')]())>=0x0&&_0x5842a0['appType']!==_0xb01b('0x38')){if(_0x5842a0['answer']){_0x4b5b42[_0xb01b('0x14')]({'type':_0x5842a0['type'],'app':_0xb01b('0x21'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5842a0[_0xb01b('0x19')],'exten':_0x5842a0[_0xb01b('0xa')],'priority':_0x4abb1d[_0xb01b('0x2c')]+_0x8590b['priority']+_0x2893c8++,'VoiceExtensionId':_0x5842a0['VoiceExtensionId']});_0x4b5b42[_0xb01b('0x14')]({'type':_0x5842a0['type'],'app':_0xb01b('0x16'),'appdata':_0xb01b('0x39'),'context':_0x5842a0['context'],'exten':_0x5842a0['exten'],'priority':_0x4abb1d['length']+_0x8590b[_0xb01b('0x10')]+_0x2893c8++,'VoiceExtensionId':_0x5842a0['VoiceExtensionId']});}else{_0x4b5b42['push']({'type':_0x5842a0[_0xb01b('0x15')],'app':'ExecIf','appdata':_0xb01b('0x3a'),'context':_0x5842a0['context'],'exten':_0x5842a0[_0xb01b('0xa')],'priority':_0x4abb1d[_0xb01b('0x2c')]+_0x8590b[_0xb01b('0x10')]+_0x2893c8++,'VoiceExtensionId':_0x5842a0[_0xb01b('0x1f')]});_0x4b5b42['push']({'type':_0x5842a0[_0xb01b('0x15')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x5842a0['context'],'exten':_0x5842a0[_0xb01b('0xa')],'priority':_0x4abb1d[_0xb01b('0x2c')]+_0x8590b[_0xb01b('0x10')]+_0x2893c8++,'VoiceExtensionId':_0x5842a0['VoiceExtensionId']});}}}for(var _0x2dc827=0x0;_0x2dc827<_0x4abb1d['length'];_0x2dc827+=0x1){var _0x39b837=_0x8590b[_0xb01b('0x10')]+_0x4abb1d[_0xb01b('0x2c')];var _0x57afe0=_0x2dc827===_0x4abb1d[_0xb01b('0x2c')]-0x1?_0x8590b[_0xb01b('0x10')]+_0x4b5b42[_0xb01b('0x2c')]+_0x5bf3bf[_0xb01b('0x2c')]+0x2:_0x8590b[_0xb01b('0x10')]+_0x2dc827+0x1;_0x4b5b42[_0xb01b('0x3b')](_0x2dc827,0x0,{'type':_0x5842a0[_0xb01b('0x15')],'app':'GotoIfTime','appdata':_0x4abb1d[_0x2dc827]+'?'+_0x5842a0[_0xb01b('0x19')]+',${EXTEN},'+_0x39b837+':'+_0x5842a0[_0xb01b('0x19')]+_0xb01b('0x3c')+_0x57afe0,'exten':_0x5842a0[_0xb01b('0xa')],'context':_0x5842a0[_0xb01b('0x19')],'priority':_0x8590b['priority']+_0x2dc827,'VoiceExtensionId':_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]});}_0x5842a0[_0xb01b('0x10')]=_0x4b5b42[_0xb01b('0x2c')]?_['last'](_0x4b5b42)[_0xb01b('0x10')]+0x1:_0x8590b[_0xb01b('0x10')];_0x8590b['priority']=(_0x5bf3bf['length']?_['last'](_0x5bf3bf)[_0xb01b('0x10')]:_0x5842a0[_0xb01b('0x10')])+0x1;_0x8590b[_0xb01b('0x11')]=_[_0xb01b('0x3d')](_0x8590b['extensions'],_0x4b5b42,[_0x5842a0],_0x5bf3bf);}_0x8590b['extensions'][_0xb01b('0x14')]({'type':_0x5db279[_0x1905b5][0x0][_0xb01b('0x15')],'app':_0xb01b('0x3e'),'exten':_0x5db279[_0x1905b5][0x0]['exten'],'context':_0x5db279[_0x1905b5][0x0]['context'],'priority':_0x8590b[_0xb01b('0x10')],'VoiceExtensionId':_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]});_0x285696['push'](_0x5db279[_0x1905b5][0x0][_0xb01b('0x1f')]);_0x2ab47c=_[_0xb01b('0x3d')](_0x2ab47c,_0x8590b[_0xb01b('0x11')]);}}return _0x3980b1[_0xb01b('0x3f')](function(_0x4bd207){return _0x3980b1[_0xb01b('0x4')][_0xb01b('0x5')][_0xb01b('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x285696}},'transaction':_0x4bd207})[_0xb01b('0x3')](function(_0x20b9ae){return _0x3980b1[_0xb01b('0x4')][_0xb01b('0x5')][_0xb01b('0x41')](_['sortBy'](_0x2ab47c,_0xb01b('0x10')),{'transaction':_0x4bd207});});});})[_0xb01b('0x42')](function(_0x32b9fa){console['error'](_0x32b9fa);});}exports[_0xb01b('0x43')]=rewrite; \ No newline at end of file +var _0x8093=['updatedAt','interval','filter','hasOwnProperty','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','length','answer','indexOf','app','toLowerCase','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','groupBy','playback','extensions','extension','find','type','Set','format','CDR(type)=%s','context','push','cutdigits','${EXTEN:','priority','VoiceExtensionId','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','createdAt'];(function(_0x2b2fee,_0x53c223){var _0x4592b3=function(_0x37d71f){while(--_0x37d71f){_0x2b2fee['push'](_0x2b2fee['shift']());}};_0x4592b3(++_0x53c223);}(_0x8093,0xa9));var _0x3809=function(_0x431807,_0x187385){_0x431807=_0x431807-0x0;var _0x51d062=_0x8093[_0x431807];return _0x51d062;};'use strict';var _=require(_0x3809('0x0'));var util=require(_0x3809('0x1'));function rewrite(_0x30ec67,_0xdce24e){var _0x315a70=this;return _0x30ec67[_0x3809('0x2')]['Interval'][_0x3809('0x3')]({'raw':!![]})[_0x3809('0x4')](function(_0x1a8173){_0x315a70[_0x3809('0x5')]=_0x1a8173;return _0x30ec67[_0x3809('0x2')][_0x3809('0x6')][_0x3809('0x3')]({'where':{'IntervalId':_0xdce24e[_0x3809('0x7')]},'raw':!![]});})[_0x3809('0x4')](function(_0x31db08){return _0x30ec67[_0x3809('0x2')][_0x3809('0x6')]['findAll']({'where':{'exten':{'$in':_[_0x3809('0x8')](_[_0x3809('0x9')](_0x31db08,_0x3809('0xa')))}},'order':[{'raw':_0x3809('0xb')}],'raw':!![]});})['then'](function(_0x54d1f3){var _0x1c8f6f=_['filter'](_0x54d1f3,{'priority':'1'});var _0x3221b7=_['filter'](_0x54d1f3,{'isApp':0x1});var _0x5ab73b=_[_0x3809('0xc')](_0x3221b7,_0x3809('0xa'));var _0x273134=['queue',_0x3809('0xd')];var _0x3e09c0=[];var _0x2db602=[];for(var _0x498dab in _0x5ab73b){if(_0x5ab73b['hasOwnProperty'](_0x498dab)){_0x315a70['priority']=0x2;_0x315a70[_0x3809('0xe')]=[];_0x315a70[_0x3809('0xf')]=_[_0x3809('0x10')](_0x1c8f6f,{'exten':_0x5ab73b[_0x498dab][0x0]['exten']});_0x315a70[_0x3809('0xe')]['push']({'type':_0x5ab73b[_0x498dab][0x0][_0x3809('0x11')],'app':_0x3809('0x12'),'appdata':util[_0x3809('0x13')](_0x3809('0x14'),_0x5ab73b[_0x498dab][0x0][_0x3809('0x11')]),'context':_0x5ab73b[_0x498dab][0x0][_0x3809('0x15')],'exten':_0x5ab73b[_0x498dab][0x0]['exten'],'priority':_0x315a70['priority']++,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0]['VoiceExtensionId']});if(_0x5ab73b[_0x498dab][0x0]['type']==='outbound'){if(_0x315a70['extension']){_0x315a70['extensions'][_0x3809('0x16')]({'type':_0x5ab73b[_0x498dab][0x0]['type'],'app':_0x3809('0x12'),'appdata':'CDR(destination)='+(_0x315a70[_0x3809('0xf')][_0x3809('0x17')]?_0x3809('0x18')+_0x315a70[_0x3809('0xf')][_0x3809('0x17')]+'}':'${EXTEN}'),'context':_0x5ab73b[_0x498dab][0x0][_0x3809('0x15')],'exten':_0x5ab73b[_0x498dab][0x0][_0x3809('0xa')],'priority':_0x315a70[_0x3809('0x19')]++,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0][_0x3809('0x1a')]});}_0x315a70[_0x3809('0xe')][_0x3809('0x16')]({'type':_0x5ab73b[_0x498dab][0x0][_0x3809('0x11')],'app':_0x3809('0x12'),'appdata':'CDR(routeid)='+_0x5ab73b[_0x498dab][0x0]['VoiceExtensionId'],'context':_0x5ab73b[_0x498dab][0x0]['context'],'exten':_0x5ab73b[_0x498dab][0x0][_0x3809('0xa')],'priority':_0x315a70[_0x3809('0x19')]++,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0][_0x3809('0x1a')]});var _0x583cb1=_0x315a70[_0x3809('0x19')]++;_0x315a70['extensions'][_0x3809('0x16')]({'type':_0x5ab73b[_0x498dab][0x0][_0x3809('0x11')],'app':_0x3809('0x1b'),'appdata':_0x3809('0x1c')+(_0x583cb1+0x2)+_0x3809('0x1d')+(_0x583cb1+0x1)+')','context':_0x5ab73b[_0x498dab][0x0]['context'],'exten':_0x5ab73b[_0x498dab][0x0]['exten'],'priority':_0x583cb1,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0][_0x3809('0x1a')]});if(_0x315a70['extension']){_0x315a70[_0x3809('0xe')]['push']({'type':_0x5ab73b[_0x498dab][0x0]['type'],'app':_0x3809('0x12'),'appdata':_0x315a70[_0x3809('0xf')][_0x3809('0x17')]?_0x3809('0x1e')+_0x315a70[_0x3809('0xf')][_0x3809('0x17')]+'}':'CDR(prefix)=noprefix','context':_0x5ab73b[_0x498dab][0x0][_0x3809('0x15')],'exten':_0x5ab73b[_0x498dab][0x0]['exten'],'priority':_0x315a70[_0x3809('0x19')]++,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0][_0x3809('0x1a')]});}_0x315a70[_0x3809('0xe')]['push']({'type':_0x5ab73b[_0x498dab][0x0][_0x3809('0x11')],'app':_0x3809('0x12'),'appdata':_0x3809('0x1f')+_0x5ab73b[_0x498dab][0x0][_0x3809('0x1a')],'context':_0x5ab73b[_0x498dab][0x0][_0x3809('0x15')],'exten':_0x5ab73b[_0x498dab][0x0][_0x3809('0xa')],'priority':_0x315a70['priority']++,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0][_0x3809('0x1a')]});if(_0x315a70[_0x3809('0xf')]&&_0x315a70['extension']['hasOwnProperty'](_0x3809('0x20'))&&_0x315a70['extension'][_0x3809('0x20')]!==_0x3809('0x21')){_0x315a70['extensions'][_0x3809('0x16')]({'type':_0x5ab73b[_0x498dab][0x0]['type'],'app':_0x3809('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5ab73b[_0x498dab][0x0]['context'],'exten':_0x5ab73b[_0x498dab][0x0]['exten'],'priority':_0x315a70[_0x3809('0x19')]++,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0]['VoiceExtensionId']});_0x315a70[_0x3809('0xe')][_0x3809('0x16')]({'type':_0x5ab73b[_0x498dab][0x0][_0x3809('0x11')],'app':_0x3809('0x12'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x315a70[_0x3809('0xf')]['recordingFormat']||'wav','context':_0x5ab73b[_0x498dab][0x0][_0x3809('0x15')],'exten':_0x5ab73b[_0x498dab][0x0]['exten'],'priority':_0x315a70[_0x3809('0x19')]++,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0]['VoiceExtensionId']});}}_0x315a70[_0x3809('0xe')][_0x3809('0x16')]({'type':_0x5ab73b[_0x498dab][0x0]['type'],'app':'Set','appdata':_0x3809('0x22'),'context':_0x5ab73b[_0x498dab][0x0][_0x3809('0x15')],'exten':_0x5ab73b[_0x498dab][0x0][_0x3809('0xa')],'priority':_0x315a70[_0x3809('0x19')]++,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0][_0x3809('0x1a')]});_0x315a70[_0x3809('0xe')][_0x3809('0x16')]({'type':_0x5ab73b[_0x498dab][0x0][_0x3809('0x11')],'app':_0x3809('0x12'),'appdata':_0x3809('0x23'),'context':_0x5ab73b[_0x498dab][0x0][_0x3809('0x15')],'exten':_0x5ab73b[_0x498dab][0x0][_0x3809('0xa')],'priority':_0x315a70[_0x3809('0x19')]++,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0][_0x3809('0x1a')]});_0x315a70['extensions'][_0x3809('0x16')]({'type':_0x5ab73b[_0x498dab][0x0][_0x3809('0x11')],'app':_0x3809('0x12'),'appdata':_0x3809('0x24'),'context':_0x5ab73b[_0x498dab][0x0][_0x3809('0x15')],'exten':_0x5ab73b[_0x498dab][0x0]['exten'],'priority':_0x315a70['priority']++,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0]['VoiceExtensionId']});for(var _0x497748=0x0,_0x592412=0x0;_0x497748<_0x5ab73b[_0x498dab]['length'];_0x497748+=0x1,_0x592412=0x0){var _0x1fb4eb=_0x5ab73b[_0x498dab][_0x497748];if(_0x1fb4eb['type']){_0x1fb4eb[_0x3809('0x11')]=_0x1fb4eb[_0x3809('0x11')]['toLowerCase']();}var _0x5901fb=[];var _0x28793e=[];delete _0x1fb4eb['id'];delete _0x1fb4eb[_0x3809('0x25')];delete _0x1fb4eb[_0x3809('0x26')];var _0x506512=_0x1fb4eb[_0x3809('0x27')]!=='*,*,*,*'?[_0x1fb4eb['interval']]:_0x1fb4eb[_0x3809('0x7')]?_[_0x3809('0x9')](_[_0x3809('0x28')](_0x315a70[_0x3809('0x5')],{'IntervalId':_0x1fb4eb[_0x3809('0x7')]}),'interval'):[];if(_0x1fb4eb[_0x3809('0x29')](_0x3809('0x2a'))){if(_0x1fb4eb[_0x3809('0x2a')]&&_0x1fb4eb[_0x3809('0x2a')]!=='--'){_0x5901fb[_0x3809('0x16')]({'type':_0x1fb4eb['type'],'app':_0x3809('0x12'),'appdata':_0x3809('0x2b')+_0x1fb4eb[_0x3809('0x2a')],'context':_0x1fb4eb['context'],'exten':_0x1fb4eb[_0x3809('0xa')],'priority':_0x506512['length']+_0x315a70[_0x3809('0x19')]+_0x592412++,'VoiceExtensionId':_0x1fb4eb[_0x3809('0x1a')]});}}if(_0x1fb4eb[_0x3809('0x11')]===_0x3809('0x2c')&&_0x1fb4eb[_0x3809('0x29')](_0x3809('0x2d'))){if(_0x1fb4eb['callerID']){_0x5901fb[_0x3809('0x16')]({'type':_0x1fb4eb[_0x3809('0x11')],'app':_0x3809('0x1b'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x1fb4eb[_0x3809('0x2d')]+')','context':_0x1fb4eb['context'],'exten':_0x1fb4eb['exten'],'priority':_0x506512['length']+_0x315a70['priority']+_0x592412++,'VoiceExtensionId':_0x1fb4eb[_0x3809('0x1a')]});}else{_0x5901fb[_0x3809('0x16')]({'type':_0x1fb4eb['type'],'app':_0x3809('0x1b'),'appdata':_0x3809('0x2e'),'context':_0x1fb4eb[_0x3809('0x15')],'exten':_0x1fb4eb[_0x3809('0xa')],'priority':_0x506512[_0x3809('0x2f')]+_0x315a70[_0x3809('0x19')]+_0x592412++,'VoiceExtensionId':_0x1fb4eb['VoiceExtensionId']});}}if(_0x1fb4eb[_0x3809('0x29')](_0x3809('0x30'))){if(_0x273134[_0x3809('0x31')](_0x1fb4eb[_0x3809('0x32')][_0x3809('0x33')]())>=0x0&&_0x1fb4eb['appType']!==_0x3809('0x34')){if(_0x1fb4eb['answer']){_0x5901fb['push']({'type':_0x1fb4eb[_0x3809('0x11')],'app':'ExecIf','appdata':_0x3809('0x35'),'context':_0x1fb4eb[_0x3809('0x15')],'exten':_0x1fb4eb[_0x3809('0xa')],'priority':_0x506512[_0x3809('0x2f')]+_0x315a70['priority']+_0x592412++,'VoiceExtensionId':_0x1fb4eb[_0x3809('0x1a')]});_0x5901fb[_0x3809('0x16')]({'type':_0x1fb4eb['type'],'app':_0x3809('0x12'),'appdata':_0x3809('0x36'),'context':_0x1fb4eb[_0x3809('0x15')],'exten':_0x1fb4eb['exten'],'priority':_0x506512[_0x3809('0x2f')]+_0x315a70['priority']+_0x592412++,'VoiceExtensionId':_0x1fb4eb[_0x3809('0x1a')]});}else{_0x5901fb[_0x3809('0x16')]({'type':_0x1fb4eb['type'],'app':_0x3809('0x1b'),'appdata':_0x3809('0x37'),'context':_0x1fb4eb['context'],'exten':_0x1fb4eb[_0x3809('0xa')],'priority':_0x506512['length']+_0x315a70['priority']+_0x592412++,'VoiceExtensionId':_0x1fb4eb[_0x3809('0x1a')]});_0x5901fb['push']({'type':_0x1fb4eb[_0x3809('0x11')],'app':_0x3809('0x12'),'appdata':_0x3809('0x38'),'context':_0x1fb4eb[_0x3809('0x15')],'exten':_0x1fb4eb[_0x3809('0xa')],'priority':_0x506512[_0x3809('0x2f')]+_0x315a70['priority']+_0x592412++,'VoiceExtensionId':_0x1fb4eb['VoiceExtensionId']});}}}for(var _0x173225=0x0;_0x173225<_0x506512[_0x3809('0x2f')];_0x173225+=0x1){var _0x2ad895=_0x315a70[_0x3809('0x19')]+_0x506512[_0x3809('0x2f')];var _0x404033=_0x173225===_0x506512[_0x3809('0x2f')]-0x1?_0x315a70[_0x3809('0x19')]+_0x5901fb[_0x3809('0x2f')]+_0x28793e[_0x3809('0x2f')]+0x2:_0x315a70['priority']+_0x173225+0x1;_0x5901fb[_0x3809('0x39')](_0x173225,0x0,{'type':_0x1fb4eb[_0x3809('0x11')],'app':_0x3809('0x3a'),'appdata':_0x506512[_0x173225]+'?'+_0x1fb4eb['context']+',${EXTEN},'+_0x2ad895+':'+_0x1fb4eb[_0x3809('0x15')]+_0x3809('0x3b')+_0x404033,'exten':_0x1fb4eb['exten'],'context':_0x1fb4eb[_0x3809('0x15')],'priority':_0x315a70[_0x3809('0x19')]+_0x173225,'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0]['VoiceExtensionId']});}_0x1fb4eb[_0x3809('0x19')]=_0x5901fb[_0x3809('0x2f')]?_[_0x3809('0x3c')](_0x5901fb)[_0x3809('0x19')]+0x1:_0x315a70[_0x3809('0x19')];_0x315a70['priority']=(_0x28793e[_0x3809('0x2f')]?_[_0x3809('0x3c')](_0x28793e)[_0x3809('0x19')]:_0x1fb4eb[_0x3809('0x19')])+0x1;_0x315a70['extensions']=_[_0x3809('0x3d')](_0x315a70['extensions'],_0x5901fb,[_0x1fb4eb],_0x28793e);}_0x315a70[_0x3809('0xe')]['push']({'type':_0x5ab73b[_0x498dab][0x0]['type'],'app':_0x3809('0x3e'),'exten':_0x5ab73b[_0x498dab][0x0][_0x3809('0xa')],'context':_0x5ab73b[_0x498dab][0x0][_0x3809('0x15')],'priority':_0x315a70[_0x3809('0x19')],'VoiceExtensionId':_0x5ab73b[_0x498dab][0x0][_0x3809('0x1a')]});_0x3e09c0[_0x3809('0x16')](_0x5ab73b[_0x498dab][0x0][_0x3809('0x1a')]);_0x2db602=_[_0x3809('0x3d')](_0x2db602,_0x315a70['extensions']);}}return _0x30ec67[_0x3809('0x3f')](function(_0x671915){return _0x30ec67['models'][_0x3809('0x6')][_0x3809('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x3e09c0}},'transaction':_0x671915})[_0x3809('0x4')](function(_0x1c66b2){return _0x30ec67[_0x3809('0x2')][_0x3809('0x6')][_0x3809('0x41')](_[_0x3809('0x42')](_0x2db602,'priority'),{'transaction':_0x671915});});});})['catch'](function(_0xd88bbc){console[_0x3809('0x43')](_0xd88bbc);});}exports[_0x3809('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 75b738f..ef63264 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 _0xbaf0=['YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','fromQuery','cm_contacts','str','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','BlackLists','get','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','duplicate','pause','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate'];(function(_0xed9a,_0x536521){var _0x40f3db=function(_0x2730a9){while(--_0x2730a9){_0xed9a['push'](_0xed9a['shift']());}};_0x40f3db(++_0x536521);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var BPromise=require('bluebird');var util=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var fs=require('fs');var squel=require(_0x0baf('0x2'));var Papa=require(_0x0baf('0x3'));var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));config[_0x0baf('0x8')]=_[_0x0baf('0x9')](config[_0x0baf('0x8')],{'host':_0x0baf('0xa'),'port':0x18eb});var socket=require(_0x0baf('0xb'))(new Redis(config[_0x0baf('0x8')]));require(_0x0baf('0xc'))['register'](socket);try{if(!process[_0x0baf('0xd')][0x2]||process['argv'][0x2]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x2]===_0x0baf('0xf')){throw new Error(_0x0baf('0x10'));}var FILEPATH=process[_0x0baf('0xd')][0x2];if(!process[_0x0baf('0xd')][0x3]||process[_0x0baf('0xd')][0x3]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x3]===_0x0baf('0xf')||!process[_0x0baf('0xd')][0x4]||process['argv'][0x4]==='undefined'||process[_0x0baf('0xd')][0x4]===_0x0baf('0xf')){throw new Error(_0x0baf('0x11'));}var FIELDS=_[_0x0baf('0x12')](process['argv'][0x3][_0x0baf('0x13')](','),process['argv'][0x4][_0x0baf('0x13')](','));if(!process[_0x0baf('0xd')][0x5]||process[_0x0baf('0xd')][0x5]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x5]===_0x0baf('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x0baf('0xd')][0x6]&&process[_0x0baf('0xd')][0x6]!==_0x0baf('0xe')&&process[_0x0baf('0xd')][0x6]!==_0x0baf('0xf')?process[_0x0baf('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x0baf('0xd')][0x7]!==_0x0baf('0xe')&&process[_0x0baf('0xd')][0x7]!==_0x0baf('0xf')?process[_0x0baf('0xd')][0x7]:null;if(!process[_0x0baf('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0x0baf('0xd')][0x8]===_0x0baf('0xf')){throw new Error(_0x0baf('0x14'));}var SOCKET_TIMESTAMP=process[_0x0baf('0xd')][0x8];}catch(_0x1fa92b){logger[_0x0baf('0x15')](_0x1fa92b);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(_0x210cd8,_0x636a13,_0x2c42e2,_0x15a2c3){var _0x54f2fa={'message':_0x636a13};_0x54f2fa[_0x210cd8]=!![];if(_0x2c42e2){_0x54f2fa[_0x0baf('0x16')]=_0x2c42e2;}if(_0x15a2c3){_0x54f2fa['index']=_0x15a2c3;}return _0x54f2fa;}function isEmail(_0xf6c158){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'](_0xf6c158);}function checkRow(_0x4de74c,_0x2ef0aa,_0x48a0e9){return new BPromise(function(_0x4be1b9,_0x47c4b){if(_[_0x0baf('0x17')](_0x4de74c)){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x18'),null,_0x48a0e9));}if(_0x4de74c[_0x0baf('0x19')]&&_0x4de74c['errors'][_0x0baf('0x1a')]){var _0x4681c5=_[_0x0baf('0x1b')](_0x4de74c[_0x0baf('0x19')],_0x0baf('0x1c'))[_0x0baf('0x1d')](';');return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x4681c5,null,_0x48a0e9));}var _0x549fd0={};for(var _0x1590b4 in FIELDS){if(FIELDS[_0x0baf('0x1e')](_0x1590b4)&&FIELDS[_0x1590b4]){_0x549fd0[_0x1590b4]=_0x4de74c[_0x0baf('0x1f')][0x0][FIELDS[_0x1590b4]]||_0x4de74c[_0x0baf('0x1f')][0x0]['\ufeff'+FIELDS[_0x1590b4]];}}if(!_0x549fd0['firstName']){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x20'),null,_0x48a0e9));}if(!_0x549fd0['phone']){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x21'),null,_0x48a0e9));}if(_0x549fd0[_0x0baf('0x22')]){var _0xb4dbb1=moment(_0x549fd0[_0x0baf('0x22')],_0x0baf('0x23'));if(!_0xb4dbb1[_0x0baf('0x24')]()){return _0x47c4b(handleCheckRowError('error',_0x0baf('0x25'),null,_0x48a0e9));}}if(_0x549fd0[_0x0baf('0x26')]){if(!isEmail(_0x549fd0[_0x0baf('0x26')])){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x27'),null,_0x48a0e9));}}_0x549fd0[_0x0baf('0x28')]=LISTID;_0x549fd0[_0x0baf('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0baf('0x1a')]&&_0x2ef0aa){var _0x59431b={};for(var _0x3ded64=0x0,_0x2adfd7=DUPLICATES[_0x0baf('0x1a')];_0x3ded64<_0x2adfd7;_0x3ded64+=0x1){_0x59431b[DUPLICATES[_0x3ded64]]=_0x549fd0[DUPLICATES[_0x3ded64]];}var _0x45294a=_[_0x0baf('0x2a')](_0x2ef0aa,_0x59431b);if(_0x45294a){return _0x47c4b(handleCheckRowError('duplicate',_0x0baf('0x2b'),_0x45294a,_0x48a0e9));}}return db['CmContact'][_0x0baf('0x2c')](_0x549fd0,{'raw':!![],'hooks':![],'fields':_[_0x0baf('0x2d')](_0x549fd0)})[_0x0baf('0x2e')](function(_0x3d65f2){if(DUPLICATES&&DUPLICATES['length']&&_0x2ef0aa){_0x2ef0aa[_0x0baf('0x2f')](_[_0x0baf('0x30')](_0x549fd0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3d65f2['id'];return _0x4be1b9();})['catch'](function(_0x23d890){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x31')+(_0x23d890[_0x0baf('0x1c')]||JSON[_0x0baf('0x32')](_0x23d890)),null,_0x48a0e9));});});}function checkHopper(){function _0x1b0991(){return function(_0xe03d82){logger[_0x0baf('0x15')]('cmContact',_0x0baf('0x33'),util[_0x0baf('0x34')](_0xe03d82,{'showHidden':![],'depth':null}));};}var _0x5b991f=function(_0x32c022,_0x57783c){var _0x5c545f=squel[_0x0baf('0x35')]()[_0x0baf('0x36')]('cm_hopper')['fromQuery']([_0x0baf('0x37'),_0x0baf('0x38'),_0x0baf('0x39'),_0x0baf('0x28'),_0x57783c,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),_0x0baf('0x37'))[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x38'))[_0x0baf('0x3d')]('id','ContactId')[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),'ListId')[_0x0baf('0x3d')](_0x32c022['id'][_0x0baf('0x3f')](),_0x57783c)[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3a'))[_0x0baf('0x3d')]('NOW()',_0x0baf('0x3b'))[_0x0baf('0x40')]('cm_contacts')[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')](_0x0baf('0x43'),LISTID['toString']())[_0x0baf('0x41')](_0x0baf('0x44'))[_0x0baf('0x41')](_0x0baf('0x45'),squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'))[_0x0baf('0x40')](_0x0baf('0x46'))[_0x0baf('0x41')](_0x57783c+'\x20=\x20?',_0x32c022['id'][_0x0baf('0x3f')]())))[_0x0baf('0x3f')]();return _0x5c545f;};var _0x1daf1d=function(_0x339aff,_0x22207a){var _0x55f4f8=squel[_0x0baf('0x35')]()[_0x0baf('0x36')](_0x0baf('0x46'))[_0x0baf('0x47')]([_0x0baf('0x37'),'scheduledAt',_0x0baf('0x39'),_0x0baf('0x28'),_0x22207a,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),'phone')[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x38'))['field']('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),_0x0baf('0x28'))[_0x0baf('0x3d')](_0x339aff['id'][_0x0baf('0x3f')](),_0x22207a)[_0x0baf('0x3d')]('NOW()',_0x0baf('0x3a'))[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')](_0x0baf('0x43'),LISTID[_0x0baf('0x3f')]())['where']('id\x20IN\x20?',squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44'))[_0x0baf('0x41')](_0x0baf('0x45'),squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')]('calleridnum')[_0x0baf('0x40')](_0x0baf('0x4a'))[_0x0baf('0x41')](_0x22207a+_0x0baf('0x4b'),_0x339aff['id'][_0x0baf('0x3f')]()))[_0x0baf('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0baf('0x3c')]()['field'](_0x0baf('0x37'))['from'](_0x0baf('0x46'))['where'](_0x22207a+_0x0baf('0x4b'),_0x339aff['id']['toString']())))[_0x0baf('0x3f')]();return _0x55f4f8;};function _0xcf7b8d(_0x411c1f,_0x4520d1){var _0x42a68b=squel['insert']()[_0x0baf('0x36')](_0x0baf('0x46'))[_0x0baf('0x47')]([_0x0baf('0x37'),_0x0baf('0x38'),_0x0baf('0x39'),'ListId',_0x4520d1,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),_0x0baf('0x37'))[_0x0baf('0x3d')]('NOW()','scheduledAt')[_0x0baf('0x3d')]('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),_0x0baf('0x28'))[_0x0baf('0x3d')](_0x411c1f['id'][_0x0baf('0x3f')](),_0x4520d1)[_0x0baf('0x3d')](_0x0baf('0x3e'),'createdAt')[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))['where'](_0x0baf('0x43'),LISTID[_0x0baf('0x3f')]())[_0x0baf('0x41')](_0x0baf('0x4c'),squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44')))[_0x0baf('0x3f')]();return _0x42a68b;}function _0x498405(_0x178495,_0x5dc434){var _0x3c00e7=squel['insert']()['into'](_0x0baf('0x4d'))['fromQuery']([_0x0baf('0x37'),_0x0baf('0x39'),'ListId',_0x5dc434,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()['field']('phone',_0x0baf('0x37'))[_0x0baf('0x3d')]('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),'ListId')[_0x0baf('0x3d')](_0x178495['id']['toString'](),_0x5dc434)['field']('NOW()',_0x0baf('0x3a'))['field']('NOW()',_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')]('ListId\x20=\x20?',LISTID[_0x0baf('0x3f')]())[_0x0baf('0x41')](_0x0baf('0x4c'),squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44')))['toString']();return _0x3c00e7;}return db[_0x0baf('0x4e')][_0x0baf('0x4f')]({'where':{'type':_0x0baf('0x50')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x0baf('0x51')],'as':_0x0baf('0x52'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x2c20fe){var _0x125906=[];if(_0x2c20fe){var _0x27a959;for(var _0x4cc046=0x0,_0x5874cc;_0x4cc046<_0x2c20fe['length'];_0x4cc046+=0x1){_0x5874cc=_0x2c20fe[_0x4cc046]['get']({'plain':!![]});switch(_0x5874cc[_0x0baf('0x53')]){case _0x0baf('0x54'):_0x125906[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x1daf1d(_0x5874cc,_0x0baf('0x57')))['then'](function(){})['catch'](_0x1b0991()));break;case _0x0baf('0x58'):_0x125906['push'](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x5b991f(_0x5874cc,'VoiceQueueId'))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));break;default:_0x125906[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0xcf7b8d(_0x5874cc,_0x0baf('0x57')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}}return _0x125906;})[_0x0baf('0x5a')]()['then'](function(){return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0baf('0x5b'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x333b07){var _0x20a514=[];if(_0x333b07){var _0x5093f5;for(var _0x1be7f2=0x0,_0x410f6c;_0x1be7f2<_0x333b07['length'];_0x1be7f2+=0x1){_0x410f6c=_0x333b07[_0x1be7f2]['get']({'plain':!![]});_0x20a514[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x498405(_0x410f6c,_0x0baf('0x57')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}return _0x20a514;})[_0x0baf('0x5a')]();})[_0x0baf('0x2e')](function(){return db['Campaign'][_0x0baf('0x4f')]({'attributes':['id',_0x0baf('0x53')],'include':[{'model':db['CmList'],'as':_0x0baf('0x52'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x538f24){var _0x97d385=[];if(_0x538f24){for(var _0x4043d5=0x0,_0x421ca0;_0x4043d5<_0x538f24[_0x0baf('0x1a')];_0x4043d5+=0x1){_0x421ca0=_0x538f24[_0x4043d5][_0x0baf('0x5c')]({'plain':!![]});switch(_0x421ca0['dialCheckDuplicateType']){case'always':_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')]['query'](_0x1daf1d(_0x421ca0,_0x0baf('0x5d')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));break;case'onlyIfOpen':_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x5b991f(_0x421ca0,'CampaignId'))[_0x0baf('0x2e')](function(){})['catch'](_0x1b0991()));break;default:_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0xcf7b8d(_0x421ca0,_0x0baf('0x5d')))[_0x0baf('0x2e')](function(){})['catch'](_0x1b0991()));}}}return _0x97d385;})[_0x0baf('0x5a')]();})[_0x0baf('0x2e')](function(){return db['Campaign'][_0x0baf('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x0baf('0x51')],'as':_0x0baf('0x5b'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x1cbbcc){var _0x250df2=[];if(_0x1cbbcc){for(var _0xa4fd1b=0x0,_0x1cda78;_0xa4fd1b<_0x1cbbcc[_0x0baf('0x1a')];_0xa4fd1b+=0x1){_0x1cda78=_0x1cbbcc[_0xa4fd1b][_0x0baf('0x5c')]({'plain':!![]});_0x250df2[_0x0baf('0x2f')](db[_0x0baf('0x55')]['query'](_0x498405(_0x1cda78,'CampaignId'))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}return _0x250df2;})[_0x0baf('0x5a')]();})['catch'](function(_0x507783){logger[_0x0baf('0x15')](_0x0baf('0x5e'),_0x0baf('0x5f'),_0x507783[_0x0baf('0x1c')]);});}var processPromises=function(_0x2dcdfe){return BPromise[_0x0baf('0x5a')](promises)[_0x0baf('0x2e')](function(_0xa2d315){})[_0x0baf('0x59')](function(_0x4e8e85){logger[_0x0baf('0x15')](_0x0baf('0x60'),JSON[_0x0baf('0x32')](_0x4e8e85));})[_0x0baf('0x61')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2dcdfe){return _0x2dcdfe['resume']();}});};var endCsv=function(){return BPromise[_0x0baf('0x62')]()[_0x0baf('0x2e')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x0baf('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0baf('0x64')](FILEPATH);}catch(_0x52e0c4){logger[_0x0baf('0x15')](_0x0baf('0x65'),JSON[_0x0baf('0x32')](_0x52e0c4));}finally{process[_0x0baf('0x66')](0x0);}});};process['on'](_0x0baf('0x67'),function(){logger[_0x0baf('0x68')](_0x0baf('0x69'));endCsv();});function main(){return BPromise[_0x0baf('0x62')]()[_0x0baf('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0baf('0x13')](',');return db[_0x0baf('0x6a')][_0x0baf('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1ed607){var _0xd0f63b=fs[_0x0baf('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0baf('0x6c')](_0xd0f63b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c37b4,_0x195303){total+=0x1;var _0x49d411=total;promises[_0x0baf('0x2f')](checkRow(_0x3c37b4,_0x1ed607,_0x49d411)[_0x0baf('0x2e')](function(){success+=0x1;})[_0x0baf('0x59')](function(_0x457ae8){if(_0x457ae8[_0x0baf('0x15')]){errors+=0x1;delete _0x457ae8['error'];}else if(_0x457ae8[_0x0baf('0x6d')]){duplicates+=0x1;delete _0x457ae8[_0x0baf('0x6d')];}rows[_0x0baf('0x2f')](_0x457ae8);}));if(total%0xc8===0x0){_0x195303[_0x0baf('0x6e')]();return processPromises(_0x195303);}},'complete':function(){return processPromises()[_0x0baf('0x2e')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0xb5f4e5,_0x5a2454){logger[_0x0baf('0x68')]('CSV\x20parse\x20error',JSON[_0x0baf('0x32')](_0xb5f4e5));endCsv();}});})[_0x0baf('0x59')](function(_0x1ce7bb){logger[_0x0baf('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x0baf('0x32')](_0x1ce7bb));});}main(); \ No newline at end of file +var _0xd8b0=['find','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','ListId','toString','NOW()','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','insert','deletedAt\x20IS\x20NULL','str','cm_hopper_black','VoiceQueue','outbound','Lists','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','onlyIfOpen','query','all','CmList','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','hasOwnProperty','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email','CompanyId','length'];(function(_0x122fb1,_0x3c8e63){var _0x15f0c2=function(_0x566f33){while(--_0x566f33){_0x122fb1['push'](_0x122fb1['shift']());}};_0x15f0c2(++_0x3c8e63);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var socket=require(_0x0d8b('0x9'))(new Redis(config['redis']));require(_0x0d8b('0xa'))[_0x0d8b('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0xf'));}var FILEPATH=process[_0x0d8b('0xc')][0x2];if(!process[_0x0d8b('0xc')][0x3]||process[_0x0d8b('0xc')][0x3]==='undefined'||process[_0x0d8b('0xc')][0x3]==='null'||!process[_0x0d8b('0xc')][0x4]||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x10'));}var FIELDS=_[_0x0d8b('0x11')](process[_0x0d8b('0xc')][0x3][_0x0d8b('0x12')](','),process[_0x0d8b('0xc')][0x4][_0x0d8b('0x12')](','));if(!process[_0x0d8b('0xc')][0x5]||process[_0x0d8b('0xc')][0x5]===_0x0d8b('0xd')||process['argv'][0x5]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x13'));}var LISTID=process[_0x0d8b('0xc')][0x5];var COMPANYID=process[_0x0d8b('0xc')][0x6]&&process[_0x0d8b('0xc')][0x6]!=='undefined'&&process[_0x0d8b('0xc')][0x6]!==_0x0d8b('0xe')?process[_0x0d8b('0xc')][0x6]:null;var DUPLICATES=process[_0x0d8b('0xc')][0x7]&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xd')&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xe')?process['argv'][0x7]:null;if(!process[_0x0d8b('0xc')][0x8]||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x14'));}var SOCKET_TIMESTAMP=process[_0x0d8b('0xc')][0x8];}catch(_0x352c17){logger['error'](_0x352c17);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(_0x4f0a1a,_0x33fb87,_0x54a9a7,_0x56c729){var _0x5527d8={'message':_0x33fb87};_0x5527d8[_0x4f0a1a]=!![];if(_0x54a9a7){_0x5527d8[_0x0d8b('0x15')]=_0x54a9a7;}if(_0x56c729){_0x5527d8[_0x0d8b('0x16')]=_0x56c729;}return _0x5527d8;}function isEmail(_0x214778){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))*$/[_0x0d8b('0x17')](_0x214778);}function checkRow(_0x221071,_0x2c64e2,_0x30980c){return new BPromise(function(_0x4562cb,_0x27b695){if(_['isNil'](_0x221071)){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x0d8b('0x19'),null,_0x30980c));}if(_0x221071['errors']&&_0x221071[_0x0d8b('0x1a')]['length']){var _0x3dd149=_[_0x0d8b('0x1b')](_0x221071[_0x0d8b('0x1a')],'message')['join'](';');return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x3dd149,null,_0x30980c));}var _0x3ef745={};for(var _0x4c05ee in FIELDS){if(FIELDS[_0x0d8b('0x1c')](_0x4c05ee)&&FIELDS[_0x4c05ee]){_0x3ef745[_0x4c05ee]=_0x221071['data'][0x0][FIELDS[_0x4c05ee]]||_0x221071[_0x0d8b('0x1d')][0x0]['\ufeff'+FIELDS[_0x4c05ee]];}}if(!_0x3ef745['firstName']){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'firstName\x20not\x20specified!',null,_0x30980c));}if(!_0x3ef745[_0x0d8b('0x1e')]){return _0x27b695(handleCheckRowError('error',_0x0d8b('0x1f'),null,_0x30980c));}if(_0x3ef745['birthDate']){var _0x3c8887=moment(_0x3ef745[_0x0d8b('0x20')],_0x0d8b('0x21'));if(!_0x3c8887['isValid']()){return _0x27b695(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x30980c));}}if(_0x3ef745[_0x0d8b('0x22')]){if(!isEmail(_0x3ef745['email'])){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'email\x20format\x20is\x20not\x20valid!',null,_0x30980c));}}_0x3ef745['ListId']=LISTID;_0x3ef745[_0x0d8b('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0d8b('0x24')]&&_0x2c64e2){var _0x109c14={};for(var _0xdeee5d=0x0,_0x183220=DUPLICATES[_0x0d8b('0x24')];_0xdeee5d<_0x183220;_0xdeee5d+=0x1){_0x109c14[DUPLICATES[_0xdeee5d]]=_0x3ef745[DUPLICATES[_0xdeee5d]];}var _0x4a99d3=_[_0x0d8b('0x25')](_0x2c64e2,_0x109c14);if(_0x4a99d3){return _0x27b695(handleCheckRowError('duplicate',_0x0d8b('0x26'),_0x4a99d3,_0x30980c));}}return db[_0x0d8b('0x27')]['create'](_0x3ef745,{'raw':!![],'hooks':![],'fields':_[_0x0d8b('0x28')](_0x3ef745)})[_0x0d8b('0x29')](function(_0x18a905){if(DUPLICATES&&DUPLICATES['length']&&_0x2c64e2){_0x2c64e2[_0x0d8b('0x2a')](_[_0x0d8b('0x2b')](_0x3ef745,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x18a905['id'];return _0x4562cb();})[_0x0d8b('0x2c')](function(_0x31ceba){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'Error\x20while\x20creating\x20contact:\x20'+(_0x31ceba[_0x0d8b('0x2d')]||JSON[_0x0d8b('0x2e')](_0x31ceba)),null,_0x30980c));});});}function checkHopper(){function _0x5ad0fe(){return function(_0x1180ac){logger[_0x0d8b('0x18')](_0x0d8b('0x2f'),_0x0d8b('0x30'),util[_0x0d8b('0x31')](_0x1180ac,{'showHidden':![],'depth':null}));};}var _0x519088=function(_0x497a71,_0x41b4f9){var _0x5c2c04=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x33'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),'ListId',_0x41b4f9,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()[_0x0d8b('0x3a')](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID['toString'](),_0x0d8b('0x3b'))['field'](_0x497a71['id'][_0x0d8b('0x3c')](),_0x41b4f9)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID['toString']())['where'](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel['select']()['field'](_0x0d8b('0x1e'))[_0x0d8b('0x3e')](_0x0d8b('0x33'))['where'](_0x41b4f9+_0x0d8b('0x43'),_0x497a71['id'][_0x0d8b('0x3c')]())))['toString']();return _0x5c2c04;};var _0x4d7bb0=function(_0x372740,_0x495870){var _0x1e22e5=squel['insert']()['into'](_0x0d8b('0x33'))[_0x0d8b('0x34')](['phone','scheduledAt','ContactId','ListId',_0x495870,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x372740['id'][_0x0d8b('0x3c')](),_0x495870)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')]('cm_contacts')[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel['str'](hopperContacts))[_0x0d8b('0x40')](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('calleridnum')['from']('cm_hopper_final')[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id']['toString']()))['where'](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('phone')[_0x0d8b('0x3e')](_0x0d8b('0x33'))[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id'][_0x0d8b('0x3c')]())))['toString']();return _0x1e22e5;};function _0x2de903(_0x2afe34,_0x5481fc){var _0x580580=squel[_0x0d8b('0x46')]()[_0x0d8b('0x32')]('cm_hopper')['fromQuery']([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),_0x0d8b('0x3b'),_0x5481fc,'createdAt',_0x0d8b('0x38')],squel['select']()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))['field']('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x2afe34['id'][_0x0d8b('0x3c')](),_0x5481fc)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where'](_0x0d8b('0x41')))[_0x0d8b('0x3c')]();return _0x580580;}function _0x181d49(_0x17a87f,_0x1d6cd4){var _0x59ada2=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x49'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),'ContactId',_0x0d8b('0x3b'),_0x1d6cd4,_0x0d8b('0x37'),_0x0d8b('0x38')],squel['select']()[_0x0d8b('0x3a')]('phone',_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))['field'](_0x17a87f['id'][_0x0d8b('0x3c')](),_0x1d6cd4)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),'updatedAt')[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))[_0x0d8b('0x40')](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0d8b('0x3c')]();return _0x59ada2;}return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x4f4b4d){var _0x587128=[];if(_0x4f4b4d){var _0x1900e3;for(var _0x1c007b=0x0,_0x70e4b2;_0x1c007b<_0x4f4b4d[_0x0d8b('0x24')];_0x1c007b+=0x1){_0x70e4b2=_0x4f4b4d[_0x1c007b][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x70e4b2[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x4d7bb0(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;case _0x0d8b('0x52'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x519088(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x587128[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x587128;})[_0x0d8b('0x54')]()['then'](function(){return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x56e03c){var _0x10c318=[];if(_0x56e03c){var _0x445a00;for(var _0x24f75=0x0,_0x259ac9;_0x24f75<_0x56e03c[_0x0d8b('0x24')];_0x24f75+=0x1){_0x259ac9=_0x56e03c[_0x24f75][_0x0d8b('0x4d')]({'plain':!![]});_0x10c318[_0x0d8b('0x2a')](db[_0x0d8b('0x50')]['query'](_0x181d49(_0x259ac9,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));}}return _0x10c318;})[_0x0d8b('0x54')]();})[_0x0d8b('0x29')](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id',_0x0d8b('0x4e')],'include':[{'model':db[_0x0d8b('0x55')],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x466082){var _0x5007c0=[];if(_0x466082){for(var _0xe35028=0x0,_0x16df83;_0xe35028<_0x466082['length'];_0xe35028+=0x1){_0x16df83=_0x466082[_0xe35028][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x16df83[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x5007c0['push'](db['sequelize'][_0x0d8b('0x53')](_0x4d7bb0(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));break;case'onlyIfOpen':_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x519088(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x5007c0;})[_0x0d8b('0x54')]();})['then'](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x1dad9f){var _0x3573b4=[];if(_0x1dad9f){for(var _0x14b1b8=0x0,_0x23e2e0;_0x14b1b8<_0x1dad9f[_0x0d8b('0x24')];_0x14b1b8+=0x1){_0x23e2e0=_0x1dad9f[_0x14b1b8]['get']({'plain':!![]});_0x3573b4['push'](db['sequelize'][_0x0d8b('0x53')](_0x181d49(_0x23e2e0,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}return _0x3573b4;})[_0x0d8b('0x54')]();})[_0x0d8b('0x2c')](function(_0x5ef461){logger[_0x0d8b('0x18')](_0x0d8b('0x59'),'generalCheckHopper',_0x5ef461[_0x0d8b('0x2d')]);});}var processPromises=function(_0x57e3c2){return BPromise[_0x0d8b('0x54')](promises)[_0x0d8b('0x29')](function(_0x9dfa5a){})[_0x0d8b('0x2c')](function(_0x10c7ab){logger[_0x0d8b('0x18')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x2e')](_0x10c7ab));})[_0x0d8b('0x5b')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x57e3c2){return _0x57e3c2[_0x0d8b('0x5e')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0d8b('0x29')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0d8b('0x5f')](FILEPATH);}catch(_0xf91ecd){logger[_0x0d8b('0x18')](_0x0d8b('0x60'),JSON['stringify'](_0xf91ecd));}finally{process[_0x0d8b('0x61')](0x0);}});};process['on']('SIGINT',function(){logger[_0x0d8b('0x62')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x0d8b('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0d8b('0x12')](',');return db[_0x0d8b('0x27')][_0x0d8b('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0d8b('0x29')](function(_0x2eece2){var _0x3c7b9b=fs[_0x0d8b('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0d8b('0x64')](_0x3c7b9b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x20a8b6,_0x3a6014){total+=0x1;var _0x180539=total;promises['push'](checkRow(_0x20a8b6,_0x2eece2,_0x180539)[_0x0d8b('0x29')](function(){success+=0x1;})[_0x0d8b('0x2c')](function(_0x8be77c){if(_0x8be77c['error']){errors+=0x1;delete _0x8be77c['error'];}else if(_0x8be77c[_0x0d8b('0x65')]){duplicates+=0x1;delete _0x8be77c[_0x0d8b('0x65')];}rows[_0x0d8b('0x2a')](_0x8be77c);}));if(total%0xc8===0x0){_0x3a6014[_0x0d8b('0x66')]();return processPromises(_0x3a6014);}},'complete':function(){return processPromises()[_0x0d8b('0x29')](function(){logger[_0x0d8b('0x62')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x1a96ce,_0x3d6267){logger[_0x0d8b('0x62')](_0x0d8b('0x67'),JSON[_0x0d8b('0x2e')](_0x1a96ce));endCsv();}});})['catch'](function(_0x4dbcfc){logger[_0x0d8b('0x18')](_0x0d8b('0x68'),JSON[_0x0d8b('0x2e')](_0x4dbcfc));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 923f5be..a3781d3 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 _0x1885=['phone','scheduledat','ContactId','ListId','createdAt','priority','recallme','select','cm_contacts','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','into','cm_hopper_black','updatedAt','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys','CompanyId','id\x20IN\x20?','field','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','spread','catch','main','stringify','send','start','socket_timestamp','.csv','header','writeFileSync','parse','createReadStream','length','rows','hasOwnProperty','data','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','then','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','root','existsSync','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','cm_hopper','fromQuery'];(function(_0x11268b,_0x323f6c){var _0x189dd1=function(_0x101417){while(--_0x101417){_0x11268b['push'](_0x11268b['shift']());}};_0x189dd1(++_0x323f6c);}(_0x1885,0xf0));var _0x5188=function(_0x5520b4,_0x4c9f22){_0x5520b4=_0x5520b4-0x0;var _0x119723=_0x1885[_0x5520b4];return _0x119723;};'use strict';var fs=require('fs');var path=require(_0x5188('0x0'));var _=require(_0x5188('0x1'));var Papa=require(_0x5188('0x2'));var util=require(_0x5188('0x3'));var BPromise=require('bluebird');var moment=require('moment');var squel=require('squel');var Redis=require(_0x5188('0x4'));var db=require(_0x5188('0x5'))['db'];var config=require(_0x5188('0x6'));var logger=require(_0x5188('0x7'))(_0x5188('0x8'));config[_0x5188('0x9')]=_[_0x5188('0xa')](config[_0x5188('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x5188('0xb'))(new Redis(config[_0x5188('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x5188('0xc'));function isEmail(_0x208a5f){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'](_0x208a5f);}function selectNotIn(_0x4d9fb4,_0x57c060,_0x224187,_0xdf50cb,_0x92698a){return squel['select']()['field']('phone')[_0x5188('0xd')](_0xdf50cb)[_0x5188('0xe')](_0x57c060,null,_0x57c060+_0x5188('0xf')+_0xdf50cb+'.'+_0x224187)[_0x5188('0x10')](_0xdf50cb+'.'+_0x224187+_0x5188('0x11')+_0x4d9fb4+'.'+_0x224187)[_0x5188('0x10')](_0x57c060+_0x5188('0x12')+_0x92698a['join']()+')');}function insertCmHopper(_0x553afb,_0x11936c,_0x4ab41c,_0x21af9f,_0x40d778){var _0x2f51db=['cm_contacts.phone',_0x5188('0x13'),_0x5188('0x14'),_0x5188('0x15'),_0x11936c+'.'+_0x21af9f,_0x5188('0x16'),_0x5188('0x17'),'cm_contacts.priority',_0x5188('0x18'),'\x22'+_0x40d778+'\x22'];return squel[_0x5188('0x19')]()['into'](_0x5188('0x1a'))[_0x5188('0x1b')]([_0x5188('0x1c'),_0x5188('0x1d'),_0x5188('0x1e'),_0x5188('0x1f'),_0x21af9f,_0x5188('0x20'),'updatedAt',_0x5188('0x21'),'UserId',_0x5188('0x22')],squel[_0x5188('0x23')]()['fields'](_0x2f51db)[_0x5188('0xd')](_0x11936c)[_0x5188('0xe')](_0x5188('0x24'),null,'cm_contacts.ListId\x20=\x20'+_0x11936c+'.CmListId')[_0x5188('0xe')](_0x4ab41c,null,_0x4ab41c+_0x5188('0xf')+_0x11936c+'.'+_0x21af9f)[_0x5188('0x10')](_0x11936c+'.CmListId\x20=\x20?',_0x553afb)[_0x5188('0x10')](_0x5188('0x25'),NOW)['where'](_0x5188('0x26'),selectNotIn(_0x11936c,_0x4ab41c,_0x21af9f,_0x5188('0x1a'),[_0x5188('0x27'),_0x5188('0x28')]))['where'](_0x5188('0x26'),selectNotIn(_0x11936c,_0x4ab41c,_0x21af9f,_0x5188('0x1a'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x85771f,_0x1d7166,_0x3f565f,_0x39875c){var _0x33b27c=['cm_contacts.phone',_0x5188('0x14'),_0x5188('0x15'),_0x1d7166+'.'+_0x39875c,_0x5188('0x16'),_0x5188('0x17')];return squel[_0x5188('0x19')]()[_0x5188('0x29')](_0x5188('0x2a'))[_0x5188('0x1b')](['phone',_0x5188('0x1e'),'ListId',_0x39875c,_0x5188('0x20'),_0x5188('0x2b')],squel[_0x5188('0x23')]()[_0x5188('0x2c')](_0x33b27c)[_0x5188('0xd')](_0x1d7166)[_0x5188('0xe')](_0x5188('0x24'),null,_0x5188('0x2d')+_0x1d7166+'.CmListId')[_0x5188('0xe')](_0x3f565f,null,_0x3f565f+_0x5188('0xf')+_0x1d7166+'.'+_0x39875c)[_0x5188('0x10')](_0x1d7166+_0x5188('0x2e'),_0x85771f)[_0x5188('0x10')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5188('0x10')](_0x5188('0x26'),squel[_0x5188('0x23')]()['field'](_0x5188('0x1c'))[_0x5188('0xd')](_0x5188('0x2a'))[_0x5188('0x10')](_0x5188('0x2f'),_0x85771f)[_0x5188('0x10')](_0x39875c+_0x5188('0x30'),_0x1d7166+'.'+_0x39875c)))[_0x5188('0x31')]();}function insertCmContact(_0x5a0afa,_0x1df169,_0x159055,_0x28f732){var _0x3175f7=_[_0x5188('0x32')](_[_0x5188('0x33')](_0x28f732),[_0x5188('0x1f'),_0x5188('0x34'),_0x5188('0x20'),_0x5188('0x2b')]);return squel[_0x5188('0x19')]()['into'](_0x5188('0x24'))[_0x5188('0x1b')](_0x3175f7,squel[_0x5188('0x23')]()[_0x5188('0x2c')](_0x3175f7)[_0x5188('0xd')](_0x1df169)[_0x5188('0x10')]('('+_0x159055[_0x5188('0xe')](',')+')\x20NOT\x20IN\x20?',squel[_0x5188('0x23')]()[_0x5188('0x2c')](_0x159055)[_0x5188('0xd')]('cm_contacts')[_0x5188('0x10')](_0x5188('0x2f'),_0x5a0afa)[_0x5188('0x10')]('deletedAt\x20IS\x20NULL'))[_0x5188('0x10')](_0x5188('0x35'),squel['select']()[_0x5188('0x36')](_0x5188('0x37'),_0x5188('0x38'))[_0x5188('0xd')](_0x1df169)[_0x5188('0x39')](_0x159055[_0x5188('0xe')](','))))[_0x5188('0x31')]();}function handleStop(){logger[_0x5188('0x3a')](_0x5188('0x3b'));stopped=!![];}function handleUncaughtException(_0xab7d40){logger[_0x5188('0x3c')](_0xab7d40[_0x5188('0x3d')]);process[_0x5188('0x3e')](0x1);}function handleError(_0xa6a308,_0x34d7d9){stats[_0x5188('0x3f')][_0x5188('0x40')]({'name':_0x34d7d9[_0x5188('0x41')],'message':_0x34d7d9[_0x5188('0x3d')],'row':_0xa6a308});}function handleQuery(_0x1e87ed){logger[_0x5188('0x3a')](_0x1e87ed);return db[_0x5188('0x42')]['query'](_0x1e87ed)[_0x5188('0x43')](function(_0x1f42f2){results['push'](_0x1f42f2);})[_0x5188('0x44')](function(_0x3616ae){logger[_0x5188('0x3c')](_0x3616ae['message']);});}function main(_0xcb2386,_0x5248db,_0x320986,_0x3ff04b){logger['info'](_0x5188('0x45'),_0xcb2386,JSON[_0x5188('0x46')](_0x5248db));process[_0x5188('0x47')](_0x5188('0x48'));var _0x3e27c6=_0x5248db['binding'];var _0x2a80de=_0x5248db[_0x5188('0x49')];var _0x3d3901=path[_0x5188('0xe')](config['root'],'server/files/tmp',_0x2a80de+_0x5188('0x4a'));var _0x14463a=_['keys'](_0x3e27c6)[_0x5188('0xe')]();logger[_0x5188('0x3a')](_0x5188('0x4b'),_0x14463a);fs[_0x5188('0x4c')](_0x3d3901,_0x14463a+'\x0a');Papa[_0x5188('0x4d')](fs[_0x5188('0x4e')](_0xcb2386),{'header':!![],'skipEmptyLines':!![],'step':function(_0x6d7e5a,_0x20bd02){try{for(var _0x290ecc=0x0,_0x55e534=[];_0x290ecc<_0x6d7e5a['data'][_0x5188('0x4f')];_0x290ecc++){stats[_0x5188('0x50')]+=0x1;if(_0x6d7e5a[_0x5188('0x3f')][_0x290ecc]){handleError(_0x6d7e5a['data'][_0x290ecc],_0x6d7e5a['errors'][_0x290ecc]);}else{var _0x2ed9d7=[];for(var _0x3bad70 in _0x3e27c6){if(_0x3e27c6[_0x5188('0x51')](_0x3bad70)){if(_0x6d7e5a[_0x5188('0x52')][_0x290ecc][_0x3e27c6[_0x3bad70]]){var _0x182259=_[_0x5188('0x53')](_0x6d7e5a[_0x5188('0x52')][_0x290ecc][_0x3e27c6[_0x3bad70]][_0x5188('0x54')](/"/g,'\x27'));switch(_0x3bad70){case'scheduledat':var _0x5474b9=moment(_0x182259,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5474b9[_0x5188('0x55')]()){_0x55e534['push']('\x22'+_0x182259+'\x22');}else{_0x2ed9d7['push'](_0x5188('0x56'));}break;case _0x5188('0x21'):var _0x256a8e=parseInt(_0x182259);_0x182259=_[_0x5188('0x57')](_0x256a8e)||_0x256a8e<0x0||_0x256a8e>0x4?_0x3ff04b?0x3:0x2:_0x256a8e;_0x55e534['push']('\x22'+_0x182259+'\x22');break;case _0x5188('0x58'):var _0x226bcd=parseInt(_0x182259);if(_[_0x5188('0x59')](_0x226bcd)&&_[_0x5188('0x5a')](_0x320986,_0x226bcd)){_0x55e534[_0x5188('0x40')]('\x22'+_0x226bcd+'\x22');}else{_0x2ed9d7[_0x5188('0x40')](_0x5188('0x5b'));}break;case'email':if(isEmail(_0x182259)){_0x55e534['push']('\x22'+_0x182259+'\x22');}else{_0x2ed9d7['push'](_0x5188('0x5c'));}break;case'dateOfBirth':var _0x1a696c=moment(_0x182259,'YYYY-MM-DD',!![]);if(_0x1a696c[_0x5188('0x55')]()){_0x55e534['push']('\x22'+_0x182259+'\x22');}else{_0x2ed9d7[_0x5188('0x40')](_0x5188('0x5d'));}break;default:_0x55e534[_0x5188('0x40')]('\x22'+_0x182259+'\x22');}}else{switch(_0x3bad70){case _0x5188('0x5e'):case'phone':_0x2ed9d7[_0x5188('0x40')](_0x3bad70+_0x5188('0x5f'));break;default:_0x55e534[_0x5188('0x40')]('\x22\x22');}}}}if(_0x2ed9d7['length']){handleError(_0x6d7e5a[_0x5188('0x52')][_0x290ecc],{'code':_0x5188('0x60'),'message':_0x2ed9d7[_0x5188('0xe')]()});}else{fs[_0x5188('0x61')](_0x3d3901,_0x55e534[_0x5188('0xe')]()+'\x0a');}_0x55e534=[];}if(!(stats[_0x5188('0x50')]%0xc8)){socket[_0x5188('0x62')](_0x5188('0x63')+_0x2a80de,stats);stats[_0x5188('0x3f')]=[];}}if(stopped){logger[_0x5188('0x3a')](_0x5188('0x64'));_0x20bd02[_0x5188('0x65')]();}}catch(_0x121481){handleError(_0x6d7e5a[_0x5188('0x52')][_0x290ecc],{'code':_0x5188('0x66'),'message':_0x121481['message']});logger[_0x5188('0x3c')]('step',_0x121481[_0x5188('0x3d')]);}},'complete':function(){try{var _0x3b76d0=[];var _0x53ab46='cm_contacts';if(_0x5248db[_0x5188('0x67')]&&_0x5248db['duplicates'][_0x5188('0x4f')]){_0x53ab46=_0x5188('0x68')+_0x2a80de;_0x3b76d0[_0x5188('0x40')](_0x5188('0x69')+_0x53ab46+_0x5188('0x6a'));}var _0x187be2=util['format'](_0x5188('0x6b'),_0x3d3901,_0x53ab46,_0x14463a,_0x5248db[_0x5188('0x1f')],_0x5248db[_0x5188('0x34')]||null,NOW,NOW);if(_[_0x5188('0x6c')](_0x3e27c6[_0x5188('0x1d')])){_0x187be2+=_0x5188('0x6d');}_0x3b76d0[_0x5188('0x40')](_0x187be2);if(_0x5248db[_0x5188('0x67')]&&_0x5248db[_0x5188('0x67')][_0x5188('0x4f')]){_0x3b76d0[_0x5188('0x40')](insertCmContact(_0x5248db[_0x5188('0x1f')],_0x53ab46,_0x5248db[_0x5188('0x67')],_0x3e27c6));_0x3b76d0[_0x5188('0x40')](_0x5188('0x6e')+_0x53ab46+';');}_0x3b76d0[_0x5188('0x40')](insertCmHopper(_0x5248db['ListId'],_0x5188('0x6f'),_0x5188('0x70'),_0x5188('0x71'),_0x3ff04b));_0x3b76d0[_0x5188('0x40')](insertCmHopperBlack(_0x5248db['ListId'],_0x5188('0x72'),_0x5188('0x70'),'VoiceQueueId'));_0x3b76d0['push'](insertCmHopper(_0x5248db[_0x5188('0x1f')],_0x5188('0x73'),_0x5188('0x74'),'CampaignId',_0x3ff04b));_0x3b76d0[_0x5188('0x40')](insertCmHopperBlack(_0x5248db[_0x5188('0x1f')],_0x5188('0x75'),_0x5188('0x74'),_0x5188('0x76')));BPromise['each'](_0x3b76d0,handleQuery)[_0x5188('0x77')](function(_0x5cd08a){stats[_0x5188('0x78')]=!![];stats[_0x5188('0x79')]=_0x5248db[_0x5188('0x67')]&&_0x5248db[_0x5188('0x67')][_0x5188('0x4f')]?results[0x2][_0x5188('0x79')]:results[0x0][_0x5188('0x79')];socket[_0x5188('0x62')]('contact:import:'+_0x2a80de,stats);fs[_0x5188('0x7a')](_0xcb2386);fs[_0x5188('0x7a')](_0x3d3901);process[_0x5188('0x3e')](0x0);})['catch'](function(_0x38e1d9){logger['error'](_0x38e1d9['message']);process[_0x5188('0x3e')](0x1);});}catch(_0x4ea61e){logger[_0x5188('0x3c')]('complete',_0x4ea61e[_0x5188('0x3d')]);process[_0x5188('0x3e')](0x1);}},'error':function(_0x431c71,_0x79c576,_0x593756,_0x5e3598){throw new Error(_0x5e3598);}});}function validate(){if(process['argv']&&process[_0x5188('0x7b')]['length']<0x4){throw new Error(_0x5188('0x7c'));}var _0x34d014=path[_0x5188('0xe')](config[_0x5188('0x7d')],'server/files/tmp',process[_0x5188('0x7b')][0x2]);if(!fs[_0x5188('0x7e')](_0x34d014)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x3129b7={};try{_0x3129b7=JSON['parse'](process[_0x5188('0x7b')][0x3]);if(!_0x3129b7[_0x5188('0x7f')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x3129b7['binding'][_0x5188('0x1c')]){throw new Error(_0x5188('0x80'));}if(!_0x3129b7['binding'][_0x5188('0x5e')]){throw new Error(_0x5188('0x81'));}var _0x57e15b=0x0;if(_0x3129b7['binding'][_0x5188('0x58')]){_0x57e15b=0x1;}if(!_0x3129b7[_0x5188('0x1f')]){throw new Error(_0x5188('0x82'));}}catch(_0xd5bc18){throw new Error(_0x5188('0x83'));}var _0x22de7d=[];try{_0x22de7d=_['map'](JSON[_0x5188('0x4d')](process[_0x5188('0x7b')][0x4]),'id');}catch(_0x1da71f){logger['info'](_0x5188('0x84'));}main(_0x34d014,_0x3129b7,_0x22de7d,_0x57e15b);}validate();process['on']('SIGINT',handleStop);process['on'](_0x5188('0x85'),handleUncaughtException); \ No newline at end of file +var _0x316b=['lodash','papaparse','util','bluebird','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','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_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_hopper_black','fields','ListId\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','code','sequelize','query','spread','push','catch','error','main','stringify','send','binding','socket_timestamp','root','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','includes','agent\x20not\x20exists','email','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','CompanyId',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path'];(function(_0x362a87,_0x27daf5){var _0x47500d=function(_0x127a34){while(--_0x127a34){_0x362a87['push'](_0x362a87['shift']());}};_0x47500d(++_0x27daf5);}(_0x316b,0x113));var _0xb316=function(_0x5c1329,_0x44d752){_0x5c1329=_0x5c1329-0x0;var _0x282631=_0x316b[_0x5c1329];return _0x282631;};'use strict';var fs=require('fs');var path=require(_0xb316('0x0'));var _=require(_0xb316('0x1'));var Papa=require(_0xb316('0x2'));var util=require(_0xb316('0x3'));var BPromise=require(_0xb316('0x4'));var moment=require('moment');var squel=require(_0xb316('0x5'));var Redis=require('ioredis');var db=require(_0xb316('0x6'))['db'];var config=require(_0xb316('0x7'));var logger=require(_0xb316('0x8'))(_0xb316('0x9'));config[_0xb316('0xa')]=_['defaults'](config[_0xb316('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0xb316('0xb'));function isEmail(_0x44aab4){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))*$/[_0xb316('0xc')](_0x44aab4);}function selectNotIn(_0x42f141,_0x546a1b,_0x5e5983,_0x53ea6a,_0x21a1c8){return squel[_0xb316('0xd')]()[_0xb316('0xe')](_0xb316('0xf'))[_0xb316('0x10')](_0x53ea6a)['join'](_0x546a1b,null,_0x546a1b+'.id\x20=\x20'+_0x53ea6a+'.'+_0x5e5983)[_0xb316('0x11')](_0x53ea6a+'.'+_0x5e5983+_0xb316('0x12')+_0x42f141+'.'+_0x5e5983)[_0xb316('0x11')](_0x546a1b+_0xb316('0x13')+_0x21a1c8[_0xb316('0x14')]()+')');}function insertCmHopper(_0x18d8bf,_0x5d47f4,_0x3ae8c5,_0x2f5b4e,_0x1935b7){var _0x13425e=[_0xb316('0x15'),_0xb316('0x16'),_0xb316('0x17'),_0xb316('0x18'),_0x5d47f4+'.'+_0x2f5b4e,_0xb316('0x19'),_0xb316('0x1a'),_0xb316('0x1b'),_0xb316('0x1c'),'\x22'+_0x1935b7+'\x22'];return squel[_0xb316('0x1d')]()[_0xb316('0x1e')]('cm_hopper')[_0xb316('0x1f')]([_0xb316('0xf'),_0xb316('0x20'),_0xb316('0x21'),_0xb316('0x22'),_0x2f5b4e,_0xb316('0x23'),_0xb316('0x24'),_0xb316('0x25'),_0xb316('0x26'),_0xb316('0x27')],squel['select']()['fields'](_0x13425e)[_0xb316('0x10')](_0x5d47f4)[_0xb316('0x14')](_0xb316('0x28'),null,_0xb316('0x29')+_0x5d47f4+_0xb316('0x2a'))[_0xb316('0x14')](_0x3ae8c5,null,_0x3ae8c5+'.id\x20=\x20'+_0x5d47f4+'.'+_0x2f5b4e)[_0xb316('0x11')](_0x5d47f4+_0xb316('0x2b'),_0x18d8bf)['where'](_0xb316('0x2c'),NOW)[_0xb316('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5d47f4,_0x3ae8c5,_0x2f5b4e,_0xb316('0x2d'),[_0xb316('0x2e'),_0xb316('0x2f')]))[_0xb316('0x11')](_0xb316('0x30'),selectNotIn(_0x5d47f4,_0x3ae8c5,_0x2f5b4e,'cm_hopper',[_0xb316('0x2e')])))[_0xb316('0x31')]();}function insertCmHopperBlack(_0x18cabc,_0x2227e0,_0x200ede,_0x53a47b){var _0x5345ab=[_0xb316('0x15'),'cm_contacts.id','cm_contacts.ListId',_0x2227e0+'.'+_0x53a47b,_0xb316('0x19'),_0xb316('0x1a')];return squel[_0xb316('0x1d')]()[_0xb316('0x1e')](_0xb316('0x32'))[_0xb316('0x1f')](['phone',_0xb316('0x21'),_0xb316('0x22'),_0x53a47b,_0xb316('0x23'),_0xb316('0x24')],squel['select']()[_0xb316('0x33')](_0x5345ab)[_0xb316('0x10')](_0x2227e0)[_0xb316('0x14')](_0xb316('0x28'),null,_0xb316('0x29')+_0x2227e0+_0xb316('0x2a'))['join'](_0x200ede,null,_0x200ede+'.id\x20=\x20'+_0x2227e0+'.'+_0x53a47b)['where'](_0x2227e0+'.CmListId\x20=\x20?',_0x18cabc)[_0xb316('0x11')](_0xb316('0x2c'),NOW)['where'](_0xb316('0x30'),squel['select']()[_0xb316('0xe')](_0xb316('0xf'))[_0xb316('0x10')]('cm_hopper_black')['where'](_0xb316('0x34'),_0x18cabc)[_0xb316('0x11')](_0x53a47b+'\x20=\x20?',_0x2227e0+'.'+_0x53a47b)))[_0xb316('0x31')]();}function insertCmContact(_0x24e5cb,_0x335ee3,_0x50bffa,_0x354e65){var _0x5ce509=_[_0xb316('0x35')](_[_0xb316('0x36')](_0x354e65),[_0xb316('0x22'),'CompanyId','createdAt',_0xb316('0x24')]);return squel[_0xb316('0x1d')]()[_0xb316('0x1e')](_0xb316('0x28'))[_0xb316('0x1f')](_0x5ce509,squel['select']()[_0xb316('0x33')](_0x5ce509)[_0xb316('0x10')](_0x335ee3)[_0xb316('0x11')]('('+_0x50bffa[_0xb316('0x14')](',')+_0xb316('0x37'),squel[_0xb316('0xd')]()[_0xb316('0x33')](_0x50bffa)[_0xb316('0x10')](_0xb316('0x28'))[_0xb316('0x11')](_0xb316('0x34'),_0x24e5cb)[_0xb316('0x11')](_0xb316('0x38')))[_0xb316('0x11')](_0xb316('0x39'),squel[_0xb316('0xd')]()[_0xb316('0xe')](_0xb316('0x3a'),_0xb316('0x3b'))['from'](_0x335ee3)[_0xb316('0x3c')](_0x50bffa[_0xb316('0x14')](','))))[_0xb316('0x31')]();}function handleStop(){logger[_0xb316('0x3d')](_0xb316('0x3e'));stopped=!![];}function handleUncaughtException(_0x3e3d01){logger['error'](_0x3e3d01[_0xb316('0x3f')]);process[_0xb316('0x40')](0x1);}function handleError(_0x13bdde,_0x3ac217){stats[_0xb316('0x41')]['push']({'name':_0x3ac217[_0xb316('0x42')],'message':_0x3ac217['message'],'row':_0x13bdde});}function handleQuery(_0x1d2e9b){logger[_0xb316('0x3d')](_0x1d2e9b);return db[_0xb316('0x43')][_0xb316('0x44')](_0x1d2e9b)[_0xb316('0x45')](function(_0x91bf7d){results[_0xb316('0x46')](_0x91bf7d);})[_0xb316('0x47')](function(_0x1be002){logger[_0xb316('0x48')](_0x1be002[_0xb316('0x3f')]);});}function main(_0x4567d8,_0x52ebcf,_0x420c23,_0x5efbc6){logger[_0xb316('0x3d')](_0xb316('0x49'),_0x4567d8,JSON[_0xb316('0x4a')](_0x52ebcf));process[_0xb316('0x4b')]('start');var _0x362bb2=_0x52ebcf[_0xb316('0x4c')];var _0x2fe6e2=_0x52ebcf[_0xb316('0x4d')];var _0x53fb81=path['join'](config[_0xb316('0x4e')],'server/files/tmp',_0x2fe6e2+_0xb316('0x4f'));var _0x470de6=_[_0xb316('0x36')](_0x362bb2)[_0xb316('0x14')]();logger[_0xb316('0x3d')](_0xb316('0x50'),_0x470de6);fs[_0xb316('0x51')](_0x53fb81,_0x470de6+'\x0a');Papa[_0xb316('0x52')](fs[_0xb316('0x53')](_0x4567d8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1d3cf8,_0x94406a){try{for(var _0x64695b=0x0,_0x50b5e5=[];_0x64695b<_0x1d3cf8[_0xb316('0x54')][_0xb316('0x55')];_0x64695b++){stats[_0xb316('0x56')]+=0x1;if(_0x1d3cf8['errors'][_0x64695b]){handleError(_0x1d3cf8[_0xb316('0x54')][_0x64695b],_0x1d3cf8[_0xb316('0x41')][_0x64695b]);}else{var _0x577f2a=[];for(var _0x164db6 in _0x362bb2){if(_0x362bb2[_0xb316('0x57')](_0x164db6)){if(_0x1d3cf8[_0xb316('0x54')][_0x64695b][_0x362bb2[_0x164db6]]){var _0x48661b=_[_0xb316('0x58')](_0x1d3cf8['data'][_0x64695b][_0x362bb2[_0x164db6]][_0xb316('0x59')](/"/g,'\x27'));switch(_0x164db6){case _0xb316('0x20'):var _0xe3203c=moment(_0x48661b,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xe3203c[_0xb316('0x5a')]()){_0x50b5e5[_0xb316('0x46')]('\x22'+_0x48661b+'\x22');}else{_0x577f2a[_0xb316('0x46')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xb316('0x25'):var _0x1bf2ce=parseInt(_0x48661b);_0x48661b=_[_0xb316('0x5b')](_0x1bf2ce)||_0x1bf2ce<0x0||_0x1bf2ce>0x4?_0x5efbc6?0x3:0x2:_0x1bf2ce;_0x50b5e5[_0xb316('0x46')]('\x22'+_0x48661b+'\x22');break;case _0xb316('0x26'):var _0x21444c=parseInt(_0x48661b);if(_[_0xb316('0x5c')](_0x21444c)&&_[_0xb316('0x5d')](_0x420c23,_0x21444c)){_0x50b5e5[_0xb316('0x46')]('\x22'+_0x21444c+'\x22');}else{_0x577f2a['push'](_0xb316('0x5e'));}break;case _0xb316('0x5f'):if(isEmail(_0x48661b)){_0x50b5e5['push']('\x22'+_0x48661b+'\x22');}else{_0x577f2a[_0xb316('0x46')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x355d56=moment(_0x48661b,_0xb316('0x60'),!![]);if(_0x355d56[_0xb316('0x5a')]()){_0x50b5e5[_0xb316('0x46')]('\x22'+_0x48661b+'\x22');}else{_0x577f2a[_0xb316('0x46')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x50b5e5['push']('\x22'+_0x48661b+'\x22');}}else{switch(_0x164db6){case _0xb316('0x61'):case _0xb316('0xf'):_0x577f2a[_0xb316('0x46')](_0x164db6+_0xb316('0x62'));break;default:_0x50b5e5[_0xb316('0x46')]('\x22\x22');}}}}if(_0x577f2a[_0xb316('0x55')]){handleError(_0x1d3cf8[_0xb316('0x54')][_0x64695b],{'code':_0xb316('0x63'),'message':_0x577f2a[_0xb316('0x14')]()});}else{fs['appendFileSync'](_0x53fb81,_0x50b5e5[_0xb316('0x14')]()+'\x0a');}_0x50b5e5=[];}if(!(stats[_0xb316('0x56')]%0xc8)){socket[_0xb316('0x64')]('contact:import:'+_0x2fe6e2,stats);stats['errors']=[];}}if(stopped){logger[_0xb316('0x3d')](_0xb316('0x65'));_0x94406a[_0xb316('0x66')]();}}catch(_0x24d8e4){handleError(_0x1d3cf8[_0xb316('0x54')][_0x64695b],{'code':_0xb316('0x67'),'message':_0x24d8e4[_0xb316('0x3f')]});logger[_0xb316('0x48')](_0xb316('0x68'),_0x24d8e4['message']);}},'complete':function(){try{var _0x4ef7c5=[];var _0x3850b4=_0xb316('0x28');if(_0x52ebcf['duplicates']&&_0x52ebcf[_0xb316('0x69')]['length']){_0x3850b4=_0xb316('0x6a')+_0x2fe6e2;_0x4ef7c5[_0xb316('0x46')](_0xb316('0x6b')+_0x3850b4+_0xb316('0x6c'));}var _0x16e573=util[_0xb316('0x6d')]('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',_0x53fb81,_0x3850b4,_0x470de6,_0x52ebcf['ListId'],_0x52ebcf[_0xb316('0x6e')]||null,NOW,NOW);if(_['isNil'](_0x362bb2[_0xb316('0x20')])){_0x16e573+=_0xb316('0x6f');}_0x4ef7c5[_0xb316('0x46')](_0x16e573);if(_0x52ebcf[_0xb316('0x69')]&&_0x52ebcf[_0xb316('0x69')][_0xb316('0x55')]){_0x4ef7c5[_0xb316('0x46')](insertCmContact(_0x52ebcf[_0xb316('0x22')],_0x3850b4,_0x52ebcf[_0xb316('0x69')],_0x362bb2));_0x4ef7c5[_0xb316('0x46')]('DROP\x20TABLE\x20'+_0x3850b4+';');}_0x4ef7c5['push'](insertCmHopper(_0x52ebcf[_0xb316('0x22')],_0xb316('0x70'),_0xb316('0x71'),_0xb316('0x72'),_0x5efbc6));_0x4ef7c5[_0xb316('0x46')](insertCmHopperBlack(_0x52ebcf[_0xb316('0x22')],_0xb316('0x73'),_0xb316('0x71'),_0xb316('0x72')));_0x4ef7c5[_0xb316('0x46')](insertCmHopper(_0x52ebcf['ListId'],_0xb316('0x74'),_0xb316('0x75'),_0xb316('0x76'),_0x5efbc6));_0x4ef7c5[_0xb316('0x46')](insertCmHopperBlack(_0x52ebcf[_0xb316('0x22')],_0xb316('0x77'),_0xb316('0x75'),'CampaignId'));BPromise[_0xb316('0x78')](_0x4ef7c5,handleQuery)['then'](function(_0x3590a7){stats[_0xb316('0x79')]=!![];stats[_0xb316('0x7a')]=_0x52ebcf[_0xb316('0x69')]&&_0x52ebcf[_0xb316('0x69')][_0xb316('0x55')]?results[0x2][_0xb316('0x7a')]:results[0x0][_0xb316('0x7a')];socket['emit'](_0xb316('0x7b')+_0x2fe6e2,stats);fs[_0xb316('0x7c')](_0x4567d8);fs['unlink'](_0x53fb81);process[_0xb316('0x40')](0x0);})[_0xb316('0x47')](function(_0x27ee8d){logger[_0xb316('0x48')](_0x27ee8d[_0xb316('0x3f')]);process[_0xb316('0x40')](0x1);});}catch(_0x25ae03){logger[_0xb316('0x48')](_0xb316('0x7d'),_0x25ae03['message']);process[_0xb316('0x40')](0x1);}},'error':function(_0xa5c9b0,_0x2bb588,_0xd786bb,_0x2aa58f){throw new Error(_0x2aa58f);}});}function validate(){if(process['argv']&&process[_0xb316('0x7e')]['length']<0x4){throw new Error(_0xb316('0x7f'));}var _0x30f758=path[_0xb316('0x14')](config[_0xb316('0x4e')],_0xb316('0x80'),process[_0xb316('0x7e')][0x2]);if(!fs[_0xb316('0x81')](_0x30f758)){throw new Error(_0xb316('0x82'));}var _0x27b628={};try{_0x27b628=JSON[_0xb316('0x52')](process[_0xb316('0x7e')][0x3]);if(!_0x27b628['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x27b628[_0xb316('0x4c')][_0xb316('0xf')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x27b628[_0xb316('0x4c')][_0xb316('0x61')]){throw new Error(_0xb316('0x83'));}var _0x31a5e=0x0;if(_0x27b628[_0xb316('0x4c')][_0xb316('0x26')]){_0x31a5e=0x1;}if(!_0x27b628['ListId']){throw new Error(_0xb316('0x84'));}}catch(_0xa8e586){throw new Error(_0xb316('0x85'));}var _0x105cce=[];try{_0x105cce=_[_0xb316('0x86')](JSON[_0xb316('0x52')](process[_0xb316('0x7e')][0x4]),'id');}catch(_0x169feb){logger['info'](_0xb316('0x87'));}main(_0x30f758,_0x27b628,_0x105cce,_0x31a5e);}validate();process['on'](_0xb316('0x88'),handleStop);process['on'](_0xb316('0x89'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 70a702e..e1224af 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 _0x80ed=['Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','Queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number','membername','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','endtime','Duration','duration','Billable\x20Time','getSubjects','string','toLowerCase','voice','inbound','variable','queue','push','calleridnum','outbound'];(function(_0x3116a0,_0x58e3a5){var _0x2f8b9e=function(_0x3fe2f9){while(--_0x3fe2f9){_0x3116a0['push'](_0x3116a0['shift']());}};_0x2f8b9e(++_0x58e3a5);}(_0x80ed,0x11c));var _0xd80e=function(_0x30d2a8,_0x249e53){_0x30d2a8=_0x30d2a8-0x0;var _0x484d41=_0x80ed[_0x30d2a8];return _0x484d41;};'use strict';exports[_0xd80e('0x0')]=function(_0x5a14b2,_0x1bb10e){var _0x182da3=[{'type':_0xd80e('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x5a14b2[_0xd80e('0x2')]()){case _0xd80e('0x3'):switch(_0x1bb10e[_0xd80e('0x2')]()){case _0xd80e('0x4'):_0x182da3['push']({'type':_0xd80e('0x5'),'content':'','variableName':_0xd80e('0x6')});_0x182da3[_0xd80e('0x7')]({'type':'variable','content':'','variableName':_0xd80e('0x8')});break;case _0xd80e('0x9'):_0x182da3[_0xd80e('0x7')]({'type':_0xd80e('0x1'),'content':_0xd80e('0xa'),'variableName':null});_0x182da3[_0xd80e('0x7')]({'type':_0xd80e('0x5'),'content':'','variableName':_0xd80e('0xb')});break;}}return _0x182da3;};exports[_0xd80e('0xc')]=function(_0x7f93b4,_0x4eee08){var _0x450b44=[];switch(_0x7f93b4[_0xd80e('0x2')]()){case _0xd80e('0x3'):switch(_0x4eee08[_0xd80e('0x2')]()){case _0xd80e('0x4'):_0x450b44=[{'type':_0xd80e('0x1'),'content':_0xd80e('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0xf'),'keyType':'variable','variableName':'calleridnum'},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0xd80e('0x5'),'variableName':_0xd80e('0x10')},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0x11'),'keyType':_0xd80e('0x5'),'variableName':'destexten'},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0x12'),'keyType':_0xd80e('0x5'),'variableName':_0xd80e('0x6')},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0x13'),'keyType':_0xd80e('0x5'),'variableName':_0xd80e('0x14')},{'type':'keyValue','content':'','key':_0xd80e('0x15'),'keyType':_0xd80e('0x5'),'variableName':_0xd80e('0x16')},{'type':_0xd80e('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0x17'),'keyType':_0xd80e('0x5'),'variableName':'destcalleridname'},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0x18'),'keyType':_0xd80e('0x5'),'variableName':_0xd80e('0xb')},{'type':_0xd80e('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xd80e('0x19'),'keyType':_0xd80e('0x5'),'variableName':_0xd80e('0x16')},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0x1a'),'keyType':_0xd80e('0x5'),'variableName':_0xd80e('0x1b')},{'type':'keyValue','content':'','key':_0xd80e('0x1c'),'keyType':_0xd80e('0x5'),'variableName':_0xd80e('0x1d')},{'type':'keyValue','content':'','key':_0xd80e('0x1e'),'keyType':_0xd80e('0x5'),'variableName':_0xd80e('0x1f')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0xd80e('0x20')}];break;case'outbound':_0x450b44=[{'type':_0xd80e('0x1'),'content':_0xd80e('0xd'),'variableName':null},{'type':'keyValue','content':'','key':_0xd80e('0x21'),'keyType':_0xd80e('0x5'),'keyContent':'','variableName':_0xd80e('0xb')},{'type':_0xd80e('0xe'),'content':'','key':'Member\x20Name','keyType':_0xd80e('0x5'),'keyContent':'','variableName':_0xd80e('0x22')},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0x13'),'keyType':_0xd80e('0x5'),'keyContent':'','variableName':_0xd80e('0x14')},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0x15'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0xd80e('0x1'),'content':_0xd80e('0x23')},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0x24'),'keyType':_0xd80e('0x5'),'keyContent':'','variableName':_0xd80e('0x25')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0xd80e('0x5'),'keyContent':'','variableName':_0xd80e('0x26')},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0x27'),'keyType':_0xd80e('0x5'),'keyContent':'','variableName':_0xd80e('0x28')},{'type':_0xd80e('0xe'),'content':'','key':_0xd80e('0x29'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x450b44;}; \ No newline at end of file +var _0xea28=['push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','talktime','Called\x20Number','starttime','answertime','Duration','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound'];(function(_0x576d8a,_0x2d7bde){var _0x3dc3ef=function(_0xc76758){while(--_0xc76758){_0x576d8a['push'](_0x576d8a['shift']());}};_0x3dc3ef(++_0x2d7bde);}(_0xea28,0x13a));var _0x8ea2=function(_0x962f,_0x4e9480){_0x962f=_0x962f-0x0;var _0x40adb1=_0xea28[_0x962f];return _0x40adb1;};'use strict';exports[_0x8ea2('0x0')]=function(_0x2e031a,_0x389e8f){var _0x26155f=[{'type':_0x8ea2('0x1'),'content':_0x8ea2('0x2'),'variableName':null}];switch(_0x2e031a[_0x8ea2('0x3')]()){case _0x8ea2('0x4'):switch(_0x389e8f['toLowerCase']()){case _0x8ea2('0x5'):_0x26155f[_0x8ea2('0x6')]({'type':_0x8ea2('0x7'),'content':'','variableName':'queue'});_0x26155f[_0x8ea2('0x6')]({'type':_0x8ea2('0x7'),'content':'','variableName':_0x8ea2('0x8')});break;case _0x8ea2('0x9'):_0x26155f[_0x8ea2('0x6')]({'type':_0x8ea2('0x1'),'content':_0x8ea2('0xa'),'variableName':null});_0x26155f[_0x8ea2('0x6')]({'type':_0x8ea2('0x7'),'content':'','variableName':_0x8ea2('0xb')});break;}}return _0x26155f;};exports[_0x8ea2('0xc')]=function(_0x21ae3d,_0x500b82){var _0x4da3b1=[];switch(_0x21ae3d[_0x8ea2('0x3')]()){case _0x8ea2('0x4'):switch(_0x500b82[_0x8ea2('0x3')]()){case'inbound':_0x4da3b1=[{'type':_0x8ea2('0x1'),'content':_0x8ea2('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0xf'),'keyType':_0x8ea2('0x7'),'variableName':'calleridnum'},{'type':_0x8ea2('0xe'),'content':'','key':'Caller\x20Name','keyType':'variable','variableName':_0x8ea2('0x10')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x11'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x12')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x13'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x14')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x15'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x16')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x17'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x18')},{'type':_0x8ea2('0x1'),'content':_0x8ea2('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x1a'),'keyType':_0x8ea2('0x7'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0x8ea2('0x1b'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0xb')},{'type':'string','content':_0x8ea2('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':_0x8ea2('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x18')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x1d'),'keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x1e')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x1f'),'keyType':_0x8ea2('0x7'),'variableName':'agentcompleteAt'},{'type':_0x8ea2('0xe'),'content':'','key':'Hold\x20Time','keyType':_0x8ea2('0x7'),'variableName':_0x8ea2('0x20')},{'type':_0x8ea2('0xe'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0x8ea2('0x21')}];break;case'outbound':_0x4da3b1=[{'type':_0x8ea2('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x22'),'keyType':_0x8ea2('0x7'),'keyContent':'','variableName':_0x8ea2('0xb')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0x8ea2('0x7'),'keyContent':'','variableName':'membername'},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x15'),'keyType':_0x8ea2('0x7'),'keyContent':'','variableName':_0x8ea2('0x16')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x17'),'keyType':_0x8ea2('0x7'),'keyContent':'','variableName':_0x8ea2('0x23')},{'type':_0x8ea2('0x1'),'content':_0x8ea2('0x1c')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0x8ea2('0x7'),'keyContent':'','variableName':_0x8ea2('0x24')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x8ea2('0x7'),'keyContent':'','variableName':'endtime'},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x25'),'keyType':'variable','keyContent':'','variableName':_0x8ea2('0x26')},{'type':_0x8ea2('0xe'),'content':'','key':_0x8ea2('0x27'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x4da3b1;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index f459ac6..35906b9 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 _0x1e6c=['unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','user','query','clone','body','omit','phone','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst'];(function(_0x5be458,_0x3be6de){var _0x4891c2=function(_0x463d0c){while(--_0x463d0c){_0x5be458['push'](_0x5be458['shift']());}};_0x4891c2(++_0x3be6de);}(_0x1e6c,0x11a));var _0xc1e6=function(_0x4bd76e,_0x260c31){_0x4bd76e=_0x4bd76e-0x0;var _0x96a285=_0x1e6c[_0x4bd76e];return _0x96a285;};'use strict';var _=require(_0xc1e6('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xc1e6('0x1'))(_0xc1e6('0x2')),'mail':require(_0xc1e6('0x1'))(_0xc1e6('0x3')),'fax':require(_0xc1e6('0x1'))('fax-interactions'),'sms':require('../../config/logger')(_0xc1e6('0x4')),'chat':require(_0xc1e6('0x1'))(_0xc1e6('0x5')),'whatsapp':require(_0xc1e6('0x1'))(_0xc1e6('0x6'))};function getInteractionId(_0x36c625,_0x30c2b6,_0x5cd563){if(_0x36c625&&_0x36c625[_[_0xc1e6('0x7')](_0x5cd563)+'InteractionId']){return _0x36c625[_[_0xc1e6('0x7')](_0x5cd563)+'InteractionId'];}else if(_0x36c625&&_0x36c625['id']){return _0x36c625['id'];}else if(_0x30c2b6&&_0x30c2b6['id']){return _0x30c2b6['id'];}else{return _0xc1e6('0x8');}}function log(_0xf0c17d,_0x19d8e0,_0x401059,_0x4a2ce8,_0x5af60e,_0xf0c4e0){loggers[_0x5af60e[_0xc1e6('0x9')]()][_0xf0c17d](_0xc1e6('0xa'),_0xf0c4e0['toUpperCase'](),_0x19d8e0?_0x19d8e0['id']:null,_0x19d8e0?_0x19d8e0[_0xc1e6('0xb')]:null,_0x19d8e0?_0x19d8e0[_0xc1e6('0xc')]:null,getInteractionId(_0x401059,_0x4a2ce8,_0x5af60e),_0x401059?JSON[_0xc1e6('0xd')](_0x401059):_0xc1e6('0xe'));}function updateUser(_0x1387ef,_0x13ceab,_0x3be789,_0x21f042,_0x50e4f4){db[_['upperFirst'](_0x21f042)+_0xc1e6('0xf')][_0xc1e6('0x10')]({'where':{'id':getInteractionId(_0x13ceab,_0x3be789,_0x21f042)}})[_0xc1e6('0x11')](function(_0x1c58cd){if(_0x1c58cd){return _0x1c58cd[_0xc1e6('0x12')]({'UserId':_0x1387ef?_0x1387ef['id']:null});}})[_0xc1e6('0x11')](function(_0xb850be){if(_0xb850be){log(_0xc1e6('0x13'),_0x1387ef,_0x13ceab,_0x3be789,_0x21f042,_0x50e4f4);}})[_0xc1e6('0x14')](function(){log(_0xc1e6('0x15'),_0x1387ef,_0x13ceab,_0x3be789,_0x21f042,_0x50e4f4);});}exports['tracked']=function(_0x2d621f,_0x13a15d){return function(_0x15175b,_0x2864a6,_0x5d9dc4){var _0x5adebf=_0x15175b[_0xc1e6('0x16')];var _0x149205={};var _0x1b9e95=_0x15175b[_0xc1e6('0x17')];if(_0x149205){_0x149205=_[_0xc1e6('0x18')](_0x15175b[_0xc1e6('0x19')]);_0x149205=_[_0xc1e6('0x1a')](_0x149205,[_0xc1e6('0x19'),'html',_0xc1e6('0x1b'),'fax',_0xc1e6('0x1c')]);}updateUser(_0x5adebf,_0x149205,_0x1b9e95,_0x2d621f,_0x13a15d);_0x5d9dc4(null);};}; \ No newline at end of file +var _0xf7df=['lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne','update','then','info','catch','error','tracked','user','query','clone','body','omit','html','fax','mobile'];(function(_0x8d823c,_0x4dfa8e){var _0x1399a6=function(_0x85d55e){while(--_0x85d55e){_0x8d823c['push'](_0x8d823c['shift']());}};_0x1399a6(++_0x4dfa8e);}(_0xf7df,0x10e));var _0xff7d=function(_0x4af938,_0x30c9dc){_0x4af938=_0x4af938-0x0;var _0x233e43=_0xf7df[_0x4af938];return _0x233e43;};'use strict';var _=require(_0xff7d('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xff7d('0x1'))(_0xff7d('0x2')),'mail':require(_0xff7d('0x1'))(_0xff7d('0x3')),'fax':require('../../config/logger')(_0xff7d('0x4')),'sms':require('../../config/logger')(_0xff7d('0x5')),'chat':require(_0xff7d('0x1'))('chat-interactions'),'whatsapp':require(_0xff7d('0x1'))('whatsapp-interactions')};function getInteractionId(_0x526150,_0xbf82e,_0x118c8f){if(_0x526150&&_0x526150[_[_0xff7d('0x6')](_0x118c8f)+_0xff7d('0x7')]){return _0x526150[_[_0xff7d('0x6')](_0x118c8f)+_0xff7d('0x7')];}else if(_0x526150&&_0x526150['id']){return _0x526150['id'];}else if(_0xbf82e&&_0xbf82e['id']){return _0xbf82e['id'];}else{return'unknown';}}function log(_0x2193f7,_0x111c0f,_0x43df23,_0x38208a,_0x209099,_0x2fa1c6){loggers[_0x209099[_0xff7d('0x8')]()][_0x2193f7](_0xff7d('0x9'),_0x2fa1c6[_0xff7d('0xa')](),_0x111c0f?_0x111c0f['id']:null,_0x111c0f?_0x111c0f[_0xff7d('0xb')]:null,_0x111c0f?_0x111c0f[_0xff7d('0xc')]:null,getInteractionId(_0x43df23,_0x38208a,_0x209099),_0x43df23?JSON['stringify'](_0x43df23):_0xff7d('0xd'));}function updateUser(_0x39e420,_0x5ceb43,_0x1174c5,_0x19124c,_0x2965e2){db[_[_0xff7d('0x6')](_0x19124c)+_0xff7d('0xe')][_0xff7d('0xf')]({'where':{'id':getInteractionId(_0x5ceb43,_0x1174c5,_0x19124c)}})['then'](function(_0x216b3f){if(_0x216b3f){return _0x216b3f[_0xff7d('0x10')]({'UserId':_0x39e420?_0x39e420['id']:null});}})[_0xff7d('0x11')](function(_0x14d6b3){if(_0x14d6b3){log(_0xff7d('0x12'),_0x39e420,_0x5ceb43,_0x1174c5,_0x19124c,_0x2965e2);}})[_0xff7d('0x13')](function(){log(_0xff7d('0x14'),_0x39e420,_0x5ceb43,_0x1174c5,_0x19124c,_0x2965e2);});}exports[_0xff7d('0x15')]=function(_0x113fc8,_0x4f2c9f){return function(_0xdbab79,_0x3ed184,_0x606f37){var _0x59dc8c=_0xdbab79[_0xff7d('0x16')];var _0xf0c560={};var _0x2df581=_0xdbab79[_0xff7d('0x17')];if(_0xf0c560){_0xf0c560=_[_0xff7d('0x18')](_0xdbab79[_0xff7d('0x19')]);_0xf0c560=_[_0xff7d('0x1a')](_0xf0c560,[_0xff7d('0x19'),_0xff7d('0x1b'),'phone',_0xff7d('0x1c'),_0xff7d('0x1d')]);}updateUser(_0x59dc8c,_0xf0c560,_0x2df581,_0x113fc8,_0x4f2c9f);_0x606f37(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index c22eae2..69178ea 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 _0x5f8b=['data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','license'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x5f8b,0x100));var _0xb5f8=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x5f8b[_0x44bcb0];return _0xfaf881;};'use strict';var crypto=require('crypto');var util=require(_0xb5f8('0x0'));var compose=require(_0xb5f8('0x1'));var db=require(_0xb5f8('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x68e1fc,_0x8f554d){if(_0x68e1fc&&_0x8f554d){if(_0x8f554d['data1']&&_0x8f554d[_0xb5f8('0x3')]){var _0x256294=_0x8f554d[_0xb5f8('0x4')];var _0x3522a1=_0x8f554d[_0xb5f8('0x3')];var _0x1fd96b=_0x256294[_0xb5f8('0x5')]('-')[0x4];var _0x27f3d4=_0x256294[_0xb5f8('0x5')]('-')[0x0];var _0x55dc07=crypto[_0xb5f8('0x6')](_0xb5f8('0x7'),util[_0xb5f8('0x8')](_0xb5f8('0x9'),_0x1fd96b,_0x256294,_0x27f3d4));var _0x4de952=_0x55dc07[_0xb5f8('0xa')](_0x3522a1,'base64',_0xb5f8('0xb'));_0x4de952+=_0x55dc07[_0xb5f8('0xc')](_0xb5f8('0xb'));var _0x4aafca=JSON[_0xb5f8('0xd')](_0x4de952);return _0x4aafca[_0xb5f8('0xe')](_0x68e1fc)?_0x4aafca[_0x68e1fc]:null;}}return null;}function isLimit(_0x56e2aa,_0x19249b,_0x122e1e,_0x1b8a83){var _0x15ad9e=_0x19249b;return compose()[_0xb5f8('0xf')](function(_0xc4a47a,_0x17f204,_0x115e55){return db[_0xb5f8('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xb5f8('0x11')](function(_0x5ae301){var _0x40cd5a=getValueFromLicense(_0x56e2aa,_0x5ae301);return _0x40cd5a?_0x40cd5a:_0x15ad9e;})['then'](function(_0x5618fa){_0x15ad9e=_0x5618fa;return _0x122e1e[_0xb5f8('0x12')](_0x1b8a83);})['then'](function(_0x8d1ef6){if(_0x8d1ef6>=_0x15ad9e){return _0x17f204[_0xb5f8('0x13')](0x193)['json']({'message':util[_0xb5f8('0x8')](_0xb5f8('0x14'),_0x56e2aa)});}_0x115e55();})[_0xb5f8('0x15')](function(_0x33fcf8){_0x115e55(_0x33fcf8);});});}function isUserLimit(){return isLimit(_0xb5f8('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0xb5f8('0x17')},{'role':_0xb5f8('0x18')}]}});}exports[_0xb5f8('0x19')]=isUserLimit; \ No newline at end of file +var _0x6529=['admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','hasOwnProperty','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User'];(function(_0x598eab,_0x315fca){var _0x6f8218=function(_0xb4a459){while(--_0xb4a459){_0x598eab['push'](_0x598eab['shift']());}};_0x6f8218(++_0x315fca);}(_0x6529,0x19b));var _0x9652=function(_0x1d647d,_0x197452){_0x1d647d=_0x1d647d-0x0;var _0x4454d4=_0x6529[_0x1d647d];return _0x4454d4;};'use strict';var crypto=require(_0x9652('0x0'));var util=require('util');var compose=require(_0x9652('0x1'));var db=require(_0x9652('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x25bfe3,_0x272247){if(_0x25bfe3&&_0x272247){if(_0x272247[_0x9652('0x3')]&&_0x272247['license']){var _0x450a96=_0x272247[_0x9652('0x3')];var _0x14de84=_0x272247['license'];var _0x2afe66=_0x450a96[_0x9652('0x4')]('-')[0x4];var _0x4454eb=_0x450a96[_0x9652('0x4')]('-')[0x0];var _0x581051=crypto[_0x9652('0x5')](_0x9652('0x6'),util[_0x9652('0x7')](_0x9652('0x8'),_0x2afe66,_0x450a96,_0x4454eb));var _0x3c2f0b=_0x581051[_0x9652('0x9')](_0x14de84,_0x9652('0xa'),_0x9652('0xb'));_0x3c2f0b+=_0x581051['final'](_0x9652('0xb'));var _0x5d9b71=JSON['parse'](_0x3c2f0b);return _0x5d9b71[_0x9652('0xc')](_0x25bfe3)?_0x5d9b71[_0x25bfe3]:null;}}return null;}function isLimit(_0x4199d7,_0x4062a0,_0x354451,_0x3749c7){var _0x219974=_0x4062a0;return compose()['use'](function(_0x229597,_0x39ffc4,_0x13aa39){return db['License'][_0x9652('0xd')]({'where':{'id':0x1},'raw':!![]})[_0x9652('0xe')](function(_0x5d6e04){var _0x493077=getValueFromLicense(_0x4199d7,_0x5d6e04);return _0x493077?_0x493077:_0x219974;})[_0x9652('0xe')](function(_0x2e42a5){_0x219974=_0x2e42a5;return _0x354451['count'](_0x3749c7);})[_0x9652('0xe')](function(_0x1dc7b1){if(_0x1dc7b1>=_0x219974){return _0x39ffc4[_0x9652('0xf')](0x193)[_0x9652('0x10')]({'message':util['format'](_0x9652('0x11'),_0x4199d7)});}_0x13aa39();})[_0x9652('0x12')](function(_0xf10e4a){_0x13aa39(_0xf10e4a);});});}function isUserLimit(){return isLimit(_0x9652('0x13'),0x1,db[_0x9652('0x14')],{'where':{'$or':[{'role':_0x9652('0x15')},{'role':_0x9652('0x16')}]}});}exports[_0x9652('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 6c78ac0..6957910 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 _0x906a=['lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','start','utcOffset','hours','minutes','seconds'];(function(_0x32b4e3,_0x1ca9a7){var _0x29732c=function(_0x12f437){while(--_0x12f437){_0x32b4e3['push'](_0x32b4e3['shift']());}};_0x29732c(++_0x1ca9a7);}(_0x906a,0x18f));var _0xa906=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x906a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xa906('0x0'));var moment=require(_0xa906('0x1'));exports[_0xa906('0x2')]=function(_0x4b7793){var _0x445ef4={'conditions':[]};_0x445ef4[_0xa906('0x3')]=_[_0xa906('0x4')](_0x4b7793,_0xa906('0x5'))?'or':'and';var _0x16f95c=_0x4b7793[_0xa906('0x6')]('[$and]','')[_0xa906('0x6')]('[$or]','')[_0xa906('0x7')]('||');for(var _0x501cdd=0x0;_0x501cdd<_0x16f95c[_0xa906('0x8')];_0x501cdd++){var _0x1bf0aa=_0x16f95c[_0x501cdd][_0xa906('0x7')](':=');var _0x1a367e=_0x1bf0aa[0x0];var _0x18a615=_0x1bf0aa[_0xa906('0x9')](0x1);_0x18a615[_0xa906('0xa')](function(_0x1f9d6d){var _0x1f0416=_0x1f9d6d[_0xa906('0x7')]('[')[_0xa906('0xb')]();var _0x10084d=_0x1f9d6d[_0xa906('0xc')](/\[(.*?)\]/g);_0x10084d['forEach'](function(_0x259d75){var _0x3020ab=_0x259d75[_0xa906('0x7')]('[')[_0xa906('0xd')](function(_0x3faad0){return _0x3faad0[_0xa906('0xe')](']')>-0x1;})[_0xa906('0xf')](function(_0x5b1e1c){return _0x5b1e1c[_0xa906('0x7')](']')[0x0];})[0x0];_0x445ef4[_0xa906('0x10')][_0xa906('0x11')]({'field':_0x1a367e,'operator':_0x1f0416,'value':_0x3020ab});});});}return _0x445ef4;};exports[_0xa906('0x12')]=function(_0x14d0e9,_0x56771b,_0x4662ac){var _0x320125={};if(_0x56771b===_0xa906('0x13')){if(_0x4662ac[_0xa906('0x14')]===_0xa906('0x15')){_0x4662ac[_0xa906('0x14')]=_0xa906('0x16');_0x4662ac['value']+=','+_0x4662ac[_0xa906('0x17')];}else if(_[_0xa906('0x18')]([_0xa906('0x19'),_0xa906('0x1a')],_0x4662ac[_0xa906('0x14')])){_0x4662ac[_0xa906('0x17')]=moment(_0x4662ac['value'])[_0xa906('0x1b')](0x1,_0xa906('0x1c'))[_0xa906('0x1d')](_0xa906('0x1e'));}}if(_0x4662ac[_0xa906('0x1f')]){_0x56771b=_0x4662ac['castTo'];_0x320125[_0xa906('0x20')]=_0xa906('0x21')+_0x14d0e9+'.'+_0x4662ac['field']+_0xa906('0x22')+_0x4662ac['castTo']+')\x20'+parseOperator(_0x4662ac[_0xa906('0x14')]);}else{_0x320125[_0xa906('0x20')]=_0x14d0e9+'.'+_0x4662ac[_0xa906('0x23')]+'\x20'+parseOperator(_0x4662ac[_0xa906('0x14')]);}if(_[_0xa906('0x18')]([_0xa906('0x24'),_0xa906('0x25')],_0x4662ac['operator']))_0x320125[_0xa906('0x20')]='('+_0x320125[_0xa906('0x20')]+_0xa906('0x26')+_0x14d0e9+'.'+_0x4662ac[_0xa906('0x23')]+_0xa906('0x27');_0x320125[_0xa906('0x17')]=parseValue(_0x56771b,_0x4662ac[_0xa906('0x14')],_0x4662ac[_0xa906('0x17')]);return _0x320125;};function parseOperator(_0x1e37a5){var _0x3fb888;switch(_0x1e37a5){case _0xa906('0x28'):_0x3fb888=_0xa906('0x29');break;case _0xa906('0x25'):_0x3fb888=_0xa906('0x2a');break;case'$eq':_0x3fb888='=\x20?';break;case _0xa906('0x24'):_0x3fb888='<>\x20?';break;case _0xa906('0x2b'):case _0xa906('0x2c'):case _0xa906('0x2d'):_0x3fb888=_0xa906('0x2e');break;case _0xa906('0x2f'):_0x3fb888=_0xa906('0x30');break;case _0xa906('0x19'):_0x3fb888=_0xa906('0x31');break;case _0xa906('0x1a'):_0x3fb888=_0xa906('0x32');break;case _0xa906('0x33'):_0x3fb888='>=\x20?';break;case'$between':_0x3fb888='BETWEEN\x20?\x20AND\x20?';break;}return _0x3fb888;}function parseValue(_0x3eb603,_0x20f109,_0x364096){var _0x45b41a={'start':undefined,'end':undefined};switch(_0x20f109){case _0xa906('0x28'):case _0xa906('0x25'):_0x45b41a[_0xa906('0x34')]=_0x364096[_0xa906('0x7')](',');break;case'$substring':_0x45b41a['start']='%'+_0x364096+'%';break;case _0xa906('0x2c'):_0x45b41a[_0xa906('0x34')]=_0x364096+'%';break;case'$endsWith':_0x45b41a['start']='%'+_0x364096;break;case _0xa906('0x16'):var _0x3a3161=_0x364096[_0xa906('0x7')](',');var _0x364096=_0x3a3161[_0xa906('0xb')]();var _0x1c9873=_0x3a3161['pop']();if(_0x3eb603==='DATE'){_0x364096=moment(_0x364096)['utcOffset'](0x0,!![])[_0xa906('0x1d')]();_0x1c9873=moment(_0x1c9873)[_0xa906('0x35')](0x0,!![])['add'](0x17,_0xa906('0x36'))[_0xa906('0x1b')](0x3b,_0xa906('0x37'))['add'](0x3b,_0xa906('0x38'))[_0xa906('0x1d')]();}_0x45b41a={'start':_0x364096,'end':_0x1c9873};break;default:_0x45b41a[_0xa906('0x34')]=_0x364096;break;}return _0x45b41a;} \ No newline at end of file +var _0x563b=['length','slice','forEach','match','filter','indexOf','map','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','CAST(','text','field','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','utcOffset','add','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split'];(function(_0x494641,_0x57d526){var _0x36347e=function(_0x57c70b){while(--_0x57c70b){_0x494641['push'](_0x494641['shift']());}};_0x36347e(++_0x57d526);}(_0x563b,0x13b));var _0xb563=function(_0x12f19e,_0x2fd02f){_0x12f19e=_0x12f19e-0x0;var _0x103d8c=_0x563b[_0x12f19e];return _0x103d8c;};'use strict';var _=require(_0xb563('0x0'));var moment=require(_0xb563('0x1'));exports[_0xb563('0x2')]=function(_0x2e7c53){var _0x4709d3={'conditions':[]};_0x4709d3[_0xb563('0x3')]=_['startsWith'](_0x2e7c53,_0xb563('0x4'))?'or':_0xb563('0x5');var _0xadf213=_0x2e7c53[_0xb563('0x6')](_0xb563('0x7'),'')[_0xb563('0x6')](_0xb563('0x4'),'')[_0xb563('0x8')]('||');for(var _0x20c69b=0x0;_0x20c69b<_0xadf213[_0xb563('0x9')];_0x20c69b++){var _0x1c16fb=_0xadf213[_0x20c69b][_0xb563('0x8')](':=');var _0xe901b0=_0x1c16fb[0x0];var _0x54ee30=_0x1c16fb[_0xb563('0xa')](0x1);_0x54ee30[_0xb563('0xb')](function(_0x134c60){var _0x2e88ae=_0x134c60[_0xb563('0x8')]('[')['shift']();var _0xd615c5=_0x134c60[_0xb563('0xc')](/\[(.*?)\]/g);_0xd615c5[_0xb563('0xb')](function(_0x49de99){var _0x109833=_0x49de99['split']('[')[_0xb563('0xd')](function(_0x1dbbaf){return _0x1dbbaf[_0xb563('0xe')](']')>-0x1;})[_0xb563('0xf')](function(_0x272255){return _0x272255['split'](']')[0x0];})[0x0];_0x4709d3['conditions'][_0xb563('0x10')]({'field':_0xe901b0,'operator':_0x2e88ae,'value':_0x109833});});});}return _0x4709d3;};exports[_0xb563('0x11')]=function(_0x1caa21,_0x317381,_0x19d600){var _0x159401={};if(_0x317381===_0xb563('0x12')){if(_0x19d600['operator']===_0xb563('0x13')){_0x19d600[_0xb563('0x14')]=_0xb563('0x15');_0x19d600[_0xb563('0x16')]+=','+_0x19d600[_0xb563('0x16')];}else if(_[_0xb563('0x17')]([_0xb563('0x18'),_0xb563('0x19')],_0x19d600[_0xb563('0x14')])){_0x19d600[_0xb563('0x16')]=moment(_0x19d600[_0xb563('0x16')])['add'](0x1,_0xb563('0x1a'))[_0xb563('0x1b')](_0xb563('0x1c'));}}if(_0x19d600['castTo']){_0x317381=_0x19d600[_0xb563('0x1d')];_0x159401['text']=_0xb563('0x1e')+_0x1caa21+'.'+_0x19d600['field']+'\x20AS\x20'+_0x19d600['castTo']+')\x20'+parseOperator(_0x19d600[_0xb563('0x14')]);}else{_0x159401[_0xb563('0x1f')]=_0x1caa21+'.'+_0x19d600[_0xb563('0x20')]+'\x20'+parseOperator(_0x19d600[_0xb563('0x14')]);}if(_[_0xb563('0x17')]([_0xb563('0x21'),_0xb563('0x22')],_0x19d600[_0xb563('0x14')]))_0x159401[_0xb563('0x1f')]='('+_0x159401[_0xb563('0x1f')]+'\x20OR\x20'+_0x1caa21+'.'+_0x19d600[_0xb563('0x20')]+_0xb563('0x23');_0x159401[_0xb563('0x16')]=parseValue(_0x317381,_0x19d600['operator'],_0x19d600[_0xb563('0x16')]);return _0x159401;};function parseOperator(_0x320e5d){var _0x14bb66;switch(_0x320e5d){case _0xb563('0x24'):_0x14bb66=_0xb563('0x25');break;case'$notIn':_0x14bb66=_0xb563('0x26');break;case'$eq':_0x14bb66='=\x20?';break;case _0xb563('0x21'):_0x14bb66=_0xb563('0x27');break;case _0xb563('0x28'):case'$startsWith':case _0xb563('0x29'):_0x14bb66=_0xb563('0x2a');break;case _0xb563('0x2b'):_0x14bb66=_0xb563('0x2c');break;case _0xb563('0x18'):_0x14bb66=_0xb563('0x2d');break;case _0xb563('0x19'):_0x14bb66='<=\x20?';break;case'$gte':_0x14bb66=_0xb563('0x2e');break;case _0xb563('0x15'):_0x14bb66=_0xb563('0x2f');break;}return _0x14bb66;}function parseValue(_0x793d1f,_0x5ca85c,_0x270f6d){var _0x2fdea5={'start':undefined,'end':undefined};switch(_0x5ca85c){case _0xb563('0x24'):case _0xb563('0x22'):_0x2fdea5[_0xb563('0x30')]=_0x270f6d[_0xb563('0x8')](',');break;case _0xb563('0x28'):_0x2fdea5['start']='%'+_0x270f6d+'%';break;case'$startsWith':_0x2fdea5[_0xb563('0x30')]=_0x270f6d+'%';break;case _0xb563('0x29'):_0x2fdea5[_0xb563('0x30')]='%'+_0x270f6d;break;case _0xb563('0x15'):var _0x4fe460=_0x270f6d[_0xb563('0x8')](',');var _0x270f6d=_0x4fe460[_0xb563('0x31')]();var _0x5e18d0=_0x4fe460['pop']();if(_0x793d1f===_0xb563('0x12')){_0x270f6d=moment(_0x270f6d)[_0xb563('0x32')](0x0,!![])[_0xb563('0x1b')]();_0x5e18d0=moment(_0x5e18d0)[_0xb563('0x32')](0x0,!![])['add'](0x17,'hours')[_0xb563('0x33')](0x3b,_0xb563('0x34'))[_0xb563('0x33')](0x3b,_0xb563('0x35'))[_0xb563('0x1b')]();}_0x2fdea5={'start':_0x270f6d,'end':_0x5e18d0};break;default:_0x2fdea5['start']=_0x270f6d;break;}return _0x2fdea5;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index bb13b19..22cc91f 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 _0x3fc0=['indexOf','priority','col','unsigned','substr','DESC','cast','ASC','omit','length','isObject','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','lodash','moment','fields','split','filters','isEmpty','forOwn','find','DATE','isPlainObject','$gte','utc','$lte','format','YYYY-MM-DD','subtract','isArray','limit','offset','sort'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x3fc0,0x10b));var _0x03fc=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x3fc0[_0x3df223];return _0x562d11;};'use strict';var _=require(_0x03fc('0x0'));var sequelize=require('sequelize');var moment=require(_0x03fc('0x1'));var LIMIT_VALUE=0xfa;exports[_0x03fc('0x2')]=function(_0xaf1ae0){var _0x381027=null;if(_0xaf1ae0){_0x381027=_0xaf1ae0[_0x03fc('0x3')](',');}return _0x381027;};exports[_0x03fc('0x4')]=function(_0x30f820,_0x54956b){var _0x1430e={};if(!_[_0x03fc('0x5')](_0x30f820)){_[_0x03fc('0x6')](_0x30f820,function(_0x2274a7,_0x1fb9c2){try{if(_0x54956b){var _0x1471d5=_[_0x03fc('0x7')](_0x54956b,{'name':_0x1fb9c2})||{};if(_0x1471d5['type']===_0x03fc('0x8')&&_[_0x03fc('0x9')](_0x2274a7)){var _0x1e65a8=JSON['parse'](_0x2274a7);var _0x323cb9={'$gte':moment(moment(_0x1e65a8[_0x03fc('0xa')])['format']('YYYY-MM-DD'))[_0x03fc('0xb')]()['format'](),'$lte':moment(moment(_0x1e65a8[_0x03fc('0xc')])[_0x03fc('0xd')](_0x03fc('0xe')))[_0x03fc('0xb')]()[_0x03fc('0xf')](0x1,'s')[_0x03fc('0xd')]()};_0x1430e[_0x1fb9c2]=_0x323cb9;}else if(_0x1471d5['name']==='uniqueid'){_0x1430e[_0x1fb9c2]=_0x2274a7;}else{_0x1430e[_0x1fb9c2]=_[_0x03fc('0x10')](_0x2274a7)?_0x2274a7:JSON['parse'](_0x2274a7);}}else{_0x1430e[_0x1fb9c2]=_['isArray'](_0x2274a7)?_0x2274a7:JSON['parse'](_0x2274a7);}}catch(_0x4b9847){_0x1430e[_0x1fb9c2]=_0x2274a7[_0x03fc('0x3')](',');}});}return _0x1430e;};exports[_0x03fc('0x11')]=function(_0x21728a){_0x21728a=parseInt(_0x21728a,0xa);if(!_0x21728a||_0x21728a<0x0){_0x21728a=LIMIT_VALUE;}return _0x21728a;};exports[_0x03fc('0x12')]=function(_0x1b30a8){_0x1b30a8=parseInt(_0x1b30a8,0xa);if(!_0x1b30a8||_0x1b30a8<0x0){_0x1b30a8=0x0;}return _0x1b30a8;};exports[_0x03fc('0x13')]=function(_0x1b3498){var _0x237fcf,_0x35abb2=null;if(_0x1b3498){_0x237fcf=_0x1b3498[_0x03fc('0x3')](',');_0x35abb2=_['map'](_0x237fcf,function(_0x40e9c6){if(_0x40e9c6[_0x03fc('0x14')]('-')===0x0){return[_0x40e9c6===_0x03fc('0x15')?sequelize['cast'](sequelize[_0x03fc('0x16')](_0x03fc('0x15')),_0x03fc('0x17')):_0x40e9c6[_0x03fc('0x18')](0x1),_0x03fc('0x19')];}else{return[_0x40e9c6===_0x03fc('0x15')?sequelize[_0x03fc('0x1a')](sequelize['col'](_0x03fc('0x15')),_0x03fc('0x17')):_0x40e9c6,_0x03fc('0x1b')];}});}return _0x35abb2;};exports[_0x03fc('0x1c')]=function(_0x4db165,_0x414a98){if(_[_0x03fc('0x5')](_0x4db165)){return _0x4db165;}if(_[_0x03fc('0x10')](_0x4db165)){for(var _0x3e3fbe=0x0;_0x3e3fbe<_0x4db165[_0x03fc('0x1d')];_0x3e3fbe+=0x1){_0x4db165[_0x3e3fbe]=this[_0x03fc('0x1c')](_0x4db165[_0x3e3fbe],_0x414a98);}return _0x4db165;}if(!_[_0x03fc('0x1e')](_0x4db165)){return _0x4db165;}if(_['isString'](_0x414a98)){_0x414a98=[_0x414a98];}if(!_[_0x03fc('0x10')](_0x414a98)){return _0x4db165;}for(var _0x437690=0x0;_0x437690<_0x414a98[_0x03fc('0x1d')];_0x437690+=0x1){_[_0x03fc('0x1f')](_0x4db165,_0x414a98[_0x437690]);}for(var _0x1af633 in _0x4db165){if(_0x4db165[_0x03fc('0x20')](_0x1af633)){_0x4db165[_0x1af633]=this[_0x03fc('0x1c')](_0x4db165[_0x1af633],_0x414a98);}}return _0x4db165;};exports[_0x03fc('0x21')]=function(_0x127538){return _0x127538[_0x03fc('0x22')](RegExp(_0x03fc('0x23')))?!![]:![];};exports[_0x03fc('0x24')]=function(_0x2f3e4e){return _0x2f3e4e[_0x03fc('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x03fc('0x25')]=function(_0x39798b){var _0x42c9f4=[];_0x39798b[_0x03fc('0x3')](/[ ,]+/)[_0x03fc('0x26')](function(_0x11ae21){_0x11ae21=_0x11ae21[_0x03fc('0x27')](/([^:]")"+/g,'$1');_0x11ae21='+'+_0x11ae21+'*';if(_0x11ae21['includes']('@'))_0x11ae21='\x22'+_0x11ae21+'\x22';_0x42c9f4[_0x03fc('0x28')](_0x11ae21);});return _0x42c9f4['join']('\x20');}; \ No newline at end of file +var _0x548a=['isEmpty','forOwn','find','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','isArray','offset','sort','map','indexOf','cast','col','priority','unsigned','substr','DESC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','replace','includes','push','join','lodash','sequelize','fields','split'];(function(_0x5dbac8,_0x2a86b3){var _0x4f5535=function(_0x674318){while(--_0x674318){_0x5dbac8['push'](_0x5dbac8['shift']());}};_0x4f5535(++_0x2a86b3);}(_0x548a,0xf8));var _0xa548=function(_0x1d37e7,_0x139ca8){_0x1d37e7=_0x1d37e7-0x0;var _0x5ebd34=_0x548a[_0x1d37e7];return _0x5ebd34;};'use strict';var _=require(_0xa548('0x0'));var sequelize=require(_0xa548('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;exports[_0xa548('0x2')]=function(_0x3e54f3){var _0x4244e0=null;if(_0x3e54f3){_0x4244e0=_0x3e54f3[_0xa548('0x3')](',');}return _0x4244e0;};exports['filters']=function(_0x50ef82,_0x3ed247){var _0x282df7={};if(!_[_0xa548('0x4')](_0x50ef82)){_[_0xa548('0x5')](_0x50ef82,function(_0x2997d4,_0x88c868){try{if(_0x3ed247){var _0x1a7381=_[_0xa548('0x6')](_0x3ed247,{'name':_0x88c868})||{};if(_0x1a7381['type']==='DATE'&&_[_0xa548('0x7')](_0x2997d4)){var _0x2d318b=JSON[_0xa548('0x8')](_0x2997d4);var _0x5861ee={'$gte':moment(moment(_0x2d318b[_0xa548('0x9')])[_0xa548('0xa')](_0xa548('0xb')))[_0xa548('0xc')]()[_0xa548('0xa')](),'$lte':moment(moment(_0x2d318b[_0xa548('0xd')])[_0xa548('0xa')](_0xa548('0xb')))[_0xa548('0xc')]()[_0xa548('0xe')](0x1,'s')['format']()};_0x282df7[_0x88c868]=_0x5861ee;}else if(_0x1a7381[_0xa548('0xf')]==='uniqueid'){_0x282df7[_0x88c868]=_0x2997d4;}else{_0x282df7[_0x88c868]=_[_0xa548('0x10')](_0x2997d4)?_0x2997d4:JSON[_0xa548('0x8')](_0x2997d4);}}else{_0x282df7[_0x88c868]=_[_0xa548('0x10')](_0x2997d4)?_0x2997d4:JSON[_0xa548('0x8')](_0x2997d4);}}catch(_0xd52414){_0x282df7[_0x88c868]=_0x2997d4['split'](',');}});}return _0x282df7;};exports['limit']=function(_0x1005ae){_0x1005ae=parseInt(_0x1005ae,0xa);if(!_0x1005ae||_0x1005ae<0x0){_0x1005ae=LIMIT_VALUE;}return _0x1005ae;};exports[_0xa548('0x11')]=function(_0xfe940a){_0xfe940a=parseInt(_0xfe940a,0xa);if(!_0xfe940a||_0xfe940a<0x0){_0xfe940a=0x0;}return _0xfe940a;};exports[_0xa548('0x12')]=function(_0x3aa962){var _0x38e0a4,_0x376d1b=null;if(_0x3aa962){_0x38e0a4=_0x3aa962[_0xa548('0x3')](',');_0x376d1b=_[_0xa548('0x13')](_0x38e0a4,function(_0xd079e8){if(_0xd079e8[_0xa548('0x14')]('-')===0x0){return[_0xd079e8==='priority'?sequelize[_0xa548('0x15')](sequelize[_0xa548('0x16')](_0xa548('0x17')),_0xa548('0x18')):_0xd079e8[_0xa548('0x19')](0x1),_0xa548('0x1a')];}else{return[_0xd079e8===_0xa548('0x17')?sequelize['cast'](sequelize[_0xa548('0x16')](_0xa548('0x17')),_0xa548('0x18')):_0xd079e8,'ASC'];}});}return _0x376d1b;};exports[_0xa548('0x1b')]=function(_0x16fccc,_0x3d1553){if(_[_0xa548('0x4')](_0x16fccc)){return _0x16fccc;}if(_['isArray'](_0x16fccc)){for(var _0x2afb47=0x0;_0x2afb47<_0x16fccc[_0xa548('0x1c')];_0x2afb47+=0x1){_0x16fccc[_0x2afb47]=this[_0xa548('0x1b')](_0x16fccc[_0x2afb47],_0x3d1553);}return _0x16fccc;}if(!_[_0xa548('0x1d')](_0x16fccc)){return _0x16fccc;}if(_[_0xa548('0x1e')](_0x3d1553)){_0x3d1553=[_0x3d1553];}if(!_[_0xa548('0x10')](_0x3d1553)){return _0x16fccc;}for(var _0x5ad6df=0x0;_0x5ad6df<_0x3d1553[_0xa548('0x1c')];_0x5ad6df+=0x1){_[_0xa548('0x1f')](_0x16fccc,_0x3d1553[_0x5ad6df]);}for(var _0x398449 in _0x16fccc){if(_0x16fccc[_0xa548('0x20')](_0x398449)){_0x16fccc[_0x398449]=this[_0xa548('0x1b')](_0x16fccc[_0x398449],_0x3d1553);}}return _0x16fccc;};exports[_0xa548('0x21')]=function(_0x49c852){return _0x49c852[_0xa548('0x22')](RegExp(_0xa548('0x23')))?!![]:![];};exports[_0xa548('0x24')]=function(_0x4fe73e){return _0x4fe73e[_0xa548('0x22')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x28b36f){var _0x479a22=[];_0x28b36f[_0xa548('0x3')](/[ ,]+/)[_0xa548('0x25')](function(_0x564d82){_0x564d82=_0x564d82[_0xa548('0x26')](/([^:]")"+/g,'$1');_0x564d82='+'+_0x564d82+'*';if(_0x564d82[_0xa548('0x27')]('@'))_0x564d82='\x22'+_0x564d82+'\x22';_0x479a22[_0xa548('0x28')](_0x564d82);});return _0x479a22[_0xa548('0x29')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 1552cd9..4111aac 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9197=['ejs','renderFile','view\x20engine','html','urlencoded','50mb','initialize','express','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','set','appPath','join','root','public','development','client','use','json\x20replacer','toISOString','split','static','views','/server/views'];(function(_0x1b86c4,_0x396fb6){var _0x237e8c=function(_0x38cce1){while(--_0x38cce1){_0x1b86c4['push'](_0x1b86c4['shift']());}};_0x237e8c(++_0x396fb6);}(_0x9197,0x1ce));var _0x7919=function(_0x18fdff,_0x4a5bc8){_0x18fdff=_0x18fdff-0x0;var _0x50015a=_0x9197[_0x18fdff];return _0x50015a;};'use strict';var express=require(_0x7919('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x7919('0x1'));var methodOverride=require(_0x7919('0x2'));var cookieParser=require(_0x7919('0x3'));var errorHandler=require(_0x7919('0x4'));var path=require(_0x7919('0x5'));var passport=require(_0x7919('0x6'));var cors=require(_0x7919('0x7'));var moment=require(_0x7919('0x8'));var config=require(_0x7919('0x9'));var db=require(_0x7919('0xa'))['db'];exports[_0x7919('0xb')]=function(_0x29f14b){var _0x3f0313=_0x29f14b[_0x7919('0xc')](_0x7919('0xd'));if(_0x3f0313==='production'){_0x29f14b[_0x7919('0xe')](_0x7919('0xf'),path[_0x7919('0x10')](config[_0x7919('0x11')],_0x7919('0x12')));}if(_0x3f0313===_0x7919('0x13')||_0x3f0313==='test'){_0x29f14b[_0x7919('0xe')](_0x7919('0xf'),path[_0x7919('0x10')](config['root'],_0x7919('0x14')));_0x29f14b[_0x7919('0x15')](errorHandler());}_0x29f14b['set'](_0x7919('0x16'),function(_0x177724,_0x9f812e){if(this[_0x177724]instanceof Date){_0x9f812e=this[_0x177724][_0x7919('0x17')]()[_0x7919('0x18')]('.')[0x0]+'Z';}return _0x9f812e;});_0x29f14b['use'](express[_0x7919('0x19')](_0x29f14b[_0x7919('0xc')](_0x7919('0xf'))));_0x29f14b[_0x7919('0xe')](_0x7919('0x1a'),config[_0x7919('0x11')]+_0x7919('0x1b'));_0x29f14b['engine']('html',require(_0x7919('0x1c'))[_0x7919('0x1d')]);_0x29f14b[_0x7919('0xe')](_0x7919('0x1e'),_0x7919('0x1f'));_0x29f14b['use'](bodyParser[_0x7919('0x20')]({'limit':_0x7919('0x21'),'extended':!![]}));_0x29f14b[_0x7919('0x15')](bodyParser['json']({'limit':_0x7919('0x21')}));_0x29f14b[_0x7919('0x15')](cors());_0x29f14b[_0x7919('0x15')](methodOverride());_0x29f14b['use'](cookieParser());_0x29f14b[_0x7919('0x15')](passport[_0x7919('0x22')]());}; \ No newline at end of file +var _0xf39b=['view\x20engine','html','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','path','cors','moment','../mysqldb','default','get','env','production','set','appPath','root','public','development','test','join','use','toISOString','split','static','/server/views','engine','ejs','renderFile'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf39b,0x192));var _0xbf39=function(_0xb42bd2,_0x18c572){_0xb42bd2=_0xb42bd2-0x0;var _0xbc4c35=_0xf39b[_0xb42bd2];return _0xbc4c35;};'use strict';var express=require(_0xbf39('0x0'));var favicon=require(_0xbf39('0x1'));var bodyParser=require(_0xbf39('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0xbf39('0x3'));var errorHandler=require('errorhandler');var path=require(_0xbf39('0x4'));var passport=require('passport');var cors=require(_0xbf39('0x5'));var moment=require(_0xbf39('0x6'));var config=require('./environment');var db=require(_0xbf39('0x7'))['db'];exports[_0xbf39('0x8')]=function(_0x36974c){var _0x2a94e6=_0x36974c[_0xbf39('0x9')](_0xbf39('0xa'));if(_0x2a94e6===_0xbf39('0xb')){_0x36974c[_0xbf39('0xc')](_0xbf39('0xd'),path['join'](config[_0xbf39('0xe')],_0xbf39('0xf')));}if(_0x2a94e6===_0xbf39('0x10')||_0x2a94e6===_0xbf39('0x11')){_0x36974c['set'](_0xbf39('0xd'),path[_0xbf39('0x12')](config[_0xbf39('0xe')],'client'));_0x36974c[_0xbf39('0x13')](errorHandler());}_0x36974c['set']('json\x20replacer',function(_0x5d3575,_0x23ef97){if(this[_0x5d3575]instanceof Date){_0x23ef97=this[_0x5d3575][_0xbf39('0x14')]()[_0xbf39('0x15')]('.')[0x0]+'Z';}return _0x23ef97;});_0x36974c['use'](express[_0xbf39('0x16')](_0x36974c[_0xbf39('0x9')](_0xbf39('0xd'))));_0x36974c['set']('views',config[_0xbf39('0xe')]+_0xbf39('0x17'));_0x36974c[_0xbf39('0x18')]('html',require(_0xbf39('0x19'))[_0xbf39('0x1a')]);_0x36974c[_0xbf39('0xc')](_0xbf39('0x1b'),_0xbf39('0x1c'));_0x36974c[_0xbf39('0x13')](bodyParser[_0xbf39('0x1d')]({'limit':_0xbf39('0x1e'),'extended':!![]}));_0x36974c[_0xbf39('0x13')](bodyParser[_0xbf39('0x1f')]({'limit':_0xbf39('0x1e')}));_0x36974c['use'](cors());_0x36974c[_0xbf39('0x13')](methodOverride());_0x36974c[_0xbf39('0x13')](cookieParser());_0x36974c['use'](passport[_0xbf39('0x20')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 4a43176..bfb335f 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 _0xf0a5=['child_process','../environment','networkInterfaces','orderBy','keys','length','filter','family','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','substring','crypto','bimedia-machine-uuid'];(function(_0x1da6ab,_0x4d8120){var _0x4c9fba=function(_0x29b347){while(--_0x29b347){_0x1da6ab['push'](_0x1da6ab['shift']());}};_0x4c9fba(++_0x4d8120);}(_0xf0a5,0x174));var _0x5f0a=function(_0x149ba1,_0x3467ec){_0x149ba1=_0x149ba1-0x0;var _0x39db3b=_0xf0a5[_0x149ba1];return _0x39db3b;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x5f0a('0x0'));var machine=require(_0x5f0a('0x1'));var exec=require(_0x5f0a('0x2'))['execSync'];var config=require(_0x5f0a('0x3'));function getInterfaces(){var _0x5e9edb=[];var _0x21ed27=os[_0x5f0a('0x4')]();var _0x53727b=_[_0x5f0a('0x5')](_[_0x5f0a('0x6')](_0x21ed27));for(var _0x114eab=0x0;_0x114eab<_0x53727b[_0x5f0a('0x7')];_0x114eab++){var _0x4c5da4=_0x21ed27[_0x53727b[_0x114eab]][_0x5f0a('0x8')](function(_0xcd2b21){return _0xcd2b21[_0x5f0a('0x9')]==='IPv4'&&_0xcd2b21[_0x5f0a('0xa')]===![];});_0x5e9edb=_0x5e9edb['concat'](_0x4c5da4);}return _0x5e9edb;}function getFirstInterface(){var _0x341540=_[_0x5f0a('0xb')](getInterfaces());return{'macAddress':_0x341540&&_0x341540['mac']?_0x341540[_0x5f0a('0xc')]:_0x5f0a('0xd'),'ipAddress':_0x341540&&_0x341540[_0x5f0a('0xe')]?_0x341540[_0x5f0a('0xe')]:_0x5f0a('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x1ad3b2=_[_0x5f0a('0x5')](os[_0x5f0a('0x10')]()[_0x5f0a('0x11')](function(_0x400173){return _0x400173[_0x5f0a('0x12')];}))[_0x5f0a('0x13')](':');return crypto['createHash'](_0x5f0a('0x14'))[_0x5f0a('0x15')](_0x1ad3b2)[_0x5f0a('0x16')](_0x5f0a('0x17'));}exports[_0x5f0a('0x18')]=function(){var _0x1bb3ab=os[_0x5f0a('0x19')]();var _0x3ee07d=/[0-9a-f-]{36}/;if(config[_0x5f0a('0x1a')]&&_0x3ee07d[_0x5f0a('0x1b')](config[_0x5f0a('0x1a')])){return config[_0x5f0a('0x1a')];}else if(_0x1bb3ab===_0x5f0a('0x1c')){return exec(_0x5f0a('0x1d'),{'encoding':_0x5f0a('0x1e')})[_0x5f0a('0x1f')]('\x0d\x0a','');}else{var _0x298c80=getFirstInterface();var _0x57fd3d=getCPUhash();var _0x293c0a=_0x57fd3d+'|'+os[_0x5f0a('0x20')]()+'|'+_0x298c80['macAddress']+'|'+_0x298c80['ipAddress'];var _0x39f270=crypto['createHash'](_0x5f0a('0x14'))['update'](_0x293c0a)['digest'](_0x5f0a('0x17'));return _0x39f270['substring'](0x0,0x8)+'-'+_0x39f270[_0x5f0a('0x21')](0x8,0xc)+'-'+_0x39f270[_0x5f0a('0x21')](0xc,0x10)+'-'+_0x39f270['substring'](0x10,0x14)+'-'+_0x39f270[_0x5f0a('0x21')](0x14);}}; \ No newline at end of file +var _0xa83f=['lodash','bimedia-machine-uuid','child_process','execSync','networkInterfaces','keys','family','IPv4','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','join','createHash','md5','update','digest','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','hex','substring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa83f,0xf8));var _0xfa83=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa83f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfa83('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xfa83('0x1'));var exec=require(_0xfa83('0x2'))[_0xfa83('0x3')];var config=require('../environment');function getInterfaces(){var _0x4b1dcd=[];var _0x2972b7=os[_0xfa83('0x4')]();var _0x5ba4f9=_['orderBy'](_[_0xfa83('0x5')](_0x2972b7));for(var _0x279000=0x0;_0x279000<_0x5ba4f9['length'];_0x279000++){var _0x506670=_0x2972b7[_0x5ba4f9[_0x279000]]['filter'](function(_0x237536){return _0x237536[_0xfa83('0x6')]===_0xfa83('0x7')&&_0x237536['internal']===![];});_0x4b1dcd=_0x4b1dcd['concat'](_0x506670);}return _0x4b1dcd;}function getFirstInterface(){var _0x791d45=_[_0xfa83('0x8')](getInterfaces());return{'macAddress':_0x791d45&&_0x791d45['mac']?_0x791d45[_0xfa83('0x9')]:_0xfa83('0xa'),'ipAddress':_0x791d45&&_0x791d45['address']?_0x791d45[_0xfa83('0xb')]:'127.0.0.1'};}exports[_0xfa83('0xc')]=getFirstInterface;function getCPUhash(){var _0x3328ba=_['orderBy'](os[_0xfa83('0xd')]()['map'](function(_0x1edd12){return _0x1edd12['model'];}))[_0xfa83('0xe')](':');return crypto[_0xfa83('0xf')](_0xfa83('0x10'))[_0xfa83('0x11')](_0x3328ba)[_0xfa83('0x12')]('hex');}exports['getUuid']=function(){var _0x29207e=os[_0xfa83('0x13')]();var _0x481218=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x481218[_0xfa83('0x14')](config[_0xfa83('0x15')])){return config[_0xfa83('0x15')];}else if(_0x29207e===_0xfa83('0x16')){return exec(_0xfa83('0x17'),{'encoding':_0xfa83('0x18')})[_0xfa83('0x19')]('\x0d\x0a','');}else{var _0x480413=getFirstInterface();var _0x1049d4=getCPUhash();var _0x3a739f=_0x1049d4+'|'+os[_0xfa83('0x1a')]()+'|'+_0x480413[_0xfa83('0x1b')]+'|'+_0x480413[_0xfa83('0x1c')];var _0x38db68=crypto[_0xfa83('0xf')](_0xfa83('0x10'))[_0xfa83('0x11')](_0x3a739f)[_0xfa83('0x12')](_0xfa83('0x1d'));return _0x38db68['substring'](0x0,0x8)+'-'+_0x38db68[_0xfa83('0x1e')](0x8,0xc)+'-'+_0x38db68['substring'](0xc,0x10)+'-'+_0x38db68[_0xfa83('0x1e')](0x10,0x14)+'-'+_0x38db68[_0xfa83('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1099a97..a9b30f6 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 _0x344c=['%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','bluebird','pkginfo','version','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports'];(function(_0x1d1c35,_0x11a922){var _0x4cc280=function(_0x2c84c5){while(--_0x2c84c5){_0x1d1c35['push'](_0x1d1c35['shift']());}};_0x4cc280(++_0x11a922);}(_0x344c,0x1b7));var _0xc344=function(_0x1305f8,_0x575443){_0x1305f8=_0x1305f8-0x0;var _0x24b59c=_0x344c[_0x1305f8];return _0x24b59c;};'use strict';var util=require(_0xc344('0x0'));var moment=require(_0xc344('0x1'));var rp=require('request-promise');var BPromise=require(_0xc344('0x2'));var pkginfo=require(_0xc344('0x3'))(module,_0xc344('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xc344('0x5'));var hardware=require(_0xc344('0x6'));var logger=require(_0xc344('0x7'))('license');var HOST=_0xc344('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1b7b70){return new BPromise(function(_0x5520be,_0x309e80){var _0x4d0019=util[_0xc344('0x9')](_0xc344('0xa'),HOST,_0x1b7b70,module[_0xc344('0xb')]['version']);if(oldToken){_0x4d0019=util['format'](_0xc344('0xc'),HOST,_0x1b7b70,module[_0xc344('0xb')][_0xc344('0x4')],oldToken);}var _0x372cfb={'uri':_0x4d0019,'method':_0xc344('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x372cfb)['then'](function(_0x35e9aa){_0x5520be(_0x35e9aa);})[_0xc344('0xe')](function(_0x57f6b0){_0x309e80(_0x57f6b0);});});}function manageLicense(_0x3ec4ac,_0x432880){var _0x1bc4dd=_0x432880[_0xc344('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x1bc4dd[_0xc344('0x10')]!==_0x3ec4ac&&!_0x1bc4dd[_0xc344('0x11')]){oldToken=_0x1bc4dd[_0xc344('0x10')];}httpRequest(_0x3ec4ac)[_0xc344('0x12')](function(_0x2ff165){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2ff165[_0xc344('0x13')]){isOldTokenSent=![];if(!_0x1bc4dd[_0xc344('0x14')]&&_0x1bc4dd['license']!=_0x2ff165[_0xc344('0x14')]||_0x1bc4dd[_0xc344('0x14')]&&_0x1bc4dd[_0xc344('0x11')]){logger[_0xc344('0x15')](_0xc344('0x16'));}if(_0x1bc4dd[_0xc344('0x14')]&&!_0x1bc4dd[_0xc344('0x11')]&&_0x1bc4dd[_0xc344('0x14')]!=_0x2ff165[_0xc344('0x14')]){logger[_0xc344('0x15')](_0xc344('0x17'));}if(_0x1bc4dd[_0xc344('0x14')]&&!_0x1bc4dd[_0xc344('0x11')]&&_0x1bc4dd['license']==_0x2ff165[_0xc344('0x14')]){return _0x432880;}return _0x432880[_0xc344('0x18')]({'data1':_0x3ec4ac,'data2':null,'license':_0x2ff165[_0xc344('0x14')]});}else{if(_0x2ff165[_0xc344('0x14')]||_0x1bc4dd['license']){if(!_0x1bc4dd[_0xc344('0x11')]){if(_0x1bc4dd[_0xc344('0x10')]==_0x3ec4ac){GRAY_PERIOD_REASON=_0xc344('0x19');logger[_0xc344('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xc344('0x1a');logger[_0xc344('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1bc4dd[_0xc344('0x10')],_0x3ec4ac);}logger[_0xc344('0x15')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xc344('0x1b')](),moment()['format'](_0xc344('0x1c')));return _0x432880[_0xc344('0x18')]({'data2':encryptor[_0xc344('0x1d')](moment()[_0xc344('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xc344('0x1e')](encryptor['decryptString'](_0x1bc4dd[_0xc344('0x11')]),_0xc344('0x1f'))>DAYS){logger[_0xc344('0x15')](_0xc344('0x20'),moment()[_0xc344('0x9')](_0xc344('0x1c')));isOldTokenSent=![];return _0x432880[_0xc344('0x18')]({'data1':_0x3ec4ac,'data2':null,'license':null});}}}else{if(_0x1bc4dd[_0xc344('0x10')]!=_0x3ec4ac){logger[_0xc344('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1bc4dd[_0xc344('0x10')],_0x3ec4ac);return _0x432880['update']({'data1':_0x3ec4ac,'data2':null,'license':null});}}}return _0x432880;})[_0xc344('0x12')](function(_0x12965c){_0x432880=_0x12965c;})['catch'](function(_0x5c475a){logger['error'](_0x5c475a[_0xc344('0x21')]);})[_0xc344('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0xc344('0x23')](),_0x432880);},TIME);});}function defaultLicense(){var _0x517301=hardware['getUuid']();if(_0x517301){return db[_0xc344('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x517301}})[_0xc344('0x25')](function(_0x5aedbc,_0x2962f7){logger[_0xc344('0x15')](_0xc344('0x26'),_0x517301);manageLicense(_0x517301,_0x5aedbc);})[_0xc344('0xe')](function(_0x40b2e2){logger[_0xc344('0x27')](_0x40b2e2[_0xc344('0x21')]);});}}exports[_0xc344('0x28')]=defaultLicense; \ No newline at end of file +var _0xeb65=['Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','GET','catch','get','data2','then','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled'];(function(_0x1db757,_0x4e2046){var _0x199572=function(_0x165b48){while(--_0x165b48){_0x1db757['push'](_0x1db757['shift']());}};_0x199572(++_0x4e2046);}(_0xeb65,0x163));var _0x5eb6=function(_0x40e63b,_0x58bb08){_0x40e63b=_0x40e63b-0x0;var _0x1dcc96=_0xeb65[_0x40e63b];return _0x1dcc96;};'use strict';var util=require(_0x5eb6('0x0'));var moment=require(_0x5eb6('0x1'));var rp=require(_0x5eb6('0x2'));var BPromise=require(_0x5eb6('0x3'));var pkginfo=require(_0x5eb6('0x4'))(module,_0x5eb6('0x5'));var db=require(_0x5eb6('0x6'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x5eb6('0x7'));var logger=require(_0x5eb6('0x8'))(_0x5eb6('0x9'));var HOST=_0x5eb6('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x9346c6){return new BPromise(function(_0x5bd41d,_0x5a55cd){var _0x23e712=util[_0x5eb6('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x9346c6,module[_0x5eb6('0xc')][_0x5eb6('0x5')]);if(oldToken){_0x23e712=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x9346c6,module[_0x5eb6('0xc')][_0x5eb6('0x5')],oldToken);}var _0x38ff7c={'uri':_0x23e712,'method':_0x5eb6('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x38ff7c)['then'](function(_0x5a5129){_0x5bd41d(_0x5a5129);})[_0x5eb6('0xe')](function(_0x427248){_0x5a55cd(_0x427248);});});}function manageLicense(_0x21adff,_0x526bd8){var _0x1a1750=_0x526bd8[_0x5eb6('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x1a1750['data1']!==_0x21adff&&!_0x1a1750[_0x5eb6('0x10')]){oldToken=_0x1a1750['data1'];}httpRequest(_0x21adff)[_0x5eb6('0x11')](function(_0xb40339){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xb40339['active']){isOldTokenSent=![];if(!_0x1a1750[_0x5eb6('0x9')]&&_0x1a1750[_0x5eb6('0x9')]!=_0xb40339[_0x5eb6('0x9')]||_0x1a1750[_0x5eb6('0x9')]&&_0x1a1750[_0x5eb6('0x10')]){logger[_0x5eb6('0x12')](_0x5eb6('0x13'));}if(_0x1a1750['license']&&!_0x1a1750[_0x5eb6('0x10')]&&_0x1a1750[_0x5eb6('0x9')]!=_0xb40339['license']){logger[_0x5eb6('0x12')](_0x5eb6('0x14'));}if(_0x1a1750[_0x5eb6('0x9')]&&!_0x1a1750[_0x5eb6('0x10')]&&_0x1a1750[_0x5eb6('0x9')]==_0xb40339[_0x5eb6('0x9')]){return _0x526bd8;}return _0x526bd8[_0x5eb6('0x15')]({'data1':_0x21adff,'data2':null,'license':_0xb40339['license']});}else{if(_0xb40339[_0x5eb6('0x9')]||_0x1a1750[_0x5eb6('0x9')]){if(!_0x1a1750[_0x5eb6('0x10')]){if(_0x1a1750['data1']==_0x21adff){GRAY_PERIOD_REASON=_0x5eb6('0x16');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x5eb6('0x17');logger[_0x5eb6('0x12')](_0x5eb6('0x18'),_0x1a1750[_0x5eb6('0x19')],_0x21adff);}logger['info'](_0x5eb6('0x1a'),GRAY_PERIOD_REASON[_0x5eb6('0x1b')](),moment()['format'](_0x5eb6('0x1c')));return _0x526bd8[_0x5eb6('0x15')]({'data2':encryptor[_0x5eb6('0x1d')](moment()[_0x5eb6('0xb')](_0x5eb6('0x1c')))});}else{if(moment()[_0x5eb6('0x1e')](encryptor[_0x5eb6('0x1f')](_0x1a1750[_0x5eb6('0x10')]),'days')>DAYS){logger[_0x5eb6('0x12')](_0x5eb6('0x20'),moment()['format'](_0x5eb6('0x1c')));isOldTokenSent=![];return _0x526bd8[_0x5eb6('0x15')]({'data1':_0x21adff,'data2':null,'license':null});}}}else{if(_0x1a1750[_0x5eb6('0x19')]!=_0x21adff){logger[_0x5eb6('0x12')](_0x5eb6('0x18'),_0x1a1750[_0x5eb6('0x19')],_0x21adff);return _0x526bd8['update']({'data1':_0x21adff,'data2':null,'license':null});}}}return _0x526bd8;})['then'](function(_0x35324c){_0x526bd8=_0x35324c;})['catch'](function(_0x9e8838){logger['error'](_0x9e8838[_0x5eb6('0x21')]);})[_0x5eb6('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x5eb6('0x23')](),_0x526bd8);},TIME);});}function defaultLicense(){var _0x4295c9=hardware[_0x5eb6('0x23')]();if(_0x4295c9){return db[_0x5eb6('0x24')][_0x5eb6('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x4295c9}})[_0x5eb6('0x26')](function(_0x3c0b29,_0x60414d){logger['info'](_0x5eb6('0x27'),_0x4295c9);manageLicense(_0x4295c9,_0x3c0b29);})[_0x5eb6('0xe')](function(_0xec1024){logger[_0x5eb6('0x28')](_0xec1024['message']);});}}exports[_0x5eb6('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index f7bc6b1..135ce4d 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 _0xae1b=['forEach','pick','admin','user','License\x20limit\x20reached\x20for\x20users','util','lodash','moment','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','license','isEmpty','data1','data2','split','%s:%s:%s','demo','decryptString','gray','deadline','add','days','format','machineUuid','changed','message','findAll','role','sequelize','COUNT','count','telephone','telephones'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae1b,0x1d3));var _0xbae1=function(_0x258512,_0x423e86){_0x258512=_0x258512-0x0;var _0x5cd34a=_0xae1b[_0x258512];return _0x5cd34a;};'use strict';var util=require(_0xbae1('0x0'));var _=require(_0xbae1('0x1'));var moment=require(_0xbae1('0x2'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0xbae1('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbae1('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xbae1('0x5'),'machineUuid':hardware[_0xbae1('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbae1('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xbae1('0x7'),'machineUuid':hardware[_0xbae1('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x59edd9){return new BPromise(function(_0xe51fb4,_0x563471){return db[_0xbae1('0x8')][_0xbae1('0x9')](_[_0xbae1('0xa')](_0x59edd9,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5e02e6){return checkLicense(_0x5e02e6,null);})[_0xbae1('0xb')](function(_0x491c69){_0xe51fb4(_0x491c69);return;})[_0xbae1('0xc')](function(_0x41f229){_0x563471(_0x41f229);});});}function checkLicense(_0x199bc8,_0x153e6b){if(!_0x199bc8){demoLicense[_0xbae1('0xd')]=_0x199bc8['data1'];return demoLicense;}try{var _0x58a114=_0x153e6b||_0x199bc8[_0xbae1('0xe')];if(_[_0xbae1('0xf')](_0x58a114)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x320399=_0x199bc8[_0xbae1('0x10')];var _0x12f906=_0x199bc8[_0xbae1('0x11')];var _0x32f687=_0x320399[_0xbae1('0x12')]('-')[0x4];var _0x1b947=_0x320399['split']('-')[0x0];var _0x277f7d=encryptor['decryptString'](_0x58a114,util['format'](_0xbae1('0x13'),_0x32f687,_0x320399,_0x1b947));var _0xc1e04f=JSON['parse'](_0x277f7d);_0xc1e04f[_0xbae1('0x14')]=![];_0xc1e04f[_0xbae1('0xd')]=_0x320399;_0xc1e04f['machineUuid']=hardware[_0xbae1('0x6')]();if(_0x12f906){var _0x3c67f4=encryptor[_0xbae1('0x15')](_0x12f906);_0xc1e04f[_0xbae1('0x16')]=_0x3c67f4;_0xc1e04f[_0xbae1('0x17')]=moment(_0x3c67f4)[_0xbae1('0x18')](0x7,_0xbae1('0x19'))[_0xbae1('0x1a')]();_0xc1e04f['grayReason']=_0xc1e04f[_0xbae1('0xd')]!=_0xc1e04f[_0xbae1('0x1b')]?_0xbae1('0x1c'):'disabled';}return _0xc1e04f;}catch(_0x2d8899){breakingLicense['uuid']=_0x199bc8[_0xbae1('0x10')];breakingLicense['message']=_0x2d8899[_0xbae1('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x256d0a,_0xc38ba8){getLicense()[_0xbae1('0xb')](function(_0xafa4cc){return db['User'][_0xbae1('0x1e')]({'attributes':[_0xbae1('0x1f'),[db[_0xbae1('0x20')]['fn'](_0xbae1('0x21'),db[_0xbae1('0x20')]['col'](_0xbae1('0x1f'))),_0xbae1('0x22')]],'group':_0xbae1('0x1f'),'where':{'role':{'$or':['admin','user',_0xbae1('0x23')]}},'raw':!![]})[_0xbae1('0xb')](function(_0x477484){var _0x2e9997={'user':_0xafa4cc['users']||0x0,'telephone':_0xafa4cc[_0xbae1('0x24')]||0x0};_0x477484[_0xbae1('0x25')](function(_0x354186){var _0x1f127e=_0x354186[_0xbae1('0x1f')]==='admin'?'user':_0x354186[_0xbae1('0x1f')];_0x2e9997[_0x1f127e]-=_0x354186['count'];if(_0x2e9997[_0x1f127e]<0x0)_0x2e9997[_0x1f127e]=0x0;});_0x256d0a(_0x2e9997);return;});})[_0xbae1('0xc')](function(_0x495d84){_0xc38ba8(_0x495d84);});});}function checkUserLimits(_0x39282d){return new BPromise(function(_0x4a1a47,_0x5439ba){getLimits()[_0xbae1('0xb')](function(_0x2b1be6){var _0x4662d2=_[_0xbae1('0x26')](_['countBy'](_0x39282d,_0xbae1('0x1f')),[_0xbae1('0x27'),_0xbae1('0x28'),_0xbae1('0x23')]);var _0x13b971=(_0x4662d2[_0xbae1('0x27')]||0x0)+(_0x4662d2[_0xbae1('0x28')]||0x0);var _0x15f257=_0x4662d2[_0xbae1('0x23')]||0x0;if(_0x13b971>_0x2b1be6['user'])return _0x5439ba(_0xbae1('0x29'));if(_0x15f257>_0x2b1be6[_0xbae1('0x23')])return _0x5439ba('License\x20limit\x20reached\x20for\x20telephones');return _0x4a1a47();})[_0xbae1('0xc')](function(_0x329900){_0x5439ba(_0x329900);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x1b5d=['disabled','message','User','findAll','sequelize','COUNT','role','admin','users','telephones','forEach','user','count','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','decryptString','%s:%s:%s','parse','uuid','gray','deadline','days','format','grayReason','machineUuid','changed'];(function(_0x506cde,_0x24fb30){var _0x25fc7d=function(_0x10e6f9){while(--_0x10e6f9){_0x506cde['push'](_0x506cde['shift']());}};_0x25fc7d(++_0x24fb30);}(_0x1b5d,0x70));var _0xd1b5=function(_0x329ba0,_0x2e889b){_0x329ba0=_0x329ba0-0x0;var _0x526123=_0x1b5d[_0x329ba0];return _0x526123;};'use strict';var util=require(_0xd1b5('0x0'));var _=require(_0xd1b5('0x1'));var moment=require(_0xd1b5('0x2'));var BPromise=require(_0xd1b5('0x3'));var hardware=require('./hardware');var encryptor=require(_0xd1b5('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd1b5('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd1b5('0x6'),'machineUuid':hardware[_0xd1b5('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd1b5('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd1b5('0x8'),'machineUuid':hardware[_0xd1b5('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xfbecb9){return new BPromise(function(_0x4f13ee,_0x38ff77){return db[_0xd1b5('0x9')][_0xd1b5('0xa')](_[_0xd1b5('0xb')](_0xfbecb9,{'raw':!![],'where':{'id':0x1}}))[_0xd1b5('0xc')](function(_0x3b1385){return checkLicense(_0x3b1385,null);})[_0xd1b5('0xc')](function(_0x16c5c4){_0x4f13ee(_0x16c5c4);return;})[_0xd1b5('0xd')](function(_0x322f7d){_0x38ff77(_0x322f7d);});});}function checkLicense(_0x56bd3b,_0x2fd559){if(!_0x56bd3b){demoLicense['uuid']=_0x56bd3b['data1'];return demoLicense;}try{var _0x204641=_0x2fd559||_0x56bd3b['license'];if(_[_0xd1b5('0xe')](_0x204641)){throw new Error(_0xd1b5('0xf'));}var _0x1e4347=_0x56bd3b[_0xd1b5('0x10')];var _0x122b71=_0x56bd3b['data2'];var _0x31b32c=_0x1e4347[_0xd1b5('0x11')]('-')[0x4];var _0x370323=_0x1e4347[_0xd1b5('0x11')]('-')[0x0];var _0x3046b9=encryptor[_0xd1b5('0x12')](_0x204641,util['format'](_0xd1b5('0x13'),_0x31b32c,_0x1e4347,_0x370323));var _0xa76026=JSON[_0xd1b5('0x14')](_0x3046b9);_0xa76026['demo']=![];_0xa76026[_0xd1b5('0x15')]=_0x1e4347;_0xa76026['machineUuid']=hardware[_0xd1b5('0x7')]();if(_0x122b71){var _0x1dab2e=encryptor['decryptString'](_0x122b71);_0xa76026[_0xd1b5('0x16')]=_0x1dab2e;_0xa76026[_0xd1b5('0x17')]=moment(_0x1dab2e)['add'](0x7,_0xd1b5('0x18'))[_0xd1b5('0x19')]();_0xa76026[_0xd1b5('0x1a')]=_0xa76026[_0xd1b5('0x15')]!=_0xa76026[_0xd1b5('0x1b')]?_0xd1b5('0x1c'):_0xd1b5('0x1d');}return _0xa76026;}catch(_0x1a35bb){breakingLicense[_0xd1b5('0x15')]=_0x56bd3b[_0xd1b5('0x10')];breakingLicense[_0xd1b5('0x1e')]=_0x1a35bb['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x534b6c,_0x41b9e9){getLicense()[_0xd1b5('0xc')](function(_0x507159){return db[_0xd1b5('0x1f')][_0xd1b5('0x20')]({'attributes':['role',[db[_0xd1b5('0x21')]['fn'](_0xd1b5('0x22'),db['sequelize']['col'](_0xd1b5('0x23'))),'count']],'group':'role','where':{'role':{'$or':[_0xd1b5('0x24'),'user','telephone']}},'raw':!![]})[_0xd1b5('0xc')](function(_0xe35254){var _0x17152a={'user':_0x507159[_0xd1b5('0x25')]||0x0,'telephone':_0x507159[_0xd1b5('0x26')]||0x0};_0xe35254[_0xd1b5('0x27')](function(_0x3a8bac){var _0x14fd22=_0x3a8bac['role']===_0xd1b5('0x24')?_0xd1b5('0x28'):_0x3a8bac[_0xd1b5('0x23')];_0x17152a[_0x14fd22]-=_0x3a8bac[_0xd1b5('0x29')];if(_0x17152a[_0x14fd22]<0x0)_0x17152a[_0x14fd22]=0x0;});_0x534b6c(_0x17152a);return;});})[_0xd1b5('0xd')](function(_0x1dff94){_0x41b9e9(_0x1dff94);});});}function checkUserLimits(_0x1ab987){return new BPromise(function(_0x3b6588,_0x4a7466){getLimits()[_0xd1b5('0xc')](function(_0x356d2f){var _0x47d969=_['pick'](_[_0xd1b5('0x2a')](_0x1ab987,'role'),[_0xd1b5('0x24'),_0xd1b5('0x28'),_0xd1b5('0x2b')]);var _0x14a002=(_0x47d969[_0xd1b5('0x24')]||0x0)+(_0x47d969[_0xd1b5('0x28')]||0x0);var _0x29ada7=_0x47d969['telephone']||0x0;if(_0x14a002>_0x356d2f[_0xd1b5('0x28')])return _0x4a7466(_0xd1b5('0x2c'));if(_0x29ada7>_0x356d2f[_0xd1b5('0x2b')])return _0x4a7466(_0xd1b5('0x2d'));return _0x3b6588();})['catch'](function(_0x521da1){_0x4a7466(_0x521da1);});});}module[_0xd1b5('0x2e')]={'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 6b026fa..4af103d 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 _0xa508=['http://localhost:9000','app-id','secret','exports'];(function(_0xdef496,_0x2eb88b){var _0x871098=function(_0x302fe8){while(--_0x302fe8){_0xdef496['push'](_0xdef496['shift']());}};_0x871098(++_0x2eb88b);}(_0xa508,0x187));var _0x8a50=function(_0x5bcdd1,_0x372f77){_0x5bcdd1=_0x5bcdd1-0x0;var _0x526def=_0xa508[_0x5bcdd1];return _0x526def;};'use strict';module[_0x8a50('0x0')]={'DOMAIN':_0x8a50('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x8a50('0x2'),'GOOGLE_SECRET':_0x8a50('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xe2af=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xe2af,0x167));var _0xfe2a=function(_0x57ebf9,_0x5d7849){_0x57ebf9=_0x57ebf9-0x0;var _0x16376b=_0xe2af[_0x57ebf9];return _0x16376b;};'use strict';module[_0xfe2a('0x0')]={'DOMAIN':_0xfe2a('0x1'),'SESSION_SECRET':_0xfe2a('0x2'),'GOOGLE_ID':_0xfe2a('0x3'),'GOOGLE_SECRET':_0xfe2a('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 00512c9..0418336 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65a5=['winston','path','join','/var','xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','%s-%s','error','File','info','Console','debugLevel','moment'];(function(_0x141103,_0x56f880){var _0x3d47e3=function(_0x3e081a){while(--_0x3e081a){_0x141103['push'](_0x141103['shift']());}};_0x3d47e3(++_0x56f880);}(_0x65a5,0x175));var _0x565a=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x65a5[_0x754ab4];return _0x34079a;};'use strict';var moment=require(_0x565a('0x0'));var winston=require(_0x565a('0x1'));var util=require('util');var path=require(_0x565a('0x2'));var debugLevel='INFO';function filename(_0x4235c0,_0x4543b4){return path[_0x565a('0x3')](_0x565a('0x4'),'log',_0x565a('0x5'),util[_0x565a('0x6')](_0x565a('0x7'),_0x4235c0,_0x4543b4));}function formatter(_0x10357f,_0x206df1){_0x206df1['message']=_0x206df1[_0x565a('0x8')][_0x565a('0x9')](/@@{/g,_0x565a('0xa'))['replace'](/}@@/g,_0x565a('0xb'))[_0x565a('0x9')](/@{/g,'{{')[_0x565a('0x9')](/}@/g,'}}');return util[_0x565a('0x6')](_0x565a('0xc'),moment()[_0x565a('0x6')](_0x565a('0xd')),_0x206df1['level'][_0x565a('0xe')](),_0x10357f,_0x206df1[_0x565a('0x8')]);}module[_0x565a('0xf')]=function(_0x171752){return new winston['Logger']({'transports':[new winston['transports']['File']({'name':util['format'](_0x565a('0x10'),_0x171752,'error'),'filename':filename(_0x171752,_0x565a('0x11')),'level':_0x565a('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5b9e0c){return formatter(_0x171752,_0x5b9e0c);}}),new winston['transports'][(_0x565a('0x12'))]({'name':util[_0x565a('0x6')](_0x565a('0x10'),_0x171752,_0x565a('0x13')),'filename':filename(_0x171752,_0x565a('0x13')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x41b10c){return formatter(_0x171752,_0x41b10c);}}),new winston['transports'][(_0x565a('0x14'))]({'level':process['env'][_0x565a('0x15')]||debugLevel,'json':![],'formatter':function(_0x590ded){return formatter(_0x171752,_0x590ded);}})]});}; \ No newline at end of file +var _0x344d=['toUpperCase','exports','transports','%s-%s','error','File','info','Console','debugLevel','moment','winston','util','join','/var','format','%s-%s.log','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level'];(function(_0x4c7db3,_0x20a531){var _0x202824=function(_0x53adcf){while(--_0x53adcf){_0x4c7db3['push'](_0x4c7db3['shift']());}};_0x202824(++_0x20a531);}(_0x344d,0x1ab));var _0xd344=function(_0x56c2d3,_0x245571){_0x56c2d3=_0x56c2d3-0x0;var _0x21b228=_0x344d[_0x56c2d3];return _0x21b228;};'use strict';var moment=require(_0xd344('0x0'));var winston=require(_0xd344('0x1'));var util=require(_0xd344('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x11dd89,_0x3be5c0){return path[_0xd344('0x3')](_0xd344('0x4'),'log','xcally',util[_0xd344('0x5')](_0xd344('0x6'),_0x11dd89,_0x3be5c0));}function formatter(_0x1dce3b,_0x5dc1e1){_0x5dc1e1[_0xd344('0x7')]=_0x5dc1e1[_0xd344('0x7')][_0xd344('0x8')](/@@{/g,_0xd344('0x9'))[_0xd344('0x8')](/}@@/g,_0xd344('0xa'))[_0xd344('0x8')](/@{/g,'{{')[_0xd344('0x8')](/}@/g,'}}');return util[_0xd344('0x5')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xd344('0x5')](_0xd344('0xb')),_0x5dc1e1[_0xd344('0xc')][_0xd344('0xd')](),_0x1dce3b,_0x5dc1e1[_0xd344('0x7')]);}module[_0xd344('0xe')]=function(_0x4a2e48){return new winston['Logger']({'transports':[new winston[(_0xd344('0xf'))]['File']({'name':util['format'](_0xd344('0x10'),_0x4a2e48,'error'),'filename':filename(_0x4a2e48,_0xd344('0x11')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x26d59e){return formatter(_0x4a2e48,_0x26d59e);}}),new winston[(_0xd344('0xf'))][(_0xd344('0x12'))]({'name':util[_0xd344('0x5')]('%s-%s',_0x4a2e48,'info'),'filename':filename(_0x4a2e48,_0xd344('0x13')),'level':_0xd344('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4fe07c){return formatter(_0x4a2e48,_0x4fe07c);}}),new winston['transports'][(_0xd344('0x14'))]({'level':process['env'][_0xd344('0x15')]||debugLevel,'json':![],'formatter':function(_0xaa8c60){return formatter(_0x4a2e48,_0xaa8c60);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index d815057..721e6b5 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 _0xfd87=['routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','ami','agi','email','../../services/email/index.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd87,0x1b5));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x7fd8('0x0'));var os=require('os');var config={'apps':[{'name':_0x7fd8('0x1'),'script':path[_0x7fd8('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x7fd8('0x3'),'script':path[_0x7fd8('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x7fd8('0x4'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0x7fd8('0x5'),'script':path[_0x7fd8('0x2')](__dirname,_0x7fd8('0x6'))},{'name':_0x7fd8('0x7'),'script':path['join'](__dirname,_0x7fd8('0x8'))},{'name':_0x7fd8('0x9'),'script':path[_0x7fd8('0x2')](__dirname,_0x7fd8('0xa'))}]};module[_0x7fd8('0xb')]=config; \ No newline at end of file +var _0xce77=['../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami'];(function(_0xdd1fac,_0x3d6e09){var _0xd76c1f=function(_0x16e602){while(--_0x16e602){_0xdd1fac['push'](_0xdd1fac['shift']());}};_0xd76c1f(++_0x3d6e09);}(_0xce77,0x18e));var _0x7ce7=function(_0x5480bd,_0x17636e){_0x5480bd=_0x5480bd-0x0;var _0x509bdb=_0xce77[_0x5480bd];return _0x509bdb;};'use strict';var path=require(_0x7ce7('0x0'));var os=require('os');var config={'apps':[{'name':_0x7ce7('0x1'),'script':path[_0x7ce7('0x2')](__dirname,_0x7ce7('0x3'))},{'name':_0x7ce7('0x4'),'script':path[_0x7ce7('0x2')](__dirname,_0x7ce7('0x5'))},{'name':_0x7ce7('0x6'),'script':path[_0x7ce7('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x7ce7('0x7'),'script':path['join'](__dirname,_0x7ce7('0x8'))},{'name':_0x7ce7('0x9'),'script':path[_0x7ce7('0x2')](__dirname,_0x7ce7('0xa'))},{'name':'xdr','script':path[_0x7ce7('0x2')](__dirname,_0x7ce7('0xb'))}]};module[_0x7ce7('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 94def06..60b4f7a 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 _0x0d4d=['restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','then','start','disconnect','stop'];(function(_0x41568f,_0x7c6734){var _0x2b35e5=function(_0x486c48){while(--_0x486c48){_0x41568f['push'](_0x41568f['shift']());}};_0x2b35e5(++_0x7c6734);}(_0x0d4d,0x132));var _0xd0d4=function(_0x5d976f,_0x4c22af){_0x5d976f=_0x5d976f-0x0;var _0x514630=_0x0d4d[_0x5d976f];return _0x514630;};'use strict';var pm2=require(_0xd0d4('0x0'));var BPromise=require(_0xd0d4('0x1'));var config=require(_0xd0d4('0x2'));function connect(){return new BPromise(function(_0x24a4c4,_0x1f74ab){return pm2[_0xd0d4('0x3')](function(_0x4d5c19){if(_0x4d5c19){return _0x1f74ab(_0x4d5c19);}return _0x24a4c4(_0xd0d4('0x4'));});});};exports['start']=function(_0x2e99ee){return connect()[_0xd0d4('0x5')](function(){return new BPromise(function(_0x582aaa,_0x34d93b){return pm2[_0xd0d4('0x6')](_0x2e99ee,function(_0x1c5d01,_0x5c8c7b){if(_0x1c5d01){return _0x34d93b(_0x1c5d01);}pm2[_0xd0d4('0x7')]();return _0x582aaa(_0x5c8c7b);});});});};exports['stop']=function(_0x3fdd50){return connect()['then'](function(){return new BPromise(function(_0xdf6916,_0x314cd5){return pm2[_0xd0d4('0x8')](_0x3fdd50,function(_0x5bdeab,_0x1ed4da){if(_0x5bdeab){return _0x314cd5(_0x5bdeab);}pm2[_0xd0d4('0x7')]();return _0xdf6916(_0x1ed4da);});});});};exports[_0xd0d4('0x9')]=function(_0xe102db){return connect()[_0xd0d4('0x5')](function(){return new BPromise(function(_0xbf4c47,_0x5c3360){return pm2[_0xd0d4('0x9')](_0xe102db,function(_0x37ac04,_0x29ee49){if(_0x37ac04){return _0x5c3360(_0x37ac04);}pm2[_0xd0d4('0x7')]();return _0xbf4c47(_0x29ee49);});});});};exports[_0xd0d4('0xa')]=function(){return connect()[_0xd0d4('0x5')](function(){return new BPromise(function(_0x583c05,_0x3dc332){return pm2[_0xd0d4('0xa')](function(_0x10a175,_0x5d6dd7){if(_0x10a175){return _0x3dc332(_0x10a175);}pm2['disconnect']();return _0x583c05(_0x5d6dd7);});});});};exports[_0xd0d4('0xb')]=function(_0x186405){return connect()['then'](function(){return new BPromise(function(_0x29bda4,_0x1e8608){return pm2['describe'](_0x186405,function(_0x5d7e66,_0x1b64f){if(_0x5d7e66){return _0x1e8608(_0x5d7e66);}pm2[_0xd0d4('0x7')]();return _0x29bda4(_0x1b64f);});});});};exports[_0xd0d4('0xc')]=function(_0x5079d5){return connect()['then'](function(){return new BPromise(function(_0x5eb5e4,_0x407cda){return pm2[_0xd0d4('0xc')](_0x5079d5,function(_0x1e8409,_0x5de0e2){if(_0x1e8409){return _0x407cda(_0x1e8409);}pm2['disconnect']();return _0x5eb5e4(_0x5de0e2);});});});};exports[_0xd0d4('0xd')]=function(){return connect()['then'](function(){return new BPromise(function(_0x2e6bbf,_0x272580){return pm2[_0xd0d4('0xd')](function(_0x485cd8){if(_0x485cd8){return _0x272580(_0x485cd8);}return _0x2e6bbf(_0xd0d4('0xe'));});});});}; \ No newline at end of file +var _0xa976=['list','describe','delete','dump','saved','pm2','bluebird','connect','connected','start','then','disconnect','stop','restart'];(function(_0x5407b6,_0x50ad7d){var _0x28889a=function(_0x405452){while(--_0x405452){_0x5407b6['push'](_0x5407b6['shift']());}};_0x28889a(++_0x50ad7d);}(_0xa976,0xd7));var _0x6a97=function(_0x3e88c2,_0x7554a7){_0x3e88c2=_0x3e88c2-0x0;var _0x4430d0=_0xa976[_0x3e88c2];return _0x4430d0;};'use strict';var pm2=require(_0x6a97('0x0'));var BPromise=require(_0x6a97('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x28d3ba,_0x2f5457){return pm2[_0x6a97('0x2')](function(_0x15cd31){if(_0x15cd31){return _0x2f5457(_0x15cd31);}return _0x28d3ba(_0x6a97('0x3'));});});};exports[_0x6a97('0x4')]=function(_0x58caf7){return connect()[_0x6a97('0x5')](function(){return new BPromise(function(_0x5832b3,_0x46d246){return pm2[_0x6a97('0x4')](_0x58caf7,function(_0x45a705,_0x57855a){if(_0x45a705){return _0x46d246(_0x45a705);}pm2[_0x6a97('0x6')]();return _0x5832b3(_0x57855a);});});});};exports[_0x6a97('0x7')]=function(_0x3d8ceb){return connect()[_0x6a97('0x5')](function(){return new BPromise(function(_0x2a41e1,_0x340307){return pm2[_0x6a97('0x7')](_0x3d8ceb,function(_0x26712d,_0x538b68){if(_0x26712d){return _0x340307(_0x26712d);}pm2[_0x6a97('0x6')]();return _0x2a41e1(_0x538b68);});});});};exports[_0x6a97('0x8')]=function(_0x49e011){return connect()[_0x6a97('0x5')](function(){return new BPromise(function(_0x58c92a,_0x1f8bb4){return pm2['restart'](_0x49e011,function(_0x3797ed,_0x5c9212){if(_0x3797ed){return _0x1f8bb4(_0x3797ed);}pm2[_0x6a97('0x6')]();return _0x58c92a(_0x5c9212);});});});};exports[_0x6a97('0x9')]=function(){return connect()[_0x6a97('0x5')](function(){return new BPromise(function(_0x2e928c,_0x1a249c){return pm2['list'](function(_0x5f02a2,_0x5b5ce0){if(_0x5f02a2){return _0x1a249c(_0x5f02a2);}pm2[_0x6a97('0x6')]();return _0x2e928c(_0x5b5ce0);});});});};exports[_0x6a97('0xa')]=function(_0x377056){return connect()[_0x6a97('0x5')](function(){return new BPromise(function(_0x52ec46,_0x500f7a){return pm2[_0x6a97('0xa')](_0x377056,function(_0x4f82c7,_0x2694c9){if(_0x4f82c7){return _0x500f7a(_0x4f82c7);}pm2[_0x6a97('0x6')]();return _0x52ec46(_0x2694c9);});});});};exports[_0x6a97('0xb')]=function(_0x5883e9){return connect()['then'](function(){return new BPromise(function(_0x29245d,_0x5de4fa){return pm2[_0x6a97('0xb')](_0x5883e9,function(_0x19e490,_0x4fe3b0){if(_0x19e490){return _0x5de4fa(_0x19e490);}pm2[_0x6a97('0x6')]();return _0x29245d(_0x4fe3b0);});});});};exports[_0x6a97('0xc')]=function(){return connect()[_0x6a97('0x5')](function(){return new BPromise(function(_0x4c8cb1,_0x40756e){return pm2[_0x6a97('0xc')](function(_0x55c60b){if(_0x55c60b){return _0x40756e(_0x55c60b);}return _0x4c8cb1(_0x6a97('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index b5d8e47..9a05c8f 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 _0x7034=['start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','then','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','inspect'];(function(_0x3b05bd,_0x4e425b){var _0x1575fd=function(_0xfc68b1){while(--_0xfc68b1){_0x3b05bd['push'](_0x3b05bd['shift']());}};_0x1575fd(++_0x4e425b);}(_0x7034,0x67));var _0x4703=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x7034[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x4703('0x0'));var moment=require(_0x4703('0x1'));var Redis=require(_0x4703('0x2'));var util=require(_0x4703('0x3'));var config=require(_0x4703('0x4'));var db=require(_0x4703('0x5'))['db'];var logger=require(_0x4703('0x6'))(_0x4703('0x7'));config[_0x4703('0x8')]=_[_0x4703('0x9')](config[_0x4703('0x8')],{'host':_0x4703('0xa'),'port':0x18eb});var io=require(_0x4703('0xb'))(new Redis(config[_0x4703('0x8')]));function closeInteractions(){var _0x34041e=0x0;var _0x59af64=[];return db['Setting'][_0x4703('0xc')]({'raw':!![],'attributes':['id',_0x4703('0xd')],'where':{'id':0x1}})['then'](function(_0x68d790){_0x34041e=_0x68d790[_0x4703('0xd')];if(_0x34041e){return db[_0x4703('0xe')][_0x4703('0xf')]({'raw':!![],'attributes':['id',_0x4703('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4703('0x11')](_0x68d790[_0x4703('0xd')],'minutes')}}});}else{return[];}})[_0x4703('0x12')](function(_0x124ea9){if(_0x124ea9&&_0x124ea9[_0x4703('0x13')]){_0x59af64=_[_0x4703('0x14')](_0x124ea9||[],'id');logger['info'](_0x4703('0x15'),_0x59af64[_0x4703('0x16')]());return db[_0x4703('0xe')][_0x4703('0x17')]({'closeReason':_0x4703('0x18'),'disposition':_0x4703('0x19'),'closed':!![],'closedAt':moment()[_0x4703('0x1a')](_0x4703('0x1b'))},{'where':{'id':_0x59af64}});}})[_0x4703('0x12')](function(){if(_0x59af64&&_0x59af64[_0x4703('0x13')]){logger['info'](_0x4703('0x1c'),_0x59af64[_0x4703('0x16')]());for(var _0x4a757c=0x0;_0x4a757c<_0x59af64[_0x4703('0x13')];_0x4a757c++){io[_0x4703('0x1d')](_0x4703('0x1e'),{'id':_0x59af64[_0x4a757c],'closed':!![]});}}})['catch'](function(_0x4f0a02){logger[_0x4703('0x1f')]('[CHAT]\x20Error\x20closing\x20interactions',_0x4f0a02?util[_0x4703('0x20')](_0x4f0a02,{'showHidden':![],'depth':null}):'');});}exports[_0x4703('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xce22=['join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','then','ChatInteraction','findAll','subtract','chatTimeout','length','map','info'];(function(_0x58bbba,_0x36615c){var _0x374260=function(_0x35145a){while(--_0x35145a){_0x58bbba['push'](_0x58bbba['shift']());}};_0x374260(++_0x36615c);}(_0xce22,0x17f));var _0x2ce2=function(_0x28c4fe,_0xc408af){_0x28c4fe=_0x28c4fe-0x0;var _0x1a527d=_0xce22[_0x28c4fe];return _0x1a527d;};'use strict';var _=require(_0x2ce2('0x0'));var moment=require(_0x2ce2('0x1'));var Redis=require(_0x2ce2('0x2'));var util=require(_0x2ce2('0x3'));var config=require(_0x2ce2('0x4'));var db=require(_0x2ce2('0x5'))['db'];var logger=require(_0x2ce2('0x6'))(_0x2ce2('0x7'));config[_0x2ce2('0x8')]=_[_0x2ce2('0x9')](config[_0x2ce2('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x2ce2('0xa'))(new Redis(config[_0x2ce2('0x8')]));function closeInteractions(){var _0x112f57=0x0;var _0x14b125=[];return db[_0x2ce2('0xb')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x2ce2('0xc')](function(_0x2941fc){_0x112f57=_0x2941fc['chatTimeout'];if(_0x112f57){return db[_0x2ce2('0xd')][_0x2ce2('0xe')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x2ce2('0xf')](_0x2941fc[_0x2ce2('0x10')],'minutes')}}});}else{return[];}})[_0x2ce2('0xc')](function(_0x1d8d52){if(_0x1d8d52&&_0x1d8d52[_0x2ce2('0x11')]){_0x14b125=_[_0x2ce2('0x12')](_0x1d8d52||[],'id');logger[_0x2ce2('0x13')]('[CHAT]\x20Interactions\x20to\x20close:',_0x14b125[_0x2ce2('0x14')]());return db[_0x2ce2('0xd')][_0x2ce2('0x15')]({'closeReason':_0x2ce2('0x16'),'disposition':_0x2ce2('0x17'),'closed':!![],'closedAt':moment()['format'](_0x2ce2('0x18'))},{'where':{'id':_0x14b125}});}})[_0x2ce2('0xc')](function(){if(_0x14b125&&_0x14b125[_0x2ce2('0x11')]){logger[_0x2ce2('0x13')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x14b125[_0x2ce2('0x14')]());for(var _0x3ebe9b=0x0;_0x3ebe9b<_0x14b125[_0x2ce2('0x11')];_0x3ebe9b++){io[_0x2ce2('0x19')]('chatInteraction:update',{'id':_0x14b125[_0x3ebe9b],'closed':!![]});}}})[_0x2ce2('0x1a')](function(_0x13986b){logger[_0x2ce2('0x1b')](_0x2ce2('0x1c'),_0x13986b?util[_0x2ce2('0x1d')](_0x13986b,{'showHidden':![],'depth':null}):'');});}exports[_0x2ce2('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 72caa73..1d0cca0 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 _0x6f84=['auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','catch','error\x20mail','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','toString','keyBy','difference','deleteJob','delete\x20cron','length','my\x20id','run\x20job','isBetween','startAt','endAt','cron','exists','stop','stop\x20cron','active','update','update\x20cron','run','util','path','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','service','MailAccount','host','Smtp','port','secure','authentication'];(function(_0x1dc9a1,_0x1b65f0){var _0x25bbdb=function(_0x1a0d51){while(--_0x1a0d51){_0x1dc9a1['push'](_0x1dc9a1['shift']());}};_0x25bbdb(++_0x1b65f0);}(_0x6f84,0x1b2));var _0x46f8=function(_0x393a3a,_0x40220c){_0x393a3a=_0x393a3a-0x0;var _0x1b4631=_0x6f84[_0x393a3a];return _0x1b4631;};'use strict';var fs=require('fs');var util=require(_0x46f8('0x0'));var path=require(_0x46f8('0x1'));var _=require('lodash');var moment=require(_0x46f8('0x2'));var CronJobManager=require(_0x46f8('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x46f8('0x4'));var logger=require(_0x46f8('0x5'))(_0x46f8('0x6'));var db=require(_0x46f8('0x7'))['db'];var analyticCustomReportController=require(_0x46f8('0x8'));var analyticDefaultReportController=require(_0x46f8('0x9'));var client=jayson[_0x46f8('0xa')][_0x46f8('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x39a34f,_0x122833){return function(){logger[_0x46f8('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x39a34f[_0x46f8('0xd')]);var _0x53b9bc=!![];var _0x1d6673={'tls':{'rejectUnauthorized':![]}};if(_0x39a34f['MailAccount']['Smtp'][_0x46f8('0xe')]){_0x1d6673['service']=_0x39a34f[_0x46f8('0xf')]['Smtp'][_0x46f8('0xe')];}else{_0x1d6673[_0x46f8('0x10')]=_0x39a34f[_0x46f8('0xf')][_0x46f8('0x11')][_0x46f8('0x10')];_0x1d6673[_0x46f8('0x12')]=_0x39a34f[_0x46f8('0xf')]['Smtp'][_0x46f8('0x12')];_0x1d6673[_0x46f8('0x13')]=_0x39a34f[_0x46f8('0xf')]['Smtp']['secure'];}if(_0x39a34f[_0x46f8('0xf')]['Smtp'][_0x46f8('0x14')]){_0x1d6673[_0x46f8('0x15')]={'user':_0x39a34f[_0x46f8('0xf')][_0x46f8('0x11')][_0x46f8('0x16')],'pass':_0x39a34f[_0x46f8('0xf')][_0x46f8('0x11')][_0x46f8('0x17')]};}var _0x4136c8={'account':_0x1d6673,'message':{'from':util[_0x46f8('0x18')](_0x46f8('0x19'),_0x39a34f[_0x46f8('0xf')][_0x46f8('0x1a')],_0x39a34f[_0x46f8('0xf')][_0x46f8('0xd')]||_0x39a34f[_0x46f8('0xf')][_0x46f8('0x11')][_0x46f8('0x16')]),'to':_0x39a34f[_0x46f8('0xd')],'cc':_0x39a34f['cc'],'bcc':_0x39a34f[_0x46f8('0x1b')],'subject':util[_0x46f8('0x18')](_0x46f8('0x1c'),_0x122833[_0x46f8('0x1a')],_0x39a34f['subtractNumber'],_0x39a34f[_0x46f8('0x1d')])}};var _0x5abb01=path[_0x46f8('0x1e')](__dirname,_0x46f8('0x1f'));var _0xa95bbf=_0x122833[_0x46f8('0x20')];var _0x224f03=util['format'](_0x46f8('0x21'),path[_0x46f8('0x22')](_0x122833['savename'],path[_0x46f8('0x23')](_0x122833['savename'])),_0x46f8('0x24'));var _0x3a06b8=path[_0x46f8('0x1e')](_0x5abb01,_0xa95bbf);var _0x333d89=path[_0x46f8('0x1e')](_0x5abb01,_0x224f03);if(fs[_0x46f8('0x25')](_0x3a06b8)){_0x122833[_0x46f8('0x26')]=_0x46f8('0x27');_0x4136c8['message'][_0x46f8('0x28')]=[{'filename':_0xa95bbf,'path':_0x3a06b8}];_0x4136c8[_0x46f8('0x29')]['text']=util[_0x46f8('0x18')](_0x46f8('0x2a'),JSON[_0x46f8('0x2b')](_0x122833,null,0x2));}else if(fs[_0x46f8('0x25')](_0x333d89)){_0x122833[_0x46f8('0x26')]=_0x46f8('0x27');_0x4136c8[_0x46f8('0x29')][_0x46f8('0x28')]=[{'filename':_0x224f03,'path':_0x333d89}];}else{_0x4136c8[_0x46f8('0x29')][_0x46f8('0x2c')]=_0x46f8('0x2d');if(!_0x39a34f[_0x46f8('0x2e')]){_0x53b9bc=![];logger['info'](_0x46f8('0x2f'));}}if(_0x53b9bc){return client[_0x46f8('0x30')](_0x46f8('0x31'),_0x4136c8)[_0x46f8('0x32')](function(_0x46e592){if(_0x46e592['error']){return logger[_0x46f8('0x33')]('error\x20mail',JSON[_0x46f8('0x2b')](_0x46e592));}return logger[_0x46f8('0xc')]('email\x20sent');})[_0x46f8('0x34')](function(_0x192119){return logger['error'](_0x46f8('0x35'),JSON['stringify'](_0x192119));});}};}function handleError(){return function(_0x19ae01){return logger[_0x46f8('0x33')](JSON[_0x46f8('0x2b')](_0x19ae01));};}function handleResult(_0x4165db){return function(_0x5c3bf1){logger[_0x46f8('0xc')](_0x46f8('0x36'),JSON[_0x46f8('0x2b')](_0x5c3bf1));if(_0x4165db['MailAccount']&&_0x4165db[_0x46f8('0xf')]['Smtp']&&!_[_0x46f8('0x37')](_0x4165db['email'])){setTimeout(handleSendEmail(_0x4165db,_0x5c3bf1),0x3c*0x3e8);}};}function handleJob(_0x31df75){return function(){try{if(_[_0x46f8('0x37')](_0x31df75[_0x46f8('0x38')])){return logger['info'](_0x46f8('0x39'));}if(_['isNil'](_0x31df75['subtractUnit'])){return logger[_0x46f8('0xc')](_0x46f8('0x3a'));}var _0x25853d={'startDate':moment()[_0x46f8('0x3b')](_0x31df75[_0x46f8('0x38')],_0x31df75['subtractUnit'])[_0x46f8('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x46f8('0x18')](_0x46f8('0x3c')),'type':_0x46f8('0x3d'),'output':_0x31df75[_0x46f8('0x3e')],'name':_0x31df75['name']};if(!_[_0x46f8('0x37')](_0x31df75[_0x46f8('0x3f')])){logger[_0x46f8('0xc')]('exec\x20defaul\x20report\x20id:%s',_0x31df75[_0x46f8('0x3f')]);return analyticDefaultReportController['runReport']({'id':_0x31df75[_0x46f8('0x3f')]},_0x25853d)['then'](handleResult(_0x31df75))[_0x46f8('0x34')](handleError());}if(!_['isNil'](_0x31df75[_0x46f8('0x40')])){logger[_0x46f8('0xc')](_0x46f8('0x41'),_0x31df75[_0x46f8('0x40')]);return analyticCustomReportController[_0x46f8('0x42')]({'id':_0x31df75[_0x46f8('0x40')]},_0x25853d)[_0x46f8('0x32')](handleResult(_0x31df75))['catch'](handleError());}}catch(_0x335f41){logger[_0x46f8('0x33')](JSON[_0x46f8('0x2b')](_0x335f41));}return logger['info'](_0x46f8('0x43'));};}function getJobs(_0x50ce17){var _0x58f019={};if(_0x50ce17){_0x58f019['id']=_0x50ce17;}return db[_0x46f8('0x44')]['findAll']({'where':_0x58f019,'include':[{'model':db['MailAccount'],'attributes':['id',_0x46f8('0x1a'),'email'],'include':[{'model':db[_0x46f8('0x45')],'as':'Smtp'}]}]})[_0x46f8('0x32')](function(_0x52974b){var _0x1fbef5=_[_0x46f8('0x46')](manager[_0x46f8('0x47')]);var _0xffb4e7=_['map'](_0x52974b,function(_0x420e8c){return _0x420e8c['id'][_0x46f8('0x48')]();});var _0x21863a=_[_0x46f8('0x49')](_0x52974b,function(_0x2a7381){return _0x2a7381['id']['toString']();});var _0x3e452e=_0x50ce17?_0xffb4e7:_[_0x46f8('0x4a')](_0xffb4e7,_0x1fbef5);var _0x3a3dfe=_['intersection'](_0xffb4e7,_0x1fbef5);var _0x42fece=_['difference'](_0x1fbef5,_0xffb4e7);var _0xe89f45;var _0x33b917;for(_0xe89f45=0x0;_0xe89f45<_0x42fece['length']&&!_0x50ce17;_0xe89f45+=0x1){_0x33b917=_0x42fece[_0xe89f45][_0x46f8('0x48')]();if(manager['exists'](_0x33b917)){manager['stop'](_0x33b917);manager[_0x46f8('0x4b')](_0x33b917);logger['info'](_0x46f8('0x4c'),_0x33b917);}}logger[_0x46f8('0xc')]('toRun',JSON['stringify'](_0x3e452e));for(_0xe89f45=0x0;_0xe89f45<_0x3e452e[_0x46f8('0x4d')];_0xe89f45+=0x1){_0x33b917=_0x3e452e[_0xe89f45][_0x46f8('0x48')]();logger['info']('index',_0x33b917);if(_0x50ce17){logger[_0x46f8('0xc')](_0x46f8('0x4e'),_0x50ce17);logger[_0x46f8('0xc')](JSON[_0x46f8('0x2b')](_0x21863a[_0x33b917]));BPromise['resolve']()['then'](handleJob(_0x21863a[_0x33b917]));logger[_0x46f8('0xc')](_0x46f8('0x4f'),_0x21863a[_0x33b917][_0x46f8('0x1a')],_0x21863a[_0x33b917]['cron']);}else if(_0x21863a[_0x33b917]['cron']&&_0x21863a[_0x33b917]['active']&&moment()[_0x46f8('0x50')](_0x21863a[_0x33b917][_0x46f8('0x51')],_0x21863a[_0x33b917][_0x46f8('0x52')])){manager['add'](_0x33b917,_0x21863a[_0x33b917][_0x46f8('0x53')],handleJob(_0x21863a[_0x33b917]));manager['start'](_0x33b917);logger['info']('add\x20cron',_0x21863a[_0x33b917]['name'],_0x21863a[_0x33b917]['cron']);}else if(manager[_0x46f8('0x54')](_0x33b917)){manager[_0x46f8('0x55')](_0x33b917);manager[_0x46f8('0x4b')](_0x33b917);logger[_0x46f8('0xc')](_0x46f8('0x56'),_0x21863a[_0x33b917]['name'],_0x21863a[_0x33b917][_0x46f8('0x53')]);}}for(_0xe89f45=0x0,_0x33b917;_0xe89f45<_0x3a3dfe[_0x46f8('0x4d')]&&!_0x50ce17;_0xe89f45+=0x1){_0x33b917=_0x3a3dfe[_0xe89f45][_0x46f8('0x48')]();if(manager['exists'](_0x33b917)){if(_0x21863a[_0x33b917][_0x46f8('0x53')]&&_0x21863a[_0x33b917][_0x46f8('0x57')]&&moment()['isBetween'](_0x21863a[_0x33b917][_0x46f8('0x51')],_0x21863a[_0x33b917][_0x46f8('0x52')])){manager[_0x46f8('0x58')](_0x33b917,_0x21863a[_0x33b917][_0x46f8('0x53')],handleJob(_0x21863a[_0x33b917]));logger['info'](_0x46f8('0x59'),_0x21863a[_0x33b917][_0x46f8('0x1a')],_0x21863a[_0x33b917]['cron']);}else{manager[_0x46f8('0x55')](_0x33b917);manager[_0x46f8('0x4b')](_0x33b917);logger[_0x46f8('0xc')](_0x46f8('0x56'),_0x21863a[_0x33b917][_0x46f8('0x1a')],_0x21863a[_0x33b917][_0x46f8('0x53')]);}}}})['catch'](function(_0x3d7a8e){logger[_0x46f8('0x33')](JSON['stringify'](_0x3d7a8e));});}exports[_0x46f8('0x5a')]=function(_0x1a51b5){return getJobs(_0x1a51b5);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xc5c7=['stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','stop\x20cron','update','start','lodash','moment','cron-job-manager','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','email','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractUnit','join','../../files/reports','savename','extname','existsSync','Sent','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','then','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','keys','map','toString','difference','intersection','exists'];(function(_0x5ce20f,_0x1759b7){var _0x47b66e=function(_0x372cb2){while(--_0x372cb2){_0x5ce20f['push'](_0x5ce20f['shift']());}};_0x47b66e(++_0x1759b7);}(_0xc5c7,0x1c4));var _0x7c5c=function(_0x551603,_0x42e62e){_0x551603=_0x551603-0x0;var _0x4ad6ac=_0xc5c7[_0x551603];return _0x4ad6ac;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x7c5c('0x0'));var moment=require(_0x7c5c('0x1'));var CronJobManager=require(_0x7c5c('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0x7c5c('0x3'));var logger=require(_0x7c5c('0x4'))(_0x7c5c('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x7c5c('0x6'));var analyticDefaultReportController=require(_0x7c5c('0x7'));var client=jayson[_0x7c5c('0x8')][_0x7c5c('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x318f14,_0x288af8){return function(){logger[_0x7c5c('0xa')](_0x7c5c('0xb'),_0x318f14['email']);var _0x4f13c3=!![];var _0x377285={'tls':{'rejectUnauthorized':![]}};if(_0x318f14[_0x7c5c('0xc')][_0x7c5c('0xd')][_0x7c5c('0xe')]){_0x377285['service']=_0x318f14['MailAccount']['Smtp'][_0x7c5c('0xe')];}else{_0x377285[_0x7c5c('0xf')]=_0x318f14['MailAccount'][_0x7c5c('0xd')][_0x7c5c('0xf')];_0x377285[_0x7c5c('0x10')]=_0x318f14[_0x7c5c('0xc')]['Smtp'][_0x7c5c('0x10')];_0x377285[_0x7c5c('0x11')]=_0x318f14[_0x7c5c('0xc')][_0x7c5c('0xd')][_0x7c5c('0x11')];}if(_0x318f14[_0x7c5c('0xc')][_0x7c5c('0xd')]['authentication']){_0x377285[_0x7c5c('0x12')]={'user':_0x318f14[_0x7c5c('0xc')][_0x7c5c('0xd')][_0x7c5c('0x13')],'pass':_0x318f14[_0x7c5c('0xc')][_0x7c5c('0xd')][_0x7c5c('0x14')]};}var _0x415641={'account':_0x377285,'message':{'from':util[_0x7c5c('0x15')](_0x7c5c('0x16'),_0x318f14[_0x7c5c('0xc')]['name'],_0x318f14[_0x7c5c('0xc')][_0x7c5c('0x17')]||_0x318f14[_0x7c5c('0xc')]['Smtp'][_0x7c5c('0x13')]),'to':_0x318f14[_0x7c5c('0x17')],'cc':_0x318f14['cc'],'bcc':_0x318f14[_0x7c5c('0x18')],'subject':util[_0x7c5c('0x15')](_0x7c5c('0x19'),_0x288af8[_0x7c5c('0x1a')],_0x318f14['subtractNumber'],_0x318f14[_0x7c5c('0x1b')])}};var _0x5025a5=path[_0x7c5c('0x1c')](__dirname,_0x7c5c('0x1d'));var _0x12c647=_0x288af8[_0x7c5c('0x1e')];var _0x554d94=util['format']('%s.%s',path['basename'](_0x288af8['savename'],path[_0x7c5c('0x1f')](_0x288af8[_0x7c5c('0x1e')])),'zip');var _0x4add95=path[_0x7c5c('0x1c')](_0x5025a5,_0x12c647);var _0x4b2c91=path[_0x7c5c('0x1c')](_0x5025a5,_0x554d94);if(fs[_0x7c5c('0x20')](_0x4add95)){_0x288af8['status']=_0x7c5c('0x21');_0x415641['message'][_0x7c5c('0x22')]=[{'filename':_0x12c647,'path':_0x4add95}];_0x415641[_0x7c5c('0x23')]['text']=util['format'](_0x7c5c('0x24'),JSON[_0x7c5c('0x25')](_0x288af8,null,0x2));}else if(fs[_0x7c5c('0x20')](_0x4b2c91)){_0x288af8['status']=_0x7c5c('0x21');_0x415641['message']['attachments']=[{'filename':_0x554d94,'path':_0x4b2c91}];}else{_0x415641['message'][_0x7c5c('0x26')]=_0x7c5c('0x27');if(!_0x318f14[_0x7c5c('0x28')]){_0x4f13c3=![];logger[_0x7c5c('0xa')](_0x7c5c('0x29'));}}if(_0x4f13c3){return client[_0x7c5c('0x2a')](_0x7c5c('0x2b'),_0x415641)['then'](function(_0x9deebd){if(_0x9deebd[_0x7c5c('0x2c')]){return logger[_0x7c5c('0x2c')](_0x7c5c('0x2d'),JSON[_0x7c5c('0x25')](_0x9deebd));}return logger[_0x7c5c('0xa')](_0x7c5c('0x2e'));})['catch'](function(_0x577192){return logger[_0x7c5c('0x2c')](_0x7c5c('0x2d'),JSON[_0x7c5c('0x25')](_0x577192));});}};}function handleError(){return function(_0x4218d0){return logger['error'](JSON[_0x7c5c('0x25')](_0x4218d0));};}function handleResult(_0x49ca97){return function(_0x2a6f08){logger[_0x7c5c('0xa')](_0x7c5c('0x2f'),JSON[_0x7c5c('0x25')](_0x2a6f08));if(_0x49ca97[_0x7c5c('0xc')]&&_0x49ca97[_0x7c5c('0xc')][_0x7c5c('0xd')]&&!_[_0x7c5c('0x30')](_0x49ca97[_0x7c5c('0x17')])){setTimeout(handleSendEmail(_0x49ca97,_0x2a6f08),0x3c*0x3e8);}};}function handleJob(_0x3b006a){return function(){try{if(_[_0x7c5c('0x30')](_0x3b006a[_0x7c5c('0x31')])){return logger[_0x7c5c('0xa')](_0x7c5c('0x32'));}if(_['isNil'](_0x3b006a[_0x7c5c('0x1b')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x23cc29={'startDate':moment()[_0x7c5c('0x33')](_0x3b006a[_0x7c5c('0x31')],_0x3b006a[_0x7c5c('0x1b')])[_0x7c5c('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x7c5c('0x15')](_0x7c5c('0x34')),'type':_0x7c5c('0x35'),'output':_0x3b006a[_0x7c5c('0x36')],'name':_0x3b006a['name']};if(!_[_0x7c5c('0x30')](_0x3b006a[_0x7c5c('0x37')])){logger[_0x7c5c('0xa')](_0x7c5c('0x38'),_0x3b006a[_0x7c5c('0x37')]);return analyticDefaultReportController['runReport']({'id':_0x3b006a[_0x7c5c('0x37')]},_0x23cc29)[_0x7c5c('0x39')](handleResult(_0x3b006a))[_0x7c5c('0x3a')](handleError());}if(!_[_0x7c5c('0x30')](_0x3b006a[_0x7c5c('0x3b')])){logger[_0x7c5c('0xa')](_0x7c5c('0x3c'),_0x3b006a['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x3b006a['CustomReportId']},_0x23cc29)['then'](handleResult(_0x3b006a))[_0x7c5c('0x3a')](handleError());}}catch(_0x4bbc9c){logger[_0x7c5c('0x2c')](JSON[_0x7c5c('0x25')](_0x4bbc9c));}return logger[_0x7c5c('0xa')](_0x7c5c('0x3d'));};}function getJobs(_0x173aa3){var _0x564c59={};if(_0x173aa3){_0x564c59['id']=_0x173aa3;}return db[_0x7c5c('0x3e')]['findAll']({'where':_0x564c59,'include':[{'model':db[_0x7c5c('0xc')],'attributes':['id',_0x7c5c('0x1a'),_0x7c5c('0x17')],'include':[{'model':db[_0x7c5c('0x3f')],'as':_0x7c5c('0xd')}]}]})['then'](function(_0x2e1339){var _0x42ccce=_[_0x7c5c('0x40')](manager['jobs']);var _0x1e9e91=_[_0x7c5c('0x41')](_0x2e1339,function(_0x1596f3){return _0x1596f3['id'][_0x7c5c('0x42')]();});var _0x4e198d=_['keyBy'](_0x2e1339,function(_0x3de966){return _0x3de966['id'][_0x7c5c('0x42')]();});var _0x40309c=_0x173aa3?_0x1e9e91:_[_0x7c5c('0x43')](_0x1e9e91,_0x42ccce);var _0x14a52a=_[_0x7c5c('0x44')](_0x1e9e91,_0x42ccce);var _0x29df26=_[_0x7c5c('0x43')](_0x42ccce,_0x1e9e91);var _0x34eee3;var _0x476f3e;for(_0x34eee3=0x0;_0x34eee3<_0x29df26['length']&&!_0x173aa3;_0x34eee3+=0x1){_0x476f3e=_0x29df26[_0x34eee3][_0x7c5c('0x42')]();if(manager[_0x7c5c('0x45')](_0x476f3e)){manager[_0x7c5c('0x46')](_0x476f3e);manager[_0x7c5c('0x47')](_0x476f3e);logger[_0x7c5c('0xa')](_0x7c5c('0x48'),_0x476f3e);}}logger[_0x7c5c('0xa')](_0x7c5c('0x49'),JSON[_0x7c5c('0x25')](_0x40309c));for(_0x34eee3=0x0;_0x34eee3<_0x40309c['length'];_0x34eee3+=0x1){_0x476f3e=_0x40309c[_0x34eee3][_0x7c5c('0x42')]();logger[_0x7c5c('0xa')](_0x7c5c('0x4a'),_0x476f3e);if(_0x173aa3){logger['info'](_0x7c5c('0x4b'),_0x173aa3);logger['info'](JSON[_0x7c5c('0x25')](_0x4e198d[_0x476f3e]));BPromise[_0x7c5c('0x4c')]()[_0x7c5c('0x39')](handleJob(_0x4e198d[_0x476f3e]));logger[_0x7c5c('0xa')](_0x7c5c('0x4d'),_0x4e198d[_0x476f3e][_0x7c5c('0x1a')],_0x4e198d[_0x476f3e][_0x7c5c('0x4e')]);}else if(_0x4e198d[_0x476f3e][_0x7c5c('0x4e')]&&_0x4e198d[_0x476f3e][_0x7c5c('0x4f')]&&moment()[_0x7c5c('0x50')](_0x4e198d[_0x476f3e][_0x7c5c('0x51')],_0x4e198d[_0x476f3e][_0x7c5c('0x52')])){manager[_0x7c5c('0x53')](_0x476f3e,_0x4e198d[_0x476f3e]['cron'],handleJob(_0x4e198d[_0x476f3e]));manager['start'](_0x476f3e);logger[_0x7c5c('0xa')]('add\x20cron',_0x4e198d[_0x476f3e][_0x7c5c('0x1a')],_0x4e198d[_0x476f3e][_0x7c5c('0x4e')]);}else if(manager[_0x7c5c('0x45')](_0x476f3e)){manager['stop'](_0x476f3e);manager['deleteJob'](_0x476f3e);logger[_0x7c5c('0xa')](_0x7c5c('0x54'),_0x4e198d[_0x476f3e][_0x7c5c('0x1a')],_0x4e198d[_0x476f3e][_0x7c5c('0x4e')]);}}for(_0x34eee3=0x0,_0x476f3e;_0x34eee3<_0x14a52a['length']&&!_0x173aa3;_0x34eee3+=0x1){_0x476f3e=_0x14a52a[_0x34eee3][_0x7c5c('0x42')]();if(manager[_0x7c5c('0x45')](_0x476f3e)){if(_0x4e198d[_0x476f3e][_0x7c5c('0x4e')]&&_0x4e198d[_0x476f3e]['active']&&moment()['isBetween'](_0x4e198d[_0x476f3e][_0x7c5c('0x51')],_0x4e198d[_0x476f3e][_0x7c5c('0x52')])){manager[_0x7c5c('0x55')](_0x476f3e,_0x4e198d[_0x476f3e][_0x7c5c('0x4e')],handleJob(_0x4e198d[_0x476f3e]));logger['info']('update\x20cron',_0x4e198d[_0x476f3e]['name'],_0x4e198d[_0x476f3e][_0x7c5c('0x4e')]);}else{manager[_0x7c5c('0x46')](_0x476f3e);manager[_0x7c5c('0x47')](_0x476f3e);logger['info']('stop\x20cron',_0x4e198d[_0x476f3e][_0x7c5c('0x1a')],_0x4e198d[_0x476f3e][_0x7c5c('0x4e')]);}}}})[_0x7c5c('0x3a')](function(_0x3aee03){logger[_0x7c5c('0x2c')](JSON['stringify'](_0x3aee03));});}exports['run']=function(_0x1fbbde){return getJobs(_0x1fbbde);};exports[_0x7c5c('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index e7068b3..a02f523 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 _0x9a1f=['error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','start','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','info','format','data2','transcribeRegion','transcribeName','then','TranscriptionJob','fileText','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','CloudProvider','COMPLETED','catch','name','SequelizeValidationError'];(function(_0x5b18c4,_0x491f56){var _0x3bc7f1=function(_0x159352){while(--_0x159352){_0x5b18c4['push'](_0x5b18c4['shift']());}};_0x3bc7f1(++_0x491f56);}(_0x9a1f,0x1b6));var _0xf9a1=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x9a1f[_0x5037ab];return _0x512adb;};var _=require('lodash');var AWS=require(_0xf9a1('0x0'));var rp=require(_0xf9a1('0x1'));var util=require(_0xf9a1('0x2'));var BPromise=require(_0xf9a1('0x3'));var db=require(_0xf9a1('0x4'))['db'];var logger=require(_0xf9a1('0x5'))(_0xf9a1('0x6'));function getTranscriptionJob(_0x1c791a,_0x5d1164,_0x4afde7,_0x2a9bc4){return new Promise(function(_0x415c0d,_0x1c27d6){var _0x1633f=new AWS[(_0xf9a1('0x7'))]({'accessKeyId':_0x5d1164,'secretAccessKey':_0x1c791a,'region':_0x4afde7});_0x1633f[_0xf9a1('0x8')]({'TranscriptionJobName':_0x2a9bc4},function(_0x490e76,_0x3ff964){if(_0x490e76){return _0x1c27d6(_0x490e76);}else{return _0x415c0d(_0x3ff964);}});});}function sentiment(_0x5a388b,_0xec40a1,_0x5efc11,_0x562d69,_0x23c4e7){return new Promise(function(_0x36b476,_0x2a170b){var _0x9ee9fc=new AWS['Comprehend']({'accessKeyId':_0xec40a1,'secretAccessKey':_0x5a388b,'region':_0x5efc11});_0x9ee9fc[_0xf9a1('0x9')]({'Text':_0x562d69,'LanguageCode':_0x23c4e7['substring'](0x0,0x2)},function(_0x2ca865,_0x2ba332){if(_0x2ca865){return _0x2a170b(_0x2ca865);}else{return _0x36b476(_0x2ba332);}});});}function checkTranscribeJob(_0x1cda35,_0x23f679,_0x4ca0cf){var _0x45fabe;return new BPromise(function(_0xb7ebd6,_0x276554){logger[_0xf9a1('0xa')](util[_0xf9a1('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x1cda35['id'],_0x1cda35['transcribeName']));return getTranscriptionJob(_0x4ca0cf['data1'],_0x4ca0cf[_0xf9a1('0xc')],_0x23f679[_0xf9a1('0xd')],_0x1cda35[_0xf9a1('0xe')])[_0xf9a1('0xf')](function(_0x8c8c14){logger[_0xf9a1('0xa')](util[_0xf9a1('0xb')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x1cda35['id'],_0x1cda35[_0xf9a1('0xe')],_0x8c8c14[_0xf9a1('0x10')]['TranscriptionJobStatus']));if(!_0x1cda35[_0xf9a1('0x11')]){switch(_0x8c8c14[_0xf9a1('0x10')][_0xf9a1('0x12')]){case'COMPLETED':var _0x19819b={'transcribeStatus':_0x8c8c14['TranscriptionJob'][_0xf9a1('0x12')],'fileUri':_0x8c8c14[_0xf9a1('0x10')][_0xf9a1('0x13')][_0xf9a1('0x14')]};logger['info'](util[_0xf9a1('0xb')](_0xf9a1('0x15'),_0x1cda35['id']));return rp({'uri':_0x8c8c14[_0xf9a1('0x10')][_0xf9a1('0x13')][_0xf9a1('0x14')],'json':!![]})['then'](function(_0x21b227){logger[_0xf9a1('0xa')](util[_0xf9a1('0xb')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x1cda35['id']));if(_0x21b227&&_0x21b227[_0xf9a1('0x16')]&&_0x21b227['results'][_0xf9a1('0x17')]&&_0x21b227[_0xf9a1('0x16')][_0xf9a1('0x17')][_0xf9a1('0x18')]){_0x19819b['fileText']='';for(var _0x213318=0x0;_0x213318<_0x21b227['results'][_0xf9a1('0x17')][_0xf9a1('0x18')];_0x213318++){_0x19819b[_0xf9a1('0x11')]+=_0x21b227[_0xf9a1('0x16')][_0xf9a1('0x17')][_0x213318][_0xf9a1('0x19')]+'';}}return _0x1cda35[_0xf9a1('0x1a')](_0x19819b);})['then'](function(){logger[_0xf9a1('0xa')](util['format'](_0xf9a1('0x1b'),_0x1cda35['id']));if(!_0x1cda35[_0xf9a1('0x1c')]){throw new db[(_0xf9a1('0x1d'))][(_0xf9a1('0x1e'))](_0xf9a1('0x1f'));}if(!_0x23f679[_0xf9a1('0x20')]||!_0x23f679[_0xf9a1('0x21')]||!_0x23f679[_0xf9a1('0x22')]||!_0x23f679[_0xf9a1('0x23')]||!_0x23f679[_0xf9a1('0x24')]){throw new db[(_0xf9a1('0x1d'))][(_0xf9a1('0x1e'))](_0xf9a1('0x25'));}if(!_0x19819b[_0xf9a1('0x11')]){throw new Error(_0xf9a1('0x26'));}if(_0x23f679[_0xf9a1('0x21')]===_0x4ca0cf['id']){return _0x4ca0cf;}else{return db['CloudProvider'][_0xf9a1('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xf9a1('0xf')](function(_0xec85cc){if(!_0xec85cc){throw new db[(_0xf9a1('0x1d'))]['ValidationError'](_0xf9a1('0x28'));}if(!_0xec85cc[_0xf9a1('0x29')]||!_0xec85cc['data2']){throw new db['Sequelize'][(_0xf9a1('0x1e'))](_0xf9a1('0x2a'));}_0x45fabe=_0xec85cc;logger[_0xf9a1('0xa')](util[_0xf9a1('0xb')](_0xf9a1('0x2b'),_0x1cda35['id']));return sentiment(_0x45fabe[_0xf9a1('0x29')],_0x45fabe[_0xf9a1('0xc')],_0x23f679[_0xf9a1('0x22')],_0x19819b[_0xf9a1('0x11')],_0x23f679[_0xf9a1('0x23')]);})[_0xf9a1('0xf')](function(_0x337922){logger[_0xf9a1('0xa')](util[_0xf9a1('0xb')](_0xf9a1('0x2c'),_0x1cda35['id']));return _0x1cda35[_0xf9a1('0x1a')]({'sentiment':_0x337922[_0xf9a1('0x2d')],'sPositive':_0x337922[_0xf9a1('0x2e')][_0xf9a1('0x2f')],'sNegative':_0x337922[_0xf9a1('0x2e')][_0xf9a1('0x30')],'sMixed':_0x337922[_0xf9a1('0x2e')][_0xf9a1('0x31')],'sNeutral':_0x337922[_0xf9a1('0x2e')][_0xf9a1('0x32')]});})['then'](function(){logger[_0xf9a1('0xa')](util[_0xf9a1('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1cda35['id']));_0xb7ebd6();});case _0xf9a1('0x33'):return _0x1cda35[_0xf9a1('0x1a')]({'transcribeStatus':_0xf9a1('0x33'),'failureReason':_0x8c8c14[_0xf9a1('0x10')]['FailureReason']})[_0xf9a1('0xf')](function(){logger[_0xf9a1('0xa')](util['format'](_0xf9a1('0x1b'),_0x1cda35['id']));_0xb7ebd6();});default:logger[_0xf9a1('0xa')](util[_0xf9a1('0xb')](_0xf9a1('0x34'),_0x1cda35['id']));break;}}else{return BPromise[_0xf9a1('0x35')]()[_0xf9a1('0xf')](function(){if(!_0x1cda35[_0xf9a1('0x1c')]){throw new db[(_0xf9a1('0x1d'))][(_0xf9a1('0x1e'))](_0xf9a1('0x1f'));}if(!_0x23f679[_0xf9a1('0x20')]||!_0x23f679[_0xf9a1('0x21')]||!_0x23f679[_0xf9a1('0x22')]||!_0x23f679['language']||!_0x23f679[_0xf9a1('0x24')]){throw new db[(_0xf9a1('0x1d'))][(_0xf9a1('0x1e'))](_0xf9a1('0x25'));}if(!_0x1cda35[_0xf9a1('0x11')]){throw new Error(_0xf9a1('0x26'));}if(_0x23f679[_0xf9a1('0x21')]===_0x4ca0cf['id']){return _0x4ca0cf;}else{return db[_0xf9a1('0x36')]['findOne']({'where':{'id':_settings[_0xf9a1('0x21')]}});}})[_0xf9a1('0xf')](function(_0x4e639d){if(!_0x4e639d){throw new db[(_0xf9a1('0x1d'))][(_0xf9a1('0x1e'))](_0xf9a1('0x28'));}if(!_0x4e639d['data1']||!_0x4e639d[_0xf9a1('0xc')]){throw new db['Sequelize'][(_0xf9a1('0x1e'))](_0xf9a1('0x2a'));}_0x45fabe=_0x4e639d;logger[_0xf9a1('0xa')](util[_0xf9a1('0xb')](_0xf9a1('0x2b'),_0x1cda35['id']));return sentiment(_0x45fabe[_0xf9a1('0x29')],_0x45fabe[_0xf9a1('0xc')],_0x23f679[_0xf9a1('0x22')],_0x1cda35[_0xf9a1('0x11')],_0x23f679[_0xf9a1('0x23')]);})['then'](function(_0x331359){logger[_0xf9a1('0xa')](util[_0xf9a1('0xb')](_0xf9a1('0x2c'),_0x1cda35['id']));return _0x1cda35[_0xf9a1('0x1a')]({'sentiment':_0x331359['Sentiment'],'sPositive':_0x331359[_0xf9a1('0x2e')][_0xf9a1('0x2f')],'sNegative':_0x331359[_0xf9a1('0x2e')][_0xf9a1('0x30')],'sMixed':_0x331359[_0xf9a1('0x2e')][_0xf9a1('0x31')],'sNeutral':_0x331359[_0xf9a1('0x2e')][_0xf9a1('0x32')],'transcribeStatus':_0xf9a1('0x37')});})['then'](function(){logger[_0xf9a1('0xa')](util['format'](_0xf9a1('0x1b'),_0x1cda35['id']));_0xb7ebd6();});}})[_0xf9a1('0x38')](function(_0x24b4fa){if(_0x24b4fa){if(!_0x24b4fa[_0xf9a1('0x39')]||_0x24b4fa[_0xf9a1('0x39')]!==_0xf9a1('0x3a')){logger[_0xf9a1('0x3b')](util[_0xf9a1('0xb')](_0xf9a1('0x3c'),_0x1cda35['id']),util[_0xf9a1('0x3d')](_0x24b4fa,{'showHidden':![],'depth':null}));}}_0xb7ebd6();});});}function checkTranscribe(){var _0x225f62;var _0x4cfcc0;var _0x540a26;return db[_0xf9a1('0x3e')][_0xf9a1('0x3f')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x4e4957){if(!_0x4e4957||!_0x4e4957['length']){throw new db[(_0xf9a1('0x1d'))][(_0xf9a1('0x1e'))]('No\x20transcribe\x20job\x20to\x20check');}_0x225f62=_0x4e4957;return db[_0xf9a1('0x40')][_0xf9a1('0x27')]({'where':{'id':0x1}});})[_0xf9a1('0xf')](function(_0x994c19){if(!_0x994c19){throw new db[(_0xf9a1('0x1d'))][(_0xf9a1('0x1e'))](_0xf9a1('0x41'));}_0x4cfcc0=_0x994c19;if(!_0x4cfcc0['transcribe']||!_0x4cfcc0[_0xf9a1('0x42')]||!_0x4cfcc0[_0xf9a1('0xd')]||!_0x4cfcc0['language']||!_0x4cfcc0['bucket']){throw new db[(_0xf9a1('0x1d'))][(_0xf9a1('0x1e'))](_0xf9a1('0x43'));}return db[_0xf9a1('0x36')][_0xf9a1('0x27')]({'where':{'id':_0x4cfcc0[_0xf9a1('0x42')]}});})[_0xf9a1('0xf')](function(_0x39b62e){if(!_0x39b62e){throw new db['Sequelize'][(_0xf9a1('0x1e'))](_0xf9a1('0x28'));}if(!_0x39b62e[_0xf9a1('0x29')]||!_0x39b62e['data2']){throw new db[(_0xf9a1('0x1d'))][(_0xf9a1('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x540a26=_0x39b62e;var _0x3172d1=[];_0x225f62['forEach'](function(_0x1a7483){_0x3172d1[_0xf9a1('0x44')](checkTranscribeJob(_0x1a7483,_0x4cfcc0,_0x540a26));});return BPromise[_0xf9a1('0x45')](_0x3172d1);})[_0xf9a1('0x38')](function(_0x132bb9){if(_0x132bb9){if(!_0x132bb9[_0xf9a1('0x39')]||_0x132bb9[_0xf9a1('0x39')]!==_0xf9a1('0x3a')){logger[_0xf9a1('0x3b')](util['inspect'](_0x132bb9,{'showHidden':![],'depth':null}));}}});}exports[_0xf9a1('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x2d20=['../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','transcribeName','then','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','length','transcripts','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','FAILED','FailureReason','findOne','Sentiment','Negative','Mixed','Neutral','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb'];(function(_0x36fc72,_0x1843c7){var _0x1a85c7=function(_0x1bdcd4){while(--_0x1bdcd4){_0x36fc72['push'](_0x36fc72['shift']());}};_0x1a85c7(++_0x1843c7);}(_0x2d20,0x1b0));var _0x02d2=function(_0x31711a,_0x10590e){_0x31711a=_0x31711a-0x0;var _0x3b407f=_0x2d20[_0x31711a];return _0x3b407f;};var _=require(_0x02d2('0x0'));var AWS=require(_0x02d2('0x1'));var rp=require(_0x02d2('0x2'));var util=require(_0x02d2('0x3'));var BPromise=require(_0x02d2('0x4'));var db=require(_0x02d2('0x5'))['db'];var logger=require(_0x02d2('0x6'))(_0x02d2('0x7'));function getTranscriptionJob(_0x4bb98b,_0xa307cb,_0x5e9eae,_0x49fd61){return new Promise(function(_0x4a83eb,_0x1b34e3){var _0x3564f0=new AWS[(_0x02d2('0x8'))]({'accessKeyId':_0xa307cb,'secretAccessKey':_0x4bb98b,'region':_0x5e9eae});_0x3564f0[_0x02d2('0x9')]({'TranscriptionJobName':_0x49fd61},function(_0x35ba13,_0x4c2619){if(_0x35ba13){return _0x1b34e3(_0x35ba13);}else{return _0x4a83eb(_0x4c2619);}});});}function sentiment(_0x137f6e,_0x2814ed,_0x5a280c,_0x30ff27,_0x4e8c86){return new Promise(function(_0x24dc1b,_0x5b3ad2){var _0x254e65=new AWS['Comprehend']({'accessKeyId':_0x2814ed,'secretAccessKey':_0x137f6e,'region':_0x5a280c});_0x254e65[_0x02d2('0xa')]({'Text':_0x30ff27,'LanguageCode':_0x4e8c86[_0x02d2('0xb')](0x0,0x2)},function(_0x2d16c9,_0x52b9a4){if(_0x2d16c9){return _0x5b3ad2(_0x2d16c9);}else{return _0x24dc1b(_0x52b9a4);}});});}function checkTranscribeJob(_0x42a3b7,_0x22e4ca,_0x4f3863){var _0x123fb1;return new BPromise(function(_0x40fecf,_0x1d174b){logger[_0x02d2('0xc')](util[_0x02d2('0xd')](_0x02d2('0xe'),_0x42a3b7['id'],_0x42a3b7['transcribeName']));return getTranscriptionJob(_0x4f3863[_0x02d2('0xf')],_0x4f3863[_0x02d2('0x10')],_0x22e4ca[_0x02d2('0x11')],_0x42a3b7[_0x02d2('0x12')])[_0x02d2('0x13')](function(_0x59c613){logger['info'](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x42a3b7['id'],_0x42a3b7[_0x02d2('0x12')],_0x59c613[_0x02d2('0x14')]['TranscriptionJobStatus']));if(!_0x42a3b7[_0x02d2('0x15')]){switch(_0x59c613[_0x02d2('0x14')][_0x02d2('0x16')]){case _0x02d2('0x17'):var _0x4a7fdc={'transcribeStatus':_0x59c613[_0x02d2('0x14')]['TranscriptionJobStatus'],'fileUri':_0x59c613[_0x02d2('0x14')][_0x02d2('0x18')][_0x02d2('0x19')]};logger[_0x02d2('0xc')](util[_0x02d2('0xd')](_0x02d2('0x1a'),_0x42a3b7['id']));return rp({'uri':_0x59c613[_0x02d2('0x14')]['Transcript']['TranscriptFileUri'],'json':!![]})[_0x02d2('0x13')](function(_0x22a255){logger[_0x02d2('0xc')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x42a3b7['id']));if(_0x22a255&&_0x22a255[_0x02d2('0x1b')]&&_0x22a255[_0x02d2('0x1b')]['transcripts']&&_0x22a255[_0x02d2('0x1b')]['transcripts'][_0x02d2('0x1c')]){_0x4a7fdc[_0x02d2('0x15')]='';for(var _0x52f84a=0x0;_0x52f84a<_0x22a255[_0x02d2('0x1b')][_0x02d2('0x1d')]['length'];_0x52f84a++){_0x4a7fdc[_0x02d2('0x15')]+=_0x22a255[_0x02d2('0x1b')][_0x02d2('0x1d')][_0x52f84a]['transcript']+'';}}return _0x42a3b7[_0x02d2('0x1e')](_0x4a7fdc);})[_0x02d2('0x13')](function(){logger[_0x02d2('0xc')](util[_0x02d2('0xd')](_0x02d2('0x1f'),_0x42a3b7['id']));if(!_0x42a3b7[_0x02d2('0x20')]){throw new db[(_0x02d2('0x21'))][(_0x02d2('0x22'))](_0x02d2('0x23'));}if(!_0x22e4ca[_0x02d2('0x24')]||!_0x22e4ca[_0x02d2('0x25')]||!_0x22e4ca[_0x02d2('0x26')]||!_0x22e4ca[_0x02d2('0x27')]||!_0x22e4ca[_0x02d2('0x28')]){throw new db[(_0x02d2('0x21'))]['ValidationError'](_0x02d2('0x29'));}if(!_0x4a7fdc[_0x02d2('0x15')]){throw new Error(_0x02d2('0x2a'));}if(_0x22e4ca[_0x02d2('0x25')]===_0x4f3863['id']){return _0x4f3863;}else{return db[_0x02d2('0x2b')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1bf504){if(!_0x1bf504){throw new db[(_0x02d2('0x21'))]['ValidationError'](_0x02d2('0x2c'));}if(!_0x1bf504[_0x02d2('0xf')]||!_0x1bf504[_0x02d2('0x10')]){throw new db[(_0x02d2('0x21'))]['ValidationError'](_0x02d2('0x2d'));}_0x123fb1=_0x1bf504;logger[_0x02d2('0xc')](util[_0x02d2('0xd')](_0x02d2('0x2e'),_0x42a3b7['id']));return sentiment(_0x123fb1[_0x02d2('0xf')],_0x123fb1[_0x02d2('0x10')],_0x22e4ca[_0x02d2('0x26')],_0x4a7fdc[_0x02d2('0x15')],_0x22e4ca[_0x02d2('0x27')]);})[_0x02d2('0x13')](function(_0x512f82){logger[_0x02d2('0xc')](util['format'](_0x02d2('0x2f'),_0x42a3b7['id']));return _0x42a3b7[_0x02d2('0x1e')]({'sentiment':_0x512f82['Sentiment'],'sPositive':_0x512f82[_0x02d2('0x30')][_0x02d2('0x31')],'sNegative':_0x512f82[_0x02d2('0x30')]['Negative'],'sMixed':_0x512f82['SentimentScore']['Mixed'],'sNeutral':_0x512f82['SentimentScore']['Neutral']});})[_0x02d2('0x13')](function(){logger[_0x02d2('0xc')](util[_0x02d2('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x42a3b7['id']));_0x40fecf();});case _0x02d2('0x32'):return _0x42a3b7[_0x02d2('0x1e')]({'transcribeStatus':'FAILED','failureReason':_0x59c613[_0x02d2('0x14')][_0x02d2('0x33')]})[_0x02d2('0x13')](function(){logger[_0x02d2('0xc')](util[_0x02d2('0xd')](_0x02d2('0x1f'),_0x42a3b7['id']));_0x40fecf();});default:logger[_0x02d2('0xc')](util[_0x02d2('0xd')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x42a3b7['id']));break;}}else{return BPromise['resolve']()[_0x02d2('0x13')](function(){if(!_0x42a3b7['tempSentiment']){throw new db['Sequelize'][(_0x02d2('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x22e4ca[_0x02d2('0x24')]||!_0x22e4ca[_0x02d2('0x25')]||!_0x22e4ca[_0x02d2('0x26')]||!_0x22e4ca['language']||!_0x22e4ca['bucket']){throw new db[(_0x02d2('0x21'))][(_0x02d2('0x22'))](_0x02d2('0x29'));}if(!_0x42a3b7[_0x02d2('0x15')]){throw new Error(_0x02d2('0x2a'));}if(_0x22e4ca[_0x02d2('0x25')]===_0x4f3863['id']){return _0x4f3863;}else{return db[_0x02d2('0x2b')][_0x02d2('0x34')]({'where':{'id':_settings[_0x02d2('0x25')]}});}})['then'](function(_0x591479){if(!_0x591479){throw new db[(_0x02d2('0x21'))]['ValidationError'](_0x02d2('0x2c'));}if(!_0x591479[_0x02d2('0xf')]||!_0x591479[_0x02d2('0x10')]){throw new db[(_0x02d2('0x21'))][(_0x02d2('0x22'))](_0x02d2('0x2d'));}_0x123fb1=_0x591479;logger[_0x02d2('0xc')](util[_0x02d2('0xd')](_0x02d2('0x2e'),_0x42a3b7['id']));return sentiment(_0x123fb1[_0x02d2('0xf')],_0x123fb1[_0x02d2('0x10')],_0x22e4ca[_0x02d2('0x26')],_0x42a3b7['fileText'],_0x22e4ca[_0x02d2('0x27')]);})[_0x02d2('0x13')](function(_0x46450d){logger[_0x02d2('0xc')](util['format'](_0x02d2('0x2f'),_0x42a3b7['id']));return _0x42a3b7[_0x02d2('0x1e')]({'sentiment':_0x46450d[_0x02d2('0x35')],'sPositive':_0x46450d['SentimentScore']['Positive'],'sNegative':_0x46450d[_0x02d2('0x30')][_0x02d2('0x36')],'sMixed':_0x46450d[_0x02d2('0x30')][_0x02d2('0x37')],'sNeutral':_0x46450d[_0x02d2('0x30')][_0x02d2('0x38')],'transcribeStatus':_0x02d2('0x17')});})[_0x02d2('0x13')](function(){logger[_0x02d2('0xc')](util[_0x02d2('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x42a3b7['id']));_0x40fecf();});}})[_0x02d2('0x39')](function(_0x126927){if(_0x126927){if(!_0x126927[_0x02d2('0x3a')]||_0x126927[_0x02d2('0x3a')]!==_0x02d2('0x3b')){logger[_0x02d2('0x3c')](util[_0x02d2('0xd')](_0x02d2('0x3d'),_0x42a3b7['id']),util[_0x02d2('0x3e')](_0x126927,{'showHidden':![],'depth':null}));}}_0x40fecf();});});}function checkTranscribe(){var _0x3ec14f;var _0x85beab;var _0x3d6792;return db[_0x02d2('0x3f')][_0x02d2('0x40')]({'where':{'transcribeStatus':_0x02d2('0x41')}})['then'](function(_0x18d161){if(!_0x18d161||!_0x18d161[_0x02d2('0x1c')]){throw new db[(_0x02d2('0x21'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x3ec14f=_0x18d161;return db[_0x02d2('0x42')][_0x02d2('0x34')]({'where':{'id':0x1}});})[_0x02d2('0x13')](function(_0x33f2dc){if(!_0x33f2dc){throw new db[(_0x02d2('0x21'))][(_0x02d2('0x22'))](_0x02d2('0x43'));}_0x85beab=_0x33f2dc;if(!_0x85beab[_0x02d2('0x7')]||!_0x85beab[_0x02d2('0x44')]||!_0x85beab[_0x02d2('0x11')]||!_0x85beab[_0x02d2('0x27')]||!_0x85beab[_0x02d2('0x28')]){throw new db[(_0x02d2('0x21'))]['ValidationError'](_0x02d2('0x45'));}return db[_0x02d2('0x2b')][_0x02d2('0x34')]({'where':{'id':_0x85beab[_0x02d2('0x44')]}});})[_0x02d2('0x13')](function(_0xeb4b1){if(!_0xeb4b1){throw new db[(_0x02d2('0x21'))][(_0x02d2('0x22'))](_0x02d2('0x2c'));}if(!_0xeb4b1[_0x02d2('0xf')]||!_0xeb4b1[_0x02d2('0x10')]){throw new db[(_0x02d2('0x21'))][(_0x02d2('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x3d6792=_0xeb4b1;var _0x5184b3=[];_0x3ec14f[_0x02d2('0x46')](function(_0x15e63d){_0x5184b3['push'](checkTranscribeJob(_0x15e63d,_0x85beab,_0x3d6792));});return BPromise[_0x02d2('0x47')](_0x5184b3);})[_0x02d2('0x39')](function(_0x16bc1a){if(_0x16bc1a){if(!_0x16bc1a[_0x02d2('0x3a')]||_0x16bc1a['name']!==_0x02d2('0x3b')){logger[_0x02d2('0x3c')](util[_0x02d2('0x3e')](_0x16bc1a,{'showHidden':![],'depth':null}));}}});}exports[_0x02d2('0x48')]=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 07c0aa3..9c29cd3 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 _0x2734=['findAll','lastMsgAt','subtract','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction'];(function(_0x581d4d,_0x10f2ba){var _0x4d6925=function(_0x32b228){while(--_0x32b228){_0x581d4d['push'](_0x581d4d['shift']());}};_0x4d6925(++_0x10f2ba);}(_0x2734,0x15f));var _0x4273=function(_0x24b8f7,_0x597908){_0x24b8f7=_0x24b8f7-0x0;var _0x26a7db=_0x2734[_0x24b8f7];return _0x26a7db;};'use strict';var _=require(_0x4273('0x0'));var moment=require(_0x4273('0x1'));var Redis=require('ioredis');var util=require(_0x4273('0x2'));var config=require(_0x4273('0x3'));var db=require(_0x4273('0x4'))['db'];var logger=require(_0x4273('0x5'))(_0x4273('0x6'));config['redis']=_[_0x4273('0x7')](config[_0x4273('0x8')],{'host':_0x4273('0x9'),'port':0x18eb});var io=require(_0x4273('0xa'))(new Redis(config[_0x4273('0x8')]));function closeInteractions(){var _0x5b0ed7=[];return db[_0x4273('0xb')][_0x4273('0xc')]({'raw':!![],'attributes':['id',_0x4273('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4273('0xe')](0x18,_0x4273('0xf'))}}})[_0x4273('0x10')](function(_0x4d247a){if(_0x4d247a&&_0x4d247a[_0x4273('0x11')]){_0x5b0ed7=_[_0x4273('0x12')](_0x4d247a||[],'id');logger['info'](_0x4273('0x13'),_0x5b0ed7[_0x4273('0x14')]());return db['WhatsappInteraction'][_0x4273('0x15')]({'closeReason':_0x4273('0x16'),'disposition':_0x4273('0x17'),'closed':!![],'closedAt':moment()[_0x4273('0x18')](_0x4273('0x19'))},{'where':{'id':_0x5b0ed7}});}})[_0x4273('0x10')](function(){if(_0x5b0ed7&&_0x5b0ed7[_0x4273('0x11')]){logger[_0x4273('0x1a')](_0x4273('0x1b'),_0x5b0ed7['join']());for(var _0x54564e=0x0;_0x54564e<_0x5b0ed7[_0x4273('0x11')];_0x54564e++){io[_0x4273('0x1c')]('whatsappInteraction:update',{'id':_0x5b0ed7[_0x54564e],'closed':!![]});}}})[_0x4273('0x1d')](function(_0x40ca6a){logger[_0x4273('0x1e')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x40ca6a?util[_0x4273('0x1f')](_0x40ca6a,{'showHidden':![],'depth':null}):'');});}exports[_0x4273('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x555f=['inspect','start','lodash','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x555f,0xf2));var _0xf555=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0x555f[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require(_0xf555('0x0'));var moment=require('moment');var Redis=require(_0xf555('0x1'));var util=require('util');var config=require(_0xf555('0x2'));var db=require(_0xf555('0x3'))['db'];var logger=require(_0xf555('0x4'))(_0xf555('0x5'));config[_0xf555('0x6')]=_[_0xf555('0x7')](config[_0xf555('0x6')],{'host':_0xf555('0x8'),'port':0x18eb});var io=require(_0xf555('0x9'))(new Redis(config[_0xf555('0x6')]));function closeInteractions(){var _0x47f451=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xf555('0xa')](0x18,_0xf555('0xb'))}}})[_0xf555('0xc')](function(_0x55a88f){if(_0x55a88f&&_0x55a88f[_0xf555('0xd')]){_0x47f451=_[_0xf555('0xe')](_0x55a88f||[],'id');logger[_0xf555('0xf')](_0xf555('0x10'),_0x47f451[_0xf555('0x11')]());return db[_0xf555('0x12')][_0xf555('0x13')]({'closeReason':_0xf555('0x14'),'disposition':_0xf555('0x15'),'closed':!![],'closedAt':moment()[_0xf555('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x47f451}});}})[_0xf555('0xc')](function(){if(_0x47f451&&_0x47f451[_0xf555('0xd')]){logger[_0xf555('0xf')](_0xf555('0x17'),_0x47f451[_0xf555('0x11')]());for(var _0x4e3e3b=0x0;_0x4e3e3b<_0x47f451[_0xf555('0xd')];_0x4e3e3b++){io['emit'](_0xf555('0x18'),{'id':_0x47f451[_0x4e3e3b],'closed':!![]});}}})[_0xf555('0x19')](function(_0x1b68d4){logger[_0xf555('0x1a')](_0xf555('0x1b'),_0x1b68d4?util[_0xf555('0x1c')](_0x1b68d4,{'showHidden':![],'depth':null}):'');});}exports[_0xf555('0x1d')]=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 082c7b8..3ac0258 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3dee=['contacts2','hopper2','catch','util','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','destroy','CmContact','bulkCreate','then','log','finished\x20populating','CmHopper'];(function(_0x24549b,_0x5e2f92){var _0x352b98=function(_0x4b2dd6){while(--_0x4b2dd6){_0x24549b['push'](_0x24549b['shift']());}};_0x352b98(++_0x5e2f92);}(_0x3dee,0x1ac));var _0xe3de=function(_0x195cc9,_0x57d2ec){_0x195cc9=_0x195cc9-0x0;var _0x45157c=_0x3dee[_0x195cc9];return _0x45157c;};'use strict';var util=require(_0xe3de('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xe3de('0x1')+i,'lastName':_0xe3de('0x2')+i,'phone':0xf879fb460+i,'email':_0xe3de('0x3')+i+_0xe3de('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe3de('0x5')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe3de('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe3de('0x5')]({'id':i,'firstName':_0xe3de('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xe3de('0x3')+i+_0xe3de('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe3de('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xe3de('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe3de('0x6')](),'updatedAt':Date['now']()});}db['CmContact'][_0xe3de('0x7')]({'where':{}})['then'](function(){return db[_0xe3de('0x8')][_0xe3de('0x9')](contacts);})[_0xe3de('0xa')](function(){console[_0xe3de('0xb')](_0xe3de('0xc'),'contacts1');return db[_0xe3de('0xd')]['destroy']({'where':{}});})[_0xe3de('0xa')](function(){return db[_0xe3de('0xd')][_0xe3de('0x9')](hopper);})[_0xe3de('0xa')](function(){console['log']('finished\x20populating','hopper1');return db['CmContact'][_0xe3de('0x9')](contacts2);})[_0xe3de('0xa')](function(){console[_0xe3de('0xb')]('finished\x20populating',_0xe3de('0xe'));return db['CmHopper'][_0xe3de('0x9')](hopper2);})[_0xe3de('0xa')](function(){console['log'](_0xe3de('0xc'),_0xe3de('0xf'));})[_0xe3de('0x10')](function(_0x12b49d){console[_0xe3de('0xb')](_0x12b49d);}); \ No newline at end of file +var _0xf0fb=['util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','contacts2','hopper2','catch'];(function(_0x409fb8,_0x5ab3d3){var _0x278270=function(_0x58849c){while(--_0x58849c){_0x409fb8['push'](_0x409fb8['shift']());}};_0x278270(++_0x5ab3d3);}(_0xf0fb,0xbe));var _0xbf0f=function(_0x4e4e83,_0x2f29a7){_0x4e4e83=_0x4e4e83-0x0;var _0x4cbeb6=_0xf0fb[_0x4e4e83];return _0x4cbeb6;};'use strict';var util=require(_0xbf0f('0x0'));var db=require(_0xbf0f('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xbf0f('0x2')+i,'lastName':_0xbf0f('0x3')+i,'phone':0xf879fb460+i,'email':_0xbf0f('0x4')+i+_0xbf0f('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xbf0f('0x6')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xbf0f('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xbf0f('0x6')]({'id':i,'firstName':_0xbf0f('0x2')+i,'lastName':_0xbf0f('0x3')+i,'phone':0xf879fb460+i,'email':_0xbf0f('0x4')+i+_0xbf0f('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xbf0f('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xbf0f('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xbf0f('0x7')](),'updatedAt':Date[_0xbf0f('0x7')]()});}db[_0xbf0f('0x8')][_0xbf0f('0x9')]({'where':{}})[_0xbf0f('0xa')](function(){return db[_0xbf0f('0x8')][_0xbf0f('0xb')](contacts);})[_0xbf0f('0xa')](function(){console[_0xbf0f('0xc')](_0xbf0f('0xd'),_0xbf0f('0xe'));return db[_0xbf0f('0xf')][_0xbf0f('0x9')]({'where':{}});})[_0xbf0f('0xa')](function(){return db[_0xbf0f('0xf')][_0xbf0f('0xb')](hopper);})[_0xbf0f('0xa')](function(){console[_0xbf0f('0xc')](_0xbf0f('0xd'),'hopper1');return db[_0xbf0f('0x8')][_0xbf0f('0xb')](contacts2);})['then'](function(){console[_0xbf0f('0xc')](_0xbf0f('0xd'),_0xbf0f('0x10'));return db[_0xbf0f('0xf')][_0xbf0f('0xb')](hopper2);})['then'](function(){console[_0xbf0f('0xc')]('finished\x20populating',_0xbf0f('0x11'));})[_0xbf0f('0x12')](function(_0x15a0e4){console[_0xbf0f('0xc')](_0x15a0e4);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 58cbe58..d943e5e 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2507=['/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','then','log','catch','util','push','%s%s','agent','format','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes'];(function(_0x40dd6b,_0x3311a1){var _0x25232f=function(_0x2b25fb){while(--_0x2b25fb){_0x40dd6b['push'](_0x40dd6b['shift']());}};_0x25232f(++_0x3311a1);}(_0x2507,0x1e7));var _0x7250=function(_0x135d6d,_0x4dd943){_0x135d6d=_0x135d6d-0x0;var _0xf59e7b=_0x2507[_0x135d6d];return _0xf59e7b;};'use strict';var util=require(_0x7250('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7250('0x1')]({'name':util['format'](_0x7250('0x2'),_0x7250('0x3'),i),'fullname':util['format'](_0x7250('0x2'),_0x7250('0x3'),i),'email':util[_0x7250('0x4')](_0x7250('0x5'),_0x7250('0x3'),i),'role':_0x7250('0x3'),'password':_0x7250('0x6'),'internal':0xfa0+i,'type':_0x7250('0x7'),'transport':[_0x7250('0x8'),'ws',_0x7250('0x9')],'disallow':[_0x7250('0xa')],'allow':[_0x7250('0xb')],'defaultuser':util[_0x7250('0x4')](_0x7250('0x2'),'agent',i),'encryption':_0x7250('0xc'),'avpf':_0x7250('0xc'),'force_avp':'yes','icesupport':_0x7250('0xc'),'dtlsenable':_0x7250('0xc'),'dtlsverify':'no','dtlscertfile':_0x7250('0xd'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x7250('0xe'),'callerid':util[_0x7250('0x4')](_0x7250('0xf'),util[_0x7250('0x4')](_0x7250('0x2'),_0x7250('0x3'),i),0xfa0+i)});}db[_0x7250('0x10')]['bulkCreate'](users)[_0x7250('0x11')](function(){console[_0x7250('0x12')]('add\x20user');})[_0x7250('0x13')](function(_0x25f92b){console[_0x7250('0x12')](_0x25f92b);}); \ No newline at end of file +var _0x65d6=['%s%s','agent','%s%s@xcally.com','friend','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','push','format'];(function(_0x9d66ca,_0x29e28b){var _0x41205f=function(_0x5cddc9){while(--_0x5cddc9){_0x9d66ca['push'](_0x9d66ca['shift']());}};_0x41205f(++_0x29e28b);}(_0x65d6,0x6f));var _0x665d=function(_0x5841c3,_0x188797){_0x5841c3=_0x5841c3-0x0;var _0x48dab6=_0x65d6[_0x5841c3];return _0x48dab6;};'use strict';var util=require('util');var db=require(_0x665d('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x665d('0x1')]({'name':util[_0x665d('0x2')]('%s%s','agent',i),'fullname':util['format'](_0x665d('0x3'),_0x665d('0x4'),i),'email':util[_0x665d('0x2')](_0x665d('0x5'),_0x665d('0x4'),i),'role':_0x665d('0x4'),'password':'password','internal':0xfa0+i,'type':_0x665d('0x6'),'transport':['udp','ws',_0x665d('0x7')],'disallow':[_0x665d('0x8')],'allow':['ulaw'],'defaultuser':util[_0x665d('0x2')]('%s%s','agent',i),'encryption':_0x665d('0x9'),'avpf':_0x665d('0x9'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0x665d('0x9'),'dtlsverify':'no','dtlscertfile':_0x665d('0xa'),'dtlsprivatekey':_0x665d('0xb'),'dtlssetup':_0x665d('0xc'),'callerid':util[_0x665d('0x2')]('\x22%s\x22\x20<%s>',util[_0x665d('0x2')](_0x665d('0x3'),_0x665d('0x4'),i),0xfa0+i)});}db[_0x665d('0xd')][_0x665d('0xe')](users)[_0x665d('0xf')](function(){console[_0x665d('0x10')](_0x665d('0x11'));})[_0x665d('0x12')](function(_0x5a4996){console[_0x665d('0x10')](_0x5a4996);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index ee32c20..9d9ee9d 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef4b=['Telephones','Trunks','IvrCampaigns','resourceId','Campaign','where','type','ivr','format','%s:queue:%s','Agents','query','find','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','user:%s','voice:inbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','voice:outbound','SmsQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','length','voice','chat','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','map','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','WhatsappInteractions','catch','join','connection','address','request','remotePort','connectedAt','log','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','User','name','role','agent','telephone','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll'];(function(_0x239a9b,_0x4f2b0a){var _0x3c176a=function(_0x20ca5f){while(--_0x20ca5f){_0x239a9b['push'](_0x239a9b['shift']());}};_0x3c176a(++_0x4f2b0a);}(_0xef4b,0x17b));var _0xbef4=function(_0x11dfbb,_0x1f4c8a){_0x11dfbb=_0x11dfbb-0x0;var _0x22d016=_0xef4b[_0x11dfbb];return _0x22d016;};'use strict';var _=require(_0xbef4('0x0'));var util=require(_0xbef4('0x1'));var BPromise=require(_0xbef4('0x2'));var db=require(_0xbef4('0x3'))['db'];var config=require(_0xbef4('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0xbef4('0x5')],'attributes':['id',_0xbef4('0x6'),_0xbef4('0x7')],'raw':!![],'where':{'role':_0xbef4('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xbef4('0x6')],'where':{'role':_0xbef4('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xbef4('0x6'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x40530e,_0x23ec16,_0x112928){return db[_0xbef4('0xa')][_0xbef4('0xb')]({'where':{'name':_0x40530e,'userProfileId':_0x23ec16},'raw':!![]})[_0xbef4('0xc')](function(_0x136eeb){if(_0x136eeb){if(_0x136eeb[_0xbef4('0xd')]){switch(_0x40530e){case _0xbef4('0xe'):case _0xbef4('0xf'):case _0xbef4('0x10'):case'SmsQueues':case _0xbef4('0x11'):case _0xbef4('0x12'):case _0xbef4('0x13'):return db[_0x112928][_0xbef4('0x14')](queryQueues);case _0xbef4('0x15'):return db[_0x112928]['findAll'](queryTelephones);case _0xbef4('0x16'):return db[_0x112928]['findAll'](queryTrunks);case _0xbef4('0x17'):return db[_0x112928][_0xbef4('0x14')](queryCampaigns);}}else{return db['UserProfileResource'][_0xbef4('0x14')]({'attributes':[_0xbef4('0x18')],'where':{'sectionId':_0x136eeb['id']},'raw':!![]})['then'](function(_0x3320d6){if(_0x3320d6){var _0x3511be={'where':{'id':_['map'](_0x3320d6,'resourceId')},'raw':!![]};switch(_0x112928){case _0xbef4('0x5'):_0x3511be['where'][_0xbef4('0x7')]=_0xbef4('0x9');break;case _0xbef4('0x19'):_0x3511be[_0xbef4('0x1a')][_0xbef4('0x1b')]=_0xbef4('0x1c');break;}return db[_0x112928][_0xbef4('0x14')](_0x3511be);}else{return[];}});}}else{return[];}})[_0xbef4('0xc')](function(_0x1f9263){return _0x1f9263;});}function joinOrLeaveQueues(_0x269a34,_0x589825,_0x1a63e0,_0x51e08e){_0x269a34[_0x589825](util[_0xbef4('0x1d')](_0xbef4('0x1e'),_0x1a63e0,_0x51e08e[_0xbef4('0x6')]));if(_0x51e08e[_0xbef4('0x1f')]){for(var _0x35547e=0x0;_0x35547e<_0x51e08e[_0xbef4('0x1f')]['length'];_0x35547e+=0x1){_0x269a34[_0x589825](util[_0xbef4('0x1d')]('user:%s',_0x51e08e[_0xbef4('0x1f')][_0x35547e][_0xbef4('0x6')]));}}}function joinOrLeave(_0xc2f9c,_0x5bac4b,_0x1102d2){var _0x35e311;if(_0xc2f9c['handshake'][_0xbef4('0x20')]['id']){db[_0xbef4('0x5')][_0xbef4('0x21')]({'attributes':['id',_0xbef4('0x6'),'role',_0xbef4('0x22')],'where':{'id':_0xc2f9c[_0xbef4('0x23')]['query']['id']},'include':[{'model':db[_0xbef4('0x24')],'as':_0xbef4('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xbef4('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xbef4('0x27')],'as':_0xbef4('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xbef4('0x29')],'as':_0xbef4('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xbef4('0x2b')],'as':_0xbef4('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0xbef4('0x2d')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x1cd73f){if(_0x1cd73f){_0x35e311=_0x1cd73f;_0xc2f9c[_0x5bac4b](util['format'](_0xbef4('0x2e'),_0x1cd73f[_0xbef4('0x6')]));var _0x213e6a=[];switch(_0x1cd73f[_0xbef4('0x7')]){case'admin':_0xc2f9c[_0x5bac4b](_0xbef4('0x2f'));_0xc2f9c[_0x5bac4b]('voice:outbound');if(queryQueues[_0xbef4('0x30')](_0xbef4('0x31'))){delete queryQueues[_0xbef4('0x31')];}_0x213e6a[_0xbef4('0x32')](db['VoiceQueue'][_0xbef4('0x14')](queryQueues));_0x213e6a['push'](db[_0xbef4('0x33')][_0xbef4('0x14')](queryQueues));_0x213e6a[_0xbef4('0x32')](db[_0xbef4('0x34')][_0xbef4('0x14')](queryQueues));_0x213e6a[_0xbef4('0x32')](db[_0xbef4('0x35')][_0xbef4('0x14')](queryQueues));_0x213e6a[_0xbef4('0x32')](db[_0xbef4('0x36')][_0xbef4('0x14')](queryQueues));_0x213e6a[_0xbef4('0x32')](db[_0xbef4('0x37')][_0xbef4('0x14')](queryQueues));_0x213e6a[_0xbef4('0x32')](db['WhatsappQueue'][_0xbef4('0x14')](queryQueues));_0x213e6a[_0xbef4('0x32')](db['User']['findAll'](queryTelephones));_0x213e6a[_0xbef4('0x32')](db[_0xbef4('0x38')]['findAll'](queryTrunks));_0x213e6a[_0xbef4('0x32')](db['Campaign'][_0xbef4('0x14')](queryCampaigns));_0x213e6a[_0xbef4('0x32')](db[_0xbef4('0x5')][_0xbef4('0x14')](queryAgents));break;case'user':_0xc2f9c[_0x5bac4b]('voice:inbound');_0xc2f9c[_0x5bac4b](_0xbef4('0x39'));_0x213e6a[_0xbef4('0x32')](getAssociatedResources(_0xbef4('0xe'),_0x1cd73f['userProfileId'],'VoiceQueue'));_0x213e6a['push'](getAssociatedResources('ChatQueues',_0x1cd73f[_0xbef4('0x22')],_0xbef4('0x33')));_0x213e6a['push'](getAssociatedResources(_0xbef4('0x10'),_0x1cd73f[_0xbef4('0x22')],'FaxQueue'));_0x213e6a[_0xbef4('0x32')](getAssociatedResources(_0xbef4('0x3a'),_0x1cd73f[_0xbef4('0x22')],_0xbef4('0x35')));_0x213e6a['push'](getAssociatedResources(_0xbef4('0x11'),_0x1cd73f[_0xbef4('0x22')],_0xbef4('0x36')));_0x213e6a[_0xbef4('0x32')](getAssociatedResources(_0xbef4('0x12'),_0x1cd73f[_0xbef4('0x22')],_0xbef4('0x37')));_0x213e6a[_0xbef4('0x32')](getAssociatedResources(_0xbef4('0x13'),_0x1cd73f['userProfileId'],'WhatsappQueue'));_0x213e6a['push'](getAssociatedResources('Telephones',_0x1cd73f['userProfileId'],_0xbef4('0x5')));_0x213e6a[_0xbef4('0x32')](getAssociatedResources('Trunks',_0x1cd73f[_0xbef4('0x22')],_0xbef4('0x38')));_0x213e6a[_0xbef4('0x32')](getAssociatedResources(_0xbef4('0x17'),_0x1cd73f['userProfileId'],_0xbef4('0x19')));_0x213e6a[_0xbef4('0x32')](db[_0xbef4('0x5')]['findAll'](queryAgents));break;case _0xbef4('0x8'):_0xc2f9c[_0x5bac4b](_0xbef4('0x2f'));_0xc2f9c[_0x5bac4b](_0xbef4('0x39'));_0x213e6a[_0xbef4('0x32')](_0x1cd73f[_0xbef4('0x3b')]({'attributes':['id','name']}));_0x213e6a[_0xbef4('0x32')](_0x1cd73f[_0xbef4('0x3c')]({'attributes':['id',_0xbef4('0x6')]}));_0x213e6a[_0xbef4('0x32')](_0x1cd73f[_0xbef4('0x3d')]({'attributes':['id',_0xbef4('0x6')]}));_0x213e6a['push'](_0x1cd73f[_0xbef4('0x3e')]({'attributes':['id',_0xbef4('0x6')]}));_0x213e6a[_0xbef4('0x32')](_0x1cd73f[_0xbef4('0x3f')]({'attributes':['id',_0xbef4('0x6')]}));_0x213e6a[_0xbef4('0x32')](_0x1cd73f['getOpenchannelQueues']({'attributes':['id',_0xbef4('0x6')]}));_0x213e6a[_0xbef4('0x32')](_0x1cd73f[_0xbef4('0x40')]({'attributes':['id',_0xbef4('0x6')]}));break;}return BPromise['all'](_0x213e6a);}})[_0xbef4('0xc')](function(_0x1125f4){if(_0x1125f4&&_0x1125f4[_0xbef4('0x41')]){for(var _0x10f263=0x0;_0x10f263<_0x1125f4['length'];_0x10f263+=0x1){for(var _0x1ce710=0x0;_0x1ce710<_0x1125f4[_0x10f263][_0xbef4('0x41')];_0x1ce710+=0x1){switch(_0x10f263){case 0x0:joinOrLeaveQueues(_0xc2f9c,_0x5bac4b,_0xbef4('0x42'),_0x1125f4[_0x10f263][_0x1ce710]);break;case 0x1:joinOrLeaveQueues(_0xc2f9c,_0x5bac4b,_0xbef4('0x43'),_0x1125f4[_0x10f263][_0x1ce710]);break;case 0x2:joinOrLeaveQueues(_0xc2f9c,_0x5bac4b,_0xbef4('0x44'),_0x1125f4[_0x10f263][_0x1ce710]);break;case 0x3:joinOrLeaveQueues(_0xc2f9c,_0x5bac4b,_0xbef4('0x45'),_0x1125f4[_0x10f263][_0x1ce710]);break;case 0x4:joinOrLeaveQueues(_0xc2f9c,_0x5bac4b,_0xbef4('0x46'),_0x1125f4[_0x10f263][_0x1ce710]);break;case 0x5:joinOrLeaveQueues(_0xc2f9c,_0x5bac4b,'openchannel',_0x1125f4[_0x10f263][_0x1ce710]);break;case 0x6:joinOrLeaveQueues(_0xc2f9c,_0x5bac4b,_0xbef4('0x47'),_0x1125f4[_0x10f263][_0x1ce710]);break;case 0x7:if(_0x35e311['role']!==_0xbef4('0x8'))_0xc2f9c[_0x5bac4b](util[_0xbef4('0x1d')](_0xbef4('0x48'),_0x1125f4[_0x10f263][_0x1ce710]['name']));break;case 0x8:if(_0x35e311[_0xbef4('0x7')]!=='agent')_0xc2f9c[_0x5bac4b](util[_0xbef4('0x1d')](_0xbef4('0x49'),_0x1125f4[_0x10f263][_0x1ce710][_0xbef4('0x6')]));break;case 0x9:if(_0x35e311[_0xbef4('0x7')]!=='agent')_0xc2f9c[_0x5bac4b](util[_0xbef4('0x1d')](_0xbef4('0x4a'),_0x1125f4[_0x10f263][_0x1ce710][_0xbef4('0x1b')],_0x1125f4[_0x10f263][_0x1ce710][_0xbef4('0x6')]));break;case 0xa:_0xc2f9c[_0x5bac4b](util[_0xbef4('0x1d')]('user:%s',_0x1125f4[_0x10f263][_0x1ce710][_0xbef4('0x6')]));break;}}}}})[_0xbef4('0xc')](function(){if(_0x5bac4b===_0xbef4('0x4b')){var _0x22ab89=_['map'](_0x35e311[_0xbef4('0x25')],'id');return _0x35e311[_0xbef4('0x4c')](_0x22ab89)[_0xbef4('0xc')](function(){for(var _0x43563e=0x0;_0x43563e<_0x22ab89[_0xbef4('0x41')];_0x43563e+=0x1){_0x1102d2[_0xbef4('0x4d')](_0xbef4('0x4e'),{'ChatInteractionId':Number(_0x22ab89[_0x43563e]),'UserId':Number(_0x35e311['id'])});}});}})[_0xbef4('0xc')](function(){if(_0x5bac4b===_0xbef4('0x4b')){var _0x37f5a8=_[_0xbef4('0x4f')](_0x35e311[_0xbef4('0x50')],'id');return _0x35e311[_0xbef4('0x51')](_0x37f5a8)[_0xbef4('0xc')](function(){for(var _0x51bc82=0x0;_0x51bc82<_0x37f5a8['length'];_0x51bc82+=0x1){_0x1102d2[_0xbef4('0x4d')](_0xbef4('0x52'),{'MailInteractionId':Number(_0x37f5a8[_0x51bc82]),'UserId':Number(_0x35e311['id'])});}});}})[_0xbef4('0xc')](function(){if(_0x5bac4b==='leave'){var _0x2b1dcf=_[_0xbef4('0x4f')](_0x35e311[_0xbef4('0x28')],'id');return _0x35e311[_0xbef4('0x53')](_0x2b1dcf)[_0xbef4('0xc')](function(){for(var _0x5bb085=0x0;_0x5bb085<_0x2b1dcf[_0xbef4('0x41')];_0x5bb085+=0x1){_0x1102d2[_0xbef4('0x4d')](_0xbef4('0x54'),{'FaxInteractionId':Number(_0x2b1dcf[_0x5bb085]),'UserId':Number(_0x35e311['id'])});}});}})[_0xbef4('0xc')](function(){if(_0x5bac4b===_0xbef4('0x4b')){var _0x48569d=_[_0xbef4('0x4f')](_0x35e311[_0xbef4('0x2a')],'id');return _0x35e311['removeSmsInteractions'](_0x48569d)['then'](function(){for(var _0x1bccd3=0x0;_0x1bccd3<_0x48569d[_0xbef4('0x41')];_0x1bccd3+=0x1){_0x1102d2[_0xbef4('0x4d')](_0xbef4('0x55'),{'SmsInteractionId':Number(_0x48569d[_0x1bccd3]),'UserId':Number(_0x35e311['id'])});}});}})[_0xbef4('0xc')](function(){if(_0x5bac4b===_0xbef4('0x4b')){var _0x454ac9=_['map'](_0x35e311[_0xbef4('0x2c')],'id');return _0x35e311['removeOpenchannelInteractions'](_0x454ac9)[_0xbef4('0xc')](function(){for(var _0x216ceb=0x0;_0x216ceb<_0x454ac9[_0xbef4('0x41')];_0x216ceb+=0x1){_0x1102d2['emit'](_0xbef4('0x56'),{'OpenchannelInteractionId':Number(_0x454ac9[_0x216ceb]),'UserId':Number(_0x35e311['id'])});}});}})[_0xbef4('0xc')](function(){if(_0x5bac4b===_0xbef4('0x4b')){var _0x566628=_[_0xbef4('0x4f')](_0x35e311[_0xbef4('0x57')],'id');return _0x35e311['removeWhatsappInteractions'](_0x566628)[_0xbef4('0xc')](function(){for(var _0x38ce11=0x0;_0x38ce11<_0x566628['length'];_0x38ce11+=0x1){_0x1102d2[_0xbef4('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x566628[_0x38ce11]),'UserId':Number(_0x35e311['id'])});}});}})[_0xbef4('0x58')](function(_0x2bee52){_0xc2f9c['log'](_0x2bee52);});}}function onDisconnect(_0x1f89c1,_0x3afc83){joinOrLeave(_0x1f89c1,_0xbef4('0x4b'),_0x3afc83);}function onConnect(_0x504ddf){joinOrLeave(_0x504ddf,_0xbef4('0x59'));}exports['default']=function(_0x5b6ad7){_0x5b6ad7['on'](_0xbef4('0x5a'),function(_0x762860){_0x762860['setMaxListeners'](0x0);_0x762860[_0xbef4('0x5b')]=_0x762860['request'][_0xbef4('0x5a')]['remoteAddress']+':'+_0x762860[_0xbef4('0x5c')]['connection'][_0xbef4('0x5d')];_0x762860[_0xbef4('0x5e')]=new Date();_0x762860[_0xbef4('0x5f')]=function(_0x1d9462){console['log'](_0xbef4('0x60')+_0x762860['nsp']['name']+'['+_0x762860[_0xbef4('0x5b')]+']',_0x1d9462);};_0x762860['on'](_0xbef4('0x61'),function(){onDisconnect(_0x762860,_0x5b6ad7);_0x762860[_0xbef4('0x5f')](_0xbef4('0x62'));});onConnect(_0x762860);_0x762860[_0xbef4('0x5f')](_0xbef4('0x63'));});}; \ No newline at end of file +var _0x517b=['map','where','%s:queue:%s','length','user:%s','query','userProfileId','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','format','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','Campaign','agent','voice:outbound','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','leave','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','default','connection','setMaxListeners','request','remotePort','connectedAt','log','nsp','address','disconnect','DISCONNECTED','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone','type','ivr','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId'];(function(_0x259991,_0x56b6dc){var _0x18c8e7=function(_0x113e03){while(--_0x113e03){_0x259991['push'](_0x259991['shift']());}};_0x18c8e7(++_0x56b6dc);}(_0x517b,0xff));var _0xb517=function(_0x263520,_0x271c36){_0x263520=_0x263520-0x0;var _0x4b27a1=_0x517b[_0x263520];return _0x4b27a1;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xb517('0x0'));var db=require(_0xb517('0x1'))['db'];var config=require(_0xb517('0x2'));var queryQueues={'attributes':['id',_0xb517('0x3')],'include':[{'as':_0xb517('0x4'),'model':db[_0xb517('0x5')],'attributes':['id',_0xb517('0x3'),_0xb517('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xb517('0x3')],'where':{'role':_0xb517('0x7')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xb517('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb517('0x3'),_0xb517('0x8')],'where':{'type':_0xb517('0x9')}};function getAssociatedResources(_0xde0e96,_0x59279d,_0xafd8f7){return db['UserProfileSection']['findOne']({'where':{'name':_0xde0e96,'userProfileId':_0x59279d},'raw':!![]})[_0xb517('0xa')](function(_0xcc23ca){if(_0xcc23ca){if(_0xcc23ca[_0xb517('0xb')]){switch(_0xde0e96){case _0xb517('0xc'):case _0xb517('0xd'):case _0xb517('0xe'):case _0xb517('0xf'):case _0xb517('0x10'):case'OpenchannelQueues':case _0xb517('0x11'):return db[_0xafd8f7][_0xb517('0x12')](queryQueues);case _0xb517('0x13'):return db[_0xafd8f7][_0xb517('0x12')](queryTelephones);case _0xb517('0x14'):return db[_0xafd8f7][_0xb517('0x12')](queryTrunks);case _0xb517('0x15'):return db[_0xafd8f7][_0xb517('0x12')](queryCampaigns);}}else{return db[_0xb517('0x16')][_0xb517('0x12')]({'attributes':[_0xb517('0x17')],'where':{'sectionId':_0xcc23ca['id']},'raw':!![]})[_0xb517('0xa')](function(_0x4dd554){if(_0x4dd554){var _0x44a928={'where':{'id':_[_0xb517('0x18')](_0x4dd554,_0xb517('0x17'))},'raw':!![]};switch(_0xafd8f7){case _0xb517('0x5'):_0x44a928[_0xb517('0x19')][_0xb517('0x6')]=_0xb517('0x7');break;case'Campaign':_0x44a928[_0xb517('0x19')][_0xb517('0x8')]=_0xb517('0x9');break;}return db[_0xafd8f7][_0xb517('0x12')](_0x44a928);}else{return[];}});}}else{return[];}})['then'](function(_0x57a546){return _0x57a546;});}function joinOrLeaveQueues(_0x154c77,_0x5b426c,_0x38a95d,_0x44c2f7){_0x154c77[_0x5b426c](util['format'](_0xb517('0x1a'),_0x38a95d,_0x44c2f7[_0xb517('0x3')]));if(_0x44c2f7[_0xb517('0x4')]){for(var _0x598dc3=0x0;_0x598dc3<_0x44c2f7[_0xb517('0x4')][_0xb517('0x1b')];_0x598dc3+=0x1){_0x154c77[_0x5b426c](util['format'](_0xb517('0x1c'),_0x44c2f7[_0xb517('0x4')][_0x598dc3]['name']));}}}function joinOrLeave(_0x27dc73,_0x4c981e,_0x10396b){var _0x8dfcda;if(_0x27dc73['handshake'][_0xb517('0x1d')]['id']){db[_0xb517('0x5')]['find']({'attributes':['id','name','role',_0xb517('0x1e')],'where':{'id':_0x27dc73['handshake'][_0xb517('0x1d')]['id']},'include':[{'model':db[_0xb517('0x1f')],'as':_0xb517('0x20'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb517('0x21')],'as':_0xb517('0x22'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xb517('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xb517('0x24')],'as':_0xb517('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xb517('0x26')],'as':_0xb517('0x27'),'attributes':['id'],'raw':!![]}]})[_0xb517('0xa')](function(_0xfd2e89){if(_0xfd2e89){_0x8dfcda=_0xfd2e89;_0x27dc73[_0x4c981e](util[_0xb517('0x28')](_0xb517('0x1c'),_0xfd2e89[_0xb517('0x3')]));var _0x2dd05f=[];switch(_0xfd2e89[_0xb517('0x6')]){case _0xb517('0x29'):_0x27dc73[_0x4c981e](_0xb517('0x2a'));_0x27dc73[_0x4c981e]('voice:outbound');if(queryQueues[_0xb517('0x2b')](_0xb517('0x2c'))){delete queryQueues['include'];}_0x2dd05f[_0xb517('0x2d')](db[_0xb517('0x2e')][_0xb517('0x12')](queryQueues));_0x2dd05f['push'](db[_0xb517('0x2f')][_0xb517('0x12')](queryQueues));_0x2dd05f[_0xb517('0x2d')](db[_0xb517('0x30')][_0xb517('0x12')](queryQueues));_0x2dd05f[_0xb517('0x2d')](db[_0xb517('0x31')][_0xb517('0x12')](queryQueues));_0x2dd05f['push'](db[_0xb517('0x32')][_0xb517('0x12')](queryQueues));_0x2dd05f[_0xb517('0x2d')](db[_0xb517('0x33')][_0xb517('0x12')](queryQueues));_0x2dd05f[_0xb517('0x2d')](db[_0xb517('0x34')][_0xb517('0x12')](queryQueues));_0x2dd05f[_0xb517('0x2d')](db[_0xb517('0x5')][_0xb517('0x12')](queryTelephones));_0x2dd05f[_0xb517('0x2d')](db['Trunk'][_0xb517('0x12')](queryTrunks));_0x2dd05f['push'](db['Campaign'][_0xb517('0x12')](queryCampaigns));_0x2dd05f['push'](db[_0xb517('0x5')][_0xb517('0x12')](queryAgents));break;case _0xb517('0x35'):_0x27dc73[_0x4c981e](_0xb517('0x2a'));_0x27dc73[_0x4c981e]('voice:outbound');_0x2dd05f[_0xb517('0x2d')](getAssociatedResources(_0xb517('0xc'),_0xfd2e89[_0xb517('0x1e')],'VoiceQueue'));_0x2dd05f['push'](getAssociatedResources(_0xb517('0xd'),_0xfd2e89['userProfileId'],_0xb517('0x2f')));_0x2dd05f[_0xb517('0x2d')](getAssociatedResources(_0xb517('0xe'),_0xfd2e89[_0xb517('0x1e')],'FaxQueue'));_0x2dd05f[_0xb517('0x2d')](getAssociatedResources('SmsQueues',_0xfd2e89['userProfileId'],_0xb517('0x31')));_0x2dd05f[_0xb517('0x2d')](getAssociatedResources(_0xb517('0x10'),_0xfd2e89['userProfileId'],'MailQueue'));_0x2dd05f[_0xb517('0x2d')](getAssociatedResources('OpenchannelQueues',_0xfd2e89[_0xb517('0x1e')],'OpenchannelQueue'));_0x2dd05f[_0xb517('0x2d')](getAssociatedResources(_0xb517('0x11'),_0xfd2e89['userProfileId'],_0xb517('0x34')));_0x2dd05f[_0xb517('0x2d')](getAssociatedResources(_0xb517('0x13'),_0xfd2e89[_0xb517('0x1e')],'User'));_0x2dd05f[_0xb517('0x2d')](getAssociatedResources('Trunks',_0xfd2e89['userProfileId'],'Trunk'));_0x2dd05f['push'](getAssociatedResources(_0xb517('0x15'),_0xfd2e89[_0xb517('0x1e')],_0xb517('0x36')));_0x2dd05f[_0xb517('0x2d')](db[_0xb517('0x5')][_0xb517('0x12')](queryAgents));break;case _0xb517('0x37'):_0x27dc73[_0x4c981e](_0xb517('0x2a'));_0x27dc73[_0x4c981e](_0xb517('0x38'));_0x2dd05f[_0xb517('0x2d')](_0xfd2e89['getVoiceQueues']({'attributes':['id','name']}));_0x2dd05f[_0xb517('0x2d')](_0xfd2e89[_0xb517('0x39')]({'attributes':['id',_0xb517('0x3')]}));_0x2dd05f[_0xb517('0x2d')](_0xfd2e89[_0xb517('0x3a')]({'attributes':['id',_0xb517('0x3')]}));_0x2dd05f[_0xb517('0x2d')](_0xfd2e89['getSmsQueues']({'attributes':['id',_0xb517('0x3')]}));_0x2dd05f[_0xb517('0x2d')](_0xfd2e89[_0xb517('0x3b')]({'attributes':['id',_0xb517('0x3')]}));_0x2dd05f[_0xb517('0x2d')](_0xfd2e89[_0xb517('0x3c')]({'attributes':['id',_0xb517('0x3')]}));_0x2dd05f[_0xb517('0x2d')](_0xfd2e89[_0xb517('0x3d')]({'attributes':['id',_0xb517('0x3')]}));break;}return BPromise[_0xb517('0x3e')](_0x2dd05f);}})[_0xb517('0xa')](function(_0x331033){if(_0x331033&&_0x331033[_0xb517('0x1b')]){for(var _0x19d8e8=0x0;_0x19d8e8<_0x331033[_0xb517('0x1b')];_0x19d8e8+=0x1){for(var _0x23c851=0x0;_0x23c851<_0x331033[_0x19d8e8][_0xb517('0x1b')];_0x23c851+=0x1){switch(_0x19d8e8){case 0x0:joinOrLeaveQueues(_0x27dc73,_0x4c981e,_0xb517('0x3f'),_0x331033[_0x19d8e8][_0x23c851]);break;case 0x1:joinOrLeaveQueues(_0x27dc73,_0x4c981e,_0xb517('0x40'),_0x331033[_0x19d8e8][_0x23c851]);break;case 0x2:joinOrLeaveQueues(_0x27dc73,_0x4c981e,_0xb517('0x41'),_0x331033[_0x19d8e8][_0x23c851]);break;case 0x3:joinOrLeaveQueues(_0x27dc73,_0x4c981e,_0xb517('0x42'),_0x331033[_0x19d8e8][_0x23c851]);break;case 0x4:joinOrLeaveQueues(_0x27dc73,_0x4c981e,_0xb517('0x43'),_0x331033[_0x19d8e8][_0x23c851]);break;case 0x5:joinOrLeaveQueues(_0x27dc73,_0x4c981e,_0xb517('0x44'),_0x331033[_0x19d8e8][_0x23c851]);break;case 0x6:joinOrLeaveQueues(_0x27dc73,_0x4c981e,'whatsapp',_0x331033[_0x19d8e8][_0x23c851]);break;case 0x7:if(_0x8dfcda[_0xb517('0x6')]!==_0xb517('0x37'))_0x27dc73[_0x4c981e](util['format'](_0xb517('0x45'),_0x331033[_0x19d8e8][_0x23c851][_0xb517('0x3')]));break;case 0x8:if(_0x8dfcda[_0xb517('0x6')]!==_0xb517('0x37'))_0x27dc73[_0x4c981e](util['format'](_0xb517('0x46'),_0x331033[_0x19d8e8][_0x23c851]['name']));break;case 0x9:if(_0x8dfcda[_0xb517('0x6')]!==_0xb517('0x37'))_0x27dc73[_0x4c981e](util[_0xb517('0x28')]('campaign:%s:%s',_0x331033[_0x19d8e8][_0x23c851][_0xb517('0x8')],_0x331033[_0x19d8e8][_0x23c851][_0xb517('0x3')]));break;case 0xa:_0x27dc73[_0x4c981e](util[_0xb517('0x28')](_0xb517('0x1c'),_0x331033[_0x19d8e8][_0x23c851][_0xb517('0x3')]));break;}}}}})['then'](function(){if(_0x4c981e===_0xb517('0x47')){var _0x4d7a3e=_['map'](_0x8dfcda[_0xb517('0x20')],'id');return _0x8dfcda['removeChatInteractions'](_0x4d7a3e)[_0xb517('0xa')](function(){for(var _0x1bf201=0x0;_0x1bf201<_0x4d7a3e[_0xb517('0x1b')];_0x1bf201+=0x1){_0x10396b[_0xb517('0x48')](_0xb517('0x49'),{'ChatInteractionId':Number(_0x4d7a3e[_0x1bf201]),'UserId':Number(_0x8dfcda['id'])});}});}})[_0xb517('0xa')](function(){if(_0x4c981e===_0xb517('0x47')){var _0x2e61d6=_[_0xb517('0x18')](_0x8dfcda[_0xb517('0x4a')],'id');return _0x8dfcda[_0xb517('0x4b')](_0x2e61d6)[_0xb517('0xa')](function(){for(var _0x13ab33=0x0;_0x13ab33<_0x2e61d6['length'];_0x13ab33+=0x1){_0x10396b['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2e61d6[_0x13ab33]),'UserId':Number(_0x8dfcda['id'])});}});}})[_0xb517('0xa')](function(){if(_0x4c981e===_0xb517('0x47')){var _0x5df749=_[_0xb517('0x18')](_0x8dfcda['FaxInteractions'],'id');return _0x8dfcda['removeFaxInteractions'](_0x5df749)[_0xb517('0xa')](function(){for(var _0x365e26=0x0;_0x365e26<_0x5df749[_0xb517('0x1b')];_0x365e26+=0x1){_0x10396b[_0xb517('0x48')](_0xb517('0x4c'),{'FaxInteractionId':Number(_0x5df749[_0x365e26]),'UserId':Number(_0x8dfcda['id'])});}});}})[_0xb517('0xa')](function(){if(_0x4c981e===_0xb517('0x47')){var _0x1060e5=_['map'](_0x8dfcda['SmsInteractions'],'id');return _0x8dfcda['removeSmsInteractions'](_0x1060e5)[_0xb517('0xa')](function(){for(var _0x51cbbb=0x0;_0x51cbbb<_0x1060e5[_0xb517('0x1b')];_0x51cbbb+=0x1){_0x10396b[_0xb517('0x48')](_0xb517('0x4d'),{'SmsInteractionId':Number(_0x1060e5[_0x51cbbb]),'UserId':Number(_0x8dfcda['id'])});}});}})[_0xb517('0xa')](function(){if(_0x4c981e===_0xb517('0x47')){var _0x59b15c=_[_0xb517('0x18')](_0x8dfcda[_0xb517('0x25')],'id');return _0x8dfcda[_0xb517('0x4e')](_0x59b15c)['then'](function(){for(var _0x4c2a1e=0x0;_0x4c2a1e<_0x59b15c[_0xb517('0x1b')];_0x4c2a1e+=0x1){_0x10396b[_0xb517('0x48')](_0xb517('0x4f'),{'OpenchannelInteractionId':Number(_0x59b15c[_0x4c2a1e]),'UserId':Number(_0x8dfcda['id'])});}});}})['then'](function(){if(_0x4c981e===_0xb517('0x47')){var _0x2c7413=_[_0xb517('0x18')](_0x8dfcda['WhatsappInteractions'],'id');return _0x8dfcda[_0xb517('0x50')](_0x2c7413)[_0xb517('0xa')](function(){for(var _0x3731c0=0x0;_0x3731c0<_0x2c7413[_0xb517('0x1b')];_0x3731c0+=0x1){_0x10396b[_0xb517('0x48')](_0xb517('0x51'),{'WhatsappInteractionId':Number(_0x2c7413[_0x3731c0]),'UserId':Number(_0x8dfcda['id'])});}});}})['catch'](function(_0x5cb23f){_0x27dc73['log'](_0x5cb23f);});}}function onDisconnect(_0x3b8d90,_0x3c6e1b){joinOrLeave(_0x3b8d90,'leave',_0x3c6e1b);}function onConnect(_0xab7a92){joinOrLeave(_0xab7a92,'join');}exports[_0xb517('0x52')]=function(_0x3fccd8){_0x3fccd8['on'](_0xb517('0x53'),function(_0xda7a67){_0xda7a67[_0xb517('0x54')](0x0);_0xda7a67['address']=_0xda7a67[_0xb517('0x55')]['connection']['remoteAddress']+':'+_0xda7a67[_0xb517('0x55')][_0xb517('0x53')][_0xb517('0x56')];_0xda7a67[_0xb517('0x57')]=new Date();_0xda7a67[_0xb517('0x58')]=function(_0x142241){console['log']('SocketIO\x20'+_0xda7a67[_0xb517('0x59')][_0xb517('0x3')]+'['+_0xda7a67[_0xb517('0x5a')]+']',_0x142241);};_0xda7a67['on'](_0xb517('0x5b'),function(){onDisconnect(_0xda7a67,_0x3fccd8);_0xda7a67[_0xb517('0x58')](_0xb517('0x5c'));});onConnect(_0xda7a67);_0xda7a67[_0xb517('0x58')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 069bd4d..b0ff06a 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 _0x2049=['EventManager','error','code','get','channel','event','direction','UserId','User','name','interface','format','SIP/%s','incomingmessage','catch','outgoingmessage','opened','changed','closed','default','length','model','hook','callback','toLowerCase','../../mysqldb','jayson/promise','triggers','client','Chat','ChatInteraction','afterCreate','afterUpdate','ChatMessage','Sms','SmsInteraction','newinteraction','closedinteraction','SmsMessage','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxMessage','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','then','info','Trigger,\x20%s'];(function(_0x3f1732,_0x300971){var _0x2dd600=function(_0x4e51af){while(--_0x4e51af){_0x3f1732['push'](_0x3f1732['shift']());}};_0x2dd600(++_0x300971);}(_0x2049,0x15d));var _0x9204=function(_0x5b7f3f,_0x3b6367){_0x5b7f3f=_0x5b7f3f-0x0;var _0x545c03=_0x2049[_0x5b7f3f];return _0x545c03;};'use strict';var util=require('util');var db=require(_0x9204('0x0'))['db'];var jayson=require(_0x9204('0x1'));var logger=require('../logger')(_0x9204('0x2'));var client=jayson[_0x9204('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0x9204('0x4'),'model':_0x9204('0x5'),'event':_0x9204('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x9204('0x4'),'model':'ChatInteraction','event':_0x9204('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x9204('0x4'),'model':_0x9204('0x8'),'event':_0x9204('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x9204('0x9'),'model':_0x9204('0xa'),'event':_0x9204('0x6'),'condition':_0x9204('0xb'),'callback':afterCreate},{'channel':_0x9204('0x9'),'model':'SmsInteraction','event':_0x9204('0x7'),'condition':_0x9204('0xc'),'callback':afterUpdate},{'channel':_0x9204('0x9'),'model':_0x9204('0xd'),'event':_0x9204('0x6'),'condition':_0x9204('0xe'),'callback':afterCreateMessage},{'channel':_0x9204('0xf'),'model':_0x9204('0x10'),'event':_0x9204('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x9204('0xf'),'model':_0x9204('0x10'),'event':'afterUpdate','condition':_0x9204('0xc'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x9204('0x11'),'event':_0x9204('0x6'),'condition':_0x9204('0xe'),'callback':afterCreateMessage},{'channel':_0x9204('0x12'),'model':'FaxInteraction','event':_0x9204('0x6'),'condition':_0x9204('0xb'),'callback':afterCreate},{'channel':_0x9204('0x12'),'model':'FaxInteraction','event':'afterUpdate','condition':_0x9204('0xc'),'callback':afterUpdate},{'channel':_0x9204('0x12'),'model':_0x9204('0x13'),'event':_0x9204('0x6'),'condition':_0x9204('0xe'),'callback':afterCreateMessage},{'channel':_0x9204('0x14'),'model':'MailInteraction','event':_0x9204('0x6'),'condition':_0x9204('0xb'),'callback':afterCreate},{'channel':_0x9204('0x14'),'model':'MailInteraction','event':_0x9204('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x9204('0x14'),'model':_0x9204('0x15'),'event':_0x9204('0x6'),'condition':_0x9204('0xe'),'callback':afterCreateMessage},{'channel':_0x9204('0x16'),'model':_0x9204('0x17'),'event':_0x9204('0x6'),'condition':_0x9204('0xb'),'callback':afterCreate},{'channel':_0x9204('0x16'),'model':_0x9204('0x17'),'event':_0x9204('0x7'),'condition':_0x9204('0xc'),'callback':afterUpdate},{'channel':_0x9204('0x16'),'model':_0x9204('0x18'),'event':_0x9204('0x6'),'condition':_0x9204('0xe'),'callback':afterCreateMessage}];function request(_0x4791c3){return client[_0x9204('0x19')]('EventManager',_0x4791c3)[_0x9204('0x1a')](function(_0x4effea){logger[_0x9204('0x1b')](_0x9204('0x1c'),_0x9204('0x1d'),_0x4effea);if(_0x4effea[_0x9204('0x1e')]){if(_0x4effea[_0x9204('0x1e')][_0x9204('0x1f')]===0x1f4){logger[_0x9204('0x1e')](_0x9204('0x1c'),_0x9204('0x1d'),_0x4effea[_0x9204('0x1e')]);}}})['catch'](function(_0x1512a4){logger[_0x9204('0x1e')](_0x9204('0x1c'),_0x9204('0x1d'),_0x1512a4);});}function afterCreateMessage(_0x3f9303,_0xce194e){return function(_0x4cba12,_0x5505aa){_0x4cba12=_0x4cba12[_0x9204('0x20')]({'plain':!![]});_0x4cba12[_0x9204('0x21')]=_0x3f9303;_0x4cba12[_0x9204('0x22')]=_0x4cba12[_0x9204('0x23')];if(_0x4cba12[_0x9204('0x24')]){return db[_0x9204('0x25')]['find']({'where':{'id':_0x4cba12['UserId']},'attributes':['id',_0x9204('0x26')],'raw':!![]})[_0x9204('0x1a')](function(_0x1d0ebc){_0x4cba12[_0x9204('0x27')]=util[_0x9204('0x28')](_0x9204('0x29'),_0x1d0ebc[_0x9204('0x26')]);_0x4cba12[_0x9204('0x21')]=_0x3f9303;return request({'event':_0x9204('0x2a'),'message':_0x4cba12});})[_0x9204('0x2b')](function(_0x40b22a){console[_0x9204('0x1e')](_0x40b22a);});}else{return request({'event':_0x9204('0x2c'),'message':_0x4cba12});}};}function afterCreate(_0x461a8a,_0x31bf0f){return function(_0x34acfe,_0x3e3ef0){_0x34acfe=_0x34acfe[_0x9204('0x20')]({'plain':!![]});_0x34acfe[_0x9204('0x21')]=_0x461a8a;_0x34acfe[_0x9204('0x22')]=_0x9204('0x2d');return request({'event':_0x31bf0f,'message':_0x34acfe});};}function afterUpdate(_0x51621b,_0x4eb3d6){return function(_0x53ea1e,_0x125cdb){if(_0x53ea1e[_0x9204('0x2e')](_0x9204('0x2f'))&&_0x53ea1e['closed']){_0x53ea1e=_0x53ea1e['get']({'plain':!![]});_0x53ea1e['channel']=_0x51621b;_0x53ea1e[_0x9204('0x22')]=_0x9204('0x2f');if(_0x53ea1e[_0x9204('0x24')]){return db[_0x9204('0x25')]['find']({'where':{'id':_0x53ea1e[_0x9204('0x24')]},'attributes':['id',_0x9204('0x26')],'raw':!![]})[_0x9204('0x1a')](function(_0x9e9e99){_0x53ea1e[_0x9204('0x27')]=util[_0x9204('0x28')](_0x9204('0x29'),_0x9e9e99[_0x9204('0x26')]);return request({'event':_0x4eb3d6,'message':_0x53ea1e});})[_0x9204('0x2b')](function(_0x44a5d0){console['error'](_0x44a5d0);});}else{return request({'event':_0x4eb3d6,'message':_0x53ea1e});}}};}exports[_0x9204('0x30')]=function(){for(var _0x76c203=0x0;_0x76c203=_0x2a65a5[_0xa026('0x12')]){throw Error(_0xa026('0x13'));}_0xbc9c9e(_0x19cdaa);})[_0xa026('0x14')](function(_0x26b7fa){_0x337c26(_0x26b7fa);});});}; \ No newline at end of file +var _0xe473=['getChannels','isValidChannel','clearBlockUser','blockedAt','updateAttributes','agent','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','./license/util','voice','chat','fax','sms','openchannel'];(function(_0x4b92b9,_0x1bd47d){var _0x157b9d=function(_0x41d8e4){while(--_0x41d8e4){_0x4b92b9['push'](_0x4b92b9['shift']());}};_0x157b9d(++_0x1bd47d);}(_0xe473,0x19b));var _0x3e47=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xe473[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x3e47('0x0'));var BPromise=require(_0x3e47('0x1'));var db=require(_0x3e47('0x2'))['db'];var util=require(_0x3e47('0x3'));var channels=[_0x3e47('0x4'),'mail',_0x3e47('0x5'),_0x3e47('0x6'),_0x3e47('0x7'),'whatsapp',_0x3e47('0x8')];exports[_0x3e47('0x9')]=function(){return channels;};exports[_0x3e47('0xa')]=function(_0x3e9891){_0x3e9891=_0x3e9891['toLowerCase']();return _['includes'](channels,_0x3e9891);};exports[_0x3e47('0xb')]=function(_0x320700,_0x48b40d,_0x5d9a50,_0x460a73){var _0x42eaa5={'loginAttempts':_0x48b40d,'blocked':_0x5d9a50};if(!_['isUndefined'](_0x460a73)){_0x42eaa5[_0x3e47('0xc')]=_0x460a73;}return _0x320700[_0x3e47('0xd')](_0x42eaa5);};exports['getLicense']=function(_0x483aa5){return new BPromise(function(_0xec4596,_0x25f144){var _0x52a1df=0x0;if(_0x483aa5['role']!==_0x3e47('0xe')){_0xec4596(_0x483aa5);}db[_0x3e47('0xf')][_0x3e47('0x10')]({'where':{'role':_0x3e47('0xe'),'online':!![],'id':{'$ne':_0x483aa5['id']}}})[_0x3e47('0x11')](function(_0x298cca){_0x52a1df=_0x298cca;return util[_0x3e47('0x12')]();})[_0x3e47('0x11')](function(_0x5e780c){if(_0x5e780c&&_0x5e780c[_0x3e47('0x13')]&&_0x52a1df>=_0x5e780c[_0x3e47('0x13')]){throw Error(_0x3e47('0x14'));}_0xec4596(_0x483aa5);})['catch'](function(_0x5b508a){_0x25f144(_0x5b508a);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 8c50fd1..4a3c337 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd619=['404','status','render','json','send','exports'];(function(_0x4e170e,_0x207e58){var _0x338291=function(_0x4cb198){while(--_0x4cb198){_0x4e170e['push'](_0x4e170e['shift']());}};_0x338291(++_0x207e58);}(_0xd619,0x89));var _0x9d61=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xd619[_0x101e7b];return _0x4995c0;};'use strict';module[_0x9d61('0x0')][0x194]=function pageNotFound(_0x34eae3,_0x18314a){var _0x47cf6a=_0x9d61('0x1');var _0x1ff49d=0x194;var _0x1232bc={'status':_0x1ff49d};_0x18314a[_0x9d61('0x2')](_0x1232bc[_0x9d61('0x2')]);_0x18314a[_0x9d61('0x3')](_0x47cf6a,{},function(_0x282057,_0x3f4ac3){if(_0x282057){return _0x18314a['status'](_0x1232bc['status'])[_0x9d61('0x4')](_0x1232bc);}_0x18314a[_0x9d61('0x5')](_0x3f4ac3);});}; \ No newline at end of file +var _0x117f=['status','json','send','exports','404'];(function(_0x25b40d,_0x3d8e6c){var _0x25adab=function(_0x44de2b){while(--_0x44de2b){_0x25b40d['push'](_0x25b40d['shift']());}};_0x25adab(++_0x3d8e6c);}(_0x117f,0xf8));var _0xf117=function(_0x1afca9,_0x5a4b34){_0x1afca9=_0x1afca9-0x0;var _0x4580af=_0x117f[_0x1afca9];return _0x4580af;};'use strict';module[_0xf117('0x0')][0x194]=function pageNotFound(_0x1b9f20,_0x5a8a90){var _0x295054=_0xf117('0x1');var _0x3576cd=0x194;var _0x1aaa2e={'status':_0x3576cd};_0x5a8a90[_0xf117('0x2')](_0x1aaa2e[_0xf117('0x2')]);_0x5a8a90['render'](_0x295054,{},function(_0x51f7a9,_0x2b5edf){if(_0x51f7a9){return _0x5a8a90[_0xf117('0x2')](_0x1aaa2e['status'])[_0xf117('0x3')](_0x1aaa2e);}_0x5a8a90[_0xf117('0x4')](_0x2b5edf);});}; \ No newline at end of file diff --git a/server/migrations/2.5.27.js b/server/migrations/2.5.27.js new file mode 100644 index 0000000..92c836d --- /dev/null +++ b/server/migrations/2.5.27.js @@ -0,0 +1,165 @@ +'use strict'; + +var BPromise = require('bluebird'); +var util = require('util'); + +var logger = require('../config/logger')('migration'); + +var Sequence = function () { }; + +Sequence.prototype.enqueue = function (fn) { + this.tail = this.tail ? this.tail.finally(fn) : fn(); +}; + +var Migration = function (queryInterface) { + this.queryInterface = queryInterface; + this.sequence = new Sequence(); +}; + +Migration.prototype.changeColumn = function (table, column, type) { + var _this = this; + this.sequence.enqueue(function () { + return _this.queryInterface + .changeColumn(table, column, type) + .then(function () { + logger.info('Changed column %s in table %s', column, table); + }) + .catch(function (err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.addColumn = function (table, column, type) { + var _this = this; + this.sequence.enqueue(function () { + return _this.queryInterface + .addColumn(table, column, type) + .then(function () { + logger.info('Added column %s to %s', column, table); + }) + .catch(function (err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.dropTable = function (table) { + var _this = this; + this.sequence.enqueue(function () { + return _this.queryInterface + .dropTable(table, { + force: true + }) + .then(function () { + logger.info('table dropped %s', table); + }) + .catch(function (err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.addIndex = function (table, column, indexName) { + var _this = this; + this.sequence.enqueue(function () { + return _this.queryInterface + .addIndex(table, column, { + indexName: indexName + }) + .then(function () { + logger.info('addIndex %s %s %s', table, column.join(','), indexName); + }) + .catch(function (err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.removeIndex = function (table, indexName) { + var _this = this; + this.sequence.enqueue(function () { + return _this.queryInterface + .removeIndex(table, indexName) + .then(function () { + logger.info('removeIndex %s %s', table, indexName); + }) + .catch(function (err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.query = function (sql) { + var _this = this; + this.sequence.enqueue(function () { + return _this.queryInterface.sequelize + .query(sql) + .then(function () { + logger.info('query %s', sql); + }) + .catch(function (err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.removeColumn = function (table, column) { + var _this = this; + this.sequence.enqueue(function () { + return _this.queryInterface + .removeColumn(table, column) + .then(function () { + logger.info('Removed column %s from %s', column, table); + }) + .catch(function (err) { + logger.info( + util.inspect(err, { + showHidden: false, + depth: null + }) + ); + }); + }); +}; + +Migration.prototype.renameColumn = function (table, oldColumn, newColumn) { + var _this = this; + this.sequence.enqueue(function () { + return _this.queryInterface + .renameColumn(table, oldColumn, newColumn) + .then(function () { + logger.info('Renamed column from %s to %s on %s', oldColumn, newColumn, table); + }) + .catch(function (err) { + logger.info( + util.inspect(err, { + showHidden: false, + depth: null + }) + ); + }); + }); +}; + +Migration.prototype.final = function (resolve) { + this.sequence.enqueue(function () { + return resolve(); + }); +}; + +module.exports = { + up: function (queryInterface, Sequelize) { + return new BPromise(function (resolve) { + var migration = new Migration(queryInterface); + + // START FINAL + migration.final(resolve); + // END FINAL + }); + }, + + down: function (queryInterface, Sequelize) { + // var migration = new Migration(queryInterface); + } +}; diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index cfb0af6..08f628e 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde32=['../api/voiceExtension/voiceExtension.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailMessage/mailMessage.model','MailApplication','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','SquareProject','SquareRecording','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','cascade','VoiceQueuesRt','UserId','Extensions','hasMany','CmHopperFinal','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','FaxInteractions','MailInteractions','SenderId','belongsTo','UserProfile','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','ChatQueue','ChatQueues','FaxQueue','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','Applications','VoiceMusicOnHold','VoiceQueueId','Hoppers','VoiceQueue','CmHopperBlack','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','Smtp','Answers','MailMessage','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachment','Attachments','Interaction','ChatOfflineMessageId','restrict','MailQueueReport','Dashboard','Items','Dispositions','FaxAccountId','Interactions','fax_interaction_has_tags','FaxInteractionId','AttachmentId','team_has_fax_queues','Teams','FaxQueueReport','SmsAccount','SmsAccountId','user_has_sms_accounts','TagId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CompanyId','HopperFinals','HopperHistories','CmCompany','CampaignId','OwnerId','OneAll','AutomationAllId','Automation','Any','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticCustomReport','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllConditions','AnyConditions','AnyCondition','TriggerId','Fields','DefaultReportId','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','Field','VariableId','Description','int_desk_configuration_has_tags','ZohoAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','FromId','SessionId','ProjectId','JscriptyAnswerReport','user_has_square_projects','MailQueues','team_has_whatsapp_queues','TrunkId','TrunkBackup','SquareProjectId','Lists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsAccountId','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','database','username','options','sequelizeHistory','password','User','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','import'];(function(_0x5c989e,_0x3bb062){var _0x1cd16d=function(_0x4fc695){while(--_0x4fc695){_0x5c989e['push'](_0x5c989e['shift']());}};_0x1cd16d(++_0x3bb062);}(_0xde32,0x1d4));var _0x2de3=function(_0x2e0ddb,_0x1a081b){_0x2e0ddb=_0x2e0ddb-0x0;var _0x2967d0=_0xde32[_0x2e0ddb];return _0x2967d0;};'use strict';var path=require('path');var config=require(_0x2de3('0x0'));var Sequelize=require(_0x2de3('0x1'));var _=require('lodash');var jstz=require(_0x2de3('0x2'));var timezone=jstz['determine']();config[_0x2de3('0x1')]=_[_0x2de3('0x3')](config[_0x2de3('0x1')],{'database':_0x2de3('0x4'),'username':_0x2de3('0x5'),'password':_0x2de3('0x6'),'options':{'host':_0x2de3('0x7'),'port':0xcea,'dialect':_0x2de3('0x8'),'dialectOptions':{'charset':_0x2de3('0x9')},'logging':![],'timezone':timezone[_0x2de3('0xa')](),'define':{'charset':'utf8','collate':_0x2de3('0xb')}}});config['sequelizeHistory']=_[_0x2de3('0x3')](config['sequelizeHistory'],{'database':_0x2de3('0x4'),'username':'xcall','password':_0x2de3('0x6'),'options':{'host':_0x2de3('0x7'),'port':0xcea,'dialect':_0x2de3('0x8'),'dialectOptions':{'charset':_0x2de3('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2de3('0x1')][_0x2de3('0xc')],config[_0x2de3('0x1')][_0x2de3('0xd')],config[_0x2de3('0x1')]['password'],config[_0x2de3('0x1')][_0x2de3('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2de3('0xf')]['database'],config[_0x2de3('0xf')][_0x2de3('0xd')],config['sequelizeHistory'][_0x2de3('0x10')],config[_0x2de3('0xf')]['options'])};db[_0x2de3('0x11')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x12'));db[_0x2de3('0x13')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x14'));db[_0x2de3('0x15')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x16'));db[_0x2de3('0x17')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x19'));db['VoiceMusicOnHold']=db[_0x2de3('0x1')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x1a'));db[_0x2de3('0x1b')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x1c'));db[_0x2de3('0x1d')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x1e'));db[_0x2de3('0x1f')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x20'));db[_0x2de3('0x21')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x2de3('0x22')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/voiceCallReport/voiceCallReport.model');db[_0x2de3('0x23')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x24'));db[_0x2de3('0x25')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x26'));db[_0x2de3('0x27')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x28'));db[_0x2de3('0x29')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x2a'));db[_0x2de3('0x2b')]=db['sequelize']['import'](_0x2de3('0x2c'));db[_0x2de3('0x2d')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x2e'));db[_0x2de3('0x2f')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x30'));db[_0x2de3('0x31')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x32'));db[_0x2de3('0x33')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x34'));db[_0x2de3('0x35')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x36'));db['UserFaxQueue']=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/userFaxQueue/userFaxQueue.model');db[_0x2de3('0x37')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x38'));db[_0x2de3('0x39')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x3a'));db[_0x2de3('0x3b')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x3c'));db[_0x2de3('0x3d')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x3e'));db[_0x2de3('0x3f')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x40'));db[_0x2de3('0x41')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x42'));db[_0x2de3('0x43')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x44'));db[_0x2de3('0x45')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x46'));db[_0x2de3('0x47')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x48'));db[_0x2de3('0x49')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0x2de3('0x1')]['import'](_0x2de3('0x4a'));db['Dashboard']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x4b'));db[_0x2de3('0x4c')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x4d'));db[_0x2de3('0x4e')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x4f'));db[_0x2de3('0x50')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x51'));db[_0x2de3('0x52')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/faxInteraction/faxInteraction.model');db[_0x2de3('0x53')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x54'));db['FaxQueue']=db[_0x2de3('0x1')]['import'](_0x2de3('0x55'));db['FaxQueueReport']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x56'));db['SmsAccount']=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/smsAccount/smsAccount.model');db[_0x2de3('0x57')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x58'));db['SmsInteraction']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x59'));db[_0x2de3('0x5a')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/smsMessage/smsMessage.model');db[_0x2de3('0x5b')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x5c'));db['OpenchannelAccount']=db[_0x2de3('0x1')]['import'](_0x2de3('0x5d'));db['OpenchannelApplication']=db['sequelize']['import']('../api/openchannelApplication/openchannelApplication.model');db[_0x2de3('0x5e')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x5f'));db[_0x2de3('0x60')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/openchannelMessage/openchannelMessage.model');db[_0x2de3('0x61')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x62'));db[_0x2de3('0x63')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x64'));db[_0x2de3('0x65')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x66'));db[_0x2de3('0x67')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/chatInteraction/chatInteraction.model');db[_0x2de3('0x68')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x69'));db[_0x2de3('0x6a')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x6b'));db['ChatQueue']=db['sequelize']['import'](_0x2de3('0x6c'));db[_0x2de3('0x6d')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x6e'));db[_0x2de3('0x6f')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x70'));db['CmCompany']=db['sequelize'][_0x2de3('0x18')]('../api/cmCompany/cmCompany.model');db[_0x2de3('0x71')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x72'));db[_0x2de3('0x73')]=db['sequelize'][_0x2de3('0x18')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0x2de3('0x1')]['import'](_0x2de3('0x74'));db['CmHopperFinal']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x75'));db[_0x2de3('0x76')]=db['sequelize']['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0x2de3('0x77')]=db['sequelize']['import'](_0x2de3('0x78'));db[_0x2de3('0x79')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x7a'));db[_0x2de3('0x7b')]=db['sequelize']['import']('../api/action/action.model');db['Automation']=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/automation/automation.model');db[_0x2de3('0x7c')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x7d'));db[_0x2de3('0x7e')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x7f'));db[_0x2de3('0x80')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x81'));db[_0x2de3('0x82')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x83'));db[_0x2de3('0x84')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x85'));db[_0x2de3('0x86')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x87'));db[_0x2de3('0x88')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x89'));db[_0x2de3('0x8a')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x8b'));db[_0x2de3('0x8c')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x8d'));db[_0x2de3('0x8e')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x8f'));db[_0x2de3('0x90')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x91'));db[_0x2de3('0x92')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x93'));db[_0x2de3('0x94')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x95'));db[_0x2de3('0x96')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x97'));db['AnalyticCustomReport']=db['sequelize'][_0x2de3('0x18')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x2de3('0x98')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x99'));db[_0x2de3('0x9a')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x9b'));db[_0x2de3('0x9c')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x9d'));db[_0x2de3('0x9e')]=db['sequelize']['import'](_0x2de3('0x9f'));db[_0x2de3('0xa0')]=db['sequelize'][_0x2de3('0x18')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x2de3('0xa1')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x2de3('0xa2')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xa3'));db[_0x2de3('0xa4')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xa5'));db[_0x2de3('0xa6')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0xa7'));db[_0x2de3('0xa8')]=db[_0x2de3('0x1')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x2de3('0xa9')]=db['sequelize'][_0x2de3('0x18')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x2de3('0xaa')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xab'));db[_0x2de3('0xac')]=db['sequelize']['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x2de3('0xad')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xae'));db['ZohoAccount']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xaf'));db[_0x2de3('0xb0')]=db[_0x2de3('0x1')]['import'](_0x2de3('0xb1'));db[_0x2de3('0xb2')]=db[_0x2de3('0x1')]['import'](_0x2de3('0xb3'));db[_0x2de3('0xb4')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db[_0x2de3('0x1')]['import'](_0x2de3('0xb5'));db[_0x2de3('0xb6')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xb7'));db['FreshdeskAccount']=db[_0x2de3('0x1')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x2de3('0x18')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x2de3('0xb8')]=db['sequelize'][_0x2de3('0x18')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x2de3('0xb9')]=db[_0x2de3('0x1')]['import'](_0x2de3('0xba'));db[_0x2de3('0xbb')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0xbc'));db[_0x2de3('0xbd')]=db['sequelize']['import'](_0x2de3('0xbe'));db[_0x2de3('0xbf')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0xc0'));db[_0x2de3('0xc1')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x2de3('0xc2')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xc3'));db[_0x2de3('0xc4')]=db[_0x2de3('0x1')]['import'](_0x2de3('0xc5'));db[_0x2de3('0xc6')]=db[_0x2de3('0x1')]['import'](_0x2de3('0xc7'));db[_0x2de3('0xc8')]=db['sequelize'][_0x2de3('0x18')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x2de3('0xc9')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x2de3('0xca')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0xcb'));db[_0x2de3('0xcc')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xcd'));db[_0x2de3('0x94')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x95'));db[_0x2de3('0xce')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xcf'));db[_0x2de3('0xd0')]=db[_0x2de3('0x1')]['import'](_0x2de3('0xd1'));db[_0x2de3('0xd2')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xd3'));db['JscriptyAnswerReport']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xd4'));db[_0x2de3('0xd5')]=db[_0x2de3('0x1')]['import'](_0x2de3('0xd6'));db['JscriptySessionReport']=db['sequelize']['import'](_0x2de3('0xd7'));db[_0x2de3('0xd8')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xd9'));db[_0x2de3('0xda')]=db['sequelize']['import']('../api/squareReport/squareReport.model');db[_0x2de3('0xdb')]=db[_0x2de3('0x1')]['import'](_0x2de3('0xdc'));db[_0x2de3('0xdd')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0xde'));db[_0x2de3('0xdf')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/setting/setting.model');db[_0x2de3('0xe0')]=db[_0x2de3('0x1')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x2de3('0xe1')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/squareProject/squareProject.model');db[_0x2de3('0xe2')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xe3'));db[_0x2de3('0xe4')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xe5'));db['License']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xe6'));db[_0x2de3('0xe7')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xe8'));db[_0x2de3('0xe9')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0xea'));db['Attachment']=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/attachment/attachment.model');db[_0x2de3('0xeb')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xec'));db[_0x2de3('0xed')]=db['sequelize'][_0x2de3('0x18')](_0x2de3('0xee'));db[_0x2de3('0xef')]=db['sequelize']['import'](_0x2de3('0xf0'));db[_0x2de3('0xf1')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xf2'));db[_0x2de3('0xf3')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db['sequelize'][_0x2de3('0x18')](_0x2de3('0xf4'));db[_0x2de3('0xf5')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xf6'));db[_0x2de3('0xf7')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xf8'));db['UserProfile']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xf9'));db[_0x2de3('0xfa')]=db['sequelize']['import'](_0x2de3('0xfb'));db['UserProfileResource']=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xfc'));db[_0x2de3('0xfd')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0xfe'));db[_0x2de3('0xff')]=db[_0x2de3('0x1')]['import'](_0x2de3('0x100'));db[_0x2de3('0x101')]=db['sequelize']['import'](_0x2de3('0x102'));db[_0x2de3('0x103')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x104'));db[_0x2de3('0x105')]=db['sequelize'][_0x2de3('0x18')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x106'));db['WhatsappTransferReport']=db['sequelize'][_0x2de3('0x18')](_0x2de3('0x107'));db[_0x2de3('0x108')]=db[_0x2de3('0x1')][_0x2de3('0x18')]('../api/whatsappQueue/whatsappQueue.model');db[_0x2de3('0x109')]=db['sequelize'][_0x2de3('0x18')]('../api/cloudProvider/cloudProvider.model');db[_0x2de3('0x10a')]=db[_0x2de3('0x1')][_0x2de3('0x18')](_0x2de3('0x10b'));db[_0x2de3('0x11')][_0x2de3('0x10c')](db[_0x2de3('0x1f')],{'as':_0x2de3('0x1f'),'onDelete':_0x2de3('0x10d'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x2de3('0x1b')],{'as':'Recordings','foreignKey':'UserId'});db['User']['hasMany'](db['UserVoiceQueueRt'],{'as':_0x2de3('0x10e'),'foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x11')]['hasMany'](db[_0x2de3('0x17')],{'as':_0x2de3('0x110'),'onDelete':'cascade','hooks':!![]});db['User'][_0x2de3('0x111')](db[_0x2de3('0x112')],{'as':'HopperFinals','foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x11')]['hasMany'](db[_0x2de3('0x76')],{'as':_0x2de3('0x113'),'foreignKey':_0x2de3('0x10f')});db['User'][_0x2de3('0x111')](db[_0x2de3('0x77')],{'as':_0x2de3('0x77'),'foreignKey':_0x2de3('0x10f')});db['User'][_0x2de3('0x111')](db[_0x2de3('0x5e')],{'as':_0x2de3('0x114'),'foreignKey':'UserId'});db['User'][_0x2de3('0x111')](db[_0x2de3('0x67')],{'as':_0x2de3('0x115'),'foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x11')][_0x2de3('0x111')](db[_0x2de3('0x116')],{'as':'SmsInteractions','foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x11')]['hasMany'](db[_0x2de3('0x52')],{'as':_0x2de3('0x117'),'foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x11')][_0x2de3('0x111')](db[_0x2de3('0x47')],{'as':_0x2de3('0x118'),'foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x11')]['hasMany'](db[_0x2de3('0x103')],{'as':'WhatsappInteractions','foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x11')]['hasMany'](db['UserNotification'],{'as':'UserNotifications','foreignKey':_0x2de3('0x119')});db['User'][_0x2de3('0x11a')](db[_0x2de3('0x11b')],{'as':_0x2de3('0x11b'),'foreignKey':_0x2de3('0x11c')});db['User']['belongsToMany'](db[_0x2de3('0x6d')],{'as':_0x2de3('0x11d'),'through':_0x2de3('0x11e')});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0x71')],{'as':_0x2de3('0x120'),'through':_0x2de3('0x121')});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0xf5')],{'as':'Lists','through':_0x2de3('0x122')});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0xe4')],{'through':_0x2de3('0x123')});db[_0x2de3('0x11')][_0x2de3('0x11f')](db['MailInteraction'],{'as':_0x2de3('0x118'),'through':_0x2de3('0x124')});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0x67')],{'as':_0x2de3('0x115'),'through':'user_has_chat_interactions'});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0x52')],{'as':_0x2de3('0x117'),'through':_0x2de3('0x125')});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0x116')],{'as':_0x2de3('0x126'),'through':_0x2de3('0x127')});db[_0x2de3('0x11')]['belongsToMany'](db[_0x2de3('0x5e')],{'as':_0x2de3('0x114'),'through':_0x2de3('0x128')});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0x103')],{'as':_0x2de3('0x129'),'through':_0x2de3('0x12a')});db['User']['belongsToMany'](db['VoiceQueue'],{'as':_0x2de3('0x12b'),'through':_0x2de3('0x31'),'required':![]});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0x43')],{'as':'MailQueues','through':'UserMailQueue','required':![]});db['User'][_0x2de3('0x11f')](db[_0x2de3('0x12c')],{'as':_0x2de3('0x12d'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0x12e')],{'as':_0x2de3('0x12f'),'through':_0x2de3('0x130'),'required':![]});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0x5b')],{'as':_0x2de3('0x131'),'through':_0x2de3('0x37'),'required':![]});db[_0x2de3('0x11')]['belongsToMany'](db['OpenchannelQueue'],{'as':_0x2de3('0x132'),'through':_0x2de3('0x39'),'required':![]});db[_0x2de3('0x11')][_0x2de3('0x11f')](db['WhatsappQueue'],{'as':_0x2de3('0x133'),'through':'UserWhatsappQueue','required':![]});db[_0x2de3('0x11')][_0x2de3('0x11f')](db['CmList'],{'through':_0x2de3('0x122')});db[_0x2de3('0x11')]['belongsToMany'](db[_0x2de3('0xf7')],{'as':_0x2de3('0x134'),'through':_0x2de3('0x135'),'required':![]});db['User'][_0x2de3('0x11f')](db[_0x2de3('0x63')],{'as':'ChatWebsites','through':_0x2de3('0x136')});db[_0x2de3('0x11')][_0x2de3('0x11f')](db['FaxAccount'],{'as':_0x2de3('0x137'),'through':_0x2de3('0x138')});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0x41')],{'as':'MailAccounts','through':_0x2de3('0x139')});db[_0x2de3('0x11')]['belongsToMany'](db[_0x2de3('0x13a')],{'as':_0x2de3('0x13b'),'through':_0x2de3('0x13c')});db[_0x2de3('0x11')][_0x2de3('0x11f')](db['SmsAccount'],{'as':_0x2de3('0x13d'),'through':'user_has_sms_accounts'});db[_0x2de3('0x11')][_0x2de3('0x11f')](db['WhatsappAccount'],{'as':_0x2de3('0x13e'),'through':_0x2de3('0x13f')});db[_0x2de3('0x11')][_0x2de3('0x11f')](db[_0x2de3('0xe1')],{'as':'SquareProjects','through':'user_has_square_projects'});db['VoiceChanSpy'][_0x2de3('0x111')](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x2de3('0x140')});db[_0x2de3('0x15')][_0x2de3('0x111')](db[_0x2de3('0x17')],{'onDelete':'cascade'});db[_0x2de3('0x17')]['hasMany'](db['VoiceExtension'],{'as':_0x2de3('0x141'),'onDelete':_0x2de3('0x10d')});db[_0x2de3('0x142')][_0x2de3('0x11f')](db[_0x2de3('0x8a')],{'as':'Sounds','through':'moh_has_sounds'});db['VoiceQueue'][_0x2de3('0x111')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0x2de3('0x143')});db['VoiceQueue'][_0x2de3('0x111')](db['CmHopper'],{'as':_0x2de3('0x144'),'foreignKey':'VoiceQueueId'});db[_0x2de3('0x145')][_0x2de3('0x111')](db[_0x2de3('0x112')],{'as':'HopperFinals','foreignKey':_0x2de3('0x143')});db['VoiceQueue'][_0x2de3('0x111')](db[_0x2de3('0x76')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db[_0x2de3('0x145')][_0x2de3('0x111')](db[_0x2de3('0x77')],{'as':_0x2de3('0x77'),'foreignKey':'VoiceQueueId'});db[_0x2de3('0x145')][_0x2de3('0x111')](db[_0x2de3('0x146')],{'as':_0x2de3('0x147'),'foreignKey':_0x2de3('0x143')});db[_0x2de3('0x145')][_0x2de3('0x111')](db[_0x2de3('0x148')],{'as':_0x2de3('0x149'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x2de3('0x11a')](db[_0x2de3('0x2b')],{'as':_0x2de3('0x2b'),'foreignKey':'TrunkId'});db[_0x2de3('0x145')][_0x2de3('0x11a')](db[_0x2de3('0x2b')],{'as':'TrunkBackup','foreignKey':_0x2de3('0x14a')});db[_0x2de3('0x145')]['belongsTo'](db[_0x2de3('0x82')],{'as':_0x2de3('0x82'),'foreignKey':_0x2de3('0x14b')});db['VoiceQueue'][_0x2de3('0x11a')](db[_0x2de3('0x84')],{'as':_0x2de3('0x14c'),'foreignKey':_0x2de3('0x14d')});db['VoiceQueue'][_0x2de3('0x11f')](db[_0x2de3('0xf5')],{'as':'Lists','through':_0x2de3('0x14e')});db['VoiceQueue'][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x14f'),'through':'UserVoiceQueue'});db[_0x2de3('0x145')]['belongsToMany'](db[_0x2de3('0xe4')],{'as':'Teams','through':'TeamVoiceQueue'});db['VoiceQueue'][_0x2de3('0x11f')](db['CmList'],{'as':_0x2de3('0x150'),'through':_0x2de3('0x151')});db[_0x2de3('0x1b')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'as':'User','foreignKey':'UserId'});db['ScreenRecording'][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'as':_0x2de3('0x11'),'foreignKey':_0x2de3('0x10f')});db['VoiceMail'][_0x2de3('0x111')](db[_0x2de3('0x21')],{'as':_0x2de3('0x152'),'onDelete':'cascade','foreignKey':_0x2de3('0x153'),'sourceKey':_0x2de3('0x154')});db[_0x2de3('0x21')]['belongsTo'](db[_0x2de3('0x1f')],{'foreignKey':_0x2de3('0x153'),'targetKey':_0x2de3('0x154')});db[_0x2de3('0x22')][_0x2de3('0x111')](db[_0x2de3('0x27')],{'as':_0x2de3('0x155'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['hasMany'](db[_0x2de3('0x25')],{'as':'AgentReports','foreignKey':_0x2de3('0x156'),'constraints':![]});db[_0x2de3('0x22')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'as':_0x2de3('0x11'),'foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x22')][_0x2de3('0x11a')](db['CmContact'],{'as':_0x2de3('0x157'),'foreignKey':_0x2de3('0x158')});db[_0x2de3('0x3d')][_0x2de3('0x11a')](db[_0x2de3('0x41')],{'as':_0x2de3('0x41'),'foreignKey':_0x2de3('0x159')});db[_0x2de3('0x3f')]['belongsTo'](db[_0x2de3('0x41')],{'as':_0x2de3('0x41'),'foreignKey':_0x2de3('0x159')});db['MailAccount']['hasOne'](db[_0x2de3('0x3d')],{'as':'Imap','onDelete':_0x2de3('0x10d')});db['MailAccount'][_0x2de3('0x10c')](db[_0x2de3('0x3f')],{'as':_0x2de3('0x15a'),'onDelete':_0x2de3('0x10d')});db[_0x2de3('0x41')][_0x2de3('0x111')](db[_0x2de3('0x7e')],{'as':'Dispositions','foreignKey':_0x2de3('0x159')});db['MailAccount'][_0x2de3('0x111')](db[_0x2de3('0x7c')],{'as':_0x2de3('0x15b'),'foreignKey':_0x2de3('0x159')});db[_0x2de3('0x41')][_0x2de3('0x111')](db[_0x2de3('0x15c')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0x2de3('0x41')][_0x2de3('0x111')](db[_0x2de3('0x47')],{'as':'Interactions'});db[_0x2de3('0x41')][_0x2de3('0x111')](db[_0x2de3('0x49')],{'as':_0x2de3('0x141')});db[_0x2de3('0x41')][_0x2de3('0x11a')](db[_0x2de3('0xf5')],{'as':_0x2de3('0x15d'),'foreignKey':_0x2de3('0x15e')});db['MailAccount'][_0x2de3('0x11a')](db[_0x2de3('0x8e')],{'as':'Template','foreignKey':_0x2de3('0x15f')});db[_0x2de3('0x41')][_0x2de3('0x11a')](db['Pause'],{'as':_0x2de3('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2de3('0x41')][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':'Agents','through':_0x2de3('0x139')});db['MailQueue'][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x14f'),'through':'UserMailQueue'});db[_0x2de3('0x43')][_0x2de3('0x11f')](db[_0x2de3('0xe4')],{'through':_0x2de3('0x160'),'as':'Teams'});db['MailInteraction']['hasMany'](db[_0x2de3('0x15c')],{'as':'Messages','onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x161')});db[_0x2de3('0x47')][_0x2de3('0x11a')](db[_0x2de3('0x41')],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x159')});db['MailInteraction'][_0x2de3('0x11a')](db[_0x2de3('0x71')],{'as':'Contact','foreignKey':'ContactId'});db[_0x2de3('0x47')]['belongsTo'](db[_0x2de3('0x11')],{'as':_0x2de3('0x163'),'foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x47')][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':'mail_interaction_has_tags','as':_0x2de3('0x164')});db[_0x2de3('0x47')][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':_0x2de3('0x165'),'as':_0x2de3('0x166')});db[_0x2de3('0x47')][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x167'),'through':_0x2de3('0x124'),'foreignKey':_0x2de3('0x161')});db[_0x2de3('0x15c')][_0x2de3('0x111')](db[_0x2de3('0x168')],{'as':_0x2de3('0x169'),'onDelete':_0x2de3('0x10d')});db[_0x2de3('0x15c')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'as':'User'});db['MailMessage'][_0x2de3('0x11a')](db[_0x2de3('0x71')],{'onDelete':_0x2de3('0x10d'),'as':'Contact'});db[_0x2de3('0x15c')][_0x2de3('0x11a')](db[_0x2de3('0x47')],{'as':_0x2de3('0x16a'),'foreignKey':_0x2de3('0x161')});db[_0x2de3('0x15c')][_0x2de3('0x11a')](db['MailAccount'],{'as':'Account','foreignKey':'MailAccountId'});db['MailMessage'][_0x2de3('0x11a')](db[_0x2de3('0x63')],{'as':_0x2de3('0x63'),'foreignKey':'ChatWebsiteId'});db[_0x2de3('0x15c')]['belongsTo'](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x2de3('0x16b')});db['MailApplication'][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'onDelete':_0x2de3('0x16c')});db[_0x2de3('0x49')][_0x2de3('0x11a')](db[_0x2de3('0x43')],{'onDelete':_0x2de3('0x16c')});db[_0x2de3('0x49')][_0x2de3('0x11a')](db[_0x2de3('0x41')],{'onDelete':_0x2de3('0x16c')});db[_0x2de3('0x49')][_0x2de3('0x11a')](db['Interval'],{'onDelete':_0x2de3('0x16c'),'foreignKey':_0x2de3('0x14b')});db[_0x2de3('0x49')][_0x2de3('0x11a')](db[_0x2de3('0x8c')],{'onDelete':_0x2de3('0x16c'),'foreignKey':'TagId'});db[_0x2de3('0x16d')][_0x2de3('0x11a')](db[_0x2de3('0x41')],{});db[_0x2de3('0x16d')][_0x2de3('0x11a')](db[_0x2de3('0xf5')],{'as':_0x2de3('0x15d'),'foreignKey':_0x2de3('0x15e')});db['MailQueueReport'][_0x2de3('0x11a')](db['CmContact'],{'as':'Contact','foreignKey':_0x2de3('0x158')});db[_0x2de3('0x16d')][_0x2de3('0x11a')](db[_0x2de3('0x47')],{});db[_0x2de3('0x16d')][_0x2de3('0x11a')](db[_0x2de3('0x15c')],{});db[_0x2de3('0x16d')][_0x2de3('0x11a')](db['User'],{});db[_0x2de3('0x16d')]['belongsTo'](db[_0x2de3('0x43')],{});db[_0x2de3('0x16e')][_0x2de3('0x111')](db[_0x2de3('0x4c')],{'as':_0x2de3('0x16f'),'onDelete':'cascade'});db[_0x2de3('0x4e')][_0x2de3('0x111')](db[_0x2de3('0x7e')],{'as':_0x2de3('0x170'),'foreignKey':_0x2de3('0x171')});db[_0x2de3('0x4e')][_0x2de3('0x111')](db[_0x2de3('0x7c')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0x2de3('0x4e')][_0x2de3('0x111')](db[_0x2de3('0x52')],{'as':_0x2de3('0x172')});db[_0x2de3('0x4e')][_0x2de3('0x111')](db['FaxApplication'],{'as':_0x2de3('0x141')});db[_0x2de3('0x4e')][_0x2de3('0x111')](db[_0x2de3('0x17')],{'as':'Exntensions','onDelete':_0x2de3('0x10d')});db['FaxAccount']['hasMany'](db[_0x2de3('0x53')],{'as':'Messages'});db[_0x2de3('0x4e')][_0x2de3('0x11a')](db['Trunk'],{'as':_0x2de3('0x2b')});db[_0x2de3('0x4e')][_0x2de3('0x11a')](db[_0x2de3('0xf5')],{'as':'List','foreignKey':_0x2de3('0x15e')});db[_0x2de3('0x4e')][_0x2de3('0x11a')](db[_0x2de3('0x84')],{'as':_0x2de3('0x14c'),'foreignKey':_0x2de3('0x14d')});db[_0x2de3('0x4e')][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x14f'),'through':_0x2de3('0x138')});db[_0x2de3('0x50')]['belongsTo'](db['User'],{'onDelete':_0x2de3('0x16c')});db[_0x2de3('0x50')][_0x2de3('0x11a')](db[_0x2de3('0x12e')],{'onDelete':_0x2de3('0x16c')});db['FaxApplication'][_0x2de3('0x11a')](db[_0x2de3('0x4e')],{'onDelete':_0x2de3('0x16c')});db['FaxApplication'][_0x2de3('0x11a')](db[_0x2de3('0x8c')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x2de3('0x52')][_0x2de3('0x111')](db[_0x2de3('0x53')],{'as':_0x2de3('0x152'),'onDelete':_0x2de3('0x10d'),'foreignKey':'FaxInteractionId'});db[_0x2de3('0x52')][_0x2de3('0x11a')](db['FaxAccount'],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x171')});db[_0x2de3('0x52')]['belongsTo'](db[_0x2de3('0x71')],{'as':'Contact','foreignKey':_0x2de3('0x158')});db['FaxInteraction'][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'as':'Owner','foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x52')][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':_0x2de3('0x173'),'as':_0x2de3('0x164')});db[_0x2de3('0x52')][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':_0x2de3('0x173'),'as':'ThroughTags'});db[_0x2de3('0x52')][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x167'),'through':_0x2de3('0x125'),'foreignKey':_0x2de3('0x174')});db[_0x2de3('0x53')][_0x2de3('0x11a')](db['User'],{'onDelete':_0x2de3('0x10d'),'as':_0x2de3('0x11')});db[_0x2de3('0x53')][_0x2de3('0x11a')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0x2de3('0x174')});db[_0x2de3('0x53')]['belongsTo'](db[_0x2de3('0x71')],{'onDelete':_0x2de3('0x10d'),'as':_0x2de3('0x157')});db['FaxMessage']['belongsTo'](db[_0x2de3('0x168')],{'as':_0x2de3('0x168'),'foreignKey':_0x2de3('0x175')});db[_0x2de3('0x53')][_0x2de3('0x11a')](db[_0x2de3('0x4e')],{'as':_0x2de3('0x162'),'foreignKey':'FaxAccountId'});db[_0x2de3('0x12e')][_0x2de3('0x11f')](db['User'],{'as':_0x2de3('0x14f'),'through':_0x2de3('0x130')});db[_0x2de3('0x12e')][_0x2de3('0x11f')](db[_0x2de3('0xe4')],{'through':_0x2de3('0x176'),'as':_0x2de3('0x177')});db[_0x2de3('0x178')][_0x2de3('0x11a')](db[_0x2de3('0x4e')],{});db['FaxQueueReport'][_0x2de3('0x11a')](db['CmList'],{'as':_0x2de3('0x15d'),'foreignKey':'ListId'});db[_0x2de3('0x178')][_0x2de3('0x11a')](db[_0x2de3('0x71')],{'as':_0x2de3('0x157'),'foreignKey':_0x2de3('0x158')});db[_0x2de3('0x178')]['belongsTo'](db[_0x2de3('0x52')],{});db[_0x2de3('0x178')]['belongsTo'](db[_0x2de3('0x53')],{});db[_0x2de3('0x178')][_0x2de3('0x11a')](db['User'],{});db[_0x2de3('0x178')]['belongsTo'](db[_0x2de3('0x12e')],{});db[_0x2de3('0x179')][_0x2de3('0x111')](db['Disposition'],{'as':_0x2de3('0x170'),'foreignKey':_0x2de3('0x17a')});db[_0x2de3('0x179')][_0x2de3('0x111')](db[_0x2de3('0x7c')],{'as':_0x2de3('0x15b'),'foreignKey':_0x2de3('0x17a')});db[_0x2de3('0x179')][_0x2de3('0x111')](db[_0x2de3('0x5a')],{'as':_0x2de3('0x152'),'foreignKey':_0x2de3('0x17a')});db[_0x2de3('0x179')][_0x2de3('0x111')](db['SmsInteraction'],{'as':_0x2de3('0x172')});db[_0x2de3('0x179')][_0x2de3('0x111')](db[_0x2de3('0x57')],{'as':_0x2de3('0x141')});db['SmsAccount'][_0x2de3('0x11a')](db[_0x2de3('0xf5')],{'as':_0x2de3('0x15d'),'foreignKey':_0x2de3('0x15e')});db[_0x2de3('0x179')][_0x2de3('0x11a')](db[_0x2de3('0x84')],{'as':_0x2de3('0x14c'),'foreignKey':_0x2de3('0x14d')});db[_0x2de3('0x179')][_0x2de3('0x11f')](db['User'],{'as':_0x2de3('0x14f'),'through':_0x2de3('0x17b')});db[_0x2de3('0x57')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'onDelete':'restrict'});db[_0x2de3('0x57')][_0x2de3('0x11a')](db[_0x2de3('0x5b')],{'onDelete':_0x2de3('0x16c')});db['SmsApplication'][_0x2de3('0x11a')](db[_0x2de3('0x179')],{'onDelete':_0x2de3('0x16c')});db['SmsApplication'][_0x2de3('0x11a')](db['Interval'],{'onDelete':_0x2de3('0x16c'),'foreignKey':_0x2de3('0x14b')});db[_0x2de3('0x57')][_0x2de3('0x11a')](db[_0x2de3('0x8c')],{'onDelete':_0x2de3('0x16c'),'foreignKey':_0x2de3('0x17c')});db[_0x2de3('0x116')]['hasMany'](db[_0x2de3('0x5a')],{'as':_0x2de3('0x152'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x17d')});db[_0x2de3('0x116')][_0x2de3('0x11a')](db[_0x2de3('0x179')],{'as':'Account','foreignKey':_0x2de3('0x17a')});db['SmsInteraction']['belongsTo'](db[_0x2de3('0x71')],{'as':_0x2de3('0x157'),'foreignKey':_0x2de3('0x158')});db[_0x2de3('0x116')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'as':_0x2de3('0x163'),'foreignKey':'UserId'});db[_0x2de3('0x116')][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':_0x2de3('0x17e'),'as':_0x2de3('0x164')});db[_0x2de3('0x116')][_0x2de3('0x11f')](db['Tag'],{'through':_0x2de3('0x17e'),'as':_0x2de3('0x166')});db[_0x2de3('0x116')][_0x2de3('0x11f')](db['User'],{'as':_0x2de3('0x167'),'through':_0x2de3('0x127'),'foreignKey':_0x2de3('0x17d')});db['SmsMessage'][_0x2de3('0x11a')](db['User'],{'as':_0x2de3('0x11')});db[_0x2de3('0x5a')][_0x2de3('0x11a')](db['CmContact'],{'onDelete':_0x2de3('0x10d'),'as':_0x2de3('0x157')});db['SmsMessage'][_0x2de3('0x11a')](db[_0x2de3('0x116')],{'onDelete':'cascade','as':_0x2de3('0x16a'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x2de3('0x11a')](db['SmsAccount'],{'as':'Account','foreignKey':_0x2de3('0x17a')});db[_0x2de3('0x5b')][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x14f'),'through':_0x2de3('0x37'),'foreignKey':_0x2de3('0x17f')});db[_0x2de3('0x5b')][_0x2de3('0x11f')](db[_0x2de3('0xe4')],{'through':_0x2de3('0x180'),'as':_0x2de3('0x177')});db['OpenchannelAccount']['hasMany'](db[_0x2de3('0x7e')],{'as':_0x2de3('0x170'),'foreignKey':_0x2de3('0x181')});db[_0x2de3('0x13a')]['hasMany'](db[_0x2de3('0x7c')],{'as':_0x2de3('0x15b'),'foreignKey':_0x2de3('0x181')});db['OpenchannelAccount'][_0x2de3('0x111')](db[_0x2de3('0x5e')],{'as':_0x2de3('0x172'),'foreignKey':_0x2de3('0x181')});db['OpenchannelAccount']['hasMany'](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0x2de3('0x181')});db[_0x2de3('0x13a')][_0x2de3('0x111')](db[_0x2de3('0x182')],{'as':_0x2de3('0x141'),'foreignKey':_0x2de3('0x181')});db[_0x2de3('0x13a')][_0x2de3('0x11a')](db[_0x2de3('0xf5')],{'as':_0x2de3('0x15d'),'foreignKey':_0x2de3('0x15e')});db[_0x2de3('0x13a')][_0x2de3('0x11a')](db[_0x2de3('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0x2de3('0x14d')});db[_0x2de3('0x13a')][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x14f'),'through':_0x2de3('0x13c')});db[_0x2de3('0x182')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'onDelete':'restrict'});db[_0x2de3('0x182')][_0x2de3('0x11a')](db[_0x2de3('0x61')],{'onDelete':_0x2de3('0x16c'),'foreignKey':_0x2de3('0x183')});db[_0x2de3('0x182')][_0x2de3('0x11a')](db[_0x2de3('0x13a')],{'onDelete':_0x2de3('0x16c'),'foreignKey':_0x2de3('0x181')});db[_0x2de3('0x182')][_0x2de3('0x11a')](db[_0x2de3('0x82')],{'onDelete':_0x2de3('0x16c'),'foreignKey':_0x2de3('0x14b')});db[_0x2de3('0x182')]['belongsTo'](db[_0x2de3('0x8c')],{'onDelete':_0x2de3('0x16c'),'foreignKey':'TagId'});db[_0x2de3('0x5e')][_0x2de3('0x111')](db[_0x2de3('0x60')],{'as':_0x2de3('0x152'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x184')});db['OpenchannelInteraction'][_0x2de3('0x11a')](db[_0x2de3('0x13a')],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x181')});db[_0x2de3('0x5e')][_0x2de3('0x11a')](db[_0x2de3('0x71')],{'as':'Contact','foreignKey':'ContactId'});db[_0x2de3('0x5e')]['belongsTo'](db[_0x2de3('0x11')],{'as':_0x2de3('0x163'),'foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x5e')]['belongsToMany'](db[_0x2de3('0x8c')],{'through':'openchannel_interaction_has_tags','as':_0x2de3('0x164')});db[_0x2de3('0x5e')][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':_0x2de3('0x185'),'as':_0x2de3('0x166')});db['OpenchannelInteraction'][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x167'),'through':_0x2de3('0x128'),'foreignKey':_0x2de3('0x184')});db['OpenchannelMessage'][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'onDelete':_0x2de3('0x10d'),'as':'User'});db[_0x2de3('0x60')][_0x2de3('0x11a')](db['CmContact'],{'onDelete':_0x2de3('0x10d'),'as':_0x2de3('0x157')});db[_0x2de3('0x60')][_0x2de3('0x11a')](db[_0x2de3('0x5e')],{'onDelete':_0x2de3('0x10d'),'as':_0x2de3('0x16a'),'foreignKey':_0x2de3('0x184')});db[_0x2de3('0x60')]['belongsTo'](db['Attachment'],{'as':_0x2de3('0x168'),'foreignKey':_0x2de3('0x175')});db['OpenchannelMessage'][_0x2de3('0x11a')](db[_0x2de3('0x13a')],{'as':_0x2de3('0x162'),'foreignKey':'OpenchannelAccountId'});db[_0x2de3('0x61')][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x14f'),'through':_0x2de3('0x39'),'foreignKey':'OpenchannelQueueId'});db[_0x2de3('0x61')][_0x2de3('0x11f')](db[_0x2de3('0xe4')],{'through':_0x2de3('0x186'),'as':_0x2de3('0x177')});db[_0x2de3('0x63')][_0x2de3('0x111')](db['Disposition'],{'as':_0x2de3('0x170'),'foreignKey':_0x2de3('0x187')});db['ChatWebsite'][_0x2de3('0x111')](db[_0x2de3('0x7c')],{'as':'Answers','foreignKey':'ChatWebsiteId'});db[_0x2de3('0x63')]['hasMany'](db[_0x2de3('0x6f')],{'as':_0x2de3('0x188')});db[_0x2de3('0x63')][_0x2de3('0x111')](db[_0x2de3('0x67')],{'as':_0x2de3('0x172')});db['ChatWebsite'][_0x2de3('0x111')](db['ChatApplication'],{'as':_0x2de3('0x141')});db[_0x2de3('0x63')]['hasMany'](db['ChatMessage'],{'as':_0x2de3('0x152')});db[_0x2de3('0x63')][_0x2de3('0x11a')](db['CmList'],{'as':'List','foreignKey':_0x2de3('0x15e')});db[_0x2de3('0x63')][_0x2de3('0x11a')](db[_0x2de3('0x82')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x2de3('0x63')][_0x2de3('0x11a')](db[_0x2de3('0x41')],{'as':_0x2de3('0x41'),'foreignKey':_0x2de3('0x159')});db[_0x2de3('0x63')][_0x2de3('0x11a')](db['Pause'],{'as':_0x2de3('0x14c'),'foreignKey':_0x2de3('0x14d')});db[_0x2de3('0x63')][_0x2de3('0x11f')](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db[_0x2de3('0x189')][_0x2de3('0x11a')](db[_0x2de3('0x13a')],{});db[_0x2de3('0x189')][_0x2de3('0x11a')](db['CmList'],{'as':'List','foreignKey':_0x2de3('0x15e')});db[_0x2de3('0x189')][_0x2de3('0x11a')](db[_0x2de3('0x71')],{'as':_0x2de3('0x157'),'foreignKey':_0x2de3('0x158')});db['OpenchannelQueueReport'][_0x2de3('0x11a')](db[_0x2de3('0x5e')],{});db[_0x2de3('0x189')][_0x2de3('0x11a')](db[_0x2de3('0x60')],{});db['OpenchannelQueueReport'][_0x2de3('0x11a')](db[_0x2de3('0x11')],{});db[_0x2de3('0x189')][_0x2de3('0x11a')](db[_0x2de3('0x61')],{});db[_0x2de3('0x65')]['belongsTo'](db[_0x2de3('0x11')],{'as':_0x2de3('0x18a'),'foreignKey':_0x2de3('0x10f'),'onDelete':_0x2de3('0x16c')});db[_0x2de3('0x65')][_0x2de3('0x11a')](db[_0x2de3('0x12c')],{'as':_0x2de3('0x18b'),'foreignKey':'ChatQueueId','onDelete':_0x2de3('0x16c')});db[_0x2de3('0x65')][_0x2de3('0x11a')](db['ChatWebsite'],{'as':_0x2de3('0x18c'),'foreignKey':_0x2de3('0x187'),'onDelete':_0x2de3('0x16c')});db[_0x2de3('0x65')][_0x2de3('0x11a')](db[_0x2de3('0x8c')],{'onDelete':_0x2de3('0x16c'),'foreignKey':_0x2de3('0x17c')});db['ChatInteraction'][_0x2de3('0x111')](db[_0x2de3('0x68')],{'as':_0x2de3('0x152'),'onDelete':'cascade','foreignKey':_0x2de3('0x18d')});db['ChatInteraction'][_0x2de3('0x11a')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x2de3('0x67')][_0x2de3('0x11a')](db[_0x2de3('0x71')],{'as':_0x2de3('0x157'),'foreignKey':_0x2de3('0x158')});db[_0x2de3('0x67')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'as':_0x2de3('0x163'),'foreignKey':'UserId'});db['ChatInteraction'][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':_0x2de3('0x18e'),'as':'Tags'});db[_0x2de3('0x67')]['belongsToMany'](db[_0x2de3('0x8c')],{'through':_0x2de3('0x18e'),'as':'ThroughTags'});db['ChatInteraction'][_0x2de3('0x11f')](db['User'],{'as':_0x2de3('0x167'),'through':_0x2de3('0x18f'),'foreignKey':_0x2de3('0x18d')});db[_0x2de3('0x68')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'onDelete':_0x2de3('0x10d'),'as':_0x2de3('0x11')});db['ChatMessage'][_0x2de3('0x11a')](db[_0x2de3('0x71')],{'onDelete':'cascade','as':_0x2de3('0x157'),'foreignKey':_0x2de3('0x158')});db[_0x2de3('0x68')][_0x2de3('0x11a')](db[_0x2de3('0x67')],{'onDelete':_0x2de3('0x10d'),'as':'Interaction','foreignKey':_0x2de3('0x18d')});db['ChatMessage']['belongsTo'](db[_0x2de3('0x168')],{'as':'Attachment','foreignKey':_0x2de3('0x175')});db[_0x2de3('0x68')]['belongsTo'](db[_0x2de3('0x63')],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x187')});db[_0x2de3('0x6a')][_0x2de3('0x111')](db[_0x2de3('0x168')],{'as':_0x2de3('0x169'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x2de3('0x10d'),'hooks':!![]});db[_0x2de3('0x6a')][_0x2de3('0x11a')](db['CmContact'],{'onDelete':_0x2de3('0x10d'),'as':_0x2de3('0x157'),'foreignKey':'ContactId'});db[_0x2de3('0x6a')][_0x2de3('0x11a')](db[_0x2de3('0x63')],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x187')});db[_0x2de3('0x12c')]['belongsToMany'](db['User'],{'as':_0x2de3('0x14f'),'through':'UserChatQueue','hooks':!![]});db[_0x2de3('0x12c')]['belongsToMany'](db[_0x2de3('0xe4')],{'through':_0x2de3('0x190'),'as':_0x2de3('0x177')});db[_0x2de3('0x6d')][_0x2de3('0x111')](db[_0x2de3('0xd2')],{'as':_0x2de3('0x152'),'foreignKey':_0x2de3('0x191'),'onDelete':_0x2de3('0x10d')});db[_0x2de3('0x6d')][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':'Members','through':_0x2de3('0x11e')});db[_0x2de3('0x6f')][_0x2de3('0x11a')](db[_0x2de3('0x63')],{'as':_0x2de3('0x18c'),'foreignKey':_0x2de3('0x187')});db['CmCompany'][_0x2de3('0x111')](db[_0x2de3('0x71')],{'as':_0x2de3('0x120'),'foreignKey':_0x2de3('0x192')});db['CmContact'][_0x2de3('0x111')](db[_0x2de3('0x73')],{'as':_0x2de3('0x144'),'foreignKey':'ContactId'});db[_0x2de3('0x71')]['hasMany'](db[_0x2de3('0x112')],{'as':_0x2de3('0x193'),'foreignKey':_0x2de3('0x158')});db[_0x2de3('0x71')]['hasMany'](db['CmHopperHistory'],{'as':_0x2de3('0x194'),'foreignKey':'ContactId'});db[_0x2de3('0x71')][_0x2de3('0x111')](db[_0x2de3('0x77')],{'as':_0x2de3('0x77'),'foreignKey':'ContactId'});db['CmContact'][_0x2de3('0x111')](db[_0x2de3('0x148')],{'as':'JscriptySessions','foreignKey':_0x2de3('0x158')});db[_0x2de3('0x71')][_0x2de3('0x111')](db[_0x2de3('0x5e')],{'as':_0x2de3('0x114'),'foreignKey':_0x2de3('0x158'),'onDelete':'restrict'});db[_0x2de3('0x71')][_0x2de3('0x111')](db[_0x2de3('0x67')],{'as':_0x2de3('0x115'),'foreignKey':_0x2de3('0x158'),'onDelete':'restrict'});db['CmContact'][_0x2de3('0x111')](db[_0x2de3('0x116')],{'as':_0x2de3('0x126'),'foreignKey':'ContactId','onDelete':_0x2de3('0x16c')});db['CmContact'][_0x2de3('0x111')](db[_0x2de3('0x52')],{'as':'FaxInteractions','foreignKey':_0x2de3('0x158'),'onDelete':_0x2de3('0x16c')});db['CmContact'][_0x2de3('0x111')](db['MailInteraction'],{'as':_0x2de3('0x118'),'foreignKey':_0x2de3('0x158'),'onDelete':_0x2de3('0x16c')});db[_0x2de3('0x71')]['belongsTo'](db[_0x2de3('0x195')],{'as':'Company','foreignKey':'CompanyId'});db[_0x2de3('0x71')][_0x2de3('0x11a')](db[_0x2de3('0xf5')],{'as':'List','foreignKey':_0x2de3('0x15e'),'onDelete':'cascade'});db[_0x2de3('0x71')]['belongsToMany'](db[_0x2de3('0x11')],{'as':'Users','through':_0x2de3('0x121')});db[_0x2de3('0x71')][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'as':_0x2de3('0x164'),'through':'cm_contact_has_tags'});db[_0x2de3('0x71')]['belongsToMany'](db[_0x2de3('0x8c')],{'through':'cm_contact_has_tags','as':_0x2de3('0x166')});db[_0x2de3('0x73')][_0x2de3('0x11a')](db[_0x2de3('0x71')],{'as':_0x2de3('0x157'),'foreignKey':_0x2de3('0x158'),'onDelete':_0x2de3('0x10d')});db['CmHopper']['belongsTo'](db[_0x2de3('0xf5')],{'as':_0x2de3('0x15d'),'foreignKey':_0x2de3('0x15e'),'onDelete':_0x2de3('0x10d')});db['CmHopper'][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'as':_0x2de3('0x18a'),'foreignKey':'UserId'});db[_0x2de3('0x73')][_0x2de3('0x11a')](db[_0x2de3('0x145')],{'as':_0x2de3('0x18b'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x2de3('0x73')][_0x2de3('0x11a')](db[_0x2de3('0xe7')],{'as':_0x2de3('0xe7'),'foreignKey':_0x2de3('0x196'),'onDelete':'cascade'});db[_0x2de3('0x73')][_0x2de3('0x11a')](db['User'],{'as':'Owner','foreignKey':_0x2de3('0x197')});db[_0x2de3('0x146')]['belongsTo'](db[_0x2de3('0x71')],{'as':_0x2de3('0x157'),'foreignKey':_0x2de3('0x158'),'onDelete':'cascade'});db[_0x2de3('0x146')][_0x2de3('0x11a')](db['CmList'],{'as':'List','foreignKey':_0x2de3('0x15e'),'onDelete':_0x2de3('0x10d')});db[_0x2de3('0x146')][_0x2de3('0x11a')](db['VoiceQueue'],{'as':_0x2de3('0x18b'),'foreignKey':_0x2de3('0x143'),'onDelete':_0x2de3('0x10d')});db[_0x2de3('0x146')][_0x2de3('0x11a')](db['Campaign'],{'as':_0x2de3('0xe7'),'foreignKey':_0x2de3('0x196'),'onDelete':_0x2de3('0x10d')});db['Automation'][_0x2de3('0x111')](db[_0x2de3('0x80')],{'as':{'plural':'All','singular':_0x2de3('0x198')},'foreignKey':_0x2de3('0x199'),'onDelete':'cascade','hooks':!![]});db[_0x2de3('0x19a')][_0x2de3('0x111')](db[_0x2de3('0x80')],{'as':{'plural':_0x2de3('0x19b'),'singular':'OneAny'},'foreignKey':_0x2de3('0x19c'),'onDelete':'cascade','hooks':!![]});db[_0x2de3('0x19a')][_0x2de3('0x111')](db[_0x2de3('0x7b')],{'as':_0x2de3('0x19d'),'foreignKey':'AutomationId','onDelete':_0x2de3('0x10d'),'hooks':!![]});db[_0x2de3('0x7e')][_0x2de3('0x111')](db[_0x2de3('0x7e')],{'as':'Dispositions','foreignKey':_0x2de3('0x19e'),'onDelete':_0x2de3('0x10d')});db['Interval'][_0x2de3('0x111')](db[_0x2de3('0x82')],{'as':_0x2de3('0x19f'),'foreignKey':_0x2de3('0x14b'),'onDelete':_0x2de3('0x10d'),'hooks':!![],'required':![]});db[_0x2de3('0x82')][_0x2de3('0x111')](db[_0x2de3('0x17')],{'as':_0x2de3('0x110'),'foreignKey':_0x2de3('0x14b'),'onDelete':_0x2de3('0x16c')});db[_0x2de3('0x82')][_0x2de3('0x111')](db[_0x2de3('0x49')],{'as':_0x2de3('0x1a0'),'foreignKey':_0x2de3('0x14b')});db[_0x2de3('0x82')][_0x2de3('0x111')](db[_0x2de3('0x65')],{'as':_0x2de3('0x1a1'),'foreignKey':_0x2de3('0x14b')});db[_0x2de3('0x82')]['hasMany'](db['FaxApplication'],{'as':_0x2de3('0x1a2'),'foreignKey':_0x2de3('0x14b')});db[_0x2de3('0x82')][_0x2de3('0x111')](db['SmsApplication'],{'as':_0x2de3('0x1a3'),'foreignKey':'IntervalId'});db['Schedule']['belongsTo'](db[_0x2de3('0x41')],{});db[_0x2de3('0x1a4')][_0x2de3('0x11a')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db['Schedule'][_0x2de3('0x11a')](db[_0x2de3('0x1a5')],{'foreignKey':_0x2de3('0x1a6')});db[_0x2de3('0x8a')][_0x2de3('0x11f')](db[_0x2de3('0x142')],{'as':_0x2de3('0x1a7'),'through':_0x2de3('0x1a8'),'onDelete':_0x2de3('0x16c')});db['Tag'][_0x2de3('0x11f')](db[_0x2de3('0x71')],{'through':'cm_contact_has_tags'});db['Tag'][_0x2de3('0x11f')](db['ChatInteraction'],{'through':_0x2de3('0x18e')});db[_0x2de3('0x8c')][_0x2de3('0x11f')](db[_0x2de3('0x47')],{'through':'mail_interaction_has_tags'});db[_0x2de3('0x8c')][_0x2de3('0x11f')](db[_0x2de3('0x116')],{'through':_0x2de3('0x17e')});db[_0x2de3('0x8c')][_0x2de3('0x11f')](db[_0x2de3('0x52')],{'through':_0x2de3('0x173')});db[_0x2de3('0x8c')]['belongsToMany'](db[_0x2de3('0x5e')],{'through':_0x2de3('0x185')});db[_0x2de3('0x8c')][_0x2de3('0x11f')](db[_0x2de3('0x103')],{'through':_0x2de3('0x1a9')});db['Trigger']['hasMany'](db[_0x2de3('0x80')],{'as':{'plural':_0x2de3('0x1aa'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0x2de3('0x10d'),'hooks':!![]});db[_0x2de3('0x90')]['hasMany'](db[_0x2de3('0x80')],{'as':{'plural':_0x2de3('0x1ab'),'singular':_0x2de3('0x1ac')},'foreignKey':'TriggerAnyId','onDelete':_0x2de3('0x10d'),'hooks':!![]});db[_0x2de3('0x90')][_0x2de3('0x111')](db['Action'],{'as':_0x2de3('0x19d'),'foreignKey':_0x2de3('0x1ad'),'onDelete':_0x2de3('0x10d'),'hooks':!![]});db[_0x2de3('0x1a5')][_0x2de3('0x111')](db['AnalyticFieldReport'],{'as':_0x2de3('0x1ae'),'onDelete':_0x2de3('0x10d'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x2de3('0x98')][_0x2de3('0x111')](db[_0x2de3('0x9e')],{'as':_0x2de3('0x1ae'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1af')});db['AnalyticMetric'][_0x2de3('0x111')](db[_0x2de3('0x9e')],{'as':'Fields','onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b0')});db['AnalyticFieldReport'][_0x2de3('0x11a')](db[_0x2de3('0x9c')],{'foreignKey':_0x2de3('0x1b0')});db[_0x2de3('0xa1')][_0x2de3('0x111')](db[_0x2de3('0xa2')],{'as':_0x2de3('0x1b1'),'onDelete':_0x2de3('0x10d'),'foreignKey':'AccountId'});db[_0x2de3('0xa2')][_0x2de3('0x111')](db[_0x2de3('0xa4')],{'as':_0x2de3('0x1b2'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0xa2')][_0x2de3('0x111')](db['SalesforceField'],{'as':_0x2de3('0x1b4'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b5')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0x2de3('0x1ae'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0xa2')]['belongsTo'](db['SalesforceAccount'],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x1b7')});db[_0x2de3('0xa4')][_0x2de3('0x111')](db['SalesforceField'],{'as':_0x2de3('0x1b8'),'foreignKey':'SubjectId'});db[_0x2de3('0xa4')][_0x2de3('0x111')](db['SalesforceField'],{'as':'Description','foreignKey':_0x2de3('0x1b5')});db[_0x2de3('0xa4')][_0x2de3('0x111')](db[_0x2de3('0xa4')],{'as':_0x2de3('0x1b9'),'foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0xa4')]['belongsTo'](db[_0x2de3('0x92')],{'as':'Variable','foreignKey':_0x2de3('0x1ba')});db[_0x2de3('0xa6')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0x2de3('0x1b1'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b7')});db['SugarcrmConfiguration'][_0x2de3('0x111')](db[_0x2de3('0xa9')],{'as':_0x2de3('0x1b2'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0xa8')][_0x2de3('0x111')](db[_0x2de3('0xa9')],{'as':_0x2de3('0x1b4'),'onDelete':_0x2de3('0x10d'),'foreignKey':'DescriptionId'});db[_0x2de3('0xa8')][_0x2de3('0x111')](db[_0x2de3('0xa9')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x2de3('0x1b6')});db['SugarcrmConfiguration']['belongsTo'](db['SugarcrmAccount'],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x1b7')});db['SugarcrmField'][_0x2de3('0x111')](db['SugarcrmField'],{'as':_0x2de3('0x1b8'),'foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0xa9')]['hasMany'](db[_0x2de3('0xa9')],{'as':_0x2de3('0x1bb'),'foreignKey':_0x2de3('0x1b5')});db[_0x2de3('0xa9')][_0x2de3('0x111')](db['SugarcrmField'],{'as':_0x2de3('0x1b9'),'foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0xa9')][_0x2de3('0x11a')](db[_0x2de3('0x92')],{'as':'Variable','foreignKey':_0x2de3('0x1ba')});db[_0x2de3('0xaa')]['hasMany'](db['DeskConfiguration'],{'as':_0x2de3('0x1b1'),'onDelete':'cascade','foreignKey':_0x2de3('0x1b7')});db[_0x2de3('0xac')][_0x2de3('0x111')](db['DeskField'],{'as':_0x2de3('0x1b2'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0xac')][_0x2de3('0x111')](db[_0x2de3('0xad')],{'as':_0x2de3('0x1b4'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b5')});db['DeskConfiguration']['hasMany'](db[_0x2de3('0xad')],{'as':_0x2de3('0x1ae'),'onDelete':'cascade','foreignKey':_0x2de3('0x1b6')});db['DeskConfiguration'][_0x2de3('0x11a')](db[_0x2de3('0xaa')],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x1b7')});db['DeskConfiguration'][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':_0x2de3('0x1bc')});db[_0x2de3('0xad')][_0x2de3('0x111')](db['DeskField'],{'as':'Subject','foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0xad')][_0x2de3('0x111')](db[_0x2de3('0xad')],{'as':'Description','foreignKey':_0x2de3('0x1b5')});db['DeskField']['hasMany'](db[_0x2de3('0xad')],{'as':_0x2de3('0x1b9'),'foreignKey':'FieldId'});db[_0x2de3('0xad')][_0x2de3('0x11a')](db[_0x2de3('0x92')],{'as':_0x2de3('0x92'),'foreignKey':'VariableId'});db['ZohoAccount'][_0x2de3('0x111')](db[_0x2de3('0xb0')],{'as':_0x2de3('0x1b1'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b7')});db[_0x2de3('0xb0')]['hasMany'](db[_0x2de3('0xb2')],{'as':_0x2de3('0x1b2'),'onDelete':_0x2de3('0x10d'),'foreignKey':'SubjectId'});db[_0x2de3('0xb0')][_0x2de3('0x111')](db[_0x2de3('0xb2')],{'as':_0x2de3('0x1b4'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b5')});db[_0x2de3('0xb0')][_0x2de3('0x111')](db['ZohoField'],{'as':_0x2de3('0x1ae'),'onDelete':_0x2de3('0x10d'),'foreignKey':'FieldId'});db[_0x2de3('0xb0')]['belongsTo'](db[_0x2de3('0x1bd')],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x1b7')});db[_0x2de3('0xb2')]['hasMany'](db[_0x2de3('0xb2')],{'as':_0x2de3('0x1b8'),'foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0xb2')][_0x2de3('0x111')](db['ZohoField'],{'as':_0x2de3('0x1bb'),'foreignKey':_0x2de3('0x1b5')});db[_0x2de3('0xb2')][_0x2de3('0x111')](db['ZohoField'],{'as':_0x2de3('0x1b9'),'foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0xb2')]['belongsTo'](db[_0x2de3('0x92')],{'as':_0x2de3('0x92'),'foreignKey':_0x2de3('0x1ba')});db[_0x2de3('0xb4')][_0x2de3('0x111')](db[_0x2de3('0x1be')],{'as':'Configurations','onDelete':_0x2de3('0x10d'),'foreignKey':'AccountId'});db[_0x2de3('0x1be')][_0x2de3('0x111')](db[_0x2de3('0xb6')],{'as':_0x2de3('0x1b2'),'foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0x1be')][_0x2de3('0x111')](db[_0x2de3('0xb6')],{'as':_0x2de3('0x1b4'),'foreignKey':'DescriptionId'});db[_0x2de3('0x1be')]['hasMany'](db[_0x2de3('0xb6')],{'as':_0x2de3('0x1ae'),'foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0x1be')][_0x2de3('0x11a')](db['ZendeskAccount'],{'as':_0x2de3('0x162'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':_0x2de3('0x1bf')});db['ZendeskField'][_0x2de3('0x111')](db[_0x2de3('0xb6')],{'as':_0x2de3('0x1b8'),'foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0xb6')][_0x2de3('0x111')](db[_0x2de3('0xb6')],{'as':_0x2de3('0x1bb'),'foreignKey':_0x2de3('0x1b5')});db[_0x2de3('0xb6')][_0x2de3('0x111')](db[_0x2de3('0xb6')],{'as':_0x2de3('0x1b9'),'foreignKey':_0x2de3('0x1b6')});db['ZendeskField'][_0x2de3('0x11a')](db['Variable'],{'as':_0x2de3('0x92'),'foreignKey':'VariableId'});db[_0x2de3('0x1c0')][_0x2de3('0x111')](db[_0x2de3('0x1c1')],{'as':_0x2de3('0x1b1'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b7')});db[_0x2de3('0x1c1')]['hasMany'](db[_0x2de3('0xb8')],{'as':_0x2de3('0x1b2'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0x1c1')][_0x2de3('0x111')](db[_0x2de3('0xb8')],{'as':_0x2de3('0x1b4'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b5')});db[_0x2de3('0x1c1')]['hasMany'](db[_0x2de3('0xb8')],{'as':_0x2de3('0x1ae'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0x1c1')][_0x2de3('0x11a')](db[_0x2de3('0x1c0')],{'as':'Account','foreignKey':_0x2de3('0x1b7')});db[_0x2de3('0x1c1')][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x2de3('0xb8')][_0x2de3('0x111')](db['FreshdeskField'],{'as':_0x2de3('0x1b8'),'foreignKey':_0x2de3('0x1b3')});db['FreshdeskField'][_0x2de3('0x111')](db['FreshdeskField'],{'as':'Description','foreignKey':_0x2de3('0x1b5')});db[_0x2de3('0xb8')]['hasMany'](db['FreshdeskField'],{'as':_0x2de3('0x1b9'),'foreignKey':'FieldId'});db[_0x2de3('0xb8')]['belongsTo'](db[_0x2de3('0x92')],{'as':_0x2de3('0x92'),'foreignKey':_0x2de3('0x1ba')});db['VtigerAccount'][_0x2de3('0x111')](db[_0x2de3('0xbb')],{'as':_0x2de3('0x1b1'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b7')});db['VtigerConfiguration'][_0x2de3('0x111')](db[_0x2de3('0xbd')],{'as':_0x2de3('0x1b2'),'foreignKey':'SubjectId'});db[_0x2de3('0xbb')][_0x2de3('0x111')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0x2de3('0x1b5')});db[_0x2de3('0xbb')]['hasMany'](db[_0x2de3('0xbd')],{'as':_0x2de3('0x1ae'),'foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0xbb')]['belongsTo'](db['VtigerAccount'],{'as':_0x2de3('0x162'),'foreignKey':'AccountId'});db['VtigerField'][_0x2de3('0x111')](db[_0x2de3('0xbd')],{'as':_0x2de3('0x1b8'),'foreignKey':_0x2de3('0x1b3')});db['VtigerField'][_0x2de3('0x111')](db['VtigerField'],{'as':'Description','foreignKey':'DescriptionId'});db['VtigerField']['hasMany'](db[_0x2de3('0xbd')],{'as':_0x2de3('0x1b9'),'foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0xbd')]['belongsTo'](db[_0x2de3('0x92')],{'as':_0x2de3('0x92'),'foreignKey':_0x2de3('0x1ba')});db[_0x2de3('0xbf')][_0x2de3('0x111')](db[_0x2de3('0xc1')],{'as':_0x2de3('0x1b1'),'onDelete':'cascade','foreignKey':_0x2de3('0x1b7')});db['ServicenowConfiguration'][_0x2de3('0x111')](db[_0x2de3('0xc2')],{'as':_0x2de3('0x1b2'),'foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0xc1')][_0x2de3('0x111')](db[_0x2de3('0xc2')],{'as':_0x2de3('0x1b4'),'foreignKey':'DescriptionId'});db[_0x2de3('0xc1')][_0x2de3('0x111')](db[_0x2de3('0xc2')],{'as':'Fields','foreignKey':'FieldId'});db[_0x2de3('0xc1')]['belongsTo'](db['ServicenowAccount'],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x1b7')});db[_0x2de3('0xc2')][_0x2de3('0x111')](db[_0x2de3('0xc2')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x2de3('0xc2')][_0x2de3('0x111')](db[_0x2de3('0xc2')],{'as':_0x2de3('0x1bb'),'foreignKey':'DescriptionId'});db[_0x2de3('0xc2')][_0x2de3('0x111')](db[_0x2de3('0xc2')],{'as':'Field','foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0xc2')][_0x2de3('0x11a')](db['Variable'],{'as':_0x2de3('0x92'),'foreignKey':_0x2de3('0x1ba')});db['Dynamics365Account'][_0x2de3('0x111')](db[_0x2de3('0xc6')],{'as':'Configurations','onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b7')});db[_0x2de3('0xc6')][_0x2de3('0x111')](db[_0x2de3('0xc8')],{'as':_0x2de3('0x1b2'),'onDelete':'cascade','foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0xc6')][_0x2de3('0x111')](db[_0x2de3('0xc8')],{'as':_0x2de3('0x1b4'),'onDelete':_0x2de3('0x10d'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration']['hasMany'](db[_0x2de3('0xc8')],{'as':_0x2de3('0x1ae'),'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0xc6')][_0x2de3('0x11a')](db['Dynamics365Account'],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x1b7')});db[_0x2de3('0xc8')][_0x2de3('0x111')](db[_0x2de3('0xc8')],{'as':'Subject','foreignKey':_0x2de3('0x1b3')});db[_0x2de3('0xc8')][_0x2de3('0x111')](db[_0x2de3('0xc8')],{'as':_0x2de3('0x1bb'),'foreignKey':_0x2de3('0x1b5')});db[_0x2de3('0xc8')][_0x2de3('0x111')](db[_0x2de3('0xc8')],{'as':_0x2de3('0x1b9'),'foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0xc8')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x2de3('0x1ba')});db[_0x2de3('0xc9')][_0x2de3('0x111')](db['FreshsalesConfiguration'],{'as':_0x2de3('0x1b1'),'onDelete':'cascade','foreignKey':_0x2de3('0x1b7')});db[_0x2de3('0xca')][_0x2de3('0x111')](db[_0x2de3('0xcc')],{'as':_0x2de3('0x1b2'),'foreignKey':_0x2de3('0x1b3')});db['FreshsalesConfiguration'][_0x2de3('0x111')](db[_0x2de3('0xcc')],{'as':_0x2de3('0x1b4'),'foreignKey':_0x2de3('0x1b5')});db['FreshsalesConfiguration'][_0x2de3('0x111')](db[_0x2de3('0xcc')],{'as':'Fields','foreignKey':_0x2de3('0x1b6')});db[_0x2de3('0xca')][_0x2de3('0x11a')](db[_0x2de3('0xc9')],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x1b7')});db['FreshsalesField']['hasMany'](db[_0x2de3('0xcc')],{'as':_0x2de3('0x1b8'),'foreignKey':'SubjectId'});db[_0x2de3('0xcc')]['hasMany'](db[_0x2de3('0xcc')],{'as':_0x2de3('0x1bb'),'foreignKey':_0x2de3('0x1b5')});db[_0x2de3('0xcc')]['hasMany'](db[_0x2de3('0xcc')],{'as':_0x2de3('0x1b9'),'foreignKey':_0x2de3('0x1b6')});db['FreshsalesField'][_0x2de3('0x11a')](db[_0x2de3('0x92')],{'as':_0x2de3('0x92'),'foreignKey':_0x2de3('0x1ba')});db[_0x2de3('0xd0')][_0x2de3('0x11a')](db[_0x2de3('0x63')],{});db['ChatQueueReport'][_0x2de3('0x11a')](db[_0x2de3('0xf5')],{'as':'List','foreignKey':_0x2de3('0x15e')});db[_0x2de3('0xd0')][_0x2de3('0x11a')](db[_0x2de3('0x71')],{'as':_0x2de3('0x157'),'foreignKey':_0x2de3('0x158')});db[_0x2de3('0xd0')]['belongsTo'](db['ChatInteraction'],{});db[_0x2de3('0xd0')]['belongsTo'](db[_0x2de3('0x68')],{});db[_0x2de3('0xd0')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{});db['ChatQueueReport'][_0x2de3('0x11a')](db[_0x2de3('0x12c')],{});db[_0x2de3('0xd2')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'onDelete':_0x2de3('0x10d'),'foreignKey':_0x2de3('0x1c2')});db[_0x2de3('0xd2')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'onDelete':_0x2de3('0x10d'),'foreignKey':'ToId'});db[_0x2de3('0x148')][_0x2de3('0x111')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x2de3('0x148')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x2de3('0x1c3'),'onDelete':_0x2de3('0x10d')});db[_0x2de3('0xd8')][_0x2de3('0x11a')](db[_0x2de3('0x179')],{});db['SmsQueueReport'][_0x2de3('0x11a')](db[_0x2de3('0xf5')],{'as':_0x2de3('0x15d'),'foreignKey':_0x2de3('0x15e')});db[_0x2de3('0xd8')]['belongsTo'](db[_0x2de3('0x71')],{'as':_0x2de3('0x157'),'foreignKey':_0x2de3('0x158')});db[_0x2de3('0xd8')][_0x2de3('0x11a')](db[_0x2de3('0x116')],{});db[_0x2de3('0xd8')][_0x2de3('0x11a')](db[_0x2de3('0x5a')],{});db['SmsQueueReport']['belongsTo'](db[_0x2de3('0x11')],{});db[_0x2de3('0xd8')]['belongsTo'](db['SmsQueue'],{});db[_0x2de3('0xdd')][_0x2de3('0x111')](db[_0x2de3('0x148')],{'foreignKey':_0x2de3('0x1c4')});db[_0x2de3('0xdd')][_0x2de3('0x111')](db[_0x2de3('0xd5')],{'foreignKey':'ProjectId'});db[_0x2de3('0xdd')][_0x2de3('0x111')](db[_0x2de3('0x1c5')],{'foreignKey':_0x2de3('0x1c4')});db[_0x2de3('0xe1')][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':'Users','through':_0x2de3('0x1c6')});db['Team'][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x14f'),'through':'user_has_teams'});db['Team'][_0x2de3('0x11f')](db[_0x2de3('0x145')],{'through':'TeamVoiceQueue','as':_0x2de3('0x12b')});db[_0x2de3('0xe4')][_0x2de3('0x11f')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x2de3('0x1c7')});db['Team'][_0x2de3('0x11f')](db[_0x2de3('0x12c')],{'through':_0x2de3('0x190'),'as':_0x2de3('0x12d')});db[_0x2de3('0xe4')][_0x2de3('0x11f')](db[_0x2de3('0x12e')],{'through':_0x2de3('0x176'),'as':_0x2de3('0x12f')});db[_0x2de3('0xe4')][_0x2de3('0x11f')](db[_0x2de3('0x5b')],{'through':_0x2de3('0x180'),'as':_0x2de3('0x131')});db[_0x2de3('0xe4')][_0x2de3('0x11f')](db[_0x2de3('0x61')],{'through':_0x2de3('0x186'),'as':'OpenchannelQueues'});db[_0x2de3('0xe4')][_0x2de3('0x11f')](db['WhatsappQueue'],{'through':_0x2de3('0x1c8'),'as':_0x2de3('0x133')});db[_0x2de3('0xe7')]['hasMany'](db[_0x2de3('0x73')],{'as':'Hoppers','foreignKey':_0x2de3('0x196')});db[_0x2de3('0xe7')][_0x2de3('0x111')](db[_0x2de3('0x112')],{'as':_0x2de3('0x193'),'foreignKey':_0x2de3('0x196')});db[_0x2de3('0xe7')][_0x2de3('0x111')](db[_0x2de3('0x76')],{'as':_0x2de3('0x194'),'foreignKey':'CampaignId'});db[_0x2de3('0xe7')]['hasMany'](db['CmHopperBlack'],{'as':_0x2de3('0x147'),'foreignKey':'CampaignId'});db[_0x2de3('0xe7')][_0x2de3('0x11a')](db['Trunk'],{'as':'Trunk','foreignKey':_0x2de3('0x1c9')});db[_0x2de3('0xe7')]['belongsTo'](db[_0x2de3('0x2b')],{'as':_0x2de3('0x1ca'),'foreignKey':_0x2de3('0x14a')});db[_0x2de3('0xe7')]['belongsTo'](db[_0x2de3('0x82')],{'as':_0x2de3('0x82'),'foreignKey':'IntervalId'});db[_0x2de3('0xe7')][_0x2de3('0x11a')](db[_0x2de3('0xe1')],{'as':'SquareProject','foreignKey':_0x2de3('0x1cb')});db[_0x2de3('0xe7')][_0x2de3('0x11f')](db[_0x2de3('0xf5')],{'as':_0x2de3('0x1cc'),'through':_0x2de3('0x1cd')});db[_0x2de3('0xe7')][_0x2de3('0x11f')](db['CmList'],{'as':_0x2de3('0x150'),'through':_0x2de3('0x1ce')});db[_0x2de3('0x168')][_0x2de3('0x11a')](db[_0x2de3('0x6a')],{'as':'ChatOfflineMessage','foreignKey':_0x2de3('0x16b')});db[_0x2de3('0xed')][_0x2de3('0x11a')](db['MailMessage'],{});db['MailTransferReport'][_0x2de3('0x11a')](db[_0x2de3('0x47')],{});db[_0x2de3('0xed')][_0x2de3('0x11a')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x2de3('0x1cf')});db['MailTransferReport'][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'foreignKey':'FromUserId','as':_0x2de3('0x1d0')});db[_0x2de3('0xed')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'foreignKey':_0x2de3('0x1d1'),'as':_0x2de3('0x1d2')});db[_0x2de3('0xed')][_0x2de3('0x11a')](db['MailQueue'],{'foreignKey':_0x2de3('0x1d3'),'as':'ToQueue'});db[_0x2de3('0xed')]['belongsTo'](db[_0x2de3('0x41')],{'foreignKey':_0x2de3('0x1d4'),'as':_0x2de3('0x1d5')});db['ChatTransferReport']['belongsTo'](db[_0x2de3('0x68')],{});db[_0x2de3('0xef')][_0x2de3('0x11a')](db[_0x2de3('0x67')],{});db[_0x2de3('0xef')]['belongsTo'](db[_0x2de3('0x63')],{'foreignKey':_0x2de3('0x1d6'),'as':_0x2de3('0x1cf')});db[_0x2de3('0xef')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'foreignKey':_0x2de3('0x1d7'),'as':_0x2de3('0x1d0')});db[_0x2de3('0xef')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'foreignKey':'ToUserId','as':_0x2de3('0x1d2')});db[_0x2de3('0xef')][_0x2de3('0x11a')](db[_0x2de3('0x12c')],{'foreignKey':_0x2de3('0x1d8'),'as':_0x2de3('0x1d9')});db[_0x2de3('0xef')][_0x2de3('0x11a')](db[_0x2de3('0x63')],{'foreignKey':_0x2de3('0x1da'),'as':_0x2de3('0x1d5')});db[_0x2de3('0xf1')][_0x2de3('0x11a')](db[_0x2de3('0x53')],{});db[_0x2de3('0xf1')][_0x2de3('0x11a')](db[_0x2de3('0x52')],{});db[_0x2de3('0xf1')]['belongsTo'](db[_0x2de3('0x4e')],{'foreignKey':_0x2de3('0x1db'),'as':_0x2de3('0x1cf')});db[_0x2de3('0xf1')]['belongsTo'](db['User'],{'foreignKey':_0x2de3('0x1d7'),'as':_0x2de3('0x1d0')});db['FaxTransferReport'][_0x2de3('0x11a')](db['User'],{'foreignKey':_0x2de3('0x1d1'),'as':_0x2de3('0x1d2')});db['FaxTransferReport'][_0x2de3('0x11a')](db['FaxQueue'],{'foreignKey':_0x2de3('0x1dc'),'as':_0x2de3('0x1d9')});db[_0x2de3('0xf1')]['belongsTo'](db[_0x2de3('0x4e')],{'foreignKey':'ToFaxAccountId','as':_0x2de3('0x1d5')});db['OpenchannelTransferReport'][_0x2de3('0x11a')](db[_0x2de3('0x60')],{});db[_0x2de3('0xf3')][_0x2de3('0x11a')](db[_0x2de3('0x5e')],{});db[_0x2de3('0xf3')][_0x2de3('0x11a')](db['OpenchannelAccount'],{'foreignKey':_0x2de3('0x1dd'),'as':_0x2de3('0x1cf')});db[_0x2de3('0xf3')][_0x2de3('0x11a')](db['User'],{'foreignKey':_0x2de3('0x1d7'),'as':_0x2de3('0x1d0')});db[_0x2de3('0xf3')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'foreignKey':_0x2de3('0x1d1'),'as':_0x2de3('0x1d2')});db[_0x2de3('0xf3')][_0x2de3('0x11a')](db[_0x2de3('0x61')],{'foreignKey':'ToOpenchannelQueueId','as':_0x2de3('0x1d9')});db['OpenchannelTransferReport'][_0x2de3('0x11a')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0x2de3('0x1d5')});db[_0x2de3('0x1de')][_0x2de3('0x11a')](db[_0x2de3('0x5a')],{});db[_0x2de3('0x1de')][_0x2de3('0x11a')](db[_0x2de3('0x116')],{});db[_0x2de3('0x1de')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x2de3('0x1df'),'as':'FromAccount'});db[_0x2de3('0x1de')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'foreignKey':_0x2de3('0x1d7'),'as':_0x2de3('0x1d0')});db[_0x2de3('0x1de')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'foreignKey':'ToUserId','as':_0x2de3('0x1d2')});db[_0x2de3('0x1de')][_0x2de3('0x11a')](db[_0x2de3('0x5b')],{'foreignKey':'ToSmsQueueId','as':_0x2de3('0x1d9')});db[_0x2de3('0x1de')][_0x2de3('0x11a')](db['SmsAccount'],{'foreignKey':_0x2de3('0x1e0'),'as':_0x2de3('0x1d5')});db[_0x2de3('0xf5')][_0x2de3('0x111')](db[_0x2de3('0x7e')],{'as':'Dispositions','foreignKey':_0x2de3('0x15e')});db[_0x2de3('0xf5')][_0x2de3('0x111')](db[_0x2de3('0x79')],{'as':'CustomFields','foreignKey':_0x2de3('0x15e')});db['CmList'][_0x2de3('0x111')](db[_0x2de3('0x71')],{'as':_0x2de3('0x120'),'onDelete':_0x2de3('0x10d'),'foreignKey':'ListId'});db[_0x2de3('0xf5')][_0x2de3('0x111')](db[_0x2de3('0x112')],{'as':_0x2de3('0x193'),'foreignKey':_0x2de3('0x15e')});db[_0x2de3('0xf5')][_0x2de3('0x111')](db['CmHopperHistory'],{'as':_0x2de3('0x113'),'foreignKey':_0x2de3('0x15e')});db[_0x2de3('0xf5')]['hasMany'](db['ReportAgentPreview'],{'as':_0x2de3('0x77'),'foreignKey':_0x2de3('0x15e')});db[_0x2de3('0xf5')][_0x2de3('0x11f')](db[_0x2de3('0x145')],{'as':_0x2de3('0x1e1'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x14f'),'through':_0x2de3('0x122')});db[_0x2de3('0xf7')][_0x2de3('0x111')](db[_0x2de3('0x17')],{'as':_0x2de3('0x110'),'onDelete':'cascade'});db['VoicePrefix'][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x14f'),'through':_0x2de3('0x135')});db[_0x2de3('0x11b')][_0x2de3('0x111')](db[_0x2de3('0x11')],{'as':_0x2de3('0x167'),'foreignKey':_0x2de3('0x11c')});db['UserProfile']['hasMany'](db[_0x2de3('0xfa')],{'as':_0x2de3('0x1e2'),'foreignKey':_0x2de3('0x11c'),'onDelete':_0x2de3('0x10d')});db[_0x2de3('0xfa')]['hasMany'](db['UserProfileResource'],{'as':_0x2de3('0x1e3'),'foreignKey':_0x2de3('0x1e4'),'onDelete':_0x2de3('0x10d')});db['WhatsappAccount']['hasMany'](db[_0x2de3('0x7e')],{'as':_0x2de3('0x170'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x2de3('0x111')](db[_0x2de3('0x7c')],{'as':_0x2de3('0x15b'),'foreignKey':_0x2de3('0x1e5')});db[_0x2de3('0xff')][_0x2de3('0x111')](db[_0x2de3('0x105')],{'as':_0x2de3('0x152'),'foreignKey':_0x2de3('0x1e5')});db[_0x2de3('0xff')]['hasMany'](db[_0x2de3('0x103')],{'as':'Interactions'});db[_0x2de3('0xff')][_0x2de3('0x111')](db[_0x2de3('0x101')],{'as':'Applications'});db[_0x2de3('0xff')]['belongsTo'](db['CmList'],{'as':_0x2de3('0x15d'),'foreignKey':_0x2de3('0x15e')});db['WhatsappAccount']['belongsTo'](db[_0x2de3('0x84')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x2de3('0xff')][_0x2de3('0x11f')](db['User'],{'as':_0x2de3('0x14f'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'onDelete':'restrict'});db[_0x2de3('0x101')][_0x2de3('0x11a')](db[_0x2de3('0x108')],{'onDelete':'restrict'});db[_0x2de3('0x101')][_0x2de3('0x11a')](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0x2de3('0x101')][_0x2de3('0x11a')](db[_0x2de3('0x82')],{'onDelete':_0x2de3('0x16c'),'foreignKey':'IntervalId'});db[_0x2de3('0x101')]['belongsTo'](db['Tag'],{'onDelete':_0x2de3('0x16c'),'foreignKey':_0x2de3('0x17c')});db['WhatsappInteraction'][_0x2de3('0x111')](db[_0x2de3('0x105')],{'as':_0x2de3('0x152'),'onDelete':_0x2de3('0x10d'),'foreignKey':'WhatsappInteractionId'});db[_0x2de3('0x103')][_0x2de3('0x11a')](db[_0x2de3('0xff')],{'as':_0x2de3('0x162'),'foreignKey':'WhatsappAccountId'});db[_0x2de3('0x103')]['belongsTo'](db[_0x2de3('0x71')],{'as':_0x2de3('0x157'),'foreignKey':'ContactId'});db[_0x2de3('0x103')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'as':_0x2de3('0x163'),'foreignKey':_0x2de3('0x10f')});db[_0x2de3('0x103')][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':_0x2de3('0x1a9'),'as':_0x2de3('0x164')});db[_0x2de3('0x103')][_0x2de3('0x11f')](db[_0x2de3('0x8c')],{'through':_0x2de3('0x1a9'),'as':'ThroughTags'});db[_0x2de3('0x103')][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x167'),'through':_0x2de3('0x12a'),'foreignKey':_0x2de3('0x1e6')});db[_0x2de3('0x105')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'as':_0x2de3('0x11')});db[_0x2de3('0x105')][_0x2de3('0x11a')](db['CmContact'],{'onDelete':'cascade','as':_0x2de3('0x157')});db[_0x2de3('0x105')][_0x2de3('0x11a')](db['WhatsappInteraction'],{'onDelete':_0x2de3('0x10d'),'as':_0x2de3('0x16a'),'foreignKey':_0x2de3('0x1e6')});db['WhatsappMessage'][_0x2de3('0x11a')](db['WhatsappAccount'],{'as':_0x2de3('0x162'),'foreignKey':_0x2de3('0x1e5')});db['WhatsappQueueReport'][_0x2de3('0x11a')](db['WhatsappAccount'],{});db[_0x2de3('0x1e7')][_0x2de3('0x11a')](db[_0x2de3('0xf5')],{'as':'List','foreignKey':'ListId'});db['WhatsappQueueReport'][_0x2de3('0x11a')](db['CmContact'],{'as':_0x2de3('0x157'),'foreignKey':'ContactId'});db[_0x2de3('0x1e7')]['belongsTo'](db[_0x2de3('0x103')],{});db[_0x2de3('0x1e7')][_0x2de3('0x11a')](db[_0x2de3('0x108')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x2de3('0x105')],{});db[_0x2de3('0x1e7')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{});db[_0x2de3('0x1e8')]['belongsTo'](db[_0x2de3('0x105')],{});db[_0x2de3('0x1e8')][_0x2de3('0x11a')](db[_0x2de3('0x103')],{});db[_0x2de3('0x1e8')]['belongsTo'](db[_0x2de3('0xff')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0x2de3('0x1e8')][_0x2de3('0x11a')](db[_0x2de3('0xff')],{'foreignKey':_0x2de3('0x1e9'),'as':'ToAccount'});db[_0x2de3('0x1e8')][_0x2de3('0x11a')](db[_0x2de3('0x108')],{'foreignKey':_0x2de3('0x1ea'),'as':'ToQueue'});db[_0x2de3('0x1e8')][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'foreignKey':_0x2de3('0x1d7'),'as':_0x2de3('0x1d0')});db['WhatsappTransferReport'][_0x2de3('0x11a')](db[_0x2de3('0x11')],{'foreignKey':_0x2de3('0x1d1'),'as':_0x2de3('0x1d2')});db[_0x2de3('0x108')][_0x2de3('0x11f')](db[_0x2de3('0x11')],{'as':_0x2de3('0x14f'),'through':_0x2de3('0x3b'),'foreignKey':_0x2de3('0x1eb')});db['WhatsappQueue']['belongsToMany'](db[_0x2de3('0xe4')],{'through':_0x2de3('0x1c8'),'as':_0x2de3('0x177')});module[_0x2de3('0x1ec')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xe976=['VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','CannedAnswer','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','hasOne','VoiceMail','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ChatInteractions','SmsInteractions','FaxInteractions','belongsTo','userProfileId','belongsToMany','ChatGroup','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_chat_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','UserVoiceQueue','FaxQueues','SmsQueues','OpenchannelQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Members','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','Contact','ContactId','MailAccountId','Smtp','Disposition','Dispositions','Interactions','MailApplication','List','ListId','TemplateId','MailInteractionId','Account','Tag','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachment','Interaction','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','FaxAccountId','Answers','Exntensions','FaxQueue','Owner','fax_interaction_has_tags','user_has_fax_interactions','FaxInteractionId','AttachmentId','SmsAccountId','SmsApplication','SmsQueue','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','ChatWebsiteId','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','chat_group_has_users','CmCompany','CompanyId','JscriptySessionReport','Company','cm_contact_has_tags','Agent','OwnerId','CampaignId','OneAll','AutomationAllId','OneAny','AutomationAnyId','Action','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceConfiguration','AccountId','Subjects','Descriptions','FieldId','Subject','Description','Configurations','SubjectId','DescriptionId','Field','int_desk_configuration_has_tags','VariableId','ZohoConfiguration','ZohoField','ServicenowConfiguration','ServicenowField','Dynamics365Account','FromId','ToId','SessionId','JscriptyAnswerReport','ProjectId','JscriptyQuestionReport','VoiceQueues','team_has_mail_queues','MailQueues','ChatQueues','team_has_fax_queues','WhatsappQueues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','FromAgent','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsAccountId','CustomFields','CmHopperFinal','Queues','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','path','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','database','username','options','password','User','import','../api/user/user.model'];(function(_0x2f13ae,_0x1800f0){var _0x1d32ca=function(_0x360365){while(--_0x360365){_0x2f13ae['push'](_0x2f13ae['shift']());}};_0x1d32ca(++_0x1800f0);}(_0xe976,0x1dc));var _0x6e97=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0xe976[_0x54eab6];return _0x1e7435;};'use strict';var path=require(_0x6e97('0x0'));var config=require(_0x6e97('0x1'));var Sequelize=require(_0x6e97('0x2'));var _=require(_0x6e97('0x3'));var jstz=require(_0x6e97('0x4'));var timezone=jstz[_0x6e97('0x5')]();config[_0x6e97('0x2')]=_['defaultsDeep'](config[_0x6e97('0x2')],{'database':_0x6e97('0x6'),'username':_0x6e97('0x7'),'password':_0x6e97('0x8'),'options':{'host':_0x6e97('0x9'),'port':0xcea,'dialect':_0x6e97('0xa'),'dialectOptions':{'charset':_0x6e97('0xb')},'logging':![],'timezone':timezone[_0x6e97('0xc')](),'define':{'charset':_0x6e97('0xd'),'collate':_0x6e97('0xe')}}});config[_0x6e97('0xf')]=_[_0x6e97('0x10')](config[_0x6e97('0xf')],{'database':_0x6e97('0x6'),'username':_0x6e97('0x7'),'password':'xC@LL1234','options':{'host':_0x6e97('0x9'),'port':0xcea,'dialect':_0x6e97('0xa'),'dialectOptions':{'charset':_0x6e97('0xb')},'logging':![],'timezone':timezone[_0x6e97('0xc')](),'define':{'charset':_0x6e97('0xd'),'collate':_0x6e97('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6e97('0x2')][_0x6e97('0x11')],config[_0x6e97('0x2')][_0x6e97('0x12')],config[_0x6e97('0x2')]['password'],config[_0x6e97('0x2')][_0x6e97('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6e97('0xf')][_0x6e97('0x11')],config['sequelizeHistory']['username'],config[_0x6e97('0xf')][_0x6e97('0x14')],config[_0x6e97('0xf')][_0x6e97('0x13')])};db[_0x6e97('0x15')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x17'));db[_0x6e97('0x18')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x19'));db[_0x6e97('0x1a')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x1b'));db[_0x6e97('0x1c')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x1d'));db[_0x6e97('0x1e')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x1f'));db[_0x6e97('0x20')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x21'));db[_0x6e97('0x22')]=db['sequelize'][_0x6e97('0x16')]('../api/voiceRecording/voiceRecording.model');db[_0x6e97('0x23')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x24'));db['VoiceMail']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x25'));db[_0x6e97('0x26')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x6e97('0x27')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x28'));db['VoiceDialReport']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x29'));db['VoiceAgentReport']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x2a'));db[_0x6e97('0x2b')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x2c'));db[_0x6e97('0x2d')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x2e'));db[_0x6e97('0x2f')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/trunk/trunk.model');db[_0x6e97('0x30')]=db[_0x6e97('0x2')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x6e97('0x31')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x32'));db['UserVoiceQueue']=db['sequelize']['import'](_0x6e97('0x33'));db[_0x6e97('0x34')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x35'));db[_0x6e97('0x36')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/userMailQueue/userMailQueue.model');db[_0x6e97('0x37')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/userFaxQueue/userFaxQueue.model');db[_0x6e97('0x38')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/userSmsQueue/userSmsQueue.model');db[_0x6e97('0x39')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x6e97('0x3a')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x3b'));db[_0x6e97('0x3c')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x3d'));db[_0x6e97('0x3e')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x3f'));db[_0x6e97('0x40')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x41'));db[_0x6e97('0x42')]=db['sequelize'][_0x6e97('0x16')]('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x43'));db[_0x6e97('0x44')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x45'));db[_0x6e97('0x46')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x47'));db['MailApplication']=db['sequelize']['import']('../api/mailApplication/mailApplication.model');db[_0x6e97('0x48')]=db['sequelize']['import'](_0x6e97('0x49'));db[_0x6e97('0x4a')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x4b'));db[_0x6e97('0x4c')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x4d'));db[_0x6e97('0x4e')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x4f'));db[_0x6e97('0x50')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x51'));db[_0x6e97('0x52')]=db['sequelize'][_0x6e97('0x16')]('../api/faxInteraction/faxInteraction.model');db[_0x6e97('0x53')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x54'));db['FaxQueue']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x55'));db[_0x6e97('0x56')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x57'));db[_0x6e97('0x58')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x59'));db['SmsApplication']=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x5a'));db[_0x6e97('0x5b')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x5c'));db[_0x6e97('0x5d')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x5e'));db[_0x6e97('0x5f')]=db['sequelize']['import'](_0x6e97('0x60'));db[_0x6e97('0x61')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/openchannelApplication/openchannelApplication.model');db[_0x6e97('0x62')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x63'));db[_0x6e97('0x64')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x65'));db[_0x6e97('0x66')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x67'));db[_0x6e97('0x68')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x69'));db[_0x6e97('0x6a')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x6b'));db[_0x6e97('0x6c')]=db['sequelize']['import']('../api/chatApplication/chatApplication.model');db[_0x6e97('0x6d')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x6e'));db[_0x6e97('0x6f')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x70'));db['ChatOfflineMessage']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x71'));db[_0x6e97('0x72')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x73'));db['ChatGroup']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x74'));db[_0x6e97('0x75')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x76'));db['CmCompany']=db['sequelize']['import']('../api/cmCompany/cmCompany.model');db[_0x6e97('0x77')]=db['sequelize']['import'](_0x6e97('0x78'));db[_0x6e97('0x79')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/cmHopper/cmHopper.model');db[_0x6e97('0x7a')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x7b'));db['CmHopperFinal']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x7c'));db[_0x6e97('0x7d')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x7e'));db[_0x6e97('0x7f')]=db['sequelize']['import'](_0x6e97('0x80'));db[_0x6e97('0x81')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x82'));db['Action']=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/action/action.model');db[_0x6e97('0x83')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/automation/automation.model');db[_0x6e97('0x84')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x85'));db[_0x6e97('0x86')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x87'));db['Interval']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x88'));db['Pause']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x89'));db[_0x6e97('0x8a')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x8b'));db['VoiceQueuesLog']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x8c'));db[_0x6e97('0x8d')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x8e'));db[_0x6e97('0x8f')]=db['sequelize']['import'](_0x6e97('0x90'));db['Tag']=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/tag/tag.model');db[_0x6e97('0x91')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x92'));db[_0x6e97('0x93')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x94'));db[_0x6e97('0x95')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/variable/variable.model');db[_0x6e97('0x96')]=db['sequelize'][_0x6e97('0x16')]('../api/integration/integration.model');db[_0x6e97('0x97')]=db['sequelize']['import']('../api/integrationReport/integrationReport.model');db[_0x6e97('0x98')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x99'));db[_0x6e97('0x9a')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x9b'));db[_0x6e97('0x9c')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x9d'));db['AnalyticMetric']=db['sequelize'][_0x6e97('0x16')]('../api/analyticMetric/analyticMetric.model');db[_0x6e97('0x9e')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x9f'));db[_0x6e97('0xa0')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xa1'));db[_0x6e97('0xa2')]=db[_0x6e97('0x2')]['import'](_0x6e97('0xa3'));db['SalesforceConfiguration']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xa4'));db[_0x6e97('0xa5')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/intSalesforceField/intSalesforceField.model');db[_0x6e97('0xa6')]=db['sequelize']['import'](_0x6e97('0xa7'));db[_0x6e97('0xa8')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xa9'));db[_0x6e97('0xaa')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xab'));db[_0x6e97('0xac')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xad'));db[_0x6e97('0xae')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xaf'));db[_0x6e97('0xb0')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xb1'));db[_0x6e97('0xb2')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xb3'));db['ZohoConfiguration']=db[_0x6e97('0x2')]['import'](_0x6e97('0xb4'));db['ZohoField']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xb5'));db[_0x6e97('0xb6')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x6e97('0xb7')]=db[_0x6e97('0x2')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x6e97('0xb8')]=db[_0x6e97('0x2')]['import']('../api/intZendeskField/intZendeskField.model');db[_0x6e97('0xb9')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xba'));db[_0x6e97('0xbb')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0xbc'));db[_0x6e97('0xbd')]=db[_0x6e97('0x2')]['import'](_0x6e97('0xbe'));db[_0x6e97('0xbf')]=db[_0x6e97('0x2')]['import'](_0x6e97('0xc0'));db[_0x6e97('0xc1')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x6e97('0xc2')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xc3'));db[_0x6e97('0xc4')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xc5'));db['ServicenowConfiguration']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xc6'));db['ServicenowField']=db['sequelize'][_0x6e97('0x16')](_0x6e97('0xc7'));db['Dynamics365Account']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xc8'));db[_0x6e97('0xc9')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xca'));db[_0x6e97('0xcb')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0xcc'));db[_0x6e97('0xcd')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xce'));db[_0x6e97('0xcf')]=db['sequelize'][_0x6e97('0x16')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x6e97('0xd0')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xd1'));db['Integration']=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/integration/integration.model');db[_0x6e97('0xd2')]=db[_0x6e97('0x2')]['import'](_0x6e97('0xd3'));db[_0x6e97('0xd4')]=db['sequelize']['import']('../api/chatQueueReport/chatQueueReport.model');db[_0x6e97('0xd5')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0xd6'));db['JscriptyAnswerReport']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xd7'));db['JscriptyQuestionReport']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xd8'));db['JscriptySessionReport']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xd9'));db[_0x6e97('0xda')]=db[_0x6e97('0x2')]['import'](_0x6e97('0xdb'));db['SquareReport']=db[_0x6e97('0x2')]['import'](_0x6e97('0xdc'));db['SquareDetailsReport']=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/squareReportDetail/squareReportDetail.model');db[_0x6e97('0xdd')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/jscriptyProject/jscriptyProject.model');db[_0x6e97('0xde')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xdf'));db[_0x6e97('0xe0')]=db['sequelize'][_0x6e97('0x16')]('../api/squareOdbc/squareOdbc.model');db[_0x6e97('0xe1')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xe2'));db[_0x6e97('0xe3')]=db[_0x6e97('0x2')]['import'](_0x6e97('0xe4'));db[_0x6e97('0xe5')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xe6'));db[_0x6e97('0xe7')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0xe8'));db[_0x6e97('0xe9')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0xea'));db[_0x6e97('0xeb')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/campaign/campaign.model');db[_0x6e97('0xec')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/migration/migration.model');db['Attachment']=db['sequelize'][_0x6e97('0x16')](_0x6e97('0xed'));db[_0x6e97('0xee')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xef'));db['MailTransferReport']=db[_0x6e97('0x2')]['import'](_0x6e97('0xf0'));db[_0x6e97('0xf1')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xf2'));db[_0x6e97('0xf3')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/faxTransferReport/faxTransferReport.model');db[_0x6e97('0xf4')]=db[_0x6e97('0x2')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x6e97('0xf5')]=db[_0x6e97('0x2')]['import'](_0x6e97('0xf6'));db['CmList']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xf7'));db[_0x6e97('0xf8')]=db[_0x6e97('0x2')]['import'](_0x6e97('0xf9'));db[_0x6e97('0xfa')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0xfb'));db[_0x6e97('0xfc')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xfd'));db['UserProfileResource']=db['sequelize'][_0x6e97('0x16')]('../api/userProfileResource/userProfileResource.model');db[_0x6e97('0xfe')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0xff'));db['WhatsappAccount']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x100'));db[_0x6e97('0x101')]=db[_0x6e97('0x2')]['import'](_0x6e97('0x102'));db[_0x6e97('0x103')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x104'));db[_0x6e97('0x105')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x106'));db['WhatsappTransferReport']=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x107'));db[_0x6e97('0x108')]=db['sequelize'][_0x6e97('0x16')](_0x6e97('0x109'));db[_0x6e97('0x10a')]=db[_0x6e97('0x2')][_0x6e97('0x16')](_0x6e97('0x10b'));db[_0x6e97('0x10c')]=db[_0x6e97('0x2')][_0x6e97('0x16')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x6e97('0x15')][_0x6e97('0x10d')](db[_0x6e97('0x10e')],{'as':'VoiceMail','onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x110')});db['User']['hasMany'](db[_0x6e97('0x22')],{'as':_0x6e97('0x111'),'foreignKey':_0x6e97('0x110')});db[_0x6e97('0x15')][_0x6e97('0x112')](db[_0x6e97('0x31')],{'as':_0x6e97('0x113'),'foreignKey':_0x6e97('0x110')});db[_0x6e97('0x15')][_0x6e97('0x112')](db[_0x6e97('0x1c')],{'as':_0x6e97('0x114'),'onDelete':_0x6e97('0x10f'),'hooks':!![]});db[_0x6e97('0x15')]['hasMany'](db['CmHopperFinal'],{'as':_0x6e97('0x115'),'foreignKey':_0x6e97('0x110')});db[_0x6e97('0x15')]['hasMany'](db['CmHopperHistory'],{'as':_0x6e97('0x116'),'foreignKey':'UserId'});db[_0x6e97('0x15')][_0x6e97('0x112')](db['ReportAgentPreview'],{'as':_0x6e97('0x7f'),'foreignKey':_0x6e97('0x110')});db['User'][_0x6e97('0x112')](db[_0x6e97('0x62')],{'as':'OpenchannelInteractions','foreignKey':_0x6e97('0x110')});db['User'][_0x6e97('0x112')](db[_0x6e97('0x6d')],{'as':_0x6e97('0x117'),'foreignKey':_0x6e97('0x110')});db[_0x6e97('0x15')][_0x6e97('0x112')](db['SmsInteraction'],{'as':_0x6e97('0x118'),'foreignKey':_0x6e97('0x110')});db[_0x6e97('0x15')][_0x6e97('0x112')](db[_0x6e97('0x52')],{'as':_0x6e97('0x119'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x6e97('0x44')],{'as':'MailInteractions','foreignKey':_0x6e97('0x110')});db[_0x6e97('0x15')]['hasMany'](db[_0x6e97('0x103')],{'as':'WhatsappInteractions','foreignKey':_0x6e97('0x110')});db[_0x6e97('0x15')][_0x6e97('0x112')](db[_0x6e97('0xfe')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0x6e97('0x15')][_0x6e97('0x11a')](db[_0x6e97('0xfa')],{'as':'UserProfile','foreignKey':_0x6e97('0x11b')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0x11d')],{'as':'Groups','through':'chat_group_has_users'});db[_0x6e97('0x15')][_0x6e97('0x11c')](db['CmContact'],{'as':_0x6e97('0x11e'),'through':_0x6e97('0x11f')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0x120')],{'as':_0x6e97('0x121'),'through':_0x6e97('0x122')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0xe7')],{'through':_0x6e97('0x123')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db['MailInteraction'],{'as':_0x6e97('0x124'),'through':'user_has_mail_interactions'});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0x6d')],{'as':_0x6e97('0x117'),'through':_0x6e97('0x125')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db['FaxInteraction'],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0x5b')],{'as':_0x6e97('0x118'),'through':_0x6e97('0x126')});db['User']['belongsToMany'](db[_0x6e97('0x62')],{'as':_0x6e97('0x127'),'through':_0x6e97('0x128')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db['WhatsappInteraction'],{'as':_0x6e97('0x129'),'through':_0x6e97('0x12a')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0x20')],{'as':'VoiceQueues','through':_0x6e97('0x12b'),'required':![]});db[_0x6e97('0x15')]['belongsToMany'](db['MailQueue'],{'as':'MailQueues','through':'UserMailQueue','required':![]});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0x72')],{'as':'ChatQueues','through':_0x6e97('0x34'),'required':![],'hooks':!![]});db[_0x6e97('0x15')][_0x6e97('0x11c')](db['FaxQueue'],{'as':_0x6e97('0x12c'),'through':_0x6e97('0x37'),'required':![]});db['User'][_0x6e97('0x11c')](db['SmsQueue'],{'as':_0x6e97('0x12d'),'through':_0x6e97('0x38'),'required':![]});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0x66')],{'as':_0x6e97('0x12e'),'through':'UserOpenchannelQueue','required':![]});db[_0x6e97('0x15')][_0x6e97('0x11c')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0x6e97('0x3a'),'required':![]});db[_0x6e97('0x15')][_0x6e97('0x11c')](db['CmList'],{'through':_0x6e97('0x122')});db[_0x6e97('0x15')]['belongsToMany'](db[_0x6e97('0xf8')],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db['User']['belongsToMany'](db[_0x6e97('0x68')],{'as':_0x6e97('0x12f'),'through':_0x6e97('0x130')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0x4e')],{'as':_0x6e97('0x131'),'through':_0x6e97('0x132')});db['User']['belongsToMany'](db['MailAccount'],{'as':_0x6e97('0x133'),'through':_0x6e97('0x134')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0x5f')],{'as':_0x6e97('0x135'),'through':_0x6e97('0x136')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0x58')],{'as':_0x6e97('0x137'),'through':_0x6e97('0x138')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0x139')],{'as':_0x6e97('0x13a'),'through':_0x6e97('0x13b')});db[_0x6e97('0x15')][_0x6e97('0x11c')](db[_0x6e97('0xe1')],{'as':_0x6e97('0x13c'),'through':_0x6e97('0x13d')});db[_0x6e97('0x18')][_0x6e97('0x112')](db[_0x6e97('0x1c')],{'as':_0x6e97('0x13e'),'onDelete':'cascade','foreignKey':_0x6e97('0x13f')});db[_0x6e97('0x1a')][_0x6e97('0x112')](db[_0x6e97('0x1c')],{'onDelete':_0x6e97('0x10f')});db[_0x6e97('0x1c')][_0x6e97('0x112')](db[_0x6e97('0x1c')],{'as':_0x6e97('0x140'),'onDelete':_0x6e97('0x10f')});db[_0x6e97('0x1e')]['belongsToMany'](db['Sound'],{'as':'Sounds','through':'moh_has_sounds'});db[_0x6e97('0x20')][_0x6e97('0x112')](db[_0x6e97('0x31')],{'as':_0x6e97('0x141'),'foreignKey':'VoiceQueueId'});db[_0x6e97('0x20')]['hasMany'](db[_0x6e97('0x79')],{'as':_0x6e97('0x142'),'foreignKey':_0x6e97('0x143')});db['VoiceQueue'][_0x6e97('0x112')](db['CmHopperFinal'],{'as':_0x6e97('0x115'),'foreignKey':_0x6e97('0x143')});db[_0x6e97('0x20')]['hasMany'](db[_0x6e97('0x7d')],{'as':_0x6e97('0x144'),'foreignKey':_0x6e97('0x143')});db[_0x6e97('0x20')][_0x6e97('0x112')](db[_0x6e97('0x7f')],{'as':_0x6e97('0x7f'),'foreignKey':_0x6e97('0x143')});db[_0x6e97('0x20')]['hasMany'](db[_0x6e97('0x7a')],{'as':_0x6e97('0x145'),'foreignKey':'VoiceQueueId'});db[_0x6e97('0x20')][_0x6e97('0x112')](db['JscriptySessionReport'],{'as':_0x6e97('0x146'),'foreignKey':_0x6e97('0x143')});db[_0x6e97('0x20')][_0x6e97('0x11a')](db['Trunk'],{'as':_0x6e97('0x2f'),'foreignKey':_0x6e97('0x147')});db[_0x6e97('0x20')][_0x6e97('0x11a')](db[_0x6e97('0x2f')],{'as':_0x6e97('0x148'),'foreignKey':_0x6e97('0x149')});db['VoiceQueue'][_0x6e97('0x11a')](db[_0x6e97('0x14a')],{'as':_0x6e97('0x14a'),'foreignKey':_0x6e97('0x14b')});db['VoiceQueue'][_0x6e97('0x11a')](db[_0x6e97('0x14c')],{'as':_0x6e97('0x14d'),'foreignKey':_0x6e97('0x14e')});db[_0x6e97('0x20')][_0x6e97('0x11c')](db['CmList'],{'as':'Lists','through':_0x6e97('0x14f')});db[_0x6e97('0x20')]['belongsToMany'](db['User'],{'as':_0x6e97('0x150'),'through':_0x6e97('0x12b')});db[_0x6e97('0x20')][_0x6e97('0x11c')](db[_0x6e97('0xe7')],{'as':_0x6e97('0x151'),'through':_0x6e97('0x10c')});db[_0x6e97('0x20')]['belongsToMany'](db[_0x6e97('0x120')],{'as':_0x6e97('0x152'),'through':_0x6e97('0x153')});db['VoiceRecording'][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'as':_0x6e97('0x15'),'foreignKey':_0x6e97('0x110')});db[_0x6e97('0x23')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'as':_0x6e97('0x15'),'foreignKey':'UserId'});db['VoiceMail'][_0x6e97('0x112')](db['VoiceMailMessage'],{'as':_0x6e97('0x154'),'onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x155'),'sourceKey':'mailbox'});db[_0x6e97('0x26')][_0x6e97('0x11a')](db[_0x6e97('0x10e')],{'foreignKey':_0x6e97('0x155'),'targetKey':_0x6e97('0x156')});db['VoiceCallReport'][_0x6e97('0x112')](db[_0x6e97('0x2b')],{'as':_0x6e97('0x157'),'foreignKey':'uniqueid','constraints':![]});db[_0x6e97('0x27')][_0x6e97('0x112')](db[_0x6e97('0x158')],{'as':_0x6e97('0x159'),'foreignKey':_0x6e97('0x15a'),'constraints':![]});db[_0x6e97('0x27')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'as':_0x6e97('0x15'),'foreignKey':_0x6e97('0x110')});db[_0x6e97('0x27')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c')});db[_0x6e97('0x3c')]['belongsTo'](db[_0x6e97('0x40')],{'as':_0x6e97('0x40'),'foreignKey':_0x6e97('0x15d')});db[_0x6e97('0x3e')][_0x6e97('0x11a')](db[_0x6e97('0x40')],{'as':'MailAccount','foreignKey':_0x6e97('0x15d')});db[_0x6e97('0x40')][_0x6e97('0x10d')](db[_0x6e97('0x3c')],{'as':'Imap','onDelete':_0x6e97('0x10f')});db[_0x6e97('0x40')][_0x6e97('0x10d')](db['MailServerOut'],{'as':_0x6e97('0x15e'),'onDelete':'cascade'});db[_0x6e97('0x40')][_0x6e97('0x112')](db[_0x6e97('0x15f')],{'as':_0x6e97('0x160'),'foreignKey':'MailAccountId'});db[_0x6e97('0x40')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x6e97('0x15d')});db[_0x6e97('0x40')]['hasMany'](db[_0x6e97('0x46')],{'as':_0x6e97('0x154'),'foreignKey':_0x6e97('0x15d')});db['MailAccount'][_0x6e97('0x112')](db['MailInteraction'],{'as':_0x6e97('0x161')});db[_0x6e97('0x40')][_0x6e97('0x112')](db[_0x6e97('0x162')],{'as':'Applications'});db[_0x6e97('0x40')]['belongsTo'](db[_0x6e97('0x120')],{'as':_0x6e97('0x163'),'foreignKey':_0x6e97('0x164')});db[_0x6e97('0x40')]['belongsTo'](db[_0x6e97('0x91')],{'as':_0x6e97('0x91'),'foreignKey':_0x6e97('0x165')});db[_0x6e97('0x40')][_0x6e97('0x11a')](db['Pause'],{'as':_0x6e97('0x14d'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x6e97('0x11c')](db['User'],{'as':_0x6e97('0x150'),'through':_0x6e97('0x134')});db['MailQueue']['belongsToMany'](db['User'],{'as':_0x6e97('0x150'),'through':_0x6e97('0x36')});db['MailQueue']['belongsToMany'](db[_0x6e97('0xe7')],{'through':'team_has_mail_queues','as':_0x6e97('0x151')});db[_0x6e97('0x44')][_0x6e97('0x112')](db[_0x6e97('0x46')],{'as':_0x6e97('0x154'),'onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x166')});db[_0x6e97('0x44')][_0x6e97('0x11a')](db[_0x6e97('0x40')],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x15d')});db[_0x6e97('0x44')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c')});db[_0x6e97('0x44')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'as':'Owner','foreignKey':_0x6e97('0x110')});db[_0x6e97('0x44')]['belongsToMany'](db[_0x6e97('0x168')],{'through':'mail_interaction_has_tags','as':_0x6e97('0x169')});db[_0x6e97('0x44')]['belongsToMany'](db[_0x6e97('0x168')],{'through':_0x6e97('0x16a'),'as':_0x6e97('0x16b')});db[_0x6e97('0x44')][_0x6e97('0x11c')](db[_0x6e97('0x15')],{'as':_0x6e97('0x16c'),'through':'user_has_mail_interactions','foreignKey':_0x6e97('0x166')});db[_0x6e97('0x46')][_0x6e97('0x112')](db[_0x6e97('0x16d')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage'][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'as':'User'});db[_0x6e97('0x46')][_0x6e97('0x11a')](db['CmContact'],{'onDelete':'cascade','as':_0x6e97('0x15b')});db['MailMessage']['belongsTo'](db[_0x6e97('0x44')],{'as':_0x6e97('0x16e'),'foreignKey':_0x6e97('0x166')});db[_0x6e97('0x46')][_0x6e97('0x11a')](db[_0x6e97('0x40')],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x15d')});db[_0x6e97('0x46')][_0x6e97('0x11a')](db['ChatWebsite'],{'as':_0x6e97('0x68'),'foreignKey':'ChatWebsiteId'});db[_0x6e97('0x46')][_0x6e97('0x11a')](db[_0x6e97('0x16f')],{'as':_0x6e97('0x16f'),'foreignKey':_0x6e97('0x170')});db['MailApplication'][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'onDelete':_0x6e97('0x171')});db[_0x6e97('0x162')]['belongsTo'](db[_0x6e97('0x42')],{'onDelete':_0x6e97('0x171')});db[_0x6e97('0x162')][_0x6e97('0x11a')](db['MailAccount'],{'onDelete':_0x6e97('0x171')});db[_0x6e97('0x162')][_0x6e97('0x11a')](db[_0x6e97('0x14a')],{'onDelete':_0x6e97('0x171'),'foreignKey':_0x6e97('0x14b')});db['MailApplication'][_0x6e97('0x11a')](db[_0x6e97('0x168')],{'onDelete':_0x6e97('0x171'),'foreignKey':_0x6e97('0x172')});db[_0x6e97('0x48')][_0x6e97('0x11a')](db[_0x6e97('0x40')],{});db[_0x6e97('0x48')][_0x6e97('0x11a')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x6e97('0x48')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c')});db[_0x6e97('0x48')][_0x6e97('0x11a')](db['MailInteraction'],{});db['MailQueueReport'][_0x6e97('0x11a')](db['MailMessage'],{});db[_0x6e97('0x48')]['belongsTo'](db[_0x6e97('0x15')],{});db[_0x6e97('0x48')][_0x6e97('0x11a')](db[_0x6e97('0x42')],{});db[_0x6e97('0x4a')][_0x6e97('0x112')](db[_0x6e97('0x4c')],{'as':'Items','onDelete':'cascade'});db[_0x6e97('0x4e')][_0x6e97('0x112')](db[_0x6e97('0x15f')],{'as':'Dispositions','foreignKey':_0x6e97('0x173')});db[_0x6e97('0x4e')]['hasMany'](db[_0x6e97('0x84')],{'as':_0x6e97('0x174'),'foreignKey':_0x6e97('0x173')});db[_0x6e97('0x4e')][_0x6e97('0x112')](db['FaxInteraction'],{'as':_0x6e97('0x161')});db[_0x6e97('0x4e')][_0x6e97('0x112')](db[_0x6e97('0x50')],{'as':_0x6e97('0x140')});db['FaxAccount'][_0x6e97('0x112')](db[_0x6e97('0x1c')],{'as':_0x6e97('0x175'),'onDelete':_0x6e97('0x10f')});db['FaxAccount'][_0x6e97('0x112')](db[_0x6e97('0x53')],{'as':_0x6e97('0x154')});db[_0x6e97('0x4e')][_0x6e97('0x11a')](db[_0x6e97('0x2f')],{'as':_0x6e97('0x2f')});db[_0x6e97('0x4e')]['belongsTo'](db[_0x6e97('0x120')],{'as':_0x6e97('0x163'),'foreignKey':_0x6e97('0x164')});db['FaxAccount'][_0x6e97('0x11a')](db[_0x6e97('0x14c')],{'as':_0x6e97('0x14d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x6e97('0x4e')]['belongsToMany'](db[_0x6e97('0x15')],{'as':'Agents','through':_0x6e97('0x132')});db[_0x6e97('0x50')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'onDelete':'restrict'});db[_0x6e97('0x50')][_0x6e97('0x11a')](db[_0x6e97('0x176')],{'onDelete':'restrict'});db[_0x6e97('0x50')][_0x6e97('0x11a')](db[_0x6e97('0x4e')],{'onDelete':'restrict'});db[_0x6e97('0x50')][_0x6e97('0x11a')](db[_0x6e97('0x168')],{'onDelete':_0x6e97('0x171'),'foreignKey':'TagId'});db[_0x6e97('0x52')][_0x6e97('0x112')](db['FaxMessage'],{'as':_0x6e97('0x154'),'onDelete':_0x6e97('0x10f'),'foreignKey':'FaxInteractionId'});db[_0x6e97('0x52')][_0x6e97('0x11a')](db[_0x6e97('0x4e')],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x173')});db[_0x6e97('0x52')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c')});db[_0x6e97('0x52')]['belongsTo'](db['User'],{'as':_0x6e97('0x177'),'foreignKey':'UserId'});db[_0x6e97('0x52')][_0x6e97('0x11c')](db[_0x6e97('0x168')],{'through':'fax_interaction_has_tags','as':_0x6e97('0x169')});db['FaxInteraction'][_0x6e97('0x11c')](db[_0x6e97('0x168')],{'through':_0x6e97('0x178'),'as':_0x6e97('0x16b')});db['FaxInteraction'][_0x6e97('0x11c')](db['User'],{'as':'Users','through':_0x6e97('0x179'),'foreignKey':_0x6e97('0x17a')});db[_0x6e97('0x53')]['belongsTo'](db['User'],{'onDelete':_0x6e97('0x10f'),'as':_0x6e97('0x15')});db[_0x6e97('0x53')]['belongsTo'](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0x6e97('0x17a')});db[_0x6e97('0x53')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'onDelete':_0x6e97('0x10f'),'as':_0x6e97('0x15b')});db['FaxMessage']['belongsTo'](db[_0x6e97('0x16d')],{'as':_0x6e97('0x16d'),'foreignKey':_0x6e97('0x17b')});db['FaxMessage'][_0x6e97('0x11a')](db[_0x6e97('0x4e')],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x173')});db[_0x6e97('0x176')][_0x6e97('0x11c')](db[_0x6e97('0x15')],{'as':_0x6e97('0x150'),'through':_0x6e97('0x37')});db[_0x6e97('0x176')][_0x6e97('0x11c')](db[_0x6e97('0xe7')],{'through':'team_has_fax_queues','as':_0x6e97('0x151')});db[_0x6e97('0x56')][_0x6e97('0x11a')](db[_0x6e97('0x4e')],{});db[_0x6e97('0x56')][_0x6e97('0x11a')](db[_0x6e97('0x120')],{'as':_0x6e97('0x163'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c')});db[_0x6e97('0x56')]['belongsTo'](db[_0x6e97('0x52')],{});db[_0x6e97('0x56')][_0x6e97('0x11a')](db[_0x6e97('0x53')],{});db['FaxQueueReport'][_0x6e97('0x11a')](db[_0x6e97('0x15')],{});db[_0x6e97('0x56')][_0x6e97('0x11a')](db[_0x6e97('0x176')],{});db[_0x6e97('0x58')][_0x6e97('0x112')](db[_0x6e97('0x15f')],{'as':'Dispositions','foreignKey':_0x6e97('0x17c')});db[_0x6e97('0x58')]['hasMany'](db[_0x6e97('0x84')],{'as':_0x6e97('0x174'),'foreignKey':_0x6e97('0x17c')});db['SmsAccount']['hasMany'](db[_0x6e97('0x5d')],{'as':_0x6e97('0x154'),'foreignKey':_0x6e97('0x17c')});db[_0x6e97('0x58')]['hasMany'](db[_0x6e97('0x5b')],{'as':'Interactions'});db[_0x6e97('0x58')][_0x6e97('0x112')](db[_0x6e97('0x17d')],{'as':_0x6e97('0x140')});db['SmsAccount'][_0x6e97('0x11a')](db[_0x6e97('0x120')],{'as':_0x6e97('0x163'),'foreignKey':'ListId'});db['SmsAccount'][_0x6e97('0x11a')](db[_0x6e97('0x14c')],{'as':_0x6e97('0x14d'),'foreignKey':_0x6e97('0x14e')});db['SmsAccount']['belongsToMany'](db[_0x6e97('0x15')],{'as':_0x6e97('0x150'),'through':'user_has_sms_accounts'});db[_0x6e97('0x17d')]['belongsTo'](db['User'],{'onDelete':_0x6e97('0x171')});db[_0x6e97('0x17d')][_0x6e97('0x11a')](db[_0x6e97('0x17e')],{'onDelete':_0x6e97('0x171')});db['SmsApplication'][_0x6e97('0x11a')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x6e97('0x17d')][_0x6e97('0x11a')](db[_0x6e97('0x14a')],{'onDelete':_0x6e97('0x171'),'foreignKey':'IntervalId'});db[_0x6e97('0x17d')][_0x6e97('0x11a')](db['Tag'],{'onDelete':_0x6e97('0x171'),'foreignKey':_0x6e97('0x172')});db[_0x6e97('0x5b')][_0x6e97('0x112')](db[_0x6e97('0x5d')],{'as':'Messages','onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x17f')});db[_0x6e97('0x5b')][_0x6e97('0x11a')](db[_0x6e97('0x58')],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x17c')});db[_0x6e97('0x5b')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'as':_0x6e97('0x15b'),'foreignKey':'ContactId'});db['SmsInteraction'][_0x6e97('0x11a')](db['User'],{'as':'Owner','foreignKey':_0x6e97('0x110')});db[_0x6e97('0x5b')][_0x6e97('0x11c')](db[_0x6e97('0x168')],{'through':_0x6e97('0x180'),'as':_0x6e97('0x169')});db[_0x6e97('0x5b')]['belongsToMany'](db[_0x6e97('0x168')],{'through':_0x6e97('0x180'),'as':_0x6e97('0x16b')});db[_0x6e97('0x5b')][_0x6e97('0x11c')](db['User'],{'as':_0x6e97('0x16c'),'through':_0x6e97('0x126'),'foreignKey':_0x6e97('0x17f')});db[_0x6e97('0x5d')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'as':'User'});db[_0x6e97('0x5d')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'onDelete':_0x6e97('0x10f'),'as':_0x6e97('0x15b')});db[_0x6e97('0x5d')][_0x6e97('0x11a')](db[_0x6e97('0x5b')],{'onDelete':_0x6e97('0x10f'),'as':_0x6e97('0x16e'),'foreignKey':_0x6e97('0x17f')});db['SmsMessage'][_0x6e97('0x11a')](db[_0x6e97('0x58')],{'as':'Account','foreignKey':_0x6e97('0x17c')});db[_0x6e97('0x17e')]['belongsToMany'](db[_0x6e97('0x15')],{'as':_0x6e97('0x150'),'through':'UserSmsQueue','foreignKey':_0x6e97('0x181')});db[_0x6e97('0x17e')][_0x6e97('0x11c')](db[_0x6e97('0xe7')],{'through':_0x6e97('0x182'),'as':_0x6e97('0x151')});db[_0x6e97('0x5f')]['hasMany'](db[_0x6e97('0x15f')],{'as':_0x6e97('0x160'),'foreignKey':'OpenchannelAccountId'});db[_0x6e97('0x5f')]['hasMany'](db[_0x6e97('0x84')],{'as':'Answers','foreignKey':_0x6e97('0x183')});db['OpenchannelAccount'][_0x6e97('0x112')](db[_0x6e97('0x62')],{'as':_0x6e97('0x161'),'foreignKey':_0x6e97('0x183')});db[_0x6e97('0x5f')]['hasMany'](db[_0x6e97('0x64')],{'as':_0x6e97('0x154'),'foreignKey':_0x6e97('0x183')});db[_0x6e97('0x5f')][_0x6e97('0x112')](db[_0x6e97('0x61')],{'as':_0x6e97('0x140'),'foreignKey':_0x6e97('0x183')});db[_0x6e97('0x5f')]['belongsTo'](db[_0x6e97('0x120')],{'as':_0x6e97('0x163'),'foreignKey':_0x6e97('0x164')});db[_0x6e97('0x5f')][_0x6e97('0x11a')](db[_0x6e97('0x14c')],{'as':_0x6e97('0x14d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x6e97('0x5f')]['belongsToMany'](db[_0x6e97('0x15')],{'as':_0x6e97('0x150'),'through':_0x6e97('0x136')});db['OpenchannelApplication']['belongsTo'](db[_0x6e97('0x15')],{'onDelete':_0x6e97('0x171')});db[_0x6e97('0x61')][_0x6e97('0x11a')](db[_0x6e97('0x66')],{'onDelete':_0x6e97('0x171'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x6e97('0x11a')](db['OpenchannelAccount'],{'onDelete':_0x6e97('0x171'),'foreignKey':_0x6e97('0x183')});db['OpenchannelApplication'][_0x6e97('0x11a')](db[_0x6e97('0x14a')],{'onDelete':_0x6e97('0x171'),'foreignKey':_0x6e97('0x14b')});db[_0x6e97('0x61')][_0x6e97('0x11a')](db[_0x6e97('0x168')],{'onDelete':_0x6e97('0x171'),'foreignKey':_0x6e97('0x172')});db[_0x6e97('0x62')][_0x6e97('0x112')](db[_0x6e97('0x64')],{'as':_0x6e97('0x154'),'onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x184')});db[_0x6e97('0x62')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x183')});db[_0x6e97('0x62')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'as':'Contact','foreignKey':_0x6e97('0x15c')});db['OpenchannelInteraction']['belongsTo'](db[_0x6e97('0x15')],{'as':'Owner','foreignKey':_0x6e97('0x110')});db['OpenchannelInteraction'][_0x6e97('0x11c')](db['Tag'],{'through':_0x6e97('0x185'),'as':_0x6e97('0x169')});db['OpenchannelInteraction'][_0x6e97('0x11c')](db['Tag'],{'through':_0x6e97('0x185'),'as':_0x6e97('0x16b')});db[_0x6e97('0x62')][_0x6e97('0x11c')](db['User'],{'as':_0x6e97('0x16c'),'through':_0x6e97('0x128'),'foreignKey':_0x6e97('0x184')});db['OpenchannelMessage'][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'onDelete':_0x6e97('0x10f'),'as':'User'});db[_0x6e97('0x64')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'onDelete':_0x6e97('0x10f'),'as':'Contact'});db[_0x6e97('0x64')]['belongsTo'](db[_0x6e97('0x62')],{'onDelete':_0x6e97('0x10f'),'as':_0x6e97('0x16e'),'foreignKey':'OpenchannelInteractionId'});db[_0x6e97('0x64')][_0x6e97('0x11a')](db[_0x6e97('0x16d')],{'as':_0x6e97('0x16d'),'foreignKey':'AttachmentId'});db[_0x6e97('0x64')][_0x6e97('0x11a')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x6e97('0x183')});db[_0x6e97('0x66')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x6e97('0x39'),'foreignKey':_0x6e97('0x186')});db[_0x6e97('0x66')]['belongsToMany'](db[_0x6e97('0xe7')],{'through':'team_has_openchannel_queues','as':_0x6e97('0x151')});db[_0x6e97('0x68')][_0x6e97('0x112')](db[_0x6e97('0x15f')],{'as':_0x6e97('0x160'),'foreignKey':_0x6e97('0x187')});db[_0x6e97('0x68')]['hasMany'](db[_0x6e97('0x84')],{'as':_0x6e97('0x174'),'foreignKey':_0x6e97('0x187')});db[_0x6e97('0x68')]['hasMany'](db[_0x6e97('0x75')],{'as':'ProactiveActions'});db[_0x6e97('0x68')]['hasMany'](db[_0x6e97('0x6d')],{'as':_0x6e97('0x161')});db[_0x6e97('0x68')][_0x6e97('0x112')](db[_0x6e97('0x6c')],{'as':'Applications'});db[_0x6e97('0x68')][_0x6e97('0x112')](db[_0x6e97('0x6f')],{'as':_0x6e97('0x154')});db[_0x6e97('0x68')][_0x6e97('0x11a')](db[_0x6e97('0x120')],{'as':_0x6e97('0x163'),'foreignKey':_0x6e97('0x164')});db[_0x6e97('0x68')]['belongsTo'](db['Interval'],{'as':_0x6e97('0x14a'),'foreignKey':'IntervalId'});db[_0x6e97('0x68')][_0x6e97('0x11a')](db[_0x6e97('0x40')],{'as':'MailAccount','foreignKey':_0x6e97('0x15d')});db['ChatWebsite']['belongsTo'](db[_0x6e97('0x14c')],{'as':_0x6e97('0x14d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x6e97('0x68')][_0x6e97('0x11c')](db[_0x6e97('0x15')],{'as':_0x6e97('0x150'),'through':_0x6e97('0x130')});db[_0x6e97('0x6a')][_0x6e97('0x11a')](db[_0x6e97('0x5f')],{});db[_0x6e97('0x6a')][_0x6e97('0x11a')](db[_0x6e97('0x120')],{'as':'List','foreignKey':'ListId'});db[_0x6e97('0x6a')]['belongsTo'](db[_0x6e97('0x77')],{'as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c')});db['OpenchannelQueueReport'][_0x6e97('0x11a')](db['OpenchannelInteraction'],{});db[_0x6e97('0x6a')][_0x6e97('0x11a')](db[_0x6e97('0x64')],{});db[_0x6e97('0x6a')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{});db[_0x6e97('0x6a')]['belongsTo'](db[_0x6e97('0x66')],{});db['ChatApplication'][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'as':'Agent','foreignKey':_0x6e97('0x110'),'onDelete':_0x6e97('0x171')});db[_0x6e97('0x6c')][_0x6e97('0x11a')](db['ChatQueue'],{'as':_0x6e97('0x188'),'foreignKey':_0x6e97('0x189'),'onDelete':_0x6e97('0x171')});db[_0x6e97('0x6c')][_0x6e97('0x11a')](db[_0x6e97('0x68')],{'as':_0x6e97('0x18a'),'foreignKey':'ChatWebsiteId','onDelete':_0x6e97('0x171')});db['ChatApplication'][_0x6e97('0x11a')](db['Tag'],{'onDelete':_0x6e97('0x171'),'foreignKey':_0x6e97('0x172')});db[_0x6e97('0x6d')]['hasMany'](db[_0x6e97('0x6f')],{'as':'Messages','onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x18b')});db[_0x6e97('0x6d')][_0x6e97('0x11a')](db['ChatWebsite'],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x187')});db['ChatInteraction']['belongsTo'](db[_0x6e97('0x77')],{'as':'Contact','foreignKey':'ContactId'});db[_0x6e97('0x6d')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'as':'Owner','foreignKey':_0x6e97('0x110')});db[_0x6e97('0x6d')][_0x6e97('0x11c')](db[_0x6e97('0x168')],{'through':_0x6e97('0x18c'),'as':_0x6e97('0x169')});db['ChatInteraction'][_0x6e97('0x11c')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x6e97('0x16b')});db[_0x6e97('0x6d')][_0x6e97('0x11c')](db['User'],{'as':_0x6e97('0x16c'),'through':_0x6e97('0x125'),'foreignKey':_0x6e97('0x18b')});db['ChatMessage'][_0x6e97('0x11a')](db['User'],{'onDelete':_0x6e97('0x10f'),'as':'User'});db['ChatMessage'][_0x6e97('0x11a')](db['CmContact'],{'onDelete':'cascade','as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c')});db['ChatMessage'][_0x6e97('0x11a')](db[_0x6e97('0x6d')],{'onDelete':_0x6e97('0x10f'),'as':_0x6e97('0x16e'),'foreignKey':_0x6e97('0x18b')});db['ChatMessage'][_0x6e97('0x11a')](db['Attachment'],{'as':_0x6e97('0x16d'),'foreignKey':_0x6e97('0x17b')});db[_0x6e97('0x6f')][_0x6e97('0x11a')](db[_0x6e97('0x68')],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x187')});db[_0x6e97('0x16f')][_0x6e97('0x112')](db['Attachment'],{'as':_0x6e97('0x18d'),'foreignKey':_0x6e97('0x170'),'onDelete':_0x6e97('0x10f'),'hooks':!![]});db[_0x6e97('0x16f')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'onDelete':_0x6e97('0x10f'),'as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c')});db['ChatOfflineMessage'][_0x6e97('0x11a')](db[_0x6e97('0x68')],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x187')});db[_0x6e97('0x72')][_0x6e97('0x11c')](db[_0x6e97('0x15')],{'as':_0x6e97('0x150'),'through':'UserChatQueue','hooks':!![]});db[_0x6e97('0x72')][_0x6e97('0x11c')](db[_0x6e97('0xe7')],{'through':_0x6e97('0x18e'),'as':_0x6e97('0x151')});db[_0x6e97('0x11d')][_0x6e97('0x112')](db[_0x6e97('0xd5')],{'as':_0x6e97('0x154'),'foreignKey':'ChatGroupId','onDelete':_0x6e97('0x10f')});db[_0x6e97('0x11d')][_0x6e97('0x11c')](db[_0x6e97('0x15')],{'as':_0x6e97('0x141'),'through':_0x6e97('0x18f')});db[_0x6e97('0x75')][_0x6e97('0x11a')](db['ChatWebsite'],{'as':_0x6e97('0x18a'),'foreignKey':'ChatWebsiteId'});db[_0x6e97('0x190')][_0x6e97('0x112')](db[_0x6e97('0x77')],{'as':'Contacts','foreignKey':_0x6e97('0x191')});db[_0x6e97('0x77')]['hasMany'](db[_0x6e97('0x79')],{'as':'Hoppers','foreignKey':'ContactId'});db[_0x6e97('0x77')][_0x6e97('0x112')](db['CmHopperFinal'],{'as':_0x6e97('0x115'),'foreignKey':_0x6e97('0x15c')});db[_0x6e97('0x77')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x6e97('0x15c')});db[_0x6e97('0x77')][_0x6e97('0x112')](db[_0x6e97('0x7f')],{'as':_0x6e97('0x7f'),'foreignKey':_0x6e97('0x15c')});db[_0x6e97('0x77')][_0x6e97('0x112')](db[_0x6e97('0x192')],{'as':_0x6e97('0x146'),'foreignKey':_0x6e97('0x15c')});db[_0x6e97('0x77')][_0x6e97('0x112')](db[_0x6e97('0x62')],{'as':_0x6e97('0x127'),'foreignKey':_0x6e97('0x15c'),'onDelete':_0x6e97('0x171')});db['CmContact'][_0x6e97('0x112')](db[_0x6e97('0x6d')],{'as':_0x6e97('0x117'),'foreignKey':_0x6e97('0x15c'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x6e97('0x5b')],{'as':_0x6e97('0x118'),'foreignKey':_0x6e97('0x15c'),'onDelete':_0x6e97('0x171')});db[_0x6e97('0x77')]['hasMany'](db['FaxInteraction'],{'as':_0x6e97('0x119'),'foreignKey':_0x6e97('0x15c'),'onDelete':'restrict'});db[_0x6e97('0x77')][_0x6e97('0x112')](db[_0x6e97('0x44')],{'as':_0x6e97('0x124'),'foreignKey':_0x6e97('0x15c'),'onDelete':_0x6e97('0x171')});db[_0x6e97('0x77')][_0x6e97('0x11a')](db['CmCompany'],{'as':_0x6e97('0x193'),'foreignKey':_0x6e97('0x191')});db[_0x6e97('0x77')][_0x6e97('0x11a')](db[_0x6e97('0x120')],{'as':'List','foreignKey':_0x6e97('0x164'),'onDelete':_0x6e97('0x10f')});db[_0x6e97('0x77')]['belongsToMany'](db[_0x6e97('0x15')],{'as':_0x6e97('0x16c'),'through':_0x6e97('0x11f')});db['CmContact'][_0x6e97('0x11c')](db[_0x6e97('0x168')],{'as':_0x6e97('0x169'),'through':_0x6e97('0x194')});db[_0x6e97('0x77')][_0x6e97('0x11c')](db['Tag'],{'through':_0x6e97('0x194'),'as':_0x6e97('0x16b')});db[_0x6e97('0x79')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'as':'Contact','foreignKey':_0x6e97('0x15c'),'onDelete':'cascade'});db[_0x6e97('0x79')][_0x6e97('0x11a')](db[_0x6e97('0x120')],{'as':_0x6e97('0x163'),'foreignKey':_0x6e97('0x164'),'onDelete':_0x6e97('0x10f')});db[_0x6e97('0x79')]['belongsTo'](db[_0x6e97('0x15')],{'as':_0x6e97('0x195'),'foreignKey':'UserId'});db[_0x6e97('0x79')][_0x6e97('0x11a')](db[_0x6e97('0x20')],{'as':_0x6e97('0x188'),'foreignKey':'VoiceQueueId','onDelete':_0x6e97('0x10f')});db['CmHopper']['belongsTo'](db[_0x6e97('0xeb')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0x6e97('0x15')],{'as':'Owner','foreignKey':_0x6e97('0x196')});db[_0x6e97('0x7a')][_0x6e97('0x11a')](db['CmContact'],{'as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c'),'onDelete':_0x6e97('0x10f')});db[_0x6e97('0x7a')][_0x6e97('0x11a')](db[_0x6e97('0x120')],{'as':_0x6e97('0x163'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x6e97('0x7a')][_0x6e97('0x11a')](db[_0x6e97('0x20')],{'as':'Queue','foreignKey':_0x6e97('0x143'),'onDelete':_0x6e97('0x10f')});db[_0x6e97('0x7a')][_0x6e97('0x11a')](db[_0x6e97('0xeb')],{'as':_0x6e97('0xeb'),'foreignKey':_0x6e97('0x197'),'onDelete':_0x6e97('0x10f')});db[_0x6e97('0x83')][_0x6e97('0x112')](db[_0x6e97('0x86')],{'as':{'plural':'All','singular':_0x6e97('0x198')},'foreignKey':_0x6e97('0x199'),'onDelete':_0x6e97('0x10f'),'hooks':!![]});db[_0x6e97('0x83')][_0x6e97('0x112')](db[_0x6e97('0x86')],{'as':{'plural':'Any','singular':_0x6e97('0x19a')},'foreignKey':_0x6e97('0x19b'),'onDelete':_0x6e97('0x10f'),'hooks':!![]});db['Automation'][_0x6e97('0x112')](db[_0x6e97('0x19c')],{'as':_0x6e97('0x19d'),'foreignKey':_0x6e97('0x19e'),'onDelete':_0x6e97('0x10f'),'hooks':!![]});db['Disposition'][_0x6e97('0x112')](db[_0x6e97('0x15f')],{'as':_0x6e97('0x160'),'foreignKey':_0x6e97('0x19f'),'onDelete':_0x6e97('0x10f')});db[_0x6e97('0x14a')][_0x6e97('0x112')](db[_0x6e97('0x14a')],{'as':_0x6e97('0x1a0'),'foreignKey':_0x6e97('0x14b'),'onDelete':_0x6e97('0x10f'),'hooks':!![],'required':![]});db[_0x6e97('0x14a')]['hasMany'](db[_0x6e97('0x1c')],{'as':_0x6e97('0x114'),'foreignKey':_0x6e97('0x14b'),'onDelete':_0x6e97('0x171')});db[_0x6e97('0x14a')]['hasMany'](db[_0x6e97('0x162')],{'as':_0x6e97('0x1a1'),'foreignKey':_0x6e97('0x14b')});db[_0x6e97('0x14a')]['hasMany'](db[_0x6e97('0x6c')],{'as':_0x6e97('0x1a2'),'foreignKey':'IntervalId'});db[_0x6e97('0x14a')][_0x6e97('0x112')](db['FaxApplication'],{'as':_0x6e97('0x1a3'),'foreignKey':'IntervalId'});db[_0x6e97('0x14a')]['hasMany'](db[_0x6e97('0x17d')],{'as':_0x6e97('0x1a4'),'foreignKey':'IntervalId'});db[_0x6e97('0x8d')]['belongsTo'](db[_0x6e97('0x40')],{});db[_0x6e97('0x8d')][_0x6e97('0x11a')](db[_0x6e97('0x9a')],{'foreignKey':_0x6e97('0x1a5')});db[_0x6e97('0x8d')]['belongsTo'](db[_0x6e97('0x98')],{'foreignKey':_0x6e97('0x1a6')});db['Sound'][_0x6e97('0x11c')](db[_0x6e97('0x1e')],{'as':_0x6e97('0x1a7'),'through':_0x6e97('0x1a8'),'onDelete':_0x6e97('0x171')});db[_0x6e97('0x168')][_0x6e97('0x11c')](db[_0x6e97('0x77')],{'through':_0x6e97('0x194')});db[_0x6e97('0x168')][_0x6e97('0x11c')](db[_0x6e97('0x6d')],{'through':_0x6e97('0x18c')});db['Tag']['belongsToMany'](db[_0x6e97('0x44')],{'through':_0x6e97('0x16a')});db[_0x6e97('0x168')][_0x6e97('0x11c')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x6e97('0x168')]['belongsToMany'](db[_0x6e97('0x52')],{'through':_0x6e97('0x178')});db['Tag']['belongsToMany'](db[_0x6e97('0x62')],{'through':_0x6e97('0x185')});db[_0x6e97('0x168')][_0x6e97('0x11c')](db['WhatsappInteraction'],{'through':_0x6e97('0x1a9')});db[_0x6e97('0x93')][_0x6e97('0x112')](db['Condition'],{'as':{'plural':_0x6e97('0x1aa'),'singular':_0x6e97('0x1ab')},'foreignKey':_0x6e97('0x1ac'),'onDelete':_0x6e97('0x10f'),'hooks':!![]});db[_0x6e97('0x93')][_0x6e97('0x112')](db[_0x6e97('0x86')],{'as':{'plural':'AnyConditions','singular':_0x6e97('0x1ad')},'foreignKey':_0x6e97('0x1ae'),'onDelete':_0x6e97('0x10f'),'hooks':!![]});db[_0x6e97('0x93')][_0x6e97('0x112')](db[_0x6e97('0x19c')],{'as':_0x6e97('0x19d'),'foreignKey':_0x6e97('0x1af'),'onDelete':_0x6e97('0x10f'),'hooks':!![]});db[_0x6e97('0x98')][_0x6e97('0x112')](db[_0x6e97('0x9e')],{'as':_0x6e97('0x1b0'),'onDelete':'cascade','foreignKey':_0x6e97('0x1a6'),'hooks':!![]});db[_0x6e97('0x9a')][_0x6e97('0x112')](db[_0x6e97('0x9e')],{'as':_0x6e97('0x1b0'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db['AnalyticMetric'][_0x6e97('0x112')](db[_0x6e97('0x9e')],{'as':_0x6e97('0x1b0'),'onDelete':'cascade','foreignKey':_0x6e97('0x1b1')});db[_0x6e97('0x9e')][_0x6e97('0x11a')](db['AnalyticMetric'],{'foreignKey':_0x6e97('0x1b1')});db[_0x6e97('0xa2')][_0x6e97('0x112')](db[_0x6e97('0x1b2')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x6e97('0x1b3')});db['SalesforceConfiguration'][_0x6e97('0x112')](db[_0x6e97('0xa5')],{'as':_0x6e97('0x1b4'),'onDelete':_0x6e97('0x10f'),'foreignKey':'SubjectId'});db[_0x6e97('0x1b2')][_0x6e97('0x112')](db[_0x6e97('0xa5')],{'as':_0x6e97('0x1b5'),'onDelete':_0x6e97('0x10f'),'foreignKey':'DescriptionId'});db[_0x6e97('0x1b2')][_0x6e97('0x112')](db[_0x6e97('0xa5')],{'as':'Fields','onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1b6')});db['SalesforceConfiguration']['belongsTo'](db[_0x6e97('0xa2')],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x1b3')});db[_0x6e97('0xa5')][_0x6e97('0x112')](db[_0x6e97('0xa5')],{'as':_0x6e97('0x1b7'),'foreignKey':'SubjectId'});db[_0x6e97('0xa5')][_0x6e97('0x112')](db[_0x6e97('0xa5')],{'as':_0x6e97('0x1b8'),'foreignKey':'DescriptionId'});db[_0x6e97('0xa5')]['hasMany'](db[_0x6e97('0xa5')],{'as':'Field','foreignKey':'FieldId'});db[_0x6e97('0xa5')][_0x6e97('0x11a')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['SugarcrmAccount']['hasMany'](db[_0x6e97('0xa8')],{'as':_0x6e97('0x1b9'),'onDelete':_0x6e97('0x10f'),'foreignKey':'AccountId'});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xa8')][_0x6e97('0x112')](db[_0x6e97('0xaa')],{'as':_0x6e97('0x1b5'),'onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0xa8')][_0x6e97('0x112')](db['SugarcrmField'],{'as':_0x6e97('0x1b0'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x6e97('0xa8')][_0x6e97('0x11a')](db['SugarcrmAccount'],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x1b3')});db[_0x6e97('0xaa')][_0x6e97('0x112')](db[_0x6e97('0xaa')],{'as':_0x6e97('0x1b7'),'foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xaa')][_0x6e97('0x112')](db['SugarcrmField'],{'as':'Description','foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0xaa')][_0x6e97('0x112')](db[_0x6e97('0xaa')],{'as':_0x6e97('0x1bc'),'foreignKey':_0x6e97('0x1b6')});db[_0x6e97('0xaa')]['belongsTo'](db[_0x6e97('0x95')],{'as':_0x6e97('0x95'),'foreignKey':'VariableId'});db[_0x6e97('0xac')][_0x6e97('0x112')](db[_0x6e97('0xae')],{'as':_0x6e97('0x1b9'),'onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1b3')});db[_0x6e97('0xae')][_0x6e97('0x112')](db[_0x6e97('0xb0')],{'as':_0x6e97('0x1b4'),'onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xae')][_0x6e97('0x112')](db[_0x6e97('0xb0')],{'as':_0x6e97('0x1b5'),'onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0xae')]['hasMany'](db[_0x6e97('0xb0')],{'as':'Fields','onDelete':_0x6e97('0x10f'),'foreignKey':'FieldId'});db[_0x6e97('0xae')][_0x6e97('0x11a')](db['DeskAccount'],{'as':'Account','foreignKey':_0x6e97('0x1b3')});db['DeskConfiguration'][_0x6e97('0x11c')](db[_0x6e97('0x168')],{'through':_0x6e97('0x1bd')});db[_0x6e97('0xb0')][_0x6e97('0x112')](db[_0x6e97('0xb0')],{'as':_0x6e97('0x1b7'),'foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xb0')][_0x6e97('0x112')](db[_0x6e97('0xb0')],{'as':_0x6e97('0x1b8'),'foreignKey':'DescriptionId'});db[_0x6e97('0xb0')][_0x6e97('0x112')](db[_0x6e97('0xb0')],{'as':_0x6e97('0x1bc'),'foreignKey':_0x6e97('0x1b6')});db[_0x6e97('0xb0')]['belongsTo'](db['Variable'],{'as':_0x6e97('0x95'),'foreignKey':_0x6e97('0x1be')});db['ZohoAccount'][_0x6e97('0x112')](db[_0x6e97('0x1bf')],{'as':'Configurations','onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1b3')});db['ZohoConfiguration'][_0x6e97('0x112')](db[_0x6e97('0x1c0')],{'as':_0x6e97('0x1b4'),'onDelete':_0x6e97('0x10f'),'foreignKey':'SubjectId'});db[_0x6e97('0x1bf')][_0x6e97('0x112')](db['ZohoField'],{'as':_0x6e97('0x1b5'),'onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1bb')});db['ZohoConfiguration'][_0x6e97('0x112')](db[_0x6e97('0x1c0')],{'as':'Fields','onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1b6')});db[_0x6e97('0x1bf')][_0x6e97('0x11a')](db[_0x6e97('0xb2')],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x1b3')});db[_0x6e97('0x1c0')]['hasMany'](db['ZohoField'],{'as':_0x6e97('0x1b7'),'foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0x1c0')]['hasMany'](db[_0x6e97('0x1c0')],{'as':_0x6e97('0x1b8'),'foreignKey':'DescriptionId'});db[_0x6e97('0x1c0')]['hasMany'](db['ZohoField'],{'as':_0x6e97('0x1bc'),'foreignKey':_0x6e97('0x1b6')});db[_0x6e97('0x1c0')]['belongsTo'](db[_0x6e97('0x95')],{'as':'Variable','foreignKey':_0x6e97('0x1be')});db[_0x6e97('0xb6')][_0x6e97('0x112')](db[_0x6e97('0xb7')],{'as':_0x6e97('0x1b9'),'onDelete':'cascade','foreignKey':_0x6e97('0x1b3')});db[_0x6e97('0xb7')][_0x6e97('0x112')](db[_0x6e97('0xb8')],{'as':'Subjects','foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xb7')][_0x6e97('0x112')](db[_0x6e97('0xb8')],{'as':_0x6e97('0x1b5'),'foreignKey':_0x6e97('0x1bb')});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0x6e97('0x1b0'),'foreignKey':_0x6e97('0x1b6')});db[_0x6e97('0xb7')][_0x6e97('0x11a')](db[_0x6e97('0xb6')],{'as':_0x6e97('0x167'),'foreignKey':'AccountId'});db[_0x6e97('0xb7')][_0x6e97('0x11c')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField']['hasMany'](db[_0x6e97('0xb8')],{'as':'Subject','foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xb8')][_0x6e97('0x112')](db['ZendeskField'],{'as':_0x6e97('0x1b8'),'foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0xb8')]['hasMany'](db[_0x6e97('0xb8')],{'as':_0x6e97('0x1bc'),'foreignKey':_0x6e97('0x1b6')});db[_0x6e97('0xb8')]['belongsTo'](db[_0x6e97('0x95')],{'as':'Variable','foreignKey':'VariableId'});db[_0x6e97('0xb9')][_0x6e97('0x112')](db[_0x6e97('0xbb')],{'as':'Configurations','onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1b3')});db[_0x6e97('0xbb')][_0x6e97('0x112')](db[_0x6e97('0xbd')],{'as':_0x6e97('0x1b4'),'onDelete':'cascade','foreignKey':_0x6e97('0x1ba')});db['FreshdeskConfiguration'][_0x6e97('0x112')](db[_0x6e97('0xbd')],{'as':_0x6e97('0x1b5'),'onDelete':_0x6e97('0x10f'),'foreignKey':'DescriptionId'});db[_0x6e97('0xbb')][_0x6e97('0x112')](db[_0x6e97('0xbd')],{'as':_0x6e97('0x1b0'),'onDelete':_0x6e97('0x10f'),'foreignKey':'FieldId'});db[_0x6e97('0xbb')]['belongsTo'](db[_0x6e97('0xb9')],{'as':_0x6e97('0x167'),'foreignKey':'AccountId'});db['FreshdeskConfiguration']['belongsToMany'](db[_0x6e97('0x168')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x6e97('0xbd')][_0x6e97('0x112')](db[_0x6e97('0xbd')],{'as':_0x6e97('0x1b7'),'foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xbd')][_0x6e97('0x112')](db['FreshdeskField'],{'as':_0x6e97('0x1b8'),'foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0xbd')][_0x6e97('0x112')](db['FreshdeskField'],{'as':_0x6e97('0x1bc'),'foreignKey':_0x6e97('0x1b6')});db[_0x6e97('0xbd')][_0x6e97('0x11a')](db['Variable'],{'as':'Variable','foreignKey':_0x6e97('0x1be')});db['VtigerAccount'][_0x6e97('0x112')](db[_0x6e97('0xc1')],{'as':_0x6e97('0x1b9'),'onDelete':_0x6e97('0x10f'),'foreignKey':'AccountId'});db[_0x6e97('0xc1')][_0x6e97('0x112')](db['VtigerField'],{'as':_0x6e97('0x1b4'),'foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xc1')][_0x6e97('0x112')](db[_0x6e97('0xc2')],{'as':'Descriptions','foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0xc1')][_0x6e97('0x112')](db[_0x6e97('0xc2')],{'as':_0x6e97('0x1b0'),'foreignKey':'FieldId'});db[_0x6e97('0xc1')][_0x6e97('0x11a')](db[_0x6e97('0xbf')],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x1b3')});db[_0x6e97('0xc2')][_0x6e97('0x112')](db['VtigerField'],{'as':_0x6e97('0x1b7'),'foreignKey':_0x6e97('0x1ba')});db['VtigerField'][_0x6e97('0x112')](db[_0x6e97('0xc2')],{'as':_0x6e97('0x1b8'),'foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0xc2')][_0x6e97('0x112')](db[_0x6e97('0xc2')],{'as':'Field','foreignKey':_0x6e97('0x1b6')});db['VtigerField'][_0x6e97('0x11a')](db[_0x6e97('0x95')],{'as':_0x6e97('0x95'),'foreignKey':_0x6e97('0x1be')});db['ServicenowAccount']['hasMany'](db[_0x6e97('0x1c1')],{'as':'Configurations','onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1b3')});db['ServicenowConfiguration']['hasMany'](db[_0x6e97('0x1c2')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x6e97('0x1c1')][_0x6e97('0x112')](db[_0x6e97('0x1c2')],{'as':_0x6e97('0x1b5'),'foreignKey':'DescriptionId'});db[_0x6e97('0x1c1')]['hasMany'](db[_0x6e97('0x1c2')],{'as':_0x6e97('0x1b0'),'foreignKey':_0x6e97('0x1b6')});db[_0x6e97('0x1c1')][_0x6e97('0x11a')](db[_0x6e97('0xc4')],{'as':_0x6e97('0x167'),'foreignKey':'AccountId'});db[_0x6e97('0x1c2')][_0x6e97('0x112')](db[_0x6e97('0x1c2')],{'as':_0x6e97('0x1b7'),'foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0x1c2')]['hasMany'](db[_0x6e97('0x1c2')],{'as':_0x6e97('0x1b8'),'foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0x1c2')][_0x6e97('0x112')](db[_0x6e97('0x1c2')],{'as':_0x6e97('0x1bc'),'foreignKey':_0x6e97('0x1b6')});db[_0x6e97('0x1c2')][_0x6e97('0x11a')](db[_0x6e97('0x95')],{'as':_0x6e97('0x95'),'foreignKey':_0x6e97('0x1be')});db[_0x6e97('0x1c3')][_0x6e97('0x112')](db[_0x6e97('0xc9')],{'as':_0x6e97('0x1b9'),'onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1b3')});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':_0x6e97('0x1b4'),'onDelete':'cascade','foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xc9')][_0x6e97('0x112')](db[_0x6e97('0xcb')],{'as':_0x6e97('0x1b5'),'onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0xc9')][_0x6e97('0x112')](db[_0x6e97('0xcb')],{'as':'Fields','onDelete':_0x6e97('0x10f'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0x6e97('0x11a')](db['Dynamics365Account'],{'as':_0x6e97('0x167'),'foreignKey':_0x6e97('0x1b3')});db[_0x6e97('0xcb')]['hasMany'](db['Dynamics365Field'],{'as':_0x6e97('0x1b7'),'foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xcb')][_0x6e97('0x112')](db[_0x6e97('0xcb')],{'as':_0x6e97('0x1b8'),'foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0xcb')]['hasMany'](db[_0x6e97('0xcb')],{'as':'Field','foreignKey':_0x6e97('0x1b6')});db[_0x6e97('0xcb')][_0x6e97('0x11a')](db[_0x6e97('0x95')],{'as':_0x6e97('0x95'),'foreignKey':_0x6e97('0x1be')});db[_0x6e97('0xcd')]['hasMany'](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x6e97('0x1b3')});db[_0x6e97('0xcf')]['hasMany'](db[_0x6e97('0xd0')],{'as':_0x6e97('0x1b4'),'foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xcf')]['hasMany'](db[_0x6e97('0xd0')],{'as':_0x6e97('0x1b5'),'foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0xcf')][_0x6e97('0x112')](db['FreshsalesField'],{'as':_0x6e97('0x1b0'),'foreignKey':_0x6e97('0x1b6')});db['FreshsalesConfiguration'][_0x6e97('0x11a')](db[_0x6e97('0xcd')],{'as':_0x6e97('0x167'),'foreignKey':'AccountId'});db[_0x6e97('0xd0')][_0x6e97('0x112')](db[_0x6e97('0xd0')],{'as':_0x6e97('0x1b7'),'foreignKey':_0x6e97('0x1ba')});db[_0x6e97('0xd0')]['hasMany'](db['FreshsalesField'],{'as':_0x6e97('0x1b8'),'foreignKey':_0x6e97('0x1bb')});db[_0x6e97('0xd0')][_0x6e97('0x112')](db[_0x6e97('0xd0')],{'as':_0x6e97('0x1bc'),'foreignKey':_0x6e97('0x1b6')});db[_0x6e97('0xd0')][_0x6e97('0x11a')](db[_0x6e97('0x95')],{'as':_0x6e97('0x95'),'foreignKey':'VariableId'});db[_0x6e97('0xd4')][_0x6e97('0x11a')](db[_0x6e97('0x68')],{});db[_0x6e97('0xd4')][_0x6e97('0x11a')](db[_0x6e97('0x120')],{'as':'List','foreignKey':'ListId'});db[_0x6e97('0xd4')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'as':'Contact','foreignKey':_0x6e97('0x15c')});db['ChatQueueReport'][_0x6e97('0x11a')](db[_0x6e97('0x6d')],{});db[_0x6e97('0xd4')][_0x6e97('0x11a')](db[_0x6e97('0x6f')],{});db['ChatQueueReport'][_0x6e97('0x11a')](db[_0x6e97('0x15')],{});db['ChatQueueReport'][_0x6e97('0x11a')](db[_0x6e97('0x72')],{});db[_0x6e97('0xd5')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'onDelete':'cascade','foreignKey':_0x6e97('0x1c4')});db['ChatInternalMessage']['belongsTo'](db['User'],{'onDelete':_0x6e97('0x10f'),'foreignKey':_0x6e97('0x1c5')});db['JscriptySessionReport'][_0x6e97('0x112')](db['JscriptyQuestionReport'],{'foreignKey':_0x6e97('0x1c6'),'onDelete':_0x6e97('0x10f')});db[_0x6e97('0x192')]['hasMany'](db[_0x6e97('0x1c7')],{'foreignKey':_0x6e97('0x1c6'),'onDelete':'cascade'});db[_0x6e97('0xda')][_0x6e97('0x11a')](db['SmsAccount'],{});db[_0x6e97('0xda')][_0x6e97('0x11a')](db[_0x6e97('0x120')],{'as':_0x6e97('0x163'),'foreignKey':'ListId'});db[_0x6e97('0xda')][_0x6e97('0x11a')](db['CmContact'],{'as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c')});db[_0x6e97('0xda')][_0x6e97('0x11a')](db[_0x6e97('0x5b')],{});db['SmsQueueReport'][_0x6e97('0x11a')](db[_0x6e97('0x5d')],{});db[_0x6e97('0xda')][_0x6e97('0x11a')](db['User'],{});db['SmsQueueReport']['belongsTo'](db[_0x6e97('0x17e')],{});db['JscriptyProject'][_0x6e97('0x112')](db[_0x6e97('0x192')],{'foreignKey':_0x6e97('0x1c8')});db['JscriptyProject'][_0x6e97('0x112')](db[_0x6e97('0x1c9')],{'foreignKey':_0x6e97('0x1c8')});db[_0x6e97('0xdd')][_0x6e97('0x112')](db[_0x6e97('0x1c7')],{'foreignKey':_0x6e97('0x1c8')});db[_0x6e97('0xe1')][_0x6e97('0x11c')](db[_0x6e97('0x15')],{'as':'Users','through':_0x6e97('0x13d')});db[_0x6e97('0xe7')][_0x6e97('0x11c')](db[_0x6e97('0x15')],{'as':_0x6e97('0x150'),'through':'user_has_teams'});db[_0x6e97('0xe7')][_0x6e97('0x11c')](db[_0x6e97('0x20')],{'through':_0x6e97('0x10c'),'as':_0x6e97('0x1ca')});db[_0x6e97('0xe7')]['belongsToMany'](db['MailQueue'],{'through':_0x6e97('0x1cb'),'as':_0x6e97('0x1cc')});db[_0x6e97('0xe7')]['belongsToMany'](db['ChatQueue'],{'through':_0x6e97('0x18e'),'as':_0x6e97('0x1cd')});db[_0x6e97('0xe7')][_0x6e97('0x11c')](db[_0x6e97('0x176')],{'through':_0x6e97('0x1ce'),'as':_0x6e97('0x12c')});db['Team'][_0x6e97('0x11c')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x6e97('0x12d')});db['Team'][_0x6e97('0x11c')](db[_0x6e97('0x66')],{'through':'team_has_openchannel_queues','as':_0x6e97('0x12e')});db[_0x6e97('0xe7')][_0x6e97('0x11c')](db[_0x6e97('0x108')],{'through':'team_has_whatsapp_queues','as':_0x6e97('0x1cf')});db[_0x6e97('0xeb')][_0x6e97('0x112')](db[_0x6e97('0x79')],{'as':_0x6e97('0x142'),'foreignKey':_0x6e97('0x197')});db[_0x6e97('0xeb')][_0x6e97('0x112')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x6e97('0x197')});db['Campaign']['hasMany'](db[_0x6e97('0x7d')],{'as':_0x6e97('0x144'),'foreignKey':_0x6e97('0x197')});db[_0x6e97('0xeb')]['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x6e97('0xeb')][_0x6e97('0x11a')](db[_0x6e97('0x2f')],{'as':_0x6e97('0x2f'),'foreignKey':_0x6e97('0x147')});db[_0x6e97('0xeb')][_0x6e97('0x11a')](db[_0x6e97('0x2f')],{'as':_0x6e97('0x148'),'foreignKey':'TrunkBackupId'});db[_0x6e97('0xeb')][_0x6e97('0x11a')](db['Interval'],{'as':_0x6e97('0x14a'),'foreignKey':_0x6e97('0x14b')});db[_0x6e97('0xeb')][_0x6e97('0x11a')](db[_0x6e97('0xe1')],{'as':_0x6e97('0xe1'),'foreignKey':_0x6e97('0x1d0')});db['Campaign']['belongsToMany'](db[_0x6e97('0x120')],{'as':'Lists','through':_0x6e97('0x1d1')});db[_0x6e97('0xeb')][_0x6e97('0x11c')](db[_0x6e97('0x120')],{'as':_0x6e97('0x152'),'through':_0x6e97('0x1d2')});db[_0x6e97('0x16d')][_0x6e97('0x11a')](db['ChatOfflineMessage'],{'as':_0x6e97('0x16f'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0x6e97('0x11a')](db['MailMessage'],{});db[_0x6e97('0x1d3')]['belongsTo'](db[_0x6e97('0x44')],{});db['MailTransferReport'][_0x6e97('0x11a')](db[_0x6e97('0x40')],{'foreignKey':_0x6e97('0x1d4'),'as':_0x6e97('0x1d5')});db[_0x6e97('0x1d3')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x6e97('0x1d3')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'foreignKey':'ToUserId','as':_0x6e97('0x1d6')});db[_0x6e97('0x1d3')][_0x6e97('0x11a')](db[_0x6e97('0x42')],{'foreignKey':'ToMailQueueId','as':_0x6e97('0x1d7')});db['MailTransferReport'][_0x6e97('0x11a')](db[_0x6e97('0x40')],{'foreignKey':_0x6e97('0x1d8'),'as':_0x6e97('0x1d9')});db['ChatTransferReport'][_0x6e97('0x11a')](db[_0x6e97('0x6f')],{});db[_0x6e97('0xf1')][_0x6e97('0x11a')](db[_0x6e97('0x6d')],{});db[_0x6e97('0xf1')][_0x6e97('0x11a')](db['ChatWebsite'],{'foreignKey':_0x6e97('0x1da'),'as':_0x6e97('0x1d5')});db['ChatTransferReport'][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'foreignKey':_0x6e97('0x1db'),'as':_0x6e97('0x1dc')});db[_0x6e97('0xf1')][_0x6e97('0x11a')](db['User'],{'foreignKey':_0x6e97('0x1dd'),'as':'ToAgent'});db[_0x6e97('0xf1')][_0x6e97('0x11a')](db[_0x6e97('0x72')],{'foreignKey':_0x6e97('0x1de'),'as':_0x6e97('0x1d7')});db['ChatTransferReport'][_0x6e97('0x11a')](db[_0x6e97('0x68')],{'foreignKey':_0x6e97('0x1df'),'as':'ToAccount'});db[_0x6e97('0xf3')]['belongsTo'](db['FaxMessage'],{});db[_0x6e97('0xf3')]['belongsTo'](db[_0x6e97('0x52')],{});db[_0x6e97('0xf3')][_0x6e97('0x11a')](db[_0x6e97('0x4e')],{'foreignKey':_0x6e97('0x1e0'),'as':_0x6e97('0x1d5')});db[_0x6e97('0xf3')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'foreignKey':'FromUserId','as':_0x6e97('0x1dc')});db[_0x6e97('0xf3')][_0x6e97('0x11a')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x6e97('0xf3')][_0x6e97('0x11a')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x6e97('0x1d7')});db[_0x6e97('0xf3')][_0x6e97('0x11a')](db[_0x6e97('0x4e')],{'foreignKey':'ToFaxAccountId','as':_0x6e97('0x1d9')});db[_0x6e97('0xf4')][_0x6e97('0x11a')](db[_0x6e97('0x64')],{});db[_0x6e97('0xf4')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x6e97('0xf4')]['belongsTo'](db[_0x6e97('0x5f')],{'foreignKey':_0x6e97('0x1e1'),'as':_0x6e97('0x1d5')});db[_0x6e97('0xf4')]['belongsTo'](db[_0x6e97('0x15')],{'foreignKey':_0x6e97('0x1db'),'as':_0x6e97('0x1dc')});db[_0x6e97('0xf4')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'foreignKey':_0x6e97('0x1dd'),'as':_0x6e97('0x1d6')});db['OpenchannelTransferReport'][_0x6e97('0x11a')](db[_0x6e97('0x66')],{'foreignKey':'ToOpenchannelQueueId','as':_0x6e97('0x1d7')});db[_0x6e97('0xf4')][_0x6e97('0x11a')](db[_0x6e97('0x5f')],{'foreignKey':_0x6e97('0x1e2'),'as':_0x6e97('0x1d9')});db[_0x6e97('0xf5')][_0x6e97('0x11a')](db[_0x6e97('0x5d')],{});db[_0x6e97('0xf5')][_0x6e97('0x11a')](db['SmsInteraction'],{});db[_0x6e97('0xf5')]['belongsTo'](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0x6e97('0x1d5')});db[_0x6e97('0xf5')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'foreignKey':'FromUserId','as':_0x6e97('0x1dc')});db[_0x6e97('0xf5')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'foreignKey':'ToUserId','as':_0x6e97('0x1d6')});db[_0x6e97('0xf5')][_0x6e97('0x11a')](db[_0x6e97('0x17e')],{'foreignKey':'ToSmsQueueId','as':_0x6e97('0x1d7')});db[_0x6e97('0xf5')][_0x6e97('0x11a')](db[_0x6e97('0x58')],{'foreignKey':_0x6e97('0x1e3'),'as':_0x6e97('0x1d9')});db['CmList']['hasMany'](db[_0x6e97('0x15f')],{'as':'Dispositions','foreignKey':_0x6e97('0x164')});db['CmList'][_0x6e97('0x112')](db['CmCustomField'],{'as':_0x6e97('0x1e4'),'foreignKey':'ListId'});db[_0x6e97('0x120')][_0x6e97('0x112')](db['CmContact'],{'as':_0x6e97('0x11e'),'onDelete':'cascade','foreignKey':'ListId'});db[_0x6e97('0x120')]['hasMany'](db[_0x6e97('0x1e5')],{'as':'HopperFinals','foreignKey':_0x6e97('0x164')});db['CmList'][_0x6e97('0x112')](db[_0x6e97('0x7d')],{'as':_0x6e97('0x116'),'foreignKey':_0x6e97('0x164')});db[_0x6e97('0x120')][_0x6e97('0x112')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x6e97('0x120')]['belongsToMany'](db['VoiceQueue'],{'as':_0x6e97('0x1e6'),'through':_0x6e97('0x14f')});db[_0x6e97('0x120')][_0x6e97('0x11c')](db[_0x6e97('0x15')],{'as':_0x6e97('0x150'),'through':_0x6e97('0x122')});db[_0x6e97('0xf8')][_0x6e97('0x112')](db[_0x6e97('0x1c')],{'as':_0x6e97('0x114'),'onDelete':_0x6e97('0x10f')});db[_0x6e97('0xf8')][_0x6e97('0x11c')](db[_0x6e97('0x15')],{'as':_0x6e97('0x150'),'through':'user_has_voice_prefixes'});db[_0x6e97('0xfa')][_0x6e97('0x112')](db['User'],{'as':_0x6e97('0x16c'),'foreignKey':'userProfileId'});db['UserProfile']['hasMany'](db[_0x6e97('0xfc')],{'as':_0x6e97('0x1e7'),'foreignKey':_0x6e97('0x11b'),'onDelete':_0x6e97('0x10f')});db[_0x6e97('0xfc')][_0x6e97('0x112')](db[_0x6e97('0x1e8')],{'as':_0x6e97('0x1e9'),'foreignKey':_0x6e97('0x1ea'),'onDelete':'cascade'});db[_0x6e97('0x139')][_0x6e97('0x112')](db['Disposition'],{'as':_0x6e97('0x160'),'foreignKey':_0x6e97('0x1eb')});db[_0x6e97('0x139')][_0x6e97('0x112')](db[_0x6e97('0x84')],{'as':_0x6e97('0x174'),'foreignKey':_0x6e97('0x1eb')});db['WhatsappAccount'][_0x6e97('0x112')](db[_0x6e97('0x105')],{'as':_0x6e97('0x154'),'foreignKey':'WhatsappAccountId'});db[_0x6e97('0x139')][_0x6e97('0x112')](db[_0x6e97('0x103')],{'as':_0x6e97('0x161')});db[_0x6e97('0x139')][_0x6e97('0x112')](db[_0x6e97('0x101')],{'as':_0x6e97('0x140')});db[_0x6e97('0x139')][_0x6e97('0x11a')](db[_0x6e97('0x120')],{'as':_0x6e97('0x163'),'foreignKey':_0x6e97('0x164')});db[_0x6e97('0x139')][_0x6e97('0x11a')](db[_0x6e97('0x14c')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x6e97('0x139')][_0x6e97('0x11c')](db['User'],{'as':_0x6e97('0x150'),'through':_0x6e97('0x13b')});db['WhatsappApplication'][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'onDelete':_0x6e97('0x171')});db[_0x6e97('0x101')][_0x6e97('0x11a')](db['WhatsappQueue'],{'onDelete':'restrict'});db[_0x6e97('0x101')][_0x6e97('0x11a')](db[_0x6e97('0x139')],{'onDelete':_0x6e97('0x171')});db[_0x6e97('0x101')][_0x6e97('0x11a')](db[_0x6e97('0x14a')],{'onDelete':_0x6e97('0x171'),'foreignKey':_0x6e97('0x14b')});db[_0x6e97('0x101')][_0x6e97('0x11a')](db['Tag'],{'onDelete':_0x6e97('0x171'),'foreignKey':_0x6e97('0x172')});db[_0x6e97('0x103')][_0x6e97('0x112')](db[_0x6e97('0x105')],{'as':_0x6e97('0x154'),'onDelete':'cascade','foreignKey':_0x6e97('0x1ec')});db[_0x6e97('0x103')][_0x6e97('0x11a')](db[_0x6e97('0x139')],{'as':'Account','foreignKey':_0x6e97('0x1eb')});db[_0x6e97('0x103')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c')});db[_0x6e97('0x103')][_0x6e97('0x11a')](db['User'],{'as':_0x6e97('0x177'),'foreignKey':_0x6e97('0x110')});db[_0x6e97('0x103')][_0x6e97('0x11c')](db[_0x6e97('0x168')],{'through':_0x6e97('0x1a9'),'as':_0x6e97('0x169')});db[_0x6e97('0x103')][_0x6e97('0x11c')](db[_0x6e97('0x168')],{'through':'whatsapp_interaction_has_tags','as':_0x6e97('0x16b')});db[_0x6e97('0x103')]['belongsToMany'](db['User'],{'as':_0x6e97('0x16c'),'through':_0x6e97('0x12a'),'foreignKey':_0x6e97('0x1ec')});db[_0x6e97('0x105')][_0x6e97('0x11a')](db[_0x6e97('0x15')],{'as':_0x6e97('0x15')});db[_0x6e97('0x105')]['belongsTo'](db['CmContact'],{'onDelete':_0x6e97('0x10f'),'as':_0x6e97('0x15b')});db[_0x6e97('0x105')][_0x6e97('0x11a')](db[_0x6e97('0x103')],{'onDelete':'cascade','as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0x6e97('0x105')][_0x6e97('0x11a')](db[_0x6e97('0x139')],{'as':'Account','foreignKey':_0x6e97('0x1eb')});db[_0x6e97('0x1ed')][_0x6e97('0x11a')](db['WhatsappAccount'],{});db[_0x6e97('0x1ed')]['belongsTo'](db[_0x6e97('0x120')],{'as':'List','foreignKey':_0x6e97('0x164')});db[_0x6e97('0x1ed')][_0x6e97('0x11a')](db[_0x6e97('0x77')],{'as':_0x6e97('0x15b'),'foreignKey':_0x6e97('0x15c')});db[_0x6e97('0x1ed')][_0x6e97('0x11a')](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0x6e97('0x11a')](db[_0x6e97('0x108')],{});db[_0x6e97('0x1ed')][_0x6e97('0x11a')](db[_0x6e97('0x105')],{});db['WhatsappQueueReport'][_0x6e97('0x11a')](db[_0x6e97('0x15')],{});db[_0x6e97('0x1ee')]['belongsTo'](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0x6e97('0x11a')](db[_0x6e97('0x103')],{});db[_0x6e97('0x1ee')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0x6e97('0x1d5')});db[_0x6e97('0x1ee')][_0x6e97('0x11a')](db['WhatsappAccount'],{'foreignKey':_0x6e97('0x1ef'),'as':_0x6e97('0x1d9')});db[_0x6e97('0x1ee')][_0x6e97('0x11a')](db[_0x6e97('0x108')],{'foreignKey':_0x6e97('0x1f0'),'as':_0x6e97('0x1d7')});db[_0x6e97('0x1ee')]['belongsTo'](db['User'],{'foreignKey':_0x6e97('0x1db'),'as':_0x6e97('0x1dc')});db['WhatsappTransferReport']['belongsTo'](db[_0x6e97('0x15')],{'foreignKey':_0x6e97('0x1dd'),'as':_0x6e97('0x1d6')});db[_0x6e97('0x108')][_0x6e97('0x11c')](db[_0x6e97('0x15')],{'as':_0x6e97('0x150'),'through':_0x6e97('0x3a'),'foreignKey':_0x6e97('0x1f1')});db['WhatsappQueue'][_0x6e97('0x11c')](db[_0x6e97('0xe7')],{'through':_0x6e97('0x1f2'),'as':_0x6e97('0x151')});module[_0x6e97('0x1f3')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 51ef292..f0ca74e 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cbe=['/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','/api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','root','/www','static','join','/demo','/snippet','snippet','3.0.0','route','get','sendFile','resolve','appPath','username','password','apiKey','firstName','street','phone','fax','email','clientSecret','securityToken','code','accessKey','token','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','exten','clientEmail','privateKey','accesskeyid','key','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','isString','replace','@@{','}@@','lodash','path','express','express-winston','util','./errors','./config/logger','auth','default','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','format','method','headers','x-forwarded-for','url','responseTime','user','name','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','role','other','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/action','/api/automations','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','/api/triggers','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field'];(function(_0x309997,_0x197637){var _0x135719=function(_0x5ebdb7){while(--_0x5ebdb7){_0x309997['push'](_0x309997['shift']());}};_0x135719(++_0x197637);}(_0x5cbe,0x79));var _0xe5cb=function(_0x185068,_0x441dac){_0x185068=_0x185068-0x0;var _0x1547f3=_0x5cbe[_0x185068];return _0x1547f3;};'use strict';var _=require(_0xe5cb('0x0'));var path=require(_0xe5cb('0x1'));var express=require(_0xe5cb('0x2'));var ewinston=require(_0xe5cb('0x3'));var util=require(_0xe5cb('0x4'));var errors=require(_0xe5cb('0x5'));var config=require('./config/environment');var logger=require('./config/logger')('api');var authLogger=require(_0xe5cb('0x6'))(_0xe5cb('0x7'));exports[_0xe5cb('0x8')]=function(_0x22c3b2){_0x22c3b2['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2f463e,_0x3aa869){var _0x514bd3=_0xe5cb('0x9');if(!_['isEmpty'](_0x2f463e['body'])){_0x514bd3+='\x20body=%s';var _0x414dfc=_0x2f463e[_0xe5cb('0xa')];maskSensitiveData(_0x414dfc);}return util[_0xe5cb('0xb')](_0x514bd3,_0x2f463e[_0xe5cb('0xc')],_0x2f463e[_0xe5cb('0xd')][_0xe5cb('0xe')]?_0x2f463e['headers'][_0xe5cb('0xe')]:_0x2f463e['connection']['remoteAddress']||_0x2f463e['ip'],_0x2f463e[_0xe5cb('0xf')],_0x3aa869['statusCode'],_0x3aa869[_0xe5cb('0x10')],_0x2f463e['user']?_0x2f463e[_0xe5cb('0x11')]['id']:null,_0x2f463e[_0xe5cb('0x11')]?_0x2f463e[_0xe5cb('0x11')][_0xe5cb('0x12')]:null,_0x2f463e['user']?_0x2f463e[_0xe5cb('0x11')]['role']:null,_0x414dfc?util[_0xe5cb('0x13')](_0x414dfc,![],null):'');}}));_0x22c3b2[_0xe5cb('0x14')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x58d268,_0x50283c){var _0x508130=_0xe5cb('0x15');if(_0x58d268[_0xe5cb('0xa')]&&_0x58d268['body'][_0xe5cb('0x16')]&&_0x58d268[_0xe5cb('0xa')][_0xe5cb('0x17')]){_0x508130=_0xe5cb('0x18');}return util[_0xe5cb('0xb')](_0x508130,_0x58d268[_0xe5cb('0xc')],_0x58d268[_0xe5cb('0xd')][_0xe5cb('0xe')]?_0x58d268[_0xe5cb('0xd')]['x-forwarded-for']:_0x58d268[_0xe5cb('0x19')]['remoteAddress']||_0x58d268['ip'],_0x58d268[_0xe5cb('0xf')],_0x50283c['statusCode'],_0x50283c['responseTime'],_0x58d268[_0xe5cb('0x11')]?_0x58d268[_0xe5cb('0x11')]['id']:null,_0x58d268[_0xe5cb('0x11')]?_0x58d268['user']['name']:null,_0x58d268[_0xe5cb('0x11')]?_0x58d268['user'][_0xe5cb('0x1a')]:null,_0x58d268[_0xe5cb('0xa')]&&_0x58d268['body'][_0xe5cb('0x16')]?_0x58d268[_0xe5cb('0xa')]['device']:_0xe5cb('0x1b'),_0x58d268[_0xe5cb('0xa')]&&_0x58d268[_0xe5cb('0xa')][_0xe5cb('0x17')]?_0x58d268[_0xe5cb('0xa')][_0xe5cb('0x17')]:'',_0x58d268[_0xe5cb('0xa')]&&_0x58d268[_0xe5cb('0xa')][_0xe5cb('0x1c')]?_0x58d268[_0xe5cb('0xa')]['agent_name']:'');},'ignoreRoute':function(_0x4c2549){var _0x2cdf41=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2cdf41['test'](_0x4c2549[_0xe5cb('0xf')]);}}));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x1d'),require(_0xe5cb('0x1e')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x1f'),require(_0xe5cb('0x20')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x21'),require('./api/voiceContext'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x22'),require(_0xe5cb('0x23')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x24'),require('./api/voiceMusicOnHold'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x25'),require(_0xe5cb('0x26')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x27'),require(_0xe5cb('0x28')));_0x22c3b2[_0xe5cb('0x14')]('/api/screen/recordings',require(_0xe5cb('0x29')));_0x22c3b2['use'](_0xe5cb('0x2a'),require(_0xe5cb('0x2b')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x2c'),require(_0xe5cb('0x2d')));_0x22c3b2[_0xe5cb('0x14')]('/api/voice/calls/reports',require(_0xe5cb('0x2e')));_0x22c3b2['use']('/api/voice/dials/reports',require(_0xe5cb('0x2f')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x30'),require(_0xe5cb('0x31')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x32'),require(_0xe5cb('0x33')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x34'),require(_0xe5cb('0x35')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x36'),require(_0xe5cb('0x37')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x38'),require('./api/voiceTransferReport'));_0x22c3b2[_0xe5cb('0x14')]('/api/mail/out_servers',require(_0xe5cb('0x39')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x3a'),require(_0xe5cb('0x3b')));_0x22c3b2[_0xe5cb('0x14')]('/api/mail/queues',require(_0xe5cb('0x3c')));_0x22c3b2[_0xe5cb('0x14')]('/api/mail/substatuses',require(_0xe5cb('0x3d')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x3e'),require('./api/mailInteraction'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x3f'),require(_0xe5cb('0x40')));_0x22c3b2['use']('/api/mail/applications',require(_0xe5cb('0x41')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x42'),require(_0xe5cb('0x43')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x44'),require(_0xe5cb('0x45')));_0x22c3b2[_0xe5cb('0x14')]('/api/dashboards/items',require('./api/dashboardItem'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x46'),require(_0xe5cb('0x47')));_0x22c3b2['use'](_0xe5cb('0x48'),require(_0xe5cb('0x49')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x4a'),require(_0xe5cb('0x4b')));_0x22c3b2[_0xe5cb('0x14')]('/api/fax/messages',require(_0xe5cb('0x4c')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x4d'),require(_0xe5cb('0x4e')));_0x22c3b2['use'](_0xe5cb('0x4f'),require(_0xe5cb('0x50')));_0x22c3b2[_0xe5cb('0x14')]('/api/sms/accounts',require(_0xe5cb('0x51')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x52'),require(_0xe5cb('0x53')));_0x22c3b2['use'](_0xe5cb('0x54'),require(_0xe5cb('0x55')));_0x22c3b2[_0xe5cb('0x14')]('/api/sms/messages',require(_0xe5cb('0x56')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x57'),require(_0xe5cb('0x58')));_0x22c3b2[_0xe5cb('0x14')]('/api/openchannel/accounts',require(_0xe5cb('0x59')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x5a'),require(_0xe5cb('0x5b')));_0x22c3b2['use']('/api/openchannel/interactions',require(_0xe5cb('0x5c')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x5d'),require(_0xe5cb('0x5e')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x5f'),require(_0xe5cb('0x60')));_0x22c3b2['use'](_0xe5cb('0x61'),require(_0xe5cb('0x62')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x63'),require(_0xe5cb('0x64')));_0x22c3b2['use'](_0xe5cb('0x65'),require(_0xe5cb('0x66')));_0x22c3b2[_0xe5cb('0x14')]('/api/chat/interactions',require(_0xe5cb('0x67')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x68'),require(_0xe5cb('0x69')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x6a'),require(_0xe5cb('0x6b')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x6c'),require(_0xe5cb('0x6d')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x6e'),require(_0xe5cb('0x6f')));_0x22c3b2[_0xe5cb('0x14')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x22c3b2[_0xe5cb('0x14')]('/api/cm/companies',require(_0xe5cb('0x70')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x71'),require(_0xe5cb('0x72')));_0x22c3b2[_0xe5cb('0x14')]('/api/cm/hopper',require(_0xe5cb('0x73')));_0x22c3b2['use'](_0xe5cb('0x74'),require(_0xe5cb('0x75')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x76'),require(_0xe5cb('0x77')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x78'),require(_0xe5cb('0x79')));_0x22c3b2[_0xe5cb('0x14')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x22c3b2[_0xe5cb('0x14')]('/api/actions',require(_0xe5cb('0x7a')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x7b'),require('./api/automation'));_0x22c3b2[_0xe5cb('0x14')]('/api/canned_answers',require(_0xe5cb('0x7c')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x7d'),require(_0xe5cb('0x7e')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x7f'),require(_0xe5cb('0x80')));_0x22c3b2[_0xe5cb('0x14')]('/api/intervals',require(_0xe5cb('0x81')));_0x22c3b2['use'](_0xe5cb('0x82'),require(_0xe5cb('0x83')));_0x22c3b2['use'](_0xe5cb('0x84'),require(_0xe5cb('0x85')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x86'),require(_0xe5cb('0x87')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x88'),require(_0xe5cb('0x89')));_0x22c3b2['use'](_0xe5cb('0x8a'),require(_0xe5cb('0x8b')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x8c'),require(_0xe5cb('0x8d')));_0x22c3b2[_0xe5cb('0x14')]('/api/templates',require(_0xe5cb('0x8e')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x8f'),require('./api/trigger'));_0x22c3b2['use'](_0xe5cb('0x90'),require('./api/variable'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x91'),require(_0xe5cb('0x92')));_0x22c3b2['use'](_0xe5cb('0x93'),require(_0xe5cb('0x94')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x95'),require(_0xe5cb('0x96')));_0x22c3b2['use'](_0xe5cb('0x97'),require(_0xe5cb('0x98')));_0x22c3b2['use'](_0xe5cb('0x99'),require('./api/analyticExtractedReport'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x9a'),require(_0xe5cb('0x9b')));_0x22c3b2[_0xe5cb('0x14')]('/api/analytics/field_reports',require(_0xe5cb('0x9c')));_0x22c3b2['use'](_0xe5cb('0x9d'),require(_0xe5cb('0x9e')));_0x22c3b2['use']('/api/integrations/salesforce/accounts',require(_0xe5cb('0x9f')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xa0'),require(_0xe5cb('0xa1')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xa2'),require(_0xe5cb('0xa3')));_0x22c3b2[_0xe5cb('0x14')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xa4'),require(_0xe5cb('0xa5')));_0x22c3b2['use']('/api/integrations/sugarcrm/fields',require(_0xe5cb('0xa6')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xa7'),require('./api/intDeskAccount'));_0x22c3b2['use'](_0xe5cb('0xa8'),require(_0xe5cb('0xa9')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xaa'),require(_0xe5cb('0xab')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xac'),require(_0xe5cb('0xad')));_0x22c3b2[_0xe5cb('0x14')]('/api/integrations/zoho/configurations',require(_0xe5cb('0xae')));_0x22c3b2[_0xe5cb('0x14')]('/api/integrations/zoho/fields',require(_0xe5cb('0xaf')));_0x22c3b2[_0xe5cb('0x14')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x22c3b2[_0xe5cb('0x14')]('/api/integrations/zendesk/configurations',require(_0xe5cb('0xb0')));_0x22c3b2[_0xe5cb('0x14')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xb1'),require(_0xe5cb('0xb2')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xb3'),require(_0xe5cb('0xb4')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xb5'),require(_0xe5cb('0xb6')));_0x22c3b2['use'](_0xe5cb('0xb7'),require(_0xe5cb('0xb8')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xb9'),require(_0xe5cb('0xba')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xbb'),require(_0xe5cb('0xbc')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xbd'),require(_0xe5cb('0xbe')));_0x22c3b2[_0xe5cb('0x14')]('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xbf'),require(_0xe5cb('0xc0')));_0x22c3b2['use']('/api/integrations/dynamics365/accounts',require(_0xe5cb('0xc1')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xc2'),require(_0xe5cb('0xc3')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xc4'),require(_0xe5cb('0xc5')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xc6'),require(_0xe5cb('0xc7')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xc8'),require(_0xe5cb('0xc9')));_0x22c3b2['use']('/api/integrations/freshsales/fields',require(_0xe5cb('0xca')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xcb'),require(_0xe5cb('0xcc')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xcd'),require(_0xe5cb('0xce')));_0x22c3b2['use'](_0xe5cb('0xcf'),require(_0xe5cb('0xd0')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xd1'),require(_0xe5cb('0xd2')));_0x22c3b2['use']('/api/jscripty/questions/reports',require(_0xe5cb('0xd3')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xd4'),require(_0xe5cb('0xd5')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xd6'),require(_0xe5cb('0xd7')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xd8'),require(_0xe5cb('0xd9')));_0x22c3b2[_0xe5cb('0x14')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xda'),require('./api/jscriptyProject'));_0x22c3b2['use'](_0xe5cb('0xdb'),require(_0xe5cb('0xdc')));_0x22c3b2['use'](_0xe5cb('0xdd'),require('./api/squareOdbc'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xde'),require(_0xe5cb('0xdf')));_0x22c3b2['use'](_0xe5cb('0xe0'),require(_0xe5cb('0xe1')));_0x22c3b2['use']('/api/square/messages',require(_0xe5cb('0xe2')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xe3'),require(_0xe5cb('0xe4')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xe5'),require(_0xe5cb('0xe6')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xe7'),require(_0xe5cb('0xe8')));_0x22c3b2[_0xe5cb('0x14')]('/api/migrations',require(_0xe5cb('0xe9')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xea'),require('./api/attachment'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xeb'),require(_0xe5cb('0xec')));_0x22c3b2[_0xe5cb('0x14')]('/api/mail/reports/transfer',require(_0xe5cb('0xed')));_0x22c3b2['use']('/api/chat/reports/transfer',require(_0xe5cb('0xee')));_0x22c3b2['use'](_0xe5cb('0xef'),require(_0xe5cb('0xf0')));_0x22c3b2['use'](_0xe5cb('0xf1'),require('./api/openchannelTransferReport'));_0x22c3b2[_0xe5cb('0x14')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x22c3b2['use']('/api/cm/lists',require('./api/cmList'));_0x22c3b2['use'](_0xe5cb('0xf2'),require(_0xe5cb('0xf3')));_0x22c3b2[_0xe5cb('0x14')]('/api/userProfiles',require(_0xe5cb('0xf4')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xf5'),require('./api/userProfileSection'));_0x22c3b2['use'](_0xe5cb('0xf6'),require('./api/userProfileResource'));_0x22c3b2['use']('/api/userNotifications',require(_0xe5cb('0xf7')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xf8'),require(_0xe5cb('0xf9')));_0x22c3b2['use'](_0xe5cb('0xfa'),require(_0xe5cb('0xfb')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xfc'),require(_0xe5cb('0xfd')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0xfe'),require(_0xe5cb('0xff')));_0x22c3b2['use']('/api/whatsapp/reports/queue',require(_0xe5cb('0x100')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x101'),require('./api/whatsappTransferReport'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x102'),require(_0xe5cb('0x103')));_0x22c3b2[_0xe5cb('0x14')]('/api/cloudProviders',require(_0xe5cb('0x104')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x105'),require(_0xe5cb('0x106')));_0x22c3b2['use'](_0xe5cb('0x107'),require('./api/authGoogle'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x108'),require('./api/jira'));_0x22c3b2[_0xe5cb('0x14')]('/api/rpc',require('./api/rpc'));_0x22c3b2[_0xe5cb('0x14')]('/api/version',require('./api/version'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x109'),require('./api/system'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x10a'),require(_0xe5cb('0x10b')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x10c'),require('./api/webbar'));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x10d'),express['static'](path['join'](config[_0xe5cb('0x10e')],'/apidoc')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x10f'),express[_0xe5cb('0x110')](path[_0xe5cb('0x111')](config['root'],'/www')));_0x22c3b2[_0xe5cb('0x14')](_0xe5cb('0x112'),express['static'](path[_0xe5cb('0x111')](config[_0xe5cb('0x10e')],'/demo')));_0x22c3b2['use'](_0xe5cb('0x113'),express[_0xe5cb('0x110')](path['join'](config[_0xe5cb('0x10e')],_0xe5cb('0x114'),_0xe5cb('0x115'))));_0x22c3b2[_0xe5cb('0x14')]('/plugins',express[_0xe5cb('0x110')](path['join'](config[_0xe5cb('0x10e')],'/server/files/plugins')));_0x22c3b2[_0xe5cb('0x116')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xe5cb('0x117')](errors[0x194]);_0x22c3b2[_0xe5cb('0x116')]('/*')[_0xe5cb('0x117')](function(_0xe73e7e,_0x52c6a1){_0x52c6a1[_0xe5cb('0x118')](path[_0xe5cb('0x119')](_0x22c3b2['get'](_0xe5cb('0x11a'))+'/index.html'));});};var sensitiveFields=[_0xe5cb('0x11b'),_0xe5cb('0x11c'),'newPassword',_0xe5cb('0x11d'),_0xe5cb('0x11e'),'lastName',_0xe5cb('0x11f'),_0xe5cb('0x120'),'mobile',_0xe5cb('0x121'),_0xe5cb('0x122'),'clientId',_0xe5cb('0x123'),_0xe5cb('0x124'),_0xe5cb('0x125'),_0xe5cb('0x126'),'tenantId',_0xe5cb('0x127'),_0xe5cb('0x128'),'accessToken',_0xe5cb('0x129'),_0xe5cb('0x12a'),_0xe5cb('0x12b'),_0xe5cb('0x12c'),_0xe5cb('0x12d'),'calleridname','calleridnum',_0xe5cb('0x12e'),'vidaooApiKey',_0xe5cb('0x12f'),_0xe5cb('0x130'),_0xe5cb('0x131'),'secretaccesskey',_0xe5cb('0x132'),_0xe5cb('0x11'),_0xe5cb('0x133'),'accountSid',_0xe5cb('0x134'),_0xe5cb('0x135'),_0xe5cb('0x136'),_0xe5cb('0x137'),_0xe5cb('0x138')];function maskSensitiveData(_0x5d7823){var _0x490f52=/(?!^)[\s\S](?!$)/g;if(!_[_0xe5cb('0x139')](_0x5d7823))return;for(var _0x172443 in _0x5d7823){if(_[_0xe5cb('0x13a')](_0x5d7823[_0x172443])){for(var _0x19cdee=0x0;_0x19cdee<_0x5d7823[_0x172443]['length'];_0x19cdee++){maskSensitiveData(_0x5d7823[_0x172443][_0x19cdee]);}}else if(_[_0xe5cb('0x139')](_0x5d7823[_0x172443])){maskSensitiveData(_0x5d7823[_0x172443]);}else if(_[_0xe5cb('0x13b')](_0x5d7823[_0x172443])){_0x5d7823[_0x172443]=_0x5d7823[_0x172443][_0xe5cb('0x13c')](/{{{/g,_0xe5cb('0x13d'))[_0xe5cb('0x13c')](/}}}/g,_0xe5cb('0x13e'))[_0xe5cb('0x13c')](/{{/g,'@{')[_0xe5cb('0x13c')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x172443)){_0x5d7823[_0x172443]=_0x5d7823[_0x172443][_0xe5cb('0x13c')](_0x490f52,'*');}}}} \ No newline at end of file +var _0x2e78=['./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatQueue','/api/chat/groups','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','/api/variables','/api/integrations','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/server/files/plugins','route','sendFile','get','/index.html','username','password','newPassword','apiKey','firstName','phone','mobile','fax','email','clientId','clientSecret','tenantId','channelSecret','accessToken','consumerKey','consumerSecret','membername','calleridname','exten','vidaooApiKey','privateKey','accesskeyid','key','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','length','replace','@@{','}@@','includes','lodash','path','express','./errors','./config/environment','./config/logger','api','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','user','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','role','agent_id','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','/api/dashboards/items','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues'];(function(_0x4e63bc,_0x5bc3a6){var _0x4594d1=function(_0x13b8ae){while(--_0x13b8ae){_0x4e63bc['push'](_0x4e63bc['shift']());}};_0x4594d1(++_0x5bc3a6);}(_0x2e78,0xd8));var _0x82e7=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x2e78[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x82e7('0x0'));var path=require(_0x82e7('0x1'));var express=require(_0x82e7('0x2'));var ewinston=require('express-winston');var util=require('util');var errors=require(_0x82e7('0x3'));var config=require(_0x82e7('0x4'));var logger=require(_0x82e7('0x5'))(_0x82e7('0x6'));var authLogger=require(_0x82e7('0x5'))('auth');exports[_0x82e7('0x7')]=function(_0x5e94c5){_0x5e94c5[_0x82e7('0x8')](ewinston[_0x82e7('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2f9ea3,_0x2add25){var _0x1d9614=_0x82e7('0xa');if(!_['isEmpty'](_0x2f9ea3[_0x82e7('0xb')])){_0x1d9614+=_0x82e7('0xc');var _0x2c2cc4=_0x2f9ea3['body'];maskSensitiveData(_0x2c2cc4);}return util[_0x82e7('0xd')](_0x1d9614,_0x2f9ea3[_0x82e7('0xe')],_0x2f9ea3[_0x82e7('0xf')][_0x82e7('0x10')]?_0x2f9ea3[_0x82e7('0xf')]['x-forwarded-for']:_0x2f9ea3[_0x82e7('0x11')]['remoteAddress']||_0x2f9ea3['ip'],_0x2f9ea3[_0x82e7('0x12')],_0x2add25[_0x82e7('0x13')],_0x2add25[_0x82e7('0x14')],_0x2f9ea3[_0x82e7('0x15')]?_0x2f9ea3[_0x82e7('0x15')]['id']:null,_0x2f9ea3[_0x82e7('0x15')]?_0x2f9ea3[_0x82e7('0x15')][_0x82e7('0x16')]:null,_0x2f9ea3[_0x82e7('0x15')]?_0x2f9ea3[_0x82e7('0x15')]['role']:null,_0x2c2cc4?util[_0x82e7('0x17')](_0x2c2cc4,![],null):'');}}));_0x5e94c5[_0x82e7('0x8')](ewinston[_0x82e7('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x36d952,_0x41c938){var _0x1e1c77=_0x82e7('0x18');if(_0x36d952[_0x82e7('0xb')]&&_0x36d952[_0x82e7('0xb')][_0x82e7('0x19')]&&_0x36d952['body']['agent_id']){_0x1e1c77=_0x82e7('0x1a');}return util[_0x82e7('0xd')](_0x1e1c77,_0x36d952[_0x82e7('0xe')],_0x36d952[_0x82e7('0xf')][_0x82e7('0x10')]?_0x36d952[_0x82e7('0xf')][_0x82e7('0x10')]:_0x36d952[_0x82e7('0x11')][_0x82e7('0x1b')]||_0x36d952['ip'],_0x36d952['url'],_0x41c938[_0x82e7('0x13')],_0x41c938['responseTime'],_0x36d952[_0x82e7('0x15')]?_0x36d952['user']['id']:null,_0x36d952['user']?_0x36d952[_0x82e7('0x15')][_0x82e7('0x16')]:null,_0x36d952[_0x82e7('0x15')]?_0x36d952[_0x82e7('0x15')][_0x82e7('0x1c')]:null,_0x36d952['body']&&_0x36d952['body']['device']?_0x36d952['body'][_0x82e7('0x19')]:'other',_0x36d952['body']&&_0x36d952[_0x82e7('0xb')][_0x82e7('0x1d')]?_0x36d952[_0x82e7('0xb')][_0x82e7('0x1d')]:'',_0x36d952[_0x82e7('0xb')]&&_0x36d952[_0x82e7('0xb')][_0x82e7('0x1e')]?_0x36d952['body'][_0x82e7('0x1e')]:'');},'ignoreRoute':function(_0x18962b){var _0x158335=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x158335[_0x82e7('0x1f')](_0x18962b['url']);}}));_0x5e94c5['use'](_0x82e7('0x20'),require(_0x82e7('0x21')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x22'),require(_0x82e7('0x23')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x24'),require(_0x82e7('0x25')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x26'),require('./api/voiceExtension'));_0x5e94c5[_0x82e7('0x8')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x5e94c5['use'](_0x82e7('0x27'),require(_0x82e7('0x28')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x29'),require(_0x82e7('0x2a')));_0x5e94c5['use'](_0x82e7('0x2b'),require(_0x82e7('0x2c')));_0x5e94c5['use']('/api/voice/mails',require('./api/voiceMail'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x2d'),require(_0x82e7('0x2e')));_0x5e94c5[_0x82e7('0x8')]('/api/voice/calls/reports',require(_0x82e7('0x2f')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x30'),require(_0x82e7('0x31')));_0x5e94c5[_0x82e7('0x8')]('/api/voice/agents/reports',require(_0x82e7('0x32')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x33'),require('./api/voiceQueueReport'));_0x5e94c5['use']('/api/members/reports',require('./api/memberReport'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x34'),require(_0x82e7('0x35')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x36'),require(_0x82e7('0x37')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x38'),require(_0x82e7('0x39')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x3a'),require(_0x82e7('0x3b')));_0x5e94c5[_0x82e7('0x8')]('/api/mail/queues',require(_0x82e7('0x3c')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x3d'),require(_0x82e7('0x3e')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x3f'),require(_0x82e7('0x40')));_0x5e94c5[_0x82e7('0x8')]('/api/mail/messages',require(_0x82e7('0x41')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x42'),require(_0x82e7('0x43')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x44'),require('./api/mailQueueReport'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x45'),require('./api/dashboard'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x46'),require('./api/dashboardItem'));_0x5e94c5['use']('/api/fax/accounts',require(_0x82e7('0x47')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x48'),require(_0x82e7('0x49')));_0x5e94c5['use'](_0x82e7('0x4a'),require(_0x82e7('0x4b')));_0x5e94c5['use']('/api/fax/messages',require(_0x82e7('0x4c')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x4d'),require(_0x82e7('0x4e')));_0x5e94c5['use']('/api/fax/reports/queue',require(_0x82e7('0x4f')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x50'),require(_0x82e7('0x51')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x52'),require(_0x82e7('0x53')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x54'),require('./api/smsInteraction'));_0x5e94c5['use'](_0x82e7('0x55'),require('./api/smsMessage'));_0x5e94c5['use'](_0x82e7('0x56'),require(_0x82e7('0x57')));_0x5e94c5['use'](_0x82e7('0x58'),require(_0x82e7('0x59')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x5a'),require(_0x82e7('0x5b')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x5c'),require(_0x82e7('0x5d')));_0x5e94c5['use'](_0x82e7('0x5e'),require('./api/openchannelMessage'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x5f'),require(_0x82e7('0x60')));_0x5e94c5['use'](_0x82e7('0x61'),require(_0x82e7('0x62')));_0x5e94c5[_0x82e7('0x8')]('/api/openchannel/reports/queue',require(_0x82e7('0x63')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x64'),require(_0x82e7('0x65')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x66'),require(_0x82e7('0x67')));_0x5e94c5[_0x82e7('0x8')]('/api/chat/messages',require(_0x82e7('0x68')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x69'),require('./api/chatOfflineMessage'));_0x5e94c5[_0x82e7('0x8')]('/api/chat/queues',require(_0x82e7('0x6a')));_0x5e94c5['use'](_0x82e7('0x6b'),require('./api/chatGroup'));_0x5e94c5['use']('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x6c'),require(_0x82e7('0x6d')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x6e'),require(_0x82e7('0x6f')));_0x5e94c5['use']('/api/cm/hopper',require(_0x82e7('0x70')));_0x5e94c5[_0x82e7('0x8')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x71'),require(_0x82e7('0x72')));_0x5e94c5['use']('/api/cm/hopper_history',require(_0x82e7('0x73')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x74'),require(_0x82e7('0x75')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x76'),require(_0x82e7('0x77')));_0x5e94c5[_0x82e7('0x8')]('/api/automations',require(_0x82e7('0x78')));_0x5e94c5['use'](_0x82e7('0x79'),require('./api/cannedAnswer'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x7a'),require(_0x82e7('0x7b')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x7c'),require('./api/condition'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x7d'),require(_0x82e7('0x7e')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x7f'),require(_0x82e7('0x80')));_0x5e94c5[_0x82e7('0x8')]('/api/cdr',require(_0x82e7('0x81')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x82'),require(_0x82e7('0x83')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x84'),require(_0x82e7('0x85')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x86'),require('./api/sound'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x87'),require(_0x82e7('0x88')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x89'),require(_0x82e7('0x8a')));_0x5e94c5['use'](_0x82e7('0x8b'),require('./api/trigger'));_0x5e94c5['use'](_0x82e7('0x8c'),require('./api/variable'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x8d'),require('./api/integration'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x8e'),require(_0x82e7('0x8f')));_0x5e94c5[_0x82e7('0x8')]('/api/analytics/custom_reports',require(_0x82e7('0x90')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x91'),require('./api/analyticDefaultReport'));_0x5e94c5['use']('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x92'),require(_0x82e7('0x93')));_0x5e94c5['use'](_0x82e7('0x94'),require(_0x82e7('0x95')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x96'),require(_0x82e7('0x97')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x98'),require('./api/intSalesforceAccount'));_0x5e94c5[_0x82e7('0x8')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x5e94c5[_0x82e7('0x8')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x99'),require(_0x82e7('0x9a')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x9b'),require(_0x82e7('0x9c')));_0x5e94c5[_0x82e7('0x8')]('/api/integrations/sugarcrm/fields',require(_0x82e7('0x9d')));_0x5e94c5[_0x82e7('0x8')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x5e94c5['use'](_0x82e7('0x9e'),require(_0x82e7('0x9f')));_0x5e94c5[_0x82e7('0x8')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x5e94c5[_0x82e7('0x8')]('/api/integrations/zoho/accounts',require(_0x82e7('0xa0')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xa1'),require(_0x82e7('0xa2')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xa3'),require(_0x82e7('0xa4')));_0x5e94c5[_0x82e7('0x8')]('/api/integrations/zendesk/accounts',require(_0x82e7('0xa5')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xa6'),require('./api/intZendeskConfiguration'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xa7'),require('./api/intZendeskField'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xa8'),require(_0x82e7('0xa9')));_0x5e94c5['use'](_0x82e7('0xaa'),require('./api/intFreshdeskConfiguration'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xab'),require(_0x82e7('0xac')));_0x5e94c5[_0x82e7('0x8')]('/api/integrations/vtiger/accounts',require(_0x82e7('0xad')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xae'),require(_0x82e7('0xaf')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xb0'),require('./api/intVtigerField'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xb1'),require('./api/intServicenowAccount'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xb2'),require(_0x82e7('0xb3')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xb4'),require('./api/intServicenowField'));_0x5e94c5['use']('/api/integrations/dynamics365/accounts',require(_0x82e7('0xb5')));_0x5e94c5['use'](_0x82e7('0xb6'),require(_0x82e7('0xb7')));_0x5e94c5[_0x82e7('0x8')]('/api/integrations/dynamics365/fields',require(_0x82e7('0xb8')));_0x5e94c5[_0x82e7('0x8')]('/api/integrations/freshsales/accounts',require(_0x82e7('0xb9')));_0x5e94c5[_0x82e7('0x8')]('/api/integrations/freshsales/configurations',require(_0x82e7('0xba')));_0x5e94c5['use'](_0x82e7('0xbb'),require('./api/intFreshsalesField'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xbc'),require(_0x82e7('0xbd')));_0x5e94c5[_0x82e7('0x8')]('/api/chat/reports/queue',require(_0x82e7('0xbe')));_0x5e94c5[_0x82e7('0x8')]('/api/chat/internal/messages',require(_0x82e7('0xbf')));_0x5e94c5['use'](_0x82e7('0xc0'),require(_0x82e7('0xc1')));_0x5e94c5['use'](_0x82e7('0xc2'),require(_0x82e7('0xc3')));_0x5e94c5[_0x82e7('0x8')]('/api/jscripty/sessions/reports',require(_0x82e7('0xc4')));_0x5e94c5[_0x82e7('0x8')]('/api/sms/reports/queue',require(_0x82e7('0xc5')));_0x5e94c5[_0x82e7('0x8')]('/api/square/reports',require(_0x82e7('0xc6')));_0x5e94c5['use'](_0x82e7('0xc7'),require(_0x82e7('0xc8')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xc9'),require(_0x82e7('0xca')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xcb'),require(_0x82e7('0xcc')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xcd'),require(_0x82e7('0xce')));_0x5e94c5['use']('/api/square/projects',require('./api/squareProject'));_0x5e94c5['use'](_0x82e7('0xcf'),require(_0x82e7('0xd0')));_0x5e94c5['use'](_0x82e7('0xd1'),require(_0x82e7('0xd2')));_0x5e94c5['use']('/api/teams',require(_0x82e7('0xd3')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xd4'),require(_0x82e7('0xd5')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xd6'),require(_0x82e7('0xd7')));_0x5e94c5[_0x82e7('0x8')]('/api/migrations',require(_0x82e7('0xd8')));_0x5e94c5[_0x82e7('0x8')]('/api/attachments',require('./api/attachment'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xd9'),require(_0x82e7('0xda')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xdb'),require(_0x82e7('0xdc')));_0x5e94c5['use'](_0x82e7('0xdd'),require(_0x82e7('0xde')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xdf'),require(_0x82e7('0xe0')));_0x5e94c5['use'](_0x82e7('0xe1'),require(_0x82e7('0xe2')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xe3'),require(_0x82e7('0xe4')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xe5'),require(_0x82e7('0xe6')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xe7'),require(_0x82e7('0xe8')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xe9'),require(_0x82e7('0xea')));_0x5e94c5['use']('/api/userProfile/sections',require('./api/userProfileSection'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xeb'),require(_0x82e7('0xec')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xed'),require(_0x82e7('0xee')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xef'),require(_0x82e7('0xf0')));_0x5e94c5[_0x82e7('0x8')]('/api/whatsapp/applications',require(_0x82e7('0xf1')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xf2'),require(_0x82e7('0xf3')));_0x5e94c5[_0x82e7('0x8')]('/api/whatsapp/messages',require(_0x82e7('0xf4')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xf5'),require(_0x82e7('0xf6')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xf7'),require(_0x82e7('0xf8')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0xf9'),require(_0x82e7('0xfa')));_0x5e94c5['use'](_0x82e7('0xfb'),require('./api/cloudProvider'));_0x5e94c5['use'](_0x82e7('0xfc'),require(_0x82e7('0xfd')));_0x5e94c5['use'](_0x82e7('0xfe'),require(_0x82e7('0xff')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x100'),require(_0x82e7('0x101')));_0x5e94c5[_0x82e7('0x8')]('/api/rpc',require('./api/rpc'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x102'),require('./api/version'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x103'),require('./api/system'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x104'),require(_0x82e7('0x105')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x106'),require('./api/webbar'));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x107'),express[_0x82e7('0x108')](path[_0x82e7('0x109')](config[_0x82e7('0x10a')],'/apidoc')));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x10b'),express['static'](path[_0x82e7('0x109')](config[_0x82e7('0x10a')],_0x82e7('0x10b'))));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x10c'),express[_0x82e7('0x108')](path['join'](config['root'],_0x82e7('0x10c'))));_0x5e94c5[_0x82e7('0x8')](_0x82e7('0x10d'),express[_0x82e7('0x108')](path[_0x82e7('0x109')](config['root'],_0x82e7('0x10e'),'3.0.0')));_0x5e94c5[_0x82e7('0x8')]('/plugins',express[_0x82e7('0x108')](path['join'](config[_0x82e7('0x10a')],_0x82e7('0x10f'))));_0x5e94c5[_0x82e7('0x110')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x5e94c5['route']('/*')['get'](function(_0xf0da46,_0x6792f0){_0x6792f0[_0x82e7('0x111')](path['resolve'](_0x5e94c5[_0x82e7('0x112')]('appPath')+_0x82e7('0x113')));});};var sensitiveFields=[_0x82e7('0x114'),_0x82e7('0x115'),_0x82e7('0x116'),_0x82e7('0x117'),_0x82e7('0x118'),'lastName','street',_0x82e7('0x119'),_0x82e7('0x11a'),_0x82e7('0x11b'),_0x82e7('0x11c'),_0x82e7('0x11d'),_0x82e7('0x11e'),'securityToken','code','accessKey',_0x82e7('0x11f'),'token',_0x82e7('0x120'),_0x82e7('0x121'),'accessTokenSecret','authToken',_0x82e7('0x122'),_0x82e7('0x123'),_0x82e7('0x124'),_0x82e7('0x125'),'calleridnum',_0x82e7('0x126'),_0x82e7('0x127'),'clientEmail',_0x82e7('0x128'),_0x82e7('0x129'),'secretaccesskey',_0x82e7('0x12a'),_0x82e7('0x15'),_0x82e7('0x12b'),_0x82e7('0x12c'),_0x82e7('0x12d'),_0x82e7('0x12e'),_0x82e7('0x12f'),_0x82e7('0x130'),'oldPassword'];function maskSensitiveData(_0x2186f0){var _0x17b9b4=/(?!^)[\s\S](?!$)/g;if(!_[_0x82e7('0x131')](_0x2186f0))return;for(var _0x45979b in _0x2186f0){if(_[_0x82e7('0x132')](_0x2186f0[_0x45979b])){for(var _0x2bdee3=0x0;_0x2bdee3<_0x2186f0[_0x45979b][_0x82e7('0x133')];_0x2bdee3++){maskSensitiveData(_0x2186f0[_0x45979b][_0x2bdee3]);}}else if(_[_0x82e7('0x131')](_0x2186f0[_0x45979b])){maskSensitiveData(_0x2186f0[_0x45979b]);}else if(_['isString'](_0x2186f0[_0x45979b])){_0x2186f0[_0x45979b]=_0x2186f0[_0x45979b][_0x82e7('0x134')](/{{{/g,_0x82e7('0x135'))[_0x82e7('0x134')](/}}}/g,_0x82e7('0x136'))[_0x82e7('0x134')](/{{/g,'@{')[_0x82e7('0x134')](/}}/g,'}@');if(_[_0x82e7('0x137')](sensitiveFields,_0x45979b)){_0x2186f0[_0x45979b]=_0x2186f0[_0x45979b][_0x82e7('0x134')](_0x17b9b4,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 2209d16..8cd2677 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb44=['../api/voiceRecording/voiceRecording.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.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/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.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/template/template.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/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc'];(function(_0x31069b,_0x32d629){var _0x111601=function(_0x4717e4){while(--_0x4717e4){_0x31069b['push'](_0x31069b['shift']());}};_0x111601(++_0x32d629);}(_0xfb44,0x192));var _0x4fb4=function(_0x390014,_0x18cefc){_0x390014=_0x390014-0x0;var _0x312d68=_0xfb44[_0x390014];return _0x312d68;};'use strict';var jayson=require(_0x4fb4('0x0'));var BPromise=require(_0x4fb4('0x1'));var _=require('lodash');var config=require('../config/environment');exports[_0x4fb4('0x2')]=function(){return new BPromise(function(_0x44a90d,_0x463dba){var _0x560a02={};_0x560a02=_['merge'](_0x560a02,require('../api/user/user.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x4')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x5')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x6')));_0x560a02=_['merge'](_0x560a02,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x7')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x8')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x9')));_0x560a02=_['merge'](_0x560a02,require(_0x4fb4('0xa')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0xb')));_0x560a02=_['merge'](_0x560a02,require(_0x4fb4('0xc')));_0x560a02=_['merge'](_0x560a02,require(_0x4fb4('0xd')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0xe')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0xf')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x10')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x11')));_0x560a02=_['merge'](_0x560a02,require(_0x4fb4('0x12')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/faxApplication/faxApplication.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/faxInteraction/faxInteraction.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x13')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x14')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x15')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x16')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x17')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x18')));_0x560a02=_['merge'](_0x560a02,require(_0x4fb4('0x19')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x1a')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x1b')));_0x560a02=_['merge'](_0x560a02,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x1c')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x1d')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x1e')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/chatQueue/chatQueue.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x1f')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x20')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x21')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x22')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x23')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x24')));_0x560a02=_['merge'](_0x560a02,require(_0x4fb4('0x25')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x26')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x27')));_0x560a02=_['merge'](_0x560a02,require('../api/trigger/trigger.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/variable/variable.rpc'));_0x560a02=_['merge'](_0x560a02,require(_0x4fb4('0x28')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x29')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x2a')));_0x560a02=_['merge'](_0x560a02,require(_0x4fb4('0x2b')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x2c')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x2d')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x2e')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x2f')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x30')));_0x560a02=_['merge'](_0x560a02,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x560a02=_['merge'](_0x560a02,require(_0x4fb4('0x31')));_0x560a02=_['merge'](_0x560a02,require(_0x4fb4('0x32')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x33')));_0x560a02=_['merge'](_0x560a02,require('../api/squareOdbc/squareOdbc.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x34')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x35')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x36')));_0x560a02=_['merge'](_0x560a02,require(_0x4fb4('0x37')));_0x560a02=_['merge'](_0x560a02,require('../api/attachment/attachment.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x38')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x39')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x3a')));_0x560a02=_[_0x4fb4('0x3')](_0x560a02,require(_0x4fb4('0x3b')));var _0x29eb56=jayson['server'](_0x560a02)[_0x4fb4('0x3c')]();var _0x5d46f4=config[_0x4fb4('0x3d')][_0x4fb4('0x3e')]||config[_0x4fb4('0x3e')]+0x1;var _0x26fd94=config[_0x4fb4('0x3d')]['ip']||_0x4fb4('0x3f');_0x29eb56['on'](_0x4fb4('0x40'),function(_0x1c67ab){return _0x463dba(_0x1c67ab);});_0x29eb56[_0x4fb4('0x2')](_0x5d46f4,_0x26fd94,function(){console['log'](_0x4fb4('0x41'),_0x26fd94,_0x5d46f4);require('../config/triggers')[_0x4fb4('0x42')]();return _0x44a90d(_0x4fb4('0x43')+_0x26fd94+':'+_0x5d46f4);});});}; \ No newline at end of file +var _0x6ab8=['../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc'];(function(_0x19bbd6,_0x243502){var _0x4621eb=function(_0x2de337){while(--_0x2de337){_0x19bbd6['push'](_0x19bbd6['shift']());}};_0x4621eb(++_0x243502);}(_0x6ab8,0xd7));var _0x86ab=function(_0x1cffe8,_0x5230cc){_0x1cffe8=_0x1cffe8-0x0;var _0xabd5fd=_0x6ab8[_0x1cffe8];return _0xabd5fd;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x86ab('0x0'));var _=require(_0x86ab('0x1'));var config=require(_0x86ab('0x2'));exports['listen']=function(){return new BPromise(function(_0x4f8b47,_0x3664bb){var _0x5629e3={};_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x3')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x5')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x6')));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x7')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x8')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x9')));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0xa')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0xb')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0xc')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/trunk/trunk.rpc'));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0xd')));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0xe')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/mailServerIn/mailServerIn.rpc'));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0xf')));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x10')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x11')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x12')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x13')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x14')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x15')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x16')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x17')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x18')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x19')));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x1a')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x1b')));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x1c')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x1d')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x1e')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x1f')));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x20')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x21')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x22')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x23')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x24')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x25')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x26')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x27')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x28')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/interval/interval.rpc'));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x29')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x2a')));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x2b')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/trigger/trigger.rpc'));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x2c')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x2d')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x2e')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x2f')));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x30')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x31')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x32')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x33')));_0x5629e3=_['merge'](_0x5629e3,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x34')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x35')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x36')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x37')));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x38')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/setting/setting.rpc'));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/squareOdbc/squareOdbc.rpc'));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x39')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x3a')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x3b')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x3c')));_0x5629e3=_['merge'](_0x5629e3,require('../api/attachment/attachment.rpc'));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require('../api/plugin/plugin.rpc'));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x3d')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x3e')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x3f')));_0x5629e3=_['merge'](_0x5629e3,require(_0x86ab('0x40')));_0x5629e3=_[_0x86ab('0x4')](_0x5629e3,require(_0x86ab('0x41')));var _0x23d260=jayson[_0x86ab('0x42')](_0x5629e3)['http']();var _0x36a34e=config[_0x86ab('0x43')][_0x86ab('0x44')]||config[_0x86ab('0x44')]+0x1;var _0x4596e3=config[_0x86ab('0x43')]['ip']||_0x86ab('0x45');_0x23d260['on']('error',function(_0x2f95ef){return _0x3664bb(_0x2f95ef);});_0x23d260['listen'](_0x36a34e,_0x4596e3,function(){console[_0x86ab('0x46')](_0x86ab('0x47'),_0x4596e3,_0x36a34e);require(_0x86ab('0x48'))[_0x86ab('0x49')]();return _0x4f8b47(_0x86ab('0x4a')+_0x4596e3+':'+_0x36a34e);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 62cc765..f41360a 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 _0x9c44=['no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','sync','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','noop','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','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIReply=require(_0x49c4('0x2'));var AGIError=require(_0x49c4('0x3'));function AGIChannel(_0x455700){var _0x2ad237=this,_0x4e0313=new AGIReply(),_0x4941f1=![],_0x41a183={};EventEmitter['call'](_0x2ad237);_0x455700[_0x49c4('0x4')](_0x49c4('0x5'));_0x455700[_0x49c4('0x6')](0x8*0x3c*0x3c*0x3e8);_0x4e0313[_0x49c4('0x4')](_0x49c4('0x5'));_0x4e0313['on']('headers',function(_0x11c586){for(var _0x42e4f8 in _0x11c586){_0x2ad237[_0x42e4f8]=_0x11c586[_0x42e4f8];}_0x2ad237[_0x49c4('0x7')](_0x49c4('0x8'));});_0x4e0313['on']('line',function(_0x5ab4a3){if(_0x5ab4a3[_0x49c4('0x9')]()==_0x49c4('0xa')){_0x2ad237['emit'](_0x49c4('0xa'));return;}if(_0x5ab4a3[_0x49c4('0xb')](0x0,0xb)=='520-Invalid'){_0x4941f1=!![];}if(_0x4941f1){_0x41a183['rx']+=_0x5ab4a3+'\x0a';if(_0x5ab4a3['search'](_0x49c4('0xc'))!=-0x1){_0x4941f1=![];}}else{_0x41a183['rx']=_0x5ab4a3;}if(_0x4941f1){return;}if(typeof _0x41a183['cb']==_0x49c4('0xd')){var _0x5487cd=_0x41a183['rx']['substring'](0x0,0x3),_0x7df3a9=null,_0x403bfb=null;_0x5487cd=parseInt(_0x5487cd);if(isNaN(_0x5487cd)){_0x41a183['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x49c4('0xe')});return;}if(_0x5487cd!=0xc8){_0x41a183['cb'](null,{'code':_0x5487cd,'result':-0x1,'extra':'KO'});return;}_0x7df3a9=_0x41a183['rx'][_0x49c4('0xb')](0x4)[_0x49c4('0xf')](_0x49c4('0x10'),'');if(_0x7df3a9[_0x49c4('0x11')]('\x20')!=-0x1){_0x7df3a9=_0x7df3a9[_0x49c4('0x12')](0x0,_0x7df3a9[_0x49c4('0x11')]('\x20'));}if(_[_0x49c4('0x13')](_0x7df3a9,'-1')){_0x7df3a9=parseInt(_0x7df3a9);}_0x403bfb=_0x41a183['rx']['split']('\x20');if(_0x403bfb[_0x49c4('0x14')]==0x3){_0x403bfb=_0x403bfb[0x2][_0x49c4('0xb')](0x1,_0x403bfb[0x2][_0x49c4('0x14')]-0x1);}else if(_0x403bfb[_0x49c4('0x14')]>0x3){var _0x2abc78=/\((.+)\)/;var _0x53e3a2=_0x41a183['rx'][_0x49c4('0x15')](_0x2abc78);if(_0x53e3a2){_0x403bfb=_0x53e3a2[0x1];}else{_0x403bfb=null;}}else{_0x403bfb=null;}_0x41a183['cb'](null,{'code':_0x5487cd,'result':_0x7df3a9,'extra':_0x403bfb});}});_0x455700['on'](_0x49c4('0x16'),function(_0x4c3253){_0x2ad237['emit'](_0x49c4('0x16'),new AGIError(_0x49c4('0x17'),_0x4c3253[_0x49c4('0x18')]));});_0x455700['on']('close',function(){_0x2ad237[_0x49c4('0x7')]('close',new AGIError(_0x49c4('0x19')));});_0x455700['on'](_0x49c4('0x1a'),function(){_0x2ad237[_0x49c4('0x7')](_0x49c4('0x1a'),new AGIError(_0x49c4('0x1b')));_0x455700[_0x49c4('0x1c')]();});_0x455700[_0x49c4('0x1d')](_0x4e0313);this[_0x49c4('0x1e')]=function(_0x2197d2,_0x578447){var _0x2197d2=_0x2197d2||'',_0x578447=typeof _0x578447==_0x49c4('0xd')?_0x578447:new Function();_0x41a183={'tx':_0x2197d2,'rx':'','cb':_0x578447};_0x455700['write'](_0x2197d2+'\x0a');},this['close']=function(){_0x455700[_0x49c4('0x1c')]();};}util[_0x49c4('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x49c4('0x20')][_0x49c4('0x21')]=function(_0x4811c4){return this['command'][_0x49c4('0x22')](this,_0x4811c4);};AGIChannel[_0x49c4('0x20')]['answer']=function(){return this[_0x49c4('0x21')](_0x49c4('0x23'));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x24')]=function(_0x531d92,_0x543ea2,_0x449960){_0x531d92=_0x531d92===undefined?'beep':_0x531d92;_0x543ea2=_0x543ea2===undefined?'5':_0x543ea2;_0x449960=_0x449960===undefined?'1':_0x449960;return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x26'),_0x531d92,_0x543ea2*0x3e8,_0x449960));};AGIChannel[_0x49c4('0x20')]['noop']=function(_0x889909){_0x889909=_0x889909||_0x49c4('0x27');return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x28'),_0x889909));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x29')]=function(_0x427b26,_0x17b50f){if(_[_0x49c4('0x2a')](_0x17b50f)){return this[_0x49c4('0x21')](util['format']('EXEC\x20%s\x20%s',_0x427b26,_0x17b50f['join'](',')));}return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2b'),_0x427b26,_0x17b50f));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x2c')]=function(_0x574fd3){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2d'),_0x574fd3));};AGIChannel[_0x49c4('0x20')]['setExtension']=function(_0x57a29c){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2e'),_0x57a29c));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x2f')]=function(_0x4a0c7a){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x30'),_0x4a0c7a));};AGIChannel['prototype']['hangup']=function(){return this[_0x49c4('0x21')](_0x49c4('0x31'));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x32')]=function(_0x2b45a1,_0x2cf897){var _0x1d1557=_[_0x49c4('0x33')](_0x2cf897)||_[_0x49c4('0x34')](_0x2cf897)?_0x2cf897['toString']():_0x2cf897;return this[_0x49c4('0x21')](util['format'](_0x49c4('0x35'),_0x2b45a1,_0x1d1557?_0x1d1557[_0x49c4('0x36')]()[_0x49c4('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x49c4('0x20')]['sayNumber']=function(_0x335f0c,_0x31f3ff){return this[_0x49c4('0x21')](util['format'](_0x49c4('0x37'),_0x335f0c,_0x31f3ff));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x38')]=function(_0x5e5366,_0x1ba7a0){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x39'),_0x5e5366,_0x1ba7a0));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x3a')]=function(_0x1e506a,_0x4e0663){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x3b'),_0x1e506a,_0x4e0663));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x3c')]=function(_0x29dd5d,_0x1be62d,_0xc9722b){_0x1be62d=_0x1be62d||this[_0x49c4('0x3d')];_0xc9722b=_0xc9722b||0x1;this[_0x49c4('0x2c')](_0x29dd5d);this[_0x49c4('0x3e')](_0x1be62d);this[_0x49c4('0x2f')](_0xc9722b);return this[_0x49c4('0x3f')](util['format'](_0x49c4('0x40'),_0x29dd5d,_0x1be62d,_0xc9722b));};AGIChannel['prototype'][_0x49c4('0x41')]=function(_0x4915bc){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x42'),_0x4915bc));};AGIChannel[_0x49c4('0x20')]['recordFile']=function(_0x4d628a,_0x20490b,_0x1e7bdc,_0x38349b,_0x117151,_0x490823){_0x20490b=_0x20490b||_0x49c4('0x43');_0x1e7bdc=_0x1e7bdc||'';_0x38349b=_0x38349b===undefined?-0x1:_0x38349b==='-1'?-0x1:_0x38349b*0x3e8;_0x117151=_0x117151===undefined?'':'s='+_0x117151;_0x490823=_0x490823?_0x49c4('0x44'):'';return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x45'),_0x4d628a,_0x20490b,_0x1e7bdc,_0x38349b,_0x490823,_0x117151));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x46')]=function(_0x3351c1,_0x3c4a1d){_0x3c4a1d=_0x3c4a1d||'';return this['sendRequest'](util[_0x49c4('0x25')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3351c1,_0x3c4a1d));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x47')]=function(_0x301def){return this[_0x49c4('0x29')](_0x49c4('0x48'),_0x301def);};AGIChannel['prototype'][_0x49c4('0x49')]=function(_0x15b674){return this[_0x49c4('0x29')](_0x49c4('0x4a'),_0x15b674);};AGIChannel[_0x49c4('0x20')][_0x49c4('0x16')]=function(_0x9779ef,_0x4d89e0){this[_0x49c4('0x3f')](util['format'](_0x49c4('0x4b'),_0x9779ef['id'],_0x9779ef[_0x49c4('0x4c')],_0x4d89e0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x49c4('0x4d')]=AGIChannel; \ No newline at end of file +var _0xcb91=['GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','events','EventEmitter','./reply','./error','call','utf8','setTimeout','headers','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','sendRequest','sync','prototype','answer','getData','beep','format'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xcb91[_0x243217];return _0x478029;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x1cb9('0x0'))[_0x1cb9('0x1')];var AGIReply=require(_0x1cb9('0x2'));var AGIError=require(_0x1cb9('0x3'));function AGIChannel(_0x4c37e8){var _0x8c392f=this,_0x2c17b8=new AGIReply(),_0x545a34=![],_0x13d5fd={};EventEmitter[_0x1cb9('0x4')](_0x8c392f);_0x4c37e8['setEncoding'](_0x1cb9('0x5'));_0x4c37e8[_0x1cb9('0x6')](0x8*0x3c*0x3c*0x3e8);_0x2c17b8['setEncoding'](_0x1cb9('0x5'));_0x2c17b8['on'](_0x1cb9('0x7'),function(_0x59d1be){for(var _0x3ae0f1 in _0x59d1be){_0x8c392f[_0x3ae0f1]=_0x59d1be[_0x3ae0f1];}_0x8c392f['emit']('ready');});_0x2c17b8['on'](_0x1cb9('0x8'),function(_0x2fa15c){if(_0x2fa15c[_0x1cb9('0x9')]()==_0x1cb9('0xa')){_0x8c392f[_0x1cb9('0xb')]('hangup');return;}if(_0x2fa15c[_0x1cb9('0xc')](0x0,0xb)==_0x1cb9('0xd')){_0x545a34=!![];}if(_0x545a34){_0x13d5fd['rx']+=_0x2fa15c+'\x0a';if(_0x2fa15c[_0x1cb9('0xe')](_0x1cb9('0xf'))!=-0x1){_0x545a34=![];}}else{_0x13d5fd['rx']=_0x2fa15c;}if(_0x545a34){return;}if(typeof _0x13d5fd['cb']==_0x1cb9('0x10')){var _0x5445e1=_0x13d5fd['rx'][_0x1cb9('0xc')](0x0,0x3),_0x5e3c19=null,_0x59dec3=null;_0x5445e1=parseInt(_0x5445e1);if(isNaN(_0x5445e1)){_0x13d5fd['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1cb9('0x11')});return;}if(_0x5445e1!=0xc8){_0x13d5fd['cb'](null,{'code':_0x5445e1,'result':-0x1,'extra':'KO'});return;}_0x5e3c19=_0x13d5fd['rx'][_0x1cb9('0xc')](0x4)[_0x1cb9('0x12')]('result=','');if(_0x5e3c19[_0x1cb9('0x13')]('\x20')!=-0x1){_0x5e3c19=_0x5e3c19[_0x1cb9('0x14')](0x0,_0x5e3c19[_0x1cb9('0x13')]('\x20'));}if(_[_0x1cb9('0x15')](_0x5e3c19,'-1')){_0x5e3c19=parseInt(_0x5e3c19);}_0x59dec3=_0x13d5fd['rx'][_0x1cb9('0x16')]('\x20');if(_0x59dec3['length']==0x3){_0x59dec3=_0x59dec3[0x2]['substring'](0x1,_0x59dec3[0x2][_0x1cb9('0x17')]-0x1);}else if(_0x59dec3[_0x1cb9('0x17')]>0x3){var _0x3904b7=/\((.+)\)/;var _0x3f1376=_0x13d5fd['rx'][_0x1cb9('0x18')](_0x3904b7);if(_0x3f1376){_0x59dec3=_0x3f1376[0x1];}else{_0x59dec3=null;}}else{_0x59dec3=null;}_0x13d5fd['cb'](null,{'code':_0x5445e1,'result':_0x5e3c19,'extra':_0x59dec3});}});_0x4c37e8['on'](_0x1cb9('0x19'),function(_0x23d3a9){_0x8c392f['emit']('error',new AGIError(_0x1cb9('0x1a'),_0x23d3a9[_0x1cb9('0x1b')]));});_0x4c37e8['on'](_0x1cb9('0x1c'),function(){_0x8c392f[_0x1cb9('0xb')](_0x1cb9('0x1c'),new AGIError(_0x1cb9('0x1d')));});_0x4c37e8['on'](_0x1cb9('0x1e'),function(){_0x8c392f['emit']('timeout',new AGIError(_0x1cb9('0x1f')));_0x4c37e8['destroy']();});_0x4c37e8[_0x1cb9('0x20')](_0x2c17b8);this[_0x1cb9('0x21')]=function(_0x523b26,_0x599275){var _0x523b26=_0x523b26||'',_0x599275=typeof _0x599275==_0x1cb9('0x10')?_0x599275:new Function();_0x13d5fd={'tx':_0x523b26,'rx':'','cb':_0x599275};_0x4c37e8[_0x1cb9('0x22')](_0x523b26+'\x0a');},this[_0x1cb9('0x1c')]=function(){_0x4c37e8[_0x1cb9('0x23')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x1cb9('0x24')]=function(_0x557199){return this[_0x1cb9('0x21')][_0x1cb9('0x25')](this,_0x557199);};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0x27')]=function(){return this[_0x1cb9('0x24')]('ANSWER');};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0x28')]=function(_0x4c8d76,_0xd6891c,_0x21effa){_0x4c8d76=_0x4c8d76===undefined?_0x1cb9('0x29'):_0x4c8d76;_0xd6891c=_0xd6891c===undefined?'5':_0xd6891c;_0x21effa=_0x21effa===undefined?'1':_0x21effa;return this[_0x1cb9('0x24')](util[_0x1cb9('0x2a')](_0x1cb9('0x2b'),_0x4c8d76,_0xd6891c*0x3e8,_0x21effa));};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0x2c')]=function(_0x41e5c2){_0x41e5c2=_0x41e5c2||_0x1cb9('0x2d');return this['sendRequest'](util[_0x1cb9('0x2a')]('VERBOSE\x20\x22%s\x22',_0x41e5c2));};AGIChannel[_0x1cb9('0x26')]['exec']=function(_0x278327,_0x41011c){if(_[_0x1cb9('0x2e')](_0x41011c)){return this[_0x1cb9('0x24')](util['format'](_0x1cb9('0x2f'),_0x278327,_0x41011c['join'](',')));}return this[_0x1cb9('0x24')](util[_0x1cb9('0x2a')](_0x1cb9('0x2f'),_0x278327,_0x41011c));};AGIChannel['prototype'][_0x1cb9('0x30')]=function(_0x5e84fd){return this[_0x1cb9('0x24')](util['format'](_0x1cb9('0x31'),_0x5e84fd));};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0x32')]=function(_0xae910){return this['sendRequest'](util[_0x1cb9('0x2a')](_0x1cb9('0x33'),_0xae910));};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0x34')]=function(_0xc6784c){return this[_0x1cb9('0x24')](util[_0x1cb9('0x2a')](_0x1cb9('0x35'),_0xc6784c));};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0xa')]=function(){return this[_0x1cb9('0x24')](_0x1cb9('0x36'));};AGIChannel[_0x1cb9('0x26')]['setVariable']=function(_0x54c6e6,_0x299ff8){var _0x30f7e4=_[_0x1cb9('0x37')](_0x299ff8)||_[_0x1cb9('0x38')](_0x299ff8)?_0x299ff8[_0x1cb9('0x39')]():_0x299ff8;return this[_0x1cb9('0x24')](util[_0x1cb9('0x2a')](_0x1cb9('0x3a'),_0x54c6e6,_0x30f7e4?_0x30f7e4['toString']()[_0x1cb9('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0x3b')]=function(_0x5350f9,_0x2a5aac){return this['sendRequest'](util[_0x1cb9('0x2a')]('SAY\x20NUMBER\x20%s\x20%s',_0x5350f9,_0x2a5aac));};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0x3c')]=function(_0x289b73,_0x2bcacd){return this[_0x1cb9('0x24')](util[_0x1cb9('0x2a')](_0x1cb9('0x3d'),_0x289b73,_0x2bcacd));};AGIChannel['prototype']['sayPhonetic']=function(_0x4111b8,_0x1d2723){return this[_0x1cb9('0x24')](util[_0x1cb9('0x2a')](_0x1cb9('0x3e'),_0x4111b8,_0x1d2723));};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0x3f')]=function(_0x4a670c,_0xbcaa32,_0x47edad){_0xbcaa32=_0xbcaa32||this['extension'];_0x47edad=_0x47edad||0x1;this['setContext'](_0x4a670c);this[_0x1cb9('0x32')](_0xbcaa32);this[_0x1cb9('0x34')](_0x47edad);return this[_0x1cb9('0x2c')](util[_0x1cb9('0x2a')](_0x1cb9('0x40'),_0x4a670c,_0xbcaa32,_0x47edad));};AGIChannel['prototype'][_0x1cb9('0x41')]=function(_0x523866){return this[_0x1cb9('0x24')](util[_0x1cb9('0x2a')](_0x1cb9('0x42'),_0x523866));};AGIChannel['prototype'][_0x1cb9('0x43')]=function(_0x522283,_0xda1a44,_0xbc36fc,_0x51a898,_0x5839aa,_0x24c643){_0xda1a44=_0xda1a44||_0x1cb9('0x44');_0xbc36fc=_0xbc36fc||'';_0x51a898=_0x51a898===undefined?-0x1:_0x51a898==='-1'?-0x1:_0x51a898*0x3e8;_0x5839aa=_0x5839aa===undefined?'':'s='+_0x5839aa;_0x24c643=_0x24c643?_0x1cb9('0x45'):'';return this[_0x1cb9('0x24')](util[_0x1cb9('0x2a')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x522283,_0xda1a44,_0xbc36fc,_0x51a898,_0x24c643,_0x5839aa));};AGIChannel[_0x1cb9('0x26')]['streamFile']=function(_0x4c59e7,_0x495335){_0x495335=_0x495335||'';return this[_0x1cb9('0x24')](util[_0x1cb9('0x2a')](_0x1cb9('0x46'),_0x4c59e7,_0x495335));};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0x47')]=function(_0x2a8b7f){return this[_0x1cb9('0x48')](_0x1cb9('0x49'),_0x2a8b7f);};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0x4a')]=function(_0x3ea88c){return this['exec'](_0x1cb9('0x4b'),_0x3ea88c);};AGIChannel[_0x1cb9('0x26')][_0x1cb9('0x19')]=function(_0x55255c,_0x179e81){this[_0x1cb9('0x2c')](util[_0x1cb9('0x2a')](_0x1cb9('0x4c'),_0x55255c['id'],_0x55255c[_0x1cb9('0x4d')],_0x179e81));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index a3c2c9b..a965ad4 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 _0xccef=['Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','apply','message','exports'];(function(_0x3e6a68,_0x577b80){var _0x3981aa=function(_0x5c264f){while(--_0x5c264f){_0x3e6a68['push'](_0x3e6a68['shift']());}};_0x3981aa(++_0x577b80);}(_0xccef,0x1ee));var _0xfcce=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xccef[_0x4565bf];return _0x5610ba;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xfcce('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xfcce('0x1'),'E_AGI_SERVER_CLOSE':_0xfcce('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xfcce('0x3'),'E_AGI_SOCKET_ERROR':_0xfcce('0x4'),'E_AGI_SOCKET_CLOSE':_0xfcce('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xfcce('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xfcce('0x7'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x1bd704){var _0x1bd704=_0x1bd704||null,_0x4bcc9f=_0x4bcc9f||[],_0x30730c=0x1,_0x2e4775='';if(!error[_0x1bd704]){_0x1bd704='E_AGI_UNDEFINED';}_0x4bcc9f['push'](error[_0x1bd704]);while(arguments[_0x30730c]){_0x4bcc9f[_0xfcce('0x8')](arguments[_0x30730c]);_0x30730c++;}_0x2e4775=util[_0xfcce('0x9')][_0xfcce('0xa')](util,_0x4bcc9f);this[_0xfcce('0xb')]=_0x2e4775;this['name']=_0x1bd704;}module[_0xfcce('0xc')]=AGIError; \ No newline at end of file +var _0xccc9=['format','apply','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.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x3403c3,_0x9e30c7){var _0x57aff3=function(_0x289c0a){while(--_0x289c0a){_0x3403c3['push'](_0x3403c3['shift']());}};_0x57aff3(++_0x9e30c7);}(_0xccc9,0xf4));var _0x9ccc=function(_0x3981e9,_0xcc13f2){_0x3981e9=_0x3981e9-0x0;var _0x5ac004=_0xccc9[_0x3981e9];return _0x5ac004;};'use strict';var util=require(_0x9ccc('0x0'));var error={'E_AGI_UNDEFINED':_0x9ccc('0x1'),'E_AGI_ARGUMENT_PORT':_0x9ccc('0x2'),'E_AGI_SERVER_ERROR':_0x9ccc('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x9ccc('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x9ccc('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x9ccc('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x9ccc('0x7'),'E_AGI_IVR_ENTRY':_0x9ccc('0x8')};function AGIError(_0x3c9d3c){var _0x3c9d3c=_0x3c9d3c||null,_0x2f8b10=_0x2f8b10||[],_0x2300ea=0x1,_0x37de8e='';if(!error[_0x3c9d3c]){_0x3c9d3c=_0x9ccc('0x9');}_0x2f8b10[_0x9ccc('0xa')](error[_0x3c9d3c]);while(arguments[_0x2300ea]){_0x2f8b10[_0x9ccc('0xa')](arguments[_0x2300ea]);_0x2300ea++;}_0x37de8e=util[_0x9ccc('0xb')][_0x9ccc('0xc')](util,_0x2f8b10);this['message']=_0x37de8e;this[_0x9ccc('0xd')]=_0x3c9d3c;}module[_0x9ccc('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index aa905fd..eecd729 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 _0xcae2=['default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','numberOfEdges','prototype','addVertex','edges','addEdge','size','relations','traverseBFS','info','stop\x20traverse','length','condition','split','agicommand','vswitch','target','default','invalid'];(function(_0x5eaa23,_0x4b7005){var _0x360c9b=function(_0x367778){while(--_0x367778){_0x5eaa23['push'](_0x5eaa23['shift']());}};_0x360c9b(++_0x4b7005);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2cae('0x0'));var logger=require(_0x2cae('0x1'))(_0x2cae('0x2'));var verticesWithRetry=[_0x2cae('0x3'),_0x2cae('0x4'),_0x2cae('0x5')];var Graph=function(){this[_0x2cae('0x6')]={};this['edges']={};this[_0x2cae('0x7')]=0x0;};Graph[_0x2cae('0x8')][_0x2cae('0x9')]=function(_0x415f20){this['vertices'][_0x415f20['id']]=_0x415f20;this[_0x2cae('0xa')][_0x415f20['id']]=[];};Graph[_0x2cae('0x8')][_0x2cae('0xb')]=function(_0x25b6a2,_0x2e7498,_0x49e1d1){this['edges'][_0x25b6a2]['push']({'target':_0x2e7498,'condition':_0x49e1d1});this['numberOfEdges']+=0x1;};Graph[_0x2cae('0x8')][_0x2cae('0xc')]=function(){return _[_0x2cae('0xc')](this[_0x2cae('0x6')]);};Graph[_0x2cae('0x8')][_0x2cae('0xd')]=function(){return this['numberOfEdges'];};Graph[_0x2cae('0x8')]['getVertex']=function(_0x19373b){return this[_0x2cae('0x6')][_0x19373b];};Graph[_0x2cae('0x8')][_0x2cae('0xe')]=function(_0x302385,_0x9f306f){if(!this['vertices'][_0x302385]){return logger[_0x2cae('0xf')]('no\x20vertex\x20found');}var _0x42f393=_0x9f306f(this[_0x2cae('0x6')][_0x302385]);if(!_0x42f393){return logger['info'](_0x2cae('0x10'));}if(this[_0x2cae('0xa')][_0x302385][_0x2cae('0x11')]===0x0){return logger[_0x2cae('0xf')]('no\x20edge/s\x20available');}for(var _0x3fda2f=0x0,_0x272401=[],_0x4a89e1=![];_0x3fda2f\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','getSquareProject','catch','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','result','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','defaults','127.0.0.1','nextTick','error','stack','log'];(function(_0x250858,_0x3278ba){var _0x17771e=function(_0x3cd613){while(--_0x3cd613){_0x250858['push'](_0x250858['shift']());}};_0x17771e(++_0x3278ba);}(_0x7118,0x159));var _0x8711=function(_0xa19d0a,_0x16f2d7){_0xa19d0a=_0xa19d0a-0x0;var _0xe110d8=_0x7118[_0xa19d0a];return _0xe110d8;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0x8711('0x0'));var util=require(_0x8711('0x1'));var moment=require('moment');var config=require(_0x8711('0x2'));var logger=require(_0x8711('0x3'))(_0x8711('0x4'));var utilLicense=require(_0x8711('0x5'));var rpc=require(_0x8711('0x6'));var mailRpc=require(_0x8711('0x7'));var Graph=require(_0x8711('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8711('0x4')]=_[_0x8711('0x9')](config[_0x8711('0x4')],{'ip':_0x8711('0xa'),'port':0x11dd});function connectionHandler(_0x189349){process[_0x8711('0xb')](function(){syncho(function(){try{setChannelVariables(_0x189349);agiHandler(_0x189349);}catch(_0x7f7ca7){logger[_0x8711('0xc')](_0x7f7ca7[_0x8711('0xd')]);}});});}function listeningHandler(){console[_0x8711('0xe')](_0x8711('0xf'),config['agi']['port']);logger[_0x8711('0x10')](util[_0x8711('0x11')](_0x8711('0x12'),config['agi']['ip'],config['agi'][_0x8711('0x13')]));}function errorHandler(_0x89db9a){if(_0x89db9a&&_0x89db9a['name']&&_0x89db9a['message']){logger[_0x8711('0xc')](util[_0x8711('0x11')](_0x8711('0x14'),_0x89db9a[_0x8711('0x15')],_0x89db9a[_0x8711('0x16')]));}else{logger[_0x8711('0xc')](util[_0x8711('0x11')]('[ERROR]\x20%s',_0x89db9a[_0x8711('0xd')]));}}function closeHandler(){logger[_0x8711('0x10')](util[_0x8711('0x11')](_0x8711('0x17'),this[_0x8711('0x18')],this[_0x8711('0x19')],this['callerid'],this[_0x8711('0x1a')],this[_0x8711('0x1b')]));try{createSquareReport(this);}catch(_0x1c2cb5){logger[_0x8711('0xc')](_0x1c2cb5[_0x8711('0xd')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x8711('0x18')],this[_0x8711('0x19')],this[_0x8711('0x1c')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x8711('0x10')](util[_0x8711('0x11')](_0x8711('0x1d'),this[_0x8711('0x18')],this[_0x8711('0x19')],this[_0x8711('0x1c')],this[_0x8711('0x1a')],this[_0x8711('0x1b')]));this[_0x8711('0x1e')]=!![];}function getRoot(_0x41369d){return parser['toJson'](_0x41369d,{'object':!![]})[_0x8711('0x1f')][_0x8711('0x20')];}function addVertex(_0x3302b9,_0x939ef3,_0x4cf830){_0x939ef3[_0x8711('0x21')]=_0x4cf830;if(_0x939ef3[_0x8711('0x22')](_0x8711('0x23'))){_0x939ef3['maxRetry']=parseInt(_0x939ef3[_0x8711('0x23')],0xa);}_0x3302b9[_0x8711('0x24')](_[_0x8711('0x25')](_0x939ef3,_0x8711('0x26')));}function initGraph(_0x3f937b,_0x514956){var _0x494683=new Graph();for(var _0x515a74 in _0x3f937b){if(_0x3f937b[_0x8711('0x22')](_0x515a74)){if(_[_0x8711('0x27')](_0x3f937b[_0x515a74])){for(var _0x2d0901=0x0;_0x2d0901<_0x3f937b[_0x515a74][_0x8711('0x28')];_0x2d0901+=0x1){addVertex(_0x494683,_0x3f937b[_0x515a74][_0x2d0901],_0x515a74);}}else{addVertex(_0x494683,_0x3f937b[_0x515a74],_0x515a74);}}}for(var _0x12cfdc=0x0;_0x12cfdc<_0x514956[_0x8711('0x28')];_0x12cfdc+=0x1){if(_0x514956[_0x12cfdc][_0x8711('0x29')]&&_0x514956[_0x12cfdc][_0x8711('0x2a')]){_0x494683[_0x8711('0x2b')](_0x514956[_0x12cfdc]['source'],_0x514956[_0x12cfdc][_0x8711('0x2a')],_0x514956[_0x12cfdc]['value']);}}return _0x494683;}function getSquareProject(_0x28c2d5,_0xd0c671){rpc[_0x8711('0x2c')](_0x28c2d5)['then'](function(_0x440bc8){_0xd0c671(null,_0x440bc8);})['catch'](function(_0x2c4ba3){_0xd0c671(null,_0x2c4ba3);});}function createSquareReport(_0xa85687,_0x230376){rpc['createSquareReport'](_0xa85687)['then'](function(_0x465c5b){if(_0x230376){_0x230376(null,_0x465c5b);}})[_0x8711('0x2d')](function(_0x35af69){if(_0x230376){_0x230376(null,_0x35af69);}});}function setChannelVariables(_0x6ab2c7){for(var _0x1c2fae in _0x6ab2c7){if(_0x6ab2c7[_0x8711('0x22')](_0x1c2fae)){if(_0x1c2fae[_0x8711('0x2e')](_0x8711('0x2f'))===0x0){_0x6ab2c7[_0x1c2fae[_0x8711('0x30')](0x4)]=_0x6ab2c7[_0x1c2fae];delete _0x6ab2c7[_0x1c2fae];}}}}function getLogFromObject(_0x36f3bd){return util['inspect'](_0x36f3bd,{'showHidden':![],'depth':null});}function agiHandler(_0x3ede91){var _0x11c1e9,_0xa22baf,_0x285390,_0x11e2fc,_0x23a78b;logger[_0x8711('0x31')](_0x8711('0x32'),JSON[_0x8711('0x33')](_0x3ede91,null,0x2));logger[_0x8711('0x10')](util['format'](_0x8711('0x34'),_0x3ede91[_0x8711('0x18')],_0x3ede91[_0x8711('0x19')],_0x3ede91[_0x8711('0x1c')],_0x3ede91[_0x8711('0x1a')],_0x3ede91['uniqueid']));_0x3ede91['on'](_0x8711('0xc'),errorHandler);_0x3ede91['on'](_0x8711('0x35'),closeHandler);_0x3ede91['on'](_0x8711('0x36'),timeoutHandler);_0x3ede91['evtHangup']=![];_0x3ede91['on'](_0x8711('0x37'),hangupHandler);var _0x37fc30=getSquareProject[_0x8711('0x38')](null,_0x3ede91[_0x8711('0x18')]);if(_0x37fc30){if(_0x37fc30[_0x8711('0x39')]){_0x11c1e9=getRoot(_0x37fc30[_0x8711('0x39')]);if(_0x11c1e9&&_0x11c1e9[_0x8711('0x3a')]){logger['debug'](_0x8711('0x20'),JSON[_0x8711('0x33')](_0x11c1e9,null,0x2));_0x3ede91[_0x8711('0x3b')]=moment()[_0x8711('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0xa22baf=initGraph(_['omit'](_0x11c1e9,_0x8711('0x26')),_0x11c1e9[_0x8711('0x26')]);_0x285390=new Vertices(_0x3ede91,rpc,mailRpc);logger[_0x8711('0x10')](util[_0x8711('0x11')](_0x8711('0x3c'),_0x3ede91[_0x8711('0x18')],_0x3ede91[_0x8711('0x19')],_0x3ede91[_0x8711('0x1c')],_0x3ede91[_0x8711('0x1a')],_0x3ede91[_0x8711('0x1b')]));_0xa22baf[_0x8711('0x3d')](_0x11c1e9[_0x8711('0x3a')]['id'],function(_0x1efd42){try{_0x1efd42=_0x285390[_0x8711('0x3e')](_0x1efd42);logger[_0x8711('0x31')](_0x8711('0x3f'),JSON[_0x8711('0x33')](_0x1efd42,null,0x2));if(_0x1efd42[_0x8711('0x21')]===_0x8711('0x40')){logger[_0x8711('0x10')](_0x8711('0x41'));_0x3ede91['context']=_0x1efd42[_0x8711('0x42')]||_0x3ede91['context'];_0x3ede91[_0x8711('0x43')]=_0x1efd42[_0x8711('0x43')];_0x3ede91[_0x8711('0x44')]=_0x1efd42[_0x8711('0x44')]?_0x1efd42['priority']-0x1:0x1;return null;}else if(_0x1efd42&&_0x285390[_0x1efd42[_0x8711('0x21')]]){_0x23a78b=_0x285390[_0x1efd42[_0x8711('0x21')]](_0x1efd42);logger[_0x8711('0x10')](_0x8711('0x45'),JSON[_0x8711('0x33')](_0x23a78b,null,0x2));if(_0x23a78b&&_0x23a78b[_0x8711('0x46')]===AGI_CODE_SUCCESS&&_0x23a78b['result']!==AGI_RESULT_ERROR&&!_0x3ede91[_0x8711('0x1e')]){logger[_0x8711('0x31')](_0x8711('0x45'),getLogFromObject(_0x23a78b));return _[_0x8711('0x47')](_0x23a78b['result'])?null:_0x23a78b[_0x8711('0x48')][_0x8711('0x49')]();}else{logger[_0x8711('0xc')](_0x8711('0x45'),getLogFromObject(_0x23a78b));return null;}}else{logger[_0x8711('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x4a0436){logger[_0x8711('0xc')](_0x4a0436[_0x8711('0xd')]);return null;}});if(_0x11c1e9['finally']){logger[_0x8711('0x10')](util[_0x8711('0x11')](_0x8711('0x4a'),_0x3ede91[_0x8711('0x18')],_0x3ede91['calleridname'],_0x3ede91[_0x8711('0x1c')],_0x3ede91[_0x8711('0x1a')],_0x3ede91[_0x8711('0x1b')]));_0xa22baf['traverseBFS'](_0x11c1e9[_0x8711('0x4b')]['id'],function(_0x29b79e){try{_0x29b79e=_0x285390['clear'](_0x29b79e);logger[_0x8711('0x31')](_0x8711('0x3f'),JSON['stringify'](_0x29b79e,null,0x2));if(_0x29b79e&&_0x285390[_0x29b79e[_0x8711('0x21')]]){_0x23a78b=_0x285390[_0x29b79e[_0x8711('0x21')]](_0x29b79e);if(_0x23a78b){logger['debug'](_0x8711('0x45'),getLogFromObject(_0x23a78b));return _[_0x8711('0x47')](_0x23a78b[_0x8711('0x48')])?null:_0x23a78b[_0x8711('0x48')]['toString']();}else{logger[_0x8711('0xc')](_0x8711('0x45'),getLogFromObject(_0x23a78b));return null;}}else{logger['error'](_0x8711('0x4c'));return null;}}catch(_0x209813){logger['error'](_0x209813['stack']);return null;}});}logger['info'](util['format'](_0x8711('0x4d'),_0x3ede91[_0x8711('0x18')],_0x3ede91[_0x8711('0x19')],_0x3ede91[_0x8711('0x1c')],_0x3ede91[_0x8711('0x1a')],_0x3ede91[_0x8711('0x1b')]));logger[_0x8711('0x10')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3ede91['context'],_0x3ede91[_0x8711('0x43')],parseInt(_0x3ede91[_0x8711('0x44')],0xa)+0x1));_0x3ede91[_0x8711('0x4e')](_0x3ede91[_0x8711('0x42')],_0x3ede91[_0x8711('0x43')],parseInt(_0x3ede91[_0x8711('0x44')],0xa)+0x1);_0x3ede91['close']();}}else{logger[_0x8711('0xc')](util[_0x8711('0x11')](_0x8711('0x4f'),_0x3ede91['arg_1']));_0x3ede91[_0x8711('0x4e')](_0x3ede91[_0x8711('0x42')],_0x3ede91[_0x8711('0x43')],parseInt(_0x3ede91[_0x8711('0x44')],0xa)+0x1);_0x3ede91[_0x8711('0x35')]();}}else{logger[_0x8711('0xc')](util[_0x8711('0x11')](_0x8711('0x50'),_0x3ede91['arg_1']));_0x3ede91[_0x8711('0x4e')](_0x3ede91['context'],_0x3ede91[_0x8711('0x43')],parseInt(_0x3ede91['priority'],0xa)+0x1);_0x3ede91['close']();}}function main(){var _0x4f6f3d;return utilLicense[_0x8711('0x51')]()[_0x8711('0x52')](function(_0x5a1468){if(_0x5a1468){if(_0x5a1468[_0x8711('0x53')]){if(_0x5a1468['callysquare']&&_0x5a1468[_0x8711('0x54')]>0x0){logger[_0x8711('0x10')](util['format'](_0x8711('0x55'),_0x5a1468['callysquare']));_0x4f6f3d=_0x5a1468[_0x8711('0x54')];}else{logger[_0x8711('0x10')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0x8711('0x56'));_0x4f6f3d=-0x1;}}})['catch'](function(_0x15c02f){logger[_0x8711('0xc')](_0x8711('0x57'),_0x15c02f[_0x8711('0xd')]);})[_0x8711('0x4b')](function(){var _0x5dfb08=require(_0x8711('0x58'))(config[_0x8711('0x4')][_0x8711('0x13')],config[_0x8711('0x4')]['ip'],_0x4f6f3d);_0x5dfb08['on'](_0x8711('0xc'),errorHandler);_0x5dfb08['on']('listening',listeningHandler);_0x5dfb08['on'](_0x8711('0x59'),connectionHandler);_0x5dfb08['on'](_0x8711('0x35'),closeHandler);});}main(); \ No newline at end of file +var _0xa41a=['vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','catch','./server','listening','xml2json','lodash','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./vertices','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','addVertex','isArray','length','source','target','addEdge','value','then','createSquareReport','indexOf','substring','inspect','debug','stringify','hangup','sync','production','start','root','joinAt','omit','mxCell','calleridname','traverseBFS','clear'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0xa41a,0x6b));var _0xaa41=function(_0x1dc348,_0x453ca3){_0x1dc348=_0x1dc348-0x0;var _0x4b1e3f=_0xa41a[_0x1dc348];return _0x4b1e3f;};'use strict';var parser=require(_0xaa41('0x0'));var _=require(_0xaa41('0x1'));var syncho=require('syncho');var util=require(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var config=require(_0xaa41('0x4'));var logger=require(_0xaa41('0x5'))(_0xaa41('0x6'));var utilLicense=require(_0xaa41('0x7'));var rpc=require(_0xaa41('0x8'));var mailRpc=require(_0xaa41('0x9'));var Graph=require('./graph');var Vertices=require(_0xaa41('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xaa41('0x6')]=_['defaults'](config['agi'],{'ip':_0xaa41('0xb'),'port':0x11dd});function connectionHandler(_0x202cce){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x202cce);agiHandler(_0x202cce);}catch(_0x31df43){logger[_0xaa41('0xc')](_0x31df43[_0xaa41('0xd')]);}});});}function listeningHandler(){console[_0xaa41('0xe')](_0xaa41('0xf'),config[_0xaa41('0x6')][_0xaa41('0x10')]);logger[_0xaa41('0x11')](util[_0xaa41('0x12')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xaa41('0x6')]['ip'],config[_0xaa41('0x6')]['port']));}function errorHandler(_0x54827c){if(_0x54827c&&_0x54827c[_0xaa41('0x13')]&&_0x54827c['message']){logger[_0xaa41('0xc')](util[_0xaa41('0x12')](_0xaa41('0x14'),_0x54827c[_0xaa41('0x13')],_0x54827c[_0xaa41('0x15')]));}else{logger['error'](util[_0xaa41('0x12')](_0xaa41('0x16'),_0x54827c[_0xaa41('0xd')]));}}function closeHandler(){logger[_0xaa41('0x11')](util[_0xaa41('0x12')](_0xaa41('0x17'),this[_0xaa41('0x18')],this['calleridname'],this[_0xaa41('0x19')],this[_0xaa41('0x1a')],this[_0xaa41('0x1b')]));try{createSquareReport(this);}catch(_0x391b01){logger[_0xaa41('0xc')](_0x391b01[_0xaa41('0xd')]);}}function timeoutHandler(){logger[_0xaa41('0x11')](util[_0xaa41('0x12')](_0xaa41('0x1c'),this['arg_1'],this['calleridname'],this[_0xaa41('0x19')],this[_0xaa41('0x1a')],this[_0xaa41('0x1b')]));}function hangupHandler(){logger['info'](util[_0xaa41('0x12')](_0xaa41('0x1d'),this['arg_1'],this['calleridname'],this[_0xaa41('0x19')],this['dnid'],this[_0xaa41('0x1b')]));this[_0xaa41('0x1e')]=!![];}function getRoot(_0x3e2175){return parser[_0xaa41('0x1f')](_0x3e2175,{'object':!![]})[_0xaa41('0x20')]['root'];}function addVertex(_0x43c430,_0x43a85c,_0x448a21){_0x43a85c[_0xaa41('0x21')]=_0x448a21;if(_0x43a85c[_0xaa41('0x22')](_0xaa41('0x23'))){_0x43a85c['maxRetry']=parseInt(_0x43a85c['retry'],0xa);}_0x43c430[_0xaa41('0x24')](_['omit'](_0x43a85c,'mxCell'));}function initGraph(_0x12e362,_0x59707f){var _0x536bed=new Graph();for(var _0x2d0ac0 in _0x12e362){if(_0x12e362[_0xaa41('0x22')](_0x2d0ac0)){if(_[_0xaa41('0x25')](_0x12e362[_0x2d0ac0])){for(var _0x632fd2=0x0;_0x632fd2<_0x12e362[_0x2d0ac0][_0xaa41('0x26')];_0x632fd2+=0x1){addVertex(_0x536bed,_0x12e362[_0x2d0ac0][_0x632fd2],_0x2d0ac0);}}else{addVertex(_0x536bed,_0x12e362[_0x2d0ac0],_0x2d0ac0);}}}for(var _0xa7269f=0x0;_0xa7269f<_0x59707f['length'];_0xa7269f+=0x1){if(_0x59707f[_0xa7269f][_0xaa41('0x27')]&&_0x59707f[_0xa7269f][_0xaa41('0x28')]){_0x536bed[_0xaa41('0x29')](_0x59707f[_0xa7269f][_0xaa41('0x27')],_0x59707f[_0xa7269f][_0xaa41('0x28')],_0x59707f[_0xa7269f][_0xaa41('0x2a')]);}}return _0x536bed;}function getSquareProject(_0x30f88e,_0x104a95){rpc['getSquareProject'](_0x30f88e)[_0xaa41('0x2b')](function(_0x48b48b){_0x104a95(null,_0x48b48b);})['catch'](function(_0x714537){_0x104a95(null,_0x714537);});}function createSquareReport(_0x1176bd,_0x534a85){rpc[_0xaa41('0x2c')](_0x1176bd)[_0xaa41('0x2b')](function(_0x4e3b44){if(_0x534a85){_0x534a85(null,_0x4e3b44);}})['catch'](function(_0x5c25fb){if(_0x534a85){_0x534a85(null,_0x5c25fb);}});}function setChannelVariables(_0x1cf3da){for(var _0x2f5cc0 in _0x1cf3da){if(_0x1cf3da[_0xaa41('0x22')](_0x2f5cc0)){if(_0x2f5cc0[_0xaa41('0x2d')]('agi_')===0x0){_0x1cf3da[_0x2f5cc0[_0xaa41('0x2e')](0x4)]=_0x1cf3da[_0x2f5cc0];delete _0x1cf3da[_0x2f5cc0];}}}}function getLogFromObject(_0x45c8fe){return util[_0xaa41('0x2f')](_0x45c8fe,{'showHidden':![],'depth':null});}function agiHandler(_0x4de770){var _0x387c55,_0xd8cd56,_0x321eb7,_0x57ab80,_0x252c62;logger[_0xaa41('0x30')]('variables',JSON[_0xaa41('0x31')](_0x4de770,null,0x2));logger[_0xaa41('0x11')](util[_0xaa41('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4de770[_0xaa41('0x18')],_0x4de770['calleridname'],_0x4de770[_0xaa41('0x19')],_0x4de770[_0xaa41('0x1a')],_0x4de770[_0xaa41('0x1b')]));_0x4de770['on']('error',errorHandler);_0x4de770['on']('close',closeHandler);_0x4de770['on']('timeout',timeoutHandler);_0x4de770[_0xaa41('0x1e')]=![];_0x4de770['on'](_0xaa41('0x32'),hangupHandler);var _0x1334c8=getSquareProject[_0xaa41('0x33')](null,_0x4de770['arg_1']);if(_0x1334c8){if(_0x1334c8['production']){_0x387c55=getRoot(_0x1334c8[_0xaa41('0x34')]);if(_0x387c55&&_0x387c55[_0xaa41('0x35')]){logger[_0xaa41('0x30')](_0xaa41('0x36'),JSON[_0xaa41('0x31')](_0x387c55,null,0x2));_0x4de770[_0xaa41('0x37')]=moment()[_0xaa41('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0xd8cd56=initGraph(_[_0xaa41('0x38')](_0x387c55,_0xaa41('0x39')),_0x387c55[_0xaa41('0x39')]);_0x321eb7=new Vertices(_0x4de770,rpc,mailRpc);logger[_0xaa41('0x11')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4de770[_0xaa41('0x18')],_0x4de770[_0xaa41('0x3a')],_0x4de770['callerid'],_0x4de770[_0xaa41('0x1a')],_0x4de770['uniqueid']));_0xd8cd56[_0xaa41('0x3b')](_0x387c55[_0xaa41('0x35')]['id'],function(_0x1a2d11){try{_0x1a2d11=_0x321eb7[_0xaa41('0x3c')](_0x1a2d11);logger[_0xaa41('0x30')](_0xaa41('0x3d'),JSON[_0xaa41('0x31')](_0x1a2d11,null,0x2));if(_0x1a2d11[_0xaa41('0x21')]==='gotoc'){logger[_0xaa41('0x11')](_0xaa41('0x3e'));_0x4de770[_0xaa41('0x3f')]=_0x1a2d11[_0xaa41('0x3f')]||_0x4de770[_0xaa41('0x3f')];_0x4de770[_0xaa41('0x40')]=_0x1a2d11['extension'];_0x4de770['priority']=_0x1a2d11[_0xaa41('0x41')]?_0x1a2d11['priority']-0x1:0x1;return null;}else if(_0x1a2d11&&_0x321eb7[_0x1a2d11[_0xaa41('0x21')]]){_0x252c62=_0x321eb7[_0x1a2d11[_0xaa41('0x21')]](_0x1a2d11);logger[_0xaa41('0x11')](_0xaa41('0x42'),JSON[_0xaa41('0x31')](_0x252c62,null,0x2));if(_0x252c62&&_0x252c62[_0xaa41('0x43')]===AGI_CODE_SUCCESS&&_0x252c62[_0xaa41('0x44')]!==AGI_RESULT_ERROR&&!_0x4de770['evtHangup']){logger[_0xaa41('0x30')]('response',getLogFromObject(_0x252c62));return _['isUndefined'](_0x252c62[_0xaa41('0x44')])?null:_0x252c62['result']['toString']();}else{logger['error'](_0xaa41('0x42'),getLogFromObject(_0x252c62));return null;}}else{logger['error'](_0xaa41('0x45'));return null;}}catch(_0x198716){logger['error'](_0x198716['stack']);return null;}});if(_0x387c55[_0xaa41('0x46')]){logger[_0xaa41('0x11')](util[_0xaa41('0x12')](_0xaa41('0x47'),_0x4de770[_0xaa41('0x18')],_0x4de770[_0xaa41('0x3a')],_0x4de770[_0xaa41('0x19')],_0x4de770[_0xaa41('0x1a')],_0x4de770[_0xaa41('0x1b')]));_0xd8cd56['traverseBFS'](_0x387c55[_0xaa41('0x46')]['id'],function(_0x22d512){try{_0x22d512=_0x321eb7[_0xaa41('0x3c')](_0x22d512);logger[_0xaa41('0x30')](_0xaa41('0x3d'),JSON[_0xaa41('0x31')](_0x22d512,null,0x2));if(_0x22d512&&_0x321eb7[_0x22d512['agicommand']]){_0x252c62=_0x321eb7[_0x22d512[_0xaa41('0x21')]](_0x22d512);if(_0x252c62){logger[_0xaa41('0x30')](_0xaa41('0x42'),getLogFromObject(_0x252c62));return _[_0xaa41('0x48')](_0x252c62['result'])?null:_0x252c62[_0xaa41('0x44')]['toString']();}else{logger['error'](_0xaa41('0x42'),getLogFromObject(_0x252c62));return null;}}else{logger[_0xaa41('0xc')](_0xaa41('0x45'));return null;}}catch(_0x4ca114){logger[_0xaa41('0xc')](_0x4ca114[_0xaa41('0xd')]);return null;}});}logger[_0xaa41('0x11')](util['format'](_0xaa41('0x49'),_0x4de770[_0xaa41('0x18')],_0x4de770[_0xaa41('0x3a')],_0x4de770[_0xaa41('0x19')],_0x4de770[_0xaa41('0x1a')],_0x4de770[_0xaa41('0x1b')]));logger[_0xaa41('0x11')](util[_0xaa41('0x12')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4de770[_0xaa41('0x3f')],_0x4de770['extension'],parseInt(_0x4de770['priority'],0xa)+0x1));_0x4de770[_0xaa41('0x4a')](_0x4de770[_0xaa41('0x3f')],_0x4de770[_0xaa41('0x40')],parseInt(_0x4de770[_0xaa41('0x41')],0xa)+0x1);_0x4de770[_0xaa41('0x4b')]();}}else{logger[_0xaa41('0xc')](util[_0xaa41('0x12')](_0xaa41('0x4c'),_0x4de770['arg_1']));_0x4de770[_0xaa41('0x4a')](_0x4de770[_0xaa41('0x3f')],_0x4de770[_0xaa41('0x40')],parseInt(_0x4de770['priority'],0xa)+0x1);_0x4de770[_0xaa41('0x4b')]();}}else{logger[_0xaa41('0xc')](util['format'](_0xaa41('0x4d'),_0x4de770[_0xaa41('0x18')]));_0x4de770[_0xaa41('0x4a')](_0x4de770['context'],_0x4de770[_0xaa41('0x40')],parseInt(_0x4de770[_0xaa41('0x41')],0xa)+0x1);_0x4de770['close']();}}function main(){var _0x49789a;return utilLicense[_0xaa41('0x4e')]()[_0xaa41('0x2b')](function(_0x3a29d2){if(_0x3a29d2){if(_0x3a29d2['voice']){if(_0x3a29d2[_0xaa41('0x4f')]&&_0x3a29d2[_0xaa41('0x4f')]>0x0){logger[_0xaa41('0x11')](util[_0xaa41('0x12')](_0xaa41('0x50'),_0x3a29d2['callysquare']));_0x49789a=_0x3a29d2[_0xaa41('0x4f')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xaa41('0x11')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x49789a=-0x1;}}})[_0xaa41('0x51')](function(_0xbbf261){logger[_0xaa41('0xc')]('[LICENSE]',_0xbbf261[_0xaa41('0xd')]);})[_0xaa41('0x46')](function(){var _0x36154e=require(_0xaa41('0x52'))(config[_0xaa41('0x6')][_0xaa41('0x10')],config[_0xaa41('0x6')]['ip'],_0x49789a);_0x36154e['on'](_0xaa41('0xc'),errorHandler);_0x36154e['on'](_0xaa41('0x53'),listeningHandler);_0x36154e['on']('connection',connectionHandler);_0x36154e['on'](_0xaa41('0x4b'),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 adcd235..d4b026e 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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x22e381,_0x44e0aa){var _0x17bf73=function(_0x6dc89f){while(--_0x6dc89f){_0x22e381['push'](_0x22e381['shift']());}};_0x17bf73(++_0x44e0aa);}(_0x814b,0x1a2));var _0xb814=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0x814b[_0x1529a3];return _0x1a0d4b;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x11876b,_0x2c40f6){var _0x10f380=function(_0x262bfd){while(--_0x262bfd){_0x11876b['push'](_0x11876b['shift']());}};_0x10f380(++_0x2c40f6);}(_0x34e8,0x12c));var _0x834e=function(_0x405a46,_0x5202bb){_0x405a46=_0x405a46-0x0;var _0x1feadc=_0x34e8[_0x405a46];return _0x1feadc;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index cc0364f..2b98882 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x34e9da,_0xd22403){var _0x343289=function(_0x3c30c8){while(--_0x3c30c8){_0x34e9da['push'](_0x34e9da['shift']());}};_0x343289(++_0xd22403);}(_0x5f2f,0x73));var _0xf5f2=function(_0x40d18c,_0x170f07){_0x40d18c=_0x40d18c-0x0;var _0xe08c17=_0x5f2f[_0x40d18c];return _0xe08c17;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0xb9234d,_0x566e12){var _0x55008a=function(_0x2612c1){while(--_0x2612c1){_0xb9234d['push'](_0xb9234d['shift']());}};_0x55008a(++_0x566e12);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ac093,_0x352d1a){_0x5ac093=_0x5ac093-0x0;var _0x192026=_0x5f2f[_0x5ac093];return _0x192026;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 9b60206..9732306 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 _0x8a85=['result','catch','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowTrunk','getSoundById','ShowSound','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareMessage','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','agentUnpause','UnpauseUser','agentLogout','moment','util','jayson/promise','request','error','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8a85,0x64));var _0x58a8=function(_0x564ab4,_0x253c01){_0x564ab4=_0x564ab4-0x0;var _0x5c2ed3=_0x8a85[_0x564ab4];return _0x5c2ed3;};'use strict';var BPromise=require('bluebird');var moment=require(_0x58a8('0x0'));var _=require('lodash');var util=require(_0x58a8('0x1'));var jayson=require(_0x58a8('0x2'));var client=jayson['client']['http']({'port':0x2329});function request(_0x224831,_0xbd3e90){return new BPromise(function(_0x255762,_0x387c26){return client[_0x58a8('0x3')](_0x224831,_0xbd3e90)['then'](function(_0x5f37a6){if(_0x5f37a6[_0x58a8('0x4')]){return _0x387c26(_0x5f37a6[_0x58a8('0x4')][_0x58a8('0x5')]);}else{return _0x255762(_0x5f37a6[_0x58a8('0x6')]);}})[_0x58a8('0x7')](function(_0x4b9c4d){return _0x387c26(_0x4b9c4d);});});}exports[_0x58a8('0x8')]=function(_0x427f42){return request(_0x58a8('0x9'),{'options':{'raw':![],'where':{'name':_0x427f42},'attributes':['production']}});};exports['getMailAccountById']=function(_0x478821){return request(_0x58a8('0xa'),{'options':{'raw':![],'where':{'id':_0x478821},'include':[{'model':_0x58a8('0xb'),'as':_0x58a8('0xc')}],'attributes':['id',_0x58a8('0xd'),_0x58a8('0xe')]}});};exports[_0x58a8('0xf')]=function(_0x17fcf2){return request(_0x58a8('0x9'),{'options':{'where':{'id':_0x17fcf2},'attributes':['name']}});};exports[_0x58a8('0x10')]=function(_0xc6ba3b){return request(_0x58a8('0x11'),{'options':{'where':{'id':_0xc6ba3b},'attributes':[_0x58a8('0xd')]}});};exports['getVariableById']=function(_0x28fad8){return request(_0x58a8('0x12'),{'options':{'where':{'id':_0x28fad8},'attributes':[_0x58a8('0xd')]}});};exports['getSquareOdbcById']=function(_0x42ba3c){return request(_0x58a8('0x13'),{'options':{'where':{'id':_0x42ba3c},'attributes':[_0x58a8('0x14')]}});};exports[_0x58a8('0x15')]=function(_0x2a1e10){return request('ShowUser',{'options':{'where':{'id':_0x2a1e10},'attributes':[_0x58a8('0xd')]}});};exports['getTrunkById']=function(_0x12cc08){return request(_0x58a8('0x16'),{'options':{'where':{'id':_0x12cc08},'attributes':[_0x58a8('0xd')]}});};exports[_0x58a8('0x17')]=function(_0x2cc44b){return request(_0x58a8('0x18'),{'options':{'where':{'id':_0x2cc44b},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x44a491){return request(_0x58a8('0x19'),{'options':{'raw':![],'where':{'id':_0x44a491},'include':[{'model':_0x58a8('0x1a'),'as':_0x58a8('0x1b')}]}});};exports[_0x58a8('0x1c')]=function(_0x1b54d5){return request(_0x58a8('0x1d'),{'options':{'where':{'id':_0x1b54d5},'attributes':['id',_0x58a8('0xd')]}});};exports[_0x58a8('0x1e')]=function(_0x280f59){return request('CreateSmsMessage',{'body':_0x280f59});};exports[_0x58a8('0x1f')]=function(_0x49a8f3){return request(_0x58a8('0x20'),{'body':_0x49a8f3});};exports['createSquareReport']=function(_0x1e4367){return request(_0x58a8('0x21'),{'body':_[_0x58a8('0x22')](_0x1e4367,{'project_name':_0x1e4367[_0x58a8('0x23')],'prev_project_name':_0x1e4367[_0x58a8('0x24')]||'','is_subproject':_0x1e4367['arg_2']?!![]:![],'leaveAt':moment()[_0x58a8('0x25')](_0x58a8('0x26'))})});};exports[_0x58a8('0x27')]=function(_0x22efce){return request('CreateSquareRecording',{'body':_0x22efce});};exports['createSquareMessage']=function(_0x454644){return request(_0x58a8('0x28'),{'body':_0x454644});};exports['createCmContact']=function(_0x1be44f){return request(_0x58a8('0x29'),{'options':{'raw':![],'where':{'phone':_0x1be44f[_0x58a8('0x2a')],'ListId':_0x1be44f[_0x58a8('0x2b')]}}})[_0x58a8('0x2c')](function(_0x1b3bf1){if(_0x1b3bf1){return _0x1b3bf1;}return request(_0x58a8('0x2d'),{'body':_0x1be44f});});};exports[_0x58a8('0x2e')]=function(_0x52fe37){return request(_0x58a8('0x2f'),{'options':{'where':{'id':_0x52fe37},'attributes':[_0x58a8('0xd')]}});};exports[_0x58a8('0x30')]=function(_0x13aeb2,_0x145cbf){return request('LoginUser',{'body':{'interface':_0x145cbf},'options':{'where':_0x13aeb2}});};exports[_0x58a8('0x31')]=function(_0x238c7b,_0x3b05f3,_0x1abde8){return request('PauseUser',{'body':{'type':_0x3b05f3,'uniqueid':_0x1abde8},'options':{'where':_0x238c7b}});};exports[_0x58a8('0x32')]=function(_0x1baa9a){return request(_0x58a8('0x33'),{'body':{},'options':{'where':_0x1baa9a}});};exports[_0x58a8('0x34')]=function(_0x259ec2){return request('LogoutUser',{'body':{},'options':{'where':_0x259ec2}});}; \ No newline at end of file +var _0x9173=['CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentUnpause','agentLogout','LogoutUser','bluebird','moment','util','jayson/promise','client','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','ShowMailAccount','email','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getTrunkById','ShowTrunk','getSoundById','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport'];(function(_0x17a754,_0x5f1052){var _0x545d3e=function(_0x24ec39){while(--_0x24ec39){_0x17a754['push'](_0x17a754['shift']());}};_0x545d3e(++_0x5f1052);}(_0x9173,0xb4));var _0x3917=function(_0x49c5e7,_0x398f36){_0x49c5e7=_0x49c5e7-0x0;var _0x70bbae=_0x9173[_0x49c5e7];return _0x70bbae;};'use strict';var BPromise=require(_0x3917('0x0'));var moment=require(_0x3917('0x1'));var _=require('lodash');var util=require(_0x3917('0x2'));var jayson=require(_0x3917('0x3'));var client=jayson[_0x3917('0x4')]['http']({'port':0x2329});function request(_0x245822,_0x5e0739){return new BPromise(function(_0xb4eb06,_0x1b874d){return client[_0x3917('0x5')](_0x245822,_0x5e0739)[_0x3917('0x6')](function(_0x2dace9){if(_0x2dace9['error']){return _0x1b874d(_0x2dace9[_0x3917('0x7')][_0x3917('0x8')]);}else{return _0xb4eb06(_0x2dace9[_0x3917('0x9')]);}})[_0x3917('0xa')](function(_0x10ee61){return _0x1b874d(_0x10ee61);});});}exports[_0x3917('0xb')]=function(_0x58282f){return request(_0x3917('0xc'),{'options':{'raw':![],'where':{'name':_0x58282f},'attributes':[_0x3917('0xd')]}});};exports['getMailAccountById']=function(_0x41cd4a){return request(_0x3917('0xe'),{'options':{'raw':![],'where':{'id':_0x41cd4a},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id','name',_0x3917('0xf')]}});};exports[_0x3917('0x10')]=function(_0x378ad3){return request(_0x3917('0xc'),{'options':{'where':{'id':_0x378ad3},'attributes':[_0x3917('0x11')]}});};exports[_0x3917('0x12')]=function(_0x55b37a){return request(_0x3917('0x13'),{'options':{'where':{'id':_0x55b37a},'attributes':[_0x3917('0x11')]}});};exports[_0x3917('0x14')]=function(_0x1d19bc){return request('ShowVariable',{'options':{'where':{'id':_0x1d19bc},'attributes':[_0x3917('0x11')]}});};exports[_0x3917('0x15')]=function(_0x36b162){return request(_0x3917('0x16'),{'options':{'where':{'id':_0x36b162},'attributes':[_0x3917('0x17')]}});};exports['getUserById']=function(_0x1a5614){return request('ShowUser',{'options':{'where':{'id':_0x1a5614},'attributes':['name']}});};exports[_0x3917('0x18')]=function(_0x42b9d4){return request(_0x3917('0x19'),{'options':{'where':{'id':_0x42b9d4},'attributes':['name']}});};exports[_0x3917('0x1a')]=function(_0x504934){return request('ShowSound',{'options':{'where':{'id':_0x504934},'attributes':[_0x3917('0x1b')]}});};exports['getIntervalById']=function(_0x1f91a5){return request(_0x3917('0x1c'),{'options':{'raw':![],'where':{'id':_0x1f91a5},'include':[{'model':_0x3917('0x1d'),'as':_0x3917('0x1e')}]}});};exports[_0x3917('0x1f')]=function(_0x2f9f7d){return request(_0x3917('0x20'),{'options':{'where':{'id':_0x2f9f7d},'attributes':['id',_0x3917('0x11')]}});};exports[_0x3917('0x21')]=function(_0x29482e){return request(_0x3917('0x22'),{'body':_0x29482e});};exports['createSquareDetailsReport']=function(_0x1e3d24){return request(_0x3917('0x23'),{'body':_0x1e3d24});};exports['createSquareReport']=function(_0x576a23){return request(_0x3917('0x24'),{'body':_['merge'](_0x576a23,{'project_name':_0x576a23[_0x3917('0x25')],'prev_project_name':_0x576a23[_0x3917('0x26')]||'','is_subproject':_0x576a23[_0x3917('0x26')]?!![]:![],'leaveAt':moment()['format'](_0x3917('0x27'))})});};exports['createSquareRecording']=function(_0x454b17){return request(_0x3917('0x28'),{'body':_0x454b17});};exports[_0x3917('0x29')]=function(_0x5d1da9){return request(_0x3917('0x2a'),{'body':_0x5d1da9});};exports[_0x3917('0x2b')]=function(_0x103729){return request(_0x3917('0x2c'),{'options':{'raw':![],'where':{'phone':_0x103729[_0x3917('0x2d')],'ListId':_0x103729['ListId']}}})['then'](function(_0x445b5b){if(_0x445b5b){return _0x445b5b;}return request(_0x3917('0x2e'),{'body':_0x103729});});};exports[_0x3917('0x2f')]=function(_0x29eb9b){return request(_0x3917('0x30'),{'options':{'where':{'id':_0x29eb9b},'attributes':[_0x3917('0x11')]}});};exports[_0x3917('0x31')]=function(_0x294f0e,_0x1b8f93){return request(_0x3917('0x32'),{'body':{'interface':_0x1b8f93},'options':{'where':_0x294f0e}});};exports['agentPause']=function(_0x345869,_0x59096c,_0x2461a5){return request('PauseUser',{'body':{'type':_0x59096c,'uniqueid':_0x2461a5},'options':{'where':_0x345869}});};exports[_0x3917('0x33')]=function(_0x41661a){return request('UnpauseUser',{'body':{},'options':{'where':_0x41661a}});};exports[_0x3917('0x34')]=function(_0x43fd03){return request(_0x3917('0x35'),{'body':{},'options':{'where':_0x43fd03}});}; \ 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 3017e35..8bf49d6 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 _0x008c=['./lex','exports','./polly'];(function(_0x36d18b,_0x498804){var _0x203424=function(_0xf94ce3){while(--_0xf94ce3){_0x36d18b['push'](_0x36d18b['shift']());}};_0x203424(++_0x498804);}(_0x008c,0x188));var _0xc008=function(_0xd36ecf,_0xbc090b){_0xd36ecf=_0xd36ecf-0x0;var _0x15847a=_0x008c[_0xd36ecf];return _0x15847a;};var polly=require(_0xc008('0x0'));var lex=require(_0xc008('0x1'));module[_0xc008('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x4fdb=['./polly','./lex','exports'];(function(_0x37dcb2,_0x4aed8d){var _0x3daf64=function(_0x18871f){while(--_0x18871f){_0x37dcb2['push'](_0x37dcb2['shift']());}};_0x3daf64(++_0x4aed8d);}(_0x4fdb,0x9c));var _0xb4fd=function(_0xded472,_0x4d8308){_0xded472=_0xded472-0x0;var _0x2c9f89=_0x4fdb[_0xded472];return _0x2c9f89;};var polly=require(_0xb4fd('0x0'));var lex=require(_0xb4fd('0x1'));module[_0xb4fd('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 71ef2da..11c429b 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 _0x9990=['exports'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0x9990,0xf6));var _0x0999=function(_0x1ffb10,_0x28ce2c){_0x1ffb10=_0x1ffb10-0x0;var _0x390ad0=_0x9990[_0x1ffb10];return _0x390ad0;};'use strict';var lex=require('./lib/api');module[_0x0999('0x0')]=function(_0x643d39,_0xbbb89f,_0x46a009,_0x33d7a5,_0x43f491,_0x1fd95b){return lex(_0x643d39,_0xbbb89f,_0x46a009,_0x33d7a5,_0x43f491,_0x1fd95b);}; \ No newline at end of file +var _0xcb99=['./lib/api'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xcb99,0x8b));var _0x9cb9=function(_0x32a554,_0x37ad7b){_0x32a554=_0x32a554-0x0;var _0x5ce71c=_0xcb99[_0x32a554];return _0x5ce71c;};'use strict';var lex=require(_0x9cb9('0x0'));module['exports']=function(_0x30a555,_0x52af95,_0x480364,_0x3a2f21,_0x1308a8,_0x124c48){return lex(_0x30a555,_0x52af95,_0x480364,_0x3a2f21,_0x1308a8,_0x124c48);}; \ 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 7c0fd4d..306c925 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 _0x8e0a=['aws-sdk','slots','hasOwnProperty','exports','LexRuntime','$LATEST'];(function(_0x27a948,_0x2eebae){var _0x45ac61=function(_0x8418f5){while(--_0x8418f5){_0x27a948['push'](_0x27a948['shift']());}};_0x45ac61(++_0x2eebae);}(_0x8e0a,0x168));var _0xa8e0=function(_0x1e9210,_0x201b5c){_0x1e9210=_0x1e9210-0x0;var _0x40c9cd=_0x8e0a[_0x1e9210];return _0x40c9cd;};'use strict';var BPromise=require('bluebird');var AWS=require(_0xa8e0('0x0'));function lexResult(_0xddb157,_0xc7ed2b){return new BPromise(function(_0x1dd49c,_0x36c945){_0xddb157['postText'](_0xc7ed2b,function(_0x43897c,_0x37e77e){if(_0x43897c){_0x36c945(_0x43897c);}if(_0x37e77e[_0xa8e0('0x1')]){for(const _0x4a60b7 in _0x37e77e[_0xa8e0('0x1')]){if(_0x37e77e['slots'][_0xa8e0('0x2')](_0x4a60b7)){var _0x37c5c8=_0x37e77e[_0xa8e0('0x1')][_0x4a60b7];_0x37e77e['slot_'+_0x4a60b7]=_0x37c5c8;}}}_0x1dd49c(_0x37e77e);});});}module[_0xa8e0('0x3')]=function(_0x2d19d4,_0x2bb50a,_0x4cc75c,_0x3fcdf4,_0xc0d0e8,_0xdcfa72){var _0x522877=new AWS[(_0xa8e0('0x4'))]({'accessKeyId':_0x2bb50a,'secretAccessKey':_0x4cc75c,'region':_0x3fcdf4});var _0x31bd2b={'botAlias':_0xa8e0('0x5'),'botName':_0xdcfa72,'inputText':_0xc0d0e8,'userId':_0x2d19d4};return lexResult(_0x522877,_0x31bd2b);}; \ No newline at end of file +var _0xfc59=['slots','hasOwnProperty','slot_','exports','$LATEST','bluebird','aws-sdk'];(function(_0x59e7b2,_0x74595a){var _0x57bfb4=function(_0x160b87){while(--_0x160b87){_0x59e7b2['push'](_0x59e7b2['shift']());}};_0x57bfb4(++_0x74595a);}(_0xfc59,0x16a));var _0x9fc5=function(_0x5ea002,_0x1c95de){_0x5ea002=_0x5ea002-0x0;var _0x38491b=_0xfc59[_0x5ea002];return _0x38491b;};'use strict';var BPromise=require(_0x9fc5('0x0'));var AWS=require(_0x9fc5('0x1'));function lexResult(_0x101002,_0x50eaad){return new BPromise(function(_0x189170,_0xfc2ec1){_0x101002['postText'](_0x50eaad,function(_0x307bcb,_0x184a59){if(_0x307bcb){_0xfc2ec1(_0x307bcb);}if(_0x184a59[_0x9fc5('0x2')]){for(const _0x31361b in _0x184a59[_0x9fc5('0x2')]){if(_0x184a59[_0x9fc5('0x2')][_0x9fc5('0x3')](_0x31361b)){var _0x2ab015=_0x184a59[_0x9fc5('0x2')][_0x31361b];_0x184a59[_0x9fc5('0x4')+_0x31361b]=_0x2ab015;}}}_0x189170(_0x184a59);});});}module[_0x9fc5('0x5')]=function(_0x17ef31,_0x308d38,_0x28f76a,_0x3d7a5b,_0xf7a8f5,_0x57bbf8){var _0x272ea1=new AWS['LexRuntime']({'accessKeyId':_0x308d38,'secretAccessKey':_0x28f76a,'region':_0x3d7a5b});var _0x364f02={'botAlias':_0x9fc5('0x6'),'botName':_0x57bbf8,'inputText':_0xf7a8f5,'userId':_0x17ef31};return lexResult(_0x272ea1,_0x364f02);}; \ 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 45da2dd..aec2ebb 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 _0x6e04=['exports','./lib/api'];(function(_0x42babc,_0x1287c0){var _0x3b240a=function(_0xd07e1f){while(--_0xd07e1f){_0x42babc['push'](_0x42babc['shift']());}};_0x3b240a(++_0x1287c0);}(_0x6e04,0x191));var _0x46e0=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0x6e04[_0x53f0db];return _0xae0a5c;};'use strict';var polly=require(_0x46e0('0x0'));module[_0x46e0('0x1')]=function(_0x4f986b,_0x7ef6a5,_0x5c0a92,_0x4914ef,_0x5f4818,_0x329ddb,_0x30e2da){return polly(_0x4f986b,_0x7ef6a5,_0x5c0a92,_0x4914ef,_0x5f4818,_0x329ddb,_0x30e2da);}; \ No newline at end of file +var _0x826e=['exports'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0x826e,0x171));var _0xe826=function(_0x417dd9,_0x34c874){_0x417dd9=_0x417dd9-0x0;var _0x7e7052=_0x826e[_0x417dd9];return _0x7e7052;};'use strict';var polly=require('./lib/api');module[_0xe826('0x0')]=function(_0x3beb25,_0x59d548,_0x22b30b,_0x41cd93,_0x1d76a0,_0x100b83,_0x56af10){return polly(_0x3beb25,_0x59d548,_0x22b30b,_0x41cd93,_0x1d76a0,_0x100b83,_0x56af10);}; \ 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 f8b8936..3134685 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 _0x559b=['AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring','aws-sdk'];(function(_0x44b5d9,_0xe28bb1){var _0x25d599=function(_0x33d5ed){while(--_0x33d5ed){_0x44b5d9['push'](_0x44b5d9['shift']());}};_0x25d599(++_0xe28bb1);}(_0x559b,0x10b));var _0xb559=function(_0x5c8ab0,_0x2cef5b){_0x5c8ab0=_0x5c8ab0-0x0;var _0x35bcd9=_0x559b[_0x5c8ab0];return _0x35bcd9;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xb559('0x0'));var rs=require(_0xb559('0x1'));var AWS=require(_0xb559('0x2'));function pollyResult(_0xacb82c,_0x5b9f67,_0xf4654d){return new BPromise(function(_0x4a923c,_0x47b6b7){_0xacb82c['synthesizeSpeech'](_0x5b9f67,function(_0x380cf3,_0x3fa750){if(_0x380cf3){_0x47b6b7(_0x380cf3);}else if(_0x3fa750){if(_0x3fa750[_0xb559('0x3')]instanceof Buffer){fs['writeFile'](_0xf4654d,_0x3fa750['AudioStream'],function(_0x526b0b){if(_0x526b0b){_0x47b6b7(_0x526b0b);}else{_0x4a923c();}});}else{_0x47b6b7(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x47b6b7(new Error(_0xb559('0x4')));}});});}module[_0xb559('0x5')]=function(_0x26ec95,_0x5759c0,_0x5d2884,_0x2e3896,_0x1eeee0,_0x39c482,_0xa2016d){var _0x379018=new AWS[(_0xb559('0x6'))]({'accessKeyId':_0x26ec95,'secretAccessKey':_0x5759c0,'region':_0x5d2884});var _0x517b2b={'Text':_0x1eeee0,'TextType':_0x39c482||_0xb559('0x7'),'OutputFormat':_0xb559('0x8'),'VoiceId':_0x2e3896};return pollyResult(_0x379018,_0x517b2b,_0xa2016d);}; \ No newline at end of file +var _0xa061=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','synthesizeSpeech'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xa061,0x1eb));var _0x1a06=function(_0x47ba2f,_0x3ea976){_0x47ba2f=_0x47ba2f-0x0;var _0xc5c358=_0xa061[_0x47ba2f];return _0xc5c358;};'use strict';var fs=require('fs');var path=require(_0x1a06('0x0'));var BPromise=require(_0x1a06('0x1'));var rs=require(_0x1a06('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x450440,_0x4c2866,_0x11dac2){return new BPromise(function(_0x4b159d,_0x7168df){_0x450440[_0x1a06('0x3')](_0x4c2866,function(_0x412784,_0x1bc295){if(_0x412784){_0x7168df(_0x412784);}else if(_0x1bc295){if(_0x1bc295['AudioStream']instanceof Buffer){fs[_0x1a06('0x4')](_0x11dac2,_0x1bc295['AudioStream'],function(_0x1b8d07){if(_0x1b8d07){_0x7168df(_0x1b8d07);}else{_0x4b159d();}});}else{_0x7168df(new Error(_0x1a06('0x5')));}}else{_0x7168df(new Error(_0x1a06('0x6')));}});});}module[_0x1a06('0x7')]=function(_0x16016f,_0x2f08f8,_0x269d33,_0x7c06f5,_0x1648bb,_0x2a9a0d,_0x21e774){var _0x48b197=new AWS[(_0x1a06('0x8'))]({'accessKeyId':_0x16016f,'secretAccessKey':_0x2f08f8,'region':_0x269d33});var _0x239aaf={'Text':_0x1648bb,'TextType':_0x2a9a0d||_0x1a06('0x9'),'OutputFormat':_0x1a06('0xa'),'VoiceId':_0x7c06f5};return pollyResult(_0x48b197,_0x239aaf,_0x21e774);}; \ 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 5fd4ca7..1e2ce58 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 _0x040c=['exports','./lib/api'];(function(_0x2543c8,_0x4af6fe){var _0x55d9fd=function(_0xaa16b5){while(--_0xaa16b5){_0x2543c8['push'](_0x2543c8['shift']());}};_0x55d9fd(++_0x4af6fe);}(_0x040c,0xe5));var _0xc040=function(_0x5aac2e,_0x2b5f88){_0x5aac2e=_0x5aac2e-0x0;var _0x2b9f2c=_0x040c[_0x5aac2e];return _0x2b9f2c;};'use strict';var asr=require(_0xc040('0x0'));module[_0xc040('0x1')]=function(_0x13cb7a,_0x3ab69d,_0x124a93,_0x5ddf50){return asr(_0x13cb7a,_0x3ab69d,_0x124a93);}; \ No newline at end of file +var _0x095f=['exports','./lib/api'];(function(_0x14e045,_0x1d9eb){var _0x18243b=function(_0x3e757a){while(--_0x3e757a){_0x14e045['push'](_0x14e045['shift']());}};_0x18243b(++_0x1d9eb);}(_0x095f,0x185));var _0xf095=function(_0x54bbac,_0x5e1990){_0x54bbac=_0x54bbac-0x0;var _0x46d8b0=_0x095f[_0x54bbac];return _0x46d8b0;};'use strict';var asr=require(_0xf095('0x0'));module[_0xf095('0x1')]=function(_0xc40914,_0x286d8c,_0x4a5b96,_0x31b681){return asr(_0xc40914,_0x286d8c,_0x4a5b96);}; \ 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 25cd7b9..da48066 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 _0x9d9f=['https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','LINEAR16','url'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9d9f,0x11d));var _0xf9d9=function(_0x481960,_0x1f281c){_0x481960=_0x481960-0x0;var _0x1ecdb6=_0x9d9f[_0x481960];return _0x1ecdb6;};'use strict';var url=require(_0xf9d9('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xf9d9('0x1');module[_0xf9d9('0x2')]=function(_0x1410d4,_0x22a1c3,_0x2a0ee2){return new BPromise(function(_0xbc01fc,_0x972a77){var _0xe8d7;if(typeof _0x1410d4!=='string'||_0x1410d4[_0xf9d9('0x3')]===0x0){return _0x972a77(_0xf9d9('0x4'));}if(typeof _0x22a1c3!=='string'||_0x22a1c3[_0xf9d9('0x3')]===0x0){return _0x972a77('key\x20should\x20be\x20a\x20string');}if(typeof _0x2a0ee2!=='undefined'&&(typeof _0x2a0ee2!==_0xf9d9('0x5')||_0x2a0ee2['length']===0x0)){return _0x972a77(_0xf9d9('0x6'));}try{_0xe8d7=fs[_0xf9d9('0x7')](_0x1410d4)[_0xf9d9('0x8')](_0xf9d9('0x9'));}catch(_0x5254ba){return _0x972a77(_0x5254ba);}return _0xbc01fc({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x22a1c3,'body':{'config':{'encoding':_0xf9d9('0xa'),'sampleRateHertz':'8000','languageCode':_0x2a0ee2},'audio':{'content':_0xe8d7}},'json':!![]});});}; \ No newline at end of file +var _0xa507=['readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','filepath\x20should\x20be\x20a\x20string','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string'];(function(_0x463c49,_0x98ef16){var _0x34123a=function(_0x9ec05a){while(--_0x9ec05a){_0x463c49['push'](_0x463c49['shift']());}};_0x34123a(++_0x98ef16);}(_0xa507,0x141));var _0x7a50=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0xa507[_0x1678c8];return _0x387aa9;};'use strict';var url=require(_0x7a50('0x0'));var BPromise=require(_0x7a50('0x1'));var fs=require('fs');var host=_0x7a50('0x2');module[_0x7a50('0x3')]=function(_0x479dad,_0x404bfa,_0x4b83ac){return new BPromise(function(_0x1b419b,_0x4006e7){var _0x284d16;if(typeof _0x479dad!=='string'||_0x479dad['length']===0x0){return _0x4006e7(_0x7a50('0x4'));}if(typeof _0x404bfa!==_0x7a50('0x5')||_0x404bfa[_0x7a50('0x6')]===0x0){return _0x4006e7(_0x7a50('0x7'));}if(typeof _0x4b83ac!=='undefined'&&(typeof _0x4b83ac!==_0x7a50('0x5')||_0x4b83ac[_0x7a50('0x6')]===0x0)){return _0x4006e7(_0x7a50('0x8'));}try{_0x284d16=fs[_0x7a50('0x9')](_0x479dad)[_0x7a50('0xa')](_0x7a50('0xb'));}catch(_0x802cdf){return _0x4006e7(_0x802cdf);}return _0x1b419b({'method':_0x7a50('0xc'),'uri':host+_0x7a50('0xd')+_0x404bfa,'body':{'config':{'encoding':_0x7a50('0xe'),'sampleRateHertz':'8000','languageCode':_0x4b83ac},'audio':{'content':_0x284d16}},'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 1ac0dd3..1d49b2c 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 _0xbd11=['exports','./asr'];(function(_0x2cff4f,_0x21e344){var _0x3df848=function(_0x49474b){while(--_0x49474b){_0x2cff4f['push'](_0x2cff4f['shift']());}};_0x3df848(++_0x21e344);}(_0xbd11,0xc5));var _0x1bd1=function(_0x4f345d,_0x22f2ea){_0x4f345d=_0x4f345d-0x0;var _0x4e75d5=_0xbd11[_0x4f345d];return _0x4e75d5;};var asr=require(_0x1bd1('0x0'));module[_0x1bd1('0x1')]={'asr':asr}; \ No newline at end of file +var _0xe94c=['./asr'];(function(_0x2245eb,_0x3c4807){var _0x3e5654=function(_0x643759){while(--_0x643759){_0x2245eb['push'](_0x2245eb['shift']());}};_0x3e5654(++_0x3c4807);}(_0xe94c,0x153));var _0xce94=function(_0x5b1cf7,_0x245a9c){_0x5b1cf7=_0x5b1cf7-0x0;var _0x391c73=_0xe94c[_0x5b1cf7];return _0x391c73;};var asr=require(_0xce94('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 09b75e0..07b208e 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 _0x4a5c=['chmodSync','googleCloudTTS\x20path','split','googleTTS','utf8','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','action','actionIncomplete','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','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','freeform=3','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','request-promise','google-tts-api','url','util','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','finish','info','close','unlink','download\x20error','pipe','end','https:','host','data','transcode','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','readFileSync','googleCloudTTS','ssml','input','audioConfig','MP3','POST','.mp3','from','audioContent','writeFile','777'];(function(_0x10edeb,_0x1b93b8){var _0x1c5fea=function(_0x16a1c5){while(--_0x16a1c5){_0x10edeb['push'](_0x10edeb['shift']());}};_0x1c5fea(++_0x1b93b8);}(_0x4a5c,0x1d7));var _0xc4a5=function(_0x1b892b,_0x4efe48){_0x1b892b=_0x1b892b-0x0;var _0xa99e57=_0x4a5c[_0x1b892b];return _0xa99e57;};'use strict';var apiai=require(_0xc4a5('0x0'));var BPromise=require(_0xc4a5('0x1'));var dialogflow=require(_0xc4a5('0x2'));var fs=require('fs');var http=require(_0xc4a5('0x3'));var https=require(_0xc4a5('0x4'));var md5=require(_0xc4a5('0x5'));var path=require(_0xc4a5('0x6'));var querystring=require('querystring');var rp=require(_0xc4a5('0x7'));var rs=require('randomstring');var sox=require('sox');var tts=require(_0xc4a5('0x8'));var urlParse=require(_0xc4a5('0x9'))['parse'];var util=require(_0xc4a5('0xa'));var aws=require(_0xc4a5('0xb'));var google=require('./google');var sestek=require(_0xc4a5('0xc'));var tilde=require(_0xc4a5('0xd'));var logger=require(_0xc4a5('0xe'))(_0xc4a5('0xf'));var ISPEECH_API=_0xc4a5('0x10');function downloadFile(_0x392d5d,_0x38991a){return new BPromise(function(_0x154244,_0x5367ab){var _0x4c04b4=urlParse(_0x392d5d);var _0x1a2ca0=_0x4c04b4[_0xc4a5('0x11')]==='https:'?https:http;var _0x5337d9={'host':_0x4c04b4['host'],'path':_0x4c04b4[_0xc4a5('0x6')],'headers':{'user-agent':_0xc4a5('0x12')}};_0x1a2ca0[_0xc4a5('0x13')](_0x5337d9,function(_0x5d5c73){if(_0x5d5c73[_0xc4a5('0x14')]!==0xc8){logger[_0xc4a5('0x15')]('request\x20to\x20'+_0x392d5d+_0xc4a5('0x16')+_0x5d5c73['statusCode']+'\x20('+_0x5d5c73[_0xc4a5('0x17')]+')');_0x5367ab(new Error(_0xc4a5('0x18')+_0x392d5d+'\x20failed,\x20status\x20code\x20=\x20'+_0x5d5c73[_0xc4a5('0x14')]+'\x20('+_0x5d5c73[_0xc4a5('0x17')]+')'));return;}var _0x107941=fs['createWriteStream'](_0x38991a);_0x107941['on'](_0xc4a5('0x19'),function(){logger[_0xc4a5('0x1a')]('finish\x20download\x20file');_0x107941[_0xc4a5('0x1b')](_0x154244);});_0x107941['on']('error',function(_0x21dfaa){fs[_0xc4a5('0x1c')](_0x38991a);logger['error'](_0xc4a5('0x1d'),_0x21dfaa);_0x5367ab(_0x21dfaa);});_0x5d5c73[_0xc4a5('0x1e')](_0x107941);})['on'](_0xc4a5('0x15'),function(_0x5413b9){logger[_0xc4a5('0x15')](_0x5413b9);_0x5367ab(_0x5413b9);})[_0xc4a5('0x1f')]();});}function uploadFile(_0x46ec88){return new BPromise(function(_0x3af218,_0x40b586){var _0x397deb=urlParse(_0x46ec88);var _0x541a17=_0x397deb[_0xc4a5('0x11')]===_0xc4a5('0x20')?https:http;var _0x28a90d={'host':_0x397deb[_0xc4a5('0x21')],'path':_0x397deb[_0xc4a5('0x6')],'headers':{'user-agent':_0xc4a5('0x12')}};_0x541a17['get'](_0x28a90d,function(_0x36814b){if(_0x36814b[_0xc4a5('0x14')]!==0xc8){_0x40b586(new Error(_0xc4a5('0x18')+_0x46ec88+_0xc4a5('0x16')+_0x36814b[_0xc4a5('0x14')]+'\x20('+_0x36814b[_0xc4a5('0x17')]+')'));return;}var _0x2d9788='';_0x36814b['on'](_0xc4a5('0x22'),function(_0x398581){_0x2d9788+=_0x398581;});_0x36814b['on'](_0xc4a5('0x1f'),function(){_0x3af218(_0x2d9788);});})['on'](_0xc4a5('0x15'),function(_0xbf58d7){_0x40b586(_0xbf58d7);})['end']();});}function convertFile(_0x3d9167,_0x21bc54){return new BPromise(function(_0x96a19c,_0x296896){var _0x38fdd7=sox[_0xc4a5('0x23')](_0x3d9167,_0x21bc54,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x38fdd7['on']('error',function(_0x1d37f2){logger['error']('error\x20convert',_0x1d37f2);_0x296896(_0x1d37f2);});_0x38fdd7['on'](_0xc4a5('0x1f'),function(){logger[_0xc4a5('0x1a')](_0xc4a5('0x24'));_0x96a19c();});_0x38fdd7[_0xc4a5('0x25')]();});}function base64Decode(_0xa96952,_0xb1ba32){var _0x4fd6bb=path[_0xc4a5('0x26')](__dirname,_0xc4a5('0x27'),rs[_0xc4a5('0x28')](0x4)+_0xc4a5('0x29'));fs[_0xc4a5('0x2a')](_0x4fd6bb,_0xa96952,_0xc4a5('0x2b'));return convertFile(_0x4fd6bb,_0xb1ba32)[_0xc4a5('0x2c')](function(){try{fs['unlink'](_0x4fd6bb);fs['chmodSync'](_0xb1ba32,'777');}catch(_0x2b1705){logger[_0xc4a5('0x15')](_0x2b1705);}return _0xb1ba32['split']('.')[0x0];});}function base64Encode(_0x74a160){var _0x1785d1=fs[_0xc4a5('0x2d')](_0x74a160);return new Buffer(_0x1785d1)['toString'](_0xc4a5('0x2b'));}exports[_0xc4a5('0x2e')]=function(_0x257a41,_0x4d4d3a,_0x5dd8a4,_0x2fdfd4,_0x1296a6,_0x193b8e){var _0x4a1cbb,_0x220658;var _0x4e7c1a='https://texttospeech.googleapis.com/v1/';var _0x5585c5='?key='+_0x257a41;var _0x3b767e={};if(_0x4d4d3a===_0xc4a5('0x2f')){_0x3b767e[_0xc4a5('0x30')]={'ssml':_0x5dd8a4};}else{_0x3b767e['input']={'text':_0x5dd8a4};};_0x3b767e['voice']={'languageCode':_0x2fdfd4,'ssmlGender':_0x1296a6};_0x3b767e[_0xc4a5('0x31')]={'audioEncoding':_0xc4a5('0x32'),'sampleRateHertz':0x1f40};var _0x1c020e={'url':_0x4e7c1a+'text:synthesize'+_0x5585c5,'method':_0xc4a5('0x33'),'json':!![],'body':_0x3b767e};return rp(_0x1c020e)[_0xc4a5('0x2c')](function(_0x2fa462){return new BPromise(function(_0x36eb35,_0x3fced6){_0x4a1cbb=path[_0xc4a5('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0xc4a5('0x34'));var _0x4a847f=Buffer[_0xc4a5('0x35')](_0x2fa462[_0xc4a5('0x36')],_0xc4a5('0x2b'));return fs[_0xc4a5('0x37')](_0x4a1cbb,_0x4a847f,function(_0x15cb3a){_0x3fced6(_0x15cb3a);},function(_0x2b08ea){fs['chmodSync'](_0x4a1cbb,_0xc4a5('0x38'));_0x36eb35(_0x2b08ea);});});})['then'](function(_0x4b2abe){_0x220658=path[_0xc4a5('0x26')](__dirname,_0xc4a5('0x27'),rs[_0xc4a5('0x28')](0x4)+_0xc4a5('0x29'));return convertFile(_0x4a1cbb,_0x220658);})[_0xc4a5('0x2c')](function(){try{fs[_0xc4a5('0x1c')](_0x4a1cbb);fs[_0xc4a5('0x39')](_0x220658,_0xc4a5('0x38'));}catch(_0xd29177){logger[_0xc4a5('0x15')](_0xd29177);}logger[_0xc4a5('0x1a')](_0xc4a5('0x3a'),_0x220658[_0xc4a5('0x3b')]('.')[0x0]);return _0x220658[_0xc4a5('0x3b')]('.')[0x0];});};exports[_0xc4a5('0x3c')]=function(_0x45492,_0x17d523){var _0x34f097='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x4dca0b,_0x1a766e;var _0xaee78a;var _0x4ecc4f={'encoding':_0xc4a5('0x3d'),'method':_0xc4a5('0x33'),'timeout':0x2710,'url':_0x34f097,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0xc4a5('0x3e'),JSON[_0xc4a5('0x3f')]([_0x45492,_0x17d523||'en',![],_0xc4a5('0x40')]),null,_0xc4a5('0x41')]]]))};return rp(_0x4ecc4f)['then'](function(_0x1247fb){try{_0xaee78a=eval(_0x1247fb[_0xc4a5('0x42')](0x5))[0x0][0x2];}catch(_0x33369d){throw new Error(_0xc4a5('0x43')+_0x1247fb[_0xc4a5('0x22')]);}if(!_0xaee78a){if(_0x45492[_0xc4a5('0x44')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x17d523+_0xc4a5('0x45'));}}try{_0xaee78a=eval(_0xaee78a)[0x0];}catch(_0x645cd0){throw new Error(_0xc4a5('0x43')+res[_0xc4a5('0x22')]);}const _0x204746=_0xaee78a;_0x4dca0b=path[_0xc4a5('0x26')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');fs[_0xc4a5('0x2a')](_0x4dca0b,_0xaee78a,{'encoding':_0xc4a5('0x2b')});_0x1a766e=path['resolve'](__dirname,'tmp',rs[_0xc4a5('0x28')](0x4)+_0xc4a5('0x29'));return convertFile(_0x4dca0b,_0x1a766e);})[_0xc4a5('0x2c')](function(){try{fs[_0xc4a5('0x1c')](_0x4dca0b);fs[_0xc4a5('0x39')](_0x1a766e,_0xc4a5('0x38'));}catch(_0x118c4e){logger[_0xc4a5('0x15')](_0x118c4e);}logger['info'](_0xc4a5('0x46'),_0x1a766e[_0xc4a5('0x3b')]('.')[0x0]);return _0x1a766e[_0xc4a5('0x3b')]('.')[0x0];});};exports[_0xc4a5('0x47')]=function(_0x769a02,_0x36a6e0,_0x24d7ff){return google[_0xc4a5('0x48')](_0x769a02,_0x36a6e0,_0x24d7ff)[_0xc4a5('0x2c')](function(_0x2420c0){logger[_0xc4a5('0x1a')](_0x2420c0['uri']);return rp(_0x2420c0);})[_0xc4a5('0x2c')](function(_0xc76761){var _0x20f74a='';var _0x1f5431=0x0;try{fs[_0xc4a5('0x1c')](_0x769a02);}catch(_0x26802c){logger[_0xc4a5('0x15')](_0x26802c);}if(_0xc76761&&_0xc76761['results']){_0x20f74a=_0xc76761[_0xc4a5('0x49')][_0xc4a5('0x4a')](function(_0x38642d){return _0x38642d&&_0x38642d[_0xc4a5('0x4b')][0x0]&&_0x38642d[_0xc4a5('0x4b')][0x0][_0xc4a5('0x4c')]?_0x38642d[_0xc4a5('0x4b')][0x0][_0xc4a5('0x4c')]:'';})['join']('\x0a');_0x1f5431=_0xc76761[_0xc4a5('0x49')][_0xc4a5('0x4a')](function(_0x464ab3){return _0x464ab3&&_0x464ab3[_0xc4a5('0x4b')][0x0]&&_0x464ab3[_0xc4a5('0x4b')][0x0][_0xc4a5('0x4d')]?_0x464ab3[_0xc4a5('0x4b')][0x0][_0xc4a5('0x4d')]:0x0;})[_0xc4a5('0x4e')]('\x0a');}logger[_0xc4a5('0x1a')](_0xc4a5('0x4f'),_0x20f74a);logger[_0xc4a5('0x1a')](_0xc4a5('0x50'),_0x1f5431);return{'transcript':_0x20f74a,'confidence':_0x1f5431};})[_0xc4a5('0x51')](function(_0x24baf8){logger[_0xc4a5('0x15')](_0xc4a5('0x52'),_0x24baf8[_0xc4a5('0x14')],_0x24baf8[_0xc4a5('0x53')],_0x24baf8['message']);});};exports[_0xc4a5('0x54')]=function(_0xce0bb1,_0x516ac1,_0x47e5fb,_0x5c39ed){var _0x4d32f2=apiai(_0x516ac1,{'language':_0x5c39ed||'en'});return _0x4d32f2[_0xc4a5('0x55')](_0x47e5fb,{'sessionId':md5(_0xce0bb1)})[_0xc4a5('0x2c')](function(_0x31fcac){logger[_0xc4a5('0x1a')](JSON[_0xc4a5('0x3f')](_0x31fcac));return{'source':_0x31fcac[_0xc4a5('0x56')]['source'],'resolvedQuery':_0x31fcac['result']['resolvedQuery'],'action':_0x31fcac[_0xc4a5('0x56')][_0xc4a5('0x57')],'actionIncomplete':_0x31fcac[_0xc4a5('0x56')][_0xc4a5('0x58')],'speech':_0x31fcac[_0xc4a5('0x56')]['fulfillment'][_0xc4a5('0x59')],'score':_0x31fcac[_0xc4a5('0x56')][_0xc4a5('0x5a')],'statusCode':_0x31fcac[_0xc4a5('0x5b')][_0xc4a5('0x5c')],'endConversation':_0x31fcac[_0xc4a5('0x56')][_0xc4a5('0x5d')][_0xc4a5('0x5e')]||![],'isFallbackIntent':_0x31fcac[_0xc4a5('0x56')][_0xc4a5('0x5d')][_0xc4a5('0x5f')]};});};exports[_0xc4a5('0x60')]=function(_0x5bc3a8,_0x4492df,_0x359571,_0x566fd3,_0x159bf3,_0x2afaff){var _0xb32aa=_0x566fd3[_0xc4a5('0x61')](/\\n/g,'\x0a');var _0x385367={'credentials':{'private_key':_0xb32aa,'client_email':_0x359571}};var _0x39c35d=new dialogflow[(_0xc4a5('0x62'))](_0x385367);var _0x1eba88=_0x39c35d[_0xc4a5('0x63')](_0x4492df,md5(_0x5bc3a8));var _0xcbc07e={'session':_0x1eba88,'queryInput':{'text':{'text':_0x159bf3,'languageCode':_0x2afaff}}};return _0x39c35d['detectIntent'](_0xcbc07e)[_0xc4a5('0x2c')](function(_0x291702){if(_0x291702&&_0x291702[_0xc4a5('0x44')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0xc4a5('0x3f')](_0x291702));var _0x395838=_0x291702[0x0];if(_0x395838){var _0x5e0523={'action':_0x395838[_0xc4a5('0x64')][_0xc4a5('0x57')],'allRequiredParamsPresent':_0x395838[_0xc4a5('0x64')][_0xc4a5('0x65')],'endConversation':_0x395838[_0xc4a5('0x64')][_0xc4a5('0x66')]&&_0x395838['queryResult'][_0xc4a5('0x66')][_0xc4a5('0x67')]?_0x395838[_0xc4a5('0x64')][_0xc4a5('0x66')][_0xc4a5('0x67')][_0xc4a5('0x68')]['boolValue']:![],'fulfillmentText':_0x395838['queryResult'][_0xc4a5('0x69')],'intentName':_0x395838['queryResult']['intent'][_0xc4a5('0x53')],'intentDisplayName':_0x395838[_0xc4a5('0x64')][_0xc4a5('0x6a')]['displayName'],'isFallbackIntent':_0x395838[_0xc4a5('0x64')][_0xc4a5('0x6a')][_0xc4a5('0x6b')],'languageCode':_0x395838['queryResult'][_0xc4a5('0x6c')],'queryText':_0x395838[_0xc4a5('0x64')][_0xc4a5('0x6d')],'responseId':_0x395838[_0xc4a5('0x6e')],'score':_0x395838[_0xc4a5('0x64')][_0xc4a5('0x6f')],'speech':_0x395838['queryResult'][_0xc4a5('0x69')],'providerResponse':JSON[_0xc4a5('0x3f')](_0x291702)};return _0x5e0523;}}});};exports[_0xc4a5('0x70')]=function(_0x406005,_0x3f03c2,_0x5e62f6,_0x36339c){return tilde[_0xc4a5('0x48')](_0x406005,_0x3f03c2,_0x5e62f6,_0x36339c)[_0xc4a5('0x2c')](function(_0x48ef3a){try{fs[_0xc4a5('0x1c')](_0x406005);}catch(_0x25d512){logger[_0xc4a5('0x15')](_0x25d512);}logger[_0xc4a5('0x1a')](_0xc4a5('0x71'),_0x48ef3a[_0xc4a5('0x4c')]);logger[_0xc4a5('0x1a')](_0xc4a5('0x72'),_0x48ef3a[_0xc4a5('0x4d')]);return _0x48ef3a;});};exports[_0xc4a5('0x73')]=function(_0x3f9b65,_0x33b3d6,_0xe9b2de,_0x1f3547,_0xa96088,_0xc1e2ab){var _0x4dadd4=path['resolve'](__dirname,'tmp',rs[_0xc4a5('0x28')](0x4)+_0xc4a5('0x34'));var _0x37b733;return aws[_0xc4a5('0x74')](_0x3f9b65,_0x33b3d6,_0xe9b2de,_0x1f3547,_0xa96088,_0xc1e2ab,_0x4dadd4)[_0xc4a5('0x2c')](function(){_0x37b733=path[_0xc4a5('0x26')](__dirname,_0xc4a5('0x27'),rs[_0xc4a5('0x28')](0x4)+_0xc4a5('0x29'));return convertFile(_0x4dadd4,_0x37b733);})['then'](function(){try{fs[_0xc4a5('0x1c')](_0x4dadd4);fs[_0xc4a5('0x39')](_0x37b733,_0xc4a5('0x38'));}catch(_0x1997fb){logger[_0xc4a5('0x15')](_0x1997fb);}return _0x37b733[_0xc4a5('0x3b')]('.')[0x0];});};exports[_0xc4a5('0x75')]=function(_0xc56590,_0x4d8a5c,_0x5eca13,_0x5e39b8,_0x5ef91f,_0x1f9b83){return aws[_0xc4a5('0x76')](_0xc56590,_0x4d8a5c,_0x5eca13,_0x5e39b8,_0x5ef91f,_0x1f9b83)['then'](function(_0x4eaec0){logger[_0xc4a5('0x1a')](JSON[_0xc4a5('0x3f')](_0x4eaec0));return _0x4eaec0;});};exports['ispeechTTS']=function(_0x109be5,_0x9b9e02,_0x586189,_0x5191f4){var _0x222c09=util[_0xc4a5('0x77')](_0xc4a5('0x78'),ISPEECH_API,_0x109be5,encodeURIComponent(_0x9b9e02),_0x586189,_0x5191f4);var _0x3965ec=path[_0xc4a5('0x26')](__dirname,_0xc4a5('0x27'),rs[_0xc4a5('0x28')](0x4)+_0xc4a5('0x34'));var _0x357969;return downloadFile(_0x222c09,_0x3965ec)[_0xc4a5('0x2c')](function(){_0x357969=path[_0xc4a5('0x26')](__dirname,_0xc4a5('0x27'),rs[_0xc4a5('0x28')](0x4)+'.wav');return convertFile(_0x3965ec,_0x357969);})[_0xc4a5('0x2c')](function(){try{fs['unlink'](_0x3965ec);fs[_0xc4a5('0x39')](_0x357969,_0xc4a5('0x38'));}catch(_0x128e06){logger[_0xc4a5('0x15')](_0x128e06);}return _0x357969[_0xc4a5('0x3b')]('.')[0x0];});};exports[_0xc4a5('0x79')]=function(_0x49726c,_0xd0ac6,_0x44e4b1,_0x849bcb){var _0x51a832=util[_0xc4a5('0x77')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0xd0ac6,_0x44e4b1,base64Encode(_0x49726c),_0x849bcb?util[_0xc4a5('0x77')]('model=%s',encodeURIComponent(_0x849bcb)):_0xc4a5('0x7a'));return uploadFile(_0x51a832)[_0xc4a5('0x2c')](function(_0x2dfdc0){return querystring['parse'](_0x2dfdc0);});};exports['sestekNDA']=function(_0x385ee4,_0x27ee3d){return sestek[_0xc4a5('0x7b')](_0x385ee4,_0x27ee3d)['then'](function(_0x5f079b){logger['info'](JSON['stringify'](_0x5f079b));var _0x42bed7={'speech':_0x5f079b[_0xc4a5('0x7c')],'action':_0x5f079b[_0xc4a5('0x7d')]?_0x5f079b[_0xc4a5('0x7d')][_0xc4a5('0x7e')]:undefined,'actiondata':_0x5f079b[_0xc4a5('0x7d')]?_0x5f079b[_0xc4a5('0x7d')][_0xc4a5('0x7f')]:undefined};if(_0x5f079b['channelData']&&_0x5f079b[_0xc4a5('0x7d')][_0xc4a5('0x80')]){return base64Decode(_0x5f079b['channelData'][_0xc4a5('0x80')][_0xc4a5('0x81')],path[_0xc4a5('0x26')](__dirname,_0xc4a5('0x27'),rs[_0xc4a5('0x28')](0x4)+_0xc4a5('0x29')))[_0xc4a5('0x2c')](function(_0x1812c5){_0x42bed7[_0xc4a5('0x82')]=_0x1812c5;return _0x42bed7;});}return _0x42bed7;});};exports[_0xc4a5('0x83')]=function(){return __dirname;}; \ No newline at end of file +var _0xf535=['status','code','metadata','endConversation','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','displayName','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','lex','ispeechTTS','format','ispeechASR','model=%s','parse','sestekNDA','nda','text','CustomAction','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','util','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','https:','WHAT_EVER','get','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','chmodSync','777','split','toString','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','audioContent','writeFile','then','resolve','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','googleDialogflow','result','source','action','actionIncomplete','fulfillment','score'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf535,0x1c0));var _0x5f53=function(_0x36a04d,_0x42e2d4){_0x36a04d=_0x36a04d-0x0;var _0x743c52=_0xf535[_0x36a04d];return _0x743c52;};'use strict';var apiai=require(_0x5f53('0x0'));var BPromise=require(_0x5f53('0x1'));var dialogflow=require(_0x5f53('0x2'));var fs=require('fs');var http=require(_0x5f53('0x3'));var https=require(_0x5f53('0x4'));var md5=require(_0x5f53('0x5'));var path=require(_0x5f53('0x6'));var querystring=require(_0x5f53('0x7'));var rp=require(_0x5f53('0x8'));var rs=require(_0x5f53('0x9'));var sox=require(_0x5f53('0xa'));var tts=require(_0x5f53('0xb'));var urlParse=require('url')['parse'];var util=require(_0x5f53('0xc'));var aws=require(_0x5f53('0xd'));var google=require('./google');var sestek=require(_0x5f53('0xe'));var tilde=require(_0x5f53('0xf'));var logger=require(_0x5f53('0x10'))(_0x5f53('0x11'));var ISPEECH_API=_0x5f53('0x12');function downloadFile(_0xb7f7c8,_0x3ac7f7){return new BPromise(function(_0x5d2248,_0x3182f3){var _0x329d8c=urlParse(_0xb7f7c8);var _0x179e4a=_0x329d8c[_0x5f53('0x13')]==='https:'?https:http;var _0x1510d5={'host':_0x329d8c[_0x5f53('0x14')],'path':_0x329d8c[_0x5f53('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x179e4a['get'](_0x1510d5,function(_0x417fb4){if(_0x417fb4[_0x5f53('0x15')]!==0xc8){logger['error'](_0x5f53('0x16')+_0xb7f7c8+_0x5f53('0x17')+_0x417fb4[_0x5f53('0x15')]+'\x20('+_0x417fb4[_0x5f53('0x18')]+')');_0x3182f3(new Error('request\x20to\x20'+_0xb7f7c8+'\x20failed,\x20status\x20code\x20=\x20'+_0x417fb4[_0x5f53('0x15')]+'\x20('+_0x417fb4['statusMessage']+')'));return;}var _0x44446c=fs[_0x5f53('0x19')](_0x3ac7f7);_0x44446c['on'](_0x5f53('0x1a'),function(){logger[_0x5f53('0x1b')](_0x5f53('0x1c'));_0x44446c[_0x5f53('0x1d')](_0x5d2248);});_0x44446c['on'](_0x5f53('0x1e'),function(_0x5bae57){fs[_0x5f53('0x1f')](_0x3ac7f7);logger[_0x5f53('0x1e')](_0x5f53('0x20'),_0x5bae57);_0x3182f3(_0x5bae57);});_0x417fb4['pipe'](_0x44446c);})['on'](_0x5f53('0x1e'),function(_0x236959){logger[_0x5f53('0x1e')](_0x236959);_0x3182f3(_0x236959);})['end']();});}function uploadFile(_0x5654de){return new BPromise(function(_0xc3e7f8,_0x5e2d8e){var _0x5ba1e7=urlParse(_0x5654de);var _0x4cefa8=_0x5ba1e7[_0x5f53('0x13')]===_0x5f53('0x21')?https:http;var _0xae4bc6={'host':_0x5ba1e7[_0x5f53('0x14')],'path':_0x5ba1e7[_0x5f53('0x6')],'headers':{'user-agent':_0x5f53('0x22')}};_0x4cefa8[_0x5f53('0x23')](_0xae4bc6,function(_0x27fec0){if(_0x27fec0[_0x5f53('0x15')]!==0xc8){_0x5e2d8e(new Error(_0x5f53('0x16')+_0x5654de+_0x5f53('0x17')+_0x27fec0[_0x5f53('0x15')]+'\x20('+_0x27fec0['statusMessage']+')'));return;}var _0x42cc2f='';_0x27fec0['on'](_0x5f53('0x24'),function(_0x2caa90){_0x42cc2f+=_0x2caa90;});_0x27fec0['on'](_0x5f53('0x25'),function(){_0xc3e7f8(_0x42cc2f);});})['on'](_0x5f53('0x1e'),function(_0x376ba4){_0x5e2d8e(_0x376ba4);})[_0x5f53('0x25')]();});}function convertFile(_0x36d2bd,_0x4c86cf){return new BPromise(function(_0x28775a,_0x418de5){var _0x12d423=sox[_0x5f53('0x26')](_0x36d2bd,_0x4c86cf,{'sampleRate':0x1f40,'format':_0x5f53('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x12d423['on'](_0x5f53('0x1e'),function(_0x4297f9){logger[_0x5f53('0x1e')](_0x5f53('0x28'),_0x4297f9);_0x418de5(_0x4297f9);});_0x12d423['on'](_0x5f53('0x25'),function(){logger[_0x5f53('0x1b')](_0x5f53('0x29'));_0x28775a();});_0x12d423[_0x5f53('0x2a')]();});}function base64Decode(_0x56fabc,_0x4af26f){var _0x39c31c=path['resolve'](__dirname,_0x5f53('0x2b'),rs[_0x5f53('0x2c')](0x4)+_0x5f53('0x2d'));fs[_0x5f53('0x2e')](_0x39c31c,_0x56fabc,_0x5f53('0x2f'));return convertFile(_0x39c31c,_0x4af26f)['then'](function(){try{fs[_0x5f53('0x1f')](_0x39c31c);fs[_0x5f53('0x30')](_0x4af26f,_0x5f53('0x31'));}catch(_0x12bf94){logger[_0x5f53('0x1e')](_0x12bf94);}return _0x4af26f[_0x5f53('0x32')]('.')[0x0];});}function base64Encode(_0x3e9546){var _0x590542=fs['readFileSync'](_0x3e9546);return new Buffer(_0x590542)[_0x5f53('0x33')](_0x5f53('0x2f'));}exports['googleCloudTTS']=function(_0x29ac50,_0x11e430,_0x352d29,_0x3c7a32,_0x49c98d,_0x454f72){var _0x54dcb2,_0x2069d6;var _0x1130ea='https://texttospeech.googleapis.com/v1/';var _0x349c5f=_0x5f53('0x34')+_0x29ac50;var _0x1a83f8={};if(_0x11e430==='ssml'){_0x1a83f8[_0x5f53('0x35')]={'ssml':_0x352d29};}else{_0x1a83f8[_0x5f53('0x35')]={'text':_0x352d29};};_0x1a83f8[_0x5f53('0x36')]={'languageCode':_0x3c7a32,'ssmlGender':_0x49c98d};_0x1a83f8[_0x5f53('0x37')]={'audioEncoding':_0x5f53('0x38'),'sampleRateHertz':0x1f40};var _0x4d2b6f={'url':_0x1130ea+_0x5f53('0x39')+_0x349c5f,'method':_0x5f53('0x3a'),'json':!![],'body':_0x1a83f8};return rp(_0x4d2b6f)['then'](function(_0x5b1084){return new BPromise(function(_0x29f895,_0x3d03dc){_0x54dcb2=path['resolve'](__dirname,_0x5f53('0x2b'),rs['generate'](0x4)+_0x5f53('0x3b'));var _0x50b406=Buffer['from'](_0x5b1084[_0x5f53('0x3c')],_0x5f53('0x2f'));return fs[_0x5f53('0x3d')](_0x54dcb2,_0x50b406,function(_0x466d20){_0x3d03dc(_0x466d20);},function(_0x38701d){fs[_0x5f53('0x30')](_0x54dcb2,_0x5f53('0x31'));_0x29f895(_0x38701d);});});})[_0x5f53('0x3e')](function(_0x11235e){_0x2069d6=path[_0x5f53('0x3f')](__dirname,_0x5f53('0x2b'),rs['generate'](0x4)+_0x5f53('0x2d'));return convertFile(_0x54dcb2,_0x2069d6);})['then'](function(){try{fs[_0x5f53('0x1f')](_0x54dcb2);fs[_0x5f53('0x30')](_0x2069d6,_0x5f53('0x31'));}catch(_0x1e66d5){logger['error'](_0x1e66d5);}logger['info'](_0x5f53('0x40'),_0x2069d6[_0x5f53('0x32')]('.')[0x0]);return _0x2069d6[_0x5f53('0x32')]('.')[0x0];});};exports[_0x5f53('0x41')]=function(_0x3fa53c,_0x4eb407){var _0x509732=_0x5f53('0x42');var _0x55dd58,_0x3100b8;var _0x1e9c71;var _0xb23c57={'encoding':_0x5f53('0x43'),'method':_0x5f53('0x3a'),'timeout':0x2710,'url':_0x509732,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0x5f53('0x44')]([[[_0x5f53('0x45'),JSON[_0x5f53('0x44')]([_0x3fa53c,_0x4eb407||'en',![],_0x5f53('0x46')]),null,_0x5f53('0x47')]]]))};return rp(_0xb23c57)['then'](function(_0x59d78a){try{_0x1e9c71=eval(_0x59d78a[_0x5f53('0x48')](0x5))[0x0][0x2];}catch(_0x4ae93c){throw new Error(_0x5f53('0x49')+_0x59d78a[_0x5f53('0x24')]);}if(!_0x1e9c71){if(_0x3fa53c[_0x5f53('0x4a')]>0xc8){throw new Error(_0x5f53('0x4b'));}else{throw new Error(_0x5f53('0x4c')+_0x4eb407+_0x5f53('0x4d'));}}try{_0x1e9c71=eval(_0x1e9c71)[0x0];}catch(_0x1d5f72){throw new Error(_0x5f53('0x49')+res[_0x5f53('0x24')]);}const _0x36372d=_0x1e9c71;_0x55dd58=path[_0x5f53('0x3f')](__dirname,'tmp',rs[_0x5f53('0x2c')](0x4)+_0x5f53('0x3b'));fs[_0x5f53('0x2e')](_0x55dd58,_0x1e9c71,{'encoding':_0x5f53('0x2f')});_0x3100b8=path[_0x5f53('0x3f')](__dirname,'tmp',rs[_0x5f53('0x2c')](0x4)+_0x5f53('0x2d'));return convertFile(_0x55dd58,_0x3100b8);})[_0x5f53('0x3e')](function(){try{fs['unlink'](_0x55dd58);fs['chmodSync'](_0x3100b8,_0x5f53('0x31'));}catch(_0x33d2b0){logger[_0x5f53('0x1e')](_0x33d2b0);}logger[_0x5f53('0x1b')]('goggleTTS\x20path',_0x3100b8[_0x5f53('0x32')]('.')[0x0]);return _0x3100b8['split']('.')[0x0];});};exports['googleASR']=function(_0x579fab,_0x5bce0c,_0x30dab6){return google['asr'](_0x579fab,_0x5bce0c,_0x30dab6)[_0x5f53('0x3e')](function(_0x51c27d){logger[_0x5f53('0x1b')](_0x51c27d[_0x5f53('0x4e')]);return rp(_0x51c27d);})[_0x5f53('0x3e')](function(_0x436e8f){var _0x24218c='';var _0x4630e4=0x0;try{fs['unlink'](_0x579fab);}catch(_0x9b7414){logger[_0x5f53('0x1e')](_0x9b7414);}if(_0x436e8f&&_0x436e8f['results']){_0x24218c=_0x436e8f[_0x5f53('0x4f')][_0x5f53('0x50')](function(_0x18ca60){return _0x18ca60&&_0x18ca60[_0x5f53('0x51')][0x0]&&_0x18ca60[_0x5f53('0x51')][0x0][_0x5f53('0x52')]?_0x18ca60[_0x5f53('0x51')][0x0][_0x5f53('0x52')]:'';})[_0x5f53('0x53')]('\x0a');_0x4630e4=_0x436e8f[_0x5f53('0x4f')][_0x5f53('0x50')](function(_0x36ece6){return _0x36ece6&&_0x36ece6[_0x5f53('0x51')][0x0]&&_0x36ece6['alternatives'][0x0]['confidence']?_0x36ece6[_0x5f53('0x51')][0x0][_0x5f53('0x54')]:0x0;})[_0x5f53('0x53')]('\x0a');}logger[_0x5f53('0x1b')](_0x5f53('0x55'),_0x24218c);logger[_0x5f53('0x1b')](_0x5f53('0x56'),_0x4630e4);return{'transcript':_0x24218c,'confidence':_0x4630e4};})[_0x5f53('0x57')](function(_0xa0377f){logger[_0x5f53('0x1e')]('[%s]\x20%s:%s',_0xa0377f[_0x5f53('0x15')],_0xa0377f[_0x5f53('0x58')],_0xa0377f['message']);});};exports[_0x5f53('0x59')]=function(_0x4caa4d,_0x333b46,_0x22677e,_0x5bead4){var _0x3a8ec5=apiai(_0x333b46,{'language':_0x5bead4||'en'});return _0x3a8ec5['textRequest'](_0x22677e,{'sessionId':md5(_0x4caa4d)})[_0x5f53('0x3e')](function(_0x59ecba){logger[_0x5f53('0x1b')](JSON[_0x5f53('0x44')](_0x59ecba));return{'source':_0x59ecba[_0x5f53('0x5a')][_0x5f53('0x5b')],'resolvedQuery':_0x59ecba[_0x5f53('0x5a')]['resolvedQuery'],'action':_0x59ecba['result'][_0x5f53('0x5c')],'actionIncomplete':_0x59ecba['result'][_0x5f53('0x5d')],'speech':_0x59ecba['result'][_0x5f53('0x5e')]['speech'],'score':_0x59ecba[_0x5f53('0x5a')][_0x5f53('0x5f')],'statusCode':_0x59ecba[_0x5f53('0x60')][_0x5f53('0x61')],'endConversation':_0x59ecba[_0x5f53('0x5a')][_0x5f53('0x62')][_0x5f53('0x63')]||![],'isFallbackIntent':_0x59ecba['result'][_0x5f53('0x62')]['isFallbackIntent']};});};exports[_0x5f53('0x64')]=function(_0x41040e,_0xcdb4b8,_0x37f931,_0x3518bd,_0x561602,_0x22f52b){var _0x379163=_0x3518bd['replace'](/\\n/g,'\x0a');var _0x1d31a7={'credentials':{'private_key':_0x379163,'client_email':_0x37f931}};var _0x219761=new dialogflow[(_0x5f53('0x65'))](_0x1d31a7);var _0x4e9d4c=_0x219761[_0x5f53('0x66')](_0xcdb4b8,md5(_0x41040e));var _0xb77007={'session':_0x4e9d4c,'queryInput':{'text':{'text':_0x561602,'languageCode':_0x22f52b}}};return _0x219761[_0x5f53('0x67')](_0xb77007)[_0x5f53('0x3e')](function(_0x2c4ad6){if(_0x2c4ad6&&_0x2c4ad6[_0x5f53('0x4a')]){logger['info'](_0x5f53('0x68'),JSON[_0x5f53('0x44')](_0x2c4ad6));var _0x304dda=_0x2c4ad6[0x0];if(_0x304dda){var _0x548fd9={'action':_0x304dda[_0x5f53('0x69')]['action'],'allRequiredParamsPresent':_0x304dda[_0x5f53('0x69')]['allRequiredParamsPresent'],'endConversation':_0x304dda[_0x5f53('0x69')][_0x5f53('0x6a')]&&_0x304dda[_0x5f53('0x69')]['diagnosticInfo']['fields']?_0x304dda[_0x5f53('0x69')][_0x5f53('0x6a')][_0x5f53('0x6b')][_0x5f53('0x6c')]['boolValue']:![],'fulfillmentText':_0x304dda[_0x5f53('0x69')][_0x5f53('0x6d')],'intentName':_0x304dda[_0x5f53('0x69')]['intent'][_0x5f53('0x58')],'intentDisplayName':_0x304dda['queryResult']['intent'][_0x5f53('0x6e')],'isFallbackIntent':_0x304dda[_0x5f53('0x69')][_0x5f53('0x6f')][_0x5f53('0x70')],'languageCode':_0x304dda[_0x5f53('0x69')][_0x5f53('0x71')],'queryText':_0x304dda[_0x5f53('0x69')][_0x5f53('0x72')],'responseId':_0x304dda[_0x5f53('0x73')],'score':_0x304dda[_0x5f53('0x69')][_0x5f53('0x74')],'speech':_0x304dda[_0x5f53('0x69')][_0x5f53('0x6d')],'providerResponse':JSON['stringify'](_0x2c4ad6)};return _0x548fd9;}}});};exports['tildeASR']=function(_0x224704,_0x1464c8,_0x2f7257,_0x3f50fb){return tilde[_0x5f53('0x75')](_0x224704,_0x1464c8,_0x2f7257,_0x3f50fb)[_0x5f53('0x3e')](function(_0x4aed50){try{fs[_0x5f53('0x1f')](_0x224704);}catch(_0x36c8e6){logger[_0x5f53('0x1e')](_0x36c8e6);}logger[_0x5f53('0x1b')](_0x5f53('0x76'),_0x4aed50[_0x5f53('0x52')]);logger['info'](_0x5f53('0x77'),_0x4aed50['confidence']);return _0x4aed50;});};exports['awsPolly']=function(_0x4adadf,_0xfc070a,_0xf706e3,_0x4d400c,_0xddd364,_0x4ae2d0){var _0x55dd41=path[_0x5f53('0x3f')](__dirname,_0x5f53('0x2b'),rs['generate'](0x4)+_0x5f53('0x3b'));var _0xd9a623;return aws['polly'](_0x4adadf,_0xfc070a,_0xf706e3,_0x4d400c,_0xddd364,_0x4ae2d0,_0x55dd41)[_0x5f53('0x3e')](function(){_0xd9a623=path[_0x5f53('0x3f')](__dirname,_0x5f53('0x2b'),rs[_0x5f53('0x2c')](0x4)+_0x5f53('0x2d'));return convertFile(_0x55dd41,_0xd9a623);})['then'](function(){try{fs[_0x5f53('0x1f')](_0x55dd41);fs['chmodSync'](_0xd9a623,_0x5f53('0x31'));}catch(_0x2203ff){logger[_0x5f53('0x1e')](_0x2203ff);}return _0xd9a623[_0x5f53('0x32')]('.')[0x0];});};exports['awsLex']=function(_0x136957,_0x59b961,_0x5601b5,_0x54546a,_0x3541b0,_0x3ca849){return aws[_0x5f53('0x78')](_0x136957,_0x59b961,_0x5601b5,_0x54546a,_0x3541b0,_0x3ca849)['then'](function(_0x1d9903){logger[_0x5f53('0x1b')](JSON[_0x5f53('0x44')](_0x1d9903));return _0x1d9903;});};exports[_0x5f53('0x79')]=function(_0x11bf93,_0x32dd1e,_0x28c566,_0x2b41e7){var _0x5ecbd3=util[_0x5f53('0x7a')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x11bf93,encodeURIComponent(_0x32dd1e),_0x28c566,_0x2b41e7);var _0x3cb576=path['resolve'](__dirname,_0x5f53('0x2b'),rs[_0x5f53('0x2c')](0x4)+'.mp3');var _0x3d7670;return downloadFile(_0x5ecbd3,_0x3cb576)[_0x5f53('0x3e')](function(){_0x3d7670=path[_0x5f53('0x3f')](__dirname,_0x5f53('0x2b'),rs['generate'](0x4)+_0x5f53('0x2d'));return convertFile(_0x3cb576,_0x3d7670);})[_0x5f53('0x3e')](function(){try{fs['unlink'](_0x3cb576);fs['chmodSync'](_0x3d7670,'777');}catch(_0x23c840){logger[_0x5f53('0x1e')](_0x23c840);}return _0x3d7670[_0x5f53('0x32')]('.')[0x0];});};exports[_0x5f53('0x7b')]=function(_0x1d5534,_0x2d95bf,_0x4ab0f2,_0xb4d802){var _0x195ea8=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x2d95bf,_0x4ab0f2,base64Encode(_0x1d5534),_0xb4d802?util['format'](_0x5f53('0x7c'),encodeURIComponent(_0xb4d802)):'freeform=3');return uploadFile(_0x195ea8)[_0x5f53('0x3e')](function(_0x2c5592){return querystring[_0x5f53('0x7d')](_0x2c5592);});};exports[_0x5f53('0x7e')]=function(_0xbb400b,_0xe16c3f){return sestek[_0x5f53('0x7f')](_0xbb400b,_0xe16c3f)[_0x5f53('0x3e')](function(_0xe817d7){logger['info'](JSON['stringify'](_0xe817d7));var _0x1e48b2={'speech':_0xe817d7[_0x5f53('0x80')],'action':_0xe817d7['channelData']?_0xe817d7['channelData'][_0x5f53('0x81')]:undefined,'actiondata':_0xe817d7['channelData']?_0xe817d7[_0x5f53('0x82')][_0x5f53('0x83')]:undefined};if(_0xe817d7[_0x5f53('0x82')]&&_0xe817d7['channelData'][_0x5f53('0x84')]){return base64Decode(_0xe817d7['channelData'][_0x5f53('0x84')][_0x5f53('0x85')],path[_0x5f53('0x3f')](__dirname,_0x5f53('0x2b'),rs[_0x5f53('0x2c')](0x4)+_0x5f53('0x2d')))[_0x5f53('0x3e')](function(_0x326a41){_0x1e48b2[_0x5f53('0x86')]=_0x326a41;return _0x1e48b2;});}return _0x1e48b2;});};exports[_0x5f53('0x87')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 2c3deaf..7eb2dc4 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 _0x28a2=['./nda','exports'];(function(_0x4d5251,_0x40cd0e){var _0x4c8567=function(_0x57dbad){while(--_0x57dbad){_0x4d5251['push'](_0x4d5251['shift']());}};_0x4c8567(++_0x40cd0e);}(_0x28a2,0x140));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};var nda=require(_0x228a('0x0'));module[_0x228a('0x1')]={'nda':nda}; \ No newline at end of file +var _0x4782=['./nda','exports'];(function(_0x315660,_0x4a3969){var _0x2385d7=function(_0x283515){while(--_0x283515){_0x315660['push'](_0x315660['shift']());}};_0x2385d7(++_0x4a3969);}(_0x4782,0x152));var _0x2478=function(_0x33b44c,_0x16b582){_0x33b44c=_0x33b44c-0x0;var _0x93dfa4=_0x4782[_0x33b44c];return _0x93dfa4;};var nda=require(_0x2478('0x0'));module[_0x2478('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 26909f4..94809ea 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 _0x3afc=['extension','text','Bearer\x20','access_token','project','body','ProjectName','ndagenerate_audio','channelData','audio/wav','custom_action_data','CustomActionData','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','password','username','ndassistant_url','ndaactivity_type','message','callerid','calleridname','dnid'];(function(_0x4c8036,_0xec4f1){var _0x340753=function(_0x5933fd){while(--_0x5933fd){_0x4c8036['push'](_0x4c8036['shift']());}};_0x340753(++_0xec4f1);}(_0x3afc,0x99));var _0xc3af=function(_0x58e3fa,_0x9a43cf){_0x58e3fa=_0x58e3fa-0x0;var _0x51e4be=_0x3afc[_0x58e3fa];return _0x51e4be;};'use strict';var rp=require(_0xc3af('0x0'));var url=require(_0xc3af('0x1'));var logger=require(_0xc3af('0x2'))('agi');module[_0xc3af('0x3')]=function(_0x1e8799,_0x1c0ccd){var _0x50a702={'method':_0xc3af('0x4'),'uri':url[_0xc3af('0x5')](_0x1c0ccd[_0xc3af('0x6')],'/token'),'form':{'grant_type':_0xc3af('0x7'),'username':_0x1c0ccd[_0xc3af('0x8')],'password':_0x1c0ccd[_0xc3af('0x7')]},'json':!![]};return rp(_0x50a702)['then'](function(_0x2781b4){var _0x10a9fe={'method':_0xc3af('0x4'),'uri':url['resolve'](_0x1c0ccd[_0xc3af('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x1c0ccd[_0xc3af('0xa')]||_0xc3af('0xb'),'channelId':'Nda','conversation':{'id':_0x1e8799['uniqueid']},'from':{'id':_0x1e8799[_0xc3af('0xc')],'name':_0x1e8799[_0xc3af('0xd')]},'recipient':{'id':_0x1e8799[_0xc3af('0xe')],'name':_0x1e8799[_0xc3af('0xf')]},'text':_0x1c0ccd[_0xc3af('0x10')],'channelData':{}},'headers':{'Authorization':_0xc3af('0x11')+_0x2781b4[_0xc3af('0x12')]},'json':!![]};if(_0x1c0ccd[_0xc3af('0x13')]){_0x10a9fe[_0xc3af('0x14')]['channelData'][_0xc3af('0x15')]=_0x1c0ccd[_0xc3af('0x13')];}if(_0x1c0ccd[_0xc3af('0x16')]=='1'){_0x10a9fe[_0xc3af('0x14')][_0xc3af('0x17')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc3af('0x18')};}if(_0x1c0ccd['custom_action']){_0x10a9fe[_0xc3af('0x14')][_0xc3af('0x17')]['CustomAction']=_0x1c0ccd['custom_action'];if(_0x1c0ccd[_0xc3af('0x19')]){_0x10a9fe['body'][_0xc3af('0x17')][_0xc3af('0x1a')]=_0x1c0ccd[_0xc3af('0x19')];}}logger['info'](JSON[_0xc3af('0x1b')](_0x10a9fe));return rp(_0x10a9fe);});}; \ No newline at end of file +var _0xc4e8=['then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','../../../../../config/logger','POST','resolve','/token','password'];(function(_0x30d719,_0x22729b){var _0x21358e=function(_0x9c8042){while(--_0x9c8042){_0x30d719['push'](_0x30d719['shift']());}};_0x21358e(++_0x22729b);}(_0xc4e8,0x14b));var _0x8c4e=function(_0xf628fd,_0x3033d5){_0xf628fd=_0xf628fd-0x0;var _0x37ccc8=_0xc4e8[_0xf628fd];return _0x37ccc8;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x8c4e('0x0'))('agi');module['exports']=function(_0x4587b5,_0x56d54c){var _0x266cbe={'method':_0x8c4e('0x1'),'uri':url[_0x8c4e('0x2')](_0x56d54c['ndauth_url'],_0x8c4e('0x3')),'form':{'grant_type':_0x8c4e('0x4'),'username':_0x56d54c['username'],'password':_0x56d54c[_0x8c4e('0x4')]},'json':!![]};return rp(_0x266cbe)[_0x8c4e('0x5')](function(_0x106691){var _0x1d644f={'method':_0x8c4e('0x1'),'uri':url['resolve'](_0x56d54c[_0x8c4e('0x6')],_0x8c4e('0x7')),'body':{'type':_0x56d54c[_0x8c4e('0x8')]||_0x8c4e('0x9'),'channelId':_0x8c4e('0xa'),'conversation':{'id':_0x4587b5[_0x8c4e('0xb')]},'from':{'id':_0x4587b5[_0x8c4e('0xc')],'name':_0x4587b5['calleridname']},'recipient':{'id':_0x4587b5[_0x8c4e('0xd')],'name':_0x4587b5[_0x8c4e('0xe')]},'text':_0x56d54c[_0x8c4e('0xf')],'channelData':{}},'headers':{'Authorization':_0x8c4e('0x10')+_0x106691['access_token']},'json':!![]};if(_0x56d54c[_0x8c4e('0x11')]){_0x1d644f[_0x8c4e('0x12')][_0x8c4e('0x13')][_0x8c4e('0x14')]=_0x56d54c[_0x8c4e('0x11')];}if(_0x56d54c['ndagenerate_audio']=='1'){_0x1d644f[_0x8c4e('0x12')]['channelData'][_0x8c4e('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8c4e('0x16')};}if(_0x56d54c[_0x8c4e('0x17')]){_0x1d644f[_0x8c4e('0x12')]['channelData'][_0x8c4e('0x18')]=_0x56d54c['custom_action'];if(_0x56d54c[_0x8c4e('0x19')]){_0x1d644f['body'][_0x8c4e('0x13')][_0x8c4e('0x1a')]=_0x56d54c[_0x8c4e('0x19')];}}logger[_0x8c4e('0x1b')](JSON['stringify'](_0x1d644f));return rp(_0x1d644f);});}; \ 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 bcdc23a..e8bd8ea 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 _0x403e=['exports','./lib/api'];(function(_0x25a900,_0x1e5233){var _0x5ef885=function(_0x27de61){while(--_0x27de61){_0x25a900['push'](_0x25a900['shift']());}};_0x5ef885(++_0x1e5233);}(_0x403e,0x19b));var _0xe403=function(_0x4d6dd0,_0x4e69b7){_0x4d6dd0=_0x4d6dd0-0x0;var _0x16ce7a=_0x403e[_0x4d6dd0];return _0x16ce7a;};'use strict';var asr=require(_0xe403('0x0'));module[_0xe403('0x1')]=function(_0xdc2429,_0x2dbaaa,_0x2e7216,_0x261033){return asr(_0xdc2429,_0x2dbaaa,_0x2e7216,_0x261033);}; \ No newline at end of file +var _0x17da=['./lib/api','exports'];(function(_0x1de02b,_0x53aa84){var _0x2025a4=function(_0x20e1a5){while(--_0x20e1a5){_0x1de02b['push'](_0x1de02b['shift']());}};_0x2025a4(++_0x53aa84);}(_0x17da,0x196));var _0xa17d=function(_0x1dffd4,_0x53c5fc){_0x1dffd4=_0x1dffd4-0x0;var _0x1722c4=_0x17da[_0x1dffd4];return _0x1722c4;};'use strict';var asr=require(_0xa17d('0x0'));module[_0xa17d('0x1')]=function(_0x582838,_0x384203,_0x26854c,_0x424323){return asr(_0x582838,_0x384203,_0x26854c,_0x424323);}; \ 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 0bb3c35..7eb3b03 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 _0x8d5e=['Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','../../../../../../config/logger','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','stringify','close','send','EOS','Tilde\x20ASR\x20send\x20error','terminate','status','result','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket'];(function(_0x4c11a3,_0x441c5d){var _0x5377ec=function(_0x866a2b){while(--_0x866a2b){_0x4c11a3['push'](_0x4c11a3['shift']());}};_0x5377ec(++_0x441c5d);}(_0x8d5e,0xe3));var _0xe8d5=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x8d5e[_0x126558];return _0x1f6d14;};'use strict';var BPromise=require(_0xe8d5('0x0'));var _=require(_0xe8d5('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xe8d5('0x2'));var crypto=require('crypto');var logger=require(_0xe8d5('0x3'))('agi');module[_0xe8d5('0x4')]=function(_0x4a8b4a,_0x39a9c0,_0x4636f1,_0x36a3c6){return new BPromise(function(_0x259103,_0x43684d){logger['info'](_0xe8d5('0x5'),_0x36a3c6||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x51ad19=new WebSocket(_0x36a3c6||_0xe8d5('0x6'),{'perMessageDeflate':![]});var _0x557a0a='';var _0x57afe2='0';var _0x20d042='1';var _0x3dacee='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2b33ad(_0x106ef2){var _0x55ab22=crypto[_0xe8d5('0x7')](_0xe8d5('0x8'));_0x55ab22[_0xe8d5('0x9')](_0x106ef2);return _0x55ab22[_0xe8d5('0xa')](_0xe8d5('0xb'));}function _0x543e50(){try{logger[_0xe8d5('0xc')](_0xe8d5('0xd'));var _0x54a082=moment()['unix']();var _0x4c9406=_0x2b33ad(_0x54a082+_0x39a9c0+_0x4636f1);_0x51ad19['send'](JSON[_0xe8d5('0xe')]({'appID':_0x39a9c0,'timestamp':_0x54a082,'appKey':_0x4c9406}));var _0x4f400c=fs['createReadStream'](_0x4a8b4a);_0x4f400c['on']('data',function(_0x54f86d){_0x51ad19['send'](_0x54f86d);});_0x4f400c['on'](_0xe8d5('0xf'),function(){_0x51ad19[_0xe8d5('0x10')](_0xe8d5('0x11'));});}catch(_0xee5d81){logger['error'](_0xe8d5('0x12'),JSON[_0xe8d5('0xe')](_0xee5d81));_0x51ad19[_0xe8d5('0x13')]();}}function _0x293bc7(_0x3ab7b8){try{if(_0x3ab7b8){var _0x3490c2=JSON['parse'](_0x3ab7b8);switch(_0x3490c2[_0xe8d5('0x14')]){case 0x0:if(_0x3490c2[_0xe8d5('0x15')]){if(_0x3490c2[_0xe8d5('0x15')]['final']){logger[_0xe8d5('0xc')]('Tilde\x20ASR\x20hypoteses',JSON[_0xe8d5('0xe')](_0x3490c2[_0xe8d5('0x15')][_0xe8d5('0x16')]));_0x557a0a=_0x3490c2[_0xe8d5('0x15')][_0xe8d5('0x16')][0x0][_0xe8d5('0x17')];_0x57afe2=_0x3490c2['result'][_0xe8d5('0x16')][0x0][_0xe8d5('0x18')];_0x20d042='0';_0x3dacee=_0xe8d5('0x19');_0x51ad19[_0xe8d5('0x13')]();}}break;case 0x1:logger[_0xe8d5('0xc')](_0xe8d5('0x1a'));_0x20d042='1';_0x3dacee='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xe8d5('0xc')](_0xe8d5('0x1b'));_0x20d042='2';_0x3dacee=_0xe8d5('0x1b');break;case 0x9:logger[_0xe8d5('0xc')](_0xe8d5('0x1c'));_0x20d042='9';_0x3dacee=_0xe8d5('0x1c');break;case 0xa:logger['info']('Authentication\x20failed.');_0x20d042='10';_0x3dacee='Authentication\x20failed.';break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x20d042='11';_0x3dacee='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x3f80b8){logger[_0xe8d5('0x1d')](_0xe8d5('0x1e'),JSON['stringify'](_0x3f80b8));_0x51ad19['terminate']();}}function _0x5b5c5a(){logger[_0xe8d5('0xc')](_0xe8d5('0x1f'));_0x259103({'transcript':_0x557a0a,'confidence':_0x57afe2,'status':_0x20d042,'status_message':_0x3dacee});}function _0x1f7710(_0x34364c){logger[_0xe8d5('0x1d')](_0xe8d5('0x20'));if(!_[_0xe8d5('0x21')](_0x34364c)){logger[_0xe8d5('0x1d')](_[_0xe8d5('0x22')](_0x34364c)?JSON[_0xe8d5('0xe')](_0x34364c):_0x34364c);}}_0x51ad19['on'](_0xe8d5('0x23'),_0x543e50);_0x51ad19['on'](_0xe8d5('0x24'),_0x293bc7);_0x51ad19['on']('close',_0x5b5c5a);_0x51ad19['on'](_0xe8d5('0x1d'),_0x1f7710);});}; \ No newline at end of file +var _0xe7c2=['error','Tilde\x20ASR\x20send\x20error','terminate','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','isNil','isObject','open','message','close','bluebird','lodash','crypto','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','sha1','digest','Open\x20Tilde\x20ASR\x20socket','stringify','createReadStream','data','send','EOS'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0xe7c2,0x117));var _0x2e7c=function(_0x4b75a0,_0x277c31){_0x4b75a0=_0x4b75a0-0x0;var _0x293430=_0xe7c2[_0x4b75a0];return _0x293430;};'use strict';var BPromise=require(_0x2e7c('0x0'));var _=require(_0x2e7c('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x2e7c('0x2'));var logger=require('../../../../../../config/logger')(_0x2e7c('0x3'));module[_0x2e7c('0x4')]=function(_0x1d0774,_0x1faa77,_0xe802bc,_0x2981e8){return new BPromise(function(_0x36b0b4,_0x4ca502){logger[_0x2e7c('0x5')](_0x2e7c('0x6'),_0x2981e8||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x488970=new WebSocket(_0x2981e8||_0x2e7c('0x7'),{'perMessageDeflate':![]});var _0x10f254='';var _0x4c9531='0';var _0x4ae54a='1';var _0x436afd=_0x2e7c('0x8');function _0x125f4f(_0x404971){var _0xa36c77=crypto['createHash'](_0x2e7c('0x9'));_0xa36c77['update'](_0x404971);return _0xa36c77[_0x2e7c('0xa')]('hex');}function _0xd81311(){try{logger['info'](_0x2e7c('0xb'));var _0xb99895=moment()['unix']();var _0x1cd81a=_0x125f4f(_0xb99895+_0x1faa77+_0xe802bc);_0x488970['send'](JSON[_0x2e7c('0xc')]({'appID':_0x1faa77,'timestamp':_0xb99895,'appKey':_0x1cd81a}));var _0x23be75=fs[_0x2e7c('0xd')](_0x1d0774);_0x23be75['on'](_0x2e7c('0xe'),function(_0xb462ce){_0x488970[_0x2e7c('0xf')](_0xb462ce);});_0x23be75['on']('close',function(){_0x488970['send'](_0x2e7c('0x10'));});}catch(_0x6e7a20){logger[_0x2e7c('0x11')](_0x2e7c('0x12'),JSON[_0x2e7c('0xc')](_0x6e7a20));_0x488970[_0x2e7c('0x13')]();}}function _0x1bffbf(_0x40170f){try{if(_0x40170f){var _0x326c6d=JSON['parse'](_0x40170f);switch(_0x326c6d[_0x2e7c('0x14')]){case 0x0:if(_0x326c6d[_0x2e7c('0x15')]){if(_0x326c6d[_0x2e7c('0x15')]['final']){logger[_0x2e7c('0x5')](_0x2e7c('0x16'),JSON['stringify'](_0x326c6d[_0x2e7c('0x15')][_0x2e7c('0x17')]));_0x10f254=_0x326c6d[_0x2e7c('0x15')][_0x2e7c('0x17')][0x0][_0x2e7c('0x18')];_0x4c9531=_0x326c6d[_0x2e7c('0x15')][_0x2e7c('0x17')][0x0][_0x2e7c('0x19')];_0x4ae54a='0';_0x436afd=_0x2e7c('0x1a');_0x488970[_0x2e7c('0x13')]();}}break;case 0x1:logger[_0x2e7c('0x5')](_0x2e7c('0x8'));_0x4ae54a='1';_0x436afd=_0x2e7c('0x8');break;case 0x2:logger[_0x2e7c('0x5')](_0x2e7c('0x1b'));_0x4ae54a='2';_0x436afd=_0x2e7c('0x1b');break;case 0x9:logger[_0x2e7c('0x5')](_0x2e7c('0x1c'));_0x4ae54a='9';_0x436afd=_0x2e7c('0x1c');break;case 0xa:logger[_0x2e7c('0x5')](_0x2e7c('0x1d'));_0x4ae54a='10';_0x436afd=_0x2e7c('0x1d');break;case 0xb:logger[_0x2e7c('0x5')](_0x2e7c('0x1e'));_0x4ae54a='11';_0x436afd=_0x2e7c('0x1e');}}}catch(_0x2ec207){logger[_0x2e7c('0x11')](_0x2e7c('0x1f'),JSON[_0x2e7c('0xc')](_0x2ec207));_0x488970[_0x2e7c('0x13')]();}}function _0x2fba8e(){logger[_0x2e7c('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x36b0b4({'transcript':_0x10f254,'confidence':_0x4c9531,'status':_0x4ae54a,'status_message':_0x436afd});}function _0x179474(_0x5b31eb){logger[_0x2e7c('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x2e7c('0x20')](_0x5b31eb)){logger[_0x2e7c('0x11')](_[_0x2e7c('0x21')](_0x5b31eb)?JSON['stringify'](_0x5b31eb):_0x5b31eb);}}_0x488970['on'](_0x2e7c('0x22'),_0xd81311);_0x488970['on'](_0x2e7c('0x23'),_0x1bffbf);_0x488970['on'](_0x2e7c('0x24'),_0x2fba8e);_0x488970['on'](_0x2e7c('0x11'),_0x179474);});}; \ 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 890ba2f..1710aca 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 _0xa5fe=['exports','./asr'];(function(_0xfb19ff,_0x1a17c2){var _0x3c8900=function(_0x577719){while(--_0x577719){_0xfb19ff['push'](_0xfb19ff['shift']());}};_0x3c8900(++_0x1a17c2);}(_0xa5fe,0x163));var _0xea5f=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0xa5fe[_0x19159a];return _0xa677f4;};var asr=require(_0xea5f('0x0'));module[_0xea5f('0x1')]={'asr':asr}; \ No newline at end of file +var _0x99b7=['./asr','exports'];(function(_0x5f3ee2,_0x5a8001){var _0x467904=function(_0x105ec9){while(--_0x105ec9){_0x5f3ee2['push'](_0x5f3ee2['shift']());}};_0x467904(++_0x5a8001);}(_0x99b7,0x1e8));var _0x799b=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x99b7[_0x280f4a];return _0x1bb157;};var asr=require(_0x799b('0x0'));module[_0x799b('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index d998524..a0f6096 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 _0x50a8=['E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','./error','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections'];(function(_0x3d93de,_0x531e99){var _0x4d2eac=function(_0x38f81d){while(--_0x38f81d){_0x3d93de['push'](_0x3d93de['shift']());}};_0x4d2eac(++_0x531e99);}(_0x50a8,0x198));var _0x850a=function(_0x15f972,_0x4a1fc7){_0x15f972=_0x15f972-0x0;var _0x3d916e=_0x50a8[_0x15f972];return _0x3d916e;};'use strict';var util=require(_0x850a('0x0'));var net=require('net');var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0x850a('0x1'));var AGIChannel=require('./channel');var AGIServer=function(_0x204954,_0xd9cbd,_0x2109b0){var _0x3df4c3=this,_0x204954=_0x204954||0x11dd,_0xd9cbd=_0xd9cbd||_0x850a('0x2'),_0xb85c1a=null,_0x442316=0x0;EventEmitter['call'](_0x3df4c3);function _0x488676(){if(!_0x204954){_0x3df4c3[_0x850a('0x3')](_0x850a('0x4'),new AGIError(_0x850a('0x5')));return![];}_0xb85c1a=net[_0x850a('0x6')]();_0xb85c1a['listen'](_0x204954,_0xd9cbd);_0xb85c1a['on'](_0x850a('0x7'),function(){_0x3df4c3['emit']('listening');});_0xb85c1a['on'](_0x850a('0x8'),function(_0x931343){_0xb85c1a[_0x850a('0x9')](function(_0x208812,_0x2b3ccd){if(_0x208812){_0x3df4c3['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0x208812));}else if(_0x2109b0&&_0x2109b0<0x0){_0x3df4c3[_0x850a('0x3')]('error',new AGIError(_0x850a('0xa')));_0x931343[_0x850a('0xb')]();}else if(_0x2109b0&&_0x2109b0>0x0&&_0x2109b0<_0x2b3ccd){_0x442316+=0x1;_0x3df4c3[_0x850a('0x3')](_0x850a('0x4'),new AGIError(_0x850a('0xc'),_0x442316));_0x931343['destroy']();}else{var _0x355a31=new AGIChannel(_0x931343);_0x355a31['on']('ready',function(){_0x3df4c3['emit']('connection',_0x355a31);});}});});_0xb85c1a['on']('error',function(_0x3e6e81){_0x3df4c3['emit'](_0x850a('0x4'),new AGIError(_0x850a('0xd'),_0x3e6e81[_0x850a('0xe')]));});_0xb85c1a['on'](_0x850a('0xf'),function(){_0x3df4c3[_0x850a('0x3')](_0x850a('0xf'),new AGIError(_0x850a('0x10')));});}process[_0x850a('0x11')](function(){_0x488676();});};util['inherits'](AGIServer,EventEmitter);module[_0x850a('0x12')]=function(_0x4bdd56,_0x4c70ab,_0x49690e){return new AGIServer(_0x4bdd56,_0x4c70ab,_0x49690e);}; \ No newline at end of file +var _0xcc8d=['127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','error','code','close','exports','net','events','./channel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0xcc8d[_0x4b9dc9];return _0x57b302;};'use strict';var util=require('util');var net=require(_0xdcc8('0x0'));var EventEmitter=require(_0xdcc8('0x1'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0xdcc8('0x2'));var AGIServer=function(_0x412657,_0x32d674,_0x33ec37){var _0x350afb=this,_0x412657=_0x412657||0x11dd,_0x32d674=_0x32d674||_0xdcc8('0x3'),_0x47b30e=null,_0x44e0b0=0x0;EventEmitter[_0xdcc8('0x4')](_0x350afb);function _0x237528(){if(!_0x412657){_0x350afb[_0xdcc8('0x5')]('error',new AGIError(_0xdcc8('0x6')));return![];}_0x47b30e=net[_0xdcc8('0x7')]();_0x47b30e[_0xdcc8('0x8')](_0x412657,_0x32d674);_0x47b30e['on'](_0xdcc8('0x9'),function(){_0x350afb[_0xdcc8('0x5')](_0xdcc8('0x9'));});_0x47b30e['on'](_0xdcc8('0xa'),function(_0x1612ad){_0x47b30e[_0xdcc8('0xb')](function(_0x390f8c,_0x771c05){if(_0x390f8c){_0x350afb[_0xdcc8('0x5')]('error',new AGIError(_0xdcc8('0xc'),_0x390f8c));}else if(_0x33ec37&&_0x33ec37<0x0){_0x350afb[_0xdcc8('0x5')]('error',new AGIError(_0xdcc8('0xd')));_0x1612ad[_0xdcc8('0xe')]();}else if(_0x33ec37&&_0x33ec37>0x0&&_0x33ec37<_0x771c05){_0x44e0b0+=0x1;_0x350afb[_0xdcc8('0x5')](_0xdcc8('0xf'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x44e0b0));_0x1612ad[_0xdcc8('0xe')]();}else{var _0x446b5c=new AGIChannel(_0x1612ad);_0x446b5c['on']('ready',function(){_0x350afb[_0xdcc8('0x5')]('connection',_0x446b5c);});}});});_0x47b30e['on'](_0xdcc8('0xf'),function(_0x3dfd45){_0x350afb[_0xdcc8('0x5')](_0xdcc8('0xf'),new AGIError(_0xdcc8('0xc'),_0x3dfd45[_0xdcc8('0x10')]));});_0x47b30e['on'](_0xdcc8('0x11'),function(){_0x350afb['emit']('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process['nextTick'](function(){_0x237528();});};util['inherits'](AGIServer,EventEmitter);module[_0xdcc8('0x12')]=function(_0x4dff9b,_0xd07622,_0x249f47){return new AGIServer(_0x4dff9b,_0xd07622,_0x249f47);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 96c77d1..2b2c725 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 _0x6050=['createSmsMessage','createSquareDetailsReport','uniqueid','label','channel','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','google_tts_language','url','method','timeout','number','POST','PUT','toUpperCase','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','clear','includes','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth','noop','no\x20text\x20configured','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','no\x20list\x20selected','delay','add','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','%s/recordings/%s','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','condition','no\x20condition\x20configured','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','true','IFTIME\x20%s\x20%s','false','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','menu','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','getSound','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','%s_STATUS_MESSAGE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','sayNumber','sayPhonetic','sendMail','account_id','Smtp','\x22%s\x22\x20<%s>','user','bcc','subject','service','host','port','secure','authentication','pass','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','Enter\x20in\x20START\x20(%s)\x20block','yes','Skipped\x20Answer','subproject','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','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','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','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','path','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','/var/opt/motion2/server/files','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x6050,0x196));var _0x0605=function(_0x53a3ec,_0x2e58c5){_0x53a3ec=_0x53a3ec-0x0;var _0x9ec8bc=_0x6050[_0x53a3ec];return _0x9ec8bc;};'use strict';var fs=require('fs');var path=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var _=require(_0x0605('0x2'));var sh=require(_0x0605('0x3'));var odbc=require(_0x0605('0x4'))();var rs=require(_0x0605('0x5'));var moment=require('moment');var Mustache=require(_0x0605('0x6'));var rp=require(_0x0605('0x7'));var logger=require(_0x0605('0x8'))('agi');var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0x0605('0x9');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=['menu',_0x0605('0xa'),_0x0605('0xb')];var AGIVertices=function(_0xa08eca,_0x5bb96,_0x44fdd3){this['channel']=_0xa08eca;this[_0x0605('0xc')]=_0x5bb96;this[_0x0605('0xd')]=_0x44fdd3;};AGIVertices[_0x0605('0xe')][_0x0605('0xf')]=function(_0x203772,_0x409f0d){this[_0x0605('0xc')][_0x0605('0x10')](_0x203772)[_0x0605('0x11')](function(_0x434e62){_0x409f0d(null,_0x434e62?_0x434e62[_0x0605('0x12')]:![]);})[_0x0605('0x13')](function(_0x34c9e6){_0x409f0d(_0x34c9e6);});};AGIVertices[_0x0605('0xe')][_0x0605('0x14')]=function(_0x44e793,_0x169a70){this[_0x0605('0xc')][_0x0605('0x15')](_0x44e793)['then'](function(_0x2b4610){_0x169a70(null,_0x2b4610?_0x2b4610[_0x0605('0x12')]:![]);})[_0x0605('0x13')](function(_0x5ce56a){_0x169a70(_0x5ce56a);});};AGIVertices['prototype'][_0x0605('0x16')]=function(_0xd0996d,_0xa83443){this[_0x0605('0xc')][_0x0605('0x17')](_0xd0996d)[_0x0605('0x11')](function(_0x2b7b5a){_0xa83443(null,_0x2b7b5a?_0x2b7b5a[_0x0605('0x12')]:![]);})[_0x0605('0x13')](function(_0x40abb2){_0xa83443(_0x40abb2);});};AGIVertices[_0x0605('0xe')][_0x0605('0x18')]=function(_0x2e2204,_0x103952){this['rpc'][_0x0605('0x19')](_0x2e2204)[_0x0605('0x11')](function(_0x430f28){_0x103952(null,_0x430f28?_0x430f28[_0x0605('0x1a')]:![]);})[_0x0605('0x13')](function(_0x90b2e1){_0x103952(_0x90b2e1);});};AGIVertices[_0x0605('0xe')][_0x0605('0x1b')]=function(_0x226ef5,_0x5b0d44){this[_0x0605('0xc')]['getUserById'](_0x226ef5)[_0x0605('0x11')](function(_0x118e9c){_0x5b0d44(null,_0x118e9c?_0x118e9c[_0x0605('0x12')]:![]);})[_0x0605('0x13')](function(_0x10c575){_0x5b0d44(_0x10c575);});};AGIVertices[_0x0605('0xe')][_0x0605('0x1c')]=function(_0x1ae3db,_0x234231){this[_0x0605('0xc')][_0x0605('0x1d')](_0x1ae3db)[_0x0605('0x11')](function(_0x5a602e){_0x234231(null,_0x5a602e?_0x5a602e[_0x0605('0x12')]:![]);})[_0x0605('0x13')](function(_0x4b1e0c){_0x234231(_0x4b1e0c);});};AGIVertices['prototype']['getSound']=function(_0x33558f,_0x226825){var _0x4163cd=this;this[_0x0605('0xc')][_0x0605('0x1e')](_0x33558f)[_0x0605('0x11')](function(_0x4e32ef){_0x226825(null,_0x4e32ef?_0x4163cd[_0x0605('0x1f')](_0x4e32ef['save_name']):![]);})[_0x0605('0x13')](function(_0x3640b9){_0x226825(_0x3640b9);});};AGIVertices[_0x0605('0xe')][_0x0605('0x20')]=function(_0x1f65aa,_0x352dd6){this['rpc'][_0x0605('0x21')](_0x1f65aa)[_0x0605('0x11')](function(_0x2764b6){_0x352dd6(null,_0x2764b6?_0x2764b6:![]);})[_0x0605('0x13')](function(_0x25d397){_0x352dd6(_0x25d397);});};AGIVertices[_0x0605('0xe')][_0x0605('0x22')]=function(_0x362551,_0x2f69ad,_0x5905c0){this[_0x0605('0xd')][_0x0605('0x22')](_0x362551,_0x2f69ad)[_0x0605('0x11')](function(){_0x5905c0(null);})[_0x0605('0x13')](function(_0x4be5f8){_0x5905c0(_0x4be5f8);});};AGIVertices[_0x0605('0xe')][_0x0605('0x23')]=function(_0x36307a,_0x1637ba){this[_0x0605('0xc')][_0x0605('0x24')](_0x36307a)[_0x0605('0x11')](function(_0x32a979){if(_0x32a979){if(_0x32a979[_0x0605('0x25')]){_0x1637ba(null,[_0x32a979[_0x0605('0x26')]]);}else{_0x1637ba(null,_[_0x0605('0x27')](_0x32a979[_0x0605('0x28')],'interval'));}}else{_0x1637ba(null,![]);}})[_0x0605('0x13')](function(_0x111298){_0x1637ba(_0x111298);});};AGIVertices['prototype'][_0x0605('0x1f')]=function(_0x128428){return util['format'](_0x0605('0x29'),FILES_PATH,_0x128428);};AGIVertices[_0x0605('0xe')][_0x0605('0x2a')]=function(_0x23a094,_0x31cb08,_0x17cd94){odbc['open'](_0x23a094,function(_0x5c2862){if(_0x5c2862){logger[_0x0605('0x2b')](_0x0605('0x2c'),_0x5c2862);_0x17cd94(_0x5c2862);}else{logger[_0x0605('0x2d')]('ODBC\x20connection\x20successfully');odbc[_0x0605('0x2e')](_0x31cb08,function(_0x4d8f39,_0xbb1eeb){if(_0x4d8f39){logger[_0x0605('0x2d')](_0x0605('0x2f'),_0x31cb08);_0x17cd94(_0x4d8f39);}else{logger[_0x0605('0x2d')](_0x0605('0x30'),_0x31cb08);odbc[_0x0605('0x31')](function(_0x88c0ae){if(_0x88c0ae){logger[_0x0605('0x2b')](_0x0605('0x32'),_0x88c0ae);}_0x17cd94(null,_0xbb1eeb);});}});}});};AGIVertices[_0x0605('0xe')]['getSmsAccount']=function(_0x3aa844,_0x56796e){this[_0x0605('0xc')][_0x0605('0x33')](_0x3aa844)[_0x0605('0x11')](function(_0x479c55){_0x56796e(null,_0x479c55?_0x479c55:![]);})['catch'](function(_0xeaab8){_0x56796e(_0xeaab8);});};AGIVertices['prototype'][_0x0605('0x34')]=function(_0x52f4b6,_0xef54f1){this[_0x0605('0xc')][_0x0605('0x34')](_0x52f4b6)[_0x0605('0x11')](function(_0x279404){_0xef54f1(null,_0x279404);})[_0x0605('0x13')](function(_0x3fa553){_0xef54f1(_0x3fa553);});};AGIVertices[_0x0605('0xe')][_0x0605('0x35')]=function(_0x3616a3,_0x44d912,_0x58a698){this['rpc'][_0x0605('0x35')]({'uniqueid':this['channel'][_0x0605('0x36')],'node':_0x3616a3[_0x0605('0x37')],'application':_0x3616a3['agicommand'],'data':_0x44d912||null,'project_name':this[_0x0605('0x38')][_0x0605('0x39')],'callerid':this['channel'][_0x0605('0x3a')]})[_0x0605('0x11')](function(_0x573dba){if(_0x58a698){_0x58a698(null,_0x573dba);}})[_0x0605('0x13')](function(_0x118d04){if(_0x58a698){_0x58a698(_0x118d04);}});};AGIVertices['prototype'][_0x0605('0x3b')]=function(_0x5e278f,_0x5df8d1,_0x1fa208,_0x468a3e){this[_0x0605('0xc')][_0x0605('0x3b')]({'uniqueid':this[_0x0605('0x38')][_0x0605('0x36')],'callerid':this[_0x0605('0x38')][_0x0605('0x3a')],'calleridname':this['channel'][_0x0605('0x3c')],'context':this[_0x0605('0x38')][_0x0605('0x3d')],'extension':this['channel'][_0x0605('0x3e')],'priority':this[_0x0605('0x38')][_0x0605('0x3f')],'accountcode':this[_0x0605('0x38')][_0x0605('0x40')],'dnid':this[_0x0605('0x38')][_0x0605('0x41')],'projectName':this[_0x0605('0x38')][_0x0605('0x39')],'saveName':_0x5df8d1,'filename':_0x5e278f['file']||_0x5df8d1,'savePath':_0x1fa208})[_0x0605('0x11')](function(_0x97805d){_0x468a3e(null,_0x97805d);})[_0x0605('0x13')](function(_0x389bb6){_0x468a3e(_0x389bb6);});};AGIVertices[_0x0605('0xe')][_0x0605('0x42')]=function(_0x18995e,_0x3c903c,_0x2e3319,_0x17ff8e,_0x4c03cf){this['rpc']['createSquareMessage']({'uniqueid':this[_0x0605('0x38')][_0x0605('0x36')],'body':_0x18995e,'direction':_0x3c903c,'providerName':_0x2e3319,'providerResponse':_0x17ff8e})[_0x0605('0x11')](function(_0x30140e){if(_0x4c03cf){_0x4c03cf(null,_0x30140e);}})[_0x0605('0x13')](function(_0x203fe9){if(_0x4c03cf){_0x4c03cf(_0x203fe9);}});};AGIVertices['prototype'][_0x0605('0x43')]=function(_0x286485,_0x184232){this[_0x0605('0xc')]['createCmContact']({'firstName':_[_0x0605('0x44')](_0x286485[_0x0605('0x12')])||_[_0x0605('0x45')](_0x286485['name'])?'callback_'+Math[_0x0605('0x46')]():_0x286485[_0x0605('0x12')],'lastName':_[_0x0605('0x44')](_0x286485['lastName'])||_['isNil'](_0x286485[_0x0605('0x47')])?null:_0x286485['lastName'],'phone':_0x286485[_0x0605('0x48')],'ListId':_0x286485[_0x0605('0x49')],'scheduledat':_0x286485[_0x0605('0x4a')],'callbackUniqueid':this[_0x0605('0x38')][_0x0605('0x36')],'tags':_0x0605('0x4b'),'description':_0x0605('0x4c')+_0x286485['scheduledAt'][_0x0605('0x4d')](),'priority':_0x286485['callback_priority']})[_0x0605('0x11')](function(_0x529600){_0x184232(null,_0x529600);})[_0x0605('0x13')](function(_0x322fcf){_0x184232(_0x322fcf);});};AGIVertices[_0x0605('0xe')][_0x0605('0x4e')]=function(_0x48be2f,_0x553efc){this[_0x0605('0xc')][_0x0605('0x4f')](_0x48be2f)['then'](function(_0x51d295){_0x553efc(null,_0x51d295?_0x51d295['name']:![]);})[_0x0605('0x13')](function(_0x2b43cf){_0x553efc(_0x2b43cf);});};AGIVertices[_0x0605('0xe')][_0x0605('0x50')]=function(_0x3af2ad,_0x50220d,_0x491ff2){var _0x34f2e4={'role':_0x0605('0x51')};_0x34f2e4[_0x3af2ad]=this[_0x0605('0x38')][_0x0605('0x3a')];this[_0x0605('0xc')][_0x0605('0x50')](_0x34f2e4,_0x50220d,this[_0x0605('0x38')][_0x0605('0x36')])['then'](function(_0x5d34d3){_0x491ff2(null,_['isNil'](_0x5d34d3)?![]:!![]);})[_0x0605('0x13')](function(_0x1799e2){logger[_0x0605('0x2b')](_0x1799e2);_0x491ff2(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x36fb25,_0x2227c9){var _0x8ae474={'role':_0x0605('0x51')};_0x8ae474[_0x36fb25]=this[_0x0605('0x38')][_0x0605('0x3a')];this[_0x0605('0xc')][_0x0605('0x52')](_0x8ae474)[_0x0605('0x11')](function(_0x1981a9){_0x2227c9(null,_[_0x0605('0x45')](_0x1981a9)?![]:!![]);})[_0x0605('0x13')](function(_0x5d4e9a){logger[_0x0605('0x2b')](_0x5d4e9a);_0x2227c9(null,![]);});};AGIVertices[_0x0605('0xe')][_0x0605('0x53')]=function(_0x37b35b,_0x47248d){var _0xe86cd3={'role':'agent'};_0xe86cd3[_0x37b35b]=this[_0x0605('0x38')]['callerid'];this['rpc'][_0x0605('0x53')](_0xe86cd3)[_0x0605('0x11')](function(_0x855868){_0x47248d(null,_[_0x0605('0x45')](_0x855868)?![]:!![]);})[_0x0605('0x13')](function(_0x13e6f4){logger[_0x0605('0x2b')](_0x13e6f4);_0x47248d(null,![]);});};AGIVertices[_0x0605('0xe')][_0x0605('0x54')]=function(_0x309da5,_0x53c460){var _0x4ea0f8={'role':'agent'};_0x4ea0f8[_0x309da5]=this['channel']['callerid'];var _0x439dab=_0x309da5!=_0x0605('0x55')?util[_0x0605('0x56')]('%s/%s@from-sip/n',_0x0605('0x57'),this[_0x0605('0x38')][_0x0605('0x3a')]):undefined;this[_0x0605('0xc')][_0x0605('0x54')](_0x4ea0f8,_0x439dab)[_0x0605('0x11')](function(_0x55cc8b){_0x53c460(null,_[_0x0605('0x45')](_0x55cc8b)?![]:!![]);})[_0x0605('0x13')](function(_0x38e202){logger['error'](_0x38e202);_0x53c460(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x3c4375,_0x393c0a){sh[_0x0605('0x58')](_[_0x0605('0x59')](_0x3c4375),function(_0x55d375,_0x4b6d10){var _0x37bc3c=_0x4b6d10[_0x0605('0x5a')](/(\r\n|\n|\r)/gm,'');_0x393c0a(null,_0x37bc3c);});};AGIVertices['prototype'][_0x0605('0x5b')]=function(_0x1ab06c,_0x29eca2){scripts[_0x0605('0x5b')](_0x1ab06c[_0x0605('0x5c')],_0x1ab06c[_0x0605('0x5d')]||_0x0605('0x5e'),_0x1ab06c[_0x0605('0x5e')],_0x1ab06c[_0x0605('0x5f')]||_0x0605('0x60'),_0x1ab06c[_0x0605('0x61')]||_0x0605('0x62'),_0x1ab06c[_0x0605('0x63')]||'MP3')['then'](function(_0x1d500c){_0x29eca2(null,_0x1d500c);})[_0x0605('0x13')](function(_0x1d3605){_0x29eca2(_0x1d3605);});};AGIVertices['prototype']['googleTTS']=function(_0x3fa92e,_0x5f21b2){scripts['googleTTS'](_0x3fa92e[_0x0605('0x5e')],_0x3fa92e[_0x0605('0x64')]||'en',0x1)[_0x0605('0x11')](function(_0x5eb6d3){_0x5f21b2(null,_0x5eb6d3);})['catch'](function(_0x54e147){_0x5f21b2(_0x54e147);});};AGIVertices[_0x0605('0xe')]['restAPI']=function(_0x8b4ffe,_0x854ca1){var _0x1429be={'uri':_0x8b4ffe[_0x0605('0x65')],'method':_0x8b4ffe[_0x0605('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x8b4ffe[_0x0605('0x67')])===_0x0605('0x68')&&parseInt(_0x8b4ffe[_0x0605('0x67')])>=0x1?parseInt(_0x8b4ffe['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0x0605('0x69'),_0x0605('0x6a')],_0x1429be['method'][_0x0605('0x6b')]())){try{_0x1429be['body']=_0x8b4ffe[_0x0605('0x6c')]?JSON[_0x0605('0x6d')](_0x8b4ffe['rawBody']):{};}catch(_0x36b7a5){logger['error'](_0x0605('0x6e'),_0x36b7a5);}}try{_0x1429be[_0x0605('0x6f')]=_0x8b4ffe[_0x0605('0x70')]?JSON[_0x0605('0x6d')](_0x8b4ffe['rawHeaders']):{};}catch(_0x18862a){logger[_0x0605('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x18862a);}if(_0x8b4ffe[_0x0605('0x71')]){try{var _0x3bbcc1=require(_0x8b4ffe[_0x0605('0x71')])[_0x0605('0x72')](this,_0x1429be);_0x1429be[_0x0605('0x73')]=Mustache[_0x0605('0x74')](_0x8b4ffe['url'],_0x3bbcc1,{},['$$','$$']);if(_0x1429be['headers']){_0x1429be[_0x0605('0x6f')]=JSON[_0x0605('0x6d')](Mustache[_0x0605('0x74')](JSON[_0x0605('0x75')](_0x1429be['headers']),_0x3bbcc1,{},['$$','$$']));}if(_0x1429be[_0x0605('0x76')]){_0x1429be[_0x0605('0x76')]=JSON[_0x0605('0x6d')](Mustache[_0x0605('0x74')](JSON[_0x0605('0x75')](_0x1429be[_0x0605('0x76')]),_0x3bbcc1,{},['$$','$$']));}}catch(_0x13baf4){logger['error'](_0x0605('0x77'),_0x13baf4);}}rp(_0x1429be)[_0x0605('0x11')](function(_0x317b94){var _0x1b19ab={'statusCode':_0x317b94['statusCode']||0xc8,'statusMessage':_0x317b94['statusMessage']||'OK','headers':_0x317b94[_0x0605('0x6f')]||{},'body':_0x317b94[_0x0605('0x76')]||{}};_0x854ca1(null,_0x1b19ab);})['catch'](function(_0x4763eb){var _0x503568={'statusCode':_0x4763eb['statusCode']||0x1f4,'statusMessage':_0x4763eb[_0x0605('0x78')]||_0x0605('0x79'),'headers':_0x4763eb[_0x0605('0x7a')]['headers']||{},'body':_0x4763eb[_0x0605('0x7a')][_0x0605('0x76')]||{}};_0x854ca1(null,_0x503568);});};AGIVertices[_0x0605('0xe')][_0x0605('0x7b')]=function(_0x40145b,_0x1b4abd){scripts[_0x0605('0x7b')](this[_0x0605('0x38')][_0x0605('0x36')],_0x40145b[_0x0605('0x7c')],_0x40145b[_0x0605('0x5e')],_0x40145b[_0x0605('0x7d')]||'en')[_0x0605('0x11')](function(_0xd26a54){_0x1b4abd(null,_0xd26a54);})[_0x0605('0x13')](function(_0x3de079){_0x1b4abd(_0x3de079);});};AGIVertices['prototype'][_0x0605('0x7e')]=function(_0x106da4,_0x2f9235){scripts[_0x0605('0x7e')](this[_0x0605('0x38')]['uniqueid'],_0x106da4[_0x0605('0x7f')],_0x106da4[_0x0605('0x80')],_0x106da4[_0x0605('0x81')],_0x106da4['text'],_0x106da4[_0x0605('0x82')]||'en')['then'](function(_0xe02b78){_0x2f9235(null,_0xe02b78);})['catch'](function(_0x52aafc){_0x2f9235(_0x52aafc);});};AGIVertices[_0x0605('0xe')]['sestekNDA']=function(_0x53a944,_0xf58bdf){scripts[_0x0605('0x83')](this[_0x0605('0x38')],_0x53a944)[_0x0605('0x11')](function(_0x13e60a){_0xf58bdf(null,_0x13e60a);})[_0x0605('0x13')](function(_0x23a5d8){_0xf58bdf(_0x23a5d8);});};AGIVertices['prototype'][_0x0605('0x84')]=function(_0xe989d1,_0x3ff76d){scripts['ispeechTTS'](_0xe989d1[_0x0605('0x7c')],_0xe989d1['text'],_0xe989d1[_0x0605('0x85')]||_0x0605('0x60'),_0xe989d1['speed'])[_0x0605('0x11')](function(_0x516b20){_0x3ff76d(null,_0x516b20);})['catch'](function(_0x2a1602){_0x3ff76d(_0x2a1602);});};AGIVertices[_0x0605('0xe')][_0x0605('0x86')]=function(_0x51a186,_0x428f06,_0x2e47d5){scripts[_0x0605('0x86')](_0x428f06,_0x51a186[_0x0605('0x7c')],_0x51a186[_0x0605('0x87')]||_0x0605('0x60'),this[_0x0605('0x88')](_0x51a186[_0x0605('0x89')])?_0x51a186[_0x0605('0x89')]:undefined)[_0x0605('0x11')](function(_0x4fd082){_0x2e47d5(null,_0x4fd082);})[_0x0605('0x13')](function(_0xd838f6){_0x2e47d5(_0xd838f6);});};AGIVertices[_0x0605('0xe')][_0x0605('0x8a')]=function(_0x42c1fa,_0x4dea54){scripts[_0x0605('0x8a')](_0x42c1fa['aws_access_key_id'],_0x42c1fa[_0x0605('0x8b')],_0x42c1fa[_0x0605('0x8c')],_0x42c1fa['aws_polly_voice']||_0x0605('0x8d'),_0x42c1fa[_0x0605('0x5e')],_0x42c1fa[_0x0605('0x8e')]||_0x0605('0x5e'))[_0x0605('0x11')](function(_0x1a31f7){_0x4dea54(null,_0x1a31f7);})[_0x0605('0x13')](function(_0x1165d3){_0x4dea54(_0x1165d3);});};AGIVertices['prototype'][_0x0605('0x8f')]=function(_0x5c6822,_0x1ccdbb){scripts[_0x0605('0x8f')](this[_0x0605('0x38')][_0x0605('0x36')],_0x5c6822[_0x0605('0x90')],_0x5c6822['aws_secret_access_key'],_0x5c6822[_0x0605('0x91')],_0x5c6822[_0x0605('0x5e')],_0x5c6822[_0x0605('0x92')])[_0x0605('0x11')](function(_0x3b7846){_0x1ccdbb(null,_0x3b7846);})[_0x0605('0x13')](function(_0x5dd9f3){_0x1ccdbb(_0x5dd9f3);});};AGIVertices[_0x0605('0xe')][_0x0605('0x93')]=function(_0x39e179,_0x26a089,_0xfbe941){scripts[_0x0605('0x93')](_0x26a089,_0x39e179[_0x0605('0x7c')],_0x39e179['google_asr_language']||_0x0605('0x60'))['then'](function(_0x139d90){_0xfbe941(null,_0x139d90);})[_0x0605('0x13')](function(_0x5adad8){_0xfbe941(_0x5adad8);});};AGIVertices[_0x0605('0xe')][_0x0605('0x94')]=function(_0x43cc45,_0x26c006,_0x31f09d){scripts[_0x0605('0x94')](_0x26c006,_0x43cc45['appid'],_0x43cc45['appsecret'],_0x43cc45[_0x0605('0x73')])['then'](function(_0x281bf6){_0x31f09d(null,_0x281bf6);})[_0x0605('0x13')](function(_0x326cb0){_0x31f09d(_0x326cb0);});};AGIVertices[_0x0605('0xe')][_0x0605('0x95')]=function(_0x401168){var _0x40f96b=_[_0x0605('0x96')](verticesWithRetry,_0x401168[_0x0605('0x97')])?_0x401168:_[_0x0605('0x98')](_0x401168);for(var _0x312545 in _0x40f96b){if(_0x40f96b[_0x0605('0x99')](_0x312545)){if(_0x40f96b[_0x312545]&&_[_0x0605('0x9a')](_0x40f96b[_0x312545])){if(_[_0x0605('0x96')](recursiveMapAttributes,_0x312545)){_0x40f96b[_0x312545]=this[_0x0605('0x9b')](_0x40f96b[_0x312545]);}else{_0x40f96b[_0x312545]=this[_0x0605('0x9c')](_0x40f96b[_0x312545]);}}}}return _0x40f96b;};AGIVertices[_0x0605('0xe')][_0x0605('0x9d')]=function(_0x1c1b61){for(var _0x5ec542 in _0x1c1b61){if(_0x1c1b61[_0x0605('0x99')](_0x5ec542)){if(_['isPlainObject'](_0x1c1b61[_0x5ec542])){this[_0x0605('0x9d')](_0x1c1b61[_0x5ec542]);}else if(_[_0x0605('0x9e')](_0x1c1b61[_0x5ec542])){for(var _0x47e010=0x0;_0x47e010<_0x1c1b61[_0x5ec542][_0x0605('0x9f')];_0x47e010++){this[_0x0605('0x9d')](_0x1c1b61[_0x5ec542][_0x47e010]);}}else if(_[_0x0605('0x9a')](_0x1c1b61[_0x5ec542])){_0x1c1b61[_0x5ec542]=this[_0x0605('0x9c')](_0x1c1b61[_0x5ec542]);}}}};AGIVertices[_0x0605('0xe')][_0x0605('0xa0')]=function(_0x14bcbf,_0x58b7ea){for(var _0x3e2034 in _0x14bcbf){if(_0x14bcbf[_0x0605('0x99')](_0x3e2034)){if(_['isPlainObject'](_0x14bcbf[_0x3e2034])){if(!_['isEmpty'](_0x14bcbf[_0x3e2034])){this[_0x0605('0xa0')](_0x14bcbf[_0x3e2034],util['format'](_0x0605('0xa1'),_0x58b7ea,_0x3e2034));}}else if(_['isArray'](_0x14bcbf[_0x3e2034])){for(var _0x460753=0x0;_0x460753<_0x14bcbf[_0x3e2034][_0x0605('0x9f')];_0x460753++){this['saveRestApiResult'](_0x14bcbf[_0x3e2034][_0x460753],util['format']('%s.%s',_0x58b7ea,_0x3e2034+'['+_0x460753+']'));}}else{if(!_[_0x0605('0x45')](_0x14bcbf[_0x3e2034])){this['channel'][_0x0605('0xa2')](util['format'](_0x0605('0xa1'),_0x58b7ea,_0x3e2034),_0x14bcbf[_0x3e2034]);}}}}};AGIVertices[_0x0605('0xe')][_0x0605('0x9b')]=function(_0x1bdcf5){try{var _0x5b2079=JSON[_0x0605('0x6d')](_0x1bdcf5);this[_0x0605('0x9d')](_0x5b2079);return JSON[_0x0605('0x75')](_0x5b2079);}catch(_0x5e9694){return this['replaceAllVariables'](_0x1bdcf5);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x155f6d){var _0x172640=_0x155f6d[_0x0605('0xa3')]('{');for(var _0x1b35db=0x1;_0x1b35db<_0x172640[_0x0605('0x9f')];_0x1b35db+=0x1){var _0x4288fc=_0x172640[_0x1b35db][_0x0605('0xa3')]('}');if(_0x4288fc[_0x0605('0x9f')]>0x1){_0x155f6d=_0x155f6d[_0x0605('0xa4')]('{'+_0x4288fc[0x0]+'}',this['channel'][_0x0605('0xf')](_0x4288fc[0x0])[_0x0605('0xa5')]||_0x4288fc[0x0]);}}if(_0x172640[_0x0605('0x9f')]===0x1){return _0x155f6d[_0x0605('0x4d')]();}return this['replaceAllVariables'](_0x155f6d);};AGIVertices[_0x0605('0xe')][_0x0605('0xa6')]=function(_0x4c0779,_0x2fd758){var _0x474895=this[_0x0605('0x38')]['getVariable'](_0x4c0779);if(_0x474895[_0x0605('0xa7')]===-0x1){return _0x474895;}logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0xa8'),_0x2fd758,_0x474895[_0x0605('0xa5')]));return this[_0x0605('0x38')][_0x0605('0xa2')](_0x2fd758,_0x474895[_0x0605('0xa5')]);};AGIVertices[_0x0605('0xe')][_0x0605('0x88')]=function(_0x3b3603){return _0x3b3603&&_0x3b3603!=='0'&&_0x3b3603!=='-1'&&_0x3b3603!=='';};AGIVertices['prototype']['maxRetry']=function(_0x2ad4f3){this[_0x0605('0x35')][_0x0605('0x72')](this,_0x2ad4f3,'-');_0x2ad4f3[_0x0605('0xa9')]=_0x2ad4f3[_0x0605('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0605('0xe')][_0x0605('0xab')]=function(_0x4b3f17){logger['info'](util[_0x0605('0x56')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x4b3f17[_0x0605('0x37')]));if(!this['isConfigured'](_0x4b3f17[_0x0605('0x5e')])){return this['channel'][_0x0605('0xac')](_0x0605('0xad'));}var _0x198b1c='\x22'+_0x4b3f17[_0x0605('0x5e')]+'\x22';if(this[_0x0605('0x88')](_0x4b3f17[_0x0605('0x7a')])){_0x198b1c+=','+_0x4b3f17[_0x0605('0x7a')];}var _0x30658e=this[_0x0605('0x38')]['exec']('MRCPSynth',_0x198b1c);if(_0x30658e[_0x0605('0xa7')]===-0x1){return _0x30658e;}return this[_0x0605('0x38')]['noop'](util[_0x0605('0x56')]('Executed\x20command\x20MRCPSynth\x20%s',_0x198b1c));};AGIVertices['prototype'][_0x0605('0xae')]=function(_0x16a71f){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0xaf'),_0x16a71f[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x16a71f[_0x0605('0xb0')])){return this['channel'][_0x0605('0xac')]('no\x20grammar\x20configured');}var _0x3d6240=_0x16a71f[_0x0605('0xb0')];if(this[_0x0605('0x88')](_0x16a71f[_0x0605('0x7a')])){_0x3d6240+=','+_0x16a71f[_0x0605('0x7a')];}var _0x2e2158=this[_0x0605('0x38')][_0x0605('0x58')]('MRCPRecog',_0x3d6240);if(_0x2e2158[_0x0605('0xa7')]===-0x1){return _0x2e2158;}var _0x11ce66=this['getAndSetVariable'](_0x0605('0xb1'),'MRCP_RECOG_CONFIDENCE');if(_0x11ce66[_0x0605('0xa7')]===-0x1){return _0x11ce66;}var _0x3feb42=this[_0x0605('0xa6')](_0x0605('0xb2'),_0x0605('0xb3'));if(_0x3feb42['result']===-0x1){return _0x3feb42;}var _0x1f91c1=this[_0x0605('0xa6')](_0x0605('0xb4'),'MRCP_RECOG_INSTANCE');if(_0x1f91c1[_0x0605('0xa7')]===-0x1){return _0x1f91c1;}return this['channel'][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0xb5'),_0x3d6240));};AGIVertices[_0x0605('0xe')][_0x0605('0xb6')]=function(_0x200dd2){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0xb7'),_0x200dd2[_0x0605('0x37')]));return this[_0x0605('0x38')][_0x0605('0xb6')]([_0x200dd2[_0x0605('0xb8')],_0x200dd2[_0x0605('0xb9')]]);};AGIVertices[_0x0605('0xe')]['answer']=function(_0x2df0e0){logger['info'](util[_0x0605('0x56')](_0x0605('0xba'),_0x2df0e0[_0x0605('0x37')]));if(this['isConfigured'](_0x2df0e0['timeout'])){logger['info'](util[_0x0605('0x56')](_0x0605('0xbb'),_0x2df0e0['timeout']));var _0x1c5803=this[_0x0605('0x38')][_0x0605('0xbc')](_0x2df0e0[_0x0605('0x67')]);if(_0x1c5803[_0x0605('0xa7')]===-0x1){return _0x1c5803;}}return this[_0x0605('0x38')][_0x0605('0xbd')]();};AGIVertices[_0x0605('0xe')][_0x0605('0x4b')]=function(_0x43e691){logger[_0x0605('0x2d')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x43e691['label']));if(!this['isConfigured'](_0x43e691[_0x0605('0x49')])){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x43e691,_0x0605('0xbe'));}_0x43e691[_0x0605('0x4a')]=moment();if(this[_0x0605('0x88')](_0x43e691[_0x0605('0xbf')])){_0x43e691['scheduledAt']=moment()[_0x0605('0xc0')](_0x43e691['delay'],'minutes');}if(!this[_0x0605('0x88')](_0x43e691[_0x0605('0xc1')])){_0x43e691[_0x0605('0xc1')]=0x2;}this[_0x0605('0x43')][_0x0605('0x72')](this,_0x43e691);return this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0xc2'),_0x43e691[_0x0605('0x48')],_0x43e691[_0x0605('0x49')],_0x43e691[_0x0605('0x4a')]));};AGIVertices[_0x0605('0xe')][_0x0605('0xc3')]=function(_0x234d1d){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0xc4'),_0x234d1d[_0x0605('0x37')]));var _0x569f19=this['channel'][_0x0605('0x58')](_0x234d1d['application'],_0x234d1d[_0x0605('0x7a')]);if(_0x569f19['result']===-0x1){return _0x569f19;}return this['channel']['noop'](util['format'](_0x0605('0xc5'),_0x234d1d[_0x0605('0xc6')],_0x234d1d[_0x0605('0x7a')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x4cb973){logger['info'](util[_0x0605('0x56')](_0x0605('0xc7'),_0x4cb973[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x4cb973['text'])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0xad'));}var _0x37b45d='\x22'+_0x4cb973[_0x0605('0x5e')]+'\x22';if(this[_0x0605('0x88')](_0x4cb973[_0x0605('0x7a')])){_0x37b45d+=','+_0x4cb973[_0x0605('0x7a')];}var _0x284b38=this[_0x0605('0x38')][_0x0605('0x58')](_0x0605('0xc8'),_0x37b45d);if(_0x284b38[_0x0605('0xa7')]===-0x1){return _0x284b38;}return this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')]('Executed\x20command\x20MRCPSynth\x20%s',_0x37b45d));};AGIVertices[_0x0605('0xe')][_0x0605('0xc9')]=function(_0x59607a){logger[_0x0605('0x2d')](util['format'](_0x0605('0xca'),_0x59607a[_0x0605('0x37')]));if(!this['isConfigured'](_0x59607a['text'])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0xad'));}var _0x501fa3='\x22'+_0x59607a['text']+'\x22';if(this[_0x0605('0x88')](_0x59607a[_0x0605('0x7a')])){_0x501fa3+=','+_0x59607a['options'];}var _0x32e95c=this[_0x0605('0x38')][_0x0605('0x58')](_0x0605('0xc8'),_0x501fa3);if(_0x32e95c[_0x0605('0xa7')]===-0x1){return _0x32e95c;}return this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0xcb'),_0x501fa3));};AGIVertices[_0x0605('0xe')][_0x0605('0xcc')]=function(_0x3fa16a){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0xcd'),_0x3fa16a[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x3fa16a['grammar'])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0xce'));}var _0x8281b5=_0x3fa16a[_0x0605('0xb0')];if(this[_0x0605('0x88')](_0x3fa16a[_0x0605('0x7a')])){_0x8281b5+=','+_0x3fa16a[_0x0605('0x7a')];}var _0x2a513a=this[_0x0605('0x38')][_0x0605('0x58')](_0x0605('0xcf'),_0x8281b5);if(_0x2a513a[_0x0605('0xa7')]===-0x1){return _0x2a513a;}var _0xafa39=this[_0x0605('0xa6')](_0x0605('0xb1'),_0x0605('0xd0'));if(_0xafa39[_0x0605('0xa7')]===-0x1){return _0xafa39;}var _0x471ea9=this[_0x0605('0xa6')](_0x0605('0xb2'),_0x0605('0xd1'));if(_0x471ea9[_0x0605('0xa7')]===-0x1){return _0x471ea9;}var _0x20b587=this[_0x0605('0xa6')](_0x0605('0xb4'),_0x0605('0xd2'));if(_0x20b587['result']===-0x1){return _0x20b587;}return this['channel'][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0xb5'),_0x8281b5));};AGIVertices[_0x0605('0xe')][_0x0605('0xd3')]=function(_0x5c78b1){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0xd4'),_0x5c78b1[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x5c78b1[_0x0605('0xb0')])){return this[_0x0605('0x38')][_0x0605('0xac')]('no\x20grammar\x20configured');}var _0x1a67a7=_0x5c78b1[_0x0605('0xb0')];if(this[_0x0605('0x88')](_0x5c78b1[_0x0605('0x7a')])){_0x1a67a7+=','+_0x5c78b1[_0x0605('0x7a')];}var _0x58ef11=this[_0x0605('0x38')][_0x0605('0x58')]('MRCPRecog',_0x1a67a7);if(_0x58ef11[_0x0605('0xa7')]===-0x1){return _0x58ef11;}var _0x49cc16=this[_0x0605('0xa6')](_0x0605('0xb1'),_0x0605('0xd5'));if(_0x49cc16['result']===-0x1){return _0x49cc16;}var _0x18c12c=this[_0x0605('0xa6')]('RECOG_INPUT()',_0x0605('0xd6'));if(_0x18c12c[_0x0605('0xa7')]===-0x1){return _0x18c12c;}var _0xeaa71d=this[_0x0605('0xa6')](_0x0605('0xb4'),_0x0605('0xd7'));if(_0xeaa71d[_0x0605('0xa7')]===-0x1){return _0xeaa71d;}return this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0xb5'),_0x1a67a7));};AGIVertices[_0x0605('0xe')][_0x0605('0xd8')]=function(_0x5c9d68){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x5c9d68['label']));if(!this['isConfigured'](_0x5c9d68[_0x0605('0xd9')])){return this['channel'][_0x0605('0x2b')](_0x5c9d68,_0x0605('0xda'));}var _0x3c0e01=this[_0x0605('0x18')][_0x0605('0x72')](this,_0x5c9d68[_0x0605('0xd9')]);if(!_0x3c0e01){return this[_0x0605('0x38')]['error'](_0x5c9d68,_0x0605('0xdb'));}if(!this[_0x0605('0x88')](_0x5c9d68['query'])){return this['channel'][_0x0605('0x2b')](_0x5c9d68,_0x0605('0xdc'));}var _0x465cf5=_0x5c9d68[_0x0605('0x2e')][_0x0605('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0605('0x38')]['noop'](util[_0x0605('0x56')]('query:\x20%s',_0x465cf5));var _0x403e0b=this[_0x0605('0x2a')][_0x0605('0x72')](this,_0x3c0e01,_0x465cf5);this[_0x0605('0x35')][_0x0605('0x72')](this,_0x5c9d68,_0x465cf5);if(!this[_0x0605('0x88')](_0x5c9d68[_0x0605('0xdd')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0xde'));}var _0x35b99b=this[_0x0605('0xf')][_0x0605('0x72')](this,_0x5c9d68['variable_id']);if(!_0x35b99b){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x5c9d68,_0x0605('0xdf'));}var _0x3b1f6a=this;_0x403e0b[_0x0605('0xe0')](function(_0x4bc1f7,_0x2f7bee){Object[_0x0605('0xe1')](_0x4bc1f7)[_0x0605('0xe0')](function(_0x1c3eea){_0x3b1f6a[_0x0605('0x38')][_0x0605('0xa2')](util[_0x0605('0x56')](_0x0605('0xe2'),_0x35b99b,_0x2f7bee,_0x1c3eea),_0x4bc1f7[_0x1c3eea]);});});this[_0x0605('0x38')]['setVariable'](util[_0x0605('0x56')](_0x0605('0xe3'),_0x35b99b),_0x403e0b[_0x0605('0x9f')]);return this['channel'][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0xe4'),_0x35b99b));};AGIVertices['prototype'][_0x0605('0xe5')]=function(_0x441583){logger[_0x0605('0xe6')](util[_0x0605('0x56')](_0x0605('0xe7'),_0x441583[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x441583['sip_id'])){return this[_0x0605('0x38')]['error'](_0x441583,_0x0605('0xe8'));}var _0x47d7d8=this[_0x0605('0x1b')]['sync'](this,_0x441583[_0x0605('0xe9')]);if(!_0x47d7d8){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x441583,_0x0605('0xea'));}var _0x4091b6=this[_0x0605('0x38')][_0x0605('0x58')](_0x0605('0xeb'),[util[_0x0605('0x56')](_0x0605('0xec'),_0x47d7d8),_0x441583[_0x0605('0x67')],_0x441583[_0x0605('0xed')],_0x441583[_0x0605('0x65')]]);if(_0x4091b6[_0x0605('0xa7')]===-0x1){return _0x4091b6;}return this[_0x0605('0x38')]['noop'](util[_0x0605('0x56')](_0x0605('0xee'),'DIAL'));};AGIVertices['prototype'][_0x0605('0xef')]=function(_0x25bf82){logger['info'](util[_0x0605('0x56')](_0x0605('0xf0'),_0x25bf82[_0x0605('0x37')]));if(!this['isConfigured'](_0x25bf82[_0x0605('0x7c')])){return this[_0x0605('0x38')][_0x0605('0xac')]('no\x20key\x20configured');}if(!this[_0x0605('0x88')](_0x25bf82[_0x0605('0x5e')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0xad'));}this[_0x0605('0x38')][_0x0605('0xf1')]=!![];this['createSquareDetailsReport'](_0x25bf82);this[_0x0605('0x42')](_0x25bf82['text'],'in','','');this[_0x0605('0x38')]['noop'](util[_0x0605('0x56')](_0x0605('0xf2'),_0x25bf82[_0x0605('0x5e')]));var _0x493022=this[_0x0605('0x7b')]['sync'](this,_0x25bf82);if(_0x493022){for(var _0x22f17f in _0x493022){if(_0x493022['hasOwnProperty'](_0x22f17f)){this[_0x0605('0x38')][_0x0605('0xa2')](util[_0x0605('0x56')](_0x0605('0xf3'),_0x22f17f[_0x0605('0x6b')]()),_0x493022[_0x22f17f]);}}this[_0x0605('0x42')](_0x493022[_0x0605('0xf4')],_0x0605('0xf5'),'dialogflow','');return this[_0x0605('0x38')]['noop'](util[_0x0605('0x56')](_0x0605('0xf6'),_0x493022[_0x0605('0xf4')]));}return this[_0x0605('0x38')]['error'](_0x25bf82,_0x0605('0xf7'));};AGIVertices[_0x0605('0xe')]['dialogflowV2']=function(_0x373704){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0xf8'),_0x373704[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x373704[_0x0605('0x7f')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0xf9'));}if(!this['isConfigured'](_0x373704[_0x0605('0x80')])){return this['channel']['noop']('no\x20client_email\x20configured');}if(!this[_0x0605('0x88')](_0x373704[_0x0605('0x81')])){return this['channel'][_0x0605('0xac')](_0x0605('0xfa'));}if(!this[_0x0605('0x88')](_0x373704[_0x0605('0x82')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0xfb'));}if(!this[_0x0605('0x88')](_0x373704[_0x0605('0x5e')])){return this[_0x0605('0x38')]['noop'](_0x0605('0xad'));}this['channel'][_0x0605('0xf1')]=!![];this['createSquareDetailsReport'](_0x373704);this[_0x0605('0x42')](_0x373704[_0x0605('0x5e')],'in','','');this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0xfc'),_0x373704[_0x0605('0x5e')]));var _0x460158=this['googleDialogflowV2'][_0x0605('0x72')](this,_0x373704);if(_0x460158){for(var _0x543c0b in _0x460158){if(_0x460158['hasOwnProperty'](_0x543c0b)){if(_0x543c0b!==_0x0605('0xfd')){this['channel'][_0x0605('0xa2')](util[_0x0605('0x56')](_0x0605('0xf3'),_0x543c0b['toUpperCase']()),_0x460158[_0x543c0b]);}}}this[_0x0605('0x42')](_0x460158[_0x0605('0xf4')],_0x0605('0xf5'),_0x0605('0xfe'),_0x460158['providerResponse']);return this['channel'][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0xff'),_0x460158['speech']));}return this[_0x0605('0x38')][_0x0605('0x2b')](_0x373704,_0x0605('0x100'));};AGIVertices['prototype'][_0x0605('0x101')]=function(_0x1bc426){logger['info'](util[_0x0605('0x56')](_0x0605('0x102'),_0x1bc426[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x1bc426[_0x0605('0x103')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x104'));}if(!this['isConfigured'](_0x1bc426[_0x0605('0x105')])){return this[_0x0605('0x38')][_0x0605('0xac')]('no\x20username\x20configured');}if(!this[_0x0605('0x88')](_0x1bc426[_0x0605('0x106')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x107'));}if(!this['isConfigured'](_0x1bc426[_0x0605('0x108')])){return this[_0x0605('0x38')]['noop'](_0x0605('0xad'));}this['channel']['bot']=!![];this[_0x0605('0x35')](_0x1bc426);this[_0x0605('0x42')](_0x1bc426[_0x0605('0x5e')],'in','','');this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x109'),_0x1bc426[_0x0605('0x5e')]));var _0xe1ea2c=this['sestekNDA'][_0x0605('0x72')](this,_0x1bc426);if(_0xe1ea2c){for(var _0x480171 in _0xe1ea2c){if(_0xe1ea2c['hasOwnProperty'](_0x480171)){this[_0x0605('0x38')]['setVariable'](util[_0x0605('0x56')](_0x0605('0x10a'),_0x480171[_0x0605('0x6b')]()),_0xe1ea2c[_0x480171]);}}this[_0x0605('0x42')](_0xe1ea2c[_0x0605('0xf4')],_0x0605('0xf5'),_0x0605('0x101'),'');if(_0xe1ea2c[_0x0605('0x10b')]){this[_0x0605('0x38')][_0x0605('0xac')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0xe1ea2c[_0x0605('0x10b')]));var _0x1f39e6=this[_0x0605('0x38')]['streamFile'](_0xe1ea2c[_0x0605('0x10b')]);try{fs[_0x0605('0x10c')](_0xe1ea2c[_0x0605('0x10b')]+'.wav');}catch(_0x1fee37){logger[_0x0605('0x2b')](_0x1fee37);}return _0x1f39e6;}else{return this['channel']['noop'](util[_0x0605('0x56')](_0x0605('0x10d'),_0xe1ea2c[_0x0605('0xf4')]));}}return this[_0x0605('0x38')]['error'](_0x1bc426,_0x0605('0x10e'));};AGIVertices[_0x0605('0xe')][_0x0605('0x10f')]=function(_0xc368fc){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20END\x20(%s)\x20block',_0xc368fc[_0x0605('0x37')]));return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x10f'));};AGIVertices[_0x0605('0xe')][_0x0605('0x110')]=function(_0x38db15){logger['info'](util[_0x0605('0x56')](_0x0605('0x111'),_0x38db15[_0x0605('0x37')]));var _0x3681b1='';if(_0x38db15[_0x0605('0x112')]){if(!this['isConfigured'](_0x38db15[_0x0605('0x112')])){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x38db15,_0x0605('0x113'));}else{var _0x191719=parseInt(_0x38db15[_0x0605('0x112')],0xa);if(isNaN(_0x191719)){_0x3681b1=_0x38db15[_0x0605('0x112')];}else{_0x3681b1=this[_0x0605('0x1c')]['sync'](this,_0x38db15[_0x0605('0x112')]);if(!_0x3681b1){return this['channel']['error'](_0x38db15,_0x0605('0x114'));}}}}else if(_0x38db15[_0x0605('0x115')]){_0x3681b1=_0x38db15[_0x0605('0x115')];}else{return this['channel'][_0x0605('0x2b')](_0x38db15,_0x0605('0x113'));}var _0xc19a34=this[_0x0605('0x38')]['exec'](_0x0605('0xeb'),[util[_0x0605('0x56')](_0x0605('0x116'),_0x3681b1,_0x38db15[_0x0605('0x48')]),_0x38db15[_0x0605('0x67')],_0x38db15[_0x0605('0xed')],_0x38db15['url']]);if(_0xc19a34[_0x0605('0xa7')]===-0x1){return _0xc19a34;}return this[_0x0605('0x38')][_0x0605('0xac')](util['format']('Executed\x20command\x20%s',_0x0605('0xeb')));};AGIVertices[_0x0605('0xe')][_0x0605('0x117')]=function(_0x51ffab){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x118'),_0x51ffab[_0x0605('0x37')]));return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x117'));};AGIVertices[_0x0605('0xe')]['getdigits']=function(_0x4b048c){logger[_0x0605('0x2d')](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4b048c[_0x0605('0x37')]));if(_0x4b048c[_0x0605('0xa9')]===0x0){return this[_0x0605('0xaa')](_0x4b048c);}_0x4b048c[_0x0605('0xa9')]-=0x1;if(!this['isConfigured'](_0x4b048c[_0x0605('0x119')])){return this['channel']['error'](_0x4b048c,_0x0605('0x11a'));}var _0x142937=this['getSound'][_0x0605('0x72')](this,_0x4b048c[_0x0605('0x119')]);if(!_0x142937){return this[_0x0605('0x38')]['error'](_0x4b048c,_0x0605('0x11b'));}if(!this[_0x0605('0x88')](_0x4b048c['variable_id'])){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x0605('0xde'));}var _0x51651a=this['channel'][_0x0605('0x11c')](_0x142937,_0x4b048c[_0x0605('0x11d')],_0x4b048c[_0x0605('0x11e')]);var _0xc22903=_0x51651a[_0x0605('0xa7')]?_0x51651a[_0x0605('0xa7')][_0x0605('0x4d')]():'';logger[_0x0605('0x2d')](_0x0605('0x11f'),JSON[_0x0605('0x75')](_0x51651a));if(_0x51651a[_0x0605('0xa7')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x4b048c,_0xc22903);return _0x51651a;}else if(_0x51651a[_0x0605('0xa5')]==='timeout'){_0x51651a[_0x0605('0xa7')]=_0xc22903['length']>=parseInt(_0x4b048c['mindigit'])?'x':'i';}else{_0x51651a[_0x0605('0xa7')]=_0xc22903[_0x0605('0x9f')]>=parseInt(_0x4b048c[_0x0605('0x120')])&&_0xc22903[_0x0605('0x9f')]<=parseInt(_0x4b048c[_0x0605('0x11e')])?'x':'i';}var _0x8e150f=this[_0x0605('0xf')][_0x0605('0x72')](this,_0x4b048c[_0x0605('0xdd')]);if(!_0x8e150f){return this[_0x0605('0x38')]['error'](_0x4b048c,'no\x20variable\x20found');}this['channel'][_0x0605('0xa2')](_0x8e150f,_0xc22903);if(this[_0x0605('0x88')](_0x4b048c[_0x0605('0x121')])){var _0x2bfd53=parseInt(_0x4b048c[_0x0605('0x121')],0xa);var _0x3dd22f=rs[_0x0605('0x122')]({'charset':'*','length':_0x2bfd53});var _0x422c74=_0xc22903[_0x0605('0x9f')];if(_0x422c74>0x0){if(_0x422c74>_0x2bfd53){this[_0x0605('0x35')][_0x0605('0x72')](this,_0x4b048c,_0x4b048c[_0x0605('0x123')]==='first'?_0x3dd22f+_0xc22903['substr'](_0x2bfd53):_0xc22903[_0x0605('0x124')](0x0,_0x422c74-_0x2bfd53)+_0x3dd22f);}else{this[_0x0605('0x35')][_0x0605('0x72')](this,_0x4b048c,rs[_0x0605('0x122')]({'charset':'*','length':_0x422c74}));}}else{this[_0x0605('0x35')][_0x0605('0x72')](this,_0x4b048c,'');}}else{this[_0x0605('0x35')][_0x0605('0x72')](this,_0x4b048c,_0xc22903);}return _0x51651a;};AGIVertices[_0x0605('0xe')][_0x0605('0xb')]=function(_0x52cd55){logger[_0x0605('0x2d')](util['format'](_0x0605('0x125'),_0x52cd55['label']));return this['getdigits'](_0x52cd55);};AGIVertices[_0x0605('0xe')][_0x0605('0x126')]=function(_0x1010e8){logger['info'](util[_0x0605('0x56')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x1010e8[_0x0605('0x37')]));this[_0x0605('0x35')][_0x0605('0x72')](this,_0x1010e8,_0x1010e8[_0x0605('0x127')]);return this['channel'][_0x0605('0xac')](util[_0x0605('0x56')]('GOAL\x20%s',_0x1010e8[_0x0605('0x127')]));};AGIVertices[_0x0605('0xe')]['awspolly']=function(_0x106b3c){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x106b3c['label']));if(!this[_0x0605('0x88')](_0x106b3c[_0x0605('0x90')])||!this[_0x0605('0x88')](_0x106b3c[_0x0605('0x8b')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x128'));}if(!this['isConfigured'](_0x106b3c[_0x0605('0x5e')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0xad'));}this['channel'][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x129'),_0x106b3c[_0x0605('0x5e')]));var _0x336f7b=this[_0x0605('0x8a')][_0x0605('0x72')](this,_0x106b3c);if(_0x336f7b){this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x12a'),_0x336f7b));var _0x1d4f2f=this[_0x0605('0x38')][_0x0605('0x12b')](_0x336f7b);try{fs[_0x0605('0x10c')](_0x336f7b+_0x0605('0x12c'));}catch(_0x4cc796){logger[_0x0605('0x2b')](_0x4cc796);}return _0x1d4f2f;}return this[_0x0605('0x38')][_0x0605('0x2b')](_0x106b3c,_0x0605('0x12d'));};AGIVertices[_0x0605('0xe')][_0x0605('0x12e')]=function(_0x419320){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x12f'),_0x419320[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x419320[_0x0605('0x90')])||!this[_0x0605('0x88')](_0x419320['aws_secret_access_key'])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x128'));}if(!this[_0x0605('0x88')](_0x419320[_0x0605('0x92')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x130'));}if(!this[_0x0605('0x88')](_0x419320[_0x0605('0x5e')])){return this['channel'][_0x0605('0xac')](_0x0605('0xad'));}this[_0x0605('0x38')][_0x0605('0xf1')]=!![];this[_0x0605('0x35')](_0x419320);this[_0x0605('0x42')](_0x419320['text'],'in','','');this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x131'),_0x419320['text']));var _0x18c34c=this['awsLex'][_0x0605('0x72')](this,_0x419320);if(_0x18c34c){for(var _0x436160 in _0x18c34c){if(_0x18c34c['hasOwnProperty'](_0x436160)&&_[_0x0605('0x9a')](_0x18c34c[_0x436160])){this[_0x0605('0x38')][_0x0605('0xa2')](util[_0x0605('0x56')](_0x0605('0x132'),_0x436160['toUpperCase']()),_0x18c34c[_0x436160]);}}if(_[_0x0605('0x45')](_0x18c34c[_0x0605('0x78')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x133'));}else{this['createSquareMessage'](_0x18c34c[_0x0605('0x78')],_0x0605('0xf5'),'amazonlex','');return this['channel']['noop'](util[_0x0605('0x56')](_0x0605('0x134'),_0x18c34c[_0x0605('0x78')]));}}return this[_0x0605('0x38')][_0x0605('0x2b')](_0x419320,_0x0605('0x135'));};AGIVertices[_0x0605('0xe')][_0x0605('0x136')]=function(_0x427718){logger[_0x0605('0x2d')](util['format'](_0x0605('0x137'),_0x427718[_0x0605('0x37')],_0x427718['timeout']));if(!this[_0x0605('0x88')](_0x427718[_0x0605('0x7c')])){return this[_0x0605('0x38')]['noop'](_0x0605('0x138'));}var _0x4553c6=_0x0605('0x139');var _0x20aed6=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x26a05f=util[_0x0605('0x56')]('%s.%s',_0x20aed6,_0x4553c6);var _0x53800d=!![];if(_0x427718[_0x0605('0x13a')]===_0x0605('0x13b')){_0x53800d=![];}var _0x46bcc4=this[_0x0605('0x38')]['recordFile'](_0x20aed6,_0x4553c6,_0x427718[_0x0605('0x13c')],_0x427718['timeout'],undefined,_0x53800d);if(_0x46bcc4['result']!==-0x1){this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x13d'),_0x26a05f));var _0x380334=this[_0x0605('0x93')][_0x0605('0x72')](this,_0x427718,_0x26a05f);if(_0x380334){for(var _0x4b39a4 in _0x380334){if(_0x380334['hasOwnProperty'](_0x4b39a4)){this[_0x0605('0x38')][_0x0605('0xa2')](util[_0x0605('0x56')](_0x0605('0x13e'),_0x4b39a4[_0x0605('0x6b')]()),_0x380334[_0x4b39a4]);}}return this['channel'][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x13f'),JSON[_0x0605('0x75')](_0x380334)));}}return _0x46bcc4;};AGIVertices[_0x0605('0xe')][_0x0605('0x140')]=function(_0x29dd65){logger[_0x0605('0x2d')](util['format'](_0x0605('0x141'),_0x29dd65['label']));if(!this['isConfigured'](_0x29dd65['appid'])){return this[_0x0605('0x38')][_0x0605('0xac')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x29dd65['appsecret'])){return this['channel'][_0x0605('0xac')](_0x0605('0x142'));}var _0x4fbcf4=_0x0605('0x139');var _0x29f39e=util[_0x0605('0x56')](_0x0605('0x143'),FILES_PATH,rs[_0x0605('0x122')](0x4));var _0x44d39f=util[_0x0605('0x56')](_0x0605('0xa1'),_0x29f39e,_0x4fbcf4);var _0xd4f142=!![];if(_0x29dd65[_0x0605('0x13a')]==='NOBEEP'){_0xd4f142=![];}var _0xdbd8e4=this[_0x0605('0x38')][_0x0605('0x144')](_0x29f39e,_0x4fbcf4,_0x29dd65[_0x0605('0x13c')],_0x29dd65[_0x0605('0x67')],undefined,_0xd4f142);if(_0xdbd8e4['result']!==-0x1){this[_0x0605('0x38')][_0x0605('0xac')](util['format'](_0x0605('0x145'),_0x44d39f));var _0x2bd540=this[_0x0605('0x94')][_0x0605('0x72')](this,_0x29dd65,_0x44d39f);if(_0x2bd540){for(var _0x1b86aa in _0x2bd540){if(_0x2bd540[_0x0605('0x99')](_0x1b86aa)){this[_0x0605('0x38')][_0x0605('0xa2')](util[_0x0605('0x56')](_0x0605('0x146'),_0x1b86aa[_0x0605('0x6b')]()),_0x2bd540[_0x1b86aa]);}}return this[_0x0605('0x38')]['noop'](util[_0x0605('0x56')](_0x0605('0x147'),JSON[_0x0605('0x75')](_0x2bd540)));}}return _0xdbd8e4;};AGIVertices['prototype'][_0x0605('0x148')]=function(_0x5124db){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5124db[_0x0605('0x37')]));return this[_0x0605('0x38')][_0x0605('0x149')](_0x5124db[_0x0605('0x3d')],_0x5124db[_0x0605('0x3e')],_0x5124db[_0x0605('0x3f')]);};AGIVertices['prototype']['gotoif']=function(_0x560ed4){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x560ed4[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x560ed4[_0x0605('0x14a')])){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x560ed4,_0x0605('0x14b'));}try{var _0x40f1a2=eval(_0x560ed4[_0x0605('0x14a')])?'true':'false';this['channel'][_0x0605('0xac')](util[_0x0605('0x56')]('EVAL\x20CONDITION\x20%s\x20%s',_0x560ed4[_0x0605('0x14a')],_0x40f1a2));return{'code':0xc8,'result':_0x40f1a2};}catch(_0x2050d0){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x536ec3){logger['info'](util[_0x0605('0x56')](_0x0605('0x14c'),_0x536ec3[_0x0605('0x37')]));if(!this['isConfigured'](_0x536ec3[_0x0605('0x14d')])){return this[_0x0605('0x38')]['error'](_0x536ec3,'no\x20interval\x20configured');}var _0x53ce85=this[_0x0605('0x23')][_0x0605('0x72')](this,_0x536ec3[_0x0605('0x14d')]);if(!_0x53ce85){return this['channel'][_0x0605('0x2b')](_0x536ec3,_0x0605('0x14e'));}for(var _0x47f59b=0x0;_0x47f59b<_0x53ce85[_0x0605('0x9f')];_0x47f59b+=0x1){var _0x30e782=this['channel'][_0x0605('0xf')](util[_0x0605('0x56')]('IFTIME(%s?true:false)',_0x53ce85[_0x47f59b]));if(_0x30e782[_0x0605('0xa7')]===-0x1){return _0x30e782;}logger[_0x0605('0x2d')](util[_0x0605('0x56')]('IFTIME\x20%s\x20%s',_0x53ce85[_0x47f59b],_0x30e782[_0x0605('0xa5')]));if(_0x30e782[_0x0605('0xa5')]===_0x0605('0x14f')){logger[_0x0605('0x2d')](util['format'](_0x0605('0x150'),_0x53ce85[_0x47f59b],_0x0605('0x14f')));this['channel'][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x150'),_0x53ce85[_0x47f59b],_0x0605('0x14f')));return{'code':0xc8,'result':_0x0605('0x14f')};}else{logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x150'),_0x53ce85[_0x47f59b],_0x0605('0x151')));this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x150'),_0x53ce85[_0x47f59b],'false'));}}return{'code':0xc8,'result':_0x0605('0x151')};};AGIVertices[_0x0605('0xe')]['hangup']=function(_0x4a9854){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x152'),_0x4a9854[_0x0605('0x37')]));return this[_0x0605('0x38')][_0x0605('0x153')]();};AGIVertices[_0x0605('0xe')][_0x0605('0x154')]=function(_0x3623da){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x155'),_0x3623da[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x3623da[_0x0605('0x7c')])){return this[_0x0605('0x38')][_0x0605('0xac')]('no\x20key\x20configured');}var _0x44b9ca='wav';var _0x4bc2d1=util[_0x0605('0x56')](_0x0605('0x143'),FILES_PATH,rs[_0x0605('0x122')](0x4));var _0x578f67=util[_0x0605('0x56')](_0x0605('0xa1'),_0x4bc2d1,_0x44b9ca);var _0x4981e=!![];if(_0x3623da[_0x0605('0x13a')]==='NOBEEP'){_0x4981e=![];}var _0x523c09=this[_0x0605('0x38')][_0x0605('0x144')](_0x4bc2d1,_0x44b9ca,_0x3623da[_0x0605('0x13c')],_0x3623da[_0x0605('0x67')],undefined,_0x4981e);if(_0x523c09[_0x0605('0xa7')]!==-0x1){this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x156'),_0x578f67));var _0x1b4c43=this[_0x0605('0x86')][_0x0605('0x72')](this,_0x3623da,_0x578f67);if(_0x1b4c43){for(var _0x41e54c in _0x1b4c43){if(_0x1b4c43[_0x0605('0x99')](_0x41e54c)){this['channel'][_0x0605('0xa2')](util[_0x0605('0x56')](_0x0605('0x157'),_0x41e54c[_0x0605('0x6b')]()),_0x1b4c43[_0x41e54c]);}}return this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x158'),JSON[_0x0605('0x75')](_0x1b4c43)));}}return _0x523c09;};AGIVertices[_0x0605('0xe')][_0x0605('0x159')]=function(_0x6198a1){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x15a'),_0x6198a1[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x6198a1[_0x0605('0x7c')])){return this[_0x0605('0x38')][_0x0605('0xac')]('no\x20key\x20configured');}if(!this[_0x0605('0x88')](_0x6198a1[_0x0605('0x5e')])){return this[_0x0605('0x38')]['noop'](_0x0605('0xad'));}this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')]('Trying\x20ispeech\x20TTS\x20%s',_0x6198a1['text']));var _0x432af8=this[_0x0605('0x84')][_0x0605('0x72')](this,_0x6198a1);if(_0x432af8){this[_0x0605('0x38')][_0x0605('0xac')](util['format'](_0x0605('0x156'),_0x432af8));var _0x5de7a9=this['channel'][_0x0605('0x12b')](_0x432af8,_0x6198a1[_0x0605('0x13c')]);try{fs[_0x0605('0x10c')](_0x432af8+'.wav');}catch(_0x54baad){logger[_0x0605('0x2b')](_0x54baad);}return _0x5de7a9;}return this[_0x0605('0x38')][_0x0605('0x2b')](_0x6198a1,_0x0605('0x15b'));};AGIVertices[_0x0605('0xe')][_0x0605('0x15c')]=function(_0x24250b){logger['info'](util[_0x0605('0x56')](_0x0605('0x15d'),_0x24250b[_0x0605('0x37')]));if(!this['isConfigured'](_0x24250b['findBy'])){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x24250b,_0x0605('0x15e'));}logger[_0x0605('0x2d')](util[_0x0605('0x56')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0605('0x38')][_0x0605('0x3a')],_0x24250b[_0x0605('0x15f')]));var _0x5e26f3=this[_0x0605('0x54')][_0x0605('0x72')](this,_0x24250b[_0x0605('0x15f')]);if(_0x5e26f3){logger['info'](util[_0x0605('0x56')](_0x0605('0x160'),this[_0x0605('0x38')]['callerid'],_0x24250b[_0x0605('0x15f')]));this[_0x0605('0x38')][_0x0605('0xac')](util['format'](_0x0605('0x160'),this[_0x0605('0x38')]['callerid'],_0x24250b[_0x0605('0x15f')]));return{'code':0xc8,'result':_0x0605('0x161')};}else{logger[_0x0605('0x2d')](util[_0x0605('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0605('0x38')][_0x0605('0x3a')],_0x24250b[_0x0605('0x15f')]));this['channel'][_0x0605('0xac')](util[_0x0605('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0605('0x38')][_0x0605('0x3a')],_0x24250b[_0x0605('0x15f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0605('0xe')][_0x0605('0x162')]=function(_0x2f9d25){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2f9d25['label']));if(!this[_0x0605('0x88')](_0x2f9d25[_0x0605('0x15f')])){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x2f9d25,'no\x20find\x20by\x20configured');}logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x163'),this[_0x0605('0x38')]['callerid'],_0x2f9d25['findBy']));var _0x22f616=this[_0x0605('0x53')][_0x0605('0x72')](this,_0x2f9d25[_0x0605('0x15f')]);if(_0x22f616){logger['info'](util['format'](_0x0605('0x160'),this['channel'][_0x0605('0x3a')],_0x2f9d25[_0x0605('0x15f')]));this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x160'),this[_0x0605('0x38')]['callerid'],_0x2f9d25[_0x0605('0x15f')]));return{'code':0xc8,'result':_0x0605('0x161')};}else{logger['info'](util['format'](_0x0605('0x164'),this[_0x0605('0x38')]['callerid'],_0x2f9d25[_0x0605('0x15f')]));this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0605('0x38')][_0x0605('0x3a')],_0x2f9d25[_0x0605('0x15f')]));return{'code':0xc8,'result':_0x0605('0x165')};}};AGIVertices[_0x0605('0xe')][_0x0605('0x166')]=function(_0x5dc9ff){logger['info'](util[_0x0605('0x56')](_0x0605('0x167'),_0x5dc9ff[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x5dc9ff[_0x0605('0x168')])){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x5dc9ff,_0x0605('0x169'));}this['channel'][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x16a'),_0x5dc9ff[_0x0605('0x168')]));var _0x54111c=eval(_0x5dc9ff[_0x0605('0x168')]);if(!this[_0x0605('0x88')](_0x5dc9ff[_0x0605('0xdd')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0xde'));}var _0x7a301b=this[_0x0605('0xf')][_0x0605('0x72')](this,_0x5dc9ff[_0x0605('0xdd')]);if(!_0x7a301b){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x5dc9ff,_0x0605('0xdf'));}if(_[_0x0605('0x9e')](_0x54111c)){var _0x11fae1=this;_0x54111c[_0x0605('0xe0')](function(_0x58445b,_0x2354a5){_0x11fae1[_0x0605('0x38')][_0x0605('0xa2')](util[_0x0605('0x56')](_0x0605('0x16b'),_0x7a301b,_0x2354a5),_0x58445b);});return this[_0x0605('0x38')][_0x0605('0xac')](util['format']('variable\x20%s[key]\x20set',_0x7a301b));}else{return this[_0x0605('0x38')][_0x0605('0xa2')](_0x7a301b,_0x54111c);}};AGIVertices['prototype'][_0x0605('0x16c')]=function(_0x1e876d){logger['info'](util[_0x0605('0x56')](_0x0605('0x16d'),_0x1e876d[_0x0605('0x37')]));if(_0x1e876d['retry']===0x0){return this['maxRetry'](_0x1e876d);}_0x1e876d[_0x0605('0xa9')]-=0x1;if(!this[_0x0605('0x88')](_0x1e876d['file_id'])){return this[_0x0605('0x38')]['error'](_0x1e876d,_0x0605('0x11a'));}var _0x3eab28=this['getSound']['sync'](this,_0x1e876d[_0x0605('0x119')]);if(!_0x3eab28){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x1e876d,_0x0605('0x11b'));}var _0x18227e=this[_0x0605('0x38')][_0x0605('0x11c')](_0x3eab28,_0x1e876d[_0x0605('0x11d')],_0x1e876d['digit']);var _0x5301bc=_0x18227e['result'];if(_0x18227e[_0x0605('0xa7')]===-0x1){this[_0x0605('0x35')][_0x0605('0x72')](this,_0x1e876d,'-1');return _0x18227e;}else if(_0x18227e[_0x0605('0xa5')]===_0x0605('0x67')){_0x18227e[_0x0605('0xa7')]=_0x18227e[_0x0605('0xa7')][_0x0605('0x9f')]>0x0?_0x18227e[_0x0605('0xa7')]:'t';}else if(_[_0x0605('0x44')](_0x18227e[_0x0605('0xa7')])){_0x18227e[_0x0605('0xa7')]='#';_0x5301bc='#';}if(!this[_0x0605('0x88')](_0x1e876d[_0x0605('0xdd')])){this['channel'][_0x0605('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x471dde=this['getVariable'][_0x0605('0x72')](this,_0x1e876d[_0x0605('0xdd')]);if(!_0x471dde){return this[_0x0605('0x38')]['error'](_0x1e876d,_0x0605('0xdf'));}this['channel'][_0x0605('0xa2')](_0x471dde,_0x5301bc);}this[_0x0605('0x35')]['sync'](this,_0x1e876d,_0x5301bc);return _0x18227e;};AGIVertices[_0x0605('0xe')]['noop']=function(_0x48b7b3){logger['info'](util[_0x0605('0x56')](_0x0605('0x16e'),_0x48b7b3['label']));return this[_0x0605('0x38')][_0x0605('0xac')](_0x48b7b3[_0x0605('0x16f')]||_0x48b7b3['label']);};AGIVertices[_0x0605('0xe')][_0x0605('0x170')]=function(_0x39a382){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x39a382[_0x0605('0x37')]));if(!this['isConfigured'](_0x39a382[_0x0605('0x15f')])){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x39a382,_0x0605('0x15e'));}logger[_0x0605('0x2d')](util['format'](_0x0605('0x163'),this[_0x0605('0x38')][_0x0605('0x3a')],_0x39a382[_0x0605('0x15f')]));var _0x449879=this[_0x0605('0x4e')]['sync'](this,_0x39a382[_0x0605('0x171')]);var _0x714f15=this['agentPause'][_0x0605('0x72')](this,_0x39a382['findBy'],_0x449879);if(_0x714f15){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0605('0x38')][_0x0605('0x3a')],_0x39a382[_0x0605('0x15f')]));this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x160'),this[_0x0605('0x38')][_0x0605('0x3a')],_0x39a382[_0x0605('0x15f')]));return{'code':0xc8,'result':'success'};}else{logger[_0x0605('0x2d')](util[_0x0605('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x0605('0x3a')],_0x39a382[_0x0605('0x15f')]));this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x0605('0x3a')],_0x39a382[_0x0605('0x15f')]));return{'code':0xc8,'result':_0x0605('0x165')};}};AGIVertices['prototype'][_0x0605('0x172')]=function(_0x1beedd){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1beedd[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x1beedd['file_id'])){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x1beedd,'no\x20file\x20audio\x20selected');}var _0x4f0682=this[_0x0605('0x173')]['sync'](this,_0x1beedd[_0x0605('0x119')]);if(!_0x4f0682){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x1beedd,_0x0605('0x11b'));}var _0x363dc4=this[_0x0605('0x38')][_0x0605('0x58')]('PLAYBACK',[_0x4f0682,_0x1beedd[_0x0605('0xed')]]);if(_0x363dc4[_0x0605('0xa7')]===-0x1){return _0x363dc4;}return this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')]('Executed\x20command\x20%s\x20%s',_0x0605('0x174'),_0x4f0682));};AGIVertices[_0x0605('0xe')][_0x0605('0x175')]=function(_0x2a9710){logger['info'](util[_0x0605('0x56')](_0x0605('0x176'),_0x2a9710[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x2a9710[_0x0605('0x177')])){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x2a9710,_0x0605('0x178'));}var _0x272e30='';var _0x14f497=parseInt(_0x2a9710[_0x0605('0x177')],0xa);if(isNaN(_0x14f497)){_0x272e30=_0x2a9710[_0x0605('0x177')];}else{_0x272e30=this['getVoiceQueue'][_0x0605('0x72')](this,_0x2a9710[_0x0605('0x177')]);if(!_0x272e30){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x2a9710,'no\x20queue\x20found');}}var _0x320eff='';if(this[_0x0605('0x88')](_0x2a9710[_0x0605('0x119')])){var _0xaf1ad8=this[_0x0605('0x173')][_0x0605('0x72')](this,_0x2a9710[_0x0605('0x119')]);if(_0xaf1ad8){_0x320eff=_0xaf1ad8;}}this['createSquareDetailsReport']['sync'](this,_0x2a9710,_0x272e30);if(_0x2a9710['opts'][_0x0605('0x179')]('x')<0x0){_0x2a9710[_0x0605('0xed')]+='x';}if(_0x2a9710[_0x0605('0xed')][_0x0605('0x179')]('X')<0x0){_0x2a9710[_0x0605('0xed')]+='X';}this[_0x0605('0x38')][_0x0605('0xa2')](_0x0605('0x17a'),_0x272e30?_0x272e30[_0x0605('0x17b')]():'');var _0x5708a1=this['channel']['exec'](_0x0605('0x17c'),[_0x272e30,_0x2a9710[_0x0605('0xed')],_0x2a9710['url'],_0x320eff,_0x2a9710[_0x0605('0x67')],_0x2a9710[_0x0605('0xb6')],_0x2a9710[_0x0605('0x17d')],_0x2a9710['gosub'],'',_0x2a9710['position']]);if(_0x5708a1['result']===-0x1){return _0x5708a1;}return this['channel'][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0xc5'),_0x0605('0x17c'),_0x272e30));};AGIVertices[_0x0605('0xe')][_0x0605('0x17e')]=function(_0x1b3288){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x17f'),_0x1b3288[_0x0605('0x37')]));var _0x180ffd=_0x1b3288[_0x0605('0x180')]||_0x0605('0x139');var _0x5e022b=util[_0x0605('0x56')]('%s_%s',this['channel']['uniqueid'],rs[_0x0605('0x122')](0x5));var _0x1efb20=util['format'](_0x0605('0x181'),FILES_PATH,_0x5e022b,_0x180ffd);var _0x129583=util[_0x0605('0x56')](_0x0605('0x143'),FILES_PATH,_0x5e022b);this[_0x0605('0x3b')][_0x0605('0x72')](this,_0x1b3288,_0x5e022b,_0x1efb20);this[_0x0605('0x38')][_0x0605('0xa2')](_0x0605('0x182'),_0x5e022b);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x129583,_0x180ffd,_0x1b3288[_0x0605('0x183')],_0x1b3288[_0x0605('0x67')]);return this['channel'][_0x0605('0x144')](_0x129583,_0x180ffd,_0x1b3288[_0x0605('0x183')],_0x1b3288[_0x0605('0x67')],undefined,!![]);};AGIVertices['prototype'][_0x0605('0x184')]=function(_0x326060){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x326060[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x326060[_0x0605('0x65')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x185'));}var _0x314f4b=this['restAPI'][_0x0605('0x72')](this,_0x326060);logger[_0x0605('0x2d')](util['format']('Response:',util[_0x0605('0x186')](_0x314f4b,{'showHidden':![],'depth':null})));if(!this[_0x0605('0x88')](_0x326060[_0x0605('0xdd')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x187'));}var _0x4bf0fd=this[_0x0605('0xf')][_0x0605('0x72')](this,_0x326060[_0x0605('0xdd')]);if(!_0x4bf0fd){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x326060,_0x0605('0xdf'));}this[_0x0605('0x38')]['setVariable'](util[_0x0605('0x56')](_0x0605('0x188'),_0x4bf0fd),_0x314f4b['statusCode']?_0x314f4b[_0x0605('0x189')]:_0x0605('0x18a'));this['channel'][_0x0605('0xa2')](util[_0x0605('0x56')](_0x0605('0x18b'),_0x4bf0fd),_0x314f4b[_0x0605('0x18c')]?_0x314f4b[_0x0605('0x18c')]:'OK');if(_0x314f4b[_0x0605('0x76')]){try{this[_0x0605('0xa0')](_0x314f4b[_0x0605('0x76')],_0x4bf0fd);}catch(_0x3e9657){logger[_0x0605('0x2b')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x4bf0fd));}}return this[_0x0605('0x38')]['noop'](util[_0x0605('0x56')]('variable\x20%s\x20set',_0x4bf0fd));};AGIVertices['prototype'][_0x0605('0x18d')]=function(_0x143bfd){logger['info'](util[_0x0605('0x56')](_0x0605('0x18e'),_0x143bfd['label']));return this[_0x0605('0x38')]['sayDigits'](_0x143bfd[_0x0605('0x18f')][_0x0605('0x5a')](/\s+/g,''),_0x143bfd[_0x0605('0x183')]);};AGIVertices[_0x0605('0xe')][_0x0605('0x190')]=function(_0x4984b9){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4984b9[_0x0605('0x37')]));return this[_0x0605('0x38')][_0x0605('0x191')](_0x4984b9[_0x0605('0x68')][_0x0605('0x5a')](/\s+/g,''),_0x4984b9[_0x0605('0x183')]);};AGIVertices[_0x0605('0xe')]['sayphonetic']=function(_0x3bc707){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x3bc707['label']));return this[_0x0605('0x38')][_0x0605('0x192')](_0x3bc707['text'],_0x3bc707[_0x0605('0x183')]);};AGIVertices[_0x0605('0xe')][_0x0605('0x193')]=function(_0x33ccdd){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x33ccdd[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x33ccdd[_0x0605('0x194')])){return this[_0x0605('0x38')]['noop']('no\x20mail\x20account\x20configured');}var _0x543567=this[_0x0605('0x20')][_0x0605('0x72')](this,_0x33ccdd[_0x0605('0x194')]);if(!_0x543567||!_0x543567[_0x0605('0x195')]){return this['channel']['error'](_0x33ccdd,'no\x20mail\x20account\x20found');}var _0x3e05aa={'from':util[_0x0605('0x56')](_0x0605('0x196'),_0x543567['name'],_0x543567['email']||_0x543567[_0x0605('0x195')][_0x0605('0x197')]),'to':_0x33ccdd['to']||'','cc':_0x33ccdd['cc']||'','bcc':_0x33ccdd[_0x0605('0x198')]||'','subject':_0x33ccdd[_0x0605('0x199')],'html':_0x33ccdd[_0x0605('0x5e')],'text':_0x33ccdd[_0x0605('0x5e')]};var _0x83af19={'tls':{'rejectUnauthorized':![]}};if(_0x543567[_0x0605('0x195')][_0x0605('0x19a')]){_0x83af19[_0x0605('0x19a')]=_0x543567['Smtp'][_0x0605('0x19a')];}else{_0x83af19[_0x0605('0x19b')]=_0x543567[_0x0605('0x195')][_0x0605('0x19b')];_0x83af19[_0x0605('0x19c')]=_0x543567['Smtp']['port'];_0x83af19['secure']=_0x543567['Smtp'][_0x0605('0x19d')];}if(_0x543567['Smtp'][_0x0605('0x19e')]){_0x83af19['auth']={'user':_0x543567[_0x0605('0x195')][_0x0605('0x197')],'pass':_0x543567[_0x0605('0x195')][_0x0605('0x19f')]};}if(this['isConfigured'](_0x33ccdd['template_id'])){}logger['debug'](_0x0605('0x1a0'),JSON[_0x0605('0x75')](_0x3e05aa));this[_0x0605('0x35')][_0x0605('0x72')](this,_0x33ccdd,_0x33ccdd[_0x0605('0x194')]);this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x543567[_0x0605('0x12')]));this[_0x0605('0x22')][_0x0605('0x72')](this,_0x83af19,_0x3e05aa);return this[_0x0605('0x38')]['noop'](_0x0605('0x1a1'));};AGIVertices[_0x0605('0xe')]['sendFax']=function(_0x5ac3d4){logger[_0x0605('0x2d')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x5ac3d4['label']));return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x1a2'));};AGIVertices['prototype'][_0x0605('0x1a3')]=function(_0x57412e){logger[_0x0605('0x2d')](util['format'](_0x0605('0x1a4'),_0x57412e[_0x0605('0x37')]));if(!this['isConfigured'](_0x57412e[_0x0605('0x1a5')])){return this[_0x0605('0x38')][_0x0605('0xac')]('no\x20sms\x20account\x20configured');}var _0x5bdd15=this['getSmsAccount'][_0x0605('0x72')](this,_0x57412e[_0x0605('0x1a5')]);if(!_0x5bdd15){return this[_0x0605('0x38')][_0x0605('0x2b')](_0x57412e,'no\x20sms\x20account\x20found');}var _0x21d72c={'body':_0x57412e[_0x0605('0x1a6')],'phone':_0x57412e['to']||'','SmsAccountId':_0x5bdd15['id']};logger[_0x0605('0xe6')]('sendSMS\x20message',JSON[_0x0605('0x75')](_0x21d72c));this[_0x0605('0x35')]['sync'](this,_0x57412e,_0x57412e['sms_account_id']);this[_0x0605('0x38')][_0x0605('0xac')](util['format'](_0x0605('0x1a7'),_0x5bdd15['name']));this[_0x0605('0x34')][_0x0605('0x72')](this,_0x21d72c);return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0x1a8'));};AGIVertices['prototype'][_0x0605('0x1a9')]=function(_0x30d67c){logger[_0x0605('0x2d')](util['format'](_0x0605('0x1aa'),_0x30d67c['label']));if(!this[_0x0605('0x88')](_0x30d67c[_0x0605('0xdd')])){return this[_0x0605('0x38')]['error'](_0x30d67c,'no\x20variable\x20selected');}var _0x3754f6=this[_0x0605('0xf')][_0x0605('0x72')](this,_0x30d67c[_0x0605('0xdd')]);if(!_0x3754f6){return this[_0x0605('0x38')]['error'](_0x30d67c,'no\x20variable\x20found');}return this['channel'][_0x0605('0xa2')](_0x3754f6,_0x30d67c[_0x0605('0x1ab')]);};AGIVertices[_0x0605('0xe')]['start']=function(_0x3ffb09){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x1ac'),_0x3ffb09[_0x0605('0x37')]));this[_0x0605('0x38')]['noop']('START\x20CALLY\x20SQUARE');if(_0x3ffb09[_0x0605('0xbd')]===_0x0605('0x1ad')){this['channel'][_0x0605('0xac')]('Answer');return this['channel'][_0x0605('0xbd')]();}return this['channel'][_0x0605('0xac')](_0x0605('0x1ae'));};AGIVertices['prototype'][_0x0605('0x1af')]=function(_0xc3a94b){logger['info'](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0xc3a94b['label']));if(!this['isConfigured'](_0xc3a94b['project_id'])){return this[_0x0605('0x38')][_0x0605('0x2b')](_0xc3a94b,_0x0605('0x1b0'));}var _0x10e4d8=this['getSquareProject'][_0x0605('0x72')](this,_0xc3a94b['project_id']);if(!this['isConfigured'](_0x10e4d8)){return this[_0x0605('0x38')][_0x0605('0x2b')](_0xc3a94b,util[_0x0605('0x56')](_0x0605('0x1b1'),_0xc3a94b[_0x0605('0x1b2')]));}if(_0x10e4d8===this[_0x0605('0x38')][_0x0605('0x39')]){return this[_0x0605('0x38')][_0x0605('0x2b')](_0xc3a94b,_0x0605('0x1b3'));}this[_0x0605('0x35')]['sync'](this,_0xc3a94b,_0x10e4d8);var _0x33e84c=this['channel'][_0x0605('0x58')](_0x0605('0x1b4'),util[_0x0605('0x56')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x0605('0x19b')]||'127.0.0.1',_0x10e4d8,this[_0x0605('0x38')][_0x0605('0x39')]));if(_0x33e84c[_0x0605('0xa7')]===-0x1){return _0x33e84c;}return this['channel'][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0xc5'),_0x0605('0x1b4'),_0x10e4d8));};AGIVertices[_0x0605('0xe')]['system']=function(_0x13e766){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x1b5'),_0x13e766[_0x0605('0x37')]));var _0x661ca=this[_0x0605('0x1b6')][_0x0605('0x72')](this,_0x13e766[_0x0605('0xb8')]);this[_0x0605('0x35')][_0x0605('0x72')](this,_0x13e766,_0x13e766[_0x0605('0xb8')]);if(this[_0x0605('0x88')](_0x13e766['variable_id'])){var _0x5709d0=this[_0x0605('0xf')]['sync'](this,_0x13e766[_0x0605('0xdd')]);if(_0x5709d0){this[_0x0605('0x38')]['setVariable'](_0x5709d0,_0x661ca);return this[_0x0605('0x38')]['noop'](util[_0x0605('0x56')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x13e766['command'],_0x5709d0));}}return this[_0x0605('0x38')]['noop'](util['format'](_0x0605('0x1b7'),_0x13e766[_0x0605('0xb8')]));};AGIVertices[_0x0605('0xe')][_0x0605('0x1b8')]=function(_0x452142){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x1b9'),_0x452142[_0x0605('0x37')]));_0x452142['text']=_0x452142['text'][_0x0605('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x452142['apiKey'])){return this['channel'][_0x0605('0xac')](_0x0605('0x1ba'));}if(!this[_0x0605('0x88')](_0x452142[_0x0605('0x5e')])){return this[_0x0605('0x38')][_0x0605('0xac')]('no\x20text\x20configured');}this['channel'][_0x0605('0xac')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x452142[_0x0605('0x5e')]));var _0x18a78c=this[_0x0605('0x5b')][_0x0605('0x72')](this,_0x452142);if(_0x18a78c){this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x1bb'),_0x18a78c));var _0x40e593=this[_0x0605('0x38')][_0x0605('0x12b')](_0x18a78c);try{fs[_0x0605('0x10c')](_0x18a78c+_0x0605('0x12c'));}catch(_0xefbe4e){logger[_0x0605('0x2b')](_0xefbe4e);}return _0x40e593;}return this['channel'][_0x0605('0x2b')](_0x452142,_0x0605('0x1bc'));};AGIVertices[_0x0605('0xe')][_0x0605('0x1bd')]=function(_0xe0713e){logger[_0x0605('0x2d')](util[_0x0605('0x56')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0xe0713e[_0x0605('0x37')]));_0xe0713e['text']=_0xe0713e[_0x0605('0x5e')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0605('0x88')](_0xe0713e[_0x0605('0x5e')])){return this[_0x0605('0x38')][_0x0605('0xac')](_0x0605('0xad'));}this[_0x0605('0x38')]['noop'](util[_0x0605('0x56')](_0x0605('0x1be'),_0xe0713e[_0x0605('0x5e')]));var _0x20eade=this[_0x0605('0x1bf')][_0x0605('0x72')](this,_0xe0713e);if(_0x20eade){this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0x1c0'),_0x20eade));var _0xec0c9b=this['channel'][_0x0605('0x12b')](_0x20eade);try{fs['unlink'](_0x20eade+_0x0605('0x12c'));}catch(_0x535aec){logger[_0x0605('0x2b')](_0x535aec);}return _0xec0c9b;}return this[_0x0605('0x38')][_0x0605('0x2b')](_0xe0713e,_0x0605('0x1c1'));};AGIVertices[_0x0605('0xe')][_0x0605('0x1c2')]=function(_0x19cbbe){logger[_0x0605('0x2d')](util['format'](_0x0605('0x1c3'),_0x19cbbe[_0x0605('0x37')]));if(!this['isConfigured'](_0x19cbbe['findBy'])){return this['channel'][_0x0605('0x2b')](_0x19cbbe,_0x0605('0x15e'));}logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x163'),this[_0x0605('0x38')][_0x0605('0x3a')],_0x19cbbe[_0x0605('0x15f')]));var _0x1f9d14=this[_0x0605('0x52')]['sync'](this,_0x19cbbe['findBy']);if(_0x1f9d14){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x160'),this[_0x0605('0x38')]['callerid'],_0x19cbbe[_0x0605('0x15f')]));this[_0x0605('0x38')]['noop'](util[_0x0605('0x56')](_0x0605('0x160'),this['channel'][_0x0605('0x3a')],_0x19cbbe[_0x0605('0x15f')]));return{'code':0xc8,'result':_0x0605('0x161')};}else{logger[_0x0605('0x2d')](util['format'](_0x0605('0x164'),this['channel'][_0x0605('0x3a')],_0x19cbbe[_0x0605('0x15f')]));this[_0x0605('0x38')]['noop'](util[_0x0605('0x56')](_0x0605('0x164'),this[_0x0605('0x38')][_0x0605('0x3a')],_0x19cbbe[_0x0605('0x15f')]));return{'code':0xc8,'result':_0x0605('0x165')};}};AGIVertices[_0x0605('0xe')]['voicemail']=function(_0x3acc83){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x1c4'),_0x3acc83[_0x0605('0x37')]));var _0x28ad11=this[_0x0605('0x38')]['exec'](_0x0605('0x1c5'),[_0x3acc83[_0x0605('0x1c6')],_0x3acc83[_0x0605('0x7a')]]);if(_0x28ad11[_0x0605('0xa7')]===-0x1){return _0x28ad11;}return this[_0x0605('0x38')][_0x0605('0xac')](util[_0x0605('0x56')](_0x0605('0xc5'),_0x0605('0x1c5'),_0x3acc83['mailbox']));};AGIVertices['prototype'][_0x0605('0x1c7')]=function(_0x2b3953){logger[_0x0605('0x2d')](util[_0x0605('0x56')](_0x0605('0x1c8'),_0x2b3953[_0x0605('0x37')]));if(!this[_0x0605('0x88')](_0x2b3953['variable_id'])){return this[_0x0605('0x38')]['error'](_0x2b3953,_0x0605('0x1c9'));}var _0x1a9b4c=this[_0x0605('0xf')][_0x0605('0x72')](this,_0x2b3953[_0x0605('0xdd')]);if(!_0x1a9b4c){return this[_0x0605('0x38')]['error'](_0x2b3953,_0x0605('0xdf'));}var _0xe26b4c=this[_0x0605('0x38')]['getVariable'](_0x1a9b4c);return{'code':0xc8,'result':_0xe26b4c[_0x0605('0xa5')]?_0xe26b4c[_0x0605('0xa5')]:'-'};};String[_0x0605('0xe')][_0x0605('0xa4')]=function(_0x562fb7,_0x95a5a4){return this[_0x0605('0xa3')](_0x562fb7)['join'](_0x95a5a4);};module['exports']=AGIVertices; \ No newline at end of file +var _0x6657=['shellCommand','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','googleTTS','url','method','timeout','POST','toUpperCase','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','length','recursiveNodeIndex','isPlainObject','%s.%s','isArray','replaceObjectAllVariables','split','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','username','no\x20username\x20configured','ndassistant_url','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','%s/recordings/%s','tilde\x20%s\x20file\x20created','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','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','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','ispeech\x20TTS\x20is\x20unreachable','login','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','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','saveRestApiResult','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','escape_digits','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','path','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUserById','getTrunk','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','agentLogin'];(function(_0x2e86cb,_0x9d3b91){var _0x68c58=function(_0x4324e0){while(--_0x4324e0){_0x2e86cb['push'](_0x2e86cb['shift']());}};_0x68c58(++_0x9d3b91);}(_0x6657,0x17f));var _0x7665=function(_0x57e14f,_0x17f93c){_0x57e14f=_0x57e14f-0x0;var _0x39fce2=_0x6657[_0x57e14f];return _0x39fce2;};'use strict';var fs=require('fs');var path=require(_0x7665('0x0'));var util=require('util');var _=require(_0x7665('0x1'));var sh=require(_0x7665('0x2'));var odbc=require(_0x7665('0x3'))();var rs=require(_0x7665('0x4'));var moment=require('moment');var Mustache=require(_0x7665('0x5'));var rp=require(_0x7665('0x6'));var logger=require(_0x7665('0x7'))(_0x7665('0x8'));var config=require(_0x7665('0x9'));var scripts=require(_0x7665('0xa'));var FILES_PATH=_0x7665('0xb');var recursiveMapAttributes=[_0x7665('0xc'),'rawBody'];var verticesWithRetry=[_0x7665('0xd'),_0x7665('0xe'),_0x7665('0xf')];var AGIVertices=function(_0x37f647,_0x3e341b,_0x3f3a65){this[_0x7665('0x10')]=_0x37f647;this[_0x7665('0x11')]=_0x3e341b;this['mailRpc']=_0x3f3a65;};AGIVertices[_0x7665('0x12')][_0x7665('0x13')]=function(_0x28cae2,_0x520829){this[_0x7665('0x11')]['getVariableById'](_0x28cae2)[_0x7665('0x14')](function(_0x280c66){_0x520829(null,_0x280c66?_0x280c66['name']:![]);})[_0x7665('0x15')](function(_0x2e8dda){_0x520829(_0x2e8dda);});};AGIVertices['prototype'][_0x7665('0x16')]=function(_0x3ee33,_0x4e75c2){this[_0x7665('0x11')][_0x7665('0x17')](_0x3ee33)[_0x7665('0x14')](function(_0x3bc95e){_0x4e75c2(null,_0x3bc95e?_0x3bc95e[_0x7665('0x18')]:![]);})[_0x7665('0x15')](function(_0x308e5c){_0x4e75c2(_0x308e5c);});};AGIVertices[_0x7665('0x12')][_0x7665('0x19')]=function(_0x334ee6,_0x365469){this[_0x7665('0x11')][_0x7665('0x1a')](_0x334ee6)[_0x7665('0x14')](function(_0x2dab51){_0x365469(null,_0x2dab51?_0x2dab51[_0x7665('0x18')]:![]);})['catch'](function(_0x30dedb){_0x365469(_0x30dedb);});};AGIVertices[_0x7665('0x12')]['getSquareOdbc']=function(_0x32b37a,_0x2033a5){this[_0x7665('0x11')][_0x7665('0x1b')](_0x32b37a)['then'](function(_0x35ca0f){_0x2033a5(null,_0x35ca0f?_0x35ca0f[_0x7665('0x1c')]:![]);})[_0x7665('0x15')](function(_0x468c93){_0x2033a5(_0x468c93);});};AGIVertices[_0x7665('0x12')]['getUser']=function(_0x1292a0,_0x51d577){this[_0x7665('0x11')][_0x7665('0x1d')](_0x1292a0)['then'](function(_0x5652dd){_0x51d577(null,_0x5652dd?_0x5652dd[_0x7665('0x18')]:![]);})[_0x7665('0x15')](function(_0x4a9a25){_0x51d577(_0x4a9a25);});};AGIVertices[_0x7665('0x12')][_0x7665('0x1e')]=function(_0xcc4a89,_0x488d86){this['rpc']['getTrunkById'](_0xcc4a89)['then'](function(_0x2633d){_0x488d86(null,_0x2633d?_0x2633d[_0x7665('0x18')]:![]);})[_0x7665('0x15')](function(_0x5809e9){_0x488d86(_0x5809e9);});};AGIVertices[_0x7665('0x12')][_0x7665('0x1f')]=function(_0x50bfa5,_0x56b6e8){var _0x30bd99=this;this[_0x7665('0x11')][_0x7665('0x20')](_0x50bfa5)[_0x7665('0x14')](function(_0x240ee3){_0x56b6e8(null,_0x240ee3?_0x30bd99[_0x7665('0x21')](_0x240ee3['save_name']):![]);})[_0x7665('0x15')](function(_0x55d046){_0x56b6e8(_0x55d046);});};AGIVertices['prototype'][_0x7665('0x22')]=function(_0x7425af,_0x43797a){this[_0x7665('0x11')][_0x7665('0x23')](_0x7425af)[_0x7665('0x14')](function(_0x39c7a5){_0x43797a(null,_0x39c7a5?_0x39c7a5:![]);})[_0x7665('0x15')](function(_0x1dbc6b){_0x43797a(_0x1dbc6b);});};AGIVertices[_0x7665('0x12')][_0x7665('0x24')]=function(_0x3a3f27,_0x44463c,_0x3430a0){this[_0x7665('0x25')][_0x7665('0x24')](_0x3a3f27,_0x44463c)[_0x7665('0x14')](function(){_0x3430a0(null);})[_0x7665('0x15')](function(_0x446b8c){_0x3430a0(_0x446b8c);});};AGIVertices['prototype'][_0x7665('0x26')]=function(_0xd93b75,_0x15eb7b){this[_0x7665('0x11')][_0x7665('0x27')](_0xd93b75)[_0x7665('0x14')](function(_0x4da120){if(_0x4da120){if(_0x4da120[_0x7665('0x28')]){_0x15eb7b(null,[_0x4da120[_0x7665('0x29')]]);}else{_0x15eb7b(null,_[_0x7665('0x2a')](_0x4da120[_0x7665('0x2b')],_0x7665('0x29')));}}else{_0x15eb7b(null,![]);}})['catch'](function(_0x3a08a7){_0x15eb7b(_0x3a08a7);});};AGIVertices['prototype'][_0x7665('0x21')]=function(_0x539f24){return util[_0x7665('0x2c')](_0x7665('0x2d'),FILES_PATH,_0x539f24);};AGIVertices[_0x7665('0x12')][_0x7665('0x2e')]=function(_0x3eea5a,_0x3c0ef1,_0x48c1ed){odbc[_0x7665('0x2f')](_0x3eea5a,function(_0x3dfab1){if(_0x3dfab1){logger[_0x7665('0x30')](_0x7665('0x31'),_0x3dfab1);_0x48c1ed(_0x3dfab1);}else{logger['info'](_0x7665('0x32'));odbc[_0x7665('0x33')](_0x3c0ef1,function(_0x365c33,_0x2aae93){if(_0x365c33){logger[_0x7665('0x34')]('Error\x20executing\x20query\x20%s',_0x3c0ef1);_0x48c1ed(_0x365c33);}else{logger[_0x7665('0x34')](_0x7665('0x35'),_0x3c0ef1);odbc[_0x7665('0x36')](function(_0x12e605){if(_0x12e605){logger[_0x7665('0x30')](_0x7665('0x37'),_0x12e605);}_0x48c1ed(null,_0x2aae93);});}});}});};AGIVertices[_0x7665('0x12')][_0x7665('0x38')]=function(_0x42777b,_0x46ddcd){this['rpc']['getSmsAccountById'](_0x42777b)[_0x7665('0x14')](function(_0x3f20d6){_0x46ddcd(null,_0x3f20d6?_0x3f20d6:![]);})['catch'](function(_0x50c49c){_0x46ddcd(_0x50c49c);});};AGIVertices[_0x7665('0x12')][_0x7665('0x39')]=function(_0x4dfec7,_0x3e7ee2){this[_0x7665('0x11')][_0x7665('0x39')](_0x4dfec7)[_0x7665('0x14')](function(_0x3cb235){_0x3e7ee2(null,_0x3cb235);})[_0x7665('0x15')](function(_0x442847){_0x3e7ee2(_0x442847);});};AGIVertices[_0x7665('0x12')][_0x7665('0x3a')]=function(_0x30fe6b,_0xe56900,_0x132fd8){this[_0x7665('0x11')][_0x7665('0x3a')]({'uniqueid':this['channel'][_0x7665('0x3b')],'node':_0x30fe6b['label'],'application':_0x30fe6b[_0x7665('0x3c')],'data':_0xe56900||null,'project_name':this[_0x7665('0x10')][_0x7665('0x3d')],'callerid':this[_0x7665('0x10')][_0x7665('0x3e')]})['then'](function(_0x23e7f0){if(_0x132fd8){_0x132fd8(null,_0x23e7f0);}})[_0x7665('0x15')](function(_0x5dc646){if(_0x132fd8){_0x132fd8(_0x5dc646);}});};AGIVertices[_0x7665('0x12')]['createSquareRecording']=function(_0x40fd9a,_0x14a4bf,_0x1a1cd9,_0x503679){this['rpc'][_0x7665('0x3f')]({'uniqueid':this[_0x7665('0x10')]['uniqueid'],'callerid':this[_0x7665('0x10')][_0x7665('0x3e')],'calleridname':this[_0x7665('0x10')][_0x7665('0x40')],'context':this[_0x7665('0x10')][_0x7665('0x41')],'extension':this[_0x7665('0x10')][_0x7665('0x42')],'priority':this[_0x7665('0x10')][_0x7665('0x43')],'accountcode':this[_0x7665('0x10')]['accountcode'],'dnid':this[_0x7665('0x10')]['dnid'],'projectName':this[_0x7665('0x10')][_0x7665('0x3d')],'saveName':_0x14a4bf,'filename':_0x40fd9a[_0x7665('0x44')]||_0x14a4bf,'savePath':_0x1a1cd9})[_0x7665('0x14')](function(_0x543425){_0x503679(null,_0x543425);})[_0x7665('0x15')](function(_0x1d1667){_0x503679(_0x1d1667);});};AGIVertices[_0x7665('0x12')][_0x7665('0x45')]=function(_0x69912d,_0x532740,_0x322b43,_0x5044ac,_0x3b6d9d){this[_0x7665('0x11')]['createSquareMessage']({'uniqueid':this['channel'][_0x7665('0x3b')],'body':_0x69912d,'direction':_0x532740,'providerName':_0x322b43,'providerResponse':_0x5044ac})[_0x7665('0x14')](function(_0x4296c1){if(_0x3b6d9d){_0x3b6d9d(null,_0x4296c1);}})[_0x7665('0x15')](function(_0x5a9a49){if(_0x3b6d9d){_0x3b6d9d(_0x5a9a49);}});};AGIVertices['prototype'][_0x7665('0x46')]=function(_0x567c79,_0x9e40ea){this[_0x7665('0x11')][_0x7665('0x46')]({'firstName':_['isEmpty'](_0x567c79[_0x7665('0x18')])||_[_0x7665('0x47')](_0x567c79[_0x7665('0x18')])?_0x7665('0x48')+Math[_0x7665('0x49')]():_0x567c79[_0x7665('0x18')],'lastName':_[_0x7665('0x4a')](_0x567c79[_0x7665('0x4b')])||_[_0x7665('0x47')](_0x567c79[_0x7665('0x4b')])?null:_0x567c79[_0x7665('0x4b')],'phone':_0x567c79[_0x7665('0x4c')],'ListId':_0x567c79[_0x7665('0x4d')],'scheduledat':_0x567c79[_0x7665('0x4e')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x7665('0x4f'),'description':_0x7665('0x50')+_0x567c79['scheduledAt']['toString'](),'priority':_0x567c79['callback_priority']})[_0x7665('0x14')](function(_0x1be4da){_0x9e40ea(null,_0x1be4da);})[_0x7665('0x15')](function(_0x1078d9){_0x9e40ea(_0x1078d9);});};AGIVertices[_0x7665('0x12')][_0x7665('0x51')]=function(_0x36151b,_0x37210f){this[_0x7665('0x11')][_0x7665('0x52')](_0x36151b)['then'](function(_0x49513c){_0x37210f(null,_0x49513c?_0x49513c[_0x7665('0x18')]:![]);})[_0x7665('0x15')](function(_0x29f66d){_0x37210f(_0x29f66d);});};AGIVertices['prototype'][_0x7665('0x53')]=function(_0x56ee91,_0x17bbbe,_0xed47d0){var _0x3d056c={'role':_0x7665('0x54')};_0x3d056c[_0x56ee91]=this[_0x7665('0x10')][_0x7665('0x3e')];this[_0x7665('0x11')][_0x7665('0x53')](_0x3d056c,_0x17bbbe,this[_0x7665('0x10')][_0x7665('0x3b')])[_0x7665('0x14')](function(_0x486f24){_0xed47d0(null,_[_0x7665('0x47')](_0x486f24)?![]:!![]);})[_0x7665('0x15')](function(_0x3b092c){logger[_0x7665('0x30')](_0x3b092c);_0xed47d0(null,![]);});};AGIVertices[_0x7665('0x12')][_0x7665('0x55')]=function(_0x42932e,_0x478071){var _0x4ef2fc={'role':'agent'};_0x4ef2fc[_0x42932e]=this[_0x7665('0x10')][_0x7665('0x3e')];this[_0x7665('0x11')][_0x7665('0x55')](_0x4ef2fc)[_0x7665('0x14')](function(_0x26d40d){_0x478071(null,_['isNil'](_0x26d40d)?![]:!![]);})[_0x7665('0x15')](function(_0x38743a){logger[_0x7665('0x30')](_0x38743a);_0x478071(null,![]);});};AGIVertices[_0x7665('0x12')][_0x7665('0x56')]=function(_0x1fa8fa,_0x59c97b){var _0x345dbd={'role':_0x7665('0x54')};_0x345dbd[_0x1fa8fa]=this[_0x7665('0x10')][_0x7665('0x3e')];this['rpc'][_0x7665('0x56')](_0x345dbd)[_0x7665('0x14')](function(_0x3504e9){_0x59c97b(null,_[_0x7665('0x47')](_0x3504e9)?![]:!![]);})[_0x7665('0x15')](function(_0x4abf42){logger[_0x7665('0x30')](_0x4abf42);_0x59c97b(null,![]);});};AGIVertices[_0x7665('0x12')]['agentLogin']=function(_0x312983,_0x58c138){var _0x295197={'role':_0x7665('0x54')};_0x295197[_0x312983]=this['channel'][_0x7665('0x3e')];var _0x4d4b4b=_0x312983!='internal'?util[_0x7665('0x2c')](_0x7665('0x57'),'LOCAL',this['channel'][_0x7665('0x3e')]):undefined;this['rpc'][_0x7665('0x58')](_0x295197,_0x4d4b4b)[_0x7665('0x14')](function(_0x57098f){_0x58c138(null,_['isNil'](_0x57098f)?![]:!![]);})[_0x7665('0x15')](function(_0x44a6a0){logger[_0x7665('0x30')](_0x44a6a0);_0x58c138(null,![]);});};AGIVertices[_0x7665('0x12')][_0x7665('0x59')]=function(_0x52b675,_0x2ee258){sh['exec'](_[_0x7665('0x5a')](_0x52b675),function(_0x1f6b54,_0x269621){var _0x1ee8a6=_0x269621[_0x7665('0x5b')](/(\r\n|\n|\r)/gm,'');_0x2ee258(null,_0x1ee8a6);});};AGIVertices[_0x7665('0x12')][_0x7665('0x5c')]=function(_0x4ea88e,_0x561c2f){scripts[_0x7665('0x5c')](_0x4ea88e['apiKey'],_0x4ea88e[_0x7665('0x5d')]||'text',_0x4ea88e[_0x7665('0x5e')],_0x4ea88e[_0x7665('0x5f')]||_0x7665('0x60'),_0x4ea88e['ssmlGender']||_0x7665('0x61'),_0x4ea88e[_0x7665('0x62')]||'MP3')['then'](function(_0x2050be){_0x561c2f(null,_0x2050be);})[_0x7665('0x15')](function(_0x210b91){_0x561c2f(_0x210b91);});};AGIVertices[_0x7665('0x12')][_0x7665('0x63')]=function(_0x430dd0,_0xa8e489){scripts[_0x7665('0x63')](_0x430dd0['text'],_0x430dd0['google_tts_language']||'en',0x1)[_0x7665('0x14')](function(_0x2980b6){_0xa8e489(null,_0x2980b6);})['catch'](function(_0x276775){_0xa8e489(_0x276775);});};AGIVertices['prototype']['restAPI']=function(_0x1e7e7a,_0x1c9c70){var _0x3fd193={'uri':_0x1e7e7a[_0x7665('0x64')],'method':_0x1e7e7a[_0x7665('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1e7e7a['timeout'])==='number'&&parseInt(_0x1e7e7a['timeout'])>=0x1?parseInt(_0x1e7e7a[_0x7665('0x66')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x7665('0x67'),'PUT'],_0x3fd193[_0x7665('0x65')][_0x7665('0x68')]())){try{_0x3fd193[_0x7665('0x69')]=_0x1e7e7a[_0x7665('0x6a')]?JSON['parse'](_0x1e7e7a['rawBody']):{};}catch(_0x10b0df){logger[_0x7665('0x30')](_0x7665('0x6b'),_0x10b0df);}}try{_0x3fd193[_0x7665('0x6c')]=_0x1e7e7a[_0x7665('0xc')]?JSON[_0x7665('0x6d')](_0x1e7e7a[_0x7665('0xc')]):{};}catch(_0xcd5bbd){logger[_0x7665('0x30')](_0x7665('0x6e'),_0xcd5bbd);}if(_0x1e7e7a['computedVariables']){try{var _0x106908=require(_0x1e7e7a[_0x7665('0x6f')])['sync'](this,_0x3fd193);_0x3fd193[_0x7665('0x70')]=Mustache['render'](_0x1e7e7a['url'],_0x106908,{},['$$','$$']);if(_0x3fd193['headers']){_0x3fd193['headers']=JSON['parse'](Mustache[_0x7665('0x71')](JSON[_0x7665('0x72')](_0x3fd193['headers']),_0x106908,{},['$$','$$']));}if(_0x3fd193[_0x7665('0x69')]){_0x3fd193[_0x7665('0x69')]=JSON[_0x7665('0x6d')](Mustache[_0x7665('0x71')](JSON['stringify'](_0x3fd193[_0x7665('0x69')]),_0x106908,{},['$$','$$']));}}catch(_0x18beb0){logger['error'](_0x7665('0x73'),_0x18beb0);}}rp(_0x3fd193)[_0x7665('0x14')](function(_0x3b6cba){var _0x5de400={'statusCode':_0x3b6cba[_0x7665('0x74')]||0xc8,'statusMessage':_0x3b6cba['statusMessage']||'OK','headers':_0x3b6cba['headers']||{},'body':_0x3b6cba[_0x7665('0x69')]||{}};_0x1c9c70(null,_0x5de400);})[_0x7665('0x15')](function(_0x125011){var _0x78d2d0={'statusCode':_0x125011['statusCode']||0x1f4,'statusMessage':_0x125011[_0x7665('0x75')]||_0x7665('0x76'),'headers':_0x125011[_0x7665('0x77')][_0x7665('0x6c')]||{},'body':_0x125011[_0x7665('0x77')][_0x7665('0x69')]||{}};_0x1c9c70(null,_0x78d2d0);});};AGIVertices[_0x7665('0x12')][_0x7665('0x78')]=function(_0x297a94,_0x427c17){scripts[_0x7665('0x78')](this[_0x7665('0x10')][_0x7665('0x3b')],_0x297a94[_0x7665('0x79')],_0x297a94['text'],_0x297a94[_0x7665('0x7a')]||'en')[_0x7665('0x14')](function(_0x35ee78){_0x427c17(null,_0x35ee78);})[_0x7665('0x15')](function(_0x520307){_0x427c17(_0x520307);});};AGIVertices[_0x7665('0x12')][_0x7665('0x7b')]=function(_0x52108b,_0x3bb518){scripts[_0x7665('0x7b')](this['channel'][_0x7665('0x3b')],_0x52108b[_0x7665('0x7c')],_0x52108b[_0x7665('0x7d')],_0x52108b['private_key'],_0x52108b[_0x7665('0x5e')],_0x52108b[_0x7665('0x7e')]||'en')[_0x7665('0x14')](function(_0x1ccd21){_0x3bb518(null,_0x1ccd21);})['catch'](function(_0x2e1a9b){_0x3bb518(_0x2e1a9b);});};AGIVertices[_0x7665('0x12')]['sestekNDA']=function(_0x1b5099,_0x46ea84){scripts[_0x7665('0x7f')](this[_0x7665('0x10')],_0x1b5099)[_0x7665('0x14')](function(_0x5ee9a6){_0x46ea84(null,_0x5ee9a6);})[_0x7665('0x15')](function(_0x2a9601){_0x46ea84(_0x2a9601);});};AGIVertices[_0x7665('0x12')][_0x7665('0x80')]=function(_0x53c492,_0x616270){scripts['ispeechTTS'](_0x53c492[_0x7665('0x79')],_0x53c492['text'],_0x53c492[_0x7665('0x81')]||_0x7665('0x60'),_0x53c492[_0x7665('0x82')])[_0x7665('0x14')](function(_0x1986cf){_0x616270(null,_0x1986cf);})[_0x7665('0x15')](function(_0x2e6c4b){_0x616270(_0x2e6c4b);});};AGIVertices[_0x7665('0x12')][_0x7665('0x83')]=function(_0x15a17f,_0x22ab54,_0x1983bd){scripts[_0x7665('0x83')](_0x22ab54,_0x15a17f['key'],_0x15a17f[_0x7665('0x84')]||'en-US',this['isConfigured'](_0x15a17f[_0x7665('0x85')])?_0x15a17f[_0x7665('0x85')]:undefined)[_0x7665('0x14')](function(_0x2ac6a4){_0x1983bd(null,_0x2ac6a4);})[_0x7665('0x15')](function(_0x1e617f){_0x1983bd(_0x1e617f);});};AGIVertices[_0x7665('0x12')][_0x7665('0x86')]=function(_0x21af97,_0x4e65a5){scripts[_0x7665('0x86')](_0x21af97[_0x7665('0x87')],_0x21af97[_0x7665('0x88')],_0x21af97[_0x7665('0x89')],_0x21af97[_0x7665('0x8a')]||_0x7665('0x8b'),_0x21af97['text'],_0x21af97[_0x7665('0x8c')]||_0x7665('0x5e'))[_0x7665('0x14')](function(_0x3eff77){_0x4e65a5(null,_0x3eff77);})[_0x7665('0x15')](function(_0x3891b3){_0x4e65a5(_0x3891b3);});};AGIVertices['prototype'][_0x7665('0x8d')]=function(_0x6949dc,_0x165ddd){scripts[_0x7665('0x8d')](this[_0x7665('0x10')][_0x7665('0x3b')],_0x6949dc[_0x7665('0x87')],_0x6949dc[_0x7665('0x88')],_0x6949dc[_0x7665('0x8e')],_0x6949dc[_0x7665('0x5e')],_0x6949dc[_0x7665('0x8f')])['then'](function(_0x356786){_0x165ddd(null,_0x356786);})['catch'](function(_0x4797a2){_0x165ddd(_0x4797a2);});};AGIVertices[_0x7665('0x12')][_0x7665('0x90')]=function(_0x41b147,_0x3817e8,_0x2c4204){scripts[_0x7665('0x90')](_0x3817e8,_0x41b147[_0x7665('0x79')],_0x41b147[_0x7665('0x91')]||_0x7665('0x60'))[_0x7665('0x14')](function(_0x2c9e1d){_0x2c4204(null,_0x2c9e1d);})['catch'](function(_0x11d32f){_0x2c4204(_0x11d32f);});};AGIVertices[_0x7665('0x12')][_0x7665('0x92')]=function(_0x122602,_0x312c59,_0x589c98){scripts['tildeASR'](_0x312c59,_0x122602[_0x7665('0x93')],_0x122602['appsecret'],_0x122602[_0x7665('0x70')])[_0x7665('0x14')](function(_0x5a9413){_0x589c98(null,_0x5a9413);})[_0x7665('0x15')](function(_0x4507d0){_0x589c98(_0x4507d0);});};AGIVertices['prototype'][_0x7665('0x94')]=function(_0x275a1e){var _0x9c4ee5=_[_0x7665('0x95')](verticesWithRetry,_0x275a1e[_0x7665('0x3c')])?_0x275a1e:_[_0x7665('0x96')](_0x275a1e);for(var _0x4d5093 in _0x9c4ee5){if(_0x9c4ee5[_0x7665('0x97')](_0x4d5093)){if(_0x9c4ee5[_0x4d5093]&&_[_0x7665('0x98')](_0x9c4ee5[_0x4d5093])){if(_[_0x7665('0x95')](recursiveMapAttributes,_0x4d5093)){_0x9c4ee5[_0x4d5093]=this['replaceObjectAllVariables'](_0x9c4ee5[_0x4d5093]);}else{_0x9c4ee5[_0x4d5093]=this[_0x7665('0x99')](_0x9c4ee5[_0x4d5093]);}}}}return _0x9c4ee5;};AGIVertices[_0x7665('0x12')]['recursiveNodeIndex']=function(_0xf66c1c){for(var _0x182657 in _0xf66c1c){if(_0xf66c1c[_0x7665('0x97')](_0x182657)){if(_['isPlainObject'](_0xf66c1c[_0x182657])){this['recursiveNodeIndex'](_0xf66c1c[_0x182657]);}else if(_['isArray'](_0xf66c1c[_0x182657])){for(var _0x22284b=0x0;_0x22284b<_0xf66c1c[_0x182657][_0x7665('0x9a')];_0x22284b++){this[_0x7665('0x9b')](_0xf66c1c[_0x182657][_0x22284b]);}}else if(_[_0x7665('0x98')](_0xf66c1c[_0x182657])){_0xf66c1c[_0x182657]=this[_0x7665('0x99')](_0xf66c1c[_0x182657]);}}}};AGIVertices[_0x7665('0x12')]['saveRestApiResult']=function(_0x473fed,_0x411aa7){for(var _0x4e6e8d in _0x473fed){if(_0x473fed[_0x7665('0x97')](_0x4e6e8d)){if(_[_0x7665('0x9c')](_0x473fed[_0x4e6e8d])){if(!_['isEmpty'](_0x473fed[_0x4e6e8d])){this['saveRestApiResult'](_0x473fed[_0x4e6e8d],util[_0x7665('0x2c')](_0x7665('0x9d'),_0x411aa7,_0x4e6e8d));}}else if(_[_0x7665('0x9e')](_0x473fed[_0x4e6e8d])){for(var _0xd849a9=0x0;_0xd849a9<_0x473fed[_0x4e6e8d][_0x7665('0x9a')];_0xd849a9++){this['saveRestApiResult'](_0x473fed[_0x4e6e8d][_0xd849a9],util['format'](_0x7665('0x9d'),_0x411aa7,_0x4e6e8d+'['+_0xd849a9+']'));}}else{if(!_[_0x7665('0x47')](_0x473fed[_0x4e6e8d])){this[_0x7665('0x10')]['setVariable'](util[_0x7665('0x2c')](_0x7665('0x9d'),_0x411aa7,_0x4e6e8d),_0x473fed[_0x4e6e8d]);}}}}};AGIVertices[_0x7665('0x12')][_0x7665('0x9f')]=function(_0x940d64){try{var _0x5831af=JSON['parse'](_0x940d64);this[_0x7665('0x9b')](_0x5831af);return JSON['stringify'](_0x5831af);}catch(_0x42445b){return this[_0x7665('0x99')](_0x940d64);}};AGIVertices[_0x7665('0x12')][_0x7665('0x99')]=function(_0xd51507){var _0x5ca2e4=_0xd51507[_0x7665('0xa0')]('{');for(var _0x16022b=0x1;_0x16022b<_0x5ca2e4[_0x7665('0x9a')];_0x16022b+=0x1){var _0x34cb38=_0x5ca2e4[_0x16022b][_0x7665('0xa0')]('}');if(_0x34cb38[_0x7665('0x9a')]>0x1){_0xd51507=_0xd51507['replaceAll']('{'+_0x34cb38[0x0]+'}',this['channel']['getVariable'](_0x34cb38[0x0])[_0x7665('0xa1')]||_0x34cb38[0x0]);}}if(_0x5ca2e4[_0x7665('0x9a')]===0x1){return _0xd51507[_0x7665('0xa2')]();}return this[_0x7665('0x99')](_0xd51507);};AGIVertices[_0x7665('0x12')][_0x7665('0xa3')]=function(_0x57eac7,_0x46eccf){var _0x18f91e=this[_0x7665('0x10')][_0x7665('0x13')](_0x57eac7);if(_0x18f91e[_0x7665('0xa4')]===-0x1){return _0x18f91e;}logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0xa5'),_0x46eccf,_0x18f91e[_0x7665('0xa1')]));return this[_0x7665('0x10')][_0x7665('0xa6')](_0x46eccf,_0x18f91e[_0x7665('0xa1')]);};AGIVertices[_0x7665('0x12')][_0x7665('0xa7')]=function(_0xb859e6){return _0xb859e6&&_0xb859e6!=='0'&&_0xb859e6!=='-1'&&_0xb859e6!=='';};AGIVertices[_0x7665('0x12')][_0x7665('0xa8')]=function(_0x28742a){this['createSquareDetailsReport']['sync'](this,_0x28742a,'-');_0x28742a['retry']=_0x28742a['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x7665('0x12')][_0x7665('0xa9')]=function(_0x433c8c){logger[_0x7665('0x34')](util['format'](_0x7665('0xaa'),_0x433c8c[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x433c8c['text'])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xad'));}var _0x2fbc8a='\x22'+_0x433c8c[_0x7665('0x5e')]+'\x22';if(this[_0x7665('0xa7')](_0x433c8c[_0x7665('0x77')])){_0x2fbc8a+=','+_0x433c8c[_0x7665('0x77')];}var _0x4cb2b8=this['channel']['exec'](_0x7665('0xae'),_0x2fbc8a);if(_0x4cb2b8[_0x7665('0xa4')]===-0x1){return _0x4cb2b8;}return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0xaf'),_0x2fbc8a));};AGIVertices[_0x7665('0x12')][_0x7665('0xb0')]=function(_0x5930f5){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0xb1'),_0x5930f5[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x5930f5[_0x7665('0xb2')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xb3'));}var _0x20e02e=_0x5930f5[_0x7665('0xb2')];if(this['isConfigured'](_0x5930f5[_0x7665('0x77')])){_0x20e02e+=','+_0x5930f5[_0x7665('0x77')];}var _0xc7a4f3=this[_0x7665('0x10')]['exec'](_0x7665('0xb4'),_0x20e02e);if(_0xc7a4f3['result']===-0x1){return _0xc7a4f3;}var _0x2fc69a=this[_0x7665('0xa3')](_0x7665('0xb5'),_0x7665('0xb6'));if(_0x2fc69a[_0x7665('0xa4')]===-0x1){return _0x2fc69a;}var _0x531f1=this[_0x7665('0xa3')](_0x7665('0xb7'),_0x7665('0xb8'));if(_0x531f1[_0x7665('0xa4')]===-0x1){return _0x531f1;}var _0x557702=this[_0x7665('0xa3')](_0x7665('0xb9'),'MRCP_RECOG_INSTANCE');if(_0x557702[_0x7665('0xa4')]===-0x1){return _0x557702;}return this['channel'][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0xba'),_0x20e02e));};AGIVertices[_0x7665('0x12')]['agi']=function(_0x39146c){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0xbb'),_0x39146c[_0x7665('0xab')]));return this['channel'][_0x7665('0x8')]([_0x39146c[_0x7665('0xbc')],_0x39146c[_0x7665('0xbd')]]);};AGIVertices[_0x7665('0x12')][_0x7665('0xbe')]=function(_0x114558){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0xbf'),_0x114558[_0x7665('0xab')]));if(this[_0x7665('0xa7')](_0x114558[_0x7665('0x66')])){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0xc0'),_0x114558[_0x7665('0x66')]));var _0x365cd4=this[_0x7665('0x10')][_0x7665('0xc1')](_0x114558[_0x7665('0x66')]);if(_0x365cd4[_0x7665('0xa4')]===-0x1){return _0x365cd4;}}return this['channel'][_0x7665('0xbe')]();};AGIVertices[_0x7665('0x12')][_0x7665('0x4f')]=function(_0x574559){logger['info'](util[_0x7665('0x2c')](_0x7665('0xc2'),_0x574559[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x574559[_0x7665('0x4d')])){return this[_0x7665('0x10')][_0x7665('0x30')](_0x574559,_0x7665('0xc3'));}_0x574559[_0x7665('0x4e')]=moment();if(this[_0x7665('0xa7')](_0x574559[_0x7665('0xc4')])){_0x574559[_0x7665('0x4e')]=moment()['add'](_0x574559[_0x7665('0xc4')],_0x7665('0xc5'));}if(!this[_0x7665('0xa7')](_0x574559[_0x7665('0xc6')])){_0x574559[_0x7665('0xc6')]=0x2;}this[_0x7665('0x46')][_0x7665('0xc7')](this,_0x574559);return this[_0x7665('0x10')]['noop'](util[_0x7665('0x2c')](_0x7665('0xc8'),_0x574559[_0x7665('0x4c')],_0x574559[_0x7665('0x4d')],_0x574559['scheduledAt']));};AGIVertices[_0x7665('0x12')][_0x7665('0xc9')]=function(_0x5a0261){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0xca'),_0x5a0261[_0x7665('0xab')]));var _0x6949c3=this[_0x7665('0x10')][_0x7665('0xcb')](_0x5a0261['application'],_0x5a0261[_0x7665('0x77')]);if(_0x6949c3[_0x7665('0xa4')]===-0x1){return _0x6949c3;}return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0xcc'),_0x5a0261[_0x7665('0xcd')],_0x5a0261[_0x7665('0x77')]));};AGIVertices[_0x7665('0x12')]['lumenvoxtts']=function(_0x1c4ff7){logger['info'](util[_0x7665('0x2c')](_0x7665('0xce'),_0x1c4ff7[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x1c4ff7['text'])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xad'));}var _0x4d5fcf='\x22'+_0x1c4ff7[_0x7665('0x5e')]+'\x22';if(this[_0x7665('0xa7')](_0x1c4ff7[_0x7665('0x77')])){_0x4d5fcf+=','+_0x1c4ff7[_0x7665('0x77')];}var _0x55d07c=this[_0x7665('0x10')][_0x7665('0xcb')]('MRCPSynth',_0x4d5fcf);if(_0x55d07c[_0x7665('0xa4')]===-0x1){return _0x55d07c;}return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0xaf'),_0x4d5fcf));};AGIVertices[_0x7665('0x12')][_0x7665('0xcf')]=function(_0x475bde){logger['info'](util[_0x7665('0x2c')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x475bde[_0x7665('0xab')]));if(!this['isConfigured'](_0x475bde[_0x7665('0x5e')])){return this[_0x7665('0x10')][_0x7665('0xac')]('no\x20text\x20configured');}var _0x599aa3='\x22'+_0x475bde[_0x7665('0x5e')]+'\x22';if(this[_0x7665('0xa7')](_0x475bde[_0x7665('0x77')])){_0x599aa3+=','+_0x475bde[_0x7665('0x77')];}var _0x14dd61=this[_0x7665('0x10')][_0x7665('0xcb')](_0x7665('0xae'),_0x599aa3);if(_0x14dd61[_0x7665('0xa4')]===-0x1){return _0x14dd61;}return this['channel']['noop'](util['format'](_0x7665('0xaf'),_0x599aa3));};AGIVertices[_0x7665('0x12')][_0x7665('0xd0')]=function(_0xb6358d){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0xd1'),_0xb6358d[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0xb6358d['grammar'])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xb3'));}var _0x57c421=_0xb6358d[_0x7665('0xb2')];if(this[_0x7665('0xa7')](_0xb6358d['options'])){_0x57c421+=','+_0xb6358d['options'];}var _0x2cc0d5=this['channel']['exec'](_0x7665('0xb4'),_0x57c421);if(_0x2cc0d5[_0x7665('0xa4')]===-0x1){return _0x2cc0d5;}var _0x587921=this[_0x7665('0xa3')](_0x7665('0xb5'),_0x7665('0xd2'));if(_0x587921[_0x7665('0xa4')]===-0x1){return _0x587921;}var _0x2722de=this[_0x7665('0xa3')](_0x7665('0xb7'),_0x7665('0xd3'));if(_0x2722de[_0x7665('0xa4')]===-0x1){return _0x2722de;}var _0x3c9dc8=this['getAndSetVariable'](_0x7665('0xb9'),_0x7665('0xd4'));if(_0x3c9dc8[_0x7665('0xa4')]===-0x1){return _0x3c9dc8;}return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0xba'),_0x57c421));};AGIVertices['prototype']['sestekasr']=function(_0x534d46){logger['info'](util[_0x7665('0x2c')](_0x7665('0xd5'),_0x534d46['label']));if(!this[_0x7665('0xa7')](_0x534d46[_0x7665('0xb2')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xb3'));}var _0x37940d=_0x534d46[_0x7665('0xb2')];if(this[_0x7665('0xa7')](_0x534d46['options'])){_0x37940d+=','+_0x534d46[_0x7665('0x77')];}var _0x54cc00=this[_0x7665('0x10')][_0x7665('0xcb')](_0x7665('0xb4'),_0x37940d);if(_0x54cc00[_0x7665('0xa4')]===-0x1){return _0x54cc00;}var _0x3736c7=this['getAndSetVariable'](_0x7665('0xb5'),_0x7665('0xd6'));if(_0x3736c7[_0x7665('0xa4')]===-0x1){return _0x3736c7;}var _0x510fd9=this[_0x7665('0xa3')]('RECOG_INPUT()',_0x7665('0xd7'));if(_0x510fd9[_0x7665('0xa4')]===-0x1){return _0x510fd9;}var _0x3f693b=this['getAndSetVariable'](_0x7665('0xb9'),_0x7665('0xd8'));if(_0x3f693b[_0x7665('0xa4')]===-0x1){return _0x3f693b;}return this[_0x7665('0x10')]['noop'](util[_0x7665('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x37940d));};AGIVertices[_0x7665('0x12')]['database']=function(_0x191f61){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0xd9'),_0x191f61[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x191f61[_0x7665('0xda')])){return this[_0x7665('0x10')][_0x7665('0x30')](_0x191f61,_0x7665('0xdb'));}var _0x262619=this[_0x7665('0xdc')]['sync'](this,_0x191f61['odbc_id']);if(!_0x262619){return this[_0x7665('0x10')][_0x7665('0x30')](_0x191f61,_0x7665('0xdd'));}if(!this[_0x7665('0xa7')](_0x191f61[_0x7665('0x33')])){return this[_0x7665('0x10')][_0x7665('0x30')](_0x191f61,_0x7665('0xde'));}var _0x598f14=_0x191f61[_0x7665('0x33')][_0x7665('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0xdf'),_0x598f14));var _0x38a529=this[_0x7665('0x2e')][_0x7665('0xc7')](this,_0x262619,_0x598f14);this['createSquareDetailsReport']['sync'](this,_0x191f61,_0x598f14);if(!this['isConfigured'](_0x191f61[_0x7665('0xe0')])){return this['channel'][_0x7665('0xac')](_0x7665('0xe1'));}var _0x39b833=this[_0x7665('0x13')][_0x7665('0xc7')](this,_0x191f61[_0x7665('0xe0')]);if(!_0x39b833){return this[_0x7665('0x10')][_0x7665('0x30')](_0x191f61,_0x7665('0xe2'));}var _0x5b8274=this;_0x38a529[_0x7665('0xe3')](function(_0x3cd334,_0x1da4eb){Object[_0x7665('0xe4')](_0x3cd334)[_0x7665('0xe3')](function(_0x5dd505){_0x5b8274['channel'][_0x7665('0xa6')](util[_0x7665('0x2c')](_0x7665('0xe5'),_0x39b833,_0x1da4eb,_0x5dd505),_0x3cd334[_0x5dd505]);});});this[_0x7665('0x10')][_0x7665('0xa6')](util['format']('%s_ROWS_COUNT',_0x39b833),_0x38a529[_0x7665('0x9a')]);return this[_0x7665('0x10')]['noop'](util[_0x7665('0x2c')](_0x7665('0xe6'),_0x39b833));};AGIVertices[_0x7665('0x12')][_0x7665('0xe7')]=function(_0x594afc){logger['debug'](util[_0x7665('0x2c')](_0x7665('0xe8'),_0x594afc[_0x7665('0xab')]));if(!this['isConfigured'](_0x594afc[_0x7665('0xe9')])){return this[_0x7665('0x10')][_0x7665('0x30')](_0x594afc,_0x7665('0xea'));}var _0x5e7d49=this[_0x7665('0xeb')]['sync'](this,_0x594afc[_0x7665('0xe9')]);if(!_0x5e7d49){return this['channel'][_0x7665('0x30')](_0x594afc,_0x7665('0xec'));}var _0x2d9b88=this[_0x7665('0x10')][_0x7665('0xcb')](_0x7665('0xed'),[util[_0x7665('0x2c')](_0x7665('0xee'),_0x5e7d49),_0x594afc['timeout'],_0x594afc[_0x7665('0xef')],_0x594afc[_0x7665('0x64')]]);if(_0x2d9b88[_0x7665('0xa4')]===-0x1){return _0x2d9b88;}return this[_0x7665('0x10')][_0x7665('0xac')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x7665('0x12')][_0x7665('0xf0')]=function(_0x2fa128){logger[_0x7665('0x34')](util[_0x7665('0x2c')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x2fa128[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x2fa128[_0x7665('0x79')])){return this[_0x7665('0x10')]['noop'](_0x7665('0xf1'));}if(!this['isConfigured'](_0x2fa128[_0x7665('0x5e')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xad'));}this[_0x7665('0x10')][_0x7665('0xf2')]=!![];this['createSquareDetailsReport'](_0x2fa128);this[_0x7665('0x45')](_0x2fa128[_0x7665('0x5e')],'in','','');this['channel'][_0x7665('0xac')](util[_0x7665('0x2c')]('Trying\x20Dialogflow:\x20%s',_0x2fa128['text']));var _0x2e585e=this[_0x7665('0x78')][_0x7665('0xc7')](this,_0x2fa128);if(_0x2e585e){for(var _0x3d7eb9 in _0x2e585e){if(_0x2e585e[_0x7665('0x97')](_0x3d7eb9)){this[_0x7665('0x10')][_0x7665('0xa6')](util[_0x7665('0x2c')](_0x7665('0xf3'),_0x3d7eb9[_0x7665('0x68')]()),_0x2e585e[_0x3d7eb9]);}}this['createSquareMessage'](_0x2e585e[_0x7665('0xf4')],_0x7665('0xf5'),'dialogflow','');return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')]('Dialogflow\x20Result\x20%s',_0x2e585e[_0x7665('0xf4')]));}return this[_0x7665('0x10')][_0x7665('0x30')](_0x2fa128,_0x7665('0xf6'));};AGIVertices['prototype'][_0x7665('0xf7')]=function(_0x3020be){logger['info'](util['format'](_0x7665('0xf8'),_0x3020be[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x3020be['dialogflowV2_project_id'])){return this['channel'][_0x7665('0xac')](_0x7665('0xf9'));}if(!this[_0x7665('0xa7')](_0x3020be[_0x7665('0x7d')])){return this[_0x7665('0x10')][_0x7665('0xac')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x3020be[_0x7665('0xfa')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xfb'));}if(!this[_0x7665('0xa7')](_0x3020be[_0x7665('0x7e')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xfc'));}if(!this['isConfigured'](_0x3020be[_0x7665('0x5e')])){return this[_0x7665('0x10')]['noop'](_0x7665('0xad'));}this[_0x7665('0x10')][_0x7665('0xf2')]=!![];this[_0x7665('0x3a')](_0x3020be);this[_0x7665('0x45')](_0x3020be[_0x7665('0x5e')],'in','','');this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0xfd'),_0x3020be[_0x7665('0x5e')]));var _0x6f46f0=this[_0x7665('0x7b')][_0x7665('0xc7')](this,_0x3020be);if(_0x6f46f0){for(var _0x134e2b in _0x6f46f0){if(_0x6f46f0[_0x7665('0x97')](_0x134e2b)){if(_0x134e2b!==_0x7665('0xfe')){this[_0x7665('0x10')][_0x7665('0xa6')](util[_0x7665('0x2c')]('DIALOGFLOW_%s',_0x134e2b[_0x7665('0x68')]()),_0x6f46f0[_0x134e2b]);}}}this[_0x7665('0x45')](_0x6f46f0[_0x7665('0xf4')],_0x7665('0xf5'),_0x7665('0xf7'),_0x6f46f0[_0x7665('0xfe')]);return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0xff'),_0x6f46f0[_0x7665('0xf4')]));}return this[_0x7665('0x10')][_0x7665('0x30')](_0x3020be,_0x7665('0x100'));};AGIVertices['prototype'][_0x7665('0x101')]=function(_0x4f94cd){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x102'),_0x4f94cd[_0x7665('0xab')]));if(!this['isConfigured'](_0x4f94cd['ndauth_url'])){return this[_0x7665('0x10')][_0x7665('0xac')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x7665('0xa7')](_0x4f94cd[_0x7665('0x103')])){return this['channel'][_0x7665('0xac')](_0x7665('0x104'));}if(!this['isConfigured'](_0x4f94cd['password'])){return this[_0x7665('0x10')]['noop']('no\x20password\x20configured');}if(!this['isConfigured'](_0x4f94cd[_0x7665('0x105')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xad'));}this[_0x7665('0x10')]['bot']=!![];this[_0x7665('0x3a')](_0x4f94cd);this[_0x7665('0x45')](_0x4f94cd['text'],'in','','');this['channel'][_0x7665('0xac')](util['format']('Trying\x20SestekNDA:\x20%s',_0x4f94cd[_0x7665('0x5e')]));var _0xc8dbe7=this['sestekNDA'][_0x7665('0xc7')](this,_0x4f94cd);if(_0xc8dbe7){for(var _0x1b05a3 in _0xc8dbe7){if(_0xc8dbe7[_0x7665('0x97')](_0x1b05a3)){this[_0x7665('0x10')][_0x7665('0xa6')](util[_0x7665('0x2c')](_0x7665('0x106'),_0x1b05a3['toUpperCase']()),_0xc8dbe7[_0x1b05a3]);}}this['createSquareMessage'](_0xc8dbe7[_0x7665('0xf4')],_0x7665('0xf5'),_0x7665('0x101'),'');if(_0xc8dbe7['audiofile']){this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x107'),_0xc8dbe7[_0x7665('0x108')]));var _0x30be03=this['channel']['streamFile'](_0xc8dbe7[_0x7665('0x108')]);try{fs[_0x7665('0x109')](_0xc8dbe7['audiofile']+_0x7665('0x10a'));}catch(_0x44a56b){logger[_0x7665('0x30')](_0x44a56b);}return _0x30be03;}else{return this[_0x7665('0x10')]['noop'](util[_0x7665('0x2c')](_0x7665('0x10b'),_0xc8dbe7[_0x7665('0xf4')]));}}return this[_0x7665('0x10')][_0x7665('0x30')](_0x4f94cd,_0x7665('0x10c'));};AGIVertices['prototype']['end']=function(_0x9159f1){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x10d'),_0x9159f1[_0x7665('0xab')]));return this[_0x7665('0x10')][_0x7665('0xac')]('end');};AGIVertices[_0x7665('0x12')][_0x7665('0x10e')]=function(_0xc651b8){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x10f'),_0xc651b8[_0x7665('0xab')]));var _0x1fff80='';if(_0xc651b8[_0x7665('0x110')]){if(!this[_0x7665('0xa7')](_0xc651b8[_0x7665('0x110')])){return this['channel']['error'](_0xc651b8,_0x7665('0x111'));}else{var _0x2fed5b=parseInt(_0xc651b8[_0x7665('0x110')],0xa);if(isNaN(_0x2fed5b)){_0x1fff80=_0xc651b8[_0x7665('0x110')];}else{_0x1fff80=this[_0x7665('0x1e')][_0x7665('0xc7')](this,_0xc651b8[_0x7665('0x110')]);if(!_0x1fff80){return this[_0x7665('0x10')][_0x7665('0x30')](_0xc651b8,_0x7665('0x112'));}}}}else if(_0xc651b8['trunk_name']){_0x1fff80=_0xc651b8[_0x7665('0x113')];}else{return this[_0x7665('0x10')][_0x7665('0x30')](_0xc651b8,_0x7665('0x111'));}var _0x418717=this['channel'][_0x7665('0xcb')](_0x7665('0xed'),[util[_0x7665('0x2c')](_0x7665('0x114'),_0x1fff80,_0xc651b8['phone']),_0xc651b8['timeout'],_0xc651b8[_0x7665('0xef')],_0xc651b8[_0x7665('0x64')]]);if(_0x418717[_0x7665('0xa4')]===-0x1){return _0x418717;}return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x115'),_0x7665('0xed')));};AGIVertices[_0x7665('0x12')][_0x7665('0x116')]=function(_0x13f4e3){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x13f4e3[_0x7665('0xab')]));return this[_0x7665('0x10')][_0x7665('0xac')]('finally');};AGIVertices[_0x7665('0x12')]['getdigits']=function(_0x391340){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x117'),_0x391340['label']));if(_0x391340[_0x7665('0x118')]===0x0){return this[_0x7665('0xa8')](_0x391340);}_0x391340[_0x7665('0x118')]-=0x1;if(!this[_0x7665('0xa7')](_0x391340[_0x7665('0x119')])){return this['channel'][_0x7665('0x30')](_0x391340,_0x7665('0x11a'));}var _0x5aca3e=this[_0x7665('0x1f')][_0x7665('0xc7')](this,_0x391340[_0x7665('0x119')]);if(!_0x5aca3e){return this['channel']['error'](_0x391340,'no\x20file\x20audio\x20found');}if(!this[_0x7665('0xa7')](_0x391340[_0x7665('0xe0')])){return this[_0x7665('0x10')][_0x7665('0x30')](_0x7665('0xe1'));}var _0x31570d=this[_0x7665('0x10')][_0x7665('0x11b')](_0x5aca3e,_0x391340[_0x7665('0x11c')],_0x391340[_0x7665('0x11d')]);var _0x446dfa=_0x31570d['result']?_0x31570d[_0x7665('0xa4')][_0x7665('0xa2')]():'';logger[_0x7665('0x34')](_0x7665('0x11e'),JSON[_0x7665('0x72')](_0x31570d));if(_0x31570d[_0x7665('0xa4')]===-0x1){this['createSquareDetailsReport'][_0x7665('0xc7')](this,_0x391340,_0x446dfa);return _0x31570d;}else if(_0x31570d['extra']===_0x7665('0x66')){_0x31570d['result']=_0x446dfa['length']>=parseInt(_0x391340['mindigit'])?'x':'i';}else{_0x31570d[_0x7665('0xa4')]=_0x446dfa['length']>=parseInt(_0x391340[_0x7665('0x11f')])&&_0x446dfa[_0x7665('0x9a')]<=parseInt(_0x391340[_0x7665('0x11d')])?'x':'i';}var _0x80daa=this[_0x7665('0x13')][_0x7665('0xc7')](this,_0x391340[_0x7665('0xe0')]);if(!_0x80daa){return this[_0x7665('0x10')][_0x7665('0x30')](_0x391340,_0x7665('0xe2'));}this[_0x7665('0x10')][_0x7665('0xa6')](_0x80daa,_0x446dfa);if(this[_0x7665('0xa7')](_0x391340[_0x7665('0x120')])){var _0x4809bb=parseInt(_0x391340[_0x7665('0x120')],0xa);var _0x2551f9=rs[_0x7665('0x121')]({'charset':'*','length':_0x4809bb});var _0x4754cb=_0x446dfa[_0x7665('0x9a')];if(_0x4754cb>0x0){if(_0x4754cb>_0x4809bb){this[_0x7665('0x3a')][_0x7665('0xc7')](this,_0x391340,_0x391340[_0x7665('0x122')]==='first'?_0x2551f9+_0x446dfa[_0x7665('0x123')](_0x4809bb):_0x446dfa[_0x7665('0x123')](0x0,_0x4754cb-_0x4809bb)+_0x2551f9);}else{this['createSquareDetailsReport'][_0x7665('0xc7')](this,_0x391340,rs[_0x7665('0x121')]({'charset':'*','length':_0x4754cb}));}}else{this['createSquareDetailsReport'][_0x7665('0xc7')](this,_0x391340,'');}}else{this[_0x7665('0x3a')]['sync'](this,_0x391340,_0x446dfa);}return _0x31570d;};AGIVertices[_0x7665('0x12')][_0x7665('0xf')]=function(_0x5b18b5){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x124'),_0x5b18b5['label']));return this[_0x7665('0xe')](_0x5b18b5);};AGIVertices[_0x7665('0x12')]['goal']=function(_0x4ec8ba){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x125'),_0x4ec8ba[_0x7665('0xab')]));this['createSquareDetailsReport'][_0x7665('0xc7')](this,_0x4ec8ba,_0x4ec8ba['goalname']);return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')]('GOAL\x20%s',_0x4ec8ba[_0x7665('0x126')]));};AGIVertices[_0x7665('0x12')][_0x7665('0x127')]=function(_0x14edd6){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x128'),_0x14edd6[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x14edd6[_0x7665('0x87')])||!this[_0x7665('0xa7')](_0x14edd6[_0x7665('0x88')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0x129'));}if(!this[_0x7665('0xa7')](_0x14edd6['text'])){return this['channel'][_0x7665('0xac')](_0x7665('0xad'));}this[_0x7665('0x10')][_0x7665('0xac')](util['format'](_0x7665('0x12a'),_0x14edd6[_0x7665('0x5e')]));var _0xe00d99=this[_0x7665('0x86')][_0x7665('0xc7')](this,_0x14edd6);if(_0xe00d99){this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x12b'),_0xe00d99));var _0x13156c=this[_0x7665('0x10')]['streamFile'](_0xe00d99);try{fs[_0x7665('0x109')](_0xe00d99+'.wav');}catch(_0x5ecb0e){logger[_0x7665('0x30')](_0x5ecb0e);}return _0x13156c;}return this[_0x7665('0x10')][_0x7665('0x30')](_0x14edd6,_0x7665('0x12c'));};AGIVertices[_0x7665('0x12')][_0x7665('0x12d')]=function(_0x23e1f7){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x12e'),_0x23e1f7[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x23e1f7[_0x7665('0x87')])||!this[_0x7665('0xa7')](_0x23e1f7[_0x7665('0x88')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0x129'));}if(!this[_0x7665('0xa7')](_0x23e1f7[_0x7665('0x8f')])){return this[_0x7665('0x10')][_0x7665('0xac')]('no\x20bot\x20name\x20configured');}if(!this[_0x7665('0xa7')](_0x23e1f7[_0x7665('0x5e')])){return this['channel'][_0x7665('0xac')](_0x7665('0xad'));}this['channel'][_0x7665('0xf2')]=!![];this[_0x7665('0x3a')](_0x23e1f7);this[_0x7665('0x45')](_0x23e1f7[_0x7665('0x5e')],'in','','');this[_0x7665('0x10')][_0x7665('0xac')](util['format'](_0x7665('0x12f'),_0x23e1f7[_0x7665('0x5e')]));var _0x4ac31e=this[_0x7665('0x8d')][_0x7665('0xc7')](this,_0x23e1f7);if(_0x4ac31e){for(var _0x4c4279 in _0x4ac31e){if(_0x4ac31e['hasOwnProperty'](_0x4c4279)&&_[_0x7665('0x98')](_0x4ac31e[_0x4c4279])){this[_0x7665('0x10')]['setVariable'](util[_0x7665('0x2c')](_0x7665('0x130'),_0x4c4279['toUpperCase']()),_0x4ac31e[_0x4c4279]);}}if(_[_0x7665('0x47')](_0x4ac31e[_0x7665('0x75')])){return this[_0x7665('0x10')][_0x7665('0xac')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x7665('0x45')](_0x4ac31e[_0x7665('0x75')],'out','amazonlex','');return this['channel']['noop'](util[_0x7665('0x2c')](_0x7665('0x131'),_0x4ac31e[_0x7665('0x75')]));}}return this['channel'][_0x7665('0x30')](_0x23e1f7,_0x7665('0x132'));};AGIVertices[_0x7665('0x12')][_0x7665('0x133')]=function(_0x52ddab){logger[_0x7665('0x34')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x52ddab[_0x7665('0xab')],_0x52ddab[_0x7665('0x66')]));if(!this['isConfigured'](_0x52ddab[_0x7665('0x79')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xf1'));}var _0x5d9c98=_0x7665('0x134');var _0x51e700=util[_0x7665('0x2c')]('%s/recordings/%s',FILES_PATH,rs[_0x7665('0x121')](0x4));var _0x2f6b0d=util[_0x7665('0x2c')](_0x7665('0x9d'),_0x51e700,_0x5d9c98);var _0x2f914d=!![];if(_0x52ddab[_0x7665('0x135')]===_0x7665('0x136')){_0x2f914d=![];}var _0x4a8cb0=this[_0x7665('0x10')]['recordFile'](_0x51e700,_0x5d9c98,_0x52ddab[_0x7665('0x137')],_0x52ddab[_0x7665('0x66')],undefined,_0x2f914d);if(_0x4a8cb0['result']!==-0x1){this[_0x7665('0x10')][_0x7665('0xac')](util['format'](_0x7665('0x138'),_0x2f6b0d));var _0x19bdf9=this[_0x7665('0x90')][_0x7665('0xc7')](this,_0x52ddab,_0x2f6b0d);if(_0x19bdf9){for(var _0x491d97 in _0x19bdf9){if(_0x19bdf9[_0x7665('0x97')](_0x491d97)){this[_0x7665('0x10')][_0x7665('0xa6')](util[_0x7665('0x2c')](_0x7665('0x139'),_0x491d97[_0x7665('0x68')]()),_0x19bdf9[_0x491d97]);}}return this['channel'][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x13a'),JSON[_0x7665('0x72')](_0x19bdf9)));}}return _0x4a8cb0;};AGIVertices[_0x7665('0x12')][_0x7665('0x13b')]=function(_0x2243ff){logger['info'](util['format'](_0x7665('0x13c'),_0x2243ff[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x2243ff[_0x7665('0x93')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0x13d'));}if(!this['isConfigured'](_0x2243ff[_0x7665('0x13e')])){return this[_0x7665('0x10')][_0x7665('0xac')]('no\x20appsecret\x20configured');}var _0x469b36=_0x7665('0x134');var _0x2533d9=util[_0x7665('0x2c')](_0x7665('0x13f'),FILES_PATH,rs[_0x7665('0x121')](0x4));var _0x342070=util[_0x7665('0x2c')](_0x7665('0x9d'),_0x2533d9,_0x469b36);var _0x5dd0ba=!![];if(_0x2243ff['beep']==='NOBEEP'){_0x5dd0ba=![];}var _0x1178a1=this[_0x7665('0x10')]['recordFile'](_0x2533d9,_0x469b36,_0x2243ff['intKey'],_0x2243ff[_0x7665('0x66')],undefined,_0x5dd0ba);if(_0x1178a1[_0x7665('0xa4')]!==-0x1){this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x140'),_0x342070));var _0x56e084=this['tildeASR'][_0x7665('0xc7')](this,_0x2243ff,_0x342070);if(_0x56e084){for(var _0x3bdc49 in _0x56e084){if(_0x56e084[_0x7665('0x97')](_0x3bdc49)){this[_0x7665('0x10')][_0x7665('0xa6')](util[_0x7665('0x2c')]('TILDE_ASR_%s',_0x3bdc49[_0x7665('0x68')]()),_0x56e084[_0x3bdc49]);}}return this[_0x7665('0x10')]['noop'](util[_0x7665('0x2c')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x56e084)));}}return _0x1178a1;};AGIVertices[_0x7665('0x12')]['gotoc']=function(_0x17dcd2){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x141'),_0x17dcd2[_0x7665('0xab')]));return this['channel'][_0x7665('0x142')](_0x17dcd2[_0x7665('0x41')],_0x17dcd2[_0x7665('0x42')],_0x17dcd2[_0x7665('0x43')]);};AGIVertices['prototype'][_0x7665('0x143')]=function(_0x387610){logger['info'](util[_0x7665('0x2c')](_0x7665('0x144'),_0x387610[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x387610[_0x7665('0x145')])){return this['channel']['error'](_0x387610,'no\x20condition\x20configured');}try{var _0x392008=eval(_0x387610[_0x7665('0x145')])?_0x7665('0x146'):_0x7665('0x147');this['channel'][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x148'),_0x387610['condition'],_0x392008));return{'code':0xc8,'result':_0x392008};}catch(_0x2f2283){return{'code':0xc8,'result':_0x7665('0x147')};}};AGIVertices[_0x7665('0x12')][_0x7665('0x149')]=function(_0x3356e9){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x14a'),_0x3356e9[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x3356e9[_0x7665('0x14b')])){return this['channel'][_0x7665('0x30')](_0x3356e9,_0x7665('0x14c'));}var _0xc289a5=this[_0x7665('0x26')][_0x7665('0xc7')](this,_0x3356e9[_0x7665('0x14b')]);if(!_0xc289a5){return this[_0x7665('0x10')][_0x7665('0x30')](_0x3356e9,_0x7665('0x14d'));}for(var _0x1881af=0x0;_0x1881af<_0xc289a5[_0x7665('0x9a')];_0x1881af+=0x1){var _0x4513df=this[_0x7665('0x10')][_0x7665('0x13')](util[_0x7665('0x2c')]('IFTIME(%s?true:false)',_0xc289a5[_0x1881af]));if(_0x4513df[_0x7665('0xa4')]===-0x1){return _0x4513df;}logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x14e'),_0xc289a5[_0x1881af],_0x4513df['extra']));if(_0x4513df[_0x7665('0xa1')]===_0x7665('0x146')){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x14e'),_0xc289a5[_0x1881af],_0x7665('0x146')));this[_0x7665('0x10')][_0x7665('0xac')](util['format'](_0x7665('0x14e'),_0xc289a5[_0x1881af],'true'));return{'code':0xc8,'result':_0x7665('0x146')};}else{logger[_0x7665('0x34')](util['format'](_0x7665('0x14e'),_0xc289a5[_0x1881af],'false'));this[_0x7665('0x10')]['noop'](util['format'](_0x7665('0x14e'),_0xc289a5[_0x1881af],'false'));}}return{'code':0xc8,'result':_0x7665('0x147')};};AGIVertices['prototype'][_0x7665('0x14f')]=function(_0x363123){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x150'),_0x363123['label']));return this[_0x7665('0x10')][_0x7665('0x14f')]();};AGIVertices['prototype']['ispeechasr']=function(_0x16dcfc){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x151'),_0x16dcfc['label']));if(!this['isConfigured'](_0x16dcfc['key'])){return this['channel'][_0x7665('0xac')]('no\x20key\x20configured');}var _0x5bc42d=_0x7665('0x134');var _0x377a72=util['format'](_0x7665('0x13f'),FILES_PATH,rs[_0x7665('0x121')](0x4));var _0x3b4ebd=util['format'](_0x7665('0x9d'),_0x377a72,_0x5bc42d);var _0x1dc9f6=!![];if(_0x16dcfc[_0x7665('0x135')]==='NOBEEP'){_0x1dc9f6=![];}var _0x4de46f=this[_0x7665('0x10')]['recordFile'](_0x377a72,_0x5bc42d,_0x16dcfc[_0x7665('0x137')],_0x16dcfc[_0x7665('0x66')],undefined,_0x1dc9f6);if(_0x4de46f[_0x7665('0xa4')]!==-0x1){this['channel'][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x152'),_0x3b4ebd));var _0x5600ce=this[_0x7665('0x83')]['sync'](this,_0x16dcfc,_0x3b4ebd);if(_0x5600ce){for(var _0x80fac0 in _0x5600ce){if(_0x5600ce['hasOwnProperty'](_0x80fac0)){this[_0x7665('0x10')][_0x7665('0xa6')](util[_0x7665('0x2c')](_0x7665('0x153'),_0x80fac0[_0x7665('0x68')]()),_0x5600ce[_0x80fac0]);}}return this[_0x7665('0x10')][_0x7665('0xac')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x7665('0x72')](_0x5600ce)));}}return _0x4de46f;};AGIVertices[_0x7665('0x12')][_0x7665('0x154')]=function(_0x2efb86){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x155'),_0x2efb86[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x2efb86[_0x7665('0x79')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xf1'));}if(!this['isConfigured'](_0x2efb86[_0x7665('0x5e')])){return this[_0x7665('0x10')]['noop'](_0x7665('0xad'));}this[_0x7665('0x10')]['noop'](util[_0x7665('0x2c')](_0x7665('0x156'),_0x2efb86['text']));var _0x114a17=this['ispeechTTS'][_0x7665('0xc7')](this,_0x2efb86);if(_0x114a17){this['channel']['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x114a17));var _0x3363d9=this['channel'][_0x7665('0x157')](_0x114a17,_0x2efb86[_0x7665('0x137')]);try{fs[_0x7665('0x109')](_0x114a17+_0x7665('0x10a'));}catch(_0x1cf7f7){logger[_0x7665('0x30')](_0x1cf7f7);}return _0x3363d9;}return this[_0x7665('0x10')][_0x7665('0x30')](_0x2efb86,_0x7665('0x158'));};AGIVertices[_0x7665('0x12')][_0x7665('0x159')]=function(_0x481e0c){logger['info'](util[_0x7665('0x2c')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x481e0c[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x481e0c[_0x7665('0x15a')])){return this[_0x7665('0x10')]['error'](_0x481e0c,'no\x20find\x20by\x20configured');}logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x15b'),this[_0x7665('0x10')]['callerid'],_0x481e0c[_0x7665('0x15a')]));var _0x379bbf=this[_0x7665('0x58')][_0x7665('0xc7')](this,_0x481e0c[_0x7665('0x15a')]);if(_0x379bbf){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x15c'),this[_0x7665('0x10')]['callerid'],_0x481e0c[_0x7665('0x15a')]));this[_0x7665('0x10')]['noop'](util[_0x7665('0x2c')](_0x7665('0x15c'),this[_0x7665('0x10')][_0x7665('0x3e')],_0x481e0c['findBy']));return{'code':0xc8,'result':_0x7665('0x15d')};}else{logger[_0x7665('0x34')](util[_0x7665('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7665('0x10')]['callerid'],_0x481e0c['findBy']));this['channel']['noop'](util[_0x7665('0x2c')](_0x7665('0x15e'),this[_0x7665('0x10')][_0x7665('0x3e')],_0x481e0c[_0x7665('0x15a')]));return{'code':0xc8,'result':_0x7665('0x15f')};}};AGIVertices[_0x7665('0x12')][_0x7665('0x160')]=function(_0x239bb4){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x161'),_0x239bb4[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x239bb4['findBy'])){return this['channel']['error'](_0x239bb4,_0x7665('0x162'));}logger['info'](util['format'](_0x7665('0x15b'),this['channel'][_0x7665('0x3e')],_0x239bb4['findBy']));var _0x211d86=this[_0x7665('0x56')][_0x7665('0xc7')](this,_0x239bb4[_0x7665('0x15a')]);if(_0x211d86){logger['info'](util[_0x7665('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7665('0x3e')],_0x239bb4[_0x7665('0x15a')]));this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7665('0x10')][_0x7665('0x3e')],_0x239bb4[_0x7665('0x15a')]));return{'code':0xc8,'result':_0x7665('0x15d')};}else{logger[_0x7665('0x34')](util['format'](_0x7665('0x15e'),this['channel'][_0x7665('0x3e')],_0x239bb4[_0x7665('0x15a')]));this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x15e'),this[_0x7665('0x10')][_0x7665('0x3e')],_0x239bb4[_0x7665('0x15a')]));return{'code':0xc8,'result':_0x7665('0x15f')};}};AGIVertices[_0x7665('0x12')][_0x7665('0x163')]=function(_0x263469){logger[_0x7665('0x34')](util['format'](_0x7665('0x164'),_0x263469[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x263469['operation'])){return this[_0x7665('0x10')]['error'](_0x263469,_0x7665('0x165'));}this['channel']['noop'](util[_0x7665('0x2c')](_0x7665('0x166'),_0x263469[_0x7665('0x167')]));var _0x28df6b=eval(_0x263469[_0x7665('0x167')]);if(!this[_0x7665('0xa7')](_0x263469[_0x7665('0xe0')])){return this['channel'][_0x7665('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2c0cba=this[_0x7665('0x13')][_0x7665('0xc7')](this,_0x263469['variable_id']);if(!_0x2c0cba){return this[_0x7665('0x10')]['error'](_0x263469,_0x7665('0xe2'));}if(_['isArray'](_0x28df6b)){var _0x45ea84=this;_0x28df6b['forEach'](function(_0x13ad9f,_0x4cc615){_0x45ea84['channel'][_0x7665('0xa6')](util[_0x7665('0x2c')](_0x7665('0x168'),_0x2c0cba,_0x4cc615),_0x13ad9f);});return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x169'),_0x2c0cba));}else{return this['channel'][_0x7665('0xa6')](_0x2c0cba,_0x28df6b);}};AGIVertices['prototype'][_0x7665('0xd')]=function(_0x349073){logger[_0x7665('0x34')](util['format'](_0x7665('0x16a'),_0x349073[_0x7665('0xab')]));if(_0x349073[_0x7665('0x118')]===0x0){return this[_0x7665('0xa8')](_0x349073);}_0x349073[_0x7665('0x118')]-=0x1;if(!this[_0x7665('0xa7')](_0x349073[_0x7665('0x119')])){return this[_0x7665('0x10')]['error'](_0x349073,'no\x20file\x20audio\x20selected');}var _0x22c9a4=this[_0x7665('0x1f')][_0x7665('0xc7')](this,_0x349073[_0x7665('0x119')]);if(!_0x22c9a4){return this[_0x7665('0x10')][_0x7665('0x30')](_0x349073,_0x7665('0x16b'));}var _0x1ed582=this[_0x7665('0x10')][_0x7665('0x11b')](_0x22c9a4,_0x349073[_0x7665('0x11c')],_0x349073[_0x7665('0x16c')]);var _0x1b7107=_0x1ed582[_0x7665('0xa4')];if(_0x1ed582[_0x7665('0xa4')]===-0x1){this[_0x7665('0x3a')][_0x7665('0xc7')](this,_0x349073,'-1');return _0x1ed582;}else if(_0x1ed582['extra']===_0x7665('0x66')){_0x1ed582[_0x7665('0xa4')]=_0x1ed582[_0x7665('0xa4')][_0x7665('0x9a')]>0x0?_0x1ed582[_0x7665('0xa4')]:'t';}else if(_[_0x7665('0x4a')](_0x1ed582['result'])){_0x1ed582[_0x7665('0xa4')]='#';_0x1b7107='#';}if(!this[_0x7665('0xa7')](_0x349073[_0x7665('0xe0')])){this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0xe1'));}else{var _0x40fc=this[_0x7665('0x13')][_0x7665('0xc7')](this,_0x349073[_0x7665('0xe0')]);if(!_0x40fc){return this[_0x7665('0x10')][_0x7665('0x30')](_0x349073,_0x7665('0xe2'));}this[_0x7665('0x10')][_0x7665('0xa6')](_0x40fc,_0x1b7107);}this['createSquareDetailsReport'][_0x7665('0xc7')](this,_0x349073,_0x1b7107);return _0x1ed582;};AGIVertices[_0x7665('0x12')][_0x7665('0xac')]=function(_0x3af999){logger[_0x7665('0x34')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x3af999[_0x7665('0xab')]));return this[_0x7665('0x10')][_0x7665('0xac')](_0x3af999[_0x7665('0x16d')]||_0x3af999['label']);};AGIVertices[_0x7665('0x12')][_0x7665('0x16e')]=function(_0x1703d0){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x16f'),_0x1703d0[_0x7665('0xab')]));if(!this['isConfigured'](_0x1703d0[_0x7665('0x15a')])){return this[_0x7665('0x10')][_0x7665('0x30')](_0x1703d0,'no\x20find\x20by\x20configured');}logger[_0x7665('0x34')](util[_0x7665('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7665('0x10')]['callerid'],_0x1703d0[_0x7665('0x15a')]));var _0x4f08eb=this['getPause']['sync'](this,_0x1703d0[_0x7665('0x170')]);var _0x3f605c=this['agentPause'][_0x7665('0xc7')](this,_0x1703d0[_0x7665('0x15a')],_0x4f08eb);if(_0x3f605c){logger['info'](util['format'](_0x7665('0x15c'),this[_0x7665('0x10')][_0x7665('0x3e')],_0x1703d0[_0x7665('0x15a')]));this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7665('0x3e')],_0x1703d0['findBy']));return{'code':0xc8,'result':_0x7665('0x15d')};}else{logger['info'](util[_0x7665('0x2c')](_0x7665('0x15e'),this[_0x7665('0x10')]['callerid'],_0x1703d0[_0x7665('0x15a')]));this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x15c'),this['channel'][_0x7665('0x3e')],_0x1703d0[_0x7665('0x15a')]));return{'code':0xc8,'result':_0x7665('0x15f')};}};AGIVertices[_0x7665('0x12')][_0x7665('0x171')]=function(_0x1dfeb0){logger[_0x7665('0x34')](util[_0x7665('0x2c')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1dfeb0[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x1dfeb0[_0x7665('0x119')])){return this[_0x7665('0x10')][_0x7665('0x30')](_0x1dfeb0,_0x7665('0x11a'));}var _0x177e17=this[_0x7665('0x1f')]['sync'](this,_0x1dfeb0[_0x7665('0x119')]);if(!_0x177e17){return this[_0x7665('0x10')][_0x7665('0x30')](_0x1dfeb0,'no\x20file\x20audio\x20found');}var _0x131d7e=this['channel'][_0x7665('0xcb')](_0x7665('0x172'),[_0x177e17,_0x1dfeb0[_0x7665('0xef')]]);if(_0x131d7e[_0x7665('0xa4')]===-0x1){return _0x131d7e;}return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0xcc'),_0x7665('0x172'),_0x177e17));};AGIVertices['prototype'][_0x7665('0x173')]=function(_0x50e3cf){logger[_0x7665('0x34')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x50e3cf[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x50e3cf['queue_id'])){return this['channel'][_0x7665('0x30')](_0x50e3cf,_0x7665('0x174'));}var _0xbe1277='';var _0x133401=parseInt(_0x50e3cf[_0x7665('0x175')],0xa);if(isNaN(_0x133401)){_0xbe1277=_0x50e3cf[_0x7665('0x175')];}else{_0xbe1277=this[_0x7665('0x16')][_0x7665('0xc7')](this,_0x50e3cf[_0x7665('0x175')]);if(!_0xbe1277){return this['channel'][_0x7665('0x30')](_0x50e3cf,'no\x20queue\x20found');}}var _0x48288b='';if(this[_0x7665('0xa7')](_0x50e3cf[_0x7665('0x119')])){var _0x5967b0=this[_0x7665('0x1f')]['sync'](this,_0x50e3cf[_0x7665('0x119')]);if(_0x5967b0){_0x48288b=_0x5967b0;}}this['createSquareDetailsReport']['sync'](this,_0x50e3cf,_0xbe1277);if(_0x50e3cf[_0x7665('0xef')][_0x7665('0x176')]('x')<0x0){_0x50e3cf[_0x7665('0xef')]+='x';}if(_0x50e3cf[_0x7665('0xef')][_0x7665('0x176')]('X')<0x0){_0x50e3cf['opts']+='X';}this[_0x7665('0x10')]['setVariable'](_0x7665('0x177'),_0xbe1277?_0xbe1277[_0x7665('0x178')]():'');var _0x5b5853=this[_0x7665('0x10')][_0x7665('0xcb')](_0x7665('0x179'),[_0xbe1277,_0x50e3cf[_0x7665('0xef')],_0x50e3cf[_0x7665('0x64')],_0x48288b,_0x50e3cf[_0x7665('0x66')],_0x50e3cf['agi'],_0x50e3cf[_0x7665('0x17a')],_0x50e3cf['gosub'],'',_0x50e3cf[_0x7665('0x17b')]]);if(_0x5b5853[_0x7665('0xa4')]===-0x1){return _0x5b5853;}return this['channel'][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0xcc'),_0x7665('0x179'),_0xbe1277));};AGIVertices['prototype'][_0x7665('0x17c')]=function(_0x17beb8){logger[_0x7665('0x34')](util['format'](_0x7665('0x17d'),_0x17beb8[_0x7665('0xab')]));var _0x212d87=_0x17beb8[_0x7665('0x17e')]||'wav';var _0x441700=util['format'](_0x7665('0x17f'),this[_0x7665('0x10')]['uniqueid'],rs[_0x7665('0x121')](0x5));var _0x5a53e9=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x441700,_0x212d87);var _0x27a395=util[_0x7665('0x2c')](_0x7665('0x13f'),FILES_PATH,_0x441700);this[_0x7665('0x3f')]['sync'](this,_0x17beb8,_0x441700,_0x5a53e9);this['channel'][_0x7665('0xa6')](_0x7665('0x180'),_0x441700);logger[_0x7665('0x34')](_0x7665('0x181'),_0x27a395,_0x212d87,_0x17beb8['escape_digits'],_0x17beb8[_0x7665('0x66')]);return this[_0x7665('0x10')]['recordFile'](_0x27a395,_0x212d87,_0x17beb8['escape_digits'],_0x17beb8[_0x7665('0x66')],undefined,!![]);};AGIVertices['prototype'][_0x7665('0x182')]=function(_0x119a2f){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x183'),_0x119a2f['label']));if(!this[_0x7665('0xa7')](_0x119a2f['url'])){return this['channel']['noop'](_0x7665('0x184'));}var _0x787747=this[_0x7665('0x185')][_0x7665('0xc7')](this,_0x119a2f);logger[_0x7665('0x34')](util['format'](_0x7665('0x186'),util['inspect'](_0x787747,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x119a2f[_0x7665('0xe0')])){return this['channel'][_0x7665('0xac')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x5b9d5a=this[_0x7665('0x13')][_0x7665('0xc7')](this,_0x119a2f['variable_id']);if(!_0x5b9d5a){return this['channel']['error'](_0x119a2f,_0x7665('0xe2'));}this['channel'][_0x7665('0xa6')](util[_0x7665('0x2c')](_0x7665('0x187'),_0x5b9d5a),_0x787747[_0x7665('0x74')]?_0x787747[_0x7665('0x74')]:_0x7665('0x188'));this['channel'][_0x7665('0xa6')](util['format'](_0x7665('0x189'),_0x5b9d5a),_0x787747[_0x7665('0x18a')]?_0x787747['statusMessage']:'OK');if(_0x787747[_0x7665('0x69')]){try{this[_0x7665('0x18b')](_0x787747['body'],_0x5b9d5a);}catch(_0x31000e){logger['error'](util[_0x7665('0x2c')](_0x7665('0x18c'),_0x5b9d5a));}}return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')]('variable\x20%s\x20set',_0x5b9d5a));};AGIVertices[_0x7665('0x12')]['saydigits']=function(_0x132481){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x18d'),_0x132481[_0x7665('0xab')]));return this[_0x7665('0x10')]['sayDigits'](_0x132481[_0x7665('0x18e')][_0x7665('0x5b')](/\s+/g,''),_0x132481['escape_digits']);};AGIVertices[_0x7665('0x12')][_0x7665('0x18f')]=function(_0x528a2d){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x190'),_0x528a2d[_0x7665('0xab')]));return this[_0x7665('0x10')][_0x7665('0x191')](_0x528a2d[_0x7665('0x192')][_0x7665('0x5b')](/\s+/g,''),_0x528a2d[_0x7665('0x193')]);};AGIVertices[_0x7665('0x12')][_0x7665('0x194')]=function(_0x3022ae){logger['info'](util[_0x7665('0x2c')](_0x7665('0x195'),_0x3022ae['label']));return this[_0x7665('0x10')][_0x7665('0x196')](_0x3022ae[_0x7665('0x5e')],_0x3022ae[_0x7665('0x193')]);};AGIVertices[_0x7665('0x12')][_0x7665('0x197')]=function(_0x4d1cca){logger[_0x7665('0x34')](util[_0x7665('0x2c')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x4d1cca[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x4d1cca[_0x7665('0x198')])){return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0x199'));}var _0x3bee72=this[_0x7665('0x22')][_0x7665('0xc7')](this,_0x4d1cca[_0x7665('0x198')]);if(!_0x3bee72||!_0x3bee72[_0x7665('0x19a')]){return this['channel']['error'](_0x4d1cca,'no\x20mail\x20account\x20found');}var _0x3f011d={'from':util['format'](_0x7665('0x19b'),_0x3bee72[_0x7665('0x18')],_0x3bee72[_0x7665('0x19c')]||_0x3bee72[_0x7665('0x19a')][_0x7665('0x19d')]),'to':_0x4d1cca['to']||'','cc':_0x4d1cca['cc']||'','bcc':_0x4d1cca[_0x7665('0x19e')]||'','subject':_0x4d1cca[_0x7665('0x19f')],'html':_0x4d1cca['text'],'text':_0x4d1cca['text']};var _0x5cf482={'tls':{'rejectUnauthorized':![]}};if(_0x3bee72[_0x7665('0x19a')][_0x7665('0x1a0')]){_0x5cf482['service']=_0x3bee72[_0x7665('0x19a')]['service'];}else{_0x5cf482[_0x7665('0x1a1')]=_0x3bee72[_0x7665('0x19a')][_0x7665('0x1a1')];_0x5cf482[_0x7665('0x1a2')]=_0x3bee72[_0x7665('0x19a')][_0x7665('0x1a2')];_0x5cf482[_0x7665('0x1a3')]=_0x3bee72[_0x7665('0x19a')][_0x7665('0x1a3')];}if(_0x3bee72['Smtp'][_0x7665('0x1a4')]){_0x5cf482[_0x7665('0x1a5')]={'user':_0x3bee72[_0x7665('0x19a')][_0x7665('0x19d')],'pass':_0x3bee72['Smtp']['pass']};}if(this[_0x7665('0xa7')](_0x4d1cca[_0x7665('0x1a6')])){}logger[_0x7665('0x1a7')](_0x7665('0x1a8'),JSON['stringify'](_0x3f011d));this[_0x7665('0x3a')]['sync'](this,_0x4d1cca,_0x4d1cca['account_id']);this['channel'][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x1a9'),_0x3bee72[_0x7665('0x18')]));this['sendMailMessage'][_0x7665('0xc7')](this,_0x5cf482,_0x3f011d);return this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0x1aa'));};AGIVertices[_0x7665('0x12')][_0x7665('0x1ab')]=function(_0x5ff973){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x1ac'),_0x5ff973[_0x7665('0xab')]));return this[_0x7665('0x10')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x7665('0x1ad')]=function(_0x637b6e){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x1ae'),_0x637b6e['label']));if(!this['isConfigured'](_0x637b6e[_0x7665('0x1af')])){return this['channel']['noop'](_0x7665('0x1b0'));}var _0x3cfc2e=this[_0x7665('0x38')][_0x7665('0xc7')](this,_0x637b6e[_0x7665('0x1af')]);if(!_0x3cfc2e){return this[_0x7665('0x10')][_0x7665('0x30')](_0x637b6e,_0x7665('0x1b1'));}var _0x32c3a1={'body':_0x637b6e[_0x7665('0x1b2')],'phone':_0x637b6e['to']||'','SmsAccountId':_0x3cfc2e['id']};logger[_0x7665('0x1a7')](_0x7665('0x1b3'),JSON['stringify'](_0x32c3a1));this['createSquareDetailsReport']['sync'](this,_0x637b6e,_0x637b6e['sms_account_id']);this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x1b4'),_0x3cfc2e[_0x7665('0x18')]));this[_0x7665('0x39')][_0x7665('0xc7')](this,_0x32c3a1);return this['channel'][_0x7665('0xac')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x7665('0x12')]['set']=function(_0x3e2747){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x1b5'),_0x3e2747[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x3e2747[_0x7665('0xe0')])){return this['channel'][_0x7665('0x30')](_0x3e2747,_0x7665('0x1b6'));}var _0x9e601f=this[_0x7665('0x13')]['sync'](this,_0x3e2747[_0x7665('0xe0')]);if(!_0x9e601f){return this[_0x7665('0x10')][_0x7665('0x30')](_0x3e2747,_0x7665('0xe2'));}return this['channel'][_0x7665('0xa6')](_0x9e601f,_0x3e2747[_0x7665('0x1b7')]);};AGIVertices[_0x7665('0x12')][_0x7665('0x1b8')]=function(_0x3d4f5b){logger[_0x7665('0x34')](util['format'](_0x7665('0x1b9'),_0x3d4f5b[_0x7665('0xab')]));this[_0x7665('0x10')][_0x7665('0xac')](_0x7665('0x1ba'));if(_0x3d4f5b['answer']===_0x7665('0x1bb')){this[_0x7665('0x10')][_0x7665('0xac')]('Answer');return this[_0x7665('0x10')][_0x7665('0xbe')]();}return this['channel'][_0x7665('0xac')](_0x7665('0x1bc'));};AGIVertices['prototype'][_0x7665('0x1bd')]=function(_0x3e7664){logger[_0x7665('0x34')](util['format'](_0x7665('0x1be'),_0x3e7664['label']));if(!this[_0x7665('0xa7')](_0x3e7664[_0x7665('0x1bf')])){return this[_0x7665('0x10')][_0x7665('0x30')](_0x3e7664,_0x7665('0x1c0'));}var _0x28023f=this[_0x7665('0x19')]['sync'](this,_0x3e7664[_0x7665('0x1bf')]);if(!this[_0x7665('0xa7')](_0x28023f)){return this[_0x7665('0x10')]['error'](_0x3e7664,util[_0x7665('0x2c')](_0x7665('0x1c1'),_0x3e7664['project_id']));}if(_0x28023f===this['channel'][_0x7665('0x3d')]){return this[_0x7665('0x10')][_0x7665('0x30')](_0x3e7664,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x7665('0x3a')][_0x7665('0xc7')](this,_0x3e7664,_0x28023f);var _0x12bef9=this[_0x7665('0x10')]['exec'](_0x7665('0x1c2'),util[_0x7665('0x2c')](_0x7665('0x1c3'),config[_0x7665('0x8')][_0x7665('0x1a1')]||'127.0.0.1',_0x28023f,this['channel']['arg_1']));if(_0x12bef9[_0x7665('0xa4')]===-0x1){return _0x12bef9;}return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')]('Executed\x20command\x20%s\x20%s',_0x7665('0x1c2'),_0x28023f));};AGIVertices[_0x7665('0x12')][_0x7665('0x1c4')]=function(_0x213bf6){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x1c5'),_0x213bf6[_0x7665('0xab')]));var _0x4cc141=this[_0x7665('0x59')][_0x7665('0xc7')](this,_0x213bf6[_0x7665('0xbc')]);this[_0x7665('0x3a')][_0x7665('0xc7')](this,_0x213bf6,_0x213bf6[_0x7665('0xbc')]);if(this[_0x7665('0xa7')](_0x213bf6[_0x7665('0xe0')])){var _0x3f5a68=this[_0x7665('0x13')][_0x7665('0xc7')](this,_0x213bf6['variable_id']);if(_0x3f5a68){this[_0x7665('0x10')][_0x7665('0xa6')](_0x3f5a68,_0x4cc141);return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x1c6'),_0x213bf6[_0x7665('0xbc')],_0x3f5a68));}}return this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x1c7'),_0x213bf6[_0x7665('0xbc')]));};AGIVertices['prototype'][_0x7665('0x1c8')]=function(_0xac45de){logger[_0x7665('0x34')](util['format'](_0x7665('0x1c9'),_0xac45de[_0x7665('0xab')]));_0xac45de[_0x7665('0x5e')]=_0xac45de[_0x7665('0x5e')][_0x7665('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7665('0xa7')](_0xac45de[_0x7665('0x1ca')])){return this[_0x7665('0x10')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x7665('0xa7')](_0xac45de[_0x7665('0x5e')])){return this[_0x7665('0x10')]['noop']('no\x20text\x20configured');}this['channel'][_0x7665('0xac')](util['format'](_0x7665('0x1cb'),_0xac45de[_0x7665('0x5e')]));var _0xec0020=this[_0x7665('0x5c')][_0x7665('0xc7')](this,_0xac45de);if(_0xec0020){this[_0x7665('0x10')][_0x7665('0xac')](util[_0x7665('0x2c')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0xec0020));var _0x5a8123=this[_0x7665('0x10')][_0x7665('0x157')](_0xec0020);try{fs['unlink'](_0xec0020+_0x7665('0x10a'));}catch(_0x31978a){logger[_0x7665('0x30')](_0x31978a);}return _0x5a8123;}return this['channel']['error'](_0xac45de,_0x7665('0x1cc'));};AGIVertices[_0x7665('0x12')][_0x7665('0x1cd')]=function(_0x1efa64){logger['info'](util[_0x7665('0x2c')](_0x7665('0x1ce'),_0x1efa64['label']));_0x1efa64[_0x7665('0x5e')]=_0x1efa64[_0x7665('0x5e')][_0x7665('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7665('0xa7')](_0x1efa64['text'])){return this['channel'][_0x7665('0xac')](_0x7665('0xad'));}this[_0x7665('0x10')][_0x7665('0xac')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x1efa64['text']));var _0x1b01f0=this[_0x7665('0x63')][_0x7665('0xc7')](this,_0x1efa64);if(_0x1b01f0){this['channel'][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x1cf'),_0x1b01f0));var _0x58f479=this['channel'][_0x7665('0x157')](_0x1b01f0);try{fs[_0x7665('0x109')](_0x1b01f0+_0x7665('0x10a'));}catch(_0x37de0a){logger['error'](_0x37de0a);}return _0x58f479;}return this[_0x7665('0x10')][_0x7665('0x30')](_0x1efa64,_0x7665('0x1d0'));};AGIVertices[_0x7665('0x12')][_0x7665('0x1d1')]=function(_0x150d83){logger[_0x7665('0x34')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x150d83['label']));if(!this[_0x7665('0xa7')](_0x150d83['findBy'])){return this[_0x7665('0x10')]['error'](_0x150d83,_0x7665('0x162'));}logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x15b'),this[_0x7665('0x10')]['callerid'],_0x150d83[_0x7665('0x15a')]));var _0x18760b=this['agentUnpause']['sync'](this,_0x150d83[_0x7665('0x15a')]);if(_0x18760b){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x15c'),this[_0x7665('0x10')][_0x7665('0x3e')],_0x150d83[_0x7665('0x15a')]));this[_0x7665('0x10')]['noop'](util[_0x7665('0x2c')](_0x7665('0x15c'),this[_0x7665('0x10')]['callerid'],_0x150d83[_0x7665('0x15a')]));return{'code':0xc8,'result':_0x7665('0x15d')};}else{logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x15e'),this['channel'][_0x7665('0x3e')],_0x150d83['findBy']));this['channel'][_0x7665('0xac')](util[_0x7665('0x2c')](_0x7665('0x15e'),this[_0x7665('0x10')]['callerid'],_0x150d83[_0x7665('0x15a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x7665('0x12')][_0x7665('0x1d2')]=function(_0x4cd132){logger[_0x7665('0x34')](util[_0x7665('0x2c')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4cd132[_0x7665('0xab')]));var _0x5d0c2d=this['channel']['exec'](_0x7665('0x1d3'),[_0x4cd132[_0x7665('0x1d4')],_0x4cd132[_0x7665('0x77')]]);if(_0x5d0c2d['result']===-0x1){return _0x5d0c2d;}return this[_0x7665('0x10')][_0x7665('0xac')](util['format'](_0x7665('0xcc'),_0x7665('0x1d3'),_0x4cd132[_0x7665('0x1d4')]));};AGIVertices[_0x7665('0x12')][_0x7665('0x1d5')]=function(_0x2f27b8){logger[_0x7665('0x34')](util[_0x7665('0x2c')](_0x7665('0x1d6'),_0x2f27b8[_0x7665('0xab')]));if(!this[_0x7665('0xa7')](_0x2f27b8['variable_id'])){return this['channel'][_0x7665('0x30')](_0x2f27b8,_0x7665('0x1b6'));}var _0x5d676d=this['getVariable'][_0x7665('0xc7')](this,_0x2f27b8[_0x7665('0xe0')]);if(!_0x5d676d){return this[_0x7665('0x10')][_0x7665('0x30')](_0x2f27b8,'no\x20variable\x20found');}var _0x58deec=this['channel'][_0x7665('0x13')](_0x5d676d);return{'code':0xc8,'result':_0x58deec[_0x7665('0xa1')]?_0x58deec['extra']:'-'};};String[_0x7665('0x12')][_0x7665('0x1d7')]=function(_0x572d4e,_0x173e79){return this['split'](_0x572d4e)['join'](_0x173e79);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 0fe29ed..fa462cf 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 _0x7a54=['[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','startAcw','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[ACW][START]\x20%s','prototype','[%s][TIMER][STOP][AGENT:%s]','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s'];(function(_0x1bd251,_0x338d85){var _0x29ef4c=function(_0x1072b2){while(--_0x1072b2){_0x1bd251['push'](_0x1bd251['shift']());}};_0x29ef4c(++_0x338d85);}(_0x7a54,0x106));var _0x47a5=function(_0x327568,_0x5b1b81){_0x327568=_0x327568-0x0;var _0x48c201=_0x7a54[_0x327568];return _0x48c201;};'use strict';var util=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var ami=require('../ami');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x47a5('0x5'));function Acw(_0x11bf85){this[_0x47a5('0x6')]=_0x11bf85[_0x47a5('0x6')];this[_0x47a5('0x7')]=_0x11bf85['agents'];this[_0x47a5('0x8')]=_0x11bf85['timers'];this[_0x47a5('0x9')]={};ami['on'](_0x47a5('0xa'),this['syncAgentConnect'][_0x47a5('0xb')](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on'](_0x47a5('0xc'),this[_0x47a5('0xd')]['bind'](this));ami['on'](_0x47a5('0xe'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x47a5('0xf'),this[_0x47a5('0x10')][_0x47a5('0xb')](this));ami['on'](_0x47a5('0x11'),this[_0x47a5('0x12')][_0x47a5('0xb')](this));ami['on'](_0x47a5('0x13'),this['syncAgentConnectPreview'][_0x47a5('0xb')](this));}function getDiff(_0x221b54){var _0x1cf309=moment()[_0x47a5('0x14')](0x0);var _0x139f25=moment(_0x221b54)[_0x47a5('0x14')](0x0);return _0x1cf309[_0x47a5('0x15')](_0x139f25,_0x47a5('0x16'));}Acw['prototype'][_0x47a5('0x17')]=function(_0x11faf5){try{var _0x3b001e=this;var _0x2a2cbb=this[_0x47a5('0x9')][_0x11faf5]['interface'];var _0x549de3=this[_0x47a5('0x9')][_0x11faf5]['queue'];var _0x5247fd=this[_0x47a5('0x6')][_0x549de3];var _0xaf70a6=![];var _0x2ce454=_0x47a5('0x18');if(_0x5247fd[_0x47a5('0x19')]){if(_0x5247fd[_0x47a5('0x1a')][_0x47a5('0x1b')]){_0xaf70a6=!![];_0x2ce454=_0x5247fd[_0x47a5('0x1a')][_0x47a5('0x1b')];}}ami['Action']({'action':_0x47a5('0x1c'),'interface':_0x2a2cbb,'paused':!![],'reason':_0x2ce454})[_0x47a5('0x1d')](function(_0x47cf3c){if(_0x3b001e[_0x47a5('0x7')][_0x2a2cbb]){return RpcUser[_0x47a5('0x1e')](_0x3b001e[_0x47a5('0x7')][_0x2a2cbb]['id'])['then'](function(_0xb8ae6c){if(_0xb8ae6c&&!_0xb8ae6c[_0x47a5('0x1f')]){logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x11faf5,_0x2a2cbb,_0x549de3);var _0x5ef1b1=_0x3b001e[_0x47a5('0x9')][_0x11faf5][_0x47a5('0x22')]&&_0x3b001e['channels'][_0x11faf5][_0x47a5('0x23')]?_0x3b001e[_0x47a5('0x9')][_0x11faf5][_0x47a5('0x23')]:_0x11faf5;return RpcUser[_0x47a5('0x24')](_0x3b001e[_0x47a5('0x7')][_0x2a2cbb],_0x2ce454,_0x5ef1b1)['then'](function(_0x53078a){if(!_0xaf70a6){_0x3b001e[_0x47a5('0x8')][_0x2a2cbb]={};logger['info'](_0x47a5('0x25'),_0x11faf5,_0x3b001e['voiceQueues'][_0x549de3][_0x47a5('0x26')],_0x2a2cbb,_0x549de3);_0x3b001e[_0x47a5('0x8')][_0x2a2cbb][_0x47a5('0x27')]=setTimeout(_0x3b001e[_0x47a5('0x28')][_0x47a5('0xb')](_0x3b001e,_0x2a2cbb),_0x3b001e[_0x47a5('0x6')][_0x549de3][_0x47a5('0x26')]*0x3e8);_0x3b001e[_0x47a5('0x8')][_0x2a2cbb][_0x47a5('0x29')]=moment()[_0x47a5('0x2a')](_0x47a5('0x2b'));_0x3b001e[_0x47a5('0x8')][_0x2a2cbb][_0x47a5('0x2c')]=_0x11faf5;_0x3b001e['timers'][_0x2a2cbb][_0x47a5('0x2d')]=_0x549de3;_0x3b001e['timers'][_0x2a2cbb][_0x47a5('0x2e')]=function(){var _0x9ac908=getDiff(_0x3b001e[_0x47a5('0x8')][_0x2a2cbb]['lastPauseAt']);clearTimeout(_0x3b001e[_0x47a5('0x8')][_0x2a2cbb][_0x47a5('0x27')]);_0x3b001e[_0x47a5('0x8')][_0x2a2cbb][_0x47a5('0x27')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x9ac908},_0x3b001e['timers'][_0x2a2cbb][_0x47a5('0x2c')],_0x2a2cbb)[_0x47a5('0x1d')](function(_0x5bd7eb){logger['info'](_0x47a5('0x2f'),_0x11faf5,_0x9ac908,_0x5bd7eb);})[_0x47a5('0x30')](function(_0x57bff6){logger[_0x47a5('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x11faf5,_0x57bff6);});delete _0x3b001e[_0x47a5('0x8')][_0x2a2cbb];};}});}else{logger[_0x47a5('0x20')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x11faf5,_0x2a2cbb,_0x549de3);}});}})['catch'](function(_0x274e34){logger['error'](_0x47a5('0x25'),_0x11faf5,_0x3b001e[_0x47a5('0x6')][_0x549de3][_0x47a5('0x26')],_0x2a2cbb,_0x549de3);})['finally'](function(){delete _0x3b001e[_0x47a5('0x9')][_0x11faf5];});}catch(_0x50c086){logger['error'](_0x47a5('0x32'),_0x50c086['message']);}};Acw[_0x47a5('0x33')]['stopAcw']=function(_0x21ad34){try{var _0x3534cb=this;if(_0x3534cb[_0x47a5('0x8')][_0x21ad34]){_0x3534cb[_0x47a5('0x8')][_0x21ad34][_0x47a5('0x27')]=![];var _0xed6320=_0x3534cb[_0x47a5('0x8')][_0x21ad34][_0x47a5('0x2c')];var _0x1a0d23=_0x3534cb['timers'][_0x21ad34][_0x47a5('0x2d')];var _0x10f136=_0x3534cb['voiceQueues'][_0x1a0d23][_0x47a5('0x26')];logger[_0x47a5('0x20')](_0x47a5('0x34'),_0xed6320,_0x21ad34);RpcUser['saveUnpause'](this[_0x47a5('0x7')][_0x21ad34]);RpcVoiceAgentReport[_0x47a5('0x35')]({'acwtime':_0x10f136,'agentacw':!![]},_0xed6320,_0x21ad34)['then'](function(_0x2ebba0){logger[_0x47a5('0x20')]('[%s][UPDATE][ACWTIME:%s]',_0xed6320,_0x10f136,_0x2ebba0);})['catch'](function(_0x5ebd8c){logger[_0x47a5('0x31')]('[%s][UPDATE][ERRORS:%s]',_0xed6320,_0x5ebd8c);});}else{logger[_0x47a5('0x31')](_0x47a5('0x36'),_0x21ad34);if(_0x3534cb[_0x47a5('0x8')]){logger[_0x47a5('0x20')](_0x47a5('0x37'),JSON[_0x47a5('0x38')](_0x3534cb[_0x47a5('0x8')]));}}}catch(_0x1f3d01){logger[_0x47a5('0x31')](_0x47a5('0x39'),_0x1f3d01[_0x47a5('0x3a')]);}};Acw[_0x47a5('0x33')][_0x47a5('0x3b')]=function(_0x56dbbd){try{if(this[_0x47a5('0x6')][_0x56dbbd[_0x47a5('0x2d')]]&&(this[_0x47a5('0x6')][_0x56dbbd[_0x47a5('0x2d')]]['acw']||this[_0x47a5('0x6')][_0x56dbbd['queue']]['mandatoryDisposition'])){if(this['agents'][_0x56dbbd['interface']]){this[_0x47a5('0x9')][_0x56dbbd['uniqueid']]={'queue':_0x56dbbd[_0x47a5('0x2d')],'interface':_0x56dbbd[_0x47a5('0x3c')],'destlinkedid':_0x56dbbd[_0x47a5('0x23')]};}}}catch(_0x494526){logger[_0x47a5('0x31')](_0x47a5('0x3d'),_0x494526['message']);}};Acw['prototype'][_0x47a5('0x3e')]=function(_0x4edf7f){try{if(this[_0x47a5('0x6')][_0x4edf7f[_0x47a5('0x2d')]]&&(this[_0x47a5('0x6')][_0x4edf7f[_0x47a5('0x2d')]][_0x47a5('0x4')]||this[_0x47a5('0x6')][_0x4edf7f[_0x47a5('0x2d')]][_0x47a5('0x19')])){if(this[_0x47a5('0x7')][_0x4edf7f[_0x47a5('0x3c')]]){this[_0x47a5('0x9')][_0x4edf7f[_0x47a5('0x2c')]]={'queue':_0x4edf7f[_0x47a5('0x2d')],'interface':_0x4edf7f[_0x47a5('0x3c')]};}}}catch(_0x4e5e7){logger[_0x47a5('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x4e5e7[_0x47a5('0x3a')]);}};Acw[_0x47a5('0x33')]['syncHangupRequest']=function(_0x52b3a8){try{if(this[_0x47a5('0x9')][_0x52b3a8['uniqueid']]&&_[_0x47a5('0x3f')](this[_0x47a5('0x9')][_0x52b3a8['uniqueid']]['attended'])){logger[_0x47a5('0x20')]('[%s][HANGUP:UNIQUEID]',_0x52b3a8[_0x47a5('0x2c')]);this[_0x47a5('0x17')](_0x52b3a8[_0x47a5('0x2c')]);}else if(this[_0x47a5('0x9')][_0x52b3a8[_0x47a5('0x40')]]&&_[_0x47a5('0x3f')](this[_0x47a5('0x9')][_0x52b3a8['linkedid']]['attended'])){logger[_0x47a5('0x20')](_0x47a5('0x41'),_0x52b3a8[_0x47a5('0x40')]);this[_0x47a5('0x17')](_0x52b3a8[_0x47a5('0x40')]);}}catch(_0x2c0c86){logger[_0x47a5('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x2c0c86[_0x47a5('0x3a')]);}};Acw[_0x47a5('0x33')][_0x47a5('0xd')]=function(_0x5c3c75){try{if(this[_0x47a5('0x9')][_0x5c3c75['uniqueid']]&&this[_0x47a5('0x9')][_0x5c3c75[_0x47a5('0x2c')]][_0x47a5('0x22')]){logger[_0x47a5('0x20')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5c3c75[_0x47a5('0x2c')]);this[_0x47a5('0x17')](_0x5c3c75[_0x47a5('0x2c')]);}else if(this[_0x47a5('0x9')][_0x5c3c75[_0x47a5('0x40')]]&&this[_0x47a5('0x9')][_0x5c3c75[_0x47a5('0x40')]]['attended']){logger[_0x47a5('0x20')](_0x47a5('0x42'),_0x5c3c75[_0x47a5('0x40')]);this[_0x47a5('0x17')](_0x5c3c75[_0x47a5('0x40')]);}}catch(_0x1ab0bf){logger['error'](_0x47a5('0x43'),_0x1ab0bf[_0x47a5('0x3a')]);}};Acw[_0x47a5('0x33')]['syncAttendedTransfer']=function(_0x4c5ed){try{if(!_[_0x47a5('0x44')](this[_0x47a5('0x9')][_0x4c5ed['transfereeuniqueid']])){this['startAcw'](_0x4c5ed[_0x47a5('0x45')]);if(this[_0x47a5('0x9')][_0x4c5ed['secondtransfereruniqueid']]){this['channels'][_0x4c5ed[_0x47a5('0x46')]]['attended']=!![];this[_0x47a5('0x9')][_0x4c5ed['transfertargetuniqueid']]=this['channels'][_0x4c5ed[_0x47a5('0x46')]];delete this[_0x47a5('0x9')][_0x4c5ed['secondtransfereruniqueid']];}}else if(!_[_0x47a5('0x44')](this[_0x47a5('0x9')][_0x4c5ed['transfertargetuniqueid']])){this['startAcw'](_0x4c5ed[_0x47a5('0x47')]);if(this[_0x47a5('0x9')][_0x4c5ed[_0x47a5('0x48')]]){this[_0x47a5('0x9')][_0x4c5ed['origtransfereruniqueid']][_0x47a5('0x22')]=!![];this[_0x47a5('0x9')][_0x4c5ed[_0x47a5('0x45')]]=this['channels'][_0x4c5ed[_0x47a5('0x48')]];delete this['channels'][_0x4c5ed[_0x47a5('0x48')]];}}}catch(_0x470da6){logger[_0x47a5('0x31')](_0x47a5('0x49'),_0x470da6[_0x47a5('0x3a')]);}};Acw['prototype'][_0x47a5('0x12')]=function(_0x5d1550){try{if(this['channels'][_0x5d1550['transfereruniqueid']]){logger['info'](_0x47a5('0x4a'),JSON[_0x47a5('0x38')](_0x5d1550[_0x47a5('0x4b')]));this['startAcw'](_0x5d1550['transfereruniqueid']);}else if(this[_0x47a5('0x9')][_0x5d1550[_0x47a5('0x4c')]]){logger[_0x47a5('0x20')](_0x47a5('0x4d'),JSON[_0x47a5('0x38')](_0x5d1550['transfererlinkedid']));this[_0x47a5('0x17')](_0x5d1550['transfererlinkedid']);}}catch(_0x22c886){logger[_0x47a5('0x31')]('[ACW][syncBlindTransfer]\x20%s',_0x22c886[_0x47a5('0x3a')]);}};Acw[_0x47a5('0x33')][_0x47a5('0x4e')]=function(_0x3e8274){try{if(this[_0x47a5('0x6')][_0x3e8274[_0x47a5('0x2d')]]&&this[_0x47a5('0x6')][_0x3e8274[_0x47a5('0x2d')]]['autopause']===_0x47a5('0x4f')){if(this[_0x47a5('0x7')][_0x3e8274[_0x47a5('0x3c')]]){logger[_0x47a5('0x20')](_0x47a5('0x50'),_0x3e8274['uniqueid'],_0x3e8274[_0x47a5('0x3c')],_0x3e8274[_0x47a5('0x2d')]);return RpcUser[_0x47a5('0x24')](this[_0x47a5('0x7')][_0x3e8274[_0x47a5('0x3c')]],_0x47a5('0x51'),_0x3e8274[_0x47a5('0x2c')]);}}}catch(_0x149d34){logger[_0x47a5('0x31')](_0x47a5('0x52'),_0x149d34[_0x47a5('0x3a')]);}};module[_0x47a5('0x53')]=Acw; \ No newline at end of file +var _0x7a54=['[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','startAcw','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[ACW][START]\x20%s','prototype','[%s][TIMER][STOP][AGENT:%s]','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s'];(function(_0x37f59e,_0x45b71f){var _0x1a8170=function(_0x2a456e){while(--_0x2a456e){_0x37f59e['push'](_0x37f59e['shift']());}};_0x1a8170(++_0x45b71f);}(_0x7a54,0x106));var _0x47a5=function(_0x54cab5,_0x2fdcee){_0x54cab5=_0x54cab5-0x0;var _0x579568=_0x7a54[_0x54cab5];return _0x579568;};'use strict';var util=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var ami=require('../ami');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x47a5('0x5'));function Acw(_0x11bf85){this[_0x47a5('0x6')]=_0x11bf85[_0x47a5('0x6')];this[_0x47a5('0x7')]=_0x11bf85['agents'];this[_0x47a5('0x8')]=_0x11bf85['timers'];this[_0x47a5('0x9')]={};ami['on'](_0x47a5('0xa'),this['syncAgentConnect'][_0x47a5('0xb')](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on'](_0x47a5('0xc'),this[_0x47a5('0xd')]['bind'](this));ami['on'](_0x47a5('0xe'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x47a5('0xf'),this[_0x47a5('0x10')][_0x47a5('0xb')](this));ami['on'](_0x47a5('0x11'),this[_0x47a5('0x12')][_0x47a5('0xb')](this));ami['on'](_0x47a5('0x13'),this['syncAgentConnectPreview'][_0x47a5('0xb')](this));}function getDiff(_0x221b54){var _0x1cf309=moment()[_0x47a5('0x14')](0x0);var _0x139f25=moment(_0x221b54)[_0x47a5('0x14')](0x0);return _0x1cf309[_0x47a5('0x15')](_0x139f25,_0x47a5('0x16'));}Acw['prototype'][_0x47a5('0x17')]=function(_0x11faf5){try{var _0x3b001e=this;var _0x2a2cbb=this[_0x47a5('0x9')][_0x11faf5]['interface'];var _0x549de3=this[_0x47a5('0x9')][_0x11faf5]['queue'];var _0x5247fd=this[_0x47a5('0x6')][_0x549de3];var _0xaf70a6=![];var _0x2ce454=_0x47a5('0x18');if(_0x5247fd[_0x47a5('0x19')]){if(_0x5247fd[_0x47a5('0x1a')][_0x47a5('0x1b')]){_0xaf70a6=!![];_0x2ce454=_0x5247fd[_0x47a5('0x1a')][_0x47a5('0x1b')];}}ami['Action']({'action':_0x47a5('0x1c'),'interface':_0x2a2cbb,'paused':!![],'reason':_0x2ce454})[_0x47a5('0x1d')](function(_0x47cf3c){if(_0x3b001e[_0x47a5('0x7')][_0x2a2cbb]){return RpcUser[_0x47a5('0x1e')](_0x3b001e[_0x47a5('0x7')][_0x2a2cbb]['id'])['then'](function(_0xb8ae6c){if(_0xb8ae6c&&!_0xb8ae6c[_0x47a5('0x1f')]){logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x11faf5,_0x2a2cbb,_0x549de3);var _0x5ef1b1=_0x3b001e[_0x47a5('0x9')][_0x11faf5][_0x47a5('0x22')]&&_0x3b001e['channels'][_0x11faf5][_0x47a5('0x23')]?_0x3b001e[_0x47a5('0x9')][_0x11faf5][_0x47a5('0x23')]:_0x11faf5;return RpcUser[_0x47a5('0x24')](_0x3b001e[_0x47a5('0x7')][_0x2a2cbb],_0x2ce454,_0x5ef1b1)['then'](function(_0x53078a){if(!_0xaf70a6){_0x3b001e[_0x47a5('0x8')][_0x2a2cbb]={};logger['info'](_0x47a5('0x25'),_0x11faf5,_0x3b001e['voiceQueues'][_0x549de3][_0x47a5('0x26')],_0x2a2cbb,_0x549de3);_0x3b001e[_0x47a5('0x8')][_0x2a2cbb][_0x47a5('0x27')]=setTimeout(_0x3b001e[_0x47a5('0x28')][_0x47a5('0xb')](_0x3b001e,_0x2a2cbb),_0x3b001e[_0x47a5('0x6')][_0x549de3][_0x47a5('0x26')]*0x3e8);_0x3b001e[_0x47a5('0x8')][_0x2a2cbb][_0x47a5('0x29')]=moment()[_0x47a5('0x2a')](_0x47a5('0x2b'));_0x3b001e[_0x47a5('0x8')][_0x2a2cbb][_0x47a5('0x2c')]=_0x11faf5;_0x3b001e['timers'][_0x2a2cbb][_0x47a5('0x2d')]=_0x549de3;_0x3b001e['timers'][_0x2a2cbb][_0x47a5('0x2e')]=function(){var _0x9ac908=getDiff(_0x3b001e[_0x47a5('0x8')][_0x2a2cbb]['lastPauseAt']);clearTimeout(_0x3b001e[_0x47a5('0x8')][_0x2a2cbb][_0x47a5('0x27')]);_0x3b001e[_0x47a5('0x8')][_0x2a2cbb][_0x47a5('0x27')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x9ac908},_0x3b001e['timers'][_0x2a2cbb][_0x47a5('0x2c')],_0x2a2cbb)[_0x47a5('0x1d')](function(_0x5bd7eb){logger['info'](_0x47a5('0x2f'),_0x11faf5,_0x9ac908,_0x5bd7eb);})[_0x47a5('0x30')](function(_0x57bff6){logger[_0x47a5('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x11faf5,_0x57bff6);});delete _0x3b001e[_0x47a5('0x8')][_0x2a2cbb];};}});}else{logger[_0x47a5('0x20')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x11faf5,_0x2a2cbb,_0x549de3);}});}})['catch'](function(_0x274e34){logger['error'](_0x47a5('0x25'),_0x11faf5,_0x3b001e[_0x47a5('0x6')][_0x549de3][_0x47a5('0x26')],_0x2a2cbb,_0x549de3);})['finally'](function(){delete _0x3b001e[_0x47a5('0x9')][_0x11faf5];});}catch(_0x50c086){logger['error'](_0x47a5('0x32'),_0x50c086['message']);}};Acw[_0x47a5('0x33')]['stopAcw']=function(_0x21ad34){try{var _0x3534cb=this;if(_0x3534cb[_0x47a5('0x8')][_0x21ad34]){_0x3534cb[_0x47a5('0x8')][_0x21ad34][_0x47a5('0x27')]=![];var _0xed6320=_0x3534cb[_0x47a5('0x8')][_0x21ad34][_0x47a5('0x2c')];var _0x1a0d23=_0x3534cb['timers'][_0x21ad34][_0x47a5('0x2d')];var _0x10f136=_0x3534cb['voiceQueues'][_0x1a0d23][_0x47a5('0x26')];logger[_0x47a5('0x20')](_0x47a5('0x34'),_0xed6320,_0x21ad34);RpcUser['saveUnpause'](this[_0x47a5('0x7')][_0x21ad34]);RpcVoiceAgentReport[_0x47a5('0x35')]({'acwtime':_0x10f136,'agentacw':!![]},_0xed6320,_0x21ad34)['then'](function(_0x2ebba0){logger[_0x47a5('0x20')]('[%s][UPDATE][ACWTIME:%s]',_0xed6320,_0x10f136,_0x2ebba0);})['catch'](function(_0x5ebd8c){logger[_0x47a5('0x31')]('[%s][UPDATE][ERRORS:%s]',_0xed6320,_0x5ebd8c);});}else{logger[_0x47a5('0x31')](_0x47a5('0x36'),_0x21ad34);if(_0x3534cb[_0x47a5('0x8')]){logger[_0x47a5('0x20')](_0x47a5('0x37'),JSON[_0x47a5('0x38')](_0x3534cb[_0x47a5('0x8')]));}}}catch(_0x1f3d01){logger[_0x47a5('0x31')](_0x47a5('0x39'),_0x1f3d01[_0x47a5('0x3a')]);}};Acw[_0x47a5('0x33')][_0x47a5('0x3b')]=function(_0x56dbbd){try{if(this[_0x47a5('0x6')][_0x56dbbd[_0x47a5('0x2d')]]&&(this[_0x47a5('0x6')][_0x56dbbd[_0x47a5('0x2d')]]['acw']||this[_0x47a5('0x6')][_0x56dbbd['queue']]['mandatoryDisposition'])){if(this['agents'][_0x56dbbd['interface']]){this[_0x47a5('0x9')][_0x56dbbd['uniqueid']]={'queue':_0x56dbbd[_0x47a5('0x2d')],'interface':_0x56dbbd[_0x47a5('0x3c')],'destlinkedid':_0x56dbbd[_0x47a5('0x23')]};}}}catch(_0x494526){logger[_0x47a5('0x31')](_0x47a5('0x3d'),_0x494526['message']);}};Acw['prototype'][_0x47a5('0x3e')]=function(_0x4edf7f){try{if(this[_0x47a5('0x6')][_0x4edf7f[_0x47a5('0x2d')]]&&(this[_0x47a5('0x6')][_0x4edf7f[_0x47a5('0x2d')]][_0x47a5('0x4')]||this[_0x47a5('0x6')][_0x4edf7f[_0x47a5('0x2d')]][_0x47a5('0x19')])){if(this[_0x47a5('0x7')][_0x4edf7f[_0x47a5('0x3c')]]){this[_0x47a5('0x9')][_0x4edf7f[_0x47a5('0x2c')]]={'queue':_0x4edf7f[_0x47a5('0x2d')],'interface':_0x4edf7f[_0x47a5('0x3c')]};}}}catch(_0x4e5e7){logger[_0x47a5('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x4e5e7[_0x47a5('0x3a')]);}};Acw[_0x47a5('0x33')]['syncHangupRequest']=function(_0x52b3a8){try{if(this[_0x47a5('0x9')][_0x52b3a8['uniqueid']]&&_[_0x47a5('0x3f')](this[_0x47a5('0x9')][_0x52b3a8['uniqueid']]['attended'])){logger[_0x47a5('0x20')]('[%s][HANGUP:UNIQUEID]',_0x52b3a8[_0x47a5('0x2c')]);this[_0x47a5('0x17')](_0x52b3a8[_0x47a5('0x2c')]);}else if(this[_0x47a5('0x9')][_0x52b3a8[_0x47a5('0x40')]]&&_[_0x47a5('0x3f')](this[_0x47a5('0x9')][_0x52b3a8['linkedid']]['attended'])){logger[_0x47a5('0x20')](_0x47a5('0x41'),_0x52b3a8[_0x47a5('0x40')]);this[_0x47a5('0x17')](_0x52b3a8[_0x47a5('0x40')]);}}catch(_0x2c0c86){logger[_0x47a5('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x2c0c86[_0x47a5('0x3a')]);}};Acw[_0x47a5('0x33')][_0x47a5('0xd')]=function(_0x5c3c75){try{if(this[_0x47a5('0x9')][_0x5c3c75['uniqueid']]&&this[_0x47a5('0x9')][_0x5c3c75[_0x47a5('0x2c')]][_0x47a5('0x22')]){logger[_0x47a5('0x20')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5c3c75[_0x47a5('0x2c')]);this[_0x47a5('0x17')](_0x5c3c75[_0x47a5('0x2c')]);}else if(this[_0x47a5('0x9')][_0x5c3c75[_0x47a5('0x40')]]&&this[_0x47a5('0x9')][_0x5c3c75[_0x47a5('0x40')]]['attended']){logger[_0x47a5('0x20')](_0x47a5('0x42'),_0x5c3c75[_0x47a5('0x40')]);this[_0x47a5('0x17')](_0x5c3c75[_0x47a5('0x40')]);}}catch(_0x1ab0bf){logger['error'](_0x47a5('0x43'),_0x1ab0bf[_0x47a5('0x3a')]);}};Acw[_0x47a5('0x33')]['syncAttendedTransfer']=function(_0x4c5ed){try{if(!_[_0x47a5('0x44')](this[_0x47a5('0x9')][_0x4c5ed['transfereeuniqueid']])){this['startAcw'](_0x4c5ed[_0x47a5('0x45')]);if(this[_0x47a5('0x9')][_0x4c5ed['secondtransfereruniqueid']]){this['channels'][_0x4c5ed[_0x47a5('0x46')]]['attended']=!![];this[_0x47a5('0x9')][_0x4c5ed['transfertargetuniqueid']]=this['channels'][_0x4c5ed[_0x47a5('0x46')]];delete this[_0x47a5('0x9')][_0x4c5ed['secondtransfereruniqueid']];}}else if(!_[_0x47a5('0x44')](this[_0x47a5('0x9')][_0x4c5ed['transfertargetuniqueid']])){this['startAcw'](_0x4c5ed[_0x47a5('0x47')]);if(this[_0x47a5('0x9')][_0x4c5ed[_0x47a5('0x48')]]){this[_0x47a5('0x9')][_0x4c5ed['origtransfereruniqueid']][_0x47a5('0x22')]=!![];this[_0x47a5('0x9')][_0x4c5ed[_0x47a5('0x45')]]=this['channels'][_0x4c5ed[_0x47a5('0x48')]];delete this['channels'][_0x4c5ed[_0x47a5('0x48')]];}}}catch(_0x470da6){logger[_0x47a5('0x31')](_0x47a5('0x49'),_0x470da6[_0x47a5('0x3a')]);}};Acw['prototype'][_0x47a5('0x12')]=function(_0x5d1550){try{if(this['channels'][_0x5d1550['transfereruniqueid']]){logger['info'](_0x47a5('0x4a'),JSON[_0x47a5('0x38')](_0x5d1550[_0x47a5('0x4b')]));this['startAcw'](_0x5d1550['transfereruniqueid']);}else if(this[_0x47a5('0x9')][_0x5d1550[_0x47a5('0x4c')]]){logger[_0x47a5('0x20')](_0x47a5('0x4d'),JSON[_0x47a5('0x38')](_0x5d1550['transfererlinkedid']));this[_0x47a5('0x17')](_0x5d1550['transfererlinkedid']);}}catch(_0x22c886){logger[_0x47a5('0x31')]('[ACW][syncBlindTransfer]\x20%s',_0x22c886[_0x47a5('0x3a')]);}};Acw[_0x47a5('0x33')][_0x47a5('0x4e')]=function(_0x3e8274){try{if(this[_0x47a5('0x6')][_0x3e8274[_0x47a5('0x2d')]]&&this[_0x47a5('0x6')][_0x3e8274[_0x47a5('0x2d')]]['autopause']===_0x47a5('0x4f')){if(this[_0x47a5('0x7')][_0x3e8274[_0x47a5('0x3c')]]){logger[_0x47a5('0x20')](_0x47a5('0x50'),_0x3e8274['uniqueid'],_0x3e8274[_0x47a5('0x3c')],_0x3e8274[_0x47a5('0x2d')]);return RpcUser[_0x47a5('0x24')](this[_0x47a5('0x7')][_0x3e8274[_0x47a5('0x3c')]],_0x47a5('0x51'),_0x3e8274[_0x47a5('0x2c')]);}}}catch(_0x149d34){logger[_0x47a5('0x31')](_0x47a5('0x52'),_0x149d34[_0x47a5('0x3a')]);}};module[_0x47a5('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 5c848ff..dc100b0 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 _0xff8c=['asterisk-manager','bluebird','moment','lodash','ami','../../config/environment','port','asterisk','username','keepConnected','Action','promisify','action','error','format','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','log','exports'];(function(_0x1b6e39,_0x43f894){var _0x52882d=function(_0x342d89){while(--_0x342d89){_0x1b6e39['push'](_0x1b6e39['shift']());}};_0x52882d(++_0x43f894);}(_0xff8c,0xaa));var _0xcff8=function(_0x4f67a2,_0x273325){_0x4f67a2=_0x4f67a2-0x0;var _0x42beb3=_0xff8c[_0x4f67a2];return _0x42beb3;};'use strict';var Manager=require(_0xcff8('0x0'));var BPromise=require(_0xcff8('0x1'));var moment=require(_0xcff8('0x2'));var util=require('util');var _=require(_0xcff8('0x3'));var logger=require('../../config/logger')(_0xcff8('0x4'));var config=require(_0xcff8('0x5'));var ami=new Manager(config['asterisk'][_0xcff8('0x6')],config['asterisk']['ip'],config[_0xcff8('0x7')][_0xcff8('0x8')],config['asterisk']['password'],!![]);ami[_0xcff8('0x9')]();ami[_0xcff8('0xa')]=BPromise[_0xcff8('0xb')](ami[_0xcff8('0xc')]);function error(_0x4e9b5b){logger[_0xcff8('0xd')](util[_0xcff8('0xe')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xcff8('0x7')]['username'],config['asterisk']['ip'],config['asterisk'][_0xcff8('0x6')],util['inspect'](_0x4e9b5b,![],null)));}function close(){logger['error'](util[_0xcff8('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xcff8('0x7')][_0xcff8('0x8')],config[_0xcff8('0x7')]['ip'],config['asterisk']['port']));}ami[_0xcff8('0xf')]=function(){return function(){return ami[_0xcff8('0xa')]({'action':_0xcff8('0x10')});};};ami[_0xcff8('0x11')]=function(){return function(){return ami[_0xcff8('0xa')]({'action':'devicestatelist'});};};ami[_0xcff8('0x12')]=function(){return function(){return ami[_0xcff8('0xa')]({'action':'sippeerstatus'});};};ami[_0xcff8('0x13')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0xcff8('0x14')]=function(){return function(){return ami[_0xcff8('0xa')]({'action':_0xcff8('0x15')});};};function connect(_0x2c8726){logger[_0xcff8('0x16')](util[_0xcff8('0xe')](_0xcff8('0x17'),config[_0xcff8('0x7')][_0xcff8('0x8')],config['asterisk']['ip'],config['asterisk'][_0xcff8('0x6')]));ami[_0xcff8('0x18')](_0xcff8('0xd'),error);ami[_0xcff8('0x18')]('close',close);}ami['on']('connect',connect);ami['on'](_0xcff8('0x19'),function(_0x5c9035){logger[_0xcff8('0x16')](util[_0xcff8('0xe')](_0xcff8('0x1a'),config[_0xcff8('0x7')][_0xcff8('0x8')],config[_0xcff8('0x7')]['ip'],config[_0xcff8('0x7')][_0xcff8('0x6')],util[_0xcff8('0x1b')](_0x5c9035,![],null)));});ami['on'](_0xcff8('0x1c'),function(_0x5b7a89){logger['info'](util[_0xcff8('0xe')](_0xcff8('0x1d'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xcff8('0x7')][_0xcff8('0x6')]));return BPromise['resolve']()['then'](ami['actionSipShowRegistry']())[_0xcff8('0x1e')](ami[_0xcff8('0x11')]())['then'](ami[_0xcff8('0x12')]())[_0xcff8('0x1e')](ami[_0xcff8('0x13')]())[_0xcff8('0x1e')](ami[_0xcff8('0x14')]())[_0xcff8('0x1f')](function(_0xd33e43){console[_0xcff8('0x20')](_0xd33e43);});});ami[_0xcff8('0x18')](_0xcff8('0xd'),error);ami[_0xcff8('0x18')]('close',close);module[_0xcff8('0x21')]=ami; \ No newline at end of file +var _0x6717=['actionDeviceStateList','log','close','exports','bluebird','moment','util','../../config/logger','../../config/environment','asterisk','port','keepConnected','Action','promisify','action','format','username','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then'];(function(_0xa79445,_0x29c91d){var _0x515dbd=function(_0x352944){while(--_0x352944){_0xa79445['push'](_0xa79445['shift']());}};_0x515dbd(++_0x29c91d);}(_0x6717,0xb8));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x7671('0x0'));var moment=require(_0x7671('0x1'));var util=require(_0x7671('0x2'));var _=require('lodash');var logger=require(_0x7671('0x3'))('ami');var config=require(_0x7671('0x4'));var ami=new Manager(config[_0x7671('0x5')][_0x7671('0x6')],config[_0x7671('0x5')]['ip'],config[_0x7671('0x5')]['username'],config[_0x7671('0x5')]['password'],!![]);ami[_0x7671('0x7')]();ami[_0x7671('0x8')]=BPromise[_0x7671('0x9')](ami[_0x7671('0xa')]);function error(_0x51dc25){logger['error'](util[_0x7671('0xb')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x7671('0x5')][_0x7671('0xc')],config['asterisk']['ip'],config[_0x7671('0x5')][_0x7671('0x6')],util['inspect'](_0x51dc25,![],null)));}function close(){logger[_0x7671('0xd')](util['format'](_0x7671('0xe'),config[_0x7671('0x5')][_0x7671('0xc')],config[_0x7671('0x5')]['ip'],config[_0x7671('0x5')][_0x7671('0x6')]));}ami[_0x7671('0xf')]=function(){return function(){return ami[_0x7671('0x8')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7671('0x8')]({'action':'devicestatelist'});};};ami[_0x7671('0x10')]=function(){return function(){return ami[_0x7671('0x8')]({'action':_0x7671('0x11')});};};ami[_0x7671('0x12')]=function(){return function(){return ami[_0x7671('0x8')]({'action':_0x7671('0x13')});};};ami[_0x7671('0x14')]=function(){return function(){return ami['Action']({'action':_0x7671('0x15')});};};function connect(_0x128ebb){logger[_0x7671('0x16')](util[_0x7671('0xb')](_0x7671('0x17'),config[_0x7671('0x5')]['username'],config['asterisk']['ip'],config['asterisk'][_0x7671('0x6')]));ami[_0x7671('0x18')](_0x7671('0xd'),error);ami[_0x7671('0x18')]('close',close);}ami['on'](_0x7671('0x19'),connect);ami['on'](_0x7671('0x1a'),function(_0x2b9164){logger[_0x7671('0x16')](util[_0x7671('0xb')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x7671('0x5')][_0x7671('0xc')],config[_0x7671('0x5')]['ip'],config[_0x7671('0x5')]['port'],util[_0x7671('0x1b')](_0x2b9164,![],null)));});ami['on'](_0x7671('0x1c'),function(_0x2ca423){logger[_0x7671('0x16')](util[_0x7671('0xb')](_0x7671('0x1d'),config[_0x7671('0x5')][_0x7671('0xc')],config[_0x7671('0x5')]['ip'],config['asterisk'][_0x7671('0x6')]));return BPromise[_0x7671('0x1e')]()['then'](ami[_0x7671('0xf')]())[_0x7671('0x1f')](ami[_0x7671('0x20')]())['then'](ami[_0x7671('0x10')]())['then'](ami[_0x7671('0x12')]())[_0x7671('0x1f')](ami[_0x7671('0x14')]())['catch'](function(_0x7158a7){console[_0x7671('0x21')](_0x7158a7);});});ami[_0x7671('0x18')](_0x7671('0xd'),error);ami[_0x7671('0x18')](_0x7671('0x22'),close);module[_0x7671('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index e55d64e..d18a2be 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 _0x5064=['debug','rpc','memberReport','error','message','result','exports','jayson/promise','../../config/logger','client','http','then'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5064,0x103));var _0x4506=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5064[_0x1facfa];return _0x9ec701;};'use strict';var jayson=require(_0x4506('0x0'));var BPromise=require('bluebird');var logger=require(_0x4506('0x1'))('ami');var client=jayson[_0x4506('0x2')][_0x4506('0x3')]({'port':0x2329});client['Request']=function(_0x26c81c,_0x5a5f4d){return new BPromise(function(_0x3506ef,_0xbc777a){return client['request'](_0x26c81c,_0x5a5f4d)[_0x4506('0x4')](function(_0x3cc3dc){logger[_0x4506('0x5')](_0x4506('0x6'),_0x4506('0x7'),_0x26c81c,_0x5a5f4d,_0x3cc3dc);if(_0x3cc3dc[_0x4506('0x8')]){logger[_0x4506('0x8')]('rpc',_0x4506('0x7'),_0x26c81c,_0x3cc3dc[_0x4506('0x8')]['message'],_0x5a5f4d);return _0xbc777a(_0x3cc3dc['error'][_0x4506('0x9')]);}else{return _0x3506ef(_0x3cc3dc[_0x4506('0xa')]);}})['catch'](function(_0x38943f){logger['error'](_0x4506('0x6'),'memberReport',_0x26c81c,_0x38943f,_0x5a5f4d);return _0xbc777a(_0x38943f);});});};module[_0x4506('0xb')]=client; \ No newline at end of file +var _0xbddc=['client','http','Request','request','then','debug','rpc','memberReport','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xbddc,0x161));var _0xcbdd=function(_0x56783d,_0x2d4123){_0x56783d=_0x56783d-0x0;var _0x39e462=_0xbddc[_0x56783d];return _0x39e462;};'use strict';var jayson=require(_0xcbdd('0x0'));var BPromise=require(_0xcbdd('0x1'));var logger=require(_0xcbdd('0x2'))(_0xcbdd('0x3'));var client=jayson[_0xcbdd('0x4')][_0xcbdd('0x5')]({'port':0x2329});client[_0xcbdd('0x6')]=function(_0x36851b,_0x4dde03){return new BPromise(function(_0x4f15a9,_0x2c4b66){return client[_0xcbdd('0x7')](_0x36851b,_0x4dde03)[_0xcbdd('0x8')](function(_0x518088){logger[_0xcbdd('0x9')](_0xcbdd('0xa'),_0xcbdd('0xb'),_0x36851b,_0x4dde03,_0x518088);if(_0x518088[_0xcbdd('0xc')]){logger[_0xcbdd('0xc')]('rpc',_0xcbdd('0xb'),_0x36851b,_0x518088[_0xcbdd('0xc')]['message'],_0x4dde03);return _0x2c4b66(_0x518088[_0xcbdd('0xc')][_0xcbdd('0xd')]);}else{return _0x4f15a9(_0x518088[_0xcbdd('0xe')]);}})[_0xcbdd('0xf')](function(_0x4737c8){logger[_0xcbdd('0xc')]('rpc','memberReport',_0x36851b,_0x4737c8,_0x4dde03);return _0x2c4b66(_0x4737c8);});});};module[_0xcbdd('0x10')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 397dce4..aafd54e 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ded=['UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','queue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x4ded,0x116));var _0xd4de=function(_0x563b53,_0x4ab9c4){_0x563b53=_0x563b53-0x0;var _0x43a68f=_0x4ded[_0x563b53];return _0x43a68f;};'use strict';var util=require(_0xd4de('0x0'));var _=require(_0xd4de('0x1'));var moment=require(_0xd4de('0x2'));function checkNameSurname(_0x1fa334,_0x2349f5,_0x377530){var _0x1b2252='';if(!_[_0xd4de('0x3')](_0x2349f5)&&_0xd4de('0x4')===typeof _0x2349f5){_0x1b2252+=_0x2349f5;}if(!_[_0xd4de('0x3')](_0x377530)&&_0xd4de('0x4')===typeof _0x377530){_0x1b2252+='\x20'+_0x377530;}if(_0x1b2252!==''){return _0x1b2252;}return _0x1fa334;}function Action(_0x8fbe6a,_0x554a51,_0x23e5b9){this[_0xd4de('0x5')]=_0x8fbe6a;this[_0xd4de('0x6')]=_0x23e5b9||undefined;this[_0xd4de('0x7')]=checkNameSurname(_0x554a51[_0xd4de('0x8')][_0xd4de('0x9')],_0x554a51['Contact'][_0xd4de('0xa')],_0x554a51['Contact']['lastName']);this['number']=_0x554a51[_0xd4de('0x8')][_0xd4de('0x9')];this['queue']=_0x8fbe6a['name'];this['active']=_0x554a51[_0xd4de('0xb')]||![];this['type']=_0x8fbe6a[_0xd4de('0xc')];this[_0xd4de('0xd')]=_0x8fbe6a[_0xd4de('0xd')]||0x3;this[_0xd4de('0xe')]=_0x554a51[_0xd4de('0xe')];this[_0xd4de('0xf')]=_0x554a51[_0xd4de('0xf')];this[_0xd4de('0x10')]=_0x554a51[_0xd4de('0x10')];this[_0xd4de('0x11')]=_0x554a51[_0xd4de('0x11')];this[_0xd4de('0x12')]=_0x554a51[_0xd4de('0x12')];this[_0xd4de('0x13')]=_0x554a51[_0xd4de('0x13')];this[_0xd4de('0x14')]=_0x554a51[_0xd4de('0x14')];this['countmachineretry']=_0x554a51['countmachineretry'];this[_0xd4de('0x15')]=_0x554a51[_0xd4de('0x15')];this[_0xd4de('0x16')]=_0x554a51[_0xd4de('0x16')];this['ListId']=_0x554a51['ListId'];this[_0xd4de('0x17')]=_0x554a51['UserId'];this[_0xd4de('0x18')]=_0x554a51[_0xd4de('0x18')];this['CampaignId']=_0x554a51[_0xd4de('0x19')];this['idHopper']=_0x554a51['id'];this[_0xd4de('0x1a')]=_0x554a51[_0xd4de('0x8')][_0xd4de('0xa')]||'';this[_0xd4de('0x1b')]=moment()['format'](_0xd4de('0x1c'));this[_0xd4de('0x1d')]=_0x554a51[_0xd4de('0x1d')];this[_0xd4de('0x1e')]=_0x554a51[_0xd4de('0x1e')];this[_0xd4de('0x1f')]=_0x554a51[_0xd4de('0x1f')];this[_0xd4de('0x20')]=_0x554a51[_0xd4de('0x20')];this[_0xd4de('0x21')]='';this['originatecalleridname']='';}Action[_0xd4de('0x22')][_0xd4de('0x23')]=function(){return util[_0xd4de('0x24')](_0xd4de('0x25'),this[_0xd4de('0x7')],this[_0xd4de('0x5')][_0xd4de('0x26')]>0x0?this[_0xd4de('0x27')][_0xd4de('0x28')](this[_0xd4de('0x5')][_0xd4de('0x26')]):this[_0xd4de('0x27')]);};Action['prototype'][_0xd4de('0x29')]=function(){return this[_0xd4de('0x2a')];};module['exports']=Action; \ No newline at end of file +var _0x1123=['recallme','prototype','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','queue','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat'];(function(_0x1104d6,_0x1020cf){var _0x44463c=function(_0x178473){while(--_0x178473){_0x1104d6['push'](_0x1104d6['shift']());}};_0x44463c(++_0x1020cf);}(_0x1123,0x118));var _0x3112=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1123[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3112('0x0'));function checkNameSurname(_0x558da2,_0x1baf4e,_0x324dd8){var _0x17f650='';if(!_['isNil'](_0x1baf4e)&&'string'===typeof _0x1baf4e){_0x17f650+=_0x1baf4e;}if(!_[_0x3112('0x1')](_0x324dd8)&&_0x3112('0x2')===typeof _0x324dd8){_0x17f650+='\x20'+_0x324dd8;}if(_0x17f650!==''){return _0x17f650;}return _0x558da2;}function Action(_0x21752a,_0x34ad01,_0xc4b189){this[_0x3112('0x3')]=_0x21752a;this[_0x3112('0x4')]=_0xc4b189||undefined;this[_0x3112('0x5')]=checkNameSurname(_0x34ad01[_0x3112('0x6')]['phone'],_0x34ad01[_0x3112('0x6')][_0x3112('0x7')],_0x34ad01[_0x3112('0x6')][_0x3112('0x8')]);this[_0x3112('0x9')]=_0x34ad01[_0x3112('0x6')]['phone'];this['queue']=_0x21752a[_0x3112('0x5')];this[_0x3112('0xa')]=_0x34ad01[_0x3112('0xa')]||![];this[_0x3112('0xb')]=_0x21752a[_0x3112('0xb')];this['dialQueueTimeout']=_0x21752a[_0x3112('0xc')]||0x3;this['scheduledat']=_0x34ad01['scheduledat'];this[_0x3112('0xd')]=_0x34ad01[_0x3112('0xd')];this[_0x3112('0xe')]=_0x34ad01['countcongestionretry'];this['countnoanswerretry']=_0x34ad01[_0x3112('0xf')];this['countnosuchnumberretry']=_0x34ad01[_0x3112('0x10')];this['countdropretry']=_0x34ad01['countdropretry'];this[_0x3112('0x11')]=_0x34ad01[_0x3112('0x11')];this['countmachineretry']=_0x34ad01[_0x3112('0x12')];this[_0x3112('0x13')]=_0x34ad01['countagentrejectretry'];this['ContactId']=_0x34ad01[_0x3112('0x14')];this['ListId']=_0x34ad01[_0x3112('0x15')];this[_0x3112('0x16')]=_0x34ad01['UserId'];this['VoiceQueueId']=_0x34ad01[_0x3112('0x17')];this[_0x3112('0x18')]=_0x34ad01[_0x3112('0x18')];this[_0x3112('0x19')]=_0x34ad01['id'];this[_0x3112('0x1a')]=_0x34ad01[_0x3112('0x6')]['firstName']||'';this[_0x3112('0x1b')]=moment()['format'](_0x3112('0x1c'));this[_0x3112('0x1d')]=_0x34ad01[_0x3112('0x1d')];this[_0x3112('0x1e')]=_0x34ad01[_0x3112('0x1e')];this['callbackat']=_0x34ad01[_0x3112('0x1f')];this['recallme']=_0x34ad01[_0x3112('0x20')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x3112('0x21')]['getCaller']=function(){return util[_0x3112('0x22')](_0x3112('0x23'),this[_0x3112('0x5')],this['voiceQueue'][_0x3112('0x24')]>0x0?this[_0x3112('0x9')][_0x3112('0x25')](this[_0x3112('0x3')]['dialCutDigit']):this[_0x3112('0x9')]);};Action[_0x3112('0x21')]['getQueue']=function(){return this[_0x3112('0x26')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 7430e0f..99a30dd 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2371=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','calleridnum','number','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','talktime','endtime','membername'];(function(_0x58e0fe,_0x5c96a4){var _0x5d9a83=function(_0x1de47f){while(--_0x1de47f){_0x58e0fe['push'](_0x58e0fe['shift']());}};_0x5d9a83(++_0x5c96a4);}(_0x2371,0x1bd));var _0x1237=function(_0xea35d1,_0x302471){_0xea35d1=_0xea35d1-0x0;var _0x1d7a7c=_0x2371[_0xea35d1];return _0x1d7a7c;};'use strict';var util=require('util');var _=require(_0x1237('0x0'));var moment=require(_0x1237('0x1'));function getSeconds(_0x2eae11,_0x2abf60){var _0x438dbd=moment(_0x2eae11)['milliseconds'](0x0);var _0x5e051c=moment(_0x2abf60)[_0x1237('0x2')](0x0);return _0x438dbd[_0x1237('0x3')](_0x5e051c,_0x1237('0x4'));}function AgentComplete(_0x366dc5,_0x4682fb){this['state']=0x4;this[_0x1237('0x5')]=_0x1237('0x6');this[_0x1237('0x7')]=_0x366dc5[_0x1237('0x7')];this[_0x1237('0x8')]=_0x366dc5[_0x1237('0x8')];this[_0x1237('0x9')]=_0x366dc5[_0x1237('0x8')]===_0x1237('0xa')?_0x1237('0xb'):_0x366dc5[_0x1237('0x8')];this[_0x1237('0xc')]=_0x366dc5[_0x1237('0xc')];this[_0x1237('0xd')]=_0x366dc5[_0x1237('0xd')];this[_0x1237('0xe')]=_0x366dc5[_0x1237('0xe')];this[_0x1237('0xf')]=_0x366dc5['countbusyretry']+_0x366dc5[_0x1237('0xd')]+_0x366dc5['countnoanswerretry']+_0x366dc5[_0x1237('0x10')]+_0x366dc5['countdropretry']+_0x366dc5[_0x1237('0x11')]+_0x366dc5[_0x1237('0x12')]+_0x366dc5[_0x1237('0x13')];this[_0x1237('0x10')]=_0x366dc5[_0x1237('0x10')];this['countdropretry']=_0x366dc5[_0x1237('0x14')];this['countabandonedretry']=_0x366dc5['countabandonedretry'];this[_0x1237('0x12')]=_0x366dc5['countmachineretry'];this['countagentrejectretry']=_0x366dc5['countagentrejectretry'];this[_0x1237('0x15')]=_0x4682fb[_0x1237('0x15')];this[_0x1237('0x16')]=_0x366dc5['name'];this[_0x1237('0x17')]=_0x366dc5[_0x1237('0x18')];this['starttime']=_0x366dc5['starttime'];this[_0x1237('0x19')]=_0x366dc5['responsetime'];this['answertime']=_0x366dc5[_0x1237('0x1a')];this['endtime']=moment()[_0x1237('0x1b')](_0x1237('0x1c'));this[_0x1237('0x1d')]=getSeconds(_0x366dc5[_0x1237('0x19')],_0x366dc5[_0x1237('0x1e')]);this[_0x1237('0x1f')]=getSeconds(_0x366dc5[_0x1237('0x1a')],_0x366dc5[_0x1237('0x19')]);this[_0x1237('0x20')]=getSeconds(this[_0x1237('0x21')],_0x366dc5[_0x1237('0x1a')]);this[_0x1237('0xb')]=_0x4682fb[_0x1237('0xb')];this[_0x1237('0x22')]=_0x4682fb[_0x1237('0x22')];this[_0x1237('0x23')]=_0x4682fb[_0x1237('0x23')];this['callback']=_0x366dc5[_0x1237('0x24')];this[_0x1237('0x25')]=_0x366dc5[_0x1237('0x25')];this['callbackat']=_0x366dc5[_0x1237('0x26')];this['recallme']=_0x366dc5[_0x1237('0x27')];this['ContactId']=_0x366dc5[_0x1237('0x28')];this['ListId']=_0x366dc5[_0x1237('0x29')];this[_0x1237('0x2a')]=_0x366dc5[_0x1237('0x2a')];this[_0x1237('0x2b')]=_0x366dc5[_0x1237('0x2b')];this[_0x1237('0x2c')]=_0x366dc5[_0x1237('0x2c')];this[_0x1237('0x2d')]=_0x366dc5[_0x1237('0x2d')]||'';this[_0x1237('0x2e')]=_0x366dc5[_0x1237('0x2e')]||'';}module[_0x1237('0x2f')]=AgentComplete; \ No newline at end of file +var _0xa062=['campaigntype','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','state','statedesc','scheduledat','type'];(function(_0xbecdac,_0xe834d){var _0x51fb1d=function(_0x27c763){while(--_0x27c763){_0xbecdac['push'](_0xbecdac['shift']());}};_0x51fb1d(++_0xe834d);}(_0xa062,0x100));var _0x2a06=function(_0x138b0d,_0x1c9e9b){_0x138b0d=_0x138b0d-0x0;var _0x1b2a7c=_0xa062[_0x138b0d];return _0x1b2a7c;};'use strict';var util=require(_0x2a06('0x0'));var _=require(_0x2a06('0x1'));var moment=require('moment');function getSeconds(_0x336822,_0x2c5413){var _0x46b4dc=moment(_0x336822)['milliseconds'](0x0);var _0xb041a9=moment(_0x2c5413)[_0x2a06('0x2')](0x0);return _0x46b4dc[_0x2a06('0x3')](_0xb041a9,'seconds');}function AgentComplete(_0x2a7964,_0x56a414){this[_0x2a06('0x4')]=0x4;this[_0x2a06('0x5')]='Answer';this[_0x2a06('0x6')]=_0x2a7964[_0x2a06('0x6')];this['type']=_0x2a7964[_0x2a06('0x7')];this[_0x2a06('0x8')]=_0x2a7964[_0x2a06('0x7')]==='outbound'?'queue':_0x2a7964['type'];this['countbusyretry']=_0x2a7964['countbusyretry'];this[_0x2a06('0x9')]=_0x2a7964[_0x2a06('0x9')];this[_0x2a06('0xa')]=_0x2a7964[_0x2a06('0xa')];this['countglobal']=_0x2a7964[_0x2a06('0xb')]+_0x2a7964[_0x2a06('0x9')]+_0x2a7964[_0x2a06('0xa')]+_0x2a7964[_0x2a06('0xc')]+_0x2a7964[_0x2a06('0xd')]+_0x2a7964['countabandonedretry']+_0x2a7964[_0x2a06('0xe')]+_0x2a7964[_0x2a06('0xf')];this[_0x2a06('0xc')]=_0x2a7964[_0x2a06('0xc')];this[_0x2a06('0xd')]=_0x2a7964[_0x2a06('0xd')];this['countabandonedretry']=_0x2a7964[_0x2a06('0x10')];this[_0x2a06('0xe')]=_0x2a7964[_0x2a06('0xe')];this[_0x2a06('0xf')]=_0x2a7964[_0x2a06('0xf')];this['uniqueid']=_0x56a414[_0x2a06('0x11')];this[_0x2a06('0x12')]=_0x2a7964[_0x2a06('0x13')];this[_0x2a06('0x14')]=_0x2a7964[_0x2a06('0x15')];this['starttime']=_0x2a7964[_0x2a06('0x16')];this[_0x2a06('0x17')]=_0x2a7964[_0x2a06('0x17')];this['answertime']=_0x2a7964[_0x2a06('0x18')];this[_0x2a06('0x19')]=moment()[_0x2a06('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2a06('0x1b')]=getSeconds(_0x2a7964[_0x2a06('0x17')],_0x2a7964[_0x2a06('0x16')]);this[_0x2a06('0x1c')]=getSeconds(_0x2a7964[_0x2a06('0x18')],_0x2a7964[_0x2a06('0x17')]);this['talktime']=getSeconds(this['endtime'],_0x2a7964[_0x2a06('0x18')]);this[_0x2a06('0x1d')]=_0x56a414[_0x2a06('0x1d')];this[_0x2a06('0x1e')]=_0x56a414[_0x2a06('0x1e')];this[_0x2a06('0x1f')]=_0x56a414[_0x2a06('0x1f')];this[_0x2a06('0x20')]=_0x2a7964[_0x2a06('0x20')];this[_0x2a06('0x21')]=_0x2a7964[_0x2a06('0x21')];this[_0x2a06('0x22')]=_0x2a7964[_0x2a06('0x22')];this[_0x2a06('0x23')]=_0x2a7964[_0x2a06('0x23')];this[_0x2a06('0x24')]=_0x2a7964[_0x2a06('0x24')];this[_0x2a06('0x25')]=_0x2a7964[_0x2a06('0x25')];this['UserId']=_0x2a7964[_0x2a06('0x26')];this['VoiceQueueId']=_0x2a7964[_0x2a06('0x27')];this[_0x2a06('0x28')]=_0x2a7964[_0x2a06('0x28')];this[_0x2a06('0x29')]=_0x2a7964['originatecalleridnum']||'';this[_0x2a06('0x2a')]=_0x2a7964[_0x2a06('0x2a')]||'';}module[_0x2a06('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index bf8ebfc..b2a92bd 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x230e=['countnosuchnumberretry','countdropretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countagentrejectretry'];(function(_0x114bdf,_0x119ada){var _0x5658f6=function(_0xff3dc){while(--_0xff3dc){_0x114bdf['push'](_0x114bdf['shift']());}};_0x5658f6(++_0x119ada);}(_0x230e,0x164));var _0xe230=function(_0xf1ccf4,_0x6690d8){_0xf1ccf4=_0xf1ccf4-0x0;var _0x540593=_0x230e[_0xf1ccf4];return _0x540593;};'use strict';var util=require(_0xe230('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x10d0dd,_0x1c6793){var _0x427639=moment(_0x10d0dd)[_0xe230('0x1')](0x0);var _0x2d7f96=moment(_0x1c6793)[_0xe230('0x1')](0x0);return _0x427639[_0xe230('0x2')](_0x2d7f96,_0xe230('0x3'));}function Final(_0x2df7c3){this[_0xe230('0x4')]=_0x2df7c3[_0xe230('0x4')];this[_0xe230('0x5')]=_0x2df7c3[_0xe230('0x5')];this[_0xe230('0x6')]=_0x2df7c3[_0xe230('0x6')];this[_0xe230('0x7')]=_0x2df7c3[_0xe230('0x6')]==='outbound'?_0xe230('0x8'):_0x2df7c3['type'];this['countbusyretry']=_0x2df7c3[_0xe230('0x9')];this[_0xe230('0xa')]=_0x2df7c3[_0xe230('0xa')];this[_0xe230('0xb')]=_0x2df7c3[_0xe230('0xb')];this['countglobal']=_0x2df7c3[_0xe230('0x9')]+_0x2df7c3[_0xe230('0xa')]+_0x2df7c3[_0xe230('0xb')]+_0x2df7c3['countnosuchnumberretry']+_0x2df7c3['countdropretry']+_0x2df7c3[_0xe230('0xc')]+_0x2df7c3['countmachineretry']+_0x2df7c3[_0xe230('0xd')];this[_0xe230('0xe')]=_0x2df7c3[_0xe230('0xe')];this[_0xe230('0xf')]=_0x2df7c3[_0xe230('0xf')];this['countabandonedretry']=_0x2df7c3[_0xe230('0xc')];this[_0xe230('0x10')]=_0x2df7c3[_0xe230('0x10')];this['countagentrejectretry']=_0x2df7c3[_0xe230('0xd')];this[_0xe230('0x8')]=_0x2df7c3['queue'];this['calleridname']=_0x2df7c3[_0xe230('0x11')];this[_0xe230('0x12')]=_0x2df7c3[_0xe230('0x12')];this[_0xe230('0x13')]=_0x2df7c3[_0xe230('0x13')];this[_0xe230('0x14')]=_0x2df7c3[_0xe230('0x14')];this[_0xe230('0x15')]=_0x2df7c3[_0xe230('0x14')];this[_0xe230('0x16')]=_0x2df7c3[_0xe230('0x16')]||0x0;this['holdtime']=_0x2df7c3[_0xe230('0x17')]||0x0;this[_0xe230('0x18')]=_0x2df7c3[_0xe230('0x18')]||0x0;this[_0xe230('0x19')]=_0x2df7c3['callback'];this['callbackuniqueid']=_0x2df7c3[_0xe230('0x1a')];this['callbackat']=_0x2df7c3[_0xe230('0x1b')];this[_0xe230('0x1c')]=_0x2df7c3[_0xe230('0x1c')];this['ContactId']=_0x2df7c3[_0xe230('0x1d')];this[_0xe230('0x1e')]=_0x2df7c3[_0xe230('0x1e')];this[_0xe230('0x1f')]=_0x2df7c3[_0xe230('0x1f')];this['VoiceQueueId']=_0x2df7c3[_0xe230('0x20')];this[_0xe230('0x21')]=_0x2df7c3['CampaignId'];this['originatecalleridnum']=_0x2df7c3[_0xe230('0x22')]||'';this['originatecalleridname']=_0x2df7c3[_0xe230('0x23')]||'';}module[_0xe230('0x24')]=Final; \ No newline at end of file +var _0xb76c=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x7767c3,_0x4825ac){var _0x1f22a1=function(_0x5164a3){while(--_0x5164a3){_0x7767c3['push'](_0x7767c3['shift']());}};_0x1f22a1(++_0x4825ac);}(_0xb76c,0x97));var _0xcb76=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0xb76c[_0x3c4a7c];return _0xf13d1e;};'use strict';var util=require(_0xcb76('0x0'));var _=require(_0xcb76('0x1'));var moment=require('moment');function getSeconds(_0x2f6a80,_0x1764ea){var _0x5685c2=moment(_0x2f6a80)['milliseconds'](0x0);var _0x2a7af2=moment(_0x1764ea)['milliseconds'](0x0);return _0x5685c2['diff'](_0x2a7af2,_0xcb76('0x2'));}function Final(_0x3ebaca){this['uniqueid']=_0x3ebaca['uniqueid'];this[_0xcb76('0x3')]=_0x3ebaca[_0xcb76('0x3')];this[_0xcb76('0x4')]=_0x3ebaca['type'];this['campaigntype']=_0x3ebaca[_0xcb76('0x4')]===_0xcb76('0x5')?_0xcb76('0x6'):_0x3ebaca[_0xcb76('0x4')];this[_0xcb76('0x7')]=_0x3ebaca[_0xcb76('0x7')];this[_0xcb76('0x8')]=_0x3ebaca[_0xcb76('0x8')];this[_0xcb76('0x9')]=_0x3ebaca[_0xcb76('0x9')];this[_0xcb76('0xa')]=_0x3ebaca['countbusyretry']+_0x3ebaca['countcongestionretry']+_0x3ebaca[_0xcb76('0x9')]+_0x3ebaca[_0xcb76('0xb')]+_0x3ebaca[_0xcb76('0xc')]+_0x3ebaca[_0xcb76('0xd')]+_0x3ebaca[_0xcb76('0xe')]+_0x3ebaca[_0xcb76('0xf')];this[_0xcb76('0xb')]=_0x3ebaca[_0xcb76('0xb')];this[_0xcb76('0xc')]=_0x3ebaca[_0xcb76('0xc')];this['countabandonedretry']=_0x3ebaca[_0xcb76('0xd')];this[_0xcb76('0xe')]=_0x3ebaca[_0xcb76('0xe')];this[_0xcb76('0xf')]=_0x3ebaca[_0xcb76('0xf')];this[_0xcb76('0x6')]=_0x3ebaca[_0xcb76('0x6')];this['calleridname']=_0x3ebaca[_0xcb76('0x10')];this[_0xcb76('0x11')]=_0x3ebaca['calleridnum'];this[_0xcb76('0x12')]=_0x3ebaca[_0xcb76('0x12')];this[_0xcb76('0x13')]=_0x3ebaca[_0xcb76('0x13')];this[_0xcb76('0x14')]=_0x3ebaca[_0xcb76('0x13')];this[_0xcb76('0x15')]=_0x3ebaca[_0xcb76('0x15')]||0x0;this[_0xcb76('0x16')]=_0x3ebaca['holdtime']||0x0;this[_0xcb76('0x17')]=_0x3ebaca[_0xcb76('0x17')]||0x0;this[_0xcb76('0x18')]=_0x3ebaca[_0xcb76('0x18')];this[_0xcb76('0x19')]=_0x3ebaca[_0xcb76('0x19')];this[_0xcb76('0x1a')]=_0x3ebaca['callbackat'];this[_0xcb76('0x1b')]=_0x3ebaca[_0xcb76('0x1b')];this[_0xcb76('0x1c')]=_0x3ebaca[_0xcb76('0x1c')];this[_0xcb76('0x1d')]=_0x3ebaca[_0xcb76('0x1d')];this[_0xcb76('0x1e')]=_0x3ebaca['UserId'];this[_0xcb76('0x1f')]=_0x3ebaca[_0xcb76('0x1f')];this[_0xcb76('0x20')]=_0x3ebaca['CampaignId'];this[_0xcb76('0x21')]=_0x3ebaca[_0xcb76('0x21')]||'';this[_0xcb76('0x22')]=_0x3ebaca[_0xcb76('0x22')]||'';}module[_0xcb76('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 0ed6830..11ab0e1 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe19=['countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','state','statedesc','Answer','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x53bdbe,_0x27bae6){var _0xfe2892=function(_0x3361b8){while(--_0x3361b8){_0x53bdbe['push'](_0x53bdbe['shift']());}};_0xfe2892(++_0x27bae6);}(_0xfe19,0xc2));var _0x9fe1=function(_0x40cd28,_0x3fec84){_0x40cd28=_0x40cd28-0x0;var _0xbb88ca=_0xfe19[_0x40cd28];return _0xbb88ca;};'use strict';var util=require(_0x9fe1('0x0'));var _=require('lodash');var moment=require(_0x9fe1('0x1'));function getSeconds(_0xf6a59b,_0xe7dde8){var _0x101680=moment(_0xf6a59b)[_0x9fe1('0x2')](0x0);var _0x44c920=moment(_0xe7dde8)[_0x9fe1('0x2')](0x0);return _0x101680[_0x9fe1('0x3')](_0x44c920,'seconds');}function Hangup(_0x48ac5b,_0x574e22){this[_0x9fe1('0x4')]=0x4;this[_0x9fe1('0x5')]=_0x9fe1('0x6');this['scheduledat']=_0x48ac5b['scheduledat'];this[_0x9fe1('0x7')]=_0x48ac5b[_0x9fe1('0x7')];this[_0x9fe1('0x8')]=_0x48ac5b[_0x9fe1('0x7')]==='outbound'?_0x9fe1('0x9'):_0x48ac5b[_0x9fe1('0x7')];this['countbusyretry']=_0x48ac5b[_0x9fe1('0xa')];this[_0x9fe1('0xb')]=_0x48ac5b[_0x9fe1('0xb')];this[_0x9fe1('0xc')]=_0x48ac5b[_0x9fe1('0xc')];this[_0x9fe1('0xd')]=_0x48ac5b[_0x9fe1('0xa')]+_0x48ac5b[_0x9fe1('0xb')]+_0x48ac5b[_0x9fe1('0xc')]+_0x48ac5b[_0x9fe1('0xe')]+_0x48ac5b[_0x9fe1('0xf')]+_0x48ac5b['countabandonedretry']+_0x48ac5b[_0x9fe1('0x10')]+_0x48ac5b['countagentrejectretry'];this['countnosuchnumberretry']=_0x48ac5b[_0x9fe1('0xe')];this['countdropretry']=_0x48ac5b['countdropretry'];this['countabandonedretry']=_0x48ac5b['countabandonedretry'];this[_0x9fe1('0x10')]=_0x48ac5b['countmachineretry'];this[_0x9fe1('0x11')]=_0x48ac5b['countagentrejectretry'];this['uniqueid']=_0x574e22[_0x9fe1('0x12')];this[_0x9fe1('0x13')]=_0x48ac5b[_0x9fe1('0x14')];this[_0x9fe1('0x15')]=_0x48ac5b[_0x9fe1('0x16')];this['starttime']=_0x48ac5b[_0x9fe1('0x17')];this[_0x9fe1('0x18')]=_0x48ac5b[_0x9fe1('0x18')];this[_0x9fe1('0x19')]=moment()[_0x9fe1('0x1a')](_0x9fe1('0x1b'));this[_0x9fe1('0x1c')]=getSeconds(_0x48ac5b['responsetime'],_0x48ac5b[_0x9fe1('0x17')]);this[_0x9fe1('0x1d')]=0x0;this[_0x9fe1('0x1e')]=getSeconds(this[_0x9fe1('0x19')],_0x48ac5b[_0x9fe1('0x18')]);this[_0x9fe1('0x9')]=_0x48ac5b['queue'];this['membername']='IVR';this[_0x9fe1('0x1f')]=_0x574e22[_0x9fe1('0x20')];this['callback']=_0x48ac5b['callback'];this[_0x9fe1('0x21')]=_0x48ac5b[_0x9fe1('0x21')];this[_0x9fe1('0x22')]=_0x48ac5b[_0x9fe1('0x22')];this[_0x9fe1('0x23')]=_0x48ac5b['recallme'];this[_0x9fe1('0x24')]=_0x48ac5b[_0x9fe1('0x24')];this['ListId']=_0x48ac5b[_0x9fe1('0x25')];this[_0x9fe1('0x26')]=_0x48ac5b['UserId'];this[_0x9fe1('0x27')]=_0x48ac5b[_0x9fe1('0x27')];this[_0x9fe1('0x28')]=_0x48ac5b[_0x9fe1('0x28')];}module[_0x9fe1('0x29')]=Hangup; \ No newline at end of file +var _0xfdce=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xfdce,0x19f));var _0xefdc=function(_0x103c57,_0x4402b8){_0x103c57=_0x103c57-0x0;var _0x3902f2=_0xfdce[_0x103c57];return _0x3902f2;};'use strict';var util=require(_0xefdc('0x0'));var _=require('lodash');var moment=require(_0xefdc('0x1'));function getSeconds(_0x267d53,_0x2cc209){var _0x42c40c=moment(_0x267d53)[_0xefdc('0x2')](0x0);var _0x258ed5=moment(_0x2cc209)[_0xefdc('0x2')](0x0);return _0x42c40c[_0xefdc('0x3')](_0x258ed5,'seconds');}function Hangup(_0x45917a,_0x49747f){this[_0xefdc('0x4')]=0x4;this[_0xefdc('0x5')]=_0xefdc('0x6');this[_0xefdc('0x7')]=_0x45917a[_0xefdc('0x7')];this['type']=_0x45917a[_0xefdc('0x8')];this[_0xefdc('0x9')]=_0x45917a['type']==='outbound'?_0xefdc('0xa'):_0x45917a['type'];this['countbusyretry']=_0x45917a[_0xefdc('0xb')];this['countcongestionretry']=_0x45917a[_0xefdc('0xc')];this[_0xefdc('0xd')]=_0x45917a[_0xefdc('0xd')];this[_0xefdc('0xe')]=_0x45917a['countbusyretry']+_0x45917a[_0xefdc('0xc')]+_0x45917a[_0xefdc('0xd')]+_0x45917a[_0xefdc('0xf')]+_0x45917a[_0xefdc('0x10')]+_0x45917a[_0xefdc('0x11')]+_0x45917a[_0xefdc('0x12')]+_0x45917a[_0xefdc('0x13')];this[_0xefdc('0xf')]=_0x45917a[_0xefdc('0xf')];this['countdropretry']=_0x45917a[_0xefdc('0x10')];this[_0xefdc('0x11')]=_0x45917a[_0xefdc('0x11')];this[_0xefdc('0x12')]=_0x45917a[_0xefdc('0x12')];this[_0xefdc('0x13')]=_0x45917a[_0xefdc('0x13')];this['uniqueid']=_0x49747f[_0xefdc('0x14')];this[_0xefdc('0x15')]=_0x45917a[_0xefdc('0x16')];this[_0xefdc('0x17')]=_0x45917a[_0xefdc('0x18')];this[_0xefdc('0x19')]=_0x45917a[_0xefdc('0x19')];this[_0xefdc('0x1a')]=_0x45917a['responsetime'];this['endtime']=moment()[_0xefdc('0x1b')](_0xefdc('0x1c'));this[_0xefdc('0x1d')]=getSeconds(_0x45917a['responsetime'],_0x45917a[_0xefdc('0x19')]);this[_0xefdc('0x1e')]=0x0;this['talktime']=getSeconds(this['endtime'],_0x45917a[_0xefdc('0x1a')]);this[_0xefdc('0xa')]=_0x45917a[_0xefdc('0xa')];this['membername']=_0xefdc('0x1f');this[_0xefdc('0x20')]=_0x49747f['cause-txt'];this[_0xefdc('0x21')]=_0x45917a[_0xefdc('0x21')];this['callbackuniqueid']=_0x45917a[_0xefdc('0x22')];this[_0xefdc('0x23')]=_0x45917a[_0xefdc('0x23')];this[_0xefdc('0x24')]=_0x45917a[_0xefdc('0x24')];this[_0xefdc('0x25')]=_0x45917a['ContactId'];this[_0xefdc('0x26')]=_0x45917a[_0xefdc('0x26')];this[_0xefdc('0x27')]=_0x45917a[_0xefdc('0x27')];this['VoiceQueueId']=_0x45917a[_0xefdc('0x28')];this[_0xefdc('0x29')]=_0x45917a[_0xefdc('0x29')];}module[_0xefdc('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 54536b8..bdb35c6 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdafa=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','milliseconds','diff','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime'];(function(_0x4bb029,_0x51329e){var _0x95a40c=function(_0x35c654){while(--_0x35c654){_0x4bb029['push'](_0x4bb029['shift']());}};_0x95a40c(++_0x51329e);}(_0xdafa,0x1c5));var _0xadaf=function(_0x52ff2f,_0x277db0){_0x52ff2f=_0x52ff2f-0x0;var _0x41fe39=_0xdafa[_0x52ff2f];return _0x41fe39;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0xbc7a8b,_0xd6a4e6){var _0x194df1=moment(_0xbc7a8b)[_0xadaf('0x0')](0x0);var _0x2dbb42=moment(_0xd6a4e6)[_0xadaf('0x0')](0x0);return _0x194df1[_0xadaf('0x1')](_0x2dbb42,'seconds');}function History(_0x35ef7a){this['uniqueid']=_0x35ef7a['uniqueid'];this[_0xadaf('0x2')]=_0x35ef7a['scheduledat']||undefined;this[_0xadaf('0x3')]=_0x35ef7a[_0xadaf('0x3')];this['campaigntype']=_0x35ef7a[_0xadaf('0x3')]===_0xadaf('0x4')?_0xadaf('0x5'):_0x35ef7a['type'];this[_0xadaf('0x6')]=_0x35ef7a[_0xadaf('0x6')];this[_0xadaf('0x7')]=_0x35ef7a[_0xadaf('0x7')];this[_0xadaf('0x8')]=_0x35ef7a['countnoanswerretry'];this[_0xadaf('0x9')]=_0x35ef7a[_0xadaf('0x6')]+_0x35ef7a[_0xadaf('0x7')]+_0x35ef7a[_0xadaf('0x8')]+_0x35ef7a['countnosuchnumberretry']+_0x35ef7a[_0xadaf('0xa')]+_0x35ef7a[_0xadaf('0xb')]+_0x35ef7a[_0xadaf('0xc')]+_0x35ef7a['countagentrejectretry'];this[_0xadaf('0xd')]=_0x35ef7a[_0xadaf('0xd')];this[_0xadaf('0xa')]=_0x35ef7a[_0xadaf('0xa')];this[_0xadaf('0xb')]=_0x35ef7a[_0xadaf('0xb')];this[_0xadaf('0xc')]=_0x35ef7a['countmachineretry'];this[_0xadaf('0xe')]=_0x35ef7a[_0xadaf('0xe')];this['queue']=_0x35ef7a[_0xadaf('0x5')];this['calleridname']=_0x35ef7a[_0xadaf('0xf')];this['calleridnum']=_0x35ef7a[_0xadaf('0x10')];this[_0xadaf('0x11')]=_0x35ef7a[_0xadaf('0x11')];this[_0xadaf('0x12')]=_0x35ef7a[_0xadaf('0x12')];this[_0xadaf('0x13')]=_0x35ef7a[_0xadaf('0x12')];this[_0xadaf('0x14')]=getSeconds(_0x35ef7a['responsetime'],_0x35ef7a[_0xadaf('0x11')]);this[_0xadaf('0x15')]=0x0;this[_0xadaf('0x16')]=0x0;this[_0xadaf('0x17')]=_0x35ef7a[_0xadaf('0x17')];this[_0xadaf('0x18')]=_0x35ef7a[_0xadaf('0x18')];this['callbackat']=_0x35ef7a[_0xadaf('0x19')];this[_0xadaf('0x1a')]=_0x35ef7a[_0xadaf('0x1a')];this[_0xadaf('0x1b')]=_0x35ef7a[_0xadaf('0x1b')];this[_0xadaf('0x1c')]=_0x35ef7a['ListId'];this[_0xadaf('0x1d')]=_0x35ef7a[_0xadaf('0x1d')];this[_0xadaf('0x1e')]=_0x35ef7a[_0xadaf('0x1e')];this[_0xadaf('0x1f')]=_0x35ef7a[_0xadaf('0x1f')];this[_0xadaf('0x20')]=_0x35ef7a[_0xadaf('0x20')]||'';this[_0xadaf('0x21')]=_0x35ef7a['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file +var _0x7857=['recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x49d940,_0x516f31){var _0x3201be=function(_0x311c8c){while(--_0x311c8c){_0x49d940['push'](_0x49d940['shift']());}};_0x3201be(++_0x516f31);}(_0x7857,0x1a9));var _0x7785=function(_0xd5a43d,_0x1ede8b){_0xd5a43d=_0xd5a43d-0x0;var _0x508083=_0x7857[_0xd5a43d];return _0x508083;};'use strict';var util=require(_0x7785('0x0'));var _=require(_0x7785('0x1'));var moment=require('moment');function getSeconds(_0x32048c,_0x192376){var _0x57ec14=moment(_0x32048c)[_0x7785('0x2')](0x0);var _0x294fe6=moment(_0x192376)[_0x7785('0x2')](0x0);return _0x57ec14['diff'](_0x294fe6,_0x7785('0x3'));}function History(_0x1f5efd){this[_0x7785('0x4')]=_0x1f5efd['uniqueid'];this['scheduledat']=_0x1f5efd[_0x7785('0x5')]||undefined;this[_0x7785('0x6')]=_0x1f5efd['type'];this[_0x7785('0x7')]=_0x1f5efd[_0x7785('0x6')]===_0x7785('0x8')?_0x7785('0x9'):_0x1f5efd['type'];this[_0x7785('0xa')]=_0x1f5efd['countbusyretry'];this[_0x7785('0xb')]=_0x1f5efd[_0x7785('0xb')];this['countnoanswerretry']=_0x1f5efd[_0x7785('0xc')];this[_0x7785('0xd')]=_0x1f5efd[_0x7785('0xa')]+_0x1f5efd[_0x7785('0xb')]+_0x1f5efd[_0x7785('0xc')]+_0x1f5efd[_0x7785('0xe')]+_0x1f5efd['countdropretry']+_0x1f5efd[_0x7785('0xf')]+_0x1f5efd[_0x7785('0x10')]+_0x1f5efd['countagentrejectretry'];this[_0x7785('0xe')]=_0x1f5efd[_0x7785('0xe')];this['countdropretry']=_0x1f5efd['countdropretry'];this[_0x7785('0xf')]=_0x1f5efd[_0x7785('0xf')];this[_0x7785('0x10')]=_0x1f5efd[_0x7785('0x10')];this[_0x7785('0x11')]=_0x1f5efd['countagentrejectretry'];this[_0x7785('0x9')]=_0x1f5efd[_0x7785('0x9')];this[_0x7785('0x12')]=_0x1f5efd[_0x7785('0x13')];this[_0x7785('0x14')]=_0x1f5efd[_0x7785('0x15')];this['starttime']=_0x1f5efd[_0x7785('0x16')];this[_0x7785('0x17')]=_0x1f5efd[_0x7785('0x17')];this[_0x7785('0x18')]=_0x1f5efd[_0x7785('0x17')];this[_0x7785('0x19')]=getSeconds(_0x1f5efd[_0x7785('0x17')],_0x1f5efd[_0x7785('0x16')]);this[_0x7785('0x1a')]=0x0;this[_0x7785('0x1b')]=0x0;this[_0x7785('0x1c')]=_0x1f5efd[_0x7785('0x1c')];this['callbackuniqueid']=_0x1f5efd[_0x7785('0x1d')];this[_0x7785('0x1e')]=_0x1f5efd['callbackat'];this['recallme']=_0x1f5efd[_0x7785('0x1f')];this[_0x7785('0x20')]=_0x1f5efd[_0x7785('0x20')];this[_0x7785('0x21')]=_0x1f5efd[_0x7785('0x21')];this['UserId']=_0x1f5efd['UserId'];this[_0x7785('0x22')]=_0x1f5efd[_0x7785('0x22')];this[_0x7785('0x23')]=_0x1f5efd[_0x7785('0x23')];this[_0x7785('0x24')]=_0x1f5efd[_0x7785('0x24')]||'';this[_0x7785('0x25')]=_0x1f5efd[_0x7785('0x25')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index dc9a306..8e2e807 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 _0xf963=['VoiceQueueId','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','countglobal','[syncAgentComplete][createHistory][0]','ContactId','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','Unknow','syncAgentComplete','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dropreason','TIMEOUT','agiafterat','add','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','actionid','locked','stateinterface','queueBooked','push','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','timezones','content','indexOf','true','iftime\x20%s,%s','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','originate','phone','contact\x20is\x20undefine','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','isSuccess','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','NoAnswer','custom:agentnoanswer','noanswer','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','dialBusyMaxRetry','reason\x205\x20busy','custom:agentcongestion','congestion','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','dialPredictiveInterval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','util','lodash','bluebird','uuid','ioredis','../preview/util/util','../../../config/environment/','dialer','predictive','../../../config/logger','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','custom:queuesummary','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','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','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','clearing\x20variable\x20start\x20progressive','handlePredictive','string','\x22%s\x22\x20<%s>','inspect','error','stack','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','[actions]','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','merge','pick','ListId','UserId','CampaignId','[emptyContact][createHistory]','Success','reachable','unmonitored','saveInDb','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','state','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','membername','countmachineretry','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3227cf,_0x160680){var _0x24cdfa=function(_0x1e050c){while(--_0x1e050c){_0x3227cf['push'](_0x3227cf['shift']());}};_0x24cdfa(++_0x160680);}(_0xf963,0x11f));var _0x3f96=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf963[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x3f96('0x0'));var _=require(_0x3f96('0x1'));var BPromise=require(_0x3f96('0x2'));var uuid=require(_0x3f96('0x3'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0x3f96('0x4'));var ut=require(_0x3f96('0x5'));var config=require(_0x3f96('0x6'));var logger=require('../../../config/logger')(_0x3f96('0x7'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require('../../../config/logger')(_0x3f96('0x8'));var loggerPredictiveCalls=require(_0x3f96('0x9'))(_0x3f96('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x3f96('0xb'));var ami=require(_0x3f96('0xc'));config[_0x3f96('0xd')]=_['defaults'](config[_0x3f96('0xd')],{'host':_0x3f96('0xe'),'port':0x18eb});var io=require(_0x3f96('0xf'))(new Redis(config[_0x3f96('0xd')]));var cmHopper=require(_0x3f96('0x10'));var cmHopperHistory=require(_0x3f96('0x11'));var cmHopperBlack=require(_0x3f96('0x12'));var voiceQueueRt=require(_0x3f96('0x13'));var Action=require('./action');var History=require(_0x3f96('0x14'));var Final=require(_0x3f96('0x15'));var AgentComplete=require(_0x3f96('0x16'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x3f96('0x17'));var ipAgi=process[_0x3f96('0x18')][_0x3f96('0x19')]||'127.0.0.1';var strategy={'rrmemory':_0x3f96('0x1a'),'roundrobin':_0x3f96('0x1b')};var Sequence=function(){};Sequence[_0x3f96('0x1c')][_0x3f96('0x1d')]=function(_0x7f8f10){this[_0x3f96('0x1e')]=this['tail']?this[_0x3f96('0x1e')][_0x3f96('0x1f')](_0x7f8f10):_0x7f8f10();};function Dialer(_0x3178e8,_0x1bc5bc){this[_0x3f96('0x20')]=new Sequence();this[_0x3f96('0x21')]=_0x1bc5bc;this['voiceQueues']=_0x3178e8[_0x3f96('0x22')];this['campaigns']=_0x3178e8[_0x3f96('0x23')];this[_0x3f96('0x24')]=_0x3178e8[_0x3f96('0x24')];this[_0x3f96('0x25')]=_0x3178e8['trunks'];this['maxNumberOriginate']=config[_0x3f96('0x26')]||0x2;this[_0x3f96('0x27')]={};this[_0x3f96('0x28')]={};this[_0x3f96('0x29')]={};this[_0x3f96('0x2a')]={};this[_0x3f96('0x2b')]={};this[_0x3f96('0x2c')]={};this['startProgressive']={};this[_0x3f96('0x2d')]={};this['queueBooked']={};this[_0x3f96('0x2e')]={};ami['on'](_0x3f96('0x2f'),this[_0x3f96('0x30')][_0x3f96('0x31')](this));ami['on'](_0x3f96('0x32'),this[_0x3f96('0x33')][_0x3f96('0x31')](this));ami['on'](_0x3f96('0x34'),this['syncOriginateResponse'][_0x3f96('0x31')](this));ami['on']('agentcomplete',this['syncAgentComplete']['bind'](this));ami['on'](_0x3f96('0x35'),this[_0x3f96('0xb')][_0x3f96('0x31')](this));ami['on'](_0x3f96('0x36'),this[_0x3f96('0x37')][_0x3f96('0x31')](this));ami['on']('newexten',this[_0x3f96('0x38')][_0x3f96('0x31')](this));ami['on'](_0x3f96('0x39'),this[_0x3f96('0x3a')][_0x3f96('0x31')](this));ami['on'](_0x3f96('0x3b'),this[_0x3f96('0x3c')][_0x3f96('0x31')](this));ami['on'](_0x3f96('0x3d'),this[_0x3f96('0x3e')][_0x3f96('0x31')](this));this[_0x3f96('0x3f')]();this[_0x3f96('0x40')]();}function isNotNull(_0x1a7758){return _0x1a7758!==null&&!_[_0x3f96('0x41')](_0x1a7758);}function checkIsLoggedIn(_0x9a15fa,_0x2ec6ec){return function(){if(_0x2ec6ec<=0x0){_0x9a15fa[_0x3f96('0x42')]=_0x3f96('0x43');throw _0x9a15fa[_0x3f96('0x44')]+_0x3f96('0x45');}};}function isActive(_0x20c4f9){return _0x20c4f9;}function checkIsActive(_0x467dc9,_0x197894){return function(){if(!isActive(_0x197894)){_0x467dc9[_0x3f96('0x42')]=_0x3f96('0x46');throw _0x467dc9['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x531455){return function(){if(!isNotNull(_0x531455[_0x3f96('0x47')])){_0x531455[_0x3f96('0x42')]=_0x3f96('0x48');throw _0x531455[_0x3f96('0x44')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x531455['Interval']['Intervals'])){_0x531455[_0x3f96('0x42')]='INTERVAL_IS_NULL';throw _0x531455[_0x3f96('0x44')]+_0x3f96('0x49');}if(!isNotNull(_[_0x3f96('0x4a')](_0x531455['Interval'][_0x3f96('0x4b')]))){_0x531455[_0x3f96('0x42')]=_0x3f96('0x48');throw _0x531455['name']+_0x3f96('0x49');}};}function msgResponse(_0xfaaed4,_0x3e83a3,_0x1a1020){return{'action':_0xfaaed4,'response':_0x3e83a3,'message':_0x1a1020,'stack':_0x1a1020};}function myreject(_0x25228f){return function(_0x44c078){return _0x25228f(msgResponse(_0x3f96('0x4c'),_0x3f96('0x4d'),JSON[_0x3f96('0x4e')](_0x44c078)));};}function getSeconds(_0x385ee3,_0xe2f77){var _0x25ac25=moment(_0x385ee3)[_0x3f96('0x4f')](0x0);var _0x52546a=moment(_0xe2f77)['milliseconds'](0x0);return _0x25ac25[_0x3f96('0x50')](_0x52546a,_0x3f96('0x51'));}function emit(_0x16b184,_0xa9372f,_0x1e5a83){io['to'](_0x16b184)[_0x3f96('0x52')](_0xa9372f,_0x1e5a83);}function emitVoiceQueueSummary(_0x408f63){if(_0x408f63[_0x3f96('0x53')]===_0x3f96('0x54')){var _0x608707={'id':_0x408f63['id'],'name':_0x408f63[_0x3f96('0x44')],'strategy':_0x408f63[_0x3f96('0x55')],'answered':_0x408f63['answered'],'available':_0x408f63[_0x3f96('0x56')],'loggedIn':_0x408f63[_0x3f96('0x57')],'pTalking':_0x408f63[_0x3f96('0x58')],'sumBillable':_0x408f63[_0x3f96('0x59')],'sumDuration':_0x408f63[_0x3f96('0x5a')],'sumHoldTime':_0x408f63[_0x3f96('0x5b')]||0x0,'talking':_0x408f63[_0x3f96('0x5c')],'total':_0x408f63['total'],'type':_0x408f63[_0x3f96('0x53')],'unmanaged':_0x408f63[_0x3f96('0x5d')],'abandoned':_0x408f63[_0x3f96('0x5e')],'waiting':_0x408f63[_0x3f96('0x5f')],'loggedInDb':_0x408f63[_0x3f96('0x60')],'dialActive':_0x408f63['dialActive'],'dialMethod':_0x408f63['dialMethod'],'dialOriginateCallerIdName':_0x408f63[_0x3f96('0x61')],'dialOriginateCallerIdNumber':_0x408f63[_0x3f96('0x62')],'dialOriginateTimeout':_0x408f63['dialOriginateTimeout'],'dialPrefix':_0x408f63[_0x3f96('0x63')],'outboundAnswerAgiCallsDay':_0x408f63[_0x3f96('0x64')],'outboundAnswerCallsDay':_0x408f63[_0x3f96('0x65')],'outboundBlacklistCallsDay':_0x408f63[_0x3f96('0x66')],'outboundBusyCallsDay':_0x408f63['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x408f63[_0x3f96('0x67')],'outboundDropCallsDayACS':_0x408f63[_0x3f96('0x68')],'outboundDropCallsDayCallersExit':_0x408f63[_0x3f96('0x69')],'outboundDropCallsDayTimeout':_0x408f63[_0x3f96('0x6a')],'outboundNoAnswerCallsDay':_0x408f63[_0x3f96('0x6b')],'outboundNoSuchCallsDay':_0x408f63[_0x3f96('0x6c')],'outboundOriginateFailureCallsDay':_0x408f63[_0x3f96('0x6d')],'outboundReCallsDay':_0x408f63['outboundReCallsDay'],'outboundRejectCallsDay':_0x408f63[_0x3f96('0x6e')],'outboundUnknownCallsDay':_0x408f63['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x408f63[_0x3f96('0x6f')],'predictiveIntervalAvgHoldtime':_0x408f63[_0x3f96('0x70')],'predictiveIntervalAvgTalktime':_0x408f63['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x408f63[_0x3f96('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x408f63['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x408f63[_0x3f96('0x72')],'predictiveIntervalErlangCallsDroppedCalls':_0x408f63[_0x3f96('0x73')],'predictiveIntervalHitRate':_0x408f63[_0x3f96('0x74')],'predictiveIntervalMultiplicativeFactor':_0x408f63[_0x3f96('0x75')],'predictiveIntervalPauses':_0x408f63['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x408f63[_0x3f96('0x76')],'predictiveIntervalTotalCalls':_0x408f63[_0x3f96('0x77')],'message':_0x408f63[_0x3f96('0x42')],'originated':_0x408f63['originated'],'erlangCalls':_0x408f63[_0x3f96('0x78')],'erlangCallToSecond':_0x408f63['erlangCallToSecond'],'erlangAbandonmentRate':_0x408f63[_0x3f96('0x79')],'erlangBusyFactor':_0x408f63[_0x3f96('0x7a')],'startPredictive':_0x408f63[_0x3f96('0x2c')],'startProgressive':_0x408f63[_0x3f96('0x7b')]};if(_0x408f63['Trunk']){_0x608707['Trunk']={'id':_0x408f63[_0x3f96('0x7c')]['id'],'name':_0x408f63[_0x3f96('0x7c')][_0x3f96('0x44')],'active':_0x408f63[_0x3f96('0x7c')][_0x3f96('0x7d')],'callerid':_0x408f63[_0x3f96('0x7c')][_0x3f96('0x7e')]};}if(_0x408f63[_0x3f96('0x47')]){_0x608707[_0x3f96('0x47')]={'id':_0x408f63[_0x3f96('0x47')]['id'],'name':_0x408f63[_0x3f96('0x47')]['name']};}var _0x1e85be=md5(JSON[_0x3f96('0x4e')](_0x608707));if(_0x408f63[_0x3f96('0x7f')]!==_0x1e85be){_0x408f63['md5']=_0x1e85be;emit(util[_0x3f96('0x80')](_0x3f96('0x81'),_0x608707[_0x3f96('0x44')]),_0x3f96('0x82'),_0x608707);}}}function emitCampaignSummary(_0x5c8e97){if(_0x5c8e97[_0x3f96('0x53')]===_0x3f96('0x83')){emit(util[_0x3f96('0x80')](_0x3f96('0x84'),_0x5c8e97[_0x3f96('0x44')]),_0x3f96('0x85'),_0x5c8e97);}}function checkGetDataPredictive(_0xb4df94){if(isNotNull(_0xb4df94)&&!_[_0x3f96('0x4a')](_0xb4df94)){loggerPredictive[_0x3f96('0x86')](_0x3f96('0x87'));loggerPredictive[_0x3f96('0x86')](_0x3f96('0x88'),_0xb4df94[_0x3f96('0x77')]);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x89'),_0xb4df94[_0x3f96('0x6f')]);loggerPredictive['info'](_0x3f96('0x8a'),_0xb4df94[_0x3f96('0x8b')]);loggerPredictive[_0x3f96('0x86')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xb4df94[_0x3f96('0x71')]);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x8c'),_0xb4df94['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x3f96('0x86')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xb4df94[_0x3f96('0x8d')]);loggerPredictive[_0x3f96('0x86')]('---------------------------');if(_0xb4df94[_0x3f96('0x77')]>0x0){if(!_[_0x3f96('0x41')](_0xb4df94[_0x3f96('0x8d')])&&_0xb4df94['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x3f96('0x86')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x3f96('0x41')](_0xb4df94[_0x3f96('0x70')])&&_0xb4df94[_0x3f96('0x70')]>0x0){return!![];}loggerPredictive[_0x3f96('0x86')](_0x3f96('0x8e'));}else{loggerPredictive[_0x3f96('0x86')](_0x3f96('0x8f'));}}else{loggerPredictive[_0x3f96('0x86')](_0x3f96('0x90'));}return![];}function mergeDataErlangB(_0x3a1974){return function(_0x141e3d){loggerPredictive[_0x3f96('0x86')](_0x3f96('0x91'));loggerPredictive[_0x3f96('0x86')](_0x3f96('0x92'),_0x141e3d[_0x3f96('0x78')]);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x93'),_0x141e3d['erlangCallToSecond']);loggerPredictive[_0x3f96('0x86')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x141e3d['erlangAbandonmentRate']);loggerPredictive[_0x3f96('0x86')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x141e3d[_0x3f96('0x7a')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x141e3d[_0x3f96('0x79')]);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x94'));_['merge'](_0x3a1974,_0x141e3d);};}function getDiff(_0x49add7){var _0x4e1ac6=moment()[_0x3f96('0x4f')](0x0);var _0x425275=moment(_0x49add7)[_0x3f96('0x4f')](0x0);return _0x4e1ac6[_0x3f96('0x50')](_0x425275,_0x3f96('0x51'));}function ifInterval(_0x4e7180,_0x3936ef){if(_['isUndefined'](_0x3936ef)){return![];}return getDiff(_0x3936ef)<_0x4e7180*0x3c;}function freeVariablesPredictive(_0x83238b){if(isNotNull(_0x83238b)){if(!_[_0x3f96('0x41')](_0x83238b[_0x3f96('0x7b')])){_0x83238b[_0x3f96('0x7b')]=undefined;loggerPredictive['info'](_0x83238b[_0x3f96('0x44')],_0x3f96('0x95'));}if(!_[_0x3f96('0x41')](_0x83238b[_0x3f96('0x2c')])){_0x83238b[_0x3f96('0x2c')]=undefined;loggerPredictive[_0x3f96('0x86')](_0x83238b['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x3f96('0x41')](_0x83238b[_0x3f96('0x96')])){clearInterval(_0x83238b[_0x3f96('0x96')]);_0x83238b[_0x3f96('0x96')]=undefined;loggerPredictive[_0x3f96('0x86')](_0x83238b['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x5c0c7f,_0x5d5f95){if(_0x5d5f95===0x0){return 0x0;}var _0x55eeb9=0x1;for(var _0x3aa24f=0x1;_0x3aa24f<=_0x5d5f95;_0x3aa24f+=0x1){_0x55eeb9=0x1+_0x55eeb9*_0x3aa24f/_0x5c0c7f;}return 0x1/_0x55eeb9;}function isVoiceQueueOutbound(_0x1633ae){return _0x1633ae===_0x3f96('0x54');}function isNotPreview(_0x439fef){return _0x439fef!=='preview';}function isCampaignIvr(_0x5ab821){return _0x5ab821==='ivr';}function getCallerId(_0x276cad,_0xf5e4af,_0x4f7d59){if(!_[_0x3f96('0x41')](_0x4f7d59)&&typeof _0x4f7d59==='string'&&!_['isEmpty'](_0x4f7d59)){if(!_[_0x3f96('0x41')](_0xf5e4af)&&typeof _0xf5e4af===_0x3f96('0x97')&&!_[_0x3f96('0x4a')](_0xf5e4af)){return util[_0x3f96('0x80')](_0x3f96('0x98'),_0xf5e4af,_0x4f7d59);}return util[_0x3f96('0x80')](_0x3f96('0x98'),_0x4f7d59,_0x4f7d59);}if(!_[_0x3f96('0x41')](_0x276cad)&&typeof _0x276cad===_0x3f96('0x97')&&!_['isEmpty'](_0x276cad)){return _0x276cad;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x44e8ec,_0x5585c8){return function(_0x56f54f){freeVariablesPredictive(_0x5585c8);emitVoiceQueueSummary(_0x5585c8);emitCampaignSummary(_0x5585c8);loggerSyncQueueSummary['error'](_0x44e8ec,util[_0x3f96('0x99')](_0x56f54f,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4315f5,_0x3c3608){return function(_0x108fc1){loggerPredictive[_0x3f96('0x9a')](_0x3c3608[_0x3f96('0x44')],_0x4315f5);loggerPredictive['error'](_0x108fc1[_0x3f96('0x9b')]);freeVariablesPredictive(_0x3c3608);};}function loggerCatch(_0xaf3ccb){return function(_0x18ea00){logger['error'](_0xaf3ccb,util[_0x3f96('0x99')](_0x18ea00,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xb3b07e){return _0xb3b07e&&!_[_0x3f96('0x41')](_0xb3b07e)&&_0xb3b07e[_0x3f96('0x9c')]>0x0;}function decremetOriginate(_0x2d28c1){if(!_[_0x3f96('0x41')](_0x2d28c1)&&_0x2d28c1!==null){if(typeof _0x2d28c1[_0x3f96('0x9d')]!==_0x3f96('0x9e')){if(_0x2d28c1[_0x3f96('0x9d')]>0x0){_0x2d28c1[_0x3f96('0x9d')]-=0x1;}else{logger[_0x3f96('0x9a')](_0x3f96('0x9f'));}}}else{logger[_0x3f96('0x9a')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x44e572,_0x1e9df3,_0x38d3b7){if(_0x1e9df3>_0x38d3b7){for(var _0x50756e=0x0;_0x50756e<_0x1e9df3-_0x38d3b7;_0x50756e+=0x1){decremetOriginate(_0x44e572);}}}function loggerGetContactDialer(_0x24f824,_0x37da82,_0xaa1883){return function(_0x161672){checkContactLowerLimitOriginate(_0x37da82,_0xaa1883,0x0);logger['error'](_0x24f824,util[_0x3f96('0x99')](_0x161672,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x311bcc){return function(_0x39e316){if(isNotNull(_0x39e316)&&isNotNull(_0x39e316[0x0])){if(_0x39e316[0x0][_0x3f96('0xa0')]>0x0){_0x311bcc[_0x3f96('0x42')]=_0x3f96('0xa1');logger[_0x3f96('0x86')](_0x3f96('0xa2')+_0x311bcc[_0x3f96('0x44')],_0x39e316[0x0][_0x3f96('0xa0')],_0x3f96('0xa3'));}else{_0x311bcc[_0x3f96('0x42')]=_0x3f96('0xa4');logger[_0x3f96('0x86')](_0x3f96('0xa5')+_0x311bcc['name']);}}};}function notSendMessagesQueue(_0x9262){if(_0x9262[_0x3f96('0xa6')]){freeVariablesPredictive(_0x9262);if(_0x9262[_0x3f96('0x9d')]===0x0&&_0x9262[_0x3f96('0x5c')]===0x0&&_0x9262[_0x3f96('0x5f')]===0x0&&(_0x9262[_0x3f96('0x58')]||0x0)===0x0){_0x9262[_0x3f96('0xa6')]=![];_0x9262[_0x3f96('0x56')]=0x0;_0x9262['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x3f96('0x9a')](_0x3f96('0xa7'),_0x9262[_0x3f96('0x44')],_0x3f96('0xa8'));}else{_0x9262[_0x3f96('0x42')]=_0x3f96('0xa9');loggerSyncQueueSummary[_0x3f96('0x9a')](_0x3f96('0xa7'),_0x9262['name'],_0x3f96('0xaa'));}emitVoiceQueueSummary(_0x9262);}}function notSendMessagesCampaign(_0x1c3a0c){if(_0x1c3a0c[_0x3f96('0xa6')]){if(_0x1c3a0c[_0x3f96('0x9d')]===0x0){_0x1c3a0c[_0x3f96('0xa6')]=![];_0x1c3a0c['message']=_0x3f96('0x46');loggerSyncQueueSummary[_0x3f96('0x9a')](_0x3f96('0xab'),_0x1c3a0c[_0x3f96('0x44')],'is\x20not\x20active');}else{_0x1c3a0c[_0x3f96('0x42')]=_0x3f96('0xa9');loggerSyncQueueSummary[_0x3f96('0x9a')](_0x3f96('0xab'),_0x1c3a0c[_0x3f96('0x44')],_0x3f96('0xaa'));}emitCampaignSummary(_0x1c3a0c);}}function createObjHistory(_0x574e54,_0x241fae,_0x273933,_0x4bcad9,_0x35cca1){_0x574e54['message']=_0x273933;var _0x4affd4=new Action(_0x574e54,_0x241fae);var _0x5f4c01=new History(_0x4affd4);_0x5f4c01['state']=_0x4bcad9;_0x5f4c01[_0x3f96('0xac')]=_0x35cca1;_0x5f4c01[_0x3f96('0xad')]=_0x4affd4[_0x3f96('0xae')];return _0x5f4c01;}Dialer[_0x3f96('0x1c')][_0x3f96('0x40')]=function(){var _0x3cd443=this;setInterval(function(){_0x3cd443[_0x3f96('0xaf')](_0x3cd443[_0x3f96('0x2a')],'[uniqueid]');_0x3cd443[_0x3f96('0xaf')](_0x3cd443[_0x3f96('0x28')],_0x3f96('0xb0'));},0x32c8);};Dialer[_0x3f96('0x1c')][_0x3f96('0xaf')]=function(_0x1a79a1,_0x3a2cc9){var _0x30c2cb=this;for(var _0x4e34e7 in _0x1a79a1){if(typeof _0x1a79a1[_0x4e34e7]!==_0x3f96('0x9e')){this[_0x3f96('0x20')][_0x3f96('0x1d')](function(){if(!_[_0x3f96('0xb1')](_0x1a79a1[_0x4e34e7])){return ami[_0x3f96('0xb2')]({'action':_0x3f96('0xb3'),'channel':_0x1a79a1[_0x4e34e7][_0x3f96('0xb4')]})['catch'](function(_0x56bacd){if(_0x56bacd[_0x3f96('0x42')]===_0x3f96('0xb5')){setTimeout(function(){if(_0x1a79a1[_0x4e34e7]&&_0x1a79a1[_0x4e34e7][_0x3f96('0x53')]!==_0x3f96('0x83')){_0x30c2cb[_0x3f96('0xb6')](_0x30c2cb[_0x3f96('0x22')][_0x1a79a1[_0x4e34e7][_0x3f96('0xb7')]]);logger[_0x3f96('0x9a')](_0x3f96('0xb8'),_0x3a2cc9,_0x4e34e7,_0x1a79a1[_0x4e34e7][_0x3f96('0xb7')]);delete _0x1a79a1[_0x4e34e7];}if(_0x1a79a1[_0x4e34e7]&&_0x1a79a1[_0x4e34e7][_0x3f96('0x53')]===_0x3f96('0x83')){_0x30c2cb[_0x3f96('0xb6')](_0x30c2cb[_0x3f96('0x23')][_0x1a79a1[_0x4e34e7][_0x3f96('0xb7')]]);logger[_0x3f96('0x9a')](_0x3f96('0xb9'),_0x3a2cc9,_0x4e34e7,_0x1a79a1[_0x4e34e7]['queue']);delete _0x1a79a1[_0x4e34e7];}},0x2328);}});}});}}};Dialer[_0x3f96('0x1c')][_0x3f96('0xba')]=function(_0xc21cca){return BPromise[_0x3f96('0xbb')]()[_0x3f96('0xbc')](cmHopper[_0x3f96('0xba')](_0xc21cca))[_0x3f96('0xbd')](loggerCatch(_0x3f96('0xbe')));};Dialer[_0x3f96('0x1c')]['checkIsBlackList']=function(_0x3c6efc){return BPromise[_0x3f96('0xbb')]()['then'](cmHopperBlack[_0x3f96('0xbf')](_0x3c6efc))[_0x3f96('0xbd')](loggerCatch(_0x3f96('0xc0')));};Dialer[_0x3f96('0x1c')][_0x3f96('0xc1')]=function(_0x25269f){return BPromise[_0x3f96('0xbb')]()[_0x3f96('0xbc')](cmHopperBlack['checkIsBlackListIvr'](_0x25269f))[_0x3f96('0xbd')](loggerCatch(_0x3f96('0xc2')));};Dialer[_0x3f96('0x1c')][_0x3f96('0xc3')]=function(_0x44fbfc){return BPromise[_0x3f96('0xbb')]()['then'](cmHopperHistory[_0x3f96('0xc4')](_0x44fbfc))[_0x3f96('0xbd')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0x3f96('0xc5')]=function(_0x2dfe19){return BPromise[_0x3f96('0xbb')]()[_0x3f96('0xbc')](cmHopper[_0x3f96('0xc5')](_0x2dfe19))[_0x3f96('0xbd')](loggerCatch(_0x3f96('0xc6')));};Dialer[_0x3f96('0x1c')][_0x3f96('0xc7')]=function(_0xf03c9,_0x1faa0b,_0x143fa1){return BPromise[_0x3f96('0xbb')]()[_0x3f96('0xbc')](cmHopper[_0x3f96('0xc7')](_0xf03c9,_0x1faa0b,_0x143fa1))[_0x3f96('0xbd')](loggerCatch(_0x3f96('0xc8')));};Dialer[_0x3f96('0x1c')][_0x3f96('0xc9')]=function(_0x42cf4b,_0xcb0441,_0x64e8d,_0x5f2156){return BPromise['resolve']()[_0x3f96('0xbc')](cmHopper[_0x3f96('0xc9')](_0x42cf4b,_0xcb0441,_0x64e8d,_0x5f2156))[_0x3f96('0xbd')](loggerCatch(_0x3f96('0xca')));};Dialer['prototype'][_0x3f96('0xcb')]=function(_0x295e06,_0xd9f99b,_0x28055){return BPromise[_0x3f96('0xbb')]()[_0x3f96('0xbc')](cmHopper['getContactDialerIvr'](_0x295e06,_0xd9f99b,_0x28055))[_0x3f96('0xbd')](loggerCatch(_0x3f96('0xca')));};Dialer[_0x3f96('0x1c')][_0x3f96('0xcc')]=function(_0x3799d4){return BPromise[_0x3f96('0xbb')]()[_0x3f96('0xbc')](voiceQueueRt[_0x3f96('0xcc')](_0x3799d4))[_0x3f96('0xbd')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x3f96('0x1c')][_0x3f96('0xcd')]=function(_0x4661b5){return BPromise[_0x3f96('0xbb')]()[_0x3f96('0xbc')](cmHopper[_0x3f96('0xcd')](_0x4661b5))[_0x3f96('0xbd')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x3f96('0x1c')][_0x3f96('0xce')]=function(_0x1e29ac){return BPromise['resolve']()[_0x3f96('0xbc')](cmHopperHistory[_0x3f96('0xce')](_0x1e29ac))[_0x3f96('0xbd')](loggerCatch(_0x3f96('0xcf')));};Dialer[_0x3f96('0x1c')][_0x3f96('0xb6')]=function(_0x499688){if(!_[_0x3f96('0x41')](_0x499688)&&_0x499688!==null){if(typeof _0x499688[_0x3f96('0x9d')]!=='undefined'){if(_0x499688[_0x3f96('0x9d')]>0x0){_0x499688['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x3f96('0x9a')](_0x3f96('0xd0'));}};Dialer['prototype'][_0x3f96('0xd1')]=function(_0x4ee38e,_0x5d083b){var _0x4e7e35=this;return function(_0x1aab2e){_0x4e7e35['updateOriginated'](_0x5d083b);logger[_0x3f96('0x9a')](_0x4ee38e,util[_0x3f96('0x99')](_0x1aab2e,{'showHidden':![],'depth':null}));};};Dialer[_0x3f96('0x1c')][_0x3f96('0xd2')]=function(_0xa97ae0,_0x37fb90,_0x58dfb2){var _0x2585e4={'state':0x19,'statedesc':_0x3f96('0xd3')};this[_0x3f96('0xb6')](_0x37fb90);this['saveInDb'](_[_0x3f96('0xd4')](_0x2585e4,_[_0x3f96('0xd5')](_0x58dfb2,['ContactId',_0x3f96('0xd6'),_0x3f96('0xd7'),'VoiceQueueId',_0x3f96('0xd8')])),_0x3f96('0xd9'),'[emptyContact]');logger[_0x3f96('0x9a')](_0xa97ae0);};Dialer[_0x3f96('0x1c')]['isSuccess']=function(_0x148ecf){return _0x148ecf===_0x3f96('0xda');};Dialer['prototype']['isTrunkReachable']=function(_0x39a2a7){return!_[_0x3f96('0x41')](_0x39a2a7)&&_0x39a2a7&&!_[_0x3f96('0x41')](_0x39a2a7[_0x3f96('0x44')])&&!_[_0x3f96('0x41')](_0x39a2a7[_0x3f96('0x7d')])&&_0x39a2a7['active']&&(this[_0x3f96('0x25')][util[_0x3f96('0x80')]('SIP/%s',_0x39a2a7[_0x3f96('0x44')])][_0x3f96('0xb3')]===_0x3f96('0xdb')||this['trunks'][util[_0x3f96('0x80')]('SIP/%s',_0x39a2a7['name'])][_0x3f96('0xb3')]===_0x3f96('0xdc'));};Dialer[_0x3f96('0x1c')][_0x3f96('0xdd')]=function(_0x20c8d4,_0x67d0a1,_0x3e466f){this[_0x3f96('0xce')](_0x20c8d4)[_0x3f96('0xbd')](loggerCatch(_0x67d0a1));this[_0x3f96('0xcd')](_0x20c8d4)['catch'](loggerCatch(_0x3e466f));};Dialer[_0x3f96('0x1c')][_0x3f96('0x3a')]=function(_0x257dea){var _0x1ae59c=this['uniqueId'][_0x257dea[_0x3f96('0xde')]];var _0x157b87;if(!_[_0x3f96('0xb1')](_0x257dea)&&!_['isNil'](_0x257dea[_0x3f96('0xdf')])&&!_[_0x3f96('0xb1')](_0x257dea['variable'][_0x3f96('0xe0')])&&_0x257dea[_0x3f96('0xe1')]===_0x3f96('0xe2')&&_0x1ae59c){if(_0x1ae59c[_0x3f96('0x53')]!=='ivr'&&this[_0x3f96('0x22')][_0x1ae59c['queue']][_0x3f96('0xe3')]&&_0x257dea[_0x3f96('0xe4')]===_0x3f96('0xe5')){delete this[_0x3f96('0x2a')][_0x257dea[_0x3f96('0xde')]];this[_0x3f96('0xb6')](this[_0x3f96('0x22')][_0x1ae59c[_0x3f96('0xb7')]]);this[_0x3f96('0x22')][_0x1ae59c[_0x3f96('0xb7')]][_0x3f96('0x65')]+=0x1;this[_0x3f96('0x22')][_0x1ae59c['queue']][_0x3f96('0x64')]+=0x1;_0x157b87=new Hangup(_0x1ae59c,_0x257dea);_0x157b87[_0x3f96('0xe6')]=0x12;_0x157b87[_0x3f96('0xac')]='HangupInAMD';_0x157b87['membername']=_0x3f96('0xe7');this[_0x3f96('0xdd')](_0x157b87,_0x3f96('0xe8'),_0x3f96('0xe9'));}if(_0x1ae59c[_0x3f96('0x53')]!==_0x3f96('0x83')&&this['voiceQueues'][_0x1ae59c[_0x3f96('0xb7')]][_0x3f96('0xe3')]&&_0x257dea[_0x3f96('0xe4')]===_0x3f96('0xea')){var _0x2299a5=this;return new BPromise(function(_0x537ffb,_0x251062){delete _0x2299a5[_0x3f96('0x2a')][_0x257dea[_0x3f96('0xde')]];_0x2299a5[_0x3f96('0xb6')](_0x2299a5['voiceQueues'][_0x1ae59c['queue']]);_0x2299a5['voiceQueues'][_0x1ae59c[_0x3f96('0xb7')]][_0x3f96('0x65')]+=0x1;_0x2299a5['voiceQueues'][_0x1ae59c[_0x3f96('0xb7')]][_0x3f96('0x64')]+=0x1;var _0x2fa4cc=_0x2299a5[_0x3f96('0x22')][_0x1ae59c[_0x3f96('0xb7')]];var _0xd9b98=new Hangup(_0x1ae59c,_0x257dea);_0xd9b98['state']=0x13;_0xd9b98[_0x3f96('0xac')]=_0x3f96('0xeb');_0xd9b98[_0x3f96('0xec')]=_0x3f96('0xe7');_0xd9b98[_0x3f96('0xed')]+=0x1;_0xd9b98['countglobal']+=0x1;_0xd9b98[_0x3f96('0xee')]=!![];_0x2299a5[_0x3f96('0xce')](_0xd9b98)[_0x3f96('0xbd')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xd9b98[_0x3f96('0xef')]+_0xd9b98[_0x3f96('0xf0')]+_0xd9b98[_0x3f96('0xf1')]+_0xd9b98[_0x3f96('0xf2')]+_0xd9b98[_0x3f96('0xf3')]+_0xd9b98[_0x3f96('0xf4')]+_0xd9b98[_0x3f96('0xed')]+_0xd9b98[_0x3f96('0xf5')]>=_0x2fa4cc[_0x3f96('0xf6')]){_0x2299a5[_0x3f96('0xf7')](_0xd9b98,_0x537ffb,_0x251062,_0x3f96('0xf8'));}else{if(_0xd9b98[_0x3f96('0xed')]>=_0x2fa4cc[_0x3f96('0xf9')]){_0x2299a5[_0x3f96('0xfa')](_0xd9b98,_0x537ffb,_0x251062,_0x3f96('0xfb'));}else{_0x2299a5['rescheduleContact']({'active':![],'countmachineretry':_0xd9b98[_0x3f96('0xed')],'scheduledat':moment()['add'](_0x2fa4cc[_0x3f96('0xfc')],_0x3f96('0xfd'))['format'](_0x3f96('0xfe')),'ContactId':_0xd9b98['ContactId'],'ListId':_0xd9b98['ListId'],'VoiceQueueId':_0xd9b98[_0x3f96('0xff')]||undefined,'CampaignId':_0xd9b98[_0x3f96('0xd8')]||undefined})[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x100')));_0x537ffb({'reschedule':0x1});}}});}if(_0x1ae59c[_0x3f96('0x53')]===_0x3f96('0x83')&&this[_0x3f96('0x23')][_0x1ae59c['queue']][_0x3f96('0xe3')]&&_0x257dea[_0x3f96('0xe4')]===_0x3f96('0xe5')){delete this[_0x3f96('0x2a')][_0x257dea[_0x3f96('0xde')]];this[_0x3f96('0xb6')](this[_0x3f96('0x23')][_0x1ae59c[_0x3f96('0xb7')]]);_0x157b87=new Hangup(_0x1ae59c,_0x257dea);_0x157b87[_0x3f96('0xe6')]=0x12;_0x157b87['statedesc']=_0x3f96('0x101');_0x157b87[_0x3f96('0xec')]='AMD';this['saveInDb'](_0x157b87,_0x3f96('0x102'),'[syncHangupInAMDIvr]');}if(_0x1ae59c['type']===_0x3f96('0x83')&&this[_0x3f96('0x23')][_0x1ae59c['queue']][_0x3f96('0xe3')]&&_0x257dea[_0x3f96('0xe4')]==='MACHINE'){var _0x2299a5=this;return new BPromise(function(_0x338329,_0x1ab866){delete _0x2299a5[_0x3f96('0x2a')][_0x257dea['uniqueid']];_0x2299a5[_0x3f96('0xb6')](_0x2299a5[_0x3f96('0x23')][_0x1ae59c['queue']]);_0x2299a5[_0x3f96('0x23')][_0x1ae59c[_0x3f96('0xb7')]][_0x3f96('0x65')]+=0x1;_0x2299a5[_0x3f96('0x23')][_0x1ae59c[_0x3f96('0xb7')]][_0x3f96('0x64')]+=0x1;var _0x11477c=_0x2299a5[_0x3f96('0x23')][_0x1ae59c['queue']];var _0x5d0696=new Hangup(_0x1ae59c,_0x257dea);_0x5d0696[_0x3f96('0xe6')]=0x13;_0x5d0696[_0x3f96('0xac')]=_0x3f96('0xeb');_0x5d0696[_0x3f96('0xec')]=_0x3f96('0xe7');_0x5d0696[_0x3f96('0xed')]+=0x1;_0x5d0696[_0x3f96('0x103')]+=0x1;_0x5d0696[_0x3f96('0xee')]=!![];_0x2299a5[_0x3f96('0xce')](_0x5d0696)[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x104')));if(_0x5d0696[_0x3f96('0xef')]+_0x5d0696[_0x3f96('0xf0')]+_0x5d0696[_0x3f96('0xf1')]+_0x5d0696[_0x3f96('0xf2')]+_0x5d0696[_0x3f96('0xf3')]+_0x5d0696[_0x3f96('0xf4')]+_0x5d0696[_0x3f96('0xed')]+_0x5d0696['countagentrejectretry']>=_0x11477c[_0x3f96('0xf6')]){_0x2299a5[_0x3f96('0xf7')](_0x5d0696,_0x338329,_0x1ab866,_0x3f96('0xf8'));}else{if(_0x5d0696[_0x3f96('0xed')]>=_0x11477c[_0x3f96('0xf9')]){_0x2299a5['createStateFinal'](_0x5d0696,_0x338329,_0x1ab866,_0x3f96('0xfb'));}else{_0x2299a5['rescheduleContact']({'active':![],'countmachineretry':_0x5d0696[_0x3f96('0xed')],'scheduledat':moment()['add'](_0x11477c[_0x3f96('0xfc')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5d0696[_0x3f96('0x105')],'ListId':_0x5d0696[_0x3f96('0xd6')],'VoiceQueueId':_0x5d0696[_0x3f96('0xff')]||undefined,'CampaignId':_0x5d0696[_0x3f96('0xd8')]||undefined})[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x100')));_0x338329({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x3f96('0x37')]=function(_0x11e808){var _0x1fa018=this['uniqueId'][_0x11e808[_0x3f96('0xde')]];var _0x47f15f=this;var _0x54a19e;if(_0x1fa018&&_0x1fa018[_0x3f96('0x53')]===_0x3f96('0x83')){delete this['uniqueId'][_0x11e808['uniqueid']];this[_0x3f96('0xb6')](this[_0x3f96('0x23')][_0x1fa018['queue']]);this[_0x3f96('0x23')][_0x1fa018[_0x3f96('0xb7')]]['ivrAnswerCallsDay']+=0x1;_0x54a19e=new Hangup(_0x1fa018,_0x11e808);this[_0x3f96('0xce')](_0x54a19e)[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x106')));this['moveContactManagedDialer'](_0x54a19e)['catch'](loggerCatch(_0x3f96('0x107')));}if(_0x1fa018&&_0x1fa018[_0x3f96('0x53')]!=='ivr'&&isNotNull(this[_0x3f96('0x22')][_0x1fa018[_0x3f96('0xb7')]]['dialQueueProject'])){delete this['uniqueId'][_0x11e808[_0x3f96('0xde')]];this[_0x3f96('0xb6')](this['voiceQueues'][_0x1fa018[_0x3f96('0xb7')]]);this['voiceQueues'][_0x1fa018[_0x3f96('0xb7')]][_0x3f96('0x65')]+=0x1;this[_0x3f96('0x22')][_0x1fa018[_0x3f96('0xb7')]][_0x3f96('0x64')]+=0x1;_0x54a19e=new Hangup(_0x1fa018,_0x11e808);_0x54a19e[_0x3f96('0xe6')]=0x10;_0x54a19e[_0x3f96('0xac')]=_0x3f96('0x108');_0x54a19e[_0x3f96('0xec')]=_0x3f96('0x109');this[_0x3f96('0xce')](_0x54a19e)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x3f96('0xcd')](_0x54a19e)[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x107')));}if(_0x1fa018&&_0x1fa018[_0x3f96('0x53')]!==_0x3f96('0x83')&&!isNotNull(this[_0x3f96('0x22')][_0x1fa018[_0x3f96('0xb7')]][_0x3f96('0x10a')])){delete this[_0x3f96('0x2a')][_0x11e808[_0x3f96('0xde')]];this[_0x3f96('0xb6')](this['voiceQueues'][_0x1fa018[_0x3f96('0xb7')]]);this[_0x3f96('0x22')][_0x1fa018[_0x3f96('0xb7')]]['outboundUnknownCallsDay']+=0x1;_0x54a19e=new Hangup(_0x1fa018,_0x11e808);_0x54a19e[_0x3f96('0xe6')]=0xc;_0x54a19e[_0x3f96('0xac')]=_0x11e808[_0x3f96('0x10b')];_0x54a19e[_0x3f96('0xec')]=_0x3f96('0x10c');this[_0x3f96('0xce')](_0x54a19e)['catch'](loggerCatch(_0x3f96('0x106')));this['moveContactManagedDialer'](_0x54a19e)['catch'](loggerCatch(_0x3f96('0x107')));}};Dialer[_0x3f96('0x1c')][_0x3f96('0x10d')]=function(_0x5197c0){var _0x10db90=this[_0x3f96('0x2a')][_0x5197c0['uniqueid']];var _0x4b922b=this;if(this[_0x3f96('0x22')][_0x5197c0[_0x3f96('0xb7')]]){if(_0x10db90&&_0x10db90['type']!=='ivr'){delete this['uniqueId'][_0x5197c0[_0x3f96('0xde')]];this[_0x3f96('0x22')][_0x5197c0[_0x3f96('0xb7')]][_0x3f96('0x65')]+=0x1;var _0x4e875e=new AgentComplete(_0x10db90,_0x5197c0);if(_0x5197c0[_0x3f96('0x10e')]===_0x3f96('0x10f')){_0x4e875e['agiafterat']=this[_0x3f96('0x22')][_0x5197c0[_0x3f96('0xb7')]][_0x3f96('0x110')]&&this[_0x3f96('0x22')][_0x5197c0[_0x3f96('0xb7')]][_0x3f96('0x111')]?moment()[_0x3f96('0x80')](_0x3f96('0xfe')):undefined;}this[_0x3f96('0xce')](_0x4e875e)[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x112')));this[_0x3f96('0xcd')](_0x4e875e)[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x113')));}}};Dialer[_0x3f96('0x1c')][_0x3f96('0x30')]=function(_0x217a45){if(this[_0x3f96('0x22')][_0x217a45['queue']]){if(this[_0x3f96('0x2a')][_0x217a45[_0x3f96('0xde')]]&&this['uniqueId'][_0x217a45[_0x3f96('0xde')]][_0x3f96('0x53')]!==_0x3f96('0x83')){this[_0x3f96('0xb6')](this['voiceQueues'][_0x217a45[_0x3f96('0xb7')]]);this[_0x3f96('0x2a')][_0x217a45[_0x3f96('0xde')]]['answertime']=moment()[_0x3f96('0x80')](_0x3f96('0xfe'));}}};Dialer[_0x3f96('0x1c')][_0x3f96('0x114')]=function(_0x997aad){this[_0x3f96('0xce')](_0x997aad)['catch'](loggerCatch(_0x3f96('0x112')));this[_0x3f96('0xcd')](_0x997aad)[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x115')));};Dialer[_0x3f96('0x1c')][_0x3f96('0x33')]=function(_0x25dd2b){var _0x1cfc7b=this[_0x3f96('0x2a')][_0x25dd2b[_0x3f96('0xde')]];var _0x5289f0=this;if(this['voiceQueues'][_0x25dd2b[_0x3f96('0xb7')]]){if(_0x1cfc7b&&_0x1cfc7b[_0x3f96('0x53')]!=='ivr'){delete this[_0x3f96('0x2a')][_0x25dd2b[_0x3f96('0xde')]];this[_0x3f96('0xb6')](this['voiceQueues'][_0x25dd2b[_0x3f96('0xb7')]]);_0x1cfc7b[_0x3f96('0x116')]=moment()['format'](_0x3f96('0xfe'));var _0x212e2b=new QueueCallerAbandon(_0x1cfc7b,_0x25dd2b);if(getSeconds(_0x1cfc7b['droptime'],_0x1cfc7b[_0x3f96('0x117')])>=_0x1cfc7b['dialQueueTimeout']){this['voiceQueues'][_0x25dd2b[_0x3f96('0xb7')]][_0x3f96('0x8b')]+=0x1;this[_0x3f96('0x22')][_0x25dd2b[_0x3f96('0xb7')]][_0x3f96('0x6a')]+=0x1;this[_0x3f96('0x22')][_0x25dd2b['queue']][_0x3f96('0x73')]+=0x1;_0x212e2b[_0x3f96('0xe6')]=0xa;_0x212e2b[_0x3f96('0xac')]='Drop';_0x212e2b[_0x3f96('0x118')]=_0x3f96('0x119');_0x212e2b[_0x3f96('0x11a')]=this[_0x3f96('0x22')][_0x25dd2b[_0x3f96('0xb7')]][_0x3f96('0x110')]?moment()[_0x3f96('0x80')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x212e2b['countdropretry']+=0x1;_0x212e2b[_0x3f96('0x103')]+=0x1;if(_0x212e2b[_0x3f96('0xf3')]>=this[_0x3f96('0x22')][_0x25dd2b[_0x3f96('0xb7')]]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x212e2b);}else{this[_0x3f96('0xc5')]({'active':![],'countdropretry':_0x212e2b[_0x3f96('0xf3')],'scheduledat':moment()[_0x3f96('0x11b')](this[_0x3f96('0x22')][_0x25dd2b[_0x3f96('0xb7')]][_0x3f96('0x11c')],'minutes')[_0x3f96('0x80')](_0x3f96('0xfe')),'ContactId':_0x1cfc7b[_0x3f96('0x105')],'ListId':_0x1cfc7b[_0x3f96('0xd6')],'VoiceQueueId':_0x1cfc7b[_0x3f96('0xff')]||undefined,'CampaignId':_0x1cfc7b[_0x3f96('0xd8')]||undefined})[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x11d')));var _0x1a03bd=new History(_0x212e2b);_0x1a03bd[_0x3f96('0xe6')]=0xa;_0x1a03bd[_0x3f96('0xac')]=_0x3f96('0x11e');_0x1a03bd[_0x3f96('0xae')]=moment()[_0x3f96('0x80')]('YYYY-MM-DD\x20HH:mm:ss');_0x1a03bd[_0x3f96('0xad')]=_0x1a03bd[_0x3f96('0xae')];_0x1a03bd['calleridname']=_0x212e2b[_0x3f96('0x11f')];_0x1a03bd[_0x3f96('0x120')]=_0x212e2b[_0x3f96('0x120')];this[_0x3f96('0xce')](_0x1a03bd)[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x121')));}}else{this[_0x3f96('0x22')][_0x25dd2b[_0x3f96('0xb7')]][_0x3f96('0x71')]+=0x1;this['voiceQueues'][_0x25dd2b['queue']][_0x3f96('0x69')]+=0x1;_0x212e2b[_0x3f96('0xe6')]=0xb;_0x212e2b[_0x3f96('0xac')]=_0x3f96('0x122');_0x212e2b[_0x3f96('0x118')]='CALLEREXIT';_0x212e2b['countabandonedretry']+=0x1;_0x212e2b[_0x3f96('0x103')]+=0x1;if(_0x212e2b['countabandonedretry']>=this[_0x3f96('0x22')][_0x25dd2b[_0x3f96('0xb7')]][_0x3f96('0x123')]){this[_0x3f96('0x114')](_0x212e2b);}else{this[_0x3f96('0xc5')]({'active':![],'countabandonedretry':_0x212e2b['countabandonedretry'],'scheduledat':moment()[_0x3f96('0x11b')](this[_0x3f96('0x22')][_0x25dd2b[_0x3f96('0xb7')]][_0x3f96('0x124')],'minutes')['format'](_0x3f96('0xfe')),'ContactId':_0x1cfc7b['ContactId'],'ListId':_0x1cfc7b[_0x3f96('0xd6')],'VoiceQueueId':_0x1cfc7b[_0x3f96('0xff')]||undefined,'CampaignId':_0x1cfc7b[_0x3f96('0xd8')]||undefined})[_0x3f96('0xbd')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x1a03bd=new History(_0x212e2b);_0x1a03bd[_0x3f96('0xe6')]=0xb;_0x1a03bd[_0x3f96('0xac')]=_0x3f96('0x122');_0x1a03bd[_0x3f96('0xae')]=moment()['format'](_0x3f96('0xfe'));_0x1a03bd[_0x3f96('0xad')]=_0x1a03bd[_0x3f96('0xae')];_0x1a03bd['calleridname']=_0x212e2b[_0x3f96('0x11f')];_0x1a03bd[_0x3f96('0x120')]=_0x212e2b[_0x3f96('0x120')];this[_0x3f96('0xce')](_0x1a03bd)[_0x3f96('0xbd')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x3f96('0x1c')]['syncNewExten']=function(_0x110181){if(this['actions'][_0x110181[_0x3f96('0xde')]]){this[_0x3f96('0x28')][_0x110181['uniqueid']]['channel']=_0x110181[_0x3f96('0xb4')];}if(this[_0x3f96('0x2a')][_0x110181[_0x3f96('0xde')]]){this[_0x3f96('0x2a')][_0x110181['uniqueid']]['channel']=_0x110181['channel'];}};Dialer['prototype'][_0x3f96('0x3c')]=function(_0x535c95){if(strategy[this[_0x3f96('0x22')][this['actions'][_0x535c95[_0x3f96('0x125')]][_0x3f96('0xb7')]][_0x3f96('0x55')]]===_0x3f96('0x1b')){if(this[_0x3f96('0x28')][_0x535c95[_0x3f96('0x125')]]&&_['isNil'](this[_0x3f96('0x28')][_0x535c95[_0x3f96('0x125')]][_0x3f96('0x126')])&&_0x535c95['status']==='1'&&_0x535c95['paused']==='0'){if(this[_0x3f96('0x24')][_0x535c95[_0x3f96('0x127')]]){if(!this[_0x3f96('0x24')][_0x535c95['stateinterface']]['locked']){this[_0x3f96('0x24')][_0x535c95[_0x3f96('0x127')]][_0x3f96('0x126')]=!![];this[_0x3f96('0x28')][_0x535c95[_0x3f96('0x125')]]['locked']=!![];this[_0x3f96('0x28')][_0x535c95['actionid']][_0x3f96('0x127')]=_0x535c95[_0x3f96('0x127')];}}}}else if((strategy[this[_0x3f96('0x22')][this[_0x3f96('0x28')][_0x535c95[_0x3f96('0x125')]][_0x3f96('0xb7')]][_0x3f96('0x55')]]||_0x3f96('0x1a'))===_0x3f96('0x1a')){if(this[_0x3f96('0x28')][_0x535c95[_0x3f96('0x125')]]){if(this['agents'][_0x535c95[_0x3f96('0x127')]]){this['actions'][_0x535c95[_0x3f96('0x125')]][_0x3f96('0x127')]=_0x535c95[_0x3f96('0x127')];if(_[_0x3f96('0xb1')](this['queueBooked'][this[_0x3f96('0x28')][_0x535c95[_0x3f96('0x125')]][_0x3f96('0xb7')]])){this[_0x3f96('0x128')][this[_0x3f96('0x28')][_0x535c95[_0x3f96('0x125')]][_0x3f96('0xb7')]]=[];}this[_0x3f96('0x128')][this['actions'][_0x535c95[_0x3f96('0x125')]]['queue']][_0x3f96('0x129')](_[_0x3f96('0xd4')](_[_0x3f96('0xd5')](this[_0x3f96('0x28')][_0x535c95['actionid']],[_0x3f96('0x12a'),'stateinterface']),{'status':_0x535c95[_0x3f96('0xb3')],'paused':_0x535c95[_0x3f96('0x12b')]}));}}}};function unlockQueueStatus(_0x347dc5,_0x453cf6){setTimeout(function(){if(_[_0x3f96('0x41')](_0x347dc5[_0x3f96('0x12c')])){loggerBooked[_0x3f96('0x9a')]('[unlockQueueStatus][undefined]',_0x453cf6);}_0x347dc5[_0x3f96('0x12c')]=!![];loggerBooked[_0x3f96('0x86')](_0x3f96('0x12d'),_0x453cf6,JSON[_0x3f96('0x4e')](_[_0x3f96('0xd5')](_0x347dc5,['name',_0x3f96('0x12c')])));},0x1f3);}Dialer['prototype'][_0x3f96('0x3e')]=function(_0x4deed0){var _0x13c2f0=this;var _0x2fad99=_0x13c2f0[_0x3f96('0x22')][_0x13c2f0['actions'][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xb7')]];if(strategy[this['voiceQueues'][this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xb7')]][_0x3f96('0x55')]]===_0x3f96('0x1b')){if(this[_0x3f96('0x28')][_0x4deed0['actionid']]&&this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0x127')]){this[_0x3f96('0x21')][_0x3f96('0x12e')](this[_0x3f96('0x28')][_0x4deed0['actionid']][_0x3f96('0x12a')],this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0x127')])[_0x3f96('0xbd')](function(_0x339647){logger[_0x3f96('0x9a')](_0x3f96('0x12f'),util[_0x3f96('0x99')](_0x339647,{'showHidden':![],'depth':null}));})[_0x3f96('0x1f')](function(){_0x13c2f0[_0x3f96('0xb6')](_0x13c2f0[_0x3f96('0x22')][_0x13c2f0[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xb7')]]);_0x13c2f0[_0x3f96('0x24')][_0x13c2f0[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0x127')]][_0x3f96('0x126')]=![];delete _0x13c2f0[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]];unlockQueueStatus(_0x2fad99);});}else{this['updateOriginated'](this[_0x3f96('0x22')][this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xb7')]]);this[_0x3f96('0xc5')]({'active':![],'ContactId':this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0x105')],'ListId':this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xd6')],'VoiceQueueId':this['actions'][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xff')]||undefined,'CampaignId':this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xd8')]||undefined})[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x130')));delete this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]];unlockQueueStatus(_0x2fad99);}}else if((strategy[this[_0x3f96('0x22')][this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xb7')]]['strategy']]||_0x3f96('0x1a'))==='rrmemory'){var _0x2be702;if(this['actions'][_0x4deed0[_0x3f96('0x125')]]&&!_[_0x3f96('0x4a')](this['queueBooked'][this[_0x3f96('0x28')][_0x4deed0['actionid']][_0x3f96('0xb7')]])){if(this['queueBookedRR'][_0x13c2f0['actions'][_0x4deed0['actionid']][_0x3f96('0xb7')]]){this[_0x3f96('0x2e')][_0x13c2f0[_0x3f96('0x28')][_0x4deed0['actionid']]['queue']]=this['queueBookedRR'][this[_0x3f96('0x28')][_0x4deed0['actionid']]['queue']]?this['queueBookedRR'][this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xb7')]]:this[_0x3f96('0x128')][this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xb7')]]?this[_0x3f96('0x128')][this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xb7')]][_0x3f96('0x131')]||0x0:0x0;}this[_0x3f96('0x128')][this[_0x3f96('0x28')][_0x4deed0[_0x3f96('0x125')]][_0x3f96('0xb7')]]['_rr']=this['queueBookedRR'][this['actions'][_0x4deed0['actionid']][_0x3f96('0xb7')]];for(var _0x5e022f=0x0;_0x5e022f=0x0;})['catch'](myreject(_0x389e33)));}}else{_0x549ca9[_0x3f96('0x129')](ami[_0x3f96('0xb2')]({'action':'command','command':util[_0x3f96('0x80')](_0x3f96('0x150'),_0x42dc7d,!_[_0x3f96('0x41')](config[_0x3f96('0x14c')][_0x604c76])?_0x604c76:'')})[_0x3f96('0xbc')](function(_0x2b8b62){return _0x2b8b62[_0x3f96('0x14d')][_0x3f96('0x14e')]('true')>=0x0;})['catch'](myreject(_0x389e33)));}BPromise['all'](_0x549ca9)[_0x3f96('0xbc')](function(_0xe5f3ba){var _0x435c88=_[_0x3f96('0x151')](_0xe5f3ba);if(_0x435c88){return _0x13d284(_0x435c88);}else{_0x316283[_0x3f96('0x42')]=_0x37e0e3?'GLOBAL_INTERVAL_IS_OVERTIME':_0x3f96('0x152');return _0x389e33(msgResponse(_0x3f96('0x153'),_0x3f96('0x145'),'Global:\x20'+_0x37e0e3+'\x20'+_0x1aaff5+_0x3f96('0x154')+util[_0x3f96('0x99')](_0x42dc7d,{'showHidden':![],'depth':null})+_0x3f96('0x155')+_0x604c76));}})[_0x3f96('0xbd')](function(_0x4b4a19){return _0x389e33(msgResponse(_0x3f96('0x143'),'Failure',JSON['stringify'](_0x4b4a19)));});});};Dialer['prototype'][_0x3f96('0x156')]=function(_0x28c6bf){var _0x4e63cd=this;return function(){switch(_0x28c6bf[_0x3f96('0x157')]){case _0x3f96('0x158'):freeVariablesPredictive(_0x28c6bf);_0x4e63cd[_0x3f96('0x159')](_0x28c6bf,0x1);break;case _0x3f96('0x15a'):freeVariablesPredictive(_0x28c6bf);_0x4e63cd[_0x3f96('0x159')](_0x28c6bf,_0x28c6bf[_0x3f96('0x15b')]);break;case _0x3f96('0x8'):_0x4e63cd[_0x3f96('0x8')](_0x28c6bf);break;case'booked':freeVariablesPredictive(_0x28c6bf);_0x4e63cd[_0x3f96('0x159')](_0x28c6bf,0x1);break;default:freeVariablesPredictive(_0x28c6bf);logger[_0x3f96('0x9a')](_0x3f96('0x15c'),_0x28c6bf['name'],_0x3f96('0x15d'));}};};Dialer['prototype'][_0x3f96('0x15e')]=function(_0xbcdd8a){var _0x436704=this;return function(){_0x436704[_0x3f96('0x15f')](_0xbcdd8a);};};Dialer[_0x3f96('0x1c')][_0x3f96('0xb')]=function(_0x3cc0ae){var _0x5eb838=this;if(isNotPreview(_0x3cc0ae[_0x3f96('0x157')])){if(isVoiceQueueOutbound(_0x3cc0ae[_0x3f96('0x53')])&&isActive(_0x3cc0ae[_0x3f96('0x160')])){_0x3cc0ae[_0x3f96('0xa6')]=!![];BPromise[_0x3f96('0xbb')]()[_0x3f96('0xbc')](checkIsLoggedIn(_0x3cc0ae,_0x3cc0ae[_0x3f96('0x57')]))[_0x3f96('0xbc')](checkIsActive(_0x3cc0ae,_0x3cc0ae['dialActive']))['then'](checkInterval(_0x3cc0ae))[_0x3f96('0xbc')](_0x5eb838[_0x3f96('0x13d')](_0x3cc0ae))[_0x3f96('0xbc')](_0x5eb838['checkIfTime'](_0x3cc0ae[_0x3f96('0x161')],_0x3cc0ae[_0x3f96('0x162')],_0x3cc0ae[_0x3f96('0x44')],_0x3cc0ae))['then'](_0x5eb838[_0x3f96('0x144')](_0x3cc0ae[_0x3f96('0x47')],_0x3cc0ae[_0x3f96('0x162')],_0x3cc0ae[_0x3f96('0x44')],_0x3cc0ae))['then'](_0x5eb838[_0x3f96('0x156')](_0x3cc0ae))[_0x3f96('0xbd')](loggerCatchQueueSummary(_0x3f96('0x163'),_0x3cc0ae));}else{notSendMessagesQueue(_0x3cc0ae);}}else{freeVariablesPredictive(_0x3cc0ae);}};Dialer['prototype'][_0x3f96('0x13c')]=function(){var _0x287d4a=this;var _0xb6a04d;for(var _0x15e408 in this[_0x3f96('0x23')]){if(typeof this[_0x3f96('0x23')][_0x15e408]!==_0x3f96('0x9e')){_0xb6a04d=this[_0x3f96('0x23')][_0x15e408];if(isCampaignIvr(_0xb6a04d[_0x3f96('0x53')])&&isActive(_0xb6a04d[_0x3f96('0x7d')])){_0xb6a04d[_0x3f96('0xa6')]=!![];BPromise[_0x3f96('0xbb')]()[_0x3f96('0xbc')](checkIsActive(_0xb6a04d,_0xb6a04d[_0x3f96('0x7d')]))['then'](checkInterval(_0xb6a04d))[_0x3f96('0xbc')](_0x287d4a[_0x3f96('0x13d')](_0xb6a04d))[_0x3f96('0xbc')](_0x287d4a[_0x3f96('0x142')](_0xb6a04d['dialGlobalInterval'],_0xb6a04d[_0x3f96('0x162')],_0xb6a04d[_0x3f96('0x44')],_0xb6a04d))[_0x3f96('0xbc')](_0x287d4a[_0x3f96('0x144')](_0xb6a04d[_0x3f96('0x47')],_0xb6a04d[_0x3f96('0x162')],_0xb6a04d[_0x3f96('0x44')],_0xb6a04d))[_0x3f96('0xbc')](_0x287d4a[_0x3f96('0x15e')](_0xb6a04d))[_0x3f96('0xbd')](loggerCatchQueueSummary(_0x3f96('0x164'),_0xb6a04d));}else{notSendMessagesCampaign(_0xb6a04d);}}}};function getCallerIdRandom(_0x47397c,_0x2a5e4f){var _0x1a9ecb;var _0x25335f;var _0x11e2ad;if(_0x2a5e4f<=0x0){_0x2a5e4f=0x1;}_0x1a9ecb=new RegExp(_0x3f96('0x165')+_0x2a5e4f+'}$');_0x25335f=Math[_0x3f96('0x166')](0xa,_0x2a5e4f-0x1);_0x11e2ad=Math[_0x3f96('0x166')](0xa,_0x2a5e4f)-0x1;return util[_0x3f96('0x80')]('%s',_[_0x3f96('0x167')](_0x47397c,_0x1a9ecb,_[_0x3f96('0x168')](_0x25335f,_0x11e2ad)));}function extractCalleridName(_0x3fd81f){var _0x53ae92=_0x3fd81f[_0x3f96('0x169')](/"(.*?)"/);return _0x53ae92?_0x53ae92[0x1]:_0x3fd81f;}function extractCalleridNumber(_0xdf3460){var _0x54a80d=_0xdf3460[_0x3f96('0x169')](/<(.*?)>/);return _0x54a80d?_0x54a80d[0x1]:_0xdf3460;}Dialer[_0x3f96('0x1c')]['actionOriginate']=function(_0x17be61,_0x2ec591){var _0x2f6419=this;var _0x5aa3d0=uuid['v4']();this[_0x3f96('0x28')][_0x5aa3d0]=new Action(_0x17be61,_0x2ec591,_0x5aa3d0);return new BPromise(function(_0x175fee,_0xb23511){if(_[_0x3f96('0x41')](_0x17be61)&&typeof _0x17be61!==_0x3f96('0x16a')){return _0xb23511(msgResponse(_0x3f96('0x16b'),'Failure','voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x2ec591['Contact'][_0x3f96('0x16c')])||_0x2ec591['Contact'][_0x3f96('0x16c')]===null){return _0xb23511(msgResponse(_0x3f96('0x16b'),_0x3f96('0x145'),_0x3f96('0x16d')));}var _0x37a8aa={'XMD-CALLERID':_0x2f6419[_0x3f96('0x28')][_0x5aa3d0]['getCaller'](),'XMD-AGI':_0x17be61[_0x3f96('0x10a')]?util[_0x3f96('0x80')]('\x22agi://%s/square,%s\x22',ipAgi,_0x17be61[_0x3f96('0x10a')]):'NONE','XMD-AGIAFTER':_0x17be61[_0x3f96('0x110')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x17be61[_0x3f96('0x110')]):_0x3f96('0x16e'),'XMD-QUEUE':_0x17be61['type']===_0x3f96('0x54')?util[_0x3f96('0x80')](_0x3f96('0x16f'),_0x17be61['name'],_0x17be61[_0x3f96('0x170')]||'',_0x17be61[_0x3f96('0x111')]?'c':'',_0x17be61[_0x3f96('0x171')]||0x3):_0x3f96('0x16e'),'XMD-CONTACTID':_0x2ec591[_0x3f96('0x105')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2f6419['actions'][_0x5aa3d0][_0x3f96('0x172')](),'XMD-AMD':_0x17be61[_0x3f96('0xe3')]?_0x3f96('0x173'):_0x3f96('0x16e'),'XMD-DESTINATION':_0x3f96('0xe2')};if(_0x17be61['dialAMDActive']){_0x37a8aa[_0x3f96('0x174')]=_0x17be61[_0x3f96('0x175')]||0x9c4;_0x37a8aa[_0x3f96('0x176')]=_0x17be61[_0x3f96('0x177')]||0x5dc;_0x37a8aa['XMD-AMDAFTERGREETINGSILENCE']=_0x17be61['dialAMDAfterGreetingSilence']||0x320;_0x37a8aa[_0x3f96('0x178')]=_0x17be61[_0x3f96('0x179')]||0x1388;_0x37a8aa[_0x3f96('0x17a')]=_0x17be61[_0x3f96('0x17b')]||0x64;_0x37a8aa[_0x3f96('0x17c')]=_0x17be61[_0x3f96('0x17d')]||0x32;_0x37a8aa[_0x3f96('0x17e')]=_0x17be61[_0x3f96('0x17f')]||0x3;_0x37a8aa[_0x3f96('0x180')]=_0x17be61['dialAMDSilenceThreshold']||0x100;_0x37a8aa[_0x3f96('0x181')]=_0x17be61[_0x3f96('0x182')]||0x1388;}if(_0x17be61['type']===_0x3f96('0x54')){_0x37a8aa[_0x3f96('0x183')]=_0x2ec591[_0x3f96('0xff')];}else{_0x37a8aa['XMD-CAMPAIGNID']=_0x2ec591[_0x3f96('0xd8')];}for(var _0x559858 in _0x2ec591[_0x3f96('0x184')]){if(typeof _0x2ec591[_0x3f96('0x184')][_0x559858]!=='undefined'){if(isNotNull(_0x2ec591[_0x3f96('0x184')][_0x559858])&&_0x559858!=='id'&&_0x559858!==_0x3f96('0x185')&&_0x559858!=='createdAt'&&_0x559858!==_0x3f96('0x186')){_0x37a8aa[util[_0x3f96('0x80')](_0x3f96('0x187'),_0x3f96('0x188'),_[_0x3f96('0x189')](_0x559858))]=_0x2ec591[_0x3f96('0x184')][_0x559858];}}}var _0x2b064d=_0x2f6419[_0x3f96('0x13e')](_0x17be61['Trunk'])?getCallerId(_0x17be61[_0x3f96('0x7c')]['callerid'],_0x17be61[_0x3f96('0x61')],_0x17be61['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x17be61['dialOriginateCallerIdNumber'],_0x17be61[_0x3f96('0x18a')]):_0x17be61[_0x3f96('0x62')]):getCallerId(_[_0x3f96('0xb1')](_0x17be61['TrunkBackup'])?_0x17be61[_0x3f96('0x7c')][_0x3f96('0x7e')]:_0x17be61[_0x3f96('0x13f')][_0x3f96('0x7e')],_0x17be61[_0x3f96('0x61')],_0x17be61[_0x3f96('0x18a')]>0x0?getCallerIdRandom(_0x17be61['dialOriginateCallerIdNumber'],_0x17be61[_0x3f96('0x18a')]):_0x17be61['dialOriginateCallerIdNumber']);if(_0x2b064d){_0x37a8aa[_0x3f96('0x18b')]=_0x2f6419['actions'][_0x5aa3d0][_0x3f96('0x18c')]=extractCalleridName(_0x2b064d);_0x37a8aa[_0x3f96('0x18d')]=_0x2f6419['actions'][_0x5aa3d0][_0x3f96('0x18e')]=extractCalleridNumber(_0x2b064d);}return ami['Action']({'actionid':_0x5aa3d0,'action':_0x3f96('0x16b'),'channel':_0x2f6419[_0x3f96('0x13e')](_0x17be61[_0x3f96('0x7c')])?util['format']('SIP/%s/%s%s',_0x17be61['Trunk'][_0x3f96('0x44')],isNotNull(_0x17be61['dialPrefix'])?_0x17be61[_0x3f96('0x63')][_0x3f96('0x18f')]()||'':'',_0x17be61[_0x3f96('0x190')]>0x0?_0x2ec591[_0x3f96('0x184')][_0x3f96('0x16c')][_0x3f96('0x191')](_0x17be61[_0x3f96('0x190')]):_0x2ec591[_0x3f96('0x184')][_0x3f96('0x16c')]):util[_0x3f96('0x80')](_0x3f96('0x192'),_[_0x3f96('0xb1')](_0x17be61[_0x3f96('0x13f')])?_0x17be61[_0x3f96('0x7c')][_0x3f96('0x44')]:_0x17be61[_0x3f96('0x13f')][_0x3f96('0x44')],isNotNull(_0x17be61[_0x3f96('0x63')])?_0x17be61['dialPrefix'][_0x3f96('0x18f')]()||'':'',_0x17be61[_0x3f96('0x190')]>0x0?_0x2ec591[_0x3f96('0x184')][_0x3f96('0x16c')][_0x3f96('0x191')](_0x17be61['dialCutDigit']):_0x2ec591[_0x3f96('0x184')]['phone']),'callerid':_0x2b064d,'Exten':_0x3f96('0xe2'),'Context':_0x3f96('0x193'),'Priority':'1','variable':_0x37a8aa,'timeout':(_0x17be61[_0x3f96('0x194')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5aa3d0})[_0x3f96('0xbc')](function(_0x403902){return _0x175fee(_0x403902);})['catch'](function(_0x51da1b){_0x17be61[_0x3f96('0x6d')]+=0x1;var _0x4a8ef7=new History(_0x2f6419[_0x3f96('0x28')][_0x5aa3d0]);logger[_0x3f96('0x9a')](util[_0x3f96('0x80')](_0x3f96('0x195'),JSON['stringify'](_0x51da1b)));_0x4a8ef7[_0x3f96('0xe6')]=0xe;_0x4a8ef7[_0x3f96('0xac')]=_0x3f96('0x196');_0x4a8ef7[_0x3f96('0xae')]=moment()[_0x3f96('0x80')](_0x3f96('0xfe'));_0x4a8ef7[_0x3f96('0xad')]=_0x4a8ef7[_0x3f96('0xae')];_0x2f6419[_0x3f96('0xce')](_0x4a8ef7)[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x197')));_0x2f6419[_0x3f96('0xcd')](_0x4a8ef7)['catch'](loggerCatch(_0x3f96('0x197')))[_0x3f96('0x1f')](function(){delete _0x2f6419[_0x3f96('0x28')][_0x5aa3d0];return _0xb23511(msgResponse(_0x3f96('0x16b'),_0x3f96('0x4d'),'originate\x20action\x20Error'));});});});};Dialer[_0x3f96('0x1c')]['syncOriginateResponse']=function(_0x1b7b1a){var _0x38dd73=this[_0x3f96('0x28')][_0x1b7b1a[_0x3f96('0x125')]];if(_0x38dd73){delete this[_0x3f96('0x28')][_0x1b7b1a[_0x3f96('0x125')]];_0x38dd73[_0x3f96('0x117')]=moment()[_0x3f96('0x80')](_0x3f96('0xfe'));var _0x44d54f=_0x38dd73[_0x3f96('0x53')]===_0x3f96('0x83')?this[_0x3f96('0x23')][_0x38dd73[_0x3f96('0xb7')]]:this['voiceQueues'][_0x38dd73[_0x3f96('0x198')]()];if(!this[_0x3f96('0x199')](_0x1b7b1a[_0x3f96('0x19a')])){this['updateOriginated'](_0x44d54f);return this['callProgressDetecting'](_0x38dd73,_0x44d54f,_0x1b7b1a)[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x19b')));}this[_0x3f96('0x2a')][_0x1b7b1a[_0x3f96('0xde')]]=_0x38dd73;}};Dialer[_0x3f96('0x1c')][_0x3f96('0x19c')]=function(_0x5bfb17,_0x2d7bc9,_0x2c7473){var _0x2d3271=new History(_0x2d7bc9);if(_0x2d3271[_0x3f96('0xef')]+_0x2d3271['countcongestionretry']+_0x2d3271[_0x3f96('0xf1')]+_0x2d3271['countnosuchnumberretry']+_0x2d3271[_0x3f96('0xf3')]+_0x2d3271[_0x3f96('0xf4')]+_0x2d3271[_0x3f96('0xed')]+_0x2d3271[_0x3f96('0xf5')]>=_0x2c7473['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x5bfb17){case 0x3:if(_0x2d3271['countnoanswerretry']>=_0x2c7473['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x3f96('0xc5')]({'active':![],'countnoanswerretry':_0x2d3271[_0x3f96('0xf1')]+=0x1,'scheduledat':moment()[_0x3f96('0x11b')](_0x2c7473[_0x3f96('0x19d')],_0x3f96('0xfd'))[_0x3f96('0x80')](_0x3f96('0xfe')),'ContactId':_0x2d3271['ContactId'],'ListId':_0x2d3271[_0x3f96('0xd6')],'VoiceQueueId':_0x2d3271[_0x3f96('0xff')]||undefined,'CampaignId':_0x2d3271['CampaignId']||undefined})[_0x3f96('0xbd')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x2d3271['countbusyretry']>=_0x2c7473['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x2d3271[_0x3f96('0xef')]+=0x1,'scheduledat':moment()[_0x3f96('0x11b')](_0x2c7473[_0x3f96('0x19e')],_0x3f96('0xfd'))['format'](_0x3f96('0xfe')),'ContactId':_0x2d3271[_0x3f96('0x105')],'ListId':_0x2d3271[_0x3f96('0xd6')],'VoiceQueueId':_0x2d3271[_0x3f96('0xff')]||undefined,'CampaignId':_0x2d3271[_0x3f96('0xd8')]||undefined})[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x19f')));break;case 0x8:if(_0x2d3271['countcongestionretry']>=_0x2c7473[_0x3f96('0x1a0')]-0x1){return!![];}this[_0x3f96('0xc5')]({'active':![],'countcongestionretry':_0x2d3271[_0x3f96('0xf0')]+=0x1,'scheduledat':moment()[_0x3f96('0x11b')](_0x2c7473[_0x3f96('0x1a1')],_0x3f96('0xfd'))[_0x3f96('0x80')](_0x3f96('0xfe')),'ContactId':_0x2d3271[_0x3f96('0x105')],'ListId':_0x2d3271[_0x3f96('0xd6')],'VoiceQueueId':_0x2d3271[_0x3f96('0xff')]||undefined,'CampaignId':_0x2d3271[_0x3f96('0xd8')]||undefined})['catch'](loggerCatch(_0x3f96('0x1a2')));break;case 0x0:if(_0x2d3271['countnosuchnumberretry']>=_0x2c7473[_0x3f96('0x1a3')]-0x1){return!![];}else{this[_0x3f96('0xc5')]({'active':![],'countnosuchnumberretry':_0x2d3271['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x3f96('0x11b')](_0x2c7473[_0x3f96('0x1a4')],_0x3f96('0xfd'))['format'](_0x3f96('0xfe')),'ContactId':_0x2d3271['ContactId'],'ListId':_0x2d3271[_0x3f96('0xd6')],'VoiceQueueId':_0x2d3271[_0x3f96('0xff')]||undefined,'CampaignId':_0x2d3271['CampaignId']||undefined})[_0x3f96('0xbd')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x2d3271[_0x3f96('0xf3')]>=_0x2c7473[_0x3f96('0x1a5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x2d3271[_0x3f96('0xf3')]+=0x1,'scheduledat':moment()['add'](_0x2c7473[_0x3f96('0x11c')],_0x3f96('0xfd'))[_0x3f96('0x80')](_0x3f96('0xfe')),'ContactId':_0x2d3271[_0x3f96('0x105')],'ListId':_0x2d3271[_0x3f96('0xd6')],'VoiceQueueId':_0x2d3271[_0x3f96('0xff')]||undefined,'CampaignId':_0x2d3271[_0x3f96('0xd8')]||undefined})[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x11d')));break;case 0xb:if(_0x2d3271[_0x3f96('0xf4')]>=_0x2c7473[_0x3f96('0x123')]-0x1){return!![];}this[_0x3f96('0xc5')]({'active':![],'countabandonedretry':_0x2d3271[_0x3f96('0xf4')]+=0x1,'scheduledat':moment()['add'](_0x2c7473[_0x3f96('0x124')],'minutes')['format'](_0x3f96('0xfe')),'ContactId':_0x2d3271[_0x3f96('0x105')],'ListId':_0x2d3271['ListId'],'VoiceQueueId':_0x2d3271[_0x3f96('0xff')]||undefined,'CampaignId':_0x2d3271[_0x3f96('0xd8')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x2d3271[_0x3f96('0xed')]>=_0x2c7473[_0x3f96('0xf9')]-0x1){return!![];}this[_0x3f96('0xc5')]({'active':![],'countmachineretry':_0x2d3271[_0x3f96('0xed')]+=0x1,'scheduledat':moment()[_0x3f96('0x11b')](_0x2c7473[_0x3f96('0xfc')],'minutes')[_0x3f96('0x80')](_0x3f96('0xfe')),'ContactId':_0x2d3271[_0x3f96('0x105')],'ListId':_0x2d3271[_0x3f96('0xd6')],'VoiceQueueId':_0x2d3271[_0x3f96('0xff')]||undefined,'CampaignId':_0x2d3271[_0x3f96('0xd8')]||undefined})[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x100')));break;case 0x14:if(_0x2d3271['countagentrejectretry']>=_0x2c7473[_0x3f96('0x1a6')]-0x1){return!![];}this[_0x3f96('0xc5')]({'active':![],'countagentrejectretry':_0x2d3271[_0x3f96('0xf5')]+=0x1,'scheduledat':moment()['add'](_0x2c7473[_0x3f96('0x1a7')],_0x3f96('0xfd'))[_0x3f96('0x80')](_0x3f96('0xfe')),'ContactId':_0x2d3271[_0x3f96('0x105')],'ListId':_0x2d3271['ListId'],'VoiceQueueId':_0x2d3271[_0x3f96('0xff')]||undefined,'CampaignId':_0x2d3271[_0x3f96('0xd8')]||undefined})[_0x3f96('0xbd')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0x3f96('0x1a8')]=function(_0x5cc789,_0x36209f,_0x47c83e){var _0x277fb5=this;var _0x20f65c=new History(_0x5cc789);return new BPromise(function(_0x293a07,_0x3824e4){if(_[_0x3f96('0x41')](_0x36209f)&&typeof _0x36209f!==_0x3f96('0x16a')){return _0x3824e4(msgResponse(_0x3f96('0x1a9'),_0x3f96('0x145'),_0x3f96('0x1aa')));}if(_[_0x3f96('0x41')](_0x47c83e)&&typeof _0x47c83e!=='object'){return _0x3824e4(msgResponse(_0x3f96('0x1a9'),_0x3f96('0x145'),_0x3f96('0x1ab')));}switch(_0x47c83e['reason']){case'0':_0x36209f[_0x3f96('0x6c')]+=0x1;_0x20f65c[_0x3f96('0xe6')]=0x0;_0x20f65c[_0x3f96('0xac')]=_0x3f96('0x1ac');_0x20f65c[_0x3f96('0xf2')]+=0x1;_0x20f65c[_0x3f96('0x103')]+=0x1;ami[_0x3f96('0x52')](_0x3f96('0x1ad'),ut[_0x3f96('0x1ae')](_0x5cc789,_0x3f96('0x1af')));_0x277fb5['createHistory'](_0x20f65c)[_0x3f96('0xbd')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x277fb5[_0x3f96('0x19c')](0x0,_0x5cc789,_0x36209f)){if(_0x20f65c[_0x3f96('0xf2')]>=_0x36209f[_0x3f96('0x1a3')]){_0x277fb5[_0x3f96('0xfa')](_0x20f65c,_0x293a07,_0x3824e4,'reason\x200\x20no\x20such\x20number....');}else{_0x277fb5['stateGlobal'](_0x20f65c,_0x293a07,_0x3824e4,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x36209f[_0x3f96('0x6b')]+=0x1;_0x20f65c[_0x3f96('0xe6')]=0x3;_0x20f65c['statedesc']=_0x3f96('0x1b0');_0x20f65c[_0x3f96('0xf1')]+=0x1;_0x20f65c['countglobal']+=0x1;ami['emit'](_0x3f96('0x1b1'),ut[_0x3f96('0x1ae')](_0x5cc789,_0x3f96('0x1b2')));_0x277fb5['createHistory'](_0x20f65c)[_0x3f96('0xbd')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x277fb5[_0x3f96('0x19c')](0x3,_0x5cc789,_0x36209f)){if(_0x20f65c[_0x3f96('0xf1')]>=_0x36209f[_0x3f96('0x1b3')]){_0x277fb5['createStateFinal'](_0x20f65c,_0x293a07,_0x3824e4,_0x3f96('0x1b4'));}else{_0x277fb5[_0x3f96('0xf7')](_0x20f65c,_0x293a07,_0x3824e4,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x36209f[_0x3f96('0x1b5')]+=0x1;_0x20f65c[_0x3f96('0xe6')]=0x5;_0x20f65c[_0x3f96('0xac')]=_0x3f96('0x1b6');_0x20f65c[_0x3f96('0xef')]+=0x1;_0x20f65c[_0x3f96('0x103')]+=0x1;ami[_0x3f96('0x52')](_0x3f96('0x1b7'),ut[_0x3f96('0x1ae')](_0x5cc789,_0x3f96('0x1b8')));_0x277fb5[_0x3f96('0xce')](_0x20f65c)[_0x3f96('0xbd')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x277fb5['checkRetriveMax'](0x5,_0x5cc789,_0x36209f)){if(_0x20f65c[_0x3f96('0xef')]>=_0x36209f[_0x3f96('0x1b9')]){_0x277fb5[_0x3f96('0xfa')](_0x20f65c,_0x293a07,_0x3824e4,_0x3f96('0x1ba'));}else{_0x277fb5['stateGlobal'](_0x20f65c,_0x293a07,_0x3824e4,_0x3f96('0x1ba'));}}break;case'8':_0x36209f['outboundCongestionCallsDay']+=0x1;_0x20f65c[_0x3f96('0xe6')]=0x8;_0x20f65c[_0x3f96('0xac')]='Congestion';_0x20f65c['countcongestionretry']+=0x1;_0x20f65c[_0x3f96('0x103')]+=0x1;ami[_0x3f96('0x52')](_0x3f96('0x1bb'),ut['buildObj'](_0x5cc789,_0x3f96('0x1bc')));_0x277fb5[_0x3f96('0xce')](_0x20f65c)[_0x3f96('0xbd')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x277fb5['checkRetriveMax'](0x8,_0x5cc789,_0x36209f)){if(_0x20f65c['countcongestionretry']>=_0x36209f[_0x3f96('0x1a0')]){_0x277fb5[_0x3f96('0xfa')](_0x20f65c,_0x293a07,_0x3824e4,_0x3f96('0x1bd'));}else{_0x277fb5[_0x3f96('0xf7')](_0x20f65c,_0x293a07,_0x3824e4,_0x3f96('0x1bd'));}}break;case'11':_0x36209f['outboundAbandonedCallsDay']+=0x1;_0x20f65c[_0x3f96('0xe6')]=0xb;_0x20f65c[_0x3f96('0xac')]=_0x3f96('0x122');_0x20f65c['countabandonedretry']+=0x1;_0x20f65c[_0x3f96('0x103')]+=0x1;_0x277fb5[_0x3f96('0xce')](_0x20f65c)['catch'](loggerCatch(_0x3f96('0x1be')));if(_0x277fb5[_0x3f96('0x19c')](0xb,_0x5cc789,_0x36209f)){if(_0x20f65c[_0x3f96('0xf4')]>=_0x36209f['dialAbandonedMaxRetry']){_0x277fb5[_0x3f96('0xfa')](_0x20f65c,_0x293a07,_0x3824e4,_0x3f96('0x1bf'));}else{_0x277fb5[_0x3f96('0xf7')](_0x20f65c,_0x293a07,_0x3824e4,_0x3f96('0x1bf'));}}break;case'20':_0x36209f[_0x3f96('0x6e')]+=0x1;_0x20f65c['state']=0x14;_0x20f65c[_0x3f96('0xac')]=_0x3f96('0x1c0');_0x20f65c[_0x3f96('0xf5')]+=0x1;_0x20f65c[_0x3f96('0x103')]+=0x1;ami[_0x3f96('0x52')]('custom:agentreject',ut['buildObj'](_0x5cc789,_0x3f96('0x1c1')));_0x277fb5['createHistory'](_0x20f65c)['catch'](loggerCatch(_0x3f96('0x1c2')));if(_0x277fb5['checkRetriveMax'](0x14,_0x5cc789,_0x36209f)){if(_0x20f65c[_0x3f96('0xf5')]>=_0x36209f[_0x3f96('0x1a6')]){_0x277fb5[_0x3f96('0xfa')](_0x20f65c,_0x293a07,_0x3824e4,_0x3f96('0x1c3'));}else{_0x277fb5[_0x3f96('0xf7')](_0x20f65c,_0x293a07,_0x3824e4,_0x3f96('0x1c3'));}}break;default:_0x36209f[_0x3f96('0x1c4')]+=0x1;_0x20f65c[_0x3f96('0xe6')]=0xc;_0x20f65c[_0x3f96('0xac')]=_0x47c83e['reason'];_0x277fb5[_0x3f96('0xce')](_0x20f65c)[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x1c5')));if(_0x277fb5['checkRetriveMax'](_0x47c83e[_0x3f96('0x10e')],_0x5cc789,_0x36209f)){if(_0x20f65c['countbusyretry']+_0x20f65c[_0x3f96('0xf0')]+_0x20f65c[_0x3f96('0xf1')]+_0x20f65c['countnosuchnumberretry']+_0x20f65c[_0x3f96('0xf3')]+_0x20f65c['countabandonedretry']+_0x20f65c['countmachineretry']+_0x20f65c[_0x3f96('0xf5')]>=_0x36209f['dialGlobalMaxRetry']){_0x277fb5[_0x3f96('0xf7')](_0x20f65c,_0x293a07,_0x3824e4,_0x47c83e[_0x3f96('0x10e')]);}else{_0x277fb5[_0x3f96('0xfa')](_0x20f65c,_0x293a07,_0x3824e4,_0x47c83e[_0x3f96('0x10e')]);}}}});};Dialer['prototype'][_0x3f96('0xf7')]=function(_0x1d6045,_0x5f0a2b,_0x4e6e8b,_0x40122c){var _0x39e8ec=new Final(_0x1d6045);_0x39e8ec['state']=0xf;_0x39e8ec[_0x3f96('0xac')]=_0x3f96('0x1c6');this[_0x3f96('0xfa')](_0x39e8ec,_0x5f0a2b,_0x4e6e8b,_0x40122c);};Dialer['prototype'][_0x3f96('0xfa')]=function(_0x1109f8,_0x5135f3,_0x477918,_0x40467e){this['moveContactManagedDialer'](_0x1109f8)['then'](function(){return _0x5135f3(msgResponse(_0x3f96('0x1a9'),'Success',_0x40467e));})[_0x3f96('0xbd')](function(){return _0x477918(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer[_0x3f96('0x1c')]['predictive']=function(_0xad8048){var _0x226d69=_0xad8048[_0x3f96('0x1c7')]/0x64;var _0x59518e=_0xad8048[_0x3f96('0x6a')]/(_0xad8048[_0x3f96('0x6a')]+_0xad8048[_0x3f96('0x65')]);var _0x1ccc01=Math[_0x3f96('0x1c8')](_0xad8048['predictiveIntervalAvailable']*(_0xad8048[_0x3f96('0x1c9')]/0x64));var _0x575b8c=Math[_0x3f96('0x1c8')](_0xad8048['predictiveIntervalAvailable']*(_0xad8048['predictiveIntervalMinThreshold']/0x64));var _0x246186=_0xad8048[_0x3f96('0x56')]+_0xad8048[_0x3f96('0x5c')];var _0x11fd16=Math[_0x3f96('0x1ca')](_0xad8048[_0x3f96('0x78')]*_0xad8048[_0x3f96('0x79')]*_0xad8048['predictiveIntervalHitRate']*_0xad8048['predictiveIntervalMultiplicativeFactor']);if(_[_0x3f96('0x41')](_0xad8048[_0x3f96('0x7b')])){if(!_['isUndefined'](_0xad8048[_0x3f96('0x2c')])){_0xad8048[_0x3f96('0x2c')]=undefined;loggerPredictive[_0x3f96('0x9a')](_0x3f96('0x1cb'),_0x3f96('0x1cc'));}if(!_[_0x3f96('0x41')](_0xad8048[_0x3f96('0x96')])){loggerPredictive[_0x3f96('0x9a')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0xad8048[_0x3f96('0x96')]);_0xad8048['handlePredictive']=undefined;}_0xad8048['startProgressive']=moment()[_0x3f96('0x80')](_0x3f96('0xfe'));loggerPredictive[_0x3f96('0x86')](_0xad8048[_0x3f96('0x44')],_0x3f96('0x1cd'),_0xad8048[_0x3f96('0x7b')]);this[_0x3f96('0x159')](_0xad8048,0x1);}else if(ifInterval(_0xad8048['dialPredictiveInterval'],_0xad8048['startProgressive'])){this[_0x3f96('0x159')](_0xad8048,0x1);loggerPredictiveCalls[_0x3f96('0x86')]('[startMethodPredictive][StartProgressive][Loop]',_0xad8048[_0x3f96('0x7b')],_0xad8048[_0x3f96('0x44')]);_0xad8048[_0x3f96('0x78')]=0x0;_0xad8048['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x226d69<_0x59518e&&_0xad8048['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0xad8048);loggerPredictive['info'](_0x3f96('0x1ce'),_0x3f96('0x1cf'),_0x59518e,_0x3f96('0x7b'),_0xad8048['name']);}else if(_0x11fd16<_0xad8048['predictiveIntervalErlangCallsDroppedCalls']&&_0xad8048[_0x3f96('0x1d0')]===_0x3f96('0x1d1')){freeVariablesPredictive(_0xad8048);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x1d2'),_0x3f96('0x1d3'),_0x11fd16,_0x3f96('0x1d4'),_0xad8048['predictiveIntervalErlangCallsDroppedCalls'],_0x3f96('0x7b'),_0xad8048[_0x3f96('0x44')]);}else if(!ifInterval(_0xad8048['dialPredictiveInterval'],_0xad8048[_0x3f96('0x7b')])&&_['isUndefined'](_0xad8048[_0x3f96('0x2c')])&&!_[_0x3f96('0x41')](_0xad8048[_0x3f96('0x7b')])){_0xad8048['startPredictive']=moment()['format'](_0x3f96('0xfe'));loggerPredictive['info'](_0xad8048[_0x3f96('0x44')],'started\x20in\x20predictive\x20at',_0xad8048[_0x3f96('0x2c')]);this[_0x3f96('0xc3')](_0xad8048['dialPredictiveInterval'])[_0x3f96('0xbc')](this[_0x3f96('0x1d5')](_0xad8048))[_0x3f96('0xbc')](mergeDataErlangB(_0xad8048))[_0x3f96('0xbc')](this[_0x3f96('0x1d6')](_0xad8048))[_0x3f96('0xbd')](loggerCatchPredictive(_0x3f96('0x1d7'),_0xad8048));}else if(!ifInterval(_0xad8048[_0x3f96('0x1d8')],_0xad8048[_0x3f96('0x2c')])){_0xad8048[_0x3f96('0x73')]=0x0;_0xad8048[_0x3f96('0x2c')]=moment()[_0x3f96('0x80')](_0x3f96('0xfe'));loggerPredictive[_0x3f96('0x86')](_0xad8048[_0x3f96('0x44')],_0x3f96('0x1d9'),_0xad8048[_0x3f96('0x2c')]);clearInterval(_0xad8048[_0x3f96('0x96')]);_0xad8048[_0x3f96('0x96')]=undefined;this[_0x3f96('0xc3')](_0xad8048[_0x3f96('0x1d8')])['then'](this[_0x3f96('0x1d5')](_0xad8048))[_0x3f96('0xbc')](mergeDataErlangB(_0xad8048))[_0x3f96('0xbc')](this[_0x3f96('0x1d6')](_0xad8048))[_0x3f96('0xbd')](loggerCatchPredictive(_0x3f96('0x1da'),_0xad8048));}else if(_0xad8048[_0x3f96('0x76')]&&_0x246186<_0xad8048['predictiveIntervalAvailable']-_0x575b8c){freeVariablesPredictive(_0xad8048);loggerPredictive[_0x3f96('0x86')](_0xad8048[_0x3f96('0x44')],_0x3f96('0x1db'),_0x246186,_0x3f96('0x1dc'),_0xad8048['predictiveIntervalAvailable'],'-',_0x575b8c,'=',_0xad8048[_0x3f96('0x76')]-_0x575b8c,')');}else if(_0xad8048[_0x3f96('0x76')]&&_0x246186>_0xad8048[_0x3f96('0x76')]+_0x1ccc01){freeVariablesPredictive(_0xad8048);loggerPredictive['info'](_0xad8048[_0x3f96('0x44')],_0x3f96('0x1db'),_0x246186,')\x20are\x20more\x20than\x20threshold\x20(',_0xad8048['predictiveIntervalAvailable'],'+',_0x1ccc01,'=',_0xad8048[_0x3f96('0x76')]+_0x1ccc01,')');}};Dialer['prototype'][_0x3f96('0x1d5')]=function(_0x3cc469){var _0x38e07e=this;return function(_0x3f33b3){return new BPromise(function(_0x47ef8f,_0x350e10){_[_0x3f96('0xd4')](_0x3cc469,_0x3f33b3[0x0]);if(checkGetDataPredictive(_0x3f33b3[0x0])){var _0x1fea54=_0x3cc469[_0x3f96('0x76')]=_0x3cc469[_0x3f96('0x5c')]+_0x3cc469[_0x3f96('0x56')];var _0x4ebd89=_0x3cc469[_0x3f96('0x1d8')]*0x3c;var _0xd90412=_0x3f33b3[0x0][_0x3f96('0x8d')]+_0x3f33b3[0x0][_0x3f96('0x70')];var _0x1bf648=(_0x3f33b3[0x0]['predictiveIntervalAnsweredCalls']+_0x3f33b3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3f33b3[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3f33b3[0x0]['predictiveIntervalTotalCalls'];_0x3cc469[_0x3f96('0x74')]=_0x1bf648>0x0?_0x1bf648:0x1;switch(_0x3cc469[_0x3f96('0x1d0')]){case _0x3f96('0x1d1'):var _0x387d0c=_0x3cc469[_0x3f96('0x1c7')]/0x64;return _0x38e07e[_0x3f96('0x1dd')](_0x1fea54,_0x4ebd89,_0xd90412,_0x1bf648,_0x387d0c)[_0x3f96('0xbc')](function(_0x58cfc2){return _0x47ef8f(_0x58cfc2);});case'agentBusyFactor':var _0x4d0e50=_0x3cc469[_0x3f96('0x1c7')]/0x64;return _0x38e07e[_0x3f96('0x1de')](_0x1fea54,_0x4ebd89,_0xd90412,_0x1bf648,_0x4d0e50)['then'](function(_0x191773){return _0x47ef8f(_0x191773);});default:return _0x350e10(msgResponse(_0x3f96('0x1df'),_0x3f96('0x145'),_0x3f96('0x1e0')));}}else{return _0x350e10(msgResponse(_0x3f96('0x1df'),'Failure',_0x3f96('0x1e1')));}});};};Dialer[_0x3f96('0x1c')][_0x3f96('0x1e2')]=function(_0x173473){var _0x5ea61b=this;return function(_0x116cd2){return new BPromise(function(_0x5b92b3,_0x1aaabe){_['merge'](_0x173473,_0x116cd2[0x0]);if(checkGetDataPredictive(_0x116cd2[0x0])){loggerPredictive[_0x3f96('0x86')](JSON[_0x3f96('0x4e')](_0x116cd2[0x0]));if(_0x173473[_0x3f96('0x1d0')]===_0x3f96('0x1d1')){return _0x5ea61b[_0x3f96('0xcc')](_0x173473['id'])[_0x3f96('0xbc')](function(_0x4d6fd2){var _0x181e6e=_0x173473['loggedIn']-_0x4d6fd2[0x0][_0x3f96('0x1e3')];var _0x3508e0=_0x173473[_0x3f96('0x1d8')]*0x3c;var _0x4314bd=_0x116cd2[0x0][_0x3f96('0x8d')]+_0x116cd2[0x0][_0x3f96('0x70')];var _0x37ec4c=(_0x116cd2[0x0]['predictiveIntervalAnsweredCalls']+_0x116cd2[0x0][_0x3f96('0x8b')]+_0x116cd2[0x0][_0x3f96('0x71')])/_0x116cd2[0x0][_0x3f96('0x77')];var _0x2f1227=_0x173473['dialPredictiveOptimizationPercentage']/0x64;_0x173473[_0x3f96('0x1e4')]=_0x4d6fd2[0x0]['outboundQueuePauses']||0x0;_0x173473['predictiveIntervalHitRate']=_0x37ec4c>0x0?_0x37ec4c:0x1;return _0x5ea61b[_0x3f96('0x1dd')](_0x181e6e,_0x3508e0,_0x4314bd,_0x37ec4c,_0x2f1227);})['then'](function(_0x32ee53){return _0x5b92b3(_0x32ee53);})[_0x3f96('0xbd')](function(_0x2d548d){return _0x1aaabe(msgResponse(_0x3f96('0x1e5'),'Failure',JSON[_0x3f96('0x4e')](_0x2d548d)));});}if(_0x173473[_0x3f96('0x1d0')]==='agentBusyFactor'){return _0x5ea61b[_0x3f96('0xcc')](_0x173473['id'])[_0x3f96('0xbc')](function(_0x4dcedd){var _0xa14594=_0x173473['loggedIn']-_0x4dcedd[0x0][_0x3f96('0x1e3')];var _0x345b99=_0x173473['dialPredictiveInterval']*0x3c;var _0x246730=_0x116cd2[0x0][_0x3f96('0x8d')]+_0x116cd2[0x0][_0x3f96('0x70')];var _0x2549a7=(_0x116cd2[0x0]['predictiveIntervalAnsweredCalls']+_0x116cd2[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x116cd2[0x0][_0x3f96('0x71')])/_0x116cd2[0x0][_0x3f96('0x77')];var _0x44be5a=_0x173473['dialPredictiveOptimizationPercentage']/0x64;_0x173473['predictiveIntervalPauses']=_0x4dcedd[0x0][_0x3f96('0x1e3')]||0x0;_0x173473[_0x3f96('0x74')]=_0x2549a7>0x0?_0x2549a7:0x1;return _0x5ea61b[_0x3f96('0x1de')](_0xa14594,_0x345b99,_0x246730,_0x2549a7,_0x44be5a);})['then'](function(_0x441054){return _0x5b92b3(_0x441054);})[_0x3f96('0xbd')](function(_0x2e8fd6){return _0x1aaabe(msgResponse(_0x3f96('0x1e5'),_0x3f96('0x145'),JSON[_0x3f96('0x4e')](_0x2e8fd6)));});}}else{return _0x1aaabe(msgResponse(_0x3f96('0x1df'),_0x3f96('0x145'),_0x3f96('0x1e1')));}});};};Dialer[_0x3f96('0x1c')][_0x3f96('0x1d6')]=function(_0x1e83ac){var _0x544104=this;return function(){var _0x12208c=0x0;var _0x190ec4=Math[_0x3f96('0x1ca')](_0x1e83ac[_0x3f96('0x1e6')]*0x3e8);if(_0x190ec4>0x0){_0x190ec4=_0x190ec4<0x64?0x64:_0x190ec4;loggerPredictive[_0x3f96('0x86')](_0x1e83ac[_0x3f96('0x44')],_0x3f96('0x1e7'),_0x190ec4,_0x3f96('0x4f'));_0x1e83ac[_0x3f96('0x96')]=setInterval(function(){_0x544104[_0x3f96('0x96')](_0x1e83ac);loggerPredictiveCalls[_0x3f96('0x86')](_0x3f96('0x1e8'),_0x12208c+=0x1);},_0x190ec4);}else{loggerPredictive[_0x3f96('0x86')](_0x1e83ac[_0x3f96('0x44')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x3f96('0x1c')]['checkContactBlack']=function(_0x5b2ed7,_0x33c109){var _0x364588=this;return function(_0x3471b8){if(_[_0x3f96('0x4a')](_0x3471b8)){if(_['isNil'](_0x33c109[_0x3f96('0xd7')])||!_0x33c109[_0x3f96('0x1e9')]){if(_0x5b2ed7[_0x3f96('0x157')]===_0x3f96('0x1ea')){_0x5b2ed7[_0x3f96('0x12c')]=_[_0x3f96('0x41')](_0x5b2ed7['queueStatusComplete'])?!![]:_0x5b2ed7[_0x3f96('0x12c')];var _0x2d6f73=uuid['v4']();_0x364588['actions'][_0x2d6f73]=new Action(_0x5b2ed7,_0x33c109,_0x2d6f73);loggerBooked[_0x3f96('0x86')](_0x3f96('0x1eb'),_0x2d6f73,_0x3f96('0x1ec'),JSON[_0x3f96('0x4e')](_0x5b2ed7[_0x3f96('0x12c')]),_0x3f96('0x1ed'),_0x5b2ed7[_0x3f96('0x44')]);if(_0x5b2ed7[_0x3f96('0x12c')]){_0x5b2ed7[_0x3f96('0x12c')]=![];_0x364588[_0x3f96('0x128')][_0x364588[_0x3f96('0x28')][_0x2d6f73][_0x3f96('0xb7')]]=[];ami['Action']({'actionid':_0x2d6f73,'action':'queuestatus','queue':_0x5b2ed7[_0x3f96('0x44')]})[_0x3f96('0xbd')](function(){_0x364588[_0x3f96('0xb6')](_0x5b2ed7);_0x364588['rescheduleContact']({'active':![],'ContactId':_0x364588[_0x3f96('0x28')][_0x2d6f73][_0x3f96('0x105')],'ListId':_0x364588['actions'][_0x2d6f73][_0x3f96('0xd6')],'VoiceQueueId':_0x364588['actions'][_0x2d6f73][_0x3f96('0xff')]||undefined,'CampaignId':_0x364588[_0x3f96('0x28')][_0x2d6f73]['CampaignId']||undefined})[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x1ee')));delete _0x364588[_0x3f96('0x28')][_0x2d6f73];});}else{loggerBooked[_0x3f96('0x86')](_0x3f96('0x1ef'),JSON[_0x3f96('0x4e')](_0x5b2ed7['queueStatusComplete']),'Queue:\x20',_0x5b2ed7[_0x3f96('0x44')]);_0x364588[_0x3f96('0xb6')](_0x5b2ed7);_0x364588[_0x3f96('0xc5')]({'active':![],'ContactId':_0x364588[_0x3f96('0x28')][_0x2d6f73][_0x3f96('0x105')],'ListId':_0x364588[_0x3f96('0x28')][_0x2d6f73][_0x3f96('0xd6')],'VoiceQueueId':_0x364588['actions'][_0x2d6f73][_0x3f96('0xff')]||undefined,'CampaignId':_0x364588[_0x3f96('0x28')][_0x2d6f73][_0x3f96('0xd8')]||undefined})[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x1ee')));delete _0x364588[_0x3f96('0x28')][_0x2d6f73];}}else{return _0x364588[_0x3f96('0x1f0')](_0x5b2ed7,_0x33c109);}}else{if(getDiff(_0x33c109['scheduledat'])<_0x5b2ed7['dialRecallMeTimeout']*0x3c){if(_0x33c109[_0x3f96('0x1f1')]&&!_0x33c109[_0x3f96('0x1f1')][_0x3f96('0x1f2')]){_0x364588[_0x3f96('0x21')][_0x3f96('0x12e')](_0x33c109['id'])[_0x3f96('0x1f')](function(){_0x364588[_0x3f96('0xb6')](_0x5b2ed7);});}else{_0x364588[_0x3f96('0xc7')]({'active':![]},_0x33c109['id'],0x1)[_0x3f96('0x1f')](function(){_0x364588[_0x3f96('0xb6')](_0x5b2ed7);});}}else{_0x5b2ed7['outboundReCallsDay']+=0x1;_0x364588[_0x3f96('0xb6')](_0x5b2ed7);if(_0x5b2ed7[_0x3f96('0x1f3')]){_0x364588[_0x3f96('0xc5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x33c109['ContactId'],'ListId':_0x33c109[_0x3f96('0xd6')],'VoiceQueueId':_0x33c109['VoiceQueueId']||undefined,'CampaignId':_0x33c109['CampaignId']||undefined})[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x1f4')));_0x364588[_0x3f96('0xce')](createObjHistory(_0x5b2ed7,_0x33c109,_0x3f96('0x1f5'),0x17,_0x3f96('0x1f6')))[_0x3f96('0xbd')](loggerCatch(_0x3f96('0x1f7')));}else{_0x364588[_0x3f96('0xdd')](createObjHistory(_0x5b2ed7,_0x33c109,_0x3f96('0x1f8'),0x16,_0x3f96('0x1f9')),_0x3f96('0x1fa'),'[Originate][HistoryRecallClose]');}}}}else{_0x5b2ed7[_0x3f96('0x66')]+=0x1;_0x364588[_0x3f96('0xdd')](createObjHistory(_0x5b2ed7,_0x33c109,'BLACKLIST',0xd,'Blacklist'),_0x3f96('0x1fb'),_0x3f96('0x1fc'));throw _0x3f96('0x1fd');}};};Dialer['prototype']['handleIvr']=function(_0xd557bc){var _0x3840d6=this;var _0x2b9f54=_0xd557bc[_0x3f96('0x1fe')]-_0xd557bc['originated']-_0xd557bc[_0x3f96('0x1ff')];emitCampaignSummary(_0xd557bc);if(_0x2b9f54>0x0){if(_0x2b9f54>this[_0x3f96('0x26')]){_0x2b9f54=this[_0x3f96('0x26')];}_0xd557bc[_0x3f96('0x1ff')]+=_0x2b9f54;this[_0x3f96('0xcb')](_0xd557bc['id'],_0x2b9f54,_0xd557bc[_0x3f96('0x200')])[_0x3f96('0xbc')](function(_0x5242a7){_0xd557bc['temp']-=_0x2b9f54;_0xd557bc['temp']=_0xd557bc[_0x3f96('0x1ff')]>0x0?_0xd557bc[_0x3f96('0x1ff')]:0x0;if(!checkContactEmpty(_0x5242a7)){_0xd557bc[_0x3f96('0x42')]=_0x3f96('0xa4');logger['info'](_0x3f96('0x201')+_0xd557bc[_0x3f96('0x44')]);}else{_0xd557bc[_0x3f96('0x9d')]+=_0x5242a7[_0x3f96('0x9c')];_0xd557bc[_0x3f96('0x42')]=_0x3f96('0x202');for(var _0x590261=0x0;_0x590261<_0x5242a7['length'];_0x590261+=0x1){_0xd557bc[_0x3f96('0x203')]+=0x1;if(_[_0x3f96('0xb1')](_0x5242a7[_0x590261])||_[_0x3f96('0xb1')](_0x5242a7[_0x590261][_0x3f96('0x184')])||_['isNil'](_0x5242a7[_0x590261][_0x3f96('0x184')][_0x3f96('0x16c')])){_0x3840d6[_0x3f96('0xd2')](_0x3f96('0x204'),_0xd557bc,_0x5242a7[_0x590261]);}else{_0x3840d6[_0x3f96('0xc1')](_[_0x3f96('0xd5')](_0x5242a7[_0x590261],[_0x3f96('0xd8'),_0x3f96('0x205')]))[_0x3f96('0xbc')](_0x3840d6['checkContactBlack'](_0xd557bc,_0x5242a7[_0x590261]))[_0x3f96('0xbd')](_0x3840d6['loggerHandler'](_0x3f96('0x206'),_0xd557bc));}}}})[_0x3f96('0xbd')](loggerGetContactDialer(_0x3f96('0x207'),_0xd557bc,_0x2b9f54));}};Dialer[_0x3f96('0x1c')][_0x3f96('0x159')]=function(_0x1a0df1,_0x52f9b){var _0x506324=this;var _0x44ebc1=[];var _0x3f3a44=_0x52f9b>=0x1?_0x52f9b:0x1;if(_0x1a0df1[_0x3f96('0x157')]===_0x3f96('0x1ea')){_0x3f3a44=0x1;}var _0x579d26=Math[_0x3f96('0x1ca')](_0x1a0df1['available']*_0x3f3a44)-_0x1a0df1['originated']-_0x1a0df1['temp'];emitVoiceQueueSummary(_0x1a0df1);if(_0x1a0df1[_0x3f96('0x208')]>0x0){var _0x2ab6b0=_0x1a0df1[_0x3f96('0x208')]-_0x1a0df1[_0x3f96('0x9d')]-_0x1a0df1['talking']-_0x1a0df1[_0x3f96('0x1ff')]-_0x1a0df1[_0x3f96('0x58')];if(_0x579d26>_0x2ab6b0){_0x579d26=_0x2ab6b0;}}if(_0x579d26>0x0){if(_0x1a0df1[_0x3f96('0x157')]===_0x3f96('0x1ea')){_0x579d26=0x1;}if(_0x579d26>this[_0x3f96('0x26')]){_0x579d26=this['maxNumberOriginate'];}_0x1a0df1[_0x3f96('0x1ff')]+=_0x579d26;for(var _0x413546 in this['agents']){if(typeof this['agents'][_0x413546]!==_0x3f96('0x9e')){if(this['agents'][_0x413546][_0x3f96('0xe6')]===_0x3f96('0x209')&&this[_0x3f96('0x24')][_0x413546][_0x3f96('0xb3')]===_0x3f96('0xdb')){_0x44ebc1['push'](this[_0x3f96('0x24')][_0x413546]['id']);}}}this[_0x3f96('0xc9')](_0x1a0df1['id'],_0x44ebc1,_0x579d26,_0x1a0df1[_0x3f96('0x200')])[_0x3f96('0xbc')](function(_0x32c9ca){_0x1a0df1['temp']-=_0x579d26;_0x1a0df1['temp']=_0x1a0df1[_0x3f96('0x1ff')]>0x0?_0x1a0df1[_0x3f96('0x1ff')]:0x0;if(!checkContactEmpty(_0x32c9ca)){_0x506324[_0x3f96('0xba')](_0x1a0df1)['then'](sendMessageReschedule(_0x1a0df1))[_0x3f96('0xbd')](loggerCatch(_0x3f96('0xbe')));}else{_0x1a0df1[_0x3f96('0x9d')]+=_0x32c9ca[_0x3f96('0x9c')];_0x1a0df1[_0x3f96('0x42')]=_0x1a0df1['dialMethod']==='booked'?_0x3f96('0x173'):'RUNNING';for(var _0x5f2005=0x0;_0x5f2005<_0x32c9ca[_0x3f96('0x9c')];_0x5f2005+=0x1){if(_[_0x3f96('0xb1')](_0x32c9ca[_0x5f2005])||_[_0x3f96('0xb1')](_0x32c9ca[_0x5f2005]['Contact'])||_[_0x3f96('0xb1')](_0x32c9ca[_0x5f2005][_0x3f96('0x184')]['phone'])){_0x506324['emptyContact'](_0x3f96('0x204'),_0x1a0df1,_0x32c9ca[_0x5f2005]);}else{_0x506324[_0x3f96('0xbf')](_[_0x3f96('0xd5')](_0x32c9ca[_0x5f2005],[_0x3f96('0xff'),_0x3f96('0x205')]))[_0x3f96('0xbc')](_0x506324[_0x3f96('0x20a')](_0x1a0df1,_0x32c9ca[_0x5f2005]))[_0x3f96('0xbd')](_0x506324['loggerHandler'](_0x3f96('0x204'),_0x1a0df1));}}}})[_0x3f96('0xbd')](loggerGetContactDialer(_0x3f96('0x20b'),_0x1a0df1,_0x579d26));}};Dialer[_0x3f96('0x1c')][_0x3f96('0x96')]=function(_0x33324c){if(_0x33324c['dialLimitQueue']>0x0){var _0x48eddd=_0x33324c[_0x3f96('0x208')]-_0x33324c[_0x3f96('0x9d')]-_0x33324c[_0x3f96('0x5c')];if(_0x48eddd>0x0){this[_0x3f96('0x20c')](_0x33324c);}else{loggerPredictiveCalls[_0x3f96('0x86')](_0x3f96('0x20d'));}}else{this[_0x3f96('0x20c')](_0x33324c);}};Dialer[_0x3f96('0x1c')][_0x3f96('0x20c')]=function(_0x22692f){var _0x15cc9c=this;var _0x5e60fd=[];_0x22692f['originated']+=0x1;for(var _0x5b88c8 in this['agents']){if(typeof this['agents'][_0x5b88c8]!==_0x3f96('0x9e')){if(this[_0x3f96('0x24')][_0x5b88c8][_0x3f96('0xe6')]===_0x3f96('0x209')&&this['agents'][_0x5b88c8]['status']===_0x3f96('0xdb')){_0x5e60fd['push'](this[_0x3f96('0x24')][_0x5b88c8]['id']);}}}this[_0x3f96('0xc9')](_0x22692f['id'],_0x5e60fd,0x1,_0x22692f['dialOrderByScheduledAt'])[_0x3f96('0xbc')](function(_0x3f29d4){if(!checkContactEmpty(_0x3f29d4)){checkContactLowerLimitOriginate(_0x22692f,0x1,0x0);_0x15cc9c[_0x3f96('0xba')](_0x22692f)[_0x3f96('0xbc')](sendMessageReschedule(_0x22692f))[_0x3f96('0xbd')](loggerCatch(_0x3f96('0xbe')));}else{_0x22692f[_0x3f96('0x42')]=_0x3f96('0x202');if(_[_0x3f96('0xb1')](_0x3f29d4[0x0])||_[_0x3f96('0xb1')](_0x3f29d4[0x0]['Contact'])||_[_0x3f96('0xb1')](_0x3f29d4[0x0][_0x3f96('0x184')]['phone'])){_0x15cc9c['emptyContact'](_0x3f96('0x204'),_0x22692f,_0x3f29d4[0x0]);}else{_0x15cc9c[_0x3f96('0xbf')](_['pick'](_0x3f29d4[0x0],[_0x3f96('0xff'),_0x3f96('0x205')]))[_0x3f96('0xbc')](_0x15cc9c[_0x3f96('0x20a')](_0x22692f,_0x3f29d4[0x0]))[_0x3f96('0xbd')](_0x15cc9c[_0x3f96('0xd1')](_0x3f96('0x20e'),_0x22692f));}}})[_0x3f96('0xbd')](loggerGetContactDialer(_0x3f96('0x20f'),_0x22692f,0x1));emitVoiceQueueSummary(_0x22692f);};Dialer[_0x3f96('0x1c')][_0x3f96('0x1dd')]=function(_0x259257,_0x130636,_0x2ab71f,_0x55bdfb,_0x4a30d3,_0x6e153b){loggerPredictive[_0x3f96('0x86')](_0x3f96('0x210'));loggerPredictive[_0x3f96('0x86')](_0x3f96('0x211'),_0x259257);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x212'),_0x130636);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x213'),_0x2ab71f);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x214'),_0x55bdfb);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x215'),_0x4a30d3);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x94'));return new BPromise(function(_0x2b692b,_0x7e38f6){if(_0x259257<=0x0||isNaN(_0x259257)){return _0x7e38f6(msgResponse(_0x3f96('0x216'),'Error',_0x3f96('0x217')+_0x259257));}if(_0x2ab71f<=0x0||isNaN(_0x2ab71f)){return _0x7e38f6(msgResponse(_0x3f96('0x216'),_0x3f96('0x4d'),'Ts\x20=\x20'+_0x2ab71f));}if(_0x55bdfb<=0x0||isNaN(_0x55bdfb)){return _0x7e38f6(msgResponse('[abandonmentRate]','Error',_0x3f96('0x218')+_0x55bdfb));}if(_0x130636<=0x0||isNaN(_0x130636)){return _0x7e38f6(msgResponse(_0x3f96('0x216'),_0x3f96('0x4d'),'interval\x20=\x20'+_0x130636));}if(_0x4a30d3<=0x0||isNaN(_0x4a30d3)){return _0x7e38f6(msgResponse('[abandonmentRate]','Error',_0x3f96('0x219')+_0x4a30d3));}_0x6e153b=_0x6e153b||0x0;var _0x381b23=0x1/_0x2ab71f;var _0x46eb3d=0x0;var _0x556954=0x0;var _0x1a3d84=0x0;var _0x2ee91d=0x0;for(var _0x428386=0x0;_0x1a3d84<_0x4a30d3;_0x428386+=0x1){_0x556954=_0x428386/_0x130636;_0x46eb3d=(_0x55bdfb*_0x556954+_0x6e153b)/_0x381b23;_0x1a3d84=erlangb(_0x46eb3d,_0x259257);_0x2ee91d=_0x46eb3d/_0x259257*(0x1-erlangb(_0x46eb3d,_0x259257));}return _0x2b692b({'erlangCalls':_0x428386,'erlangCallToSecond':_0x130636/_0x428386,'erlangAbandonmentRate':_0x1a3d84,'erlangBusyFactor':_0x2ee91d});});};Dialer[_0x3f96('0x1c')]['busyFactor']=function(_0x3813af,_0x5b508d,_0x1e3a62,_0x46900a,_0x606a1,_0x4532ce){loggerPredictive[_0x3f96('0x86')](_0x3f96('0x21a'));loggerPredictive[_0x3f96('0x86')]('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',_0x3813af);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x212'),_0x5b508d);loggerPredictive['info'](_0x3f96('0x213'),_0x1e3a62);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',_0x46900a);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x606a1);loggerPredictive[_0x3f96('0x86')](_0x3f96('0x94'));return new BPromise(function(_0x4c5d78,_0x2c3e5f){if(_0x3813af<=0x0||isNaN(_0x3813af)){return _0x2c3e5f(msgResponse(_0x3f96('0x21b'),_0x3f96('0x4d'),_0x3f96('0x217')+_0x3813af));}if(_0x1e3a62<=0x0||isNaN(_0x1e3a62)){return _0x2c3e5f(msgResponse(_0x3f96('0x21b'),_0x3f96('0x4d'),_0x3f96('0x21c')+_0x1e3a62));}if(_0x46900a<=0x0||isNaN(_0x46900a)){return _0x2c3e5f(msgResponse(_0x3f96('0x21b'),_0x3f96('0x4d'),'p\x20=\x20'+_0x46900a));}if(_0x5b508d<=0x0||isNaN(_0x5b508d)){return _0x2c3e5f(msgResponse(_0x3f96('0x21b'),_0x3f96('0x4d'),'interval\x20=\x20'+_0x5b508d));}if(_0x606a1<=0x0||isNaN(_0x606a1)){return _0x2c3e5f(msgResponse('[busyFactor]',_0x3f96('0x4d'),_0x3f96('0x21d')+_0x606a1));}_0x4532ce=_0x4532ce||0x0;var _0x4d94ed=0x1/_0x1e3a62;var _0x6c1285=0x0;var _0x44f216=0x0;var _0x1a8303=0x0;var _0x4342ec=0x0;for(var _0x1a0911=0x0;_0x4342ec<_0x606a1;_0x1a0911+=0x1){_0x44f216=_0x1a0911/_0x5b508d;_0x6c1285=(_0x46900a*_0x44f216+_0x4532ce)/_0x4d94ed;_0x1a8303=erlangb(_0x6c1285,_0x3813af);_0x4342ec=_0x6c1285/_0x3813af*(0x1-erlangb(_0x6c1285,_0x3813af));}return _0x4c5d78({'erlangCalls':_0x1a0911,'erlangCallToSecond':_0x5b508d/_0x1a0911,'erlangAbandonmentRate':_0x1a8303,'erlangBusyFactor':_0x4342ec});});};module['exports']=Dialer; \ No newline at end of file +var _0x0076=['isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','available','loggedIn','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','ivr','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','merge','pick','ListId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','SIP/%s','unmonitored','saveInDb','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','MACHINE','Machine','countmachineretry','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','VoiceQueueId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','outboundAnswerAgiCallsDay','countglobal','countdropretry','dialGlobalMaxRetry','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','droptime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','Drop','dropreason','dialDropMaxRetry','queueCallerAbandonCreateState','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','actionid','strategy','locked','stateinterface','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Intervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','isArray','push','command','iftime\x20%s,%s','interval','content','indexOf','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','dialTimezone','[syncQueueSummary]','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','isSuccess','response','checkRetriveMax','countagentrejectretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','buildObj','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','reason\x2020\x20agentreject','outboundUnknownCallsDay','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','getDataPredictive','predictiveIntervalAvailable','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','dialPredictiveOptimization','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','busyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','length','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels'];(function(_0x45c1b7,_0x136e78){var _0x2ae433=function(_0x139954){while(--_0x139954){_0x45c1b7['push'](_0x45c1b7['shift']());}};_0x2ae433(++_0x136e78);}(_0x0076,0x1e2));var _0x6007=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x0076[_0x88cd7b];return _0x56fcc8;};'use strict';var util=require(_0x6007('0x0'));var _=require(_0x6007('0x1'));var BPromise=require('bluebird');var uuid=require(_0x6007('0x2'));var moment=require(_0x6007('0x3'));var rr=require('rr');var md5=require(_0x6007('0x4'));var Redis=require(_0x6007('0x5'));var ut=require(_0x6007('0x6'));var config=require(_0x6007('0x7'));var logger=require(_0x6007('0x8'))('dialer');var loggerBooked=require('../../../config/logger')(_0x6007('0x9'));var loggerPredictive=require(_0x6007('0x8'))(_0x6007('0xa'));var loggerPredictiveCalls=require(_0x6007('0x8'))(_0x6007('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x6007('0xc'));var ami=require('../ami');config['redis']=_[_0x6007('0xd')](config[_0x6007('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x6007('0xf'))(new Redis(config[_0x6007('0xe')]));var cmHopper=require(_0x6007('0x10'));var cmHopperHistory=require(_0x6007('0x11'));var cmHopperBlack=require(_0x6007('0x12'));var voiceQueueRt=require(_0x6007('0x13'));var Action=require(_0x6007('0x14'));var History=require(_0x6007('0x15'));var Final=require(_0x6007('0x16'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x6007('0x17'));var Hangup=require('./hangup');var ipAgi=process[_0x6007('0x18')][_0x6007('0x19')]||_0x6007('0x1a');var strategy={'rrmemory':_0x6007('0x1b'),'roundrobin':_0x6007('0x1c')};var Sequence=function(){};Sequence[_0x6007('0x1d')][_0x6007('0x1e')]=function(_0x4b5f0c){this[_0x6007('0x1f')]=this[_0x6007('0x1f')]?this[_0x6007('0x1f')][_0x6007('0x20')](_0x4b5f0c):_0x4b5f0c();};function Dialer(_0x25050c,_0x44a8fe){this[_0x6007('0x21')]=new Sequence();this[_0x6007('0x22')]=_0x44a8fe;this[_0x6007('0x23')]=_0x25050c[_0x6007('0x23')];this[_0x6007('0x24')]=_0x25050c[_0x6007('0x24')];this['agents']=_0x25050c[_0x6007('0x25')];this['trunks']=_0x25050c[_0x6007('0x26')];this[_0x6007('0x27')]=config[_0x6007('0x27')]||0x2;this[_0x6007('0x28')]={};this['actions']={};this['contactsId']={};this[_0x6007('0x29')]={};this[_0x6007('0x2a')]={};this[_0x6007('0x2b')]={};this[_0x6007('0x2c')]={};this[_0x6007('0x2d')]={};this[_0x6007('0x2e')]={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0x6007('0x2f')][_0x6007('0x30')](this));ami['on'](_0x6007('0x31'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x6007('0x32'),this[_0x6007('0x33')]['bind'](this));ami['on'](_0x6007('0x34'),this[_0x6007('0x35')][_0x6007('0x30')](this));ami['on'](_0x6007('0x36'),this[_0x6007('0xc')][_0x6007('0x30')](this));ami['on'](_0x6007('0x37'),this['syncHangup'][_0x6007('0x30')](this));ami['on'](_0x6007('0x38'),this[_0x6007('0x39')][_0x6007('0x30')](this));ami['on'](_0x6007('0x3a'),this['syncVarSet'][_0x6007('0x30')](this));ami['on'](_0x6007('0x3b'),this[_0x6007('0x3c')][_0x6007('0x30')](this));ami['on'](_0x6007('0x3d'),this[_0x6007('0x3e')]['bind'](this));this['loopCampaigns']();this[_0x6007('0x3f')]();}function isNotNull(_0x1c5f53){return _0x1c5f53!==null&&!_[_0x6007('0x40')](_0x1c5f53);}function checkIsLoggedIn(_0x579b94,_0x47776a){return function(){if(_0x47776a<=0x0){_0x579b94[_0x6007('0x41')]=_0x6007('0x42');throw _0x579b94['name']+_0x6007('0x43');}};}function isActive(_0x4b8fbc){return _0x4b8fbc;}function checkIsActive(_0x28e3f8,_0x4c4219){return function(){if(!isActive(_0x4c4219)){_0x28e3f8['message']='NOT_ACTIVE';throw _0x28e3f8[_0x6007('0x44')]+_0x6007('0x45');}};}function checkInterval(_0x33bea0){return function(){if(!isNotNull(_0x33bea0[_0x6007('0x46')])){_0x33bea0[_0x6007('0x41')]=_0x6007('0x47');throw _0x33bea0[_0x6007('0x44')]+_0x6007('0x48');}if(!isNotNull(_0x33bea0[_0x6007('0x46')]['Intervals'])){_0x33bea0[_0x6007('0x41')]=_0x6007('0x47');throw _0x33bea0[_0x6007('0x44')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x33bea0[_0x6007('0x46')]['Intervals']))){_0x33bea0[_0x6007('0x41')]=_0x6007('0x47');throw _0x33bea0[_0x6007('0x44')]+_0x6007('0x48');}};}function msgResponse(_0x383644,_0x53a1b5,_0x3cb20a){return{'action':_0x383644,'response':_0x53a1b5,'message':_0x3cb20a,'stack':_0x3cb20a};}function myreject(_0x5a18f9){return function(_0x3d2220){return _0x5a18f9(msgResponse(_0x6007('0x49'),_0x6007('0x4a'),JSON[_0x6007('0x4b')](_0x3d2220)));};}function getSeconds(_0x343e7e,_0x113d4a){var _0xc36763=moment(_0x343e7e)[_0x6007('0x4c')](0x0);var _0x3a7997=moment(_0x113d4a)[_0x6007('0x4c')](0x0);return _0xc36763[_0x6007('0x4d')](_0x3a7997,_0x6007('0x4e'));}function emit(_0x542e88,_0x472748,_0x56f399){io['to'](_0x542e88)[_0x6007('0x4f')](_0x472748,_0x56f399);}function emitVoiceQueueSummary(_0x2aef9d){if(_0x2aef9d[_0x6007('0x50')]===_0x6007('0x51')){var _0x4a8491={'id':_0x2aef9d['id'],'name':_0x2aef9d[_0x6007('0x44')],'strategy':_0x2aef9d['strategy'],'answered':_0x2aef9d['answered'],'available':_0x2aef9d[_0x6007('0x52')],'loggedIn':_0x2aef9d[_0x6007('0x53')],'pTalking':_0x2aef9d['pTalking'],'sumBillable':_0x2aef9d['sumBillable'],'sumDuration':_0x2aef9d['sumDuration'],'sumHoldTime':_0x2aef9d[_0x6007('0x54')]||0x0,'talking':_0x2aef9d[_0x6007('0x55')],'total':_0x2aef9d[_0x6007('0x56')],'type':_0x2aef9d[_0x6007('0x50')],'unmanaged':_0x2aef9d[_0x6007('0x57')],'abandoned':_0x2aef9d[_0x6007('0x58')],'waiting':_0x2aef9d[_0x6007('0x59')],'loggedInDb':_0x2aef9d[_0x6007('0x5a')],'dialActive':_0x2aef9d[_0x6007('0x5b')],'dialMethod':_0x2aef9d[_0x6007('0x5c')],'dialOriginateCallerIdName':_0x2aef9d[_0x6007('0x5d')],'dialOriginateCallerIdNumber':_0x2aef9d['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2aef9d[_0x6007('0x5e')],'dialPrefix':_0x2aef9d[_0x6007('0x5f')],'outboundAnswerAgiCallsDay':_0x2aef9d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2aef9d[_0x6007('0x60')],'outboundBlacklistCallsDay':_0x2aef9d[_0x6007('0x61')],'outboundBusyCallsDay':_0x2aef9d[_0x6007('0x62')],'outboundCongestionCallsDay':_0x2aef9d[_0x6007('0x63')],'outboundDropCallsDayACS':_0x2aef9d[_0x6007('0x64')],'outboundDropCallsDayCallersExit':_0x2aef9d['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2aef9d[_0x6007('0x65')],'outboundNoAnswerCallsDay':_0x2aef9d['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x2aef9d[_0x6007('0x66')],'outboundOriginateFailureCallsDay':_0x2aef9d[_0x6007('0x67')],'outboundReCallsDay':_0x2aef9d[_0x6007('0x68')],'outboundRejectCallsDay':_0x2aef9d[_0x6007('0x69')],'outboundUnknownCallsDay':_0x2aef9d['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x2aef9d[_0x6007('0x6a')],'predictiveIntervalAvgHoldtime':_0x2aef9d[_0x6007('0x6b')],'predictiveIntervalAvgTalktime':_0x2aef9d['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x2aef9d[_0x6007('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x2aef9d['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x2aef9d[_0x6007('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x2aef9d[_0x6007('0x6e')],'predictiveIntervalHitRate':_0x2aef9d[_0x6007('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x2aef9d['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2aef9d['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x2aef9d['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x2aef9d[_0x6007('0x70')],'message':_0x2aef9d[_0x6007('0x41')],'originated':_0x2aef9d[_0x6007('0x71')],'erlangCalls':_0x2aef9d[_0x6007('0x72')],'erlangCallToSecond':_0x2aef9d[_0x6007('0x73')],'erlangAbandonmentRate':_0x2aef9d[_0x6007('0x74')],'erlangBusyFactor':_0x2aef9d[_0x6007('0x75')],'startPredictive':_0x2aef9d['startPredictive'],'startProgressive':_0x2aef9d[_0x6007('0x2c')]};if(_0x2aef9d['Trunk']){_0x4a8491[_0x6007('0x76')]={'id':_0x2aef9d['Trunk']['id'],'name':_0x2aef9d[_0x6007('0x76')][_0x6007('0x44')],'active':_0x2aef9d[_0x6007('0x76')][_0x6007('0x77')],'callerid':_0x2aef9d[_0x6007('0x76')][_0x6007('0x78')]};}if(_0x2aef9d[_0x6007('0x46')]){_0x4a8491[_0x6007('0x46')]={'id':_0x2aef9d[_0x6007('0x46')]['id'],'name':_0x2aef9d[_0x6007('0x46')][_0x6007('0x44')]};}var _0x793eb=md5(JSON[_0x6007('0x4b')](_0x4a8491));if(_0x2aef9d['md5']!==_0x793eb){_0x2aef9d['md5']=_0x793eb;emit(util[_0x6007('0x79')](_0x6007('0x7a'),_0x4a8491[_0x6007('0x44')]),_0x6007('0x7b'),_0x4a8491);}}}function emitCampaignSummary(_0x61ce1a){if(_0x61ce1a[_0x6007('0x50')]==='ivr'){emit(util[_0x6007('0x79')](_0x6007('0x7c'),_0x61ce1a['name']),_0x6007('0x7d'),_0x61ce1a);}}function checkGetDataPredictive(_0x3d8ace){if(isNotNull(_0x3d8ace)&&!_[_0x6007('0x7e')](_0x3d8ace)){loggerPredictive[_0x6007('0x7f')](_0x6007('0x80'));loggerPredictive[_0x6007('0x7f')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3d8ace[_0x6007('0x70')]);loggerPredictive['info'](_0x6007('0x81'),_0x3d8ace[_0x6007('0x6a')]);loggerPredictive[_0x6007('0x7f')](_0x6007('0x82'),_0x3d8ace['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x6007('0x83'),_0x3d8ace[_0x6007('0x6c')]);loggerPredictive[_0x6007('0x7f')](_0x6007('0x84'),_0x3d8ace[_0x6007('0x6b')]);loggerPredictive[_0x6007('0x7f')](_0x6007('0x85'),_0x3d8ace[_0x6007('0x86')]);loggerPredictive[_0x6007('0x7f')](_0x6007('0x87'));if(_0x3d8ace['predictiveIntervalTotalCalls']>0x0){if(!_[_0x6007('0x40')](_0x3d8ace[_0x6007('0x86')])&&_0x3d8ace[_0x6007('0x86')]>0x0){return!![];}loggerPredictive[_0x6007('0x7f')](_0x6007('0x88'));if(!_[_0x6007('0x40')](_0x3d8ace[_0x6007('0x6b')])&&_0x3d8ace[_0x6007('0x6b')]>0x0){return!![];}loggerPredictive[_0x6007('0x7f')](_0x6007('0x89'));}else{loggerPredictive[_0x6007('0x7f')](_0x6007('0x8a'));}}else{loggerPredictive[_0x6007('0x7f')](_0x6007('0x8b'));}return![];}function mergeDataErlangB(_0x477f5b){return function(_0x175445){loggerPredictive[_0x6007('0x7f')](_0x6007('0x8c'));loggerPredictive[_0x6007('0x7f')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x175445[_0x6007('0x72')]);loggerPredictive[_0x6007('0x7f')](_0x6007('0x8d'),_0x175445[_0x6007('0x73')]);loggerPredictive[_0x6007('0x7f')](_0x6007('0x8e'),_0x175445[_0x6007('0x74')]);loggerPredictive['info'](_0x6007('0x8f'),_0x175445['erlangBusyFactor']);loggerPredictive[_0x6007('0x7f')](_0x6007('0x8e'),_0x175445[_0x6007('0x74')]);loggerPredictive[_0x6007('0x7f')](_0x6007('0x87'));_['merge'](_0x477f5b,_0x175445);};}function getDiff(_0x1f1db7){var _0x51d693=moment()[_0x6007('0x4c')](0x0);var _0x5a54a1=moment(_0x1f1db7)[_0x6007('0x4c')](0x0);return _0x51d693['diff'](_0x5a54a1,'seconds');}function ifInterval(_0x43cbe3,_0x5cb01f){if(_[_0x6007('0x40')](_0x5cb01f)){return![];}return getDiff(_0x5cb01f)<_0x43cbe3*0x3c;}function freeVariablesPredictive(_0x3998bc){if(isNotNull(_0x3998bc)){if(!_[_0x6007('0x40')](_0x3998bc[_0x6007('0x2c')])){_0x3998bc['startProgressive']=undefined;loggerPredictive['info'](_0x3998bc[_0x6007('0x44')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x6007('0x40')](_0x3998bc[_0x6007('0x2b')])){_0x3998bc['startPredictive']=undefined;loggerPredictive[_0x6007('0x7f')](_0x3998bc[_0x6007('0x44')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x6007('0x40')](_0x3998bc['handlePredictive'])){clearInterval(_0x3998bc[_0x6007('0x90')]);_0x3998bc['handlePredictive']=undefined;loggerPredictive[_0x6007('0x7f')](_0x3998bc[_0x6007('0x44')],_0x6007('0x91'));}}}function erlangb(_0x20161d,_0x2e6baf){if(_0x2e6baf===0x0){return 0x0;}var _0x1b4a24=0x1;for(var _0x2a7670=0x1;_0x2a7670<=_0x2e6baf;_0x2a7670+=0x1){_0x1b4a24=0x1+_0x1b4a24*_0x2a7670/_0x20161d;}return 0x1/_0x1b4a24;}function isVoiceQueueOutbound(_0x7030ca){return _0x7030ca===_0x6007('0x51');}function isNotPreview(_0x565a39){return _0x565a39!==_0x6007('0x22');}function isCampaignIvr(_0x3f8316){return _0x3f8316==='ivr';}function getCallerId(_0x30a6c2,_0x4014ab,_0x20e527){if(!_['isUndefined'](_0x20e527)&&typeof _0x20e527===_0x6007('0x92')&&!_[_0x6007('0x7e')](_0x20e527)){if(!_['isUndefined'](_0x4014ab)&&typeof _0x4014ab===_0x6007('0x92')&&!_['isEmpty'](_0x4014ab)){return util[_0x6007('0x79')](_0x6007('0x93'),_0x4014ab,_0x20e527);}return util[_0x6007('0x79')](_0x6007('0x93'),_0x20e527,_0x20e527);}if(!_[_0x6007('0x40')](_0x30a6c2)&&typeof _0x30a6c2===_0x6007('0x92')&&!_[_0x6007('0x7e')](_0x30a6c2)){return _0x30a6c2;}return _0x6007('0x94');}function loggerCatchQueueSummary(_0x8cafbb,_0x295bc1){return function(_0x3c3cda){freeVariablesPredictive(_0x295bc1);emitVoiceQueueSummary(_0x295bc1);emitCampaignSummary(_0x295bc1);loggerSyncQueueSummary[_0x6007('0x95')](_0x8cafbb,util[_0x6007('0x96')](_0x3c3cda,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x12bd99,_0x12912a){return function(_0x4c1c3a){loggerPredictive[_0x6007('0x95')](_0x12912a[_0x6007('0x44')],_0x12bd99);loggerPredictive[_0x6007('0x95')](_0x4c1c3a[_0x6007('0x97')]);freeVariablesPredictive(_0x12912a);};}function loggerCatch(_0x5bc7e7){return function(_0x3dbd2a){logger[_0x6007('0x95')](_0x5bc7e7,util[_0x6007('0x96')](_0x3dbd2a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x34138a){return _0x34138a&&!_[_0x6007('0x40')](_0x34138a)&&_0x34138a['length']>0x0;}function decremetOriginate(_0x1371db){if(!_[_0x6007('0x40')](_0x1371db)&&_0x1371db!==null){if(typeof _0x1371db[_0x6007('0x71')]!==_0x6007('0x98')){if(_0x1371db[_0x6007('0x71')]>0x0){_0x1371db[_0x6007('0x71')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x6007('0x95')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x3493e0,_0x2b61f6,_0xd63d6f){if(_0x2b61f6>_0xd63d6f){for(var _0x4fe7c6=0x0;_0x4fe7c6<_0x2b61f6-_0xd63d6f;_0x4fe7c6+=0x1){decremetOriginate(_0x3493e0);}}}function loggerGetContactDialer(_0x368657,_0x4d79b5,_0x2aa686){return function(_0xfef56b){checkContactLowerLimitOriginate(_0x4d79b5,_0x2aa686,0x0);logger[_0x6007('0x95')](_0x368657,util['inspect'](_0xfef56b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x788e60){return function(_0x4b4a95){if(isNotNull(_0x4b4a95)&&isNotNull(_0x4b4a95[0x0])){if(_0x4b4a95[0x0]['contactsRescheduled']>0x0){_0x788e60[_0x6007('0x41')]=_0x6007('0x99');logger[_0x6007('0x7f')](_0x6007('0x9a')+_0x788e60[_0x6007('0x44')],_0x4b4a95[0x0][_0x6007('0x9b')],_0x6007('0x9c'));}else{_0x788e60[_0x6007('0x41')]=_0x6007('0x9d');logger[_0x6007('0x7f')](_0x6007('0x9e')+_0x788e60[_0x6007('0x44')]);}}};}function notSendMessagesQueue(_0x28627d){if(_0x28627d['sendMessageOneNotActive']){freeVariablesPredictive(_0x28627d);if(_0x28627d[_0x6007('0x71')]===0x0&&_0x28627d[_0x6007('0x55')]===0x0&&_0x28627d['waiting']===0x0&&(_0x28627d['pTalking']||0x0)===0x0){_0x28627d[_0x6007('0x9f')]=![];_0x28627d['available']=0x0;_0x28627d[_0x6007('0x41')]=_0x6007('0xa0');loggerSyncQueueSummary[_0x6007('0x95')](_0x6007('0xa1'),_0x28627d[_0x6007('0x44')],_0x6007('0xa2'));}else{_0x28627d[_0x6007('0x41')]=_0x6007('0xa3');loggerSyncQueueSummary[_0x6007('0x95')](_0x6007('0xa1'),_0x28627d['name'],_0x6007('0xa4'));}emitVoiceQueueSummary(_0x28627d);}}function notSendMessagesCampaign(_0x59bc09){if(_0x59bc09['sendMessageOneNotActive']){if(_0x59bc09[_0x6007('0x71')]===0x0){_0x59bc09['sendMessageOneNotActive']=![];_0x59bc09[_0x6007('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x59bc09[_0x6007('0x44')],_0x6007('0xa2'));}else{_0x59bc09[_0x6007('0x41')]=_0x6007('0xa3');loggerSyncQueueSummary[_0x6007('0x95')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x59bc09[_0x6007('0x44')],_0x6007('0xa4'));}emitCampaignSummary(_0x59bc09);}}function createObjHistory(_0x59e27a,_0x3db7fb,_0x3daf11,_0x2a4f41,_0x3947c6){_0x59e27a[_0x6007('0x41')]=_0x3daf11;var _0x45b2d1=new Action(_0x59e27a,_0x3db7fb);var _0x5771b5=new History(_0x45b2d1);_0x5771b5[_0x6007('0xa5')]=_0x2a4f41;_0x5771b5[_0x6007('0xa6')]=_0x3947c6;_0x5771b5[_0x6007('0xa7')]=_0x45b2d1[_0x6007('0xa8')];return _0x5771b5;}Dialer['prototype'][_0x6007('0x3f')]=function(){var _0x780a1b=this;setInterval(function(){_0x780a1b[_0x6007('0xa9')](_0x780a1b[_0x6007('0x29')],_0x6007('0xaa'));_0x780a1b[_0x6007('0xa9')](_0x780a1b['actions'],_0x6007('0xab'));},0x32c8);};Dialer[_0x6007('0x1d')]['clearZombieChannels']=function(_0x4e4eb6,_0x162c18){var _0x495e34=this;for(var _0x2cbf6e in _0x4e4eb6){if(typeof _0x4e4eb6[_0x2cbf6e]!==_0x6007('0x98')){this[_0x6007('0x21')][_0x6007('0x1e')](function(){if(!_[_0x6007('0xac')](_0x4e4eb6[_0x2cbf6e])){return ami[_0x6007('0xad')]({'action':_0x6007('0xae'),'channel':_0x4e4eb6[_0x2cbf6e][_0x6007('0xaf')]})[_0x6007('0xb0')](function(_0x22540e){if(_0x22540e[_0x6007('0x41')]===_0x6007('0xb1')){setTimeout(function(){if(_0x4e4eb6[_0x2cbf6e]&&_0x4e4eb6[_0x2cbf6e][_0x6007('0x50')]!==_0x6007('0xb2')){_0x495e34[_0x6007('0xb3')](_0x495e34[_0x6007('0x23')][_0x4e4eb6[_0x2cbf6e][_0x6007('0xb4')]]);logger['error'](_0x6007('0xb5'),_0x162c18,_0x2cbf6e,_0x4e4eb6[_0x2cbf6e][_0x6007('0xb4')]);delete _0x4e4eb6[_0x2cbf6e];}if(_0x4e4eb6[_0x2cbf6e]&&_0x4e4eb6[_0x2cbf6e][_0x6007('0x50')]==='ivr'){_0x495e34[_0x6007('0xb3')](_0x495e34[_0x6007('0x24')][_0x4e4eb6[_0x2cbf6e][_0x6007('0xb4')]]);logger[_0x6007('0x95')](_0x6007('0xb6'),_0x162c18,_0x2cbf6e,_0x4e4eb6[_0x2cbf6e]['queue']);delete _0x4e4eb6[_0x2cbf6e];}},0x2328);}});}});}}};Dialer[_0x6007('0x1d')]['countReScheduled']=function(_0x3542e6){return BPromise[_0x6007('0xb7')]()[_0x6007('0xb8')](cmHopper[_0x6007('0xb9')](_0x3542e6))[_0x6007('0xb0')](loggerCatch(_0x6007('0xba')));};Dialer[_0x6007('0x1d')][_0x6007('0xbb')]=function(_0x448b8b){return BPromise[_0x6007('0xb7')]()[_0x6007('0xb8')](cmHopperBlack[_0x6007('0xbb')](_0x448b8b))[_0x6007('0xb0')](loggerCatch(_0x6007('0xbc')));};Dialer[_0x6007('0x1d')][_0x6007('0xbd')]=function(_0x5c758a){return BPromise[_0x6007('0xb7')]()[_0x6007('0xb8')](cmHopperBlack[_0x6007('0xbd')](_0x5c758a))[_0x6007('0xb0')](loggerCatch(_0x6007('0xbe')));};Dialer[_0x6007('0x1d')][_0x6007('0xbf')]=function(_0x232257){return BPromise[_0x6007('0xb7')]()[_0x6007('0xb8')](cmHopperHistory[_0x6007('0xc0')](_0x232257))['catch'](loggerCatch(_0x6007('0xc1')));};Dialer[_0x6007('0x1d')]['rescheduleContact']=function(_0x5d8859){return BPromise['resolve']()[_0x6007('0xb8')](cmHopper[_0x6007('0xc2')](_0x5d8859))['catch'](loggerCatch(_0x6007('0xc3')));};Dialer[_0x6007('0x1d')][_0x6007('0xc4')]=function(_0xe37048,_0xde3da7,_0x5eb835){return BPromise[_0x6007('0xb7')]()['then'](cmHopper['unlockContact'](_0xe37048,_0xde3da7,_0x5eb835))['catch'](loggerCatch(_0x6007('0xc5')));};Dialer[_0x6007('0x1d')][_0x6007('0xc6')]=function(_0x5339f4,_0xfeaf5a,_0x3eb461,_0x5c88b3){return BPromise[_0x6007('0xb7')]()[_0x6007('0xb8')](cmHopper['getContactDialer'](_0x5339f4,_0xfeaf5a,_0x3eb461,_0x5c88b3))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype']['getContactDialerIvr']=function(_0xc264e0,_0x3d2965,_0x2a3652){return BPromise[_0x6007('0xb7')]()[_0x6007('0xb8')](cmHopper[_0x6007('0xc7')](_0xc264e0,_0x3d2965,_0x2a3652))[_0x6007('0xb0')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x6007('0x1d')][_0x6007('0xc8')]=function(_0x6e91d5){return BPromise['resolve']()[_0x6007('0xb8')](voiceQueueRt['getVoiceQueueRtPauses'](_0x6e91d5))['catch'](loggerCatch(_0x6007('0xc9')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x4fc4d2){return BPromise[_0x6007('0xb7')]()[_0x6007('0xb8')](cmHopper[_0x6007('0xca')](_0x4fc4d2))[_0x6007('0xb0')](loggerCatch(_0x6007('0xcb')));};Dialer[_0x6007('0x1d')][_0x6007('0xcc')]=function(_0xe3081d){return BPromise[_0x6007('0xb7')]()[_0x6007('0xb8')](cmHopperHistory[_0x6007('0xcc')](_0xe3081d))[_0x6007('0xb0')](loggerCatch('[createHistory]\x20'));};Dialer[_0x6007('0x1d')][_0x6007('0xb3')]=function(_0x14935e){if(!_[_0x6007('0x40')](_0x14935e)&&_0x14935e!==null){if(typeof _0x14935e[_0x6007('0x71')]!==_0x6007('0x98')){if(_0x14935e[_0x6007('0x71')]>0x0){_0x14935e['originated']-=0x1;}else{logger[_0x6007('0x95')](_0x6007('0xcd'));}}}else{logger[_0x6007('0x95')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x6007('0x1d')][_0x6007('0xce')]=function(_0x197397,_0x2e65ae){var _0x1d894b=this;return function(_0x5811c2){_0x1d894b[_0x6007('0xb3')](_0x2e65ae);logger[_0x6007('0x95')](_0x197397,util['inspect'](_0x5811c2,{'showHidden':![],'depth':null}));};};Dialer[_0x6007('0x1d')][_0x6007('0xcf')]=function(_0x403ebb,_0x2ba1f2,_0x319b5a){var _0x133da6={'state':0x19,'statedesc':'notFound'};this[_0x6007('0xb3')](_0x2ba1f2);this['saveInDb'](_[_0x6007('0xd0')](_0x133da6,_[_0x6007('0xd1')](_0x319b5a,['ContactId',_0x6007('0xd2'),'UserId','VoiceQueueId',_0x6007('0xd3')])),_0x6007('0xd4'),_0x6007('0xd5'));logger['error'](_0x403ebb);};Dialer[_0x6007('0x1d')]['isSuccess']=function(_0x56564c){return _0x56564c===_0x6007('0xd6');};Dialer[_0x6007('0x1d')]['isTrunkReachable']=function(_0x1bdced){return!_[_0x6007('0x40')](_0x1bdced)&&_0x1bdced&&!_['isUndefined'](_0x1bdced[_0x6007('0x44')])&&!_[_0x6007('0x40')](_0x1bdced[_0x6007('0x77')])&&_0x1bdced[_0x6007('0x77')]&&(this[_0x6007('0x26')][util[_0x6007('0x79')]('SIP/%s',_0x1bdced[_0x6007('0x44')])][_0x6007('0xae')]==='reachable'||this[_0x6007('0x26')][util[_0x6007('0x79')](_0x6007('0xd7'),_0x1bdced[_0x6007('0x44')])][_0x6007('0xae')]===_0x6007('0xd8'));};Dialer[_0x6007('0x1d')][_0x6007('0xd9')]=function(_0x3a4472,_0x55b344,_0x31b7d2){this['createHistory'](_0x3a4472)[_0x6007('0xb0')](loggerCatch(_0x55b344));this[_0x6007('0xca')](_0x3a4472)['catch'](loggerCatch(_0x31b7d2));};Dialer[_0x6007('0x1d')][_0x6007('0xda')]=function(_0x1a084f){var _0x29804b=this[_0x6007('0x29')][_0x1a084f[_0x6007('0xdb')]];var _0x401698;if(!_[_0x6007('0xac')](_0x1a084f)&&!_['isNil'](_0x1a084f[_0x6007('0xdc')])&&!_[_0x6007('0xac')](_0x1a084f['variable'][_0x6007('0xdd')])&&_0x1a084f[_0x6007('0xde')]===_0x6007('0xdf')&&_0x29804b){if(_0x29804b['type']!==_0x6007('0xb2')&&this[_0x6007('0x23')][_0x29804b[_0x6007('0xb4')]][_0x6007('0xe0')]&&_0x1a084f[_0x6007('0xe1')]===_0x6007('0xe2')){delete this[_0x6007('0x29')][_0x1a084f[_0x6007('0xdb')]];this['updateOriginated'](this[_0x6007('0x23')][_0x29804b['queue']]);this[_0x6007('0x23')][_0x29804b[_0x6007('0xb4')]][_0x6007('0x60')]+=0x1;this[_0x6007('0x23')][_0x29804b[_0x6007('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;_0x401698=new Hangup(_0x29804b,_0x1a084f);_0x401698[_0x6007('0xa5')]=0x12;_0x401698[_0x6007('0xa6')]=_0x6007('0xe3');_0x401698[_0x6007('0xe4')]=_0x6007('0xe5');this['saveInDb'](_0x401698,_0x6007('0xe6'),'[syncHangupInAMD]');}if(_0x29804b[_0x6007('0x50')]!==_0x6007('0xb2')&&this[_0x6007('0x23')][_0x29804b[_0x6007('0xb4')]][_0x6007('0xe0')]&&_0x1a084f[_0x6007('0xe1')]===_0x6007('0xe7')){var _0x395e6f=this;return new BPromise(function(_0x24baac,_0x2d2ad9){delete _0x395e6f[_0x6007('0x29')][_0x1a084f[_0x6007('0xdb')]];_0x395e6f[_0x6007('0xb3')](_0x395e6f[_0x6007('0x23')][_0x29804b['queue']]);_0x395e6f['voiceQueues'][_0x29804b[_0x6007('0xb4')]][_0x6007('0x60')]+=0x1;_0x395e6f['voiceQueues'][_0x29804b['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x4e5a28=_0x395e6f[_0x6007('0x23')][_0x29804b[_0x6007('0xb4')]];var _0x2e7284=new Hangup(_0x29804b,_0x1a084f);_0x2e7284['state']=0x13;_0x2e7284[_0x6007('0xa6')]=_0x6007('0xe8');_0x2e7284['membername']=_0x6007('0xe5');_0x2e7284[_0x6007('0xe9')]+=0x1;_0x2e7284['countglobal']+=0x1;_0x2e7284[_0x6007('0xea')]=!![];_0x395e6f[_0x6007('0xcc')](_0x2e7284)[_0x6007('0xb0')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2e7284[_0x6007('0xeb')]+_0x2e7284[_0x6007('0xec')]+_0x2e7284[_0x6007('0xed')]+_0x2e7284[_0x6007('0xee')]+_0x2e7284['countdropretry']+_0x2e7284[_0x6007('0xef')]+_0x2e7284[_0x6007('0xe9')]+_0x2e7284['countagentrejectretry']>=_0x4e5a28['dialGlobalMaxRetry']){_0x395e6f[_0x6007('0xf0')](_0x2e7284,_0x24baac,_0x2d2ad9,_0x6007('0xf1'));}else{if(_0x2e7284[_0x6007('0xe9')]>=_0x4e5a28[_0x6007('0xf2')]){_0x395e6f[_0x6007('0xf3')](_0x2e7284,_0x24baac,_0x2d2ad9,_0x6007('0xf4'));}else{_0x395e6f[_0x6007('0xc2')]({'active':![],'countmachineretry':_0x2e7284['countmachineretry'],'scheduledat':moment()[_0x6007('0xf5')](_0x4e5a28[_0x6007('0xf6')],_0x6007('0xf7'))['format'](_0x6007('0xf8')),'ContactId':_0x2e7284[_0x6007('0xf9')],'ListId':_0x2e7284[_0x6007('0xd2')],'VoiceQueueId':_0x2e7284[_0x6007('0xfa')]||undefined,'CampaignId':_0x2e7284[_0x6007('0xd3')]||undefined})[_0x6007('0xb0')](loggerCatch(_0x6007('0xfb')));_0x24baac({'reschedule':0x1});}}});}if(_0x29804b['type']==='ivr'&&this[_0x6007('0x24')][_0x29804b['queue']]['dialAMDActive']&&_0x1a084f['value']===_0x6007('0xe2')){delete this[_0x6007('0x29')][_0x1a084f[_0x6007('0xdb')]];this[_0x6007('0xb3')](this[_0x6007('0x24')][_0x29804b['queue']]);_0x401698=new Hangup(_0x29804b,_0x1a084f);_0x401698['state']=0x12;_0x401698[_0x6007('0xa6')]=_0x6007('0xe3');_0x401698[_0x6007('0xe4')]=_0x6007('0xe5');this[_0x6007('0xd9')](_0x401698,_0x6007('0xfc'),_0x6007('0xfd'));}if(_0x29804b['type']===_0x6007('0xb2')&&this[_0x6007('0x24')][_0x29804b['queue']][_0x6007('0xe0')]&&_0x1a084f['value']==='MACHINE'){var _0x395e6f=this;return new BPromise(function(_0x44dd6e,_0x2eb5db){delete _0x395e6f[_0x6007('0x29')][_0x1a084f[_0x6007('0xdb')]];_0x395e6f[_0x6007('0xb3')](_0x395e6f['campaigns'][_0x29804b[_0x6007('0xb4')]]);_0x395e6f[_0x6007('0x24')][_0x29804b[_0x6007('0xb4')]][_0x6007('0x60')]+=0x1;_0x395e6f[_0x6007('0x24')][_0x29804b[_0x6007('0xb4')]][_0x6007('0xfe')]+=0x1;var _0x45c86c=_0x395e6f[_0x6007('0x24')][_0x29804b[_0x6007('0xb4')]];var _0x14925d=new Hangup(_0x29804b,_0x1a084f);_0x14925d[_0x6007('0xa5')]=0x13;_0x14925d['statedesc']='Machine';_0x14925d[_0x6007('0xe4')]='AMD';_0x14925d['countmachineretry']+=0x1;_0x14925d[_0x6007('0xff')]+=0x1;_0x14925d[_0x6007('0xea')]=!![];_0x395e6f[_0x6007('0xcc')](_0x14925d)[_0x6007('0xb0')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x14925d[_0x6007('0xeb')]+_0x14925d[_0x6007('0xec')]+_0x14925d['countnoanswerretry']+_0x14925d[_0x6007('0xee')]+_0x14925d[_0x6007('0x100')]+_0x14925d[_0x6007('0xef')]+_0x14925d['countmachineretry']+_0x14925d['countagentrejectretry']>=_0x45c86c[_0x6007('0x101')]){_0x395e6f['stateGlobal'](_0x14925d,_0x44dd6e,_0x2eb5db,_0x6007('0xf1'));}else{if(_0x14925d[_0x6007('0xe9')]>=_0x45c86c['dialMachineMaxRetry']){_0x395e6f['createStateFinal'](_0x14925d,_0x44dd6e,_0x2eb5db,_0x6007('0xf4'));}else{_0x395e6f[_0x6007('0xc2')]({'active':![],'countmachineretry':_0x14925d[_0x6007('0xe9')],'scheduledat':moment()['add'](_0x45c86c[_0x6007('0xf6')],'minutes')[_0x6007('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14925d[_0x6007('0xf9')],'ListId':_0x14925d['ListId'],'VoiceQueueId':_0x14925d[_0x6007('0xfa')]||undefined,'CampaignId':_0x14925d[_0x6007('0xd3')]||undefined})[_0x6007('0xb0')](loggerCatch(_0x6007('0xfb')));_0x44dd6e({'reschedule':0x1});}}});}}};Dialer[_0x6007('0x1d')][_0x6007('0x102')]=function(_0x14a3be){var _0x35e3b3=this[_0x6007('0x29')][_0x14a3be['uniqueid']];var _0x135b29=this;var _0x102aa7;if(_0x35e3b3&&_0x35e3b3['type']===_0x6007('0xb2')){delete this[_0x6007('0x29')][_0x14a3be[_0x6007('0xdb')]];this[_0x6007('0xb3')](this[_0x6007('0x24')][_0x35e3b3[_0x6007('0xb4')]]);this[_0x6007('0x24')][_0x35e3b3[_0x6007('0xb4')]][_0x6007('0x103')]+=0x1;_0x102aa7=new Hangup(_0x35e3b3,_0x14a3be);this[_0x6007('0xcc')](_0x102aa7)[_0x6007('0xb0')](loggerCatch(_0x6007('0x104')));this[_0x6007('0xca')](_0x102aa7)[_0x6007('0xb0')](loggerCatch('[syncHangupIvr]'));}if(_0x35e3b3&&_0x35e3b3[_0x6007('0x50')]!==_0x6007('0xb2')&&isNotNull(this['voiceQueues'][_0x35e3b3[_0x6007('0xb4')]]['dialQueueProject'])){delete this['uniqueId'][_0x14a3be['uniqueid']];this[_0x6007('0xb3')](this[_0x6007('0x23')][_0x35e3b3[_0x6007('0xb4')]]);this['voiceQueues'][_0x35e3b3[_0x6007('0xb4')]][_0x6007('0x60')]+=0x1;this[_0x6007('0x23')][_0x35e3b3[_0x6007('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;_0x102aa7=new Hangup(_0x35e3b3,_0x14a3be);_0x102aa7[_0x6007('0xa5')]=0x10;_0x102aa7[_0x6007('0xa6')]=_0x6007('0x105');_0x102aa7[_0x6007('0xe4')]=_0x6007('0x106');this['createHistory'](_0x102aa7)[_0x6007('0xb0')](loggerCatch(_0x6007('0x104')));this['moveContactManagedDialer'](_0x102aa7)[_0x6007('0xb0')](loggerCatch(_0x6007('0x107')));}if(_0x35e3b3&&_0x35e3b3['type']!==_0x6007('0xb2')&&!isNotNull(this[_0x6007('0x23')][_0x35e3b3[_0x6007('0xb4')]]['dialQueueProject'])){delete this[_0x6007('0x29')][_0x14a3be[_0x6007('0xdb')]];this[_0x6007('0xb3')](this[_0x6007('0x23')][_0x35e3b3[_0x6007('0xb4')]]);this[_0x6007('0x23')][_0x35e3b3[_0x6007('0xb4')]]['outboundUnknownCallsDay']+=0x1;_0x102aa7=new Hangup(_0x35e3b3,_0x14a3be);_0x102aa7[_0x6007('0xa5')]=0xc;_0x102aa7[_0x6007('0xa6')]=_0x14a3be[_0x6007('0x108')];_0x102aa7[_0x6007('0xe4')]=_0x6007('0x109');this['createHistory'](_0x102aa7)['catch'](loggerCatch(_0x6007('0x104')));this[_0x6007('0xca')](_0x102aa7)[_0x6007('0xb0')](loggerCatch(_0x6007('0x107')));}};Dialer[_0x6007('0x1d')][_0x6007('0x35')]=function(_0x2423aa){var _0x536434=this['uniqueId'][_0x2423aa[_0x6007('0xdb')]];var _0x47cbd5=this;if(this[_0x6007('0x23')][_0x2423aa[_0x6007('0xb4')]]){if(_0x536434&&_0x536434[_0x6007('0x50')]!==_0x6007('0xb2')){delete this[_0x6007('0x29')][_0x2423aa[_0x6007('0xdb')]];this[_0x6007('0x23')][_0x2423aa[_0x6007('0xb4')]][_0x6007('0x60')]+=0x1;var _0xb5aaed=new AgentComplete(_0x536434,_0x2423aa);if(_0x2423aa[_0x6007('0x10a')]===_0x6007('0x10b')){_0xb5aaed[_0x6007('0x10c')]=this[_0x6007('0x23')][_0x2423aa[_0x6007('0xb4')]][_0x6007('0x10d')]&&this[_0x6007('0x23')][_0x2423aa[_0x6007('0xb4')]][_0x6007('0x10e')]?moment()[_0x6007('0x79')](_0x6007('0xf8')):undefined;}this[_0x6007('0xcc')](_0xb5aaed)[_0x6007('0xb0')](loggerCatch(_0x6007('0x10f')));this['moveContactManagedDialer'](_0xb5aaed)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x6007('0x1d')][_0x6007('0x2f')]=function(_0x1d1e64){if(this[_0x6007('0x23')][_0x1d1e64[_0x6007('0xb4')]]){if(this[_0x6007('0x29')][_0x1d1e64[_0x6007('0xdb')]]&&this[_0x6007('0x29')][_0x1d1e64[_0x6007('0xdb')]][_0x6007('0x50')]!==_0x6007('0xb2')){this[_0x6007('0xb3')](this[_0x6007('0x23')][_0x1d1e64['queue']]);this['uniqueId'][_0x1d1e64[_0x6007('0xdb')]][_0x6007('0x110')]=moment()[_0x6007('0x79')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x6007('0x1d')]['queueCallerAbandonCreateState']=function(_0x4555ed){this['createHistory'](_0x4555ed)[_0x6007('0xb0')](loggerCatch(_0x6007('0x10f')));this['moveContactManagedDialer'](_0x4555ed)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x6007('0x1d')]['syncQueueCallerAbandon']=function(_0x5d14d9){var _0x1e3081=this[_0x6007('0x29')][_0x5d14d9[_0x6007('0xdb')]];var _0x548848=this;if(this[_0x6007('0x23')][_0x5d14d9[_0x6007('0xb4')]]){if(_0x1e3081&&_0x1e3081[_0x6007('0x50')]!==_0x6007('0xb2')){delete this[_0x6007('0x29')][_0x5d14d9[_0x6007('0xdb')]];this['updateOriginated'](this[_0x6007('0x23')][_0x5d14d9[_0x6007('0xb4')]]);_0x1e3081[_0x6007('0x111')]=moment()[_0x6007('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x12df4b=new QueueCallerAbandon(_0x1e3081,_0x5d14d9);if(getSeconds(_0x1e3081[_0x6007('0x111')],_0x1e3081['responsetime'])>=_0x1e3081[_0x6007('0x112')]){this['voiceQueues'][_0x5d14d9[_0x6007('0xb4')]][_0x6007('0x113')]+=0x1;this['voiceQueues'][_0x5d14d9[_0x6007('0xb4')]][_0x6007('0x65')]+=0x1;this[_0x6007('0x23')][_0x5d14d9['queue']][_0x6007('0x6e')]+=0x1;_0x12df4b[_0x6007('0xa5')]=0xa;_0x12df4b[_0x6007('0xa6')]=_0x6007('0x114');_0x12df4b[_0x6007('0x115')]='TIMEOUT';_0x12df4b['agiafterat']=this[_0x6007('0x23')][_0x5d14d9[_0x6007('0xb4')]][_0x6007('0x10d')]?moment()[_0x6007('0x79')](_0x6007('0xf8')):undefined;_0x12df4b['countdropretry']+=0x1;_0x12df4b['countglobal']+=0x1;if(_0x12df4b[_0x6007('0x100')]>=this[_0x6007('0x23')][_0x5d14d9[_0x6007('0xb4')]][_0x6007('0x116')]){this[_0x6007('0x117')](_0x12df4b);}else{this[_0x6007('0xc2')]({'active':![],'countdropretry':_0x12df4b[_0x6007('0x100')],'scheduledat':moment()[_0x6007('0xf5')](this[_0x6007('0x23')][_0x5d14d9[_0x6007('0xb4')]]['dialDropRetryFrequency'],_0x6007('0xf7'))[_0x6007('0x79')](_0x6007('0xf8')),'ContactId':_0x1e3081[_0x6007('0xf9')],'ListId':_0x1e3081[_0x6007('0xd2')],'VoiceQueueId':_0x1e3081[_0x6007('0xfa')]||undefined,'CampaignId':_0x1e3081[_0x6007('0xd3')]||undefined})[_0x6007('0xb0')](loggerCatch(_0x6007('0x118')));var _0x1a6d8e=new History(_0x12df4b);_0x1a6d8e[_0x6007('0xa5')]=0xa;_0x1a6d8e['statedesc']=_0x6007('0x114');_0x1a6d8e['starttime']=moment()[_0x6007('0x79')](_0x6007('0xf8'));_0x1a6d8e[_0x6007('0xa7')]=_0x1a6d8e[_0x6007('0xa8')];_0x1a6d8e['calleridname']=_0x12df4b[_0x6007('0x119')];_0x1a6d8e[_0x6007('0x11a')]=_0x12df4b[_0x6007('0x11a')];this[_0x6007('0xcc')](_0x1a6d8e)[_0x6007('0xb0')](loggerCatch(_0x6007('0x11b')));}}else{this['voiceQueues'][_0x5d14d9[_0x6007('0xb4')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x6007('0x23')][_0x5d14d9[_0x6007('0xb4')]][_0x6007('0x11c')]+=0x1;_0x12df4b[_0x6007('0xa5')]=0xb;_0x12df4b[_0x6007('0xa6')]=_0x6007('0x11d');_0x12df4b['dropreason']=_0x6007('0x11e');_0x12df4b[_0x6007('0xef')]+=0x1;_0x12df4b[_0x6007('0xff')]+=0x1;if(_0x12df4b[_0x6007('0xef')]>=this[_0x6007('0x23')][_0x5d14d9[_0x6007('0xb4')]]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x12df4b);}else{this[_0x6007('0xc2')]({'active':![],'countabandonedretry':_0x12df4b[_0x6007('0xef')],'scheduledat':moment()[_0x6007('0xf5')](this[_0x6007('0x23')][_0x5d14d9[_0x6007('0xb4')]]['dialAbandonedRetryFrequency'],'minutes')[_0x6007('0x79')](_0x6007('0xf8')),'ContactId':_0x1e3081[_0x6007('0xf9')],'ListId':_0x1e3081[_0x6007('0xd2')],'VoiceQueueId':_0x1e3081[_0x6007('0xfa')]||undefined,'CampaignId':_0x1e3081['CampaignId']||undefined})[_0x6007('0xb0')](loggerCatch(_0x6007('0x11f')));var _0x1a6d8e=new History(_0x12df4b);_0x1a6d8e[_0x6007('0xa5')]=0xb;_0x1a6d8e[_0x6007('0xa6')]=_0x6007('0x11d');_0x1a6d8e[_0x6007('0xa8')]=moment()[_0x6007('0x79')](_0x6007('0xf8'));_0x1a6d8e[_0x6007('0xa7')]=_0x1a6d8e[_0x6007('0xa8')];_0x1a6d8e['calleridname']=_0x12df4b[_0x6007('0x119')];_0x1a6d8e[_0x6007('0x11a')]=_0x12df4b[_0x6007('0x11a')];this[_0x6007('0xcc')](_0x1a6d8e)['catch'](loggerCatch(_0x6007('0x120')));}}}}};Dialer['prototype']['syncNewExten']=function(_0x3d83b0){if(this['actions'][_0x3d83b0[_0x6007('0xdb')]]){this[_0x6007('0x121')][_0x3d83b0[_0x6007('0xdb')]][_0x6007('0xaf')]=_0x3d83b0[_0x6007('0xaf')];}if(this[_0x6007('0x29')][_0x3d83b0[_0x6007('0xdb')]]){this[_0x6007('0x29')][_0x3d83b0[_0x6007('0xdb')]][_0x6007('0xaf')]=_0x3d83b0[_0x6007('0xaf')];}};Dialer[_0x6007('0x1d')]['syncQueueMember']=function(_0x5f3fc1){if(strategy[this['voiceQueues'][this['actions'][_0x5f3fc1[_0x6007('0x122')]][_0x6007('0xb4')]][_0x6007('0x123')]]===_0x6007('0x1c')){if(this[_0x6007('0x121')][_0x5f3fc1[_0x6007('0x122')]]&&_[_0x6007('0xac')](this[_0x6007('0x121')][_0x5f3fc1[_0x6007('0x122')]][_0x6007('0x124')])&&_0x5f3fc1[_0x6007('0xae')]==='1'&&_0x5f3fc1['paused']==='0'){if(this[_0x6007('0x25')][_0x5f3fc1[_0x6007('0x125')]]){if(!this[_0x6007('0x25')][_0x5f3fc1[_0x6007('0x125')]][_0x6007('0x124')]){this[_0x6007('0x25')][_0x5f3fc1[_0x6007('0x125')]][_0x6007('0x124')]=!![];this[_0x6007('0x121')][_0x5f3fc1[_0x6007('0x122')]][_0x6007('0x124')]=!![];this['actions'][_0x5f3fc1[_0x6007('0x122')]][_0x6007('0x125')]=_0x5f3fc1[_0x6007('0x125')];}}}}else if((strategy[this['voiceQueues'][this[_0x6007('0x121')][_0x5f3fc1[_0x6007('0x122')]][_0x6007('0xb4')]][_0x6007('0x123')]]||_0x6007('0x1b'))===_0x6007('0x1b')){if(this[_0x6007('0x121')][_0x5f3fc1[_0x6007('0x122')]]){if(this[_0x6007('0x25')][_0x5f3fc1[_0x6007('0x125')]]){this[_0x6007('0x121')][_0x5f3fc1['actionid']][_0x6007('0x125')]=_0x5f3fc1[_0x6007('0x125')];if(_[_0x6007('0xac')](this[_0x6007('0x2e')][this['actions'][_0x5f3fc1['actionid']][_0x6007('0xb4')]])){this['queueBooked'][this[_0x6007('0x121')][_0x5f3fc1['actionid']]['queue']]=[];}this['queueBooked'][this[_0x6007('0x121')][_0x5f3fc1[_0x6007('0x122')]]['queue']]['push'](_[_0x6007('0xd0')](_[_0x6007('0xd1')](this['actions'][_0x5f3fc1[_0x6007('0x122')]],[_0x6007('0x126'),'stateinterface']),{'status':_0x5f3fc1[_0x6007('0xae')],'paused':_0x5f3fc1[_0x6007('0x127')]}));}}}};function unlockQueueStatus(_0x20337e,_0x47d853){setTimeout(function(){if(_[_0x6007('0x40')](_0x20337e[_0x6007('0x128')])){loggerBooked[_0x6007('0x95')](_0x6007('0x129'),_0x47d853);}_0x20337e['queueStatusComplete']=!![];loggerBooked[_0x6007('0x7f')](_0x6007('0x12a'),_0x47d853,JSON[_0x6007('0x4b')](_[_0x6007('0xd1')](_0x20337e,[_0x6007('0x44'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x6007('0x1d')][_0x6007('0x3e')]=function(_0xdd5519){var _0x38dce5=this;var _0x4b5226=_0x38dce5['voiceQueues'][_0x38dce5[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]][_0x6007('0xb4')]];if(strategy[this['voiceQueues'][this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]][_0x6007('0xb4')]]['strategy']]===_0x6007('0x1c')){if(this['actions'][_0xdd5519[_0x6007('0x122')]]&&this['actions'][_0xdd5519[_0x6007('0x122')]]['stateinterface']){this[_0x6007('0x22')][_0x6007('0x12b')](this[_0x6007('0x121')][_0xdd5519['actionid']][_0x6007('0x126')],this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]][_0x6007('0x125')])['catch'](function(_0x13e400){logger[_0x6007('0x95')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x6007('0x96')](_0x13e400,{'showHidden':![],'depth':null}));})[_0x6007('0x20')](function(){_0x38dce5[_0x6007('0xb3')](_0x38dce5[_0x6007('0x23')][_0x38dce5[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]]['queue']]);_0x38dce5[_0x6007('0x25')][_0x38dce5[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]][_0x6007('0x125')]][_0x6007('0x124')]=![];delete _0x38dce5['actions'][_0xdd5519[_0x6007('0x122')]];unlockQueueStatus(_0x4b5226);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]][_0x6007('0xb4')]]);this[_0x6007('0xc2')]({'active':![],'ContactId':this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]][_0x6007('0xf9')],'ListId':this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]][_0x6007('0xd2')],'VoiceQueueId':this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]][_0x6007('0xd3')]||undefined})['catch'](loggerCatch(_0x6007('0x12c')));delete this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]];unlockQueueStatus(_0x4b5226);}}else if((strategy[this[_0x6007('0x23')][this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]][_0x6007('0xb4')]][_0x6007('0x123')]]||_0x6007('0x1b'))==='rrmemory'){var _0x4872e2;if(this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]]&&!_[_0x6007('0x7e')](this[_0x6007('0x2e')][this['actions'][_0xdd5519['actionid']][_0x6007('0xb4')]])){if(this['queueBookedRR'][_0x38dce5[_0x6007('0x121')][_0xdd5519['actionid']]['queue']]){this[_0x6007('0x12d')][_0x38dce5[_0x6007('0x121')][_0xdd5519['actionid']]['queue']]=this[_0x6007('0x12d')][this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]][_0x6007('0xb4')]]?this[_0x6007('0x12d')][this['actions'][_0xdd5519[_0x6007('0x122')]]['queue']]:this[_0x6007('0x2e')][this[_0x6007('0x121')][_0xdd5519[_0x6007('0x122')]][_0x6007('0xb4')]]?this[_0x6007('0x2e')][this[_0x6007('0x121')][_0xdd5519['actionid']][_0x6007('0xb4')]][_0x6007('0x12e')]||0x0:0x0;}this[_0x6007('0x2e')][this['actions'][_0xdd5519[_0x6007('0x122')]][_0x6007('0xb4')]][_0x6007('0x12e')]=this[_0x6007('0x12d')][this[_0x6007('0x121')][_0xdd5519['actionid']][_0x6007('0xb4')]];for(var _0x4ac2a8=0x0;_0x4ac2a8=0x0;})['catch'](myreject(_0x5aebcc)));}}else{_0x13482e[_0x6007('0x146')](ami['Action']({'action':_0x6007('0x147'),'command':util[_0x6007('0x79')](_0x6007('0x148'),_0x516934,!_['isUndefined'](config[_0x6007('0x144')][_0x13e345])?_0x13e345:'')})[_0x6007('0xb8')](function(_0x362b2b){return _0x362b2b[_0x6007('0x14a')][_0x6007('0x14b')]('true')>=0x0;})['catch'](myreject(_0x5aebcc)));}BPromise[_0x6007('0x14c')](_0x13482e)[_0x6007('0xb8')](function(_0x5936bb){var _0x5da76e=_['some'](_0x5936bb);if(_0x5da76e){return _0x23fb3e(_0x5da76e);}else{_0x462454[_0x6007('0x41')]=_0x25cd32?_0x6007('0x14d'):_0x6007('0x14e');return _0x5aebcc(msgResponse(_0x6007('0x14f'),_0x6007('0x141'),_0x6007('0x150')+_0x25cd32+'\x20'+_0x2975ec+_0x6007('0x151')+util['inspect'](_0x516934,{'showHidden':![],'depth':null})+_0x6007('0x152')+_0x13e345));}})[_0x6007('0xb0')](function(_0x2d9a9d){return _0x5aebcc(msgResponse(_0x6007('0x13e'),'Failure',JSON[_0x6007('0x4b')](_0x2d9a9d)));});});};Dialer[_0x6007('0x1d')][_0x6007('0x153')]=function(_0x593a38){var _0x582c6b=this;return function(){switch(_0x593a38[_0x6007('0x5c')]){case'progressive':freeVariablesPredictive(_0x593a38);_0x582c6b[_0x6007('0x154')](_0x593a38,0x1);break;case _0x6007('0x155'):freeVariablesPredictive(_0x593a38);_0x582c6b['handlePower'](_0x593a38,_0x593a38[_0x6007('0x156')]);break;case _0x6007('0xa'):_0x582c6b[_0x6007('0xa')](_0x593a38);break;case _0x6007('0x9'):freeVariablesPredictive(_0x593a38);_0x582c6b['handlePower'](_0x593a38,0x1);break;default:freeVariablesPredictive(_0x593a38);logger['error'](_0x6007('0x157'),_0x593a38[_0x6007('0x44')],_0x6007('0x158'));}};};Dialer[_0x6007('0x1d')][_0x6007('0x159')]=function(_0x4acc32){var _0x56d449=this;return function(){_0x56d449['handleIvr'](_0x4acc32);};};Dialer[_0x6007('0x1d')][_0x6007('0xc')]=function(_0x3b52ba){var _0xcf9777=this;if(isNotPreview(_0x3b52ba[_0x6007('0x5c')])){if(isVoiceQueueOutbound(_0x3b52ba[_0x6007('0x50')])&&isActive(_0x3b52ba[_0x6007('0x5b')])){_0x3b52ba[_0x6007('0x9f')]=!![];BPromise[_0x6007('0xb7')]()[_0x6007('0xb8')](checkIsLoggedIn(_0x3b52ba,_0x3b52ba['loggedIn']))['then'](checkIsActive(_0x3b52ba,_0x3b52ba[_0x6007('0x5b')]))[_0x6007('0xb8')](checkInterval(_0x3b52ba))[_0x6007('0xb8')](_0xcf9777[_0x6007('0x15a')](_0x3b52ba))[_0x6007('0xb8')](_0xcf9777[_0x6007('0x15b')](_0x3b52ba[_0x6007('0x15c')],_0x3b52ba[_0x6007('0x15d')],_0x3b52ba[_0x6007('0x44')],_0x3b52ba))[_0x6007('0xb8')](_0xcf9777[_0x6007('0x13f')](_0x3b52ba[_0x6007('0x46')],_0x3b52ba[_0x6007('0x15d')],_0x3b52ba['name'],_0x3b52ba))['then'](_0xcf9777['checkDialMethod'](_0x3b52ba))['catch'](loggerCatchQueueSummary(_0x6007('0x15e'),_0x3b52ba));}else{notSendMessagesQueue(_0x3b52ba);}}else{freeVariablesPredictive(_0x3b52ba);}};Dialer[_0x6007('0x1d')]['syncCampaigns']=function(){var _0x3c5d23=this;var _0x56c116;for(var _0x1c2747 in this[_0x6007('0x24')]){if(typeof this[_0x6007('0x24')][_0x1c2747]!==_0x6007('0x98')){_0x56c116=this['campaigns'][_0x1c2747];if(isCampaignIvr(_0x56c116[_0x6007('0x50')])&&isActive(_0x56c116[_0x6007('0x77')])){_0x56c116['sendMessageOneNotActive']=!![];BPromise[_0x6007('0xb7')]()[_0x6007('0xb8')](checkIsActive(_0x56c116,_0x56c116[_0x6007('0x77')]))[_0x6007('0xb8')](checkInterval(_0x56c116))[_0x6007('0xb8')](_0x3c5d23[_0x6007('0x15a')](_0x56c116))[_0x6007('0xb8')](_0x3c5d23[_0x6007('0x15b')](_0x56c116[_0x6007('0x15c')],_0x56c116[_0x6007('0x15d')],_0x56c116['name'],_0x56c116))['then'](_0x3c5d23[_0x6007('0x13f')](_0x56c116[_0x6007('0x46')],_0x56c116[_0x6007('0x15d')],_0x56c116[_0x6007('0x44')],_0x56c116))['then'](_0x3c5d23['launchHandleIvr'](_0x56c116))[_0x6007('0xb0')](loggerCatchQueueSummary('[syncCampaigns]',_0x56c116));}else{notSendMessagesCampaign(_0x56c116);}}}};function getCallerIdRandom(_0x237699,_0x5e334e){var _0x10dfb7;var _0x149ac7;var _0x55f757;if(_0x5e334e<=0x0){_0x5e334e=0x1;}_0x10dfb7=new RegExp('\x5cw{0,'+_0x5e334e+'}$');_0x149ac7=Math['pow'](0xa,_0x5e334e-0x1);_0x55f757=Math['pow'](0xa,_0x5e334e)-0x1;return util[_0x6007('0x79')]('%s',_[_0x6007('0x15f')](_0x237699,_0x10dfb7,_[_0x6007('0x160')](_0x149ac7,_0x55f757)));}function extractCalleridName(_0x9082ea){var _0x393fe8=_0x9082ea[_0x6007('0x161')](/"(.*?)"/);return _0x393fe8?_0x393fe8[0x1]:_0x9082ea;}function extractCalleridNumber(_0x67f9be){var _0x155517=_0x67f9be['match'](/<(.*?)>/);return _0x155517?_0x155517[0x1]:_0x67f9be;}Dialer[_0x6007('0x1d')][_0x6007('0x162')]=function(_0x3472f3,_0x588882){var _0x5c3451=this;var _0x76ac61=uuid['v4']();this['actions'][_0x76ac61]=new Action(_0x3472f3,_0x588882,_0x76ac61);return new BPromise(function(_0x3e4fdc,_0x3ec8be){if(_[_0x6007('0x40')](_0x3472f3)&&typeof _0x3472f3!==_0x6007('0x163')){return _0x3ec8be(msgResponse(_0x6007('0x164'),_0x6007('0x141'),_0x6007('0x165')));}if(_[_0x6007('0x40')](_0x588882[_0x6007('0x166')][_0x6007('0x167')])||_0x588882[_0x6007('0x166')][_0x6007('0x167')]===null){return _0x3ec8be(msgResponse(_0x6007('0x164'),_0x6007('0x141'),'contact\x20is\x20undefine'));}var _0xe888fe={'XMD-CALLERID':_0x5c3451[_0x6007('0x121')][_0x76ac61][_0x6007('0x168')](),'XMD-AGI':_0x3472f3[_0x6007('0x169')]?util[_0x6007('0x79')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3472f3[_0x6007('0x169')]):_0x6007('0x16a'),'XMD-AGIAFTER':_0x3472f3[_0x6007('0x10d')]?util[_0x6007('0x79')](_0x6007('0x16b'),ipAgi,_0x3472f3['dialQueueProject2']):_0x6007('0x16a'),'XMD-QUEUE':_0x3472f3[_0x6007('0x50')]===_0x6007('0x51')?util[_0x6007('0x79')](_0x6007('0x16c'),_0x3472f3[_0x6007('0x44')],_0x3472f3[_0x6007('0x16d')]||'',_0x3472f3[_0x6007('0x10e')]?'c':'',_0x3472f3[_0x6007('0x112')]||0x3):_0x6007('0x16a'),'XMD-CONTACTID':_0x588882[_0x6007('0xf9')],'XMD-CDRTYPE':_0x6007('0x16e'),'CALLERID(all)':_0x5c3451[_0x6007('0x121')][_0x76ac61][_0x6007('0x168')](),'XMD-AMD':_0x3472f3[_0x6007('0xe0')]?'ACTIVE':_0x6007('0x16a'),'XMD-DESTINATION':_0x6007('0xdf')};if(_0x3472f3[_0x6007('0xe0')]){_0xe888fe[_0x6007('0x16f')]=_0x3472f3[_0x6007('0x170')]||0x9c4;_0xe888fe[_0x6007('0x171')]=_0x3472f3[_0x6007('0x172')]||0x5dc;_0xe888fe[_0x6007('0x173')]=_0x3472f3[_0x6007('0x174')]||0x320;_0xe888fe[_0x6007('0x175')]=_0x3472f3['dialAMDTotalAnalysisTime']||0x1388;_0xe888fe[_0x6007('0x176')]=_0x3472f3[_0x6007('0x177')]||0x64;_0xe888fe[_0x6007('0x178')]=_0x3472f3[_0x6007('0x179')]||0x32;_0xe888fe['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x3472f3[_0x6007('0x17a')]||0x3;_0xe888fe[_0x6007('0x17b')]=_0x3472f3[_0x6007('0x17c')]||0x100;_0xe888fe[_0x6007('0x17d')]=_0x3472f3[_0x6007('0x17e')]||0x1388;}if(_0x3472f3[_0x6007('0x50')]===_0x6007('0x51')){_0xe888fe[_0x6007('0x17f')]=_0x588882[_0x6007('0xfa')];}else{_0xe888fe[_0x6007('0x180')]=_0x588882[_0x6007('0xd3')];}for(var _0x13c3ff in _0x588882[_0x6007('0x166')]){if(typeof _0x588882['Contact'][_0x13c3ff]!=='undefined'){if(isNotNull(_0x588882[_0x6007('0x166')][_0x13c3ff])&&_0x13c3ff!=='id'&&_0x13c3ff!=='tags'&&_0x13c3ff!=='createdAt'&&_0x13c3ff!==_0x6007('0x181')){_0xe888fe[util[_0x6007('0x79')](_0x6007('0x182'),_0x6007('0x183'),_[_0x6007('0x184')](_0x13c3ff))]=_0x588882['Contact'][_0x13c3ff];}}}var _0x2f2c34=_0x5c3451['isTrunkReachable'](_0x3472f3['Trunk'])?getCallerId(_0x3472f3[_0x6007('0x76')][_0x6007('0x78')],_0x3472f3[_0x6007('0x5d')],_0x3472f3[_0x6007('0x185')]>0x0?getCallerIdRandom(_0x3472f3[_0x6007('0x186')],_0x3472f3['dialRandomLastDigitCallerIdNumber']):_0x3472f3[_0x6007('0x186')]):getCallerId(_[_0x6007('0xac')](_0x3472f3[_0x6007('0x13b')])?_0x3472f3[_0x6007('0x76')][_0x6007('0x78')]:_0x3472f3[_0x6007('0x13b')]['callerid'],_0x3472f3['dialOriginateCallerIdName'],_0x3472f3[_0x6007('0x185')]>0x0?getCallerIdRandom(_0x3472f3[_0x6007('0x186')],_0x3472f3[_0x6007('0x185')]):_0x3472f3[_0x6007('0x186')]);if(_0x2f2c34){_0xe888fe[_0x6007('0x187')]=_0x5c3451[_0x6007('0x121')][_0x76ac61][_0x6007('0x188')]=extractCalleridName(_0x2f2c34);_0xe888fe['XMD-ORIGINATECALLERIDNUM']=_0x5c3451[_0x6007('0x121')][_0x76ac61][_0x6007('0x189')]=extractCalleridNumber(_0x2f2c34);}return ami[_0x6007('0xad')]({'actionid':_0x76ac61,'action':_0x6007('0x164'),'channel':_0x5c3451[_0x6007('0x13a')](_0x3472f3[_0x6007('0x76')])?util[_0x6007('0x79')](_0x6007('0x18a'),_0x3472f3['Trunk'][_0x6007('0x44')],isNotNull(_0x3472f3[_0x6007('0x5f')])?_0x3472f3[_0x6007('0x5f')][_0x6007('0x18b')]()||'':'',_0x3472f3['dialCutDigit']>0x0?_0x588882[_0x6007('0x166')][_0x6007('0x167')]['substring'](_0x3472f3[_0x6007('0x18c')]):_0x588882[_0x6007('0x166')][_0x6007('0x167')]):util['format'](_0x6007('0x18a'),_[_0x6007('0xac')](_0x3472f3['TrunkBackup'])?_0x3472f3[_0x6007('0x76')][_0x6007('0x44')]:_0x3472f3[_0x6007('0x13b')][_0x6007('0x44')],isNotNull(_0x3472f3[_0x6007('0x5f')])?_0x3472f3['dialPrefix']['trim']()||'':'',_0x3472f3['dialCutDigit']>0x0?_0x588882[_0x6007('0x166')][_0x6007('0x167')][_0x6007('0x18d')](_0x3472f3[_0x6007('0x18c')]):_0x588882[_0x6007('0x166')]['phone']),'callerid':_0x2f2c34,'Exten':_0x6007('0xdf'),'Context':_0x6007('0x18e'),'Priority':'1','variable':_0xe888fe,'timeout':(_0x3472f3['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x76ac61})[_0x6007('0xb8')](function(_0x5cc1e4){return _0x3e4fdc(_0x5cc1e4);})[_0x6007('0xb0')](function(_0x3a8a51){_0x3472f3[_0x6007('0x67')]+=0x1;var _0x11a55b=new History(_0x5c3451[_0x6007('0x121')][_0x76ac61]);logger[_0x6007('0x95')](util[_0x6007('0x79')](_0x6007('0x18f'),JSON[_0x6007('0x4b')](_0x3a8a51)));_0x11a55b[_0x6007('0xa5')]=0xe;_0x11a55b[_0x6007('0xa6')]=_0x6007('0x190');_0x11a55b[_0x6007('0xa8')]=moment()[_0x6007('0x79')](_0x6007('0xf8'));_0x11a55b[_0x6007('0xa7')]=_0x11a55b[_0x6007('0xa8')];_0x5c3451['createHistory'](_0x11a55b)[_0x6007('0xb0')](loggerCatch('[originate][error]'));_0x5c3451[_0x6007('0xca')](_0x11a55b)[_0x6007('0xb0')](loggerCatch(_0x6007('0x191')))['finally'](function(){delete _0x5c3451[_0x6007('0x121')][_0x76ac61];return _0x3ec8be(msgResponse(_0x6007('0x164'),_0x6007('0x4a'),_0x6007('0x192')));});});});};Dialer[_0x6007('0x1d')]['syncOriginateResponse']=function(_0x5048c6){var _0x59ddb1=this[_0x6007('0x121')][_0x5048c6[_0x6007('0x122')]];if(_0x59ddb1){delete this['actions'][_0x5048c6['actionid']];_0x59ddb1[_0x6007('0x193')]=moment()['format'](_0x6007('0xf8'));var _0x385509=_0x59ddb1[_0x6007('0x50')]===_0x6007('0xb2')?this['campaigns'][_0x59ddb1[_0x6007('0xb4')]]:this[_0x6007('0x23')][_0x59ddb1['getQueue']()];if(!this[_0x6007('0x194')](_0x5048c6[_0x6007('0x195')])){this[_0x6007('0xb3')](_0x385509);return this['callProgressDetecting'](_0x59ddb1,_0x385509,_0x5048c6)[_0x6007('0xb0')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x6007('0x29')][_0x5048c6['uniqueid']]=_0x59ddb1;}};Dialer[_0x6007('0x1d')][_0x6007('0x196')]=function(_0x2e50bc,_0x33cb89,_0x8b9222){var _0x267e8c=new History(_0x33cb89);if(_0x267e8c['countbusyretry']+_0x267e8c[_0x6007('0xec')]+_0x267e8c['countnoanswerretry']+_0x267e8c['countnosuchnumberretry']+_0x267e8c['countdropretry']+_0x267e8c['countabandonedretry']+_0x267e8c[_0x6007('0xe9')]+_0x267e8c[_0x6007('0x197')]>=_0x8b9222[_0x6007('0x101')]-0x1){return!![];}switch(_0x2e50bc){case 0x3:if(_0x267e8c[_0x6007('0xed')]>=_0x8b9222[_0x6007('0x198')]-0x1){return!![];}this[_0x6007('0xc2')]({'active':![],'countnoanswerretry':_0x267e8c[_0x6007('0xed')]+=0x1,'scheduledat':moment()[_0x6007('0xf5')](_0x8b9222['dialNoAnswerRetryFrequency'],_0x6007('0xf7'))[_0x6007('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x267e8c[_0x6007('0xf9')],'ListId':_0x267e8c[_0x6007('0xd2')],'VoiceQueueId':_0x267e8c[_0x6007('0xfa')]||undefined,'CampaignId':_0x267e8c[_0x6007('0xd3')]||undefined})['catch'](loggerCatch(_0x6007('0x199')));break;case 0x5:if(_0x267e8c[_0x6007('0xeb')]>=_0x8b9222[_0x6007('0x19a')]-0x1){return!![];}this[_0x6007('0xc2')]({'active':![],'countbusyretry':_0x267e8c[_0x6007('0xeb')]+=0x1,'scheduledat':moment()[_0x6007('0xf5')](_0x8b9222[_0x6007('0x19b')],_0x6007('0xf7'))['format'](_0x6007('0xf8')),'ContactId':_0x267e8c['ContactId'],'ListId':_0x267e8c[_0x6007('0xd2')],'VoiceQueueId':_0x267e8c[_0x6007('0xfa')]||undefined,'CampaignId':_0x267e8c['CampaignId']||undefined})[_0x6007('0xb0')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x267e8c['countcongestionretry']>=_0x8b9222[_0x6007('0x19c')]-0x1){return!![];}this[_0x6007('0xc2')]({'active':![],'countcongestionretry':_0x267e8c['countcongestionretry']+=0x1,'scheduledat':moment()[_0x6007('0xf5')](_0x8b9222[_0x6007('0x19d')],'minutes')[_0x6007('0x79')](_0x6007('0xf8')),'ContactId':_0x267e8c[_0x6007('0xf9')],'ListId':_0x267e8c[_0x6007('0xd2')],'VoiceQueueId':_0x267e8c[_0x6007('0xfa')]||undefined,'CampaignId':_0x267e8c[_0x6007('0xd3')]||undefined})[_0x6007('0xb0')](loggerCatch(_0x6007('0x19e')));break;case 0x0:if(_0x267e8c[_0x6007('0xee')]>=_0x8b9222[_0x6007('0x19f')]-0x1){return!![];}else{this[_0x6007('0xc2')]({'active':![],'countnosuchnumberretry':_0x267e8c[_0x6007('0xee')]+=0x1,'scheduledat':moment()[_0x6007('0xf5')](_0x8b9222[_0x6007('0x1a0')],_0x6007('0xf7'))[_0x6007('0x79')](_0x6007('0xf8')),'ContactId':_0x267e8c[_0x6007('0xf9')],'ListId':_0x267e8c[_0x6007('0xd2')],'VoiceQueueId':_0x267e8c[_0x6007('0xfa')]||undefined,'CampaignId':_0x267e8c[_0x6007('0xd3')]||undefined})[_0x6007('0xb0')](loggerCatch(_0x6007('0x1a1')));}break;case 0xa:if(_0x267e8c[_0x6007('0x100')]>=_0x8b9222[_0x6007('0x116')]-0x1){return!![];}this[_0x6007('0xc2')]({'active':![],'countdropretry':_0x267e8c[_0x6007('0x100')]+=0x1,'scheduledat':moment()['add'](_0x8b9222[_0x6007('0x1a2')],_0x6007('0xf7'))[_0x6007('0x79')](_0x6007('0xf8')),'ContactId':_0x267e8c[_0x6007('0xf9')],'ListId':_0x267e8c[_0x6007('0xd2')],'VoiceQueueId':_0x267e8c[_0x6007('0xfa')]||undefined,'CampaignId':_0x267e8c[_0x6007('0xd3')]||undefined})[_0x6007('0xb0')](loggerCatch(_0x6007('0x118')));break;case 0xb:if(_0x267e8c[_0x6007('0xef')]>=_0x8b9222[_0x6007('0x1a3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x267e8c[_0x6007('0xef')]+=0x1,'scheduledat':moment()[_0x6007('0xf5')](_0x8b9222[_0x6007('0x1a4')],_0x6007('0xf7'))['format'](_0x6007('0xf8')),'ContactId':_0x267e8c[_0x6007('0xf9')],'ListId':_0x267e8c[_0x6007('0xd2')],'VoiceQueueId':_0x267e8c[_0x6007('0xfa')]||undefined,'CampaignId':_0x267e8c[_0x6007('0xd3')]||undefined})[_0x6007('0xb0')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x267e8c[_0x6007('0xe9')]>=_0x8b9222['dialMachineMaxRetry']-0x1){return!![];}this[_0x6007('0xc2')]({'active':![],'countmachineretry':_0x267e8c[_0x6007('0xe9')]+=0x1,'scheduledat':moment()[_0x6007('0xf5')](_0x8b9222[_0x6007('0xf6')],_0x6007('0xf7'))[_0x6007('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x267e8c['ContactId'],'ListId':_0x267e8c[_0x6007('0xd2')],'VoiceQueueId':_0x267e8c['VoiceQueueId']||undefined,'CampaignId':_0x267e8c[_0x6007('0xd3')]||undefined})['catch'](loggerCatch(_0x6007('0xfb')));break;case 0x14:if(_0x267e8c[_0x6007('0x197')]>=_0x8b9222[_0x6007('0x1a5')]-0x1){return!![];}this[_0x6007('0xc2')]({'active':![],'countagentrejectretry':_0x267e8c[_0x6007('0x197')]+=0x1,'scheduledat':moment()[_0x6007('0xf5')](_0x8b9222[_0x6007('0x1a6')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x267e8c[_0x6007('0xf9')],'ListId':_0x267e8c['ListId'],'VoiceQueueId':_0x267e8c[_0x6007('0xfa')]||undefined,'CampaignId':_0x267e8c['CampaignId']||undefined})[_0x6007('0xb0')](loggerCatch(_0x6007('0x1a7')));break;default:return!![];}};Dialer['prototype'][_0x6007('0x1a8')]=function(_0x2912a0,_0x315d41,_0x23176d){var _0x535a7d=this;var _0x393eee=new History(_0x2912a0);return new BPromise(function(_0xf53cfe,_0x47dabe){if(_['isUndefined'](_0x315d41)&&typeof _0x315d41!==_0x6007('0x163')){return _0x47dabe(msgResponse(_0x6007('0x1a9'),_0x6007('0x141'),_0x6007('0x1aa')));}if(_[_0x6007('0x40')](_0x23176d)&&typeof _0x23176d!=='object'){return _0x47dabe(msgResponse(_0x6007('0x1a9'),_0x6007('0x141'),_0x6007('0x1ab')));}switch(_0x23176d[_0x6007('0x10a')]){case'0':_0x315d41[_0x6007('0x66')]+=0x1;_0x393eee['state']=0x0;_0x393eee[_0x6007('0xa6')]=_0x6007('0x1ac');_0x393eee[_0x6007('0xee')]+=0x1;_0x393eee[_0x6007('0xff')]+=0x1;ami[_0x6007('0x4f')](_0x6007('0x1ad'),ut['buildObj'](_0x2912a0,_0x6007('0x1ae')));_0x535a7d[_0x6007('0xcc')](_0x393eee)[_0x6007('0xb0')](loggerCatch(_0x6007('0x1af')));if(_0x535a7d[_0x6007('0x196')](0x0,_0x2912a0,_0x315d41)){if(_0x393eee[_0x6007('0xee')]>=_0x315d41[_0x6007('0x19f')]){_0x535a7d['createStateFinal'](_0x393eee,_0xf53cfe,_0x47dabe,_0x6007('0x1b0'));}else{_0x535a7d['stateGlobal'](_0x393eee,_0xf53cfe,_0x47dabe,_0x6007('0x1b0'));}}break;case'3':_0x315d41[_0x6007('0x1b1')]+=0x1;_0x393eee[_0x6007('0xa5')]=0x3;_0x393eee['statedesc']=_0x6007('0x1b2');_0x393eee['countnoanswerretry']+=0x1;_0x393eee[_0x6007('0xff')]+=0x1;ami[_0x6007('0x4f')](_0x6007('0x1b3'),ut[_0x6007('0x1b4')](_0x2912a0,'noanswer'));_0x535a7d[_0x6007('0xcc')](_0x393eee)[_0x6007('0xb0')](loggerCatch(_0x6007('0x1b5')));if(_0x535a7d[_0x6007('0x196')](0x3,_0x2912a0,_0x315d41)){if(_0x393eee['countnoanswerretry']>=_0x315d41['dialNoAnswerMaxRetry']){_0x535a7d['createStateFinal'](_0x393eee,_0xf53cfe,_0x47dabe,_0x6007('0x1b6'));}else{_0x535a7d[_0x6007('0xf0')](_0x393eee,_0xf53cfe,_0x47dabe,_0x6007('0x1b6'));}}break;case'5':_0x315d41[_0x6007('0x62')]+=0x1;_0x393eee[_0x6007('0xa5')]=0x5;_0x393eee[_0x6007('0xa6')]=_0x6007('0x1b7');_0x393eee[_0x6007('0xeb')]+=0x1;_0x393eee[_0x6007('0xff')]+=0x1;ami[_0x6007('0x4f')](_0x6007('0x1b8'),ut['buildObj'](_0x2912a0,'busy'));_0x535a7d['createHistory'](_0x393eee)[_0x6007('0xb0')](loggerCatch(_0x6007('0x1b9')));if(_0x535a7d[_0x6007('0x196')](0x5,_0x2912a0,_0x315d41)){if(_0x393eee[_0x6007('0xeb')]>=_0x315d41[_0x6007('0x19a')]){_0x535a7d['createStateFinal'](_0x393eee,_0xf53cfe,_0x47dabe,'reason\x205\x20busy');}else{_0x535a7d[_0x6007('0xf0')](_0x393eee,_0xf53cfe,_0x47dabe,_0x6007('0x1ba'));}}break;case'8':_0x315d41[_0x6007('0x63')]+=0x1;_0x393eee[_0x6007('0xa5')]=0x8;_0x393eee[_0x6007('0xa6')]=_0x6007('0x1bb');_0x393eee['countcongestionretry']+=0x1;_0x393eee[_0x6007('0xff')]+=0x1;ami['emit']('custom:agentcongestion',ut[_0x6007('0x1b4')](_0x2912a0,_0x6007('0x1bc')));_0x535a7d['createHistory'](_0x393eee)[_0x6007('0xb0')](loggerCatch(_0x6007('0x1bd')));if(_0x535a7d[_0x6007('0x196')](0x8,_0x2912a0,_0x315d41)){if(_0x393eee[_0x6007('0xec')]>=_0x315d41[_0x6007('0x19c')]){_0x535a7d[_0x6007('0xf3')](_0x393eee,_0xf53cfe,_0x47dabe,_0x6007('0x1be'));}else{_0x535a7d['stateGlobal'](_0x393eee,_0xf53cfe,_0x47dabe,_0x6007('0x1be'));}}break;case'11':_0x315d41[_0x6007('0x1bf')]+=0x1;_0x393eee[_0x6007('0xa5')]=0xb;_0x393eee[_0x6007('0xa6')]=_0x6007('0x11d');_0x393eee[_0x6007('0xef')]+=0x1;_0x393eee[_0x6007('0xff')]+=0x1;_0x535a7d[_0x6007('0xcc')](_0x393eee)[_0x6007('0xb0')](loggerCatch(_0x6007('0x120')));if(_0x535a7d[_0x6007('0x196')](0xb,_0x2912a0,_0x315d41)){if(_0x393eee[_0x6007('0xef')]>=_0x315d41[_0x6007('0x1a3')]){_0x535a7d[_0x6007('0xf3')](_0x393eee,_0xf53cfe,_0x47dabe,_0x6007('0x1c0'));}else{_0x535a7d[_0x6007('0xf0')](_0x393eee,_0xf53cfe,_0x47dabe,'reason\x2011\x20abandoned');}}break;case'20':_0x315d41[_0x6007('0x69')]+=0x1;_0x393eee[_0x6007('0xa5')]=0x14;_0x393eee[_0x6007('0xa6')]=_0x6007('0x1c1');_0x393eee[_0x6007('0x197')]+=0x1;_0x393eee[_0x6007('0xff')]+=0x1;ami[_0x6007('0x4f')](_0x6007('0x1c2'),ut[_0x6007('0x1b4')](_0x2912a0,'agentreject'));_0x535a7d['createHistory'](_0x393eee)[_0x6007('0xb0')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x535a7d[_0x6007('0x196')](0x14,_0x2912a0,_0x315d41)){if(_0x393eee[_0x6007('0x197')]>=_0x315d41[_0x6007('0x1a5')]){_0x535a7d[_0x6007('0xf3')](_0x393eee,_0xf53cfe,_0x47dabe,_0x6007('0x1c3'));}else{_0x535a7d[_0x6007('0xf0')](_0x393eee,_0xf53cfe,_0x47dabe,_0x6007('0x1c3'));}}break;default:_0x315d41[_0x6007('0x1c4')]+=0x1;_0x393eee[_0x6007('0xa5')]=0xc;_0x393eee['statedesc']=_0x23176d['reason'];_0x535a7d['createHistory'](_0x393eee)[_0x6007('0xb0')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x535a7d['checkRetriveMax'](_0x23176d[_0x6007('0x10a')],_0x2912a0,_0x315d41)){if(_0x393eee[_0x6007('0xeb')]+_0x393eee['countcongestionretry']+_0x393eee['countnoanswerretry']+_0x393eee[_0x6007('0xee')]+_0x393eee[_0x6007('0x100')]+_0x393eee[_0x6007('0xef')]+_0x393eee[_0x6007('0xe9')]+_0x393eee[_0x6007('0x197')]>=_0x315d41[_0x6007('0x101')]){_0x535a7d[_0x6007('0xf0')](_0x393eee,_0xf53cfe,_0x47dabe,_0x23176d['reason']);}else{_0x535a7d[_0x6007('0xf3')](_0x393eee,_0xf53cfe,_0x47dabe,_0x23176d[_0x6007('0x10a')]);}}}});};Dialer[_0x6007('0x1d')][_0x6007('0xf0')]=function(_0x5f26dd,_0xb8e187,_0x2a4ea6,_0x57490a){var _0x175b4c=new Final(_0x5f26dd);_0x175b4c[_0x6007('0xa5')]=0xf;_0x175b4c['statedesc']=_0x6007('0x1c5');this['createStateFinal'](_0x175b4c,_0xb8e187,_0x2a4ea6,_0x57490a);};Dialer['prototype']['createStateFinal']=function(_0x11fdd4,_0x26108d,_0x1b77f6,_0x2e125a){this[_0x6007('0xca')](_0x11fdd4)[_0x6007('0xb8')](function(){return _0x26108d(msgResponse('[callProgressDetecting]',_0x6007('0xd6'),_0x2e125a));})[_0x6007('0xb0')](function(){return _0x1b77f6(msgResponse(_0x6007('0x1c6'),_0x6007('0x141'),_0x6007('0x1c7')));});};Dialer[_0x6007('0x1d')][_0x6007('0xa')]=function(_0x26606d){var _0x214f49=_0x26606d[_0x6007('0x1c8')]/0x64;var _0x56a565=_0x26606d[_0x6007('0x65')]/(_0x26606d[_0x6007('0x65')]+_0x26606d[_0x6007('0x60')]);var _0x37da95=Math[_0x6007('0x1c9')](_0x26606d['predictiveIntervalAvailable']*(_0x26606d[_0x6007('0x1ca')]/0x64));var _0x44e31=Math[_0x6007('0x1c9')](_0x26606d['predictiveIntervalAvailable']*(_0x26606d['predictiveIntervalMinThreshold']/0x64));var _0x2e03d9=_0x26606d['available']+_0x26606d[_0x6007('0x55')];var _0x1a9587=Math[_0x6007('0x1cb')](_0x26606d[_0x6007('0x72')]*_0x26606d[_0x6007('0x74')]*_0x26606d[_0x6007('0x6f')]*_0x26606d[_0x6007('0x1cc')]);if(_[_0x6007('0x40')](_0x26606d[_0x6007('0x2c')])){if(!_['isUndefined'](_0x26606d[_0x6007('0x2b')])){_0x26606d[_0x6007('0x2b')]=undefined;loggerPredictive['error'](_0x6007('0x1cd'),_0x6007('0x1ce'));}if(!_[_0x6007('0x40')](_0x26606d['handlePredictive'])){loggerPredictive['error'](_0x6007('0x1cd'),_0x6007('0x1cf'));clearInterval(_0x26606d[_0x6007('0x90')]);_0x26606d['handlePredictive']=undefined;}_0x26606d['startProgressive']=moment()[_0x6007('0x79')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x6007('0x7f')](_0x26606d['name'],'collection\x20data\x20in\x20progressive\x20at',_0x26606d[_0x6007('0x2c')]);this[_0x6007('0x154')](_0x26606d,0x1);}else if(ifInterval(_0x26606d[_0x6007('0x1d0')],_0x26606d['startProgressive'])){this[_0x6007('0x154')](_0x26606d,0x1);loggerPredictiveCalls[_0x6007('0x7f')](_0x6007('0x1d1'),_0x26606d[_0x6007('0x2c')],_0x26606d[_0x6007('0x44')]);_0x26606d[_0x6007('0x72')]=0x0;_0x26606d['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x214f49<_0x56a565&&_0x26606d['dialPredictiveOptimization']===_0x6007('0x1d2')){freeVariablesPredictive(_0x26606d);loggerPredictive['info'](_0x6007('0x1d3'),_0x6007('0x1d4'),_0x56a565,'startProgressive',_0x26606d[_0x6007('0x44')]);}else if(_0x1a9587<_0x26606d[_0x6007('0x6e')]&&_0x26606d['dialPredictiveOptimization']===_0x6007('0x1d2')){freeVariablesPredictive(_0x26606d);loggerPredictive['info'](_0x6007('0x1d5'),_0x6007('0x1d6'),_0x1a9587,_0x6007('0x1d7'),_0x26606d[_0x6007('0x6e')],'startProgressive',_0x26606d[_0x6007('0x44')]);}else if(!ifInterval(_0x26606d[_0x6007('0x1d0')],_0x26606d['startProgressive'])&&_[_0x6007('0x40')](_0x26606d[_0x6007('0x2b')])&&!_['isUndefined'](_0x26606d[_0x6007('0x2c')])){_0x26606d['startPredictive']=moment()[_0x6007('0x79')](_0x6007('0xf8'));loggerPredictive['info'](_0x26606d[_0x6007('0x44')],_0x6007('0x1d8'),_0x26606d['startPredictive']);this[_0x6007('0xbf')](_0x26606d[_0x6007('0x1d0')])[_0x6007('0xb8')](this['getDataPredictive'](_0x26606d))[_0x6007('0xb8')](mergeDataErlangB(_0x26606d))[_0x6007('0xb8')](this[_0x6007('0x1d9')](_0x26606d))[_0x6007('0xb0')](loggerCatchPredictive(_0x6007('0x1da'),_0x26606d));}else if(!ifInterval(_0x26606d[_0x6007('0x1d0')],_0x26606d['startPredictive'])){_0x26606d[_0x6007('0x6e')]=0x0;_0x26606d[_0x6007('0x2b')]=moment()['format'](_0x6007('0xf8'));loggerPredictive[_0x6007('0x7f')](_0x26606d[_0x6007('0x44')],'recalculate\x20predictive\x20at',_0x26606d[_0x6007('0x2b')]);clearInterval(_0x26606d[_0x6007('0x90')]);_0x26606d[_0x6007('0x90')]=undefined;this[_0x6007('0xbf')](_0x26606d[_0x6007('0x1d0')])[_0x6007('0xb8')](this[_0x6007('0x1db')](_0x26606d))[_0x6007('0xb8')](mergeDataErlangB(_0x26606d))[_0x6007('0xb8')](this[_0x6007('0x1d9')](_0x26606d))[_0x6007('0xb0')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x26606d));}else if(_0x26606d[_0x6007('0x1dc')]&&_0x2e03d9<_0x26606d[_0x6007('0x1dc')]-_0x44e31){freeVariablesPredictive(_0x26606d);loggerPredictive[_0x6007('0x7f')](_0x26606d[_0x6007('0x44')],_0x6007('0x1dd'),_0x2e03d9,_0x6007('0x1de'),_0x26606d['predictiveIntervalAvailable'],'-',_0x44e31,'=',_0x26606d['predictiveIntervalAvailable']-_0x44e31,')');}else if(_0x26606d[_0x6007('0x1dc')]&&_0x2e03d9>_0x26606d[_0x6007('0x1dc')]+_0x37da95){freeVariablesPredictive(_0x26606d);loggerPredictive[_0x6007('0x7f')](_0x26606d[_0x6007('0x44')],_0x6007('0x1dd'),_0x2e03d9,_0x6007('0x1df'),_0x26606d['predictiveIntervalAvailable'],'+',_0x37da95,'=',_0x26606d[_0x6007('0x1dc')]+_0x37da95,')');}};Dialer[_0x6007('0x1d')][_0x6007('0x1db')]=function(_0x10e053){var _0xd53346=this;return function(_0x159cb9){return new BPromise(function(_0x40c98b,_0x2c4753){_['merge'](_0x10e053,_0x159cb9[0x0]);if(checkGetDataPredictive(_0x159cb9[0x0])){var _0x22e39c=_0x10e053['predictiveIntervalAvailable']=_0x10e053[_0x6007('0x55')]+_0x10e053[_0x6007('0x52')];var _0x494589=_0x10e053[_0x6007('0x1d0')]*0x3c;var _0x51c356=_0x159cb9[0x0]['predictiveIntervalAvgTalktime']+_0x159cb9[0x0][_0x6007('0x6b')];var _0x228fda=(_0x159cb9[0x0][_0x6007('0x6a')]+_0x159cb9[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x159cb9[0x0][_0x6007('0x6c')])/_0x159cb9[0x0][_0x6007('0x70')];_0x10e053[_0x6007('0x6f')]=_0x228fda>0x0?_0x228fda:0x1;switch(_0x10e053['dialPredictiveOptimization']){case _0x6007('0x1d2'):var _0x55ff9c=_0x10e053[_0x6007('0x1c8')]/0x64;return _0xd53346[_0x6007('0x1e0')](_0x22e39c,_0x494589,_0x51c356,_0x228fda,_0x55ff9c)[_0x6007('0xb8')](function(_0x4bd7aa){return _0x40c98b(_0x4bd7aa);});case _0x6007('0x1e1'):var _0x5a9167=_0x10e053['dialPredictiveOptimizationPercentage']/0x64;return _0xd53346['busyFactor'](_0x22e39c,_0x494589,_0x51c356,_0x228fda,_0x5a9167)[_0x6007('0xb8')](function(_0x2c2fb2){return _0x40c98b(_0x2c2fb2);});default:return _0x2c4753(msgResponse(_0x6007('0x1e2'),_0x6007('0x141'),_0x6007('0x1e3')));}}else{return _0x2c4753(msgResponse(_0x6007('0x1e2'),_0x6007('0x141'),_0x6007('0x1e4')));}});};};Dialer[_0x6007('0x1d')][_0x6007('0x1e5')]=function(_0x48cb4e){var _0x1eb3c5=this;return function(_0x57b1e6){return new BPromise(function(_0x1da77b,_0x14b444){_[_0x6007('0xd0')](_0x48cb4e,_0x57b1e6[0x0]);if(checkGetDataPredictive(_0x57b1e6[0x0])){loggerPredictive[_0x6007('0x7f')](JSON[_0x6007('0x4b')](_0x57b1e6[0x0]));if(_0x48cb4e[_0x6007('0x1e6')]===_0x6007('0x1d2')){return _0x1eb3c5[_0x6007('0xc8')](_0x48cb4e['id'])['then'](function(_0xc76dbd){var _0x2d2d57=_0x48cb4e[_0x6007('0x53')]-_0xc76dbd[0x0][_0x6007('0x1e7')];var _0x1c72bb=_0x48cb4e[_0x6007('0x1d0')]*0x3c;var _0x27d0b4=_0x57b1e6[0x0][_0x6007('0x86')]+_0x57b1e6[0x0][_0x6007('0x6b')];var _0x3839e3=(_0x57b1e6[0x0][_0x6007('0x6a')]+_0x57b1e6[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x57b1e6[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x57b1e6[0x0][_0x6007('0x70')];var _0x9cb71d=_0x48cb4e[_0x6007('0x1c8')]/0x64;_0x48cb4e[_0x6007('0x1e8')]=_0xc76dbd[0x0]['outboundQueuePauses']||0x0;_0x48cb4e[_0x6007('0x6f')]=_0x3839e3>0x0?_0x3839e3:0x1;return _0x1eb3c5[_0x6007('0x1e0')](_0x2d2d57,_0x1c72bb,_0x27d0b4,_0x3839e3,_0x9cb71d);})[_0x6007('0xb8')](function(_0x584284){return _0x1da77b(_0x584284);})[_0x6007('0xb0')](function(_0x2be3e7){return _0x14b444(msgResponse(_0x6007('0x1e9'),_0x6007('0x141'),JSON[_0x6007('0x4b')](_0x2be3e7)));});}if(_0x48cb4e[_0x6007('0x1e6')]===_0x6007('0x1e1')){return _0x1eb3c5[_0x6007('0xc8')](_0x48cb4e['id'])['then'](function(_0x15b9ec){var _0x28a5e6=_0x48cb4e[_0x6007('0x53')]-_0x15b9ec[0x0][_0x6007('0x1e7')];var _0x3cd88c=_0x48cb4e[_0x6007('0x1d0')]*0x3c;var _0x25e89f=_0x57b1e6[0x0][_0x6007('0x86')]+_0x57b1e6[0x0]['predictiveIntervalAvgHoldtime'];var _0x42b46e=(_0x57b1e6[0x0][_0x6007('0x6a')]+_0x57b1e6[0x0][_0x6007('0x113')]+_0x57b1e6[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x57b1e6[0x0]['predictiveIntervalTotalCalls'];var _0x5541d7=_0x48cb4e['dialPredictiveOptimizationPercentage']/0x64;_0x48cb4e[_0x6007('0x1e8')]=_0x15b9ec[0x0]['outboundQueuePauses']||0x0;_0x48cb4e[_0x6007('0x6f')]=_0x42b46e>0x0?_0x42b46e:0x1;return _0x1eb3c5[_0x6007('0x1ea')](_0x28a5e6,_0x3cd88c,_0x25e89f,_0x42b46e,_0x5541d7);})[_0x6007('0xb8')](function(_0x513b94){return _0x1da77b(_0x513b94);})['catch'](function(_0x3f16f5){return _0x14b444(msgResponse(_0x6007('0x1e9'),_0x6007('0x141'),JSON[_0x6007('0x4b')](_0x3f16f5)));});}}else{return _0x14b444(msgResponse(_0x6007('0x1e2'),'Failure',_0x6007('0x1e4')));}});};};Dialer[_0x6007('0x1d')][_0x6007('0x1d9')]=function(_0x3850a2){var _0x1e03c0=this;return function(){var _0x11318b=0x0;var _0x2e637a=Math['floor'](_0x3850a2[_0x6007('0x73')]*0x3e8);if(_0x2e637a>0x0){_0x2e637a=_0x2e637a<0x64?0x64:_0x2e637a;loggerPredictive['info'](_0x3850a2[_0x6007('0x44')],_0x6007('0x1eb'),_0x2e637a,_0x6007('0x4c'));_0x3850a2[_0x6007('0x90')]=setInterval(function(){_0x1e03c0[_0x6007('0x90')](_0x3850a2);loggerPredictiveCalls['info'](_0x6007('0x1ec'),_0x11318b+=0x1);},_0x2e637a);}else{loggerPredictive[_0x6007('0x7f')](_0x3850a2[_0x6007('0x44')],_0x6007('0x1ed'));}};};Dialer[_0x6007('0x1d')][_0x6007('0x1ee')]=function(_0x4f8c61,_0x35cbaf){var _0x2afede=this;return function(_0x1d9095){if(_[_0x6007('0x7e')](_0x1d9095)){if(_[_0x6007('0xac')](_0x35cbaf[_0x6007('0x1ef')])||!_0x35cbaf['recallme']){if(_0x4f8c61[_0x6007('0x5c')]===_0x6007('0x9')){_0x4f8c61[_0x6007('0x128')]=_[_0x6007('0x40')](_0x4f8c61[_0x6007('0x128')])?!![]:_0x4f8c61[_0x6007('0x128')];var _0x528ffd=uuid['v4']();_0x2afede[_0x6007('0x121')][_0x528ffd]=new Action(_0x4f8c61,_0x35cbaf,_0x528ffd);loggerBooked[_0x6007('0x7f')]('[booked][checkContactBlack]',_0x528ffd,'queueStatusComplete:\x20',JSON[_0x6007('0x4b')](_0x4f8c61['queueStatusComplete']),'Queue:\x20',_0x4f8c61['name']);if(_0x4f8c61['queueStatusComplete']){_0x4f8c61['queueStatusComplete']=![];_0x2afede[_0x6007('0x2e')][_0x2afede['actions'][_0x528ffd][_0x6007('0xb4')]]=[];ami[_0x6007('0xad')]({'actionid':_0x528ffd,'action':'queuestatus','queue':_0x4f8c61[_0x6007('0x44')]})[_0x6007('0xb0')](function(){_0x2afede[_0x6007('0xb3')](_0x4f8c61);_0x2afede[_0x6007('0xc2')]({'active':![],'ContactId':_0x2afede[_0x6007('0x121')][_0x528ffd]['ContactId'],'ListId':_0x2afede[_0x6007('0x121')][_0x528ffd][_0x6007('0xd2')],'VoiceQueueId':_0x2afede[_0x6007('0x121')][_0x528ffd][_0x6007('0xfa')]||undefined,'CampaignId':_0x2afede[_0x6007('0x121')][_0x528ffd][_0x6007('0xd3')]||undefined})[_0x6007('0xb0')](loggerCatch(_0x6007('0x1f0')));delete _0x2afede[_0x6007('0x121')][_0x528ffd];});}else{loggerBooked[_0x6007('0x7f')](_0x6007('0x1f1'),JSON[_0x6007('0x4b')](_0x4f8c61[_0x6007('0x128')]),_0x6007('0x1f2'),_0x4f8c61['name']);_0x2afede[_0x6007('0xb3')](_0x4f8c61);_0x2afede['rescheduleContact']({'active':![],'ContactId':_0x2afede[_0x6007('0x121')][_0x528ffd][_0x6007('0xf9')],'ListId':_0x2afede[_0x6007('0x121')][_0x528ffd][_0x6007('0xd2')],'VoiceQueueId':_0x2afede[_0x6007('0x121')][_0x528ffd][_0x6007('0xfa')]||undefined,'CampaignId':_0x2afede[_0x6007('0x121')][_0x528ffd][_0x6007('0xd3')]||undefined})['catch'](loggerCatch(_0x6007('0x1f0')));delete _0x2afede[_0x6007('0x121')][_0x528ffd];}}else{return _0x2afede[_0x6007('0x162')](_0x4f8c61,_0x35cbaf);}}else{if(getDiff(_0x35cbaf[_0x6007('0x1f3')])<_0x4f8c61[_0x6007('0x1f4')]*0x3c){if(_0x35cbaf['Agent']&&!_0x35cbaf[_0x6007('0x1f5')]['voicePause']){_0x2afede[_0x6007('0x22')][_0x6007('0x12b')](_0x35cbaf['id'])['finally'](function(){_0x2afede['updateOriginated'](_0x4f8c61);});}else{_0x2afede[_0x6007('0xc4')]({'active':![]},_0x35cbaf['id'],0x1)['finally'](function(){_0x2afede[_0x6007('0xb3')](_0x4f8c61);});}}else{_0x4f8c61['outboundReCallsDay']+=0x1;_0x2afede[_0x6007('0xb3')](_0x4f8c61);if(_0x4f8c61[_0x6007('0x1f6')]){_0x2afede['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x35cbaf[_0x6007('0xf9')],'ListId':_0x35cbaf[_0x6007('0xd2')],'VoiceQueueId':_0x35cbaf[_0x6007('0xfa')]||undefined,'CampaignId':_0x35cbaf[_0x6007('0xd3')]||undefined})[_0x6007('0xb0')](loggerCatch(_0x6007('0x1f7')));_0x2afede[_0x6007('0xcc')](createObjHistory(_0x4f8c61,_0x35cbaf,'RECALLINQUEUE',0x17,_0x6007('0x1f8')))[_0x6007('0xb0')](loggerCatch(_0x6007('0x1f9')));}else{_0x2afede[_0x6007('0xd9')](createObjHistory(_0x4f8c61,_0x35cbaf,_0x6007('0x1fa'),0x16,_0x6007('0x1fb')),'[Originate][HistoryRecallClose][historyCatch]',_0x6007('0x1fc'));}}}}else{_0x4f8c61['outboundBlacklistCallsDay']+=0x1;_0x2afede['saveInDb'](createObjHistory(_0x4f8c61,_0x35cbaf,_0x6007('0x1fd'),0xd,_0x6007('0x1fe')),_0x6007('0x1ff'),_0x6007('0x200'));throw _0x6007('0x201');}};};Dialer[_0x6007('0x1d')]['handleIvr']=function(_0x56c0a0){var _0x2ab8be=this;var _0x30a2b1=_0x56c0a0[_0x6007('0x202')]-_0x56c0a0[_0x6007('0x71')]-_0x56c0a0[_0x6007('0x203')];emitCampaignSummary(_0x56c0a0);if(_0x30a2b1>0x0){if(_0x30a2b1>this[_0x6007('0x27')]){_0x30a2b1=this[_0x6007('0x27')];}_0x56c0a0[_0x6007('0x203')]+=_0x30a2b1;this[_0x6007('0xc7')](_0x56c0a0['id'],_0x30a2b1,_0x56c0a0[_0x6007('0x204')])[_0x6007('0xb8')](function(_0x131a4d){_0x56c0a0[_0x6007('0x203')]-=_0x30a2b1;_0x56c0a0[_0x6007('0x203')]=_0x56c0a0[_0x6007('0x203')]>0x0?_0x56c0a0['temp']:0x0;if(!checkContactEmpty(_0x131a4d)){_0x56c0a0['message']=_0x6007('0x9d');logger['info'](_0x6007('0x205')+_0x56c0a0[_0x6007('0x44')]);}else{_0x56c0a0[_0x6007('0x71')]+=_0x131a4d[_0x6007('0x206')];_0x56c0a0['message']=_0x6007('0x207');for(var _0x58d71a=0x0;_0x58d71a<_0x131a4d[_0x6007('0x206')];_0x58d71a+=0x1){_0x56c0a0['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x131a4d[_0x58d71a])||_[_0x6007('0xac')](_0x131a4d[_0x58d71a]['Contact'])||_['isNil'](_0x131a4d[_0x58d71a][_0x6007('0x166')]['phone'])){_0x2ab8be[_0x6007('0xcf')](_0x6007('0x208'),_0x56c0a0,_0x131a4d[_0x58d71a]);}else{_0x2ab8be['checkIsBlackListIvr'](_['pick'](_0x131a4d[_0x58d71a],[_0x6007('0xd3'),_0x6007('0x209')]))[_0x6007('0xb8')](_0x2ab8be[_0x6007('0x1ee')](_0x56c0a0,_0x131a4d[_0x58d71a]))[_0x6007('0xb0')](_0x2ab8be[_0x6007('0xce')](_0x6007('0x20a'),_0x56c0a0));}}}})['catch'](loggerGetContactDialer(_0x6007('0x20b'),_0x56c0a0,_0x30a2b1));}};Dialer['prototype']['handlePower']=function(_0x3d8a4e,_0x5421b9){var _0x3f4917=this;var _0x5c98f8=[];var _0x536a7c=_0x5421b9>=0x1?_0x5421b9:0x1;if(_0x3d8a4e[_0x6007('0x5c')]===_0x6007('0x9')){_0x536a7c=0x1;}var _0xfccec6=Math[_0x6007('0x1cb')](_0x3d8a4e[_0x6007('0x52')]*_0x536a7c)-_0x3d8a4e[_0x6007('0x71')]-_0x3d8a4e[_0x6007('0x203')];emitVoiceQueueSummary(_0x3d8a4e);if(_0x3d8a4e[_0x6007('0x20c')]>0x0){var _0x5a9b45=_0x3d8a4e[_0x6007('0x20c')]-_0x3d8a4e[_0x6007('0x71')]-_0x3d8a4e[_0x6007('0x55')]-_0x3d8a4e['temp']-_0x3d8a4e['pTalking'];if(_0xfccec6>_0x5a9b45){_0xfccec6=_0x5a9b45;}}if(_0xfccec6>0x0){if(_0x3d8a4e[_0x6007('0x5c')]===_0x6007('0x9')){_0xfccec6=0x1;}if(_0xfccec6>this[_0x6007('0x27')]){_0xfccec6=this[_0x6007('0x27')];}_0x3d8a4e['temp']+=_0xfccec6;for(var _0x10d0ff in this[_0x6007('0x25')]){if(typeof this[_0x6007('0x25')][_0x10d0ff]!==_0x6007('0x98')){if(this['agents'][_0x10d0ff][_0x6007('0xa5')]===_0x6007('0x20d')&&this[_0x6007('0x25')][_0x10d0ff][_0x6007('0xae')]===_0x6007('0x20e')){_0x5c98f8[_0x6007('0x146')](this[_0x6007('0x25')][_0x10d0ff]['id']);}}}this[_0x6007('0xc6')](_0x3d8a4e['id'],_0x5c98f8,_0xfccec6,_0x3d8a4e['dialOrderByScheduledAt'])[_0x6007('0xb8')](function(_0x158ae0){_0x3d8a4e[_0x6007('0x203')]-=_0xfccec6;_0x3d8a4e[_0x6007('0x203')]=_0x3d8a4e['temp']>0x0?_0x3d8a4e[_0x6007('0x203')]:0x0;if(!checkContactEmpty(_0x158ae0)){_0x3f4917[_0x6007('0xb9')](_0x3d8a4e)[_0x6007('0xb8')](sendMessageReschedule(_0x3d8a4e))['catch'](loggerCatch(_0x6007('0xba')));}else{_0x3d8a4e[_0x6007('0x71')]+=_0x158ae0[_0x6007('0x206')];_0x3d8a4e[_0x6007('0x41')]=_0x3d8a4e[_0x6007('0x5c')]==='booked'?'ACTIVE':_0x6007('0x207');for(var _0x46b706=0x0;_0x46b706<_0x158ae0[_0x6007('0x206')];_0x46b706+=0x1){if(_[_0x6007('0xac')](_0x158ae0[_0x46b706])||_['isNil'](_0x158ae0[_0x46b706][_0x6007('0x166')])||_[_0x6007('0xac')](_0x158ae0[_0x46b706][_0x6007('0x166')][_0x6007('0x167')])){_0x3f4917[_0x6007('0xcf')](_0x6007('0x208'),_0x3d8a4e,_0x158ae0[_0x46b706]);}else{_0x3f4917[_0x6007('0xbb')](_[_0x6007('0xd1')](_0x158ae0[_0x46b706],[_0x6007('0xfa'),_0x6007('0x209')]))['then'](_0x3f4917[_0x6007('0x1ee')](_0x3d8a4e,_0x158ae0[_0x46b706]))[_0x6007('0xb0')](_0x3f4917['loggerHandler'](_0x6007('0x208'),_0x3d8a4e));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x3d8a4e,_0xfccec6));}};Dialer['prototype'][_0x6007('0x90')]=function(_0x3d8a19){if(_0x3d8a19[_0x6007('0x20c')]>0x0){var _0x3716e9=_0x3d8a19[_0x6007('0x20c')]-_0x3d8a19[_0x6007('0x71')]-_0x3d8a19[_0x6007('0x55')];if(_0x3716e9>0x0){this[_0x6007('0x20f')](_0x3d8a19);}else{loggerPredictiveCalls[_0x6007('0x7f')](_0x6007('0x210'));}}else{this[_0x6007('0x20f')](_0x3d8a19);}};Dialer['prototype'][_0x6007('0x20f')]=function(_0x6c2a56){var _0x430af1=this;var _0x39a2cb=[];_0x6c2a56[_0x6007('0x71')]+=0x1;for(var _0x593665 in this[_0x6007('0x25')]){if(typeof this['agents'][_0x593665]!==_0x6007('0x98')){if(this[_0x6007('0x25')][_0x593665][_0x6007('0xa5')]===_0x6007('0x20d')&&this['agents'][_0x593665][_0x6007('0xae')]===_0x6007('0x20e')){_0x39a2cb[_0x6007('0x146')](this[_0x6007('0x25')][_0x593665]['id']);}}}this[_0x6007('0xc6')](_0x6c2a56['id'],_0x39a2cb,0x1,_0x6c2a56[_0x6007('0x204')])[_0x6007('0xb8')](function(_0x157ff2){if(!checkContactEmpty(_0x157ff2)){checkContactLowerLimitOriginate(_0x6c2a56,0x1,0x0);_0x430af1[_0x6007('0xb9')](_0x6c2a56)[_0x6007('0xb8')](sendMessageReschedule(_0x6c2a56))[_0x6007('0xb0')](loggerCatch('[countReScheduled]\x20'));}else{_0x6c2a56[_0x6007('0x41')]=_0x6007('0x207');if(_[_0x6007('0xac')](_0x157ff2[0x0])||_[_0x6007('0xac')](_0x157ff2[0x0]['Contact'])||_[_0x6007('0xac')](_0x157ff2[0x0][_0x6007('0x166')][_0x6007('0x167')])){_0x430af1[_0x6007('0xcf')]('[actionOriginate]\x20',_0x6c2a56,_0x157ff2[0x0]);}else{_0x430af1[_0x6007('0xbb')](_[_0x6007('0xd1')](_0x157ff2[0x0],[_0x6007('0xfa'),_0x6007('0x209')]))[_0x6007('0xb8')](_0x430af1[_0x6007('0x1ee')](_0x6c2a56,_0x157ff2[0x0]))[_0x6007('0xb0')](_0x430af1['loggerHandler']('[actionOriginatePredictive]\x20',_0x6c2a56));}}})['catch'](loggerGetContactDialer(_0x6007('0x211'),_0x6c2a56,0x1));emitVoiceQueueSummary(_0x6c2a56);};Dialer[_0x6007('0x1d')]['abandonmentRate']=function(_0x8cb1df,_0x128904,_0xa10026,_0x1723a3,_0x22f96e,_0x4ac8f2){loggerPredictive[_0x6007('0x7f')](_0x6007('0x212'));loggerPredictive[_0x6007('0x7f')]('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',_0x8cb1df);loggerPredictive[_0x6007('0x7f')](_0x6007('0x213'),_0x128904);loggerPredictive[_0x6007('0x7f')](_0x6007('0x214'),_0xa10026);loggerPredictive['info'](_0x6007('0x215'),_0x1723a3);loggerPredictive[_0x6007('0x7f')](_0x6007('0x216'),_0x22f96e);loggerPredictive['info'](_0x6007('0x87'));return new BPromise(function(_0x3b9e97,_0x49649e){if(_0x8cb1df<=0x0||isNaN(_0x8cb1df)){return _0x49649e(msgResponse(_0x6007('0x217'),_0x6007('0x4a'),_0x6007('0x218')+_0x8cb1df));}if(_0xa10026<=0x0||isNaN(_0xa10026)){return _0x49649e(msgResponse(_0x6007('0x217'),_0x6007('0x4a'),_0x6007('0x219')+_0xa10026));}if(_0x1723a3<=0x0||isNaN(_0x1723a3)){return _0x49649e(msgResponse(_0x6007('0x217'),_0x6007('0x4a'),'p\x20=\x20'+_0x1723a3));}if(_0x128904<=0x0||isNaN(_0x128904)){return _0x49649e(msgResponse(_0x6007('0x217'),_0x6007('0x4a'),_0x6007('0x21a')+_0x128904));}if(_0x22f96e<=0x0||isNaN(_0x22f96e)){return _0x49649e(msgResponse(_0x6007('0x217'),_0x6007('0x4a'),'Amax\x20=\x20'+_0x22f96e));}_0x4ac8f2=_0x4ac8f2||0x0;var _0x185c05=0x1/_0xa10026;var _0x16dd11=0x0;var _0x586cac=0x0;var _0x1273bf=0x0;var _0x434039=0x0;for(var _0x4efc6b=0x0;_0x1273bf<_0x22f96e;_0x4efc6b+=0x1){_0x586cac=_0x4efc6b/_0x128904;_0x16dd11=(_0x1723a3*_0x586cac+_0x4ac8f2)/_0x185c05;_0x1273bf=erlangb(_0x16dd11,_0x8cb1df);_0x434039=_0x16dd11/_0x8cb1df*(0x1-erlangb(_0x16dd11,_0x8cb1df));}return _0x3b9e97({'erlangCalls':_0x4efc6b,'erlangCallToSecond':_0x128904/_0x4efc6b,'erlangAbandonmentRate':_0x1273bf,'erlangBusyFactor':_0x434039});});};Dialer[_0x6007('0x1d')]['busyFactor']=function(_0x7a582b,_0x14d186,_0x5018a0,_0x731684,_0x3fb7e2,_0x2e4d0d){loggerPredictive[_0x6007('0x7f')](_0x6007('0x21b'));loggerPredictive[_0x6007('0x7f')](_0x6007('0x21c'),_0x7a582b);loggerPredictive[_0x6007('0x7f')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14d186);loggerPredictive['info'](_0x6007('0x214'),_0x5018a0);loggerPredictive[_0x6007('0x7f')](_0x6007('0x215'),_0x731684);loggerPredictive['info'](_0x6007('0x21d'),_0x3fb7e2);loggerPredictive[_0x6007('0x7f')](_0x6007('0x87'));return new BPromise(function(_0x1a6aa3,_0x4f1efc){if(_0x7a582b<=0x0||isNaN(_0x7a582b)){return _0x4f1efc(msgResponse('[busyFactor]',_0x6007('0x4a'),'m\x20=\x20'+_0x7a582b));}if(_0x5018a0<=0x0||isNaN(_0x5018a0)){return _0x4f1efc(msgResponse(_0x6007('0x21e'),_0x6007('0x4a'),_0x6007('0x219')+_0x5018a0));}if(_0x731684<=0x0||isNaN(_0x731684)){return _0x4f1efc(msgResponse(_0x6007('0x21e'),'Error',_0x6007('0x21f')+_0x731684));}if(_0x14d186<=0x0||isNaN(_0x14d186)){return _0x4f1efc(msgResponse(_0x6007('0x21e'),'Error',_0x6007('0x21a')+_0x14d186));}if(_0x3fb7e2<=0x0||isNaN(_0x3fb7e2)){return _0x4f1efc(msgResponse(_0x6007('0x21e'),_0x6007('0x4a'),_0x6007('0x220')+_0x3fb7e2));}_0x2e4d0d=_0x2e4d0d||0x0;var _0x4f6102=0x1/_0x5018a0;var _0x3f7402=0x0;var _0x3ca9bd=0x0;var _0x317165=0x0;var _0x477412=0x0;for(var _0x5d0498=0x0;_0x477412<_0x3fb7e2;_0x5d0498+=0x1){_0x3ca9bd=_0x5d0498/_0x14d186;_0x3f7402=(_0x731684*_0x3ca9bd+_0x2e4d0d)/_0x4f6102;_0x317165=erlangb(_0x3f7402,_0x7a582b);_0x477412=_0x3f7402/_0x7a582b*(0x1-erlangb(_0x3f7402,_0x7a582b));}return _0x1a6aa3({'erlangCalls':_0x5d0498,'erlangCallToSecond':_0x14d186/_0x5d0498,'erlangAbandonmentRate':_0x317165,'erlangBusyFactor':_0x477412});});};module[_0x6007('0x221')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index a582406..a61dc52 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c6a=['uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry'];(function(_0x1d5c12,_0x12777e){var _0x553d6f=function(_0x5d0f53){while(--_0x5d0f53){_0x1d5c12['push'](_0x1d5c12['shift']());}};_0x553d6f(++_0x12777e);}(_0x3c6a,0x128));var _0xa3c6=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0x3c6a[_0x151721];return _0x2deaa7;};'use strict';var util=require(_0xa3c6('0x0'));var _=require(_0xa3c6('0x1'));var moment=require(_0xa3c6('0x2'));function getSeconds(_0x34fbcf,_0x4dd418){var _0x93f44b=moment(_0x34fbcf)[_0xa3c6('0x3')](0x0);var _0x313ea2=moment(_0x4dd418)[_0xa3c6('0x3')](0x0);return _0x93f44b[_0xa3c6('0x4')](_0x313ea2,_0xa3c6('0x5'));}function QueueCallerAbandon(_0x7ed03a,_0x4f0658){this[_0xa3c6('0x6')]=_0x7ed03a[_0xa3c6('0x6')];this[_0xa3c6('0x7')]=_0x7ed03a[_0xa3c6('0x7')];this[_0xa3c6('0x8')]=_0x7ed03a[_0xa3c6('0x7')]==='outbound'?_0xa3c6('0x9'):_0x7ed03a['type'];this[_0xa3c6('0xa')]=_0x7ed03a[_0xa3c6('0xa')];this[_0xa3c6('0xb')]=_0x7ed03a[_0xa3c6('0xb')];this[_0xa3c6('0xc')]=_0x7ed03a[_0xa3c6('0xc')];this[_0xa3c6('0xd')]=_0x7ed03a[_0xa3c6('0xa')]+_0x7ed03a[_0xa3c6('0xb')]+_0x7ed03a[_0xa3c6('0xc')]+_0x7ed03a['countnosuchnumberretry']+_0x7ed03a['countdropretry']+_0x7ed03a[_0xa3c6('0xe')]+_0x7ed03a[_0xa3c6('0xf')]+_0x7ed03a[_0xa3c6('0x10')];this[_0xa3c6('0x11')]=_0x7ed03a[_0xa3c6('0x11')];this['countdropretry']=_0x7ed03a[_0xa3c6('0x12')];this[_0xa3c6('0xe')]=_0x7ed03a[_0xa3c6('0xe')];this[_0xa3c6('0xf')]=_0x7ed03a[_0xa3c6('0xf')];this[_0xa3c6('0x10')]=_0x7ed03a[_0xa3c6('0x10')];this[_0xa3c6('0x13')]=_0x4f0658[_0xa3c6('0x13')];this[_0xa3c6('0x14')]=_0x7ed03a[_0xa3c6('0x15')];this[_0xa3c6('0x16')]=_0x7ed03a[_0xa3c6('0x17')];this[_0xa3c6('0x18')]=_0x7ed03a['starttime'];this[_0xa3c6('0x19')]=_0x7ed03a[_0xa3c6('0x19')];this['droptime']=_0x7ed03a[_0xa3c6('0x1a')];this[_0xa3c6('0x1b')]=this[_0xa3c6('0x1a')];this[_0xa3c6('0x1c')]=getSeconds(_0x7ed03a[_0xa3c6('0x19')],_0x7ed03a['starttime']);this[_0xa3c6('0x1d')]=getSeconds(this[_0xa3c6('0x1a')],_0x7ed03a[_0xa3c6('0x19')]);this[_0xa3c6('0x1e')]=0x0;this['queue']=_0x4f0658[_0xa3c6('0x9')];this[_0xa3c6('0x1f')]=_0x4f0658[_0xa3c6('0x20')];this[_0xa3c6('0x21')]=_0x4f0658[_0xa3c6('0x21')];this[_0xa3c6('0x22')]=_0x7ed03a[_0xa3c6('0x22')];this['callbackuniqueid']=_0x7ed03a['callbackuniqueid'];this[_0xa3c6('0x23')]=_0x7ed03a[_0xa3c6('0x23')];this[_0xa3c6('0x24')]=_0x7ed03a['recallme'];this[_0xa3c6('0x25')]=_0x7ed03a[_0xa3c6('0x25')];this[_0xa3c6('0x26')]=_0x7ed03a[_0xa3c6('0x26')];this[_0xa3c6('0x27')]=_0x7ed03a['UserId'];this[_0xa3c6('0x28')]=_0x7ed03a[_0xa3c6('0x28')];this[_0xa3c6('0x29')]=_0x7ed03a[_0xa3c6('0x29')];this['originatecalleridnum']=_0x7ed03a[_0xa3c6('0x2a')]||'';this[_0xa3c6('0x2b')]=_0x7ed03a[_0xa3c6('0x2b')]||'';}module[_0xa3c6('0x2c')]=QueueCallerAbandon; \ No newline at end of file +var _0x7a19=['type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','droptime','endtime','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x7a19,0x151));var _0x97a1=function(_0x58743f,_0x485681){_0x58743f=_0x58743f-0x0;var _0x28da14=_0x7a19[_0x58743f];return _0x28da14;};'use strict';var util=require(_0x97a1('0x0'));var _=require(_0x97a1('0x1'));var moment=require(_0x97a1('0x2'));function getSeconds(_0x319ce1,_0x1f42a9){var _0x52ce5f=moment(_0x319ce1)['milliseconds'](0x0);var _0x45cdbe=moment(_0x1f42a9)[_0x97a1('0x3')](0x0);return _0x52ce5f[_0x97a1('0x4')](_0x45cdbe,_0x97a1('0x5'));}function QueueCallerAbandon(_0x3f75d8,_0x42c2cd){this[_0x97a1('0x6')]=_0x3f75d8[_0x97a1('0x6')];this[_0x97a1('0x7')]=_0x3f75d8[_0x97a1('0x7')];this[_0x97a1('0x8')]=_0x3f75d8[_0x97a1('0x7')]===_0x97a1('0x9')?'queue':_0x3f75d8[_0x97a1('0x7')];this['countbusyretry']=_0x3f75d8['countbusyretry'];this[_0x97a1('0xa')]=_0x3f75d8[_0x97a1('0xa')];this[_0x97a1('0xb')]=_0x3f75d8[_0x97a1('0xb')];this['countglobal']=_0x3f75d8[_0x97a1('0xc')]+_0x3f75d8[_0x97a1('0xa')]+_0x3f75d8[_0x97a1('0xb')]+_0x3f75d8[_0x97a1('0xd')]+_0x3f75d8[_0x97a1('0xe')]+_0x3f75d8['countabandonedretry']+_0x3f75d8[_0x97a1('0xf')]+_0x3f75d8[_0x97a1('0x10')];this['countnosuchnumberretry']=_0x3f75d8[_0x97a1('0xd')];this[_0x97a1('0xe')]=_0x3f75d8[_0x97a1('0xe')];this[_0x97a1('0x11')]=_0x3f75d8['countabandonedretry'];this[_0x97a1('0xf')]=_0x3f75d8[_0x97a1('0xf')];this['countagentrejectretry']=_0x3f75d8[_0x97a1('0x10')];this[_0x97a1('0x12')]=_0x42c2cd['uniqueid'];this[_0x97a1('0x13')]=_0x3f75d8[_0x97a1('0x14')];this[_0x97a1('0x15')]=_0x3f75d8['number'];this[_0x97a1('0x16')]=_0x3f75d8[_0x97a1('0x16')];this['responsetime']=_0x3f75d8['responsetime'];this[_0x97a1('0x17')]=_0x3f75d8[_0x97a1('0x17')];this[_0x97a1('0x18')]=this[_0x97a1('0x17')];this[_0x97a1('0x19')]=getSeconds(_0x3f75d8['responsetime'],_0x3f75d8[_0x97a1('0x16')]);this[_0x97a1('0x1a')]=getSeconds(this[_0x97a1('0x17')],_0x3f75d8['responsetime']);this[_0x97a1('0x1b')]=0x0;this['queue']=_0x42c2cd[_0x97a1('0x1c')];this[_0x97a1('0x1d')]=_0x42c2cd['connectedlinename'];this['reason']=_0x42c2cd[_0x97a1('0x1e')];this[_0x97a1('0x1f')]=_0x3f75d8[_0x97a1('0x1f')];this[_0x97a1('0x20')]=_0x3f75d8[_0x97a1('0x20')];this[_0x97a1('0x21')]=_0x3f75d8['callbackat'];this[_0x97a1('0x22')]=_0x3f75d8[_0x97a1('0x22')];this['ContactId']=_0x3f75d8[_0x97a1('0x23')];this[_0x97a1('0x24')]=_0x3f75d8[_0x97a1('0x24')];this[_0x97a1('0x25')]=_0x3f75d8[_0x97a1('0x25')];this[_0x97a1('0x26')]=_0x3f75d8['VoiceQueueId'];this['CampaignId']=_0x3f75d8[_0x97a1('0x27')];this[_0x97a1('0x28')]=_0x3f75d8['originatecalleridnum']||'';this['originatecalleridname']=_0x3f75d8[_0x97a1('0x29')]||'';}module[_0x97a1('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 3973e9f..4b32880 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 _0xf6c0=['moment','uniqueid','channel','format','%s/%s/%s','Trunk','fax','localstationid','headerinfo','path','AttachmentId','util','lodash'];(function(_0x146e1a,_0x59db92){var _0x1cda43=function(_0x33bd1f){while(--_0x33bd1f){_0x146e1a['push'](_0x146e1a['shift']());}};_0x1cda43(++_0x59db92);}(_0xf6c0,0xdb));var _0x0f6c=function(_0xa7242e,_0x22572b){_0xa7242e=_0xa7242e-0x0;var _0x55dbc4=_0xf6c0[_0xa7242e];return _0x55dbc4;};'use strict';var util=require(_0x0f6c('0x0'));var _=require(_0x0f6c('0x1'));var moment=require(_0x0f6c('0x2'));function Action(_0x2371f0,_0x354d0b,_0x5eab44){this[_0x0f6c('0x3')]=_0x2371f0||undefined;this[_0x0f6c('0x4')]=util[_0x0f6c('0x5')](_0x0f6c('0x6'),_0x354d0b['tech'],_0x354d0b[_0x0f6c('0x7')]['name'],_0x5eab44[_0x0f6c('0x8')]);this['localstationid']=_0x354d0b[_0x0f6c('0x9')];this[_0x0f6c('0xa')]=_0x354d0b[_0x0f6c('0xa')];this[_0x0f6c('0xb')]=_0x5eab44[_0x0f6c('0xb')];this[_0x0f6c('0xc')]=_0x5eab44[_0x0f6c('0xc')];}module['exports']=Action; \ No newline at end of file +var _0xc23b=['tech','name','fax','localstationid','headerinfo','path','AttachmentId','exports','util','lodash','moment','uniqueid','channel','format','%s/%s/%s'];(function(_0x165a35,_0x5cb99a){var _0x4f3bed=function(_0x52d8cd){while(--_0x52d8cd){_0x165a35['push'](_0x165a35['shift']());}};_0x4f3bed(++_0x5cb99a);}(_0xc23b,0x71));var _0xbc23=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xc23b[_0x59d89e];return _0x554e93;};'use strict';var util=require(_0xbc23('0x0'));var _=require(_0xbc23('0x1'));var moment=require(_0xbc23('0x2'));function Action(_0x2d875c,_0x752ced,_0x3cf62a){this[_0xbc23('0x3')]=_0x2d875c||undefined;this[_0xbc23('0x4')]=util[_0xbc23('0x5')](_0xbc23('0x6'),_0x752ced[_0xbc23('0x7')],_0x752ced['Trunk'][_0xbc23('0x8')],_0x3cf62a[_0xbc23('0x9')]);this[_0xbc23('0xa')]=_0x752ced[_0xbc23('0xa')];this[_0xbc23('0xb')]=_0x752ced[_0xbc23('0xb')];this['path']=_0x3cf62a[_0xbc23('0xc')];this[_0xbc23('0xd')]=_0x3cf62a['AttachmentId'];}module[_0xbc23('0xe')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 1720467..1688601 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 _0x1713=['transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','then','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','reason','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate2]','AttachmentId','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','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','path','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','lodash','bluebird','uuid','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./util/util','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','hasOwnProperty','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution'];(function(_0x5cbe8e,_0x599120){var _0x53921d=function(_0x660f5a){while(--_0x660f5a){_0x5cbe8e['push'](_0x5cbe8e['shift']());}};_0x53921d(++_0x599120);}(_0x1713,0x191));var _0x3171=function(_0xaaa771,_0x37fcbb){_0xaaa771=_0xaaa771-0x0;var _0x2514f7=_0x1713[_0xaaa771];return _0x2514f7;};'use strict';var util=require('util');var _=require(_0x3171('0x0'));var BPromise=require(_0x3171('0x1'));var uuid=require(_0x3171('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x3171('0x3'));var gs=require(_0x3171('0x4'));var logger=require(_0x3171('0x5'))(_0x3171('0x6'));var ami=require(_0x3171('0x7'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x3171('0x8'));var Action=require('./action');var faxAccount=require(_0x3171('0x9'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x3171('0xa'));function Fax(_0x398e8e){this[_0x3171('0xb')]={};this[_0x3171('0xc')]=_0x398e8e[_0x3171('0xc')];this[_0x3171('0xd')]=_0x398e8e['trunks'];this[_0x3171('0xe')]={};ami['on'](_0x3171('0xf'),this[_0x3171('0x10')][_0x3171('0x11')](this));ami['on']('varset',this[_0x3171('0x12')]['bind'](this));ami['on'](_0x3171('0x13'),this['syncNewState'][_0x3171('0x11')](this));ami['on'](_0x3171('0x14'),this[_0x3171('0x15')][_0x3171('0x11')](this));ami['on'](_0x3171('0x16'),this[_0x3171('0x17')]['bind'](this));ami['on'](_0x3171('0x18'),this[_0x3171('0x19')][_0x3171('0x11')](this));ami['on'](_0x3171('0x1a'),this['syncHangup'][_0x3171('0x11')](this));ami['on'](_0x3171('0x1b'),this[_0x3171('0x1c')][_0x3171('0x11')](this));}Fax[_0x3171('0x1d')][_0x3171('0x10')]=function(_0x216cfb){if(_0x216cfb[_0x3171('0x1e')]==='from-voip-provider'){for(var _0x2617e6 in this['faxAccounts']){if(this[_0x3171('0xc')]['hasOwnProperty'](_0x2617e6)){if(_0x216cfb[_0x3171('0x1f')]===this[_0x3171('0xc')][_0x2617e6]['localstationid']){this[_0x3171('0xb')][_0x216cfb[_0x3171('0x20')]]={};this[_0x3171('0xb')][_0x216cfb[_0x3171('0x20')]][_0x3171('0x21')]=_0x216cfb[_0x3171('0x21')];this['channels'][_0x216cfb[_0x3171('0x20')]]['id']=this[_0x3171('0xc')][_0x2617e6]['id'];this[_0x3171('0xb')][_0x216cfb[_0x3171('0x20')]][_0x3171('0x22')]=this[_0x3171('0xc')][_0x2617e6][_0x3171('0x22')];logger[_0x3171('0x23')](_0x216cfb[_0x3171('0x20')],_0x3171('0x24'));}}}}if(this[_0x3171('0xe')][_0x216cfb[_0x3171('0x20')]]){this[_0x3171('0xb')][_0x216cfb[_0x3171('0x20')]]={};this[_0x3171('0xb')][_0x216cfb[_0x3171('0x20')]][_0x3171('0x21')]=_0x216cfb[_0x3171('0x21')];logger[_0x3171('0x23')](_0x216cfb[_0x3171('0x20')],_0x3171('0x24'));}};Fax[_0x3171('0x1d')][_0x3171('0x12')]=function(_0x17d37b){if(this[_0x3171('0xb')][_0x17d37b[_0x3171('0x20')]]){for(var _0x4c6cb5 in _0x17d37b['variable']){if(_0x17d37b[_0x3171('0x25')]['hasOwnProperty'](_0x4c6cb5)){this[_0x3171('0xb')][_0x17d37b[_0x3171('0x20')]][_0x4c6cb5]=_0x17d37b[_0x3171('0x26')];}}}};Fax[_0x3171('0x1d')][_0x3171('0x27')]=function(_0xb99860){if(this[_0x3171('0xb')][_0xb99860['uniqueid']]){this[_0x3171('0xb')][_0xb99860[_0x3171('0x20')]][_0x3171('0x28')]=_0xb99860[_0x3171('0x28')];this['channels'][_0xb99860[_0x3171('0x20')]][_0x3171('0x29')]=_0xb99860[_0x3171('0x29')];}};Fax[_0x3171('0x1d')][_0x3171('0x15')]=function(_0x5d7722){if(this[_0x3171('0xb')][_0x5d7722[_0x3171('0x20')]]){for(var _0xe59b6b in _0x5d7722[_0x3171('0x25')]){if(_0x5d7722[_0x3171('0x25')][_0x3171('0x2a')](_0xe59b6b)){this[_0x3171('0xb')][_0x5d7722[_0x3171('0x20')]][_0xe59b6b]=_0x5d7722[_0x3171('0x26')];}}}};Fax['prototype'][_0x3171('0x17')]=function(_0x1b3200){if(this[_0x3171('0xb')][_0x1b3200[_0x3171('0x20')]]){this[_0x3171('0xb')][_0x1b3200[_0x3171('0x20')]]['operation']=_0x1b3200[_0x3171('0x2b')];this[_0x3171('0xb')][_0x1b3200['uniqueid']][_0x3171('0x2c')]=_0x1b3200[_0x3171('0x2c')];this['channels'][_0x1b3200[_0x3171('0x20')]][_0x3171('0x2d')]=_0x1b3200['localstationid'];this[_0x3171('0xb')][_0x1b3200[_0x3171('0x20')]][_0x3171('0x2e')]=_0x1b3200[_0x3171('0x2e')];logger[_0x3171('0x23')](_0x1b3200[_0x3171('0x20')],_0x3171('0x2f'));}};Fax[_0x3171('0x1d')][_0x3171('0x19')]=function(_0x246ec0){var _0x16154e=this;if(this[_0x3171('0xb')][_0x246ec0[_0x3171('0x20')]]){var _0x180fb8=this['channels'][_0x246ec0['uniqueid']]['id'];this[_0x3171('0xb')][_0x246ec0[_0x3171('0x20')]][_0x3171('0x30')]=_0x246ec0[_0x3171('0x30')];this[_0x3171('0xb')][_0x246ec0[_0x3171('0x20')]][_0x3171('0x31')]=_0x246ec0[_0x3171('0x31')];this[_0x3171('0xb')][_0x246ec0[_0x3171('0x20')]][_0x3171('0x2d')]=_0x246ec0[_0x3171('0x2d')];this['channels'][_0x246ec0[_0x3171('0x20')]][_0x3171('0x32')]=_0x246ec0[_0x3171('0x32')];this['channels'][_0x246ec0[_0x3171('0x20')]][_0x3171('0x33')]=_0x246ec0['transferrate'];this['channels'][_0x246ec0[_0x3171('0x20')]][_0x3171('0x2e')]=_0x246ec0['filename'];this['channels'][_0x246ec0[_0x3171('0x20')]][_0x3171('0x34')]=_0x246ec0[_0x3171('0x34')];if(this['channels'][_0x246ec0['uniqueid']][_0x3171('0x31')]>0x0){tiff2pdf(_0x246ec0[_0x3171('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0x56f277){logger[_0x3171('0x23')](_0x246ec0[_0x3171('0x20')],_0x3171('0x35'),_0x56f277[_0x3171('0x36')]);attachment['create']({'name':path[_0x3171('0x37')](_0x246ec0[_0x3171('0x2e')])['name'],'basename':path['parse'](_0x246ec0[_0x3171('0x2e')])[_0x3171('0x22')]+'.pdf','type':'application/pdf'})[_0x3171('0x38')](function(_0x51d8e7){faxAccount['notify'](_0x180fb8,{'from':_0x246ec0['calleridnum'],'mapKey':_0x3171('0x6'),'body':path[_0x3171('0x37')](_0x246ec0[_0x3171('0x2e')])['name']+_0x3171('0x39'),'AttachmentId':_0x51d8e7['id']})[_0x3171('0x3a')](function(_0x4a4e8d){logger[_0x3171('0x3b')](_0x246ec0[_0x3171('0x20')],_0x3171('0x3c'),JSON[_0x3171('0x3d')](_0x4a4e8d));});})[_0x3171('0x3a')](function(_0x2d7bf1){logger[_0x3171('0x3b')](_0x246ec0[_0x3171('0x20')],_0x3171('0x3e'),JSON['stringify'](_0x2d7bf1));});});}logger[_0x3171('0x23')](_0x246ec0[_0x3171('0x20')],_0x3171('0x3e'));}};Fax[_0x3171('0x1d')][_0x3171('0x1c')]=function(_0xd72ff4){if(this[_0x3171('0xe')][_0xd72ff4[_0x3171('0x20')]]){_['merge'](this['channels'][_0xd72ff4[_0x3171('0x20')]],_[_0x3171('0x3f')](_0xd72ff4,[_0x3171('0x40'),_0x3171('0x41')]));}};function updateStatus(_0x5e0215){if(_0x5e0215['AttachmentId']){faxMessage[_0x3171('0x42')](_0x5e0215['AttachmentId'],{'failMessage':_0x3171('0x43')})[_0x3171('0x38')](function(_0xc4d144){ut['logger']('[Fax][Message][Error][Updated]',_0xc4d144);})[_0x3171('0x3a')](function(_0x1ba1a4){ut[_0x3171('0x44')]('[Fax][Message][Error][NoUpdate1]',_0x1ba1a4);});}else{ut[_0x3171('0x44')](_0x3171('0x45'));}}Fax[_0x3171('0x1d')]['updateStatus']=function(_0x23fefc,_0x5b7c82,_0x3b8950){var _0xb430c6=this;var _0x45fafd={};if(_0x5b7c82){_0x45fafd={'read':_0x5b7c82};}else{_0x45fafd={'failMessage':_0x3b8950};}if(this[_0x3171('0xe')][_0x23fefc]['AttachmentId']){faxMessage[_0x3171('0x42')](this[_0x3171('0xe')][_0x23fefc][_0x3171('0x46')],_0x45fafd)[_0x3171('0x38')](function(_0x296e5b){ut[_0x3171('0x44')](_0x3171('0x47'),_0x296e5b);})[_0x3171('0x3a')](function(_0x1e6f1d){ut[_0x3171('0x44')]('[Fax][Message][NoUpdate1]',_0x1e6f1d);})[_0x3171('0x48')](function(){delete _0xb430c6[_0x3171('0xb')][_0x23fefc];delete _0xb430c6[_0x3171('0xe')][_0x23fefc];});}else{ut[_0x3171('0x44')](_0x3171('0x49'));delete this[_0x3171('0xb')][_0x23fefc];delete this['actions'][_0x23fefc];}};Fax['prototype'][_0x3171('0x4a')]=function(_0x3d2163){var _0x2a9eb5=this;if(this['channels'][_0x3d2163[_0x3171('0x20')]]){if(this['actions'][_0x3d2163[_0x3171('0x20')]]){this[_0x3171('0xb')][_0x3d2163[_0x3171('0x20')]]['id']=this['actions'][_0x3d2163[_0x3171('0x20')]]['id'];this[_0x3171('0xb')][_0x3d2163[_0x3171('0x20')]][_0x3171('0x22')]=this[_0x3171('0xe')][_0x3d2163[_0x3171('0x20')]][_0x3171('0x22')];}logger[_0x3171('0x23')](_0x3d2163['uniqueid'],this[_0x3171('0xe')][_0x3d2163[_0x3171('0x20')]]?_0x3171('0x4b'):_0x3171('0x4c'),JSON[_0x3171('0x3d')](this[_0x3171('0xb')][_0x3d2163[_0x3171('0x20')]]));if(this[_0x3171('0xe')][_0x3d2163['uniqueid']]){if(this[_0x3171('0xb')][_0x3d2163['uniqueid']][_0x3171('0x4d')]>0x0&&this['channels'][_0x3d2163[_0x3171('0x20')]][_0x3171('0x16')]===_0x3171('0x4e')){this[_0x3171('0x4f')](_0x3d2163[_0x3171('0x20')],!![]);}else{this[_0x3171('0x4f')](_0x3d2163[_0x3171('0x20')],![],this[_0x3171('0xb')][_0x3d2163['uniqueid']][_0x3171('0x50')]?'SENDING\x20FAILED:\x20'+this[_0x3171('0xb')][_0x3d2163[_0x3171('0x20')]][_0x3171('0x50')]:_0x3171('0x51'));}}}};Fax[_0x3171('0x1d')][_0x3171('0x52')]=function(_0x75e2be){var _0x10bb43=this;return new BPromise(function(_0x17148e,_0xc369e7){_0x10bb43[_0x3171('0x53')](_0x75e2be,_0x10bb43[_0x3171('0xc')][_0x75e2be[_0x3171('0x54')]])[_0x3171('0x38')](function(_0x3d66cc){ut[_0x3171('0x44')](_0x3171('0x55'),_0x3d66cc);_0x17148e(ut[_0x3171('0x36')](_0x3171('0x56')));})[_0x3171('0x3a')](function(_0x34bd12){ut['logger'](_0x3171('0x57'),_0x34bd12);updateStatus(_0x75e2be);_0xc369e7(ut['message'](_0x3171('0x58')));});});};Fax[_0x3171('0x1d')][_0x3171('0x59')]=function(_0x27b98a){var _0x3165eb=this;return new BPromise(function(_0x33f581,_0x2981c6){var _0x8b52d9=_0x3165eb['checkTrunk'](_0x3165eb['faxAccounts'][_0x27b98a[_0x3171('0x54')]][_0x3171('0x5a')],_0x27b98a);if(_0x8b52d9[_0x3171('0x5b')]){_0x33f581(ut[_0x3171('0x36')](_0x3171('0x5c')));}else{_0x2981c6(ut['message'](_0x8b52d9['message']));}});};function originate(_0x1f6c44,_0x73bc9c,_0x13a246){return new BPromise(function(_0x12e8e9,_0x52d56b){if(_0x13a246){var _0xcd4fc8=util[_0x3171('0x5d')](_0x3171('0x5e'),path[_0x3171('0x37')](_0x1f6c44['path'])[_0x3171('0x22')],_0x1f6c44['path']);gs['execute'](_0xcd4fc8)['then'](function(){_0x1f6c44[_0x3171('0x5f')]=util[_0x3171('0x5d')]('%s/%s.tif',path['parse'](_0x1f6c44[_0x3171('0x5f')])['dir'],path[_0x3171('0x37')](_0x1f6c44[_0x3171('0x5f')])[_0x3171('0x22')]);_0x73bc9c[_0x3171('0x60')]=_0x1f6c44['path'];ut['logger'](_0x3171('0x61'),'');ami[_0x3171('0x62')](ut[_0x3171('0x63')](_0x1f6c44,_0x73bc9c))['then'](function(_0x53726a){_0x12e8e9(_0x53726a);})[_0x3171('0x3a')](function(_0x5739e5){_0x52d56b(_0x5739e5);});})[_0x3171('0x3a')](function(_0x3cee6a){_0x52d56b(_0x3cee6a);});}else{ami['Action'](ut[_0x3171('0x63')](_0x1f6c44,_0x73bc9c))[_0x3171('0x38')](function(_0xdea6bc){_0x12e8e9(_0xdea6bc);})[_0x3171('0x3a')](function(_0x4b76f0){_0x52d56b(_0x4b76f0);});}});}Fax[_0x3171('0x1d')]['execOriginate']=function(_0x1e886e,_0x17cdaa){var _0x1de835=this;return new BPromise(function(_0x418750,_0x366d41){var _0x2c9a25=uuid['v4']();var _0x257f1e=ut[_0x3171('0x64')](_0x1e886e,_0x17cdaa);_0x1de835['actions'][_0x2c9a25]=new Action(_0x2c9a25,_0x17cdaa,_0x1e886e);var _0x22e5f8=_0x1de835['actions'][_0x2c9a25];if(path[_0x3171('0x37')](_0x1e886e[_0x3171('0x5f')])[_0x3171('0x65')]==='.pdf'){originate(_0x22e5f8,_0x257f1e,!![])[_0x3171('0x38')](function(_0x50a94e){_0x418750(_0x50a94e);})['catch'](function(_0x5a6b3c){_0x366d41(_0x5a6b3c);});}else{originate(_0x22e5f8,_0x257f1e,![])['then'](function(_0x5bd8ff){_0x418750(_0x5bd8ff);})['catch'](function(_0x54680e){_0x366d41(_0x54680e);});}});};Fax['prototype'][_0x3171('0x66')]=function(_0x631c9f){return!_['isNil'](_0x631c9f)&&!_[_0x3171('0x67')](_0x631c9f[_0x3171('0x22')])&&!_['isNil'](_0x631c9f[_0x3171('0x68')])&&_0x631c9f[_0x3171('0x68')]&&!_[_0x3171('0x67')](this[_0x3171('0xd')][util['format'](_0x3171('0x69'),_0x631c9f['name'])])&&!_[_0x3171('0x67')](this['trunks'][util[_0x3171('0x5d')]('SIP/%s',_0x631c9f['name'])][_0x3171('0x2c')])&&(this[_0x3171('0xd')][util['format'](_0x3171('0x69'),_0x631c9f[_0x3171('0x22')])][_0x3171('0x2c')]===_0x3171('0x6a')||this['trunks'][util[_0x3171('0x5d')](_0x3171('0x69'),_0x631c9f[_0x3171('0x22')])][_0x3171('0x2c')]==='unmonitored');};Fax['prototype'][_0x3171('0x6b')]=function(_0x2ac638,_0x389993){if(!this[_0x3171('0x66')](_0x2ac638)){ut[_0x3171('0x44')](_0x3171('0x6c'),_['isNil'](_0x2ac638)?'':_0x2ac638[_0x3171('0x22')]+_0x3171('0x6d'));return{'isValid':![],'message':_0x3171('0x6e')};}if(_[_0x3171('0x67')](_0x389993[_0x3171('0x6')])){ut[_0x3171('0x44')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x389993));return{'isValid':![],'message':_0x3171('0x6f')};}if(_[_0x3171('0x67')](_0x389993['path'])){ut[_0x3171('0x44')](_0x3171('0x70'),JSON['stringify'](_0x389993));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file +var _0x03b7=['status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','application/pdf','then','notify','.pdf','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','[Fax][execOriginate][success]','message','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk\x20Reachable','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','format','%s/%s.tif','dir','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','actions','channel','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation'];(function(_0x397004,_0x7949f){var _0xa7a10=function(_0x377854){while(--_0x377854){_0x397004['push'](_0x397004['shift']());}};_0xa7a10(++_0x7949f);}(_0x03b7,0x120));var _0x703b=function(_0x38a177,_0xaa6c59){_0x38a177=_0x38a177-0x0;var _0x3ca75a=_0x03b7[_0x38a177];return _0x3ca75a;};'use strict';var util=require('util');var _=require(_0x703b('0x0'));var BPromise=require('bluebird');var uuid=require(_0x703b('0x1'));var moment=require(_0x703b('0x2'));var path=require(_0x703b('0x3'));var tiff2pdf=require(_0x703b('0x4'));var gs=require(_0x703b('0x5'));var logger=require(_0x703b('0x6'))(_0x703b('0x7'));var ami=require(_0x703b('0x8'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x703b('0x9'));var Action=require(_0x703b('0xa'));var faxAccount=require(_0x703b('0xb'));var attachment=require(_0x703b('0xc'));var faxMessage=require(_0x703b('0xd'));function Fax(_0x41ec88){this[_0x703b('0xe')]={};this[_0x703b('0xf')]=_0x41ec88[_0x703b('0xf')];this[_0x703b('0x10')]=_0x41ec88[_0x703b('0x10')];this['actions']={};ami['on'](_0x703b('0x11'),this[_0x703b('0x12')][_0x703b('0x13')](this));ami['on'](_0x703b('0x14'),this[_0x703b('0x15')]['bind'](this));ami['on']('newstate',this[_0x703b('0x16')][_0x703b('0x13')](this));ami['on'](_0x703b('0x17'),this[_0x703b('0x18')][_0x703b('0x13')](this));ami['on'](_0x703b('0x19'),this['syncFaxStatus']['bind'](this));ami['on'](_0x703b('0x1a'),this[_0x703b('0x1b')]['bind'](this));ami['on'](_0x703b('0x1c'),this[_0x703b('0x1d')][_0x703b('0x13')](this));ami['on']('originateresponse',this[_0x703b('0x1e')][_0x703b('0x13')](this));}Fax[_0x703b('0x1f')]['syncNewchannel']=function(_0x2f567e){if(_0x2f567e['context']===_0x703b('0x20')){for(var _0x2fe6c in this[_0x703b('0xf')]){if(this['faxAccounts'][_0x703b('0x21')](_0x2fe6c)){if(_0x2f567e[_0x703b('0x22')]===this[_0x703b('0xf')][_0x2fe6c][_0x703b('0x23')]){this['channels'][_0x2f567e[_0x703b('0x24')]]={};this[_0x703b('0xe')][_0x2f567e['uniqueid']]['channel']=_0x2f567e['channel'];this[_0x703b('0xe')][_0x2f567e[_0x703b('0x24')]]['id']=this[_0x703b('0xf')][_0x2fe6c]['id'];this['channels'][_0x2f567e[_0x703b('0x24')]][_0x703b('0x25')]=this[_0x703b('0xf')][_0x2fe6c][_0x703b('0x25')];logger[_0x703b('0x26')](_0x2f567e[_0x703b('0x24')],_0x703b('0x27'));}}}}if(this[_0x703b('0x28')][_0x2f567e[_0x703b('0x24')]]){this['channels'][_0x2f567e[_0x703b('0x24')]]={};this[_0x703b('0xe')][_0x2f567e[_0x703b('0x24')]][_0x703b('0x29')]=_0x2f567e[_0x703b('0x29')];logger[_0x703b('0x26')](_0x2f567e[_0x703b('0x24')],_0x703b('0x27'));}};Fax['prototype'][_0x703b('0x15')]=function(_0x279c7d){if(this[_0x703b('0xe')][_0x279c7d[_0x703b('0x24')]]){for(var _0x332c09 in _0x279c7d[_0x703b('0x2a')]){if(_0x279c7d['variable'][_0x703b('0x21')](_0x332c09)){this[_0x703b('0xe')][_0x279c7d['uniqueid']][_0x332c09]=_0x279c7d[_0x703b('0x2b')];}}}};Fax[_0x703b('0x1f')][_0x703b('0x16')]=function(_0x26e37f){if(this[_0x703b('0xe')][_0x26e37f[_0x703b('0x24')]]){this[_0x703b('0xe')][_0x26e37f['uniqueid']][_0x703b('0x2c')]=_0x26e37f[_0x703b('0x2c')];this[_0x703b('0xe')][_0x26e37f[_0x703b('0x24')]]['channelstatedesc']=_0x26e37f[_0x703b('0x2d')];}};Fax[_0x703b('0x1f')][_0x703b('0x18')]=function(_0x5119e7){if(this['channels'][_0x5119e7['uniqueid']]){for(var _0x309690 in _0x5119e7['variable']){if(_0x5119e7['variable'][_0x703b('0x21')](_0x309690)){this[_0x703b('0xe')][_0x5119e7[_0x703b('0x24')]][_0x309690]=_0x5119e7['value'];}}}};Fax[_0x703b('0x1f')][_0x703b('0x2e')]=function(_0x2c96b5){if(this[_0x703b('0xe')][_0x2c96b5[_0x703b('0x24')]]){this[_0x703b('0xe')][_0x2c96b5[_0x703b('0x24')]][_0x703b('0x2f')]=_0x2c96b5[_0x703b('0x2f')];this[_0x703b('0xe')][_0x2c96b5['uniqueid']][_0x703b('0x30')]=_0x2c96b5[_0x703b('0x30')];this[_0x703b('0xe')][_0x2c96b5[_0x703b('0x24')]][_0x703b('0x23')]=_0x2c96b5['localstationid'];this['channels'][_0x2c96b5[_0x703b('0x24')]][_0x703b('0x31')]=_0x2c96b5[_0x703b('0x31')];logger[_0x703b('0x26')](_0x2c96b5[_0x703b('0x24')],_0x703b('0x32'));}};Fax[_0x703b('0x1f')]['syncReceiveFax']=function(_0x5ae4ab){var _0x4009f0=this;if(this[_0x703b('0xe')][_0x5ae4ab['uniqueid']]){var _0x524789=this['channels'][_0x5ae4ab[_0x703b('0x24')]]['id'];this[_0x703b('0xe')][_0x5ae4ab[_0x703b('0x24')]][_0x703b('0x33')]=_0x5ae4ab[_0x703b('0x33')];this[_0x703b('0xe')][_0x5ae4ab[_0x703b('0x24')]][_0x703b('0x34')]=_0x5ae4ab[_0x703b('0x34')];this[_0x703b('0xe')][_0x5ae4ab['uniqueid']][_0x703b('0x23')]=_0x5ae4ab[_0x703b('0x23')];this['channels'][_0x5ae4ab[_0x703b('0x24')]][_0x703b('0x35')]=_0x5ae4ab[_0x703b('0x35')];this[_0x703b('0xe')][_0x5ae4ab[_0x703b('0x24')]][_0x703b('0x36')]=_0x5ae4ab[_0x703b('0x36')];this[_0x703b('0xe')][_0x5ae4ab[_0x703b('0x24')]][_0x703b('0x31')]=_0x5ae4ab[_0x703b('0x31')];this[_0x703b('0xe')][_0x5ae4ab[_0x703b('0x24')]][_0x703b('0x37')]=_0x5ae4ab[_0x703b('0x37')];if(this[_0x703b('0xe')][_0x5ae4ab[_0x703b('0x24')]]['pagestransferred']>0x0){tiff2pdf(_0x5ae4ab[_0x703b('0x31')],_0x703b('0x38'),function(_0x4a7efc){logger['info'](_0x5ae4ab[_0x703b('0x24')],_0x703b('0x39'),_0x4a7efc['message']);attachment['create']({'name':path[_0x703b('0x3a')](_0x5ae4ab[_0x703b('0x31')])['name'],'basename':path[_0x703b('0x3a')](_0x5ae4ab[_0x703b('0x31')])[_0x703b('0x25')]+'.pdf','type':_0x703b('0x3b')})[_0x703b('0x3c')](function(_0x514337){faxAccount[_0x703b('0x3d')](_0x524789,{'from':_0x5ae4ab[_0x703b('0x37')],'mapKey':'fax','body':path['parse'](_0x5ae4ab[_0x703b('0x31')])[_0x703b('0x25')]+_0x703b('0x3e'),'AttachmentId':_0x514337['id']})['catch'](function(_0x1046c7){logger[_0x703b('0x3f')](_0x5ae4ab[_0x703b('0x24')],_0x703b('0x40'),JSON[_0x703b('0x41')](_0x1046c7));});})[_0x703b('0x42')](function(_0x29aceb){logger['error'](_0x5ae4ab[_0x703b('0x24')],'\x20receiveFax\x20',JSON[_0x703b('0x41')](_0x29aceb));});});}logger[_0x703b('0x26')](_0x5ae4ab[_0x703b('0x24')],_0x703b('0x43'));}};Fax['prototype']['syncOriginateResponse']=function(_0x148be4){if(this['actions'][_0x148be4[_0x703b('0x24')]]){_['merge'](this[_0x703b('0xe')][_0x148be4[_0x703b('0x24')]],_[_0x703b('0x44')](_0x148be4,[_0x703b('0x45'),_0x703b('0x46')]));}};function updateStatus(_0x4d4f00){if(_0x4d4f00[_0x703b('0x47')]){faxMessage[_0x703b('0x48')](_0x4d4f00[_0x703b('0x47')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x703b('0x3c')](function(_0x54e843){ut[_0x703b('0x49')](_0x703b('0x4a'),_0x54e843);})[_0x703b('0x42')](function(_0x1f4c6e){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x1f4c6e);});}else{ut[_0x703b('0x49')](_0x703b('0x4b'));}}Fax['prototype']['updateStatus']=function(_0x3a6f05,_0x148e7b,_0x5ddb6d){var _0x39a506=this;var _0x1a6d45={};if(_0x148e7b){_0x1a6d45={'read':_0x148e7b};}else{_0x1a6d45={'failMessage':_0x5ddb6d};}if(this[_0x703b('0x28')][_0x3a6f05]['AttachmentId']){faxMessage[_0x703b('0x48')](this[_0x703b('0x28')][_0x3a6f05][_0x703b('0x47')],_0x1a6d45)['then'](function(_0x47dc78){ut[_0x703b('0x49')](_0x703b('0x4c'),_0x47dc78);})[_0x703b('0x42')](function(_0x2cd3f5){ut[_0x703b('0x49')](_0x703b('0x4d'),_0x2cd3f5);})[_0x703b('0x4e')](function(){delete _0x39a506[_0x703b('0xe')][_0x3a6f05];delete _0x39a506['actions'][_0x3a6f05];});}else{ut[_0x703b('0x49')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x3a6f05];delete this[_0x703b('0x28')][_0x3a6f05];}};Fax['prototype'][_0x703b('0x1d')]=function(_0x177a6a){var _0x1d95ed=this;if(this[_0x703b('0xe')][_0x177a6a['uniqueid']]){if(this[_0x703b('0x28')][_0x177a6a['uniqueid']]){this[_0x703b('0xe')][_0x177a6a[_0x703b('0x24')]]['id']=this[_0x703b('0x28')][_0x177a6a['uniqueid']]['id'];this[_0x703b('0xe')][_0x177a6a[_0x703b('0x24')]][_0x703b('0x25')]=this[_0x703b('0x28')][_0x177a6a[_0x703b('0x24')]][_0x703b('0x25')];}logger['info'](_0x177a6a[_0x703b('0x24')],this[_0x703b('0x28')][_0x177a6a[_0x703b('0x24')]]?_0x703b('0x4f'):_0x703b('0x50'),JSON[_0x703b('0x41')](this[_0x703b('0xe')][_0x177a6a[_0x703b('0x24')]]));if(this[_0x703b('0x28')][_0x177a6a[_0x703b('0x24')]]){if(this['channels'][_0x177a6a[_0x703b('0x24')]][_0x703b('0x51')]>0x0&&this[_0x703b('0xe')][_0x177a6a[_0x703b('0x24')]][_0x703b('0x19')]===_0x703b('0x52')){this[_0x703b('0x53')](_0x177a6a[_0x703b('0x24')],!![]);}else{this['updateStatus'](_0x177a6a['uniqueid'],![],this[_0x703b('0xe')][_0x177a6a[_0x703b('0x24')]][_0x703b('0x54')]?_0x703b('0x55')+this['channels'][_0x177a6a[_0x703b('0x24')]][_0x703b('0x54')]:_0x703b('0x56'));}}}};Fax['prototype'][_0x703b('0x57')]=function(_0x46080b){var _0x487980=this;return new BPromise(function(_0x4e1ebc,_0x5c91b3){_0x487980['execOriginate'](_0x46080b,_0x487980['faxAccounts'][_0x46080b['FaxAccountId']])[_0x703b('0x3c')](function(_0xf92480){ut[_0x703b('0x49')](_0x703b('0x58'),_0xf92480);_0x4e1ebc(ut[_0x703b('0x59')]('Fax\x20received'));})[_0x703b('0x42')](function(_0x331b17){ut[_0x703b('0x49')]('[Fax][execOriginate][failure]',_0x331b17);updateStatus(_0x46080b);_0x5c91b3(ut['message'](_0x703b('0x5a')));});});};Fax[_0x703b('0x1f')][_0x703b('0x5b')]=function(_0x433909){var _0x327367=this;return new BPromise(function(_0x34ef4c,_0x5bc9b){var _0x2f867d=_0x327367[_0x703b('0x5c')](_0x327367[_0x703b('0xf')][_0x433909[_0x703b('0x5d')]]['Trunk'],_0x433909);if(_0x2f867d['isValid']){_0x34ef4c(ut[_0x703b('0x59')](_0x703b('0x5e')));}else{_0x5bc9b(ut[_0x703b('0x59')](_0x2f867d[_0x703b('0x59')]));}});};function originate(_0x42b820,_0x9dbc9b,_0x3be41b){return new BPromise(function(_0xc71430,_0x4029d8){if(_0x3be41b){var _0x4fc37d=util['format'](_0x703b('0x5f'),path[_0x703b('0x3a')](_0x42b820['path'])[_0x703b('0x25')],_0x42b820['path']);gs['execute'](_0x4fc37d)['then'](function(){_0x42b820['path']=util[_0x703b('0x60')](_0x703b('0x61'),path['parse'](_0x42b820[_0x703b('0x3')])[_0x703b('0x62')],path[_0x703b('0x3a')](_0x42b820[_0x703b('0x3')])[_0x703b('0x25')]);_0x9dbc9b['XMF-PATH']=_0x42b820[_0x703b('0x3')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x703b('0x63')](ut[_0x703b('0x64')](_0x42b820,_0x9dbc9b))[_0x703b('0x3c')](function(_0x5857b7){_0xc71430(_0x5857b7);})['catch'](function(_0x4bded8){_0x4029d8(_0x4bded8);});})[_0x703b('0x42')](function(_0x4774d9){_0x4029d8(_0x4774d9);});}else{ami['Action'](ut[_0x703b('0x64')](_0x42b820,_0x9dbc9b))['then'](function(_0x5c7fd7){_0xc71430(_0x5c7fd7);})[_0x703b('0x42')](function(_0x9bdcd6){_0x4029d8(_0x9bdcd6);});}});}Fax[_0x703b('0x1f')][_0x703b('0x65')]=function(_0x1bfdd5,_0x482e08){var _0x24a719=this;return new BPromise(function(_0x468f4f,_0x56ed5b){var _0x4eafb1=uuid['v4']();var _0xf3cadc=ut[_0x703b('0x66')](_0x1bfdd5,_0x482e08);_0x24a719['actions'][_0x4eafb1]=new Action(_0x4eafb1,_0x482e08,_0x1bfdd5);var _0x1b183b=_0x24a719['actions'][_0x4eafb1];if(path['parse'](_0x1bfdd5[_0x703b('0x3')])[_0x703b('0x67')]===_0x703b('0x3e')){originate(_0x1b183b,_0xf3cadc,!![])[_0x703b('0x3c')](function(_0x18db4a){_0x468f4f(_0x18db4a);})['catch'](function(_0x2316d8){_0x56ed5b(_0x2316d8);});}else{originate(_0x1b183b,_0xf3cadc,![])[_0x703b('0x3c')](function(_0x478b3c){_0x468f4f(_0x478b3c);})[_0x703b('0x42')](function(_0x6ef78f){_0x56ed5b(_0x6ef78f);});}});};Fax[_0x703b('0x1f')][_0x703b('0x68')]=function(_0x4b14c5){return!_[_0x703b('0x69')](_0x4b14c5)&&!_[_0x703b('0x69')](_0x4b14c5[_0x703b('0x25')])&&!_[_0x703b('0x69')](_0x4b14c5[_0x703b('0x6a')])&&_0x4b14c5[_0x703b('0x6a')]&&!_[_0x703b('0x69')](this['trunks'][util[_0x703b('0x60')](_0x703b('0x6b'),_0x4b14c5['name'])])&&!_[_0x703b('0x69')](this[_0x703b('0x10')][util[_0x703b('0x60')]('SIP/%s',_0x4b14c5[_0x703b('0x25')])][_0x703b('0x30')])&&(this[_0x703b('0x10')][util['format'](_0x703b('0x6b'),_0x4b14c5[_0x703b('0x25')])][_0x703b('0x30')]==='reachable'||this[_0x703b('0x10')][util['format'](_0x703b('0x6b'),_0x4b14c5[_0x703b('0x25')])][_0x703b('0x30')]==='unmonitored');};Fax['prototype'][_0x703b('0x5c')]=function(_0x430c85,_0x30fe41){if(!this[_0x703b('0x68')](_0x430c85)){ut[_0x703b('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x703b('0x69')](_0x430c85)?'':_0x430c85[_0x703b('0x25')]+_0x703b('0x6c'));return{'isValid':![],'message':_0x703b('0x6d')};}if(_[_0x703b('0x69')](_0x30fe41[_0x703b('0x7')])){ut[_0x703b('0x49')](_0x703b('0x6e'),JSON['stringify'](_0x30fe41));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x703b('0x69')](_0x30fe41[_0x703b('0x3')])){ut[_0x703b('0x49')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x703b('0x41')](_0x30fe41));return{'isValid':![],'message':_0x703b('0x6f')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 373d3f5..05a2f75 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 _0x81d8=['error','inspect','resolve','then','notify','catch','util','bluebird','../../../config/logger','preview','lodash'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0x81d8,0x1df));var _0x881d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x81d8[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x881d('0x0'));var BPromise=require(_0x881d('0x1'));var logger=require(_0x881d('0x2'))(_0x881d('0x3'));var _=require(_0x881d('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x166d26){return function(_0x4ddd9e){logger[_0x881d('0x5')](_0x166d26,util[_0x881d('0x6')](_0x4ddd9e,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x1c2377,_0x17e4df){return BPromise[_0x881d('0x7')]()[_0x881d('0x8')](faxAccount[_0x881d('0x9')](_0x1c2377,_0x17e4df))[_0x881d('0xa')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xc5aa=['../rpc/faxAccount','inspect','notify','[Notify]\x20','bluebird','preview','lodash'];(function(_0xa2671e,_0x5707ae){var _0x3c1369=function(_0x552e7c){while(--_0x552e7c){_0xa2671e['push'](_0xa2671e['shift']());}};_0x3c1369(++_0x5707ae);}(_0xc5aa,0x138));var _0xac5a=function(_0x575aa0,_0x222ae2){_0x575aa0=_0x575aa0-0x0;var _0x451559=_0xc5aa[_0x575aa0];return _0x451559;};'use strict';var util=require('util');var BPromise=require(_0xac5a('0x0'));var logger=require('../../../config/logger')(_0xac5a('0x1'));var _=require(_0xac5a('0x2'));var faxAccount=require(_0xac5a('0x3'));function loggerCatch(_0x55a286){return function(_0x18a6ae){logger['error'](_0x55a286,util[_0xac5a('0x4')](_0x18a6ae,{'showHidden':![],'depth':null}));};}exports[_0xac5a('0x5')]=function(_0x16d61a,_0x4a893f){return BPromise['resolve']()['then'](faxAccount[_0xac5a('0x5')](_0x16d61a,_0x4a893f))['catch'](loggerCatch(_0xac5a('0x6')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index cbfe70e..73aa26a 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 _0xcc4f=['\x20Error\x20:','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs'];(function(_0x436bc5,_0x47b676){var _0x3795fc=function(_0x12daa5){while(--_0x12daa5){_0x436bc5['push'](_0x436bc5['shift']());}};_0x3795fc(++_0x47b676);}(_0xcc4f,0x1a5));var _0xfcc4=function(_0x50dba0,_0x919876){_0x50dba0=_0x50dba0-0x0;var _0x42eb35=_0xcc4f[_0x50dba0];return _0x42eb35;};'use strict';var util=require(_0xfcc4('0x0'));var logger=require(_0xfcc4('0x1'))(_0xfcc4('0x2'));var BPromise=require(_0xfcc4('0x3'));var exec=require(_0xfcc4('0x4'))[_0xfcc4('0x5')];exports[_0xfcc4('0x6')]=function(_0x34fccd){return new BPromise(function(_0x57c024,_0x3e6c47){exec(_0x34fccd,function(_0xcc856a,_0x5f369d,_0x4b5355){logger[_0xfcc4('0x7')]('Exec\x20gs',_0x5f369d);if(_0xcc856a){logger[_0xfcc4('0x7')](_0xfcc4('0x8'),_0xfcc4('0x9'),util['inspect'](_0xcc856a,{'showHidden':![],'depth':null}),_0x5f369d,_0x4b5355);_0x3e6c47(_0xcc856a);}_0x57c024(_0x5f369d);});});}; \ No newline at end of file +var _0xae2e=['info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax','bluebird','child_process','exec','execute'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xae2e,0x12f));var _0xeae2=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xae2e[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0xeae2('0x0'));var logger=require(_0xeae2('0x1'))(_0xeae2('0x2'));var BPromise=require(_0xeae2('0x3'));var exec=require(_0xeae2('0x4'))[_0xeae2('0x5')];exports[_0xeae2('0x6')]=function(_0x31c91b){return new BPromise(function(_0x3d7afc,_0x48f6d1){exec(_0x31c91b,function(_0x4ad8da,_0x425622,_0x4b5ef6){logger[_0xeae2('0x7')](_0xeae2('0x8'),_0x425622);if(_0x4ad8da){logger[_0xeae2('0x7')](_0xeae2('0x8'),_0xeae2('0x9'),util['inspect'](_0x4ad8da,{'showHidden':![],'depth':null}),_0x425622,_0x4b5ef6);_0x48f6d1(_0x4ad8da);}_0x3d7afc(_0x425622);});});}; \ 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 44f2210..375fcf5 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 _0xe205=['inspect','addVariables','ecm','maxrate','format','modem','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','headerinfo','localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','info'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xe205,0xa7));var _0x5e20=function(_0x431e61,_0x53c722){_0x431e61=_0x431e61-0x0;var _0x5328e4=_0xe205[_0x431e61];return _0x5328e4;};'use strict';var util=require(_0x5e20('0x0'));var _=require(_0x5e20('0x1'));var moment=require(_0x5e20('0x2'));var logger=require(_0x5e20('0x3'))(_0x5e20('0x4'));exports[_0x5e20('0x5')]=function(_0x13bace){return{'message':_0x13bace};};exports[_0x5e20('0x6')]=function(_0x37c5e9,_0x4ac934){logger[_0x5e20('0x7')](_0x37c5e9,util[_0x5e20('0x8')](_0x4ac934,{'showHidden':![],'depth':null}));};exports[_0x5e20('0x9')]=function(_0x3c4203,_0x5eca5c){var _0x4cc88d={'XMF-ECM':_0x5eca5c[_0x5e20('0xa')],'XMF-HEADERINFO':_0x5eca5c['headerinfo'],'XMF-MINRATE':_0x5eca5c['minrate'],'XMF-MAXRATE':_0x5eca5c[_0x5e20('0xb')],'XMF-MODEM':util[_0x5e20('0xc')]('\x22%s\x22',_0x5eca5c[_0x5e20('0xd')]),'XMF-GATEWAY':_0x5eca5c[_0x5e20('0xe')],'XMF-FAXDETECT':_0x5eca5c[_0x5e20('0xf')],'XMF-T38TIMEOUT':_0x5eca5c[_0x5e20('0x10')],'XMF-LOCALSTATIONID':_0x5eca5c['localstationid'],'XMF-PATH':_0x3c4203[_0x5e20('0x11')]};return _0x4cc88d;};exports[_0x5e20('0x12')]=function(_0x270689,_0x27f1f9){return{'actionid':_0x270689[_0x5e20('0x13')],'action':_0x5e20('0x14'),'channel':_0x270689['channel'],'Exten':_0x5e20('0x15'),'Context':_0x5e20('0x16'),'Priority':'1','callerid':util[_0x5e20('0xc')]('\x22%s\x22\x20<%s>',_0x270689[_0x5e20('0x17')]?_0x270689['headerinfo']:'',_0x270689[_0x5e20('0x18')]),'variable':_0x27f1f9,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x270689['uniqueid']};}; \ No newline at end of file +var _0xe5b5=['maxrate','format','\x22%s\x22','modem','faxdetect','localstationid','path','variablesAction','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate'];(function(_0x27aac,_0x2829ec){var _0x3c7247=function(_0x465cb4){while(--_0x465cb4){_0x27aac['push'](_0x27aac['shift']());}};_0x3c7247(++_0x2829ec);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x7b484,_0x195ad4){_0x7b484=_0x7b484-0x0;var _0x2ae1cf=_0xe5b5[_0x7b484];return _0x2ae1cf;};'use strict';var util=require(_0x5e5b('0x0'));var _=require(_0x5e5b('0x1'));var moment=require(_0x5e5b('0x2'));var logger=require(_0x5e5b('0x3'))(_0x5e5b('0x4'));exports[_0x5e5b('0x5')]=function(_0x33e813){return{'message':_0x33e813};};exports[_0x5e5b('0x6')]=function(_0xf20c6a,_0x20a50c){logger[_0x5e5b('0x7')](_0xf20c6a,util[_0x5e5b('0x8')](_0x20a50c,{'showHidden':![],'depth':null}));};exports[_0x5e5b('0x9')]=function(_0x11e0e0,_0x545eb3){var _0x29db2c={'XMF-ECM':_0x545eb3[_0x5e5b('0xa')],'XMF-HEADERINFO':_0x545eb3[_0x5e5b('0xb')],'XMF-MINRATE':_0x545eb3[_0x5e5b('0xc')],'XMF-MAXRATE':_0x545eb3[_0x5e5b('0xd')],'XMF-MODEM':util[_0x5e5b('0xe')](_0x5e5b('0xf'),_0x545eb3[_0x5e5b('0x10')]),'XMF-GATEWAY':_0x545eb3['gateway'],'XMF-FAXDETECT':_0x545eb3[_0x5e5b('0x11')],'XMF-T38TIMEOUT':_0x545eb3['t38timeout'],'XMF-LOCALSTATIONID':_0x545eb3[_0x5e5b('0x12')],'XMF-PATH':_0x11e0e0[_0x5e5b('0x13')]};return _0x29db2c;};exports[_0x5e5b('0x14')]=function(_0x3f64b6,_0x55c974){return{'actionid':_0x3f64b6['uniqueid'],'action':'originate','channel':_0x3f64b6[_0x5e5b('0x15')],'Exten':_0x5e5b('0x16'),'Context':_0x5e5b('0x17'),'Priority':'1','callerid':util[_0x5e5b('0xe')](_0x5e5b('0x18'),_0x3f64b6[_0x5e5b('0xb')]?_0x3f64b6[_0x5e5b('0xb')]:'',_0x3f64b6['localstationid']),'variable':_0x55c974,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3f64b6[_0x5e5b('0x19')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index a8ffec6..3503528 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 _0xea28=['./rpc/integrations/dynamics365','get','hour','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales'];(function(_0x4121f5,_0x1313be){var _0x58c2e5=function(_0x134e27){while(--_0x134e27){_0x4121f5['push'](_0x4121f5['shift']());}};_0x58c2e5(++_0x1313be);}(_0xea28,0x13a));var _0x8ea2=function(_0x2621e7,_0x5cfd8a){_0x2621e7=_0x2621e7-0x0;var _0x490569=_0xea28[_0x2621e7];return _0x490569;};'use strict';var BPromise=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var server=require(_0x8ea2('0x3'));var Realtime=require(_0x8ea2('0x4'));var Report=require(_0x8ea2('0x5'));var Acw=require(_0x8ea2('0x6'));var Trigger=require(_0x8ea2('0x7'));var Dialer=require('./dialer');var Preview=require(_0x8ea2('0x8'));var Fax=require(_0x8ea2('0x9'));var user=require(_0x8ea2('0xa'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x8ea2('0xb'));var voiceCallReport=require(_0x8ea2('0xc'));var trunk=require(_0x8ea2('0xd'));var trigger=require(_0x8ea2('0xe'));var template=require(_0x8ea2('0xf'));var cmHopperHistory=require(_0x8ea2('0x10'));var campaign=require(_0x8ea2('0x11'));var voiceExtension=require(_0x8ea2('0x12'));var faxAccount=require(_0x8ea2('0x13'));var zendesk=require(_0x8ea2('0x14'));var salesforce=require(_0x8ea2('0x15'));var sugarcrm=require(_0x8ea2('0x16'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x8ea2('0x17'));var vtiger=require(_0x8ea2('0x18'));var freshsales=require(_0x8ea2('0x19'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x8ea2('0x1a'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8ea2('0x1b')](_0x8ea2('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8ea2('0x1b')](_0x8ea2('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x8ea2('0x1d')](user['getAgents']())['then'](realtime[_0x8ea2('0x1e')]())[_0x8ea2('0x1d')](user[_0x8ea2('0x1f')]())[_0x8ea2('0x1d')](realtime[_0x8ea2('0x20')]())[_0x8ea2('0x1d')](trunk[_0x8ea2('0x21')]())[_0x8ea2('0x1d')](realtime[_0x8ea2('0x22')]())[_0x8ea2('0x1d')](voiceQueue[_0x8ea2('0x23')]())[_0x8ea2('0x1d')](realtime[_0x8ea2('0x24')]())[_0x8ea2('0x1d')](trigger[_0x8ea2('0x25')]())[_0x8ea2('0x1d')](realtime[_0x8ea2('0x26')]())[_0x8ea2('0x1d')](template[_0x8ea2('0x27')]())[_0x8ea2('0x1d')](realtime[_0x8ea2('0x28')]())[_0x8ea2('0x1d')](zendesk['getZendeskAccounts']())['then'](realtime[_0x8ea2('0x29')]())[_0x8ea2('0x1d')](salesforce[_0x8ea2('0x2a')]())['then'](realtime[_0x8ea2('0x2b')]())[_0x8ea2('0x1d')](sugarcrm['getSugarcrmAccounts']())[_0x8ea2('0x1d')](realtime[_0x8ea2('0x2c')]())[_0x8ea2('0x1d')](freshdesk[_0x8ea2('0x2d')]())[_0x8ea2('0x1d')](realtime[_0x8ea2('0x2e')]())[_0x8ea2('0x1d')](desk[_0x8ea2('0x2f')]())[_0x8ea2('0x1d')](realtime['initDeskAccounts']())[_0x8ea2('0x1d')](zoho['getZohoAccounts']())[_0x8ea2('0x1d')](realtime[_0x8ea2('0x30')]())[_0x8ea2('0x1d')](vtiger['getVtigerAccounts']())['then'](realtime[_0x8ea2('0x31')]())['then'](freshsales[_0x8ea2('0x32')]())['then'](realtime[_0x8ea2('0x33')]())[_0x8ea2('0x1d')](servicenow[_0x8ea2('0x34')]())[_0x8ea2('0x1d')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x8ea2('0x35')]())['then'](realtime[_0x8ea2('0x36')]())[_0x8ea2('0x1d')](campaign[_0x8ea2('0x37')]())[_0x8ea2('0x1d')](realtime[_0x8ea2('0x38')]())[_0x8ea2('0x1d')](voiceExtension[_0x8ea2('0x39')]())[_0x8ea2('0x1d')](realtime[_0x8ea2('0x3a')]())[_0x8ea2('0x1d')](faxAccount['getFaxAccounts']())['then'](realtime[_0x8ea2('0x3b')]())[_0x8ea2('0x1d')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0x8ea2('0x3c')]())['then'](realtime[_0x8ea2('0x3d')]())[_0x8ea2('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x8ea2('0x1d')](realtime[_0x8ea2('0x3e')]())[_0x8ea2('0x1d')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime['initCampaignHopperHistory']())[_0x8ea2('0x1d')](voiceCallReport[_0x8ea2('0x3f')]())[_0x8ea2('0x1d')](realtime['initVoiceCallReports']())[_0x8ea2('0x1d')](function(_0x391b08){})[_0x8ea2('0x40')](function(_0x278e5d){console[_0x8ea2('0x41')](_0x278e5d);});}function main(){return server[_0x8ea2('0x42')](realtime,preview,fax)[_0x8ea2('0x1d')](function(_0x1fc76a){return initRealtime();})['then'](function(){return initParams();})[_0x8ea2('0x1d')](function(){report[_0x8ea2('0x43')]();setInterval(initRealtime,0x1388);})[_0x8ea2('0x40')](function(_0x467d97){console['log'](_0x467d97);});}main(); \ No newline at end of file +var _0x9354=['getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','log','sync','catch','util','moment','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/freshsales','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts'];(function(_0x18657d,_0x4b81aa){var _0x1ee78e=function(_0xb7167e){while(--_0xb7167e){_0x18657d['push'](_0x18657d['shift']());}};_0x1ee78e(++_0x4b81aa);}(_0x9354,0x96));var _0x4935=function(_0x51f2c0,_0xb7c46e){_0x51f2c0=_0x51f2c0-0x0;var _0x34ffd5=_0x9354[_0x51f2c0];return _0x34ffd5;};'use strict';var BPromise=require('bluebird');var util=require(_0x4935('0x0'));var moment=require(_0x4935('0x1'));var server=require('./server');var Realtime=require(_0x4935('0x2'));var Report=require(_0x4935('0x3'));var Acw=require(_0x4935('0x4'));var Trigger=require(_0x4935('0x5'));var Dialer=require('./dialer');var Preview=require(_0x4935('0x6'));var Fax=require(_0x4935('0x7'));var user=require(_0x4935('0x8'));var voiceQueue=require(_0x4935('0x9'));var voiceQueueReport=require(_0x4935('0xa'));var voiceCallReport=require(_0x4935('0xb'));var trunk=require(_0x4935('0xc'));var trigger=require(_0x4935('0xd'));var template=require(_0x4935('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x4935('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x4935('0x10'));var zendesk=require(_0x4935('0x11'));var salesforce=require(_0x4935('0x12'));var sugarcrm=require(_0x4935('0x13'));var freshdesk=require(_0x4935('0x14'));var desk=require(_0x4935('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x4935('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x4935('0x17')](_0x4935('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x4935('0x17')](_0x4935('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x4935('0x19')]()[_0x4935('0x1a')](user[_0x4935('0x1b')]())[_0x4935('0x1a')](realtime[_0x4935('0x1c')]())[_0x4935('0x1a')](user[_0x4935('0x1d')]())[_0x4935('0x1a')](realtime[_0x4935('0x1e')]())[_0x4935('0x1a')](trunk[_0x4935('0x1f')]())[_0x4935('0x1a')](realtime['initTrunks']())[_0x4935('0x1a')](voiceQueue[_0x4935('0x20')]())[_0x4935('0x1a')](realtime[_0x4935('0x21')]())[_0x4935('0x1a')](trigger[_0x4935('0x22')]())['then'](realtime[_0x4935('0x23')]())[_0x4935('0x1a')](template['getTemplates']())[_0x4935('0x1a')](realtime[_0x4935('0x24')]())[_0x4935('0x1a')](zendesk['getZendeskAccounts']())['then'](realtime[_0x4935('0x25')]())[_0x4935('0x1a')](salesforce[_0x4935('0x26')]())[_0x4935('0x1a')](realtime[_0x4935('0x27')]())[_0x4935('0x1a')](sugarcrm[_0x4935('0x28')]())[_0x4935('0x1a')](realtime['initSugarcrmAccounts']())[_0x4935('0x1a')](freshdesk[_0x4935('0x29')]())[_0x4935('0x1a')](realtime[_0x4935('0x2a')]())[_0x4935('0x1a')](desk['getDeskAccounts']())['then'](realtime[_0x4935('0x2b')]())[_0x4935('0x1a')](zoho[_0x4935('0x2c')]())[_0x4935('0x1a')](realtime[_0x4935('0x2d')]())[_0x4935('0x1a')](vtiger[_0x4935('0x2e')]())[_0x4935('0x1a')](realtime[_0x4935('0x2f')]())[_0x4935('0x1a')](freshsales[_0x4935('0x30')]())[_0x4935('0x1a')](realtime[_0x4935('0x31')]())[_0x4935('0x1a')](servicenow[_0x4935('0x32')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0x4935('0x33')]())[_0x4935('0x1a')](realtime['initDynamics365Accounts']())[_0x4935('0x1a')](campaign[_0x4935('0x34')]())[_0x4935('0x1a')](realtime[_0x4935('0x35')]())[_0x4935('0x1a')](voiceExtension[_0x4935('0x36')]())[_0x4935('0x1a')](realtime[_0x4935('0x37')]())['then'](faxAccount[_0x4935('0x38')]())[_0x4935('0x1a')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x4935('0x19')]()['then'](voiceQueueReport[_0x4935('0x39')]())[_0x4935('0x1a')](realtime[_0x4935('0x3a')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x4935('0x1a')](realtime[_0x4935('0x3b')]())['then'](cmHopperHistory[_0x4935('0x3c')]())[_0x4935('0x1a')](realtime[_0x4935('0x3d')]())[_0x4935('0x1a')](voiceCallReport[_0x4935('0x3e')]())['then'](realtime['initVoiceCallReports']())[_0x4935('0x1a')](function(_0x1016cc){})['catch'](function(_0x4945a7){console[_0x4935('0x3f')](_0x4945a7);});}function main(){return server['listen'](realtime,preview,fax)[_0x4935('0x1a')](function(_0x3f32fb){return initRealtime();})[_0x4935('0x1a')](function(){return initParams();})[_0x4935('0x1a')](function(){report[_0x4935('0x40')]();setInterval(initRealtime,0x1388);})[_0x4935('0x41')](function(_0x4d1d1c){console[_0x4935('0x3f')](_0x4d1d1c);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index cbc79b5..9ccd07b 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 _0x654b=['socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','updateStatusRealtime','state','toLowerCase','not_inuse','inuse','talking','statePause','toNumber','voiceStatus','format','user:%s','emit','user:save','user:presence','exports','lodash','moment','ioredis','../../../config/environment','redis','localhost'];(function(_0x170663,_0x4d8d30){var _0x4e8bf6=function(_0x109dc7){while(--_0x109dc7){_0x170663['push'](_0x170663['shift']());}};_0x4e8bf6(++_0x4d8d30);}(_0x654b,0x180));var _0xb654=function(_0x2f7231,_0x20670d){_0x2f7231=_0x2f7231-0x0;var _0x1a9d86=_0x654b[_0x2f7231];return _0x1a9d86;};'use strict';var _=require(_0xb654('0x0'));var util=require('util');var moment=require(_0xb654('0x1'));var md5=require('md5');var Redis=require(_0xb654('0x2'));var config=require(_0xb654('0x3'));config['redis']=_['defaults'](config[_0xb654('0x4')],{'host':_0xb654('0x5'),'port':0x18eb});var io=require(_0xb654('0x6'))(new Redis(config[_0xb654('0x4')]));function Agent(_0x49dcfa){this['id']=_0x49dcfa['id']||0x0;this[_0xb654('0x7')]=_0x49dcfa[_0xb654('0x7')]||'';this[_0xb654('0x8')]=_0x49dcfa[_0xb654('0x8')]||'';this[_0xb654('0x9')]=_0x49dcfa[_0xb654('0x9')]||'';this[_0xb654('0xa')]=_0x49dcfa[_0xb654('0xa')]||'';this['state']=_0xb654('0xb');this[_0xb654('0xc')]=0x0;this[_0xb654('0xd')]='unknown';this[_0xb654('0xe')]='';this['phone']='';this[_0xb654('0xf')]='';this[_0xb654('0x10')]='';this[_0xb654('0x11')]=_0x49dcfa[_0xb654('0x11')]||![];this['voiceStatus']='unknown';this[_0xb654('0x12')]=0x0;this[_0xb654('0x13')]='';this[_0xb654('0x14')]='';this[_0xb654('0x15')]=![];this[_0xb654('0x16')]=![];this[_0xb654('0x17')]='';}Agent['prototype'][_0xb654('0x18')]=function(_0x5350f5){var _0x59f4be;if(_0x5350f5&&_0x5350f5[_0xb654('0x19')]){_0x59f4be=_0x5350f5[_0xb654('0x19')][_0xb654('0x1a')]();switch(_0x59f4be){case _0xb654('0x1b'):_0x59f4be='idle';break;case _0xb654('0x1c'):_0x59f4be=_0xb654('0x1d');break;}}if(_0x59f4be&&this['voiceStatus']!==_0x59f4be||_0x5350f5[_0xb654('0x1e')]){this[_0xb654('0x12')]=_[_0xb654('0x1f')](moment()['format']('x'));}if(_0x59f4be){this[_0xb654('0x20')]=_0x59f4be;}var _0x5e503d={'id':this['id'],'name':this[_0xb654('0x7')],'email':this['email'],'accountcode':this[_0xb654('0x9')],'fullname':this['fullname'],'state':this[_0xb654('0x19')],'stateTime':this[_0xb654('0xc')],'status':this[_0xb654('0xd')],'address':this[_0xb654('0xe')],'online':this[_0xb654('0x11')],'voiceStatus':this[_0xb654('0x20')],'voiceStatusTime':this[_0xb654('0x12')],'voiceStatusCallerIdNumber':this[_0xb654('0x13')],'voiceStatusQueue':this[_0xb654('0x14')],'interface':this[_0xb654('0x10')],'onhold':this[_0xb654('0x15')]};var _0x593dcc=md5(JSON['stringify'](_0x5e503d));if(this[_0xb654('0x17')]!==_0x593dcc){this[_0xb654('0x17')]=_0x593dcc;io['to'](util[_0xb654('0x21')](_0xb654('0x22'),_0x5e503d[_0xb654('0x7')]))[_0xb654('0x23')](_0xb654('0x24'),_0x5e503d);io[_0xb654('0x23')](_0xb654('0x25'),_0x5e503d);}};module[_0xb654('0x26')]=Agent; \ No newline at end of file +var _0x92d8=['onhold','prototype','updateStatusRealtime','toLowerCase','idle','inuse','talking','statePause','format','voiceStatusQueue','stringify','emit','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber'];(function(_0x2ea224,_0x687f58){var _0xe7375=function(_0x418951){while(--_0x418951){_0x2ea224['push'](_0x2ea224['shift']());}};_0xe7375(++_0x687f58);}(_0x92d8,0xcb));var _0x892d=function(_0xa1e664,_0x35cb49){_0xa1e664=_0xa1e664-0x0;var _0xbfdb4d=_0x92d8[_0xa1e664];return _0xbfdb4d;};'use strict';var _=require(_0x892d('0x0'));var util=require(_0x892d('0x1'));var moment=require(_0x892d('0x2'));var md5=require(_0x892d('0x3'));var Redis=require(_0x892d('0x4'));var config=require(_0x892d('0x5'));config[_0x892d('0x6')]=_[_0x892d('0x7')](config[_0x892d('0x6')],{'host':_0x892d('0x8'),'port':0x18eb});var io=require(_0x892d('0x9'))(new Redis(config[_0x892d('0x6')]));function Agent(_0x1a53a8){this['id']=_0x1a53a8['id']||0x0;this['name']=_0x1a53a8[_0x892d('0xa')]||'';this[_0x892d('0xb')]=_0x1a53a8[_0x892d('0xb')]||'';this[_0x892d('0xc')]=_0x1a53a8[_0x892d('0xc')]||'';this[_0x892d('0xd')]=_0x1a53a8['fullname']||'';this[_0x892d('0xe')]=_0x892d('0xf');this[_0x892d('0x10')]=0x0;this[_0x892d('0x11')]=_0x892d('0xf');this[_0x892d('0x12')]='';this['phone']='';this[_0x892d('0x13')]='';this[_0x892d('0x14')]='';this['online']=_0x1a53a8[_0x892d('0x15')]||![];this[_0x892d('0x16')]=_0x892d('0xf');this[_0x892d('0x17')]=0x0;this[_0x892d('0x18')]='';this['voiceStatusQueue']='';this[_0x892d('0x19')]=![];this['local']=![];this['md5']='';}Agent[_0x892d('0x1a')][_0x892d('0x1b')]=function(_0x242083){var _0x51b9ce;if(_0x242083&&_0x242083[_0x892d('0xe')]){_0x51b9ce=_0x242083[_0x892d('0xe')][_0x892d('0x1c')]();switch(_0x51b9ce){case'not_inuse':_0x51b9ce=_0x892d('0x1d');break;case _0x892d('0x1e'):_0x51b9ce=_0x892d('0x1f');break;}}if(_0x51b9ce&&this[_0x892d('0x16')]!==_0x51b9ce||_0x242083[_0x892d('0x20')]){this['voiceStatusTime']=_['toNumber'](moment()[_0x892d('0x21')]('x'));}if(_0x51b9ce){this[_0x892d('0x16')]=_0x51b9ce;}var _0x5194da={'id':this['id'],'name':this[_0x892d('0xa')],'email':this[_0x892d('0xb')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x892d('0xe')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0x892d('0x12')],'online':this[_0x892d('0x15')],'voiceStatus':this[_0x892d('0x16')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x892d('0x18')],'voiceStatusQueue':this[_0x892d('0x22')],'interface':this[_0x892d('0x14')],'onhold':this['onhold']};var _0x221c79=md5(JSON[_0x892d('0x23')](_0x5194da));if(this[_0x892d('0x3')]!==_0x221c79){this[_0x892d('0x3')]=_0x221c79;io['to'](util[_0x892d('0x21')]('user:%s',_0x5194da[_0x892d('0xa')]))[_0x892d('0x24')]('user:save',_0x5194da);io['emit']('user:presence',_0x5194da);}};module[_0x892d('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 0ba61cb..eb8ed41 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 _0xd53f=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0xd53f,0x131));var _0xfd53=function(_0x355da3,_0x64dc57){_0x355da3=_0x355da3-0x0;var _0x505465=_0xd53f[_0x355da3];return _0x505465;};'use strict';function Campaign(_0x367180){this['id']=_0x367180['id']||0x0;this[_0xfd53('0x0')]=_0x367180[_0xfd53('0x0')]||'';this['type']=_0x367180[_0xfd53('0x1')]||_0xfd53('0x2');this['originated']=0x0;this[_0xfd53('0x3')]=0x0;this[_0xfd53('0x4')]=0x0;this[_0xfd53('0x5')]=0x0;this[_0xfd53('0x6')]='';this[_0xfd53('0x7')]=!![];this['active']=_0x367180[_0xfd53('0x8')];this['limitCalls']=_0x367180[_0xfd53('0x9')];this['dialTimezone']=_0x367180[_0xfd53('0xa')]||null;this['dialGlobalInterval']=_0x367180[_0xfd53('0xb')]?_0x367180['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x367180[_0xfd53('0xc')];this['dialOriginateCallerIdNumber']=_0x367180[_0xfd53('0xd')];this[_0xfd53('0xe')]=_0x367180[_0xfd53('0xe')]||0x1e;this[_0xfd53('0xf')]=_0x367180['dialCongestionMaxRetry'];this[_0xfd53('0x10')]=_0x367180[_0xfd53('0x10')];this['dialBusyMaxRetry']=_0x367180['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x367180[_0xfd53('0x11')];this[_0xfd53('0x12')]=_0x367180[_0xfd53('0x12')];this[_0xfd53('0x13')]=_0x367180[_0xfd53('0x13')];this[_0xfd53('0x14')]=_0x367180[_0xfd53('0x14')];this[_0xfd53('0x15')]=_0x367180[_0xfd53('0x15')]||0x3;this[_0xfd53('0x16')]=_0x367180[_0xfd53('0x16')]||0x96;this[_0xfd53('0x17')]=_0x367180['dialDropMaxRetry']||0x3;this[_0xfd53('0x18')]=_0x367180[_0xfd53('0x18')]||0x96;this[_0xfd53('0x19')]=_0x367180['dialAbandonedMaxRetry']||0x3;this[_0xfd53('0x1a')]=_0x367180['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x367180[_0xfd53('0x1b')]||0x3;this[_0xfd53('0x1c')]=_0x367180['dialMachineRetryFrequency']||0x96;this[_0xfd53('0x1d')]=_0x367180['dialAgentRejectMaxRetry']||0x3;this[_0xfd53('0x1e')]=_0x367180[_0xfd53('0x1e')]||0x96;this['dialOrderByScheduledAt']=_0x367180[_0xfd53('0x1f')]||_0xfd53('0x20');this['dialPrefix']=_0x367180[_0xfd53('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x367180[_0xfd53('0x22')]||undefined;this[_0xfd53('0x23')]=_0x367180[_0xfd53('0x23')]||undefined;this[_0xfd53('0x24')]=_0x367180[_0xfd53('0x24')]?_0x367180[_0xfd53('0x24')]:undefined;this[_0xfd53('0x25')]=_0x367180[_0xfd53('0x25')]?_0x367180['Trunk']:undefined;this[_0xfd53('0x26')]=_0x367180[_0xfd53('0x26')]?_0x367180[_0xfd53('0x26')]:undefined;this[_0xfd53('0x27')]=_0x367180[_0xfd53('0x27')]?_0x367180[_0xfd53('0x27')]:undefined;this[_0xfd53('0x28')]=_0x367180[_0xfd53('0x27')]?_0x367180[_0xfd53('0x27')][_0xfd53('0x0')]:undefined;this['dialAMDActive']=_0x367180[_0xfd53('0x29')]||![];this[_0xfd53('0x2a')]=_0x367180[_0xfd53('0x2a')];this[_0xfd53('0x2b')]=_0x367180['dialAMDGreeting'];this[_0xfd53('0x2c')]=_0x367180[_0xfd53('0x2c')];this[_0xfd53('0x2d')]=_0x367180[_0xfd53('0x2d')];this[_0xfd53('0x2e')]=_0x367180[_0xfd53('0x2e')];this[_0xfd53('0x2f')]=_0x367180[_0xfd53('0x2f')];this[_0xfd53('0x30')]=_0x367180[_0xfd53('0x30')];this[_0xfd53('0x31')]=_0x367180[_0xfd53('0x31')];this[_0xfd53('0x32')]=_0x367180[_0xfd53('0x32')];}module[_0xfd53('0x33')]=Campaign; \ No newline at end of file +var _0x643f=['temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated'];(function(_0x3fd41c,_0x311d8c){var _0x1074cf=function(_0x2ecb81){while(--_0x2ecb81){_0x3fd41c['push'](_0x3fd41c['shift']());}};_0x1074cf(++_0x311d8c);}(_0x643f,0x1e6));var _0xf643=function(_0x418fa3,_0x464468){_0x418fa3=_0x418fa3-0x0;var _0x845083=_0x643f[_0x418fa3];return _0x845083;};'use strict';function Campaign(_0x45e171){this['id']=_0x45e171['id']||0x0;this[_0xf643('0x0')]=_0x45e171['name']||'';this['type']=_0x45e171[_0xf643('0x1')]||_0xf643('0x2');this[_0xf643('0x3')]=0x0;this[_0xf643('0x4')]=0x0;this[_0xf643('0x5')]=0x0;this[_0xf643('0x6')]=0x0;this[_0xf643('0x7')]='';this['sendMessageOneNotActive']=!![];this[_0xf643('0x8')]=_0x45e171[_0xf643('0x8')];this['limitCalls']=_0x45e171['limitCalls'];this[_0xf643('0x9')]=_0x45e171[_0xf643('0x9')]||null;this[_0xf643('0xa')]=_0x45e171['dialGlobalInterval']?_0x45e171[_0xf643('0xa')]:null;this[_0xf643('0xb')]=_0x45e171[_0xf643('0xb')];this[_0xf643('0xc')]=_0x45e171[_0xf643('0xc')];this[_0xf643('0xd')]=_0x45e171[_0xf643('0xd')]||0x1e;this[_0xf643('0xe')]=_0x45e171[_0xf643('0xe')];this[_0xf643('0xf')]=_0x45e171[_0xf643('0xf')];this['dialBusyMaxRetry']=_0x45e171['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x45e171['dialBusyRetryFrequency'];this[_0xf643('0x10')]=_0x45e171['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x45e171[_0xf643('0x11')];this[_0xf643('0x12')]=_0x45e171['dialGlobalMaxRetry'];this[_0xf643('0x13')]=_0x45e171[_0xf643('0x13')]||0x3;this[_0xf643('0x14')]=_0x45e171[_0xf643('0x14')]||0x96;this[_0xf643('0x15')]=_0x45e171[_0xf643('0x15')]||0x3;this[_0xf643('0x16')]=_0x45e171[_0xf643('0x16')]||0x96;this[_0xf643('0x17')]=_0x45e171[_0xf643('0x17')]||0x3;this[_0xf643('0x18')]=_0x45e171['dialAbandonedRetryFrequency']||0x96;this[_0xf643('0x19')]=_0x45e171[_0xf643('0x19')]||0x3;this['dialMachineRetryFrequency']=_0x45e171[_0xf643('0x1a')]||0x96;this[_0xf643('0x1b')]=_0x45e171[_0xf643('0x1b')]||0x3;this[_0xf643('0x1c')]=_0x45e171[_0xf643('0x1c')]||0x96;this[_0xf643('0x1d')]=_0x45e171[_0xf643('0x1d')]||'DESC';this[_0xf643('0x1e')]=_0x45e171[_0xf643('0x1e')]||undefined;this[_0xf643('0x1f')]=_0x45e171[_0xf643('0x1f')]||undefined;this['dialCutDigit']=_0x45e171[_0xf643('0x20')]||undefined;this[_0xf643('0x21')]=_0x45e171[_0xf643('0x21')]?_0x45e171[_0xf643('0x21')]:undefined;this[_0xf643('0x22')]=_0x45e171[_0xf643('0x22')]?_0x45e171[_0xf643('0x22')]:undefined;this[_0xf643('0x23')]=_0x45e171[_0xf643('0x23')]?_0x45e171[_0xf643('0x23')]:undefined;this[_0xf643('0x24')]=_0x45e171[_0xf643('0x24')]?_0x45e171[_0xf643('0x24')]:undefined;this[_0xf643('0x25')]=_0x45e171[_0xf643('0x24')]?_0x45e171[_0xf643('0x24')]['name']:undefined;this[_0xf643('0x26')]=_0x45e171[_0xf643('0x26')]||![];this['dialAMDInitialSilence']=_0x45e171[_0xf643('0x27')];this[_0xf643('0x28')]=_0x45e171[_0xf643('0x28')];this[_0xf643('0x29')]=_0x45e171['dialAMDAfterGreetingSilence'];this[_0xf643('0x2a')]=_0x45e171[_0xf643('0x2a')];this[_0xf643('0x2b')]=_0x45e171[_0xf643('0x2b')];this['dialAMDBetweenWordsSilence']=_0x45e171[_0xf643('0x2c')];this[_0xf643('0x2d')]=_0x45e171[_0xf643('0x2d')];this[_0xf643('0x2e')]=_0x45e171[_0xf643('0x2e')];this[_0xf643('0x2f')]=_0x45e171[_0xf643('0x2f')];}module[_0xf643('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index bcbd97a..28a89b2 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 _0x9795=['transferType','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','exten','answered','answertime','unmanaged','duration','billableseconds','holdtime','type','disposition','monitorFilename','queue','monitors','transfercalleridnum'];(function(_0x112ee7,_0x1bb108){var _0x5d6d71=function(_0x557792){while(--_0x557792){_0x112ee7['push'](_0x112ee7['shift']());}};_0x5d6d71(++_0x1bb108);}(_0x9795,0x1e3));var _0x5979=function(_0x5bb65b,_0x2b4ee9){_0x5bb65b=_0x5bb65b-0x0;var _0x3332f9=_0x9795[_0x5bb65b];return _0x3332f9;};'use strict';function Channel(){this[_0x5979('0x0')]=null;this['channel']='';this[_0x5979('0x1')]='';this[_0x5979('0x2')]=0x0;this[_0x5979('0x3')]='';this[_0x5979('0x4')]=undefined;this[_0x5979('0x5')]=undefined;this[_0x5979('0x6')]=0x0;this[_0x5979('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x5979('0x8')]=0x0;this[_0x5979('0x9')]=![];this[_0x5979('0xa')]=null;this['endtime']=null;this[_0x5979('0xb')]=![];this['abandoned']=![];this['lastapplication']='';this['lastdata']='';this[_0x5979('0xc')]=0x0;this[_0x5979('0xd')]=0x0;this[_0x5979('0xe')]=0x0;this[_0x5979('0xf')]=null;this['tag']=null;this[_0x5979('0x10')]=null;this['monitor']=![];this[_0x5979('0x11')]=null;this[_0x5979('0x12')]=null;this[_0x5979('0x13')]=[];this[_0x5979('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x5979('0x15')]=undefined;this[_0x5979('0x16')]=0x0;}module[_0x5979('0x17')]=Channel; \ No newline at end of file +var _0x9e04=['transferconnectedlinenum','exports','starttime','channel','calleridnum','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','duration','holdtime','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum'];(function(_0x333fbf,_0x365fe8){var _0x2daaa6=function(_0x29c404){while(--_0x29c404){_0x333fbf['push'](_0x333fbf['shift']());}};_0x2daaa6(++_0x365fe8);}(_0x9e04,0x9e));var _0x49e0=function(_0x4a8358,_0x2f9460){_0x4a8358=_0x4a8358-0x0;var _0x5e2709=_0x9e04[_0x4a8358];return _0x5e2709;};'use strict';function Channel(){this[_0x49e0('0x0')]=null;this[_0x49e0('0x1')]='';this['destinationchannel']='';this[_0x49e0('0x2')]=0x0;this[_0x49e0('0x3')]='';this[_0x49e0('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x49e0('0x5')]=0x0;this[_0x49e0('0x6')]='';this[_0x49e0('0x7')]=0x0;this[_0x49e0('0x8')]=0x0;this[_0x49e0('0x9')]=0x0;this[_0x49e0('0xa')]=![];this[_0x49e0('0xb')]=null;this[_0x49e0('0xc')]=null;this[_0x49e0('0xd')]=![];this[_0x49e0('0xe')]=![];this['lastapplication']='';this['lastdata']='';this[_0x49e0('0xf')]=0x0;this['billableseconds']=0x0;this[_0x49e0('0x10')]=0x0;this['type']=null;this[_0x49e0('0x11')]=null;this[_0x49e0('0x12')]=null;this[_0x49e0('0x13')]=![];this[_0x49e0('0x14')]=null;this[_0x49e0('0x15')]=null;this[_0x49e0('0x16')]=[];this[_0x49e0('0x17')]=undefined;this[_0x49e0('0x18')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0x49e0('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 30db82c..0201fcc 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 _0x9b2a=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x9b2a,0x127));var _0xa9b2=function(_0x123afd,_0xe709aa){_0x123afd=_0x123afd-0x0;var _0x1f0256=_0x9b2a[_0x123afd];return _0x1f0256;};'use strict';function DeskAccount(_0x19fd42){this['id']=_0x19fd42['id']||0x0;this['name']=_0x19fd42[_0xa9b2('0x0')]||'';this[_0xa9b2('0x1')]=_0x19fd42[_0xa9b2('0x1')]||'';this['remoteUri']=_0x19fd42[_0xa9b2('0x2')]||'';this[_0xa9b2('0x3')]=_0x19fd42['authType']||'';this['password']=_0x19fd42[_0xa9b2('0x4')]||'';this[_0xa9b2('0x5')]=_0x19fd42[_0xa9b2('0x5')]||'';this[_0xa9b2('0x6')]=_0x19fd42['consumerSecret']||'';this[_0xa9b2('0x7')]=_0x19fd42[_0xa9b2('0x7')]||'';this[_0xa9b2('0x8')]=_0x19fd42['tokenSecret']||'';this[_0xa9b2('0x9')]=_0x19fd42[_0xa9b2('0x9')]||'';this[_0xa9b2('0xa')]=_0x19fd42[_0xa9b2('0xa')]||'';this[_0xa9b2('0xb')]=_0x19fd42[_0xa9b2('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x5b5a=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x44601e,_0xdda273){var _0x44b89f=function(_0xa0fdfa){while(--_0xa0fdfa){_0x44601e['push'](_0x44601e['shift']());}};_0x44b89f(++_0xdda273);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x19e9a7,_0x57e686){_0x19e9a7=_0x19e9a7-0x0;var _0x3a8442=_0x5b5a[_0x19e9a7];return _0x3a8442;};'use strict';function DeskAccount(_0x3fdff1){this['id']=_0x3fdff1['id']||0x0;this[_0xa5b5('0x0')]=_0x3fdff1[_0xa5b5('0x0')]||'';this['username']=_0x3fdff1[_0xa5b5('0x1')]||'';this[_0xa5b5('0x2')]=_0x3fdff1[_0xa5b5('0x2')]||'';this[_0xa5b5('0x3')]=_0x3fdff1[_0xa5b5('0x3')]||'';this[_0xa5b5('0x4')]=_0x3fdff1[_0xa5b5('0x4')]||'';this[_0xa5b5('0x5')]=_0x3fdff1['consumerKey']||'';this[_0xa5b5('0x6')]=_0x3fdff1[_0xa5b5('0x6')]||'';this['token']=_0x3fdff1[_0xa5b5('0x7')]||'';this[_0xa5b5('0x8')]=_0x3fdff1[_0xa5b5('0x8')]||'';this[_0xa5b5('0x9')]=_0x3fdff1[_0xa5b5('0x9')]||'';this[_0xa5b5('0xa')]=_0x3fdff1[_0xa5b5('0xa')]||'';this[_0xa5b5('0xb')]=_0x3fdff1[_0xa5b5('0xb')]||{};}module[_0xa5b5('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 45e72a2..85de722 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 _0xd72d=['clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId'];(function(_0x55d8bb,_0x16bef2){var _0x35fe26=function(_0x13d53f){while(--_0x13d53f){_0x55d8bb['push'](_0x55d8bb['shift']());}};_0x35fe26(++_0x16bef2);}(_0xd72d,0x19e));var _0xdd72=function(_0x5c4247,_0x45b96e){_0x5c4247=_0x5c4247-0x0;var _0x95879a=_0xd72d[_0x5c4247];return _0x95879a;};'use strict';function Dynamics365Account(_0x1c931b){this['id']=_0x1c931b['id']||0x0;this[_0xdd72('0x0')]=_0x1c931b['name']||'';this[_0xdd72('0x1')]=_0x1c931b['username']||'';this[_0xdd72('0x2')]=_0x1c931b['password']||'';this['remoteUri']=_0x1c931b[_0xdd72('0x3')]||'';this[_0xdd72('0x4')]=_0x1c931b[_0xdd72('0x4')]||'';this[_0xdd72('0x5')]=_0x1c931b[_0xdd72('0x5')]||'';this[_0xdd72('0x6')]=_0x1c931b[_0xdd72('0x6')]||{};this[_0xdd72('0x7')]=_0x1c931b['serverUrl']||'';this[_0xdd72('0x8')]=_0x1c931b[_0xdd72('0x8')]||{};}module[_0xdd72('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xa94a=['name','username','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x241b27,_0x755b3b){var _0x17e5de=function(_0x309e35){while(--_0x309e35){_0x241b27['push'](_0x241b27['shift']());}};_0x17e5de(++_0x755b3b);}(_0xa94a,0xfc));var _0xaa94=function(_0xd36d27,_0x278208){_0xd36d27=_0xd36d27-0x0;var _0x10cef5=_0xa94a[_0xd36d27];return _0x10cef5;};'use strict';function Dynamics365Account(_0x53bedb){this['id']=_0x53bedb['id']||0x0;this['name']=_0x53bedb[_0xaa94('0x0')]||'';this[_0xaa94('0x1')]=_0x53bedb[_0xaa94('0x1')]||'';this['password']=_0x53bedb['password']||'';this[_0xaa94('0x2')]=_0x53bedb['remoteUri']||'';this[_0xaa94('0x3')]=_0x53bedb['tenantId']||'';this[_0xaa94('0x4')]=_0x53bedb[_0xaa94('0x4')]||'';this[_0xaa94('0x5')]=_0x53bedb[_0xaa94('0x5')]||{};this[_0xaa94('0x6')]=_0x53bedb[_0xaa94('0x6')]||'';this['Configurations']=_0x53bedb['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index ec671f6..bd43234 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 _0xf590=['localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x37affd,_0x53e54d){var _0x5c385a=function(_0x246e90){while(--_0x246e90){_0x37affd['push'](_0x37affd['shift']());}};_0x5c385a(++_0x53e54d);}(_0xf590,0x1e2));var _0x0f59=function(_0x1fa274,_0x27a51f){_0x1fa274=_0x1fa274-0x0;var _0x5601e0=_0xf590[_0x1fa274];return _0x5601e0;};'use strict';function FaxAccount(_0x1d2745){this['id']=_0x1d2745['id']||0x0;this['name']=_0x1d2745[_0x0f59('0x0')]||'';this['description']=_0x1d2745[_0x0f59('0x1')];this[_0x0f59('0x2')]=_0x1d2745[_0x0f59('0x2')];this[_0x0f59('0x3')]=_0x1d2745[_0x0f59('0x3')];this[_0x0f59('0x4')]=_0x1d2745[_0x0f59('0x4')];this[_0x0f59('0x5')]=_0x1d2745['minrate']||0x960;this[_0x0f59('0x6')]=_0x1d2745[_0x0f59('0x6')]||0x3840;this[_0x0f59('0x7')]=_0x1d2745['modem']||_0x0f59('0x8');this[_0x0f59('0x9')]=_0x1d2745['gateway']||'no';this[_0x0f59('0xa')]=_0x1d2745[_0x0f59('0xa')]||'no';this[_0x0f59('0xb')]=_0x1d2745[_0x0f59('0xb')]||0x1388;this['tech']=_0x1d2745[_0x0f59('0xc')]||_0x0f59('0xd');this[_0x0f59('0xe')]=_0x1d2745['Trunk']?_0x1d2745['Trunk']:undefined;this[_0x0f59('0xf')]=_0x1d2745[_0x0f59('0xf')];this[_0x0f59('0x10')]=_0x1d2745[_0x0f59('0x10')];}module[_0x0f59('0x11')]=FaxAccount; \ No newline at end of file +var _0x07ef=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x07ef,0x70));var _0xf07e=function(_0x1ccc19,_0x2a5e47){_0x1ccc19=_0x1ccc19-0x0;var _0x393065=_0x07ef[_0x1ccc19];return _0x393065;};'use strict';function FaxAccount(_0x21f85c){this['id']=_0x21f85c['id']||0x0;this[_0xf07e('0x0')]=_0x21f85c[_0xf07e('0x0')]||'';this[_0xf07e('0x1')]=_0x21f85c['description'];this[_0xf07e('0x2')]=_0x21f85c[_0xf07e('0x2')];this[_0xf07e('0x3')]=_0x21f85c[_0xf07e('0x3')];this[_0xf07e('0x4')]=_0x21f85c[_0xf07e('0x4')];this[_0xf07e('0x5')]=_0x21f85c[_0xf07e('0x5')]||0x960;this[_0xf07e('0x6')]=_0x21f85c[_0xf07e('0x6')]||0x3840;this[_0xf07e('0x7')]=_0x21f85c[_0xf07e('0x7')]||_0xf07e('0x8');this[_0xf07e('0x9')]=_0x21f85c[_0xf07e('0x9')]||'no';this[_0xf07e('0xa')]=_0x21f85c[_0xf07e('0xa')]||'no';this[_0xf07e('0xb')]=_0x21f85c['t38timeout']||0x1388;this[_0xf07e('0xc')]=_0x21f85c[_0xf07e('0xc')]||'SIP';this['Trunk']=_0x21f85c[_0xf07e('0xd')]?_0x21f85c[_0xf07e('0xd')]:undefined;this['ListId']=_0x21f85c[_0xf07e('0xe')];this[_0xf07e('0xf')]=_0x21f85c[_0xf07e('0xf')];}module[_0xf07e('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 1af3a0d..66e2039 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 _0xe1b0=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x4c2e89,_0x2a41f5){var _0xb51c1e=function(_0x16779a){while(--_0x16779a){_0x4c2e89['push'](_0x4c2e89['shift']());}};_0xb51c1e(++_0x2a41f5);}(_0xe1b0,0x1b2));var _0x0e1b=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xe1b0[_0x1da527];return _0x40fc7c;};'use strict';function FreshdeskAccount(_0x441c98){this['id']=_0x441c98['id']||0x0;this[_0x0e1b('0x0')]=_0x441c98['name']||'';this[_0x0e1b('0x1')]=_0x441c98[_0x0e1b('0x1')]||'';this[_0x0e1b('0x2')]=_0x441c98['token']||'';this['remoteUri']=_0x441c98[_0x0e1b('0x3')]||'';this[_0x0e1b('0x4')]=_0x441c98[_0x0e1b('0x4')]||'';this[_0x0e1b('0x5')]=_0x441c98['Configurations']||{};}module[_0x0e1b('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xdcd1=['name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x5ef71c,_0x35c1d2){var _0x3d63c8=function(_0x55093c){while(--_0x55093c){_0x5ef71c['push'](_0x5ef71c['shift']());}};_0x3d63c8(++_0x35c1d2);}(_0xdcd1,0x188));var _0x1dcd=function(_0x34ddfe,_0x1c5858){_0x34ddfe=_0x34ddfe-0x0;var _0x54eaee=_0xdcd1[_0x34ddfe];return _0x54eaee;};'use strict';function FreshdeskAccount(_0x1cea9e){this['id']=_0x1cea9e['id']||0x0;this['name']=_0x1cea9e[_0x1dcd('0x0')]||'';this[_0x1dcd('0x1')]=_0x1cea9e[_0x1dcd('0x1')]||'';this[_0x1dcd('0x2')]=_0x1cea9e[_0x1dcd('0x3')]||'';this[_0x1dcd('0x4')]=_0x1cea9e[_0x1dcd('0x4')]||'';this[_0x1dcd('0x5')]=_0x1cea9e[_0x1dcd('0x5')]||'';this[_0x1dcd('0x6')]=_0x1cea9e['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 9ba4a6f..63abfdf 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 _0x42d9=['name','username','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x23eb8c,_0x5618e8){var _0x4978ba=function(_0x1512ed){while(--_0x1512ed){_0x23eb8c['push'](_0x23eb8c['shift']());}};_0x4978ba(++_0x5618e8);}(_0x42d9,0x18f));var _0x942d=function(_0x5c587a,_0x4dba89){_0x5c587a=_0x5c587a-0x0;var _0x28d19e=_0x42d9[_0x5c587a];return _0x28d19e;};'use strict';function FreshsalesAccount(_0x7de50f){this['id']=_0x7de50f['id']||0x0;this['name']=_0x7de50f[_0x942d('0x0')]||'';this[_0x942d('0x1')]=_0x7de50f[_0x942d('0x1')]||'';this['apiKey']=_0x7de50f[_0x942d('0x2')]||'';this[_0x942d('0x3')]=_0x7de50f[_0x942d('0x3')]||'';this[_0x942d('0x4')]=_0x7de50f[_0x942d('0x4')]||'';this[_0x942d('0x5')]=_0x7de50f[_0x942d('0x5')]||{};}module[_0x942d('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x2fbb=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x1cf62f,_0x31c033){var _0x2d593e=function(_0x59eafc){while(--_0x59eafc){_0x1cf62f['push'](_0x1cf62f['shift']());}};_0x2d593e(++_0x31c033);}(_0x2fbb,0x19d));var _0xb2fb=function(_0x245704,_0x184938){_0x245704=_0x245704-0x0;var _0x3a8c12=_0x2fbb[_0x245704];return _0x3a8c12;};'use strict';function FreshsalesAccount(_0x1208ed){this['id']=_0x1208ed['id']||0x0;this['name']=_0x1208ed['name']||'';this['username']=_0x1208ed[_0xb2fb('0x0')]||'';this[_0xb2fb('0x1')]=_0x1208ed[_0xb2fb('0x2')]||'';this[_0xb2fb('0x3')]=_0x1208ed[_0xb2fb('0x3')]||'';this[_0xb2fb('0x4')]=_0x1208ed[_0xb2fb('0x4')]||'';this[_0xb2fb('0x5')]=_0x1208ed[_0xb2fb('0x5')]||{};}module[_0xb2fb('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 665950a..0127aa4 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 _0xe96d=['exten','priority','lastAssignedTo','variables','exports','type','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','context'];(function(_0x5587b1,_0x1b926b){var _0x3492ed=function(_0x2b1768){while(--_0x2b1768){_0x5587b1['push'](_0x5587b1['shift']());}};_0x3492ed(++_0x1b926b);}(_0xe96d,0xb5));var _0xde96=function(_0x90e9a2,_0x156bd8){_0x90e9a2=_0x90e9a2-0x0;var _0x3ffc2e=_0xe96d[_0x90e9a2];return _0x3ffc2e;};'use strict';function QueueReport(){this[_0xde96('0x0')]='inbound';this['uniqueid']='';this[_0xde96('0x1')]='';this[_0xde96('0x2')]='';this[_0xde96('0x3')]='';this[_0xde96('0x4')]=null;this[_0xde96('0x5')]=null;this['position']=0x1;this[_0xde96('0x6')]=0x1;this[_0xde96('0x7')]=![];this[_0xde96('0x8')]=null;this['queuecallercomplete']=![];this[_0xde96('0x9')]=null;this[_0xde96('0xa')]=![];this[_0xde96('0xb')]=null;this[_0xde96('0xc')]=0x1;this[_0xde96('0xd')]='';this['connectedlinenum']='';this[_0xde96('0xe')]='';this[_0xde96('0xf')]='';this[_0xde96('0x10')]='';this[_0xde96('0x11')]='';this[_0xde96('0x12')]='';this['holdtime']=0x0;this['assigned']=![];this[_0xde96('0x13')]='';this['mohtime']=0x0;this[_0xde96('0x14')]={};}module[_0xde96('0x15')]=QueueReport; \ No newline at end of file +var _0xe698=['queuecallercomplete','queuecallercompleteAt','queuecallerexit','channel','connectedlinenum','connectedlinename','accountcode','context','exten','lastAssignedTo','mohtime','variables','exports','type','inbound','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xe698,0x69));var _0x8e69=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe698[_0x42cae2];return _0x5f256f;};'use strict';function QueueReport(){this[_0x8e69('0x0')]=_0x8e69('0x1');this['uniqueid']='';this['calleridnum']='';this[_0x8e69('0x2')]='';this[_0x8e69('0x3')]='';this[_0x8e69('0x4')]=null;this[_0x8e69('0x5')]=null;this[_0x8e69('0x6')]=0x1;this[_0x8e69('0x7')]=0x1;this[_0x8e69('0x8')]=![];this[_0x8e69('0x9')]=null;this[_0x8e69('0xa')]=![];this[_0x8e69('0xb')]=null;this[_0x8e69('0xc')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0x8e69('0xd')]='';this[_0x8e69('0xe')]='';this[_0x8e69('0xf')]='';this[_0x8e69('0x10')]='';this[_0x8e69('0x11')]='';this[_0x8e69('0x12')]='';this['priority']='';this['holdtime']=0x0;this['assigned']=![];this[_0x8e69('0x13')]='';this[_0x8e69('0x14')]=0x0;this[_0x8e69('0x15')]={};}module[_0x8e69('0x16')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index dc6533f..19ee527 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 _0x99df=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x305d3d,_0x4cd35d){var _0x3ade52=function(_0x3510e7){while(--_0x3510e7){_0x305d3d['push'](_0x305d3d['shift']());}};_0x3ade52(++_0x4cd35d);}(_0x99df,0x85));var _0xf99d=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x99df[_0x2b7764];return _0x848dcb;};'use strict';function SalesforceAccount(_0x5be1ec){this['id']=_0x5be1ec['id']||0x0;this[_0xf99d('0x0')]=_0x5be1ec['name']||'';this['username']=_0x5be1ec[_0xf99d('0x1')]||'';this['remoteUri']=_0x5be1ec[_0xf99d('0x2')]||'';this[_0xf99d('0x3')]=_0x5be1ec[_0xf99d('0x3')]||'';this[_0xf99d('0x4')]=_0x5be1ec['clientId']||'';this[_0xf99d('0x5')]=_0x5be1ec['clientSecret']||'';this[_0xf99d('0x6')]=_0x5be1ec[_0xf99d('0x6')]||'';this[_0xf99d('0x7')]=_0x5be1ec[_0xf99d('0x7')]||_0xf99d('0x8');this[_0xf99d('0x9')]=_0x5be1ec['serverUrl']||'';this[_0xf99d('0xa')]=_0x5be1ec[_0xf99d('0xa')]||{};}module[_0xf99d('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xa042=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x2af353,_0x418430){var _0x3f3f4e=function(_0x186bb5){while(--_0x186bb5){_0x2af353['push'](_0x2af353['shift']());}};_0x3f3f4e(++_0x418430);}(_0xa042,0x7b));var _0x2a04=function(_0x120980,_0x7e2057){_0x120980=_0x120980-0x0;var _0x351402=_0xa042[_0x120980];return _0x351402;};'use strict';function SalesforceAccount(_0x111474){this['id']=_0x111474['id']||0x0;this[_0x2a04('0x0')]=_0x111474[_0x2a04('0x0')]||'';this[_0x2a04('0x1')]=_0x111474[_0x2a04('0x1')]||'';this['remoteUri']=_0x111474[_0x2a04('0x2')]||'';this[_0x2a04('0x3')]=_0x111474['password']||'';this[_0x2a04('0x4')]=_0x111474[_0x2a04('0x4')]||'';this['clientSecret']=_0x111474[_0x2a04('0x5')]||'';this[_0x2a04('0x6')]=_0x111474[_0x2a04('0x6')]||'';this[_0x2a04('0x7')]=_0x111474['type']||_0x2a04('0x8');this[_0x2a04('0x9')]=_0x111474[_0x2a04('0x9')]||'';this[_0x2a04('0xa')]=_0x111474['Configurations']||{};}module[_0x2a04('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 2873c2c..85f1924 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 _0xcea1=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcea1,0x1b1));var _0x1cea=function(_0x53a11c,_0x393441){_0x53a11c=_0x53a11c-0x0;var _0x2680d5=_0xcea1[_0x53a11c];return _0x2680d5;};'use strict';function ServicenowAccount(_0x111633){this['id']=_0x111633['id']||0x0;this[_0x1cea('0x0')]=_0x111633[_0x1cea('0x0')]||'';this[_0x1cea('0x1')]=_0x111633[_0x1cea('0x1')]||'';this[_0x1cea('0x2')]=_0x111633[_0x1cea('0x2')]||'';this[_0x1cea('0x3')]=_0x111633[_0x1cea('0x3')]||'';this[_0x1cea('0x4')]=_0x111633[_0x1cea('0x4')]||'';this[_0x1cea('0x5')]=_0x111633[_0x1cea('0x5')]||{};}module[_0x1cea('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xc74e=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x3eec60,_0x46d09b){var _0x5eef61=function(_0x2fbee7){while(--_0x2fbee7){_0x3eec60['push'](_0x3eec60['shift']());}};_0x5eef61(++_0x46d09b);}(_0xc74e,0x1cf));var _0xec74=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc74e[_0x3947c9];return _0x2e7871;};'use strict';function ServicenowAccount(_0x325a40){this['id']=_0x325a40['id']||0x0;this['name']=_0x325a40[_0xec74('0x0')]||'';this['username']=_0x325a40[_0xec74('0x1')]||'';this[_0xec74('0x2')]=_0x325a40['password']||'';this[_0xec74('0x3')]=_0x325a40[_0xec74('0x3')]||'';this[_0xec74('0x4')]=_0x325a40[_0xec74('0x4')]||'';this['Configurations']=_0x325a40[_0xec74('0x5')]||{};}module[_0xec74('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 518191d..4bd72b9 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 _0x71f1=['Configurations','exports','name','username','remoteUri','serverUrl'];(function(_0xbf1026,_0x2b483f){var _0x1b224c=function(_0x1cb7f0){while(--_0x1cb7f0){_0xbf1026['push'](_0xbf1026['shift']());}};_0x1b224c(++_0x2b483f);}(_0x71f1,0x116));var _0x171f=function(_0x45fb8f,_0x46da98){_0x45fb8f=_0x45fb8f-0x0;var _0x3d906b=_0x71f1[_0x45fb8f];return _0x3d906b;};'use strict';function SugarcrmAccount(_0x2d4329){this['id']=_0x2d4329['id']||0x0;this[_0x171f('0x0')]=_0x2d4329[_0x171f('0x0')]||'';this[_0x171f('0x1')]=_0x2d4329[_0x171f('0x1')]||'';this['password']=_0x2d4329['password']||'';this[_0x171f('0x2')]=_0x2d4329[_0x171f('0x2')]||'';this['serverUrl']=_0x2d4329[_0x171f('0x3')]||'';this[_0x171f('0x4')]=_0x2d4329[_0x171f('0x4')]||{};}module[_0x171f('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xe774=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3780bd,_0x81b109){var _0x2a7b7f=function(_0x5a221f){while(--_0x5a221f){_0x3780bd['push'](_0x3780bd['shift']());}};_0x2a7b7f(++_0x81b109);}(_0xe774,0xf3));var _0x4e77=function(_0xc2b527,_0x34dd72){_0xc2b527=_0xc2b527-0x0;var _0x2781ae=_0xe774[_0xc2b527];return _0x2781ae;};'use strict';function SugarcrmAccount(_0x3c30f8){this['id']=_0x3c30f8['id']||0x0;this[_0x4e77('0x0')]=_0x3c30f8['name']||'';this[_0x4e77('0x1')]=_0x3c30f8[_0x4e77('0x1')]||'';this[_0x4e77('0x2')]=_0x3c30f8[_0x4e77('0x2')]||'';this['remoteUri']=_0x3c30f8[_0x4e77('0x3')]||'';this[_0x4e77('0x4')]=_0x3c30f8[_0x4e77('0x4')]||'';this[_0x4e77('0x5')]=_0x3c30f8[_0x4e77('0x5')]||{};}module[_0x4e77('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 3e365f3..a2d0587 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 _0x9ccb=['exports','name','unknown','status','address'];(function(_0x4cbf77,_0x47af47){var _0x2706bf=function(_0x572e5e){while(--_0x572e5e){_0x4cbf77['push'](_0x4cbf77['shift']());}};_0x2706bf(++_0x47af47);}(_0x9ccb,0xf1));var _0xb9cc=function(_0xfc444f,_0x5281c7){_0xfc444f=_0xfc444f-0x0;var _0x126d39=_0x9ccb[_0xfc444f];return _0x126d39;};'use strict';function Telephone(_0x40fa3c){this['id']=_0x40fa3c['id']||0x0;this[_0xb9cc('0x0')]=_0x40fa3c[_0xb9cc('0x0')]||'';this['accountcode']=_0x40fa3c['accountcode']||'';this['state']=_0xb9cc('0x1');this['stateTime']=0x0;this[_0xb9cc('0x2')]=_0xb9cc('0x1');this[_0xb9cc('0x3')]='';}module[_0xb9cc('0x4')]=Telephone; \ No newline at end of file +var _0x1b79=['address','name','accountcode','unknown','stateTime','status'];(function(_0x4060ec,_0x28cb05){var _0x25fc2d=function(_0x286ac7){while(--_0x286ac7){_0x4060ec['push'](_0x4060ec['shift']());}};_0x25fc2d(++_0x28cb05);}(_0x1b79,0xeb));var _0x91b7=function(_0x21851a,_0x2d2df5){_0x21851a=_0x21851a-0x0;var _0x4dec86=_0x1b79[_0x21851a];return _0x4dec86;};'use strict';function Telephone(_0x1f7533){this['id']=_0x1f7533['id']||0x0;this[_0x91b7('0x0')]=_0x1f7533[_0x91b7('0x0')]||'';this[_0x91b7('0x1')]=_0x1f7533['accountcode']||'';this['state']=_0x91b7('0x2');this[_0x91b7('0x3')]=0x0;this[_0x91b7('0x4')]=_0x91b7('0x2');this[_0x91b7('0x5')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 810985d..183703b 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 _0x9275=['name','exports'];(function(_0x465e42,_0x251b11){var _0x3fb3cc=function(_0x35e2c6){while(--_0x35e2c6){_0x465e42['push'](_0x465e42['shift']());}};_0x3fb3cc(++_0x251b11);}(_0x9275,0x154));var _0x5927=function(_0x591cfd,_0x501204){_0x591cfd=_0x591cfd-0x0;var _0x4d0100=_0x9275[_0x591cfd];return _0x4d0100;};'use strict';function template(_0x37da32){this['id']=_0x37da32['id']||0x0;this[_0x5927('0x0')]=_0x37da32['name']||'';this['html']=_0x37da32['html']||'';}module[_0x5927('0x1')]=template; \ No newline at end of file +var _0x444c=['html','name'];(function(_0x400708,_0x227e6b){var _0x355e18=function(_0x4a9c27){while(--_0x4a9c27){_0x400708['push'](_0x400708['shift']());}};_0x355e18(++_0x227e6b);}(_0x444c,0x93));var _0xc444=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x444c[_0x3dd15e];return _0x231fd0;};'use strict';function template(_0x2102c0){this['id']=_0x2102c0['id']||0x0;this[_0xc444('0x0')]=_0x2102c0[_0xc444('0x0')]||'';this['html']=_0x2102c0[_0xc444('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 c21ba3d..2f8bf7d 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 _0x55ca=['name','voice','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x55ca,0x126));var _0xa55c=function(_0x4114dd,_0x2ad862){_0x4114dd=_0x4114dd-0x0;var _0x26f44c=_0x55ca[_0x4114dd];return _0x26f44c;};'use strict';function Trigger(_0x53d0d7){this['id']=_0x53d0d7['id']||0x0;this[_0xa55c('0x0')]=_0x53d0d7['name']||'';this['channel']=_0x53d0d7['channel']||_0xa55c('0x1');this[_0xa55c('0x2')]=_0x53d0d7['status']||![];this[_0xa55c('0x3')]=_0x53d0d7[_0xa55c('0x3')]||[];this[_0xa55c('0x4')]=_0x53d0d7[_0xa55c('0x4')]||[];this[_0xa55c('0x5')]=_0x53d0d7[_0xa55c('0x5')]||[];}module[_0xa55c('0x6')]=Trigger; \ No newline at end of file +var _0x54ef=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x30bd30,_0x2a4dcd){var _0x35f7b=function(_0x436b5c){while(--_0x436b5c){_0x30bd30['push'](_0x30bd30['shift']());}};_0x35f7b(++_0x2a4dcd);}(_0x54ef,0x112));var _0xf54e=function(_0x1eb311,_0x5a96ed){_0x1eb311=_0x1eb311-0x0;var _0x14f29f=_0x54ef[_0x1eb311];return _0x14f29f;};'use strict';function Trigger(_0x19d4d5){this['id']=_0x19d4d5['id']||0x0;this[_0xf54e('0x0')]=_0x19d4d5[_0xf54e('0x0')]||'';this['channel']=_0x19d4d5[_0xf54e('0x1')]||_0xf54e('0x2');this[_0xf54e('0x3')]=_0x19d4d5[_0xf54e('0x3')]||![];this[_0xf54e('0x4')]=_0x19d4d5[_0xf54e('0x4')]||[];this[_0xf54e('0x5')]=_0x19d4d5['AnyConditions']||[];this['Actions']=_0x19d4d5[_0xf54e('0x6')]||[];}module[_0xf54e('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index f3e449b..42861da 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 _0xded4=['registry','indexOf','split','host','port','domain','refresh','registrationtime','address','exports','active','name','state','unknown','stateTime','status'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0xded4,0x14a));var _0x4ded=function(_0x27bfd4,_0xa301e4){_0x27bfd4=_0x27bfd4-0x0;var _0x4c5fd6=_0xded4[_0x27bfd4];return _0x4c5fd6;};'use strict';function Trunk(_0x1ac3af){this['id']=_0x1ac3af['id']||0x0;this['active']=_0x1ac3af[_0x4ded('0x0')]||![];this[_0x4ded('0x1')]=_0x1ac3af[_0x4ded('0x1')]||'';this[_0x4ded('0x2')]=_0x4ded('0x3');this[_0x4ded('0x4')]=0x0;this[_0x4ded('0x5')]=_0x4ded('0x3');this[_0x4ded('0x6')]=_0x1ac3af[_0x4ded('0x6')]&&_0x1ac3af[_0x4ded('0x6')][_0x4ded('0x7')](':')?_0x1ac3af[_0x4ded('0x6')][_0x4ded('0x8')](':')[0x0]:'';this[_0x4ded('0x9')]='';this[_0x4ded('0xa')]='';this[_0x4ded('0xb')]='';this['domainport']='';this[_0x4ded('0xc')]='';this['stateRegistry']=_0x4ded('0x3');this[_0x4ded('0xd')]='';this[_0x4ded('0xe')]='';}module[_0x4ded('0xf')]=Trunk; \ No newline at end of file +var _0xc519=['stateTime','registry','indexOf','host','domain','refresh','registrationtime','address','exports','active','name','state','unknown'];(function(_0xa2e03d,_0x58dcca){var _0x57eb87=function(_0x342649){while(--_0x342649){_0xa2e03d['push'](_0xa2e03d['shift']());}};_0x57eb87(++_0x58dcca);}(_0xc519,0x1ea));var _0x9c51=function(_0x508a80,_0x16f1e6){_0x508a80=_0x508a80-0x0;var _0x44d5e2=_0xc519[_0x508a80];return _0x44d5e2;};'use strict';function Trunk(_0x9a9949){this['id']=_0x9a9949['id']||0x0;this[_0x9c51('0x0')]=_0x9a9949['active']||![];this[_0x9c51('0x1')]=_0x9a9949[_0x9c51('0x1')]||'';this[_0x9c51('0x2')]=_0x9c51('0x3');this[_0x9c51('0x4')]=0x0;this['status']=_0x9c51('0x3');this['registry']=_0x9a9949[_0x9c51('0x5')]&&_0x9a9949[_0x9c51('0x5')][_0x9c51('0x6')](':')?_0x9a9949['registry']['split'](':')[0x0]:'';this[_0x9c51('0x7')]='';this['port']='';this[_0x9c51('0x8')]='';this['domainport']='';this[_0x9c51('0x9')]='';this['stateRegistry']=_0x9c51('0x3');this[_0x9c51('0xa')]='';this[_0x9c51('0xb')]='';}module[_0x9c51('0xc')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index def7802..5fc21f2 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 _0xcc8e=['exports','recordingFormat','mandatoryDisposition'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xcc8e,0xe8));var _0xecc8=function(_0x56007e,_0x272f7d){_0x56007e=_0x56007e-0x0;var _0x2f5805=_0xcc8e[_0x56007e];return _0x2f5805;};'use strict';function voiceExtension(_0x44990){this['id']=_0x44990['id']||0x0;this['exten']=_0x44990['exten']||'';this[_0xecc8('0x0')]=_0x44990[_0xecc8('0x0')]||'none';this[_0xecc8('0x1')]=_0x44990[_0xecc8('0x1')]||![];}module[_0xecc8('0x2')]=voiceExtension; \ No newline at end of file +var _0xe922=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x8fe7f8,_0x4e5a9c){var _0x41cccb=function(_0x1aae9d){while(--_0x1aae9d){_0x8fe7f8['push'](_0x8fe7f8['shift']());}};_0x41cccb(++_0x4e5a9c);}(_0xe922,0xf9));var _0x2e92=function(_0x2c43f8,_0x261d10){_0x2c43f8=_0x2c43f8-0x0;var _0x3c0c0f=_0xe922[_0x2c43f8];return _0x3c0c0f;};'use strict';function voiceExtension(_0x1a4ca1){this['id']=_0x1a4ca1['id']||0x0;this[_0x2e92('0x0')]=_0x1a4ca1[_0x2e92('0x0')]||'';this[_0x2e92('0x1')]=_0x1a4ca1[_0x2e92('0x1')]||_0x2e92('0x2');this[_0x2e92('0x3')]=_0x1a4ca1['mandatoryDisposition']||![];}module[_0x2e92('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 278c153..c0ca8ba 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 _0xd250=['invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','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','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','not_inuse','busy'];(function(_0x491b9c,_0x372369){var _0x219e83=function(_0x5eadb0){while(--_0x5eadb0){_0x491b9c['push'](_0x491b9c['shift']());}};_0x219e83(++_0x372369);}(_0xd250,0x16c));var _0x0d25=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0xd250[_0x1e4f2d];return _0xd05ce5;};'use strict';var statusDesc=['unknown',_0x0d25('0x0'),'inuse',_0x0d25('0x1'),_0x0d25('0x2'),_0x0d25('0x3'),_0x0d25('0x4'),_0x0d25('0x5'),_0x0d25('0x6')];var monitorFormat={'wav':_0x0d25('0x7'),'wav49':_0x0d25('0x8'),'gsm':_0x0d25('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x0d25('0xa')};function VoiceQueue(_0x3f177f){this['id']=_0x3f177f['id']||0x0;this[_0x0d25('0xb')]=_0x3f177f['name']||'';this[_0x0d25('0xc')]=_0x3f177f[_0x0d25('0xc')]||'';this[_0x0d25('0xd')]=_0x3f177f['type']||'inbound';this[_0x0d25('0xe')]=0x0;this[_0x0d25('0xf')]=0x0;this['total']=0x0;this[_0x0d25('0x10')]=0x0;this[_0x0d25('0x11')]=0x0;this[_0x0d25('0x12')]=0x0;this[_0x0d25('0x13')]=0x0;this[_0x0d25('0x14')]=0x0;this[_0x0d25('0x15')]=0x0;this[_0x0d25('0x16')]=0x0;this[_0x0d25('0x17')]=0x0;this[_0x0d25('0x18')]=_0x3f177f[_0x0d25('0x18')]||![];this[_0x0d25('0x19')]=_0x3f177f[_0x0d25('0x19')]||0xa;this[_0x0d25('0x1a')]=_0x3f177f[_0x0d25('0x1a')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x0d25('0x1b')]=0x0;this[_0x0d25('0x1c')]=0x0;this[_0x0d25('0x1d')]=_0x3f177f[_0x0d25('0x1d')]||null;this[_0x0d25('0x1e')]=_0x3f177f[_0x0d25('0x1e')]?_0x3f177f[_0x0d25('0x1e')]:null;this['dialActive']=_0x3f177f[_0x0d25('0x1f')];this[_0x0d25('0x20')]=_0x3f177f['dialMethod']||_0x0d25('0x21');this['dialLimitChannel']=_0x3f177f['dialLimitChannel']||0x0;this[_0x0d25('0x22')]=_0x3f177f[_0x0d25('0x22')]||0x0;this[_0x0d25('0x23')]=_0x3f177f[_0x0d25('0x23')]||0x1;this[_0x0d25('0x24')]=_0x3f177f[_0x0d25('0x24')]||_0x0d25('0x25');this[_0x0d25('0x26')]=_0x3f177f['dialPredictiveOptimizationPercentage']||0.03;this[_0x0d25('0x27')]=_0x3f177f[_0x0d25('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x3f177f[_0x0d25('0x28')]||'anonymous';this[_0x0d25('0x29')]=_0x3f177f[_0x0d25('0x29')]||_0x0d25('0x2a');this[_0x0d25('0x2b')]=_0x3f177f['dialOriginateTimeout']||0x1e;this[_0x0d25('0x2c')]=_0x3f177f[_0x0d25('0x2c')]||_0x0d25('0x2d');this[_0x0d25('0x2e')]=_0x3f177f[_0x0d25('0x2e')]||0x3;this['dialQueueProject']=_0x3f177f[_0x0d25('0x2f')]||undefined;this['dialCongestionMaxRetry']=_0x3f177f[_0x0d25('0x30')]||0x3;this[_0x0d25('0x31')]=_0x3f177f[_0x0d25('0x31')]||0x96;this[_0x0d25('0x32')]=_0x3f177f['dialBusyMaxRetry']||0x3;this[_0x0d25('0x33')]=_0x3f177f[_0x0d25('0x33')]||0x96;this[_0x0d25('0x34')]=_0x3f177f[_0x0d25('0x34')]||0x3;this[_0x0d25('0x35')]=_0x3f177f[_0x0d25('0x35')]||0x96;this[_0x0d25('0x36')]=_0x3f177f[_0x0d25('0x36')]||0x3;this[_0x0d25('0x37')]=_0x3f177f['dialNoSuchNumberRetryFrequency']||0x96;this[_0x0d25('0x38')]=_0x3f177f[_0x0d25('0x38')]||0x3;this[_0x0d25('0x39')]=_0x3f177f[_0x0d25('0x39')]||0x96;this[_0x0d25('0x3a')]=_0x3f177f[_0x0d25('0x3a')]||0x3;this[_0x0d25('0x3b')]=_0x3f177f[_0x0d25('0x3b')]||0x96;this[_0x0d25('0x3c')]=_0x3f177f['dialMachineMaxRetry']||0x3;this[_0x0d25('0x3d')]=_0x3f177f[_0x0d25('0x3d')]||0x96;this[_0x0d25('0x3e')]=_0x3f177f[_0x0d25('0x3e')]||0x3;this[_0x0d25('0x3f')]=_0x3f177f[_0x0d25('0x3f')]||0x96;this[_0x0d25('0x40')]=_0x3f177f[_0x0d25('0x40')]||0x4;this['Trunk']=_0x3f177f[_0x0d25('0x41')]?_0x3f177f[_0x0d25('0x41')]:undefined;this[_0x0d25('0x42')]=_0x3f177f[_0x0d25('0x42')]?_0x3f177f[_0x0d25('0x42')]:undefined;this[_0x0d25('0x43')]=_0x3f177f[_0x0d25('0x43')]||undefined;this[_0x0d25('0x44')]=_0x3f177f[_0x0d25('0x44')]?_0x3f177f[_0x0d25('0x44')]:undefined;this['dialOrderByScheduledAt']=_0x3f177f[_0x0d25('0x45')]||_0x0d25('0x46');this['dialRandomLastDigitCallerIdNumber']=_0x3f177f[_0x0d25('0x47')]||undefined;this[_0x0d25('0x48')]=_0x3f177f['dialCutDigit']||undefined;this[_0x0d25('0x49')]=strategy[_0x3f177f[_0x0d25('0x49')]]||_0x0d25('0x4a');this[_0x0d25('0x4b')]=!![];this[_0x0d25('0x4c')]=_0x3f177f[_0x0d25('0x4c')]||![];this[_0x0d25('0x4d')]=_0x3f177f[_0x0d25('0x4d')];this[_0x0d25('0x4e')]=_0x3f177f[_0x0d25('0x4e')];this['dialAMDAfterGreetingSilence']=_0x3f177f['dialAMDAfterGreetingSilence'];this[_0x0d25('0x4f')]=_0x3f177f['dialAMDTotalAnalysisTime'];this[_0x0d25('0x50')]=_0x3f177f['dialAMDMinWordLength'];this[_0x0d25('0x51')]=_0x3f177f['dialAMDBetweenWordsSilence'];this[_0x0d25('0x52')]=_0x3f177f[_0x0d25('0x52')];this[_0x0d25('0x53')]=_0x3f177f[_0x0d25('0x53')];this[_0x0d25('0x54')]=_0x3f177f['dialAMDMaximumWordLength'];this[_0x0d25('0x55')]=0x0;this[_0x0d25('0x56')]=0x0;this['timeout']=_0x3f177f['timeout'];this[_0x0d25('0x57')]=0x0;this[_0x0d25('0x58')]=0x0;this[_0x0d25('0x59')]=0x0;this[_0x0d25('0x5a')]=0x0;this[_0x0d25('0x5b')]=0x0;this[_0x0d25('0x5c')]=0x0;this[_0x0d25('0x5d')]=0x0;this[_0x0d25('0x5e')]=0x0;this[_0x0d25('0x5f')]=0x0;this[_0x0d25('0x60')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0x0d25('0x61')]=undefined;this[_0x0d25('0x62')]=undefined;this[_0x0d25('0x63')]=undefined;this[_0x0d25('0x64')]=1.05;this[_0x0d25('0x65')]=0x0;this[_0x0d25('0x66')]=0x0;this[_0x0d25('0x67')]=0x0;this[_0x0d25('0x68')]=0x0;this[_0x0d25('0x69')]=0x0;this[_0x0d25('0x6a')]=0x0;this[_0x0d25('0x6b')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x3f177f[_0x0d25('0x6c')]||0x14;this[_0x0d25('0x6d')]=_0x3f177f['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x0d25('0x6e')]=0x0;this[_0x0d25('0x6f')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x0d25('0x70')]=0x0;this[_0x0d25('0x71')]=0x0;this[_0x0d25('0x72')]=0x0;this['erlangBusyFactor']=0x0;this[_0x0d25('0x73')]=_0x3f177f['dialRecallMeTimeout']||0x1e;this[_0x0d25('0x74')]=_0x3f177f[_0x0d25('0x74')]||![];this[_0x0d25('0x75')]=_0x3f177f['dialQueueProject2']||undefined;this[_0x0d25('0x76')]=_0x3f177f[_0x0d25('0x76')]||![];this[_0x0d25('0x77')]=_0x3f177f[_0x0d25('0x77')]||![];this['monitor_format']=monitorFormat[_0x3f177f[_0x0d25('0xc')]]?monitorFormat[_0x3f177f[_0x0d25('0xc')]]:undefined;this[_0x0d25('0x78')]=_0x3f177f[_0x0d25('0x78')]||![];this[_0x0d25('0x79')]=_0x3f177f['mandatoryDispositionPause']?_0x3f177f['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x1805=['autopause','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','unavailable','ringing','onhold','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','acw','acwTimeout'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1805,0x145));var _0x5180=function(_0x36be67,_0x564580){_0x36be67=_0x36be67-0x0;var _0x225f19=_0x1805[_0x36be67];return _0x225f19;};'use strict';var statusDesc=[_0x5180('0x0'),_0x5180('0x1'),_0x5180('0x2'),_0x5180('0x3'),'invalid',_0x5180('0x4'),_0x5180('0x5'),'ringinuse',_0x5180('0x6')];var monitorFormat={'wav':'wav','wav49':_0x5180('0x7'),'gsm':_0x5180('0x8')};var strategy={'rrmemory':_0x5180('0x9'),'roundrobin':_0x5180('0xa')};function VoiceQueue(_0x3c6322){this['id']=_0x3c6322['id']||0x0;this['name']=_0x3c6322[_0x5180('0xb')]||'';this[_0x5180('0xc')]=_0x3c6322['monitor_format']||'';this[_0x5180('0xd')]=_0x3c6322[_0x5180('0xd')]||_0x5180('0xe');this[_0x5180('0xf')]=0x0;this[_0x5180('0x10')]=0x0;this[_0x5180('0x11')]=0x0;this[_0x5180('0x12')]=0x0;this[_0x5180('0x13')]=0x0;this[_0x5180('0x14')]=0x0;this['sumBillable']=0x0;this[_0x5180('0x15')]=0x0;this[_0x5180('0x16')]=0x0;this[_0x5180('0x17')]=0x0;this['available']=0x0;this[_0x5180('0x18')]=_0x3c6322[_0x5180('0x18')]||![];this[_0x5180('0x19')]=_0x3c6322[_0x5180('0x19')]||0xa;this[_0x5180('0x1a')]=_0x3c6322[_0x5180('0x1a')]||'no';this['sendMessageOneNotActive']=!![];this[_0x5180('0x1b')]='';this[_0x5180('0x1c')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x3c6322[_0x5180('0x1d')]||null;this[_0x5180('0x1e')]=_0x3c6322['dialGlobalInterval']?_0x3c6322[_0x5180('0x1e')]:null;this[_0x5180('0x1f')]=_0x3c6322[_0x5180('0x1f')];this[_0x5180('0x20')]=_0x3c6322[_0x5180('0x20')]||_0x5180('0x21');this[_0x5180('0x22')]=_0x3c6322[_0x5180('0x22')]||0x0;this[_0x5180('0x23')]=_0x3c6322[_0x5180('0x23')]||0x0;this['dialPowerLevel']=_0x3c6322[_0x5180('0x24')]||0x1;this[_0x5180('0x25')]=_0x3c6322[_0x5180('0x25')]||_0x5180('0x26');this['dialPredictiveOptimizationPercentage']=_0x3c6322['dialPredictiveOptimizationPercentage']||0.03;this[_0x5180('0x27')]=_0x3c6322[_0x5180('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x3c6322[_0x5180('0x28')]||_0x5180('0x29');this[_0x5180('0x2a')]=_0x3c6322[_0x5180('0x2a')]||'anonymous';this[_0x5180('0x2b')]=_0x3c6322[_0x5180('0x2b')]||0x1e;this['dialQueueOptions']=_0x3c6322['dialQueueOptions']||_0x5180('0x2c');this[_0x5180('0x2d')]=_0x3c6322['dialQueueTimeout']||0x3;this[_0x5180('0x2e')]=_0x3c6322[_0x5180('0x2e')]||undefined;this[_0x5180('0x2f')]=_0x3c6322[_0x5180('0x2f')]||0x3;this[_0x5180('0x30')]=_0x3c6322['dialCongestionRetryFrequency']||0x96;this[_0x5180('0x31')]=_0x3c6322[_0x5180('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x3c6322['dialBusyRetryFrequency']||0x96;this[_0x5180('0x32')]=_0x3c6322[_0x5180('0x32')]||0x3;this[_0x5180('0x33')]=_0x3c6322['dialNoAnswerRetryFrequency']||0x96;this[_0x5180('0x34')]=_0x3c6322[_0x5180('0x34')]||0x3;this[_0x5180('0x35')]=_0x3c6322['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x3c6322[_0x5180('0x36')]||0x3;this[_0x5180('0x37')]=_0x3c6322[_0x5180('0x37')]||0x96;this[_0x5180('0x38')]=_0x3c6322['dialAbandonedMaxRetry']||0x3;this[_0x5180('0x39')]=_0x3c6322[_0x5180('0x39')]||0x96;this['dialMachineMaxRetry']=_0x3c6322['dialMachineMaxRetry']||0x3;this[_0x5180('0x3a')]=_0x3c6322[_0x5180('0x3a')]||0x96;this[_0x5180('0x3b')]=_0x3c6322[_0x5180('0x3b')]||0x3;this[_0x5180('0x3c')]=_0x3c6322[_0x5180('0x3c')]||0x96;this['dialGlobalMaxRetry']=_0x3c6322['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x3c6322[_0x5180('0x3d')]?_0x3c6322[_0x5180('0x3d')]:undefined;this[_0x5180('0x3e')]=_0x3c6322[_0x5180('0x3e')]?_0x3c6322[_0x5180('0x3e')]:undefined;this[_0x5180('0x3f')]=_0x3c6322[_0x5180('0x3f')]||undefined;this['Interval']=_0x3c6322[_0x5180('0x40')]?_0x3c6322['Interval']:undefined;this[_0x5180('0x41')]=_0x3c6322[_0x5180('0x41')]||_0x5180('0x42');this[_0x5180('0x43')]=_0x3c6322[_0x5180('0x43')]||undefined;this['dialCutDigit']=_0x3c6322[_0x5180('0x44')]||undefined;this[_0x5180('0x45')]=strategy[_0x3c6322[_0x5180('0x45')]]||_0x5180('0x9');this['queueStatusComplete']=!![];this[_0x5180('0x46')]=_0x3c6322[_0x5180('0x46')]||![];this['dialAMDInitialSilence']=_0x3c6322[_0x5180('0x47')];this[_0x5180('0x48')]=_0x3c6322['dialAMDGreeting'];this[_0x5180('0x49')]=_0x3c6322[_0x5180('0x49')];this[_0x5180('0x4a')]=_0x3c6322[_0x5180('0x4a')];this[_0x5180('0x4b')]=_0x3c6322[_0x5180('0x4b')];this['dialAMDBetweenWordsSilence']=_0x3c6322[_0x5180('0x4c')];this['dialAMDMaximumNumberOfWords']=_0x3c6322[_0x5180('0x4d')];this[_0x5180('0x4e')]=_0x3c6322[_0x5180('0x4e')];this['dialAMDMaximumWordLength']=_0x3c6322[_0x5180('0x4f')];this[_0x5180('0x50')]=0x0;this[_0x5180('0x51')]=0x0;this['timeout']=_0x3c6322['timeout'];this[_0x5180('0x52')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x5180('0x53')]=0x0;this[_0x5180('0x54')]=0x0;this[_0x5180('0x55')]=0x0;this[_0x5180('0x56')]=0x0;this[_0x5180('0x57')]=0x0;this[_0x5180('0x58')]=0x0;this[_0x5180('0x59')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x5180('0x5a')]=0x0;this[_0x5180('0x5b')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0x5180('0x5c')]=undefined;this['handlePredictive']=undefined;this[_0x5180('0x5d')]=1.05;this[_0x5180('0x5e')]=0x0;this[_0x5180('0x5f')]=0x0;this[_0x5180('0x60')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x5180('0x61')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x5180('0x62')]=0x0;this[_0x5180('0x63')]=0x0;this[_0x5180('0x64')]=_0x3c6322[_0x5180('0x65')]||0x14;this['predictiveIntervalMinThreshold']=_0x3c6322[_0x5180('0x65')]||0xa;this[_0x5180('0x66')]=0x0;this[_0x5180('0x67')]=0x0;this[_0x5180('0x68')]=0x1;this[_0x5180('0x69')]=0x0;this[_0x5180('0x6a')]=0x0;this[_0x5180('0x6b')]=0x0;this[_0x5180('0x6c')]=0x0;this['dialRecallMeTimeout']=_0x3c6322[_0x5180('0x6d')]||0x1e;this[_0x5180('0x6e')]=_0x3c6322[_0x5180('0x6e')]||![];this['dialQueueProject2']=_0x3c6322[_0x5180('0x6f')]||undefined;this['dialAgiAfterHangupClient']=_0x3c6322[_0x5180('0x70')]||![];this[_0x5180('0x71')]=_0x3c6322[_0x5180('0x71')]||![];this['monitor_format']=monitorFormat[_0x3c6322[_0x5180('0xc')]]?monitorFormat[_0x3c6322['monitor_format']]:undefined;this[_0x5180('0x72')]=_0x3c6322[_0x5180('0x72')]||![];this[_0x5180('0x73')]=_0x3c6322[_0x5180('0x73')]?_0x3c6322['mandatoryDispositionPause']:undefined;}module[_0x5180('0x74')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 74bac15..ae11133 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 _0x4970=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4970,0xcd));var _0x0497=function(_0x2c342a,_0x307015){_0x2c342a=_0x2c342a-0x0;var _0x3da616=_0x4970[_0x2c342a];return _0x3da616;};'use strict';function VtigerAccount(_0x3950ac){this['id']=_0x3950ac['id']||0x0;this[_0x0497('0x0')]=_0x3950ac['name']||'';this[_0x0497('0x1')]=_0x3950ac['username']||'';this[_0x0497('0x2')]=_0x3950ac[_0x0497('0x2')]||'';this[_0x0497('0x3')]=_0x3950ac[_0x0497('0x3')]||'';this['serverUrl']=_0x3950ac[_0x0497('0x4')]||'';this['Configurations']=_0x3950ac[_0x0497('0x5')]||{};}module[_0x0497('0x6')]=VtigerAccount; \ No newline at end of file +var _0x8396=['name','username','remoteUri','serverUrl','Configurations','exports'];(function(_0x5b9e1b,_0x1bf696){var _0x146231=function(_0x41eccd){while(--_0x41eccd){_0x5b9e1b['push'](_0x5b9e1b['shift']());}};_0x146231(++_0x1bf696);}(_0x8396,0xf6));var _0x6839=function(_0x7b8f69,_0x411383){_0x7b8f69=_0x7b8f69-0x0;var _0x4230a6=_0x8396[_0x7b8f69];return _0x4230a6;};'use strict';function VtigerAccount(_0x252f0f){this['id']=_0x252f0f['id']||0x0;this[_0x6839('0x0')]=_0x252f0f[_0x6839('0x0')]||'';this[_0x6839('0x1')]=_0x252f0f['username']||'';this['accessKey']=_0x252f0f['accessKey']||'';this[_0x6839('0x2')]=_0x252f0f[_0x6839('0x2')]||'';this[_0x6839('0x3')]=_0x252f0f[_0x6839('0x3')]||'';this['Configurations']=_0x252f0f[_0x6839('0x4')]||{};}module[_0x6839('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 81a9c2f..37dd490 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 _0x2032=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x57fddb,_0x6da61f){var _0x1682b7=function(_0x19f70a){while(--_0x19f70a){_0x57fddb['push'](_0x57fddb['shift']());}};_0x1682b7(++_0x6da61f);}(_0x2032,0xd9));var _0x2203=function(_0x171293,_0x1bbd64){_0x171293=_0x171293-0x0;var _0x7b7ec5=_0x2032[_0x171293];return _0x7b7ec5;};'use strict';function ZendeskAccount(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['username']||'';this[_0x2203('0x2')]=_0x4d6c97[_0x2203('0x2')]||'';this['token']=_0x4d6c97[_0x2203('0x3')]||'';this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||'';this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||'';this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||_0x2203('0x7');this[_0x2203('0x8')]=_0x4d6c97[_0x2203('0x8')]||'';this[_0x2203('0x9')]=_0x4d6c97['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x5f2f=['authType','type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x43f08f,_0x415b10){var _0x248006=function(_0x46bd30){while(--_0x46bd30){_0x43f08f['push'](_0x43f08f['shift']());}};_0x248006(++_0x415b10);}(_0x5f2f,0x73));var _0xf5f2=function(_0x14c65b,_0x10b662){_0x14c65b=_0x14c65b-0x0;var _0x7ed29a=_0x5f2f[_0x14c65b];return _0x7ed29a;};'use strict';function ZendeskAccount(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||'';this[_0xf5f2('0x2')]=_0x7c86d8[_0xf5f2('0x2')]||'';this[_0xf5f2('0x3')]=_0x7c86d8['token']||'';this['remoteUri']=_0x7c86d8[_0xf5f2('0x4')]||'';this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||'';this[_0xf5f2('0x6')]=_0x7c86d8[_0xf5f2('0x6')]||_0xf5f2('0x7');this['serverUrl']=_0x7c86d8[_0xf5f2('0x8')]||'';this[_0xf5f2('0x9')]=_0x7c86d8[_0xf5f2('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 a0f0056..b3cfb24 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 _0xea28=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x499797,_0x5bbcce){var _0x2098d0=function(_0x18afb7){while(--_0x18afb7){_0x499797['push'](_0x499797['shift']());}};_0x2098d0(++_0x5bbcce);}(_0xea28,0x13a));var _0x8ea2=function(_0x4158e2,_0x26d80f){_0x4158e2=_0x4158e2-0x0;var _0x2ff0a9=_0xea28[_0x4158e2];return _0x2ff0a9;};'use strict';function ZohoAccount(_0x12ee06){this['id']=_0x12ee06['id']||0x0;this[_0x8ea2('0x0')]=_0x12ee06[_0x8ea2('0x0')]||'';this[_0x8ea2('0x1')]=_0x12ee06[_0x8ea2('0x1')]||'';this[_0x8ea2('0x2')]=_0x12ee06[_0x8ea2('0x2')]||'';this[_0x8ea2('0x3')]=_0x12ee06['zone']||'';this[_0x8ea2('0x4')]=_0x12ee06[_0x8ea2('0x4')]||'';this[_0x8ea2('0x5')]=_0x12ee06['clientSecret']||'';this[_0x8ea2('0x6')]=_0x12ee06[_0x8ea2('0x6')]||'';this[_0x8ea2('0x7')]=_0x12ee06[_0x8ea2('0x7')]||'';this[_0x8ea2('0x8')]=_0x12ee06[_0x8ea2('0x8')]||'';this[_0x8ea2('0x9')]=_0x12ee06[_0x8ea2('0x9')]||{};}module[_0x8ea2('0xa')]=ZohoAccount; \ No newline at end of file +var _0xa30a=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x5826a7,_0x258e32){var _0x5edfd8=function(_0x3d8280){while(--_0x3d8280){_0x5826a7['push'](_0x5826a7['shift']());}};_0x5edfd8(++_0x258e32);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';function ZohoAccount(_0x45514b){this['id']=_0x45514b['id']||0x0;this[_0xaa30('0x0')]=_0x45514b[_0xaa30('0x0')]||'';this['description']=_0x45514b[_0xaa30('0x1')]||'';this[_0xaa30('0x2')]=_0x45514b[_0xaa30('0x2')]||'';this[_0xaa30('0x3')]=_0x45514b[_0xaa30('0x3')]||'';this[_0xaa30('0x4')]=_0x45514b[_0xaa30('0x4')]||'';this['clientSecret']=_0x45514b[_0xaa30('0x5')]||'';this['serverUrl']=_0x45514b[_0xaa30('0x6')]||'';this[_0xaa30('0x7')]=_0x45514b[_0xaa30('0x7')]||'';this['refreshToken']=_0x45514b[_0xaa30('0x8')]||'';this[_0xaa30('0x9')]=_0x45514b[_0xaa30('0x9')]||{};}module[_0xaa30('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 03f4e05..7c52dbf 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 _0x9121=['originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','channelAgent','format','calleridname','Contact','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','Agent'];(function(_0x24952b,_0x31573c){var _0x3c0fb4=function(_0x359cb7){while(--_0x359cb7){_0x24952b['push'](_0x24952b['shift']());}};_0x3c0fb4(++_0x31573c);}(_0x9121,0x15e));var _0x1912=function(_0x3550e8,_0x424fea){_0x3550e8=_0x3550e8-0x0;var _0x18eb61=_0x9121[_0x3550e8];return _0x18eb61;};'use strict';var util=require(_0x1912('0x0'));var _=require('lodash');var moment=require(_0x1912('0x1'));function checkNameSurname(_0x819053,_0xa89f43,_0x350b18){var _0x2abd6e='';if(!_[_0x1912('0x2')](_0xa89f43)&&_0x1912('0x3')===typeof _0xa89f43){_0x2abd6e+=_0xa89f43;}if(!_['isNil'](_0x350b18)&&_0x1912('0x3')===typeof _0x350b18){_0x2abd6e+='\x20'+_0x350b18;}if(_0x2abd6e!==''){return _0x2abd6e;}return _0x819053;}function Action(_0x102c63,_0x480dc3,_0x3ac6e0,_0x4f7de6,_0x1716e1){this[_0x1912('0x4')]=_0x3ac6e0||undefined;this[_0x1912('0x5')]=_0x102c63['id'];this[_0x1912('0x6')]=_0x480dc3[_0x1912('0x7')];this[_0x1912('0x8')]=_0x480dc3[_0x1912('0x8')];this[_0x1912('0x9')]=_0x1912('0x6');this[_0x1912('0xa')]=![];this[_0x1912('0xb')]=_['isNil'](_0x102c63['Agent'])?undefined:_0x102c63['Agent']['name'];this[_0x1912('0xc')]=this[_0x1912('0xb')]?util[_0x1912('0xd')]('SIP/%s',this[_0x1912('0xb')]):_0x4f7de6||undefined;this[_0x1912('0xe')]=checkNameSurname(_0x102c63[_0x1912('0xf')]['phone'],_0x102c63[_0x1912('0xf')]['firstName'],_0x102c63[_0x1912('0xf')][_0x1912('0x10')]);this[_0x1912('0x11')]=_0x102c63['active']||![];this[_0x1912('0x12')]=_0x102c63[_0x1912('0xf')][_0x1912('0x13')];this[_0x1912('0x14')]=_0x102c63[_0x1912('0x14')];this['countbusyretry']=_0x102c63[_0x1912('0x15')]||0x0;this[_0x1912('0x16')]=_0x102c63['countcongestionretry']||0x0;this[_0x1912('0x17')]=_0x102c63[_0x1912('0x17')]||0x0;this['countglobal']=(_0x102c63[_0x1912('0x15')]||0x0)+(_0x102c63[_0x1912('0x16')]||0x0)+(_0x102c63[_0x1912('0x17')]||0x0)+(_0x102c63['countnosuchnumberretry']||0x0)+(_0x102c63[_0x1912('0x18')]||0x0)+(_0x102c63[_0x1912('0x19')]||0x0)+(_0x102c63[_0x1912('0x1a')]||0x0)+(_0x102c63[_0x1912('0x1b')]||0x0);this[_0x1912('0x1c')]=_0x102c63[_0x1912('0x1c')]||0x0;this[_0x1912('0x18')]=_0x102c63[_0x1912('0x18')]||0x0;this[_0x1912('0x19')]=_0x102c63[_0x1912('0x19')]||0x0;this[_0x1912('0x1a')]=_0x102c63['countmachineretry']||0x0;this[_0x1912('0x1b')]=_0x102c63[_0x1912('0x1b')]||0x0;this['callback']=_0x102c63[_0x1912('0x1d')];this[_0x1912('0x1e')]=_0x102c63['callbackuniqueid'];this['callbackat']=_0x102c63[_0x1912('0x1f')];this[_0x1912('0x20')]=_0x102c63[_0x1912('0x20')];this[_0x1912('0x21')]=_0x102c63[_0x1912('0x21')];this['ListId']=_0x102c63[_0x1912('0x22')];this[_0x1912('0x23')]=_[_0x1912('0x2')](_0x102c63['Agent'])?_0x102c63[_0x1912('0x23')]:_0x102c63[_0x1912('0x24')]['id'];this['VoiceQueueId']=_0x102c63['VoiceQueueId'];this['originatecalleridnum']='';this[_0x1912('0x25')]='';}Action[_0x1912('0x26')][_0x1912('0x27')]=function(){return util[_0x1912('0xd')](_0x1912('0x28'),this[_0x1912('0xe')],this[_0x1912('0x29')]);};module[_0x1912('0x2a')]=Action; \ No newline at end of file +var _0x0fa6=['getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','uniqueid','idContact','queue','name','type','dialAnswer','membername','Agent','channelAgent','calleridname','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x0fa6,0x85));var _0x60fa=function(_0x50f545,_0x2596ab){_0x50f545=_0x50f545-0x0;var _0x477b9d=_0x0fa6[_0x50f545];return _0x477b9d;};'use strict';var util=require(_0x60fa('0x0'));var _=require(_0x60fa('0x1'));var moment=require('moment');function checkNameSurname(_0x45875a,_0x26d0a8,_0x52aaf9){var _0x2c8681='';if(!_[_0x60fa('0x2')](_0x26d0a8)&&'string'===typeof _0x26d0a8){_0x2c8681+=_0x26d0a8;}if(!_[_0x60fa('0x2')](_0x52aaf9)&&'string'===typeof _0x52aaf9){_0x2c8681+='\x20'+_0x52aaf9;}if(_0x2c8681!==''){return _0x2c8681;}return _0x45875a;}function Action(_0x12afbe,_0x4d0efa,_0x34b555,_0x572f41,_0x3ef819){this[_0x60fa('0x3')]=_0x34b555||undefined;this[_0x60fa('0x4')]=_0x12afbe['id'];this[_0x60fa('0x5')]=_0x4d0efa[_0x60fa('0x6')];this[_0x60fa('0x7')]=_0x4d0efa[_0x60fa('0x7')];this['campaigntype']=_0x60fa('0x5');this[_0x60fa('0x8')]=![];this[_0x60fa('0x9')]=_[_0x60fa('0x2')](_0x12afbe['Agent'])?undefined:_0x12afbe[_0x60fa('0xa')][_0x60fa('0x6')];this[_0x60fa('0xb')]=this[_0x60fa('0x9')]?util['format']('SIP/%s',this[_0x60fa('0x9')]):_0x572f41||undefined;this[_0x60fa('0xc')]=checkNameSurname(_0x12afbe[_0x60fa('0xd')]['phone'],_0x12afbe[_0x60fa('0xd')][_0x60fa('0xe')],_0x12afbe[_0x60fa('0xd')][_0x60fa('0xf')]);this[_0x60fa('0x10')]=_0x12afbe[_0x60fa('0x10')]||![];this[_0x60fa('0x11')]=_0x12afbe['Contact']['phone'];this['scheduledat']=_0x12afbe[_0x60fa('0x12')];this[_0x60fa('0x13')]=_0x12afbe['countbusyretry']||0x0;this[_0x60fa('0x14')]=_0x12afbe['countcongestionretry']||0x0;this['countnoanswerretry']=_0x12afbe['countnoanswerretry']||0x0;this[_0x60fa('0x15')]=(_0x12afbe['countbusyretry']||0x0)+(_0x12afbe[_0x60fa('0x14')]||0x0)+(_0x12afbe[_0x60fa('0x16')]||0x0)+(_0x12afbe[_0x60fa('0x17')]||0x0)+(_0x12afbe[_0x60fa('0x18')]||0x0)+(_0x12afbe[_0x60fa('0x19')]||0x0)+(_0x12afbe[_0x60fa('0x1a')]||0x0)+(_0x12afbe[_0x60fa('0x1b')]||0x0);this[_0x60fa('0x17')]=_0x12afbe[_0x60fa('0x17')]||0x0;this[_0x60fa('0x18')]=_0x12afbe[_0x60fa('0x18')]||0x0;this[_0x60fa('0x19')]=_0x12afbe[_0x60fa('0x19')]||0x0;this[_0x60fa('0x1a')]=_0x12afbe[_0x60fa('0x1a')]||0x0;this[_0x60fa('0x1b')]=_0x12afbe['countagentrejectretry']||0x0;this[_0x60fa('0x1c')]=_0x12afbe[_0x60fa('0x1c')];this[_0x60fa('0x1d')]=_0x12afbe[_0x60fa('0x1d')];this[_0x60fa('0x1e')]=_0x12afbe['callbackat'];this[_0x60fa('0x1f')]=_0x12afbe[_0x60fa('0x1f')];this[_0x60fa('0x20')]=_0x12afbe[_0x60fa('0x20')];this[_0x60fa('0x21')]=_0x12afbe[_0x60fa('0x21')];this[_0x60fa('0x22')]=_['isNil'](_0x12afbe[_0x60fa('0xa')])?_0x12afbe[_0x60fa('0x22')]:_0x12afbe[_0x60fa('0xa')]['id'];this[_0x60fa('0x23')]=_0x12afbe[_0x60fa('0x23')];this[_0x60fa('0x24')]='';this[_0x60fa('0x25')]='';}Action[_0x60fa('0x26')][_0x60fa('0x27')]=function(){return util['format'](_0x60fa('0x28'),this[_0x60fa('0xc')],this[_0x60fa('0x29')]);};module[_0x60fa('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 5384f4e..e208d89 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 _0x93be=['erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','booked','clearZombieChannels','hasOwnProperty','recallMe','clearZombieChannel','sequence','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','logger2','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','complete','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','countbusyretry','dialBusyRetryFrequency','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','congestion','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','countabandonedetry','dialAbandonedMaxRety','[callProgressDetectingCustomer][logAbandoned]','countabandonedretry','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','isTrunkReachable','trunks','SIP/%s','status','reachable','unlock','unlockContact','execRun','recallme','isValid','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','SIP/%s/%s%s','trim','dialCutDigit','substring','dialRandomLastDigitCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','merge','toLowerVariables','variablesAction','[originated][increment]','channel','syncOriginateResponse','actionid','logLookAgent','clone','responsetime','rejected','Answer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','callProgressDetectingCustomer','[syncHangup][talking][cause]','cause','dialQueueProject','channelstate','transfer','reason','callProgressDetectingAgent','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','keys','variable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./util/util','redis','localhost','socket.io-emitter','prototype','tail','finally','campaignsPreview','voiceQueues','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x93be,0xfe));var _0xe93b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x93be[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0xe93b('0x0'));var _=require(_0xe93b('0x1'));var BPromise=require('bluebird');var uuid=require(_0xe93b('0x2'));var moment=require(_0xe93b('0x3'));var md5=require(_0xe93b('0x4'));var Redis=require(_0xe93b('0x5'));var config=require(_0xe93b('0x6'));var logger=require(_0xe93b('0x7'))(_0xe93b('0x8'));var loggerAction=require(_0xe93b('0x7'))(_0xe93b('0x9'));var ami=require(_0xe93b('0xa'));var rpcDb=require(_0xe93b('0xb'));var Action=require('./action');var ut=require(_0xe93b('0xc'));config[_0xe93b('0xd')]=_['defaults'](config[_0xe93b('0xd')],{'host':_0xe93b('0xe'),'port':0x18eb});var io=require(_0xe93b('0xf'))(new Redis(config[_0xe93b('0xd')]));var Sequence=function(){};Sequence[_0xe93b('0x10')]['enqueue']=function(_0x4590fe){this[_0xe93b('0x11')]=this[_0xe93b('0x11')]?this[_0xe93b('0x11')][_0xe93b('0x12')](_0x4590fe):_0x4590fe();};function Preview(_0x1e07f6){this['sequence']=new Sequence();this[_0xe93b('0x13')]=_0x1e07f6[_0xe93b('0x14')];this['trunks']=_0x1e07f6['trunks'];this[_0xe93b('0x15')]={};this[_0xe93b('0x16')]=_0x1e07f6[_0xe93b('0x16')];this[_0xe93b('0x17')]=0x0;ami['on'](_0xe93b('0x18'),this['syncOriginateResponse'][_0xe93b('0x19')](this));ami['on'](_0xe93b('0x1a'),this['syncHangup']['bind'](this));ami['on']('hanguprequest',this[_0xe93b('0x1b')][_0xe93b('0x19')](this));ami['on'](_0xe93b('0x1c'),this[_0xe93b('0x1d')][_0xe93b('0x19')](this));ami['on']('newexten',this[_0xe93b('0x1e')][_0xe93b('0x19')](this));ami['on'](_0xe93b('0x1f'),this[_0xe93b('0x20')]['bind'](this));ami['on'](_0xe93b('0x21'),this[_0xe93b('0x22')]['bind'](this));ami['on'](_0xe93b('0x23'),this[_0xe93b('0x24')][_0xe93b('0x19')](this));this[_0xe93b('0x25')](this[_0xe93b('0x13')]);}function emit(_0x2b67f8,_0x314147,_0x30094f){io['to'](_0x2b67f8)[_0xe93b('0x26')](_0x314147,_0x30094f);}function emitCampaignPreview(_0x1bc32a){if(_0x1bc32a[_0xe93b('0x27')]===_0xe93b('0x28')){var _0x65e012={'id':_0x1bc32a['id'],'name':_0x1bc32a[_0xe93b('0x29')],'strategy':_0x1bc32a[_0xe93b('0x2a')],'answered':_0x1bc32a[_0xe93b('0x2b')],'available':_0x1bc32a[_0xe93b('0x2c')],'loggedIn':_0x1bc32a[_0xe93b('0x2d')],'pTalking':_0x1bc32a[_0xe93b('0x2e')],'sumBillable':_0x1bc32a[_0xe93b('0x2f')],'sumDuration':_0x1bc32a[_0xe93b('0x30')],'sumHoldTime':_0x1bc32a[_0xe93b('0x31')]||0x0,'talking':_0x1bc32a[_0xe93b('0x32')],'total':_0x1bc32a['total'],'type':_0x1bc32a[_0xe93b('0x27')],'unmanaged':_0x1bc32a[_0xe93b('0x33')],'abandoned':_0x1bc32a['abandoned'],'waiting':_0x1bc32a[_0xe93b('0x34')],'loggedInDb':_0x1bc32a[_0xe93b('0x35')],'dialActive':_0x1bc32a[_0xe93b('0x36')],'dialMethod':_0x1bc32a[_0xe93b('0x37')],'dialOriginateCallerIdName':_0x1bc32a[_0xe93b('0x38')],'dialOriginateCallerIdNumber':_0x1bc32a[_0xe93b('0x39')],'dialOriginateTimeout':_0x1bc32a['dialOriginateTimeout'],'dialPrefix':_0x1bc32a[_0xe93b('0x3a')],'outboundAnswerAgiCallsDay':_0x1bc32a[_0xe93b('0x3b')],'outboundAnswerCallsDay':_0x1bc32a[_0xe93b('0x3c')],'outboundBlacklistCallsDay':_0x1bc32a[_0xe93b('0x3d')],'outboundBusyCallsDay':_0x1bc32a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1bc32a['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1bc32a[_0xe93b('0x3e')],'outboundDropCallsDayCallersExit':_0x1bc32a[_0xe93b('0x3f')],'outboundDropCallsDayTimeout':_0x1bc32a[_0xe93b('0x40')],'outboundNoAnswerCallsDay':_0x1bc32a['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1bc32a[_0xe93b('0x41')],'outboundOriginateFailureCallsDay':_0x1bc32a[_0xe93b('0x42')],'outboundReCallsDay':_0x1bc32a[_0xe93b('0x43')],'outboundRejectCallsDay':_0x1bc32a[_0xe93b('0x44')],'outboundUnknownCallsDay':_0x1bc32a[_0xe93b('0x45')],'outboundAbandonedCallsDay':_0x1bc32a[_0xe93b('0x46')],'predictiveIntervalAnsweredCalls':_0x1bc32a[_0xe93b('0x47')],'predictiveIntervalAvgHoldtime':_0x1bc32a[_0xe93b('0x48')],'predictiveIntervalAvgTalktime':_0x1bc32a[_0xe93b('0x49')],'predictiveIntervalDroppedCallsCallersExit':_0x1bc32a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1bc32a[_0xe93b('0x4a')],'predictiveIntervalErlangCalls':_0x1bc32a['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1bc32a[_0xe93b('0x4b')],'predictiveIntervalHitRate':_0x1bc32a[_0xe93b('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x1bc32a['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1bc32a[_0xe93b('0x4d')],'predictiveIntervalAvailable':_0x1bc32a['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1bc32a[_0xe93b('0x4e')],'message':_0x1bc32a['message'],'originated':_0x1bc32a[_0xe93b('0x4f')],'erlangCalls':_0x1bc32a[_0xe93b('0x50')],'erlangCallToSecond':_0x1bc32a[_0xe93b('0x51')],'erlangAbandonmentRate':_0x1bc32a[_0xe93b('0x52')],'erlangBusyFactor':_0x1bc32a[_0xe93b('0x53')],'startPredictive':_0x1bc32a[_0xe93b('0x54')],'startProgressive':_0x1bc32a['startProgressive']};if(_0x1bc32a[_0xe93b('0x55')]){_0x65e012[_0xe93b('0x55')]={'id':_0x1bc32a[_0xe93b('0x55')]['id'],'name':_0x1bc32a[_0xe93b('0x55')][_0xe93b('0x29')],'active':_0x1bc32a['Trunk'][_0xe93b('0x56')],'callerid':_0x1bc32a[_0xe93b('0x55')][_0xe93b('0x57')]};}if(_0x1bc32a[_0xe93b('0x58')]){_0x65e012[_0xe93b('0x58')]={'id':_0x1bc32a['Interval']['id'],'name':_0x1bc32a['Interval'][_0xe93b('0x29')]};}var _0x314a4b=md5(JSON[_0xe93b('0x59')](_0x65e012));if(_0x1bc32a[_0xe93b('0x4')]!==_0x314a4b){_0x1bc32a[_0xe93b('0x4')]=_0x314a4b;emit(util['format']('voice:queue:%s',_0x65e012[_0xe93b('0x29')]),_0xe93b('0x5a'),_0x65e012);}}}function emitVoiceQueueChannelRemove(_0x599246){logger[_0xe93b('0x5b')](_0xe93b('0x5c'),JSON[_0xe93b('0x59')](_0x599246));emit(util['format'](_0xe93b('0x5d'),_0x599246['name']),_0xe93b('0x5e'),_0x599246);io[_0xe93b('0x26')]('voice_queue_presence:remove',_0x599246);}function notSendMessagesQueue(_0xf9b29b){if(_0xf9b29b[_0xe93b('0x5f')]){if(_0xf9b29b[_0xe93b('0x4f')]===0x0&&_0xf9b29b[_0xe93b('0x2e')]===0x0){_0xf9b29b[_0xe93b('0x5f')]=![];_0xf9b29b[_0xe93b('0x2c')]=0x0;_0xf9b29b[_0xe93b('0x60')]=0x0;_0xf9b29b[_0xe93b('0x61')]=_0xe93b('0x62');ut[_0xe93b('0x63')](_0xe93b('0x64'),_0xf9b29b['name']+_0xe93b('0x65'));}else{_0xf9b29b[_0xe93b('0x61')]=_0xe93b('0x66');ut[_0xe93b('0x63')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xf9b29b[_0xe93b('0x29')]+_0xe93b('0x67'));}emitCampaignPreview(_0xf9b29b);}}Preview[_0xe93b('0x10')][_0xe93b('0x25')]=function(){var _0x22850a=this;setInterval(function(){_0x22850a['syncCampaigns']();},0x7cf);};Preview[_0xe93b('0x10')][_0xe93b('0x68')]=function(){var _0x9111f9=this[_0xe93b('0x13')];this[_0xe93b('0x17')]+=0x1;for(var _0x56e801 in _0x9111f9){if(_0x9111f9['hasOwnProperty'](_0x56e801)&&(_0x9111f9[_0x56e801][_0xe93b('0x37')]===_0xe93b('0x8')||_0x9111f9[_0x56e801][_0xe93b('0x37')]===_0xe93b('0x69'))&&_0x9111f9[_0x56e801]['type']===_0xe93b('0x28')){if(this[_0xe93b('0x17')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xe93b('0x6a')]();}}if(_0x9111f9[_0xe93b('0x6b')](_0x56e801)&&_0x9111f9[_0x56e801][_0xe93b('0x37')]==='preview'&&_0x9111f9[_0x56e801]['type']===_0xe93b('0x28')){if(_0x9111f9[_0x56e801][_0xe93b('0x36')]){this['setMessage'](_0x9111f9[_0x56e801]);this[_0xe93b('0x6c')](_0x9111f9[_0x56e801]);}else{notSendMessagesQueue(_0x9111f9[_0x56e801]);}}}};Preview[_0xe93b('0x10')][_0xe93b('0x6d')]=function(_0x2999f9){var _0x5baf50=this;this[_0xe93b('0x6e')][_0xe93b('0x6f')](function(){if(!_[_0xe93b('0x70')](_0x5baf50[_0xe93b('0x15')][_0x2999f9])){loggerAction[_0xe93b('0x5b')](_0xe93b('0x71'),_0x2999f9,_0xe93b('0x72'),_0x5baf50['actions'][_0x2999f9][_0xe93b('0x73')],_0xe93b('0x74'),JSON['stringify'](_0x5baf50[_0xe93b('0x13')][_0x5baf50[_0xe93b('0x15')][_0x2999f9][_0xe93b('0x73')]][_0xe93b('0x4f')]),_0xe93b('0x75'),JSON[_0xe93b('0x59')](_0x5baf50[_0xe93b('0x13')][_0x5baf50[_0xe93b('0x15')][_0x2999f9]['queue']][_0xe93b('0x2e')]),JSON[_0xe93b('0x59')](_0x5baf50['actions'][_0x2999f9][_0xe93b('0x76')]),JSON['stringify'](_[_0xe93b('0x77')](_0x5baf50[_0xe93b('0x15')][_0x2999f9],[_0xe93b('0x78'),_0xe93b('0x79'),_0xe93b('0x7a'),'ListId'])));return ami[_0xe93b('0x7b')]({'action':'status','channel':_0x5baf50[_0xe93b('0x15')][_0x2999f9]['channel']})[_0xe93b('0x7c')](function(_0x3190a2){if(_0x3190a2['message']===_0xe93b('0x7d')){setTimeout(function(){if(_0x5baf50['actions'][_0x2999f9]){ut['updateOriginated'](_0x5baf50[_0xe93b('0x13')][_0x5baf50[_0xe93b('0x15')][_0x2999f9][_0xe93b('0x73')]],_0xe93b('0x7e'));if(_0x5baf50['actions'][_0x2999f9][_0xe93b('0x76')]===!![]){ut[_0xe93b('0x7f')](_0x5baf50[_0xe93b('0x13')][_0x5baf50[_0xe93b('0x15')][_0x2999f9][_0xe93b('0x73')]],_0xe93b('0x7e'));ut[_0xe93b('0x80')](_0xe93b('0x81')+_0x2999f9,_0x5baf50[_0xe93b('0x15')][_0x2999f9][_0xe93b('0x73')]);}ut[_0xe93b('0x80')](_0xe93b('0x82')+_0x2999f9,_0x5baf50['actions'][_0x2999f9]['queue']);delete _0x5baf50['actions'][_0x2999f9];}},0x2328);}});}});};Preview[_0xe93b('0x10')][_0xe93b('0x6a')]=function(){var _0x139794=this;loggerAction[_0xe93b('0x5b')](_0xe93b('0x83'),_[_0xe93b('0x84')](this[_0xe93b('0x15')]));for(var _0x5f77f2 in this[_0xe93b('0x15')]){if(_0x139794[_0xe93b('0x15')][_0xe93b('0x6b')](_0x5f77f2)){_0x139794[_0xe93b('0x6d')](_0x5f77f2);}}};Preview['prototype'][_0xe93b('0x6c')]=function(_0x376fcf){var _0x385029=this;rpcDb[_0xe93b('0x85')](_0x376fcf['id'],ut['agentReadyId'](this[_0xe93b('0x16')]))[_0xe93b('0x86')](function(_0x3c34f4){if(!_[_0xe93b('0x70')](_0x3c34f4)){for(var _0x3c76d0=0x0;_0x3c76d0<_0x3c34f4[_0xe93b('0x87')];_0x3c76d0+=0x1){if(ut['getDiff'](_0x3c34f4[_0x3c76d0][_0xe93b('0x88')])<_0x376fcf[_0xe93b('0x89')]*0x3c){if(_0x3c34f4[_0x3c76d0][_0xe93b('0x8a')]&&!_0x3c34f4[_0x3c76d0][_0xe93b('0x8a')][_0xe93b('0x8b')]){_0x385029[_0xe93b('0x8c')](_0x3c34f4[_0x3c76d0]['id'])[_0xe93b('0x86')](ut['logger2'](_0xe93b('0x8d')))[_0xe93b('0x7c')](ut[_0xe93b('0x8e')](_0xe93b('0x8d')));}else{rpcDb[_0xe93b('0x8f')](_0x3c34f4[_0x3c76d0]['id']);}}else{var _0x3e9fbe=new Action(_0x3c34f4[_0x3c76d0],_0x376fcf);_0x3e9fbe[_0xe93b('0x90')]=moment()[_0xe93b('0x91')](_0xe93b('0x92'));_0x376fcf[_0xe93b('0x43')]+=0x1;ut[_0xe93b('0x93')](_0x3e9fbe,0x17,'RecallInQueue');if(_0x376fcf[_0xe93b('0x94')]){rpcDb['rescheduleContactInQueue'](ut[_0xe93b('0x95')](_0x3c34f4[_0x3c76d0]));rpcDb[_0xe93b('0x96')](_0x3e9fbe,_0xe93b('0x97'));}else{ut['logCustomer'](_0x3e9fbe,0x16,_0xe93b('0x98'));rpcDb[_0xe93b('0x96')](_0x3e9fbe,_0xe93b('0x99'));rpcDb['createCustomerFinal'](_0x3e9fbe,_0xe93b('0x99'));}}}}})['catch'](ut['logger2']('[getContactRecallMe]'));};Preview[_0xe93b('0x10')][_0xe93b('0x9a')]=function(_0x5e7ce5){_0x5e7ce5[_0xe93b('0x5f')]=!![];if(ut[_0xe93b('0x9b')](_0x5e7ce5['loggedIn'])){_0x5e7ce5[_0xe93b('0x61')]=_0xe93b('0x9c');}else if(!ut[_0xe93b('0x9d')](_0x5e7ce5[_0xe93b('0x36')])){_0x5e7ce5[_0xe93b('0x61')]=_0xe93b('0x62');}else if(!this['isTrunkReachable'](_0x5e7ce5['Trunk'])){if(!this['isTrunkReachable'](_0x5e7ce5[_0xe93b('0x9e')])){_0x5e7ce5['message']=_0xe93b('0x9f');}else{_0x5e7ce5[_0xe93b('0x61')]=_0xe93b('0xa0');}}else{_0x5e7ce5[_0xe93b('0x61')]='ACTIVE';}emitCampaignPreview(_0x5e7ce5);};Preview[_0xe93b('0x10')]['callProgressDetectingCustomer']=function(_0x3f9c19,_0x3e2f5c,_0x24b772){var _0x24aeae=this;var _0x3ddf52=this[_0xe93b('0x15')][_0x3e2f5c];var _0x2a2e51=this[_0xe93b('0x13')][_0x3ddf52[_0xe93b('0x73')]];var _0x15300d;if(_0x2a2e51){switch(_0x24b772){case'1':_0x2a2e51[_0xe93b('0x41')]+=0x1;_0x3ddf52[_0xe93b('0xa1')]+=0x1;_0x3ddf52[_0xe93b('0xa2')]=ut[_0xe93b('0xa3')](_0x3ddf52);ut['logCustomer'](_0x3ddf52,0x0,_0xe93b('0xa4'));ami[_0xe93b('0x26')](_0xe93b('0xa5'),ut[_0xe93b('0xa6')](_0x3ddf52,'nosuchnumber'));rpcDb[_0xe93b('0x96')](_0x3ddf52,_0xe93b('0xa7'));if(ut[_0xe93b('0xa3')](_0x3ddf52)>=_0x2a2e51[_0xe93b('0xa8')]){_0x15300d=ut[_0xe93b('0xa9')](_0x3ddf52,0xf,_0xe93b('0xaa'));rpcDb[_0xe93b('0xab')](_0x15300d,_0xe93b('0xac'));}else{if(_0x3ddf52[_0xe93b('0xa1')]>=_0x2a2e51[_0xe93b('0xad')]){rpcDb[_0xe93b('0xab')](_0x3ddf52,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xe93b('0xae')](ut[_0xe93b('0xaf')](_0x3ddf52,_0xe93b('0xa1'),_0x2a2e51[_0xe93b('0xb0')]),_0x3ddf52[_0xe93b('0xb1')],_0x3ddf52[_0xe93b('0xb2')]);}}delete this[_0xe93b('0x15')][_0x3f9c19[_0xe93b('0xb3')]];break;case _0xe93b('0xb4'):var _0x186e05=moment()[_0xe93b('0x91')](_0xe93b('0x92'));_0x3ddf52['responsetime']=_0x186e05;_0x3ddf52[_0xe93b('0xb5')]=_0x186e05;_0x3ddf52[_0xe93b('0x76')]=!![];_0x2a2e51[_0xe93b('0x2e')]+=0x1;logger[_0xe93b('0x5b')](_0xe93b('0xb6'),_0x3ddf52[_0xe93b('0xb7')],_0xe93b('0xb8'),_0x2a2e51[_0xe93b('0x29')],_0xe93b('0x75'),_0x2a2e51[_0xe93b('0x2e')]);ami[_0xe93b('0x26')](_0xe93b('0xb9'),ut['buildObj'](_0x3ddf52,'connect',this[_0xe93b('0x13')][_0x3ddf52[_0xe93b('0x73')]]));if(_0x2a2e51[_0xe93b('0xba')]){ami[_0xe93b('0x26')](_0xe93b('0xbb'),ut[_0xe93b('0xbc')](_0x3ddf52));}break;case'16':ami[_0xe93b('0x26')]('custom:agentcomplete',ut[_0xe93b('0xa6')](_0x3ddf52,_0xe93b('0xbd'),this[_0xe93b('0x13')][_0x3ddf52[_0xe93b('0x73')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x3ddf52,_0xe93b('0xbd')));_0x2a2e51['outboundAnswerCallsDay']+=0x1;_0x2a2e51['total']+=0x1;_0x2a2e51[_0xe93b('0x2b')]+=0x1;ut[_0xe93b('0x7f')](_0x2a2e51,'[16]');_0x3ddf52[_0xe93b('0xa2')]=ut[_0xe93b('0xa3')](_0x3ddf52);ut[_0xe93b('0x93')](_0x3ddf52,0x4,'Answer');rpcDb[_0xe93b('0x96')](_0x3ddf52,_0xe93b('0xbe'));rpcDb[_0xe93b('0xab')](_0x3ddf52,_0xe93b('0xbf'));rpcDb[_0xe93b('0xc0')](_0x3ddf52);_0x2a2e51['sumDuration']+=_0x3ddf52[_0xe93b('0xc1')];_0x2a2e51[_0xe93b('0x2f')]+=_0x3ddf52[_0xe93b('0xc1')];logger['info'](_0xe93b('0xc2'),_0x3ddf52['uniqueid'],'\x20Queue',_0x2a2e51[_0xe93b('0x29')],'pTalking:\x20',_0x2a2e51[_0xe93b('0x2e')]);delete this[_0xe93b('0x15')][_0x3f9c19[_0xe93b('0xb3')]];break;case _0xe93b('0xc3'):_0x2a2e51[_0xe93b('0xc4')]+=0x1;_0x3ddf52['countbusyretry']+=0x1;_0x3ddf52['countglobal']=ut[_0xe93b('0xa3')](_0x3ddf52);ut[_0xe93b('0x93')](_0x3ddf52,0x5,_0xe93b('0xc5'));ami[_0xe93b('0x26')](_0xe93b('0xc6'),ut['buildObj'](_0x3ddf52,_0xe93b('0xc7')));rpcDb[_0xe93b('0x96')](_0x3ddf52,_0xe93b('0xc8'));if(ut[_0xe93b('0xa3')](_0x3ddf52)>=_0x2a2e51['dialGlobalMaxRetry']){_0x15300d=ut[_0xe93b('0xa9')](_0x3ddf52,0xf,'Global');rpcDb[_0xe93b('0xab')](_0x15300d,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x3ddf52['countbusyretry']>=_0x2a2e51[_0xe93b('0xc9')]){rpcDb[_0xe93b('0xab')](_0x3ddf52,_0xe93b('0xc8'));}else{rpcDb[_0xe93b('0xae')](ut[_0xe93b('0xaf')](_0x3ddf52,_0xe93b('0xca'),_0x2a2e51[_0xe93b('0xcb')]),_0x3ddf52['unlockAgent'],_0x3ddf52['activeContact']);}}break;case _0xe93b('0xcc'):_0x2a2e51[_0xe93b('0xcd')]+=0x1;_0x3ddf52[_0xe93b('0xce')]+=0x1;_0x3ddf52[_0xe93b('0xa2')]=ut['totalGlobal'](_0x3ddf52);ut[_0xe93b('0x93')](_0x3ddf52,0x3,_0xe93b('0xcf'));ami[_0xe93b('0x26')]('custom:agentnoanswer',ut['buildObj'](_0x3ddf52,_0xe93b('0xd0')));rpcDb['createCustomerHistory'](_0x3ddf52,_0xe93b('0xd1'));if(ut['totalGlobal'](_0x3ddf52)>=_0x2a2e51['dialGlobalMaxRetry']){_0x15300d=ut[_0xe93b('0xa9')](_0x3ddf52,0xf,_0xe93b('0xaa'));rpcDb[_0xe93b('0xab')](_0x15300d,_0xe93b('0xd2'));}else{if(_0x3ddf52[_0xe93b('0xce')]>=_0x2a2e51['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x3ddf52,_0xe93b('0xd1'));}else{rpcDb[_0xe93b('0xae')](ut[_0xe93b('0xaf')](_0x3ddf52,'countnoanswerretry',_0x2a2e51[_0xe93b('0xd3')]),_0x3ddf52['unlockAgent'],_0x3ddf52['activeContact']);}}break;case _0xe93b('0xd4'):_0x2a2e51[_0xe93b('0xd5')]+=0x1;_0x3ddf52[_0xe93b('0xd6')]+=0x1;_0x3ddf52[_0xe93b('0xa2')]=ut[_0xe93b('0xa3')](_0x3ddf52);ut['logCustomer'](_0x3ddf52,0x8,'Congestion');ami[_0xe93b('0x26')](_0xe93b('0xd7'),ut[_0xe93b('0xa6')](_0x3ddf52,_0xe93b('0xd8')));rpcDb[_0xe93b('0x96')](_0x3ddf52,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0xe93b('0xa3')](_0x3ddf52)>=_0x2a2e51[_0xe93b('0xa8')]){_0x15300d=ut[_0xe93b('0xa9')](_0x3ddf52,0xf,_0xe93b('0xaa'));rpcDb['createCustomerFinal'](_0x15300d,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x3ddf52[_0xe93b('0xd6')]>=_0x2a2e51[_0xe93b('0xd9')]){rpcDb[_0xe93b('0xab')](_0x3ddf52,_0xe93b('0xda'));}else{rpcDb[_0xe93b('0xae')](ut[_0xe93b('0xaf')](_0x3ddf52,_0xe93b('0xd6'),_0x2a2e51[_0xe93b('0xcb')]),_0x3ddf52[_0xe93b('0xb1')],_0x3ddf52[_0xe93b('0xb2')]);}}break;case _0xe93b('0xdb'):_0x2a2e51[_0xe93b('0x44')]+=0x1;_0x3ddf52[_0xe93b('0xdc')]+=0x1;_0x3ddf52['countglobal']=ut[_0xe93b('0xa3')](_0x3ddf52);ut[_0xe93b('0x93')](_0x3ddf52,0x14,_0xe93b('0xdd'));ami[_0xe93b('0x26')](_0xe93b('0xde'),ut[_0xe93b('0xa6')](_0x3ddf52,_0xe93b('0xdf')));rpcDb[_0xe93b('0x96')](_0x3ddf52,_0xe93b('0xe0'));if(ut[_0xe93b('0xa3')](_0x3ddf52)>=_0x2a2e51[_0xe93b('0xa8')]){_0x15300d=ut[_0xe93b('0xa9')](_0x3ddf52,0x14,_0xe93b('0xdd'));rpcDb[_0xe93b('0xab')](_0x15300d,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3ddf52[_0xe93b('0xdc')]>=_0x2a2e51['dialAgentRejectMaxRetry']){rpcDb[_0xe93b('0xab')](_0x3ddf52,_0xe93b('0xe1'));}else{rpcDb[_0xe93b('0xae')](ut[_0xe93b('0xaf')](_0x3ddf52,_0xe93b('0xdc'),_0x2a2e51[_0xe93b('0xe2')]),_0x3ddf52[_0xe93b('0xb1')],_0x3ddf52[_0xe93b('0xb2')]);}}break;case _0xe93b('0xe3'):_0x2a2e51[_0xe93b('0x46')]+=0x1;_0x3ddf52['countabandonedretry']+=0x1;_0x3ddf52[_0xe93b('0xa2')]=ut[_0xe93b('0xa3')](_0x3ddf52);ut[_0xe93b('0x93')](_0x3ddf52,0xb,_0xe93b('0xe4'));rpcDb[_0xe93b('0x96')](_0x3ddf52,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xe93b('0xa3')](_0x3ddf52)>=_0x2a2e51[_0xe93b('0xa8')]){_0x15300d=ut[_0xe93b('0xa9')](_0x3ddf52,0xf,'Global');rpcDb[_0xe93b('0xab')](_0x15300d,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x3ddf52[_0xe93b('0xe5')]>=_0x2a2e51[_0xe93b('0xe6')]){rpcDb[_0xe93b('0xab')](_0x3ddf52,_0xe93b('0xe7'));}else{rpcDb[_0xe93b('0xae')](ut['scheduledAt'](_0x3ddf52,_0xe93b('0xe8'),_0x2a2e51['dialAbandonedRetryFrequency']),_0x3ddf52[_0xe93b('0xb1')],_0x3ddf52[_0xe93b('0xb2')]);}}break;default:if(_0x3ddf52[_0xe93b('0x76')]){ut[_0xe93b('0x7f')](_0x2a2e51,'[default]');ut[_0xe93b('0x80')](_0xe93b('0xe9')+_0x2a2e51[_0xe93b('0x29')],_0x3f9c19);}_0x2a2e51[_0xe93b('0x45')]+=0x1;_0x3ddf52[_0xe93b('0xa2')]=ut[_0xe93b('0xa3')](_0x3ddf52);ut['logCustomer'](_0x3ddf52,0xc,_0x3f9c19[_0xe93b('0xea')]||_0x3f9c19[_0xe93b('0xeb')]);rpcDb['createCustomerHistory'](_0x3ddf52,_0xe93b('0xec'));if(ut[_0xe93b('0xa3')](_0x3ddf52)>=_0x2a2e51[_0xe93b('0xa8')]){_0x15300d=ut['cloneAction'](_0x3ddf52,0xf,_0xe93b('0xaa'));rpcDb[_0xe93b('0xab')](_0x15300d,_0xe93b('0xed'));}else{rpcDb[_0xe93b('0xab')](_0x3ddf52,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xe93b('0x15')][_0x3f9c19[_0xe93b('0xb3')]];}if(!(_0x3ddf52['dialAnswer']&&_0x24b772==='16')){ut['updateOriginated'](_0x2a2e51,_0xe93b('0xee'));logger[_0xe93b('0x5b')]('[originated][decrement][callProgressDetectingCustomer]',_0x3ddf52['uniqueid'],_0xe93b('0xb8'),_0x2a2e51['name'],_0xe93b('0x74'),_0x2a2e51['originated']);}if(_0x24b772!==_0xe93b('0xb4')){delete this[_0xe93b('0x15')][_0x3f9c19[_0xe93b('0xb3')]];delete this[_0xe93b('0x15')][_0x3f9c19[_0xe93b('0xef')]];}}};Preview[_0xe93b('0x10')]['callProgressDetectingAgent']=function(_0x48c340,_0xf292bc,_0x907231){if(_[_0xe93b('0xf0')](_0xf292bc)&&_0xe93b('0xf1')!==typeof _0xf292bc){return;}if(_[_0xe93b('0xf0')](_0x907231)&&_0xe93b('0xf1')!==typeof _0x907231){return;}switch(_0x907231['reason']){case'0':ut[_0xe93b('0xf2')](_0x48c340,0x0,'NoSuchNumber');rpcDb[_0xe93b('0xf3')](_0x48c340,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xe93b('0xf2')](_0x48c340,0x3,'NoAnswer');rpcDb[_0xe93b('0xf3')](_0x48c340,_0xe93b('0xf4'));break;case'5':ut['logAgent'](_0x48c340,0x5,_0xe93b('0xc5'));rpcDb['createAgentHistory'](_0x48c340,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xe93b('0xf2')](_0x48c340,0x8,_0xe93b('0xf5'));rpcDb[_0xe93b('0xf3')](_0x48c340,_0xe93b('0xf6'));break;case'22':ut[_0xe93b('0xf2')](_0x48c340,0x16,_0xe93b('0xf7'));rpcDb['createAgentHistory'](_0x48c340,_0xe93b('0xf8'));break;default:ut[_0xe93b('0xf2')](_0x48c340,0xc,_0x907231['reason']);rpcDb[_0xe93b('0xf3')](_0x48c340,_0xe93b('0xf6'));}ut[_0xe93b('0xf9')](_0xf292bc,_0xe93b('0xfa'));logger['info'](_0xe93b('0xfb'),_0x48c340[_0xe93b('0xb7')],_0xe93b('0xb8'),_0xf292bc['name'],_0xe93b('0x74'),_0xf292bc[_0xe93b('0x4f')]);delete this[_0xe93b('0x15')][_0x48c340[_0xe93b('0xb7')]];};Preview[_0xe93b('0x10')]['checkInBlack']=function(_0xc9b58e,_0x5663a5,_0x224910,_0x323ea4,_0x31663f){var _0x5ce3de=this;return new BPromise(function(_0x2bf980,_0x5edcac){if(_[_0xe93b('0x70')](_0x5663a5)||_[_0xe93b('0x70')](_0x5663a5[_0xe93b('0xfc')])||_[_0xe93b('0x70')](_0x5663a5[_0xe93b('0xfc')][_0xe93b('0xfd')])||_['isNil'](_0x5663a5[_0xe93b('0x7a')])){_0x5edcac(ut[_0xe93b('0x61')](_0xe93b('0xfe'),_0x323ea4,_0x31663f));return;}var _0x43b015=uuid['v4']();var _0x157e06=_0x5ce3de[_0xe93b('0x13')][_0x5663a5[_0xe93b('0x72')][_0xe93b('0x29')]];var _0x433336=_0x224910?_0x5ce3de[_0xe93b('0x16')][_0x224910]['id']:undefined;_0x5ce3de[_0xe93b('0x15')][_0x43b015]=new Action(_0x5663a5,_0x157e06,_0x43b015,_0x224910,_0x433336);var _0x3d2be1=_0x5ce3de[_0xe93b('0x15')][_0x43b015];_0x3d2be1[_0xe93b('0xb1')]=_0x323ea4;_0x3d2be1[_0xe93b('0xb2')]=_0x31663f;_0x3d2be1[_0xe93b('0xff')]=_0x224910;if(_[_0xe93b('0x100')](_0xc9b58e)){_0x5ce3de[_0xe93b('0x101')](_0x3d2be1,_0x157e06,_0x5663a5,_0x224910)['then'](function(_0xd1f703){logger[_0xe93b('0x5b')](_0xe93b('0x102'),_0xe93b('0x103')+_0x3d2be1[_0xe93b('0x73')]+_0xe93b('0x104')+_0x3d2be1[_0xe93b('0x105')],JSON['stringify'](_0xd1f703));ami[_0xe93b('0x26')](_0xe93b('0x106'),ut[_0xe93b('0xa6')](_0x3d2be1,_0xe93b('0x107'),_0x5ce3de[_0xe93b('0x13')][_0x3d2be1['queue']]));_0x2bf980(ut[_0xe93b('0x61')](_0xe93b('0x108')));})[_0xe93b('0x7c')](function(_0xf625a6){ut[_0xe93b('0x63')](_0xe93b('0x109'),_0xf625a6);_0x5edcac(ut[_0xe93b('0x61')](_0xe93b('0x10a'),_0x323ea4,_0x31663f));});}else{_0x157e06[_0xe93b('0x3d')]+=0x1;ut['logBlacklist'](_0x3d2be1);rpcDb['createHistory'](_0x3d2be1,'[Blacklist][error]');delete _0x5ce3de[_0xe93b('0x15')][_0x43b015];_0x5edcac(ut[_0xe93b('0x61')]('Contact\x20in\x20black\x20List',_0x323ea4,_0x31663f));}});};Preview[_0xe93b('0x10')][_0xe93b('0x10b')]=function(_0x16782a){return!_['isNil'](_0x16782a)&&!_['isNil'](_0x16782a[_0xe93b('0x29')])&&!_[_0xe93b('0x70')](_0x16782a[_0xe93b('0x56')])&&_0x16782a['active']&&!_[_0xe93b('0x70')](this[_0xe93b('0x10c')][util[_0xe93b('0x91')](_0xe93b('0x10d'),_0x16782a[_0xe93b('0x29')])])&&!_[_0xe93b('0x70')](this[_0xe93b('0x10c')][util[_0xe93b('0x91')](_0xe93b('0x10d'),_0x16782a[_0xe93b('0x29')])][_0xe93b('0x10e')])&&(this[_0xe93b('0x10c')][util[_0xe93b('0x91')](_0xe93b('0x10d'),_0x16782a['name'])][_0xe93b('0x10e')]===_0xe93b('0x10f')||this[_0xe93b('0x10c')][util[_0xe93b('0x91')]('SIP/%s',_0x16782a[_0xe93b('0x29')])][_0xe93b('0x10e')]==='unmonitored');};Preview[_0xe93b('0x10')][_0xe93b('0x8c')]=function(_0x445ab6,_0x32d88d){var _0xb75724=this;return new BPromise(function(_0x15adee,_0x56745c){_0xb75724['execRun'](_0x445ab6,_0x32d88d)[_0xe93b('0x86')](function(_0x4f36a2){_0x15adee(_[_0xe93b('0x77')](_0x4f36a2,['message']));})[_0xe93b('0x7c')](function(_0x41a43f){if(_0x41a43f[_0xe93b('0x110')]){rpcDb[_0xe93b('0x111')](_0x445ab6);}if(_0x41a43f[_0xe93b('0x56')]){rpcDb[_0xe93b('0x8f')](_0x445ab6);}_0x56745c(_[_0xe93b('0x77')](_0x41a43f,[_0xe93b('0x61')]));});});};Preview[_0xe93b('0x10')][_0xe93b('0x112')]=function(_0x3dbdc8,_0x150633){var _0x2f7e32=this;return new BPromise(function(_0x90ef10,_0x2d8217){var _0x59e646,_0x1bf373;rpcDb['getContactPreview'](_0x3dbdc8)[_0xe93b('0x86')](function(_0x3f1156){if(!_[_0xe93b('0x70')](_0x3f1156[0x0])){_0x1bf373=_0x3f1156[0x0][_0xe93b('0x113')]?![]:!![];_0x59e646=_0x3f1156[0x0]['recallme']?!![]:![];_0x59e646=_0x150633?!![]:_0x59e646;}var _0x511620=_0x2f7e32['validateContact'](_0x3f1156);if(_0x511620[_0xe93b('0x114')]){rpcDb[_0xe93b('0x115')](_['pick'](_0x3f1156[0x0],[_0xe93b('0x7a'),_0xe93b('0x116')]))['then'](function(_0x3a4c3b){_0x2f7e32[_0xe93b('0x117')](_0x3a4c3b,_0x3f1156[0x0],_0x150633,_0x1bf373,_0x59e646)[_0xe93b('0x86')](function(_0x5a08ed){_0x90ef10(_0x5a08ed);})[_0xe93b('0x7c')](function(_0xe0436a){_0x2d8217(_0xe0436a);});})[_0xe93b('0x7c')](function(_0x5be121){ut[_0xe93b('0x63')](_0xe93b('0x118'),_0x5be121);_0x2d8217(ut[_0xe93b('0x61')]('Call\x20unsuccessful',_0x1bf373,_0x59e646));});}else{_0x2d8217(ut[_0xe93b('0x61')](_0x511620['message'],_0x1bf373,_0x59e646));}})[_0xe93b('0x7c')](function(_0x537096){ut['logger'](_0xe93b('0x119'),_0x537096);_0x2d8217(ut[_0xe93b('0x61')](_0xe93b('0x11a'),![],!![]));});});};Preview[_0xe93b('0x10')][_0xe93b('0x11b')]=function(_0xca5ce){if(_[_0xe93b('0x70')](_0xca5ce)||_['isEmpty'](_0xca5ce)||!_['isNil'](_0xca5ce[0x0][_0xe93b('0x8a')])&&_[_0xe93b('0x70')](_0xca5ce[0x0][_0xe93b('0x8a')][_0xe93b('0x29')])){ut[_0xe93b('0x63')](_0xe93b('0x11c'),_0xca5ce);return{'isValid':![],'message':_0xe93b('0x11d')};}var _0x3456cc=this['campaignsPreview'][_0xca5ce[0x0][_0xe93b('0x72')][_0xe93b('0x29')]];_0x3456cc[_0xe93b('0x61')]=_0xe93b('0xa0');if(_['isNil'](_0x3456cc)){ut[_0xe93b('0x63')](_0xe93b('0x11e'),_0x3456cc);return{'isValid':![],'message':_0xe93b('0x11f')};}if(!this[_0xe93b('0x10b')](_0x3456cc[_0xe93b('0x55')])){ut[_0xe93b('0x63')](_0xe93b('0x120'),'campaign\x20Name:\x20'+_0x3456cc[_0xe93b('0x29')]+_0xe93b('0x121'));if(!this[_0xe93b('0x10b')](_0x3456cc['TrunkBackup'])){ut['logger'](_0xe93b('0x120'),_0x3456cc['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xe93b('0x122')};}}if(!ut[_0xe93b('0x9d')](_0x3456cc[_0xe93b('0x36')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x3456cc[_0xe93b('0x29')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x3456cc[_0xe93b('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xe93b('0x10')][_0xe93b('0x101')]=function(_0x17ea09,_0x2fe4d5,_0x311b70,_0x29b505){var _0x55cfa3=this;return new BPromise(function(_0x5e7a6b,_0x305582){var _0x16b663=_0x17ea09['uniqueid'];var _0x1c7425=_0x55cfa3[_0xe93b('0x10b')](_0x2fe4d5[_0xe93b('0x55')])?util['format'](_0xe93b('0x123'),_0x2fe4d5[_0xe93b('0x55')][_0xe93b('0x29')],_['isNil'](_0x2fe4d5[_0xe93b('0x3a')])?'':_0x2fe4d5[_0xe93b('0x3a')][_0xe93b('0x124')]()||'',_0x2fe4d5[_0xe93b('0x125')]>0x0?_0x311b70['Contact']['phone']['substring'](_0x2fe4d5[_0xe93b('0x125')]):_0x311b70['Contact'][_0xe93b('0xfd')]):util[_0xe93b('0x91')]('SIP/%s/%s%s',_['isNil'](_0x2fe4d5[_0xe93b('0x9e')])?_0x2fe4d5[_0xe93b('0x55')][_0xe93b('0x29')]:_0x2fe4d5[_0xe93b('0x9e')][_0xe93b('0x29')],_['isNil'](_0x2fe4d5[_0xe93b('0x3a')])?'':_0x2fe4d5[_0xe93b('0x3a')][_0xe93b('0x124')]()||'',_0x2fe4d5['dialCutDigit']>0x0?_0x311b70[_0xe93b('0xfc')][_0xe93b('0xfd')][_0xe93b('0x126')](_0x2fe4d5[_0xe93b('0x125')]):_0x311b70[_0xe93b('0xfc')]['phone']);var _0x32b7d6=_0x55cfa3['isTrunkReachable'](_0x2fe4d5['Trunk'])?ut['getCallerId'](_0x2fe4d5[_0xe93b('0x55')][_0xe93b('0x57')],_0x2fe4d5['dialOriginateCallerIdName'],_0x2fe4d5[_0xe93b('0x127')]>0x0?ut['getCallerIdRandom'](_0x2fe4d5[_0xe93b('0x39')],_0x2fe4d5[_0xe93b('0x127')]):_0x2fe4d5[_0xe93b('0x39')]):ut[_0xe93b('0x128')](_[_0xe93b('0x70')](_0x2fe4d5[_0xe93b('0x9e')])?_0x2fe4d5[_0xe93b('0x55')][_0xe93b('0x57')]:_0x2fe4d5[_0xe93b('0x9e')][_0xe93b('0x57')],_0x2fe4d5[_0xe93b('0x38')],_0x2fe4d5['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x2fe4d5[_0xe93b('0x39')],_0x2fe4d5[_0xe93b('0x127')]):_0x2fe4d5[_0xe93b('0x39')]);if(_0x32b7d6){_0x17ea09[_0xe93b('0x129')]=ut[_0xe93b('0x12a')](_0x32b7d6);_0x17ea09[_0xe93b('0x12b')]=ut['extractCalleridNumber'](_0x32b7d6);}var _0x3a40a1=ut['addVariables'](_0x2fe4d5,_0x311b70,_0x1c7425,_0x32b7d6,_0x16b663,_0x17ea09);_[_0xe93b('0x12c')](_0x17ea09,ut[_0xe93b('0x12d')](_0x3a40a1));_0x17ea09[_0xe93b('0x90')]=moment()[_0xe93b('0x91')](_0xe93b('0x92'));ami[_0xe93b('0x7b')](ut[_0xe93b('0x12e')](_0x17ea09,_0x2fe4d5,_0x3a40a1,_0x17ea09[_0xe93b('0xb2')],_0x29b505))[_0xe93b('0x86')](function(_0x1bb01f){_0x2fe4d5[_0xe93b('0x4f')]+=0x1;logger['info'](_0xe93b('0x12f'),_0x16b663,_0xe93b('0xb8'),_0x2fe4d5['name'],_0xe93b('0x74'),_0x2fe4d5[_0xe93b('0x4f')]);_0x5e7a6b(_0x1bb01f);})['catch'](function(_0x24d674){ut['logAgent'](_0x17ea09,0xe,'OriginateError');rpcDb[_0xe93b('0xf3')](_0x17ea09,'[originateFailure][logOriginateFailure]');_0x305582(_0x24d674);});});};Preview[_0xe93b('0x10')]['syncNewExten']=function(_0x317257){if(this['actions'][_0x317257[_0xe93b('0xb3')]]){this[_0xe93b('0x15')][_0x317257[_0xe93b('0xb3')]]['channel']=_0x317257[_0xe93b('0x130')];}};Preview[_0xe93b('0x10')][_0xe93b('0x131')]=function(_0x429978){var _0x4d954d=this;var _0x2c7fe4=this[_0xe93b('0x15')][_0x429978[_0xe93b('0x132')]];if(_0x2c7fe4){if(_0x2c7fe4[_0xe93b('0xff')]&&this['agents'][_0x2c7fe4[_0xe93b('0xff')]]){ut[_0xe93b('0x133')](_0x2c7fe4,this[_0xe93b('0x16')][_0x2c7fe4[_0xe93b('0xff')]][_0xe93b('0x29')],this['agents'][_0x2c7fe4[_0xe93b('0xff')]]['id']);}var _0xcf55e=_[_0xe93b('0x134')](_0x2c7fe4);_0xcf55e[_0xe93b('0x135')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x30b583=_0x4d954d[_0xe93b('0x13')][_0x2c7fe4['queue']];if(ut['isFailure'](_0x429978['response'])){if(_0x2c7fe4[_0xe93b('0xb1')]){rpcDb['unlockContact'](_0x2c7fe4[_0xe93b('0x105')]);}if(_0x2c7fe4[_0xe93b('0xb2')]){rpcDb['disableContact'](_0x2c7fe4[_0xe93b('0x105')]);}ami[_0xe93b('0x26')]('custom:agentringnoanswer',ut['buildObj'](_0x2c7fe4,_0xe93b('0x136'),this['campaignsPreview'][_0x2c7fe4[_0xe93b('0x73')]]));this['callProgressDetectingAgent'](_0xcf55e,_0x30b583,_0x429978);}else{_0x2c7fe4[_0xe93b('0x90')]=moment()[_0xe93b('0x91')](_0xe93b('0x92'));ut[_0xe93b('0xf2')](_0xcf55e,0x4,_0xe93b('0x137'));rpcDb[_0xe93b('0xf3')](_0xcf55e,_0xe93b('0x138'));}}};Preview[_0xe93b('0x10')][_0xe93b('0x139')]=function(_0x5690f6){var _0x27a9b8=this;var _0x26a2d8=this[_0xe93b('0x15')][_0x5690f6['linkedid']];var _0xbcf277;if(_0x26a2d8){_0xbcf277=this[_0xe93b('0x13')][_0x26a2d8['queue']];logger[_0xe93b('0x5b')](_0xe93b('0x13a'),_0x5690f6[_0xe93b('0xb3')],_0xe93b('0xb8'),_0xbcf277[_0xe93b('0x29')],_0xe93b('0x75'),_0xbcf277[_0xe93b('0x2e')]);}if(this['actions'][_0x5690f6[_0xe93b('0xb3')]]&&_0x5690f6[_0xe93b('0xb3')]!==_0x5690f6[_0xe93b('0xb7')]){if(_0x5690f6['cause']==='16'&&this['actions'][_0x5690f6['linkedid']][_0xe93b('0x76')]){this[_0xe93b('0x13b')](_0x5690f6,_0x5690f6[_0xe93b('0xb3')],_0x5690f6['cause']);}else if(this[_0xe93b('0x15')][_0x5690f6[_0xe93b('0xb3')]][_0xe93b('0x76')]){logger[_0xe93b('0x5b')](_0xe93b('0x13c'),_0x5690f6['linkedid'],_0x5690f6[_0xe93b('0x13d')],'\x20Queue',_0xbcf277[_0xe93b('0x29')],'pTalking:\x20',_0xbcf277[_0xe93b('0x2e')]);this[_0xe93b('0x13b')](_0x5690f6,_0x5690f6[_0xe93b('0xb3')],_0x5690f6[_0xe93b('0x13d')]);}}else if(_0x26a2d8&&_[_0xe93b('0x70')](_0x26a2d8['statedesc'])&&_0xbcf277[_0xe93b('0x13e')]&&_0x5690f6['linkedid']===_0x5690f6[_0xe93b('0xb7')]&&_[_0xe93b('0x70')](_0x5690f6['reason'])&&_0x5690f6[_0xe93b('0x13d')]==='16'&&_0x5690f6[_0xe93b('0x13f')]==='6'&&_[_0xe93b('0xf0')](_0x26a2d8[_0xe93b('0x140')])){if(_0x26a2d8[_0xe93b('0xb1')]){rpcDb[_0xe93b('0x111')](_0x26a2d8[_0xe93b('0x105')]);}if(_0x26a2d8[_0xe93b('0xb2')]){rpcDb[_0xe93b('0x8f')](_0x26a2d8[_0xe93b('0x105')]);}_0x5690f6[_0xe93b('0x141')]='22';this[_0xe93b('0x142')](_0x26a2d8,_0xbcf277,_0x5690f6);}else if(_0x26a2d8&&_0x26a2d8[_0xe93b('0x140')]){if(_0x5690f6[_0xe93b('0x13d')]==='16'&&this[_0xe93b('0x15')][_0x5690f6[_0xe93b('0xb3')]]['dialAnswer']){logger[_0xe93b('0x5b')](_0xe93b('0x143'),_0x5690f6['linkedid'],_0x5690f6['cause'],_0xe93b('0xb8'),_0xbcf277['name'],_0xe93b('0x75'),_0xbcf277[_0xe93b('0x2e')]);this[_0xe93b('0x13b')](_0x5690f6,_0x5690f6[_0xe93b('0xb3')],_0x5690f6['cause']);}else if(this['actions'][_0x5690f6[_0xe93b('0xb3')]][_0xe93b('0x76')]){logger['info'](_0xe93b('0x13c'),_0x5690f6[_0xe93b('0xb3')],_0x5690f6[_0xe93b('0x13d')],'\x20Queue',_0xbcf277[_0xe93b('0x29')],_0xe93b('0x75'),_0xbcf277[_0xe93b('0x2e')]);this[_0xe93b('0x13b')](_0x5690f6,_0x5690f6[_0xe93b('0xb3')],_0x5690f6['cause']);}}};Preview[_0xe93b('0x10')][_0xe93b('0x1d')]=function(_0x368702){if(this[_0xe93b('0x15')][_0x368702[_0xe93b('0xef')]]&&_0x368702[_0xe93b('0xef')]!==_0x368702[_0xe93b('0x144')]){this[_0xe93b('0x13b')](_0x368702,_0x368702[_0xe93b('0xef')],_0x368702[_0xe93b('0xeb')]);}};Preview[_0xe93b('0x10')]['syncHangupRequest']=function(_0x2ce7f0){if(this['actions'][_0x2ce7f0[_0xe93b('0xb3')]]&&_0x2ce7f0[_0xe93b('0xb3')]!==_0x2ce7f0[_0xe93b('0xb7')]&&!this['actions'][_0x2ce7f0[_0xe93b('0xb3')]]['dialAnswer']){if(_0x2ce7f0[_0xe93b('0x13d')]==='1'){this[_0xe93b('0x13b')](_0x2ce7f0,_0x2ce7f0['linkedid'],_0x2ce7f0[_0xe93b('0x13d')]);}}};Preview[_0xe93b('0x10')][_0xe93b('0x145')]=function(_0x2227ea,_0xe5bf9e,_0x50a354){if(this['actions'][_0x2227ea]){if(_['isNil'](this[_0xe93b('0x15')][_0x2227ea][_0xe93b('0x146')])){this['actions'][_0x2227ea][_0xe93b('0x146')]={};}this[_0xe93b('0x15')][_0x2227ea][_0xe93b('0x146')][_0xe5bf9e]=_0x50a354;}};Preview[_0xe93b('0x10')]['syncVarSet']=function(_0x528fe8){try{if(!_[_0xe93b('0x70')](_0x528fe8)){if(ut['filterKey'](_[_0xe93b('0x147')](_0x528fe8[_0xe93b('0x148')])[0x0])){this[_0xe93b('0x145')](_0x528fe8[_0xe93b('0xb7')],_[_0xe93b('0x147')](_0x528fe8[_0xe93b('0x148')])[0x0],_0x528fe8[_0xe93b('0x149')]);}}}catch(_0x4fad86){logger[_0xe93b('0x14a')]('[syncVarSet][Preview]',util[_0xe93b('0x14b')](_0x4fad86,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xe93b('0x22')]=function(_0x1ffe3f){if(_0x1ffe3f){if(this[_0xe93b('0x15')][_0x1ffe3f['transfertargetlinkedid']]){this['actions'][_0x1ffe3f[_0xe93b('0x14c')]][_0xe93b('0x140')]=!![];}}};Preview['prototype'][_0xe93b('0x24')]=function(_0x4cbe70){if(_0x4cbe70){if(this[_0xe93b('0x15')][_0x4cbe70[_0xe93b('0x14d')]]){this[_0xe93b('0x15')][_0x4cbe70['transfererlinkedid']][_0xe93b('0x140')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x82af=['createCustomerFinal','[HistoryRecallClose]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','activeContact','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','acw','buildAcw','custom:agentcomplete','complete','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','[syncHangup][talking][decrement]','countbusyretry','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','countagentrejectretry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','\x20Queue','destlinkedid','isUndefined','object','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','Contact','phone','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','status','reachable','unmonitored','run','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','Call\x20unsuccessful','[Preview][getContactPreview]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','SIP/%s/%s%s','trim','substring','dialCutDigit','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','addVariables','starttime','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','clone','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','emit','type','outbound','name','strategy','answered','loggedIn','pTalking','sumBillable','total','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','message','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','loopCampaigns','syncCampaigns','hasOwnProperty','booked','recallMe','clearZombieChannel','enqueue','isNil','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','info','[action]','size','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','logCustomer','RecallFailedTimeout','createCustomerHistory'];(function(_0x538c97,_0x548d76){var _0x10df88=function(_0x51bb27){while(--_0x51bb27){_0x538c97['push'](_0x538c97['shift']());}};_0x10df88(++_0x548d76);}(_0x82af,0x1f2));var _0xf82a=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0x82af[_0x466247];return _0x4b352e;};'use strict';var util=require(_0xf82a('0x0'));var _=require('lodash');var BPromise=require(_0xf82a('0x1'));var uuid=require(_0xf82a('0x2'));var moment=require(_0xf82a('0x3'));var md5=require(_0xf82a('0x4'));var Redis=require(_0xf82a('0x5'));var config=require(_0xf82a('0x6'));var logger=require(_0xf82a('0x7'))(_0xf82a('0x8'));var loggerAction=require(_0xf82a('0x7'))(_0xf82a('0x9'));var ami=require(_0xf82a('0xa'));var rpcDb=require(_0xf82a('0xb'));var Action=require(_0xf82a('0xc'));var ut=require(_0xf82a('0xd'));config[_0xf82a('0xe')]=_[_0xf82a('0xf')](config[_0xf82a('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0xf82a('0x10'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xf82a('0x11')]['enqueue']=function(_0x3c5eb4){this[_0xf82a('0x12')]=this['tail']?this[_0xf82a('0x12')][_0xf82a('0x13')](_0x3c5eb4):_0x3c5eb4();};function Preview(_0x22c615){this[_0xf82a('0x14')]=new Sequence();this[_0xf82a('0x15')]=_0x22c615[_0xf82a('0x16')];this[_0xf82a('0x17')]=_0x22c615[_0xf82a('0x17')];this['actions']={};this['agents']=_0x22c615[_0xf82a('0x18')];this[_0xf82a('0x19')]=0x0;ami['on'](_0xf82a('0x1a'),this[_0xf82a('0x1b')]['bind'](this));ami['on']('hangup',this[_0xf82a('0x1c')][_0xf82a('0x1d')](this));ami['on'](_0xf82a('0x1e'),this[_0xf82a('0x1f')][_0xf82a('0x1d')](this));ami['on']('dialend',this[_0xf82a('0x20')]['bind'](this));ami['on'](_0xf82a('0x21'),this['syncNewExten'][_0xf82a('0x1d')](this));ami['on']('varset',this[_0xf82a('0x22')]['bind'](this));ami['on'](_0xf82a('0x23'),this['syncAttendedTransfer'][_0xf82a('0x1d')](this));ami['on'](_0xf82a('0x24'),this[_0xf82a('0x25')]['bind'](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x23936d,_0x1037d8,_0x1d9b82){io['to'](_0x23936d)[_0xf82a('0x26')](_0x1037d8,_0x1d9b82);}function emitCampaignPreview(_0x48ef2d){if(_0x48ef2d[_0xf82a('0x27')]===_0xf82a('0x28')){var _0x5b994d={'id':_0x48ef2d['id'],'name':_0x48ef2d[_0xf82a('0x29')],'strategy':_0x48ef2d[_0xf82a('0x2a')],'answered':_0x48ef2d[_0xf82a('0x2b')],'available':_0x48ef2d['available'],'loggedIn':_0x48ef2d[_0xf82a('0x2c')],'pTalking':_0x48ef2d[_0xf82a('0x2d')],'sumBillable':_0x48ef2d[_0xf82a('0x2e')],'sumDuration':_0x48ef2d['sumDuration'],'sumHoldTime':_0x48ef2d['sumHoldTime']||0x0,'talking':_0x48ef2d['talking'],'total':_0x48ef2d[_0xf82a('0x2f')],'type':_0x48ef2d[_0xf82a('0x27')],'unmanaged':_0x48ef2d['unmanaged'],'abandoned':_0x48ef2d[_0xf82a('0x30')],'waiting':_0x48ef2d['waiting'],'loggedInDb':_0x48ef2d['loggedInDb'],'dialActive':_0x48ef2d[_0xf82a('0x31')],'dialMethod':_0x48ef2d[_0xf82a('0x32')],'dialOriginateCallerIdName':_0x48ef2d[_0xf82a('0x33')],'dialOriginateCallerIdNumber':_0x48ef2d[_0xf82a('0x34')],'dialOriginateTimeout':_0x48ef2d[_0xf82a('0x35')],'dialPrefix':_0x48ef2d[_0xf82a('0x36')],'outboundAnswerAgiCallsDay':_0x48ef2d[_0xf82a('0x37')],'outboundAnswerCallsDay':_0x48ef2d[_0xf82a('0x38')],'outboundBlacklistCallsDay':_0x48ef2d[_0xf82a('0x39')],'outboundBusyCallsDay':_0x48ef2d[_0xf82a('0x3a')],'outboundCongestionCallsDay':_0x48ef2d[_0xf82a('0x3b')],'outboundDropCallsDayACS':_0x48ef2d['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x48ef2d['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x48ef2d[_0xf82a('0x3c')],'outboundNoAnswerCallsDay':_0x48ef2d['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x48ef2d['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x48ef2d[_0xf82a('0x3d')],'outboundReCallsDay':_0x48ef2d[_0xf82a('0x3e')],'outboundRejectCallsDay':_0x48ef2d[_0xf82a('0x3f')],'outboundUnknownCallsDay':_0x48ef2d[_0xf82a('0x40')],'outboundAbandonedCallsDay':_0x48ef2d[_0xf82a('0x41')],'predictiveIntervalAnsweredCalls':_0x48ef2d[_0xf82a('0x42')],'predictiveIntervalAvgHoldtime':_0x48ef2d[_0xf82a('0x43')],'predictiveIntervalAvgTalktime':_0x48ef2d['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x48ef2d[_0xf82a('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x48ef2d['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x48ef2d[_0xf82a('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x48ef2d['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x48ef2d[_0xf82a('0x46')],'predictiveIntervalMultiplicativeFactor':_0x48ef2d['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x48ef2d[_0xf82a('0x47')],'predictiveIntervalAvailable':_0x48ef2d[_0xf82a('0x48')],'predictiveIntervalTotalCalls':_0x48ef2d['predictiveIntervalTotalCalls'],'message':_0x48ef2d['message'],'originated':_0x48ef2d[_0xf82a('0x49')],'erlangCalls':_0x48ef2d[_0xf82a('0x4a')],'erlangCallToSecond':_0x48ef2d[_0xf82a('0x4b')],'erlangAbandonmentRate':_0x48ef2d['erlangAbandonmentRate'],'erlangBusyFactor':_0x48ef2d[_0xf82a('0x4c')],'startPredictive':_0x48ef2d[_0xf82a('0x4d')],'startProgressive':_0x48ef2d[_0xf82a('0x4e')]};if(_0x48ef2d['Trunk']){_0x5b994d[_0xf82a('0x4f')]={'id':_0x48ef2d[_0xf82a('0x4f')]['id'],'name':_0x48ef2d[_0xf82a('0x4f')][_0xf82a('0x29')],'active':_0x48ef2d[_0xf82a('0x4f')][_0xf82a('0x50')],'callerid':_0x48ef2d[_0xf82a('0x4f')][_0xf82a('0x51')]};}if(_0x48ef2d[_0xf82a('0x52')]){_0x5b994d[_0xf82a('0x52')]={'id':_0x48ef2d[_0xf82a('0x52')]['id'],'name':_0x48ef2d[_0xf82a('0x52')][_0xf82a('0x29')]};}var _0x53122d=md5(JSON[_0xf82a('0x53')](_0x5b994d));if(_0x48ef2d[_0xf82a('0x4')]!==_0x53122d){_0x48ef2d[_0xf82a('0x4')]=_0x53122d;emit(util[_0xf82a('0x54')]('voice:queue:%s',_0x5b994d[_0xf82a('0x29')]),_0xf82a('0x55'),_0x5b994d);}}}function emitVoiceQueueChannelRemove(_0xaa4705){logger['info'](_0xf82a('0x56'),JSON[_0xf82a('0x53')](_0xaa4705));emit(util[_0xf82a('0x54')]('voice:queue:%s',_0xaa4705[_0xf82a('0x29')]),_0xf82a('0x57'),_0xaa4705);io[_0xf82a('0x26')](_0xf82a('0x58'),_0xaa4705);}function notSendMessagesQueue(_0x39fb5b){if(_0x39fb5b[_0xf82a('0x59')]){if(_0x39fb5b[_0xf82a('0x49')]===0x0&&_0x39fb5b[_0xf82a('0x2d')]===0x0){_0x39fb5b[_0xf82a('0x59')]=![];_0x39fb5b[_0xf82a('0x5a')]=0x0;_0x39fb5b[_0xf82a('0x5b')]=0x0;_0x39fb5b['message']=_0xf82a('0x5c');ut[_0xf82a('0x5d')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x39fb5b[_0xf82a('0x29')]+_0xf82a('0x5e'));}else{_0x39fb5b[_0xf82a('0x5f')]=_0xf82a('0x60');ut[_0xf82a('0x5d')](_0xf82a('0x61'),_0x39fb5b[_0xf82a('0x29')]+'\x20is\x20disactive');}emitCampaignPreview(_0x39fb5b);}}Preview[_0xf82a('0x11')][_0xf82a('0x62')]=function(){var _0x15364a=this;setInterval(function(){_0x15364a[_0xf82a('0x63')]();},0x7cf);};Preview['prototype'][_0xf82a('0x63')]=function(){var _0x1b0876=this[_0xf82a('0x15')];this[_0xf82a('0x19')]+=0x1;for(var _0x478750 in _0x1b0876){if(_0x1b0876[_0xf82a('0x64')](_0x478750)&&(_0x1b0876[_0x478750][_0xf82a('0x32')]===_0xf82a('0x8')||_0x1b0876[_0x478750][_0xf82a('0x32')]===_0xf82a('0x65'))&&_0x1b0876[_0x478750][_0xf82a('0x27')]===_0xf82a('0x28')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x1b0876[_0xf82a('0x64')](_0x478750)&&_0x1b0876[_0x478750]['dialMethod']===_0xf82a('0x8')&&_0x1b0876[_0x478750]['type']===_0xf82a('0x28')){if(_0x1b0876[_0x478750]['dialActive']){this['setMessage'](_0x1b0876[_0x478750]);this[_0xf82a('0x66')](_0x1b0876[_0x478750]);}else{notSendMessagesQueue(_0x1b0876[_0x478750]);}}}};Preview['prototype'][_0xf82a('0x67')]=function(_0x515654){var _0x27ed1a=this;this[_0xf82a('0x14')][_0xf82a('0x68')](function(){if(!_[_0xf82a('0x69')](_0x27ed1a[_0xf82a('0x6a')][_0x515654])){loggerAction['info'](_0xf82a('0x6b'),_0x515654,_0xf82a('0x6c'),_0x27ed1a[_0xf82a('0x6a')][_0x515654][_0xf82a('0x6d')],_0xf82a('0x6e'),JSON['stringify'](_0x27ed1a['campaignsPreview'][_0x27ed1a[_0xf82a('0x6a')][_0x515654]['queue']][_0xf82a('0x49')]),_0xf82a('0x6f'),JSON[_0xf82a('0x53')](_0x27ed1a[_0xf82a('0x15')][_0x27ed1a['actions'][_0x515654][_0xf82a('0x6d')]][_0xf82a('0x2d')]),JSON[_0xf82a('0x53')](_0x27ed1a['actions'][_0x515654][_0xf82a('0x70')]),JSON[_0xf82a('0x53')](_[_0xf82a('0x71')](_0x27ed1a[_0xf82a('0x6a')][_0x515654],['contactId',_0xf82a('0x72'),_0xf82a('0x73'),_0xf82a('0x74')])));return ami['Action']({'action':'status','channel':_0x27ed1a[_0xf82a('0x6a')][_0x515654][_0xf82a('0x75')]})[_0xf82a('0x76')](function(_0x1717f4){if(_0x1717f4['message']===_0xf82a('0x77')){setTimeout(function(){if(_0x27ed1a[_0xf82a('0x6a')][_0x515654]){ut[_0xf82a('0x78')](_0x27ed1a[_0xf82a('0x15')][_0x27ed1a['actions'][_0x515654][_0xf82a('0x6d')]],'[clearZombieChannel]');if(_0x27ed1a['actions'][_0x515654]['dialAnswer']===!![]){ut[_0xf82a('0x79')](_0x27ed1a['campaignsPreview'][_0x27ed1a[_0xf82a('0x6a')][_0x515654][_0xf82a('0x6d')]],_0xf82a('0x7a'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x515654,_0x27ed1a[_0xf82a('0x6a')][_0x515654][_0xf82a('0x6d')]);}ut[_0xf82a('0x7b')]('[Dialer][checkChannel][Preview]'+_0x515654,_0x27ed1a['actions'][_0x515654]['queue']);delete _0x27ed1a[_0xf82a('0x6a')][_0x515654];}},0x2328);}});}});};Preview[_0xf82a('0x11')]['clearZombieChannels']=function(){var _0x3df19d=this;loggerAction[_0xf82a('0x7c')](_0xf82a('0x7d'),_[_0xf82a('0x7e')](this['actions']));for(var _0x59adc1 in this[_0xf82a('0x6a')]){if(_0x3df19d[_0xf82a('0x6a')][_0xf82a('0x64')](_0x59adc1)){_0x3df19d[_0xf82a('0x67')](_0x59adc1);}}};Preview[_0xf82a('0x11')][_0xf82a('0x66')]=function(_0x506f9e){var _0x37c5b5=this;rpcDb['getContactRecallMe'](_0x506f9e['id'],ut[_0xf82a('0x7f')](this['agents']))[_0xf82a('0x80')](function(_0x157631){if(!_[_0xf82a('0x69')](_0x157631)){for(var _0x435513=0x0;_0x435513<_0x157631['length'];_0x435513+=0x1){if(ut[_0xf82a('0x81')](_0x157631[_0x435513][_0xf82a('0x82')])<_0x506f9e[_0xf82a('0x83')]*0x3c){if(_0x157631[_0x435513][_0xf82a('0x84')]&&!_0x157631[_0x435513]['Agent'][_0xf82a('0x85')]){_0x37c5b5['run'](_0x157631[_0x435513]['id'])[_0xf82a('0x80')](ut[_0xf82a('0x86')](_0xf82a('0x87')))['catch'](ut[_0xf82a('0x86')]('[RecallMe]'));}else{rpcDb[_0xf82a('0x88')](_0x157631[_0x435513]['id']);}}else{var _0x46a5a7=new Action(_0x157631[_0x435513],_0x506f9e);_0x46a5a7['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x506f9e[_0xf82a('0x3e')]+=0x1;ut['logCustomer'](_0x46a5a7,0x17,_0xf82a('0x89'));if(_0x506f9e[_0xf82a('0x8a')]){rpcDb[_0xf82a('0x8b')](ut[_0xf82a('0x8c')](_0x157631[_0x435513]));rpcDb['createCustomerHistory'](_0x46a5a7,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xf82a('0x8d')](_0x46a5a7,0x16,_0xf82a('0x8e'));rpcDb[_0xf82a('0x8f')](_0x46a5a7,'[HistoryRecallClose]');rpcDb[_0xf82a('0x90')](_0x46a5a7,_0xf82a('0x91'));}}}}})[_0xf82a('0x76')](ut[_0xf82a('0x86')]('[getContactRecallMe]'));};Preview[_0xf82a('0x11')][_0xf82a('0x92')]=function(_0x81bd93){_0x81bd93[_0xf82a('0x59')]=!![];if(ut[_0xf82a('0x93')](_0x81bd93['loggedIn'])){_0x81bd93[_0xf82a('0x5f')]=_0xf82a('0x94');}else if(!ut[_0xf82a('0x95')](_0x81bd93[_0xf82a('0x31')])){_0x81bd93[_0xf82a('0x5f')]=_0xf82a('0x5c');}else if(!this[_0xf82a('0x96')](_0x81bd93['Trunk'])){if(!this['isTrunkReachable'](_0x81bd93[_0xf82a('0x97')])){_0x81bd93[_0xf82a('0x5f')]=_0xf82a('0x98');}else{_0x81bd93['message']='ACTIVE';}}else{_0x81bd93['message']=_0xf82a('0x99');}emitCampaignPreview(_0x81bd93);};Preview[_0xf82a('0x11')][_0xf82a('0x9a')]=function(_0x2c5000,_0x58d34d,_0x41431e){var _0x31f08c=this;var _0x316a7f=this[_0xf82a('0x6a')][_0x58d34d];var _0x79c6f5=this[_0xf82a('0x15')][_0x316a7f[_0xf82a('0x6d')]];var _0x58b484;if(_0x79c6f5){switch(_0x41431e){case'1':_0x79c6f5[_0xf82a('0x9b')]+=0x1;_0x316a7f[_0xf82a('0x9c')]+=0x1;_0x316a7f[_0xf82a('0x9d')]=ut[_0xf82a('0x9e')](_0x316a7f);ut[_0xf82a('0x8d')](_0x316a7f,0x0,_0xf82a('0x9f'));ami[_0xf82a('0x26')](_0xf82a('0xa0'),ut[_0xf82a('0xa1')](_0x316a7f,'nosuchnumber'));rpcDb[_0xf82a('0x8f')](_0x316a7f,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xf82a('0x9e')](_0x316a7f)>=_0x79c6f5[_0xf82a('0xa2')]){_0x58b484=ut['cloneAction'](_0x316a7f,0xf,_0xf82a('0xa3'));rpcDb[_0xf82a('0x90')](_0x58b484,_0xf82a('0xa4'));}else{if(_0x316a7f[_0xf82a('0x9c')]>=_0x79c6f5[_0xf82a('0xa5')]){rpcDb['createCustomerFinal'](_0x316a7f,_0xf82a('0xa4'));}else{rpcDb['rescheduleContact'](ut[_0xf82a('0xa6')](_0x316a7f,'countnosuchnumberretry',_0x79c6f5['dialNoSuchNumberRetryFrequency']),_0x316a7f[_0xf82a('0xa7')],_0x316a7f[_0xf82a('0xa8')]);}}delete this[_0xf82a('0x6a')][_0x2c5000[_0xf82a('0xa9')]];break;case'ANSWER':var _0x5e2d22=moment()[_0xf82a('0x54')](_0xf82a('0xaa'));_0x316a7f[_0xf82a('0xab')]=_0x5e2d22;_0x316a7f[_0xf82a('0xac')]=_0x5e2d22;_0x316a7f[_0xf82a('0x70')]=!![];_0x79c6f5[_0xf82a('0x2d')]+=0x1;logger[_0xf82a('0x7c')](_0xf82a('0xad'),_0x316a7f[_0xf82a('0xae')],'\x20Queue',_0x79c6f5[_0xf82a('0x29')],'pTalking:\x20',_0x79c6f5['pTalking']);ami['emit'](_0xf82a('0xaf'),ut[_0xf82a('0xa1')](_0x316a7f,'connect',this['campaignsPreview'][_0x316a7f[_0xf82a('0x6d')]]));if(_0x79c6f5[_0xf82a('0xb0')]){ami[_0xf82a('0x26')]('custom:agentConnectPreview',ut[_0xf82a('0xb1')](_0x316a7f));}break;case'16':ami[_0xf82a('0x26')](_0xf82a('0xb2'),ut[_0xf82a('0xa1')](_0x316a7f,_0xf82a('0xb3'),this[_0xf82a('0x15')][_0x316a7f[_0xf82a('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0xf82a('0xa1')](_0x316a7f,_0xf82a('0xb3')));_0x79c6f5[_0xf82a('0x38')]+=0x1;_0x79c6f5[_0xf82a('0x2f')]+=0x1;_0x79c6f5['answered']+=0x1;ut['decrementTalkink'](_0x79c6f5,_0xf82a('0xb4'));_0x316a7f[_0xf82a('0x9d')]=ut[_0xf82a('0x9e')](_0x316a7f);ut[_0xf82a('0x8d')](_0x316a7f,0x4,'Answer');rpcDb['createCustomerHistory'](_0x316a7f,_0xf82a('0xb5'));rpcDb[_0xf82a('0x90')](_0x316a7f,_0xf82a('0xb6'));rpcDb['crateCustomerReportQueue'](_0x316a7f);_0x79c6f5[_0xf82a('0xb7')]+=_0x316a7f[_0xf82a('0xb8')];_0x79c6f5[_0xf82a('0x2e')]+=_0x316a7f[_0xf82a('0xb8')];logger[_0xf82a('0x7c')](_0xf82a('0xb9'),_0x316a7f['uniqueid'],'\x20Queue',_0x79c6f5['name'],_0xf82a('0x6f'),_0x79c6f5[_0xf82a('0x2d')]);delete this[_0xf82a('0x6a')][_0x2c5000[_0xf82a('0xa9')]];break;case'BUSY':_0x79c6f5[_0xf82a('0x3a')]+=0x1;_0x316a7f[_0xf82a('0xba')]+=0x1;_0x316a7f[_0xf82a('0x9d')]=ut['totalGlobal'](_0x316a7f);ut[_0xf82a('0x8d')](_0x316a7f,0x5,'Busy');ami[_0xf82a('0x26')](_0xf82a('0xbb'),ut['buildObj'](_0x316a7f,'busy'));rpcDb['createCustomerHistory'](_0x316a7f,_0xf82a('0xbc'));if(ut[_0xf82a('0x9e')](_0x316a7f)>=_0x79c6f5[_0xf82a('0xa2')]){_0x58b484=ut[_0xf82a('0xbd')](_0x316a7f,0xf,'Global');rpcDb[_0xf82a('0x90')](_0x58b484,_0xf82a('0xbe'));}else{if(_0x316a7f[_0xf82a('0xba')]>=_0x79c6f5[_0xf82a('0xbf')]){rpcDb[_0xf82a('0x90')](_0x316a7f,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xf82a('0xc0')](ut[_0xf82a('0xa6')](_0x316a7f,_0xf82a('0xba'),_0x79c6f5['dialBusyRetryFrequency']),_0x316a7f[_0xf82a('0xa7')],_0x316a7f['activeContact']);}}break;case _0xf82a('0xc1'):_0x79c6f5[_0xf82a('0xc2')]+=0x1;_0x316a7f[_0xf82a('0xc3')]+=0x1;_0x316a7f['countglobal']=ut[_0xf82a('0x9e')](_0x316a7f);ut[_0xf82a('0x8d')](_0x316a7f,0x3,_0xf82a('0xc4'));ami[_0xf82a('0x26')](_0xf82a('0xc5'),ut[_0xf82a('0xa1')](_0x316a7f,_0xf82a('0xc6')));rpcDb['createCustomerHistory'](_0x316a7f,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x316a7f)>=_0x79c6f5['dialGlobalMaxRetry']){_0x58b484=ut[_0xf82a('0xbd')](_0x316a7f,0xf,_0xf82a('0xa3'));rpcDb[_0xf82a('0x90')](_0x58b484,_0xf82a('0xc7'));}else{if(_0x316a7f[_0xf82a('0xc3')]>=_0x79c6f5[_0xf82a('0xc8')]){rpcDb[_0xf82a('0x90')](_0x316a7f,_0xf82a('0xc9'));}else{rpcDb['rescheduleContact'](ut[_0xf82a('0xa6')](_0x316a7f,_0xf82a('0xc3'),_0x79c6f5[_0xf82a('0xca')]),_0x316a7f['unlockAgent'],_0x316a7f['activeContact']);}}break;case _0xf82a('0xcb'):_0x79c6f5[_0xf82a('0x3b')]+=0x1;_0x316a7f[_0xf82a('0xcc')]+=0x1;_0x316a7f[_0xf82a('0x9d')]=ut['totalGlobal'](_0x316a7f);ut['logCustomer'](_0x316a7f,0x8,'Congestion');ami['emit']('custom:agentcongestion',ut['buildObj'](_0x316a7f,_0xf82a('0xcd')));rpcDb[_0xf82a('0x8f')](_0x316a7f,_0xf82a('0xce'));if(ut[_0xf82a('0x9e')](_0x316a7f)>=_0x79c6f5['dialGlobalMaxRetry']){_0x58b484=ut[_0xf82a('0xbd')](_0x316a7f,0xf,_0xf82a('0xa3'));rpcDb[_0xf82a('0x90')](_0x58b484,_0xf82a('0xcf'));}else{if(_0x316a7f[_0xf82a('0xcc')]>=_0x79c6f5[_0xf82a('0xd0')]){rpcDb['createCustomerFinal'](_0x316a7f,_0xf82a('0xce'));}else{rpcDb[_0xf82a('0xc0')](ut[_0xf82a('0xa6')](_0x316a7f,_0xf82a('0xcc'),_0x79c6f5['dialBusyRetryFrequency']),_0x316a7f[_0xf82a('0xa7')],_0x316a7f[_0xf82a('0xa8')]);}}break;case'CANCEL':_0x79c6f5[_0xf82a('0x3f')]+=0x1;_0x316a7f['countagentrejectretry']+=0x1;_0x316a7f[_0xf82a('0x9d')]=ut[_0xf82a('0x9e')](_0x316a7f);ut[_0xf82a('0x8d')](_0x316a7f,0x14,'AgentReject');ami['emit'](_0xf82a('0xd1'),ut[_0xf82a('0xa1')](_0x316a7f,_0xf82a('0xd2')));rpcDb[_0xf82a('0x8f')](_0x316a7f,_0xf82a('0xd3'));if(ut['totalGlobal'](_0x316a7f)>=_0x79c6f5[_0xf82a('0xa2')]){_0x58b484=ut[_0xf82a('0xbd')](_0x316a7f,0x14,_0xf82a('0xd4'));rpcDb[_0xf82a('0x90')](_0x58b484,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x316a7f[_0xf82a('0xd5')]>=_0x79c6f5['dialAgentRejectMaxRetry']){rpcDb[_0xf82a('0x90')](_0x316a7f,_0xf82a('0xd6'));}else{rpcDb[_0xf82a('0xc0')](ut[_0xf82a('0xa6')](_0x316a7f,_0xf82a('0xd5'),_0x79c6f5[_0xf82a('0xd7')]),_0x316a7f[_0xf82a('0xa7')],_0x316a7f[_0xf82a('0xa8')]);}}break;case _0xf82a('0xd8'):_0x79c6f5['outboundAbandonedCallsDay']+=0x1;_0x316a7f[_0xf82a('0xd9')]+=0x1;_0x316a7f['countglobal']=ut[_0xf82a('0x9e')](_0x316a7f);ut['logCustomer'](_0x316a7f,0xb,'Abandoned');rpcDb[_0xf82a('0x8f')](_0x316a7f,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xf82a('0x9e')](_0x316a7f)>=_0x79c6f5['dialGlobalMaxRetry']){_0x58b484=ut[_0xf82a('0xbd')](_0x316a7f,0xf,'Global');rpcDb[_0xf82a('0x90')](_0x58b484,_0xf82a('0xda'));}else{if(_0x316a7f[_0xf82a('0xdb')]>=_0x79c6f5[_0xf82a('0xdc')]){rpcDb[_0xf82a('0x90')](_0x316a7f,_0xf82a('0xda'));}else{rpcDb[_0xf82a('0xc0')](ut[_0xf82a('0xa6')](_0x316a7f,'countabandonedretry',_0x79c6f5[_0xf82a('0xdd')]),_0x316a7f[_0xf82a('0xa7')],_0x316a7f[_0xf82a('0xa8')]);}}break;default:if(_0x316a7f[_0xf82a('0x70')]){ut[_0xf82a('0x79')](_0x79c6f5,'[default]');ut[_0xf82a('0x7b')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x79c6f5['name'],_0x2c5000);}_0x79c6f5['outboundUnknownCallsDay']+=0x1;_0x316a7f['countglobal']=ut[_0xf82a('0x9e')](_0x316a7f);ut[_0xf82a('0x8d')](_0x316a7f,0xc,_0x2c5000[_0xf82a('0xde')]||_0x2c5000[_0xf82a('0xdf')]);rpcDb[_0xf82a('0x8f')](_0x316a7f,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0xf82a('0x9e')](_0x316a7f)>=_0x79c6f5[_0xf82a('0xa2')]){_0x58b484=ut[_0xf82a('0xbd')](_0x316a7f,0xf,_0xf82a('0xa3'));rpcDb[_0xf82a('0x90')](_0x58b484,_0xf82a('0xe0'));}else{rpcDb[_0xf82a('0x90')](_0x316a7f,_0xf82a('0xe0'));}delete this[_0xf82a('0x6a')][_0x2c5000[_0xf82a('0xa9')]];}if(!(_0x316a7f['dialAnswer']&&_0x41431e==='16')){ut[_0xf82a('0x78')](_0x79c6f5,_0xf82a('0xe1'));logger[_0xf82a('0x7c')]('[originated][decrement][callProgressDetectingCustomer]',_0x316a7f[_0xf82a('0xae')],_0xf82a('0xe2'),_0x79c6f5[_0xf82a('0x29')],'originated:\x20',_0x79c6f5['originated']);}if(_0x41431e!=='ANSWER'){delete this[_0xf82a('0x6a')][_0x2c5000['linkedid']];delete this[_0xf82a('0x6a')][_0x2c5000[_0xf82a('0xe3')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x2fb6e1,_0x43fd2d,_0x1148bb){if(_[_0xf82a('0xe4')](_0x43fd2d)&&_0xf82a('0xe5')!==typeof _0x43fd2d){return;}if(_[_0xf82a('0xe4')](_0x1148bb)&&'object'!==typeof _0x1148bb){return;}switch(_0x1148bb['reason']){case'0':ut[_0xf82a('0xe6')](_0x2fb6e1,0x0,_0xf82a('0x9f'));rpcDb['createAgentHistory'](_0x2fb6e1,_0xf82a('0xe7'));break;case'3':ut[_0xf82a('0xe6')](_0x2fb6e1,0x3,_0xf82a('0xc4'));rpcDb[_0xf82a('0xe8')](_0x2fb6e1,_0xf82a('0xe9'));break;case'5':ut[_0xf82a('0xe6')](_0x2fb6e1,0x5,_0xf82a('0xea'));rpcDb[_0xf82a('0xe8')](_0x2fb6e1,_0xf82a('0xeb'));break;case'8':ut[_0xf82a('0xe6')](_0x2fb6e1,0x8,_0xf82a('0xec'));rpcDb['createAgentHistory'](_0x2fb6e1,_0xf82a('0xed'));break;case'22':ut[_0xf82a('0xe6')](_0x2fb6e1,0x16,_0xf82a('0xee'));rpcDb[_0xf82a('0xe8')](_0x2fb6e1,_0xf82a('0xef'));break;default:ut[_0xf82a('0xe6')](_0x2fb6e1,0xc,_0x1148bb[_0xf82a('0xf0')]);rpcDb[_0xf82a('0xe8')](_0x2fb6e1,_0xf82a('0xed'));}ut[_0xf82a('0x78')](_0x43fd2d,_0xf82a('0xf1'));logger[_0xf82a('0x7c')]('[originated][decrement][callProgressDetectingAgent]',_0x2fb6e1[_0xf82a('0xae')],_0xf82a('0xe2'),_0x43fd2d[_0xf82a('0x29')],_0xf82a('0x6e'),_0x43fd2d[_0xf82a('0x49')]);delete this[_0xf82a('0x6a')][_0x2fb6e1[_0xf82a('0xae')]];};Preview[_0xf82a('0x11')]['checkInBlack']=function(_0x4195f3,_0x540531,_0x3aa7b0,_0x1caee9,_0x48ee81){var _0x4dd1b9=this;return new BPromise(function(_0x4a0cd7,_0x45d1aa){if(_['isNil'](_0x540531)||_[_0xf82a('0x69')](_0x540531[_0xf82a('0xf2')])||_[_0xf82a('0x69')](_0x540531['Contact'][_0xf82a('0xf3')])||_[_0xf82a('0x69')](_0x540531[_0xf82a('0x73')])){_0x45d1aa(ut[_0xf82a('0x5f')]('Contact\x20is\x20undefined',_0x1caee9,_0x48ee81));return;}var _0x515bd4=uuid['v4']();var _0x1be5bc=_0x4dd1b9['campaignsPreview'][_0x540531[_0xf82a('0x6c')][_0xf82a('0x29')]];var _0x5d488b=_0x3aa7b0?_0x4dd1b9[_0xf82a('0x18')][_0x3aa7b0]['id']:undefined;_0x4dd1b9['actions'][_0x515bd4]=new Action(_0x540531,_0x1be5bc,_0x515bd4,_0x3aa7b0,_0x5d488b);var _0x9033d5=_0x4dd1b9[_0xf82a('0x6a')][_0x515bd4];_0x9033d5[_0xf82a('0xa7')]=_0x1caee9;_0x9033d5[_0xf82a('0xa8')]=_0x48ee81;_0x9033d5[_0xf82a('0xf4')]=_0x3aa7b0;if(_['isEmpty'](_0x4195f3)){_0x4dd1b9[_0xf82a('0xf5')](_0x9033d5,_0x1be5bc,_0x540531,_0x3aa7b0)[_0xf82a('0x80')](function(_0x35dace){logger[_0xf82a('0x7c')](_0xf82a('0xf6'),_0xf82a('0xf7')+_0x9033d5[_0xf82a('0x6d')]+_0xf82a('0xf8')+_0x9033d5[_0xf82a('0xf9')],JSON[_0xf82a('0x53')](_0x35dace));ami[_0xf82a('0x26')](_0xf82a('0xfa'),ut[_0xf82a('0xa1')](_0x9033d5,'called',_0x4dd1b9['campaignsPreview'][_0x9033d5['queue']]));_0x4a0cd7(ut['message'](_0xf82a('0xfb')));})[_0xf82a('0x76')](function(_0x274d42){ut[_0xf82a('0x5d')](_0xf82a('0xfc'),_0x274d42);_0x45d1aa(ut['message'](_0xf82a('0xfd'),_0x1caee9,_0x48ee81));});}else{_0x1be5bc[_0xf82a('0x39')]+=0x1;ut[_0xf82a('0xfe')](_0x9033d5);rpcDb[_0xf82a('0xff')](_0x9033d5,'[Blacklist][error]');delete _0x4dd1b9[_0xf82a('0x6a')][_0x515bd4];_0x45d1aa(ut[_0xf82a('0x5f')](_0xf82a('0x100'),_0x1caee9,_0x48ee81));}});};Preview[_0xf82a('0x11')]['isTrunkReachable']=function(_0x3e6157){return!_[_0xf82a('0x69')](_0x3e6157)&&!_[_0xf82a('0x69')](_0x3e6157[_0xf82a('0x29')])&&!_['isNil'](_0x3e6157['active'])&&_0x3e6157[_0xf82a('0x50')]&&!_[_0xf82a('0x69')](this[_0xf82a('0x17')][util['format']('SIP/%s',_0x3e6157[_0xf82a('0x29')])])&&!_['isNil'](this[_0xf82a('0x17')][util['format']('SIP/%s',_0x3e6157['name'])][_0xf82a('0x101')])&&(this['trunks'][util[_0xf82a('0x54')]('SIP/%s',_0x3e6157['name'])][_0xf82a('0x101')]===_0xf82a('0x102')||this[_0xf82a('0x17')][util[_0xf82a('0x54')]('SIP/%s',_0x3e6157['name'])][_0xf82a('0x101')]===_0xf82a('0x103'));};Preview[_0xf82a('0x11')][_0xf82a('0x104')]=function(_0x1fdcfd,_0x5181e2){var _0x2d8a5c=this;return new BPromise(function(_0x5ccddb,_0x325807){_0x2d8a5c[_0xf82a('0x105')](_0x1fdcfd,_0x5181e2)[_0xf82a('0x80')](function(_0x49f176){_0x5ccddb(_[_0xf82a('0x71')](_0x49f176,['message']));})[_0xf82a('0x76')](function(_0x2de26f){if(_0x2de26f[_0xf82a('0x106')]){rpcDb[_0xf82a('0x107')](_0x1fdcfd);}if(_0x2de26f[_0xf82a('0x50')]){rpcDb[_0xf82a('0x88')](_0x1fdcfd);}_0x325807(_[_0xf82a('0x71')](_0x2de26f,['message']));});});};Preview[_0xf82a('0x11')][_0xf82a('0x105')]=function(_0x3d84f0,_0x56a90a){var _0x3acf33=this;return new BPromise(function(_0x222669,_0x2803ca){var _0xa8db78,_0x3cb53b;rpcDb[_0xf82a('0x108')](_0x3d84f0)[_0xf82a('0x80')](function(_0x2c2254){if(!_['isNil'](_0x2c2254[0x0])){_0x3cb53b=_0x2c2254[0x0][_0xf82a('0x109')]?![]:!![];_0xa8db78=_0x2c2254[0x0][_0xf82a('0x109')]?!![]:![];_0xa8db78=_0x56a90a?!![]:_0xa8db78;}var _0x171a4f=_0x3acf33[_0xf82a('0x10a')](_0x2c2254);if(_0x171a4f[_0xf82a('0x10b')]){rpcDb[_0xf82a('0x10c')](_['pick'](_0x2c2254[0x0],[_0xf82a('0x73'),_0xf82a('0x10d')]))[_0xf82a('0x80')](function(_0xdee8e6){_0x3acf33[_0xf82a('0x10e')](_0xdee8e6,_0x2c2254[0x0],_0x56a90a,_0x3cb53b,_0xa8db78)['then'](function(_0x1b332d){_0x222669(_0x1b332d);})[_0xf82a('0x76')](function(_0x7f746f){_0x2803ca(_0x7f746f);});})[_0xf82a('0x76')](function(_0xcb296f){ut[_0xf82a('0x5d')]('[Preview][checkIsBlackList]',_0xcb296f);_0x2803ca(ut[_0xf82a('0x5f')](_0xf82a('0x10f'),_0x3cb53b,_0xa8db78));});}else{_0x2803ca(ut[_0xf82a('0x5f')](_0x171a4f[_0xf82a('0x5f')],_0x3cb53b,_0xa8db78));}})[_0xf82a('0x76')](function(_0x4790cc){ut[_0xf82a('0x5d')](_0xf82a('0x110'),_0x4790cc);_0x2803ca(ut['message'](_0xf82a('0x10f'),![],!![]));});});};Preview['prototype'][_0xf82a('0x10a')]=function(_0x59c69c){if(_[_0xf82a('0x69')](_0x59c69c)||_['isEmpty'](_0x59c69c)||!_[_0xf82a('0x69')](_0x59c69c[0x0]['Agent'])&&_[_0xf82a('0x69')](_0x59c69c[0x0]['Agent'][_0xf82a('0x29')])){ut[_0xf82a('0x5d')]('[Preview][validateContact][Empty\x20Contact]',_0x59c69c);return{'isValid':![],'message':_0xf82a('0x111')};}var _0x388a66=this['campaignsPreview'][_0x59c69c[0x0][_0xf82a('0x6c')][_0xf82a('0x29')]];_0x388a66['message']='ACTIVE';if(_[_0xf82a('0x69')](_0x388a66)){ut[_0xf82a('0x5d')](_0xf82a('0x112'),_0x388a66);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xf82a('0x96')](_0x388a66[_0xf82a('0x4f')])){ut[_0xf82a('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xf82a('0x113')+_0x388a66[_0xf82a('0x29')]+_0xf82a('0x114'));if(!this[_0xf82a('0x96')](_0x388a66[_0xf82a('0x97')])){ut[_0xf82a('0x5d')](_0xf82a('0x115'),_0x388a66['name']+_0xf82a('0x116'));return{'isValid':![],'message':_0xf82a('0x117')};}}if(!ut[_0xf82a('0x95')](_0x388a66[_0xf82a('0x31')])){ut[_0xf82a('0x5d')]('[Preview][validateContact][Campaign\x20Active]',_0x388a66[_0xf82a('0x29')]+_0xf82a('0x118'));return{'isValid':![],'message':_0xf82a('0x113')+_0x388a66[_0xf82a('0x29')]+_0xf82a('0x118')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xf82a('0x11')][_0xf82a('0xf5')]=function(_0x31feb9,_0x5bee20,_0x17362b,_0x3d8f70){var _0x47e758=this;return new BPromise(function(_0x31e745,_0x339bb7){var _0x21ccdb=_0x31feb9['uniqueid'];var _0x4e5453=_0x47e758['isTrunkReachable'](_0x5bee20['Trunk'])?util['format'](_0xf82a('0x119'),_0x5bee20['Trunk'][_0xf82a('0x29')],_[_0xf82a('0x69')](_0x5bee20['dialPrefix'])?'':_0x5bee20[_0xf82a('0x36')][_0xf82a('0x11a')]()||'',_0x5bee20['dialCutDigit']>0x0?_0x17362b[_0xf82a('0xf2')]['phone'][_0xf82a('0x11b')](_0x5bee20[_0xf82a('0x11c')]):_0x17362b[_0xf82a('0xf2')]['phone']):util[_0xf82a('0x54')]('SIP/%s/%s%s',_[_0xf82a('0x69')](_0x5bee20['TrunkBackup'])?_0x5bee20[_0xf82a('0x4f')][_0xf82a('0x29')]:_0x5bee20['TrunkBackup'][_0xf82a('0x29')],_[_0xf82a('0x69')](_0x5bee20['dialPrefix'])?'':_0x5bee20[_0xf82a('0x36')][_0xf82a('0x11a')]()||'',_0x5bee20['dialCutDigit']>0x0?_0x17362b[_0xf82a('0xf2')][_0xf82a('0xf3')]['substring'](_0x5bee20['dialCutDigit']):_0x17362b['Contact'][_0xf82a('0xf3')]);var _0x5a0c15=_0x47e758[_0xf82a('0x96')](_0x5bee20[_0xf82a('0x4f')])?ut['getCallerId'](_0x5bee20[_0xf82a('0x4f')]['callerid'],_0x5bee20[_0xf82a('0x33')],_0x5bee20[_0xf82a('0x11d')]>0x0?ut[_0xf82a('0x11e')](_0x5bee20['dialOriginateCallerIdNumber'],_0x5bee20[_0xf82a('0x11d')]):_0x5bee20[_0xf82a('0x34')]):ut['getCallerId'](_[_0xf82a('0x69')](_0x5bee20[_0xf82a('0x97')])?_0x5bee20['Trunk'][_0xf82a('0x51')]:_0x5bee20[_0xf82a('0x97')][_0xf82a('0x51')],_0x5bee20[_0xf82a('0x33')],_0x5bee20[_0xf82a('0x11d')]>0x0?ut[_0xf82a('0x11e')](_0x5bee20[_0xf82a('0x34')],_0x5bee20[_0xf82a('0x11d')]):_0x5bee20['dialOriginateCallerIdNumber']);if(_0x5a0c15){_0x31feb9[_0xf82a('0x11f')]=ut['extractCalleridName'](_0x5a0c15);_0x31feb9['originatecalleridnum']=ut['extractCalleridNumber'](_0x5a0c15);}var _0x16cebd=ut[_0xf82a('0x120')](_0x5bee20,_0x17362b,_0x4e5453,_0x5a0c15,_0x21ccdb,_0x31feb9);_['merge'](_0x31feb9,ut['toLowerVariables'](_0x16cebd));_0x31feb9[_0xf82a('0x121')]=moment()[_0xf82a('0x54')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xf82a('0x122')](ut['variablesAction'](_0x31feb9,_0x5bee20,_0x16cebd,_0x31feb9[_0xf82a('0xa8')],_0x3d8f70))[_0xf82a('0x80')](function(_0x55a8a8){_0x5bee20['originated']+=0x1;logger[_0xf82a('0x7c')](_0xf82a('0x123'),_0x21ccdb,'\x20Queue',_0x5bee20['name'],'originated:\x20',_0x5bee20['originated']);_0x31e745(_0x55a8a8);})[_0xf82a('0x76')](function(_0x1de4d4){ut[_0xf82a('0xe6')](_0x31feb9,0xe,_0xf82a('0x124'));rpcDb[_0xf82a('0xe8')](_0x31feb9,_0xf82a('0x125'));_0x339bb7(_0x1de4d4);});});};Preview['prototype']['syncNewExten']=function(_0x1a561e){if(this[_0xf82a('0x6a')][_0x1a561e[_0xf82a('0xa9')]]){this['actions'][_0x1a561e[_0xf82a('0xa9')]][_0xf82a('0x75')]=_0x1a561e[_0xf82a('0x75')];}};Preview['prototype']['syncOriginateResponse']=function(_0x15b1a2){var _0x574b9c=this;var _0x2b59a4=this[_0xf82a('0x6a')][_0x15b1a2[_0xf82a('0x126')]];if(_0x2b59a4){if(_0x2b59a4['lookAgent']&&this[_0xf82a('0x18')][_0x2b59a4[_0xf82a('0xf4')]]){ut['logLookAgent'](_0x2b59a4,this[_0xf82a('0x18')][_0x2b59a4['lookAgent']][_0xf82a('0x29')],this[_0xf82a('0x18')][_0x2b59a4[_0xf82a('0xf4')]]['id']);}var _0x52e1c5=_[_0xf82a('0x127')](_0x2b59a4);_0x52e1c5[_0xf82a('0xab')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2f9608=_0x574b9c['campaignsPreview'][_0x2b59a4[_0xf82a('0x6d')]];if(ut['isFailure'](_0x15b1a2[_0xf82a('0x128')])){if(_0x2b59a4[_0xf82a('0xa7')]){rpcDb[_0xf82a('0x107')](_0x2b59a4[_0xf82a('0xf9')]);}if(_0x2b59a4['activeContact']){rpcDb[_0xf82a('0x88')](_0x2b59a4['idContact']);}ami['emit'](_0xf82a('0x129'),ut[_0xf82a('0xa1')](_0x2b59a4,_0xf82a('0x12a'),this[_0xf82a('0x15')][_0x2b59a4['queue']]));this[_0xf82a('0x12b')](_0x52e1c5,_0x2f9608,_0x15b1a2);}else{_0x2b59a4[_0xf82a('0x121')]=moment()[_0xf82a('0x54')](_0xf82a('0xaa'));ut[_0xf82a('0xe6')](_0x52e1c5,0x4,_0xf82a('0x12c'));rpcDb[_0xf82a('0xe8')](_0x52e1c5,_0xf82a('0x12d'));}}};Preview[_0xf82a('0x11')][_0xf82a('0x1c')]=function(_0x1661dc){var _0x1e0095=this;var _0x37efa8=this[_0xf82a('0x6a')][_0x1661dc[_0xf82a('0xa9')]];var _0x948567;if(_0x37efa8){_0x948567=this[_0xf82a('0x15')][_0x37efa8[_0xf82a('0x6d')]];logger[_0xf82a('0x7c')]('[syncHangup][talking]',_0x1661dc[_0xf82a('0xa9')],_0xf82a('0xe2'),_0x948567[_0xf82a('0x29')],_0xf82a('0x6f'),_0x948567[_0xf82a('0x2d')]);}if(this[_0xf82a('0x6a')][_0x1661dc[_0xf82a('0xa9')]]&&_0x1661dc[_0xf82a('0xa9')]!==_0x1661dc[_0xf82a('0xae')]){if(_0x1661dc[_0xf82a('0x12e')]==='16'&&this[_0xf82a('0x6a')][_0x1661dc[_0xf82a('0xa9')]][_0xf82a('0x70')]){this[_0xf82a('0x9a')](_0x1661dc,_0x1661dc['linkedid'],_0x1661dc[_0xf82a('0x12e')]);}else if(this[_0xf82a('0x6a')][_0x1661dc['linkedid']][_0xf82a('0x70')]){logger[_0xf82a('0x7c')](_0xf82a('0x12f'),_0x1661dc[_0xf82a('0xa9')],_0x1661dc[_0xf82a('0x12e')],_0xf82a('0xe2'),_0x948567[_0xf82a('0x29')],_0xf82a('0x6f'),_0x948567['pTalking']);this[_0xf82a('0x9a')](_0x1661dc,_0x1661dc[_0xf82a('0xa9')],_0x1661dc[_0xf82a('0x12e')]);}}else if(_0x37efa8&&_[_0xf82a('0x69')](_0x37efa8[_0xf82a('0x130')])&&_0x948567['dialQueueProject']&&_0x1661dc[_0xf82a('0xa9')]===_0x1661dc['uniqueid']&&_[_0xf82a('0x69')](_0x1661dc[_0xf82a('0xf0')])&&_0x1661dc['cause']==='16'&&_0x1661dc[_0xf82a('0x131')]==='6'&&_[_0xf82a('0xe4')](_0x37efa8['transfer'])){if(_0x37efa8[_0xf82a('0xa7')]){rpcDb['unlockContact'](_0x37efa8[_0xf82a('0xf9')]);}if(_0x37efa8['activeContact']){rpcDb[_0xf82a('0x88')](_0x37efa8[_0xf82a('0xf9')]);}_0x1661dc[_0xf82a('0xf0')]='22';this['callProgressDetectingAgent'](_0x37efa8,_0x948567,_0x1661dc);}else if(_0x37efa8&&_0x37efa8[_0xf82a('0x132')]){if(_0x1661dc[_0xf82a('0x12e')]==='16'&&this[_0xf82a('0x6a')][_0x1661dc[_0xf82a('0xa9')]][_0xf82a('0x70')]){logger[_0xf82a('0x7c')](_0xf82a('0x133'),_0x1661dc[_0xf82a('0xa9')],_0x1661dc[_0xf82a('0x12e')],_0xf82a('0xe2'),_0x948567[_0xf82a('0x29')],_0xf82a('0x6f'),_0x948567['pTalking']);this[_0xf82a('0x9a')](_0x1661dc,_0x1661dc[_0xf82a('0xa9')],_0x1661dc[_0xf82a('0x12e')]);}else if(this[_0xf82a('0x6a')][_0x1661dc[_0xf82a('0xa9')]][_0xf82a('0x70')]){logger[_0xf82a('0x7c')](_0xf82a('0x12f'),_0x1661dc[_0xf82a('0xa9')],_0x1661dc['cause'],_0xf82a('0xe2'),_0x948567['name'],_0xf82a('0x6f'),_0x948567['pTalking']);this[_0xf82a('0x9a')](_0x1661dc,_0x1661dc[_0xf82a('0xa9')],_0x1661dc[_0xf82a('0x12e')]);}}};Preview[_0xf82a('0x11')][_0xf82a('0x20')]=function(_0x2a738f){if(this[_0xf82a('0x6a')][_0x2a738f['destlinkedid']]&&_0x2a738f[_0xf82a('0xe3')]!==_0x2a738f[_0xf82a('0x134')]){this['callProgressDetectingCustomer'](_0x2a738f,_0x2a738f[_0xf82a('0xe3')],_0x2a738f[_0xf82a('0xdf')]);}};Preview['prototype'][_0xf82a('0x1f')]=function(_0x15e945){if(this[_0xf82a('0x6a')][_0x15e945['linkedid']]&&_0x15e945['linkedid']!==_0x15e945[_0xf82a('0xae')]&&!this[_0xf82a('0x6a')][_0x15e945[_0xf82a('0xa9')]][_0xf82a('0x70')]){if(_0x15e945[_0xf82a('0x12e')]==='1'){this['callProgressDetectingCustomer'](_0x15e945,_0x15e945['linkedid'],_0x15e945[_0xf82a('0x12e')]);}}};Preview[_0xf82a('0x11')][_0xf82a('0x135')]=function(_0x244711,_0x5284b8,_0x2ba5a3){if(this[_0xf82a('0x6a')][_0x244711]){if(_[_0xf82a('0x69')](this[_0xf82a('0x6a')][_0x244711][_0xf82a('0x136')])){this['actions'][_0x244711][_0xf82a('0x136')]={};}this[_0xf82a('0x6a')][_0x244711][_0xf82a('0x136')][_0x5284b8]=_0x2ba5a3;}};Preview[_0xf82a('0x11')][_0xf82a('0x22')]=function(_0x1c7e6e){try{if(!_[_0xf82a('0x69')](_0x1c7e6e)){if(ut[_0xf82a('0x137')](_[_0xf82a('0x138')](_0x1c7e6e[_0xf82a('0x139')])[0x0])){this[_0xf82a('0x135')](_0x1c7e6e[_0xf82a('0xae')],_['keys'](_0x1c7e6e['variable'])[0x0],_0x1c7e6e[_0xf82a('0x13a')]);}}}catch(_0x15600d){logger[_0xf82a('0x13b')](_0xf82a('0x13c'),util[_0xf82a('0x13d')](_0x15600d,{'showHidden':![],'depth':null}));}};Preview[_0xf82a('0x11')][_0xf82a('0x13e')]=function(_0x4e0561){if(_0x4e0561){if(this[_0xf82a('0x6a')][_0x4e0561['transfertargetlinkedid']]){this[_0xf82a('0x6a')][_0x4e0561[_0xf82a('0x13f')]][_0xf82a('0x132')]=!![];}}};Preview[_0xf82a('0x11')][_0xf82a('0x25')]=function(_0x3d43cb){if(_0x3d43cb){if(this['actions'][_0x3d43cb[_0xf82a('0x140')]]){this['actions'][_0x3d43cb['transfererlinkedid']][_0xf82a('0x132')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index de3e406..a876d03 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 _0x3c6c=['assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','createHistory','catch','resolve','then','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime'];(function(_0x569cb9,_0x31078d){var _0x14c031=function(_0x1fc9d7){while(--_0x1fc9d7){_0x569cb9['push'](_0x569cb9['shift']());}};_0x14c031(++_0x31078d);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x15e044,_0x45278d){_0x15e044=_0x15e044-0x0;var _0x3297ee=_0x3c6c[_0x15e044];return _0x3297ee;};'use strict';var util=require(_0xc3c6('0x0'));var BPromise=require('bluebird');var logger=require(_0xc3c6('0x1'))(_0xc3c6('0x2'));var _=require(_0xc3c6('0x3'));var cmHopper=require(_0xc3c6('0x4'));var cmHopperFinal=require(_0xc3c6('0x5'));var cmHopperHistory=require(_0xc3c6('0x6'));var cmHopperBlack=require(_0xc3c6('0x7'));var voiceQueueRt=require(_0xc3c6('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xc3c6('0x9'));function loggerCatch(_0x4a2ca1){return function(_0xe7731e){logger['error'](_0x4a2ca1,util['inspect'](_0xe7731e,{'showHidden':![],'depth':null}));};}function create(_0x4aed87){return BPromise['resolve']()['then'](cmHopperHistory[_0xc3c6('0xa')](_0x4aed87))[_0xc3c6('0xb')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x168fdc){return BPromise[_0xc3c6('0xc')]()[_0xc3c6('0xd')](agentReportPreview[_0xc3c6('0xa')](_0x168fdc))['catch'](loggerCatch(_0xc3c6('0xe')));}function moveContact(_0x3ba85a){return BPromise[_0xc3c6('0xc')]()['then'](cmHopper['moveContactManagedDialer'](_0x3ba85a,!![]))[_0xc3c6('0xb')](loggerCatch(_0xc3c6('0xf')));}exports[_0xc3c6('0x10')]=function(_0x648a0){return BPromise[_0xc3c6('0xc')]()[_0xc3c6('0xd')](cmHopperBlack[_0xc3c6('0x10')](_0x648a0))[_0xc3c6('0xb')](loggerCatch(_0xc3c6('0x11')));};exports[_0xc3c6('0x12')]=function(_0x5e42b8){return BPromise[_0xc3c6('0xc')]()[_0xc3c6('0xd')](cmHopper[_0xc3c6('0x12')](_0x5e42b8))[_0xc3c6('0xb')](loggerCatch(_0xc3c6('0x13')));};exports[_0xc3c6('0xa')]=function(_0x181b3b,_0x33920c){create(_0x181b3b)[_0xc3c6('0xb')](loggerCatch(_0x33920c));moveContact(_0x181b3b)[_0xc3c6('0xb')](loggerCatch(_0x33920c));};exports[_0xc3c6('0x14')]=function(_0x26c9b0,_0x11df9a){createAgent(_0x26c9b0)[_0xc3c6('0xb')](loggerCatch(_0x11df9a));};exports[_0xc3c6('0x15')]=function(_0x50a39c,_0x23cd62){create(_0x50a39c)[_0xc3c6('0xb')](loggerCatch(_0x23cd62));};exports[_0xc3c6('0x16')]=function(_0x248bfe,_0x3893c4){moveContact(_0x248bfe)[_0xc3c6('0xb')](loggerCatch(_0x3893c4));};exports[_0xc3c6('0x17')]=function(_0x3490a2,_0x22d170,_0x22aa76){if(_0x22d170){_0x3490a2[_0xc3c6('0x18')]=null;}if(_0x22aa76){_0x3490a2[_0xc3c6('0x19')]=![];}return BPromise[_0xc3c6('0xc')]()[_0xc3c6('0xd')](cmHopper[_0xc3c6('0x17')](_0x3490a2))[_0xc3c6('0xb')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xc3c6('0x1a')]=function(_0x40893b){return BPromise[_0xc3c6('0xc')]()['then'](cmHopper[_0xc3c6('0x1a')](_0x40893b))[_0xc3c6('0xb')](loggerCatch(_0xc3c6('0x1b')));};exports[_0xc3c6('0x1c')]=function(_0x2bc9bf){return BPromise[_0xc3c6('0xc')]()[_0xc3c6('0xd')](cmHopper['unlockContact']({'UserId':null},_0x2bc9bf,0x1))[_0xc3c6('0xb')](loggerCatch(_0xc3c6('0x1d')));};exports['disableContact']=function(_0x24c417){return BPromise[_0xc3c6('0xc')]()[_0xc3c6('0xd')](cmHopper[_0xc3c6('0x1c')]({'active':![]},_0x24c417,0x1))[_0xc3c6('0xb')](loggerCatch(_0xc3c6('0x1e')));};exports[_0xc3c6('0x1f')]=function(_0x2e4094){var _0x1f1d36={};_0x1f1d36['type']=_0x2e4094[_0xc3c6('0x20')];_0x1f1d36[_0xc3c6('0x21')]=_0x2e4094[_0xc3c6('0x21')];_0x1f1d36[_0xc3c6('0x22')]=_0x2e4094['calleridnum'];_0x1f1d36[_0xc3c6('0x23')]=_0x2e4094[_0xc3c6('0x23')];_0x1f1d36[_0xc3c6('0x24')]=_0x2e4094[_0xc3c6('0x24')];_0x1f1d36[_0xc3c6('0x25')]=_0x2e4094[_0xc3c6('0x26')];_0x1f1d36['queuecallerleaveAt']=_0x2e4094[_0xc3c6('0x26')];_0x1f1d36[_0xc3c6('0x27')]=0x1;_0x1f1d36[_0xc3c6('0x28')]=_0x2e4094[_0xc3c6('0x29')];_0x1f1d36[_0xc3c6('0x2a')]=_0x2e4094['membername'];_0x1f1d36[_0xc3c6('0x2b')]=_0xc3c6('0x2c');_0x1f1d36[_0xc3c6('0x2d')]=_0xc3c6('0x2e');_0x1f1d36[_0xc3c6('0x2f')]=0x0;_0x1f1d36[_0xc3c6('0x30')]=0x1;_0x1f1d36[_0xc3c6('0x31')]=_0x2e4094['membername'];_0x1f1d36[_0xc3c6('0x32')]='COMPLETED';return BPromise[_0xc3c6('0xc')]()[_0xc3c6('0xd')](voiceQueueReport[_0xc3c6('0x33')](_0x1f1d36))[_0xc3c6('0xb')](loggerCatch(_0xc3c6('0x34')));};exports[_0xc3c6('0x35')]=function(_0x4ba1ae,_0x36562e){return BPromise[_0xc3c6('0xc')]()['then'](cmHopper[_0xc3c6('0x35')](_0x4ba1ae,_0x36562e))[_0xc3c6('0xb')](loggerCatch(_0xc3c6('0x36')));};exports[_0xc3c6('0x37')]=function(_0x4140df){return BPromise[_0xc3c6('0xc')]()[_0xc3c6('0xd')](cmHopper['rescheduleContact'](_0x4140df,!![],!![]))['catch'](loggerCatch(_0xc3c6('0x38')));}; \ No newline at end of file +var _0x72b1=['queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','createHistory','catch','[createHistory]\x20','then','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt'];(function(_0xb99421,_0xaab133){var _0x4b3ec7=function(_0x591d1a){while(--_0x591d1a){_0xb99421['push'](_0xb99421['shift']());}};_0x4b3ec7(++_0xaab133);}(_0x72b1,0x16e));var _0x172b=function(_0x1e8ee0,_0x4b3d92){_0x1e8ee0=_0x1e8ee0-0x0;var _0x24b043=_0x72b1[_0x1e8ee0];return _0x24b043;};'use strict';var util=require(_0x172b('0x0'));var BPromise=require('bluebird');var logger=require(_0x172b('0x1'))(_0x172b('0x2'));var _=require(_0x172b('0x3'));var cmHopper=require(_0x172b('0x4'));var cmHopperFinal=require(_0x172b('0x5'));var cmHopperHistory=require(_0x172b('0x6'));var cmHopperBlack=require(_0x172b('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x172b('0x8'));var voiceQueueReport=require(_0x172b('0x9'));function loggerCatch(_0x475fd6){return function(_0x222624){logger['error'](_0x475fd6,util[_0x172b('0xa')](_0x222624,{'showHidden':![],'depth':null}));};}function create(_0x517363){return BPromise[_0x172b('0xb')]()['then'](cmHopperHistory[_0x172b('0xc')](_0x517363))[_0x172b('0xd')](loggerCatch(_0x172b('0xe')));}function createAgent(_0x392f1e){return BPromise['resolve']()[_0x172b('0xf')](agentReportPreview[_0x172b('0xc')](_0x392f1e))[_0x172b('0xd')](loggerCatch(_0x172b('0xe')));}function moveContact(_0xa4ada9){return BPromise[_0x172b('0xb')]()[_0x172b('0xf')](cmHopper['moveContactManagedDialer'](_0xa4ada9,!![]))[_0x172b('0xd')](loggerCatch(_0x172b('0x10')));}exports[_0x172b('0x11')]=function(_0x4970f8){return BPromise[_0x172b('0xb')]()['then'](cmHopperBlack[_0x172b('0x11')](_0x4970f8))[_0x172b('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x172b('0x12')]=function(_0x3452f2){return BPromise[_0x172b('0xb')]()[_0x172b('0xf')](cmHopper['getContactPreview'](_0x3452f2))['catch'](loggerCatch(_0x172b('0x13')));};exports[_0x172b('0xc')]=function(_0x36af74,_0x3c7fff){create(_0x36af74)['catch'](loggerCatch(_0x3c7fff));moveContact(_0x36af74)['catch'](loggerCatch(_0x3c7fff));};exports[_0x172b('0x14')]=function(_0x3b2701,_0x18c22a){createAgent(_0x3b2701)[_0x172b('0xd')](loggerCatch(_0x18c22a));};exports[_0x172b('0x15')]=function(_0x4e7cb9,_0x304b96){create(_0x4e7cb9)[_0x172b('0xd')](loggerCatch(_0x304b96));};exports[_0x172b('0x16')]=function(_0x33c62c,_0x12f3ec){moveContact(_0x33c62c)[_0x172b('0xd')](loggerCatch(_0x12f3ec));};exports[_0x172b('0x17')]=function(_0x5c7e17,_0x4edaad,_0x562db9){if(_0x4edaad){_0x5c7e17['UserId']=null;}if(_0x562db9){_0x5c7e17[_0x172b('0x18')]=![];}return BPromise['resolve']()[_0x172b('0xf')](cmHopper[_0x172b('0x17')](_0x5c7e17))[_0x172b('0xd')](loggerCatch(_0x172b('0x19')));};exports[_0x172b('0x1a')]=function(_0x24e4ff){return BPromise[_0x172b('0xb')]()[_0x172b('0xf')](cmHopper[_0x172b('0x1a')](_0x24e4ff))['catch'](loggerCatch(_0x172b('0x1b')));};exports[_0x172b('0x1c')]=function(_0x3df490){return BPromise[_0x172b('0xb')]()[_0x172b('0xf')](cmHopper[_0x172b('0x1c')]({'UserId':null},_0x3df490,0x1))[_0x172b('0xd')](loggerCatch('[unlockContact]\x20'));};exports[_0x172b('0x1d')]=function(_0x22827a){return BPromise['resolve']()[_0x172b('0xf')](cmHopper[_0x172b('0x1c')]({'active':![]},_0x22827a,0x1))[_0x172b('0xd')](loggerCatch(_0x172b('0x1e')));};exports[_0x172b('0x1f')]=function(_0x4bea8e){var _0x9624f5={};_0x9624f5[_0x172b('0x20')]=_0x4bea8e['type'];_0x9624f5['uniqueid']=_0x4bea8e[_0x172b('0x21')];_0x9624f5[_0x172b('0x22')]=_0x4bea8e[_0x172b('0x22')];_0x9624f5[_0x172b('0x23')]=_0x4bea8e[_0x172b('0x23')];_0x9624f5[_0x172b('0x24')]=_0x4bea8e[_0x172b('0x24')];_0x9624f5[_0x172b('0x25')]=_0x4bea8e[_0x172b('0x26')];_0x9624f5[_0x172b('0x27')]=_0x4bea8e[_0x172b('0x26')];_0x9624f5[_0x172b('0x28')]=0x1;_0x9624f5[_0x172b('0x29')]=_0x4bea8e[_0x172b('0x2a')];_0x9624f5[_0x172b('0x2b')]=_0x4bea8e[_0x172b('0x2c')];_0x9624f5[_0x172b('0x2d')]=_0x172b('0x2e');_0x9624f5[_0x172b('0x2f')]=_0x172b('0x30');_0x9624f5[_0x172b('0x31')]=0x0;_0x9624f5[_0x172b('0x32')]=0x1;_0x9624f5[_0x172b('0x33')]=_0x4bea8e[_0x172b('0x2c')];_0x9624f5[_0x172b('0x34')]='COMPLETED';return BPromise[_0x172b('0xb')]()[_0x172b('0xf')](voiceQueueReport[_0x172b('0x35')](_0x9624f5))['catch'](loggerCatch(_0x172b('0x36')));};exports['getContactRecallMe']=function(_0x58a4aa,_0x5cc073){return BPromise[_0x172b('0xb')]()['then'](cmHopper['getContactRecallMe'](_0x58a4aa,_0x5cc073))[_0x172b('0xd')](loggerCatch(_0x172b('0x37')));};exports[_0x172b('0x38')]=function(_0x55d96f){return BPromise[_0x172b('0xb')]()[_0x172b('0xf')](cmHopper[_0x172b('0x17')](_0x55d96f,!![],!![]))[_0x172b('0xd')](loggerCatch(_0x172b('0x39')));}; \ 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 9cbfc0b..c9240dc 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 _0x9116=['rtpaudioqosrtt','bridgepeer','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','loggerCatch','logger','inspect','error','logger2','info','getCallerId','isUndefined','string','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','isActive','addVariables','Queue','name','format','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','endtime','state','responsetime','logLookAgent','logCustomer','ringtime','talktime','answertime','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','scheduledAt','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','mandatoryDisposition','queue','interface','agentReadyId','not_inuse','status','getDiff','diff','CampaignId','filterKey','idContact','campaigntype','membername','active','scheduledat','callback','callbackuniqueid','recallme','UserId','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqos','rtpaudioqosjitterbridged'];(function(_0x5622b2,_0x5dc268){var _0x2c441b=function(_0x3a3f73){while(--_0x3a3f73){_0x5622b2['push'](_0x5622b2['shift']());}};_0x2c441b(++_0x5dc268);}(_0x9116,0x111));var _0x6911=function(_0x46275a,_0x157c56){_0x46275a=_0x46275a-0x0;var _0x1b6b39=_0x9116[_0x46275a];return _0x1b6b39;};'use strict';var util=require('util');var _=require(_0x6911('0x0'));var moment=require(_0x6911('0x1'));var logger=require(_0x6911('0x2'))(_0x6911('0x3'));var ipAgi=process['env'][_0x6911('0x4')]||'127.0.0.1';function getSeconds(_0x9832c3,_0x4317ca){var _0x3696d1=moment(_0x9832c3)[_0x6911('0x5')](0x0);var _0x2cdd4d=moment(_0x4317ca)[_0x6911('0x5')](0x0);return _0x3696d1['diff'](_0x2cdd4d,'seconds');}exports[_0x6911('0x6')]=function(_0x4a2b7d){return function(_0x248f37){logger['error'](_0x4a2b7d,util['inspect'](_0x248f37,{'showHidden':![],'depth':null}));};};exports[_0x6911('0x7')]=function(_0x30513b,_0x10d33b){logger['info'](_0x30513b,util[_0x6911('0x8')](_0x10d33b,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x26e9b7,_0x57c291){logger[_0x6911('0x9')](_0x26e9b7,util['inspect'](_0x57c291,{'showHidden':![],'depth':null}));};exports[_0x6911('0xa')]=function(_0x3f2074){return function(_0x1e9334){logger[_0x6911('0xb')](_0x3f2074,util[_0x6911('0x8')](_0x1e9334,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x540cfb,_0x1914ee,_0x16d4bc){return{'message':_0x540cfb,'unlock':_0x1914ee,'active':_0x16d4bc};};exports[_0x6911('0xc')]=function(_0xc4dd65,_0x593dde,_0x210800){if(!_[_0x6911('0xd')](_0x210800)&&'string'===typeof _0x210800&&!_['isEmpty'](_0x210800)){if(!_[_0x6911('0xd')](_0x593dde)&&_0x6911('0xe')===typeof _0x593dde&&!_['isEmpty'](_0x593dde)){return util['format'](_0x6911('0xf'),_0x593dde,_0x210800);}return util['format'](_0x6911('0xf'),_0x210800,_0x210800);}if(!_[_0x6911('0xd')](_0xc4dd65)&&_0x6911('0xe')===typeof _0xc4dd65&&!_[_0x6911('0x10')](_0xc4dd65)){return _0xc4dd65;}return _0x6911('0x11');};exports[_0x6911('0x12')]=function(_0x14afc2){if(_['isNil'](_0x14afc2)){return![];}return _0x14afc2;};exports[_0x6911('0x13')]=function(_0xa15811,_0x272ef8,_0x21d6c0,_0x41a9f2,_0x220dd8,_0x4b86fb){var _0x4dd647={'XMD-QUEUE':_0x272ef8[_0x6911('0x14')]?_0x272ef8[_0x6911('0x14')][_0x6911('0x15')]:'','XMD-CALLERID':_0x41a9f2,'XMD-CALLERID-PREVIEW':_0x4b86fb?util[_0x6911('0x16')]('\x22%s\x22\x20<%s>',_0x4b86fb[_0x6911('0x17')],_0x4b86fb[_0x6911('0x18')]):_0x41a9f2,'XMD-DIALID':_0x220dd8,'XMD-CONTACTID':_0x272ef8[_0x6911('0x19')],'XMD-CDRTYPE':_0x6911('0x1a'),'CALLERID(all)':_0x41a9f2,'XMD-VOICEQUEUEID':_0x272ef8[_0x6911('0x1b')],'XMD-DIALCHANNEL':_0x21d6c0,'XMD-DIALTIMEOUT':_0xa15811[_0x6911('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x6911('0x16')]('\x22rtTxX%s%s\x22',_0xa15811['dialQueueProject2']?'g':'',_[_0x6911('0x10')](_0xa15811['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0xa15811[_0x6911('0x1d')]||'','XMD-AGI':_0xa15811['dialQueueProject']?util[_0x6911('0x16')](_0x6911('0x1e'),ipAgi,_0xa15811[_0x6911('0x1f')]):_0x6911('0x20'),'XMD-AGIAFTER':_0xa15811[_0x6911('0x21')]?util[_0x6911('0x16')](_0x6911('0x1e'),ipAgi,_0xa15811[_0x6911('0x21')]):_0x6911('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x4b86fb?_0x4b86fb[_0x6911('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x4b86fb?_0x4b86fb[_0x6911('0x23')]:'','XMD-DESTINATION':_0x6911('0x24')};if(!_['isEmpty'](_0xa15811[_0x6911('0x25')])){_0x4dd647[util[_0x6911('0x16')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0xa15811[_0x6911('0x25')];_0x4dd647[util[_0x6911('0x16')]('%s',_0x6911('0x26'))]=_0x220dd8;}if(_0x272ef8&&_0x272ef8[_0x6911('0x27')]){for(var _0xea9e21 in _0x272ef8[_0x6911('0x27')]){if(_0x272ef8[_0x6911('0x27')][_0x6911('0x28')](_0xea9e21)){if(!_[_0x6911('0x29')](_0x272ef8[_0x6911('0x27')][_0xea9e21])&&_0xea9e21!=='id'&&_0xea9e21!==_0x6911('0x2a')&&_0xea9e21!==_0x6911('0x2b')&&_0xea9e21!=='updatedAt'){_0x4dd647[util[_0x6911('0x16')](_0x6911('0x2c'),_0x6911('0x2d'),_[_0x6911('0x2e')](_0xea9e21))]=_0x272ef8[_0x6911('0x27')][_0xea9e21];}}}}return _0x4dd647;};exports[_0x6911('0x2f')]=function(_0x87e74e){var _0x55d8a2={};for(var _0x19b9ef in _0x87e74e){if(_0x87e74e[_0x6911('0x28')](_0x19b9ef)){_0x55d8a2[util[_0x6911('0x16')]('%s',_['toLower'](_0x19b9ef))]=_0x87e74e[_0x19b9ef];}}return{'variables':_0x55d8a2};};exports[_0x6911('0x30')]=function(_0x2a80fd,_0x1c031a){if(!_[_0x6911('0x29')](_0x2a80fd)){if(_0x2a80fd[_0x6911('0x28')](_0x6911('0x31'))){if(_0x2a80fd[_0x6911('0x31')]>0x0){_0x2a80fd['originated']-=0x1;}else{logger[_0x6911('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x1c031a);}}}else{logger[_0x6911('0x9')](_0x6911('0x32'),_0x1c031a);}};exports[_0x6911('0x33')]=function(_0x3be6a2){var _0x33f459=moment()['format'](_0x6911('0x34'));_0x3be6a2['state']=0xd;_0x3be6a2[_0x6911('0x35')]=_0x6911('0x36');_0x3be6a2[_0x6911('0x37')]=_0x33f459;_0x3be6a2['responsetime']=_0x33f459;_0x3be6a2[_0x6911('0x38')]=_0x33f459;};exports['logAgent']=function(_0x5948cf,_0x1c74b1,_0x26f2d6){var _0x2080b7=moment()[_0x6911('0x16')](_0x6911('0x34'));_0x5948cf[_0x6911('0x39')]=_0x1c74b1;_0x5948cf[_0x6911('0x35')]=_0x26f2d6;_0x5948cf[_0x6911('0x3a')]=_0x2080b7;_0x5948cf['ringtime']=getSeconds(_0x5948cf['responsetime'],_0x5948cf[_0x6911('0x37')]);};exports[_0x6911('0x3b')]=function(_0x291cd3,_0x168e11,_0x2b2597){_0x291cd3['membername']=_0x168e11;_0x291cd3['UserId']=_0x2b2597;};exports[_0x6911('0x3c')]=function(_0x210537,_0x312ecf,_0x504bbd){var _0x22ce4f=moment()[_0x6911('0x16')](_0x6911('0x34'));_0x210537['state']=_0x312ecf;_0x210537[_0x6911('0x35')]=_0x504bbd;_0x210537['responsetime']=_0x210537['responsetime']?_0x210537[_0x6911('0x3a')]:_0x22ce4f;_0x210537[_0x6911('0x38')]=_0x210537[_0x6911('0x38')]?_0x210537[_0x6911('0x38')]:_0x22ce4f;_0x210537[_0x6911('0x3d')]=getSeconds(_0x210537[_0x6911('0x3a')]||0x0,_0x210537[_0x6911('0x37')]||0x0);_0x210537[_0x6911('0x3e')]=_0x210537[_0x6911('0x3f')]?getSeconds(_0x210537[_0x6911('0x38')],_0x210537[_0x6911('0x3f')]):0x0;};exports['isFailure']=function(_0x11e237){return _0x11e237===_0x6911('0x40');};exports['variablesAction']=function(_0x255dae,_0x5e3849,_0x14e5fd,_0xe62a0b,_0x1cfe65){var _0x4e2236=_0xe62a0b?_0x6911('0x41'):_0x255dae['calleridname'];_0x4e2236=_0x1cfe65?_0x6911('0x42'):_0x4e2236;return{'actionid':_0x255dae[_0x6911('0x43')],'action':_0x6911('0x44'),'channel':_0x255dae[_0x6911('0x45')],'callerid':util['format'](_0x6911('0xf'),_0x4e2236,_0x255dae[_0x6911('0x18')]),'Exten':_0x6911('0x24'),'Context':_0x6911('0x46'),'Priority':'1','variable':_0x14e5fd,'timeout':(_0x5e3849[_0x6911('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x255dae['uniqueid']};};exports[_0x6911('0x48')]=function(_0xc1b201){return _0xc1b201[_0x6911('0x49')]+_0xc1b201[_0x6911('0x4a')]+_0xc1b201[_0x6911('0x4b')]+_0xc1b201[_0x6911('0x4c')]+_0xc1b201[_0x6911('0x4d')];};exports[_0x6911('0x4e')]=function(_0x27f19d){var _0x41e9b9=_['clone'](_0x27f19d);_0x41e9b9['state']=0xf;_0x41e9b9[_0x6911('0x35')]='Global';return _0x41e9b9;};exports[_0x6911('0x4f')]=function(_0x14d5e7,_0x404a08,_0x30dab7){var _0x478857={};_0x478857[_0x404a08]=_0x14d5e7[_0x404a08];_0x478857['active']=![];_0x478857['scheduledat']=moment()[_0x6911('0x50')](_0x30dab7,_0x6911('0x51'))['format'](_0x6911('0x34'));_0x478857[_0x6911('0x19')]=_0x14d5e7[_0x6911('0x19')];_0x478857[_0x6911('0x52')]=_0x14d5e7['ListId'];_0x478857[_0x6911('0x1b')]=_0x14d5e7[_0x6911('0x1b')]||undefined;return _0x478857;};exports[_0x6911('0x53')]=function(_0x3b96d0,_0x23c281){if(!_[_0x6911('0x29')](_0x3b96d0)){if(_0x3b96d0[_0x6911('0x54')]>0x0){_0x3b96d0[_0x6911('0x54')]-=0x1;}else{logger[_0x6911('0x9')](_0x23c281,_0x6911('0x55'));}}else{logger[_0x6911('0x9')](_0x23c281,_0x6911('0x56'));}};exports['IsNotLoggedIn']=function(_0x11de17){if(_0x11de17<=0x0){return!![];}return![];};exports[_0x6911('0x57')]=function(_0x9b68ad,_0x223aa6,_0x4f5884){_0x9b68ad[_0x6911('0x58')]=_0x223aa6;_0x9b68ad[_0x6911('0x15')]=_0x9b68ad['queue'];_0x9b68ad['interface']=_0x9b68ad[_0x6911('0x45')];if(_0x4f5884){_0x9b68ad[_0x6911('0x59')]=_0x4f5884[_0x6911('0x59')];}return _0x9b68ad;};exports['buildAcw']=function(_0xd5c900){var _0x3b52b8={};_0x3b52b8[_0x6911('0x5a')]=_0xd5c900[_0x6911('0x5a')];_0x3b52b8[_0x6911('0x5b')]=_0xd5c900[_0x6911('0x45')];_0x3b52b8['uniqueid']=_0xd5c900['uniqueid'];return _0x3b52b8;};exports[_0x6911('0x5c')]=function(_0x3860c1){var _0x11aecc=[];for(var _0x45c900 in _0x3860c1){if(_0x3860c1['hasOwnProperty'](_0x45c900)){if(!_[_0x6911('0x29')](_0x3860c1[_0x45c900])&&_0x3860c1[_0x45c900]['state']===_0x6911('0x5d')&&_0x3860c1[_0x45c900][_0x6911('0x5e')]==='reachable'){_0x11aecc['push'](_0x3860c1[_0x45c900]['id']);}}}return _0x11aecc;};exports[_0x6911('0x5f')]=function(_0xe1dc78){var _0x377d7b=moment()['milliseconds'](0x0);var _0x362b81=moment(_0xe1dc78)[_0x6911('0x5')](0x0);return _0x377d7b[_0x6911('0x60')](_0x362b81,'seconds');};exports['createBody']=function(_0x5884fa){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5884fa[_0x6911('0x19')],'ListId':_0x5884fa['ListId'],'VoiceQueueId':_0x5884fa[_0x6911('0x1b')]||undefined,'CampaignId':_0x5884fa[_0x6911('0x61')]||undefined};};exports[_0x6911('0x62')]=function(_0x3eaa9b){if(_0x3eaa9b===_0x6911('0x43')||_0x3eaa9b===_0x6911('0x63')||_0x3eaa9b===_0x6911('0x5a')||_0x3eaa9b==='type'||_0x3eaa9b===_0x6911('0x64')||_0x3eaa9b==='dialAnswer'||_0x3eaa9b===_0x6911('0x65')||_0x3eaa9b==='channelAgent'||_0x3eaa9b===_0x6911('0x17')||_0x3eaa9b===_0x6911('0x66')||_0x3eaa9b===_0x6911('0x18')||_0x3eaa9b===_0x6911('0x67')||_0x3eaa9b===_0x6911('0x49')||_0x3eaa9b==='countcongestionretry'||_0x3eaa9b===_0x6911('0x4b')||_0x3eaa9b==='countglobal'||_0x3eaa9b===_0x6911('0x68')||_0x3eaa9b===_0x6911('0x69')||_0x3eaa9b==='callbackat'||_0x3eaa9b===_0x6911('0x6a')||_0x3eaa9b===_0x6911('0x19')||_0x3eaa9b===_0x6911('0x52')||_0x3eaa9b===_0x6911('0x6b')||_0x3eaa9b===_0x6911('0x1b')||_0x3eaa9b==='sipcallid'||_0x3eaa9b==='xmd-voicequeueid'||_0x3eaa9b===_0x6911('0x6c')||_0x3eaa9b===_0x6911('0x6d')||_0x3eaa9b===_0x6911('0x6e')||_0x3eaa9b===_0x6911('0x6f')||_0x3eaa9b==='xmd-dialtimeout'||_0x3eaa9b===_0x6911('0x70')||_0x3eaa9b==='xmd-dialid'||_0x3eaa9b==='xmd-dialchannel'||_0x3eaa9b===_0x6911('0x71')||_0x3eaa9b===_0x6911('0x72')||_0x3eaa9b===_0x6911('0x73')||_0x3eaa9b===_0x6911('0x74')||_0x3eaa9b===_0x6911('0x75')||_0x3eaa9b==='rtpaudioqos'||_0x3eaa9b===_0x6911('0x76')||_0x3eaa9b===_0x6911('0x77')||_0x3eaa9b==='rtpaudioqosjitterbridged'||_0x3eaa9b==='rtpaudioqosloss'||_0x3eaa9b===_0x6911('0x78')||_0x3eaa9b==='rtpaudioqosrtt'||_0x3eaa9b==='rtpaudioqosrttbridged'||_0x3eaa9b===_0x6911('0x79')||_0x3eaa9b===_0x6911('0x76')||_0x3eaa9b===_0x6911('0x77')||_0x3eaa9b===_0x6911('0x7a')||_0x3eaa9b==='rtpaudioqosloss'||_0x3eaa9b===_0x6911('0x78')||_0x3eaa9b===_0x6911('0x7b')||_0x3eaa9b==='rtpaudioqosrttbridged'||_0x3eaa9b===_0x6911('0x7c')||_0x3eaa9b==='bridgepvtcallid'||_0x3eaa9b===_0x6911('0x39')||_0x3eaa9b==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x888352,_0x184954){var _0x358eab,_0x1feff8,_0x42e8be;if(_0x184954<=0x0){_0x184954=0x1;}_0x358eab=new RegExp(_0x6911('0x7d')+_0x184954+'}$');_0x1feff8=Math[_0x6911('0x7e')](0xa,_0x184954-0x1);_0x42e8be=Math[_0x6911('0x7e')](0xa,_0x184954)-0x1;return util[_0x6911('0x16')]('%s',_[_0x6911('0x7f')](_0x888352,_0x358eab,_[_0x6911('0x80')](_0x1feff8,_0x42e8be)));};exports[_0x6911('0x81')]=function(_0x503755){var _0x2002c3=_0x503755['match'](/"(.*?)"/);return _0x2002c3?_0x2002c3[0x1]:_0x503755;};exports[_0x6911('0x82')]=function(_0x144927){var _0xe388c6=_0x144927[_0x6911('0x83')](/<(.*?)>/);return _0xe388c6?_0xe388c6[0x1]:_0x144927;}; \ No newline at end of file +var _0x1025=['XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','ringtime','logLookAgent','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','mandatoryDisposition','queue','agentReadyId','not_inuse','reachable','push','createBody','CampaignId','filterKey','idContact','type','campaigntype','membername','countbusyretry','countnoanswerretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0x1025,0x64));var _0x5102=function(_0x4bfaa7,_0x1033b0){_0x4bfaa7=_0x4bfaa7-0x0;var _0x282f8f=_0x1025[_0x4bfaa7];return _0x282f8f;};'use strict';var util=require('util');var _=require(_0x5102('0x0'));var moment=require(_0x5102('0x1'));var logger=require('../../../../config/logger')(_0x5102('0x2'));var ipAgi=process[_0x5102('0x3')][_0x5102('0x4')]||_0x5102('0x5');function getSeconds(_0x10a5de,_0x3465f8){var _0x409891=moment(_0x10a5de)[_0x5102('0x6')](0x0);var _0x50b73b=moment(_0x3465f8)[_0x5102('0x6')](0x0);return _0x409891[_0x5102('0x7')](_0x50b73b,_0x5102('0x8'));}exports[_0x5102('0x9')]=function(_0x14a7f4){return function(_0x4e0a39){logger[_0x5102('0xa')](_0x14a7f4,util[_0x5102('0xb')](_0x4e0a39,{'showHidden':![],'depth':null}));};};exports[_0x5102('0xc')]=function(_0xb62bda,_0x5b939a){logger[_0x5102('0xd')](_0xb62bda,util[_0x5102('0xb')](_0x5b939a,{'showHidden':![],'depth':null}));};exports[_0x5102('0xe')]=function(_0x279f3d,_0x256deb){logger[_0x5102('0xa')](_0x279f3d,util[_0x5102('0xb')](_0x256deb,{'showHidden':![],'depth':null}));};exports[_0x5102('0xf')]=function(_0x11b635){return function(_0x3c358d){logger['info'](_0x11b635,util[_0x5102('0xb')](_0x3c358d,{'showHidden':![],'depth':null}));};};exports[_0x5102('0x10')]=function(_0x251b39,_0x1ed0e7,_0xef74b2){return{'message':_0x251b39,'unlock':_0x1ed0e7,'active':_0xef74b2};};exports[_0x5102('0x11')]=function(_0x233352,_0x2ee24b,_0xd75407){if(!_[_0x5102('0x12')](_0xd75407)&&_0x5102('0x13')===typeof _0xd75407&&!_[_0x5102('0x14')](_0xd75407)){if(!_[_0x5102('0x12')](_0x2ee24b)&&'string'===typeof _0x2ee24b&&!_[_0x5102('0x14')](_0x2ee24b)){return util[_0x5102('0x15')]('\x22%s\x22\x20<%s>',_0x2ee24b,_0xd75407);}return util[_0x5102('0x15')](_0x5102('0x16'),_0xd75407,_0xd75407);}if(!_[_0x5102('0x12')](_0x233352)&&_0x5102('0x13')===typeof _0x233352&&!_[_0x5102('0x14')](_0x233352)){return _0x233352;}return'\x22\x22\x20<>';};exports[_0x5102('0x17')]=function(_0x5aec74){if(_[_0x5102('0x18')](_0x5aec74)){return![];}return _0x5aec74;};exports[_0x5102('0x19')]=function(_0x5d64f1,_0x4f2b9d,_0x42cc58,_0x4e4678,_0x3d719b,_0x316bfe){var _0x4a5a98={'XMD-QUEUE':_0x4f2b9d[_0x5102('0x1a')]?_0x4f2b9d[_0x5102('0x1a')][_0x5102('0x1b')]:'','XMD-CALLERID':_0x4e4678,'XMD-CALLERID-PREVIEW':_0x316bfe?util[_0x5102('0x15')](_0x5102('0x16'),_0x316bfe[_0x5102('0x1c')],_0x316bfe[_0x5102('0x1d')]):_0x4e4678,'XMD-DIALID':_0x3d719b,'XMD-CONTACTID':_0x4f2b9d[_0x5102('0x1e')],'XMD-CDRTYPE':_0x5102('0x1f'),'CALLERID(all)':_0x4e4678,'XMD-VOICEQUEUEID':_0x4f2b9d['VoiceQueueId'],'XMD-DIALCHANNEL':_0x42cc58,'XMD-DIALTIMEOUT':_0x5d64f1[_0x5102('0x20')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x5102('0x21'),_0x5d64f1[_0x5102('0x22')]?'g':'',_[_0x5102('0x14')](_0x5d64f1['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x5d64f1[_0x5102('0x23')]||'','XMD-AGI':_0x5d64f1[_0x5102('0x24')]?util[_0x5102('0x15')](_0x5102('0x25'),ipAgi,_0x5d64f1[_0x5102('0x24')]):_0x5102('0x26'),'XMD-AGIAFTER':_0x5d64f1[_0x5102('0x22')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x5d64f1[_0x5102('0x22')]):_0x5102('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x316bfe?_0x316bfe[_0x5102('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x316bfe?_0x316bfe[_0x5102('0x28')]:'','XMD-DESTINATION':_0x5102('0x29')};if(!_[_0x5102('0x14')](_0x5d64f1[_0x5102('0x2a')])){_0x4a5a98[util[_0x5102('0x15')]('%s',_0x5102('0x2b'))]=_0x5d64f1[_0x5102('0x2a')];_0x4a5a98[util[_0x5102('0x15')]('%s',_0x5102('0x2c'))]=_0x3d719b;}if(_0x4f2b9d&&_0x4f2b9d[_0x5102('0x2d')]){for(var _0x5b83c3 in _0x4f2b9d['Contact']){if(_0x4f2b9d[_0x5102('0x2d')][_0x5102('0x2e')](_0x5b83c3)){if(!_['isNil'](_0x4f2b9d[_0x5102('0x2d')][_0x5b83c3])&&_0x5b83c3!=='id'&&_0x5b83c3!==_0x5102('0x2f')&&_0x5b83c3!==_0x5102('0x30')&&_0x5b83c3!==_0x5102('0x31')){_0x4a5a98[util[_0x5102('0x15')]('%s%s',_0x5102('0x32'),_['toUpper'](_0x5b83c3))]=_0x4f2b9d['Contact'][_0x5b83c3];}}}}return _0x4a5a98;};exports[_0x5102('0x33')]=function(_0x51be6e){var _0x352e73={};for(var _0x4e1d94 in _0x51be6e){if(_0x51be6e['hasOwnProperty'](_0x4e1d94)){_0x352e73[util[_0x5102('0x15')]('%s',_[_0x5102('0x34')](_0x4e1d94))]=_0x51be6e[_0x4e1d94];}}return{'variables':_0x352e73};};exports[_0x5102('0x35')]=function(_0x42806a,_0xcb64c9){if(!_['isNil'](_0x42806a)){if(_0x42806a['hasOwnProperty'](_0x5102('0x36'))){if(_0x42806a['originated']>0x0){_0x42806a[_0x5102('0x36')]-=0x1;}else{logger[_0x5102('0xa')](_0x5102('0x37'),_0xcb64c9);}}}else{logger[_0x5102('0xa')](_0x5102('0x38'),_0xcb64c9);}};exports[_0x5102('0x39')]=function(_0xf0db66){var _0x163d3c=moment()['format'](_0x5102('0x3a'));_0xf0db66[_0x5102('0x3b')]=0xd;_0xf0db66[_0x5102('0x3c')]=_0x5102('0x3d');_0xf0db66[_0x5102('0x3e')]=_0x163d3c;_0xf0db66[_0x5102('0x3f')]=_0x163d3c;_0xf0db66[_0x5102('0x40')]=_0x163d3c;};exports['logAgent']=function(_0x8c950c,_0x181745,_0x4e4f7b){var _0x1b8699=moment()[_0x5102('0x15')](_0x5102('0x3a'));_0x8c950c['state']=_0x181745;_0x8c950c[_0x5102('0x3c')]=_0x4e4f7b;_0x8c950c[_0x5102('0x3f')]=_0x1b8699;_0x8c950c[_0x5102('0x41')]=getSeconds(_0x8c950c[_0x5102('0x3f')],_0x8c950c[_0x5102('0x3e')]);};exports[_0x5102('0x42')]=function(_0x1c3038,_0x366dc6,_0x30aa7b){_0x1c3038['membername']=_0x366dc6;_0x1c3038[_0x5102('0x43')]=_0x30aa7b;};exports[_0x5102('0x44')]=function(_0x452751,_0x3524c1,_0x3b8e36){var _0x53d125=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x452751[_0x5102('0x3b')]=_0x3524c1;_0x452751[_0x5102('0x3c')]=_0x3b8e36;_0x452751['responsetime']=_0x452751[_0x5102('0x3f')]?_0x452751[_0x5102('0x3f')]:_0x53d125;_0x452751['endtime']=_0x452751[_0x5102('0x40')]?_0x452751[_0x5102('0x40')]:_0x53d125;_0x452751['ringtime']=getSeconds(_0x452751[_0x5102('0x3f')]||0x0,_0x452751['starttime']||0x0);_0x452751[_0x5102('0x45')]=_0x452751['answertime']?getSeconds(_0x452751[_0x5102('0x40')],_0x452751[_0x5102('0x46')]):0x0;};exports[_0x5102('0x47')]=function(_0x2bc1aa){return _0x2bc1aa===_0x5102('0x48');};exports[_0x5102('0x49')]=function(_0x19ce12,_0x4bcfc4,_0x24dd80,_0x79ec8c,_0x29c01d){var _0x46dc69=_0x79ec8c?'RECALL':_0x19ce12['calleridname'];_0x46dc69=_0x29c01d?'BOOKED':_0x46dc69;return{'actionid':_0x19ce12[_0x5102('0x4a')],'action':_0x5102('0x4b'),'channel':_0x19ce12[_0x5102('0x4c')],'callerid':util[_0x5102('0x15')](_0x5102('0x16'),_0x46dc69,_0x19ce12['calleridnum']),'Exten':_0x5102('0x29'),'Context':_0x5102('0x4d'),'Priority':'1','variable':_0x24dd80,'timeout':(_0x4bcfc4[_0x5102('0x4e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x19ce12['uniqueid']};};exports[_0x5102('0x4f')]=function(_0x41f9ac){return _0x41f9ac['countbusyretry']+_0x41f9ac[_0x5102('0x50')]+_0x41f9ac['countnoanswerretry']+_0x41f9ac[_0x5102('0x51')]+_0x41f9ac[_0x5102('0x52')];};exports[_0x5102('0x53')]=function(_0x26eca5){var _0x3543dc=_[_0x5102('0x54')](_0x26eca5);_0x3543dc[_0x5102('0x3b')]=0xf;_0x3543dc[_0x5102('0x3c')]=_0x5102('0x55');return _0x3543dc;};exports[_0x5102('0x56')]=function(_0x5d7602,_0x743d48,_0x2980c2){var _0x15e72b={};_0x15e72b[_0x743d48]=_0x5d7602[_0x743d48];_0x15e72b[_0x5102('0x57')]=![];_0x15e72b[_0x5102('0x58')]=moment()[_0x5102('0x59')](_0x2980c2,_0x5102('0x5a'))[_0x5102('0x15')](_0x5102('0x3a'));_0x15e72b[_0x5102('0x1e')]=_0x5d7602[_0x5102('0x1e')];_0x15e72b[_0x5102('0x5b')]=_0x5d7602[_0x5102('0x5b')];_0x15e72b['VoiceQueueId']=_0x5d7602[_0x5102('0x5c')]||undefined;return _0x15e72b;};exports['decrementTalkink']=function(_0xedb822,_0x596277){if(!_[_0x5102('0x18')](_0xedb822)){if(_0xedb822['pTalking']>0x0){_0xedb822[_0x5102('0x5d')]-=0x1;}else{logger[_0x5102('0xa')](_0x596277,_0x5102('0x5e'));}}else{logger['error'](_0x596277,_0x5102('0x5f'));}};exports[_0x5102('0x60')]=function(_0x3830f){if(_0x3830f<=0x0){return!![];}return![];};exports[_0x5102('0x61')]=function(_0x14b333,_0x52ef3a,_0x4623ef){_0x14b333[_0x5102('0x62')]=_0x52ef3a;_0x14b333[_0x5102('0x1b')]=_0x14b333['queue'];_0x14b333[_0x5102('0x63')]=_0x14b333[_0x5102('0x4c')];if(_0x4623ef){_0x14b333[_0x5102('0x64')]=_0x4623ef['mandatoryDisposition'];}return _0x14b333;};exports['buildAcw']=function(_0x21456c){var _0x56da07={};_0x56da07[_0x5102('0x65')]=_0x21456c['queue'];_0x56da07[_0x5102('0x63')]=_0x21456c[_0x5102('0x4c')];_0x56da07['uniqueid']=_0x21456c[_0x5102('0x4a')];return _0x56da07;};exports[_0x5102('0x66')]=function(_0x4cae3f){var _0x3c3f93=[];for(var _0x470060 in _0x4cae3f){if(_0x4cae3f[_0x5102('0x2e')](_0x470060)){if(!_['isNil'](_0x4cae3f[_0x470060])&&_0x4cae3f[_0x470060]['state']===_0x5102('0x67')&&_0x4cae3f[_0x470060]['status']===_0x5102('0x68')){_0x3c3f93[_0x5102('0x69')](_0x4cae3f[_0x470060]['id']);}}}return _0x3c3f93;};exports['getDiff']=function(_0x146793){var _0xeb61e0=moment()[_0x5102('0x6')](0x0);var _0x58c8c9=moment(_0x146793)['milliseconds'](0x0);return _0xeb61e0['diff'](_0x58c8c9,_0x5102('0x8'));};exports[_0x5102('0x6a')]=function(_0x309204){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x309204[_0x5102('0x1e')],'ListId':_0x309204[_0x5102('0x5b')],'VoiceQueueId':_0x309204['VoiceQueueId']||undefined,'CampaignId':_0x309204[_0x5102('0x6b')]||undefined};};exports[_0x5102('0x6c')]=function(_0x4f136f){if(_0x4f136f===_0x5102('0x4a')||_0x4f136f===_0x5102('0x6d')||_0x4f136f===_0x5102('0x65')||_0x4f136f===_0x5102('0x6e')||_0x4f136f===_0x5102('0x6f')||_0x4f136f==='dialAnswer'||_0x4f136f===_0x5102('0x70')||_0x4f136f==='channelAgent'||_0x4f136f===_0x5102('0x1c')||_0x4f136f===_0x5102('0x57')||_0x4f136f==='calleridnum'||_0x4f136f===_0x5102('0x58')||_0x4f136f===_0x5102('0x71')||_0x4f136f===_0x5102('0x50')||_0x4f136f===_0x5102('0x72')||_0x4f136f===_0x5102('0x73')||_0x4f136f==='callback'||_0x4f136f===_0x5102('0x74')||_0x4f136f===_0x5102('0x75')||_0x4f136f===_0x5102('0x76')||_0x4f136f==='ContactId'||_0x4f136f===_0x5102('0x5b')||_0x4f136f===_0x5102('0x43')||_0x4f136f===_0x5102('0x5c')||_0x4f136f===_0x5102('0x77')||_0x4f136f===_0x5102('0x78')||_0x4f136f===_0x5102('0x79')||_0x4f136f===_0x5102('0x7a')||_0x4f136f===_0x5102('0x7b')||_0x4f136f===_0x5102('0x7c')||_0x4f136f===_0x5102('0x7d')||_0x4f136f===_0x5102('0x7e')||_0x4f136f===_0x5102('0x7f')||_0x4f136f===_0x5102('0x80')||_0x4f136f===_0x5102('0x81')||_0x4f136f===_0x5102('0x82')||_0x4f136f===_0x5102('0x83')||_0x4f136f===_0x5102('0x84')||_0x4f136f==='xmd-agi'||_0x4f136f==='rtpaudioqos'||_0x4f136f==='rtpaudioqosbridged'||_0x4f136f==='rtpaudioqosjitter'||_0x4f136f===_0x5102('0x85')||_0x4f136f===_0x5102('0x86')||_0x4f136f==='rtpaudioqoslossbridged'||_0x4f136f===_0x5102('0x87')||_0x4f136f===_0x5102('0x88')||_0x4f136f===_0x5102('0x89')||_0x4f136f===_0x5102('0x8a')||_0x4f136f===_0x5102('0x8b')||_0x4f136f==='rtpaudioqosjitterbridged'||_0x4f136f===_0x5102('0x86')||_0x4f136f===_0x5102('0x8c')||_0x4f136f===_0x5102('0x87')||_0x4f136f===_0x5102('0x88')||_0x4f136f===_0x5102('0x8d')||_0x4f136f===_0x5102('0x8e')||_0x4f136f==='state'||_0x4f136f===_0x5102('0x3c')){return![];}return!![];};exports[_0x5102('0x8f')]=function(_0x3151a5,_0x42166a){var _0x17f1a0,_0x2d0343,_0x4b1997;if(_0x42166a<=0x0){_0x42166a=0x1;}_0x17f1a0=new RegExp(_0x5102('0x90')+_0x42166a+'}$');_0x2d0343=Math[_0x5102('0x91')](0xa,_0x42166a-0x1);_0x4b1997=Math['pow'](0xa,_0x42166a)-0x1;return util[_0x5102('0x15')]('%s',_[_0x5102('0x92')](_0x3151a5,_0x17f1a0,_[_0x5102('0x93')](_0x2d0343,_0x4b1997)));};exports['extractCalleridName']=function(_0xa7d6b7){var _0x5840d0=_0xa7d6b7[_0x5102('0x94')](/"(.*?)"/);return _0x5840d0?_0x5840d0[0x1]:_0xa7d6b7;};exports[_0x5102('0x95')]=function(_0x53ade8){var _0x1addb7=_0x53ade8['match'](/<(.*?)>/);return _0x1addb7?_0x1addb7[0x1]:_0x53ade8;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 783866c..e215e7a 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 _0xb10b=['voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause','boolean','reload','voicechannel'];(function(_0x3cab38,_0x439e61){var _0x187d60=function(_0x285a14){while(--_0x285a14){_0x3cab38['push'](_0x3cab38['shift']());}};_0x187d60(++_0x439e61);}(_0xb10b,0x12a));var _0xbb10=function(_0x3f0b2a,_0x52f963){_0x3f0b2a=_0x3f0b2a-0x0;var _0x23bd63=_0xb10b[_0x3f0b2a];return _0x23bd63;};'use strict';exports[_0xbb10('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]},'membername':{'type':_0xbb10('0x1'),'required':!![]},'penalty':{'type':_0xbb10('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbb10('0x3')]={'queue':{'type':_0xbb10('0x1'),'required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x4')]={'interface':{'type':_0xbb10('0x1'),'required':!![]},'paused':{'type':_0xbb10('0x5')},'reason':{'type':'string','required':![]}};exports[_0xbb10('0x6')]={'module':{'type':_0xbb10('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x7')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]},'filename':{'type':_0xbb10('0x1')},'format':{'type':_0xbb10('0x1')},'mixmonitorid':{'type':_0xbb10('0x1')}};exports[_0xbb10('0x8')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xbb10('0x1'),'required':!![]},'context':{'type':_0xbb10('0x1')}}; \ No newline at end of file +var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x53d74e,_0x1093bf){var _0x5bdfd7=function(_0x135d2f){while(--_0x135d2f){_0x53d74e['push'](_0x53d74e['shift']());}};_0x5bdfd7(++_0x1093bf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3c460f,_0x1dcbed){_0x3c460f=_0x3c460f-0x0;var _0xb5842c=_0x5f2f[_0x3c460f];return _0xb5842c;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 66fe1ee..37436a0 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 _0xdace=['campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','agents','isNil','isUndefined','initTelephones','length','initTrunks','initVoiceQueues','voiceQueues','initTriggers','triggers','initTemplates','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','SquareProject','initVoiceExtensions','faxAccounts','bluebird','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks'];(function(_0x269492,_0x29febe){var _0x1696d9=function(_0x50750c){while(--_0x50750c){_0x269492['push'](_0x269492['shift']());}};_0x1696d9(++_0x29febe);}(_0xdace,0xc5));var _0xedac=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xdace[_0x1a36a5];return _0x746243;};'use strict';var BPromise=require(_0xedac('0x0'));var util=require('util');var _=require(_0xedac('0x1'));var moment=require(_0xedac('0x2'));var Agent=require(_0xedac('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0xedac('0x4'));var VoiceQueue=require(_0xedac('0x5'));var Trigger=require(_0xedac('0x6'));var Template=require(_0xedac('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xedac('0x8'));var ZendeskAccount=require(_0xedac('0x9'));var SalesforceAccount=require(_0xedac('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xedac('0xb'));var ZohoAccount=require(_0xedac('0xc'));var DeskAccount=require(_0xedac('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xedac('0xe'));var Dynamics365Account=require(_0xedac('0xf'));var FreshsalesAccount=require(_0xedac('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0xedac('0x11')]={};this[_0xedac('0x12')]={};this['voiceQueues']={};this['triggers']={};this[_0xedac('0x13')]={};this[_0xedac('0x14')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xedac('0x15')]={};this['channels']={};this[_0xedac('0x16')]={};this[_0xedac('0x17')]={};this[_0xedac('0x18')]={};this[_0xedac('0x19')]={};this[_0xedac('0x1a')]={};this[_0xedac('0x1b')]={};this[_0xedac('0x1c')]={};this[_0xedac('0x1d')]={};this['zohoAccounts']={};this[_0xedac('0x1e')]={};this[_0xedac('0x1f')]={};this[_0xedac('0x20')]={};this[_0xedac('0x21')]={};this[_0xedac('0x22')]={};this['faxAccounts']={};};function freeIsNotKey(_0xed25bb,_0x594b11,_0xddc7b8){var _0x2eeac9=_[_0xedac('0x23')](_0xed25bb,function(_0xba0c93,_0x4fb540){return _0xba0c93[_0xddc7b8];});for(var _0x4b2563 in _0x594b11){if(_0x594b11[_0xedac('0x24')](_0x4b2563)){if(!_0x2eeac9[_0x4b2563]){delete _0x594b11[_0x4b2563];}}}}function freeIsNotKeySip(_0x2adefa,_0x25fe64){var _0x1500ae=_['mapKeys'](_0x2adefa,function(_0x4a699b,_0x2b2ae9){return util[_0xedac('0x25')](_0xedac('0x26'),_0x4a699b[_0xedac('0x27')]);});for(var _0x2f5eee in _0x25fe64){if(_0x25fe64[_0xedac('0x24')](_0x2f5eee)){if(!_0x1500ae[_0x2f5eee]){delete _0x25fe64[_0x2f5eee];}}}}function freeIsNotKeyAgent(_0x160be7,_0x928ebe){var _0x5353e3=_[_0xedac('0x23')](_0x160be7,function(_0x510005,_0x29cd40){var _0x14fc02=_['isNil'](_0x510005[_0xedac('0x28')])?util[_0xedac('0x25')](_0xedac('0x26'),_0x510005[_0xedac('0x27')]):_0x510005[_0xedac('0x28')];return _0x14fc02;});for(var _0x167d7e in _0x928ebe){if(_0x928ebe['hasOwnProperty'](_0x167d7e)){if(!_0x5353e3[_0x167d7e]){delete _0x928ebe[_0x167d7e];}}}}function clearVoiceCallReports(_0x3114a1){_0x3114a1[_0xedac('0x29')]=0x0;_0x3114a1[_0xedac('0x2a')]=0x0;_0x3114a1[_0xedac('0x2b')]=0x0;_0x3114a1[_0xedac('0x2c')]=0x0;_0x3114a1[_0xedac('0x2d')]=0x0;}function clearCampaigns(_0x40ba53){if(!_[_0xedac('0x2e')](_0x40ba53)){for(var _0x409825 in _0x40ba53){if(_0x40ba53[_0xedac('0x24')](_0x409825)){_0x40ba53[_0x409825]['ivrTotalCallsDays']=0x0;_0x40ba53[_0x409825][_0xedac('0x2f')]=0x0;}}}}function clearVoiceQueues(_0xf0a2ce){if(!_[_0xedac('0x2e')](_0xf0a2ce)){for(var _0x5dff75 in _0xf0a2ce){if(_0xf0a2ce[_0xedac('0x24')](_0x5dff75)){_0xf0a2ce[_0x5dff75]['total']=0x0;_0xf0a2ce[_0x5dff75]['answered']=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x30')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x31')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x2b')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x2c')]=0x0;_0xf0a2ce[_0x5dff75]['sumBillable']=0x0;_0xf0a2ce[_0x5dff75]['outboundAnswerAgiCallsDay']=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x32')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x33')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x34')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x35')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x36')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x37')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x38')]=0x0;_0xf0a2ce[_0x5dff75]['outboundBlacklistCallsDay']=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x39')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x3a')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x3b')]=0x0;_0xf0a2ce[_0x5dff75]['outboundAnswerAgiCallsDay']=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x3c')]=0x0;_0xf0a2ce[_0x5dff75][_0xedac('0x3d')]=!![];}}}}Realtime['prototype'][_0xedac('0x3e')]=function(_0x2c622a,_0x51b13f){for(var _0x4255b9 in _0x51b13f){if(_0x2c622a[_0xedac('0x24')](_0x4255b9)){_0x2c622a[_0x4255b9]=_0x51b13f[_0x4255b9];}}};Realtime[_0xedac('0x3f')][_0xedac('0x40')]=function(){var _0x4473f0=this;return function(_0x2d38fd){if(_0x2d38fd){freeIsNotKeyAgent(_0x2d38fd,_0x4473f0[_0xedac('0x41')]);for(var _0xe8b54c=0x0,_0x370358={},_0x34be79={};_0xe8b54c<_0x2d38fd['length'];_0xe8b54c+=0x1){_0x370358=_0x2d38fd[_0xe8b54c];var _0x9ef574=_[_0xedac('0x42')](_0x370358[_0xedac('0x28')])?util[_0xedac('0x25')](_0xedac('0x26'),_0x370358[_0xedac('0x27')]):_0x370358[_0xedac('0x28')];if(_[_0xedac('0x43')](_0x4473f0[_0xedac('0x41')][_0x9ef574])){_0x4473f0[_0xedac('0x41')][_0x9ef574]=new Agent(_0x370358);}else{_0x4473f0[_0xedac('0x3e')](_0x4473f0[_0xedac('0x41')][_0x9ef574],_0x370358);}}}return _0x4473f0[_0xedac('0x41')];};};Realtime[_0xedac('0x3f')][_0xedac('0x44')]=function(){var _0x527878=this;return function(_0x1ddcc1){if(_0x1ddcc1){freeIsNotKeySip(_0x1ddcc1,_0x527878[_0xedac('0x11')]);for(var _0x20d997=0x0,_0x27481c={},_0x5085ae={};_0x20d997<_0x1ddcc1[_0xedac('0x45')];_0x20d997+=0x1){_0x27481c=_0x1ddcc1[_0x20d997];if(_[_0xedac('0x43')](_0x527878[_0xedac('0x11')][util['format'](_0xedac('0x26'),_0x27481c[_0xedac('0x27')])])){_0x527878[_0xedac('0x11')][util['format'](_0xedac('0x26'),_0x27481c[_0xedac('0x27')])]=new Telephone(_0x27481c);}else{_0x527878['mergeFromDatabase'](_0x527878[_0xedac('0x11')][util[_0xedac('0x25')]('SIP/%s',_0x27481c[_0xedac('0x27')])],_0x27481c);}}}return _0x527878['telephones'];};};Realtime[_0xedac('0x3f')][_0xedac('0x46')]=function(){var _0x2e3fcd=this;return function(_0x8383fb){if(_0x8383fb){freeIsNotKeySip(_0x8383fb,_0x2e3fcd[_0xedac('0x12')]);for(var _0x9ea1b1=0x0,_0x5030a9={},_0x2370aa={};_0x9ea1b1<_0x8383fb[_0xedac('0x45')];_0x9ea1b1+=0x1){_0x5030a9=_0x8383fb[_0x9ea1b1];if(_[_0xedac('0x43')](_0x2e3fcd[_0xedac('0x12')][util[_0xedac('0x25')](_0xedac('0x26'),_0x5030a9[_0xedac('0x27')])])){_0x2e3fcd[_0xedac('0x12')][util[_0xedac('0x25')](_0xedac('0x26'),_0x5030a9[_0xedac('0x27')])]=new Trunk(_0x5030a9);}else{_0x2e3fcd[_0xedac('0x3e')](_0x2e3fcd[_0xedac('0x12')][util[_0xedac('0x25')](_0xedac('0x26'),_0x5030a9[_0xedac('0x27')])],_0x5030a9);}}}return _0x2e3fcd['trunks'];};};Realtime[_0xedac('0x3f')][_0xedac('0x47')]=function(){var _0x144ff7=this;return function(_0x4d2de3){if(_0x4d2de3){freeIsNotKey(_0x4d2de3,_0x144ff7['voiceQueues'],'name');for(var _0x158209=0x0,_0x8368ca={},_0x5a3139={};_0x158209<_0x4d2de3[_0xedac('0x45')];_0x158209+=0x1){_0x8368ca=_0x4d2de3[_0x158209];if(_['isUndefined'](_0x144ff7[_0xedac('0x48')][_0x8368ca['name']])){_0x144ff7[_0xedac('0x48')][_0x8368ca[_0xedac('0x27')]]=new VoiceQueue(_0x8368ca);}else{_0x144ff7[_0xedac('0x3e')](_0x144ff7[_0xedac('0x48')][_0x8368ca[_0xedac('0x27')]],_0x8368ca);}}}return _0x144ff7['voiceQueues'];};};Realtime['prototype'][_0xedac('0x49')]=function(){var _0x51dc40=this;return function(_0x39b159){if(_0x39b159){freeIsNotKey(_0x39b159,_0x51dc40[_0xedac('0x4a')],'id');for(var _0x3cefa5=0x0,_0x4fa8e3={},_0x29a707={};_0x3cefa5<_0x39b159[_0xedac('0x45')];_0x3cefa5+=0x1){_0x4fa8e3=_0x39b159[_0x3cefa5];if(_[_0xedac('0x43')](_0x51dc40['triggers'][_0x4fa8e3['id']])){_0x51dc40[_0xedac('0x4a')][_0x4fa8e3['id']]=new Trigger(_0x4fa8e3);}else{_0x51dc40[_0xedac('0x3e')](_0x51dc40[_0xedac('0x4a')][_0x4fa8e3['id']],_0x4fa8e3);}}}return _0x51dc40['triggers'];};};Realtime['prototype'][_0xedac('0x4b')]=function(){var _0x204bb6=this;return function(_0x4c2ecd){if(_0x4c2ecd){freeIsNotKey(_0x4c2ecd,_0x204bb6['templates'],'id');for(var _0x3338de=0x0,_0x38425e={},_0x4e81bc={};_0x3338de<_0x4c2ecd[_0xedac('0x45')];_0x3338de+=0x1){_0x38425e=_0x4c2ecd[_0x3338de];if(_['isUndefined'](_0x204bb6[_0xedac('0x14')][_0x38425e['id']])){_0x204bb6[_0xedac('0x14')][_0x38425e['id']]=new Template(_0x38425e);}else{_0x204bb6[_0xedac('0x3e')](_0x204bb6[_0xedac('0x14')][_0x38425e['id']],_0x38425e);}}}return _0x204bb6[_0xedac('0x14')];};};Realtime[_0xedac('0x3f')]['initZendeskAccounts']=function(){var _0x37da04=this;return function(_0x3fb534){if(_0x3fb534){freeIsNotKey(_0x3fb534,_0x37da04['zendeskAccounts'],'id');for(var _0x8cd781=0x0,_0x2d0846={},_0x3178a1={};_0x8cd781<_0x3fb534['length'];_0x8cd781+=0x1){_0x2d0846=_0x3fb534[_0x8cd781];if(_['isUndefined'](_0x37da04[_0xedac('0x1a')][_0x2d0846['id']])){_0x37da04[_0xedac('0x1a')][_0x2d0846['id']]=new ZendeskAccount(_0x2d0846);}else{_0x37da04['mergeFromDatabase'](_0x37da04[_0xedac('0x1a')][_0x2d0846['id']],_0x2d0846);}}}return _0x37da04[_0xedac('0x1a')];};};Realtime[_0xedac('0x3f')][_0xedac('0x4c')]=function(){var _0x584beb=this;return function(_0x3dbcff){if(_0x3dbcff){freeIsNotKey(_0x3dbcff,_0x584beb[_0xedac('0x1b')],'id');for(var _0x15d582=0x0,_0x5a6e3c={},_0x575f9e={};_0x15d582<_0x3dbcff[_0xedac('0x45')];_0x15d582+=0x1){_0x5a6e3c=_0x3dbcff[_0x15d582];if(_[_0xedac('0x43')](_0x584beb[_0xedac('0x1b')][_0x5a6e3c['id']])){_0x584beb['salesforceAccounts'][_0x5a6e3c['id']]=new SalesforceAccount(_0x5a6e3c);}else{_0x584beb[_0xedac('0x3e')](_0x584beb[_0xedac('0x1b')][_0x5a6e3c['id']],_0x5a6e3c);}}}return _0x584beb['salesforceAccounts'];};};Realtime[_0xedac('0x3f')][_0xedac('0x4d')]=function(){var _0x4bc336=this;return function(_0x575620){if(_0x575620){freeIsNotKey(_0x575620,_0x4bc336['freshdeskAccounts'],'id');for(var _0x2165e4=0x0,_0x48540d={},_0x30813b={};_0x2165e4<_0x575620['length'];_0x2165e4+=0x1){_0x48540d=_0x575620[_0x2165e4];if(_['isUndefined'](_0x4bc336[_0xedac('0x1d')][_0x48540d['id']])){_0x4bc336[_0xedac('0x1d')][_0x48540d['id']]=new FreshdeskAccount(_0x48540d);}else{_0x4bc336[_0xedac('0x3e')](_0x4bc336[_0xedac('0x1d')][_0x48540d['id']],_0x48540d);}}}return _0x4bc336[_0xedac('0x1d')];};};Realtime['prototype'][_0xedac('0x4e')]=function(){var _0x5d9712=this;return function(_0x1ece76){if(_0x1ece76){freeIsNotKey(_0x1ece76,_0x5d9712[_0xedac('0x4f')],'id');for(var _0x2f3df5=0x0,_0x862e0f={},_0x3ca111={};_0x2f3df5<_0x1ece76[_0xedac('0x45')];_0x2f3df5+=0x1){_0x862e0f=_0x1ece76[_0x2f3df5];if(_[_0xedac('0x43')](_0x5d9712['zohoAccounts'][_0x862e0f['id']])){_0x5d9712[_0xedac('0x4f')][_0x862e0f['id']]=new ZohoAccount(_0x862e0f);}else{_0x5d9712[_0xedac('0x3e')](_0x5d9712[_0xedac('0x4f')][_0x862e0f['id']],_0x862e0f);}}}return _0x5d9712[_0xedac('0x4f')];};};Realtime[_0xedac('0x3f')][_0xedac('0x50')]=function(){var _0x3f313a=this;return function(_0x19e85f){if(_0x19e85f){freeIsNotKey(_0x19e85f,_0x3f313a[_0xedac('0x1e')],'id');for(var _0x3d25a4=0x0,_0x54b88e={},_0x5ced22={};_0x3d25a4<_0x19e85f[_0xedac('0x45')];_0x3d25a4+=0x1){_0x54b88e=_0x19e85f[_0x3d25a4];if(_[_0xedac('0x43')](_0x3f313a[_0xedac('0x1e')][_0x54b88e['id']])){_0x3f313a[_0xedac('0x1e')][_0x54b88e['id']]=new DeskAccount(_0x54b88e);}else{_0x3f313a[_0xedac('0x3e')](_0x3f313a['deskAccounts'][_0x54b88e['id']],_0x54b88e);}}}return _0x3f313a[_0xedac('0x1e')];};};Realtime['prototype'][_0xedac('0x51')]=function(){var _0x15b168=this;return function(_0x54f159){if(_0x54f159){freeIsNotKey(_0x54f159,_0x15b168['sugarcrmAccounts'],'id');for(var _0x5840c7=0x0,_0x2c984e={},_0x467e22={};_0x5840c7<_0x54f159[_0xedac('0x45')];_0x5840c7+=0x1){_0x2c984e=_0x54f159[_0x5840c7];if(_[_0xedac('0x43')](_0x15b168[_0xedac('0x1c')][_0x2c984e['id']])){_0x15b168[_0xedac('0x1c')][_0x2c984e['id']]=new SugarcrmAccount(_0x2c984e);}else{_0x15b168[_0xedac('0x3e')](_0x15b168[_0xedac('0x1c')][_0x2c984e['id']],_0x2c984e);}}}return _0x15b168[_0xedac('0x1c')];};};Realtime[_0xedac('0x3f')]['initVtigerAccounts']=function(){var _0x35251e=this;return function(_0x30f8ca){if(_0x30f8ca){freeIsNotKey(_0x30f8ca,_0x35251e['vtigerAccounts'],'id');for(var _0x3b8d23=0x0,_0x347461={},_0x7fbced={};_0x3b8d23<_0x30f8ca[_0xedac('0x45')];_0x3b8d23+=0x1){_0x347461=_0x30f8ca[_0x3b8d23];if(_[_0xedac('0x43')](_0x35251e[_0xedac('0x1f')][_0x347461['id']])){_0x35251e[_0xedac('0x1f')][_0x347461['id']]=new VtigerAccount(_0x347461);}else{_0x35251e[_0xedac('0x3e')](_0x35251e[_0xedac('0x1f')][_0x347461['id']],_0x347461);}}}return _0x35251e[_0xedac('0x1f')];};};Realtime[_0xedac('0x3f')][_0xedac('0x52')]=function(){var _0x77fc48=this;return function(_0x3a1d68){if(_0x3a1d68){freeIsNotKey(_0x3a1d68,_0x77fc48[_0xedac('0x20')],'id');for(var _0x180be4=0x0,_0x5c140f={},_0x20cc00={};_0x180be4<_0x3a1d68['length'];_0x180be4+=0x1){_0x5c140f=_0x3a1d68[_0x180be4];if(_[_0xedac('0x43')](_0x77fc48['servicenowAccounts'][_0x5c140f['id']])){_0x77fc48[_0xedac('0x20')][_0x5c140f['id']]=new ServicenowAccount(_0x5c140f);}else{_0x77fc48['mergeFromDatabase'](_0x77fc48[_0xedac('0x20')][_0x5c140f['id']],_0x5c140f);}}}return _0x77fc48[_0xedac('0x20')];};};Realtime[_0xedac('0x3f')][_0xedac('0x53')]=function(){var _0xe1721f=this;return function(_0x241a9e){if(_0x241a9e){freeIsNotKey(_0x241a9e,_0xe1721f['dynamics365Accounts'],'id');for(var _0x327823=0x0,_0x3d1565={},_0x3a6819={};_0x327823<_0x241a9e[_0xedac('0x45')];_0x327823+=0x1){_0x3d1565=_0x241a9e[_0x327823];if(_[_0xedac('0x43')](_0xe1721f[_0xedac('0x21')][_0x3d1565['id']])){_0xe1721f['dynamics365Accounts'][_0x3d1565['id']]=new Dynamics365Account(_0x3d1565);}else{_0xe1721f[_0xedac('0x3e')](_0xe1721f['dynamics365Accounts'][_0x3d1565['id']],_0x3d1565);}}}return _0xe1721f[_0xedac('0x21')];};};Realtime[_0xedac('0x3f')][_0xedac('0x54')]=function(){var _0x5a7f9c=this;return function(_0x249b20){if(_0x249b20){freeIsNotKey(_0x249b20,_0x5a7f9c['freshsalesAccounts'],'id');for(var _0x574078=0x0,_0x166fd6={},_0x133a24={};_0x574078<_0x249b20[_0xedac('0x45')];_0x574078+=0x1){_0x166fd6=_0x249b20[_0x574078];if(_[_0xedac('0x43')](_0x5a7f9c[_0xedac('0x22')][_0x166fd6['id']])){_0x5a7f9c['freshsalesAccounts'][_0x166fd6['id']]=new FreshsalesAccount(_0x166fd6);}else{_0x5a7f9c[_0xedac('0x3e')](_0x5a7f9c['freshsalesAccounts'][_0x166fd6['id']],_0x166fd6);}}}return _0x5a7f9c[_0xedac('0x22')];};};Realtime[_0xedac('0x3f')][_0xedac('0x55')]=function(){var _0x27f911=this;return function(_0x1a80bf){for(var _0xc7d947=0x0;_0xc7d947<_0x1a80bf['length'];_0xc7d947+=0x1){_[_0xedac('0x56')](_0x27f911[_0xedac('0x48')][_0x1a80bf[_0xc7d947][_0xedac('0x27')]],_0x1a80bf[_0xc7d947]);}return _0x27f911[_0xedac('0x48')];};};Realtime[_0xedac('0x3f')][_0xedac('0x57')]=function(){var _0x32fc02=this;return function(_0x30c83a){clearVoiceQueues(_0x32fc02[_0xedac('0x48')]);if(_0x30c83a){_0x30c83a=_[_0xedac('0x58')](_0x30c83a,_0xedac('0x59'));for(var _0x3d4d30 in _0x30c83a){if(_0x30c83a['hasOwnProperty'](_0x3d4d30)){var _0xc8eca1={};for(var _0x5481c8=0x0;_0x5481c8<_0x30c83a[_0x3d4d30]['length'];_0x5481c8+=0x1){var _0xdf86e8=_0x30c83a[_0x3d4d30][_0x5481c8]['queue'];if(_0x32fc02[_0xedac('0x48')][_0xdf86e8]){if(_0x30c83a[_0x3d4d30][_0x5481c8][_0xedac('0x5a')]){_0x32fc02['voiceQueues'][_0xdf86e8][_0xedac('0x30')]+=0x1;}if(_0x30c83a[_0x3d4d30][_0x5481c8]['queuecallerabandon']){_0x32fc02[_0xedac('0x48')][_0xdf86e8]['abandoned']+=0x1;}_0x32fc02[_0xedac('0x48')][_0xdf86e8]['sumHoldTime']+=moment(_0x30c83a[_0x3d4d30][_0x5481c8][_0xedac('0x5b')])[_0xedac('0x5c')](moment(_0x30c83a[_0x3d4d30][_0x5481c8]['queuecallerjoinAt']),_0xedac('0x5d'))||0x0;if(_0x5481c8===_0x30c83a[_0x3d4d30]['length']-0x1){_0x32fc02[_0xedac('0x48')][_0xdf86e8][_0xedac('0x2c')]+=moment(_0x30c83a[_0x3d4d30][_0x5481c8][_0xedac('0x5e')]||_0x30c83a[_0x3d4d30][_0x5481c8][_0xedac('0x5f')]||_0x30c83a[_0x3d4d30][_0x5481c8][_0xedac('0x60')])['diff'](moment(_0x30c83a[_0x3d4d30][_0x5481c8][_0xedac('0x61')]),'seconds')||0x0;_0x32fc02[_0xedac('0x48')][_0xdf86e8][_0xedac('0x29')]+=0x1;if(_0x30c83a[_0x3d4d30][_0x5481c8][_0xedac('0x62')]){_0x32fc02[_0xedac('0x48')][_0xdf86e8][_0xedac('0x2a')]+=0x1;_0x32fc02[_0xedac('0x48')][_0xdf86e8]['sumBillable']+=moment(_0x30c83a[_0x3d4d30][_0x5481c8][_0xedac('0x5e')])[_0xedac('0x5c')](moment(_0x30c83a[_0x3d4d30][_0x5481c8]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x32fc02[_0xedac('0x48')][_0xdf86e8][_0xedac('0x2c')]+=_0x32fc02[_0xedac('0x48')][_0xdf86e8][_0xedac('0x2b')]||0x0;}}}}}}return _0x32fc02[_0xedac('0x48')];};};Realtime['prototype'][_0xedac('0x63')]=function(){var _0x2f5f35=this;return function(_0x4dd9bd){clearVoiceCallReports(_0x2f5f35[_0xedac('0x64')]);if(_0x4dd9bd){for(var _0x472e8a=0x0;_0x472e8a<_0x4dd9bd[_0xedac('0x45')];_0x472e8a+=0x1){_0x2f5f35[_0xedac('0x64')][_0xedac('0x29')]+=0x1;_0x2f5f35[_0xedac('0x64')][_0xedac('0x2c')]+=_0x4dd9bd[_0x472e8a][_0xedac('0x65')];if(_0x4dd9bd[_0x472e8a][_0xedac('0x66')]===_0xedac('0x67')){_0x2f5f35['outbound'][_0xedac('0x2a')]+=0x1;_0x2f5f35[_0xedac('0x64')][_0xedac('0x2b')]+=_0x4dd9bd[_0x472e8a][_0xedac('0x65')]-_0x4dd9bd[_0x472e8a][_0xedac('0x68')]||0x0;_0x2f5f35['outbound'][_0xedac('0x2d')]+=_0x4dd9bd[_0x472e8a][_0xedac('0x68')];}}}return _0x2f5f35[_0xedac('0x64')];};};Realtime[_0xedac('0x3f')]['initCampaigns']=function(){var _0x585533=this;return function(_0x880e26){if(_0x880e26){freeIsNotKey(_0x880e26,_0x585533[_0xedac('0x13')],_0xedac('0x27'));for(var _0xcde123=0x0,_0x20f7e6={};_0xcde123<_0x880e26[_0xedac('0x45')];_0xcde123+=0x1){_0x20f7e6=_0x880e26[_0xcde123];if(_[_0xedac('0x43')](_0x585533[_0xedac('0x13')][_0x20f7e6[_0xedac('0x27')]])){_0x585533[_0xedac('0x13')][_0x20f7e6[_0xedac('0x27')]]=new Campaign(_0x20f7e6);}else{_0x585533[_0xedac('0x3e')](_0x585533['campaigns'][_0x20f7e6[_0xedac('0x27')]],_0x20f7e6);_0x585533['campaigns'][_0x20f7e6[_0xedac('0x27')]]['dialQueueProject']=_0x20f7e6[_0xedac('0x69')]?_0x20f7e6[_0xedac('0x69')]['name']:undefined;}}}return _0x585533[_0xedac('0x13')];};};Realtime[_0xedac('0x3f')][_0xedac('0x6a')]=function(){var _0x595453=this;return function(_0x29c0c1){if(_0x29c0c1){freeIsNotKey(_0x29c0c1,_0x595453[_0xedac('0x15')],'id');for(var _0x251b99=0x0,_0x512c4c={};_0x251b99<_0x29c0c1[_0xedac('0x45')];_0x251b99+=0x1){_0x512c4c=_0x29c0c1[_0x251b99];if(_['isUndefined'](_0x595453[_0xedac('0x15')][_0x512c4c['id']])){_0x595453['voiceExtensions'][_0x512c4c['id']]=new VoiceExtension(_0x512c4c);}else{_0x595453[_0xedac('0x3e')](_0x595453[_0xedac('0x15')][_0x512c4c['id']],_0x512c4c);}}}return _0x595453[_0xedac('0x15')];};};Realtime[_0xedac('0x3f')]['initCampaignHopperHistory']=function(){var _0x4ae773=this;return function(_0x5466f6){clearCampaigns(_0x4ae773[_0xedac('0x13')]);for(var _0x595121=0x0;_0x595121<_0x5466f6[_0xedac('0x45')];_0x595121+=0x1){_[_0xedac('0x56')](_0x4ae773[_0xedac('0x13')][_0x5466f6[_0x595121][_0xedac('0x27')]],_0x5466f6[_0x595121]);}return _0x4ae773[_0xedac('0x13')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x21a797=this;return function(_0x2a75d9){if(_0x2a75d9){freeIsNotKey(_0x2a75d9,_0x21a797[_0xedac('0x6b')],'id');for(var _0x48f91d=0x0,_0x39bbdd={},_0x21cc9b={};_0x48f91d<_0x2a75d9[_0xedac('0x45')];_0x48f91d+=0x1){_0x39bbdd=_0x2a75d9[_0x48f91d];if(_[_0xedac('0x43')](_0x21a797['faxAccounts'][_0x39bbdd['id']])){_0x21a797[_0xedac('0x6b')][_0x39bbdd['id']]=new FaxAccount(_0x39bbdd);}else{_0x21a797[_0xedac('0x3e')](_0x21a797['faxAccounts'][_0x39bbdd['id']],_0x39bbdd);}}}return _0x21a797[_0xedac('0x6b')];};};module['exports']=Realtime; \ No newline at end of file +var _0x00bb=['outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initVoiceQueues','initTriggers','triggers','templates','initZendeskAccounts','salesforceAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallerexitAt','queuecallercomplete','seconds','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','dialQueueProject','SquareProject','voiceExtensions','initFaxAccounts','faxAccounts','bluebird','util','lodash','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','freshsalesAccounts','mapKeys','hasOwnProperty','SIP/%s','interface','format','name','total','answered','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','abandoned','sumHoldTime','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout'];(function(_0x259a5e,_0x52b6c8){var _0x18792c=function(_0x1dc2f7){while(--_0x1dc2f7){_0x259a5e['push'](_0x259a5e['shift']());}};_0x18792c(++_0x52b6c8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x00bb[_0x311c35];return _0x5cc50c;};'use strict';var BPromise=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var _=require(_0xb00b('0x2'));var moment=require('moment');var Agent=require(_0xb00b('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0xb00b('0x4'));var VoiceQueue=require(_0xb00b('0x5'));var Trigger=require('../model/trigger');var Template=require(_0xb00b('0x6'));var Campaign=require(_0xb00b('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xb00b('0x8'));var SugarcrmAccount=require(_0xb00b('0x9'));var ZohoAccount=require(_0xb00b('0xa'));var DeskAccount=require(_0xb00b('0xb'));var VtigerAccount=require(_0xb00b('0xc'));var ServicenowAccount=require(_0xb00b('0xd'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xb00b('0xe'));var Realtime=function(){this[_0xb00b('0xf')]={};this[_0xb00b('0x10')]={};this[_0xb00b('0x11')]={};this[_0xb00b('0x12')]={};this['triggers']={};this[_0xb00b('0x13')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xb00b('0x14')]={};this[_0xb00b('0x15')]={};this[_0xb00b('0x16')]={};this[_0xb00b('0x17')]={};this[_0xb00b('0x18')]={};this[_0xb00b('0x19')]={};this['salesforceAccounts']={};this[_0xb00b('0x1a')]={};this[_0xb00b('0x1b')]={};this['zohoAccounts']={};this[_0xb00b('0x1c')]={};this[_0xb00b('0x1d')]={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this[_0xb00b('0x1e')]={};this['faxAccounts']={};};function freeIsNotKey(_0x51d136,_0x1f9c78,_0x638443){var _0x387d97=_[_0xb00b('0x1f')](_0x51d136,function(_0x58d65f,_0x2a7231){return _0x58d65f[_0x638443];});for(var _0x599347 in _0x1f9c78){if(_0x1f9c78[_0xb00b('0x20')](_0x599347)){if(!_0x387d97[_0x599347]){delete _0x1f9c78[_0x599347];}}}}function freeIsNotKeySip(_0x5aa9a0,_0x25d7a0){var _0x5e8d7b=_[_0xb00b('0x1f')](_0x5aa9a0,function(_0x3355a3,_0x53ee68){return util['format'](_0xb00b('0x21'),_0x3355a3['name']);});for(var _0x1344c4 in _0x25d7a0){if(_0x25d7a0[_0xb00b('0x20')](_0x1344c4)){if(!_0x5e8d7b[_0x1344c4]){delete _0x25d7a0[_0x1344c4];}}}}function freeIsNotKeyAgent(_0x2fe48d,_0x3501af){var _0x56c189=_[_0xb00b('0x1f')](_0x2fe48d,function(_0x4df284,_0x25a973){var _0x121ec7=_['isNil'](_0x4df284[_0xb00b('0x22')])?util[_0xb00b('0x23')]('SIP/%s',_0x4df284[_0xb00b('0x24')]):_0x4df284[_0xb00b('0x22')];return _0x121ec7;});for(var _0x5568bb in _0x3501af){if(_0x3501af[_0xb00b('0x20')](_0x5568bb)){if(!_0x56c189[_0x5568bb]){delete _0x3501af[_0x5568bb];}}}}function clearVoiceCallReports(_0x243fdb){_0x243fdb[_0xb00b('0x25')]=0x0;_0x243fdb[_0xb00b('0x26')]=0x0;_0x243fdb['sumHoldTime']=0x0;_0x243fdb['sumDuration']=0x0;_0x243fdb[_0xb00b('0x27')]=0x0;}function clearCampaigns(_0x490380){if(!_['isEmpty'](_0x490380)){for(var _0x4a635e in _0x490380){if(_0x490380[_0xb00b('0x20')](_0x4a635e)){_0x490380[_0x4a635e][_0xb00b('0x28')]=0x0;_0x490380[_0x4a635e][_0xb00b('0x29')]=0x0;}}}}function clearVoiceQueues(_0x3825af){if(!_[_0xb00b('0x2a')](_0x3825af)){for(var _0x197379 in _0x3825af){if(_0x3825af[_0xb00b('0x20')](_0x197379)){_0x3825af[_0x197379]['total']=0x0;_0x3825af[_0x197379][_0xb00b('0x26')]=0x0;_0x3825af[_0x197379]['unmanaged']=0x0;_0x3825af[_0x197379][_0xb00b('0x2b')]=0x0;_0x3825af[_0x197379][_0xb00b('0x2c')]=0x0;_0x3825af[_0x197379][_0xb00b('0x2d')]=0x0;_0x3825af[_0x197379]['sumBillable']=0x0;_0x3825af[_0x197379][_0xb00b('0x2e')]=0x0;_0x3825af[_0x197379][_0xb00b('0x2f')]=0x0;_0x3825af[_0x197379][_0xb00b('0x30')]=0x0;_0x3825af[_0x197379][_0xb00b('0x31')]=0x0;_0x3825af[_0x197379][_0xb00b('0x32')]=0x0;_0x3825af[_0x197379][_0xb00b('0x33')]=0x0;_0x3825af[_0x197379][_0xb00b('0x34')]=0x0;_0x3825af[_0x197379][_0xb00b('0x35')]=0x0;_0x3825af[_0x197379][_0xb00b('0x36')]=0x0;_0x3825af[_0x197379]['outboundOriginateFailureCallsDay']=0x0;_0x3825af[_0x197379][_0xb00b('0x37')]=0x0;_0x3825af[_0x197379][_0xb00b('0x38')]=0x0;_0x3825af[_0x197379]['outboundAnswerAgiCallsDay']=0x0;_0x3825af[_0x197379][_0xb00b('0x39')]=0x0;_0x3825af[_0x197379][_0xb00b('0x3a')]=!![];}}}}Realtime['prototype'][_0xb00b('0x3b')]=function(_0x4d2ee5,_0x20e1c9){for(var _0x4117f2 in _0x20e1c9){if(_0x4d2ee5[_0xb00b('0x20')](_0x4117f2)){_0x4d2ee5[_0x4117f2]=_0x20e1c9[_0x4117f2];}}};Realtime[_0xb00b('0x3c')][_0xb00b('0x3d')]=function(){var _0x1436ad=this;return function(_0x17f613){if(_0x17f613){freeIsNotKeyAgent(_0x17f613,_0x1436ad['agents']);for(var _0x57e8f9=0x0,_0x5b04c2={},_0x347e73={};_0x57e8f9<_0x17f613[_0xb00b('0x3e')];_0x57e8f9+=0x1){_0x5b04c2=_0x17f613[_0x57e8f9];var _0x45dcda=_[_0xb00b('0x3f')](_0x5b04c2['interface'])?util[_0xb00b('0x23')](_0xb00b('0x21'),_0x5b04c2[_0xb00b('0x24')]):_0x5b04c2[_0xb00b('0x22')];if(_[_0xb00b('0x40')](_0x1436ad[_0xb00b('0xf')][_0x45dcda])){_0x1436ad[_0xb00b('0xf')][_0x45dcda]=new Agent(_0x5b04c2);}else{_0x1436ad[_0xb00b('0x3b')](_0x1436ad['agents'][_0x45dcda],_0x5b04c2);}}}return _0x1436ad['agents'];};};Realtime[_0xb00b('0x3c')]['initTelephones']=function(){var _0x1c8258=this;return function(_0x1c5400){if(_0x1c5400){freeIsNotKeySip(_0x1c5400,_0x1c8258[_0xb00b('0x10')]);for(var _0x45ca74=0x0,_0x37c017={},_0x142cdd={};_0x45ca74<_0x1c5400[_0xb00b('0x3e')];_0x45ca74+=0x1){_0x37c017=_0x1c5400[_0x45ca74];if(_['isUndefined'](_0x1c8258[_0xb00b('0x10')][util[_0xb00b('0x23')](_0xb00b('0x21'),_0x37c017[_0xb00b('0x24')])])){_0x1c8258[_0xb00b('0x10')][util[_0xb00b('0x23')]('SIP/%s',_0x37c017[_0xb00b('0x24')])]=new Telephone(_0x37c017);}else{_0x1c8258[_0xb00b('0x3b')](_0x1c8258['telephones'][util[_0xb00b('0x23')](_0xb00b('0x21'),_0x37c017[_0xb00b('0x24')])],_0x37c017);}}}return _0x1c8258[_0xb00b('0x10')];};};Realtime[_0xb00b('0x3c')]['initTrunks']=function(){var _0x14ff6a=this;return function(_0xe4b5b6){if(_0xe4b5b6){freeIsNotKeySip(_0xe4b5b6,_0x14ff6a[_0xb00b('0x11')]);for(var _0xa262a3=0x0,_0x5d2bbd={},_0x4867fe={};_0xa262a3<_0xe4b5b6[_0xb00b('0x3e')];_0xa262a3+=0x1){_0x5d2bbd=_0xe4b5b6[_0xa262a3];if(_[_0xb00b('0x40')](_0x14ff6a[_0xb00b('0x11')][util[_0xb00b('0x23')](_0xb00b('0x21'),_0x5d2bbd[_0xb00b('0x24')])])){_0x14ff6a[_0xb00b('0x11')][util['format'](_0xb00b('0x21'),_0x5d2bbd[_0xb00b('0x24')])]=new Trunk(_0x5d2bbd);}else{_0x14ff6a[_0xb00b('0x3b')](_0x14ff6a[_0xb00b('0x11')][util[_0xb00b('0x23')](_0xb00b('0x21'),_0x5d2bbd[_0xb00b('0x24')])],_0x5d2bbd);}}}return _0x14ff6a[_0xb00b('0x11')];};};Realtime[_0xb00b('0x3c')][_0xb00b('0x41')]=function(){var _0xc0dddd=this;return function(_0x419113){if(_0x419113){freeIsNotKey(_0x419113,_0xc0dddd['voiceQueues'],_0xb00b('0x24'));for(var _0x35a0ba=0x0,_0xd07fb8={},_0x44afa0={};_0x35a0ba<_0x419113[_0xb00b('0x3e')];_0x35a0ba+=0x1){_0xd07fb8=_0x419113[_0x35a0ba];if(_[_0xb00b('0x40')](_0xc0dddd[_0xb00b('0x12')][_0xd07fb8[_0xb00b('0x24')]])){_0xc0dddd[_0xb00b('0x12')][_0xd07fb8[_0xb00b('0x24')]]=new VoiceQueue(_0xd07fb8);}else{_0xc0dddd[_0xb00b('0x3b')](_0xc0dddd[_0xb00b('0x12')][_0xd07fb8['name']],_0xd07fb8);}}}return _0xc0dddd['voiceQueues'];};};Realtime['prototype'][_0xb00b('0x42')]=function(){var _0x23d858=this;return function(_0x481154){if(_0x481154){freeIsNotKey(_0x481154,_0x23d858[_0xb00b('0x43')],'id');for(var _0x3c0fa=0x0,_0x1d3c5d={},_0x32163b={};_0x3c0fa<_0x481154['length'];_0x3c0fa+=0x1){_0x1d3c5d=_0x481154[_0x3c0fa];if(_['isUndefined'](_0x23d858[_0xb00b('0x43')][_0x1d3c5d['id']])){_0x23d858[_0xb00b('0x43')][_0x1d3c5d['id']]=new Trigger(_0x1d3c5d);}else{_0x23d858['mergeFromDatabase'](_0x23d858['triggers'][_0x1d3c5d['id']],_0x1d3c5d);}}}return _0x23d858[_0xb00b('0x43')];};};Realtime[_0xb00b('0x3c')]['initTemplates']=function(){var _0x2228e9=this;return function(_0x47a814){if(_0x47a814){freeIsNotKey(_0x47a814,_0x2228e9['templates'],'id');for(var _0x4bcc9e=0x0,_0x465d90={},_0x481515={};_0x4bcc9e<_0x47a814[_0xb00b('0x3e')];_0x4bcc9e+=0x1){_0x465d90=_0x47a814[_0x4bcc9e];if(_[_0xb00b('0x40')](_0x2228e9[_0xb00b('0x44')][_0x465d90['id']])){_0x2228e9[_0xb00b('0x44')][_0x465d90['id']]=new Template(_0x465d90);}else{_0x2228e9[_0xb00b('0x3b')](_0x2228e9[_0xb00b('0x44')][_0x465d90['id']],_0x465d90);}}}return _0x2228e9['templates'];};};Realtime['prototype'][_0xb00b('0x45')]=function(){var _0x161da9=this;return function(_0x559357){if(_0x559357){freeIsNotKey(_0x559357,_0x161da9[_0xb00b('0x19')],'id');for(var _0xe4cf45=0x0,_0x57f6ab={},_0x15dcbf={};_0xe4cf45<_0x559357[_0xb00b('0x3e')];_0xe4cf45+=0x1){_0x57f6ab=_0x559357[_0xe4cf45];if(_[_0xb00b('0x40')](_0x161da9['zendeskAccounts'][_0x57f6ab['id']])){_0x161da9['zendeskAccounts'][_0x57f6ab['id']]=new ZendeskAccount(_0x57f6ab);}else{_0x161da9[_0xb00b('0x3b')](_0x161da9[_0xb00b('0x19')][_0x57f6ab['id']],_0x57f6ab);}}}return _0x161da9[_0xb00b('0x19')];};};Realtime[_0xb00b('0x3c')]['initSalesforceAccounts']=function(){var _0x380acb=this;return function(_0x3f31e5){if(_0x3f31e5){freeIsNotKey(_0x3f31e5,_0x380acb['salesforceAccounts'],'id');for(var _0x4cd9fd=0x0,_0x160965={},_0x524b05={};_0x4cd9fd<_0x3f31e5[_0xb00b('0x3e')];_0x4cd9fd+=0x1){_0x160965=_0x3f31e5[_0x4cd9fd];if(_[_0xb00b('0x40')](_0x380acb[_0xb00b('0x46')][_0x160965['id']])){_0x380acb[_0xb00b('0x46')][_0x160965['id']]=new SalesforceAccount(_0x160965);}else{_0x380acb[_0xb00b('0x3b')](_0x380acb[_0xb00b('0x46')][_0x160965['id']],_0x160965);}}}return _0x380acb['salesforceAccounts'];};};Realtime[_0xb00b('0x3c')]['initFreshdeskAccounts']=function(){var _0x37d4d2=this;return function(_0x98caa9){if(_0x98caa9){freeIsNotKey(_0x98caa9,_0x37d4d2[_0xb00b('0x1b')],'id');for(var _0x5ac79e=0x0,_0x248335={},_0x25f1f6={};_0x5ac79e<_0x98caa9[_0xb00b('0x3e')];_0x5ac79e+=0x1){_0x248335=_0x98caa9[_0x5ac79e];if(_['isUndefined'](_0x37d4d2[_0xb00b('0x1b')][_0x248335['id']])){_0x37d4d2[_0xb00b('0x1b')][_0x248335['id']]=new FreshdeskAccount(_0x248335);}else{_0x37d4d2[_0xb00b('0x3b')](_0x37d4d2[_0xb00b('0x1b')][_0x248335['id']],_0x248335);}}}return _0x37d4d2[_0xb00b('0x1b')];};};Realtime[_0xb00b('0x3c')][_0xb00b('0x47')]=function(){var _0x3a0b90=this;return function(_0x4c3067){if(_0x4c3067){freeIsNotKey(_0x4c3067,_0x3a0b90[_0xb00b('0x48')],'id');for(var _0x2cbe80=0x0,_0x1b4860={},_0x4a22dd={};_0x2cbe80<_0x4c3067[_0xb00b('0x3e')];_0x2cbe80+=0x1){_0x1b4860=_0x4c3067[_0x2cbe80];if(_[_0xb00b('0x40')](_0x3a0b90[_0xb00b('0x48')][_0x1b4860['id']])){_0x3a0b90[_0xb00b('0x48')][_0x1b4860['id']]=new ZohoAccount(_0x1b4860);}else{_0x3a0b90[_0xb00b('0x3b')](_0x3a0b90['zohoAccounts'][_0x1b4860['id']],_0x1b4860);}}}return _0x3a0b90[_0xb00b('0x48')];};};Realtime[_0xb00b('0x3c')][_0xb00b('0x49')]=function(){var _0x1cad79=this;return function(_0x4b1e5f){if(_0x4b1e5f){freeIsNotKey(_0x4b1e5f,_0x1cad79[_0xb00b('0x1c')],'id');for(var _0x2301b7=0x0,_0x2c93db={},_0x2d73bb={};_0x2301b7<_0x4b1e5f[_0xb00b('0x3e')];_0x2301b7+=0x1){_0x2c93db=_0x4b1e5f[_0x2301b7];if(_[_0xb00b('0x40')](_0x1cad79[_0xb00b('0x1c')][_0x2c93db['id']])){_0x1cad79['deskAccounts'][_0x2c93db['id']]=new DeskAccount(_0x2c93db);}else{_0x1cad79[_0xb00b('0x3b')](_0x1cad79['deskAccounts'][_0x2c93db['id']],_0x2c93db);}}}return _0x1cad79[_0xb00b('0x1c')];};};Realtime['prototype'][_0xb00b('0x4a')]=function(){var _0x530d4a=this;return function(_0xe2d5ca){if(_0xe2d5ca){freeIsNotKey(_0xe2d5ca,_0x530d4a['sugarcrmAccounts'],'id');for(var _0x3dffaf=0x0,_0x2534ed={},_0x3bae02={};_0x3dffaf<_0xe2d5ca['length'];_0x3dffaf+=0x1){_0x2534ed=_0xe2d5ca[_0x3dffaf];if(_['isUndefined'](_0x530d4a['sugarcrmAccounts'][_0x2534ed['id']])){_0x530d4a[_0xb00b('0x1a')][_0x2534ed['id']]=new SugarcrmAccount(_0x2534ed);}else{_0x530d4a[_0xb00b('0x3b')](_0x530d4a[_0xb00b('0x1a')][_0x2534ed['id']],_0x2534ed);}}}return _0x530d4a['sugarcrmAccounts'];};};Realtime[_0xb00b('0x3c')][_0xb00b('0x4b')]=function(){var _0xca87d4=this;return function(_0x2ddba4){if(_0x2ddba4){freeIsNotKey(_0x2ddba4,_0xca87d4[_0xb00b('0x1d')],'id');for(var _0x485033=0x0,_0x32f924={},_0x27b13b={};_0x485033<_0x2ddba4['length'];_0x485033+=0x1){_0x32f924=_0x2ddba4[_0x485033];if(_[_0xb00b('0x40')](_0xca87d4[_0xb00b('0x1d')][_0x32f924['id']])){_0xca87d4[_0xb00b('0x1d')][_0x32f924['id']]=new VtigerAccount(_0x32f924);}else{_0xca87d4['mergeFromDatabase'](_0xca87d4['vtigerAccounts'][_0x32f924['id']],_0x32f924);}}}return _0xca87d4[_0xb00b('0x1d')];};};Realtime[_0xb00b('0x3c')][_0xb00b('0x4c')]=function(){var _0x49f0a2=this;return function(_0x5aac5f){if(_0x5aac5f){freeIsNotKey(_0x5aac5f,_0x49f0a2['servicenowAccounts'],'id');for(var _0x5e9677=0x0,_0xc695f={},_0x4df7fa={};_0x5e9677<_0x5aac5f[_0xb00b('0x3e')];_0x5e9677+=0x1){_0xc695f=_0x5aac5f[_0x5e9677];if(_[_0xb00b('0x40')](_0x49f0a2['servicenowAccounts'][_0xc695f['id']])){_0x49f0a2[_0xb00b('0x4d')][_0xc695f['id']]=new ServicenowAccount(_0xc695f);}else{_0x49f0a2[_0xb00b('0x3b')](_0x49f0a2[_0xb00b('0x4d')][_0xc695f['id']],_0xc695f);}}}return _0x49f0a2[_0xb00b('0x4d')];};};Realtime[_0xb00b('0x3c')]['initDynamics365Accounts']=function(){var _0x222066=this;return function(_0x851800){if(_0x851800){freeIsNotKey(_0x851800,_0x222066[_0xb00b('0x4e')],'id');for(var _0x15dcc3=0x0,_0x8e7e4e={},_0x404fbd={};_0x15dcc3<_0x851800[_0xb00b('0x3e')];_0x15dcc3+=0x1){_0x8e7e4e=_0x851800[_0x15dcc3];if(_['isUndefined'](_0x222066[_0xb00b('0x4e')][_0x8e7e4e['id']])){_0x222066[_0xb00b('0x4e')][_0x8e7e4e['id']]=new Dynamics365Account(_0x8e7e4e);}else{_0x222066[_0xb00b('0x3b')](_0x222066[_0xb00b('0x4e')][_0x8e7e4e['id']],_0x8e7e4e);}}}return _0x222066[_0xb00b('0x4e')];};};Realtime[_0xb00b('0x3c')][_0xb00b('0x4f')]=function(){var _0x266294=this;return function(_0x4d6f3a){if(_0x4d6f3a){freeIsNotKey(_0x4d6f3a,_0x266294[_0xb00b('0x1e')],'id');for(var _0x446e42=0x0,_0x1bf5ad={},_0x3e6a79={};_0x446e42<_0x4d6f3a[_0xb00b('0x3e')];_0x446e42+=0x1){_0x1bf5ad=_0x4d6f3a[_0x446e42];if(_[_0xb00b('0x40')](_0x266294[_0xb00b('0x1e')][_0x1bf5ad['id']])){_0x266294[_0xb00b('0x1e')][_0x1bf5ad['id']]=new FreshsalesAccount(_0x1bf5ad);}else{_0x266294['mergeFromDatabase'](_0x266294[_0xb00b('0x1e')][_0x1bf5ad['id']],_0x1bf5ad);}}}return _0x266294[_0xb00b('0x1e')];};};Realtime[_0xb00b('0x3c')][_0xb00b('0x50')]=function(){var _0x227949=this;return function(_0x376adc){for(var _0x26461a=0x0;_0x26461a<_0x376adc['length'];_0x26461a+=0x1){_[_0xb00b('0x51')](_0x227949[_0xb00b('0x12')][_0x376adc[_0x26461a][_0xb00b('0x24')]],_0x376adc[_0x26461a]);}return _0x227949[_0xb00b('0x12')];};};Realtime[_0xb00b('0x3c')][_0xb00b('0x52')]=function(){var _0x4930f3=this;return function(_0x39bb6c){clearVoiceQueues(_0x4930f3['voiceQueues']);if(_0x39bb6c){_0x39bb6c=_[_0xb00b('0x53')](_0x39bb6c,'uniqueid');for(var _0x1b255d in _0x39bb6c){if(_0x39bb6c[_0xb00b('0x20')](_0x1b255d)){var _0x20e844={};for(var _0x4d1daa=0x0;_0x4d1daa<_0x39bb6c[_0x1b255d]['length'];_0x4d1daa+=0x1){var _0x9ad1c6=_0x39bb6c[_0x1b255d][_0x4d1daa][_0xb00b('0x54')];if(_0x4930f3[_0xb00b('0x12')][_0x9ad1c6]){if(_0x39bb6c[_0x1b255d][_0x4d1daa][_0xb00b('0x55')]){_0x4930f3[_0xb00b('0x12')][_0x9ad1c6][_0xb00b('0x56')]+=0x1;}if(_0x39bb6c[_0x1b255d][_0x4d1daa][_0xb00b('0x57')]){_0x4930f3[_0xb00b('0x12')][_0x9ad1c6][_0xb00b('0x2b')]+=0x1;}_0x4930f3[_0xb00b('0x12')][_0x9ad1c6][_0xb00b('0x2c')]+=moment(_0x39bb6c[_0x1b255d][_0x4d1daa][_0xb00b('0x58')])[_0xb00b('0x59')](moment(_0x39bb6c[_0x1b255d][_0x4d1daa][_0xb00b('0x5a')]),'seconds')||0x0;if(_0x4d1daa===_0x39bb6c[_0x1b255d]['length']-0x1){_0x4930f3[_0xb00b('0x12')][_0x9ad1c6][_0xb00b('0x2d')]+=moment(_0x39bb6c[_0x1b255d][_0x4d1daa]['queuecallercompleteAt']||_0x39bb6c[_0x1b255d][_0x4d1daa]['queuecallerabandonAt']||_0x39bb6c[_0x1b255d][_0x4d1daa][_0xb00b('0x5b')])[_0xb00b('0x59')](moment(_0x39bb6c[_0x1b255d][_0x4d1daa][_0xb00b('0x5a')]),'seconds')||0x0;_0x4930f3[_0xb00b('0x12')][_0x9ad1c6][_0xb00b('0x25')]+=0x1;if(_0x39bb6c[_0x1b255d][_0x4d1daa][_0xb00b('0x5c')]){_0x4930f3[_0xb00b('0x12')][_0x9ad1c6][_0xb00b('0x26')]+=0x1;_0x4930f3[_0xb00b('0x12')][_0x9ad1c6][_0xb00b('0x27')]+=moment(_0x39bb6c[_0x1b255d][_0x4d1daa]['queuecallercompleteAt'])[_0xb00b('0x59')](moment(_0x39bb6c[_0x1b255d][_0x4d1daa]['queuecallerleaveAt']),_0xb00b('0x5d'))||0x0;}}else{_0x4930f3[_0xb00b('0x12')][_0x9ad1c6]['sumDuration']+=_0x4930f3[_0xb00b('0x12')][_0x9ad1c6][_0xb00b('0x2c')]||0x0;}}}}}}return _0x4930f3[_0xb00b('0x12')];};};Realtime[_0xb00b('0x3c')][_0xb00b('0x5e')]=function(){var _0x4434fa=this;return function(_0xc41c1f){clearVoiceCallReports(_0x4434fa[_0xb00b('0x5f')]);if(_0xc41c1f){for(var _0x36ba5c=0x0;_0x36ba5c<_0xc41c1f[_0xb00b('0x3e')];_0x36ba5c+=0x1){_0x4434fa[_0xb00b('0x5f')][_0xb00b('0x25')]+=0x1;_0x4434fa['outbound'][_0xb00b('0x2d')]+=_0xc41c1f[_0x36ba5c][_0xb00b('0x60')];if(_0xc41c1f[_0x36ba5c][_0xb00b('0x61')]===_0xb00b('0x62')){_0x4434fa['outbound'][_0xb00b('0x26')]+=0x1;_0x4434fa[_0xb00b('0x5f')][_0xb00b('0x2c')]+=_0xc41c1f[_0x36ba5c][_0xb00b('0x60')]-_0xc41c1f[_0x36ba5c][_0xb00b('0x63')]||0x0;_0x4434fa['outbound'][_0xb00b('0x27')]+=_0xc41c1f[_0x36ba5c][_0xb00b('0x63')];}}}return _0x4434fa[_0xb00b('0x5f')];};};Realtime[_0xb00b('0x3c')]['initCampaigns']=function(){var _0x34dcb0=this;return function(_0x584f4b){if(_0x584f4b){freeIsNotKey(_0x584f4b,_0x34dcb0[_0xb00b('0x13')],_0xb00b('0x24'));for(var _0x69b4e0=0x0,_0x165442={};_0x69b4e0<_0x584f4b[_0xb00b('0x3e')];_0x69b4e0+=0x1){_0x165442=_0x584f4b[_0x69b4e0];if(_[_0xb00b('0x40')](_0x34dcb0[_0xb00b('0x13')][_0x165442[_0xb00b('0x24')]])){_0x34dcb0[_0xb00b('0x13')][_0x165442[_0xb00b('0x24')]]=new Campaign(_0x165442);}else{_0x34dcb0[_0xb00b('0x3b')](_0x34dcb0['campaigns'][_0x165442[_0xb00b('0x24')]],_0x165442);_0x34dcb0[_0xb00b('0x13')][_0x165442[_0xb00b('0x24')]][_0xb00b('0x64')]=_0x165442['SquareProject']?_0x165442[_0xb00b('0x65')][_0xb00b('0x24')]:undefined;}}}return _0x34dcb0['campaigns'];};};Realtime[_0xb00b('0x3c')]['initVoiceExtensions']=function(){var _0x3caf51=this;return function(_0x43377c){if(_0x43377c){freeIsNotKey(_0x43377c,_0x3caf51[_0xb00b('0x66')],'id');for(var _0x51fdf7=0x0,_0x2c4cdf={};_0x51fdf7<_0x43377c[_0xb00b('0x3e')];_0x51fdf7+=0x1){_0x2c4cdf=_0x43377c[_0x51fdf7];if(_[_0xb00b('0x40')](_0x3caf51[_0xb00b('0x66')][_0x2c4cdf['id']])){_0x3caf51[_0xb00b('0x66')][_0x2c4cdf['id']]=new VoiceExtension(_0x2c4cdf);}else{_0x3caf51[_0xb00b('0x3b')](_0x3caf51[_0xb00b('0x66')][_0x2c4cdf['id']],_0x2c4cdf);}}}return _0x3caf51[_0xb00b('0x66')];};};Realtime[_0xb00b('0x3c')]['initCampaignHopperHistory']=function(){var _0x5914c9=this;return function(_0x466ddb){clearCampaigns(_0x5914c9[_0xb00b('0x13')]);for(var _0x2c4488=0x0;_0x2c4488<_0x466ddb[_0xb00b('0x3e')];_0x2c4488+=0x1){_['merge'](_0x5914c9[_0xb00b('0x13')][_0x466ddb[_0x2c4488][_0xb00b('0x24')]],_0x466ddb[_0x2c4488]);}return _0x5914c9['campaigns'];};};Realtime[_0xb00b('0x3c')][_0xb00b('0x67')]=function(){var _0x2762fb=this;return function(_0x54244b){if(_0x54244b){freeIsNotKey(_0x54244b,_0x2762fb[_0xb00b('0x68')],'id');for(var _0x1dd043=0x0,_0x51d9de={},_0x2b7fa9={};_0x1dd043<_0x54244b[_0xb00b('0x3e')];_0x1dd043+=0x1){_0x51d9de=_0x54244b[_0x1dd043];if(_[_0xb00b('0x40')](_0x2762fb[_0xb00b('0x68')][_0x51d9de['id']])){_0x2762fb[_0xb00b('0x68')][_0x51d9de['id']]=new FaxAccount(_0x51d9de);}else{_0x2762fb[_0xb00b('0x3b')](_0x2762fb[_0xb00b('0x68')][_0x51d9de['id']],_0x51d9de);}}}return _0x2762fb[_0xb00b('0x68')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 8d654b5..8257b51 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 _0x7129=['custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','isNil','format','SIP/%s','length','connectedlinenum','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','destination','type','dialer','lastapplication','queue','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','linkedid','transfereelinkedid','uniqueid','transfers','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','exten','xcally-motion-dialer','create','voiceAgentReport','isArray','forEach','startsWith','Local','substring','mobile','phone','indexOf','transfererlinkedid','attendedTransfer','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport'];(function(_0x5e137d,_0x7eeb8f){var _0x411618=function(_0x2e2820){while(--_0x2e2820){_0x5e137d['push'](_0x5e137d['shift']());}};_0x411618(++_0x7eeb8f);}(_0x7129,0x94));var _0x9712=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x7129[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var moment=require(_0x9712('0x0'));var util=require(_0x9712('0x1'));var config=require('../../../config/environment');var ami=require(_0x9712('0x2'));var RpcVoiceAgentReport=require(_0x9712('0x3'));var RpcVoiceCallReport=require(_0x9712('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x9712('0x5'));var RpcVoiceQueueReport=require(_0x9712('0x6'));var RpcVoiceRecording=require(_0x9712('0x7'));var RpcVoiceTransferReport=require(_0x9712('0x8'));var VoiceQueueReport=require(_0x9712('0x9'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x9712('0xa'));var VoiceDialReport=require(_0x9712('0xb'));var UserReport=require(_0x9712('0xc'));function Report(_0x128db6){this[_0x9712('0xd')]=_0x128db6;this['agents']=_0x128db6[_0x9712('0xe')];this[_0x9712('0xf')]=_0x128db6[_0x9712('0xf')];}Report[_0x9712('0x10')][_0x9712('0x11')]=function(_0x540778){var _0x27dc2f=new VoiceQueueReport(this[_0x9712('0xd')]);var _0x3054ed=new VoiceAgentReport(this[_0x9712('0xd')]);var _0x569b00=new VoiceDialReport(this[_0x9712('0xd')]);var _0x22bf73=new VoiceCallReport(this[_0x9712('0xd')]);var _0x5af51f=new UserReport(this['realtime']);if(config['xdr']&&config[_0x9712('0x12')]['disabled']){ami['on']('custom:voiceQueueReport',this[_0x9712('0x13')][_0x9712('0x14')](this));ami['on'](_0x9712('0x15'),this[_0x9712('0x16')][_0x9712('0x14')](this));ami['on'](_0x9712('0x17'),this['voiceAgentReport'][_0x9712('0x14')](this));ami['on'](_0x9712('0x18'),this[_0x9712('0x19')][_0x9712('0x14')](this));ami['on']('blindtransfer',this[_0x9712('0x1a')][_0x9712('0x14')](this));ami['on'](_0x9712('0x1b'),this['attendedTransfer'][_0x9712('0x14')](this));}};Report['prototype'][_0x9712('0x1c')]=function(_0x5628db){var _0xcc6f08;_0xcc6f08=_[_0x9712('0x1d')](this[_0x9712('0xe')],function(_0x2c6339){return _0x2c6339[_0x9712('0x1e')]==_0x5628db||_0x2c6339[_0x9712('0x1f')]==_0x5628db;});if(_[_0x9712('0x20')](_0xcc6f08)){var _0x13f8c3=_[_0x9712('0x1d')](this['telephones'],function(_0xd62054){return _0xd62054[_0x9712('0x1e')]==_0x5628db||_0xd62054['name']==_0x5628db;});if(_0x13f8c3){_0xcc6f08=_[_0x9712('0x1d')](this[_0x9712('0xe')],function(_0x32c957){return _0x32c957['interface']==util[_0x9712('0x21')](_0x9712('0x22'),_0x13f8c3[_0x9712('0x1f')]);});}}return _0xcc6f08;};Report[_0x9712('0x10')][_0x9712('0x13')]=function(_0x7f5e04){for(var _0x3cd7b1=0x0;_0x3cd7b1<_0x7f5e04[_0x9712('0x23')];_0x3cd7b1+=0x1){var _0x3345ab=this['findAgent'](_0x7f5e04[_0x3cd7b1][_0x9712('0x24')]);if(_0x3345ab){_0x7f5e04[_0x3cd7b1]['accountcode']=_0x3345ab[_0x9712('0x1e')];_0x7f5e04[_0x3cd7b1]['assigned']=!![];_0x7f5e04[_0x3cd7b1][_0x9712('0x25')]=_0x3345ab[_0x9712('0x1f')];_0x7f5e04[_0x3cd7b1][_0x9712('0x26')]=_['isNil'](_0x3345ab[_0x9712('0x26')])?util['format'](_0x9712('0x22'),_0x3345ab[_0x9712('0x1f')]):_0x3345ab[_0x9712('0x26')];if(_0x7f5e04[_0x3cd7b1][_0x9712('0x27')]){_0x7f5e04[_0x3cd7b1][_0x9712('0x28')]=moment()[_0x9712('0x21')](_0x9712('0x29'));}if(_0x7f5e04[_0x3cd7b1][_0x9712('0x2a')]){_0x7f5e04[_0x3cd7b1][_0x9712('0x2b')]=moment()[_0x9712('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x7f5e04[_0x3cd7b1]);}RpcVoiceQueueReport['create'](_0x7f5e04[_0x3cd7b1]);}};function extractCalleridNumber(_0x1459e1){var _0xcaaf84=_0x1459e1['match'](/<(.*?)>/);return _0xcaaf84?_0xcaaf84[0x1]:_0x1459e1;}Report[_0x9712('0x10')][_0x9712('0x16')]=function(_0x51099c){_0x51099c['destination']=_0x51099c[_0x9712('0x2c')]||_0x51099c['exten'];if(_0x51099c[_0x9712('0x2d')]==_0x9712('0x2e')){_0x51099c[_0x9712('0x2f')]=_0x9712('0x30');_0x51099c['lastdata']=_0x51099c[_0x9712('0x30')];if(_0x51099c[_0x9712('0x31')]==_0x9712('0x32')){_0x51099c[_0x9712('0x1e')]='';_0x51099c['destination']=extractCalleridNumber(_0x51099c['callerid']);}else if(_0x51099c[_0x9712('0x31')]==_0x9712('0x33')){if(_0x51099c['destination']==_0x9712('0x34')){_0x51099c[_0x9712('0x2c')]=extractCalleridNumber(_0x51099c[_0x9712('0x35')]);_0x51099c[_0x9712('0x36')]=_0x51099c[_0x9712('0x37')];_0x51099c[_0x9712('0x38')]=[_0x51099c[_0x9712('0x39')],_0x51099c[_0x9712('0x39')]=_0x51099c[_0x9712('0x38')]][0x0];_0x51099c[_0x9712('0x3a')]=_0x51099c[_0x9712('0x35')];}else{_0x51099c[_0x9712('0x2c')]=_0x51099c[_0x9712('0x36')];_0x51099c[_0x9712('0x36')]=_0x51099c[_0x9712('0x37')];if(_0x51099c[_0x9712('0x3b')]==_0x9712('0x3c')){_0x51099c['accountcode']=_0x51099c[_0x9712('0x24')];}else{_0x51099c[_0x9712('0x1e')]='';}}}}else{_0x51099c[_0x9712('0x3a')]=util[_0x9712('0x21')](_0x9712('0x3d'),_0x51099c['calleridname'],_0x51099c[_0x9712('0x36')]);}if(RpcVoiceTransferReport['transfers'][_0x51099c[_0x9712('0x3e')]]){var _0x51b322=RpcVoiceTransferReport['transfers'][_0x51099c['linkedid']];_0x51b322[_0x9712('0x3f')]=_0x51099c[_0x9712('0x40')];RpcVoiceTransferReport[_0x9712('0x1a')](_0x51b322);delete RpcVoiceTransferReport[_0x9712('0x41')][_0x51099c['linkedid']];}RpcVoiceCallReport['create'](_0x51099c);if(_0x51099c['monitor']){for(var _0x41ccca=0x0;_0x41ccca<_0x51099c[_0x9712('0x42')]['length'];_0x41ccca+=0x1){_0x51099c[_0x9712('0x43')]=_0x51099c[_0x9712('0x42')][_0x41ccca][_0x9712('0x44')];_0x51099c[_0x9712('0x45')]=_0x51099c['monitors'][_0x41ccca]['createdAt'];if(_0x51099c['exten']=='xcally-motion-preview'){_0x51099c[_0x9712('0x36')]=_0x51099c['connectedlinenum'];_0x51099c[_0x9712('0x46')]=_0x51099c[_0x9712('0x47')];_0x51099c['connectedlinenum']=_0x51099c[_0x9712('0x1e')];_0x51099c[_0x9712('0x47')]=_0x51099c['membername'];_0x51099c[_0x9712('0x48')]=_0x51099c[_0x9712('0x37')];}else if(_0x51099c[_0x9712('0x48')]==_0x9712('0x49')){_0x51099c[_0x9712('0x36')]=_0x51099c[_0x9712('0x2c')];_0x51099c[_0x9712('0x48')]=_0x51099c['originatecalleridnum'];}RpcVoiceRecording[_0x9712('0x4a')](_0x51099c);}}};Report[_0x9712('0x10')][_0x9712('0x4b')]=function(_0x1c7bc7){if(_[_0x9712('0x4c')](_0x1c7bc7)){_0x1c7bc7[_0x9712('0x4d')](function(_0x1258a3){RpcVoiceAgentReport['create'](_0x1258a3);});}else{RpcVoiceAgentReport[_0x9712('0x4a')](_0x1c7bc7);}};Report[_0x9712('0x10')]['voiceDialReport']=function(_0x4a9143){RpcVoiceDialReport[_0x9712('0x4a')](_0x4a9143);var _0x8a1351;var _0x475c04;var _0x3dee8d=_0x4a9143[_0x9712('0x39')];if(_[_0x9712('0x4e')](_0x3dee8d,_0x9712('0x4f'))){_0x475c04=_0x3dee8d[_0x9712('0x50')](_0x3dee8d['indexOf']('/')+0x1,_0x3dee8d['indexOf']('@'));_0x8a1351=_['find'](this[_0x9712('0xe')],function(_0x2f6275){return _0x2f6275[_0x9712('0x51')]==_0x475c04||_0x2f6275[_0x9712('0x52')]==_0x475c04||_0x2f6275['accountcode']==_0x475c04;});}else{_0x475c04=_0x3dee8d[_0x9712('0x50')](_0x3dee8d[_0x9712('0x53')]('/')+0x1,_0x3dee8d['lastIndexOf']('-'));_0x8a1351=this[_0x9712('0x1c')](_0x475c04);}if(_0x8a1351){_0x4a9143[_0x9712('0x26')]=_[_0x9712('0x20')](_0x8a1351[_0x9712('0x26')])?util[_0x9712('0x21')](_0x9712('0x22'),_0x8a1351[_0x9712('0x1f')]):_0x8a1351[_0x9712('0x26')];_0x4a9143['membername']=_0x8a1351['name'];_0x4a9143[_0x9712('0x1e')]=_0x8a1351['accountcode'];RpcMemberReport[_0x9712('0x19')](_0x4a9143);}};Report['prototype'][_0x9712('0x1a')]=function(_0x1baa69){RpcVoiceTransferReport[_0x9712('0x41')][_0x1baa69[_0x9712('0x54')]]=_0x1baa69;};Report[_0x9712('0x10')][_0x9712('0x55')]=function(_0x4484ea){RpcVoiceTransferReport['attendedTransfer'](_0x4484ea);};module['exports']=Report; \ No newline at end of file +var _0x7473=['createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','create','startsWith','substring','indexOf','phone','lastIndexOf','membername','transfererlinkedid','exports','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedTransfer','findAgent','find','accountcode','name','format','SIP/%s','length','connectedlinenum','assigned','isNil','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','exten','type','lastdata','queue','context','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','blindTransfer','monitor','monitors','monitorFilename','filename'];(function(_0x47c457,_0x1c4057){var _0x502e53=function(_0x2635bc){while(--_0x2635bc){_0x47c457['push'](_0x47c457['shift']());}};_0x502e53(++_0x1c4057);}(_0x7473,0x1b7));var _0x3747=function(_0x31c48b,_0x2bbf66){_0x31c48b=_0x31c48b-0x0;var _0x465ec0=_0x7473[_0x31c48b];return _0x465ec0;};'use strict';var _=require('lodash');var moment=require(_0x3747('0x0'));var util=require(_0x3747('0x1'));var config=require(_0x3747('0x2'));var ami=require(_0x3747('0x3'));var RpcVoiceAgentReport=require(_0x3747('0x4'));var RpcVoiceCallReport=require(_0x3747('0x5'));var RpcVoiceDialReport=require(_0x3747('0x6'));var RpcMemberReport=require(_0x3747('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x3747('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x3747('0x9'));var VoiceCallReport=require(_0x3747('0xa'));var VoiceAgentReport=require(_0x3747('0xb'));var VoiceDialReport=require(_0x3747('0xc'));var UserReport=require('./userReport');function Report(_0x11b006){this[_0x3747('0xd')]=_0x11b006;this[_0x3747('0xe')]=_0x11b006['agents'];this[_0x3747('0xf')]=_0x11b006[_0x3747('0xf')];}Report[_0x3747('0x10')][_0x3747('0x11')]=function(_0x6cd764){var _0xefa953=new VoiceQueueReport(this[_0x3747('0xd')]);var _0x3d34d2=new VoiceAgentReport(this[_0x3747('0xd')]);var _0x6ad916=new VoiceDialReport(this[_0x3747('0xd')]);var _0x379215=new VoiceCallReport(this[_0x3747('0xd')]);var _0x533555=new UserReport(this['realtime']);if(config['xdr']&&config[_0x3747('0x12')][_0x3747('0x13')]){ami['on']('custom:voiceQueueReport',this[_0x3747('0x14')][_0x3747('0x15')](this));ami['on'](_0x3747('0x16'),this[_0x3747('0x17')][_0x3747('0x15')](this));ami['on'](_0x3747('0x18'),this[_0x3747('0x19')][_0x3747('0x15')](this));ami['on'](_0x3747('0x1a'),this[_0x3747('0x1b')][_0x3747('0x15')](this));ami['on'](_0x3747('0x1c'),this['blindTransfer']['bind'](this));ami['on']('attendedtransfer',this[_0x3747('0x1d')][_0x3747('0x15')](this));}};Report[_0x3747('0x10')][_0x3747('0x1e')]=function(_0xbc4cb2){var _0x519b8e;_0x519b8e=_[_0x3747('0x1f')](this[_0x3747('0xe')],function(_0x1903c4){return _0x1903c4[_0x3747('0x20')]==_0xbc4cb2||_0x1903c4[_0x3747('0x21')]==_0xbc4cb2;});if(_['isNil'](_0x519b8e)){var _0x45fbcb=_[_0x3747('0x1f')](this[_0x3747('0xf')],function(_0xef849a){return _0xef849a[_0x3747('0x20')]==_0xbc4cb2||_0xef849a[_0x3747('0x21')]==_0xbc4cb2;});if(_0x45fbcb){_0x519b8e=_['find'](this[_0x3747('0xe')],function(_0x44e226){return _0x44e226['interface']==util[_0x3747('0x22')](_0x3747('0x23'),_0x45fbcb['name']);});}}return _0x519b8e;};Report[_0x3747('0x10')][_0x3747('0x14')]=function(_0x1b0034){for(var _0x589dec=0x0;_0x589dec<_0x1b0034[_0x3747('0x24')];_0x589dec+=0x1){var _0x532366=this['findAgent'](_0x1b0034[_0x589dec][_0x3747('0x25')]);if(_0x532366){_0x1b0034[_0x589dec]['accountcode']=_0x532366[_0x3747('0x20')];_0x1b0034[_0x589dec][_0x3747('0x26')]=!![];_0x1b0034[_0x589dec]['lastAssignedTo']=_0x532366[_0x3747('0x21')];_0x1b0034[_0x589dec]['interface']=_[_0x3747('0x27')](_0x532366[_0x3747('0x28')])?util[_0x3747('0x22')](_0x3747('0x23'),_0x532366[_0x3747('0x21')]):_0x532366[_0x3747('0x28')];if(_0x1b0034[_0x589dec]['queuecallercomplete']){_0x1b0034[_0x589dec][_0x3747('0x29')]=moment()[_0x3747('0x22')](_0x3747('0x2a'));}if(_0x1b0034[_0x589dec][_0x3747('0x2b')]){_0x1b0034[_0x589dec][_0x3747('0x2c')]=moment()[_0x3747('0x22')](_0x3747('0x2a'));}RpcMemberReport[_0x3747('0x14')](_0x1b0034[_0x589dec]);}RpcVoiceQueueReport['create'](_0x1b0034[_0x589dec]);}};function extractCalleridNumber(_0xa4c7d0){var _0x54f308=_0xa4c7d0[_0x3747('0x2d')](/<(.*?)>/);return _0x54f308?_0x54f308[0x1]:_0xa4c7d0;}Report[_0x3747('0x10')]['voiceCallReport']=function(_0x1c7572){_0x1c7572[_0x3747('0x2e')]=_0x1c7572[_0x3747('0x2e')]||_0x1c7572[_0x3747('0x2f')];if(_0x1c7572[_0x3747('0x30')]=='dialer'){_0x1c7572['lastapplication']='queue';_0x1c7572[_0x3747('0x31')]=_0x1c7572[_0x3747('0x32')];if(_0x1c7572[_0x3747('0x33')]=='from-voip-provider'){_0x1c7572[_0x3747('0x20')]='';_0x1c7572[_0x3747('0x2e')]=extractCalleridNumber(_0x1c7572[_0x3747('0x34')]);}else if(_0x1c7572[_0x3747('0x33')]==_0x3747('0x35')){if(_0x1c7572[_0x3747('0x2e')]==_0x3747('0x36')){_0x1c7572[_0x3747('0x2e')]=extractCalleridNumber(_0x1c7572[_0x3747('0x37')]);_0x1c7572[_0x3747('0x38')]=_0x1c7572[_0x3747('0x39')];_0x1c7572[_0x3747('0x3a')]=[_0x1c7572[_0x3747('0x3b')],_0x1c7572[_0x3747('0x3b')]=_0x1c7572[_0x3747('0x3a')]][0x0];_0x1c7572[_0x3747('0x34')]=_0x1c7572[_0x3747('0x37')];}else{_0x1c7572[_0x3747('0x2e')]=_0x1c7572[_0x3747('0x38')];_0x1c7572['calleridnum']=_0x1c7572[_0x3747('0x39')];if(_0x1c7572[_0x3747('0x3c')]=='ANSWERED'){_0x1c7572[_0x3747('0x20')]=_0x1c7572[_0x3747('0x25')];}else{_0x1c7572[_0x3747('0x20')]='';}}}}else{_0x1c7572[_0x3747('0x34')]=util[_0x3747('0x22')]('\x22%s\x22\x20<%s>',_0x1c7572[_0x3747('0x3d')],_0x1c7572[_0x3747('0x38')]);}if(RpcVoiceTransferReport['transfers'][_0x1c7572[_0x3747('0x3e')]]){var _0x547504=RpcVoiceTransferReport[_0x3747('0x3f')][_0x1c7572[_0x3747('0x3e')]];_0x547504[_0x3747('0x40')]=_0x1c7572[_0x3747('0x41')];RpcVoiceTransferReport[_0x3747('0x42')](_0x547504);delete RpcVoiceTransferReport[_0x3747('0x3f')][_0x1c7572[_0x3747('0x3e')]];}RpcVoiceCallReport['create'](_0x1c7572);if(_0x1c7572[_0x3747('0x43')]){for(var _0x3b1a71=0x0;_0x3b1a71<_0x1c7572[_0x3747('0x44')][_0x3747('0x24')];_0x3b1a71+=0x1){_0x1c7572[_0x3747('0x45')]=_0x1c7572[_0x3747('0x44')][_0x3b1a71][_0x3747('0x46')];_0x1c7572[_0x3747('0x47')]=_0x1c7572[_0x3747('0x44')][_0x3b1a71][_0x3747('0x47')];if(_0x1c7572[_0x3747('0x2f')]=='xcally-motion-preview'){_0x1c7572[_0x3747('0x38')]=_0x1c7572[_0x3747('0x25')];_0x1c7572[_0x3747('0x3d')]=_0x1c7572[_0x3747('0x48')];_0x1c7572[_0x3747('0x25')]=_0x1c7572['accountcode'];_0x1c7572[_0x3747('0x48')]=_0x1c7572['membername'];_0x1c7572[_0x3747('0x2f')]=_0x1c7572[_0x3747('0x39')];}else if(_0x1c7572[_0x3747('0x2f')]==_0x3747('0x49')){_0x1c7572[_0x3747('0x38')]=_0x1c7572[_0x3747('0x2e')];_0x1c7572[_0x3747('0x2f')]=_0x1c7572[_0x3747('0x39')];}RpcVoiceRecording['create'](_0x1c7572);}}};Report[_0x3747('0x10')]['voiceAgentReport']=function(_0x3f2f75){if(_[_0x3747('0x4a')](_0x3f2f75)){_0x3f2f75[_0x3747('0x4b')](function(_0x52d985){RpcVoiceAgentReport[_0x3747('0x4c')](_0x52d985);});}else{RpcVoiceAgentReport[_0x3747('0x4c')](_0x3f2f75);}};Report[_0x3747('0x10')]['voiceDialReport']=function(_0x55ed6e){RpcVoiceDialReport[_0x3747('0x4c')](_0x55ed6e);var _0x1f76c4;var _0x232899;var _0x4e6b59=_0x55ed6e[_0x3747('0x3b')];if(_[_0x3747('0x4d')](_0x4e6b59,'Local')){_0x232899=_0x4e6b59[_0x3747('0x4e')](_0x4e6b59[_0x3747('0x4f')]('/')+0x1,_0x4e6b59[_0x3747('0x4f')]('@'));_0x1f76c4=_['find'](this['agents'],function(_0x35892b){return _0x35892b['mobile']==_0x232899||_0x35892b[_0x3747('0x50')]==_0x232899||_0x35892b[_0x3747('0x20')]==_0x232899;});}else{_0x232899=_0x4e6b59[_0x3747('0x4e')](_0x4e6b59[_0x3747('0x4f')]('/')+0x1,_0x4e6b59[_0x3747('0x51')]('-'));_0x1f76c4=this[_0x3747('0x1e')](_0x232899);}if(_0x1f76c4){_0x55ed6e[_0x3747('0x28')]=_[_0x3747('0x27')](_0x1f76c4[_0x3747('0x28')])?util[_0x3747('0x22')](_0x3747('0x23'),_0x1f76c4[_0x3747('0x21')]):_0x1f76c4['interface'];_0x55ed6e[_0x3747('0x52')]=_0x1f76c4['name'];_0x55ed6e[_0x3747('0x20')]=_0x1f76c4[_0x3747('0x20')];RpcMemberReport[_0x3747('0x1b')](_0x55ed6e);}};Report[_0x3747('0x10')][_0x3747('0x42')]=function(_0x15a0d0){RpcVoiceTransferReport[_0x3747('0x3f')][_0x15a0d0[_0x3747('0x53')]]=_0x15a0d0;};Report[_0x3747('0x10')]['attendedTransfer']=function(_0x591899){RpcVoiceTransferReport['attendedTransfer'](_0x591899);};module[_0x3747('0x54')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index e0c7a1e..568b43a 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e26=['[userReport][registry]\x20sending\x20trunk:save\x20event:','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','stateTime','format','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','Local','substring','indexOf','phone','accountcode','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status','updateStatusRealtime','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','util','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','actionSipShowRegistry','error','[userReport][sipshowregistry]','resolve','then','actionDeviceStateList','[userReport][devicestatelist]','inspect','actionSipPeerStatus','catch','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','username','state','[userReport][registry]','find','merge','omit','event','actionid','debug'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0e26,0x19b));var _0x60e2=function(_0x37a15e,_0x59bd6a){_0x37a15e=_0x37a15e-0x0;var _0x376dda=_0x0e26[_0x37a15e];return _0x376dda;};'use strict';var _=require('lodash');var moment=require(_0x60e2('0x0'));var util=require(_0x60e2('0x1'));var Redis=require('ioredis');var BPromise=require(_0x60e2('0x2'));var config=require(_0x60e2('0x3'));var logger=require(_0x60e2('0x4'))(_0x60e2('0x5'));var ami=require(_0x60e2('0x6'));config[_0x60e2('0x7')]=_[_0x60e2('0x8')](config['redis'],{'host':_0x60e2('0x9'),'port':0x18eb});var io=require(_0x60e2('0xa'))(new Redis(config[_0x60e2('0x7')]));function UserReport(_0x36bf92){this[_0x60e2('0xb')]=_0x36bf92[_0x60e2('0xb')];this[_0x60e2('0xc')]=_0x36bf92[_0x60e2('0xc')];this[_0x60e2('0xd')]=_0x36bf92[_0x60e2('0xd')];ami['on'](_0x60e2('0xe'),this[_0x60e2('0xf')][_0x60e2('0x10')](this));ami['on']('registry',this[_0x60e2('0xf')][_0x60e2('0x10')](this));ami['on'](_0x60e2('0x11'),this[_0x60e2('0x12')][_0x60e2('0x10')](this));ami['on'](_0x60e2('0x13'),this[_0x60e2('0x14')][_0x60e2('0x10')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise['resolve']()['then'](ami[_0x60e2('0x15')]())['catch'](function(_0x2ec39a){logger[_0x60e2('0x16')](_0x60e2('0x17'),util['inspect'](_0x2ec39a,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x60e2('0x18')]()[_0x60e2('0x19')](ami[_0x60e2('0x1a')]())['catch'](function(_0x51d2e4){logger[_0x60e2('0x16')](_0x60e2('0x1b'),util[_0x60e2('0x1c')](_0x51d2e4,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x60e2('0x19')](ami[_0x60e2('0x1d')]())[_0x60e2('0x1e')](function(_0x2dcfee){logger['error'](_0x60e2('0x1f'),util['inspect'](_0x2dcfee,{'showHidden':![],'depth':null}));});}UserReport[_0x60e2('0x20')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x60e2('0x18')]()[_0x60e2('0x19')](showSipRegistrations())[_0x60e2('0x19')](listDeviceStates())[_0x60e2('0x19')](showPeersStatus());},0x32c8);};UserReport[_0x60e2('0x20')][_0x60e2('0x21')]=function(_0x1f8d6b){return _0x1f8d6b!==null&&!_[_0x60e2('0x22')](_0x1f8d6b);};UserReport[_0x60e2('0x20')]['emit']=function(_0x51bf12,_0x14b7f9,_0x5c9d92){io['to'](_0x51bf12)[_0x60e2('0x23')](_0x14b7f9,_0x5c9d92);};UserReport[_0x60e2('0x20')][_0x60e2('0xf')]=function(_0x458c03){try{if(this[_0x60e2('0x21')](_0x458c03)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x458c03[_0x60e2('0x24')],_0x458c03[_0x60e2('0x25')]);logger['debug'](_0x60e2('0x26'),util[_0x60e2('0x1c')](_0x458c03,{'showHidden':![],'depth':null}));var _0x43bc9=_[_0x60e2('0x27')](this[_0x60e2('0xb')],{'registry':_0x458c03[_0x60e2('0x24')]});if(_0x43bc9){_0x458c03['stateRegistry']=_0x458c03[_0x60e2('0x25')];_[_0x60e2('0x28')](_0x43bc9,_[_0x60e2('0x29')](_0x458c03,[_0x60e2('0x2a'),_0x60e2('0x2b'),_0x60e2('0x24'),_0x60e2('0x25')]));logger[_0x60e2('0x2c')](_0x60e2('0x2d'),util[_0x60e2('0x1c')](_0x43bc9,{'showHidden':![],'depth':null}));this[_0x60e2('0x23')](util['format']('trunk:%s',_0x43bc9[_0x60e2('0x2e')]),_0x60e2('0x2f'),_0x43bc9);}}}catch(_0x355292){logger[_0x60e2('0x16')]('[userReport][registry]',util[_0x60e2('0x1c')](_0x355292,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x60e2('0x12')]=function(_0x34aa69){try{if(this[_0x60e2('0x21')](_0x34aa69)){logger[_0x60e2('0x30')](_0x60e2('0x31'),_0x34aa69[_0x60e2('0x32')],_0x34aa69['state']);logger[_0x60e2('0x2c')]('[userReport][devicestatechange]',util[_0x60e2('0x1c')](_0x34aa69,{'showHidden':![],'depth':null}));if(this['agents'][_0x34aa69[_0x60e2('0x32')]]){if(!this['agents'][_0x34aa69[_0x60e2('0x32')]][_0x60e2('0x33')]||_0x34aa69['state'][_0x60e2('0x34')]()==_0x60e2('0x35')){this['agents'][_0x34aa69['device']][_0x60e2('0x33')]=![];if(this[_0x60e2('0xc')][_0x34aa69[_0x60e2('0x32')]]['state']!==_0x34aa69[_0x60e2('0x25')][_0x60e2('0x34')]()){this[_0x60e2('0xc')][_0x34aa69[_0x60e2('0x32')]][_0x60e2('0x36')]=_['toNumber'](moment()[_0x60e2('0x37')]('x'));}this[_0x60e2('0xc')][_0x34aa69[_0x60e2('0x32')]][_0x60e2('0x25')]=_0x34aa69[_0x60e2('0x25')]['toLowerCase']();this[_0x60e2('0xc')][_0x34aa69[_0x60e2('0x32')]]['updateStatusRealtime'](_0x34aa69);}}else if(this[_0x60e2('0xd')][_0x34aa69[_0x60e2('0x32')]]){if(this['telephones'][_0x34aa69[_0x60e2('0x32')]][_0x60e2('0x25')]!==_0x34aa69[_0x60e2('0x25')][_0x60e2('0x34')]()){this[_0x60e2('0xd')][_0x34aa69[_0x60e2('0x32')]]['stateTime']=_[_0x60e2('0x38')](moment()[_0x60e2('0x37')]('x'));}this[_0x60e2('0xd')][_0x34aa69[_0x60e2('0x32')]][_0x60e2('0x25')]=_0x34aa69[_0x60e2('0x25')][_0x60e2('0x34')]();logger[_0x60e2('0x2c')](_0x60e2('0x39'),util[_0x60e2('0x1c')](this['telephones'][_0x34aa69[_0x60e2('0x32')]],{'showHidden':![],'depth':null}));this[_0x60e2('0x23')](util['format'](_0x60e2('0x3a'),this['telephones'][_0x34aa69[_0x60e2('0x32')]][_0x60e2('0x2e')]),_0x60e2('0x3b'),this[_0x60e2('0xd')][_0x34aa69[_0x60e2('0x32')]]);}else if(this[_0x60e2('0xb')][_0x34aa69[_0x60e2('0x32')]]){if(this[_0x60e2('0xb')][_0x34aa69[_0x60e2('0x32')]][_0x60e2('0x25')]!==_0x34aa69['state'][_0x60e2('0x34')]()){this[_0x60e2('0xb')][_0x34aa69['device']][_0x60e2('0x36')]=_[_0x60e2('0x38')](moment()[_0x60e2('0x37')]('x'));}this[_0x60e2('0xb')][_0x34aa69['device']][_0x60e2('0x25')]=_0x34aa69[_0x60e2('0x25')][_0x60e2('0x34')]();logger[_0x60e2('0x2c')](_0x60e2('0x3c'),util[_0x60e2('0x1c')](this[_0x60e2('0xb')][_0x34aa69[_0x60e2('0x32')]],{'showHidden':![],'depth':null}));this[_0x60e2('0x23')](util['format'](_0x60e2('0x3d'),this[_0x60e2('0xb')][_0x34aa69[_0x60e2('0x32')]][_0x60e2('0x2e')]),_0x60e2('0x2f'),this['trunks'][_0x34aa69[_0x60e2('0x32')]]);}else if(_['startsWith'](_0x34aa69[_0x60e2('0x32')],_0x60e2('0x3e'))){var _0x4d8d42=_0x34aa69['device'];var _0x2a32a3=_0x4d8d42[_0x60e2('0x3f')](_0x4d8d42[_0x60e2('0x40')]('/')+0x1,_0x4d8d42[_0x60e2('0x40')]('@'));var _0x4e6c96=_[_0x60e2('0x27')](this[_0x60e2('0xc')],function(_0x4d10e6){return _0x4d10e6['mobile']==_0x2a32a3||_0x4d10e6[_0x60e2('0x41')]==_0x2a32a3||_0x4d10e6[_0x60e2('0x42')]==_0x2a32a3;});if(_0x4e6c96){if(_0x4e6c96['state']!==_0x34aa69[_0x60e2('0x25')][_0x60e2('0x34')]()){_0x4e6c96['stateTime']=_[_0x60e2('0x38')](moment()[_0x60e2('0x37')]('x'));}_0x4e6c96[_0x60e2('0x25')]=_0x34aa69['state'][_0x60e2('0x34')]();_0x4e6c96[_0x60e2('0x33')]=!![];_0x4e6c96['updateStatusRealtime'](_0x34aa69);}}}}catch(_0x340d29){logger[_0x60e2('0x16')](_0x60e2('0x43'),util[_0x60e2('0x1c')](_0x340d29,{'showHidden':![],'depth':null}));}};UserReport[_0x60e2('0x20')][_0x60e2('0x14')]=function(_0x45f7c1){try{if(this[_0x60e2('0x21')](_0x45f7c1)&&this[_0x60e2('0x21')](_0x45f7c1[_0x60e2('0x13')])){logger['info'](_0x60e2('0x44'),_0x45f7c1[_0x60e2('0x45')],_0x45f7c1[_0x60e2('0x46')],_0x45f7c1[_0x60e2('0x13')]);logger[_0x60e2('0x2c')](_0x60e2('0x47'),util[_0x60e2('0x1c')](_0x45f7c1,{'showHidden':![],'depth':null}));if(this[_0x60e2('0xc')][_0x45f7c1['peer']]){if(!this['agents'][_0x45f7c1[_0x60e2('0x45')]][_0x60e2('0x33')]||_0x45f7c1[_0x60e2('0x13')][_0x60e2('0x34')]()=='registered'){this[_0x60e2('0xc')][_0x45f7c1[_0x60e2('0x45')]]['local']=![];this[_0x60e2('0xc')][_0x45f7c1[_0x60e2('0x45')]][_0x60e2('0x48')]=_0x45f7c1[_0x60e2('0x13')][_0x60e2('0x34')]();this[_0x60e2('0xc')][_0x45f7c1[_0x60e2('0x45')]][_0x60e2('0x46')]=_0x45f7c1['address'];this['agents'][_0x45f7c1[_0x60e2('0x45')]][_0x60e2('0x49')](_0x45f7c1);}}else if(this[_0x60e2('0xd')][_0x45f7c1[_0x60e2('0x45')]]){this[_0x60e2('0xd')][_0x45f7c1[_0x60e2('0x45')]][_0x60e2('0x48')]=_0x45f7c1[_0x60e2('0x13')][_0x60e2('0x34')]();this['telephones'][_0x45f7c1['peer']][_0x60e2('0x46')]=_0x45f7c1[_0x60e2('0x46')];logger[_0x60e2('0x2c')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x60e2('0x1c')](this[_0x60e2('0xd')][_0x45f7c1[_0x60e2('0x45')]],{'showHidden':![],'depth':null}));this[_0x60e2('0x23')](util['format']('telephone:%s',this[_0x60e2('0xd')][_0x45f7c1[_0x60e2('0x45')]][_0x60e2('0x2e')]),_0x60e2('0x3b'),this[_0x60e2('0xd')][_0x45f7c1[_0x60e2('0x45')]]);}else if(this[_0x60e2('0xb')][_0x45f7c1[_0x60e2('0x45')]]){this[_0x60e2('0xb')][_0x45f7c1[_0x60e2('0x45')]]['status']=_0x45f7c1['peerstatus']['toLowerCase']();this[_0x60e2('0xb')][_0x45f7c1[_0x60e2('0x45')]]['address']=_0x45f7c1['address'];logger[_0x60e2('0x2c')](_0x60e2('0x4a'),util[_0x60e2('0x1c')](this[_0x60e2('0xb')][_0x45f7c1[_0x60e2('0x45')]],{'showHidden':![],'depth':null}));this[_0x60e2('0x23')](util[_0x60e2('0x37')](_0x60e2('0x3d'),this[_0x60e2('0xb')][_0x45f7c1[_0x60e2('0x45')]][_0x60e2('0x2e')]),_0x60e2('0x2f'),this['trunks'][_0x45f7c1[_0x60e2('0x45')]]);}}}catch(_0x56ccbd){logger['error'](_0x60e2('0x47'),util['inspect'](_0x56ccbd,{'showHidden':![],'depth':null}));}};module[_0x60e2('0x4b')]=UserReport; \ No newline at end of file +var _0x6b1b=['telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','substring','indexOf','mobile','phone','accountcode','syncPeerStatus','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','telephones','registryentry','bind','devicestatechange','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','emit','syncRegistry','info','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','find','stateRegistry','state','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','syncDeviceState','device','[userReport][devicestatechange]','agents','inuse','local','toLowerCase','updateStatusRealtime','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s'];(function(_0x1b0a00,_0xb772fd){var _0x24ba40=function(_0x47301a){while(--_0x47301a){_0x1b0a00['push'](_0x1b0a00['shift']());}};_0x24ba40(++_0xb772fd);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x6b1b[_0x4baae2];return _0x1a2285;};'use strict';var _=require('lodash');var moment=require(_0xb6b1('0x0'));var util=require(_0xb6b1('0x1'));var Redis=require(_0xb6b1('0x2'));var BPromise=require('bluebird');var config=require(_0xb6b1('0x3'));var logger=require(_0xb6b1('0x4'))(_0xb6b1('0x5'));var ami=require(_0xb6b1('0x6'));config[_0xb6b1('0x7')]=_[_0xb6b1('0x8')](config[_0xb6b1('0x7')],{'host':_0xb6b1('0x9'),'port':0x18eb});var io=require(_0xb6b1('0xa'))(new Redis(config[_0xb6b1('0x7')]));function UserReport(_0x1a4cd0){this['trunks']=_0x1a4cd0[_0xb6b1('0xb')];this['agents']=_0x1a4cd0['agents'];this[_0xb6b1('0xc')]=_0x1a4cd0['telephones'];ami['on'](_0xb6b1('0xd'),this['syncRegistry']['bind'](this));ami['on']('registry',this['syncRegistry'][_0xb6b1('0xe')](this));ami['on'](_0xb6b1('0xf'),this['syncDeviceState'][_0xb6b1('0xe')](this));ami['on']('peerstatus',this['syncPeerStatus'][_0xb6b1('0xe')](this));return this[_0xb6b1('0x10')]();}function showSipRegistrations(){Promise[_0xb6b1('0x11')]()[_0xb6b1('0x12')](ami[_0xb6b1('0x13')]())[_0xb6b1('0x14')](function(_0x360fc7){logger[_0xb6b1('0x15')](_0xb6b1('0x16'),util[_0xb6b1('0x17')](_0x360fc7,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xb6b1('0x11')]()[_0xb6b1('0x12')](ami['actionDeviceStateList']())['catch'](function(_0x513207){logger['error'](_0xb6b1('0x18'),util[_0xb6b1('0x17')](_0x513207,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xb6b1('0x11')]()[_0xb6b1('0x12')](ami[_0xb6b1('0x19')]())[_0xb6b1('0x14')](function(_0x47a204){logger['error'](_0xb6b1('0x1a'),util[_0xb6b1('0x17')](_0x47a204,{'showHidden':![],'depth':null}));});}UserReport[_0xb6b1('0x1b')][_0xb6b1('0x10')]=function(){setInterval(function(){BPromise[_0xb6b1('0x11')]()[_0xb6b1('0x12')](showSipRegistrations())['then'](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0xb6b1('0x1b')][_0xb6b1('0x1c')]=function(_0x5ce41c){return _0x5ce41c!==null&&!_['isUndefined'](_0x5ce41c);};UserReport[_0xb6b1('0x1b')]['emit']=function(_0x509c55,_0x232157,_0x2086ea){io['to'](_0x509c55)[_0xb6b1('0x1d')](_0x232157,_0x2086ea);};UserReport[_0xb6b1('0x1b')][_0xb6b1('0x1e')]=function(_0x3d0864){try{if(this[_0xb6b1('0x1c')](_0x3d0864)){logger[_0xb6b1('0x1f')](_0xb6b1('0x20'),_0x3d0864[_0xb6b1('0x21')],_0x3d0864['state']);logger[_0xb6b1('0x22')]('[userReport][registry]',util[_0xb6b1('0x17')](_0x3d0864,{'showHidden':![],'depth':null}));var _0x5864d6=_[_0xb6b1('0x23')](this['trunks'],{'registry':_0x3d0864[_0xb6b1('0x21')]});if(_0x5864d6){_0x3d0864[_0xb6b1('0x24')]=_0x3d0864[_0xb6b1('0x25')];_[_0xb6b1('0x26')](_0x5864d6,_[_0xb6b1('0x27')](_0x3d0864,[_0xb6b1('0x28'),_0xb6b1('0x29'),_0xb6b1('0x21'),_0xb6b1('0x25')]));logger['debug'](_0xb6b1('0x2a'),util['inspect'](_0x5864d6,{'showHidden':![],'depth':null}));this[_0xb6b1('0x1d')](util[_0xb6b1('0x2b')](_0xb6b1('0x2c'),_0x5864d6[_0xb6b1('0x2d')]),_0xb6b1('0x2e'),_0x5864d6);}}}catch(_0x12f369){logger[_0xb6b1('0x15')]('[userReport][registry]',util[_0xb6b1('0x17')](_0x12f369,{'showHidden':![],'depth':null}));}};UserReport[_0xb6b1('0x1b')][_0xb6b1('0x2f')]=function(_0x4e4e89){try{if(this[_0xb6b1('0x1c')](_0x4e4e89)){logger[_0xb6b1('0x1f')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x4e4e89[_0xb6b1('0x30')],_0x4e4e89[_0xb6b1('0x25')]);logger[_0xb6b1('0x22')](_0xb6b1('0x31'),util[_0xb6b1('0x17')](_0x4e4e89,{'showHidden':![],'depth':null}));if(this[_0xb6b1('0x32')][_0x4e4e89['device']]){if(!this[_0xb6b1('0x32')][_0x4e4e89[_0xb6b1('0x30')]]['local']||_0x4e4e89[_0xb6b1('0x25')]['toLowerCase']()==_0xb6b1('0x33')){this[_0xb6b1('0x32')][_0x4e4e89[_0xb6b1('0x30')]][_0xb6b1('0x34')]=![];if(this[_0xb6b1('0x32')][_0x4e4e89[_0xb6b1('0x30')]]['state']!==_0x4e4e89[_0xb6b1('0x25')][_0xb6b1('0x35')]()){this[_0xb6b1('0x32')][_0x4e4e89[_0xb6b1('0x30')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this[_0xb6b1('0x32')][_0x4e4e89[_0xb6b1('0x30')]][_0xb6b1('0x25')]=_0x4e4e89[_0xb6b1('0x25')][_0xb6b1('0x35')]();this[_0xb6b1('0x32')][_0x4e4e89[_0xb6b1('0x30')]][_0xb6b1('0x36')](_0x4e4e89);}}else if(this[_0xb6b1('0xc')][_0x4e4e89[_0xb6b1('0x30')]]){if(this[_0xb6b1('0xc')][_0x4e4e89[_0xb6b1('0x30')]]['state']!==_0x4e4e89[_0xb6b1('0x25')][_0xb6b1('0x35')]()){this[_0xb6b1('0xc')][_0x4e4e89[_0xb6b1('0x30')]][_0xb6b1('0x37')]=_[_0xb6b1('0x38')](moment()[_0xb6b1('0x2b')]('x'));}this[_0xb6b1('0xc')][_0x4e4e89[_0xb6b1('0x30')]][_0xb6b1('0x25')]=_0x4e4e89[_0xb6b1('0x25')]['toLowerCase']();logger[_0xb6b1('0x22')](_0xb6b1('0x39'),util[_0xb6b1('0x17')](this[_0xb6b1('0xc')][_0x4e4e89[_0xb6b1('0x30')]],{'showHidden':![],'depth':null}));this[_0xb6b1('0x1d')](util[_0xb6b1('0x2b')](_0xb6b1('0x3a'),this['telephones'][_0x4e4e89['device']][_0xb6b1('0x2d')]),_0xb6b1('0x3b'),this[_0xb6b1('0xc')][_0x4e4e89['device']]);}else if(this[_0xb6b1('0xb')][_0x4e4e89[_0xb6b1('0x30')]]){if(this[_0xb6b1('0xb')][_0x4e4e89[_0xb6b1('0x30')]][_0xb6b1('0x25')]!==_0x4e4e89[_0xb6b1('0x25')][_0xb6b1('0x35')]()){this[_0xb6b1('0xb')][_0x4e4e89['device']][_0xb6b1('0x37')]=_['toNumber'](moment()[_0xb6b1('0x2b')]('x'));}this[_0xb6b1('0xb')][_0x4e4e89[_0xb6b1('0x30')]][_0xb6b1('0x25')]=_0x4e4e89[_0xb6b1('0x25')][_0xb6b1('0x35')]();logger['debug'](_0xb6b1('0x3c'),util[_0xb6b1('0x17')](this['trunks'][_0x4e4e89[_0xb6b1('0x30')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xb6b1('0x2b')](_0xb6b1('0x2c'),this[_0xb6b1('0xb')][_0x4e4e89[_0xb6b1('0x30')]][_0xb6b1('0x2d')]),_0xb6b1('0x2e'),this[_0xb6b1('0xb')][_0x4e4e89[_0xb6b1('0x30')]]);}else if(_[_0xb6b1('0x3d')](_0x4e4e89['device'],'Local')){var _0x3826bd=_0x4e4e89[_0xb6b1('0x30')];var _0x5959ca=_0x3826bd[_0xb6b1('0x3e')](_0x3826bd[_0xb6b1('0x3f')]('/')+0x1,_0x3826bd[_0xb6b1('0x3f')]('@'));var _0x1a95cf=_[_0xb6b1('0x23')](this['agents'],function(_0x28f353){return _0x28f353[_0xb6b1('0x40')]==_0x5959ca||_0x28f353[_0xb6b1('0x41')]==_0x5959ca||_0x28f353[_0xb6b1('0x42')]==_0x5959ca;});if(_0x1a95cf){if(_0x1a95cf['state']!==_0x4e4e89['state'][_0xb6b1('0x35')]()){_0x1a95cf['stateTime']=_[_0xb6b1('0x38')](moment()[_0xb6b1('0x2b')]('x'));}_0x1a95cf['state']=_0x4e4e89[_0xb6b1('0x25')]['toLowerCase']();_0x1a95cf[_0xb6b1('0x34')]=!![];_0x1a95cf[_0xb6b1('0x36')](_0x4e4e89);}}}}catch(_0xbd7cec){logger[_0xb6b1('0x15')](_0xb6b1('0x31'),util[_0xb6b1('0x17')](_0xbd7cec,{'showHidden':![],'depth':null}));}};UserReport[_0xb6b1('0x1b')][_0xb6b1('0x43')]=function(_0x37bbbe){try{if(this[_0xb6b1('0x1c')](_0x37bbbe)&&this['isNotNull'](_0x37bbbe[_0xb6b1('0x44')])){logger[_0xb6b1('0x1f')](_0xb6b1('0x45'),_0x37bbbe[_0xb6b1('0x46')],_0x37bbbe[_0xb6b1('0x47')],_0x37bbbe[_0xb6b1('0x44')]);logger[_0xb6b1('0x22')](_0xb6b1('0x48'),util[_0xb6b1('0x17')](_0x37bbbe,{'showHidden':![],'depth':null}));if(this['agents'][_0x37bbbe[_0xb6b1('0x46')]]){if(!this['agents'][_0x37bbbe['peer']][_0xb6b1('0x34')]||_0x37bbbe[_0xb6b1('0x44')]['toLowerCase']()==_0xb6b1('0x49')){this[_0xb6b1('0x32')][_0x37bbbe[_0xb6b1('0x46')]]['local']=![];this[_0xb6b1('0x32')][_0x37bbbe['peer']]['status']=_0x37bbbe[_0xb6b1('0x44')][_0xb6b1('0x35')]();this['agents'][_0x37bbbe['peer']]['address']=_0x37bbbe[_0xb6b1('0x47')];this['agents'][_0x37bbbe['peer']]['updateStatusRealtime'](_0x37bbbe);}}else if(this[_0xb6b1('0xc')][_0x37bbbe[_0xb6b1('0x46')]]){this[_0xb6b1('0xc')][_0x37bbbe[_0xb6b1('0x46')]][_0xb6b1('0x4a')]=_0x37bbbe[_0xb6b1('0x44')]['toLowerCase']();this[_0xb6b1('0xc')][_0x37bbbe[_0xb6b1('0x46')]]['address']=_0x37bbbe['address'];logger[_0xb6b1('0x22')](_0xb6b1('0x4b'),util['inspect'](this['telephones'][_0x37bbbe[_0xb6b1('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xb6b1('0x2b')](_0xb6b1('0x3a'),this['telephones'][_0x37bbbe[_0xb6b1('0x46')]][_0xb6b1('0x2d')]),_0xb6b1('0x3b'),this[_0xb6b1('0xc')][_0x37bbbe[_0xb6b1('0x46')]]);}else if(this[_0xb6b1('0xb')][_0x37bbbe[_0xb6b1('0x46')]]){this[_0xb6b1('0xb')][_0x37bbbe[_0xb6b1('0x46')]][_0xb6b1('0x4a')]=_0x37bbbe['peerstatus'][_0xb6b1('0x35')]();this[_0xb6b1('0xb')][_0x37bbbe[_0xb6b1('0x46')]][_0xb6b1('0x47')]=_0x37bbbe['address'];logger[_0xb6b1('0x22')](_0xb6b1('0x4c'),util[_0xb6b1('0x17')](this[_0xb6b1('0xb')][_0x37bbbe[_0xb6b1('0x46')]],{'showHidden':![],'depth':null}));this[_0xb6b1('0x1d')](util[_0xb6b1('0x2b')]('trunk:%s',this['trunks'][_0x37bbbe[_0xb6b1('0x46')]]['name']),_0xb6b1('0x2e'),this[_0xb6b1('0xb')][_0x37bbbe[_0xb6b1('0x46')]]);}}}catch(_0x4bd083){logger[_0xb6b1('0x15')](_0xb6b1('0x48'),util[_0xb6b1('0x17')](_0x4bd083,{'showHidden':![],'depth':null}));}};module[_0xb6b1('0x4d')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index e3cfec1..554166d 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf4a=['queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','holdtime','lastevent','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwTimeout','interface','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','called'];(function(_0x327f2a,_0x2501ef){var _0x16e1c0=function(_0x1c99bf){while(--_0x1c99bf){_0x327f2a['push'](_0x327f2a['shift']());}};_0x16e1c0(++_0x2501ef);}(_0xdf4a,0x10e));var _0xadf4=function(_0x45549a,_0x3c4806){_0x45549a=_0x45549a-0x0;var _0x5535b8=_0xdf4a[_0x45549a];return _0x5535b8;};'use strict';var _=require(_0xadf4('0x0'));var moment=require(_0xadf4('0x1'));var util=require(_0xadf4('0x2'));var Redis=require(_0xadf4('0x3'));var config=require(_0xadf4('0x4'));var logger=require(_0xadf4('0x5'))(_0xadf4('0x6'));var ami=require('../ami');config[_0xadf4('0x7')]=_['defaults'](config[_0xadf4('0x7')],{'host':_0xadf4('0x8'),'port':0x18eb});var io=require(_0xadf4('0x9'))(new Redis(config[_0xadf4('0x7')]));function VoiceAgentReport(_0xc873e1){this[_0xadf4('0xa')]={};this[_0xadf4('0xb')]=_0xc873e1[_0xadf4('0xb')];this[_0xadf4('0xc')]=_0xc873e1[_0xadf4('0xc')];this[_0xadf4('0xd')]={};ami['on'](_0xadf4('0xe'),this[_0xadf4('0xf')]['bind'](this));ami['on'](_0xadf4('0x10'),this[_0xadf4('0x11')][_0xadf4('0x12')](this));ami['on']('agentringnoanswer',this[_0xadf4('0x13')][_0xadf4('0x12')](this));ami['on']('queuecallerabandon',this[_0xadf4('0x14')]['bind'](this));ami['on'](_0xadf4('0x15'),this[_0xadf4('0x16')][_0xadf4('0x12')](this));ami['on']('varset',this[_0xadf4('0x17')]['bind'](this));ami['on'](_0xadf4('0x18'),this[_0xadf4('0x19')][_0xadf4('0x12')](this));ami['on'](_0xadf4('0x1a'),this[_0xadf4('0x1b')][_0xadf4('0x12')](this));ami['on']('musiconholdstop',this[_0xadf4('0x1c')][_0xadf4('0x12')](this));ami['on'](_0xadf4('0x1d'),this[_0xadf4('0x1e')][_0xadf4('0x12')](this));ami['on']('blindtransfer',this[_0xadf4('0x1f')][_0xadf4('0x12')](this));}VoiceAgentReport[_0xadf4('0x20')][_0xadf4('0x21')]=function(_0x117f47,_0x29ecb6,_0x39f69e){io['to'](_0x117f47)[_0xadf4('0x21')](_0x29ecb6,_0x39f69e);};VoiceAgentReport[_0xadf4('0x20')][_0xadf4('0x22')]=function(_0x3975a6){return _0x3975a6!==null&&!_[_0xadf4('0x23')](_0x3975a6);};VoiceAgentReport[_0xadf4('0x20')][_0xadf4('0xf')]=function(_0x7eface){try{if(this[_0xadf4('0x22')](_0x7eface)){logger[_0xadf4('0x24')](_0xadf4('0x25'),_0x7eface[_0xadf4('0x26')],_0x7eface[_0xadf4('0x27')],_0x7eface[_0xadf4('0x28')]);logger[_0xadf4('0x29')](_0xadf4('0x2a'),_0x7eface['uniqueid'],util[_0xadf4('0x2b')](_0x7eface,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xadf4('0xa')][_0x7eface[_0xadf4('0x26')]])){this[_0xadf4('0xa')][_0x7eface[_0xadf4('0x26')]]={};}if(_[_0xadf4('0x23')](this[_0xadf4('0xa')][_0x7eface[_0xadf4('0x26')]][_0x7eface[_0xadf4('0x28')]])){this[_0xadf4('0xa')][_0x7eface[_0xadf4('0x26')]][_0x7eface[_0xadf4('0x28')]]={'agentcalledAt':moment()[_0xadf4('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xadf4('0x2d'),'mandatoryDisposition':this[_0xadf4('0xb')][_0x7eface[_0xadf4('0x2e')]]?this[_0xadf4('0xb')][_0x7eface['queue']][_0xadf4('0x2f')]||![]:![],'type':this[_0xadf4('0xb')][_0x7eface[_0xadf4('0x2e')]]?this[_0xadf4('0xb')][_0x7eface[_0xadf4('0x2e')]][_0xadf4('0x30')]||_0xadf4('0x31'):_0xadf4('0x31'),'variables':this['variables'][_0x7eface[_0xadf4('0x26')]]};}_[_0xadf4('0x32')](this['channels'][_0x7eface[_0xadf4('0x26')]][_0x7eface[_0xadf4('0x28')]],_[_0xadf4('0x33')](_0x7eface,[_0xadf4('0x34'),_0xadf4('0x35')]));logger['debug'](_0xadf4('0x36'),_0x7eface[_0xadf4('0x26')],util[_0xadf4('0x2b')](this['channels'][_0x7eface[_0xadf4('0x26')]][_0x7eface[_0xadf4('0x28')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcalled',this[_0xadf4('0xa')][_0x7eface['uniqueid']][_0x7eface['destuniqueid']]);logger['debug'](_0xadf4('0x37'),_0x7eface[_0xadf4('0x26')],util[_0xadf4('0x2b')](this[_0xadf4('0xa')][_0x7eface[_0xadf4('0x26')]][_0x7eface[_0xadf4('0x28')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xadf4('0x2c')](_0xadf4('0x38'),_0x7eface[_0xadf4('0x27')]),_0xadf4('0x39'),this[_0xadf4('0xa')][_0x7eface[_0xadf4('0x26')]][_0x7eface['destuniqueid']]);}}catch(_0x323395){logger[_0xadf4('0x3a')]('[%s][voiceAgentReport][agentcalled]',_0x7eface[_0xadf4('0x26')],util['inspect'](_0x323395,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xadf4('0x11')]=function(_0x5487e7){try{if(this[_0xadf4('0x22')](_0x5487e7)){if(this[_0xadf4('0xa')][_0x5487e7['uniqueid']]){logger[_0xadf4('0x29')](_0xadf4('0x3b'),_0x5487e7[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0x5487e7,{'showHidden':![],'depth':null}));for(var _0x2a4c0c in this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]]){if(this[_0xadf4('0xa')][_0x5487e7['uniqueid']][_0xadf4('0x3c')](_0x2a4c0c)){if(_0x5487e7['destuniqueid']===_0x2a4c0c){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x5487e7[_0xadf4('0x26')],_0x5487e7['membername'],_0x5487e7[_0xadf4('0x28')]);this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c][_0xadf4('0x3d')]=moment()[_0xadf4('0x2c')](_0xadf4('0x3e'));this['channels'][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c]['connectedlinename']=_0x5487e7[_0xadf4('0x3f')];this['channels'][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c][_0xadf4('0x40')]=_0x5487e7['connectedlinenum'];this['channels'][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c]['destchannelstate']=_0x5487e7[_0xadf4('0x41')];this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c]['destchannelstatedesc']=_0x5487e7['destchannelstatedesc'];this[_0xadf4('0xa')][_0x5487e7['uniqueid']][_0x2a4c0c][_0xadf4('0x42')]=_0x5487e7[_0xadf4('0x42')];this['channels'][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c][_0xadf4('0x43')]='connect';_[_0xadf4('0x32')](this[_0xadf4('0xc')][_0x5487e7['interface']],_[_0xadf4('0x44')](_0x5487e7,[_0xadf4('0x2e'),_0xadf4('0x45')]));logger[_0xadf4('0x29')](_0xadf4('0x46'),_0x5487e7[_0xadf4('0x26')],util[_0xadf4('0x2b')](this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x5487e7[_0xadf4('0x28')]],{'showHidden':![],'depth':null}));ami[_0xadf4('0x21')](_0xadf4('0x47'),this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x5487e7[_0xadf4('0x28')]]);logger['debug'](_0xadf4('0x48'),_0x5487e7[_0xadf4('0x26')],util[_0xadf4('0x2b')](this[_0xadf4('0xa')][_0x5487e7['uniqueid']][_0x5487e7[_0xadf4('0x28')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xadf4('0x2c')]('user:%s',_0x5487e7[_0xadf4('0x27')]),_0xadf4('0x49'),this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x5487e7['destuniqueid']]);}else if(!this[_0xadf4('0xa')][_0x5487e7['uniqueid']][_0x2a4c0c][_0xadf4('0x4a')]&&!this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c][_0xadf4('0x15')]){logger[_0xadf4('0x24')](_0xadf4('0x4b'),_0x5487e7['uniqueid'],this['channels'][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c][_0xadf4('0x27')],_0x2a4c0c);this[_0xadf4('0xa')][_0x5487e7['uniqueid']][_0x2a4c0c][_0xadf4('0x4a')]=!![];this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c][_0xadf4('0x4c')]=moment()[_0xadf4('0x2c')](_0xadf4('0x3e'));this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c][_0xadf4('0x4d')]=_0x5487e7['destuniqueid'];this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c][_0xadf4('0x4e')]=_0x5487e7[_0xadf4('0x27')];this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c][_0xadf4('0x43')]=_0xadf4('0x4f');this['channels'][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c][_0xadf4('0x50')]='answered_elsewhere';logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x5487e7[_0xadf4('0x26')],util['inspect'](this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c],{'showHidden':![],'depth':null}));ami[_0xadf4('0x21')](_0xadf4('0x51'),this[_0xadf4('0xa')][_0x5487e7[_0xadf4('0x26')]][_0x2a4c0c]);}}}}}}catch(_0x8eb93c){logger[_0xadf4('0x3a')](_0xadf4('0x52'),_0x5487e7['uniqueid'],util[_0xadf4('0x2b')](_0x8eb93c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentRingNoAnswer']=function(_0x4e1c22){try{if(this[_0xadf4('0x22')](_0x4e1c22)){logger[_0xadf4('0x29')](_0xadf4('0x53'),_0x4e1c22[_0xadf4('0x26')],util['inspect'](_0x4e1c22,{'showHidden':![],'depth':null}));if(this[_0xadf4('0xa')][_0x4e1c22['uniqueid']]&&this[_0xadf4('0xa')][_0x4e1c22[_0xadf4('0x26')]][_0x4e1c22[_0xadf4('0x28')]]){logger[_0xadf4('0x24')](_0xadf4('0x54'),_0x4e1c22[_0xadf4('0x26')],_0x4e1c22[_0xadf4('0x27')],_0x4e1c22['destuniqueid']);this[_0xadf4('0xa')][_0x4e1c22['uniqueid']][_0x4e1c22[_0xadf4('0x28')]][_0xadf4('0x4a')]=!![];this[_0xadf4('0xa')][_0x4e1c22[_0xadf4('0x26')]][_0x4e1c22[_0xadf4('0x28')]][_0xadf4('0x4c')]=moment()[_0xadf4('0x2c')](_0xadf4('0x3e'));this[_0xadf4('0xa')][_0x4e1c22['uniqueid']][_0x4e1c22[_0xadf4('0x28')]][_0xadf4('0x43')]=_0xadf4('0x55');this[_0xadf4('0xa')][_0x4e1c22[_0xadf4('0x26')]][_0x4e1c22[_0xadf4('0x28')]][_0xadf4('0x50')]=_0xadf4('0x55');logger[_0xadf4('0x29')](_0xadf4('0x56'),_0x4e1c22[_0xadf4('0x26')],util[_0xadf4('0x2b')](this[_0xadf4('0xa')][_0x4e1c22['uniqueid']][_0x4e1c22[_0xadf4('0x28')]],{'showHidden':![],'depth':null}));ami[_0xadf4('0x21')](_0xadf4('0x57'),this[_0xadf4('0xa')][_0x4e1c22[_0xadf4('0x26')]][_0x4e1c22[_0xadf4('0x28')]]);}}}catch(_0x26ec21){logger['error'](_0xadf4('0x58'),_0x4e1c22[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0x26ec21,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xadf4('0x20')][_0xadf4('0x14')]=function(_0x2e192b){try{if(this[_0xadf4('0x22')](_0x2e192b)){logger[_0xadf4('0x29')](_0xadf4('0x59'),_0x2e192b[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0x2e192b,{'showHidden':![],'depth':null}));if(this[_0xadf4('0xa')][_0x2e192b['uniqueid']]){for(var _0x10a65c in this[_0xadf4('0xa')][_0x2e192b['uniqueid']]){if(this[_0xadf4('0xa')][_0x2e192b[_0xadf4('0x26')]][_0xadf4('0x3c')](_0x10a65c)&&!this[_0xadf4('0xa')][_0x2e192b[_0xadf4('0x26')]][_0x10a65c][_0xadf4('0x4a')]&&!this[_0xadf4('0xa')][_0x2e192b['uniqueid']][_0x10a65c][_0xadf4('0x15')]){logger[_0xadf4('0x24')](_0xadf4('0x5a'),_0x2e192b[_0xadf4('0x26')],this[_0xadf4('0xa')][_0x2e192b[_0xadf4('0x26')]][_0x10a65c][_0xadf4('0x27')],_0x10a65c);this[_0xadf4('0xa')][_0x2e192b[_0xadf4('0x26')]][_0x10a65c][_0xadf4('0x4a')]=!![];this[_0xadf4('0xa')][_0x2e192b[_0xadf4('0x26')]][_0x10a65c][_0xadf4('0x4c')]=moment()[_0xadf4('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xadf4('0xa')][_0x2e192b[_0xadf4('0x26')]][_0x10a65c][_0xadf4('0x43')]=_0xadf4('0x5b');this['channels'][_0x2e192b[_0xadf4('0x26')]][_0x10a65c]['reason']=_0xadf4('0x5b');logger[_0xadf4('0x29')](_0xadf4('0x5c'),_0x2e192b[_0xadf4('0x26')],util[_0xadf4('0x2b')](this['channels'][_0x2e192b[_0xadf4('0x26')]][_0x10a65c],{'showHidden':![],'depth':null}));ami['emit'](_0xadf4('0x5d'),this[_0xadf4('0xa')][_0x2e192b[_0xadf4('0x26')]][_0x10a65c]);}}}}}catch(_0x4beedc){logger['error']('[%s][voiceAgentReport][queuecallerabandon]',_0x2e192b[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0x4beedc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xadf4('0x20')][_0xadf4('0x16')]=function(_0x123d2f){try{if(this['isNotNull'](_0x123d2f)){logger[_0xadf4('0x29')](_0xadf4('0x5e'),_0x123d2f[_0xadf4('0x26')],util['inspect'](_0x123d2f,{'showHidden':![],'depth':null}));if(this['channels'][_0x123d2f[_0xadf4('0x26')]]){for(var _0x1d93a6 in this['channels'][_0x123d2f[_0xadf4('0x26')]]){if(this[_0xadf4('0xa')][_0x123d2f['uniqueid']][_0xadf4('0x3c')](_0x1d93a6)){if(this[_0xadf4('0xa')][_0x123d2f['uniqueid']][_0x1d93a6][_0xadf4('0x3d')]&&!this[_0xadf4('0xa')][_0x123d2f[_0xadf4('0x26')]][_0x1d93a6]['agentcomplete']){logger[_0xadf4('0x24')](_0xadf4('0x5f'),_0x123d2f[_0xadf4('0x26')],this['channels'][_0x123d2f[_0xadf4('0x26')]][_0x1d93a6][_0xadf4('0x27')],_0x1d93a6);this[_0xadf4('0xa')][_0x123d2f[_0xadf4('0x26')]][_0x1d93a6][_0xadf4('0x15')]=!![];this[_0xadf4('0xa')][_0x123d2f['uniqueid']][_0x1d93a6][_0xadf4('0x60')]=moment()[_0xadf4('0x2c')](_0xadf4('0x3e'));this[_0xadf4('0xa')][_0x123d2f[_0xadf4('0x26')]][_0x1d93a6][_0xadf4('0x43')]=_0xadf4('0x61');this[_0xadf4('0xa')][_0x123d2f[_0xadf4('0x26')]][_0x1d93a6]['reason']=_0x123d2f[_0xadf4('0x50')]==_0xadf4('0x62')?_0xadf4('0x63'):_0x123d2f[_0xadf4('0x50')];this['channels'][_0x123d2f[_0xadf4('0x26')]][_0x1d93a6]['talktime']=_0x123d2f[_0xadf4('0x64')];if(this[_0xadf4('0xb')][_0x123d2f['queue']]&&this[_0xadf4('0xb')][_0x123d2f[_0xadf4('0x2e')]][_0xadf4('0x65')]){this[_0xadf4('0xa')][_0x123d2f[_0xadf4('0x26')]][_0x1d93a6]['acwtime']=this['voiceQueues'][_0x123d2f['queue']][_0xadf4('0x66')];this[_0xadf4('0xa')][_0x123d2f['uniqueid']][_0x1d93a6]['agentacw']=!![];}this[_0xadf4('0xc')][_0x123d2f[_0xadf4('0x67')]]=_['omit'](this['agents'][_0x123d2f[_0xadf4('0x67')]],[_0xadf4('0x2e'),_0xadf4('0x45')]);logger[_0xadf4('0x29')](_0xadf4('0x68'),_0x123d2f[_0xadf4('0x26')],util[_0xadf4('0x2b')](this[_0xadf4('0xa')][_0x123d2f['uniqueid']][_0x1d93a6],{'showHidden':![],'depth':null}));ami[_0xadf4('0x21')](_0xadf4('0x69'),this['channels'][_0x123d2f[_0xadf4('0x26')]][_0x1d93a6]);logger['debug'](_0xadf4('0x6a'),_0x123d2f[_0xadf4('0x26')],util[_0xadf4('0x2b')](this[_0xadf4('0xa')][_0x123d2f['uniqueid']][_0x1d93a6],{'showHidden':![],'depth':null}));this[_0xadf4('0x21')](util['format'](_0xadf4('0x38'),_0x123d2f[_0xadf4('0x27')]),_0xadf4('0x6b'),this['channels'][_0x123d2f['uniqueid']][_0x1d93a6]);}}}}}}catch(_0xc5dbfd){logger[_0xadf4('0x3a')]('[%s][voiceAgentReport][agentcomplete]',_0x123d2f[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0xc5dbfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xadf4('0x20')][_0xadf4('0x17')]=function(_0x4302ea){try{if(this[_0xadf4('0x22')](_0x4302ea)){logger['debug'](_0xadf4('0x6c'),_0x4302ea['uniqueid'],util[_0xadf4('0x2b')](_0x4302ea,{'showHidden':![],'depth':null}));this[_0xadf4('0x6d')](_0x4302ea[_0xadf4('0x26')],_['keys'](_0x4302ea['variable'])[0x0],_0x4302ea[_0xadf4('0x6e')]);if(this['channels'][_0x4302ea[_0xadf4('0x26')]]){for(var _0x23fce7 in this[_0xadf4('0xa')][_0x4302ea['uniqueid']]){if(this[_0xadf4('0xa')][_0x4302ea[_0xadf4('0x26')]][_0xadf4('0x3c')](_0x23fce7)){logger['info'](_0xadf4('0x6f'),_0x4302ea[_0xadf4('0x26')],_0x23fce7,_[_0xadf4('0x70')](_0x4302ea['variable'])[0x0],_0x4302ea[_0xadf4('0x6e')]);if(_['isUndefined'](this[_0xadf4('0xa')][_0x4302ea['uniqueid']][_0x23fce7][_0xadf4('0xd')])){this[_0xadf4('0xa')][_0x4302ea[_0xadf4('0x26')]][_0x23fce7][_0xadf4('0xd')]={};}this[_0xadf4('0xa')][_0x4302ea[_0xadf4('0x26')]][_0x23fce7][_0xadf4('0xd')]=this[_0xadf4('0xd')][_0x4302ea['uniqueid']];}}}}}catch(_0x5854fe){logger[_0xadf4('0x3a')](_0xadf4('0x71'),_0x4302ea['uniqueid'],util[_0xadf4('0x2b')](_0x5854fe,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xadf4('0x20')]['addVariable']=function(_0x442856,_0x579efc,_0x252548){var _0x7331bb=[_0xadf4('0x72'),_0xadf4('0x73'),_0xadf4('0x74'),_0xadf4('0x75'),_0xadf4('0x76'),_0xadf4('0x77'),_0xadf4('0x78'),_0xadf4('0x79'),_0xadf4('0x7a'),_0xadf4('0x7b'),'bridgepeer',_0xadf4('0x7c'),_0xadf4('0x7d'),_0xadf4('0x7e'),_0xadf4('0x7f'),'memberlastcall',_0xadf4('0x27'),_0xadf4('0x80'),_0xadf4('0x81')];if(!_[_0xadf4('0x82')](_0x579efc)&&!_['includes'](_0x7331bb,_0x579efc)){if(_[_0xadf4('0x23')](this[_0xadf4('0xd')][_0x442856])){this[_0xadf4('0xd')][_0x442856]={};}this['variables'][_0x442856][_0x579efc]=_0x252548;}};VoiceAgentReport['prototype'][_0xadf4('0x19')]=function(_0x3fc582){try{if(this['isNotNull'](_0x3fc582)){logger[_0xadf4('0x29')](_0xadf4('0x83'),_0x3fc582[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0x3fc582,{'showHidden':![],'depth':null}));if(this['channels'][_0x3fc582[_0xadf4('0x26')]]){for(var _0x11379b in this[_0xadf4('0xa')][_0x3fc582['uniqueid']]){if(this[_0xadf4('0xa')][_0x3fc582[_0xadf4('0x26')]][_0xadf4('0x3c')](_0x11379b)){if(this[_0xadf4('0xa')][_0x3fc582['uniqueid']][_0x11379b][_0xadf4('0x50')]==_0xadf4('0x62')&&this[_0xadf4('0xa')][_0x3fc582[_0xadf4('0x26')]][_0x11379b][_0xadf4('0x15')]){logger['info'](_0xadf4('0x84'),_0x3fc582[_0xadf4('0x26')],_0x11379b);this[_0xadf4('0xa')][_0x3fc582[_0xadf4('0x26')]][_0x11379b][_0xadf4('0x60')]=moment()[_0xadf4('0x2c')](_0xadf4('0x3e'));}}}logger['debug'](_0xadf4('0x85'),_0x3fc582['uniqueid'],util[_0xadf4('0x2b')](_[_0xadf4('0x86')](this['channels'][_0x3fc582[_0xadf4('0x26')]]),{'showHidden':![],'depth':null}));ami[_0xadf4('0x21')](_0xadf4('0x87'),_[_0xadf4('0x86')](this[_0xadf4('0xa')][_0x3fc582[_0xadf4('0x26')]]));delete this['channels'][_0x3fc582['uniqueid']];}if(this[_0xadf4('0xd')][_0x3fc582[_0xadf4('0x26')]]){delete this[_0xadf4('0xd')][_0x3fc582[_0xadf4('0x26')]];}}}catch(_0x24f72b){logger['error'](_0xadf4('0x88'),_0x3fc582[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0x24f72b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xadf4('0x20')]['syncAttendedTransfer']=function(_0x2c9acf){try{if(this[_0xadf4('0x22')](_0x2c9acf)){logger[_0xadf4('0x29')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x2c9acf[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0x2c9acf,{'showHidden':![],'depth':null}));if(this['channels'][_0x2c9acf[_0xadf4('0x89')]]){for(var _0xcbb7c4 in this[_0xadf4('0xa')][_0x2c9acf[_0xadf4('0x89')]]){if(this[_0xadf4('0xa')][_0x2c9acf[_0xadf4('0x89')]][_0xadf4('0x3c')](_0xcbb7c4)){if(_0x2c9acf[_0xadf4('0x8a')]===_0xcbb7c4){logger[_0xadf4('0x24')](_0xadf4('0x8b'),_0x2c9acf['uniqueid'],this[_0xadf4('0xa')][_0x2c9acf['transfereeuniqueid']][_0xcbb7c4]['membername'],_0xcbb7c4);var _0x5535d4=moment();this[_0xadf4('0xa')][_0x2c9acf[_0xadf4('0x89')]][_0xcbb7c4][_0xadf4('0x15')]=!![];this[_0xadf4('0xa')][_0x2c9acf[_0xadf4('0x89')]][_0xcbb7c4]['agentcompleteAt']=moment()[_0xadf4('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xadf4('0xa')][_0x2c9acf[_0xadf4('0x89')]][_0xcbb7c4][_0xadf4('0x43')]='complete';this[_0xadf4('0xa')][_0x2c9acf[_0xadf4('0x89')]][_0xcbb7c4][_0xadf4('0x50')]=_0xadf4('0x62');this[_0xadf4('0xa')][_0x2c9acf['transfereeuniqueid']][_0xcbb7c4]['talktime']=_0x5535d4[_0xadf4('0x8c')](this[_0xadf4('0xa')][_0x2c9acf[_0xadf4('0x89')]][_0xcbb7c4][_0xadf4('0x3d')],'seconds');}}}}if(this[_0xadf4('0xa')][_0x2c9acf[_0xadf4('0x8d')]]){var _0x52641d=this['channels'][_0x2c9acf['secondtransfereruniqueid']];this[_0xadf4('0xa')][_0x2c9acf['secondtransfereruniqueid']]=this[_0xadf4('0xa')][_0x2c9acf[_0xadf4('0x89')]];this['channels'][_0x2c9acf[_0xadf4('0x89')]]=_0x52641d;}}}catch(_0x43aa6c){logger['error'](_0xadf4('0x8e'),_0x2c9acf[_0xadf4('0x26')],util['inspect'](_0x43aa6c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xadf4('0x1f')]=function(_0x5a1dff){try{if(this['isNotNull'](_0x5a1dff)){logger[_0xadf4('0x29')](_0xadf4('0x8f'),_0x5a1dff[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0x5a1dff,{'showHidden':![],'depth':null}));if(this[_0xadf4('0xa')][_0x5a1dff[_0xadf4('0x89')]]){for(var _0x51ee4d in this['channels'][_0x5a1dff['transfereeuniqueid']]){if(this[_0xadf4('0xa')][_0x5a1dff[_0xadf4('0x89')]][_0xadf4('0x3c')](_0x51ee4d)){if(_0x5a1dff[_0xadf4('0x90')]===_0x51ee4d){logger[_0xadf4('0x24')](_0xadf4('0x91'),_0x5a1dff['uniqueid'],this[_0xadf4('0xa')][_0x5a1dff[_0xadf4('0x89')]][_0x51ee4d][_0xadf4('0x27')],_0x51ee4d);var _0x1f12c5=moment();this['channels'][_0x5a1dff[_0xadf4('0x89')]][_0x51ee4d]['agentcomplete']=!![];this[_0xadf4('0xa')][_0x5a1dff[_0xadf4('0x89')]][_0x51ee4d][_0xadf4('0x60')]=_0x1f12c5;this['channels'][_0x5a1dff['transfereeuniqueid']][_0x51ee4d][_0xadf4('0x43')]='complete';this[_0xadf4('0xa')][_0x5a1dff[_0xadf4('0x89')]][_0x51ee4d]['reason']=_0xadf4('0x62');this['channels'][_0x5a1dff[_0xadf4('0x89')]][_0x51ee4d][_0xadf4('0x64')]=_0x1f12c5[_0xadf4('0x8c')](this[_0xadf4('0xa')][_0x5a1dff['transfereeuniqueid']][_0x51ee4d][_0xadf4('0x3d')],_0xadf4('0x92'));}}}}}}catch(_0x7ba819){logger[_0xadf4('0x3a')](_0xadf4('0x93'),_0x5a1dff[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0x7ba819,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xadf4('0x20')][_0xadf4('0x1b')]=function(_0x1278cc){var _0x19764d='';try{if(this[_0xadf4('0x22')](_0x1278cc)){logger[_0xadf4('0x29')](_0xadf4('0x94'),_0x1278cc[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0x1278cc,{'showHidden':![],'depth':null}));if(_0x1278cc[_0xadf4('0x95')]){_0x19764d=_0x1278cc[_0xadf4('0x95')][_0xadf4('0x96')](0x0,_0x1278cc['channel'][_0xadf4('0x97')]('-'));if(this[_0xadf4('0xc')][_0x19764d]){logger[_0xadf4('0x24')](_0xadf4('0x98'),_0x1278cc[_0xadf4('0x26')],_0x19764d);this[_0xadf4('0xc')][_0x19764d][_0xadf4('0x99')]=!![];}}}}catch(_0xe868e){logger[_0xadf4('0x3a')]('[%s][voiceAgentReport][musiconholdstart]',_0x1278cc[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0xe868e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xadf4('0x20')][_0xadf4('0x1c')]=function(_0x5f4975){var _0x3801b4='';try{if(this[_0xadf4('0x22')](_0x5f4975)){logger['debug'](_0xadf4('0x9a'),_0x5f4975['uniqueid'],util[_0xadf4('0x2b')](_0x5f4975,{'showHidden':![],'depth':null}));if(_0x5f4975[_0xadf4('0x95')]){_0x3801b4=_0x5f4975[_0xadf4('0x95')][_0xadf4('0x96')](0x0,_0x5f4975[_0xadf4('0x95')][_0xadf4('0x97')]('-'));if(this['agents'][_0x3801b4]){logger[_0xadf4('0x24')](_0xadf4('0x9b'),_0x5f4975[_0xadf4('0x26')],_0x3801b4);this['agents'][_0x3801b4][_0xadf4('0x99')]=![];}}}}catch(_0x8c860e){logger[_0xadf4('0x3a')](_0xadf4('0x9c'),_0x5f4975[_0xadf4('0x26')],util[_0xadf4('0x2b')](_0x8c860e,{'showHidden':![],'depth':null}));}};module[_0xadf4('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0x49e4=['isNotNull','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','debug','isUndefined','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','inbound','variables','merge','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','inspect','user:%s','membername','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentcomplete','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','acw','acwTimeout','agentacw','interface','custom:agentcomplete','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','value','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','talktime','seconds','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','util','ioredis','../../../config/environment','ami','../ami','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','prototype','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x49e4,0x7f));var _0x449e=function(_0x1c48ff,_0x1e39cd){_0x1c48ff=_0x1c48ff-0x0;var _0x5553cc=_0x49e4[_0x1c48ff];return _0x5553cc;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x449e('0x0'));var Redis=require(_0x449e('0x1'));var config=require(_0x449e('0x2'));var logger=require('../../../config/logger')(_0x449e('0x3'));var ami=require(_0x449e('0x4'));config[_0x449e('0x5')]=_['defaults'](config[_0x449e('0x5')],{'host':_0x449e('0x6'),'port':0x18eb});var io=require(_0x449e('0x7'))(new Redis(config[_0x449e('0x5')]));function VoiceAgentReport(_0x4b32d8){this[_0x449e('0x8')]={};this['voiceQueues']=_0x4b32d8[_0x449e('0x9')];this[_0x449e('0xa')]=_0x4b32d8[_0x449e('0xa')];this['variables']={};ami['on'](_0x449e('0xb'),this[_0x449e('0xc')][_0x449e('0xd')](this));ami['on'](_0x449e('0xe'),this[_0x449e('0xf')]['bind'](this));ami['on']('agentringnoanswer',this[_0x449e('0x10')][_0x449e('0xd')](this));ami['on'](_0x449e('0x11'),this['syncQueueCallerAbandon'][_0x449e('0xd')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x449e('0xd')](this));ami['on'](_0x449e('0x12'),this[_0x449e('0x13')]['bind'](this));ami['on'](_0x449e('0x14'),this[_0x449e('0x15')]['bind'](this));ami['on'](_0x449e('0x16'),this['syncMusicOnHoldStart'][_0x449e('0xd')](this));ami['on'](_0x449e('0x17'),this[_0x449e('0x18')][_0x449e('0xd')](this));ami['on'](_0x449e('0x19'),this[_0x449e('0x1a')][_0x449e('0xd')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x449e('0xd')](this));}VoiceAgentReport[_0x449e('0x1b')][_0x449e('0x1c')]=function(_0x190902,_0x32a69f,_0x4e5160){io['to'](_0x190902)[_0x449e('0x1c')](_0x32a69f,_0x4e5160);};VoiceAgentReport[_0x449e('0x1b')][_0x449e('0x1d')]=function(_0x347b1b){return _0x347b1b!==null&&!_['isUndefined'](_0x347b1b);};VoiceAgentReport['prototype']['syncAgentCalled']=function(_0x4b09ce){try{if(this[_0x449e('0x1d')](_0x4b09ce)){logger['info'](_0x449e('0x1e'),_0x4b09ce[_0x449e('0x1f')],_0x4b09ce['membername'],_0x4b09ce['destuniqueid']);logger[_0x449e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x4b09ce['uniqueid'],util['inspect'](_0x4b09ce,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x449e('0x8')][_0x4b09ce[_0x449e('0x1f')]])){this[_0x449e('0x8')][_0x4b09ce[_0x449e('0x1f')]]={};}if(_[_0x449e('0x21')](this[_0x449e('0x8')][_0x4b09ce['uniqueid']][_0x4b09ce[_0x449e('0x22')]])){this[_0x449e('0x8')][_0x4b09ce[_0x449e('0x1f')]][_0x4b09ce['destuniqueid']]={'agentcalledAt':moment()[_0x449e('0x23')](_0x449e('0x24')),'lastevent':'called','mandatoryDisposition':this[_0x449e('0x9')][_0x4b09ce[_0x449e('0x25')]]?this['voiceQueues'][_0x4b09ce['queue']][_0x449e('0x26')]||![]:![],'type':this[_0x449e('0x9')][_0x4b09ce[_0x449e('0x25')]]?this[_0x449e('0x9')][_0x4b09ce[_0x449e('0x25')]]['type']||_0x449e('0x27'):_0x449e('0x27'),'variables':this[_0x449e('0x28')][_0x4b09ce['uniqueid']]};}_[_0x449e('0x29')](this[_0x449e('0x8')][_0x4b09ce[_0x449e('0x1f')]][_0x4b09ce[_0x449e('0x22')]],_[_0x449e('0x2a')](_0x4b09ce,[_0x449e('0x2b'),'privilege']));logger[_0x449e('0x20')](_0x449e('0x2c'),_0x4b09ce[_0x449e('0x1f')],util['inspect'](this[_0x449e('0x8')][_0x4b09ce[_0x449e('0x1f')]][_0x4b09ce[_0x449e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x449e('0x1c')](_0x449e('0x2d'),this[_0x449e('0x8')][_0x4b09ce[_0x449e('0x1f')]][_0x4b09ce[_0x449e('0x22')]]);logger[_0x449e('0x20')](_0x449e('0x2e'),_0x4b09ce['uniqueid'],util[_0x449e('0x2f')](this[_0x449e('0x8')][_0x4b09ce[_0x449e('0x1f')]][_0x4b09ce[_0x449e('0x22')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x449e('0x23')](_0x449e('0x30'),_0x4b09ce[_0x449e('0x31')]),_0x449e('0x32'),this[_0x449e('0x8')][_0x4b09ce['uniqueid']][_0x4b09ce[_0x449e('0x22')]]);}}catch(_0x4e7a08){logger[_0x449e('0x33')](_0x449e('0x34'),_0x4b09ce[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x4e7a08,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x449e('0x1b')][_0x449e('0xf')]=function(_0x3c5e58){try{if(this[_0x449e('0x1d')](_0x3c5e58)){if(this[_0x449e('0x8')][_0x3c5e58['uniqueid']]){logger[_0x449e('0x20')](_0x449e('0x35'),_0x3c5e58[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x3c5e58,{'showHidden':![],'depth':null}));for(var _0x30176c in this['channels'][_0x3c5e58[_0x449e('0x1f')]]){if(this['channels'][_0x3c5e58['uniqueid']][_0x449e('0x36')](_0x30176c)){if(_0x3c5e58[_0x449e('0x22')]===_0x30176c){logger['info'](_0x449e('0x37'),_0x3c5e58[_0x449e('0x1f')],_0x3c5e58[_0x449e('0x31')],_0x3c5e58[_0x449e('0x22')]);this['channels'][_0x3c5e58['uniqueid']][_0x30176c]['agentconnectAt']=moment()[_0x449e('0x23')](_0x449e('0x24'));this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x30176c][_0x449e('0x38')]=_0x3c5e58[_0x449e('0x38')];this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x30176c][_0x449e('0x39')]=_0x3c5e58['connectedlinenum'];this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x30176c][_0x449e('0x3a')]=_0x3c5e58[_0x449e('0x3a')];this['channels'][_0x3c5e58['uniqueid']][_0x30176c][_0x449e('0x3b')]=_0x3c5e58[_0x449e('0x3b')];this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x30176c][_0x449e('0x3c')]=_0x3c5e58['holdtime'];this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x30176c][_0x449e('0x3d')]=_0x449e('0x3e');_[_0x449e('0x29')](this[_0x449e('0xa')][_0x3c5e58['interface']],_[_0x449e('0x3f')](_0x3c5e58,[_0x449e('0x25'),_0x449e('0x40')]));logger['debug'](_0x449e('0x41'),_0x3c5e58[_0x449e('0x1f')],util[_0x449e('0x2f')](this[_0x449e('0x8')][_0x3c5e58['uniqueid']][_0x3c5e58[_0x449e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x449e('0x1c')](_0x449e('0x42'),this[_0x449e('0x8')][_0x3c5e58['uniqueid']][_0x3c5e58[_0x449e('0x22')]]);logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x3c5e58[_0x449e('0x1f')],util[_0x449e('0x2f')](this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x3c5e58[_0x449e('0x22')]],{'showHidden':![],'depth':null}));this[_0x449e('0x1c')](util[_0x449e('0x23')](_0x449e('0x30'),_0x3c5e58[_0x449e('0x31')]),_0x449e('0x43'),this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x3c5e58[_0x449e('0x22')]]);}else if(!this[_0x449e('0x8')][_0x3c5e58['uniqueid']][_0x30176c][_0x449e('0x44')]&&!this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x30176c][_0x449e('0x45')]){logger[_0x449e('0x46')](_0x449e('0x47'),_0x3c5e58[_0x449e('0x1f')],this[_0x449e('0x8')][_0x3c5e58['uniqueid']][_0x30176c][_0x449e('0x31')],_0x30176c);this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x30176c][_0x449e('0x44')]=!![];this[_0x449e('0x8')][_0x3c5e58['uniqueid']][_0x30176c][_0x449e('0x48')]=moment()[_0x449e('0x23')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x30176c][_0x449e('0x49')]=_0x3c5e58[_0x449e('0x22')];this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x30176c][_0x449e('0x4a')]=_0x3c5e58[_0x449e('0x31')];this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x30176c][_0x449e('0x3d')]=_0x449e('0x4b');this[_0x449e('0x8')][_0x3c5e58[_0x449e('0x1f')]][_0x30176c][_0x449e('0x4c')]='answered_elsewhere';logger[_0x449e('0x20')](_0x449e('0x4d'),_0x3c5e58[_0x449e('0x1f')],util[_0x449e('0x2f')](this[_0x449e('0x8')][_0x3c5e58['uniqueid']][_0x30176c],{'showHidden':![],'depth':null}));ami[_0x449e('0x1c')](_0x449e('0x4e'),this[_0x449e('0x8')][_0x3c5e58['uniqueid']][_0x30176c]);}}}}}}catch(_0x405e33){logger['error'](_0x449e('0x4f'),_0x3c5e58[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x405e33,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x449e('0x1b')]['syncAgentRingNoAnswer']=function(_0x5185a1){try{if(this[_0x449e('0x1d')](_0x5185a1)){logger[_0x449e('0x20')](_0x449e('0x50'),_0x5185a1[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x5185a1,{'showHidden':![],'depth':null}));if(this[_0x449e('0x8')][_0x5185a1['uniqueid']]&&this[_0x449e('0x8')][_0x5185a1['uniqueid']][_0x5185a1['destuniqueid']]){logger['info'](_0x449e('0x51'),_0x5185a1['uniqueid'],_0x5185a1[_0x449e('0x31')],_0x5185a1['destuniqueid']);this[_0x449e('0x8')][_0x5185a1[_0x449e('0x1f')]][_0x5185a1[_0x449e('0x22')]]['agentringnoanswer']=!![];this[_0x449e('0x8')][_0x5185a1[_0x449e('0x1f')]][_0x5185a1['destuniqueid']][_0x449e('0x48')]=moment()[_0x449e('0x23')](_0x449e('0x24'));this[_0x449e('0x8')][_0x5185a1[_0x449e('0x1f')]][_0x5185a1['destuniqueid']][_0x449e('0x3d')]='rejected';this[_0x449e('0x8')][_0x5185a1['uniqueid']][_0x5185a1[_0x449e('0x22')]][_0x449e('0x4c')]=_0x449e('0x52');logger[_0x449e('0x20')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5185a1[_0x449e('0x1f')],util[_0x449e('0x2f')](this[_0x449e('0x8')][_0x5185a1[_0x449e('0x1f')]][_0x5185a1[_0x449e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x449e('0x53'),this[_0x449e('0x8')][_0x5185a1[_0x449e('0x1f')]][_0x5185a1['destuniqueid']]);}}}catch(_0x50d90d){logger[_0x449e('0x33')](_0x449e('0x54'),_0x5185a1[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x50d90d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x449e('0x1b')][_0x449e('0x55')]=function(_0x475a3a){try{if(this['isNotNull'](_0x475a3a)){logger[_0x449e('0x20')](_0x449e('0x56'),_0x475a3a[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x475a3a,{'showHidden':![],'depth':null}));if(this[_0x449e('0x8')][_0x475a3a[_0x449e('0x1f')]]){for(var _0x31004e in this[_0x449e('0x8')][_0x475a3a[_0x449e('0x1f')]]){if(this['channels'][_0x475a3a[_0x449e('0x1f')]][_0x449e('0x36')](_0x31004e)&&!this[_0x449e('0x8')][_0x475a3a[_0x449e('0x1f')]][_0x31004e][_0x449e('0x44')]&&!this[_0x449e('0x8')][_0x475a3a[_0x449e('0x1f')]][_0x31004e][_0x449e('0x45')]){logger[_0x449e('0x46')](_0x449e('0x57'),_0x475a3a[_0x449e('0x1f')],this[_0x449e('0x8')][_0x475a3a['uniqueid']][_0x31004e][_0x449e('0x31')],_0x31004e);this[_0x449e('0x8')][_0x475a3a[_0x449e('0x1f')]][_0x31004e][_0x449e('0x44')]=!![];this['channels'][_0x475a3a[_0x449e('0x1f')]][_0x31004e][_0x449e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x449e('0x8')][_0x475a3a[_0x449e('0x1f')]][_0x31004e][_0x449e('0x3d')]=_0x449e('0x58');this['channels'][_0x475a3a[_0x449e('0x1f')]][_0x31004e][_0x449e('0x4c')]=_0x449e('0x58');logger[_0x449e('0x20')](_0x449e('0x59'),_0x475a3a[_0x449e('0x1f')],util[_0x449e('0x2f')](this[_0x449e('0x8')][_0x475a3a['uniqueid']][_0x31004e],{'showHidden':![],'depth':null}));ami['emit'](_0x449e('0x5a'),this[_0x449e('0x8')][_0x475a3a[_0x449e('0x1f')]][_0x31004e]);}}}}}catch(_0x4a7c48){logger[_0x449e('0x33')](_0x449e('0x5b'),_0x475a3a[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x4a7c48,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x449e('0x1b')]['syncAgentComplete']=function(_0x1012e2){try{if(this[_0x449e('0x1d')](_0x1012e2)){logger[_0x449e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x1012e2[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x1012e2,{'showHidden':![],'depth':null}));if(this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]]){for(var _0x50dcec in this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]]){if(this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]]['hasOwnProperty'](_0x50dcec)){if(this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]][_0x50dcec][_0x449e('0x5c')]&&!this[_0x449e('0x8')][_0x1012e2['uniqueid']][_0x50dcec][_0x449e('0x45')]){logger['info'](_0x449e('0x5d'),_0x1012e2['uniqueid'],this['channels'][_0x1012e2[_0x449e('0x1f')]][_0x50dcec][_0x449e('0x31')],_0x50dcec);this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]][_0x50dcec][_0x449e('0x45')]=!![];this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]][_0x50dcec]['agentcompleteAt']=moment()[_0x449e('0x23')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]][_0x50dcec][_0x449e('0x3d')]=_0x449e('0x5e');this[_0x449e('0x8')][_0x1012e2['uniqueid']][_0x50dcec][_0x449e('0x4c')]=_0x1012e2[_0x449e('0x4c')]==_0x449e('0x5f')?'agent':_0x1012e2[_0x449e('0x4c')];this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]][_0x50dcec]['talktime']=_0x1012e2['talktime'];if(this[_0x449e('0x9')][_0x1012e2[_0x449e('0x25')]]&&this[_0x449e('0x9')][_0x1012e2['queue']][_0x449e('0x60')]){this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]][_0x50dcec]['acwtime']=this[_0x449e('0x9')][_0x1012e2[_0x449e('0x25')]][_0x449e('0x61')];this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]][_0x50dcec][_0x449e('0x62')]=!![];}this[_0x449e('0xa')][_0x1012e2['interface']]=_[_0x449e('0x2a')](this[_0x449e('0xa')][_0x1012e2[_0x449e('0x63')]],[_0x449e('0x25'),'destconnectedlinenum']);logger[_0x449e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x1012e2['uniqueid'],util[_0x449e('0x2f')](this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]][_0x50dcec],{'showHidden':![],'depth':null}));ami[_0x449e('0x1c')](_0x449e('0x64'),this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]][_0x50dcec]);logger[_0x449e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x1012e2[_0x449e('0x1f')],util[_0x449e('0x2f')](this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]][_0x50dcec],{'showHidden':![],'depth':null}));this['emit'](util[_0x449e('0x23')](_0x449e('0x30'),_0x1012e2[_0x449e('0x31')]),_0x449e('0x65'),this[_0x449e('0x8')][_0x1012e2[_0x449e('0x1f')]][_0x50dcec]);}}}}}}catch(_0x3796b3){logger['error'](_0x449e('0x66'),_0x1012e2['uniqueid'],util['inspect'](_0x3796b3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x449e('0x1b')][_0x449e('0x13')]=function(_0x4e3b4c){try{if(this[_0x449e('0x1d')](_0x4e3b4c)){logger[_0x449e('0x20')](_0x449e('0x67'),_0x4e3b4c[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x4e3b4c,{'showHidden':![],'depth':null}));this[_0x449e('0x68')](_0x4e3b4c[_0x449e('0x1f')],_['keys'](_0x4e3b4c['variable'])[0x0],_0x4e3b4c['value']);if(this[_0x449e('0x8')][_0x4e3b4c['uniqueid']]){for(var _0x21f9a4 in this[_0x449e('0x8')][_0x4e3b4c[_0x449e('0x1f')]]){if(this[_0x449e('0x8')][_0x4e3b4c[_0x449e('0x1f')]][_0x449e('0x36')](_0x21f9a4)){logger[_0x449e('0x46')](_0x449e('0x69'),_0x4e3b4c[_0x449e('0x1f')],_0x21f9a4,_[_0x449e('0x6a')](_0x4e3b4c['variable'])[0x0],_0x4e3b4c[_0x449e('0x6b')]);if(_[_0x449e('0x21')](this[_0x449e('0x8')][_0x4e3b4c[_0x449e('0x1f')]][_0x21f9a4][_0x449e('0x28')])){this[_0x449e('0x8')][_0x4e3b4c[_0x449e('0x1f')]][_0x21f9a4][_0x449e('0x28')]={};}this[_0x449e('0x8')][_0x4e3b4c[_0x449e('0x1f')]][_0x21f9a4]['variables']=this['variables'][_0x4e3b4c['uniqueid']];}}}}}catch(_0x5955eb){logger[_0x449e('0x33')](_0x449e('0x6c'),_0x4e3b4c['uniqueid'],util['inspect'](_0x5955eb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x449e('0x1b')]['addVariable']=function(_0x2c3d14,_0x2d48d5,_0x2f1bda){var _0xd7b616=[_0x449e('0x6d'),_0x449e('0x6e'),'rtpaudioqosjitter',_0x449e('0x6f'),_0x449e('0x70'),_0x449e('0x71'),_0x449e('0x72'),_0x449e('0x73'),'sipcallid',_0x449e('0x74'),_0x449e('0x75'),_0x449e('0x76'),_0x449e('0x77'),_0x449e('0x78'),_0x449e('0x79'),_0x449e('0x7a'),'membername',_0x449e('0x7b'),_0x449e('0x7c')];if(!_[_0x449e('0x7d')](_0x2d48d5)&&!_[_0x449e('0x7e')](_0xd7b616,_0x2d48d5)){if(_['isUndefined'](this[_0x449e('0x28')][_0x2c3d14])){this[_0x449e('0x28')][_0x2c3d14]={};}this['variables'][_0x2c3d14][_0x2d48d5]=_0x2f1bda;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x1ba23e){try{if(this[_0x449e('0x1d')](_0x1ba23e)){logger[_0x449e('0x20')](_0x449e('0x7f'),_0x1ba23e['uniqueid'],util['inspect'](_0x1ba23e,{'showHidden':![],'depth':null}));if(this['channels'][_0x1ba23e[_0x449e('0x1f')]]){for(var _0x53ffb7 in this[_0x449e('0x8')][_0x1ba23e[_0x449e('0x1f')]]){if(this[_0x449e('0x8')][_0x1ba23e['uniqueid']][_0x449e('0x36')](_0x53ffb7)){if(this['channels'][_0x1ba23e['uniqueid']][_0x53ffb7][_0x449e('0x4c')]==_0x449e('0x5f')&&this['channels'][_0x1ba23e[_0x449e('0x1f')]][_0x53ffb7][_0x449e('0x45')]){logger[_0x449e('0x46')](_0x449e('0x80'),_0x1ba23e[_0x449e('0x1f')],_0x53ffb7);this['channels'][_0x1ba23e[_0x449e('0x1f')]][_0x53ffb7][_0x449e('0x81')]=moment()['format'](_0x449e('0x24'));}}}logger[_0x449e('0x20')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x1ba23e[_0x449e('0x1f')],util[_0x449e('0x2f')](_[_0x449e('0x82')](this['channels'][_0x1ba23e[_0x449e('0x1f')]]),{'showHidden':![],'depth':null}));ami[_0x449e('0x1c')](_0x449e('0x83'),_['values'](this['channels'][_0x1ba23e[_0x449e('0x1f')]]));delete this['channels'][_0x1ba23e[_0x449e('0x1f')]];}if(this['variables'][_0x1ba23e[_0x449e('0x1f')]]){delete this[_0x449e('0x28')][_0x1ba23e[_0x449e('0x1f')]];}}}catch(_0x233622){logger[_0x449e('0x33')](_0x449e('0x84'),_0x1ba23e[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x233622,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x449e('0x1b')][_0x449e('0x1a')]=function(_0x538a13){try{if(this[_0x449e('0x1d')](_0x538a13)){logger[_0x449e('0x20')](_0x449e('0x85'),_0x538a13[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x538a13,{'showHidden':![],'depth':null}));if(this[_0x449e('0x8')][_0x538a13[_0x449e('0x86')]]){for(var _0x33d71a in this[_0x449e('0x8')][_0x538a13[_0x449e('0x86')]]){if(this[_0x449e('0x8')][_0x538a13['transfereeuniqueid']][_0x449e('0x36')](_0x33d71a)){if(_0x538a13[_0x449e('0x87')]===_0x33d71a){logger[_0x449e('0x46')](_0x449e('0x88'),_0x538a13[_0x449e('0x1f')],this[_0x449e('0x8')][_0x538a13[_0x449e('0x86')]][_0x33d71a]['membername'],_0x33d71a);var _0x31fb89=moment();this[_0x449e('0x8')][_0x538a13[_0x449e('0x86')]][_0x33d71a][_0x449e('0x45')]=!![];this[_0x449e('0x8')][_0x538a13[_0x449e('0x86')]][_0x33d71a][_0x449e('0x81')]=moment()[_0x449e('0x23')](_0x449e('0x24'));this[_0x449e('0x8')][_0x538a13['transfereeuniqueid']][_0x33d71a][_0x449e('0x3d')]=_0x449e('0x5e');this[_0x449e('0x8')][_0x538a13['transfereeuniqueid']][_0x33d71a][_0x449e('0x4c')]=_0x449e('0x5f');this[_0x449e('0x8')][_0x538a13[_0x449e('0x86')]][_0x33d71a]['talktime']=_0x31fb89[_0x449e('0x89')](this['channels'][_0x538a13[_0x449e('0x86')]][_0x33d71a][_0x449e('0x5c')],'seconds');}}}}if(this[_0x449e('0x8')][_0x538a13['secondtransfereruniqueid']]){var _0x4077aa=this['channels'][_0x538a13[_0x449e('0x8a')]];this[_0x449e('0x8')][_0x538a13[_0x449e('0x8a')]]=this['channels'][_0x538a13[_0x449e('0x86')]];this['channels'][_0x538a13[_0x449e('0x86')]]=_0x4077aa;}}}catch(_0x16c915){logger['error']('[%s][voiceAgentReport][attendedtransfer]',_0x538a13[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x16c915,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x449e('0x1b')][_0x449e('0x8b')]=function(_0x4bcf83){try{if(this[_0x449e('0x1d')](_0x4bcf83)){logger[_0x449e('0x20')](_0x449e('0x8c'),_0x4bcf83[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x4bcf83,{'showHidden':![],'depth':null}));if(this[_0x449e('0x8')][_0x4bcf83['transfereeuniqueid']]){for(var _0x3ab24d in this['channels'][_0x4bcf83[_0x449e('0x86')]]){if(this[_0x449e('0x8')][_0x4bcf83[_0x449e('0x86')]]['hasOwnProperty'](_0x3ab24d)){if(_0x4bcf83[_0x449e('0x8d')]===_0x3ab24d){logger['info']('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4bcf83[_0x449e('0x1f')],this['channels'][_0x4bcf83[_0x449e('0x86')]][_0x3ab24d][_0x449e('0x31')],_0x3ab24d);var _0x10c4be=moment();this[_0x449e('0x8')][_0x4bcf83[_0x449e('0x86')]][_0x3ab24d][_0x449e('0x45')]=!![];this[_0x449e('0x8')][_0x4bcf83[_0x449e('0x86')]][_0x3ab24d][_0x449e('0x81')]=_0x10c4be;this[_0x449e('0x8')][_0x4bcf83[_0x449e('0x86')]][_0x3ab24d][_0x449e('0x3d')]=_0x449e('0x5e');this[_0x449e('0x8')][_0x4bcf83[_0x449e('0x86')]][_0x3ab24d][_0x449e('0x4c')]=_0x449e('0x5f');this[_0x449e('0x8')][_0x4bcf83[_0x449e('0x86')]][_0x3ab24d][_0x449e('0x8e')]=_0x10c4be[_0x449e('0x89')](this['channels'][_0x4bcf83[_0x449e('0x86')]][_0x3ab24d][_0x449e('0x5c')],_0x449e('0x8f'));}}}}}}catch(_0x4ec47f){logger[_0x449e('0x33')](_0x449e('0x90'),_0x4bcf83['uniqueid'],util[_0x449e('0x2f')](_0x4ec47f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x449e('0x1b')][_0x449e('0x91')]=function(_0x14ef1e){var _0x3d5b25='';try{if(this[_0x449e('0x1d')](_0x14ef1e)){logger[_0x449e('0x20')](_0x449e('0x92'),_0x14ef1e[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x14ef1e,{'showHidden':![],'depth':null}));if(_0x14ef1e['channel']){_0x3d5b25=_0x14ef1e['channel'][_0x449e('0x93')](0x0,_0x14ef1e[_0x449e('0x94')][_0x449e('0x95')]('-'));if(this[_0x449e('0xa')][_0x3d5b25]){logger['info'](_0x449e('0x96'),_0x14ef1e['uniqueid'],_0x3d5b25);this[_0x449e('0xa')][_0x3d5b25][_0x449e('0x97')]=!![];}}}}catch(_0x42ab74){logger['error'](_0x449e('0x98'),_0x14ef1e[_0x449e('0x1f')],util['inspect'](_0x42ab74,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x449e('0x1b')]['syncMusicOnHoldStop']=function(_0x461fd7){var _0x13f7c9='';try{if(this[_0x449e('0x1d')](_0x461fd7)){logger[_0x449e('0x20')](_0x449e('0x99'),_0x461fd7[_0x449e('0x1f')],util[_0x449e('0x2f')](_0x461fd7,{'showHidden':![],'depth':null}));if(_0x461fd7[_0x449e('0x94')]){_0x13f7c9=_0x461fd7[_0x449e('0x94')][_0x449e('0x93')](0x0,_0x461fd7[_0x449e('0x94')][_0x449e('0x95')]('-'));if(this[_0x449e('0xa')][_0x13f7c9]){logger['info'](_0x449e('0x9a'),_0x461fd7[_0x449e('0x1f')],_0x13f7c9);this['agents'][_0x13f7c9][_0x449e('0x97')]=![];}}}}catch(_0x31e8ac){logger[_0x449e('0x33')]('[%s][voiceAgentReport][musiconholdstop]',_0x461fd7[_0x449e('0x1f')],util['inspect'](_0x31e8ac,{'showHidden':![],'depth':null}));}};module[_0x449e('0x9b')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 5755a91..1f96e2d 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x752c=['undefined','isEmpty','getSettings','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','destinationchannel','catch','finally','webbar:stopmonitors','event','blindTransfers','type','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','BlindTransfer','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','invalid','unavailable','ringing','ringinuse','agi','dial','playback','NO\x20ANSWER','FAILED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','coreshowchannel','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','syncNewState','hangup','syncHangup','syncNewCallerId','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','emit','uniqueid','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','merge','pick','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','keys','agents','split','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','name','user:agentconnect','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','appdata','starttime','duration','subtract','seconds','format','includes','lastapplication','lastdata','startsWith','cdr(','queue','[%s][voiceCallReport][newexten]','calleridnum','answered','answertime','xcally-motion-preview','connectedlinenum','connectedlinename','channelstate','UserId','membername','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','monitorFilename','find','monitors','isNil','rec','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','value','syncMixMonitorFilename','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-destination','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','diff','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','then','transferType'];(function(_0x4d201f,_0x56b30d){var _0x2556a8=function(_0x4ec9d9){while(--_0x4ec9d9){_0x4d201f['push'](_0x4d201f['shift']());}};_0x2556a8(++_0x56b30d);}(_0x752c,0xea));var _0xc752=function(_0x51ae54,_0x346bc3){_0x51ae54=_0x51ae54-0x0;var _0x16e760=_0x752c[_0x51ae54];return _0x16e760;};'use strict';var BPromise=require(_0xc752('0x0'));var _=require('lodash');var moment=require(_0xc752('0x1'));var util=require(_0xc752('0x2'));var path=require(_0xc752('0x3'));var Redis=require(_0xc752('0x4'));var config=require(_0xc752('0x5'));var logger=require(_0xc752('0x6'))(_0xc752('0x7'));var ami=require(_0xc752('0x8'));var Channel=require(_0xc752('0x9'));var RpcSetting=require(_0xc752('0xa'));var statusDesc=[_0xc752('0xb'),_0xc752('0xc'),'inuse','busy',_0xc752('0xd'),_0xc752('0xe'),_0xc752('0xf'),_0xc752('0x10'),'onhold'];var applications=['set','queue',_0xc752('0x11'),_0xc752('0x12'),_0xc752('0x13'),'voicemail'];var dispositions=[_0xc752('0x14'),_0xc752('0x15'),_0xc752('0x15'),_0xc752('0x14'),_0xc752('0x14'),'NO\x20ANSWER','ANSWERED',_0xc752('0x16'),_0xc752('0x15'),_0xc752('0x15'),_0xc752('0x15')];var actions={};config[_0xc752('0x17')]=_[_0xc752('0x18')](config[_0xc752('0x17')],{'host':_0xc752('0x19'),'port':0x18eb});var io=require(_0xc752('0x1a'))(new Redis(config[_0xc752('0x17')]));function VoiceCallReport(_0x4f8d71){this['channels']=_0x4f8d71[_0xc752('0x1b')];this['agents']=_0x4f8d71['agents'];this['blindTransfers']={};ami['on'](_0xc752('0x1c'),this[_0xc752('0x1d')]['bind'](this));ami['on'](_0xc752('0x1e'),this[_0xc752('0x1d')][_0xc752('0x1f')](this));ami['on'](_0xc752('0x20'),this[_0xc752('0x21')][_0xc752('0x1f')](this));ami['on'](_0xc752('0x22'),this[_0xc752('0x23')][_0xc752('0x1f')](this));ami['on']('varset',this['syncVarSet'][_0xc752('0x1f')](this));ami['on'](_0xc752('0x24'),this[_0xc752('0x25')][_0xc752('0x1f')](this));ami['on']('newcallerid',this[_0xc752('0x26')]['bind'](this));ami['on']('attendedtransfer',this[_0xc752('0x27')][_0xc752('0x1f')](this));ami['on']('blindtransfer',this[_0xc752('0x28')]['bind'](this));ami['on'](_0xc752('0x29'),this[_0xc752('0x2a')][_0xc752('0x1f')](this));ami['on']('musiconholdstop',this[_0xc752('0x2b')][_0xc752('0x1f')](this));try{logger[_0xc752('0x2c')]('[voiceCallReport][coreshowchannels]\x20started');ami['actionCoreShowChannels']();}catch(_0x246df2){logger[_0xc752('0x2d')](_0xc752('0x2e'),util[_0xc752('0x2f')](_0x246df2,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xc752('0x30')][_0xc752('0x31')]=function(_0x580277){return _0x580277!==null&&!_['isUndefined'](_0x580277);};VoiceCallReport['prototype'][_0xc752('0x32')]=function(_0x5147d9,_0x1402e2,_0xe9ab20){io['to'](_0x5147d9)[_0xc752('0x32')](_0x1402e2,_0xe9ab20);};VoiceCallReport[_0xc752('0x30')][_0xc752('0x26')]=function(_0x2d582d){try{if(this[_0xc752('0x31')](_0x2d582d)){logger[_0xc752('0x2c')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x2d582d[_0xc752('0x33')],_0x2d582d['calleridname'],_0x2d582d['calleridnum']);logger['debug'](_0xc752('0x34'),_0x2d582d[_0xc752('0x33')],util['inspect'](_0x2d582d,{'showHidden':![],'depth':null}));if(_0x2d582d['uniqueid']===_0x2d582d[_0xc752('0x35')]){if(!_[_0xc752('0x36')](this[_0xc752('0x1b')][_0x2d582d[_0xc752('0x33')]])){_[_0xc752('0x37')](this[_0xc752('0x1b')][_0x2d582d[_0xc752('0x33')]],_[_0xc752('0x38')](_0x2d582d,_['keys'](this[_0xc752('0x1b')][_0x2d582d[_0xc752('0x33')]])));}}}}catch(_0x4bb694){logger[_0xc752('0x2d')](_0xc752('0x39'),_0x2d582d[_0xc752('0x33')],util['inspect'](_0x4bb694,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc752('0x30')][_0xc752('0x21')]=function(_0x22f50f){try{if(this[_0xc752('0x31')](_0x22f50f)){logger[_0xc752('0x3a')](_0xc752('0x3b'),_0x22f50f['uniqueid'],util[_0xc752('0x2f')](_0x22f50f,{'showHidden':![],'depth':null}));if(_0x22f50f['uniqueid']===_0x22f50f[_0xc752('0x35')]&&_0x22f50f[_0xc752('0x3c')]!=_0xc752('0x3d')){if(_['isUndefined'](this[_0xc752('0x1b')][_0x22f50f[_0xc752('0x33')]])){logger[_0xc752('0x2c')](_0xc752('0x3e'),_0x22f50f[_0xc752('0x33')],_0x22f50f[_0xc752('0x3f')],_0x22f50f[_0xc752('0x40')]);this[_0xc752('0x1b')][_0x22f50f['uniqueid']]=new Channel();this[_0xc752('0x1b')][_0x22f50f[_0xc752('0x33')]]['starttime']=moment()['format'](_0xc752('0x41'));this[_0xc752('0x1b')][_0x22f50f[_0xc752('0x33')]][_0xc752('0x42')]=dispositions[_[_0xc752('0x43')](_0x22f50f['channelstate'])];_[_0xc752('0x37')](this[_0xc752('0x1b')][_0x22f50f[_0xc752('0x33')]],_[_0xc752('0x38')](_0x22f50f,_[_0xc752('0x44')](this[_0xc752('0x1b')][_0x22f50f['uniqueid']])));if(_0x22f50f[_0xc752('0x3f')]==='from-sip'){if(this[_0xc752('0x45')][_0x22f50f[_0xc752('0x3c')][_0xc752('0x46')]('-')[0x0]]){this[_0xc752('0x45')][_0x22f50f['channel'][_0xc752('0x46')]('-')[0x0]][_0xc752('0x47')]=_0x22f50f['exten'];logger[_0xc752('0x3a')](_0xc752('0x48'),_0x22f50f[_0xc752('0x33')],util[_0xc752('0x2f')]({'destaccountcode':this['agents'][_0x22f50f['channel'][_0xc752('0x46')]('-')[0x0]][_0xc752('0x49')],'destconnectedlinenum':_0x22f50f[_0xc752('0x40')]},{'showHidden':![],'depth':null}));this[_0xc752('0x32')](util['format'](_0xc752('0x4a'),this[_0xc752('0x45')][_0x22f50f[_0xc752('0x3c')]['split']('-')[0x0]][_0xc752('0x4b')]),_0xc752('0x4c'),{'destaccountcode':this[_0xc752('0x45')][_0x22f50f['channel'][_0xc752('0x46')]('-')[0x0]][_0xc752('0x49')],'destconnectedlinenum':_0x22f50f['exten']});}}}}}}catch(_0x14f70a){logger['error'](_0xc752('0x4d'),_0x22f50f[_0xc752('0x33')],util[_0xc752('0x2f')](_0x14f70a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc752('0x30')]['syncNewExten']=function(_0x241148){try{if(this[_0xc752('0x31')](_0x241148)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0x241148[_0xc752('0x33')],util[_0xc752('0x2f')](_0x241148,{'showHidden':![],'depth':null}));if(_0x241148[_0xc752('0x33')]===_0x241148[_0xc752('0x35')]&&_0x241148[_0xc752('0x40')]!='h'&&_0x241148[_0xc752('0x3c')]!='OutgoingSpoolFailed'){_0x241148[_0xc752('0x4e')]=_0x241148[_0xc752('0x4e')][_0xc752('0x4f')]();_0x241148[_0xc752('0x50')]=(_0x241148[_0xc752('0x51')]||_0x241148[_0xc752('0x50')])['toLowerCase']();logger[_0xc752('0x2c')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x241148[_0xc752('0x33')],_0x241148[_0xc752('0x4e')],_0x241148[_0xc752('0x50')]);if(_[_0xc752('0x36')](this['channels'][_0x241148['uniqueid']])){this[_0xc752('0x1b')][_0x241148[_0xc752('0x33')]]=new Channel();this[_0xc752('0x1b')][_0x241148[_0xc752('0x33')]][_0xc752('0x52')]=_0x241148[_0xc752('0x53')]?moment()[_0xc752('0x54')](moment['duration'](_0x241148[_0xc752('0x53')])['seconds'](),_0xc752('0x55'))[_0xc752('0x56')](_0xc752('0x41')):moment()[_0xc752('0x56')](_0xc752('0x41'));this[_0xc752('0x1b')][_0x241148[_0xc752('0x33')]]['disposition']=_0xc752('0x14');}_[_0xc752('0x37')](this[_0xc752('0x1b')][_0x241148[_0xc752('0x33')]],_[_0xc752('0x38')](_0x241148,_['keys'](this[_0xc752('0x1b')][_0x241148[_0xc752('0x33')]])));if(_[_0xc752('0x57')](applications,_0x241148['application'])){this[_0xc752('0x1b')][_0x241148[_0xc752('0x33')]][_0xc752('0x58')]=_0x241148[_0xc752('0x4e')];this['channels'][_0x241148[_0xc752('0x33')]][_0xc752('0x59')]=_0x241148[_0xc752('0x50')];if(_0x241148[_0xc752('0x4e')]==='set'&&_[_0xc752('0x5a')](_0x241148[_0xc752('0x50')],_0xc752('0x5b'))){var _0x45ec3c=_0x241148[_0xc752('0x50')][_0xc752('0x46')]('=');var _0x22efab=_0x45ec3c[0x0]['match'](/cdr\((.*)\)/);if(_0x22efab){this[_0xc752('0x1b')][_0x241148[_0xc752('0x33')]][_0x22efab[0x1]]=_0x45ec3c[0x1];}}else if(_0x241148[_0xc752('0x4e')]===_0xc752('0x5c')){this[_0xc752('0x1b')][_0x241148[_0xc752('0x33')]]['queue']=_0x241148['applicationdata']['split'](',')[0x0];}}}}}catch(_0x4a2447){logger['error'](_0xc752('0x5d'),_0x241148['uniqueid'],util[_0xc752('0x2f')](_0x4a2447,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc752('0x30')][_0xc752('0x23')]=function(_0x1a509a){try{if(this['isNotNull'](_0x1a509a)){logger[_0xc752('0x2c')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x1a509a[_0xc752('0x33')],_0x1a509a[_0xc752('0x35')],_0x1a509a['calleridname'],_0x1a509a[_0xc752('0x5e')]);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x1a509a[_0xc752('0x33')],util[_0xc752('0x2f')](_0x1a509a,{'showHidden':![],'depth':null}));if(_0x1a509a[_0xc752('0x33')]!==_0x1a509a[_0xc752('0x35')]){if(this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x35')]]){if(_0x1a509a['channelstate']==='6'){if(!this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x35')]][_0xc752('0x5f')]){var _0x50e745=moment();this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x35')]][_0xc752('0x5f')]=!![];this[_0xc752('0x1b')][_0x1a509a['linkedid']][_0xc752('0x60')]=_0x50e745[_0xc752('0x56')](_0xc752('0x41'));if(this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x35')]][_0xc752('0x52')]){this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x35')]]['holdtime']=_0x50e745['diff'](this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x35')]][_0xc752('0x52')],'seconds');}}this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x35')]][_0xc752('0x35')]=_0x1a509a[_0xc752('0x33')];if(_0x1a509a[_0xc752('0x5e')]!==_0xc752('0x61')){this[_0xc752('0x1b')][_0x1a509a['linkedid']][_0xc752('0x62')]=_0x1a509a['calleridnum'];}this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x35')]][_0xc752('0x63')]=_0x1a509a['calleridname'];this[_0xc752('0x1b')][_0x1a509a['linkedid']]['destinationchannel']=_0x1a509a['channel'];this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x35')]][_0xc752('0x42')]=dispositions[_[_0xc752('0x43')](_0x1a509a[_0xc752('0x64')])];if(this[_0xc752('0x45')][_0x1a509a[_0xc752('0x3c')][_0xc752('0x46')]('-')[0x0]]){this['channels'][_0x1a509a[_0xc752('0x35')]]['UserId']=this[_0xc752('0x45')][_0x1a509a['channel'][_0xc752('0x46')]('-')[0x0]]['id'];this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x35')]]['membername']=this[_0xc752('0x45')][_0x1a509a[_0xc752('0x3c')][_0xc752('0x46')]('-')[0x0]][_0xc752('0x4b')];}}}}else{if(this['channels'][_0x1a509a['uniqueid']]){if(_0x1a509a[_0xc752('0x64')]==='6'){if(this[_0xc752('0x45')][_0x1a509a[_0xc752('0x3c')]['split']('-')[0x0]]){this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x33')]][_0xc752('0x65')]=this['agents'][_0x1a509a['channel'][_0xc752('0x46')]('-')[0x0]]['id'];this[_0xc752('0x1b')][_0x1a509a[_0xc752('0x33')]][_0xc752('0x66')]=this[_0xc752('0x45')][_0x1a509a['channel'][_0xc752('0x46')]('-')[0x0]][_0xc752('0x4b')];}}}}}}catch(_0x5b5a4e){logger['error'](_0xc752('0x67'),_0x1a509a['uniqueid'],util['inspect'](_0x5b5a4e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc752('0x30')]['syncMixMonitorFilename']=function(_0x375048,_0x5db799){try{if(this['channels'][_0x375048]){logger[_0xc752('0x2c')](_0xc752('0x68'),_0x375048,_0x5db799);this[_0xc752('0x1b')][_0x375048][_0xc752('0x69')]=!![];if(_['endsWith'](_0x5db799,'.wav49')){_0x5db799=_0x5db799['replace'](_0xc752('0x6a'),'.WAV');}this[_0xc752('0x1b')][_0x375048][_0xc752('0x6b')]=_0x5db799;var _0xca80e3=_[_0xc752('0x6c')](this[_0xc752('0x1b')][_0x375048][_0xc752('0x6d')],{'filename':_0x5db799});if(_[_0xc752('0x6e')](_0xca80e3)){this[_0xc752('0x1b')][_0x375048]['monitors']['push']({'filename':_0x5db799,'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xc752('0x6f')});}}}catch(_0x1684e5){logger[_0xc752('0x2d')]('[%s][voiceCallReport][mixMonitorFilename]',_0x375048,util[_0xc752('0x2f')](_0x1684e5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc752('0x70')]=function(_0x5c7394){try{if(this[_0xc752('0x31')](_0x5c7394)){logger['debug'](_0xc752('0x71'),_0x5c7394[_0xc752('0x33')],util[_0xc752('0x2f')](_0x5c7394,{'showHidden':![],'depth':null}));if(this[_0xc752('0x1b')][_0x5c7394[_0xc752('0x33')]]&&_0x5c7394[_0xc752('0x3c')]!=_0xc752('0x3d')){if(this[_0xc752('0x31')](_0x5c7394[_0xc752('0x72')])){if(this['isNotNull'](_0x5c7394[_0xc752('0x72')][_0xc752('0x73')])){logger[_0xc752('0x2c')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x5c7394[_0xc752('0x33')],_0x5c7394[_0xc752('0x74')]);this[_0xc752('0x75')](_0x5c7394[_0xc752('0x33')],_0x5c7394[_0xc752('0x74')]);}else if(this[_0xc752('0x31')](_0x5c7394[_0xc752('0x72')]['xmd-phone'])){logger[_0xc752('0x2c')](_0xc752('0x76'),_0x5c7394[_0xc752('0x33')],_0x5c7394[_0xc752('0x74')]);this[_0xc752('0x1b')][_0x5c7394[_0xc752('0x33')]][_0xc752('0x5e')]=_0x5c7394[_0xc752('0x74')];}else if(this[_0xc752('0x31')](_0x5c7394[_0xc752('0x72')][_0xc752('0x77')])){logger['info'](_0xc752('0x78'),_0x5c7394['uniqueid'],_0x5c7394[_0xc752('0x74')]);this[_0xc752('0x1b')][_0x5c7394[_0xc752('0x33')]][_0xc752('0x79')]=_0x5c7394[_0xc752('0x74')];}else if(this['isNotNull'](_0x5c7394[_0xc752('0x72')][_0xc752('0x7a')])){logger[_0xc752('0x2c')](_0xc752('0x7b'),_0x5c7394[_0xc752('0x33')],_0x5c7394[_0xc752('0x74')]);this[_0xc752('0x1b')][_0x5c7394[_0xc752('0x33')]]['type']=_0x5c7394[_0xc752('0x74')];}else if(this[_0xc752('0x31')](_0x5c7394[_0xc752('0x72')]['xmd-queue'])){logger[_0xc752('0x2c')](_0xc752('0x7c'),_0x5c7394['uniqueid'],_0x5c7394[_0xc752('0x74')][_0xc752('0x46')](',')[0x0]);this[_0xc752('0x1b')][_0x5c7394[_0xc752('0x33')]][_0xc752('0x5c')]=_0x5c7394[_0xc752('0x74')][_0xc752('0x46')](',')[0x0];}else if(this[_0xc752('0x31')](_0x5c7394[_0xc752('0x72')]['xmd-originatecalleridnum'])){logger[_0xc752('0x2c')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x5c7394[_0xc752('0x33')],_0x5c7394['value']);this[_0xc752('0x1b')][_0x5c7394[_0xc752('0x33')]]['originatecalleridnum']=_0x5c7394[_0xc752('0x74')];}else if(this[_0xc752('0x31')](_0x5c7394[_0xc752('0x72')][_0xc752('0x7d')])){logger[_0xc752('0x2c')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x5c7394[_0xc752('0x33')],_0x5c7394[_0xc752('0x74')]);this['channels'][_0x5c7394[_0xc752('0x33')]]['destination']=_0x5c7394[_0xc752('0x74')];}else if(this[_0xc752('0x31')](_0x5c7394[_0xc752('0x72')]['xmd-callerid-preview'])){logger[_0xc752('0x2c')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x5c7394[_0xc752('0x33')],_0x5c7394['value']);this['channels'][_0x5c7394[_0xc752('0x33')]][_0xc752('0x7e')]=_0x5c7394[_0xc752('0x74')];}else if(this[_0xc752('0x31')](_0x5c7394[_0xc752('0x72')][_0xc752('0x7f')])){logger[_0xc752('0x2c')](_0xc752('0x80'),_0x5c7394[_0xc752('0x33')],_0x5c7394['value']);this[_0xc752('0x1b')][_0x5c7394[_0xc752('0x33')]][_0xc752('0x5c')]=_0x5c7394[_0xc752('0x74')];}else if(this[_0xc752('0x31')](_0x5c7394['variable'][_0xc752('0x81')])){logger[_0xc752('0x2c')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x5c7394[_0xc752('0x33')],_0x5c7394[_0xc752('0x74')]);this['channels'][_0x5c7394[_0xc752('0x33')]][_0xc752('0x82')]=_0x5c7394[_0xc752('0x74')];}}}else if(this['isNotNull'](_0x5c7394['variable']['mixmonitor_filename'])){if(_0x5c7394[_0xc752('0x74')]){var _0x1f4511=path['parse'](_0x5c7394[_0xc752('0x74')])['name'];logger[_0xc752('0x2c')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x1f4511,_0x5c7394['value']);this['syncMixMonitorFilename'](_0x1f4511,_0x5c7394[_0xc752('0x74')]);}}else if(this['channels'][_0x5c7394[_0xc752('0x35')]]){if(this[_0xc752('0x31')](_0x5c7394[_0xc752('0x72')])){if(this[_0xc752('0x31')](_0x5c7394[_0xc752('0x72')][_0xc752('0x81')])){logger[_0xc752('0x2c')](_0xc752('0x83'),_0x5c7394[_0xc752('0x35')],_0x5c7394['value']);this[_0xc752('0x1b')][_0x5c7394['linkedid']][_0xc752('0x84')]=_0x5c7394[_0xc752('0x74')];}}}}}catch(_0x1e25c2){logger[_0xc752('0x2d')]('[%s][voiceCallReport][varset]',_0x5c7394[_0xc752('0x33')],util[_0xc752('0x2f')](_0x1e25c2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc752('0x30')][_0xc752('0x25')]=function(_0x54d377){try{if(this[_0xc752('0x31')](_0x54d377)){logger[_0xc752('0x3a')](_0xc752('0x85'),_0x54d377[_0xc752('0x33')],util[_0xc752('0x2f')](_0x54d377,{'showHidden':![],'depth':null}));if(this[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]]){logger[_0xc752('0x2c')](_0xc752('0x86'),_0x54d377[_0xc752('0x33')],_0x54d377[_0xc752('0x87')]);var _0x56e8f1=moment();this[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]][_0xc752('0x88')]=_0x56e8f1[_0xc752('0x56')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]][_0xc752('0x53')]=_0x56e8f1[_0xc752('0x89')](this[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]]['starttime'],_0xc752('0x55'));if(this[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]][_0xc752('0x5f')]){this['channels'][_0x54d377['uniqueid']][_0xc752('0x8a')]=_0x56e8f1[_0xc752('0x89')](this[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]][_0xc752('0x60')],_0xc752('0x55'));this['channels'][_0x54d377[_0xc752('0x33')]]['holdtime']=this['channels'][_0x54d377[_0xc752('0x33')]][_0xc752('0x53')]-this[_0xc752('0x1b')][_0x54d377['uniqueid']][_0xc752('0x8a')];}if(_0x54d377['context']==='from-sip'){if(this[_0xc752('0x45')][_0x54d377[_0xc752('0x3c')][_0xc752('0x46')]('-')[0x0]]){this['agents'][_0x54d377[_0xc752('0x3c')]['split']('-')[0x0]]=_[_0xc752('0x8b')](this['agents'][_0x54d377[_0xc752('0x3c')][_0xc752('0x46')]('-')[0x0]],[_0xc752('0x47')]);logger[_0xc752('0x3a')](_0xc752('0x8c'),_0x54d377[_0xc752('0x33')],util[_0xc752('0x2f')]({'destaccountcode':this[_0xc752('0x45')][_0x54d377[_0xc752('0x3c')][_0xc752('0x46')]('-')[0x0]][_0xc752('0x49')]},{'showHidden':![],'depth':null}));this[_0xc752('0x32')](util[_0xc752('0x56')](_0xc752('0x4a'),this[_0xc752('0x45')][_0x54d377['channel'][_0xc752('0x46')]('-')[0x0]][_0xc752('0x4b')]),_0xc752('0x8d'),{'destaccountcode':this[_0xc752('0x45')][_0x54d377['channel'][_0xc752('0x46')]('-')[0x0]][_0xc752('0x49')]});}}var _0x534a15=this;Promise['resolve']()[_0xc752('0x8e')](function(){var _0x299748=_0x534a15['channels'][_0x54d377['uniqueid']];if(typeof _0x299748[_0xc752('0x8f')]===_0xc752('0x90'))return;if(_[_0xc752('0x91')](_0x299748[_0xc752('0x6d')]))return;return RpcSetting[_0xc752('0x92')]()[_0xc752('0x8e')](function(_0x1432fc){if(!_0x1432fc[_0xc752('0x93')])return;return Promise[_0xc752('0x94')]()[_0xc752('0x8e')](function(){return ami[_0xc752('0x95')]({'action':'StopMixMonitor','channel':_0x299748['channel']})['catch'](function(){});})['then'](function(){return ami[_0xc752('0x95')]({'action':_0xc752('0x96'),'channel':_0x299748[_0xc752('0x97')]})[_0xc752('0x98')](function(){})[_0xc752('0x99')](function(){var _0x543e98=_0x534a15[_0xc752('0x45')][_0x299748[_0xc752('0x97')][_0xc752('0x46')]('-')[0x0]];if(!_0x543e98)return;io[_0xc752('0x32')](_0xc752('0x9a'),{'agentId':_0x543e98['id'],'uniqueid':_0x299748[_0xc752('0x33')]});});});});})[_0xc752('0x8e')](function(){if(_0x54d377[_0xc752('0x9b')]==='BlindTransfer'){_0x534a15[_0xc752('0x9c')][_0x54d377[_0xc752('0x33')]]=_0x534a15[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]];}else{if(_0x534a15[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]][_0xc752('0x9d')]==='outbound'&&_0x534a15[_0xc752('0x9c')][_0x54d377[_0xc752('0x33')]]){_0x534a15[_0xc752('0x1b')][_0x54d377['uniqueid']][_0xc752('0x33')]=[_0x534a15['channels'][_0x54d377['uniqueid']][_0xc752('0x35')],_0x534a15[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]][_0xc752('0x35')]=_0x534a15['channels'][_0x54d377[_0xc752('0x33')]][_0xc752('0x33')]][0x0];delete _0x534a15['blindTransfers'][_0x54d377[_0xc752('0x33')]];}}logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x54d377[_0xc752('0x33')],util[_0xc752('0x2f')](_0x534a15[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]],{'showHidden':![],'depth':null}));ami[_0xc752('0x32')](_0xc752('0x9e'),_0x534a15[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]]);delete _0x534a15[_0xc752('0x1b')][_0x54d377[_0xc752('0x33')]];});}}}catch(_0x3db480){logger[_0xc752('0x2d')](_0xc752('0x9f'),_0x54d377[_0xc752('0x33')],util['inspect'](_0x3db480,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc752('0x30')][_0xc752('0x27')]=function(_0x534c8e){try{if(this[_0xc752('0x31')](_0x534c8e)){logger[_0xc752('0x2c')](_0xc752('0xa0'),_0x534c8e['uniqueid'],_0x534c8e['origtransferercalleridnum'],_0x534c8e[_0xc752('0xa1')]);logger[_0xc752('0x3a')](_0xc752('0xa2'),_0x534c8e['uniqueid'],util[_0xc752('0x2f')](_0x534c8e,{'showHidden':![],'depth':null}));if(this[_0xc752('0x1b')][_0x534c8e['transfereeuniqueid']]){this['channels'][_0x534c8e[_0xc752('0xa3')]][_0xc752('0xa4')]=_0x534c8e[_0xc752('0xa5')];this[_0xc752('0x1b')][_0x534c8e['transfereeuniqueid']][_0xc752('0xa6')]=_0x534c8e[_0xc752('0xa1')];if(this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa7')]]){var _0x2cc273=this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa7')]];this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa7')]]=this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa3')]];this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa3')]]=_0x2cc273;}}else if(this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa8')]]){this['channels'][_0x534c8e[_0xc752('0xa8')]][_0xc752('0xa4')]=_0x534c8e[_0xc752('0xa5')];this['channels'][_0x534c8e[_0xc752('0xa8')]][_0xc752('0xa6')]=_0x534c8e[_0xc752('0xa1')];if(this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa9')]]){var _0x2cc273=this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa9')]];this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa9')]]=this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa8')]];this[_0xc752('0x1b')][_0x534c8e['transfertargetuniqueid']]=_0x2cc273;}}if((this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa9')]]||this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xaa')]])&&this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa7')]]){var _0x2e958c=_[_0xc752('0xab')]([this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa9')]],this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xaa')]],this['channels'][_0x534c8e['secondtransfereruniqueid']]],function(_0x55d7f1){return _0x55d7f1&&_0x55d7f1[_0xc752('0x9d')]==='outbound'&&_0x55d7f1['routeid'];});if(_0x2e958c){if(this[_0xc752('0x1b')][_0x534c8e['origtransfereruniqueid']])this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa9')]]['transferType']='ATTENDED';if(this['channels'][_0x534c8e[_0xc752('0xaa')]])this['channels'][_0x534c8e['origtransfererlinkedid']][_0xc752('0x8f')]=_0xc752('0xac');this[_0xc752('0x1b')][_0x534c8e[_0xc752('0xa7')]][_0xc752('0x8f')]=_0xc752('0xac');}}}}catch(_0x200d15){logger[_0xc752('0x2d')](_0xc752('0xad'),_0x534c8e[_0xc752('0x33')],util[_0xc752('0x2f')](_0x200d15,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc752('0x30')][_0xc752('0x28')]=function(_0x275d41){try{if(this[_0xc752('0x31')](_0x275d41)){logger[_0xc752('0x2c')](_0xc752('0xae'),_0x275d41[_0xc752('0x33')],_0x275d41[_0xc752('0xaf')],_0x275d41[_0xc752('0xb0')]);logger[_0xc752('0x3a')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x275d41['uniqueid'],util[_0xc752('0x2f')](_0x275d41,{'showHidden':![],'depth':null}));if(this[_0xc752('0x1b')][_0x275d41['transfereeuniqueid']]){this[_0xc752('0x1b')][_0x275d41[_0xc752('0xa3')]][_0xc752('0xa4')]=_0x275d41[_0xc752('0xaf')];this['channels'][_0x275d41[_0xc752('0xa3')]]['transferconnectedlinenum']=_0x275d41[_0xc752('0xb0')];this[_0xc752('0x1b')][_0x275d41[_0xc752('0xa3')]][_0xc752('0x8f')]=_0xc752('0xb1');this[_0xc752('0x25')]({'event':_0xc752('0xb2'),'uniqueid':_0x275d41[_0xc752('0xa3')],'context':_0x275d41['context'],'channel':_0x275d41[_0xc752('0xb3')]});}else{this[_0xc752('0x1b')][_0x275d41['transfereruniqueid']][_0xc752('0x8f')]=_0xc752('0xb1');}}}catch(_0x42ce20){logger['error'](_0xc752('0xb4'),_0x275d41[_0xc752('0x33')],util[_0xc752('0x2f')](_0x42ce20,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc752('0x30')]['syncMusicOnHoldStart']=function(_0x255a7c){try{if(this['isNotNull'](_0x255a7c)){logger[_0xc752('0x3a')](_0xc752('0xb5'),_0x255a7c[_0xc752('0x33')],util[_0xc752('0x2f')](_0x255a7c,{'showHidden':![],'depth':null}));if(this['channels'][_0x255a7c['uniqueid']]){if(!_[_0xc752('0x6e')](this[_0xc752('0x1b')][_0x255a7c[_0xc752('0x33')]]['answertime'])){this[_0xc752('0x1b')][_0x255a7c['uniqueid']][_0xc752('0xb6')]=moment()['format'](_0xc752('0x41'));logger[_0xc752('0x2c')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x255a7c['uniqueid'],this[_0xc752('0x1b')][_0x255a7c['uniqueid']]['mohstarttime']);}}}}catch(_0x3057e0){logger['error'](_0xc752('0xb7'),_0x255a7c['uniqueid'],util[_0xc752('0x2f')](_0x3057e0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc752('0x2b')]=function(_0x1a7c43){try{if(this[_0xc752('0x31')](_0x1a7c43)){logger[_0xc752('0x3a')](_0xc752('0xb8'),_0x1a7c43[_0xc752('0x33')],util[_0xc752('0x2f')](_0x1a7c43,{'showHidden':![],'depth':null}));if(this[_0xc752('0x1b')][_0x1a7c43[_0xc752('0x33')]]){if(!_[_0xc752('0x6e')](this[_0xc752('0x1b')][_0x1a7c43[_0xc752('0x33')]][_0xc752('0xb6')])){this[_0xc752('0x1b')][_0x1a7c43[_0xc752('0x33')]][_0xc752('0xb9')]+=moment()[_0xc752('0xba')](0x0)[_0xc752('0x89')](this[_0xc752('0x1b')][_0x1a7c43[_0xc752('0x33')]]['mohstarttime'],'seconds');logger[_0xc752('0x2c')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x1a7c43[_0xc752('0x33')],this[_0xc752('0x1b')][_0x1a7c43[_0xc752('0x33')]][_0xc752('0xb9')]);delete this[_0xc752('0x1b')][_0x1a7c43[_0xc752('0x33')]][_0xc752('0xb6')];}}}}catch(_0x28474d){logger[_0xc752('0x2d')](_0xc752('0xbb'),_0x1a7c43['uniqueid'],util[_0xc752('0x2f')](_0x28474d,{'showHidden':![],'depth':null}));}};module[_0xc752('0xbc')]=VoiceCallReport; \ No newline at end of file +var _0x1c75=['destconnectedlinenum','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','resolve','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','destinationchannel','webbar:stopmonitors','event','BlindTransfer','type','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','routeid','ATTENDED','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereruniqueid','BLIND','[%s][voiceCallReport][blindtransfer]','answertime','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','isNil','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../rpc/setting','not_inuse','inuse','busy','ringing','ringinuse','onhold','set','queue','agi','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','syncNewState','varset','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','merge','pick','[%s][voiceCallReport][newchannel]\x20event:','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','keys','from-sip','split','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','lastdata','startsWith','cdr(','match','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','holdtime','diff','connectedlinenum','connectedlinename','UserId','membername','name','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','endsWith','replace','.wav49','.WAV','find','monitors','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','mixmonitor_filename','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds'];(function(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_0x1c75,0xf4));var _0x51c7=function(_0x2a0824,_0x21d97a){_0x2a0824=_0x2a0824-0x0;var _0x1a78f7=_0x1c75[_0x2a0824];return _0x1a78f7;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require('moment');var util=require(_0x51c7('0x0'));var path=require(_0x51c7('0x1'));var Redis=require(_0x51c7('0x2'));var config=require(_0x51c7('0x3'));var logger=require(_0x51c7('0x4'))('ami');var ami=require(_0x51c7('0x5'));var Channel=require('../model/channel');var RpcSetting=require(_0x51c7('0x6'));var statusDesc=['unknown',_0x51c7('0x7'),_0x51c7('0x8'),_0x51c7('0x9'),'invalid','unavailable',_0x51c7('0xa'),_0x51c7('0xb'),_0x51c7('0xc')];var applications=[_0x51c7('0xd'),_0x51c7('0xe'),_0x51c7('0xf'),'dial',_0x51c7('0x10'),_0x51c7('0x11')];var dispositions=[_0x51c7('0x12'),_0x51c7('0x13'),_0x51c7('0x13'),_0x51c7('0x12'),'NO\x20ANSWER',_0x51c7('0x12'),_0x51c7('0x14'),_0x51c7('0x15'),_0x51c7('0x13'),_0x51c7('0x13'),_0x51c7('0x13')];var actions={};config[_0x51c7('0x16')]=_['defaults'](config[_0x51c7('0x16')],{'host':_0x51c7('0x17'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x51c7('0x16')]));function VoiceCallReport(_0x283b53){this[_0x51c7('0x18')]=_0x283b53['channels'];this[_0x51c7('0x19')]=_0x283b53[_0x51c7('0x19')];this[_0x51c7('0x1a')]={};ami['on'](_0x51c7('0x1b'),this[_0x51c7('0x1c')]['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x51c7('0x1d')](this));ami['on'](_0x51c7('0x1e'),this[_0x51c7('0x1f')][_0x51c7('0x1d')](this));ami['on']('newstate',this[_0x51c7('0x20')][_0x51c7('0x1d')](this));ami['on'](_0x51c7('0x21'),this[_0x51c7('0x22')][_0x51c7('0x1d')](this));ami['on']('hangup',this[_0x51c7('0x23')][_0x51c7('0x1d')](this));ami['on'](_0x51c7('0x24'),this[_0x51c7('0x25')][_0x51c7('0x1d')](this));ami['on'](_0x51c7('0x26'),this['syncAttendedTransfer'][_0x51c7('0x1d')](this));ami['on'](_0x51c7('0x27'),this[_0x51c7('0x28')][_0x51c7('0x1d')](this));ami['on'](_0x51c7('0x29'),this[_0x51c7('0x2a')][_0x51c7('0x1d')](this));ami['on'](_0x51c7('0x2b'),this[_0x51c7('0x2c')]['bind'](this));try{logger[_0x51c7('0x2d')](_0x51c7('0x2e'));ami['actionCoreShowChannels']();}catch(_0x512290){logger[_0x51c7('0x2f')](_0x51c7('0x30'),util[_0x51c7('0x31')](_0x512290,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x51c7('0x32')][_0x51c7('0x33')]=function(_0x2dfac6){return _0x2dfac6!==null&&!_[_0x51c7('0x34')](_0x2dfac6);};VoiceCallReport[_0x51c7('0x32')][_0x51c7('0x35')]=function(_0x509913,_0x4efd40,_0x35d329){io['to'](_0x509913)[_0x51c7('0x35')](_0x4efd40,_0x35d329);};VoiceCallReport[_0x51c7('0x32')][_0x51c7('0x25')]=function(_0x4f7481){try{if(this[_0x51c7('0x33')](_0x4f7481)){logger[_0x51c7('0x2d')](_0x51c7('0x36'),_0x4f7481['uniqueid'],_0x4f7481[_0x51c7('0x37')],_0x4f7481['calleridnum']);logger[_0x51c7('0x38')](_0x51c7('0x39'),_0x4f7481[_0x51c7('0x3a')],util[_0x51c7('0x31')](_0x4f7481,{'showHidden':![],'depth':null}));if(_0x4f7481[_0x51c7('0x3a')]===_0x4f7481[_0x51c7('0x3b')]){if(!_['isUndefined'](this[_0x51c7('0x18')][_0x4f7481[_0x51c7('0x3a')]])){_[_0x51c7('0x3c')](this['channels'][_0x4f7481[_0x51c7('0x3a')]],_[_0x51c7('0x3d')](_0x4f7481,_['keys'](this[_0x51c7('0x18')][_0x4f7481['uniqueid']])));}}}}catch(_0x41b3d0){logger[_0x51c7('0x2f')]('[%s][voiceCallReport][newcallerid]',_0x4f7481[_0x51c7('0x3a')],util['inspect'](_0x41b3d0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x51c7('0x32')][_0x51c7('0x1f')]=function(_0x8d6c72){try{if(this[_0x51c7('0x33')](_0x8d6c72)){logger[_0x51c7('0x38')](_0x51c7('0x3e'),_0x8d6c72[_0x51c7('0x3a')],util[_0x51c7('0x31')](_0x8d6c72,{'showHidden':![],'depth':null}));if(_0x8d6c72[_0x51c7('0x3a')]===_0x8d6c72[_0x51c7('0x3b')]&&_0x8d6c72[_0x51c7('0x3f')]!=_0x51c7('0x40')){if(_[_0x51c7('0x34')](this[_0x51c7('0x18')][_0x8d6c72['uniqueid']])){logger['info'](_0x51c7('0x41'),_0x8d6c72[_0x51c7('0x3a')],_0x8d6c72[_0x51c7('0x42')],_0x8d6c72[_0x51c7('0x43')]);this[_0x51c7('0x18')][_0x8d6c72[_0x51c7('0x3a')]]=new Channel();this[_0x51c7('0x18')][_0x8d6c72[_0x51c7('0x3a')]][_0x51c7('0x44')]=moment()[_0x51c7('0x45')](_0x51c7('0x46'));this[_0x51c7('0x18')][_0x8d6c72[_0x51c7('0x3a')]][_0x51c7('0x47')]=dispositions[_[_0x51c7('0x48')](_0x8d6c72[_0x51c7('0x49')])];_['merge'](this[_0x51c7('0x18')][_0x8d6c72[_0x51c7('0x3a')]],_['pick'](_0x8d6c72,_[_0x51c7('0x4a')](this['channels'][_0x8d6c72['uniqueid']])));if(_0x8d6c72[_0x51c7('0x42')]===_0x51c7('0x4b')){if(this[_0x51c7('0x19')][_0x8d6c72[_0x51c7('0x3f')][_0x51c7('0x4c')]('-')[0x0]]){this[_0x51c7('0x19')][_0x8d6c72[_0x51c7('0x3f')][_0x51c7('0x4c')]('-')[0x0]]['destconnectedlinenum']=_0x8d6c72[_0x51c7('0x43')];logger[_0x51c7('0x38')](_0x51c7('0x4d'),_0x8d6c72['uniqueid'],util[_0x51c7('0x31')]({'destaccountcode':this[_0x51c7('0x19')][_0x8d6c72[_0x51c7('0x3f')][_0x51c7('0x4c')]('-')[0x0]][_0x51c7('0x4e')],'destconnectedlinenum':_0x8d6c72[_0x51c7('0x43')]},{'showHidden':![],'depth':null}));this[_0x51c7('0x35')](util['format'](_0x51c7('0x4f'),this[_0x51c7('0x19')][_0x8d6c72[_0x51c7('0x3f')][_0x51c7('0x4c')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x51c7('0x19')][_0x8d6c72['channel'][_0x51c7('0x4c')]('-')[0x0]][_0x51c7('0x4e')],'destconnectedlinenum':_0x8d6c72[_0x51c7('0x43')]});}}}}}}catch(_0x503fe8){logger[_0x51c7('0x2f')](_0x51c7('0x50'),_0x8d6c72[_0x51c7('0x3a')],util[_0x51c7('0x31')](_0x503fe8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x51c7('0x32')]['syncNewExten']=function(_0x1661aa){try{if(this[_0x51c7('0x33')](_0x1661aa)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0x1661aa['uniqueid'],util[_0x51c7('0x31')](_0x1661aa,{'showHidden':![],'depth':null}));if(_0x1661aa[_0x51c7('0x3a')]===_0x1661aa[_0x51c7('0x3b')]&&_0x1661aa['exten']!='h'&&_0x1661aa[_0x51c7('0x3f')]!=_0x51c7('0x40')){_0x1661aa[_0x51c7('0x51')]=_0x1661aa['application'][_0x51c7('0x52')]();_0x1661aa['applicationdata']=(_0x1661aa['appdata']||_0x1661aa[_0x51c7('0x53')])['toLowerCase']();logger[_0x51c7('0x2d')](_0x51c7('0x54'),_0x1661aa['uniqueid'],_0x1661aa[_0x51c7('0x51')],_0x1661aa['applicationdata']);if(_[_0x51c7('0x34')](this[_0x51c7('0x18')][_0x1661aa['uniqueid']])){this[_0x51c7('0x18')][_0x1661aa[_0x51c7('0x3a')]]=new Channel();this[_0x51c7('0x18')][_0x1661aa['uniqueid']][_0x51c7('0x44')]=_0x1661aa[_0x51c7('0x55')]?moment()[_0x51c7('0x56')](moment['duration'](_0x1661aa[_0x51c7('0x55')])[_0x51c7('0x57')](),_0x51c7('0x57'))[_0x51c7('0x45')](_0x51c7('0x46')):moment()['format'](_0x51c7('0x46'));this[_0x51c7('0x18')][_0x1661aa[_0x51c7('0x3a')]][_0x51c7('0x47')]=_0x51c7('0x12');}_[_0x51c7('0x3c')](this[_0x51c7('0x18')][_0x1661aa['uniqueid']],_[_0x51c7('0x3d')](_0x1661aa,_[_0x51c7('0x4a')](this[_0x51c7('0x18')][_0x1661aa['uniqueid']])));if(_[_0x51c7('0x58')](applications,_0x1661aa['application'])){this[_0x51c7('0x18')][_0x1661aa[_0x51c7('0x3a')]][_0x51c7('0x59')]=_0x1661aa['application'];this[_0x51c7('0x18')][_0x1661aa[_0x51c7('0x3a')]][_0x51c7('0x5a')]=_0x1661aa['applicationdata'];if(_0x1661aa[_0x51c7('0x51')]===_0x51c7('0xd')&&_[_0x51c7('0x5b')](_0x1661aa[_0x51c7('0x53')],_0x51c7('0x5c'))){var _0x20b989=_0x1661aa['applicationdata']['split']('=');var _0x569faa=_0x20b989[0x0][_0x51c7('0x5d')](/cdr\((.*)\)/);if(_0x569faa){this[_0x51c7('0x18')][_0x1661aa[_0x51c7('0x3a')]][_0x569faa[0x1]]=_0x20b989[0x1];}}else if(_0x1661aa[_0x51c7('0x51')]===_0x51c7('0xe')){this[_0x51c7('0x18')][_0x1661aa[_0x51c7('0x3a')]][_0x51c7('0xe')]=_0x1661aa[_0x51c7('0x53')][_0x51c7('0x4c')](',')[0x0];}}}}}catch(_0x52f8e4){logger[_0x51c7('0x2f')]('[%s][voiceCallReport][newexten]',_0x1661aa[_0x51c7('0x3a')],util[_0x51c7('0x31')](_0x52f8e4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x51c7('0x32')][_0x51c7('0x20')]=function(_0x5e17e1){try{if(this[_0x51c7('0x33')](_0x5e17e1)){logger[_0x51c7('0x2d')](_0x51c7('0x5e'),_0x5e17e1[_0x51c7('0x3a')],_0x5e17e1['linkedid'],_0x5e17e1[_0x51c7('0x37')],_0x5e17e1[_0x51c7('0x5f')]);logger[_0x51c7('0x38')](_0x51c7('0x60'),_0x5e17e1[_0x51c7('0x3a')],util[_0x51c7('0x31')](_0x5e17e1,{'showHidden':![],'depth':null}));if(_0x5e17e1['uniqueid']!==_0x5e17e1['linkedid']){if(this[_0x51c7('0x18')][_0x5e17e1[_0x51c7('0x3b')]]){if(_0x5e17e1[_0x51c7('0x49')]==='6'){if(!this[_0x51c7('0x18')][_0x5e17e1[_0x51c7('0x3b')]][_0x51c7('0x61')]){var _0x5e878a=moment();this['channels'][_0x5e17e1[_0x51c7('0x3b')]][_0x51c7('0x61')]=!![];this[_0x51c7('0x18')][_0x5e17e1[_0x51c7('0x3b')]]['answertime']=_0x5e878a[_0x51c7('0x45')](_0x51c7('0x46'));if(this[_0x51c7('0x18')][_0x5e17e1[_0x51c7('0x3b')]][_0x51c7('0x44')]){this[_0x51c7('0x18')][_0x5e17e1[_0x51c7('0x3b')]][_0x51c7('0x62')]=_0x5e878a[_0x51c7('0x63')](this['channels'][_0x5e17e1[_0x51c7('0x3b')]][_0x51c7('0x44')],'seconds');}}this['channels'][_0x5e17e1[_0x51c7('0x3b')]]['linkedid']=_0x5e17e1[_0x51c7('0x3a')];if(_0x5e17e1[_0x51c7('0x5f')]!=='xcally-motion-preview'){this['channels'][_0x5e17e1['linkedid']][_0x51c7('0x64')]=_0x5e17e1['calleridnum'];}this[_0x51c7('0x18')][_0x5e17e1[_0x51c7('0x3b')]][_0x51c7('0x65')]=_0x5e17e1[_0x51c7('0x37')];this[_0x51c7('0x18')][_0x5e17e1[_0x51c7('0x3b')]]['destinationchannel']=_0x5e17e1['channel'];this[_0x51c7('0x18')][_0x5e17e1[_0x51c7('0x3b')]][_0x51c7('0x47')]=dispositions[_['toNumber'](_0x5e17e1[_0x51c7('0x49')])];if(this['agents'][_0x5e17e1['channel'][_0x51c7('0x4c')]('-')[0x0]]){this[_0x51c7('0x18')][_0x5e17e1['linkedid']][_0x51c7('0x66')]=this[_0x51c7('0x19')][_0x5e17e1[_0x51c7('0x3f')][_0x51c7('0x4c')]('-')[0x0]]['id'];this['channels'][_0x5e17e1[_0x51c7('0x3b')]][_0x51c7('0x67')]=this[_0x51c7('0x19')][_0x5e17e1[_0x51c7('0x3f')][_0x51c7('0x4c')]('-')[0x0]]['name'];}}}}else{if(this[_0x51c7('0x18')][_0x5e17e1['uniqueid']]){if(_0x5e17e1[_0x51c7('0x49')]==='6'){if(this[_0x51c7('0x19')][_0x5e17e1[_0x51c7('0x3f')]['split']('-')[0x0]]){this[_0x51c7('0x18')][_0x5e17e1[_0x51c7('0x3a')]][_0x51c7('0x66')]=this[_0x51c7('0x19')][_0x5e17e1['channel'][_0x51c7('0x4c')]('-')[0x0]]['id'];this['channels'][_0x5e17e1[_0x51c7('0x3a')]]['membername']=this[_0x51c7('0x19')][_0x5e17e1['channel']['split']('-')[0x0]][_0x51c7('0x68')];}}}}}}catch(_0x4ad6b9){logger[_0x51c7('0x2f')](_0x51c7('0x69'),_0x5e17e1['uniqueid'],util[_0x51c7('0x31')](_0x4ad6b9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x51c7('0x6a')]=function(_0x432cfc,_0x30589b){try{if(this['channels'][_0x432cfc]){logger[_0x51c7('0x2d')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x432cfc,_0x30589b);this[_0x51c7('0x18')][_0x432cfc]['monitor']=!![];if(_[_0x51c7('0x6b')](_0x30589b,'.wav49')){_0x30589b=_0x30589b[_0x51c7('0x6c')](_0x51c7('0x6d'),_0x51c7('0x6e'));}this['channels'][_0x432cfc]['monitorFilename']=_0x30589b;var _0x4500a6=_[_0x51c7('0x6f')](this['channels'][_0x432cfc]['monitors'],{'filename':_0x30589b});if(_['isNil'](_0x4500a6)){this[_0x51c7('0x18')][_0x432cfc][_0x51c7('0x70')][_0x51c7('0x71')]({'filename':_0x30589b,'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x51c7('0x72')});}}}catch(_0x5a04bd){logger['error']('[%s][voiceCallReport][mixMonitorFilename]',_0x432cfc,util['inspect'](_0x5a04bd,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncVarSet']=function(_0x25a24f){try{if(this[_0x51c7('0x33')](_0x25a24f)){logger['debug'](_0x51c7('0x73'),_0x25a24f['uniqueid'],util['inspect'](_0x25a24f,{'showHidden':![],'depth':null}));if(this[_0x51c7('0x18')][_0x25a24f[_0x51c7('0x3a')]]&&_0x25a24f[_0x51c7('0x3f')]!=_0x51c7('0x40')){if(this[_0x51c7('0x33')](_0x25a24f[_0x51c7('0x74')])){if(this[_0x51c7('0x33')](_0x25a24f[_0x51c7('0x74')]['mixmonitor_filename'])){logger[_0x51c7('0x2d')](_0x51c7('0x75'),_0x25a24f[_0x51c7('0x3a')],_0x25a24f['value']);this[_0x51c7('0x6a')](_0x25a24f[_0x51c7('0x3a')],_0x25a24f['value']);}else if(this[_0x51c7('0x33')](_0x25a24f[_0x51c7('0x74')]['xmd-phone'])){logger[_0x51c7('0x2d')](_0x51c7('0x76'),_0x25a24f[_0x51c7('0x3a')],_0x25a24f[_0x51c7('0x77')]);this[_0x51c7('0x18')][_0x25a24f[_0x51c7('0x3a')]]['calleridnum']=_0x25a24f[_0x51c7('0x77')];}else if(this[_0x51c7('0x33')](_0x25a24f[_0x51c7('0x74')][_0x51c7('0x78')])){logger[_0x51c7('0x2d')](_0x51c7('0x79'),_0x25a24f[_0x51c7('0x3a')],_0x25a24f[_0x51c7('0x77')]);this[_0x51c7('0x18')][_0x25a24f[_0x51c7('0x3a')]]['callerid']=_0x25a24f[_0x51c7('0x77')];}else if(this[_0x51c7('0x33')](_0x25a24f['variable'][_0x51c7('0x7a')])){logger[_0x51c7('0x2d')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x25a24f[_0x51c7('0x3a')],_0x25a24f[_0x51c7('0x77')]);this[_0x51c7('0x18')][_0x25a24f[_0x51c7('0x3a')]]['type']=_0x25a24f['value'];}else if(this[_0x51c7('0x33')](_0x25a24f[_0x51c7('0x74')][_0x51c7('0x7b')])){logger[_0x51c7('0x2d')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x25a24f[_0x51c7('0x3a')],_0x25a24f[_0x51c7('0x77')][_0x51c7('0x4c')](',')[0x0]);this[_0x51c7('0x18')][_0x25a24f[_0x51c7('0x3a')]]['queue']=_0x25a24f[_0x51c7('0x77')]['split'](',')[0x0];}else if(this['isNotNull'](_0x25a24f['variable'][_0x51c7('0x7c')])){logger['info'](_0x51c7('0x7d'),_0x25a24f['uniqueid'],_0x25a24f[_0x51c7('0x77')]);this[_0x51c7('0x18')][_0x25a24f[_0x51c7('0x3a')]]['originatecalleridnum']=_0x25a24f[_0x51c7('0x77')];}else if(this['isNotNull'](_0x25a24f['variable'][_0x51c7('0x7e')])){logger['info'](_0x51c7('0x7f'),_0x25a24f[_0x51c7('0x3a')],_0x25a24f['value']);this['channels'][_0x25a24f[_0x51c7('0x3a')]][_0x51c7('0x80')]=_0x25a24f[_0x51c7('0x77')];}else if(this[_0x51c7('0x33')](_0x25a24f[_0x51c7('0x74')]['xmd-callerid-preview'])){logger[_0x51c7('0x2d')](_0x51c7('0x81'),_0x25a24f['uniqueid'],_0x25a24f[_0x51c7('0x77')]);this[_0x51c7('0x18')][_0x25a24f['uniqueid']][_0x51c7('0x82')]=_0x25a24f[_0x51c7('0x77')];}else if(this[_0x51c7('0x33')](_0x25a24f[_0x51c7('0x74')][_0x51c7('0x83')])){logger[_0x51c7('0x2d')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x25a24f['uniqueid'],_0x25a24f[_0x51c7('0x77')]);this[_0x51c7('0x18')][_0x25a24f[_0x51c7('0x3a')]][_0x51c7('0xe')]=_0x25a24f[_0x51c7('0x77')];}else if(this[_0x51c7('0x33')](_0x25a24f['variable'][_0x51c7('0x84')])){logger['info'](_0x51c7('0x85'),_0x25a24f[_0x51c7('0x3a')],_0x25a24f[_0x51c7('0x77')]);this[_0x51c7('0x18')][_0x25a24f[_0x51c7('0x3a')]]['sipcalluniqueid']=_0x25a24f[_0x51c7('0x77')];}}}else if(this[_0x51c7('0x33')](_0x25a24f[_0x51c7('0x74')][_0x51c7('0x86')])){if(_0x25a24f['value']){var _0x44a9b0=path['parse'](_0x25a24f[_0x51c7('0x77')])['name'];logger[_0x51c7('0x2d')](_0x51c7('0x75'),_0x44a9b0,_0x25a24f['value']);this[_0x51c7('0x6a')](_0x44a9b0,_0x25a24f[_0x51c7('0x77')]);}}else if(this[_0x51c7('0x18')][_0x25a24f['linkedid']]){if(this[_0x51c7('0x33')](_0x25a24f[_0x51c7('0x74')])){if(this[_0x51c7('0x33')](_0x25a24f[_0x51c7('0x74')][_0x51c7('0x84')])){logger[_0x51c7('0x2d')](_0x51c7('0x85'),_0x25a24f[_0x51c7('0x3b')],_0x25a24f[_0x51c7('0x77')]);this['channels'][_0x25a24f['linkedid']][_0x51c7('0x87')]=_0x25a24f['value'];}}}}}catch(_0x3515f1){logger[_0x51c7('0x2f')](_0x51c7('0x88'),_0x25a24f['uniqueid'],util[_0x51c7('0x31')](_0x3515f1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x51c7('0x23')]=function(_0x12bd4e){try{if(this[_0x51c7('0x33')](_0x12bd4e)){logger[_0x51c7('0x38')](_0x51c7('0x89'),_0x12bd4e[_0x51c7('0x3a')],util['inspect'](_0x12bd4e,{'showHidden':![],'depth':null}));if(this['channels'][_0x12bd4e['uniqueid']]){logger[_0x51c7('0x2d')](_0x51c7('0x8a'),_0x12bd4e['uniqueid'],_0x12bd4e[_0x51c7('0x8b')]);var _0xc02f1=moment();this[_0x51c7('0x18')][_0x12bd4e[_0x51c7('0x3a')]][_0x51c7('0x8c')]=_0xc02f1[_0x51c7('0x45')](_0x51c7('0x46'));this[_0x51c7('0x18')][_0x12bd4e[_0x51c7('0x3a')]][_0x51c7('0x55')]=_0xc02f1[_0x51c7('0x63')](this[_0x51c7('0x18')][_0x12bd4e[_0x51c7('0x3a')]]['starttime'],'seconds');if(this['channels'][_0x12bd4e[_0x51c7('0x3a')]]['answered']){this['channels'][_0x12bd4e[_0x51c7('0x3a')]][_0x51c7('0x8d')]=_0xc02f1[_0x51c7('0x63')](this[_0x51c7('0x18')][_0x12bd4e['uniqueid']]['answertime'],_0x51c7('0x57'));this[_0x51c7('0x18')][_0x12bd4e[_0x51c7('0x3a')]]['holdtime']=this[_0x51c7('0x18')][_0x12bd4e['uniqueid']]['duration']-this['channels'][_0x12bd4e[_0x51c7('0x3a')]][_0x51c7('0x8d')];}if(_0x12bd4e[_0x51c7('0x42')]===_0x51c7('0x4b')){if(this[_0x51c7('0x19')][_0x12bd4e['channel'][_0x51c7('0x4c')]('-')[0x0]]){this['agents'][_0x12bd4e['channel'][_0x51c7('0x4c')]('-')[0x0]]=_['omit'](this[_0x51c7('0x19')][_0x12bd4e[_0x51c7('0x3f')]['split']('-')[0x0]],[_0x51c7('0x8e')]);logger['debug'](_0x51c7('0x8f'),_0x12bd4e[_0x51c7('0x3a')],util[_0x51c7('0x31')]({'destaccountcode':this['agents'][_0x12bd4e[_0x51c7('0x3f')][_0x51c7('0x4c')]('-')[0x0]][_0x51c7('0x4e')]},{'showHidden':![],'depth':null}));this[_0x51c7('0x35')](util['format'](_0x51c7('0x4f'),this[_0x51c7('0x19')][_0x12bd4e['channel'][_0x51c7('0x4c')]('-')[0x0]][_0x51c7('0x68')]),'user:agentcomplete',{'destaccountcode':this['agents'][_0x12bd4e[_0x51c7('0x3f')][_0x51c7('0x4c')]('-')[0x0]][_0x51c7('0x4e')]});}}var _0x1b5d69=this;Promise[_0x51c7('0x90')]()[_0x51c7('0x91')](function(){var _0x535fb7=_0x1b5d69[_0x51c7('0x18')][_0x12bd4e['uniqueid']];if(typeof _0x535fb7[_0x51c7('0x92')]===_0x51c7('0x93'))return;if(_[_0x51c7('0x94')](_0x535fb7[_0x51c7('0x70')]))return;return RpcSetting[_0x51c7('0x95')]()['then'](function(_0x567721){if(!_0x567721[_0x51c7('0x96')])return;return Promise['resolve']()['then'](function(){return ami[_0x51c7('0x97')]({'action':_0x51c7('0x98'),'channel':_0x535fb7['channel']})[_0x51c7('0x99')](function(){});})[_0x51c7('0x91')](function(){return ami['Action']({'action':_0x51c7('0x98'),'channel':_0x535fb7['destinationchannel']})[_0x51c7('0x99')](function(){})[_0x51c7('0x9a')](function(){var _0xa3df9=_0x1b5d69[_0x51c7('0x19')][_0x535fb7[_0x51c7('0x9b')][_0x51c7('0x4c')]('-')[0x0]];if(!_0xa3df9)return;io['emit'](_0x51c7('0x9c'),{'agentId':_0xa3df9['id'],'uniqueid':_0x535fb7[_0x51c7('0x3a')]});});});});})['then'](function(){if(_0x12bd4e[_0x51c7('0x9d')]===_0x51c7('0x9e')){_0x1b5d69[_0x51c7('0x1a')][_0x12bd4e['uniqueid']]=_0x1b5d69[_0x51c7('0x18')][_0x12bd4e[_0x51c7('0x3a')]];}else{if(_0x1b5d69[_0x51c7('0x18')][_0x12bd4e['uniqueid']][_0x51c7('0x9f')]===_0x51c7('0xa0')&&_0x1b5d69['blindTransfers'][_0x12bd4e[_0x51c7('0x3a')]]){_0x1b5d69['channels'][_0x12bd4e[_0x51c7('0x3a')]][_0x51c7('0x3a')]=[_0x1b5d69[_0x51c7('0x18')][_0x12bd4e[_0x51c7('0x3a')]]['linkedid'],_0x1b5d69[_0x51c7('0x18')][_0x12bd4e[_0x51c7('0x3a')]][_0x51c7('0x3b')]=_0x1b5d69[_0x51c7('0x18')][_0x12bd4e[_0x51c7('0x3a')]][_0x51c7('0x3a')]][0x0];delete _0x1b5d69[_0x51c7('0x1a')][_0x12bd4e[_0x51c7('0x3a')]];}}logger[_0x51c7('0x38')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x12bd4e[_0x51c7('0x3a')],util[_0x51c7('0x31')](_0x1b5d69[_0x51c7('0x18')][_0x12bd4e[_0x51c7('0x3a')]],{'showHidden':![],'depth':null}));ami[_0x51c7('0x35')](_0x51c7('0xa1'),_0x1b5d69[_0x51c7('0x18')][_0x12bd4e['uniqueid']]);delete _0x1b5d69[_0x51c7('0x18')][_0x12bd4e['uniqueid']];});}}}catch(_0x3788d2){logger[_0x51c7('0x2f')](_0x51c7('0xa2'),_0x12bd4e[_0x51c7('0x3a')],util['inspect'](_0x3788d2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x51c7('0x32')][_0x51c7('0xa3')]=function(_0x49866e){try{if(this[_0x51c7('0x33')](_0x49866e)){logger[_0x51c7('0x2d')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x49866e[_0x51c7('0x3a')],_0x49866e[_0x51c7('0xa4')],_0x49866e[_0x51c7('0xa5')]);logger[_0x51c7('0x38')](_0x51c7('0xa6'),_0x49866e[_0x51c7('0x3a')],util[_0x51c7('0x31')](_0x49866e,{'showHidden':![],'depth':null}));if(this['channels'][_0x49866e[_0x51c7('0xa7')]]){this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xa7')]][_0x51c7('0xa8')]=_0x49866e[_0x51c7('0xa4')];this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xa7')]][_0x51c7('0xa9')]=_0x49866e[_0x51c7('0xa5')];if(this['channels'][_0x49866e[_0x51c7('0xaa')]]){var _0x5efbfb=this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xaa')]];this['channels'][_0x49866e['secondtransfereruniqueid']]=this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xa7')]];this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xa7')]]=_0x5efbfb;}}else if(this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xab')]]){this['channels'][_0x49866e[_0x51c7('0xab')]][_0x51c7('0xa8')]=_0x49866e[_0x51c7('0xa4')];this[_0x51c7('0x18')][_0x49866e['transfertargetuniqueid']][_0x51c7('0xa9')]=_0x49866e[_0x51c7('0xa5')];if(this['channels'][_0x49866e[_0x51c7('0xac')]]){var _0x5efbfb=this[_0x51c7('0x18')][_0x49866e['origtransfereruniqueid']];this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xac')]]=this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xab')]];this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xab')]]=_0x5efbfb;}}if((this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xac')]]||this['channels'][_0x49866e['origtransfererlinkedid']])&&this['channels'][_0x49866e['secondtransfereruniqueid']]){var _0xaa6a90=_[_0x51c7('0xad')]([this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xac')]],this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xae')]],this[_0x51c7('0x18')][_0x49866e['secondtransfereruniqueid']]],function(_0x5dc531){return _0x5dc531&&_0x5dc531['type']===_0x51c7('0xa0')&&_0x5dc531[_0x51c7('0xaf')];});if(_0xaa6a90){if(this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xac')]])this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xac')]][_0x51c7('0x92')]=_0x51c7('0xb0');if(this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xae')]])this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xae')]][_0x51c7('0x92')]=_0x51c7('0xb0');this[_0x51c7('0x18')][_0x49866e[_0x51c7('0xaa')]][_0x51c7('0x92')]=_0x51c7('0xb0');}}}}catch(_0x245c84){logger['error']('[%s][voiceCallReport][attendedtransfer]',_0x49866e['uniqueid'],util['inspect'](_0x245c84,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x51c7('0x32')][_0x51c7('0x28')]=function(_0x6b3979){try{if(this['isNotNull'](_0x6b3979)){logger[_0x51c7('0x2d')](_0x51c7('0xb1'),_0x6b3979['uniqueid'],_0x6b3979[_0x51c7('0xb2')],_0x6b3979[_0x51c7('0xb3')]);logger[_0x51c7('0x38')](_0x51c7('0xb4'),_0x6b3979['uniqueid'],util[_0x51c7('0x31')](_0x6b3979,{'showHidden':![],'depth':null}));if(this['channels'][_0x6b3979[_0x51c7('0xa7')]]){this['channels'][_0x6b3979[_0x51c7('0xa7')]][_0x51c7('0xa8')]=_0x6b3979[_0x51c7('0xb2')];this[_0x51c7('0x18')][_0x6b3979[_0x51c7('0xa7')]][_0x51c7('0xa9')]=_0x6b3979['extension'];this['channels'][_0x6b3979['transfereeuniqueid']][_0x51c7('0x92')]='BLIND';this['syncHangup']({'event':_0x51c7('0x9e'),'uniqueid':_0x6b3979[_0x51c7('0xa7')],'context':_0x6b3979[_0x51c7('0x42')],'channel':_0x6b3979['transfererchannel']});}else{this['channels'][_0x6b3979[_0x51c7('0xb5')]][_0x51c7('0x92')]=_0x51c7('0xb6');}}}catch(_0x5ae7e1){logger[_0x51c7('0x2f')](_0x51c7('0xb7'),_0x6b3979[_0x51c7('0x3a')],util[_0x51c7('0x31')](_0x5ae7e1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x51c7('0x32')]['syncMusicOnHoldStart']=function(_0xd5dd33){try{if(this['isNotNull'](_0xd5dd33)){logger['debug']('[%s][voiceCallReport][musiconholdstart]\x20event:',_0xd5dd33[_0x51c7('0x3a')],util[_0x51c7('0x31')](_0xd5dd33,{'showHidden':![],'depth':null}));if(this[_0x51c7('0x18')][_0xd5dd33[_0x51c7('0x3a')]]){if(!_['isNil'](this[_0x51c7('0x18')][_0xd5dd33[_0x51c7('0x3a')]][_0x51c7('0xb8')])){this[_0x51c7('0x18')][_0xd5dd33[_0x51c7('0x3a')]][_0x51c7('0xb9')]=moment()[_0x51c7('0x45')](_0x51c7('0x46'));logger['info'](_0x51c7('0xba'),_0xd5dd33[_0x51c7('0x3a')],this[_0x51c7('0x18')][_0xd5dd33['uniqueid']]['mohstarttime']);}}}}catch(_0x208883){logger[_0x51c7('0x2f')]('[%s][voiceCallReport][musiconholdstart]',_0xd5dd33[_0x51c7('0x3a')],util[_0x51c7('0x31')](_0x208883,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x51c7('0x32')]['syncMusicOnHoldStop']=function(_0x5277d5){try{if(this['isNotNull'](_0x5277d5)){logger['debug']('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x5277d5[_0x51c7('0x3a')],util['inspect'](_0x5277d5,{'showHidden':![],'depth':null}));if(this[_0x51c7('0x18')][_0x5277d5[_0x51c7('0x3a')]]){if(!_[_0x51c7('0xbb')](this[_0x51c7('0x18')][_0x5277d5[_0x51c7('0x3a')]]['mohstarttime'])){this['channels'][_0x5277d5[_0x51c7('0x3a')]]['mohtime']+=moment()[_0x51c7('0xbc')](0x0)['diff'](this['channels'][_0x5277d5[_0x51c7('0x3a')]][_0x51c7('0xb9')],_0x51c7('0x57'));logger['info'](_0x51c7('0xbd'),_0x5277d5[_0x51c7('0x3a')],this['channels'][_0x5277d5[_0x51c7('0x3a')]][_0x51c7('0xbe')]);delete this[_0x51c7('0x18')][_0x5277d5[_0x51c7('0x3a')]]['mohstarttime'];}}}}catch(_0x487d2d){logger[_0x51c7('0x2f')](_0x51c7('0xbf'),_0x5277d5[_0x51c7('0x3a')],util['inspect'](_0x487d2d,{'showHidden':![],'depth':null}));}};module[_0x51c7('0xc0')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 4a41590..edd8335 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed32=['[%s][voiceDialReport][hangup]\x20event:','cause-txt','endtime','duration','diff','seconds','total','holdtime','billableseconds','sumHoldTime','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','[%s][voiceDialReport][hangup]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','socket.io-emitter','channels','outbound','variables','dialbegin','syncVarSet','bind','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','syncDialBegin','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','YYYY-MM-DD\x20HH:mm:ss','substring','channel','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','membername','memberpenalty'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xed32,0x7b));var _0x2ed3=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xed32[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0x2ed3('0x0'));var moment=require(_0x2ed3('0x1'));var util=require(_0x2ed3('0x2'));var Redis=require(_0x2ed3('0x3'));var config=require(_0x2ed3('0x4'));var logger=require(_0x2ed3('0x5'))(_0x2ed3('0x6'));var ami=require(_0x2ed3('0x7'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2ed3('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x1257aa){this[_0x2ed3('0x9')]=_0x1257aa['outboundChannels'];this[_0x2ed3('0xa')]=_0x1257aa[_0x2ed3('0xa')];this[_0x2ed3('0xb')]={};ami['on'](_0x2ed3('0xc'),this['syncDialBegin']['bind'](this));ami['on']('dialend',this['syncDialEnd']['bind'](this));ami['on']('varset',this[_0x2ed3('0xd')][_0x2ed3('0xe')](this));ami['on'](_0x2ed3('0xf'),this[_0x2ed3('0x10')]['bind'](this));}VoiceDialReport[_0x2ed3('0x11')][_0x2ed3('0x12')]=function(_0xc240c){return _0xc240c!==null&&!_[_0x2ed3('0x13')](_0xc240c);};VoiceDialReport[_0x2ed3('0x11')][_0x2ed3('0x14')]=function(_0x5e72d2,_0x4d7106,_0x3f0b0c){io['to'](_0x5e72d2)[_0x2ed3('0x14')](_0x4d7106,_0x3f0b0c);};VoiceDialReport[_0x2ed3('0x11')][_0x2ed3('0x15')]=function(_0x4a13ce){try{if(this[_0x2ed3('0x12')](_0x4a13ce)){logger['debug'](_0x2ed3('0x16'),_0x4a13ce[_0x2ed3('0x17')],util[_0x2ed3('0x18')](_0x4a13ce,{'showHidden':![],'depth':null}));if(this[_0x2ed3('0x9')][_0x4a13ce[_0x2ed3('0x17')]]){_[_0x2ed3('0x19')](this[_0x2ed3('0x9')][_0x4a13ce[_0x2ed3('0x17')]],{'starttime':moment()['format'](_0x2ed3('0x1a')),'lastevent':'called','interface':_0x4a13ce['channel'][_0x2ed3('0x1b')](0x0,_0x4a13ce[_0x2ed3('0x1c')][_0x2ed3('0x1d')]('-')),'membername':_0x4a13ce[_0x2ed3('0x1c')][_0x2ed3('0x1b')](_0x4a13ce[_0x2ed3('0x1c')][_0x2ed3('0x1d')]('/')+0x1,_0x4a13ce[_0x2ed3('0x1c')]['lastIndexOf']('-'))},_[_0x2ed3('0x1e')](_0x4a13ce,[_0x2ed3('0x1f'),_0x2ed3('0x20')]));logger[_0x2ed3('0x21')](_0x2ed3('0x22'),_0x4a13ce[_0x2ed3('0x17')],this[_0x2ed3('0x9')][_0x4a13ce['uniqueid']]['membername'],this[_0x2ed3('0x9')][_0x4a13ce[_0x2ed3('0x17')]][_0x2ed3('0x23')]);logger[_0x2ed3('0x24')](_0x2ed3('0x25'),_0x4a13ce[_0x2ed3('0x17')],util[_0x2ed3('0x18')](this[_0x2ed3('0x9')][_0x4a13ce['uniqueid']],{'showHidden':![],'depth':null}));this[_0x2ed3('0x14')](_0x2ed3('0x26'),_0x2ed3('0x27'),this['channels'][_0x4a13ce[_0x2ed3('0x17')]]);logger[_0x2ed3('0x24')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x4a13ce['uniqueid'],util['inspect'](this[_0x2ed3('0x9')][_0x4a13ce['uniqueid']],{'showHidden':![],'depth':null}));ami['emit']('custom:dialbegin',this[_0x2ed3('0x9')][_0x4a13ce['uniqueid']]);}}}catch(_0x1e0fda){logger[_0x2ed3('0x28')](_0x2ed3('0x29'),_0x4a13ce[_0x2ed3('0x17')],util[_0x2ed3('0x18')](_0x1e0fda,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x2ed3('0x2a')]=function(_0x176be2){try{if(this[_0x2ed3('0x12')](_0x176be2)){logger[_0x2ed3('0x24')](_0x2ed3('0x2b'),_0x176be2[_0x2ed3('0x17')],util[_0x2ed3('0x18')](_0x176be2,{'showHidden':![],'depth':null}));if(this[_0x2ed3('0x9')][_0x176be2[_0x2ed3('0x17')]]){this[_0x2ed3('0x9')][_0x176be2[_0x2ed3('0x17')]][_0x2ed3('0x2c')]=_0x176be2['dialstatus'];if(_0x176be2['dialstatus']===_0x2ed3('0x2d')){this[_0x2ed3('0x9')][_0x176be2[_0x2ed3('0x17')]][_0x2ed3('0x2e')]=_0x176be2[_0x2ed3('0x2e')];this[_0x2ed3('0x9')][_0x176be2[_0x2ed3('0x17')]]['connectedlinename']=_0x176be2[_0x2ed3('0x2f')];this['channels'][_0x176be2['uniqueid']][_0x2ed3('0x30')]=moment()[_0x2ed3('0x31')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2ed3('0x9')][_0x176be2[_0x2ed3('0x17')]][_0x2ed3('0x32')]=_0x2ed3('0x33');logger[_0x2ed3('0x21')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x176be2[_0x2ed3('0x17')],_0x176be2[_0x2ed3('0x1c')][_0x2ed3('0x1b')](_0x176be2[_0x2ed3('0x1c')]['lastIndexOf']('/')+0x1,_0x176be2['channel'][_0x2ed3('0x1d')]('-')));logger[_0x2ed3('0x24')](_0x2ed3('0x34'),_0x176be2[_0x2ed3('0x17')],util['inspect'](this[_0x2ed3('0x9')][_0x176be2['uniqueid']],{'showHidden':![],'depth':null}));ami['emit']('custom:dialconnect',this['channels'][_0x176be2['uniqueid']]);}logger[_0x2ed3('0x24')](_0x2ed3('0x35'),_0x176be2[_0x2ed3('0x17')],util['inspect'](this[_0x2ed3('0x9')][_0x176be2['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x2ed3('0x27'),this[_0x2ed3('0x9')][_0x176be2['uniqueid']]);}}}catch(_0x2860d5){logger[_0x2ed3('0x28')](_0x2ed3('0x36'),_0x176be2['uniqueid'],util[_0x2ed3('0x18')](_0x2860d5,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2ed3('0x11')][_0x2ed3('0xd')]=function(_0x3ff1f9){try{if(this[_0x2ed3('0x12')](_0x3ff1f9)){logger[_0x2ed3('0x24')](_0x2ed3('0x37'),_0x3ff1f9[_0x2ed3('0x17')],util['inspect'](_0x3ff1f9,{'showHidden':![],'depth':null}));this['addVariable'](_0x3ff1f9[_0x2ed3('0x17')],_[_0x2ed3('0x38')](_0x3ff1f9[_0x2ed3('0x39')])[0x0],_0x3ff1f9[_0x2ed3('0x3a')]);if(this[_0x2ed3('0x12')](_0x3ff1f9[_0x2ed3('0x39')])&&this[_0x2ed3('0x12')](_0x3ff1f9[_0x2ed3('0x39')][_0x2ed3('0x3b')])){if(_[_0x2ed3('0x13')](this['channels'][_0x3ff1f9[_0x2ed3('0x17')]])){this[_0x2ed3('0x9')][_0x3ff1f9['uniqueid']]={'routeId':_0x3ff1f9[_0x2ed3('0x3a')],'variables':this[_0x2ed3('0xb')][_0x3ff1f9[_0x2ed3('0x17')]]};logger['info']('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x3ff1f9[_0x2ed3('0x17')],_0x3ff1f9['variable']['outboundrouteid'],_[_0x2ed3('0x38')](_0x3ff1f9[_0x2ed3('0x39')])[0x0],_0x3ff1f9['value']);logger[_0x2ed3('0x24')](_0x2ed3('0x3c'),_0x3ff1f9[_0x2ed3('0x17')],util['inspect'](this[_0x2ed3('0x9')][_0x3ff1f9[_0x2ed3('0x17')]],{'showHidden':![],'depth':null}));this[_0x2ed3('0x14')](_0x2ed3('0x26'),_0x2ed3('0x27'),this[_0x2ed3('0x9')][_0x3ff1f9['uniqueid']]);}}}}catch(_0x2f75d8){logger[_0x2ed3('0x28')](_0x2ed3('0x3d'),_0x3ff1f9[_0x2ed3('0x17')],util['inspect'](_0x2f75d8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2ed3('0x11')][_0x2ed3('0x3e')]=function(_0x279a44,_0x7845f4,_0x492386){var _0x71e21e=[_0x2ed3('0x3f'),_0x2ed3('0x40'),_0x2ed3('0x41'),_0x2ed3('0x42'),_0x2ed3('0x43'),_0x2ed3('0x44'),_0x2ed3('0x45'),_0x2ed3('0x46'),_0x2ed3('0x47'),_0x2ed3('0x48'),_0x2ed3('0x49'),_0x2ed3('0x4a'),'membercalls',_0x2ed3('0x4b'),_0x2ed3('0x4c'),'memberlastcall',_0x2ed3('0x4d'),_0x2ed3('0x4e'),'memberrealtime'];if(!_['isNil'](_0x7845f4)&&!_['includes'](_0x71e21e,_0x7845f4)){if(_[_0x2ed3('0x13')](this[_0x2ed3('0xb')][_0x279a44])){this[_0x2ed3('0xb')][_0x279a44]={};}this[_0x2ed3('0xb')][_0x279a44][_0x7845f4]=_0x492386;}};VoiceDialReport[_0x2ed3('0x11')]['syncHangup']=function(_0xc872f8){try{if(this['isNotNull'](_0xc872f8)){logger[_0x2ed3('0x24')](_0x2ed3('0x4f'),_0xc872f8[_0x2ed3('0x17')],util['inspect'](_0xc872f8,{'showHidden':![],'depth':null}));if(this['channels'][_0xc872f8['uniqueid']]){logger[_0x2ed3('0x21')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0xc872f8[_0x2ed3('0x17')],_0xc872f8[_0x2ed3('0x50')]);this[_0x2ed3('0x9')][_0xc872f8['uniqueid']][_0x2ed3('0x51')]=moment()['format'](_0x2ed3('0x1a'));this['channels'][_0xc872f8[_0x2ed3('0x17')]][_0x2ed3('0x52')]=moment(this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]][_0x2ed3('0x51')])[_0x2ed3('0x53')](this['channels'][_0xc872f8[_0x2ed3('0x17')]]['starttime'],_0x2ed3('0x54'));this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]][_0x2ed3('0x32')]='complete';this[_0x2ed3('0xa')][_0x2ed3('0x55')]+=0x1;if(this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]][_0x2ed3('0x30')]){this[_0x2ed3('0xa')]['answered']+=0x1;this['channels'][_0xc872f8[_0x2ed3('0x17')]][_0x2ed3('0x56')]=moment(this[_0x2ed3('0x9')][_0xc872f8['uniqueid']][_0x2ed3('0x30')])['diff'](this['channels'][_0xc872f8[_0x2ed3('0x17')]]['starttime'],_0x2ed3('0x54'));this[_0x2ed3('0x9')][_0xc872f8['uniqueid']][_0x2ed3('0x57')]=moment(this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]][_0x2ed3('0x51')])[_0x2ed3('0x53')](this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]]['answertime'],_0x2ed3('0x54'));this['outbound'][_0x2ed3('0x58')]+=this['channels'][_0xc872f8[_0x2ed3('0x17')]][_0x2ed3('0x56')]||0x0;this[_0x2ed3('0xa')]['sumBillable']+=this[_0x2ed3('0x9')][_0xc872f8['uniqueid']][_0x2ed3('0x57')];}this[_0x2ed3('0xa')][_0x2ed3('0x59')]+=this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]]['duration'];logger[_0x2ed3('0x24')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0xc872f8['uniqueid'],util[_0x2ed3('0x18')](this[_0x2ed3('0x9')][_0xc872f8['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x2ed3('0x14')](_0x2ed3('0x5a'),this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]]);logger[_0x2ed3('0x24')](_0x2ed3('0x5b'),_0xc872f8[_0x2ed3('0x17')],util[_0x2ed3('0x18')](this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]],{'showHidden':![],'depth':null}));ami[_0x2ed3('0x14')](_0x2ed3('0x5c'),this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]]);logger[_0x2ed3('0x24')](_0x2ed3('0x5d'),_0xc872f8['uniqueid'],util[_0x2ed3('0x18')](this['channels'][_0xc872f8[_0x2ed3('0x17')]],{'showHidden':![],'depth':null}));this[_0x2ed3('0x14')](_0x2ed3('0x26'),_0x2ed3('0x5e'),this[_0x2ed3('0xa')]);logger[_0x2ed3('0x21')](_0x2ed3('0x5f'),JSON[_0x2ed3('0x60')](this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]]));logger[_0x2ed3('0x24')](_0x2ed3('0x61'),_0xc872f8[_0x2ed3('0x17')],util['inspect'](this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]],{'showHidden':![],'depth':null}));this['emit'](_0x2ed3('0x26'),'voice_outbound_channel:remove',this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x17')]]);delete this['channels'][_0xc872f8[_0x2ed3('0x17')]];}else if(this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x62')]]){this['channels'][_0xc872f8[_0x2ed3('0x62')]][_0x2ed3('0x17')]=this[_0x2ed3('0x9')][_0xc872f8[_0x2ed3('0x62')]]['destuniqueid'];}if(this['variables'][_0xc872f8[_0x2ed3('0x17')]]){delete this['variables'][_0xc872f8[_0x2ed3('0x17')]];}}}catch(_0x4b4f73){logger[_0x2ed3('0x28')](_0x2ed3('0x63'),_0xc872f8['uniqueid'],util[_0x2ed3('0x18')](_0x4b4f73,{'showHidden':![],'depth':null}));}};module[_0x2ed3('0x64')]=VoiceDialReport; \ No newline at end of file +var _0x08f9=['[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','info','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','membercalls','memberinterface','memberlastcall','memberrealtime','isNil','[%s][voiceDialReport][hangup]\x20event:','endtime','diff','starttime','seconds','complete','total','answered','holdtime','sumHoldTime','sumBillable','duration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','exports','lodash','moment','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','channels','outbound','variables','dialbegin','syncDialBegin','bind','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege'];(function(_0xa1c588,_0x30efa2){var _0x410a4a=function(_0x170de9){while(--_0x170de9){_0xa1c588['push'](_0xa1c588['shift']());}};_0x410a4a(++_0x30efa2);}(_0x08f9,0x1cf));var _0x908f=function(_0x4bcbdd,_0x224408){_0x4bcbdd=_0x4bcbdd-0x0;var _0x5db702=_0x08f9[_0x4bcbdd];return _0x5db702;};'use strict';var _=require(_0x908f('0x0'));var moment=require(_0x908f('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x908f('0x2'));var logger=require(_0x908f('0x3'))(_0x908f('0x4'));var ami=require('../ami');config[_0x908f('0x5')]=_[_0x908f('0x6')](config['redis'],{'host':_0x908f('0x7'),'port':0x18eb});var io=require(_0x908f('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0xb4baf7){this[_0x908f('0x9')]=_0xb4baf7['outboundChannels'];this['outbound']=_0xb4baf7[_0x908f('0xa')];this[_0x908f('0xb')]={};ami['on'](_0x908f('0xc'),this[_0x908f('0xd')][_0x908f('0xe')](this));ami['on']('dialend',this[_0x908f('0xf')][_0x908f('0xe')](this));ami['on'](_0x908f('0x10'),this[_0x908f('0x11')][_0x908f('0xe')](this));ami['on'](_0x908f('0x12'),this[_0x908f('0x13')][_0x908f('0xe')](this));}VoiceDialReport[_0x908f('0x14')][_0x908f('0x15')]=function(_0x3daf8f){return _0x3daf8f!==null&&!_[_0x908f('0x16')](_0x3daf8f);};VoiceDialReport[_0x908f('0x14')][_0x908f('0x17')]=function(_0x1a92fa,_0x4df8d8,_0x4f1093){io['to'](_0x1a92fa)[_0x908f('0x17')](_0x4df8d8,_0x4f1093);};VoiceDialReport['prototype'][_0x908f('0xd')]=function(_0x393a60){try{if(this[_0x908f('0x15')](_0x393a60)){logger[_0x908f('0x18')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x393a60[_0x908f('0x19')],util[_0x908f('0x1a')](_0x393a60,{'showHidden':![],'depth':null}));if(this[_0x908f('0x9')][_0x393a60[_0x908f('0x19')]]){_[_0x908f('0x1b')](this['channels'][_0x393a60[_0x908f('0x19')]],{'starttime':moment()[_0x908f('0x1c')](_0x908f('0x1d')),'lastevent':_0x908f('0x1e'),'interface':_0x393a60[_0x908f('0x1f')][_0x908f('0x20')](0x0,_0x393a60[_0x908f('0x1f')]['lastIndexOf']('-')),'membername':_0x393a60['channel']['substring'](_0x393a60[_0x908f('0x1f')]['lastIndexOf']('/')+0x1,_0x393a60[_0x908f('0x1f')][_0x908f('0x21')]('-'))},_[_0x908f('0x22')](_0x393a60,[_0x908f('0x23'),_0x908f('0x24')]));logger['info'](_0x908f('0x25'),_0x393a60['uniqueid'],this[_0x908f('0x9')][_0x393a60[_0x908f('0x19')]][_0x908f('0x26')],this[_0x908f('0x9')][_0x393a60['uniqueid']][_0x908f('0x27')]);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x393a60['uniqueid'],util['inspect'](this[_0x908f('0x9')][_0x393a60[_0x908f('0x19')]],{'showHidden':![],'depth':null}));this[_0x908f('0x17')](_0x908f('0x28'),'voice_outbound_channel:save',this['channels'][_0x393a60['uniqueid']]);logger[_0x908f('0x18')](_0x908f('0x29'),_0x393a60[_0x908f('0x19')],util[_0x908f('0x1a')](this[_0x908f('0x9')][_0x393a60[_0x908f('0x19')]],{'showHidden':![],'depth':null}));ami[_0x908f('0x17')](_0x908f('0x2a'),this['channels'][_0x393a60[_0x908f('0x19')]]);}}}catch(_0x2d3762){logger['error'](_0x908f('0x2b'),_0x393a60['uniqueid'],util[_0x908f('0x1a')](_0x2d3762,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x908f('0x14')][_0x908f('0xf')]=function(_0x495338){try{if(this[_0x908f('0x15')](_0x495338)){logger[_0x908f('0x18')]('[%s][voiceDialReport][dialend]\x20event:',_0x495338[_0x908f('0x19')],util[_0x908f('0x1a')](_0x495338,{'showHidden':![],'depth':null}));if(this[_0x908f('0x9')][_0x495338['uniqueid']]){this[_0x908f('0x9')][_0x495338[_0x908f('0x19')]][_0x908f('0x2c')]=_0x495338[_0x908f('0x2c')];if(_0x495338[_0x908f('0x2c')]===_0x908f('0x2d')){this[_0x908f('0x9')][_0x495338['uniqueid']][_0x908f('0x2e')]=_0x495338[_0x908f('0x2e')];this['channels'][_0x495338[_0x908f('0x19')]][_0x908f('0x2f')]=_0x495338[_0x908f('0x2f')];this['channels'][_0x495338[_0x908f('0x19')]][_0x908f('0x30')]=moment()[_0x908f('0x1c')](_0x908f('0x1d'));this[_0x908f('0x9')][_0x495338['uniqueid']][_0x908f('0x31')]='connect';logger[_0x908f('0x32')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x495338['uniqueid'],_0x495338[_0x908f('0x1f')]['substring'](_0x495338[_0x908f('0x1f')][_0x908f('0x21')]('/')+0x1,_0x495338['channel'][_0x908f('0x21')]('-')));logger[_0x908f('0x18')](_0x908f('0x33'),_0x495338['uniqueid'],util[_0x908f('0x1a')](this[_0x908f('0x9')][_0x495338[_0x908f('0x19')]],{'showHidden':![],'depth':null}));ami[_0x908f('0x17')]('custom:dialconnect',this[_0x908f('0x9')][_0x495338[_0x908f('0x19')]]);}logger[_0x908f('0x18')](_0x908f('0x34'),_0x495338[_0x908f('0x19')],util['inspect'](this[_0x908f('0x9')][_0x495338[_0x908f('0x19')]],{'showHidden':![],'depth':null}));this[_0x908f('0x17')](_0x908f('0x28'),_0x908f('0x35'),this[_0x908f('0x9')][_0x495338['uniqueid']]);}}}catch(_0x2b38b9){logger[_0x908f('0x36')](_0x908f('0x37'),_0x495338[_0x908f('0x19')],util[_0x908f('0x1a')](_0x2b38b9,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x908f('0x11')]=function(_0x236a39){try{if(this[_0x908f('0x15')](_0x236a39)){logger[_0x908f('0x18')](_0x908f('0x38'),_0x236a39[_0x908f('0x19')],util['inspect'](_0x236a39,{'showHidden':![],'depth':null}));this[_0x908f('0x39')](_0x236a39[_0x908f('0x19')],_[_0x908f('0x3a')](_0x236a39['variable'])[0x0],_0x236a39[_0x908f('0x3b')]);if(this['isNotNull'](_0x236a39[_0x908f('0x3c')])&&this[_0x908f('0x15')](_0x236a39[_0x908f('0x3c')][_0x908f('0x3d')])){if(_[_0x908f('0x16')](this[_0x908f('0x9')][_0x236a39[_0x908f('0x19')]])){this[_0x908f('0x9')][_0x236a39[_0x908f('0x19')]]={'routeId':_0x236a39[_0x908f('0x3b')],'variables':this['variables'][_0x236a39[_0x908f('0x19')]]};logger[_0x908f('0x32')](_0x908f('0x3e'),_0x236a39[_0x908f('0x19')],_0x236a39[_0x908f('0x3c')]['outboundrouteid'],_[_0x908f('0x3a')](_0x236a39[_0x908f('0x3c')])[0x0],_0x236a39[_0x908f('0x3b')]);logger['debug'](_0x908f('0x3f'),_0x236a39[_0x908f('0x19')],util['inspect'](this['channels'][_0x236a39[_0x908f('0x19')]],{'showHidden':![],'depth':null}));this[_0x908f('0x17')](_0x908f('0x28'),_0x908f('0x35'),this['channels'][_0x236a39[_0x908f('0x19')]]);}}}}catch(_0x20b483){logger[_0x908f('0x36')](_0x908f('0x40'),_0x236a39['uniqueid'],util[_0x908f('0x1a')](_0x20b483,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x908f('0x14')][_0x908f('0x39')]=function(_0x53e0e4,_0x410e0b,_0xd72fa1){var _0x217ec0=[_0x908f('0x41'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x908f('0x42'),_0x908f('0x43'),_0x908f('0x44'),_0x908f('0x45'),'rtpaudioqosrttbridged',_0x908f('0x46'),_0x908f('0x47'),_0x908f('0x48'),'bridgepvtcallid',_0x908f('0x49'),'memberdynamic',_0x908f('0x4a'),_0x908f('0x4b'),_0x908f('0x26'),'memberpenalty',_0x908f('0x4c')];if(!_[_0x908f('0x4d')](_0x410e0b)&&!_['includes'](_0x217ec0,_0x410e0b)){if(_[_0x908f('0x16')](this['variables'][_0x53e0e4])){this[_0x908f('0xb')][_0x53e0e4]={};}this[_0x908f('0xb')][_0x53e0e4][_0x410e0b]=_0xd72fa1;}};VoiceDialReport[_0x908f('0x14')]['syncHangup']=function(_0x455e9f){try{if(this[_0x908f('0x15')](_0x455e9f)){logger[_0x908f('0x18')](_0x908f('0x4e'),_0x455e9f[_0x908f('0x19')],util[_0x908f('0x1a')](_0x455e9f,{'showHidden':![],'depth':null}));if(this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]]){logger['info']('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x455e9f[_0x908f('0x19')],_0x455e9f['cause-txt']);this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]][_0x908f('0x4f')]=moment()[_0x908f('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]]['duration']=moment(this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]]['endtime'])[_0x908f('0x50')](this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]][_0x908f('0x51')],_0x908f('0x52'));this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]]['lastevent']=_0x908f('0x53');this[_0x908f('0xa')][_0x908f('0x54')]+=0x1;if(this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]][_0x908f('0x30')]){this[_0x908f('0xa')][_0x908f('0x55')]+=0x1;this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]][_0x908f('0x56')]=moment(this['channels'][_0x455e9f['uniqueid']][_0x908f('0x30')])[_0x908f('0x50')](this[_0x908f('0x9')][_0x455e9f['uniqueid']][_0x908f('0x51')],_0x908f('0x52'));this[_0x908f('0x9')][_0x455e9f['uniqueid']]['billableseconds']=moment(this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]][_0x908f('0x4f')])['diff'](this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]][_0x908f('0x30')],_0x908f('0x52'));this[_0x908f('0xa')][_0x908f('0x57')]+=this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]][_0x908f('0x56')]||0x0;this['outbound'][_0x908f('0x58')]+=this['channels'][_0x455e9f[_0x908f('0x19')]]['billableseconds'];}this[_0x908f('0xa')]['sumDuration']+=this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]][_0x908f('0x59')];logger[_0x908f('0x18')](_0x908f('0x5a'),_0x455e9f[_0x908f('0x19')],util[_0x908f('0x1a')](this['channels'][_0x455e9f['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x908f('0x5b'),this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]]);logger['debug'](_0x908f('0x5c'),_0x455e9f[_0x908f('0x19')],util[_0x908f('0x1a')](this[_0x908f('0x9')][_0x455e9f['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x908f('0x17')]('custom:dialend',this['channels'][_0x455e9f[_0x908f('0x19')]]);logger[_0x908f('0x18')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x455e9f[_0x908f('0x19')],util[_0x908f('0x1a')](this['channels'][_0x455e9f['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0x908f('0x28'),_0x908f('0x5d'),this[_0x908f('0xa')]);logger[_0x908f('0x32')](_0x908f('0x5e'),JSON['stringify'](this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]]));logger['debug'](_0x908f('0x5f'),_0x455e9f[_0x908f('0x19')],util[_0x908f('0x1a')](this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]],{'showHidden':![],'depth':null}));this[_0x908f('0x17')](_0x908f('0x28'),'voice_outbound_channel:remove',this[_0x908f('0x9')][_0x455e9f[_0x908f('0x19')]]);delete this[_0x908f('0x9')][_0x455e9f['uniqueid']];}else if(this[_0x908f('0x9')][_0x455e9f[_0x908f('0x60')]]){this[_0x908f('0x9')][_0x455e9f[_0x908f('0x60')]][_0x908f('0x19')]=this[_0x908f('0x9')][_0x455e9f[_0x908f('0x60')]][_0x908f('0x61')];}if(this['variables'][_0x455e9f[_0x908f('0x19')]]){delete this['variables'][_0x455e9f['uniqueid']];}}}catch(_0x201f29){logger[_0x908f('0x36')](_0x908f('0x62'),_0x455e9f[_0x908f('0x19')],util['inspect'](_0x201f29,{'showHidden':![],'depth':null}));}};module[_0x908f('0x63')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index cb16af7..3263b7e 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x693f=['uniqueid','format','name','voice_queue_presence:save','emitVoiceQueueChannelRemove','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','strategy','answered','loggedIn','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','Trunk','active','callerid','Interval','debug','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','[voiceQueueReport][queues]','loopQueueSummary','flagQueueSummary','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','available','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','type','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerjoin]','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','syncAgentConnect','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','value','variable','queuestatus','CONTINUE','TIMEOUT','timeout','queuecallerleaveAt','custom:timeout','queueposition','EXITWITHKEY','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','seconds','milliseconds','diff','queuecallercompleteAt','lastevent','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','[%s][voiceQueueReport][blindtransfer]','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','mohtime','[%s][voiceQueueReport][musiconholdstop]','exports','lodash','moment','util','md5','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','queueReports','agents','channels','queueChannels','voiceQueues','campaigns','variables','syncQueueSummary','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','enqueue','isNil','Action','channel','catch','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearqueuereport','emit','emitVoiceQueueChannelSave',']\x20sending\x20voice_queue_channel:save\x20event:'];(function(_0x1ce52,_0x23f160){var _0x12f287=function(_0x3c6ebe){while(--_0x3c6ebe){_0x1ce52['push'](_0x1ce52['shift']());}};_0x12f287(++_0x23f160);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf693('0x0'));var moment=require(_0xf693('0x1'));var util=require(_0xf693('0x2'));var md5=require(_0xf693('0x3'));var Redis=require('ioredis');var config=require(_0xf693('0x4'));var logger=require(_0xf693('0x5'))(_0xf693('0x6'));var ami=require(_0xf693('0x7'));var QueueReport=require(_0xf693('0x8'));config[_0xf693('0x9')]=_[_0xf693('0xa')](config['redis'],{'host':_0xf693('0xb'),'port':0x18eb});var io=require(_0xf693('0xc'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xf693('0xd')]['enqueue']=function(_0x38e78a){this['tail']=this[_0xf693('0xe')]?this[_0xf693('0xe')]['finally'](_0x38e78a):_0x38e78a();};function VoiceQueueReport(_0x4b09d6){this['sequence']=new Sequence();this[_0xf693('0xf')]={};this['agents']=_0x4b09d6[_0xf693('0x10')];this[_0xf693('0x11')]=_0x4b09d6[_0xf693('0x12')];this[_0xf693('0x13')]=_0x4b09d6[_0xf693('0x13')];this['flagQueueSummary']=!![];this['campaigns']=_0x4b09d6[_0xf693('0x14')];this[_0xf693('0x15')]={};ami['on']('queuesummary',this[_0xf693('0x16')][_0xf693('0x17')](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete'][_0xf693('0x17')](this));ami['on'](_0xf693('0x18'),this[_0xf693('0x19')][_0xf693('0x17')](this));ami['on'](_0xf693('0x1a'),this['syncQueueCallerAbandon'][_0xf693('0x17')](this));ami['on'](_0xf693('0x1b'),this[_0xf693('0x1c')][_0xf693('0x17')](this));ami['on'](_0xf693('0x1d'),this[_0xf693('0x1e')]['bind'](this));ami['on']('agentconnect',this['syncAgentConnect'][_0xf693('0x17')](this));ami['on'](_0xf693('0x1f'),this[_0xf693('0x20')][_0xf693('0x17')](this));ami['on'](_0xf693('0x21'),this['syncHangup'][_0xf693('0x17')](this));ami['on'](_0xf693('0x22'),this[_0xf693('0x23')][_0xf693('0x17')](this));ami['on'](_0xf693('0x24'),this[_0xf693('0x25')][_0xf693('0x17')](this));ami['on'](_0xf693('0x26'),this['syncMusicOnHoldStop'][_0xf693('0x17')](this));ami['on'](_0xf693('0x27'),this[_0xf693('0x28')][_0xf693('0x17')](this));ami['on'](_0xf693('0x29'),this[_0xf693('0x2a')][_0xf693('0x17')](this));this['loopQueueSummary']();this[_0xf693('0x2b')]();}function clearChannels(_0x11ff68){if(!_[_0xf693('0x2c')](_0x11ff68)){for(var _0x414a3f in _0x11ff68){if(_0x11ff68['hasOwnProperty'](_0x414a3f)){delete _0x11ff68[_0x414a3f];}}}}function clearCampaigns(_0x950632){if(!_[_0xf693('0x2c')](_0x950632)){for(var _0xe7a396 in _0x950632){if(_0x950632[_0xf693('0x2d')](_0xe7a396)){_0x950632[_0xe7a396][_0xf693('0x2e')]=0x0;}}}}function clearVoiceQueues(_0xbbbf29){if(!_[_0xf693('0x2c')](_0xbbbf29)){for(var _0x423cda in _0xbbbf29){if(_0xbbbf29[_0xf693('0x2d')](_0x423cda)){_0xbbbf29[_0x423cda][_0xf693('0x2e')]=0x0;_0xbbbf29[_0x423cda]['talking']=0x0;_0xbbbf29[_0x423cda][_0xf693('0x2f')]=0x0;_0xbbbf29[_0x423cda][_0xf693('0x30')]=0x0;_0xbbbf29[_0x423cda][_0xf693('0x31')]=!![];}}}}function clearAgentBooked(_0x405f94){if(!_[_0xf693('0x2c')](_0x405f94)){for(var _0x7fdc22 in _0x405f94){if(_0x405f94[_0xf693('0x2d')](_0x7fdc22)){_0x405f94[_0x7fdc22][_0xf693('0x32')]=!![];}}}}VoiceQueueReport['prototype'][_0xf693('0x33')]=function(){var _0x3e6570=this;for(var _0x3580c5 in this[_0xf693('0x11')]){if(this['channels']['hasOwnProperty'](_0x3580c5)&&!this[_0xf693('0x11')][_0x3580c5][_0xf693('0x34')]){this['sequence'][_0xf693('0x35')](function(){if(!_[_0xf693('0x36')](_0x3e6570[_0xf693('0x11')][_0x3580c5])){return ami[_0xf693('0x37')]({'action':'status','channel':_0x3e6570[_0xf693('0x11')][_0x3580c5][_0xf693('0x38')]})[_0xf693('0x39')](function(_0x3a2ced){if(_0x3a2ced[_0xf693('0x3a')]===_0xf693('0x3b')){setTimeout(function(){if(_0x3e6570[_0xf693('0x11')][_0x3580c5]){delete _0x3e6570[_0xf693('0x11')][_0x3580c5];logger['error'](_0xf693('0x3c'),_0x3580c5,util[_0xf693('0x3d')](_0x3a2ced,{'showHidden':![],'depth':null}));}if(_0x3e6570[_0xf693('0xf')][_0x3580c5]){delete _0x3e6570[_0xf693('0xf')][_0x3580c5];logger[_0xf693('0x3e')](_0xf693('0x3f'),_0x3580c5,util['inspect'](_0x3a2ced,{'showHidden':![],'depth':null}));}if(_0x3e6570['variables'][_0x3580c5]){delete _0x3e6570[_0xf693('0x15')][_0x3580c5];logger[_0xf693('0x3e')](_0xf693('0x40'),_0x3580c5,util['inspect'](_0x3a2ced,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x23')]=function(){logger[_0xf693('0x3e')](_0xf693('0x41'));clearChannels(this[_0xf693('0x11')]);this['clearQueueReport'](this[_0xf693('0xf')]);clearAgentBooked(this[_0xf693('0x10')]);clearVoiceQueues(this[_0xf693('0x13')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0xf693('0xd')]['clearQueueReport']=function(_0x424b00){var _0x500df0=this;if(!_[_0xf693('0x2c')](_0x424b00)){for(var _0x111ab6 in _0x424b00){if(_0x424b00[_0xf693('0x2d')](_0x111ab6)){_0x500df0['emitVoiceQueueChannelRemove'](_0x424b00[_0x111ab6],_0xf693('0x42'));delete _0x424b00[_0x111ab6];}}}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x43')]=function(_0x4033ae,_0x3ef95a,_0x24c5d4){io['to'](_0x4033ae)[_0xf693('0x43')](_0x3ef95a,_0x24c5d4);};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x44')]=function(_0x4b9234,_0x244b29){logger['debug']('[%s][voiceQueueReport]['+_0x244b29+_0xf693('0x45'),_0x4b9234[_0xf693('0x46')],util[_0xf693('0x3d')](_0x4b9234,{'showHidden':![],'depth':null}));this['emit'](util[_0xf693('0x47')]('voice:queue:%s',_0x4b9234[_0xf693('0x48')]),'voice_queue_channel:save',_0x4b9234);io[_0xf693('0x43')](_0xf693('0x49'),_0x4b9234);};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x4a')]=function(_0x307bdf,_0x47bc1b){logger['debug']('[%s][voiceQueueReport]['+_0x47bc1b+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x307bdf[_0xf693('0x46')],util[_0xf693('0x3d')](_0x307bdf,{'showHidden':![],'depth':null}));this['emit'](util['format']('voice:queue:%s',_0x307bdf[_0xf693('0x48')]),_0xf693('0x4b'),_0x307bdf);io[_0xf693('0x43')](_0xf693('0x4c'),_0x307bdf);};VoiceQueueReport['prototype'][_0xf693('0x4d')]=function(_0x20323a,_0x24c08c){if(_0x20323a['type']===_0xf693('0x4e')){var _0x41d60a={'id':_0x20323a['id'],'name':_0x20323a['name'],'strategy':_0x20323a[_0xf693('0x4f')],'answered':_0x20323a[_0xf693('0x50')],'available':_0x20323a['available'],'loggedIn':_0x20323a[_0xf693('0x51')],'pTalking':_0x20323a[_0xf693('0x2f')],'sumBillable':_0x20323a['sumBillable'],'sumDuration':_0x20323a[_0xf693('0x52')],'sumHoldTime':_0x20323a[_0xf693('0x53')]||0x0,'talking':_0x20323a[_0xf693('0x54')],'total':_0x20323a[_0xf693('0x55')],'type':_0x20323a['type'],'unmanaged':_0x20323a[_0xf693('0x56')],'abandoned':_0x20323a[_0xf693('0x57')],'waiting':_0x20323a[_0xf693('0x30')]};if(_0x20323a[_0xf693('0x58')]){_0x41d60a[_0xf693('0x58')]={'id':_0x20323a[_0xf693('0x58')]['id'],'name':_0x20323a['Trunk'][_0xf693('0x48')],'active':_0x20323a[_0xf693('0x58')][_0xf693('0x59')],'callerid':_0x20323a[_0xf693('0x58')][_0xf693('0x5a')]};}if(_0x20323a['Interval']){_0x41d60a[_0xf693('0x5b')]={'id':_0x20323a[_0xf693('0x5b')]['id'],'name':_0x20323a['Interval'][_0xf693('0x48')]};}var _0x48189a=md5(JSON['stringify'](_0x41d60a));if(_0x20323a['md5']!==_0x48189a){_0x20323a[_0xf693('0x3')]=_0x48189a;logger[_0xf693('0x5c')](_0xf693('0x5d')+_0x24c08c+_0xf693('0x5e'),util['inspect'](_0x41d60a,{'showHidden':![],'depth':null}));this['emit'](util[_0xf693('0x47')]('voice:queue:%s',_0x41d60a[_0xf693('0x48')]),_0xf693('0x5f'),_0x41d60a);}}};VoiceQueueReport[_0xf693('0xd')]['isNotNull']=function(_0x39bb51){return _0x39bb51!==null&&!_[_0xf693('0x60')](_0x39bb51);};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x2b')]=function(){var _0x150edb=this;setInterval(function(){_0x150edb[_0xf693('0x33')]();ami['Action']({'action':'queues'})[_0xf693('0x39')](function(_0x4c257c){logger['error'](_0xf693('0x61'),util[_0xf693('0x3d')](_0x4c257c,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0xf693('0x62')]=function(){var _0x283918=this;setInterval(function(){if(_0x283918[_0xf693('0x63')]){return ami[_0xf693('0x37')]({'action':'queuesummary'})['then'](function(_0x3717a1){_0x283918[_0xf693('0x63')]=![];})[_0xf693('0x39')](function(_0x3c26a9){logger['error'](_0xf693('0x64'),util[_0xf693('0x3d')](_0x3c26a9,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xf693('0x16')]=function(_0xa59522){try{if(this[_0xf693('0x65')](_0xa59522)&&this[_0xf693('0x65')](_0xa59522[_0xf693('0x66')])){logger[_0xf693('0x5c')](_0xf693('0x67'),util[_0xf693('0x3d')](_0xa59522,{'showHidden':![],'depth':null}));if(this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]]){logger[_0xf693('0x68')](_0xf693('0x69'),_0xa59522['queue']);var _0x46af17=_[_0xf693('0x6a')](this[_0xf693('0x11')],_0xf693('0x66'))[_0xa59522[_0xf693('0x66')]]||0x0;var _0x266161=_0x46af17-_0xa59522[_0xf693('0x6b')];if(this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x30')]!==_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6b')])||this['voiceQueues'][_0xa59522[_0xf693('0x66')]][_0xf693('0x51')]!==_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6d')])||this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x6e')]!==_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6e')])||this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x54')]!==_0x266161){this['voiceQueues'][_0xa59522[_0xf693('0x66')]][_0xf693('0x30')]=_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6b')]);this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]]['loggedIn']=_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6d')]);this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x6e')]=_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6e')]);this['voiceQueues'][_0xa59522['queue']][_0xf693('0x54')]=_0x266161>0x0?_0x266161:0x0;this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x54')]=this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x54')]>_['toNumber'](_0xa59522['loggedin'])?_[_0xf693('0x6c')](_0xa59522['loggedin']):this['voiceQueues'][_0xa59522['queue']][_0xf693('0x54')];this[_0xf693('0x4d')](this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]],'queuesummary');}logger[_0xf693('0x5c')](_0xf693('0x6f'),util[_0xf693('0x3d')](this[_0xf693('0x13')][_0xa59522['queue']],{'showHidden':![],'depth':null}));ami[_0xf693('0x43')](_0xf693('0x70'),this[_0xf693('0x13')][_0xa59522['queue']]);}}}catch(_0x53b9d3){logger[_0xf693('0x3e')](_0xf693('0x64'),util[_0xf693('0x3d')](_0x53b9d3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf693('0x71')]=function(_0x25874d){logger['debug'](_0xf693('0x72'),util[_0xf693('0x3d')](_0x25874d,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x19')]=function(_0x347fa4){try{if(this['isNotNull'](_0x347fa4)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x347fa4[_0xf693('0x46')],util['inspect'](_0x347fa4,{'showHidden':![],'depth':null}));if(_[_0xf693('0x60')](this[_0xf693('0xf')][_0x347fa4[_0xf693('0x46')]])){this[_0xf693('0xf')][_0x347fa4[_0xf693('0x46')]]=[];this[_0xf693('0x11')][_0x347fa4[_0xf693('0x46')]]={};}var _0x1dcf87=new QueueReport();_0x1dcf87[_0xf693('0x48')]=_0x347fa4[_0xf693('0x66')];_0x1dcf87[_0xf693('0x73')]=this[_0xf693('0x13')][_0x1dcf87[_0xf693('0x48')]]&&this[_0xf693('0x13')][_0x1dcf87[_0xf693('0x48')]][_0xf693('0x73')]?this[_0xf693('0x13')][_0x1dcf87[_0xf693('0x48')]][_0xf693('0x73')]||_0xf693('0x4e'):_0xf693('0x4e');_0x1dcf87[_0xf693('0x66')]=_0x347fa4[_0xf693('0x66')];_0x1dcf87[_0xf693('0x74')]=moment()[_0xf693('0x47')](_0xf693('0x75'));_0x1dcf87[_0xf693('0x76')]=_0x347fa4[_0xf693('0x76')];_0x1dcf87['count']=_0x347fa4[_0xf693('0x77')];_0x1dcf87['uniqueid']=_0x347fa4[_0xf693('0x46')];logger[_0xf693('0x68')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x1dcf87['name'],_0x1dcf87[_0xf693('0x73')]);_[_0xf693('0x78')](_0x1dcf87,_[_0xf693('0x79')](_0x347fa4,_[_0xf693('0x7a')](_0x1dcf87)));this[_0xf693('0xf')][_0x347fa4[_0xf693('0x46')]][_0xf693('0x7b')](_0x1dcf87);this['channels'][_0x347fa4['uniqueid']]=_0x1dcf87;this[_0xf693('0x44')](_0x1dcf87,_0xf693('0x18'));}}catch(_0x2e5711){logger[_0xf693('0x3e')](_0xf693('0x7c'),_0x347fa4[_0xf693('0x46')],util[_0xf693('0x3d')](_0x2e5711,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x7d')]=function(_0x7c960d){try{if(this[_0xf693('0x65')](_0x7c960d)){logger['debug'](_0xf693('0x7e'),_0x7c960d[_0xf693('0x46')],util['inspect'](_0x7c960d,{'showHidden':![],'depth':null}));if(this[_0xf693('0xf')][_0x7c960d[_0xf693('0x46')]]){var _0x1050a3=_[_0xf693('0x7f')](this['queueReports'][_0x7c960d[_0xf693('0x46')]]);_0x1050a3[_0xf693('0x80')]=![];_0x1050a3['queuecallercompleteAt']=null;_0x1050a3['holdtime']=_0x7c960d[_0xf693('0x81')];_0x1050a3[_0xf693('0x82')]=_0x7c960d[_0xf693('0x82')];_0x1050a3[_0xf693('0x1a')]=!![];_0x1050a3[_0xf693('0x83')]=moment()[_0xf693('0x47')](_0xf693('0x75'));_0x1050a3[_0xf693('0x84')]=_0xf693('0x85');_0x1050a3[_0xf693('0x86')]=null;logger[_0xf693('0x68')](_0xf693('0x87'),_0x1050a3[_0xf693('0x48')],_0x1050a3[_0xf693('0x73')]);this[_0xf693('0x11')][_0x7c960d[_0xf693('0x46')]]=_0x1050a3;this[_0xf693('0x4a')](_0x1050a3,_0xf693('0x1a'));}}}catch(_0x5b5d04){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x7c960d[_0xf693('0x46')],util[_0xf693('0x3d')](_0x5b5d04,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf693('0x1c')]=function(_0x5c6cd7){try{if(this[_0xf693('0x65')](_0x5c6cd7)){logger[_0xf693('0x5c')](_0xf693('0x88'),_0x5c6cd7[_0xf693('0x46')],util[_0xf693('0x3d')](_0x5c6cd7,{'showHidden':![],'depth':null}));if(this[_0xf693('0xf')][_0x5c6cd7[_0xf693('0x46')]]){var _0x2f316c=_[_0xf693('0x7f')](this['queueReports'][_0x5c6cd7['uniqueid']]);_0x2f316c['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2f316c[_0xf693('0x89')]=_0x5c6cd7[_0xf693('0x89')];_0x2f316c['connectedlinename']=_0x5c6cd7[_0xf693('0x8a')];logger[_0xf693('0x68')](_0xf693('0x8b'),_0x2f316c[_0xf693('0x48')],_0x2f316c[_0xf693('0x73')],_0x5c6cd7[_0xf693('0x89')],_0x5c6cd7[_0xf693('0x8a')]);this['channels'][_0x5c6cd7[_0xf693('0x46')]]=_0x2f316c;this[_0xf693('0x44')](_0x2f316c,_0xf693('0x1b'));}}}catch(_0x39c642){logger[_0xf693('0x3e')](_0xf693('0x88'),_0x5c6cd7[_0xf693('0x46')],util[_0xf693('0x3d')](_0x39c642,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf693('0x8c')]=function(_0x4e584d){try{if(this['isNotNull'](_0x4e584d)){logger[_0xf693('0x5c')]('[%s][voiceQueueReport][agentconnect]',_0x4e584d[_0xf693('0x46')],util[_0xf693('0x3d')](_0x4e584d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4e584d[_0xf693('0x46')]]){var _0x34ecdc=_['last'](this['queueReports'][_0x4e584d[_0xf693('0x46')]]);_0x34ecdc[_0xf693('0x80')]=!![];_0x34ecdc['queuecallerexitreason']=_0xf693('0x8d');logger['info'](_0xf693('0x8e'),_0x34ecdc[_0xf693('0x48')],_0x34ecdc[_0xf693('0x73')]);}}}catch(_0x18870b){logger[_0xf693('0x3e')]('[%s][voiceQueueReport][agentconnect]',_0x4e584d['uniqueid'],util['inspect'](_0x18870b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x1e')]=function(_0x2c14c2){try{if(this[_0xf693('0x65')](_0x2c14c2)){logger[_0xf693('0x5c')](_0xf693('0x8f'),_0x2c14c2[_0xf693('0x46')],util[_0xf693('0x3d')](_0x2c14c2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2c14c2['uniqueid']]){var _0x4a3919=_[_0xf693('0x7f')](this[_0xf693('0xf')][_0x2c14c2[_0xf693('0x46')]]);_0x4a3919['queuecallerabandon']=![];_0x4a3919['queuecallerabandonAt']=null;_0x4a3919['assigned']=!![];_0x4a3919['lastAssignedTo']=_0x2c14c2['membername'];_0x4a3919[_0xf693('0x81')]=_0x2c14c2[_0xf693('0x81')];_0x4a3919['queuecallercomplete']=!![];_0x4a3919[_0xf693('0x90')]=![];_0x4a3919[_0xf693('0x91')]=null;if(!_0x4a3919[_0xf693('0x92')]){if(_0x2c14c2[_0xf693('0x93')]==_0xf693('0x92')){_0x4a3919[_0xf693('0x84')]=_0xf693('0x94');logger[_0xf693('0x68')](_0xf693('0x95'),_0x4a3919[_0xf693('0x48')],_0x4a3919[_0xf693('0x73')]);}else{if(_[_0xf693('0x96')](_0x2c14c2[_0xf693('0x38')][_0xf693('0x97')](),_0xf693('0x98'))){if(this[_0xf693('0xf')][_0x2c14c2[_0xf693('0x99')]]){var _0x1256b8=_['last'](this[_0xf693('0xf')][_0x2c14c2[_0xf693('0x99')]]);_0x1256b8[_0xf693('0x80')]=![];_0x1256b8[_0xf693('0x90')]=!![];_0x1256b8['queuecallerexitAt']=moment(_0x4a3919[_0xf693('0x74')])['add'](_0x2c14c2[_0xf693('0x81')],'seconds')[_0xf693('0x47')](_0xf693('0x75'));_0x1256b8[_0xf693('0x84')]=_0xf693('0x9a');_0x1256b8['transfer']=!![];_0x1256b8[_0xf693('0x9b')]=_0xf693('0x9c');_0x1256b8[_0xf693('0x9d')]=_0x2c14c2[_0xf693('0x9e')];_0x1256b8[_0xf693('0x9f')]=_0x2c14c2['uniqueid'];logger[_0xf693('0x68')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x1256b8['name'],_0x1256b8['type']);var _0x48561b=this['queueReports'][_0x2c14c2[_0xf693('0x99')]];this[_0xf693('0xf')][_0x2c14c2[_0xf693('0x99')]]=this[_0xf693('0xf')][_0x2c14c2['uniqueid']];this['queueReports'][_0x2c14c2['uniqueid']]=_0x48561b;}}else{_0x4a3919[_0xf693('0x84')]=_0xf693('0xa0')+_0x2c14c2[_0xf693('0x93')][_0xf693('0xa1')]();logger[_0xf693('0x68')](_0xf693('0xa2'),_0x4a3919['name'],_0x4a3919[_0xf693('0x73')],_0x4a3919[_0xf693('0x84')]);}}}this[_0xf693('0x11')][_0x2c14c2[_0xf693('0x46')]]=_0x4a3919;this[_0xf693('0x4a')](_0x4a3919,'agentcomplete');}}}catch(_0x20b687){logger[_0xf693('0x3e')](_0xf693('0x8f'),_0x2c14c2[_0xf693('0x46')],util[_0xf693('0x3d')](_0x20b687,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x20')]=function(_0x23489d){try{if(this[_0xf693('0x65')](_0x23489d)){logger['debug'](_0xf693('0xa3'),_0x23489d['uniqueid'],util[_0xf693('0x3d')](_0x23489d,{'showHidden':![],'depth':null}));this[_0xf693('0xa4')](_0x23489d[_0xf693('0x46')],_['keys'](_0x23489d['variable'])[0x0],_0x23489d[_0xf693('0xa5')]);if(this[_0xf693('0xf')][_0x23489d['uniqueid']]){var _0x1b5981=_[_0xf693('0x7f')](this[_0xf693('0xf')][_0x23489d['uniqueid']]);if(_0x1b5981){if(this[_0xf693('0x65')](_0x23489d[_0xf693('0xa6')])&&this[_0xf693('0x65')](_0x23489d['variable'][_0xf693('0xa7')])){switch(_0x23489d[_0xf693('0xa5')]){case _0xf693('0xa8'):_0x1b5981['queuecallerexit']=![];_0x1b5981['queuecallerexitAt']=null;break;case _0xf693('0xa9'):_0x1b5981['lastevent']=_0xf693('0xaa');_0x1b5981[_0xf693('0x90')]=!![];_0x1b5981['queuecallerexitAt']=moment()[_0xf693('0x47')](_0xf693('0x75'));_0x1b5981[_0xf693('0xab')]=moment()[_0xf693('0x47')](_0xf693('0x75'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x23489d[_0xf693('0x46')],util['inspect'](_0x1b5981,{'showHidden':![],'depth':null}));ami[_0xf693('0x43')](_0xf693('0xac'),_0x1b5981);break;default:_0x1b5981['queuecallerexit']=!![];_0x1b5981[_0xf693('0x91')]=moment()[_0xf693('0x47')](_0xf693('0x75'));_0x1b5981[_0xf693('0xab')]=moment()[_0xf693('0x47')](_0xf693('0x75'));}_0x1b5981['queuecallerabandon']=![];_0x1b5981['queuecallerabandonAt']=null;_0x1b5981['queuecallerexitreason']=_0x23489d[_0xf693('0xa5')];this[_0xf693('0x11')][_0x23489d[_0xf693('0x46')]]=_0x1b5981;this[_0xf693('0x4a')](_0x1b5981,_0xf693('0x1f'));}else if(this[_0xf693('0x65')](_0x23489d[_0xf693('0xa6')])&&this[_0xf693('0x65')](_0x23489d[_0xf693('0xa6')][_0xf693('0xad')])){if(!_0x1b5981['queuecallerabandon']){_0x1b5981['queuecallerexit']=!![];_0x1b5981['queuecallerexitAt']=moment()['format'](_0xf693('0x75'));_0x1b5981[_0xf693('0x84')]=_0xf693('0xae');_0x1b5981[_0xf693('0xab')]=moment()[_0xf693('0x47')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf693('0x11')][_0x23489d[_0xf693('0x46')]]=_0x1b5981;}}logger[_0xf693('0x68')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x23489d[_0xf693('0x46')],_0x1b5981['name'],_0x1b5981['type'],_['keys'](_0x23489d[_0xf693('0xa6')])[0x0],_0x23489d[_0xf693('0xa5')]);_0x1b5981[_0xf693('0x15')]=this[_0xf693('0x15')][_0x23489d[_0xf693('0x46')]];}}}}catch(_0x4a61e){logger[_0xf693('0x3e')](_0xf693('0xa3'),_0x23489d[_0xf693('0x46')],util['inspect'](_0x4a61e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf693('0xa4')]=function(_0x2e4088,_0x27ce3d,_0xe84196){var _0x18784b=[_0xf693('0xaf'),_0xf693('0xb0'),_0xf693('0xb1'),_0xf693('0xb2'),_0xf693('0xb3'),_0xf693('0xb4'),_0xf693('0xb5'),_0xf693('0xb6'),_0xf693('0xb7'),'sipuri',_0xf693('0xb8'),_0xf693('0xb9'),'membercalls',_0xf693('0xba'),_0xf693('0xbb'),_0xf693('0xbc'),'membername',_0xf693('0xbd'),_0xf693('0xbe')];if(!_[_0xf693('0x36')](_0x27ce3d)&&!_[_0xf693('0xbf')](_0x18784b,_0x27ce3d)){if(_[_0xf693('0x60')](this[_0xf693('0x15')][_0x2e4088])){this[_0xf693('0x15')][_0x2e4088]={};}this[_0xf693('0x15')][_0x2e4088][_0x27ce3d]=_0xe84196;}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0xc0')]=function(_0xf09d5){try{if(this['isNotNull'](_0xf09d5)){logger[_0xf693('0x5c')](_0xf693('0xc1'),_0xf09d5['uniqueid'],util[_0xf693('0x3d')](_0xf09d5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xf09d5[_0xf693('0x46')]]){for(var _0x2d1287=0x0,_0x1fcfdf={};_0x2d12870x0?_0x5795c7:0x0;this[_0x3448('0x15')][_0x363723[_0x3448('0x65')]]['talking']=this['voiceQueues'][_0x363723[_0x3448('0x65')]]['talking']>_['toNumber'](_0x363723[_0x3448('0x6d')])?_[_0x3448('0x6b')](_0x363723['loggedin']):this['voiceQueues'][_0x363723[_0x3448('0x65')]][_0x3448('0x2e')];this[_0x3448('0x4f')](this[_0x3448('0x15')][_0x363723[_0x3448('0x65')]],_0x3448('0x17'));}logger[_0x3448('0x44')](_0x3448('0x6e'),util[_0x3448('0x3b')](this[_0x3448('0x15')][_0x363723[_0x3448('0x65')]],{'showHidden':![],'depth':null}));ami[_0x3448('0x42')](_0x3448('0x6f'),this[_0x3448('0x15')][_0x363723['queue']]);}}}catch(_0x18c449){logger[_0x3448('0x39')]('[voiceQueueReport][queuesummary]',util[_0x3448('0x3b')](_0x18c449,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3448('0xc')]['syncQueueSummaryComplete']=function(_0x374cef){logger[_0x3448('0x44')](_0x3448('0x70'),util['inspect'](_0x374cef,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x3448('0xc')]['syncQueueCallerJoin']=function(_0x31dfc5){try{if(this[_0x3448('0x61')](_0x31dfc5)){logger[_0x3448('0x44')]('[%s][voiceQueueReport][queuecallerjoin]',_0x31dfc5[_0x3448('0x47')],util[_0x3448('0x3b')](_0x31dfc5,{'showHidden':![],'depth':null}));if(_[_0x3448('0x71')](this['queueReports'][_0x31dfc5['uniqueid']])){this[_0x3448('0x11')][_0x31dfc5[_0x3448('0x47')]]=[];this[_0x3448('0x13')][_0x31dfc5[_0x3448('0x47')]]={};}var _0x29dd31=new QueueReport();_0x29dd31[_0x3448('0x4a')]=_0x31dfc5['queue'];_0x29dd31[_0x3448('0x57')]=this['voiceQueues'][_0x29dd31[_0x3448('0x4a')]]&&this[_0x3448('0x15')][_0x29dd31['name']][_0x3448('0x57')]?this[_0x3448('0x15')][_0x29dd31['name']]['type']||_0x3448('0x50'):_0x3448('0x50');_0x29dd31[_0x3448('0x65')]=_0x31dfc5[_0x3448('0x65')];_0x29dd31[_0x3448('0x72')]=moment()[_0x3448('0x48')](_0x3448('0x73'));_0x29dd31[_0x3448('0x74')]=_0x31dfc5[_0x3448('0x74')];_0x29dd31[_0x3448('0x75')]=_0x31dfc5[_0x3448('0x75')];_0x29dd31[_0x3448('0x47')]=_0x31dfc5[_0x3448('0x47')];logger[_0x3448('0x67')](_0x3448('0x76'),_0x29dd31[_0x3448('0x4a')],_0x29dd31['type']);_['merge'](_0x29dd31,_[_0x3448('0x77')](_0x31dfc5,_['keys'](_0x29dd31)));this[_0x3448('0x11')][_0x31dfc5[_0x3448('0x47')]]['push'](_0x29dd31);this[_0x3448('0x13')][_0x31dfc5['uniqueid']]=_0x29dd31;this[_0x3448('0x43')](_0x29dd31,_0x3448('0x78'));}}catch(_0x2dbd3c){logger[_0x3448('0x39')](_0x3448('0x79'),_0x31dfc5['uniqueid'],util[_0x3448('0x3b')](_0x2dbd3c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3448('0xc')][_0x3448('0x7a')]=function(_0x4aad6d){try{if(this[_0x3448('0x61')](_0x4aad6d)){logger[_0x3448('0x44')](_0x3448('0x7b'),_0x4aad6d['uniqueid'],util[_0x3448('0x3b')](_0x4aad6d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4aad6d['uniqueid']]){var _0x395fd5=_['last'](this[_0x3448('0x11')][_0x4aad6d['uniqueid']]);_0x395fd5[_0x3448('0x7c')]=![];_0x395fd5[_0x3448('0x7d')]=null;_0x395fd5['holdtime']=_0x4aad6d['holdtime'];_0x395fd5[_0x3448('0x7e')]=_0x4aad6d[_0x3448('0x7e')];_0x395fd5['queuecallerabandon']=!![];_0x395fd5[_0x3448('0x7f')]=moment()[_0x3448('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x395fd5[_0x3448('0x80')]=_0x3448('0x81');_0x395fd5[_0x3448('0x82')]=null;logger[_0x3448('0x67')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x395fd5[_0x3448('0x4a')],_0x395fd5['type']);this[_0x3448('0x13')][_0x4aad6d['uniqueid']]=_0x395fd5;this[_0x3448('0x83')](_0x395fd5,_0x3448('0x1c'));}}}catch(_0x4117da){logger['error'](_0x3448('0x7b'),_0x4aad6d[_0x3448('0x47')],util['inspect'](_0x4117da,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3448('0xc')]['syncQueueCallerLeave']=function(_0x520950){try{if(this[_0x3448('0x61')](_0x520950)){logger['debug'](_0x3448('0x84'),_0x520950[_0x3448('0x47')],util[_0x3448('0x3b')](_0x520950,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x520950[_0x3448('0x47')]]){var _0x716797=_[_0x3448('0x85')](this[_0x3448('0x11')][_0x520950[_0x3448('0x47')]]);_0x716797[_0x3448('0x86')]=moment()[_0x3448('0x48')](_0x3448('0x73'));_0x716797[_0x3448('0x87')]=_0x520950[_0x3448('0x87')];_0x716797[_0x3448('0x88')]=_0x520950[_0x3448('0x88')];logger[_0x3448('0x67')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x716797['name'],_0x716797['type'],_0x520950[_0x3448('0x87')],_0x520950['connectedlinename']);this['channels'][_0x520950[_0x3448('0x47')]]=_0x716797;this[_0x3448('0x43')](_0x716797,_0x3448('0x1d'));}}}catch(_0x94d13f){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x520950[_0x3448('0x47')],util[_0x3448('0x3b')](_0x94d13f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3448('0xc')]['syncAgentConnect']=function(_0x2f2773){try{if(this[_0x3448('0x61')](_0x2f2773)){logger[_0x3448('0x44')](_0x3448('0x89'),_0x2f2773['uniqueid'],util[_0x3448('0x3b')](_0x2f2773,{'showHidden':![],'depth':null}));if(this[_0x3448('0x11')][_0x2f2773['uniqueid']]){var _0x4f535c=_[_0x3448('0x85')](this[_0x3448('0x11')][_0x2f2773[_0x3448('0x47')]]);_0x4f535c['queuecallercomplete']=!![];_0x4f535c[_0x3448('0x80')]=_0x3448('0x8a');logger[_0x3448('0x67')](_0x3448('0x8b'),_0x4f535c['name'],_0x4f535c[_0x3448('0x57')]);}}}catch(_0x4092c9){logger['error'](_0x3448('0x89'),_0x2f2773[_0x3448('0x47')],util['inspect'](_0x4092c9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3448('0x20')]=function(_0xaef9d5){try{if(this[_0x3448('0x61')](_0xaef9d5)){logger[_0x3448('0x44')](_0x3448('0x8c'),_0xaef9d5[_0x3448('0x47')],util[_0x3448('0x3b')](_0xaef9d5,{'showHidden':![],'depth':null}));if(this[_0x3448('0x11')][_0xaef9d5[_0x3448('0x47')]]){var _0x392d92=_['last'](this[_0x3448('0x11')][_0xaef9d5['uniqueid']]);_0x392d92[_0x3448('0x1c')]=![];_0x392d92['queuecallerabandonAt']=null;_0x392d92[_0x3448('0x8d')]=!![];_0x392d92[_0x3448('0x82')]=_0xaef9d5['membername'];_0x392d92['holdtime']=_0xaef9d5['holdtime'];_0x392d92[_0x3448('0x7c')]=!![];_0x392d92[_0x3448('0x8e')]=![];_0x392d92[_0x3448('0x8f')]=null;if(!_0x392d92['transfer']){if(_0xaef9d5[_0x3448('0x90')]==_0x3448('0x91')){_0x392d92['queuecallerexitreason']='COMPLETED';logger[_0x3448('0x67')](_0x3448('0x92'),_0x392d92[_0x3448('0x4a')],_0x392d92[_0x3448('0x57')]);}else{if(_[_0x3448('0x93')](_0xaef9d5[_0x3448('0x35')][_0x3448('0x94')](),_0x3448('0x95'))){if(this[_0x3448('0x11')][_0xaef9d5['linkedid']]){var _0x54c1e5=_[_0x3448('0x85')](this['queueReports'][_0xaef9d5[_0x3448('0x96')]]);_0x54c1e5['queuecallercomplete']=![];_0x54c1e5[_0x3448('0x8e')]=!![];_0x54c1e5[_0x3448('0x8f')]=moment(_0x392d92['queuecallerjoinAt'])[_0x3448('0x97')](_0xaef9d5[_0x3448('0x98')],_0x3448('0x99'))[_0x3448('0x48')](_0x3448('0x73'));_0x54c1e5[_0x3448('0x80')]=_0x3448('0x9a');_0x54c1e5[_0x3448('0x91')]=!![];_0x54c1e5[_0x3448('0x9b')]=_0x3448('0x9c');_0x54c1e5[_0x3448('0x9d')]=_0xaef9d5['destexten'];_0x54c1e5[_0x3448('0x9e')]=_0xaef9d5[_0x3448('0x47')];logger[_0x3448('0x67')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x54c1e5[_0x3448('0x4a')],_0x54c1e5[_0x3448('0x57')]);var _0xc22ef9=this[_0x3448('0x11')][_0xaef9d5[_0x3448('0x96')]];this[_0x3448('0x11')][_0xaef9d5['linkedid']]=this['queueReports'][_0xaef9d5[_0x3448('0x47')]];this[_0x3448('0x11')][_0xaef9d5[_0x3448('0x47')]]=_0xc22ef9;}}else{_0x392d92[_0x3448('0x80')]=_0x3448('0x9f')+_0xaef9d5[_0x3448('0x90')][_0x3448('0xa0')]();logger[_0x3448('0x67')](_0x3448('0xa1'),_0x392d92[_0x3448('0x4a')],_0x392d92[_0x3448('0x57')],_0x392d92[_0x3448('0x80')]);}}}this[_0x3448('0x13')][_0xaef9d5[_0x3448('0x47')]]=_0x392d92;this['emitVoiceQueueChannelRemove'](_0x392d92,'agentcomplete');}}}catch(_0x5039fa){logger[_0x3448('0x39')](_0x3448('0x8c'),_0xaef9d5[_0x3448('0x47')],util[_0x3448('0x3b')](_0x5039fa,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3448('0xa2')]=function(_0x5809bf){try{if(this[_0x3448('0x61')](_0x5809bf)){logger['debug'](_0x3448('0xa3'),_0x5809bf['uniqueid'],util[_0x3448('0x3b')](_0x5809bf,{'showHidden':![],'depth':null}));this[_0x3448('0xa4')](_0x5809bf[_0x3448('0x47')],_[_0x3448('0xa5')](_0x5809bf[_0x3448('0xa6')])[0x0],_0x5809bf[_0x3448('0xa7')]);if(this[_0x3448('0x11')][_0x5809bf[_0x3448('0x47')]]){var _0x29e00b=_['last'](this['queueReports'][_0x5809bf[_0x3448('0x47')]]);if(_0x29e00b){if(this[_0x3448('0x61')](_0x5809bf[_0x3448('0xa6')])&&this[_0x3448('0x61')](_0x5809bf['variable'][_0x3448('0xa8')])){switch(_0x5809bf[_0x3448('0xa7')]){case _0x3448('0xa9'):_0x29e00b['queuecallerexit']=![];_0x29e00b[_0x3448('0x8f')]=null;break;case'TIMEOUT':_0x29e00b[_0x3448('0xaa')]=_0x3448('0xab');_0x29e00b[_0x3448('0x8e')]=!![];_0x29e00b['queuecallerexitAt']=moment()[_0x3448('0x48')](_0x3448('0x73'));_0x29e00b[_0x3448('0x86')]=moment()[_0x3448('0x48')](_0x3448('0x73'));logger[_0x3448('0x44')](_0x3448('0xac'),_0x5809bf[_0x3448('0x47')],util[_0x3448('0x3b')](_0x29e00b,{'showHidden':![],'depth':null}));ami[_0x3448('0x42')](_0x3448('0xad'),_0x29e00b);break;default:_0x29e00b[_0x3448('0x8e')]=!![];_0x29e00b[_0x3448('0x8f')]=moment()[_0x3448('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x29e00b['queuecallerleaveAt']=moment()[_0x3448('0x48')](_0x3448('0x73'));}_0x29e00b[_0x3448('0x1c')]=![];_0x29e00b['queuecallerabandonAt']=null;_0x29e00b['queuecallerexitreason']=_0x5809bf[_0x3448('0xa7')];this[_0x3448('0x13')][_0x5809bf[_0x3448('0x47')]]=_0x29e00b;this[_0x3448('0x83')](_0x29e00b,_0x3448('0xae'));}else if(this[_0x3448('0x61')](_0x5809bf[_0x3448('0xa6')])&&this[_0x3448('0x61')](_0x5809bf[_0x3448('0xa6')][_0x3448('0xaf')])){if(!_0x29e00b[_0x3448('0x1c')]){_0x29e00b[_0x3448('0x8e')]=!![];_0x29e00b['queuecallerexitAt']=moment()[_0x3448('0x48')](_0x3448('0x73'));_0x29e00b[_0x3448('0x80')]=_0x3448('0xb0');_0x29e00b[_0x3448('0x86')]=moment()[_0x3448('0x48')](_0x3448('0x73'));this[_0x3448('0x13')][_0x5809bf[_0x3448('0x47')]]=_0x29e00b;}}logger[_0x3448('0x67')](_0x3448('0xb1'),_0x5809bf[_0x3448('0x47')],_0x29e00b['name'],_0x29e00b['type'],_[_0x3448('0xa5')](_0x5809bf[_0x3448('0xa6')])[0x0],_0x5809bf[_0x3448('0xa7')]);_0x29e00b['variables']=this[_0x3448('0x3d')][_0x5809bf[_0x3448('0x47')]];}}}}catch(_0xb54ad0){logger['error']('[%s][voiceQueueReport][varset]',_0x5809bf[_0x3448('0x47')],util[_0x3448('0x3b')](_0xb54ad0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3448('0xc')][_0x3448('0xa4')]=function(_0xf77f3a,_0x2d47eb,_0xc9dac9){var _0x126b14=[_0x3448('0xb2'),_0x3448('0xb3'),_0x3448('0xb4'),_0x3448('0xb5'),_0x3448('0xb6'),_0x3448('0xb7'),'rtpaudioqosrtt',_0x3448('0xb8'),_0x3448('0xb9'),'sipuri',_0x3448('0xba'),_0x3448('0xbb'),_0x3448('0xbc'),_0x3448('0xbd'),_0x3448('0xbe'),_0x3448('0xbf'),'membername',_0x3448('0xc0'),_0x3448('0xc1')];if(!_[_0x3448('0x33')](_0x2d47eb)&&!_['includes'](_0x126b14,_0x2d47eb)){if(_['isUndefined'](this[_0x3448('0x3d')][_0xf77f3a])){this[_0x3448('0x3d')][_0xf77f3a]={};}this[_0x3448('0x3d')][_0xf77f3a][_0x2d47eb]=_0xc9dac9;}};VoiceQueueReport[_0x3448('0xc')][_0x3448('0x23')]=function(_0x1e505d){try{if(this[_0x3448('0x61')](_0x1e505d)){logger[_0x3448('0x44')](_0x3448('0xc2'),_0x1e505d['uniqueid'],util[_0x3448('0x3b')](_0x1e505d,{'showHidden':![],'depth':null}));if(this[_0x3448('0x11')][_0x1e505d[_0x3448('0x47')]]){for(var _0x36d196=0x0,_0x40214d={};_0x36d196=0x0?moment(_0x3820af['endtime'])[_0xae35('0x1b')](_0x3820af[_0xae35('0x19')],_0xae35('0x1c')):null,'data1':_0xae35('0x1d'),'data2':_0x3820af[_0xae35('0x12')],'data3':_0x3820af[_0xae35('0x10')],'data4':_0x3820af[_0xae35('0x1e')]||null,'role':_0xae35('0x11'),'internal':_0x3820af[_0xae35('0x12')]?_['toNumber'](_0x3820af['accountcode']):undefined,'uniqueid':_0x3820af['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xfe17=['membername','TALKING','starttime','endtime','seconds','outbound','dialstring','lodash','util','queuecallercompleteAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','queuecallerleaveAt','diff','inbound','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport'];(function(_0x5535f7,_0x16e16c){var _0x4c5ffe=function(_0x5688ab){while(--_0x5688ab){_0x5535f7['push'](_0x5535f7['shift']());}};_0x4c5ffe(++_0x16e16c);}(_0xfe17,0x1c1));var _0x7fe1=function(_0x23da17,_0x4b2aff){_0x23da17=_0x23da17-0x0;var _0x1ea689=_0xfe17[_0x23da17];return _0x1ea689;};'use strict';var moment=require('moment');var _=require(_0x7fe1('0x0'));var util=require(_0x7fe1('0x1'));var client=require('../client');exports['voiceQueueReport']=function(_0x151dc4){var _0x2eb768=_0x151dc4[_0x7fe1('0x2')]||_0x151dc4['queuecallerexitAt'];return client[_0x7fe1('0x3')](_0x7fe1('0x4'),{'body':{'channel':_0x7fe1('0x5'),'membername':_0x151dc4[_0x7fe1('0x6')],'interface':_[_0x7fe1('0x7')](_0x151dc4[_0x7fe1('0x8')])?util[_0x7fe1('0x9')]('SIP/%s',_0x151dc4[_0x7fe1('0x6')]):_0x151dc4[_0x7fe1('0x8')],'type':'TALKING','enterAt':_0x151dc4[_0x7fe1('0xa')],'exitAt':_0x2eb768,'duration':moment(_0x2eb768)[_0x7fe1('0xb')](_0x151dc4['queuecallerleaveAt'],'seconds'),'data1':_0x7fe1('0xc'),'data2':_0x151dc4['calleridnum'],'data3':_0x151dc4['exten'],'data4':null,'data5':_0x151dc4[_0x7fe1('0xd')],'role':_0x7fe1('0xe'),'internal':_0x151dc4[_0x7fe1('0xf')]?_[_0x7fe1('0x10')](_0x151dc4[_0x7fe1('0xf')]):undefined,'uniqueid':_0x151dc4[_0x7fe1('0x11')]},'log':_0x7fe1('0x4')});};exports[_0x7fe1('0x12')]=function(_0x455b74){return client[_0x7fe1('0x3')]('CreateMemberReport',{'body':{'channel':_0x7fe1('0x5'),'membername':_0x455b74[_0x7fe1('0x13')],'interface':_0x455b74['interface'],'type':_0x7fe1('0x14'),'enterAt':_0x455b74[_0x7fe1('0x15')],'exitAt':_0x455b74[_0x7fe1('0x16')],'duration':moment(_0x455b74[_0x7fe1('0x16')])[_0x7fe1('0xb')](_0x455b74['starttime'],'seconds')>=0x0?moment(_0x455b74[_0x7fe1('0x16')])['diff'](_0x455b74[_0x7fe1('0x15')],_0x7fe1('0x17')):null,'data1':_0x7fe1('0x18'),'data2':_0x455b74['accountcode'],'data3':_0x455b74['exten'],'data4':_0x455b74[_0x7fe1('0x19')]||null,'role':'agent','internal':_0x455b74[_0x7fe1('0xf')]?_[_0x7fe1('0x10')](_0x455b74[_0x7fe1('0xf')]):undefined,'uniqueid':_0x455b74[_0x7fe1('0x11')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 44f63d0..a8ede3d 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 _0xbb53=['GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x2b8ffd,_0x517b31){var _0x3324f3=function(_0x332226){while(--_0x332226){_0x2b8ffd['push'](_0x2b8ffd['shift']());}};_0x3324f3(++_0x517b31);}(_0xbb53,0x121));var _0x3bb5=function(_0x48bd3f,_0x4242b5){_0x48bd3f=_0x48bd3f-0x0;var _0x591eb0=_0xbb53[_0x48bd3f];return _0x591eb0;};'use strict';var client=require(_0x3bb5('0x0'));exports[_0x3bb5('0x1')]=function(){return client[_0x3bb5('0x2')](_0x3bb5('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3bb5('0x4')]},'log':_0x3bb5('0x5')});}; \ No newline at end of file +var _0x9c44=['Request','ShowSetting','stopRecordingOnTransfer','GetSettings'];(function(_0x2f2c0c,_0x3bd7ae){var _0x2fe8d5=function(_0x1a2850){while(--_0x1a2850){_0x2f2c0c['push'](_0x2f2c0c['shift']());}};_0x2fe8d5(++_0x3bd7ae);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x49c4('0x2')]},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 3328fb9..7a3ccf0 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 _0x1be1=['GetTemplate','name','html'];(function(_0x6b67c,_0xe3e585){var _0x5013a9=function(_0xf31716){while(--_0xf31716){_0x6b67c['push'](_0x6b67c['shift']());}};_0x5013a9(++_0xe3e585);}(_0x1be1,0x192));var _0x11be=function(_0x199ab0,_0x5076e9){_0x199ab0=_0x199ab0-0x0;var _0x546f9f=_0x1be1[_0x199ab0];return _0x546f9f;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x3d5d4e){return function(_0x33a55d){return client['Request'](_0x11be('0x0'),{'options':{'raw':!![],'attributes':['id',_0x11be('0x1'),_0x11be('0x2')]},'log':_0x11be('0x0')});};}; \ No newline at end of file +var _0x1b32=['GetTemplate','name','html','getTemplates','Request'];(function(_0x508511,_0x3a4919){var _0x7a07ee=function(_0xf9e568){while(--_0xf9e568){_0x508511['push'](_0x508511['shift']());}};_0x7a07ee(++_0x3a4919);}(_0x1b32,0x85));var _0x21b3=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x1b32[_0x5f0089];return _0x193892;};'use strict';var client=require('../client');exports[_0x21b3('0x0')]=function(_0xd03c78){return function(_0x22122d){return client[_0x21b3('0x1')](_0x21b3('0x2'),{'options':{'raw':!![],'attributes':['id',_0x21b3('0x3'),_0x21b3('0x4')]},'log':_0x21b3('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 632f461..b7ec1aa 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 _0xf0ab=['data3','data4','data5','data7','getTriggers','Request','name','channel','Condition','AllConditions','field','value','Action','action','data1','data2'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf0ab,0xf4));var _0xbf0a=function(_0x5376ff,_0x4682a8){_0x5376ff=_0x5376ff-0x0;var _0x10ed2d=_0xf0ab[_0x5376ff];return _0x10ed2d;};'use strict';var client=require('../client');exports[_0xbf0a('0x0')]=function(_0x575e51){return function(_0x110317){return client[_0xbf0a('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xbf0a('0x2'),_0xbf0a('0x3'),'status'],'include':[{'model':_0xbf0a('0x4'),'as':_0xbf0a('0x5'),'attributes':['id',_0xbf0a('0x6'),'operator',_0xbf0a('0x7')]},{'model':_0xbf0a('0x4'),'as':'AnyConditions','attributes':['id','field','operator','value']},{'model':_0xbf0a('0x8'),'as':'Actions','attributes':['id',_0xbf0a('0x9'),_0xbf0a('0xa'),_0xbf0a('0xb'),_0xbf0a('0xc'),_0xbf0a('0xd'),_0xbf0a('0xe'),'data6',_0xbf0a('0xf')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x95cb=['AllConditions','field','operator','AnyConditions','value','Action','Actions','data1','data3','data5','data6','data7','../client','getTriggers','GetTrigger','name','channel','status','Condition'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x95cb,0x91));var _0xb95c=function(_0x446e15,_0x30ecb1){_0x446e15=_0x446e15-0x0;var _0x4ed3ce=_0x95cb[_0x446e15];return _0x4ed3ce;};'use strict';var client=require(_0xb95c('0x0'));exports[_0xb95c('0x1')]=function(_0x2c727d){return function(_0x5357f7){return client['Request'](_0xb95c('0x2'),{'options':{'raw':![],'attributes':['id',_0xb95c('0x3'),_0xb95c('0x4'),_0xb95c('0x5')],'include':[{'model':_0xb95c('0x6'),'as':_0xb95c('0x7'),'attributes':['id',_0xb95c('0x8'),_0xb95c('0x9'),'value']},{'model':_0xb95c('0x6'),'as':_0xb95c('0xa'),'attributes':['id','field',_0xb95c('0x9'),_0xb95c('0xb')]},{'model':_0xb95c('0xc'),'as':_0xb95c('0xd'),'attributes':['id','action',_0xb95c('0xe'),'data2',_0xb95c('0xf'),'data4',_0xb95c('0x10'),_0xb95c('0x11'),_0xb95c('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 9fe17d8..4c1fbf1 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 _0xa927=['GetTrunk','name','registry','../client','getTrunks','Request'];(function(_0xd6a2c,_0x42cb87){var _0x38c80c=function(_0x51b0de){while(--_0x51b0de){_0xd6a2c['push'](_0xd6a2c['shift']());}};_0x38c80c(++_0x42cb87);}(_0xa927,0xed));var _0x7a92=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa927[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x7a92('0x0'));exports[_0x7a92('0x1')]=function(_0x541c31){return function(_0x58065c){return client[_0x7a92('0x2')](_0x7a92('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7a92('0x4'),_0x7a92('0x5')]},'log':_0x7a92('0x3')});};}; \ No newline at end of file +var _0x77f5=['Request','GetTrunk','name','../client'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x77f5,0x1eb));var _0x577f=function(_0xd8a8af,_0x1e93f0){_0xd8a8af=_0xd8a8af-0x0;var _0x5b7278=_0x77f5[_0xd8a8af];return _0x5b7278;};'use strict';var client=require(_0x577f('0x0'));exports['getTrunks']=function(_0x54f217){return function(_0x45376b){return client[_0x577f('0x1')](_0x577f('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x577f('0x3'),'registry']},'log':_0x577f('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index b7bfc83..910c0e6 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 _0xb8d7=['getAgents','GetUser','agent','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','Request','telephone','accountcode','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','email','../client'];(function(_0x5b1c9c,_0x47981a){var _0x977fd3=function(_0x41e449){while(--_0x41e449){_0x5b1c9c['push'](_0x5b1c9c['shift']());}};_0x977fd3(++_0x47981a);}(_0xb8d7,0x176));var _0x7b8d=function(_0x563d77,_0x305794){_0x563d77=_0x563d77-0x0;var _0x24cfdf=_0xb8d7[_0x563d77];return _0x24cfdf;};'use strict';var client=require(_0x7b8d('0x0'));exports[_0x7b8d('0x1')]=function(){return function(){return client['Request'](_0x7b8d('0x2'),{'options':{'raw':![],'where':{'role':_0x7b8d('0x3')},'attributes':['id','name','email','accountcode',_0x7b8d('0x4'),_0x7b8d('0x5'),_0x7b8d('0x6'),_0x7b8d('0x7'),_0x7b8d('0x8'),_0x7b8d('0x9'),_0x7b8d('0xa'),_0x7b8d('0xb'),_0x7b8d('0xc')]},'log':_0x7b8d('0x1')});};};exports[_0x7b8d('0xd')]=function(){return function(){return client[_0x7b8d('0xe')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x7b8d('0xf')},'attributes':['id','name',_0x7b8d('0x10'),_0x7b8d('0x11')]},'log':_0x7b8d('0xd')});};};exports[_0x7b8d('0x12')]=function(_0xb03b92,_0x1fc403,_0xd1fe59){return client[_0x7b8d('0xe')](_0x7b8d('0x13'),{'body':{'type':_0x1fc403,'uniqueid':_0xd1fe59},'options':{'where':{'id':_0xb03b92['id']}},'log':_0x7b8d('0x12')});};exports[_0x7b8d('0x14')]=function(_0x243917){return client[_0x7b8d('0xe')](_0x7b8d('0x15'),{'body':{},'options':{'where':{'id':_0x243917['id']}},'log':'savePause'});};exports[_0x7b8d('0x16')]=function(_0x10bdbe){return client[_0x7b8d('0xe')](_0x7b8d('0x17'),{'options':{'raw':![],'where':{'role':_0x7b8d('0x3'),'id':_0x10bdbe},'attributes':['id','name',_0x7b8d('0x18'),'accountcode',_0x7b8d('0x4'),_0x7b8d('0x5'),_0x7b8d('0x6'),_0x7b8d('0x7'),_0x7b8d('0x8'),_0x7b8d('0x9'),'interface']},'log':'getAgent'});}; \ No newline at end of file +var _0xfdbf=['getTelephones','savePause','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','email','lastLoginAt','../client','getAgents','Request','GetUser','name','accountcode','fullname','online','pauseType','lastPauseAt','voicePause','mobile','interface','telephone','internal'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0xfdbf,0x159));var _0xffdb=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0xfdbf[_0x96f74c];return _0x379222;};'use strict';var client=require(_0xffdb('0x0'));exports[_0xffdb('0x1')]=function(){return function(){return client[_0xffdb('0x2')](_0xffdb('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0xffdb('0x4'),'email',_0xffdb('0x5'),_0xffdb('0x6'),_0xffdb('0x7'),'lastLoginAt',_0xffdb('0x8'),_0xffdb('0x9'),_0xffdb('0xa'),'phone',_0xffdb('0xb'),_0xffdb('0xc')]},'log':_0xffdb('0x1')});};};exports['getTelephones']=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0xffdb('0xd')},'attributes':['id','name',_0xffdb('0x5'),_0xffdb('0xe')]},'log':_0xffdb('0xf')});};};exports['savePause']=function(_0x3b5317,_0x42792b,_0x5df9){return client[_0xffdb('0x2')]('PauseUser',{'body':{'type':_0x42792b,'uniqueid':_0x5df9},'options':{'where':{'id':_0x3b5317['id']}},'log':_0xffdb('0x10')});};exports[_0xffdb('0x11')]=function(_0x2d23e0){return client[_0xffdb('0x2')](_0xffdb('0x12'),{'body':{},'options':{'where':{'id':_0x2d23e0['id']}},'log':_0xffdb('0x10')});};exports[_0xffdb('0x13')]=function(_0x4c706f){return client[_0xffdb('0x2')](_0xffdb('0x14'),{'options':{'raw':![],'where':{'role':_0xffdb('0x15'),'id':_0x4c706f},'attributes':['id',_0xffdb('0x4'),_0xffdb('0x16'),_0xffdb('0x5'),_0xffdb('0x6'),_0xffdb('0x7'),_0xffdb('0x17'),_0xffdb('0x8'),_0xffdb('0x9'),'voicePause',_0xffdb('0xc')]},'log':_0xffdb('0x13')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index fbccab3..9cca99f 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 _0x96f3=['create','Request','CreateVoiceAgentReport','../client'];(function(_0x4ef221,_0x289b08){var _0x1f9ee9=function(_0x482185){while(--_0x482185){_0x4ef221['push'](_0x4ef221['shift']());}};_0x1f9ee9(++_0x289b08);}(_0x96f3,0xf7));var _0x396f=function(_0x3c3b44,_0x3bb416){_0x3c3b44=_0x3c3b44-0x0;var _0x174177=_0x96f3[_0x3c3b44];return _0x174177;};'use strict';var client=require(_0x396f('0x0'));exports[_0x396f('0x1')]=function(_0x2baf9d){return client[_0x396f('0x2')](_0x396f('0x3'),{'body':_0x2baf9d,'log':_0x396f('0x3')});};exports['update']=function(_0x5440cd,_0x2f7a4c,_0x46a13b){return client[_0x396f('0x2')]('UpdateVoiceAgentReport',{'body':_0x5440cd,'options':{'where':{'uniqueid':_0x2f7a4c,'interface':_0x46a13b,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x2a36=['create','Request','CreateVoiceAgentReport','update','../client'];(function(_0x34c2d4,_0x418ed2){var _0x38796a=function(_0xf017c5){while(--_0xf017c5){_0x34c2d4['push'](_0x34c2d4['shift']());}};_0x38796a(++_0x418ed2);}(_0x2a36,0x95));var _0x62a3=function(_0x4869a6,_0x3a4c0a){_0x4869a6=_0x4869a6-0x0;var _0x839d3f=_0x2a36[_0x4869a6];return _0x839d3f;};'use strict';var client=require(_0x62a3('0x0'));exports[_0x62a3('0x1')]=function(_0x18b775){return client[_0x62a3('0x2')](_0x62a3('0x3'),{'body':_0x18b775,'log':_0x62a3('0x3')});};exports[_0x62a3('0x4')]=function(_0x400c12,_0x8261c3,_0x744224){return client[_0x62a3('0x2')]('UpdateVoiceAgentReport',{'body':_0x400c12,'options':{'where':{'uniqueid':_0x8261c3,'interface':_0x744224,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index e98efa3..bca37b0 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 _0x753e=['type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x5e2b34,_0x58385c){var _0x4859f9=function(_0x177263){while(--_0x177263){_0x5e2b34['push'](_0x5e2b34['shift']());}};_0x4859f9(++_0x58385c);}(_0x753e,0x8e));var _0xe753=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x753e[_0x1f9f37];return _0x21c080;};'use strict';var moment=require(_0xe753('0x0'));var util=require(_0xe753('0x1'));var _=require(_0xe753('0x2'));var client=require(_0xe753('0x3'));exports[_0xe753('0x4')]=function(_0x112a44){return client[_0xe753('0x5')]('CreateVoiceCallReport',{'body':_['merge'](_0x112a44,{'source':_0x112a44[_0xe753('0x6')],'destinationcontext':_0x112a44[_0xe753('0x7')],'callerid':_0x112a44[_0xe753('0x8')],'amaflags':_0xe753('0x9')}),'log':_0xe753('0xa')});};exports[_0xe753('0xb')]=function(){return function(){return client[_0xe753('0x5')](_0xe753('0xc'),{'options':{'where':{'type':[_0xe753('0xd')],'createdAt':{'$between':[moment()[_0xe753('0xe')](_0xe753('0xf'))[_0xe753('0x10')](_0xe753('0x11')),moment()[_0xe753('0x12')](_0xe753('0xf'))[_0xe753('0x10')](_0xe753('0x11'))]}},'attributes':[_0xe753('0x13'),'disposition',_0xe753('0x14'),_0xe753('0x15')]},'log':_0xe753('0x16')});};}; \ No newline at end of file +var _0x4bfc=['billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','calleridnum','context','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition'];(function(_0xce1d6c,_0x3f597b){var _0x5a38e6=function(_0x20cd06){while(--_0x20cd06){_0xce1d6c['push'](_0xce1d6c['shift']());}};_0x5a38e6(++_0x3f597b);}(_0x4bfc,0x80));var _0xc4bf=function(_0x234aec,_0x4dde42){_0x234aec=_0x234aec-0x0;var _0x249db3=_0x4bfc[_0x234aec];return _0x249db3;};'use strict';var moment=require('moment');var util=require(_0xc4bf('0x0'));var _=require(_0xc4bf('0x1'));var client=require(_0xc4bf('0x2'));exports[_0xc4bf('0x3')]=function(_0x5d3b11){return client[_0xc4bf('0x4')]('CreateVoiceCallReport',{'body':_['merge'](_0x5d3b11,{'source':_0x5d3b11[_0xc4bf('0x5')],'destinationcontext':_0x5d3b11[_0xc4bf('0x6')],'callerid':_0x5d3b11['callerid'],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xc4bf('0x7')]=function(){return function(){return client['Request'](_0xc4bf('0x8'),{'options':{'where':{'type':[_0xc4bf('0x9')],'createdAt':{'$between':[moment()[_0xc4bf('0xa')](_0xc4bf('0xb'))[_0xc4bf('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xc4bf('0xb'))[_0xc4bf('0xc')](_0xc4bf('0xd'))]}},'attributes':[_0xc4bf('0xe'),_0xc4bf('0xf'),'duration',_0xc4bf('0x10')]},'log':_0xc4bf('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 949d843..ac9ff01 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 _0xef77=['CreateVoiceDialReport','../client','create'];(function(_0x19cce8,_0x23a814){var _0x575f93=function(_0x515f8b){while(--_0x515f8b){_0x19cce8['push'](_0x19cce8['shift']());}};_0x575f93(++_0x23a814);}(_0xef77,0x88));var _0x7ef7=function(_0x326e05,_0x4be2d9){_0x326e05=_0x326e05-0x0;var _0xae22d=_0xef77[_0x326e05];return _0xae22d;};'use strict';var client=require(_0x7ef7('0x0'));exports[_0x7ef7('0x1')]=function(_0x260105){return client['Request'](_0x7ef7('0x2'),{'body':_0x260105,'log':_0x7ef7('0x2')});}; \ No newline at end of file +var _0xb6a8=['create','Request','CreateVoiceDialReport','../client'];(function(_0x1e54cb,_0x4675b3){var _0xf3e4bf=function(_0x5972dc){while(--_0x5972dc){_0x1e54cb['push'](_0x1e54cb['shift']());}};_0xf3e4bf(++_0x4675b3);}(_0xb6a8,0x1b7));var _0x8b6a=function(_0x22c32f,_0x19d2b3){_0x22c32f=_0x22c32f-0x0;var _0x242105=_0xb6a8[_0x22c32f];return _0x242105;};'use strict';var client=require(_0x8b6a('0x0'));exports[_0x8b6a('0x1')]=function(_0x2dd8dd){return client[_0x8b6a('0x2')](_0x8b6a('0x3'),{'body':_0x2dd8dd,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 0caac86..1f8d941 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 _0x160b=['getVoiceExtensions','Request','recordingFormat','../client'];(function(_0x3ef4f1,_0x5f0f9b){var _0x69953c=function(_0xb4e621){while(--_0xb4e621){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x69953c(++_0x5f0f9b);}(_0x160b,0xff));var _0xb160=function(_0x2cb90b,_0x2ec8b4){_0x2cb90b=_0x2cb90b-0x0;var _0xea4513=_0x160b[_0x2cb90b];return _0xea4513;};'use strict';var client=require(_0xb160('0x0'));exports[_0xb160('0x1')]=function(){return function(){return client[_0xb160('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0xb160('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xb160('0x1')});};}; \ No newline at end of file +var _0xd276=['GetVoiceExtension','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x1e3ad3,_0x51a1d7){var _0x332890=function(_0x4b5866){while(--_0x4b5866){_0x1e3ad3['push'](_0x1e3ad3['shift']());}};_0x332890(++_0x51a1d7);}(_0xd276,0xfc));var _0x6d27=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0xd276[_0x3a9661];return _0x5bb119;};'use strict';var client=require(_0x6d27('0x0'));exports[_0x6d27('0x1')]=function(){return function(){return client[_0x6d27('0x2')](_0x6d27('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x6d27('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x6d27('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 4b3559c..cf7ad27 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 _0x7325=['dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','TrunkBackup','Interval','interval','getVoiceQueues','Request','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient'];(function(_0x29e0d3,_0x307ff0){var _0x56e6c4=function(_0x4abd2c){while(--_0x4abd2c){_0x29e0d3['push'](_0x29e0d3['shift']());}};_0x56e6c4(++_0x307ff0);}(_0x7325,0x1ec));var _0x5732=function(_0x5da20c,_0x4511c8){_0x5da20c=_0x5da20c-0x0;var _0xceb00d=_0x7325[_0x5da20c];return _0xceb00d;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0x5732('0x0')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x5732('0x1'),_0x5732('0x2'),_0x5732('0x3'),_0x5732('0x4'),_0x5732('0x5'),_0x5732('0x6'),_0x5732('0x7'),_0x5732('0x8'),_0x5732('0x9'),_0x5732('0xa'),_0x5732('0xb'),_0x5732('0xc'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0x5732('0xd'),_0x5732('0xe'),'dialOriginateTimeout',_0x5732('0xf'),_0x5732('0x10'),_0x5732('0x11'),_0x5732('0x12'),_0x5732('0x13'),_0x5732('0x14'),_0x5732('0x15'),_0x5732('0x16'),_0x5732('0x17'),_0x5732('0x18'),'dialTimezone',_0x5732('0x19'),_0x5732('0x1a'),_0x5732('0x1b'),'dialAMDActive',_0x5732('0x1c'),_0x5732('0x1d'),_0x5732('0x1e'),_0x5732('0x1f'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x5732('0x20'),_0x5732('0x21'),_0x5732('0x22'),_0x5732('0x23'),_0x5732('0x24'),_0x5732('0x25'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0x5732('0x26'),_0x5732('0x27'),_0x5732('0x5'),_0x5732('0x28'),_0x5732('0x29'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0x5732('0x2a'),_0x5732('0x2b'),_0x5732('0x2c'),'dialAbandonedMaxRetry',_0x5732('0x2d'),'dialMachineMaxRetry',_0x5732('0x2e'),_0x5732('0x2f'),'dialAgentRejectRetryFrequency',_0x5732('0x30'),_0x5732('0x31'),_0x5732('0x32')],'include':[{'model':_0x5732('0x33'),'as':_0x5732('0x33'),'attributes':['id',_0x5732('0x1'),_0x5732('0x34'),_0x5732('0x35')]},{'model':_0x5732('0x36'),'as':'mandatoryDispositionPause','attributes':['id',_0x5732('0x1')]},{'model':'Trunk','as':_0x5732('0x37'),'attributes':['id',_0x5732('0x1'),_0x5732('0x34'),_0x5732('0x35')]},{'model':_0x5732('0x38'),'as':'Interval','attributes':['id',_0x5732('0x1')],'include':[{'model':_0x5732('0x38'),'as':'Intervals','attributes':['id',_0x5732('0x1'),_0x5732('0x39')]}]}]},'log':_0x5732('0x3a')});};}; \ No newline at end of file +var _0x13a2=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy'];(function(_0x14c983,_0x1058ca){var _0x45af3d=function(_0x19186b){while(--_0x19186b){_0x14c983['push'](_0x14c983['shift']());}};_0x45af3d(++_0x1058ca);}(_0x13a2,0xf3));var _0x213a=function(_0x3b519e,_0x2e486d){_0x3b519e=_0x3b519e-0x0;var _0xe806c1=_0x13a2[_0x3b519e];return _0xe806c1;};'use strict';var client=require(_0x213a('0x0'));exports[_0x213a('0x1')]=function(){return function(){return client[_0x213a('0x2')](_0x213a('0x3'),{'options':{'raw':![],'attributes':['id',_0x213a('0x4'),_0x213a('0x5'),'acwTimeout',_0x213a('0x6'),_0x213a('0x7'),_0x213a('0x8'),_0x213a('0x9'),_0x213a('0xa'),'dialLimitChannel',_0x213a('0xb'),_0x213a('0xc'),_0x213a('0xd'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0x213a('0xe'),'dialOriginateCallerIdNumber',_0x213a('0xf'),_0x213a('0x10'),_0x213a('0x11'),'dialQueueProject','dialCongestionMaxRetry',_0x213a('0x12'),_0x213a('0x13'),_0x213a('0x14'),_0x213a('0x15'),'dialNoAnswerRetryFrequency',_0x213a('0x16'),_0x213a('0x17'),_0x213a('0x18'),_0x213a('0x19'),'dialCheckDuplicateType',_0x213a('0x1a'),_0x213a('0x1b'),_0x213a('0x1c'),_0x213a('0x1d'),_0x213a('0x1e'),_0x213a('0x1f'),_0x213a('0x20'),_0x213a('0x21'),_0x213a('0x22'),_0x213a('0x23'),_0x213a('0x24'),_0x213a('0x25'),'dialRecallInQueue','dialOrderByScheduledAt',_0x213a('0x26'),_0x213a('0x27'),_0x213a('0x28'),_0x213a('0x7'),_0x213a('0x29'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x213a('0x2a'),_0x213a('0x2b'),_0x213a('0x2c'),'dialDropRetryFrequency','dialAbandonedMaxRetry',_0x213a('0x2d'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x213a('0x2e'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x213a('0x2f'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x213a('0x30'),'as':_0x213a('0x30'),'attributes':['id',_0x213a('0x4'),_0x213a('0x31'),_0x213a('0x32')]},{'model':_0x213a('0x33'),'as':_0x213a('0x34'),'attributes':['id',_0x213a('0x4')]},{'model':_0x213a('0x30'),'as':_0x213a('0x35'),'attributes':['id',_0x213a('0x4'),_0x213a('0x31'),'active']},{'model':_0x213a('0x36'),'as':_0x213a('0x36'),'attributes':['id',_0x213a('0x4')],'include':[{'model':_0x213a('0x36'),'as':_0x213a('0x37'),'attributes':['id',_0x213a('0x4'),_0x213a('0x38')]}]}]},'log':_0x213a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 7b2d638..c96704b 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 _0xeaf3=['queuecallerabandonAt','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon'];(function(_0x2a9c57,_0x4f4114){var _0x4d4183=function(_0x115c49){while(--_0x115c49){_0x2a9c57['push'](_0x2a9c57['shift']());}};_0x4d4183(++_0x4f4114);}(_0xeaf3,0x1cd));var _0x3eaf=function(_0x38c57b,_0x21c2a3){_0x38c57b=_0x38c57b-0x0;var _0x9750e9=_0xeaf3[_0x38c57b];return _0x9750e9;};'use strict';var moment=require('moment');var _=require('lodash');var client=require(_0x3eaf('0x0'));exports[_0x3eaf('0x1')]=function(_0x3679b1){return client[_0x3eaf('0x2')](_0x3eaf('0x3'),{'body':_0x3679b1,'log':'CreateVoiceQueueReport'});};exports[_0x3eaf('0x4')]=function(){return function(){return client[_0x3eaf('0x2')](_0x3eaf('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x3eaf('0x6')](_0x3eaf('0x7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')[_0x3eaf('0x8')](_0x3eaf('0x9'))]}},'attributes':[_0x3eaf('0xa'),_0x3eaf('0xb'),_0x3eaf('0xc'),_0x3eaf('0xd'),_0x3eaf('0xe'),_0x3eaf('0xf'),_0x3eaf('0x10'),_0x3eaf('0x11'),_0x3eaf('0x12'),_0x3eaf('0x13')]},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0x1633=['queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','moment','lodash','create','CreateVoiceQueueReport','getVoiceQueueReports','Request','GetVoiceQueueReport','day','YYYY-MM-DD\x20HH:mm:ss','queue','queuecallerjoinAt','queuecallerleaveAt'];(function(_0x336e6e,_0x1435e6){var _0x4d3270=function(_0x3f314c){while(--_0x3f314c){_0x336e6e['push'](_0x336e6e['shift']());}};_0x4d3270(++_0x1435e6);}(_0x1633,0x154));var _0x3163=function(_0x5a7c14,_0xfe838a){_0x5a7c14=_0x5a7c14-0x0;var _0x28ed61=_0x1633[_0x5a7c14];return _0x28ed61;};'use strict';var moment=require(_0x3163('0x0'));var _=require(_0x3163('0x1'));var client=require('../client');exports[_0x3163('0x2')]=function(_0x3b3d12){return client['Request'](_0x3163('0x3'),{'body':_0x3b3d12,'log':'CreateVoiceQueueReport'});};exports[_0x3163('0x4')]=function(){return function(){return client[_0x3163('0x5')](_0x3163('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x3163('0x7'))['format'](_0x3163('0x8')),moment()['endOf'](_0x3163('0x7'))['format'](_0x3163('0x8'))]}},'attributes':['uniqueid',_0x3163('0x9'),_0x3163('0xa'),_0x3163('0xb'),'queuecallercomplete','queuecallercompleteAt',_0x3163('0xc'),_0x3163('0xd'),_0x3163('0xe'),_0x3163('0xf')]},'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 c00fafb..79ad19b 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 _0x75f2=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x226d6f,_0x5ce17a){var _0x204073=function(_0x2242bd){while(--_0x2242bd){_0x226d6f['push'](_0x226d6f['shift']());}};_0x204073(++_0x5ce17a);}(_0x75f2,0x153));var _0x275f=function(_0x32fb20,_0x410fc0){_0x32fb20=_0x32fb20-0x0;var _0x10a18c=_0x75f2[_0x32fb20];return _0x10a18c;};'use strict';var client=require(_0x275f('0x0'));exports[_0x275f('0x1')]=function(_0x4155fb){return function(){return client['Request'](_0x275f('0x2'),{'options':{'where':{'VoiceQueueId':_0x4155fb,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xa88d=['Request','../client','getVoiceQueueRtPauses'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0xa88d,0x10f));var _0xda88=function(_0x531301,_0x3509f2){_0x531301=_0x531301-0x0;var _0x46e668=_0xa88d[_0x531301];return _0x46e668;};'use strict';var client=require(_0xda88('0x0'));exports[_0xda88('0x1')]=function(_0x5a9c00){return function(){return client[_0xda88('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x5a9c00,'paused':!![]},'raw':!![]},'log':_0xda88('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 1a6e9e2..583bc53 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 _0x7f8d=['create','merge','lodash','../client'];(function(_0x44269e,_0xaef4f0){var _0x3a5a6b=function(_0x53c533){while(--_0x53c533){_0x44269e['push'](_0x44269e['shift']());}};_0x3a5a6b(++_0xaef4f0);}(_0x7f8d,0x1da));var _0xd7f8=function(_0xd4e1b0,_0x3013b4){_0xd4e1b0=_0xd4e1b0-0x0;var _0x56dd21=_0x7f8d[_0xd4e1b0];return _0x56dd21;};'use strict';var _=require(_0xd7f8('0x0'));var client=require(_0xd7f8('0x1'));exports[_0xd7f8('0x2')]=function(_0x4beb6a){return client['Request']('CreateVoiceRecording',{'body':_[_0xd7f8('0x3')](_0x4beb6a,{'value':_0x4beb6a['monitorFilename']}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0xabda=['merge','monitorFilename','../client','create','Request','CreateVoiceRecording'];(function(_0x159747,_0x87c53){var _0x4df545=function(_0x100d23){while(--_0x100d23){_0x159747['push'](_0x159747['shift']());}};_0x4df545(++_0x87c53);}(_0xabda,0x98));var _0xaabd=function(_0x2e75c8,_0x43557b){_0x2e75c8=_0x2e75c8-0x0;var _0x4ebdd0=_0xabda[_0x2e75c8];return _0x4ebdd0;};'use strict';var _=require('lodash');var client=require(_0xaabd('0x0'));exports[_0xaabd('0x1')]=function(_0x160264){return client[_0xaabd('0x2')](_0xaabd('0x3'),{'body':_[_0xaabd('0x4')](_0x160264,{'value':_0x160264[_0xaabd('0x5')]}),'log':_0xaabd('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index f5ae2c0..5a7ea08 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 _0x6096=['transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','Request','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext'];(function(_0x32ab87,_0x5803d0){var _0x5ae2b0=function(_0x3af5d3){while(--_0x3af5d3){_0x32ab87['push'](_0x32ab87['shift']());}};_0x5ae2b0(++_0x5803d0);}(_0x6096,0x131));var _0x6609=function(_0x4f0f21,_0x4b6c78){_0x4f0f21=_0x4f0f21-0x0;var _0x22ac6f=_0x6096[_0x4f0f21];return _0x22ac6f;};'use strict';var client=require(_0x6609('0x0'));exports[_0x6609('0x1')]={};exports['blindTransfer']=function(_0x1d14f4){return client[_0x6609('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x1d14f4[_0x6609('0x3')],'transfererchannel':_0x1d14f4[_0x6609('0x4')],'transferercalleridnum':_0x1d14f4['transferercalleridnum'],'transferercalleridname':_0x1d14f4['transferercalleridname'],'transfererconnectedlinenum':_0x1d14f4[_0x6609('0x5')],'transfererconnectedlinename':_0x1d14f4[_0x6609('0x6')],'transfereraccountcode':_0x1d14f4['transfereraccountcode'],'transferercontext':_0x1d14f4[_0x6609('0x7')],'transfererexten':_0x1d14f4[_0x6609('0x8')],'transfererlinkedid':_0x1d14f4[_0x6609('0x9')],'transfereechannel':_0x1d14f4[_0x6609('0xa')],'transfereecalleridnum':_0x1d14f4['transfereecalleridnum'],'transfereecalleridname':_0x1d14f4['transfereecalleridname'],'transfereeconnectedlinenum':_0x1d14f4[_0x6609('0xb')],'transfereeconnectedlinename':_0x1d14f4[_0x6609('0xc')],'transfereeaccountcode':_0x1d14f4[_0x6609('0xd')],'transfereecontext':_0x1d14f4[_0x6609('0xe')],'transfereeexten':_0x1d14f4['transfereeexten'],'transfereelinkedid':_0x1d14f4[_0x6609('0xf')],'isexternal':_0x1d14f4[_0x6609('0x10')],'context':_0x1d14f4[_0x6609('0x11')],'extension':_0x1d14f4[_0x6609('0x12')],'type':_0x6609('0x13')},'log':'CreateVoiceTransferReport'});};exports[_0x6609('0x14')]=function(_0x46e3fa){return client[_0x6609('0x2')](_0x6609('0x15'),{'body':{'result':_0x46e3fa['result'],'transfererchannel':_0x46e3fa[_0x6609('0x16')],'transferercalleridnum':_0x46e3fa[_0x6609('0x17')],'transferercalleridname':_0x46e3fa['origtransferercalleridname'],'transfererconnectedlinenum':_0x46e3fa[_0x6609('0x18')],'transfererconnectedlinename':_0x46e3fa[_0x6609('0x19')],'transfereraccountcode':_0x46e3fa[_0x6609('0x1a')],'transferercontext':_0x46e3fa[_0x6609('0x1b')],'transfererexten':_0x46e3fa[_0x6609('0x1c')],'transfererlinkedid':_0x46e3fa[_0x6609('0x1d')],'transfereechannel':_0x46e3fa['transfertargetchannel'],'transfereecalleridnum':_0x46e3fa[_0x6609('0x1e')],'transfereecalleridname':_0x46e3fa[_0x6609('0x1f')],'transfereeconnectedlinenum':_0x46e3fa[_0x6609('0x20')],'transfereeconnectedlinename':_0x46e3fa[_0x6609('0x21')],'transfereeaccountcode':_0x46e3fa[_0x6609('0x22')],'transfereecontext':_0x46e3fa[_0x6609('0x23')],'transfereeexten':_0x46e3fa['transfertargetexten'],'transfereelinkedid':_0x46e3fa[_0x6609('0x24')],'isexternal':_0x46e3fa[_0x6609('0x10')],'context':_0x46e3fa[_0x6609('0x25')],'extension':_0x46e3fa[_0x6609('0x26')],'type':_0x6609('0x27')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x0741=['origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereecalleridname','transfereeexten','isexternal','context','extension','blind'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x0741,0x108));var _0x1074=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0741[_0x465028];return _0xb783d4;};'use strict';var client=require(_0x1074('0x0'));exports['transfers']={};exports[_0x1074('0x1')]=function(_0x42ccdb){return client[_0x1074('0x2')](_0x1074('0x3'),{'body':{'result':_0x42ccdb[_0x1074('0x4')],'transfererchannel':_0x42ccdb['transfererchannel'],'transferercalleridnum':_0x42ccdb['transferercalleridnum'],'transferercalleridname':_0x42ccdb['transferercalleridname'],'transfererconnectedlinenum':_0x42ccdb[_0x1074('0x5')],'transfererconnectedlinename':_0x42ccdb[_0x1074('0x6')],'transfereraccountcode':_0x42ccdb[_0x1074('0x7')],'transferercontext':_0x42ccdb['transferercontext'],'transfererexten':_0x42ccdb[_0x1074('0x8')],'transfererlinkedid':_0x42ccdb[_0x1074('0x9')],'transfereechannel':_0x42ccdb['transfereechannel'],'transfereecalleridnum':_0x42ccdb['transfereecalleridnum'],'transfereecalleridname':_0x42ccdb[_0x1074('0xa')],'transfereeconnectedlinenum':_0x42ccdb['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x42ccdb['transfereeconnectedlinename'],'transfereeaccountcode':_0x42ccdb['transfereeaccountcode'],'transfereecontext':_0x42ccdb['transfereecontext'],'transfereeexten':_0x42ccdb[_0x1074('0xb')],'transfereelinkedid':_0x42ccdb['transfereelinkedid'],'isexternal':_0x42ccdb[_0x1074('0xc')],'context':_0x42ccdb[_0x1074('0xd')],'extension':_0x42ccdb[_0x1074('0xe')],'type':_0x1074('0xf')},'log':_0x1074('0x3')});};exports['attendedTransfer']=function(_0xa5ac95){return client[_0x1074('0x2')](_0x1074('0x3'),{'body':{'result':_0xa5ac95[_0x1074('0x4')],'transfererchannel':_0xa5ac95['origtransfererchannel'],'transferercalleridnum':_0xa5ac95[_0x1074('0x10')],'transferercalleridname':_0xa5ac95[_0x1074('0x11')],'transfererconnectedlinenum':_0xa5ac95[_0x1074('0x12')],'transfererconnectedlinename':_0xa5ac95[_0x1074('0x13')],'transfereraccountcode':_0xa5ac95[_0x1074('0x14')],'transferercontext':_0xa5ac95[_0x1074('0x15')],'transfererexten':_0xa5ac95[_0x1074('0x16')],'transfererlinkedid':_0xa5ac95[_0x1074('0x17')],'transfereechannel':_0xa5ac95[_0x1074('0x18')],'transfereecalleridnum':_0xa5ac95[_0x1074('0x19')],'transfereecalleridname':_0xa5ac95[_0x1074('0x1a')],'transfereeconnectedlinenum':_0xa5ac95[_0x1074('0x1b')],'transfereeconnectedlinename':_0xa5ac95['transfertargetconnectedlinename'],'transfereeaccountcode':_0xa5ac95[_0x1074('0x1c')],'transfereecontext':_0xa5ac95[_0x1074('0x1d')],'transfereeexten':_0xa5ac95[_0x1074('0x1e')],'transfereelinkedid':_0xa5ac95[_0x1074('0x1f')],'isexternal':_0xa5ac95[_0x1074('0xc')],'context':_0xa5ac95[_0x1074('0x20')],'extension':_0xa5ac95[_0x1074('0x21')],'type':_0x1074('0x22')},'log':_0x1074('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 9b422fd..e67f983 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 _0x8dfa=['mixmonitorid','status','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','QueuePause','error','username','ami\x20disconnected','join','pick','Reload','Action','then','message','catch','isConnected','asterisk','command','voiceQueues','answered','available','pTalking','sumBillable','sumHoldTime','total','type','unmanaged','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','find','omit','undefined','values','channels','map','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase'];(function(_0x4fe01d,_0x5471e0){var _0x1669bd=function(_0x44e94a){while(--_0x44e94a){_0x4fe01d['push'](_0x4fe01d['shift']());}};_0x1669bd(++_0x5471e0);}(_0x8dfa,0x11f));var _0xa8df=function(_0x536128,_0x205e2b){_0x536128=_0x536128-0x0;var _0x19eb75=_0x8dfa[_0x536128];return _0x19eb75;};'use strict';var _=require('lodash');var util=require(_0xa8df('0x0'));var jayson=require('jayson/promise');var schema=require(_0xa8df('0x1'));var BPromise=require('bluebird');var moment=require(_0xa8df('0x2'));var config=require(_0xa8df('0x3'));var properties=require(_0xa8df('0x4'));var ami=require(_0xa8df('0x5'));exports[_0xa8df('0x6')]=function(_0x24bcda,_0x3d8e07,_0x38a2a5){return new BPromise(function(_0x3898d7,_0x2ae498){var _0x5af82d={'QueuePause':function(_0x5b371e){return new Promise(function(_0x46b177,_0x3c2f6b){var _0x4f5af9=util[_0xa8df('0x7')](_0xa8df('0x8'),_0xa8df('0x9'),_0x5b371e[_0xa8df('0xa')]);if(_0x24bcda[_0xa8df('0xb')]&&_0x24bcda[_0xa8df('0xb')][_0x4f5af9]&&_0x24bcda[_0xa8df('0xb')][_0x4f5af9][_0xa8df('0xc')]){_0x24bcda[_0xa8df('0xb')][_0x4f5af9][_0xa8df('0xd')]();}if(_0x24bcda['agents'][_0x4f5af9]){_0x24bcda[_0xa8df('0xe')][_0x4f5af9]['updateStatusRealtime']({'statePause':_0x5b371e['pause']?!![]:![]});}_0x46b177({'code':0xc8,'message':_0xa8df('0xf')});});},'Reload':function(_0x3ae721){var _0x4037d0=this;return new Promise(function(_0x1dcd21,_0x4b60be){if(ami['isConnected']()==![]){return _0x4b60be(_0x4037d0[_0xa8df('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xa8df('0x11')],_0xa8df('0x12')][_0xa8df('0x13')]('\x20')));}_0x3ae721=_[_0xa8df('0x14')](_0x3ae721,_['keys'](properties['module']));_0x3ae721['action']=_0xa8df('0x15');return ami[_0xa8df('0x16')](_0x3ae721)[_0xa8df('0x17')](function(_0x229796){_0x1dcd21({'code':0xc8,'message':_0x229796[_0xa8df('0x18')]});})[_0xa8df('0x19')](function(_0x598c09){_0x4b60be(_0x4037d0[_0xa8df('0x10')](0x1f5,_0x598c09['message']));});});},'Command':function(_0x486575){var _0x2d9a28=this;return new Promise(function(_0x4ec9af,_0x77c467){if(ami[_0xa8df('0x1a')]()==![]){return _0x77c467(_0x2d9a28[_0xa8df('0x10')](0x1f4,[config[_0xa8df('0x1b')]['ip'],config[_0xa8df('0x1b')][_0xa8df('0x11')],_0xa8df('0x12')][_0xa8df('0x13')]('\x20')));}_0x486575=_['pick'](_0x486575,_0xa8df('0x1c'));_0x486575['action']='Command';return ami[_0xa8df('0x16')](_0x486575)[_0xa8df('0x17')](function(_0x16fae3){_0x4ec9af({'code':0xc8,'message':_0x16fae3['content']});})[_0xa8df('0x19')](function(_0x1ed30c){_0x77c467(_0x2d9a28[_0xa8df('0x10')](0x1f5,_0x1ed30c['message']));});});},'VoiceQueues':function(_0x102b22){return new Promise(function(_0x2d0405,_0x5491c3){var _0x5a3ee5=[];for(var _0x4247b7 in _0x24bcda[_0xa8df('0x1d')]){if(_0x24bcda[_0xa8df('0x1d')]['hasOwnProperty'](_0x4247b7)){var _0xf8a4d3=_0x24bcda[_0xa8df('0x1d')][_0x4247b7];var _0x4f8ae3={'id':_0xf8a4d3['id'],'name':_0xf8a4d3[_0xa8df('0xa')],'strategy':_0xf8a4d3['strategy'],'answered':_0xf8a4d3[_0xa8df('0x1e')],'available':_0xf8a4d3[_0xa8df('0x1f')],'loggedIn':_0xf8a4d3['loggedIn'],'pTalking':_0xf8a4d3[_0xa8df('0x20')],'sumBillable':_0xf8a4d3[_0xa8df('0x21')],'sumDuration':_0xf8a4d3['sumDuration'],'sumHoldTime':_0xf8a4d3[_0xa8df('0x22')]||0x0,'talking':_0xf8a4d3['talking'],'total':_0xf8a4d3[_0xa8df('0x23')],'type':_0xf8a4d3[_0xa8df('0x24')],'unmanaged':_0xf8a4d3[_0xa8df('0x25')],'abandoned':_0xf8a4d3[_0xa8df('0x26')],'waiting':_0xf8a4d3['waiting'],'loggedInDb':_0xf8a4d3[_0xa8df('0x27')]};if(_0xf8a4d3[_0xa8df('0x24')]===_0xa8df('0x28')){_0x4f8ae3[_0xa8df('0x29')]=_0xf8a4d3['dialActive'];_0x4f8ae3[_0xa8df('0x2a')]=_0xf8a4d3[_0xa8df('0x2a')];_0x4f8ae3['dialOriginateCallerIdName']=_0xf8a4d3[_0xa8df('0x2b')];_0x4f8ae3['dialOriginateCallerIdNumber']=_0xf8a4d3[_0xa8df('0x2c')];_0x4f8ae3[_0xa8df('0x2d')]=_0xf8a4d3['dialOriginateTimeout'];_0x4f8ae3['dialPrefix']=_0xf8a4d3[_0xa8df('0x2e')];_0x4f8ae3['temp']=_0xf8a4d3[_0xa8df('0x2f')];_0x4f8ae3['outboundAnswerAgiCallsDay']=_0xf8a4d3[_0xa8df('0x30')];_0x4f8ae3[_0xa8df('0x31')]=_0xf8a4d3[_0xa8df('0x31')];_0x4f8ae3['outboundBlacklistCallsDay']=_0xf8a4d3['outboundBlacklistCallsDay'];_0x4f8ae3['outboundBusyCallsDay']=_0xf8a4d3['outboundBusyCallsDay'];_0x4f8ae3[_0xa8df('0x32')]=_0xf8a4d3[_0xa8df('0x32')];_0x4f8ae3[_0xa8df('0x33')]=_0xf8a4d3[_0xa8df('0x33')];_0x4f8ae3[_0xa8df('0x34')]=_0xf8a4d3[_0xa8df('0x34')];_0x4f8ae3[_0xa8df('0x35')]=_0xf8a4d3['outboundDropCallsDayTimeout'];_0x4f8ae3[_0xa8df('0x36')]=_0xf8a4d3[_0xa8df('0x36')];_0x4f8ae3['outboundNoSuchCallsDay']=_0xf8a4d3[_0xa8df('0x37')];_0x4f8ae3['outboundOriginateFailureCallsDay']=_0xf8a4d3['outboundOriginateFailureCallsDay'];_0x4f8ae3[_0xa8df('0x38')]=_0xf8a4d3[_0xa8df('0x38')];_0x4f8ae3[_0xa8df('0x39')]=_0xf8a4d3[_0xa8df('0x39')];_0x4f8ae3['outboundUnknownCallsDay']=_0xf8a4d3[_0xa8df('0x3a')];_0x4f8ae3[_0xa8df('0x3b')]=_0xf8a4d3['predictiveIntervalAnsweredCalls'];_0x4f8ae3[_0xa8df('0x3c')]=_0xf8a4d3['predictiveIntervalAvgHoldtime'];_0x4f8ae3[_0xa8df('0x3d')]=_0xf8a4d3[_0xa8df('0x3d')];_0x4f8ae3[_0xa8df('0x3e')]=_0xf8a4d3[_0xa8df('0x3e')];_0x4f8ae3[_0xa8df('0x3f')]=_0xf8a4d3[_0xa8df('0x3f')];_0x4f8ae3[_0xa8df('0x40')]=_0xf8a4d3[_0xa8df('0x40')];_0x4f8ae3[_0xa8df('0x41')]=_0xf8a4d3['predictiveIntervalErlangCallsDroppedCalls'];_0x4f8ae3[_0xa8df('0x42')]=_0xf8a4d3[_0xa8df('0x42')];_0x4f8ae3[_0xa8df('0x43')]=_0xf8a4d3[_0xa8df('0x43')];_0x4f8ae3[_0xa8df('0x44')]=_0xf8a4d3[_0xa8df('0x44')];_0x4f8ae3['predictiveIntervalAvailable']=_0xf8a4d3['predictiveIntervalAvailable'];_0x4f8ae3[_0xa8df('0x45')]=_0xf8a4d3[_0xa8df('0x45')];_0x4f8ae3[_0xa8df('0x18')]=_0xf8a4d3[_0xa8df('0x18')];_0x4f8ae3[_0xa8df('0x46')]=_0xf8a4d3[_0xa8df('0x46')];_0x4f8ae3[_0xa8df('0x47')]=_0xf8a4d3[_0xa8df('0x47')];_0x4f8ae3['erlangCallToSecond']=_0xf8a4d3[_0xa8df('0x48')];_0x4f8ae3[_0xa8df('0x49')]=_0xf8a4d3[_0xa8df('0x49')];_0x4f8ae3[_0xa8df('0x4a')]=_0xf8a4d3[_0xa8df('0x4a')];_0x4f8ae3[_0xa8df('0x4b')]=_0xf8a4d3[_0xa8df('0x4b')];_0x4f8ae3[_0xa8df('0x4c')]=_0xf8a4d3[_0xa8df('0x4c')];}if(_0xf8a4d3[_0xa8df('0x4d')]){_0x4f8ae3[_0xa8df('0x4d')]={'id':_0xf8a4d3[_0xa8df('0x4d')]['id'],'name':_0xf8a4d3[_0xa8df('0x4d')][_0xa8df('0xa')],'active':_0xf8a4d3[_0xa8df('0x4d')]['active'],'callerid':_0xf8a4d3[_0xa8df('0x4d')][_0xa8df('0x4e')]};}if(_0xf8a4d3[_0xa8df('0x4f')]){_0x4f8ae3['Interval']={'id':_0xf8a4d3[_0xa8df('0x4f')]['id'],'name':_0xf8a4d3['Interval'][_0xa8df('0xa')]};}_0x5a3ee5[_0xa8df('0x50')](_0x4f8ae3);}}_0x2d0405({'count':_0x5a3ee5[_0xa8df('0x51')],'rows':_0x5a3ee5});});},'UpdateVoiceQueue':function(_0x11812f){return new Promise(function(_0x50a1c6,_0x36aa8a){var _0x468731=_[_0xa8df('0x52')](_0x24bcda['voiceQueues'],{'id':parseInt(_0x11812f['id'])});var _0x5eb936=_[_0xa8df('0x53')](_0x11812f,['id']);if(_0x468731){for(var _0x4d7c23 in _0x5eb936){if(typeof _0x5eb936[_0x4d7c23]!==_0xa8df('0x54')&&typeof _0x468731[_0x4d7c23]!==_0xa8df('0x54')){_0x468731[_0x4d7c23]=_0x5eb936[_0x4d7c23];}}_0x50a1c6(_0x468731);}else{_0x36aa8a();}});},'VoiceChannels':function(_0x3b88c6){return new Promise(function(_0x2890e3,_0xd8b89){var _0x3c6ffb=_[_0xa8df('0x55')](_0x24bcda[_0xa8df('0x56')]);_0x2890e3({'count':_0x3c6ffb['length'],'rows':_0x3c6ffb});});},'VoiceChannelMixMonitor':function(_0x3eb85e){var _0x5119cf=this;return new Promise(function(_0xea7f3a,_0x284197){if(ami[_0xa8df('0x1a')]()==![]){return _0x284197(_0x5119cf['error'](0x1f4,[config[_0xa8df('0x1b')]['ip'],config[_0xa8df('0x1b')][_0xa8df('0x11')],_0xa8df('0x12')][_0xa8df('0x13')]('\x20')));}var _0x4ec46e=schema(properties['voicechannel'])[_0xa8df('0x1')](_0x3eb85e);if(_0x4ec46e['length']>0x0){return _0x284197(_0x5119cf['error'](0x1f4,_[_0xa8df('0x57')](_0x4ec46e,_0xa8df('0x18'))[_0xa8df('0x13')](',\x20')));}var _0xc428b9=_[_0xa8df('0x52')](_0x24bcda[_0xa8df('0x56')],{'uniqueid':_0x3eb85e[_0xa8df('0x58')]});if(_0xc428b9&&_0xc428b9[_0xa8df('0x59')]){var _0x58a5c8=util[_0xa8df('0x7')](_0xa8df('0x5a'),_0x3eb85e[_0xa8df('0x5b')]||_0x3eb85e[_0xa8df('0x58')],_0x3eb85e['format']||_0xa8df('0x5c'));return ami[_0xa8df('0x16')]({'action':'MixMonitor','channel':_0xc428b9[_0xa8df('0x59')],'file':_0x58a5c8,'options':_0xa8df('0x5d')})[_0xa8df('0x17')](function(_0x3c406a){var _0x1e4bf3=_[_0xa8df('0x52')](_0xc428b9[_0xa8df('0x5e')],{'filename':_0xa8df('0x5f')+_0x58a5c8[_0xa8df('0x60')]()});if(_['isNil'](_0x1e4bf3)){_0xc428b9['monitors'][_0xa8df('0x50')]({'filename':_0xa8df('0x5f')+_0x58a5c8[_0xa8df('0x60')](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3c406a['mixmonitorid'],'status':'rec'});}else{_0x1e4bf3[_0xa8df('0x61')]=_0x3c406a[_0xa8df('0x61')];_0x1e4bf3[_0xa8df('0x62')]='rec';}_0xea7f3a({'code':0xc8,'message':[_0x3eb85e[_0xa8df('0x58')],'MixMonitor\x20Success',_0x3c406a['mixmonitorid']][_0xa8df('0x13')]('\x20'),'mixmonitorid':_0x3c406a[_0xa8df('0x61')]});})['catch'](function(_0x18c99b){_0x284197(_0x5119cf[_0xa8df('0x10')](0x1f5,[_0x3eb85e['uniqueid'],_0x18c99b[_0xa8df('0x18')][_0xa8df('0x60')]()][_0xa8df('0x13')]('\x20')));});}else{return _0x284197(_0x5119cf[_0xa8df('0x10')](0x1f5,_0xa8df('0x63')));}});},'VoiceChannelStopMixMonitor':function(_0x3149ac){var _0x1d5731=this;return new Promise(function(_0x3b14cd,_0x925fcd){if(ami[_0xa8df('0x1a')]()==![]){return _0x925fcd(_0x1d5731[_0xa8df('0x10')](0x1f4,[config[_0xa8df('0x1b')]['ip'],config[_0xa8df('0x1b')][_0xa8df('0x11')],_0xa8df('0x12')][_0xa8df('0x13')]('\x20')));}var _0x4c4eb0=schema(properties[_0xa8df('0x64')])[_0xa8df('0x1')](_0x3149ac);if(_0x4c4eb0[_0xa8df('0x51')]>0x0){return _0x925fcd(_0x1d5731[_0xa8df('0x10')](0x1f4,_[_0xa8df('0x57')](_0x4c4eb0,_0xa8df('0x18'))[_0xa8df('0x13')](',\x20')));}var _0x2fa5ce=_['find'](_0x24bcda[_0xa8df('0x56')],{'uniqueid':_0x3149ac[_0xa8df('0x58')]});if(_0x2fa5ce){return BPromise[_0xa8df('0x65')]()[_0xa8df('0x17')](function(){if(_0x2fa5ce[_0xa8df('0x59')]){return ami[_0xa8df('0x16')]({'action':_0xa8df('0x66'),'channel':_0x2fa5ce[_0xa8df('0x59')],'mixmonitorid':_0x3149ac[_0xa8df('0x61')]})[_0xa8df('0x19')](function(_0x512c44){});}})[_0xa8df('0x17')](function(){if(_0x2fa5ce[_0xa8df('0x67')]){return ami[_0xa8df('0x16')]({'action':_0xa8df('0x66'),'channel':_0x2fa5ce['destinationchannel'],'mixmonitorid':_0x3149ac['mixmonitorid']})[_0xa8df('0x19')](function(_0x4d643e){});}})[_0xa8df('0x17')](function(_0x2f4a4f){var _0x466244=_[_0xa8df('0x52')](_0x2fa5ce['monitors'],{'mixmonitorid':_0x3149ac['mixmonitorid']});if(_0x466244){_0x466244['status']=_0xa8df('0x68');}})[_0xa8df('0x17')](function(){var _0x22daf7=util[_0xa8df('0x7')]('%s.%s',_0x3149ac[_0xa8df('0x5b')]||_0x3149ac[_0xa8df('0x58')],_0x3149ac[_0xa8df('0x7')]||_0xa8df('0x5c'));var _0x373fb4=_[_0xa8df('0x52')](_0x2fa5ce[_0xa8df('0x5e')],{'filename':_0xa8df('0x5f')+_0x22daf7[_0xa8df('0x60')]()});if(_0x373fb4){_0x373fb4[_0xa8df('0x62')]=_0xa8df('0x68');}})[_0xa8df('0x17')](function(){_0x3b14cd({'code':0xc8,'message':[_0x3149ac[_0xa8df('0x58')],'StopMixMonitor\x20Success'][_0xa8df('0x13')]('\x20')});})[_0xa8df('0x19')](function(_0x537e5a){_0x925fcd(_0x1d5731[_0xa8df('0x10')](0x1f5,[_0x3149ac[_0xa8df('0x58')],_0x537e5a[_0xa8df('0x18')]['toLowerCase']()][_0xa8df('0x13')]('\x20')));});}else{return _0x925fcd(_0x1d5731[_0xa8df('0x10')](0x1f5,_0xa8df('0x63')));}});},'VoiceQueuesChannels':function(_0x729d0a){return new Promise(function(_0x39bed0,_0x437cd2){var _0x5d69ce=_['values'](_0x24bcda[_0xa8df('0x69')]);_0x39bed0({'count':_0x5d69ce[_0xa8df('0x51')],'rows':_0x5d69ce});});},'VoiceQueuesChannel':function(_0x3ae328){var _0x1d4629=this;return new Promise(function(_0x32ad79,_0x1bc16c){var _0x40d817=schema(properties[_0xa8df('0x6a')])['validate'](_0x3ae328);if(_0x40d817[_0xa8df('0x51')]>0x0){return _0x1bc16c(_0x1d4629['error'](0x1f4,_[_0xa8df('0x57')](_0x40d817,_0xa8df('0x18'))[_0xa8df('0x13')](',\x20')));}var _0x3afb54=_[_0xa8df('0x52')](_0x24bcda[_0xa8df('0x69')],{'uniqueid':_0x3ae328['uniqueid']});if(_0x3afb54){_0x32ad79(_0x3afb54);}else{return _0x1bc16c(_0x1d4629[_0xa8df('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x422e23){var _0x44368b=this;return new Promise(function(_0xd9c84a,_0x4dcc68){if(ami[_0xa8df('0x1a')]()==![]){return _0x4dcc68(_0x44368b[_0xa8df('0x10')](0x1f4,[config[_0xa8df('0x1b')]['ip'],config[_0xa8df('0x1b')][_0xa8df('0x11')],_0xa8df('0x12')][_0xa8df('0x13')]('\x20')));}var _0x429d53=schema(properties[_0xa8df('0x6b')])[_0xa8df('0x1')](_0x422e23);if(_0x429d53['length']>0x0){return _0x4dcc68(_0x44368b['error'](0x1f4,_[_0xa8df('0x57')](_0x429d53,_0xa8df('0x18'))[_0xa8df('0x13')](',\x20')));}var _0x1955c3=_[_0xa8df('0x52')](_0x24bcda['queueChannels'],{'uniqueid':_0x422e23[_0xa8df('0x58')]});if(_0x1955c3&&_0x1955c3[_0xa8df('0x59')]){return ami[_0xa8df('0x16')]({'action':'Hangup','channel':_0x1955c3[_0xa8df('0x59')]})[_0xa8df('0x17')](function(_0x45a3c3){_0xd9c84a({'code':0xc8,'message':[_0x422e23[_0xa8df('0x58')],_0x45a3c3[_0xa8df('0x18')][_0xa8df('0x60')]()][_0xa8df('0x13')]('\x20')});})['catch'](function(_0x3fc447){_0x4dcc68(_0x44368b['error'](0x1f5,[_0x422e23[_0xa8df('0x58')],_0x3fc447[_0xa8df('0x18')][_0xa8df('0x60')]()][_0xa8df('0x13')]('\x20')));});}else{return _0x4dcc68(_0x44368b[_0xa8df('0x10')](0x1f5,_0xa8df('0x63')));}});},'VoiceQueuesChannelRedirect':function(_0x53224d){var _0x3d6b15=this;return new Promise(function(_0x4ec3bc,_0x44f124){if(ami['isConnected']()==![]){return _0x44f124(_0x3d6b15[_0xa8df('0x10')](0x1f4,[config[_0xa8df('0x1b')]['ip'],config[_0xa8df('0x1b')][_0xa8df('0x11')],_0xa8df('0x12')]['join']('\x20')));}var _0x4642bb=schema(properties[_0xa8df('0x6c')])[_0xa8df('0x1')](_0x53224d);if(_0x4642bb[_0xa8df('0x51')]>0x0){return _0x44f124(_0x3d6b15['error'](0x1f4,_[_0xa8df('0x57')](_0x4642bb,_0xa8df('0x18'))['join'](',\x20')));}var _0x1ad4aa=_[_0xa8df('0x52')](_0x24bcda[_0xa8df('0x69')],{'uniqueid':_0x53224d[_0xa8df('0x58')]});if(_0x1ad4aa&&_0x1ad4aa[_0xa8df('0x59')]){return ami['Action']({'action':_0xa8df('0x6d'),'channel':_0x1ad4aa[_0xa8df('0x59')],'exten':_0x53224d[_0xa8df('0x6e')],'context':_0x53224d[_0xa8df('0x6f')]||_0x1ad4aa['context'],'priority':0x1})['then'](function(_0x341da9){_0x4ec3bc({'code':0xc8,'message':[_0x53224d['uniqueid'],_0x341da9['message'][_0xa8df('0x60')]()][_0xa8df('0x13')]('\x20')});})['catch'](function(_0x15daf2){_0x44f124(_0x3d6b15[_0xa8df('0x10')](0x1f5,[_0x53224d[_0xa8df('0x58')],_0x15daf2[_0xa8df('0x18')][_0xa8df('0x60')]()]['join']('\x20')));});}else{return _0x44f124(_0x3d6b15['error'](0x1f5,_0xa8df('0x63')));}});},'Agents':function(_0x1337b0){return new Promise(function(_0x599a9a,_0x3d7577){var _0x1960c4=_[_0xa8df('0x55')](_0x24bcda[_0xa8df('0xe')]);_0x599a9a({'count':_0x1960c4[_0xa8df('0x51')],'rows':_0x1960c4});});},'Telephones':function(_0x273c19){return new Promise(function(_0x3b2841,_0x17994e){var _0x1e02e9=_['values'](_0x24bcda[_0xa8df('0x70')]);_0x3b2841({'count':_0x1e02e9[_0xa8df('0x51')],'rows':_0x1e02e9});});},'Trunks':function(_0x365407){return new Promise(function(_0x55c857,_0x248d13){var _0x5f38ed=_[_0xa8df('0x55')](_0x24bcda[_0xa8df('0x71')]);_0x55c857({'count':_0x5f38ed['length'],'rows':_0x5f38ed});});},'OutboundChannels':function(_0x21a75d){return new Promise(function(_0x543497,_0x4fbd06){var _0x1a296f=_['values'](_0x24bcda[_0xa8df('0x72')]);_0x543497({'count':_0x1a296f[_0xa8df('0x51')],'rows':_0x1a296f});});},'Outbound':function(_0x12e178){return new Promise(function(_0x2ead94,_0x4c45c2){_0x2ead94(_0x24bcda[_0xa8df('0x28')]);});},'Campaigns':function(_0x38874e){return new Promise(function(_0x4464e2,_0x55c6b7){var _0x554049=_[_0xa8df('0x55')](_0x24bcda['campaigns']);_0x4464e2({'count':_0x554049[_0xa8df('0x51')],'rows':_0x554049});});},'VoiceQueuesPreview':function(_0x898f23){var _0x5e5db7=this;return new Promise(function(_0x4e26cd,_0x2f6fc4){_0x3d8e07[_0xa8df('0x73')](_0x898f23['id'])[_0xa8df('0x17')](function(_0x155660){_0x4e26cd({'code':0xc8,'message':_0x155660['message']});})[_0xa8df('0x19')](function(_0x1d265b){_0x2f6fc4(_0x5e5db7[_0xa8df('0x10')](0x1f4,_0x1d265b[_0xa8df('0x18')]));});});},'EventManager':function(_0x51638e){var _0x1bdcec=this;return new Promise(function(_0x104b7a,_0x49de5d){if(!_0x51638e[_0xa8df('0x74')]){return _0x49de5d(_0x1bdcec['error'](0x1f4,_0xa8df('0x75')));}ami[_0xa8df('0x76')](_0xa8df('0x77')+_0x51638e[_0xa8df('0x74')],_0x51638e['message']);_0x104b7a({'code':0xc8,'message':_0x51638e});});},'FaxAccounts':function(_0x5ca955){return new Promise(function(_0x59c99c,_0x122c52){var _0x444bee=_['values'](_0x24bcda[_0xa8df('0x78')]);_0x59c99c({'count':_0x444bee[_0xa8df('0x51')],'rows':_0x444bee});});},'SendFax':function(_0x3e187c){var _0xc96a8b=this;return new Promise(function(_0x3dec51,_0x93cf5d){_0x38a2a5[_0xa8df('0x79')](_0x3e187c)[_0xa8df('0x17')](function(_0x5bb662){_0x3dec51({'code':0xc8,'message':_0x5bb662[_0xa8df('0x18')]});})[_0xa8df('0x19')](function(_0x55ec2a){_0x93cf5d(_0xc96a8b[_0xa8df('0x10')](0x1f4,_0x55ec2a[_0xa8df('0x18')]));});});},'CheckAfterSend':function(_0x4f93ff){var _0x120c93=this;return new Promise(function(_0x4c212d,_0x556177){_0x38a2a5[_0xa8df('0x7a')](_0x4f93ff)['then'](function(_0x4d0b05){_0x4c212d({'code':0xc8,'message':_0x4d0b05[_0xa8df('0x18')]});})['catch'](function(_0x1fe758){_0x556177(_0x120c93[_0xa8df('0x10')](0x1f4,_0x1fe758[_0xa8df('0x18')]));});});}};var _0x58ad5e=jayson[_0xa8df('0x7b')](_0x5af82d)[_0xa8df('0x7c')]();_0x58ad5e['on'](_0xa8df('0x10'),function(_0x89a6a){return _0x2ae498(_0x89a6a);});_0x58ad5e[_0xa8df('0x6')](0x232a,_0xa8df('0x7d'),function(){console[_0xa8df('0x7e')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3898d7(_0xa8df('0x7f')+0x232a);});});}; \ No newline at end of file +var _0xa264=['answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','callerid','Interval','push','find','omit','undefined','values','channels','voicechannel','validate','length','map','uniqueid','%s.%s','filename','format','wav','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','StopMixMonitor','destinationchannel','stop','queueChannels','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','agents','outboundChannels','campaigns','run','event','custom:','faxAccounts','send','checkAfterSend','http','listen','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','moment','../../../config/environment','../properties','%s/%s','timers','timer','updateAcw','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','name'];(function(_0x5ecf84,_0x23a6e9){var _0x43488c=function(_0x2b09e6){while(--_0x2b09e6){_0x5ecf84['push'](_0x5ecf84['shift']());}};_0x43488c(++_0x23a6e9);}(_0xa264,0x170));var _0x4a26=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0xa264[_0x34ad72];return _0x5c9aa8;};'use strict';var _=require('lodash');var util=require(_0x4a26('0x0'));var jayson=require(_0x4a26('0x1'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0x4a26('0x2'));var config=require(_0x4a26('0x3'));var properties=require(_0x4a26('0x4'));var ami=require('../ami');exports['listen']=function(_0x2b311f,_0x447891,_0x4d66a8){return new BPromise(function(_0xafa3c2,_0x4c6e35){var _0x47acf4={'QueuePause':function(_0x39cf64){return new Promise(function(_0x5e3e6f,_0x2d482c){var _0x173fdd=util['format'](_0x4a26('0x5'),'SIP',_0x39cf64['name']);if(_0x2b311f[_0x4a26('0x6')]&&_0x2b311f[_0x4a26('0x6')][_0x173fdd]&&_0x2b311f[_0x4a26('0x6')][_0x173fdd][_0x4a26('0x7')]){_0x2b311f[_0x4a26('0x6')][_0x173fdd][_0x4a26('0x8')]();}if(_0x2b311f['agents'][_0x173fdd]){_0x2b311f['agents'][_0x173fdd][_0x4a26('0x9')]({'statePause':_0x39cf64[_0x4a26('0xa')]?!![]:![]});}_0x5e3e6f({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x155ad3){var _0x1082c6=this;return new Promise(function(_0x4ac3c2,_0x3a3064){if(ami[_0x4a26('0xb')]()==![]){return _0x3a3064(_0x1082c6[_0x4a26('0xc')](0x1f4,[config[_0x4a26('0xd')]['ip'],config[_0x4a26('0xd')][_0x4a26('0xe')],_0x4a26('0xf')][_0x4a26('0x10')]('\x20')));}_0x155ad3=_[_0x4a26('0x11')](_0x155ad3,_[_0x4a26('0x12')](properties[_0x4a26('0x13')]));_0x155ad3[_0x4a26('0x14')]=_0x4a26('0x15');return ami[_0x4a26('0x16')](_0x155ad3)[_0x4a26('0x17')](function(_0x27e197){_0x4ac3c2({'code':0xc8,'message':_0x27e197[_0x4a26('0x18')]});})[_0x4a26('0x19')](function(_0x15e377){_0x3a3064(_0x1082c6[_0x4a26('0xc')](0x1f5,_0x15e377[_0x4a26('0x18')]));});});},'Command':function(_0x468cf7){var _0x474474=this;return new Promise(function(_0x5a3966,_0x51adf0){if(ami['isConnected']()==![]){return _0x51adf0(_0x474474['error'](0x1f4,[config[_0x4a26('0xd')]['ip'],config['asterisk'][_0x4a26('0xe')],_0x4a26('0xf')]['join']('\x20')));}_0x468cf7=_[_0x4a26('0x11')](_0x468cf7,_0x4a26('0x1a'));_0x468cf7[_0x4a26('0x14')]=_0x4a26('0x1b');return ami[_0x4a26('0x16')](_0x468cf7)['then'](function(_0x2e82a3){_0x5a3966({'code':0xc8,'message':_0x2e82a3[_0x4a26('0x1c')]});})[_0x4a26('0x19')](function(_0x3cdf0a){_0x51adf0(_0x474474[_0x4a26('0xc')](0x1f5,_0x3cdf0a[_0x4a26('0x18')]));});});},'VoiceQueues':function(_0x2a7ed0){return new Promise(function(_0x2d26c6,_0x22ec7e){var _0x1a4878=[];for(var _0x2ab3fa in _0x2b311f[_0x4a26('0x1d')]){if(_0x2b311f[_0x4a26('0x1d')]['hasOwnProperty'](_0x2ab3fa)){var _0x220fe5=_0x2b311f[_0x4a26('0x1d')][_0x2ab3fa];var _0x5381d9={'id':_0x220fe5['id'],'name':_0x220fe5[_0x4a26('0x1e')],'strategy':_0x220fe5['strategy'],'answered':_0x220fe5[_0x4a26('0x1f')],'available':_0x220fe5[_0x4a26('0x20')],'loggedIn':_0x220fe5[_0x4a26('0x21')],'pTalking':_0x220fe5[_0x4a26('0x22')],'sumBillable':_0x220fe5[_0x4a26('0x23')],'sumDuration':_0x220fe5['sumDuration'],'sumHoldTime':_0x220fe5[_0x4a26('0x24')]||0x0,'talking':_0x220fe5['talking'],'total':_0x220fe5[_0x4a26('0x25')],'type':_0x220fe5[_0x4a26('0x26')],'unmanaged':_0x220fe5[_0x4a26('0x27')],'abandoned':_0x220fe5[_0x4a26('0x28')],'waiting':_0x220fe5[_0x4a26('0x29')],'loggedInDb':_0x220fe5['loggedInDb']};if(_0x220fe5[_0x4a26('0x26')]==='outbound'){_0x5381d9[_0x4a26('0x2a')]=_0x220fe5[_0x4a26('0x2a')];_0x5381d9[_0x4a26('0x2b')]=_0x220fe5['dialMethod'];_0x5381d9[_0x4a26('0x2c')]=_0x220fe5[_0x4a26('0x2c')];_0x5381d9[_0x4a26('0x2d')]=_0x220fe5[_0x4a26('0x2d')];_0x5381d9['dialOriginateTimeout']=_0x220fe5[_0x4a26('0x2e')];_0x5381d9[_0x4a26('0x2f')]=_0x220fe5[_0x4a26('0x2f')];_0x5381d9[_0x4a26('0x30')]=_0x220fe5[_0x4a26('0x30')];_0x5381d9[_0x4a26('0x31')]=_0x220fe5[_0x4a26('0x31')];_0x5381d9['outboundAnswerCallsDay']=_0x220fe5[_0x4a26('0x32')];_0x5381d9[_0x4a26('0x33')]=_0x220fe5[_0x4a26('0x33')];_0x5381d9[_0x4a26('0x34')]=_0x220fe5[_0x4a26('0x34')];_0x5381d9[_0x4a26('0x35')]=_0x220fe5[_0x4a26('0x35')];_0x5381d9[_0x4a26('0x36')]=_0x220fe5[_0x4a26('0x36')];_0x5381d9[_0x4a26('0x37')]=_0x220fe5[_0x4a26('0x37')];_0x5381d9[_0x4a26('0x38')]=_0x220fe5['outboundDropCallsDayTimeout'];_0x5381d9[_0x4a26('0x39')]=_0x220fe5[_0x4a26('0x39')];_0x5381d9[_0x4a26('0x3a')]=_0x220fe5[_0x4a26('0x3a')];_0x5381d9[_0x4a26('0x3b')]=_0x220fe5[_0x4a26('0x3b')];_0x5381d9[_0x4a26('0x3c')]=_0x220fe5[_0x4a26('0x3c')];_0x5381d9[_0x4a26('0x3d')]=_0x220fe5['outboundRejectCallsDay'];_0x5381d9['outboundUnknownCallsDay']=_0x220fe5[_0x4a26('0x3e')];_0x5381d9[_0x4a26('0x3f')]=_0x220fe5[_0x4a26('0x3f')];_0x5381d9[_0x4a26('0x40')]=_0x220fe5['predictiveIntervalAvgHoldtime'];_0x5381d9['predictiveIntervalAvgTalktime']=_0x220fe5[_0x4a26('0x41')];_0x5381d9['predictiveIntervalDroppedCallsCallersExit']=_0x220fe5[_0x4a26('0x42')];_0x5381d9[_0x4a26('0x43')]=_0x220fe5[_0x4a26('0x43')];_0x5381d9[_0x4a26('0x44')]=_0x220fe5[_0x4a26('0x44')];_0x5381d9[_0x4a26('0x45')]=_0x220fe5[_0x4a26('0x45')];_0x5381d9[_0x4a26('0x46')]=_0x220fe5[_0x4a26('0x46')];_0x5381d9['predictiveIntervalMultiplicativeFactor']=_0x220fe5[_0x4a26('0x47')];_0x5381d9['predictiveIntervalPauses']=_0x220fe5[_0x4a26('0x48')];_0x5381d9[_0x4a26('0x49')]=_0x220fe5['predictiveIntervalAvailable'];_0x5381d9[_0x4a26('0x4a')]=_0x220fe5[_0x4a26('0x4a')];_0x5381d9[_0x4a26('0x18')]=_0x220fe5[_0x4a26('0x18')];_0x5381d9[_0x4a26('0x4b')]=_0x220fe5[_0x4a26('0x4b')];_0x5381d9[_0x4a26('0x4c')]=_0x220fe5[_0x4a26('0x4c')];_0x5381d9[_0x4a26('0x4d')]=_0x220fe5['erlangCallToSecond'];_0x5381d9[_0x4a26('0x4e')]=_0x220fe5['erlangAbandonmentRate'];_0x5381d9['erlangBusyFactor']=_0x220fe5['erlangBusyFactor'];_0x5381d9['startPredictive']=_0x220fe5[_0x4a26('0x4f')];_0x5381d9[_0x4a26('0x50')]=_0x220fe5[_0x4a26('0x50')];}if(_0x220fe5[_0x4a26('0x51')]){_0x5381d9[_0x4a26('0x51')]={'id':_0x220fe5[_0x4a26('0x51')]['id'],'name':_0x220fe5[_0x4a26('0x51')][_0x4a26('0x1e')],'active':_0x220fe5[_0x4a26('0x51')]['active'],'callerid':_0x220fe5[_0x4a26('0x51')][_0x4a26('0x52')]};}if(_0x220fe5[_0x4a26('0x53')]){_0x5381d9[_0x4a26('0x53')]={'id':_0x220fe5[_0x4a26('0x53')]['id'],'name':_0x220fe5['Interval']['name']};}_0x1a4878[_0x4a26('0x54')](_0x5381d9);}}_0x2d26c6({'count':_0x1a4878['length'],'rows':_0x1a4878});});},'UpdateVoiceQueue':function(_0x5564fe){return new Promise(function(_0xf8251b,_0x181e0c){var _0x16050a=_[_0x4a26('0x55')](_0x2b311f['voiceQueues'],{'id':parseInt(_0x5564fe['id'])});var _0x24c8d7=_[_0x4a26('0x56')](_0x5564fe,['id']);if(_0x16050a){for(var _0x59783c in _0x24c8d7){if(typeof _0x24c8d7[_0x59783c]!==_0x4a26('0x57')&&typeof _0x16050a[_0x59783c]!=='undefined'){_0x16050a[_0x59783c]=_0x24c8d7[_0x59783c];}}_0xf8251b(_0x16050a);}else{_0x181e0c();}});},'VoiceChannels':function(_0x5622b8){return new Promise(function(_0x1e9359,_0x3949a0){var _0x38173f=_[_0x4a26('0x58')](_0x2b311f[_0x4a26('0x59')]);_0x1e9359({'count':_0x38173f['length'],'rows':_0x38173f});});},'VoiceChannelMixMonitor':function(_0x23d3f0){var _0x1a1912=this;return new Promise(function(_0x4a969c,_0x2595a0){if(ami[_0x4a26('0xb')]()==![]){return _0x2595a0(_0x1a1912['error'](0x1f4,[config[_0x4a26('0xd')]['ip'],config[_0x4a26('0xd')][_0x4a26('0xe')],_0x4a26('0xf')]['join']('\x20')));}var _0x1f95ea=schema(properties[_0x4a26('0x5a')])[_0x4a26('0x5b')](_0x23d3f0);if(_0x1f95ea[_0x4a26('0x5c')]>0x0){return _0x2595a0(_0x1a1912['error'](0x1f4,_[_0x4a26('0x5d')](_0x1f95ea,_0x4a26('0x18'))['join'](',\x20')));}var _0x5a9496=_[_0x4a26('0x55')](_0x2b311f[_0x4a26('0x59')],{'uniqueid':_0x23d3f0[_0x4a26('0x5e')]});if(_0x5a9496&&_0x5a9496['channel']){var _0x3ef002=util['format'](_0x4a26('0x5f'),_0x23d3f0[_0x4a26('0x60')]||_0x23d3f0[_0x4a26('0x5e')],_0x23d3f0[_0x4a26('0x61')]||_0x4a26('0x62'));return ami[_0x4a26('0x16')]({'action':'MixMonitor','channel':_0x5a9496[_0x4a26('0x63')],'file':_0x3ef002,'options':_0x4a26('0x64')})[_0x4a26('0x17')](function(_0xbf67c4){var _0x260ab7=_['find'](_0x5a9496[_0x4a26('0x65')],{'filename':_0x4a26('0x66')+_0x3ef002[_0x4a26('0x67')]()});if(_[_0x4a26('0x68')](_0x260ab7)){_0x5a9496[_0x4a26('0x65')][_0x4a26('0x54')]({'filename':_0x4a26('0x66')+_0x3ef002[_0x4a26('0x67')](),'createdAt':moment()['format'](_0x4a26('0x69')),'mixmonitorid':_0xbf67c4[_0x4a26('0x6a')],'status':_0x4a26('0x6b')});}else{_0x260ab7[_0x4a26('0x6a')]=_0xbf67c4[_0x4a26('0x6a')];_0x260ab7[_0x4a26('0x6c')]=_0x4a26('0x6b');}_0x4a969c({'code':0xc8,'message':[_0x23d3f0[_0x4a26('0x5e')],'MixMonitor\x20Success',_0xbf67c4[_0x4a26('0x6a')]][_0x4a26('0x10')]('\x20'),'mixmonitorid':_0xbf67c4['mixmonitorid']});})[_0x4a26('0x19')](function(_0x188bdb){_0x2595a0(_0x1a1912[_0x4a26('0xc')](0x1f5,[_0x23d3f0[_0x4a26('0x5e')],_0x188bdb[_0x4a26('0x18')][_0x4a26('0x67')]()][_0x4a26('0x10')]('\x20')));});}else{return _0x2595a0(_0x1a1912[_0x4a26('0xc')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x400fbb){var _0x27cc0e=this;return new Promise(function(_0x4a8d01,_0x3a5ec2){if(ami['isConnected']()==![]){return _0x3a5ec2(_0x27cc0e[_0x4a26('0xc')](0x1f4,[config[_0x4a26('0xd')]['ip'],config[_0x4a26('0xd')][_0x4a26('0xe')],_0x4a26('0xf')]['join']('\x20')));}var _0x4709d5=schema(properties[_0x4a26('0x5a')])['validate'](_0x400fbb);if(_0x4709d5[_0x4a26('0x5c')]>0x0){return _0x3a5ec2(_0x27cc0e['error'](0x1f4,_[_0x4a26('0x5d')](_0x4709d5,_0x4a26('0x18'))['join'](',\x20')));}var _0x5e7bf8=_['find'](_0x2b311f[_0x4a26('0x59')],{'uniqueid':_0x400fbb[_0x4a26('0x5e')]});if(_0x5e7bf8){return BPromise['resolve']()[_0x4a26('0x17')](function(){if(_0x5e7bf8[_0x4a26('0x63')]){return ami[_0x4a26('0x16')]({'action':_0x4a26('0x6d'),'channel':_0x5e7bf8[_0x4a26('0x63')],'mixmonitorid':_0x400fbb[_0x4a26('0x6a')]})[_0x4a26('0x19')](function(_0x2a8bea){});}})[_0x4a26('0x17')](function(){if(_0x5e7bf8[_0x4a26('0x6e')]){return ami[_0x4a26('0x16')]({'action':_0x4a26('0x6d'),'channel':_0x5e7bf8[_0x4a26('0x6e')],'mixmonitorid':_0x400fbb[_0x4a26('0x6a')]})[_0x4a26('0x19')](function(_0x23d019){});}})[_0x4a26('0x17')](function(_0x5b40e9){var _0x44b4c8=_['find'](_0x5e7bf8[_0x4a26('0x65')],{'mixmonitorid':_0x400fbb[_0x4a26('0x6a')]});if(_0x44b4c8){_0x44b4c8[_0x4a26('0x6c')]=_0x4a26('0x6f');}})[_0x4a26('0x17')](function(){var _0x404b28=util['format']('%s.%s',_0x400fbb[_0x4a26('0x60')]||_0x400fbb[_0x4a26('0x5e')],_0x400fbb[_0x4a26('0x61')]||_0x4a26('0x62'));var _0x4427f7=_[_0x4a26('0x55')](_0x5e7bf8[_0x4a26('0x65')],{'filename':_0x4a26('0x66')+_0x404b28[_0x4a26('0x67')]()});if(_0x4427f7){_0x4427f7[_0x4a26('0x6c')]=_0x4a26('0x6f');}})[_0x4a26('0x17')](function(){_0x4a8d01({'code':0xc8,'message':[_0x400fbb['uniqueid'],'StopMixMonitor\x20Success'][_0x4a26('0x10')]('\x20')});})['catch'](function(_0x199be8){_0x3a5ec2(_0x27cc0e[_0x4a26('0xc')](0x1f5,[_0x400fbb['uniqueid'],_0x199be8[_0x4a26('0x18')][_0x4a26('0x67')]()]['join']('\x20')));});}else{return _0x3a5ec2(_0x27cc0e['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0xe5a78b){return new Promise(function(_0x532198,_0x544479){var _0x1044ba=_[_0x4a26('0x58')](_0x2b311f[_0x4a26('0x70')]);_0x532198({'count':_0x1044ba['length'],'rows':_0x1044ba});});},'VoiceQueuesChannel':function(_0x32af29){var _0x4e1051=this;return new Promise(function(_0x404253,_0x3c3af8){var _0x96bbf2=schema(properties[_0x4a26('0x71')])[_0x4a26('0x5b')](_0x32af29);if(_0x96bbf2['length']>0x0){return _0x3c3af8(_0x4e1051['error'](0x1f4,_[_0x4a26('0x5d')](_0x96bbf2,'message')['join'](',\x20')));}var _0x6f7335=_['find'](_0x2b311f[_0x4a26('0x70')],{'uniqueid':_0x32af29[_0x4a26('0x5e')]});if(_0x6f7335){_0x404253(_0x6f7335);}else{return _0x3c3af8(_0x4e1051[_0x4a26('0xc')](0x1f5,_0x4a26('0x72')));}});},'VoiceQueuesChannelHangup':function(_0x5851fb){var _0x461f3b=this;return new Promise(function(_0x1b6203,_0x31816f){if(ami[_0x4a26('0xb')]()==![]){return _0x31816f(_0x461f3b['error'](0x1f4,[config[_0x4a26('0xd')]['ip'],config[_0x4a26('0xd')][_0x4a26('0xe')],_0x4a26('0xf')][_0x4a26('0x10')]('\x20')));}var _0x1f1a4f=schema(properties[_0x4a26('0x73')])[_0x4a26('0x5b')](_0x5851fb);if(_0x1f1a4f[_0x4a26('0x5c')]>0x0){return _0x31816f(_0x461f3b[_0x4a26('0xc')](0x1f4,_[_0x4a26('0x5d')](_0x1f1a4f,_0x4a26('0x18'))[_0x4a26('0x10')](',\x20')));}var _0x42c42b=_[_0x4a26('0x55')](_0x2b311f[_0x4a26('0x70')],{'uniqueid':_0x5851fb[_0x4a26('0x5e')]});if(_0x42c42b&&_0x42c42b[_0x4a26('0x63')]){return ami[_0x4a26('0x16')]({'action':'Hangup','channel':_0x42c42b[_0x4a26('0x63')]})[_0x4a26('0x17')](function(_0x2b19f5){_0x1b6203({'code':0xc8,'message':[_0x5851fb[_0x4a26('0x5e')],_0x2b19f5['message'][_0x4a26('0x67')]()][_0x4a26('0x10')]('\x20')});})[_0x4a26('0x19')](function(_0x1ee3dc){_0x31816f(_0x461f3b[_0x4a26('0xc')](0x1f5,[_0x5851fb[_0x4a26('0x5e')],_0x1ee3dc[_0x4a26('0x18')][_0x4a26('0x67')]()][_0x4a26('0x10')]('\x20')));});}else{return _0x31816f(_0x461f3b[_0x4a26('0xc')](0x1f5,_0x4a26('0x72')));}});},'VoiceQueuesChannelRedirect':function(_0x2a0223){var _0x4dbcd7=this;return new Promise(function(_0x5eecb4,_0x4ff592){if(ami[_0x4a26('0xb')]()==![]){return _0x4ff592(_0x4dbcd7[_0x4a26('0xc')](0x1f4,[config['asterisk']['ip'],config[_0x4a26('0xd')][_0x4a26('0xe')],_0x4a26('0xf')][_0x4a26('0x10')]('\x20')));}var _0x1ee58d=schema(properties[_0x4a26('0x74')])[_0x4a26('0x5b')](_0x2a0223);if(_0x1ee58d[_0x4a26('0x5c')]>0x0){return _0x4ff592(_0x4dbcd7['error'](0x1f4,_[_0x4a26('0x5d')](_0x1ee58d,_0x4a26('0x18'))[_0x4a26('0x10')](',\x20')));}var _0x418347=_[_0x4a26('0x55')](_0x2b311f[_0x4a26('0x70')],{'uniqueid':_0x2a0223['uniqueid']});if(_0x418347&&_0x418347[_0x4a26('0x63')]){return ami[_0x4a26('0x16')]({'action':_0x4a26('0x75'),'channel':_0x418347[_0x4a26('0x63')],'exten':_0x2a0223[_0x4a26('0x76')],'context':_0x2a0223['context']||_0x418347['context'],'priority':0x1})['then'](function(_0x529374){_0x5eecb4({'code':0xc8,'message':[_0x2a0223[_0x4a26('0x5e')],_0x529374[_0x4a26('0x18')]['toLowerCase']()]['join']('\x20')});})[_0x4a26('0x19')](function(_0x4a018f){_0x4ff592(_0x4dbcd7[_0x4a26('0xc')](0x1f5,[_0x2a0223[_0x4a26('0x5e')],_0x4a018f[_0x4a26('0x18')]['toLowerCase']()][_0x4a26('0x10')]('\x20')));});}else{return _0x4ff592(_0x4dbcd7[_0x4a26('0xc')](0x1f5,_0x4a26('0x72')));}});},'Agents':function(_0x357592){return new Promise(function(_0x3325b4,_0x289533){var _0x42f9ed=_['values'](_0x2b311f[_0x4a26('0x77')]);_0x3325b4({'count':_0x42f9ed[_0x4a26('0x5c')],'rows':_0x42f9ed});});},'Telephones':function(_0x3cbcd3){return new Promise(function(_0x253cf5,_0x4f5680){var _0xdede46=_[_0x4a26('0x58')](_0x2b311f['telephones']);_0x253cf5({'count':_0xdede46[_0x4a26('0x5c')],'rows':_0xdede46});});},'Trunks':function(_0x390ec5){return new Promise(function(_0x240413,_0x3f1d53){var _0x4e11d1=_[_0x4a26('0x58')](_0x2b311f['trunks']);_0x240413({'count':_0x4e11d1['length'],'rows':_0x4e11d1});});},'OutboundChannels':function(_0x545050){return new Promise(function(_0x2b1ac3,_0x513cbf){var _0x31256c=_[_0x4a26('0x58')](_0x2b311f[_0x4a26('0x78')]);_0x2b1ac3({'count':_0x31256c[_0x4a26('0x5c')],'rows':_0x31256c});});},'Outbound':function(_0x20c5c4){return new Promise(function(_0x137618,_0x37e70b){_0x137618(_0x2b311f['outbound']);});},'Campaigns':function(_0x1e3eee){return new Promise(function(_0x4631e9,_0x4c2eaf){var _0x54e210=_['values'](_0x2b311f[_0x4a26('0x79')]);_0x4631e9({'count':_0x54e210[_0x4a26('0x5c')],'rows':_0x54e210});});},'VoiceQueuesPreview':function(_0x4a0c2d){var _0x5650cc=this;return new Promise(function(_0x6d2e1c,_0x1ccc33){_0x447891[_0x4a26('0x7a')](_0x4a0c2d['id'])[_0x4a26('0x17')](function(_0x164189){_0x6d2e1c({'code':0xc8,'message':_0x164189[_0x4a26('0x18')]});})[_0x4a26('0x19')](function(_0x2ee7cc){_0x1ccc33(_0x5650cc[_0x4a26('0xc')](0x1f4,_0x2ee7cc[_0x4a26('0x18')]));});});},'EventManager':function(_0x1758b9){var _0x2760d4=this;return new Promise(function(_0x17f763,_0x3afd2a){if(!_0x1758b9[_0x4a26('0x7b')]){return _0x3afd2a(_0x2760d4[_0x4a26('0xc')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x4a26('0x7c')+_0x1758b9[_0x4a26('0x7b')],_0x1758b9[_0x4a26('0x18')]);_0x17f763({'code':0xc8,'message':_0x1758b9});});},'FaxAccounts':function(_0x478bcf){return new Promise(function(_0xe62757,_0x2d4c27){var _0x3debbe=_[_0x4a26('0x58')](_0x2b311f[_0x4a26('0x7d')]);_0xe62757({'count':_0x3debbe[_0x4a26('0x5c')],'rows':_0x3debbe});});},'SendFax':function(_0x566cfe){var _0x4e2bfa=this;return new Promise(function(_0x4ddc62,_0x59b149){_0x4d66a8[_0x4a26('0x7e')](_0x566cfe)[_0x4a26('0x17')](function(_0x498372){_0x4ddc62({'code':0xc8,'message':_0x498372[_0x4a26('0x18')]});})['catch'](function(_0x555536){_0x59b149(_0x4e2bfa[_0x4a26('0xc')](0x1f4,_0x555536[_0x4a26('0x18')]));});});},'CheckAfterSend':function(_0x2f3ea7){var _0x3b536a=this;return new Promise(function(_0x4566a9,_0x1b3095){_0x4d66a8[_0x4a26('0x7f')](_0x2f3ea7)['then'](function(_0x488bf3){_0x4566a9({'code':0xc8,'message':_0x488bf3[_0x4a26('0x18')]});})['catch'](function(_0x5c17dd){_0x1b3095(_0x3b536a['error'](0x1f4,_0x5c17dd[_0x4a26('0x18')]));});});}};var _0x447a07=jayson['server'](_0x47acf4)[_0x4a26('0x80')]();_0x447a07['on'](_0x4a26('0xc'),function(_0x5ea637){return _0x4c6e35(_0x5ea637);});_0x447a07[_0x4a26('0x81')](0x232a,_0x4a26('0x82'),function(){console['log'](_0x4a26('0x83'),0x232a);return _0xafa3c2(_0x4a26('0x84')+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 be65530..d6b23cc 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 _0x4e0f=['length','[CM][%s][%s]\x20Contact\x20found:%s','map','info','[CM][%s][%s]\x20Contact\x20not\x20found','uniqueid','data4','isNil','firstName','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','name','trigger:%s','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty'];(function(_0x143291,_0x520ebc){var _0x4e56b5=function(_0x1659ef){while(--_0x1659ef){_0x143291['push'](_0x143291['shift']());}};_0x4e56b5(++_0x520ebc);}(_0x4e0f,0x1ac));var _0xf4e0=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x4e0f[_0x2850c0];return _0x21e830;};'use strict';var _=require(_0xf4e0('0x0'));var BPromise=require(_0xf4e0('0x1'));var Redis=require('ioredis');var util=require(_0xf4e0('0x2'));var config=require(_0xf4e0('0x3'));var logger=require(_0xf4e0('0x4'))(_0xf4e0('0x5'));var cmContactRpc=require(_0xf4e0('0x6'));config[_0xf4e0('0x7')]=_[_0xf4e0('0x8')](config[_0xf4e0('0x7')],{'host':_0xf4e0('0x9'),'port':0x18eb});var io=require(_0xf4e0('0xa'))(new Redis(config[_0xf4e0('0x7')]));function emit(_0x23b996,_0x21b512,_0x5c8d0b,_0xb56283,_0x27ce0c){logger['info'](_0xf4e0('0xb'),_0x23b996,_0x21b512['id'],_0x5c8d0b,_0xb56283,JSON[_0xf4e0('0xc')](_0x27ce0c));io['to'](_0x5c8d0b)[_0xf4e0('0xd')](_0xb56283,_0x27ce0c);}exports[_0xf4e0('0xe')]=function(_0x284a21,_0x3cafe9,_0x2af35b,_0x4e9781){var _0x320797,_0x302356;var _0xd409e6={};var _0x2b70c0=Number(_0x2af35b[_0xf4e0('0xf')]);var _0x54c006=_0x2af35b[_0xf4e0('0x10')]?Boolean(Number(_0x2af35b[_0xf4e0('0x10')])):![];var _0x4b7f09;if(_0x4e9781[_0xf4e0('0x11')]){_0xd409e6['id']=_0x4e9781[_0xf4e0('0x11')];}if(!_0xd409e6['id']){_0xd409e6[_0xf4e0('0x12')]=_0x2b70c0;_0x4b7f09=_0x2af35b[_0xf4e0('0x13')]&&_0x2af35b[_0xf4e0('0x13')]!=='0'?_0x2af35b['data3'][_0xf4e0('0x14')](','):[_0xf4e0('0x15')];_0xd409e6[_0xf4e0('0x16')]=_['map'](_0x4b7f09,function(_0xa66e0f){var _0x142e7e={};_0x142e7e[_0xa66e0f]=_0x4e9781[_0xf4e0('0x17')]?_0x4e9781[_0xf4e0('0x18')]:_0x4e9781['calleridnum'];return _0x142e7e;});}var _0x395ed0=['id','firstName',_0xf4e0('0x19'),_0xf4e0('0x15'),_0xf4e0('0x1a'),_0xf4e0('0x1b'),_0xf4e0('0x12'),_0xf4e0('0x1c'),_0xf4e0('0x1d'),_0xf4e0('0x1e')];var _0x33edaa=_[_0xf4e0('0x1f')](_0x395ed0,_0x4b7f09);BPromise[_0xf4e0('0x20')]()[_0xf4e0('0x21')](cmContactRpc[_0xf4e0('0x22')]({'attributes':_0x33edaa,'where':_0xd409e6}))[_0xf4e0('0x21')](function(_0x435afc){_0x302356=_0x435afc;if(!_[_0xf4e0('0x23')](_0x302356)){if(_0x302356[_0xf4e0('0x24')]===0x1){_0x320797=_0x302356[0x0];logger['info'](_0xf4e0('0x25'),_0x4e9781['uniqueid'],_0x3cafe9['id'],_0x320797['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x4e9781['uniqueid'],_0x3cafe9['id'],_[_0xf4e0('0x26')](_0x302356,'id')['join'](','));}return;}else{logger[_0xf4e0('0x27')](_0xf4e0('0x28'),_0x4e9781[_0xf4e0('0x29')],_0x3cafe9['id']);var _0x511289={'ListId':_0x2b70c0};var _0x3cb6c3=_0x2af35b[_0xf4e0('0x2a')]&&_0x2af35b[_0xf4e0('0x2a')]!=='0'?_0x2af35b[_0xf4e0('0x2a')]:'phone';if(_0x54c006){logger[_0xf4e0('0x27')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x4e9781['uniqueid'],_0x3cafe9['id']);_0x511289[_0x3cb6c3]=_['isNil'](_0x4e9781[_0xf4e0('0x17')])?_0x4e9781['calleridnum']:_0x4e9781[_0xf4e0('0x18')];if(_[_0xf4e0('0x2b')](_0x4e9781[_0xf4e0('0x17')])){_0x511289[_0xf4e0('0x2c')]=_0x4e9781[_0xf4e0('0x2d')]&&_0x4e9781[_0xf4e0('0x2d')]!==_0xf4e0('0x2e')?_0x4e9781[_0xf4e0('0x2d')]:_0xf4e0('0x2f');}else{_0x511289[_0xf4e0('0x2c')]=_0x4e9781[_0xf4e0('0x30')]&&_0x4e9781[_0xf4e0('0x30')]!==_0xf4e0('0x2e')?_0x4e9781[_0xf4e0('0x30')]:_0xf4e0('0x2f');}return BPromise[_0xf4e0('0x20')]()[_0xf4e0('0x21')](cmContactRpc[_0xf4e0('0x31')](_0x511289))[_0xf4e0('0x21')](function(_0x2ba88b){_0x320797=_0x2ba88b;_0x302356['push'](_0x2ba88b);if(_0x320797){logger['info'](_0xf4e0('0x32'),_0x4e9781[_0xf4e0('0x29')],_0x3cafe9['id'],_0x320797['id']);}return;});}else{logger[_0xf4e0('0x27')](_0xf4e0('0x33'),_0x4e9781[_0xf4e0('0x29')],_0x3cafe9['id']);_0x511289[_0x3cb6c3]=_[_0xf4e0('0x2b')](_0x4e9781[_0xf4e0('0x17')])?_0x4e9781['calleridnum']:_0x4e9781[_0xf4e0('0x18')];if(_[_0xf4e0('0x2b')](_0x4e9781[_0xf4e0('0x17')])){_0x511289[_0xf4e0('0x2c')]=_0x4e9781[_0xf4e0('0x2d')]&&_0x4e9781[_0xf4e0('0x2d')]!==_0xf4e0('0x2e')?_0x4e9781[_0xf4e0('0x2d')]:_0xf4e0('0x2f');}else{_0x511289['firstName']=_0x4e9781[_0xf4e0('0x30')]&&_0x4e9781['destcalleridname']!==_0xf4e0('0x2e')?_0x4e9781[_0xf4e0('0x30')]:_0xf4e0('0x2f');}_0x320797=_0x511289;_0x302356[_0xf4e0('0x34')](_0x511289);return;}}})['then'](function(){if(_0x284a21){emit(_0x4e9781[_0xf4e0('0x29')],_0x3cafe9,util[_0xf4e0('0x35')]('user:%s',_0x284a21[_0xf4e0('0x36')]),util['format'](_0xf4e0('0x37'),_0x2af35b['action'][_0xf4e0('0x38')]()),{'evt':_[_0xf4e0('0x39')](_0x4e9781,{'autoCreate':_0x54c006}),'contact':_0x320797===undefined?{}:_0x320797,'contacts':_0x302356['length']===0x0?undefined:_0x302356});}});}; \ No newline at end of file +var _0xd9da=['merge','length','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','localhost','info','[CM][%s][%s]','stringify','exec','data2','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridnum','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','action','toLowerCase'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xd9da,0xe2));var _0xad9d=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xd9da[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xad9d('0x0'));var BPromise=require(_0xad9d('0x1'));var Redis=require(_0xad9d('0x2'));var util=require('util');var config=require(_0xad9d('0x3'));var logger=require(_0xad9d('0x4'))('trigger');var cmContactRpc=require(_0xad9d('0x5'));config[_0xad9d('0x6')]=_['defaults'](config[_0xad9d('0x6')],{'host':_0xad9d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xad9d('0x6')]));function emit(_0x3ce9a2,_0x4efa88,_0xbf07df,_0x276de7,_0x82ff3b){logger[_0xad9d('0x8')](_0xad9d('0x9'),_0x3ce9a2,_0x4efa88['id'],_0xbf07df,_0x276de7,JSON[_0xad9d('0xa')](_0x82ff3b));io['to'](_0xbf07df)['emit'](_0x276de7,_0x82ff3b);}exports[_0xad9d('0xb')]=function(_0x527507,_0x18946b,_0x2171ae,_0x588710){var _0x3e21af,_0x496848;var _0xe2260b={};var _0xadd89=Number(_0x2171ae['data1']);var _0x47a093=_0x2171ae[_0xad9d('0xc')]?Boolean(Number(_0x2171ae[_0xad9d('0xc')])):![];var _0x560fe7;if(_0x588710[_0xad9d('0xd')]){_0xe2260b['id']=_0x588710['xmd-contactid'];}if(!_0xe2260b['id']){_0xe2260b[_0xad9d('0xe')]=_0xadd89;_0x560fe7=_0x2171ae['data3']&&_0x2171ae[_0xad9d('0xf')]!=='0'?_0x2171ae[_0xad9d('0xf')][_0xad9d('0x10')](','):[_0xad9d('0x11')];_0xe2260b[_0xad9d('0x12')]=_[_0xad9d('0x13')](_0x560fe7,function(_0x165757){var _0x359747={};_0x359747[_0x165757]=_0x588710['routeId']?_0x588710[_0xad9d('0x14')]:_0x588710['calleridnum'];return _0x359747;});}var _0x205b17=['id',_0xad9d('0x15'),_0xad9d('0x16'),'phone',_0xad9d('0x17'),_0xad9d('0x18'),_0xad9d('0xe'),_0xad9d('0x19'),'scheduledAt',_0xad9d('0x1a')];var _0x23b65d=_[_0xad9d('0x1b')](_0x205b17,_0x560fe7);BPromise[_0xad9d('0x1c')]()[_0xad9d('0x1d')](cmContactRpc[_0xad9d('0x1e')]({'attributes':_0x23b65d,'where':_0xe2260b}))['then'](function(_0x1c5f1b){_0x496848=_0x1c5f1b;if(!_[_0xad9d('0x1f')](_0x496848)){if(_0x496848['length']===0x1){_0x3e21af=_0x496848[0x0];logger[_0xad9d('0x8')](_0xad9d('0x20'),_0x588710[_0xad9d('0x21')],_0x18946b['id'],_0x3e21af['id']);}else{logger[_0xad9d('0x8')](_0xad9d('0x22'),_0x588710[_0xad9d('0x21')],_0x18946b['id'],_[_0xad9d('0x13')](_0x496848,'id')[_0xad9d('0x23')](','));}return;}else{logger[_0xad9d('0x8')](_0xad9d('0x24'),_0x588710[_0xad9d('0x21')],_0x18946b['id']);var _0x2e157b={'ListId':_0xadd89};var _0x5a98bd=_0x2171ae[_0xad9d('0x25')]&&_0x2171ae['data4']!=='0'?_0x2171ae[_0xad9d('0x25')]:'phone';if(_0x47a093){logger['info'](_0xad9d('0x26'),_0x588710[_0xad9d('0x21')],_0x18946b['id']);_0x2e157b[_0x5a98bd]=_[_0xad9d('0x27')](_0x588710[_0xad9d('0x28')])?_0x588710[_0xad9d('0x29')]:_0x588710[_0xad9d('0x14')];if(_[_0xad9d('0x27')](_0x588710[_0xad9d('0x28')])){_0x2e157b[_0xad9d('0x15')]=_0x588710[_0xad9d('0x2a')]&&_0x588710[_0xad9d('0x2a')]!==_0xad9d('0x2b')?_0x588710[_0xad9d('0x2a')]:_0xad9d('0x2c');}else{_0x2e157b[_0xad9d('0x15')]=_0x588710[_0xad9d('0x2d')]&&_0x588710[_0xad9d('0x2d')]!==_0xad9d('0x2b')?_0x588710[_0xad9d('0x2d')]:'Unknown';}return BPromise['resolve']()['then'](cmContactRpc[_0xad9d('0x2e')](_0x2e157b))[_0xad9d('0x1d')](function(_0xdc81ca){_0x3e21af=_0xdc81ca;_0x496848[_0xad9d('0x2f')](_0xdc81ca);if(_0x3e21af){logger[_0xad9d('0x8')](_0xad9d('0x30'),_0x588710['uniqueid'],_0x18946b['id'],_0x3e21af['id']);}return;});}else{logger[_0xad9d('0x8')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x588710[_0xad9d('0x21')],_0x18946b['id']);_0x2e157b[_0x5a98bd]=_[_0xad9d('0x27')](_0x588710[_0xad9d('0x28')])?_0x588710[_0xad9d('0x29')]:_0x588710[_0xad9d('0x14')];if(_[_0xad9d('0x27')](_0x588710['routeId'])){_0x2e157b[_0xad9d('0x15')]=_0x588710['calleridname']&&_0x588710[_0xad9d('0x2a')]!==_0xad9d('0x2b')?_0x588710[_0xad9d('0x2a')]:'Unknown';}else{_0x2e157b[_0xad9d('0x15')]=_0x588710[_0xad9d('0x2d')]&&_0x588710[_0xad9d('0x2d')]!==_0xad9d('0x2b')?_0x588710['destcalleridname']:_0xad9d('0x2c');}_0x3e21af=_0x2e157b;_0x496848[_0xad9d('0x2f')](_0x2e157b);return;}}})[_0xad9d('0x1d')](function(){if(_0x527507){emit(_0x588710[_0xad9d('0x21')],_0x18946b,util[_0xad9d('0x31')](_0xad9d('0x32'),_0x527507[_0xad9d('0x33')]),util[_0xad9d('0x31')]('trigger:%s',_0x2171ae[_0xad9d('0x34')][_0xad9d('0x35')]()),{'evt':_[_0xad9d('0x36')](_0x588710,{'autoCreate':_0x47a093}),'contact':_0x3e21af===undefined?{}:_0x3e21af,'contacts':_0x496848[_0xad9d('0x37')]===0x0?undefined:_0x496848});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 9e83e39..29bdaa6 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 _0x8bd4=['stringify','clone','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','contactmanager','motionbar','browser','data1','TemplateId','html','data2','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','windowWidth','data5','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','action','jscripty','trigger:%s','toLowerCase','integration','exec','accounts','routeId','urlforward','script','query','search','every','AllConditions','checkConditions','channel','AnyConditions','some','account','ChatWebsiteId','operator','value','upperFirst','interaction','message','event','queue','agent','membername','lastevent','lodash','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','trigger','../ami','defaults','redis','localhost','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info'];(function(_0x21f577,_0x31b275){var _0xd342d5=function(_0x27988f){while(--_0x27988f){_0x21f577['push'](_0x21f577['shift']());}};_0xd342d5(++_0x31b275);}(_0x8bd4,0xb9));var _0x48bd=function(_0x38865a,_0x47fc4d){_0x38865a=_0x38865a-0x0;var _0x538fdc=_0x8bd4[_0x38865a];return _0x538fdc;};'use strict';var util=require('util');var _=require(_0x48bd('0x0'));var url=require('url');var Mustache=require(_0x48bd('0x1'));var Redis=require(_0x48bd('0x2'));var urlforward=require(_0x48bd('0x3'));var integration=require(_0x48bd('0x4'));var cmContact=require(_0x48bd('0x5'));var script=require(_0x48bd('0x6'));var config=require(_0x48bd('0x7'));var logger=require('../../../config/logger')(_0x48bd('0x8'));var ami=require(_0x48bd('0x9'));config['redis']=_[_0x48bd('0xa')](config[_0x48bd('0xb')],{'host':_0x48bd('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x48bd('0xb')]));var operators={'equals':function(_0x5d14aa,_0x979e80){return _0x5d14aa==_0x979e80;},'not_equals':function(_0x4dfeab,_0x5497a7){return _0x4dfeab!=_0x5497a7;}};var barAndWebActions=[_0x48bd('0xd'),_0x48bd('0xe'),_0x48bd('0xf')];function Trigger(_0x1ec816){this['triggers']=_0x1ec816[_0x48bd('0x10')];this['agents']=_0x1ec816[_0x48bd('0x11')];this[_0x48bd('0x12')]=_0x1ec816[_0x48bd('0x12')];this[_0x48bd('0x13')]=_0x1ec816[_0x48bd('0x13')];this[_0x48bd('0x14')]=_0x1ec816[_0x48bd('0x14')];this[_0x48bd('0x15')]=_0x1ec816['zendeskAccounts'];this[_0x48bd('0x16')]=_0x1ec816[_0x48bd('0x16')];this[_0x48bd('0x17')]=_0x1ec816[_0x48bd('0x17')];this['sugarcrmAccounts']=_0x1ec816[_0x48bd('0x18')];this[_0x48bd('0x19')]=_0x1ec816['zohoAccounts'];this[_0x48bd('0x1a')]=_0x1ec816[_0x48bd('0x1a')];this[_0x48bd('0x1b')]=_0x1ec816['vtigerAccounts'];this[_0x48bd('0x1c')]=_0x1ec816[_0x48bd('0x1c')];this[_0x48bd('0x1d')]=_0x1ec816[_0x48bd('0x1d')];this[_0x48bd('0x1e')]=_0x1ec816[_0x48bd('0x1e')];this['accounts']={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x48bd('0x17')],'freshdesk':this[_0x48bd('0x16')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this['zohoAccounts'],'desk':this[_0x48bd('0x1a')],'vtiger':this[_0x48bd('0x1b')],'dynamics365':this[_0x48bd('0x1d')],'freshsales':this[_0x48bd('0x1e')],'servicenow':this['servicenowAccounts']};ami['on'](_0x48bd('0x1f'),this['syncCustomEvent'][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x21'),this[_0x48bd('0x22')][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x23'),this[_0x48bd('0x22')]['bind'](this));ami['on'](_0x48bd('0x24'),this['syncCustomEvent'][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x25'),this[_0x48bd('0x22')]['bind'](this));ami['on']('custom:agentnoanswer',this[_0x48bd('0x22')][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x26'),this[_0x48bd('0x22')][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x27'),this['syncCustomEvent'][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x28'),this['syncCustomEvent'][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x29'),this['syncCustomEvent'][_0x48bd('0x20')](this));ami['on']('custom:timeout',this[_0x48bd('0x22')]['bind'](this));ami['on'](_0x48bd('0x2a'),this[_0x48bd('0x2b')][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x2c'),this[_0x48bd('0x2b')][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x2d'),this['syncAgentDial'][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x2e'),this['syncCustomEvent'][_0x48bd('0x20')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x2f'),this[_0x48bd('0x22')][_0x48bd('0x20')](this));ami['on']('custom:outgoingmessage',this[_0x48bd('0x22')][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x30'),this['syncCustomEvent'][_0x48bd('0x20')](this));ami['on'](_0x48bd('0x31'),this[_0x48bd('0x22')][_0x48bd('0x20')](this));}Trigger[_0x48bd('0x32')][_0x48bd('0x33')]=function(_0x2d5e2c,_0x201cf9,_0x4e37e2){logger[_0x48bd('0x34')](_0x2d5e2c,_0x201cf9,JSON[_0x48bd('0x35')](_0x4e37e2));io['to'](_0x2d5e2c)[_0x48bd('0x33')](_0x201cf9,_0x4e37e2);};Trigger[_0x48bd('0x32')][_0x48bd('0x22')]=function(_0x5d513e){var _0x517d98=_[_0x48bd('0x36')](_0x5d513e);this[_0x48bd('0x37')](_0x517d98);};Trigger[_0x48bd('0x32')][_0x48bd('0x2b')]=function(_0x1a2840){if(this[_0x48bd('0x11')][_0x1a2840[_0x48bd('0x38')]]){this[_0x48bd('0x22')](_0x1a2840);}};Trigger[_0x48bd('0x32')][_0x48bd('0x37')]=function(_0x38eb9a){var _0x11e958;for(var _0x192f18 in this['triggers']){if(this[_0x48bd('0x10')][_0x48bd('0x39')](_0x192f18)){if(this[_0x48bd('0x10')][_0x192f18][_0x48bd('0x3a')]){_0x11e958=this[_0x48bd('0x3b')](this[_0x48bd('0x10')][_0x192f18],_0x38eb9a);if(_0x11e958){_[_0x48bd('0x3c')](_0x38eb9a,_0x38eb9a[_0x48bd('0x3d')]);for(var _0x260927=0x0,_0x384df3,_0x423502,_0x27be9f;_0x2609270x0){_0x3f654c=_[_0xaa0b('0x2b')](_0x186029,_0x17c971);}return _0x3f654c;}function getCustomFields(_0x1bcd59,_0x241d17){var _0x2d9991=[];var _0x6fc96b={'custom_fields':{}};if(_0x1bcd59[_0xaa0b('0x2a')]>0x0){_[_0xaa0b('0x2c')](_0x1bcd59,function(_0x4f4dae){if(_[_0xaa0b('0x2d')](['string',_0xaa0b('0x2e')],_0x4f4dae[_0xaa0b('0x2f')])&&_0x4f4dae['nameField']&&!_0x4f4dae['customField']){_0x6fc96b[_0x4f4dae[_0xaa0b('0x30')][_0xaa0b('0x31')]()]=_0x4f4dae[_0xaa0b('0x32')][_0xaa0b('0x24')]();}else if(_[_0xaa0b('0x2d')](['string',_0xaa0b('0x2e')],_0x4f4dae['type'])&&_0x4f4dae['idField']&&_0x4f4dae[_0xaa0b('0x33')]){_0x6fc96b[_0xaa0b('0x34')][_0x4f4dae['idField']]=_0x4f4dae[_0xaa0b('0x32')]['toString']();}else if(_0x4f4dae[_0xaa0b('0x2f')]===_0xaa0b('0x35')&&_0x4f4dae[_0xaa0b('0x36')]&&_0x4f4dae[_0xaa0b('0x37')]&&_0x4f4dae[_0xaa0b('0x33')]){_0x241d17[_0x4f4dae[_0xaa0b('0x36')]]&&(_0x6fc96b[_0xaa0b('0x34')][_0x4f4dae[_0xaa0b('0x37')]]=_0x241d17[_0x4f4dae['variableName']][_0xaa0b('0x24')]());}else if(_0x4f4dae['type']===_0xaa0b('0x38')&&_0x4f4dae[_0xaa0b('0x39')]&&_0x4f4dae[_0xaa0b('0x39')]['name']&&_0x4f4dae[_0xaa0b('0x37')]&&_0x4f4dae['customField']){_0x241d17[_0x4f4dae[_0xaa0b('0x39')][_0xaa0b('0x3a')][_0xaa0b('0x31')]()]&&(_0x6fc96b['custom_fields'][_0x4f4dae[_0xaa0b('0x37')]]=_0x241d17[_0x4f4dae['Variable']['name']['toLowerCase']()][_0xaa0b('0x24')]());}});}if(_0x6fc96b[_0xaa0b('0x3b')]){_0x6fc96b['priority']=Number(_0x6fc96b[_0xaa0b('0x3b')]);}return _0x6fc96b;}function getTicket(_0x546f9e,_0x20b09f,_0x46c9a9,_0x273857,_0x2f1c6e){logger[_0xaa0b('0xd')](_0xaa0b('0x3c'));var _0x28a04d=_[_0xaa0b('0x3d')]({'subject':intUtil[_0xaa0b('0x3e')](_0x273857[_0xaa0b('0x3f')],_0x2f1c6e,'\x20'),'type':'phone','status':'new','labels':[_0xaa0b('0x40'),_0xaa0b('0x41'),_0xaa0b('0x42')][_0xaa0b('0x43')](getTags(_0x273857[_0xaa0b('0x44')],_0xaa0b('0x3a'))),'description':intUtil[_0xaa0b('0x3e')](_0x273857[_0xaa0b('0x45')],_0x2f1c6e,'\x0a'),'_links':{'assigned_user':{'href':util[_0xaa0b('0xf')](_0xaa0b('0x46'),_0x20b09f['id']),'class':_0xaa0b('0x47')}},'message':{'direction':'in','body':intUtil[_0xaa0b('0x3e')](_0x273857[_0xaa0b('0x45')],_0x2f1c6e,'\x0a')}},getCustomFields(_0x273857[_0xaa0b('0x48')],_0x2f1c6e));return request({'uri':util[_0xaa0b('0xf')](_0xaa0b('0x49'),_0x546f9e[_0xaa0b('0x11')],_0x46c9a9['id']),'method':_0xaa0b('0x28'),'body':_0x28a04d});}exports[_0xaa0b('0x4a')]=function(_0x24de48,_0xc7481c,_0x58497a,_0x5460d4,_0x268b25,_0x54d1a4){var _0x2f90b6,_0x2a126d;_0x54d1a4[_0xaa0b('0x11')]=intUtil[_0xaa0b('0x4b')](_0x54d1a4[_0xaa0b('0x11')]);_0x54d1a4['serverUrl']=intUtil['stripTrailingSlash'](_0x54d1a4[_0xaa0b('0x4c')]);if(_0x268b25&&_0x268b25[_0xaa0b('0x4d')]){logger['info'](_0xaa0b('0x4e'),'Recording\x20is\x20enabled!');_0xc7481c[_0xaa0b('0x4f')]=util[_0xaa0b('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x54d1a4[_0xaa0b('0x4c')],_0xc7481c['uniqueid'],md5(_0xc7481c[_0xaa0b('0x50')]));}else{_0xc7481c['recordingURL']='';}headers['Authorization']=getAuth(_0x54d1a4);return getUser(_0x54d1a4,_0x5460d4[_0xaa0b('0x51')])[_0xaa0b('0x12')](function(_0x2e195d){_0x2f90b6=_0x2e195d;logger[_0xaa0b('0xd')]('The\x20User\x20ID\x20is:',_0x2f90b6['id']);return getEndUser(_0x54d1a4,_0xc7481c[_0xaa0b('0x52')],_0xc7481c[_0xaa0b('0x53')]);})[_0xaa0b('0x12')](function(_0x2c9a71){_0x2a126d=_0x2c9a71;logger[_0xaa0b('0xd')](_0xaa0b('0x54'),_0x2a126d['id']);return getTicket(_0x54d1a4,_0x2f90b6,_0x2a126d,_0x58497a,_0xc7481c);})[_0xaa0b('0x12')](function(_0x2b8f42){if(_0x2b8f42){logger[_0xaa0b('0xd')]('Ticket\x20created!');logger['info'](_0xaa0b('0x55'),_0x2b8f42['id']);switch(_0x54d1a4[_0xaa0b('0x2f')]){case _0xaa0b('0x56'):logger['info'](_0xaa0b('0x4e'),_0xaa0b('0x57'));emit(util['format'](_0xaa0b('0x58'),_0x5460d4['name']),_0xaa0b('0x59'),{'recordId':_0x2b8f42['id']});break;case _0xaa0b('0x5a'):logger['info'](_0xaa0b('0x4e'),_0xaa0b('0x5b'));emit(util[_0xaa0b('0xf')](_0xaa0b('0x58'),_0x5460d4[_0xaa0b('0x3a')]),_0xaa0b('0x5c'),{'uri':util[_0xaa0b('0xf')](_0xaa0b('0x5d'),_0x2b8f42['id'])});break;default:logger[_0xaa0b('0x5e')]('[QUEUE]',_0xaa0b('0x5f'));}}})[_0xaa0b('0x60')](function(_0x370d14){console[_0xaa0b('0x5e')](_0x370d14);logger[_0xaa0b('0x5e')]('[QUEUE]',JSON[_0xaa0b('0x61')](_0x370d14));});};exports['outbound']=function(_0x589ab9,_0x59d351,_0x5bd3ff,_0x2ca471,_0x3df98f,_0x7ad990,_0x1248ae){var _0x2665f4,_0x5f50da;_0x7ad990[_0xaa0b('0x11')]=intUtil[_0xaa0b('0x4b')](_0x7ad990['remoteUri']);_0x7ad990['serverUrl']=intUtil[_0xaa0b('0x4b')](_0x7ad990[_0xaa0b('0x4c')]);if(_0x1248ae&&_0x1248ae['recordingFormat']&&_0x1248ae[_0xaa0b('0x62')]!==_0xaa0b('0x63')){logger[_0xaa0b('0xd')](_0xaa0b('0x64'),'Recording\x20is\x20enabled!');_0x59d351[_0xaa0b('0x4f')]=util['format'](_0xaa0b('0x65'),_0x7ad990['serverUrl'],_0x59d351[_0xaa0b('0x50')],md5(_0x59d351[_0xaa0b('0x50')]));}headers['Authorization']=getAuth(_0x7ad990);return getUser(_0x7ad990,_0x2ca471['email'])[_0xaa0b('0x12')](function(_0x160a9c){_0x2665f4=_0x160a9c;logger[_0xaa0b('0xd')](_0xaa0b('0x66'),_0x2665f4['id']);return getEndUser(_0x7ad990,_0x59d351[_0xaa0b('0x67')],_0x59d351[_0xaa0b('0x68')]);})[_0xaa0b('0x12')](function(_0x3f4ff3){_0x5f50da=_0x3f4ff3;logger[_0xaa0b('0xd')](_0xaa0b('0x54'),_0x5f50da['id']);return getTicket(_0x7ad990,_0x2665f4,_0x5f50da,_0x5bd3ff,_0x59d351);})[_0xaa0b('0x12')](function(_0x8eebaa){if(_0x8eebaa){logger[_0xaa0b('0xd')](_0xaa0b('0x69'));logger[_0xaa0b('0xd')](_0xaa0b('0x55'),_0x8eebaa['id']);switch(_0x7ad990['type']){case _0xaa0b('0x56'):logger[_0xaa0b('0xd')]('[QUEUE]',_0xaa0b('0x57'));emit(util[_0xaa0b('0xf')]('user:%s',_0x2ca471[_0xaa0b('0x3a')]),_0xaa0b('0x59'),{'recordId':_0x8eebaa['id']});break;case _0xaa0b('0x5a'):logger[_0xaa0b('0xd')](_0xaa0b('0x4e'),_0xaa0b('0x5b'));emit(util[_0xaa0b('0xf')](_0xaa0b('0x58'),_0x2ca471['name']),_0xaa0b('0x5c'),{'uri':util[_0xaa0b('0xf')](_0xaa0b('0x6a'),_0x7ad990['remoteUri'],_0x8eebaa['id'])});break;default:logger[_0xaa0b('0x5e')](_0xaa0b('0x64'),_0xaa0b('0x5f'));}}})[_0xaa0b('0x60')](function(_0x1fe2fa){logger['error'](_0xaa0b('0x64'),JSON[_0xaa0b('0x61')](_0x1fe2fa));});};exports[_0xaa0b('0x6b')]=function(_0x5d8b68,_0x18776e,_0x1711b1,_0x28d95e,_0x1ed055,_0x397c94){var _0x57d4fb,_0x98bec5;_0x397c94[_0xaa0b('0x11')]=intUtil[_0xaa0b('0x4b')](_0x397c94[_0xaa0b('0x11')]);_0x397c94[_0xaa0b('0x4c')]=intUtil[_0xaa0b('0x4b')](_0x397c94['serverUrl']);if(_0x1ed055&&_0x1ed055['monitor_format']){logger[_0xaa0b('0xd')]('['+_0x18776e[_0xaa0b('0x6c')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x18776e[_0xaa0b('0x4f')]=util[_0xaa0b('0xf')](_0xaa0b('0x65'),_0x397c94[_0xaa0b('0x4c')],_0x18776e[_0xaa0b('0x50')],md5(_0x18776e[_0xaa0b('0x50')]));}else{_0x18776e[_0xaa0b('0x4f')]='';}headers[_0xaa0b('0x6d')]=getAuth(_0x397c94);return getUser(_0x397c94)[_0xaa0b('0x12')](function(_0x3471dd){_0x57d4fb=_0x3471dd;logger[_0xaa0b('0xd')](_0xaa0b('0x66'),_0x57d4fb['id']);return getEndUser(_0x397c94,_0x18776e['calleridname'],_0x18776e[_0xaa0b('0x53')]);})[_0xaa0b('0x12')](function(_0x30ca15){_0x98bec5=_0x30ca15;logger[_0xaa0b('0xd')](_0xaa0b('0x54'),_0x98bec5['id']);return getTicket(_0x397c94,_0x57d4fb,_0x98bec5,_0x1711b1,_0x18776e);})[_0xaa0b('0x12')](function(_0x4658f2){if(_0x4658f2){logger[_0xaa0b('0xd')](_0xaa0b('0x69'));logger[_0xaa0b('0xd')]('The\x20Ticket\x20ID\x20is:',_0x4658f2['id']);}})['catch'](function(_0x445ac0){logger[_0xaa0b('0x5e')]('['+_0x18776e[_0xaa0b('0x6c')]['toUpperCase']()+']',JSON[_0xaa0b('0x61')](_0x445ac0));});}; \ No newline at end of file +var _0xb46c=['Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','newTab','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','unmanaged','toUpperCase','lastevent','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','total_entries','find','_embedded','entries','then','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','defaults','GET','authType','%s:%s','username','password','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','map','length','string','picklist','type','nameField','customField','content','idField','variable','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY','Motion','concat','Tags','/api/v2/users/%d','Descriptions','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb46c,0x150));var _0xcb46=function(_0x643324,_0x1f51af){_0x643324=_0x643324-0x0;var _0x56f4cc=_0xb46c[_0x643324];return _0x56f4cc;};'use strict';var _=require('lodash');var rp=require(_0xcb46('0x0'));var md5=require(_0xcb46('0x1'));var util=require(_0xcb46('0x2'));var Redis=require(_0xcb46('0x3'));var intUtil=require(_0xcb46('0x4'));var config=require('../../../../config/environment');var logger=require(_0xcb46('0x5'))(_0xcb46('0x6'));config[_0xcb46('0x7')]=_['defaults'](config['redis'],{'host':_0xcb46('0x8'),'port':0x18eb});var io=require(_0xcb46('0x9'))(new Redis(config[_0xcb46('0x7')]));function emit(_0x159a06,_0x28e8cc,_0xb54dde){io['to'](_0x159a06)[_0xcb46('0xa')](_0x28e8cc,_0xb54dde);}var headers={'Content-Type':'application/json','Accept':_0xcb46('0xb')};function getUser(_0x103824,_0x5714ce){if(intUtil[_0xcb46('0xc')](_0x5714ce)===!![]){logger['info'](_0xcb46('0xd'),_0x5714ce);return request({'uri':util[_0xcb46('0xe')](_0xcb46('0xf'),_0x103824[_0xcb46('0x10')])})['then'](function(_0x580a10){if(_0x580a10[_0xcb46('0x11')]){return _[_0xcb46('0x12')](_0x580a10[_0xcb46('0x13')][_0xcb46('0x14')],{'email':_0x5714ce});}})[_0xcb46('0x15')](function(_0x189dc2){if(_0x189dc2){logger[_0xcb46('0x16')](_0xcb46('0x17'));return _0x189dc2;}else{logger[_0xcb46('0x16')](_0xcb46('0x18'));return request({'uri':util['format'](_0xcb46('0x19'),_0x103824[_0xcb46('0x10')])});}});}else{logger[_0xcb46('0x16')](_0xcb46('0x1a'));return request({'uri':util[_0xcb46('0xe')](_0xcb46('0x19'),_0x103824[_0xcb46('0x10')])});}}function request(_0x1754f5){logger[_0xcb46('0x1b')]('[HTTP]',JSON[_0xcb46('0x1c')](_0x1754f5));return rp(_[_0xcb46('0x1d')](_0x1754f5,{'method':_0xcb46('0x1e'),'headers':headers,'json':!![]}));}function getAuth(_0x9c7318){var _0x53e9fb;if(_0x9c7318[_0xcb46('0x1f')]==='basic'){_0x53e9fb=util['format'](_0xcb46('0x20'),_0x9c7318[_0xcb46('0x21')],_0x9c7318[_0xcb46('0x22')]);}else if(_0x9c7318[_0xcb46('0x1f')]===_0xcb46('0x23')){_0x53e9fb=util[_0xcb46('0xe')](_0xcb46('0x24'),_0x9c7318[_0xcb46('0x21')],_0x9c7318['token']);}return util['format']('Basic\x20%s',new Buffer(_0x53e9fb)[_0xcb46('0x25')](_0xcb46('0x26')));}function getEndUser(_0x13b5e2,_0xf21d02,_0x3c3579){logger[_0xcb46('0x16')](_0xcb46('0x27'),_0x3c3579);return request({'uri':util[_0xcb46('0xe')]('%s/customers/search',_0x13b5e2[_0xcb46('0x10')]),'qs':{'phone':_0x3c3579}})[_0xcb46('0x15')](function(_0x14d5dc){if(_0x14d5dc[_0xcb46('0x11')]){logger[_0xcb46('0x16')]('Enduser\x20found!');return _0x14d5dc['_embedded'][_0xcb46('0x14')][0x0];}else{logger[_0xcb46('0x16')](_0xcb46('0x28'));return request({'uri':util[_0xcb46('0xe')](_0xcb46('0x29'),_0x13b5e2[_0xcb46('0x10')]),'method':_0xcb46('0x2a'),'body':{'first_name':_0xf21d02,'title':_0xf21d02,'phone_numbers':[{'type':'work','value':_0x3c3579}]}});}});}function getTags(_0x1452c2,_0x16eca7){var _0x34cc89=[];if(_0x1452c2&&_0x1452c2['length']>0x0){_0x34cc89=_[_0xcb46('0x2b')](_0x1452c2,_0x16eca7);}return _0x34cc89;}function getCustomFields(_0x593518,_0x4e0cc2){var _0x4f7a5c=[];var _0x2f2e93={'custom_fields':{}};if(_0x593518[_0xcb46('0x2c')]>0x0){_['forEach'](_0x593518,function(_0x5b73ad){if(_['includes']([_0xcb46('0x2d'),_0xcb46('0x2e')],_0x5b73ad[_0xcb46('0x2f')])&&_0x5b73ad[_0xcb46('0x30')]&&!_0x5b73ad[_0xcb46('0x31')]){_0x2f2e93[_0x5b73ad[_0xcb46('0x30')]['toLowerCase']()]=_0x5b73ad[_0xcb46('0x32')][_0xcb46('0x25')]();}else if(_['includes'](['string',_0xcb46('0x2e')],_0x5b73ad['type'])&&_0x5b73ad[_0xcb46('0x33')]&&_0x5b73ad[_0xcb46('0x31')]){_0x2f2e93['custom_fields'][_0x5b73ad[_0xcb46('0x33')]]=_0x5b73ad[_0xcb46('0x32')][_0xcb46('0x25')]();}else if(_0x5b73ad['type']===_0xcb46('0x34')&&_0x5b73ad[_0xcb46('0x35')]&&_0x5b73ad['idField']&&_0x5b73ad[_0xcb46('0x31')]){_0x4e0cc2[_0x5b73ad[_0xcb46('0x35')]]&&(_0x2f2e93[_0xcb46('0x36')][_0x5b73ad[_0xcb46('0x33')]]=_0x4e0cc2[_0x5b73ad[_0xcb46('0x35')]]['toString']());}else if(_0x5b73ad['type']==='customVariable'&&_0x5b73ad['Variable']&&_0x5b73ad[_0xcb46('0x37')][_0xcb46('0x38')]&&_0x5b73ad[_0xcb46('0x33')]&&_0x5b73ad['customField']){_0x4e0cc2[_0x5b73ad['Variable']['name']['toLowerCase']()]&&(_0x2f2e93[_0xcb46('0x36')][_0x5b73ad[_0xcb46('0x33')]]=_0x4e0cc2[_0x5b73ad[_0xcb46('0x37')][_0xcb46('0x38')]['toLowerCase']()][_0xcb46('0x25')]());}});}if(_0x2f2e93[_0xcb46('0x39')]){_0x2f2e93['priority']=Number(_0x2f2e93[_0xcb46('0x39')]);}return _0x2f2e93;}function getTicket(_0x3bf12e,_0x4e97fb,_0x3d2f1b,_0x49139c,_0x530a2e){logger[_0xcb46('0x16')](_0xcb46('0x3a'));var _0x1bd6ae=_[_0xcb46('0x3b')]({'subject':intUtil[_0xcb46('0x3c')](_0x49139c[_0xcb46('0x3d')],_0x530a2e,'\x20'),'type':_0xcb46('0x3e'),'status':_0xcb46('0x3f'),'labels':[_0xcb46('0x40'),_0xcb46('0x41'),'CTI'][_0xcb46('0x42')](getTags(_0x49139c[_0xcb46('0x43')],'name')),'description':intUtil['getString'](_0x49139c['Descriptions'],_0x530a2e,'\x0a'),'_links':{'assigned_user':{'href':util[_0xcb46('0xe')](_0xcb46('0x44'),_0x4e97fb['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x49139c[_0xcb46('0x45')],_0x530a2e,'\x0a')}},getCustomFields(_0x49139c['Fields'],_0x530a2e));return request({'uri':util[_0xcb46('0xe')]('%s/customers/%d/cases',_0x3bf12e[_0xcb46('0x10')],_0x3d2f1b['id']),'method':_0xcb46('0x2a'),'body':_0x1bd6ae});}exports[_0xcb46('0x46')]=function(_0x18f601,_0x297d1,_0x44f914,_0x5c87c5,_0x35fe5c,_0x3f4567){var _0x34f9ba,_0x45e2a7;_0x3f4567[_0xcb46('0x10')]=intUtil[_0xcb46('0x47')](_0x3f4567[_0xcb46('0x10')]);_0x3f4567['serverUrl']=intUtil[_0xcb46('0x47')](_0x3f4567['serverUrl']);if(_0x35fe5c&&_0x35fe5c[_0xcb46('0x48')]){logger[_0xcb46('0x16')](_0xcb46('0x49'),_0xcb46('0x4a'));_0x297d1[_0xcb46('0x4b')]=util[_0xcb46('0xe')](_0xcb46('0x4c'),_0x3f4567[_0xcb46('0x4d')],_0x297d1[_0xcb46('0x4e')],md5(_0x297d1[_0xcb46('0x4e')]));}else{_0x297d1['recordingURL']='';}headers[_0xcb46('0x4f')]=getAuth(_0x3f4567);return getUser(_0x3f4567,_0x5c87c5[_0xcb46('0x50')])[_0xcb46('0x15')](function(_0x337dd1){_0x34f9ba=_0x337dd1;logger[_0xcb46('0x16')](_0xcb46('0x51'),_0x34f9ba['id']);return getEndUser(_0x3f4567,_0x297d1[_0xcb46('0x52')],_0x297d1[_0xcb46('0x53')]);})['then'](function(_0x3b4b43){_0x45e2a7=_0x3b4b43;logger[_0xcb46('0x16')]('The\x20Enduser\x20ID\x20is:',_0x45e2a7['id']);return getTicket(_0x3f4567,_0x34f9ba,_0x45e2a7,_0x44f914,_0x297d1);})['then'](function(_0x36d1ab){if(_0x36d1ab){logger[_0xcb46('0x16')](_0xcb46('0x54'));logger[_0xcb46('0x16')](_0xcb46('0x55'),_0x36d1ab['id']);switch(_0x3f4567[_0xcb46('0x2f')]){case'integrationTab':logger[_0xcb46('0x16')](_0xcb46('0x49'),_0xcb46('0x56'));emit(util[_0xcb46('0xe')](_0xcb46('0x57'),_0x5c87c5[_0xcb46('0x38')]),'trigger:desk:display',{'recordId':_0x36d1ab['id']});break;case _0xcb46('0x58'):logger[_0xcb46('0x16')](_0xcb46('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcb46('0xe')]('user:%s',_0x5c87c5['name']),_0xcb46('0x59'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x36d1ab['id'])});break;default:logger[_0xcb46('0x5a')](_0xcb46('0x49'),_0xcb46('0x5b'));}}})['catch'](function(_0x45485d){console[_0xcb46('0x5a')](_0x45485d);logger['error'](_0xcb46('0x49'),JSON['stringify'](_0x45485d));});};exports[_0xcb46('0x5c')]=function(_0x2f0543,_0x552064,_0x58c82b,_0x55e9a9,_0x378614,_0x2b1a69,_0x591a1d){var _0x15e48a,_0x229600;_0x2b1a69[_0xcb46('0x10')]=intUtil[_0xcb46('0x47')](_0x2b1a69[_0xcb46('0x10')]);_0x2b1a69[_0xcb46('0x4d')]=intUtil['stripTrailingSlash'](_0x2b1a69['serverUrl']);if(_0x591a1d&&_0x591a1d[_0xcb46('0x5d')]&&_0x591a1d['recordingFormat']!=='none'){logger[_0xcb46('0x16')](_0xcb46('0x5e'),_0xcb46('0x4a'));_0x552064[_0xcb46('0x4b')]=util[_0xcb46('0xe')](_0xcb46('0x4c'),_0x2b1a69['serverUrl'],_0x552064[_0xcb46('0x4e')],md5(_0x552064[_0xcb46('0x4e')]));}headers[_0xcb46('0x4f')]=getAuth(_0x2b1a69);return getUser(_0x2b1a69,_0x55e9a9[_0xcb46('0x50')])[_0xcb46('0x15')](function(_0x2b537f){_0x15e48a=_0x2b537f;logger[_0xcb46('0x16')]('The\x20User\x20ID\x20is:',_0x15e48a['id']);return getEndUser(_0x2b1a69,_0x552064[_0xcb46('0x5f')],_0x552064[_0xcb46('0x60')]);})[_0xcb46('0x15')](function(_0x15e3a9){_0x229600=_0x15e3a9;logger[_0xcb46('0x16')](_0xcb46('0x61'),_0x229600['id']);return getTicket(_0x2b1a69,_0x15e48a,_0x229600,_0x58c82b,_0x552064);})['then'](function(_0x2741ee){if(_0x2741ee){logger[_0xcb46('0x16')](_0xcb46('0x54'));logger['info'](_0xcb46('0x55'),_0x2741ee['id']);switch(_0x2b1a69['type']){case _0xcb46('0x62'):logger['info']('[QUEUE]',_0xcb46('0x56'));emit(util[_0xcb46('0xe')](_0xcb46('0x57'),_0x55e9a9[_0xcb46('0x38')]),_0xcb46('0x63'),{'recordId':_0x2741ee['id']});break;case _0xcb46('0x58'):logger['info']('[QUEUE]',_0xcb46('0x64'));emit(util['format'](_0xcb46('0x57'),_0x55e9a9[_0xcb46('0x38')]),_0xcb46('0x59'),{'uri':util['format']('%s/agent/tickets/%s',_0x2b1a69[_0xcb46('0x10')],_0x2741ee['id'])});break;default:logger[_0xcb46('0x5a')](_0xcb46('0x5e'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xcb46('0x65')](function(_0x246f2e){logger['error'](_0xcb46('0x5e'),JSON['stringify'](_0x246f2e));});};exports[_0xcb46('0x66')]=function(_0x3c10d9,_0x1a65f5,_0x5a8fbb,_0x4fcf38,_0x5c2066,_0x5376d6){var _0x41f505,_0x587c74;_0x5376d6[_0xcb46('0x10')]=intUtil[_0xcb46('0x47')](_0x5376d6['remoteUri']);_0x5376d6[_0xcb46('0x4d')]=intUtil[_0xcb46('0x47')](_0x5376d6['serverUrl']);if(_0x5c2066&&_0x5c2066[_0xcb46('0x48')]){logger[_0xcb46('0x16')]('['+_0x1a65f5['lastevent'][_0xcb46('0x67')]()+']',_0xcb46('0x4a'));_0x1a65f5[_0xcb46('0x4b')]=util[_0xcb46('0xe')](_0xcb46('0x4c'),_0x5376d6[_0xcb46('0x4d')],_0x1a65f5['uniqueid'],md5(_0x1a65f5[_0xcb46('0x4e')]));}else{_0x1a65f5[_0xcb46('0x4b')]='';}headers[_0xcb46('0x4f')]=getAuth(_0x5376d6);return getUser(_0x5376d6)[_0xcb46('0x15')](function(_0x315445){_0x41f505=_0x315445;logger[_0xcb46('0x16')](_0xcb46('0x51'),_0x41f505['id']);return getEndUser(_0x5376d6,_0x1a65f5[_0xcb46('0x52')],_0x1a65f5['calleridnum']);})[_0xcb46('0x15')](function(_0x20b7a0){_0x587c74=_0x20b7a0;logger[_0xcb46('0x16')]('The\x20Enduser\x20ID\x20is:',_0x587c74['id']);return getTicket(_0x5376d6,_0x41f505,_0x587c74,_0x5a8fbb,_0x1a65f5);})[_0xcb46('0x15')](function(_0x15fd41){if(_0x15fd41){logger[_0xcb46('0x16')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x15fd41['id']);}})[_0xcb46('0x65')](function(_0x3789c9){logger['error']('['+_0x1a65f5[_0xcb46('0x68')]['toUpperCase']()+']',JSON[_0xcb46('0x1c')](_0x3789c9));});}; \ 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 8f09c0e..02a1e89 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 _0x8b52=['calleridnum','/systemusers(','headers','odata-entityid','lastIndexOf','enduserId','catch','message','Bearer\x20','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','includes','string','picklist','type','nameField','idField','substring','indexOf','content','ticketType','incident','assign','Subjects','getString','Descriptions','/contacts(','phonecall','phonecalls','callDirection','queue','Fields','ticketId','format','user:%s','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','recordingURL',']\x20The\x20User\x20email\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','access_token','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','userEmail','length','toLowerCase','outbound','destcalleridnum'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8b52,0x151));var _0x28b5=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8b52[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x28b5('0x0'));var BPromise=require(_0x28b5('0x1'));var rp=require(_0x28b5('0x2'));var util=require('util');var intUtil=require(_0x28b5('0x3'));var md5=require(_0x28b5('0x4'));var Redis=require('ioredis');var logger=require(_0x28b5('0x5'))(_0x28b5('0x6'));var config=require(_0x28b5('0x7'));config[_0x28b5('0x8')]=_[_0x28b5('0x9')](config[_0x28b5('0x8')],{'host':_0x28b5('0xa'),'port':0x18eb});var io=require(_0x28b5('0xb'))(new Redis(config[_0x28b5('0x8')]));function getAuthToken(_0x4a136e,_0x1fc3a0,_0x55cbda){var _0x4ff1ab={'method':_0x28b5('0xc'),'uri':_0x1fc3a0,'form':{'client_id':_0x4a136e[_0x28b5('0xd')],'resource':_0x4a136e['remoteUri'],'username':_0x4a136e[_0x28b5('0xe')],'password':_0x4a136e[_0x28b5('0xf')],'grant_type':'password','client_secret':_0x4a136e[_0x28b5('0x10')]},'json':!![]};return rp(_0x4ff1ab)[_0x28b5('0x11')](function(_0x3e6ef){return _0x3e6ef[_0x28b5('0x12')];})['catch'](function(_0x88feb){logger['error']('['+[_0x55cbda[_0x28b5('0x13')]()]+_0x28b5('0x14'));return _0x88feb['message'];});}function getUser(_0x15a546,_0x4c45b1,_0x26d895,_0x4a684e,_0x58f350,_0xff943a){return new BPromise(function(_0x2e63ff,_0x590ef6){return getAuthToken(_0x4c45b1,_0x4a684e,_0xff943a)[_0x28b5('0x11')](function(_0x26213c){var _0x1e4a10={'method':_0x28b5('0x15'),'uri':_0x58f350+_0x28b5('0x16'),'headers':{'Authorization':'Bearer\x20'+_0x26213c,'OData-Version':_0x28b5('0x17')},'json':!![]};return rp(_0x1e4a10);})['then'](function(_0x7b6900){var _0x205c05=_0x7b6900[_0x28b5('0x18')];var _0x1a4f53=![];var _0x540933=null;if(!_[_0x28b5('0x19')](_0x26d895)){if(intUtil[_0x28b5('0x1a')](_0x26d895[_0x28b5('0x1b')])){_0x15a546['userEmail']=_0x26d895[_0x28b5('0x1b')];for(_0x540933=0x0;_0x540933<_0x205c05['length'];_0x540933++){if(_0x205c05[_0x540933][_0x28b5('0x1c')]===_0x26d895[_0x28b5('0x1b')]&&!_0x205c05[_0x540933][_0x28b5('0x1d')]){_0x1a4f53=!![];logger[_0x28b5('0x1e')]('['+[_0xff943a['toUpperCase']()]+_0x28b5('0x1f')+_0x205c05[_0x540933][_0x28b5('0x20')]+'!');_0x15a546[_0x28b5('0x21')]=_0x205c05[_0x540933][_0x28b5('0x20')];}}}}if(!_0x1a4f53){logger['info']('['+[_0xff943a['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x15a546[_0x28b5('0x22')]=_0x4c45b1[_0x28b5('0xe')];for(_0x540933=0x0;_0x540933<_0x205c05[_0x28b5('0x23')];_0x540933++){if(_0x205c05[_0x540933][_0x28b5('0x1c')]===_0x4c45b1[_0x28b5('0xe')]){_0x15a546[_0x28b5('0x21')]=_0x205c05[_0x540933]['systemuserid'];}}}_0x2e63ff(_0x15a546);})['catch'](function(_0x32f15d){_0x590ef6(_0x32f15d['message']);});});}function createEndUser(_0x304f72,_0x25fd54,_0x24954d,_0x18176c,_0x127ab0,_0x5ae41d){return new BPromise(function(_0x47e031,_0x30348a){return getAuthToken(_0x25fd54,_0x24954d,_0x5ae41d)[_0x28b5('0x11')](function(_0x12c721){var _0xb109dd=_0x5ae41d[_0x28b5('0x24')]()===_0x28b5('0x25')?_0x127ab0[_0x28b5('0x26')]:_0x127ab0[_0x28b5('0x27')];var _0x139524={'method':_0x28b5('0xc'),'uri':_0x18176c+'contacts','body':{'telephone1':_0xb109dd,'fullname':_0xb109dd,'firstname':_0xb109dd,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x28b5('0x28')+_0x304f72[_0x28b5('0x21')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x12c721,'OData-Version':_0x28b5('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x139524);})[_0x28b5('0x11')](function(_0x225f0b){var _0x3e8ee3=_0x225f0b[_0x28b5('0x29')][_0x28b5('0x2a')];var _0xa873ec=_0x3e8ee3['substring'](_0x3e8ee3[_0x28b5('0x2b')]('(')+0x1,_0x3e8ee3['lastIndexOf'](')'));_0x304f72[_0x28b5('0x2c')]=_0xa873ec;_0x47e031(_0x304f72);})[_0x28b5('0x2d')](function(_0x3eccd6){_0x30348a(_0x3eccd6[_0x28b5('0x2e')]);});});}function getEndUser(_0x26fb31,_0x306e1a,_0x3f4c74,_0x16c24e,_0x1544b7,_0x2c815d){return new BPromise(function(_0x88bb17,_0x270b73){return getAuthToken(_0x306e1a,_0x3f4c74,_0x2c815d)[_0x28b5('0x11')](function(_0xc9dcb2){var _0x31bf13={'method':_0x28b5('0x15'),'uri':_0x16c24e+'contacts?$select=telephone1','headers':{'Authorization':_0x28b5('0x2f')+_0xc9dcb2,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x31bf13);})[_0x28b5('0x11')](function(_0x412219){var _0x15580d=null;if(_0x412219){var _0x135f3e=_0x412219['value'];var _0xd52635=![];for(_0x15580d=0x0;_0x15580d<_0x135f3e[_0x28b5('0x23')];_0x15580d++){var _0x2714e8=_0x2c815d['toLowerCase']()==='outbound'?_0x1544b7[_0x28b5('0x26')]:_0x1544b7[_0x28b5('0x27')];if(_0x135f3e[_0x15580d][_0x28b5('0x30')]===_0x2714e8){_0xd52635=!![];_0x26fb31[_0x28b5('0x2c')]=_0x135f3e[_0x15580d]['contactid'];}}if(_0xd52635){_0x88bb17(_0x26fb31);}else{return createEndUser(_0x26fb31,_0x306e1a,_0x3f4c74,_0x16c24e,_0x1544b7,_0x2c815d)[_0x28b5('0x11')](function(_0x388339){logger[_0x28b5('0x1e')]('['+[_0x2c815d[_0x28b5('0x13')]()]+_0x28b5('0x31'),_0x388339[_0x28b5('0x2c')]);_0x88bb17(_0x388339);});}}else{return createEndUser(_0x26fb31,_0x306e1a,_0x3f4c74,_0x16c24e,_0x1544b7,_0x2c815d)[_0x28b5('0x11')](function(_0x198093){logger['info']('['+[_0x2c815d[_0x28b5('0x13')]()]+_0x28b5('0x32'),_0x198093['enduserId']);_0x88bb17(_0x198093);});}});});}function getCustomFields(_0x428596,_0x4ee7cc,_0x1ca663){var _0x2a20c9={};if(_0x428596[_0x28b5('0x23')]>0x0){_['forEach'](_0x428596,function(_0x45a866){if(_[_0x28b5('0x33')]([_0x28b5('0x34'),_0x28b5('0x35')],_0x45a866[_0x28b5('0x36')])&&_0x45a866[_0x28b5('0x37')]&&!_0x45a866['customField']){var _0x3f5047=_0x45a866[_0x28b5('0x38')][_0x28b5('0x24')]();var _0x3b068f=_0x3f5047[_0x28b5('0x39')](0x0,_0x3f5047['indexOf']('_'));var _0x108a49=_0x3f5047[_0x28b5('0x39')](_0x3f5047[_0x28b5('0x3a')]('_')+0x1);if(_0x3b068f===_0x1ca663){_0x2a20c9[_0x108a49]=_0x45a866[_0x28b5('0x3b')];}}});}return _0x2a20c9;}function getTicket(_0x45bd3c,_0x4bd2e3,_0x2ac508,_0x5bee77,_0x2e5b82,_0xcb77e8,_0x17a13b){return new BPromise(function(_0x1690e5,_0x56c63e){var _0x48e881;return getAuthToken(_0x4bd2e3,_0x2ac508,_0x17a13b)[_0x28b5('0x11')](function(_0x41a461){if(_0xcb77e8[_0x28b5('0x3c')]===_0x28b5('0x3d')){_0x48e881={'method':_0x28b5('0xc'),'uri':_0x5bee77+'incidents','body':Object[_0x28b5('0x3e')]({},{'title':intUtil['getString'](_0xcb77e8[_0x28b5('0x3f')],_0x2e5b82,'\x20'),'description':intUtil[_0x28b5('0x40')](_0xcb77e8[_0x28b5('0x41')],_0x2e5b82,'\x0a'),'customerid_contact@odata.bind':_0x28b5('0x42')+_0x45bd3c[_0x28b5('0x2c')]+')','ownerid@odata.bind':_0x28b5('0x28')+_0x45bd3c[_0x28b5('0x21')]+')','caseorigincode':'1'},getCustomFields(_0xcb77e8['Fields'],_0x2e5b82,_0xcb77e8[_0x28b5('0x3c')])),'headers':{'Authorization':_0x28b5('0x2f')+_0x41a461,'OData-Version':_0x28b5('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xcb77e8[_0x28b5('0x3c')]===_0x28b5('0x43')){_0x48e881={'method':_0x28b5('0xc'),'uri':_0x5bee77+_0x28b5('0x44'),'body':Object[_0x28b5('0x3e')]({},{'subject':intUtil[_0x28b5('0x40')](_0xcb77e8['Subjects'],_0x2e5b82,'\x20'),'phonenumber':String(_0x2e5b82[_0x28b5('0x27')]),'description':intUtil[_0x28b5('0x40')](_0xcb77e8[_0x28b5('0x41')],_0x2e5b82,'\x0a'),'regardingobjectid_contact@odata.bind':_0x28b5('0x42')+_0x45bd3c['enduserId']+')','ownerid@odata.bind':_0x28b5('0x28')+_0x45bd3c[_0x28b5('0x21')]+')','directioncode':_0x45bd3c[_0x28b5('0x45')]===_0x28b5('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x28b5('0x28')+_0x45bd3c[_0x28b5('0x21')]+')','participationtypemask':_0x45bd3c[_0x28b5('0x45')]===_0x28b5('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0x28b5('0x42')+_0x45bd3c[_0x28b5('0x2c')]+')','participationtypemask':_0x45bd3c[_0x28b5('0x45')]===_0x28b5('0x46')?0x1:0x2}]},getCustomFields(_0xcb77e8[_0x28b5('0x47')],_0x2e5b82,_0xcb77e8[_0x28b5('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x41a461,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x48e881);})['then'](function(_0x2d6a5a){var _0x97af32=_0x2d6a5a['headers'][_0x28b5('0x2a')];var _0x4003e9=_0x97af32['substring'](_0x97af32[_0x28b5('0x2b')]('(')+0x1,_0x97af32[_0x28b5('0x2b')](')'));_0x45bd3c[_0x28b5('0x48')]=_0x4003e9;_0x1690e5(_0x45bd3c);})[_0x28b5('0x2d')](function(_0x5da088){_0x56c63e(_0x5da088['message']);});});}function emit(_0x332f9c,_0x2aa97b,_0x2466f4,_0x77f0c3){var _0x25c05c={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x332f9c,_0x2466f4,_0x77f0c3)};io['to'](util[_0x28b5('0x49')](_0x28b5('0x4a'),_0x2aa97b))['emit'](_0x28b5('0x4b'),_0x25c05c);}exports['cs']=function(_0x1abe89,_0x364563,_0x370beb,_0x53885e,_0xd2466f,_0x28684e,_0x5bae3b,_0x1363a0){var _0x20d5a4={};_0x28684e[_0x28b5('0x4c')]=intUtil[_0x28b5('0x4d')](_0x28684e[_0x28b5('0x4c')]);_0x28684e[_0x28b5('0x4e')]=intUtil[_0x28b5('0x4d')](_0x28684e['serverUrl']);_0x20d5a4['callDirection']=_0x1363a0===_0x28b5('0x46')||_0x1363a0==='unmanaged'?_0x28b5('0x46'):_0x28b5('0x25');var _0x31d7f4=util[_0x28b5('0x49')]('%s/api/data/v9.0/',_0x28684e['remoteUri']);var _0x14217=util[_0x28b5('0x49')]('https://login.microsoftonline.com/%s/oauth2/token',_0x28684e[_0x28b5('0x4f')]);var _0x5ac3fb=util['format'](_0x28b5('0x50'),_0x28684e[_0x28b5('0x4e')],_0x364563[_0x28b5('0x51')],md5(_0x364563[_0x28b5('0x51')]));if(_0xd2466f&&_0xd2466f['monitor_format']){logger[_0x28b5('0x1e')](_0x28b5('0x52'),_0x28b5('0x53'));_0x364563['recordingURL']=_0x5ac3fb;}else if(_0x5bae3b&&_0x5bae3b[_0x28b5('0x54')]&&_0x5bae3b[_0x28b5('0x54')]!=='none'){logger['info']('[OUTBOUND]',_0x28b5('0x53'));_0x364563['recordingURL']=_0x5ac3fb;}else{_0x364563[_0x28b5('0x55')]='';}return getUser(_0x20d5a4,_0x28684e,_0x53885e,_0x14217,_0x31d7f4,_0x1363a0)[_0x28b5('0x11')](function(_0x172616){logger[_0x28b5('0x1e')]('['+_0x1363a0[_0x28b5('0x13')]()+']\x20The\x20User\x20ID\x20is:',_0x172616['userId']);logger['info']('['+_0x1363a0[_0x28b5('0x13')]()+_0x28b5('0x56'),_0x172616[_0x28b5('0x22')]);return getEndUser(_0x172616,_0x28684e,_0x14217,_0x31d7f4,_0x364563,_0x1363a0);})['then'](function(_0x274d19){logger[_0x28b5('0x1e')]('['+_0x1363a0[_0x28b5('0x13')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x274d19[_0x28b5('0x2c')]);logger[_0x28b5('0x1e')]('['+_0x1363a0['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x364563[_0x28b5('0x27')]);return getTicket(_0x274d19,_0x28684e,_0x14217,_0x31d7f4,_0x364563,_0x370beb,_0x1363a0);})[_0x28b5('0x11')](function(_0x24501f){logger['info'](util[_0x28b5('0x49')]('['+_0x1363a0[_0x28b5('0x13')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x370beb['ticketType'],_0x24501f[_0x28b5('0x48')]));logger[_0x28b5('0x1e')](util[_0x28b5('0x49')]('['+_0x1363a0[_0x28b5('0x13')]()+_0x28b5('0x57'),_0x1363a0));if(_0x1363a0!==_0x28b5('0x58')){logger[_0x28b5('0x1e')]('['+_0x1363a0[_0x28b5('0x13')]()+']',_0x28b5('0x59'));emit(_0x28684e[_0x28b5('0x4c')],_0x53885e[_0x28b5('0x5a')],_0x370beb[_0x28b5('0x3c')],_0x24501f[_0x28b5('0x48')]);}})[_0x28b5('0x2d')](function(_0x3ef9ef){logger[_0x28b5('0x5b')]('['+_0x1363a0[_0x28b5('0x13')]()+_0x28b5('0x5c'),util[_0x28b5('0x5d')](_0x3ef9ef,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6365=['assign','Subjects','Descriptions','callDirection','queue','odata-entityid','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','uniqueid','monitor_format','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','username','clientSecret','access_token','catch','error','toUpperCase','message','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','toLowerCase','destcalleridnum','contacts','4.0','headers','substring','lastIndexOf','enduserId','GET','Bearer\x20','outbound','calleridnum',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','includes','string','picklist','type','nameField','idField','indexOf','content','ticketType','incident','incidents','getString','/contacts(','/systemusers(','Fields','phonecall','phonecalls'];(function(_0x35a779,_0x27f8fb){var _0xca723b=function(_0x298df7){while(--_0x298df7){_0x35a779['push'](_0x35a779['shift']());}};_0xca723b(++_0x27f8fb);}(_0x6365,0x148));var _0x5636=function(_0x495537,_0x36b7c0){_0x495537=_0x495537-0x0;var _0x2fcb4b=_0x6365[_0x495537];return _0x2fcb4b;};'use strict';var _=require(_0x5636('0x0'));var BPromise=require(_0x5636('0x1'));var rp=require(_0x5636('0x2'));var util=require(_0x5636('0x3'));var intUtil=require('./util');var md5=require(_0x5636('0x4'));var Redis=require(_0x5636('0x5'));var logger=require(_0x5636('0x6'))(_0x5636('0x7'));var config=require(_0x5636('0x8'));config['redis']=_[_0x5636('0x9')](config[_0x5636('0xa')],{'host':_0x5636('0xb'),'port':0x18eb});var io=require(_0x5636('0xc'))(new Redis(config['redis']));function getAuthToken(_0x17439f,_0x10769f,_0x54eb5c){var _0x516641={'method':_0x5636('0xd'),'uri':_0x10769f,'form':{'client_id':_0x17439f[_0x5636('0xe')],'resource':_0x17439f[_0x5636('0xf')],'username':_0x17439f[_0x5636('0x10')],'password':_0x17439f['password'],'grant_type':'password','client_secret':_0x17439f[_0x5636('0x11')]},'json':!![]};return rp(_0x516641)['then'](function(_0x355571){return _0x355571[_0x5636('0x12')];})[_0x5636('0x13')](function(_0x215eb0){logger[_0x5636('0x14')]('['+[_0x54eb5c[_0x5636('0x15')]()]+']\x20Wrong\x20credentials!');return _0x215eb0[_0x5636('0x16')];});}function getUser(_0x1c60dd,_0x5d4b17,_0x250a72,_0x196741,_0x51eaa7,_0x565538){return new BPromise(function(_0x26f30d,_0x19ec78){return getAuthToken(_0x5d4b17,_0x196741,_0x565538)[_0x5636('0x17')](function(_0x11340b){var _0x3fb15a={'method':'GET','uri':_0x51eaa7+_0x5636('0x18'),'headers':{'Authorization':'Bearer\x20'+_0x11340b,'OData-Version':'4.0'},'json':!![]};return rp(_0x3fb15a);})[_0x5636('0x17')](function(_0xecf7ab){var _0x395f26=_0xecf7ab[_0x5636('0x19')];var _0x4683c6=![];var _0x2e375d=null;if(!_[_0x5636('0x1a')](_0x250a72)){if(intUtil[_0x5636('0x1b')](_0x250a72['email'])){_0x1c60dd['userEmail']=_0x250a72[_0x5636('0x1c')];for(_0x2e375d=0x0;_0x2e375d<_0x395f26[_0x5636('0x1d')];_0x2e375d++){if(_0x395f26[_0x2e375d][_0x5636('0x1e')]===_0x250a72['email']&&!_0x395f26[_0x2e375d][_0x5636('0x1f')]){_0x4683c6=!![];logger[_0x5636('0x20')]('['+[_0x565538[_0x5636('0x15')]()]+_0x5636('0x21')+_0x395f26[_0x2e375d][_0x5636('0x22')]+'!');_0x1c60dd['userId']=_0x395f26[_0x2e375d][_0x5636('0x22')];}}}}if(!_0x4683c6){logger[_0x5636('0x20')]('['+[_0x565538[_0x5636('0x15')]()]+_0x5636('0x23'));_0x1c60dd['userEmail']=_0x5d4b17['username'];for(_0x2e375d=0x0;_0x2e375d<_0x395f26[_0x5636('0x1d')];_0x2e375d++){if(_0x395f26[_0x2e375d]['internalemailaddress']===_0x5d4b17[_0x5636('0x10')]){_0x1c60dd[_0x5636('0x24')]=_0x395f26[_0x2e375d][_0x5636('0x22')];}}}_0x26f30d(_0x1c60dd);})[_0x5636('0x13')](function(_0x51e5cc){_0x19ec78(_0x51e5cc[_0x5636('0x16')]);});});}function createEndUser(_0x488e0c,_0x3c6dcb,_0x5953cf,_0x29e35c,_0x65d71f,_0x10f3ea){return new BPromise(function(_0x278316,_0x4d1db1){return getAuthToken(_0x3c6dcb,_0x5953cf,_0x10f3ea)[_0x5636('0x17')](function(_0x1ff533){var _0x19f718=_0x10f3ea[_0x5636('0x25')]()==='outbound'?_0x65d71f[_0x5636('0x26')]:_0x65d71f['calleridnum'];var _0x222a3b={'method':'POST','uri':_0x29e35c+_0x5636('0x27'),'body':{'telephone1':_0x19f718,'fullname':_0x19f718,'firstname':_0x19f718,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x488e0c[_0x5636('0x24')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x1ff533,'OData-Version':_0x5636('0x28')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x222a3b);})['then'](function(_0x183f69){var _0x29e56a=_0x183f69[_0x5636('0x29')]['odata-entityid'];var _0x2bf315=_0x29e56a[_0x5636('0x2a')](_0x29e56a[_0x5636('0x2b')]('(')+0x1,_0x29e56a['lastIndexOf'](')'));_0x488e0c[_0x5636('0x2c')]=_0x2bf315;_0x278316(_0x488e0c);})[_0x5636('0x13')](function(_0x3ec53d){_0x4d1db1(_0x3ec53d[_0x5636('0x16')]);});});}function getEndUser(_0x404d6b,_0x295eeb,_0x499f04,_0x53ec71,_0x1faa63,_0x4cc803){return new BPromise(function(_0x3a79ac,_0x4d9e93){return getAuthToken(_0x295eeb,_0x499f04,_0x4cc803)[_0x5636('0x17')](function(_0x3825ca){var _0x35e684={'method':_0x5636('0x2d'),'uri':_0x53ec71+'contacts?$select=telephone1','headers':{'Authorization':_0x5636('0x2e')+_0x3825ca,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x35e684);})[_0x5636('0x17')](function(_0x293bb2){var _0x19d8de=null;if(_0x293bb2){var _0x592bbc=_0x293bb2['value'];var _0x4214ed=![];for(_0x19d8de=0x0;_0x19d8de<_0x592bbc[_0x5636('0x1d')];_0x19d8de++){var _0x120329=_0x4cc803[_0x5636('0x25')]()===_0x5636('0x2f')?_0x1faa63[_0x5636('0x26')]:_0x1faa63[_0x5636('0x30')];if(_0x592bbc[_0x19d8de]['telephone1']===_0x120329){_0x4214ed=!![];_0x404d6b[_0x5636('0x2c')]=_0x592bbc[_0x19d8de]['contactid'];}}if(_0x4214ed){_0x3a79ac(_0x404d6b);}else{return createEndUser(_0x404d6b,_0x295eeb,_0x499f04,_0x53ec71,_0x1faa63,_0x4cc803)['then'](function(_0x27c439){logger[_0x5636('0x20')]('['+[_0x4cc803[_0x5636('0x15')]()]+_0x5636('0x31'),_0x27c439[_0x5636('0x2c')]);_0x3a79ac(_0x27c439);});}}else{return createEndUser(_0x404d6b,_0x295eeb,_0x499f04,_0x53ec71,_0x1faa63,_0x4cc803)[_0x5636('0x17')](function(_0x1c5731){logger[_0x5636('0x20')]('['+[_0x4cc803[_0x5636('0x15')]()]+_0x5636('0x32'),_0x1c5731[_0x5636('0x2c')]);_0x3a79ac(_0x1c5731);});}});});}function getCustomFields(_0x47af59,_0x4cd0dc,_0x4f2de2){var _0x461fd1={};if(_0x47af59[_0x5636('0x1d')]>0x0){_['forEach'](_0x47af59,function(_0x490dae){if(_[_0x5636('0x33')]([_0x5636('0x34'),_0x5636('0x35')],_0x490dae[_0x5636('0x36')])&&_0x490dae[_0x5636('0x37')]&&!_0x490dae['customField']){var _0x488a24=_0x490dae[_0x5636('0x38')][_0x5636('0x25')]();var _0x40da72=_0x488a24[_0x5636('0x2a')](0x0,_0x488a24['indexOf']('_'));var _0x5b16a9=_0x488a24[_0x5636('0x2a')](_0x488a24[_0x5636('0x39')]('_')+0x1);if(_0x40da72===_0x4f2de2){_0x461fd1[_0x5b16a9]=_0x490dae[_0x5636('0x3a')];}}});}return _0x461fd1;}function getTicket(_0x52ba2e,_0x54faf7,_0x84b9fa,_0x3f9e2a,_0x11bf7c,_0xf67bc3,_0x4e3137){return new BPromise(function(_0x19e159,_0x835db7){var _0x359dc1;return getAuthToken(_0x54faf7,_0x84b9fa,_0x4e3137)[_0x5636('0x17')](function(_0xcba35f){if(_0xf67bc3[_0x5636('0x3b')]===_0x5636('0x3c')){_0x359dc1={'method':_0x5636('0xd'),'uri':_0x3f9e2a+_0x5636('0x3d'),'body':Object['assign']({},{'title':intUtil[_0x5636('0x3e')](_0xf67bc3['Subjects'],_0x11bf7c,'\x20'),'description':intUtil[_0x5636('0x3e')](_0xf67bc3['Descriptions'],_0x11bf7c,'\x0a'),'customerid_contact@odata.bind':_0x5636('0x3f')+_0x52ba2e[_0x5636('0x2c')]+')','ownerid@odata.bind':_0x5636('0x40')+_0x52ba2e[_0x5636('0x24')]+')','caseorigincode':'1'},getCustomFields(_0xf67bc3[_0x5636('0x41')],_0x11bf7c,_0xf67bc3[_0x5636('0x3b')])),'headers':{'Authorization':'Bearer\x20'+_0xcba35f,'OData-Version':_0x5636('0x28')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xf67bc3[_0x5636('0x3b')]===_0x5636('0x42')){_0x359dc1={'method':_0x5636('0xd'),'uri':_0x3f9e2a+_0x5636('0x43'),'body':Object[_0x5636('0x44')]({},{'subject':intUtil[_0x5636('0x3e')](_0xf67bc3[_0x5636('0x45')],_0x11bf7c,'\x20'),'phonenumber':String(_0x11bf7c[_0x5636('0x30')]),'description':intUtil[_0x5636('0x3e')](_0xf67bc3[_0x5636('0x46')],_0x11bf7c,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x52ba2e[_0x5636('0x2c')]+')','ownerid@odata.bind':'/systemusers('+_0x52ba2e[_0x5636('0x24')]+')','directioncode':_0x52ba2e[_0x5636('0x47')]===_0x5636('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x52ba2e[_0x5636('0x24')]+')','participationtypemask':_0x52ba2e[_0x5636('0x47')]===_0x5636('0x48')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x52ba2e['enduserId']+')','participationtypemask':_0x52ba2e['callDirection']===_0x5636('0x48')?0x1:0x2}]},getCustomFields(_0xf67bc3[_0x5636('0x41')],_0x11bf7c,_0xf67bc3['ticketType'])),'headers':{'Authorization':_0x5636('0x2e')+_0xcba35f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x359dc1);})[_0x5636('0x17')](function(_0xa4b924){var _0x1db80d=_0xa4b924[_0x5636('0x29')][_0x5636('0x49')];var _0x5b6eb9=_0x1db80d[_0x5636('0x2a')](_0x1db80d[_0x5636('0x2b')]('(')+0x1,_0x1db80d[_0x5636('0x2b')](')'));_0x52ba2e[_0x5636('0x4a')]=_0x5b6eb9;_0x19e159(_0x52ba2e);})['catch'](function(_0x33f2ca){_0x835db7(_0x33f2ca[_0x5636('0x16')]);});});}function emit(_0x1a6ce7,_0x2ee78a,_0x163268,_0x1a3770){var _0x537a06={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x1a6ce7,_0x163268,_0x1a3770)};io['to'](util[_0x5636('0x4b')](_0x5636('0x4c'),_0x2ee78a))[_0x5636('0x4d')](_0x5636('0x4e'),_0x537a06);}exports['cs']=function(_0x55dd1d,_0x3e4836,_0x23cdde,_0x515635,_0x52516e,_0x45dbf9,_0x4f4f51,_0x5e6eaa){var _0x5d0d72={};_0x45dbf9['remoteUri']=intUtil[_0x5636('0x4f')](_0x45dbf9[_0x5636('0xf')]);_0x45dbf9[_0x5636('0x50')]=intUtil[_0x5636('0x4f')](_0x45dbf9['serverUrl']);_0x5d0d72[_0x5636('0x47')]=_0x5e6eaa==='queue'||_0x5e6eaa===_0x5636('0x51')?_0x5636('0x48'):_0x5636('0x2f');var _0x68322e=util[_0x5636('0x4b')](_0x5636('0x52'),_0x45dbf9[_0x5636('0xf')]);var _0x28a72a=util[_0x5636('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0x45dbf9[_0x5636('0x53')]);var _0x1077b0=util[_0x5636('0x4b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x45dbf9[_0x5636('0x50')],_0x3e4836[_0x5636('0x54')],md5(_0x3e4836[_0x5636('0x54')]));if(_0x52516e&&_0x52516e[_0x5636('0x55')]){logger[_0x5636('0x20')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3e4836[_0x5636('0x56')]=_0x1077b0;}else if(_0x4f4f51&&_0x4f4f51[_0x5636('0x57')]&&_0x4f4f51[_0x5636('0x57')]!==_0x5636('0x58')){logger[_0x5636('0x20')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3e4836[_0x5636('0x56')]=_0x1077b0;}else{_0x3e4836['recordingURL']='';}return getUser(_0x5d0d72,_0x45dbf9,_0x515635,_0x28a72a,_0x68322e,_0x5e6eaa)[_0x5636('0x17')](function(_0xfefe50){logger['info']('['+_0x5e6eaa[_0x5636('0x15')]()+_0x5636('0x59'),_0xfefe50[_0x5636('0x24')]);logger[_0x5636('0x20')]('['+_0x5e6eaa[_0x5636('0x15')]()+_0x5636('0x5a'),_0xfefe50[_0x5636('0x5b')]);return getEndUser(_0xfefe50,_0x45dbf9,_0x28a72a,_0x68322e,_0x3e4836,_0x5e6eaa);})[_0x5636('0x17')](function(_0x4bbd70){logger[_0x5636('0x20')]('['+_0x5e6eaa[_0x5636('0x15')]()+_0x5636('0x5c'),_0x4bbd70[_0x5636('0x2c')]);logger[_0x5636('0x20')]('['+_0x5e6eaa['toUpperCase']()+_0x5636('0x5d'),_0x3e4836[_0x5636('0x30')]);return getTicket(_0x4bbd70,_0x45dbf9,_0x28a72a,_0x68322e,_0x3e4836,_0x23cdde,_0x5e6eaa);})['then'](function(_0x496bc9){logger[_0x5636('0x20')](util[_0x5636('0x4b')]('['+_0x5e6eaa['toUpperCase']()+_0x5636('0x5e'),_0x23cdde[_0x5636('0x3b')],_0x496bc9[_0x5636('0x4a')]));logger['info'](util[_0x5636('0x4b')]('['+_0x5e6eaa[_0x5636('0x15')]()+_0x5636('0x5f'),_0x5e6eaa));if(_0x5e6eaa!==_0x5636('0x51')){logger['info']('['+_0x5e6eaa['toUpperCase']()+']',_0x5636('0x60'));emit(_0x45dbf9['remoteUri'],_0x515635['name'],_0x23cdde['ticketType'],_0x496bc9[_0x5636('0x4a')]);}})[_0x5636('0x13')](function(_0x7d48ed){logger[_0x5636('0x14')]('['+_0x5e6eaa['toUpperCase']()+_0x5636('0x61'),util[_0x5636('0x62')](_0x7d48ed,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index ae15059..4a87191 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 _0xe82e=['Subjects','Descriptions','
','Tags','name','custom_fields','keyBy','value','format','%s/api/v2/tickets','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','remoteUri','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','forEach','includes','type','nameField','customField','content','string','picklist','push','variable','variableName','idField','Variable','toLowerCase','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','[OUTBOUND]','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','redis','defaults','application/json','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString'];(function(_0x3ef4f1,_0x5f0f9b){var _0x69953c=function(_0xb4e621){while(--_0xb4e621){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x69953c(++_0x5f0f9b);}(_0xe82e,0x101));var _0xee82=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xe82e[_0x344a3f];return _0x264712;};'use strict';var _=require(_0xee82('0x0'));var rp=require(_0xee82('0x1'));var md5=require(_0xee82('0x2'));var util=require(_0xee82('0x3'));var Redis=require(_0xee82('0x4'));var intUtil=require(_0xee82('0x5'));var config=require('../../../../config/environment');var logger=require(_0xee82('0x6'))('freshdesk');config[_0xee82('0x7')]=_[_0xee82('0x8')](config[_0xee82('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xee82('0x7')]));var headers={'Content-Type':'application/json','Accept':_0xee82('0x9')};function emit(_0x275a6d,_0x574cf8,_0x2ab2c5){io['to'](_0x275a6d)['emit'](_0x574cf8,_0x2ab2c5);}function getTicket(_0xa3f385,_0xd1c856,_0x13c023,_0x3687b4,_0xe0a5ca){logger[_0xee82('0xa')](_0xee82('0xb'));var _0x17ebe2=_[_0xee82('0xc')]({'responder_id':_0xd1c856['id'],'requester_id':_0x13c023['id'],'name':util['format'](_0xee82('0xd'),_0xe0a5ca[_0xee82('0xe')]),'phone':_0xe0a5ca['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xee82('0xf')](_0x3687b4[_0xee82('0x10')],_0xe0a5ca,'\x20'),'description':intUtil['getString'](_0x3687b4[_0xee82('0x11')],_0xe0a5ca,_0xee82('0x12')),'tags':getTags(_0x3687b4[_0xee82('0x13')],_0xee82('0x14'))},getCustomFields(_0x3687b4['Fields'],_0xe0a5ca));_0x17ebe2[_0xee82('0x15')]=_['mapValues'](_[_0xee82('0x16')](_0x17ebe2[_0xee82('0x15')],'id'),_0xee82('0x17'));return request({'uri':util[_0xee82('0x18')](_0xee82('0x19'),_0xa3f385['remoteUri']),'method':_0xee82('0x1a'),'body':_0x17ebe2})[_0xee82('0x1b')](function(_0x460652){logger[_0xee82('0xa')](_0xee82('0x1c'));return _0x460652;});}function getUser(_0x427038,_0x54710e){if(intUtil[_0xee82('0x1d')](_0x54710e)){return request({'uri':util[_0xee82('0x18')](_0xee82('0x1e'),_0x427038['remoteUri']),'qs':{'email':_0x54710e}})['then'](function(_0x423ff2){if(_0x423ff2[_0xee82('0x1f')]){logger['info'](_0xee82('0x20'));return _[_0xee82('0x21')](_0x423ff2,function(_0x3f2643){return _0x3f2643[_0xee82('0x22')][_0xee82('0x23')]===_0x54710e;});}else{logger[_0xee82('0xa')](_0xee82('0x24'));return request({'uri':util[_0xee82('0x18')](_0xee82('0x25'),_0x427038[_0xee82('0x26')])})[_0xee82('0x1b')](function(_0x5840c5){logger[_0xee82('0xa')](_0xee82('0x27'));return _0x5840c5;});}});}else{logger[_0xee82('0xa')](_0xee82('0x28'));return request({'uri':util['format'](_0xee82('0x25'),_0x427038[_0xee82('0x26')])})[_0xee82('0x1b')](function(_0x5c0957){logger[_0xee82('0xa')](_0xee82('0x27'));return _0x5c0957;});}}function getEndUser(_0x37412f,_0x594cb1,_0x3e45d2){logger[_0xee82('0xa')]('Searching\x20enduser\x20with\x20phone',_0x3e45d2);return request({'uri':util[_0xee82('0x18')](_0xee82('0x29'),_0x37412f[_0xee82('0x26')]),'qs':{'phone':_0x3e45d2}})['then'](function(_0x175eb8){if(_0x175eb8[_0xee82('0x1f')]){logger[_0xee82('0xa')](_0xee82('0x2a'));return _[_0xee82('0x21')](_0x175eb8,{'phone':_0x3e45d2});}else{logger[_0xee82('0xa')](_0xee82('0x2b'));return request({'uri':util[_0xee82('0x18')](_0xee82('0x29'),_0x37412f[_0xee82('0x26')]),'method':'POST','body':{'name':_0x594cb1,'phone':_0x3e45d2}})['then'](function(_0x15ed66){logger[_0xee82('0xa')](_0xee82('0x2c'));return _0x15ed66;});}});}function getAuth(_0x22a996){return util[_0xee82('0x18')](_0xee82('0x2d'),new Buffer(_0x22a996[_0xee82('0x2e')]+':X')[_0xee82('0x2f')](_0xee82('0x30')));}function request(_0x278076){logger[_0xee82('0x31')](_0xee82('0x32'),JSON[_0xee82('0x33')](_0x278076));return rp(_[_0xee82('0x8')](_0x278076,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4bcb38,_0x3d430b){var _0x1eb6c9=[];if(_0x4bcb38&&_0x4bcb38['length']>0x0){_0x1eb6c9=_['map'](_0x4bcb38,_0x3d430b);}return _0x1eb6c9;}function getCustomFields(_0x3d1635,_0x5cfbea){var _0x573c21=[];var _0x22cee0={'custom_fields':[]};if(_0x3d1635[_0xee82('0x1f')]>0x0){_[_0xee82('0x34')](_0x3d1635,function(_0x31b200){if(_[_0xee82('0x35')](['string','picklist'],_0x31b200[_0xee82('0x36')])&&_0x31b200[_0xee82('0x37')]&&!_0x31b200[_0xee82('0x38')]){_0x22cee0[_0x31b200['nameField']['toLowerCase']()]=_0x31b200[_0xee82('0x39')][_0xee82('0x2f')]();}else if(_[_0xee82('0x35')]([_0xee82('0x3a'),_0xee82('0x3b')],_0x31b200[_0xee82('0x36')])&&_0x31b200['idField']&&_0x31b200[_0xee82('0x38')]){_0x22cee0['custom_fields'][_0xee82('0x3c')]({'id':_0x31b200['idField'],'value':_0x31b200[_0xee82('0x39')][_0xee82('0x2f')]()});}else if(_0x31b200['type']===_0xee82('0x3d')&&_0x31b200[_0xee82('0x3e')]&&_0x31b200[_0xee82('0x3f')]&&_0x31b200[_0xee82('0x38')]){_0x5cfbea[_0x31b200[_0xee82('0x3e')]]&&_0x22cee0[_0xee82('0x15')][_0xee82('0x3c')]({'id':_0x31b200[_0xee82('0x3f')],'value':_0x5cfbea[_0x31b200[_0xee82('0x3e')]][_0xee82('0x2f')]()});}else if(_0x31b200['type']==='customVariable'&&_0x31b200[_0xee82('0x40')]&&_0x31b200[_0xee82('0x40')]['name']&&_0x31b200[_0xee82('0x3f')]&&_0x31b200['customField']){_0x5cfbea[_0x31b200[_0xee82('0x40')][_0xee82('0x14')][_0xee82('0x41')]()]&&_0x22cee0['custom_fields'][_0xee82('0x3c')]({'id':_0x31b200['idField'],'value':_0x5cfbea[_0x31b200[_0xee82('0x40')][_0xee82('0x14')][_0xee82('0x41')]()][_0xee82('0x2f')]()});}});}return _0x22cee0;}exports[_0xee82('0x42')]=function(_0x31135c,_0x28c72c,_0x2e952b,_0x5228bf,_0x5ce8da,_0x1ec2b5){var _0x2bafe9,_0x7badb1;_0x1ec2b5[_0xee82('0x26')]=intUtil[_0xee82('0x43')](_0x1ec2b5[_0xee82('0x26')]);_0x1ec2b5['serverUrl']=intUtil[_0xee82('0x43')](_0x1ec2b5['serverUrl']);if(_0x5ce8da&&_0x5ce8da[_0xee82('0x44')]){logger[_0xee82('0xa')](_0xee82('0x45'),_0xee82('0x46'));_0x28c72c[_0xee82('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1ec2b5[_0xee82('0x48')],_0x28c72c[_0xee82('0x49')],md5(_0x28c72c[_0xee82('0x49')]));}else{_0x28c72c[_0xee82('0x47')]='';}headers[_0xee82('0x4a')]=getAuth(_0x1ec2b5);return getUser(_0x1ec2b5,_0x5228bf[_0xee82('0x23')])[_0xee82('0x1b')](function(_0x344465){_0x2bafe9=_0x344465;logger[_0xee82('0xa')](_0xee82('0x4b'),_0x2bafe9['id']);return getEndUser(_0x1ec2b5,_0x28c72c[_0xee82('0xe')],_0x28c72c[_0xee82('0x4c')]);})['then'](function(_0x25bb71){_0x7badb1=_0x25bb71;logger['info'](_0xee82('0x4d'),_0x7badb1['id']);return getTicket(_0x1ec2b5,_0x2bafe9,_0x7badb1,_0x2e952b,_0x28c72c);})['then'](function(_0xdc7ee2){if(_0xdc7ee2&&_0xdc7ee2['id']){logger[_0xee82('0xa')]('Ticket\x20created!');logger[_0xee82('0xa')](_0xee82('0x4e'),_0xdc7ee2['id']);logger['info']('[QUEUE]',_0xee82('0x4f'));emit(util['format'](_0xee82('0x50'),_0x5228bf['name']),'trigger:browser:url',{'uri':util[_0xee82('0x18')]('%s/helpdesk/tickets/%d',_0x1ec2b5[_0xee82('0x26')],_0xdc7ee2['id'])});}})[_0xee82('0x51')](function(_0x1840c0){logger[_0xee82('0x52')]('[QUEUE]',JSON['stringify'](_0x1840c0));});};exports[_0xee82('0x53')]=function(_0x57b099,_0x2af99e,_0x5a458c,_0x4612b4,_0x2ed3f2,_0x518e27,_0x35b2ed){var _0x35ccd3,_0x15df65;_0x518e27[_0xee82('0x26')]=intUtil[_0xee82('0x43')](_0x518e27[_0xee82('0x26')]);_0x518e27['serverUrl']=intUtil['stripTrailingSlash'](_0x518e27['serverUrl']);if(_0x35b2ed&&_0x35b2ed[_0xee82('0x54')]&&_0x35b2ed['recordingFormat']!==_0xee82('0x55')){logger[_0xee82('0xa')]('[OUTBOUND]',_0xee82('0x46'));_0x2af99e[_0xee82('0x47')]=util['format'](_0xee82('0x56'),_0x518e27[_0xee82('0x48')],_0x2af99e[_0xee82('0x49')],md5(_0x2af99e[_0xee82('0x49')]));}headers[_0xee82('0x4a')]=getAuth(_0x518e27);return getUser(_0x518e27,_0x4612b4[_0xee82('0x23')])[_0xee82('0x1b')](function(_0x2cbf17){_0x35ccd3=_0x2cbf17;logger[_0xee82('0xa')](_0xee82('0x4b'),_0x35ccd3['id']);return getEndUser(_0x518e27,_0x2af99e[_0xee82('0x57')],_0x2af99e['destcalleridnum']);})[_0xee82('0x1b')](function(_0x1d6ad6){_0x15df65=_0x1d6ad6;logger['info']('The\x20Enduser\x20ID\x20is:',_0x15df65['id']);return getTicket(_0x518e27,_0x35ccd3,_0x15df65,_0x5a458c,_0x2af99e);})[_0xee82('0x1b')](function(_0x575dfe){if(_0x575dfe&&_0x575dfe['id']){logger[_0xee82('0xa')](_0xee82('0x1c'));logger[_0xee82('0xa')](_0xee82('0x4e'),_0x575dfe['id']);logger[_0xee82('0xa')](_0xee82('0x58'),_0xee82('0x4f'));emit(util['format'](_0xee82('0x50'),_0x4612b4[_0xee82('0x14')]),'trigger:browser:url',{'uri':util['format']('%s/helpdesk/tickets/%d',_0x518e27[_0xee82('0x26')],_0x575dfe['id'])});}})[_0xee82('0x51')](function(_0x1e325e){logger[_0xee82('0x52')](_0xee82('0x58'),JSON[_0xee82('0x33')](_0x1e325e));});};exports['unmanaged']=function(_0x4f4206,_0x50f178,_0x588d0b,_0x51854b,_0x54cddd,_0x46a021){var _0x52d90c,_0x4b2d18;_0x46a021[_0xee82('0x26')]=intUtil[_0xee82('0x43')](_0x46a021[_0xee82('0x26')]);_0x46a021[_0xee82('0x48')]=intUtil[_0xee82('0x43')](_0x46a021['serverUrl']);if(_0x54cddd&&_0x54cddd[_0xee82('0x44')]){logger['info']('['+_0x50f178[_0xee82('0x59')][_0xee82('0x5a')]()+']',_0xee82('0x46'));_0x50f178[_0xee82('0x47')]=util[_0xee82('0x18')](_0xee82('0x56'),_0x46a021[_0xee82('0x48')],_0x50f178[_0xee82('0x49')],md5(_0x50f178['uniqueid']));}else{_0x50f178['recordingURL']='';}headers[_0xee82('0x4a')]=getAuth(_0x46a021);return getUser(_0x46a021,'')[_0xee82('0x1b')](function(_0x50356e){_0x52d90c=_0x50356e;logger[_0xee82('0xa')]('The\x20User\x20ID\x20is:',_0x52d90c['id']);return getEndUser(_0x46a021,_0x50f178[_0xee82('0xe')],_0x50f178[_0xee82('0x4c')]);})[_0xee82('0x1b')](function(_0xaa131c){_0x4b2d18=_0xaa131c;logger[_0xee82('0xa')]('The\x20Enduser\x20ID\x20is:',_0x4b2d18['id']);return getTicket(_0x46a021,_0x52d90c,_0x4b2d18,_0x588d0b,_0x50f178);})[_0xee82('0x1b')](function(_0x5026af){if(_0x5026af){logger[_0xee82('0xa')]('Ticket\x20created!');logger[_0xee82('0xa')](_0xee82('0x4e'),_0x5026af['id']);}})['catch'](function(_0x1b6d49){logger[_0xee82('0x52')]('['+_0x50f178[_0xee82('0x59')][_0xee82('0x5a')]()+']',JSON[_0xee82('0x33')](_0x1b6d49));});}; \ No newline at end of file +var _0xa1ab=['Subjects','
','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','stringify','defaults','GET','map','forEach','includes','string','nameField','customField','toLowerCase','picklist','type','idField','content','variable','variableName','push','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20Enduser\x20ID\x20is:','trigger:browser:url','unmanaged','toUpperCase','calleridname','lastevent','md5','ioredis','./util','../../../../config/environment','freshdesk','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','getString'];(function(_0x4950a0,_0x1c04e2){var _0x56d5a0=function(_0x3bf439){while(--_0x3bf439){_0x4950a0['push'](_0x4950a0['shift']());}};_0x56d5a0(++_0x1c04e2);}(_0xa1ab,0x1ae));var _0xba1a=function(_0x423cc8,_0x51155e){_0x423cc8=_0x423cc8-0x0;var _0x16f336=_0xa1ab[_0x423cc8];return _0x16f336;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xba1a('0x0'));var util=require('util');var Redis=require(_0xba1a('0x1'));var intUtil=require(_0xba1a('0x2'));var config=require(_0xba1a('0x3'));var logger=require('../../../../config/logger')(_0xba1a('0x4'));config[_0xba1a('0x5')]=_['defaults'](config[_0xba1a('0x5')],{'host':_0xba1a('0x6'),'port':0x18eb});var io=require(_0xba1a('0x7'))(new Redis(config[_0xba1a('0x5')]));var headers={'Content-Type':_0xba1a('0x8'),'Accept':_0xba1a('0x8')};function emit(_0x42dd63,_0x596b2b,_0x5908a4){io['to'](_0x42dd63)['emit'](_0x596b2b,_0x5908a4);}function getTicket(_0x53e506,_0x3c818b,_0x4bf345,_0x4d20ee,_0x274b13){logger[_0xba1a('0x9')](_0xba1a('0xa'));var _0x30517b=_['merge']({'responder_id':_0x3c818b['id'],'requester_id':_0x4bf345['id'],'name':util[_0xba1a('0xb')](_0xba1a('0xc'),_0x274b13['calleridname']),'phone':_0x274b13[_0xba1a('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xba1a('0xe')](_0x4d20ee[_0xba1a('0xf')],_0x274b13,'\x20'),'description':intUtil[_0xba1a('0xe')](_0x4d20ee['Descriptions'],_0x274b13,_0xba1a('0x10')),'tags':getTags(_0x4d20ee['Tags'],_0xba1a('0x11'))},getCustomFields(_0x4d20ee['Fields'],_0x274b13));_0x30517b[_0xba1a('0x12')]=_[_0xba1a('0x13')](_[_0xba1a('0x14')](_0x30517b[_0xba1a('0x12')],'id'),_0xba1a('0x15'));return request({'uri':util[_0xba1a('0xb')](_0xba1a('0x16'),_0x53e506['remoteUri']),'method':'POST','body':_0x30517b})[_0xba1a('0x17')](function(_0x27133c){logger[_0xba1a('0x9')](_0xba1a('0x18'));return _0x27133c;});}function getUser(_0x328e70,_0x5ea513){if(intUtil[_0xba1a('0x19')](_0x5ea513)){return request({'uri':util[_0xba1a('0xb')](_0xba1a('0x1a'),_0x328e70[_0xba1a('0x1b')]),'qs':{'email':_0x5ea513}})[_0xba1a('0x17')](function(_0x2c46a5){if(_0x2c46a5['length']){logger[_0xba1a('0x9')]('Agent\x20found!');return _[_0xba1a('0x1c')](_0x2c46a5,function(_0x78ac04){return _0x78ac04[_0xba1a('0x1d')][_0xba1a('0x1e')]===_0x5ea513;});}else{logger[_0xba1a('0x9')](_0xba1a('0x1f'));return request({'uri':util['format'](_0xba1a('0x20'),_0x328e70[_0xba1a('0x1b')])})[_0xba1a('0x17')](function(_0x20ff2e){logger[_0xba1a('0x9')]('Admin\x20account\x20selected.');return _0x20ff2e;});}});}else{logger['info'](_0xba1a('0x21'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x328e70[_0xba1a('0x1b')])})[_0xba1a('0x17')](function(_0x331224){logger[_0xba1a('0x9')](_0xba1a('0x22'));return _0x331224;});}}function getEndUser(_0x545633,_0x2426d1,_0x50069a){logger['info'](_0xba1a('0x23'),_0x50069a);return request({'uri':util[_0xba1a('0xb')](_0xba1a('0x24'),_0x545633[_0xba1a('0x1b')]),'qs':{'phone':_0x50069a}})[_0xba1a('0x17')](function(_0xb5127a){if(_0xb5127a[_0xba1a('0x25')]){logger['info']('Enduser\x20found!');return _[_0xba1a('0x1c')](_0xb5127a,{'phone':_0x50069a});}else{logger[_0xba1a('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xba1a('0xb')](_0xba1a('0x24'),_0x545633[_0xba1a('0x1b')]),'method':_0xba1a('0x26'),'body':{'name':_0x2426d1,'phone':_0x50069a}})[_0xba1a('0x17')](function(_0x4be049){logger[_0xba1a('0x9')](_0xba1a('0x27'));return _0x4be049;});}});}function getAuth(_0x33c041){return util[_0xba1a('0xb')](_0xba1a('0x28'),new Buffer(_0x33c041[_0xba1a('0x29')]+':X')[_0xba1a('0x2a')]('base64'));}function request(_0x2ba5ac){logger[_0xba1a('0x2b')]('[HTTP]',JSON[_0xba1a('0x2c')](_0x2ba5ac));return rp(_[_0xba1a('0x2d')](_0x2ba5ac,{'method':_0xba1a('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x63126e,_0x3c73c3){var _0x52d39c=[];if(_0x63126e&&_0x63126e[_0xba1a('0x25')]>0x0){_0x52d39c=_[_0xba1a('0x2f')](_0x63126e,_0x3c73c3);}return _0x52d39c;}function getCustomFields(_0x5cf891,_0x1ba489){var _0x345326=[];var _0x26382c={'custom_fields':[]};if(_0x5cf891['length']>0x0){_[_0xba1a('0x30')](_0x5cf891,function(_0x3f5e1f){if(_[_0xba1a('0x31')]([_0xba1a('0x32'),'picklist'],_0x3f5e1f['type'])&&_0x3f5e1f[_0xba1a('0x33')]&&!_0x3f5e1f[_0xba1a('0x34')]){_0x26382c[_0x3f5e1f[_0xba1a('0x33')][_0xba1a('0x35')]()]=_0x3f5e1f['content'][_0xba1a('0x2a')]();}else if(_[_0xba1a('0x31')]([_0xba1a('0x32'),_0xba1a('0x36')],_0x3f5e1f[_0xba1a('0x37')])&&_0x3f5e1f[_0xba1a('0x38')]&&_0x3f5e1f[_0xba1a('0x34')]){_0x26382c['custom_fields']['push']({'id':_0x3f5e1f[_0xba1a('0x38')],'value':_0x3f5e1f[_0xba1a('0x39')][_0xba1a('0x2a')]()});}else if(_0x3f5e1f[_0xba1a('0x37')]===_0xba1a('0x3a')&&_0x3f5e1f[_0xba1a('0x3b')]&&_0x3f5e1f[_0xba1a('0x38')]&&_0x3f5e1f[_0xba1a('0x34')]){_0x1ba489[_0x3f5e1f[_0xba1a('0x3b')]]&&_0x26382c[_0xba1a('0x12')][_0xba1a('0x3c')]({'id':_0x3f5e1f[_0xba1a('0x38')],'value':_0x1ba489[_0x3f5e1f[_0xba1a('0x3b')]][_0xba1a('0x2a')]()});}else if(_0x3f5e1f[_0xba1a('0x37')]===_0xba1a('0x3d')&&_0x3f5e1f[_0xba1a('0x3e')]&&_0x3f5e1f[_0xba1a('0x3e')][_0xba1a('0x11')]&&_0x3f5e1f['idField']&&_0x3f5e1f[_0xba1a('0x34')]){_0x1ba489[_0x3f5e1f[_0xba1a('0x3e')][_0xba1a('0x11')]['toLowerCase']()]&&_0x26382c['custom_fields'][_0xba1a('0x3c')]({'id':_0x3f5e1f[_0xba1a('0x38')],'value':_0x1ba489[_0x3f5e1f[_0xba1a('0x3e')][_0xba1a('0x11')]['toLowerCase']()]['toString']()});}});}return _0x26382c;}exports[_0xba1a('0x3f')]=function(_0x5216de,_0x595b45,_0x372675,_0x542903,_0x27a113,_0x14d721){var _0x54e741,_0x300dc3;_0x14d721[_0xba1a('0x1b')]=intUtil['stripTrailingSlash'](_0x14d721[_0xba1a('0x1b')]);_0x14d721[_0xba1a('0x40')]=intUtil[_0xba1a('0x41')](_0x14d721['serverUrl']);if(_0x27a113&&_0x27a113[_0xba1a('0x42')]){logger['info'](_0xba1a('0x43'),_0xba1a('0x44'));_0x595b45[_0xba1a('0x45')]=util[_0xba1a('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14d721[_0xba1a('0x40')],_0x595b45[_0xba1a('0x46')],md5(_0x595b45[_0xba1a('0x46')]));}else{_0x595b45[_0xba1a('0x45')]='';}headers[_0xba1a('0x47')]=getAuth(_0x14d721);return getUser(_0x14d721,_0x542903[_0xba1a('0x1e')])['then'](function(_0x387427){_0x54e741=_0x387427;logger[_0xba1a('0x9')](_0xba1a('0x48'),_0x54e741['id']);return getEndUser(_0x14d721,_0x595b45['calleridname'],_0x595b45['calleridnum']);})[_0xba1a('0x17')](function(_0x388589){_0x300dc3=_0x388589;logger['info']('The\x20Enduser\x20ID\x20is:',_0x300dc3['id']);return getTicket(_0x14d721,_0x54e741,_0x300dc3,_0x372675,_0x595b45);})[_0xba1a('0x17')](function(_0x20e925){if(_0x20e925&&_0x20e925['id']){logger['info'](_0xba1a('0x18'));logger[_0xba1a('0x9')](_0xba1a('0x49'),_0x20e925['id']);logger[_0xba1a('0x9')](_0xba1a('0x43'),_0xba1a('0x4a'));emit(util[_0xba1a('0xb')](_0xba1a('0x4b'),_0x542903[_0xba1a('0x11')]),'trigger:browser:url',{'uri':util[_0xba1a('0xb')](_0xba1a('0x4c'),_0x14d721[_0xba1a('0x1b')],_0x20e925['id'])});}})[_0xba1a('0x4d')](function(_0x4a5b72){logger[_0xba1a('0x4e')]('[QUEUE]',JSON['stringify'](_0x4a5b72));});};exports['outbound']=function(_0x4da00d,_0x4c9f7a,_0x17e191,_0x5d2837,_0x40cd30,_0x11612e,_0x544d4a){var _0x4c2692,_0x4208d9;_0x11612e[_0xba1a('0x1b')]=intUtil[_0xba1a('0x41')](_0x11612e[_0xba1a('0x1b')]);_0x11612e[_0xba1a('0x40')]=intUtil['stripTrailingSlash'](_0x11612e[_0xba1a('0x40')]);if(_0x544d4a&&_0x544d4a['recordingFormat']&&_0x544d4a[_0xba1a('0x4f')]!==_0xba1a('0x50')){logger[_0xba1a('0x9')](_0xba1a('0x51'),_0xba1a('0x44'));_0x4c9f7a['recordingURL']=util[_0xba1a('0xb')](_0xba1a('0x52'),_0x11612e[_0xba1a('0x40')],_0x4c9f7a[_0xba1a('0x46')],md5(_0x4c9f7a[_0xba1a('0x46')]));}headers['Authorization']=getAuth(_0x11612e);return getUser(_0x11612e,_0x5d2837['email'])[_0xba1a('0x17')](function(_0x5f2480){_0x4c2692=_0x5f2480;logger[_0xba1a('0x9')](_0xba1a('0x48'),_0x4c2692['id']);return getEndUser(_0x11612e,_0x4c9f7a['destcalleridname'],_0x4c9f7a['destcalleridnum']);})[_0xba1a('0x17')](function(_0x4c57a8){_0x4208d9=_0x4c57a8;logger['info'](_0xba1a('0x53'),_0x4208d9['id']);return getTicket(_0x11612e,_0x4c2692,_0x4208d9,_0x17e191,_0x4c9f7a);})['then'](function(_0x24b8bd){if(_0x24b8bd&&_0x24b8bd['id']){logger['info'](_0xba1a('0x18'));logger[_0xba1a('0x9')]('The\x20Ticket\x20ID\x20is:',_0x24b8bd['id']);logger['info'](_0xba1a('0x51'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xba1a('0xb')]('user:%s',_0x5d2837['name']),_0xba1a('0x54'),{'uri':util[_0xba1a('0xb')]('%s/helpdesk/tickets/%d',_0x11612e[_0xba1a('0x1b')],_0x24b8bd['id'])});}})['catch'](function(_0x7c2a1c){logger[_0xba1a('0x4e')](_0xba1a('0x51'),JSON[_0xba1a('0x2c')](_0x7c2a1c));});};exports[_0xba1a('0x55')]=function(_0xc4dc5d,_0x402010,_0x30bf93,_0x34ea4f,_0x2e28c4,_0x1e46b7){var _0x1564c5,_0x4c6701;_0x1e46b7['remoteUri']=intUtil[_0xba1a('0x41')](_0x1e46b7[_0xba1a('0x1b')]);_0x1e46b7[_0xba1a('0x40')]=intUtil[_0xba1a('0x41')](_0x1e46b7[_0xba1a('0x40')]);if(_0x2e28c4&&_0x2e28c4[_0xba1a('0x42')]){logger[_0xba1a('0x9')]('['+_0x402010['lastevent'][_0xba1a('0x56')]()+']',_0xba1a('0x44'));_0x402010[_0xba1a('0x45')]=util[_0xba1a('0xb')](_0xba1a('0x52'),_0x1e46b7[_0xba1a('0x40')],_0x402010[_0xba1a('0x46')],md5(_0x402010[_0xba1a('0x46')]));}else{_0x402010[_0xba1a('0x45')]='';}headers[_0xba1a('0x47')]=getAuth(_0x1e46b7);return getUser(_0x1e46b7,'')[_0xba1a('0x17')](function(_0x1de85d){_0x1564c5=_0x1de85d;logger[_0xba1a('0x9')](_0xba1a('0x48'),_0x1564c5['id']);return getEndUser(_0x1e46b7,_0x402010[_0xba1a('0x57')],_0x402010[_0xba1a('0xd')]);})[_0xba1a('0x17')](function(_0x5c39cf){_0x4c6701=_0x5c39cf;logger[_0xba1a('0x9')](_0xba1a('0x53'),_0x4c6701['id']);return getTicket(_0x1e46b7,_0x1564c5,_0x4c6701,_0x30bf93,_0x402010);})[_0xba1a('0x17')](function(_0x1011d4){if(_0x1011d4){logger[_0xba1a('0x9')]('Ticket\x20created!');logger[_0xba1a('0x9')](_0xba1a('0x49'),_0x1011d4['id']);}})[_0xba1a('0x4d')](function(_0x3e940d){logger[_0xba1a('0x4e')]('['+_0x402010[_0xba1a('0x58')][_0xba1a('0x56')]()+']',JSON[_0xba1a('0x2c')](_0x3e940d));});}; \ 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 8d4bd70..f371558 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 _0x05bc=['recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','request-promise','util','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','adminId','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require(_0xc05b('0x0'));var md5=require('md5');var util=require(_0xc05b('0x1'));var moment=require(_0xc05b('0x2'));var Promise=require('bluebird');var Redis=require(_0xc05b('0x3'));var intUtil=require(_0xc05b('0x4'));var config=require(_0xc05b('0x5'));var logger=require(_0xc05b('0x6'))(_0xc05b('0x7'));config[_0xc05b('0x8')]=_[_0xc05b('0x9')](config[_0xc05b('0x8')],{'host':_0xc05b('0xa'),'port':0x18eb});var io=require(_0xc05b('0xb'))(new Redis(config[_0xc05b('0x8')]));function getAdminId(_0x143ba4,_0x45245b,_0x2b6c75,_0x5c13ee){return new Promise(function(_0x5d72b9,_0x2e0ae1){var _0x430531=![];var _0x376e79={'method':_0xc05b('0xc'),'uri':_0x5c13ee+_0xc05b('0xd'),'json':!![]};_0x376e79[_0xc05b('0xe')]=_0x2b6c75;logger[_0xc05b('0xf')](_0xc05b('0x10'));return rp(_0x376e79)[_0xc05b('0x11')](function(_0x5a7ad0){if(_0x5a7ad0){var _0x2976c2=_0x5a7ad0[_0xc05b('0x12')];var _0x12c7ec=null;for(_0x12c7ec=0x0;_0x12c7ec<_0x2976c2[_0xc05b('0x13')];_0x12c7ec++){if(_0x2976c2[_0x12c7ec][_0xc05b('0x14')]===_0x143ba4[_0xc05b('0x15')]){_0x143ba4['adminId']=_0x2976c2[_0x12c7ec]['id'];_0x430531=!![];}}if(_0x430531){logger[_0xc05b('0xf')](_0xc05b('0x16'),_0x143ba4['adminId']);_0x5d72b9(_0x143ba4);}else{_0x2e0ae1({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2e0ae1({'statusCode':0x194,'message':_0xc05b('0x17')});}})[_0xc05b('0x18')](function(_0x5ce354){logger[_0xc05b('0x19')]('['+[_0x45245b[_0xc05b('0x1a')]()]+']',_0x5ce354[_0xc05b('0x1b')]);_0x2e0ae1(_0x5ce354);});});}function getUser(_0xe94a8f,_0x5a33c1,_0x42395b){return function(_0x13c79f){return new Promise(function(_0xee4d8,_0x421cb){var _0x1cba94={'method':_0xc05b('0xc'),'uri':_0x42395b+'/api/selector/owners','json':!![]};_0x1cba94[_0xc05b('0xe')]=_0x5a33c1;logger['info'](_0xc05b('0x1c'));return rp(_0x1cba94)[_0xc05b('0x11')](function(_0x45d561){if(_0x45d561){var _0x12dcd5=_0x45d561[_0xc05b('0x12')];var _0x48c36e=![];var _0x10eb99=null;if(_0x13c79f[_0xc05b('0x1d')]!==null){logger[_0xc05b('0xf')](_0xc05b('0x1e'),_0x13c79f['agentEmail']);_0x13c79f[_0xc05b('0x1f')]=_0x13c79f[_0xc05b('0x1d')];for(_0x10eb99=0x0;_0x10eb99<_0x12dcd5[_0xc05b('0x13')];_0x10eb99++){if(_0x12dcd5[_0x10eb99][_0xc05b('0x14')]===_0x13c79f[_0xc05b('0x1d')]){_0x48c36e=!![];_0x13c79f[_0xc05b('0x20')]=_0x12dcd5[_0x10eb99]['id'];logger['info']('User\x20found:',_0x13c79f[_0xc05b('0x20')]);}}}if(!_0x48c36e){logger[_0xc05b('0xf')]('Admin\x20selected');_0x13c79f[_0xc05b('0x1f')]=_0x13c79f['adminEmail'];_0x13c79f['userId']=_0x13c79f[_0xc05b('0x21')];_0x48c36e=!![];}if(_0x48c36e){_0xee4d8(_0x13c79f);}else{_0x421cb({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x421cb({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x3a085f){logger['error']('['+[_0xe94a8f[_0xc05b('0x1a')]()]+']',_0x3a085f[_0xc05b('0x1b')]);_0x421cb(_0x3a085f);});});};}function searchContact(_0x4d1fd4,_0x337cc1,_0x395baa,_0x444a55){return new Promise(function(_0x3e26c4,_0x23a937){var _0xeb6d8b={'method':_0xc05b('0xc'),'headers':_0x337cc1,'uri':_0x4d1fd4+_0xc05b('0x22')+_0x444a55+_0xc05b('0x23')+_0x395baa+_0xc05b('0x24'),'json':!![]};rp(_0xeb6d8b)[_0xc05b('0x11')](function(_0x35f8f7){var _0x4fbdc7=_[_0xc05b('0x25')](_0x35f8f7['contacts'][_0xc05b('0x26')],[_0x395baa,_0x444a55]);_0x3e26c4(_0x4fbdc7);})['catch'](function(_0x580d43){_0x23a937(_0x580d43);});});}function getEndUser(_0x78333,_0x772f50,_0x1c39d5){return function(_0x48366c){return new Promise(function(_0x884fcb,_0x4deec8){logger['info'](util['format'](_0xc05b('0x27'),_0x48366c[_0xc05b('0x28')]));searchContact(_0x1c39d5,_0x772f50,_0xc05b('0x29'),_0x48366c['contactNumber'])[_0xc05b('0x11')](function(_0x1601e3){if(_0x1601e3){_0x48366c[_0xc05b('0x2a')]=_0x1601e3['id'];logger[_0xc05b('0xf')]('Contact\x20found\x20mobile_number:',_0x48366c[_0xc05b('0x2a')]);return _0x884fcb(_0x48366c);}searchContact(_0x1c39d5,_0x772f50,_0xc05b('0x2b'),_0x48366c[_0xc05b('0x28')])['then'](function(_0x3e3309){if(_0x3e3309){_0x48366c[_0xc05b('0x2a')]=_0x3e3309['id'];logger['info'](_0xc05b('0x2c'),_0x48366c[_0xc05b('0x2a')]);return _0x884fcb(_0x48366c);}createEndUser(_0x48366c,_0x78333,_0x772f50,_0x1c39d5)['then'](function(_0x497589){logger[_0xc05b('0xf')](_0xc05b('0x2d'),_0x497589[_0xc05b('0x2a')]);return _0x884fcb(_0x497589);});});})[_0xc05b('0x18')](function(_0x549899){_0x4deec8(_0x549899);});});};}function createEndUser(_0x19cff2,_0x4883c2,_0xea8bc4,_0x2239aa){return new Promise(function(_0x11cfbc,_0x98ecbd){var _0x5744c1=moment();var _0x7fa59d={'method':_0xc05b('0x2e'),'uri':_0x2239aa+'/api/contacts','body':{'contact':{'last_name':_0x19cff2['contactNumber'],'work_number':_0x19cff2[_0xc05b('0x28')],'mobile_number':_0x19cff2[_0xc05b('0x28')],'owner_id':_0x19cff2[_0xc05b('0x20')],'created_at':_0x5744c1[_0xc05b('0x2f')](_0xc05b('0x30'))}},'json':!![]};_0x7fa59d['headers']=_0xea8bc4;logger[_0xc05b('0xf')](_0xc05b('0x31'));return rp(_0x7fa59d)[_0xc05b('0x11')](function(_0x4b858e){_0x19cff2['endUserId']=_0x4b858e['contact']['id'];_0x11cfbc(_0x19cff2);})[_0xc05b('0x18')](function(_0x56ba68){logger[_0xc05b('0x19')]('['+[_0x4883c2['toUpperCase']()]+']',_0x56ba68[_0xc05b('0x1b')]);_0x98ecbd(_0x56ba68[_0xc05b('0x1b')]);});});}function getTicket(_0x2bb4c0,_0x1222a8,_0x5bf0b5,_0x53bc46,_0x2aa4b8){return function(_0x4b3150){logger[_0xc05b('0xf')]('Creating\x20new\x20task');return new Promise(function(_0x249a9d,_0x1f6ecb){var _0x4fd1d2=moment();var _0x3697ff={'method':_0xc05b('0x2e'),'uri':_0x5bf0b5+_0xc05b('0x32'),'body':{'title':intUtil[_0xc05b('0x33')](_0x53bc46[_0xc05b('0x34')],_0x2aa4b8,'\x20'),'description':intUtil[_0xc05b('0x33')](_0x53bc46[_0xc05b('0x35')],_0x2aa4b8,'\x0a'),'owner_id':_0x4b3150[_0xc05b('0x20')],'creater_id':_0x4b3150[_0xc05b('0x21')],'targetable_id':_0x4b3150[_0xc05b('0x2a')],'targetable_type':_0xc05b('0x36'),'created_at':_0x4fd1d2['format'](_0xc05b('0x30')),'due_date':_0x4fd1d2[_0xc05b('0x37')](0x1e,'m')[_0xc05b('0x2f')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x3697ff[_0xc05b('0xe')]=_0x1222a8;return rp(_0x3697ff)[_0xc05b('0x11')](function(_0x47754d){_0x4b3150[_0xc05b('0x38')]=_0x47754d['task']['id'];logger[_0xc05b('0xf')](_0xc05b('0x39'),_0x4b3150['ticketId']);_0x249a9d(_0x4b3150);})[_0xc05b('0x18')](function(_0x41a78d){logger[_0xc05b('0x19')]('['+[_0x2bb4c0['toUpperCase']()]+']',_0x41a78d[_0xc05b('0x1b')]);_0x1f6ecb(_0x41a78d[_0xc05b('0x1b')]);});});};}function emit(_0x2cabd4,_0x828b23,_0x48a388){var _0x6fef0c={'uri':_0x2cabd4+_0xc05b('0x3a')+_0x48a388};io['to'](util['format'](_0xc05b('0x3b'),_0x828b23))[_0xc05b('0x3c')](_0xc05b('0x3d'),_0x6fef0c);}exports['cs']=function(_0x1851c8,_0x1f6d8a,_0x4a3f98,_0x2bc814,_0x10842e,_0x28ca5f,_0x216d41,_0xea513b){var _0x45467={};var _0xe7e2a3={'Authorization':'Token\x20token='+_0x28ca5f[_0xc05b('0x3e')]};_0x28ca5f[_0xc05b('0x3f')]=intUtil[_0xc05b('0x40')](_0x28ca5f[_0xc05b('0x3f')]);_0x28ca5f[_0xc05b('0x41')]=intUtil[_0xc05b('0x40')](_0x28ca5f['serverUrl']);var _0x316469=_0x28ca5f[_0xc05b('0x3f')];_0x45467['adminEmail']=_0x28ca5f[_0xc05b('0x42')];_0x45467[_0xc05b('0x28')]=_0xea513b[_0xc05b('0x43')]()===_0xc05b('0x44')?_0x1f6d8a['destcalleridnum']:_0x1f6d8a['calleridnum'];_0x45467[_0xc05b('0x45')]=_0xea513b===_0xc05b('0x46')||_0xea513b===_0xc05b('0x47')?_0xc05b('0x46'):'outbound';if(_0x2bc814){_0x45467[_0xc05b('0x1d')]=_0x2bc814['email'];}var _0x4cd1b9=util[_0xc05b('0x2f')](_0xc05b('0x48'),_0x28ca5f[_0xc05b('0x41')],_0x1f6d8a[_0xc05b('0x49')],md5(_0x1f6d8a[_0xc05b('0x49')]));if(_0x10842e&&_0x10842e['monitor_format']){logger[_0xc05b('0xf')]('[QUEUE]',_0xc05b('0x4a'));_0x1f6d8a[_0xc05b('0x4b')]=_0x4cd1b9;}else if(_0x216d41&&_0x216d41[_0xc05b('0x4c')]&&_0x216d41['recordingFormat']!==_0xc05b('0x4d')){logger[_0xc05b('0xf')](_0xc05b('0x4e'),_0xc05b('0x4a'));_0x1f6d8a[_0xc05b('0x4b')]=_0x4cd1b9;}else{_0x1f6d8a[_0xc05b('0x4b')]='';}return getAdminId(_0x45467,_0xea513b,_0xe7e2a3,_0x316469)[_0xc05b('0x11')](getUser(_0xea513b,_0xe7e2a3,_0x316469))['then'](getEndUser(_0xea513b,_0xe7e2a3,_0x316469))[_0xc05b('0x11')](getTicket(_0xea513b,_0xe7e2a3,_0x316469,_0x4a3f98,_0x1f6d8a))[_0xc05b('0x11')](function(_0x2d2085){logger[_0xc05b('0xf')](util['format'](_0xc05b('0x4f'),_0x2d2085[_0xc05b('0x38')]));if(_0xea513b!=='unmanaged'){logger[_0xc05b('0xf')]('['+[_0xea513b[_0xc05b('0x1a')]()]+']',_0xc05b('0x50'));emit(_0x316469,_0x2bc814[_0xc05b('0x51')],_0x2d2085['endUserId']);}})[_0xc05b('0x18')](function(_0x4b0427){logger['error']('['+[_0xea513b[_0xc05b('0x1a')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xc05b('0x52')](_0x4b0427,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe953=['trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','queue','unmanaged','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','bluebird','ioredis','../../../../config/environment','freshsales','defaults','redis','localhost','socket.io-emitter','GET','headers','Getting\x20admin\x20information','then','users','email','adminEmail','info','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','length','userId','User\x20found:','Admin\x20selected','userEmail','error','/api/lookup?q=','&f=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','add','task','Task\x20created:','ticketId','user:%s'];(function(_0x563e9b,_0x1b82f4){var _0x25dc70=function(_0x3cd05e){while(--_0x3cd05e){_0x563e9b['push'](_0x563e9b['shift']());}};_0x25dc70(++_0x1b82f4);}(_0xe953,0x1d0));var _0x3e95=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0xe953[_0x58547b];return _0x1d3fd2;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require('util');var moment=require('moment');var Promise=require(_0x3e95('0x0'));var Redis=require(_0x3e95('0x1'));var intUtil=require('./util');var config=require(_0x3e95('0x2'));var logger=require('../../../../config/logger')(_0x3e95('0x3'));config['redis']=_[_0x3e95('0x4')](config[_0x3e95('0x5')],{'host':_0x3e95('0x6'),'port':0x18eb});var io=require(_0x3e95('0x7'))(new Redis(config[_0x3e95('0x5')]));function getAdminId(_0x5bb380,_0x38c27b,_0x21ac04,_0x1b6ce7){return new Promise(function(_0x5ae40a,_0xf019c5){var _0x12a756=![];var _0x35ed18={'method':_0x3e95('0x8'),'uri':_0x1b6ce7+'/api/selector/owners','json':!![]};_0x35ed18[_0x3e95('0x9')]=_0x21ac04;logger['info'](_0x3e95('0xa'));return rp(_0x35ed18)[_0x3e95('0xb')](function(_0x2ae756){if(_0x2ae756){var _0x3b2f1a=_0x2ae756[_0x3e95('0xc')];var _0x152671=null;for(_0x152671=0x0;_0x152671<_0x3b2f1a['length'];_0x152671++){if(_0x3b2f1a[_0x152671][_0x3e95('0xd')]===_0x5bb380[_0x3e95('0xe')]){_0x5bb380['adminId']=_0x3b2f1a[_0x152671]['id'];_0x12a756=!![];}}if(_0x12a756){logger[_0x3e95('0xf')](_0x3e95('0x10'),_0x5bb380[_0x3e95('0x11')]);_0x5ae40a(_0x5bb380);}else{_0xf019c5({'statusCode':0x194,'message':_0x3e95('0x12')});}}else{_0xf019c5({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x3e95('0x13')](function(_0xd1d345){logger['error']('['+[_0x38c27b[_0x3e95('0x14')]()]+']',_0xd1d345[_0x3e95('0x15')]);_0xf019c5(_0xd1d345);});});}function getUser(_0x12dec2,_0xc3be41,_0x5c8896){return function(_0x1490ec){return new Promise(function(_0x4d44c3,_0x3ecd6f){var _0x2f6a8c={'method':'GET','uri':_0x5c8896+_0x3e95('0x16'),'json':!![]};_0x2f6a8c[_0x3e95('0x9')]=_0xc3be41;logger[_0x3e95('0xf')](_0x3e95('0x17'));return rp(_0x2f6a8c)[_0x3e95('0xb')](function(_0x1da3c7){if(_0x1da3c7){var _0x177818=_0x1da3c7[_0x3e95('0xc')];var _0x5c7479=![];var _0x18a811=null;if(_0x1490ec['agentEmail']!==null){logger[_0x3e95('0xf')](_0x3e95('0x18'),_0x1490ec[_0x3e95('0x19')]);_0x1490ec['userEmail']=_0x1490ec[_0x3e95('0x19')];for(_0x18a811=0x0;_0x18a811<_0x177818[_0x3e95('0x1a')];_0x18a811++){if(_0x177818[_0x18a811][_0x3e95('0xd')]===_0x1490ec[_0x3e95('0x19')]){_0x5c7479=!![];_0x1490ec[_0x3e95('0x1b')]=_0x177818[_0x18a811]['id'];logger[_0x3e95('0xf')](_0x3e95('0x1c'),_0x1490ec[_0x3e95('0x1b')]);}}}if(!_0x5c7479){logger[_0x3e95('0xf')](_0x3e95('0x1d'));_0x1490ec[_0x3e95('0x1e')]=_0x1490ec[_0x3e95('0xe')];_0x1490ec[_0x3e95('0x1b')]=_0x1490ec[_0x3e95('0x11')];_0x5c7479=!![];}if(_0x5c7479){_0x4d44c3(_0x1490ec);}else{_0x3ecd6f({'statusCode':0x194,'message':_0x3e95('0x12')});}}else{_0x3ecd6f({'statusCode':0x194,'message':_0x3e95('0x12')});}})[_0x3e95('0x13')](function(_0x3f29a3){logger[_0x3e95('0x1f')]('['+[_0x12dec2[_0x3e95('0x14')]()]+']',_0x3f29a3[_0x3e95('0x15')]);_0x3ecd6f(_0x3f29a3);});});};}function searchContact(_0x70753d,_0x203699,_0x348cbb,_0x19ea9f){return new Promise(function(_0x51595b,_0x761f8b){var _0x38c2f5={'method':_0x3e95('0x8'),'headers':_0x203699,'uri':_0x70753d+_0x3e95('0x20')+_0x19ea9f+_0x3e95('0x21')+_0x348cbb+'&entities=contact','json':!![]};rp(_0x38c2f5)[_0x3e95('0xb')](function(_0x3397b3){var _0x5e1e51=_['find'](_0x3397b3[_0x3e95('0x22')]['contacts'],[_0x348cbb,_0x19ea9f]);_0x51595b(_0x5e1e51);})[_0x3e95('0x13')](function(_0x3d2cdb){_0x761f8b(_0x3d2cdb);});});}function getEndUser(_0x4ee356,_0x17690c,_0x4849de){return function(_0x1d3970){return new Promise(function(_0x575fb5,_0x367da3){logger[_0x3e95('0xf')](util[_0x3e95('0x23')](_0x3e95('0x24'),_0x1d3970['contactNumber']));searchContact(_0x4849de,_0x17690c,_0x3e95('0x25'),_0x1d3970[_0x3e95('0x26')])['then'](function(_0x255ac4){if(_0x255ac4){_0x1d3970[_0x3e95('0x27')]=_0x255ac4['id'];logger[_0x3e95('0xf')]('Contact\x20found\x20mobile_number:',_0x1d3970[_0x3e95('0x27')]);return _0x575fb5(_0x1d3970);}searchContact(_0x4849de,_0x17690c,'work_number',_0x1d3970['contactNumber'])[_0x3e95('0xb')](function(_0x50b257){if(_0x50b257){_0x1d3970[_0x3e95('0x27')]=_0x50b257['id'];logger['info']('Contact\x20found\x20work_number:',_0x1d3970['endUserId']);return _0x575fb5(_0x1d3970);}createEndUser(_0x1d3970,_0x4ee356,_0x17690c,_0x4849de)[_0x3e95('0xb')](function(_0x279abc){logger[_0x3e95('0xf')](_0x3e95('0x28'),_0x279abc[_0x3e95('0x27')]);return _0x575fb5(_0x279abc);});});})[_0x3e95('0x13')](function(_0x8b2f21){_0x367da3(_0x8b2f21);});});};}function createEndUser(_0xdd7c15,_0x7bba56,_0x3ca817,_0x18ac71){return new Promise(function(_0x31b556,_0x1feb3a){var _0x3e5b0f=moment();var _0x397ab9={'method':_0x3e95('0x29'),'uri':_0x18ac71+'/api/contacts','body':{'contact':{'last_name':_0xdd7c15[_0x3e95('0x26')],'work_number':_0xdd7c15['contactNumber'],'mobile_number':_0xdd7c15[_0x3e95('0x26')],'owner_id':_0xdd7c15[_0x3e95('0x1b')],'created_at':_0x3e5b0f['format'](_0x3e95('0x2a'))}},'json':!![]};_0x397ab9[_0x3e95('0x9')]=_0x3ca817;logger['info'](_0x3e95('0x2b'));return rp(_0x397ab9)[_0x3e95('0xb')](function(_0x3789c2){_0xdd7c15[_0x3e95('0x27')]=_0x3789c2[_0x3e95('0x2c')]['id'];_0x31b556(_0xdd7c15);})[_0x3e95('0x13')](function(_0x3dcc58){logger[_0x3e95('0x1f')]('['+[_0x7bba56[_0x3e95('0x14')]()]+']',_0x3dcc58['message']);_0x1feb3a(_0x3dcc58[_0x3e95('0x15')]);});});}function getTicket(_0x21797b,_0x3865ec,_0xbe80fe,_0x2cd62d,_0x288f90){return function(_0x464de9){logger['info'](_0x3e95('0x2d'));return new Promise(function(_0x288826,_0x1f300c){var _0x2a2b02=moment();var _0xe379db={'method':_0x3e95('0x29'),'uri':_0xbe80fe+_0x3e95('0x2e'),'body':{'title':intUtil[_0x3e95('0x2f')](_0x2cd62d['Subjects'],_0x288f90,'\x20'),'description':intUtil[_0x3e95('0x2f')](_0x2cd62d[_0x3e95('0x30')],_0x288f90,'\x0a'),'owner_id':_0x464de9[_0x3e95('0x1b')],'creater_id':_0x464de9[_0x3e95('0x11')],'targetable_id':_0x464de9[_0x3e95('0x27')],'targetable_type':'Contact','created_at':_0x2a2b02['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x2a2b02[_0x3e95('0x31')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0xe379db[_0x3e95('0x9')]=_0x3865ec;return rp(_0xe379db)[_0x3e95('0xb')](function(_0x8099de){_0x464de9['ticketId']=_0x8099de[_0x3e95('0x32')]['id'];logger['info'](_0x3e95('0x33'),_0x464de9[_0x3e95('0x34')]);_0x288826(_0x464de9);})[_0x3e95('0x13')](function(_0x153528){logger[_0x3e95('0x1f')]('['+[_0x21797b['toUpperCase']()]+']',_0x153528[_0x3e95('0x15')]);_0x1f300c(_0x153528[_0x3e95('0x15')]);});});};}function emit(_0x1d8862,_0xbca246,_0x3fd4d3){var _0x4eafe6={'uri':_0x1d8862+'/contacts/'+_0x3fd4d3};io['to'](util[_0x3e95('0x23')](_0x3e95('0x35'),_0xbca246))['emit'](_0x3e95('0x36'),_0x4eafe6);}exports['cs']=function(_0x439ace,_0x388718,_0x5e8177,_0x1e27f9,_0x1323fd,_0x5a693e,_0x255b1f,_0xe13a52){var _0x1e5627={};var _0x173a4e={'Authorization':_0x3e95('0x37')+_0x5a693e['apiKey']};_0x5a693e[_0x3e95('0x38')]=intUtil[_0x3e95('0x39')](_0x5a693e[_0x3e95('0x38')]);_0x5a693e[_0x3e95('0x3a')]=intUtil['stripTrailingSlash'](_0x5a693e[_0x3e95('0x3a')]);var _0x4e4d8b=_0x5a693e['remoteUri'];_0x1e5627[_0x3e95('0xe')]=_0x5a693e[_0x3e95('0x3b')];_0x1e5627['contactNumber']=_0xe13a52[_0x3e95('0x3c')]()===_0x3e95('0x3d')?_0x388718[_0x3e95('0x3e')]:_0x388718['calleridnum'];_0x1e5627['callDirection']=_0xe13a52===_0x3e95('0x3f')||_0xe13a52===_0x3e95('0x40')?_0x3e95('0x3f'):'outbound';if(_0x1e27f9){_0x1e5627['agentEmail']=_0x1e27f9[_0x3e95('0xd')];}var _0x426cf6=util[_0x3e95('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a693e[_0x3e95('0x3a')],_0x388718[_0x3e95('0x41')],md5(_0x388718['uniqueid']));if(_0x1323fd&&_0x1323fd['monitor_format']){logger[_0x3e95('0xf')]('[QUEUE]',_0x3e95('0x42'));_0x388718[_0x3e95('0x43')]=_0x426cf6;}else if(_0x255b1f&&_0x255b1f[_0x3e95('0x44')]&&_0x255b1f[_0x3e95('0x44')]!==_0x3e95('0x45')){logger['info']('[OUTBOUND]',_0x3e95('0x42'));_0x388718[_0x3e95('0x43')]=_0x426cf6;}else{_0x388718[_0x3e95('0x43')]='';}return getAdminId(_0x1e5627,_0xe13a52,_0x173a4e,_0x4e4d8b)[_0x3e95('0xb')](getUser(_0xe13a52,_0x173a4e,_0x4e4d8b))[_0x3e95('0xb')](getEndUser(_0xe13a52,_0x173a4e,_0x4e4d8b))['then'](getTicket(_0xe13a52,_0x173a4e,_0x4e4d8b,_0x5e8177,_0x388718))['then'](function(_0x416707){logger[_0x3e95('0xf')](util[_0x3e95('0x23')](_0x3e95('0x46'),_0x416707['ticketId']));if(_0xe13a52!==_0x3e95('0x40')){logger[_0x3e95('0xf')]('['+[_0xe13a52[_0x3e95('0x14')]()]+']',_0x3e95('0x47'));emit(_0x4e4d8b,_0x1e27f9['name'],_0x416707[_0x3e95('0x27')]);}})[_0x3e95('0x13')](function(_0xbbd1c8){logger[_0x3e95('0x1f')]('['+[_0xe13a52[_0x3e95('0x14')]()]+_0x3e95('0x48'),util[_0x3e95('0x49')](_0xbbd1c8,{'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 bd53eec..15443f1 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 _0xb688=['[EXEC]','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data3','queue','log','unmanaged','zendesk','sugarcrm','unknown\x20integration','../../../../config/logger','error'];(function(_0x327094,_0x5c214b){var _0x48c55f=function(_0x121ddd){while(--_0x121ddd){_0x327094['push'](_0x327094['shift']());}};_0x48c55f(++_0x5c214b);}(_0xb688,0xcf));var _0x8b68=function(_0x1fb29b,_0x491313){_0x1fb29b=_0x1fb29b-0x0;var _0x53cdc3=_0xb688[_0x1fb29b];return _0x53cdc3;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var zendesk=require(_0x8b68('0x1'));var salesforce=require(_0x8b68('0x2'));var sugarcrm=require(_0x8b68('0x3'));var freshdesk=require(_0x8b68('0x4'));var zoho=require(_0x8b68('0x5'));var desk=require('./desk');var vtiger=require(_0x8b68('0x6'));var servicenow=require(_0x8b68('0x7'));var dynamics365=require(_0x8b68('0x8'));var freshsales=require(_0x8b68('0x9'));var integrations=['zendesk',_0x8b68('0xa'),'sugarcrm',_0x8b68('0xb'),_0x8b68('0xc'),_0x8b68('0xd'),_0x8b68('0xe'),_0x8b68('0xf'),_0x8b68('0x10'),_0x8b68('0x11')];exports[_0x8b68('0x12')]=function(_0x24e0b0,_0x2f2e3c,_0x418775,_0x317d01,_0x2a852a,_0x502727){if(_0x418775){if(_[_0x8b68('0x13')](integrations,_0x24e0b0[_0x8b68('0x14')][_0x8b68('0x15')]())){try{var _0x2d8472=null;var _0x1965cf='';var _0x2f3af4=_0x418775[_0x24e0b0[_0x8b68('0x14')][_0x8b68('0x15')]()];if(_0x2f3af4){var _0x2686c7=_0x2f3af4[_0x24e0b0['data2']];if(_0x2686c7){var _0xb2df35=_['find'](_0x2686c7['Configurations'],{'id':parseInt(_0x24e0b0[_0x8b68('0x16')],0xa)});if(_0xb2df35){if(_0x317d01){if(_0x2a852a&&_0x2f2e3c[_0x8b68('0x17')]){_0x1965cf=_0x8b68('0x17');}else if(_0x2f2e3c['routeId']){_0x1965cf='outbound';}else{console[_0x8b68('0x18')]('EVENT\x20UNKNOWN',_0x2f2e3c);}}else{_0x1965cf=_0x8b68('0x19');}switch(_0x24e0b0[_0x8b68('0x14')][_0x8b68('0x15')]()){case _0x8b68('0x1a'):zendesk[_0x1965cf](_0x24e0b0,_0x2f2e3c,_0xb2df35,_0x317d01,_0x2a852a,_0x2686c7,_0x502727);break;case'salesforce':salesforce[_0x1965cf](_0x24e0b0,_0x2f2e3c,_0xb2df35,_0x317d01,_0x2a852a,_0x2686c7,_0x502727);break;case _0x8b68('0x1b'):sugarcrm[_0x1965cf](_0x24e0b0,_0x2f2e3c,_0xb2df35,_0x317d01,_0x2a852a,_0x2686c7,_0x502727);break;case _0x8b68('0xb'):freshdesk[_0x1965cf](_0x24e0b0,_0x2f2e3c,_0xb2df35,_0x317d01,_0x2a852a,_0x2686c7,_0x502727);break;case'zoho':zoho[_0x1965cf](_0x24e0b0,_0x2f2e3c,_0xb2df35,_0x317d01,_0x2a852a,_0x2686c7,_0x502727);break;case _0x8b68('0xd'):desk[_0x1965cf](_0x24e0b0,_0x2f2e3c,_0xb2df35,_0x317d01,_0x2a852a,_0x2686c7,_0x502727);break;case _0x8b68('0xe'):vtiger[_0x1965cf](_0x24e0b0,_0x2f2e3c,_0xb2df35,_0x317d01,_0x2a852a,_0x2686c7,_0x502727);break;case _0x8b68('0x10'):freshsales['cs'](_0x24e0b0,_0x2f2e3c,_0xb2df35,_0x317d01,_0x2a852a,_0x2686c7,_0x502727,_0x1965cf);break;case _0x8b68('0x11'):servicenow['cs'](_0x24e0b0,_0x2f2e3c,_0xb2df35,_0x317d01,_0x2a852a,_0x2686c7,_0x502727,_0x1965cf);break;case _0x8b68('0xf'):dynamics365['cs'](_0x24e0b0,_0x2f2e3c,_0xb2df35,_0x317d01,_0x2a852a,_0x2686c7,_0x502727,_0x1965cf);break;default:console['log'](_0x8b68('0x1c'));}}else{_0x2d8472=require(_0x8b68('0x1d'))(_0x24e0b0[_0x8b68('0x14')][_0x8b68('0x15')]());_0x2d8472[_0x8b68('0x1e')](_0x8b68('0x1f'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x24e0b0[_0x8b68('0x14')]['toLowerCase'](),_0x24e0b0[_0x8b68('0x16')]));}}else{_0x2d8472=require(_0x8b68('0x1d'))(_0x24e0b0[_0x8b68('0x14')][_0x8b68('0x15')]());_0x2d8472[_0x8b68('0x1e')](_0x8b68('0x1f'),util['format'](_0x8b68('0x20'),_0x24e0b0[_0x8b68('0x14')]['toLowerCase'](),_0x24e0b0[_0x8b68('0x21')]));}}else{}}catch(_0x3cf8d2){console[_0x8b68('0x1e')](_0x3cf8d2);}}}}; \ No newline at end of file +var _0x4fc2=['data3','queue','outbound','EVENT\x20UNKNOWN','unmanaged','sugarcrm','servicenow','unknown\x20integration','../../../../config/logger','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','error','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','toLowerCase','data1','data2','Configurations'];(function(_0x30f5bb,_0x4db4bd){var _0x1cfc00=function(_0x20f833){while(--_0x20f833){_0x30f5bb['push'](_0x30f5bb['shift']());}};_0x1cfc00(++_0x4db4bd);}(_0x4fc2,0x111));var _0x24fc=function(_0x3a6d3e,_0x4f0ac5){_0x3a6d3e=_0x3a6d3e-0x0;var _0x735896=_0x4fc2[_0x3a6d3e];return _0x735896;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var zendesk=require(_0x24fc('0x2'));var salesforce=require(_0x24fc('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x24fc('0x4'));var zoho=require(_0x24fc('0x5'));var desk=require(_0x24fc('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0x24fc('0x7'));var dynamics365=require(_0x24fc('0x8'));var freshsales=require('./freshsales');var integrations=[_0x24fc('0x9'),_0x24fc('0xa'),'sugarcrm',_0x24fc('0xb'),_0x24fc('0xc'),_0x24fc('0xd'),_0x24fc('0xe'),_0x24fc('0xf'),_0x24fc('0x10'),'servicenow'];exports[_0x24fc('0x11')]=function(_0x1819a5,_0x1a4462,_0x133438,_0x24998d,_0x2de64d,_0x3b3e6c){if(_0x133438){if(_[_0x24fc('0x12')](integrations,_0x1819a5['data1'][_0x24fc('0x13')]())){try{var _0x1cde5d=null;var _0x5cc65e='';var _0x306873=_0x133438[_0x1819a5[_0x24fc('0x14')][_0x24fc('0x13')]()];if(_0x306873){var _0x3bc30b=_0x306873[_0x1819a5[_0x24fc('0x15')]];if(_0x3bc30b){var _0x326276=_['find'](_0x3bc30b[_0x24fc('0x16')],{'id':parseInt(_0x1819a5[_0x24fc('0x17')],0xa)});if(_0x326276){if(_0x24998d){if(_0x2de64d&&_0x1a4462[_0x24fc('0x18')]){_0x5cc65e=_0x24fc('0x18');}else if(_0x1a4462['routeId']){_0x5cc65e=_0x24fc('0x19');}else{console['log'](_0x24fc('0x1a'),_0x1a4462);}}else{_0x5cc65e=_0x24fc('0x1b');}switch(_0x1819a5[_0x24fc('0x14')][_0x24fc('0x13')]()){case _0x24fc('0x9'):zendesk[_0x5cc65e](_0x1819a5,_0x1a4462,_0x326276,_0x24998d,_0x2de64d,_0x3bc30b,_0x3b3e6c);break;case'salesforce':salesforce[_0x5cc65e](_0x1819a5,_0x1a4462,_0x326276,_0x24998d,_0x2de64d,_0x3bc30b,_0x3b3e6c);break;case _0x24fc('0x1c'):sugarcrm[_0x5cc65e](_0x1819a5,_0x1a4462,_0x326276,_0x24998d,_0x2de64d,_0x3bc30b,_0x3b3e6c);break;case _0x24fc('0xb'):freshdesk[_0x5cc65e](_0x1819a5,_0x1a4462,_0x326276,_0x24998d,_0x2de64d,_0x3bc30b,_0x3b3e6c);break;case _0x24fc('0xc'):zoho[_0x5cc65e](_0x1819a5,_0x1a4462,_0x326276,_0x24998d,_0x2de64d,_0x3bc30b,_0x3b3e6c);break;case _0x24fc('0xd'):desk[_0x5cc65e](_0x1819a5,_0x1a4462,_0x326276,_0x24998d,_0x2de64d,_0x3bc30b,_0x3b3e6c);break;case'vtiger':vtiger[_0x5cc65e](_0x1819a5,_0x1a4462,_0x326276,_0x24998d,_0x2de64d,_0x3bc30b,_0x3b3e6c);break;case _0x24fc('0x10'):freshsales['cs'](_0x1819a5,_0x1a4462,_0x326276,_0x24998d,_0x2de64d,_0x3bc30b,_0x3b3e6c,_0x5cc65e);break;case _0x24fc('0x1d'):servicenow['cs'](_0x1819a5,_0x1a4462,_0x326276,_0x24998d,_0x2de64d,_0x3bc30b,_0x3b3e6c,_0x5cc65e);break;case _0x24fc('0xf'):dynamics365['cs'](_0x1819a5,_0x1a4462,_0x326276,_0x24998d,_0x2de64d,_0x3bc30b,_0x3b3e6c,_0x5cc65e);break;default:console['log'](_0x24fc('0x1e'));}}else{_0x1cde5d=require(_0x24fc('0x1f'))(_0x1819a5[_0x24fc('0x14')][_0x24fc('0x13')]());_0x1cde5d['error'](_0x24fc('0x20'),util['format'](_0x24fc('0x21'),_0x1819a5['data1'][_0x24fc('0x13')](),_0x1819a5[_0x24fc('0x17')]));}}else{_0x1cde5d=require(_0x24fc('0x1f'))(_0x1819a5['data1'][_0x24fc('0x13')]());_0x1cde5d['error'](_0x24fc('0x20'),util[_0x24fc('0x22')](_0x24fc('0x23'),_0x1819a5[_0x24fc('0x14')][_0x24fc('0x13')](),_0x1819a5[_0x24fc('0x15')]));}}else{}}catch(_0x3f0875){console[_0x24fc('0x24')](_0x3f0875);}}}}; \ 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 9d5cb1d..da4fd02 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 _0x65fe=['https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','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.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase',']\x20Ticket\x20%s\x20created.','lastevent','lodash','request-promise','moment','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','assign','getString','Subjects','Task','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','validateEmail','User','find','execute','then','length','Email','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','display_name','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','Lead','account_contact_lead','additionalSearchAccount','sobject','Account','additionalSearchLead','first','Name','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','LastName','Caller\x20-\x20%s','Company','No\x20Company','create','includes','string','picklist','type','idField','toString','variable','variableName','Variable','name','concat','securityToken','Connection','remoteUri'];(function(_0x14ca78,_0x284b65){var _0x22b766=function(_0xd2bf69){while(--_0xd2bf69){_0x14ca78['push'](_0x14ca78['shift']());}};_0x22b766(++_0x284b65);}(_0x65fe,0x12e));var _0xe65f=function(_0x628c39,_0x5d8464){_0x628c39=_0x628c39-0x0;var _0x485600=_0x65fe[_0x628c39];return _0x485600;};'use strict';var _=require(_0xe65f('0x0'));var rp=require(_0xe65f('0x1'));var moment=require(_0xe65f('0x2'));var BPromise=require(_0xe65f('0x3'));var md5=require(_0xe65f('0x4'));var jsforce=require('jsforce');var util=require(_0xe65f('0x5'));var Redis=require('ioredis');var intUtil=require(_0xe65f('0x6'));var config=require(_0xe65f('0x7'));var logger=require(_0xe65f('0x8'))(_0xe65f('0x9'));config['redis']=_[_0xe65f('0xa')](config[_0xe65f('0xb')],{'host':_0xe65f('0xc'),'port':0x18eb});var io=require(_0xe65f('0xd'))(new Redis(config[_0xe65f('0xb')]));function emit(_0x1509b1,_0xdc45ed,_0x19b026){io['to'](_0x1509b1)['emit'](_0xdc45ed,_0x19b026);}function getTicket(_0x205442,_0xadb713,_0x27b9a1,_0x101cc1,_0x3d7f7a,_0x446c63,_0x35d795,_0x15b1eb){var _0x1dd9de=Object[_0xe65f('0xe')]({},{'OwnerId':_0xadb713['id'],'Subject':intUtil[_0xe65f('0xf')](_0x101cc1[_0xe65f('0x10')],_0x3d7f7a,'\x20'),'Description':intUtil[_0xe65f('0xf')](_0x101cc1['Descriptions'],_0x3d7f7a,'\x0a')},getCustomFields(_0x446c63,_0x3d7f7a));if(_0x27b9a1){if(_0x101cc1['ticketType']===_0xe65f('0x11')){_0x1dd9de['ActivityDate']=moment[_0xe65f('0x12')]();_0x1dd9de['IsReminderSet']=![];_0x1dd9de[_0xe65f('0x13')]=![];if(_0x27b9a1[_0xe65f('0x14')]===_0xe65f('0x15')||_0x27b9a1[_0xe65f('0x14')]===_0xe65f('0x16')){_0x1dd9de[_0xe65f('0x17')]=_0x27b9a1['id'];}else if(_0x27b9a1[_0xe65f('0x14')]===_0xe65f('0x18')){_0x1dd9de[_0xe65f('0x19')]=_0x27b9a1['id'];}}else if(_0x101cc1[_0xe65f('0x1a')]===_0xe65f('0x1b')){if(_0x27b9a1[_0xe65f('0x14')]==='contact'){_0x1dd9de[_0xe65f('0x1c')]=_0x27b9a1['id'];}else if(_0x27b9a1['endUserType']===_0xe65f('0x18')){_0x1dd9de[_0xe65f('0x1d')]=_0x27b9a1['id'];}else if(_0x27b9a1['endUserType']===_0xe65f('0x16')&&_0x101cc1[_0xe65f('0x1e')]){_0x1dd9de[_0x101cc1[_0xe65f('0x1e')]]=_0x27b9a1['id'];}else{logger['info'](_0xe65f('0x1f'));}}}return _0x35d795['sobject'](_0x101cc1[_0xe65f('0x1a')])['create'](_0x1dd9de);}function getUser(_0x36cda7,_0x1eb5bd,_0x399e51){if(!_[_0xe65f('0x20')](_0x1eb5bd)&&intUtil[_0xe65f('0x21')](_0x1eb5bd)){var _0x1045fe={'Email':_0x1eb5bd};var _0x11ae4a={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x399e51['sobject'](_0xe65f('0x22'))[_0xe65f('0x23')](_0x1045fe,_0x11ae4a)[_0xe65f('0x24')]()[_0xe65f('0x25')](function(_0x47155f){if(_0x47155f[_0xe65f('0x26')]){var _0x5e0de5=_[_0xe65f('0x23')](_0x47155f,function(_0x22f577){return _0x22f577[_0xe65f('0x27')]===_0x1eb5bd;});if(_0x5e0de5){logger[_0xe65f('0x28')]('Agent\x20%s\x20found.',_0x1eb5bd);return BPromise['resolve']({'id':_0x5e0de5['Id'],'name':_0x5e0de5['Name']});}}else{logger[_0xe65f('0x28')](_0xe65f('0x29'),_0x1eb5bd);return _0x399e51['identity']()[_0xe65f('0x25')](function(_0x1fb85f){return BPromise[_0xe65f('0x2a')]({'id':_0x1fb85f['user_id'],'name':_0x1fb85f[_0xe65f('0x2b')]});});}});}else{logger[_0xe65f('0x28')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1eb5bd);return _0x399e51[_0xe65f('0x2c')]()[_0xe65f('0x25')](function(_0x2e8931){return BPromise['resolve']({'id':_0x2e8931[_0xe65f('0x2d')],'name':_0x2e8931[_0xe65f('0x2b')]});});}}function getEndUser(_0x258aae,_0x3e1ea6,_0x116215,_0x4f8bd8,_0x3724f6){var _0xed6dbe={'$or':{'Phone':_0x4f8bd8}};var _0x51eeaf={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xe65f('0x25')](function(){logger[_0xe65f('0x28')](_0xe65f('0x2e'),_0x4f8bd8,_0x3e1ea6[_0xe65f('0x2f')]);switch(_0x3e1ea6[_0xe65f('0x2f')]){case _0xe65f('0x30'):var _0x2a5e58=_[_0xe65f('0x31')](_0xed6dbe);if(_0x3e1ea6[_0xe65f('0x32')]){var _0x7cb189={};_0x7cb189[_0x3e1ea6[_0xe65f('0x32')]]=_0x4f8bd8;_[_0xe65f('0x33')](_0x2a5e58[_0xe65f('0x34')],_0x7cb189);}return _0x3724f6['sobject'](_0xe65f('0x35'))['find'](_0x2a5e58,_0x51eeaf)['execute']()[_0xe65f('0x25')](function(_0x4ccb7e){if(_0x4ccb7e&&_0x4ccb7e[_0xe65f('0x26')]){return _0x4ccb7e;}else{var _0x2ab41a=_[_0xe65f('0x31')](_0xed6dbe);if(_0x3e1ea6['additionalSearchLead']){var _0x5257ed={};_0x5257ed[_0x3e1ea6['additionalSearchLead']]=_0x4f8bd8;_[_0xe65f('0x33')](_0x2ab41a[_0xe65f('0x34')],_0x5257ed);}return _0x3724f6['sobject'](_0xe65f('0x36'))['find'](_0x2ab41a,_0x51eeaf);}});case _0xe65f('0x37'):var _0x3ef818=_[_0xe65f('0x31')](_0xed6dbe);if(_0x3e1ea6[_0xe65f('0x38')]){var _0x7cb189={};_0x7cb189[_0x3e1ea6[_0xe65f('0x38')]]=_0x4f8bd8;_['merge'](_0x3ef818[_0xe65f('0x34')],_0x7cb189);}return _0x3724f6[_0xe65f('0x39')](_0xe65f('0x3a'))[_0xe65f('0x23')](_0x3ef818,_0x51eeaf)[_0xe65f('0x24')]()[_0xe65f('0x25')](function(_0x400aaa){if(_0x400aaa&&_0x400aaa['length']){return _0x400aaa;}else{var _0x595ef0=_['cloneDeep'](_0xed6dbe);if(_0x3e1ea6['additionalSearchContact']){var _0x2b5423={};_0x2b5423[_0x3e1ea6['additionalSearchContact']]=_0x4f8bd8;_[_0xe65f('0x33')](_0x595ef0[_0xe65f('0x34')],_0x2b5423);}return _0x3724f6[_0xe65f('0x39')](_0xe65f('0x35'))[_0xe65f('0x23')](_0x595ef0,_0x51eeaf)[_0xe65f('0x25')](function(_0x26175b){if(_0x26175b&&_0x26175b[_0xe65f('0x26')]){return _0x26175b;}else{var _0x12804a=_[_0xe65f('0x31')](_0xed6dbe);if(_0x3e1ea6[_0xe65f('0x3b')]){var _0x371773={};_0x371773[_0x3e1ea6[_0xe65f('0x3b')]]=_0x4f8bd8;_['merge'](_0x12804a[_0xe65f('0x34')],_0x371773);}return _0x3724f6[_0xe65f('0x39')](_0xe65f('0x36'))['find'](_0x12804a,_0x51eeaf);}});}});case _0xe65f('0x15'):var _0x2a5e58=_[_0xe65f('0x31')](_0xed6dbe);if(_0x3e1ea6[_0xe65f('0x32')]){var _0x7cb189={};_0x7cb189[_0x3e1ea6[_0xe65f('0x32')]]=_0x4f8bd8;_[_0xe65f('0x33')](_0x2a5e58[_0xe65f('0x34')],_0x7cb189);}return _0x3724f6[_0xe65f('0x39')]('Contact')['find'](_0x2a5e58,_0x51eeaf)[_0xe65f('0x24')]();case _0xe65f('0x16'):var _0xb1dc4=_['cloneDeep'](_0xed6dbe);if(_0x3e1ea6['additionalSearchLead']){var _0x7cb189={};_0x7cb189[_0x3e1ea6[_0xe65f('0x3b')]]=_0x4f8bd8;_['merge'](_0xb1dc4['$or'],_0x7cb189);}return _0x3724f6['sobject'](_0xe65f('0x36'))[_0xe65f('0x23')](_0xb1dc4,_0x51eeaf);case _0xe65f('0x18'):var _0x3ef818=_[_0xe65f('0x31')](_0xed6dbe);if(_0x3e1ea6[_0xe65f('0x38')]){var _0x7cb189={};_0x7cb189[_0x3e1ea6['additionalSearchAccount']]=_0x4f8bd8;_['merge'](_0x3ef818[_0xe65f('0x34')],_0x7cb189);}return _0x3724f6['sobject'](_0xe65f('0x3a'))[_0xe65f('0x23')](_0x3ef818,_0x51eeaf);default:return null;}})[_0xe65f('0x25')](function(_0x4f44c9){if(_0x4f44c9&&_0x4f44c9['length']){var _0x365dd9=_[_0xe65f('0x3c')](_0x4f44c9);if(_0x365dd9){return BPromise[_0xe65f('0x2a')]({'id':_0x365dd9['Id'],'name':_0x365dd9[_0xe65f('0x3d')],'phone':_0x365dd9['Phone'],'endUserType':_0x365dd9[_0xe65f('0x3e')]['type'][_0xe65f('0x3f')]()});}}})[_0xe65f('0x25')](function(_0x1432ce){if(_0x1432ce){logger[_0xe65f('0x28')](_0xe65f('0x40'),_0x1432ce[_0xe65f('0x14')],_0x4f8bd8);return BPromise[_0xe65f('0x2a')](_0x1432ce);}else{logger[_0xe65f('0x28')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x4f8bd8);var _0x1cb25b={'Phone':_0x4f8bd8};if(_0x3e1ea6[_0xe65f('0x41')]){if(_0x3e1ea6[_0xe65f('0x41')]==='contact'){logger[_0xe65f('0x28')](_0xe65f('0x42'),_0x4f8bd8,_0x3e1ea6[_0xe65f('0x41')]);_0x1cb25b['LastName']=_0x116215!==_0xe65f('0x43')?_0x116215:util[_0xe65f('0x44')]('Caller\x20-\x20%s',_0x4f8bd8);}else if(_0x3e1ea6[_0xe65f('0x41')]===_0xe65f('0x16')){logger[_0xe65f('0x28')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4f8bd8,_0x3e1ea6[_0xe65f('0x41')]);_0x1cb25b[_0xe65f('0x45')]=_0x116215!==_0xe65f('0x43')?_0x116215:util[_0xe65f('0x44')](_0xe65f('0x46'),_0x4f8bd8);_0x1cb25b[_0xe65f('0x47')]=_0xe65f('0x48');}else if(_0x3e1ea6[_0xe65f('0x41')]===_0xe65f('0x18')){logger[_0xe65f('0x28')](_0xe65f('0x42'),_0x4f8bd8,_0x3e1ea6[_0xe65f('0x41')]);_0x1cb25b[_0xe65f('0x3d')]=_0x116215!==''?_0x116215:util['format']('Caller\x20-\x20%s',_0x4f8bd8);}else{return null;}}return _0x3724f6[_0xe65f('0x39')](_['upperFirst'](_0x3e1ea6[_0xe65f('0x41')]))[_0xe65f('0x49')](_0x1cb25b)['then'](function(_0x392a54){return BPromise[_0xe65f('0x2a')]({'id':_0x392a54['id'],'endUserType':_0x3e1ea6[_0xe65f('0x41')]});});}});}function getCustomFields(_0x5d43b7,_0x3823c8){var _0x426d3e={};if(_0x5d43b7[_0xe65f('0x26')]>0x0){_['forEach'](_0x5d43b7,function(_0x2cff2c){if(_[_0xe65f('0x4a')]([_0xe65f('0x4b'),_0xe65f('0x4c')],_0x2cff2c[_0xe65f('0x4d')])&&_0x2cff2c[_0xe65f('0x4e')]){_0x426d3e[_0x2cff2c[_0xe65f('0x4e')]]=_0x2cff2c['content'][_0xe65f('0x4f')]();}else if(_0x2cff2c[_0xe65f('0x4d')]===_0xe65f('0x50')&&_0x2cff2c[_0xe65f('0x51')]&&_0x2cff2c['idField']){_0x3823c8[_0x2cff2c['variableName']]&&(_0x426d3e[_0x2cff2c['idField']]=_0x3823c8[_0x2cff2c[_0xe65f('0x51')]][_0xe65f('0x4f')]());}else if(_0x2cff2c[_0xe65f('0x4d')]==='customVariable'&&_0x2cff2c['Variable']&&_0x2cff2c[_0xe65f('0x52')][_0xe65f('0x53')]&&_0x2cff2c[_0xe65f('0x4e')]){_0x3823c8[_0x2cff2c[_0xe65f('0x52')]['name'][_0xe65f('0x3f')]()]&&(_0x426d3e[_0x2cff2c[_0xe65f('0x4e')]]=_0x3823c8[_0x2cff2c[_0xe65f('0x52')][_0xe65f('0x53')][_0xe65f('0x3f')]()]['toString']());}});}return _0x426d3e;}function getConnection(_0x5aa0b8){var _0x3610bb=_0x5aa0b8['password'][_0xe65f('0x54')](_0x5aa0b8[_0xe65f('0x55')]);var _0x3dc9f4=new jsforce[(_0xe65f('0x56'))]({'oauth2':{'loginUrl':_0x5aa0b8[_0xe65f('0x57')]||_0xe65f('0x58'),'clientId':_0x5aa0b8[_0xe65f('0x59')],'clientSecret':_0x5aa0b8[_0xe65f('0x5a')]}});return _0x3dc9f4[_0xe65f('0x5b')](_0x5aa0b8[_0xe65f('0x5c')],_0x3610bb)[_0xe65f('0x25')](function(){logger[_0xe65f('0x28')]('Connection\x20established.');return _0x3dc9f4;});}exports[_0xe65f('0x5d')]=function(_0x2850f0,_0x21b8b1,_0x2ad240,_0x5eed22,_0x6eb2e,_0x34274c){var _0x3ca9aa,_0x12dba6,_0x2fa9f3,_0x176d18;_0x34274c[_0xe65f('0x5e')]=intUtil[_0xe65f('0x5f')](_0x34274c[_0xe65f('0x5e')]);_0x34274c[_0xe65f('0x57')]=intUtil[_0xe65f('0x5f')](_0x34274c['remoteUri']);if(_0x6eb2e&&_0x6eb2e[_0xe65f('0x60')]){logger['info'](_0xe65f('0x61'),_0xe65f('0x62'));_0x21b8b1[_0xe65f('0x63')]=util[_0xe65f('0x44')](_0xe65f('0x64'),_0x34274c['serverUrl'],_0x21b8b1[_0xe65f('0x65')],md5(_0x21b8b1['uniqueid']));}else{_0x21b8b1[_0xe65f('0x63')]='';}return getConnection(_0x34274c)[_0xe65f('0x25')](function(_0x766ac4){_0x176d18=_0x766ac4;return getUser(_0x34274c,_0x5eed22[_0xe65f('0x66')],_0x176d18);})['then'](function(_0x5a25ed){_0x3ca9aa=_0x5a25ed;return getEndUser(_0x34274c,_0x2ad240,_0x21b8b1[_0xe65f('0x67')],_0x21b8b1[_0xe65f('0x68')],_0x176d18);})['then'](function(_0xba9551){_0x12dba6=_0xba9551;return getTicket(_0x34274c,_0x3ca9aa,_0x12dba6,_0x2ad240,_0x21b8b1,_0x2ad240['Fields'],_0x176d18,'queue');})['then'](function(_0x17cf3a){_0x2fa9f3=_0x17cf3a;logger[_0xe65f('0x28')](_0xe65f('0x69'),_0x2fa9f3['id']);logger[_0xe65f('0x28')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2fa9f3['id'],_0x5eed22[_0xe65f('0x53')],_0x34274c[_0xe65f('0x4d')]);switch(_0x34274c[_0xe65f('0x4d')]){case _0xe65f('0x6a'):emit(util[_0xe65f('0x44')](_0xe65f('0x6b'),_0x5eed22['name']),_0xe65f('0x6c'),{'recordId':_0x2fa9f3['id']});break;case _0xe65f('0x6d'):emit(util['format'](_0xe65f('0x6b'),_0x5eed22[_0xe65f('0x53')]),_0xe65f('0x6e'),{'uri':util[_0xe65f('0x44')](_0xe65f('0x6f'),_0x176d18[_0xe65f('0x70')],_0x2fa9f3['id'])});break;default:logger[_0xe65f('0x71')](_0xe65f('0x72'));}})[_0xe65f('0x73')](function(_0x211923){logger[_0xe65f('0x71')]('[QUEUE]',_0x211923);});};exports[_0xe65f('0x74')]=function(_0x492aa3,_0x888cbc,_0x49e21d,_0x349e11,_0x5df6d0,_0x336303,_0x5aacc8){var _0x290487,_0x1dd1e8,_0x489b1d,_0xf8733f;_0x336303['serverUrl']=intUtil[_0xe65f('0x5f')](_0x336303[_0xe65f('0x5e')]);_0x336303[_0xe65f('0x57')]=intUtil[_0xe65f('0x5f')](_0x336303['remoteUri']);if(_0x5aacc8&&_0x5aacc8[_0xe65f('0x75')]&&_0x5aacc8['recordingFormat']!==_0xe65f('0x76')){logger[_0xe65f('0x28')](_0xe65f('0x77'),_0xe65f('0x62'));_0x888cbc['recordingURL']=util[_0xe65f('0x44')](_0xe65f('0x64'),_0x336303[_0xe65f('0x5e')],_0x888cbc['uniqueid'],md5(_0x888cbc[_0xe65f('0x65')]));}return getConnection(_0x336303)[_0xe65f('0x25')](function(_0x41e9b1){_0xf8733f=_0x41e9b1;return getUser(_0x336303,_0x349e11[_0xe65f('0x66')],_0xf8733f);})[_0xe65f('0x25')](function(_0x508975){_0x290487=_0x508975;return getEndUser(_0x336303,_0x49e21d,_0x888cbc[_0xe65f('0x78')],_0x888cbc[_0xe65f('0x79')],_0xf8733f);})[_0xe65f('0x25')](function(_0x39b801){_0x1dd1e8=_0x39b801;return getTicket(_0x336303,_0x290487,_0x1dd1e8,_0x49e21d,_0x888cbc,_0x49e21d[_0xe65f('0x7a')],_0xf8733f,_0xe65f('0x74'));})[_0xe65f('0x25')](function(_0x1f693e){_0x489b1d=_0x1f693e;logger[_0xe65f('0x28')](_0xe65f('0x7b'),_0x489b1d['id']);logger[_0xe65f('0x28')](_0xe65f('0x7c'),_0x489b1d['id'],_0x349e11[_0xe65f('0x53')],_0x336303[_0xe65f('0x4d')]);switch(_0x336303[_0xe65f('0x4d')]){case _0xe65f('0x6a'):emit(util[_0xe65f('0x44')](_0xe65f('0x6b'),_0x349e11[_0xe65f('0x53')]),_0xe65f('0x6c'),{'recordId':_0x489b1d['id']});break;case _0xe65f('0x6d'):emit(util[_0xe65f('0x44')](_0xe65f('0x6b'),_0x349e11[_0xe65f('0x53')]),_0xe65f('0x6e'),{'uri':util[_0xe65f('0x44')](_0xe65f('0x6f'),_0xf8733f[_0xe65f('0x70')],_0x489b1d['id'])});break;default:logger['error'](_0xe65f('0x77'),_0xe65f('0x7d'));}})[_0xe65f('0x73')](function(_0x4a5bd4){logger[_0xe65f('0x71')](_0xe65f('0x77'),_0x4a5bd4);});};exports[_0xe65f('0x7e')]=function(_0x2e450a,_0x2819f6,_0x1d8dc6,_0x424558,_0x388b39,_0x5a8918){var _0x47c282,_0x4cb7da,_0xe22140,_0x5989f5;_0x5a8918[_0xe65f('0x5e')]=intUtil[_0xe65f('0x5f')](_0x5a8918[_0xe65f('0x5e')]);_0x5a8918[_0xe65f('0x57')]=intUtil[_0xe65f('0x5f')](_0x5a8918[_0xe65f('0x57')]);if(_0x388b39&&_0x388b39['monitor_format']){logger[_0xe65f('0x28')]('['+_0x2819f6['lastevent'][_0xe65f('0x7f')]()+']',_0xe65f('0x62'));_0x2819f6[_0xe65f('0x63')]=util[_0xe65f('0x44')](_0xe65f('0x64'),_0x5a8918[_0xe65f('0x5e')],_0x2819f6[_0xe65f('0x65')],md5(_0x2819f6['uniqueid']));}else{_0x2819f6[_0xe65f('0x63')]='';}return getConnection(_0x5a8918)[_0xe65f('0x25')](function(_0x87934f){_0x5989f5=_0x87934f;if(!_[_0xe65f('0x20')](_0x424558)){return getUser(_0x5a8918,_0x424558['name'],_0x5989f5);}else{return getUser(_0x5a8918,null,_0x5989f5);}})[_0xe65f('0x25')](function(_0x3a9125){_0x47c282=_0x3a9125;return getEndUser(_0x5a8918,_0x1d8dc6,_0x2819f6[_0xe65f('0x67')],_0x2819f6[_0xe65f('0x68')],_0x5989f5);})[_0xe65f('0x25')](function(_0x574676){_0x4cb7da=_0x574676;return getTicket(_0x5a8918,_0x47c282,_0x4cb7da,_0x1d8dc6,_0x2819f6,_0x1d8dc6['Fields'],_0x5989f5);})[_0xe65f('0x25')](function(_0x2e50a5){_0xe22140=_0x2e50a5;logger[_0xe65f('0x28')]('['+_0x2819f6['lastevent'][_0xe65f('0x7f')]()+_0xe65f('0x80'),_0xe22140['id']);logger['info']('['+_0x2819f6[_0xe65f('0x81')][_0xe65f('0x7f')]()+']\x20Integration\x20account\x20type\x20%s.',_0x5a8918[_0xe65f('0x4d')]);})['catch'](function(_0x327120){logger[_0xe65f('0x71')]('['+_0x2819f6[_0xe65f('0x81')][_0xe65f('0x7f')]()+']',_0x327120);});}; \ No newline at end of file +var _0x2b52=['catch','unmanaged','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','endUserType','contact','lead','account','WhatId','Case','ContactId','leadId','info','create','isNil','validateEmail','sobject','execute','find','Email','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','resolve','user_id','display_name','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','account_contact_lead','additionalSearchAccount','Lead','Account','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','format','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','integrationTab','user:%s','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized'];(function(_0xe98817,_0x52c939){var _0xf36d24=function(_0x12dc1c){while(--_0x12dc1c){_0xe98817['push'](_0xe98817['shift']());}};_0xf36d24(++_0x52c939);}(_0x2b52,0x88));var _0x22b5=function(_0x119cd8,_0x556b73){_0x119cd8=_0x119cd8-0x0;var _0x7072a3=_0x2b52[_0x119cd8];return _0x7072a3;};'use strict';var _=require(_0x22b5('0x0'));var rp=require(_0x22b5('0x1'));var moment=require(_0x22b5('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x22b5('0x3'));var util=require(_0x22b5('0x4'));var Redis=require(_0x22b5('0x5'));var intUtil=require(_0x22b5('0x6'));var config=require(_0x22b5('0x7'));var logger=require(_0x22b5('0x8'))(_0x22b5('0x9'));config[_0x22b5('0xa')]=_[_0x22b5('0xb')](config[_0x22b5('0xa')],{'host':_0x22b5('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x22b5('0xa')]));function emit(_0x43df53,_0x765ab7,_0x2b0c03){io['to'](_0x43df53)[_0x22b5('0xd')](_0x765ab7,_0x2b0c03);}function getTicket(_0xf327a6,_0x56599c,_0x2ff2b2,_0x15d7b4,_0x1687fa,_0x1882f4,_0x1ff9f0,_0x551814){var _0x4ba035=Object[_0x22b5('0xe')]({},{'OwnerId':_0x56599c['id'],'Subject':intUtil['getString'](_0x15d7b4[_0x22b5('0xf')],_0x1687fa,'\x20'),'Description':intUtil[_0x22b5('0x10')](_0x15d7b4[_0x22b5('0x11')],_0x1687fa,'\x0a')},getCustomFields(_0x1882f4,_0x1687fa));if(_0x2ff2b2){if(_0x15d7b4[_0x22b5('0x12')]===_0x22b5('0x13')){_0x4ba035[_0x22b5('0x14')]=moment[_0x22b5('0x15')]();_0x4ba035['IsReminderSet']=![];_0x4ba035['IsRecurrence']=![];if(_0x2ff2b2[_0x22b5('0x16')]===_0x22b5('0x17')||_0x2ff2b2[_0x22b5('0x16')]===_0x22b5('0x18')){_0x4ba035['WhoId']=_0x2ff2b2['id'];}else if(_0x2ff2b2[_0x22b5('0x16')]===_0x22b5('0x19')){_0x4ba035[_0x22b5('0x1a')]=_0x2ff2b2['id'];}}else if(_0x15d7b4[_0x22b5('0x12')]===_0x22b5('0x1b')){if(_0x2ff2b2[_0x22b5('0x16')]===_0x22b5('0x17')){_0x4ba035[_0x22b5('0x1c')]=_0x2ff2b2['id'];}else if(_0x2ff2b2['endUserType']===_0x22b5('0x19')){_0x4ba035['AccountId']=_0x2ff2b2['id'];}else if(_0x2ff2b2['endUserType']===_0x22b5('0x18')&&_0x15d7b4[_0x22b5('0x1d')]){_0x4ba035[_0x15d7b4[_0x22b5('0x1d')]]=_0x2ff2b2['id'];}else{logger[_0x22b5('0x1e')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x1ff9f0['sobject'](_0x15d7b4['ticketType'])[_0x22b5('0x1f')](_0x4ba035);}function getUser(_0xe53d03,_0x43cf16,_0x597225){if(!_[_0x22b5('0x20')](_0x43cf16)&&intUtil[_0x22b5('0x21')](_0x43cf16)){var _0x351ba9={'Email':_0x43cf16};var _0x31e2a0={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x597225[_0x22b5('0x22')]('User')['find'](_0x351ba9,_0x31e2a0)[_0x22b5('0x23')]()['then'](function(_0x54ba01){if(_0x54ba01['length']){var _0x5cae90=_[_0x22b5('0x24')](_0x54ba01,function(_0x525896){return _0x525896[_0x22b5('0x25')]===_0x43cf16;});if(_0x5cae90){logger[_0x22b5('0x1e')]('Agent\x20%s\x20found.',_0x43cf16);return BPromise['resolve']({'id':_0x5cae90['Id'],'name':_0x5cae90[_0x22b5('0x26')]});}}else{logger[_0x22b5('0x1e')](_0x22b5('0x27'),_0x43cf16);return _0x597225[_0x22b5('0x28')]()[_0x22b5('0x29')](function(_0x447630){return BPromise[_0x22b5('0x2a')]({'id':_0x447630[_0x22b5('0x2b')],'name':_0x447630[_0x22b5('0x2c')]});});}});}else{logger[_0x22b5('0x1e')](_0x22b5('0x27'),_0x43cf16);return _0x597225['identity']()[_0x22b5('0x29')](function(_0x33b18d){return BPromise[_0x22b5('0x2a')]({'id':_0x33b18d[_0x22b5('0x2b')],'name':_0x33b18d[_0x22b5('0x2c')]});});}}function getEndUser(_0x4a6576,_0x5eaea9,_0x4b156c,_0x44e47b,_0x50ade3){var _0x5a30d8={'$or':{'Phone':_0x44e47b}};var _0x1d0443={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0x22b5('0x1e')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x44e47b,_0x5eaea9[_0x22b5('0x2d')]);switch(_0x5eaea9[_0x22b5('0x2d')]){case'contact_lead':var _0x1e8959=_[_0x22b5('0x2e')](_0x5a30d8);if(_0x5eaea9[_0x22b5('0x2f')]){var _0xf957ab={};_0xf957ab[_0x5eaea9[_0x22b5('0x2f')]]=_0x44e47b;_[_0x22b5('0x30')](_0x1e8959[_0x22b5('0x31')],_0xf957ab);}return _0x50ade3[_0x22b5('0x22')](_0x22b5('0x32'))[_0x22b5('0x24')](_0x1e8959,_0x1d0443)[_0x22b5('0x23')]()[_0x22b5('0x29')](function(_0x5a8b20){if(_0x5a8b20&&_0x5a8b20[_0x22b5('0x33')]){return _0x5a8b20;}else{var _0x343fac=_[_0x22b5('0x2e')](_0x5a30d8);if(_0x5eaea9[_0x22b5('0x34')]){var _0xfb011={};_0xfb011[_0x5eaea9[_0x22b5('0x34')]]=_0x44e47b;_['merge'](_0x343fac[_0x22b5('0x31')],_0xfb011);}return _0x50ade3[_0x22b5('0x22')]('Lead')[_0x22b5('0x24')](_0x343fac,_0x1d0443);}});case _0x22b5('0x35'):var _0x271d33=_[_0x22b5('0x2e')](_0x5a30d8);if(_0x5eaea9[_0x22b5('0x36')]){var _0xf957ab={};_0xf957ab[_0x5eaea9[_0x22b5('0x36')]]=_0x44e47b;_['merge'](_0x271d33[_0x22b5('0x31')],_0xf957ab);}return _0x50ade3[_0x22b5('0x22')]('Account')[_0x22b5('0x24')](_0x271d33,_0x1d0443)[_0x22b5('0x23')]()[_0x22b5('0x29')](function(_0x3b6726){if(_0x3b6726&&_0x3b6726[_0x22b5('0x33')]){return _0x3b6726;}else{var _0x33d0ea=_[_0x22b5('0x2e')](_0x5a30d8);if(_0x5eaea9[_0x22b5('0x2f')]){var _0x416544={};_0x416544[_0x5eaea9[_0x22b5('0x2f')]]=_0x44e47b;_[_0x22b5('0x30')](_0x33d0ea[_0x22b5('0x31')],_0x416544);}return _0x50ade3[_0x22b5('0x22')]('Contact')[_0x22b5('0x24')](_0x33d0ea,_0x1d0443)[_0x22b5('0x29')](function(_0x1e2b10){if(_0x1e2b10&&_0x1e2b10['length']){return _0x1e2b10;}else{var _0x1fb6fd=_[_0x22b5('0x2e')](_0x5a30d8);if(_0x5eaea9[_0x22b5('0x34')]){var _0xc0a95c={};_0xc0a95c[_0x5eaea9[_0x22b5('0x34')]]=_0x44e47b;_[_0x22b5('0x30')](_0x1fb6fd[_0x22b5('0x31')],_0xc0a95c);}return _0x50ade3[_0x22b5('0x22')](_0x22b5('0x37'))['find'](_0x1fb6fd,_0x1d0443);}});}});case'contact':var _0x1e8959=_['cloneDeep'](_0x5a30d8);if(_0x5eaea9[_0x22b5('0x2f')]){var _0xf957ab={};_0xf957ab[_0x5eaea9[_0x22b5('0x2f')]]=_0x44e47b;_[_0x22b5('0x30')](_0x1e8959[_0x22b5('0x31')],_0xf957ab);}return _0x50ade3['sobject'](_0x22b5('0x32'))[_0x22b5('0x24')](_0x1e8959,_0x1d0443)[_0x22b5('0x23')]();case _0x22b5('0x18'):var _0x5efc1a=_[_0x22b5('0x2e')](_0x5a30d8);if(_0x5eaea9[_0x22b5('0x34')]){var _0xf957ab={};_0xf957ab[_0x5eaea9[_0x22b5('0x34')]]=_0x44e47b;_[_0x22b5('0x30')](_0x5efc1a[_0x22b5('0x31')],_0xf957ab);}return _0x50ade3['sobject'](_0x22b5('0x37'))[_0x22b5('0x24')](_0x5efc1a,_0x1d0443);case _0x22b5('0x19'):var _0x271d33=_[_0x22b5('0x2e')](_0x5a30d8);if(_0x5eaea9[_0x22b5('0x36')]){var _0xf957ab={};_0xf957ab[_0x5eaea9[_0x22b5('0x36')]]=_0x44e47b;_['merge'](_0x271d33[_0x22b5('0x31')],_0xf957ab);}return _0x50ade3[_0x22b5('0x22')](_0x22b5('0x38'))[_0x22b5('0x24')](_0x271d33,_0x1d0443);default:return null;}})[_0x22b5('0x29')](function(_0x2ca5b1){if(_0x2ca5b1&&_0x2ca5b1[_0x22b5('0x33')]){var _0x515c3d=_[_0x22b5('0x39')](_0x2ca5b1);if(_0x515c3d){return BPromise[_0x22b5('0x2a')]({'id':_0x515c3d['Id'],'name':_0x515c3d[_0x22b5('0x26')],'phone':_0x515c3d[_0x22b5('0x3a')],'endUserType':_0x515c3d[_0x22b5('0x3b')][_0x22b5('0x3c')]['toLowerCase']()});}}})[_0x22b5('0x29')](function(_0x17c2ed){if(_0x17c2ed){logger[_0x22b5('0x1e')](_0x22b5('0x3d'),_0x17c2ed[_0x22b5('0x16')],_0x44e47b);return BPromise[_0x22b5('0x2a')](_0x17c2ed);}else{logger[_0x22b5('0x1e')](_0x22b5('0x3e'),_0x44e47b);var _0x3b1811={'Phone':_0x44e47b};if(_0x5eaea9[_0x22b5('0x3f')]){if(_0x5eaea9[_0x22b5('0x3f')]===_0x22b5('0x17')){logger[_0x22b5('0x1e')](_0x22b5('0x40'),_0x44e47b,_0x5eaea9['moduleCreate']);_0x3b1811[_0x22b5('0x41')]=_0x4b156c!==_0x22b5('0x42')?_0x4b156c:util['format'](_0x22b5('0x43'),_0x44e47b);}else if(_0x5eaea9[_0x22b5('0x3f')]===_0x22b5('0x18')){logger[_0x22b5('0x1e')](_0x22b5('0x40'),_0x44e47b,_0x5eaea9[_0x22b5('0x3f')]);_0x3b1811['LastName']=_0x4b156c!==_0x22b5('0x42')?_0x4b156c:util[_0x22b5('0x44')](_0x22b5('0x43'),_0x44e47b);_0x3b1811[_0x22b5('0x45')]=_0x22b5('0x46');}else if(_0x5eaea9[_0x22b5('0x3f')]===_0x22b5('0x19')){logger[_0x22b5('0x1e')](_0x22b5('0x40'),_0x44e47b,_0x5eaea9[_0x22b5('0x3f')]);_0x3b1811['Name']=_0x4b156c!==_0x22b5('0x42')?_0x4b156c:util['format']('Caller\x20-\x20%s',_0x44e47b);}else{return null;}}return _0x50ade3['sobject'](_[_0x22b5('0x47')](_0x5eaea9['moduleCreate']))[_0x22b5('0x1f')](_0x3b1811)['then'](function(_0x30aae3){return BPromise['resolve']({'id':_0x30aae3['id'],'endUserType':_0x5eaea9[_0x22b5('0x3f')]});});}});}function getCustomFields(_0x16f101,_0x44e7b3){var _0x10cfae={};if(_0x16f101['length']>0x0){_[_0x22b5('0x48')](_0x16f101,function(_0x3e967c){if(_[_0x22b5('0x49')]([_0x22b5('0x4a'),_0x22b5('0x4b')],_0x3e967c[_0x22b5('0x3c')])&&_0x3e967c[_0x22b5('0x4c')]){_0x10cfae[_0x3e967c[_0x22b5('0x4c')]]=_0x3e967c[_0x22b5('0x4d')][_0x22b5('0x4e')]();}else if(_0x3e967c[_0x22b5('0x3c')]===_0x22b5('0x4f')&&_0x3e967c[_0x22b5('0x50')]&&_0x3e967c[_0x22b5('0x4c')]){_0x44e7b3[_0x3e967c['variableName']]&&(_0x10cfae[_0x3e967c[_0x22b5('0x4c')]]=_0x44e7b3[_0x3e967c[_0x22b5('0x50')]][_0x22b5('0x4e')]());}else if(_0x3e967c[_0x22b5('0x3c')]===_0x22b5('0x51')&&_0x3e967c[_0x22b5('0x52')]&&_0x3e967c[_0x22b5('0x52')][_0x22b5('0x53')]&&_0x3e967c[_0x22b5('0x4c')]){_0x44e7b3[_0x3e967c['Variable']['name'][_0x22b5('0x54')]()]&&(_0x10cfae[_0x3e967c[_0x22b5('0x4c')]]=_0x44e7b3[_0x3e967c[_0x22b5('0x52')]['name'][_0x22b5('0x54')]()]['toString']());}});}return _0x10cfae;}function getConnection(_0x12bf76){var _0x43af79=_0x12bf76[_0x22b5('0x55')][_0x22b5('0x56')](_0x12bf76[_0x22b5('0x57')]);var _0x26911e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x12bf76[_0x22b5('0x58')]||_0x22b5('0x59'),'clientId':_0x12bf76[_0x22b5('0x5a')],'clientSecret':_0x12bf76[_0x22b5('0x5b')]}});return _0x26911e['login'](_0x12bf76[_0x22b5('0x5c')],_0x43af79)[_0x22b5('0x29')](function(){logger[_0x22b5('0x1e')](_0x22b5('0x5d'));return _0x26911e;});}exports[_0x22b5('0x5e')]=function(_0x321329,_0x1663ce,_0x369457,_0x12f391,_0x2a7124,_0x303e54){var _0x106475,_0x464198,_0x54bbdd,_0x1369cf;_0x303e54['serverUrl']=intUtil[_0x22b5('0x5f')](_0x303e54[_0x22b5('0x60')]);_0x303e54[_0x22b5('0x58')]=intUtil[_0x22b5('0x5f')](_0x303e54[_0x22b5('0x58')]);if(_0x2a7124&&_0x2a7124[_0x22b5('0x61')]){logger['info'](_0x22b5('0x62'),_0x22b5('0x63'));_0x1663ce[_0x22b5('0x64')]=util[_0x22b5('0x44')](_0x22b5('0x65'),_0x303e54['serverUrl'],_0x1663ce['uniqueid'],md5(_0x1663ce[_0x22b5('0x66')]));}else{_0x1663ce['recordingURL']='';}return getConnection(_0x303e54)['then'](function(_0x4db708){_0x1369cf=_0x4db708;return getUser(_0x303e54,_0x12f391[_0x22b5('0x67')],_0x1369cf);})['then'](function(_0x5976e6){_0x106475=_0x5976e6;return getEndUser(_0x303e54,_0x369457,_0x1663ce['calleridname'],_0x1663ce[_0x22b5('0x68')],_0x1369cf);})[_0x22b5('0x29')](function(_0x43fc9c){_0x464198=_0x43fc9c;return getTicket(_0x303e54,_0x106475,_0x464198,_0x369457,_0x1663ce,_0x369457['Fields'],_0x1369cf,_0x22b5('0x5e'));})[_0x22b5('0x29')](function(_0x18685c){_0x54bbdd=_0x18685c;logger[_0x22b5('0x1e')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x54bbdd['id']);logger[_0x22b5('0x1e')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x54bbdd['id'],_0x12f391[_0x22b5('0x53')],_0x303e54[_0x22b5('0x3c')]);switch(_0x303e54['type']){case _0x22b5('0x69'):emit(util['format'](_0x22b5('0x6a'),_0x12f391[_0x22b5('0x53')]),'trigger:salesforce:display',{'recordId':_0x54bbdd['id']});break;case'newTab':emit(util[_0x22b5('0x44')]('user:%s',_0x12f391[_0x22b5('0x53')]),'trigger:browser:url',{'uri':util[_0x22b5('0x44')](_0x22b5('0x6b'),_0x1369cf[_0x22b5('0x6c')],_0x54bbdd['id'])});break;default:logger[_0x22b5('0x6d')](_0x22b5('0x6e'));}})['catch'](function(_0x422583){logger['error'](_0x22b5('0x62'),_0x422583);});};exports[_0x22b5('0x6f')]=function(_0x358e4e,_0x26870d,_0x440955,_0x5e8dbf,_0x3a2c62,_0x282700,_0x385e13){var _0x398d8b,_0x5cce26,_0x262732,_0x34c3d2;_0x282700['serverUrl']=intUtil[_0x22b5('0x5f')](_0x282700[_0x22b5('0x60')]);_0x282700[_0x22b5('0x58')]=intUtil['stripTrailingSlash'](_0x282700[_0x22b5('0x58')]);if(_0x385e13&&_0x385e13[_0x22b5('0x70')]&&_0x385e13[_0x22b5('0x70')]!==_0x22b5('0x71')){logger['info'](_0x22b5('0x72'),'Recording\x20is\x20enabled!');_0x26870d[_0x22b5('0x64')]=util[_0x22b5('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x282700[_0x22b5('0x60')],_0x26870d['uniqueid'],md5(_0x26870d[_0x22b5('0x66')]));}return getConnection(_0x282700)['then'](function(_0x26ecf5){_0x34c3d2=_0x26ecf5;return getUser(_0x282700,_0x5e8dbf[_0x22b5('0x67')],_0x34c3d2);})[_0x22b5('0x29')](function(_0x31e9ad){_0x398d8b=_0x31e9ad;return getEndUser(_0x282700,_0x440955,_0x26870d[_0x22b5('0x73')],_0x26870d['destcalleridnum'],_0x34c3d2);})[_0x22b5('0x29')](function(_0x47fa73){_0x5cce26=_0x47fa73;return getTicket(_0x282700,_0x398d8b,_0x5cce26,_0x440955,_0x26870d,_0x440955[_0x22b5('0x74')],_0x34c3d2,_0x22b5('0x6f'));})[_0x22b5('0x29')](function(_0x2a909a){_0x262732=_0x2a909a;logger['info'](_0x22b5('0x75'),_0x262732['id']);logger[_0x22b5('0x1e')](_0x22b5('0x76'),_0x262732['id'],_0x5e8dbf[_0x22b5('0x53')],_0x282700[_0x22b5('0x3c')]);switch(_0x282700[_0x22b5('0x3c')]){case _0x22b5('0x69'):emit(util[_0x22b5('0x44')](_0x22b5('0x6a'),_0x5e8dbf[_0x22b5('0x53')]),_0x22b5('0x77'),{'recordId':_0x262732['id']});break;case'newTab':emit(util[_0x22b5('0x44')](_0x22b5('0x6a'),_0x5e8dbf['name']),_0x22b5('0x78'),{'uri':util['format'](_0x22b5('0x6b'),_0x34c3d2['instanceUrl'],_0x262732['id'])});break;default:logger[_0x22b5('0x6d')]('[OUTBOUND]',_0x22b5('0x79'));}})[_0x22b5('0x7a')](function(_0x3c8f13){logger[_0x22b5('0x6d')](_0x22b5('0x72'),_0x3c8f13);});};exports[_0x22b5('0x7b')]=function(_0x24b459,_0xd08595,_0x5301e1,_0x55661f,_0x591ca7,_0x150a65){var _0x58fb1b,_0x5b450f,_0x5bd981,_0x4042a2;_0x150a65['serverUrl']=intUtil[_0x22b5('0x5f')](_0x150a65[_0x22b5('0x60')]);_0x150a65['remoteUri']=intUtil[_0x22b5('0x5f')](_0x150a65[_0x22b5('0x58')]);if(_0x591ca7&&_0x591ca7['monitor_format']){logger[_0x22b5('0x1e')]('['+_0xd08595[_0x22b5('0x7c')][_0x22b5('0x7d')]()+']',_0x22b5('0x63'));_0xd08595['recordingURL']=util[_0x22b5('0x44')](_0x22b5('0x65'),_0x150a65[_0x22b5('0x60')],_0xd08595[_0x22b5('0x66')],md5(_0xd08595[_0x22b5('0x66')]));}else{_0xd08595[_0x22b5('0x64')]='';}return getConnection(_0x150a65)[_0x22b5('0x29')](function(_0x75bd69){_0x4042a2=_0x75bd69;if(!_[_0x22b5('0x20')](_0x55661f)){return getUser(_0x150a65,_0x55661f[_0x22b5('0x53')],_0x4042a2);}else{return getUser(_0x150a65,null,_0x4042a2);}})[_0x22b5('0x29')](function(_0x1ee478){_0x58fb1b=_0x1ee478;return getEndUser(_0x150a65,_0x5301e1,_0xd08595[_0x22b5('0x7e')],_0xd08595[_0x22b5('0x68')],_0x4042a2);})[_0x22b5('0x29')](function(_0x130d9e){_0x5b450f=_0x130d9e;return getTicket(_0x150a65,_0x58fb1b,_0x5b450f,_0x5301e1,_0xd08595,_0x5301e1[_0x22b5('0x74')],_0x4042a2);})[_0x22b5('0x29')](function(_0x4740d6){_0x5bd981=_0x4740d6;logger[_0x22b5('0x1e')]('['+_0xd08595['lastevent'][_0x22b5('0x7d')]()+_0x22b5('0x7f'),_0x5bd981['id']);logger[_0x22b5('0x1e')]('['+_0xd08595[_0x22b5('0x7c')][_0x22b5('0x7d')]()+_0x22b5('0x80'),_0x150a65[_0x22b5('0x3c')]);})[_0x22b5('0x7a')](function(_0x53dbc5){logger[_0x22b5('0x6d')]('['+_0xd08595[_0x22b5('0x7c')][_0x22b5('0x7d')]()+']',_0x53dbc5);});}; \ 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 9a83ea9..b3401ac 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 _0x7d25=['name','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','message',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','content','toString','idField','toLowerCase','variable','variableName','Variable','outbound','incident','assign','getString','Descriptions','Fields','ticketId','ticketNumber','number','label','label_entry','Incident','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label'];(function(_0x451680,_0x9187d8){var _0x1ba454=function(_0xac2a5d){while(--_0xac2a5d){_0x451680['push'](_0x451680['shift']());}};_0x1ba454(++_0x9187d8);}(_0x7d25,0x8a));var _0x57d2=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x7d25[_0x3740fe];return _0x55492b;};'use strict';var _=require('lodash');var Promise=require(_0x57d2('0x0'));var rp=require(_0x57d2('0x1'));var util=require(_0x57d2('0x2'));var md5=require(_0x57d2('0x3'));var Redis=require(_0x57d2('0x4'));var intUtil=require(_0x57d2('0x5'));var config=require(_0x57d2('0x6'));var logger=require('../../../../config/logger')('servicenow');config['redis']=_['defaults'](config[_0x57d2('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x57d2('0x8'))(new Redis(config[_0x57d2('0x7')]));function getAdminUser(_0x147194,_0x59ae87,_0x49e3e5,_0xeb8b91,_0x4f94a6,_0x3a1ec5){return new Promise(function(_0x5153c2,_0xa04872){var _0x485438={'method':_0x57d2('0x9'),'uri':_0xeb8b91+_0x57d2('0xa')+'&'+_0x4f94a6+'&'+_0x3a1ec5,'auth':_0x59ae87,'json':!![]};return rp(_0x485438)[_0x57d2('0xb')](function(_0x3a53a1){if(_0x3a53a1[_0x57d2('0xc')][_0x57d2('0xd')]>0x0){_0x49e3e5[_0x57d2('0xe')]=_0x3a53a1[_0x57d2('0xc')][0x0][_0x57d2('0xf')];}logger[_0x57d2('0x10')]('['+[_0x147194[_0x57d2('0x11')]()]+_0x57d2('0x12'),_0x49e3e5);_0x5153c2(_0x49e3e5);})[_0x57d2('0x13')](function(_0x229734){logger[_0x57d2('0x14')]('['+[_0x147194[_0x57d2('0x11')]()]+']',_0x229734['message']);_0xa04872(_0x229734['message']);});});}function getUser(_0x6fad35,_0x148ef3,_0x4ec4b1,_0x8cf637,_0x319489){return function(_0x4bb8f7){logger[_0x57d2('0x10')]('['+[_0x6fad35['toUpperCase']()]+_0x57d2('0x15'),_0x4bb8f7);return new Promise(function(_0x4b4fe0,_0x2ab5f0){if(intUtil[_0x57d2('0x16')](_0x4bb8f7[_0x57d2('0x17')])){var _0x4a94e3={'method':'GET','uri':_0x4ec4b1+_0x57d2('0x18')+_0x4bb8f7[_0x57d2('0x17')]+'&'+_0x8cf637+'&'+_0x319489,'auth':_0x148ef3,'json':!![]};logger[_0x57d2('0x10')]('['+[_0x6fad35[_0x57d2('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x4a94e3);return rp(_0x4a94e3)[_0x57d2('0xb')](function(_0xcf924f){logger['info']('['+[_0x6fad35['toUpperCase']()]+_0x57d2('0x19'),_0xcf924f);if(_0xcf924f[_0x57d2('0xc')][_0x57d2('0xd')]>0x0&&String(_0xcf924f[_0x57d2('0xc')][0x0][_0x57d2('0x1a')])===_0x57d2('0x1b')){_0x4bb8f7[_0x57d2('0x1c')]=_0xcf924f[_0x57d2('0xc')][0x0][_0x57d2('0xf')];}else{_0x4bb8f7[_0x57d2('0x1c')]=_0x4bb8f7[_0x57d2('0xe')];_0x4bb8f7[_0x57d2('0x17')]=_0x4bb8f7[_0x57d2('0x1d')];}logger[_0x57d2('0x10')]('['+[_0x6fad35['toUpperCase']()]+_0x57d2('0x1e'),_0x4bb8f7);_0x4b4fe0(_0x4bb8f7);})[_0x57d2('0x13')](function(_0x3c7de8){logger[_0x57d2('0x14')]('['+[_0x6fad35[_0x57d2('0x11')]()]+']',_0x3c7de8['message']);_0x2ab5f0(_0x3c7de8[_0x57d2('0x1f')]);});}else{logger[_0x57d2('0x10')]('['+[_0x6fad35[_0x57d2('0x11')]()]+_0x57d2('0x20'));_0x4bb8f7[_0x57d2('0x1c')]=_0x4bb8f7[_0x57d2('0xe')];_0x4bb8f7[_0x57d2('0x17')]=_0x4bb8f7['adminEmail'];_0x4b4fe0(_0x4bb8f7);}});};}function createEndUser(_0x1ae5ff,_0x15f1ba,_0x277426,_0x1fe383,_0x1957a6){logger[_0x57d2('0x10')]('['+[_0x1ae5ff[_0x57d2('0x11')]()]+_0x57d2('0x21'),_0x277426);return new Promise(function(_0x1d2bdb,_0x2cf9d9){var _0x574589={'method':_0x57d2('0x22'),'uri':_0x1fe383+_0x57d2('0x23')+_0x1957a6,'body':{'user_name':_0x277426[_0x57d2('0x24')],'roles':_0x57d2('0x25'),'first_name':_0x277426['endUserNumber'],'active':_0x57d2('0x1b'),'date_format':_0x57d2('0x26'),'phone':_0x277426[_0x57d2('0x24')]},'auth':_0x15f1ba,'json':!![]};return rp(_0x574589)[_0x57d2('0xb')](function(_0xb3051c){logger[_0x57d2('0x10')]('['+[_0x1ae5ff[_0x57d2('0x11')]()]+_0x57d2('0x27'),_0xb3051c[_0x57d2('0xc')]);_0x277426['endUserId']=_0xb3051c[_0x57d2('0xc')][_0x57d2('0xf')];_0x1d2bdb(_0x277426);})['catch'](function(_0xcf7e0e){logger[_0x57d2('0x14')]('['+[_0x1ae5ff['toUpperCase']()]+']',_0xcf7e0e[_0x57d2('0x1f')]);_0x2cf9d9(_0xcf7e0e[_0x57d2('0x1f')]);});});}function getEndUser(_0x179cce,_0x15613b,_0x1805ee,_0x5184d9,_0x4c14df){return function(_0x581ebc){logger['info']('['+[_0x179cce[_0x57d2('0x11')]()]+_0x57d2('0x28'),_0x581ebc);return new Promise(function(_0x39f3b9,_0x2f2173){var _0x13beac={'method':'GET','uri':_0x1805ee+_0x57d2('0x29')+_0x581ebc['endUserNumber']+'&'+_0x5184d9+'&'+_0x4c14df,'auth':_0x15613b,'json':!![]};return rp(_0x13beac)[_0x57d2('0xb')](function(_0xdcbd13){if(_0xdcbd13[_0x57d2('0xc')]['length']>0x0){_0x581ebc[_0x57d2('0x2a')]=_0xdcbd13[_0x57d2('0xc')][0x0]['sys_id'];logger[_0x57d2('0x10')]('['+[_0x179cce[_0x57d2('0x11')]()]+_0x57d2('0x2b'),_0x581ebc);_0x39f3b9(_0x581ebc);}else{return createEndUser(_0x179cce,_0x15613b,_0x581ebc,_0x1805ee,_0x5184d9)[_0x57d2('0xb')](function(_0x3153fd){logger[_0x57d2('0x10')]('['+[_0x179cce['toUpperCase']()]+_0x57d2('0x2c'),_0x3153fd);_0x39f3b9(_0x3153fd);});}})['catch'](function(_0x1d3303){logger[_0x57d2('0x14')]('['+[_0x179cce[_0x57d2('0x11')]()]+']',_0x1d3303[_0x57d2('0x1f')]);_0x2f2173(_0x1d3303[_0x57d2('0x1f')]);});});};}function getCustomFields(_0x512dbf,_0x282e6e){var _0x1dbbb7={};if(_0x512dbf['length']>0x0){_[_0x57d2('0x2d')](_0x512dbf,function(_0x267c8b){if(_[_0x57d2('0x2e')](['string',_0x57d2('0x2f')],_0x267c8b[_0x57d2('0x30')])&&_0x267c8b[_0x57d2('0x31')]&&!_0x267c8b[_0x57d2('0x32')]){_0x1dbbb7[_0x267c8b['nameField']['toLowerCase']()]=_0x267c8b[_0x57d2('0x33')][_0x57d2('0x34')]();}else if(_[_0x57d2('0x2e')](['string','picklist'],_0x267c8b[_0x57d2('0x30')])&&_0x267c8b['idField']&&_0x267c8b[_0x57d2('0x32')]){_0x1dbbb7[_0x267c8b[_0x57d2('0x35')][_0x57d2('0x36')]()]=_0x267c8b[_0x57d2('0x33')][_0x57d2('0x34')]();}else if(_0x267c8b['type']===_0x57d2('0x37')&&_0x267c8b[_0x57d2('0x38')]&&_0x267c8b['idField']&&_0x267c8b[_0x57d2('0x32')]){_0x1dbbb7[_0x267c8b['idField'][_0x57d2('0x36')]()]=_0x282e6e[_0x267c8b[_0x57d2('0x38')]][_0x57d2('0x34')]();}else if(_0x267c8b[_0x57d2('0x30')]==='customVariable'&&_0x267c8b['Variable']&&_0x267c8b[_0x57d2('0x39')]['name']&&_0x267c8b['idField']&&_0x267c8b[_0x57d2('0x32')]){_0x1dbbb7[_0x267c8b['idField']['toLowerCase']()]=_0x282e6e[_0x267c8b[_0x57d2('0x39')]['name'][_0x57d2('0x36')]()]['toString']();}});}return _0x1dbbb7;}function getTicket(_0x2bf106,_0x49a2c3,_0x50ce3b,_0x1090de,_0x3e39f5,_0xba2cc8){return function(_0x28566d){logger[_0x57d2('0x10')]('['+[_0x2bf106[_0x57d2('0x11')]()]+']\x20getTicket\x20input\x20crm',_0x28566d);return new Promise(function(_0x4541b2,_0xf91b05){var _0x2afbcb=_0x2bf106[_0x57d2('0x36')]()===_0x57d2('0x3a')?_0x28566d[_0x57d2('0x1c')]:_0x28566d[_0x57d2('0x2a')];var _0x406375={'method':'POST','uri':_0x50ce3b+_0x57d2('0x3b')+'?'+_0xba2cc8,'body':Object[_0x57d2('0x3c')]({},{'active':'true','caller_id':_0x2afbcb,'assigned_to':_0x28566d[_0x57d2('0x1c')],'short_description':intUtil['getString'](_0x1090de['Subjects'],_0x3e39f5,'\x20'),'description':intUtil[_0x57d2('0x3d')](_0x1090de[_0x57d2('0x3e')],_0x3e39f5,'\x0a')},getCustomFields(_0x1090de[_0x57d2('0x3f')],_0x3e39f5)),'auth':_0x49a2c3,'json':!![]};return rp(_0x406375)[_0x57d2('0xb')](function(_0x4821b4){logger[_0x57d2('0x10')]('['+[_0x2bf106[_0x57d2('0x11')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x4821b4['result']);_0x28566d[_0x57d2('0x40')]=_0x4821b4[_0x57d2('0xc')][_0x57d2('0xf')];_0x28566d[_0x57d2('0x41')]=_0x4821b4[_0x57d2('0xc')][_0x57d2('0x42')];logger['info']('['+[_0x2bf106['toUpperCase']()]+']\x20getTicket\x20crm',_0x28566d);_0x4541b2(_0x28566d);})[_0x57d2('0x13')](function(_0x505849){logger[_0x57d2('0x14')]('['+[_0x2bf106[_0x57d2('0x11')]()]+']',_0x505849['message']);_0xf91b05(_0x505849[_0x57d2('0x1f')]);});});};}function createRemoteTag(_0xdb19c5,_0x35ced7,_0x557f79,_0x10d4e5){return new Promise(function(_0x224b7d,_0x25e121){var _0x1d8329={'method':_0x57d2('0x22'),'uri':_0x557f79+_0x57d2('0x43')+'?'+_0x10d4e5,'body':{'short_description':_0xdb19c5,'global':!![],'active':!![],'name':_0xdb19c5},'auth':_0x35ced7,'json':!![]};return rp(_0x1d8329)[_0x57d2('0xb')](function(_0x2b93c4){var _0x183ae8=_0x2b93c4['result'][_0x57d2('0xf')];_0x224b7d(_0x183ae8);});});}function getRemoteTag(_0x3ad348,_0x28109b,_0x5e3289,_0x7b334f,_0x3b12c9){return new Promise(function(_0x52ad94,_0x4b5f82){var _0x5aa6d3={'method':'GET','uri':_0x5e3289+_0x57d2('0x43')+'?sysparm_query=name%3D'+_0x3ad348+'&'+_0x7b334f,'auth':_0x28109b,'json':!![]};return rp(_0x5aa6d3)[_0x57d2('0xb')](function(_0x4cdae5){if(_0x4cdae5[_0x57d2('0xc')]['length']>0x0){var _0x240322=_0x4cdae5[_0x57d2('0xc')][0x0][_0x57d2('0xf')];_0x52ad94(_0x240322);}else{return createRemoteTag(_0x3ad348,_0x28109b,_0x5e3289,_0x7b334f)['then'](function(_0x5985e4){_0x52ad94(_0x5985e4);});}});});}function assignTagToIncident(_0xd5b87e,_0x2c1710,_0x3b57fa,_0x227a02,_0x3e5d71){return new Promise(function(_0x421f99,_0x4a2208){var _0x58301e={'method':_0x57d2('0x22'),'uri':_0x3b57fa+_0x57d2('0x44')+'?'+_0x3e5d71,'body':{'label':_0xd5b87e,'table':_0x57d2('0x3b'),'id_type':_0x57d2('0x45'),'table_key':_0x227a02['ticketId'],'title':'Incident\x20-\x20'+_0x227a02[_0x57d2('0x41')],'id_display':_0x227a02[_0x57d2('0x41')]},'auth':_0x2c1710,'json':!![]};return rp(_0x58301e)['then'](function(_0xad397){_0x421f99();})[_0x57d2('0x13')](function(){_0x421f99();});});}function manageTags(_0x15e3b6,_0x472e5d,_0x5ea1e5,_0x59f67c,_0x55f669,_0x4b7b27,_0x434cb7){return new Promise(function(_0x15a15d,_0x343890){var _0xa57b70=[];_0x472e5d[_0x57d2('0x2d')](function(_0x33fa8f){_0xa57b70[_0x57d2('0x46')](getRemoteTag(_0x33fa8f,_0x5ea1e5,_0x59f67c,_0x4b7b27,_0x434cb7));});return Promise['all'](_0xa57b70)[_0x57d2('0xb')](function(_0x4b8024){if(_0x4b8024[_0x57d2('0xd')]){logger['info']('['+[_0x15e3b6[_0x57d2('0x11')]()]+_0x57d2('0x47'),_0x4b8024);var _0x453e6c=[];_0x4b8024[_0x57d2('0x2d')](function(_0xcbe523){_0x453e6c[_0x57d2('0x46')](assignTagToIncident(_0xcbe523,_0x5ea1e5,_0x59f67c,_0x55f669,_0x4b7b27));});return Promise['all'](_0x453e6c)[_0x57d2('0xb')](function(){_0x15a15d();})[_0x57d2('0x13')](function(){_0x15a15d();});}else{_0x15a15d();}});});}function getTags(_0x27b27a,_0x6da8c3,_0x17e0f7,_0x2af67e,_0x26680f,_0x27669e){return function(_0x10141e){return new Promise(function(_0x59c4e4,_0x319643){var _0x4bddff=[];var _0x5b73e7=_0x2af67e['Tags'];if(_0x5b73e7&&_0x5b73e7[_0x57d2('0xd')]>0x0){_0x4bddff=_['map'](_0x5b73e7,_0x57d2('0x48'));}if(_0x4bddff[_0x57d2('0xd')]>0x0){return manageTags(_0x27b27a,_0x4bddff,_0x6da8c3,_0x17e0f7,_0x10141e,_0x26680f,_0x27669e)['then'](function(){_0x59c4e4(_0x10141e);});}else{_0x59c4e4(_0x10141e);}});};}function emit(_0x2792b0,_0xd3d714,_0x3ea517){var _0x13741f='%26sysparm_record_target%3Dincident'+_0x57d2('0x49')+_0x57d2('0x4a')+'%255EORDERBYDESCnumber';var _0x4cfae2={'uri':_0x2792b0+_0x57d2('0x4b')+_0x3ea517+_0x13741f};io['to'](util[_0x57d2('0x4c')]('user:%s',_0xd3d714))[_0x57d2('0x4d')](_0x57d2('0x4e'),_0x4cfae2);}exports['cs']=function(_0x360ee0,_0x858d6e,_0x720441,_0x3899b8,_0xca6e3,_0x2fa113,_0x6bc721,_0x3bec6f){var _0x22f977={};var _0x1d7850={'user':_0x2fa113[_0x57d2('0x4f')],'pass':_0x2fa113['password']};var _0x113c81=_0x57d2('0x50');var _0x1c14af=_0x57d2('0x51');_0x2fa113[_0x57d2('0x52')]=intUtil[_0x57d2('0x53')](_0x2fa113[_0x57d2('0x52')]);_0x2fa113[_0x57d2('0x54')]=intUtil[_0x57d2('0x53')](_0x2fa113[_0x57d2('0x54')]);var _0x1db3ac=util[_0x57d2('0x4c')](_0x57d2('0x55'),_0x2fa113[_0x57d2('0x52')]);_0x22f977[_0x57d2('0x17')]=!_[_0x57d2('0x56')](_0x3899b8)?_0x3899b8['email']:null;_0x22f977[_0x57d2('0x1d')]=_0x2fa113[_0x57d2('0x57')];_0x22f977['endUserNumber']=_0x3bec6f[_0x57d2('0x36')]()===_0x57d2('0x3a')?_0x858d6e[_0x57d2('0x58')]:_0x858d6e[_0x57d2('0x59')];_0x22f977['callDirection']=_0x3bec6f===_0x57d2('0x5a')||_0x3bec6f==='unmanaged'?'queue':_0x57d2('0x3a');var _0x4f30e8=util[_0x57d2('0x4c')](_0x57d2('0x5b'),_0x2fa113[_0x57d2('0x54')],_0x858d6e[_0x57d2('0x5c')],md5(_0x858d6e['uniqueid']));if(_0xca6e3&&_0xca6e3[_0x57d2('0x5d')]){logger[_0x57d2('0x10')](_0x57d2('0x5e'),_0x57d2('0x5f'));_0x858d6e[_0x57d2('0x60')]=_0x4f30e8;}else if(_0x6bc721&&_0x6bc721[_0x57d2('0x61')]&&_0x6bc721[_0x57d2('0x61')]!==_0x57d2('0x62')){logger[_0x57d2('0x10')](_0x57d2('0x63'),'Recording\x20is\x20enabled!');_0x858d6e[_0x57d2('0x60')]=_0x4f30e8;}else{_0x858d6e[_0x57d2('0x60')]='';}return getAdminUser(_0x3bec6f,_0x1d7850,_0x22f977,_0x1db3ac,_0x1c14af,_0x113c81)[_0x57d2('0xb')](getUser(_0x3bec6f,_0x1d7850,_0x1db3ac,_0x1c14af,_0x113c81))[_0x57d2('0xb')](getEndUser(_0x3bec6f,_0x1d7850,_0x1db3ac,_0x1c14af,_0x113c81))[_0x57d2('0xb')](getTicket(_0x3bec6f,_0x1d7850,_0x1db3ac,_0x720441,_0x858d6e,_0x1c14af))[_0x57d2('0xb')](function(_0x3052a3){logger[_0x57d2('0x10')](util[_0x57d2('0x4c')](_0x57d2('0x64'),_0x3052a3[_0x57d2('0x40')]));logger[_0x57d2('0x10')](util['format']('call\x20direction:\x20%s',_0x3bec6f));if(_0x3bec6f!==_0x57d2('0x65')){logger[_0x57d2('0x10')]('['+[_0x3bec6f[_0x57d2('0x11')]()]+']',_0x57d2('0x66'));emit(_0x2fa113[_0x57d2('0x52')],_0x3899b8['name'],_0x3052a3['ticketId']);}})[_0x57d2('0x13')](function(_0x14b5e1){logger[_0x57d2('0x14')]('['+[_0x3bec6f[_0x57d2('0x11')]()]+_0x57d2('0x67'),util[_0x57d2('0x68')](_0x14b5e1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x430c=['none','[OUTBOUND]','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','util','md5','ioredis','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','length','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20rp\x20obj','then','active','true','userId','adminId','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','Incident','Incident\x20-\x20','ticketNumber','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','format','user:%s','emit','username','sysparm_limit=1','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','adminEmail','email','outbound','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat'];(function(_0x3a3ec8,_0x129f27){var _0x214da9=function(_0x52168f){while(--_0x52168f){_0x3a3ec8['push'](_0x3a3ec8['shift']());}};_0x214da9(++_0x129f27);}(_0x430c,0x1a1));var _0xc430=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x430c[_0xf26d40];return _0x50b68c;};'use strict';var _=require(_0xc430('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0xc430('0x1'));var md5=require(_0xc430('0x2'));var Redis=require(_0xc430('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('servicenow');config[_0xc430('0x4')]=_[_0xc430('0x5')](config['redis'],{'host':_0xc430('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc430('0x4')]));function getAdminUser(_0x2e51c6,_0x814a90,_0x13ae66,_0x2e23f8,_0x11f4b0,_0x861581){return new Promise(function(_0x115814,_0x24737a){var _0x5bbdf9={'method':_0xc430('0x7'),'uri':_0x2e23f8+_0xc430('0x8')+'&'+_0x11f4b0+'&'+_0x861581,'auth':_0x814a90,'json':!![]};return rp(_0x5bbdf9)['then'](function(_0x39e624){if(_0x39e624['result'][_0xc430('0x9')]>0x0){_0x13ae66['adminId']=_0x39e624[_0xc430('0xa')][0x0][_0xc430('0xb')];}logger[_0xc430('0xc')]('['+[_0x2e51c6[_0xc430('0xd')]()]+_0xc430('0xe'),_0x13ae66);_0x115814(_0x13ae66);})[_0xc430('0xf')](function(_0x2a3777){logger['error']('['+[_0x2e51c6['toUpperCase']()]+']',_0x2a3777[_0xc430('0x10')]);_0x24737a(_0x2a3777[_0xc430('0x10')]);});});}function getUser(_0x17d5c8,_0x2ef538,_0x31d3b7,_0x55cc6c,_0x111598){return function(_0x4aeb72){logger['info']('['+[_0x17d5c8[_0xc430('0xd')]()]+_0xc430('0x11'),_0x4aeb72);return new Promise(function(_0x2327c5,_0x5830b0){if(intUtil['validateEmail'](_0x4aeb72[_0xc430('0x12')])){var _0x4c1937={'method':_0xc430('0x7'),'uri':_0x31d3b7+'sys_user?sysparm_query=email%3D'+_0x4aeb72['userEmail']+'&'+_0x55cc6c+'&'+_0x111598,'auth':_0x2ef538,'json':!![]};logger[_0xc430('0xc')]('['+[_0x17d5c8['toUpperCase']()]+_0xc430('0x13'),_0x4c1937);return rp(_0x4c1937)[_0xc430('0x14')](function(_0x3eb888){logger[_0xc430('0xc')]('['+[_0x17d5c8[_0xc430('0xd')]()]+'],\x20getUser\x20entity',_0x3eb888);if(_0x3eb888[_0xc430('0xa')]['length']>0x0&&String(_0x3eb888['result'][0x0][_0xc430('0x15')])===_0xc430('0x16')){_0x4aeb72[_0xc430('0x17')]=_0x3eb888['result'][0x0][_0xc430('0xb')];}else{_0x4aeb72['userId']=_0x4aeb72[_0xc430('0x18')];_0x4aeb72[_0xc430('0x12')]=_0x4aeb72['adminEmail'];}logger[_0xc430('0xc')]('['+[_0x17d5c8[_0xc430('0xd')]()]+'],\x20getUser\x20crm',_0x4aeb72);_0x2327c5(_0x4aeb72);})[_0xc430('0xf')](function(_0x59c498){logger[_0xc430('0x19')]('['+[_0x17d5c8['toUpperCase']()]+']',_0x59c498[_0xc430('0x10')]);_0x5830b0(_0x59c498[_0xc430('0x10')]);});}else{logger['info']('['+[_0x17d5c8[_0xc430('0xd')]()]+_0xc430('0x1a'));_0x4aeb72[_0xc430('0x17')]=_0x4aeb72[_0xc430('0x18')];_0x4aeb72[_0xc430('0x12')]=_0x4aeb72['adminEmail'];_0x2327c5(_0x4aeb72);}});};}function createEndUser(_0x2ccc13,_0x1a9512,_0x1c1da9,_0x1591e3,_0x542cba){logger[_0xc430('0xc')]('['+[_0x2ccc13['toUpperCase']()]+_0xc430('0x1b'),_0x1c1da9);return new Promise(function(_0x4ad29e,_0x6b263b){var _0x1045c0={'method':_0xc430('0x1c'),'uri':_0x1591e3+_0xc430('0x1d')+_0x542cba,'body':{'user_name':_0x1c1da9['endUserNumber'],'roles':_0xc430('0x1e'),'first_name':_0x1c1da9[_0xc430('0x1f')],'active':_0xc430('0x16'),'date_format':_0xc430('0x20'),'phone':_0x1c1da9['endUserNumber']},'auth':_0x1a9512,'json':!![]};return rp(_0x1045c0)[_0xc430('0x14')](function(_0x39c17f){logger['info']('['+[_0x2ccc13[_0xc430('0xd')]()]+'],\x20EndUser\x20schema',_0x39c17f['result']);_0x1c1da9[_0xc430('0x21')]=_0x39c17f[_0xc430('0xa')][_0xc430('0xb')];_0x4ad29e(_0x1c1da9);})[_0xc430('0xf')](function(_0x2f44bb){logger[_0xc430('0x19')]('['+[_0x2ccc13[_0xc430('0xd')]()]+']',_0x2f44bb[_0xc430('0x10')]);_0x6b263b(_0x2f44bb['message']);});});}function getEndUser(_0x442d20,_0x4c7fc8,_0x119bee,_0x43029d,_0x3fec7c){return function(_0x44ca3e){logger['info']('['+[_0x442d20[_0xc430('0xd')]()]+'],\x20getEndUser\x20input\x20crm',_0x44ca3e);return new Promise(function(_0x517d2b,_0x2d6cec){var _0x3ebdc0={'method':'GET','uri':_0x119bee+_0xc430('0x22')+_0x44ca3e[_0xc430('0x1f')]+'&'+_0x43029d+'&'+_0x3fec7c,'auth':_0x4c7fc8,'json':!![]};return rp(_0x3ebdc0)[_0xc430('0x14')](function(_0x20bcdd){if(_0x20bcdd[_0xc430('0xa')][_0xc430('0x9')]>0x0){_0x44ca3e[_0xc430('0x21')]=_0x20bcdd[_0xc430('0xa')][0x0][_0xc430('0xb')];logger[_0xc430('0xc')]('['+[_0x442d20[_0xc430('0xd')]()]+_0xc430('0x23'),_0x44ca3e);_0x517d2b(_0x44ca3e);}else{return createEndUser(_0x442d20,_0x4c7fc8,_0x44ca3e,_0x119bee,_0x43029d)[_0xc430('0x14')](function(_0x283483){logger[_0xc430('0xc')]('['+[_0x442d20['toUpperCase']()]+_0xc430('0x24'),_0x283483);_0x517d2b(_0x283483);});}})[_0xc430('0xf')](function(_0x24363b){logger[_0xc430('0x19')]('['+[_0x442d20['toUpperCase']()]+']',_0x24363b[_0xc430('0x10')]);_0x2d6cec(_0x24363b[_0xc430('0x10')]);});});};}function getCustomFields(_0x13ac85,_0x45b3dc){var _0x9d695={};if(_0x13ac85[_0xc430('0x9')]>0x0){_['forEach'](_0x13ac85,function(_0xa93ed0){if(_[_0xc430('0x25')]([_0xc430('0x26'),_0xc430('0x27')],_0xa93ed0[_0xc430('0x28')])&&_0xa93ed0[_0xc430('0x29')]&&!_0xa93ed0[_0xc430('0x2a')]){_0x9d695[_0xa93ed0[_0xc430('0x29')][_0xc430('0x2b')]()]=_0xa93ed0[_0xc430('0x2c')][_0xc430('0x2d')]();}else if(_[_0xc430('0x25')]([_0xc430('0x26'),_0xc430('0x27')],_0xa93ed0['type'])&&_0xa93ed0['idField']&&_0xa93ed0['customField']){_0x9d695[_0xa93ed0[_0xc430('0x2e')][_0xc430('0x2b')]()]=_0xa93ed0[_0xc430('0x2c')][_0xc430('0x2d')]();}else if(_0xa93ed0[_0xc430('0x28')]===_0xc430('0x2f')&&_0xa93ed0[_0xc430('0x30')]&&_0xa93ed0[_0xc430('0x2e')]&&_0xa93ed0[_0xc430('0x2a')]){_0x9d695[_0xa93ed0[_0xc430('0x2e')][_0xc430('0x2b')]()]=_0x45b3dc[_0xa93ed0[_0xc430('0x30')]][_0xc430('0x2d')]();}else if(_0xa93ed0[_0xc430('0x28')]===_0xc430('0x31')&&_0xa93ed0[_0xc430('0x32')]&&_0xa93ed0['Variable'][_0xc430('0x33')]&&_0xa93ed0[_0xc430('0x2e')]&&_0xa93ed0[_0xc430('0x2a')]){_0x9d695[_0xa93ed0[_0xc430('0x2e')][_0xc430('0x2b')]()]=_0x45b3dc[_0xa93ed0[_0xc430('0x32')][_0xc430('0x33')][_0xc430('0x2b')]()]['toString']();}});}return _0x9d695;}function getTicket(_0x46658b,_0x4c068e,_0x2c1560,_0xff4c62,_0x5a704d,_0x5ce31b){return function(_0x1795f2){logger['info']('['+[_0x46658b['toUpperCase']()]+_0xc430('0x34'),_0x1795f2);return new Promise(function(_0x4eafae,_0x175f3f){var _0x364788=_0x46658b[_0xc430('0x2b')]()==='outbound'?_0x1795f2[_0xc430('0x17')]:_0x1795f2[_0xc430('0x21')];var _0x19e563={'method':'POST','uri':_0x2c1560+_0xc430('0x35')+'?'+_0x5ce31b,'body':Object[_0xc430('0x36')]({},{'active':_0xc430('0x16'),'caller_id':_0x364788,'assigned_to':_0x1795f2[_0xc430('0x17')],'short_description':intUtil[_0xc430('0x37')](_0xff4c62[_0xc430('0x38')],_0x5a704d,'\x20'),'description':intUtil[_0xc430('0x37')](_0xff4c62['Descriptions'],_0x5a704d,'\x0a')},getCustomFields(_0xff4c62[_0xc430('0x39')],_0x5a704d)),'auth':_0x4c068e,'json':!![]};return rp(_0x19e563)[_0xc430('0x14')](function(_0x2df2f2){logger['info']('['+[_0x46658b[_0xc430('0xd')]()]+_0xc430('0x3a'),_0x2df2f2[_0xc430('0xa')]);_0x1795f2[_0xc430('0x3b')]=_0x2df2f2['result'][_0xc430('0xb')];_0x1795f2['ticketNumber']=_0x2df2f2[_0xc430('0xa')][_0xc430('0x3c')];logger[_0xc430('0xc')]('['+[_0x46658b[_0xc430('0xd')]()]+_0xc430('0x3d'),_0x1795f2);_0x4eafae(_0x1795f2);})[_0xc430('0xf')](function(_0x5a0b32){logger[_0xc430('0x19')]('['+[_0x46658b[_0xc430('0xd')]()]+']',_0x5a0b32['message']);_0x175f3f(_0x5a0b32[_0xc430('0x10')]);});});};}function createRemoteTag(_0x1a3d7e,_0x9cc64a,_0xdf3ac9,_0x5e361a){return new Promise(function(_0x23f2e9,_0x493576){var _0x28a0a2={'method':_0xc430('0x1c'),'uri':_0xdf3ac9+_0xc430('0x3e')+'?'+_0x5e361a,'body':{'short_description':_0x1a3d7e,'global':!![],'active':!![],'name':_0x1a3d7e},'auth':_0x9cc64a,'json':!![]};return rp(_0x28a0a2)[_0xc430('0x14')](function(_0x532d98){var _0x12c624=_0x532d98[_0xc430('0xa')]['sys_id'];_0x23f2e9(_0x12c624);});});}function getRemoteTag(_0x506287,_0x75d9ff,_0x274760,_0x2d3e0b,_0x14c427){return new Promise(function(_0x2d71d5,_0x40ed6f){var _0x2065d0={'method':'GET','uri':_0x274760+_0xc430('0x3e')+'?sysparm_query=name%3D'+_0x506287+'&'+_0x2d3e0b,'auth':_0x75d9ff,'json':!![]};return rp(_0x2065d0)[_0xc430('0x14')](function(_0x8cb2e3){if(_0x8cb2e3[_0xc430('0xa')][_0xc430('0x9')]>0x0){var _0x19e84f=_0x8cb2e3[_0xc430('0xa')][0x0]['sys_id'];_0x2d71d5(_0x19e84f);}else{return createRemoteTag(_0x506287,_0x75d9ff,_0x274760,_0x2d3e0b)[_0xc430('0x14')](function(_0x325387){_0x2d71d5(_0x325387);});}});});}function assignTagToIncident(_0xd91525,_0x419dad,_0x10c7a4,_0xb4d28f,_0x43f3fb){return new Promise(function(_0x56e25a,_0x13e9a5){var _0x52b5b4={'method':_0xc430('0x1c'),'uri':_0x10c7a4+'label_entry'+'?'+_0x43f3fb,'body':{'label':_0xd91525,'table':_0xc430('0x35'),'id_type':_0xc430('0x3f'),'table_key':_0xb4d28f[_0xc430('0x3b')],'title':_0xc430('0x40')+_0xb4d28f[_0xc430('0x41')],'id_display':_0xb4d28f[_0xc430('0x41')]},'auth':_0x419dad,'json':!![]};return rp(_0x52b5b4)['then'](function(_0x3ad99c){_0x56e25a();})[_0xc430('0xf')](function(){_0x56e25a();});});}function manageTags(_0x5c6eeb,_0x5b494f,_0x1a2e00,_0x35c7c2,_0x219dc0,_0x37d225,_0x3ca9ac){return new Promise(function(_0x22f8cf,_0xd91c80){var _0x28fa9f=[];_0x5b494f[_0xc430('0x42')](function(_0x2c0e13){_0x28fa9f[_0xc430('0x43')](getRemoteTag(_0x2c0e13,_0x1a2e00,_0x35c7c2,_0x37d225,_0x3ca9ac));});return Promise[_0xc430('0x44')](_0x28fa9f)['then'](function(_0x52e622){if(_0x52e622[_0xc430('0x9')]){logger['info']('['+[_0x5c6eeb[_0xc430('0xd')]()]+_0xc430('0x45'),_0x52e622);var _0x541286=[];_0x52e622[_0xc430('0x42')](function(_0x4e1732){_0x541286['push'](assignTagToIncident(_0x4e1732,_0x1a2e00,_0x35c7c2,_0x219dc0,_0x37d225));});return Promise[_0xc430('0x44')](_0x541286)[_0xc430('0x14')](function(){_0x22f8cf();})['catch'](function(){_0x22f8cf();});}else{_0x22f8cf();}});});}function getTags(_0x2ae493,_0x5bb111,_0x5a77a3,_0x173792,_0x3ab0ac,_0xd4aae7){return function(_0x2c1620){return new Promise(function(_0x4eda14,_0x155df9){var _0x2672dd=[];var _0x35c752=_0x173792[_0xc430('0x46')];if(_0x35c752&&_0x35c752['length']>0x0){_0x2672dd=_[_0xc430('0x47')](_0x35c752,_0xc430('0x33'));}if(_0x2672dd[_0xc430('0x9')]>0x0){return manageTags(_0x2ae493,_0x2672dd,_0x5bb111,_0x5a77a3,_0x2c1620,_0x3ab0ac,_0xd4aae7)[_0xc430('0x14')](function(){_0x4eda14(_0x2c1620);});}else{_0x4eda14(_0x2c1620);}});};}function emit(_0x242160,_0x2c53c9,_0x420942){var _0x186925=_0xc430('0x48')+_0xc430('0x49')+_0xc430('0x4a')+'%255EORDERBYDESCnumber';var _0x4f390c={'uri':_0x242160+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x420942+_0x186925};io['to'](util[_0xc430('0x4b')](_0xc430('0x4c'),_0x2c53c9))[_0xc430('0x4d')]('trigger:browser:url',_0x4f390c);}exports['cs']=function(_0x58fb03,_0x196a43,_0x1c10b5,_0x31ae3c,_0x19c080,_0x256290,_0x407e3f,_0x37303b){var _0x1cc357={};var _0x3c9a38={'user':_0x256290[_0xc430('0x4e')],'pass':_0x256290['password']};var _0x6debfb=_0xc430('0x4f');var _0x1c6390='sysparm_display_value=true';_0x256290['remoteUri']=intUtil['stripTrailingSlash'](_0x256290[_0xc430('0x50')]);_0x256290[_0xc430('0x51')]=intUtil[_0xc430('0x52')](_0x256290[_0xc430('0x51')]);var _0x4d98a0=util[_0xc430('0x4b')](_0xc430('0x53'),_0x256290[_0xc430('0x50')]);_0x1cc357['userEmail']=!_[_0xc430('0x54')](_0x31ae3c)?_0x31ae3c['email']:null;_0x1cc357[_0xc430('0x55')]=_0x256290[_0xc430('0x56')];_0x1cc357[_0xc430('0x1f')]=_0x37303b[_0xc430('0x2b')]()===_0xc430('0x57')?_0x196a43['destcalleridnum']:_0x196a43[_0xc430('0x58')];_0x1cc357[_0xc430('0x59')]=_0x37303b===_0xc430('0x5a')||_0x37303b===_0xc430('0x5b')?'queue':'outbound';var _0x3e3932=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x256290[_0xc430('0x51')],_0x196a43[_0xc430('0x5c')],md5(_0x196a43['uniqueid']));if(_0x19c080&&_0x19c080[_0xc430('0x5d')]){logger[_0xc430('0xc')](_0xc430('0x5e'),_0xc430('0x5f'));_0x196a43[_0xc430('0x60')]=_0x3e3932;}else if(_0x407e3f&&_0x407e3f[_0xc430('0x61')]&&_0x407e3f['recordingFormat']!==_0xc430('0x62')){logger[_0xc430('0xc')](_0xc430('0x63'),_0xc430('0x5f'));_0x196a43['recordingURL']=_0x3e3932;}else{_0x196a43[_0xc430('0x60')]='';}return getAdminUser(_0x37303b,_0x3c9a38,_0x1cc357,_0x4d98a0,_0x1c6390,_0x6debfb)[_0xc430('0x14')](getUser(_0x37303b,_0x3c9a38,_0x4d98a0,_0x1c6390,_0x6debfb))[_0xc430('0x14')](getEndUser(_0x37303b,_0x3c9a38,_0x4d98a0,_0x1c6390,_0x6debfb))['then'](getTicket(_0x37303b,_0x3c9a38,_0x4d98a0,_0x1c10b5,_0x196a43,_0x1c6390))[_0xc430('0x14')](function(_0x5c31f1){logger['info'](util[_0xc430('0x4b')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5c31f1[_0xc430('0x3b')]));logger['info'](util[_0xc430('0x4b')](_0xc430('0x64'),_0x37303b));if(_0x37303b!=='unmanaged'){logger[_0xc430('0xc')]('['+[_0x37303b[_0xc430('0xd')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x256290[_0xc430('0x50')],_0x31ae3c[_0xc430('0x33')],_0x5c31f1['ticketId']);}})[_0xc430('0xf')](function(_0x7aa69e){logger['error']('['+[_0x37303b[_0xc430('0xd')]()]+_0xc430('0x65'),util[_0xc430('0x66')](_0x7aa69e,{'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 42d341b..b27d6a1 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 _0x3b1b=['name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','string','nameField','customField','toLowerCase','content','type','custom_fields','push','variable','customVariable','Variable','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','contacts','version','[OUTBOUND]','error','unmanaged','toUpperCase','calleridname','Inbound','lodash','request-promise','bluebird','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','duration_minutes','parent_type','Contacts','parent_name','direction','length','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','Agent\x20found!'];(function(_0x2ae22a,_0x4fe753){var _0x286a82=function(_0x256e58){while(--_0x256e58){_0x2ae22a['push'](_0x2ae22a['shift']());}};_0x286a82(++_0x4fe753);}(_0x3b1b,0x139));var _0xb3b1=function(_0x35f463,_0x491a53){_0x35f463=_0x35f463-0x0;var _0x4f6c71=_0x3b1b[_0x35f463];return _0x4f6c71;};'use strict';var _=require(_0xb3b1('0x0'));var rp=require(_0xb3b1('0x1'));var BPromise=require(_0xb3b1('0x2'));var md5=require('md5');var util=require(_0xb3b1('0x3'));var Redis=require(_0xb3b1('0x4'));var intUtil=require('./util');var config=require(_0xb3b1('0x5'));var logger=require(_0xb3b1('0x6'))(_0xb3b1('0x7'));config[_0xb3b1('0x8')]=_['defaults'](config[_0xb3b1('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xb3b1('0x9'))(new Redis(config[_0xb3b1('0x8')]));var def={'method':_0xb3b1('0xa'),'json':!![]};function emit(_0x13f5b1,_0xf8bce4,_0x179f7c){io['to'](_0x13f5b1)[_0xb3b1('0xb')](_0xf8bce4,_0x179f7c);}function getTicket(_0x3a96c8,_0x565366,_0xb587ed,_0x543372,_0x512bb5,_0x135c43,_0x4c2d5e,_0x295b1c){logger[_0xb3b1('0xc')](_0xb3b1('0xd'));var _0x2b0447=new Date();var _0x27974a=[{'name':_0xb3b1('0xe'),'value':intUtil[_0xb3b1('0xf')](_0x543372[_0xb3b1('0x10')],_0x512bb5,'\x20')},{'name':_0xb3b1('0x11'),'value':_0x565366['id']},{'name':_0xb3b1('0x12'),'value':_0x565366['id']},{'name':_0xb3b1('0x13'),'value':intUtil[_0xb3b1('0xf')](_0x543372[_0xb3b1('0x14')],_0x512bb5,'\x0a')},{'name':_0xb3b1('0x15'),'value':_0x2b0447[_0xb3b1('0x16')]()[_0xb3b1('0x17')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xb3b1('0x18'),'value':'15'},{'name':'parent_id','value':_0xb587ed['id']},{'name':_0xb3b1('0x19'),'value':_0xb3b1('0x1a')},{'name':_0xb3b1('0x1b'),'value':_0xb587ed['name']},{'name':_0xb3b1('0x1c'),'value':_0x295b1c}];if(_0x135c43[_0xb3b1('0x1d')]){_['forEach'](_0x135c43,function(_0xb0dcd0){if(_0x512bb5[_0xb0dcd0[_0xb3b1('0x1e')]]){_0x27974a['push']({'name':_0xb0dcd0[_0xb3b1('0x1f')],'value':_0x512bb5[_0xb0dcd0[_0xb3b1('0x1e')]]});}});}return request({'form':{'method':_0xb3b1('0x20'),'input_type':_0xb3b1('0x21'),'response_type':_0xb3b1('0x21'),'rest_data':JSON[_0xb3b1('0x22')]({'session':_0x4c2d5e['id'],'module_name':_0xb3b1('0x23'),'name_value_list':_0x27974a})}});}function getAuth(_0x3a7cff){return util[_0xb3b1('0x24')](_0xb3b1('0x25'),new Buffer(_0x3a7cff[_0xb3b1('0x26')]+':X')[_0xb3b1('0x27')](_0xb3b1('0x28')));}function getServerInfo(_0x3be627){return request({'form':{'method':_0xb3b1('0x29'),'input_type':_0xb3b1('0x21'),'response_type':_0xb3b1('0x21'),'rest_data':JSON[_0xb3b1('0x22')]({'session':_0x3be627['id']})}});}function getUser(_0x3083ba,_0x1a1ac4,_0x2d5407){if(!_['isNil'](_0x1a1ac4)){logger[_0xb3b1('0xc')]('Getting\x20agent\x20with\x20name',_0x1a1ac4);return request({'form':{'method':_0xb3b1('0x2a'),'input_type':_0xb3b1('0x21'),'response_type':_0xb3b1('0x21'),'rest_data':JSON[_0xb3b1('0x22')]({'session':_0x2d5407['id'],'module_name':'Employees','query':util[_0xb3b1('0x24')](_0xb3b1('0x2b'),_0x1a1ac4),'order_by':'','offset':'0','select_fields':['id',_0xb3b1('0xe'),_0xb3b1('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb3b1('0x2d')](function(_0x49efbd){if(_0x49efbd[_0xb3b1('0x2e')][_0xb3b1('0x1d')]){var _0x3fa356=_[_0xb3b1('0x2f')](_0x49efbd['entry_list'],function(_0x1861b8){return _0x1861b8['name_value_list'][_0xb3b1('0x2c')][_0xb3b1('0x30')]===_0x1a1ac4;});if(_0x3fa356){logger[_0xb3b1('0xc')](_0xb3b1('0x31'));return BPromise['resolve']({'id':_0x3fa356[_0xb3b1('0x32')]['id'][_0xb3b1('0x30')],'name':_0x3fa356[_0xb3b1('0x32')][_0xb3b1('0xe')][_0xb3b1('0x30')]});}}logger[_0xb3b1('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x2d5407[_0xb3b1('0x32')][_0xb3b1('0x33')]['value'],'name':_0x2d5407[_0xb3b1('0x32')][_0xb3b1('0x2c')][_0xb3b1('0x30')]});});}else{logger[_0xb3b1('0xc')](_0xb3b1('0x34'));return BPromise[_0xb3b1('0x35')]({'id':_0x2d5407[_0xb3b1('0x32')][_0xb3b1('0x33')][_0xb3b1('0x30')],'name':_0x2d5407[_0xb3b1('0x32')][_0xb3b1('0x2c')][_0xb3b1('0x30')]});}}function getEndUser(_0xa20aee,_0xe145f8,_0x5ac1fa,_0x20b504){logger[_0xb3b1('0xc')](_0xb3b1('0x36'),_0x5ac1fa);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xb3b1('0x22')]({'session':_0x20b504['id'],'module_name':_0xb3b1('0x1a'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x5ac1fa),'order_by':'','offset':'0','select_fields':['id',_0xb3b1('0xe'),_0xb3b1('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb3b1('0x2d')](function(_0x344398){if(_0x344398[_0xb3b1('0x2e')][_0xb3b1('0x1d')]){var _0x3e4d37=_[_0xb3b1('0x2f')](_0x344398[_0xb3b1('0x2e')],function(_0x5d02f3){return _0x5d02f3[_0xb3b1('0x32')]['phone_home'][_0xb3b1('0x30')]===_0x5ac1fa;});if(_0x3e4d37){logger[_0xb3b1('0xc')](_0xb3b1('0x38'));return BPromise[_0xb3b1('0x35')]({'id':_0x3e4d37['name_value_list']['id'][_0xb3b1('0x30')],'name':_0x3e4d37[_0xb3b1('0x32')][_0xb3b1('0xe')][_0xb3b1('0x30')],'phone':_0x3e4d37[_0xb3b1('0x32')][_0xb3b1('0x37')][_0xb3b1('0x30')]});}}else{logger[_0xb3b1('0xc')](_0xb3b1('0x39'));return request({'form':{'method':_0xb3b1('0x20'),'input_type':_0xb3b1('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x20b504['id'],'module_name':_0xb3b1('0x1a'),'name_value_list':[{'name':_0xb3b1('0x3a'),'value':_0xe145f8!==''?_0xe145f8:util[_0xb3b1('0x24')](_0xb3b1('0x3b'),_0x5ac1fa)},{'name':_0xb3b1('0x37'),'value':_0x5ac1fa}]})}})[_0xb3b1('0x2d')](function(_0x2570b5){logger[_0xb3b1('0xc')](_0xb3b1('0x3c'));return BPromise[_0xb3b1('0x35')]({'id':_0x2570b5['id'],'name':_0x2570b5[_0xb3b1('0x2e')][_0xb3b1('0x3a')][_0xb3b1('0x30')],'phone':_0x2570b5['entry_list'][_0xb3b1('0x37')][_0xb3b1('0x30')]});});}});}function request(_0x537fe6){logger[_0xb3b1('0x3d')]('[HTTP]',JSON[_0xb3b1('0x22')](_0x537fe6));return rp(_[_0xb3b1('0x3e')](def,_0x537fe6));}function getTags(_0x30a6c9,_0x39988b){var _0x1c8bff=[];if(_0x30a6c9&&_0x30a6c9['length']>0x0){_0x1c8bff=_[_0xb3b1('0x3f')](_0x30a6c9,_0x39988b);}return _0x1c8bff;}function getCustomFields(_0x28a152,_0x3ff3b5){var _0x2e9b00=[];var _0xb9ba46={'custom_fields':[]};if(_0x28a152[_0xb3b1('0x1d')]>0x0){_['forEach'](_0x28a152,function(_0x28956f){if(_0x28956f['type']===_0xb3b1('0x40')&&_0x28956f[_0xb3b1('0x41')]&&!_0x28956f[_0xb3b1('0x42')]){_0xb9ba46[_0x28956f[_0xb3b1('0x41')][_0xb3b1('0x43')]()]=_0x28956f[_0xb3b1('0x44')][_0xb3b1('0x27')]();}else if(_0x28956f[_0xb3b1('0x45')]===_0xb3b1('0x40')&&_0x28956f[_0xb3b1('0x1f')]&&_0x28956f[_0xb3b1('0x42')]){_0xb9ba46[_0xb3b1('0x46')][_0xb3b1('0x47')]({'id':_0x28956f[_0xb3b1('0x1f')],'value':_0x28956f[_0xb3b1('0x44')][_0xb3b1('0x27')]()});}else if(_0x28956f['type']===_0xb3b1('0x48')&&_0x28956f['variableName']&&_0x28956f['idField']&&_0x28956f[_0xb3b1('0x42')]){_0x3ff3b5[_0x28956f[_0xb3b1('0x1e')]]&&_0xb9ba46[_0xb3b1('0x46')][_0xb3b1('0x47')]({'id':_0x28956f['idField'],'value':_0x3ff3b5[_0x28956f[_0xb3b1('0x1e')]][_0xb3b1('0x27')]()});}else if(_0x28956f['type']===_0xb3b1('0x49')&&_0x28956f[_0xb3b1('0x4a')]&&_0x28956f[_0xb3b1('0x4a')][_0xb3b1('0xe')]&&_0x28956f['idField']&&_0x28956f['customField']){_0x3ff3b5[_0x28956f[_0xb3b1('0x4a')][_0xb3b1('0xe')][_0xb3b1('0x43')]()]&&_0xb9ba46[_0xb3b1('0x46')]['push']({'id':_0x28956f[_0xb3b1('0x1f')],'value':_0x3ff3b5[_0x28956f[_0xb3b1('0x4a')]['name'][_0xb3b1('0x43')]()][_0xb3b1('0x27')]()});}});}return _0xb9ba46;}function getConnection(_0x84a5e4){return request({'method':_0xb3b1('0xa'),'form':{'method':'login','input_type':_0xb3b1('0x21'),'response_type':'JSON','rest_data':JSON[_0xb3b1('0x22')]({'user_auth':{'user_name':_0x84a5e4[_0xb3b1('0x4b')],'password':_0x84a5e4[_0xb3b1('0x4c')],'encryption':'PLAIN'},'application':_0xb3b1('0x4d')})}})[_0xb3b1('0x2d')](function(_0x181770){var _0x3518e1=_0x181770;if(_0x3518e1['id']){def[_0xb3b1('0x4e')]=_0x3518e1['id'];return BPromise['resolve'](_0x3518e1);}else{throw new Error(util['format'](_0xb3b1('0x4f'),_0x84a5e4['id']));}});}function setRelationship(_0x3ced4a,_0x288673,_0x32fcd9,_0x5f1b70){return request({'form':{'method':_0xb3b1('0x50'),'input_type':_0xb3b1('0x21'),'response_type':_0xb3b1('0x21'),'rest_data':JSON['stringify']({'session':_0x3ced4a['id'],'module_name':_0xb3b1('0x23'),'module_id':_0x32fcd9['id'],'link_field_name':_0x5f1b70,'related_ids':[_0x288673['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xb3b1('0x51')]=function(_0x50aa33,_0x3a9034,_0x3381fb,_0x481076,_0x53f885,_0x4b1b3e){var _0x1444ea,_0x2e422c,_0xdd52bb,_0x12db2e;_0x4b1b3e[_0xb3b1('0x52')]=intUtil[_0xb3b1('0x53')](_0x4b1b3e['remoteUri']);_0x4b1b3e[_0xb3b1('0x54')]=intUtil[_0xb3b1('0x53')](_0x4b1b3e[_0xb3b1('0x54')]);def[_0xb3b1('0x55')]=util['format'](_0xb3b1('0x56'),_0x4b1b3e['remoteUri']);if(_0x53f885&&_0x53f885[_0xb3b1('0x57')]){logger['info'](_0xb3b1('0x58'),_0xb3b1('0x59'));_0x3a9034['recordingURL']=util['format'](_0xb3b1('0x5a'),_0x4b1b3e[_0xb3b1('0x54')],_0x3a9034[_0xb3b1('0x5b')],md5(_0x3a9034[_0xb3b1('0x5b')]));}else{_0x3a9034[_0xb3b1('0x5c')]='';}return getConnection(_0x4b1b3e)[_0xb3b1('0x2d')](function(_0x3ed5ae){_0x12db2e=_0x3ed5ae;return getUser(_0x4b1b3e,_0x481076[_0xb3b1('0xe')],_0x12db2e);})[_0xb3b1('0x2d')](function(_0x454045){_0x1444ea=_0x454045;logger['info'](_0xb3b1('0x5d'),_0x1444ea['id']);return getEndUser(_0x4b1b3e,_0x3a9034['calleridname'],_0x3a9034[_0xb3b1('0x5e')],_0x12db2e);})[_0xb3b1('0x2d')](function(_0x5a59b1){_0x2e422c=_0x5a59b1;logger['info'](_0xb3b1('0x5f'),_0x2e422c['id']);return getTicket(_0x4b1b3e,_0x1444ea,_0x2e422c,_0x3381fb,_0x3a9034,_0x3381fb[_0xb3b1('0x60')],_0x12db2e,'Inbound');})[_0xb3b1('0x2d')](function(_0x31eeca){_0xdd52bb=_0x31eeca;logger[_0xb3b1('0xc')]('Ticket\x20created!');logger[_0xb3b1('0xc')](_0xb3b1('0x61'),_0xdd52bb['id']);return setRelationship(_0x12db2e,_0x1444ea,_0xdd52bb,_0xb3b1('0x62'));})[_0xb3b1('0x2d')](function(){return setRelationship(_0x12db2e,_0x2e422c,_0xdd52bb,'contacts');})[_0xb3b1('0x2d')](function(){return getServerInfo(_0x12db2e);})[_0xb3b1('0x2d')](function(_0x15488d){var _0x3fdfad=parseInt(_0x15488d['version'][_0xb3b1('0x63')](0x0));var _0x3da192=util[_0xb3b1('0x24')](_0xb3b1('0x64'),_0x4b1b3e[_0xb3b1('0x52')],_0xdd52bb['id']);if(_0x3fdfad>0x6){_0x3da192=util['format'](_0xb3b1('0x65'),_0x4b1b3e[_0xb3b1('0x52')],_0xdd52bb['id']);}logger[_0xb3b1('0xc')](_0xb3b1('0x58'),_0xb3b1('0x66'));emit(util[_0xb3b1('0x24')](_0xb3b1('0x67'),_0x481076[_0xb3b1('0xe')]),_0xb3b1('0x68'),{'uri':_0x3da192});})[_0xb3b1('0x69')](function(_0x3f285b){logger['error'](_0xb3b1('0x58'),JSON[_0xb3b1('0x22')](_0x3f285b));});};exports[_0xb3b1('0x6a')]=function(_0x2f5cbe,_0x458ba6,_0x3265ba,_0x55b58f,_0x1ab357,_0x57b199,_0x1b3551){var _0x1ca8b3,_0x291ec2,_0x2915fe,_0xde5831;_0x57b199[_0xb3b1('0x52')]=intUtil[_0xb3b1('0x53')](_0x57b199[_0xb3b1('0x52')]);_0x57b199[_0xb3b1('0x54')]=intUtil[_0xb3b1('0x53')](_0x57b199[_0xb3b1('0x54')]);def['uri']=util[_0xb3b1('0x24')]('%s/service/v4_1/rest.php',_0x57b199[_0xb3b1('0x52')]);if(_0x1b3551&&_0x1b3551[_0xb3b1('0x6b')]&&_0x1b3551[_0xb3b1('0x6b')]!==_0xb3b1('0x6c')){logger[_0xb3b1('0xc')]('[OUTBOUND]',_0xb3b1('0x59'));_0x458ba6[_0xb3b1('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x57b199['serverUrl'],_0x458ba6['uniqueid'],md5(_0x458ba6[_0xb3b1('0x5b')]));}return getConnection(_0x57b199)[_0xb3b1('0x2d')](function(_0x3f86f1){_0xde5831=_0x3f86f1;return getUser(_0x57b199,_0x55b58f[_0xb3b1('0xe')],_0xde5831);})[_0xb3b1('0x2d')](function(_0xb71666){_0x1ca8b3=_0xb71666;logger[_0xb3b1('0xc')](_0xb3b1('0x5d'),_0x1ca8b3['id']);return getEndUser(_0x57b199,_0x458ba6[_0xb3b1('0x6d')],_0x458ba6[_0xb3b1('0x6e')],_0xde5831);})[_0xb3b1('0x2d')](function(_0x337644){_0x291ec2=_0x337644;logger['info'](_0xb3b1('0x5f'),_0x291ec2['id']);return getTicket(_0x57b199,_0x1ca8b3,_0x291ec2,_0x3265ba,_0x458ba6,_0x3265ba[_0xb3b1('0x60')],_0xde5831,_0xb3b1('0x6f'));})[_0xb3b1('0x2d')](function(_0x4f106c){_0x2915fe=_0x4f106c;logger[_0xb3b1('0xc')](_0xb3b1('0x70'));logger[_0xb3b1('0xc')](_0xb3b1('0x61'),_0x2915fe['id']);return setRelationship(_0xde5831,_0x1ca8b3,_0x2915fe,'users');})[_0xb3b1('0x2d')](function(){return setRelationship(_0xde5831,_0x291ec2,_0x2915fe,_0xb3b1('0x71'));})['then'](function(){return getServerInfo(_0xde5831);})[_0xb3b1('0x2d')](function(_0x27433c){var _0x247ca7=parseInt(_0x27433c[_0xb3b1('0x72')]['charAt'](0x0));var _0x5bf594=util[_0xb3b1('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x57b199[_0xb3b1('0x52')],_0x2915fe['id']);if(_0x247ca7>0x6){_0x5bf594=util[_0xb3b1('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x57b199[_0xb3b1('0x52')],_0x2915fe['id']);}logger[_0xb3b1('0xc')](_0xb3b1('0x73'),_0xb3b1('0x66'));emit(util[_0xb3b1('0x24')](_0xb3b1('0x67'),_0x55b58f[_0xb3b1('0xe')]),_0xb3b1('0x68'),{'uri':_0x5bf594});})[_0xb3b1('0x69')](function(_0x24beff){logger[_0xb3b1('0x74')]('[OUTBOUND]',JSON[_0xb3b1('0x22')](_0x24beff));});};exports[_0xb3b1('0x75')]=function(_0x53a16a,_0xc56458,_0x5e6c53,_0x34e871,_0x5bb1a4,_0x1af285){var _0x366d9d,_0x30833b,_0x3cbfce,_0x6f0b3f;_0x1af285[_0xb3b1('0x52')]=intUtil[_0xb3b1('0x53')](_0x1af285['remoteUri']);_0x1af285['serverUrl']=intUtil['stripTrailingSlash'](_0x1af285[_0xb3b1('0x54')]);def[_0xb3b1('0x55')]=util[_0xb3b1('0x24')](_0xb3b1('0x56'),_0x1af285[_0xb3b1('0x52')]);if(_0x5bb1a4&&_0x5bb1a4[_0xb3b1('0x57')]){logger['info']('['+_0xc56458['lastevent'][_0xb3b1('0x76')]()+']','Recording\x20is\x20enabled!');_0xc56458['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1af285['serverUrl'],_0xc56458['uniqueid'],md5(_0xc56458[_0xb3b1('0x5b')]));}else{_0xc56458[_0xb3b1('0x5c')]='';}return getConnection(_0x1af285)[_0xb3b1('0x2d')](function(_0x54d00a){_0x6f0b3f=_0x54d00a;if(!_['isNil'](_0x34e871)){return getUser(_0x1af285,_0x34e871[_0xb3b1('0xe')],_0x6f0b3f);}else{return getUser(_0x1af285,null,_0x6f0b3f);}})[_0xb3b1('0x2d')](function(_0x37b916){_0x366d9d=_0x37b916;logger[_0xb3b1('0xc')](_0xb3b1('0x5d'),_0x366d9d['id']);return getEndUser(_0x1af285,_0xc56458[_0xb3b1('0x77')],_0xc56458[_0xb3b1('0x5e')],_0x6f0b3f);})['then'](function(_0x386b8c){_0x30833b=_0x386b8c;logger[_0xb3b1('0xc')](_0xb3b1('0x5f'),_0x30833b['id']);return getTicket(_0x1af285,_0x366d9d,_0x30833b,_0x5e6c53,_0xc56458,_0x5e6c53[_0xb3b1('0x60')],_0x6f0b3f,_0xb3b1('0x78'));})[_0xb3b1('0x2d')](function(_0xce8a01){_0x3cbfce=_0xce8a01;logger[_0xb3b1('0xc')]('Ticket\x20created!');logger[_0xb3b1('0xc')](_0xb3b1('0x61'),_0x3cbfce['id']);return setRelationship(_0x6f0b3f,_0x366d9d,_0x3cbfce,'users');})[_0xb3b1('0x2d')](function(){return setRelationship(_0x6f0b3f,_0x30833b,_0x3cbfce,_0xb3b1('0x71'));})['then'](function(){return getServerInfo(_0x6f0b3f);})[_0xb3b1('0x69')](function(_0x448ad6){logger['error']('['+_0xc56458['lastevent'][_0xb3b1('0x76')]()+']',JSON[_0xb3b1('0x22')](_0x448ad6));});}; \ No newline at end of file +var _0xc933=['error','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','forEach','variableName','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','value','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_name','contacts.phone_home\x20=\x20\x22%s\x22','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','Caller\x20-\x20%s','phone_home','debug','[HTTP]','merge','map','type','string','nameField','customField','content','idField','push','customVariable','Variable','toLowerCase','custom_fields','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','stripTrailingSlash','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Fields','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s'];(function(_0x351781,_0xdf3a2c){var _0x1c773b=function(_0x34f336){while(--_0x34f336){_0x351781['push'](_0x351781['shift']());}};_0x1c773b(++_0xdf3a2c);}(_0xc933,0xf9));var _0x3c93=function(_0x1b321e,_0xd7b8ec){_0x1b321e=_0x1b321e-0x0;var _0x5ae51d=_0xc933[_0x1b321e];return _0x5ae51d;};'use strict';var _=require(_0x3c93('0x0'));var rp=require(_0x3c93('0x1'));var BPromise=require(_0x3c93('0x2'));var md5=require(_0x3c93('0x3'));var util=require(_0x3c93('0x4'));var Redis=require('ioredis');var intUtil=require(_0x3c93('0x5'));var config=require(_0x3c93('0x6'));var logger=require(_0x3c93('0x7'))(_0x3c93('0x8'));config[_0x3c93('0x9')]=_['defaults'](config[_0x3c93('0x9')],{'host':_0x3c93('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3c93('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x1b505a,_0x2ead14,_0x137d3c){io['to'](_0x1b505a)[_0x3c93('0xb')](_0x2ead14,_0x137d3c);}function getTicket(_0x46f9e8,_0x292096,_0x5577cf,_0x4b5ba8,_0x4a260d,_0x1a5bac,_0x39ff98,_0x2a904f){logger[_0x3c93('0xc')](_0x3c93('0xd'));var _0x8848dd=new Date();var _0x283ed8=[{'name':_0x3c93('0xe'),'value':intUtil[_0x3c93('0xf')](_0x4b5ba8[_0x3c93('0x10')],_0x4a260d,'\x20')},{'name':_0x3c93('0x11'),'value':_0x292096['id']},{'name':_0x3c93('0x12'),'value':_0x292096['id']},{'name':_0x3c93('0x13'),'value':intUtil[_0x3c93('0xf')](_0x4b5ba8[_0x3c93('0x14')],_0x4a260d,'\x0a')},{'name':_0x3c93('0x15'),'value':_0x8848dd[_0x3c93('0x16')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x3c93('0x17'),'value':'0'},{'name':_0x3c93('0x18'),'value':'15'},{'name':_0x3c93('0x19'),'value':_0x5577cf['id']},{'name':_0x3c93('0x1a'),'value':_0x3c93('0x1b')},{'name':_0x3c93('0x1c'),'value':_0x5577cf[_0x3c93('0xe')]},{'name':'direction','value':_0x2a904f}];if(_0x1a5bac['length']){_[_0x3c93('0x1d')](_0x1a5bac,function(_0x42516b){if(_0x4a260d[_0x42516b['variableName']]){_0x283ed8['push']({'name':_0x42516b['idField'],'value':_0x4a260d[_0x42516b[_0x3c93('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3c93('0x1f')]({'session':_0x39ff98['id'],'module_name':_0x3c93('0x20'),'name_value_list':_0x283ed8})}});}function getAuth(_0xa4bcfb){return util[_0x3c93('0x21')](_0x3c93('0x22'),new Buffer(_0xa4bcfb[_0x3c93('0x23')]+':X')[_0x3c93('0x24')](_0x3c93('0x25')));}function getServerInfo(_0x3207ac){return request({'form':{'method':_0x3c93('0x26'),'input_type':'JSON','response_type':_0x3c93('0x27'),'rest_data':JSON[_0x3c93('0x1f')]({'session':_0x3207ac['id']})}});}function getUser(_0xcbc8b,_0xb35e89,_0x3b3fbb){if(!_[_0x3c93('0x28')](_0xb35e89)){logger['info'](_0x3c93('0x29'),_0xb35e89);return request({'form':{'method':_0x3c93('0x2a'),'input_type':_0x3c93('0x27'),'response_type':_0x3c93('0x27'),'rest_data':JSON[_0x3c93('0x1f')]({'session':_0x3b3fbb['id'],'module_name':_0x3c93('0x2b'),'query':util[_0x3c93('0x21')](_0x3c93('0x2c'),_0xb35e89),'order_by':'','offset':'0','select_fields':['id',_0x3c93('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3c93('0x2d')](function(_0x3d50b3){if(_0x3d50b3[_0x3c93('0x2e')]['length']){var _0x129354=_[_0x3c93('0x2f')](_0x3d50b3[_0x3c93('0x2e')],function(_0x367022){return _0x367022['name_value_list']['user_name']['value']===_0xb35e89;});if(_0x129354){logger[_0x3c93('0xc')](_0x3c93('0x30'));return BPromise[_0x3c93('0x31')]({'id':_0x129354[_0x3c93('0x32')]['id']['value'],'name':_0x129354[_0x3c93('0x32')]['name']['value']});}}logger[_0x3c93('0xc')](_0x3c93('0x33'));return BPromise[_0x3c93('0x31')]({'id':_0x3b3fbb['name_value_list'][_0x3c93('0x34')][_0x3c93('0x35')],'name':_0x3b3fbb[_0x3c93('0x32')]['user_name'][_0x3c93('0x35')]});});}else{logger[_0x3c93('0xc')](_0x3c93('0x36'));return BPromise[_0x3c93('0x31')]({'id':_0x3b3fbb[_0x3c93('0x32')][_0x3c93('0x34')]['value'],'name':_0x3b3fbb[_0x3c93('0x32')][_0x3c93('0x37')]['value']});}}function getEndUser(_0x2c51f9,_0x410b94,_0x114c8d,_0x4e5c98){logger[_0x3c93('0xc')]('Searching\x20enduser\x20with\x20phone',_0x114c8d);return request({'form':{'method':_0x3c93('0x2a'),'input_type':'JSON','response_type':_0x3c93('0x27'),'rest_data':JSON[_0x3c93('0x1f')]({'session':_0x4e5c98['id'],'module_name':_0x3c93('0x1b'),'query':util[_0x3c93('0x21')](_0x3c93('0x38'),_0x114c8d),'order_by':'','offset':'0','select_fields':['id',_0x3c93('0xe'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3c93('0x2d')](function(_0xb44e93){if(_0xb44e93[_0x3c93('0x2e')][_0x3c93('0x39')]){var _0x1c2526=_[_0x3c93('0x2f')](_0xb44e93[_0x3c93('0x2e')],function(_0x56a8b8){return _0x56a8b8[_0x3c93('0x32')]['phone_home'][_0x3c93('0x35')]===_0x114c8d;});if(_0x1c2526){logger[_0x3c93('0xc')](_0x3c93('0x3a'));return BPromise['resolve']({'id':_0x1c2526[_0x3c93('0x32')]['id'][_0x3c93('0x35')],'name':_0x1c2526[_0x3c93('0x32')]['name']['value'],'phone':_0x1c2526[_0x3c93('0x32')]['phone_home'][_0x3c93('0x35')]});}}else{logger[_0x3c93('0xc')](_0x3c93('0x3b'));return request({'form':{'method':_0x3c93('0x3c'),'input_type':_0x3c93('0x27'),'response_type':_0x3c93('0x27'),'rest_data':JSON[_0x3c93('0x1f')]({'session':_0x4e5c98['id'],'module_name':_0x3c93('0x1b'),'name_value_list':[{'name':_0x3c93('0x3d'),'value':_0x410b94!==''?_0x410b94:util['format'](_0x3c93('0x3e'),_0x114c8d)},{'name':'phone_home','value':_0x114c8d}]})}})[_0x3c93('0x2d')](function(_0x1f48d3){logger[_0x3c93('0xc')]('Enduser\x20created.');return BPromise[_0x3c93('0x31')]({'id':_0x1f48d3['id'],'name':_0x1f48d3[_0x3c93('0x2e')][_0x3c93('0x3d')][_0x3c93('0x35')],'phone':_0x1f48d3[_0x3c93('0x2e')][_0x3c93('0x3f')]['value']});});}});}function request(_0x5c101a){logger[_0x3c93('0x40')](_0x3c93('0x41'),JSON[_0x3c93('0x1f')](_0x5c101a));return rp(_[_0x3c93('0x42')](def,_0x5c101a));}function getTags(_0x101b48,_0x419567){var _0x398faa=[];if(_0x101b48&&_0x101b48[_0x3c93('0x39')]>0x0){_0x398faa=_[_0x3c93('0x43')](_0x101b48,_0x419567);}return _0x398faa;}function getCustomFields(_0x450624,_0x34c018){var _0x1dc48e=[];var _0x45125f={'custom_fields':[]};if(_0x450624[_0x3c93('0x39')]>0x0){_[_0x3c93('0x1d')](_0x450624,function(_0xc1311a){if(_0xc1311a[_0x3c93('0x44')]===_0x3c93('0x45')&&_0xc1311a[_0x3c93('0x46')]&&!_0xc1311a[_0x3c93('0x47')]){_0x45125f[_0xc1311a['nameField']['toLowerCase']()]=_0xc1311a[_0x3c93('0x48')][_0x3c93('0x24')]();}else if(_0xc1311a['type']===_0x3c93('0x45')&&_0xc1311a[_0x3c93('0x49')]&&_0xc1311a[_0x3c93('0x47')]){_0x45125f['custom_fields'][_0x3c93('0x4a')]({'id':_0xc1311a[_0x3c93('0x49')],'value':_0xc1311a[_0x3c93('0x48')]['toString']()});}else if(_0xc1311a[_0x3c93('0x44')]==='variable'&&_0xc1311a[_0x3c93('0x1e')]&&_0xc1311a['idField']&&_0xc1311a[_0x3c93('0x47')]){_0x34c018[_0xc1311a[_0x3c93('0x1e')]]&&_0x45125f['custom_fields'][_0x3c93('0x4a')]({'id':_0xc1311a[_0x3c93('0x49')],'value':_0x34c018[_0xc1311a[_0x3c93('0x1e')]][_0x3c93('0x24')]()});}else if(_0xc1311a[_0x3c93('0x44')]===_0x3c93('0x4b')&&_0xc1311a['Variable']&&_0xc1311a[_0x3c93('0x4c')][_0x3c93('0xe')]&&_0xc1311a[_0x3c93('0x49')]&&_0xc1311a[_0x3c93('0x47')]){_0x34c018[_0xc1311a[_0x3c93('0x4c')][_0x3c93('0xe')][_0x3c93('0x4d')]()]&&_0x45125f[_0x3c93('0x4e')][_0x3c93('0x4a')]({'id':_0xc1311a[_0x3c93('0x49')],'value':_0x34c018[_0xc1311a[_0x3c93('0x4c')][_0x3c93('0xe')][_0x3c93('0x4d')]()][_0x3c93('0x24')]()});}});}return _0x45125f;}function getConnection(_0x4f492c){return request({'method':'POST','form':{'method':_0x3c93('0x4f'),'input_type':_0x3c93('0x27'),'response_type':_0x3c93('0x27'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4f492c[_0x3c93('0x50')],'password':_0x4f492c[_0x3c93('0x51')],'encryption':_0x3c93('0x52')},'application':_0x3c93('0x53')})}})[_0x3c93('0x2d')](function(_0x4314ea){var _0x33f465=_0x4314ea;if(_0x33f465['id']){def['sessionID']=_0x33f465['id'];return BPromise['resolve'](_0x33f465);}else{throw new Error(util['format'](_0x3c93('0x54'),_0x4f492c['id']));}});}function setRelationship(_0xd3177e,_0x21588b,_0x839baa,_0x3e8b36){return request({'form':{'method':_0x3c93('0x55'),'input_type':_0x3c93('0x27'),'response_type':_0x3c93('0x27'),'rest_data':JSON[_0x3c93('0x1f')]({'session':_0xd3177e['id'],'module_name':'Calls','module_id':_0x839baa['id'],'link_field_name':_0x3e8b36,'related_ids':[_0x21588b['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x20d0c9,_0x59f3b3,_0x453415,_0x53a00d,_0x168aad,_0x3069a7){var _0x3ae3e8,_0x4bd8c4,_0x2d7914,_0x4e897a;_0x3069a7['remoteUri']=intUtil['stripTrailingSlash'](_0x3069a7[_0x3c93('0x56')]);_0x3069a7['serverUrl']=intUtil['stripTrailingSlash'](_0x3069a7['serverUrl']);def[_0x3c93('0x57')]=util['format'](_0x3c93('0x58'),_0x3069a7[_0x3c93('0x56')]);if(_0x168aad&&_0x168aad['monitor_format']){logger[_0x3c93('0xc')](_0x3c93('0x59'),_0x3c93('0x5a'));_0x59f3b3[_0x3c93('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3069a7[_0x3c93('0x5c')],_0x59f3b3[_0x3c93('0x5d')],md5(_0x59f3b3[_0x3c93('0x5d')]));}else{_0x59f3b3[_0x3c93('0x5b')]='';}return getConnection(_0x3069a7)[_0x3c93('0x2d')](function(_0x3b2778){_0x4e897a=_0x3b2778;return getUser(_0x3069a7,_0x53a00d[_0x3c93('0xe')],_0x4e897a);})[_0x3c93('0x2d')](function(_0xbdb4c7){_0x3ae3e8=_0xbdb4c7;logger[_0x3c93('0xc')](_0x3c93('0x5e'),_0x3ae3e8['id']);return getEndUser(_0x3069a7,_0x59f3b3['calleridname'],_0x59f3b3[_0x3c93('0x5f')],_0x4e897a);})[_0x3c93('0x2d')](function(_0x191934){_0x4bd8c4=_0x191934;logger['info'](_0x3c93('0x60'),_0x4bd8c4['id']);return getTicket(_0x3069a7,_0x3ae3e8,_0x4bd8c4,_0x453415,_0x59f3b3,_0x453415['Fields'],_0x4e897a,_0x3c93('0x61'));})['then'](function(_0x33c831){_0x2d7914=_0x33c831;logger[_0x3c93('0xc')](_0x3c93('0x62'));logger[_0x3c93('0xc')](_0x3c93('0x63'),_0x2d7914['id']);return setRelationship(_0x4e897a,_0x3ae3e8,_0x2d7914,_0x3c93('0x64'));})[_0x3c93('0x2d')](function(){return setRelationship(_0x4e897a,_0x4bd8c4,_0x2d7914,_0x3c93('0x65'));})[_0x3c93('0x2d')](function(){return getServerInfo(_0x4e897a);})[_0x3c93('0x2d')](function(_0x5d717a){var _0x4391d5=parseInt(_0x5d717a['version'][_0x3c93('0x66')](0x0));var _0x9e857d=util[_0x3c93('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3069a7[_0x3c93('0x56')],_0x2d7914['id']);if(_0x4391d5>0x6){_0x9e857d=util['format'](_0x3c93('0x67'),_0x3069a7[_0x3c93('0x56')],_0x2d7914['id']);}logger[_0x3c93('0xc')](_0x3c93('0x59'),_0x3c93('0x68'));emit(util[_0x3c93('0x21')](_0x3c93('0x69'),_0x53a00d[_0x3c93('0xe')]),_0x3c93('0x6a'),{'uri':_0x9e857d});})[_0x3c93('0x6b')](function(_0x9d31d5){logger['error'](_0x3c93('0x59'),JSON[_0x3c93('0x1f')](_0x9d31d5));});};exports['outbound']=function(_0x468edb,_0x332a49,_0x5a4034,_0x2b3305,_0x371119,_0xad4578,_0x4a28a8){var _0x1e3c80,_0x13f207,_0x5b1fe9,_0x254475;_0xad4578[_0x3c93('0x56')]=intUtil[_0x3c93('0x6c')](_0xad4578['remoteUri']);_0xad4578[_0x3c93('0x5c')]=intUtil[_0x3c93('0x6c')](_0xad4578[_0x3c93('0x5c')]);def[_0x3c93('0x57')]=util[_0x3c93('0x21')]('%s/service/v4_1/rest.php',_0xad4578[_0x3c93('0x56')]);if(_0x4a28a8&&_0x4a28a8[_0x3c93('0x6d')]&&_0x4a28a8[_0x3c93('0x6d')]!=='none'){logger['info'](_0x3c93('0x6e'),'Recording\x20is\x20enabled!');_0x332a49[_0x3c93('0x5b')]=util[_0x3c93('0x21')](_0x3c93('0x6f'),_0xad4578[_0x3c93('0x5c')],_0x332a49['uniqueid'],md5(_0x332a49[_0x3c93('0x5d')]));}return getConnection(_0xad4578)[_0x3c93('0x2d')](function(_0x12d6de){_0x254475=_0x12d6de;return getUser(_0xad4578,_0x2b3305[_0x3c93('0xe')],_0x254475);})[_0x3c93('0x2d')](function(_0x381f89){_0x1e3c80=_0x381f89;logger[_0x3c93('0xc')]('The\x20User\x20ID\x20is:',_0x1e3c80['id']);return getEndUser(_0xad4578,_0x332a49[_0x3c93('0x70')],_0x332a49[_0x3c93('0x71')],_0x254475);})[_0x3c93('0x2d')](function(_0x2a5e4c){_0x13f207=_0x2a5e4c;logger[_0x3c93('0xc')](_0x3c93('0x60'),_0x13f207['id']);return getTicket(_0xad4578,_0x1e3c80,_0x13f207,_0x5a4034,_0x332a49,_0x5a4034[_0x3c93('0x72')],_0x254475,'Outbound');})['then'](function(_0x4f6c5f){_0x5b1fe9=_0x4f6c5f;logger['info'](_0x3c93('0x62'));logger[_0x3c93('0xc')](_0x3c93('0x63'),_0x5b1fe9['id']);return setRelationship(_0x254475,_0x1e3c80,_0x5b1fe9,_0x3c93('0x64'));})[_0x3c93('0x2d')](function(){return setRelationship(_0x254475,_0x13f207,_0x5b1fe9,'contacts');})[_0x3c93('0x2d')](function(){return getServerInfo(_0x254475);})[_0x3c93('0x2d')](function(_0x4b0e18){var _0x2fc73a=parseInt(_0x4b0e18[_0x3c93('0x73')][_0x3c93('0x66')](0x0));var _0x193b97=util[_0x3c93('0x21')](_0x3c93('0x74'),_0xad4578['remoteUri'],_0x5b1fe9['id']);if(_0x2fc73a>0x6){_0x193b97=util[_0x3c93('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0xad4578['remoteUri'],_0x5b1fe9['id']);}logger[_0x3c93('0xc')]('[OUTBOUND]',_0x3c93('0x68'));emit(util[_0x3c93('0x21')](_0x3c93('0x69'),_0x2b3305[_0x3c93('0xe')]),_0x3c93('0x6a'),{'uri':_0x193b97});})[_0x3c93('0x6b')](function(_0x317458){logger[_0x3c93('0x75')](_0x3c93('0x6e'),JSON['stringify'](_0x317458));});};exports[_0x3c93('0x76')]=function(_0x55f51c,_0x5c73d7,_0x2d8a0a,_0x29016f,_0xb329af,_0x94d709){var _0x435aa5,_0x527f5c,_0x46bde3,_0x1f04ac;_0x94d709[_0x3c93('0x56')]=intUtil[_0x3c93('0x6c')](_0x94d709[_0x3c93('0x56')]);_0x94d709[_0x3c93('0x5c')]=intUtil['stripTrailingSlash'](_0x94d709[_0x3c93('0x5c')]);def['uri']=util[_0x3c93('0x21')]('%s/service/v4_1/rest.php',_0x94d709[_0x3c93('0x56')]);if(_0xb329af&&_0xb329af[_0x3c93('0x77')]){logger[_0x3c93('0xc')]('['+_0x5c73d7[_0x3c93('0x78')][_0x3c93('0x79')]()+']',_0x3c93('0x5a'));_0x5c73d7['recordingURL']=util['format'](_0x3c93('0x6f'),_0x94d709[_0x3c93('0x5c')],_0x5c73d7[_0x3c93('0x5d')],md5(_0x5c73d7['uniqueid']));}else{_0x5c73d7['recordingURL']='';}return getConnection(_0x94d709)['then'](function(_0x213bf9){_0x1f04ac=_0x213bf9;if(!_[_0x3c93('0x28')](_0x29016f)){return getUser(_0x94d709,_0x29016f[_0x3c93('0xe')],_0x1f04ac);}else{return getUser(_0x94d709,null,_0x1f04ac);}})[_0x3c93('0x2d')](function(_0x77d172){_0x435aa5=_0x77d172;logger[_0x3c93('0xc')](_0x3c93('0x5e'),_0x435aa5['id']);return getEndUser(_0x94d709,_0x5c73d7['calleridname'],_0x5c73d7[_0x3c93('0x5f')],_0x1f04ac);})[_0x3c93('0x2d')](function(_0x33a479){_0x527f5c=_0x33a479;logger[_0x3c93('0xc')](_0x3c93('0x60'),_0x527f5c['id']);return getTicket(_0x94d709,_0x435aa5,_0x527f5c,_0x2d8a0a,_0x5c73d7,_0x2d8a0a['Fields'],_0x1f04ac,_0x3c93('0x61'));})['then'](function(_0x3f5a07){_0x46bde3=_0x3f5a07;logger[_0x3c93('0xc')](_0x3c93('0x62'));logger['info'](_0x3c93('0x63'),_0x46bde3['id']);return setRelationship(_0x1f04ac,_0x435aa5,_0x46bde3,_0x3c93('0x64'));})[_0x3c93('0x2d')](function(){return setRelationship(_0x1f04ac,_0x527f5c,_0x46bde3,'contacts');})[_0x3c93('0x2d')](function(){return getServerInfo(_0x1f04ac);})['catch'](function(_0x1eb3b4){logger[_0x3c93('0x75')]('['+_0x5c73d7[_0x3c93('0x78')]['toUpperCase']()+']',JSON['stringify'](_0x1eb3b4));});}; \ 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 1763cc1..04bd490 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 _0x1d32=['sortBy','type','push','content','variable','variableName','toString','name','Variable','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','customVariable','join','stripTrailingSlash','lastIndexOf','validateEmail','isNil','lodash','util','length'];(function(_0x46068f,_0x35c2f8){var _0x2adf74=function(_0x26f092){while(--_0x26f092){_0x46068f['push'](_0x46068f['shift']());}};_0x2adf74(++_0x35c2f8);}(_0x1d32,0x99));var _0x21d3=function(_0x3ca95b,_0x1645a7){_0x3ca95b=_0x3ca95b-0x0;var _0x468381=_0x1d32[_0x3ca95b];return _0x468381;};'use strict';var _=require(_0x21d3('0x0'));var util=require(_0x21d3('0x1'));exports['getString']=function(_0xfda26,_0x4af9d2,_0x358205){var _0x493c7b=[];if(_0xfda26[_0x21d3('0x2')]>0x0){var _0x388392=_[_0x21d3('0x3')](_0xfda26,['id']);for(var _0x2a20c9=0x0;_0x2a20c9<_0x388392[_0x21d3('0x2')];_0x2a20c9++){var _0x1f044a=_0x388392[_0x2a20c9];if(_0x1f044a[_0x21d3('0x4')]==='string'){_0x493c7b[_0x21d3('0x5')](_0x1f044a[_0x21d3('0x6')]);}else if(_0x1f044a[_0x21d3('0x4')]===_0x21d3('0x7')&&_0x1f044a[_0x21d3('0x8')]){_0x4af9d2[_0x1f044a[_0x21d3('0x8')]]&&_0x493c7b[_0x21d3('0x5')](_0x4af9d2[_0x1f044a[_0x21d3('0x8')]][_0x21d3('0x9')]());}else if(_0x1f044a[_0x21d3('0x4')]==='customVariable'&&_0x1f044a['Variable']&&_0x1f044a['Variable'][_0x21d3('0xa')]){_0x4af9d2[_0x1f044a[_0x21d3('0xb')]['name'][_0x21d3('0xc')]()]&&_0x493c7b[_0x21d3('0x5')](_0x4af9d2[_0x1f044a[_0x21d3('0xb')]['name'][_0x21d3('0xc')]()][_0x21d3('0x9')]());}else if(_0x1f044a[_0x21d3('0x4')]===_0x21d3('0xd')){if(_0x1f044a[_0x21d3('0xe')]===_0x21d3('0xf')&&_0x1f044a[_0x21d3('0x10')]){_0x493c7b[_0x21d3('0x5')](util[_0x21d3('0x11')](_0x21d3('0x12'),_0x1f044a[_0x21d3('0x10')],_0x1f044a[_0x21d3('0x13')]));}else if(_0x1f044a[_0x21d3('0xe')]===_0x21d3('0x7')&&_0x1f044a[_0x21d3('0x8')]&&_0x1f044a[_0x21d3('0x10')]){_0x4af9d2[_0x1f044a[_0x21d3('0x8')]]&&_0x493c7b[_0x21d3('0x5')](util[_0x21d3('0x11')](_0x21d3('0x12'),_0x1f044a[_0x21d3('0x10')],_0x4af9d2[_0x1f044a[_0x21d3('0x8')]]));}else if(_0x1f044a['keyType']===_0x21d3('0x14')&&_0x1f044a['Variable']&&_0x1f044a[_0x21d3('0xb')][_0x21d3('0xa')]&&_0x1f044a[_0x21d3('0x10')]){_0x4af9d2[_0x1f044a[_0x21d3('0xb')]['name'][_0x21d3('0xc')]()]&&_0x493c7b[_0x21d3('0x5')](util['format'](_0x21d3('0x12'),_0x1f044a[_0x21d3('0x10')],_0x4af9d2[_0x1f044a['Variable'][_0x21d3('0xa')]['toLowerCase']()]));}}}}return _0x493c7b[_0x21d3('0x15')](_0x358205);};exports[_0x21d3('0x16')]=function(_0x421bc9){var _0x533b5f=_0x421bc9['slice'](-0x1);if(_0x533b5f==='/'){_0x421bc9=_0x421bc9['substring'](0x0,_0x421bc9[_0x21d3('0x17')](_0x533b5f));}return _0x421bc9;};exports[_0x21d3('0x18')]=function(_0xa5afcf){if(!_[_0x21d3('0x19')](_0xa5afcf)&&_0xa5afcf!==''){var _0xaff140=/^(([^<>()\[\]\\.,;:\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 _0xaff140['test'](String(_0xa5afcf)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x3b96=['length','sortBy','type','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','join','stripTrailingSlash','slice','validateEmail','isNil','test','util','getString'];(function(_0x2ca05a,_0x3467af){var _0x11b01c=function(_0x312994){while(--_0x312994){_0x2ca05a['push'](_0x2ca05a['shift']());}};_0x11b01c(++_0x3467af);}(_0x3b96,0x9a));var _0x63b9=function(_0x405832,_0x10f728){_0x405832=_0x405832-0x0;var _0x138aab=_0x3b96[_0x405832];return _0x138aab;};'use strict';var _=require('lodash');var util=require(_0x63b9('0x0'));exports[_0x63b9('0x1')]=function(_0x1caed8,_0x110e91,_0x212fda){var _0x39c018=[];if(_0x1caed8[_0x63b9('0x2')]>0x0){var _0x5b7346=_[_0x63b9('0x3')](_0x1caed8,['id']);for(var _0x1aaf04=0x0;_0x1aaf04<_0x5b7346['length'];_0x1aaf04++){var _0x16ba10=_0x5b7346[_0x1aaf04];if(_0x16ba10[_0x63b9('0x4')]==='string'){_0x39c018[_0x63b9('0x5')](_0x16ba10[_0x63b9('0x6')]);}else if(_0x16ba10[_0x63b9('0x4')]==='variable'&&_0x16ba10[_0x63b9('0x7')]){_0x110e91[_0x16ba10[_0x63b9('0x7')]]&&_0x39c018['push'](_0x110e91[_0x16ba10['variableName']][_0x63b9('0x8')]());}else if(_0x16ba10['type']===_0x63b9('0x9')&&_0x16ba10[_0x63b9('0xa')]&&_0x16ba10[_0x63b9('0xa')][_0x63b9('0xb')]){_0x110e91[_0x16ba10[_0x63b9('0xa')][_0x63b9('0xb')][_0x63b9('0xc')]()]&&_0x39c018[_0x63b9('0x5')](_0x110e91[_0x16ba10['Variable'][_0x63b9('0xb')]['toLowerCase']()][_0x63b9('0x8')]());}else if(_0x16ba10[_0x63b9('0x4')]===_0x63b9('0xd')){if(_0x16ba10[_0x63b9('0xe')]==='string'&&_0x16ba10[_0x63b9('0xf')]){_0x39c018[_0x63b9('0x5')](util[_0x63b9('0x10')](_0x63b9('0x11'),_0x16ba10['key'],_0x16ba10[_0x63b9('0x12')]));}else if(_0x16ba10[_0x63b9('0xe')]===_0x63b9('0x13')&&_0x16ba10[_0x63b9('0x7')]&&_0x16ba10[_0x63b9('0xf')]){_0x110e91[_0x16ba10[_0x63b9('0x7')]]&&_0x39c018[_0x63b9('0x5')](util[_0x63b9('0x10')](_0x63b9('0x11'),_0x16ba10['key'],_0x110e91[_0x16ba10[_0x63b9('0x7')]]));}else if(_0x16ba10[_0x63b9('0xe')]==='customVariable'&&_0x16ba10[_0x63b9('0xa')]&&_0x16ba10[_0x63b9('0xa')]['name']&&_0x16ba10[_0x63b9('0xf')]){_0x110e91[_0x16ba10['Variable']['name'][_0x63b9('0xc')]()]&&_0x39c018['push'](util['format'](_0x63b9('0x11'),_0x16ba10[_0x63b9('0xf')],_0x110e91[_0x16ba10[_0x63b9('0xa')][_0x63b9('0xb')][_0x63b9('0xc')]()]));}}}}return _0x39c018[_0x63b9('0x14')](_0x212fda);};exports[_0x63b9('0x15')]=function(_0x27742d){var _0x5b479d=_0x27742d[_0x63b9('0x16')](-0x1);if(_0x5b479d==='/'){_0x27742d=_0x27742d['substring'](0x0,_0x27742d['lastIndexOf'](_0x5b479d));}return _0x27742d;};exports[_0x63b9('0x17')]=function(_0x1b8860){if(!_[_0x63b9('0x18')](_0x1b8860)&&_0x1b8860!==''){var _0x329831=/^(([^<>()\[\]\\.,;:\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 _0x329831[_0x63b9('0x19')](String(_0x1b8860)[_0x63b9('0xc')]());}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 caa256e..2c22b5f 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 _0x5c28=['admin','Searching\x20end\x20user\x20with\x20phone','GET','Enduser\x20found!','firstname','lastname','POST','Contacts','Enduser\x20created.','phone','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','destcalleridname','user:%s','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','includes','string','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','getString','Subjects','Descriptions','format','%s/webservice.php','remoteUri','create','HelpDesk','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','stringify','validateEmail','Getting\x20agent\x20with\x20email','query','username','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','success','length','Agent\x20found!','email1','first_name','last_name','getUser','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId'];(function(_0x5da201,_0x24b5c3){var _0x51f615=function(_0x13aa0f){while(--_0x13aa0f){_0x5da201['push'](_0x5da201['shift']());}};_0x51f615(++_0x24b5c3);}(_0x5c28,0x1b8));var _0x85c2=function(_0x5c5f6e,_0x53e22d){_0x5c5f6e=_0x5c5f6e-0x0;var _0x247f39=_0x5c28[_0x5c5f6e];return _0x247f39;};'use strict';var _=require(_0x85c2('0x0'));var rp=require('request-promise');var BPromise=require(_0x85c2('0x1'));var md5=require(_0x85c2('0x2'));var util=require(_0x85c2('0x3'));var Redis=require(_0x85c2('0x4'));var intUtil=require(_0x85c2('0x5'));var config=require(_0x85c2('0x6'));var logger=require(_0x85c2('0x7'))(_0x85c2('0x8'));config[_0x85c2('0x9')]=_['defaults'](config[_0x85c2('0x9')],{'host':_0x85c2('0xa'),'port':0x18eb});var io=require(_0x85c2('0xb'))(new Redis(config['redis']));function emit(_0x47ae90,_0x75db0c,_0x2a0cd){io['to'](_0x47ae90)[_0x85c2('0xc')](_0x75db0c,_0x2a0cd);}function getCustomFields(_0x301df6,_0x5904a2){var _0xcd9201={};if(_0x301df6['length']>0x0){_['forEach'](_0x301df6,function(_0x586fc3){if(_[_0x85c2('0xd')]([_0x85c2('0xe'),'picklist'],_0x586fc3[_0x85c2('0xf')])&&_0x586fc3[_0x85c2('0x10')]){_0xcd9201[_0x586fc3['idField']]=_0x586fc3[_0x85c2('0x11')][_0x85c2('0x12')]();}else if(_0x586fc3['type']==='variable'&&_0x586fc3[_0x85c2('0x13')]&&_0x586fc3['idField']&&_0x5904a2[_0x586fc3[_0x85c2('0x13')]]){_0xcd9201[_0x586fc3['idField']]=_0x5904a2[_0x586fc3['variableName']][_0x85c2('0x12')]();}else if(_0x586fc3[_0x85c2('0xf')]===_0x85c2('0x14')&&_0x586fc3[_0x85c2('0x15')]&&_0x586fc3[_0x85c2('0x15')][_0x85c2('0x16')]&&_0x586fc3[_0x85c2('0x10')]&&_0x5904a2[_0x586fc3[_0x85c2('0x15')][_0x85c2('0x16')]['toLowerCase']()]){_0xcd9201[_0x586fc3[_0x85c2('0x10')]]=_0x5904a2[_0x586fc3[_0x85c2('0x15')][_0x85c2('0x16')][_0x85c2('0x17')]()]['toString']();}});}return _0xcd9201;}function createTicket(_0x2eed5d,_0x4b60df,_0x2c1fef,_0x28957d,_0xc23695,_0x2bff9c,_0x28a34e){logger[_0x85c2('0x18')](_0x85c2('0x19'));var _0x22f188=_[_0x85c2('0x1a')]({'parent_id':'','assigned_user_id':_0x4b60df['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0x85c2('0x1b')](_0x28957d[_0x85c2('0x1c')],_0xc23695,'\x20'),'description':intUtil[_0x85c2('0x1b')](_0x28957d[_0x85c2('0x1d')],_0xc23695,'\x0a'),'contact_id':_0x2c1fef['id']},getCustomFields(_0x2bff9c,_0xc23695));var _0x108d5d={'method':'POST','uri':util[_0x85c2('0x1e')](_0x85c2('0x1f'),_0x2eed5d[_0x85c2('0x20')]),'form':{'operation':_0x85c2('0x21'),'username':_0x2eed5d['username'],'sessionName':_0x28a34e['sessionName'],'elementType':_0x85c2('0x22'),'element':JSON['stringify'](_0x22f188)},'json':!![]};return request(_0x108d5d)['then'](function(_0x3f3273){if(_0x3f3273['success']){return BPromise[_0x85c2('0x23')]({'id':_0x3f3273[_0x85c2('0x24')]['id']});}else{throw new Error(util[_0x85c2('0x1e')](_0x85c2('0x25'),JSON['stringify'](_0x3f3273[_0x85c2('0x26')])));}})[_0x85c2('0x27')](function(_0x3f4c97){var _0x3aaf32=_0x3f4c97[_0x85c2('0x28')]||0x1f4;logger['error'](_0x85c2('0x29'),_0x85c2('0x2a'),_0x3aaf32,JSON[_0x85c2('0x2b')](_0x3f4c97));});}function getUser(_0xe66e3,_0x141198,_0x33a438){if(intUtil[_0x85c2('0x2c')](_0x141198)){logger[_0x85c2('0x18')](_0x85c2('0x2d'),_0x141198);return request({'method':'GET','uri':util[_0x85c2('0x1e')](_0x85c2('0x1f'),_0xe66e3[_0x85c2('0x20')]),'qs':{'operation':_0x85c2('0x2e'),'username':_0xe66e3[_0x85c2('0x2f')],'sessionName':_0x33a438[_0x85c2('0x30')],'query':util['format'](_0x85c2('0x31'),_0x141198)},'json':!![]})[_0x85c2('0x32')](function(_0x5e8d86){if(_0x5e8d86[_0x85c2('0x33')]&&_0x5e8d86[_0x85c2('0x24')][_0x85c2('0x34')]){logger['info'](_0x85c2('0x35'));return BPromise[_0x85c2('0x23')]({'id':_0x5e8d86[_0x85c2('0x24')][0x0]['id'],'email':_0x5e8d86[_0x85c2('0x24')][0x0][_0x85c2('0x36')],'name':_0x5e8d86[_0x85c2('0x24')][0x0][_0x85c2('0x37')]+'\x20'+_0x5e8d86[_0x85c2('0x24')][_0x85c2('0x38')]});}else{logger[_0x85c2('0x18')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x85c2('0x23')]({'id':_0x33a438['userId'],'email':_0xe66e3[_0x85c2('0x2f')],'name':'admin'});}})[_0x85c2('0x27')](function(_0x5a9045){var _0x117b04=_0x5a9045[_0x85c2('0x28')]||0x1f4;logger[_0x85c2('0x26')](_0x85c2('0x29'),_0x85c2('0x39'),_0x117b04,JSON['stringify'](_0x5a9045));});}else{logger[_0x85c2('0x18')](_0x85c2('0x3a'));return BPromise[_0x85c2('0x23')]({'id':_0x33a438[_0x85c2('0x3b')],'email':_0xe66e3[_0x85c2('0x2f')],'name':_0x85c2('0x3c')})['catch'](function(_0x2a7193){var _0x43451c=_0x2a7193['statusCode']||0x1f4;logger[_0x85c2('0x26')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x85c2('0x39'),_0x43451c,JSON['stringify'](_0x2a7193));});}}function getEndUser(_0x347e4e,_0x2dabbc,_0x5f3372,_0x259208){logger[_0x85c2('0x18')](_0x85c2('0x3d'),_0x5f3372);return request({'method':_0x85c2('0x3e'),'uri':util[_0x85c2('0x1e')]('%s/webservice.php',_0x347e4e['remoteUri']),'qs':{'operation':_0x85c2('0x2e'),'username':_0x347e4e[_0x85c2('0x2f')],'sessionName':_0x259208[_0x85c2('0x30')],'query':util[_0x85c2('0x1e')]('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;',_0x5f3372,_0x5f3372,_0x5f3372,_0x5f3372,_0x5f3372)},'json':!![]})[_0x85c2('0x32')](function(_0x1c26f8){if(_0x1c26f8['success']&&_0x1c26f8[_0x85c2('0x24')][_0x85c2('0x34')]){logger[_0x85c2('0x18')](_0x85c2('0x3f'));return BPromise[_0x85c2('0x23')]({'id':_0x1c26f8[_0x85c2('0x24')][0x0]['id'],'name':_0x1c26f8[_0x85c2('0x24')][0x0][_0x85c2('0x40')]+'\x20'+_0x1c26f8[_0x85c2('0x24')][0x0][_0x85c2('0x41')],'phone':_0x5f3372});}else{logger[_0x85c2('0x18')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x85c2('0x42'),'uri':util[_0x85c2('0x1e')]('%s/webservice.php',_0x347e4e[_0x85c2('0x20')]),'form':{'operation':_0x85c2('0x21'),'sessionName':_0x259208[_0x85c2('0x30')],'elementType':_0x85c2('0x43'),'element':JSON[_0x85c2('0x2b')]({'lastname':_0x2dabbc,'phone':_0x5f3372,'assigned_user_id':'\x20'})},'json':!![]})[_0x85c2('0x32')](function(_0x34094e){logger[_0x85c2('0x18')](_0x85c2('0x44'));return BPromise['resolve']({'id':_0x34094e[_0x85c2('0x24')]['id'],'name':_0x34094e[_0x85c2('0x24')]['lastname'],'phone':_0x34094e[_0x85c2('0x24')][_0x85c2('0x45')]});})[_0x85c2('0x27')](function(_0x5e9601){var _0x3e5cb8=_0x5e9601[_0x85c2('0x28')]||0x1f4;logger[_0x85c2('0x26')]('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x3e5cb8,JSON['stringify'](_0x5e9601));});}});}function getConnection(_0x33b633){var _0xc8d2=_0x33b633['username'];var _0x54e095=_0x33b633['accessKey'];return request({'method':_0x85c2('0x3e'),'uri':util[_0x85c2('0x1e')](_0x85c2('0x1f'),_0x33b633['remoteUri']),'qs':{'operation':_0x85c2('0x46'),'username':_0xc8d2},'json':!![]})[_0x85c2('0x32')](function(_0x1653e4){if(_0x1653e4[_0x85c2('0x33')]){return request({'method':_0x85c2('0x42'),'uri':util[_0x85c2('0x1e')](_0x85c2('0x1f'),_0x33b633[_0x85c2('0x20')]),'form':{'operation':_0x85c2('0x47'),'username':_0xc8d2,'accessKey':md5(_0x1653e4[_0x85c2('0x24')][_0x85c2('0x48')]+_0x54e095)},'json':!![]});}})[_0x85c2('0x32')](function(_0x51f006){if(_0x51f006['success']){return BPromise['resolve'](_0x51f006[_0x85c2('0x24')]);}else{throw new Error(util['format'](_0x85c2('0x49'),_0x33b633['id']));}})[_0x85c2('0x27')](function(_0x276bc6){var _0x49101e=_0x276bc6[_0x85c2('0x28')]||0x1f4;logger[_0x85c2('0x26')](_0x85c2('0x29'),_0x85c2('0x4a'),_0x49101e,JSON[_0x85c2('0x2b')](_0x276bc6));});}function request(_0x22c946){logger['info']('[HTTP]',JSON[_0x85c2('0x2b')](_0x22c946));return rp(_0x22c946);}exports[_0x85c2('0x4b')]=function(_0x2cd5d4,_0x411eac,_0x440955,_0x5aa27a,_0x1d8c7b,_0x331330){var _0xdd29c2,_0x33ff31,_0x4fa123,_0xa88d55;_0x331330[_0x85c2('0x20')]=intUtil['stripTrailingSlash'](_0x331330['remoteUri']);if(_0x1d8c7b&&_0x1d8c7b['monitor_format']){logger[_0x85c2('0x18')](_0x85c2('0x4c'),'Recording\x20is\x20enabled!');_0x411eac[_0x85c2('0x4d')]=util['format'](_0x85c2('0x4e'),_0x331330[_0x85c2('0x4f')],_0x411eac[_0x85c2('0x50')],md5(_0x411eac[_0x85c2('0x50')]));}else{_0x411eac['recordingURL']='';}return getConnection(_0x331330)[_0x85c2('0x32')](function(_0x205c94){_0xa88d55=_0x205c94;return getUser(_0x331330,_0x5aa27a[_0x85c2('0x51')],_0xa88d55);})[_0x85c2('0x32')](function(_0x2c8aac){_0xdd29c2=_0x2c8aac;logger[_0x85c2('0x18')]('The\x20User\x20ID\x20is:',_0xdd29c2['id']);return getEndUser(_0x331330,_0x411eac[_0x85c2('0x52')],_0x411eac[_0x85c2('0x53')],_0xa88d55);})['then'](function(_0x569bec){_0x33ff31=_0x569bec;logger['info'](_0x85c2('0x54'),_0x33ff31['id']);return createTicket(_0x331330,_0xdd29c2,_0x33ff31,_0x440955,_0x411eac,_0x440955[_0x85c2('0x55')],_0xa88d55);})[_0x85c2('0x32')](function(_0xf9c1e5){_0x4fa123=_0xf9c1e5;logger[_0x85c2('0x18')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x4fa123['id']);var _0x11d647=util[_0x85c2('0x1e')](_0x85c2('0x56'),_0x331330[_0x85c2('0x20')],_[_0x85c2('0x57')](_0x4fa123['id'],'x')[0x1]);logger['info'](_0x85c2('0x4c'),_0x85c2('0x58'));emit(util[_0x85c2('0x1e')]('user:%s',_0x5aa27a[_0x85c2('0x16')]),_0x85c2('0x59'),{'uri':_0x11d647});})[_0x85c2('0x27')](function(_0x4eedf8){logger[_0x85c2('0x26')](_0x85c2('0x4c'),JSON[_0x85c2('0x2b')](_0x4eedf8));});};exports[_0x85c2('0x5a')]=function(_0x2cbf31,_0x5b36da,_0x17bea4,_0x4ff9f0,_0x298680,_0x4daa89,_0x43c569){var _0x3f2989,_0x28aba2,_0x52d713,_0x251df8;_0x4daa89[_0x85c2('0x20')]=intUtil[_0x85c2('0x5b')](_0x4daa89[_0x85c2('0x20')]);_0x4daa89[_0x85c2('0x4f')]=intUtil[_0x85c2('0x5b')](_0x4daa89['serverUrl']);if(_0x43c569&&_0x43c569[_0x85c2('0x5c')]&&_0x43c569[_0x85c2('0x5c')]!=='none'){logger['info'](_0x85c2('0x5d'),'Recording\x20is\x20enabled!');_0x5b36da[_0x85c2('0x4d')]=util[_0x85c2('0x1e')](_0x85c2('0x4e'),_0x4daa89[_0x85c2('0x4f')],_0x5b36da[_0x85c2('0x50')],md5(_0x5b36da[_0x85c2('0x50')]));}return getConnection(_0x4daa89)[_0x85c2('0x32')](function(_0x3a3390){_0x251df8=_0x3a3390;return getUser(_0x4daa89,_0x4ff9f0[_0x85c2('0x51')],_0x251df8);})[_0x85c2('0x32')](function(_0x55aad3){_0x3f2989=_0x55aad3;logger['info']('The\x20User\x20ID\x20is:',_0x3f2989['id']);return getEndUser(_0x4daa89,_0x5b36da[_0x85c2('0x5e')],_0x5b36da['destcalleridnum'],_0x251df8);})[_0x85c2('0x32')](function(_0x9bc960){_0x28aba2=_0x9bc960;logger[_0x85c2('0x18')](_0x85c2('0x54'),_0x28aba2['id']);return createTicket(_0x4daa89,_0x3f2989,_0x28aba2,_0x17bea4,_0x5b36da,_0x17bea4[_0x85c2('0x55')],_0x251df8);})[_0x85c2('0x32')](function(_0x298946){_0x52d713=_0x298946;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x52d713['id']);var _0x6d7b8a=util[_0x85c2('0x1e')](_0x85c2('0x56'),_0x4daa89[_0x85c2('0x20')],_['split'](_0x52d713['id'],'x')[0x1]);logger[_0x85c2('0x18')](_0x85c2('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x85c2('0x5f'),_0x4ff9f0[_0x85c2('0x16')]),_0x85c2('0x59'),{'uri':_0x6d7b8a});})[_0x85c2('0x27')](function(_0x3ed2d6){logger[_0x85c2('0x26')](_0x85c2('0x5d'),JSON[_0x85c2('0x2b')](_0x3ed2d6));});};exports['unmanaged']=function(_0x4d7633,_0x2cbc31,_0x20994f,_0x37bdff,_0x3415bb,_0x9ab3ed){var _0x224b12,_0x501e22,_0x11f5c5,_0x570477;_0x9ab3ed[_0x85c2('0x20')]=intUtil[_0x85c2('0x5b')](_0x9ab3ed[_0x85c2('0x20')]);_0x9ab3ed[_0x85c2('0x4f')]=intUtil['stripTrailingSlash'](_0x9ab3ed[_0x85c2('0x4f')]);if(_0x3415bb&&_0x3415bb[_0x85c2('0x60')]){logger['info']('['+_0x2cbc31[_0x85c2('0x61')][_0x85c2('0x62')]()+']',_0x85c2('0x63'));_0x2cbc31['recordingURL']=util[_0x85c2('0x1e')](_0x85c2('0x4e'),_0x9ab3ed[_0x85c2('0x4f')],_0x2cbc31[_0x85c2('0x50')],md5(_0x2cbc31[_0x85c2('0x50')]));}else{_0x2cbc31['recordingURL']='';}return getConnection(_0x9ab3ed)[_0x85c2('0x32')](function(_0x330105){_0x570477=_0x330105;return getUser(_0x9ab3ed,'',_0x570477);})[_0x85c2('0x32')](function(_0xc2c15b){_0x224b12=_0xc2c15b;logger[_0x85c2('0x18')]('The\x20User\x20ID\x20is:',_0x224b12['id']);return getEndUser(_0x9ab3ed,_0x2cbc31[_0x85c2('0x52')],_0x2cbc31[_0x85c2('0x53')],_0x570477);})[_0x85c2('0x32')](function(_0x35ea93){_0x501e22=_0x35ea93;logger['info'](_0x85c2('0x54'),_0x501e22['id']);return createTicket(_0x9ab3ed,_0x224b12,_0x501e22,_0x20994f,_0x2cbc31,_0x20994f[_0x85c2('0x55')],_0x570477);})[_0x85c2('0x32')](function(_0x150c31){_0x11f5c5=_0x150c31;logger[_0x85c2('0x18')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x11f5c5['id']);})[_0x85c2('0x27')](function(_0x3826f0){logger[_0x85c2('0x26')]('['+_0x2cbc31[_0x85c2('0x61')][_0x85c2('0x62')]()+']',JSON['stringify'](_0x3826f0));});}; \ No newline at end of file +var _0xc891=['phone','catch','getEndUser','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','unmanaged','lastevent','toUpperCase','lodash','md5','ioredis','./util','../../../../config/environment','vTiger','redis','defaults','socket.io-emitter','string','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','getString','Subjects','Descriptions','POST','format','remoteUri','create','username','HelpDesk','stringify','then','success','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','statusCode','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','lastname','Contacts','Enduser\x20created.'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0xc891,0x152));var _0x1c89=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xc891[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x1c89('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x1c89('0x1'));var util=require('util');var Redis=require(_0x1c89('0x2'));var intUtil=require(_0x1c89('0x3'));var config=require(_0x1c89('0x4'));var logger=require('../../../../config/logger')(_0x1c89('0x5'));config[_0x1c89('0x6')]=_[_0x1c89('0x7')](config[_0x1c89('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1c89('0x8'))(new Redis(config[_0x1c89('0x6')]));function emit(_0x4cbacb,_0x44b3cf,_0x300289){io['to'](_0x4cbacb)['emit'](_0x44b3cf,_0x300289);}function getCustomFields(_0x1a3e57,_0x4e9b16){var _0x21f69d={};if(_0x1a3e57['length']>0x0){_['forEach'](_0x1a3e57,function(_0x4c69e3){if(_['includes']([_0x1c89('0x9'),'picklist'],_0x4c69e3[_0x1c89('0xa')])&&_0x4c69e3[_0x1c89('0xb')]){_0x21f69d[_0x4c69e3[_0x1c89('0xb')]]=_0x4c69e3[_0x1c89('0xc')][_0x1c89('0xd')]();}else if(_0x4c69e3[_0x1c89('0xa')]===_0x1c89('0xe')&&_0x4c69e3[_0x1c89('0xf')]&&_0x4c69e3['idField']&&_0x4e9b16[_0x4c69e3[_0x1c89('0xf')]]){_0x21f69d[_0x4c69e3['idField']]=_0x4e9b16[_0x4c69e3[_0x1c89('0xf')]][_0x1c89('0xd')]();}else if(_0x4c69e3[_0x1c89('0xa')]==='customVariable'&&_0x4c69e3[_0x1c89('0x10')]&&_0x4c69e3[_0x1c89('0x10')][_0x1c89('0x11')]&&_0x4c69e3['idField']&&_0x4e9b16[_0x4c69e3[_0x1c89('0x10')][_0x1c89('0x11')][_0x1c89('0x12')]()]){_0x21f69d[_0x4c69e3[_0x1c89('0xb')]]=_0x4e9b16[_0x4c69e3[_0x1c89('0x10')][_0x1c89('0x11')][_0x1c89('0x12')]()][_0x1c89('0xd')]();}});}return _0x21f69d;}function createTicket(_0x166444,_0x35bd99,_0x2d2e23,_0x52ec5c,_0x18ce93,_0x3003c1,_0x4c9069){logger[_0x1c89('0x13')](_0x1c89('0x14'));var _0x14121c=_[_0x1c89('0x15')]({'parent_id':'','assigned_user_id':_0x35bd99['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0x1c89('0x16')](_0x52ec5c[_0x1c89('0x17')],_0x18ce93,'\x20'),'description':intUtil[_0x1c89('0x16')](_0x52ec5c[_0x1c89('0x18')],_0x18ce93,'\x0a'),'contact_id':_0x2d2e23['id']},getCustomFields(_0x3003c1,_0x18ce93));var _0x5b4fbc={'method':_0x1c89('0x19'),'uri':util[_0x1c89('0x1a')]('%s/webservice.php',_0x166444[_0x1c89('0x1b')]),'form':{'operation':_0x1c89('0x1c'),'username':_0x166444[_0x1c89('0x1d')],'sessionName':_0x4c9069['sessionName'],'elementType':_0x1c89('0x1e'),'element':JSON[_0x1c89('0x1f')](_0x14121c)},'json':!![]};return request(_0x5b4fbc)[_0x1c89('0x20')](function(_0x59a87e){if(_0x59a87e[_0x1c89('0x21')]){return BPromise['resolve']({'id':_0x59a87e['result']['id']});}else{throw new Error(util[_0x1c89('0x1a')](_0x1c89('0x22'),JSON['stringify'](_0x59a87e['error'])));}})['catch'](function(_0x1d40e1){var _0x5ce91f=_0x1d40e1['statusCode']||0x1f4;logger[_0x1c89('0x23')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x1c89('0x24'),_0x5ce91f,JSON['stringify'](_0x1d40e1));});}function getUser(_0x4dac46,_0x25500d,_0x10dc12){if(intUtil[_0x1c89('0x25')](_0x25500d)){logger['info'](_0x1c89('0x26'),_0x25500d);return request({'method':_0x1c89('0x27'),'uri':util['format'](_0x1c89('0x28'),_0x4dac46['remoteUri']),'qs':{'operation':_0x1c89('0x29'),'username':_0x4dac46[_0x1c89('0x1d')],'sessionName':_0x10dc12[_0x1c89('0x2a')],'query':util[_0x1c89('0x1a')](_0x1c89('0x2b'),_0x25500d)},'json':!![]})[_0x1c89('0x20')](function(_0x3a0190){if(_0x3a0190[_0x1c89('0x21')]&&_0x3a0190[_0x1c89('0x2c')][_0x1c89('0x2d')]){logger['info'](_0x1c89('0x2e'));return BPromise['resolve']({'id':_0x3a0190['result'][0x0]['id'],'email':_0x3a0190[_0x1c89('0x2c')][0x0][_0x1c89('0x2f')],'name':_0x3a0190[_0x1c89('0x2c')][0x0][_0x1c89('0x30')]+'\x20'+_0x3a0190[_0x1c89('0x2c')][_0x1c89('0x31')]});}else{logger[_0x1c89('0x13')](_0x1c89('0x32'));return BPromise[_0x1c89('0x33')]({'id':_0x10dc12[_0x1c89('0x34')],'email':_0x4dac46[_0x1c89('0x1d')],'name':'admin'});}})['catch'](function(_0x5bf65f){var _0x495a4a=_0x5bf65f['statusCode']||0x1f4;logger[_0x1c89('0x23')](_0x1c89('0x35'),_0x1c89('0x36'),_0x495a4a,JSON[_0x1c89('0x1f')](_0x5bf65f));});}else{logger[_0x1c89('0x13')](_0x1c89('0x32'));return BPromise[_0x1c89('0x33')]({'id':_0x10dc12['userId'],'email':_0x4dac46[_0x1c89('0x1d')],'name':_0x1c89('0x37')})['catch'](function(_0xb0ff02){var _0x3f6ce0=_0xb0ff02[_0x1c89('0x38')]||0x1f4;logger[_0x1c89('0x23')](_0x1c89('0x35'),'getUser',_0x3f6ce0,JSON[_0x1c89('0x1f')](_0xb0ff02));});}}function getEndUser(_0x2e6ebd,_0x31375a,_0x5324e8,_0xed5122){logger['info'](_0x1c89('0x39'),_0x5324e8);return request({'method':'GET','uri':util[_0x1c89('0x1a')](_0x1c89('0x28'),_0x2e6ebd[_0x1c89('0x1b')]),'qs':{'operation':_0x1c89('0x29'),'username':_0x2e6ebd[_0x1c89('0x1d')],'sessionName':_0xed5122[_0x1c89('0x2a')],'query':util[_0x1c89('0x1a')](_0x1c89('0x3a'),_0x5324e8,_0x5324e8,_0x5324e8,_0x5324e8,_0x5324e8)},'json':!![]})[_0x1c89('0x20')](function(_0x4a2d18){if(_0x4a2d18[_0x1c89('0x21')]&&_0x4a2d18[_0x1c89('0x2c')][_0x1c89('0x2d')]){logger[_0x1c89('0x13')]('Enduser\x20found!');return BPromise[_0x1c89('0x33')]({'id':_0x4a2d18[_0x1c89('0x2c')][0x0]['id'],'name':_0x4a2d18[_0x1c89('0x2c')][0x0]['firstname']+'\x20'+_0x4a2d18['result'][0x0][_0x1c89('0x3b')],'phone':_0x5324e8});}else{logger[_0x1c89('0x13')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x1c89('0x19'),'uri':util[_0x1c89('0x1a')](_0x1c89('0x28'),_0x2e6ebd[_0x1c89('0x1b')]),'form':{'operation':_0x1c89('0x1c'),'sessionName':_0xed5122[_0x1c89('0x2a')],'elementType':_0x1c89('0x3c'),'element':JSON['stringify']({'lastname':_0x31375a,'phone':_0x5324e8,'assigned_user_id':'\x20'})},'json':!![]})[_0x1c89('0x20')](function(_0x517da1){logger['info'](_0x1c89('0x3d'));return BPromise[_0x1c89('0x33')]({'id':_0x517da1[_0x1c89('0x2c')]['id'],'name':_0x517da1[_0x1c89('0x2c')][_0x1c89('0x3b')],'phone':_0x517da1[_0x1c89('0x2c')][_0x1c89('0x3e')]});})[_0x1c89('0x3f')](function(_0x413a68){var _0x36fcbe=_0x413a68[_0x1c89('0x38')]||0x1f4;logger[_0x1c89('0x23')](_0x1c89('0x35'),_0x1c89('0x40'),_0x36fcbe,JSON[_0x1c89('0x1f')](_0x413a68));});}});}function getConnection(_0x29265f){var _0x5ef833=_0x29265f[_0x1c89('0x1d')];var _0x4dbb87=_0x29265f['accessKey'];return request({'method':_0x1c89('0x27'),'uri':util['format']('%s/webservice.php',_0x29265f[_0x1c89('0x1b')]),'qs':{'operation':_0x1c89('0x41'),'username':_0x5ef833},'json':!![]})[_0x1c89('0x20')](function(_0x4c8e9f){if(_0x4c8e9f[_0x1c89('0x21')]){return request({'method':'POST','uri':util[_0x1c89('0x1a')]('%s/webservice.php',_0x29265f[_0x1c89('0x1b')]),'form':{'operation':'login','username':_0x5ef833,'accessKey':md5(_0x4c8e9f[_0x1c89('0x2c')][_0x1c89('0x42')]+_0x4dbb87)},'json':!![]});}})[_0x1c89('0x20')](function(_0x47dc6f){if(_0x47dc6f[_0x1c89('0x21')]){return BPromise[_0x1c89('0x33')](_0x47dc6f['result']);}else{throw new Error(util['format'](_0x1c89('0x43'),_0x29265f['id']));}})[_0x1c89('0x3f')](function(_0x68b83e){var _0x3cc93e=_0x68b83e[_0x1c89('0x38')]||0x1f4;logger[_0x1c89('0x23')](_0x1c89('0x35'),_0x1c89('0x44'),_0x3cc93e,JSON[_0x1c89('0x1f')](_0x68b83e));});}function request(_0x2dcfc4){logger[_0x1c89('0x13')](_0x1c89('0x45'),JSON[_0x1c89('0x1f')](_0x2dcfc4));return rp(_0x2dcfc4);}exports[_0x1c89('0x46')]=function(_0x190bf6,_0x2ff174,_0x13daee,_0x1d61a3,_0x1e6714,_0x356292){var _0x57409c,_0x773a16,_0x1a2b06,_0x3ef99d;_0x356292[_0x1c89('0x1b')]=intUtil[_0x1c89('0x47')](_0x356292[_0x1c89('0x1b')]);if(_0x1e6714&&_0x1e6714[_0x1c89('0x48')]){logger[_0x1c89('0x13')]('[QUEUE]',_0x1c89('0x49'));_0x2ff174[_0x1c89('0x4a')]=util[_0x1c89('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x356292[_0x1c89('0x4b')],_0x2ff174[_0x1c89('0x4c')],md5(_0x2ff174[_0x1c89('0x4c')]));}else{_0x2ff174['recordingURL']='';}return getConnection(_0x356292)[_0x1c89('0x20')](function(_0x3367d3){_0x3ef99d=_0x3367d3;return getUser(_0x356292,_0x1d61a3['email'],_0x3ef99d);})['then'](function(_0x49c3b9){_0x57409c=_0x49c3b9;logger[_0x1c89('0x13')](_0x1c89('0x4d'),_0x57409c['id']);return getEndUser(_0x356292,_0x2ff174[_0x1c89('0x4e')],_0x2ff174[_0x1c89('0x4f')],_0x3ef99d);})[_0x1c89('0x20')](function(_0x3176d1){_0x773a16=_0x3176d1;logger[_0x1c89('0x13')]('The\x20Enduser\x20ID\x20is:',_0x773a16['id']);return createTicket(_0x356292,_0x57409c,_0x773a16,_0x13daee,_0x2ff174,_0x13daee['Fields'],_0x3ef99d);})[_0x1c89('0x20')](function(_0x1d4822){_0x1a2b06=_0x1d4822;logger[_0x1c89('0x13')](_0x1c89('0x50'));logger[_0x1c89('0x13')](_0x1c89('0x51'),_0x1a2b06['id']);var _0x1bdc34=util[_0x1c89('0x1a')](_0x1c89('0x52'),_0x356292[_0x1c89('0x1b')],_[_0x1c89('0x53')](_0x1a2b06['id'],'x')[0x1]);logger['info'](_0x1c89('0x54'),_0x1c89('0x55'));emit(util[_0x1c89('0x1a')](_0x1c89('0x56'),_0x1d61a3[_0x1c89('0x11')]),_0x1c89('0x57'),{'uri':_0x1bdc34});})['catch'](function(_0x3acc56){logger[_0x1c89('0x23')](_0x1c89('0x54'),JSON[_0x1c89('0x1f')](_0x3acc56));});};exports[_0x1c89('0x58')]=function(_0x53db32,_0x3b218f,_0x388cfb,_0x3fe3bc,_0x22b74b,_0x276101,_0xcdddd0){var _0x707a0c,_0x2862dd,_0xba5a0f,_0x5d7c23;_0x276101[_0x1c89('0x1b')]=intUtil[_0x1c89('0x47')](_0x276101[_0x1c89('0x1b')]);_0x276101[_0x1c89('0x4b')]=intUtil['stripTrailingSlash'](_0x276101[_0x1c89('0x4b')]);if(_0xcdddd0&&_0xcdddd0['recordingFormat']&&_0xcdddd0[_0x1c89('0x59')]!=='none'){logger[_0x1c89('0x13')](_0x1c89('0x5a'),_0x1c89('0x49'));_0x3b218f[_0x1c89('0x4a')]=util[_0x1c89('0x1a')](_0x1c89('0x5b'),_0x276101[_0x1c89('0x4b')],_0x3b218f[_0x1c89('0x4c')],md5(_0x3b218f[_0x1c89('0x4c')]));}return getConnection(_0x276101)[_0x1c89('0x20')](function(_0x9a41d6){_0x5d7c23=_0x9a41d6;return getUser(_0x276101,_0x3fe3bc[_0x1c89('0x5c')],_0x5d7c23);})[_0x1c89('0x20')](function(_0xf35984){_0x707a0c=_0xf35984;logger[_0x1c89('0x13')](_0x1c89('0x4d'),_0x707a0c['id']);return getEndUser(_0x276101,_0x3b218f[_0x1c89('0x5d')],_0x3b218f[_0x1c89('0x5e')],_0x5d7c23);})['then'](function(_0x293f8b){_0x2862dd=_0x293f8b;logger['info'](_0x1c89('0x5f'),_0x2862dd['id']);return createTicket(_0x276101,_0x707a0c,_0x2862dd,_0x388cfb,_0x3b218f,_0x388cfb[_0x1c89('0x60')],_0x5d7c23);})[_0x1c89('0x20')](function(_0x3f3ac3){_0xba5a0f=_0x3f3ac3;logger[_0x1c89('0x13')](_0x1c89('0x50'));logger['info'](_0x1c89('0x51'),_0xba5a0f['id']);var _0x25d15b=util[_0x1c89('0x1a')](_0x1c89('0x52'),_0x276101[_0x1c89('0x1b')],_[_0x1c89('0x53')](_0xba5a0f['id'],'x')[0x1]);logger[_0x1c89('0x13')](_0x1c89('0x5a'),_0x1c89('0x55'));emit(util[_0x1c89('0x1a')](_0x1c89('0x56'),_0x3fe3bc[_0x1c89('0x11')]),_0x1c89('0x57'),{'uri':_0x25d15b});})[_0x1c89('0x3f')](function(_0x53c2e4){logger[_0x1c89('0x23')](_0x1c89('0x5a'),JSON['stringify'](_0x53c2e4));});};exports[_0x1c89('0x61')]=function(_0x3c099b,_0x3f9b32,_0x4caf59,_0x10c260,_0x5c8c94,_0x811e3c){var _0xa94080,_0x53dac6,_0x45b887,_0x5834d0;_0x811e3c[_0x1c89('0x1b')]=intUtil['stripTrailingSlash'](_0x811e3c[_0x1c89('0x1b')]);_0x811e3c[_0x1c89('0x4b')]=intUtil[_0x1c89('0x47')](_0x811e3c[_0x1c89('0x4b')]);if(_0x5c8c94&&_0x5c8c94[_0x1c89('0x48')]){logger['info']('['+_0x3f9b32[_0x1c89('0x62')][_0x1c89('0x63')]()+']',_0x1c89('0x49'));_0x3f9b32[_0x1c89('0x4a')]=util[_0x1c89('0x1a')](_0x1c89('0x5b'),_0x811e3c['serverUrl'],_0x3f9b32['uniqueid'],md5(_0x3f9b32[_0x1c89('0x4c')]));}else{_0x3f9b32['recordingURL']='';}return getConnection(_0x811e3c)['then'](function(_0x512924){_0x5834d0=_0x512924;return getUser(_0x811e3c,'',_0x5834d0);})['then'](function(_0x2a9327){_0xa94080=_0x2a9327;logger[_0x1c89('0x13')](_0x1c89('0x4d'),_0xa94080['id']);return getEndUser(_0x811e3c,_0x3f9b32[_0x1c89('0x4e')],_0x3f9b32[_0x1c89('0x4f')],_0x5834d0);})[_0x1c89('0x20')](function(_0x59fa42){_0x53dac6=_0x59fa42;logger[_0x1c89('0x13')](_0x1c89('0x5f'),_0x53dac6['id']);return createTicket(_0x811e3c,_0xa94080,_0x53dac6,_0x4caf59,_0x3f9b32,_0x4caf59[_0x1c89('0x60')],_0x5834d0);})[_0x1c89('0x20')](function(_0x492498){_0x45b887=_0x492498;logger[_0x1c89('0x13')](_0x1c89('0x50'));logger[_0x1c89('0x13')](_0x1c89('0x51'),_0x45b887['id']);})[_0x1c89('0x3f')](function(_0x30db82){logger[_0x1c89('0x23')]('['+_0x3f9b32[_0x1c89('0x62')][_0x1c89('0x63')]()+']',JSON['stringify'](_0x30db82));});}; \ 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 efe8735..26d9187 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 _0xc28d=['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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','user:%s','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','info','validateEmail','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','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','includes','string','picklist','type','nameField','toLowerCase','content','custom_fields','push','idField','variable','variableName','customVariable','Variable','name','customField','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email'];(function(_0x5abe6b,_0x3e1e3d){var _0x13b26c=function(_0x5af559){while(--_0x5af559){_0x5abe6b['push'](_0x5abe6b['shift']());}};_0x13b26c(++_0x3e1e3d);}(_0xc28d,0x1c9));var _0xdc28=function(_0x5be795,_0x1cb1b8){_0x5be795=_0x5be795-0x0;var _0x4e8a3b=_0xc28d[_0x5be795];return _0x4e8a3b;};'use strict';var _=require(_0xdc28('0x0'));var rp=require(_0xdc28('0x1'));var md5=require(_0xdc28('0x2'));var util=require(_0xdc28('0x3'));var Redis=require('ioredis');var intUtil=require(_0xdc28('0x4'));var config=require(_0xdc28('0x5'));var logger=require('../../../../config/logger')(_0xdc28('0x6'));config[_0xdc28('0x7')]=_[_0xdc28('0x8')](config[_0xdc28('0x7')],{'host':_0xdc28('0x9'),'port':0x18eb});var io=require(_0xdc28('0xa'))(new Redis(config[_0xdc28('0x7')]));function emit(_0x8024af,_0x558277,_0x491875){io['to'](_0x8024af)['emit'](_0x558277,_0x491875);}var headers={'Content-Type':_0xdc28('0xb'),'Accept':'application/json'};function getTicket(_0x403198,_0x304922,_0x5ba09f,_0x2d64e3,_0x3ab42d){logger['info'](_0xdc28('0xc'));return request({'uri':util[_0xdc28('0xd')](_0xdc28('0xe'),_0x403198[_0xdc28('0xf')]),'method':_0xdc28('0x10'),'body':{'ticket':_[_0xdc28('0x11')]({'requester_id':_0x5ba09f['id'],'submitter_id':_0x304922?_0x304922['id']:undefined,'assignee_id':_0x304922?_0x304922['id']:undefined,'tags':getTags(_0x2d64e3[_0xdc28('0x12')],'name'),'subject':intUtil[_0xdc28('0x13')](_0x2d64e3[_0xdc28('0x14')],_0x3ab42d,'\x20'),'description':intUtil[_0xdc28('0x13')](_0x2d64e3[_0xdc28('0x15')],_0x3ab42d,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2d64e3[_0xdc28('0x15')],_0x3ab42d,'\x0a')}},getCustomFields(_0x2d64e3[_0xdc28('0x16')],_0x3ab42d))}})[_0xdc28('0x17')](function(_0x331fd8){logger[_0xdc28('0x18')]('Ticket\x20created!');return _0x331fd8['ticket'];});}function getUser(_0x56320a,_0x4601ed){if(intUtil[_0xdc28('0x19')](_0x4601ed)){logger[_0xdc28('0x18')](_0xdc28('0x1a'),_0x4601ed);return request({'uri':util[_0xdc28('0xd')](_0xdc28('0x1b'),_0x56320a[_0xdc28('0xf')]),'qs':{'query':util[_0xdc28('0xd')](_0xdc28('0x1c'),_0x4601ed)}})[_0xdc28('0x17')](function(_0xeb48e3){if(_0xeb48e3[_0xdc28('0x1d')]){logger['info'](_0xdc28('0x1e'));return _[_0xdc28('0x1f')](_0xeb48e3[_0xdc28('0x20')],{'email':_0x4601ed,'role':_0xdc28('0x21')});}else{logger[_0xdc28('0x18')](_0xdc28('0x22'));return request({'uri':util['format'](_0xdc28('0x23'),_0x56320a[_0xdc28('0xf')])})[_0xdc28('0x17')](function(_0x2f96ae){logger[_0xdc28('0x18')](_0xdc28('0x24'));return _0x2f96ae['user'];});}});}else{logger[_0xdc28('0x18')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xdc28('0xd')]('%s/users/me.json',_0x56320a[_0xdc28('0xf')])})[_0xdc28('0x17')](function(_0x592144){logger['info'](_0xdc28('0x24'));return _0x592144[_0xdc28('0x25')];});}}function getEndUser(_0x2acff1,_0x184c07,_0x557771){logger[_0xdc28('0x18')](_0xdc28('0x26'),_0x557771);return request({'uri':util[_0xdc28('0xd')](_0xdc28('0x1b'),_0x2acff1[_0xdc28('0xf')]),'qs':{'query':util[_0xdc28('0xd')](_0xdc28('0x27'),_0x557771)}})['then'](function(_0x435f4f){var _0x1e398d;if(_0x435f4f[_0xdc28('0x20')][_0xdc28('0x28')]){_0x435f4f['results']=_['filter'](_0x435f4f[_0xdc28('0x20')],{'suspended':![],'role':'end-user'});if(_0x435f4f['results'][_0xdc28('0x28')]){_0x1e398d=_[_0xdc28('0x29')](_0x435f4f['results']);}}if(_0x1e398d){logger['info'](_0xdc28('0x2a'));return _0x1e398d;}else{logger[_0xdc28('0x18')](_0xdc28('0x2b'));return request({'uri':util[_0xdc28('0xd')](_0xdc28('0x2c'),_0x2acff1[_0xdc28('0xf')]),'method':_0xdc28('0x10'),'body':{'user':{'role':_0xdc28('0x2d'),'name':util['format']('Caller\x20-\x20%s',_0x184c07||_0x557771),'phone':_0x557771}}})[_0xdc28('0x17')](function(_0x119845){logger[_0xdc28('0x18')](_0xdc28('0x2e'));return _0x119845[_0xdc28('0x25')];});}});}function getAuth(_0x3a577b){var _0x5bcd10;if(_0x3a577b['authType']===_0xdc28('0x2f')){_0x5bcd10=util['format'](_0xdc28('0x30'),_0x3a577b[_0xdc28('0x31')],_0x3a577b[_0xdc28('0x2f')]);}else if(_0x3a577b[_0xdc28('0x32')]===_0xdc28('0x33')){_0x5bcd10=util[_0xdc28('0xd')](_0xdc28('0x34'),_0x3a577b['username'],_0x3a577b[_0xdc28('0x33')]);}return util['format'](_0xdc28('0x35'),new Buffer(_0x5bcd10)[_0xdc28('0x36')](_0xdc28('0x37')));}function request(_0x59e30a){logger[_0xdc28('0x38')](_0xdc28('0x39'),JSON['stringify'](_0x59e30a));return rp(_[_0xdc28('0x8')](_0x59e30a,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4565f9,_0x360dfd){var _0x39fce0=[];if(_0x4565f9&&_0x4565f9[_0xdc28('0x28')]>0x0){_0x39fce0=_['map'](_0x4565f9,_0x360dfd);}return _0x39fce0;}function getCustomFields(_0x34fa5d,_0x3dfb7f){var _0x5bef22=[];var _0x58d8cf={'custom_fields':[]};if(_0x34fa5d[_0xdc28('0x28')]>0x0){_['forEach'](_0x34fa5d,function(_0xbd9a22){if(_[_0xdc28('0x3a')]([_0xdc28('0x3b'),_0xdc28('0x3c')],_0xbd9a22[_0xdc28('0x3d')])&&_0xbd9a22[_0xdc28('0x3e')]&&!_0xbd9a22['customField']){_0x58d8cf[_0xbd9a22[_0xdc28('0x3e')][_0xdc28('0x3f')]()]=_0xbd9a22[_0xdc28('0x40')][_0xdc28('0x36')]();}else if(_['includes']([_0xdc28('0x3b'),_0xdc28('0x3c')],_0xbd9a22[_0xdc28('0x3d')])&&_0xbd9a22['idField']&&_0xbd9a22['customField']){_0x58d8cf[_0xdc28('0x41')][_0xdc28('0x42')]({'id':_0xbd9a22[_0xdc28('0x43')],'value':_0xbd9a22[_0xdc28('0x40')]['toString']()});}else if(_0xbd9a22[_0xdc28('0x3d')]===_0xdc28('0x44')&&_0xbd9a22['variableName']&&_0xbd9a22['idField']&&_0xbd9a22['customField']){_0x3dfb7f[_0xbd9a22[_0xdc28('0x45')]]&&_0x58d8cf[_0xdc28('0x41')][_0xdc28('0x42')]({'id':_0xbd9a22[_0xdc28('0x43')],'value':_0x3dfb7f[_0xbd9a22['variableName']][_0xdc28('0x36')]()});}else if(_0xbd9a22['type']===_0xdc28('0x46')&&_0xbd9a22[_0xdc28('0x47')]&&_0xbd9a22[_0xdc28('0x47')][_0xdc28('0x48')]&&_0xbd9a22[_0xdc28('0x43')]&&_0xbd9a22[_0xdc28('0x49')]){_0x3dfb7f[_0xbd9a22[_0xdc28('0x47')][_0xdc28('0x48')][_0xdc28('0x3f')]()]&&_0x58d8cf[_0xdc28('0x41')][_0xdc28('0x42')]({'id':_0xbd9a22['idField'],'value':_0x3dfb7f[_0xbd9a22['Variable'][_0xdc28('0x48')]['toLowerCase']()][_0xdc28('0x36')]()});}});}return _0x58d8cf;}exports['queue']=function(_0x9b2740,_0x118867,_0x22a505,_0x1b56a4,_0x1a1be4,_0x3f84db){var _0x58f883,_0x76141c;_0x3f84db['remoteUri']=intUtil[_0xdc28('0x4a')](_0x3f84db['remoteUri']);_0x3f84db[_0xdc28('0x4b')]=intUtil[_0xdc28('0x4a')](_0x3f84db[_0xdc28('0x4b')]);if(_0x1a1be4&&_0x1a1be4[_0xdc28('0x4c')]){logger[_0xdc28('0x18')](_0xdc28('0x4d'),_0xdc28('0x4e'));_0x118867[_0xdc28('0x4f')]=util[_0xdc28('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f84db['serverUrl'],_0x118867[_0xdc28('0x50')],md5(_0x118867[_0xdc28('0x50')]));}else{_0x118867[_0xdc28('0x4f')]='';}headers[_0xdc28('0x51')]=getAuth(_0x3f84db);return getUser(_0x3f84db,_0x1b56a4[_0xdc28('0x52')])[_0xdc28('0x17')](function(_0x984692){_0x58f883=_0x984692;logger[_0xdc28('0x18')](_0xdc28('0x53'),_0x58f883['id']);return getEndUser(_0x3f84db,_0x118867[_0xdc28('0x54')],_0x118867['calleridnum']);})[_0xdc28('0x17')](function(_0x5c65b6){_0x76141c=_0x5c65b6;logger['info'](_0xdc28('0x55'),_0x76141c['id']);return getTicket(_0x3f84db,_0x58f883,_0x76141c,_0x22a505,_0x118867);})[_0xdc28('0x17')](function(_0x65b6e){if(_0x65b6e){logger[_0xdc28('0x18')](_0xdc28('0x56'),_0x65b6e['id']);switch(_0x3f84db[_0xdc28('0x3d')]){case _0xdc28('0x57'):logger['info'](_0xdc28('0x4d'),_0xdc28('0x58'));return request({'uri':util[_0xdc28('0xd')](_0xdc28('0x59'),_0x3f84db[_0xdc28('0xf')],_0x58f883['id'],_0x65b6e['id']),'method':_0xdc28('0x10')});case'newTab':logger['info']('[QUEUE]',_0xdc28('0x5a'));emit(util[_0xdc28('0xd')]('user:%s',_0x1b56a4[_0xdc28('0x48')]),'trigger:browser:url',{'uri':util[_0xdc28('0xd')](_0xdc28('0x5b'),_0x3f84db[_0xdc28('0xf')][_0xdc28('0x5c')](_0xdc28('0x5d'),''),_0x65b6e['id'])});break;default:logger[_0xdc28('0x5e')](_0xdc28('0x4d'),_0xdc28('0x5f'));}}})[_0xdc28('0x60')](function(_0x465b93){logger[_0xdc28('0x5e')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xdc28('0x61')](_0x465b93,{'showHidden':!![],'depth':null}));});};exports[_0xdc28('0x62')]=function(_0x417e28,_0x4648ee,_0x1f57b5,_0x199391,_0xda2591,_0x38a1ec,_0x57d311){var _0x212f81,_0x5ef9ff;_0x38a1ec['remoteUri']=intUtil[_0xdc28('0x4a')](_0x38a1ec[_0xdc28('0xf')]);_0x38a1ec['serverUrl']=intUtil[_0xdc28('0x4a')](_0x38a1ec['serverUrl']);if(_0x57d311&&_0x57d311['recordingFormat']&&_0x57d311['recordingFormat']!==_0xdc28('0x63')){logger[_0xdc28('0x18')](_0xdc28('0x64'),_0xdc28('0x4e'));_0x4648ee[_0xdc28('0x4f')]=util[_0xdc28('0xd')](_0xdc28('0x65'),_0x38a1ec['serverUrl'],_0x4648ee['uniqueid'],md5(_0x4648ee[_0xdc28('0x50')]));}headers[_0xdc28('0x51')]=getAuth(_0x38a1ec);return getUser(_0x38a1ec,_0x199391[_0xdc28('0x52')])[_0xdc28('0x17')](function(_0x137f7e){_0x212f81=_0x137f7e;logger['info'](_0xdc28('0x53'),_0x212f81['id']);return getEndUser(_0x38a1ec,_0x4648ee[_0xdc28('0x66')],_0x4648ee['destcalleridnum']);})[_0xdc28('0x17')](function(_0x38de2b){_0x5ef9ff=_0x38de2b;logger[_0xdc28('0x18')](_0xdc28('0x55'),_0x5ef9ff['id']);return getTicket(_0x38a1ec,_0x212f81,_0x5ef9ff,_0x1f57b5,_0x4648ee);})[_0xdc28('0x17')](function(_0x2a9d3f){if(_0x2a9d3f){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2a9d3f['id']);switch(_0x38a1ec[_0xdc28('0x3d')]){case _0xdc28('0x57'):logger[_0xdc28('0x18')](_0xdc28('0x64'),_0xdc28('0x58'));return request({'uri':util[_0xdc28('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x38a1ec['remoteUri'],_0x212f81['id'],_0x2a9d3f['id']),'method':_0xdc28('0x10')});case'newTab':logger['info'](_0xdc28('0x64'),_0xdc28('0x5a'));emit(util[_0xdc28('0xd')](_0xdc28('0x67'),_0x199391[_0xdc28('0x48')]),_0xdc28('0x68'),{'uri':util[_0xdc28('0xd')]('%s/agent/tickets/%s',_0x38a1ec['remoteUri'][_0xdc28('0x5c')](_0xdc28('0x5d'),''),_0x2a9d3f['id'])});break;default:logger[_0xdc28('0x5e')](_0xdc28('0x64'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xdc28('0x60')](function(_0x5e1f74){logger[_0xdc28('0x5e')](_0xdc28('0x69'),util['inspect'](_0x5e1f74,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0xb68e79,_0xb60556,_0x244f7a,_0x31e0e0,_0x59574c,_0x313dda){var _0x16a432,_0x41aa2;_0x313dda['remoteUri']=intUtil[_0xdc28('0x4a')](_0x313dda[_0xdc28('0xf')]);_0x313dda['serverUrl']=intUtil[_0xdc28('0x4a')](_0x313dda[_0xdc28('0x4b')]);if(_0x59574c&&_0x59574c['monitor_format']){logger[_0xdc28('0x18')]('['+_0xb60556[_0xdc28('0x6a')][_0xdc28('0x6b')]()+']',_0xdc28('0x4e'));_0xb60556[_0xdc28('0x4f')]=util[_0xdc28('0xd')](_0xdc28('0x65'),_0x313dda['serverUrl'],_0xb60556[_0xdc28('0x50')],md5(_0xb60556[_0xdc28('0x50')]));}else{_0xb60556['recordingURL']='';}headers[_0xdc28('0x51')]=getAuth(_0x313dda);return getUser(_0x313dda)[_0xdc28('0x17')](function(_0x5c18c8){_0x16a432=_0x5c18c8;logger[_0xdc28('0x18')](_0xdc28('0x53'),_0x16a432['id']);return getEndUser(_0x313dda,_0xb60556[_0xdc28('0x54')],_0xb60556['calleridnum']);})['then'](function(_0x36b007){_0x41aa2=_0x36b007;logger[_0xdc28('0x18')]('The\x20Enduser\x20ID\x20is:',_0x41aa2['id']);return getTicket(_0x313dda,_0x16a432,_0x41aa2,_0x244f7a,_0xb60556);})[_0xdc28('0x17')](function(_0x134e14){if(_0x134e14){logger[_0xdc28('0x18')]('The\x20Ticket\x20ID\x20is:',_0x134e14['id']);}})[_0xdc28('0x60')](function(_0x554129){logger[_0xdc28('0x5e')]('['+_0xb60556['lastevent']['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xdc28('0x61')](_0x554129,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5b86=['Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','results','end-user','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','string','picklist','nameField','toLowerCase','content','includes','custom_fields','push','type','variable','idField','customField','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','replace','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','calleridname','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count'];(function(_0x1ed1a6,_0x333c3e){var _0x4f2017=function(_0x8d6e34){while(--_0x8d6e34){_0x1ed1a6['push'](_0x1ed1a6['shift']());}};_0x4f2017(++_0x333c3e);}(_0x5b86,0xb9));var _0x65b8=function(_0x33add5,_0x54f3c1){_0x33add5=_0x33add5-0x0;var _0x399430=_0x5b86[_0x33add5];return _0x399430;};'use strict';var _=require('lodash');var rp=require(_0x65b8('0x0'));var md5=require(_0x65b8('0x1'));var util=require(_0x65b8('0x2'));var Redis=require(_0x65b8('0x3'));var intUtil=require('./util');var config=require(_0x65b8('0x4'));var logger=require(_0x65b8('0x5'))(_0x65b8('0x6'));config[_0x65b8('0x7')]=_[_0x65b8('0x8')](config[_0x65b8('0x7')],{'host':_0x65b8('0x9'),'port':0x18eb});var io=require(_0x65b8('0xa'))(new Redis(config[_0x65b8('0x7')]));function emit(_0x416d5f,_0x5cca52,_0x268450){io['to'](_0x416d5f)[_0x65b8('0xb')](_0x5cca52,_0x268450);}var headers={'Content-Type':'application/json','Accept':_0x65b8('0xc')};function getTicket(_0x3dcb96,_0x520eb8,_0x3dd38b,_0x127c9b,_0x46d85a){logger[_0x65b8('0xd')](_0x65b8('0xe'));return request({'uri':util[_0x65b8('0xf')]('%s/tickets.json',_0x3dcb96['remoteUri']),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x3dd38b['id'],'submitter_id':_0x520eb8?_0x520eb8['id']:undefined,'assignee_id':_0x520eb8?_0x520eb8['id']:undefined,'tags':getTags(_0x127c9b[_0x65b8('0x10')],_0x65b8('0x11')),'subject':intUtil[_0x65b8('0x12')](_0x127c9b[_0x65b8('0x13')],_0x46d85a,'\x20'),'description':intUtil[_0x65b8('0x12')](_0x127c9b['Descriptions'],_0x46d85a,'\x0a'),'comment':{'public':![],'body':intUtil[_0x65b8('0x12')](_0x127c9b[_0x65b8('0x14')],_0x46d85a,'\x0a')}},getCustomFields(_0x127c9b['Fields'],_0x46d85a))}})[_0x65b8('0x15')](function(_0x2cba85){logger['info'](_0x65b8('0x16'));return _0x2cba85[_0x65b8('0x17')];});}function getUser(_0x443a14,_0x36033a){if(intUtil[_0x65b8('0x18')](_0x36033a)){logger[_0x65b8('0xd')]('Getting\x20agent\x20with\x20email',_0x36033a);return request({'uri':util[_0x65b8('0xf')](_0x65b8('0x19'),_0x443a14[_0x65b8('0x1a')]),'qs':{'query':util[_0x65b8('0xf')](_0x65b8('0x1b'),_0x36033a)}})[_0x65b8('0x15')](function(_0x25a5fa){if(_0x25a5fa[_0x65b8('0x1c')]){logger[_0x65b8('0xd')](_0x65b8('0x1d'));return _['find'](_0x25a5fa['results'],{'email':_0x36033a,'role':'agent'});}else{logger[_0x65b8('0xd')](_0x65b8('0x1e'));return request({'uri':util[_0x65b8('0xf')](_0x65b8('0x1f'),_0x443a14['remoteUri'])})['then'](function(_0x36db20){logger[_0x65b8('0xd')](_0x65b8('0x20'));return _0x36db20['user'];});}});}else{logger[_0x65b8('0xd')](_0x65b8('0x1e'));return request({'uri':util[_0x65b8('0xf')](_0x65b8('0x1f'),_0x443a14['remoteUri'])})[_0x65b8('0x15')](function(_0x2a08f6){logger['info'](_0x65b8('0x20'));return _0x2a08f6[_0x65b8('0x21')];});}}function getEndUser(_0x5ec8c4,_0x5a4ef6,_0x2c1bb9){logger[_0x65b8('0xd')](_0x65b8('0x22'),_0x2c1bb9);return request({'uri':util[_0x65b8('0xf')]('%s/search.json',_0x5ec8c4['remoteUri']),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x2c1bb9)}})['then'](function(_0x29fcff){var _0x20c255;if(_0x29fcff['results'][_0x65b8('0x23')]){_0x29fcff['results']=_[_0x65b8('0x24')](_0x29fcff[_0x65b8('0x25')],{'suspended':![],'role':_0x65b8('0x26')});if(_0x29fcff[_0x65b8('0x25')]['length']){_0x20c255=_[_0x65b8('0x27')](_0x29fcff[_0x65b8('0x25')]);}}if(_0x20c255){logger[_0x65b8('0xd')](_0x65b8('0x28'));return _0x20c255;}else{logger[_0x65b8('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x65b8('0xf')](_0x65b8('0x29'),_0x5ec8c4['remoteUri']),'method':'POST','body':{'user':{'role':_0x65b8('0x26'),'name':util[_0x65b8('0xf')](_0x65b8('0x2a'),_0x5a4ef6||_0x2c1bb9),'phone':_0x2c1bb9}}})['then'](function(_0x5f0cbd){logger[_0x65b8('0xd')](_0x65b8('0x2b'));return _0x5f0cbd[_0x65b8('0x21')];});}});}function getAuth(_0x39c122){var _0x585ae3;if(_0x39c122[_0x65b8('0x2c')]===_0x65b8('0x2d')){_0x585ae3=util['format']('%s:%s',_0x39c122[_0x65b8('0x2e')],_0x39c122[_0x65b8('0x2d')]);}else if(_0x39c122[_0x65b8('0x2c')]===_0x65b8('0x2f')){_0x585ae3=util[_0x65b8('0xf')](_0x65b8('0x30'),_0x39c122[_0x65b8('0x2e')],_0x39c122[_0x65b8('0x2f')]);}return util[_0x65b8('0xf')](_0x65b8('0x31'),new Buffer(_0x585ae3)[_0x65b8('0x32')]('base64'));}function request(_0x19ec35){logger[_0x65b8('0x33')](_0x65b8('0x34'),JSON[_0x65b8('0x35')](_0x19ec35));return rp(_[_0x65b8('0x8')](_0x19ec35,{'method':_0x65b8('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x101ee5,_0x468850){var _0x4a7b8e=[];if(_0x101ee5&&_0x101ee5[_0x65b8('0x23')]>0x0){_0x4a7b8e=_[_0x65b8('0x37')](_0x101ee5,_0x468850);}return _0x4a7b8e;}function getCustomFields(_0x29baed,_0xa25d83){var _0x2431e4=[];var _0x3c06e1={'custom_fields':[]};if(_0x29baed[_0x65b8('0x23')]>0x0){_['forEach'](_0x29baed,function(_0x138108){if(_['includes']([_0x65b8('0x38'),_0x65b8('0x39')],_0x138108['type'])&&_0x138108[_0x65b8('0x3a')]&&!_0x138108['customField']){_0x3c06e1[_0x138108[_0x65b8('0x3a')][_0x65b8('0x3b')]()]=_0x138108[_0x65b8('0x3c')][_0x65b8('0x32')]();}else if(_[_0x65b8('0x3d')]([_0x65b8('0x38'),_0x65b8('0x39')],_0x138108['type'])&&_0x138108['idField']&&_0x138108['customField']){_0x3c06e1[_0x65b8('0x3e')][_0x65b8('0x3f')]({'id':_0x138108['idField'],'value':_0x138108[_0x65b8('0x3c')][_0x65b8('0x32')]()});}else if(_0x138108[_0x65b8('0x40')]===_0x65b8('0x41')&&_0x138108['variableName']&&_0x138108[_0x65b8('0x42')]&&_0x138108[_0x65b8('0x43')]){_0xa25d83[_0x138108['variableName']]&&_0x3c06e1[_0x65b8('0x3e')][_0x65b8('0x3f')]({'id':_0x138108[_0x65b8('0x42')],'value':_0xa25d83[_0x138108[_0x65b8('0x44')]]['toString']()});}else if(_0x138108['type']===_0x65b8('0x45')&&_0x138108['Variable']&&_0x138108[_0x65b8('0x46')]['name']&&_0x138108['idField']&&_0x138108['customField']){_0xa25d83[_0x138108[_0x65b8('0x46')][_0x65b8('0x11')][_0x65b8('0x3b')]()]&&_0x3c06e1['custom_fields'][_0x65b8('0x3f')]({'id':_0x138108[_0x65b8('0x42')],'value':_0xa25d83[_0x138108[_0x65b8('0x46')]['name'][_0x65b8('0x3b')]()][_0x65b8('0x32')]()});}});}return _0x3c06e1;}exports[_0x65b8('0x47')]=function(_0x17a503,_0x1f7c17,_0x3e13c9,_0xc015a,_0x2cb524,_0x5d1def){var _0x1e91e6,_0x52801a;_0x5d1def[_0x65b8('0x1a')]=intUtil[_0x65b8('0x48')](_0x5d1def[_0x65b8('0x1a')]);_0x5d1def[_0x65b8('0x49')]=intUtil[_0x65b8('0x48')](_0x5d1def['serverUrl']);if(_0x2cb524&&_0x2cb524[_0x65b8('0x4a')]){logger[_0x65b8('0xd')](_0x65b8('0x4b'),'Recording\x20is\x20enabled!');_0x1f7c17[_0x65b8('0x4c')]=util[_0x65b8('0xf')](_0x65b8('0x4d'),_0x5d1def['serverUrl'],_0x1f7c17[_0x65b8('0x4e')],md5(_0x1f7c17[_0x65b8('0x4e')]));}else{_0x1f7c17['recordingURL']='';}headers[_0x65b8('0x4f')]=getAuth(_0x5d1def);return getUser(_0x5d1def,_0xc015a['email'])['then'](function(_0x5b52fc){_0x1e91e6=_0x5b52fc;logger[_0x65b8('0xd')](_0x65b8('0x50'),_0x1e91e6['id']);return getEndUser(_0x5d1def,_0x1f7c17['calleridname'],_0x1f7c17[_0x65b8('0x51')]);})[_0x65b8('0x15')](function(_0x58a3a6){_0x52801a=_0x58a3a6;logger[_0x65b8('0xd')](_0x65b8('0x52'),_0x52801a['id']);return getTicket(_0x5d1def,_0x1e91e6,_0x52801a,_0x3e13c9,_0x1f7c17);})[_0x65b8('0x15')](function(_0xc3b962){if(_0xc3b962){logger[_0x65b8('0xd')]('The\x20Ticket\x20ID\x20is:',_0xc3b962['id']);switch(_0x5d1def[_0x65b8('0x40')]){case'integrationTab':logger[_0x65b8('0xd')](_0x65b8('0x4b'),_0x65b8('0x53'));return request({'uri':util[_0x65b8('0xf')](_0x65b8('0x54'),_0x5d1def[_0x65b8('0x1a')],_0x1e91e6['id'],_0xc3b962['id']),'method':_0x65b8('0x55')});case _0x65b8('0x56'):logger[_0x65b8('0xd')](_0x65b8('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x65b8('0xf')]('user:%s',_0xc015a[_0x65b8('0x11')]),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x5d1def[_0x65b8('0x1a')][_0x65b8('0x57')]('/api/v2',''),_0xc3b962['id'])});break;default:logger[_0x65b8('0x58')](_0x65b8('0x4b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x65b8('0x59')](function(_0x2de88a){logger['error'](_0x65b8('0x5a'),util[_0x65b8('0x5b')](_0x2de88a,{'showHidden':!![],'depth':null}));});};exports[_0x65b8('0x5c')]=function(_0x47949d,_0x15025d,_0x401553,_0x2bd881,_0x19b24d,_0x15d224,_0x269eea){var _0x3b9a40,_0x33b293;_0x15d224[_0x65b8('0x1a')]=intUtil[_0x65b8('0x48')](_0x15d224[_0x65b8('0x1a')]);_0x15d224[_0x65b8('0x49')]=intUtil[_0x65b8('0x48')](_0x15d224[_0x65b8('0x49')]);if(_0x269eea&&_0x269eea[_0x65b8('0x5d')]&&_0x269eea['recordingFormat']!==_0x65b8('0x5e')){logger[_0x65b8('0xd')](_0x65b8('0x5f'),_0x65b8('0x60'));_0x15025d[_0x65b8('0x4c')]=util['format'](_0x65b8('0x4d'),_0x15d224[_0x65b8('0x49')],_0x15025d[_0x65b8('0x4e')],md5(_0x15025d[_0x65b8('0x4e')]));}headers[_0x65b8('0x4f')]=getAuth(_0x15d224);return getUser(_0x15d224,_0x2bd881[_0x65b8('0x61')])[_0x65b8('0x15')](function(_0x4fdd2a){_0x3b9a40=_0x4fdd2a;logger['info']('The\x20User\x20ID\x20is:',_0x3b9a40['id']);return getEndUser(_0x15d224,_0x15025d['destcalleridname'],_0x15025d['destcalleridnum']);})[_0x65b8('0x15')](function(_0x21cbe6){_0x33b293=_0x21cbe6;logger[_0x65b8('0xd')]('The\x20Enduser\x20ID\x20is:',_0x33b293['id']);return getTicket(_0x15d224,_0x3b9a40,_0x33b293,_0x401553,_0x15025d);})[_0x65b8('0x15')](function(_0x551180){if(_0x551180){logger[_0x65b8('0xd')](_0x65b8('0x62'),_0x551180['id']);switch(_0x15d224['type']){case'integrationTab':logger['info'](_0x65b8('0x5f'),_0x65b8('0x53'));return request({'uri':util[_0x65b8('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x15d224[_0x65b8('0x1a')],_0x3b9a40['id'],_0x551180['id']),'method':_0x65b8('0x55')});case _0x65b8('0x56'):logger[_0x65b8('0xd')](_0x65b8('0x5f'),_0x65b8('0x63'));emit(util[_0x65b8('0xf')](_0x65b8('0x64'),_0x2bd881[_0x65b8('0x11')]),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x15d224[_0x65b8('0x1a')][_0x65b8('0x57')]('/api/v2',''),_0x551180['id'])});break;default:logger[_0x65b8('0x58')]('[OUTBOUND]',_0x65b8('0x65'));}}})[_0x65b8('0x59')](function(_0x32481e){logger[_0x65b8('0x58')](_0x65b8('0x66'),util[_0x65b8('0x5b')](_0x32481e,{'showHidden':!![],'depth':null}));});};exports[_0x65b8('0x67')]=function(_0x4d6a66,_0x151e82,_0x10b39b,_0x44b279,_0x2f0ed8,_0x3d338b){var _0xb7b82,_0x226428;_0x3d338b[_0x65b8('0x1a')]=intUtil[_0x65b8('0x48')](_0x3d338b[_0x65b8('0x1a')]);_0x3d338b[_0x65b8('0x49')]=intUtil[_0x65b8('0x48')](_0x3d338b[_0x65b8('0x49')]);if(_0x2f0ed8&&_0x2f0ed8['monitor_format']){logger[_0x65b8('0xd')]('['+_0x151e82[_0x65b8('0x68')]['toUpperCase']()+']',_0x65b8('0x60'));_0x151e82[_0x65b8('0x4c')]=util[_0x65b8('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d338b[_0x65b8('0x49')],_0x151e82[_0x65b8('0x4e')],md5(_0x151e82[_0x65b8('0x4e')]));}else{_0x151e82[_0x65b8('0x4c')]='';}headers[_0x65b8('0x4f')]=getAuth(_0x3d338b);return getUser(_0x3d338b)['then'](function(_0x34c425){_0xb7b82=_0x34c425;logger[_0x65b8('0xd')](_0x65b8('0x50'),_0xb7b82['id']);return getEndUser(_0x3d338b,_0x151e82[_0x65b8('0x69')],_0x151e82[_0x65b8('0x51')]);})['then'](function(_0x272490){_0x226428=_0x272490;logger[_0x65b8('0xd')](_0x65b8('0x52'),_0x226428['id']);return getTicket(_0x3d338b,_0xb7b82,_0x226428,_0x10b39b,_0x151e82);})[_0x65b8('0x15')](function(_0x5518a1){if(_0x5518a1){logger['info']('The\x20Ticket\x20ID\x20is:',_0x5518a1['id']);}})[_0x65b8('0x59')](function(_0x3f9a70){logger[_0x65b8('0x58')]('['+_0x151e82[_0x65b8('0x68')]['toUpperCase']()+']'+_0x65b8('0x6a'),util[_0x65b8('0x5b')](_0x3f9a70,{'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 19f25a1..b85cd00 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 _0xeffd=['refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','findIndex','users','Agent\x20found!','Using\x20the\x20admin\x20account!','user','profile','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','POST','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','GET','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','Description','getString','Full_Name','First_Name','Last_Name','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','format','lastevent','Call_Result','Called','connect','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','email','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','zoho.eu','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lodash','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','includes','picklist','type','idField','variable','variableName','toString','customVariable','Variable','toLowerCase','name','indexOf','split','isNil','isBefore','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret'];(function(_0x9cf744,_0x2adc85){var _0x49da4b=function(_0x445776){while(--_0x445776){_0x9cf744['push'](_0x9cf744['shift']());}};_0x49da4b(++_0x2adc85);}(_0xeffd,0x6b));var _0xdeff=function(_0x1cf38c,_0x397f57){_0x1cf38c=_0x1cf38c-0x0;var _0x33a2dc=_0xeffd[_0x1cf38c];return _0x33a2dc;};'use strict';var _=require(_0xdeff('0x0'));var rp=require('request-promise');var md5=require(_0xdeff('0x1'));var util=require(_0xdeff('0x2'));var intUtil=require(_0xdeff('0x3'));var moment=require(_0xdeff('0x4'));var Redis=require(_0xdeff('0x5'));var BPromise=require(_0xdeff('0x6'));var config=require(_0xdeff('0x7'));var logger=require(_0xdeff('0x8'))(_0xdeff('0x9'));config[_0xdeff('0xa')]=_[_0xdeff('0xb')](config[_0xdeff('0xa')],{'host':_0xdeff('0xc'),'port':0x18eb});var io=require(_0xdeff('0xd'))(new Redis(config[_0xdeff('0xa')]));function emit(_0x12e953,_0x24897a,_0x540ae6){io['to'](_0x12e953)[_0xdeff('0xe')](_0x24897a,_0x540ae6);}function request(_0x45a8a6){logger[_0xdeff('0xf')]('[HTTP]',JSON[_0xdeff('0x10')](_0x45a8a6));return rp(_0x45a8a6);}function getCustomFields(_0x4423e9,_0x3c1482){var _0x192195={};if(_0x4423e9[_0xdeff('0x11')]>0x0){_[_0xdeff('0x12')](_0x4423e9,function(_0x2e9783){if(_[_0xdeff('0x13')](['string',_0xdeff('0x14')],_0x2e9783[_0xdeff('0x15')])&&_0x2e9783['idField']){_0x192195[_0x2e9783[_0xdeff('0x16')]]=_0x2e9783['content']['toString']();}else if(_0x2e9783[_0xdeff('0x15')]===_0xdeff('0x17')&&_0x2e9783[_0xdeff('0x18')]&&_0x2e9783[_0xdeff('0x16')]&&_0x3c1482[_0x2e9783['variableName']]){_0x192195[_0x2e9783[_0xdeff('0x16')]]=_0x3c1482[_0x2e9783[_0xdeff('0x18')]][_0xdeff('0x19')]();}else if(_0x2e9783[_0xdeff('0x15')]===_0xdeff('0x1a')&&_0x2e9783[_0xdeff('0x1b')]&&_0x2e9783['Variable']['name']&&_0x2e9783[_0xdeff('0x16')]&&_0x3c1482[_0x2e9783['Variable']['name'][_0xdeff('0x1c')]()]){_0x192195[_0x2e9783[_0xdeff('0x16')]]=_0x3c1482[_0x2e9783['Variable'][_0xdeff('0x1d')][_0xdeff('0x1c')]()][_0xdeff('0x19')]();}});}return _0x192195;}function getName(_0x3a677a){if(_0x3a677a[_0xdeff('0x1e')]('\x20')>0x0){var _0x299cc5=_0x3a677a[_0xdeff('0x1f')](/ (.+)/);if(_0x299cc5[0x1]){return _0x299cc5;}}return[_0x3a677a,_0x3a677a];}var accountsTokens={};function getAccessToken(_0x919c93){return new Promise(function(_0x488faa,_0x5591fa){if(!_['isNil'](accountsTokens[_0x919c93['id']])&&!_[_0xdeff('0x20')](accountsTokens[_0x919c93['id']]['access_token'])){if(moment()[_0xdeff('0x21')](accountsTokens[_0x919c93['id']][_0xdeff('0x22')])){_0x488faa(accountsTokens[_0x919c93['id']]['access_token']);}}var _0x18338c;switch(_0x919c93[_0xdeff('0x23')]){case'US':_0x18338c='https://accounts.zoho.com';break;case'AU':_0x18338c='https://accounts.zoho.com.au';break;case'EU':_0x18338c=_0xdeff('0x24');break;case'IN':_0x18338c=_0xdeff('0x25');break;case'CN':_0x18338c=_0xdeff('0x26');break;default:_0x18338c=_0xdeff('0x24');break;}var _0x32add9={'method':'POST','uri':_0x18338c+_0xdeff('0x27'),'qs':{'refresh_token':_0x919c93[_0xdeff('0x28')],'client_id':_0x919c93[_0xdeff('0x29')],'client_secret':_0x919c93[_0xdeff('0x2a')],'grant_type':_0xdeff('0x2b')},'json':!![]};return rp(_0x32add9)[_0xdeff('0x2c')](function(_0x3d0111){accountsTokens[_0x919c93['id']]={'access_token':_0x3d0111['access_token'],'expires_in':moment()[_0xdeff('0x2d')](_0x3d0111[_0xdeff('0x22')],'seconds')};_0x488faa(_0x3d0111['access_token']);})[_0xdeff('0x2e')](function(_0x2ea8e9){logger[_0xdeff('0x2f')](_0xdeff('0x30'),_0x2ea8e9[_0xdeff('0x31')]);_0x5591fa(_0x2ea8e9);});});}function getUser(_0xf9b278,_0xbc75ee,_0x4e0ff2,_0x331ddc){logger[_0xdeff('0x32')](_0xdeff('0x33'));return request({'method':'GET','uri':util['format'](_0xdeff('0x34'),_0xbc75ee),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xdeff('0x35')+_0xf9b278},'json':!![]})[_0xdeff('0x2c')](function(_0x44a8b3){if(_0x44a8b3['users']){var _0x189a51=-0x1;if(_['isArrayLikeObject'](_0x44a8b3['users'])){if(!_[_0xdeff('0x20')](_0x331ddc)){_0x189a51=_[_0xdeff('0x36')](_0x44a8b3[_0xdeff('0x37')],function(_0x240459){return _0x240459['email']===_0x331ddc;});}if(_0x189a51>=0x0){logger[_0xdeff('0x32')](_0xdeff('0x38'));}else{logger[_0xdeff('0x32')](_0xdeff('0x39'));_0x189a51=_[_0xdeff('0x36')](_0x44a8b3[_0xdeff('0x37')],function(_0x321ef0){return _0x321ef0['profile'][_0xdeff('0x1d')]==='Administrator';});}return _0x44a8b3[_0xdeff('0x37')][_0x189a51];}else{if(_0x44a8b3[_0xdeff('0x3a')][_0xdeff('0x3b')][_0xdeff('0x1d')]===_0xdeff('0x3c')){logger[_0xdeff('0x32')]('Using\x20the\x20admin\x20account!');user=_0x44a8b3[_0xdeff('0x3a')];return user;}else{logger[_0xdeff('0x2f')]('The\x20failing\x20result\x20is',JSON[_0xdeff('0x10')](_0x44a8b3));throw new Error(_0xdeff('0x3d')+JSON[_0xdeff('0x10')](_0x44a8b3));}}}else{logger[_0xdeff('0x2f')](_0xdeff('0x3e'),JSON[_0xdeff('0x10')](_0x44a8b3));throw new Error(_0xdeff('0x3d')+JSON[_0xdeff('0x10')](_0x44a8b3));}})['catch'](function(_0x118752){console['error'](_0x118752);});}function getZohoUser(_0x231893,_0x345032){return new BPromise(function(_0x30f442,_0x5f368d){request(_0x231893)[_0xdeff('0x2c')](function(_0x280a86){var _0x31dd4a=null;if(_0x280a86){_0x31dd4a=_0x280a86[_0xdeff('0x3f')][0x0];_0x31dd4a[_0xdeff('0x40')]=_0x345032;}_0x30f442(_0x31dd4a);})['catch'](function(_0x1c87bd){_0x5f368d(_0x1c87bd);});});}function createEndUser(_0x4d9985,_0x393d75,_0x14f1d0,_0x518280,_0x30609b,_0x13e25e){var _0x14f1d0=getName(_0x14f1d0);return request({'method':_0xdeff('0x41'),'uri':_0xdeff('0x42')+_0x393d75+'/crm/v2/'+_[_0xdeff('0x43')](_0x13e25e[_0xdeff('0x44')])+'s','body':{'data':[{'Last_Name':_0x14f1d0[0x1],'First_Name':_0x14f1d0[0x0],'Phone':_0x518280,'Owner':{'name':!_[_0xdeff('0x20')](_0x30609b[_0xdeff('0x45')][_0xdeff('0x1d')])?_0x30609b['role']['name']:!_[_0xdeff('0x20')](_0x30609b[_0xdeff('0x46')])?_0x30609b[_0xdeff('0x46')]+'\x20'+_0x30609b[_0xdeff('0x47')]:_0x30609b[_0xdeff('0x47')],'id':_0x30609b['id']}}]},'headers':{'Authorization':_0xdeff('0x35')+_0x4d9985},'json':!![]})[_0xdeff('0x2c')](function(_0x4f02f5){if(_0x4f02f5&&_0x4f02f5[_0xdeff('0x3f')][0x0][_0xdeff('0x48')]===_0xdeff('0x49')){var _0x54fa5b=_0x4f02f5[_0xdeff('0x3f')][0x0][_0xdeff('0x4a')];_0x54fa5b[_0xdeff('0x40')]=_[_0xdeff('0x43')](_0x13e25e['moduleCreate'])+'s';return _0x54fa5b;}logger[_0xdeff('0x2f')](_0xdeff('0x3e'),JSON[_0xdeff('0x10')](data));throw new Error(_0xdeff('0x4b')+JSON[_0xdeff('0x10')](data));})[_0xdeff('0x2e')](function(_0x3fe2e4){console[_0xdeff('0x4c')]('CREATE\x20ERROR',_0x3fe2e4);});}function getEndUser(_0x251737,_0x259631,_0xc23310,_0x473d32,_0x21c18a,_0x4d2dd3,_0x25a84f){var _0x15642a={'method':_0xdeff('0x4d'),'uri':'','headers':{'Authorization':_0xdeff('0x35')+_0x251737},'json':!![]};switch(_0x25a84f[_0xdeff('0x4e')]){case'contact_lead':_0x15642a[_0xdeff('0x4f')]='https://www.zohoapis.'+_0x259631+_0xdeff('0x50')+_0x21c18a+'))';return getZohoUser(_0x15642a,_0xdeff('0x51'))[_0xdeff('0x2c')](function(_0x46c428){if(_0x46c428)return _0x46c428;_0x15642a[_0xdeff('0x4f')]=_0xdeff('0x42')+_0x259631+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x21c18a+'))';return getZohoUser(_0x15642a,'Leads')[_0xdeff('0x2c')](function(_0xf91a72){if(_0xf91a72)return _0xf91a72;if(_0x25a84f[_0xdeff('0x44')]!='nothing'){return createEndUser(_0x251737,_0x259631,_0x473d32,_0x21c18a,_0x4d2dd3,_0x25a84f);}else{return{};}});});break;case'contact':_0x15642a[_0xdeff('0x4f')]=_0xdeff('0x42')+_0x259631+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x21c18a+'))';return getZohoUser(_0x15642a,_0xdeff('0x51'))[_0xdeff('0x2c')](function(_0xb84cfa){if(_0xb84cfa)return _0xb84cfa;if(_0x25a84f['moduleCreate']!=_0xdeff('0x52')){return createEndUser(_0x251737,_0x259631,_0x473d32,_0x21c18a,_0x4d2dd3,_0x25a84f);}else{return{};}});break;case _0xdeff('0x53'):_0x15642a[_0xdeff('0x4f')]='https://www.zohoapis.'+_0x259631+_0xdeff('0x54')+_0x21c18a+'))';return getZohoUser(_0x15642a,_0xdeff('0x55'))[_0xdeff('0x2c')](function(_0x23cec3){if(_0x23cec3)return _0x23cec3;if(_0x25a84f[_0xdeff('0x44')]!=_0xdeff('0x52')){return createEndUser(_0x251737,_0x259631,_0x473d32,_0x21c18a,_0x4d2dd3,_0x25a84f);}else{return{};}});break;}}function getCall(_0x2c7fa4,_0x578185,_0x4517d1,_0x1b90a9,_0x5e0c60,_0xe5a773,_0x1b676b,_0x2967b4){logger[_0xdeff('0x32')](_0xdeff('0x56'));var _0xfb097c={};_0xfb097c[_0xdeff('0x57')]={'name':!_[_0xdeff('0x20')](_0x1b90a9['role'][_0xdeff('0x1d')])&&!_[_0xdeff('0x20')](_0x1b90a9[_0xdeff('0x3b')]['name'])&&_0x1b90a9['profile'][_0xdeff('0x1d')]===_0xdeff('0x58')?_0x1b90a9[_0xdeff('0x45')][_0xdeff('0x1d')]:!_[_0xdeff('0x20')](_0x1b90a9[_0xdeff('0x46')])?_0x1b90a9['first_name']+'\x20'+_0x1b90a9['last_name']:_0x1b90a9[_0xdeff('0x47')],'id':_0x1b90a9['id']};_0xfb097c[_0xdeff('0x59')]=intUtil['getString'](_0xe5a773['Subjects'],_0x1b676b,'\x20');_0xfb097c[_0xdeff('0x5a')]=intUtil[_0xdeff('0x5b')](_0xe5a773['Descriptions'],_0x1b676b,'\x0a');if(_0x5e0c60[_0xdeff('0x40')]===_0xdeff('0x51')){_0xfb097c['Who_Id']={'name':!_[_0xdeff('0x20')](_0x5e0c60[_0xdeff('0x5c')])?_0x5e0c60['Full_Name']:!_[_0xdeff('0x20')](_0x5e0c60[_0xdeff('0x5d')])?_0x5e0c60['First_Name']+'\x20'+_0x5e0c60[_0xdeff('0x5e')]:_0x5e0c60[_0xdeff('0x5e')],'id':_0x5e0c60['id']};}if(_0x5e0c60[_0xdeff('0x40')]==='Leads'){_0xfb097c['What_Id']={'name':!_[_0xdeff('0x20')](_0x5e0c60['Full_Name'])?_0x5e0c60[_0xdeff('0x5c')]:!_[_0xdeff('0x20')](_0x5e0c60[_0xdeff('0x5d')])?_0x5e0c60[_0xdeff('0x5d')]+'\x20'+_0x5e0c60[_0xdeff('0x5e')]:_0x5e0c60['Last_Name'],'id':_0x5e0c60['id']};_0xfb097c['$se_module']=_[_0xdeff('0x43')](_0x5e0c60[_0xdeff('0x40')]);}if(_0x1b676b[_0xdeff('0x5f')]){_0xfb097c[_0xdeff('0x60')]=moment[_0xdeff('0x61')](parseInt(_0x1b676b[_0xdeff('0x5f')])*0x3e8)['format'](_0xdeff('0x62'));}else if(_0x1b676b['answertime']&&_0x1b676b[_0xdeff('0x63')]){_0xfb097c[_0xdeff('0x60')]=moment[_0xdeff('0x61')](moment(_0x1b676b[_0xdeff('0x63')],_0xdeff('0x64'))[_0xdeff('0x65')](moment(_0x1b676b[_0xdeff('0x66')],_0xdeff('0x64'))))[_0xdeff('0x67')]('mm:ss');}switch(_0x1b676b[_0xdeff('0x68')]){case'called':_0xfb097c[_0xdeff('0x69')]=_0xdeff('0x6a');break;case'complete':case _0xdeff('0x6b'):_0xfb097c['Call_Result']=_0xdeff('0x6c');break;case'rejected':_0xfb097c['Call_Result']=_0xdeff('0x6d');break;case _0xdeff('0x6e'):_0xfb097c['Call_Result']=_0xdeff('0x6f');break;case _0xdeff('0x70'):_0xfb097c[_0xdeff('0x69')]=_0xdeff('0x71');default:}_0xfb097c[_0xdeff('0x72')]=(_0x2967b4===_0xdeff('0x73')?moment(_0x1b676b[_0xdeff('0x66')])[_0xdeff('0x67')](_0xdeff('0x64')):moment(_0x1b676b['agentcalledAt'])[_0xdeff('0x67')](_0xdeff('0x64')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0xfb097c[_0xdeff('0x74')]=_0x2967b4||_0xdeff('0x75');_0xfb097c=_['merge'](_0xfb097c,getCustomFields(_0xe5a773[_0xdeff('0x76')],_0x1b676b));return request({'method':_0xdeff('0x41'),'uri':_0xdeff('0x42')+_0x578185+_0xdeff('0x77'),'headers':{'Authorization':_0xdeff('0x35')+_0x2c7fa4},'body':{'data':[_0xfb097c]},'json':!![]})[_0xdeff('0x2c')](function(_0xa5f4a0){if(_0xa5f4a0&&_0xa5f4a0[_0xdeff('0x3f')][0x0][_0xdeff('0x48')]===_0xdeff('0x49')){logger['info'](_0xdeff('0x78'));return{'id':_0xa5f4a0[_0xdeff('0x3f')][0x0][_0xdeff('0x4a')]['id']};}})[_0xdeff('0x2e')](function(_0x4539c8){logger['info']('err',_0x4539c8['stack']);console[_0xdeff('0x4c')](_0xdeff('0x79'),_0x4539c8);});}exports[_0xdeff('0x7a')]=function(_0x5e85dc,_0x4ea57d,_0x5c718a,_0x19de80,_0x1a6fbe,_0x46e1d5){var _0x3b67e1,_0x118aa0,_0x19ab0f;_0x46e1d5[_0xdeff('0x7b')]=intUtil[_0xdeff('0x7c')](_0x46e1d5['host']);_0x46e1d5[_0xdeff('0x7d')]=intUtil[_0xdeff('0x7c')](_0x46e1d5[_0xdeff('0x7d')]);if(_0x1a6fbe&&_0x1a6fbe[_0xdeff('0x7e')]){logger[_0xdeff('0x32')](_0xdeff('0x7f'),_0xdeff('0x80'));_0x4ea57d[_0xdeff('0x81')]=_0x46e1d5[_0xdeff('0x7d')]+_0xdeff('0x82')+_0x4ea57d[_0xdeff('0x83')]+_0xdeff('0x84')+md5(_0x4ea57d['uniqueid']);}else{_0x4ea57d[_0xdeff('0x81')]='';}var _0xa46f6c=_0x46e1d5[_0xdeff('0x7b')]==='zoho.eu'?'eu':_0xdeff('0x85');return getAccessToken(_0x46e1d5)[_0xdeff('0x2c')](function(_0x39416){_0x19ab0f=_0x39416;return getUser(_0x19ab0f,_0xa46f6c,_0x46e1d5,_0x19de80[_0xdeff('0x86')]);})['then'](function(_0x2811e5){_0x3b67e1=_0x2811e5;logger[_0xdeff('0x32')]('The\x20User\x20ID\x20is:',_0x3b67e1['id']);return getEndUser(_0x19ab0f,_0xa46f6c,_0x46e1d5,_0x4ea57d[_0xdeff('0x87')],_0x4ea57d[_0xdeff('0x88')],_0x3b67e1,_0x5c718a);})[_0xdeff('0x2c')](function(_0x1cc1d3){_0x118aa0=_0x1cc1d3;return getCall(_0x19ab0f,_0xa46f6c,_0x46e1d5,_0x3b67e1,_0x118aa0,_0x5c718a,_0x4ea57d,_0xdeff('0x75'));})['then'](function(_0x1ee669){if(_0x1ee669){logger[_0xdeff('0x32')](_0xdeff('0x89'),_0x1ee669['id']);logger[_0xdeff('0x32')](_0xdeff('0x7f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdeff('0x67')](_0xdeff('0x8a'),_0x19de80['name']),_0xdeff('0x8b'),{'uri':_0xdeff('0x8c')+_0x46e1d5[_0xdeff('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x1ee669['id']});}})[_0xdeff('0x2e')](function(_0xea0d77){logger['error'](_0xdeff('0x7f'),JSON[_0xdeff('0x10')](_0xea0d77));});};exports[_0xdeff('0x73')]=function(_0x18e96c,_0x4cacbd,_0x39e307,_0x3b8f20,_0x14a77f,_0x184cb2,_0x13bc9f){var _0x69e0f9,_0x7b5b7b,_0x3e3fd4;_0x184cb2[_0xdeff('0x7b')]=intUtil['stripTrailingSlash'](_0x184cb2[_0xdeff('0x7b')]);_0x184cb2['serverUrl']=intUtil[_0xdeff('0x7c')](_0x184cb2['serverUrl']);if(_0x13bc9f&&_0x13bc9f['recordingFormat']&&_0x13bc9f[_0xdeff('0x8d')]!==_0xdeff('0x8e')){logger['info'](_0xdeff('0x8f'),_0xdeff('0x80'));_0x4cacbd[_0xdeff('0x81')]=_0x184cb2[_0xdeff('0x7d')]+'/api/voice/recordings/'+_0x4cacbd[_0xdeff('0x83')]+_0xdeff('0x84')+md5(_0x4cacbd['uniqueid']);}var _0x3dca7f=_0x184cb2[_0xdeff('0x7b')]===_0xdeff('0x90')?'eu':_0xdeff('0x85');return getAccessToken(_0x184cb2)[_0xdeff('0x2c')](function(_0x377733){_0x3e3fd4=_0x377733;return getUser(_0x3e3fd4,_0x3dca7f,_0x184cb2,_0x3b8f20[_0xdeff('0x86')]);})[_0xdeff('0x2c')](function(_0x5ada1e){_0x69e0f9=_0x5ada1e;logger['info'](_0xdeff('0x91'),_0x69e0f9['id']);return getEndUser(_0x3e3fd4,_0x3dca7f,_0x184cb2,_0x4cacbd['destcalleridname'],_0x4cacbd[_0xdeff('0x92')],_0x69e0f9,_0x39e307);})[_0xdeff('0x2c')](function(_0x5e9c02){_0x7b5b7b=_0x5e9c02;return getCall(_0x3e3fd4,_0x3dca7f,_0x184cb2,_0x69e0f9,_0x7b5b7b,_0x39e307,_0x4cacbd,_0xdeff('0x93'));})[_0xdeff('0x2c')](function(_0x232d7e){if(_0x232d7e){logger['info'](_0xdeff('0x89'),_0x232d7e['id']);logger[_0xdeff('0x32')](_0xdeff('0x8f'),_0xdeff('0x94'));emit(util['format'](_0xdeff('0x8a'),_0x3b8f20['name']),_0xdeff('0x8b'),{'uri':'https://crm.'+_0x184cb2[_0xdeff('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x232d7e['id']});}})[_0xdeff('0x2e')](function(_0x27c2ce){logger[_0xdeff('0x2f')]('[OUTBOUND]',JSON[_0xdeff('0x10')](_0x27c2ce));});};exports[_0xdeff('0x95')]=function(_0x202682,_0x5491e2,_0x4be90d,_0x4d301d,_0x292681,_0x385903){var _0x94ad85,_0x676ac1,_0x17e961;_0x385903[_0xdeff('0x7b')]=intUtil['stripTrailingSlash'](_0x385903[_0xdeff('0x7b')]);_0x385903[_0xdeff('0x7d')]=intUtil[_0xdeff('0x7c')](_0x385903['serverUrl']);if(_0x292681&&_0x292681['monitor_format']){logger[_0xdeff('0x32')]('['+_0x5491e2[_0xdeff('0x68')]['toUpperCase']()+']',_0xdeff('0x80'));_0x5491e2[_0xdeff('0x81')]=_0x385903[_0xdeff('0x7d')]+_0xdeff('0x82')+_0x5491e2[_0xdeff('0x83')]+_0xdeff('0x84')+md5(_0x5491e2['uniqueid']);}else{_0x5491e2[_0xdeff('0x81')]='';}var _0x186139=_0x385903[_0xdeff('0x7b')]==='zoho.eu'?'eu':_0xdeff('0x85');return getAccessToken(_0x385903)['then'](function(_0x2a555f){_0x17e961=_0x2a555f;return getUser(_0x17e961,_0x186139,_0x385903);})[_0xdeff('0x2c')](function(_0x51caa7){_0x94ad85=_0x51caa7;logger[_0xdeff('0x32')](_0xdeff('0x91'),_0x94ad85['id']);return getEndUser(_0x17e961,_0x186139,_0x385903,_0x5491e2[_0xdeff('0x87')],_0x5491e2['calleridnum'],_0x94ad85,_0x4be90d);})[_0xdeff('0x2c')](function(_0x1046a6){_0x676ac1=_0x1046a6;return getCall(_0x17e961,_0x186139,_0x385903,_0x94ad85,_0x676ac1,_0x4be90d,_0x5491e2,'Inbound');})[_0xdeff('0x2c')](function(_0x14d2db){if(_0x14d2db){logger[_0xdeff('0x32')](_0xdeff('0x89'),_0x14d2db['id']);}})[_0xdeff('0x2e')](function(_0x265e1b){logger[_0xdeff('0x2f')]('['+_0x5491e2['lastevent']['toUpperCase']()+']',JSON[_0xdeff('0x10')](_0x265e1b));});}; \ No newline at end of file +var _0xb903=['uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','lead','Owner','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','connect','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','details','err','stack','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','user:%s','unmanaged','monitor_format','toUpperCase','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','forEach','string','picklist','type','content','variable','variableName','idField','toString','customVariable','name','toLowerCase','Variable','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','Zoho-oauthtoken\x20','users','findIndex','Agent\x20found!','Administrator','user','profile','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb903,0x185));var _0x3b90=function(_0x1eba2b,_0x3f8e79){_0x1eba2b=_0x1eba2b-0x0;var _0xf2f66c=_0xb903[_0x1eba2b];return _0xf2f66c;};'use strict';var _=require(_0x3b90('0x0'));var rp=require(_0x3b90('0x1'));var md5=require(_0x3b90('0x2'));var util=require(_0x3b90('0x3'));var intUtil=require('./util');var moment=require(_0x3b90('0x4'));var Redis=require(_0x3b90('0x5'));var BPromise=require(_0x3b90('0x6'));var config=require(_0x3b90('0x7'));var logger=require(_0x3b90('0x8'))(_0x3b90('0x9'));config[_0x3b90('0xa')]=_['defaults'](config[_0x3b90('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3b90('0xa')]));function emit(_0x2e4c06,_0x42efe8,_0x1b1fbf){io['to'](_0x2e4c06)['emit'](_0x42efe8,_0x1b1fbf);}function request(_0x5cda1d){logger['debug']('[HTTP]',JSON['stringify'](_0x5cda1d));return rp(_0x5cda1d);}function getCustomFields(_0x55db3f,_0x336913){var _0x5af39c={};if(_0x55db3f['length']>0x0){_[_0x3b90('0xb')](_0x55db3f,function(_0x233509){if(_['includes']([_0x3b90('0xc'),_0x3b90('0xd')],_0x233509[_0x3b90('0xe')])&&_0x233509['idField']){_0x5af39c[_0x233509['idField']]=_0x233509[_0x3b90('0xf')]['toString']();}else if(_0x233509['type']===_0x3b90('0x10')&&_0x233509[_0x3b90('0x11')]&&_0x233509['idField']&&_0x336913[_0x233509['variableName']]){_0x5af39c[_0x233509[_0x3b90('0x12')]]=_0x336913[_0x233509[_0x3b90('0x11')]][_0x3b90('0x13')]();}else if(_0x233509[_0x3b90('0xe')]===_0x3b90('0x14')&&_0x233509['Variable']&&_0x233509['Variable'][_0x3b90('0x15')]&&_0x233509[_0x3b90('0x12')]&&_0x336913[_0x233509['Variable'][_0x3b90('0x15')][_0x3b90('0x16')]()]){_0x5af39c[_0x233509[_0x3b90('0x12')]]=_0x336913[_0x233509[_0x3b90('0x17')]['name'][_0x3b90('0x16')]()]['toString']();}});}return _0x5af39c;}function getName(_0xd8d873){if(_0xd8d873[_0x3b90('0x18')]('\x20')>0x0){var _0x535894=_0xd8d873[_0x3b90('0x19')](/ (.+)/);if(_0x535894[0x1]){return _0x535894;}}return[_0xd8d873,_0xd8d873];}var accountsTokens={};function getAccessToken(_0x12e1cf){return new Promise(function(_0x3642c0,_0x3ce411){if(!_[_0x3b90('0x1a')](accountsTokens[_0x12e1cf['id']])&&!_[_0x3b90('0x1a')](accountsTokens[_0x12e1cf['id']][_0x3b90('0x1b')])){if(moment()[_0x3b90('0x1c')](accountsTokens[_0x12e1cf['id']][_0x3b90('0x1d')])){_0x3642c0(accountsTokens[_0x12e1cf['id']][_0x3b90('0x1b')]);}}var _0x4e2175;switch(_0x12e1cf[_0x3b90('0x1e')]){case'US':_0x4e2175=_0x3b90('0x1f');break;case'AU':_0x4e2175=_0x3b90('0x20');break;case'EU':_0x4e2175=_0x3b90('0x21');break;case'IN':_0x4e2175=_0x3b90('0x22');break;case'CN':_0x4e2175=_0x3b90('0x23');break;default:_0x4e2175='https://accounts.zoho.eu';break;}var _0x4b308c={'method':_0x3b90('0x24'),'uri':_0x4e2175+_0x3b90('0x25'),'qs':{'refresh_token':_0x12e1cf[_0x3b90('0x26')],'client_id':_0x12e1cf[_0x3b90('0x27')],'client_secret':_0x12e1cf['clientSecret'],'grant_type':_0x3b90('0x28')},'json':!![]};return rp(_0x4b308c)[_0x3b90('0x29')](function(_0x1787d1){accountsTokens[_0x12e1cf['id']]={'access_token':_0x1787d1['access_token'],'expires_in':moment()[_0x3b90('0x2a')](_0x1787d1[_0x3b90('0x1d')],_0x3b90('0x2b'))};_0x3642c0(_0x1787d1[_0x3b90('0x1b')]);})[_0x3b90('0x2c')](function(_0x7adf75){logger['error'](_0x3b90('0x2d'),_0x7adf75['stack']);_0x3ce411(_0x7adf75);});});}function getUser(_0xaf453c,_0x9891e4,_0x1a193e,_0x38eed0){logger[_0x3b90('0x2e')](_0x3b90('0x2f'));return request({'method':_0x3b90('0x30'),'uri':util[_0x3b90('0x31')]('https://www.zohoapis.%s/crm/v2/users',_0x9891e4),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x3b90('0x32')+_0xaf453c},'json':!![]})[_0x3b90('0x29')](function(_0x23484a){if(_0x23484a[_0x3b90('0x33')]){var _0x522ede=-0x1;if(_['isArrayLikeObject'](_0x23484a[_0x3b90('0x33')])){if(!_[_0x3b90('0x1a')](_0x38eed0)){_0x522ede=_[_0x3b90('0x34')](_0x23484a['users'],function(_0x41bd39){return _0x41bd39['email']===_0x38eed0;});}if(_0x522ede>=0x0){logger['info'](_0x3b90('0x35'));}else{logger[_0x3b90('0x2e')]('Using\x20the\x20admin\x20account!');_0x522ede=_[_0x3b90('0x34')](_0x23484a[_0x3b90('0x33')],function(_0x3e30b8){return _0x3e30b8['profile']['name']===_0x3b90('0x36');});}return _0x23484a[_0x3b90('0x33')][_0x522ede];}else{if(_0x23484a[_0x3b90('0x37')][_0x3b90('0x38')]['name']==='Administrator'){logger[_0x3b90('0x2e')](_0x3b90('0x39'));user=_0x23484a['user'];return user;}else{logger['error'](_0x3b90('0x3a'),JSON[_0x3b90('0x3b')](_0x23484a));throw new Error(_0x3b90('0x3c')+JSON[_0x3b90('0x3b')](_0x23484a));}}}else{logger['error'](_0x3b90('0x3a'),JSON['stringify'](_0x23484a));throw new Error(_0x3b90('0x3c')+JSON[_0x3b90('0x3b')](_0x23484a));}})[_0x3b90('0x2c')](function(_0x20abf8){console[_0x3b90('0x3d')](_0x20abf8);});}function getZohoUser(_0x3bf148,_0x96f7f3){return new BPromise(function(_0x534bea,_0x17aeb8){request(_0x3bf148)[_0x3b90('0x29')](function(_0x2fd30c){var _0x303922=null;if(_0x2fd30c){_0x303922=_0x2fd30c[_0x3b90('0x3e')][0x0];_0x303922[_0x3b90('0x3f')]=_0x96f7f3;}_0x534bea(_0x303922);})[_0x3b90('0x2c')](function(_0x3b6194){_0x17aeb8(_0x3b6194);});});}function createEndUser(_0x356e14,_0x5063b9,_0x369d0d,_0x1b915d,_0x40ce3a,_0x23cf0f){var _0x369d0d=getName(_0x369d0d);return request({'method':_0x3b90('0x24'),'uri':_0x3b90('0x40')+_0x5063b9+_0x3b90('0x41')+_[_0x3b90('0x42')](_0x23cf0f[_0x3b90('0x43')])+'s','body':{'data':[{'Last_Name':_0x369d0d[0x1],'First_Name':_0x369d0d[0x0],'Phone':_0x1b915d,'Owner':{'name':!_[_0x3b90('0x1a')](_0x40ce3a[_0x3b90('0x44')][_0x3b90('0x15')])?_0x40ce3a[_0x3b90('0x44')][_0x3b90('0x15')]:!_[_0x3b90('0x1a')](_0x40ce3a[_0x3b90('0x45')])?_0x40ce3a[_0x3b90('0x45')]+'\x20'+_0x40ce3a[_0x3b90('0x46')]:_0x40ce3a[_0x3b90('0x46')],'id':_0x40ce3a['id']}}]},'headers':{'Authorization':_0x3b90('0x32')+_0x356e14},'json':!![]})['then'](function(_0x28d70b){if(_0x28d70b&&_0x28d70b[_0x3b90('0x3e')][0x0][_0x3b90('0x47')]===_0x3b90('0x48')){var _0x5a48a9=_0x28d70b[_0x3b90('0x3e')][0x0]['details'];_0x5a48a9['enduserType']=_[_0x3b90('0x42')](_0x23cf0f[_0x3b90('0x43')])+'s';return _0x5a48a9;}logger['error'](_0x3b90('0x3a'),JSON[_0x3b90('0x3b')](data));throw new Error(_0x3b90('0x49')+JSON[_0x3b90('0x3b')](data));})[_0x3b90('0x2c')](function(_0x3fd5a1){console[_0x3b90('0x4a')](_0x3b90('0x4b'),_0x3fd5a1);});}function getEndUser(_0x28882e,_0x59b693,_0x3f71b0,_0x2e8a90,_0x4df41c,_0x1e9a21,_0x12e061){var _0x335c55={'method':_0x3b90('0x30'),'uri':'','headers':{'Authorization':_0x3b90('0x32')+_0x28882e},'json':!![]};switch(_0x12e061['moduleSearch']){case'contact_lead':_0x335c55[_0x3b90('0x4c')]='https://www.zohoapis.'+_0x59b693+_0x3b90('0x4d')+_0x4df41c+'))';return getZohoUser(_0x335c55,_0x3b90('0x4e'))[_0x3b90('0x29')](function(_0x27d0a8){if(_0x27d0a8)return _0x27d0a8;_0x335c55[_0x3b90('0x4c')]='https://www.zohoapis.'+_0x59b693+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4df41c+'))';return getZohoUser(_0x335c55,_0x3b90('0x4f'))[_0x3b90('0x29')](function(_0x9e2ee5){if(_0x9e2ee5)return _0x9e2ee5;if(_0x12e061['moduleCreate']!=_0x3b90('0x50')){return createEndUser(_0x28882e,_0x59b693,_0x2e8a90,_0x4df41c,_0x1e9a21,_0x12e061);}else{return{};}});});break;case _0x3b90('0x51'):_0x335c55[_0x3b90('0x4c')]=_0x3b90('0x40')+_0x59b693+_0x3b90('0x4d')+_0x4df41c+'))';return getZohoUser(_0x335c55,_0x3b90('0x4e'))[_0x3b90('0x29')](function(_0x13b364){if(_0x13b364)return _0x13b364;if(_0x12e061[_0x3b90('0x43')]!='nothing'){return createEndUser(_0x28882e,_0x59b693,_0x2e8a90,_0x4df41c,_0x1e9a21,_0x12e061);}else{return{};}});break;case _0x3b90('0x52'):_0x335c55[_0x3b90('0x4c')]=_0x3b90('0x40')+_0x59b693+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4df41c+'))';return getZohoUser(_0x335c55,_0x3b90('0x4f'))['then'](function(_0x288fbb){if(_0x288fbb)return _0x288fbb;if(_0x12e061[_0x3b90('0x43')]!=_0x3b90('0x50')){return createEndUser(_0x28882e,_0x59b693,_0x2e8a90,_0x4df41c,_0x1e9a21,_0x12e061);}else{return{};}});break;}}function getCall(_0x56f95d,_0x2a3fe8,_0x1ec976,_0x5334b5,_0x499ec1,_0x9ff1f4,_0x24337e,_0x1eb16e){logger[_0x3b90('0x2e')]('Creating\x20new\x20call...');var _0x5ee7e2={};_0x5ee7e2[_0x3b90('0x53')]={'name':!_[_0x3b90('0x1a')](_0x5334b5[_0x3b90('0x44')][_0x3b90('0x15')])&&!_[_0x3b90('0x1a')](_0x5334b5[_0x3b90('0x38')][_0x3b90('0x15')])&&_0x5334b5[_0x3b90('0x38')][_0x3b90('0x15')]==='administrator'?_0x5334b5[_0x3b90('0x44')][_0x3b90('0x15')]:!_['isNil'](_0x5334b5[_0x3b90('0x45')])?_0x5334b5[_0x3b90('0x45')]+'\x20'+_0x5334b5['last_name']:_0x5334b5[_0x3b90('0x46')],'id':_0x5334b5['id']};_0x5ee7e2[_0x3b90('0x54')]=intUtil[_0x3b90('0x55')](_0x9ff1f4[_0x3b90('0x56')],_0x24337e,'\x20');_0x5ee7e2[_0x3b90('0x57')]=intUtil[_0x3b90('0x55')](_0x9ff1f4[_0x3b90('0x58')],_0x24337e,'\x0a');if(_0x499ec1['enduserType']===_0x3b90('0x4e')){_0x5ee7e2[_0x3b90('0x59')]={'name':!_[_0x3b90('0x1a')](_0x499ec1[_0x3b90('0x5a')])?_0x499ec1[_0x3b90('0x5a')]:!_[_0x3b90('0x1a')](_0x499ec1[_0x3b90('0x5b')])?_0x499ec1[_0x3b90('0x5b')]+'\x20'+_0x499ec1[_0x3b90('0x5c')]:_0x499ec1[_0x3b90('0x5c')],'id':_0x499ec1['id']};}if(_0x499ec1[_0x3b90('0x3f')]===_0x3b90('0x4f')){_0x5ee7e2[_0x3b90('0x5d')]={'name':!_[_0x3b90('0x1a')](_0x499ec1[_0x3b90('0x5a')])?_0x499ec1['Full_Name']:!_[_0x3b90('0x1a')](_0x499ec1['First_Name'])?_0x499ec1[_0x3b90('0x5b')]+'\x20'+_0x499ec1[_0x3b90('0x5c')]:_0x499ec1[_0x3b90('0x5c')],'id':_0x499ec1['id']};_0x5ee7e2[_0x3b90('0x5e')]=_[_0x3b90('0x42')](_0x499ec1[_0x3b90('0x3f')]);}if(_0x24337e['talktime']){_0x5ee7e2[_0x3b90('0x5f')]=moment[_0x3b90('0x60')](parseInt(_0x24337e[_0x3b90('0x61')])*0x3e8)[_0x3b90('0x31')](_0x3b90('0x62'));}else if(_0x24337e[_0x3b90('0x63')]&&_0x24337e['endtime']){_0x5ee7e2[_0x3b90('0x5f')]=moment[_0x3b90('0x60')](moment(_0x24337e[_0x3b90('0x64')],'YYYY-MM-DDTHH:mm:ss')[_0x3b90('0x65')](moment(_0x24337e[_0x3b90('0x66')],_0x3b90('0x67'))))[_0x3b90('0x31')](_0x3b90('0x62'));}switch(_0x24337e[_0x3b90('0x68')]){case _0x3b90('0x69'):_0x5ee7e2[_0x3b90('0x6a')]=_0x3b90('0x6b');break;case'complete':case _0x3b90('0x6c'):_0x5ee7e2['Call_Result']='Answered';break;case _0x3b90('0x6d'):_0x5ee7e2[_0x3b90('0x6a')]='Rejected';break;case _0x3b90('0x6e'):_0x5ee7e2[_0x3b90('0x6a')]=_0x3b90('0x6f');break;case _0x3b90('0x70'):_0x5ee7e2[_0x3b90('0x6a')]=_0x3b90('0x71');default:}_0x5ee7e2[_0x3b90('0x72')]=(_0x1eb16e==='outbound'?moment(_0x24337e['starttime'])[_0x3b90('0x31')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x24337e[_0x3b90('0x73')])['format'](_0x3b90('0x67')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x5ee7e2['Call_Type']=_0x1eb16e||_0x3b90('0x74');_0x5ee7e2=_[_0x3b90('0x75')](_0x5ee7e2,getCustomFields(_0x9ff1f4[_0x3b90('0x76')],_0x24337e));return request({'method':_0x3b90('0x24'),'uri':_0x3b90('0x40')+_0x2a3fe8+_0x3b90('0x77'),'headers':{'Authorization':_0x3b90('0x32')+_0x56f95d},'body':{'data':[_0x5ee7e2]},'json':!![]})['then'](function(_0x5acf97){if(_0x5acf97&&_0x5acf97['data'][0x0][_0x3b90('0x47')]===_0x3b90('0x48')){logger['info'](_0x3b90('0x78'));return{'id':_0x5acf97[_0x3b90('0x3e')][0x0][_0x3b90('0x79')]['id']};}})[_0x3b90('0x2c')](function(_0x468ddb){logger[_0x3b90('0x2e')](_0x3b90('0x7a'),_0x468ddb[_0x3b90('0x7b')]);console[_0x3b90('0x4a')]('err',_0x468ddb);});}exports[_0x3b90('0x7c')]=function(_0x55dddd,_0x2bbbac,_0x2ddd93,_0x4b2c0f,_0x5b34f5,_0x389989){var _0x4337f0,_0x3f0f85,_0x2318d;_0x389989[_0x3b90('0x7d')]=intUtil[_0x3b90('0x7e')](_0x389989['host']);_0x389989[_0x3b90('0x7f')]=intUtil[_0x3b90('0x7e')](_0x389989[_0x3b90('0x7f')]);if(_0x5b34f5&&_0x5b34f5['monitor_format']){logger[_0x3b90('0x2e')]('[QUEUE]',_0x3b90('0x80'));_0x2bbbac[_0x3b90('0x81')]=_0x389989[_0x3b90('0x7f')]+_0x3b90('0x82')+_0x2bbbac[_0x3b90('0x83')]+_0x3b90('0x84')+md5(_0x2bbbac['uniqueid']);}else{_0x2bbbac[_0x3b90('0x81')]='';}var _0x230567=_0x389989[_0x3b90('0x7d')]===_0x3b90('0x85')?'eu':_0x3b90('0x86');return getAccessToken(_0x389989)[_0x3b90('0x29')](function(_0x23678f){_0x2318d=_0x23678f;return getUser(_0x2318d,_0x230567,_0x389989,_0x4b2c0f[_0x3b90('0x87')]);})['then'](function(_0x5f6bf9){_0x4337f0=_0x5f6bf9;logger[_0x3b90('0x2e')](_0x3b90('0x88'),_0x4337f0['id']);return getEndUser(_0x2318d,_0x230567,_0x389989,_0x2bbbac[_0x3b90('0x89')],_0x2bbbac[_0x3b90('0x8a')],_0x4337f0,_0x2ddd93);})[_0x3b90('0x29')](function(_0x1af213){_0x3f0f85=_0x1af213;return getCall(_0x2318d,_0x230567,_0x389989,_0x4337f0,_0x3f0f85,_0x2ddd93,_0x2bbbac,_0x3b90('0x74'));})['then'](function(_0x5b2469){if(_0x5b2469){logger[_0x3b90('0x2e')](_0x3b90('0x8b'),_0x5b2469['id']);logger[_0x3b90('0x2e')]('[QUEUE]',_0x3b90('0x8c'));emit(util['format']('user:%s',_0x4b2c0f[_0x3b90('0x15')]),_0x3b90('0x8d'),{'uri':_0x3b90('0x8e')+_0x389989[_0x3b90('0x7d')]+_0x3b90('0x8f')+_0x5b2469['id']});}})[_0x3b90('0x2c')](function(_0xb6678a){logger[_0x3b90('0x3d')](_0x3b90('0x90'),JSON[_0x3b90('0x3b')](_0xb6678a));});};exports[_0x3b90('0x91')]=function(_0x3a0a51,_0x2e621a,_0x241d6e,_0x122525,_0x4e8614,_0x212aa4,_0x98d7b0){var _0x4ea0b7,_0x2fa1ed,_0x47a50b;_0x212aa4[_0x3b90('0x7d')]=intUtil[_0x3b90('0x7e')](_0x212aa4[_0x3b90('0x7d')]);_0x212aa4['serverUrl']=intUtil[_0x3b90('0x7e')](_0x212aa4[_0x3b90('0x7f')]);if(_0x98d7b0&&_0x98d7b0[_0x3b90('0x92')]&&_0x98d7b0[_0x3b90('0x92')]!==_0x3b90('0x93')){logger[_0x3b90('0x2e')](_0x3b90('0x94'),_0x3b90('0x80'));_0x2e621a[_0x3b90('0x81')]=_0x212aa4[_0x3b90('0x7f')]+_0x3b90('0x82')+_0x2e621a[_0x3b90('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x2e621a['uniqueid']);}var _0x497ea7=_0x212aa4[_0x3b90('0x7d')]===_0x3b90('0x85')?'eu':_0x3b90('0x86');return getAccessToken(_0x212aa4)[_0x3b90('0x29')](function(_0x156ffd){_0x47a50b=_0x156ffd;return getUser(_0x47a50b,_0x497ea7,_0x212aa4,_0x122525[_0x3b90('0x87')]);})[_0x3b90('0x29')](function(_0x3472c8){_0x4ea0b7=_0x3472c8;logger[_0x3b90('0x2e')](_0x3b90('0x88'),_0x4ea0b7['id']);return getEndUser(_0x47a50b,_0x497ea7,_0x212aa4,_0x2e621a[_0x3b90('0x95')],_0x2e621a['destcalleridnum'],_0x4ea0b7,_0x241d6e);})['then'](function(_0x405f12){_0x2fa1ed=_0x405f12;return getCall(_0x47a50b,_0x497ea7,_0x212aa4,_0x4ea0b7,_0x2fa1ed,_0x241d6e,_0x2e621a,_0x3b90('0x96'));})[_0x3b90('0x29')](function(_0x1dc7e8){if(_0x1dc7e8){logger[_0x3b90('0x2e')](_0x3b90('0x8b'),_0x1dc7e8['id']);logger[_0x3b90('0x2e')](_0x3b90('0x94'),_0x3b90('0x8c'));emit(util[_0x3b90('0x31')](_0x3b90('0x97'),_0x122525[_0x3b90('0x15')]),_0x3b90('0x8d'),{'uri':_0x3b90('0x8e')+_0x212aa4[_0x3b90('0x7d')]+_0x3b90('0x8f')+_0x1dc7e8['id']});}})[_0x3b90('0x2c')](function(_0x4603c9){logger['error'](_0x3b90('0x94'),JSON[_0x3b90('0x3b')](_0x4603c9));});};exports[_0x3b90('0x98')]=function(_0x34fdf0,_0x22d7cb,_0x5558f7,_0x27d58d,_0x3148c0,_0x320fc2){var _0x2f5dc0,_0x38af7a,_0x38076d;_0x320fc2['host']=intUtil[_0x3b90('0x7e')](_0x320fc2['host']);_0x320fc2['serverUrl']=intUtil[_0x3b90('0x7e')](_0x320fc2[_0x3b90('0x7f')]);if(_0x3148c0&&_0x3148c0[_0x3b90('0x99')]){logger[_0x3b90('0x2e')]('['+_0x22d7cb[_0x3b90('0x68')]['toUpperCase']()+']',_0x3b90('0x80'));_0x22d7cb[_0x3b90('0x81')]=_0x320fc2[_0x3b90('0x7f')]+_0x3b90('0x82')+_0x22d7cb[_0x3b90('0x83')]+_0x3b90('0x84')+md5(_0x22d7cb[_0x3b90('0x83')]);}else{_0x22d7cb[_0x3b90('0x81')]='';}var _0x2c2e24=_0x320fc2[_0x3b90('0x7d')]===_0x3b90('0x85')?'eu':_0x3b90('0x86');return getAccessToken(_0x320fc2)[_0x3b90('0x29')](function(_0x313b07){_0x38076d=_0x313b07;return getUser(_0x38076d,_0x2c2e24,_0x320fc2);})[_0x3b90('0x29')](function(_0x1af0ea){_0x2f5dc0=_0x1af0ea;logger['info'](_0x3b90('0x88'),_0x2f5dc0['id']);return getEndUser(_0x38076d,_0x2c2e24,_0x320fc2,_0x22d7cb[_0x3b90('0x89')],_0x22d7cb[_0x3b90('0x8a')],_0x2f5dc0,_0x5558f7);})[_0x3b90('0x29')](function(_0x23d3b6){_0x38af7a=_0x23d3b6;return getCall(_0x38076d,_0x2c2e24,_0x320fc2,_0x2f5dc0,_0x38af7a,_0x5558f7,_0x22d7cb,_0x3b90('0x74'));})['then'](function(_0x39f02f){if(_0x39f02f){logger[_0x3b90('0x2e')](_0x3b90('0x8b'),_0x39f02f['id']);}})[_0x3b90('0x2c')](function(_0x1ae34b){logger['error']('['+_0x22d7cb[_0x3b90('0x68')][_0x3b90('0x9a')]()+']',JSON[_0x3b90('0x3b')](_0x1ae34b));});}; \ 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 c4b9bfb..dd304be 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x7a184c,_0x3751ed){var _0x4ceb93=function(_0xf9816e){while(--_0xf9816e){_0x7a184c['push'](_0x7a184c['shift']());}};_0x4ceb93(++_0x3751ed);}(_0x7a54,0x106));var _0x47a5=function(_0x3f5296,_0x35053d){_0x3f5296=_0x3f5296-0x0;var _0x4096e0=_0x7a54[_0x3f5296];return _0x4096e0;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x90c84c,_0x351760){var _0x22dda6=function(_0x1138ff){while(--_0x1138ff){_0x90c84c['push'](_0x90c84c['shift']());}};_0x22dda6(++_0x351760);}(_0x7a54,0x106));var _0x47a5=function(_0x55676e,_0x5b58ee){_0x55676e=_0x55676e-0x0;var _0x4cd868=_0x7a54[_0x55676e];return _0x4cd868;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index 4dbf21c..f89e427 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 _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x433390,_0x56cb16){var _0x4f3714=function(_0x20a7d2){while(--_0x20a7d2){_0x433390['push'](_0x433390['shift']());}};_0x4f3714(++_0x56cb16);}(_0x7a54,0x106));var _0x47a5=function(_0x479613,_0x2a9c00){_0x479613=_0x479613-0x0;var _0x1a39f2=_0x7a54[_0x479613];return _0x1a39f2;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});}; \ No newline at end of file +var _0xb10b=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x477ca6,_0x3c9b6b){var _0x3a3038=function(_0x47e779){while(--_0x47e779){_0x477ca6['push'](_0x477ca6['shift']());}};_0x3a3038(++_0x3c9b6b);}(_0xb10b,0x12a));var _0xbb10=function(_0x1255d6,_0x481067){_0x1255d6=_0x1255d6-0x0;var _0x1397af=_0xb10b[_0x1255d6];return _0x1397af;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index f86eec5..596ed2c 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 _0x9b2a=['request','then','rpc','error','message','catch','exports','jayson/promise','../../config/logger','routing','client','Request'];(function(_0x4bf73b,_0x13f15f){var _0x560f05=function(_0x39831f){while(--_0x39831f){_0x4bf73b['push'](_0x4bf73b['shift']());}};_0x560f05(++_0x13f15f);}(_0x9b2a,0x127));var _0xa9b2=function(_0x341a7d,_0x9a2a5e){_0x341a7d=_0x341a7d-0x0;var _0x21481b=_0x9b2a[_0x341a7d];return _0x21481b;};'use strict';var jayson=require(_0xa9b2('0x0'));var BPromise=require('bluebird');var logger=require(_0xa9b2('0x1'))(_0xa9b2('0x2'));var client=jayson[_0xa9b2('0x3')]['http']({'port':0x2329});client[_0xa9b2('0x4')]=function(_0x35ff38,_0x50f884){return new BPromise(function(_0x524e4b,_0x31b8b3){return client[_0xa9b2('0x5')](_0x35ff38,_0x50f884)[_0xa9b2('0x6')](function(_0xd7801e){logger['debug'](_0xa9b2('0x7'),_0xa9b2('0x2'),_0x35ff38,_0x50f884,_0xd7801e);if(_0xd7801e[_0xa9b2('0x8')]){logger['error'](_0xa9b2('0x7'),_0xa9b2('0x2'),_0x35ff38,_0xd7801e[_0xa9b2('0x8')][_0xa9b2('0x9')],_0x50f884);return _0x31b8b3(_0xd7801e[_0xa9b2('0x8')][_0xa9b2('0x9')]);}else{return _0x524e4b(_0xd7801e['result']);}})[_0xa9b2('0xa')](function(_0x590cb0){logger['error']('rpc',_0xa9b2('0x2'),_0x35ff38,_0x590cb0,_0x50f884);return _0x31b8b3(_0x590cb0);});});};module[_0xa9b2('0xb')]=client; \ No newline at end of file +var _0x851c=['routing','client','http','Request','request','then','debug','error','message','result','catch','rpc','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x17a8c4,_0x57e08a){var _0x14c96e=function(_0x211980){while(--_0x211980){_0x17a8c4['push'](_0x17a8c4['shift']());}};_0x14c96e(++_0x57e08a);}(_0x851c,0x19d));var _0xc851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851c[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0xc851('0x0'));var BPromise=require(_0xc851('0x1'));var logger=require(_0xc851('0x2'))(_0xc851('0x3'));var client=jayson[_0xc851('0x4')][_0xc851('0x5')]({'port':0x2329});client[_0xc851('0x6')]=function(_0x4ad892,_0x2fddd4){return new BPromise(function(_0x84f5ad,_0x52374b){return client[_0xc851('0x7')](_0x4ad892,_0x2fddd4)[_0xc851('0x8')](function(_0x535cf1){logger[_0xc851('0x9')]('rpc','routing',_0x4ad892,_0x2fddd4,_0x535cf1);if(_0x535cf1[_0xc851('0xa')]){logger['error']('rpc',_0xc851('0x3'),_0x4ad892,_0x535cf1[_0xc851('0xa')][_0xc851('0xb')],_0x2fddd4);return _0x52374b(_0x535cf1[_0xc851('0xa')][_0xc851('0xb')]);}else{return _0x84f5ad(_0x535cf1[_0xc851('0xc')]);}})[_0xc851('0xd')](function(_0x69ce5a){logger['error'](_0xc851('0xe'),_0xc851('0x3'),_0x4ad892,_0x69ce5a,_0x2fddd4);return _0x52374b(_0x69ce5a);});});};module[_0xc851('0xf')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1368f89..3482309 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 _0x5398=['catch','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','then','initMailAccounts','refresh','mailAccounts','listen','Setting','findOne','loginMailFrequency'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5398,0xe2));var _0x8539=function(_0xfbcec7,_0x24d860){_0xfbcec7=_0xfbcec7-0x0;var _0x1d8626=_0x5398[_0xfbcec7];return _0x1d8626;};'use strict';var BPromise=require('bluebird');var server=require(_0x8539('0x0'));var Realtime=require(_0x8539('0x1'));var EmailChannel=require(_0x8539('0x2'));var mailAccount=require(_0x8539('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x8539('0x4'))['db'];function initRealtime(){return BPromise[_0x8539('0x5')]()[_0x8539('0x6')](mailAccount['getMailAccounts']())['then'](realtime[_0x8539('0x7')]())[_0x8539('0x6')](function(){email[_0x8539('0x8')](realtime[_0x8539('0x9')]);return realtime;});}function main(){return server[_0x8539('0xa')](realtime,email)[_0x8539('0x6')](function(_0x47c5be){return initRealtime();})[_0x8539('0x6')](function(_0x3bf5c4){return db[_0x8539('0xb')][_0x8539('0xc')]({'attributes':['id',_0x8539('0xd')],'raw':!![]});})[_0x8539('0x6')](function(_0x33a30b){return setInterval(initRealtime,_0x33a30b[_0x8539('0xd')]*0x3e8);})[_0x8539('0xe')](function(_0x3727b3){console['log'](_0x3727b3);});}main(); \ No newline at end of file +var _0xab29=['then','getMailAccounts','initMailAccounts','mailAccounts','listen','Setting','findOne','loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','../../mysqldb'];(function(_0x474c66,_0xbce925){var _0xcbd9bf=function(_0x44019d){while(--_0x44019d){_0x474c66['push'](_0x474c66['shift']());}};_0xcbd9bf(++_0xbce925);}(_0xab29,0x145));var _0x9ab2=function(_0x5597d9,_0x1c50dd){_0x5597d9=_0x5597d9-0x0;var _0x9c1d5e=_0xab29[_0x5597d9];return _0x9c1d5e;};'use strict';var BPromise=require(_0x9ab2('0x0'));var server=require(_0x9ab2('0x1'));var Realtime=require(_0x9ab2('0x2'));var EmailChannel=require(_0x9ab2('0x3'));var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x9ab2('0x4'))['db'];function initRealtime(){return BPromise['resolve']()[_0x9ab2('0x5')](mailAccount[_0x9ab2('0x6')]())[_0x9ab2('0x5')](realtime[_0x9ab2('0x7')]())[_0x9ab2('0x5')](function(){email['refresh'](realtime[_0x9ab2('0x8')]);return realtime;});}function main(){return server[_0x9ab2('0x9')](realtime,email)[_0x9ab2('0x5')](function(_0x3c73e5){return initRealtime();})[_0x9ab2('0x5')](function(_0x564109){return db[_0x9ab2('0xa')][_0x9ab2('0xb')]({'attributes':['id',_0x9ab2('0xc')],'raw':!![]});})[_0x9ab2('0x5')](function(_0x3ef35c){return setInterval(initRealtime,_0x3ef35c[_0x9ab2('0xc')]*0x3e8);})[_0x9ab2('0xd')](function(_0xb229a2){console[_0x9ab2('0xe')](_0xb229a2);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 1d11d40..37545b4 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 _0x3b5b=['prototype','emit','name','key','active','status','messageStatus','Imap','total','isNil','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','handleImapError','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','error','smtp','send','verifySmtp','Smtp','lastSync','verify','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts'];(function(_0x57eaef,_0x560244){var _0x317298=function(_0x6f5345){while(--_0x6f5345){_0x57eaef['push'](_0x57eaef['shift']());}};_0x317298(++_0x560244);}(_0x3b5b,0x1a7));var _0xb3b5=function(_0x24d8db,_0x2392c6){_0x24d8db=_0x24d8db-0x0;var _0x13d20d=_0x3b5b[_0x24d8db];return _0x13d20d;};'use strict';var _=require(_0xb3b5('0x0'));var moment=require('moment');var BPromise=require(_0xb3b5('0x1'));var md5=require(_0xb3b5('0x2'));var Redis=require(_0xb3b5('0x3'));var config=require(_0xb3b5('0x4'));var logger=require(_0xb3b5('0x5'))(_0xb3b5('0x6'));config[_0xb3b5('0x7')]=_[_0xb3b5('0x8')](config[_0xb3b5('0x7')],{'host':_0xb3b5('0x9'),'port':0x18eb});var io=require(_0xb3b5('0xa'))(new Redis(config[_0xb3b5('0x7')]));var EmailImap=require(_0xb3b5('0xb'));var EmailSmtp=require(_0xb3b5('0xc'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x56db9d){logger[_0xb3b5('0xd')](_0xb3b5('0xe'));this[_0xb3b5('0xf')]=_0x56db9d[_0xb3b5('0xf')];this[_0xb3b5('0x10')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xb3b5('0x11')][_0xb3b5('0x12')]=function(_0x2622db){var _0x3d4898=this['mailAccounts'][_0x2622db];var _0x59af9d={'id':_0x3d4898['id'],'name':_0x3d4898[_0xb3b5('0x13')],'key':_0x3d4898[_0xb3b5('0x14')],'active':_0x3d4898[_0xb3b5('0x15')],'Imap':{'status':_0x3d4898['Imap'][_0xb3b5('0x16')],'messageStatus':_0x3d4898['Imap'][_0xb3b5('0x17')],'total':_0x3d4898[_0xb3b5('0x18')][_0xb3b5('0x19')]}};if(_[_0xb3b5('0x1a')](md5Accounts[_0x2622db])){md5Accounts[_0x2622db]={};}var _0x7e7448=md5(JSON['stringify'](_0x59af9d));if(md5Accounts[_0x2622db][_0xb3b5('0x2')]!==_0x7e7448){md5Accounts[_0x2622db][_0xb3b5('0x2')]=_0x7e7448;io['emit'](_0xb3b5('0x1b'),_0x59af9d);}};EmailChannel[_0xb3b5('0x11')][_0xb3b5('0x1c')]=function(_0x2bb01c){for(var _0x29c87e in _0x2bb01c){if(_0x2bb01c[_0xb3b5('0x1d')](_0x29c87e)){if(_0x2bb01c[_0x29c87e][_0xb3b5('0x18')]&&_0x2bb01c[_0x29c87e][_0xb3b5('0x15')]){var _0x4ad44a=_0x2bb01c[_0x29c87e][_0xb3b5('0x18')];if(!this[_0xb3b5('0x10')][_0xb3b5('0x1d')](_0x4ad44a['id'])){this[_0xb3b5('0x10')][_0x4ad44a['id']]=new EmailImap(_0x4ad44a,_0x2bb01c[_0x29c87e][_0xb3b5('0x6')]);this[_0xb3b5('0x10')][_0x4ad44a['id']]['on'](_0xb3b5('0x1e'),this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this,_0x29c87e));this['imapAccounts'][_0x4ad44a['id']]['on'](_0xb3b5('0x6'),this[_0xb3b5('0x21')][_0xb3b5('0x20')](this,_0x29c87e));this[_0xb3b5('0x10')][_0x4ad44a['id']]['on']('end',this[_0xb3b5('0x22')][_0xb3b5('0x20')](this,_0x29c87e));this[_0xb3b5('0x10')][_0x4ad44a['id']]['on']('error',this[_0xb3b5('0x23')][_0xb3b5('0x20')](this,_0x29c87e));}}else{if(_[_0xb3b5('0x1a')](this[_0xb3b5('0xf')][_0x29c87e][_0xb3b5('0x18')])){this[_0xb3b5('0xf')][_0x29c87e][_0xb3b5('0x18')]={};}this['mailAccounts'][_0x29c87e][_0xb3b5('0x18')]['status']=_0xb3b5('0x24');this[_0xb3b5('0xf')][_0x29c87e]['Imap'][_0xb3b5('0x17')]='';this[_0xb3b5('0x12')](_0x29c87e);}}}};EmailChannel[_0xb3b5('0x11')][_0xb3b5('0x1f')]=function(_0x4bfff7,_0x395476){if(this[_0xb3b5('0xf')][_0x4bfff7]){this['mailAccounts'][_0x4bfff7][_0xb3b5('0x18')][_0xb3b5('0x16')]=_0xb3b5('0x25');this[_0xb3b5('0xf')][_0x4bfff7][_0xb3b5('0x18')][_0xb3b5('0x17')]=_0x395476[_0xb3b5('0x13')];if(_0x395476[_0xb3b5('0x26')]){this[_0xb3b5('0xf')][_0x4bfff7][_0xb3b5('0x18')][_0xb3b5('0x19')]=_0x395476['messages'][_0xb3b5('0x19')];}return this[_0xb3b5('0x12')](_0x4bfff7);}};EmailChannel[_0xb3b5('0x11')][_0xb3b5('0x21')]=function(_0x3d8819,_0x4ee1d6){logger[_0xb3b5('0xd')](_0xb3b5('0x27'),_0x4ee1d6[_0xb3b5('0x28')],_0x4ee1d6['lastName'],_0x4ee1d6[_0xb3b5('0x29')],_0x3d8819);if(this[_0xb3b5('0xf')][_0x3d8819]){return mailAccount[_0xb3b5('0x2a')](_0x3d8819,_0x4ee1d6)[_0xb3b5('0x2b')](function(_0x4fc058){if(_0x4fc058){logger[_0xb3b5('0xd')](_0xb3b5('0x2c'));}})[_0xb3b5('0x2d')](function(_0x29c269){logger['error'](_0xb3b5('0x2e'),JSON['stringify'](_0x29c269));});}};EmailChannel[_0xb3b5('0x11')]['handleImapEnd']=function(_0x4617a8){if(this['mailAccounts'][_0x4617a8]&&this['mailAccounts'][_0x4617a8][_0xb3b5('0x18')]){if(this[_0xb3b5('0x10')][this[_0xb3b5('0xf')][_0x4617a8][_0xb3b5('0x18')]['id']]){delete this[_0xb3b5('0x10')][this[_0xb3b5('0xf')][_0x4617a8]['Imap']['id']];}this[_0xb3b5('0xf')][_0x4617a8][_0xb3b5('0x18')]['lastSync']=moment();this[_0xb3b5('0x12')](_0x4617a8);}};EmailChannel['prototype'][_0xb3b5('0x23')]=function(_0x17777c,_0x2ee746){if(this[_0xb3b5('0xf')][_0x17777c]){this[_0xb3b5('0xf')][_0x17777c][_0xb3b5('0x18')]['status']=_0xb3b5('0x2f');this[_0xb3b5('0xf')][_0x17777c][_0xb3b5('0x18')][_0xb3b5('0x17')]=_0x2ee746;return this[_0xb3b5('0x12')](_0x17777c);}};EmailChannel[_0xb3b5('0x11')]['sendMail']=function(_0x4ba2fe,_0x2371c7){return this[_0xb3b5('0x30')][_0xb3b5('0x31')](_0x4ba2fe,_0x2371c7);};EmailChannel[_0xb3b5('0x11')][_0xb3b5('0x32')]=function(_0x3b0449){var _0x3e2bcf=this;if(this[_0xb3b5('0xf')][_0x3b0449['id']]){if(_[_0xb3b5('0x1a')](this['mailAccounts'][_0x3b0449['id']]['Smtp'])){this['mailAccounts'][_0x3b0449['id']]['Smtp']={};}this['mailAccounts'][_0x3b0449['id']][_0xb3b5('0x33')][_0xb3b5('0x34')]=moment();return new BPromise(function(_0x1744be,_0x2553e0){return _0x3e2bcf[_0xb3b5('0x30')]['verify'](_0x3b0449)[_0xb3b5('0x2b')](function(_0x5348cd){_0x3e2bcf[_0xb3b5('0xf')][_0x3b0449['id']]['Smtp'][_0xb3b5('0x16')]='verified';_0x3e2bcf[_0xb3b5('0xf')][_0x3b0449['id']][_0xb3b5('0x33')][_0xb3b5('0x17')]='';_0x3e2bcf['emit'](_0x3b0449['id']);_0x1744be(_0x5348cd);})['catch'](function(_0x5071d0){_0x3e2bcf['mailAccounts'][_0x3b0449['id']][_0xb3b5('0x33')][_0xb3b5('0x16')]=_0xb3b5('0x2f');_0x3e2bcf['mailAccounts'][_0x3b0449['id']]['Smtp'][_0xb3b5('0x17')]=_0x5071d0;_0x3e2bcf[_0xb3b5('0x12')](_0x3b0449['id']);_0x2553e0(_0x5071d0);});});}return this[_0xb3b5('0x30')][_0xb3b5('0x35')](_0x3b0449);};module[_0xb3b5('0x36')]=EmailChannel; \ No newline at end of file +var _0xaf26=['isNil','disabled','messageStatus','connected','total','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','send','verifySmtp','Smtp','lastSync','verify','verified','catch','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','Imap','status','stringify','refresh','active','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError'];(function(_0x44cc6b,_0x542ff9){var _0x18746a=function(_0x32b34f){while(--_0x32b34f){_0x44cc6b['push'](_0x44cc6b['shift']());}};_0x18746a(++_0x542ff9);}(_0xaf26,0x1c3));var _0x6af2=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0xaf26[_0x218972];return _0x1bb1a8;};'use strict';var _=require('lodash');var moment=require(_0x6af2('0x0'));var BPromise=require(_0x6af2('0x1'));var md5=require(_0x6af2('0x2'));var Redis=require(_0x6af2('0x3'));var config=require(_0x6af2('0x4'));var logger=require(_0x6af2('0x5'))(_0x6af2('0x6'));config['redis']=_['defaults'](config[_0x6af2('0x7')],{'host':_0x6af2('0x8'),'port':0x18eb});var io=require(_0x6af2('0x9'))(new Redis(config[_0x6af2('0x7')]));var EmailImap=require(_0x6af2('0xa'));var EmailSmtp=require(_0x6af2('0xb'));var mailAccount=require(_0x6af2('0xc'));var md5Accounts={};function EmailChannel(_0x43bed7){logger['info'](_0x6af2('0xd'));this['mailAccounts']=_0x43bed7[_0x6af2('0xe')];this[_0x6af2('0xf')]={};this[_0x6af2('0x10')]=new EmailSmtp();}EmailChannel[_0x6af2('0x11')][_0x6af2('0x12')]=function(_0x1d04a6){var _0x27a8f2=this['mailAccounts'][_0x1d04a6];var _0x3e9b9a={'id':_0x27a8f2['id'],'name':_0x27a8f2[_0x6af2('0x13')],'key':_0x27a8f2[_0x6af2('0x14')],'active':_0x27a8f2['active'],'Imap':{'status':_0x27a8f2[_0x6af2('0x15')][_0x6af2('0x16')],'messageStatus':_0x27a8f2['Imap']['messageStatus'],'total':_0x27a8f2[_0x6af2('0x15')]['total']}};if(_['isNil'](md5Accounts[_0x1d04a6])){md5Accounts[_0x1d04a6]={};}var _0x3ea030=md5(JSON[_0x6af2('0x17')](_0x3e9b9a));if(md5Accounts[_0x1d04a6]['md5']!==_0x3ea030){md5Accounts[_0x1d04a6][_0x6af2('0x2')]=_0x3ea030;io[_0x6af2('0x12')]('mailAccount:update',_0x3e9b9a);}};EmailChannel[_0x6af2('0x11')][_0x6af2('0x18')]=function(_0x2db4a7){for(var _0x207ae6 in _0x2db4a7){if(_0x2db4a7['hasOwnProperty'](_0x207ae6)){if(_0x2db4a7[_0x207ae6][_0x6af2('0x15')]&&_0x2db4a7[_0x207ae6][_0x6af2('0x19')]){var _0x4c19d2=_0x2db4a7[_0x207ae6][_0x6af2('0x15')];if(!this['imapAccounts'][_0x6af2('0x1a')](_0x4c19d2['id'])){this[_0x6af2('0xf')][_0x4c19d2['id']]=new EmailImap(_0x4c19d2,_0x2db4a7[_0x207ae6][_0x6af2('0x6')]);this[_0x6af2('0xf')][_0x4c19d2['id']]['on'](_0x6af2('0x1b'),this[_0x6af2('0x1c')]['bind'](this,_0x207ae6));this[_0x6af2('0xf')][_0x4c19d2['id']]['on']('email',this[_0x6af2('0x1d')][_0x6af2('0x1e')](this,_0x207ae6));this['imapAccounts'][_0x4c19d2['id']]['on'](_0x6af2('0x1f'),this[_0x6af2('0x20')][_0x6af2('0x1e')](this,_0x207ae6));this[_0x6af2('0xf')][_0x4c19d2['id']]['on'](_0x6af2('0x21'),this[_0x6af2('0x22')]['bind'](this,_0x207ae6));}}else{if(_[_0x6af2('0x23')](this[_0x6af2('0xe')][_0x207ae6][_0x6af2('0x15')])){this[_0x6af2('0xe')][_0x207ae6][_0x6af2('0x15')]={};}this[_0x6af2('0xe')][_0x207ae6][_0x6af2('0x15')][_0x6af2('0x16')]=_0x6af2('0x24');this['mailAccounts'][_0x207ae6]['Imap'][_0x6af2('0x25')]='';this[_0x6af2('0x12')](_0x207ae6);}}}};EmailChannel['prototype'][_0x6af2('0x1c')]=function(_0xa8c486,_0x176f0e){if(this[_0x6af2('0xe')][_0xa8c486]){this[_0x6af2('0xe')][_0xa8c486][_0x6af2('0x15')][_0x6af2('0x16')]=_0x6af2('0x26');this[_0x6af2('0xe')][_0xa8c486][_0x6af2('0x15')][_0x6af2('0x25')]=_0x176f0e[_0x6af2('0x13')];if(_0x176f0e['messages']){this[_0x6af2('0xe')][_0xa8c486][_0x6af2('0x15')][_0x6af2('0x27')]=_0x176f0e['messages'][_0x6af2('0x27')];}return this[_0x6af2('0x12')](_0xa8c486);}};EmailChannel[_0x6af2('0x11')]['handleImapEmail']=function(_0x470235,_0x135e94){logger[_0x6af2('0x28')](_0x6af2('0x29'),_0x135e94[_0x6af2('0x2a')],_0x135e94['lastName'],_0x135e94[_0x6af2('0x2b')],_0x470235);if(this[_0x6af2('0xe')][_0x470235]){return mailAccount[_0x6af2('0x2c')](_0x470235,_0x135e94)[_0x6af2('0x2d')](function(_0x3899b8){if(_0x3899b8){logger[_0x6af2('0x28')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x1732b3){logger[_0x6af2('0x21')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x6af2('0x17')](_0x1732b3));});}};EmailChannel[_0x6af2('0x11')][_0x6af2('0x20')]=function(_0x27dbe4){if(this[_0x6af2('0xe')][_0x27dbe4]&&this[_0x6af2('0xe')][_0x27dbe4][_0x6af2('0x15')]){if(this[_0x6af2('0xf')][this[_0x6af2('0xe')][_0x27dbe4][_0x6af2('0x15')]['id']]){delete this[_0x6af2('0xf')][this['mailAccounts'][_0x27dbe4][_0x6af2('0x15')]['id']];}this[_0x6af2('0xe')][_0x27dbe4][_0x6af2('0x15')]['lastSync']=moment();this[_0x6af2('0x12')](_0x27dbe4);}};EmailChannel[_0x6af2('0x11')]['handleImapError']=function(_0x577260,_0x14e81e){if(this['mailAccounts'][_0x577260]){this[_0x6af2('0xe')][_0x577260][_0x6af2('0x15')]['status']=_0x6af2('0x21');this[_0x6af2('0xe')][_0x577260][_0x6af2('0x15')][_0x6af2('0x25')]=_0x14e81e;return this[_0x6af2('0x12')](_0x577260);}};EmailChannel[_0x6af2('0x11')]['sendMail']=function(_0x222ab4,_0x524197){return this['smtp'][_0x6af2('0x2e')](_0x222ab4,_0x524197);};EmailChannel[_0x6af2('0x11')][_0x6af2('0x2f')]=function(_0x47438c){var _0x2e3d12=this;if(this[_0x6af2('0xe')][_0x47438c['id']]){if(_['isNil'](this[_0x6af2('0xe')][_0x47438c['id']][_0x6af2('0x30')])){this[_0x6af2('0xe')][_0x47438c['id']][_0x6af2('0x30')]={};}this[_0x6af2('0xe')][_0x47438c['id']]['Smtp'][_0x6af2('0x31')]=moment();return new BPromise(function(_0x50f700,_0xa61d5){return _0x2e3d12[_0x6af2('0x10')][_0x6af2('0x32')](_0x47438c)['then'](function(_0x5e0cb5){_0x2e3d12['mailAccounts'][_0x47438c['id']][_0x6af2('0x30')][_0x6af2('0x16')]=_0x6af2('0x33');_0x2e3d12['mailAccounts'][_0x47438c['id']]['Smtp'][_0x6af2('0x25')]='';_0x2e3d12[_0x6af2('0x12')](_0x47438c['id']);_0x50f700(_0x5e0cb5);})[_0x6af2('0x34')](function(_0x1a71cd){_0x2e3d12[_0x6af2('0xe')][_0x47438c['id']]['Smtp'][_0x6af2('0x16')]='error';_0x2e3d12['mailAccounts'][_0x47438c['id']]['Smtp']['messageStatus']=_0x1a71cd;_0x2e3d12['emit'](_0x47438c['id']);_0xa61d5(_0x1a71cd);});});}return this[_0x6af2('0x10')][_0x6af2('0x32')](_0x47438c);};module[_0x6af2('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 8d69bbb..a455a15 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 _0xa363=['handleFetchMessage','handleFetchError','end','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','handleMessageEnd','handleSimpleParser','parser','emit','textCode','upperFirst','path','util','imap','lodash','randomstring','mailparser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','account','once','ready','bind','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','required','getHost','service','anonymous@xcally.com','handleReady','openBox','handleOpenBox','box','readUnseen','handleReadUnseen','message'];(function(_0xeb181c,_0x460333){var _0x2c1bf0=function(_0x13aa55){while(--_0x13aa55){_0xeb181c['push'](_0xeb181c['shift']());}};_0x2c1bf0(++_0x460333);}(_0xa363,0x84));var _0x3a36=function(_0xc1a760,_0x52c58d){_0xc1a760=_0xc1a760-0x0;var _0x43d11e=_0xa363[_0xc1a760];return _0x43d11e;};'use strict';var fs=require('fs');var path=require(_0x3a36('0x0'));var util=require(_0x3a36('0x1'));var Imap=require(_0x3a36('0x2'));var _=require(_0x3a36('0x3'));var rs=require(_0x3a36('0x4'));var simpleParser=require(_0x3a36('0x5'))['simpleParser'];var Iconv=require(_0x3a36('0x6'))[_0x3a36('0x7')];var EventEmitter=require('events')[_0x3a36('0x8')];var utils=require(_0x3a36('0x9'));var logger=require(_0x3a36('0xa'))(_0x3a36('0xb'));function EmailImap(_0x3d24be,_0x105c72){this[_0x3a36('0xc')]=_0x3a36('0xd');this['account']=this[_0x3a36('0xe')](_0x3d24be,_0x105c72);this[_0x3a36('0x2')]=new Imap(this[_0x3a36('0xf')]);this['imap'][_0x3a36('0x10')](_0x3a36('0x11'),this['handleReady'][_0x3a36('0x12')](this));this[_0x3a36('0x2')][_0x3a36('0x10')]('end',this[_0x3a36('0x13')][_0x3a36('0x12')](this));this[_0x3a36('0x2')]['on'](_0x3a36('0x14'),this[_0x3a36('0x15')][_0x3a36('0x12')](this));this['imap'][_0x3a36('0x16')]();}util[_0x3a36('0x17')](EmailImap,EventEmitter);EmailImap[_0x3a36('0x18')]['getAccount']=function(_0x2651f5,_0x173ad6){var _0x385649={'connTimeout':_0x2651f5[_0x3a36('0x19')]?_0x2651f5['connTimeout']*0x3e8:0x2710,'authTimeout':_0x2651f5['authTimeout']?_0x2651f5[_0x3a36('0x1a')]*0x3e8:0x1388};if(_[_0x3a36('0x1b')](_0x2651f5['service'])){if(_0x2651f5[_0x3a36('0x1c')]){_0x385649[_0x3a36('0x1d')]=_0x2651f5[_0x3a36('0x1d')];_0x385649['password']=_0x2651f5[_0x3a36('0x1e')];}_0x385649[_0x3a36('0x1f')]=_0x2651f5[_0x3a36('0x1f')];_0x385649[_0x3a36('0x20')]=_0x2651f5[_0x3a36('0x20')]||0x3e1;if(_0x2651f5[_0x3a36('0x21')]){_0x385649[_0x3a36('0x21')]=!![];}else{_0x385649[_0x3a36('0x21')]=![];_0x385649['autotls']=_0x3a36('0x22');}}else{_0x385649[_0x3a36('0x1d')]=_0x2651f5[_0x3a36('0x1d')];_0x385649[_0x3a36('0x1e')]=_0x2651f5[_0x3a36('0x1e')];_0x385649['host']=utils[_0x3a36('0x23')](_0x2651f5[_0x3a36('0x24')]);_0x385649[_0x3a36('0x20')]=0x3e1;_0x385649['tls']=!![];}_0x385649[_0x3a36('0xb')]=_0x173ad6||_0x2651f5[_0x3a36('0x1d')]||_0x3a36('0x25');return _0x385649;};EmailImap[_0x3a36('0x18')][_0x3a36('0x26')]=function(){this[_0x3a36('0x2')][_0x3a36('0x27')](this[_0x3a36('0xc')],![],this[_0x3a36('0x28')][_0x3a36('0x12')](this));};EmailImap[_0x3a36('0x18')][_0x3a36('0x28')]=function(_0x2359eb,_0x1bd0ab){if(_0x2359eb){this['handleError'](_0x2359eb,!![]);}else{this['emit'](_0x3a36('0x29'),_0x1bd0ab);this[_0x3a36('0x2a')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x35f35e){if(_0x35f35e){this[_0x3a36('0x15')](_0x35f35e,!![]);}else{this[_0x3a36('0x2')]['end']();}};EmailImap['prototype'][_0x3a36('0x2a')]=function(){this[_0x3a36('0x2')]['search'](['UNSEEN'],this[_0x3a36('0x2b')][_0x3a36('0x12')](this));};EmailImap[_0x3a36('0x18')]['handleReadUnseen']=function(_0x346473,_0x329020){if(_0x346473){this[_0x3a36('0x15')](_0x346473,!![]);}else{if(_0x329020['length']){try{var _0x2fa147=this[_0x3a36('0x2')]['fetch'](_0x329020,{'bodies':'','markSeen':!![]});_0x2fa147['on'](_0x3a36('0x2c'),this[_0x3a36('0x2d')][_0x3a36('0x12')](this));_0x2fa147['once'](_0x3a36('0x14'),this[_0x3a36('0x2e')][_0x3a36('0x12')](this));_0x2fa147[_0x3a36('0x10')](_0x3a36('0x2f'),this[_0x3a36('0x30')]['bind'](this));}catch(_0x43cc6b){logger[_0x3a36('0x14')](_0x43cc6b);}}else{this[_0x3a36('0x2')][_0x3a36('0x31')](!![],this[_0x3a36('0x32')][_0x3a36('0x12')](this));}}};EmailImap[_0x3a36('0x18')][_0x3a36('0x2d')]=function(_0x21b0fc,_0x3edae4){_0x21b0fc['on'](_0x3a36('0x33'),this[_0x3a36('0x34')][_0x3a36('0x12')](this));_0x21b0fc['once']('attributes',this['handleMessageAttributes'][_0x3a36('0x12')](this));_0x21b0fc['once'](_0x3a36('0x2f'),this[_0x3a36('0x35')][_0x3a36('0x12')](this));};EmailImap['prototype'][_0x3a36('0x34')]=function(_0x734413,_0x4215a8){simpleParser(_0x734413,{'Iconv':Iconv},this[_0x3a36('0x36')][_0x3a36('0x12')](this));};EmailImap[_0x3a36('0x18')]['handleMessageAttributes']=function(_0x35a483){};EmailImap[_0x3a36('0x18')]['handleMessageEnd']=function(){};EmailImap[_0x3a36('0x18')][_0x3a36('0x36')]=function(_0x37b889,_0x224917){if(_0x37b889){logger['error'](_0x37b889);}else{var _0x19fdca=this;utils[_0x3a36('0x37')](this['account'],_0x224917,function(_0x7fb46d){_0x19fdca[_0x3a36('0x38')]('email',_0x7fb46d);});}};EmailImap[_0x3a36('0x18')][_0x3a36('0x30')]=function(){this[_0x3a36('0x2')][_0x3a36('0x31')](!![],this[_0x3a36('0x32')][_0x3a36('0x12')](this));};EmailImap[_0x3a36('0x18')][_0x3a36('0x2e')]=function(_0x3796a7){this[_0x3a36('0x15')](_0x3796a7);this['imap'][_0x3a36('0x31')](!![],this[_0x3a36('0x32')][_0x3a36('0x12')](this));};EmailImap['prototype'][_0x3a36('0x13')]=function(){this[_0x3a36('0x38')]('end');};EmailImap[_0x3a36('0x18')][_0x3a36('0x15')]=function(_0x4fdddc,_0x2fd8d2){logger[_0x3a36('0x14')](_0x3a36('0x15'),this[_0x3a36('0xf')]['email'],JSON['stringify'](_0x4fdddc));var _0x597f1e='';if(_0x4fdddc){if(_0x4fdddc[_0x3a36('0x39')]){_0x597f1e=_0x4fdddc[_0x3a36('0x39')];}else{for(var _0x43e9b3 in _0x4fdddc){if(_0x4fdddc['hasOwnProperty'](_0x43e9b3)){_0x597f1e+=_[_0x3a36('0x3a')](_0x43e9b3)+':\x20'+_0x4fdddc[_0x43e9b3]+'\x0a';}}}}if(_0x2fd8d2){this[_0x3a36('0x2')][_0x3a36('0x2f')]();}else{this[_0x3a36('0x38')](_0x3a36('0x14'),_0x597f1e);this['emit'](_0x3a36('0x2f'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xfc3c=['parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','randomstring','mailparser','simpleParser','Iconv','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','password','host','port','tls','autotls','required','anonymous@xcally.com','openBox','emit','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser'];(function(_0x1cc4e1,_0x1629d4){var _0x192d47=function(_0x40dbe2){while(--_0x40dbe2){_0x1cc4e1['push'](_0x1cc4e1['shift']());}};_0x192d47(++_0x1629d4);}(_0xfc3c,0x1ab));var _0xcfc3=function(_0x506cbe,_0x818678){_0x506cbe=_0x506cbe-0x0;var _0x4fdaa7=_0xfc3c[_0x506cbe];return _0x4fdaa7;};'use strict';var fs=require('fs');var path=require(_0xcfc3('0x0'));var util=require(_0xcfc3('0x1'));var Imap=require(_0xcfc3('0x2'));var _=require('lodash');var rs=require(_0xcfc3('0x3'));var simpleParser=require(_0xcfc3('0x4'))[_0xcfc3('0x5')];var Iconv=require('iconv')[_0xcfc3('0x6')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0xcfc3('0x7'));var logger=require(_0xcfc3('0x8'))(_0xcfc3('0x9'));function EmailImap(_0x1eaef2,_0x964ded){this[_0xcfc3('0xa')]=_0xcfc3('0xb');this[_0xcfc3('0xc')]=this[_0xcfc3('0xd')](_0x1eaef2,_0x964ded);this[_0xcfc3('0x2')]=new Imap(this[_0xcfc3('0xc')]);this[_0xcfc3('0x2')][_0xcfc3('0xe')](_0xcfc3('0xf'),this[_0xcfc3('0x10')][_0xcfc3('0x11')](this));this[_0xcfc3('0x2')][_0xcfc3('0xe')](_0xcfc3('0x12'),this[_0xcfc3('0x13')][_0xcfc3('0x11')](this));this[_0xcfc3('0x2')]['on'](_0xcfc3('0x14'),this[_0xcfc3('0x15')][_0xcfc3('0x11')](this));this['imap'][_0xcfc3('0x16')]();}util[_0xcfc3('0x17')](EmailImap,EventEmitter);EmailImap[_0xcfc3('0x18')][_0xcfc3('0xd')]=function(_0x45bbd3,_0x409733){var _0x5c7521={'connTimeout':_0x45bbd3['connTimeout']?_0x45bbd3[_0xcfc3('0x19')]*0x3e8:0x2710,'authTimeout':_0x45bbd3[_0xcfc3('0x1a')]?_0x45bbd3[_0xcfc3('0x1a')]*0x3e8:0x1388};if(_[_0xcfc3('0x1b')](_0x45bbd3[_0xcfc3('0x1c')])){if(_0x45bbd3['authentication']){_0x5c7521['user']=_0x45bbd3['user'];_0x5c7521[_0xcfc3('0x1d')]=_0x45bbd3[_0xcfc3('0x1d')];}_0x5c7521[_0xcfc3('0x1e')]=_0x45bbd3[_0xcfc3('0x1e')];_0x5c7521[_0xcfc3('0x1f')]=_0x45bbd3['port']||0x3e1;if(_0x45bbd3[_0xcfc3('0x20')]){_0x5c7521[_0xcfc3('0x20')]=!![];}else{_0x5c7521[_0xcfc3('0x20')]=![];_0x5c7521[_0xcfc3('0x21')]=_0xcfc3('0x22');}}else{_0x5c7521['user']=_0x45bbd3['user'];_0x5c7521[_0xcfc3('0x1d')]=_0x45bbd3[_0xcfc3('0x1d')];_0x5c7521[_0xcfc3('0x1e')]=utils['getHost'](_0x45bbd3[_0xcfc3('0x1c')]);_0x5c7521[_0xcfc3('0x1f')]=0x3e1;_0x5c7521['tls']=!![];}_0x5c7521[_0xcfc3('0x9')]=_0x409733||_0x45bbd3['user']||_0xcfc3('0x23');return _0x5c7521;};EmailImap[_0xcfc3('0x18')][_0xcfc3('0x10')]=function(){this[_0xcfc3('0x2')][_0xcfc3('0x24')](this[_0xcfc3('0xa')],![],this['handleOpenBox'][_0xcfc3('0x11')](this));};EmailImap[_0xcfc3('0x18')]['handleOpenBox']=function(_0x40a9a,_0x116153){if(_0x40a9a){this['handleError'](_0x40a9a,!![]);}else{this[_0xcfc3('0x25')]('box',_0x116153);this[_0xcfc3('0x26')]();}};EmailImap[_0xcfc3('0x18')][_0xcfc3('0x27')]=function(_0x3ce5dd){if(_0x3ce5dd){this[_0xcfc3('0x15')](_0x3ce5dd,!![]);}else{this[_0xcfc3('0x2')][_0xcfc3('0x12')]();}};EmailImap[_0xcfc3('0x18')][_0xcfc3('0x26')]=function(){this[_0xcfc3('0x2')][_0xcfc3('0x28')](['UNSEEN'],this[_0xcfc3('0x29')]['bind'](this));};EmailImap[_0xcfc3('0x18')][_0xcfc3('0x29')]=function(_0x4cbb6b,_0x24a75b){if(_0x4cbb6b){this[_0xcfc3('0x15')](_0x4cbb6b,!![]);}else{if(_0x24a75b[_0xcfc3('0x2a')]){try{var _0x54097e=this[_0xcfc3('0x2')][_0xcfc3('0x2b')](_0x24a75b,{'bodies':'','markSeen':!![]});_0x54097e['on'](_0xcfc3('0x2c'),this['handleFetchMessage'][_0xcfc3('0x11')](this));_0x54097e[_0xcfc3('0xe')](_0xcfc3('0x14'),this['handleFetchError'][_0xcfc3('0x11')](this));_0x54097e[_0xcfc3('0xe')]('end',this[_0xcfc3('0x2d')]['bind'](this));}catch(_0x9fa9e8){logger[_0xcfc3('0x14')](_0x9fa9e8);}}else{this[_0xcfc3('0x2')][_0xcfc3('0x2e')](!![],this['handleCloseBox'][_0xcfc3('0x11')](this));}}};EmailImap[_0xcfc3('0x18')][_0xcfc3('0x2f')]=function(_0x2333a4,_0x443246){_0x2333a4['on'](_0xcfc3('0x30'),this[_0xcfc3('0x31')]['bind'](this));_0x2333a4[_0xcfc3('0xe')](_0xcfc3('0x32'),this[_0xcfc3('0x33')][_0xcfc3('0x11')](this));_0x2333a4[_0xcfc3('0xe')](_0xcfc3('0x12'),this['handleMessageEnd']['bind'](this));};EmailImap['prototype'][_0xcfc3('0x31')]=function(_0x5e71c4,_0x326591){simpleParser(_0x5e71c4,{'Iconv':Iconv},this[_0xcfc3('0x34')][_0xcfc3('0x11')](this));};EmailImap['prototype'][_0xcfc3('0x33')]=function(_0x5c528c){};EmailImap[_0xcfc3('0x18')]['handleMessageEnd']=function(){};EmailImap['prototype'][_0xcfc3('0x34')]=function(_0xfee731,_0x4056a0){if(_0xfee731){logger['error'](_0xfee731);}else{var _0x1243ec=this;utils[_0xcfc3('0x35')](this[_0xcfc3('0xc')],_0x4056a0,function(_0x181126){_0x1243ec[_0xcfc3('0x25')](_0xcfc3('0x9'),_0x181126);});}};EmailImap[_0xcfc3('0x18')][_0xcfc3('0x2d')]=function(){this[_0xcfc3('0x2')]['closeBox'](!![],this[_0xcfc3('0x27')][_0xcfc3('0x11')](this));};EmailImap[_0xcfc3('0x18')][_0xcfc3('0x36')]=function(_0x2b58d0){this[_0xcfc3('0x15')](_0x2b58d0);this[_0xcfc3('0x2')]['closeBox'](!![],this[_0xcfc3('0x27')][_0xcfc3('0x11')](this));};EmailImap['prototype']['handleEnd']=function(){this['emit'](_0xcfc3('0x12'));};EmailImap[_0xcfc3('0x18')][_0xcfc3('0x15')]=function(_0x3bb509,_0xe9f0ec){logger[_0xcfc3('0x14')]('handleError',this[_0xcfc3('0xc')][_0xcfc3('0x9')],JSON[_0xcfc3('0x37')](_0x3bb509));var _0x400ada='';if(_0x3bb509){if(_0x3bb509['textCode']){_0x400ada=_0x3bb509[_0xcfc3('0x38')];}else{for(var _0xec4fac in _0x3bb509){if(_0x3bb509[_0xcfc3('0x39')](_0xec4fac)){_0x400ada+=_[_0xcfc3('0x3a')](_0xec4fac)+':\x20'+_0x3bb509[_0xec4fac]+'\x0a';}}}}if(_0xe9f0ec){this[_0xcfc3('0x2')][_0xcfc3('0x12')]();}else{this[_0xcfc3('0x25')](_0xcfc3('0x14'),_0x400ada);this['emit'](_0xcfc3('0x12'));}};module[_0xcfc3('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 0b03167..9d7ca63 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 _0xa952=['use','compile','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','createTransport'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xa952,0xf8));var _0x2a95=function(_0x403d77,_0x2ff2c5){_0x403d77=_0x403d77-0x0;var _0x4e1f4b=_0xa952[_0x403d77];return _0x4e1f4b;};'use strict';var nodemailer=require(_0x2a95('0x0'));var BPromise=require(_0x2a95('0x1'));var inlineBase64=require(_0x2a95('0x2'));function EmailSmtp(){}EmailSmtp[_0x2a95('0x3')]['send']=function(_0x4a16f6,_0x4a2e1d){return new BPromise(function(_0x3ef0b7,_0x1d44e0){var _0x52967b=nodemailer[_0x2a95('0x4')](_0x4a16f6);_0x52967b[_0x2a95('0x5')](_0x2a95('0x6'),inlineBase64());_0x52967b['sendMail'](_0x4a2e1d,function(_0x1d538e,_0x1565a0){if(_0x1d538e){_0x1d44e0(_0x1d538e[_0x2a95('0x7')]());}else{_0x3ef0b7(_0x1565a0);}});});};EmailSmtp[_0x2a95('0x3')][_0x2a95('0x8')]=function(_0x46f0c2){return new BPromise(function(_0x521fb4,_0x2f0a78){var _0x36389d=nodemailer['createTransport'](_0x46f0c2);_0x36389d['verify'](function(_0xe64f6b,_0x291841){if(_0xe64f6b){_0x2f0a78(_0xe64f6b[_0x2a95('0x7')]());}else{if(_0x291841){_0x521fb4(_0x291841);}else{_0x2f0a78(_0x2a95('0x9'));}}});});};module[_0x2a95('0xa')]=EmailSmtp; \ No newline at end of file +var _0xfdaf=['nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','toString','verify','Not\x20verifired','exports','nodemailer'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0xfdaf,0x1d8));var _0xffda=function(_0x2c26e9,_0x42270e){_0x2c26e9=_0x2c26e9-0x0;var _0x20ebe9=_0xfdaf[_0x2c26e9];return _0x20ebe9;};'use strict';var nodemailer=require(_0xffda('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xffda('0x1'));function EmailSmtp(){}EmailSmtp[_0xffda('0x2')][_0xffda('0x3')]=function(_0x297e51,_0x47af71){return new BPromise(function(_0xd3d187,_0x4bdbd1){var _0x2a7c46=nodemailer[_0xffda('0x4')](_0x297e51);_0x2a7c46[_0xffda('0x5')](_0xffda('0x6'),inlineBase64());_0x2a7c46['sendMail'](_0x47af71,function(_0x1de442,_0x8d05c){if(_0x1de442){_0x4bdbd1(_0x1de442[_0xffda('0x7')]());}else{_0xd3d187(_0x8d05c);}});});};EmailSmtp['prototype'][_0xffda('0x8')]=function(_0x36717a){return new BPromise(function(_0x2a6a76,_0x499638){var _0x3e3875=nodemailer[_0xffda('0x4')](_0x36717a);_0x3e3875['verify'](function(_0x4601ca,_0x1f0c84){if(_0x4601ca){_0x499638(_0x4601ca['toString']());}else{if(_0x1f0c84){_0x2a6a76(_0x1f0c84);}else{_0x499638(_0xffda('0x9'));}}});});};module[_0xffda('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index ae68f21..6c81484 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 _0x7c5d=['originCc','includes','bcc','attach','attachment','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','parser','from','subject','messageId','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','

Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','email','head','address','anonymous','generate','@xcally.com','value','name','split','length','slice','pop','isEmpty','html','test','replace','attachments','push','filename','_SRC','_IMG','\x20]','body','textAsHtml','message','originTo'];(function(_0x4af42a,_0x3e657e){var _0x44f87c=function(_0x27f0d3){while(--_0x27f0d3){_0x4af42a['push'](_0x4af42a['shift']());}};_0x44f87c(++_0x3e657e);}(_0x7c5d,0x139));var _0xd7c5=function(_0x28c299,_0x202fad){_0x28c299=_0x28c299-0x0;var _0x2ea64d=_0x7c5d[_0x28c299];return _0x2ea64d;};'use strict';var _=require(_0xd7c5('0x0'));var moment=require(_0xd7c5('0x1'));var random=require(_0xd7c5('0x2'));var fs=require('fs');var path=require(_0xd7c5('0x3'));var util=require(_0xd7c5('0x4'));var tnef=require(_0xd7c5('0x5'));var logger=require('../../../config/logger')(_0xd7c5('0x6'));var config=require('../../../config/environment');function getAddress(_0x333db2){var _0x3ac2c2=_[_0xd7c5('0x7')](_0x333db2['value']);return _0x3ac2c2&&_0x3ac2c2[_0xd7c5('0x8')]?_0x3ac2c2['address']:_0xd7c5('0x9')+random[_0xd7c5('0xa')](0x6)+_0xd7c5('0xb');}function getFirstName(_0x24b319){var _0x50b125=_[_0xd7c5('0x7')](_0x24b319[_0xd7c5('0xc')]);if(_0x50b125&&_0x50b125[_0xd7c5('0xd')]){var _0x1fffd2=_0x50b125[_0xd7c5('0xd')][_0xd7c5('0xe')](/\s+/);return _0x1fffd2[_0xd7c5('0xf')]?_0x1fffd2[_0xd7c5('0x10')](0x0,-0x1)['join']('\x20'):_0x50b125[_0xd7c5('0xd')];}return'Anonymous';}function getLastName(_0x1c4527){var _0x51cda0=_[_0xd7c5('0x7')](_0x1c4527[_0xd7c5('0xc')]);if(_0x51cda0&&_0x51cda0[_0xd7c5('0xd')]){var _0x3b6025=_0x51cda0[_0xd7c5('0xd')]['split'](/\s+/);return _0x3b6025[_0xd7c5('0xf')]>0x1?_0x3b6025[_0xd7c5('0x11')]():'';}return'';}function getMails(_0x17b332,_0x5c27e3){var _0x3e1caf='';for(var _0x1f0464=0x0;_0x1f0464<_0x5c27e3[_0xd7c5('0xc')][_0xd7c5('0xf')];_0x1f0464+=0x1){if(_0x5c27e3[_0xd7c5('0xc')][_0x1f0464]['address']!==_0x17b332){if(!_[_0xd7c5('0x12')](_0x3e1caf)){_0x3e1caf+=',';}_0x3e1caf+=_0x5c27e3[_0xd7c5('0xc')][_0x1f0464][_0xd7c5('0xd')]||_0x5c27e3[_0xd7c5('0xc')][_0x1f0464][_0xd7c5('0x8')]||'';_0x3e1caf+='\x20<';_0x3e1caf+=_0x5c27e3[_0xd7c5('0xc')][_0x1f0464][_0xd7c5('0x8')]?_0x5c27e3['value'][_0x1f0464][_0xd7c5('0x8')]:_0xd7c5('0x9')+random[_0xd7c5('0xa')](0x6)+_0xd7c5('0xb');_0x3e1caf+='>';}}return _0x3e1caf;}function parseEmail(_0x34a8b8,_0x1325c3,_0x3a33cd){if(_0x1325c3[_0xd7c5('0x13')]){var _0x2a8b7d=/)<[^<]*)*<\/script>/gi;while(_0x2a8b7d[_0xd7c5('0x14')](_0x1325c3[_0xd7c5('0x13')])){_0x1325c3[_0xd7c5('0x13')]=_0x1325c3['html'][_0xd7c5('0x15')](_0x2a8b7d,'');}if(_0x1325c3['html']['includes']('{_0x558373[_0xd7c5('0x17')](_0x384357[_0xd7c5('0x18')]);});var _0x1bc0f8=/]+>/g;var _0x34670d=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x2c805b=_0x1325c3[_0xd7c5('0x13')][_0xd7c5('0x15')](_0x34670d,_0xd7c5('0x19'));var _0x13a6ac=_0x2c805b['replace'](_0x1bc0f8,_0xd7c5('0x1a'));for(let _0x7ba830=0x0;_0x7ba830<_0x558373[_0xd7c5('0xf')];_0x7ba830++){var _0x3939ba=_0x13a6ac[_0xd7c5('0x15')](_0xd7c5('0x1a'),'\x20[Attachment:\x20'+_0x558373[_0x7ba830]+_0xd7c5('0x1b'));_0x13a6ac=_0x3939ba;}_0x1325c3[_0xd7c5('0x13')]=_0x13a6ac;}_0x3a33cd[_0xd7c5('0x1c')]=_0x1325c3[_0xd7c5('0x13')];}else{_0x3a33cd[_0xd7c5('0x1c')]=_0x1325c3[_0xd7c5('0x1d')];}if(_0x3a33cd['body']){_0x3a33cd[_0xd7c5('0x1c')]=_0x3a33cd[_0xd7c5('0x1c')]['replace'](/\x20[Attachment:\x20','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','moment','path','util','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','Anonymous','pop','isEmpty','html','includes','0x1?_0x46ab64[_0x7098('0x11')]():'';}return'';}function getMails(_0x4bbba4,_0x27a5a5){var _0x505286='';for(var _0x4d9e38=0x0;_0x4d9e38<_0x27a5a5['value'][_0x7098('0xe')];_0x4d9e38+=0x1){if(_0x27a5a5[_0x7098('0x7')][_0x4d9e38][_0x7098('0x8')]!==_0x4bbba4){if(!_[_0x7098('0x12')](_0x505286)){_0x505286+=',';}_0x505286+=_0x27a5a5[_0x7098('0x7')][_0x4d9e38][_0x7098('0xc')]||_0x27a5a5[_0x7098('0x7')][_0x4d9e38][_0x7098('0x8')]||'';_0x505286+='\x20<';_0x505286+=_0x27a5a5[_0x7098('0x7')][_0x4d9e38]['address']?_0x27a5a5[_0x7098('0x7')][_0x4d9e38]['address']:_0x7098('0x9')+random[_0x7098('0xa')](0x6)+_0x7098('0xb');_0x505286+='>';}}return _0x505286;}function parseEmail(_0xa8852a,_0x2dfd27,_0xca880e){if(_0x2dfd27[_0x7098('0x13')]){var _0x17e137=/)<[^<]*)*<\/script>/gi;while(_0x17e137['test'](_0x2dfd27[_0x7098('0x13')])){_0x2dfd27['html']=_0x2dfd27[_0x7098('0x13')]['replace'](_0x17e137,'');}if(_0x2dfd27['html'][_0x7098('0x14')](_0x7098('0x15'))){var _0x570ef8=[];_0x2dfd27['attachments'][_0x7098('0x16')](_0x17bf5d=>{_0x570ef8['push'](_0x17bf5d[_0x7098('0x17')]);});var _0x34f811=/]+>/g;var _0x61d624=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x4cf6d1=_0x2dfd27[_0x7098('0x13')][_0x7098('0x18')](_0x61d624,'_SRC');var _0x209e48=_0x4cf6d1['replace'](_0x34f811,_0x7098('0x19'));for(let _0x54b2df=0x0;_0x54b2df<_0x570ef8[_0x7098('0xe')];_0x54b2df++){var _0x246cbf=_0x209e48['replace'](_0x7098('0x19'),_0x7098('0x1a')+_0x570ef8[_0x54b2df]+'\x20]');_0x209e48=_0x246cbf;}_0x2dfd27[_0x7098('0x13')]=_0x209e48;}_0xca880e[_0x7098('0x1b')]=_0x2dfd27[_0x7098('0x13')];}else{_0xca880e['body']=_0x2dfd27[_0x7098('0x1c')];}if(_0xca880e['body']){_0xca880e[_0x7098('0x1b')]=_0xca880e[_0x7098('0x1b')][_0x7098('0x18')](/0x0){if(this[_0x2c931e+'Capacity']>0x0&&this[_0x2c931e+_0x1168('0x25')]>=this[_0x2c931e+_0x1168('0x26')]){return _0x1168('0x27');}else{return _0x1168('0x28');}}else{return _0x1168('0x29');}};Agent[_0x1168('0x2a')][_0x1168('0x23')]=function(){var _0xae3d9b=[_0x1168('0x2b'),_0x1168('0x2c'),_0x1168('0x2d'),_0x1168('0x2e'),_0x1168('0x2f'),'whatsapp'];for(var _0x20ab97=0x0;_0x20ab97<_0xae3d9b[_0x1168('0x30')];_0x20ab97+=0x1){var _0x4adb82=this[_0x1168('0x24')](_0xae3d9b[_0x20ab97]);if(this[_0xae3d9b[_0x20ab97]+_0x1168('0x31')]!==_0x4adb82){this[_0xae3d9b[_0x20ab97]+_0x1168('0x32')]=_['toNumber'](moment()[_0x1168('0x33')]('x'));}this[_0xae3d9b[_0x20ab97]+_0x1168('0x31')]=_0x4adb82;}var _0x763d9c={'id':this['id'],'name':this[_0x1168('0x5')],'online':this['online'],'voicePause':this[_0x1168('0x7')],'chatPause':this['chatPause'],'mailPause':this[_0x1168('0x9')],'smsPause':this[_0x1168('0xb')],'faxPause':this[_0x1168('0xa')],'openchannelPause':this[_0x1168('0x34')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x1168('0xe')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x1168('0x10')],'mailStatusTime':this[_0x1168('0x11')],'mailCapacity':this[_0x1168('0x12')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x1168('0x13')],'faxStatusTime':this[_0x1168('0x14')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x1168('0x16')],'smsStatus':this[_0x1168('0x17')],'smsStatusTime':this[_0x1168('0x18')],'smsCapacity':this[_0x1168('0x19')],'smsCurrentCapacity':this[_0x1168('0x1a')],'whatsappStatus':this[_0x1168('0x35')],'whatsappStatusTime':this[_0x1168('0x1b')],'whatsappCapacity':this[_0x1168('0x1c')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x1168('0x1d')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x1168('0x1f')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x1168('0x21')],'busyQueue':this[_0x1168('0x22')]};var _0x4573b1=md5(JSON['stringify'](_0x763d9c));if(this[_0x1168('0x0')]!==_0x4573b1){this[_0x1168('0x0')]=_0x4573b1;io[_0x1168('0x36')](_0x1168('0x37'),_0x763d9c);}};module[_0x1168('0x38')]=Agent; \ No newline at end of file +var _0xb98e=['chat','openchannel','fax','sms','length','getChannelStatus','Status','StatusTime','toNumber','format','mailStatusTime','faxStatus','busy','busyQueue','user:save','exports','lodash','moment','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','md5','updateRealtime','Capacity','CurrentCapacity','maxcapacity','working','idle','prototype','mail'];(function(_0x284c9f,_0x4b1e65){var _0x335de1=function(_0x145565){while(--_0x145565){_0x284c9f['push'](_0x284c9f['shift']());}};_0x335de1(++_0x4b1e65);}(_0xb98e,0x184));var _0xeb98=function(_0x31005b,_0x300c99){_0x31005b=_0x31005b-0x0;var _0x8c5b50=_0xb98e[_0x31005b];return _0x8c5b50;};'use strict';var _=require(_0xeb98('0x0'));var moment=require(_0xeb98('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xeb98('0x2'));config[_0xeb98('0x3')]=_[_0xeb98('0x4')](config['redis'],{'host':_0xeb98('0x5'),'port':0x18eb});var io=require(_0xeb98('0x6'))(new Redis(config[_0xeb98('0x3')]));function Agent(_0x48adbc){this['id']=_0x48adbc['id']||0x0;this[_0xeb98('0x7')]=_0x48adbc['name']||'';this[_0xeb98('0x8')]=_0x48adbc['online']||!![];this[_0xeb98('0x9')]=_0x48adbc[_0xeb98('0x9')]||![];this[_0xeb98('0xa')]=_0x48adbc[_0xeb98('0xa')]||![];this[_0xeb98('0xb')]=_0x48adbc[_0xeb98('0xb')]||![];this[_0xeb98('0xc')]=_0x48adbc[_0xeb98('0xc')]||![];this['smsPause']=_0x48adbc[_0xeb98('0xd')]||![];this[_0xeb98('0xe')]=_0x48adbc[_0xeb98('0xe')]||![];this[_0xeb98('0xf')]=_0xeb98('0x10');this[_0xeb98('0x11')]=0x0;this[_0xeb98('0x12')]=_0x48adbc[_0xeb98('0x12')]||0x0;this[_0xeb98('0x13')]=0x0;this[_0xeb98('0x14')]=_0xeb98('0x10');this['mailStatusTime']=0x0;this[_0xeb98('0x15')]=_0x48adbc[_0xeb98('0x15')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0xeb98('0x10');this[_0xeb98('0x16')]=0x0;this[_0xeb98('0x17')]=_0x48adbc[_0xeb98('0x17')]||0x0;this[_0xeb98('0x18')]=0x0;this[_0xeb98('0x19')]=_0xeb98('0x10');this[_0xeb98('0x1a')]=0x0;this[_0xeb98('0x1b')]=_0x48adbc[_0xeb98('0x1b')]||0x0;this[_0xeb98('0x1c')]=0x0;this[_0xeb98('0x1d')]=_0xeb98('0x10');this[_0xeb98('0x1e')]=0x0;this[_0xeb98('0x1f')]=_0x48adbc[_0xeb98('0x1f')]||0x0;this[_0xeb98('0x20')]=0x0;this[_0xeb98('0x21')]=_0xeb98('0x10');this[_0xeb98('0x22')]=0x0;this['openchannelCapacity']=_0x48adbc[_0xeb98('0x23')]||0x0;this[_0xeb98('0x24')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0xeb98('0x25')]='';this[_0xeb98('0x26')]();}Agent['prototype']['getChannelStatus']=function(_0x2ab831){if(this[_0x2ab831+'CurrentCapacity']>0x0){if(this[_0x2ab831+_0xeb98('0x27')]>0x0&&this[_0x2ab831+_0xeb98('0x28')]>=this[_0x2ab831+'Capacity']){return _0xeb98('0x29');}else{return _0xeb98('0x2a');}}else{return _0xeb98('0x2b');}};Agent[_0xeb98('0x2c')][_0xeb98('0x26')]=function(){var _0x1fa721=[_0xeb98('0x2d'),_0xeb98('0x2e'),_0xeb98('0x2f'),_0xeb98('0x30'),_0xeb98('0x31'),'whatsapp'];for(var _0x19f31d=0x0;_0x19f31d<_0x1fa721[_0xeb98('0x32')];_0x19f31d+=0x1){var _0x45afdc=this[_0xeb98('0x33')](_0x1fa721[_0x19f31d]);if(this[_0x1fa721[_0x19f31d]+_0xeb98('0x34')]!==_0x45afdc){this[_0x1fa721[_0x19f31d]+_0xeb98('0x35')]=_[_0xeb98('0x36')](moment()[_0xeb98('0x37')]('x'));}this[_0x1fa721[_0x19f31d]+_0xeb98('0x34')]=_0x45afdc;}var _0x3f7fdd={'id':this['id'],'name':this[_0xeb98('0x7')],'online':this[_0xeb98('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0xeb98('0xa')],'mailPause':this[_0xeb98('0xb')],'smsPause':this[_0xeb98('0xd')],'faxPause':this[_0xeb98('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xeb98('0xf')],'chatStatusTime':this[_0xeb98('0x11')],'chatCapacity':this[_0xeb98('0x12')],'chatCurrentCapacity':this[_0xeb98('0x13')],'mailStatus':this[_0xeb98('0x14')],'mailStatusTime':this[_0xeb98('0x38')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xeb98('0x39')],'faxStatusTime':this[_0xeb98('0x16')],'faxCapacity':this[_0xeb98('0x17')],'faxCurrentCapacity':this[_0xeb98('0x18')],'smsStatus':this[_0xeb98('0x19')],'smsStatusTime':this[_0xeb98('0x1a')],'smsCapacity':this[_0xeb98('0x1b')],'smsCurrentCapacity':this[_0xeb98('0x1c')],'whatsappStatus':this[_0xeb98('0x1d')],'whatsappStatusTime':this[_0xeb98('0x1e')],'whatsappCapacity':this[_0xeb98('0x1f')],'whatsappCurrentCapacity':this[_0xeb98('0x20')],'openchannelStatus':this[_0xeb98('0x21')],'openchannelStatusTime':this[_0xeb98('0x22')],'openchannelCapacity':this[_0xeb98('0x23')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xeb98('0x3a')],'busyQueue':this[_0xeb98('0x3b')]};var _0x2df441=md5(JSON['stringify'](_0x3f7fdd));if(this[_0xeb98('0x25')]!==_0x2df441){this[_0xeb98('0x25')]=_0x2df441;io['emit'](_0xeb98('0x3c'),_0x3f7fdd);}};module[_0xeb98('0x3d')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index d0243f8..a9d628e 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 _0x4e05=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','md5','format','chat:queue:%s','exports','lodash','util','ioredis'];(function(_0x418f24,_0x500944){var _0x40f788=function(_0x8fb8f0){while(--_0x8fb8f0){_0x418f24['push'](_0x418f24['shift']());}};_0x40f788(++_0x500944);}(_0x4e05,0x1ea));var _0x54e0=function(_0x2a5421,_0x1b2d0e){_0x2a5421=_0x2a5421-0x0;var _0x442ef4=_0x4e05[_0x2a5421];return _0x442ef4;};'use strict';var _=require(_0x54e0('0x0'));var md5=require('md5');var util=require(_0x54e0('0x1'));var Redis=require(_0x54e0('0x2'));var config=require(_0x54e0('0x3'));config[_0x54e0('0x4')]=_[_0x54e0('0x5')](config['redis'],{'host':_0x54e0('0x6'),'port':0x18eb});var io=require(_0x54e0('0x7'))(new Redis(config[_0x54e0('0x4')]));function ChatQueue(_0x1eca76){this['id']=_0x1eca76['id']||0x0;this[_0x54e0('0x8')]=_0x1eca76[_0x54e0('0x8')]||'';this['timeout']=_0x1eca76[_0x54e0('0x9')]||0xa;this['strategy']=_0x1eca76['strategy']||_0x54e0('0xa');this[_0x54e0('0xb')]=_0x1eca76['Agents'];this[_0x54e0('0xc')]={};this[_0x54e0('0xd')]=0x0;this['md5']='';this[_0x54e0('0xe')]();this[_0x54e0('0xf')]();}ChatQueue[_0x54e0('0x10')][_0x54e0('0xe')]=function(){var _0x3cf10d=this['mapAgentsId'][_0x54e0('0x11')];this['mapAgentsId']=_[_0x54e0('0x12')](this[_0x54e0('0xb')],'id');this[_0x54e0('0xc')]['_rr']=_0x3cf10d;};ChatQueue[_0x54e0('0x10')][_0x54e0('0xf')]=function(){this[_0x54e0('0x13')]=0x0;this[_0x54e0('0x14')]=0x0;for(var _0x5e3038=0x0;_0x5e3038=0x0?this[_0x54e0('0x17')]:0x0;var _0x27a872={'id':this['id'],'available':this[_0x54e0('0x17')],'loggedIn':this[_0x54e0('0x13')],'name':this[_0x54e0('0x8')],'paused':this['paused'],'waiting':this[_0x54e0('0xd')]};var _0x36cdc5=md5(JSON[_0x54e0('0x18')](_0x27a872));if(this[_0x54e0('0x19')]!==_0x36cdc5){this[_0x54e0('0x19')]=_0x36cdc5;io['to'](util[_0x54e0('0x1a')](_0x54e0('0x1b'),_0x27a872['name']))['emit']('chat_queue:save',_0x27a872);}};module[_0x54e0('0x1c')]=ChatQueue; \ No newline at end of file +var _0x0fb4=['timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','socket.io-emitter','redis','name'];(function(_0x34559b,_0x42b8ed){var _0x517ca8=function(_0x4b92a7){while(--_0x4b92a7){_0x34559b['push'](_0x34559b['shift']());}};_0x517ca8(++_0x42b8ed);}(_0x0fb4,0x10b));var _0x40fb=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0x0fb4[_0x3d78d7];return _0x4b6784;};'use strict';var _=require(_0x40fb('0x0'));var md5=require(_0x40fb('0x1'));var util=require(_0x40fb('0x2'));var Redis=require(_0x40fb('0x3'));var config=require(_0x40fb('0x4'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x40fb('0x5'))(new Redis(config[_0x40fb('0x6')]));function ChatQueue(_0x255c80){this['id']=_0x255c80['id']||0x0;this[_0x40fb('0x7')]=_0x255c80[_0x40fb('0x7')]||'';this[_0x40fb('0x8')]=_0x255c80[_0x40fb('0x8')]||0xa;this[_0x40fb('0x9')]=_0x255c80[_0x40fb('0x9')]||'beepall';this[_0x40fb('0xa')]=_0x255c80[_0x40fb('0xa')];this[_0x40fb('0xb')]={};this[_0x40fb('0xc')]=0x0;this[_0x40fb('0x1')]='';this[_0x40fb('0xd')]();this[_0x40fb('0xe')]();}ChatQueue[_0x40fb('0xf')][_0x40fb('0xd')]=function(){var _0x4c983c=this[_0x40fb('0xb')][_0x40fb('0x10')];this[_0x40fb('0xb')]=_['map'](this[_0x40fb('0xa')],'id');this[_0x40fb('0xb')][_0x40fb('0x10')]=_0x4c983c;};ChatQueue[_0x40fb('0xf')][_0x40fb('0xe')]=function(){this[_0x40fb('0x11')]=0x0;this[_0x40fb('0x12')]=0x0;for(var _0x2d2894=0x0;_0x2d2894=0x0?this[_0x40fb('0x14')]:0x0;var _0x33d2d4={'id':this['id'],'available':this[_0x40fb('0x14')],'loggedIn':this[_0x40fb('0x11')],'name':this[_0x40fb('0x7')],'paused':this[_0x40fb('0x12')],'waiting':this[_0x40fb('0xc')]};var _0x59efa4=md5(JSON[_0x40fb('0x15')](_0x33d2d4));if(this[_0x40fb('0x1')]!==_0x59efa4){this[_0x40fb('0x1')]=_0x59efa4;io['to'](util[_0x40fb('0x16')](_0x40fb('0x17'),_0x33d2d4[_0x40fb('0x7')]))['emit'](_0x40fb('0x18'),_0x33d2d4);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 836b155..871dedd 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 _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x1a13d,_0x44bb19){var _0x10629f=function(_0x2dc5f3){while(--_0x2dc5f3){_0x1a13d['push'](_0x1a13d['shift']());}};_0x10629f(++_0x44bb19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0xe68def,_0x3a8935){var _0x3bf878=function(_0x137967){while(--_0x137967){_0xe68def['push'](_0xe68def['shift']());}};_0x3bf878(++_0x3a8935);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index a30aadf..3e0a700 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 _0xcbfd=['Intervals','exports','name'];(function(_0x230c6e,_0x340b31){var _0x3ab1ba=function(_0x1ceda0){while(--_0x1ceda0){_0x230c6e['push'](_0x230c6e['shift']());}};_0x3ab1ba(++_0x340b31);}(_0xcbfd,0x161));var _0xdcbf=function(_0x51d711,_0x2d5a81){_0x51d711=_0x51d711-0x0;var _0x4726a6=_0xcbfd[_0x51d711];return _0x4726a6;};'use strict';function Interval(_0x42cb11){this['id']=_0x42cb11['id']||0x0;this['name']=_0x42cb11[_0xdcbf('0x0')]||'';this[_0xdcbf('0x1')]=_0x42cb11[_0xdcbf('0x1')]||{};}module[_0xdcbf('0x2')]=Interval; \ No newline at end of file +var _0x0656=['name','Intervals','exports'];(function(_0x392ca7,_0x414fda){var _0x437b50=function(_0xaece5f){while(--_0xaece5f){_0x392ca7['push'](_0x392ca7['shift']());}};_0x437b50(++_0x414fda);}(_0x0656,0x72));var _0x6065=function(_0x8b429b,_0x362cb2){_0x8b429b=_0x8b429b-0x0;var _0x29299e=_0x0656[_0x8b429b];return _0x29299e;};'use strict';function Interval(_0x24af9f){this['id']=_0x24af9f['id']||0x0;this['name']=_0x24af9f[_0x6065('0x0')]||'';this['Intervals']=_0x24af9f[_0x6065('0x1')]||{};}module[_0x6065('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 5b51368..9abd31c 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 _0xb1b4=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','mailPause','available','waiting','format','emit','exports','lodash','md5','util','../../../config/environment','redis'];(function(_0x51eb77,_0x436673){var _0x4b26fe=function(_0x4db9dc){while(--_0x4db9dc){_0x51eb77['push'](_0x51eb77['shift']());}};_0x4b26fe(++_0x436673);}(_0xb1b4,0x175));var _0x4b1b=function(_0x59dccc,_0x184c1c){_0x59dccc=_0x59dccc-0x0;var _0xc97bcb=_0xb1b4[_0x59dccc];return _0xc97bcb;};'use strict';var _=require(_0x4b1b('0x0'));var md5=require(_0x4b1b('0x1'));var util=require(_0x4b1b('0x2'));var Redis=require('ioredis');var config=require(_0x4b1b('0x3'));config[_0x4b1b('0x4')]=_[_0x4b1b('0x5')](config[_0x4b1b('0x4')],{'host':_0x4b1b('0x6'),'port':0x18eb});var io=require(_0x4b1b('0x7'))(new Redis(config['redis']));function MailQueue(_0x1b83e0){this['id']=_0x1b83e0['id']||0x0;this[_0x4b1b('0x8')]=_0x1b83e0[_0x4b1b('0x8')]||'';this[_0x4b1b('0x9')]=_0x1b83e0[_0x4b1b('0x9')]||0xa;this['strategy']=_0x1b83e0[_0x4b1b('0xa')]||_0x4b1b('0xb');this['Agents']=_0x1b83e0[_0x4b1b('0xc')];this[_0x4b1b('0xd')]={};this['waiting']=0x0;this[_0x4b1b('0x1')]='';this[_0x4b1b('0xe')]();this[_0x4b1b('0xf')]();}MailQueue[_0x4b1b('0x10')][_0x4b1b('0xe')]=function(){var _0x154408=this[_0x4b1b('0xd')]['_rr'];this[_0x4b1b('0xd')]=_[_0x4b1b('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x4b1b('0x12')]=_0x154408;};MailQueue[_0x4b1b('0x10')][_0x4b1b('0xf')]=function(){this[_0x4b1b('0x13')]=0x0;this[_0x4b1b('0x14')]=0x0;for(var _0x4c1072=0x0;_0x4c1072=0x0?this['available']:0x0;var _0x5ea908={'id':this['id'],'available':this[_0x4b1b('0x16')],'loggedIn':this[_0x4b1b('0x13')],'name':this[_0x4b1b('0x8')],'paused':this[_0x4b1b('0x14')],'waiting':this[_0x4b1b('0x17')]};var _0x3ab3dc=md5(JSON['stringify'](_0x5ea908));if(this[_0x4b1b('0x1')]!==_0x3ab3dc){this[_0x4b1b('0x1')]=_0x3ab3dc;io['to'](util[_0x4b1b('0x18')]('mail:queue:%s',_0x5ea908['name']))[_0x4b1b('0x19')]('mail_queue:save',_0x5ea908);}};module[_0x4b1b('0x1a')]=MailQueue; \ No newline at end of file +var _0xccd4=['map','updateRealtime','loggedIn','paused','length','online','mailPause','available','waiting','stringify','format','mail:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','updateRouting','prototype','mapAgentsId','_rr'];(function(_0x262ee9,_0x355b6e){var _0x117287=function(_0x1236fb){while(--_0x1236fb){_0x262ee9['push'](_0x262ee9['shift']());}};_0x117287(++_0x355b6e);}(_0xccd4,0xa4));var _0x4ccd=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xccd4[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0x4ccd('0x0'));var md5=require(_0x4ccd('0x1'));var util=require(_0x4ccd('0x2'));var Redis=require(_0x4ccd('0x3'));var config=require(_0x4ccd('0x4'));config[_0x4ccd('0x5')]=_[_0x4ccd('0x6')](config[_0x4ccd('0x5')],{'host':_0x4ccd('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x58bed9){this['id']=_0x58bed9['id']||0x0;this[_0x4ccd('0x8')]=_0x58bed9[_0x4ccd('0x8')]||'';this[_0x4ccd('0x9')]=_0x58bed9[_0x4ccd('0x9')]||0xa;this[_0x4ccd('0xa')]=_0x58bed9[_0x4ccd('0xa')]||'beepall';this[_0x4ccd('0xb')]=_0x58bed9[_0x4ccd('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x4ccd('0x1')]='';this[_0x4ccd('0xc')]();this['updateRealtime']();}MailQueue[_0x4ccd('0xd')][_0x4ccd('0xc')]=function(){var _0x3182af=this[_0x4ccd('0xe')][_0x4ccd('0xf')];this[_0x4ccd('0xe')]=_[_0x4ccd('0x10')](this[_0x4ccd('0xb')],'id');this[_0x4ccd('0xe')][_0x4ccd('0xf')]=_0x3182af;};MailQueue[_0x4ccd('0xd')][_0x4ccd('0x11')]=function(){this[_0x4ccd('0x12')]=0x0;this[_0x4ccd('0x13')]=0x0;for(var _0x32f3cf=0x0;_0x32f3cf=0x0?this['available']:0x0;var _0x2b8389={'id':this['id'],'available':this[_0x4ccd('0x17')],'loggedIn':this[_0x4ccd('0x12')],'name':this[_0x4ccd('0x8')],'paused':this[_0x4ccd('0x13')],'waiting':this[_0x4ccd('0x18')]};var _0x428dee=md5(JSON[_0x4ccd('0x19')](_0x2b8389));if(this[_0x4ccd('0x1')]!==_0x428dee){this[_0x4ccd('0x1')]=_0x428dee;io['to'](util[_0x4ccd('0x1a')](_0x4ccd('0x1b'),_0x2b8389[_0x4ccd('0x8')]))[_0x4ccd('0x1c')]('mail_queue:save',_0x2b8389);}};module[_0x4ccd('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 1557afb..039709d 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 _0xf98f=['mapAgentsId','_rr','map','loggedIn','paused','openchannelPause','available','stringify','format','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','Agents','waiting','updateRouting','updateRealtime','prototype'];(function(_0x2b98fa,_0x23ed96){var _0x11b64f=function(_0x3c6050){while(--_0x3c6050){_0x2b98fa['push'](_0x2b98fa['shift']());}};_0x11b64f(++_0x23ed96);}(_0xf98f,0x142));var _0xff98=function(_0x2381ff,_0x56ff71){_0x2381ff=_0x2381ff-0x0;var _0x411b19=_0xf98f[_0x2381ff];return _0x411b19;};'use strict';var _=require(_0xff98('0x0'));var md5=require(_0xff98('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xff98('0x2'));config[_0xff98('0x3')]=_[_0xff98('0x4')](config[_0xff98('0x3')],{'host':_0xff98('0x5'),'port':0x18eb});var io=require(_0xff98('0x6'))(new Redis(config[_0xff98('0x3')]));function OpenchannelQueue(_0x44a113){this['id']=_0x44a113['id']||0x0;this[_0xff98('0x7')]=_0x44a113[_0xff98('0x7')]||'';this[_0xff98('0x8')]=_0x44a113[_0xff98('0x8')]||0xa;this['strategy']=_0x44a113['strategy']||'beepall';this[_0xff98('0x9')]=_0x44a113['Agents'];this['mapAgentsId']={};this[_0xff98('0xa')]=0x0;this['md5']='';this[_0xff98('0xb')]();this[_0xff98('0xc')]();}OpenchannelQueue[_0xff98('0xd')][_0xff98('0xb')]=function(){var _0xa2fc7a=this[_0xff98('0xe')][_0xff98('0xf')];this[_0xff98('0xe')]=_[_0xff98('0x10')](this[_0xff98('0x9')],'id');this[_0xff98('0xe')][_0xff98('0xf')]=_0xa2fc7a;};OpenchannelQueue['prototype'][_0xff98('0xc')]=function(){this[_0xff98('0x11')]=0x0;this[_0xff98('0x12')]=0x0;for(var _0x3cd6d0=0x0;_0x3cd6d0=0x0?this[_0xff98('0x14')]:0x0;var _0xefeaf3={'id':this['id'],'available':this[_0xff98('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xff98('0x7')],'paused':this[_0xff98('0x12')],'waiting':this[_0xff98('0xa')]};var _0xdc4cb=md5(JSON[_0xff98('0x15')](_0xefeaf3));if(this[_0xff98('0x1')]!==_0xdc4cb){this[_0xff98('0x1')]=_0xdc4cb;io['to'](util[_0xff98('0x16')]('openchannel:queue:%s',_0xefeaf3['name']))['emit']('openchannel_queue:save',_0xefeaf3);}};module[_0xff98('0x17')]=OpenchannelQueue; \ No newline at end of file +var _0x95fc=['prototype','_rr','map','paused','Agents','length','online','openchannelPause','loggedIn','available','waiting','stringify','emit','openchannel_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','socket.io-emitter','name','strategy','mapAgentsId','md5','updateRouting','updateRealtime'];(function(_0x3ab1db,_0x295dcd){var _0x2de25d=function(_0x251514){while(--_0x251514){_0x3ab1db['push'](_0x3ab1db['shift']());}};_0x2de25d(++_0x295dcd);}(_0x95fc,0x102));var _0xc95f=function(_0x3a96d3,_0x31efc0){_0x3a96d3=_0x3a96d3-0x0;var _0x4f42c4=_0x95fc[_0x3a96d3];return _0x4f42c4;};'use strict';var _=require(_0xc95f('0x0'));var md5=require('md5');var util=require(_0xc95f('0x1'));var Redis=require('ioredis');var config=require(_0xc95f('0x2'));config[_0xc95f('0x3')]=_[_0xc95f('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc95f('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x408ba0){this['id']=_0x408ba0['id']||0x0;this[_0xc95f('0x6')]=_0x408ba0[_0xc95f('0x6')]||'';this['timeout']=_0x408ba0['timeout']||0xa;this['strategy']=_0x408ba0[_0xc95f('0x7')]||'beepall';this['Agents']=_0x408ba0['Agents'];this[_0xc95f('0x8')]={};this['waiting']=0x0;this[_0xc95f('0x9')]='';this[_0xc95f('0xa')]();this[_0xc95f('0xb')]();}OpenchannelQueue[_0xc95f('0xc')][_0xc95f('0xa')]=function(){var _0x1b8462=this[_0xc95f('0x8')][_0xc95f('0xd')];this[_0xc95f('0x8')]=_[_0xc95f('0xe')](this['Agents'],'id');this['mapAgentsId'][_0xc95f('0xd')]=_0x1b8462;};OpenchannelQueue[_0xc95f('0xc')][_0xc95f('0xb')]=function(){this['loggedIn']=0x0;this[_0xc95f('0xf')]=0x0;for(var _0x5513b9=0x0;_0x5513b9=0x0?this['available']:0x0;var _0x2f59dc={'id':this['id'],'available':this['available'],'loggedIn':this[_0xc95f('0x14')],'name':this[_0xc95f('0x6')],'paused':this['paused'],'waiting':this[_0xc95f('0x16')]};var _0x2ba23b=md5(JSON[_0xc95f('0x17')](_0x2f59dc));if(this[_0xc95f('0x9')]!==_0x2ba23b){this[_0xc95f('0x9')]=_0x2ba23b;io['to'](util['format']('openchannel:queue:%s',_0x2f59dc[_0xc95f('0x6')]))[_0xc95f('0x18')](_0xc95f('0x19'),_0x2f59dc);}};module[_0xc95f('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 80b4e12..87ca4a2 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 _0xb10b=['length','online','loggedIn','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','prototype','updateRouting','_rr','map','updateRealtime','paused'];(function(_0x528575,_0x2e067d){var _0x3063b7=function(_0x1ee183){while(--_0x1ee183){_0x528575['push'](_0x528575['shift']());}};_0x3063b7(++_0x2e067d);}(_0xb10b,0x12a));var _0xbb10=function(_0x6afc9c,_0xf6b755){_0x6afc9c=_0x6afc9c-0x0;var _0x195d68=_0xb10b[_0x6afc9c];return _0x195d68;};'use strict';var _=require(_0xbb10('0x0'));var md5=require('md5');var util=require(_0xbb10('0x1'));var Redis=require(_0xbb10('0x2'));var config=require(_0xbb10('0x3'));config['redis']=_[_0xbb10('0x4')](config[_0xbb10('0x5')],{'host':_0xbb10('0x6'),'port':0x18eb});var io=require(_0xbb10('0x7'))(new Redis(config[_0xbb10('0x5')]));function SmsQueue(_0x312b72){this['id']=_0x312b72['id']||0x0;this['name']=_0x312b72[_0xbb10('0x8')]||'';this[_0xbb10('0x9')]=_0x312b72['timeout']||0xa;this[_0xbb10('0xa')]=_0x312b72[_0xbb10('0xa')]||_0xbb10('0xb');this[_0xbb10('0xc')]=_0x312b72[_0xbb10('0xc')];this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]=0x0;this[_0xbb10('0xf')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0xbb10('0x10')][_0xbb10('0x11')]=function(){var _0xce64f3=this['mapAgentsId'][_0xbb10('0x12')];this['mapAgentsId']=_[_0xbb10('0x13')](this[_0xbb10('0xc')],'id');this[_0xbb10('0xd')][_0xbb10('0x12')]=_0xce64f3;};SmsQueue[_0xbb10('0x10')][_0xbb10('0x14')]=function(){this['loggedIn']=0x0;this[_0xbb10('0x15')]=0x0;for(var _0x42d7e4=0x0;_0x42d7e4=0x0?this[_0xbb10('0x1a')]:0x0;var _0x1682a4={'id':this['id'],'available':this[_0xbb10('0x1a')],'loggedIn':this[_0xbb10('0x18')],'name':this[_0xbb10('0x8')],'paused':this[_0xbb10('0x15')],'waiting':this['waiting']};var _0x5ff0cf=md5(JSON[_0xbb10('0x1b')](_0x1682a4));if(this[_0xbb10('0xf')]!==_0x5ff0cf){this[_0xbb10('0xf')]=_0x5ff0cf;io['to'](util[_0xbb10('0x1c')](_0xbb10('0x1d'),_0x1682a4['name']))[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x1682a4);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xd8b0=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','smsPause','available','stringify','format','sms:queue:%s','exports','lodash','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x3bbc23,_0x38445e){var _0x872c8d=function(_0x355110){while(--_0x355110){_0x3bbc23['push'](_0x3bbc23['shift']());}};_0x872c8d(++_0x38445e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var md5=require(_0x0d8b('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0d8b('0x2')]=_[_0x0d8b('0x3')](config[_0x0d8b('0x2')],{'host':_0x0d8b('0x4'),'port':0x18eb});var io=require(_0x0d8b('0x5'))(new Redis(config['redis']));function SmsQueue(_0x5e15e6){this['id']=_0x5e15e6['id']||0x0;this[_0x0d8b('0x6')]=_0x5e15e6[_0x0d8b('0x6')]||'';this[_0x0d8b('0x7')]=_0x5e15e6['timeout']||0xa;this[_0x0d8b('0x8')]=_0x5e15e6[_0x0d8b('0x8')]||'beepall';this[_0x0d8b('0x9')]=_0x5e15e6[_0x0d8b('0x9')];this[_0x0d8b('0xa')]={};this[_0x0d8b('0xb')]=0x0;this[_0x0d8b('0x1')]='';this[_0x0d8b('0xc')]();this[_0x0d8b('0xd')]();}SmsQueue[_0x0d8b('0xe')]['updateRouting']=function(){var _0x3c4bfa=this['mapAgentsId'][_0x0d8b('0xf')];this[_0x0d8b('0xa')]=_[_0x0d8b('0x10')](this[_0x0d8b('0x9')],'id');this[_0x0d8b('0xa')][_0x0d8b('0xf')]=_0x3c4bfa;};SmsQueue[_0x0d8b('0xe')][_0x0d8b('0xd')]=function(){this[_0x0d8b('0x11')]=0x0;this[_0x0d8b('0x12')]=0x0;for(var _0x5ad086=0x0;_0x5ad086=0x0?this[_0x0d8b('0x15')]:0x0;var _0x333674={'id':this['id'],'available':this[_0x0d8b('0x15')],'loggedIn':this[_0x0d8b('0x11')],'name':this[_0x0d8b('0x6')],'paused':this['paused'],'waiting':this[_0x0d8b('0xb')]};var _0x23d58f=md5(JSON[_0x0d8b('0x16')](_0x333674));if(this[_0x0d8b('0x1')]!==_0x23d58f){this[_0x0d8b('0x1')]=_0x23d58f;io['to'](util[_0x0d8b('0x17')](_0x0d8b('0x18'),_0x333674[_0x0d8b('0x6')]))['emit']('sms_queue:save',_0x333674);}};module[_0x0d8b('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index b6a9f2e..384e2d9 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 _0x9b00=['exports','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','paused','length','online','whatsappPause','available','loggedIn','format','whatsapp:queue:%s','whatsapp_queue:save'];(function(_0x4c737d,_0x5183dd){var _0x3d70ea=function(_0x4c21f3){while(--_0x4c21f3){_0x4c737d['push'](_0x4c737d['shift']());}};_0x3d70ea(++_0x5183dd);}(_0x9b00,0x1b1));var _0x09b0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9b00[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var md5=require(_0x09b0('0x0'));var util=require(_0x09b0('0x1'));var Redis=require(_0x09b0('0x2'));var config=require('../../../config/environment');config[_0x09b0('0x3')]=_[_0x09b0('0x4')](config[_0x09b0('0x3')],{'host':_0x09b0('0x5'),'port':0x18eb});var io=require(_0x09b0('0x6'))(new Redis(config[_0x09b0('0x3')]));function WhatsappQueue(_0x39ffdb){this['id']=_0x39ffdb['id']||0x0;this[_0x09b0('0x7')]=_0x39ffdb[_0x09b0('0x7')]||'';this['timeout']=_0x39ffdb['timeout']||0xa;this[_0x09b0('0x8')]=_0x39ffdb[_0x09b0('0x8')]||_0x09b0('0x9');this[_0x09b0('0xa')]=_0x39ffdb[_0x09b0('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x09b0('0xb')]();this[_0x09b0('0xc')]();}WhatsappQueue['prototype'][_0x09b0('0xb')]=function(){var _0x504d76=this[_0x09b0('0xd')][_0x09b0('0xe')];this[_0x09b0('0xd')]=_[_0x09b0('0xf')](this[_0x09b0('0xa')],'id');this[_0x09b0('0xd')][_0x09b0('0xe')]=_0x504d76;};WhatsappQueue[_0x09b0('0x10')][_0x09b0('0xc')]=function(){this['loggedIn']=0x0;this[_0x09b0('0x11')]=0x0;for(var _0x286079=0x0;_0x286079=0x0?this[_0x09b0('0x15')]:0x0;var _0x273f73={'id':this['id'],'available':this[_0x09b0('0x15')],'loggedIn':this[_0x09b0('0x16')],'name':this[_0x09b0('0x7')],'paused':this[_0x09b0('0x11')],'waiting':this['waiting']};var _0x5d432f=md5(JSON['stringify'](_0x273f73));if(this[_0x09b0('0x0')]!==_0x5d432f){this['md5']=_0x5d432f;io['to'](util[_0x09b0('0x17')](_0x09b0('0x18'),_0x273f73[_0x09b0('0x7')]))['emit'](_0x09b0('0x19'),_0x273f73);}};module[_0x09b0('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x7ae8=['whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','map','_rr','loggedIn','paused','online','available','stringify','format','whatsapp:queue:%s','emit'];(function(_0x19a759,_0x4d43e9){var _0x20b484=function(_0x149dd4){while(--_0x149dd4){_0x19a759['push'](_0x19a759['shift']());}};_0x20b484(++_0x4d43e9);}(_0x7ae8,0x1b5));var _0x87ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ae8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x87ae('0x0'));var md5=require(_0x87ae('0x1'));var util=require(_0x87ae('0x2'));var Redis=require(_0x87ae('0x3'));var config=require(_0x87ae('0x4'));config[_0x87ae('0x5')]=_[_0x87ae('0x6')](config['redis'],{'host':_0x87ae('0x7'),'port':0x18eb});var io=require(_0x87ae('0x8'))(new Redis(config[_0x87ae('0x5')]));function WhatsappQueue(_0x3d1a83){this['id']=_0x3d1a83['id']||0x0;this[_0x87ae('0x9')]=_0x3d1a83[_0x87ae('0x9')]||'';this[_0x87ae('0xa')]=_0x3d1a83[_0x87ae('0xa')]||0xa;this[_0x87ae('0xb')]=_0x3d1a83[_0x87ae('0xb')]||'beepall';this['Agents']=_0x3d1a83[_0x87ae('0xc')];this[_0x87ae('0xd')]={};this[_0x87ae('0xe')]=0x0;this[_0x87ae('0x1')]='';this[_0x87ae('0xf')]();this[_0x87ae('0x10')]();}WhatsappQueue['prototype'][_0x87ae('0xf')]=function(){var _0x4c7495=this[_0x87ae('0xd')]['_rr'];this[_0x87ae('0xd')]=_[_0x87ae('0x11')](this[_0x87ae('0xc')],'id');this[_0x87ae('0xd')][_0x87ae('0x12')]=_0x4c7495;};WhatsappQueue['prototype'][_0x87ae('0x10')]=function(){this[_0x87ae('0x13')]=0x0;this[_0x87ae('0x14')]=0x0;for(var _0x309294=0x0;_0x309294=0x0?this['available']:0x0;var _0x724b7d={'id':this['id'],'available':this['available'],'loggedIn':this[_0x87ae('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x44dd86=md5(JSON[_0x87ae('0x17')](_0x724b7d));if(this['md5']!==_0x44dd86){this[_0x87ae('0x1')]=_0x44dd86;io['to'](util[_0x87ae('0x18')](_0x87ae('0x19'),_0x724b7d[_0x87ae('0x9')]))[_0x87ae('0x1a')](_0x87ae('0x1b'),_0x724b7d);}};module[_0x87ae('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index b2e3661..3f56a86 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 _0x3e74=['initIntervals','mergeFromDatabase','initOpenchannelQueues','openchannelQueues','updateRealtime','updateRouting','initSmsQueues','initMailQueues','initFaxQueues','initWhatsappQueues','bluebird','lodash','moment','../model/agent','../model/chatQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','agents','intervals','chatQueues','smsQueues','mailQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','length','isUndefined'];(function(_0x25e645,_0x36f51a){var _0x4b825a=function(_0x365152){while(--_0x365152){_0x25e645['push'](_0x25e645['shift']());}};_0x4b825a(++_0x36f51a);}(_0x3e74,0x175));var _0x43e7=function(_0x5a0f92,_0x16dd0a){_0x5a0f92=_0x5a0f92-0x0;var _0x5e9b68=_0x3e74[_0x5a0f92];return _0x5e9b68;};'use strict';var BPromise=require(_0x43e7('0x0'));var util=require('util');var _=require(_0x43e7('0x1'));var moment=require(_0x43e7('0x2'));var Agent=require(_0x43e7('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x43e7('0x4'));var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0x43e7('0x5'));var FaxQueue=require(_0x43e7('0x6'));var WhatsappQueue=require(_0x43e7('0x7'));var Realtime=function(){this[_0x43e7('0x8')]={};this[_0x43e7('0x9')]={};this['openchannelQueues']={};this[_0x43e7('0xa')]={};this[_0x43e7('0xb')]={};this[_0x43e7('0xc')]={};this[_0x43e7('0xd')]={};this[_0x43e7('0xe')]={};this['chatQueuesWaitingInteractions']={};this[_0x43e7('0xf')]={};this['openchannelQueuesWaitingInteractions']={};this['smsQueuesWaitingInteractions']={};this[_0x43e7('0x10')]={};this[_0x43e7('0x11')]={};};function freeIsNotKey(_0x5c34f4,_0x2803d9,_0x513707){var _0xf7c520=_[_0x43e7('0x12')](_0x5c34f4,function(_0x4ebc8e,_0x3eb206){return _0x4ebc8e[_0x513707];});for(var _0xc960ea in _0x2803d9){if(_0x2803d9[_0x43e7('0x13')](_0xc960ea)){if(!_0xf7c520[_0xc960ea]){delete _0x2803d9[_0xc960ea];}}}}Realtime[_0x43e7('0x14')]['mergeFromDatabase']=function(_0x583d85,_0x2fcb36){for(var _0x21fdd3 in _0x2fcb36){if(_0x583d85[_0x43e7('0x13')](_0x21fdd3)){_0x583d85[_0x21fdd3]=_0x2fcb36[_0x21fdd3];}}};Realtime['prototype']['initAgents']=function(){var _0x16849c=this;return function(_0x14c146){if(_0x14c146){freeIsNotKey(_0x14c146,_0x16849c[_0x43e7('0x8')],'id');for(var _0x328445=0x0,_0x4de324={},_0x5c4eaa={};_0x328445<_0x14c146[_0x43e7('0x15')];_0x328445+=0x1){_0x4de324=_0x14c146[_0x328445];if(_[_0x43e7('0x16')](_0x16849c[_0x43e7('0x8')][_0x4de324['id']])){_0x16849c['agents'][_0x4de324['id']]=new Agent(_0x4de324);}else{_0x16849c['mergeFromDatabase'](_0x16849c[_0x43e7('0x8')][_0x4de324['id']],_0x4de324);}}}return _0x16849c[_0x43e7('0x8')];};};Realtime[_0x43e7('0x14')][_0x43e7('0x17')]=function(){var _0x3776f5=this;return function(_0x1f24fb){if(_0x1f24fb){freeIsNotKey(_0x1f24fb,_0x3776f5[_0x43e7('0x9')],'id');for(var _0x1441ef=0x0,_0x2377a3={},_0xab63cf={};_0x1441ef<_0x1f24fb[_0x43e7('0x15')];_0x1441ef+=0x1){_0x2377a3=_0x1f24fb[_0x1441ef];if(_[_0x43e7('0x16')](_0x3776f5['intervals'][_0x2377a3['id']])){_0x3776f5[_0x43e7('0x9')][_0x2377a3['id']]=new Interval(_0x2377a3);}else{_0x3776f5[_0x43e7('0x18')](_0x3776f5['intervals'][_0x2377a3['id']],_0x2377a3);}}}return _0x3776f5[_0x43e7('0x9')];};};Realtime[_0x43e7('0x14')][_0x43e7('0x19')]=function(){var _0x28aacc=this;return function(_0x4077fb){if(_0x4077fb){freeIsNotKey(_0x4077fb,_0x28aacc[_0x43e7('0x1a')],'id');for(var _0x54a9e7=0x0,_0x454359={},_0x4eea52={};_0x54a9e7<_0x4077fb['length'];_0x54a9e7+=0x1){_0x454359=_0x4077fb[_0x54a9e7];if(_[_0x43e7('0x16')](_0x28aacc[_0x43e7('0x1a')][_0x454359['id']])){_0x28aacc['openchannelQueues'][_0x454359['id']]=new OpenchannelQueue(_0x454359);}else{_0x28aacc[_0x43e7('0x18')](_0x28aacc['openchannelQueues'][_0x454359['id']],_0x454359);}_0x28aacc[_0x43e7('0x1a')][_0x454359['id']]['updateRouting']();_0x28aacc[_0x43e7('0x1a')][_0x454359['id']][_0x43e7('0x1b')]();}}return _0x28aacc[_0x43e7('0x1a')];};};Realtime[_0x43e7('0x14')]['initChatQueues']=function(){var _0x52b7b3=this;return function(_0x805b54){if(_0x805b54){freeIsNotKey(_0x805b54,_0x52b7b3['chatQueues'],'id');for(var _0x2dd5f=0x0,_0x40dc8f={},_0x3565cf={};_0x2dd5f<_0x805b54[_0x43e7('0x15')];_0x2dd5f+=0x1){_0x40dc8f=_0x805b54[_0x2dd5f];if(_['isUndefined'](_0x52b7b3[_0x43e7('0xa')][_0x40dc8f['id']])){_0x52b7b3[_0x43e7('0xa')][_0x40dc8f['id']]=new ChatQueue(_0x40dc8f);}else{_0x52b7b3[_0x43e7('0x18')](_0x52b7b3[_0x43e7('0xa')][_0x40dc8f['id']],_0x40dc8f);}_0x52b7b3[_0x43e7('0xa')][_0x40dc8f['id']][_0x43e7('0x1c')]();_0x52b7b3[_0x43e7('0xa')][_0x40dc8f['id']][_0x43e7('0x1b')]();}}return _0x52b7b3[_0x43e7('0xa')];};};Realtime[_0x43e7('0x14')][_0x43e7('0x1d')]=function(){var _0x19725a=this;return function(_0x2bde44){if(_0x2bde44){freeIsNotKey(_0x2bde44,_0x19725a[_0x43e7('0xb')],'id');for(var _0x4bdb17=0x0,_0x238321={},_0x44f6b0={};_0x4bdb17<_0x2bde44[_0x43e7('0x15')];_0x4bdb17+=0x1){_0x238321=_0x2bde44[_0x4bdb17];if(_[_0x43e7('0x16')](_0x19725a[_0x43e7('0xb')][_0x238321['id']])){_0x19725a['smsQueues'][_0x238321['id']]=new SmsQueue(_0x238321);}else{_0x19725a[_0x43e7('0x18')](_0x19725a[_0x43e7('0xb')][_0x238321['id']],_0x238321);}_0x19725a[_0x43e7('0xb')][_0x238321['id']][_0x43e7('0x1c')]();_0x19725a['smsQueues'][_0x238321['id']]['updateRealtime']();}}return _0x19725a['smsQueues'];};};Realtime[_0x43e7('0x14')][_0x43e7('0x1e')]=function(){var _0x117c07=this;return function(_0x234fe6){if(_0x234fe6){freeIsNotKey(_0x234fe6,_0x117c07[_0x43e7('0xc')],'id');for(var _0xde7ed=0x0,_0x485c6c={},_0x47baee={};_0xde7ed<_0x234fe6['length'];_0xde7ed+=0x1){_0x485c6c=_0x234fe6[_0xde7ed];if(_['isUndefined'](_0x117c07['mailQueues'][_0x485c6c['id']])){_0x117c07['mailQueues'][_0x485c6c['id']]=new MailQueue(_0x485c6c);}else{_0x117c07['mergeFromDatabase'](_0x117c07[_0x43e7('0xc')][_0x485c6c['id']],_0x485c6c);}_0x117c07['mailQueues'][_0x485c6c['id']][_0x43e7('0x1c')]();_0x117c07[_0x43e7('0xc')][_0x485c6c['id']][_0x43e7('0x1b')]();}}return _0x117c07[_0x43e7('0xc')];};};Realtime[_0x43e7('0x14')][_0x43e7('0x1f')]=function(){var _0x101d45=this;return function(_0x4f1a5f){if(_0x4f1a5f){freeIsNotKey(_0x4f1a5f,_0x101d45['faxQueues'],'id');for(var _0x5d84f4=0x0,_0xfa0474={},_0xfe70e9={};_0x5d84f4<_0x4f1a5f[_0x43e7('0x15')];_0x5d84f4+=0x1){_0xfa0474=_0x4f1a5f[_0x5d84f4];if(_[_0x43e7('0x16')](_0x101d45[_0x43e7('0xd')][_0xfa0474['id']])){_0x101d45[_0x43e7('0xd')][_0xfa0474['id']]=new FaxQueue(_0xfa0474);}else{_0x101d45[_0x43e7('0x18')](_0x101d45[_0x43e7('0xd')][_0xfa0474['id']],_0xfa0474);}_0x101d45['faxQueues'][_0xfa0474['id']][_0x43e7('0x1c')]();_0x101d45[_0x43e7('0xd')][_0xfa0474['id']]['updateRealtime']();}}return _0x101d45[_0x43e7('0xd')];};};Realtime['prototype'][_0x43e7('0x20')]=function(){var _0x2ad008=this;return function(_0x1c6f45){if(_0x1c6f45){freeIsNotKey(_0x1c6f45,_0x2ad008[_0x43e7('0xe')],'id');for(var _0x35ac85=0x0,_0x234d8f={},_0x5e731b={};_0x35ac85<_0x1c6f45['length'];_0x35ac85+=0x1){_0x234d8f=_0x1c6f45[_0x35ac85];if(_[_0x43e7('0x16')](_0x2ad008[_0x43e7('0xe')][_0x234d8f['id']])){_0x2ad008[_0x43e7('0xe')][_0x234d8f['id']]=new WhatsappQueue(_0x234d8f);}else{_0x2ad008[_0x43e7('0x18')](_0x2ad008[_0x43e7('0xe')][_0x234d8f['id']],_0x234d8f);}_0x2ad008['whatsappQueues'][_0x234d8f['id']][_0x43e7('0x1c')]();_0x2ad008[_0x43e7('0xe')][_0x234d8f['id']]['updateRealtime']();}}return _0x2ad008[_0x43e7('0xe')];};};module['exports']=Realtime; \ No newline at end of file +var _0x7fbe=['../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','agents','intervals','openchannelQueues','chatQueues','mailQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','smsQueues','initMailQueues','initFaxQueues','initWhatsappQueues','lodash','moment'];(function(_0x179ae9,_0x1c3d9f){var _0x5460ac=function(_0x433ce0){while(--_0x433ce0){_0x179ae9['push'](_0x179ae9['shift']());}};_0x5460ac(++_0x1c3d9f);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2a0bf0,_0x247ffd){_0x2a0bf0=_0x2a0bf0-0x0;var _0x104fd6=_0x7fbe[_0x2a0bf0];return _0x104fd6;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xe7fb('0x0'));var moment=require(_0xe7fb('0x1'));var Agent=require(_0xe7fb('0x2'));var Interval=require(_0xe7fb('0x3'));var OpenchannelQueue=require(_0xe7fb('0x4'));var ChatQueue=require(_0xe7fb('0x5'));var SmsQueue=require(_0xe7fb('0x6'));var MailQueue=require(_0xe7fb('0x7'));var FaxQueue=require(_0xe7fb('0x8'));var WhatsappQueue=require(_0xe7fb('0x9'));var Realtime=function(){this[_0xe7fb('0xa')]={};this[_0xe7fb('0xb')]={};this[_0xe7fb('0xc')]={};this[_0xe7fb('0xd')]={};this['smsQueues']={};this[_0xe7fb('0xe')]={};this[_0xe7fb('0xf')]={};this[_0xe7fb('0x10')]={};this[_0xe7fb('0x11')]={};this['mailQueuesWaitingInteractions']={};this['openchannelQueuesWaitingInteractions']={};this[_0xe7fb('0x12')]={};this[_0xe7fb('0x13')]={};this[_0xe7fb('0x14')]={};};function freeIsNotKey(_0x348a73,_0x2a2223,_0x42435c){var _0x3e934b=_[_0xe7fb('0x15')](_0x348a73,function(_0x325035,_0x2fe8ab){return _0x325035[_0x42435c];});for(var _0x2437d4 in _0x2a2223){if(_0x2a2223[_0xe7fb('0x16')](_0x2437d4)){if(!_0x3e934b[_0x2437d4]){delete _0x2a2223[_0x2437d4];}}}}Realtime[_0xe7fb('0x17')][_0xe7fb('0x18')]=function(_0x7fe4d3,_0x598729){for(var _0x278b75 in _0x598729){if(_0x7fe4d3[_0xe7fb('0x16')](_0x278b75)){_0x7fe4d3[_0x278b75]=_0x598729[_0x278b75];}}};Realtime['prototype'][_0xe7fb('0x19')]=function(){var _0x37eb9f=this;return function(_0x482f7d){if(_0x482f7d){freeIsNotKey(_0x482f7d,_0x37eb9f[_0xe7fb('0xa')],'id');for(var _0x559129=0x0,_0x12fff6={},_0x18d23c={};_0x559129<_0x482f7d[_0xe7fb('0x1a')];_0x559129+=0x1){_0x12fff6=_0x482f7d[_0x559129];if(_[_0xe7fb('0x1b')](_0x37eb9f['agents'][_0x12fff6['id']])){_0x37eb9f[_0xe7fb('0xa')][_0x12fff6['id']]=new Agent(_0x12fff6);}else{_0x37eb9f['mergeFromDatabase'](_0x37eb9f[_0xe7fb('0xa')][_0x12fff6['id']],_0x12fff6);}}}return _0x37eb9f['agents'];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x1c')]=function(){var _0x3f96a7=this;return function(_0x182269){if(_0x182269){freeIsNotKey(_0x182269,_0x3f96a7['intervals'],'id');for(var _0x44466e=0x0,_0x5d1c87={},_0x11cae0={};_0x44466e<_0x182269['length'];_0x44466e+=0x1){_0x5d1c87=_0x182269[_0x44466e];if(_[_0xe7fb('0x1b')](_0x3f96a7['intervals'][_0x5d1c87['id']])){_0x3f96a7[_0xe7fb('0xb')][_0x5d1c87['id']]=new Interval(_0x5d1c87);}else{_0x3f96a7[_0xe7fb('0x18')](_0x3f96a7['intervals'][_0x5d1c87['id']],_0x5d1c87);}}}return _0x3f96a7[_0xe7fb('0xb')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x1d')]=function(){var _0x4dcb4b=this;return function(_0x469d50){if(_0x469d50){freeIsNotKey(_0x469d50,_0x4dcb4b[_0xe7fb('0xc')],'id');for(var _0x5da3d9=0x0,_0x5bea27={},_0x52f08b={};_0x5da3d9<_0x469d50[_0xe7fb('0x1a')];_0x5da3d9+=0x1){_0x5bea27=_0x469d50[_0x5da3d9];if(_['isUndefined'](_0x4dcb4b['openchannelQueues'][_0x5bea27['id']])){_0x4dcb4b[_0xe7fb('0xc')][_0x5bea27['id']]=new OpenchannelQueue(_0x5bea27);}else{_0x4dcb4b[_0xe7fb('0x18')](_0x4dcb4b[_0xe7fb('0xc')][_0x5bea27['id']],_0x5bea27);}_0x4dcb4b['openchannelQueues'][_0x5bea27['id']][_0xe7fb('0x1e')]();_0x4dcb4b[_0xe7fb('0xc')][_0x5bea27['id']][_0xe7fb('0x1f')]();}}return _0x4dcb4b[_0xe7fb('0xc')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x20')]=function(){var _0x380130=this;return function(_0x59e015){if(_0x59e015){freeIsNotKey(_0x59e015,_0x380130['chatQueues'],'id');for(var _0x1086e6=0x0,_0x3bdee9={},_0xead63={};_0x1086e6<_0x59e015['length'];_0x1086e6+=0x1){_0x3bdee9=_0x59e015[_0x1086e6];if(_[_0xe7fb('0x1b')](_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']])){_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']]=new ChatQueue(_0x3bdee9);}else{_0x380130[_0xe7fb('0x18')](_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']],_0x3bdee9);}_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']][_0xe7fb('0x1e')]();_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']]['updateRealtime']();}}return _0x380130[_0xe7fb('0xd')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x21')]=function(){var _0x547a04=this;return function(_0x517d70){if(_0x517d70){freeIsNotKey(_0x517d70,_0x547a04[_0xe7fb('0x22')],'id');for(var _0x4a9fea=0x0,_0xac56b4={},_0x2f8774={};_0x4a9fea<_0x517d70[_0xe7fb('0x1a')];_0x4a9fea+=0x1){_0xac56b4=_0x517d70[_0x4a9fea];if(_[_0xe7fb('0x1b')](_0x547a04['smsQueues'][_0xac56b4['id']])){_0x547a04[_0xe7fb('0x22')][_0xac56b4['id']]=new SmsQueue(_0xac56b4);}else{_0x547a04[_0xe7fb('0x18')](_0x547a04[_0xe7fb('0x22')][_0xac56b4['id']],_0xac56b4);}_0x547a04[_0xe7fb('0x22')][_0xac56b4['id']][_0xe7fb('0x1e')]();_0x547a04['smsQueues'][_0xac56b4['id']][_0xe7fb('0x1f')]();}}return _0x547a04[_0xe7fb('0x22')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x23')]=function(){var _0x46f430=this;return function(_0x25e925){if(_0x25e925){freeIsNotKey(_0x25e925,_0x46f430[_0xe7fb('0xe')],'id');for(var _0x147eb1=0x0,_0x389903={},_0x59f9df={};_0x147eb1<_0x25e925[_0xe7fb('0x1a')];_0x147eb1+=0x1){_0x389903=_0x25e925[_0x147eb1];if(_[_0xe7fb('0x1b')](_0x46f430[_0xe7fb('0xe')][_0x389903['id']])){_0x46f430['mailQueues'][_0x389903['id']]=new MailQueue(_0x389903);}else{_0x46f430[_0xe7fb('0x18')](_0x46f430[_0xe7fb('0xe')][_0x389903['id']],_0x389903);}_0x46f430[_0xe7fb('0xe')][_0x389903['id']][_0xe7fb('0x1e')]();_0x46f430[_0xe7fb('0xe')][_0x389903['id']][_0xe7fb('0x1f')]();}}return _0x46f430[_0xe7fb('0xe')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x24')]=function(){var _0xebfe1d=this;return function(_0x29c34a){if(_0x29c34a){freeIsNotKey(_0x29c34a,_0xebfe1d[_0xe7fb('0xf')],'id');for(var _0x1544f2=0x0,_0x1c81fe={},_0xeb7c29={};_0x1544f2<_0x29c34a[_0xe7fb('0x1a')];_0x1544f2+=0x1){_0x1c81fe=_0x29c34a[_0x1544f2];if(_[_0xe7fb('0x1b')](_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']])){_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']]=new FaxQueue(_0x1c81fe);}else{_0xebfe1d['mergeFromDatabase'](_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']],_0x1c81fe);}_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']][_0xe7fb('0x1e')]();_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']]['updateRealtime']();}}return _0xebfe1d[_0xe7fb('0xf')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x25')]=function(){var _0x413a13=this;return function(_0x49fe9d){if(_0x49fe9d){freeIsNotKey(_0x49fe9d,_0x413a13[_0xe7fb('0x10')],'id');for(var _0x451a6c=0x0,_0x34265f={},_0x62a8a1={};_0x451a6c<_0x49fe9d[_0xe7fb('0x1a')];_0x451a6c+=0x1){_0x34265f=_0x49fe9d[_0x451a6c];if(_[_0xe7fb('0x1b')](_0x413a13['whatsappQueues'][_0x34265f['id']])){_0x413a13[_0xe7fb('0x10')][_0x34265f['id']]=new WhatsappQueue(_0x34265f);}else{_0x413a13[_0xe7fb('0x18')](_0x413a13[_0xe7fb('0x10')][_0x34265f['id']],_0x34265f);}_0x413a13['whatsappQueues'][_0x34265f['id']][_0xe7fb('0x1e')]();_0x413a13[_0xe7fb('0x10')][_0x34265f['id']]['updateRealtime']();}}return _0x413a13['whatsappQueues'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 1884690..ca475fc 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 _0xde90=['update','Request','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x446771,_0x57ecf7){var _0x39f4ff=function(_0x3ad619){while(--_0x3ad619){_0x446771['push'](_0x446771['shift']());}};_0x39f4ff(++_0x57ecf7);}(_0xde90,0xb9));var _0x0de9=function(_0x409d34,_0x400f1d){_0x409d34=_0x409d34-0x0;var _0x1a38bc=_0xde90[_0x409d34];return _0x1a38bc;};'use strict';var client=require(_0x0de9('0x0'));exports[_0x0de9('0x1')]=function(_0x132077,_0x5a6924){return client[_0x0de9('0x2')]('UpdateChatInteraction',{'body':_0x5a6924,'options':{'where':{'id':_0x132077}},'log':'updateChatInteraction'});};exports[_0x0de9('0x3')]=function(_0x19e1a9,_0x1d44a7){return client[_0x0de9('0x2')](_0x0de9('0x4'),{'body':_0x1d44a7,'options':{'where':{'id':_0x19e1a9}},'log':_0x0de9('0x5')});}; \ No newline at end of file +var _0x76f1=['../client','update','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x55e059,_0x2df2c5){var _0x1e6bb7=function(_0x15799b){while(--_0x15799b){_0x55e059['push'](_0x55e059['shift']());}};_0x1e6bb7(++_0x2df2c5);}(_0x76f1,0x173));var _0x176f=function(_0x3d5a96,_0x22fd2f){_0x3d5a96=_0x3d5a96-0x0;var _0x2423cd=_0x76f1[_0x3d5a96];return _0x2423cd;};'use strict';var client=require(_0x176f('0x0'));exports[_0x176f('0x1')]=function(_0x2237f2,_0x1e4a00){return client['Request'](_0x176f('0x2'),{'body':_0x1e4a00,'options':{'where':{'id':_0x2237f2}},'log':_0x176f('0x3')});};exports[_0x176f('0x4')]=function(_0x49cb48,_0x70a679){return client['Request'](_0x176f('0x5'),{'body':_0x70a679,'options':{'where':{'id':_0x49cb48}},'log':_0x176f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index ddc06a6..f21dda4 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 _0x51b5=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x58aabf,_0xb10148){var _0x339831=function(_0x5763f2){while(--_0x5763f2){_0x58aabf['push'](_0x58aabf['shift']());}};_0x339831(++_0xb10148);}(_0x51b5,0x9e));var _0x551b=function(_0x534d92,_0x477baf){_0x534d92=_0x534d92-0x0;var _0x386888=_0x51b5[_0x534d92];return _0x386888;};'use strict';var client=require(_0x551b('0x0'));exports[_0x551b('0x1')]=function(_0x54e642){return client[_0x551b('0x2')](_0x551b('0x3'),{'body':_0x54e642,'log':_0x551b('0x4')});}; \ No newline at end of file +var _0x7291=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x1a8076,_0x270397){var _0x3df2d8=function(_0x22ffb3){while(--_0x22ffb3){_0x1a8076['push'](_0x1a8076['shift']());}};_0x3df2d8(++_0x270397);}(_0x7291,0x1de));var _0x1729=function(_0x229a3f,_0x16f232){_0x229a3f=_0x229a3f-0x0;var _0x1835cb=_0x7291[_0x229a3f];return _0x1835cb;};'use strict';var client=require('../client');exports[_0x1729('0x0')]=function(_0x4ea51b){return client[_0x1729('0x1')](_0x1729('0x2'),{'body':_0x4ea51b,'log':_0x1729('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 57e8490..7fe5e5a 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 _0x0826=['GetChatQueue','name','strategy','User','Agents','online','getChatQueues','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0826,0xbe));var _0x6082=function(_0x1af96c,_0x3e61c5){_0x1af96c=_0x1af96c-0x0;var _0x5a7c00=_0x0826[_0x1af96c];return _0x5a7c00;};'use strict';var client=require('../client');exports[_0x6082('0x0')]=function(){return function(){return client[_0x6082('0x1')](_0x6082('0x2'),{'options':{'raw':![],'attributes':['id',_0x6082('0x3'),'timeout',_0x6082('0x4')],'include':[{'model':_0x6082('0x5'),'as':_0x6082('0x6'),'attributes':['id',_0x6082('0x3'),_0x6082('0x7'),'chatPause']}]},'log':_0x6082('0x0')});};}; \ No newline at end of file +var _0x14b1=['timeout','strategy','User','Agents','online','chatPause','getChatQueues','Request','GetChatQueue','name'];(function(_0x2cbb59,_0x4c8e4d){var _0x2e7e87=function(_0x1befc6){while(--_0x1befc6){_0x2cbb59['push'](_0x2cbb59['shift']());}};_0x2e7e87(++_0x4c8e4d);}(_0x14b1,0xb0));var _0x114b=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x14b1[_0x710815];return _0x5b3b89;};'use strict';var client=require('../client');exports[_0x114b('0x0')]=function(){return function(){return client[_0x114b('0x1')](_0x114b('0x2'),{'options':{'raw':![],'attributes':['id',_0x114b('0x3'),_0x114b('0x4'),_0x114b('0x5')],'include':[{'model':_0x114b('0x6'),'as':_0x114b('0x7'),'attributes':['id','name',_0x114b('0x8'),_0x114b('0x9')]}]},'log':_0x114b('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index fbfdd4a..6b865e0 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 _0x89fe=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x89fe,0x83));var _0xe89f=function(_0x31aace,_0x453090){_0x31aace=_0x31aace-0x0;var _0x557604=_0x89fe[_0x31aace];return _0x557604;};'use strict';var client=require(_0xe89f('0x0'));exports[_0xe89f('0x1')]=function(_0x2aac3e){return client[_0xe89f('0x2')]('CreateChatQueueReport',{'body':_0x2aac3e,'log':_0xe89f('0x3')});};exports[_0xe89f('0x4')]=function(_0x580dce,_0x3d3aa8){return client[_0xe89f('0x2')](_0xe89f('0x5'),{'body':_0x3d3aa8,'options':{'where':{'uniqueid':_0x580dce},'order':[['id',_0xe89f('0x6')]],'limit':0x1},'log':_0xe89f('0x5')});}; \ No newline at end of file +var _0x4853=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x540858,_0x43a51c){var _0x352a91=function(_0x9b9f4){while(--_0x9b9f4){_0x540858['push'](_0x540858['shift']());}};_0x352a91(++_0x43a51c);}(_0x4853,0x11d));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports[_0x3485('0x0')]=function(_0x503fde){return client[_0x3485('0x1')](_0x3485('0x2'),{'body':_0x503fde,'log':_0x3485('0x2')});};exports[_0x3485('0x3')]=function(_0x2854fe,_0xd1a964){return client['Request']('UpdateChatQueueReport',{'body':_0xd1a964,'options':{'where':{'uniqueid':_0x2854fe},'order':[['id','DESC']],'limit':0x1},'log':_0x3485('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index bba8d6b..8217056 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 _0x4152=['AddTagsToFaxInteraction','addTagsToFaxInteraction','update','Request','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x4152,0x1f3));var _0x2415=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0x4152[_0x49ad79];return _0xa4e38a;};'use strict';var client=require('../client');exports[_0x2415('0x0')]=function(_0x171c58,_0x2183bc){return client[_0x2415('0x1')](_0x2415('0x2'),{'body':_0x2183bc,'options':{'where':{'id':_0x171c58}},'log':_0x2415('0x3')});};exports[_0x2415('0x4')]=function(_0x4a27fa,_0x3f22ab){return client[_0x2415('0x1')](_0x2415('0x5'),{'body':_0x3f22ab,'options':{'where':{'id':_0x4a27fa}},'log':_0x2415('0x6')});}; \ No newline at end of file +var _0xc138=['../client','update','Request','UpdateFaxInteraction','updateFaxInteraction','addTags','addTagsToFaxInteraction'];(function(_0xa56232,_0x114273){var _0x2c0606=function(_0x597921){while(--_0x597921){_0xa56232['push'](_0xa56232['shift']());}};_0x2c0606(++_0x114273);}(_0xc138,0x13b));var _0x8c13=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xc138[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0x8c13('0x0'));exports[_0x8c13('0x1')]=function(_0x5c39f6,_0x263a51){return client[_0x8c13('0x2')](_0x8c13('0x3'),{'body':_0x263a51,'options':{'where':{'id':_0x5c39f6}},'log':_0x8c13('0x4')});};exports[_0x8c13('0x5')]=function(_0x502cc6,_0x1199c8){return client[_0x8c13('0x2')]('AddTagsToFaxInteraction',{'body':_0x1199c8,'options':{'where':{'id':_0x502cc6}},'log':_0x8c13('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 45335f1..5e42815 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 _0xb06e=['create','Request','createFaxMessage','../client'];(function(_0x9f5245,_0x453c0d){var _0x3efccb=function(_0x47fedf){while(--_0x47fedf){_0x9f5245['push'](_0x9f5245['shift']());}};_0x3efccb(++_0x453c0d);}(_0xb06e,0x117));var _0xeb06=function(_0x12c028,_0x92363){_0x12c028=_0x12c028-0x0;var _0x18e0e9=_0xb06e[_0x12c028];return _0x18e0e9;};'use strict';var client=require(_0xeb06('0x0'));exports[_0xeb06('0x1')]=function(_0x484871){return client[_0xeb06('0x2')]('CreateFaxMessage',{'body':_0x484871,'log':_0xeb06('0x3')});}; \ No newline at end of file +var _0x37c0=['createFaxMessage','../client','Request','CreateFaxMessage'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x37c0,0x69));var _0x037c=function(_0x5e6bdb,_0x396ed1){_0x5e6bdb=_0x5e6bdb-0x0;var _0x408cd8=_0x37c0[_0x5e6bdb];return _0x408cd8;};'use strict';var client=require(_0x037c('0x0'));exports['create']=function(_0x235c1f){return client[_0x037c('0x1')](_0x037c('0x2'),{'body':_0x235c1f,'log':_0x037c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 6c50ccd..2a1f630 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 _0x4b96=['GetFaxQueue','name','strategy','User','Agents','online','faxPause','getFaxQueues','../client','Request'];(function(_0x405e90,_0xeda809){var _0x1604b9=function(_0x4acdcc){while(--_0x4acdcc){_0x405e90['push'](_0x405e90['shift']());}};_0x1604b9(++_0xeda809);}(_0x4b96,0x148));var _0x64b9=function(_0x39b3d6,_0x52adf2){_0x39b3d6=_0x39b3d6-0x0;var _0x2e3058=_0x4b96[_0x39b3d6];return _0x2e3058;};'use strict';var client=require(_0x64b9('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x64b9('0x1')](_0x64b9('0x2'),{'options':{'raw':![],'attributes':['id',_0x64b9('0x3'),'timeout',_0x64b9('0x4')],'include':[{'model':_0x64b9('0x5'),'as':_0x64b9('0x6'),'attributes':['id',_0x64b9('0x3'),_0x64b9('0x7'),_0x64b9('0x8')]}]},'log':_0x64b9('0x9')});};}; \ No newline at end of file +var _0x2d89=['Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','strategy','User'];(function(_0x19750d,_0x1d25e2){var _0x4c8a2e=function(_0x51c5e2){while(--_0x51c5e2){_0x19750d['push'](_0x19750d['shift']());}};_0x4c8a2e(++_0x1d25e2);}(_0x2d89,0xcb));var _0x92d8=function(_0x4da944,_0x54c600){_0x4da944=_0x4da944-0x0;var _0x5be6f7=_0x2d89[_0x4da944];return _0x5be6f7;};'use strict';var client=require(_0x92d8('0x0'));exports[_0x92d8('0x1')]=function(){return function(){return client[_0x92d8('0x2')](_0x92d8('0x3'),{'options':{'raw':![],'attributes':['id',_0x92d8('0x4'),'timeout',_0x92d8('0x5')],'include':[{'model':_0x92d8('0x6'),'as':_0x92d8('0x7'),'attributes':['id',_0x92d8('0x4'),_0x92d8('0x8'),_0x92d8('0x9')]}]},'log':_0x92d8('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index b24a621..f364183 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 _0x49d6=['UpdateFaxQueueReport','DESC','../client','Request','CreateFaxQueueReport'];(function(_0x1a18f9,_0x215d54){var _0x7cce8=function(_0xd5da29){while(--_0xd5da29){_0x1a18f9['push'](_0x1a18f9['shift']());}};_0x7cce8(++_0x215d54);}(_0x49d6,0x1bf));var _0x649d=function(_0x21c16f,_0x2fd4a0){_0x21c16f=_0x21c16f-0x0;var _0x58cfaf=_0x49d6[_0x21c16f];return _0x58cfaf;};'use strict';var client=require(_0x649d('0x0'));exports['create']=function(_0x7e9203){return client[_0x649d('0x1')](_0x649d('0x2'),{'body':_0x7e9203,'log':_0x649d('0x2')});};exports['update']=function(_0x53e3a9,_0x458af9){return client[_0x649d('0x1')](_0x649d('0x3'),{'body':_0x458af9,'options':{'where':{'uniqueid':_0x53e3a9},'order':[['id',_0x649d('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x5936=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x5936,0x6a));var _0x6593=function(_0x19627d,_0x12cacd){_0x19627d=_0x19627d-0x0;var _0x26f1d5=_0x5936[_0x19627d];return _0x26f1d5;};'use strict';var client=require(_0x6593('0x0'));exports[_0x6593('0x1')]=function(_0x1289f1){return client[_0x6593('0x2')](_0x6593('0x3'),{'body':_0x1289f1,'log':_0x6593('0x3')});};exports[_0x6593('0x4')]=function(_0x1a3f4b,_0x1de783){return client['Request'](_0x6593('0x5'),{'body':_0x1de783,'options':{'where':{'uniqueid':_0x1a3f4b},'order':[['id',_0x6593('0x6')]],'limit':0x1},'log':_0x6593('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 233d45c..07f6ea7 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 _0xb10b=['name','Intervals','interval','getIntervals','../client','Request','GetInterval'];(function(_0x38dcff,_0x5f249d){var _0x6cb881=function(_0x3d2494){while(--_0x3d2494){_0x38dcff['push'](_0x38dcff['shift']());}};_0x6cb881(++_0x5f249d);}(_0xb10b,0x12a));var _0xbb10=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0xb10b[_0x32b30c];return _0xcfc212;};'use strict';var client=require(_0xbb10('0x0'));exports['getIntervals']=function(){return function(){return client[_0xbb10('0x1')](_0xbb10('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xbb10('0x3')],'include':[{'model':'Interval','as':_0xbb10('0x4'),'attributes':['id',_0xbb10('0x3'),_0xbb10('0x5')]}]},'log':_0xbb10('0x6')});};}; \ No newline at end of file +var _0x19e1=['name','../client','getIntervals','Request','GetInterval','Intervals'];(function(_0x5b2b31,_0x27d7be){var _0x24e649=function(_0x598fc5){while(--_0x598fc5){_0x5b2b31['push'](_0x5b2b31['shift']());}};_0x24e649(++_0x27d7be);}(_0x19e1,0x163));var _0x119e=function(_0x8c8176,_0x5360a1){_0x8c8176=_0x8c8176-0x0;var _0x4dc47b=_0x19e1[_0x8c8176];return _0x4dc47b;};'use strict';var client=require(_0x119e('0x0'));exports[_0x119e('0x1')]=function(){return function(){return client[_0x119e('0x2')](_0x119e('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x119e('0x4'),'attributes':['id',_0x119e('0x5'),'interval']}]},'log':_0x119e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 846eff8..672ef67 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 _0xa758=['../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTagsToChatInteraction'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa758,0x17a));var _0x8a75=function(_0xd55444,_0x18220b){_0xd55444=_0xd55444-0x0;var _0x29dc54=_0xa758[_0xd55444];return _0x29dc54;};'use strict';var client=require(_0x8a75('0x0'));exports[_0x8a75('0x1')]=function(_0x2a7e82,_0x2ea5f3){return client[_0x8a75('0x2')](_0x8a75('0x3'),{'body':_0x2ea5f3,'options':{'where':{'id':_0x2a7e82}},'log':_0x8a75('0x4')});};exports['addTags']=function(_0x4b7ed3,_0xf8f84a){return client['Request']('AddTagsToMailInteraction',{'body':_0xf8f84a,'options':{'where':{'id':_0x4b7ed3}},'log':_0x8a75('0x5')});}; \ No newline at end of file +var _0x9073=['update','UpdateMailInteraction','addTags','Request','AddTagsToMailInteraction','../client'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x9073,0x19d));var _0x3907=function(_0x4864f0,_0x5da8c5){_0x4864f0=_0x4864f0-0x0;var _0x55445a=_0x9073[_0x4864f0];return _0x55445a;};'use strict';var client=require(_0x3907('0x0'));exports[_0x3907('0x1')]=function(_0x2a4e10,_0x3ff517){return client['Request'](_0x3907('0x2'),{'body':_0x3ff517,'options':{'where':{'id':_0x2a4e10}},'log':'updateMailInteraction'});};exports[_0x3907('0x3')]=function(_0x341aa9,_0xf97d84){return client[_0x3907('0x4')](_0x3907('0x5'),{'body':_0xf97d84,'options':{'where':{'id':_0x341aa9}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index b74fe9b..370520e 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 _0x5631=['create','CreateMailMessage','createMailMessage','../client'];(function(_0x4d6026,_0x1613f9){var _0x3b3708=function(_0x21154d){while(--_0x21154d){_0x4d6026['push'](_0x4d6026['shift']());}};_0x3b3708(++_0x1613f9);}(_0x5631,0xb3));var _0x1563=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0x5631[_0x543242];return _0x4c99b6;};'use strict';var client=require(_0x1563('0x0'));exports[_0x1563('0x1')]=function(_0x381633){return client['Request'](_0x1563('0x2'),{'body':_0x381633,'log':_0x1563('0x3')});}; \ No newline at end of file +var _0xb1ea=['create','Request','CreateMailMessage'];(function(_0x1a3bee,_0x346fc8){var _0x3e71a8=function(_0x5d8086){while(--_0x5d8086){_0x1a3bee['push'](_0x1a3bee['shift']());}};_0x3e71a8(++_0x346fc8);}(_0xb1ea,0xe1));var _0xab1e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb1ea[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0xab1e('0x0')]=function(_0x323928){return client[_0xab1e('0x1')](_0xab1e('0x2'),{'body':_0x323928,'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 ba09a55..6f622a8 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 _0xf5f9=['timeout','strategy','User','online','getMailQueues','Request','GetMailQueue','name'];(function(_0x1a68f5,_0x473041){var _0x32e41a=function(_0x1fa228){while(--_0x1fa228){_0x1a68f5['push'](_0x1a68f5['shift']());}};_0x32e41a(++_0x473041);}(_0xf5f9,0x114));var _0x9f5f=function(_0x2c3903,_0x31042d){_0x2c3903=_0x2c3903-0x0;var _0x490986=_0xf5f9[_0x2c3903];return _0x490986;};'use strict';var client=require('../client');exports[_0x9f5f('0x0')]=function(){return function(){return client[_0x9f5f('0x1')](_0x9f5f('0x2'),{'options':{'raw':![],'attributes':['id',_0x9f5f('0x3'),_0x9f5f('0x4'),_0x9f5f('0x5')],'include':[{'model':_0x9f5f('0x6'),'as':'Agents','attributes':['id',_0x9f5f('0x3'),_0x9f5f('0x7'),'mailPause']}]},'log':_0x9f5f('0x0')});};}; \ No newline at end of file +var _0x7b33=['Request','GetMailQueue','name','timeout','strategy','Agents','../client','getMailQueues'];(function(_0x4aa851,_0x52b4cb){var _0x498729=function(_0x4a1b37){while(--_0x4a1b37){_0x4aa851['push'](_0x4aa851['shift']());}};_0x498729(++_0x52b4cb);}(_0x7b33,0x1a6));var _0x37b3=function(_0x3fcdbc,_0x50b298){_0x3fcdbc=_0x3fcdbc-0x0;var _0x17bace=_0x7b33[_0x3fcdbc];return _0x17bace;};'use strict';var client=require(_0x37b3('0x0'));exports[_0x37b3('0x1')]=function(){return function(){return client[_0x37b3('0x2')](_0x37b3('0x3'),{'options':{'raw':![],'attributes':['id',_0x37b3('0x4'),_0x37b3('0x5'),_0x37b3('0x6')],'include':[{'model':'User','as':_0x37b3('0x7'),'attributes':['id',_0x37b3('0x4'),'online','mailPause']}]},'log':_0x37b3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 8c08414..97f5b06 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 _0xcf30=['Request','DESC','UpdateMailQueueReport','CreateMailQueueReport'];(function(_0x28c674,_0x32b689){var _0x3ed3c9=function(_0x3c9538){while(--_0x3c9538){_0x28c674['push'](_0x28c674['shift']());}};_0x3ed3c9(++_0x32b689);}(_0xcf30,0x9b));var _0x0cf3=function(_0x2b7583,_0x2424d5){_0x2b7583=_0x2b7583-0x0;var _0x2a9b54=_0xcf30[_0x2b7583];return _0x2a9b54;};'use strict';var client=require('../client');exports['create']=function(_0x410067){return client['Request']('CreateMailQueueReport',{'body':_0x410067,'log':_0x0cf3('0x0')});};exports['update']=function(_0x5900a9,_0x681c5e){return client[_0x0cf3('0x1')]('UpdateMailQueueReport',{'body':_0x681c5e,'options':{'where':{'uniqueid':_0x5900a9},'order':[['id',_0x0cf3('0x2')]],'limit':0x1},'log':_0x0cf3('0x3')});}; \ No newline at end of file +var _0x8583=['UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','update','DESC'];(function(_0x3f8798,_0x3db7cb){var _0x57d7d4=function(_0x51f4b4){while(--_0x51f4b4){_0x3f8798['push'](_0x3f8798['shift']());}};_0x57d7d4(++_0x3db7cb);}(_0x8583,0xbe));var _0x3858=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8583[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x3858('0x0'));exports[_0x3858('0x1')]=function(_0x1f2219){return client[_0x3858('0x2')](_0x3858('0x3'),{'body':_0x1f2219,'log':_0x3858('0x3')});};exports[_0x3858('0x4')]=function(_0x55ecd1,_0x3d4789){return client[_0x3858('0x2')]('UpdateMailQueueReport',{'body':_0x3d4789,'options':{'where':{'uniqueid':_0x55ecd1},'order':[['id',_0x3858('0x5')]],'limit':0x1},'log':_0x3858('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 09ff9d0..7a00664 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 _0x6d56=['../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x54ae02,_0x22b535){var _0x4c8a24=function(_0x12a50c){while(--_0x12a50c){_0x54ae02['push'](_0x54ae02['shift']());}};_0x4c8a24(++_0x22b535);}(_0x6d56,0xf0));var _0x66d5=function(_0x51a56b,_0x2f8350){_0x51a56b=_0x51a56b-0x0;var _0x10d3f2=_0x6d56[_0x51a56b];return _0x10d3f2;};'use strict';var client=require(_0x66d5('0x0'));exports['update']=function(_0x3ad380,_0x9e0b1){return client[_0x66d5('0x1')](_0x66d5('0x2'),{'body':_0x9e0b1,'options':{'where':{'id':_0x3ad380}},'log':_0x66d5('0x3')});};exports[_0x66d5('0x4')]=function(_0x4fc54e,_0x401129){return client[_0x66d5('0x1')](_0x66d5('0x5'),{'body':_0x401129,'options':{'where':{'id':_0x4fc54e}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xafda=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x282eec,_0x53d5a8){var _0x39d87b=function(_0x550b55){while(--_0x550b55){_0x282eec['push'](_0x282eec['shift']());}};_0x39d87b(++_0x53d5a8);}(_0xafda,0x70));var _0xaafd=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0xafda[_0x1c8cc6];return _0x522936;};'use strict';var client=require(_0xaafd('0x0'));exports[_0xaafd('0x1')]=function(_0x3b9d52,_0x28d651){return client[_0xaafd('0x2')](_0xaafd('0x3'),{'body':_0x28d651,'options':{'where':{'id':_0x3b9d52}},'log':_0xaafd('0x4')});};exports[_0xaafd('0x5')]=function(_0x381dcb,_0x3b0964){return client['Request'](_0xaafd('0x6'),{'body':_0x3b0964,'options':{'where':{'id':_0x381dcb}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index eed832b..cc825a4 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 _0xe14d=['Request','createOpenchannelMessage','../client','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe14d,0x1ee));var _0xde14=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xe14d[_0x2b10c6];return _0x3789d2;};'use strict';var client=require(_0xde14('0x0'));exports[_0xde14('0x1')]=function(_0x1b5d3b){return client[_0xde14('0x2')]('CreateOpenchannelMessage',{'body':_0x1b5d3b,'log':_0xde14('0x3')});}; \ No newline at end of file +var _0xbec5=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x1f7532,_0x3a476b){var _0xb0dfff=function(_0x2cacbd){while(--_0x2cacbd){_0x1f7532['push'](_0x1f7532['shift']());}};_0xb0dfff(++_0x3a476b);}(_0xbec5,0xe5));var _0x5bec=function(_0x6aad74,_0x32ecf4){_0x6aad74=_0x6aad74-0x0;var _0x5b1c38=_0xbec5[_0x6aad74];return _0x5b1c38;};'use strict';var client=require(_0x5bec('0x0'));exports[_0x5bec('0x1')]=function(_0x4cfc3b){return client[_0x5bec('0x2')](_0x5bec('0x3'),{'body':_0x4cfc3b,'log':_0x5bec('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index f27d3c0..f5df878 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 _0xa497=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','../client'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0xa497,0x18f));var _0x7a49=function(_0x53afaf,_0x31d94a){_0x53afaf=_0x53afaf-0x0;var _0x34a0bc=_0xa497[_0x53afaf];return _0x34a0bc;};'use strict';var client=require(_0x7a49('0x0'));exports[_0x7a49('0x1')]=function(){return function(){return client[_0x7a49('0x2')](_0x7a49('0x3'),{'options':{'raw':![],'attributes':['id',_0x7a49('0x4'),_0x7a49('0x5'),_0x7a49('0x6')],'include':[{'model':_0x7a49('0x7'),'as':_0x7a49('0x8'),'attributes':['id',_0x7a49('0x4'),_0x7a49('0x9'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xa560=['Agents','online','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name','strategy','User'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa560,0xd6));var _0x0a56=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa560[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0x0a56('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x0a56('0x1')](_0x0a56('0x2'),{'options':{'raw':![],'attributes':['id',_0x0a56('0x3'),'timeout',_0x0a56('0x4')],'include':[{'model':_0x0a56('0x5'),'as':_0x0a56('0x6'),'attributes':['id','name',_0x0a56('0x7'),_0x0a56('0x8')]}]},'log':_0x0a56('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index cf60eea..2887659 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 _0x13fa=['DESC','UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x5d0a45,_0x30dec6){var _0x882530=function(_0xa0820a){while(--_0xa0820a){_0x5d0a45['push'](_0x5d0a45['shift']());}};_0x882530(++_0x30dec6);}(_0x13fa,0x13a));var _0xa13f=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x13fa[_0x4709c0];return _0x13348b;};'use strict';var client=require('../client');exports[_0xa13f('0x0')]=function(_0x2c669c){return client[_0xa13f('0x1')](_0xa13f('0x2'),{'body':_0x2c669c,'log':_0xa13f('0x2')});};exports[_0xa13f('0x3')]=function(_0x211669,_0x32cd79){return client[_0xa13f('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x32cd79,'options':{'where':{'uniqueid':_0x211669},'order':[['id',_0xa13f('0x4')]],'limit':0x1},'log':_0xa13f('0x5')});}; \ No newline at end of file +var _0xf604=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','create','Request'];(function(_0x3c2166,_0x41fc16){var _0x30ccc3=function(_0x689bc3){while(--_0x689bc3){_0x3c2166['push'](_0x3c2166['shift']());}};_0x30ccc3(++_0x41fc16);}(_0xf604,0x190));var _0x4f60=function(_0x1348c0,_0x7a9608){_0x1348c0=_0x1348c0-0x0;var _0x8a6441=_0xf604[_0x1348c0];return _0x8a6441;};'use strict';var client=require('../client');exports[_0x4f60('0x0')]=function(_0x3cb9a9){return client[_0x4f60('0x1')]('CreateOpenchannelQueueReport',{'body':_0x3cb9a9,'log':_0x4f60('0x2')});};exports[_0x4f60('0x3')]=function(_0x1ab81f,_0x37b689){return client[_0x4f60('0x1')](_0x4f60('0x4'),{'body':_0x37b689,'options':{'where':{'uniqueid':_0x1ab81f},'order':[['id',_0x4f60('0x5')]],'limit':0x1},'log':_0x4f60('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index dccd635..85002bc 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 _0x965d=['addTags','../client','update','Request','UpdateSmsInteraction'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x965d,0x1be));var _0xd965=function(_0x3dce75,_0x2db1d8){_0x3dce75=_0x3dce75-0x0;var _0x48a09f=_0x965d[_0x3dce75];return _0x48a09f;};'use strict';var client=require(_0xd965('0x0'));exports[_0xd965('0x1')]=function(_0x4de48c,_0x1e6958){return client[_0xd965('0x2')](_0xd965('0x3'),{'body':_0x1e6958,'options':{'where':{'id':_0x4de48c}},'log':'updateSmsInteraction'});};exports[_0xd965('0x4')]=function(_0x10fc54,_0x2c2b60){return client['Request']('AddTagsToSmsInteraction',{'body':_0x2c2b60,'options':{'where':{'id':_0x10fc54}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x677e=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0xfd084b,_0x26977e){var _0x375d60=function(_0xfec175){while(--_0xfec175){_0xfd084b['push'](_0xfd084b['shift']());}};_0x375d60(++_0x26977e);}(_0x677e,0x7a));var _0xe677=function(_0x487ee4,_0x3d3e66){_0x487ee4=_0x487ee4-0x0;var _0x3b0877=_0x677e[_0x487ee4];return _0x3b0877;};'use strict';var client=require(_0xe677('0x0'));exports[_0xe677('0x1')]=function(_0x268e48,_0x2a7542){return client[_0xe677('0x2')](_0xe677('0x3'),{'body':_0x2a7542,'options':{'where':{'id':_0x268e48}},'log':'updateSmsInteraction'});};exports[_0xe677('0x4')]=function(_0x9d8f99,_0x5c6f63){return client['Request'](_0xe677('0x5'),{'body':_0x5c6f63,'options':{'where':{'id':_0x9d8f99}},'log':_0xe677('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 3f81caa..f457f2d 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 _0x095f=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x3c9799,_0x585d21){var _0x170c3d=function(_0x5f28ad){while(--_0x5f28ad){_0x3c9799['push'](_0x3c9799['shift']());}};_0x170c3d(++_0x585d21);}(_0x095f,0x8c));var _0xf095=function(_0x50e661,_0x1424fa){_0x50e661=_0x50e661-0x0;var _0x2edaea=_0x095f[_0x50e661];return _0x2edaea;};'use strict';var client=require(_0xf095('0x0'));exports[_0xf095('0x1')]=function(_0x373728){return client[_0xf095('0x2')](_0xf095('0x3'),{'body':_0x373728,'log':_0xf095('0x4')});}; \ No newline at end of file +var _0xfc8f=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0xfc8f,0x17e));var _0xffc8=function(_0xc7f8e7,_0x1873fb){_0xc7f8e7=_0xc7f8e7-0x0;var _0x10af62=_0xfc8f[_0xc7f8e7];return _0x10af62;};'use strict';var client=require(_0xffc8('0x0'));exports[_0xffc8('0x1')]=function(_0x562181){return client[_0xffc8('0x2')](_0xffc8('0x3'),{'body':_0x562181,'log':_0xffc8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index ac215f6..de2c97a 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 _0xe81b=['name','timeout','online','smsPause','../client','getSmsQueues','Request','GetSmsQueue'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0xe81b,0xe4));var _0xbe81=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xe81b[_0x819464];return _0x49dcc0;};'use strict';var client=require(_0xbe81('0x0'));exports[_0xbe81('0x1')]=function(){return function(){return client[_0xbe81('0x2')](_0xbe81('0x3'),{'options':{'raw':![],'attributes':['id',_0xbe81('0x4'),_0xbe81('0x5'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0xbe81('0x4'),_0xbe81('0x6'),_0xbe81('0x7')]}]},'log':_0xbe81('0x1')});};}; \ No newline at end of file +var _0x78e2=['strategy','User','Agents','smsPause','../client','getSmsQueues','Request','GetSmsQueue','name','timeout'];(function(_0x3e54d5,_0x2ac81e){var _0x2afdc1=function(_0x58a0a6){while(--_0x58a0a6){_0x3e54d5['push'](_0x3e54d5['shift']());}};_0x2afdc1(++_0x2ac81e);}(_0x78e2,0x1a8));var _0x278e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78e2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x278e('0x0'));exports[_0x278e('0x1')]=function(){return function(){return client[_0x278e('0x2')](_0x278e('0x3'),{'options':{'raw':![],'attributes':['id',_0x278e('0x4'),_0x278e('0x5'),_0x278e('0x6')],'include':[{'model':_0x278e('0x7'),'as':_0x278e('0x8'),'attributes':['id',_0x278e('0x4'),'online',_0x278e('0x9')]}]},'log':_0x278e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index b07be93..36e0863 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 _0x3748=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x508a0a,_0x3ed316){var _0x4acf06=function(_0x9cea61){while(--_0x9cea61){_0x508a0a['push'](_0x508a0a['shift']());}};_0x4acf06(++_0x3ed316);}(_0x3748,0x12d));var _0x8374=function(_0x4f6588,_0x34099a){_0x4f6588=_0x4f6588-0x0;var _0xc62e9f=_0x3748[_0x4f6588];return _0xc62e9f;};'use strict';var client=require(_0x8374('0x0'));exports[_0x8374('0x1')]=function(_0x25ead3){return client['Request'](_0x8374('0x2'),{'body':_0x25ead3,'log':_0x8374('0x2')});};exports[_0x8374('0x3')]=function(_0x31f8da,_0xf241a){return client[_0x8374('0x4')](_0x8374('0x5'),{'body':_0xf241a,'options':{'where':{'uniqueid':_0x31f8da},'order':[['id',_0x8374('0x6')]],'limit':0x1},'log':_0x8374('0x5')});}; \ No newline at end of file +var _0x831b=['DESC','UpdateSmsQueueReport','../client','create','Request','CreateSmsQueueReport','update'];(function(_0xcfc44,_0x179bc1){var _0x307a25=function(_0x2b64de){while(--_0x2b64de){_0xcfc44['push'](_0xcfc44['shift']());}};_0x307a25(++_0x179bc1);}(_0x831b,0x160));var _0xb831=function(_0xf1062f,_0x2c3db9){_0xf1062f=_0xf1062f-0x0;var _0x27ce62=_0x831b[_0xf1062f];return _0x27ce62;};'use strict';var client=require(_0xb831('0x0'));exports[_0xb831('0x1')]=function(_0x10ecf4){return client[_0xb831('0x2')](_0xb831('0x3'),{'body':_0x10ecf4,'log':_0xb831('0x3')});};exports[_0xb831('0x4')]=function(_0x95724c,_0x188b3d){return client['Request']('UpdateSmsQueueReport',{'body':_0x188b3d,'options':{'where':{'uniqueid':_0x95724c},'order':[['id',_0xb831('0x5')]],'limit':0x1},'log':_0xb831('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 6b37f19..41c1de7 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 _0xbb38=['smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','agent','name','online','pauseType','lastPauseAt','voicePause','chatPause','faxPause'];(function(_0x5f50a6,_0x1f02f4){var _0x4ed80f=function(_0x15a4ba){while(--_0x15a4ba){_0x5f50a6['push'](_0x5f50a6['shift']());}};_0x4ed80f(++_0x1f02f4);}(_0xbb38,0x1c9));var _0x8bb3=function(_0x254abd,_0x1ab7f0){_0x254abd=_0x254abd-0x0;var _0x31bf1b=_0xbb38[_0x254abd];return _0x31bf1b;};'use strict';var client=require(_0x8bb3('0x0'));exports[_0x8bb3('0x1')]=function(){return function(){return client[_0x8bb3('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x8bb3('0x3')},'attributes':['id',_0x8bb3('0x4'),_0x8bb3('0x5'),_0x8bb3('0x6'),_0x8bb3('0x7'),_0x8bb3('0x8'),_0x8bb3('0x9'),'mailPause',_0x8bb3('0xa'),_0x8bb3('0xb'),'whatsappPause',_0x8bb3('0xc'),_0x8bb3('0xd'),_0x8bb3('0xe'),_0x8bb3('0xf'),_0x8bb3('0x10'),'whatsappCapacity',_0x8bb3('0x11')]},'log':'getAgents'});};}; \ No newline at end of file +var _0x1133=['whatsappPause','chatCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','../client','Request','GetUser','name','chatPause','faxPause','smsPause'];(function(_0x3d5fe6,_0x1ce578){var _0x344a2c=function(_0x17af5b){while(--_0x17af5b){_0x3d5fe6['push'](_0x3d5fe6['shift']());}};_0x344a2c(++_0x1ce578);}(_0x1133,0x14b));var _0x3113=function(_0xcccce9,_0xd9da68){_0xcccce9=_0xcccce9-0x0;var _0x221838=_0x1133[_0xcccce9];return _0x221838;};'use strict';var client=require(_0x3113('0x0'));exports['getAgents']=function(){return function(){return client[_0x3113('0x1')](_0x3113('0x2'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x3113('0x3'),'online','pauseType','lastPauseAt','voicePause',_0x3113('0x4'),'mailPause',_0x3113('0x5'),_0x3113('0x6'),_0x3113('0x7'),'openchannelPause',_0x3113('0x8'),'mailCapacity',_0x3113('0x9'),_0x3113('0xa'),'whatsappCapacity',_0x3113('0xb')]},'log':_0x3113('0xc')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 0e73142..f884e4d 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 _0xacfe=['addTagsToWhatsappInteraction','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0xa85fda,_0x4cc327){var _0x431b52=function(_0x2a8a95){while(--_0x2a8a95){_0xa85fda['push'](_0xa85fda['shift']());}};_0x431b52(++_0x4cc327);}(_0xacfe,0xfd));var _0xeacf=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xacfe[_0x4fc9e6];return _0x551d28;};'use strict';var client=require('../client');exports['update']=function(_0x58f423,_0xb5dfb5){return client[_0xeacf('0x0')](_0xeacf('0x1'),{'body':_0xb5dfb5,'options':{'where':{'id':_0x58f423}},'log':_0xeacf('0x2')});};exports[_0xeacf('0x3')]=function(_0x2fbe17,_0x2bd934){return client[_0xeacf('0x0')](_0xeacf('0x4'),{'body':_0x2bd934,'options':{'where':{'id':_0x2fbe17}},'log':_0xeacf('0x5')});}; \ No newline at end of file +var _0xd404=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x2866ad,_0x263c7e){var _0x2138c5=function(_0x115100){while(--_0x115100){_0x2866ad['push'](_0x2866ad['shift']());}};_0x2138c5(++_0x263c7e);}(_0xd404,0x15b));var _0x4d40=function(_0x2c230f,_0x2a5c2f){_0x2c230f=_0x2c230f-0x0;var _0x2e4803=_0xd404[_0x2c230f];return _0x2e4803;};'use strict';var client=require(_0x4d40('0x0'));exports[_0x4d40('0x1')]=function(_0x5b9c2b,_0xb6576c){return client[_0x4d40('0x2')]('UpdateWhatsappInteraction',{'body':_0xb6576c,'options':{'where':{'id':_0x5b9c2b}},'log':_0x4d40('0x3')});};exports[_0x4d40('0x4')]=function(_0xba821,_0x8bde12){return client[_0x4d40('0x2')](_0x4d40('0x5'),{'body':_0x8bde12,'options':{'where':{'id':_0xba821}},'log':_0x4d40('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 4a2c0c3..0983e74 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 _0x376f=['../client','create','Request','CreateWhatsappMessage'];(function(_0x2fd1ae,_0x5af591){var _0x462bee=function(_0x5dbe4a){while(--_0x5dbe4a){_0x2fd1ae['push'](_0x2fd1ae['shift']());}};_0x462bee(++_0x5af591);}(_0x376f,0x128));var _0xf376=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x376f[_0x2070da];return _0x4f9fe1;};'use strict';var client=require(_0xf376('0x0'));exports[_0xf376('0x1')]=function(_0x297e9b){return client[_0xf376('0x2')](_0xf376('0x3'),{'body':_0x297e9b,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x7d03=['../client','create','Request','createWhatsappMessage'];(function(_0xb8e1f2,_0x4c06a6){var _0xc37396=function(_0x20cc61){while(--_0x20cc61){_0xb8e1f2['push'](_0xb8e1f2['shift']());}};_0xc37396(++_0x4c06a6);}(_0x7d03,0x124));var _0x37d0=function(_0x473706,_0x1231ec){_0x473706=_0x473706-0x0;var _0x36d47d=_0x7d03[_0x473706];return _0x36d47d;};'use strict';var client=require(_0x37d0('0x0'));exports[_0x37d0('0x1')]=function(_0x2e54e0){return client[_0x37d0('0x2')]('CreateWhatsappMessage',{'body':_0x2e54e0,'log':_0x37d0('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 16fb9fc..b105690 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 _0x44a3=['timeout','strategy','User','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x44a3,0x1a9));var _0x344a=function(_0x5b45da,_0x52bb87){_0x5b45da=_0x5b45da-0x0;var _0x2327f7=_0x44a3[_0x5b45da];return _0x2327f7;};'use strict';var client=require(_0x344a('0x0'));exports[_0x344a('0x1')]=function(){return function(){return client[_0x344a('0x2')](_0x344a('0x3'),{'options':{'raw':![],'attributes':['id',_0x344a('0x4'),_0x344a('0x5'),_0x344a('0x6')],'include':[{'model':_0x344a('0x7'),'as':'Agents','attributes':['id',_0x344a('0x4'),_0x344a('0x8'),_0x344a('0x9')]}]},'log':_0x344a('0x1')});};}; \ No newline at end of file +var _0x6b20=['online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','timeout','strategy','User','name'];(function(_0x38c160,_0x1318fa){var _0x780b56=function(_0x51c44e){while(--_0x51c44e){_0x38c160['push'](_0x38c160['shift']());}};_0x780b56(++_0x1318fa);}(_0x6b20,0xd1));var _0x06b2=function(_0x2326b9,_0x57945b){_0x2326b9=_0x2326b9-0x0;var _0x1fdb39=_0x6b20[_0x2326b9];return _0x1fdb39;};'use strict';var client=require(_0x06b2('0x0'));exports[_0x06b2('0x1')]=function(){return function(){return client['Request'](_0x06b2('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x06b2('0x3'),_0x06b2('0x4')],'include':[{'model':_0x06b2('0x5'),'as':'Agents','attributes':['id',_0x06b2('0x6'),_0x06b2('0x7'),_0x06b2('0x8')]}]},'log':_0x06b2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 96c7497..3106ea4 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 _0x8c43=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','Request'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x8c43,0xc4));var _0x38c4=function(_0x279acb,_0x4e2764){_0x279acb=_0x279acb-0x0;var _0x90cdd0=_0x8c43[_0x279acb];return _0x90cdd0;};'use strict';var client=require(_0x38c4('0x0'));exports['create']=function(_0x3d1aa5){return client[_0x38c4('0x1')](_0x38c4('0x2'),{'body':_0x3d1aa5,'log':_0x38c4('0x2')});};exports[_0x38c4('0x3')]=function(_0x4c9a0d,_0xc9fdbc){return client[_0x38c4('0x1')](_0x38c4('0x4'),{'body':_0xc9fdbc,'options':{'where':{'uniqueid':_0x4c9a0d},'order':[['id',_0x38c4('0x5')]],'limit':0x1},'log':_0x38c4('0x4')});}; \ No newline at end of file +var _0xd7e2=['UpdateWhatsappQueueReport','DESC','../client','create','CreateWhatsappQueueReport','update','Request'];(function(_0x1a1674,_0x445946){var _0x2f64d7=function(_0x446c4c){while(--_0x446c4c){_0x1a1674['push'](_0x1a1674['shift']());}};_0x2f64d7(++_0x445946);}(_0xd7e2,0x72));var _0x2d7e=function(_0x54b072,_0x10677e){_0x54b072=_0x54b072-0x0;var _0x15f608=_0xd7e2[_0x54b072];return _0x15f608;};'use strict';var client=require(_0x2d7e('0x0'));exports[_0x2d7e('0x1')]=function(_0x4088b0){return client['Request']('CreateWhatsappQueueReport',{'body':_0x4088b0,'log':_0x2d7e('0x2')});};exports[_0x2d7e('0x3')]=function(_0x348be0,_0x282af0){return client[_0x2d7e('0x4')](_0x2d7e('0x5'),{'body':_0x282af0,'options':{'where':{'uniqueid':_0x348be0},'order':[['id',_0x2d7e('0x6')]],'limit':0x1},'log':_0x2d7e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index a007c1d..83d1f77 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 _0xdcf4=['[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','util','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete'];(function(_0x17f363,_0x53e47b){var _0x5d7c1b=function(_0x6ac196){while(--_0x6ac196){_0x17f363['push'](_0x17f363['shift']());}};_0x5d7c1b(++_0x53e47b);}(_0xdcf4,0xeb));var _0x4dcf=function(_0x38aa3a,_0x40cbdd){_0x38aa3a=_0x38aa3a-0x0;var _0x2e44d7=_0xdcf4[_0x38aa3a];return _0x2e44d7;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x4dcf('0x0'));var seqqueue=require('seq-queue');var logger=require(_0x4dcf('0x1'))('routing');var strategy=require(_0x4dcf('0x2'));var queue=schema({'name':{'type':_0x4dcf('0x3'),'required':!![],'message':_0x4dcf('0x4')},'timeout':{'type':_0x4dcf('0x5'),'message':_0x4dcf('0x6')}});function writeLog(_0x3e97ea,_0x2f5d62,_0x500f7b){return logger[_0x4dcf('0x7')](util[_0x4dcf('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x3e97ea,_0x2f5d62[_0x4dcf('0x9')],_0x500f7b));}function handleFindAgent(_0x3cd35d){return function(_0x20b419){return _0x20b419[_0x4dcf('0x9')][_0x4dcf('0xa')]()===_0x3cd35d[_0x4dcf('0xa')]();};}exports[_0x4dcf('0xb')]=function(_0x5e32ed,_0x501f81,_0x335ac8,_0x3de17d){return function(_0x4703f5){try{var _0x1b457d={'name':_0x501f81[0x0],'timeout':_0x501f81[0x1]};var _0x599d8f=queue[_0x4dcf('0xc')](_0x1b457d,{'typecast':!![]});if(_0x599d8f[_0x4dcf('0xd')]){logger[_0x4dcf('0xe')](_0x4dcf('0xf'),_0x5e32ed,_[_0x4dcf('0x10')](_0x599d8f,_0x4dcf('0x11'))[_0x4dcf('0x12')](',\x20'));_0x4703f5[_0x4dcf('0x13')]();}else{var _0x1407ae=_[_0x4dcf('0x14')](_0x335ac8[_0x4dcf('0x15')],handleFindAgent(_0x1b457d['name']));if(_0x1407ae){var _0x5589f1=(_0x1b457d['timeout']||0xa)*0x3e8;var _0x36754d,_0x167205;var _0x4ec552=seqqueue[_0x4dcf('0x16')](_0x5589f1);_0x4ec552['id']=_0x5e32ed;_0x4ec552[_0x4dcf('0x17')]=_0x5589f1;_0x4ec552[_0x4dcf('0x18')]=_0x3de17d[_0x4dcf('0x18')];writeLog(_0x5e32ed,_0x1407ae,util[_0x4dcf('0x8')](_0x4dcf('0x19'),_0x5589f1));_0x335ac8[_0x4dcf('0x1a')][_0x5e32ed]['on'](_0x4dcf('0x1b'),function(){logger[_0x4dcf('0x7')](_0x4dcf('0x1c'),_0x5e32ed);clearTimeout(_0x167205);_0x167205=undefined;_0x4ec552[_0x4dcf('0x1d')]();if(_0x335ac8[_0x4dcf('0x1a')][_0x5e32ed]){delete _0x335ac8['rules'][_0x5e32ed];}_0x4703f5[_0x4dcf('0x13')]();});_0x335ac8[_0x4dcf('0x1a')][_0x5e32ed]['on'](_0x4dcf('0x1e'),function(){if(_0x335ac8[_0x4dcf('0x1a')][_0x5e32ed]){delete _0x335ac8[_0x4dcf('0x1a')][_0x5e32ed];}});_0x167205=setTimeout(function(){logger[_0x4dcf('0x7')](_0x4dcf('0x1f'),_0x5e32ed);clearTimeout(_0x167205);_0x4ec552[_0x4dcf('0x1d')]();_0x4703f5[_0x4dcf('0x20')]();},_0x5589f1);strategy[_0x4dcf('0x21')](_0x4ec552,_0x1407ae,_0x335ac8,_0x3de17d);}else{logger[_0x4dcf('0xe')](_0x4dcf('0x22'),_0x5e32ed,_0x1b457d[_0x4dcf('0x9')]);_0x4703f5[_0x4dcf('0x13')]();}}}catch(_0x3a4ffa){console[_0x4dcf('0x23')](_0x3a4ffa);logger[_0x4dcf('0xe')](_0x4dcf('0x24'),_0x5e32ed,_0x3a4ffa[_0x4dcf('0x25')]);_0x4703f5['stop']();}};}; \ No newline at end of file +var _0xa9fe=['util','seq-queue','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','atimeout','channel','format','START:%s','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','lodash'];(function(_0x4c6ad2,_0x51092b){var _0x215c13=function(_0xf76c84){while(--_0xf76c84){_0x4c6ad2['push'](_0x4c6ad2['shift']());}};_0x215c13(++_0x51092b);}(_0xa9fe,0xae));var _0xea9f=function(_0x571e38,_0x5134eb){_0x571e38=_0x571e38-0x0;var _0x6fc2b5=_0xa9fe[_0x571e38];return _0x6fc2b5;};'use strict';var schema=require('validate');var _=require(_0xea9f('0x0'));var util=require(_0xea9f('0x1'));var seqqueue=require(_0xea9f('0x2'));var logger=require('../../../../config/logger')(_0xea9f('0x3'));var strategy=require(_0xea9f('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xea9f('0x5')},'timeout':{'type':_0xea9f('0x6'),'message':_0xea9f('0x7')}});function writeLog(_0x319b99,_0x30dbc1,_0x11fed3){return logger[_0xea9f('0x8')](util['format'](_0xea9f('0x9'),_0x319b99,_0x30dbc1[_0xea9f('0xa')],_0x11fed3));}function handleFindAgent(_0x2f99b4){return function(_0x3d4a8c){return _0x3d4a8c[_0xea9f('0xa')][_0xea9f('0xb')]()===_0x2f99b4['toLowerCase']();};}exports['consequence']=function(_0x57743,_0x362d03,_0x5991a4,_0x18d55f){return function(_0x3f74bf){try{var _0x5e1ffb={'name':_0x362d03[0x0],'timeout':_0x362d03[0x1]};var _0x4afc3d=queue[_0xea9f('0xc')](_0x5e1ffb,{'typecast':!![]});if(_0x4afc3d[_0xea9f('0xd')]){logger[_0xea9f('0xe')](_0xea9f('0xf'),_0x57743,_[_0xea9f('0x10')](_0x4afc3d,_0xea9f('0x11'))[_0xea9f('0x12')](',\x20'));_0x3f74bf[_0xea9f('0x13')]();}else{var _0xf8f02=_['find'](_0x5991a4[_0xea9f('0x14')],handleFindAgent(_0x5e1ffb[_0xea9f('0xa')]));if(_0xf8f02){var _0x5f575b=(_0x5e1ffb[_0xea9f('0x15')]||0xa)*0x3e8;var _0x24f154,_0x38287d;var _0x2c610f=seqqueue['createQueue'](_0x5f575b);_0x2c610f['id']=_0x57743;_0x2c610f[_0xea9f('0x16')]=_0x5f575b;_0x2c610f['channel']=_0x18d55f[_0xea9f('0x17')];writeLog(_0x57743,_0xf8f02,util[_0xea9f('0x18')](_0xea9f('0x19'),_0x5f575b));_0x5991a4[_0xea9f('0x1a')][_0x57743]['on'](_0xea9f('0x1b'),function(){logger[_0xea9f('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x57743);clearTimeout(_0x38287d);_0x38287d=undefined;_0x2c610f[_0xea9f('0x1c')]();if(_0x5991a4[_0xea9f('0x1a')][_0x57743]){delete _0x5991a4[_0xea9f('0x1a')][_0x57743];}_0x3f74bf[_0xea9f('0x13')]();});_0x5991a4[_0xea9f('0x1a')][_0x57743]['on'](_0xea9f('0x1d'),function(){if(_0x5991a4['rules'][_0x57743]){delete _0x5991a4['rules'][_0x57743];}});_0x38287d=setTimeout(function(){logger['info'](_0xea9f('0x1e'),_0x57743);clearTimeout(_0x38287d);_0x2c610f['close']();_0x3f74bf['next']();},_0x5f575b);strategy[_0xea9f('0x1f')](_0x2c610f,_0xf8f02,_0x5991a4,_0x18d55f);}else{logger[_0xea9f('0xe')](_0xea9f('0x20'),_0x57743,_0x5e1ffb[_0xea9f('0xa')]);_0x3f74bf[_0xea9f('0x13')]();}}}catch(_0x1e96ea){console[_0xea9f('0x21')](_0x1e96ea);logger['error'](_0xea9f('0x22'),_0x57743,_0x1e96ea['stack']);_0x3f74bf['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 42db966..9f5897e 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 _0x5e84=['amazonlex','providerName','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','body','catch','error','stringify','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText'];(function(_0x3f40ee,_0x2992d4){var _0x161aeb=function(_0x581153){while(--_0x581153){_0x3f40ee['push'](_0x3f40ee['shift']());}};_0x161aeb(++_0x2992d4);}(_0x5e84,0xd1));var _0x45e8=function(_0x243223,_0x3bee50){_0x243223=_0x243223-0x0;var _0x3b5c86=_0x5e84[_0x243223];return _0x3b5c86;};'use strict';var _=require(_0x45e8('0x0'));var moment=require(_0x45e8('0x1'));var AWS=require(_0x45e8('0x2'));var utils=require(_0x45e8('0x3'));var logger=require(_0x45e8('0x4'))(_0x45e8('0x5'));var rpc={'chatMessage':require(_0x45e8('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x45e8('0x7')),'faxMessage':require(_0x45e8('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x45e8('0x9')]=function(_0x148ed7,_0x5c24c7){return function(_0x1b13db){try{if(!_[_0x45e8('0xa')](this[_0x45e8('0xb')][_0x45e8('0xc')])){logger[_0x45e8('0xd')]('[%s][AMAZONLEX]\x20%s',_0x148ed7,_0x45e8('0xe'));return _0x1b13db[_0x45e8('0xf')]();}var _0x16c321={'ContactId':this['contact']['id'],'sentAt':moment()[_0x45e8('0x10')](_0x45e8('0x11')),'direction':_0x45e8('0x12')};if(this[_0x45e8('0x13')]===_0x45e8('0x14')||this[_0x45e8('0x13')]===_0x45e8('0x15')){_0x16c321[_0x45e8('0x16')]=this['interaction'][_0x45e8('0x16')];}var _0x1fc66e=this[_0x45e8('0x13')];if(_0x1fc66e===_0x45e8('0x17')){_0x16c321[_0x45e8('0x18')]=this[_0x45e8('0x19')]['id'];}else{_0x16c321[_['upperFirst'](_0x1fc66e)+_0x45e8('0x1a')]=this[_0x45e8('0x19')]['id'];}_0x16c321[_['upperFirst'](_0x1fc66e)+_0x45e8('0x1b')]=this['interaction']['id'];if(this[_0x45e8('0xb')][_0x45e8('0x1c')]){var _0x9f0662=_0x5c24c7[0x4];if(!_[_0x45e8('0x1d')](_0x9f0662)){_0x16c321['body']=utils[_0x45e8('0x1e')](_0x9f0662,this);return rpc[_0x1fc66e+_0x45e8('0x1f')][_0x45e8('0x20')](_0x16c321)[_0x45e8('0x21')](function(_0x2b9609){logger[_0x45e8('0xd')](_0x45e8('0x22'),_0x148ed7,_0x16c321[_0x45e8('0x23')]);})[_0x45e8('0x24')](function(_0x5e0e8d){logger[_0x45e8('0x25')](_0x45e8('0x22'),_0x148ed7,JSON[_0x45e8('0x26')](_0x5e0e8d));})['finally'](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x148ed7);_0x1b13db[_0x45e8('0x27')]();});}else{logger[_0x45e8('0xd')](_0x45e8('0x28'),_0x148ed7);_0x1b13db[_0x45e8('0x27')]();}}else{var _0x9fffe6=this;var _0x153785=new AWS[(_0x45e8('0x29'))]({'accessKeyId':_0x5c24c7[0x0],'secretAccessKey':_0x5c24c7[0x1],'region':_0x5c24c7[0x2]});var _0xce3839={'botAlias':_0x45e8('0x2a'),'botName':_0x5c24c7[0x3],'inputText':this[_0x45e8('0x2b')]['body'],'userId':this[_0x45e8('0x13')]+':'+this[_0x45e8('0xb')]['id'][_0x45e8('0x2c')]()};_0x153785[_0x45e8('0x2d')](_0xce3839,function(_0x445198,_0xc3374a){if(_0x445198){logger[_0x45e8('0x25')](_0x45e8('0x22'),_0x148ed7,_0x445198[_0x45e8('0x2b')]);_0x1b13db[_0x45e8('0xf')]();}else if(_0xc3374a&&_0xc3374a[_0x45e8('0x2b')]){_0x9fffe6[_0x45e8('0x23')][_0x45e8('0x2e')]=_0xc3374a;_0x16c321[_0x45e8('0x23')]=_0xc3374a[_0x45e8('0x2b')];_0x16c321[_0x45e8('0x2f')]='amazonlex';_0x16c321[_0x45e8('0x30')]=JSON[_0x45e8('0x26')](_0xc3374a);return rpc[_0x1fc66e+_0x45e8('0x1f')][_0x45e8('0x20')](_0x16c321)['then'](function(_0x575d8a){logger[_0x45e8('0xd')](_0x45e8('0x22'),_0x148ed7,_0x16c321[_0x45e8('0x23')]);if(_0xc3374a[_0x45e8('0x31')]==_0x45e8('0x32')){_0x1b13db['next']();}else{_0x1b13db[_0x45e8('0x27')]();}})[_0x45e8('0x24')](function(_0x510f73){logger[_0x45e8('0x25')](_0x45e8('0x22'),_0x148ed7,JSON[_0x45e8('0x26')](_0x510f73));_0x1b13db[_0x45e8('0xf')]();});}else{_0x1b13db[_0x45e8('0xf')]();}});}}catch(_0x21514e){logger['error'](_0x45e8('0x22'),_0x148ed7,JSON[_0x45e8('0x26')](_0x21514e));_0x1b13db['stop']();}};}; \ No newline at end of file +var _0xff76=['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','message','amazonlex','providerName','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch'];(function(_0xdfd552,_0x5f39a0){var _0x598335=function(_0x1dc924){while(--_0x1dc924){_0xdfd552['push'](_0xdfd552['shift']());}};_0x598335(++_0x5f39a0);}(_0xff76,0xc7));var _0x6ff7=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xff76[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x6ff7('0x0'));var moment=require(_0x6ff7('0x1'));var AWS=require(_0x6ff7('0x2'));var utils=require(_0x6ff7('0x3'));var logger=require(_0x6ff7('0x4'))(_0x6ff7('0x5'));var rpc={'chatMessage':require(_0x6ff7('0x6')),'openchannelMessage':require(_0x6ff7('0x7')),'mailMessage':require(_0x6ff7('0x8')),'smsMessage':require(_0x6ff7('0x9')),'faxMessage':require(_0x6ff7('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x6ff7('0xb')]=function(_0x16f050,_0xec1ac4){return function(_0x410ab2){try{if(!_[_0x6ff7('0xc')](this[_0x6ff7('0xd')][_0x6ff7('0xe')])){logger[_0x6ff7('0xf')](_0x6ff7('0x10'),_0x16f050,_0x6ff7('0x11'));return _0x410ab2[_0x6ff7('0x12')]();}var _0x34374b={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x6ff7('0x13')),'direction':_0x6ff7('0x14')};if(this[_0x6ff7('0x15')]===_0x6ff7('0x16')||this[_0x6ff7('0x15')]==='whatsapp'){_0x34374b[_0x6ff7('0x17')]=this[_0x6ff7('0xd')][_0x6ff7('0x17')];}var _0x260831=this[_0x6ff7('0x15')];if(_0x260831===_0x6ff7('0x18')){_0x34374b[_0x6ff7('0x19')]=this['account']['id'];}else{_0x34374b[_[_0x6ff7('0x1a')](_0x260831)+_0x6ff7('0x1b')]=this['account']['id'];}_0x34374b[_['upperFirst'](_0x260831)+_0x6ff7('0x1c')]=this[_0x6ff7('0xd')]['id'];if(this[_0x6ff7('0xd')]['created']){var _0x42bef5=_0xec1ac4[0x4];if(!_[_0x6ff7('0x1d')](_0x42bef5)){_0x34374b[_0x6ff7('0x1e')]=utils[_0x6ff7('0x1f')](_0x42bef5,this);return rpc[_0x260831+_0x6ff7('0x20')][_0x6ff7('0x21')](_0x34374b)[_0x6ff7('0x22')](function(_0x53f266){logger['info'](_0x6ff7('0x10'),_0x16f050,_0x34374b['body']);})[_0x6ff7('0x23')](function(_0x2877ab){logger[_0x6ff7('0x24')]('[%s][AMAZONLEX]\x20%s',_0x16f050,JSON[_0x6ff7('0x25')](_0x2877ab));})[_0x6ff7('0x26')](function(){logger[_0x6ff7('0xf')](_0x6ff7('0x27'),_0x16f050);_0x410ab2[_0x6ff7('0x28')]();});}else{logger['info'](_0x6ff7('0x29'),_0x16f050);_0x410ab2[_0x6ff7('0x28')]();}}else{var _0x3094b3=this;var _0x200806=new AWS[(_0x6ff7('0x2a'))]({'accessKeyId':_0xec1ac4[0x0],'secretAccessKey':_0xec1ac4[0x1],'region':_0xec1ac4[0x2]});var _0xca8aea={'botAlias':'$LATEST','botName':_0xec1ac4[0x3],'inputText':this[_0x6ff7('0x2b')][_0x6ff7('0x1e')],'userId':this[_0x6ff7('0x15')]+':'+this[_0x6ff7('0xd')]['id']['toString']()};_0x200806['postText'](_0xca8aea,function(_0x5e511c,_0x1bdb51){if(_0x5e511c){logger['error'](_0x6ff7('0x10'),_0x16f050,_0x5e511c[_0x6ff7('0x2b')]);_0x410ab2[_0x6ff7('0x12')]();}else if(_0x1bdb51&&_0x1bdb51[_0x6ff7('0x2b')]){_0x3094b3[_0x6ff7('0x1e')][_0x6ff7('0x2c')]=_0x1bdb51;_0x34374b[_0x6ff7('0x1e')]=_0x1bdb51['message'];_0x34374b[_0x6ff7('0x2d')]=_0x6ff7('0x2c');_0x34374b['providerResponse']=JSON[_0x6ff7('0x25')](_0x1bdb51);return rpc[_0x260831+_0x6ff7('0x20')]['create'](_0x34374b)[_0x6ff7('0x22')](function(_0x4e7049){logger['info']('[%s][AMAZONLEX]\x20%s',_0x16f050,_0x34374b['body']);if(_0x1bdb51[_0x6ff7('0x2e')]=='Failed'){_0x410ab2[_0x6ff7('0x12')]();}else{_0x410ab2[_0x6ff7('0x28')]();}})[_0x6ff7('0x23')](function(_0xceba19){logger[_0x6ff7('0x24')](_0x6ff7('0x10'),_0x16f050,JSON['stringify'](_0xceba19));_0x410ab2[_0x6ff7('0x12')]();});}else{_0x410ab2['next']();}});}}catch(_0xd476d8){logger[_0x6ff7('0x24')](_0x6ff7('0x10'),_0x16f050,JSON[_0x6ff7('0x25')](_0xd476d8));_0x410ab2[_0x6ff7('0x28')]();}};}; \ 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 5d28afa..95ff1de 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 _0x5f2f=['info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','contact','format','out','channel','mail','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','upperFirst','account','InteractionId','Message','service','Smtp','host','port','secure','authentication','auth','pass','inReplyTo','','','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','catch','finally','next','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','../../mailRpc','consequence','interaction','created'];(function(_0x3e1fe4,_0x53d11e){var _0x13f21e=function(_0x2bb91b){while(--_0x2bb91b){_0x3e1fe4['push'](_0x3e1fe4['shift']());}};_0x13f21e(++_0x53d11e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x163b80,_0x5e63e5){_0x163b80=_0x163b80-0x0;var _0x10d631=_0x5f2f[_0x163b80];return _0x10d631;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var utils=require(_0xf5f2('0x2'));var logger=require(_0xf5f2('0x3'))(_0xf5f2('0x4'));var rpc={'chatMessage':require(_0xf5f2('0x5')),'openchannelMessage':require(_0xf5f2('0x6')),'mailMessage':require(_0xf5f2('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf5f2('0x8'))};var mailRpc=require(_0xf5f2('0x9'));exports[_0xf5f2('0xa')]=function(_0x3eebf6,_0x3133bc){return function(_0x473100){try{if(_0x3133bc[0x0]==='1'&&(_['isNil'](this[_0xf5f2('0xb')][_0xf5f2('0xc')])||!this[_0xf5f2('0xb')]['created'])){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x3eebf6,_0xf5f2('0xf'));return _0x473100['next']();}var _0x977a59=this['channel'];var _0x53fb33={'ContactId':this[_0xf5f2('0x10')]['id'],'sentAt':moment()[_0xf5f2('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xf5f2('0x12')};if(this[_0xf5f2('0x13')]===_0xf5f2('0x14')){_0x53fb33[_0xf5f2('0x15')]=utils[_0xf5f2('0x16')](_0x3133bc[0x2],this);}else{_0x53fb33[_0xf5f2('0x15')]=utils['getMustacheRender'](_0x3133bc[0x1],this);}if(this[_0xf5f2('0x17')]){_0x53fb33['to']=this[_0xf5f2('0x17')][_0xf5f2('0x18')]||'';if(this[_0xf5f2('0x13')]===_0xf5f2('0x14')&&_0x3133bc[0x1]==='1'){_0x53fb33['cc']=this['message']['cc']||'';}_0x53fb33[_0xf5f2('0x18')]=this[_0xf5f2('0x17')]['to']||'';_0x53fb33[_0xf5f2('0x19')]=this[_0xf5f2('0x17')][_0xf5f2('0x19')]||'';_0x53fb33[_0xf5f2('0x1a')]=!![];if(this[_0xf5f2('0x17')][_0xf5f2('0x1b')]){_0x53fb33[_0xf5f2('0x1b')]='';_0x53fb33[_0xf5f2('0x1b')]+=_[_0xf5f2('0x1c')](this[_0xf5f2('0x17')][_0xf5f2('0x1b')],_0xf5f2('0x1d'))?'':_0xf5f2('0x1e');_0x53fb33[_0xf5f2('0x1b')]+=this[_0xf5f2('0x17')]['subject'];}}if(this[_0xf5f2('0x13')]===_0xf5f2('0x1f')){_0x53fb33['ChatWebsiteId']=this['account']['id'];}else{_0x53fb33[_[_0xf5f2('0x20')](this[_0xf5f2('0x13')])+'AccountId']=this[_0xf5f2('0x21')]['id'];}_0x53fb33[_[_0xf5f2('0x20')](this[_0xf5f2('0x13')])+_0xf5f2('0x22')]=this[_0xf5f2('0xb')]['id'];if(rpc[this['channel']+_0xf5f2('0x23')]){if(this[_0xf5f2('0x13')]===_0xf5f2('0x14')){var _0x2833fe={'tls':{'rejectUnauthorized':![]}};if(this[_0xf5f2('0x21')]['Smtp']['service']){_0x2833fe[_0xf5f2('0x24')]=this[_0xf5f2('0x21')][_0xf5f2('0x25')][_0xf5f2('0x24')];}else{_0x2833fe[_0xf5f2('0x26')]=this[_0xf5f2('0x21')][_0xf5f2('0x25')][_0xf5f2('0x26')];_0x2833fe[_0xf5f2('0x27')]=this['account'][_0xf5f2('0x25')][_0xf5f2('0x27')];_0x2833fe[_0xf5f2('0x28')]=this[_0xf5f2('0x21')][_0xf5f2('0x25')][_0xf5f2('0x28')];}if(this['account']['Smtp'][_0xf5f2('0x29')]){_0x2833fe[_0xf5f2('0x2a')]={'user':this[_0xf5f2('0x21')]['Smtp']['user'],'pass':this[_0xf5f2('0x21')][_0xf5f2('0x25')][_0xf5f2('0x2b')]};}_0x53fb33[_0xf5f2('0x2c')]=this[_0xf5f2('0x17')]['messageId'];_0x53fb33['html']=_0xf5f2('0x2d')+_['replace'](_0x53fb33[_0xf5f2('0x15')],'','headers','auto-replied','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','[%s][AUTOREPLY]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../mailRpc','consequence','isNil','created','info','Autoreply\x20already\x20sent','next','channel','contact','format','mail','body'];(function(_0x2bedeb,_0x10baea){var _0x2f2643=function(_0x4cdeeb){while(--_0x4cdeeb){_0x2bedeb['push'](_0x2bedeb['shift']());}};_0x2f2643(++_0x10baea);}(_0xb3a9,0xa2));var _0x9b3a=function(_0x4683f9,_0x4ebc6c){_0x4683f9=_0x4683f9-0x0;var _0x3435ba=_0xb3a9[_0x4683f9];return _0x3435ba;};'use strict';var _=require(_0x9b3a('0x0'));var moment=require(_0x9b3a('0x1'));var utils=require(_0x9b3a('0x2'));var logger=require(_0x9b3a('0x3'))(_0x9b3a('0x4'));var rpc={'chatMessage':require(_0x9b3a('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x9b3a('0x6')),'smsMessage':require(_0x9b3a('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x9b3a('0x8'))};var mailRpc=require(_0x9b3a('0x9'));exports[_0x9b3a('0xa')]=function(_0x2f6367,_0x8faa65){return function(_0x83835b){try{if(_0x8faa65[0x0]==='1'&&(_[_0x9b3a('0xb')](this['interaction'][_0x9b3a('0xc')])||!this['interaction'][_0x9b3a('0xc')])){logger[_0x9b3a('0xd')]('[%s][AUTOREPLY]\x20%s',_0x2f6367,_0x9b3a('0xe'));return _0x83835b[_0x9b3a('0xf')]();}var _0x1b5b92=this[_0x9b3a('0x10')];var _0x1d8066={'ContactId':this[_0x9b3a('0x11')]['id'],'sentAt':moment()[_0x9b3a('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x9b3a('0x10')]===_0x9b3a('0x13')){_0x1d8066[_0x9b3a('0x14')]=utils[_0x9b3a('0x15')](_0x8faa65[0x2],this);}else{_0x1d8066[_0x9b3a('0x14')]=utils['getMustacheRender'](_0x8faa65[0x1],this);}if(this[_0x9b3a('0x16')]){_0x1d8066['to']=this[_0x9b3a('0x16')][_0x9b3a('0x17')]||'';if(this[_0x9b3a('0x10')]==='mail'&&_0x8faa65[0x1]==='1'){_0x1d8066['cc']=this[_0x9b3a('0x16')]['cc']||'';}_0x1d8066[_0x9b3a('0x17')]=this[_0x9b3a('0x16')]['to']||'';_0x1d8066['phone']=this[_0x9b3a('0x16')][_0x9b3a('0x18')]||'';_0x1d8066[_0x9b3a('0x19')]=!![];if(this[_0x9b3a('0x16')][_0x9b3a('0x1a')]){_0x1d8066[_0x9b3a('0x1a')]='';_0x1d8066[_0x9b3a('0x1a')]+=_[_0x9b3a('0x1b')](this[_0x9b3a('0x16')][_0x9b3a('0x1a')],'Re:')?'':_0x9b3a('0x1c');_0x1d8066[_0x9b3a('0x1a')]+=this[_0x9b3a('0x16')]['subject'];}}if(this[_0x9b3a('0x10')]===_0x9b3a('0x1d')){_0x1d8066[_0x9b3a('0x1e')]=this[_0x9b3a('0x1f')]['id'];}else{_0x1d8066[_[_0x9b3a('0x20')](this[_0x9b3a('0x10')])+_0x9b3a('0x21')]=this['account']['id'];}_0x1d8066[_[_0x9b3a('0x20')](this['channel'])+'InteractionId']=this[_0x9b3a('0x22')]['id'];if(rpc[this[_0x9b3a('0x10')]+'Message']){if(this[_0x9b3a('0x10')]==='mail'){var _0xa8ed22={'tls':{'rejectUnauthorized':![]}};if(this[_0x9b3a('0x1f')][_0x9b3a('0x23')]['service']){_0xa8ed22[_0x9b3a('0x24')]=this[_0x9b3a('0x1f')][_0x9b3a('0x23')][_0x9b3a('0x24')];}else{_0xa8ed22[_0x9b3a('0x25')]=this[_0x9b3a('0x1f')][_0x9b3a('0x23')][_0x9b3a('0x25')];_0xa8ed22[_0x9b3a('0x26')]=this[_0x9b3a('0x1f')][_0x9b3a('0x23')]['port'];_0xa8ed22['secure']=this[_0x9b3a('0x1f')][_0x9b3a('0x23')]['secure'];}if(this['account'][_0x9b3a('0x23')]['authentication']){_0xa8ed22[_0x9b3a('0x27')]={'user':this[_0x9b3a('0x1f')]['Smtp'][_0x9b3a('0x28')],'pass':this['account'][_0x9b3a('0x23')][_0x9b3a('0x29')]};}_0x1d8066[_0x9b3a('0x2a')]=this[_0x9b3a('0x16')][_0x9b3a('0x2b')];_0x1d8066[_0x9b3a('0x2c')]=''+_['replace'](_0x1d8066[_0x9b3a('0x14')],_0x9b3a('0x2d'),_0x9b3a('0x2e'))+_0x9b3a('0x2f');_0x1d8066[_0x9b3a('0x30')]={'Auto-Submitted':_0x9b3a('0x31'),'X-Auto-Response-Suppress':'All','Precedence':'auto_reply'};return mailRpc['sendMailMessage'](_0xa8ed22,_0x1d8066)[_0x9b3a('0x32')](function(_0x5e7a61){logger[_0x9b3a('0xd')](_0x9b3a('0x33'),_0x2f6367);_0x1d8066[_0x9b3a('0x2b')]=_0x5e7a61[_0x9b3a('0x16')]['messageId'];return rpc[_0x1b5b92+_0x9b3a('0x34')][_0x9b3a('0x35')](_0x1d8066);})['then'](function(_0x3a52f9){logger[_0x9b3a('0xd')]('[%s][AUTOREPLY]\x20%s',_0x2f6367,JSON[_0x9b3a('0x36')](_0x3a52f9));})[_0x9b3a('0x37')](function(_0x92ab42){logger[_0x9b3a('0x38')](_0x9b3a('0x39'),_0x2f6367,JSON[_0x9b3a('0x36')](_0x92ab42));})[_0x9b3a('0x3a')](function(){_0x83835b[_0x9b3a('0xf')]();});}else{return rpc[this['channel']+_0x9b3a('0x34')]['create'](_0x1d8066)[_0x9b3a('0x32')](function(_0x21b699){logger[_0x9b3a('0xd')](_0x9b3a('0x3b'),_0x2f6367,_0x1d8066[_0x9b3a('0x14')]);})[_0x9b3a('0x37')](function(_0x2c9b0e){logger[_0x9b3a('0x38')]('[%s][AUTOREPLY]\x20%s',_0x2f6367,JSON['stringify'](_0x2c9b0e));})[_0x9b3a('0x3a')](function(){_0x83835b[_0x9b3a('0xf')]();});}}}catch(_0x52ce65){logger[_0x9b3a('0x38')](_0x9b3a('0x3b'),_0x2f6367,JSON['stringify'](_0x52ce65));_0x83835b[_0x9b3a('0x3c')]();}};}; \ 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 3eefaf4..3767271 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 _0xd072=['../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x4cfe20,_0x2cafbf){var _0x552531=function(_0x35d791){while(--_0x35d791){_0x4cfe20['push'](_0x4cfe20['shift']());}};_0x552531(++_0x2cafbf);}(_0xd072,0x132));var _0x2d07=function(_0x480f3d,_0xe8926e){_0x480f3d=_0x480f3d-0x0;var _0x5976ce=_0xd072[_0x480f3d];return _0x5976ce;};'use strict';var moment=require(_0x2d07('0x0'));var logger=require(_0x2d07('0x1'))(_0x2d07('0x2'));var rpc={'chatInteraction':require(_0x2d07('0x3')),'openchannelInteraction':require(_0x2d07('0x4')),'smsInteraction':require(_0x2d07('0x5')),'mailInteraction':require(_0x2d07('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x2d07('0x7'))};exports[_0x2d07('0x8')]=function(_0x46e549,_0x141260,_0x34731c,_0x51aae0){return function(_0x1a992a){try{logger[_0x2d07('0x9')](_0x2d07('0xa'),_0x46e549,_0x141260[0x0]);var _0x19d04c={'closed':0x1,'closedAt':moment()[_0x2d07('0xb')](_0x2d07('0xc')),'closeReason':_0x2d07('0xd'),'disposition':_0x141260[0x0]};if(rpc[_0x51aae0['channel']+_0x2d07('0xe')]){rpc[_0x51aae0[_0x2d07('0xf')]+_0x2d07('0xe')][_0x2d07('0x10')](_0x51aae0[_0x2d07('0x11')]['id'],_0x19d04c)[_0x2d07('0x12')](function(_0xa88073){logger[_0x2d07('0x9')](_0x2d07('0x13'),_0x46e549,_0x51aae0[_0x2d07('0x11')]['id']);})[_0x2d07('0x14')](function(_0x7d5a63){logger[_0x2d07('0x15')](_0x2d07('0x16'),_0x46e549,JSON[_0x2d07('0x17')](_0x7d5a63));})[_0x2d07('0x18')](function(){_0x1a992a[_0x2d07('0x19')]();});}}catch(_0x159007){logger[_0x2d07('0x15')](_0x2d07('0x16'),_0x46e549,JSON[_0x2d07('0x17')](_0x159007));_0x1a992a[_0x2d07('0x19')]();}};}; \ No newline at end of file +var _0x21b7=['catch','[%s][CLOSE]\x20%s','finally','stop','stringify','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','system','channel','Interaction','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0xea897b,_0x269096){var _0x8a736e=function(_0x2b13b6){while(--_0x2b13b6){_0xea897b['push'](_0xea897b['shift']());}};_0x8a736e(++_0x269096);}(_0x21b7,0xef));var _0x721b=function(_0x524ebe,_0x297df2){_0x524ebe=_0x524ebe-0x0;var _0x45e6df=_0x21b7[_0x524ebe];return _0x45e6df;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require(_0x721b('0x0')),'openchannelInteraction':require(_0x721b('0x1')),'smsInteraction':require(_0x721b('0x2')),'mailInteraction':require(_0x721b('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x721b('0x4')]=function(_0x1169bf,_0xe21ce9,_0x343cd3,_0x168d33){return function(_0x470ee0){try{logger['info'](_0x721b('0x5'),_0x1169bf,_0xe21ce9[0x0]);var _0x2c4096={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x721b('0x6'),'disposition':_0xe21ce9[0x0]};if(rpc[_0x168d33[_0x721b('0x7')]+_0x721b('0x8')]){rpc[_0x168d33[_0x721b('0x7')]+_0x721b('0x8')]['update'](_0x168d33[_0x721b('0x9')]['id'],_0x2c4096)[_0x721b('0xa')](function(_0x30c163){logger[_0x721b('0xb')](_0x721b('0xc'),_0x1169bf,_0x168d33[_0x721b('0x9')]['id']);})[_0x721b('0xd')](function(_0x580320){logger['error'](_0x721b('0xe'),_0x1169bf,JSON['stringify'](_0x580320));})[_0x721b('0xf')](function(){_0x470ee0[_0x721b('0x10')]();});}}catch(_0x538be4){logger['error'](_0x721b('0xe'),_0x1169bf,JSON[_0x721b('0x11')](_0x538be4));_0x470ee0[_0x721b('0x10')]();}};}; \ 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 c51d88b..a03e683 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 _0x0aaf=['providerResponse','stringify','create','metadata','endConversation','message','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','AccountId','upperFirst','interaction','created','isEmpty','body','getMustacheRender','Message','then','[%s][DIALOGFLOW]\x20%s','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','fulfillment','speech','providerName'];(function(_0x327b08,_0x7ee70b){var _0x552f0f=function(_0x53dd32){while(--_0x53dd32){_0x327b08['push'](_0x327b08['shift']());}};_0x552f0f(++_0x7ee70b);}(_0x0aaf,0x1c8));var _0xf0aa=function(_0x475191,_0x5bce86){_0x475191=_0x475191-0x0;var _0x189e96=_0x0aaf[_0x475191];return _0x189e96;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0xf0aa('0x0'));var md5=require(_0xf0aa('0x1'));var utils=require(_0xf0aa('0x2'));var logger=require(_0xf0aa('0x3'))(_0xf0aa('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf0aa('0x5')),'mailMessage':require(_0xf0aa('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf0aa('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xf0aa('0x8')]=function(_0x4c2d11,_0xe4a744){return function(_0x244745){try{if(!_[_0xf0aa('0x9')](this['interaction'][_0xf0aa('0xa')])){logger[_0xf0aa('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x4c2d11,_0xf0aa('0xc'));return _0x244745[_0xf0aa('0xd')]();}var _0x3c71d8={'ContactId':this[_0xf0aa('0xe')]['id'],'sentAt':moment()[_0xf0aa('0xf')](_0xf0aa('0x10')),'direction':_0xf0aa('0x11')};if(this[_0xf0aa('0x12')]===_0xf0aa('0x13')||this[_0xf0aa('0x12')]===_0xf0aa('0x14')){_0x3c71d8[_0xf0aa('0x15')]=this['interaction']['phone'];}var _0x421c0f=this[_0xf0aa('0x12')];if(_0x421c0f==='chat'){_0x3c71d8['ChatWebsiteId']=this[_0xf0aa('0x16')]['id'];}else{_0x3c71d8[_['upperFirst'](_0x421c0f)+_0xf0aa('0x17')]=this['account']['id'];}_0x3c71d8[_[_0xf0aa('0x18')](_0x421c0f)+'InteractionId']=this[_0xf0aa('0x19')]['id'];if(this[_0xf0aa('0x19')][_0xf0aa('0x1a')]){var _0x1f95f0=_0xe4a744[0x2];if(!_[_0xf0aa('0x1b')](_0x1f95f0)){_0x3c71d8[_0xf0aa('0x1c')]=utils[_0xf0aa('0x1d')](_0x1f95f0,this);return rpc[_0x421c0f+_0xf0aa('0x1e')]['create'](_0x3c71d8)[_0xf0aa('0x1f')](function(_0x30f055){logger['info'](_0xf0aa('0x20'),_0x4c2d11,_0x3c71d8[_0xf0aa('0x1c')]);})[_0xf0aa('0x21')](function(_0xc51de){logger[_0xf0aa('0x22')](_0xf0aa('0x20'),_0x4c2d11,JSON['stringify'](_0xc51de));})[_0xf0aa('0x23')](function(){logger[_0xf0aa('0xb')](_0xf0aa('0x24'),_0x4c2d11);_0x244745[_0xf0aa('0x25')]();});}else{logger[_0xf0aa('0xb')](_0xf0aa('0x26'),_0x4c2d11);_0x244745['stop']();}}else{var _0x5e2470=this;var _0x4c6f86=apiai(_0xe4a744[0x0],{'language':_0xe4a744[0x1]||'en'});return _0x4c6f86[_0xf0aa('0x27')](this['message'][_0xf0aa('0x1c')],{'sessionId':md5(this[_0xf0aa('0x19')]['id'])})[_0xf0aa('0x1f')](function(_0x2983ee){_0x5e2470[_0xf0aa('0x1c')][_0xf0aa('0x28')]=_0x2983ee;_0x3c71d8[_0xf0aa('0x1c')]=_0x2983ee['result'][_0xf0aa('0x29')][_0xf0aa('0x2a')];_0x3c71d8[_0xf0aa('0x2b')]=_0xf0aa('0x28');_0x3c71d8[_0xf0aa('0x2c')]=JSON[_0xf0aa('0x2d')](_0x2983ee);return rpc[_0x421c0f+_0xf0aa('0x1e')][_0xf0aa('0x2e')](_0x3c71d8)['then'](function(_0x5bfedc){logger[_0xf0aa('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x4c2d11,_0x3c71d8[_0xf0aa('0x1c')]);if(_0x2983ee['result'][_0xf0aa('0x2f')][_0xf0aa('0x30')]){_0x244745['next']();}else{_0x244745['stop']();}})[_0xf0aa('0x21')](function(_0x132950){logger[_0xf0aa('0x22')](_0xf0aa('0x20'),_0x4c2d11,JSON[_0xf0aa('0x2d')](_0x132950));_0x244745[_0xf0aa('0xd')]();});})[_0xf0aa('0x21')](function(_0x266a0e){logger['error'](_0xf0aa('0x20'),_0x4c2d11,_0x266a0e[_0xf0aa('0x31')]);_0x244745['next']();});}}catch(_0x5ec818){logger['error'](_0xf0aa('0x20'),_0x4c2d11,JSON[_0xf0aa('0x2d')](_0x5ec818));_0x244745['stop']();}};}; \ No newline at end of file +var _0xbe2d=['phone','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','metadata','endConversation','next','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp'];(function(_0x88817b,_0x1f9192){var _0x589a14=function(_0x353b00){while(--_0x353b00){_0x88817b['push'](_0x88817b['shift']());}};_0x589a14(++_0x1f9192);}(_0xbe2d,0x17b));var _0xdbe2=function(_0x3695a6,_0x15b430){_0x3695a6=_0x3695a6-0x0;var _0x26826c=_0xbe2d[_0x3695a6];return _0x26826c;};'use strict';var _=require(_0xdbe2('0x0'));var moment=require('moment');var apiai=require(_0xdbe2('0x1'));var md5=require(_0xdbe2('0x2'));var utils=require(_0xdbe2('0x3'));var logger=require(_0xdbe2('0x4'))(_0xdbe2('0x5'));var rpc={'chatMessage':require(_0xdbe2('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xdbe2('0x7')),'faxMessage':require(_0xdbe2('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x5b8eca,_0x5252a7){return function(_0xdb8c53){try{if(!_[_0xdbe2('0x9')](this[_0xdbe2('0xa')][_0xdbe2('0xb')])){logger[_0xdbe2('0xc')](_0xdbe2('0xd'),_0x5b8eca,_0xdbe2('0xe'));return _0xdb8c53['next']();}var _0x2389b9={'ContactId':this['contact']['id'],'sentAt':moment()[_0xdbe2('0xf')](_0xdbe2('0x10')),'direction':_0xdbe2('0x11')};if(this[_0xdbe2('0x12')]===_0xdbe2('0x13')||this['channel']===_0xdbe2('0x14')){_0x2389b9[_0xdbe2('0x15')]=this[_0xdbe2('0xa')][_0xdbe2('0x15')];}var _0x3fb550=this[_0xdbe2('0x12')];if(_0x3fb550==='chat'){_0x2389b9[_0xdbe2('0x16')]=this[_0xdbe2('0x17')]['id'];}else{_0x2389b9[_[_0xdbe2('0x18')](_0x3fb550)+_0xdbe2('0x19')]=this[_0xdbe2('0x17')]['id'];}_0x2389b9[_['upperFirst'](_0x3fb550)+'InteractionId']=this[_0xdbe2('0xa')]['id'];if(this['interaction'][_0xdbe2('0x1a')]){var _0x22ffb1=_0x5252a7[0x2];if(!_[_0xdbe2('0x1b')](_0x22ffb1)){_0x2389b9[_0xdbe2('0x1c')]=utils['getMustacheRender'](_0x22ffb1,this);return rpc[_0x3fb550+_0xdbe2('0x1d')][_0xdbe2('0x1e')](_0x2389b9)[_0xdbe2('0x1f')](function(_0x5e4b34){logger['info'](_0xdbe2('0xd'),_0x5b8eca,_0x2389b9[_0xdbe2('0x1c')]);})[_0xdbe2('0x20')](function(_0x4633aa){logger[_0xdbe2('0x21')](_0xdbe2('0xd'),_0x5b8eca,JSON[_0xdbe2('0x22')](_0x4633aa));})[_0xdbe2('0x23')](function(){logger[_0xdbe2('0xc')](_0xdbe2('0x24'),_0x5b8eca);_0xdb8c53[_0xdbe2('0x25')]();});}else{logger[_0xdbe2('0xc')](_0xdbe2('0x26'),_0x5b8eca);_0xdb8c53[_0xdbe2('0x25')]();}}else{var _0x2c389e=this;var _0x3fdb5e=apiai(_0x5252a7[0x0],{'language':_0x5252a7[0x1]||'en'});return _0x3fdb5e[_0xdbe2('0x27')](this[_0xdbe2('0x28')][_0xdbe2('0x1c')],{'sessionId':md5(this['interaction']['id'])})[_0xdbe2('0x1f')](function(_0x352739){_0x2c389e['body']['dialogflow']=_0x352739;_0x2389b9[_0xdbe2('0x1c')]=_0x352739[_0xdbe2('0x29')][_0xdbe2('0x2a')][_0xdbe2('0x2b')];_0x2389b9[_0xdbe2('0x2c')]=_0xdbe2('0x2d');_0x2389b9[_0xdbe2('0x2e')]=JSON[_0xdbe2('0x22')](_0x352739);return rpc[_0x3fb550+'Message'][_0xdbe2('0x1e')](_0x2389b9)[_0xdbe2('0x1f')](function(_0x2bcd79){logger[_0xdbe2('0xc')](_0xdbe2('0xd'),_0x5b8eca,_0x2389b9[_0xdbe2('0x1c')]);if(_0x352739[_0xdbe2('0x29')][_0xdbe2('0x2f')][_0xdbe2('0x30')]){_0xdb8c53[_0xdbe2('0x31')]();}else{_0xdb8c53[_0xdbe2('0x25')]();}})[_0xdbe2('0x20')](function(_0x4b8d97){logger[_0xdbe2('0x21')](_0xdbe2('0xd'),_0x5b8eca,JSON[_0xdbe2('0x22')](_0x4b8d97));_0xdb8c53[_0xdbe2('0x31')]();});})[_0xdbe2('0x20')](function(_0x249d0a){logger['error'](_0xdbe2('0xd'),_0x5b8eca,_0x249d0a[_0xdbe2('0x28')]);_0xdb8c53[_0xdbe2('0x31')]();});}}catch(_0x5789c4){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x5b8eca,JSON[_0xdbe2('0x22')](_0x5789c4));_0xdb8c53['stop']();}};}; \ 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 ad55266..72bcf13 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 _0xa97c=['UserId','[%s][DIALOGFLOWV2]\x20%s','next','contact','format','out','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','getMustacheRender','error','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','push','message','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','body','catch','stringify','consequence','isNil','interaction'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xa97c,0xb6));var _0xca97=function(_0x34b6ef,_0x37ce5c){_0x34b6ef=_0x34b6ef-0x0;var _0x5d7f09=_0xa97c[_0x34b6ef];return _0x5d7f09;};'use strict';var _=require(_0xca97('0x0'));var dialogflow=require(_0xca97('0x1'));var md5=require('md5');var moment=require(_0xca97('0x2'));var Promise=require(_0xca97('0x3'));var logger=require(_0xca97('0x4'))(_0xca97('0x5'));var utils=require(_0xca97('0x6'));var rpc={'chatMessage':require(_0xca97('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xca97('0x8')),'smsMessage':require(_0xca97('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xca97('0xa'))};function createMessage(_0x1b6949,_0x2eec22,_0x258fae,_0x1caf1c){return new Promise(function(_0x19c454,_0x5c7922){var _0x556e87=_[_0xca97('0xb')](_0x258fae);_0x556e87['body']=_0x1caf1c;return rpc[_0x2eec22+_0xca97('0xc')][_0xca97('0xd')](_0x556e87)[_0xca97('0xe')](function(){logger[_0xca97('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x1b6949,_0x556e87[_0xca97('0x10')]);_0x19c454();})[_0xca97('0x11')](function(_0x2194c6){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x1b6949,JSON[_0xca97('0x12')](_0x2194c6));_0x5c7922(_0x2194c6);});});}exports[_0xca97('0x13')]=function(_0x2dd09,_0x29d8c6){return function(_0x206de1){try{if(!_[_0xca97('0x14')](this[_0xca97('0x15')][_0xca97('0x16')])){logger[_0xca97('0xf')](_0xca97('0x17'),_0x2dd09,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x206de1[_0xca97('0x18')]();}var _0x253a35={'ContactId':this[_0xca97('0x19')]['id'],'sentAt':moment()[_0xca97('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xca97('0x1b')};if(this[_0xca97('0x1c')]==='sms'||this[_0xca97('0x1c')]===_0xca97('0x1d')){_0x253a35[_0xca97('0x1e')]=this[_0xca97('0x15')][_0xca97('0x1e')];}var _0x3d09ed=this[_0xca97('0x1c')];if(_0x3d09ed===_0xca97('0x1f')){_0x253a35['ChatWebsiteId']=this[_0xca97('0x20')]['id'];}else{_0x253a35[_[_0xca97('0x21')](_0x3d09ed)+_0xca97('0x22')]=this[_0xca97('0x20')]['id'];}_0x253a35[_[_0xca97('0x21')](_0x3d09ed)+_0xca97('0x23')]=this[_0xca97('0x15')]['id'];if(this[_0xca97('0x15')]['created']){var _0x4952b7=_0x29d8c6[0x4];if(!_['isEmpty'](_0x4952b7)){_0x253a35[_0xca97('0x10')]=utils[_0xca97('0x24')](_0x4952b7,this);return rpc[_0x3d09ed+_0xca97('0xc')][_0xca97('0xd')](_0x253a35)[_0xca97('0xe')](function(_0x3f9ebe){logger[_0xca97('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x2dd09,_0x253a35[_0xca97('0x10')]);})[_0xca97('0x11')](function(_0x1ab8b8){logger[_0xca97('0x25')](_0xca97('0x17'),_0x2dd09,JSON['stringify'](_0x1ab8b8));})['finally'](function(){logger[_0xca97('0xf')](_0xca97('0x26'),_0x2dd09);_0x206de1[_0xca97('0x27')]();});}else{logger[_0xca97('0xf')](_0xca97('0x28'),_0x2dd09);_0x206de1['stop']();}}else{var _0x27bbe8=this;var _0x461af3=_0x29d8c6[0x2]['replace'](/\\n/g,'\x0a');var _0x1adcab={'credentials':{'private_key':_0x461af3,'client_email':_0x29d8c6[0x1]}};var _0x40b7eb=new dialogflow['SessionsClient'](_0x1adcab);var _0x202fc4=_0x40b7eb[_0xca97('0x29')](_0x29d8c6[0x0],md5(_0x27bbe8[_0xca97('0x15')]['id']));var _0x504582={'session':_0x202fc4,'queryInput':{'text':{'text':_0x27bbe8['message'][_0xca97('0x10')],'languageCode':_0x29d8c6[0x3]||'en'}}};return _0x40b7eb[_0xca97('0x2a')](_0x504582)['then'](function(_0x97374f){if(_0x97374f&&_0x97374f[_0xca97('0x2b')]){_0x27bbe8[_0xca97('0x10')][_0xca97('0x2c')]=_0x97374f;var _0xc9b268=_0x97374f[0x0];var _0x5e5b4b=_0xc9b268[_0xca97('0x2d')][_0xca97('0x2e')]&&_0xc9b268['queryResult'][_0xca97('0x2e')][_0xca97('0x2f')]?_0xc9b268[_0xca97('0x2d')]['diagnosticInfo'][_0xca97('0x2f')][_0xca97('0x30')][_0xca97('0x31')]:![];_0x27bbe8[_0xca97('0x10')]['DIALOGFLOWV2_ACTION']=_0xc9b268[_0xca97('0x2d')][_0xca97('0x32')];_0x27bbe8[_0xca97('0x10')][_0xca97('0x33')]=_0xc9b268[_0xca97('0x2d')]['allRequiredParamsPresent'];_0x27bbe8[_0xca97('0x10')][_0xca97('0x34')]=_0xc9b268[_0xca97('0x2d')][_0xca97('0x2e')]&&_0xc9b268[_0xca97('0x2d')][_0xca97('0x2e')]['fields']?_0xc9b268['queryResult'][_0xca97('0x2e')][_0xca97('0x2f')][_0xca97('0x30')][_0xca97('0x31')]:![];_0x27bbe8['body'][_0xca97('0x35')]=_0xc9b268[_0xca97('0x2d')][_0xca97('0x36')][_0xca97('0x37')];_0x27bbe8[_0xca97('0x10')][_0xca97('0x38')]=_0xc9b268['queryResult'][_0xca97('0x36')][_0xca97('0x39')];_0x27bbe8[_0xca97('0x10')][_0xca97('0x3a')]=_0xc9b268[_0xca97('0x2d')][_0xca97('0x36')][_0xca97('0x3b')];_0x27bbe8['body'][_0xca97('0x3c')]=_0xc9b268['queryResult']['languageCode'];_0x27bbe8[_0xca97('0x10')]['DIALOGFLOWV2_QUERYTEXT']=_0xc9b268[_0xca97('0x2d')][_0xca97('0x3d')];_0x27bbe8['body'][_0xca97('0x3e')]=_0xc9b268[_0xca97('0x2d')][_0xca97('0x3f')];_0x253a35[_0xca97('0x40')]='dialogflowV2';_0x253a35['providerResponse']=JSON['stringify'](_0x97374f);var _0x364882=[];for(var _0x5ac505=0x0;_0x5ac505<_0x97374f[_0xca97('0x2b')];_0x5ac505++){var _0x121fd5=_0x97374f[_0x5ac505];if(_0x121fd5&&_0x121fd5[_0xca97('0x2d')]&&_0x121fd5[_0xca97('0x2d')][_0xca97('0x41')]){_0x364882[_0xca97('0x42')](createMessage(_0x2dd09,_0x3d09ed,_0x253a35,_0x121fd5[_0xca97('0x2d')][_0xca97('0x41')]));}}return Promise['all'](_0x364882)['then'](function(){if(_0x5e5b4b){_0x206de1[_0xca97('0x18')]();}else{_0x206de1[_0xca97('0x27')]();}})[_0xca97('0x11')](function(_0x557df9){logger[_0xca97('0x25')](_0xca97('0x17'),_0x2dd09,JSON[_0xca97('0x12')](_0x557df9));_0x206de1['next']();});}})[_0xca97('0x11')](function(_0x321ef8){logger[_0xca97('0x25')](_0xca97('0x17'),_0x2dd09,_0x321ef8[_0xca97('0x43')]);_0x206de1['next']();});}}catch(_0x4ff307){logger['error'](_0xca97('0x17'),_0x2dd09,JSON[_0xca97('0x12')](_0x4ff307));_0x206de1[_0xca97('0x27')]();}};}; \ No newline at end of file +var _0x22e9=['boolValue','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerResponse','fulfillmentText','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation'];(function(_0x5c9dd8,_0x55ff4){var _0xec2b2c=function(_0x5109fb){while(--_0x5109fb){_0x5c9dd8['push'](_0x5c9dd8['shift']());}};_0xec2b2c(++_0x55ff4);}(_0x22e9,0x1c1));var _0x922e=function(_0x196dc5,_0x50be9d){_0x196dc5=_0x196dc5-0x0;var _0x56458e=_0x22e9[_0x196dc5];return _0x56458e;};'use strict';var _=require(_0x922e('0x0'));var dialogflow=require(_0x922e('0x1'));var md5=require(_0x922e('0x2'));var moment=require(_0x922e('0x3'));var Promise=require(_0x922e('0x4'));var logger=require(_0x922e('0x5'))(_0x922e('0x6'));var utils=require(_0x922e('0x7'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x922e('0x8')),'mailMessage':require(_0x922e('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x922e('0xa')),'whatsappMessage':require(_0x922e('0xb'))};function createMessage(_0x5a685e,_0x13069e,_0xdbfe20,_0x5c17c1){return new Promise(function(_0x310ef4,_0x442adc){var _0x4b9689=_[_0x922e('0xc')](_0xdbfe20);_0x4b9689[_0x922e('0xd')]=_0x5c17c1;return rpc[_0x13069e+_0x922e('0xe')][_0x922e('0xf')](_0x4b9689)[_0x922e('0x10')](function(){logger[_0x922e('0x11')](_0x922e('0x12'),_0x5a685e,_0x4b9689[_0x922e('0xd')]);_0x310ef4();})[_0x922e('0x13')](function(_0x5f5c3f){logger[_0x922e('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0x5a685e,JSON[_0x922e('0x15')](_0x5f5c3f));_0x442adc(_0x5f5c3f);});});}exports[_0x922e('0x16')]=function(_0x306d8f,_0x37c1e6){return function(_0x231d46){try{if(!_['isNil'](this[_0x922e('0x17')][_0x922e('0x18')])){logger[_0x922e('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x306d8f,_0x922e('0x19'));return _0x231d46[_0x922e('0x1a')]();}var _0x808a43={'ContactId':this[_0x922e('0x1b')]['id'],'sentAt':moment()[_0x922e('0x1c')](_0x922e('0x1d')),'direction':_0x922e('0x1e')};if(this[_0x922e('0x1f')]===_0x922e('0x20')||this[_0x922e('0x1f')]==='whatsapp'){_0x808a43[_0x922e('0x21')]=this[_0x922e('0x17')][_0x922e('0x21')];}var _0x80fe38=this[_0x922e('0x1f')];if(_0x80fe38===_0x922e('0x22')){_0x808a43[_0x922e('0x23')]=this['account']['id'];}else{_0x808a43[_['upperFirst'](_0x80fe38)+'AccountId']=this[_0x922e('0x24')]['id'];}_0x808a43[_[_0x922e('0x25')](_0x80fe38)+_0x922e('0x26')]=this[_0x922e('0x17')]['id'];if(this[_0x922e('0x17')][_0x922e('0x27')]){var _0x305fd3=_0x37c1e6[0x4];if(!_[_0x922e('0x28')](_0x305fd3)){_0x808a43[_0x922e('0xd')]=utils['getMustacheRender'](_0x305fd3,this);return rpc[_0x80fe38+'Message'][_0x922e('0xf')](_0x808a43)[_0x922e('0x10')](function(_0x434d5c){logger[_0x922e('0x11')](_0x922e('0x12'),_0x306d8f,_0x808a43[_0x922e('0xd')]);})[_0x922e('0x13')](function(_0x4e86ce){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x306d8f,JSON[_0x922e('0x15')](_0x4e86ce));})[_0x922e('0x29')](function(){logger[_0x922e('0x11')](_0x922e('0x2a'),_0x306d8f);_0x231d46[_0x922e('0x2b')]();});}else{logger[_0x922e('0x11')](_0x922e('0x2c'),_0x306d8f);_0x231d46[_0x922e('0x2b')]();}}else{var _0x29cd00=this;var _0x2f1b6d=_0x37c1e6[0x2]['replace'](/\\n/g,'\x0a');var _0xf282c1={'credentials':{'private_key':_0x2f1b6d,'client_email':_0x37c1e6[0x1]}};var _0x541230=new dialogflow[(_0x922e('0x2d'))](_0xf282c1);var _0xc2c340=_0x541230[_0x922e('0x2e')](_0x37c1e6[0x0],md5(_0x29cd00['interaction']['id']));var _0x3593c0={'session':_0xc2c340,'queryInput':{'text':{'text':_0x29cd00[_0x922e('0x2f')][_0x922e('0xd')],'languageCode':_0x37c1e6[0x3]||'en'}}};return _0x541230[_0x922e('0x30')](_0x3593c0)['then'](function(_0x14ed37){if(_0x14ed37&&_0x14ed37[_0x922e('0x31')]){_0x29cd00['body'][_0x922e('0x32')]=_0x14ed37;var _0x1a4c08=_0x14ed37[0x0];var _0x1e3b8d=_0x1a4c08['queryResult']['diagnosticInfo']&&_0x1a4c08['queryResult'][_0x922e('0x33')]['fields']?_0x1a4c08[_0x922e('0x34')][_0x922e('0x33')][_0x922e('0x35')][_0x922e('0x36')][_0x922e('0x37')]:![];_0x29cd00[_0x922e('0xd')][_0x922e('0x38')]=_0x1a4c08[_0x922e('0x34')]['action'];_0x29cd00[_0x922e('0xd')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x1a4c08[_0x922e('0x34')][_0x922e('0x39')];_0x29cd00[_0x922e('0xd')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x1a4c08[_0x922e('0x34')][_0x922e('0x33')]&&_0x1a4c08[_0x922e('0x34')][_0x922e('0x33')]['fields']?_0x1a4c08[_0x922e('0x34')][_0x922e('0x33')][_0x922e('0x35')][_0x922e('0x36')][_0x922e('0x37')]:![];_0x29cd00[_0x922e('0xd')][_0x922e('0x3a')]=_0x1a4c08['queryResult'][_0x922e('0x3b')][_0x922e('0x3c')];_0x29cd00[_0x922e('0xd')][_0x922e('0x3d')]=_0x1a4c08[_0x922e('0x34')][_0x922e('0x3b')]['displayName'];_0x29cd00[_0x922e('0xd')][_0x922e('0x3e')]=_0x1a4c08['queryResult'][_0x922e('0x3b')][_0x922e('0x3f')];_0x29cd00['body'][_0x922e('0x40')]=_0x1a4c08['queryResult'][_0x922e('0x41')];_0x29cd00[_0x922e('0xd')][_0x922e('0x42')]=_0x1a4c08[_0x922e('0x34')][_0x922e('0x43')];_0x29cd00[_0x922e('0xd')][_0x922e('0x44')]=_0x1a4c08[_0x922e('0x34')]['intentDetectionConfidence'];_0x808a43['providerName']=_0x922e('0x32');_0x808a43[_0x922e('0x45')]=JSON[_0x922e('0x15')](_0x14ed37);var _0x5899e7=[];for(var _0x50ac4d=0x0;_0x50ac4d<_0x14ed37[_0x922e('0x31')];_0x50ac4d++){var _0x5acaf0=_0x14ed37[_0x50ac4d];if(_0x5acaf0&&_0x5acaf0[_0x922e('0x34')]&&_0x5acaf0[_0x922e('0x34')][_0x922e('0x46')]){_0x5899e7['push'](createMessage(_0x306d8f,_0x80fe38,_0x808a43,_0x5acaf0[_0x922e('0x34')][_0x922e('0x46')]));}}return Promise[_0x922e('0x47')](_0x5899e7)[_0x922e('0x10')](function(){if(_0x1e3b8d){_0x231d46['next']();}else{_0x231d46['stop']();}})[_0x922e('0x13')](function(_0x4c73c0){logger['error'](_0x922e('0x12'),_0x306d8f,JSON[_0x922e('0x15')](_0x4c73c0));_0x231d46[_0x922e('0x1a')]();});}})[_0x922e('0x13')](function(_0x533100){logger[_0x922e('0x14')](_0x922e('0x12'),_0x306d8f,_0x533100[_0x922e('0x2f')]);_0x231d46[_0x922e('0x1a')]();});}}catch(_0x10548c){logger[_0x922e('0x14')](_0x922e('0x12'),_0x306d8f,JSON[_0x922e('0x15')](_0x10548c));_0x231d46['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 b47ed43..462a51b 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 _0xcf55=['rules','next','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf55,0x162));var _0x5cf5=function(_0x290820,_0x3924a0){_0x290820=_0x290820-0x0;var _0x45f9db=_0xcf55[_0x290820];return _0x45f9db;};'use strict';var schema=require(_0x5cf5('0x0'));var _=require(_0x5cf5('0x1'));var htmlToText=require(_0x5cf5('0x2'));var utils=require(_0x5cf5('0x3'));var logger=require(_0x5cf5('0x4'))(_0x5cf5('0x5'));var gotoif=schema({'condition':{'type':_0x5cf5('0x6'),'required':!![],'message':_0x5cf5('0x7')},'priorityTrue':{'type':_0x5cf5('0x8'),'message':_0x5cf5('0x9')},'priorityFalse':{'type':_0x5cf5('0x8'),'message':_0x5cf5('0xa')}});exports['consequence']=function(_0x63e5c,_0x1d319a){return function(_0x3d9f29){try{var _0x103a4e={'condition':htmlToText[_0x5cf5('0xb')](utils[_0x5cf5('0xc')](_0x1d319a[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1d319a[0x1],'priorityFalse':_0x1d319a[0x2]};var _0x18b75b=gotoif[_0x5cf5('0x0')](_0x103a4e,{'typecast':!![]});if(_0x18b75b['length']){logger[_0x5cf5('0xd')](_0x5cf5('0xe'),_0x63e5c,_[_0x5cf5('0xf')](_0x18b75b,_0x5cf5('0x10'))['join'](',\x20'));_0x3d9f29[_0x5cf5('0x11')]();}else{try{var _0x3f3a75=eval('('+_0x103a4e[_0x5cf5('0x12')]+')');var _0x2d7661=_0x3f3a75?_0x103a4e[_0x5cf5('0x13')]:_0x103a4e[_0x5cf5('0x14')];logger['info'](_0x5cf5('0x15'),_0x63e5c,_0x103a4e[_0x5cf5('0x12')],_0x3f3a75,_0x2d7661||'next');if(_0x2d7661){var _0x16aacd=_[_0x5cf5('0x16')](_0x3d9f29[_0x5cf5('0x17')](),{'p':_0x2d7661});if(_0x16aacd>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x63e5c,_0x2d7661||_0x5cf5('0x18'),_0x16aacd);_0x3d9f29[_0x5cf5('0x18')](_0x16aacd);}else{logger[_0x5cf5('0x19')](_0x5cf5('0x1a'),_0x63e5c,_0x2d7661||'next');_0x3d9f29['stop']();}}else{_0x3d9f29[_0x5cf5('0x18')]();}}catch(_0x30a4c6){logger[_0x5cf5('0xd')](_0x5cf5('0x1b'),_0x63e5c,_0x30a4c6[_0x5cf5('0x10')]);_0x3d9f29[_0x5cf5('0x11')]();}}}catch(_0x2cd369){logger[_0x5cf5('0xd')](_0x5cf5('0xe'),_0x63e5c,JSON[_0x5cf5('0x1c')](_0x2cd369));_0x3d9f29[_0x5cf5('0x11')]();}};}; \ No newline at end of file +var _0x15c9=['error','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','fromString','getMustacheRender','replace','validate','length','map','message','join','stop','condition','priorityTrue','info','next','findIndex','rules'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x15c9,0xb2));var _0x915c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x15c9[_0x2641f9];return _0x585741;};'use strict';var schema=require('validate');var _=require(_0x915c('0x0'));var htmlToText=require(_0x915c('0x1'));var utils=require(_0x915c('0x2'));var logger=require(_0x915c('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x915c('0x4'),'required':!![],'message':_0x915c('0x5')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x915c('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x5d20e2,_0x444112){return function(_0x2d958b){try{var _0x4aacd6={'condition':htmlToText[_0x915c('0x7')](utils[_0x915c('0x8')](_0x444112[0x0],this),{'wordwrap':![]})[_0x915c('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x444112[0x1],'priorityFalse':_0x444112[0x2]};var _0x5e95ba=gotoif[_0x915c('0xa')](_0x4aacd6,{'typecast':!![]});if(_0x5e95ba[_0x915c('0xb')]){logger['error']('[%s][GOTOIF]\x20%s',_0x5d20e2,_[_0x915c('0xc')](_0x5e95ba,_0x915c('0xd'))[_0x915c('0xe')](',\x20'));_0x2d958b[_0x915c('0xf')]();}else{try{var _0x467492=eval('('+_0x4aacd6[_0x915c('0x10')]+')');var _0x5077a4=_0x467492?_0x4aacd6[_0x915c('0x11')]:_0x4aacd6['priorityFalse'];logger[_0x915c('0x12')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x5d20e2,_0x4aacd6[_0x915c('0x10')],_0x467492,_0x5077a4||_0x915c('0x13'));if(_0x5077a4){var _0x1a4ff9=_[_0x915c('0x14')](_0x2d958b[_0x915c('0x15')](),{'p':_0x5077a4});if(_0x1a4ff9>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x5d20e2,_0x5077a4||'next',_0x1a4ff9);_0x2d958b[_0x915c('0x13')](_0x1a4ff9);}else{logger[_0x915c('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x5d20e2,_0x5077a4||_0x915c('0x13'));_0x2d958b[_0x915c('0xf')]();}}else{_0x2d958b[_0x915c('0x13')]();}}catch(_0x18f2f7){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5d20e2,_0x18f2f7['message']);_0x2d958b[_0x915c('0xf')]();}}}catch(_0x312c24){logger[_0x915c('0x16')](_0x915c('0x17'),_0x5d20e2,JSON[_0x915c('0x18')](_0x312c24));_0x2d958b[_0x915c('0xf')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 3e2a18a..38159e9 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 _0x286e=['validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x35e83a,_0x2c6e73){var _0x511947=function(_0x2c4c3e){while(--_0x2c4c3e){_0x35e83a['push'](_0x35e83a['shift']());}};_0x511947(++_0x2c6e73);}(_0x286e,0x98));var _0xe286=function(_0x2e2ed9,_0x589e79){_0x2e2ed9=_0x2e2ed9-0x0;var _0xb19a8c=_0x286e[_0x2e2ed9];return _0xb19a8c;};'use strict';var schema=require(_0xe286('0x0'));var _=require(_0xe286('0x1'));var logger=require(_0xe286('0x2'))(_0xe286('0x3'));var gotop=schema({'priority':{'type':_0xe286('0x4'),'required':!![],'message':_0xe286('0x5')}});exports[_0xe286('0x6')]=function(_0x2e9ae4,_0x2faf19){return function(_0x3f4000){try{var _0x5b9557={'priority':_0x2faf19[0x0]};var _0x128c9d=gotop['validate'](_0x5b9557,{'typecast':!![]});if(_0x128c9d[_0xe286('0x7')]){logger[_0xe286('0x8')]('[%s][GOTOP]\x20%s',_0x2e9ae4,_[_0xe286('0x9')](_0x128c9d,_0xe286('0xa'))['join'](',\x20'));_0x3f4000[_0xe286('0xb')]();}else{logger[_0xe286('0xc')](_0xe286('0xd'),_0x2e9ae4,_0x5b9557[_0xe286('0xe')]);if(_0x5b9557[_0xe286('0xe')]){var _0x1e97e7=_[_0xe286('0xf')](_0x3f4000[_0xe286('0x10')](),{'p':_0x5b9557[_0xe286('0xe')]});if(_0x1e97e7>=0x0){logger[_0xe286('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2e9ae4,_0x5b9557['priority']||_0xe286('0x11'),_0x1e97e7);_0x3f4000[_0xe286('0x11')](_0x1e97e7);}else{logger[_0xe286('0xc')](_0xe286('0x12'),_0x2e9ae4,_0x5b9557[_0xe286('0xe')]||_0xe286('0x11'));_0x3f4000['stop']();}}else{_0x3f4000[_0xe286('0x11')]();}}}catch(_0x5000bd){logger[_0xe286('0x8')]('[%s][GOTOP]\x20%s',_0x2e9ae4,JSON['stringify'](_0x5000bd));_0x3f4000['stop']();}};}; \ No newline at end of file +var _0x3dff=['stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','join'];(function(_0x2b8725,_0x36a671){var _0x24b348=function(_0x53e91f){while(--_0x53e91f){_0x2b8725['push'](_0x2b8725['shift']());}};_0x24b348(++_0x36a671);}(_0x3dff,0x128));var _0xf3df=function(_0x4951c1,_0x4a67d0){_0x4951c1=_0x4951c1-0x0;var _0x1b0eb9=_0x3dff[_0x4951c1];return _0x1b0eb9;};'use strict';var schema=require('validate');var _=require(_0xf3df('0x0'));var logger=require('../../../../config/logger')(_0xf3df('0x1'));var gotop=schema({'priority':{'type':_0xf3df('0x2'),'required':!![],'message':_0xf3df('0x3')}});exports[_0xf3df('0x4')]=function(_0x3e29e1,_0x315956){return function(_0x3c605c){try{var _0x17d0bf={'priority':_0x315956[0x0]};var _0x34042f=gotop[_0xf3df('0x5')](_0x17d0bf,{'typecast':!![]});if(_0x34042f[_0xf3df('0x6')]){logger[_0xf3df('0x7')](_0xf3df('0x8'),_0x3e29e1,_['map'](_0x34042f,'message')[_0xf3df('0x9')](',\x20'));_0x3c605c[_0xf3df('0xa')]();}else{logger[_0xf3df('0xb')](_0xf3df('0xc'),_0x3e29e1,_0x17d0bf[_0xf3df('0xd')]);if(_0x17d0bf[_0xf3df('0xd')]){var _0xe39158=_['findIndex'](_0x3c605c[_0xf3df('0xe')](),{'p':_0x17d0bf[_0xf3df('0xd')]});if(_0xe39158>=0x0){logger[_0xf3df('0xb')](_0xf3df('0xf'),_0x3e29e1,_0x17d0bf[_0xf3df('0xd')]||_0xf3df('0x10'),_0xe39158);_0x3c605c['next'](_0xe39158);}else{logger[_0xf3df('0xb')](_0xf3df('0x11'),_0x3e29e1,_0x17d0bf[_0xf3df('0xd')]||_0xf3df('0x10'));_0x3c605c[_0xf3df('0xa')]();}}else{_0x3c605c[_0xf3df('0x10')]();}}}catch(_0x50e972){logger['error'](_0xf3df('0x8'),_0x3e29e1,JSON['stringify'](_0x50e972));_0x3c605c[_0xf3df('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index b687e1f..b2ae368 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 _0xd495=['consequence','getMustacheRender','chat','ChatWebsiteId','account','upperFirst','channel','Message','create','then','[%s][MESSAGE]\x20%s','body','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage'];(function(_0x1df477,_0x587224){var _0x47ca3b=function(_0x1db8c5){while(--_0x1db8c5){_0x1df477['push'](_0x1df477['shift']());}};_0x47ca3b(++_0x587224);}(_0xd495,0x9f));var _0x5d49=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0xd495[_0x79cd47];return _0x3b9484;};'use strict';var _=require(_0x5d49('0x0'));var utils=require(_0x5d49('0x1'));var logger=require('../../../../config/logger')(_0x5d49('0x2'));var rpc={'chatMessage':require(_0x5d49('0x3')),'openchannelMessage':require(_0x5d49('0x4')),'mailMessage':require(_0x5d49('0x5')),'smsMessage':require(_0x5d49('0x6')),'faxMessage':require(_0x5d49('0x7')),'whatsappMessage':require(_0x5d49('0x8'))};exports[_0x5d49('0x9')]=function(_0x1f774c,_0x4ddff7){return function(_0x3544d3){try{var _0x4008fd={'body':utils[_0x5d49('0xa')](_0x4ddff7[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0x5d49('0xb')){_0x4008fd[_0x5d49('0xc')]=this[_0x5d49('0xd')]['id'];}else{_0x4008fd[_[_0x5d49('0xe')](this[_0x5d49('0xf')])+'AccountId']=this[_0x5d49('0xd')]['id'];}_0x4008fd[_['upperFirst'](this[_0x5d49('0xf')])+'InteractionId']=this['interaction']['id'];if(rpc[this['channel']+_0x5d49('0x10')]){return rpc[this[_0x5d49('0xf')]+_0x5d49('0x10')][_0x5d49('0x11')](_0x4008fd)[_0x5d49('0x12')](function(_0x173054){logger['info'](_0x5d49('0x13'),_0x1f774c,_0x4008fd[_0x5d49('0x14')]);_0x3544d3['next']();})['catch'](function(_0x182e9f){logger[_0x5d49('0x15')](_0x5d49('0x13'),_0x1f774c,JSON[_0x5d49('0x16')](_0x182e9f));_0x3544d3[_0x5d49('0x17')]();});}}catch(_0x56489e){logger[_0x5d49('0x15')](_0x5d49('0x13'),_0x1f774c,JSON[_0x5d49('0x16')](_0x56489e));_0x3544d3[_0x5d49('0x17')]();}};}; \ No newline at end of file +var _0xfa66=['ChatWebsiteId','account','upperFirst','channel','AccountId','InteractionId','interaction','Message','create','then','info','body','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0xfa66,0x1a9));var _0x6fa6=function(_0x3f9e11,_0x11c7f4){_0x3f9e11=_0x3f9e11-0x0;var _0x2c75f5=_0xfa66[_0x3f9e11];return _0x2c75f5;};'use strict';var _=require(_0x6fa6('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x6fa6('0x1')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6fa6('0x2')),'faxMessage':require(_0x6fa6('0x3')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x6fa6('0x4')]=function(_0x2453cc,_0x102d3a){return function(_0x56e55b){try{var _0x5e9929={'body':utils[_0x6fa6('0x5')](_0x102d3a[0x0],this),'ContactId':this[_0x6fa6('0x6')]['id']};if(this['channel']==='chat'){_0x5e9929[_0x6fa6('0x7')]=this[_0x6fa6('0x8')]['id'];}else{_0x5e9929[_[_0x6fa6('0x9')](this[_0x6fa6('0xa')])+_0x6fa6('0xb')]=this[_0x6fa6('0x8')]['id'];}_0x5e9929[_['upperFirst'](this[_0x6fa6('0xa')])+_0x6fa6('0xc')]=this[_0x6fa6('0xd')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x6fa6('0xa')]+_0x6fa6('0xe')][_0x6fa6('0xf')](_0x5e9929)[_0x6fa6('0x10')](function(_0x1033d9){logger[_0x6fa6('0x11')]('[%s][MESSAGE]\x20%s',_0x2453cc,_0x5e9929[_0x6fa6('0x12')]);_0x56e55b['next']();})[_0x6fa6('0x13')](function(_0x2ccc67){logger[_0x6fa6('0x14')]('[%s][MESSAGE]\x20%s',_0x2453cc,JSON['stringify'](_0x2ccc67));_0x56e55b['stop']();});}}catch(_0x123f6d){logger[_0x6fa6('0x14')](_0x6fa6('0x15'),_0x2453cc,JSON[_0x6fa6('0x16')](_0x123f6d));_0x56e55b[_0x6fa6('0x17')]();}};}; \ 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 c390103..7ec0e86 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 _0xece4=['./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stop'];(function(_0x1e0ba1,_0x24391e){var _0x107791=function(_0x51a672){while(--_0x51a672){_0x1e0ba1['push'](_0x1e0ba1['shift']());}};_0x107791(++_0x24391e);}(_0xece4,0xaa));var _0x4ece=function(_0x2113d0,_0x3c3e2d){_0x2113d0=_0x2113d0-0x0;var _0x265793=_0xece4[_0x2113d0];return _0x265793;};'use strict';var utils=require(_0x4ece('0x0'));var logger=require(_0x4ece('0x1'))(_0x4ece('0x2'));exports[_0x4ece('0x3')]=function(_0x294bfd,_0x206430){return function(_0x5acb5c){try{logger[_0x4ece('0x4')](_0x4ece('0x5'),_0x294bfd,utils[_0x4ece('0x6')](_0x206430[0x0],this));_0x5acb5c[_0x4ece('0x7')]();}catch(_0x47d8a7){logger[_0x4ece('0x8')](_0x4ece('0x5'),_0x294bfd,JSON['stringify'](_0x47d8a7));_0x5acb5c[_0x4ece('0x9')]();}};}; \ No newline at end of file +var _0xca13=['info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop','./utils','routing','consequence'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xca13,0x1ad));var _0x3ca1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xca13[_0x321bb2];return _0x9c12ed;};'use strict';var utils=require(_0x3ca1('0x0'));var logger=require('../../../../config/logger')(_0x3ca1('0x1'));exports[_0x3ca1('0x2')]=function(_0x36d2e1,_0x1f8f73){return function(_0x30741c){try{logger[_0x3ca1('0x3')](_0x3ca1('0x4'),_0x36d2e1,utils[_0x3ca1('0x5')](_0x1f8f73[0x0],this));_0x30741c[_0x3ca1('0x6')]();}catch(_0x583702){logger['error'](_0x3ca1('0x4'),_0x36d2e1,JSON[_0x3ca1('0x7')](_0x583702));_0x30741c[_0x3ca1('0x8')]();}};}; \ 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 b3fc972..451e6d1 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 _0x55ca=['../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','interaction','channel','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','map','join','find','Queues','createQueue','atimeout','rules','end','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove'];(function(_0x139dbf,_0x552754){var _0x21ef84=function(_0xf1b7dc){while(--_0xf1b7dc){_0x139dbf['push'](_0x139dbf['shift']());}};_0x21ef84(++_0x552754);}(_0x55ca,0x126));var _0xa55c=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0x55ca[_0x53a7a8];return _0x555f71;};'use strict';var schema=require(_0xa55c('0x0'));var _=require(_0xa55c('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));var strategy=require(_0xa55c('0x5'));config[_0xa55c('0x6')]=_[_0xa55c('0x7')](config[_0xa55c('0x6')],{'host':_0xa55c('0x8'),'port':0x18eb});var io=require(_0xa55c('0x9'))(new Redis(config['redis']));var attributes=['id',_0xa55c('0xa'),_0xa55c('0xb'),'queue',_0xa55c('0xc'),_0xa55c('0xd')];function emit(_0x52a3bc,_0x5849ad,_0x473d0e){io['to'](_0x52a3bc)[_0xa55c('0xe')](_0x5849ad,_0x473d0e);}function emitChannelQueueInteraction(_0x381d07,_0x5d8e5a,_0x31646d,_0xe6d826,_0x508342,_0x70c2de,_0x3998f7,_0x15eec8){var _0x5d47ff=_['clone'](_0x31646d);_0x5d47ff[_0xa55c('0xa')]=_0x15eec8;_0x5d47ff['queue']=_0x5d8e5a;_0x5d47ff['account']=_0xe6d826;_0x5d47ff['id']=_0x508342;if(_0x70c2de){_0x3998f7[util['format'](_0xa55c('0xf'),_0x381d07)][_0x508342]=_[_0xa55c('0x10')](_0x5d47ff,attributes);}else{delete _0x3998f7[util[_0xa55c('0x11')](_0xa55c('0xf'),_0x381d07)][_0x508342];}emit(util[_0xa55c('0x11')](_0xa55c('0x12'),_0x381d07,_0x5d8e5a),util['format'](_0xa55c('0x13'),_0x381d07,_0x70c2de?_0xa55c('0x14'):_0xa55c('0x15')),_[_0xa55c('0x10')](_0x5d47ff,attributes));}var rpc={'openchannelQueueReport':require(_0xa55c('0x16')),'mailQueueReport':require(_0xa55c('0x17')),'chatQueueReport':require(_0xa55c('0x18')),'smsQueueReport':require(_0xa55c('0x19')),'faxQueueReport':require(_0xa55c('0x1a')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xa55c('0x1b'),'required':!![],'message':_0xa55c('0x1c')},'timeout':{'type':_0xa55c('0x1d'),'message':_0xa55c('0x1e')}});function startRouting(_0x23a1ae,_0x5426e5,_0x4c0daf,_0x5f5158){if(_0x23a1ae&&_0x5426e5&&_0x4c0daf){_0x5426e5[_0xa55c('0x1f')]+=0x1;var _0x3776ac={'uniqueid':_0x23a1ae,'from':_0x4c0daf[_0xa55c('0x20')]?_0x4c0daf['body'][_0xa55c('0xc')]:'','joinAt':moment()[_0xa55c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c0daf[_0xa55c('0x21')]?_0x4c0daf[_0xa55c('0x21')]['id']:null,'ListId':_0x4c0daf[_0xa55c('0x22')]?_0x4c0daf[_0xa55c('0x22')]['id']:null};_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf['channel'])+_0xa55c('0x24')]=_0x5426e5['id']||null;_0x3776ac[_['upperFirst'](_0x4c0daf['channel'])+'InteractionId']=_0x4c0daf[_0xa55c('0x25')]?_0x4c0daf['interaction']['id']:null;_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf[_0xa55c('0x26')])+_0xa55c('0x27')]=_0x4c0daf[_0xa55c('0x28')]?_0x4c0daf[_0xa55c('0x28')]['id']:null;_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf[_0xa55c('0x26')])+(_0x4c0daf[_0xa55c('0x26')]!==_0xa55c('0x29')?_0xa55c('0x2a'):_0xa55c('0x2b'))]=_0x4c0daf['account']?_0x4c0daf[_0xa55c('0xb')]['id']:null;logger[_0xa55c('0x2c')](util[_0xa55c('0x11')](_0xa55c('0x2d'),_0x23a1ae,_0x5426e5['name']));emitChannelQueueInteraction(_0x4c0daf[_0xa55c('0x26')],_0x5426e5[_0xa55c('0x2e')],_0x3776ac,_0x4c0daf[_0xa55c('0xb')][_0xa55c('0x2e')],_0x4c0daf[_0xa55c('0x28')]['id'],!![],_0x5f5158,_0x5426e5['id']);if(rpc[_0x4c0daf[_0xa55c('0x26')]+'QueueReport']){return rpc[_0x4c0daf[_0xa55c('0x26')]+'QueueReport'][_0xa55c('0x2f')](_0x3776ac)[_0xa55c('0x30')](function(_0x1cc53e){logger[_0xa55c('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x3d28fb,_0x2096ae,_0x331e58,_0x20da31){if(_0x3d28fb&&_0x2096ae){_0x2096ae[_0xa55c('0x1f')]-=0x1;var _0x1225c3={'leaveAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'acceptAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'reason':_0xa55c('0x33')};logger['info'](util['format'](_0xa55c('0x34'),_0x3d28fb,_0x2096ae[_0xa55c('0x2e')]));emitChannelQueueInteraction(_0x331e58['channel'],_0x2096ae[_0xa55c('0x2e')],_0x331e58[_0xa55c('0x20')],_0x331e58[_0xa55c('0xb')][_0xa55c('0x2e')],_0x331e58[_0xa55c('0x28')]['id'],![],_0x20da31,_0x2096ae['id']);if(rpc[_0x331e58[_0xa55c('0x26')]+_0xa55c('0x35')]){return rpc[_0x331e58[_0xa55c('0x26')]+_0xa55c('0x35')]['update'](_0x3d28fb,_0x1225c3)['catch'](function(_0x4b23d3){logger[_0xa55c('0x31')](_0xa55c('0x36'));});}}}function endRouting(_0x2bb4f0,_0x5802e4,_0x768408,_0x547930){if(_0x2bb4f0&&_0x5802e4){_0x5802e4[_0xa55c('0x1f')]-=0x1;var _0x4ad813={'leaveAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'exitAt':moment()[_0xa55c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa55c('0x37')};logger[_0xa55c('0x2c')](util['format'](_0xa55c('0x38'),_0x2bb4f0,_0x5802e4[_0xa55c('0x2e')]));emitChannelQueueInteraction(_0x768408['channel'],_0x5802e4['name'],_0x768408[_0xa55c('0x20')],_0x768408['account'][_0xa55c('0x2e')],_0x768408[_0xa55c('0x28')]['id'],![],_0x547930);if(rpc[_0x768408['channel']+'QueueReport']){return rpc[_0x768408['channel']+'QueueReport'][_0xa55c('0x39')](_0x2bb4f0,_0x4ad813)[_0xa55c('0x30')](function(_0x429336){logger[_0xa55c('0x31')](_0xa55c('0x36'));});}}}function handleFindQueue(_0x56d17c){return function(_0x3d52d8){return _0x3d52d8[_0xa55c('0x2e')][_0xa55c('0x3a')]()===_0x56d17c[_0xa55c('0x3a')]();};}exports[_0xa55c('0x3b')]=function(_0x23cef5,_0x554620,_0x386e34,_0x5ee63d){return function(_0x57a972){try{var _0x404e7f={'name':_0x554620[0x0],'timeout':_0x554620[0x1]};var _0x1f63d8=queue['validate'](_0x404e7f,{'typecast':!![]});if(_0x1f63d8[_0xa55c('0x3c')]){logger['error']('[%s][QUEUE]\x20%s',_0x23cef5,_[_0xa55c('0x3d')](_0x1f63d8,_0xa55c('0x28'))[_0xa55c('0x3e')](',\x20'));_0x57a972['stop']();}else{var _0x1b2708=_[_0xa55c('0x3f')](_0x386e34[_0x5ee63d['channel']+_0xa55c('0x40')],handleFindQueue(_0x404e7f['name']));if(_0x1b2708){startRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);var _0x39886a=(_0x1b2708[_0xa55c('0x37')]||0xa)*0x3e8;var _0x5be43f=(_0x404e7f[_0xa55c('0x37')]||0x14)*0x3e8;var _0x1dae70,_0x5d834d;if(_0x39886a>_0x5be43f){_0x5be43f=_0x39886a;}var _0x40c352=seqqueue[_0xa55c('0x41')](_0x39886a);_0x40c352['id']=_0x23cef5;_0x40c352[_0xa55c('0x42')]=_0x39886a;_0x40c352['qtimeout']=_0x5be43f;_0x40c352[_0xa55c('0x26')]=_0x5ee63d['channel'];_0x386e34[_0xa55c('0x43')][_0x23cef5]['on'](_0xa55c('0x44'),function(){logger[_0xa55c('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x23cef5);stopRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);clearTimeout(_0x1dae70);_0x1dae70=undefined;_0x40c352[_0xa55c('0x45')](!![]);if(_0x386e34[_0xa55c('0x43')][_0x23cef5]){delete _0x386e34['rules'][_0x23cef5];}_0x57a972[_0xa55c('0x46')]();});_0x386e34[_0xa55c('0x43')][_0x23cef5]['on']('complete',function(){if(_0x386e34[_0xa55c('0x43')][_0x23cef5]){delete _0x386e34[_0xa55c('0x43')][_0x23cef5];}});_0x1dae70=setTimeout(function(){logger['info'](_0xa55c('0x47'),_0x23cef5);endRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);clearTimeout(_0x1dae70);_0x40c352[_0xa55c('0x45')](!![]);_0x57a972[_0xa55c('0x48')]();},_0x5be43f);switch(_0x1b2708[_0xa55c('0x49')]){case'rrmemory':strategy[_0xa55c('0x4a')](_0x40c352,_0x1b2708,_0x386e34,_0x5ee63d);break;default:strategy['beepall'](_0x40c352,_0x1b2708,_0x386e34,_0x5ee63d);}}else{logger[_0xa55c('0x31')](_0xa55c('0x4b'),_0x23cef5,_0x404e7f[_0xa55c('0x2e')]);_0x57a972['stop']();}}}catch(_0x39bd3d){console[_0xa55c('0x4c')](_0x39bd3d);logger['error'](_0xa55c('0x4d'),_0x23cef5,_0x39bd3d[_0xa55c('0x4e')]);_0x57a972[_0xa55c('0x46')]();}};}; \ No newline at end of file +var _0x9957=['seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','account','queue','joinAt','emit','clone','queue_id','pick','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','WebsiteId','info','name','QueueReport','create','catch','error','waiting','accepted','body','[%s][END:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','timeout','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','lodash','util'];(function(_0x403890,_0x584019){var _0x980b30=function(_0x23a7af){while(--_0x23a7af){_0x403890['push'](_0x403890['shift']());}};_0x980b30(++_0x584019);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var util=require(_0x7995('0x2'));var seqqueue=require(_0x7995('0x3'));var moment=require('moment');var Redis=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var strategy=require('./strategy');config[_0x7995('0x8')]=_[_0x7995('0x9')](config[_0x7995('0x8')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x8')]));var attributes=['id','queue_id',_0x7995('0xc'),_0x7995('0xd'),'from',_0x7995('0xe')];function emit(_0x3116fb,_0x18c8a3,_0x35b5fe){io['to'](_0x3116fb)[_0x7995('0xf')](_0x18c8a3,_0x35b5fe);}function emitChannelQueueInteraction(_0x1e400a,_0x341672,_0x524f7b,_0x245143,_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e=_[_0x7995('0x10')](_0x524f7b);_0x19a27e[_0x7995('0x11')]=_0x2cb37a;_0x19a27e[_0x7995('0xd')]=_0x341672;_0x19a27e[_0x7995('0xc')]=_0x245143;_0x19a27e['id']=_0x41c652;if(_0x581f22){_0xb0c872[util['format']('%sQueuesWaitingInteractions',_0x1e400a)][_0x41c652]=_[_0x7995('0x12')](_0x19a27e,attributes);}else{delete _0xb0c872[util[_0x7995('0x13')](_0x7995('0x14'),_0x1e400a)][_0x41c652];}emit(util[_0x7995('0x13')](_0x7995('0x15'),_0x1e400a,_0x341672),util[_0x7995('0x13')](_0x7995('0x16'),_0x1e400a,_0x581f22?_0x7995('0x17'):'remove'),_[_0x7995('0x12')](_0x19a27e,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x7995('0x18')),'chatQueueReport':require(_0x7995('0x19')),'smsQueueReport':require(_0x7995('0x1a')),'faxQueueReport':require(_0x7995('0x1b')),'whatsappQueueReport':require(_0x7995('0x1c'))};var queue=schema({'name':{'type':_0x7995('0x1d'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x7995('0x1e')}});function startRouting(_0x5e6f90,_0x555f74,_0x3ec178,_0x3d463e){if(_0x5e6f90&&_0x555f74&&_0x3ec178){_0x555f74['waiting']+=0x1;var _0x3a9b54={'uniqueid':_0x5e6f90,'from':_0x3ec178['body']?_0x3ec178['body'][_0x7995('0x1f')]:'','joinAt':moment()[_0x7995('0x13')](_0x7995('0x20')),'ContactId':_0x3ec178[_0x7995('0x21')]?_0x3ec178[_0x7995('0x21')]['id']:null,'ListId':_0x3ec178[_0x7995('0x22')]?_0x3ec178['list']['id']:null};_0x3a9b54[_[_0x7995('0x23')](_0x3ec178[_0x7995('0x24')])+_0x7995('0x25')]=_0x555f74['id']||null;_0x3a9b54[_[_0x7995('0x23')](_0x3ec178[_0x7995('0x24')])+_0x7995('0x26')]=_0x3ec178[_0x7995('0x27')]?_0x3ec178[_0x7995('0x27')]['id']:null;_0x3a9b54[_['upperFirst'](_0x3ec178[_0x7995('0x24')])+_0x7995('0x28')]=_0x3ec178[_0x7995('0x29')]?_0x3ec178[_0x7995('0x29')]['id']:null;_0x3a9b54[_[_0x7995('0x23')](_0x3ec178[_0x7995('0x24')])+(_0x3ec178['channel']!==_0x7995('0x2a')?'AccountId':_0x7995('0x2b'))]=_0x3ec178[_0x7995('0xc')]?_0x3ec178[_0x7995('0xc')]['id']:null;logger[_0x7995('0x2c')](util[_0x7995('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x5e6f90,_0x555f74[_0x7995('0x2d')]));emitChannelQueueInteraction(_0x3ec178['channel'],_0x555f74[_0x7995('0x2d')],_0x3a9b54,_0x3ec178[_0x7995('0xc')][_0x7995('0x2d')],_0x3ec178['message']['id'],!![],_0x3d463e,_0x555f74['id']);if(rpc[_0x3ec178['channel']+'QueueReport']){return rpc[_0x3ec178[_0x7995('0x24')]+_0x7995('0x2e')][_0x7995('0x2f')](_0x3a9b54)[_0x7995('0x30')](function(_0x2e3493){logger[_0x7995('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x481c74,_0xfa8f15,_0x5524af,_0x553671){if(_0x481c74&&_0xfa8f15){_0xfa8f15[_0x7995('0x32')]-=0x1;var _0x29fac5={'leaveAt':moment()[_0x7995('0x13')](_0x7995('0x20')),'acceptAt':moment()['format'](_0x7995('0x20')),'reason':_0x7995('0x33')};logger['info'](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x481c74,_0xfa8f15[_0x7995('0x2d')]));emitChannelQueueInteraction(_0x5524af[_0x7995('0x24')],_0xfa8f15['name'],_0x5524af[_0x7995('0x34')],_0x5524af['account'][_0x7995('0x2d')],_0x5524af[_0x7995('0x29')]['id'],![],_0x553671,_0xfa8f15['id']);if(rpc[_0x5524af[_0x7995('0x24')]+'QueueReport']){return rpc[_0x5524af['channel']+_0x7995('0x2e')]['update'](_0x481c74,_0x29fac5)['catch'](function(_0x3e99cd){logger[_0x7995('0x31')]('update\x20queue\x20report');});}}}function endRouting(_0x1baa15,_0x1922b4,_0x2b772f,_0x18667c){if(_0x1baa15&&_0x1922b4){_0x1922b4[_0x7995('0x32')]-=0x1;var _0x53002a={'leaveAt':moment()[_0x7995('0x13')](_0x7995('0x20')),'exitAt':moment()[_0x7995('0x13')](_0x7995('0x20')),'reason':'timeout'};logger[_0x7995('0x2c')](util[_0x7995('0x13')](_0x7995('0x35'),_0x1baa15,_0x1922b4[_0x7995('0x2d')]));emitChannelQueueInteraction(_0x2b772f[_0x7995('0x24')],_0x1922b4[_0x7995('0x2d')],_0x2b772f['body'],_0x2b772f[_0x7995('0xc')][_0x7995('0x2d')],_0x2b772f[_0x7995('0x29')]['id'],![],_0x18667c);if(rpc[_0x2b772f[_0x7995('0x24')]+_0x7995('0x2e')]){return rpc[_0x2b772f[_0x7995('0x24')]+_0x7995('0x2e')][_0x7995('0x36')](_0x1baa15,_0x53002a)[_0x7995('0x30')](function(_0x447981){logger[_0x7995('0x31')](_0x7995('0x37'));});}}}function handleFindQueue(_0x7b4e67){return function(_0x53cda2){return _0x53cda2['name'][_0x7995('0x38')]()===_0x7b4e67[_0x7995('0x38')]();};}exports['consequence']=function(_0x4b0855,_0x3f8522,_0x4a9fef,_0x504a33){return function(_0x23da6b){try{var _0x36e28b={'name':_0x3f8522[0x0],'timeout':_0x3f8522[0x1]};var _0x35c8ff=queue['validate'](_0x36e28b,{'typecast':!![]});if(_0x35c8ff[_0x7995('0x39')]){logger['error'](_0x7995('0x3a'),_0x4b0855,_['map'](_0x35c8ff,'message')[_0x7995('0x3b')](',\x20'));_0x23da6b[_0x7995('0x3c')]();}else{var _0xc04e5=_[_0x7995('0x3d')](_0x4a9fef[_0x504a33['channel']+_0x7995('0x3e')],handleFindQueue(_0x36e28b[_0x7995('0x2d')]));if(_0xc04e5){startRouting(_0x4b0855,_0xc04e5,_0x504a33,_0x4a9fef);var _0x31b347=(_0xc04e5[_0x7995('0x3f')]||0xa)*0x3e8;var _0x4e09b7=(_0x36e28b['timeout']||0x14)*0x3e8;var _0x1c37c6,_0x55791b;if(_0x31b347>_0x4e09b7){_0x4e09b7=_0x31b347;}var _0x23c41d=seqqueue['createQueue'](_0x31b347);_0x23c41d['id']=_0x4b0855;_0x23c41d[_0x7995('0x40')]=_0x31b347;_0x23c41d['qtimeout']=_0x4e09b7;_0x23c41d[_0x7995('0x24')]=_0x504a33[_0x7995('0x24')];_0x4a9fef['rules'][_0x4b0855]['on'](_0x7995('0x41'),function(){logger[_0x7995('0x2c')](_0x7995('0x42'),_0x4b0855);stopRouting(_0x4b0855,_0xc04e5,_0x504a33,_0x4a9fef);clearTimeout(_0x1c37c6);_0x1c37c6=undefined;_0x23c41d[_0x7995('0x43')](!![]);if(_0x4a9fef['rules'][_0x4b0855]){delete _0x4a9fef[_0x7995('0x44')][_0x4b0855];}_0x23da6b[_0x7995('0x3c')]();});_0x4a9fef[_0x7995('0x44')][_0x4b0855]['on']('complete',function(){if(_0x4a9fef[_0x7995('0x44')][_0x4b0855]){delete _0x4a9fef[_0x7995('0x44')][_0x4b0855];}});_0x1c37c6=setTimeout(function(){logger[_0x7995('0x2c')](_0x7995('0x45'),_0x4b0855);endRouting(_0x4b0855,_0xc04e5,_0x504a33,_0x4a9fef);clearTimeout(_0x1c37c6);_0x23c41d[_0x7995('0x43')](!![]);_0x23da6b['next']();},_0x4e09b7);switch(_0xc04e5[_0x7995('0x46')]){case _0x7995('0x47'):strategy['rrmemory'](_0x23c41d,_0xc04e5,_0x4a9fef,_0x504a33);break;default:strategy[_0x7995('0x48')](_0x23c41d,_0xc04e5,_0x4a9fef,_0x504a33);}}else{logger['error'](_0x7995('0x49'),_0x4b0855,_0x36e28b[_0x7995('0x2d')]);_0x23da6b[_0x7995('0x3c')]();}}}catch(_0x30e220){console[_0x7995('0x4a')](_0x30e220);logger[_0x7995('0x31')](_0x7995('0x3a'),_0x4b0855,_0x30e220['stack']);_0x23da6b[_0x7995('0x3c')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 56c7e7b..da903f9 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 _0x6ac8=['realtime','handleTimeout','bind','timeout','drained','handleDrained','prototype','push','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','STOP','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x5b62d4,_0x33323f){var _0x10f496=function(_0x557f12){while(--_0x557f12){_0x5b62d4['push'](_0x5b62d4['shift']());}};_0x10f496(++_0x33323f);}(_0x6ac8,0x9a));var _0x86ac=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x6ac8[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var uuid=require(_0x86ac('0x0'));var util=require(_0x86ac('0x1'));var logger=require(_0x86ac('0x2'))(_0x86ac('0x3'));var Agent=function(_0x95ddf6,_0x51bf04,_0x3722dc,_0x230432){this[_0x86ac('0x4')]=uuid['v4']();this[_0x86ac('0x5')]=_0x95ddf6;this['agent']=_0x51bf04;this[_0x86ac('0x6')]=_0x3722dc;this['routing']=_0x230432;this['squeue']['push'](this['handleRun']['bind'](this),this[_0x86ac('0x7')][_0x86ac('0x8')](this));this[_0x86ac('0x5')]['on'](_0x86ac('0x9'),this[_0x86ac('0x7')][_0x86ac('0x8')](this));this[_0x86ac('0x5')]['on'](_0x86ac('0xa'),this[_0x86ac('0xb')]['bind'](this));};Agent[_0x86ac('0xc')][_0x86ac('0xd')]=function(){this[_0x86ac('0x5')][_0x86ac('0xd')](this[_0x86ac('0xe')][_0x86ac('0x8')](this),this[_0x86ac('0x7')][_0x86ac('0x8')](this));};Agent[_0x86ac('0xc')][_0x86ac('0xb')]=function(){this[_0x86ac('0x7')](!![]);};Agent[_0x86ac('0xc')]['handleRun']=function(_0x3afe94){logger[_0x86ac('0xf')](_0x86ac('0x10'),this[_0x86ac('0x5')]['id'],this[_0x86ac('0x11')]['id']);if(_[_0x86ac('0x12')](this[_0x86ac('0x6')][_0x86ac('0x13')][this[_0x86ac('0x11')]['id']])){logger[_0x86ac('0xf')](_0x86ac('0x14'),this['squeue']['id'],this[_0x86ac('0x11')]['id']);setTimeout(this[_0x86ac('0xd')][_0x86ac('0x8')](this),0x3e8);}else{if(this[_0x86ac('0x3')][_0x86ac('0x15')]||util['isAgentAvailable'](this[_0x86ac('0x5')]['id'],this[_0x86ac('0x6')][_0x86ac('0x13')][this[_0x86ac('0x11')]['id']],this[_0x86ac('0x5')][_0x86ac('0x16')],![])){this['realtime'][_0x86ac('0x13')][this[_0x86ac('0x11')]['id']][_0x86ac('0x17')]=!![];this['realtime'][_0x86ac('0x13')][this[_0x86ac('0x11')]['id']][_0x86ac('0x18')]=undefined;util['showNotification'](this['notificationId'],this[_0x86ac('0x5')]['id'],this[_0x86ac('0x6')][_0x86ac('0x13')][this[_0x86ac('0x11')]['id']],null,this[_0x86ac('0x3')]);util[_0x86ac('0x19')](this['squeue']['id'],this[_0x86ac('0x6')][_0x86ac('0x13')][this[_0x86ac('0x11')]['id']],_0x86ac('0x1a')+(this['routing'][_0x86ac('0x15')]?_0x86ac('0x1b'):''));}else{logger['info'](_0x86ac('0x1c'),this['squeue']['id'],this[_0x86ac('0x11')]['id']);setTimeout(this['push'][_0x86ac('0x8')](this),0x3e8);}}};Agent[_0x86ac('0xc')][_0x86ac('0x7')]=function(_0xee39eb){if(_[_0x86ac('0x12')](this[_0x86ac('0x6')]['agents'][this[_0x86ac('0x11')]['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x86ac('0x5')]['id'],this[_0x86ac('0x11')]['id']);}else{logger[_0x86ac('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x86ac('0x5')]['id'],this[_0x86ac('0x11')]['id']);util[_0x86ac('0x1d')](this[_0x86ac('0x4')],this['squeue']['id'],this[_0x86ac('0x6')][_0x86ac('0x13')][this[_0x86ac('0x11')]['id']],null,this[_0x86ac('0x3')]);this[_0x86ac('0x6')]['agents'][this[_0x86ac('0x11')]['id']][_0x86ac('0x17')]=![];this[_0x86ac('0x6')][_0x86ac('0x13')][this[_0x86ac('0x11')]['id']][_0x86ac('0x18')]=undefined;util[_0x86ac('0x19')](this[_0x86ac('0x5')]['id'],this[_0x86ac('0x6')][_0x86ac('0x13')][this['agent']['id']],_0xee39eb?_0x86ac('0x1e'):'TIMEOUT');}if(!_0xee39eb){setTimeout(this[_0x86ac('0xd')][_0x86ac('0x8')](this),0x3e8);}};function agent(_0x3e9f5b,_0x1e4031,_0x566329,_0x4727e0){return new Agent(_0x3e9f5b,_0x1e4031,_0x566329,_0x4727e0);}module[_0x86ac('0x1f')]=agent; \ No newline at end of file +var _0x1330=['hideNotification','writeLog','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','busyQueue','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0x5bf878,_0x128633){var _0x421c4f=function(_0x229b4d){while(--_0x229b4d){_0x5bf878['push'](_0x5bf878['shift']());}};_0x421c4f(++_0x128633);}(_0x1330,0x1f4));var _0x0133=function(_0x46bec2,_0x36cde0){_0x46bec2=_0x46bec2-0x0;var _0x39b857=_0x1330[_0x46bec2];return _0x39b857;};'use strict';var _=require('lodash');var uuid=require(_0x0133('0x0'));var util=require(_0x0133('0x1'));var logger=require(_0x0133('0x2'))(_0x0133('0x3'));var Agent=function(_0x580d2b,_0x3de568,_0x1bca21,_0x12e24d){this[_0x0133('0x4')]=uuid['v4']();this[_0x0133('0x5')]=_0x580d2b;this[_0x0133('0x6')]=_0x3de568;this['realtime']=_0x1bca21;this[_0x0133('0x3')]=_0x12e24d;this[_0x0133('0x5')][_0x0133('0x7')](this[_0x0133('0x8')][_0x0133('0x9')](this),this[_0x0133('0xa')][_0x0133('0x9')](this));this[_0x0133('0x5')]['on'](_0x0133('0xb'),this[_0x0133('0xa')]['bind'](this));this[_0x0133('0x5')]['on'](_0x0133('0xc'),this[_0x0133('0xd')][_0x0133('0x9')](this));};Agent[_0x0133('0xe')][_0x0133('0x7')]=function(){this[_0x0133('0x5')]['push'](this['handleRun'][_0x0133('0x9')](this),this[_0x0133('0xa')][_0x0133('0x9')](this));};Agent[_0x0133('0xe')][_0x0133('0xd')]=function(){this[_0x0133('0xa')](!![]);};Agent[_0x0133('0xe')][_0x0133('0x8')]=function(_0x2a9860){logger[_0x0133('0xf')](_0x0133('0x10'),this[_0x0133('0x5')]['id'],this[_0x0133('0x6')]['id']);if(_[_0x0133('0x11')](this[_0x0133('0x12')][_0x0133('0x13')][this[_0x0133('0x6')]['id']])){logger['info'](_0x0133('0x14'),this['squeue']['id'],this[_0x0133('0x6')]['id']);setTimeout(this[_0x0133('0x7')][_0x0133('0x9')](this),0x3e8);}else{if(this[_0x0133('0x3')][_0x0133('0x15')]||util['isAgentAvailable'](this[_0x0133('0x5')]['id'],this[_0x0133('0x12')][_0x0133('0x13')][this[_0x0133('0x6')]['id']],this['squeue']['channel'],![])){this[_0x0133('0x12')]['agents'][this[_0x0133('0x6')]['id']][_0x0133('0x16')]=!![];this[_0x0133('0x12')][_0x0133('0x13')][this[_0x0133('0x6')]['id']][_0x0133('0x17')]=undefined;util['showNotification'](this[_0x0133('0x4')],this[_0x0133('0x5')]['id'],this['realtime'][_0x0133('0x13')][this[_0x0133('0x6')]['id']],null,this[_0x0133('0x3')]);util['writeLog'](this[_0x0133('0x5')]['id'],this['realtime'][_0x0133('0x13')][this['agent']['id']],_0x0133('0x18')+(this[_0x0133('0x3')][_0x0133('0x15')]?_0x0133('0x19'):''));}else{logger[_0x0133('0xf')](_0x0133('0x1a'),this[_0x0133('0x5')]['id'],this[_0x0133('0x6')]['id']);setTimeout(this['push'][_0x0133('0x9')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0xdb5da8){if(_[_0x0133('0x11')](this[_0x0133('0x12')][_0x0133('0x13')][this[_0x0133('0x6')]['id']])){return logger[_0x0133('0xf')](_0x0133('0x14'),this[_0x0133('0x5')]['id'],this[_0x0133('0x6')]['id']);}else{logger['info'](_0x0133('0x1b'),this[_0x0133('0x5')]['id'],this['agent']['id']);util[_0x0133('0x1c')](this[_0x0133('0x4')],this[_0x0133('0x5')]['id'],this[_0x0133('0x12')]['agents'][this[_0x0133('0x6')]['id']],null,this[_0x0133('0x3')]);this['realtime'][_0x0133('0x13')][this[_0x0133('0x6')]['id']][_0x0133('0x16')]=![];this[_0x0133('0x12')][_0x0133('0x13')][this[_0x0133('0x6')]['id']]['busyQueue']=undefined;util[_0x0133('0x1d')](this[_0x0133('0x5')]['id'],this['realtime'][_0x0133('0x13')][this[_0x0133('0x6')]['id']],_0xdb5da8?_0x0133('0x1e'):_0x0133('0x1f'));}if(!_0xdb5da8){setTimeout(this[_0x0133('0x7')]['bind'](this),0x3e8);}};function agent(_0x2f226a,_0x4c24c5,_0x1c6bed,_0x24de5e){return new Agent(_0x2f226a,_0x4c24c5,_0x1c6bed,_0x24de5e);}module[_0x0133('0x20')]=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 d23f9b6..76c37d2 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 _0xba9d=['handleTimeout','bind','handleDrained','handleRun','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','busy','exports','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime','routing','push'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xba9d,0x18a));var _0xdba9=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xba9d[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var uuid=require(_0xdba9('0x0'));var util=require(_0xdba9('0x1'));var logger=require(_0xdba9('0x2'))('routing');var Beepall=function(_0x39dd91,_0x517fce,_0x2e572a,_0x3ec392){this[_0xdba9('0x3')]=uuid['v4']();this[_0xdba9('0x4')]=_0x39dd91;this[_0xdba9('0x5')]=_0x517fce;this[_0xdba9('0x6')]=_0x2e572a;this[_0xdba9('0x7')]=_0x3ec392;this['squeue'][_0xdba9('0x8')](this['handleRun']['bind'](this),this[_0xdba9('0x9')][_0xdba9('0xa')](this));this[_0xdba9('0x4')]['on']('timeout',this[_0xdba9('0x9')][_0xdba9('0xa')](this));this[_0xdba9('0x4')]['on']('drained',this[_0xdba9('0xb')]['bind'](this));};Beepall['prototype']['push']=function(){this[_0xdba9('0x4')][_0xdba9('0x8')](this[_0xdba9('0xc')][_0xdba9('0xa')](this),this['handleTimeout'][_0xdba9('0xa')](this));};Beepall[_0xdba9('0xd')][_0xdba9('0xb')]=function(_0x30cd99){this[_0xdba9('0x9')](!![]);};Beepall['prototype']['handleRun']=function(_0x4ff907){var _0x361e8b=!![];if(!_[_0xdba9('0xe')](this['queue'])&&!_['isNil'](this['queue']['Agents'])&&this[_0xdba9('0x5')]['Agents']['length']>0x0){for(var _0x363177=0x0,_0x2c7667;_0x3631770x0){for(var _0x1064ab=0x0,_0x2602c7;_0x1064ab0x0&&_0x33ae87[_0x26ab9a+_0x00d9('0x25')]>=_0x33ae87[_0x26ab9a+_0x00d9('0x24')]){writeLog(_0x98a438,_0x33ae87,_0x26ab9a[_0x00d9('0x26')]()+_0x00d9('0x27'));return![];}}return!![];};exports[_0x00d9('0x28')]=function(_0x5c5938,_0x231b8f,_0x198fb7,_0x134662,_0x2ec808){return sendNotification(!![],_0x5c5938,_0x231b8f,_0x198fb7,_0x134662,_0x2ec808);};exports[_0x00d9('0x29')]=function(_0x1267a2,_0x332792,_0x148453,_0x14eb8d,_0xa441c8){return sendNotification(![],_0x1267a2,_0x332792,_0x148453,_0x14eb8d,_0xa441c8);};exports[_0x00d9('0x2a')]=writeLog; \ No newline at end of file +var _0x906c=['../utils','../../../../../config/environment','../../../../../config/logger','routing','redis','format','user:%s','name','emit','user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','error','[%s][QUEUE]\x20%s','message','notification:%s','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','writeLog','lodash','util'];(function(_0x590def,_0x5aaa3b){var _0x5abe2b=function(_0x55dbb7){while(--_0x55dbb7){_0x590def['push'](_0x590def['shift']());}};_0x5abe2b(++_0x5aaa3b);}(_0x906c,0x195));var _0xc906=function(_0x27f353,_0x58d883){_0x27f353=_0x27f353-0x0;var _0x15abd1=_0x906c[_0x27f353];return _0x15abd1;};'use strict';var _=require(_0xc906('0x0'));var util=require(_0xc906('0x1'));var utils=require(_0xc906('0x2'));var Mustache=require('mustache');var Redis=require('ioredis');var config=require(_0xc906('0x3'));var logger=require(_0xc906('0x4'))(_0xc906('0x5'));config[_0xc906('0x6')]=_['defaults'](config[_0xc906('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc906('0x6')]));function emit(_0x62ff11,_0x3b8256,_0x541b60){io['to'](_0x62ff11)['emit'](_0x3b8256,_0x541b60);}function sendNotification(_0x2ecf55,_0x58c03e,_0x19f87b,_0x10d187,_0x1d10a2,_0x41e4c3){io['to'](util[_0xc906('0x7')](_0xc906('0x8'),_0x10d187[_0xc906('0x9')]))[_0xc906('0xa')](_0xc906('0xb'),_0x10d187);var _0x17174d=_0x41e4c3||{};var _0x1f8ff2=_0x19f87b['split']('.');var _0x2941a8={'uniqueid':_0x58c03e,'channel':_0x1f8ff2[0x0],'id':_0x1f8ff2[0x1],'title':_0x1f8ff2[0x0]+_0xc906('0xc'),'interactionId':_0x1f8ff2[0x2],'queue':_0x1d10a2?_0x1d10a2[_0xc906('0x9')]:null,'sound':_0x17174d[_0xc906('0xd')][_0xc906('0xe')],'shake':_0x17174d[_0xc906('0xd')][_0xc906('0xf')]};try{if(!_0x17174d[_0xc906('0x10')]){_0x17174d['body']={};}if(_0x1d10a2){_0x17174d['body'][_0xc906('0x11')]=_0x1d10a2;}else if(_0x17174d[_0xc906('0x10')]['queue']){delete _0x17174d[_0xc906('0x10')]['queue'];}_0x2941a8[_0xc906('0x12')]=utils['getMustacheRender'](_0x17174d[_0xc906('0xd')][_0xc906('0x13')],_0x17174d);}catch(_0x48e9c1){_0x2941a8[_0xc906('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0xc906('0x14')](util[_0xc906('0x7')](_0xc906('0x15'),_0x58c03e,_0x48e9c1[_0xc906('0x16')]));}io['to'](util[_0xc906('0x7')](_0xc906('0x8'),_0x10d187['name']))[_0xc906('0xa')](util['format'](_0xc906('0x17'),_0x2ecf55?'save':'remove'),_0x2941a8);}function writeLog(_0x1adaf5,_0x1c38c4,_0x5a2172){return logger[_0xc906('0x18')](util[_0xc906('0x7')](_0xc906('0x19'),_0x1adaf5,_0x1c38c4[_0xc906('0x9')],_0x5a2172));}exports['isAgentAvailable']=function(_0x298555,_0x1a51a6,_0x229999,_0x2e9f9e){if(_0x1a51a6[_0xc906('0x1a')]){writeLog(_0x298555,_0x1a51a6,'BUSY');return![];}if(!_0x1a51a6[_0xc906('0x1b')]){writeLog(_0x298555,_0x1a51a6,_0xc906('0x1c'));return![];}if(_0x1a51a6[_0x229999+_0xc906('0x1d')]){writeLog(_0x298555,_0x1a51a6,_0xc906('0x1e'));return![];}if(_0x2e9f9e&&_0x1a51a6[_0xc906('0x1f')](_0x229999+_0xc906('0x20'))&&_0x1a51a6[_0xc906('0x1f')](_0x229999+_0xc906('0x21'))){if(_0x1a51a6[_0x229999+'Capacity']>0x0&&_0x1a51a6[_0x229999+_0xc906('0x21')]>=_0x1a51a6[_0x229999+_0xc906('0x20')]){writeLog(_0x298555,_0x1a51a6,_0x229999[_0xc906('0x22')]()+_0xc906('0x23'));return![];}}return!![];};exports['showNotification']=function(_0x3e0888,_0x2511a6,_0x4106cf,_0x2b59a3,_0x3817bd){return sendNotification(!![],_0x3e0888,_0x2511a6,_0x4106cf,_0x2b59a3,_0x3817bd);};exports['hideNotification']=function(_0x43273c,_0x307d00,_0x1e139f,_0x5a3768,_0x4cb367){return sendNotification(![],_0x43273c,_0x307d00,_0x1e139f,_0x5a3768,_0x4cb367);};exports[_0xc906('0x24')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 2f1b03c..2ae885d 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 _0x0b9e=['trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','[%s][SYSTEM]\x20%s','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec'];(function(_0x151132,_0x32026a){var _0x13c2ad=function(_0x4dcd81){while(--_0x4dcd81){_0x151132['push'](_0x151132['shift']());}};_0x13c2ad(++_0x32026a);}(_0x0b9e,0x92));var _0xe0b9=function(_0x4e6796,_0x3268da){_0x4e6796=_0x4e6796-0x0;var _0x1c04eb=_0x0b9e[_0x4e6796];return _0x1c04eb;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0xe0b9('0x0'));var utils=require(_0xe0b9('0x1'));var logger=require(_0xe0b9('0x2'))(_0xe0b9('0x3'));var system=schema({'command':{'type':_0xe0b9('0x4'),'required':!![],'message':_0xe0b9('0x5')}});exports['consequence']=function(_0x2a7733,_0x22bd05){return function(_0x5ed8aa){try{var _0x1f23b0={'command':_0x22bd05[0x0]};var _0x40ea8e=system[_0xe0b9('0x6')](_0x1f23b0,{'typecast':!![]});if(_0x40ea8e[_0xe0b9('0x7')]){logger['error'](_0xe0b9('0x8'),_0x2a7733,_['map'](_0x40ea8e,'message')[_0xe0b9('0x9')](',\x20'));logger[_0xe0b9('0xa')](_0xe0b9('0xb'),_0x2a7733);_0x5ed8aa[_0xe0b9('0xc')]();}else{var _0x176b12=this;var _0x43c2c0=utils[_0xe0b9('0xd')](_0x22bd05[0x0],this);logger[_0xe0b9('0xa')](_0xe0b9('0xe'),_0x2a7733,_0x43c2c0);sh[_0xe0b9('0xf')](_[_0xe0b9('0x10')](_0x43c2c0),function(_0x368da5,_0x209d00){logger[_0xe0b9('0xa')](_0xe0b9('0x11'),_0x2a7733,_0x368da5);if(_0x368da5==0x0){var _0x1beee8=_0x209d00[_0xe0b9('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xe0b9('0x13')](_0x22bd05[0x1])||_[_0xe0b9('0x14')](_0x22bd05[0x1])){logger[_0xe0b9('0xa')](_0xe0b9('0x15'),_0x2a7733);_0x176b12[_0xe0b9('0x16')][_0x22bd05[0x1]]=_0x1beee8;}else{logger[_0xe0b9('0xa')](_0xe0b9('0x17'),_0x2a7733,_0x22bd05[0x1],_0x1beee8);_0x176b12['body'][_0x22bd05[0x1]]=_0x1beee8;}}_0x5ed8aa[_0xe0b9('0xc')]();});}}catch(_0xdae8c1){logger[_0xe0b9('0x18')]('[%s][SYSTEM]\x20%s',_0x2a7733,_[_0xe0b9('0x19')](_0xdae8c1)?JSON[_0xe0b9('0x1a')](_0xdae8c1):_0xdae8c1);logger[_0xe0b9('0xa')](_0xe0b9('0xb'),_0x2a7733);_0x5ed8aa[_0xe0b9('0xc')]();}};}; \ No newline at end of file +var _0xe7dd=['isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next'];(function(_0x350796,_0x1bf21f){var _0x126f19=function(_0x4d7591){while(--_0x4d7591){_0x350796['push'](_0x350796['shift']());}};_0x126f19(++_0x1bf21f);}(_0xe7dd,0x1d6));var _0xde7d=function(_0x43a3d4,_0x579cd8){_0x43a3d4=_0x43a3d4-0x0;var _0x1b2c1f=_0xe7dd[_0x43a3d4];return _0x1b2c1f;};'use strict';var schema=require(_0xde7d('0x0'));var sh=require(_0xde7d('0x1'));var _=require(_0xde7d('0x2'));var utils=require(_0xde7d('0x3'));var logger=require(_0xde7d('0x4'))('routing');var system=schema({'command':{'type':_0xde7d('0x5'),'required':!![],'message':_0xde7d('0x6')}});exports['consequence']=function(_0x11c93c,_0x2b3336){return function(_0xf15670){try{var _0x38ae13={'command':_0x2b3336[0x0]};var _0x778050=system['validate'](_0x38ae13,{'typecast':!![]});if(_0x778050[_0xde7d('0x7')]){logger[_0xde7d('0x8')]('[%s][SYSTEM]\x20%s',_0x11c93c,_[_0xde7d('0x9')](_0x778050,_0xde7d('0xa'))['join'](',\x20'));logger[_0xde7d('0xb')](_0xde7d('0xc'),_0x11c93c);_0xf15670['next']();}else{var _0x3bd830=this;var _0x1443cb=utils[_0xde7d('0xd')](_0x2b3336[0x0],this);logger[_0xde7d('0xb')](_0xde7d('0xe'),_0x11c93c,_0x1443cb);sh[_0xde7d('0xf')](_[_0xde7d('0x10')](_0x1443cb),function(_0x142937,_0x42f8df){logger[_0xde7d('0xb')](_0xde7d('0x11'),_0x11c93c,_0x142937);if(_0x142937==0x0){var _0x304f5a=_0x42f8df[_0xde7d('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xde7d('0x13')](_0x2b3336[0x1])||_[_0xde7d('0x14')](_0x2b3336[0x1])){logger[_0xde7d('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x11c93c);_0x3bd830[_0xde7d('0x15')][_0x2b3336[0x1]]=_0x304f5a;}else{logger[_0xde7d('0xb')](_0xde7d('0x16'),_0x11c93c,_0x2b3336[0x1],_0x304f5a);_0x3bd830[_0xde7d('0x15')][_0x2b3336[0x1]]=_0x304f5a;}}_0xf15670[_0xde7d('0x17')]();});}}catch(_0x3f422a){logger[_0xde7d('0x8')]('[%s][SYSTEM]\x20%s',_0x11c93c,_[_0xde7d('0x18')](_0x3f422a)?JSON[_0xde7d('0x19')](_0x3f422a):_0x3f422a);logger['info'](_0xde7d('0xc'),_0x11c93c);_0xf15670[_0xde7d('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 687ed35..9d58a82 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 _0xab43=['message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','routing','consequence','length','error','[%s][TAG]\x20%s','map'];(function(_0x213cb8,_0x3ae288){var _0x533ecc=function(_0x2e926b){while(--_0x2e926b){_0x213cb8['push'](_0x213cb8['shift']());}};_0x533ecc(++_0x3ae288);}(_0xab43,0x1cf));var _0x3ab4=function(_0x4a0d43,_0x240997){_0x4a0d43=_0x4a0d43-0x0;var _0x1e42dc=_0xab43[_0x4a0d43];return _0x1e42dc;};'use strict';var schema=require(_0x3ab4('0x0'));var _=require(_0x3ab4('0x1'));var rpc={'chatInteraction':require(_0x3ab4('0x2')),'openchannelInteraction':require(_0x3ab4('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x3ab4('0x4')),'faxInteraction':require(_0x3ab4('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x3ab4('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x3ab4('0x7')]=function(_0x458113,_0x21b877,_0x356d30,_0x1e69ee){return function(_0x42993b){try{var _0x578a8d={'tag':_0x21b877[0x0]};var _0x4baaa7=tag[_0x3ab4('0x0')](_0x578a8d,{'typecast':!![]});if(_0x4baaa7[_0x3ab4('0x8')]){logger[_0x3ab4('0x9')](_0x3ab4('0xa'),_0x458113,_[_0x3ab4('0xb')](_0x4baaa7,_0x3ab4('0xc'))[_0x3ab4('0xd')](',\x20'));logger[_0x3ab4('0xe')](_0x3ab4('0xf'),_0x458113);_0x42993b[_0x3ab4('0x10')]();}else{var _0x1e9b55={'ids':[_0x21b877[0x0]]};if(rpc[_0x1e69ee[_0x3ab4('0x11')]+'Interaction']){rpc[_0x1e69ee[_0x3ab4('0x11')]+_0x3ab4('0x12')]['addTags'](_0x1e69ee[_0x3ab4('0x13')]['id'],_0x1e9b55)['then'](function(_0x4170e6){logger[_0x3ab4('0xe')](_0x3ab4('0x14'),_0x458113,_0x21b877[0x1],_0x1e69ee[_0x3ab4('0x11')],_0x1e69ee[_0x3ab4('0x13')]['id']);})[_0x3ab4('0x15')](function(_0x287ce6){logger[_0x3ab4('0x9')](_0x3ab4('0xa'),_0x458113,JSON[_0x3ab4('0x16')](_0x287ce6));logger[_0x3ab4('0xe')](_0x3ab4('0xf'),_0x458113);})[_0x3ab4('0x17')](function(){_0x42993b[_0x3ab4('0x10')]();});}}}catch(_0x3400c0){logger[_0x3ab4('0x9')]('[%s][TAG]\x20%s',_0x458113,_[_0x3ab4('0x18')](_0x3400c0)?JSON['stringify'](_0x3400c0):_0x3400c0);logger[_0x3ab4('0xe')](_0x3ab4('0xf'),_0x458113);_0x42993b['next']();}};}; \ No newline at end of file +var _0x9c7e=['next','channel','Interaction','addTags','interaction','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x4a8ed9,_0x39f01e){var _0xd63203=function(_0x51f9cc){while(--_0x51f9cc){_0x4a8ed9['push'](_0x4a8ed9['shift']());}};_0xd63203(++_0x39f01e);}(_0x9c7e,0xb0));var _0xe9c7=function(_0x1ee492,_0x44de20){_0x1ee492=_0x1ee492-0x0;var _0x4485cc=_0x9c7e[_0x1ee492];return _0x4485cc;};'use strict';var schema=require(_0xe9c7('0x0'));var _=require(_0xe9c7('0x1'));var rpc={'chatInteraction':require(_0xe9c7('0x2')),'openchannelInteraction':require(_0xe9c7('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xe9c7('0x4')),'faxInteraction':require(_0xe9c7('0x5')),'whatsappInteraction':require(_0xe9c7('0x6'))};var logger=require('../../../../config/logger')(_0xe9c7('0x7'));var tag=schema({'tag':{'type':_0xe9c7('0x8'),'required':!![],'message':_0xe9c7('0x9')}});exports['consequence']=function(_0x33cfb8,_0x26c843,_0x155dc8,_0x365965){return function(_0x14f3a6){try{var _0x37aa10={'tag':_0x26c843[0x0]};var _0xd621a=tag[_0xe9c7('0x0')](_0x37aa10,{'typecast':!![]});if(_0xd621a['length']){logger[_0xe9c7('0xa')](_0xe9c7('0xb'),_0x33cfb8,_['map'](_0xd621a,_0xe9c7('0xc'))[_0xe9c7('0xd')](',\x20'));logger[_0xe9c7('0xe')](_0xe9c7('0xf'),_0x33cfb8);_0x14f3a6[_0xe9c7('0x10')]();}else{var _0x59c283={'ids':[_0x26c843[0x0]]};if(rpc[_0x365965[_0xe9c7('0x11')]+_0xe9c7('0x12')]){rpc[_0x365965[_0xe9c7('0x11')]+_0xe9c7('0x12')][_0xe9c7('0x13')](_0x365965[_0xe9c7('0x14')]['id'],_0x59c283)['then'](function(_0x3e5beb){logger[_0xe9c7('0xe')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x33cfb8,_0x26c843[0x1],_0x365965['channel'],_0x365965[_0xe9c7('0x14')]['id']);})['catch'](function(_0x15d4be){logger[_0xe9c7('0xa')](_0xe9c7('0xb'),_0x33cfb8,JSON[_0xe9c7('0x15')](_0x15d4be));logger[_0xe9c7('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x33cfb8);})[_0xe9c7('0x16')](function(){_0x14f3a6[_0xe9c7('0x10')]();});}}}catch(_0x1b5a51){logger[_0xe9c7('0xa')](_0xe9c7('0xb'),_0x33cfb8,_[_0xe9c7('0x17')](_0x1b5a51)?JSON[_0xe9c7('0x15')](_0x1b5a51):_0x1b5a51);logger[_0xe9c7('0xe')](_0xe9c7('0xf'),_0x33cfb8);_0x14f3a6['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index b65f5fe..69b8425 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 _0xfb30=['list','mustache','lodash','merge','body','contact','message','account','interaction'];(function(_0x1fba6c,_0xbdb7f1){var _0x5eb8c4=function(_0x2b53bb){while(--_0x2b53bb){_0x1fba6c['push'](_0x1fba6c['shift']());}};_0x5eb8c4(++_0xbdb7f1);}(_0xfb30,0x88));var _0x0fb3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfb30[_0x19e35c];return _0x3e1fe8;};'use strict';var Mustache=require(_0x0fb3('0x0'));var _=require(_0x0fb3('0x1'));module['exports']={'getMustacheRender':function(_0x49d250,_0x310142){return Mustache['render'](_0x49d250,_[_0x0fb3('0x2')](_0x310142[_0x0fb3('0x3')],{'contact':_0x310142[_0x0fb3('0x4')],'message':_0x310142[_0x0fb3('0x5')],'account':_0x310142[_0x0fb3('0x6')],'interaction':_0x310142[_0x0fb3('0x7')],'list':_0x310142[_0x0fb3('0x8')]}))||'';}}; \ No newline at end of file +var _0xee24=['exports','render','merge','body','message','account','interaction','list','lodash'];(function(_0x21f471,_0x243912){var _0x2785ba=function(_0x3e45b9){while(--_0x3e45b9){_0x21f471['push'](_0x21f471['shift']());}};_0x2785ba(++_0x243912);}(_0xee24,0x1a6));var _0x4ee2=function(_0x3a6761,_0x36093){_0x3a6761=_0x3a6761-0x0;var _0x37f75c=_0xee24[_0x3a6761];return _0x37f75c;};'use strict';var Mustache=require('mustache');var _=require(_0x4ee2('0x0'));module[_0x4ee2('0x1')]={'getMustacheRender':function(_0x4b75c3,_0x234b61){return Mustache[_0x4ee2('0x2')](_0x4b75c3,_[_0x4ee2('0x3')](_0x234b61[_0x4ee2('0x4')],{'contact':_0x234b61['contact'],'message':_0x234b61[_0x4ee2('0x5')],'account':_0x234b61[_0x4ee2('0x6')],'interaction':_0x234b61[_0x4ee2('0x7')],'list':_0x234b61[_0x4ee2('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index d50b728..7aad97d 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 _0xa3e6=['../../../config/environment','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','interaction','applications','isArray','length','existsSync','app','.js','autoreply','appdata','split','channel','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','message','TagId','format','%s:%s:%s','./interval','condition','intervals','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','emit','complete','info','No\x20applications\x20to\x20execute','stack','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','bluebird','uuid'];(function(_0x28fe0f,_0x1ade09){var _0x2daf07=function(_0x195e89){while(--_0x195e89){_0x28fe0f['push'](_0x28fe0f['shift']());}};_0x2daf07(++_0x1ade09);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x58398b,_0x436344){_0x58398b=_0x58398b-0x0;var _0x20dc9f=_0xa3e6[_0x58398b];return _0x20dc9f;};'use strict';var _=require(_0x6a3e('0x0'));var util=require('util');var path=require(_0x6a3e('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x6a3e('0x2'));var uuid=require(_0x6a3e('0x3'));var config=require(_0x6a3e('0x4'));var logger=require('../../../config/logger')(_0x6a3e('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x6a3e('0x6')),'chatQueueReport':require(_0x6a3e('0x7')),'smsQueueReport':require(_0x6a3e('0x8')),'faxQueueReport':require(_0x6a3e('0x9')),'whatsappQueueReport':require(_0x6a3e('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x3d7fbe,_0x3d2a86,_0x5c3b9f){return util['format'](_0x6a3e('0xb'),_0x3d7fbe,_0x3d2a86||0x0,_0x5c3b9f||0x0);}function getIntervals(_0x5707de,_0x54a40c){var _0xef2185=[];if(!_['isNil'](_0x54a40c[_0x6a3e('0xc')])&&!_['isNil'](_0x5707de[_0x54a40c[_0x6a3e('0xc')]])&&!_[_0x6a3e('0xd')](_0x5707de[_0x54a40c[_0x6a3e('0xc')]][_0x6a3e('0xe')])){_0xef2185=_[_0x6a3e('0xf')](_0x5707de[_0x54a40c[_0x6a3e('0xc')]]['Intervals'],_0x6a3e('0x10'));}else if(!_[_0x6a3e('0xd')](_0x54a40c[_0x6a3e('0x10')])){_0xef2185=[_0x54a40c[_0x6a3e('0x10')]];}return _0xef2185;}exports[_0x6a3e('0x11')]=function(_0x31aefa){_0x31aefa[_0x6a3e('0x12')]={};return new BPromise(function(_0x4bd05f,_0x2e911b){var _0x13b172={'Start':function(_0x8ed74b){var _0x2a62a8=this;return new Promise(function(_0x500ccd,_0x462b8d){if(_0x8ed74b){try{var _0x24666d=[];var _0x5de9a7=getId(_0x8ed74b['channel'],_0x8ed74b['message']?_0x8ed74b['message']['id']:0x0,_0x8ed74b['interaction']?_0x8ed74b[_0x6a3e('0x13')]['id']:0x0);if(_0x8ed74b[_0x6a3e('0x14')]&&_[_0x6a3e('0x15')](_0x8ed74b[_0x6a3e('0x14')])&&_0x8ed74b[_0x6a3e('0x14')][_0x6a3e('0x16')]){for(var _0x1d6ccc=0x0;_0x1d6ccc<_0x8ed74b[_0x6a3e('0x14')]['length'];_0x1d6ccc+=0x1){var _0x3d1e03=_0x8ed74b['applications'][_0x1d6ccc];if(fs[_0x6a3e('0x17')](path['join'](__dirname,_0x6a3e('0x14'),_0x3d1e03[_0x6a3e('0x18')]+_0x6a3e('0x19')))){var _0x350b66=[];switch(_0x3d1e03['app']['toLowerCase']()){case _0x6a3e('0x1a'):var _0x2d811f=_0x3d1e03[_0x6a3e('0x1b')][_0x6a3e('0x1c')](',');if(_0x8ed74b[_0x6a3e('0x1d')]===_0x6a3e('0x1e')){_0x350b66[_0x6a3e('0x1f')](_0x2d811f[0x0]);_0x350b66[_0x6a3e('0x1f')](_0x2d811f[0x1]);_0x350b66[_0x6a3e('0x1f')](_0x2d811f[_0x6a3e('0x20')](0x2,_0x2d811f[_0x6a3e('0x16')])[_0x6a3e('0x21')](','));}else{_0x350b66[_0x6a3e('0x1f')](_0x2d811f[0x0]);_0x350b66[_0x6a3e('0x1f')](_0x2d811f[_0x6a3e('0x20')](0x1,_0x2d811f['length'])['join'](','));}break;case _0x6a3e('0x22'):var _0x6cc7c4=_0x3d1e03[_0x6a3e('0x1b')][_0x6a3e('0x1c')](',');_0x350b66[_0x6a3e('0x1f')](_0x6cc7c4[0x0]);_0x350b66[_0x6a3e('0x1f')](_0x6cc7c4[0x1]);_0x350b66[_0x6a3e('0x1f')](_0x6cc7c4[_0x6a3e('0x20')](0x2,_0x6cc7c4[_0x6a3e('0x16')])[_0x6a3e('0x21')](','));break;case _0x6a3e('0x23'):var _0x508a55=_0x3d1e03['appdata'][_0x6a3e('0x1c')](',');_0x350b66['push'](_0x508a55[0x0]);_0x350b66[_0x6a3e('0x1f')](_0x508a55[0x1]);_0x350b66['push'](_0x508a55[0x2]);_0x350b66['push'](_0x508a55[0x3]);_0x350b66[_0x6a3e('0x1f')](_0x508a55[_0x6a3e('0x20')](0x4,_0x508a55['length'])['join'](','));break;case _0x6a3e('0x24'):var _0x431a9e=_0x3d1e03[_0x6a3e('0x1b')][_0x6a3e('0x1c')](',');_0x350b66['push'](_0x431a9e[0x0]);_0x350b66['push'](_0x431a9e[0x1]);_0x350b66[_0x6a3e('0x1f')](_0x431a9e[0x2]);_0x350b66[_0x6a3e('0x1f')](_0x431a9e[0x3]);_0x350b66[_0x6a3e('0x1f')](_0x431a9e[_0x6a3e('0x20')](0x4,_0x431a9e['length'])[_0x6a3e('0x21')](','));break;case _0x6a3e('0x25'):_0x350b66['push'](_0x3d1e03['appdata']);break;case'tag':_0x350b66[_0x6a3e('0x1f')](_0x3d1e03[_0x6a3e('0x26')]);_0x350b66[_0x6a3e('0x1f')](_0x3d1e03[_0x6a3e('0x1b')]);break;default:_0x350b66=_[_0x6a3e('0xd')](_0x3d1e03[_0x6a3e('0x1b')])?[]:_0x3d1e03[_0x6a3e('0x1b')][_0x6a3e('0x1c')](',');}var _0x4044d0={'id':util[_0x6a3e('0x27')](_0x6a3e('0x28'),_0x5de9a7,_0x3d1e03['id'],_0x3d1e03[_0x6a3e('0x18')]),'condition':require(_0x6a3e('0x29'))[_0x6a3e('0x2a')](_0x5de9a7,getIntervals(_0x31aefa[_0x6a3e('0x2b')],_0x3d1e03),_0x31aefa),'consequence':require('./applications/'+_0x3d1e03[_0x6a3e('0x18')])[_0x6a3e('0x2c')](_0x5de9a7,_0x350b66,_0x31aefa,_0x8ed74b),'p':_0x3d1e03[_0x6a3e('0x2d')]||0x0};logger['info'](_0x6a3e('0x2e'),_0x4044d0['id'],_0x6a3e('0x2f'),getIntervals(_0x31aefa['intervals'],_0x3d1e03)[_0x6a3e('0x21')](_0x6a3e('0x30')));_0x24666d[_0x6a3e('0x1f')](_0x4044d0);}else{logger['error'](_0x6a3e('0x31'),path[_0x6a3e('0x21')](__dirname,_0x6a3e('0x14'),_0x3d1e03[_0x6a3e('0x18')]+_0x6a3e('0x19')));}}_0x31aefa[_0x6a3e('0x12')][_0x5de9a7]=new RuleEngine(_0x24666d);_0x31aefa['rules'][_0x5de9a7][_0x6a3e('0x32')](_0x8ed74b,function(_0x55f1d4){logger['info']('Applications\x20executed',JSON[_0x6a3e('0x33')](_0x55f1d4['matchPath']));if(_0x31aefa[_0x6a3e('0x12')][_0x5de9a7]){_0x31aefa[_0x6a3e('0x12')][_0x5de9a7][_0x6a3e('0x34')](_0x6a3e('0x35'));}});return _0x500ccd({'code':0xc8,'message':_0x8ed74b});}else{logger[_0x6a3e('0x36')](_0x6a3e('0x37'));return _0x500ccd({'code':0xc8,'message':_0x8ed74b});}}catch(_0x480981){logger['error'](_0x480981[_0x6a3e('0x38')]);return _0x462b8d(_0x2a62a8[_0x6a3e('0x39')](0x1f4,_0x480981));}}return _0x462b8d(_0x6a3e('0x3a'));});},'AcceptMessage':function(_0x25c353){var _0x1dd524=this;return new Promise(function(_0x57f40b,_0xbba7c6){if(_0x25c353[_0x6a3e('0x3b')]&&_0x25c353['agent']['id']){if(_0x31aefa[_0x6a3e('0x3c')][_0x25c353[_0x6a3e('0x3b')]['id']]){_0x31aefa[_0x6a3e('0x3c')][_0x25c353['agent']['id']][_0x6a3e('0x3d')]=![];_0x31aefa[_0x6a3e('0x3c')][_0x25c353[_0x6a3e('0x3b')]['id']][_0x6a3e('0x3e')]=undefined;}}if(_0x25c353[_0x6a3e('0x25')]&&_0x25c353[_0x6a3e('0x25')]['id']){try{var _0x5f49d6=getId(_0x25c353[_0x6a3e('0x1d')],_0x25c353[_0x6a3e('0x25')]?_0x25c353[_0x6a3e('0x25')]['id']:0x0,_0x25c353['interaction']?_0x25c353[_0x6a3e('0x13')]['id']:0x0);if(_0x31aefa['rules'][_0x5f49d6]){_0x31aefa['rules'][_0x5f49d6][_0x6a3e('0x34')](_0x6a3e('0x3f'));if(rpc[_0x25c353[_0x6a3e('0x1d')]+'QueueReport']){rpc[_0x25c353['channel']+_0x6a3e('0x40')][_0x6a3e('0x41')](_0x5f49d6,{'UserId':_0x25c353[_0x6a3e('0x25')][_0x6a3e('0x42')]})[_0x6a3e('0x43')](function(_0xb084a0){logger['error'](_0x6a3e('0x44'));});}}return _0x57f40b({'code':0xc8,'message':_0x25c353});}catch(_0x24348c){logger[_0x6a3e('0x39')](_0x24348c[_0x6a3e('0x38')]);return _0xbba7c6(_0x1dd524[_0x6a3e('0x39')](0x1f4,_0x24348c));}}logger[_0x6a3e('0x39')](_0x6a3e('0x45'));return _0xbba7c6(_0x1dd524[_0x6a3e('0x39')](0x1f4,_0x6a3e('0x45')));});},'RejectMessage':function(_0x4d36e2){var _0x40a09d=this;return new Promise(function(_0x1d55ee,_0x4f0211){if(_0x4d36e2[_0x6a3e('0x3b')]&&_0x4d36e2['agent']['id']){try{if(_0x31aefa[_0x6a3e('0x3c')][_0x4d36e2[_0x6a3e('0x3b')]['id']]){_0x31aefa[_0x6a3e('0x3c')][_0x4d36e2['agent']['id']][_0x6a3e('0x3d')]=![];_0x31aefa[_0x6a3e('0x3c')][_0x4d36e2['agent']['id']]['busyQueue']=undefined;}return _0x1d55ee({'code':0xc8,'message':_0x4d36e2});}catch(_0x4997d7){logger[_0x6a3e('0x39')](_0x4997d7[_0x6a3e('0x38')]);return _0x4f0211(_0x40a09d[_0x6a3e('0x39')](0x1f4,_0x4997d7));}}logger[_0x6a3e('0x39')](_0x6a3e('0x45'));return _0x4f0211(_0x40a09d[_0x6a3e('0x39')](0x1f4,_0x6a3e('0x45')));});},'AbandonInteraction':function(_0x1ce964){var _0x4615fa=this;return new Promise(function(_0x196470,_0x15872d){if(_0x1ce964['channel']&&_0x1ce964[_0x6a3e('0x13')]&&_0x1ce964[_0x6a3e('0x13')]['id']){try{var _0x3fabf8=getId(_0x1ce964[_0x6a3e('0x1d')],_0x1ce964[_0x6a3e('0x25')]?_0x1ce964['message']['id']:0x0,_0x1ce964[_0x6a3e('0x13')]?_0x1ce964['interaction']['id']:0x0);if(_0x31aefa[_0x6a3e('0x12')][_0x3fabf8]){_0x31aefa[_0x6a3e('0x12')][_0x3fabf8][_0x6a3e('0x34')](_0x6a3e('0x3f'));}return _0x196470({'code':0xc8,'message':_0x1ce964});}catch(_0x1a72d1){logger['error'](_0x1a72d1['stack']);return _0x15872d(_0x4615fa['error'](0x1f4,_0x1a72d1));}}logger[_0x6a3e('0x39')](_0x6a3e('0x45'));return _0x15872d(_0x4615fa[_0x6a3e('0x39')](0x1f4,_0x6a3e('0x45')));});},'AgentCapacity':function(_0x13d520){var _0x2648a0=this;return new Promise(function(_0x504d86,_0x1d94e8){if(_0x31aefa['agents']['hasOwnProperty'](_0x13d520['id'])){for(var _0x54f666 in _0x13d520[_0x6a3e('0x46')]){if(_0x13d520[_0x6a3e('0x46')]['hasOwnProperty'](_0x54f666)){if(_0x31aefa[_0x6a3e('0x3c')][_0x13d520['id']][_0x6a3e('0x47')](_0x54f666+'CurrentCapacity')){_0x31aefa[_0x6a3e('0x3c')][_0x13d520['id']][_0x54f666+_0x6a3e('0x48')]=parseInt(_0x13d520[_0x6a3e('0x46')][_0x54f666],0xa);}}}_0x31aefa[_0x6a3e('0x3c')][_0x13d520['id']][_0x6a3e('0x49')]();return _0x504d86({'code':0xc8,'message':_0x31aefa['agents'][_0x13d520['id']]});}else{return _0x1d94e8(_0x2648a0[_0x6a3e('0x39')](0x1f4,_0x6a3e('0x4a')));}});},'Agents':function(_0x51d5fb){return new Promise(function(_0x132fd9,_0x30fe3b){var _0xbfecf4=_[_0x6a3e('0x4b')](_0x31aefa[_0x6a3e('0x3c')]);_0x132fd9({'count':_0xbfecf4[_0x6a3e('0x16')],'rows':_0xbfecf4});});},'ChatQueues':function(_0x14fd86){return new Promise(function(_0x15799b,_0x4756f6){var _0x1b07f6=[];for(var _0xd90a4d in _0x31aefa['chatQueues']){if(_0x31aefa[_0x6a3e('0x4c')][_0x6a3e('0x47')](_0xd90a4d)){var _0x437a88=_0x31aefa['chatQueues'][_0xd90a4d];var _0x32b55a={'id':_0x437a88['id'],'available':_0x437a88[_0x6a3e('0x4d')],'loggedIn':_0x437a88[_0x6a3e('0x4e')],'name':_0x437a88[_0x6a3e('0x4f')],'paused':_0x437a88['paused'],'waiting':_0x437a88[_0x6a3e('0x50')]};_0x1b07f6['push'](_0x32b55a);}}_0x15799b({'count':_0x1b07f6[_0x6a3e('0x16')],'rows':_0x1b07f6});});},'MailQueues':function(_0x4f68eb){return new Promise(function(_0x3a4181,_0x486d4a){var _0x471e73=[];for(var _0x2d5cfe in _0x31aefa[_0x6a3e('0x51')]){if(_0x31aefa[_0x6a3e('0x51')][_0x6a3e('0x47')](_0x2d5cfe)){var _0x3ebaef=_0x31aefa[_0x6a3e('0x51')][_0x2d5cfe];var _0x54ae99={'id':_0x3ebaef['id'],'available':_0x3ebaef[_0x6a3e('0x4d')],'loggedIn':_0x3ebaef[_0x6a3e('0x4e')],'name':_0x3ebaef[_0x6a3e('0x4f')],'paused':_0x3ebaef[_0x6a3e('0x52')],'waiting':_0x3ebaef[_0x6a3e('0x50')]};_0x471e73[_0x6a3e('0x1f')](_0x54ae99);}}_0x3a4181({'count':_0x471e73[_0x6a3e('0x16')],'rows':_0x471e73});});},'OpenchannelQueues':function(_0x9e04b2){return new Promise(function(_0x1c85c3,_0x40613d){var _0x3c7bd0=[];for(var _0x318fd9 in _0x31aefa['openchannelQueues']){if(_0x31aefa[_0x6a3e('0x53')][_0x6a3e('0x47')](_0x318fd9)){var _0x17ed75=_0x31aefa['openchannelQueues'][_0x318fd9];var _0x4420b9={'id':_0x17ed75['id'],'available':_0x17ed75['available'],'loggedIn':_0x17ed75[_0x6a3e('0x4e')],'name':_0x17ed75[_0x6a3e('0x4f')],'paused':_0x17ed75['paused'],'waiting':_0x17ed75[_0x6a3e('0x50')]};_0x3c7bd0[_0x6a3e('0x1f')](_0x4420b9);}}_0x1c85c3({'count':_0x3c7bd0['length'],'rows':_0x3c7bd0});});},'SmsQueues':function(_0x16376b){return new Promise(function(_0x34d9d2,_0x8608e9){var _0x177432=[];for(var _0x12fbb7 in _0x31aefa['smsQueues']){if(_0x31aefa[_0x6a3e('0x54')]['hasOwnProperty'](_0x12fbb7)){var _0xdf19f9=_0x31aefa['smsQueues'][_0x12fbb7];var _0x8b3520={'id':_0xdf19f9['id'],'available':_0xdf19f9[_0x6a3e('0x4d')],'loggedIn':_0xdf19f9[_0x6a3e('0x4e')],'name':_0xdf19f9[_0x6a3e('0x4f')],'paused':_0xdf19f9['paused'],'waiting':_0xdf19f9['waiting']};_0x177432[_0x6a3e('0x1f')](_0x8b3520);}}_0x34d9d2({'count':_0x177432[_0x6a3e('0x16')],'rows':_0x177432});});},'FaxQueues':function(_0x48edbf){return new Promise(function(_0x2704f0,_0x1e11dd){var _0x3e5f88=[];for(var _0x7b8d96 in _0x31aefa[_0x6a3e('0x55')]){if(_0x31aefa['faxQueues']['hasOwnProperty'](_0x7b8d96)){var _0x4429f1=_0x31aefa[_0x6a3e('0x55')][_0x7b8d96];var _0x1ba563={'id':_0x4429f1['id'],'available':_0x4429f1[_0x6a3e('0x4d')],'loggedIn':_0x4429f1[_0x6a3e('0x4e')],'name':_0x4429f1[_0x6a3e('0x4f')],'paused':_0x4429f1['paused'],'waiting':_0x4429f1[_0x6a3e('0x50')]};_0x3e5f88[_0x6a3e('0x1f')](_0x1ba563);}}_0x2704f0({'count':_0x3e5f88[_0x6a3e('0x16')],'rows':_0x3e5f88});});},'WhatsappQueues':function(_0x11c8be){return new Promise(function(_0x228a0a,_0x4393e9){var _0x4916a5=[];for(var _0x4ad723 in _0x31aefa[_0x6a3e('0x56')]){if(_0x31aefa[_0x6a3e('0x56')][_0x6a3e('0x47')](_0x4ad723)){var _0xb3676e=_0x31aefa[_0x6a3e('0x56')][_0x4ad723];var _0x24b3fb={'id':_0xb3676e['id'],'available':_0xb3676e[_0x6a3e('0x4d')],'loggedIn':_0xb3676e[_0x6a3e('0x4e')],'name':_0xb3676e[_0x6a3e('0x4f')],'paused':_0xb3676e['paused'],'waiting':_0xb3676e[_0x6a3e('0x50')]};_0x4916a5[_0x6a3e('0x1f')](_0x24b3fb);}}_0x228a0a({'count':_0x4916a5[_0x6a3e('0x16')],'rows':_0x4916a5});});},'ChatQueuesWaitingInteractions':function(_0x2e8af7){return new Promise(function(_0x35bbfe,_0x281fba){var _0x7e983a=_[_0x6a3e('0x4b')](_0x31aefa['chatQueuesWaitingInteractions']);_0x35bbfe({'count':_0x7e983a[_0x6a3e('0x16')],'rows':_0x7e983a});});},'MailQueuesWaitingInteractions':function(_0x506df6){return new Promise(function(_0x5f4561,_0x1ac45d){var _0x4650c1=_[_0x6a3e('0x4b')](_0x31aefa['mailQueuesWaitingInteractions']);_0x5f4561({'count':_0x4650c1[_0x6a3e('0x16')],'rows':_0x4650c1});});},'OpenchannelQueuesWaitingInteractions':function(_0x292774){return new Promise(function(_0x20fdf4,_0x672d9d){var _0x462e21=_[_0x6a3e('0x4b')](_0x31aefa[_0x6a3e('0x57')]);_0x20fdf4({'count':_0x462e21[_0x6a3e('0x16')],'rows':_0x462e21});});},'SmsQueuesWaitingInteractions':function(_0x358131){return new Promise(function(_0x4a548f,_0x1508cf){var _0x8bd18f=_[_0x6a3e('0x4b')](_0x31aefa[_0x6a3e('0x58')]);_0x4a548f({'count':_0x8bd18f[_0x6a3e('0x16')],'rows':_0x8bd18f});});},'FaxQueuesWaitingInteractions':function(_0x174ddf){return new Promise(function(_0x373e10,_0x1c5255){var _0x30a60a=_[_0x6a3e('0x4b')](_0x31aefa[_0x6a3e('0x59')]);_0x373e10({'count':_0x30a60a['length'],'rows':_0x30a60a});});},'WhatsappQueuesWaitingInteractions':function(_0x5867bb){return new Promise(function(_0x5148de,_0x34048b){var _0x523f00=_['values'](_0x31aefa[_0x6a3e('0x5a')]);_0x5148de({'count':_0x523f00['length'],'rows':_0x523f00});});}};var _0x1029f9=jayson[_0x6a3e('0x5b')](_0x13b172)[_0x6a3e('0x5c')]();_0x1029f9['on'](_0x6a3e('0x39'),function(_0x15478c){logger['error'](JSON[_0x6a3e('0x33')](_0x15478c));return _0x2e911b(_0x15478c);});_0x1029f9['listen'](0x232c,_0x6a3e('0x5d'),function(){console[_0x6a3e('0x5e')](_0x6a3e('0x5f'),0x232c);return _0x4bd05f(_0x6a3e('0x60')+0x232c);});});}; \ No newline at end of file +var _0x8a28=['condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','paused','mailQueues','loggedIn','name','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','push','slice','dialogflow','amazonlex','split','TagId','./interval'];(function(_0x510783,_0x158f2f){var _0x3944f2=function(_0x390db9){while(--_0x390db9){_0x510783['push'](_0x510783['shift']());}};_0x3944f2(++_0x158f2f);}(_0x8a28,0xfd));var _0x88a2=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x8a28[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var path=require(_0x88a2('0x2'));var fs=require('fs');var jayson=require(_0x88a2('0x3'));var BPromise=require(_0x88a2('0x4'));var uuid=require(_0x88a2('0x5'));var config=require(_0x88a2('0x6'));var logger=require(_0x88a2('0x7'))('routing');var rpc={'openchannelQueueReport':require(_0x88a2('0x8')),'mailQueueReport':require(_0x88a2('0x9')),'chatQueueReport':require(_0x88a2('0xa')),'smsQueueReport':require(_0x88a2('0xb')),'faxQueueReport':require(_0x88a2('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x88a2('0xd'));function getId(_0x5406ed,_0x1cdf6b,_0x2a8576){return util[_0x88a2('0xe')](_0x88a2('0xf'),_0x5406ed,_0x1cdf6b||0x0,_0x2a8576||0x0);}function getIntervals(_0x2db7dd,_0x2d0fce){var _0x183ca3=[];if(!_[_0x88a2('0x10')](_0x2d0fce[_0x88a2('0x11')])&&!_['isNil'](_0x2db7dd[_0x2d0fce['IntervalId']])&&!_[_0x88a2('0x10')](_0x2db7dd[_0x2d0fce[_0x88a2('0x11')]][_0x88a2('0x12')])){_0x183ca3=_[_0x88a2('0x13')](_0x2db7dd[_0x2d0fce[_0x88a2('0x11')]]['Intervals'],_0x88a2('0x14'));}else if(!_[_0x88a2('0x10')](_0x2d0fce[_0x88a2('0x14')])){_0x183ca3=[_0x2d0fce[_0x88a2('0x14')]];}return _0x183ca3;}exports['listen']=function(_0x923706){_0x923706[_0x88a2('0x15')]={};return new BPromise(function(_0x3b83ce,_0x59801e){var _0x34f19e={'Start':function(_0x207b12){var _0x462b7b=this;return new Promise(function(_0x42facc,_0x1beccd){if(_0x207b12){try{var _0x209d30=[];var _0xf48d17=getId(_0x207b12[_0x88a2('0x16')],_0x207b12[_0x88a2('0x17')]?_0x207b12[_0x88a2('0x17')]['id']:0x0,_0x207b12[_0x88a2('0x18')]?_0x207b12[_0x88a2('0x18')]['id']:0x0);if(_0x207b12[_0x88a2('0x19')]&&_[_0x88a2('0x1a')](_0x207b12[_0x88a2('0x19')])&&_0x207b12[_0x88a2('0x19')][_0x88a2('0x1b')]){for(var _0x46ed82=0x0;_0x46ed82<_0x207b12['applications'][_0x88a2('0x1b')];_0x46ed82+=0x1){var _0x282a27=_0x207b12['applications'][_0x46ed82];if(fs['existsSync'](path[_0x88a2('0x1c')](__dirname,_0x88a2('0x19'),_0x282a27[_0x88a2('0x1d')]+_0x88a2('0x1e')))){var _0x2039ee=[];switch(_0x282a27['app'][_0x88a2('0x1f')]()){case _0x88a2('0x20'):var _0x36cc2c=_0x282a27[_0x88a2('0x21')]['split'](',');if(_0x207b12[_0x88a2('0x16')]==='mail'){_0x2039ee['push'](_0x36cc2c[0x0]);_0x2039ee[_0x88a2('0x22')](_0x36cc2c[0x1]);_0x2039ee[_0x88a2('0x22')](_0x36cc2c['slice'](0x2,_0x36cc2c['length'])[_0x88a2('0x1c')](','));}else{_0x2039ee[_0x88a2('0x22')](_0x36cc2c[0x0]);_0x2039ee['push'](_0x36cc2c[_0x88a2('0x23')](0x1,_0x36cc2c[_0x88a2('0x1b')])[_0x88a2('0x1c')](','));}break;case _0x88a2('0x24'):var _0x54873b=_0x282a27[_0x88a2('0x21')]['split'](',');_0x2039ee[_0x88a2('0x22')](_0x54873b[0x0]);_0x2039ee[_0x88a2('0x22')](_0x54873b[0x1]);_0x2039ee[_0x88a2('0x22')](_0x54873b['slice'](0x2,_0x54873b[_0x88a2('0x1b')])[_0x88a2('0x1c')](','));break;case'dialogflowv2':var _0x21bd1b=_0x282a27[_0x88a2('0x21')]['split'](',');_0x2039ee['push'](_0x21bd1b[0x0]);_0x2039ee[_0x88a2('0x22')](_0x21bd1b[0x1]);_0x2039ee[_0x88a2('0x22')](_0x21bd1b[0x2]);_0x2039ee[_0x88a2('0x22')](_0x21bd1b[0x3]);_0x2039ee[_0x88a2('0x22')](_0x21bd1b[_0x88a2('0x23')](0x4,_0x21bd1b[_0x88a2('0x1b')])['join'](','));break;case _0x88a2('0x25'):var _0x1a3739=_0x282a27[_0x88a2('0x21')][_0x88a2('0x26')](',');_0x2039ee[_0x88a2('0x22')](_0x1a3739[0x0]);_0x2039ee[_0x88a2('0x22')](_0x1a3739[0x1]);_0x2039ee[_0x88a2('0x22')](_0x1a3739[0x2]);_0x2039ee[_0x88a2('0x22')](_0x1a3739[0x3]);_0x2039ee[_0x88a2('0x22')](_0x1a3739[_0x88a2('0x23')](0x4,_0x1a3739['length'])['join'](','));break;case _0x88a2('0x17'):_0x2039ee[_0x88a2('0x22')](_0x282a27[_0x88a2('0x21')]);break;case'tag':_0x2039ee[_0x88a2('0x22')](_0x282a27[_0x88a2('0x27')]);_0x2039ee['push'](_0x282a27[_0x88a2('0x21')]);break;default:_0x2039ee=_[_0x88a2('0x10')](_0x282a27[_0x88a2('0x21')])?[]:_0x282a27['appdata']['split'](',');}var _0xd8b70b={'id':util[_0x88a2('0xe')]('%s:%s:%s',_0xf48d17,_0x282a27['id'],_0x282a27[_0x88a2('0x1d')]),'condition':require(_0x88a2('0x28'))[_0x88a2('0x29')](_0xf48d17,getIntervals(_0x923706[_0x88a2('0x2a')],_0x282a27),_0x923706),'consequence':require(_0x88a2('0x2b')+_0x282a27[_0x88a2('0x1d')])[_0x88a2('0x2c')](_0xf48d17,_0x2039ee,_0x923706,_0x207b12),'p':_0x282a27[_0x88a2('0x2d')]||0x0};logger['info'](_0x88a2('0x2e'),_0xd8b70b['id'],_0x88a2('0x2f'),getIntervals(_0x923706['intervals'],_0x282a27)[_0x88a2('0x1c')](_0x88a2('0x30')));_0x209d30[_0x88a2('0x22')](_0xd8b70b);}else{logger[_0x88a2('0x31')](_0x88a2('0x32'),path[_0x88a2('0x1c')](__dirname,_0x88a2('0x19'),_0x282a27[_0x88a2('0x1d')]+_0x88a2('0x1e')));}}_0x923706[_0x88a2('0x15')][_0xf48d17]=new RuleEngine(_0x209d30);_0x923706[_0x88a2('0x15')][_0xf48d17][_0x88a2('0x33')](_0x207b12,function(_0x1f2bc5){logger[_0x88a2('0x34')](_0x88a2('0x35'),JSON[_0x88a2('0x36')](_0x1f2bc5[_0x88a2('0x37')]));if(_0x923706[_0x88a2('0x15')][_0xf48d17]){_0x923706[_0x88a2('0x15')][_0xf48d17][_0x88a2('0x38')](_0x88a2('0x39'));}});return _0x42facc({'code':0xc8,'message':_0x207b12});}else{logger[_0x88a2('0x34')](_0x88a2('0x3a'));return _0x42facc({'code':0xc8,'message':_0x207b12});}}catch(_0x3df13d){logger[_0x88a2('0x31')](_0x3df13d['stack']);return _0x1beccd(_0x462b7b['error'](0x1f4,_0x3df13d));}}return _0x1beccd(_0x88a2('0x3b'));});},'AcceptMessage':function(_0x37af7f){var _0x555415=this;return new Promise(function(_0x11e426,_0x4333f6){if(_0x37af7f[_0x88a2('0x3c')]&&_0x37af7f[_0x88a2('0x3c')]['id']){if(_0x923706[_0x88a2('0x3d')][_0x37af7f[_0x88a2('0x3c')]['id']]){_0x923706['agents'][_0x37af7f[_0x88a2('0x3c')]['id']][_0x88a2('0x3e')]=![];_0x923706[_0x88a2('0x3d')][_0x37af7f['agent']['id']][_0x88a2('0x3f')]=undefined;}}if(_0x37af7f[_0x88a2('0x17')]&&_0x37af7f[_0x88a2('0x17')]['id']){try{var _0x2ac23a=getId(_0x37af7f['channel'],_0x37af7f[_0x88a2('0x17')]?_0x37af7f[_0x88a2('0x17')]['id']:0x0,_0x37af7f[_0x88a2('0x18')]?_0x37af7f[_0x88a2('0x18')]['id']:0x0);if(_0x923706[_0x88a2('0x15')][_0x2ac23a]){_0x923706[_0x88a2('0x15')][_0x2ac23a][_0x88a2('0x38')](_0x88a2('0x40'));if(rpc[_0x37af7f[_0x88a2('0x16')]+_0x88a2('0x41')]){rpc[_0x37af7f[_0x88a2('0x16')]+_0x88a2('0x41')][_0x88a2('0x42')](_0x2ac23a,{'UserId':_0x37af7f[_0x88a2('0x17')][_0x88a2('0x43')]})[_0x88a2('0x44')](function(_0x318913){logger[_0x88a2('0x31')](_0x88a2('0x45'));});}}return _0x11e426({'code':0xc8,'message':_0x37af7f});}catch(_0x3fd34d){logger['error'](_0x3fd34d[_0x88a2('0x46')]);return _0x4333f6(_0x555415['error'](0x1f4,_0x3fd34d));}}logger[_0x88a2('0x31')]('message\x20is\x20empty');return _0x4333f6(_0x555415[_0x88a2('0x31')](0x1f4,_0x88a2('0x47')));});},'RejectMessage':function(_0x1c5e6b){var _0x37319d=this;return new Promise(function(_0x2ace4b,_0x172562){if(_0x1c5e6b[_0x88a2('0x3c')]&&_0x1c5e6b[_0x88a2('0x3c')]['id']){try{if(_0x923706['agents'][_0x1c5e6b[_0x88a2('0x3c')]['id']]){_0x923706[_0x88a2('0x3d')][_0x1c5e6b['agent']['id']][_0x88a2('0x3e')]=![];_0x923706['agents'][_0x1c5e6b[_0x88a2('0x3c')]['id']]['busyQueue']=undefined;}return _0x2ace4b({'code':0xc8,'message':_0x1c5e6b});}catch(_0x4dcaa5){logger[_0x88a2('0x31')](_0x4dcaa5[_0x88a2('0x46')]);return _0x172562(_0x37319d[_0x88a2('0x31')](0x1f4,_0x4dcaa5));}}logger[_0x88a2('0x31')](_0x88a2('0x47'));return _0x172562(_0x37319d[_0x88a2('0x31')](0x1f4,_0x88a2('0x47')));});},'AbandonInteraction':function(_0x2cf43b){var _0x33e64c=this;return new Promise(function(_0x3887c5,_0x193d5e){if(_0x2cf43b['channel']&&_0x2cf43b['interaction']&&_0x2cf43b[_0x88a2('0x18')]['id']){try{var _0x889d30=getId(_0x2cf43b[_0x88a2('0x16')],_0x2cf43b[_0x88a2('0x17')]?_0x2cf43b[_0x88a2('0x17')]['id']:0x0,_0x2cf43b['interaction']?_0x2cf43b[_0x88a2('0x18')]['id']:0x0);if(_0x923706[_0x88a2('0x15')][_0x889d30]){_0x923706['rules'][_0x889d30][_0x88a2('0x38')](_0x88a2('0x40'));}return _0x3887c5({'code':0xc8,'message':_0x2cf43b});}catch(_0x588fcf){logger[_0x88a2('0x31')](_0x588fcf['stack']);return _0x193d5e(_0x33e64c[_0x88a2('0x31')](0x1f4,_0x588fcf));}}logger[_0x88a2('0x31')](_0x88a2('0x47'));return _0x193d5e(_0x33e64c[_0x88a2('0x31')](0x1f4,_0x88a2('0x47')));});},'AgentCapacity':function(_0x9b675d){var _0x50f58c=this;return new Promise(function(_0x9f2786,_0x10327e){if(_0x923706[_0x88a2('0x3d')]['hasOwnProperty'](_0x9b675d['id'])){for(var _0x1b95d3 in _0x9b675d[_0x88a2('0x48')]){if(_0x9b675d['capacity'][_0x88a2('0x49')](_0x1b95d3)){if(_0x923706[_0x88a2('0x3d')][_0x9b675d['id']]['hasOwnProperty'](_0x1b95d3+'CurrentCapacity')){_0x923706[_0x88a2('0x3d')][_0x9b675d['id']][_0x1b95d3+_0x88a2('0x4a')]=parseInt(_0x9b675d['capacity'][_0x1b95d3],0xa);}}}_0x923706[_0x88a2('0x3d')][_0x9b675d['id']][_0x88a2('0x4b')]();return _0x9f2786({'code':0xc8,'message':_0x923706[_0x88a2('0x3d')][_0x9b675d['id']]});}else{return _0x10327e(_0x50f58c[_0x88a2('0x31')](0x1f4,_0x88a2('0x4c')));}});},'Agents':function(_0x35ac79){return new Promise(function(_0x606c52,_0x53519f){var _0x3222f1=_[_0x88a2('0x4d')](_0x923706[_0x88a2('0x3d')]);_0x606c52({'count':_0x3222f1['length'],'rows':_0x3222f1});});},'ChatQueues':function(_0x5bbb2d){return new Promise(function(_0x53f380,_0x3b96ef){var _0x3907e7=[];for(var _0x435077 in _0x923706['chatQueues']){if(_0x923706[_0x88a2('0x4e')][_0x88a2('0x49')](_0x435077)){var _0x33b528=_0x923706[_0x88a2('0x4e')][_0x435077];var _0x25c090={'id':_0x33b528['id'],'available':_0x33b528[_0x88a2('0x4f')],'loggedIn':_0x33b528['loggedIn'],'name':_0x33b528['name'],'paused':_0x33b528[_0x88a2('0x50')],'waiting':_0x33b528['waiting']};_0x3907e7['push'](_0x25c090);}}_0x53f380({'count':_0x3907e7[_0x88a2('0x1b')],'rows':_0x3907e7});});},'MailQueues':function(_0x2cb78a){return new Promise(function(_0x46457c,_0x291f1f){var _0x21b09c=[];for(var _0x53e1af in _0x923706['mailQueues']){if(_0x923706[_0x88a2('0x51')][_0x88a2('0x49')](_0x53e1af)){var _0x1c264a=_0x923706[_0x88a2('0x51')][_0x53e1af];var _0x40bd68={'id':_0x1c264a['id'],'available':_0x1c264a[_0x88a2('0x4f')],'loggedIn':_0x1c264a[_0x88a2('0x52')],'name':_0x1c264a[_0x88a2('0x53')],'paused':_0x1c264a[_0x88a2('0x50')],'waiting':_0x1c264a['waiting']};_0x21b09c['push'](_0x40bd68);}}_0x46457c({'count':_0x21b09c[_0x88a2('0x1b')],'rows':_0x21b09c});});},'OpenchannelQueues':function(_0x21f140){return new Promise(function(_0x48623a,_0x4b3930){var _0x5e538c=[];for(var _0x27ecac in _0x923706[_0x88a2('0x54')]){if(_0x923706[_0x88a2('0x54')][_0x88a2('0x49')](_0x27ecac)){var _0x5638db=_0x923706[_0x88a2('0x54')][_0x27ecac];var _0x3b76bf={'id':_0x5638db['id'],'available':_0x5638db[_0x88a2('0x4f')],'loggedIn':_0x5638db[_0x88a2('0x52')],'name':_0x5638db[_0x88a2('0x53')],'paused':_0x5638db[_0x88a2('0x50')],'waiting':_0x5638db[_0x88a2('0x55')]};_0x5e538c['push'](_0x3b76bf);}}_0x48623a({'count':_0x5e538c['length'],'rows':_0x5e538c});});},'SmsQueues':function(_0x298ae7){return new Promise(function(_0x505211,_0x5f56e2){var _0x1a7619=[];for(var _0x3aaeba in _0x923706[_0x88a2('0x56')]){if(_0x923706[_0x88a2('0x56')][_0x88a2('0x49')](_0x3aaeba)){var _0x58b8b4=_0x923706[_0x88a2('0x56')][_0x3aaeba];var _0x481f44={'id':_0x58b8b4['id'],'available':_0x58b8b4[_0x88a2('0x4f')],'loggedIn':_0x58b8b4['loggedIn'],'name':_0x58b8b4[_0x88a2('0x53')],'paused':_0x58b8b4['paused'],'waiting':_0x58b8b4[_0x88a2('0x55')]};_0x1a7619[_0x88a2('0x22')](_0x481f44);}}_0x505211({'count':_0x1a7619[_0x88a2('0x1b')],'rows':_0x1a7619});});},'FaxQueues':function(_0x34873b){return new Promise(function(_0xcdbd8,_0xd98ec5){var _0x70213e=[];for(var _0x1d6efb in _0x923706[_0x88a2('0x57')]){if(_0x923706[_0x88a2('0x57')]['hasOwnProperty'](_0x1d6efb)){var _0x4784be=_0x923706[_0x88a2('0x57')][_0x1d6efb];var _0x4efe3f={'id':_0x4784be['id'],'available':_0x4784be[_0x88a2('0x4f')],'loggedIn':_0x4784be['loggedIn'],'name':_0x4784be['name'],'paused':_0x4784be[_0x88a2('0x50')],'waiting':_0x4784be[_0x88a2('0x55')]};_0x70213e[_0x88a2('0x22')](_0x4efe3f);}}_0xcdbd8({'count':_0x70213e[_0x88a2('0x1b')],'rows':_0x70213e});});},'WhatsappQueues':function(_0x1f1006){return new Promise(function(_0x2d4f9a,_0x502bdc){var _0x40edff=[];for(var _0x185c5a in _0x923706[_0x88a2('0x58')]){if(_0x923706[_0x88a2('0x58')]['hasOwnProperty'](_0x185c5a)){var _0x5d2deb=_0x923706[_0x88a2('0x58')][_0x185c5a];var _0xbaa029={'id':_0x5d2deb['id'],'available':_0x5d2deb['available'],'loggedIn':_0x5d2deb[_0x88a2('0x52')],'name':_0x5d2deb[_0x88a2('0x53')],'paused':_0x5d2deb[_0x88a2('0x50')],'waiting':_0x5d2deb[_0x88a2('0x55')]};_0x40edff['push'](_0xbaa029);}}_0x2d4f9a({'count':_0x40edff[_0x88a2('0x1b')],'rows':_0x40edff});});},'ChatQueuesWaitingInteractions':function(_0x14c831){return new Promise(function(_0x1db40c,_0x1350b2){var _0x54b65d=_[_0x88a2('0x4d')](_0x923706['chatQueuesWaitingInteractions']);_0x1db40c({'count':_0x54b65d[_0x88a2('0x1b')],'rows':_0x54b65d});});},'MailQueuesWaitingInteractions':function(_0x1452ed){return new Promise(function(_0x17b8bd,_0x59e359){var _0x38a5ad=_[_0x88a2('0x4d')](_0x923706['mailQueuesWaitingInteractions']);_0x17b8bd({'count':_0x38a5ad[_0x88a2('0x1b')],'rows':_0x38a5ad});});},'OpenchannelQueuesWaitingInteractions':function(_0x2cb588){return new Promise(function(_0x1bf412,_0xf9f243){var _0x3f7f74=_[_0x88a2('0x4d')](_0x923706[_0x88a2('0x59')]);_0x1bf412({'count':_0x3f7f74[_0x88a2('0x1b')],'rows':_0x3f7f74});});},'SmsQueuesWaitingInteractions':function(_0x539453){return new Promise(function(_0x527dca,_0x26e7c6){var _0x20d161=_[_0x88a2('0x4d')](_0x923706['smsQueuesWaitingInteractions']);_0x527dca({'count':_0x20d161[_0x88a2('0x1b')],'rows':_0x20d161});});},'FaxQueuesWaitingInteractions':function(_0x4dd6bd){return new Promise(function(_0x24cd6e,_0x442910){var _0x56640b=_[_0x88a2('0x4d')](_0x923706[_0x88a2('0x5a')]);_0x24cd6e({'count':_0x56640b[_0x88a2('0x1b')],'rows':_0x56640b});});},'WhatsappQueuesWaitingInteractions':function(_0x3617ef){return new Promise(function(_0xcb1375,_0x4f628a){var _0x30749e=_[_0x88a2('0x4d')](_0x923706[_0x88a2('0x5b')]);_0xcb1375({'count':_0x30749e[_0x88a2('0x1b')],'rows':_0x30749e});});}};var _0x9d26d1=jayson[_0x88a2('0x5c')](_0x34f19e)[_0x88a2('0x5d')]();_0x9d26d1['on']('error',function(_0x3e5b8f){logger[_0x88a2('0x31')](JSON['stringify'](_0x3e5b8f));return _0x59801e(_0x3e5b8f);});_0x9d26d1[_0x88a2('0x5e')](0x232c,_0x88a2('0x5f'),function(){console['log'](_0x88a2('0x60'),0x232c);return _0x3b83ce(_0x88a2('0x61')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 41e55cc..2da88d7 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 _0xe29e=['../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','jayson/promise'];(function(_0x44fa5e,_0x16271a){var _0x5aa758=function(_0x3314d5){while(--_0x3314d5){_0x44fa5e['push'](_0x44fa5e['shift']());}};_0x5aa758(++_0x16271a);}(_0xe29e,0x73));var _0xee29=function(_0x54e570,_0x85d6c7){_0x54e570=_0x54e570-0x0;var _0x30c30f=_0xe29e[_0x54e570];return _0x30c30f;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require(_0xee29('0x0'));var _=require('lodash');var logger=require(_0xee29('0x1'))(_0xee29('0x2'));var client=jayson[_0xee29('0x3')][_0xee29('0x4')]({'port':0x232a});function request(_0x8fbf6c,_0x59145b){return new BPromise(function(_0x4528d4,_0x37db74){return client[_0xee29('0x5')](_0x8fbf6c,_0x59145b)[_0xee29('0x6')](function(_0x49c235){if(_0x49c235[_0xee29('0x7')]){return _0x37db74(_0x49c235['error'][_0xee29('0x8')]);}else{return _0x4528d4(_0x49c235[_0xee29('0x9')]);}})[_0xee29('0xa')](function(_0x5e1ed9){return _0x37db74(_0x5e1ed9);});});}exports[_0xee29('0xb')]=function(_0x473866,_0x58890c,_0x32a31c){return function(_0x1b81af){if(_0x32a31c[_0xee29('0xc')]&&!_0x32a31c[_0xee29('0xc')][_0x473866]){logger[_0xee29('0xd')](_0xee29('0xe'),_0x473866);return _0x1b81af[_0xee29('0xf')]();}var _0x5f075a=[];for(var _0x5201fb=0x0;_0x5201fb<_0x58890c[_0xee29('0x10')];_0x5201fb+=0x1){_0x5f075a['push'](request(_0xee29('0x11'),{'command':util['format'](_0xee29('0x12'),_0x58890c[_0x5201fb])})['then'](function(_0x186580){return _0x186580&&_0x186580[_0xee29('0x8')]&&_0x186580[_0xee29('0x8')][_0xee29('0x13')](_0xee29('0x14'))>=0x0?!![]:![];})[_0xee29('0xa')](function(_0x32b391){logger['error'](_0xee29('0x15'),_0x473866,_0x58890c[_0x5201fb]);}));}BPromise[_0xee29('0x16')](_0x5f075a)[_0xee29('0x6')](function(_0x1121e1){var _0x300efb=_['some'](_0x1121e1);logger[_0xee29('0xd')](_0xee29('0x17'),_0x473866,_0x58890c[_0xee29('0x18')](_0xee29('0x19')),_0x300efb);_0x1b81af[_0xee29('0x1a')](_0x300efb);})[_0xee29('0xa')](function(_0x2eb5c6){console[_0xee29('0x1b')](_0x2eb5c6);logger[_0xee29('0x7')](_0xee29('0x17'),_0x473866,_0x58890c['join'](_0xee29('0x19')),_0x2eb5c6[_0xee29('0x1c')]);_0x1b81af[_0xee29('0xf')]();});};}; \ No newline at end of file +var _0x817a=['stack','stop','util','jayson/promise','lodash','routing','client','http','request','then','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','iftime\x20%s','message','indexOf','error','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','when','log','join'];(function(_0x363842,_0x369636){var _0x257bc2=function(_0x2516cf){while(--_0x2516cf){_0x363842['push'](_0x363842['shift']());}};_0x257bc2(++_0x369636);}(_0x817a,0x8e));var _0xa817=function(_0xa30bf0,_0x200dd8){_0xa30bf0=_0xa30bf0-0x0;var _0x3b4ca5=_0x817a[_0xa30bf0];return _0x3b4ca5;};'use strict';var util=require(_0xa817('0x0'));var BPromise=require('bluebird');var jayson=require(_0xa817('0x1'));var _=require(_0xa817('0x2'));var logger=require('../../../config/logger')(_0xa817('0x3'));var client=jayson[_0xa817('0x4')][_0xa817('0x5')]({'port':0x232a});function request(_0x5619ab,_0x40e099){return new BPromise(function(_0x4f58fd,_0x6ee871){return client[_0xa817('0x6')](_0x5619ab,_0x40e099)[_0xa817('0x7')](function(_0xf5734c){if(_0xf5734c['error']){return _0x6ee871(_0xf5734c['error']['message']);}else{return _0x4f58fd(_0xf5734c['result']);}})[_0xa817('0x8')](function(_0x4fccf2){return _0x6ee871(_0x4fccf2);});});}exports[_0xa817('0x9')]=function(_0x1efa6f,_0x49360c,_0x6ada86){return function(_0x5ad5de){if(_0x6ada86['rules']&&!_0x6ada86[_0xa817('0xa')][_0x1efa6f]){logger[_0xa817('0xb')](_0xa817('0xc'),_0x1efa6f);return _0x5ad5de['stop']();}var _0x27836d=[];for(var _0x39107c=0x0;_0x39107c<_0x49360c[_0xa817('0xd')];_0x39107c+=0x1){_0x27836d[_0xa817('0xe')](request(_0xa817('0xf'),{'command':util['format'](_0xa817('0x10'),_0x49360c[_0x39107c])})[_0xa817('0x7')](function(_0x10ed91){return _0x10ed91&&_0x10ed91[_0xa817('0x11')]&&_0x10ed91['message'][_0xa817('0x12')]('true')>=0x0?!![]:![];})[_0xa817('0x8')](function(_0x48864e){logger[_0xa817('0x13')](_0xa817('0x14'),_0x1efa6f,_0x49360c[_0x39107c]);}));}BPromise[_0xa817('0x15')](_0x27836d)[_0xa817('0x7')](function(_0x39b941){var _0x319817=_['some'](_0x39b941);logger[_0xa817('0xb')](_0xa817('0x16'),_0x1efa6f,_0x49360c['join']('\x20|\x20'),_0x319817);_0x5ad5de[_0xa817('0x17')](_0x319817);})[_0xa817('0x8')](function(_0x4e4560){console[_0xa817('0x18')](_0x4e4560);logger['error'](_0xa817('0x16'),_0x1efa6f,_0x49360c[_0xa817('0x19')]('\x20|\x20'),_0x4e4560[_0xa817('0x1a')]);_0x5ad5de[_0xa817('0x1b')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 4bfb14f..d7c31e1 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 _0x34f4=['called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','timeout','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinenum','answered_elsewhere','agentcompleteAt','diffTime','agentconnectAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','transferexten','extension','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','transferuniqueid','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','complete','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','agentcalledAt','now'];(function(_0x353c13,_0x214157){var _0x589cb0=function(_0x186357){while(--_0x186357){_0x353c13['push'](_0x353c13['shift']());}};_0x589cb0(++_0x214157);}(_0x34f4,0x136));var _0x434f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x34f4[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x434f('0x0'));var util=require(_0x434f('0x1'));var utils=require(_0x434f('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2d88a5,_0x3f64c7){utils[_0x434f('0x3')](util[_0x434f('0x4')](_0x434f('0x5'),_0x2d88a5[_0x434f('0x6')],_0x2d88a5[_0x434f('0x7')],_0x2d88a5[_0x434f('0x8')],_0x2d88a5[_0x434f('0x9')],_0x2d88a5['interface'],_0x2d88a5[_0x434f('0xa')],_0x2d88a5['connectedlinenum'],_0x2d88a5[_0x434f('0xb')]));if(_0x2d88a5[_0x434f('0x8')]){utils[_0x434f('0xc')](_0x2d88a5['queue'])['then'](function(_0x546b81){if(_0x546b81){_0x2d88a5[_0x434f('0xd')]=_0x546b81[_0x434f('0xd')];_0x2d88a5[_0x434f('0xe')]=_0x2d88a5[_0x434f('0xf')]?_0x546b81[_0x434f('0x10')]:![];_0x2d88a5[_0x434f('0x11')]=_0x2d88a5['agentacw']?_0x546b81[_0x434f('0x12')]:0x0;}utils[_0x434f('0x13')]('CreateVoiceAgentReport',_0x2d88a5);});}else{utils[_0x434f('0x13')](_0x434f('0x14'),_0x2d88a5);}if(_0x3f64c7){delete transfers[_0x2d88a5[_0x434f('0x6')]];}else{delete agents[_0x2d88a5[_0x434f('0x15')]];}}exports[_0x434f('0x16')]=function(_0x52ef0d){try{utils[_0x434f('0x17')](util[_0x434f('0x4')]('[%s][agents][agentcalled]',_0x52ef0d[_0x434f('0x6')]),_0x52ef0d);agents[_0x52ef0d[_0x434f('0x15')]]=_0x52ef0d;agents[_0x52ef0d[_0x434f('0x15')]][_0x434f('0x18')]=utils[_0x434f('0x19')]();agents[_0x52ef0d['destuniqueid']]['lastevent']=_0x434f('0x1a');agents[_0x52ef0d[_0x434f('0x15')]]['connectedlinenum']=null;agents[_0x52ef0d[_0x434f('0x15')]][_0x434f('0x1b')]=null;utils['info'](util[_0x434f('0x4')](_0x434f('0x1c'),_0x52ef0d['uniqueid'],agents[_0x52ef0d[_0x434f('0x15')]][_0x434f('0x9')],_0x52ef0d[_0x434f('0x15')]));}catch(_0x570e11){utils[_0x434f('0x1d')](util[_0x434f('0x4')]('[%s][agents][agentcalled]',_0x52ef0d['uniqueid']),_0x570e11);}};exports[_0x434f('0x1e')]=function(_0x47f9fd){try{if(!_[_0x434f('0x1f')](agents[_0x47f9fd['destuniqueid']])){utils[_0x434f('0x17')](util[_0x434f('0x4')](_0x434f('0x20'),_0x47f9fd[_0x434f('0x6')]),_0x47f9fd);utils[_0x434f('0x3')](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x47f9fd[_0x434f('0x6')],agents[_0x47f9fd[_0x434f('0x15')]][_0x434f('0x9')],_0x47f9fd[_0x434f('0x15')]));agents[_0x47f9fd[_0x434f('0x15')]][_0x434f('0x1e')]=!![];agents[_0x47f9fd[_0x434f('0x15')]][_0x434f('0x21')]=utils[_0x434f('0x19')]();agents[_0x47f9fd['destuniqueid']][_0x434f('0xb')]='timeout';agents[_0x47f9fd[_0x434f('0x15')]][_0x434f('0x22')]=_0x434f('0x23');agents[_0x47f9fd[_0x434f('0x15')]]['holdtime']=_0x47f9fd[_0x434f('0x24')]?parseInt(_0x47f9fd[_0x434f('0x24')])/0x3e8:0x0;agents[_0x47f9fd[_0x434f('0x15')]][_0x434f('0x25')]=0x0;unanswered[_0x434f('0x26')](_0x47f9fd[_0x434f('0x15')]);}}catch(_0x5f0c10){utils[_0x434f('0x1d')](util[_0x434f('0x4')](_0x434f('0x20'),_0x47f9fd[_0x434f('0x6')]),_0x5f0c10);}};exports[_0x434f('0x27')]=function(_0x50feb6){try{_[_0x434f('0x28')](agents,function(_0x280872,_0x361221){if(_0x280872[_0x434f('0x6')]==_0x50feb6[_0x434f('0x6')]&&!_[_0x434f('0x29')](unanswered,_0x280872[_0x434f('0x15')])){utils['debug'](util[_0x434f('0x4')](_0x434f('0x2a'),_0x50feb6[_0x434f('0x6')]),_0x50feb6);utils[_0x434f('0x3')](util[_0x434f('0x4')](_0x434f('0x2b'),_0x50feb6[_0x434f('0x6')],_0x280872[_0x434f('0x9')],_0x280872[_0x434f('0x15')]));_0x280872[_0x434f('0x1e')]=!![];_0x280872[_0x434f('0x21')]=utils[_0x434f('0x19')]();_0x280872[_0x434f('0xb')]='abandoned';_0x280872[_0x434f('0x22')]=_0x434f('0x2c');_0x280872[_0x434f('0x2d')]=_0x50feb6[_0x434f('0x2d')];_0x280872['talktime']=0x0;writeDB(_0x280872);}});}catch(_0x5345cb){utils[_0x434f('0x1d')](util[_0x434f('0x4')](_0x434f('0x2a'),_0x50feb6[_0x434f('0x6')]),_0x5345cb);}};exports[_0x434f('0x2e')]=function(_0x473bf1){try{if(agents[_0x473bf1[_0x434f('0x15')]]){utils['debug'](util[_0x434f('0x4')](_0x434f('0x2f'),_0x473bf1[_0x434f('0x6')]),_0x473bf1);utils[_0x434f('0x3')](util[_0x434f('0x4')](_0x434f('0x30'),_0x473bf1[_0x434f('0x6')],agents[_0x473bf1[_0x434f('0x15')]][_0x434f('0x9')],_0x473bf1[_0x434f('0x15')]));agents[_0x473bf1[_0x434f('0x15')]]['agentconnectAt']=utils[_0x434f('0x19')]();agents[_0x473bf1[_0x434f('0x15')]][_0x434f('0x31')]=_0x473bf1[_0x434f('0x31')];agents[_0x473bf1[_0x434f('0x15')]]['connectedlinename']=_0x473bf1[_0x434f('0x1b')];agents[_0x473bf1[_0x434f('0x15')]][_0x434f('0x2d')]=_0x473bf1[_0x434f('0x24')];agents[_0x473bf1['destuniqueid']]['lastevent']='connect';_['forIn'](agents,function(_0x512a97,_0x34a000){if(_0x512a97['destuniqueid']!=_0x473bf1[_0x434f('0x15')]&&_0x512a97[_0x434f('0x6')]==_0x473bf1[_0x434f('0x6')]){_0x512a97['talktime']=0x0;_0x512a97[_0x434f('0x2d')]=_0x473bf1['ringtime'];_0x512a97['agentringnoanswer']=!![];_0x512a97['agentringnoanswerAt']=utils[_0x434f('0x19')]();_0x512a97['lastevent']='answered_elsewhere';_0x512a97[_0x434f('0x22')]=_0x434f('0x32');_0x512a97['answeredelsewheredestinationuniqueid']=_0x473bf1[_0x434f('0x15')];_0x512a97['answeredelsewheremembername']=_0x473bf1[_0x434f('0x9')];writeDB(_0x512a97);}});}}catch(_0x67d20f){utils[_0x434f('0x1d')](util[_0x434f('0x4')](_0x434f('0x2f'),_0x473bf1[_0x434f('0x6')]),_0x67d20f);}};exports[_0x434f('0xf')]=function(_0x5c575d){try{if(!_['isNil'](agents[_0x5c575d[_0x434f('0x15')]])){utils[_0x434f('0x17')](util['format']('[%s][agents][agentcomplete]',_0x5c575d['uniqueid']),_0x5c575d);utils[_0x434f('0x3')](util[_0x434f('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5c575d[_0x434f('0x6')],agents[_0x5c575d[_0x434f('0x15')]][_0x434f('0x9')],_0x5c575d[_0x434f('0x15')]));agents[_0x5c575d[_0x434f('0x15')]]['agentcomplete']=!![];agents[_0x5c575d[_0x434f('0x15')]][_0x434f('0x33')]=utils[_0x434f('0x19')]();agents[_0x5c575d[_0x434f('0x15')]][_0x434f('0x25')]=utils[_0x434f('0x34')](agents[_0x5c575d[_0x434f('0x15')]][_0x434f('0x33')],agents[_0x5c575d[_0x434f('0x15')]][_0x434f('0x35')]);agents[_0x5c575d[_0x434f('0x15')]]['reason']=_0x5c575d[_0x434f('0x22')];agents[_0x5c575d['destuniqueid']]['lastevent']='complete';writeDB(agents[_0x5c575d['destuniqueid']]);}}catch(_0x183935){utils[_0x434f('0x1d')](util['format']('[%s][agents][agentcomplete]',_0x5c575d[_0x434f('0x6')]),_0x183935);}};exports[_0x434f('0x36')]=function(_0x56a84b){try{if(!_[_0x434f('0x1f')](agents[_0x56a84b[_0x434f('0x37')]])){utils['debug'](util[_0x434f('0x4')](_0x434f('0x38'),_0x56a84b[_0x434f('0x6')]),_0x56a84b);utils[_0x434f('0x3')](util[_0x434f('0x4')](_0x434f('0x39'),_0x56a84b[_0x434f('0x6')],agents[_0x56a84b['transfereruniqueid']]['membername'],agents[_0x56a84b[_0x434f('0x37')]][_0x434f('0x6')]));agents[_0x56a84b['transfereruniqueid']]['transfer']=!![];agents[_0x56a84b[_0x434f('0x37')]][_0x434f('0x3a')]=_0x434f('0x3b');agents[_0x56a84b['transfereruniqueid']][_0x434f('0x3c')]=_0x56a84b[_0x434f('0x3d')];agents[_0x56a84b[_0x434f('0x37')]]['transferuniqueid']=agents[_0x56a84b[_0x434f('0x37')]][_0x434f('0x6')];}}catch(_0x24d66f){utils[_0x434f('0x1d')](util[_0x434f('0x4')](_0x434f('0x38'),_0x56a84b['uniqueid']),_0x24d66f);}};exports[_0x434f('0x3e')]=function(_0x1fffc2){try{utils[_0x434f('0x17')](util[_0x434f('0x4')]('[%s][agents][attendedtransfer]',_0x1fffc2['origtransfereruniqueid']),_0x1fffc2);if(_0x1fffc2[_0x434f('0x3f')]==_0x1fffc2['origtransfererlinkedid']){if(!_['isNil'](agents[_0x1fffc2[_0x434f('0x40')]])){utils[_0x434f('0x3')](util[_0x434f('0x4')](_0x434f('0x41'),_0x1fffc2[_0x434f('0x3f')],agents[_0x1fffc2[_0x434f('0x40')]]['membername']));agents[_0x1fffc2[_0x434f('0x40')]][_0x434f('0x42')]=!![];agents[_0x1fffc2[_0x434f('0x40')]][_0x434f('0x3a')]=_0x434f('0x43');agents[_0x1fffc2[_0x434f('0x40')]][_0x434f('0x3c')]=_0x1fffc2['origtransfererexten'];agents[_0x1fffc2[_0x434f('0x40')]]['transferuniqueid']=_0x1fffc2[_0x434f('0x3f')];}if(_0x1fffc2[_0x434f('0x44')]&&agents[_0x1fffc2[_0x434f('0x44')]]){agents[_0x1fffc2[_0x434f('0x44')]]['agententerreason']=0x1;transfers[_0x1fffc2[_0x434f('0x44')]]=_[_0x434f('0x45')](agents[_0x1fffc2[_0x434f('0x44')]]);transfers[_0x1fffc2[_0x434f('0x44')]][_0x434f('0xa')]=agents[_0x1fffc2['secondtransfereruniqueid']]['calleridnum'];transfers[_0x1fffc2[_0x434f('0x44')]][_0x434f('0x46')]=agents[_0x1fffc2[_0x434f('0x40')]]['calleridname'];transfers[_0x1fffc2[_0x434f('0x44')]]['agentcalledAt']=utils[_0x434f('0x19')]();transfers[_0x1fffc2[_0x434f('0x44')]][_0x434f('0x35')]=utils[_0x434f('0x19')]();transfers[_0x1fffc2['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x1fffc2['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x1fffc2[_0x434f('0x40')]==_0x1fffc2[_0x434f('0x47')]){if(!_[_0x434f('0x1f')](agents[_0x1fffc2[_0x434f('0x3f')]])){utils[_0x434f('0x3')](util[_0x434f('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1fffc2[_0x434f('0x3f')],agents[_0x1fffc2['origtransfereruniqueid']][_0x434f('0x9')]));agents[_0x1fffc2[_0x434f('0x3f')]][_0x434f('0x42')]=!![];agents[_0x1fffc2[_0x434f('0x3f')]][_0x434f('0x3a')]='ATTENDED';agents[_0x1fffc2['origtransfereruniqueid']][_0x434f('0x3c')]=_0x1fffc2['secondtransfererexten'];agents[_0x1fffc2['origtransfereruniqueid']][_0x434f('0x48')]=_0x1fffc2[_0x434f('0x40')];}if(_0x1fffc2[_0x434f('0x49')]&&agents[_0x1fffc2['transfertargetuniqueid']]){agents[_0x1fffc2[_0x434f('0x49')]][_0x434f('0x4a')]=0x1;transfers[_0x1fffc2[_0x434f('0x49')]]=_['clone'](agents[_0x1fffc2['transfertargetuniqueid']]);transfers[_0x1fffc2['transfertargetuniqueid']][_0x434f('0xa')]=agents[_0x1fffc2['origtransfereruniqueid']][_0x434f('0xa')];transfers[_0x1fffc2[_0x434f('0x49')]][_0x434f('0x46')]=agents[_0x1fffc2[_0x434f('0x3f')]]['calleridname'];transfers[_0x1fffc2[_0x434f('0x49')]][_0x434f('0x18')]=utils[_0x434f('0x19')]();transfers[_0x1fffc2[_0x434f('0x49')]][_0x434f('0x35')]=utils[_0x434f('0x19')]();transfers[_0x1fffc2['transfertargetuniqueid']][_0x434f('0x2d')]=0x0;transfers[_0x1fffc2[_0x434f('0x49')]][_0x434f('0x4a')]=0x2;}}}catch(_0x3cf591){utils[_0x434f('0x1d')](util['format']('[%s][agents][attendedtransfer]',_0x1fffc2['origtransfereruniqueid']),_0x3cf591);}};exports[_0x434f('0x4b')]=function(_0x2d560f){try{utils[_0x434f('0x17')](util[_0x434f('0x4')](_0x434f('0x4c'),_0x2d560f[_0x434f('0x6')]),_0x2d560f);if(agents[_0x2d560f[_0x434f('0x6')]]&&agents[_0x2d560f[_0x434f('0x6')]][_0x434f('0x22')]===_0x434f('0x23')){if(_0x2d560f[_0x434f('0x4d')]==='21'){agents[_0x2d560f[_0x434f('0x6')]]['reason']=_0x434f('0x4e');agents[_0x2d560f[_0x434f('0x6')]]['lastevent']=_0x434f('0x4e');}utils['info'](util['format'](_0x434f('0x4f'),_0x2d560f['uniqueid'],agents[_0x2d560f[_0x434f('0x6')]]['membername'],agents[_0x2d560f[_0x434f('0x6')]]['reason'],agents[_0x2d560f['uniqueid']][_0x434f('0xb')]));writeDB(agents[_0x2d560f[_0x434f('0x6')]]);var _0x416034=unanswered[_0x434f('0x50')](_0x2d560f[_0x434f('0x6')]);if(_0x416034>-0x1){unanswered[_0x434f('0x51')](_0x416034,0x1);}}if(transfers[_0x2d560f[_0x434f('0x6')]]){transfers[_0x2d560f[_0x434f('0x6')]][_0x434f('0xf')]=!![];transfers[_0x2d560f['uniqueid']]['agentcompleteAt']=utils[_0x434f('0x19')]();transfers[_0x2d560f[_0x434f('0x6')]][_0x434f('0x25')]=utils[_0x434f('0x34')](transfers[_0x2d560f[_0x434f('0x6')]][_0x434f('0x33')],transfers[_0x2d560f[_0x434f('0x6')]][_0x434f('0x35')]);transfers[_0x2d560f[_0x434f('0x6')]][_0x434f('0x22')]='agent';transfers[_0x2d560f['uniqueid']]['lastevent']=_0x434f('0x52');utils['info'](util['format'](_0x434f('0x4f'),_0x2d560f['uniqueid'],transfers[_0x2d560f[_0x434f('0x6')]][_0x434f('0x9')],transfers[_0x2d560f[_0x434f('0x6')]][_0x434f('0x22')],transfers[_0x2d560f[_0x434f('0x6')]][_0x434f('0xb')]));writeDB(transfers[_0x2d560f['uniqueid']],!![]);}if(agents[_0x2d560f[_0x434f('0x6')]]&&agents[_0x2d560f[_0x434f('0x6')]]['agentconnectAt']){agents[_0x2d560f[_0x434f('0x6')]]['agentcomplete']=!![];agents[_0x2d560f[_0x434f('0x6')]][_0x434f('0x33')]=utils['now']();agents[_0x2d560f[_0x434f('0x6')]][_0x434f('0x25')]=utils[_0x434f('0x34')](agents[_0x2d560f['uniqueid']][_0x434f('0x33')],agents[_0x2d560f[_0x434f('0x6')]][_0x434f('0x35')]);agents[_0x2d560f[_0x434f('0x6')]][_0x434f('0x22')]=agents[_0x2d560f[_0x434f('0x6')]]['transfer']?'transfer':_0x434f('0x53');agents[_0x2d560f[_0x434f('0x6')]][_0x434f('0xb')]=_0x434f('0x52');utils['info'](util[_0x434f('0x4')](_0x434f('0x4f'),_0x2d560f['uniqueid'],agents[_0x2d560f['uniqueid']][_0x434f('0x9')],agents[_0x2d560f['uniqueid']]['reason'],agents[_0x2d560f[_0x434f('0x6')]][_0x434f('0xb')]));writeDB(agents[_0x2d560f[_0x434f('0x6')]]);}}catch(_0x539c6c){utils[_0x434f('0x1d')](util[_0x434f('0x4')](_0x434f('0x4c'),_0x2d560f[_0x434f('0x6')]),_0x539c6c);}}; \ No newline at end of file +var _0x6320=['lastevent','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','destuniqueid','agentcalledAt','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','timeout','reason','ringtime','queuecallerabandon','forIn','[%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','agentconnectAt','talktime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfereeuniqueid','clone','calleridname','agententerreason','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','indexOf','splice','agent','lodash','util','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum'];(function(_0x46d61f,_0x26608d){var _0x4f26b4=function(_0x55ebe0){while(--_0x55ebe0){_0x46d61f['push'](_0x46d61f['shift']());}};_0x4f26b4(++_0x26608d);}(_0x6320,0x13a));var _0x0632=function(_0xbdc17f,_0x5b378c){_0xbdc17f=_0xbdc17f-0x0;var _0x59a9db=_0x6320[_0xbdc17f];return _0x59a9db;};'use strict';var _=require(_0x0632('0x0'));var util=require(_0x0632('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x538acf,_0x99f41e){utils['info'](util[_0x0632('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x538acf[_0x0632('0x3')],_0x538acf[_0x0632('0x4')],_0x538acf[_0x0632('0x5')],_0x538acf[_0x0632('0x6')],_0x538acf[_0x0632('0x7')],_0x538acf[_0x0632('0x8')],_0x538acf[_0x0632('0x9')],_0x538acf[_0x0632('0xa')]));if(_0x538acf[_0x0632('0x5')]){utils['getVoiceQueueByName'](_0x538acf[_0x0632('0x5')])[_0x0632('0xb')](function(_0x3b1b10){if(_0x3b1b10){_0x538acf[_0x0632('0xc')]=_0x3b1b10[_0x0632('0xc')];_0x538acf[_0x0632('0xd')]=_0x538acf[_0x0632('0xe')]?_0x3b1b10[_0x0632('0xf')]:![];_0x538acf[_0x0632('0x10')]=_0x538acf[_0x0632('0xd')]?_0x3b1b10[_0x0632('0x11')]:0x0;}utils[_0x0632('0x12')]('CreateVoiceAgentReport',_0x538acf);});}else{utils['request']('CreateVoiceAgentReport',_0x538acf);}if(_0x99f41e){delete transfers[_0x538acf['uniqueid']];}else{delete agents[_0x538acf[_0x0632('0x13')]];}}exports['agentcalled']=function(_0xa99ced){try{utils['debug'](util[_0x0632('0x2')]('[%s][agents][agentcalled]',_0xa99ced[_0x0632('0x3')]),_0xa99ced);agents[_0xa99ced[_0x0632('0x13')]]=_0xa99ced;agents[_0xa99ced['destuniqueid']][_0x0632('0x14')]=utils['now']();agents[_0xa99ced[_0x0632('0x13')]][_0x0632('0xa')]=_0x0632('0x15');agents[_0xa99ced[_0x0632('0x13')]][_0x0632('0x9')]=null;agents[_0xa99ced[_0x0632('0x13')]][_0x0632('0x16')]=null;utils[_0x0632('0x17')](util[_0x0632('0x2')](_0x0632('0x18'),_0xa99ced['uniqueid'],agents[_0xa99ced['destuniqueid']][_0x0632('0x6')],_0xa99ced[_0x0632('0x13')]));}catch(_0xf71d1b){utils[_0x0632('0x19')](util[_0x0632('0x2')](_0x0632('0x1a'),_0xa99ced['uniqueid']),_0xf71d1b);}};exports[_0x0632('0x1b')]=function(_0x480415){try{if(!_[_0x0632('0x1c')](agents[_0x480415[_0x0632('0x13')]])){utils[_0x0632('0x1d')](util[_0x0632('0x2')](_0x0632('0x1e'),_0x480415[_0x0632('0x3')]),_0x480415);utils['info'](util[_0x0632('0x2')](_0x0632('0x1f'),_0x480415[_0x0632('0x3')],agents[_0x480415[_0x0632('0x13')]][_0x0632('0x6')],_0x480415[_0x0632('0x13')]));agents[_0x480415[_0x0632('0x13')]][_0x0632('0x1b')]=!![];agents[_0x480415[_0x0632('0x13')]][_0x0632('0x20')]=utils[_0x0632('0x21')]();agents[_0x480415[_0x0632('0x13')]]['lastevent']=_0x0632('0x22');agents[_0x480415[_0x0632('0x13')]][_0x0632('0x23')]=_0x0632('0x22');agents[_0x480415[_0x0632('0x13')]]['holdtime']=_0x480415[_0x0632('0x24')]?parseInt(_0x480415[_0x0632('0x24')])/0x3e8:0x0;agents[_0x480415[_0x0632('0x13')]]['talktime']=0x0;unanswered['push'](_0x480415[_0x0632('0x13')]);}}catch(_0x13ca39){utils['error'](util[_0x0632('0x2')](_0x0632('0x1e'),_0x480415[_0x0632('0x3')]),_0x13ca39);}};exports[_0x0632('0x25')]=function(_0x47edb6){try{_[_0x0632('0x26')](agents,function(_0x4da50e,_0x5d5f15){if(_0x4da50e[_0x0632('0x3')]==_0x47edb6[_0x0632('0x3')]&&!_['includes'](unanswered,_0x4da50e[_0x0632('0x13')])){utils[_0x0632('0x1d')](util['format'](_0x0632('0x27'),_0x47edb6[_0x0632('0x3')]),_0x47edb6);utils[_0x0632('0x17')](util[_0x0632('0x2')](_0x0632('0x28'),_0x47edb6['uniqueid'],_0x4da50e[_0x0632('0x6')],_0x4da50e['destuniqueid']));_0x4da50e[_0x0632('0x1b')]=!![];_0x4da50e['agentringnoanswerAt']=utils[_0x0632('0x21')]();_0x4da50e[_0x0632('0xa')]=_0x0632('0x29');_0x4da50e[_0x0632('0x23')]='abandoned';_0x4da50e[_0x0632('0x2a')]=_0x47edb6['holdtime'];_0x4da50e['talktime']=0x0;writeDB(_0x4da50e);}});}catch(_0x31a9da){utils['error'](util['format'](_0x0632('0x27'),_0x47edb6['uniqueid']),_0x31a9da);}};exports['agentconnect']=function(_0x5e1fc5){try{if(agents[_0x5e1fc5['destuniqueid']]){utils[_0x0632('0x1d')](util[_0x0632('0x2')](_0x0632('0x2b'),_0x5e1fc5[_0x0632('0x3')]),_0x5e1fc5);utils[_0x0632('0x17')](util['format'](_0x0632('0x2c'),_0x5e1fc5[_0x0632('0x3')],agents[_0x5e1fc5[_0x0632('0x13')]]['membername'],_0x5e1fc5[_0x0632('0x13')]));agents[_0x5e1fc5[_0x0632('0x13')]][_0x0632('0x2d')]=utils['now']();agents[_0x5e1fc5[_0x0632('0x13')]][_0x0632('0x9')]=_0x5e1fc5[_0x0632('0x9')];agents[_0x5e1fc5['destuniqueid']][_0x0632('0x16')]=_0x5e1fc5['connectedlinename'];agents[_0x5e1fc5[_0x0632('0x13')]][_0x0632('0x2a')]=_0x5e1fc5['ringtime'];agents[_0x5e1fc5[_0x0632('0x13')]][_0x0632('0xa')]='connect';_['forIn'](agents,function(_0x5c69b4,_0xda3a28){if(_0x5c69b4[_0x0632('0x13')]!=_0x5e1fc5['destuniqueid']&&_0x5c69b4[_0x0632('0x3')]==_0x5e1fc5[_0x0632('0x3')]){_0x5c69b4[_0x0632('0x2e')]=0x0;_0x5c69b4[_0x0632('0x2a')]=_0x5e1fc5[_0x0632('0x24')];_0x5c69b4['agentringnoanswer']=!![];_0x5c69b4[_0x0632('0x20')]=utils[_0x0632('0x21')]();_0x5c69b4['lastevent']=_0x0632('0x2f');_0x5c69b4[_0x0632('0x23')]=_0x0632('0x2f');_0x5c69b4[_0x0632('0x30')]=_0x5e1fc5['destuniqueid'];_0x5c69b4[_0x0632('0x31')]=_0x5e1fc5['membername'];writeDB(_0x5c69b4);}});}}catch(_0x4fcf6f){utils[_0x0632('0x19')](util[_0x0632('0x2')](_0x0632('0x2b'),_0x5e1fc5[_0x0632('0x3')]),_0x4fcf6f);}};exports[_0x0632('0xe')]=function(_0x4c2bb5){try{if(!_[_0x0632('0x1c')](agents[_0x4c2bb5['destuniqueid']])){utils[_0x0632('0x1d')](util[_0x0632('0x2')](_0x0632('0x32'),_0x4c2bb5[_0x0632('0x3')]),_0x4c2bb5);utils[_0x0632('0x17')](util[_0x0632('0x2')](_0x0632('0x33'),_0x4c2bb5[_0x0632('0x3')],agents[_0x4c2bb5['destuniqueid']]['membername'],_0x4c2bb5['destuniqueid']));agents[_0x4c2bb5[_0x0632('0x13')]][_0x0632('0xe')]=!![];agents[_0x4c2bb5[_0x0632('0x13')]][_0x0632('0x34')]=utils['now']();agents[_0x4c2bb5['destuniqueid']]['talktime']=utils[_0x0632('0x35')](agents[_0x4c2bb5[_0x0632('0x13')]][_0x0632('0x34')],agents[_0x4c2bb5[_0x0632('0x13')]][_0x0632('0x2d')]);agents[_0x4c2bb5[_0x0632('0x13')]]['reason']=_0x4c2bb5[_0x0632('0x23')];agents[_0x4c2bb5[_0x0632('0x13')]]['lastevent']=_0x0632('0x36');writeDB(agents[_0x4c2bb5['destuniqueid']]);}}catch(_0x15e9dc){utils[_0x0632('0x19')](util[_0x0632('0x2')](_0x0632('0x32'),_0x4c2bb5[_0x0632('0x3')]),_0x15e9dc);}};exports['blindtransfer']=function(_0x95f601){try{if(!_['isNil'](agents[_0x95f601[_0x0632('0x37')]])){utils[_0x0632('0x1d')](util[_0x0632('0x2')](_0x0632('0x38'),_0x95f601[_0x0632('0x3')]),_0x95f601);utils[_0x0632('0x17')](util[_0x0632('0x2')](_0x0632('0x39'),_0x95f601[_0x0632('0x3')],agents[_0x95f601[_0x0632('0x37')]][_0x0632('0x6')],agents[_0x95f601[_0x0632('0x37')]]['uniqueid']));agents[_0x95f601['transfereruniqueid']][_0x0632('0x3a')]=!![];agents[_0x95f601['transfereruniqueid']][_0x0632('0x3b')]=_0x0632('0x3c');agents[_0x95f601[_0x0632('0x37')]][_0x0632('0x3d')]=_0x95f601[_0x0632('0x3e')];agents[_0x95f601[_0x0632('0x37')]][_0x0632('0x3f')]=agents[_0x95f601['transfereruniqueid']][_0x0632('0x3')];}}catch(_0x19329f){utils[_0x0632('0x19')](util[_0x0632('0x2')](_0x0632('0x38'),_0x95f601[_0x0632('0x3')]),_0x19329f);}};exports[_0x0632('0x40')]=function(_0x58c44b){try{utils[_0x0632('0x1d')](util[_0x0632('0x2')]('[%s][agents][attendedtransfer]',_0x58c44b[_0x0632('0x41')]),_0x58c44b);if(_0x58c44b['origtransfereruniqueid']==_0x58c44b[_0x0632('0x42')]){if(!_[_0x0632('0x1c')](agents[_0x58c44b[_0x0632('0x43')]])){utils[_0x0632('0x17')](util[_0x0632('0x2')](_0x0632('0x44'),_0x58c44b[_0x0632('0x41')],agents[_0x58c44b[_0x0632('0x43')]]['membername']));agents[_0x58c44b[_0x0632('0x43')]][_0x0632('0x3a')]=!![];agents[_0x58c44b[_0x0632('0x43')]][_0x0632('0x3b')]='ATTENDED';agents[_0x58c44b[_0x0632('0x43')]][_0x0632('0x3d')]=_0x58c44b['origtransfererexten'];agents[_0x58c44b[_0x0632('0x43')]][_0x0632('0x3f')]=_0x58c44b[_0x0632('0x41')];}if(_0x58c44b[_0x0632('0x45')]&&agents[_0x58c44b[_0x0632('0x45')]]){agents[_0x58c44b[_0x0632('0x45')]]['agententerreason']=0x1;transfers[_0x58c44b[_0x0632('0x45')]]=_[_0x0632('0x46')](agents[_0x58c44b[_0x0632('0x45')]]);transfers[_0x58c44b[_0x0632('0x45')]][_0x0632('0x8')]=agents[_0x58c44b[_0x0632('0x43')]][_0x0632('0x8')];transfers[_0x58c44b[_0x0632('0x45')]]['calleridname']=agents[_0x58c44b[_0x0632('0x43')]][_0x0632('0x47')];transfers[_0x58c44b[_0x0632('0x45')]][_0x0632('0x14')]=utils[_0x0632('0x21')]();transfers[_0x58c44b['transfereeuniqueid']][_0x0632('0x2d')]=utils[_0x0632('0x21')]();transfers[_0x58c44b[_0x0632('0x45')]][_0x0632('0x2a')]=0x0;transfers[_0x58c44b[_0x0632('0x45')]][_0x0632('0x48')]=0x2;}}else if(_0x58c44b[_0x0632('0x43')]==_0x58c44b['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x58c44b[_0x0632('0x41')]])){utils[_0x0632('0x17')](util[_0x0632('0x2')](_0x0632('0x44'),_0x58c44b[_0x0632('0x41')],agents[_0x58c44b[_0x0632('0x41')]][_0x0632('0x6')]));agents[_0x58c44b[_0x0632('0x41')]][_0x0632('0x3a')]=!![];agents[_0x58c44b[_0x0632('0x41')]][_0x0632('0x3b')]=_0x0632('0x49');agents[_0x58c44b[_0x0632('0x41')]]['transferexten']=_0x58c44b[_0x0632('0x4a')];agents[_0x58c44b[_0x0632('0x41')]][_0x0632('0x3f')]=_0x58c44b[_0x0632('0x43')];}if(_0x58c44b['transfertargetuniqueid']&&agents[_0x58c44b['transfertargetuniqueid']]){agents[_0x58c44b[_0x0632('0x4b')]][_0x0632('0x48')]=0x1;transfers[_0x58c44b[_0x0632('0x4b')]]=_[_0x0632('0x46')](agents[_0x58c44b[_0x0632('0x4b')]]);transfers[_0x58c44b['transfertargetuniqueid']][_0x0632('0x8')]=agents[_0x58c44b[_0x0632('0x41')]][_0x0632('0x8')];transfers[_0x58c44b[_0x0632('0x4b')]][_0x0632('0x47')]=agents[_0x58c44b['origtransfereruniqueid']][_0x0632('0x47')];transfers[_0x58c44b[_0x0632('0x4b')]]['agentcalledAt']=utils[_0x0632('0x21')]();transfers[_0x58c44b[_0x0632('0x4b')]]['agentconnectAt']=utils[_0x0632('0x21')]();transfers[_0x58c44b['transfertargetuniqueid']][_0x0632('0x2a')]=0x0;transfers[_0x58c44b[_0x0632('0x4b')]][_0x0632('0x48')]=0x2;}}}catch(_0x1b5c2a){utils[_0x0632('0x19')](util[_0x0632('0x2')]('[%s][agents][attendedtransfer]',_0x58c44b['origtransfereruniqueid']),_0x1b5c2a);}};exports[_0x0632('0x4c')]=function(_0x26e068){try{utils[_0x0632('0x1d')](util[_0x0632('0x2')](_0x0632('0x4d'),_0x26e068[_0x0632('0x3')]),_0x26e068);if(agents[_0x26e068[_0x0632('0x3')]]&&agents[_0x26e068[_0x0632('0x3')]][_0x0632('0x23')]==='timeout'){if(_0x26e068['cause']==='21'){agents[_0x26e068[_0x0632('0x3')]][_0x0632('0x23')]='rejected';agents[_0x26e068[_0x0632('0x3')]][_0x0632('0xa')]='rejected';}utils['info'](util[_0x0632('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x26e068['uniqueid'],agents[_0x26e068['uniqueid']]['membername'],agents[_0x26e068[_0x0632('0x3')]][_0x0632('0x23')],agents[_0x26e068['uniqueid']][_0x0632('0xa')]));writeDB(agents[_0x26e068[_0x0632('0x3')]]);var _0x4a7457=unanswered[_0x0632('0x4e')](_0x26e068[_0x0632('0x3')]);if(_0x4a7457>-0x1){unanswered[_0x0632('0x4f')](_0x4a7457,0x1);}}if(transfers[_0x26e068[_0x0632('0x3')]]){transfers[_0x26e068[_0x0632('0x3')]][_0x0632('0xe')]=!![];transfers[_0x26e068['uniqueid']]['agentcompleteAt']=utils[_0x0632('0x21')]();transfers[_0x26e068[_0x0632('0x3')]][_0x0632('0x2e')]=utils['diffTime'](transfers[_0x26e068[_0x0632('0x3')]][_0x0632('0x34')],transfers[_0x26e068[_0x0632('0x3')]]['agentconnectAt']);transfers[_0x26e068['uniqueid']][_0x0632('0x23')]=_0x0632('0x50');transfers[_0x26e068[_0x0632('0x3')]][_0x0632('0xa')]=_0x0632('0x36');utils[_0x0632('0x17')](util[_0x0632('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x26e068[_0x0632('0x3')],transfers[_0x26e068[_0x0632('0x3')]][_0x0632('0x6')],transfers[_0x26e068[_0x0632('0x3')]]['reason'],transfers[_0x26e068['uniqueid']][_0x0632('0xa')]));writeDB(transfers[_0x26e068['uniqueid']],!![]);}if(agents[_0x26e068[_0x0632('0x3')]]&&agents[_0x26e068['uniqueid']][_0x0632('0x2d')]){agents[_0x26e068[_0x0632('0x3')]]['agentcomplete']=!![];agents[_0x26e068[_0x0632('0x3')]][_0x0632('0x34')]=utils[_0x0632('0x21')]();agents[_0x26e068[_0x0632('0x3')]][_0x0632('0x2e')]=utils['diffTime'](agents[_0x26e068['uniqueid']][_0x0632('0x34')],agents[_0x26e068['uniqueid']]['agentconnectAt']);agents[_0x26e068['uniqueid']]['reason']=agents[_0x26e068['uniqueid']]['transfer']?_0x0632('0x3a'):_0x0632('0x50');agents[_0x26e068[_0x0632('0x3')]]['lastevent']=_0x0632('0x36');utils['info'](util[_0x0632('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x26e068['uniqueid'],agents[_0x26e068[_0x0632('0x3')]][_0x0632('0x6')],agents[_0x26e068['uniqueid']]['reason'],agents[_0x26e068[_0x0632('0x3')]]['lastevent']));writeDB(agents[_0x26e068[_0x0632('0x3')]]);}}catch(_0x58c620){utils['error'](util[_0x0632('0x2')]('[%s][agents][hangup]',_0x26e068[_0x0632('0x3')]),_0x58c620);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index ddbfe1e..e16a391 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 _0x0d2d=['transfertargetchannel','origtransfereruniqueid','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','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','substring','lastIndexOf','hangup','noop','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','getUserByInternal','accountcode','UserId','CreateVoiceCallReport','newchannel','debug','format','linkedid','OutgoingSpoolFailed','exten','calleridnum','context','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x0d2d,0x1e0));var _0xd0d2=function(_0x2d6b43,_0x2ab36b){_0x2d6b43=_0x2d6b43-0x0;var _0x156a1e=_0x0d2d[_0x2d6b43];return _0x156a1e;};'use strict';var _=require(_0xd0d2('0x0'));var util=require(_0xd0d2('0x1'));var utils=require(_0xd0d2('0x2'));var transfers=require(_0xd0d2('0x3'));var dispositions=[_0xd0d2('0x4'),_0xd0d2('0x5'),_0xd0d2('0x5'),'NO\x20ANSWER',_0xd0d2('0x4'),_0xd0d2('0x4'),'ANSWERED',_0xd0d2('0x6'),_0xd0d2('0x5'),_0xd0d2('0x5'),_0xd0d2('0x5')];var channels={};function writeDB(_0x31356e){var _0x4994bf;if(transfers[_0xd0d2('0x7')][_0x31356e[_0xd0d2('0x8')]]){_0x4994bf=_0x31356e[_0xd0d2('0x8')];_0x31356e['uniqueid']=transfers[_0xd0d2('0x7')][_0x31356e['uniqueid']][_0xd0d2('0x9')];}utils[_0xd0d2('0xa')](util['format'](_0xd0d2('0xb'),_0x31356e[_0xd0d2('0x8')],_0x31356e[_0xd0d2('0xc')],_0x31356e[_0xd0d2('0xd')],_0x31356e['membername'],_0x31356e[_0xd0d2('0xe')],_0x31356e['calleridnum'],_0x31356e['connectedlinenum'],_0x31356e['lastevent']));if(_0x31356e['accountcode']){utils[_0xd0d2('0xf')](_0x31356e[_0xd0d2('0x10')])['then'](function(_0x4d7f6e){if(_0x4d7f6e){_0x31356e[_0xd0d2('0x11')]=_0x4d7f6e['id'];}utils['request'](_0xd0d2('0x12'),_0x31356e);});}else{utils['request'](_0xd0d2('0x12'),_0x31356e);}if(channels[_0x31356e[_0xd0d2('0x8')]]){delete channels[_0x31356e['uniqueid']];}else if(_0x4994bf&&channels[_0x4994bf]){delete transfers[_0xd0d2('0x7')][_0x4994bf];delete channels[_0x4994bf];}}exports[_0xd0d2('0x13')]=function(_0x142b41){try{utils[_0xd0d2('0x14')](util[_0xd0d2('0x15')]('[%s][calls][newchannel]',_0x142b41[_0xd0d2('0x8')]),_0x142b41);if(_0x142b41[_0xd0d2('0x8')]==_0x142b41[_0xd0d2('0x16')]&&_0x142b41[_0xd0d2('0xc')]!=_0xd0d2('0x17')){utils[_0xd0d2('0xa')](util[_0xd0d2('0x15')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x142b41['uniqueid'],_0x142b41['context'],_0x142b41[_0xd0d2('0x18')]));channels[_0x142b41[_0xd0d2('0x8')]]={'uniqueid':_0x142b41[_0xd0d2('0x8')],'accountcode':_0x142b41[_0xd0d2('0x10')],'source':_0x142b41[_0xd0d2('0x19')],'destination':_0x142b41[_0xd0d2('0x18')],'destinationcontext':_0x142b41[_0xd0d2('0x1a')],'channel':_0x142b41[_0xd0d2('0xc')],'starttime':utils[_0xd0d2('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xd0d2('0x1c')};}}catch(_0x502d27){utils[_0xd0d2('0x1d')](util['format']('[%s][calls][newchannel]',_0x142b41[_0xd0d2('0x8')]),_0x502d27);}};exports['newstate']=function(_0x32d14f){try{utils[_0xd0d2('0x14')](util[_0xd0d2('0x15')](_0xd0d2('0x1e'),_0x32d14f[_0xd0d2('0x8')]),_0x32d14f);if(!_[_0xd0d2('0x1f')](channels[_0x32d14f[_0xd0d2('0x8')]])&&_0x32d14f[_0xd0d2('0x20')]==0x6){utils[_0xd0d2('0xa')](util[_0xd0d2('0x15')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x32d14f[_0xd0d2('0x8')],_0x32d14f[_0xd0d2('0x1a')],_0x32d14f[_0xd0d2('0xc')]));if(_['isNil'](channels[_0x32d14f[_0xd0d2('0x8')]][_0xd0d2('0x21')])){channels[_0x32d14f[_0xd0d2('0x8')]][_0xd0d2('0x21')]=utils[_0xd0d2('0x1b')]();}}else if(!_[_0xd0d2('0x1f')](channels[_0x32d14f['linkedid']])&&_0x32d14f[_0xd0d2('0x20')]==0x6&&_0x32d14f['context']!=_0xd0d2('0x22')){utils[_0xd0d2('0xa')](util['format'](_0xd0d2('0x23'),_0x32d14f['uniqueid'],_0x32d14f['linkedid'],_0x32d14f['context'],_0x32d14f[_0xd0d2('0xc')]));channels[_0x32d14f['linkedid']]['accountcode']=_0x32d14f[_0xd0d2('0x10')];channels[_0x32d14f[_0xd0d2('0x16')]][_0xd0d2('0x24')]=_0x32d14f[_0xd0d2('0xc')];if(_[_0xd0d2('0x1f')](channels[_0x32d14f[_0xd0d2('0x16')]][_0xd0d2('0x25')])){channels[_0x32d14f['linkedid']][_0xd0d2('0x25')]=utils['now']();}channels[_0x32d14f[_0xd0d2('0x16')]]['disposition']=dispositions[_[_0xd0d2('0x26')](_0x32d14f[_0xd0d2('0x20')])]||'ANSWERED';}}catch(_0x4baaf7){utils[_0xd0d2('0x1d')](util[_0xd0d2('0x15')](_0xd0d2('0x1e'),_0x32d14f[_0xd0d2('0x8')]),_0x4baaf7);}};exports['hangup']=function(_0xf70895){try{if(!_[_0xd0d2('0x1f')](channels[_0xf70895[_0xd0d2('0x8')]])){utils[_0xd0d2('0x14')](util['format'](_0xd0d2('0x27'),_0xf70895[_0xd0d2('0x8')]),_0xf70895);if(_[_0xd0d2('0x1f')](channels[_0xf70895[_0xd0d2('0x8')]]['callerid'])){channels[_0xf70895['uniqueid']][_0xd0d2('0x28')]=_0xf70895[_0xd0d2('0x29')]+'\x20<'+_0xf70895['calleridnum']+'>';}utils[_0xd0d2('0xa')](util['format'](_0xd0d2('0x2a'),_0xf70895[_0xd0d2('0x8')],channels[_0xf70895[_0xd0d2('0x8')]][_0xd0d2('0x28')],_0xf70895[_0xd0d2('0x2b')]));channels[_0xf70895[_0xd0d2('0x8')]][_0xd0d2('0x2c')]=utils['now']();channels[_0xf70895['uniqueid']][_0xd0d2('0x2d')]=utils[_0xd0d2('0x2e')](channels[_0xf70895[_0xd0d2('0x8')]][_0xd0d2('0x2c')],channels[_0xf70895[_0xd0d2('0x8')]]['starttime']);channels[_0xf70895[_0xd0d2('0x8')]][_0xd0d2('0x2f')]=channels[_0xf70895[_0xd0d2('0x8')]][_0xd0d2('0x25')]?utils[_0xd0d2('0x2e')](channels[_0xf70895[_0xd0d2('0x8')]][_0xd0d2('0x2c')],channels[_0xf70895['uniqueid']][_0xd0d2('0x25')]):0x0;writeDB(channels[_0xf70895[_0xd0d2('0x8')]]);}}catch(_0x1f6ec6){utils[_0xd0d2('0x1d')](util[_0xd0d2('0x15')](_0xd0d2('0x27'),_0xf70895['uniqueid']),_0x1f6ec6);}};exports[_0xd0d2('0x30')]=function(_0x1f5a31){try{if(!_[_0xd0d2('0x1f')](channels[_0x1f5a31[_0xd0d2('0x31')]])){utils[_0xd0d2('0x14')](util['format'](_0xd0d2('0x32'),_0x1f5a31['origtransfereruniqueid']),_0x1f5a31);if(channels[_0x1f5a31[_0xd0d2('0x31')]][_0xd0d2('0xc')]==_0x1f5a31['transfereechannel']){utils[_0xd0d2('0xa')](util['format'](_0xd0d2('0x33'),_0x1f5a31['origtransfereruniqueid'],_0x1f5a31[_0xd0d2('0x31')],_0x1f5a31['secondtransfererchannel']));channels[_0x1f5a31['localtwolinkedid']][_0xd0d2('0x24')]=_0x1f5a31[_0xd0d2('0x34')];channels[_0x1f5a31[_0xd0d2('0x31')]][_0xd0d2('0x35')]=_0xd0d2('0x36');}else if(channels[_0x1f5a31['localtwolinkedid']][_0xd0d2('0xc')]=_0x1f5a31[_0xd0d2('0x37')]){utils[_0xd0d2('0xa')](util[_0xd0d2('0x15')](_0xd0d2('0x33'),_0x1f5a31[_0xd0d2('0x38')],_0x1f5a31[_0xd0d2('0x31')],_0x1f5a31[_0xd0d2('0x39')]));channels[_0x1f5a31['localtwolinkedid']][_0xd0d2('0x24')]=_0x1f5a31[_0xd0d2('0x39')];channels[_0x1f5a31[_0xd0d2('0x31')]]['userfield']='_attended';}}}catch(_0x42d7b8){utils[_0xd0d2('0x1d')](util[_0xd0d2('0x15')]('[%s][calls][attendedtransfer]',_0x1f5a31['origtransfereruniqueid']),_0x42d7b8);}};exports[_0xd0d2('0x3a')]=function(_0x490b7d){try{if(!_['isNil'](channels[_0x490b7d[_0xd0d2('0x8')]])){utils['debug'](util[_0xd0d2('0x15')](_0xd0d2('0x3b'),_0x490b7d[_0xd0d2('0x8')]),_0x490b7d);channels[_0x490b7d[_0xd0d2('0x8')]][_0xd0d2('0x3c')]=utils[_0xd0d2('0x1b')]();utils[_0xd0d2('0xa')](util[_0xd0d2('0x15')](_0xd0d2('0x3d'),_0x490b7d['uniqueid'],channels[_0x490b7d[_0xd0d2('0x8')]][_0xd0d2('0x3c')]));}}catch(_0x4c67b2){utils[_0xd0d2('0x1d')](util[_0xd0d2('0x15')]('[%s][calls][musiconholdstart]',_0x490b7d[_0xd0d2('0x8')]),_0x4c67b2);}};exports[_0xd0d2('0x3e')]=function(_0x1616c8){try{if(!_['isNil'](channels[_0x1616c8['uniqueid']])){utils[_0xd0d2('0x14')](util[_0xd0d2('0x15')](_0xd0d2('0x3f'),_0x1616c8[_0xd0d2('0x8')]),_0x1616c8);if(!_[_0xd0d2('0x1f')](channels[_0x1616c8[_0xd0d2('0x8')]]['musiconholdstartAt'])){channels[_0x1616c8['uniqueid']][_0xd0d2('0x40')]+=utils[_0xd0d2('0x2e')](utils[_0xd0d2('0x1b')](),channels[_0x1616c8[_0xd0d2('0x8')]][_0xd0d2('0x3c')]);utils[_0xd0d2('0xa')](util[_0xd0d2('0x15')](_0xd0d2('0x41'),_0x1616c8['uniqueid'],channels[_0x1616c8['uniqueid']][_0xd0d2('0x40')]));delete channels[_0x1616c8[_0xd0d2('0x8')]][_0xd0d2('0x3c')];}}}catch(_0x4ac7a6){utils['error'](util[_0xd0d2('0x15')](_0xd0d2('0x3f'),_0x1616c8[_0xd0d2('0x8')]),_0x4ac7a6);}};exports['varset']=function(_0x16aa56){try{if(!_['isNil'](channels[_0x16aa56['uniqueid']])){utils[_0xd0d2('0x14')](util[_0xd0d2('0x15')](_0xd0d2('0x42'),_0x16aa56[_0xd0d2('0x8')]),_0x16aa56);if(!_[_0xd0d2('0x1f')](_0x16aa56['variable'][_0xd0d2('0x43')])){utils[_0xd0d2('0xa')](util['format'](_0xd0d2('0x44'),_0x16aa56[_0xd0d2('0x8')],_0x16aa56[_0xd0d2('0x45')]));channels[_0x16aa56[_0xd0d2('0x8')]][_0xd0d2('0x46')]=_0x16aa56[_0xd0d2('0x45')];}if(!_[_0xd0d2('0x1f')](_0x16aa56[_0xd0d2('0x47')][_0xd0d2('0x48')])){utils['info'](util['format'](_0xd0d2('0x49'),_0x16aa56[_0xd0d2('0x8')],_0x16aa56[_0xd0d2('0x45')]));channels[_0x16aa56[_0xd0d2('0x8')]]['destination']=_0x16aa56[_0xd0d2('0x45')];channels[_0x16aa56[_0xd0d2('0x8')]]['callerid']='\x22'+_0x16aa56['value']+_0xd0d2('0x4a')+_0x16aa56['value']+'>';}if(!_['isNil'](_0x16aa56[_0xd0d2('0x47')]['xmd-callerid-preview'])||!_[_0xd0d2('0x1f')](_0x16aa56[_0xd0d2('0x47')][_0xd0d2('0x4b')])){utils[_0xd0d2('0xa')](util[_0xd0d2('0x15')](_0xd0d2('0x4c'),_0x16aa56[_0xd0d2('0x8')],!_[_0xd0d2('0x1f')](_0x16aa56[_0xd0d2('0x47')][_0xd0d2('0x4d')])?_0xd0d2('0x4d'):'xmd-callerid',_0x16aa56[_0xd0d2('0x45')]));channels[_0x16aa56[_0xd0d2('0x8')]][_0xd0d2('0x28')]=_0x16aa56[_0xd0d2('0x45')];}if(!_['isNil'](_0x16aa56[_0xd0d2('0x47')]['xmd-queue'])||!_[_0xd0d2('0x1f')](_0x16aa56[_0xd0d2('0x47')][_0xd0d2('0x4e')])){utils[_0xd0d2('0xa')](util[_0xd0d2('0x15')](_0xd0d2('0x4c'),_0x16aa56[_0xd0d2('0x8')],!_['isNil'](_0x16aa56[_0xd0d2('0x47')][_0xd0d2('0x4f')])?_0xd0d2('0x4f'):'xmcs-queue',_0x16aa56[_0xd0d2('0x45')]));channels[_0x16aa56[_0xd0d2('0x8')]][_0xd0d2('0x50')]=_0xd0d2('0x51');channels[_0x16aa56[_0xd0d2('0x8')]][_0xd0d2('0x52')]=_0x16aa56[_0xd0d2('0x45')];channels[_0x16aa56[_0xd0d2('0x8')]][_0xd0d2('0xd')]=!![];}if(!_[_0xd0d2('0x1f')](_0x16aa56[_0xd0d2('0x47')][_0xd0d2('0x53')])){utils[_0xd0d2('0xa')](util[_0xd0d2('0x15')](_0xd0d2('0x54'),_0x16aa56[_0xd0d2('0x8')],_0x16aa56[_0xd0d2('0x45')]));channels[_0x16aa56[_0xd0d2('0x8')]]['ContactId']=_0x16aa56[_0xd0d2('0x45')];}if(!_[_0xd0d2('0x1f')](_0x16aa56['variable'][_0xd0d2('0x55')])){utils[_0xd0d2('0xa')](util[_0xd0d2('0x15')](_0xd0d2('0x56'),_0x16aa56[_0xd0d2('0x8')],_0x16aa56['value']));channels[_0x16aa56[_0xd0d2('0x8')]][_0xd0d2('0x57')]=_0x16aa56[_0xd0d2('0x45')];}if(!_[_0xd0d2('0x1f')](_0x16aa56['variable'][_0xd0d2('0x58')])){utils[_0xd0d2('0xa')](util['format'](_0xd0d2('0x59'),_0x16aa56[_0xd0d2('0x8')],_0x16aa56[_0xd0d2('0x45')]));channels[_0x16aa56['uniqueid']]['routeid']=_0x16aa56[_0xd0d2('0x45')];}if(!_[_0xd0d2('0x1f')](_0x16aa56['variable'][_0xd0d2('0x5a')])){utils['info'](util[_0xd0d2('0x15')](_0xd0d2('0x5b'),_0x16aa56[_0xd0d2('0x8')],_0x16aa56[_0xd0d2('0x45')]));channels[_0x16aa56[_0xd0d2('0x8')]][_0xd0d2('0x5a')]=_0x16aa56[_0xd0d2('0x45')];}}}catch(_0x547505){utils['error'](util['format'](_0xd0d2('0x42'),_0x16aa56[_0xd0d2('0x8')]),_0x547505);}};exports[_0xd0d2('0x5c')]=function(_0x50518b){try{if(!_[_0xd0d2('0x1f')](channels[_0x50518b[_0xd0d2('0x8')]])){utils['debug'](util[_0xd0d2('0x15')](_0xd0d2('0x5d'),_0x50518b['uniqueid']),_0x50518b);utils['info'](util[_0xd0d2('0x15')](_0xd0d2('0x5e'),_0x50518b['uniqueid'],_0x50518b[_0xd0d2('0x5f')],_0x50518b[_0xd0d2('0x60')]));if(_0x50518b[_0xd0d2('0x5f')]['toLowerCase']()==_0xd0d2('0x61')&&_[_0xd0d2('0x62')](_0x50518b[_0xd0d2('0x60')][_0xd0d2('0x63')](),_0xd0d2('0x64'))){var _0x40d5a5=_0x50518b[_0xd0d2('0x60')][_0xd0d2('0x65')]('=');var _0x3cc8cd=_0x40d5a5[0x0][_0xd0d2('0x66')](_0x40d5a5[0x0][_0xd0d2('0x67')]('(')+0x1,_0x40d5a5[0x0][_0xd0d2('0x67')](')'));var _0xd75802=_0x40d5a5[0x1];channels[_0x50518b[_0xd0d2('0x8')]][_0x3cc8cd]=_0xd75802;}if(!_['includes']([_0xd0d2('0x68'),_0xd0d2('0x69'),'execif',_0xd0d2('0x61'),_0xd0d2('0x6a')],_0x50518b[_0xd0d2('0x5f')][_0xd0d2('0x63')]())){channels[_0x50518b[_0xd0d2('0x8')]][_0xd0d2('0x50')]=_0x50518b[_0xd0d2('0x5f')];channels[_0x50518b[_0xd0d2('0x8')]][_0xd0d2('0x52')]=_0x50518b[_0xd0d2('0x60')];}}}catch(_0x24542f){utils[_0xd0d2('0x1d')](util['format'](_0xd0d2('0x5d'),_0x50518b[_0xd0d2('0x8')]),_0x24542f);}}; \ No newline at end of file +var _0xad25=['./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','error','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','now','transfer','linkedid','destinationchannel','answertime','disposition','toNumber','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','endtime','starttime','diffTime','[%s][calls][hangup]','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','application','toLowerCase','set','startsWith','cdr','appdata','split','substring','gotoif','lastdata','lodash','util'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xad25,0x1a2));var _0x5ad2=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xad25[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x5ad2('0x0'));var util=require(_0x5ad2('0x1'));var utils=require(_0x5ad2('0x2'));var transfers=require(_0x5ad2('0x3'));var dispositions=[_0x5ad2('0x4'),_0x5ad2('0x5'),_0x5ad2('0x5'),_0x5ad2('0x4'),'NO\x20ANSWER',_0x5ad2('0x4'),'ANSWERED',_0x5ad2('0x6'),'FAILED',_0x5ad2('0x5'),_0x5ad2('0x5')];var channels={};function writeDB(_0x12a636){var _0x4bbcfb;if(transfers[_0x5ad2('0x7')][_0x12a636[_0x5ad2('0x8')]]){_0x4bbcfb=_0x12a636['uniqueid'];_0x12a636['uniqueid']=transfers[_0x5ad2('0x7')][_0x12a636[_0x5ad2('0x8')]][_0x5ad2('0x9')];}utils[_0x5ad2('0xa')](util[_0x5ad2('0xb')](_0x5ad2('0xc'),_0x12a636[_0x5ad2('0x8')],_0x12a636['channel'],_0x12a636[_0x5ad2('0xd')],_0x12a636[_0x5ad2('0xe')],_0x12a636[_0x5ad2('0xf')],_0x12a636[_0x5ad2('0x10')],_0x12a636[_0x5ad2('0x11')],_0x12a636[_0x5ad2('0x12')]));if(_0x12a636['accountcode']){utils[_0x5ad2('0x13')](_0x12a636[_0x5ad2('0x14')])[_0x5ad2('0x15')](function(_0x216483){if(_0x216483){_0x12a636[_0x5ad2('0x16')]=_0x216483['id'];}utils[_0x5ad2('0x17')](_0x5ad2('0x18'),_0x12a636);});}else{utils[_0x5ad2('0x17')](_0x5ad2('0x18'),_0x12a636);}if(channels[_0x12a636['uniqueid']]){delete channels[_0x12a636[_0x5ad2('0x8')]];}else if(_0x4bbcfb&&channels[_0x4bbcfb]){delete transfers['blinds'][_0x4bbcfb];delete channels[_0x4bbcfb];}}exports[_0x5ad2('0x19')]=function(_0x101e70){try{utils[_0x5ad2('0x1a')](util[_0x5ad2('0xb')](_0x5ad2('0x1b'),_0x101e70[_0x5ad2('0x8')]),_0x101e70);if(_0x101e70[_0x5ad2('0x8')]==_0x101e70['linkedid']&&_0x101e70[_0x5ad2('0x1c')]!=_0x5ad2('0x1d')){utils['info'](util['format'](_0x5ad2('0x1e'),_0x101e70[_0x5ad2('0x8')],_0x101e70[_0x5ad2('0x1f')],_0x101e70[_0x5ad2('0x20')]));channels[_0x101e70['uniqueid']]={'uniqueid':_0x101e70[_0x5ad2('0x8')],'accountcode':_0x101e70[_0x5ad2('0x14')],'source':_0x101e70[_0x5ad2('0x10')],'destination':_0x101e70[_0x5ad2('0x20')],'destinationcontext':_0x101e70['context'],'channel':_0x101e70['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5ad2('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x4923a7){utils[_0x5ad2('0x21')](util[_0x5ad2('0xb')]('[%s][calls][newchannel]',_0x101e70[_0x5ad2('0x8')]),_0x4923a7);}};exports['newstate']=function(_0xf12fd){try{utils[_0x5ad2('0x1a')](util[_0x5ad2('0xb')](_0x5ad2('0x22'),_0xf12fd['uniqueid']),_0xf12fd);if(!_['isNil'](channels[_0xf12fd[_0x5ad2('0x8')]])&&_0xf12fd[_0x5ad2('0x23')]==0x6){utils[_0x5ad2('0xa')](util['format'](_0x5ad2('0x24'),_0xf12fd[_0x5ad2('0x8')],_0xf12fd[_0x5ad2('0x1f')],_0xf12fd['channel']));if(_[_0x5ad2('0x25')](channels[_0xf12fd[_0x5ad2('0x8')]][_0x5ad2('0x26')])){channels[_0xf12fd[_0x5ad2('0x8')]][_0x5ad2('0x26')]=utils[_0x5ad2('0x27')]();}}else if(!_[_0x5ad2('0x25')](channels[_0xf12fd['linkedid']])&&_0xf12fd[_0x5ad2('0x23')]==0x6&&_0xf12fd['context']!=_0x5ad2('0x28')){utils[_0x5ad2('0xa')](util[_0x5ad2('0xb')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0xf12fd[_0x5ad2('0x8')],_0xf12fd[_0x5ad2('0x29')],_0xf12fd['context'],_0xf12fd[_0x5ad2('0x1c')]));channels[_0xf12fd[_0x5ad2('0x29')]][_0x5ad2('0x14')]=_0xf12fd[_0x5ad2('0x14')];channels[_0xf12fd[_0x5ad2('0x29')]][_0x5ad2('0x2a')]=_0xf12fd[_0x5ad2('0x1c')];if(_['isNil'](channels[_0xf12fd['linkedid']]['answertime'])){channels[_0xf12fd[_0x5ad2('0x29')]][_0x5ad2('0x2b')]=utils[_0x5ad2('0x27')]();}channels[_0xf12fd[_0x5ad2('0x29')]][_0x5ad2('0x2c')]=dispositions[_[_0x5ad2('0x2d')](_0xf12fd[_0x5ad2('0x23')])]||'ANSWERED';}}catch(_0x308dd1){utils[_0x5ad2('0x21')](util[_0x5ad2('0xb')](_0x5ad2('0x22'),_0xf12fd[_0x5ad2('0x8')]),_0x308dd1);}};exports[_0x5ad2('0x2e')]=function(_0x1bcc68){try{if(!_[_0x5ad2('0x25')](channels[_0x1bcc68[_0x5ad2('0x8')]])){utils[_0x5ad2('0x1a')](util['format']('[%s][calls][hangup]',_0x1bcc68[_0x5ad2('0x8')]),_0x1bcc68);if(_[_0x5ad2('0x25')](channels[_0x1bcc68['uniqueid']]['callerid'])){channels[_0x1bcc68['uniqueid']][_0x5ad2('0x2f')]=_0x1bcc68[_0x5ad2('0x30')]+'\x20<'+_0x1bcc68[_0x5ad2('0x10')]+'>';}utils[_0x5ad2('0xa')](util[_0x5ad2('0xb')](_0x5ad2('0x31'),_0x1bcc68[_0x5ad2('0x8')],channels[_0x1bcc68[_0x5ad2('0x8')]][_0x5ad2('0x2f')],_0x1bcc68['cause-txt']));channels[_0x1bcc68[_0x5ad2('0x8')]]['endtime']=utils[_0x5ad2('0x27')]();channels[_0x1bcc68[_0x5ad2('0x8')]][_0x5ad2('0x32')]=utils['diffTime'](channels[_0x1bcc68[_0x5ad2('0x8')]][_0x5ad2('0x33')],channels[_0x1bcc68['uniqueid']][_0x5ad2('0x34')]);channels[_0x1bcc68[_0x5ad2('0x8')]]['billableseconds']=channels[_0x1bcc68[_0x5ad2('0x8')]][_0x5ad2('0x2b')]?utils[_0x5ad2('0x35')](channels[_0x1bcc68['uniqueid']][_0x5ad2('0x33')],channels[_0x1bcc68[_0x5ad2('0x8')]]['answertime']):0x0;writeDB(channels[_0x1bcc68['uniqueid']]);}}catch(_0x3e964b){utils[_0x5ad2('0x21')](util[_0x5ad2('0xb')](_0x5ad2('0x36'),_0x1bcc68[_0x5ad2('0x8')]),_0x3e964b);}};exports['attendedtransfer']=function(_0x1ce9f1){try{if(!_['isNil'](channels[_0x1ce9f1[_0x5ad2('0x37')]])){utils['debug'](util['format'](_0x5ad2('0x38'),_0x1ce9f1[_0x5ad2('0x39')]),_0x1ce9f1);if(channels[_0x1ce9f1[_0x5ad2('0x37')]][_0x5ad2('0x1c')]==_0x1ce9f1[_0x5ad2('0x3a')]){utils['info'](util['format'](_0x5ad2('0x3b'),_0x1ce9f1[_0x5ad2('0x39')],_0x1ce9f1[_0x5ad2('0x37')],_0x1ce9f1[_0x5ad2('0x3c')]));channels[_0x1ce9f1[_0x5ad2('0x37')]][_0x5ad2('0x2a')]=_0x1ce9f1['secondtransfererchannel'];channels[_0x1ce9f1[_0x5ad2('0x37')]][_0x5ad2('0x3d')]=_0x5ad2('0x3e');}else if(channels[_0x1ce9f1[_0x5ad2('0x37')]][_0x5ad2('0x1c')]=_0x1ce9f1[_0x5ad2('0x3f')]){utils[_0x5ad2('0xa')](util['format'](_0x5ad2('0x3b'),_0x1ce9f1['origtransfereruniqueid'],_0x1ce9f1[_0x5ad2('0x37')],_0x1ce9f1[_0x5ad2('0x40')]));channels[_0x1ce9f1['localtwolinkedid']][_0x5ad2('0x2a')]=_0x1ce9f1['origtransfererchannel'];channels[_0x1ce9f1['localtwolinkedid']][_0x5ad2('0x3d')]=_0x5ad2('0x3e');}}}catch(_0x46448f){utils[_0x5ad2('0x21')](util[_0x5ad2('0xb')](_0x5ad2('0x38'),_0x1ce9f1[_0x5ad2('0x39')]),_0x46448f);}};exports[_0x5ad2('0x41')]=function(_0x2b53c7){try{if(!_[_0x5ad2('0x25')](channels[_0x2b53c7[_0x5ad2('0x8')]])){utils['debug'](util['format'](_0x5ad2('0x42'),_0x2b53c7[_0x5ad2('0x8')]),_0x2b53c7);channels[_0x2b53c7[_0x5ad2('0x8')]][_0x5ad2('0x43')]=utils[_0x5ad2('0x27')]();utils[_0x5ad2('0xa')](util[_0x5ad2('0xb')](_0x5ad2('0x44'),_0x2b53c7['uniqueid'],channels[_0x2b53c7[_0x5ad2('0x8')]]['musiconholdstartAt']));}}catch(_0x187899){utils[_0x5ad2('0x21')](util['format'](_0x5ad2('0x42'),_0x2b53c7['uniqueid']),_0x187899);}};exports['musiconholdstop']=function(_0x1b9e46){try{if(!_['isNil'](channels[_0x1b9e46['uniqueid']])){utils[_0x5ad2('0x1a')](util['format']('[%s][calls][musiconholdstop]',_0x1b9e46['uniqueid']),_0x1b9e46);if(!_[_0x5ad2('0x25')](channels[_0x1b9e46[_0x5ad2('0x8')]]['musiconholdstartAt'])){channels[_0x1b9e46['uniqueid']][_0x5ad2('0x45')]+=utils[_0x5ad2('0x35')](utils[_0x5ad2('0x27')](),channels[_0x1b9e46[_0x5ad2('0x8')]][_0x5ad2('0x43')]);utils[_0x5ad2('0xa')](util['format'](_0x5ad2('0x46'),_0x1b9e46[_0x5ad2('0x8')],channels[_0x1b9e46[_0x5ad2('0x8')]][_0x5ad2('0x45')]));delete channels[_0x1b9e46['uniqueid']]['musiconholdstartAt'];}}}catch(_0x9ad110){utils['error'](util[_0x5ad2('0xb')](_0x5ad2('0x47'),_0x1b9e46[_0x5ad2('0x8')]),_0x9ad110);}};exports[_0x5ad2('0x48')]=function(_0x2e5d50){try{if(!_['isNil'](channels[_0x2e5d50[_0x5ad2('0x8')]])){utils[_0x5ad2('0x1a')](util[_0x5ad2('0xb')](_0x5ad2('0x49'),_0x2e5d50['uniqueid']),_0x2e5d50);if(!_['isNil'](_0x2e5d50[_0x5ad2('0x4a')]['xmd-originatecalleridnum'])){utils[_0x5ad2('0xa')](util[_0x5ad2('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2e5d50[_0x5ad2('0x8')],_0x2e5d50[_0x5ad2('0x4b')]));channels[_0x2e5d50[_0x5ad2('0x8')]][_0x5ad2('0x4c')]=_0x2e5d50[_0x5ad2('0x4b')];}if(!_[_0x5ad2('0x25')](_0x2e5d50[_0x5ad2('0x4a')][_0x5ad2('0x4d')])){utils[_0x5ad2('0xa')](util[_0x5ad2('0xb')](_0x5ad2('0x4e'),_0x2e5d50[_0x5ad2('0x8')],_0x2e5d50[_0x5ad2('0x4b')]));channels[_0x2e5d50[_0x5ad2('0x8')]]['destination']=_0x2e5d50[_0x5ad2('0x4b')];channels[_0x2e5d50[_0x5ad2('0x8')]][_0x5ad2('0x2f')]='\x22'+_0x2e5d50['value']+_0x5ad2('0x4f')+_0x2e5d50[_0x5ad2('0x4b')]+'>';}if(!_['isNil'](_0x2e5d50['variable']['xmd-callerid-preview'])||!_[_0x5ad2('0x25')](_0x2e5d50[_0x5ad2('0x4a')][_0x5ad2('0x50')])){utils['info'](util['format'](_0x5ad2('0x51'),_0x2e5d50[_0x5ad2('0x8')],!_['isNil'](_0x2e5d50['variable']['xmd-callerid-preview'])?'xmd-callerid-preview':_0x5ad2('0x50'),_0x2e5d50[_0x5ad2('0x4b')]));channels[_0x2e5d50[_0x5ad2('0x8')]][_0x5ad2('0x2f')]=_0x2e5d50[_0x5ad2('0x4b')];}if(!_[_0x5ad2('0x25')](_0x2e5d50[_0x5ad2('0x4a')][_0x5ad2('0x52')])||!_[_0x5ad2('0x25')](_0x2e5d50[_0x5ad2('0x4a')][_0x5ad2('0x53')])){utils['info'](util[_0x5ad2('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2e5d50[_0x5ad2('0x8')],!_['isNil'](_0x2e5d50[_0x5ad2('0x4a')]['xmd-queue'])?_0x5ad2('0x52'):'xmcs-queue',_0x2e5d50[_0x5ad2('0x4b')]));channels[_0x2e5d50[_0x5ad2('0x8')]][_0x5ad2('0x54')]='Queue';channels[_0x2e5d50[_0x5ad2('0x8')]]['lastdata']=_0x2e5d50[_0x5ad2('0x4b')];channels[_0x2e5d50[_0x5ad2('0x8')]][_0x5ad2('0xd')]=!![];}if(!_[_0x5ad2('0x25')](_0x2e5d50[_0x5ad2('0x4a')]['xmd-contactid'])){utils[_0x5ad2('0xa')](util['format'](_0x5ad2('0x55'),_0x2e5d50[_0x5ad2('0x8')],_0x2e5d50[_0x5ad2('0x4b')]));channels[_0x2e5d50['uniqueid']][_0x5ad2('0x56')]=_0x2e5d50[_0x5ad2('0x4b')];}if(!_[_0x5ad2('0x25')](_0x2e5d50[_0x5ad2('0x4a')][_0x5ad2('0x57')])){utils[_0x5ad2('0xa')](util[_0x5ad2('0xb')](_0x5ad2('0x58'),_0x2e5d50[_0x5ad2('0x8')],_0x2e5d50['value']));channels[_0x2e5d50[_0x5ad2('0x8')]][_0x5ad2('0x59')]=_0x2e5d50[_0x5ad2('0x4b')];}if(!_[_0x5ad2('0x25')](_0x2e5d50['variable'][_0x5ad2('0x5a')])){utils[_0x5ad2('0xa')](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x2e5d50[_0x5ad2('0x8')],_0x2e5d50[_0x5ad2('0x4b')]));channels[_0x2e5d50[_0x5ad2('0x8')]][_0x5ad2('0x5b')]=_0x2e5d50['value'];}if(!_[_0x5ad2('0x25')](_0x2e5d50[_0x5ad2('0x4a')][_0x5ad2('0x5c')])){utils[_0x5ad2('0xa')](util[_0x5ad2('0xb')](_0x5ad2('0x5d'),_0x2e5d50[_0x5ad2('0x8')],_0x2e5d50[_0x5ad2('0x4b')]));channels[_0x2e5d50['uniqueid']][_0x5ad2('0x5c')]=_0x2e5d50[_0x5ad2('0x4b')];}}}catch(_0x251e21){utils[_0x5ad2('0x21')](util[_0x5ad2('0xb')](_0x5ad2('0x49'),_0x2e5d50['uniqueid']),_0x251e21);}};exports['newexten']=function(_0x3ae896){try{if(!_[_0x5ad2('0x25')](channels[_0x3ae896[_0x5ad2('0x8')]])){utils[_0x5ad2('0x1a')](util[_0x5ad2('0xb')](_0x5ad2('0x5e'),_0x3ae896[_0x5ad2('0x8')]),_0x3ae896);utils[_0x5ad2('0xa')](util[_0x5ad2('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x3ae896[_0x5ad2('0x8')],_0x3ae896[_0x5ad2('0x5f')],_0x3ae896['appdata']));if(_0x3ae896['application'][_0x5ad2('0x60')]()==_0x5ad2('0x61')&&_[_0x5ad2('0x62')](_0x3ae896['appdata'][_0x5ad2('0x60')](),_0x5ad2('0x63'))){var _0x5d02c3=_0x3ae896[_0x5ad2('0x64')][_0x5ad2('0x65')]('=');var _0x2737f6=_0x5d02c3[0x0][_0x5ad2('0x66')](_0x5d02c3[0x0]['lastIndexOf']('(')+0x1,_0x5d02c3[0x0]['lastIndexOf'](')'));var _0x2305d9=_0x5d02c3[0x1];channels[_0x3ae896[_0x5ad2('0x8')]][_0x2737f6]=_0x2305d9;}if(!_['includes']([_0x5ad2('0x2e'),'noop','execif',_0x5ad2('0x61'),_0x5ad2('0x67')],_0x3ae896[_0x5ad2('0x5f')][_0x5ad2('0x60')]())){channels[_0x3ae896[_0x5ad2('0x8')]]['lastapplication']=_0x3ae896['application'];channels[_0x3ae896[_0x5ad2('0x8')]][_0x5ad2('0x68')]=_0x3ae896[_0x5ad2('0x64')];}}}catch(_0x3f946b){utils[_0x5ad2('0x21')](util['format'](_0x5ad2('0x5e'),_0x3ae896[_0x5ad2('0x8')]),_0x3f946b);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 8b42e21..e1912fc 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 _0xdae5=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info'];(function(_0x58b5b0,_0x3f0ae4){var _0x1ce9b7=function(_0x36d75f){while(--_0x36d75f){_0x58b5b0['push'](_0x58b5b0['shift']());}};_0x1ce9b7(++_0x3f0ae4);}(_0xdae5,0xa6));var _0x5dae=function(_0xa790b1,_0x7f7b70){_0xa790b1=_0xa790b1-0x0;var _0xd1de43=_0xdae5[_0xa790b1];return _0xd1de43;};'use strict';var utils=require(_0x5dae('0x0'));exports[_0x5dae('0x1')]=function(){utils[_0x5dae('0x2')](_0x5dae('0x3'));};exports[_0x5dae('0x4')]=function(){utils['info'](_0x5dae('0x5'));};exports[_0x5dae('0x6')]=function(){utils[_0x5dae('0x2')](_0x5dae('0x7'));};exports['error']=function(_0x1ae915){utils[_0x5dae('0x8')](_0x5dae('0x9'),_0x1ae915);};exports[_0x5dae('0xa')]=function(){utils['info'](_0x5dae('0xb'));};exports[_0x5dae('0xc')]=function(_0x3be0e4){}; \ No newline at end of file +var _0xb1a8=['connect','info','[core]\x20shutdown','[core]\x20fullybooted','error','close'];(function(_0x2f997e,_0x44fcd1){var _0x42ca8b=function(_0xb9bccf){while(--_0xb9bccf){_0x2f997e['push'](_0x2f997e['shift']());}};_0x42ca8b(++_0x44fcd1);}(_0xb1a8,0x198));var _0x8b1a=function(_0x481450,_0x1906a9){_0x481450=_0x481450-0x0;var _0x2273ba=_0xb1a8[_0x481450];return _0x2273ba;};'use strict';var utils=require('./utils');exports[_0x8b1a('0x0')]=function(){utils['info']('[core]\x20connected');};exports['shutdown']=function(){utils[_0x8b1a('0x1')](_0x8b1a('0x2'));};exports['fullybooted']=function(){utils[_0x8b1a('0x1')](_0x8b1a('0x3'));};exports[_0x8b1a('0x4')]=function(_0x826b16){utils['error']('[core]\x20error',_0x826b16);};exports[_0x8b1a('0x5')]=function(){utils[_0x8b1a('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x359af0){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 4645cb2..5a963cf 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 _0x6376=['holdtime','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','debug','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','split','error','[%s][dials][newexten]','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','ANSWER','connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x6376,0x151));var _0x6637=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6376[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6637('0x0'));var util=require(_0x6637('0x1'));var utils=require(_0x6637('0x2'));var dials={};function writeDB(_0x22eb2e){utils[_0x6637('0x3')](util['format'](_0x6637('0x4'),_0x22eb2e[_0x6637('0x5')],_0x22eb2e[_0x6637('0x6')],_0x22eb2e[_0x6637('0x7')],_0x22eb2e[_0x6637('0x8')],_0x22eb2e[_0x6637('0x9')],_0x22eb2e[_0x6637('0xa')]));utils[_0x6637('0xb')]('CreateVoiceDialReport',_0x22eb2e);delete dials[_0x22eb2e[_0x6637('0x5')]];}exports['newexten']=function(_0x465653){try{utils[_0x6637('0xc')](util[_0x6637('0xd')]('[%s][dials][newexten]',_0x465653[_0x6637('0x5')]),_0x465653);utils[_0x6637('0x3')](util[_0x6637('0xd')](_0x6637('0xe'),_0x465653[_0x6637('0x5')],_0x465653[_0x6637('0xf')],_0x465653[_0x6637('0x10')]));if(_0x465653['application'][_0x6637('0x11')]()==_0x6637('0x12')&&_['startsWith'](_0x465653[_0x6637('0x10')]['toLowerCase'](),'cdr(routeid)')){var _0x37f9ee=_0x465653['appdata'][_0x6637('0x13')]('=');dials[_0x465653[_0x6637('0x5')]]={'routeId':_0x37f9ee[0x1]};}}catch(_0x3ee9ed){utils[_0x6637('0x14')](util[_0x6637('0xd')](_0x6637('0x15'),_0x465653[_0x6637('0x5')]),_0x3ee9ed);}};exports['varset']=function(_0x5a4f37){try{utils[_0x6637('0xc')](util[_0x6637('0xd')](_0x6637('0x16'),_0x5a4f37[_0x6637('0x5')]),_0x5a4f37);if(!_[_0x6637('0x17')](_0x5a4f37[_0x6637('0x18')][_0x6637('0x19')])){utils[_0x6637('0x3')](util[_0x6637('0xd')](_0x6637('0x1a'),_0x5a4f37[_0x6637('0x5')],_0x5a4f37['value']));dials[_0x5a4f37['uniqueid']]={'routeId':_0x5a4f37[_0x6637('0x1b')]};}}catch(_0x4f78e3){utils[_0x6637('0x14')](util[_0x6637('0xd')](_0x6637('0x16'),_0x5a4f37['uniqueid']),_0x4f78e3);}};exports[_0x6637('0x1c')]=function(_0x27443d){try{if(!_[_0x6637('0x17')](dials[_0x27443d['uniqueid']])){utils[_0x6637('0xc')](util[_0x6637('0xd')](_0x6637('0x1d'),_0x27443d[_0x6637('0x5')]),_0x27443d);dials[_0x27443d[_0x6637('0x5')]]=_[_0x6637('0x1e')](dials[_0x27443d[_0x6637('0x5')]],_0x27443d);dials[_0x27443d[_0x6637('0x5')]][_0x6637('0x1f')]=utils[_0x6637('0x20')]();dials[_0x27443d[_0x6637('0x5')]][_0x6637('0x21')]='called';utils['info'](util[_0x6637('0xd')](_0x6637('0x22'),_0x27443d[_0x6637('0x5')],dials[_0x27443d[_0x6637('0x5')]]['starttime']));}}catch(_0xd6e05c){utils[_0x6637('0x14')](util['format'](_0x6637('0x1d'),_0x27443d[_0x6637('0x5')]),_0xd6e05c);}};exports['dialend']=function(_0x381a79){try{if(!_[_0x6637('0x17')](dials[_0x381a79[_0x6637('0x5')]])){utils[_0x6637('0xc')](util['format']('[%s][dials][dialend]',_0x381a79[_0x6637('0x5')]),_0x381a79);dials[_0x381a79[_0x6637('0x5')]][_0x6637('0xa')]=_0x381a79[_0x6637('0xa')];if(_0x381a79['dialstatus']==_0x6637('0x23')){dials[_0x381a79[_0x6637('0x5')]]=_['assign'](dials[_0x381a79[_0x6637('0x5')]],_0x381a79);dials[_0x381a79[_0x6637('0x5')]]['answertime']=utils[_0x6637('0x20')]();dials[_0x381a79[_0x6637('0x5')]][_0x6637('0x21')]=_0x6637('0x24');utils['info'](util[_0x6637('0xd')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x381a79['uniqueid'],_0x381a79[_0x6637('0xa')],dials[_0x381a79[_0x6637('0x5')]][_0x6637('0x25')]));}else{utils[_0x6637('0x3')](util[_0x6637('0xd')](_0x6637('0x26'),_0x381a79[_0x6637('0x5')],_0x381a79[_0x6637('0xa')]));}}}catch(_0x5a08d2){utils[_0x6637('0x14')](util['format']('[%s][dials][dialend]',_0x381a79[_0x6637('0x5')]),_0x5a08d2);}};exports['hangup']=function(_0x3c564e){try{if(!_[_0x6637('0x17')](dials[_0x3c564e[_0x6637('0x5')]])){utils[_0x6637('0xc')](util[_0x6637('0xd')](_0x6637('0x27'),_0x3c564e['uniqueid']),_0x3c564e);utils[_0x6637('0x3')](util[_0x6637('0xd')](_0x6637('0x28'),_0x3c564e[_0x6637('0x5')],_0x3c564e[_0x6637('0x8')],_0x3c564e[_0x6637('0x29')],_0x3c564e[_0x6637('0x2a')]));dials[_0x3c564e[_0x6637('0x5')]]=_[_0x6637('0x1e')](dials[_0x3c564e[_0x6637('0x5')]],{'endtime':utils[_0x6637('0x20')](),'lastevent':_0x6637('0x2b')});dials[_0x3c564e['uniqueid']][_0x6637('0x2c')]=utils[_0x6637('0x2d')](dials[_0x3c564e[_0x6637('0x5')]][_0x6637('0x2e')],dials[_0x3c564e[_0x6637('0x5')]][_0x6637('0x1f')]);dials[_0x3c564e[_0x6637('0x5')]][_0x6637('0x2f')]=utils[_0x6637('0x2d')](dials[_0x3c564e[_0x6637('0x5')]][_0x6637('0x25')]||dials[_0x3c564e[_0x6637('0x5')]][_0x6637('0x2e')],dials[_0x3c564e[_0x6637('0x5')]][_0x6637('0x1f')]);dials[_0x3c564e[_0x6637('0x5')]]['billableseconds']=dials[_0x3c564e['uniqueid']][_0x6637('0x25')]?utils[_0x6637('0x2d')](dials[_0x3c564e['uniqueid']][_0x6637('0x2e')],dials[_0x3c564e[_0x6637('0x5')]][_0x6637('0x25')]):0x0;writeDB(dials[_0x3c564e[_0x6637('0x5')]]);}}catch(_0x1b3392){utils[_0x6637('0x14')](util[_0x6637('0xd')](_0x6637('0x27'),_0x3c564e[_0x6637('0x5')]),_0x1b3392);}}; \ No newline at end of file +var _0x14d0=['dialstatus','request','CreateVoiceDialReport','debug','format','[%s][dials][newexten]','info','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','holdtime','diffTime','endtime','billableseconds','lodash','uniqueid','channel','dialstring','calleridnum','connectedlinenum'];(function(_0x3f126a,_0x579f8d){var _0x5e6715=function(_0x1151b3){while(--_0x1151b3){_0x3f126a['push'](_0x3f126a['shift']());}};_0x5e6715(++_0x579f8d);}(_0x14d0,0x11a));var _0x014d=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0x14d0[_0x44dba1];return _0x2fbd3f;};'use strict';var _=require(_0x014d('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x2e4e72){utils['info'](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x2e4e72[_0x014d('0x1')],_0x2e4e72[_0x014d('0x2')],_0x2e4e72[_0x014d('0x3')],_0x2e4e72[_0x014d('0x4')],_0x2e4e72[_0x014d('0x5')],_0x2e4e72[_0x014d('0x6')]));utils[_0x014d('0x7')](_0x014d('0x8'),_0x2e4e72);delete dials[_0x2e4e72[_0x014d('0x1')]];}exports['newexten']=function(_0x32ab9c){try{utils[_0x014d('0x9')](util[_0x014d('0xa')](_0x014d('0xb'),_0x32ab9c[_0x014d('0x1')]),_0x32ab9c);utils[_0x014d('0xc')](util[_0x014d('0xa')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x32ab9c[_0x014d('0x1')],_0x32ab9c[_0x014d('0xd')],_0x32ab9c[_0x014d('0xe')]));if(_0x32ab9c[_0x014d('0xd')][_0x014d('0xf')]()==_0x014d('0x10')&&_[_0x014d('0x11')](_0x32ab9c['appdata'][_0x014d('0xf')](),_0x014d('0x12'))){var _0x216bd0=_0x32ab9c[_0x014d('0xe')]['split']('=');dials[_0x32ab9c['uniqueid']]={'routeId':_0x216bd0[0x1]};}}catch(_0x50c79d){utils[_0x014d('0x13')](util[_0x014d('0xa')]('[%s][dials][newexten]',_0x32ab9c[_0x014d('0x1')]),_0x50c79d);}};exports['varset']=function(_0x5b34a2){try{utils[_0x014d('0x9')](util[_0x014d('0xa')]('[%s][dials][varset]',_0x5b34a2[_0x014d('0x1')]),_0x5b34a2);if(!_[_0x014d('0x14')](_0x5b34a2[_0x014d('0x15')][_0x014d('0x16')])){utils['info'](util[_0x014d('0xa')](_0x014d('0x17'),_0x5b34a2['uniqueid'],_0x5b34a2[_0x014d('0x18')]));dials[_0x5b34a2['uniqueid']]={'routeId':_0x5b34a2['value']};}}catch(_0x3b0673){utils[_0x014d('0x13')](util[_0x014d('0xa')]('[%s][dials][varset]',_0x5b34a2[_0x014d('0x1')]),_0x3b0673);}};exports[_0x014d('0x19')]=function(_0x4636b8){try{if(!_[_0x014d('0x14')](dials[_0x4636b8[_0x014d('0x1')]])){utils[_0x014d('0x9')](util['format'](_0x014d('0x1a'),_0x4636b8[_0x014d('0x1')]),_0x4636b8);dials[_0x4636b8[_0x014d('0x1')]]=_['assign'](dials[_0x4636b8[_0x014d('0x1')]],_0x4636b8);dials[_0x4636b8[_0x014d('0x1')]][_0x014d('0x1b')]=utils[_0x014d('0x1c')]();dials[_0x4636b8[_0x014d('0x1')]][_0x014d('0x1d')]=_0x014d('0x1e');utils[_0x014d('0xc')](util[_0x014d('0xa')](_0x014d('0x1f'),_0x4636b8[_0x014d('0x1')],dials[_0x4636b8['uniqueid']][_0x014d('0x1b')]));}}catch(_0xb9063b){utils[_0x014d('0x13')](util['format'](_0x014d('0x1a'),_0x4636b8[_0x014d('0x1')]),_0xb9063b);}};exports[_0x014d('0x20')]=function(_0x4f6211){try{if(!_['isNil'](dials[_0x4f6211['uniqueid']])){utils['debug'](util['format']('[%s][dials][dialend]',_0x4f6211[_0x014d('0x1')]),_0x4f6211);dials[_0x4f6211['uniqueid']][_0x014d('0x6')]=_0x4f6211['dialstatus'];if(_0x4f6211[_0x014d('0x6')]==_0x014d('0x21')){dials[_0x4f6211[_0x014d('0x1')]]=_[_0x014d('0x22')](dials[_0x4f6211['uniqueid']],_0x4f6211);dials[_0x4f6211[_0x014d('0x1')]][_0x014d('0x23')]=utils[_0x014d('0x1c')]();dials[_0x4f6211[_0x014d('0x1')]][_0x014d('0x1d')]=_0x014d('0x24');utils[_0x014d('0xc')](util[_0x014d('0xa')](_0x014d('0x25'),_0x4f6211[_0x014d('0x1')],_0x4f6211[_0x014d('0x6')],dials[_0x4f6211[_0x014d('0x1')]]['answertime']));}else{utils[_0x014d('0xc')](util[_0x014d('0xa')](_0x014d('0x26'),_0x4f6211[_0x014d('0x1')],_0x4f6211[_0x014d('0x6')]));}}}catch(_0x7770c3){utils[_0x014d('0x13')](util[_0x014d('0xa')]('[%s][dials][dialend]',_0x4f6211[_0x014d('0x1')]),_0x7770c3);}};exports[_0x014d('0x27')]=function(_0x5a9f67){try{if(!_[_0x014d('0x14')](dials[_0x5a9f67[_0x014d('0x1')]])){utils[_0x014d('0x9')](util[_0x014d('0xa')](_0x014d('0x28'),_0x5a9f67[_0x014d('0x1')]),_0x5a9f67);utils[_0x014d('0xc')](util[_0x014d('0xa')](_0x014d('0x29'),_0x5a9f67[_0x014d('0x1')],_0x5a9f67['calleridnum'],_0x5a9f67[_0x014d('0x2a')],_0x5a9f67['cause-txt']));dials[_0x5a9f67['uniqueid']]=_[_0x014d('0x22')](dials[_0x5a9f67[_0x014d('0x1')]],{'endtime':utils[_0x014d('0x1c')](),'lastevent':_0x014d('0x2b')});dials[_0x5a9f67['uniqueid']]['duration']=utils['diffTime'](dials[_0x5a9f67[_0x014d('0x1')]]['endtime'],dials[_0x5a9f67[_0x014d('0x1')]]['starttime']);dials[_0x5a9f67[_0x014d('0x1')]][_0x014d('0x2c')]=utils[_0x014d('0x2d')](dials[_0x5a9f67['uniqueid']][_0x014d('0x23')]||dials[_0x5a9f67[_0x014d('0x1')]][_0x014d('0x2e')],dials[_0x5a9f67[_0x014d('0x1')]][_0x014d('0x1b')]);dials[_0x5a9f67[_0x014d('0x1')]][_0x014d('0x2f')]=dials[_0x5a9f67['uniqueid']][_0x014d('0x23')]?utils[_0x014d('0x2d')](dials[_0x5a9f67[_0x014d('0x1')]][_0x014d('0x2e')],dials[_0x5a9f67[_0x014d('0x1')]]['answertime']):0x0;writeDB(dials[_0x5a9f67[_0x014d('0x1')]]);}}catch(_0x519a10){utils[_0x014d('0x13')](util[_0x014d('0xa')](_0x014d('0x28'),_0x5a9f67[_0x014d('0x1')]),_0x519a10);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 87866e9..babcdec 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 _0x8cde=['XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','devicestatechange','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentconnect]','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','asterisk','port','username','password','keepConnected','xdr'];(function(_0x5f4331,_0x1f7ee6){var _0x1cfaee=function(_0x36a231){while(--_0x36a231){_0x5f4331['push'](_0x5f4331['shift']());}};_0x1cfaee(++_0x1f7ee6);}(_0x8cde,0x13c));var _0xe8cd=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x8cde[_0x1305e3];return _0x1068e9;};var AsteriskManager=require(_0xe8cd('0x0'));var config=require(_0xe8cd('0x1'));var utils=require(_0xe8cd('0x2'));var util=require('util');var ami=new AsteriskManager(config[_0xe8cd('0x3')][_0xe8cd('0x4')],config[_0xe8cd('0x3')]['ip'],config[_0xe8cd('0x3')][_0xe8cd('0x5')],config['asterisk'][_0xe8cd('0x6')],!![]);ami[_0xe8cd('0x7')]();if(config[_0xe8cd('0x8')]&&config[_0xe8cd('0x8')]['disabled']){utils['info'](_0xe8cd('0x9'));}else{var agents=require(_0xe8cd('0xa'));var calls=require(_0xe8cd('0xb'));var queues=require(_0xe8cd('0xc'));var recordings=require(_0xe8cd('0xd'));var members=require(_0xe8cd('0xe'));var dials=require(_0xe8cd('0xf'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0xe8cd('0x10'),core[_0xe8cd('0x10')]);ami['on'](_0xe8cd('0x11'),core[_0xe8cd('0x11')]);ami['on'](_0xe8cd('0x12'),core[_0xe8cd('0x12')]);ami['on'](_0xe8cd('0x13'),core[_0xe8cd('0x13')]);ami['on'](_0xe8cd('0x14'),core[_0xe8cd('0x14')]);ami['on'](_0xe8cd('0x15'),core[_0xe8cd('0x15')]);ami['on']('devicestatechange',function(_0x436eb9){try{utils[_0xe8cd('0x16')](util[_0xe8cd('0x17')]('[%s][index][devicestatechange]',_0x436eb9['device']),_0x436eb9);members[_0xe8cd('0x18')](_0x436eb9);}catch(_0xa2d70f){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')](_0xe8cd('0x19'),_0x436eb9[_0xe8cd('0x1a')]),_0xa2d70f);}});ami['on']('agentcalled',function(_0x205220){try{utils[_0xe8cd('0x16')](util[_0xe8cd('0x17')](_0xe8cd('0x1b'),_0x205220[_0xe8cd('0x1c')]),_0x205220);agents[_0xe8cd('0x1d')](_0x205220);}catch(_0x154c4f){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')](_0xe8cd('0x1b'),_0x205220[_0xe8cd('0x1c')]),_0x154c4f);}});ami['on'](_0xe8cd('0x1e'),function(_0xbdda49){try{utils[_0xe8cd('0x16')](util[_0xe8cd('0x17')]('[%s][index][agentringnoanswer]',_0xbdda49[_0xe8cd('0x1c')]),_0xbdda49);agents['agentringnoanswer'](_0xbdda49);}catch(_0xb70f2b){utils[_0xe8cd('0x13')](util['format']('[%s][index][agentringnoanswer]',_0xbdda49[_0xe8cd('0x1c')]),_0xb70f2b);}});ami['on']('agentconnect',function(_0x21e5c9){try{utils[_0xe8cd('0x16')](util[_0xe8cd('0x17')](_0xe8cd('0x1f'),_0x21e5c9[_0xe8cd('0x1c')]),_0x21e5c9);agents[_0xe8cd('0x20')](_0x21e5c9);queues[_0xe8cd('0x20')](_0x21e5c9);}catch(_0xd8381f){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')]('[%s][index][agentconnect]',_0x21e5c9[_0xe8cd('0x1c')]),_0xd8381f);}});ami['on']('agentcomplete',function(_0x98f998){try{utils['debug'](util[_0xe8cd('0x17')](_0xe8cd('0x21'),_0x98f998['uniqueid']),_0x98f998);agents[_0xe8cd('0x22')](_0x98f998);queues[_0xe8cd('0x22')](_0x98f998);members[_0xe8cd('0x22')](_0x98f998);}catch(_0x21b5ff){utils['error'](util['format'](_0xe8cd('0x21'),_0x98f998['uniqueid']),_0x21b5ff);}});ami['on'](_0xe8cd('0x23'),function(_0x2000ca){try{utils['debug'](util[_0xe8cd('0x17')]('[%s][index][queuecallerabandon]',_0x2000ca['uniqueid']),_0x2000ca);agents[_0xe8cd('0x23')](_0x2000ca);queues[_0xe8cd('0x23')](_0x2000ca);}catch(_0x269841){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')]('[%s][index][queuecallerabandon]',_0x2000ca[_0xe8cd('0x1c')]),_0x269841);}});ami['on'](_0xe8cd('0x24'),function(_0x3c3534){try{utils[_0xe8cd('0x16')](util['format'](_0xe8cd('0x25'),_0x3c3534[_0xe8cd('0x1c')]),_0x3c3534);queues[_0xe8cd('0x24')](_0x3c3534);recordings[_0xe8cd('0x24')](_0x3c3534);}catch(_0x4dcae0){utils['error'](util[_0xe8cd('0x17')](_0xe8cd('0x25'),_0x3c3534[_0xe8cd('0x1c')]),_0x4dcae0);}});ami['on'](_0xe8cd('0x26'),function(_0x5b5402){try{utils[_0xe8cd('0x16')](util[_0xe8cd('0x17')](_0xe8cd('0x27'),_0x5b5402[_0xe8cd('0x1c')]),_0x5b5402);queues[_0xe8cd('0x26')](_0x5b5402);}catch(_0x1b8edb){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')](_0xe8cd('0x27'),_0x5b5402[_0xe8cd('0x1c')]),_0x1b8edb);}});ami['on'](_0xe8cd('0x28'),function(_0x23ef70){try{utils[_0xe8cd('0x16')](util['format'](_0xe8cd('0x29'),_0x23ef70[_0xe8cd('0x1c')]),_0x23ef70);queues[_0xe8cd('0x28')](_0x23ef70);calls[_0xe8cd('0x28')](_0x23ef70);}catch(_0x420d09){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')](_0xe8cd('0x29'),_0x23ef70[_0xe8cd('0x1c')]),_0x420d09);}});ami['on'](_0xe8cd('0x2a'),function(_0x33a183){try{utils['debug'](util[_0xe8cd('0x17')](_0xe8cd('0x2b'),_0x33a183['uniqueid']),_0x33a183);queues[_0xe8cd('0x2a')](_0x33a183);calls[_0xe8cd('0x2a')](_0x33a183);}catch(_0x3b2cee){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')]('[%s][index][musiconholdstop]',_0x33a183[_0xe8cd('0x1c')]),_0x3b2cee);}});ami['on'](_0xe8cd('0x2c'),function(_0x1f200e){try{utils[_0xe8cd('0x16')](util[_0xe8cd('0x17')](_0xe8cd('0x2d'),_0x1f200e[_0xe8cd('0x1c')]),_0x1f200e);calls[_0xe8cd('0x2c')](_0x1f200e);recordings[_0xe8cd('0x2c')](_0x1f200e);}catch(_0x142e30){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')](_0xe8cd('0x2d'),_0x1f200e[_0xe8cd('0x1c')]),_0x142e30);}});ami['on'](_0xe8cd('0x2e'),function(_0x35ab81){try{utils[_0xe8cd('0x16')](util['format'](_0xe8cd('0x2f'),_0x35ab81[_0xe8cd('0x1c')]),_0x35ab81);calls[_0xe8cd('0x2e')](_0x35ab81);recordings[_0xe8cd('0x2e')](_0x35ab81);dials['hangup'](_0x35ab81);agents[_0xe8cd('0x2e')](_0x35ab81);queues[_0xe8cd('0x2e')](_0x35ab81);}catch(_0x12c3dc){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')](_0xe8cd('0x2f'),_0x35ab81[_0xe8cd('0x1c')]),_0x12c3dc);}});ami['on'](_0xe8cd('0x30'),function(_0x383b51){try{utils[_0xe8cd('0x16')](util[_0xe8cd('0x17')]('[%s][index][cdr]',_0x383b51['uniqueid']),_0x383b51);members[_0xe8cd('0x30')](_0x383b51);}catch(_0x49871b){utils[_0xe8cd('0x13')](util['format'](_0xe8cd('0x31'),_0x383b51['uniqueid']),_0x49871b);}});ami['on'](_0xe8cd('0x32'),function(_0x403268){try{utils[_0xe8cd('0x16')](util[_0xe8cd('0x17')](_0xe8cd('0x33'),_0x403268[_0xe8cd('0x1c')]),_0x403268);queues[_0xe8cd('0x32')](_0x403268);agents['blindtransfer'](_0x403268);transfers[_0xe8cd('0x32')](_0x403268);}catch(_0x583ab7){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')](_0xe8cd('0x33'),_0x403268[_0xe8cd('0x1c')]),_0x583ab7);}});ami['on'](_0xe8cd('0x34'),function(_0x46a63e){try{utils[_0xe8cd('0x16')](util[_0xe8cd('0x17')]('[%s][index][attendedtransfer]',_0x46a63e[_0xe8cd('0x35')]),_0x46a63e);queues[_0xe8cd('0x34')](_0x46a63e);transfers[_0xe8cd('0x34')](_0x46a63e);agents['attendedtransfer'](_0x46a63e);calls[_0xe8cd('0x34')](_0x46a63e);}catch(_0x43d285){utils['error'](util[_0xe8cd('0x17')](_0xe8cd('0x36'),_0x46a63e['origtransfereruniqueid']),_0x43d285);}});ami['on']('varset',function(_0x518f67){try{utils[_0xe8cd('0x16')](util[_0xe8cd('0x17')](_0xe8cd('0x37'),_0x518f67['uniqueid']),_0x518f67);queues[_0xe8cd('0x38')](_0x518f67);recordings[_0xe8cd('0x38')](_0x518f67);calls['varset'](_0x518f67);dials['varset'](_0x518f67);}catch(_0xd967e4){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')](_0xe8cd('0x37'),_0x518f67[_0xe8cd('0x1c')]),_0xd967e4);}});ami['on'](_0xe8cd('0x39'),function(_0x3a4e6e){try{utils[_0xe8cd('0x16')](util['format'](_0xe8cd('0x3a'),_0x3a4e6e[_0xe8cd('0x1c')]),_0x3a4e6e);calls[_0xe8cd('0x39')](_0x3a4e6e);recordings[_0xe8cd('0x39')](_0x3a4e6e);dials[_0xe8cd('0x39')](_0x3a4e6e);}catch(_0x1ad756){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')](_0xe8cd('0x3a'),_0x3a4e6e['uniqueid']),_0x1ad756);}});ami['on'](_0xe8cd('0x3b'),function(_0x45a49c){try{utils['debug'](util[_0xe8cd('0x17')]('[%s][index][newchannel]',_0x45a49c[_0xe8cd('0x1c')]),_0x45a49c);calls[_0xe8cd('0x3b')](_0x45a49c);recordings[_0xe8cd('0x3b')](_0x45a49c);}catch(_0x1e4cc3){utils['error'](util[_0xe8cd('0x17')](_0xe8cd('0x3c'),_0x45a49c[_0xe8cd('0x1c')]),_0x1e4cc3);}});ami['on']('dialbegin',function(_0x5e1d72){try{utils[_0xe8cd('0x16')](util['format'](_0xe8cd('0x3d'),_0x5e1d72['uniqueid']),_0x5e1d72);dials['dialbegin'](_0x5e1d72);}catch(_0x25c7a2){utils[_0xe8cd('0x13')](util['format'](_0xe8cd('0x3e'),_0x5e1d72[_0xe8cd('0x1c')]),_0x25c7a2);}});ami['on'](_0xe8cd('0x3f'),function(_0x4168ad){try{utils['debug'](util[_0xe8cd('0x17')](_0xe8cd('0x40'),_0x4168ad[_0xe8cd('0x1c')]),_0x4168ad);dials[_0xe8cd('0x3f')](_0x4168ad);}catch(_0x8991bd){utils[_0xe8cd('0x13')](util[_0xe8cd('0x17')](_0xe8cd('0x40'),_0x4168ad[_0xe8cd('0x1c')]),_0x8991bd);}});} \ No newline at end of file +var _0xc2f5=['asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','password','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','[%s][index][devicestatechange]','device','devicestatechange','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]'];(function(_0x2eef7f,_0x45db1c){var _0x286ffa=function(_0x2336b2){while(--_0x2336b2){_0x2eef7f['push'](_0x2eef7f['shift']());}};_0x286ffa(++_0x45db1c);}(_0xc2f5,0x114));var _0x5c2f=function(_0x3d0113,_0x1c3a5f){_0x3d0113=_0x3d0113-0x0;var _0x40d13b=_0xc2f5[_0x3d0113];return _0x40d13b;};var AsteriskManager=require(_0x5c2f('0x0'));var config=require(_0x5c2f('0x1'));var utils=require(_0x5c2f('0x2'));var util=require(_0x5c2f('0x3'));var ami=new AsteriskManager(config[_0x5c2f('0x4')][_0x5c2f('0x5')],config['asterisk']['ip'],config[_0x5c2f('0x4')][_0x5c2f('0x6')],config[_0x5c2f('0x4')][_0x5c2f('0x7')],!![]);ami['keepConnected']();if(config[_0x5c2f('0x8')]&&config['xdr'][_0x5c2f('0x9')]){utils['info'](_0x5c2f('0xa'));}else{var agents=require(_0x5c2f('0xb'));var calls=require(_0x5c2f('0xc'));var queues=require(_0x5c2f('0xd'));var recordings=require(_0x5c2f('0xe'));var members=require(_0x5c2f('0xf'));var dials=require(_0x5c2f('0x10'));var transfers=require(_0x5c2f('0x11'));var core=require('./core.controller');ami['on']('connect',core[_0x5c2f('0x12')]);ami['on']('shutdown',core[_0x5c2f('0x13')]);ami['on']('fullybooted',core[_0x5c2f('0x14')]);ami['on'](_0x5c2f('0x15'),core['error']);ami['on'](_0x5c2f('0x16'),core['close']);ami['on'](_0x5c2f('0x17'),core[_0x5c2f('0x17')]);ami['on']('devicestatechange',function(_0x13e4f7){try{utils[_0x5c2f('0x18')](util['format'](_0x5c2f('0x19'),_0x13e4f7[_0x5c2f('0x1a')]),_0x13e4f7);members[_0x5c2f('0x1b')](_0x13e4f7);}catch(_0x1fba05){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x19'),_0x13e4f7[_0x5c2f('0x1a')]),_0x1fba05);}});ami['on']('agentcalled',function(_0x2b0bdd){try{utils['debug'](util[_0x5c2f('0x1c')](_0x5c2f('0x1d'),_0x2b0bdd[_0x5c2f('0x1e')]),_0x2b0bdd);agents['agentcalled'](_0x2b0bdd);}catch(_0x503c81){utils['error'](util[_0x5c2f('0x1c')](_0x5c2f('0x1d'),_0x2b0bdd[_0x5c2f('0x1e')]),_0x503c81);}});ami['on'](_0x5c2f('0x1f'),function(_0x5b1c63){try{utils['debug'](util[_0x5c2f('0x1c')](_0x5c2f('0x20'),_0x5b1c63[_0x5c2f('0x1e')]),_0x5b1c63);agents[_0x5c2f('0x1f')](_0x5b1c63);}catch(_0x20f629){utils['error'](util[_0x5c2f('0x1c')](_0x5c2f('0x20'),_0x5b1c63[_0x5c2f('0x1e')]),_0x20f629);}});ami['on'](_0x5c2f('0x21'),function(_0x51a006){try{utils['debug'](util[_0x5c2f('0x1c')](_0x5c2f('0x22'),_0x51a006[_0x5c2f('0x1e')]),_0x51a006);agents['agentconnect'](_0x51a006);queues['agentconnect'](_0x51a006);}catch(_0x31bf2e){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x22'),_0x51a006['uniqueid']),_0x31bf2e);}});ami['on'](_0x5c2f('0x23'),function(_0x4583aa){try{utils[_0x5c2f('0x18')](util[_0x5c2f('0x1c')](_0x5c2f('0x24'),_0x4583aa[_0x5c2f('0x1e')]),_0x4583aa);agents[_0x5c2f('0x23')](_0x4583aa);queues['agentcomplete'](_0x4583aa);members[_0x5c2f('0x23')](_0x4583aa);}catch(_0x44c210){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x24'),_0x4583aa['uniqueid']),_0x44c210);}});ami['on'](_0x5c2f('0x25'),function(_0x2f4945){try{utils[_0x5c2f('0x18')](util['format'](_0x5c2f('0x26'),_0x2f4945[_0x5c2f('0x1e')]),_0x2f4945);agents['queuecallerabandon'](_0x2f4945);queues[_0x5c2f('0x25')](_0x2f4945);}catch(_0x1c4b99){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x26'),_0x2f4945[_0x5c2f('0x1e')]),_0x1c4b99);}});ami['on'](_0x5c2f('0x27'),function(_0x1c1c6f){try{utils[_0x5c2f('0x18')](util[_0x5c2f('0x1c')](_0x5c2f('0x28'),_0x1c1c6f[_0x5c2f('0x1e')]),_0x1c1c6f);queues[_0x5c2f('0x27')](_0x1c1c6f);recordings[_0x5c2f('0x27')](_0x1c1c6f);}catch(_0x293765){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x28'),_0x1c1c6f[_0x5c2f('0x1e')]),_0x293765);}});ami['on'](_0x5c2f('0x29'),function(_0x429aff){try{utils[_0x5c2f('0x18')](util[_0x5c2f('0x1c')](_0x5c2f('0x2a'),_0x429aff['uniqueid']),_0x429aff);queues['queuecallerleave'](_0x429aff);}catch(_0x242f42){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x2a'),_0x429aff[_0x5c2f('0x1e')]),_0x242f42);}});ami['on'](_0x5c2f('0x2b'),function(_0x5cefa2){try{utils[_0x5c2f('0x18')](util['format'](_0x5c2f('0x2c'),_0x5cefa2[_0x5c2f('0x1e')]),_0x5cefa2);queues[_0x5c2f('0x2b')](_0x5cefa2);calls['musiconholdstart'](_0x5cefa2);}catch(_0x15eb7c){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x2c'),_0x5cefa2[_0x5c2f('0x1e')]),_0x15eb7c);}});ami['on'](_0x5c2f('0x2d'),function(_0x5cfc39){try{utils[_0x5c2f('0x18')](util['format'](_0x5c2f('0x2e'),_0x5cfc39['uniqueid']),_0x5cfc39);queues[_0x5c2f('0x2d')](_0x5cfc39);calls[_0x5c2f('0x2d')](_0x5cfc39);}catch(_0x24a49a){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x2e'),_0x5cfc39[_0x5c2f('0x1e')]),_0x24a49a);}});ami['on']('newstate',function(_0x2143cf){try{utils[_0x5c2f('0x18')](util[_0x5c2f('0x1c')](_0x5c2f('0x2f'),_0x2143cf['uniqueid']),_0x2143cf);calls[_0x5c2f('0x30')](_0x2143cf);recordings[_0x5c2f('0x30')](_0x2143cf);}catch(_0x58948d){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x2f'),_0x2143cf[_0x5c2f('0x1e')]),_0x58948d);}});ami['on'](_0x5c2f('0x31'),function(_0x2b79e3){try{utils[_0x5c2f('0x18')](util[_0x5c2f('0x1c')](_0x5c2f('0x32'),_0x2b79e3[_0x5c2f('0x1e')]),_0x2b79e3);calls[_0x5c2f('0x31')](_0x2b79e3);recordings[_0x5c2f('0x31')](_0x2b79e3);dials[_0x5c2f('0x31')](_0x2b79e3);agents['hangup'](_0x2b79e3);queues['hangup'](_0x2b79e3);}catch(_0x48b10a){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x32'),_0x2b79e3['uniqueid']),_0x48b10a);}});ami['on'](_0x5c2f('0x33'),function(_0x5558e0){try{utils[_0x5c2f('0x18')](util[_0x5c2f('0x1c')](_0x5c2f('0x34'),_0x5558e0[_0x5c2f('0x1e')]),_0x5558e0);members[_0x5c2f('0x33')](_0x5558e0);}catch(_0x6051de){utils[_0x5c2f('0x15')](util['format']('[%s][index][cdr]',_0x5558e0['uniqueid']),_0x6051de);}});ami['on'](_0x5c2f('0x35'),function(_0x435a44){try{utils[_0x5c2f('0x18')](util[_0x5c2f('0x1c')](_0x5c2f('0x36'),_0x435a44[_0x5c2f('0x1e')]),_0x435a44);queues[_0x5c2f('0x35')](_0x435a44);agents[_0x5c2f('0x35')](_0x435a44);transfers['blindtransfer'](_0x435a44);}catch(_0x4ae62a){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x36'),_0x435a44[_0x5c2f('0x1e')]),_0x4ae62a);}});ami['on'](_0x5c2f('0x37'),function(_0x191dff){try{utils[_0x5c2f('0x18')](util[_0x5c2f('0x1c')](_0x5c2f('0x38'),_0x191dff[_0x5c2f('0x39')]),_0x191dff);queues[_0x5c2f('0x37')](_0x191dff);transfers[_0x5c2f('0x37')](_0x191dff);agents[_0x5c2f('0x37')](_0x191dff);calls['attendedtransfer'](_0x191dff);}catch(_0x451eaf){utils[_0x5c2f('0x15')](util['format'](_0x5c2f('0x38'),_0x191dff['origtransfereruniqueid']),_0x451eaf);}});ami['on'](_0x5c2f('0x3a'),function(_0x2b8007){try{utils['debug'](util[_0x5c2f('0x1c')](_0x5c2f('0x3b'),_0x2b8007[_0x5c2f('0x1e')]),_0x2b8007);queues[_0x5c2f('0x3a')](_0x2b8007);recordings[_0x5c2f('0x3a')](_0x2b8007);calls[_0x5c2f('0x3a')](_0x2b8007);dials[_0x5c2f('0x3a')](_0x2b8007);}catch(_0x18d875){utils[_0x5c2f('0x15')](util['format'](_0x5c2f('0x3b'),_0x2b8007[_0x5c2f('0x1e')]),_0x18d875);}});ami['on']('newexten',function(_0x2693cc){try{utils[_0x5c2f('0x18')](util['format'](_0x5c2f('0x3c'),_0x2693cc[_0x5c2f('0x1e')]),_0x2693cc);calls[_0x5c2f('0x3d')](_0x2693cc);recordings[_0x5c2f('0x3d')](_0x2693cc);dials[_0x5c2f('0x3d')](_0x2693cc);}catch(_0x2d63d9){utils['error'](util[_0x5c2f('0x1c')](_0x5c2f('0x3c'),_0x2693cc[_0x5c2f('0x1e')]),_0x2d63d9);}});ami['on'](_0x5c2f('0x3e'),function(_0x2c85ac){try{utils[_0x5c2f('0x18')](util[_0x5c2f('0x1c')](_0x5c2f('0x3f'),_0x2c85ac[_0x5c2f('0x1e')]),_0x2c85ac);calls['newchannel'](_0x2c85ac);recordings[_0x5c2f('0x3e')](_0x2c85ac);}catch(_0x2aac7e){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x3f'),_0x2c85ac['uniqueid']),_0x2aac7e);}});ami['on']('dialbegin',function(_0x5b2e5a){try{utils[_0x5c2f('0x18')](util[_0x5c2f('0x1c')](_0x5c2f('0x40'),_0x5b2e5a[_0x5c2f('0x1e')]),_0x5b2e5a);dials[_0x5c2f('0x41')](_0x5b2e5a);}catch(_0x42fffe){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x42'),_0x5b2e5a[_0x5c2f('0x1e')]),_0x42fffe);}});ami['on'](_0x5c2f('0x43'),function(_0x562d04){try{utils[_0x5c2f('0x18')](util[_0x5c2f('0x1c')](_0x5c2f('0x44'),_0x562d04[_0x5c2f('0x1e')]),_0x562d04);dials[_0x5c2f('0x43')](_0x562d04);}catch(_0x8fdc9e){utils[_0x5c2f('0x15')](util[_0x5c2f('0x1c')](_0x5c2f('0x44'),_0x562d04[_0x5c2f('0x1e')]),_0x8fdc9e);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 40ee6ec..497817c 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 _0xebdd=['format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','type','interface','then','name','internal','CreateMemberReport','getUserByName','split','request','catch','error','startsWith','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','source','data3','destination','data1','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:'];(function(_0x485476,_0x5f03ba){var _0x4e2edb=function(_0x53d90c){while(--_0x53d90c){_0x485476['push'](_0x485476['shift']());}};_0x4e2edb(++_0x5f03ba);}(_0xebdd,0x9a));var _0xdebd=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0xebdd[_0x836465];return _0x2150ea;};'use strict';var _=require(_0xdebd('0x0'));var util=require(_0xdebd('0x1'));var utils=require(_0xdebd('0x2'));var members={};var exclude=[_0xdebd('0x3'),_0xdebd('0x4')];function writeDB(_0x512786){utils['info'](util[_0xdebd('0x5')](_0xdebd('0x6'),_0x512786[_0xdebd('0x7')],_0x512786['interface'],_0x512786[_0xdebd('0x8')],_0x512786[_0xdebd('0x9')],_0x512786[_0xdebd('0xa')],_0x512786[_0xdebd('0xb')]));if(_0x512786['interface']){utils['getUserByInterface'](_0x512786[_0xdebd('0xc')])[_0xdebd('0xd')](function(_0x11341c){if(_0x11341c){_0x512786[_0xdebd('0xa')]=_0x11341c[_0xdebd('0xe')];_0x512786['internal']=_0x11341c[_0xdebd('0xf')];utils['request'](_0xdebd('0x10'),_0x512786);}else{utils[_0xdebd('0x11')](_0x512786['interface'][_0xdebd('0x12')]('/')[0x1])[_0xdebd('0xd')](function(_0x45017c){if(_0x45017c){_0x512786[_0xdebd('0xa')]=_0x45017c[_0xdebd('0xe')];_0x512786['internal']=_0x45017c[_0xdebd('0xf')];utils[_0xdebd('0x13')]('CreateMemberReport',_0x512786);}});}})[_0xdebd('0x14')](function(_0x35c6aa){utils[_0xdebd('0x15')](util[_0xdebd('0x5')]('[%s][members][writeDB]',_0x512786['uniqueid']),_0x35c6aa);});}delete members[_0x512786['interface']];}function startsWith(_0x3fd9f4,_0x1d32d0){return _['some'](_0x3fd9f4,function(_0x147d42){return _[_0xdebd('0x16')](_0x1d32d0,_0x147d42);});}exports['devicestatechange']=function(_0x586d24){try{utils[_0xdebd('0x17')](util[_0xdebd('0x5')](_0xdebd('0x18'),members[_0x586d24[_0xdebd('0x19')]]?members[_0x586d24[_0xdebd('0x19')]][_0xdebd('0x7')]:_0x586d24['device']),_0x586d24);utils[_0xdebd('0x1a')](util['format'](_0xdebd('0x1b'),members[_0x586d24[_0xdebd('0x19')]]?members[_0x586d24[_0xdebd('0x19')]]['uniqueid']:_0x586d24[_0xdebd('0x19')],_0x586d24[_0xdebd('0x1c')],_0x586d24[_0xdebd('0x19')]));switch(_0x586d24[_0xdebd('0x1c')]){case _0xdebd('0x1d'):case _0xdebd('0x1e'):if(!startsWith(exclude,_0x586d24[_0xdebd('0x19')])){members[_0x586d24[_0xdebd('0x19')]]={'channel':_0xdebd('0x1f'),'interface':_0x586d24[_0xdebd('0x19')],'type':_0xdebd('0x20'),'enterAt':utils['now'](),'role':_0xdebd('0x21')};}break;case _0xdebd('0x22'):if(!_[_0xdebd('0x23')](members[_0x586d24[_0xdebd('0x19')]])){members[_0x586d24[_0xdebd('0x19')]][_0xdebd('0x24')]=utils['now']();members[_0x586d24[_0xdebd('0x19')]][_0xdebd('0x25')]=utils[_0xdebd('0x26')](members[_0x586d24[_0xdebd('0x19')]]['exitAt'],members[_0x586d24[_0xdebd('0x19')]][_0xdebd('0x27')]);if(members[_0x586d24[_0xdebd('0x19')]]['uniqueid']){writeDB(members[_0x586d24[_0xdebd('0x19')]]);}}break;default:break;}}catch(_0x601690){utils['error'](util[_0xdebd('0x5')](_0xdebd('0x18'),members[_0x586d24[_0xdebd('0x19')]]?members[_0x586d24['device']][_0xdebd('0x7')]:_0x586d24[_0xdebd('0x19')]),_0x601690);}};exports[_0xdebd('0x28')]=function(_0xc9c195){try{if(!_[_0xdebd('0x23')](members[_0xc9c195[_0xdebd('0xc')]])){utils[_0xdebd('0x17')](util['format']('[%s][members][agentcomplete]',_0xc9c195['uniqueid']),_0xc9c195);utils[_0xdebd('0x1a')](util[_0xdebd('0x5')](_0xdebd('0x29'),_0xc9c195[_0xdebd('0x7')],_0xc9c195[_0xdebd('0xc')],_0xc9c195[_0xdebd('0x2a')]));members[_0xc9c195[_0xdebd('0xc')]]=_[_0xdebd('0x2b')](members[_0xc9c195[_0xdebd('0xc')]],{'data4':_0xc9c195[_0xdebd('0x2a')],'uniqueid':_0xc9c195['uniqueid']});}}catch(_0x1c1eeb){utils[_0xdebd('0x15')](util['format'](_0xdebd('0x2c'),_0xc9c195[_0xdebd('0x7')]),_0x1c1eeb);}};exports[_0xdebd('0x2d')]=function(_0x1ab00e){try{utils[_0xdebd('0x17')](util[_0xdebd('0x5')](_0xdebd('0x2e'),_0x1ab00e[_0xdebd('0x7')]),_0x1ab00e);if(_0x1ab00e[_0xdebd('0x8')]){var _0x4f167f=_0x1ab00e[_0xdebd('0x8')]['split']('-')[0x0];if(!_[_0xdebd('0x23')](members[_0x4f167f])){members[_0x4f167f]=_['assign'](members[_0x4f167f],{'data1':members[_0x4f167f]['data1']||_0x1ab00e[_0xdebd('0xb')],'data2':members[_0x4f167f][_0xdebd('0x9')]||_0x1ab00e[_0xdebd('0x2f')],'data3':members[_0x4f167f][_0xdebd('0x30')]||_0x1ab00e[_0xdebd('0x31')],'uniqueid':members[_0x4f167f][_0xdebd('0x7')]||_0x1ab00e[_0xdebd('0x7')]});utils[_0xdebd('0x1a')](util[_0xdebd('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1ab00e[_0xdebd('0x7')],members[_0x4f167f][_0xdebd('0x32')],members[_0x4f167f][_0xdebd('0x9')],members[_0x4f167f][_0xdebd('0x30')]));if(members[_0x4f167f][_0xdebd('0x24')]){writeDB(members[_0x4f167f]);}}}if(_0x1ab00e[_0xdebd('0x33')]){var _0x45e729=_0x1ab00e['destinationchannel'][_0xdebd('0x12')]('-')[0x0];if(!_['isNil'](members[_0x45e729])){members[_0x45e729]=_[_0xdebd('0x2b')](members[_0x45e729],{'data1':members[_0x45e729][_0xdebd('0x32')]||_0x1ab00e[_0xdebd('0xb')],'data2':members[_0x45e729][_0xdebd('0x9')]||_0x1ab00e[_0xdebd('0x2f')],'data3':members[_0x45e729]['data3']||_0x1ab00e[_0xdebd('0x31')],'uniqueid':members[_0x45e729]['uniqueid']||_0x1ab00e[_0xdebd('0x7')]});utils['info'](util[_0xdebd('0x5')](_0xdebd('0x34'),_0x1ab00e['uniqueid'],members[_0x45e729][_0xdebd('0x32')],members[_0x45e729][_0xdebd('0x9')],members[_0x45e729][_0xdebd('0x30')]));if(members[_0x45e729]['exitAt']){writeDB(members[_0x45e729]);}}}}catch(_0xfac261){utils[_0xdebd('0x15')](util[_0xdebd('0x5')](_0xdebd('0x2e'),_0x1ab00e[_0xdebd('0x7')]),_0xfac261);}}; \ No newline at end of file +var _0x49f5=['catch','error','some','startsWith','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','channel','data1','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','source','destination','lodash','util','Local/_attended@transfer','format','uniqueid','data2','type','getUserByInterface','membername','name','internal','CreateMemberReport','getUserByName','interface','split','then'];(function(_0x401d4e,_0x2f6357){var _0x382ee1=function(_0x46190b){while(--_0x46190b){_0x401d4e['push'](_0x401d4e['shift']());}};_0x382ee1(++_0x2f6357);}(_0x49f5,0x180));var _0x549f=function(_0x375233,_0x165da0){_0x375233=_0x375233-0x0;var _0xb1fac5=_0x49f5[_0x375233];return _0xb1fac5;};'use strict';var _=require(_0x549f('0x0'));var util=require(_0x549f('0x1'));var utils=require('./utils');var members={};var exclude=[_0x549f('0x2'),'Queue:'];function writeDB(_0x2d61d1){utils['info'](util[_0x549f('0x3')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x2d61d1[_0x549f('0x4')],_0x2d61d1['interface'],_0x2d61d1['channel'],_0x2d61d1[_0x549f('0x5')],_0x2d61d1['membername'],_0x2d61d1[_0x549f('0x6')]));if(_0x2d61d1['interface']){utils[_0x549f('0x7')](_0x2d61d1['interface'])['then'](function(_0xb14439){if(_0xb14439){_0x2d61d1[_0x549f('0x8')]=_0xb14439[_0x549f('0x9')];_0x2d61d1[_0x549f('0xa')]=_0xb14439[_0x549f('0xa')];utils['request'](_0x549f('0xb'),_0x2d61d1);}else{utils[_0x549f('0xc')](_0x2d61d1[_0x549f('0xd')][_0x549f('0xe')]('/')[0x1])[_0x549f('0xf')](function(_0x1d47b6){if(_0x1d47b6){_0x2d61d1[_0x549f('0x8')]=_0x1d47b6[_0x549f('0x9')];_0x2d61d1[_0x549f('0xa')]=_0x1d47b6[_0x549f('0xa')];utils['request'](_0x549f('0xb'),_0x2d61d1);}});}})[_0x549f('0x10')](function(_0xb126dc){utils[_0x549f('0x11')](util[_0x549f('0x3')]('[%s][members][writeDB]',_0x2d61d1[_0x549f('0x4')]),_0xb126dc);});}delete members[_0x2d61d1[_0x549f('0xd')]];}function startsWith(_0x2f66c0,_0x48ae62){return _[_0x549f('0x12')](_0x2f66c0,function(_0x328ba2){return _[_0x549f('0x13')](_0x48ae62,_0x328ba2);});}exports['devicestatechange']=function(_0x5c3266){try{utils[_0x549f('0x14')](util['format'](_0x549f('0x15'),members[_0x5c3266[_0x549f('0x16')]]?members[_0x5c3266['device']][_0x549f('0x4')]:_0x5c3266[_0x549f('0x16')]),_0x5c3266);utils[_0x549f('0x17')](util[_0x549f('0x3')](_0x549f('0x18'),members[_0x5c3266['device']]?members[_0x5c3266[_0x549f('0x16')]][_0x549f('0x4')]:_0x5c3266[_0x549f('0x16')],_0x5c3266[_0x549f('0x19')],_0x5c3266['device']));switch(_0x5c3266[_0x549f('0x19')]){case _0x549f('0x1a'):case'BUSY':if(!startsWith(exclude,_0x5c3266[_0x549f('0x16')])){members[_0x5c3266[_0x549f('0x16')]]={'channel':_0x549f('0x1b'),'interface':_0x5c3266['device'],'type':'TALKING','enterAt':utils[_0x549f('0x1c')](),'role':_0x549f('0x1d')};}break;case _0x549f('0x1e'):if(!_[_0x549f('0x1f')](members[_0x5c3266['device']])){members[_0x5c3266['device']][_0x549f('0x20')]=utils[_0x549f('0x1c')]();members[_0x5c3266[_0x549f('0x16')]][_0x549f('0x21')]=utils[_0x549f('0x22')](members[_0x5c3266['device']][_0x549f('0x20')],members[_0x5c3266[_0x549f('0x16')]][_0x549f('0x23')]);if(members[_0x5c3266[_0x549f('0x16')]][_0x549f('0x4')]){writeDB(members[_0x5c3266['device']]);}}break;default:break;}}catch(_0x4de4cc){utils[_0x549f('0x11')](util[_0x549f('0x3')](_0x549f('0x15'),members[_0x5c3266['device']]?members[_0x5c3266['device']][_0x549f('0x4')]:_0x5c3266[_0x549f('0x16')]),_0x4de4cc);}};exports[_0x549f('0x24')]=function(_0xed61f8){try{if(!_['isNil'](members[_0xed61f8[_0x549f('0xd')]])){utils[_0x549f('0x14')](util[_0x549f('0x3')]('[%s][members][agentcomplete]',_0xed61f8[_0x549f('0x4')]),_0xed61f8);utils[_0x549f('0x17')](util[_0x549f('0x3')](_0x549f('0x25'),_0xed61f8[_0x549f('0x4')],_0xed61f8[_0x549f('0xd')],_0xed61f8[_0x549f('0x26')]));members[_0xed61f8[_0x549f('0xd')]]=_[_0x549f('0x27')](members[_0xed61f8['interface']],{'data4':_0xed61f8[_0x549f('0x26')],'uniqueid':_0xed61f8[_0x549f('0x4')]});}}catch(_0x1d9138){utils[_0x549f('0x11')](util[_0x549f('0x3')](_0x549f('0x28'),_0xed61f8[_0x549f('0x4')]),_0x1d9138);}};exports[_0x549f('0x29')]=function(_0x1a63bd){try{utils[_0x549f('0x14')](util[_0x549f('0x3')](_0x549f('0x2a'),_0x1a63bd[_0x549f('0x4')]),_0x1a63bd);if(_0x1a63bd[_0x549f('0x2b')]){var _0x12b51e=_0x1a63bd['channel'][_0x549f('0xe')]('-')[0x0];if(!_[_0x549f('0x1f')](members[_0x12b51e])){members[_0x12b51e]=_[_0x549f('0x27')](members[_0x12b51e],{'data1':members[_0x12b51e][_0x549f('0x2c')]||_0x1a63bd['type'],'data2':members[_0x12b51e][_0x549f('0x5')]||_0x1a63bd['source'],'data3':members[_0x12b51e]['data3']||_0x1a63bd['destination'],'uniqueid':members[_0x12b51e]['uniqueid']||_0x1a63bd[_0x549f('0x4')]});utils[_0x549f('0x17')](util[_0x549f('0x3')](_0x549f('0x2d'),_0x1a63bd[_0x549f('0x4')],members[_0x12b51e][_0x549f('0x2c')],members[_0x12b51e][_0x549f('0x5')],members[_0x12b51e][_0x549f('0x2e')]));if(members[_0x12b51e]['exitAt']){writeDB(members[_0x12b51e]);}}}if(_0x1a63bd[_0x549f('0x2f')]){var _0x49ad88=_0x1a63bd['destinationchannel']['split']('-')[0x0];if(!_[_0x549f('0x1f')](members[_0x49ad88])){members[_0x49ad88]=_[_0x549f('0x27')](members[_0x49ad88],{'data1':members[_0x49ad88][_0x549f('0x2c')]||_0x1a63bd['type'],'data2':members[_0x49ad88][_0x549f('0x5')]||_0x1a63bd[_0x549f('0x30')],'data3':members[_0x49ad88]['data3']||_0x1a63bd[_0x549f('0x31')],'uniqueid':members[_0x49ad88][_0x549f('0x4')]||_0x1a63bd[_0x549f('0x4')]});utils[_0x549f('0x17')](util[_0x549f('0x3')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1a63bd[_0x549f('0x4')],members[_0x49ad88]['data1'],members[_0x49ad88]['data2'],members[_0x49ad88][_0x549f('0x2e')]));if(members[_0x49ad88][_0x549f('0x20')]){writeDB(members[_0x49ad88]);}}}}catch(_0x4725e8){utils[_0x549f('0x11')](util[_0x549f('0x3')]('[%s][members][cdr]',_0x1a63bd[_0x549f('0x4')]),_0x4725e8);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 1396367..54b7073 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 _0x6c45=['variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerleaveAt','count','connectedlinename','error','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','queuecallerenterreason','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','position','assign','now','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]'];(function(_0x5e74d1,_0x5ae721){var _0x4f65c4=function(_0x89fef9){while(--_0x89fef9){_0x5e74d1['push'](_0x5e74d1['shift']());}};_0x4f65c4(++_0x5ae721);}(_0x6c45,0xb1));var _0x56c4=function(_0x47e35d,_0x25acd4){_0x47e35d=_0x47e35d-0x0;var _0x4dd275=_0x6c45[_0x47e35d];return _0x4dd275;};'use strict';var _=require(_0x56c4('0x0'));var util=require(_0x56c4('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x2f7ee3){utils[_0x56c4('0x2')](util[_0x56c4('0x3')](_0x56c4('0x4'),_0x2f7ee3[_0x56c4('0x5')],_0x2f7ee3[_0x56c4('0x6')],_0x2f7ee3[_0x56c4('0x7')],_0x2f7ee3[_0x56c4('0x8')],_0x2f7ee3[_0x56c4('0x9')],_0x2f7ee3[_0x56c4('0xa')],_0x2f7ee3[_0x56c4('0xb')]));if(_0x2f7ee3[_0x56c4('0x7')]){utils[_0x56c4('0xc')](_0x2f7ee3[_0x56c4('0x7')])[_0x56c4('0xd')](function(_0x38dbd7){if(_0x38dbd7){_0x2f7ee3[_0x56c4('0xe')]=_0x38dbd7[_0x56c4('0xe')];}utils[_0x56c4('0xf')](_0x56c4('0x10'),_0x2f7ee3);});}else{utils['request'](_0x56c4('0x10'),_0x2f7ee3);}if(_0x2f7ee3[_0x56c4('0x11')]){delete queues[_0x2f7ee3[_0x56c4('0x11')]];}else{delete queues[_0x2f7ee3[_0x56c4('0x5')]];}}exports['queuecallerjoin']=function(_0x34603e){try{utils[_0x56c4('0x12')](util[_0x56c4('0x3')](_0x56c4('0x13'),_0x34603e['uniqueid']),_0x34603e);utils[_0x56c4('0x2')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x34603e[_0x56c4('0x5')],_0x34603e[_0x56c4('0x7')],_0x34603e[_0x56c4('0x14')]));queues[_0x34603e[_0x56c4('0x5')]]=_[_0x56c4('0x15')](_0x34603e,{'originalposition':_0x34603e['position'],'queuecallerjoinAt':utils[_0x56c4('0x16')](),'mohtime':0x0});}catch(_0x4279ac){utils['error'](util[_0x56c4('0x3')](_0x56c4('0x13'),_0x34603e[_0x56c4('0x5')]),_0x4279ac);}};exports[_0x56c4('0x17')]=function(_0x5c54bd){try{if(!_[_0x56c4('0x18')](queues[_0x5c54bd[_0x56c4('0x5')]])){utils['debug'](util[_0x56c4('0x3')](_0x56c4('0x19'),_0x5c54bd[_0x56c4('0x5')]),_0x5c54bd);if(queues[_0x5c54bd[_0x56c4('0x5')]]['queuecallerleaveAt']){if(!queues[_0x5c54bd[_0x56c4('0x5')]][_0x56c4('0x1a')]&&!queues[_0x5c54bd[_0x56c4('0x5')]][_0x56c4('0x1b')]){queues[_0x5c54bd[_0x56c4('0x5')]][_0x56c4('0x1c')]=!![];queues[_0x5c54bd['uniqueid']]['queuecallercompleteAt']=utils[_0x56c4('0x16')]();queues[_0x5c54bd[_0x56c4('0x5')]]['queuecallerexitreason']=_0x56c4('0x1d');}utils[_0x56c4('0x2')](util[_0x56c4('0x3')](_0x56c4('0x1e'),_0x5c54bd[_0x56c4('0x5')],queues[_0x5c54bd[_0x56c4('0x5')]][_0x56c4('0x1f')],queues[_0x5c54bd['uniqueid']][_0x56c4('0xb')]));writeDB(queues[_0x5c54bd[_0x56c4('0x5')]]);}else if(queues[_0x5c54bd[_0x56c4('0x5')]]['transfereduniqueid']){utils[_0x56c4('0x2')](util['format'](_0x56c4('0x20'),_0x5c54bd[_0x56c4('0x5')],queues[_0x5c54bd['uniqueid']][_0x56c4('0x1f')],queues[_0x5c54bd[_0x56c4('0x5')]]['transfereduniqueid']));queues[queues[_0x5c54bd['uniqueid']]['transfereduniqueid']]=queues[_0x5c54bd[_0x56c4('0x5')]];queues[queues[_0x5c54bd[_0x56c4('0x5')]][_0x56c4('0x11')]]['queuecallerenterreason']=0x2;delete queues[_0x5c54bd[_0x56c4('0x5')]];}}}catch(_0x575d79){utils['error'](util[_0x56c4('0x3')](_0x56c4('0x19'),_0x5c54bd[_0x56c4('0x5')]),_0x575d79);}};exports[_0x56c4('0x21')]=function(_0x3f9cc0){try{utils[_0x56c4('0x12')](util[_0x56c4('0x3')](_0x56c4('0x22'),_0x3f9cc0['uniqueid']),_0x3f9cc0);if(!_[_0x56c4('0x18')](_0x3f9cc0[_0x56c4('0x23')][_0x56c4('0x24')])&&_0x3f9cc0['value'][_0x56c4('0x25')]()!==_0x56c4('0x26')){if(!_[_0x56c4('0x18')](queues[_0x3f9cc0['uniqueid']])){queues[_0x3f9cc0[_0x56c4('0x5')]][_0x56c4('0x1a')]=![];queues[_0x3f9cc0['uniqueid']][_0x56c4('0x27')]=null;queues[_0x3f9cc0['uniqueid']][_0x56c4('0x1b')]=!![];queues[_0x3f9cc0[_0x56c4('0x5')]][_0x56c4('0x28')]=utils[_0x56c4('0x16')]();queues[_0x3f9cc0[_0x56c4('0x5')]]['queuecallerexitreason']=_0x3f9cc0['value'][_0x56c4('0x25')]();utils[_0x56c4('0x2')](util[_0x56c4('0x3')](_0x56c4('0x29'),_0x3f9cc0[_0x56c4('0x5')],queues[_0x3f9cc0['uniqueid']][_0x56c4('0x1f')],_0x3f9cc0[_0x56c4('0x2a')],queues[_0x3f9cc0[_0x56c4('0x5')]][_0x56c4('0xb')]));writeDB(queues[_0x3f9cc0[_0x56c4('0x5')]]);}}else if(!_[_0x56c4('0x18')](_0x3f9cc0[_0x56c4('0x23')]['queueposition'])){if(!_['isNil'](queues[_0x3f9cc0[_0x56c4('0x5')]])&&!queues[_0x3f9cc0[_0x56c4('0x5')]][_0x56c4('0x1a')]){queues[_0x3f9cc0[_0x56c4('0x5')]][_0x56c4('0x1a')]=![];queues[_0x3f9cc0['uniqueid']]['queuecallerabandonAt']=null;queues[_0x3f9cc0[_0x56c4('0x5')]]['queuecallerexit']=!![];queues[_0x3f9cc0[_0x56c4('0x5')]][_0x56c4('0x28')]=utils[_0x56c4('0x16')]();queues[_0x3f9cc0[_0x56c4('0x5')]]['queuecallerexitreason']=_0x56c4('0x2b');utils[_0x56c4('0x2')](util[_0x56c4('0x3')](_0x56c4('0x2c'),_0x3f9cc0[_0x56c4('0x5')],queues[_0x3f9cc0[_0x56c4('0x5')]][_0x56c4('0x1f')],_0x3f9cc0['value'],queues[_0x3f9cc0['uniqueid']][_0x56c4('0xb')]));}}}catch(_0x2479a1){utils['error'](util[_0x56c4('0x3')](_0x56c4('0x22'),_0x3f9cc0['uniqueid']),_0x2479a1);}};exports[_0x56c4('0x1a')]=function(_0x11816a){try{if(!_['isNil'](queues[_0x11816a['uniqueid']])){utils[_0x56c4('0x12')](util[_0x56c4('0x3')](_0x56c4('0x2d'),_0x11816a[_0x56c4('0x5')]),_0x11816a);queues[_0x11816a['uniqueid']]['queuecallerexit']=![];queues[_0x11816a['uniqueid']][_0x56c4('0x28')]=null;queues[_0x11816a[_0x56c4('0x5')]][_0x56c4('0x1a')]=!![];queues[_0x11816a['uniqueid']][_0x56c4('0x27')]=utils[_0x56c4('0x16')]();queues[_0x11816a['uniqueid']][_0x56c4('0xb')]=_0x56c4('0x2e');utils[_0x56c4('0x2')](util[_0x56c4('0x3')](_0x56c4('0x2f'),_0x11816a[_0x56c4('0x5')],queues[_0x11816a[_0x56c4('0x5')]]['name'],queues[_0x11816a['uniqueid']][_0x56c4('0xb')]));}}catch(_0x57cb07){utils['error'](util[_0x56c4('0x3')]('[%s][queues][queuecallerabandon]',_0x11816a[_0x56c4('0x5')]),_0x57cb07);}};exports[_0x56c4('0x30')]=function(_0x46a671){try{if(!_[_0x56c4('0x18')](queues[_0x46a671['uniqueid']])){utils[_0x56c4('0x12')](util[_0x56c4('0x3')]('[%s][queues][queuecallerleave]',_0x46a671['uniqueid']),_0x46a671);utils['info'](util['format'](_0x56c4('0x31'),_0x46a671['uniqueid'],queues[_0x46a671[_0x56c4('0x5')]]['name'],_0x46a671[_0x56c4('0x32')],_0x46a671['connectedlinename']));queues[_0x46a671[_0x56c4('0x5')]]['queuecallerleave']=!![];queues[_0x46a671[_0x56c4('0x5')]]['queuecallerleaveAt']=utils['now']();queues[_0x46a671[_0x56c4('0x5')]][_0x56c4('0x33')]=utils[_0x56c4('0x34')](queues[_0x46a671[_0x56c4('0x5')]][_0x56c4('0x35')],queues[_0x46a671[_0x56c4('0x5')]]['queuecallerjoinAt']);queues[_0x46a671[_0x56c4('0x5')]][_0x56c4('0x14')]=_0x46a671[_0x56c4('0x14')];queues[_0x46a671[_0x56c4('0x5')]][_0x56c4('0x36')]=_0x46a671[_0x56c4('0x36')];queues[_0x46a671[_0x56c4('0x5')]][_0x56c4('0x32')]=_0x46a671['connectedlinenum'];queues[_0x46a671[_0x56c4('0x5')]][_0x56c4('0x37')]=_0x46a671['connectedlinename'];}}catch(_0x427fa4){utils[_0x56c4('0x38')](util['format'](_0x56c4('0x39'),_0x46a671[_0x56c4('0x5')]),_0x427fa4);}};exports[_0x56c4('0x3a')]=function(_0x227001){try{if(!_[_0x56c4('0x18')](queues[_0x227001['uniqueid']])){utils[_0x56c4('0x12')](util['format'](_0x56c4('0x3b'),_0x227001[_0x56c4('0x5')]),_0x227001);utils['info'](util[_0x56c4('0x3')](_0x56c4('0x3c'),_0x227001[_0x56c4('0x5')],queues[_0x227001['uniqueid']][_0x56c4('0x1f')],_0x227001[_0x56c4('0x3d')],_0x227001[_0x56c4('0x3e')]));queues[_0x227001['uniqueid']]['queuecallerabandon']=![];queues[_0x227001[_0x56c4('0x5')]][_0x56c4('0x1a')]=![];queues[_0x227001['uniqueid']][_0x56c4('0x27')]=null;queues[_0x227001[_0x56c4('0x5')]][_0x56c4('0x1b')]=![];queues[_0x227001[_0x56c4('0x5')]]['queuecallerexitreason']=null;queues[_0x227001[_0x56c4('0x5')]][_0x56c4('0x28')]=null;queues[_0x227001[_0x56c4('0x5')]][_0x56c4('0x3f')]=!![];queues[_0x227001['uniqueid']][_0x56c4('0xa')]=_0x227001['destaccountcode'];queues[_0x227001[_0x56c4('0x5')]][_0x56c4('0x8')]=_0x227001['membername'];}}catch(_0x2328b7){utils[_0x56c4('0x38')](util['format']('[%s][queues][agentconnect]',_0x227001[_0x56c4('0x5')]),_0x2328b7);}};exports[_0x56c4('0x40')]=function(_0x5e27a8){try{if(!_[_0x56c4('0x18')](queues[_0x5e27a8[_0x56c4('0x5')]])){if(queues[_0x5e27a8[_0x56c4('0x5')]][_0x56c4('0x35')]){utils[_0x56c4('0x12')](util[_0x56c4('0x3')](_0x56c4('0x41'),_0x5e27a8[_0x56c4('0x5')]),_0x5e27a8);queues[_0x5e27a8[_0x56c4('0x5')]][_0x56c4('0x1a')]=![];queues[_0x5e27a8['uniqueid']][_0x56c4('0x1a')]=![];queues[_0x5e27a8[_0x56c4('0x5')]][_0x56c4('0x27')]=null;queues[_0x5e27a8[_0x56c4('0x5')]][_0x56c4('0x1b')]=![];queues[_0x5e27a8[_0x56c4('0x5')]][_0x56c4('0x28')]=null;queues[_0x5e27a8[_0x56c4('0x5')]][_0x56c4('0x3f')]=!![];queues[_0x5e27a8[_0x56c4('0x5')]]['lastAssignedTo']=_0x5e27a8[_0x56c4('0x3d')];queues[_0x5e27a8[_0x56c4('0x5')]][_0x56c4('0x1c')]=!![];queues[_0x5e27a8['uniqueid']][_0x56c4('0x42')]=utils['now']();if(_0x5e27a8[_0x56c4('0x43')]==_0x56c4('0x44')){if(!queues[_0x5e27a8[_0x56c4('0x5')]][_0x56c4('0x44')]){queues[_0x5e27a8[_0x56c4('0x5')]][_0x56c4('0xb')]=_0x56c4('0x45');}}else{queues[_0x5e27a8[_0x56c4('0x5')]][_0x56c4('0xb')]='COMPLETEDBY'+_0x5e27a8[_0x56c4('0x43')]['toUpperCase']();}utils['info'](util[_0x56c4('0x3')](_0x56c4('0x46'),_0x5e27a8['uniqueid'],queues[_0x5e27a8[_0x56c4('0x5')]]['name'],_0x5e27a8['membername'],queues[_0x5e27a8[_0x56c4('0x5')]][_0x56c4('0xb')]));writeDB(queues[_0x5e27a8['uniqueid']]);}}}catch(_0x1172f9){utils[_0x56c4('0x38')](util[_0x56c4('0x3')](_0x56c4('0x41'),_0x5e27a8[_0x56c4('0x5')]),_0x1172f9);}};exports[_0x56c4('0x47')]=function(_0x196904){try{if(!_[_0x56c4('0x18')](queues[_0x196904['transfereeuniqueid']])){utils[_0x56c4('0x12')](util[_0x56c4('0x3')]('[%s][queues][blindtransfer]',_0x196904[_0x56c4('0x5')]),_0x196904);queues[_0x196904['transfereeuniqueid']]['transfer']=!![];queues[_0x196904[_0x56c4('0x48')]][_0x56c4('0x49')]=_0x56c4('0x4a');queues[_0x196904[_0x56c4('0x48')]]['transferexten']=_0x196904[_0x56c4('0x4b')];queues[_0x196904[_0x56c4('0x48')]][_0x56c4('0x4c')]=_0x196904[_0x56c4('0x48')];queues[_0x196904[_0x56c4('0x48')]][_0x56c4('0xb')]=_0x56c4('0x4d');utils[_0x56c4('0x2')](util['format'](_0x56c4('0x4e'),_0x196904[_0x56c4('0x5')],queues[_0x196904[_0x56c4('0x48')]][_0x56c4('0x1f')],_0x196904['transfereeuniqueid'],_0x196904[_0x56c4('0x4b')]));}}catch(_0x5c4161){utils[_0x56c4('0x38')](util['format']('[%s][queues][blindtransfer]',_0x196904[_0x56c4('0x5')]),_0x5c4161);}};exports['attendedtransfer']=function(_0x5c7be4){try{utils['debug'](util['format'](_0x56c4('0x4f'),_0x5c7be4[_0x56c4('0x50')]),_0x5c7be4);if(_0x5c7be4[_0x56c4('0x50')]==_0x5c7be4['origtransfererlinkedid']){if(!_[_0x56c4('0x18')](queues[_0x5c7be4['secondtransfererlinkedid']])){utils[_0x56c4('0x2')](util['format'](_0x56c4('0x51'),_0x5c7be4[_0x56c4('0x50')],queues[_0x5c7be4[_0x56c4('0x52')]]['name'],_0x5c7be4[_0x56c4('0x53')]));queues[_0x5c7be4[_0x56c4('0x52')]]['transfer']=!![];queues[_0x5c7be4['secondtransfererlinkedid']][_0x56c4('0x49')]=_0x56c4('0x54');queues[_0x5c7be4['secondtransfererlinkedid']][_0x56c4('0x55')]=_0x5c7be4[_0x56c4('0x53')];queues[_0x5c7be4['secondtransfererlinkedid']]['transferuniqueid']=_0x5c7be4['origtransfereruniqueid'];queues[_0x5c7be4[_0x56c4('0x52')]][_0x56c4('0xb')]=_0x56c4('0x56');}if(!_['isNil'](queues[_0x5c7be4[_0x56c4('0x57')]])){if(_0x5c7be4[_0x56c4('0x58')]&&queues[_0x5c7be4[_0x56c4('0x58')]]){queues[_0x5c7be4['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x5c7be4[_0x56c4('0x48')]]=_[_0x56c4('0x59')](queues[_0x5c7be4['transfereelinkedid']]);queues[_0x5c7be4[_0x56c4('0x48')]]['transfereduniqueid']=_0x5c7be4['transfertargetuniqueid'];queues[_0x5c7be4['transfereeuniqueid']][_0x56c4('0x5a')]=0x2;queues[_0x5c7be4[_0x56c4('0x48')]][_0x56c4('0x9')]=queues[_0x5c7be4[_0x56c4('0x52')]][_0x56c4('0x9')];queues[_0x5c7be4[_0x56c4('0x48')]][_0x56c4('0x5b')]=queues[_0x5c7be4[_0x56c4('0x52')]]['calleridname'];queues[_0x5c7be4[_0x56c4('0x48')]][_0x56c4('0x5c')]=utils['now']();queues[_0x5c7be4[_0x56c4('0x48')]][_0x56c4('0x35')]=utils[_0x56c4('0x16')]();queues[_0x5c7be4[_0x56c4('0x48')]]['holdtime']=0x0;queues[_0x5c7be4[_0x56c4('0x48')]][_0x56c4('0x5d')]=0x0;utils['info'](util['format'](_0x56c4('0x5e'),_0x5c7be4[_0x56c4('0x50')],queues[_0x5c7be4[_0x56c4('0x48')]]['name'],queues[_0x5c7be4[_0x56c4('0x48')]]['calleridnum'],queues[_0x5c7be4['transfereeuniqueid']]['calleridname']));}else{utils[_0x56c4('0x2')](util['format'](_0x56c4('0x5f'),_0x5c7be4[_0x56c4('0x50')],queues[_0x5c7be4[_0x56c4('0x57')]][_0x56c4('0x1f')],_0x5c7be4['secondtransfererlinkedid']));queues[_0x5c7be4['origtransfererlinkedid']][_0x56c4('0x11')]=_0x5c7be4['secondtransfererlinkedid'];}}}else if(_0x5c7be4[_0x56c4('0x60')]==_0x5c7be4[_0x56c4('0x52')]){if(!_[_0x56c4('0x18')](queues[_0x5c7be4['origtransfererlinkedid']])){utils[_0x56c4('0x2')](util[_0x56c4('0x3')](_0x56c4('0x61'),_0x5c7be4[_0x56c4('0x50')],queues[_0x5c7be4[_0x56c4('0x57')]][_0x56c4('0x1f')],_0x5c7be4['secondtransfereruniqueid'],_0x5c7be4['secondtransfererexten']));queues[_0x5c7be4[_0x56c4('0x57')]][_0x56c4('0x44')]=!![];queues[_0x5c7be4[_0x56c4('0x57')]][_0x56c4('0x49')]=_0x56c4('0x54');queues[_0x5c7be4[_0x56c4('0x57')]][_0x56c4('0x55')]=_0x5c7be4[_0x56c4('0x62')];queues[_0x5c7be4['origtransfererlinkedid']]['transferuniqueid']=_0x5c7be4[_0x56c4('0x60')];queues[_0x5c7be4['origtransfererlinkedid']][_0x56c4('0xb')]=_0x56c4('0x56');}if(!_[_0x56c4('0x18')](queues[_0x5c7be4[_0x56c4('0x52')]])){if(_0x5c7be4[_0x56c4('0x63')]&&queues[_0x5c7be4['transfertargetlinkedid']]){queues[_0x5c7be4[_0x56c4('0x63')]][_0x56c4('0x5a')]=0x1;queues[_0x5c7be4[_0x56c4('0x64')]]=_['clone'](queues[_0x5c7be4[_0x56c4('0x63')]]);queues[_0x5c7be4[_0x56c4('0x64')]][_0x56c4('0x11')]=_0x5c7be4[_0x56c4('0x64')];queues[_0x5c7be4[_0x56c4('0x64')]][_0x56c4('0x5a')]=0x2;queues[_0x5c7be4[_0x56c4('0x64')]][_0x56c4('0x9')]=queues[_0x5c7be4['origtransfererlinkedid']]['calleridnum'];queues[_0x5c7be4['transfertargetuniqueid']]['calleridname']=queues[_0x5c7be4[_0x56c4('0x57')]][_0x56c4('0x5b')];queues[_0x5c7be4[_0x56c4('0x64')]][_0x56c4('0x5c')]=utils[_0x56c4('0x16')]();queues[_0x5c7be4[_0x56c4('0x64')]][_0x56c4('0x35')]=utils[_0x56c4('0x16')]();queues[_0x5c7be4[_0x56c4('0x64')]][_0x56c4('0x33')]=0x0;queues[_0x5c7be4[_0x56c4('0x64')]][_0x56c4('0x5d')]=0x0;utils[_0x56c4('0x2')](util[_0x56c4('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x5c7be4[_0x56c4('0x50')],queues[_0x5c7be4['transfertargetuniqueid']][_0x56c4('0x1f')],queues[_0x5c7be4[_0x56c4('0x64')]][_0x56c4('0x11')],queues[_0x5c7be4[_0x56c4('0x64')]][_0x56c4('0x9')],queues[_0x5c7be4['transfertargetuniqueid']][_0x56c4('0x5b')]));}else{utils[_0x56c4('0x2')](util[_0x56c4('0x3')](_0x56c4('0x5f'),_0x5c7be4[_0x56c4('0x50')],queues[_0x5c7be4[_0x56c4('0x52')]][_0x56c4('0x1f')],_0x5c7be4[_0x56c4('0x57')]));queues[_0x5c7be4[_0x56c4('0x52')]]['transfereduniqueid']=_0x5c7be4[_0x56c4('0x57')];}}}}catch(_0x343d49){utils[_0x56c4('0x38')](util[_0x56c4('0x3')](_0x56c4('0x4f'),_0x5c7be4['origtransfereruniqueid']),_0x343d49);}};exports[_0x56c4('0x65')]=function(_0x27addf){try{if(!_['isNil'](queues[_0x27addf[_0x56c4('0x5')]])){utils['debug'](util['format']('[%s][queues][musiconholdstart]',_0x27addf['uniqueid']),_0x27addf);queues[_0x27addf[_0x56c4('0x5')]][_0x56c4('0x66')]=utils['now']();utils[_0x56c4('0x2')](util[_0x56c4('0x3')](_0x56c4('0x67'),_0x27addf['uniqueid'],queues[_0x27addf[_0x56c4('0x5')]][_0x56c4('0x1f')],queues[_0x27addf[_0x56c4('0x5')]]['musiconholdstartAt']));}}catch(_0x819045){utils[_0x56c4('0x38')](util[_0x56c4('0x3')]('[%s][queues][musiconholdstart]',_0x27addf['uniqueid']),_0x819045);}};exports['musiconholdstop']=function(_0x312444){try{if(!_[_0x56c4('0x18')](queues[_0x312444[_0x56c4('0x5')]])){if(!_[_0x56c4('0x18')](queues[_0x312444[_0x56c4('0x5')]][_0x56c4('0x66')])){utils[_0x56c4('0x12')](util[_0x56c4('0x3')](_0x56c4('0x68'),_0x312444['uniqueid']),_0x312444);queues[_0x312444['uniqueid']]['mohtime']+=utils['diffTime'](utils[_0x56c4('0x16')](),queues[_0x312444[_0x56c4('0x5')]][_0x56c4('0x66')]);utils['info'](util[_0x56c4('0x3')](_0x56c4('0x69'),_0x312444['uniqueid'],queues[_0x312444['uniqueid']][_0x56c4('0x1f')],queues[_0x312444['uniqueid']][_0x56c4('0x5d')]));delete queues[_0x312444[_0x56c4('0x5')]][_0x56c4('0x66')];}}}catch(_0x2078eb){utils[_0x56c4('0x38')](util[_0x56c4('0x3')](_0x56c4('0x68'),_0x312444[_0x56c4('0x5')]),_0x2078eb);}}; \ No newline at end of file +var _0x5360=['origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transferuniqueid','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','queuecallerexitreason','getVoiceQueueByName','type','CreateVoiceQueueReport','uniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','transfereduniqueid','queuecallerenterreason','[%s][queues][varset]','isNil','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','variable','queueposition','queuecallerabandon','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerjoinAt','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','accountcode','lastAssignedTo','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5360,0x157));var _0x0536=function(_0x13dbe5,_0xaa3576){_0x13dbe5=_0x13dbe5-0x0;var _0x57e4d8=_0x5360[_0x13dbe5];return _0x57e4d8;};'use strict';var _=require(_0x0536('0x0'));var util=require(_0x0536('0x1'));var utils=require(_0x0536('0x2'));var queues={};function writeDB(_0x3c652b){utils['info'](util['format'](_0x0536('0x3'),_0x3c652b['uniqueid'],_0x3c652b[_0x0536('0x4')],_0x3c652b[_0x0536('0x5')],_0x3c652b['lastAssignedTo'],_0x3c652b['calleridnum'],_0x3c652b['accountcode'],_0x3c652b[_0x0536('0x6')]));if(_0x3c652b[_0x0536('0x5')]){utils[_0x0536('0x7')](_0x3c652b[_0x0536('0x5')])['then'](function(_0x180b94){if(_0x180b94){_0x3c652b[_0x0536('0x8')]=_0x180b94[_0x0536('0x8')];}utils['request'](_0x0536('0x9'),_0x3c652b);});}else{utils['request']('CreateVoiceQueueReport',_0x3c652b);}if(_0x3c652b['transfereduniqueid']){delete queues[_0x3c652b['transfereduniqueid']];}else{delete queues[_0x3c652b[_0x0536('0xa')]];}}exports[_0x0536('0xb')]=function(_0x25b060){try{utils[_0x0536('0xc')](util[_0x0536('0xd')](_0x0536('0xe'),_0x25b060[_0x0536('0xa')]),_0x25b060);utils[_0x0536('0xf')](util[_0x0536('0xd')](_0x0536('0x10'),_0x25b060[_0x0536('0xa')],_0x25b060[_0x0536('0x5')],_0x25b060[_0x0536('0x11')]));queues[_0x25b060['uniqueid']]=_[_0x0536('0x12')](_0x25b060,{'originalposition':_0x25b060[_0x0536('0x11')],'queuecallerjoinAt':utils[_0x0536('0x13')](),'mohtime':0x0});}catch(_0x4720c2){utils[_0x0536('0x14')](util['format'](_0x0536('0xe'),_0x25b060[_0x0536('0xa')]),_0x4720c2);}};exports[_0x0536('0x15')]=function(_0x1ff4f9){try{if(!_['isNil'](queues[_0x1ff4f9['uniqueid']])){utils[_0x0536('0xc')](util[_0x0536('0xd')](_0x0536('0x16'),_0x1ff4f9['uniqueid']),_0x1ff4f9);if(queues[_0x1ff4f9['uniqueid']][_0x0536('0x17')]){if(!queues[_0x1ff4f9[_0x0536('0xa')]]['queuecallerabandon']&&!queues[_0x1ff4f9[_0x0536('0xa')]][_0x0536('0x18')]){queues[_0x1ff4f9[_0x0536('0xa')]][_0x0536('0x19')]=!![];queues[_0x1ff4f9[_0x0536('0xa')]]['queuecallercompleteAt']=utils[_0x0536('0x13')]();queues[_0x1ff4f9['uniqueid']]['queuecallerexitreason']=_0x0536('0x1a');}utils[_0x0536('0xf')](util[_0x0536('0xd')](_0x0536('0x1b'),_0x1ff4f9[_0x0536('0xa')],queues[_0x1ff4f9[_0x0536('0xa')]][_0x0536('0x1c')],queues[_0x1ff4f9['uniqueid']][_0x0536('0x6')]));writeDB(queues[_0x1ff4f9[_0x0536('0xa')]]);}else if(queues[_0x1ff4f9['uniqueid']][_0x0536('0x1d')]){utils[_0x0536('0xf')](util[_0x0536('0xd')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x1ff4f9[_0x0536('0xa')],queues[_0x1ff4f9[_0x0536('0xa')]][_0x0536('0x1c')],queues[_0x1ff4f9['uniqueid']][_0x0536('0x1d')]));queues[queues[_0x1ff4f9[_0x0536('0xa')]][_0x0536('0x1d')]]=queues[_0x1ff4f9[_0x0536('0xa')]];queues[queues[_0x1ff4f9[_0x0536('0xa')]][_0x0536('0x1d')]][_0x0536('0x1e')]=0x2;delete queues[_0x1ff4f9[_0x0536('0xa')]];}}}catch(_0x11cfef){utils[_0x0536('0x14')](util['format'](_0x0536('0x16'),_0x1ff4f9[_0x0536('0xa')]),_0x11cfef);}};exports['varset']=function(_0x3be6c1){try{utils[_0x0536('0xc')](util[_0x0536('0xd')](_0x0536('0x1f'),_0x3be6c1['uniqueid']),_0x3be6c1);if(!_[_0x0536('0x20')](_0x3be6c1['variable']['queuestatus'])&&_0x3be6c1[_0x0536('0x21')][_0x0536('0x22')]()!==_0x0536('0x23')){if(!_[_0x0536('0x20')](queues[_0x3be6c1[_0x0536('0xa')]])){queues[_0x3be6c1[_0x0536('0xa')]]['queuecallerabandon']=![];queues[_0x3be6c1[_0x0536('0xa')]][_0x0536('0x24')]=null;queues[_0x3be6c1['uniqueid']][_0x0536('0x18')]=!![];queues[_0x3be6c1['uniqueid']][_0x0536('0x25')]=utils[_0x0536('0x13')]();queues[_0x3be6c1[_0x0536('0xa')]][_0x0536('0x6')]=_0x3be6c1[_0x0536('0x21')][_0x0536('0x22')]();utils['info'](util[_0x0536('0xd')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x3be6c1['uniqueid'],queues[_0x3be6c1[_0x0536('0xa')]][_0x0536('0x1c')],_0x3be6c1[_0x0536('0x21')],queues[_0x3be6c1['uniqueid']][_0x0536('0x6')]));writeDB(queues[_0x3be6c1[_0x0536('0xa')]]);}}else if(!_[_0x0536('0x20')](_0x3be6c1[_0x0536('0x26')][_0x0536('0x27')])){if(!_['isNil'](queues[_0x3be6c1[_0x0536('0xa')]])&&!queues[_0x3be6c1[_0x0536('0xa')]][_0x0536('0x28')]){queues[_0x3be6c1[_0x0536('0xa')]][_0x0536('0x28')]=![];queues[_0x3be6c1['uniqueid']][_0x0536('0x24')]=null;queues[_0x3be6c1['uniqueid']][_0x0536('0x18')]=!![];queues[_0x3be6c1[_0x0536('0xa')]][_0x0536('0x25')]=utils['now']();queues[_0x3be6c1[_0x0536('0xa')]][_0x0536('0x6')]=_0x0536('0x29');utils[_0x0536('0xf')](util['format'](_0x0536('0x2a'),_0x3be6c1[_0x0536('0xa')],queues[_0x3be6c1['uniqueid']][_0x0536('0x1c')],_0x3be6c1['value'],queues[_0x3be6c1['uniqueid']][_0x0536('0x6')]));}}}catch(_0x17fad0){utils[_0x0536('0x14')](util['format']('[%s][queues][varset]',_0x3be6c1['uniqueid']),_0x17fad0);}};exports[_0x0536('0x28')]=function(_0x3566d4){try{if(!_['isNil'](queues[_0x3566d4[_0x0536('0xa')]])){utils[_0x0536('0xc')](util[_0x0536('0xd')](_0x0536('0x2b'),_0x3566d4['uniqueid']),_0x3566d4);queues[_0x3566d4[_0x0536('0xa')]][_0x0536('0x18')]=![];queues[_0x3566d4[_0x0536('0xa')]][_0x0536('0x25')]=null;queues[_0x3566d4[_0x0536('0xa')]][_0x0536('0x28')]=!![];queues[_0x3566d4[_0x0536('0xa')]][_0x0536('0x24')]=utils['now']();queues[_0x3566d4[_0x0536('0xa')]][_0x0536('0x6')]=_0x0536('0x2c');utils['info'](util[_0x0536('0xd')](_0x0536('0x2d'),_0x3566d4[_0x0536('0xa')],queues[_0x3566d4[_0x0536('0xa')]][_0x0536('0x1c')],queues[_0x3566d4['uniqueid']][_0x0536('0x6')]));}}catch(_0x3d4b33){utils['error'](util[_0x0536('0xd')](_0x0536('0x2b'),_0x3566d4[_0x0536('0xa')]),_0x3d4b33);}};exports[_0x0536('0x2e')]=function(_0xc81430){try{if(!_[_0x0536('0x20')](queues[_0xc81430[_0x0536('0xa')]])){utils['debug'](util['format'](_0x0536('0x2f'),_0xc81430[_0x0536('0xa')]),_0xc81430);utils[_0x0536('0xf')](util[_0x0536('0xd')](_0x0536('0x30'),_0xc81430[_0x0536('0xa')],queues[_0xc81430[_0x0536('0xa')]][_0x0536('0x1c')],_0xc81430['connectedlinenum'],_0xc81430[_0x0536('0x31')]));queues[_0xc81430[_0x0536('0xa')]]['queuecallerleave']=!![];queues[_0xc81430[_0x0536('0xa')]]['queuecallerleaveAt']=utils[_0x0536('0x13')]();queues[_0xc81430[_0x0536('0xa')]]['holdtime']=utils['diffTime'](queues[_0xc81430[_0x0536('0xa')]][_0x0536('0x17')],queues[_0xc81430[_0x0536('0xa')]][_0x0536('0x32')]);queues[_0xc81430[_0x0536('0xa')]][_0x0536('0x11')]=_0xc81430[_0x0536('0x11')];queues[_0xc81430[_0x0536('0xa')]][_0x0536('0x33')]=_0xc81430[_0x0536('0x33')];queues[_0xc81430[_0x0536('0xa')]][_0x0536('0x34')]=_0xc81430[_0x0536('0x34')];queues[_0xc81430['uniqueid']][_0x0536('0x31')]=_0xc81430[_0x0536('0x31')];}}catch(_0x21cd8d){utils['error'](util[_0x0536('0xd')](_0x0536('0x2f'),_0xc81430[_0x0536('0xa')]),_0x21cd8d);}};exports[_0x0536('0x35')]=function(_0x2f3652){try{if(!_['isNil'](queues[_0x2f3652[_0x0536('0xa')]])){utils[_0x0536('0xc')](util[_0x0536('0xd')](_0x0536('0x36'),_0x2f3652[_0x0536('0xa')]),_0x2f3652);utils[_0x0536('0xf')](util[_0x0536('0xd')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2f3652[_0x0536('0xa')],queues[_0x2f3652[_0x0536('0xa')]]['name'],_0x2f3652['membername'],_0x2f3652[_0x0536('0x37')]));queues[_0x2f3652[_0x0536('0xa')]][_0x0536('0x28')]=![];queues[_0x2f3652[_0x0536('0xa')]][_0x0536('0x28')]=![];queues[_0x2f3652['uniqueid']][_0x0536('0x24')]=null;queues[_0x2f3652['uniqueid']][_0x0536('0x18')]=![];queues[_0x2f3652[_0x0536('0xa')]][_0x0536('0x6')]=null;queues[_0x2f3652[_0x0536('0xa')]][_0x0536('0x25')]=null;queues[_0x2f3652[_0x0536('0xa')]][_0x0536('0x38')]=!![];queues[_0x2f3652[_0x0536('0xa')]][_0x0536('0x39')]=_0x2f3652[_0x0536('0x37')];queues[_0x2f3652[_0x0536('0xa')]][_0x0536('0x3a')]=_0x2f3652[_0x0536('0x3b')];}}catch(_0x27ce95){utils['error'](util['format']('[%s][queues][agentconnect]',_0x2f3652['uniqueid']),_0x27ce95);}};exports[_0x0536('0x3c')]=function(_0x4e05f2){try{if(!_['isNil'](queues[_0x4e05f2[_0x0536('0xa')]])){if(queues[_0x4e05f2[_0x0536('0xa')]][_0x0536('0x17')]){utils[_0x0536('0xc')](util['format'](_0x0536('0x3d'),_0x4e05f2[_0x0536('0xa')]),_0x4e05f2);queues[_0x4e05f2[_0x0536('0xa')]][_0x0536('0x28')]=![];queues[_0x4e05f2['uniqueid']][_0x0536('0x28')]=![];queues[_0x4e05f2['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4e05f2[_0x0536('0xa')]][_0x0536('0x18')]=![];queues[_0x4e05f2[_0x0536('0xa')]][_0x0536('0x25')]=null;queues[_0x4e05f2[_0x0536('0xa')]][_0x0536('0x38')]=!![];queues[_0x4e05f2[_0x0536('0xa')]][_0x0536('0x3a')]=_0x4e05f2[_0x0536('0x3b')];queues[_0x4e05f2['uniqueid']][_0x0536('0x19')]=!![];queues[_0x4e05f2[_0x0536('0xa')]][_0x0536('0x3e')]=utils[_0x0536('0x13')]();if(_0x4e05f2[_0x0536('0x3f')]==_0x0536('0x40')){if(!queues[_0x4e05f2[_0x0536('0xa')]][_0x0536('0x40')]){queues[_0x4e05f2[_0x0536('0xa')]]['queuecallerexitreason']=_0x0536('0x41');}}else{queues[_0x4e05f2[_0x0536('0xa')]][_0x0536('0x6')]=_0x0536('0x42')+_0x4e05f2[_0x0536('0x3f')][_0x0536('0x22')]();}utils[_0x0536('0xf')](util['format'](_0x0536('0x43'),_0x4e05f2[_0x0536('0xa')],queues[_0x4e05f2['uniqueid']][_0x0536('0x1c')],_0x4e05f2[_0x0536('0x3b')],queues[_0x4e05f2['uniqueid']][_0x0536('0x6')]));writeDB(queues[_0x4e05f2[_0x0536('0xa')]]);}}}catch(_0x508700){utils['error'](util[_0x0536('0xd')](_0x0536('0x3d'),_0x4e05f2[_0x0536('0xa')]),_0x508700);}};exports[_0x0536('0x44')]=function(_0x4ff51a){try{if(!_[_0x0536('0x20')](queues[_0x4ff51a[_0x0536('0x45')]])){utils['debug'](util[_0x0536('0xd')](_0x0536('0x46'),_0x4ff51a[_0x0536('0xa')]),_0x4ff51a);queues[_0x4ff51a[_0x0536('0x45')]][_0x0536('0x40')]=!![];queues[_0x4ff51a[_0x0536('0x45')]][_0x0536('0x47')]=_0x0536('0x48');queues[_0x4ff51a[_0x0536('0x45')]]['transferexten']=_0x4ff51a['extension'];queues[_0x4ff51a[_0x0536('0x45')]]['transferuniqueid']=_0x4ff51a[_0x0536('0x45')];queues[_0x4ff51a[_0x0536('0x45')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0x0536('0xf')](util[_0x0536('0xd')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x4ff51a[_0x0536('0xa')],queues[_0x4ff51a[_0x0536('0x45')]][_0x0536('0x1c')],_0x4ff51a[_0x0536('0x45')],_0x4ff51a['extension']));}}catch(_0x3b3283){utils[_0x0536('0x14')](util[_0x0536('0xd')]('[%s][queues][blindtransfer]',_0x4ff51a[_0x0536('0xa')]),_0x3b3283);}};exports[_0x0536('0x49')]=function(_0xb03ebc){try{utils['debug'](util[_0x0536('0xd')](_0x0536('0x4a'),_0xb03ebc[_0x0536('0x4b')]),_0xb03ebc);if(_0xb03ebc[_0x0536('0x4b')]==_0xb03ebc['origtransfererlinkedid']){if(!_['isNil'](queues[_0xb03ebc['secondtransfererlinkedid']])){utils[_0x0536('0xf')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0xb03ebc[_0x0536('0x4b')],queues[_0xb03ebc[_0x0536('0x4c')]]['name'],_0xb03ebc[_0x0536('0x4d')]));queues[_0xb03ebc[_0x0536('0x4c')]][_0x0536('0x40')]=!![];queues[_0xb03ebc[_0x0536('0x4c')]]['transfertype']=_0x0536('0x4e');queues[_0xb03ebc[_0x0536('0x4c')]][_0x0536('0x4f')]=_0xb03ebc[_0x0536('0x4d')];queues[_0xb03ebc[_0x0536('0x4c')]]['transferuniqueid']=_0xb03ebc[_0x0536('0x4b')];queues[_0xb03ebc[_0x0536('0x4c')]][_0x0536('0x6')]=_0x0536('0x50');}if(!_[_0x0536('0x20')](queues[_0xb03ebc[_0x0536('0x51')]])){if(_0xb03ebc['transfereelinkedid']&&queues[_0xb03ebc[_0x0536('0x52')]]){queues[_0xb03ebc[_0x0536('0x52')]][_0x0536('0x1e')]=0x1;queues[_0xb03ebc['transfereeuniqueid']]=_['clone'](queues[_0xb03ebc[_0x0536('0x52')]]);queues[_0xb03ebc[_0x0536('0x45')]][_0x0536('0x1d')]=_0xb03ebc[_0x0536('0x53')];queues[_0xb03ebc[_0x0536('0x45')]][_0x0536('0x1e')]=0x2;queues[_0xb03ebc[_0x0536('0x45')]][_0x0536('0x54')]=queues[_0xb03ebc[_0x0536('0x4c')]][_0x0536('0x54')];queues[_0xb03ebc[_0x0536('0x45')]][_0x0536('0x55')]=queues[_0xb03ebc[_0x0536('0x4c')]][_0x0536('0x55')];queues[_0xb03ebc['transfereeuniqueid']][_0x0536('0x32')]=utils[_0x0536('0x13')]();queues[_0xb03ebc[_0x0536('0x45')]][_0x0536('0x17')]=utils[_0x0536('0x13')]();queues[_0xb03ebc['transfereeuniqueid']][_0x0536('0x56')]=0x0;queues[_0xb03ebc['transfereeuniqueid']][_0x0536('0x57')]=0x0;utils[_0x0536('0xf')](util[_0x0536('0xd')](_0x0536('0x58'),_0xb03ebc[_0x0536('0x4b')],queues[_0xb03ebc[_0x0536('0x45')]][_0x0536('0x1c')],queues[_0xb03ebc[_0x0536('0x45')]][_0x0536('0x54')],queues[_0xb03ebc[_0x0536('0x45')]]['calleridname']));}else{utils[_0x0536('0xf')](util['format'](_0x0536('0x59'),_0xb03ebc[_0x0536('0x4b')],queues[_0xb03ebc[_0x0536('0x51')]][_0x0536('0x1c')],_0xb03ebc[_0x0536('0x4c')]));queues[_0xb03ebc[_0x0536('0x51')]][_0x0536('0x1d')]=_0xb03ebc[_0x0536('0x4c')];}}}else if(_0xb03ebc[_0x0536('0x5a')]==_0xb03ebc['secondtransfererlinkedid']){if(!_[_0x0536('0x20')](queues[_0xb03ebc[_0x0536('0x51')]])){utils[_0x0536('0xf')](util['format'](_0x0536('0x5b'),_0xb03ebc[_0x0536('0x4b')],queues[_0xb03ebc[_0x0536('0x51')]][_0x0536('0x1c')],_0xb03ebc[_0x0536('0x5a')],_0xb03ebc[_0x0536('0x5c')]));queues[_0xb03ebc['origtransfererlinkedid']][_0x0536('0x40')]=!![];queues[_0xb03ebc[_0x0536('0x51')]]['transfertype']=_0x0536('0x4e');queues[_0xb03ebc[_0x0536('0x51')]][_0x0536('0x4f')]=_0xb03ebc['secondtransfererexten'];queues[_0xb03ebc[_0x0536('0x51')]][_0x0536('0x5d')]=_0xb03ebc[_0x0536('0x5a')];queues[_0xb03ebc[_0x0536('0x51')]][_0x0536('0x6')]=_0x0536('0x50');}if(!_['isNil'](queues[_0xb03ebc[_0x0536('0x4c')]])){if(_0xb03ebc[_0x0536('0x5e')]&&queues[_0xb03ebc[_0x0536('0x5e')]]){queues[_0xb03ebc[_0x0536('0x5e')]][_0x0536('0x1e')]=0x1;queues[_0xb03ebc[_0x0536('0x53')]]=_[_0x0536('0x5f')](queues[_0xb03ebc['transfertargetlinkedid']]);queues[_0xb03ebc['transfertargetuniqueid']][_0x0536('0x1d')]=_0xb03ebc[_0x0536('0x53')];queues[_0xb03ebc[_0x0536('0x53')]]['queuecallerenterreason']=0x2;queues[_0xb03ebc[_0x0536('0x53')]][_0x0536('0x54')]=queues[_0xb03ebc[_0x0536('0x51')]]['calleridnum'];queues[_0xb03ebc['transfertargetuniqueid']][_0x0536('0x55')]=queues[_0xb03ebc[_0x0536('0x51')]]['calleridname'];queues[_0xb03ebc[_0x0536('0x53')]]['queuecallerjoinAt']=utils['now']();queues[_0xb03ebc[_0x0536('0x53')]][_0x0536('0x17')]=utils[_0x0536('0x13')]();queues[_0xb03ebc[_0x0536('0x53')]][_0x0536('0x56')]=0x0;queues[_0xb03ebc[_0x0536('0x53')]][_0x0536('0x57')]=0x0;utils[_0x0536('0xf')](util[_0x0536('0xd')](_0x0536('0x60'),_0xb03ebc['origtransfereruniqueid'],queues[_0xb03ebc[_0x0536('0x53')]][_0x0536('0x1c')],queues[_0xb03ebc[_0x0536('0x53')]][_0x0536('0x1d')],queues[_0xb03ebc[_0x0536('0x53')]]['calleridnum'],queues[_0xb03ebc[_0x0536('0x53')]][_0x0536('0x55')]));}else{utils['info'](util[_0x0536('0xd')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0xb03ebc[_0x0536('0x4b')],queues[_0xb03ebc['secondtransfererlinkedid']][_0x0536('0x1c')],_0xb03ebc[_0x0536('0x51')]));queues[_0xb03ebc[_0x0536('0x4c')]][_0x0536('0x1d')]=_0xb03ebc['origtransfererlinkedid'];}}}}catch(_0x5ed4c7){utils[_0x0536('0x14')](util[_0x0536('0xd')](_0x0536('0x4a'),_0xb03ebc['origtransfereruniqueid']),_0x5ed4c7);}};exports[_0x0536('0x61')]=function(_0x269986){try{if(!_[_0x0536('0x20')](queues[_0x269986[_0x0536('0xa')]])){utils[_0x0536('0xc')](util[_0x0536('0xd')](_0x0536('0x62'),_0x269986[_0x0536('0xa')]),_0x269986);queues[_0x269986[_0x0536('0xa')]][_0x0536('0x63')]=utils[_0x0536('0x13')]();utils[_0x0536('0xf')](util[_0x0536('0xd')](_0x0536('0x64'),_0x269986[_0x0536('0xa')],queues[_0x269986[_0x0536('0xa')]][_0x0536('0x1c')],queues[_0x269986['uniqueid']][_0x0536('0x63')]));}}catch(_0x108ebd){utils['error'](util[_0x0536('0xd')]('[%s][queues][musiconholdstart]',_0x269986[_0x0536('0xa')]),_0x108ebd);}};exports[_0x0536('0x65')]=function(_0x1b693f){try{if(!_[_0x0536('0x20')](queues[_0x1b693f[_0x0536('0xa')]])){if(!_[_0x0536('0x20')](queues[_0x1b693f[_0x0536('0xa')]][_0x0536('0x63')])){utils[_0x0536('0xc')](util[_0x0536('0xd')](_0x0536('0x66'),_0x1b693f[_0x0536('0xa')]),_0x1b693f);queues[_0x1b693f['uniqueid']][_0x0536('0x57')]+=utils[_0x0536('0x67')](utils[_0x0536('0x13')](),queues[_0x1b693f[_0x0536('0xa')]]['musiconholdstartAt']);utils[_0x0536('0xf')](util[_0x0536('0xd')](_0x0536('0x68'),_0x1b693f[_0x0536('0xa')],queues[_0x1b693f[_0x0536('0xa')]][_0x0536('0x1c')],queues[_0x1b693f[_0x0536('0xa')]][_0x0536('0x57')]));delete queues[_0x1b693f[_0x0536('0xa')]][_0x0536('0x63')];}}}catch(_0x55dc42){utils['error'](util['format'](_0x0536('0x66'),_0x1b693f[_0x0536('0xa')]),_0x55dc42);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 91c866d..38a75d6 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 _0x473a=['[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','membername','UserId','request','CreateVoiceRecording','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','varset','variable','mixmonitor_filename'];(function(_0x2c4c63,_0x269e93){var _0xd69c85=function(_0x67e088){while(--_0x67e088){_0x2c4c63['push'](_0x2c4c63['shift']());}};_0xd69c85(++_0x269e93);}(_0x473a,0x1cd));var _0xa473=function(_0xf96d53,_0x5ac611){_0xf96d53=_0xf96d53-0x0;var _0x2895a2=_0x473a[_0xf96d53];return _0x2895a2;};'use strict';var _=require(_0xa473('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x28d027){utils[_0xa473('0x1')](util[_0xa473('0x2')](_0xa473('0x3'),_0x28d027[_0xa473('0x4')]));if(_0x28d027[_0xa473('0x5')]){utils[_0xa473('0x6')](_0x28d027[_0xa473('0x5')])['then'](function(_0x1c809e){if(_0x1c809e){_0x28d027[_0xa473('0x7')]=_0x1c809e['name'];_0x28d027[_0xa473('0x8')]=_0x1c809e['id'];}utils[_0xa473('0x9')](_0xa473('0xa'),_0x28d027);});}else{utils[_0xa473('0x9')](_0xa473('0xa'),_0x28d027);}}exports['newchannel']=function(_0xe0363c){try{utils[_0xa473('0xb')](util[_0xa473('0x2')]('[%s][recordings][newchannel]',_0xe0363c[_0xa473('0x4')]),_0xe0363c);if(_0xe0363c[_0xa473('0x4')]==_0xe0363c[_0xa473('0xc')]){utils[_0xa473('0x1')](util[_0xa473('0x2')](_0xa473('0xd'),_0xe0363c[_0xa473('0x4')],_0xe0363c[_0xa473('0xe')],_0xe0363c[_0xa473('0xf')]));recordings[_0xe0363c[_0xa473('0x4')]]={'uniqueid':_0xe0363c[_0xa473('0x4')],'accountcode':_0xe0363c[_0xa473('0x5')],'exten':_0xe0363c[_0xa473('0xf')],'context':_0xe0363c[_0xa473('0xe')],'channel':_0xe0363c[_0xa473('0x10')],'monitors':[]};}}catch(_0x58b859){utils[_0xa473('0x11')](util[_0xa473('0x2')]('[%s][recordings][newchannel]',_0xe0363c[_0xa473('0x4')]),_0x58b859);}};exports[_0xa473('0x12')]=function(_0x2b3312){try{utils['debug'](util['format'](_0xa473('0x13'),_0x2b3312[_0xa473('0x4')]),_0x2b3312);if(!_['isNil'](recordings[_0x2b3312[_0xa473('0x4')]])&&_0x2b3312[_0xa473('0x14')]==0x6){utils['info'](util[_0xa473('0x2')](_0xa473('0x15'),_0x2b3312[_0xa473('0x4')],_0x2b3312[_0xa473('0xe')],_0x2b3312['channel']));}else if(!_[_0xa473('0x16')](recordings[_0x2b3312[_0xa473('0xc')]])&&_0x2b3312[_0xa473('0x14')]==0x6&&_0x2b3312[_0xa473('0xe')]!=_0xa473('0x17')){utils[_0xa473('0x1')](util[_0xa473('0x2')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2b3312[_0xa473('0x4')],_0x2b3312[_0xa473('0xc')],_0x2b3312[_0xa473('0xe')],_0x2b3312[_0xa473('0x10')]));recordings[_0x2b3312[_0xa473('0xc')]]['accountcode']=_0x2b3312['accountcode'];}}catch(_0x3b3150){utils[_0xa473('0x11')](util['format'](_0xa473('0x13'),_0x2b3312[_0xa473('0x4')]),_0x3b3150);}};exports[_0xa473('0x18')]=function(_0xfad505){try{if(!_[_0xa473('0x16')](_0xfad505[_0xa473('0x19')])&&!_[_0xa473('0x16')](_0xfad505[_0xa473('0x19')][_0xa473('0x1a')])){utils[_0xa473('0xb')](util[_0xa473('0x2')](_0xa473('0x1b'),_0xfad505[_0xa473('0x4')]),_0xfad505);utils[_0xa473('0x1')](util[_0xa473('0x2')](_0xa473('0x1c'),_0xfad505['uniqueid'],_0xfad505[_0xa473('0x19')],_0xfad505[_0xa473('0x1d')]));if(_['endsWith'](_0xfad505[_0xa473('0x1d')],_0xa473('0x1e'))){_0xfad505[_0xa473('0x1d')]=_0xfad505[_0xa473('0x1d')][_0xa473('0x1f')](_0xa473('0x1e'),_0xa473('0x20'));}if(recordings[_0xfad505[_0xa473('0xc')]]){var _0x983bf5=_[_0xa473('0x21')](recordings[_0xfad505[_0xa473('0xc')]]['monitors'],{'value':_0xfad505[_0xa473('0x1d')]});if(_[_0xa473('0x16')](_0x983bf5)){recordings[_0xfad505['linkedid']][_0xa473('0x22')][_0xa473('0x23')]({'value':_0xfad505[_0xa473('0x1d')]});}}}}catch(_0x32530b){utils[_0xa473('0x11')](util[_0xa473('0x2')](_0xa473('0x1b'),_0xfad505['uniqueid']),_0x32530b);}};exports[_0xa473('0x24')]=function(_0x3bc05e){try{if(!_['isNil'](recordings[_0x3bc05e[_0xa473('0x4')]])){utils[_0xa473('0xb')](util['format'](_0xa473('0x25'),_0x3bc05e['uniqueid']),_0x3bc05e);utils[_0xa473('0x1')](util[_0xa473('0x2')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x3bc05e[_0xa473('0x4')],_0x3bc05e[_0xa473('0x26')],_0x3bc05e[_0xa473('0x27')],_0x3bc05e[_0xa473('0x28')]));recordings[_0x3bc05e['uniqueid']][_0xa473('0x26')]=_0x3bc05e[_0xa473('0x26')];recordings[_0x3bc05e[_0xa473('0x4')]]['calleridname']=_0x3bc05e[_0xa473('0x27')];recordings[_0x3bc05e[_0xa473('0x4')]][_0xa473('0x29')]=_0x3bc05e[_0xa473('0x29')];recordings[_0x3bc05e[_0xa473('0x4')]][_0xa473('0x2a')]=_0x3bc05e[_0xa473('0x2a')];if(recordings[_0x3bc05e['uniqueid']][_0xa473('0x2b')]==_0xa473('0x2c')&&recordings[_0x3bc05e[_0xa473('0x4')]]['accountcode']){recordings[_0x3bc05e[_0xa473('0x4')]][_0xa473('0x29')]=recordings[_0x3bc05e['uniqueid']][_0xa473('0x5')];recordings[_0x3bc05e[_0xa473('0x4')]][_0xa473('0x2a')]='';}recordings[_0x3bc05e[_0xa473('0x4')]][_0xa473('0x22')][_0xa473('0x2d')](function(_0x1f2aa6){var _0x4f46cf=_['clone'](recordings[_0x3bc05e['uniqueid']]);_0x4f46cf[_0xa473('0x1d')]=_0x1f2aa6['value'];writeDB(_0x4f46cf);});delete recordings[_0x3bc05e['uniqueid']];}}catch(_0x53135f){utils['error'](util[_0xa473('0x2')](_0xa473('0x25'),_0x3bc05e[_0xa473('0x4')]),_0x53135f);}};exports[_0xa473('0x2e')]=function(_0x5c1937){try{if(!_[_0xa473('0x16')](recordings[_0x5c1937['uniqueid']])){utils['debug'](util[_0xa473('0x2')]('[%s][recordings][newexten]',_0x5c1937[_0xa473('0x4')]),_0x5c1937);utils['info'](util['format'](_0xa473('0x2f'),_0x5c1937[_0xa473('0x4')],_0x5c1937[_0xa473('0x30')],_0x5c1937[_0xa473('0x31')]));if(_0x5c1937['application'][_0xa473('0x32')]()==_0xa473('0x33')&&_[_0xa473('0x34')](_0x5c1937[_0xa473('0x31')]['toLowerCase'](),'cdr')){var _0x1c5549=_0x5c1937[_0xa473('0x31')][_0xa473('0x35')]('=');var _0x3e6753=_0x1c5549[0x0][_0xa473('0x36')](_0x1c5549[0x0][_0xa473('0x37')]('(')+0x1,_0x1c5549[0x0][_0xa473('0x37')](')'));var _0x13ac48=_0x1c5549[0x1];recordings[_0x5c1937[_0xa473('0x4')]][_0x3e6753]=_0x13ac48;}}}catch(_0x38ea2a){utils[_0xa473('0x11')](util[_0xa473('0x2')](_0xa473('0x38'),_0x5c1937[_0xa473('0x4')]),_0x38ea2a);}};exports[_0xa473('0x39')]=function(_0x17c6a8){try{if(!_[_0xa473('0x16')](recordings[_0x17c6a8[_0xa473('0x4')]])){utils[_0xa473('0xb')](util['format'](_0xa473('0x3a'),_0x17c6a8[_0xa473('0x4')]),_0x17c6a8);utils['info'](util[_0xa473('0x2')](_0xa473('0x3b'),_0x17c6a8[_0xa473('0x4')],_0x17c6a8[_0xa473('0x3c')]));recordings[_0x17c6a8['uniqueid']][_0xa473('0x3c')]=_0x17c6a8[_0xa473('0x3c')];}}catch(_0x58e91e){utils['error'](util[_0xa473('0x2')](_0xa473('0x3a'),_0x17c6a8[_0xa473('0x4')]),_0x58e91e);}}; \ No newline at end of file +var _0x6f88=['[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','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','application','appdata','toLowerCase','set','cdr','split','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','util','info','format','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0x6f88,0x96));var _0x86f8=function(_0x3a4a0e,_0x5dcf22){_0x3a4a0e=_0x3a4a0e-0x0;var _0x4c0220=_0x6f88[_0x3a4a0e];return _0x4c0220;};'use strict';var _=require('lodash');var util=require(_0x86f8('0x0'));var utils=require('./utils');var recordings={};function writeDB(_0x381b06){utils[_0x86f8('0x1')](util[_0x86f8('0x2')]('[%s][recordings][writeDB]',_0x381b06[_0x86f8('0x3')]));if(_0x381b06[_0x86f8('0x4')]){utils[_0x86f8('0x5')](_0x381b06['accountcode'])[_0x86f8('0x6')](function(_0x37fcc0){if(_0x37fcc0){_0x381b06[_0x86f8('0x7')]=_0x37fcc0[_0x86f8('0x8')];_0x381b06[_0x86f8('0x9')]=_0x37fcc0['id'];}utils['request'](_0x86f8('0xa'),_0x381b06);});}else{utils[_0x86f8('0xb')](_0x86f8('0xa'),_0x381b06);}}exports[_0x86f8('0xc')]=function(_0x177a9b){try{utils[_0x86f8('0xd')](util[_0x86f8('0x2')](_0x86f8('0xe'),_0x177a9b[_0x86f8('0x3')]),_0x177a9b);if(_0x177a9b[_0x86f8('0x3')]==_0x177a9b['linkedid']){utils['info'](util[_0x86f8('0x2')](_0x86f8('0xf'),_0x177a9b[_0x86f8('0x3')],_0x177a9b[_0x86f8('0x10')],_0x177a9b['exten']));recordings[_0x177a9b[_0x86f8('0x3')]]={'uniqueid':_0x177a9b[_0x86f8('0x3')],'accountcode':_0x177a9b[_0x86f8('0x4')],'exten':_0x177a9b[_0x86f8('0x11')],'context':_0x177a9b['context'],'channel':_0x177a9b[_0x86f8('0x12')],'monitors':[]};}}catch(_0x59e7ea){utils[_0x86f8('0x13')](util[_0x86f8('0x2')](_0x86f8('0xe'),_0x177a9b[_0x86f8('0x3')]),_0x59e7ea);}};exports[_0x86f8('0x14')]=function(_0x22318a){try{utils[_0x86f8('0xd')](util[_0x86f8('0x2')](_0x86f8('0x15'),_0x22318a[_0x86f8('0x3')]),_0x22318a);if(!_[_0x86f8('0x16')](recordings[_0x22318a[_0x86f8('0x3')]])&&_0x22318a['channelstate']==0x6){utils['info'](util[_0x86f8('0x2')](_0x86f8('0x17'),_0x22318a['uniqueid'],_0x22318a['context'],_0x22318a[_0x86f8('0x12')]));}else if(!_[_0x86f8('0x16')](recordings[_0x22318a[_0x86f8('0x18')]])&&_0x22318a[_0x86f8('0x19')]==0x6&&_0x22318a[_0x86f8('0x10')]!=_0x86f8('0x1a')){utils[_0x86f8('0x1')](util['format'](_0x86f8('0x1b'),_0x22318a['uniqueid'],_0x22318a[_0x86f8('0x18')],_0x22318a[_0x86f8('0x10')],_0x22318a['channel']));recordings[_0x22318a[_0x86f8('0x18')]][_0x86f8('0x4')]=_0x22318a[_0x86f8('0x4')];}}catch(_0x3ac8ac){utils['error'](util[_0x86f8('0x2')](_0x86f8('0x15'),_0x22318a[_0x86f8('0x3')]),_0x3ac8ac);}};exports['varset']=function(_0x3daf4f){try{if(!_[_0x86f8('0x16')](_0x3daf4f[_0x86f8('0x1c')])&&!_[_0x86f8('0x16')](_0x3daf4f['variable'][_0x86f8('0x1d')])){utils[_0x86f8('0xd')](util['format']('[%s][recordings][varset]',_0x3daf4f[_0x86f8('0x3')]),_0x3daf4f);utils[_0x86f8('0x1')](util[_0x86f8('0x2')](_0x86f8('0x1e'),_0x3daf4f[_0x86f8('0x3')],_0x3daf4f[_0x86f8('0x1c')],_0x3daf4f['value']));if(_[_0x86f8('0x1f')](_0x3daf4f[_0x86f8('0x20')],'.wav49')){_0x3daf4f['value']=_0x3daf4f[_0x86f8('0x20')][_0x86f8('0x21')]('.wav49',_0x86f8('0x22'));}if(recordings[_0x3daf4f[_0x86f8('0x18')]]){var _0x2b7404=_[_0x86f8('0x23')](recordings[_0x3daf4f[_0x86f8('0x18')]][_0x86f8('0x24')],{'value':_0x3daf4f[_0x86f8('0x20')]});if(_[_0x86f8('0x16')](_0x2b7404)){recordings[_0x3daf4f[_0x86f8('0x18')]][_0x86f8('0x24')][_0x86f8('0x25')]({'value':_0x3daf4f[_0x86f8('0x20')]});}}}}catch(_0x104373){utils[_0x86f8('0x13')](util['format']('[%s][recordings][varset]',_0x3daf4f['uniqueid']),_0x104373);}};exports[_0x86f8('0x26')]=function(_0x24264d){try{if(!_[_0x86f8('0x16')](recordings[_0x24264d[_0x86f8('0x3')]])){utils[_0x86f8('0xd')](util[_0x86f8('0x2')](_0x86f8('0x27'),_0x24264d[_0x86f8('0x3')]),_0x24264d);utils[_0x86f8('0x1')](util['format'](_0x86f8('0x28'),_0x24264d[_0x86f8('0x3')],_0x24264d[_0x86f8('0x29')],_0x24264d[_0x86f8('0x2a')],_0x24264d[_0x86f8('0x2b')]));recordings[_0x24264d[_0x86f8('0x3')]]['calleridnum']=_0x24264d[_0x86f8('0x29')];recordings[_0x24264d['uniqueid']][_0x86f8('0x2a')]=_0x24264d[_0x86f8('0x2a')];recordings[_0x24264d[_0x86f8('0x3')]]['connectedlinenum']=_0x24264d[_0x86f8('0x2c')];recordings[_0x24264d[_0x86f8('0x3')]][_0x86f8('0x2d')]=_0x24264d['connectedlinename'];if(recordings[_0x24264d['uniqueid']]['type']==_0x86f8('0x2e')&&recordings[_0x24264d[_0x86f8('0x3')]]['accountcode']){recordings[_0x24264d[_0x86f8('0x3')]]['connectedlinenum']=recordings[_0x24264d[_0x86f8('0x3')]][_0x86f8('0x4')];recordings[_0x24264d['uniqueid']][_0x86f8('0x2d')]='';}recordings[_0x24264d[_0x86f8('0x3')]][_0x86f8('0x24')]['forEach'](function(_0x875fd3){var _0x38d4c=_[_0x86f8('0x2f')](recordings[_0x24264d[_0x86f8('0x3')]]);_0x38d4c[_0x86f8('0x20')]=_0x875fd3[_0x86f8('0x20')];writeDB(_0x38d4c);});delete recordings[_0x24264d[_0x86f8('0x3')]];}}catch(_0xdc5a0a){utils[_0x86f8('0x13')](util[_0x86f8('0x2')](_0x86f8('0x27'),_0x24264d[_0x86f8('0x3')]),_0xdc5a0a);}};exports[_0x86f8('0x30')]=function(_0x1dcd3a){try{if(!_[_0x86f8('0x16')](recordings[_0x1dcd3a[_0x86f8('0x3')]])){utils['debug'](util['format'](_0x86f8('0x31'),_0x1dcd3a['uniqueid']),_0x1dcd3a);utils[_0x86f8('0x1')](util['format'](_0x86f8('0x32'),_0x1dcd3a[_0x86f8('0x3')],_0x1dcd3a[_0x86f8('0x33')],_0x1dcd3a[_0x86f8('0x34')]));if(_0x1dcd3a['application'][_0x86f8('0x35')]()==_0x86f8('0x36')&&_['startsWith'](_0x1dcd3a[_0x86f8('0x34')][_0x86f8('0x35')](),_0x86f8('0x37'))){var _0x35e94c=_0x1dcd3a[_0x86f8('0x34')][_0x86f8('0x38')]('=');var _0x4aabaf=_0x35e94c[0x0]['substring'](_0x35e94c[0x0][_0x86f8('0x39')]('(')+0x1,_0x35e94c[0x0][_0x86f8('0x39')](')'));var _0x1d0a3e=_0x35e94c[0x1];recordings[_0x1dcd3a[_0x86f8('0x3')]][_0x4aabaf]=_0x1d0a3e;}}}catch(_0xc217fc){utils['error'](util[_0x86f8('0x2')](_0x86f8('0x31'),_0x1dcd3a[_0x86f8('0x3')]),_0xc217fc);}};exports['queuecallerjoin']=function(_0x287006){try{if(!_[_0x86f8('0x16')](recordings[_0x287006['uniqueid']])){utils[_0x86f8('0xd')](util[_0x86f8('0x2')](_0x86f8('0x3a'),_0x287006[_0x86f8('0x3')]),_0x287006);utils[_0x86f8('0x1')](util[_0x86f8('0x2')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x287006[_0x86f8('0x3')],_0x287006[_0x86f8('0x3b')]));recordings[_0x287006[_0x86f8('0x3')]][_0x86f8('0x3b')]=_0x287006[_0x86f8('0x3b')];}}catch(_0x30e7dc){utils[_0x86f8('0x13')](util[_0x86f8('0x2')](_0x86f8('0x3a'),_0x287006[_0x86f8('0x3')]),_0x30e7dc);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 24dbcd2..8e0f4d3 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 _0x21ad=['[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x21ad,0xd2));var _0xd21a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x21ad[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');function writeDB(_0x58d2a2){utils['info'](util['format'](_0xd21a('0x0'),_0x58d2a2[_0xd21a('0x1')]==='attended'?_0x58d2a2[_0xd21a('0x2')]:_0x58d2a2[_0xd21a('0x3')],_0x58d2a2[_0xd21a('0x1')]));utils[_0xd21a('0x4')](_0xd21a('0x5'),_0x58d2a2);}exports[_0xd21a('0x6')]={};exports[_0xd21a('0x7')]=function(_0x171e78){try{utils[_0xd21a('0x8')](util['format']('[%s][transfers][blindtransfer]',_0x171e78[_0xd21a('0x3')]),_0x171e78);utils['info'](util[_0xd21a('0x9')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x171e78[_0xd21a('0x3')],_0x171e78['transferercalleridnum'],_0x171e78['transferercalleridname'],_0x171e78[_0xd21a('0xa')],_0x171e78[_0xd21a('0xb')]));_0x171e78[_0xd21a('0x1')]=_0xd21a('0xc');exports[_0xd21a('0x6')][_0x171e78[_0xd21a('0xd')]]=_0x171e78;writeDB(_0x171e78);}catch(_0x49bb75){utils[_0xd21a('0xe')](util[_0xd21a('0x9')](_0xd21a('0xf'),_0x171e78[_0xd21a('0x3')]),_0x49bb75);}};exports['attendedtransfer']=function(_0x213ebc){try{utils[_0xd21a('0x8')](util[_0xd21a('0x9')](_0xd21a('0x10'),_0x213ebc[_0xd21a('0x2')]),_0x213ebc);utils['info'](util[_0xd21a('0x9')](_0xd21a('0x11'),_0x213ebc['origtransfereruniqueid'],_0x213ebc[_0xd21a('0x12')],_0x213ebc[_0xd21a('0x13')],_0x213ebc[_0xd21a('0x14')],_0x213ebc['transfertargetcalleridname']));_0x213ebc=_[_0xd21a('0x15')](_0x213ebc,{'transfererchannel':_0x213ebc[_0xd21a('0x16')],'transferercalleridnum':_0x213ebc[_0xd21a('0x12')],'transferercalleridname':_0x213ebc['origtransferercalleridname'],'transfererconnectedlinenum':_0x213ebc[_0xd21a('0x17')],'transfererconnectedlinename':_0x213ebc[_0xd21a('0x18')],'transfereraccountcode':_0x213ebc[_0xd21a('0x19')],'transferercontext':_0x213ebc[_0xd21a('0x1a')],'transfererexten':_0x213ebc['secondtransfererexten'],'transfererlinkedid':_0x213ebc[_0xd21a('0x1b')],'context':_0x213ebc[_0xd21a('0x1c')],'extension':_0x213ebc['origtransfererexten'],'type':'attended'});if(_['isNil'](_0x213ebc[_0xd21a('0x1d')])){_0x213ebc=_[_0xd21a('0x15')](_0x213ebc,{'transfereechannel':_0x213ebc[_0xd21a('0x1e')],'transfereecalleridnum':_0x213ebc[_0xd21a('0x14')],'transfereecalleridname':_0x213ebc['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x213ebc[_0xd21a('0x1f')],'transfereeconnectedlinename':_0x213ebc['transfertargetconnectedlinename'],'transfereeaccountcode':_0x213ebc['transfertargetaccountcode'],'transfereecontext':_0x213ebc[_0xd21a('0x20')],'transfereeexten':_0x213ebc[_0xd21a('0x21')],'transfereelinkedid':_0x213ebc[_0xd21a('0x22')]});}writeDB(_0x213ebc);}catch(_0x2e4db4){utils[_0xd21a('0xe')](util[_0xd21a('0x9')]('[%s][transfers][attendedtransfer]',_0x213ebc[_0xd21a('0x2')]),_0x2e4db4);}}; \ No newline at end of file +var _0x02b2=['transfertargetcalleridnum','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','error','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridnum','transfereecalleridname','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x2492bf,_0x4e196b){var _0x32e037=function(_0x35d1d9){while(--_0x35d1d9){_0x2492bf['push'](_0x2492bf['shift']());}};_0x32e037(++_0x4e196b);}(_0x02b2,0x1e4));var _0x202b=function(_0x173251,_0x245251){_0x173251=_0x173251-0x0;var _0x12a2ce=_0x02b2[_0x173251];return _0x12a2ce;};'use strict';var _=require(_0x202b('0x0'));var util=require('util');var utils=require(_0x202b('0x1'));function writeDB(_0x56542d){utils[_0x202b('0x2')](util[_0x202b('0x3')](_0x202b('0x4'),_0x56542d[_0x202b('0x5')]===_0x202b('0x6')?_0x56542d[_0x202b('0x7')]:_0x56542d[_0x202b('0x8')],_0x56542d['type']));utils['request'](_0x202b('0x9'),_0x56542d);}exports[_0x202b('0xa')]={};exports[_0x202b('0xb')]=function(_0x35fd7f){try{utils[_0x202b('0xc')](util[_0x202b('0x3')]('[%s][transfers][blindtransfer]',_0x35fd7f['uniqueid']),_0x35fd7f);utils[_0x202b('0x2')](util[_0x202b('0x3')](_0x202b('0xd'),_0x35fd7f['uniqueid'],_0x35fd7f['transferercalleridnum'],_0x35fd7f['transferercalleridname'],_0x35fd7f[_0x202b('0xe')],_0x35fd7f[_0x202b('0xf')]));_0x35fd7f['type']='blind';exports['blinds'][_0x35fd7f['transfereruniqueid']]=_0x35fd7f;writeDB(_0x35fd7f);}catch(_0x545f27){utils['error'](util[_0x202b('0x3')](_0x202b('0x10'),_0x35fd7f[_0x202b('0x8')]),_0x545f27);}};exports[_0x202b('0x11')]=function(_0x6c5f39){try{utils[_0x202b('0xc')](util['format'](_0x202b('0x12'),_0x6c5f39[_0x202b('0x7')]),_0x6c5f39);utils['info'](util[_0x202b('0x3')](_0x202b('0x13'),_0x6c5f39[_0x202b('0x7')],_0x6c5f39['origtransferercalleridnum'],_0x6c5f39['origtransferercalleridname'],_0x6c5f39[_0x202b('0x14')],_0x6c5f39['transfertargetcalleridname']));_0x6c5f39=_[_0x202b('0x15')](_0x6c5f39,{'transfererchannel':_0x6c5f39[_0x202b('0x16')],'transferercalleridnum':_0x6c5f39[_0x202b('0x17')],'transferercalleridname':_0x6c5f39[_0x202b('0x18')],'transfererconnectedlinenum':_0x6c5f39[_0x202b('0x19')],'transfererconnectedlinename':_0x6c5f39[_0x202b('0x1a')],'transfereraccountcode':_0x6c5f39[_0x202b('0x1b')],'transferercontext':_0x6c5f39[_0x202b('0x1c')],'transfererexten':_0x6c5f39[_0x202b('0x1d')],'transfererlinkedid':_0x6c5f39[_0x202b('0x1e')],'context':_0x6c5f39[_0x202b('0x1f')],'extension':_0x6c5f39[_0x202b('0x20')],'type':_0x202b('0x6')});if(_[_0x202b('0x21')](_0x6c5f39[_0x202b('0x22')])){_0x6c5f39=_['assign'](_0x6c5f39,{'transfereechannel':_0x6c5f39[_0x202b('0x23')],'transfereecalleridnum':_0x6c5f39[_0x202b('0x14')],'transfereecalleridname':_0x6c5f39[_0x202b('0x24')],'transfereeconnectedlinenum':_0x6c5f39['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x6c5f39[_0x202b('0x25')],'transfereeaccountcode':_0x6c5f39[_0x202b('0x26')],'transfereecontext':_0x6c5f39[_0x202b('0x27')],'transfereeexten':_0x6c5f39['transfertargetexten'],'transfereelinkedid':_0x6c5f39[_0x202b('0x28')]});}writeDB(_0x6c5f39);}catch(_0x259f38){utils[_0x202b('0x29')](util[_0x202b('0x3')]('[%s][transfers][attendedtransfer]',_0x6c5f39[_0x202b('0x7')]),_0x259f38);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 560a0ef..119fef5 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 _0xb10b=['util','client','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','moment'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xb10b,0x12a));var _0xbb10=function(_0x51f84a,_0x445f17){_0x51f84a=_0x51f84a-0x0;var _0x4ba63d=_0xb10b[_0x51f84a];return _0x4ba63d;};'use strict';var BPromise=require(_0xbb10('0x0'));var jayson=require('jayson/promise');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var client=jayson[_0xbb10('0x3')]['http']({'port':0x2329});var logger=require(_0xbb10('0x4'))(_0xbb10('0x5'));exports[_0xbb10('0x6')]=function(_0x22320e,_0x49baf4){logger[_0xbb10('0x6')](_0x22320e,_0x49baf4?util['inspect'](_0x49baf4,{'showHidden':![],'depth':null}):'');};exports[_0xbb10('0x7')]=function(_0x3cdd53,_0x513741){logger[_0xbb10('0x7')](_0x3cdd53,_0x513741?util[_0xbb10('0x8')](_0x513741,{'showHidden':![],'depth':null}):'');};exports[_0xbb10('0x9')]=function(_0x1c3ee5,_0x2353ef){logger[_0xbb10('0x9')](_0x1c3ee5,_0x2353ef?util[_0xbb10('0x8')](_0x2353ef,{'showHidden':![],'depth':null}):'');};exports[_0xbb10('0xa')]=function(_0x5ab04a,_0x4e47f8){return client[_0xbb10('0xa')](_0x5ab04a,{'body':_0x4e47f8})[_0xbb10('0xb')](function(_0xce64f3){logger['debug'](_0xbb10('0xc'),_0x5ab04a,_0xce64f3?util['inspect'](_0xce64f3,{'showHidden':![],'depth':null}):'');})[_0xbb10('0xd')](function(_0x916a32){logger[_0xbb10('0x9')](_0xbb10('0xc'),_0x5ab04a,_0x916a32?util[_0xbb10('0x8')](_0x916a32,{'showHidden':![],'depth':null}):'');});};function getUser(_0x147230){return client['request'](_0xbb10('0xe'),{'options':{'raw':!![],'attributes':['id',_0xbb10('0xf'),_0xbb10('0x10'),_0xbb10('0x11')],'where':_0x147230,'limit':0x1}})[_0xbb10('0xb')](function(_0x2f2ebf){logger[_0xbb10('0x7')](_0xbb10('0x12'),JSON[_0xbb10('0x13')](_0x147230),_0x2f2ebf?util[_0xbb10('0x8')](_0x2f2ebf,{'showHidden':![],'depth':null}):'');return _0x2f2ebf['result'][_0xbb10('0x14')]?_0x2f2ebf[_0xbb10('0x15')][0x0]:null;});}exports[_0xbb10('0x16')]=function(_0x42db98){return new BPromise(function(_0x378da8,_0x1682a4){if(_0x42db98){return getUser({'internal':_0x42db98})[_0xbb10('0xb')](function(_0x30efc6){logger[_0xbb10('0x6')](_0xbb10('0x17'),_0x42db98,_0x30efc6?'found':_0xbb10('0x18'));return _0x378da8(_0x30efc6);})[_0xbb10('0xd')](function(_0x388fab){logger[_0xbb10('0x9')](_0xbb10('0x19'),_0x388fab?util[_0xbb10('0x8')](_0x388fab,{'showHidden':![],'depth':null}):'');return _0x378da8(null);});}return _0x378da8(null);});};exports['getUserByInterface']=function(_0x12f888){return new BPromise(function(_0x12ef77,_0x50aea1){if(_0x12f888){return getUser({'interface':_0x12f888})['then'](function(_0x8e2b97){logger[_0xbb10('0x6')](_0xbb10('0x1a'),_0x12f888,_0x8e2b97?_0xbb10('0x1b'):_0xbb10('0x18'));return _0x12ef77(_0x8e2b97);})[_0xbb10('0xd')](function(_0x407cb4){logger[_0xbb10('0x9')](_0xbb10('0x1c'),_0x407cb4?util[_0xbb10('0x8')](_0x407cb4,{'showHidden':![],'depth':null}):'');return _0x12ef77(null);});}return _0x12ef77(null);});};exports[_0xbb10('0x1d')]=function(_0x26ad93){return new BPromise(function(_0x537898,_0x4fedac){if(_0x26ad93){return getUser({'name':_0x26ad93})['then'](function(_0xc93a04){logger[_0xbb10('0x6')](_0xbb10('0x1e'),_0x26ad93,_0xc93a04?'found':_0xbb10('0x18'));return _0x537898(_0xc93a04);})[_0xbb10('0xd')](function(_0x6ed43b){logger[_0xbb10('0x9')](_0xbb10('0x1f'),_0x6ed43b?util[_0xbb10('0x8')](_0x6ed43b,{'showHidden':![],'depth':null}):'');return _0x537898(null);});}return _0x537898(null);});};exports[_0xbb10('0x20')]=function(_0x4aabb9){return new BPromise(function(_0x3796c7,_0x21ac54){if(_0x4aabb9){return client[_0xbb10('0xa')](_0xbb10('0x21'),{'options':{'raw':!![],'attributes':['id',_0xbb10('0x10'),_0xbb10('0x22'),'acw',_0xbb10('0x23')],'where':{'name':_0x4aabb9},'limit':0x1}})['then'](function(_0x448d5c){logger['debug'](_0xbb10('0x24'),_0x4aabb9,_0x448d5c?util[_0xbb10('0x8')](_0x448d5c,{'showHidden':![],'depth':null}):'');logger[_0xbb10('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x4aabb9,_0x448d5c?'found':_0xbb10('0x18'));return _0x3796c7(_0x448d5c[_0xbb10('0x15')]['length']?_0x448d5c[_0xbb10('0x15')][0x0]:null);})[_0xbb10('0xd')](function(_0x2f653f){logger[_0xbb10('0x9')](_0xbb10('0x25'),_0x2f653f?util[_0xbb10('0x8')](_0x2f653f,{'showHidden':![],'depth':null}):'');return _0x3796c7(null);});}return _0x3796c7(null);});};exports[_0xbb10('0x26')]=function(_0x4975f5,_0x25acb3){return moment(_0x4975f5)[_0xbb10('0x27')](_0x25acb3,_0xbb10('0x28'))[_0xbb10('0x29')](_0xbb10('0x2a'));};exports[_0xbb10('0x2b')]=function(_0x188cbd,_0x10202c){return moment(_0x188cbd)[_0xbb10('0x2c')](_0x10202c,'seconds')[_0xbb10('0x29')](_0xbb10('0x2a'));};exports[_0xbb10('0x2d')]=function(_0x3c3c45,_0x570f5a){return moment(_0x3c3c45)[_0xbb10('0x2e')](moment(_0x570f5a),'seconds');};exports['sumTime']=function(_0x3eb3cc,_0x40c164){return parseInt(_0x3eb3cc,0xa)+parseInt(_0x40c164,0xa);};exports[_0xbb10('0x2f')]=function(){return moment()[_0xbb10('0x29')](_0xbb10('0x2a'));};exports[_0xbb10('0x30')]=function(_0x547062,_0x1e5bbd){if(_0x1e5bbd){return moment(_0x547062)[_0xbb10('0x30')](_0x1e5bbd);}return!![];};exports['isBefore']=function(_0x5e3fbd,_0x5cd55f){if(_0x5cd55f){return moment(_0x5e3fbd)[_0xbb10('0x31')](_0x5cd55f);}else if(_0x5e3fbd){return!![];}return![];}; \ No newline at end of file +var _0xb10b=['util','client','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','moment'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb10b,0x12a));var _0xbb10=function(_0xeab168,_0x30d561){_0xeab168=_0xeab168-0x0;var _0xbbf818=_0xb10b[_0xeab168];return _0xbbf818;};'use strict';var BPromise=require(_0xbb10('0x0'));var jayson=require('jayson/promise');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var client=jayson[_0xbb10('0x3')]['http']({'port':0x2329});var logger=require(_0xbb10('0x4'))(_0xbb10('0x5'));exports[_0xbb10('0x6')]=function(_0x22320e,_0x49baf4){logger[_0xbb10('0x6')](_0x22320e,_0x49baf4?util['inspect'](_0x49baf4,{'showHidden':![],'depth':null}):'');};exports[_0xbb10('0x7')]=function(_0x3cdd53,_0x513741){logger[_0xbb10('0x7')](_0x3cdd53,_0x513741?util[_0xbb10('0x8')](_0x513741,{'showHidden':![],'depth':null}):'');};exports[_0xbb10('0x9')]=function(_0x1c3ee5,_0x2353ef){logger[_0xbb10('0x9')](_0x1c3ee5,_0x2353ef?util[_0xbb10('0x8')](_0x2353ef,{'showHidden':![],'depth':null}):'');};exports[_0xbb10('0xa')]=function(_0x5ab04a,_0x4e47f8){return client[_0xbb10('0xa')](_0x5ab04a,{'body':_0x4e47f8})[_0xbb10('0xb')](function(_0xce64f3){logger['debug'](_0xbb10('0xc'),_0x5ab04a,_0xce64f3?util['inspect'](_0xce64f3,{'showHidden':![],'depth':null}):'');})[_0xbb10('0xd')](function(_0x916a32){logger[_0xbb10('0x9')](_0xbb10('0xc'),_0x5ab04a,_0x916a32?util[_0xbb10('0x8')](_0x916a32,{'showHidden':![],'depth':null}):'');});};function getUser(_0x147230){return client['request'](_0xbb10('0xe'),{'options':{'raw':!![],'attributes':['id',_0xbb10('0xf'),_0xbb10('0x10'),_0xbb10('0x11')],'where':_0x147230,'limit':0x1}})[_0xbb10('0xb')](function(_0x2f2ebf){logger[_0xbb10('0x7')](_0xbb10('0x12'),JSON[_0xbb10('0x13')](_0x147230),_0x2f2ebf?util[_0xbb10('0x8')](_0x2f2ebf,{'showHidden':![],'depth':null}):'');return _0x2f2ebf['result'][_0xbb10('0x14')]?_0x2f2ebf[_0xbb10('0x15')][0x0]:null;});}exports[_0xbb10('0x16')]=function(_0x42db98){return new BPromise(function(_0x378da8,_0x1682a4){if(_0x42db98){return getUser({'internal':_0x42db98})[_0xbb10('0xb')](function(_0x30efc6){logger[_0xbb10('0x6')](_0xbb10('0x17'),_0x42db98,_0x30efc6?'found':_0xbb10('0x18'));return _0x378da8(_0x30efc6);})[_0xbb10('0xd')](function(_0x388fab){logger[_0xbb10('0x9')](_0xbb10('0x19'),_0x388fab?util[_0xbb10('0x8')](_0x388fab,{'showHidden':![],'depth':null}):'');return _0x378da8(null);});}return _0x378da8(null);});};exports['getUserByInterface']=function(_0x12f888){return new BPromise(function(_0x12ef77,_0x50aea1){if(_0x12f888){return getUser({'interface':_0x12f888})['then'](function(_0x8e2b97){logger[_0xbb10('0x6')](_0xbb10('0x1a'),_0x12f888,_0x8e2b97?_0xbb10('0x1b'):_0xbb10('0x18'));return _0x12ef77(_0x8e2b97);})[_0xbb10('0xd')](function(_0x407cb4){logger[_0xbb10('0x9')](_0xbb10('0x1c'),_0x407cb4?util[_0xbb10('0x8')](_0x407cb4,{'showHidden':![],'depth':null}):'');return _0x12ef77(null);});}return _0x12ef77(null);});};exports[_0xbb10('0x1d')]=function(_0x26ad93){return new BPromise(function(_0x537898,_0x4fedac){if(_0x26ad93){return getUser({'name':_0x26ad93})['then'](function(_0xc93a04){logger[_0xbb10('0x6')](_0xbb10('0x1e'),_0x26ad93,_0xc93a04?'found':_0xbb10('0x18'));return _0x537898(_0xc93a04);})[_0xbb10('0xd')](function(_0x6ed43b){logger[_0xbb10('0x9')](_0xbb10('0x1f'),_0x6ed43b?util[_0xbb10('0x8')](_0x6ed43b,{'showHidden':![],'depth':null}):'');return _0x537898(null);});}return _0x537898(null);});};exports[_0xbb10('0x20')]=function(_0x4aabb9){return new BPromise(function(_0x3796c7,_0x21ac54){if(_0x4aabb9){return client[_0xbb10('0xa')](_0xbb10('0x21'),{'options':{'raw':!![],'attributes':['id',_0xbb10('0x10'),_0xbb10('0x22'),'acw',_0xbb10('0x23')],'where':{'name':_0x4aabb9},'limit':0x1}})['then'](function(_0x448d5c){logger['debug'](_0xbb10('0x24'),_0x4aabb9,_0x448d5c?util[_0xbb10('0x8')](_0x448d5c,{'showHidden':![],'depth':null}):'');logger[_0xbb10('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x4aabb9,_0x448d5c?'found':_0xbb10('0x18'));return _0x3796c7(_0x448d5c[_0xbb10('0x15')]['length']?_0x448d5c[_0xbb10('0x15')][0x0]:null);})[_0xbb10('0xd')](function(_0x2f653f){logger[_0xbb10('0x9')](_0xbb10('0x25'),_0x2f653f?util[_0xbb10('0x8')](_0x2f653f,{'showHidden':![],'depth':null}):'');return _0x3796c7(null);});}return _0x3796c7(null);});};exports[_0xbb10('0x26')]=function(_0x4975f5,_0x25acb3){return moment(_0x4975f5)[_0xbb10('0x27')](_0x25acb3,_0xbb10('0x28'))[_0xbb10('0x29')](_0xbb10('0x2a'));};exports[_0xbb10('0x2b')]=function(_0x188cbd,_0x10202c){return moment(_0x188cbd)[_0xbb10('0x2c')](_0x10202c,'seconds')[_0xbb10('0x29')](_0xbb10('0x2a'));};exports[_0xbb10('0x2d')]=function(_0x3c3c45,_0x570f5a){return moment(_0x3c3c45)[_0xbb10('0x2e')](moment(_0x570f5a),'seconds');};exports['sumTime']=function(_0x3eb3cc,_0x40c164){return parseInt(_0x3eb3cc,0xa)+parseInt(_0x40c164,0xa);};exports[_0xbb10('0x2f')]=function(){return moment()[_0xbb10('0x29')](_0xbb10('0x2a'));};exports[_0xbb10('0x30')]=function(_0x547062,_0x1e5bbd){if(_0x1e5bbd){return moment(_0x547062)[_0xbb10('0x30')](_0x1e5bbd);}return!![];};exports['isBefore']=function(_0x5e3fbd,_0x5cd55f){if(_0x5cd55f){return moment(_0x5e3fbd)[_0xbb10('0x31')](_0x5cd55f);}else if(_0x5e3fbd){return!![];}return![];}; \ No newline at end of file